From: support Date: Tue, 28 Jun 2022 17:50:20 +0000 (+0000) Subject: Built motion from commit 905d04ca.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=b5575e209fa9d0837e26581be287cf95e8bb37f2;p=motion2.git Built motion from commit 905d04ca.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 752ffc7..c183f5a 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-06-27T10:53:29.357Z", + "time": "2022-06-28T17:41:41.712Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 93e4371..1850a6a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-27T10:53:29.357Z", + "time": "2022-06-28T17:41:41.712Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/gaxios/build/src/gaxios.js b/legacy-libs/gaxios/build/src/gaxios.js index f8ac274..d5d40ea 100644 --- a/legacy-libs/gaxios/build/src/gaxios.js +++ b/legacy-libs/gaxios/build/src/gaxios.js @@ -1,4 +1,5 @@ "use strict"; +require('core-js/web') // Copyright 2018, Google, LLC. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 224f778..e853f1b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -88,9 +88,9 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz" }, "acorn": { - "version": "5.7.1", - "from": "acorn@5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz" + "version": "6.4.2", + "from": "acorn@6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" }, "acorn-globals": { "version": "4.3.4", @@ -354,7 +354,14 @@ "babel-runtime": { "version": "6.26.0", "from": "babel-runtime@>=6.26.0 <7.0.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz" + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "dependencies": { + "core-js": { + "version": "2.6.12", + "from": "core-js@>=2.4.0 <3.0.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" + } + } }, "babel-types": { "version": "6.26.0", @@ -915,9 +922,9 @@ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" }, "core-js": { - "version": "2.6.12", - "from": "core-js@>=2.4.0 <3.0.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz" + "version": "3.23.3", + "from": "core-js@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.23.3.tgz" }, "core-util-is": { "version": "1.0.2", @@ -2452,6 +2459,11 @@ "from": "jsdom@12.0.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-12.0.0.tgz", "dependencies": { + "acorn": { + "version": "5.7.4", + "from": "acorn@>=5.7.1 <6.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz" + }, "ajv": { "version": "6.12.6", "from": "ajv@>=6.12.3 <7.0.0", diff --git a/package.json b/package.json index 2465c10..40ed927 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "dependencies": { "@types/express-serve-static-core": "4.17.28", "@types/node": "6.14.13", - "acorn": "5.7.1", + "acorn": "^6.4.2", "activedirectory2": "2.1.0", "apiai-promise": "git+https://github.com/gcareri/apiai-promise.git", "archiver": "2.1.1", @@ -63,6 +63,7 @@ "composable-middleware": "0.3.0", "connect-timeout": "1.9.0", "cookie-parser": "1.4.5", + "core-js": "^3.23.3", "cors": "2.8.5", "cron-job-manager": "1.0.7", "crypto-js": "3.1.9-1", @@ -155,7 +156,6 @@ "zip-dir": "1.0.2" }, "devDependencies": { - "acorn": "6.4.2", "apidoc": "0.24.0", "chai": "3.5.0", "chai-http": "3.0.0", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index e05e143..67c1168 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 _0x4951=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','getDataValue'];(function(_0xad2680,_0x46aeda){var _0x16a60b=function(_0x204606){while(--_0x204606){_0xad2680['push'](_0xad2680['shift']());}};_0x16a60b(++_0x46aeda);}(_0x4951,0x11f));var _0x1495=function(_0x3a9236,_0x50ab9d){_0x3a9236=_0x3a9236-0x0;var _0x5b0ba6=_0x4951[_0x3a9236];return _0x5b0ba6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x34d3c7){return this[_0x1495('0x0')](_0x1495('0x1'));}},'action':{'type':Sequelize[_0x1495('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1495('0x3'),_0x1495('0x4'),_0x1495('0x5'),_0x1495('0x6'),_0x1495('0x7'),_0x1495('0x8'),_0x1495('0x9'),_0x1495('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1495('0xb')},'data1':{'type':Sequelize[_0x1495('0x2')](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[_0x1495('0x2')](0x1000),'comment':_0x1495('0xc')},'data3':{'type':Sequelize[_0x1495('0x2')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':_0x1495('0xd')},'data5':{'type':Sequelize[_0x1495('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x1495('0xe')},'data7':{'type':Sequelize[_0x1495('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x6da6=['exports','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','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)]','TEXT'];(function(_0xd98789,_0xfb0fd3){var _0x571bd9=function(_0xfad74){while(--_0xfad74){_0xd98789['push'](_0xd98789['shift']());}};_0x571bd9(++_0xfb0fd3);}(_0x6da6,0xa5));var _0x66da=function(_0xaca3f,_0x52732c){_0xaca3f=_0xaca3f-0x0;var _0x386c4d=_0x6da6[_0xaca3f];return _0x386c4d;};'use strict';var Sequelize=require('sequelize');module[_0x66da('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3844db){return this['getDataValue'](_0x66da('0x1'));}},'action':{'type':Sequelize[_0x66da('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x66da('0x3'),_0x66da('0x4'),_0x66da('0x5'),_0x66da('0x6'),_0x66da('0x7'),_0x66da('0x8'),_0x66da('0x9'),_0x66da('0xa')]],'msg':_0x66da('0xb')}},'comment':_0x66da('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[_0x66da('0x2')](0x1000),'comment':_0x66da('0xc')},'data3':{'type':Sequelize[_0x66da('0x2')](0x1000),'comment':_0x66da('0xd')},'data4':{'type':Sequelize[_0x66da('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x66da('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x66da('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index e027206..fc943bc 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 _0xa8f0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service'];(function(_0x357024,_0x4b9d34){var _0x2d1058=function(_0x39a38a){while(--_0x39a38a){_0x357024['push'](_0x357024['shift']());}};_0x2d1058(++_0x4b9d34);}(_0xa8f0,0x160));var _0x0a8f=function(_0x473e3f,_0x2f0947){_0x473e3f=_0x473e3f-0x0;var _0x59399b=_0xa8f0[_0x473e3f];return _0x59399b;};'use strict';var emlformat=require(_0x0a8f('0x0'));var rimraf=require(_0x0a8f('0x1'));var zipdir=require(_0x0a8f('0x2'));var jsonpatch=require(_0x0a8f('0x3'));var rp=require(_0x0a8f('0x4'));var moment=require('moment');var BPromise=require(_0x0a8f('0x5'));var Mustache=require(_0x0a8f('0x6'));var util=require('util');var path=require(_0x0a8f('0x7'));var sox=require(_0x0a8f('0x8'));var csv=require(_0x0a8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a8f('0xa'));var _=require('lodash');var squel=require(_0x0a8f('0xb'));var crypto=require(_0x0a8f('0xc'));var jsforce=require(_0x0a8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0a8f('0x9'));var querystring=require(_0x0a8f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0a8f('0xf'));var qs=require(_0x0a8f('0x10'));var as=require(_0x0a8f('0x11'));var hardwareService=require(_0x0a8f('0x12'));var logger=require(_0x0a8f('0x13'))(_0x0a8f('0x14'));var utils=require('../../config/utils');var config=require(_0x0a8f('0x15'));var licenseUtil=require(_0x0a8f('0x16'));var db=require(_0x0a8f('0x17'))['db'];function respondWithStatusCode(_0x126924,_0x362c7d){_0x362c7d=_0x362c7d||0xcc;return function(_0xd9c02f){if(_0xd9c02f){return _0x126924['sendStatus'](_0x362c7d);}return _0x126924[_0x0a8f('0x18')](_0x362c7d)[_0x0a8f('0x19')]();};}function respondWithResult(_0x5f0e49,_0x29eabe){_0x29eabe=_0x29eabe||0xc8;return function(_0x5c4bed){if(_0x5c4bed){return _0x5f0e49['status'](_0x29eabe)[_0x0a8f('0x1a')](_0x5c4bed);}};}function respondWithFilteredResult(_0x2219d6,_0x5691b0){return function(_0x5bf83d){if(_0x5bf83d){var _0x2b8870=typeof _0x5691b0['offset']===_0x0a8f('0x1b')&&typeof _0x5691b0[_0x0a8f('0x1c')]===_0x0a8f('0x1b');var _0x43cda5=_0x5bf83d[_0x0a8f('0x1d')];var _0x3162ef=_0x2b8870?0x0:_0x5691b0[_0x0a8f('0x1e')];var _0xecb7df=_0x2b8870?_0x5bf83d['count']:_0x5691b0[_0x0a8f('0x1e')]+_0x5691b0[_0x0a8f('0x1c')];var _0x397a19;if(_0xecb7df>=_0x43cda5){_0xecb7df=_0x43cda5;_0x397a19=0xc8;}else{_0x397a19=0xce;}_0x2219d6[_0x0a8f('0x18')](_0x397a19);return _0x2219d6['set'](_0x0a8f('0x1f'),_0x3162ef+'-'+_0xecb7df+'/'+_0x43cda5)[_0x0a8f('0x1a')](_0x5bf83d);}return null;};}function patchUpdates(_0x276063){return function(_0x494cb2){try{jsonpatch[_0x0a8f('0x20')](_0x494cb2,_0x276063,!![]);}catch(_0x48356f){return BPromise['reject'](_0x48356f);}return _0x494cb2[_0x0a8f('0x21')]();};}function saveUpdates(_0x57cbfc,_0x4634c1){return function(_0xf3593a){if(_0xf3593a){return _0xf3593a['update'](_0x57cbfc)['then'](function(_0x104ce1){return _0x104ce1;});}return null;};}function removeEntity(_0x4ab13a,_0x187e8a){return function(_0x19dcfe){if(_0x19dcfe){return _0x19dcfe[_0x0a8f('0x22')]()[_0x0a8f('0x23')](function(){_0x4ab13a['status'](0xcc)[_0x0a8f('0x19')]();});}};}function handleEntityNotFound(_0x50abb1,_0x3e2a68){return function(_0x391036){if(!_0x391036){_0x50abb1[_0x0a8f('0x24')](0x194);}return _0x391036;};}function handleError(_0x4c0845,_0xeab2a6){_0xeab2a6=_0xeab2a6||0x1f4;return function(_0x41ba8c){logger[_0x0a8f('0x25')](_0x41ba8c[_0x0a8f('0x26')]);if(_0x41ba8c[_0x0a8f('0x27')]){delete _0x41ba8c[_0x0a8f('0x27')];}_0x4c0845[_0x0a8f('0x18')](_0xeab2a6)[_0x0a8f('0x28')](_0x41ba8c);};}exports['update']=function(_0x16d24a,_0x2d886a){if(_0x16d24a[_0x0a8f('0x29')]['id']){delete _0x16d24a[_0x0a8f('0x29')]['id'];}return db[_0x0a8f('0x2a')]['find']({'where':{'id':_0x16d24a[_0x0a8f('0x2b')]['id']}})[_0x0a8f('0x23')](handleEntityNotFound(_0x2d886a,null))[_0x0a8f('0x23')](saveUpdates(_0x16d24a[_0x0a8f('0x29')],null))[_0x0a8f('0x23')](respondWithResult(_0x2d886a,null))[_0x0a8f('0x2c')](handleError(_0x2d886a,null));};exports[_0x0a8f('0x22')]=function(_0x2eddc4,_0x2b2ab5){return db[_0x0a8f('0x2a')][_0x0a8f('0x2d')]({'where':{'id':_0x2eddc4[_0x0a8f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2b2ab5,null))[_0x0a8f('0x23')](removeEntity(_0x2b2ab5,null))[_0x0a8f('0x2c')](handleError(_0x2b2ab5,null));}; \ No newline at end of file +var _0x36d6=['params','catch','rimraf','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','body','Action','find'];(function(_0x566315,_0x51f4f3){var _0x4adc55=function(_0x5618f3){while(--_0x5618f3){_0x566315['push'](_0x566315['shift']());}};_0x4adc55(++_0x51f4f3);}(_0x36d6,0x104));var _0x636d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36d6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x636d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x636d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x636d('0x2'));var Mustache=require(_0x636d('0x3'));var util=require(_0x636d('0x4'));var path=require('path');var sox=require(_0x636d('0x5'));var csv=require('to-csv');var ejs=require(_0x636d('0x6'));var fs=require('fs');var fs_extra=require(_0x636d('0x7'));var _=require('lodash');var squel=require(_0x636d('0x8'));var crypto=require(_0x636d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x636d('0xa'));var querystring=require('querystring');var Papa=require(_0x636d('0xb'));var Redis=require(_0x636d('0xc'));var authService=require(_0x636d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x636d('0xe'));var hardwareService=require(_0x636d('0xf'));var logger=require(_0x636d('0x10'))(_0x636d('0x11'));var utils=require(_0x636d('0x12'));var config=require(_0x636d('0x13'));var licenseUtil=require(_0x636d('0x14'));var db=require(_0x636d('0x15'))['db'];function respondWithStatusCode(_0x141f1b,_0x343635){_0x343635=_0x343635||0xcc;return function(_0x5825f8){if(_0x5825f8){return _0x141f1b[_0x636d('0x16')](_0x343635);}return _0x141f1b[_0x636d('0x17')](_0x343635)[_0x636d('0x18')]();};}function respondWithResult(_0x864cd0,_0x35fb5e){_0x35fb5e=_0x35fb5e||0xc8;return function(_0x2cc0b9){if(_0x2cc0b9){return _0x864cd0[_0x636d('0x17')](_0x35fb5e)[_0x636d('0x19')](_0x2cc0b9);}};}function respondWithFilteredResult(_0x6d08d0,_0x26af85){return function(_0x1d99ad){if(_0x1d99ad){var _0x423573=typeof _0x26af85[_0x636d('0x1a')]===_0x636d('0x1b')&&typeof _0x26af85[_0x636d('0x1c')]===_0x636d('0x1b');var _0x30d751=_0x1d99ad[_0x636d('0x1d')];var _0x66faa9=_0x423573?0x0:_0x26af85[_0x636d('0x1a')];var _0xd712f6=_0x423573?_0x1d99ad[_0x636d('0x1d')]:_0x26af85['offset']+_0x26af85[_0x636d('0x1c')];var _0x27478e;if(_0xd712f6>=_0x30d751){_0xd712f6=_0x30d751;_0x27478e=0xc8;}else{_0x27478e=0xce;}_0x6d08d0[_0x636d('0x17')](_0x27478e);return _0x6d08d0[_0x636d('0x1e')](_0x636d('0x1f'),_0x66faa9+'-'+_0xd712f6+'/'+_0x30d751)[_0x636d('0x19')](_0x1d99ad);}return null;};}function patchUpdates(_0x28341b){return function(_0x513f35){try{jsonpatch['apply'](_0x513f35,_0x28341b,!![]);}catch(_0x85be2){return BPromise[_0x636d('0x20')](_0x85be2);}return _0x513f35[_0x636d('0x21')]();};}function saveUpdates(_0x253058,_0x2d58bd){return function(_0x1aeb32){if(_0x1aeb32){return _0x1aeb32['update'](_0x253058)[_0x636d('0x22')](function(_0x57d3b0){return _0x57d3b0;});}return null;};}function removeEntity(_0x1ce9f4,_0x5726cb){return function(_0x472d02){if(_0x472d02){return _0x472d02[_0x636d('0x23')]()[_0x636d('0x22')](function(){_0x1ce9f4[_0x636d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309c05,_0x34899c){return function(_0x3daada){if(!_0x3daada){_0x309c05[_0x636d('0x16')](0x194);}return _0x3daada;};}function handleError(_0x3b55f9,_0x3903ac){_0x3903ac=_0x3903ac||0x1f4;return function(_0x161667){logger['error'](_0x161667[_0x636d('0x24')]);if(_0x161667[_0x636d('0x25')]){delete _0x161667[_0x636d('0x25')];}_0x3b55f9['status'](_0x3903ac)['send'](_0x161667);};}exports['update']=function(_0x517eb4,_0x2913ad){if(_0x517eb4[_0x636d('0x26')]['id']){delete _0x517eb4[_0x636d('0x26')]['id'];}return db[_0x636d('0x27')][_0x636d('0x28')]({'where':{'id':_0x517eb4[_0x636d('0x29')]['id']}})['then'](handleEntityNotFound(_0x2913ad,null))[_0x636d('0x22')](saveUpdates(_0x517eb4[_0x636d('0x26')],null))[_0x636d('0x22')](respondWithResult(_0x2913ad,null))['catch'](handleError(_0x2913ad,null));};exports[_0x636d('0x23')]=function(_0x26ea6a,_0x130d34){return db[_0x636d('0x27')][_0x636d('0x28')]({'where':{'id':_0x26ea6a['params']['id']}})['then'](handleEntityNotFound(_0x130d34,null))['then'](removeEntity(_0x130d34,null))[_0x636d('0x2a')](handleError(_0x130d34,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index c50c5ff..1a3fc70 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 _0x75e9=['rimraf','../../config/environment','exports','define','Action','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c6b09,_0x1019ef){var _0x50e6a3=function(_0x246b99){while(--_0x246b99){_0x1c6b09['push'](_0x1c6b09['shift']());}};_0x50e6a3(++_0x1019ef);}(_0x75e9,0x1c1));var _0x975e=function(_0x486d8d,_0x352989){_0x486d8d=_0x486d8d-0x0;var _0x4c00ff=_0x75e9[_0x486d8d];return _0x4c00ff;};'use strict';var _=require('lodash');var util=require(_0x975e('0x0'));var logger=require(_0x975e('0x1'))(_0x975e('0x2'));var moment=require(_0x975e('0x3'));var BPromise=require(_0x975e('0x4'));var rp=require(_0x975e('0x5'));var fs=require('fs');var path=require(_0x975e('0x6'));var rimraf=require(_0x975e('0x7'));var config=require(_0x975e('0x8'));var attributes=require('./action.attributes');module[_0x975e('0x9')]=function(_0x1681b9,_0x1f7eac){return _0x1681b9[_0x975e('0xa')](_0x975e('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x76ef,0xb6));var _0xf76e=function(_0x53d86e,_0x16039e){_0x53d86e=_0x53d86e-0x0;var _0x4d07a7=_0x76ef[_0x53d86e];return _0x4d07a7;};'use strict';var _=require(_0xf76e('0x0'));var util=require(_0xf76e('0x1'));var logger=require(_0xf76e('0x2'))(_0xf76e('0x3'));var moment=require(_0xf76e('0x4'));var BPromise=require(_0xf76e('0x5'));var rp=require(_0xf76e('0x6'));var fs=require('fs');var path=require(_0xf76e('0x7'));var rimraf=require(_0xf76e('0x8'));var config=require(_0xf76e('0x9'));var attributes=require(_0xf76e('0xa'));module['exports']=function(_0x2a8095,_0x502094){return _0x2a8095['define'](_0xf76e('0xb'),attributes,{'tableName':_0xf76e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 1e4b63b..0ee0cd1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x52c972,_0x88322b){var _0x5c5195=function(_0x35aecb){while(--_0x35aecb){_0x52c972['push'](_0x52c972['shift']());}};_0x5c5195(++_0x88322b);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0x5fc3[_0xd816e2];return _0x1f5924;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4975,0x86));var _0x5497=function(_0x31323a,_0x4e397e){_0x31323a=_0x31323a-0x0;var _0x5d0193=_0x4975[_0x31323a];return _0x5d0193;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 431ce70..ba91f81 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 _0xe71f=['delete','/:id','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','put','isAuthenticated'];(function(_0x48f038,_0x2bde84){var _0x2edc62=function(_0x1e6cc8){while(--_0x1e6cc8){_0x48f038['push'](_0x48f038['shift']());}};_0x2edc62(++_0x2bde84);}(_0xe71f,0x1d7));var _0xfe71=function(_0x3363b0,_0x13b11d){_0x3363b0=_0x3363b0-0x0;var _0x5a116a=_0xe71f[_0x3363b0];return _0x5a116a;};'use strict';var multer=require(_0xfe71('0x0'));var util=require(_0xfe71('0x1'));var path=require('path');var timeout=require(_0xfe71('0x2'));var express=require('express');var router=express[_0xfe71('0x3')]();var fs_extra=require(_0xfe71('0x4'));var auth=require(_0xfe71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfe71('0x6'));var controller=require('./action.controller');router[_0xfe71('0x7')]('/:id',auth[_0xfe71('0x8')](),controller['update']);router[_0xfe71('0x9')](_0xfe71('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe71('0xb')]=router; \ No newline at end of file +var _0x2dcb=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','exports'];(function(_0x5f1186,_0x299c7f){var _0x32007f=function(_0x4eaf32){while(--_0x4eaf32){_0x5f1186['push'](_0x5f1186['shift']());}};_0x32007f(++_0x299c7f);}(_0x2dcb,0x1d0));var _0xb2dc=function(_0x33bd5a,_0x37ccd6){_0x33bd5a=_0x33bd5a-0x0;var _0x49ac5d=_0x2dcb[_0x33bd5a];return _0x49ac5d;};'use strict';var multer=require(_0xb2dc('0x0'));var util=require(_0xb2dc('0x1'));var path=require(_0xb2dc('0x2'));var timeout=require(_0xb2dc('0x3'));var express=require(_0xb2dc('0x4'));var router=express[_0xb2dc('0x5')]();var fs_extra=require(_0xb2dc('0x6'));var auth=require(_0xb2dc('0x7'));var interaction=require(_0xb2dc('0x8'));var config=require(_0xb2dc('0x9'));var controller=require(_0xb2dc('0xa'));router[_0xb2dc('0xb')](_0xb2dc('0xc'),auth['isAuthenticated'](),controller[_0xb2dc('0xd')]);router[_0xb2dc('0xe')](_0xb2dc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2dc('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 e956283..1485949 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 _0xee14=['STRING','TEXT'];(function(_0x48d02a,_0x4ef182){var _0x8b391e=function(_0x154600){while(--_0x154600){_0x48d02a['push'](_0x48d02a['shift']());}};_0x8b391e(++_0x4ef182);}(_0xee14,0x13a));var _0x4ee1=function(_0x6fc991,_0x469a66){_0x6fc991=_0x6fc991-0x0;var _0x544a68=_0xee14[_0x6fc991];return _0x544a68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0x326f=['STRING','TEXT','sequelize'];(function(_0x4dcc97,_0x3e8b47){var _0x56cfb6=function(_0x518a3e){while(--_0x518a3e){_0x4dcc97['push'](_0x4dcc97['shift']());}};_0x56cfb6(++_0x3e8b47);}(_0x326f,0xd1));var _0xf326=function(_0x32bfef,_0x57ee50){_0x32bfef=_0x32bfef-0x0;var _0x5c51b8=_0x326f[_0x32bfef];return _0x5c51b8;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f40b0ad..cde35bf 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 _0xd92a=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CustomReports','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','keyBy','select','from','MetricId','metric','replace','function','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','Sequelize','ValidationErrorItem','table','DESC','output','web','%s-%s.%s','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../files/reports','savename','countTable','COUNT(*)','cross_join','Please\x20insert\x20at\x20least\x20one\x20field','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd92a,0x1bc));var _0xad92=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd92a[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad92('0x0'));var zipdir=require(_0xad92('0x1'));var jsonpatch=require(_0xad92('0x2'));var rp=require('request-promise');var moment=require(_0xad92('0x3'));var BPromise=require(_0xad92('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xad92('0x5'));var csv=require(_0xad92('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad92('0x7'));var _=require(_0xad92('0x8'));var squel=require(_0xad92('0x9'));var crypto=require(_0xad92('0xa'));var jsforce=require(_0xad92('0xb'));var deskjs=require(_0xad92('0xc'));var toCsv=require(_0xad92('0x6'));var querystring=require(_0xad92('0xd'));var Papa=require('papaparse');var Redis=require(_0xad92('0xe'));var authService=require(_0xad92('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xad92('0x10'));var hardwareService=require(_0xad92('0x11'));var logger=require(_0xad92('0x12'))('api');var utils=require(_0xad92('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xad92('0x14'));var db=require(_0xad92('0x15'))['db'];var dbH=require(_0xad92('0x15'))[_0xad92('0x16')];function respondWithStatusCode(_0x13184f,_0x336550){_0x336550=_0x336550||0xcc;return function(_0x46073a){if(_0x46073a){return _0x13184f['sendStatus'](_0x336550);}return _0x13184f[_0xad92('0x17')](_0x336550)[_0xad92('0x18')]();};}function respondWithResult(_0x2e8c01,_0x200a3d){_0x200a3d=_0x200a3d||0xc8;return function(_0xe5dbe4){if(_0xe5dbe4){return _0x2e8c01[_0xad92('0x17')](_0x200a3d)[_0xad92('0x19')](_0xe5dbe4);}};}function respondWithFilteredResult(_0x1f9ec4,_0x566ded){return function(_0x5936e3){if(_0x5936e3){var _0x4d8009=typeof _0x566ded[_0xad92('0x1a')]===_0xad92('0x1b')&&typeof _0x566ded[_0xad92('0x1c')]===_0xad92('0x1b');var _0x12a544=_0x5936e3[_0xad92('0x1d')];var _0x5e87ca=_0x4d8009?0x0:_0x566ded[_0xad92('0x1a')];var _0x5965dc=_0x4d8009?_0x5936e3['count']:_0x566ded['offset']+_0x566ded[_0xad92('0x1c')];var _0x264de9;if(_0x5965dc>=_0x12a544){_0x5965dc=_0x12a544;_0x264de9=0xc8;}else{_0x264de9=0xce;}_0x1f9ec4[_0xad92('0x17')](_0x264de9);return _0x1f9ec4[_0xad92('0x1e')]('Content-Range',_0x5e87ca+'-'+_0x5965dc+'/'+_0x12a544)[_0xad92('0x19')](_0x5936e3);}return null;};}function patchUpdates(_0x4ea1d0){return function(_0x301b7a){try{jsonpatch[_0xad92('0x1f')](_0x301b7a,_0x4ea1d0,!![]);}catch(_0x223fbf){return BPromise['reject'](_0x223fbf);}return _0x301b7a[_0xad92('0x20')]();};}function saveUpdates(_0x5bcaa3,_0x5342e8){return function(_0x579444){if(_0x579444){return _0x579444['update'](_0x5bcaa3)[_0xad92('0x21')](function(_0x157796){return _0x157796;});}return null;};}function removeEntity(_0x5e92cf,_0x56307a){return function(_0x591a05){if(_0x591a05){return _0x591a05[_0xad92('0x22')]()['then'](function(){var _0x10945a=_0x591a05[_0xad92('0x23')]({'plain':!![]});var _0xd1e056=_0xad92('0x24');return db['UserProfileResource'][_0xad92('0x22')]({'where':{'type':_0xd1e056,'resourceId':_0x10945a['id']}})[_0xad92('0x21')](function(){return _0x591a05;});})['then'](function(){_0x5e92cf['status'](0xcc)[_0xad92('0x18')]();});}};}function handleEntityNotFound(_0x418e54,_0x5e53d4){return function(_0x4780db){if(!_0x4780db){_0x418e54['sendStatus'](0x194);}return _0x4780db;};}function handleError(_0x49d7b2,_0x4031d2){_0x4031d2=_0x4031d2||0x1f4;return function(_0x3a4f0d){logger['error'](_0x3a4f0d['stack']);if(_0x3a4f0d[_0xad92('0x25')]){delete _0x3a4f0d['name'];}_0x49d7b2[_0xad92('0x17')](_0x4031d2)[_0xad92('0x26')](_0x3a4f0d);};}exports['index']=function(_0x2a322f,_0x3e6a4b){var _0x10f5b0={},_0x34831b={},_0x32d1c2={'count':0x0,'rows':[]};var _0x37b358=_[_0xad92('0x27')](db[_0xad92('0x28')][_0xad92('0x29')],function(_0x279683){return{'name':_0x279683[_0xad92('0x2a')],'type':_0x279683['type'][_0xad92('0x2b')]};});_0x34831b[_0xad92('0x2c')]=_[_0xad92('0x27')](_0x37b358,_0xad92('0x25'));_0x34831b[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x2a322f[_0xad92('0x2d')]);_0x34831b[_0xad92('0x2f')]=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],_0x34831b[_0xad92('0x2d')]);_0x10f5b0['attributes']=_[_0xad92('0x30')](_0x34831b[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x31')]));_0x10f5b0[_0xad92('0x32')]=_0x10f5b0[_0xad92('0x32')][_0xad92('0x33')]?_0x10f5b0[_0xad92('0x32')]:_0x34831b[_0xad92('0x2c')];if(!_0x2a322f[_0xad92('0x2d')][_0xad92('0x34')](_0xad92('0x35'))){_0x10f5b0[_0xad92('0x1c')]=qs['limit'](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1c')]);_0x10f5b0[_0xad92('0x1a')]=qs[_0xad92('0x1a')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x1a')]);}_0x10f5b0[_0xad92('0x36')]=qs[_0xad92('0x37')](_0x2a322f[_0xad92('0x2d')][_0xad92('0x37')]);_0x10f5b0['where']=qs[_0xad92('0x2f')](_['pick'](_0x2a322f[_0xad92('0x2d')],_0x34831b['filters']),_0x37b358);if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x38')]){_0x10f5b0['where']=_[_0xad92('0x39')](_0x10f5b0[_0xad92('0x3a')],{'$or':_[_0xad92('0x27')](_0x37b358,function(_0x1444f8){if(_0x1444f8[_0xad92('0x3b')]!==_0xad92('0x3c')){var _0x4cb5cd={};_0x4cb5cd[_0x1444f8['name']]={'$like':'%'+_0x2a322f['query'][_0xad92('0x38')]+'%'};return _0x4cb5cd;}})});}_0x10f5b0=_[_0xad92('0x39')]({},_0x10f5b0,_0x2a322f[_0xad92('0x3d')]);var _0x2232a8={'where':_0x10f5b0[_0xad92('0x3a')]};return db[_0xad92('0x28')][_0xad92('0x1d')](_0x2232a8)['then'](function(_0x66c006){_0x32d1c2[_0xad92('0x1d')]=_0x66c006;if(_0x2a322f[_0xad92('0x2d')][_0xad92('0x3e')]){_0x10f5b0[_0xad92('0x3f')]=[{'all':!![]}];}return db[_0xad92('0x28')][_0xad92('0x40')](_0x10f5b0);})[_0xad92('0x21')](function(_0xdfca06){_0x32d1c2[_0xad92('0x41')]=_0xdfca06;return _0x32d1c2;})['then'](respondWithFilteredResult(_0x3e6a4b,_0x10f5b0))[_0xad92('0x42')](handleError(_0x3e6a4b,null));};exports[_0xad92('0x43')]=function(_0x475b7f,_0x136ec9){var _0x304ccc={'raw':![],'where':{'id':_0x475b7f[_0xad92('0x44')]['id']}},_0x1f324c={};_0x1f324c[_0xad92('0x2c')]=_[_0xad92('0x2e')](db['AnalyticCustomReport'][_0xad92('0x29')]);_0x1f324c[_0xad92('0x2d')]=_[_0xad92('0x2e')](_0x475b7f[_0xad92('0x2d')]);_0x1f324c['filters']=_[_0xad92('0x30')](_0x1f324c['model'],_0x1f324c['query']);_0x304ccc['attributes']=_[_0xad92('0x30')](_0x1f324c[_0xad92('0x2c')],qs[_0xad92('0x31')](_0x475b7f[_0xad92('0x2d')][_0xad92('0x31')]));_0x304ccc[_0xad92('0x32')]=_0x304ccc[_0xad92('0x32')][_0xad92('0x33')]?_0x304ccc[_0xad92('0x32')]:_0x1f324c[_0xad92('0x2c')];if(_0x475b7f[_0xad92('0x2d')]['includeAll']){_0x304ccc[_0xad92('0x3f')]=[{'all':!![]}];}_0x304ccc=_['merge']({},_0x304ccc,_0x475b7f['options']);return db[_0xad92('0x28')][_0xad92('0x45')](_0x304ccc)[_0xad92('0x21')](handleEntityNotFound(_0x136ec9,null))[_0xad92('0x21')](respondWithResult(_0x136ec9,null))[_0xad92('0x42')](handleError(_0x136ec9,null));};exports['create']=function(_0xb09a79,_0x58cb06){return db['AnalyticCustomReport'][_0xad92('0x46')](_0xb09a79[_0xad92('0x47')],{})[_0xad92('0x21')](function(_0x231cb7){var _0x711246=_0xb09a79[_0xad92('0x48')][_0xad92('0x23')]({'plain':!![]});if(!_0x711246)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x711246['role']==='user'){var _0xad41af=_0x231cb7[_0xad92('0x23')]({'plain':!![]});var _0x128196=_0xad92('0x49');return db[_0xad92('0x4a')][_0xad92('0x45')]({'where':{'name':_0x128196,'userProfileId':_0x711246[_0xad92('0x4b')]},'raw':!![]})['then'](function(_0x476b8e){if(_0x476b8e&&_0x476b8e[_0xad92('0x4c')]===0x0){return db['UserProfileResource'][_0xad92('0x46')]({'name':_0xad41af[_0xad92('0x25')],'resourceId':_0xad41af['id'],'type':_0xad92('0x24'),'sectionId':_0x476b8e['id']},{})[_0xad92('0x21')](function(){return _0x231cb7;});}else{return _0x231cb7;}})[_0xad92('0x42')](function(_0x4d34d8){logger[_0xad92('0x4d')](_0xad92('0x4e'),_0x4d34d8);throw _0x4d34d8;});}return _0x231cb7;})[_0xad92('0x21')](respondWithResult(_0x58cb06,0xc9))[_0xad92('0x42')](handleError(_0x58cb06,null));};exports['update']=function(_0x383209,_0x842790){if(_0x383209[_0xad92('0x47')]['id']){delete _0x383209[_0xad92('0x47')]['id'];}return db[_0xad92('0x28')][_0xad92('0x45')]({'where':{'id':_0x383209[_0xad92('0x44')]['id']}})['then'](handleEntityNotFound(_0x842790,null))[_0xad92('0x21')](saveUpdates(_0x383209[_0xad92('0x47')],null))['then'](respondWithResult(_0x842790,null))['catch'](handleError(_0x842790,null));};exports[_0xad92('0x22')]=function(_0x9276e8,_0x407121){return db['AnalyticCustomReport'][_0xad92('0x45')]({'where':{'id':_0x9276e8['params']['id']}})[_0xad92('0x21')](handleEntityNotFound(_0x407121,null))[_0xad92('0x21')](removeEntity(_0x407121,null))[_0xad92('0x42')](handleError(_0x407121,null));};exports[_0xad92('0x4f')]=function(_0x38f373,_0x194fc0){var _0x5b3577=0xa;var _0x423ecf=['join',_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x4fe1a2={'SUM':_0xad92('0x52'),'COUNT':_0xad92('0x53'),'COUNT DISTINCT':_0xad92('0x54'),'MAX':_0xad92('0x55'),'MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x4641a0={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x39fe2c=function(_0x364747){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),'IS\x20NOT\x20NULL',_0xad92('0x60'),_0xad92('0x61')],_0x364747);};var _0x49169d=function(_0x11daad){if(!_0x11daad||!_0x11daad['rules']['length']){return'';}for(var _0x12648b='(',_0xe4f719=0x0;_0xe4f719<_0x11daad[_0xad92('0x62')][_0xad92('0x33')];_0xe4f719+=0x1){_0xe4f719>0x0&&(_0x12648b+='\x20'+_0x11daad[_0xad92('0x63')]+'\x20');_0x12648b+=_0x11daad['rules'][_0xe4f719][_0xad92('0x64')]?_0x49169d(_0x11daad[_0xad92('0x62')][_0xe4f719]['group']):_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x65')]+'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719]['condition']+(_0x39fe2c(_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x66')])?'\x20'+_0x11daad[_0xad92('0x62')][_0xe4f719][_0xad92('0x67')]:'');}return _0x12648b+')';};var _0x393490={'where':{'id':_0x38f373[_0xad92('0x44')]['id']}},_0x2e6915,_0x18ec47,_0x5204ac,_0x355064,_0x23c56d;_0x393490=_[_0xad92('0x39')]({},_0x393490,_0x38f373[_0xad92('0x3d')]);return db['AnalyticCustomReport'][_0xad92('0x45')](_0x393490)[_0xad92('0x21')](function(_0x102a54){if(_0x102a54){_0x2e6915=_0x102a54;return _0x102a54[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x2d289d){if(_0x2d289d){if(!_0x2d289d[_0xad92('0x33')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18ec47=_0x2d289d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x25e57e){if(_0x25e57e){_0x5204ac=_[_0xad92('0x69')](_0x25e57e,'id');var _0x5af894;var _0x424daa=squel[_0xad92('0x6a')]();_0x424daa[_0xad92('0x6b')](_0x2e6915['table']);for(var _0x40494f=0x0;_0x40494f<_0x18ec47[_0xad92('0x33')];_0x40494f+=0x1){_0x5af894=_0x18ec47[_0x40494f]['MetricId']?_0x5204ac[_0x18ec47[_0x40494f][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x18ec47[_0x40494f][_0xad92('0x65')];_0x5af894=_0x18ec47[_0x40494f]['function']?_[_0xad92('0x6e')](_0x4fe1a2[_0x18ec47[_0x40494f][_0xad92('0x6f')]],'%s',_0x5af894):_0x5af894;_0x5af894=_0x18ec47[_0x40494f][_0xad92('0x70')]?_['replace'](_0x4641a0[_0x18ec47[_0x40494f][_0xad92('0x70')]],'%s',_0x5af894):_0x5af894;if(_0x18ec47[_0x40494f][_0xad92('0x71')]){_0x424daa['group'](_0x5af894);}_0x18ec47[_0x40494f][_0xad92('0x72')]&&_0x424daa[_0xad92('0x36')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x72')]==='DESC'?![]:!![]);_0x424daa[_0xad92('0x65')](_0x5af894,_0x18ec47[_0x40494f][_0xad92('0x73')]||_0x5af894);}if(_0x2e6915[_0xad92('0x74')]){_0x2e6915[_0xad92('0x74')]=JSON['parse'](_0x2e6915[_0xad92('0x74')]);for(var _0x51c066=0x0;_0x51c066<_0x2e6915[_0xad92('0x74')][_0xad92('0x33')];_0x51c066+=0x1){if(_0x2e6915['joins'][_0x51c066][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x423ecf,_0x2e6915[_0xad92('0x74')][_0x51c066]['type'])&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')]&&_0x2e6915['joins'][_0x51c066][_0xad92('0x76')]&&_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x77')]){_0x424daa[_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x3b')]](_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x2e6915['table'],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x75')],_0x2e6915[_0xad92('0x74')][_0x51c066][_0xad92('0x76')],_0x2e6915['joins'][_0x51c066][_0xad92('0x77')]));}}}if(_0x2e6915[_0xad92('0x79')]){_0x2e6915['conditions']=JSON[_0xad92('0x7a')](_0x2e6915[_0xad92('0x79')]);_0x424daa[_0xad92('0x3a')](_0x49169d(_0x2e6915[_0xad92('0x79')][_0xad92('0x64')]));}_0x23c56d=_0x424daa['clone']();_0x424daa[_0xad92('0x1c')](_0x5b3577);_0x424daa['offset'](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x424daa['toString']());return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x424daa[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](respondWithResult(_0x194fc0,null))[_0xad92('0x42')](handleError(_0x194fc0,null));};function runReport(_0x3fb951,_0x432753,_0x4d103e){var _0xda3146=_0x432753[_0xad92('0x25')];var _0x176efd=0xa;var _0x6221cb=[_0xad92('0x81'),_0xad92('0x50'),_0xad92('0x51'),'cross_join'];var _0x2eb007={'SUM':'SUM(%s)','COUNT':_0xad92('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xad92('0x59')};var _0x1e5e15={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x5ca5dd=function(_0x2b8e44){return!_[_0xad92('0x5e')]([_0xad92('0x5f'),_0xad92('0x84'),_0xad92('0x60'),'IS\x20NOT\x20EMPTY'],_0x2b8e44);};var _0x1a4290=function(_0x1538e9){if(!_0x1538e9||!_0x1538e9[_0xad92('0x62')][_0xad92('0x33')]){return'';}for(var _0x4c82df='(',_0x1e30bc=0x0;_0x1e30bc<_0x1538e9[_0xad92('0x62')][_0xad92('0x33')];_0x1e30bc+=0x1){_0x1e30bc>0x0&&(_0x4c82df+='\x20'+_0x1538e9[_0xad92('0x63')]+'\x20');_0x4c82df+=_0x1538e9['rules'][_0x1e30bc][_0xad92('0x64')]?_0x1a4290(_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x64')]):_0x1538e9[_0xad92('0x62')][_0x1e30bc]['field']+'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x66')]+(_0x5ca5dd(_0x1538e9[_0xad92('0x62')][_0x1e30bc]['condition'])?'\x20'+_0x1538e9[_0xad92('0x62')][_0x1e30bc][_0xad92('0x67')]:'');}return _0x4c82df+')';};var _0xc431f0={'where':{'id':_0x3fb951['id']}},_0x1f4a96,_0x150aac,_0x23ad34,_0x2bd71a,_0x20fcbb;_0xc431f0=_[_0xad92('0x39')]({},_0xc431f0,_0x4d103e);return db[_0xad92('0x28')]['find'](_0xc431f0)['then'](function(_0x10870f){if(_0x10870f){_0x1f4a96=_0x10870f;return _0x10870f[_0xad92('0x68')]();}return null;})[_0xad92('0x21')](function(_0x4fab5f){if(_0x4fab5f){if(!_0x4fab5f[_0xad92('0x33')]){throw new db[(_0xad92('0x85'))][(_0xad92('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x150aac=_0x4fab5f;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})[_0xad92('0x21')](function(_0x51d37e){if(_0x51d37e){_0x23ad34=_[_0xad92('0x69')](_0x51d37e,'id');var _0x4e63e6;var _0xcd406f=squel[_0xad92('0x6a')]();_0xcd406f[_0xad92('0x6b')](_0x1f4a96[_0xad92('0x87')]);for(var _0x38ab35=0x0;_0x38ab35<_0x150aac[_0xad92('0x33')];_0x38ab35+=0x1){_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6c')]?_0x23ad34[_0x150aac[_0x38ab35]['MetricId']]['metric']:_0x150aac[_0x38ab35][_0xad92('0x65')];_0x4e63e6=_0x150aac[_0x38ab35][_0xad92('0x6f')]?_[_0xad92('0x6e')](_0x2eb007[_0x150aac[_0x38ab35][_0xad92('0x6f')]],'%s',_0x4e63e6):_0x4e63e6;_0x4e63e6=_0x150aac[_0x38ab35]['format']?_[_0xad92('0x6e')](_0x1e5e15[_0x150aac[_0x38ab35][_0xad92('0x70')]],'%s',_0x4e63e6):_0x4e63e6;if(_0x150aac[_0x38ab35][_0xad92('0x71')]){_0xcd406f['group'](_0x4e63e6);}_0x150aac[_0x38ab35]['orderBy']&&_0xcd406f['order'](_0x4e63e6,_0x150aac[_0x38ab35][_0xad92('0x72')]===_0xad92('0x88')?![]:!![]);_0xcd406f[_0xad92('0x65')](_0x4e63e6,_0x150aac[_0x38ab35]['alias']||_0x4e63e6);}if(_0x1f4a96[_0xad92('0x74')]){_0x1f4a96[_0xad92('0x74')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x74')]);for(var _0x191862=0x0;_0x191862<_0x1f4a96[_0xad92('0x74')][_0xad92('0x33')];_0x191862+=0x1){if(_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x6221cb,_0x1f4a96['joins'][_0x191862][_0xad92('0x3b')])&&_0x1f4a96[_0xad92('0x74')][_0x191862]['parentKey']&&_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')]&&_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']){_0xcd406f[_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x3b')]](_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],null,util[_0xad92('0x70')](_0xad92('0x78'),_0x1f4a96['table'],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x75')],_0x1f4a96[_0xad92('0x74')][_0x191862][_0xad92('0x76')],_0x1f4a96[_0xad92('0x74')][_0x191862]['foreignKey']));}}}if(_0x1f4a96[_0xad92('0x79')]){_0x1f4a96[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x1f4a96[_0xad92('0x79')]);_0xcd406f[_0xad92('0x3a')](_0x1a4290(_0x1f4a96[_0xad92('0x79')][_0xad92('0x64')]));}_0x20fcbb=_0xcd406f['clone']();_0xcd406f[_0xad92('0x1c')](_0x176efd);_0xcd406f[_0xad92('0x1a')](0x0);return;}})[_0xad92('0x21')](function(){if(_0x432753[_0xad92('0x89')]===_0xad92('0x8a')){return null;}var _0x1067a3=_[_0xad92('0x39')](_0x432753,{'name':_0x432753['fullPath']||_0x432753[_0xad92('0x25')]||_0x1f4a96['name'],'basename':_0xda3146,'savename':util[_0xad92('0x70')](_0xad92('0x8b'),_0x432753[_0xad92('0x25')]||_0x1f4a96[_0xad92('0x25')],require('randomstring')['generate'](0x4),_0x432753['output']||'csv'),'reportId':_0x1f4a96['id'],'reportType':_0xad92('0x8c')});return db[_0xad92('0x8d')][_0xad92('0x46')](_0x1067a3,{'raw':!![]});})['then'](function(_0x499449){if(_0x1f4a96['table']==='cdr'){_0x20fcbb[_0xad92('0x3a')](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x8e'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}else{_0x20fcbb['where'](_0x1f4a96[_0xad92('0x87')]+_0xad92('0x91'),_0x432753[_0xad92('0x8f')],_0x432753[_0xad92('0x90')]);}if(_0x499449){logger[_0xad92('0x92')]('Run\x20Query:',_0x20fcbb[_0xad92('0x7e')]());require(_0xad92('0x93'))['fork'](path['join'](__dirname,'../../components/export/',_0x499449[_0xad92('0x89')]),[_0x499449['id'],_0x20fcbb['toString'](),path['join'](__dirname,_0xad92('0x94'),_0x499449[_0xad92('0x95')]),_0xda3146]);return _0x499449;}else{var _0x3dabf5=squel[_0xad92('0x6a')]();_0x3dabf5['from']('('+_0x20fcbb[_0xad92('0x7e')]()+')',_0xad92('0x96'));_0x3dabf5['field'](_0xad92('0x97'),'count');_0x20fcbb[_0xad92('0x1c')](_0x432753[_0xad92('0x1c')]||_0x176efd);_0x20fcbb[_0xad92('0x1a')](_0x432753[_0xad92('0x1a')]||0x0);return dbH[_0xad92('0x7d')][_0xad92('0x2d')](_0x3dabf5['toString'](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]})[_0xad92('0x21')](function(_0x3d7798){if(!_0x3d7798[_0xad92('0x33')]){_0x2bd71a=0x0;}else{_0x2bd71a=_0x3d7798[0x0][_0xad92('0x1d')]||0x0;}return dbH['sequelize'][_0xad92('0x2d')](_0x20fcbb[_0xad92('0x7e')](),{'type':dbH[_0xad92('0x7d')][_0xad92('0x7f')][_0xad92('0x80')]});})['then'](function(_0x3d56aa){return{'rows':_0x3d56aa||[],'count':_0x2bd71a};});}});}exports['run']=function(_0x5a2190,_0x448e8f){return runReport(_0x5a2190[_0xad92('0x44')],_0x5a2190[_0xad92('0x2d')],_0x5a2190[_0xad92('0x3d')])[_0xad92('0x21')](respondWithResult(_0x448e8f,null))[_0xad92('0x42')](handleError(_0x448e8f,null));};exports['runReport']=runReport;exports['query']=function(_0xe64601,_0x54eb4d){var _0x8cb7f7=0xa;var _0x12d2ed=[_0xad92('0x81'),'left_join','right_join',_0xad92('0x98')];var _0x5d2d72={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xad92('0x54'),'MAX':'MAX(%s)','MIN':_0xad92('0x56'),'AVG':_0xad92('0x57'),'GROUP_CONCAT':_0xad92('0x82'),'GROUP_CONCAT ASC':_0xad92('0x58'),'GROUP_CONCAT DESC':_0xad92('0x59')};var _0x462417={'SEC_TO_TIME':_0xad92('0x5a'),'DATE':_0xad92('0x5b'),'HOUR':_0xad92('0x83'),'ROUND':_0xad92('0x5c'),'UNIX_TIMESTAMP':_0xad92('0x5d')};var _0x3c3223=function(_0x1da28a){return!_[_0xad92('0x5e')](['IS\x20NULL',_0xad92('0x84'),_0xad92('0x60'),_0xad92('0x61')],_0x1da28a);};var _0x5472b0=function(_0xb0b5f3){if(!_0xb0b5f3||!_0xb0b5f3['rules']['length']){return'';}for(var _0x592ec2='(',_0x1167d1=0x0;_0x1167d1<_0xb0b5f3[_0xad92('0x62')][_0xad92('0x33')];_0x1167d1+=0x1){_0x1167d1>0x0&&(_0x592ec2+='\x20'+_0xb0b5f3[_0xad92('0x63')]+'\x20');_0x592ec2+=_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['group']?_0x5472b0(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x64')]):_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x65')]+'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')]+(_0x3c3223(_0xb0b5f3[_0xad92('0x62')][_0x1167d1][_0xad92('0x66')])?'\x20'+_0xb0b5f3[_0xad92('0x62')][_0x1167d1]['value']:'');}return _0x592ec2+')';};var _0x1fc9a6={'where':{'id':_0xe64601[_0xad92('0x44')]['id']}},_0x5aec4e,_0x4c1e67,_0x32e228,_0x5494dd,_0xfa4c4;_0x1fc9a6=_[_0xad92('0x39')]({},_0x1fc9a6,_0xe64601['options']);return db[_0xad92('0x28')]['find'](_0x1fc9a6)[_0xad92('0x21')](function(_0x54f978){if(_0x54f978){_0x5aec4e=_0x54f978;return _0x54f978[_0xad92('0x68')]();}return null;})['then'](function(_0x530e4b){if(_0x530e4b){if(!_0x530e4b[_0xad92('0x33')]){throw new db['Sequelize'][(_0xad92('0x86'))](_0xad92('0x99'),0x193);}_0x4c1e67=_0x530e4b;return db['AnalyticMetric'][_0xad92('0x40')]({'raw':!![]});}return null;})['then'](function(_0x52e130){if(_0x52e130){_0x32e228=_[_0xad92('0x69')](_0x52e130,'id');var _0x11ae45;var _0x48450c=squel[_0xad92('0x6a')]();_0x48450c['from'](_0x5aec4e[_0xad92('0x87')]);for(var _0x2c5a48=0x0;_0x2c5a48<_0x4c1e67[_0xad92('0x33')];_0x2c5a48+=0x1){_0x11ae45=_0x4c1e67[_0x2c5a48]['MetricId']?_0x32e228[_0x4c1e67[_0x2c5a48][_0xad92('0x6c')]][_0xad92('0x6d')]:_0x4c1e67[_0x2c5a48][_0xad92('0x65')];_0x11ae45=_0x4c1e67[_0x2c5a48]['function']?_[_0xad92('0x6e')](_0x5d2d72[_0x4c1e67[_0x2c5a48]['function']],'%s',_0x11ae45):_0x11ae45;_0x11ae45=_0x4c1e67[_0x2c5a48]['format']?_[_0xad92('0x6e')](_0x462417[_0x4c1e67[_0x2c5a48][_0xad92('0x70')]],'%s',_0x11ae45):_0x11ae45;if(_0x4c1e67[_0x2c5a48][_0xad92('0x71')]){_0x48450c[_0xad92('0x64')](_0x11ae45);}_0x4c1e67[_0x2c5a48][_0xad92('0x72')]&&_0x48450c[_0xad92('0x36')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x72')]==='DESC'?![]:!![]);_0x48450c[_0xad92('0x65')](_0x11ae45,_0x4c1e67[_0x2c5a48][_0xad92('0x73')]||_0x11ae45);}if(_0x5aec4e[_0xad92('0x74')]){_0x5aec4e['joins']=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x74')]);for(var _0x336dc0=0x0;_0x336dc0<_0x5aec4e[_0xad92('0x74')]['length'];_0x336dc0+=0x1){if(_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]&&_[_0xad92('0x5e')](_0x12d2ed,_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')])&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')]&&_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x76')]&&_0x5aec4e['joins'][_0x336dc0][_0xad92('0x77')]){_0x48450c[_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x3b')]](_0x5aec4e['joins'][_0x336dc0]['foreignTable'],null,util[_0xad92('0x70')]('%s.%s\x20=\x20%s.%s',_0x5aec4e['table'],_0x5aec4e[_0xad92('0x74')][_0x336dc0][_0xad92('0x75')],_0x5aec4e['joins'][_0x336dc0][_0xad92('0x76')],_0x5aec4e['joins'][_0x336dc0]['foreignKey']));}}}if(_0x5aec4e['conditions']){_0x5aec4e[_0xad92('0x79')]=JSON[_0xad92('0x7a')](_0x5aec4e[_0xad92('0x79')]);_0x48450c[_0xad92('0x3a')](_0x5472b0(_0x5aec4e[_0xad92('0x79')][_0xad92('0x64')]));}_0xfa4c4=_0x48450c['clone']();_0x48450c[_0xad92('0x1c')](_0x8cb7f7);_0x48450c[_0xad92('0x1a')](0x0);logger[_0xad92('0x7b')](_0xad92('0x7c'),_0x48450c[_0xad92('0x7e')]());return dbH['sequelize']['query'](_0x48450c[_0xad92('0x7e')](),{'type':dbH['sequelize'][_0xad92('0x7f')][_0xad92('0x80')]});}})['then'](function(){return{'sql':_0xfa4c4[_0xad92('0x7e')]()};})[_0xad92('0x21')](respondWithResult(_0x54eb4d,null))[_0xad92('0x42')](handleError(_0x54eb4d,null));}; \ No newline at end of file +var _0x9f7b=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','SELECT','right_join','cross_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','keyBy','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','AVG(%s)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','update','get','CustomReports','UserProfileResource','destroy','then','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','body','user','Reports'];(function(_0x49de40,_0x3eb11e){var _0x43860d=function(_0x2dcdda){while(--_0x2dcdda){_0x49de40['push'](_0x49de40['shift']());}};_0x43860d(++_0x3eb11e);}(_0x9f7b,0x104));var _0xb9f7=function(_0x594017,_0x3b63e4){_0x594017=_0x594017-0x0;var _0x5678a6=_0x9f7b[_0x594017];return _0x5678a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb9f7('0x0'));var jsonpatch=require(_0xb9f7('0x1'));var rp=require(_0xb9f7('0x2'));var moment=require(_0xb9f7('0x3'));var BPromise=require(_0xb9f7('0x4'));var Mustache=require(_0xb9f7('0x5'));var util=require('util');var path=require(_0xb9f7('0x6'));var sox=require(_0xb9f7('0x7'));var csv=require('to-csv');var ejs=require(_0xb9f7('0x8'));var fs=require('fs');var fs_extra=require(_0xb9f7('0x9'));var _=require(_0xb9f7('0xa'));var squel=require(_0xb9f7('0xb'));var crypto=require(_0xb9f7('0xc'));var jsforce=require(_0xb9f7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb9f7('0xe'));var querystring=require(_0xb9f7('0xf'));var Papa=require(_0xb9f7('0x10'));var Redis=require(_0xb9f7('0x11'));var authService=require(_0xb9f7('0x12'));var qs=require(_0xb9f7('0x13'));var as=require(_0xb9f7('0x14'));var hardwareService=require(_0xb9f7('0x15'));var logger=require(_0xb9f7('0x16'))(_0xb9f7('0x17'));var utils=require(_0xb9f7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb9f7('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb9f7('0x1a'))[_0xb9f7('0x1b')];function respondWithStatusCode(_0x2908aa,_0x172043){_0x172043=_0x172043||0xcc;return function(_0x4c8e1f){if(_0x4c8e1f){return _0x2908aa[_0xb9f7('0x1c')](_0x172043);}return _0x2908aa['status'](_0x172043)[_0xb9f7('0x1d')]();};}function respondWithResult(_0x254b14,_0x22b886){_0x22b886=_0x22b886||0xc8;return function(_0x341ce1){if(_0x341ce1){return _0x254b14[_0xb9f7('0x1e')](_0x22b886)[_0xb9f7('0x1f')](_0x341ce1);}};}function respondWithFilteredResult(_0x351ab5,_0xe52c7d){return function(_0x58a1d5){if(_0x58a1d5){var _0x515bf5=typeof _0xe52c7d[_0xb9f7('0x20')]==='undefined'&&typeof _0xe52c7d[_0xb9f7('0x21')]===_0xb9f7('0x22');var _0x2aa903=_0x58a1d5[_0xb9f7('0x23')];var _0x4196b5=_0x515bf5?0x0:_0xe52c7d[_0xb9f7('0x20')];var _0x41166e=_0x515bf5?_0x58a1d5[_0xb9f7('0x23')]:_0xe52c7d[_0xb9f7('0x20')]+_0xe52c7d[_0xb9f7('0x21')];var _0x223209;if(_0x41166e>=_0x2aa903){_0x41166e=_0x2aa903;_0x223209=0xc8;}else{_0x223209=0xce;}_0x351ab5['status'](_0x223209);return _0x351ab5[_0xb9f7('0x24')]('Content-Range',_0x4196b5+'-'+_0x41166e+'/'+_0x2aa903)['json'](_0x58a1d5);}return null;};}function patchUpdates(_0x7887e0){return function(_0x6b8c0c){try{jsonpatch[_0xb9f7('0x25')](_0x6b8c0c,_0x7887e0,!![]);}catch(_0x415296){return BPromise['reject'](_0x415296);}return _0x6b8c0c[_0xb9f7('0x26')]();};}function saveUpdates(_0x53094a,_0x49fa5b){return function(_0x1d2d49){if(_0x1d2d49){return _0x1d2d49[_0xb9f7('0x27')](_0x53094a)['then'](function(_0x48f0a7){return _0x48f0a7;});}return null;};}function removeEntity(_0xc6d60f,_0x1c11f8){return function(_0x2ee735){if(_0x2ee735){return _0x2ee735['destroy']()['then'](function(){var _0x6975d6=_0x2ee735[_0xb9f7('0x28')]({'plain':!![]});var _0x2c73f7=_0xb9f7('0x29');return db[_0xb9f7('0x2a')][_0xb9f7('0x2b')]({'where':{'type':_0x2c73f7,'resourceId':_0x6975d6['id']}})[_0xb9f7('0x2c')](function(){return _0x2ee735;});})[_0xb9f7('0x2c')](function(){_0xc6d60f[_0xb9f7('0x1e')](0xcc)[_0xb9f7('0x1d')]();});}};}function handleEntityNotFound(_0x3dfec8,_0x3de6c1){return function(_0x2caec0){if(!_0x2caec0){_0x3dfec8[_0xb9f7('0x1c')](0x194);}return _0x2caec0;};}function handleError(_0x365a8e,_0x168a17){_0x168a17=_0x168a17||0x1f4;return function(_0x486e21){logger[_0xb9f7('0x2d')](_0x486e21[_0xb9f7('0x2e')]);if(_0x486e21[_0xb9f7('0x2f')]){delete _0x486e21[_0xb9f7('0x2f')];}_0x365a8e['status'](_0x168a17)[_0xb9f7('0x30')](_0x486e21);};}exports['index']=function(_0x3fea15,_0x4e0bf0){var _0x49187a={},_0x1f44b6={},_0xef593a={'count':0x0,'rows':[]};var _0x5edb37=_[_0xb9f7('0x31')](db[_0xb9f7('0x32')][_0xb9f7('0x33')],function(_0x501fd3){return{'name':_0x501fd3[_0xb9f7('0x34')],'type':_0x501fd3[_0xb9f7('0x35')][_0xb9f7('0x36')]};});_0x1f44b6[_0xb9f7('0x37')]=_[_0xb9f7('0x31')](_0x5edb37,_0xb9f7('0x2f'));_0x1f44b6['query']=_[_0xb9f7('0x38')](_0x3fea15['query']);_0x1f44b6[_0xb9f7('0x39')]=_[_0xb9f7('0x3a')](_0x1f44b6[_0xb9f7('0x37')],_0x1f44b6[_0xb9f7('0x3b')]);_0x49187a['attributes']=_[_0xb9f7('0x3a')](_0x1f44b6[_0xb9f7('0x37')],qs[_0xb9f7('0x3c')](_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x3c')]));_0x49187a[_0xb9f7('0x3d')]=_0x49187a['attributes'][_0xb9f7('0x3e')]?_0x49187a['attributes']:_0x1f44b6[_0xb9f7('0x37')];if(!_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x3f')](_0xb9f7('0x40'))){_0x49187a[_0xb9f7('0x21')]=qs[_0xb9f7('0x21')](_0x3fea15[_0xb9f7('0x3b')]['limit']);_0x49187a[_0xb9f7('0x20')]=qs[_0xb9f7('0x20')](_0x3fea15['query'][_0xb9f7('0x20')]);}_0x49187a['order']=qs[_0xb9f7('0x41')](_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x41')]);_0x49187a[_0xb9f7('0x42')]=qs['filters'](_[_0xb9f7('0x43')](_0x3fea15[_0xb9f7('0x3b')],_0x1f44b6[_0xb9f7('0x39')]),_0x5edb37);if(_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x44')]){_0x49187a[_0xb9f7('0x42')]=_['merge'](_0x49187a[_0xb9f7('0x42')],{'$or':_[_0xb9f7('0x31')](_0x5edb37,function(_0x1136db){if(_0x1136db[_0xb9f7('0x35')]!==_0xb9f7('0x45')){var _0x45202f={};_0x45202f[_0x1136db[_0xb9f7('0x2f')]]={'$like':'%'+_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x44')]+'%'};return _0x45202f;}})});}_0x49187a=_['merge']({},_0x49187a,_0x3fea15[_0xb9f7('0x46')]);var _0x399a7a={'where':_0x49187a[_0xb9f7('0x42')]};return db[_0xb9f7('0x32')][_0xb9f7('0x23')](_0x399a7a)[_0xb9f7('0x2c')](function(_0x35eb81){_0xef593a[_0xb9f7('0x23')]=_0x35eb81;if(_0x3fea15[_0xb9f7('0x3b')][_0xb9f7('0x47')]){_0x49187a[_0xb9f7('0x48')]=[{'all':!![]}];}return db[_0xb9f7('0x32')]['findAll'](_0x49187a);})[_0xb9f7('0x2c')](function(_0x4cf8d6){_0xef593a[_0xb9f7('0x49')]=_0x4cf8d6;return _0xef593a;})[_0xb9f7('0x2c')](respondWithFilteredResult(_0x4e0bf0,_0x49187a))[_0xb9f7('0x4a')](handleError(_0x4e0bf0,null));};exports[_0xb9f7('0x4b')]=function(_0x1ea26f,_0x132310){var _0x55ae9a={'raw':![],'where':{'id':_0x1ea26f[_0xb9f7('0x4c')]['id']}},_0x57000d={};_0x57000d['model']=_[_0xb9f7('0x38')](db[_0xb9f7('0x32')][_0xb9f7('0x33')]);_0x57000d['query']=_['keys'](_0x1ea26f[_0xb9f7('0x3b')]);_0x57000d[_0xb9f7('0x39')]=_[_0xb9f7('0x3a')](_0x57000d[_0xb9f7('0x37')],_0x57000d[_0xb9f7('0x3b')]);_0x55ae9a[_0xb9f7('0x3d')]=_[_0xb9f7('0x3a')](_0x57000d[_0xb9f7('0x37')],qs[_0xb9f7('0x3c')](_0x1ea26f[_0xb9f7('0x3b')][_0xb9f7('0x3c')]));_0x55ae9a[_0xb9f7('0x3d')]=_0x55ae9a[_0xb9f7('0x3d')][_0xb9f7('0x3e')]?_0x55ae9a[_0xb9f7('0x3d')]:_0x57000d['model'];if(_0x1ea26f[_0xb9f7('0x3b')][_0xb9f7('0x47')]){_0x55ae9a['include']=[{'all':!![]}];}_0x55ae9a=_[_0xb9f7('0x4d')]({},_0x55ae9a,_0x1ea26f[_0xb9f7('0x46')]);return db[_0xb9f7('0x32')][_0xb9f7('0x4e')](_0x55ae9a)['then'](handleEntityNotFound(_0x132310,null))[_0xb9f7('0x2c')](respondWithResult(_0x132310,null))['catch'](handleError(_0x132310,null));};exports['create']=function(_0x2a354b,_0x132c09){return db[_0xb9f7('0x32')]['create'](_0x2a354b[_0xb9f7('0x4f')],{})[_0xb9f7('0x2c')](function(_0x41f1f6){var _0xdf9e8a=_0x2a354b[_0xb9f7('0x50')][_0xb9f7('0x28')]({'plain':!![]});if(!_0xdf9e8a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdf9e8a['role']===_0xb9f7('0x50')){var _0x40ff95=_0x41f1f6[_0xb9f7('0x28')]({'plain':!![]});var _0x3ae782=_0xb9f7('0x51');return db['UserProfileSection'][_0xb9f7('0x4e')]({'where':{'name':_0x3ae782,'userProfileId':_0xdf9e8a['userProfileId']},'raw':!![]})['then'](function(_0x7fbbaf){if(_0x7fbbaf&&_0x7fbbaf[_0xb9f7('0x52')]===0x0){return db[_0xb9f7('0x2a')]['create']({'name':_0x40ff95[_0xb9f7('0x2f')],'resourceId':_0x40ff95['id'],'type':'CustomReports','sectionId':_0x7fbbaf['id']},{})[_0xb9f7('0x2c')](function(){return _0x41f1f6;});}else{return _0x41f1f6;}})[_0xb9f7('0x4a')](function(_0x4b5e70){logger[_0xb9f7('0x2d')](_0xb9f7('0x53'),_0x4b5e70);throw _0x4b5e70;});}return _0x41f1f6;})['then'](respondWithResult(_0x132c09,0xc9))[_0xb9f7('0x4a')](handleError(_0x132c09,null));};exports[_0xb9f7('0x27')]=function(_0x2059d2,_0x1860d7){if(_0x2059d2[_0xb9f7('0x4f')]['id']){delete _0x2059d2[_0xb9f7('0x4f')]['id'];}return db['AnalyticCustomReport'][_0xb9f7('0x4e')]({'where':{'id':_0x2059d2[_0xb9f7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1860d7,null))[_0xb9f7('0x2c')](saveUpdates(_0x2059d2[_0xb9f7('0x4f')],null))[_0xb9f7('0x2c')](respondWithResult(_0x1860d7,null))[_0xb9f7('0x4a')](handleError(_0x1860d7,null));};exports[_0xb9f7('0x2b')]=function(_0xe8229f,_0x4d5691){return db[_0xb9f7('0x32')][_0xb9f7('0x4e')]({'where':{'id':_0xe8229f['params']['id']}})[_0xb9f7('0x2c')](handleEntityNotFound(_0x4d5691,null))['then'](removeEntity(_0x4d5691,null))[_0xb9f7('0x4a')](handleError(_0x4d5691,null));};exports[_0xb9f7('0x54')]=function(_0x33215f,_0x3b6f3c){var _0x3461f7=0xa;var _0x10f798=[_0xb9f7('0x55'),_0xb9f7('0x56'),'right_join','cross_join'];var _0x306d6c={'SUM':_0xb9f7('0x57'),'COUNT':_0xb9f7('0x58'),'COUNT DISTINCT':_0xb9f7('0x59'),'MAX':_0xb9f7('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb9f7('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x383d57={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb9f7('0x5f')};var _0x42caee=function(_0x353c0f){return!_[_0xb9f7('0x60')](['IS\x20NULL',_0xb9f7('0x61'),'IS\x20EMPTY',_0xb9f7('0x62')],_0x353c0f);};var _0x52c727=function(_0x38275a){if(!_0x38275a||!_0x38275a[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0x28ae68='(',_0x51d1a7=0x0;_0x51d1a7<_0x38275a[_0xb9f7('0x63')]['length'];_0x51d1a7+=0x1){_0x51d1a7>0x0&&(_0x28ae68+='\x20'+_0x38275a[_0xb9f7('0x64')]+'\x20');_0x28ae68+=_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x65')]?_0x52c727(_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x65')]):_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x66')]+'\x20'+_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x67')]+(_0x42caee(_0x38275a['rules'][_0x51d1a7]['condition'])?'\x20'+_0x38275a[_0xb9f7('0x63')][_0x51d1a7][_0xb9f7('0x68')]:'');}return _0x28ae68+')';};var _0x20ab60={'where':{'id':_0x33215f[_0xb9f7('0x4c')]['id']}},_0xb1acd4,_0x3d85fa,_0x16c301,_0x196a80,_0x4283f8;_0x20ab60=_['merge']({},_0x20ab60,_0x33215f[_0xb9f7('0x46')]);return db['AnalyticCustomReport'][_0xb9f7('0x4e')](_0x20ab60)['then'](function(_0x3d9442){if(_0x3d9442){_0xb1acd4=_0x3d9442;return _0x3d9442[_0xb9f7('0x69')]();}return null;})[_0xb9f7('0x2c')](function(_0x2a3ca1){if(_0x2a3ca1){if(!_0x2a3ca1[_0xb9f7('0x3e')]){throw new db[(_0xb9f7('0x6a'))][(_0xb9f7('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d85fa=_0x2a3ca1;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})[_0xb9f7('0x2c')](function(_0x474bf8){if(_0x474bf8){_0x16c301=_['keyBy'](_0x474bf8,'id');var _0x5c806f;var _0x36996a=squel[_0xb9f7('0x6e')]();_0x36996a[_0xb9f7('0x6f')](_0xb1acd4[_0xb9f7('0x70')]);for(var _0x4c8e9f=0x0;_0x4c8e9f<_0x3d85fa[_0xb9f7('0x3e')];_0x4c8e9f+=0x1){_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x71')]?_0x16c301[_0x3d85fa[_0x4c8e9f][_0xb9f7('0x71')]][_0xb9f7('0x72')]:_0x3d85fa[_0x4c8e9f][_0xb9f7('0x66')];_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x73')]?_[_0xb9f7('0x74')](_0x306d6c[_0x3d85fa[_0x4c8e9f][_0xb9f7('0x73')]],'%s',_0x5c806f):_0x5c806f;_0x5c806f=_0x3d85fa[_0x4c8e9f][_0xb9f7('0x75')]?_[_0xb9f7('0x74')](_0x383d57[_0x3d85fa[_0x4c8e9f]['format']],'%s',_0x5c806f):_0x5c806f;if(_0x3d85fa[_0x4c8e9f]['groupBy']){_0x36996a[_0xb9f7('0x65')](_0x5c806f);}_0x3d85fa[_0x4c8e9f][_0xb9f7('0x76')]&&_0x36996a[_0xb9f7('0x77')](_0x5c806f,_0x3d85fa[_0x4c8e9f]['orderBy']===_0xb9f7('0x78')?![]:!![]);_0x36996a[_0xb9f7('0x66')](_0x5c806f,_0x3d85fa[_0x4c8e9f][_0xb9f7('0x79')]||_0x5c806f);}if(_0xb1acd4['joins']){_0xb1acd4['joins']=JSON[_0xb9f7('0x7a')](_0xb1acd4['joins']);for(var _0x18a223=0x0;_0x18a223<_0xb1acd4[_0xb9f7('0x7b')]['length'];_0x18a223+=0x1){if(_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x35')]&&_[_0xb9f7('0x60')](_0x10f798,_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x35')])&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7c')]&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7d')]&&_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7e')]){_0x36996a[_0xb1acd4[_0xb9f7('0x7b')][_0x18a223]['type']](_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7d')],null,util[_0xb9f7('0x75')](_0xb9f7('0x7f'),_0xb1acd4['table'],_0xb1acd4[_0xb9f7('0x7b')][_0x18a223][_0xb9f7('0x7c')],_0xb1acd4[_0xb9f7('0x7b')][_0x18a223]['foreignTable'],_0xb1acd4['joins'][_0x18a223][_0xb9f7('0x7e')]));}}}if(_0xb1acd4[_0xb9f7('0x80')]){_0xb1acd4[_0xb9f7('0x80')]=JSON['parse'](_0xb1acd4[_0xb9f7('0x80')]);_0x36996a[_0xb9f7('0x42')](_0x52c727(_0xb1acd4[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0x4283f8=_0x36996a['clone']();_0x36996a['limit'](_0x3461f7);_0x36996a[_0xb9f7('0x20')](0x0);logger[_0xb9f7('0x81')]('Limited\x20Query:',_0x36996a[_0xb9f7('0x82')]());return dbH[_0xb9f7('0x83')]['query'](_0x36996a['toString'](),{'type':dbH[_0xb9f7('0x83')][_0xb9f7('0x84')][_0xb9f7('0x85')]});}})['then'](respondWithResult(_0x3b6f3c,null))[_0xb9f7('0x4a')](handleError(_0x3b6f3c,null));};function runReport(_0x168438,_0x3ae3ab,_0x533257){var _0x55055b=_0x3ae3ab[_0xb9f7('0x2f')];var _0x50b1e5=0xa;var _0x14af37=[_0xb9f7('0x55'),_0xb9f7('0x56'),_0xb9f7('0x86'),_0xb9f7('0x87')];var _0x2ae086={'SUM':_0xb9f7('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb9f7('0x5a'),'MIN':_0xb9f7('0x88'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb9f7('0x5b'),'GROUP_CONCAT ASC':_0xb9f7('0x89'),'GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x1ce609={'SEC_TO_TIME':_0xb9f7('0x8a'),'DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8fbd4f=function(_0x419255){return!_[_0xb9f7('0x60')]([_0xb9f7('0x8b'),_0xb9f7('0x61'),_0xb9f7('0x8c'),_0xb9f7('0x62')],_0x419255);};var _0x28532c=function(_0x1f2193){if(!_0x1f2193||!_0x1f2193[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0x535b50='(',_0x21f5c7=0x0;_0x21f5c7<_0x1f2193[_0xb9f7('0x63')][_0xb9f7('0x3e')];_0x21f5c7+=0x1){_0x21f5c7>0x0&&(_0x535b50+='\x20'+_0x1f2193[_0xb9f7('0x64')]+'\x20');_0x535b50+=_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x65')]?_0x28532c(_0x1f2193[_0xb9f7('0x63')][_0x21f5c7]['group']):_0x1f2193['rules'][_0x21f5c7][_0xb9f7('0x66')]+'\x20'+_0x1f2193['rules'][_0x21f5c7][_0xb9f7('0x67')]+(_0x8fbd4f(_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x67')])?'\x20'+_0x1f2193[_0xb9f7('0x63')][_0x21f5c7][_0xb9f7('0x68')]:'');}return _0x535b50+')';};var _0x249f73={'where':{'id':_0x168438['id']}},_0x15a5ab,_0x3d66fa,_0xb300b5,_0x27b662,_0xd89e3f;_0x249f73=_['merge']({},_0x249f73,_0x533257);return db[_0xb9f7('0x32')][_0xb9f7('0x4e')](_0x249f73)[_0xb9f7('0x2c')](function(_0x2207fd){if(_0x2207fd){_0x15a5ab=_0x2207fd;return _0x2207fd['getFields']();}return null;})[_0xb9f7('0x2c')](function(_0x39b265){if(_0x39b265){if(!_0x39b265[_0xb9f7('0x3e')]){throw new db['Sequelize'][(_0xb9f7('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3d66fa=_0x39b265;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x3232e4){if(_0x3232e4){_0xb300b5=_[_0xb9f7('0x8d')](_0x3232e4,'id');var _0x290391;var _0x54f80b=squel['select']();_0x54f80b[_0xb9f7('0x6f')](_0x15a5ab[_0xb9f7('0x70')]);for(var _0x598ef7=0x0;_0x598ef7<_0x3d66fa[_0xb9f7('0x3e')];_0x598ef7+=0x1){_0x290391=_0x3d66fa[_0x598ef7]['MetricId']?_0xb300b5[_0x3d66fa[_0x598ef7]['MetricId']]['metric']:_0x3d66fa[_0x598ef7][_0xb9f7('0x66')];_0x290391=_0x3d66fa[_0x598ef7][_0xb9f7('0x73')]?_['replace'](_0x2ae086[_0x3d66fa[_0x598ef7][_0xb9f7('0x73')]],'%s',_0x290391):_0x290391;_0x290391=_0x3d66fa[_0x598ef7]['format']?_[_0xb9f7('0x74')](_0x1ce609[_0x3d66fa[_0x598ef7]['format']],'%s',_0x290391):_0x290391;if(_0x3d66fa[_0x598ef7][_0xb9f7('0x8e')]){_0x54f80b[_0xb9f7('0x65')](_0x290391);}_0x3d66fa[_0x598ef7][_0xb9f7('0x76')]&&_0x54f80b[_0xb9f7('0x77')](_0x290391,_0x3d66fa[_0x598ef7][_0xb9f7('0x76')]===_0xb9f7('0x78')?![]:!![]);_0x54f80b[_0xb9f7('0x66')](_0x290391,_0x3d66fa[_0x598ef7][_0xb9f7('0x79')]||_0x290391);}if(_0x15a5ab[_0xb9f7('0x7b')]){_0x15a5ab[_0xb9f7('0x7b')]=JSON[_0xb9f7('0x7a')](_0x15a5ab[_0xb9f7('0x7b')]);for(var _0x5e6d45=0x0;_0x5e6d45<_0x15a5ab[_0xb9f7('0x7b')][_0xb9f7('0x3e')];_0x5e6d45+=0x1){if(_0x15a5ab['joins'][_0x5e6d45][_0xb9f7('0x35')]&&_['includes'](_0x14af37,_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45]['type'])&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7c')]&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7d')]&&_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7e')]){_0x54f80b[_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x35')]](_0x15a5ab['joins'][_0x5e6d45]['foreignTable'],null,util[_0xb9f7('0x75')](_0xb9f7('0x7f'),_0x15a5ab[_0xb9f7('0x70')],_0x15a5ab['joins'][_0x5e6d45][_0xb9f7('0x7c')],_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45]['foreignTable'],_0x15a5ab[_0xb9f7('0x7b')][_0x5e6d45][_0xb9f7('0x7e')]));}}}if(_0x15a5ab[_0xb9f7('0x80')]){_0x15a5ab[_0xb9f7('0x80')]=JSON[_0xb9f7('0x7a')](_0x15a5ab[_0xb9f7('0x80')]);_0x54f80b[_0xb9f7('0x42')](_0x28532c(_0x15a5ab[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0xd89e3f=_0x54f80b[_0xb9f7('0x8f')]();_0x54f80b[_0xb9f7('0x21')](_0x50b1e5);_0x54f80b[_0xb9f7('0x20')](0x0);return;}})[_0xb9f7('0x2c')](function(){if(_0x3ae3ab[_0xb9f7('0x90')]===_0xb9f7('0x91')){return null;}var _0x45ff3b=_[_0xb9f7('0x4d')](_0x3ae3ab,{'name':_0x3ae3ab[_0xb9f7('0x92')]||_0x3ae3ab[_0xb9f7('0x2f')]||_0x15a5ab[_0xb9f7('0x2f')],'basename':_0x55055b,'savename':util['format'](_0xb9f7('0x93'),_0x3ae3ab[_0xb9f7('0x2f')]||_0x15a5ab['name'],require(_0xb9f7('0x94'))[_0xb9f7('0x95')](0x4),_0x3ae3ab[_0xb9f7('0x90')]||_0xb9f7('0x96')),'reportId':_0x15a5ab['id'],'reportType':_0xb9f7('0x97')});return db[_0xb9f7('0x98')]['create'](_0x45ff3b,{'raw':!![]});})[_0xb9f7('0x2c')](function(_0x36a06a){if(_0x15a5ab[_0xb9f7('0x70')]===_0xb9f7('0x99')){_0xd89e3f[_0xb9f7('0x42')](_0x15a5ab[_0xb9f7('0x70')]+_0xb9f7('0x9a'),_0x3ae3ab[_0xb9f7('0x9b')],_0x3ae3ab[_0xb9f7('0x9c')]);}else{_0xd89e3f[_0xb9f7('0x42')](_0x15a5ab['table']+_0xb9f7('0x9d'),_0x3ae3ab['startDate'],_0x3ae3ab['endDate']);}if(_0x36a06a){logger[_0xb9f7('0x9e')](_0xb9f7('0x9f'),_0xd89e3f[_0xb9f7('0x82')]());require(_0xb9f7('0xa0'))[_0xb9f7('0xa1')](path[_0xb9f7('0x55')](__dirname,'../../components/export/',_0x36a06a[_0xb9f7('0x90')]),[_0x36a06a['id'],_0xd89e3f['toString'](),path[_0xb9f7('0x55')](__dirname,_0xb9f7('0xa2'),_0x36a06a['savename']),_0x55055b]);return _0x36a06a;}else{var _0x1796a5=squel[_0xb9f7('0x6e')]();_0x1796a5[_0xb9f7('0x6f')]('('+_0xd89e3f['toString']()+')',_0xb9f7('0xa3'));_0x1796a5[_0xb9f7('0x66')](_0xb9f7('0xa4'),'count');_0xd89e3f[_0xb9f7('0x21')](_0x3ae3ab[_0xb9f7('0x21')]||_0x50b1e5);_0xd89e3f['offset'](_0x3ae3ab[_0xb9f7('0x20')]||0x0);return dbH[_0xb9f7('0x83')][_0xb9f7('0x3b')](_0x1796a5['toString'](),{'type':dbH[_0xb9f7('0x83')][_0xb9f7('0x84')][_0xb9f7('0x85')]})[_0xb9f7('0x2c')](function(_0x55f746){if(!_0x55f746[_0xb9f7('0x3e')]){_0x27b662=0x0;}else{_0x27b662=_0x55f746[0x0][_0xb9f7('0x23')]||0x0;}return dbH['sequelize'][_0xb9f7('0x3b')](_0xd89e3f[_0xb9f7('0x82')](),{'type':dbH[_0xb9f7('0x83')]['QueryTypes'][_0xb9f7('0x85')]});})[_0xb9f7('0x2c')](function(_0x5a31ea){return{'rows':_0x5a31ea||[],'count':_0x27b662};});}});}exports[_0xb9f7('0xa5')]=function(_0x15260b,_0x495abc){return runReport(_0x15260b[_0xb9f7('0x4c')],_0x15260b[_0xb9f7('0x3b')],_0x15260b['options'])[_0xb9f7('0x2c')](respondWithResult(_0x495abc,null))[_0xb9f7('0x4a')](handleError(_0x495abc,null));};exports[_0xb9f7('0xa6')]=runReport;exports[_0xb9f7('0x3b')]=function(_0x5745b5,_0x353403){var _0x188031=0xa;var _0x58db0b=[_0xb9f7('0x55'),'left_join',_0xb9f7('0x86'),_0xb9f7('0x87')];var _0x3246d8={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb9f7('0x59'),'MAX':_0xb9f7('0x5a'),'MIN':_0xb9f7('0x88'),'AVG':_0xb9f7('0xa7'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb9f7('0x89'),'GROUP_CONCAT DESC':_0xb9f7('0x5c')};var _0x490b6c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb9f7('0x5d'),'HOUR':_0xb9f7('0x5e'),'ROUND':_0xb9f7('0xa8'),'UNIX_TIMESTAMP':_0xb9f7('0x5f')};var _0x125037=function(_0x5ad617){return!_[_0xb9f7('0x60')]([_0xb9f7('0x8b'),'IS\x20NOT\x20NULL',_0xb9f7('0x8c'),_0xb9f7('0x62')],_0x5ad617);};var _0x4659d2=function(_0x47a27c){if(!_0x47a27c||!_0x47a27c[_0xb9f7('0x63')][_0xb9f7('0x3e')]){return'';}for(var _0xc40abf='(',_0x19649b=0x0;_0x19649b<_0x47a27c[_0xb9f7('0x63')][_0xb9f7('0x3e')];_0x19649b+=0x1){_0x19649b>0x0&&(_0xc40abf+='\x20'+_0x47a27c[_0xb9f7('0x64')]+'\x20');_0xc40abf+=_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x65')]?_0x4659d2(_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x65')]):_0x47a27c[_0xb9f7('0x63')][_0x19649b]['field']+'\x20'+_0x47a27c['rules'][_0x19649b][_0xb9f7('0x67')]+(_0x125037(_0x47a27c['rules'][_0x19649b][_0xb9f7('0x67')])?'\x20'+_0x47a27c[_0xb9f7('0x63')][_0x19649b][_0xb9f7('0x68')]:'');}return _0xc40abf+')';};var _0x46fbaf={'where':{'id':_0x5745b5[_0xb9f7('0x4c')]['id']}},_0x377e2d,_0x1f2366,_0x194b50,_0x7b7134,_0x5b5aa8;_0x46fbaf=_[_0xb9f7('0x4d')]({},_0x46fbaf,_0x5745b5[_0xb9f7('0x46')]);return db['AnalyticCustomReport'][_0xb9f7('0x4e')](_0x46fbaf)[_0xb9f7('0x2c')](function(_0x92e11e){if(_0x92e11e){_0x377e2d=_0x92e11e;return _0x92e11e[_0xb9f7('0x69')]();}return null;})[_0xb9f7('0x2c')](function(_0x2dcaef){if(_0x2dcaef){if(!_0x2dcaef['length']){throw new db[(_0xb9f7('0x6a'))][(_0xb9f7('0x6b'))](_0xb9f7('0xa9'),0x193);}_0x1f2366=_0x2dcaef;return db[_0xb9f7('0x6c')][_0xb9f7('0x6d')]({'raw':!![]});}return null;})[_0xb9f7('0x2c')](function(_0x4faaa9){if(_0x4faaa9){_0x194b50=_['keyBy'](_0x4faaa9,'id');var _0x3e9389;var _0x1ca1d6=squel[_0xb9f7('0x6e')]();_0x1ca1d6[_0xb9f7('0x6f')](_0x377e2d[_0xb9f7('0x70')]);for(var _0x8eeaf8=0x0;_0x8eeaf8<_0x1f2366[_0xb9f7('0x3e')];_0x8eeaf8+=0x1){_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x71')]?_0x194b50[_0x1f2366[_0x8eeaf8][_0xb9f7('0x71')]]['metric']:_0x1f2366[_0x8eeaf8][_0xb9f7('0x66')];_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x73')]?_[_0xb9f7('0x74')](_0x3246d8[_0x1f2366[_0x8eeaf8][_0xb9f7('0x73')]],'%s',_0x3e9389):_0x3e9389;_0x3e9389=_0x1f2366[_0x8eeaf8][_0xb9f7('0x75')]?_[_0xb9f7('0x74')](_0x490b6c[_0x1f2366[_0x8eeaf8][_0xb9f7('0x75')]],'%s',_0x3e9389):_0x3e9389;if(_0x1f2366[_0x8eeaf8][_0xb9f7('0x8e')]){_0x1ca1d6[_0xb9f7('0x65')](_0x3e9389);}_0x1f2366[_0x8eeaf8][_0xb9f7('0x76')]&&_0x1ca1d6['order'](_0x3e9389,_0x1f2366[_0x8eeaf8][_0xb9f7('0x76')]==='DESC'?![]:!![]);_0x1ca1d6[_0xb9f7('0x66')](_0x3e9389,_0x1f2366[_0x8eeaf8]['alias']||_0x3e9389);}if(_0x377e2d['joins']){_0x377e2d[_0xb9f7('0x7b')]=JSON['parse'](_0x377e2d['joins']);for(var _0x23911d=0x0;_0x23911d<_0x377e2d['joins'][_0xb9f7('0x3e')];_0x23911d+=0x1){if(_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')]&&_['includes'](_0x58db0b,_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')])&&_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['parentKey']&&_0x377e2d['joins'][_0x23911d][_0xb9f7('0x7d')]&&_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7e')]){_0x1ca1d6[_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x35')]](_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x377e2d['table'],_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7c')],_0x377e2d[_0xb9f7('0x7b')][_0x23911d][_0xb9f7('0x7d')],_0x377e2d[_0xb9f7('0x7b')][_0x23911d]['foreignKey']));}}}if(_0x377e2d[_0xb9f7('0x80')]){_0x377e2d['conditions']=JSON[_0xb9f7('0x7a')](_0x377e2d[_0xb9f7('0x80')]);_0x1ca1d6[_0xb9f7('0x42')](_0x4659d2(_0x377e2d[_0xb9f7('0x80')][_0xb9f7('0x65')]));}_0x5b5aa8=_0x1ca1d6[_0xb9f7('0x8f')]();_0x1ca1d6[_0xb9f7('0x21')](_0x188031);_0x1ca1d6['offset'](0x0);logger['debug'](_0xb9f7('0xaa'),_0x1ca1d6[_0xb9f7('0x82')]());return dbH[_0xb9f7('0x83')]['query'](_0x1ca1d6[_0xb9f7('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xb9f7('0x85')]});}})['then'](function(){return{'sql':_0x5b5aa8[_0xb9f7('0x82')]()};})[_0xb9f7('0x2c')](respondWithResult(_0x353403,null))[_0xb9f7('0x4a')](handleError(_0x353403,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c521735..6ab4cdd 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 _0x2c50=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x2c50,0x158));var _0x02c5=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2c50[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0x02c5('0x0'));var util=require(_0x02c5('0x1'));var logger=require(_0x02c5('0x2'))(_0x02c5('0x3'));var moment=require(_0x02c5('0x4'));var BPromise=require(_0x02c5('0x5'));var rp=require(_0x02c5('0x6'));var fs=require('fs');var path=require(_0x02c5('0x7'));var rimraf=require('rimraf');var config=require(_0x02c5('0x8'));var attributes=require(_0x02c5('0x9'));module[_0x02c5('0xa')]=function(_0x72f6f9,_0x46fa5a){return _0x72f6f9[_0x02c5('0xb')](_0x02c5('0xc'),attributes,{'tableName':_0x02c5('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd730=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x226fac,_0x23f076){var _0x954333=function(_0x3e7da5){while(--_0x3e7da5){_0x226fac['push'](_0x226fac['shift']());}};_0x954333(++_0x23f076);}(_0xd730,0xd9));var _0x0d73=function(_0x23fcdb,_0x304a23){_0x23fcdb=_0x23fcdb-0x0;var _0x49991c=_0xd730[_0x23fcdb];return _0x49991c;};'use strict';var _=require(_0x0d73('0x0'));var util=require(_0x0d73('0x1'));var logger=require(_0x0d73('0x2'))(_0x0d73('0x3'));var moment=require(_0x0d73('0x4'));var BPromise=require(_0x0d73('0x5'));var rp=require(_0x0d73('0x6'));var fs=require('fs');var path=require(_0x0d73('0x7'));var rimraf=require(_0x0d73('0x8'));var config=require(_0x0d73('0x9'));var attributes=require(_0x0d73('0xa'));module[_0x0d73('0xb')]=function(_0x251b57,_0x5a13ab){return _0x251b57['define'](_0x0d73('0xc'),attributes,{'tableName':_0x0d73('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 267c02d..e283d24 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 _0x08d3=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x803ae0,_0x5c5f30){var _0x3c38b1=function(_0x59b091){while(--_0x59b091){_0x803ae0['push'](_0x803ae0['shift']());}};_0x3c38b1(++_0x5c5f30);}(_0x08d3,0x6b));var _0x308d=function(_0x5776cb,_0x579eb7){_0x5776cb=_0x5776cb-0x0;var _0x46349f=_0x08d3[_0x5776cb];return _0x46349f;};'use strict';var _=require(_0x308d('0x0'));var util=require('util');var moment=require(_0x308d('0x1'));var BPromise=require(_0x308d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x308d('0x3'));var db=require(_0x308d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x308d('0x5'))(_0x308d('0x6'));var config=require(_0x308d('0x7'));var jayson=require(_0x308d('0x8'));var client=jayson[_0x308d('0x9')][_0x308d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431dcb,_0x8f13b8,_0x4b8901){return new BPromise(function(_0x3e5a61,_0x5ed568){return client['request'](_0x431dcb,_0x4b8901)['then'](function(_0x2dbccc){logger['info'](_0x308d('0xb'),_0x8f13b8,_0x308d('0xc'));logger[_0x308d('0xd')](_0x308d('0xe'),_0x8f13b8,_0x308d('0xc'),JSON['stringify'](_0x2dbccc));if(_0x2dbccc[_0x308d('0xf')]){if(_0x2dbccc[_0x308d('0xf')][_0x308d('0x10')]===0x1f4){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x5ed568(_0x2dbccc[_0x308d('0xf')]['message']);}logger[_0x308d('0xf')](_0x308d('0xb'),_0x8f13b8,_0x2dbccc[_0x308d('0xf')]['message']);return _0x3e5a61(_0x2dbccc[_0x308d('0xf')]['message']);}else{logger[_0x308d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x308d('0xc'));_0x3e5a61(_0x2dbccc[_0x308d('0x12')]['message']);}})[_0x308d('0x13')](function(_0x356abd){logger[_0x308d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8f13b8,_0x356abd);_0x5ed568(_0x356abd);});});} \ No newline at end of file +var _0x2a17=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x46b4f8,_0x48aa46){var _0x1a767f=function(_0xaebbe8){while(--_0xaebbe8){_0x46b4f8['push'](_0x46b4f8['shift']());}};_0x1a767f(++_0x48aa46);}(_0x2a17,0xb0));var _0x72a1=function(_0x26d22a,_0x321b6b){_0x26d22a=_0x26d22a-0x0;var _0x25a53b=_0x2a17[_0x26d22a];return _0x25a53b;};'use strict';var _=require(_0x72a1('0x0'));var util=require('util');var moment=require(_0x72a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x72a1('0x2'));var fs=require('fs');var Redis=require(_0x72a1('0x3'));var db=require(_0x72a1('0x4'))['db'];var utils=require(_0x72a1('0x5'));var logger=require('../../config/logger')(_0x72a1('0x6'));var config=require(_0x72a1('0x7'));var jayson=require(_0x72a1('0x8'));var client=jayson['client'][_0x72a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427967,_0x527362,_0x12932c){return new BPromise(function(_0x4c932f,_0x103db6){return client['request'](_0x427967,_0x12932c)[_0x72a1('0xa')](function(_0x4a41c7){logger['info'](_0x72a1('0xb'),_0x527362,_0x72a1('0xc'));logger[_0x72a1('0xd')](_0x72a1('0xe'),_0x527362,_0x72a1('0xc'),JSON[_0x72a1('0xf')](_0x4a41c7));if(_0x4a41c7[_0x72a1('0x10')]){if(_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x527362,_0x4a41c7['error']['message']);return _0x103db6(_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x12')]);}logger[_0x72a1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x527362,_0x4a41c7[_0x72a1('0x10')][_0x72a1('0x12')]);return _0x4c932f(_0x4a41c7['error']['message']);}else{logger[_0x72a1('0x13')](_0x72a1('0xb'),_0x527362,_0x72a1('0xc'));_0x4c932f(_0x4a41c7[_0x72a1('0x14')]['message']);}})[_0x72a1('0x15')](function(_0x164b67){logger[_0x72a1('0x10')](_0x72a1('0xb'),_0x527362,_0x164b67);_0x103db6(_0x164b67);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1b8b136..ac4abf8 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 _0x0981=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x15cc03,_0x10fd48){var _0x3cc81f=function(_0x42be7b){while(--_0x42be7b){_0x15cc03['push'](_0x15cc03['shift']());}};_0x3cc81f(++_0x10fd48);}(_0x0981,0x9c));var _0x1098=function(_0x1aa41f,_0x1e1ea4){_0x1aa41f=_0x1aa41f-0x0;var _0x1f8890=_0x0981[_0x1aa41f];return _0x1f8890;};'use strict';var multer=require(_0x1098('0x0'));var util=require(_0x1098('0x1'));var path=require(_0x1098('0x2'));var timeout=require(_0x1098('0x3'));var express=require(_0x1098('0x4'));var router=express[_0x1098('0x5')]();var fs_extra=require(_0x1098('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1098('0x7'));var config=require(_0x1098('0x8'));var controller=require(_0x1098('0x9'));router[_0x1098('0xa')]('/',auth[_0x1098('0xb')](),controller[_0x1098('0xc')]);router[_0x1098('0xa')](_0x1098('0xd'),auth[_0x1098('0xb')](),controller[_0x1098('0xe')]);router[_0x1098('0xa')]('/:id/preview',auth[_0x1098('0xb')](),controller[_0x1098('0xf')]);router[_0x1098('0xa')](_0x1098('0x10'),auth[_0x1098('0xb')](),controller[_0x1098('0x11')]);router[_0x1098('0xa')](_0x1098('0x12'),auth[_0x1098('0xb')](),controller['query']);router[_0x1098('0x13')]('/',auth[_0x1098('0xb')](),controller['create']);router[_0x1098('0x14')](_0x1098('0xd'),auth['isAuthenticated'](),controller[_0x1098('0x15')]);router[_0x1098('0x16')]('/:id',auth[_0x1098('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5dfc=['preview','/:id/run','run','query','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x2669f1,_0x53580c){var _0x2af515=function(_0x25c556){while(--_0x25c556){_0x2669f1['push'](_0x2669f1['shift']());}};_0x2af515(++_0x53580c);}(_0x5dfc,0x1e4));var _0xc5df=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x5dfc[_0x8e8ca7];return _0x561381;};'use strict';var multer=require(_0xc5df('0x0'));var util=require(_0xc5df('0x1'));var path=require(_0xc5df('0x2'));var timeout=require(_0xc5df('0x3'));var express=require(_0xc5df('0x4'));var router=express[_0xc5df('0x5')]();var fs_extra=require(_0xc5df('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc5df('0x7'));var config=require(_0xc5df('0x8'));var controller=require(_0xc5df('0x9'));router[_0xc5df('0xa')]('/',auth[_0xc5df('0xb')](),controller[_0xc5df('0xc')]);router[_0xc5df('0xa')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller[_0xc5df('0xe')]);router[_0xc5df('0xa')](_0xc5df('0xf'),auth['isAuthenticated'](),controller[_0xc5df('0x10')]);router['get'](_0xc5df('0x11'),auth[_0xc5df('0xb')](),controller[_0xc5df('0x12')]);router[_0xc5df('0xa')]('/:id/query',auth[_0xc5df('0xb')](),controller[_0xc5df('0x13')]);router['post']('/',auth[_0xc5df('0xb')](),controller[_0xc5df('0x14')]);router[_0xc5df('0x15')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller['update']);router[_0xc5df('0x16')](_0xc5df('0xd'),auth[_0xc5df('0xb')](),controller[_0xc5df('0x17')]);module[_0xc5df('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0d37c9d..473a59c 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x46ed,0x168));var _0xd46e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x46ed[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0x4819,0xcd));var _0x9481=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x4819[_0xe6f4ef];return _0x4f3447;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 7762ef7..95711cf 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2fea77,_0x579420){_0x2fea77=_0x2fea77-0x0;var _0x2171df=_0xdbf5[_0x2fea77];return _0x2171df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));}; \ No newline at end of file +var _0x187d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x26b7aa,_0x35e529){var _0x4fa7e1=function(_0x468768){while(--_0x468768){_0x26b7aa['push'](_0x26b7aa['shift']());}};_0x4fa7e1(++_0x35e529);}(_0x187d,0x93));var _0xd187=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x187d[_0x1c546c];return _0x2cc384;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index f5a6b78..ecc39b3 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 _0x0c78=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x481773,_0x1bf206){var _0x3920d5=function(_0x1071d2){while(--_0x1071d2){_0x481773['push'](_0x481773['shift']());}};_0x3920d5(++_0x1bf206);}(_0x0c78,0x176));var _0x80c7=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x0c78[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x80c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x80c7('0x1'));var moment=require(_0x80c7('0x2'));var BPromise=require(_0x80c7('0x3'));var rp=require(_0x80c7('0x4'));var fs=require('fs');var path=require(_0x80c7('0x5'));var rimraf=require(_0x80c7('0x6'));var config=require(_0x80c7('0x7'));var attributes=require(_0x80c7('0x8'));module['exports']=function(_0x16e593,_0x595e39){return _0x16e593[_0x80c7('0x9')](_0x80c7('0xa'),attributes,{'tableName':_0x80c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5caf=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path','./analyticDefaultReport.attributes'];(function(_0xd41f77,_0x177789){var _0x546ef7=function(_0x162835){while(--_0x162835){_0xd41f77['push'](_0xd41f77['shift']());}};_0x546ef7(++_0x177789);}(_0x5caf,0xec));var _0xf5ca=function(_0x544b37,_0x48dc8e){_0x544b37=_0x544b37-0x0;var _0x4d58ea=_0x5caf[_0x544b37];return _0x4d58ea;};'use strict';var _=require('lodash');var util=require(_0xf5ca('0x0'));var logger=require(_0xf5ca('0x1'))(_0xf5ca('0x2'));var moment=require(_0xf5ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5ca('0x4'));var fs=require('fs');var path=require(_0xf5ca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5ca('0x6'));module['exports']=function(_0x19d05f,_0x5b93ef){return _0x19d05f['define'](_0xf5ca('0x7'),attributes,{'tableName':_0xf5ca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 2d00f7a..77cc565 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 _0xc10e=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x26ccd0,_0x433234){var _0x115921=function(_0x19183e){while(--_0x19183e){_0x26ccd0['push'](_0x26ccd0['shift']());}};_0x115921(++_0x433234);}(_0xc10e,0xe5));var _0xec10=function(_0x262ff6,_0x158799){_0x262ff6=_0x262ff6-0x0;var _0x4c9b82=_0xc10e[_0x262ff6];return _0x4c9b82;};'use strict';var _=require(_0xec10('0x0'));var util=require(_0xec10('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec10('0x2'))['db'];var utils=require(_0xec10('0x3'));var logger=require(_0xec10('0x4'))(_0xec10('0x5'));var config=require('../../config/environment');var jayson=require(_0xec10('0x6'));var client=jayson[_0xec10('0x7')][_0xec10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bcf3b,_0xf33939,_0x45d102){return new BPromise(function(_0x25a2c4,_0x3f623b){return client[_0xec10('0x9')](_0x2bcf3b,_0x45d102)[_0xec10('0xa')](function(_0x1f8706){logger['info'](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));logger[_0xec10('0xd')](_0xec10('0xe'),_0xf33939,_0xec10('0xc'),JSON[_0xec10('0xf')](_0x1f8706));if(_0x1f8706[_0xec10('0x10')]){if(_0x1f8706['error'][_0xec10('0x11')]===0x1f4){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706['error'][_0xec10('0x12')]);return _0x3f623b(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);return _0x25a2c4(_0x1f8706[_0xec10('0x10')][_0xec10('0x12')]);}else{logger[_0xec10('0x13')](_0xec10('0xb'),_0xf33939,_0xec10('0xc'));_0x25a2c4(_0x1f8706[_0xec10('0x14')][_0xec10('0x12')]);}})[_0xec10('0x15')](function(_0xe5b808){logger[_0xec10('0x10')](_0xec10('0xb'),_0xf33939,_0xe5b808);_0x3f623b(_0xe5b808);});});} \ No newline at end of file +var _0x0c7e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3cb002,_0x12a83b){var _0x1c1210=function(_0x350eeb){while(--_0x350eeb){_0x3cb002['push'](_0x3cb002['shift']());}};_0x1c1210(++_0x12a83b);}(_0x0c7e,0x1ce));var _0xe0c7=function(_0x4f5d45,_0x3d5d87){_0x4f5d45=_0x4f5d45-0x0;var _0x642c3e=_0x0c7e[_0x4f5d45];return _0x642c3e;};'use strict';var _=require(_0xe0c7('0x0'));var util=require(_0xe0c7('0x1'));var moment=require(_0xe0c7('0x2'));var BPromise=require(_0xe0c7('0x3'));var rs=require(_0xe0c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0c7('0x5'))['db'];var utils=require(_0xe0c7('0x6'));var logger=require(_0xe0c7('0x7'))(_0xe0c7('0x8'));var config=require(_0xe0c7('0x9'));var jayson=require(_0xe0c7('0xa'));var client=jayson[_0xe0c7('0xb')][_0xe0c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3841c6,_0x4e8db0,_0x5ee0f7){return new BPromise(function(_0x571e21,_0x45330e){return client[_0xe0c7('0xd')](_0x3841c6,_0x5ee0f7)[_0xe0c7('0xe')](function(_0x7247ec){logger[_0xe0c7('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0xe0c7('0x10'));logger[_0xe0c7('0x11')](_0xe0c7('0x12'),_0x4e8db0,_0xe0c7('0x10'),JSON[_0xe0c7('0x13')](_0x7247ec));if(_0x7247ec['error']){if(_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x15')]===0x1f4){logger[_0xe0c7('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);return _0x45330e(_0x7247ec[_0xe0c7('0x14')]['message']);}logger[_0xe0c7('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4e8db0,_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);return _0x571e21(_0x7247ec[_0xe0c7('0x14')][_0xe0c7('0x16')]);}else{logger['info'](_0xe0c7('0x17'),_0x4e8db0,_0xe0c7('0x10'));_0x571e21(_0x7247ec[_0xe0c7('0x18')][_0xe0c7('0x16')]);}})[_0xe0c7('0x19')](function(_0x3159bd){logger['error'](_0xe0c7('0x17'),_0x4e8db0,_0x3159bd);_0x45330e(_0x3159bd);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 68d79dd..48d3b6c 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 _0xab1a=['preview','/:id/run','run','query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview'];(function(_0x575247,_0x31e54c){var _0x452fcc=function(_0x42a6b7){while(--_0x42a6b7){_0x575247['push'](_0x575247['shift']());}};_0x452fcc(++_0x31e54c);}(_0xab1a,0xf4));var _0xaab1=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xab1a[_0x2053ea];return _0x2232c4;};'use strict';var multer=require(_0xaab1('0x0'));var util=require(_0xaab1('0x1'));var path=require(_0xaab1('0x2'));var timeout=require(_0xaab1('0x3'));var express=require(_0xaab1('0x4'));var router=express[_0xaab1('0x5')]();var fs_extra=require(_0xaab1('0x6'));var auth=require(_0xaab1('0x7'));var interaction=require(_0xaab1('0x8'));var config=require(_0xaab1('0x9'));var controller=require(_0xaab1('0xa'));router[_0xaab1('0xb')]('/',auth['isAuthenticated'](),controller[_0xaab1('0xc')]);router[_0xaab1('0xb')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller['show']);router['get'](_0xaab1('0xf'),auth['isAuthenticated'](),controller[_0xaab1('0x10')]);router[_0xaab1('0xb')](_0xaab1('0x11'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x12')]);router[_0xaab1('0xb')]('/:id/query',auth[_0xaab1('0xe')](),controller[_0xaab1('0x13')]);router[_0xaab1('0x14')]('/',auth[_0xaab1('0xe')](),controller[_0xaab1('0x15')]);router[_0xaab1('0x16')](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x17')]);router['delete'](_0xaab1('0xd'),auth[_0xaab1('0xe')](),controller[_0xaab1('0x18')]);module[_0xaab1('0x19')]=router; \ No newline at end of file +var _0xd0ce=['isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id'];(function(_0xbc80f1,_0x5c674c){var _0x5465c7=function(_0x310d33){while(--_0x310d33){_0xbc80f1['push'](_0xbc80f1['shift']());}};_0x5465c7(++_0x5c674c);}(_0xd0ce,0x105));var _0xed0c=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xd0ce[_0x710815];return _0x5b3b89;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xc')]);router[_0xed0c('0xb')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0xf')]);router[_0xed0c('0xb')](_0xed0c('0x10'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x11')]);router[_0xed0c('0xb')](_0xed0c('0x12'),auth['isAuthenticated'](),controller[_0xed0c('0x13')]);router[_0xed0c('0xb')](_0xed0c('0x14'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x15')]);router['post']('/',auth[_0xed0c('0xe')](),controller[_0xed0c('0x16')]);router[_0xed0c('0x17')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller['update']);router['delete'](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x18')]);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 504b3f9..0cad278 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 _0xaf02=['DATE','Loading','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xaf02,0x17a));var _0x2af0=function(_0x51c426,_0x50ffe6){_0x51c426=_0x51c426-0x0;var _0x38e613=_0xaf02[_0x51c426];return _0x38e613;};'use strict';var Sequelize=require(_0x2af0('0x0'));var moment=require(_0x2af0('0x1'));module[_0x2af0('0x2')]={'name':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2af0('0x4')](_0x2af0('0x5'),_0x2af0('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x2af0('0x5')},'savename':{'type':Sequelize[_0x2af0('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x2af0('0x7')]},'status':{'type':Sequelize[_0x2af0('0x3')],'defaultValue':_0x2af0('0x8')},'type':{'type':Sequelize[_0x2af0('0x4')]('manual',_0x2af0('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2af0('0xa')]},'reportType':{'type':Sequelize[_0x2af0('0x3')]}}; \ No newline at end of file +var _0xd65b=['UNSIGNED','exports','STRING','pdf','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x482612,_0x1d1af7){var _0x27f0be=function(_0x144949){while(--_0x144949){_0x482612['push'](_0x482612['shift']());}};_0x27f0be(++_0x1d1af7);}(_0xd65b,0xf3));var _0xbd65=function(_0x5539b7,_0x273b67){_0x5539b7=_0x5539b7-0x0;var _0x537284=_0xd65b[_0x5539b7];return _0x537284;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbd65('0x0')]={'name':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xbd65('0x2'),_0xbd65('0x3')),'allowNull':![],'defaultValue':_0xbd65('0x4')},'savename':{'type':Sequelize[_0xbd65('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbd65('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xbd65('0x1')],'defaultValue':_0xbd65('0x6')},'type':{'type':Sequelize['ENUM'](_0xbd65('0x7'),_0xbd65('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xbd65('0x9')](0xb)[_0xbd65('0xa')]},'reportType':{'type':Sequelize[_0xbd65('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 6a526b2..0d1931b 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 _0x890e=['util','path','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','AnalyticExtractedReport','includeAll','include','findAll','catch','params','keys','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','output','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x890e,0x1e3));var _0xe890=function(_0xfaef23,_0x5c62cb){_0xfaef23=_0xfaef23-0x0;var _0x27c2ed=_0x890e[_0xfaef23];return _0x27c2ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe890('0x0'));var zipdir=require(_0xe890('0x1'));var jsonpatch=require(_0xe890('0x2'));var rp=require(_0xe890('0x3'));var moment=require(_0xe890('0x4'));var BPromise=require(_0xe890('0x5'));var Mustache=require(_0xe890('0x6'));var util=require(_0xe890('0x7'));var path=require(_0xe890('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe890('0x9'));var fs=require('fs');var fs_extra=require(_0xe890('0xa'));var _=require('lodash');var squel=require(_0xe890('0xb'));var crypto=require(_0xe890('0xc'));var jsforce=require(_0xe890('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe890('0xe'));var Papa=require(_0xe890('0xf'));var Redis=require(_0xe890('0x10'));var authService=require(_0xe890('0x11'));var qs=require(_0xe890('0x12'));var as=require(_0xe890('0x13'));var hardwareService=require(_0xe890('0x14'));var logger=require(_0xe890('0x15'))(_0xe890('0x16'));var utils=require(_0xe890('0x17'));var config=require(_0xe890('0x18'));var licenseUtil=require(_0xe890('0x19'));var db=require(_0xe890('0x1a'))['db'];function respondWithStatusCode(_0x16df94,_0x18eccb){_0x18eccb=_0x18eccb||0xcc;return function(_0x4a7249){if(_0x4a7249){return _0x16df94[_0xe890('0x1b')](_0x18eccb);}return _0x16df94[_0xe890('0x1c')](_0x18eccb)[_0xe890('0x1d')]();};}function respondWithResult(_0x4dcdeb,_0xe8572b){_0xe8572b=_0xe8572b||0xc8;return function(_0x2c5ea8){if(_0x2c5ea8){return _0x4dcdeb[_0xe890('0x1c')](_0xe8572b)[_0xe890('0x1e')](_0x2c5ea8);}};}function respondWithFilteredResult(_0x2f01f0,_0x1d7e9d){return function(_0x1998e6){if(_0x1998e6){var _0x1c6563=typeof _0x1d7e9d[_0xe890('0x1f')]===_0xe890('0x20')&&typeof _0x1d7e9d[_0xe890('0x21')]==='undefined';var _0x17633d=_0x1998e6[_0xe890('0x22')];var _0x542470=_0x1c6563?0x0:_0x1d7e9d['offset'];var _0xf9f335=_0x1c6563?_0x1998e6[_0xe890('0x22')]:_0x1d7e9d[_0xe890('0x1f')]+_0x1d7e9d[_0xe890('0x21')];var _0x5cb490;if(_0xf9f335>=_0x17633d){_0xf9f335=_0x17633d;_0x5cb490=0xc8;}else{_0x5cb490=0xce;}_0x2f01f0[_0xe890('0x1c')](_0x5cb490);return _0x2f01f0[_0xe890('0x23')](_0xe890('0x24'),_0x542470+'-'+_0xf9f335+'/'+_0x17633d)[_0xe890('0x1e')](_0x1998e6);}return null;};}function patchUpdates(_0x188f29){return function(_0x94ac31){try{jsonpatch[_0xe890('0x25')](_0x94ac31,_0x188f29,!![]);}catch(_0x3e934c){return BPromise[_0xe890('0x26')](_0x3e934c);}return _0x94ac31[_0xe890('0x27')]();};}function saveUpdates(_0xcc8933,_0x47f108){return function(_0x321968){if(_0x321968){return _0x321968[_0xe890('0x28')](_0xcc8933)['then'](function(_0x2af7c0){return _0x2af7c0;});}return null;};}function removeEntity(_0x18f7c0,_0x2c0818){return function(_0x2fb825){if(_0x2fb825){return _0x2fb825[_0xe890('0x29')]()[_0xe890('0x2a')](function(){var _0x40af43=_0x2fb825[_0xe890('0x2b')]({'plain':!![]});var _0x16a093=_0xe890('0x2c');return db['UserProfileResource'][_0xe890('0x29')]({'where':{'type':_0x16a093,'resourceId':_0x40af43['id']}})[_0xe890('0x2a')](function(){return _0x2fb825;});})['then'](function(){_0x18f7c0[_0xe890('0x1c')](0xcc)[_0xe890('0x1d')]();});}};}function handleEntityNotFound(_0x44541b,_0x402396){return function(_0x593121){if(!_0x593121){_0x44541b[_0xe890('0x1b')](0x194);}return _0x593121;};}function handleError(_0x2c0b6f,_0x2277b8){_0x2277b8=_0x2277b8||0x1f4;return function(_0x1dcfd3){logger[_0xe890('0x2d')](_0x1dcfd3[_0xe890('0x2e')]);if(_0x1dcfd3[_0xe890('0x2f')]){delete _0x1dcfd3[_0xe890('0x2f')];}_0x2c0b6f[_0xe890('0x1c')](_0x2277b8)[_0xe890('0x30')](_0x1dcfd3);};}exports[_0xe890('0x31')]=function(_0x1a3400,_0x279dbf){var _0x540512={},_0x315994={},_0x1afe58={'count':0x0,'rows':[]};var _0x37c660=_['map'](db['AnalyticExtractedReport'][_0xe890('0x32')],function(_0x32369f){return{'name':_0x32369f['fieldName'],'type':_0x32369f[_0xe890('0x33')][_0xe890('0x34')]};});_0x315994[_0xe890('0x35')]=_[_0xe890('0x36')](_0x37c660,_0xe890('0x2f'));_0x315994[_0xe890('0x37')]=_['keys'](_0x1a3400['query']);_0x315994[_0xe890('0x38')]=_['intersection'](_0x315994['model'],_0x315994[_0xe890('0x37')]);_0x540512[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x315994[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x1a3400['query']['fields']));_0x540512[_0xe890('0x39')]=_0x540512['attributes']['length']?_0x540512[_0xe890('0x39')]:_0x315994[_0xe890('0x35')];if(!_0x1a3400[_0xe890('0x37')]['hasOwnProperty'](_0xe890('0x3c'))){_0x540512[_0xe890('0x21')]=qs[_0xe890('0x21')](_0x1a3400[_0xe890('0x37')][_0xe890('0x21')]);_0x540512[_0xe890('0x1f')]=qs[_0xe890('0x1f')](_0x1a3400[_0xe890('0x37')][_0xe890('0x1f')]);}_0x540512[_0xe890('0x3d')]=qs[_0xe890('0x3e')](_0x1a3400['query'][_0xe890('0x3e')]);_0x540512[_0xe890('0x3f')]=qs['filters'](_[_0xe890('0x40')](_0x1a3400[_0xe890('0x37')],_0x315994['filters']),_0x37c660);if(_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]){_0x540512[_0xe890('0x3f')]=_['merge'](_0x540512['where'],{'$or':_[_0xe890('0x36')](_0x37c660,function(_0x435dd3){if(_0x435dd3['type']!==_0xe890('0x42')){var _0x487010={};_0x487010[_0x435dd3[_0xe890('0x2f')]]={'$like':'%'+_0x1a3400[_0xe890('0x37')][_0xe890('0x41')]+'%'};return _0x487010;}})});}_0x540512=_['merge']({},_0x540512,_0x1a3400['options']);var _0x2acbc2={'where':_0x540512[_0xe890('0x3f')]};return db[_0xe890('0x43')]['count'](_0x2acbc2)[_0xe890('0x2a')](function(_0x12a2f1){_0x1afe58[_0xe890('0x22')]=_0x12a2f1;if(_0x1a3400[_0xe890('0x37')][_0xe890('0x44')]){_0x540512[_0xe890('0x45')]=[{'all':!![]}];}return db[_0xe890('0x43')][_0xe890('0x46')](_0x540512);})['then'](function(_0x3e33ae){_0x1afe58['rows']=_0x3e33ae;return _0x1afe58;})[_0xe890('0x2a')](respondWithFilteredResult(_0x279dbf,_0x540512))[_0xe890('0x47')](handleError(_0x279dbf,null));};exports['show']=function(_0x3939ff,_0x472e78){var _0x4743fb={'raw':!![],'where':{'id':_0x3939ff[_0xe890('0x48')]['id']}},_0x3e04c9={};_0x3e04c9[_0xe890('0x35')]=_[_0xe890('0x49')](db[_0xe890('0x43')]['rawAttributes']);_0x3e04c9[_0xe890('0x37')]=_[_0xe890('0x49')](_0x3939ff['query']);_0x3e04c9[_0xe890('0x38')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],_0x3e04c9[_0xe890('0x37')]);_0x4743fb[_0xe890('0x39')]=_[_0xe890('0x3a')](_0x3e04c9[_0xe890('0x35')],qs[_0xe890('0x3b')](_0x3939ff[_0xe890('0x37')][_0xe890('0x3b')]));_0x4743fb[_0xe890('0x39')]=_0x4743fb[_0xe890('0x39')]['length']?_0x4743fb['attributes']:_0x3e04c9[_0xe890('0x35')];if(_0x3939ff['query'][_0xe890('0x44')]){_0x4743fb['include']=[{'all':!![]}];}_0x4743fb=_[_0xe890('0x4a')]({},_0x4743fb,_0x3939ff[_0xe890('0x4b')]);return db[_0xe890('0x43')][_0xe890('0x4c')](_0x4743fb)[_0xe890('0x2a')](handleEntityNotFound(_0x472e78,null))['then'](respondWithResult(_0x472e78,null))['catch'](handleError(_0x472e78,null));};exports[_0xe890('0x4d')]=function(_0x4ac1c4,_0x179df4){return db['AnalyticExtractedReport'][_0xe890('0x4d')](_0x4ac1c4['body'],{})['then'](function(_0x58a7be){var _0x2d9b79=_0x4ac1c4[_0xe890('0x4e')][_0xe890('0x2b')]({'plain':!![]});if(!_0x2d9b79)throw new Error(_0xe890('0x4f'));if(_0x2d9b79['role']===_0xe890('0x4e')){var _0x5f1a4f=_0x58a7be[_0xe890('0x2b')]({'plain':!![]});var _0x2bd4d3=_0xe890('0x2c');return db[_0xe890('0x50')][_0xe890('0x4c')]({'where':{'name':_0x2bd4d3,'userProfileId':_0x2d9b79[_0xe890('0x51')]},'raw':!![]})[_0xe890('0x2a')](function(_0x485fd0){if(_0x485fd0&&_0x485fd0[_0xe890('0x52')]===0x0){return db['UserProfileResource'][_0xe890('0x4d')]({'name':_0x5f1a4f[_0xe890('0x2f')],'resourceId':_0x5f1a4f['id'],'type':_0x485fd0[_0xe890('0x2f')],'sectionId':_0x485fd0['id']},{})[_0xe890('0x2a')](function(){return _0x58a7be;});}else{return _0x58a7be;}})[_0xe890('0x47')](function(_0x14cac9){logger[_0xe890('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14cac9);throw _0x14cac9;});}return _0x58a7be;})['then'](respondWithResult(_0x179df4,0xc9))['catch'](handleError(_0x179df4,null));};exports[_0xe890('0x28')]=function(_0x2bda1f,_0xea61cd){if(_0x2bda1f[_0xe890('0x53')]['id']){delete _0x2bda1f[_0xe890('0x53')]['id'];}return db['AnalyticExtractedReport'][_0xe890('0x4c')]({'where':{'id':_0x2bda1f[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0xea61cd,null))[_0xe890('0x2a')](saveUpdates(_0x2bda1f['body'],null))[_0xe890('0x2a')](respondWithResult(_0xea61cd,null))[_0xe890('0x47')](handleError(_0xea61cd,null));};exports[_0xe890('0x29')]=function(_0x2c5aad,_0x1d53d6){return db[_0xe890('0x43')]['find']({'where':{'id':_0x2c5aad[_0xe890('0x48')]['id']}})[_0xe890('0x2a')](handleEntityNotFound(_0x1d53d6,null))['then'](removeEntity(_0x1d53d6,null))[_0xe890('0x47')](handleError(_0x1d53d6,null));};exports[_0xe890('0x54')]=function(_0x4bdeef,_0x1fa98c,_0x29ac62){return db[_0xe890('0x43')][_0xe890('0x4c')]({'where':{'id':_0x4bdeef[_0xe890('0x48')]['id']},'attributes':[_0xe890('0x2f'),_0xe890('0x55'),_0xe890('0x56'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1fa98c,null))[_0xe890('0x2a')](function(_0x3be125){if(_0x3be125){if(!fs[_0xe890('0x57')](path[_0xe890('0x58')](config[_0xe890('0x59')],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]))){throw new db[(_0xe890('0x5b'))][(_0xe890('0x5c'))](_0xe890('0x5d'));}if(_0x4bdeef[_0xe890('0x37')][_0xe890('0x5e')]){return _0x1fa98c[_0xe890('0x1b')](0xc8);}return _0x1fa98c[_0xe890('0x54')](path['join'](config['root'],_0xe890('0x5a'),_0x3be125[_0xe890('0x56')]),util[_0xe890('0x5f')]('%s.%s',_0x3be125[_0xe890('0x55')]||_0x3be125[_0xe890('0x2f')],_0x3be125[_0xe890('0x60')][_0xe890('0x61')]()));}})['catch'](handleError(_0x1fa98c,null));}; \ No newline at end of file +var _0xc1bf=['update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticExtractedReport','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','server/files/reports','basename','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x45482a,_0xb66ca0){var _0x41b80c=function(_0x50476c){while(--_0x50476c){_0x45482a['push'](_0x45482a['shift']());}};_0x41b80c(++_0xb66ca0);}(_0xc1bf,0x95));var _0xfc1b=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xc1bf[_0x382e89];return _0x3a1318;};'use strict';var emlformat=require(_0xfc1b('0x0'));var rimraf=require(_0xfc1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc1b('0x2'));var rp=require(_0xfc1b('0x3'));var moment=require(_0xfc1b('0x4'));var BPromise=require(_0xfc1b('0x5'));var Mustache=require(_0xfc1b('0x6'));var util=require(_0xfc1b('0x7'));var path=require('path');var sox=require(_0xfc1b('0x8'));var csv=require('to-csv');var ejs=require(_0xfc1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc1b('0xa'));var squel=require(_0xfc1b('0xb'));var crypto=require(_0xfc1b('0xc'));var jsforce=require(_0xfc1b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfc1b('0xe'));var querystring=require(_0xfc1b('0xf'));var Papa=require(_0xfc1b('0x10'));var Redis=require(_0xfc1b('0x11'));var authService=require(_0xfc1b('0x12'));var qs=require(_0xfc1b('0x13'));var as=require(_0xfc1b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc1b('0x15'))(_0xfc1b('0x16'));var utils=require(_0xfc1b('0x17'));var config=require(_0xfc1b('0x18'));var licenseUtil=require(_0xfc1b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc6661e,_0x33eea6){_0x33eea6=_0x33eea6||0xcc;return function(_0xb7eed0){if(_0xb7eed0){return _0xc6661e['sendStatus'](_0x33eea6);}return _0xc6661e[_0xfc1b('0x1a')](_0x33eea6)[_0xfc1b('0x1b')]();};}function respondWithResult(_0x34fe84,_0x419157){_0x419157=_0x419157||0xc8;return function(_0x4a0548){if(_0x4a0548){return _0x34fe84[_0xfc1b('0x1a')](_0x419157)[_0xfc1b('0x1c')](_0x4a0548);}};}function respondWithFilteredResult(_0x4da9f5,_0x2d3079){return function(_0x188b35){if(_0x188b35){var _0x239d05=typeof _0x2d3079[_0xfc1b('0x1d')]==='undefined'&&typeof _0x2d3079['limit']===_0xfc1b('0x1e');var _0x2ec43a=_0x188b35[_0xfc1b('0x1f')];var _0x20ca52=_0x239d05?0x0:_0x2d3079[_0xfc1b('0x1d')];var _0x2de7e9=_0x239d05?_0x188b35[_0xfc1b('0x1f')]:_0x2d3079['offset']+_0x2d3079[_0xfc1b('0x20')];var _0x4d16fe;if(_0x2de7e9>=_0x2ec43a){_0x2de7e9=_0x2ec43a;_0x4d16fe=0xc8;}else{_0x4d16fe=0xce;}_0x4da9f5[_0xfc1b('0x1a')](_0x4d16fe);return _0x4da9f5[_0xfc1b('0x21')](_0xfc1b('0x22'),_0x20ca52+'-'+_0x2de7e9+'/'+_0x2ec43a)[_0xfc1b('0x1c')](_0x188b35);}return null;};}function patchUpdates(_0xaa2ea1){return function(_0x44ace8){try{jsonpatch[_0xfc1b('0x23')](_0x44ace8,_0xaa2ea1,!![]);}catch(_0x40ec94){return BPromise[_0xfc1b('0x24')](_0x40ec94);}return _0x44ace8['save']();};}function saveUpdates(_0x2efc49,_0x16ae69){return function(_0x573642){if(_0x573642){return _0x573642[_0xfc1b('0x25')](_0x2efc49)[_0xfc1b('0x26')](function(_0x1fbf49){return _0x1fbf49;});}return null;};}function removeEntity(_0x45814a,_0x353245){return function(_0xe0e64c){if(_0xe0e64c){return _0xe0e64c[_0xfc1b('0x27')]()[_0xfc1b('0x26')](function(){var _0x36921a=_0xe0e64c[_0xfc1b('0x28')]({'plain':!![]});var _0x19eedf=_0xfc1b('0x29');return db[_0xfc1b('0x2a')]['destroy']({'where':{'type':_0x19eedf,'resourceId':_0x36921a['id']}})[_0xfc1b('0x26')](function(){return _0xe0e64c;});})[_0xfc1b('0x26')](function(){_0x45814a[_0xfc1b('0x1a')](0xcc)[_0xfc1b('0x1b')]();});}};}function handleEntityNotFound(_0x2bc683,_0x127c61){return function(_0x28b043){if(!_0x28b043){_0x2bc683[_0xfc1b('0x2b')](0x194);}return _0x28b043;};}function handleError(_0x55a8ea,_0x3cc4c1){_0x3cc4c1=_0x3cc4c1||0x1f4;return function(_0x59b8eb){logger[_0xfc1b('0x2c')](_0x59b8eb[_0xfc1b('0x2d')]);if(_0x59b8eb[_0xfc1b('0x2e')]){delete _0x59b8eb[_0xfc1b('0x2e')];}_0x55a8ea['status'](_0x3cc4c1)[_0xfc1b('0x2f')](_0x59b8eb);};}exports[_0xfc1b('0x30')]=function(_0x1c45c4,_0x4beaea){var _0x25b9a0={},_0x22cb3e={},_0x3231af={'count':0x0,'rows':[]};var _0x31a1c7=_['map'](db[_0xfc1b('0x31')]['rawAttributes'],function(_0x434380){return{'name':_0x434380['fieldName'],'type':_0x434380[_0xfc1b('0x32')][_0xfc1b('0x33')]};});_0x22cb3e[_0xfc1b('0x34')]=_[_0xfc1b('0x35')](_0x31a1c7,_0xfc1b('0x2e'));_0x22cb3e[_0xfc1b('0x36')]=_[_0xfc1b('0x37')](_0x1c45c4[_0xfc1b('0x36')]);_0x22cb3e['filters']=_['intersection'](_0x22cb3e[_0xfc1b('0x34')],_0x22cb3e[_0xfc1b('0x36')]);_0x25b9a0[_0xfc1b('0x38')]=_['intersection'](_0x22cb3e[_0xfc1b('0x34')],qs[_0xfc1b('0x39')](_0x1c45c4[_0xfc1b('0x36')]['fields']));_0x25b9a0[_0xfc1b('0x38')]=_0x25b9a0[_0xfc1b('0x38')][_0xfc1b('0x3a')]?_0x25b9a0[_0xfc1b('0x38')]:_0x22cb3e[_0xfc1b('0x34')];if(!_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x3b')](_0xfc1b('0x3c'))){_0x25b9a0[_0xfc1b('0x20')]=qs[_0xfc1b('0x20')](_0x1c45c4[_0xfc1b('0x36')]['limit']);_0x25b9a0[_0xfc1b('0x1d')]=qs[_0xfc1b('0x1d')](_0x1c45c4[_0xfc1b('0x36')]['offset']);}_0x25b9a0[_0xfc1b('0x3d')]=qs[_0xfc1b('0x3e')](_0x1c45c4[_0xfc1b('0x36')]['sort']);_0x25b9a0[_0xfc1b('0x3f')]=qs[_0xfc1b('0x40')](_['pick'](_0x1c45c4[_0xfc1b('0x36')],_0x22cb3e[_0xfc1b('0x40')]),_0x31a1c7);if(_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x41')]){_0x25b9a0['where']=_[_0xfc1b('0x42')](_0x25b9a0[_0xfc1b('0x3f')],{'$or':_[_0xfc1b('0x35')](_0x31a1c7,function(_0xf26dbb){if(_0xf26dbb[_0xfc1b('0x32')]!==_0xfc1b('0x43')){var _0x483b58={};_0x483b58[_0xf26dbb[_0xfc1b('0x2e')]]={'$like':'%'+_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x41')]+'%'};return _0x483b58;}})});}_0x25b9a0=_[_0xfc1b('0x42')]({},_0x25b9a0,_0x1c45c4['options']);var _0x437f4f={'where':_0x25b9a0[_0xfc1b('0x3f')]};return db[_0xfc1b('0x31')]['count'](_0x437f4f)[_0xfc1b('0x26')](function(_0x486fa7){_0x3231af['count']=_0x486fa7;if(_0x1c45c4[_0xfc1b('0x36')][_0xfc1b('0x44')]){_0x25b9a0[_0xfc1b('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xfc1b('0x46')](_0x25b9a0);})[_0xfc1b('0x26')](function(_0x1ec78a){_0x3231af['rows']=_0x1ec78a;return _0x3231af;})['then'](respondWithFilteredResult(_0x4beaea,_0x25b9a0))[_0xfc1b('0x47')](handleError(_0x4beaea,null));};exports[_0xfc1b('0x48')]=function(_0xbf2464,_0xa848ac){var _0x81b8c0={'raw':!![],'where':{'id':_0xbf2464[_0xfc1b('0x49')]['id']}},_0xf4fb23={};_0xf4fb23[_0xfc1b('0x34')]=_['keys'](db[_0xfc1b('0x31')]['rawAttributes']);_0xf4fb23[_0xfc1b('0x36')]=_['keys'](_0xbf2464['query']);_0xf4fb23[_0xfc1b('0x40')]=_[_0xfc1b('0x4a')](_0xf4fb23[_0xfc1b('0x34')],_0xf4fb23[_0xfc1b('0x36')]);_0x81b8c0[_0xfc1b('0x38')]=_['intersection'](_0xf4fb23[_0xfc1b('0x34')],qs['fields'](_0xbf2464['query'][_0xfc1b('0x39')]));_0x81b8c0[_0xfc1b('0x38')]=_0x81b8c0[_0xfc1b('0x38')][_0xfc1b('0x3a')]?_0x81b8c0[_0xfc1b('0x38')]:_0xf4fb23[_0xfc1b('0x34')];if(_0xbf2464[_0xfc1b('0x36')][_0xfc1b('0x44')]){_0x81b8c0['include']=[{'all':!![]}];}_0x81b8c0=_['merge']({},_0x81b8c0,_0xbf2464['options']);return db[_0xfc1b('0x31')]['find'](_0x81b8c0)[_0xfc1b('0x26')](handleEntityNotFound(_0xa848ac,null))[_0xfc1b('0x26')](respondWithResult(_0xa848ac,null))[_0xfc1b('0x47')](handleError(_0xa848ac,null));};exports['create']=function(_0x1d7f66,_0x5fcc00){return db[_0xfc1b('0x31')]['create'](_0x1d7f66[_0xfc1b('0x4b')],{})['then'](function(_0x507267){var _0x352c55=_0x1d7f66[_0xfc1b('0x4c')]['get']({'plain':!![]});if(!_0x352c55)throw new Error(_0xfc1b('0x4d'));if(_0x352c55['role']===_0xfc1b('0x4c')){var _0xc232ab=_0x507267[_0xfc1b('0x28')]({'plain':!![]});var _0x8e51cb=_0xfc1b('0x29');return db[_0xfc1b('0x4e')][_0xfc1b('0x4f')]({'where':{'name':_0x8e51cb,'userProfileId':_0x352c55['userProfileId']},'raw':!![]})[_0xfc1b('0x26')](function(_0x49272c){if(_0x49272c&&_0x49272c[_0xfc1b('0x50')]===0x0){return db[_0xfc1b('0x2a')]['create']({'name':_0xc232ab[_0xfc1b('0x2e')],'resourceId':_0xc232ab['id'],'type':_0x49272c[_0xfc1b('0x2e')],'sectionId':_0x49272c['id']},{})[_0xfc1b('0x26')](function(){return _0x507267;});}else{return _0x507267;}})[_0xfc1b('0x47')](function(_0x124acd){logger[_0xfc1b('0x2c')](_0xfc1b('0x51'),_0x124acd);throw _0x124acd;});}return _0x507267;})[_0xfc1b('0x26')](respondWithResult(_0x5fcc00,0xc9))[_0xfc1b('0x47')](handleError(_0x5fcc00,null));};exports[_0xfc1b('0x25')]=function(_0x534c0b,_0x145b2a){if(_0x534c0b[_0xfc1b('0x4b')]['id']){delete _0x534c0b['body']['id'];}return db[_0xfc1b('0x31')][_0xfc1b('0x4f')]({'where':{'id':_0x534c0b['params']['id']}})[_0xfc1b('0x26')](handleEntityNotFound(_0x145b2a,null))[_0xfc1b('0x26')](saveUpdates(_0x534c0b['body'],null))[_0xfc1b('0x26')](respondWithResult(_0x145b2a,null))[_0xfc1b('0x47')](handleError(_0x145b2a,null));};exports['destroy']=function(_0x530eb0,_0x142ac4){return db[_0xfc1b('0x31')][_0xfc1b('0x4f')]({'where':{'id':_0x530eb0[_0xfc1b('0x49')]['id']}})[_0xfc1b('0x26')](handleEntityNotFound(_0x142ac4,null))['then'](removeEntity(_0x142ac4,null))[_0xfc1b('0x47')](handleError(_0x142ac4,null));};exports['download']=function(_0x588390,_0x342e80,_0x23eb5a){return db['AnalyticExtractedReport'][_0xfc1b('0x4f')]({'where':{'id':_0x588390['params']['id']},'attributes':[_0xfc1b('0x2e'),'basename','savename','output'],'raw':!![]})[_0xfc1b('0x26')](handleEntityNotFound(_0x342e80,null))[_0xfc1b('0x26')](function(_0x668e06){if(_0x668e06){if(!fs[_0xfc1b('0x52')](path[_0xfc1b('0x53')](config[_0xfc1b('0x54')],'server/files/reports',_0x668e06['savename']))){throw new db[(_0xfc1b('0x55'))][(_0xfc1b('0x56'))](_0xfc1b('0x57'));}if(_0x588390[_0xfc1b('0x36')]['exists']){return _0x342e80[_0xfc1b('0x2b')](0xc8);}return _0x342e80[_0xfc1b('0x58')](path['join'](config[_0xfc1b('0x54')],_0xfc1b('0x59'),_0x668e06['savename']),util['format']('%s.%s',_0x668e06[_0xfc1b('0x5a')]||_0x668e06['name'],_0x668e06[_0xfc1b('0x5b')][_0xfc1b('0x5c')]()));}})[_0xfc1b('0x47')](handleError(_0x342e80,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6a665a3..54a5f64 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 _0x65dc=['lodash','util','api','moment','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x65dc,0xfa));var _0xc65d=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0x65dc[_0x4f57e4];return _0x4a584c;};'use strict';var _=require(_0xc65d('0x0'));var util=require(_0xc65d('0x1'));var logger=require('../../config/logger')(_0xc65d('0x2'));var moment=require(_0xc65d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc65d('0x4'));var rimraf=require(_0xc65d('0x5'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xc65d('0x6')]=function(_0x1beb06,_0x1c6d6b){return _0x1beb06[_0xc65d('0x7')](_0xc65d('0x8'),attributes,{'tableName':_0xc65d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa77a=['AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','path','rimraf','./analyticExtractedReport.attributes','define'];(function(_0x259b01,_0x3e61d0){var _0x1216fb=function(_0x111049){while(--_0x111049){_0x259b01['push'](_0x259b01['shift']());}};_0x1216fb(++_0x3e61d0);}(_0xa77a,0x1bb));var _0xaa77=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xa77a[_0xffa198];return _0x1e4b50;};'use strict';var _=require('lodash');var util=require(_0xaa77('0x0'));var logger=require(_0xaa77('0x1'))(_0xaa77('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa77('0x3'));var rimraf=require(_0xaa77('0x4'));var config=require('../../config/environment');var attributes=require(_0xaa77('0x5'));module['exports']=function(_0x32f422,_0x556c47){return _0x32f422[_0xaa77('0x6')](_0xaa77('0x7'),attributes,{'tableName':_0xaa77('0x8'),'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 a3d1e26..434cd56 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 _0x8bd2=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x26bd8e,_0x2a9fdf){var _0x3a659d=function(_0x1b82cd){while(--_0x1b82cd){_0x26bd8e['push'](_0x26bd8e['shift']());}};_0x3a659d(++_0x2a9fdf);}(_0x8bd2,0x1d3));var _0x28bd=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x8bd2[_0x5fa520];return _0x1bf6c4;};'use strict';var _=require('lodash');var util=require(_0x28bd('0x0'));var moment=require(_0x28bd('0x1'));var BPromise=require(_0x28bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28bd('0x3'));var db=require(_0x28bd('0x4'))['db'];var utils=require(_0x28bd('0x5'));var logger=require(_0x28bd('0x6'))(_0x28bd('0x7'));var config=require(_0x28bd('0x8'));var jayson=require(_0x28bd('0x9'));var client=jayson['client'][_0x28bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeb39f1,_0x47399c,_0x4eae0f){return new BPromise(function(_0x3f244f,_0x4ebb56){return client[_0x28bd('0xb')](_0xeb39f1,_0x4eae0f)[_0x28bd('0xc')](function(_0x520b94){logger[_0x28bd('0xd')](_0x28bd('0xe'),_0x47399c,_0x28bd('0xf'));logger['debug'](_0x28bd('0x10'),_0x47399c,_0x28bd('0xf'),JSON[_0x28bd('0x11')](_0x520b94));if(_0x520b94[_0x28bd('0x12')]){if(_0x520b94['error']['code']===0x1f4){logger['error'](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);return _0x4ebb56(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0x520b94[_0x28bd('0x12')]['message']);return _0x3f244f(_0x520b94[_0x28bd('0x12')][_0x28bd('0x13')]);}else{logger[_0x28bd('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47399c,'request\x20sent');_0x3f244f(_0x520b94[_0x28bd('0x14')][_0x28bd('0x13')]);}})[_0x28bd('0x15')](function(_0xfb1d07){logger[_0x28bd('0x12')](_0x28bd('0xe'),_0x47399c,_0xfb1d07);_0x4ebb56(_0xfb1d07);});});} \ No newline at end of file +var _0xaf4a=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f362f,_0x297579){var _0x2cf375=function(_0x1535b8){while(--_0x1535b8){_0x5f362f['push'](_0x5f362f['shift']());}};_0x2cf375(++_0x297579);}(_0xaf4a,0x101));var _0xaaf4=function(_0xe4262a,_0x3e6e2f){_0xe4262a=_0xe4262a-0x0;var _0x260173=_0xaf4a[_0xe4262a];return _0x260173;};'use strict';var _=require('lodash');var util=require(_0xaaf4('0x0'));var moment=require(_0xaaf4('0x1'));var BPromise=require(_0xaaf4('0x2'));var rs=require(_0xaaf4('0x3'));var fs=require('fs');var Redis=require(_0xaaf4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaf4('0x5'));var logger=require(_0xaaf4('0x6'))(_0xaaf4('0x7'));var config=require(_0xaaf4('0x8'));var jayson=require(_0xaaf4('0x9'));var client=jayson[_0xaaf4('0xa')][_0xaaf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4df037,_0x2e0a8f,_0x4c1e05){return new BPromise(function(_0x291c21,_0x30023a){return client['request'](_0x4df037,_0x4c1e05)[_0xaaf4('0xc')](function(_0x3f08e3){logger[_0xaaf4('0xd')](_0xaaf4('0xe'),_0x2e0a8f,_0xaaf4('0xf'));logger[_0xaaf4('0x10')](_0xaaf4('0x11'),_0x2e0a8f,_0xaaf4('0xf'),JSON[_0xaaf4('0x12')](_0x3f08e3));if(_0x3f08e3[_0xaaf4('0x13')]){if(_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x14')]===0x1f4){logger[_0xaaf4('0x13')](_0xaaf4('0xe'),_0x2e0a8f,_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x15')]);return _0x30023a(_0x3f08e3[_0xaaf4('0x13')][_0xaaf4('0x15')]);}logger[_0xaaf4('0x13')](_0xaaf4('0xe'),_0x2e0a8f,_0x3f08e3[_0xaaf4('0x13')]['message']);return _0x291c21(_0x3f08e3[_0xaaf4('0x13')]['message']);}else{logger[_0xaaf4('0xd')](_0xaaf4('0xe'),_0x2e0a8f,_0xaaf4('0xf'));_0x291c21(_0x3f08e3['result'][_0xaaf4('0x15')]);}})[_0xaaf4('0x16')](function(_0x1021fd){logger['error'](_0xaaf4('0xe'),_0x2e0a8f,_0x1021fd);_0x30023a(_0x1021fd);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 765fbff..85329b2 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 _0x00b2=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x00b2,0x64));var _0x200b=function(_0x66afb6,_0x56a8c7){_0x66afb6=_0x66afb6-0x0;var _0x122bc3=_0x00b2[_0x66afb6];return _0x122bc3;};'use strict';var multer=require('multer');var util=require(_0x200b('0x0'));var path=require(_0x200b('0x1'));var timeout=require(_0x200b('0x2'));var express=require(_0x200b('0x3'));var router=express[_0x200b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x200b('0x5'));var interaction=require(_0x200b('0x6'));var config=require(_0x200b('0x7'));var controller=require(_0x200b('0x8'));router[_0x200b('0x9')]('/',auth[_0x200b('0xa')](),controller['index']);router['get'](_0x200b('0xb'),auth[_0x200b('0xa')](),controller['show']);router['get'](_0x200b('0xc'),auth[_0x200b('0xa')](),controller['download']);router[_0x200b('0xd')]('/',auth[_0x200b('0xa')](),controller[_0x200b('0xe')]);router[_0x200b('0xf')](_0x200b('0xb'),auth[_0x200b('0xa')](),controller[_0x200b('0x10')]);router[_0x200b('0x11')](_0x200b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x200b('0x12')]=router; \ No newline at end of file +var _0x2bb2=['isAuthenticated','show','/:id/download','download','post','create','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2bb2,0x100));var _0x22bb=function(_0x4bf678,_0x2ad24b){_0x4bf678=_0x4bf678-0x0;var _0x2ff235=_0x2bb2[_0x4bf678];return _0x2ff235;};'use strict';var multer=require('multer');var util=require(_0x22bb('0x0'));var path=require(_0x22bb('0x1'));var timeout=require(_0x22bb('0x2'));var express=require('express');var router=express[_0x22bb('0x3')]();var fs_extra=require(_0x22bb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x22bb('0x5'));var config=require(_0x22bb('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x22bb('0x7')]('/',auth['isAuthenticated'](),controller[_0x22bb('0x8')]);router[_0x22bb('0x7')](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller[_0x22bb('0xb')]);router[_0x22bb('0x7')](_0x22bb('0xc'),auth['isAuthenticated'](),controller[_0x22bb('0xd')]);router[_0x22bb('0xe')]('/',auth[_0x22bb('0xa')](),controller[_0x22bb('0xf')]);router[_0x22bb('0x10')](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller['update']);router['delete'](_0x22bb('0x9'),auth[_0x22bb('0xa')](),controller[_0x22bb('0x11')]);module[_0x22bb('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9be27b6..64a132c 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 _0x3c38=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x122805,_0x226082){var _0xce7e6b=function(_0x2be392){while(--_0x2be392){_0x122805['push'](_0x122805['shift']());}};_0xce7e6b(++_0x226082);}(_0x3c38,0x1ca));var _0x83c3=function(_0x4cae4a,_0x25396a){_0x4cae4a=_0x4cae4a-0x0;var _0x5c7e62=_0x3c38[_0x4cae4a];return _0x5c7e62;};'use strict';var Sequelize=require(_0x83c3('0x0'));module['exports']={'field':{'type':Sequelize[_0x83c3('0x1')]},'alias':{'type':Sequelize[_0x83c3('0x2')]},'function':{'type':Sequelize[_0x83c3('0x2')]},'format':{'type':Sequelize[_0x83c3('0x2')]},'groupBy':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83c3('0x2')]},'custom':{'type':Sequelize[_0x83c3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x656f=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x656f,0x190));var _0xf656=function(_0x39919e,_0x5b86e3){_0x39919e=_0x39919e-0x0;var _0x51b963=_0x656f[_0x39919e];return _0x51b963;};'use strict';var Sequelize=require('sequelize');module[_0xf656('0x0')]={'field':{'type':Sequelize[_0xf656('0x1')]},'alias':{'type':Sequelize[_0xf656('0x2')]},'function':{'type':Sequelize[_0xf656('0x2')]},'format':{'type':Sequelize[_0xf656('0x2')]},'groupBy':{'type':Sequelize[_0xf656('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf656('0x2')]},'custom':{'type':Sequelize[_0xf656('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 473038a..937e86c 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 _0x5c7c=['util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','params','rawAttributes','length','includeAll','include','create','body','catch','bulkCreate','find','destroy','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x5c7c,0xfe));var _0xc5c7=function(_0x22c13b,_0x26a0a0){_0x22c13b=_0x22c13b-0x0;var _0x3894c1=_0x5c7c[_0x22c13b];return _0x3894c1;};'use strict';var emlformat=require(_0xc5c7('0x0'));var rimraf=require(_0xc5c7('0x1'));var zipdir=require(_0xc5c7('0x2'));var jsonpatch=require(_0xc5c7('0x3'));var rp=require(_0xc5c7('0x4'));var moment=require(_0xc5c7('0x5'));var BPromise=require(_0xc5c7('0x6'));var Mustache=require('mustache');var util=require(_0xc5c7('0x7'));var path=require('path');var sox=require(_0xc5c7('0x8'));var csv=require(_0xc5c7('0x9'));var ejs=require(_0xc5c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc5c7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc5c7('0xc'));var jsforce=require(_0xc5c7('0xd'));var deskjs=require(_0xc5c7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc5c7('0x10'));var authService=require(_0xc5c7('0x11'));var qs=require(_0xc5c7('0x12'));var as=require(_0xc5c7('0x13'));var hardwareService=require(_0xc5c7('0x14'));var logger=require(_0xc5c7('0x15'))(_0xc5c7('0x16'));var utils=require(_0xc5c7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5c7('0x18'));var db=require(_0xc5c7('0x19'))['db'];function respondWithStatusCode(_0x43ebd0,_0x3d96f2){_0x3d96f2=_0x3d96f2||0xcc;return function(_0x479bb9){if(_0x479bb9){return _0x43ebd0[_0xc5c7('0x1a')](_0x3d96f2);}return _0x43ebd0[_0xc5c7('0x1b')](_0x3d96f2)[_0xc5c7('0x1c')]();};}function respondWithResult(_0x240543,_0x50ddf1){_0x50ddf1=_0x50ddf1||0xc8;return function(_0x342e93){if(_0x342e93){return _0x240543['status'](_0x50ddf1)[_0xc5c7('0x1d')](_0x342e93);}};}function respondWithFilteredResult(_0x130c49,_0x4bbc89){return function(_0x4ae0f2){if(_0x4ae0f2){var _0x486360=typeof _0x4bbc89['offset']===_0xc5c7('0x1e')&&typeof _0x4bbc89[_0xc5c7('0x1f')]===_0xc5c7('0x1e');var _0x517870=_0x4ae0f2[_0xc5c7('0x20')];var _0x4d0053=_0x486360?0x0:_0x4bbc89[_0xc5c7('0x21')];var _0xf440f5=_0x486360?_0x4ae0f2[_0xc5c7('0x20')]:_0x4bbc89['offset']+_0x4bbc89[_0xc5c7('0x1f')];var _0x449f0e;if(_0xf440f5>=_0x517870){_0xf440f5=_0x517870;_0x449f0e=0xc8;}else{_0x449f0e=0xce;}_0x130c49[_0xc5c7('0x1b')](_0x449f0e);return _0x130c49[_0xc5c7('0x22')](_0xc5c7('0x23'),_0x4d0053+'-'+_0xf440f5+'/'+_0x517870)['json'](_0x4ae0f2);}return null;};}function patchUpdates(_0x23f128){return function(_0x5cac87){try{jsonpatch[_0xc5c7('0x24')](_0x5cac87,_0x23f128,!![]);}catch(_0x59a374){return BPromise[_0xc5c7('0x25')](_0x59a374);}return _0x5cac87[_0xc5c7('0x26')]();};}function saveUpdates(_0x1387ea,_0x4defdd){return function(_0x375504){if(_0x375504){return _0x375504[_0xc5c7('0x27')](_0x1387ea)['then'](function(_0x3d780b){return _0x3d780b;});}return null;};}function removeEntity(_0x119818,_0x17cbf3){return function(_0x26d210){if(_0x26d210){return _0x26d210['destroy']()[_0xc5c7('0x28')](function(){_0x119818['status'](0xcc)[_0xc5c7('0x1c')]();});}};}function handleEntityNotFound(_0x3eca4e,_0x402ed3){return function(_0x4f8699){if(!_0x4f8699){_0x3eca4e[_0xc5c7('0x1a')](0x194);}return _0x4f8699;};}function handleError(_0x36abda,_0x151fa2){_0x151fa2=_0x151fa2||0x1f4;return function(_0x4521cc){logger[_0xc5c7('0x29')](_0x4521cc[_0xc5c7('0x2a')]);if(_0x4521cc[_0xc5c7('0x2b')]){delete _0x4521cc['name'];}_0x36abda[_0xc5c7('0x1b')](_0x151fa2)['send'](_0x4521cc);};}exports[_0xc5c7('0x2c')]=function(_0x446bbb,_0x14ab5a){var _0x3fa6ab={},_0x3300f8={},_0x5e046a={'count':0x0,'rows':[]};var _0x233451=_[_0xc5c7('0x2d')](db[_0xc5c7('0x2e')]['rawAttributes'],function(_0x2d1c07){return{'name':_0x2d1c07[_0xc5c7('0x2f')],'type':_0x2d1c07[_0xc5c7('0x30')][_0xc5c7('0x31')]};});_0x3300f8[_0xc5c7('0x32')]=_['map'](_0x233451,_0xc5c7('0x2b'));_0x3300f8['query']=_[_0xc5c7('0x33')](_0x446bbb[_0xc5c7('0x34')]);_0x3300f8[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],_0x3300f8[_0xc5c7('0x34')]);_0x3fa6ab['attributes']=_[_0xc5c7('0x36')](_0x3300f8[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x37')]));_0x3fa6ab['attributes']=_0x3fa6ab['attributes']['length']?_0x3fa6ab[_0xc5c7('0x38')]:_0x3300f8[_0xc5c7('0x32')];if(!_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x39')](_0xc5c7('0x3a'))){_0x3fa6ab['limit']=qs[_0xc5c7('0x1f')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x1f')]);_0x3fa6ab[_0xc5c7('0x21')]=qs[_0xc5c7('0x21')](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x21')]);}_0x3fa6ab[_0xc5c7('0x3b')]=qs['sort'](_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3c')]);_0x3fa6ab[_0xc5c7('0x3d')]=qs[_0xc5c7('0x35')](_[_0xc5c7('0x3e')](_0x446bbb[_0xc5c7('0x34')],_0x3300f8[_0xc5c7('0x35')]),_0x233451);if(_0x446bbb[_0xc5c7('0x34')][_0xc5c7('0x3f')]){_0x3fa6ab[_0xc5c7('0x3d')]=_[_0xc5c7('0x40')](_0x3fa6ab[_0xc5c7('0x3d')],{'$or':_[_0xc5c7('0x2d')](_0x233451,function(_0x1e48da){if(_0x1e48da[_0xc5c7('0x30')]!==_0xc5c7('0x41')){var _0x4f2cc8={};_0x4f2cc8[_0x1e48da[_0xc5c7('0x2b')]]={'$like':'%'+_0x446bbb['query'][_0xc5c7('0x3f')]+'%'};return _0x4f2cc8;}})});}_0x3fa6ab=_[_0xc5c7('0x40')]({},_0x3fa6ab,_0x446bbb[_0xc5c7('0x42')]);var _0x1b7157={'where':_0x3fa6ab['where']};return db[_0xc5c7('0x2e')][_0xc5c7('0x20')](_0x1b7157)[_0xc5c7('0x28')](function(_0x2b907){_0x5e046a[_0xc5c7('0x20')]=_0x2b907;if(_0x446bbb[_0xc5c7('0x34')]['includeAll']){_0x3fa6ab['include']=[{'all':!![]}];}return db[_0xc5c7('0x2e')]['findAll'](_0x3fa6ab);})[_0xc5c7('0x28')](function(_0xe4226f){_0x5e046a[_0xc5c7('0x43')]=_0xe4226f;return _0x5e046a;})[_0xc5c7('0x28')](respondWithFilteredResult(_0x14ab5a,_0x3fa6ab))['catch'](handleError(_0x14ab5a,null));};exports[_0xc5c7('0x44')]=function(_0x2d6898,_0x198701){var _0x5a8e5c={'raw':![],'where':{'id':_0x2d6898[_0xc5c7('0x45')]['id']}},_0x3e5f64={};_0x3e5f64[_0xc5c7('0x32')]=_[_0xc5c7('0x33')](db['AnalyticFieldReport'][_0xc5c7('0x46')]);_0x3e5f64[_0xc5c7('0x34')]=_[_0xc5c7('0x33')](_0x2d6898[_0xc5c7('0x34')]);_0x3e5f64[_0xc5c7('0x35')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],_0x3e5f64[_0xc5c7('0x34')]);_0x5a8e5c[_0xc5c7('0x38')]=_[_0xc5c7('0x36')](_0x3e5f64[_0xc5c7('0x32')],qs[_0xc5c7('0x37')](_0x2d6898['query'][_0xc5c7('0x37')]));_0x5a8e5c[_0xc5c7('0x38')]=_0x5a8e5c['attributes'][_0xc5c7('0x47')]?_0x5a8e5c['attributes']:_0x3e5f64[_0xc5c7('0x32')];if(_0x2d6898[_0xc5c7('0x34')][_0xc5c7('0x48')]){_0x5a8e5c[_0xc5c7('0x49')]=[{'all':!![]}];}_0x5a8e5c=_[_0xc5c7('0x40')]({},_0x5a8e5c,_0x2d6898[_0xc5c7('0x42')]);return db[_0xc5c7('0x2e')]['find'](_0x5a8e5c)['then'](handleEntityNotFound(_0x198701,null))[_0xc5c7('0x28')](respondWithResult(_0x198701,null))['catch'](handleError(_0x198701,null));};exports['create']=function(_0x3a1071,_0x59329f){return db[_0xc5c7('0x2e')][_0xc5c7('0x4a')](_0x3a1071[_0xc5c7('0x4b')],{})[_0xc5c7('0x28')](respondWithResult(_0x59329f,0xc9))[_0xc5c7('0x4c')](handleError(_0x59329f,null));};exports[_0xc5c7('0x4d')]=function(_0x26159a,_0x52a2a4){return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x26159a[_0xc5c7('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x52a2a4,0xc9))[_0xc5c7('0x4c')](handleError(_0x52a2a4,null));};exports['update']=function(_0x567b4a,_0x5385fb){if(_0x567b4a['body']['id']){delete _0x567b4a[_0xc5c7('0x4b')]['id'];}return db['AnalyticFieldReport'][_0xc5c7('0x4e')]({'where':{'id':_0x567b4a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x5385fb,null))[_0xc5c7('0x28')](saveUpdates(_0x567b4a[_0xc5c7('0x4b')],null))[_0xc5c7('0x28')](respondWithResult(_0x5385fb,null))[_0xc5c7('0x4c')](handleError(_0x5385fb,null));};exports[_0xc5c7('0x4f')]=function(_0x3740f2,_0x31f7b3){return db[_0xc5c7('0x2e')][_0xc5c7('0x4e')]({'where':{'id':_0x3740f2[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x31f7b3,null))[_0xc5c7('0x28')](removeEntity(_0x31f7b3,null))[_0xc5c7('0x4c')](handleError(_0x31f7b3,null));};exports[_0xc5c7('0x50')]=function(_0x5d3f98,_0x38cea4){return db[_0xc5c7('0x2e')]['destroy']({'where':{'id':_0x5d3f98[_0xc5c7('0x34')][_0xc5c7('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xc5c7('0x28')](respondWithResult(_0x38cea4,0xcc))[_0xc5c7('0x4c')](handleError(_0x38cea4,null));};exports[_0xc5c7('0x52')]=function(_0x4d111a,_0x2f0bea,_0x25b383){return db['AnalyticCustomReport'][_0xc5c7('0x53')]({'where':{'id':_0x4d111a[_0xc5c7('0x45')]['id']}})[_0xc5c7('0x28')](handleEntityNotFound(_0x2f0bea,null))[_0xc5c7('0x28')](function(_0x473770){if(_0x473770){return db['sequelize'][_0xc5c7('0x54')](function(_0x468501){return db['AnalyticFieldReport'][_0xc5c7('0x4f')]({'where':{'CustomReportId':_0x4d111a['params']['id']},'transaction':_0x468501})[_0xc5c7('0x28')](function(_0x454c90){var _0x1c6206=_[_0xc5c7('0x2d')](_0x4d111a['body'],function(_0x540715){delete _0x540715['id'];_0x540715[_0xc5c7('0x55')]=_0x4d111a[_0xc5c7('0x45')]['id'];return _0x540715;});return db[_0xc5c7('0x2e')][_0xc5c7('0x4d')](_0x1c6206,{'transaction':_0x468501});});})['then'](function(){return db[_0xc5c7('0x2e')][_0xc5c7('0x56')]({'where':{'CustomReportId':_0x4d111a[_0xc5c7('0x45')]['id']}});});}})[_0xc5c7('0x28')](respondWithResult(_0x2f0bea,null))['catch'](handleError(_0x2f0bea,null));}; \ No newline at end of file +var _0x06be=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','bulkCreate','params','addFields','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment'];(function(_0x17eaa5,_0x29cccb){var _0x1722f5=function(_0x21600d){while(--_0x21600d){_0x17eaa5['push'](_0x17eaa5['shift']());}};_0x1722f5(++_0x29cccb);}(_0x06be,0x96));var _0xe06b=function(_0x18f556,_0x58281a){_0x18f556=_0x18f556-0x0;var _0x41af03=_0x06be[_0x18f556];return _0x41af03;};'use strict';var emlformat=require(_0xe06b('0x0'));var rimraf=require(_0xe06b('0x1'));var zipdir=require(_0xe06b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe06b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe06b('0x4'));var util=require(_0xe06b('0x5'));var path=require(_0xe06b('0x6'));var sox=require(_0xe06b('0x7'));var csv=require(_0xe06b('0x8'));var ejs=require(_0xe06b('0x9'));var fs=require('fs');var fs_extra=require(_0xe06b('0xa'));var _=require(_0xe06b('0xb'));var squel=require(_0xe06b('0xc'));var crypto=require(_0xe06b('0xd'));var jsforce=require(_0xe06b('0xe'));var deskjs=require(_0xe06b('0xf'));var toCsv=require(_0xe06b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06b('0x10'));var authService=require(_0xe06b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe06b('0x12'));var hardwareService=require(_0xe06b('0x13'));var logger=require(_0xe06b('0x14'))(_0xe06b('0x15'));var utils=require('../../config/utils');var config=require(_0xe06b('0x16'));var licenseUtil=require(_0xe06b('0x17'));var db=require(_0xe06b('0x18'))['db'];function respondWithStatusCode(_0x57a751,_0x2c3f10){_0x2c3f10=_0x2c3f10||0xcc;return function(_0x1bb678){if(_0x1bb678){return _0x57a751[_0xe06b('0x19')](_0x2c3f10);}return _0x57a751[_0xe06b('0x1a')](_0x2c3f10)[_0xe06b('0x1b')]();};}function respondWithResult(_0x344403,_0x2d76a4){_0x2d76a4=_0x2d76a4||0xc8;return function(_0x3814ef){if(_0x3814ef){return _0x344403[_0xe06b('0x1a')](_0x2d76a4)[_0xe06b('0x1c')](_0x3814ef);}};}function respondWithFilteredResult(_0x45d80d,_0x250a5e){return function(_0x4fdd2c){if(_0x4fdd2c){var _0x1304af=typeof _0x250a5e['offset']===_0xe06b('0x1d')&&typeof _0x250a5e[_0xe06b('0x1e')]===_0xe06b('0x1d');var _0x107672=_0x4fdd2c[_0xe06b('0x1f')];var _0x20e4f6=_0x1304af?0x0:_0x250a5e['offset'];var _0x3b9f13=_0x1304af?_0x4fdd2c['count']:_0x250a5e[_0xe06b('0x20')]+_0x250a5e[_0xe06b('0x1e')];var _0x288014;if(_0x3b9f13>=_0x107672){_0x3b9f13=_0x107672;_0x288014=0xc8;}else{_0x288014=0xce;}_0x45d80d['status'](_0x288014);return _0x45d80d[_0xe06b('0x21')]('Content-Range',_0x20e4f6+'-'+_0x3b9f13+'/'+_0x107672)[_0xe06b('0x1c')](_0x4fdd2c);}return null;};}function patchUpdates(_0x471996){return function(_0x25500c){try{jsonpatch[_0xe06b('0x22')](_0x25500c,_0x471996,!![]);}catch(_0x4b0994){return BPromise[_0xe06b('0x23')](_0x4b0994);}return _0x25500c['save']();};}function saveUpdates(_0x55cf8e,_0x4f7d4f){return function(_0x358412){if(_0x358412){return _0x358412[_0xe06b('0x24')](_0x55cf8e)[_0xe06b('0x25')](function(_0x1203ed){return _0x1203ed;});}return null;};}function removeEntity(_0x526226,_0x349153){return function(_0x146edb){if(_0x146edb){return _0x146edb[_0xe06b('0x26')]()[_0xe06b('0x25')](function(){_0x526226[_0xe06b('0x1a')](0xcc)[_0xe06b('0x1b')]();});}};}function handleEntityNotFound(_0x1a4a86,_0x49b236){return function(_0x35d289){if(!_0x35d289){_0x1a4a86[_0xe06b('0x19')](0x194);}return _0x35d289;};}function handleError(_0x441537,_0x59aad8){_0x59aad8=_0x59aad8||0x1f4;return function(_0x348e49){logger[_0xe06b('0x27')](_0x348e49[_0xe06b('0x28')]);if(_0x348e49[_0xe06b('0x29')]){delete _0x348e49[_0xe06b('0x29')];}_0x441537[_0xe06b('0x1a')](_0x59aad8)['send'](_0x348e49);};}exports[_0xe06b('0x2a')]=function(_0x266793,_0x49b76e){var _0x5ae2c1={},_0x3697af={},_0x3697cd={'count':0x0,'rows':[]};var _0x48d86c=_[_0xe06b('0x2b')](db[_0xe06b('0x2c')]['rawAttributes'],function(_0x37bb6e){return{'name':_0x37bb6e[_0xe06b('0x2d')],'type':_0x37bb6e[_0xe06b('0x2e')]['key']};});_0x3697af[_0xe06b('0x2f')]=_[_0xe06b('0x2b')](_0x48d86c,_0xe06b('0x29'));_0x3697af['query']=_[_0xe06b('0x30')](_0x266793[_0xe06b('0x31')]);_0x3697af[_0xe06b('0x32')]=_[_0xe06b('0x33')](_0x3697af['model'],_0x3697af[_0xe06b('0x31')]);_0x5ae2c1[_0xe06b('0x34')]=_[_0xe06b('0x33')](_0x3697af[_0xe06b('0x2f')],qs['fields'](_0x266793[_0xe06b('0x31')][_0xe06b('0x35')]));_0x5ae2c1['attributes']=_0x5ae2c1[_0xe06b('0x34')][_0xe06b('0x36')]?_0x5ae2c1['attributes']:_0x3697af[_0xe06b('0x2f')];if(!_0x266793[_0xe06b('0x31')]['hasOwnProperty'](_0xe06b('0x37'))){_0x5ae2c1[_0xe06b('0x1e')]=qs[_0xe06b('0x1e')](_0x266793[_0xe06b('0x31')][_0xe06b('0x1e')]);_0x5ae2c1['offset']=qs[_0xe06b('0x20')](_0x266793[_0xe06b('0x31')][_0xe06b('0x20')]);}_0x5ae2c1[_0xe06b('0x38')]=qs[_0xe06b('0x39')](_0x266793['query'][_0xe06b('0x39')]);_0x5ae2c1[_0xe06b('0x3a')]=qs[_0xe06b('0x32')](_['pick'](_0x266793['query'],_0x3697af['filters']),_0x48d86c);if(_0x266793[_0xe06b('0x31')][_0xe06b('0x3b')]){_0x5ae2c1[_0xe06b('0x3a')]=_[_0xe06b('0x3c')](_0x5ae2c1[_0xe06b('0x3a')],{'$or':_['map'](_0x48d86c,function(_0x427fd9){if(_0x427fd9[_0xe06b('0x2e')]!==_0xe06b('0x3d')){var _0x2e3c65={};_0x2e3c65[_0x427fd9[_0xe06b('0x29')]]={'$like':'%'+_0x266793['query'][_0xe06b('0x3b')]+'%'};return _0x2e3c65;}})});}_0x5ae2c1=_[_0xe06b('0x3c')]({},_0x5ae2c1,_0x266793[_0xe06b('0x3e')]);var _0x12948d={'where':_0x5ae2c1[_0xe06b('0x3a')]};return db['AnalyticFieldReport'][_0xe06b('0x1f')](_0x12948d)[_0xe06b('0x25')](function(_0x3fdc6e){_0x3697cd['count']=_0x3fdc6e;if(_0x266793['query'][_0xe06b('0x3f')]){_0x5ae2c1[_0xe06b('0x40')]=[{'all':!![]}];}return db[_0xe06b('0x2c')][_0xe06b('0x41')](_0x5ae2c1);})[_0xe06b('0x25')](function(_0x266738){_0x3697cd['rows']=_0x266738;return _0x3697cd;})[_0xe06b('0x25')](respondWithFilteredResult(_0x49b76e,_0x5ae2c1))[_0xe06b('0x42')](handleError(_0x49b76e,null));};exports[_0xe06b('0x43')]=function(_0x15d409,_0x4980e2){var _0x363524={'raw':![],'where':{'id':_0x15d409['params']['id']}},_0xfc38ab={};_0xfc38ab['model']=_[_0xe06b('0x30')](db[_0xe06b('0x2c')]['rawAttributes']);_0xfc38ab[_0xe06b('0x31')]=_[_0xe06b('0x30')](_0x15d409[_0xe06b('0x31')]);_0xfc38ab[_0xe06b('0x32')]=_[_0xe06b('0x33')](_0xfc38ab[_0xe06b('0x2f')],_0xfc38ab[_0xe06b('0x31')]);_0x363524[_0xe06b('0x34')]=_[_0xe06b('0x33')](_0xfc38ab[_0xe06b('0x2f')],qs[_0xe06b('0x35')](_0x15d409['query'][_0xe06b('0x35')]));_0x363524[_0xe06b('0x34')]=_0x363524[_0xe06b('0x34')][_0xe06b('0x36')]?_0x363524['attributes']:_0xfc38ab['model'];if(_0x15d409[_0xe06b('0x31')]['includeAll']){_0x363524[_0xe06b('0x40')]=[{'all':!![]}];}_0x363524=_[_0xe06b('0x3c')]({},_0x363524,_0x15d409[_0xe06b('0x3e')]);return db[_0xe06b('0x2c')][_0xe06b('0x44')](_0x363524)[_0xe06b('0x25')](handleEntityNotFound(_0x4980e2,null))[_0xe06b('0x25')](respondWithResult(_0x4980e2,null))[_0xe06b('0x42')](handleError(_0x4980e2,null));};exports[_0xe06b('0x45')]=function(_0x4cc0e6,_0x52ae61){return db[_0xe06b('0x2c')][_0xe06b('0x45')](_0x4cc0e6[_0xe06b('0x46')],{})['then'](respondWithResult(_0x52ae61,0xc9))[_0xe06b('0x42')](handleError(_0x52ae61,null));};exports[_0xe06b('0x47')]=function(_0x3f2f97,_0x3df505){return db[_0xe06b('0x2c')][_0xe06b('0x47')](_0x3f2f97[_0xe06b('0x46')],{'raw':![],'individualHooks':!![]})[_0xe06b('0x25')](respondWithResult(_0x3df505,0xc9))[_0xe06b('0x42')](handleError(_0x3df505,null));};exports[_0xe06b('0x24')]=function(_0x2c10fc,_0x326eb1){if(_0x2c10fc['body']['id']){delete _0x2c10fc['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2c10fc[_0xe06b('0x48')]['id']}})[_0xe06b('0x25')](handleEntityNotFound(_0x326eb1,null))[_0xe06b('0x25')](saveUpdates(_0x2c10fc['body'],null))[_0xe06b('0x25')](respondWithResult(_0x326eb1,null))[_0xe06b('0x42')](handleError(_0x326eb1,null));};exports['destroy']=function(_0x555cc1,_0x828f01){return db[_0xe06b('0x2c')][_0xe06b('0x44')]({'where':{'id':_0x555cc1[_0xe06b('0x48')]['id']}})['then'](handleEntityNotFound(_0x828f01,null))[_0xe06b('0x25')](removeEntity(_0x828f01,null))[_0xe06b('0x42')](handleError(_0x828f01,null));};exports['bulkDestroy']=function(_0xeb3541,_0x4d3e58){return db[_0xe06b('0x2c')][_0xe06b('0x26')]({'where':{'id':_0xeb3541[_0xe06b('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4d3e58,0xcc))['catch'](handleError(_0x4d3e58,null));};exports[_0xe06b('0x49')]=function(_0x144b78,_0x30abc0,_0x42a8e9){return db['AnalyticCustomReport'][_0xe06b('0x4a')]({'where':{'id':_0x144b78[_0xe06b('0x48')]['id']}})[_0xe06b('0x25')](handleEntityNotFound(_0x30abc0,null))[_0xe06b('0x25')](function(_0xc66d0c){if(_0xc66d0c){return db['sequelize'][_0xe06b('0x4b')](function(_0x2ed831){return db[_0xe06b('0x2c')][_0xe06b('0x26')]({'where':{'CustomReportId':_0x144b78[_0xe06b('0x48')]['id']},'transaction':_0x2ed831})[_0xe06b('0x25')](function(_0x76bae6){var _0x59852c=_['map'](_0x144b78[_0xe06b('0x46')],function(_0x124c04){delete _0x124c04['id'];_0x124c04[_0xe06b('0x4c')]=_0x144b78[_0xe06b('0x48')]['id'];return _0x124c04;});return db[_0xe06b('0x2c')][_0xe06b('0x47')](_0x59852c,{'transaction':_0x2ed831});});})[_0xe06b('0x25')](function(){return db[_0xe06b('0x2c')][_0xe06b('0x41')]({'where':{'CustomReportId':_0x144b78['params']['id']}});});}})[_0xe06b('0x25')](respondWithResult(_0x30abc0,null))[_0xe06b('0x42')](handleError(_0x30abc0,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index a98ad31..ac597d1 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 _0x3054=['exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x45ce90,_0x114609){var _0x313c45=function(_0x55102a){while(--_0x55102a){_0x45ce90['push'](_0x45ce90['shift']());}};_0x313c45(++_0x114609);}(_0x3054,0x10c));var _0x4305=function(_0x5d1e6e,_0x16aca4){_0x5d1e6e=_0x5d1e6e-0x0;var _0x1f0dfe=_0x3054[_0x5d1e6e];return _0x1f0dfe;};'use strict';var _=require('lodash');var util=require(_0x4305('0x0'));var logger=require(_0x4305('0x1'))(_0x4305('0x2'));var moment=require(_0x4305('0x3'));var BPromise=require(_0x4305('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4305('0x5'));var rimraf=require('rimraf');var config=require(_0x4305('0x6'));var attributes=require(_0x4305('0x7'));module[_0x4305('0x8')]=function(_0x4cff36,_0x16255f){return _0x4cff36[_0x4305('0x9')](_0x4305('0xa'),attributes,{'tableName':_0x4305('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cdb=['define','analytics_report_fields','util','../../config/logger','api','path','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x272350,_0x3db80e){var _0x1685fe=function(_0x494102){while(--_0x494102){_0x272350['push'](_0x272350['shift']());}};_0x1685fe(++_0x3db80e);}(_0x5cdb,0x122));var _0xb5cd=function(_0x4a29d9,_0x3d6d77){_0x4a29d9=_0x4a29d9-0x0;var _0x4ea260=_0x5cdb[_0x4a29d9];return _0x4ea260;};'use strict';var _=require('lodash');var util=require(_0xb5cd('0x0'));var logger=require(_0xb5cd('0x1'))(_0xb5cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5cd('0x3'));var rimraf=require(_0xb5cd('0x4'));var config=require('../../config/environment');var attributes=require(_0xb5cd('0x5'));module[_0xb5cd('0x6')]=function(_0x5e9ff7,_0x155165){return _0x5e9ff7[_0xb5cd('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xb5cd('0x8'),'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 d2743f4..68669f0 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 _0x77b1=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe34133,_0x5a7691){var _0x27ebab=function(_0x3a42ba){while(--_0x3a42ba){_0xe34133['push'](_0xe34133['shift']());}};_0x27ebab(++_0x5a7691);}(_0x77b1,0x19f));var _0x177b=function(_0x23af58,_0x3d45df){_0x23af58=_0x23af58-0x0;var _0xdf23b2=_0x77b1[_0x23af58];return _0xdf23b2;};'use strict';var _=require(_0x177b('0x0'));var util=require('util');var moment=require(_0x177b('0x1'));var BPromise=require('bluebird');var rs=require(_0x177b('0x2'));var fs=require('fs');var Redis=require(_0x177b('0x3'));var db=require(_0x177b('0x4'))['db'];var utils=require(_0x177b('0x5'));var logger=require(_0x177b('0x6'))(_0x177b('0x7'));var config=require('../../config/environment');var jayson=require(_0x177b('0x8'));var client=jayson[_0x177b('0x9')][_0x177b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117e81,_0x426d35,_0x34b79d){return new BPromise(function(_0x1df58c,_0x297186){return client[_0x177b('0xb')](_0x117e81,_0x34b79d)['then'](function(_0x124ec8){logger[_0x177b('0xc')](_0x177b('0xd'),_0x426d35,_0x177b('0xe'));logger['debug'](_0x177b('0xf'),_0x426d35,_0x177b('0xe'),JSON[_0x177b('0x10')](_0x124ec8));if(_0x124ec8['error']){if(_0x124ec8[_0x177b('0x11')]['code']===0x1f4){logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8['error']['message']);return _0x297186(_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);}logger[_0x177b('0x11')](_0x177b('0xd'),_0x426d35,_0x124ec8[_0x177b('0x11')][_0x177b('0x12')]);return _0x1df58c(_0x124ec8[_0x177b('0x11')]['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x426d35,_0x177b('0xe'));_0x1df58c(_0x124ec8[_0x177b('0x13')]['message']);}})['catch'](function(_0x3fa952){logger['error'](_0x177b('0xd'),_0x426d35,_0x3fa952);_0x297186(_0x3fa952);});});} \ No newline at end of file +var _0x0b8b=['stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x3fadd6,_0x397ea7){var _0x46ceb3=function(_0x2a6d66){while(--_0x2a6d66){_0x3fadd6['push'](_0x3fadd6['shift']());}};_0x46ceb3(++_0x397ea7);}(_0x0b8b,0xeb));var _0xb0b8=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x0b8b[_0x3c38c7];return _0x4aa4b1;};'use strict';var _=require(_0xb0b8('0x0'));var util=require('util');var moment=require(_0xb0b8('0x1'));var BPromise=require(_0xb0b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb0b8('0x4'))(_0xb0b8('0x5'));var config=require(_0xb0b8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb0b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24bef2,_0x1a1844,_0xd3bba7){return new BPromise(function(_0x3cf2b4,_0x434369){return client[_0xb0b8('0x8')](_0x24bef2,_0xd3bba7)[_0xb0b8('0x9')](function(_0x55e607){logger[_0xb0b8('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a1844,_0xb0b8('0xb'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1a1844,_0xb0b8('0xb'),JSON[_0xb0b8('0xc')](_0x55e607));if(_0x55e607[_0xb0b8('0xd')]){if(_0x55e607[_0xb0b8('0xd')][_0xb0b8('0xe')]===0x1f4){logger[_0xb0b8('0xd')](_0xb0b8('0xf'),_0x1a1844,_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);return _0x434369(_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);}logger[_0xb0b8('0xd')](_0xb0b8('0xf'),_0x1a1844,_0x55e607[_0xb0b8('0xd')][_0xb0b8('0x10')]);return _0x3cf2b4(_0x55e607['error'][_0xb0b8('0x10')]);}else{logger['info'](_0xb0b8('0xf'),_0x1a1844,_0xb0b8('0xb'));_0x3cf2b4(_0x55e607[_0xb0b8('0x11')]['message']);}})[_0xb0b8('0x12')](function(_0x48d09f){logger[_0xb0b8('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1a1844,_0x48d09f);_0x434369(_0x48d09f);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4d0ae90..35380d6 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(_0x5dc120,_0x3e4683){var _0x37aa08=function(_0x176f47){while(--_0x176f47){_0x5dc120['push'](_0x5dc120['shift']());}};_0x37aa08(++_0x3e4683);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x15c870,_0x89ecb0){var _0x4d9a13=function(_0x5474f4){while(--_0x5474f4){_0x15c870['push'](_0x15c870['shift']());}};_0x4d9a13(++_0x89ecb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 2aaf585..91ca69b 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 _0xd732=['STRING','TEXT','sequelize'];(function(_0x4e9f7a,_0xcd51d8){var _0x433a29=function(_0x1c4de3){while(--_0x1c4de3){_0x4e9f7a['push'](_0x4e9f7a['shift']());}};_0x433a29(++_0xcd51d8);}(_0xd732,0x18e));var _0x2d73=function(_0x4f00ab,_0x574771){_0x4f00ab=_0x4f00ab-0x0;var _0x25d7d4=_0xd732[_0x4f00ab];return _0x25d7d4;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d73('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2d73('0x2')]},'description':{'type':Sequelize[_0x2d73('0x1')]}}; \ No newline at end of file +var _0xa68c=['TEXT','sequelize','exports','STRING','name'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0xa68c,0x187));var _0xca68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa68c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca68('0x0'));module[_0xca68('0x1')]={'name':{'type':Sequelize[_0xca68('0x2')],'allowNull':![],'unique':_0xca68('0x3')},'table':{'type':Sequelize[_0xca68('0x2')]},'metric':{'type':Sequelize[_0xca68('0x4')]},'description':{'type':Sequelize[_0xca68('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 11a9c34..1326752 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x456c80,_0x41a353){var _0x4dc31a=function(_0x379085){while(--_0x379085){_0x456c80['push'](_0x456c80['shift']());}};_0x4dc31a(++_0x41a353);}(_0x5fc3,0xa8));var _0x35fc=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x5fc3[_0x23be51];return _0x47a26d;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x295ee0,_0x5ef633){var _0x36cb3c=function(_0x3d45b4){while(--_0x3d45b4){_0x295ee0['push'](_0x295ee0['shift']());}};_0x36cb3c(++_0x5ef633);}(_0x008c,0x188));var _0xc008=function(_0x321327,_0x4965b){_0x321327=_0x321327-0x0;var _0x33be38=_0x008c[_0x321327];return _0x33be38;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 8bd46c1..3f13d3e 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 _0x13fe=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics'];(function(_0x1a7e14,_0x100435){var _0x53abf8=function(_0x4767ab){while(--_0x4767ab){_0x1a7e14['push'](_0x1a7e14['shift']());}};_0x53abf8(++_0x100435);}(_0x13fe,0x138));var _0xe13f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x13fe[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xe13f('0x0'));var util=require(_0xe13f('0x1'));var logger=require(_0xe13f('0x2'))(_0xe13f('0x3'));var moment=require(_0xe13f('0x4'));var BPromise=require(_0xe13f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe13f('0x6'));var rimraf=require(_0xe13f('0x7'));var config=require(_0xe13f('0x8'));var attributes=require(_0xe13f('0x9'));module[_0xe13f('0xa')]=function(_0x1ddbff,_0x2832ce){return _0x1ddbff['define']('AnalyticMetric',attributes,{'tableName':_0xe13f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd206=['util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0xd206,0x107));var _0x6d20=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd206[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x6d20('0x0'));var util=require(_0x6d20('0x1'));var logger=require('../../config/logger')(_0x6d20('0x2'));var moment=require(_0x6d20('0x3'));var BPromise=require(_0x6d20('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d20('0x5'));var rimraf=require(_0x6d20('0x6'));var config=require(_0x6d20('0x7'));var attributes=require(_0x6d20('0x8'));module['exports']=function(_0x467e6e,_0x5c5950){return _0x467e6e['define'](_0x6d20('0x9'),attributes,{'tableName':_0x6d20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 360e01b..725a10d 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 _0xf450=['stringify','error','code','message','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf450,0xc2));var _0x0f45=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf450[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0f45('0x0'));var util=require(_0x0f45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0f45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f45('0x3'));var logger=require(_0x0f45('0x4'))(_0x0f45('0x5'));var config=require(_0x0f45('0x6'));var jayson=require(_0x0f45('0x7'));var client=jayson[_0x0f45('0x8')][_0x0f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f642f,_0x257cb8,_0x5a059d){return new BPromise(function(_0x32d1de,_0x493a2b){return client[_0x0f45('0xa')](_0x4f642f,_0x5a059d)[_0x0f45('0xb')](function(_0x49d884){logger[_0x0f45('0xc')](_0x0f45('0xd'),_0x257cb8,'request\x20sent');logger[_0x0f45('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x257cb8,_0x0f45('0xf'),JSON[_0x0f45('0x10')](_0x49d884));if(_0x49d884[_0x0f45('0x11')]){if(_0x49d884[_0x0f45('0x11')][_0x0f45('0x12')]===0x1f4){logger['error'](_0x0f45('0xd'),_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x493a2b(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}logger[_0x0f45('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x257cb8,_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);return _0x32d1de(_0x49d884[_0x0f45('0x11')][_0x0f45('0x13')]);}else{logger['info'](_0x0f45('0xd'),_0x257cb8,_0x0f45('0xf'));_0x32d1de(_0x49d884[_0x0f45('0x14')][_0x0f45('0x13')]);}})['catch'](function(_0x3fe328){logger[_0x0f45('0x11')](_0x0f45('0xd'),_0x257cb8,_0x3fe328);_0x493a2b(_0x3fe328);});});} \ No newline at end of file +var _0x82ba=['rpc','../../config/environment','jayson/promise','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3195f8,_0x3aeeba){var _0x54cd9f=function(_0x2e21d1){while(--_0x2e21d1){_0x3195f8['push'](_0x3195f8['shift']());}};_0x54cd9f(++_0x3aeeba);}(_0x82ba,0x1d9));var _0xa82b=function(_0x2976fe,_0x580e98){_0x2976fe=_0x2976fe-0x0;var _0x4e5f3a=_0x82ba[_0x2976fe];return _0x4e5f3a;};'use strict';var _=require(_0xa82b('0x0'));var util=require('util');var moment=require(_0xa82b('0x1'));var BPromise=require(_0xa82b('0x2'));var rs=require(_0xa82b('0x3'));var fs=require('fs');var Redis=require(_0xa82b('0x4'));var db=require(_0xa82b('0x5'))['db'];var utils=require(_0xa82b('0x6'));var logger=require('../../config/logger')(_0xa82b('0x7'));var config=require(_0xa82b('0x8'));var jayson=require(_0xa82b('0x9'));var client=jayson[_0xa82b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7420,_0x217a69,_0xb6e9a){return new BPromise(function(_0x51498f,_0x2a2350){return client['request'](_0x4f7420,_0xb6e9a)['then'](function(_0x562e88){logger[_0xa82b('0xb')](_0xa82b('0xc'),_0x217a69,_0xa82b('0xd'));logger[_0xa82b('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x217a69,_0xa82b('0xd'),JSON[_0xa82b('0xf')](_0x562e88));if(_0x562e88[_0xa82b('0x10')]){if(_0x562e88[_0xa82b('0x10')][_0xa82b('0x11')]===0x1f4){logger[_0xa82b('0x10')](_0xa82b('0xc'),_0x217a69,_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);return _0x2a2350(_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);}logger[_0xa82b('0x10')](_0xa82b('0xc'),_0x217a69,_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);return _0x51498f(_0x562e88[_0xa82b('0x10')][_0xa82b('0x12')]);}else{logger[_0xa82b('0xb')](_0xa82b('0xc'),_0x217a69,_0xa82b('0xd'));_0x51498f(_0x562e88[_0xa82b('0x13')][_0xa82b('0x12')]);}})['catch'](function(_0x17d3d3){logger['error'](_0xa82b('0xc'),_0x217a69,_0x17d3d3);_0x2a2350(_0x17d3d3);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 5eabb43..08c5366 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 _0x7edb=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x7edb,0x158));var _0xb7ed=function(_0x40d287,_0x42f496){_0x40d287=_0x40d287-0x0;var _0x379218=_0x7edb[_0x40d287];return _0x379218;};'use strict';var multer=require('multer');var util=require(_0xb7ed('0x0'));var path=require(_0xb7ed('0x1'));var timeout=require(_0xb7ed('0x2'));var express=require(_0xb7ed('0x3'));var router=express[_0xb7ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7ed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb7ed('0x6'));router[_0xb7ed('0x7')]('/',auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x9')]);router[_0xb7ed('0x7')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xb')]);router[_0xb7ed('0xc')]('/',auth[_0xb7ed('0x8')](),controller['create']);router[_0xb7ed('0xd')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xe')]);router[_0xb7ed('0xf')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller['destroy']);module[_0xb7ed('0x10')]=router; \ No newline at end of file +var _0x4074=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports'];(function(_0x3911fc,_0x5a349f){var _0x51ec85=function(_0x3cfb64){while(--_0x3cfb64){_0x3911fc['push'](_0x3911fc['shift']());}};_0x51ec85(++_0x5a349f);}(_0x4074,0xf0));var _0x4407=function(_0x4183e1,_0x356f98){_0x4183e1=_0x4183e1-0x0;var _0x584196=_0x4074[_0x4183e1];return _0x584196;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xf')]('/',auth[_0x4407('0xb')](),controller['create']);router['put']('/:id',auth[_0x4407('0xb')](),controller[_0x4407('0x10')]);router[_0x4407('0x11')](_0x4407('0xd'),auth[_0x4407('0xb')](),controller[_0x4407('0x12')]);module[_0x4407('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 6ad17b1..2499027 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 _0x6d66=['sequelize','exports','TEXT'];(function(_0xdf13c9,_0x5da43f){var _0x302aaa=function(_0x42cc73){while(--_0x42cc73){_0xdf13c9['push'](_0xdf13c9['shift']());}};_0x302aaa(++_0x5da43f);}(_0x6d66,0x9c));var _0x66d6=function(_0x56fe43,_0x53383b){_0x56fe43=_0x56fe43-0x0;var _0x50ef2e=_0x6d66[_0x56fe43];return _0x50ef2e;};'use strict';var Sequelize=require(_0x66d6('0x0'));module[_0x66d6('0x1')]={'tree':{'type':Sequelize[_0x66d6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x052c=['exports','TEXT'];(function(_0x57badc,_0x339f5e){var _0xcb0771=function(_0xe7acf9){while(--_0xe7acf9){_0x57badc['push'](_0x57badc['shift']());}};_0xcb0771(++_0x339f5e);}(_0x052c,0x164));var _0xc052=function(_0xe72bea,_0x4b339){_0xe72bea=_0xe72bea-0x0;var _0x888cbc=_0x052c[_0xe72bea];return _0x888cbc;};'use strict';var Sequelize=require('sequelize');module[_0xc052('0x0')]={'tree':{'type':Sequelize[_0xc052('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a885040..c0573e8 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 _0x210e=['then','destroy','sendStatus','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x210e,0x1e9));var _0xe210=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0x210e[_0x44d88c];return _0x508da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe210('0x0'));var zipdir=require(_0xe210('0x1'));var jsonpatch=require(_0xe210('0x2'));var rp=require(_0xe210('0x3'));var moment=require(_0xe210('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe210('0x5'));var util=require('util');var path=require(_0xe210('0x6'));var sox=require(_0xe210('0x7'));var csv=require(_0xe210('0x8'));var ejs=require(_0xe210('0x9'));var fs=require('fs');var fs_extra=require(_0xe210('0xa'));var _=require(_0xe210('0xb'));var squel=require(_0xe210('0xc'));var crypto=require(_0xe210('0xd'));var jsforce=require(_0xe210('0xe'));var deskjs=require(_0xe210('0xf'));var toCsv=require(_0xe210('0x8'));var querystring=require('querystring');var Papa=require(_0xe210('0x10'));var Redis=require(_0xe210('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe210('0x12'));var as=require(_0xe210('0x13'));var hardwareService=require(_0xe210('0x14'));var logger=require(_0xe210('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe210('0x16'));var licenseUtil=require(_0xe210('0x17'));var db=require(_0xe210('0x18'))['db'];function respondWithStatusCode(_0x243c44,_0x3bba66){_0x3bba66=_0x3bba66||0xcc;return function(_0x577e9d){if(_0x577e9d){return _0x243c44['sendStatus'](_0x3bba66);}return _0x243c44[_0xe210('0x19')](_0x3bba66)[_0xe210('0x1a')]();};}function respondWithResult(_0x13c3f5,_0x43f30f){_0x43f30f=_0x43f30f||0xc8;return function(_0x1c5d11){if(_0x1c5d11){return _0x13c3f5[_0xe210('0x19')](_0x43f30f)[_0xe210('0x1b')](_0x1c5d11);}};}function respondWithFilteredResult(_0x1cc418,_0x17bcd6){return function(_0x2cb917){if(_0x2cb917){var _0x2df8db=typeof _0x17bcd6[_0xe210('0x1c')]===_0xe210('0x1d')&&typeof _0x17bcd6[_0xe210('0x1e')]===_0xe210('0x1d');var _0xd5eab1=_0x2cb917[_0xe210('0x1f')];var _0x50de63=_0x2df8db?0x0:_0x17bcd6[_0xe210('0x1c')];var _0x5447d8=_0x2df8db?_0x2cb917[_0xe210('0x1f')]:_0x17bcd6[_0xe210('0x1c')]+_0x17bcd6['limit'];var _0x4d3e86;if(_0x5447d8>=_0xd5eab1){_0x5447d8=_0xd5eab1;_0x4d3e86=0xc8;}else{_0x4d3e86=0xce;}_0x1cc418['status'](_0x4d3e86);return _0x1cc418[_0xe210('0x20')]('Content-Range',_0x50de63+'-'+_0x5447d8+'/'+_0xd5eab1)[_0xe210('0x1b')](_0x2cb917);}return null;};}function patchUpdates(_0x4aad1c){return function(_0x24a890){try{jsonpatch[_0xe210('0x21')](_0x24a890,_0x4aad1c,!![]);}catch(_0x277324){return BPromise[_0xe210('0x22')](_0x277324);}return _0x24a890[_0xe210('0x23')]();};}function saveUpdates(_0x3caea8,_0x27cca6){return function(_0x46c121){if(_0x46c121){return _0x46c121['update'](_0x3caea8)[_0xe210('0x24')](function(_0x24ee94){return _0x24ee94;});}return null;};}function removeEntity(_0x32d468,_0xe71a81){return function(_0x4b109e){if(_0x4b109e){return _0x4b109e[_0xe210('0x25')]()[_0xe210('0x24')](function(){_0x32d468[_0xe210('0x19')](0xcc)[_0xe210('0x1a')]();});}};}function handleEntityNotFound(_0x59c384,_0x5166ee){return function(_0xa7d1d5){if(!_0xa7d1d5){_0x59c384[_0xe210('0x26')](0x194);}return _0xa7d1d5;};}function handleError(_0x4e725a,_0xe0d0a4){_0xe0d0a4=_0xe0d0a4||0x1f4;return function(_0x34e971){logger['error'](_0x34e971[_0xe210('0x27')]);if(_0x34e971['name']){delete _0x34e971[_0xe210('0x28')];}_0x4e725a[_0xe210('0x19')](_0xe0d0a4)[_0xe210('0x29')](_0x34e971);};}exports[_0xe210('0x2a')]=function(_0x3213d1,_0x410aab){var _0xcf7a34={},_0x3b13dd={},_0x38d623={'count':0x0,'rows':[]};var _0xcb21c4=_[_0xe210('0x2b')](db[_0xe210('0x2c')][_0xe210('0x2d')],function(_0x88c865){return{'name':_0x88c865[_0xe210('0x2e')],'type':_0x88c865[_0xe210('0x2f')][_0xe210('0x30')]};});_0x3b13dd['model']=_['map'](_0xcb21c4,'name');_0x3b13dd['query']=_['keys'](_0x3213d1[_0xe210('0x31')]);_0x3b13dd[_0xe210('0x32')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],_0x3b13dd[_0xe210('0x31')]);_0xcf7a34[_0xe210('0x35')]=_[_0xe210('0x33')](_0x3b13dd[_0xe210('0x34')],qs[_0xe210('0x36')](_0x3213d1['query'][_0xe210('0x36')]));_0xcf7a34[_0xe210('0x35')]=_0xcf7a34[_0xe210('0x35')][_0xe210('0x37')]?_0xcf7a34[_0xe210('0x35')]:_0x3b13dd['model'];if(!_0x3213d1[_0xe210('0x31')][_0xe210('0x38')](_0xe210('0x39'))){_0xcf7a34['limit']=qs['limit'](_0x3213d1[_0xe210('0x31')][_0xe210('0x1e')]);_0xcf7a34[_0xe210('0x1c')]=qs[_0xe210('0x1c')](_0x3213d1[_0xe210('0x31')][_0xe210('0x1c')]);}_0xcf7a34[_0xe210('0x3a')]=qs[_0xe210('0x3b')](_0x3213d1[_0xe210('0x31')][_0xe210('0x3b')]);_0xcf7a34[_0xe210('0x3c')]=qs[_0xe210('0x32')](_[_0xe210('0x3d')](_0x3213d1['query'],_0x3b13dd['filters']),_0xcb21c4);if(_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]){_0xcf7a34['where']=_[_0xe210('0x3f')](_0xcf7a34['where'],{'$or':_['map'](_0xcb21c4,function(_0x41380a){if(_0x41380a[_0xe210('0x2f')]!==_0xe210('0x40')){var _0x36bc9b={};_0x36bc9b[_0x41380a[_0xe210('0x28')]]={'$like':'%'+_0x3213d1[_0xe210('0x31')][_0xe210('0x3e')]+'%'};return _0x36bc9b;}})});}_0xcf7a34=_['merge']({},_0xcf7a34,_0x3213d1[_0xe210('0x41')]);var _0x339db8={'where':_0xcf7a34[_0xe210('0x3c')]};return db[_0xe210('0x2c')][_0xe210('0x1f')](_0x339db8)[_0xe210('0x24')](function(_0x259a09){_0x38d623['count']=_0x259a09;if(_0x3213d1[_0xe210('0x31')][_0xe210('0x42')]){_0xcf7a34[_0xe210('0x43')]=[{'all':!![]}];}return db[_0xe210('0x2c')][_0xe210('0x44')](_0xcf7a34);})['then'](function(_0x1346c4){_0x38d623[_0xe210('0x45')]=_0x1346c4;return _0x38d623;})[_0xe210('0x24')](respondWithFilteredResult(_0x410aab,_0xcf7a34))[_0xe210('0x46')](handleError(_0x410aab,null));};exports['show']=function(_0x2ec39f,_0x178a4a){var _0x4926b8={'raw':!![],'where':{'id':_0x2ec39f[_0xe210('0x47')]['id']}},_0x435a7e={};_0x435a7e['model']=_[_0xe210('0x48')](db['AnalyticTreeReport'][_0xe210('0x2d')]);_0x435a7e[_0xe210('0x31')]=_['keys'](_0x2ec39f[_0xe210('0x31')]);_0x435a7e[_0xe210('0x32')]=_[_0xe210('0x33')](_0x435a7e['model'],_0x435a7e[_0xe210('0x31')]);_0x4926b8[_0xe210('0x35')]=_['intersection'](_0x435a7e[_0xe210('0x34')],qs[_0xe210('0x36')](_0x2ec39f[_0xe210('0x31')][_0xe210('0x36')]));_0x4926b8[_0xe210('0x35')]=_0x4926b8[_0xe210('0x35')][_0xe210('0x37')]?_0x4926b8[_0xe210('0x35')]:_0x435a7e['model'];if(_0x2ec39f[_0xe210('0x31')][_0xe210('0x42')]){_0x4926b8[_0xe210('0x43')]=[{'all':!![]}];}_0x4926b8=_['merge']({},_0x4926b8,_0x2ec39f[_0xe210('0x41')]);return db['AnalyticTreeReport'][_0xe210('0x49')](_0x4926b8)['then'](handleEntityNotFound(_0x178a4a,null))[_0xe210('0x24')](respondWithResult(_0x178a4a,null))[_0xe210('0x46')](handleError(_0x178a4a,null));};exports['create']=function(_0x12c0a0,_0x383795){return db[_0xe210('0x2c')]['create'](_0x12c0a0[_0xe210('0x4a')],{})[_0xe210('0x24')](respondWithResult(_0x383795,0xc9))[_0xe210('0x46')](handleError(_0x383795,null));};exports['update']=function(_0x404b11,_0x514d48){if(_0x404b11['body']['id']){delete _0x404b11[_0xe210('0x4a')]['id'];}return db[_0xe210('0x2c')][_0xe210('0x49')]({'where':{'id':_0x404b11[_0xe210('0x47')]['id']}})['then'](handleEntityNotFound(_0x514d48,null))['then'](saveUpdates(_0x404b11[_0xe210('0x4a')],null))[_0xe210('0x24')](respondWithResult(_0x514d48,null))[_0xe210('0x46')](handleError(_0x514d48,null));};exports[_0xe210('0x25')]=function(_0x634f3f,_0x44e7d5){return db[_0xe210('0x2c')]['find']({'where':{'id':_0x634f3f['params']['id']}})[_0xe210('0x24')](handleEntityNotFound(_0x44e7d5,null))[_0xe210('0x24')](removeEntity(_0x44e7d5,null))[_0xe210('0x46')](handleError(_0x44e7d5,null));}; \ No newline at end of file +var _0x5c3e=['end','json','undefined','limit','offset','count','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','filter','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','intersection','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2a8a31,_0x5e551b){var _0x2c199e=function(_0x404738){while(--_0x404738){_0x2a8a31['push'](_0x2a8a31['shift']());}};_0x2c199e(++_0x5e551b);}(_0x5c3e,0xcc));var _0xe5c3=function(_0x46fe5a,_0xfcf004){_0x46fe5a=_0x46fe5a-0x0;var _0x3a7771=_0x5c3e[_0x46fe5a];return _0x3a7771;};'use strict';var emlformat=require(_0xe5c3('0x0'));var rimraf=require(_0xe5c3('0x1'));var zipdir=require(_0xe5c3('0x2'));var jsonpatch=require(_0xe5c3('0x3'));var rp=require(_0xe5c3('0x4'));var moment=require(_0xe5c3('0x5'));var BPromise=require(_0xe5c3('0x6'));var Mustache=require(_0xe5c3('0x7'));var util=require(_0xe5c3('0x8'));var path=require('path');var sox=require(_0xe5c3('0x9'));var csv=require(_0xe5c3('0xa'));var ejs=require(_0xe5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xe5c3('0xc'));var _=require(_0xe5c3('0xd'));var squel=require(_0xe5c3('0xe'));var crypto=require('crypto');var jsforce=require(_0xe5c3('0xf'));var deskjs=require(_0xe5c3('0x10'));var toCsv=require(_0xe5c3('0xa'));var querystring=require('querystring');var Papa=require(_0xe5c3('0x11'));var Redis=require(_0xe5c3('0x12'));var authService=require(_0xe5c3('0x13'));var qs=require(_0xe5c3('0x14'));var as=require(_0xe5c3('0x15'));var hardwareService=require(_0xe5c3('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe5c3('0x17'));var config=require(_0xe5c3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5c3('0x19'))['db'];function respondWithStatusCode(_0x39d36b,_0x322964){_0x322964=_0x322964||0xcc;return function(_0x4d4113){if(_0x4d4113){return _0x39d36b[_0xe5c3('0x1a')](_0x322964);}return _0x39d36b['status'](_0x322964)[_0xe5c3('0x1b')]();};}function respondWithResult(_0xd4489e,_0x48740b){_0x48740b=_0x48740b||0xc8;return function(_0xf2e140){if(_0xf2e140){return _0xd4489e['status'](_0x48740b)[_0xe5c3('0x1c')](_0xf2e140);}};}function respondWithFilteredResult(_0x408fbe,_0x3eb0d8){return function(_0x106614){if(_0x106614){var _0x3b10f4=typeof _0x3eb0d8['offset']===_0xe5c3('0x1d')&&typeof _0x3eb0d8[_0xe5c3('0x1e')]===_0xe5c3('0x1d');var _0x20f332=_0x106614['count'];var _0xb27688=_0x3b10f4?0x0:_0x3eb0d8[_0xe5c3('0x1f')];var _0x426d52=_0x3b10f4?_0x106614[_0xe5c3('0x20')]:_0x3eb0d8['offset']+_0x3eb0d8['limit'];var _0x295e82;if(_0x426d52>=_0x20f332){_0x426d52=_0x20f332;_0x295e82=0xc8;}else{_0x295e82=0xce;}_0x408fbe[_0xe5c3('0x21')](_0x295e82);return _0x408fbe[_0xe5c3('0x22')](_0xe5c3('0x23'),_0xb27688+'-'+_0x426d52+'/'+_0x20f332)[_0xe5c3('0x1c')](_0x106614);}return null;};}function patchUpdates(_0x260578){return function(_0x49fe57){try{jsonpatch['apply'](_0x49fe57,_0x260578,!![]);}catch(_0x11d046){return BPromise[_0xe5c3('0x24')](_0x11d046);}return _0x49fe57['save']();};}function saveUpdates(_0x2dd487,_0x1f4c8e){return function(_0x58b07e){if(_0x58b07e){return _0x58b07e[_0xe5c3('0x25')](_0x2dd487)[_0xe5c3('0x26')](function(_0x3b4660){return _0x3b4660;});}return null;};}function removeEntity(_0x154498,_0x37c34f){return function(_0x42b082){if(_0x42b082){return _0x42b082[_0xe5c3('0x27')]()['then'](function(){_0x154498['status'](0xcc)[_0xe5c3('0x1b')]();});}};}function handleEntityNotFound(_0x28e5bf,_0x375841){return function(_0x44c9b2){if(!_0x44c9b2){_0x28e5bf[_0xe5c3('0x1a')](0x194);}return _0x44c9b2;};}function handleError(_0x2e1b35,_0x3e136b){_0x3e136b=_0x3e136b||0x1f4;return function(_0x238366){logger[_0xe5c3('0x28')](_0x238366[_0xe5c3('0x29')]);if(_0x238366[_0xe5c3('0x2a')]){delete _0x238366['name'];}_0x2e1b35[_0xe5c3('0x21')](_0x3e136b)[_0xe5c3('0x2b')](_0x238366);};}exports[_0xe5c3('0x2c')]=function(_0x2e0966,_0x518af9){var _0x1c8323={},_0x5d6b36={},_0x563a60={'count':0x0,'rows':[]};var _0x59399f=_['map'](db['AnalyticTreeReport']['rawAttributes'],function(_0x1b275){return{'name':_0x1b275[_0xe5c3('0x2d')],'type':_0x1b275[_0xe5c3('0x2e')][_0xe5c3('0x2f')]};});_0x5d6b36[_0xe5c3('0x30')]=_['map'](_0x59399f,_0xe5c3('0x2a'));_0x5d6b36[_0xe5c3('0x31')]=_['keys'](_0x2e0966[_0xe5c3('0x31')]);_0x5d6b36[_0xe5c3('0x32')]=_['intersection'](_0x5d6b36[_0xe5c3('0x30')],_0x5d6b36[_0xe5c3('0x31')]);_0x1c8323['attributes']=_['intersection'](_0x5d6b36[_0xe5c3('0x30')],qs[_0xe5c3('0x33')](_0x2e0966[_0xe5c3('0x31')]['fields']));_0x1c8323[_0xe5c3('0x34')]=_0x1c8323['attributes'][_0xe5c3('0x35')]?_0x1c8323[_0xe5c3('0x34')]:_0x5d6b36[_0xe5c3('0x30')];if(!_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x36')](_0xe5c3('0x37'))){_0x1c8323[_0xe5c3('0x1e')]=qs[_0xe5c3('0x1e')](_0x2e0966['query'][_0xe5c3('0x1e')]);_0x1c8323['offset']=qs[_0xe5c3('0x1f')](_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x1f')]);}_0x1c8323['order']=qs['sort'](_0x2e0966[_0xe5c3('0x31')][_0xe5c3('0x38')]);_0x1c8323['where']=qs[_0xe5c3('0x32')](_['pick'](_0x2e0966[_0xe5c3('0x31')],_0x5d6b36[_0xe5c3('0x32')]),_0x59399f);if(_0x2e0966[_0xe5c3('0x31')]['filter']){_0x1c8323[_0xe5c3('0x39')]=_[_0xe5c3('0x3a')](_0x1c8323[_0xe5c3('0x39')],{'$or':_[_0xe5c3('0x3b')](_0x59399f,function(_0x8138de){if(_0x8138de[_0xe5c3('0x2e')]!==_0xe5c3('0x3c')){var _0x3bb138={};_0x3bb138[_0x8138de[_0xe5c3('0x2a')]]={'$like':'%'+_0x2e0966['query'][_0xe5c3('0x3d')]+'%'};return _0x3bb138;}})});}_0x1c8323=_[_0xe5c3('0x3a')]({},_0x1c8323,_0x2e0966['options']);var _0x5c8cde={'where':_0x1c8323[_0xe5c3('0x39')]};return db[_0xe5c3('0x3e')][_0xe5c3('0x20')](_0x5c8cde)[_0xe5c3('0x26')](function(_0x50b388){_0x563a60[_0xe5c3('0x20')]=_0x50b388;if(_0x2e0966['query'][_0xe5c3('0x3f')]){_0x1c8323[_0xe5c3('0x40')]=[{'all':!![]}];}return db[_0xe5c3('0x3e')][_0xe5c3('0x41')](_0x1c8323);})[_0xe5c3('0x26')](function(_0x36eaa1){_0x563a60[_0xe5c3('0x42')]=_0x36eaa1;return _0x563a60;})[_0xe5c3('0x26')](respondWithFilteredResult(_0x518af9,_0x1c8323))[_0xe5c3('0x43')](handleError(_0x518af9,null));};exports[_0xe5c3('0x44')]=function(_0x3a436f,_0x20e3e6){var _0x4e7d5f={'raw':!![],'where':{'id':_0x3a436f[_0xe5c3('0x45')]['id']}},_0x12938a={};_0x12938a[_0xe5c3('0x30')]=_['keys'](db[_0xe5c3('0x3e')][_0xe5c3('0x46')]);_0x12938a['query']=_[_0xe5c3('0x47')](_0x3a436f['query']);_0x12938a[_0xe5c3('0x32')]=_[_0xe5c3('0x48')](_0x12938a['model'],_0x12938a['query']);_0x4e7d5f['attributes']=_[_0xe5c3('0x48')](_0x12938a[_0xe5c3('0x30')],qs[_0xe5c3('0x33')](_0x3a436f[_0xe5c3('0x31')][_0xe5c3('0x33')]));_0x4e7d5f[_0xe5c3('0x34')]=_0x4e7d5f[_0xe5c3('0x34')][_0xe5c3('0x35')]?_0x4e7d5f['attributes']:_0x12938a[_0xe5c3('0x30')];if(_0x3a436f[_0xe5c3('0x31')][_0xe5c3('0x3f')]){_0x4e7d5f[_0xe5c3('0x40')]=[{'all':!![]}];}_0x4e7d5f=_[_0xe5c3('0x3a')]({},_0x4e7d5f,_0x3a436f[_0xe5c3('0x49')]);return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')](_0x4e7d5f)['then'](handleEntityNotFound(_0x20e3e6,null))[_0xe5c3('0x26')](respondWithResult(_0x20e3e6,null))[_0xe5c3('0x43')](handleError(_0x20e3e6,null));};exports[_0xe5c3('0x4b')]=function(_0x31f8df,_0x328fc1){return db[_0xe5c3('0x3e')][_0xe5c3('0x4b')](_0x31f8df['body'],{})[_0xe5c3('0x26')](respondWithResult(_0x328fc1,0xc9))[_0xe5c3('0x43')](handleError(_0x328fc1,null));};exports['update']=function(_0x48d6e8,_0x3ac483){if(_0x48d6e8[_0xe5c3('0x4c')]['id']){delete _0x48d6e8['body']['id'];}return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')]({'where':{'id':_0x48d6e8[_0xe5c3('0x45')]['id']}})[_0xe5c3('0x26')](handleEntityNotFound(_0x3ac483,null))[_0xe5c3('0x26')](saveUpdates(_0x48d6e8[_0xe5c3('0x4c')],null))[_0xe5c3('0x26')](respondWithResult(_0x3ac483,null))[_0xe5c3('0x43')](handleError(_0x3ac483,null));};exports[_0xe5c3('0x27')]=function(_0xff23fc,_0x53b8e6){return db[_0xe5c3('0x3e')][_0xe5c3('0x4a')]({'where':{'id':_0xff23fc[_0xe5c3('0x45')]['id']}})['then'](handleEntityNotFound(_0x53b8e6,null))[_0xe5c3('0x26')](removeEntity(_0x53b8e6,null))[_0xe5c3('0x43')](handleError(_0x53b8e6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7d6fb38..1f29a3c 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 _0x1dd1=['bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_trees','lodash','util','../../config/logger','moment'];(function(_0x13ced3,_0x529a2a){var _0x43897f=function(_0x135f1c){while(--_0x135f1c){_0x13ced3['push'](_0x13ced3['shift']());}};_0x43897f(++_0x529a2a);}(_0x1dd1,0x1eb));var _0x11dd=function(_0x3c834d,_0x4f9feb){_0x3c834d=_0x3c834d-0x0;var _0x508ff4=_0x1dd1[_0x3c834d];return _0x508ff4;};'use strict';var _=require(_0x11dd('0x0'));var util=require(_0x11dd('0x1'));var logger=require(_0x11dd('0x2'))('api');var moment=require(_0x11dd('0x3'));var BPromise=require(_0x11dd('0x4'));var rp=require(_0x11dd('0x5'));var fs=require('fs');var path=require(_0x11dd('0x6'));var rimraf=require(_0x11dd('0x7'));var config=require(_0x11dd('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0xd3434b,_0x55e37f){return _0xd3434b[_0x11dd('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x11dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f0f=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','AnalyticTreeReport'];(function(_0x22428b,_0x452081){var _0x32e841=function(_0x19f153){while(--_0x19f153){_0x22428b['push'](_0x22428b['shift']());}};_0x32e841(++_0x452081);}(_0x1f0f,0xd8));var _0xf1f0=function(_0x20f2d4,_0x3c653d){_0x20f2d4=_0x20f2d4-0x0;var _0x35a95c=_0x1f0f[_0x20f2d4];return _0x35a95c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1f0('0x0'))(_0xf1f0('0x1'));var moment=require(_0xf1f0('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1f0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1f0('0x4'));var config=require(_0xf1f0('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0xf1f0('0x6')]=function(_0x5883af,_0x1a4668){return _0x5883af['define'](_0xf1f0('0x7'),attributes,{'tableName':'analytics_report_trees','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 9d2af9d..b54d678 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x156734,_0x14351b){var _0x3565a3=function(_0xc7e906){while(--_0xc7e906){_0x156734['push'](_0x156734['shift']());}};_0x3565a3(++_0x14351b);}(_0xdb28,0x106));var _0x8db2=function(_0x46bfe0,_0x55b1ca){_0x46bfe0=_0x46bfe0-0x0;var _0x9a062f=_0xdb28[_0x46bfe0];return _0x9a062f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x4f2422,_0x4912b1){_0x4f2422=_0x4f2422-0x0;var _0x542977=_0x7a54[_0x4f2422];return _0x542977;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4382dc3..afdad96 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 _0xcf97=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x5ada9e,_0x2ef5a7){var _0x48f5a8=function(_0x45d089){while(--_0x45d089){_0x5ada9e['push'](_0x5ada9e['shift']());}};_0x48f5a8(++_0x2ef5a7);}(_0xcf97,0x1d7));var _0x7cf9=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xcf97[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x7cf9('0x0'));var util=require(_0x7cf9('0x1'));var path=require(_0x7cf9('0x2'));var timeout=require(_0x7cf9('0x3'));var express=require(_0x7cf9('0x4'));var router=express[_0x7cf9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7cf9('0x6'));var interaction=require(_0x7cf9('0x7'));var config=require('../../config/environment');var controller=require(_0x7cf9('0x8'));router[_0x7cf9('0x9')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xb')]);router[_0x7cf9('0x9')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xd')]);router[_0x7cf9('0xe')]('/',auth[_0x7cf9('0xa')](),controller[_0x7cf9('0xf')]);router[_0x7cf9('0x10')](_0x7cf9('0xc'),auth[_0x7cf9('0xa')](),controller[_0x7cf9('0x11')]);router[_0x7cf9('0x12')](_0x7cf9('0xc'),auth['isAuthenticated'](),controller[_0x7cf9('0x13')]);module[_0x7cf9('0x14')]=router; \ No newline at end of file +var _0x693b=['../../config/environment','./analyticTreeReport.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa8369a,_0x3d2319){var _0x4b74b7=function(_0x11d138){while(--_0x11d138){_0xa8369a['push'](_0xa8369a['shift']());}};_0x4b74b7(++_0x3d2319);}(_0x693b,0x9b));var _0xb693=function(_0x46aa51,_0x2aba08){_0x46aa51=_0x46aa51-0x0;var _0x5b07a5=_0x693b[_0x46aa51];return _0x5b07a5;};'use strict';var multer=require(_0xb693('0x0'));var util=require(_0xb693('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb693('0x2'));var router=express[_0xb693('0x3')]();var fs_extra=require(_0xb693('0x4'));var auth=require(_0xb693('0x5'));var interaction=require(_0xb693('0x6'));var config=require(_0xb693('0x7'));var controller=require(_0xb693('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb693('0x9')](_0xb693('0xa'),auth[_0xb693('0xb')](),controller['show']);router[_0xb693('0xc')]('/',auth[_0xb693('0xb')](),controller[_0xb693('0xd')]);router[_0xb693('0xe')](_0xb693('0xa'),auth[_0xb693('0xb')](),controller[_0xb693('0xf')]);router[_0xb693('0x10')](_0xb693('0xa'),auth['isAuthenticated'](),controller[_0xb693('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c047319..fe81616 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 _0x05b0=['STRING'];(function(_0x2471c0,_0x87358){var _0x3843c1=function(_0xcdf8ed){while(--_0xcdf8ed){_0x2471c0['push'](_0x2471c0['shift']());}};_0x3843c1(++_0x87358);}(_0x05b0,0x188));var _0x005b=function(_0x5c64d3,_0x47d863){_0x5c64d3=_0x5c64d3-0x0;var _0x4ead44=_0x05b0[_0x5c64d3];return _0x4ead44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x005b('0x0')]},'basename':{'type':Sequelize[_0x005b('0x0')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd7b=['STRING','exports'];(function(_0x4876dc,_0x3a8c80){var _0x2e22a5=function(_0x3a79a2){while(--_0x3a79a2){_0x4876dc['push'](_0x4876dc['shift']());}};_0x2e22a5(++_0x3a8c80);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xfd7b[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'name':{'type':Sequelize[_0xbfd7('0x1')]},'basename':{'type':Sequelize[_0xbfd7('0x1')]},'type':{'type':Sequelize[_0xbfd7('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6af4ecb..0c86f8d 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 _0xd9fc=['mustache','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Attachment','include','findAll','catch','show','keys','includeAll','find','params','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','offline-chat/','join','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1376d9,_0x55674d){var _0x52ef9c=function(_0x43265a){while(--_0x43265a){_0x1376d9['push'](_0x1376d9['shift']());}};_0x52ef9c(++_0x55674d);}(_0xd9fc,0x1a4));var _0xcd9f=function(_0x5ac654,_0x117532){_0x5ac654=_0x5ac654-0x0;var _0x3a47e7=_0xd9fc[_0x5ac654];return _0x3a47e7;};'use strict';var emlformat=require(_0xcd9f('0x0'));var rimraf=require(_0xcd9f('0x1'));var zipdir=require(_0xcd9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9f('0x3'));var moment=require(_0xcd9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd9f('0x5'));var util=require('util');var path=require(_0xcd9f('0x6'));var sox=require(_0xcd9f('0x7'));var csv=require(_0xcd9f('0x8'));var ejs=require(_0xcd9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9f('0xa'));var squel=require(_0xcd9f('0xb'));var crypto=require(_0xcd9f('0xc'));var jsforce=require(_0xcd9f('0xd'));var deskjs=require(_0xcd9f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd9f('0xf'));var authService=require(_0xcd9f('0x10'));var qs=require(_0xcd9f('0x11'));var as=require(_0xcd9f('0x12'));var hardwareService=require(_0xcd9f('0x13'));var logger=require(_0xcd9f('0x14'))(_0xcd9f('0x15'));var utils=require(_0xcd9f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9f('0x17'));var db=require(_0xcd9f('0x18'))['db'];function respondWithStatusCode(_0x458c1c,_0x4fbce6){_0x4fbce6=_0x4fbce6||0xcc;return function(_0x405a32){if(_0x405a32){return _0x458c1c[_0xcd9f('0x19')](_0x4fbce6);}return _0x458c1c[_0xcd9f('0x1a')](_0x4fbce6)[_0xcd9f('0x1b')]();};}function respondWithResult(_0x401c4a,_0x47a119){_0x47a119=_0x47a119||0xc8;return function(_0x4e7571){if(_0x4e7571){return _0x401c4a['status'](_0x47a119)[_0xcd9f('0x1c')](_0x4e7571);}};}function respondWithFilteredResult(_0x7130fe,_0x50d27c){return function(_0x53c78b){if(_0x53c78b){var _0x29ee11=typeof _0x50d27c[_0xcd9f('0x1d')]===_0xcd9f('0x1e')&&typeof _0x50d27c[_0xcd9f('0x1f')]==='undefined';var _0x2d1fd7=_0x53c78b[_0xcd9f('0x20')];var _0xb8a7c1=_0x29ee11?0x0:_0x50d27c[_0xcd9f('0x1d')];var _0xed956b=_0x29ee11?_0x53c78b[_0xcd9f('0x20')]:_0x50d27c[_0xcd9f('0x1d')]+_0x50d27c[_0xcd9f('0x1f')];var _0x3b05dc;if(_0xed956b>=_0x2d1fd7){_0xed956b=_0x2d1fd7;_0x3b05dc=0xc8;}else{_0x3b05dc=0xce;}_0x7130fe[_0xcd9f('0x1a')](_0x3b05dc);return _0x7130fe[_0xcd9f('0x21')]('Content-Range',_0xb8a7c1+'-'+_0xed956b+'/'+_0x2d1fd7)['json'](_0x53c78b);}return null;};}function patchUpdates(_0x2f36c1){return function(_0x188407){try{jsonpatch[_0xcd9f('0x22')](_0x188407,_0x2f36c1,!![]);}catch(_0x3d5e5f){return BPromise['reject'](_0x3d5e5f);}return _0x188407['save']();};}function saveUpdates(_0x3d4d24,_0x2b826d){return function(_0xc9df26){if(_0xc9df26){return _0xc9df26[_0xcd9f('0x23')](_0x3d4d24)[_0xcd9f('0x24')](function(_0x4ddc1b){return _0x4ddc1b;});}return null;};}function removeEntity(_0x561057,_0x3d5552){return function(_0x5c1736){if(_0x5c1736){return _0x5c1736[_0xcd9f('0x25')]()[_0xcd9f('0x24')](function(){_0x561057[_0xcd9f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5398a2,_0x56c2da){return function(_0x1fe495){if(!_0x1fe495){_0x5398a2[_0xcd9f('0x19')](0x194);}return _0x1fe495;};}function handleError(_0x357592,_0x3cf628){_0x3cf628=_0x3cf628||0x1f4;return function(_0xd7b2a8){logger[_0xcd9f('0x26')](_0xd7b2a8[_0xcd9f('0x27')]);if(_0xd7b2a8[_0xcd9f('0x28')]){delete _0xd7b2a8['name'];}_0x357592[_0xcd9f('0x1a')](_0x3cf628)['send'](_0xd7b2a8);};}exports[_0xcd9f('0x29')]=function(_0xbdcf09,_0x30193d){var _0x40c1a6={},_0x347b52={},_0x5ca88a={'count':0x0,'rows':[]};var _0xc1785=_[_0xcd9f('0x2a')](db['Attachment'][_0xcd9f('0x2b')],function(_0xb3ace4){return{'name':_0xb3ace4['fieldName'],'type':_0xb3ace4[_0xcd9f('0x2c')]['key']};});_0x347b52[_0xcd9f('0x2d')]=_[_0xcd9f('0x2a')](_0xc1785,_0xcd9f('0x28'));_0x347b52['query']=_['keys'](_0xbdcf09[_0xcd9f('0x2e')]);_0x347b52['filters']=_[_0xcd9f('0x2f')](_0x347b52[_0xcd9f('0x2d')],_0x347b52[_0xcd9f('0x2e')]);_0x40c1a6[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x347b52['model'],qs[_0xcd9f('0x31')](_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x40c1a6[_0xcd9f('0x30')]=_0x40c1a6[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x40c1a6[_0xcd9f('0x30')]:_0x347b52['model'];if(!_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x33')](_0xcd9f('0x34'))){_0x40c1a6[_0xcd9f('0x1f')]=qs[_0xcd9f('0x1f')](_0xbdcf09[_0xcd9f('0x2e')]['limit']);_0x40c1a6[_0xcd9f('0x1d')]=qs['offset'](_0xbdcf09['query'][_0xcd9f('0x1d')]);}_0x40c1a6[_0xcd9f('0x35')]=qs[_0xcd9f('0x36')](_0xbdcf09['query'][_0xcd9f('0x36')]);_0x40c1a6[_0xcd9f('0x37')]=qs[_0xcd9f('0x38')](_[_0xcd9f('0x39')](_0xbdcf09['query'],_0x347b52['filters']),_0xc1785);if(_0xbdcf09['query'][_0xcd9f('0x3a')]){_0x40c1a6['where']=_[_0xcd9f('0x3b')](_0x40c1a6['where'],{'$or':_[_0xcd9f('0x2a')](_0xc1785,function(_0x30a01c){if(_0x30a01c[_0xcd9f('0x2c')]!==_0xcd9f('0x3c')){var _0x4eb31d={};_0x4eb31d[_0x30a01c[_0xcd9f('0x28')]]={'$like':'%'+_0xbdcf09[_0xcd9f('0x2e')][_0xcd9f('0x3a')]+'%'};return _0x4eb31d;}})});}_0x40c1a6=_['merge']({},_0x40c1a6,_0xbdcf09[_0xcd9f('0x3d')]);var _0x1e3dc1={'where':_0x40c1a6[_0xcd9f('0x37')]};return db[_0xcd9f('0x3e')][_0xcd9f('0x20')](_0x1e3dc1)[_0xcd9f('0x24')](function(_0x48ad4d){_0x5ca88a[_0xcd9f('0x20')]=_0x48ad4d;if(_0xbdcf09['query']['includeAll']){_0x40c1a6[_0xcd9f('0x3f')]=[{'all':!![]}];}return db[_0xcd9f('0x3e')][_0xcd9f('0x40')](_0x40c1a6);})[_0xcd9f('0x24')](function(_0x2049be){_0x5ca88a['rows']=_0x2049be;return _0x5ca88a;})[_0xcd9f('0x24')](respondWithFilteredResult(_0x30193d,_0x40c1a6))[_0xcd9f('0x41')](handleError(_0x30193d,null));};exports[_0xcd9f('0x42')]=function(_0x47b740,_0x331c7e){var _0x4d0d61={'raw':!![],'where':{'id':_0x47b740['params']['id']}},_0x4f1d50={};_0x4f1d50[_0xcd9f('0x2d')]=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x4f1d50[_0xcd9f('0x2e')]=_['keys'](_0x47b740[_0xcd9f('0x2e')]);_0x4f1d50[_0xcd9f('0x38')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],_0x4f1d50['query']);_0x4d0d61[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0x4f1d50[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x47b740['query']['fields']));_0x4d0d61[_0xcd9f('0x30')]=_0x4d0d61[_0xcd9f('0x30')]['length']?_0x4d0d61[_0xcd9f('0x30')]:_0x4f1d50['model'];if(_0x47b740[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x4d0d61[_0xcd9f('0x3f')]=[{'all':!![]}];}_0x4d0d61=_['merge']({},_0x4d0d61,_0x47b740[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x45')](_0x4d0d61)[_0xcd9f('0x24')](handleEntityNotFound(_0x331c7e,null))['then'](respondWithResult(_0x331c7e,null))[_0xcd9f('0x41')](handleError(_0x331c7e,null));};exports['clone']=function(_0x503c31,_0x3ed8ec){var _0x3d6e53={'where':{'id':_0x503c31[_0xcd9f('0x46')]['id']}},_0xe17dbd={};_0xe17dbd['model']=_[_0xcd9f('0x43')](db[_0xcd9f('0x3e')][_0xcd9f('0x2b')]);_0x3d6e53[_0xcd9f('0x30')]=_[_0xcd9f('0x2f')](_0xe17dbd[_0xcd9f('0x2d')],qs[_0xcd9f('0x31')](_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x31')]));_0x3d6e53['attributes']=_0x3d6e53[_0xcd9f('0x30')][_0xcd9f('0x32')]?_0x3d6e53[_0xcd9f('0x30')]:_0xe17dbd[_0xcd9f('0x2d')];if(_0x503c31[_0xcd9f('0x2e')][_0xcd9f('0x44')]){_0x3d6e53['include']=[{'all':!![]}];}_0x3d6e53=_[_0xcd9f('0x3b')]({},_0x3d6e53,_0x503c31[_0xcd9f('0x3d')]);return db[_0xcd9f('0x3e')]['find'](_0x3d6e53)['then'](handleEntityNotFound(_0x3ed8ec,null))[_0xcd9f('0x24')](function(_0x3c98aa){if(_0x3c98aa){var _0x1b993c=_0x3c98aa['get']({'plain':!![]});_0x1b993c=qs['omit'](_0x1b993c,['id',_0xcd9f('0x47'),_0xcd9f('0x48')]);_0x503c31[_0xcd9f('0x49')]=_['omit'](_0x503c31[_0xcd9f('0x49')],['id','createdAt',_0xcd9f('0x48')]);return db[_0xcd9f('0x3e')][_0xcd9f('0x4a')](_['merge'](_0x1b993c,_0x503c31[_0xcd9f('0x49')]),{'include':_0x503c31['query'][_0xcd9f('0x44')]?[{'all':!![]}]:undefined});}})[_0xcd9f('0x24')](respondWithResult(_0x3ed8ec,0xc9))[_0xcd9f('0x41')](handleError(_0x3ed8ec,null));};exports['update']=function(_0x54e6d0,_0x4ca296){if(_0x54e6d0[_0xcd9f('0x49')]['id']){delete _0x54e6d0['body']['id'];}return db[_0xcd9f('0x3e')][_0xcd9f('0x45')]({'where':{'id':_0x54e6d0[_0xcd9f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ca296,null))[_0xcd9f('0x24')](saveUpdates(_0x54e6d0[_0xcd9f('0x49')],null))['then'](respondWithResult(_0x4ca296,null))[_0xcd9f('0x41')](handleError(_0x4ca296,null));};exports[_0xcd9f('0x25')]=function(_0x56ac17,_0x5b2367){return db['Attachment'][_0xcd9f('0x45')]({'where':{'id':_0x56ac17[_0xcd9f('0x46')]['id']}})[_0xcd9f('0x24')](handleEntityNotFound(_0x5b2367,null))[_0xcd9f('0x24')](removeEntity(_0x5b2367,null))[_0xcd9f('0x41')](handleError(_0x5b2367,null));};exports[_0xcd9f('0x4a')]=function(_0x7e0795,_0x6bda16,_0x2c866e){_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x28')]=_0x7e0795['file'][_0xcd9f('0x4b')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x4c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4e')];_0x7e0795[_0xcd9f('0x49')][_0xcd9f('0x2c')]=_0x7e0795[_0xcd9f('0x4d')][_0xcd9f('0x4f')];return db['Attachment'][_0xcd9f('0x4a')](_0x7e0795['body'])[_0xcd9f('0x24')](respondWithResult(_0x6bda16,0xc9))['catch'](handleError(_0x6bda16,null));};exports[_0xcd9f('0x50')]=function(_0x51aeca,_0x88162,_0xcdda62){return db[_0xcd9f('0x3e')][_0xcd9f('0x51')]({'where':{'id':_0x51aeca[_0xcd9f('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x88162,null))[_0xcd9f('0x24')](function(_0x1d997c){if(_0x1d997c){var _0xe3c944=_0x1d997c[_0xcd9f('0x52')]!==null;var _0x3b7681=path['join'](config['root'],'server/files/attachments/');if(_0xe3c944){_0x3b7681=path['join'](_0x3b7681,_0xcd9f('0x53'));}var _0x1b5b5f=path[_0xcd9f('0x54')](_0x3b7681,_0x1d997c[_0xcd9f('0x4c')]);return _0x88162[_0xcd9f('0x50')](_0x1b5b5f);}})[_0xcd9f('0x41')](handleError(_0x88162,null));}; \ No newline at end of file +var _0xac80=['include','omit','updatedAt','createdAt','create','body','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','save','update','destroy','then','name','send','index','map','Attachment','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','clone'];(function(_0x5c3151,_0x18bfe0){var _0x2c4a35=function(_0x4866e6){while(--_0x4866e6){_0x5c3151['push'](_0x5c3151['shift']());}};_0x2c4a35(++_0x18bfe0);}(_0xac80,0xb9));var _0x0ac8=function(_0x537d9e,_0x44d509){_0x537d9e=_0x537d9e-0x0;var _0x165c72=_0xac80[_0x537d9e];return _0x165c72;};'use strict';var emlformat=require(_0x0ac8('0x0'));var rimraf=require(_0x0ac8('0x1'));var zipdir=require(_0x0ac8('0x2'));var jsonpatch=require(_0x0ac8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ac8('0x4'));var Mustache=require(_0x0ac8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0ac8('0x6'));var ejs=require(_0x0ac8('0x7'));var fs=require('fs');var fs_extra=require(_0x0ac8('0x8'));var _=require(_0x0ac8('0x9'));var squel=require(_0x0ac8('0xa'));var crypto=require(_0x0ac8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ac8('0x6'));var querystring=require(_0x0ac8('0xc'));var Papa=require(_0x0ac8('0xd'));var Redis=require(_0x0ac8('0xe'));var authService=require(_0x0ac8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ac8('0x10'));var logger=require(_0x0ac8('0x11'))(_0x0ac8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ac8('0x13'));var db=require(_0x0ac8('0x14'))['db'];function respondWithStatusCode(_0x4f15f7,_0x28370e){_0x28370e=_0x28370e||0xcc;return function(_0x473e1a){if(_0x473e1a){return _0x4f15f7[_0x0ac8('0x15')](_0x28370e);}return _0x4f15f7[_0x0ac8('0x16')](_0x28370e)[_0x0ac8('0x17')]();};}function respondWithResult(_0x16d383,_0x3d55df){_0x3d55df=_0x3d55df||0xc8;return function(_0x60400){if(_0x60400){return _0x16d383['status'](_0x3d55df)[_0x0ac8('0x18')](_0x60400);}};}function respondWithFilteredResult(_0x15d72f,_0x1b3bc3){return function(_0x3859c2){if(_0x3859c2){var _0x46282b=typeof _0x1b3bc3[_0x0ac8('0x19')]===_0x0ac8('0x1a')&&typeof _0x1b3bc3['limit']===_0x0ac8('0x1a');var _0x5f0b35=_0x3859c2['count'];var _0x19b9a1=_0x46282b?0x0:_0x1b3bc3[_0x0ac8('0x19')];var _0x395d23=_0x46282b?_0x3859c2[_0x0ac8('0x1b')]:_0x1b3bc3[_0x0ac8('0x19')]+_0x1b3bc3[_0x0ac8('0x1c')];var _0x5d19e8;if(_0x395d23>=_0x5f0b35){_0x395d23=_0x5f0b35;_0x5d19e8=0xc8;}else{_0x5d19e8=0xce;}_0x15d72f[_0x0ac8('0x16')](_0x5d19e8);return _0x15d72f[_0x0ac8('0x1d')]('Content-Range',_0x19b9a1+'-'+_0x395d23+'/'+_0x5f0b35)[_0x0ac8('0x18')](_0x3859c2);}return null;};}function patchUpdates(_0x426833){return function(_0x18d94d){try{jsonpatch['apply'](_0x18d94d,_0x426833,!![]);}catch(_0x5d8052){return BPromise['reject'](_0x5d8052);}return _0x18d94d[_0x0ac8('0x1e')]();};}function saveUpdates(_0x46ecb3,_0x23d602){return function(_0xd8d28c){if(_0xd8d28c){return _0xd8d28c[_0x0ac8('0x1f')](_0x46ecb3)['then'](function(_0x26db6d){return _0x26db6d;});}return null;};}function removeEntity(_0x2ef4ba,_0x52fbf1){return function(_0x3cd88d){if(_0x3cd88d){return _0x3cd88d[_0x0ac8('0x20')]()[_0x0ac8('0x21')](function(){_0x2ef4ba[_0x0ac8('0x16')](0xcc)[_0x0ac8('0x17')]();});}};}function handleEntityNotFound(_0x286c6b,_0x5dac04){return function(_0x288062){if(!_0x288062){_0x286c6b['sendStatus'](0x194);}return _0x288062;};}function handleError(_0x3c0072,_0x59430b){_0x59430b=_0x59430b||0x1f4;return function(_0x3ac7ca){logger['error'](_0x3ac7ca['stack']);if(_0x3ac7ca[_0x0ac8('0x22')]){delete _0x3ac7ca[_0x0ac8('0x22')];}_0x3c0072[_0x0ac8('0x16')](_0x59430b)[_0x0ac8('0x23')](_0x3ac7ca);};}exports[_0x0ac8('0x24')]=function(_0x317fa9,_0x3659eb){var _0xd7805={},_0x14f260={},_0x2b9dc5={'count':0x0,'rows':[]};var _0x1d3fc9=_[_0x0ac8('0x25')](db[_0x0ac8('0x26')]['rawAttributes'],function(_0x564c56){return{'name':_0x564c56[_0x0ac8('0x27')],'type':_0x564c56[_0x0ac8('0x28')][_0x0ac8('0x29')]};});_0x14f260['model']=_[_0x0ac8('0x25')](_0x1d3fc9,_0x0ac8('0x22'));_0x14f260[_0x0ac8('0x2a')]=_['keys'](_0x317fa9[_0x0ac8('0x2a')]);_0x14f260[_0x0ac8('0x2b')]=_['intersection'](_0x14f260['model'],_0x14f260[_0x0ac8('0x2a')]);_0xd7805[_0x0ac8('0x2c')]=_[_0x0ac8('0x2d')](_0x14f260[_0x0ac8('0x2e')],qs[_0x0ac8('0x2f')](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x2f')]));_0xd7805[_0x0ac8('0x2c')]=_0xd7805[_0x0ac8('0x2c')][_0x0ac8('0x30')]?_0xd7805[_0x0ac8('0x2c')]:_0x14f260[_0x0ac8('0x2e')];if(!_0x317fa9['query']['hasOwnProperty']('nolimit')){_0xd7805[_0x0ac8('0x1c')]=qs[_0x0ac8('0x1c')](_0x317fa9[_0x0ac8('0x2a')]['limit']);_0xd7805[_0x0ac8('0x19')]=qs['offset'](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x19')]);}_0xd7805[_0x0ac8('0x31')]=qs[_0x0ac8('0x32')](_0x317fa9[_0x0ac8('0x2a')][_0x0ac8('0x32')]);_0xd7805[_0x0ac8('0x33')]=qs[_0x0ac8('0x2b')](_[_0x0ac8('0x34')](_0x317fa9['query'],_0x14f260[_0x0ac8('0x2b')]),_0x1d3fc9);if(_0x317fa9['query'][_0x0ac8('0x35')]){_0xd7805[_0x0ac8('0x33')]=_[_0x0ac8('0x36')](_0xd7805['where'],{'$or':_['map'](_0x1d3fc9,function(_0x2aa330){if(_0x2aa330[_0x0ac8('0x28')]!==_0x0ac8('0x37')){var _0x142f81={};_0x142f81[_0x2aa330[_0x0ac8('0x22')]]={'$like':'%'+_0x317fa9['query'][_0x0ac8('0x35')]+'%'};return _0x142f81;}})});}_0xd7805=_['merge']({},_0xd7805,_0x317fa9[_0x0ac8('0x38')]);var _0x54f1a2={'where':_0xd7805[_0x0ac8('0x33')]};return db[_0x0ac8('0x26')][_0x0ac8('0x1b')](_0x54f1a2)[_0x0ac8('0x21')](function(_0x307afd){_0x2b9dc5['count']=_0x307afd;if(_0x317fa9[_0x0ac8('0x2a')]['includeAll']){_0xd7805['include']=[{'all':!![]}];}return db[_0x0ac8('0x26')][_0x0ac8('0x39')](_0xd7805);})[_0x0ac8('0x21')](function(_0x14d510){_0x2b9dc5[_0x0ac8('0x3a')]=_0x14d510;return _0x2b9dc5;})['then'](respondWithFilteredResult(_0x3659eb,_0xd7805))[_0x0ac8('0x3b')](handleError(_0x3659eb,null));};exports[_0x0ac8('0x3c')]=function(_0x592ad1,_0x55582e){var _0x5ec96e={'raw':!![],'where':{'id':_0x592ad1[_0x0ac8('0x3d')]['id']}},_0xdc73ca={};_0xdc73ca[_0x0ac8('0x2e')]=_[_0x0ac8('0x3e')](db[_0x0ac8('0x26')][_0x0ac8('0x3f')]);_0xdc73ca[_0x0ac8('0x2a')]=_['keys'](_0x592ad1[_0x0ac8('0x2a')]);_0xdc73ca[_0x0ac8('0x2b')]=_[_0x0ac8('0x2d')](_0xdc73ca[_0x0ac8('0x2e')],_0xdc73ca['query']);_0x5ec96e[_0x0ac8('0x2c')]=_[_0x0ac8('0x2d')](_0xdc73ca['model'],qs['fields'](_0x592ad1['query'][_0x0ac8('0x2f')]));_0x5ec96e['attributes']=_0x5ec96e['attributes'][_0x0ac8('0x30')]?_0x5ec96e[_0x0ac8('0x2c')]:_0xdc73ca[_0x0ac8('0x2e')];if(_0x592ad1['query'][_0x0ac8('0x40')]){_0x5ec96e['include']=[{'all':!![]}];}_0x5ec96e=_[_0x0ac8('0x36')]({},_0x5ec96e,_0x592ad1[_0x0ac8('0x38')]);return db[_0x0ac8('0x26')][_0x0ac8('0x41')](_0x5ec96e)[_0x0ac8('0x21')](handleEntityNotFound(_0x55582e,null))[_0x0ac8('0x21')](respondWithResult(_0x55582e,null))[_0x0ac8('0x3b')](handleError(_0x55582e,null));};exports[_0x0ac8('0x42')]=function(_0x221f87,_0x3399e1){var _0x90d546={'where':{'id':_0x221f87[_0x0ac8('0x3d')]['id']}},_0x54ae41={};_0x54ae41[_0x0ac8('0x2e')]=_[_0x0ac8('0x3e')](db[_0x0ac8('0x26')]['rawAttributes']);_0x90d546['attributes']=_[_0x0ac8('0x2d')](_0x54ae41[_0x0ac8('0x2e')],qs[_0x0ac8('0x2f')](_0x221f87[_0x0ac8('0x2a')][_0x0ac8('0x2f')]));_0x90d546['attributes']=_0x90d546[_0x0ac8('0x2c')][_0x0ac8('0x30')]?_0x90d546['attributes']:_0x54ae41[_0x0ac8('0x2e')];if(_0x221f87[_0x0ac8('0x2a')][_0x0ac8('0x40')]){_0x90d546[_0x0ac8('0x43')]=[{'all':!![]}];}_0x90d546=_[_0x0ac8('0x36')]({},_0x90d546,_0x221f87[_0x0ac8('0x38')]);return db['Attachment'][_0x0ac8('0x41')](_0x90d546)[_0x0ac8('0x21')](handleEntityNotFound(_0x3399e1,null))['then'](function(_0x270807){if(_0x270807){var _0x50d5bb=_0x270807['get']({'plain':!![]});_0x50d5bb=qs[_0x0ac8('0x44')](_0x50d5bb,['id','createdAt',_0x0ac8('0x45')]);_0x221f87['body']=_[_0x0ac8('0x44')](_0x221f87['body'],['id',_0x0ac8('0x46'),'updatedAt']);return db[_0x0ac8('0x26')][_0x0ac8('0x47')](_['merge'](_0x50d5bb,_0x221f87[_0x0ac8('0x48')]),{'include':_0x221f87['query'][_0x0ac8('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3399e1,0xc9))[_0x0ac8('0x3b')](handleError(_0x3399e1,null));};exports['update']=function(_0x57e21e,_0x25ec7e){if(_0x57e21e[_0x0ac8('0x48')]['id']){delete _0x57e21e[_0x0ac8('0x48')]['id'];}return db['Attachment'][_0x0ac8('0x41')]({'where':{'id':_0x57e21e[_0x0ac8('0x3d')]['id']}})[_0x0ac8('0x21')](handleEntityNotFound(_0x25ec7e,null))['then'](saveUpdates(_0x57e21e[_0x0ac8('0x48')],null))[_0x0ac8('0x21')](respondWithResult(_0x25ec7e,null))[_0x0ac8('0x3b')](handleError(_0x25ec7e,null));};exports[_0x0ac8('0x20')]=function(_0x8068aa,_0x47487f){return db[_0x0ac8('0x26')][_0x0ac8('0x41')]({'where':{'id':_0x8068aa['params']['id']}})[_0x0ac8('0x21')](handleEntityNotFound(_0x47487f,null))[_0x0ac8('0x21')](removeEntity(_0x47487f,null))[_0x0ac8('0x3b')](handleError(_0x47487f,null));};exports['create']=function(_0x3efec5,_0x19e9e8,_0x468675){_0x3efec5['body'][_0x0ac8('0x22')]=_0x3efec5[_0x0ac8('0x49')][_0x0ac8('0x4a')];_0x3efec5[_0x0ac8('0x48')][_0x0ac8('0x4b')]=_0x3efec5['file'][_0x0ac8('0x4c')];_0x3efec5[_0x0ac8('0x48')][_0x0ac8('0x28')]=_0x3efec5[_0x0ac8('0x49')][_0x0ac8('0x4d')];return db['Attachment']['create'](_0x3efec5[_0x0ac8('0x48')])[_0x0ac8('0x21')](respondWithResult(_0x19e9e8,0xc9))[_0x0ac8('0x3b')](handleError(_0x19e9e8,null));};exports[_0x0ac8('0x4e')]=function(_0x1b71c1,_0x48facd,_0xbb2fab){return db[_0x0ac8('0x26')][_0x0ac8('0x4f')]({'where':{'id':_0x1b71c1[_0x0ac8('0x3d')]['id']},'raw':!![]})[_0x0ac8('0x21')](handleEntityNotFound(_0x48facd,null))[_0x0ac8('0x21')](function(_0x44293d){if(_0x44293d){var _0x4a3ae7=_0x44293d[_0x0ac8('0x50')]!==null;var _0x1311bd=path['join'](config[_0x0ac8('0x51')],_0x0ac8('0x52'));if(_0x4a3ae7){_0x1311bd=path['join'](_0x1311bd,_0x0ac8('0x53'));}var _0x3b3d25=path['join'](_0x1311bd,_0x44293d['basename']);return _0x48facd['download'](_0x3b3d25);}})['catch'](handleError(_0x48facd,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index eb98b8c..7de6972 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 _0xbafb=['./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a50e5,_0x14accb){var _0x53b463=function(_0x12df94){while(--_0x12df94){_0x1a50e5['push'](_0x1a50e5['shift']());}};_0x53b463(++_0x14accb);}(_0xbafb,0xbb));var _0xbbaf=function(_0x4a487f,_0x1b575c){_0x4a487f=_0x4a487f-0x0;var _0x446541=_0xbafb[_0x4a487f];return _0x446541;};'use strict';var _=require(_0xbbaf('0x0'));var util=require('util');var logger=require(_0xbbaf('0x1'))(_0xbbaf('0x2'));var moment=require(_0xbbaf('0x3'));var BPromise=require(_0xbbaf('0x4'));var rp=require(_0xbbaf('0x5'));var fs=require('fs');var path=require(_0xbbaf('0x6'));var rimraf=require('rimraf');var config=require(_0xbbaf('0x7'));var attributes=require(_0xbbaf('0x8'));module[_0xbbaf('0x9')]=function(_0x64d333,_0x577ccb){return _0x64d333[_0xbbaf('0xa')](_0xbbaf('0xb'),attributes,{'tableName':_0xbbaf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3804=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','request-promise','../../config/environment'];(function(_0x19b9d1,_0x4f603f){var _0x1ca4f7=function(_0x2d1ea7){while(--_0x2d1ea7){_0x19b9d1['push'](_0x19b9d1['shift']());}};_0x1ca4f7(++_0x4f603f);}(_0x3804,0x145));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4380('0x0'));var util=require(_0x4380('0x1'));var logger=require('../../config/logger')(_0x4380('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4380('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4380('0x4'));var attributes=require(_0x4380('0x5'));module[_0x4380('0x6')]=function(_0x823c5,_0x57e8e2){return _0x823c5[_0x4380('0x7')](_0x4380('0x8'),attributes,{'tableName':_0x4380('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index cd0181f..d60eddd 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 _0x1ddc=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','util','moment'];(function(_0x6b8671,_0x23fdb0){var _0x33c700=function(_0x52c831){while(--_0x52c831){_0x6b8671['push'](_0x6b8671['shift']());}};_0x33c700(++_0x23fdb0);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x5934be,_0x2007e0){_0x5934be=_0x5934be-0x0;var _0x2a9489=_0x1ddc[_0x5934be];return _0x2a9489;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('Attachment,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('Attachment,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});}exports['CreateAttachment']=function(_0x35139a){var _0x4c3114=this;return new Promise(function(_0x6198a7,_0x24446f){return db[_0xc1dd('0x16')][_0xc1dd('0x17')](_0x35139a[_0xc1dd('0x18')],{'raw':_0x35139a[_0xc1dd('0x19')]?_0x35139a['options'][_0xc1dd('0x1a')]===undefined?!![]:![]:!![]})[_0xc1dd('0xa')](function(_0x5e99a6){logger[_0xc1dd('0x13')](_0xc1dd('0x1b'),_0x35139a);logger[_0xc1dd('0xd')](_0xc1dd('0x1b'),_0x35139a,JSON[_0xc1dd('0xf')](_0x5e99a6));_0x6198a7(_0x5e99a6);})[_0xc1dd('0x15')](function(_0x228626){logger[_0xc1dd('0x10')]('CreateAttachment',_0x228626[_0xc1dd('0x12')],_0x35139a);_0x24446f(_0x4c3114[_0xc1dd('0x10')](0x1f4,_0x228626[_0xc1dd('0x12')]));});});}; \ No newline at end of file +var _0x1bca=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','raw','info'];(function(_0x2b1b0b,_0x19c4b6){var _0x8586f3=function(_0x551a67){while(--_0x551a67){_0x2b1b0b['push'](_0x2b1b0b['shift']());}};_0x8586f3(++_0x19c4b6);}(_0x1bca,0xb6));var _0xa1bc=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x1bca[_0x474035];return _0x1b58e0;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa1bc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1bc('0x2'))['db'];var utils=require(_0xa1bc('0x3'));var logger=require(_0xa1bc('0x4'))('rpc');var config=require(_0xa1bc('0x5'));var jayson=require(_0xa1bc('0x6'));var client=jayson[_0xa1bc('0x7')][_0xa1bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54bffb,_0x43a67,_0x432b65){return new BPromise(function(_0xea5ec8,_0x378061){return client[_0xa1bc('0x9')](_0x54bffb,_0x432b65)[_0xa1bc('0xa')](function(_0x2db364){logger['info'](_0xa1bc('0xb'),_0x43a67,_0xa1bc('0xc'));logger[_0xa1bc('0xd')](_0xa1bc('0xe'),_0x43a67,_0xa1bc('0xc'),JSON[_0xa1bc('0xf')](_0x2db364));if(_0x2db364[_0xa1bc('0x10')]){if(_0x2db364[_0xa1bc('0x10')]['code']===0x1f4){logger['error'](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0x378061(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0xea5ec8(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x43a67,_0xa1bc('0xc'));_0xea5ec8(_0x2db364[_0xa1bc('0x12')][_0xa1bc('0x11')]);}})[_0xa1bc('0x13')](function(_0x2a0438){logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2a0438);_0x378061(_0x2a0438);});});}exports[_0xa1bc('0x14')]=function(_0x4765be){var _0x5b9d7c=this;return new Promise(function(_0x510046,_0x238f1f){return db[_0xa1bc('0x15')][_0xa1bc('0x16')](_0x4765be[_0xa1bc('0x17')],{'raw':_0x4765be['options']?_0x4765be['options'][_0xa1bc('0x18')]===undefined?!![]:![]:!![]})[_0xa1bc('0xa')](function(_0x322703){logger[_0xa1bc('0x19')](_0xa1bc('0x14'),_0x4765be);logger[_0xa1bc('0xd')]('CreateAttachment',_0x4765be,JSON[_0xa1bc('0xf')](_0x322703));_0x510046(_0x322703);})[_0xa1bc('0x13')](function(_0x1e4f4e){logger['error'](_0xa1bc('0x14'),_0x1e4f4e['message'],_0x4765be);_0x238f1f(_0x5b9d7c[_0xa1bc('0x10')](0x1f4,_0x1e4f4e[_0xa1bc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2da8622..86be9e3 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4742c0,_0x2ddc6c){var _0x168d97=function(_0x48b24e){while(--_0x48b24e){_0x4742c0['push'](_0x4742c0['shift']());}};_0x168d97(++_0x2ddc6c);}(_0x2032,0xd9));var _0x2203=function(_0x53ad28,_0x3bfd56){_0x53ad28=_0x53ad28-0x0;var _0x4d7c13=_0x2032[_0x53ad28];return _0x4d7c13;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0b0e,0x187));var _0xe0b0=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x0b0e[_0x231b2e];return _0x3feb2a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index cf1b682..b16c16e 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 _0x8d01=['moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','api','activedirectory','undefined','baseDN','domain','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local'];(function(_0x53f1ee,_0x29cff6){var _0x3638da=function(_0x3986a5){while(--_0x3986a5){_0x53f1ee['push'](_0x53f1ee['shift']());}};_0x3638da(++_0x29cff6);}(_0x8d01,0x193));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x18d0('0x0'));var LocalStrategy=require(_0x18d0('0x1'))['Strategy'];var moment=require(_0x18d0('0x2'));var ActiveDirectory=require(_0x18d0('0x3'));var BPromise=require(_0x18d0('0x4'));var util=require(_0x18d0('0x5'));var db=require(_0x18d0('0x6'))['db'];var authService=require(_0x18d0('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x18d0('0x8'));function isActiveDirectoryConfigured(_0x5211ca){var _0x3de2d8=![];if(typeof _0x5211ca[_0x18d0('0x9')]!==_0x18d0('0xa')){_0x3de2d8=_0x5211ca[_0x18d0('0x9')][_0x18d0('0xb')]&&_0x5211ca[_0x18d0('0x9')]['url']&&_0x5211ca[_0x18d0('0x9')][_0x18d0('0xc')];}return _0x3de2d8;}function adAuthenticate(_0x1ed66a,_0x14557f,_0x3319c6){return new BPromise(function(_0x1fc404,_0x4874b1){try{var _0x3f59f7=new ActiveDirectory(_0x1ed66a);_0x3f59f7[_0x18d0('0xd')](_0x14557f,_0x3319c6,function(_0x1375fb,_0x5a2817){if(_0x1375fb){logger[_0x18d0('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x14557f,util['inspect'](_0x1375fb,{'showHidden':![],'depth':null}));_0x4874b1(_0x18d0('0xf'));}else if(!_0x5a2817){logger[_0x18d0('0xe')](_0x18d0('0x10'),_0x14557f);_0x4874b1(_0x18d0('0xf'));}else{_0x1fc404(_0x5a2817);}});}catch(_0x309cef){_0x4874b1(_0x309cef);}});}function ActiveDirectoryAuthenticate(_0x49c6e7,_0x200df5,_0x418374,_0x4bdca5){var _0x278153,_0x5aac21;if(!isActiveDirectoryConfigured(config)){logger[_0x18d0('0xe')](_0x18d0('0x11'),_0x200df5);return _0x4bdca5(null,![],{'message':_0x18d0('0xf')});}return db[_0x18d0('0x12')][_0x18d0('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x18d0('0x14')],'raw':!![]})[_0x18d0('0x15')](function(_0x2d36bd){_0x278153=_0x2d36bd;if(!_0x278153['adSsoEnabled']){logger[_0x18d0('0xe')](_0x18d0('0x16'),_0x200df5);throw new Error(_0x18d0('0xf'));}return _0x49c6e7[_0x18d0('0x13')]({'attributes':['id',_0x18d0('0x17'),_0x18d0('0x18'),_0x18d0('0x19'),_0x18d0('0x1a'),'disabled',_0x18d0('0x1b'),'blockedAt','online'],'where':{'name':_0x200df5,'role':{'$or':['admin',_0x18d0('0x1c'),_0x18d0('0x1d')]},'adSsoEnabled':!![]}});})[_0x18d0('0x15')](function(_0x4bec6a){if(!_0x4bec6a||_0x4bec6a&&_0x4bec6a[_0x18d0('0x17')]!==_0x200df5){throw new Error(_0x18d0('0xf'));}_0x5aac21=_0x4bec6a;var _0x1c164e=_0x5aac21[_0x18d0('0x17')]+'@'+config[_0x18d0('0x9')][_0x18d0('0xc')];return adAuthenticate(config[_0x18d0('0x9')],_0x1c164e,_0x418374);})[_0x18d0('0x15')](function(_0x2c1a76){if(_0x5aac21['disabled']){throw new Error(_0x18d0('0xf'));}if(_0x278153['blockDuration']>0x0){if(_0x5aac21[_0x18d0('0x1b')]){if(moment(_0x5aac21[_0x18d0('0x1e')])[_0x18d0('0x1f')](_0x278153[_0x18d0('0x14')],_0x18d0('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x18d0('0x21')](_0x5aac21,0x0,![],null)[_0x18d0('0x15')](function(){return utils[_0x18d0('0x22')](_0x5aac21);})[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}else{return utils['getLicense'](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}}else{return utils[_0x18d0('0x22')](_0x5aac21)[_0x18d0('0x15')](function(){return _0x4bdca5(null,_0x5aac21);});}})[_0x18d0('0x23')](function(_0xfdc08f){return _0x4bdca5(null,![],_0xfdc08f);});}function handleError(_0x5c5b78,_0x3dfa94,_0x4cf86e){return _0x5c5b78[_0x18d0('0x24')](_0x3dfa94||0x1f4)['send']({'message':_0x4cf86e?_0x4cf86e[_0x18d0('0x25')]||_0x4cf86e:''});}exports[_0x18d0('0x26')]=function(_0x4fc99e,_0x3f540b,_0x2c94ec){passport[_0x18d0('0xd')](_0x18d0('0x27'),function(_0x224d6a,_0xc0bf90,_0x448507){var _0x132e87=_0x224d6a||_0x448507;if(_0x132e87){return handleError(_0x3f540b,0x191,_0x132e87);}if(!_0xc0bf90){return handleError(_0x3f540b,0x194,{'message':_0x18d0('0x28')});}else{var _0xfa8aa={'payload':{'id':_0xc0bf90['id'],'role':_0xc0bf90[_0x18d0('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x18d0('0x29')](_0xfa8aa)[_0x18d0('0x15')](function(_0x47ec8f){_0x3f540b[_0x18d0('0x2a')]({'id':_0xc0bf90['id'],'token':_0x47ec8f,'statusCall':'','isAlreadyLogged':_0xc0bf90['online']});});}})(_0x4fc99e,_0x3f540b,_0x2c94ec);};passport[_0x18d0('0x2b')](_0x18d0('0x27'),new LocalStrategy({'usernameField':_0x18d0('0x17'),'passwordField':_0x18d0('0x18')},function(_0x2579a1,_0x261d75,_0x30d4c8){return ActiveDirectoryAuthenticate(db[_0x18d0('0x2c')],_0x2579a1,_0x261d75,_0x30d4c8);})); \ No newline at end of file +var _0x6a83=['activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','password','salt','role','disabled','blockedAt','online','user','blocked','add','minutes','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0x6a83,0x1a4));var _0x36a8=function(_0x3fb599,_0x43c9ce){_0x3fb599=_0x3fb599-0x0;var _0x3cbb3a=_0x6a83[_0x3fb599];return _0x3cbb3a;};'use strict';var passport=require(_0x36a8('0x0'));var LocalStrategy=require(_0x36a8('0x1'))['Strategy'];var moment=require(_0x36a8('0x2'));var ActiveDirectory=require(_0x36a8('0x3'));var BPromise=require(_0x36a8('0x4'));var util=require('util');var db=require(_0x36a8('0x5'))['db'];var authService=require(_0x36a8('0x6'));var utils=require(_0x36a8('0x7'));var config=require(_0x36a8('0x8'));var logger=require(_0x36a8('0x9'))(_0x36a8('0xa'));function isActiveDirectoryConfigured(_0x54a763){var _0x3cbd65=![];if(typeof _0x54a763[_0x36a8('0xb')]!==_0x36a8('0xc')){_0x3cbd65=_0x54a763[_0x36a8('0xb')]['baseDN']&&_0x54a763['activedirectory']['url']&&_0x54a763['activedirectory'][_0x36a8('0xd')];}return _0x3cbd65;}function adAuthenticate(_0x5f2629,_0xdecfc3,_0x37fd9e){return new BPromise(function(_0x29dd50,_0x4a410f){try{var _0x1efe0f=new ActiveDirectory(_0x5f2629);_0x1efe0f[_0x36a8('0xe')](_0xdecfc3,_0x37fd9e,function(_0x5be619,_0x53439f){if(_0x5be619){logger[_0x36a8('0xf')](_0x36a8('0x10'),_0xdecfc3,util[_0x36a8('0x11')](_0x5be619,{'showHidden':![],'depth':null}));_0x4a410f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x53439f){logger[_0x36a8('0xf')](_0x36a8('0x12'),_0xdecfc3);_0x4a410f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x29dd50(_0x53439f);}});}catch(_0x45253f){_0x4a410f(_0x45253f);}});}function ActiveDirectoryAuthenticate(_0x5a003d,_0x51a95e,_0x360429,_0x4540c4){var _0x7e5b8b,_0x5d9a08;if(!isActiveDirectoryConfigured(config)){logger[_0x36a8('0xf')](_0x36a8('0x13'),_0x51a95e);return _0x4540c4(null,![],{'message':_0x36a8('0x14')});}return db[_0x36a8('0x15')][_0x36a8('0x16')]({'where':{'id':0x1},'attributes':[_0x36a8('0x17'),_0x36a8('0x18')],'raw':!![]})[_0x36a8('0x19')](function(_0x43a8f3){_0x7e5b8b=_0x43a8f3;if(!_0x7e5b8b[_0x36a8('0x17')]){logger[_0x36a8('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x51a95e);throw new Error(_0x36a8('0x14'));}return _0x5a003d['findOne']({'attributes':['id','name',_0x36a8('0x1a'),_0x36a8('0x1b'),_0x36a8('0x1c'),_0x36a8('0x1d'),'blocked',_0x36a8('0x1e'),_0x36a8('0x1f')],'where':{'name':_0x51a95e,'role':{'$or':['admin',_0x36a8('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x36a8('0x19')](function(_0x1ae46b){if(!_0x1ae46b||_0x1ae46b&&_0x1ae46b['name']!==_0x51a95e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x5d9a08=_0x1ae46b;var _0x4fb222=_0x5d9a08['name']+'@'+config[_0x36a8('0xb')][_0x36a8('0xd')];return adAuthenticate(config['activedirectory'],_0x4fb222,_0x360429);})['then'](function(_0x208427){if(_0x5d9a08[_0x36a8('0x1d')]){throw new Error(_0x36a8('0x14'));}if(_0x7e5b8b['blockDuration']>0x0){if(_0x5d9a08[_0x36a8('0x21')]){if(moment(_0x5d9a08[_0x36a8('0x1e')])[_0x36a8('0x22')](_0x7e5b8b[_0x36a8('0x18')],_0x36a8('0x23'))>moment()){throw new Error(_0x36a8('0x14'));}return utils['clearBlockUser'](_0x5d9a08,0x0,![],null)[_0x36a8('0x19')](function(){return utils[_0x36a8('0x24')](_0x5d9a08);})[_0x36a8('0x19')](function(){return _0x4540c4(null,_0x5d9a08);});}else{return utils[_0x36a8('0x24')](_0x5d9a08)['then'](function(){return _0x4540c4(null,_0x5d9a08);});}}else{return utils[_0x36a8('0x24')](_0x5d9a08)['then'](function(){return _0x4540c4(null,_0x5d9a08);});}})[_0x36a8('0x25')](function(_0x44d1b3){return _0x4540c4(null,![],_0x44d1b3);});}function handleError(_0x15c6ec,_0x1abe64,_0x2c392e){return _0x15c6ec[_0x36a8('0x26')](_0x1abe64||0x1f4)[_0x36a8('0x27')]({'message':_0x2c392e?_0x2c392e[_0x36a8('0x28')]||_0x2c392e:''});}exports['login']=function(_0x3fad4e,_0xe9e1fe,_0x1af121){passport[_0x36a8('0xe')](_0x36a8('0x29'),function(_0x3daa9a,_0x27b88f,_0x721970){var _0x10e7a7=_0x3daa9a||_0x721970;if(_0x10e7a7){return handleError(_0xe9e1fe,0x191,_0x10e7a7);}if(!_0x27b88f){return handleError(_0xe9e1fe,0x194,{'message':_0x36a8('0x2a')});}else{var _0x1376f1={'payload':{'id':_0x27b88f['id'],'role':_0x27b88f[_0x36a8('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x36a8('0x2b')](_0x1376f1)['then'](function(_0x1bedbd){_0xe9e1fe[_0x36a8('0x2c')]({'id':_0x27b88f['id'],'token':_0x1bedbd,'statusCall':'','isAlreadyLogged':_0x27b88f[_0x36a8('0x1f')]});});}})(_0x3fad4e,_0xe9e1fe,_0x1af121);};passport[_0x36a8('0x2d')](_0x36a8('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x36a8('0x1a')},function(_0x2741cc,_0x42c6c0,_0x58b2f5){return ActiveDirectoryAuthenticate(db[_0x36a8('0x2e')],_0x2741cc,_0x42c6c0,_0x58b2f5);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 5e88e24..cb1f823 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 _0x2e52=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x15f9f8,_0x5d4f86){var _0x49fb6d=function(_0x5e8eb8){while(--_0x5e8eb8){_0x15f9f8['push'](_0x15f9f8['shift']());}};_0x49fb6d(++_0x5d4f86);}(_0x2e52,0x12f));var _0x22e5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2e52[_0x45d3f0];return _0x314b79;};'use strict';var express=require(_0x22e5('0x0'));var router=express[_0x22e5('0x1')]();var controller=require(_0x22e5('0x2'));router[_0x22e5('0x3')]('/',controller[_0x22e5('0x4')]);module[_0x22e5('0x5')]=router; \ No newline at end of file +var _0xd039=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x519b26,_0x1fa5fc){var _0x3b0a64=function(_0x17d0cc){while(--_0x17d0cc){_0x519b26['push'](_0x519b26['shift']());}};_0x3b0a64(++_0x1fa5fc);}(_0xd039,0xa0));var _0x9d03=function(_0x216eb4,_0x10a33d){_0x216eb4=_0x216eb4-0x0;var _0x2b640f=_0xd039[_0x216eb4];return _0x2b640f;};'use strict';var express=require('express');var router=express[_0x9d03('0x0')]();var controller=require(_0x9d03('0x1'));router[_0x9d03('0x2')]('/',controller[_0x9d03('0x3')]);module[_0x9d03('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index f38ab3d..6100b48 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(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8f73,_0x1a821a){_0x5a8f73=_0x5a8f73-0x0;var _0x1d4f23=_0x7a54[_0x5a8f73];return _0x1d4f23;};'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(_0x201244,_0x164b93){var _0x3a5598=function(_0x418039){while(--_0x418039){_0x201244['push'](_0x201244['shift']());}};_0x3a5598(++_0x164b93);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 b99c69e..214288c 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 _0x196e=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x8c19a7,_0x5fb122){var _0x1e70cc=function(_0x4d099b){while(--_0x4d099b){_0x8c19a7['push'](_0x8c19a7['shift']());}};_0x1e70cc(++_0x5fb122);}(_0x196e,0xcc));var _0xe196=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0x196e[_0x4c2dfc];return _0xfd728d;};'use strict';var express=require(_0xe196('0x0'));var passport=require(_0xe196('0x1'));var router=express[_0xe196('0x2')]();var controller=require(_0xe196('0x3'));var userController=require(_0xe196('0x4'));var authService=require(_0xe196('0x5'));router['get']('/',controller[_0xe196('0x6')]);router[_0xe196('0x7')](_0xe196('0x8'),controller[_0xe196('0x9')],authService[_0xe196('0xa')],userController[_0xe196('0x6')],authService[_0xe196('0xb')]);module[_0xe196('0xc')]=router; \ No newline at end of file +var _0x2dd6=['passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','login','exports','express'];(function(_0x5aba6b,_0x52d766){var _0x31b028=function(_0x18e54f){while(--_0x18e54f){_0x5aba6b['push'](_0x5aba6b['shift']());}};_0x31b028(++_0x52d766);}(_0x2dd6,0x8f));var _0x62dd=function(_0x41f1ac,_0x48eb21){_0x41f1ac=_0x41f1ac-0x0;var _0x1b2cdf=_0x2dd6[_0x41f1ac];return _0x1b2cdf;};'use strict';var express=require(_0x62dd('0x0'));var passport=require(_0x62dd('0x1'));var router=express[_0x62dd('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x62dd('0x3'));var authService=require(_0x62dd('0x4'));router[_0x62dd('0x5')]('/',controller['login']);router[_0x62dd('0x5')](_0x62dd('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x62dd('0x7')],authService['setTokenCookie']);module[_0x62dd('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index cb43756..27a4f70 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 _0xa1b6=['blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','format','error','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked'];(function(_0x4f091d,_0x5ab76d){var _0x254ce6=function(_0x408597){while(--_0x408597){_0x4f091d['push'](_0x4f091d['shift']());}};_0x254ce6(++_0x5ab76d);}(_0xa1b6,0x137));var _0x6a1b=function(_0xbd65ad,_0x13272c){_0xbd65ad=_0xbd65ad-0x0;var _0x2d6957=_0xa1b6[_0xbd65ad];return _0x2d6957;};'use strict';var util=require(_0x6a1b('0x0'));var passport=require(_0x6a1b('0x1'));var LocalStrategy=require(_0x6a1b('0x2'))[_0x6a1b('0x3')];var jayson=require(_0x6a1b('0x4'));var _=require('lodash');var rs=require(_0x6a1b('0x5'));var moment=require('moment');var db=require(_0x6a1b('0x6'))['db'];var authService=require(_0x6a1b('0x7'));var utils=require(_0x6a1b('0x8'));var client=jayson[_0x6a1b('0x9')][_0x6a1b('0xa')]({'port':0x232b});function localAuthenticate(_0x5bcb0e,_0x35ef30,_0x423070,_0x5dc1d2){var _0x509922,_0x523e18;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0xcf2bbc){_0x509922=_0xcf2bbc;return _0x5bcb0e[_0x6a1b('0xc')]({'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x10'),_0x6a1b('0x11'),_0x6a1b('0x12'),_0x6a1b('0x13'),_0x6a1b('0x14'),_0x6a1b('0x15'),_0x6a1b('0x16')],'where':{'name':_0x35ef30,'role':{'$or':['admin',_0x6a1b('0x17'),_0x6a1b('0x18')]}}});})[_0x6a1b('0xe')](function(_0x5353d4){if(!_0x5353d4||_0x5353d4&&_0x5353d4[_0x6a1b('0xf')]!==_0x35ef30){throw new Error(_0x6a1b('0x19'));}else{_0x523e18=_0x5353d4;return _0x523e18;}})[_0x6a1b('0xe')](function(){_0x523e18[_0x6a1b('0x1a')](_0x423070,function(_0x2569c5,_0x411272){var _0xcf7a3b=_0x523e18['loginAttempts']+0x1;if(_0x2569c5){return _0x5dc1d2(_0x2569c5);}else if(!_0x411272){if(_0x523e18[_0x6a1b('0x13')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18[_0x6a1b('0x14')]){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922[_0x6a1b('0x1b')],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0xcf7a3b>=_0x509922[_0x6a1b('0xd')]){return utils[_0x6a1b('0x1e')](_0x523e18,0x0,!![],moment())[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}else{return utils[_0x6a1b('0x1e')](_0x523e18,_0xcf7a3b,![],null)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});});}}}else{return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}}else{if(_0x523e18['disabled']){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else if(_0x509922[_0x6a1b('0xd')]>0x0){if(_0x523e18['blocked']){if(_0x509922[_0x6a1b('0x1b')]>0x0){if(moment(_0x523e18[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x509922['blockDuration'],_0x6a1b('0x1d'))>moment()){return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)[_0x6a1b('0xe')](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}else{return _0x5dc1d2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x523e18,0x0,![],null)['then'](function(){return utils[_0x6a1b('0x1f')](_0x523e18);})[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);})[_0x6a1b('0x20')](function(_0x40e151){return _0x5dc1d2(null,![],_0x40e151);});}}else{if(_0x523e18[_0x6a1b('0x14')]){return _0x5dc1d2(null,![],{'message':_0x6a1b('0x19')});}else{return utils[_0x6a1b('0x1f')](_0x523e18)[_0x6a1b('0xe')](function(){return _0x5dc1d2(null,_0x523e18);});}}}});})['catch'](function(_0xc66b12){return _0x5dc1d2(null,![],_0xc66b12);});}function sendServiceMail(_0x4dbc84){return db[_0x6a1b('0x21')][_0x6a1b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x6a1b('0xf'),_0x6a1b('0x23')],'include':[{'model':db[_0x6a1b('0x24')],'as':_0x6a1b('0x25'),'include':[{'model':db[_0x6a1b('0x26')],'as':_0x6a1b('0x26')}]}]})[_0x6a1b('0xe')](function(_0x3b11e0){if(!_0x3b11e0){throw new Error(_0x6a1b('0x27'));}var _0x25fa63=_0x3b11e0[_0x6a1b('0x28')]();var _0x5490ce={'account':_0x25fa63,'message':_[_0x6a1b('0x29')]({'from':util['format'](_0x6a1b('0x2a'),_0x3b11e0[_0x6a1b('0xf')],_0x3b11e0[_0x6a1b('0x23')]||_0x3b11e0[_0x6a1b('0x25')][_0x6a1b('0x17')])},_0x4dbc84)};return client[_0x6a1b('0x2b')](_0x6a1b('0x2c'),_0x5490ce);})[_0x6a1b('0xe')](function(_0x750f86){if(_0x750f86['error']){throw new Error(util[_0x6a1b('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x750f86[_0x6a1b('0x2e')]['message']||JSON[_0x6a1b('0x2f')](_0x750f86[_0x6a1b('0x2e')])));}return!![];});}function handleError(_0x3e27a4,_0x24865d,_0x20b4ea){return _0x3e27a4['status'](_0x24865d||0x1f4)[_0x6a1b('0x30')]({'message':_0x20b4ea?_0x20b4ea['message']||_0x20b4ea:''});}exports[_0x6a1b('0x31')]=function(_0x150d08,_0xbb992b,_0x53b90b){passport[_0x6a1b('0x1a')]('local-login',function(_0xc85a4c,_0x44bf08,_0x2f857e){var _0x4ecf6b=_0xc85a4c||_0x2f857e;if(_0x4ecf6b){return handleError(_0xbb992b,0x191,_0x4ecf6b);}if(!_0x44bf08){return handleError(_0xbb992b,0x194,{'message':_0x6a1b('0x32')});}else{var _0x196b45={'payload':{'id':_0x44bf08['id'],'role':_0x44bf08[_0x6a1b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x6a1b('0x33')](_0x196b45)['then'](function(_0x38e970){_0xbb992b[_0x6a1b('0x34')]({'id':_0x44bf08['id'],'token':_0x38e970,'statusCall':'','isAlreadyLogged':_0x44bf08['online']});});}})(_0x150d08,_0xbb992b,_0x53b90b);};exports['forgot']=function(_0x338342,_0x3ca645){if(!_0x338342[_0x6a1b('0x35')]['email']){return handleError(_0x3ca645,0x1f4,{'message':_0x6a1b('0x36')});}var _0x4f25b0=rs[_0x6a1b('0x37')]();_0x338342[_0x6a1b('0x35')]['email']=_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')][_0x6a1b('0x38')]()['toLowerCase']();var _0x245dc6;return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'where':{'id':0x1},'attributes':[_0x6a1b('0xd'),'blockDuration'],'raw':!![]})[_0x6a1b('0xe')](function(_0x58d982){_0x245dc6=_0x58d982;return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'email':_0x338342[_0x6a1b('0x35')][_0x6a1b('0x23')]}});})[_0x6a1b('0xe')](function(_0x2238c6){if(!_0x2238c6){throw new Error(_0x6a1b('0x3a'));}if(_0x2238c6[_0x6a1b('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2238c6[_0x6a1b('0x14')]){if(moment(_0x2238c6[_0x6a1b('0x15')])[_0x6a1b('0x1c')](_0x245dc6[_0x6a1b('0x1b')],'minutes')>moment()){throw new Error(_0x6a1b('0x3b'));}else{_0x2238c6[_0x6a1b('0x14')]=![];_0x2238c6[_0x6a1b('0x15')]=null;}}_0x2238c6[_0x6a1b('0x3c')]=_0x4f25b0;_0x2238c6['resetPasswordExpires']=Date[_0x6a1b('0x3d')]()+0x36ee80;return _0x2238c6[_0x6a1b('0x3e')]();})[_0x6a1b('0xe')](function(){return sendServiceMail({'to':_0x338342['body'][_0x6a1b('0x23')],'subject':_0x6a1b('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6a1b('0x40')+_0x6a1b('0x41')+_0x338342[_0x6a1b('0x42')][_0x6a1b('0x43')]+_0x6a1b('0x44')+_0x4f25b0+'\x0a\x0a'+_0x6a1b('0x45')});})[_0x6a1b('0xe')](function(){_0x3ca645[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x47')});})[_0x6a1b('0x20')](function(_0x2dddff){return handleError(_0x3ca645,0x1f4,_0x2dddff);});};exports[_0x6a1b('0x48')]=function(_0x371f31,_0x290a4f){return db[_0x6a1b('0x39')][_0x6a1b('0x22')]({'where':{'resetPasswordToken':_0x371f31[_0x6a1b('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x6a1b('0x3d')]()}}})[_0x6a1b('0xe')](function(_0x7cfad3){if(!_0x7cfad3){throw new Error(_0x6a1b('0x4a'));}return db[_0x6a1b('0xb')][_0x6a1b('0xc')]({'attributes':['id','securePassword',_0x6a1b('0x4b'),_0x6a1b('0x4c')]})[_0x6a1b('0xe')](function(_0x285c9c){if(_0x285c9c['securePassword'])authService['validatePasswordPattern'](_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')]);if(!_0x285c9c[_0x6a1b('0x4b')]||!_0x7cfad3[_0x6a1b('0x4d')])return _0x7cfad3;authService[_0x6a1b('0x4e')](_0x371f31['body'][_0x6a1b('0x10')],_0x7cfad3[_0x6a1b('0x4d')],_0x285c9c[_0x6a1b('0x4c')]);return _0x7cfad3;})['then'](function(){_0x7cfad3[_0x6a1b('0x10')]=_0x371f31[_0x6a1b('0x35')][_0x6a1b('0x10')];_0x7cfad3['resetPasswordToken']=null;_0x7cfad3[_0x6a1b('0x4f')]=null;return _0x7cfad3[_0x6a1b('0x3e')]();});})['then'](function(){_0x290a4f[_0x6a1b('0x46')](0xc8)[_0x6a1b('0x30')]({'message':_0x6a1b('0x50')});})['catch'](function(_0x311005){return handleError(_0x290a4f,0x1f4,_0x311005);});};passport[_0x6a1b('0x51')](_0x6a1b('0x52'),new LocalStrategy({'usernameField':_0x6a1b('0xf'),'passwordField':_0x6a1b('0x10')},function(_0x40fbf9,_0x14a211,_0x24772b){return localAuthenticate(db[_0x6a1b('0x39')],_0x40fbf9,_0x14a211,_0x24772b);})); \ No newline at end of file +var _0xd469=['request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','User','body','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockDuration','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>'];(function(_0x2d81ec,_0x255b3e){var _0x147094=function(_0x5c8316){while(--_0x5c8316){_0x2d81ec['push'](_0x2d81ec['shift']());}};_0x147094(++_0x255b3e);}(_0xd469,0x169));var _0x9d46=function(_0x5b5429,_0x4167b1){_0x5b5429=_0x5b5429-0x0;var _0x158dee=_0xd469[_0x5b5429];return _0x158dee;};'use strict';var util=require(_0x9d46('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9d46('0x1'))[_0x9d46('0x2')];var jayson=require(_0x9d46('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x9d46('0x4'))['db'];var authService=require(_0x9d46('0x5'));var utils=require(_0x9d46('0x6'));var client=jayson[_0x9d46('0x7')][_0x9d46('0x8')]({'port':0x232b});function localAuthenticate(_0x2ba4d4,_0x16ad0b,_0x1bf270,_0xfb9372){var _0x833e67,_0x1a09f8;return db[_0x9d46('0x9')][_0x9d46('0xa')]({'where':{'id':0x1},'attributes':[_0x9d46('0xb'),'blockDuration'],'raw':!![]})[_0x9d46('0xc')](function(_0xcf01ad){_0x833e67=_0xcf01ad;return _0x2ba4d4['findOne']({'attributes':['id',_0x9d46('0xd'),_0x9d46('0xe'),_0x9d46('0xf'),_0x9d46('0x10'),_0x9d46('0x11'),_0x9d46('0x12'),_0x9d46('0x13'),'loginAttempts'],'where':{'name':_0x16ad0b,'role':{'$or':[_0x9d46('0x14'),'user',_0x9d46('0x15')]}}});})[_0x9d46('0xc')](function(_0x9069a7){if(!_0x9069a7||_0x9069a7&&_0x9069a7[_0x9d46('0xd')]!==_0x16ad0b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a09f8=_0x9069a7;return _0x1a09f8;}})[_0x9d46('0xc')](function(){_0x1a09f8[_0x9d46('0x16')](_0x1bf270,function(_0x1dd011,_0x5145a2){var _0x3d5673=_0x1a09f8[_0x9d46('0x17')]+0x1;if(_0x1dd011){return _0xfb9372(_0x1dd011);}else if(!_0x5145a2){if(_0x1a09f8[_0x9d46('0x11')]){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else if(_0x833e67[_0x9d46('0xb')]>0x0){if(_0x1a09f8[_0x9d46('0x12')]){if(_0x833e67['blockDuration']>0x0){if(moment(_0x1a09f8[_0x9d46('0x13')])[_0x9d46('0x19')](_0x833e67['blockDuration'],_0x9d46('0x1a'))>moment()){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else{return utils['clearBlockUser'](_0x1a09f8,_0x3d5673,![],null)[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});});}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{if(_0x3d5673>=_0x833e67[_0x9d46('0xb')]){return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,!![],moment())[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});});}else{return utils[_0x9d46('0x1b')](_0x1a09f8,_0x3d5673,![],null)[_0x9d46('0xc')](function(){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{if(_0x1a09f8['disabled']){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x833e67[_0x9d46('0xb')]>0x0){if(_0x1a09f8['blocked']){if(_0x833e67[_0x9d46('0x1c')]>0x0){if(moment(_0x1a09f8[_0x9d46('0x13')])['add'](_0x833e67['blockDuration'],_0x9d46('0x1a'))>moment()){return _0xfb9372(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,![],null)['then'](function(){return utils[_0x9d46('0x1d')](_0x1a09f8);})[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);});}}else{return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}}else{return utils[_0x9d46('0x1b')](_0x1a09f8,0x0,![],null)[_0x9d46('0xc')](function(){return utils['getLicense'](_0x1a09f8);})[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);})[_0x9d46('0x1e')](function(_0x257938){return _0xfb9372(null,![],_0x257938);});}}else{if(_0x1a09f8[_0x9d46('0x12')]){return _0xfb9372(null,![],{'message':_0x9d46('0x18')});}else{return utils['getLicense'](_0x1a09f8)[_0x9d46('0xc')](function(){return _0xfb9372(null,_0x1a09f8);});}}}});})[_0x9d46('0x1e')](function(_0x156d58){return _0xfb9372(null,![],_0x156d58);});}function sendServiceMail(_0x29f6df){return db[_0x9d46('0x1f')][_0x9d46('0x20')]({'where':{'service':!![]},'attributes':['id',_0x9d46('0xd'),_0x9d46('0x21')],'include':[{'model':db[_0x9d46('0x22')],'as':_0x9d46('0x23'),'include':[{'model':db[_0x9d46('0x24')],'as':_0x9d46('0x24')}]}]})['then'](function(_0x4a8e96){if(!_0x4a8e96){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4c368e=_0x4a8e96[_0x9d46('0x25')]();var _0x3859a2={'account':_0x4c368e,'message':_['merge']({'from':util['format'](_0x9d46('0x26'),_0x4a8e96[_0x9d46('0xd')],_0x4a8e96[_0x9d46('0x21')]||_0x4a8e96[_0x9d46('0x23')]['user'])},_0x29f6df)};return client[_0x9d46('0x27')](_0x9d46('0x28'),_0x3859a2);})[_0x9d46('0xc')](function(_0x231ead){if(_0x231ead[_0x9d46('0x29')]){throw new Error(util[_0x9d46('0x2a')](_0x9d46('0x2b'),_0x231ead['error'][_0x9d46('0x2c')]||JSON[_0x9d46('0x2d')](_0x231ead['error'])));}return!![];});}function handleError(_0x2cd341,_0x225e64,_0x59614e){return _0x2cd341[_0x9d46('0x2e')](_0x225e64||0x1f4)[_0x9d46('0x2f')]({'message':_0x59614e?_0x59614e[_0x9d46('0x2c')]||_0x59614e:''});}exports['login']=function(_0x1462ed,_0x5b3202,_0x21474b){passport[_0x9d46('0x16')](_0x9d46('0x30'),function(_0x47e90b,_0x5e3bbb,_0x59975e){var _0x1cf6d9=_0x47e90b||_0x59975e;if(_0x1cf6d9){return handleError(_0x5b3202,0x191,_0x1cf6d9);}if(!_0x5e3bbb){return handleError(_0x5b3202,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3ccb62={'payload':{'id':_0x5e3bbb['id'],'role':_0x5e3bbb[_0x9d46('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x9d46('0x31')](_0x3ccb62)[_0x9d46('0xc')](function(_0x3ce15a){_0x5b3202[_0x9d46('0x32')]({'id':_0x5e3bbb['id'],'token':_0x3ce15a,'statusCall':'','isAlreadyLogged':_0x5e3bbb[_0x9d46('0x33')]});});}})(_0x1462ed,_0x5b3202,_0x21474b);};exports[_0x9d46('0x34')]=function(_0x4251a1,_0x311a48){if(!_0x4251a1['body'][_0x9d46('0x21')]){return handleError(_0x311a48,0x1f4,{'message':_0x9d46('0x35')});}var _0x2e9c7a=rs['generate']();_0x4251a1['body'][_0x9d46('0x21')]=_0x4251a1['body']['email'][_0x9d46('0x36')]()['toLowerCase']();var _0x3c6039;return db[_0x9d46('0x9')][_0x9d46('0xa')]({'where':{'id':0x1},'attributes':[_0x9d46('0xb'),'blockDuration'],'raw':!![]})[_0x9d46('0xc')](function(_0x16d652){_0x3c6039=_0x16d652;return db[_0x9d46('0x37')][_0x9d46('0x20')]({'where':{'email':_0x4251a1[_0x9d46('0x38')][_0x9d46('0x21')]}});})['then'](function(_0x3e25c8){if(!_0x3e25c8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3e25c8[_0x9d46('0x11')]){throw new Error(_0x9d46('0x39'));}if(_0x3e25c8[_0x9d46('0x12')]){if(moment(_0x3e25c8[_0x9d46('0x13')])['add'](_0x3c6039['blockDuration'],'minutes')>moment()){throw new Error(_0x9d46('0x3a'));}else{_0x3e25c8[_0x9d46('0x12')]=![];_0x3e25c8[_0x9d46('0x13')]=null;}}_0x3e25c8[_0x9d46('0x3b')]=_0x2e9c7a;_0x3e25c8[_0x9d46('0x3c')]=Date[_0x9d46('0x3d')]()+0x36ee80;return _0x3e25c8['save']();})['then'](function(){return sendServiceMail({'to':_0x4251a1[_0x9d46('0x38')][_0x9d46('0x21')],'subject':_0x9d46('0x3e'),'text':_0x9d46('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9d46('0x40')+_0x4251a1['headers'][_0x9d46('0x41')]+_0x9d46('0x42')+_0x2e9c7a+'\x0a\x0a'+_0x9d46('0x43')});})['then'](function(){_0x311a48[_0x9d46('0x2e')](0xc8)[_0x9d46('0x2f')]({'message':_0x9d46('0x44')});})[_0x9d46('0x1e')](function(_0x11a178){return handleError(_0x311a48,0x1f4,_0x11a178);});};exports[_0x9d46('0x45')]=function(_0xa35d10,_0xae88cb){return db[_0x9d46('0x37')][_0x9d46('0x20')]({'where':{'resetPasswordToken':_0xa35d10[_0x9d46('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x9d46('0x3d')]()}}})[_0x9d46('0xc')](function(_0x1a364f){if(!_0x1a364f){throw new Error(_0x9d46('0x47'));}return db[_0x9d46('0x9')][_0x9d46('0xa')]({'attributes':['id','securePassword',_0x9d46('0x48'),_0x9d46('0x49')]})['then'](function(_0x41f630){if(_0x41f630[_0x9d46('0x4a')])authService[_0x9d46('0x4b')](_0xa35d10['body']['password']);if(!_0x41f630['enforcePasswordHistory']||!_0x1a364f['previousPasswords'])return _0x1a364f;authService[_0x9d46('0x4c')](_0xa35d10[_0x9d46('0x38')]['password'],_0x1a364f[_0x9d46('0x4d')],_0x41f630[_0x9d46('0x49')]);return _0x1a364f;})[_0x9d46('0xc')](function(){_0x1a364f[_0x9d46('0xe')]=_0xa35d10[_0x9d46('0x38')][_0x9d46('0xe')];_0x1a364f[_0x9d46('0x3b')]=null;_0x1a364f[_0x9d46('0x3c')]=null;return _0x1a364f['save']();});})[_0x9d46('0xc')](function(){_0xae88cb[_0x9d46('0x2e')](0xc8)['send']({'message':_0x9d46('0x4e')});})[_0x9d46('0x1e')](function(_0x13df30){return handleError(_0xae88cb,0x1f4,_0x13df30);});};passport[_0x9d46('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2210b8,_0x27eea3,_0x2ce12a){return localAuthenticate(db['User'],_0x2210b8,_0x27eea3,_0x2ce12a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a3b8c02..08bf813 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 _0xd0a3=['reset','exports','express','./authLocal.controller','login','post','/forgot','forgot','/reset/:token'];(function(_0x40640c,_0x3b92e9){var _0x27c8cc=function(_0x5e9c32){while(--_0x5e9c32){_0x40640c['push'](_0x40640c['shift']());}};_0x27c8cc(++_0x3b92e9);}(_0xd0a3,0x80));var _0x3d0a=function(_0xb01ded,_0x57ef66){_0xb01ded=_0xb01ded-0x0;var _0x541634=_0xd0a3[_0xb01ded];return _0x541634;};'use strict';var express=require(_0x3d0a('0x0'));var router=express['Router']();var controller=require(_0x3d0a('0x1'));router['post']('/',controller[_0x3d0a('0x2')]);router[_0x3d0a('0x3')](_0x3d0a('0x4'),controller[_0x3d0a('0x5')]);router[_0x3d0a('0x3')](_0x3d0a('0x6'),controller[_0x3d0a('0x7')]);module[_0x3d0a('0x8')]=router; \ No newline at end of file +var _0x728e=['post','forgot','/reset/:token','reset','exports','Router'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x728e,0xef));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xe728('0x0')]();var controller=require('./authLocal.controller');router[_0xe728('0x1')]('/',controller['login']);router[_0xe728('0x1')]('/forgot',controller[_0xe728('0x2')]);router[_0xe728('0x1')](_0xe728('0x3'),controller[_0xe728('0x4')]);module[_0xe728('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 77d6580..1c609cd 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 _0xff82=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xff82,0x13c));var _0x2ff8=function(_0x8d57ff,_0x262930){_0x8d57ff=_0x8d57ff-0x0;var _0x3d42c7=_0xff82[_0x8d57ff];return _0x3d42c7;};'use strict';var Sequelize=require(_0x2ff8('0x0'));module[_0x2ff8('0x1')]={'name':{'type':Sequelize[_0x2ff8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2ff8('0x2')]},'description':{'type':Sequelize[_0x2ff8('0x2')]},'status':{'type':Sequelize[_0x2ff8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2ff8('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3013=['sequelize','STRING','BOOLEAN'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x3013,0xc0));var _0x3301=function(_0x427165,_0x56a160){_0x427165=_0x427165-0x0;var _0xe1fb08=_0x3013[_0x427165];return _0xe1fb08;};'use strict';var Sequelize=require(_0x3301('0x0'));module['exports']={'name':{'type':Sequelize[_0x3301('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3301('0x1')]},'description':{'type':Sequelize[_0x3301('0x1')]},'status':{'type':Sequelize[_0x3301('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 85d2ba6..9e29174 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 _0x7284=['map','Automation','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','options','find','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x44f0fd,_0x363ca8){var _0x5e28de=function(_0x218086){while(--_0x218086){_0x44f0fd['push'](_0x44f0fd['shift']());}};_0x5e28de(++_0x363ca8);}(_0x7284,0x1c7));var _0x4728=function(_0x375a24,_0x1c1fb6){_0x375a24=_0x375a24-0x0;var _0x38d80e=_0x7284[_0x375a24];return _0x38d80e;};'use strict';var emlformat=require(_0x4728('0x0'));var rimraf=require(_0x4728('0x1'));var zipdir=require(_0x4728('0x2'));var jsonpatch=require(_0x4728('0x3'));var rp=require(_0x4728('0x4'));var moment=require(_0x4728('0x5'));var BPromise=require(_0x4728('0x6'));var Mustache=require('mustache');var util=require(_0x4728('0x7'));var path=require(_0x4728('0x8'));var sox=require('sox');var csv=require(_0x4728('0x9'));var ejs=require(_0x4728('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4728('0xb'));var crypto=require('crypto');var jsforce=require(_0x4728('0xc'));var deskjs=require(_0x4728('0xd'));var toCsv=require(_0x4728('0x9'));var querystring=require(_0x4728('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4728('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4728('0x10'));var hardwareService=require(_0x4728('0x11'));var logger=require('../../config/logger')(_0x4728('0x12'));var utils=require(_0x4728('0x13'));var config=require(_0x4728('0x14'));var licenseUtil=require(_0x4728('0x15'));var db=require(_0x4728('0x16'))['db'];function respondWithStatusCode(_0x6d6442,_0x49ce5b){_0x49ce5b=_0x49ce5b||0xcc;return function(_0x307afe){if(_0x307afe){return _0x6d6442['sendStatus'](_0x49ce5b);}return _0x6d6442[_0x4728('0x17')](_0x49ce5b)[_0x4728('0x18')]();};}function respondWithResult(_0x2a5269,_0x3f1ba7){_0x3f1ba7=_0x3f1ba7||0xc8;return function(_0x276b4f){if(_0x276b4f){return _0x2a5269[_0x4728('0x17')](_0x3f1ba7)[_0x4728('0x19')](_0x276b4f);}};}function respondWithFilteredResult(_0x15b9f2,_0x37ddfb){return function(_0xdbb6fd){if(_0xdbb6fd){var _0x3ff388=typeof _0x37ddfb[_0x4728('0x1a')]==='undefined'&&typeof _0x37ddfb[_0x4728('0x1b')]===_0x4728('0x1c');var _0x5b50b6=_0xdbb6fd['count'];var _0x54c200=_0x3ff388?0x0:_0x37ddfb['offset'];var _0x2f63a2=_0x3ff388?_0xdbb6fd['count']:_0x37ddfb[_0x4728('0x1a')]+_0x37ddfb[_0x4728('0x1b')];var _0x53546d;if(_0x2f63a2>=_0x5b50b6){_0x2f63a2=_0x5b50b6;_0x53546d=0xc8;}else{_0x53546d=0xce;}_0x15b9f2[_0x4728('0x17')](_0x53546d);return _0x15b9f2[_0x4728('0x1d')](_0x4728('0x1e'),_0x54c200+'-'+_0x2f63a2+'/'+_0x5b50b6)[_0x4728('0x19')](_0xdbb6fd);}return null;};}function patchUpdates(_0x287280){return function(_0x31c1f6){try{jsonpatch[_0x4728('0x1f')](_0x31c1f6,_0x287280,!![]);}catch(_0x586a11){return BPromise[_0x4728('0x20')](_0x586a11);}return _0x31c1f6[_0x4728('0x21')]();};}function saveUpdates(_0xd65cc9,_0x4cfa15){return function(_0x973e14){if(_0x973e14){return _0x973e14[_0x4728('0x22')](_0xd65cc9)[_0x4728('0x23')](function(_0x434a9e){return _0x434a9e;});}return null;};}function removeEntity(_0x1e865b,_0x1d8bd6){return function(_0x24d995){if(_0x24d995){return _0x24d995[_0x4728('0x24')]()[_0x4728('0x23')](function(){_0x1e865b[_0x4728('0x17')](0xcc)[_0x4728('0x18')]();});}};}function handleEntityNotFound(_0x57b6df,_0x85ebd8){return function(_0x55a248){if(!_0x55a248){_0x57b6df[_0x4728('0x25')](0x194);}return _0x55a248;};}function handleError(_0x42936a,_0x3a3c76){_0x3a3c76=_0x3a3c76||0x1f4;return function(_0x3e679c){logger[_0x4728('0x26')](_0x3e679c[_0x4728('0x27')]);if(_0x3e679c[_0x4728('0x28')]){delete _0x3e679c[_0x4728('0x28')];}_0x42936a[_0x4728('0x17')](_0x3a3c76)[_0x4728('0x29')](_0x3e679c);};}exports[_0x4728('0x2a')]=function(_0x4d90eb,_0x29eafc){var _0x57d7b8={},_0x11c4da={},_0x49bde5={'count':0x0,'rows':[]};var _0x433d4e=_[_0x4728('0x2b')](db[_0x4728('0x2c')][_0x4728('0x2d')],function(_0x4684f6){return{'name':_0x4684f6['fieldName'],'type':_0x4684f6[_0x4728('0x2e')][_0x4728('0x2f')]};});_0x11c4da['model']=_[_0x4728('0x2b')](_0x433d4e,_0x4728('0x28'));_0x11c4da[_0x4728('0x30')]=_[_0x4728('0x31')](_0x4d90eb['query']);_0x11c4da[_0x4728('0x32')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],_0x11c4da['query']);_0x57d7b8[_0x4728('0x35')]=_[_0x4728('0x33')](_0x11c4da[_0x4728('0x34')],qs['fields'](_0x4d90eb['query'][_0x4728('0x36')]));_0x57d7b8[_0x4728('0x35')]=_0x57d7b8['attributes'][_0x4728('0x37')]?_0x57d7b8[_0x4728('0x35')]:_0x11c4da['model'];if(!_0x4d90eb['query'][_0x4728('0x38')](_0x4728('0x39'))){_0x57d7b8[_0x4728('0x1b')]=qs['limit'](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1b')]);_0x57d7b8[_0x4728('0x1a')]=qs[_0x4728('0x1a')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x1a')]);}_0x57d7b8[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x4d90eb[_0x4728('0x30')][_0x4728('0x3b')]);_0x57d7b8[_0x4728('0x3c')]=qs['filters'](_['pick'](_0x4d90eb['query'],_0x11c4da[_0x4728('0x32')]),_0x433d4e);if(_0x4d90eb[_0x4728('0x30')][_0x4728('0x3d')]){_0x57d7b8['where']=_[_0x4728('0x3e')](_0x57d7b8['where'],{'$or':_[_0x4728('0x2b')](_0x433d4e,function(_0x44ecc9){if(_0x44ecc9[_0x4728('0x2e')]!==_0x4728('0x3f')){var _0x284857={};_0x284857[_0x44ecc9['name']]={'$like':'%'+_0x4d90eb['query'][_0x4728('0x3d')]+'%'};return _0x284857;}})});}_0x57d7b8=_[_0x4728('0x3e')]({},_0x57d7b8,_0x4d90eb['options']);var _0xa549c9={'where':_0x57d7b8[_0x4728('0x3c')]};return db['Automation']['count'](_0xa549c9)[_0x4728('0x23')](function(_0x218a07){_0x49bde5['count']=_0x218a07;if(_0x4d90eb[_0x4728('0x30')]['includeAll']){_0x57d7b8[_0x4728('0x40')]=[{'all':!![]}];}return db[_0x4728('0x2c')][_0x4728('0x41')](_0x57d7b8);})[_0x4728('0x23')](function(_0x1dbe45){_0x49bde5[_0x4728('0x42')]=_0x1dbe45;return _0x49bde5;})[_0x4728('0x23')](respondWithFilteredResult(_0x29eafc,_0x57d7b8))[_0x4728('0x43')](handleError(_0x29eafc,null));};exports[_0x4728('0x44')]=function(_0x26874c,_0x5c030d){var _0x2ee9ca={'raw':![],'where':{'id':_0x26874c['params']['id']}},_0x16820e={};_0x16820e[_0x4728('0x34')]=_[_0x4728('0x31')](db[_0x4728('0x2c')][_0x4728('0x2d')]);_0x16820e['query']=_['keys'](_0x26874c[_0x4728('0x30')]);_0x16820e[_0x4728('0x32')]=_[_0x4728('0x33')](_0x16820e[_0x4728('0x34')],_0x16820e[_0x4728('0x30')]);_0x2ee9ca['attributes']=_[_0x4728('0x33')](_0x16820e['model'],qs[_0x4728('0x36')](_0x26874c[_0x4728('0x30')][_0x4728('0x36')]));_0x2ee9ca['attributes']=_0x2ee9ca[_0x4728('0x35')][_0x4728('0x37')]?_0x2ee9ca[_0x4728('0x35')]:_0x16820e['model'];if(_0x26874c[_0x4728('0x30')]['includeAll']){_0x2ee9ca['include']=[{'all':!![]}];}_0x2ee9ca=_[_0x4728('0x3e')]({},_0x2ee9ca,_0x26874c[_0x4728('0x45')]);return db[_0x4728('0x2c')][_0x4728('0x46')](_0x2ee9ca)[_0x4728('0x23')](handleEntityNotFound(_0x5c030d,null))['then'](respondWithResult(_0x5c030d,null))[_0x4728('0x43')](handleError(_0x5c030d,null));};exports[_0x4728('0x47')]=function(_0x47b6eb,_0x587881){return db[_0x4728('0x2c')][_0x4728('0x47')](_0x47b6eb[_0x4728('0x48')],{})['then'](respondWithResult(_0x587881,0xc9))[_0x4728('0x43')](handleError(_0x587881,null));};exports[_0x4728('0x22')]=function(_0x3d993a,_0x9858b7){if(_0x3d993a[_0x4728('0x48')]['id']){delete _0x3d993a['body']['id'];}return db[_0x4728('0x2c')][_0x4728('0x46')]({'where':{'id':_0x3d993a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x9858b7,null))[_0x4728('0x23')](saveUpdates(_0x3d993a[_0x4728('0x48')],null))[_0x4728('0x23')](respondWithResult(_0x9858b7,null))['catch'](handleError(_0x9858b7,null));};exports[_0x4728('0x24')]=function(_0x535aff,_0x57dd2b){return db[_0x4728('0x2c')]['find']({'where':{'id':_0x535aff[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x57dd2b,null))[_0x4728('0x23')](removeEntity(_0x57dd2b,null))['catch'](handleError(_0x57dd2b,null));};exports[_0x4728('0x4a')]=function(_0xe87fc9,_0x29ed73,_0x4ecb11){return db['Condition'][_0x4728('0x46')]({'where':{'id':_0xe87fc9[_0x4728('0x49')]['id']}})['then'](handleEntityNotFound(_0x29ed73,null))[_0x4728('0x23')](function(_0xc02e0){if(_0xc02e0){return _0xc02e0[_0x4728('0x4a')](_0xe87fc9[_0x4728('0x48')][_0x4728('0x4b')],_[_0x4728('0x4c')](_0xe87fc9[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x29ed73,null))[_0x4728('0x43')](handleError(_0x29ed73,null));};exports[_0x4728('0x4d')]=function(_0x1e2c0a,_0x2e9209,_0x2c7beb){var _0x300961={};var _0x240f14={};var _0x4b43f5;var _0x1e9724;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0x1e2c0a[_0x4728('0x49')]['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x2e9209,null))['then'](function(_0x873498){if(_0x873498){_0x4b43f5=_0x873498;_0x240f14['model']=_[_0x4728('0x31')](db[_0x4728('0x4f')][_0x4728('0x2d')]);_0x240f14[_0x4728('0x30')]=_[_0x4728('0x31')](_0x1e2c0a[_0x4728('0x30')]);_0x240f14[_0x4728('0x32')]=_['intersection'](_0x240f14[_0x4728('0x34')],_0x240f14[_0x4728('0x30')]);_0x300961[_0x4728('0x35')]=_[_0x4728('0x33')](_0x240f14['model'],qs[_0x4728('0x36')](_0x1e2c0a[_0x4728('0x30')][_0x4728('0x36')]));_0x300961[_0x4728('0x35')]=_0x300961[_0x4728('0x35')][_0x4728('0x37')]?_0x300961[_0x4728('0x35')]:_0x240f14['model'];_0x300961[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0x1e2c0a[_0x4728('0x30')]['sort']);_0x300961['where']=qs[_0x4728('0x32')](_['pick'](_0x1e2c0a[_0x4728('0x30')],_0x240f14[_0x4728('0x32')]));if(_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]){_0x300961[_0x4728('0x3c')]=_['merge'](_0x300961['where'],{'$or':_[_0x4728('0x2b')](_0x300961['attributes'],function(_0x36ebe2){var _0x16f014={};_0x16f014[_0x36ebe2]={'$like':'%'+_0x1e2c0a[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x16f014;})});}_0x300961=_[_0x4728('0x3e')]({},_0x300961,_0x1e2c0a[_0x4728('0x45')]);return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x2a5681){if(_0x2a5681){_0x1e9724=_0x2a5681['length'];if(!_0x1e2c0a[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x300961[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0x1e2c0a['query'][_0x4728('0x1b')]);_0x300961['offset']=qs[_0x4728('0x1a')](_0x1e2c0a['query'][_0x4728('0x1a')]);}return _0x4b43f5['getConditions'](_0x300961);}})[_0x4728('0x23')](function(_0x28f2fc){if(_0x28f2fc){return _0x28f2fc?{'count':_0x1e9724,'rows':_0x28f2fc}:null;}})[_0x4728('0x23')](respondWithResult(_0x2e9209,null))[_0x4728('0x43')](handleError(_0x2e9209,null));};exports['addActions']=function(_0x4c7d6e,_0x452de6,_0x337b4c){return db[_0x4728('0x50')][_0x4728('0x46')]({'where':{'id':_0x4c7d6e['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x452de6,null))[_0x4728('0x23')](function(_0x22a95f){if(_0x22a95f){return _0x22a95f['addActions'](_0x4c7d6e[_0x4728('0x48')][_0x4728('0x4b')],_['omit'](_0x4c7d6e[_0x4728('0x48')],[_0x4728('0x4b'),'id'])||{});}})[_0x4728('0x23')](respondWithResult(_0x452de6,null))[_0x4728('0x43')](handleError(_0x452de6,null));};exports[_0x4728('0x51')]=function(_0xaa29f6,_0x1b5758,_0x376614){var _0x5146d9={};var _0x284cf6={};var _0x47626a;var _0x46c2fb;return db[_0x4728('0x2c')][_0x4728('0x4e')]({'where':{'id':_0xaa29f6['params']['id']}})[_0x4728('0x23')](handleEntityNotFound(_0x1b5758,null))[_0x4728('0x23')](function(_0x5c79c5){if(_0x5c79c5){_0x47626a=_0x5c79c5;_0x284cf6[_0x4728('0x34')]=_['keys'](db['Action'][_0x4728('0x2d')]);_0x284cf6[_0x4728('0x30')]=_[_0x4728('0x31')](_0xaa29f6[_0x4728('0x30')]);_0x284cf6[_0x4728('0x32')]=_[_0x4728('0x33')](_0x284cf6['model'],_0x284cf6['query']);_0x5146d9[_0x4728('0x35')]=_[_0x4728('0x33')](_0x284cf6[_0x4728('0x34')],qs[_0x4728('0x36')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x36')]));_0x5146d9[_0x4728('0x35')]=_0x5146d9[_0x4728('0x35')][_0x4728('0x37')]?_0x5146d9[_0x4728('0x35')]:_0x284cf6[_0x4728('0x34')];_0x5146d9[_0x4728('0x3a')]=qs[_0x4728('0x3b')](_0xaa29f6['query'][_0x4728('0x3b')]);_0x5146d9['where']=qs[_0x4728('0x32')](_[_0x4728('0x52')](_0xaa29f6[_0x4728('0x30')],_0x284cf6['filters']));if(_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]){_0x5146d9[_0x4728('0x3c')]=_['merge'](_0x5146d9[_0x4728('0x3c')],{'$or':_[_0x4728('0x2b')](_0x5146d9[_0x4728('0x35')],function(_0x45d7ef){var _0x35cd28={};_0x35cd28[_0x45d7ef]={'$like':'%'+_0xaa29f6[_0x4728('0x30')][_0x4728('0x3d')]+'%'};return _0x35cd28;})});}_0x5146d9=_[_0x4728('0x3e')]({},_0x5146d9,_0xaa29f6['options']);return _0x47626a[_0x4728('0x51')](_0x5146d9);}})[_0x4728('0x23')](function(_0x283280){if(_0x283280){_0x46c2fb=_0x283280[_0x4728('0x37')];if(!_0xaa29f6[_0x4728('0x30')][_0x4728('0x38')](_0x4728('0x39'))){_0x5146d9[_0x4728('0x1b')]=qs[_0x4728('0x1b')](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1b')]);_0x5146d9['offset']=qs['offset'](_0xaa29f6[_0x4728('0x30')][_0x4728('0x1a')]);}return _0x47626a['getActions'](_0x5146d9);}})['then'](function(_0x21bd1a){if(_0x21bd1a){return _0x21bd1a?{'count':_0x46c2fb,'rows':_0x21bd1a}:null;}})[_0x4728('0x23')](respondWithResult(_0x1b5758,null))[_0x4728('0x43')](handleError(_0x1b5758,null));}; \ No newline at end of file +var _0xccff=['then','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','body','find','params','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xccff,0x12d));var _0xfccf=function(_0x2d9da3,_0x63174d){_0x2d9da3=_0x2d9da3-0x0;var _0x2a8d6a=_0xccff[_0x2d9da3];return _0x2a8d6a;};'use strict';var emlformat=require(_0xfccf('0x0'));var rimraf=require(_0xfccf('0x1'));var zipdir=require(_0xfccf('0x2'));var jsonpatch=require(_0xfccf('0x3'));var rp=require('request-promise');var moment=require(_0xfccf('0x4'));var BPromise=require(_0xfccf('0x5'));var Mustache=require(_0xfccf('0x6'));var util=require(_0xfccf('0x7'));var path=require(_0xfccf('0x8'));var sox=require(_0xfccf('0x9'));var csv=require(_0xfccf('0xa'));var ejs=require(_0xfccf('0xb'));var fs=require('fs');var fs_extra=require(_0xfccf('0xc'));var _=require(_0xfccf('0xd'));var squel=require(_0xfccf('0xe'));var crypto=require('crypto');var jsforce=require(_0xfccf('0xf'));var deskjs=require(_0xfccf('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfccf('0x11'));var Redis=require('ioredis');var authService=require(_0xfccf('0x12'));var qs=require(_0xfccf('0x13'));var as=require(_0xfccf('0x14'));var hardwareService=require(_0xfccf('0x15'));var logger=require(_0xfccf('0x16'))(_0xfccf('0x17'));var utils=require(_0xfccf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfccf('0x19'));var db=require(_0xfccf('0x1a'))['db'];function respondWithStatusCode(_0x4e2e7d,_0x1dfe40){_0x1dfe40=_0x1dfe40||0xcc;return function(_0x4f23aa){if(_0x4f23aa){return _0x4e2e7d[_0xfccf('0x1b')](_0x1dfe40);}return _0x4e2e7d[_0xfccf('0x1c')](_0x1dfe40)[_0xfccf('0x1d')]();};}function respondWithResult(_0x42cb47,_0x2489fd){_0x2489fd=_0x2489fd||0xc8;return function(_0x4a5cfd){if(_0x4a5cfd){return _0x42cb47[_0xfccf('0x1c')](_0x2489fd)[_0xfccf('0x1e')](_0x4a5cfd);}};}function respondWithFilteredResult(_0x58a48a,_0x6b5712){return function(_0x396ed2){if(_0x396ed2){var _0x52a8c4=typeof _0x6b5712[_0xfccf('0x1f')]===_0xfccf('0x20')&&typeof _0x6b5712[_0xfccf('0x21')]===_0xfccf('0x20');var _0x46d117=_0x396ed2[_0xfccf('0x22')];var _0x3c48f7=_0x52a8c4?0x0:_0x6b5712[_0xfccf('0x1f')];var _0x49a045=_0x52a8c4?_0x396ed2[_0xfccf('0x22')]:_0x6b5712[_0xfccf('0x1f')]+_0x6b5712['limit'];var _0x517572;if(_0x49a045>=_0x46d117){_0x49a045=_0x46d117;_0x517572=0xc8;}else{_0x517572=0xce;}_0x58a48a[_0xfccf('0x1c')](_0x517572);return _0x58a48a[_0xfccf('0x23')](_0xfccf('0x24'),_0x3c48f7+'-'+_0x49a045+'/'+_0x46d117)[_0xfccf('0x1e')](_0x396ed2);}return null;};}function patchUpdates(_0x2933dd){return function(_0x5c966d){try{jsonpatch['apply'](_0x5c966d,_0x2933dd,!![]);}catch(_0x50cda3){return BPromise[_0xfccf('0x25')](_0x50cda3);}return _0x5c966d[_0xfccf('0x26')]();};}function saveUpdates(_0x25e923,_0x476b9a){return function(_0x7797c2){if(_0x7797c2){return _0x7797c2['update'](_0x25e923)[_0xfccf('0x27')](function(_0x329508){return _0x329508;});}return null;};}function removeEntity(_0x524949,_0x22c63f){return function(_0x1337f7){if(_0x1337f7){return _0x1337f7['destroy']()[_0xfccf('0x27')](function(){_0x524949[_0xfccf('0x1c')](0xcc)[_0xfccf('0x1d')]();});}};}function handleEntityNotFound(_0x46e1e0,_0x18242d){return function(_0x2ce0be){if(!_0x2ce0be){_0x46e1e0[_0xfccf('0x1b')](0x194);}return _0x2ce0be;};}function handleError(_0x430958,_0x694358){_0x694358=_0x694358||0x1f4;return function(_0x428cf4){logger[_0xfccf('0x28')](_0x428cf4[_0xfccf('0x29')]);if(_0x428cf4[_0xfccf('0x2a')]){delete _0x428cf4[_0xfccf('0x2a')];}_0x430958[_0xfccf('0x1c')](_0x694358)[_0xfccf('0x2b')](_0x428cf4);};}exports[_0xfccf('0x2c')]=function(_0x24c517,_0x26a67c){var _0x1ff73e={},_0x48e741={},_0x35955b={'count':0x0,'rows':[]};var _0x528f91=_[_0xfccf('0x2d')](db[_0xfccf('0x2e')]['rawAttributes'],function(_0x170cf7){return{'name':_0x170cf7[_0xfccf('0x2f')],'type':_0x170cf7[_0xfccf('0x30')][_0xfccf('0x31')]};});_0x48e741[_0xfccf('0x32')]=_[_0xfccf('0x2d')](_0x528f91,'name');_0x48e741[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x24c517[_0xfccf('0x33')]);_0x48e741[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0x48e741['model'],_0x48e741[_0xfccf('0x33')]);_0x1ff73e[_0xfccf('0x37')]=_[_0xfccf('0x36')](_0x48e741[_0xfccf('0x32')],qs[_0xfccf('0x38')](_0x24c517['query']['fields']));_0x1ff73e[_0xfccf('0x37')]=_0x1ff73e[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1ff73e[_0xfccf('0x37')]:_0x48e741[_0xfccf('0x32')];if(!_0x24c517[_0xfccf('0x33')]['hasOwnProperty'](_0xfccf('0x3a'))){_0x1ff73e['limit']=qs[_0xfccf('0x21')](_0x24c517['query'][_0xfccf('0x21')]);_0x1ff73e['offset']=qs[_0xfccf('0x1f')](_0x24c517[_0xfccf('0x33')][_0xfccf('0x1f')]);}_0x1ff73e[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x24c517[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x1ff73e[_0xfccf('0x3d')]=qs['filters'](_['pick'](_0x24c517[_0xfccf('0x33')],_0x48e741[_0xfccf('0x35')]),_0x528f91);if(_0x24c517['query']['filter']){_0x1ff73e['where']=_[_0xfccf('0x3e')](_0x1ff73e[_0xfccf('0x3d')],{'$or':_[_0xfccf('0x2d')](_0x528f91,function(_0x1437b9){if(_0x1437b9[_0xfccf('0x30')]!==_0xfccf('0x3f')){var _0x3e396d={};_0x3e396d[_0x1437b9[_0xfccf('0x2a')]]={'$like':'%'+_0x24c517['query'][_0xfccf('0x40')]+'%'};return _0x3e396d;}})});}_0x1ff73e=_['merge']({},_0x1ff73e,_0x24c517[_0xfccf('0x41')]);var _0x2ee9da={'where':_0x1ff73e[_0xfccf('0x3d')]};return db[_0xfccf('0x2e')]['count'](_0x2ee9da)[_0xfccf('0x27')](function(_0x25d164){_0x35955b['count']=_0x25d164;if(_0x24c517[_0xfccf('0x33')][_0xfccf('0x42')]){_0x1ff73e['include']=[{'all':!![]}];}return db['Automation'][_0xfccf('0x43')](_0x1ff73e);})[_0xfccf('0x27')](function(_0x6cf8da){_0x35955b[_0xfccf('0x44')]=_0x6cf8da;return _0x35955b;})[_0xfccf('0x27')](respondWithFilteredResult(_0x26a67c,_0x1ff73e))[_0xfccf('0x45')](handleError(_0x26a67c,null));};exports['show']=function(_0x3d1dff,_0x3f025b){var _0x1fbe79={'raw':![],'where':{'id':_0x3d1dff['params']['id']}},_0x411d2d={};_0x411d2d['model']=_[_0xfccf('0x34')](db[_0xfccf('0x2e')]['rawAttributes']);_0x411d2d[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x3d1dff[_0xfccf('0x33')]);_0x411d2d['filters']=_[_0xfccf('0x36')](_0x411d2d[_0xfccf('0x32')],_0x411d2d['query']);_0x1fbe79[_0xfccf('0x37')]=_['intersection'](_0x411d2d[_0xfccf('0x32')],qs['fields'](_0x3d1dff['query'][_0xfccf('0x38')]));_0x1fbe79['attributes']=_0x1fbe79[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1fbe79[_0xfccf('0x37')]:_0x411d2d['model'];if(_0x3d1dff['query']['includeAll']){_0x1fbe79[_0xfccf('0x46')]=[{'all':!![]}];}_0x1fbe79=_[_0xfccf('0x3e')]({},_0x1fbe79,_0x3d1dff['options']);return db['Automation']['find'](_0x1fbe79)['then'](handleEntityNotFound(_0x3f025b,null))['then'](respondWithResult(_0x3f025b,null))[_0xfccf('0x45')](handleError(_0x3f025b,null));};exports['create']=function(_0x383996,_0x22cbde){return db[_0xfccf('0x2e')]['create'](_0x383996[_0xfccf('0x47')],{})[_0xfccf('0x27')](respondWithResult(_0x22cbde,0xc9))['catch'](handleError(_0x22cbde,null));};exports['update']=function(_0x59d0f9,_0x274590){if(_0x59d0f9[_0xfccf('0x47')]['id']){delete _0x59d0f9[_0xfccf('0x47')]['id'];}return db[_0xfccf('0x2e')][_0xfccf('0x48')]({'where':{'id':_0x59d0f9['params']['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x274590,null))[_0xfccf('0x27')](saveUpdates(_0x59d0f9[_0xfccf('0x47')],null))[_0xfccf('0x27')](respondWithResult(_0x274590,null))[_0xfccf('0x45')](handleError(_0x274590,null));};exports['destroy']=function(_0x2fb1e1,_0x3d5857){return db[_0xfccf('0x2e')][_0xfccf('0x48')]({'where':{'id':_0x2fb1e1[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x3d5857,null))[_0xfccf('0x27')](removeEntity(_0x3d5857,null))[_0xfccf('0x45')](handleError(_0x3d5857,null));};exports[_0xfccf('0x4a')]=function(_0x3d8c40,_0xf51ba0,_0x595df0){return db[_0xfccf('0x4b')][_0xfccf('0x48')]({'where':{'id':_0x3d8c40[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0xf51ba0,null))[_0xfccf('0x27')](function(_0x502989){if(_0x502989){return _0x502989[_0xfccf('0x4a')](_0x3d8c40['body'][_0xfccf('0x4c')],_[_0xfccf('0x4d')](_0x3d8c40[_0xfccf('0x47')],[_0xfccf('0x4c'),'id'])||{});}})[_0xfccf('0x27')](respondWithResult(_0xf51ba0,null))[_0xfccf('0x45')](handleError(_0xf51ba0,null));};exports[_0xfccf('0x4e')]=function(_0x11a370,_0x3d5910,_0x38b21d){var _0x1f9479={};var _0xa8f759={};var _0x4be441;var _0x52419e;return db[_0xfccf('0x2e')][_0xfccf('0x4f')]({'where':{'id':_0x11a370[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x3d5910,null))[_0xfccf('0x27')](function(_0x152cf8){if(_0x152cf8){_0x4be441=_0x152cf8;_0xa8f759[_0xfccf('0x32')]=_[_0xfccf('0x34')](db[_0xfccf('0x4b')][_0xfccf('0x50')]);_0xa8f759[_0xfccf('0x33')]=_['keys'](_0x11a370[_0xfccf('0x33')]);_0xa8f759[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0xa8f759[_0xfccf('0x32')],_0xa8f759[_0xfccf('0x33')]);_0x1f9479['attributes']=_['intersection'](_0xa8f759['model'],qs[_0xfccf('0x38')](_0x11a370['query'][_0xfccf('0x38')]));_0x1f9479['attributes']=_0x1f9479[_0xfccf('0x37')][_0xfccf('0x39')]?_0x1f9479[_0xfccf('0x37')]:_0xa8f759['model'];_0x1f9479[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x11a370[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x1f9479[_0xfccf('0x3d')]=qs[_0xfccf('0x35')](_['pick'](_0x11a370[_0xfccf('0x33')],_0xa8f759[_0xfccf('0x35')]));if(_0x11a370[_0xfccf('0x33')][_0xfccf('0x40')]){_0x1f9479[_0xfccf('0x3d')]=_['merge'](_0x1f9479[_0xfccf('0x3d')],{'$or':_[_0xfccf('0x2d')](_0x1f9479[_0xfccf('0x37')],function(_0x638f8e){var _0x47d7eb={};_0x47d7eb[_0x638f8e]={'$like':'%'+_0x11a370[_0xfccf('0x33')]['filter']+'%'};return _0x47d7eb;})});}_0x1f9479=_[_0xfccf('0x3e')]({},_0x1f9479,_0x11a370[_0xfccf('0x41')]);return _0x4be441[_0xfccf('0x4e')](_0x1f9479);}})[_0xfccf('0x27')](function(_0x3ff54e){if(_0x3ff54e){_0x52419e=_0x3ff54e['length'];if(!_0x11a370[_0xfccf('0x33')][_0xfccf('0x51')](_0xfccf('0x3a'))){_0x1f9479['limit']=qs[_0xfccf('0x21')](_0x11a370[_0xfccf('0x33')]['limit']);_0x1f9479[_0xfccf('0x1f')]=qs['offset'](_0x11a370[_0xfccf('0x33')][_0xfccf('0x1f')]);}return _0x4be441[_0xfccf('0x4e')](_0x1f9479);}})[_0xfccf('0x27')](function(_0x203fc4){if(_0x203fc4){return _0x203fc4?{'count':_0x52419e,'rows':_0x203fc4}:null;}})[_0xfccf('0x27')](respondWithResult(_0x3d5910,null))[_0xfccf('0x45')](handleError(_0x3d5910,null));};exports[_0xfccf('0x52')]=function(_0x1dded2,_0x204022,_0x3c2c52){return db[_0xfccf('0x53')]['find']({'where':{'id':_0x1dded2[_0xfccf('0x49')]['id']}})['then'](handleEntityNotFound(_0x204022,null))[_0xfccf('0x27')](function(_0x2471c9){if(_0x2471c9){return _0x2471c9[_0xfccf('0x52')](_0x1dded2[_0xfccf('0x47')]['ids'],_['omit'](_0x1dded2['body'],[_0xfccf('0x4c'),'id'])||{});}})[_0xfccf('0x27')](respondWithResult(_0x204022,null))['catch'](handleError(_0x204022,null));};exports[_0xfccf('0x54')]=function(_0x384465,_0x5417b8,_0x5b2e3e){var _0x3d0cb8={};var _0xd12783={};var _0x35a457;var _0x1913ab;return db[_0xfccf('0x2e')][_0xfccf('0x4f')]({'where':{'id':_0x384465[_0xfccf('0x49')]['id']}})[_0xfccf('0x27')](handleEntityNotFound(_0x5417b8,null))['then'](function(_0x1d23f6){if(_0x1d23f6){_0x35a457=_0x1d23f6;_0xd12783[_0xfccf('0x32')]=_[_0xfccf('0x34')](db[_0xfccf('0x53')]['rawAttributes']);_0xd12783[_0xfccf('0x33')]=_[_0xfccf('0x34')](_0x384465[_0xfccf('0x33')]);_0xd12783[_0xfccf('0x35')]=_[_0xfccf('0x36')](_0xd12783[_0xfccf('0x32')],_0xd12783[_0xfccf('0x33')]);_0x3d0cb8[_0xfccf('0x37')]=_[_0xfccf('0x36')](_0xd12783['model'],qs[_0xfccf('0x38')](_0x384465['query'][_0xfccf('0x38')]));_0x3d0cb8['attributes']=_0x3d0cb8['attributes']['length']?_0x3d0cb8['attributes']:_0xd12783[_0xfccf('0x32')];_0x3d0cb8[_0xfccf('0x3b')]=qs[_0xfccf('0x3c')](_0x384465[_0xfccf('0x33')][_0xfccf('0x3c')]);_0x3d0cb8[_0xfccf('0x3d')]=qs[_0xfccf('0x35')](_['pick'](_0x384465['query'],_0xd12783['filters']));if(_0x384465[_0xfccf('0x33')][_0xfccf('0x40')]){_0x3d0cb8[_0xfccf('0x3d')]=_[_0xfccf('0x3e')](_0x3d0cb8['where'],{'$or':_[_0xfccf('0x2d')](_0x3d0cb8[_0xfccf('0x37')],function(_0xd5c101){var _0x45294b={};_0x45294b[_0xd5c101]={'$like':'%'+_0x384465[_0xfccf('0x33')]['filter']+'%'};return _0x45294b;})});}_0x3d0cb8=_[_0xfccf('0x3e')]({},_0x3d0cb8,_0x384465[_0xfccf('0x41')]);return _0x35a457[_0xfccf('0x54')](_0x3d0cb8);}})[_0xfccf('0x27')](function(_0x5632f6){if(_0x5632f6){_0x1913ab=_0x5632f6[_0xfccf('0x39')];if(!_0x384465['query']['hasOwnProperty'](_0xfccf('0x3a'))){_0x3d0cb8[_0xfccf('0x21')]=qs[_0xfccf('0x21')](_0x384465['query'][_0xfccf('0x21')]);_0x3d0cb8['offset']=qs[_0xfccf('0x1f')](_0x384465[_0xfccf('0x33')][_0xfccf('0x1f')]);}return _0x35a457['getActions'](_0x3d0cb8);}})[_0xfccf('0x27')](function(_0x1df4a8){if(_0x1df4a8){return _0x1df4a8?{'count':_0x1913ab,'rows':_0x1df4a8}:null;}})[_0xfccf('0x27')](respondWithResult(_0x5417b8,null))[_0xfccf('0x45')](handleError(_0x5417b8,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 00d4ed2..92af92d 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 _0xc1bd=['define','Automation','tools_automations','lodash','util','../../config/logger','api','rimraf','../../config/environment','./automation.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1bd,0x7b));var _0xdc1b=function(_0x1c4854,_0x3b968d){_0x1c4854=_0x1c4854-0x0;var _0x5029db=_0xc1bd[_0x1c4854];return _0x5029db;};'use strict';var _=require(_0xdc1b('0x0'));var util=require(_0xdc1b('0x1'));var logger=require(_0xdc1b('0x2'))(_0xdc1b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1b('0x4'));var config=require(_0xdc1b('0x5'));var attributes=require(_0xdc1b('0x6'));module['exports']=function(_0x7ba2b9,_0x279276){return _0x7ba2b9[_0xdc1b('0x7')](_0xdc1b('0x8'),attributes,{'tableName':_0xdc1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc414=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','path'];(function(_0xb197,_0x29fd68){var _0x34bebb=function(_0xf7e8f3){while(--_0xf7e8f3){_0xb197['push'](_0xb197['shift']());}};_0x34bebb(++_0x29fd68);}(_0xc414,0x13a));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c41('0x0'));var logger=require(_0x4c41('0x1'))(_0x4c41('0x2'));var moment=require(_0x4c41('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c41('0x4'));var rimraf=require('rimraf');var config=require(_0x4c41('0x5'));var attributes=require(_0x4c41('0x6'));module[_0x4c41('0x7')]=function(_0x5e85f6,_0x5ebfce){return _0x5e85f6[_0x4c41('0x8')](_0x4c41('0x9'),attributes,{'tableName':_0x4c41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index b65cb0a..a598aff 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 _0xf61e=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x103aa7,_0x148425){var _0x1aa8a8=function(_0x360436){while(--_0x360436){_0x103aa7['push'](_0x103aa7['shift']());}};_0x1aa8a8(++_0x148425);}(_0xf61e,0x191));var _0xef61=function(_0xd3fef4,_0x5b25e2){_0xd3fef4=_0xd3fef4-0x0;var _0x160e69=_0xf61e[_0xd3fef4];return _0x160e69;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch'];(function(_0x327935,_0x3b4150){var _0x26d1a0=function(_0x1d34fc){while(--_0x1d34fc){_0x327935['push'](_0x327935['shift']());}};_0x26d1a0(++_0x3b4150);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('Automation,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c3db990..cd333a2 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 _0xef89=['/:id/actions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','show','get','/:id/conditions','getConditions','create','addConditions','post'];(function(_0x26e7e4,_0x4d671a){var _0x4a79d7=function(_0x49f05e){while(--_0x49f05e){_0x26e7e4['push'](_0x26e7e4['shift']());}};_0x4a79d7(++_0x4d671a);}(_0xef89,0xf6));var _0x9ef8=function(_0x5b6434,_0x51ba52){_0x5b6434=_0x5b6434-0x0;var _0x20a90c=_0xef89[_0x5b6434];return _0x20a90c;};'use strict';var multer=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var path=require(_0x9ef8('0x2'));var timeout=require(_0x9ef8('0x3'));var express=require(_0x9ef8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ef8('0x5'));var auth=require(_0x9ef8('0x6'));var interaction=require(_0x9ef8('0x7'));var config=require(_0x9ef8('0x8'));var controller=require(_0x9ef8('0x9'));router['get']('/',auth[_0x9ef8('0xa')](),controller['index']);router['get']('/:id',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xb')]);router[_0x9ef8('0xc')](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xe')]);router[_0x9ef8('0xc')]('/:id/actions',auth[_0x9ef8('0xa')](),controller['getActions']);router['post']('/',auth[_0x9ef8('0xa')](),controller[_0x9ef8('0xf')]);router['post'](_0x9ef8('0xd'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x10')]);router[_0x9ef8('0x11')](_0x9ef8('0x12'),auth[_0x9ef8('0xa')](),controller['addActions']);router['put'](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x14')]);router[_0x9ef8('0x15')](_0x9ef8('0x13'),auth[_0x9ef8('0xa')](),controller[_0x9ef8('0x16')]);module[_0x9ef8('0x17')]=router; \ No newline at end of file +var _0x07c3=['index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0xe52b48,_0x1d2ce9){var _0x476b07=function(_0x1f946c){while(--_0x1f946c){_0xe52b48['push'](_0xe52b48['shift']());}};_0x476b07(++_0x1d2ce9);}(_0x07c3,0x1bf));var _0x307c=function(_0x2a53ad,_0x234135){_0x2a53ad=_0x2a53ad-0x0;var _0x31b3b6=_0x07c3[_0x2a53ad];return _0x31b3b6;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require(_0x307c('0x4'));var router=express[_0x307c('0x5')]();var fs_extra=require(_0x307c('0x6'));var auth=require(_0x307c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x307c('0x8'));var controller=require(_0x307c('0x9'));router[_0x307c('0xa')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0xc')]);router[_0x307c('0xa')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0xe')]);router[_0x307c('0xa')](_0x307c('0xf'),auth[_0x307c('0xb')](),controller[_0x307c('0x10')]);router[_0x307c('0xa')](_0x307c('0x11'),auth['isAuthenticated'](),controller[_0x307c('0x12')]);router[_0x307c('0x13')]('/',auth[_0x307c('0xb')](),controller[_0x307c('0x14')]);router['post']('/:id/conditions',auth[_0x307c('0xb')](),controller['addConditions']);router[_0x307c('0x13')](_0x307c('0x11'),auth['isAuthenticated'](),controller[_0x307c('0x15')]);router[_0x307c('0x16')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0x17')]);router[_0x307c('0x18')](_0x307c('0xd'),auth[_0x307c('0xb')](),controller[_0x307c('0x19')]);module[_0x307c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f121221..8c3fb05 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 _0x63bf=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#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)','#Drop\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)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)'];(function(_0x58c30e,_0x55a97b){var _0x570768=function(_0x40c1f9){while(--_0x40c1f9){_0x58c30e['push'](_0x58c30e['shift']());}};_0x570768(++_0x55a97b);}(_0x63bf,0xd7));var _0xf63b=function(_0x25ff74,_0x37864c){_0x25ff74=_0x25ff74-0x0;var _0x3e9649=_0x63bf[_0x25ff74];return _0x3e9649;};'use strict';var Sequelize=require('sequelize');module[_0xf63b('0x0')]={'name':{'type':Sequelize[_0xf63b('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x3')),'allowNull':![],'defaultValue':_0xf63b('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':_0xf63b('0x5')},'limitCalls':{'type':Sequelize[_0xf63b('0x6')](0x4)[_0xf63b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf63b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf63b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'comment':_0xf63b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf63b('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x11'),'never',_0xf63b('0x12')),'defaultValue':_0xf63b('0x11')},'dialAMDActive':{'type':Sequelize[_0xf63b('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf63b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf63b('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf63b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf63b('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf63b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf63b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf63b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf63b('0x6')](0x9)[_0xf63b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf63b('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x1a'),_0xf63b('0x1b')),'defaultValue':_0xf63b('0x1a')},'dialPrefix':{'type':Sequelize[_0xf63b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf63b('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xf63b('0x6')](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf63b('0x6')](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf63b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf63b('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf63b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf63b('0x25')}}; \ No newline at end of file +var _0x0a09=['ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x42ab46,_0x43639a){var _0x147a11=function(_0x49b450){while(--_0x49b450){_0x42ab46['push'](_0x42ab46['shift']());}};_0x147a11(++_0x43639a);}(_0x0a09,0xe1));var _0x90a0=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x0a09[_0x5b1c50];return _0x2d379b;};'use strict';var Sequelize=require(_0x90a0('0x0'));module[_0x90a0('0x1')]={'name':{'type':Sequelize[_0x90a0('0x2')],'unique':_0x90a0('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x90a0('0x4')),'allowNull':![],'defaultValue':_0x90a0('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x90a0('0x5')],'defaultValue':0x0,'comment':_0x90a0('0x6')},'limitCalls':{'type':Sequelize[_0x90a0('0x7')](0x4)[_0x90a0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x90a0('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x90a0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x90a0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x90a0('0xe')},'dialTimezone':{'type':Sequelize[_0x90a0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x90a0('0x2')],'defaultValue':_0x90a0('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x90a0('0x10')]('always',_0x90a0('0x11'),_0x90a0('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x90a0('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x90a0('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x90a0('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x90a0('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x90a0('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90a0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x90a0('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x90a0('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x90a0('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x90a0('0x7')](0x9)[_0x90a0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90a0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x90a0('0x10')](_0x90a0('0x1a'),_0x90a0('0x1b')),'defaultValue':_0x90a0('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x90a0('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x90a0('0x7')](0x3)[_0x90a0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90a0('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x90a0('0x7')](0x5)[_0x90a0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90a0('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 922946e..1d9af14 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 _0x3077=['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)','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','sort','where','pick','filter','merge','options','Campaign','include','findAll','rows','show','params','keys','filters','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','createdAt','updatedAt','omit','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','rawAttributes','hasOwnProperty','order','CampaignId','CmHopperHistory','nolimit','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ListId','select','field','phone','NOW()','scheduledAt','ContactId','CmListId'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3077,0x144));var _0x7307=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x3077[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x7307('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7307('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7307('0x2'));var moment=require('moment');var BPromise=require(_0x7307('0x3'));var Mustache=require(_0x7307('0x4'));var util=require(_0x7307('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7307('0x6'));var squel=require(_0x7307('0x7'));var crypto=require(_0x7307('0x8'));var jsforce=require(_0x7307('0x9'));var deskjs=require(_0x7307('0xa'));var toCsv=require(_0x7307('0xb'));var querystring=require(_0x7307('0xc'));var Papa=require(_0x7307('0xd'));var Redis=require(_0x7307('0xe'));var authService=require(_0x7307('0xf'));var qs=require(_0x7307('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7307('0x11'))(_0x7307('0x12'));var utils=require(_0x7307('0x13'));var config=require(_0x7307('0x14'));var licenseUtil=require(_0x7307('0x15'));var db=require(_0x7307('0x16'))['db'];function respondWithStatusCode(_0x2ef5b5,_0x337903){_0x337903=_0x337903||0xcc;return function(_0x18268c){if(_0x18268c){return _0x2ef5b5[_0x7307('0x17')](_0x337903);}return _0x2ef5b5[_0x7307('0x18')](_0x337903)['end']();};}function respondWithResult(_0x588727,_0x235dd7){_0x235dd7=_0x235dd7||0xc8;return function(_0x486b19){if(_0x486b19){return _0x588727[_0x7307('0x18')](_0x235dd7)[_0x7307('0x19')](_0x486b19);}};}function respondWithFilteredResult(_0x573a6f,_0x2e9794){return function(_0x5badd9){if(_0x5badd9){var _0x754da0=typeof _0x2e9794[_0x7307('0x1a')]===_0x7307('0x1b')&&typeof _0x2e9794[_0x7307('0x1c')]===_0x7307('0x1b');var _0x528472=_0x5badd9[_0x7307('0x1d')];var _0x554997=_0x754da0?0x0:_0x2e9794['offset'];var _0x5e04c9=_0x754da0?_0x5badd9[_0x7307('0x1d')]:_0x2e9794[_0x7307('0x1a')]+_0x2e9794[_0x7307('0x1c')];var _0x55750a;if(_0x5e04c9>=_0x528472){_0x5e04c9=_0x528472;_0x55750a=0xc8;}else{_0x55750a=0xce;}_0x573a6f[_0x7307('0x18')](_0x55750a);return _0x573a6f[_0x7307('0x1e')](_0x7307('0x1f'),_0x554997+'-'+_0x5e04c9+'/'+_0x528472)[_0x7307('0x19')](_0x5badd9);}return null;};}function patchUpdates(_0x589e4f){return function(_0x42740e){try{jsonpatch['apply'](_0x42740e,_0x589e4f,!![]);}catch(_0x643fef){return BPromise[_0x7307('0x20')](_0x643fef);}return _0x42740e[_0x7307('0x21')]();};}function saveUpdates(_0x23624e,_0x353c4a){return function(_0x9dc4d){if(_0x9dc4d){return _0x9dc4d[_0x7307('0x22')](_0x23624e)[_0x7307('0x23')](function(_0x550e5f){return _0x550e5f;});}return null;};}function removeEntity(_0xb31856,_0xb61a0){return function(_0x206532){if(_0x206532){return _0x206532['destroy']()['then'](function(){var _0x16ffb0=_0x206532[_0x7307('0x24')]({'plain':!![]});var _0x1f1c86='IvrCampaigns';return db['UserProfileResource'][_0x7307('0x25')]({'where':{'type':_0x1f1c86,'resourceId':_0x16ffb0['id']}})[_0x7307('0x23')](function(){return _0x206532;});})['then'](function(){_0xb31856[_0x7307('0x18')](0xcc)[_0x7307('0x26')]();});}};}function handleEntityNotFound(_0xca10ee,_0x10d6c9){return function(_0x3e2a78){if(!_0x3e2a78){_0xca10ee[_0x7307('0x17')](0x194);}return _0x3e2a78;};}function handleError(_0x1ecb0d,_0x5eefea){_0x5eefea=_0x5eefea||0x1f4;return function(_0x102078){logger[_0x7307('0x27')](_0x102078['stack']);if(_0x102078[_0x7307('0x28')]){delete _0x102078['name'];}_0x1ecb0d['status'](_0x5eefea)[_0x7307('0x29')](_0x102078);};}exports[_0x7307('0x2a')]=function(_0x232b96,_0x2f768d){var _0x276943={},_0x1ce495={},_0x55954b={'count':0x0,'rows':[]};var _0x243cc6=_[_0x7307('0x2b')](db['Campaign']['rawAttributes'],function(_0x475c06){return{'name':_0x475c06[_0x7307('0x2c')],'type':_0x475c06[_0x7307('0x2d')][_0x7307('0x2e')]};});_0x1ce495[_0x7307('0x2f')]=_[_0x7307('0x2b')](_0x243cc6,_0x7307('0x28'));_0x1ce495[_0x7307('0x30')]=_['keys'](_0x232b96[_0x7307('0x30')]);_0x1ce495['filters']=_[_0x7307('0x31')](_0x1ce495['model'],_0x1ce495['query']);_0x276943[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1ce495['model'],qs[_0x7307('0x33')](_0x232b96[_0x7307('0x30')][_0x7307('0x33')]));_0x276943[_0x7307('0x32')]=_0x276943[_0x7307('0x32')]['length']?_0x276943[_0x7307('0x32')]:_0x1ce495[_0x7307('0x2f')];if(!_0x232b96[_0x7307('0x30')]['hasOwnProperty']('nolimit')){_0x276943[_0x7307('0x1c')]=qs['limit'](_0x232b96[_0x7307('0x30')][_0x7307('0x1c')]);_0x276943['offset']=qs[_0x7307('0x1a')](_0x232b96[_0x7307('0x30')][_0x7307('0x1a')]);}_0x276943['order']=qs[_0x7307('0x34')](_0x232b96[_0x7307('0x30')][_0x7307('0x34')]);_0x276943[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0x232b96[_0x7307('0x30')],_0x1ce495['filters']),_0x243cc6);if(_0x232b96[_0x7307('0x30')][_0x7307('0x37')]){_0x276943['where']=_[_0x7307('0x38')](_0x276943['where'],{'$or':_[_0x7307('0x2b')](_0x243cc6,function(_0x232ced){if(_0x232ced['type']!=='VIRTUAL'){var _0x389bc9={};_0x389bc9[_0x232ced[_0x7307('0x28')]]={'$like':'%'+_0x232b96['query'][_0x7307('0x37')]+'%'};return _0x389bc9;}})});}_0x276943=_[_0x7307('0x38')]({},_0x276943,_0x232b96[_0x7307('0x39')]);var _0x2fe32f={'where':_0x276943[_0x7307('0x35')]};return db[_0x7307('0x3a')][_0x7307('0x1d')](_0x2fe32f)[_0x7307('0x23')](function(_0x494e25){_0x55954b['count']=_0x494e25;if(_0x232b96[_0x7307('0x30')]['includeAll']){_0x276943[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x3a')][_0x7307('0x3c')](_0x276943);})[_0x7307('0x23')](function(_0x2edacf){_0x55954b[_0x7307('0x3d')]=_0x2edacf;return _0x55954b;})[_0x7307('0x23')](respondWithFilteredResult(_0x2f768d,_0x276943))['catch'](handleError(_0x2f768d,null));};exports[_0x7307('0x3e')]=function(_0x45517a,_0x52ed35){var _0x1cdc28={'raw':![],'where':{'id':_0x45517a[_0x7307('0x3f')]['id']}},_0x53581d={};_0x53581d[_0x7307('0x2f')]=_['keys'](db[_0x7307('0x3a')]['rawAttributes']);_0x53581d['query']=_[_0x7307('0x40')](_0x45517a['query']);_0x53581d[_0x7307('0x41')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],_0x53581d[_0x7307('0x30')]);_0x1cdc28[_0x7307('0x32')]=_[_0x7307('0x31')](_0x53581d[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x45517a['query'][_0x7307('0x33')]));_0x1cdc28['attributes']=_0x1cdc28[_0x7307('0x32')][_0x7307('0x42')]?_0x1cdc28['attributes']:_0x53581d[_0x7307('0x2f')];if(_0x45517a[_0x7307('0x30')][_0x7307('0x43')]){_0x1cdc28[_0x7307('0x3b')]=[{'all':!![]}];}_0x1cdc28=_[_0x7307('0x38')]({},_0x1cdc28,_0x45517a[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x1cdc28)[_0x7307('0x23')](handleEntityNotFound(_0x52ed35,null))[_0x7307('0x23')](respondWithResult(_0x52ed35,null))[_0x7307('0x45')](handleError(_0x52ed35,null));};exports[_0x7307('0x46')]=function(_0x9e861e,_0x581e1b){return db[_0x7307('0x3a')]['create'](_0x9e861e[_0x7307('0x47')],{})[_0x7307('0x23')](function(_0x104198){var _0x38b4d9=_0x9e861e[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x38b4d9)throw new Error(_0x7307('0x49'));if(_0x38b4d9[_0x7307('0x4a')]==='user'){var _0x8a65b3=_0x104198['get']({'plain':!![]});var _0x5562ed=_0x7307('0x4b');return db[_0x7307('0x4c')][_0x7307('0x44')]({'where':{'name':_0x5562ed,'userProfileId':_0x38b4d9[_0x7307('0x4d')]},'raw':!![]})[_0x7307('0x23')](function(_0x5009fc){if(_0x5009fc&&_0x5009fc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7307('0x46')]({'name':_0x8a65b3[_0x7307('0x28')],'resourceId':_0x8a65b3['id'],'type':_0x5009fc[_0x7307('0x28')],'sectionId':_0x5009fc['id']},{})[_0x7307('0x23')](function(){return _0x104198;});}else{return _0x104198;}})[_0x7307('0x45')](function(_0x548f49){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x548f49);throw _0x548f49;});}return _0x104198;})[_0x7307('0x23')](respondWithResult(_0x581e1b,0xc9))[_0x7307('0x45')](handleError(_0x581e1b,null));};exports['clone']=function(_0x1acd2d,_0x407c40){var _0x17030a={'where':{'id':_0x1acd2d[_0x7307('0x3f')]['id']}},_0x4b2bf3={};_0x4b2bf3[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x3a')]['rawAttributes']);_0x17030a['attributes']=_[_0x7307('0x31')](_0x4b2bf3['model'],qs['fields'](_0x1acd2d[_0x7307('0x30')]['fields']));_0x17030a[_0x7307('0x32')]=_0x17030a[_0x7307('0x32')][_0x7307('0x42')]?_0x17030a[_0x7307('0x32')]:_0x4b2bf3[_0x7307('0x2f')];if(_0x1acd2d[_0x7307('0x30')][_0x7307('0x43')]){_0x17030a[_0x7307('0x3b')]=[{'all':!![]}];}_0x17030a=_[_0x7307('0x38')]({},_0x17030a,_0x1acd2d[_0x7307('0x39')]);return db[_0x7307('0x3a')][_0x7307('0x44')](_0x17030a)[_0x7307('0x23')](handleEntityNotFound(_0x407c40,null))[_0x7307('0x23')](function(_0x6cce90){if(_0x6cce90){var _0x5f0965=_0x6cce90['get']({'plain':!![]});_0x5f0965=qs['omit'](_0x5f0965,['id',_0x7307('0x4e'),_0x7307('0x4f')]);_0x1acd2d['body']=_[_0x7307('0x50')](_0x1acd2d[_0x7307('0x47')],['id',_0x7307('0x4e'),_0x7307('0x4f')]);return db[_0x7307('0x3a')][_0x7307('0x46')](_[_0x7307('0x38')](_0x5f0965,_0x1acd2d[_0x7307('0x47')]),{'include':_0x1acd2d[_0x7307('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x7307('0x23')](function(_0x28c301){var _0x333c9c=_0x1acd2d[_0x7307('0x48')][_0x7307('0x24')]({'plain':!![]});if(!_0x333c9c)throw new Error(_0x7307('0x49'));if(_0x333c9c[_0x7307('0x4a')]===_0x7307('0x48')){var _0x2412c2=_0x28c301['get']({'plain':!![]});var _0x4cfadc=_0x7307('0x4b');return db[_0x7307('0x4c')]['find']({'where':{'name':_0x4cfadc,'userProfileId':_0x333c9c[_0x7307('0x4d')]},'raw':!![]})['then'](function(_0x184842){if(_0x184842&&_0x184842[_0x7307('0x51')]===0x0){return db[_0x7307('0x52')][_0x7307('0x46')]({'name':_0x2412c2[_0x7307('0x28')],'resourceId':_0x2412c2['id'],'type':_0x184842['name'],'sectionId':_0x184842['id']},{})[_0x7307('0x23')](function(){return _0x28c301;});}else{return _0x28c301;}})[_0x7307('0x45')](function(_0x339df5){logger[_0x7307('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x339df5);throw _0x339df5;});}return _0x28c301;});}})[_0x7307('0x23')](respondWithResult(_0x407c40,0xc9))[_0x7307('0x45')](handleError(_0x407c40,null));};exports['update']=function(_0x2caed7,_0x5d22fc){if(_0x2caed7['body']['id']){delete _0x2caed7['body']['id'];}return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x2caed7['params']['id']}})['then'](handleEntityNotFound(_0x5d22fc,null))[_0x7307('0x23')](saveUpdates(_0x2caed7[_0x7307('0x47')],null))[_0x7307('0x23')](respondWithResult(_0x5d22fc,null))[_0x7307('0x45')](handleError(_0x5d22fc,null));};exports[_0x7307('0x25')]=function(_0x4fd8e6,_0x1c5934){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x4fd8e6['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x1c5934,null))[_0x7307('0x23')](removeEntity(_0x1c5934,null))['catch'](handleError(_0x1c5934,null));};exports[_0x7307('0x53')]=function(_0x54c255,_0x47e04c,_0x1a4cee){var _0x3be4c0={'raw':!![],'where':{}};var _0x79d26c={};var _0x30bdf4={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x54c255[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x47e04c,null))[_0x7307('0x23')](function(_0x3cb697){if(_0x3cb697){_0x79d26c[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x55')][_0x7307('0x56')]);_0x79d26c['query']=_[_0x7307('0x40')](_0x54c255[_0x7307('0x30')]);_0x79d26c[_0x7307('0x41')]=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],_0x79d26c[_0x7307('0x30')]);_0x3be4c0['attributes']=_[_0x7307('0x31')](_0x79d26c[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x54c255[_0x7307('0x30')][_0x7307('0x33')]));_0x3be4c0['attributes']=_0x3be4c0[_0x7307('0x32')]['length']?_0x3be4c0['attributes']:_0x79d26c['model'];if(!_0x54c255['query'][_0x7307('0x57')]('nolimit')){_0x3be4c0[_0x7307('0x1c')]=qs['limit'](_0x54c255[_0x7307('0x30')]['limit']);_0x3be4c0['offset']=qs[_0x7307('0x1a')](_0x54c255['query'][_0x7307('0x1a')]);}_0x3be4c0[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x54c255['query']['sort']);_0x3be4c0[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x54c255[_0x7307('0x30')],_0x79d26c[_0x7307('0x41')]));_0x3be4c0['where'][_0x7307('0x59')]=_0x3cb697['id'];if(_0x54c255['query'][_0x7307('0x37')]){_0x3be4c0['where']=_[_0x7307('0x38')](_0x3be4c0[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x3be4c0[_0x7307('0x32')],function(_0x4f7dc3){var _0x4218fb={};_0x4218fb[_0x4f7dc3]={'$like':'%'+_0x54c255[_0x7307('0x30')]['filter']+'%'};return _0x4218fb;})});}_0x3be4c0=_['merge']({},_0x3be4c0,_0x54c255[_0x7307('0x39')]);return db[_0x7307('0x55')][_0x7307('0x1d')]({'where':_0x3be4c0['where']})[_0x7307('0x23')](function(_0x14c3c8){_0x30bdf4[_0x7307('0x1d')]=_0x14c3c8;if(_0x54c255[_0x7307('0x30')][_0x7307('0x43')]){_0x3be4c0[_0x7307('0x3b')]=[{'all':!![]}];}return db[_0x7307('0x55')][_0x7307('0x3c')](_0x3be4c0);})[_0x7307('0x23')](function(_0x1d2ef1){_0x30bdf4['rows']=_0x1d2ef1;return _0x30bdf4;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x47e04c,_0x3be4c0))['catch'](handleError(_0x47e04c,null));};exports['getHopperHistories']=function(_0x5070f5,_0x293f68,_0x358452){var _0xa04be4={'raw':!![],'where':{}};var _0x1239b9={};var _0x7f1837={'count':0x0,'rows':[]};return db[_0x7307('0x3a')]['findOne']({'where':{'id':_0x5070f5[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x293f68,null))[_0x7307('0x23')](function(_0xadbf77){if(_0xadbf77){_0x1239b9[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5a')][_0x7307('0x56')]);_0x1239b9['query']=_[_0x7307('0x40')](_0x5070f5[_0x7307('0x30')]);_0x1239b9[_0x7307('0x41')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],_0x1239b9[_0x7307('0x30')]);_0xa04be4[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1239b9[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x5070f5[_0x7307('0x30')][_0x7307('0x33')]));_0xa04be4[_0x7307('0x32')]=_0xa04be4[_0x7307('0x32')][_0x7307('0x42')]?_0xa04be4[_0x7307('0x32')]:_0x1239b9[_0x7307('0x2f')];if(!_0x5070f5[_0x7307('0x30')][_0x7307('0x57')](_0x7307('0x5b'))){_0xa04be4['limit']=qs[_0x7307('0x1c')](_0x5070f5[_0x7307('0x30')]['limit']);_0xa04be4[_0x7307('0x1a')]=qs['offset'](_0x5070f5[_0x7307('0x30')]['offset']);}_0xa04be4['order']=qs[_0x7307('0x34')](_0x5070f5['query'][_0x7307('0x34')]);_0xa04be4['where']=qs[_0x7307('0x41')](_['pick'](_0x5070f5['query'],_0x1239b9['filters']));_0xa04be4['where']['CampaignId']=_0xadbf77['id'];if(_0x5070f5['query'][_0x7307('0x37')]){_0xa04be4[_0x7307('0x35')]=_[_0x7307('0x38')](_0xa04be4[_0x7307('0x35')],{'$or':_['map'](_0xa04be4[_0x7307('0x32')],function(_0x448716){var _0x5c7875={};_0x5c7875[_0x448716]={'$like':'%'+_0x5070f5[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x5c7875;})});}_0xa04be4=_['merge']({},_0xa04be4,_0x5070f5[_0x7307('0x39')]);return db[_0x7307('0x5a')]['count']({'where':_0xa04be4[_0x7307('0x35')]})['then'](function(_0x49ad6e){_0x7f1837[_0x7307('0x1d')]=_0x49ad6e;if(_0x5070f5['query'][_0x7307('0x43')]){_0xa04be4['include']=[{'all':!![]}];}return db[_0x7307('0x5a')]['findAll'](_0xa04be4);})[_0x7307('0x23')](function(_0x1d262f){_0x7f1837[_0x7307('0x3d')]=_0x1d262f;return _0x7f1837;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x293f68,_0xa04be4))['catch'](handleError(_0x293f68,null));};exports['getHopperFinals']=function(_0x28ca75,_0x482e8d,_0x2e30bf){var _0x6c627e={'raw':!![],'where':{}};var _0x48f713={};var _0x5ed711={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28ca75[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x482e8d,null))[_0x7307('0x23')](function(_0x3a8e91){if(_0x3a8e91){_0x48f713[_0x7307('0x2f')]=_[_0x7307('0x40')](db['CmHopperFinal'][_0x7307('0x56')]);_0x48f713[_0x7307('0x30')]=_[_0x7307('0x40')](_0x28ca75[_0x7307('0x30')]);_0x48f713['filters']=_[_0x7307('0x31')](_0x48f713[_0x7307('0x2f')],_0x48f713[_0x7307('0x30')]);_0x6c627e[_0x7307('0x32')]=_['intersection'](_0x48f713['model'],qs[_0x7307('0x33')](_0x28ca75[_0x7307('0x30')][_0x7307('0x33')]));_0x6c627e[_0x7307('0x32')]=_0x6c627e[_0x7307('0x32')][_0x7307('0x42')]?_0x6c627e[_0x7307('0x32')]:_0x48f713[_0x7307('0x2f')];if(!_0x28ca75['query'][_0x7307('0x57')](_0x7307('0x5b'))){_0x6c627e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1c')]);_0x6c627e['offset']=qs[_0x7307('0x1a')](_0x28ca75[_0x7307('0x30')][_0x7307('0x1a')]);}_0x6c627e[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x28ca75[_0x7307('0x30')][_0x7307('0x34')]);_0x6c627e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x28ca75[_0x7307('0x30')],_0x48f713[_0x7307('0x41')]));_0x6c627e['where'][_0x7307('0x59')]=_0x3a8e91['id'];if(_0x28ca75[_0x7307('0x30')][_0x7307('0x37')]){_0x6c627e['where']=_[_0x7307('0x38')](_0x6c627e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x6c627e['attributes'],function(_0x36ae04){var _0x5f048d={};_0x5f048d[_0x36ae04]={'$like':'%'+_0x28ca75['query']['filter']+'%'};return _0x5f048d;})});}_0x6c627e=_[_0x7307('0x38')]({},_0x6c627e,_0x28ca75[_0x7307('0x39')]);return db[_0x7307('0x5c')][_0x7307('0x1d')]({'where':_0x6c627e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x4b8ed2){_0x5ed711['count']=_0x4b8ed2;if(_0x28ca75['query']['includeAll']){_0x6c627e[_0x7307('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x6c627e);})['then'](function(_0xab7277){_0x5ed711[_0x7307('0x3d')]=_0xab7277;return _0x5ed711;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x482e8d,_0x6c627e))[_0x7307('0x45')](handleError(_0x482e8d,null));};exports[_0x7307('0x5d')]=function(_0x52a39b,_0x4ddf97,_0x32361f){var _0x476b2e={'raw':!![],'where':{}};var _0x5d2449={};var _0x33b624={'count':0x0,'rows':[]};return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x52a39b[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4ddf97,null))['then'](function(_0x577ad9){if(_0x577ad9){_0x5d2449[_0x7307('0x2f')]=_[_0x7307('0x40')](db[_0x7307('0x5e')][_0x7307('0x56')]);_0x5d2449['query']=_[_0x7307('0x40')](_0x52a39b['query']);_0x5d2449[_0x7307('0x41')]=_[_0x7307('0x31')](_0x5d2449['model'],_0x5d2449[_0x7307('0x30')]);_0x476b2e[_0x7307('0x32')]=_['intersection'](_0x5d2449[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x52a39b[_0x7307('0x30')][_0x7307('0x33')]));_0x476b2e[_0x7307('0x32')]=_0x476b2e['attributes'][_0x7307('0x42')]?_0x476b2e[_0x7307('0x32')]:_0x5d2449[_0x7307('0x2f')];if(!_0x52a39b[_0x7307('0x30')]['hasOwnProperty'](_0x7307('0x5b'))){_0x476b2e[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x52a39b[_0x7307('0x30')][_0x7307('0x1c')]);_0x476b2e[_0x7307('0x1a')]=qs['offset'](_0x52a39b['query'][_0x7307('0x1a')]);}_0x476b2e[_0x7307('0x58')]=qs['sort'](_0x52a39b[_0x7307('0x30')]['sort']);_0x476b2e[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x52a39b['query'],_0x5d2449[_0x7307('0x41')]));_0x476b2e[_0x7307('0x35')][_0x7307('0x59')]=_0x577ad9['id'];if(_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]){_0x476b2e[_0x7307('0x35')]=_['merge'](_0x476b2e[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0x476b2e[_0x7307('0x32')],function(_0x4ada99){var _0x43641b={};_0x43641b[_0x4ada99]={'$like':'%'+_0x52a39b[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x43641b;})});}_0x476b2e=_[_0x7307('0x38')]({},_0x476b2e,_0x52a39b[_0x7307('0x39')]);return db[_0x7307('0x5e')][_0x7307('0x1d')]({'where':_0x476b2e[_0x7307('0x35')]})[_0x7307('0x23')](function(_0x1a7182){_0x33b624[_0x7307('0x1d')]=_0x1a7182;if(_0x52a39b['query'][_0x7307('0x43')]){_0x476b2e['include']=[{'all':!![]}];}return db[_0x7307('0x5e')][_0x7307('0x3c')](_0x476b2e);})[_0x7307('0x23')](function(_0x58d1c6){_0x33b624[_0x7307('0x3d')]=_0x58d1c6;return _0x33b624;});}})[_0x7307('0x23')](respondWithFilteredResult(_0x4ddf97,_0x476b2e))[_0x7307('0x45')](handleError(_0x4ddf97,null));};exports['getLists']=function(_0x4b5f16,_0x755b21,_0x2dd041){var _0xdc58ce={};var _0x348e88={};var _0x5a0878;var _0x156c6b;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0x4b5f16[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x755b21,null))['then'](function(_0x1607a0){if(_0x1607a0){_0x5a0878=_0x1607a0;_0x348e88[_0x7307('0x2f')]=_['keys'](db['CmList'][_0x7307('0x56')]);_0x348e88[_0x7307('0x30')]=_[_0x7307('0x40')](_0x4b5f16[_0x7307('0x30')]);_0x348e88[_0x7307('0x41')]=_[_0x7307('0x31')](_0x348e88[_0x7307('0x2f')],_0x348e88[_0x7307('0x30')]);_0xdc58ce['attributes']=_['intersection'](_0x348e88[_0x7307('0x2f')],qs[_0x7307('0x33')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x33')]));_0xdc58ce['attributes']=_0xdc58ce[_0x7307('0x32')][_0x7307('0x42')]?_0xdc58ce[_0x7307('0x32')]:_0x348e88[_0x7307('0x2f')];_0xdc58ce[_0x7307('0x58')]=qs[_0x7307('0x34')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x34')]);_0xdc58ce[_0x7307('0x35')]=qs[_0x7307('0x41')](_[_0x7307('0x36')](_0x4b5f16[_0x7307('0x30')],_0x348e88[_0x7307('0x41')]));if(_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]){_0xdc58ce['where']=_[_0x7307('0x38')](_0xdc58ce[_0x7307('0x35')],{'$or':_[_0x7307('0x2b')](_0xdc58ce['attributes'],function(_0x43a62f){var _0x355814={};_0x355814[_0x43a62f]={'$like':'%'+_0x4b5f16[_0x7307('0x30')][_0x7307('0x37')]+'%'};return _0x355814;})});}_0xdc58ce=_[_0x7307('0x38')]({},_0xdc58ce,_0x4b5f16[_0x7307('0x39')]);return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x378434){if(_0x378434){_0x156c6b=_0x378434['length'];if(!_0x4b5f16[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0xdc58ce[_0x7307('0x1c')]=qs[_0x7307('0x1c')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1c')]);_0xdc58ce[_0x7307('0x1a')]=qs[_0x7307('0x1a')](_0x4b5f16[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x5a0878[_0x7307('0x5f')](_0xdc58ce);}})[_0x7307('0x23')](function(_0x46ff82){if(_0x46ff82){return _0x46ff82?{'count':_0x156c6b,'rows':_0x46ff82}:null;}})[_0x7307('0x23')](respondWithResult(_0x755b21,null))[_0x7307('0x45')](handleError(_0x755b21,null));};exports[_0x7307('0x60')]=function(_0x185a23,_0x4fcf81,_0x1dfadf){var _0x44cc86,_0x49bebd;var _0x4557f5=[];var _0x2be6f1=moment()[_0x7307('0x61')](_0x7307('0x62'));return db['Campaign'][_0x7307('0x44')]({'where':{'id':_0x185a23['params']['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x4fcf81,null))['then'](function(_0x5610ba){if(_0x5610ba){_0x49bebd=_0x5610ba;return _0x5610ba[_0x7307('0x60')](_0x185a23[_0x7307('0x47')][_0x7307('0x63')],_[_0x7307('0x50')](_0x185a23[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})['spread'](function(_0x5f3e2b){var _0x326c93;var _0x1f0eb3;_0x44cc86=_0x5f3e2b||[];var _0x2f9dac=[];if(_0x5f3e2b){for(var _0x3832cf=0x0;_0x3832cf<_0x5f3e2b[_0x7307('0x42')];_0x3832cf+=0x1){var _0x3df95e=_0x5f3e2b[_0x3832cf][_0x7307('0x24')]({'plain':!![]});_0x49bebd[_0x7307('0x64')]=_0x185a23[_0x7307('0x47')][_0x7307('0x64')]?_0x185a23[_0x7307('0x47')][_0x7307('0x64')]:_0x49bebd[_0x7307('0x64')];switch(_0x49bebd[_0x7307('0x64')]){case _0x7307('0x65'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x68'))[_0x7307('0x69')](['phone','scheduledAt','ContactId',_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),_0x7307('0x4f')],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id',_0x7307('0x70'))[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')]['toString'](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))[_0x7307('0x73')](_0x7307('0x74'))['where'](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))['where'](_0x7307('0x78'),squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x79'))[_0x7307('0x73')](_0x7307('0x7a'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]()))[_0x7307('0x35')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7307('0x6c')](_0x7307('0x7b'))[_0x7307('0x73')](_0x7307('0x68'))['where']('CampaignId\x20=\x20?',_0x185a23[_0x7307('0x3f')]['id']['toString']())))['toString']();break;case _0x7307('0x7c'):_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),'scheduledAt',_0x7307('0x70'),_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),'updatedAt'],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))[_0x7307('0x6c')](_0x7307('0x6e'),_0x7307('0x6f'))['field']('id','ContactId')[_0x7307('0x6c')](_0x3df95e[_0x7307('0x71')][_0x7307('0x72')](),'ListId')['field'](_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')](),'CampaignId')[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')[_0x7307('0x73')](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77'))[_0x7307('0x35')](_0x7307('0x78'),squel[_0x7307('0x6b')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x7307('0x68'))[_0x7307('0x35')]('CampaignId\x20=\x20?',_0x185a23['params']['id'][_0x7307('0x72')]())))[_0x7307('0x72')]();break;default:_0x326c93=squel[_0x7307('0x66')]()[_0x7307('0x67')]('cm_hopper')[_0x7307('0x69')]([_0x7307('0x6d'),_0x7307('0x6f'),_0x7307('0x70'),_0x7307('0x6a'),_0x7307('0x59'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field'](_0x7307('0x6e'),_0x7307('0x6f'))[_0x7307('0x6c')]('id','ContactId')['field'](_0x3df95e['CmListId'][_0x7307('0x72')](),'ListId')[_0x7307('0x6c')](_0x185a23['params']['id']['toString'](),_0x7307('0x59'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))[_0x7307('0x6c')]('\x27'+_0x2be6f1+'\x27','updatedAt')['from']('cm_contacts')[_0x7307('0x35')](_0x7307('0x75'))[_0x7307('0x35')](_0x7307('0x76'),_0x3df95e[_0x7307('0x71')]['toString']())[_0x7307('0x35')](_0x7307('0x77')))['toString']();}_0x1f0eb3=squel[_0x7307('0x66')]()[_0x7307('0x67')](_0x7307('0x7d'))[_0x7307('0x69')]([_0x7307('0x7e'),_0x7307('0x6f'),'phone',_0x7307('0x7f'),_0x7307('0x4e'),'updatedAt'],squel[_0x7307('0x6b')]()[_0x7307('0x6c')](_0x7307('0x80'),'id')[_0x7307('0x6c')](_0x7307('0x6e'),'scheduledAt')['field'](_0x7307('0x81'),_0x7307('0x6d'))[_0x7307('0x6c')]('ci.OrderBY',_0x7307('0x7f'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4e'))['field']('\x27'+_0x2be6f1+'\x27',_0x7307('0x4f'))['from'](_0x7307('0x82'),'ci')[_0x7307('0x83')](_0x7307('0x68'),'h',_0x7307('0x84'))[_0x7307('0x35')](_0x7307('0x85'),_0x3df95e[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x86'),_0x185a23[_0x7307('0x3f')]['id'][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x87'),_0x2be6f1))[_0x7307('0x72')]();_0x2f9dac['push'](db[_0x7307('0x88')]['query'](_0x326c93));_0x4557f5['push'](db[_0x7307('0x88')]['query'](_0x1f0eb3));}return BPromise[_0x7307('0x89')](_0x2f9dac);}})[_0x7307('0x23')](function(){return BPromise[_0x7307('0x89')](_0x4557f5);})[_0x7307('0x23')](function(){return _0x44cc86;})[_0x7307('0x23')](respondWithResult(_0x4fcf81,null))[_0x7307('0x45')](handleError(_0x4fcf81,null));};exports[_0x7307('0x8a')]=function(_0x3e85d2,_0x74a590,_0x2598da){return db[_0x7307('0x3a')]['find']({'where':{'id':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x74a590,null))[_0x7307('0x23')](function(_0x2e1e9f){if(_0x2e1e9f){return _0x2e1e9f[_0x7307('0x8a')](_0x3e85d2[_0x7307('0x30')]['ids']);}})[_0x7307('0x23')](function(_0x5d9e6d){if(_0x5d9e6d){return db[_0x7307('0x55')][_0x7307('0x25')]({'where':{'ListId':_0x3e85d2[_0x7307('0x30')]['ids'],'CampaignId':_0x3e85d2[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x5d9e6d;});}})[_0x7307('0x23')](respondWithStatusCode(_0x74a590,null))['catch'](handleError(_0x74a590,null));};exports[_0x7307('0x8b')]=function(_0xc21630,_0x56fabe,_0xabedb3){var _0x3cbf8b={};var _0x1d60db={};var _0x16a2d0;var _0x589db2;return db[_0x7307('0x3a')][_0x7307('0x54')]({'where':{'id':_0xc21630[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56fabe,null))[_0x7307('0x23')](function(_0xc63622){if(_0xc63622){_0x16a2d0=_0xc63622;_0x1d60db['model']=_['keys'](db[_0x7307('0x8c')][_0x7307('0x56')]);_0x1d60db[_0x7307('0x30')]=_[_0x7307('0x40')](_0xc21630[_0x7307('0x30')]);_0x1d60db['filters']=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],_0x1d60db[_0x7307('0x30')]);_0x3cbf8b[_0x7307('0x32')]=_[_0x7307('0x31')](_0x1d60db[_0x7307('0x2f')],qs[_0x7307('0x33')](_0xc21630[_0x7307('0x30')][_0x7307('0x33')]));_0x3cbf8b[_0x7307('0x32')]=_0x3cbf8b[_0x7307('0x32')][_0x7307('0x42')]?_0x3cbf8b[_0x7307('0x32')]:_0x1d60db[_0x7307('0x2f')];_0x3cbf8b[_0x7307('0x58')]=qs[_0x7307('0x34')](_0xc21630[_0x7307('0x30')][_0x7307('0x34')]);_0x3cbf8b[_0x7307('0x35')]=qs['filters'](_[_0x7307('0x36')](_0xc21630[_0x7307('0x30')],_0x1d60db[_0x7307('0x41')]));if(_0xc21630[_0x7307('0x30')][_0x7307('0x37')]){_0x3cbf8b[_0x7307('0x35')]=_[_0x7307('0x38')](_0x3cbf8b['where'],{'$or':_['map'](_0x3cbf8b[_0x7307('0x32')],function(_0x32831){var _0x10789b={};_0x10789b[_0x32831]={'$like':'%'+_0xc21630['query'][_0x7307('0x37')]+'%'};return _0x10789b;})});}_0x3cbf8b=_[_0x7307('0x38')]({},_0x3cbf8b,_0xc21630[_0x7307('0x39')]);return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1a39f4){if(_0x1a39f4){_0x589db2=_0x1a39f4['length'];if(!_0xc21630[_0x7307('0x30')][_0x7307('0x57')]('nolimit')){_0x3cbf8b['limit']=qs[_0x7307('0x1c')](_0xc21630[_0x7307('0x30')][_0x7307('0x1c')]);_0x3cbf8b['offset']=qs[_0x7307('0x1a')](_0xc21630[_0x7307('0x30')][_0x7307('0x1a')]);}return _0x16a2d0[_0x7307('0x8b')](_0x3cbf8b);}})[_0x7307('0x23')](function(_0x1e26c3){if(_0x1e26c3){return _0x1e26c3?{'count':_0x589db2,'rows':_0x1e26c3}:null;}})[_0x7307('0x23')](respondWithResult(_0x56fabe,null))[_0x7307('0x45')](handleError(_0x56fabe,null));};exports[_0x7307('0x8d')]=function(_0x1ee45d,_0x573bf5,_0x4ac577){var _0xfa57f8,_0x891f06;var _0x8c9a3b=[];var _0x513650=moment()[_0x7307('0x61')](_0x7307('0x62'));return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x1ee45d[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](handleEntityNotFound(_0x573bf5,null))[_0x7307('0x23')](function(_0x2b5d48){if(_0x2b5d48){_0x891f06=_0x2b5d48;return _0x2b5d48[_0x7307('0x8d')](_0x1ee45d[_0x7307('0x47')][_0x7307('0x63')],_['omit'](_0x1ee45d[_0x7307('0x47')],[_0x7307('0x63'),'id'])||{});}return null;})[_0x7307('0x8e')](function(_0x528b29){var _0x5574a2;var _0x2fd52b;_0xfa57f8=_0x528b29||[];var _0x452bd4=[];if(_0x528b29){for(var _0x33d957=0x0;_0x33d957<_0x528b29[_0x7307('0x42')];_0x33d957+=0x1){var _0x46d6dd=_0x528b29[_0x33d957][_0x7307('0x24')]({'plain':!![]});_0x5574a2=squel['insert']()[_0x7307('0x67')](_0x7307('0x8f'))[_0x7307('0x69')]([_0x7307('0x6d'),'ContactId',_0x7307('0x6a'),'CampaignId',_0x7307('0x4e'),_0x7307('0x4f')],squel['select']()[_0x7307('0x6c')](_0x7307('0x6d'),_0x7307('0x6d'))['field']('id','ContactId')['field'](_0x46d6dd['CmListId'][_0x7307('0x72')](),_0x7307('0x6a'))[_0x7307('0x6c')](_0x1ee45d[_0x7307('0x3f')]['id'][_0x7307('0x72')](),_0x7307('0x59'))[_0x7307('0x6c')]('NOW()','createdAt')['field'](_0x7307('0x6e'),_0x7307('0x4f'))['from'](_0x7307('0x74'))[_0x7307('0x35')](_0x7307('0x75'))['where']('ListId\x20=\x20?',_0x46d6dd[_0x7307('0x71')][_0x7307('0x72')]())[_0x7307('0x35')](_0x7307('0x77')))[_0x7307('0x72')]();_0x452bd4[_0x7307('0x90')](db[_0x7307('0x88')][_0x7307('0x30')](_0x5574a2));}return BPromise[_0x7307('0x89')](_0x452bd4);}})[_0x7307('0x23')](function(){return _0xfa57f8;})[_0x7307('0x23')](respondWithResult(_0x573bf5,null))[_0x7307('0x45')](handleError(_0x573bf5,null));};exports[_0x7307('0x91')]=function(_0x524e2c,_0x3f0337,_0x433a12){return db[_0x7307('0x3a')][_0x7307('0x44')]({'where':{'id':_0x524e2c[_0x7307('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f0337,null))['then'](function(_0x305342){if(_0x305342){return _0x305342[_0x7307('0x91')](_0x524e2c[_0x7307('0x30')][_0x7307('0x63')]);}})[_0x7307('0x23')](function(_0x43dd22){if(_0x43dd22){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x524e2c[_0x7307('0x30')]['ids'],'CampaignId':_0x524e2c[_0x7307('0x3f')]['id']}})[_0x7307('0x23')](function(){return _0x43dd22;});}})['then'](respondWithStatusCode(_0x3f0337,null))['catch'](handleError(_0x3f0337,null));}; \ No newline at end of file +var _0x1db3=['getLists','CmList','format','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','NOW()','cm_contacts','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','IvrCampaigns','end','error','name','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','params','intersection','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','updatedAt','createdAt','destroy','getHoppers','findOne','CmHopper','nolimit','sort','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack'];(function(_0x34f81a,_0x459c1d){var _0x12ed6f=function(_0x615392){while(--_0x615392){_0x34f81a['push'](_0x34f81a['shift']());}};_0x12ed6f(++_0x459c1d);}(_0x1db3,0x1e5));var _0x31db=function(_0xf23974,_0x22bbd9){_0xf23974=_0xf23974-0x0;var _0x1fb72b=_0x1db3[_0xf23974];return _0x1fb72b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31db('0x0'));var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require(_0x31db('0x3'));var moment=require(_0x31db('0x4'));var BPromise=require(_0x31db('0x5'));var Mustache=require(_0x31db('0x6'));var util=require(_0x31db('0x7'));var path=require(_0x31db('0x8'));var sox=require(_0x31db('0x9'));var csv=require(_0x31db('0xa'));var ejs=require(_0x31db('0xb'));var fs=require('fs');var fs_extra=require(_0x31db('0xc'));var _=require(_0x31db('0xd'));var squel=require(_0x31db('0xe'));var crypto=require(_0x31db('0xf'));var jsforce=require(_0x31db('0x10'));var deskjs=require(_0x31db('0x11'));var toCsv=require(_0x31db('0xa'));var querystring=require('querystring');var Papa=require(_0x31db('0x12'));var Redis=require(_0x31db('0x13'));var authService=require(_0x31db('0x14'));var qs=require(_0x31db('0x15'));var as=require(_0x31db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31db('0x17'))(_0x31db('0x18'));var utils=require(_0x31db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31db('0x1a'));var db=require(_0x31db('0x1b'))['db'];function respondWithStatusCode(_0x1fad0a,_0x1ca88f){_0x1ca88f=_0x1ca88f||0xcc;return function(_0x298707){if(_0x298707){return _0x1fad0a[_0x31db('0x1c')](_0x1ca88f);}return _0x1fad0a['status'](_0x1ca88f)['end']();};}function respondWithResult(_0xc899ba,_0x5706dc){_0x5706dc=_0x5706dc||0xc8;return function(_0x1ccc17){if(_0x1ccc17){return _0xc899ba[_0x31db('0x1d')](_0x5706dc)[_0x31db('0x1e')](_0x1ccc17);}};}function respondWithFilteredResult(_0x2009c7,_0x29f691){return function(_0x4ccb3d){if(_0x4ccb3d){var _0x557907=typeof _0x29f691['offset']===_0x31db('0x1f')&&typeof _0x29f691[_0x31db('0x20')]===_0x31db('0x1f');var _0x4dbc05=_0x4ccb3d[_0x31db('0x21')];var _0x1d3218=_0x557907?0x0:_0x29f691[_0x31db('0x22')];var _0x3df86e=_0x557907?_0x4ccb3d[_0x31db('0x21')]:_0x29f691[_0x31db('0x22')]+_0x29f691[_0x31db('0x20')];var _0x53ca16;if(_0x3df86e>=_0x4dbc05){_0x3df86e=_0x4dbc05;_0x53ca16=0xc8;}else{_0x53ca16=0xce;}_0x2009c7[_0x31db('0x1d')](_0x53ca16);return _0x2009c7['set']('Content-Range',_0x1d3218+'-'+_0x3df86e+'/'+_0x4dbc05)[_0x31db('0x1e')](_0x4ccb3d);}return null;};}function patchUpdates(_0x1915ec){return function(_0x168002){try{jsonpatch[_0x31db('0x23')](_0x168002,_0x1915ec,!![]);}catch(_0x211e59){return BPromise[_0x31db('0x24')](_0x211e59);}return _0x168002[_0x31db('0x25')]();};}function saveUpdates(_0x98ce70,_0x204781){return function(_0x1f00f7){if(_0x1f00f7){return _0x1f00f7[_0x31db('0x26')](_0x98ce70)[_0x31db('0x27')](function(_0x5574e5){return _0x5574e5;});}return null;};}function removeEntity(_0x358d1d,_0x335cc9){return function(_0x303cf4){if(_0x303cf4){return _0x303cf4['destroy']()[_0x31db('0x27')](function(){var _0x54d623=_0x303cf4['get']({'plain':!![]});var _0x2ea3a6=_0x31db('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2ea3a6,'resourceId':_0x54d623['id']}})['then'](function(){return _0x303cf4;});})[_0x31db('0x27')](function(){_0x358d1d['status'](0xcc)[_0x31db('0x29')]();});}};}function handleEntityNotFound(_0xe10c6a,_0x1f3355){return function(_0x3effc4){if(!_0x3effc4){_0xe10c6a[_0x31db('0x1c')](0x194);}return _0x3effc4;};}function handleError(_0xb969fe,_0x2e1c2d){_0x2e1c2d=_0x2e1c2d||0x1f4;return function(_0x19d079){logger[_0x31db('0x2a')](_0x19d079['stack']);if(_0x19d079[_0x31db('0x2b')]){delete _0x19d079[_0x31db('0x2b')];}_0xb969fe['status'](_0x2e1c2d)['send'](_0x19d079);};}exports[_0x31db('0x2c')]=function(_0x5f256c,_0x5e29e4){var _0x5a6368={},_0x260d00={},_0x2d5e49={'count':0x0,'rows':[]};var _0x5e3867=_[_0x31db('0x2d')](db['Campaign']['rawAttributes'],function(_0x2a41c9){return{'name':_0x2a41c9[_0x31db('0x2e')],'type':_0x2a41c9[_0x31db('0x2f')]['key']};});_0x260d00['model']=_[_0x31db('0x2d')](_0x5e3867,_0x31db('0x2b'));_0x260d00[_0x31db('0x30')]=_[_0x31db('0x31')](_0x5f256c[_0x31db('0x30')]);_0x260d00['filters']=_['intersection'](_0x260d00[_0x31db('0x32')],_0x260d00['query']);_0x5a6368[_0x31db('0x33')]=_['intersection'](_0x260d00[_0x31db('0x32')],qs[_0x31db('0x34')](_0x5f256c[_0x31db('0x30')][_0x31db('0x34')]));_0x5a6368['attributes']=_0x5a6368[_0x31db('0x33')][_0x31db('0x35')]?_0x5a6368['attributes']:_0x260d00['model'];if(!_0x5f256c[_0x31db('0x30')][_0x31db('0x36')]('nolimit')){_0x5a6368['limit']=qs[_0x31db('0x20')](_0x5f256c[_0x31db('0x30')][_0x31db('0x20')]);_0x5a6368[_0x31db('0x22')]=qs['offset'](_0x5f256c[_0x31db('0x30')][_0x31db('0x22')]);}_0x5a6368[_0x31db('0x37')]=qs['sort'](_0x5f256c[_0x31db('0x30')]['sort']);_0x5a6368[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x5f256c[_0x31db('0x30')],_0x260d00['filters']),_0x5e3867);if(_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]){_0x5a6368[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5a6368['where'],{'$or':_[_0x31db('0x2d')](_0x5e3867,function(_0x26f071){if(_0x26f071[_0x31db('0x2f')]!==_0x31db('0x3d')){var _0x55714d={};_0x55714d[_0x26f071[_0x31db('0x2b')]]={'$like':'%'+_0x5f256c[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x55714d;}})});}_0x5a6368=_[_0x31db('0x3c')]({},_0x5a6368,_0x5f256c[_0x31db('0x3e')]);var _0x97e7f7={'where':_0x5a6368[_0x31db('0x38')]};return db[_0x31db('0x3f')][_0x31db('0x21')](_0x97e7f7)[_0x31db('0x27')](function(_0x21e693){_0x2d5e49['count']=_0x21e693;if(_0x5f256c[_0x31db('0x30')][_0x31db('0x40')]){_0x5a6368[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x3f')][_0x31db('0x42')](_0x5a6368);})[_0x31db('0x27')](function(_0x17d9b8){_0x2d5e49['rows']=_0x17d9b8;return _0x2d5e49;})[_0x31db('0x27')](respondWithFilteredResult(_0x5e29e4,_0x5a6368))[_0x31db('0x43')](handleError(_0x5e29e4,null));};exports['show']=function(_0xe9d1fa,_0x5aa2b2){var _0x15a21c={'raw':![],'where':{'id':_0xe9d1fa[_0x31db('0x44')]['id']}},_0x242304={};_0x242304['model']=_[_0x31db('0x31')](db[_0x31db('0x3f')]['rawAttributes']);_0x242304[_0x31db('0x30')]=_[_0x31db('0x31')](_0xe9d1fa[_0x31db('0x30')]);_0x242304[_0x31db('0x39')]=_[_0x31db('0x45')](_0x242304[_0x31db('0x32')],_0x242304[_0x31db('0x30')]);_0x15a21c[_0x31db('0x33')]=_['intersection'](_0x242304[_0x31db('0x32')],qs[_0x31db('0x34')](_0xe9d1fa[_0x31db('0x30')][_0x31db('0x34')]));_0x15a21c[_0x31db('0x33')]=_0x15a21c['attributes']['length']?_0x15a21c[_0x31db('0x33')]:_0x242304[_0x31db('0x32')];if(_0xe9d1fa[_0x31db('0x30')][_0x31db('0x40')]){_0x15a21c[_0x31db('0x41')]=[{'all':!![]}];}_0x15a21c=_[_0x31db('0x3c')]({},_0x15a21c,_0xe9d1fa[_0x31db('0x3e')]);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x15a21c)[_0x31db('0x27')](handleEntityNotFound(_0x5aa2b2,null))['then'](respondWithResult(_0x5aa2b2,null))[_0x31db('0x43')](handleError(_0x5aa2b2,null));};exports[_0x31db('0x47')]=function(_0xd9b947,_0x180021){return db[_0x31db('0x3f')][_0x31db('0x47')](_0xd9b947[_0x31db('0x48')],{})[_0x31db('0x27')](function(_0x496d40){var _0x21998d=_0xd9b947['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x21998d)throw new Error(_0x31db('0x4a'));if(_0x21998d[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x4f861b=_0x496d40['get']({'plain':!![]});var _0x55db42=_0x31db('0x28');return db[_0x31db('0x4d')][_0x31db('0x46')]({'where':{'name':_0x55db42,'userProfileId':_0x21998d[_0x31db('0x4e')]},'raw':!![]})['then'](function(_0x31b324){if(_0x31b324&&_0x31b324[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x4f861b[_0x31db('0x2b')],'resourceId':_0x4f861b['id'],'type':_0x31b324['name'],'sectionId':_0x31b324['id']},{})[_0x31db('0x27')](function(){return _0x496d40;});}else{return _0x496d40;}})[_0x31db('0x43')](function(_0x51fe21){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x51fe21);throw _0x51fe21;});}return _0x496d40;})['then'](respondWithResult(_0x180021,0xc9))[_0x31db('0x43')](handleError(_0x180021,null));};exports['clone']=function(_0x919425,_0x31a1a8){var _0x5d0ff1={'where':{'id':_0x919425['params']['id']}},_0x3e6733={};_0x3e6733[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x3f')][_0x31db('0x52')]);_0x5d0ff1[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3e6733[_0x31db('0x32')],qs[_0x31db('0x34')](_0x919425['query'][_0x31db('0x34')]));_0x5d0ff1[_0x31db('0x33')]=_0x5d0ff1[_0x31db('0x33')][_0x31db('0x35')]?_0x5d0ff1[_0x31db('0x33')]:_0x3e6733[_0x31db('0x32')];if(_0x919425[_0x31db('0x30')][_0x31db('0x40')]){_0x5d0ff1['include']=[{'all':!![]}];}_0x5d0ff1=_[_0x31db('0x3c')]({},_0x5d0ff1,_0x919425['options']);return db[_0x31db('0x3f')][_0x31db('0x46')](_0x5d0ff1)[_0x31db('0x27')](handleEntityNotFound(_0x31a1a8,null))[_0x31db('0x27')](function(_0x23e416){if(_0x23e416){var _0x3479b6=_0x23e416[_0x31db('0x49')]({'plain':!![]});_0x3479b6=qs[_0x31db('0x53')](_0x3479b6,['id','createdAt',_0x31db('0x54')]);_0x919425['body']=_[_0x31db('0x53')](_0x919425[_0x31db('0x48')],['id',_0x31db('0x55'),_0x31db('0x54')]);return db[_0x31db('0x3f')][_0x31db('0x47')](_[_0x31db('0x3c')](_0x3479b6,_0x919425[_0x31db('0x48')]),{'include':_0x919425[_0x31db('0x30')][_0x31db('0x40')]?[{'all':!![]}]:undefined})[_0x31db('0x27')](function(_0x4ced2f){var _0x1e8777=_0x919425['user'][_0x31db('0x49')]({'plain':!![]});if(!_0x1e8777)throw new Error(_0x31db('0x4a'));if(_0x1e8777[_0x31db('0x4b')]===_0x31db('0x4c')){var _0x10045a=_0x4ced2f[_0x31db('0x49')]({'plain':!![]});var _0x25f94c=_0x31db('0x28');return db['UserProfileSection'][_0x31db('0x46')]({'where':{'name':_0x25f94c,'userProfileId':_0x1e8777['userProfileId']},'raw':!![]})[_0x31db('0x27')](function(_0x5d448b){if(_0x5d448b&&_0x5d448b[_0x31db('0x4f')]===0x0){return db[_0x31db('0x50')]['create']({'name':_0x10045a[_0x31db('0x2b')],'resourceId':_0x10045a['id'],'type':_0x5d448b[_0x31db('0x2b')],'sectionId':_0x5d448b['id']},{})[_0x31db('0x27')](function(){return _0x4ced2f;});}else{return _0x4ced2f;}})[_0x31db('0x43')](function(_0x166d49){logger[_0x31db('0x2a')](_0x31db('0x51'),_0x166d49);throw _0x166d49;});}return _0x4ced2f;});}})[_0x31db('0x27')](respondWithResult(_0x31a1a8,0xc9))[_0x31db('0x43')](handleError(_0x31a1a8,null));};exports[_0x31db('0x26')]=function(_0x1526af,_0x54d3a0){if(_0x1526af[_0x31db('0x48')]['id']){delete _0x1526af[_0x31db('0x48')]['id'];}return db['Campaign'][_0x31db('0x46')]({'where':{'id':_0x1526af[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d3a0,null))[_0x31db('0x27')](saveUpdates(_0x1526af['body'],null))[_0x31db('0x27')](respondWithResult(_0x54d3a0,null))[_0x31db('0x43')](handleError(_0x54d3a0,null));};exports[_0x31db('0x56')]=function(_0x41179a,_0x2aafcd){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x41179a['params']['id']}})['then'](handleEntityNotFound(_0x2aafcd,null))['then'](removeEntity(_0x2aafcd,null))['catch'](handleError(_0x2aafcd,null));};exports[_0x31db('0x57')]=function(_0x225144,_0x1ab4c0,_0x374bd4){var _0x46c678={'raw':!![],'where':{}};var _0x21e3cf={};var _0x38cc83={'count':0x0,'rows':[]};return db['Campaign'][_0x31db('0x58')]({'where':{'id':_0x225144[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1ab4c0,null))[_0x31db('0x27')](function(_0x3ccf4c){if(_0x3ccf4c){_0x21e3cf['model']=_['keys'](db[_0x31db('0x59')][_0x31db('0x52')]);_0x21e3cf[_0x31db('0x30')]=_[_0x31db('0x31')](_0x225144[_0x31db('0x30')]);_0x21e3cf[_0x31db('0x39')]=_['intersection'](_0x21e3cf['model'],_0x21e3cf[_0x31db('0x30')]);_0x46c678[_0x31db('0x33')]=_[_0x31db('0x45')](_0x21e3cf['model'],qs[_0x31db('0x34')](_0x225144[_0x31db('0x30')][_0x31db('0x34')]));_0x46c678[_0x31db('0x33')]=_0x46c678[_0x31db('0x33')][_0x31db('0x35')]?_0x46c678['attributes']:_0x21e3cf['model'];if(!_0x225144[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x46c678['limit']=qs[_0x31db('0x20')](_0x225144[_0x31db('0x30')][_0x31db('0x20')]);_0x46c678[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x225144[_0x31db('0x30')]['offset']);}_0x46c678[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x225144[_0x31db('0x30')][_0x31db('0x5b')]);_0x46c678[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x225144[_0x31db('0x30')],_0x21e3cf[_0x31db('0x39')]));_0x46c678[_0x31db('0x38')]['CampaignId']=_0x3ccf4c['id'];if(_0x225144[_0x31db('0x30')][_0x31db('0x3b')]){_0x46c678['where']=_[_0x31db('0x3c')](_0x46c678[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x46c678[_0x31db('0x33')],function(_0x4aaa1f){var _0x189595={};_0x189595[_0x4aaa1f]={'$like':'%'+_0x225144['query'][_0x31db('0x3b')]+'%'};return _0x189595;})});}_0x46c678=_['merge']({},_0x46c678,_0x225144['options']);return db[_0x31db('0x59')][_0x31db('0x21')]({'where':_0x46c678['where']})[_0x31db('0x27')](function(_0x409b2d){_0x38cc83[_0x31db('0x21')]=_0x409b2d;if(_0x225144[_0x31db('0x30')][_0x31db('0x40')]){_0x46c678[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x59')][_0x31db('0x42')](_0x46c678);})[_0x31db('0x27')](function(_0x1e756d){_0x38cc83[_0x31db('0x5c')]=_0x1e756d;return _0x38cc83;});}})['then'](respondWithFilteredResult(_0x1ab4c0,_0x46c678))[_0x31db('0x43')](handleError(_0x1ab4c0,null));};exports[_0x31db('0x5d')]=function(_0x14a76c,_0x19b391,_0x6a0b03){var _0x1a443a={'raw':!![],'where':{}};var _0x58e645={};var _0x392886={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x14a76c[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x19b391,null))[_0x31db('0x27')](function(_0xa86607){if(_0xa86607){_0x58e645[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5e')][_0x31db('0x52')]);_0x58e645[_0x31db('0x30')]=_[_0x31db('0x31')](_0x14a76c[_0x31db('0x30')]);_0x58e645[_0x31db('0x39')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],_0x58e645[_0x31db('0x30')]);_0x1a443a[_0x31db('0x33')]=_[_0x31db('0x45')](_0x58e645[_0x31db('0x32')],qs[_0x31db('0x34')](_0x14a76c[_0x31db('0x30')][_0x31db('0x34')]));_0x1a443a[_0x31db('0x33')]=_0x1a443a[_0x31db('0x33')]['length']?_0x1a443a[_0x31db('0x33')]:_0x58e645['model'];if(!_0x14a76c['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x1a443a[_0x31db('0x20')]=qs['limit'](_0x14a76c[_0x31db('0x30')][_0x31db('0x20')]);_0x1a443a['offset']=qs['offset'](_0x14a76c['query'][_0x31db('0x22')]);}_0x1a443a[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x14a76c[_0x31db('0x30')][_0x31db('0x5b')]);_0x1a443a[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0x14a76c['query'],_0x58e645['filters']));_0x1a443a['where']['CampaignId']=_0xa86607['id'];if(_0x14a76c[_0x31db('0x30')]['filter']){_0x1a443a[_0x31db('0x38')]=_['merge'](_0x1a443a['where'],{'$or':_[_0x31db('0x2d')](_0x1a443a['attributes'],function(_0x2b69eb){var _0xe520e8={};_0xe520e8[_0x2b69eb]={'$like':'%'+_0x14a76c[_0x31db('0x30')]['filter']+'%'};return _0xe520e8;})});}_0x1a443a=_['merge']({},_0x1a443a,_0x14a76c['options']);return db[_0x31db('0x5e')][_0x31db('0x21')]({'where':_0x1a443a[_0x31db('0x38')]})[_0x31db('0x27')](function(_0xe9f99d){_0x392886['count']=_0xe9f99d;if(_0x14a76c[_0x31db('0x30')][_0x31db('0x40')]){_0x1a443a[_0x31db('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x31db('0x42')](_0x1a443a);})[_0x31db('0x27')](function(_0xb1be21){_0x392886[_0x31db('0x5c')]=_0xb1be21;return _0x392886;});}})[_0x31db('0x27')](respondWithFilteredResult(_0x19b391,_0x1a443a))[_0x31db('0x43')](handleError(_0x19b391,null));};exports['getHopperFinals']=function(_0x148410,_0x3a6dd2,_0x4d8f7e){var _0x5e12a7={'raw':!![],'where':{}};var _0x5364c3={};var _0x4f05b0={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x148410[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x3a6dd2,null))[_0x31db('0x27')](function(_0x2fc070){if(_0x2fc070){_0x5364c3[_0x31db('0x32')]=_[_0x31db('0x31')](db[_0x31db('0x5f')][_0x31db('0x52')]);_0x5364c3[_0x31db('0x30')]=_[_0x31db('0x31')](_0x148410[_0x31db('0x30')]);_0x5364c3[_0x31db('0x39')]=_[_0x31db('0x45')](_0x5364c3['model'],_0x5364c3[_0x31db('0x30')]);_0x5e12a7[_0x31db('0x33')]=_['intersection'](_0x5364c3[_0x31db('0x32')],qs[_0x31db('0x34')](_0x148410[_0x31db('0x30')][_0x31db('0x34')]));_0x5e12a7[_0x31db('0x33')]=_0x5e12a7[_0x31db('0x33')]['length']?_0x5e12a7[_0x31db('0x33')]:_0x5364c3[_0x31db('0x32')];if(!_0x148410['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x5e12a7[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x148410['query'][_0x31db('0x20')]);_0x5e12a7['offset']=qs['offset'](_0x148410[_0x31db('0x30')]['offset']);}_0x5e12a7[_0x31db('0x37')]=qs['sort'](_0x148410[_0x31db('0x30')][_0x31db('0x5b')]);_0x5e12a7[_0x31db('0x38')]=qs['filters'](_[_0x31db('0x3a')](_0x148410[_0x31db('0x30')],_0x5364c3[_0x31db('0x39')]));_0x5e12a7[_0x31db('0x38')][_0x31db('0x60')]=_0x2fc070['id'];if(_0x148410[_0x31db('0x30')][_0x31db('0x3b')]){_0x5e12a7[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x5e12a7[_0x31db('0x38')],{'$or':_['map'](_0x5e12a7[_0x31db('0x33')],function(_0x22c5ec){var _0x4262e2={};_0x4262e2[_0x22c5ec]={'$like':'%'+_0x148410[_0x31db('0x30')][_0x31db('0x3b')]+'%'};return _0x4262e2;})});}_0x5e12a7=_[_0x31db('0x3c')]({},_0x5e12a7,_0x148410['options']);return db[_0x31db('0x5f')][_0x31db('0x21')]({'where':_0x5e12a7['where']})[_0x31db('0x27')](function(_0x25fce6){_0x4f05b0[_0x31db('0x21')]=_0x25fce6;if(_0x148410[_0x31db('0x30')]['includeAll']){_0x5e12a7[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x5f')]['findAll'](_0x5e12a7);})['then'](function(_0x355654){_0x4f05b0[_0x31db('0x5c')]=_0x355654;return _0x4f05b0;});}})['then'](respondWithFilteredResult(_0x3a6dd2,_0x5e12a7))[_0x31db('0x43')](handleError(_0x3a6dd2,null));};exports[_0x31db('0x61')]=function(_0x45adac,_0x423767,_0xeb01e3){var _0x269328={'raw':!![],'where':{}};var _0x347532={};var _0x180c15={'count':0x0,'rows':[]};return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x45adac[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0x423767,null))[_0x31db('0x27')](function(_0x481a5c){if(_0x481a5c){_0x347532['model']=_[_0x31db('0x31')](db[_0x31db('0x62')][_0x31db('0x52')]);_0x347532[_0x31db('0x30')]=_[_0x31db('0x31')](_0x45adac['query']);_0x347532[_0x31db('0x39')]=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],_0x347532[_0x31db('0x30')]);_0x269328['attributes']=_[_0x31db('0x45')](_0x347532[_0x31db('0x32')],qs[_0x31db('0x34')](_0x45adac['query'][_0x31db('0x34')]));_0x269328[_0x31db('0x33')]=_0x269328[_0x31db('0x33')][_0x31db('0x35')]?_0x269328[_0x31db('0x33')]:_0x347532['model'];if(!_0x45adac[_0x31db('0x30')][_0x31db('0x36')](_0x31db('0x5a'))){_0x269328[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x45adac[_0x31db('0x30')][_0x31db('0x20')]);_0x269328[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x45adac[_0x31db('0x30')][_0x31db('0x22')]);}_0x269328['order']=qs[_0x31db('0x5b')](_0x45adac['query'][_0x31db('0x5b')]);_0x269328[_0x31db('0x38')]=qs['filters'](_['pick'](_0x45adac[_0x31db('0x30')],_0x347532[_0x31db('0x39')]));_0x269328[_0x31db('0x38')]['CampaignId']=_0x481a5c['id'];if(_0x45adac[_0x31db('0x30')][_0x31db('0x3b')]){_0x269328[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x269328['where'],{'$or':_[_0x31db('0x2d')](_0x269328[_0x31db('0x33')],function(_0xaf54dc){var _0x114943={};_0x114943[_0xaf54dc]={'$like':'%'+_0x45adac[_0x31db('0x30')]['filter']+'%'};return _0x114943;})});}_0x269328=_[_0x31db('0x3c')]({},_0x269328,_0x45adac[_0x31db('0x3e')]);return db[_0x31db('0x62')][_0x31db('0x21')]({'where':_0x269328['where']})[_0x31db('0x27')](function(_0x1f7b90){_0x180c15[_0x31db('0x21')]=_0x1f7b90;if(_0x45adac[_0x31db('0x30')][_0x31db('0x40')]){_0x269328[_0x31db('0x41')]=[{'all':!![]}];}return db[_0x31db('0x62')][_0x31db('0x42')](_0x269328);})[_0x31db('0x27')](function(_0x3cfe19){_0x180c15[_0x31db('0x5c')]=_0x3cfe19;return _0x180c15;});}})['then'](respondWithFilteredResult(_0x423767,_0x269328))[_0x31db('0x43')](handleError(_0x423767,null));};exports[_0x31db('0x63')]=function(_0xcee621,_0x4430e9,_0x3f15e6){var _0x2bb353={};var _0x4ebd4f={};var _0x1324ee;var _0x5ef744;return db[_0x31db('0x3f')]['findOne']({'where':{'id':_0xcee621[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x4430e9,null))[_0x31db('0x27')](function(_0x1de2d0){if(_0x1de2d0){_0x1324ee=_0x1de2d0;_0x4ebd4f['model']=_[_0x31db('0x31')](db[_0x31db('0x64')][_0x31db('0x52')]);_0x4ebd4f[_0x31db('0x30')]=_[_0x31db('0x31')](_0xcee621[_0x31db('0x30')]);_0x4ebd4f[_0x31db('0x39')]=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],_0x4ebd4f[_0x31db('0x30')]);_0x2bb353['attributes']=_[_0x31db('0x45')](_0x4ebd4f[_0x31db('0x32')],qs[_0x31db('0x34')](_0xcee621[_0x31db('0x30')][_0x31db('0x34')]));_0x2bb353[_0x31db('0x33')]=_0x2bb353[_0x31db('0x33')][_0x31db('0x35')]?_0x2bb353[_0x31db('0x33')]:_0x4ebd4f['model'];_0x2bb353[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0xcee621[_0x31db('0x30')][_0x31db('0x5b')]);_0x2bb353[_0x31db('0x38')]=qs[_0x31db('0x39')](_[_0x31db('0x3a')](_0xcee621[_0x31db('0x30')],_0x4ebd4f[_0x31db('0x39')]));if(_0xcee621[_0x31db('0x30')]['filter']){_0x2bb353[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x2bb353['where'],{'$or':_['map'](_0x2bb353[_0x31db('0x33')],function(_0x1043d5){var _0x15cde6={};_0x15cde6[_0x1043d5]={'$like':'%'+_0xcee621[_0x31db('0x30')]['filter']+'%'};return _0x15cde6;})});}_0x2bb353=_['merge']({},_0x2bb353,_0xcee621['options']);return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x377ac1){if(_0x377ac1){_0x5ef744=_0x377ac1[_0x31db('0x35')];if(!_0xcee621[_0x31db('0x30')]['hasOwnProperty'](_0x31db('0x5a'))){_0x2bb353[_0x31db('0x20')]=qs[_0x31db('0x20')](_0xcee621[_0x31db('0x30')][_0x31db('0x20')]);_0x2bb353[_0x31db('0x22')]=qs['offset'](_0xcee621[_0x31db('0x30')][_0x31db('0x22')]);}return _0x1324ee[_0x31db('0x63')](_0x2bb353);}})[_0x31db('0x27')](function(_0x160775){if(_0x160775){return _0x160775?{'count':_0x5ef744,'rows':_0x160775}:null;}})[_0x31db('0x27')](respondWithResult(_0x4430e9,null))[_0x31db('0x43')](handleError(_0x4430e9,null));};exports['addLists']=function(_0x21dfa2,_0x55354e,_0x2f7746){var _0x27ab95,_0xd418fe;var _0x1376dd=[];var _0x1fdb48=moment()[_0x31db('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')]['find']({'where':{'id':_0x21dfa2['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x55354e,null))[_0x31db('0x27')](function(_0x17def){if(_0x17def){_0xd418fe=_0x17def;return _0x17def[_0x31db('0x66')](_0x21dfa2['body'][_0x31db('0x67')],_[_0x31db('0x53')](_0x21dfa2['body'],[_0x31db('0x67'),'id'])||{});}return null;})['spread'](function(_0x186f56){var _0x24dc7f;var _0x30ad4c;_0x27ab95=_0x186f56||[];var _0x3ebfe3=[];if(_0x186f56){for(var _0x41849c=0x0;_0x41849c<_0x186f56[_0x31db('0x35')];_0x41849c+=0x1){var _0x3d90db=_0x186f56[_0x41849c]['get']({'plain':!![]});_0xd418fe[_0x31db('0x68')]=_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]?_0x21dfa2[_0x31db('0x48')][_0x31db('0x68')]:_0xd418fe[_0x31db('0x68')];switch(_0xd418fe['dialCheckDuplicateType']){case'always':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery']([_0x31db('0x6c'),_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt','updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))['from']('cm_contacts')[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x31db('0x77')](_0x31db('0x78'))[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]()))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')[_0x31db('0x38')](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;case'onlyIfOpen':_0x24dc7f=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x6b'))['fromQuery'](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),'createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x6c'),_0x31db('0x6c'))[_0x31db('0x71')](_0x31db('0x7b'),'scheduledAt')[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db[_0x31db('0x72')][_0x31db('0x73')](),_0x31db('0x6f'))['field'](_0x21dfa2[_0x31db('0x44')]['id']['toString'](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')]('ListId\x20=\x20?',_0x3d90db[_0x31db('0x72')]['toString']())[_0x31db('0x38')](_0x31db('0x75'))[_0x31db('0x38')](_0x31db('0x76'),squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x7a'))[_0x31db('0x77')]('cm_hopper')['where'](_0x31db('0x79'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())))['toString']();break;default:_0x24dc7f=squel['insert']()[_0x31db('0x6a')]('cm_hopper')[_0x31db('0x7d')](['phone',_0x31db('0x6d'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('NOW()',_0x31db('0x6d'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x3d90db['CmListId'][_0x31db('0x73')](),'ListId')['field'](_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27','createdAt')['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))['where'](_0x31db('0x7e'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();}_0x30ad4c=squel['insert']()[_0x31db('0x6a')](_0x31db('0x7f'))[_0x31db('0x7d')](['cmHopperId',_0x31db('0x6d'),_0x31db('0x6c'),'OrderBy','createdAt',_0x31db('0x54')],squel[_0x31db('0x70')]()[_0x31db('0x71')](_0x31db('0x80'),'id')[_0x31db('0x71')]('NOW()','scheduledAt')[_0x31db('0x71')](_0x31db('0x81'),_0x31db('0x6c'))[_0x31db('0x71')]('ci.OrderBY',_0x31db('0x82'))['field']('\x27'+_0x1fdb48+'\x27',_0x31db('0x55'))[_0x31db('0x71')]('\x27'+_0x1fdb48+'\x27',_0x31db('0x54'))[_0x31db('0x77')](_0x31db('0x83'),'ci')[_0x31db('0x84')](_0x31db('0x6b'),'h',_0x31db('0x85'))[_0x31db('0x38')](_0x31db('0x86'),_0x3d90db[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x87'),_0x21dfa2[_0x31db('0x44')]['id'][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x88'),_0x1fdb48))[_0x31db('0x73')]();_0x3ebfe3[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x24dc7f));_0x1376dd[_0x31db('0x89')](db[_0x31db('0x8a')][_0x31db('0x30')](_0x30ad4c));}return BPromise[_0x31db('0x8b')](_0x3ebfe3);}})[_0x31db('0x27')](function(){return BPromise[_0x31db('0x8b')](_0x1376dd);})[_0x31db('0x27')](function(){return _0x27ab95;})[_0x31db('0x27')](respondWithResult(_0x55354e,null))['catch'](handleError(_0x55354e,null));};exports[_0x31db('0x8c')]=function(_0x5965e1,_0x5ba364,_0x1222b8){return db[_0x31db('0x3f')]['find']({'where':{'id':_0x5965e1['params']['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x5ba364,null))[_0x31db('0x27')](function(_0x4e534e){if(_0x4e534e){return _0x4e534e[_0x31db('0x8c')](_0x5965e1['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x901a92){if(_0x901a92){return db['CmHopper'][_0x31db('0x56')]({'where':{'ListId':_0x5965e1[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x5965e1[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x901a92;});}})[_0x31db('0x27')](respondWithStatusCode(_0x5ba364,null))['catch'](handleError(_0x5ba364,null));};exports['getBlackLists']=function(_0x289317,_0x1311cb,_0x45f527){var _0x13c2c0={};var _0x3481b1={};var _0x8df891;var _0x1e7170;return db[_0x31db('0x3f')][_0x31db('0x58')]({'where':{'id':_0x289317[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x1311cb,null))[_0x31db('0x27')](function(_0x58a966){if(_0x58a966){_0x8df891=_0x58a966;_0x3481b1[_0x31db('0x32')]=_[_0x31db('0x31')](db['CmList'][_0x31db('0x52')]);_0x3481b1[_0x31db('0x30')]=_[_0x31db('0x31')](_0x289317['query']);_0x3481b1[_0x31db('0x39')]=_[_0x31db('0x45')](_0x3481b1['model'],_0x3481b1[_0x31db('0x30')]);_0x13c2c0[_0x31db('0x33')]=_[_0x31db('0x45')](_0x3481b1['model'],qs[_0x31db('0x34')](_0x289317[_0x31db('0x30')][_0x31db('0x34')]));_0x13c2c0['attributes']=_0x13c2c0[_0x31db('0x33')]['length']?_0x13c2c0[_0x31db('0x33')]:_0x3481b1['model'];_0x13c2c0[_0x31db('0x37')]=qs[_0x31db('0x5b')](_0x289317[_0x31db('0x30')]['sort']);_0x13c2c0['where']=qs[_0x31db('0x39')](_['pick'](_0x289317[_0x31db('0x30')],_0x3481b1[_0x31db('0x39')]));if(_0x289317[_0x31db('0x30')]['filter']){_0x13c2c0[_0x31db('0x38')]=_[_0x31db('0x3c')](_0x13c2c0[_0x31db('0x38')],{'$or':_[_0x31db('0x2d')](_0x13c2c0[_0x31db('0x33')],function(_0x1db46f){var _0x54786f={};_0x54786f[_0x1db46f]={'$like':'%'+_0x289317['query']['filter']+'%'};return _0x54786f;})});}_0x13c2c0=_['merge']({},_0x13c2c0,_0x289317[_0x31db('0x3e')]);return _0x8df891[_0x31db('0x8d')](_0x13c2c0);}})[_0x31db('0x27')](function(_0x1fab25){if(_0x1fab25){_0x1e7170=_0x1fab25[_0x31db('0x35')];if(!_0x289317['query'][_0x31db('0x36')](_0x31db('0x5a'))){_0x13c2c0[_0x31db('0x20')]=qs['limit'](_0x289317['query'][_0x31db('0x20')]);_0x13c2c0[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x289317[_0x31db('0x30')][_0x31db('0x22')]);}return _0x8df891['getBlackLists'](_0x13c2c0);}})[_0x31db('0x27')](function(_0x35e245){if(_0x35e245){return _0x35e245?{'count':_0x1e7170,'rows':_0x35e245}:null;}})[_0x31db('0x27')](respondWithResult(_0x1311cb,null))[_0x31db('0x43')](handleError(_0x1311cb,null));};exports[_0x31db('0x8e')]=function(_0x4962ea,_0x372e0c,_0x4ddd13){var _0x3e3cf2,_0xcf6abf;var _0x3299c3=[];var _0xcd46dd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x4962ea[_0x31db('0x44')]['id']}})[_0x31db('0x27')](handleEntityNotFound(_0x372e0c,null))[_0x31db('0x27')](function(_0x771fd7){if(_0x771fd7){_0xcf6abf=_0x771fd7;return _0x771fd7[_0x31db('0x8e')](_0x4962ea[_0x31db('0x48')][_0x31db('0x67')],_[_0x31db('0x53')](_0x4962ea[_0x31db('0x48')],[_0x31db('0x67'),'id'])||{});}return null;})[_0x31db('0x8f')](function(_0x2f19bd){var _0x44f158;var _0x400a14;_0x3e3cf2=_0x2f19bd||[];var _0x317990=[];if(_0x2f19bd){for(var _0x33c0b6=0x0;_0x33c0b6<_0x2f19bd[_0x31db('0x35')];_0x33c0b6+=0x1){var _0x131942=_0x2f19bd[_0x33c0b6][_0x31db('0x49')]({'plain':!![]});_0x44f158=squel[_0x31db('0x69')]()[_0x31db('0x6a')](_0x31db('0x90'))[_0x31db('0x7d')]([_0x31db('0x6c'),_0x31db('0x6e'),_0x31db('0x6f'),_0x31db('0x60'),_0x31db('0x55'),'updatedAt'],squel[_0x31db('0x70')]()[_0x31db('0x71')]('phone',_0x31db('0x6c'))[_0x31db('0x71')]('id',_0x31db('0x6e'))[_0x31db('0x71')](_0x131942['CmListId'][_0x31db('0x73')](),_0x31db('0x6f'))[_0x31db('0x71')](_0x4962ea['params']['id'][_0x31db('0x73')](),_0x31db('0x60'))[_0x31db('0x71')](_0x31db('0x7b'),'createdAt')[_0x31db('0x71')](_0x31db('0x7b'),'updatedAt')['from'](_0x31db('0x7c'))[_0x31db('0x38')](_0x31db('0x74'))[_0x31db('0x38')](_0x31db('0x7e'),_0x131942[_0x31db('0x72')][_0x31db('0x73')]())[_0x31db('0x38')](_0x31db('0x75')))[_0x31db('0x73')]();_0x317990[_0x31db('0x89')](db['sequelize'][_0x31db('0x30')](_0x44f158));}return BPromise[_0x31db('0x8b')](_0x317990);}})[_0x31db('0x27')](function(){return _0x3e3cf2;})[_0x31db('0x27')](respondWithResult(_0x372e0c,null))[_0x31db('0x43')](handleError(_0x372e0c,null));};exports[_0x31db('0x91')]=function(_0x3839be,_0xb2967d,_0x378b96){return db[_0x31db('0x3f')][_0x31db('0x46')]({'where':{'id':_0x3839be[_0x31db('0x44')]['id']}})['then'](handleEntityNotFound(_0xb2967d,null))[_0x31db('0x27')](function(_0x459193){if(_0x459193){return _0x459193['removeBlackLists'](_0x3839be['query'][_0x31db('0x67')]);}})[_0x31db('0x27')](function(_0x26c21d){if(_0x26c21d){return db[_0x31db('0x62')][_0x31db('0x56')]({'where':{'ListId':_0x3839be[_0x31db('0x30')][_0x31db('0x67')],'CampaignId':_0x3839be[_0x31db('0x44')]['id']}})[_0x31db('0x27')](function(){return _0x26c21d;});}})[_0x31db('0x27')](respondWithStatusCode(_0xb2967d,null))['catch'](handleError(_0xb2967d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 82842d3..822fd9a 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(_0x178b4e,_0x3810c2){var _0x176a81=function(_0x490fc4){while(--_0x490fc4){_0x178b4e['push'](_0x178b4e['shift']());}};_0x176a81(++_0x3810c2);}(_0x7a54,0x106));var _0x47a5=function(_0x40bc2d,_0x54a2c8){_0x40bc2d=_0x40bc2d-0x0;var _0x114b87=_0x7a54[_0x40bc2d];return _0x114b87;};'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(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5f635b1..dc1ce27 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 _0x6c96=['GetCampaign','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','Campaign','findAll','options','raw','attributes','map','include','model','info'];(function(_0x5e5c2c,_0x4c6068){var _0x318346=function(_0x3ff218){while(--_0x3ff218){_0x5e5c2c['push'](_0x5e5c2c['shift']());}};_0x318346(++_0x4c6068);}(_0x6c96,0x1c1));var _0x66c9=function(_0x1d2e06,_0x2927f8){_0x1d2e06=_0x1d2e06-0x0;var _0x2ef575=_0x6c96[_0x1d2e06];return _0x2ef575;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var moment=require(_0x66c9('0x1'));var BPromise=require(_0x66c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66c9('0x3'));var db=require(_0x66c9('0x4'))['db'];var utils=require(_0x66c9('0x5'));var logger=require(_0x66c9('0x6'))(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var jayson=require(_0x66c9('0x9'));var client=jayson['client'][_0x66c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6baa,_0xb03819,_0x4d7692){return new BPromise(function(_0x55b488,_0xfc41a4){return client[_0x66c9('0xb')](_0x4c6baa,_0x4d7692)[_0x66c9('0xc')](function(_0x2e8ad5){logger['info']('Campaign,\x20%s,\x20%s',_0xb03819,'request\x20sent');logger['debug'](_0x66c9('0xd'),_0xb03819,_0x66c9('0xe'),JSON[_0x66c9('0xf')](_0x2e8ad5));if(_0x2e8ad5['error']){if(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x11')]===0x1f4){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5['error'][_0x66c9('0x13')]);return _0xfc41a4(_0x2e8ad5['error'][_0x66c9('0x13')]);}logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5[_0x66c9('0x10')]['message']);return _0x55b488(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x13')]);}else{logger['info'](_0x66c9('0x12'),_0xb03819,_0x66c9('0xe'));_0x55b488(_0x2e8ad5[_0x66c9('0x14')][_0x66c9('0x13')]);}})[_0x66c9('0x15')](function(_0x14d989){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x14d989);_0xfc41a4(_0x14d989);});});}exports['GetCampaign']=function(_0x11242a){var _0x578245=this;return new Promise(function(_0x4b4a50,_0x30c5fa){return db[_0x66c9('0x16')][_0x66c9('0x17')]({'raw':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x19')]===undefined?!![]:![]:!![],'where':_0x11242a[_0x66c9('0x18')]?_0x11242a['options']['where']||null:null,'attributes':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')][_0x66c9('0x1a')]||null:null,'limit':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['limit']||null:null,'include':_0x11242a[_0x66c9('0x18')]?_0x11242a[_0x66c9('0x18')]['include']?_[_0x66c9('0x1b')](_0x11242a[_0x66c9('0x18')][_0x66c9('0x1c')],function(_0x3f3be1){return{'model':db[_0x3f3be1[_0x66c9('0x1d')]],'as':_0x3f3be1['as'],'attributes':_0x3f3be1[_0x66c9('0x1a')],'include':_0x3f3be1[_0x66c9('0x1c')]?_['map'](_0x3f3be1[_0x66c9('0x1c')],function(_0x5bb599){return{'model':db[_0x5bb599['model']],'as':_0x5bb599['as'],'attributes':_0x5bb599[_0x66c9('0x1a')],'include':_0x5bb599['include']?_[_0x66c9('0x1b')](_0x5bb599['include'],function(_0x95ce9f){return{'model':db[_0x95ce9f['model']],'as':_0x95ce9f['as'],'attributes':_0x95ce9f[_0x66c9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x66c9('0xc')](function(_0x1f9d01){logger[_0x66c9('0x1e')](_0x66c9('0x1f'),_0x11242a);logger['debug'](_0x66c9('0x1f'),_0x11242a,JSON[_0x66c9('0xf')](_0x1f9d01));_0x4b4a50(_0x1f9d01);})[_0x66c9('0x15')](function(_0x1279e5){logger['error'](_0x66c9('0x1f'),_0x1279e5['message'],_0x11242a);_0x30c5fa(_0x578245[_0x66c9('0x10')](0x1f4,_0x1279e5[_0x66c9('0x13')]));});});}; \ No newline at end of file +var _0xe920=['../../config/logger','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','Campaign,\x20%s,\x20%s','result','GetCampaign','Campaign','options','raw','attributes','limit','include','model','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0xe920,0xbe));var _0x0e92=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xe920[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var moment=require(_0x0e92('0x2'));var BPromise=require(_0x0e92('0x3'));var rs=require(_0x0e92('0x4'));var fs=require('fs');var Redis=require(_0x0e92('0x5'));var db=require(_0x0e92('0x6'))['db'];var utils=require(_0x0e92('0x7'));var logger=require(_0x0e92('0x8'))(_0x0e92('0x9'));var config=require('../../config/environment');var jayson=require(_0x0e92('0xa'));var client=jayson['client'][_0x0e92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33a315,_0x2d921f,_0x176c3b){return new BPromise(function(_0x5662dc,_0x3dbc96){return client[_0x0e92('0xc')](_0x33a315,_0x176c3b)[_0x0e92('0xd')](function(_0x129376){logger[_0x0e92('0xe')]('Campaign,\x20%s,\x20%s',_0x2d921f,'request\x20sent');logger['debug'](_0x0e92('0xf'),_0x2d921f,_0x0e92('0x10'),JSON['stringify'](_0x129376));if(_0x129376['error']){if(_0x129376['error'][_0x0e92('0x11')]===0x1f4){logger[_0x0e92('0x12')]('Campaign,\x20%s,\x20%s',_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x3dbc96(_0x129376['error'][_0x0e92('0x13')]);}logger[_0x0e92('0x12')](_0x0e92('0x14'),_0x2d921f,_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);return _0x5662dc(_0x129376[_0x0e92('0x12')][_0x0e92('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x2d921f,_0x0e92('0x10'));_0x5662dc(_0x129376[_0x0e92('0x15')]['message']);}})['catch'](function(_0x424c3a){logger['error'](_0x0e92('0x14'),_0x2d921f,_0x424c3a);_0x3dbc96(_0x424c3a);});});}exports[_0x0e92('0x16')]=function(_0x3316a5){var _0x46aa84=this;return new Promise(function(_0x153002,_0x8f7626){return db[_0x0e92('0x17')]['findAll']({'raw':_0x3316a5[_0x0e92('0x18')]?_0x3316a5['options'][_0x0e92('0x19')]===undefined?!![]:![]:!![],'where':_0x3316a5['options']?_0x3316a5['options']['where']||null:null,'attributes':_0x3316a5[_0x0e92('0x18')]?_0x3316a5['options'][_0x0e92('0x1a')]||null:null,'limit':_0x3316a5['options']?_0x3316a5[_0x0e92('0x18')][_0x0e92('0x1b')]||null:null,'include':_0x3316a5['options']?_0x3316a5[_0x0e92('0x18')][_0x0e92('0x1c')]?_['map'](_0x3316a5[_0x0e92('0x18')]['include'],function(_0x43c54c){return{'model':db[_0x43c54c[_0x0e92('0x1d')]],'as':_0x43c54c['as'],'attributes':_0x43c54c[_0x0e92('0x1a')],'include':_0x43c54c[_0x0e92('0x1c')]?_[_0x0e92('0x1e')](_0x43c54c[_0x0e92('0x1c')],function(_0xc34ae4){return{'model':db[_0xc34ae4[_0x0e92('0x1d')]],'as':_0xc34ae4['as'],'attributes':_0xc34ae4[_0x0e92('0x1a')],'include':_0xc34ae4[_0x0e92('0x1c')]?_['map'](_0xc34ae4[_0x0e92('0x1c')],function(_0x47f156){return{'model':db[_0x47f156['model']],'as':_0x47f156['as'],'attributes':_0x47f156[_0x0e92('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0e92('0xd')](function(_0x5c5cef){logger['info'](_0x0e92('0x16'),_0x3316a5);logger[_0x0e92('0x1f')]('GetCampaign',_0x3316a5,JSON['stringify'](_0x5c5cef));_0x153002(_0x5c5cef);})[_0x0e92('0x20')](function(_0x329c5f){logger[_0x0e92('0x12')](_0x0e92('0x16'),_0x329c5f[_0x0e92('0x13')],_0x3316a5);_0x8f7626(_0x46aa84[_0x0e92('0x12')](0x1f4,_0x329c5f[_0x0e92('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e30b4e5..e947da8 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 _0x1294=['put','update','destroy','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x1294,0xb8));var _0x4129=function(_0x21f8a8,_0x1d7071){_0x21f8a8=_0x21f8a8-0x0;var _0x21d3d5=_0x1294[_0x21f8a8];return _0x21d3d5;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require('connect-timeout');var express=require(_0x4129('0x2'));var router=express[_0x4129('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4129('0x4'));var interaction=require(_0x4129('0x5'));var config=require(_0x4129('0x6'));var controller=require(_0x4129('0x7'));router[_0x4129('0x8')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0xa')]);router[_0x4129('0x8')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0xc')]);router[_0x4129('0x8')]('/:id/hoppers',auth[_0x4129('0x9')](),controller[_0x4129('0xd')]);router[_0x4129('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x4129('0xe')]);router[_0x4129('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x4129('0xf')]);router['get'](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x11')]);router[_0x4129('0x8')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller[_0x4129('0x13')]);router[_0x4129('0x14')]('/',auth[_0x4129('0x9')](),controller[_0x4129('0x15')]);router['post'](_0x4129('0x16'),auth['isAuthenticated'](),controller[_0x4129('0x17')]);router[_0x4129('0x14')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller[_0x4129('0x18')]);router[_0x4129('0x14')](_0x4129('0x12'),auth['isAuthenticated'](),controller[_0x4129('0x19')]);router[_0x4129('0x1a')](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1b')]);router['delete'](_0x4129('0xb'),auth[_0x4129('0x9')](),controller[_0x4129('0x1c')]);router[_0x4129('0x1d')](_0x4129('0x10'),auth[_0x4129('0x9')](),controller['removeLists']);router[_0x4129('0x1d')](_0x4129('0x12'),auth[_0x4129('0x9')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x5fc7=['/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x5fc7[_0x22b8a3];return _0x199a0c;};'use strict';var multer=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var path=require(_0x75fc('0x2'));var timeout=require(_0x75fc('0x3'));var express=require(_0x75fc('0x4'));var router=express[_0x75fc('0x5')]();var fs_extra=require(_0x75fc('0x6'));var auth=require(_0x75fc('0x7'));var interaction=require(_0x75fc('0x8'));var config=require(_0x75fc('0x9'));var controller=require(_0x75fc('0xa'));router[_0x75fc('0xb')]('/',auth['isAuthenticated'](),controller[_0x75fc('0xc')]);router[_0x75fc('0xb')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller[_0x75fc('0xf')]);router[_0x75fc('0xb')](_0x75fc('0x10'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x11')]);router[_0x75fc('0xb')]('/:id/hopper_histories',auth[_0x75fc('0xe')](),controller[_0x75fc('0x12')]);router[_0x75fc('0xb')](_0x75fc('0x13'),auth['isAuthenticated'](),controller[_0x75fc('0x14')]);router[_0x75fc('0xb')](_0x75fc('0x15'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x16')]);router[_0x75fc('0xb')](_0x75fc('0x17'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x75fc('0x18'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x19')]);router[_0x75fc('0x1a')]('/',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1b')]);router[_0x75fc('0x1a')](_0x75fc('0x1c'),auth['isAuthenticated'](),controller[_0x75fc('0x1d')]);router[_0x75fc('0x1a')]('/:id/lists',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1e')]);router['post']('/:id/blacklists',auth[_0x75fc('0xe')](),controller[_0x75fc('0x1f')]);router[_0x75fc('0x20')](_0x75fc('0xd'),auth[_0x75fc('0xe')](),controller[_0x75fc('0x21')]);router['delete'](_0x75fc('0xd'),auth['isAuthenticated'](),controller[_0x75fc('0x22')]);router[_0x75fc('0x23')](_0x75fc('0x17'),auth[_0x75fc('0xe')](),controller['removeLists']);router[_0x75fc('0x23')](_0x75fc('0x18'),auth['isAuthenticated'](),controller[_0x75fc('0x24')]);module[_0x75fc('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 734eff4..470b260 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 _0x9a14=['key','sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x2c3737,_0x20b109){var _0x103a77=function(_0x519d7f){while(--_0x519d7f){_0x2c3737['push'](_0x2c3737['shift']());}};_0x103a77(++_0x20b109);}(_0x9a14,0x1b7));var _0x49a1=function(_0x2a6710,_0x4949c0){_0x2a6710=_0x2a6710-0x0;var _0x88f714=_0x9a14[_0x2a6710];return _0x88f714;};'use strict';var Sequelize=require(_0x49a1('0x0'));module[_0x49a1('0x1')]={'key':{'type':Sequelize[_0x49a1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x49a1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x49a1('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49a1('0x4')](_0x49a1('0x5'));}}}; \ No newline at end of file +var _0xd43a=['STRING','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd43a,0x17d));var _0xad43=function(_0x3291c3,_0x21a8b4){_0x3291c3=_0x3291c3-0x0;var _0xe2af8b=_0xd43a[_0x3291c3];return _0xe2af8b;};'use strict';var Sequelize=require(_0xad43('0x0'));module[_0xad43('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xad43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xad43('0x3')]},'name':{'type':Sequelize[_0xad43('0x4')],'get':function(){return this[_0xad43('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f228829..3f2f561 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 _0x8cb7=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x43a929,_0x4b70a6){var _0x394281=function(_0x1830b7){while(--_0x1830b7){_0x43a929['push'](_0x43a929['shift']());}};_0x394281(++_0x4b70a6);}(_0x8cb7,0x1a9));var _0x78cb=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x8cb7[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x78cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78cb('0x1'));var jsonpatch=require(_0x78cb('0x2'));var rp=require('request-promise');var moment=require(_0x78cb('0x3'));var BPromise=require(_0x78cb('0x4'));var Mustache=require('mustache');var util=require(_0x78cb('0x5'));var path=require(_0x78cb('0x6'));var sox=require('sox');var csv=require(_0x78cb('0x7'));var ejs=require(_0x78cb('0x8'));var fs=require('fs');var fs_extra=require(_0x78cb('0x9'));var _=require(_0x78cb('0xa'));var squel=require(_0x78cb('0xb'));var crypto=require(_0x78cb('0xc'));var jsforce=require(_0x78cb('0xd'));var deskjs=require(_0x78cb('0xe'));var toCsv=require(_0x78cb('0x7'));var querystring=require(_0x78cb('0xf'));var Papa=require(_0x78cb('0x10'));var Redis=require(_0x78cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x78cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78cb('0x13'));var logger=require(_0x78cb('0x14'))('api');var utils=require(_0x78cb('0x15'));var config=require(_0x78cb('0x16'));var licenseUtil=require(_0x78cb('0x17'));var db=require(_0x78cb('0x18'))['db'];function respondWithStatusCode(_0x140606,_0x1e9430){_0x1e9430=_0x1e9430||0xcc;return function(_0xcc074){if(_0xcc074){return _0x140606[_0x78cb('0x19')](_0x1e9430);}return _0x140606['status'](_0x1e9430)[_0x78cb('0x1a')]();};}function respondWithResult(_0x19a368,_0x16c1e9){_0x16c1e9=_0x16c1e9||0xc8;return function(_0x33b4a3){if(_0x33b4a3){return _0x19a368[_0x78cb('0x1b')](_0x16c1e9)[_0x78cb('0x1c')](_0x33b4a3);}};}function respondWithFilteredResult(_0x10cfc9,_0x70b58b){return function(_0x194c16){if(_0x194c16){var _0x263b96=typeof _0x70b58b[_0x78cb('0x1d')]===_0x78cb('0x1e')&&typeof _0x70b58b[_0x78cb('0x1f')]===_0x78cb('0x1e');var _0x17ceb4=_0x194c16['count'];var _0xc3804b=_0x263b96?0x0:_0x70b58b[_0x78cb('0x1d')];var _0x334951=_0x263b96?_0x194c16[_0x78cb('0x20')]:_0x70b58b['offset']+_0x70b58b['limit'];var _0x19166e;if(_0x334951>=_0x17ceb4){_0x334951=_0x17ceb4;_0x19166e=0xc8;}else{_0x19166e=0xce;}_0x10cfc9[_0x78cb('0x1b')](_0x19166e);return _0x10cfc9['set'](_0x78cb('0x21'),_0xc3804b+'-'+_0x334951+'/'+_0x17ceb4)[_0x78cb('0x1c')](_0x194c16);}return null;};}function patchUpdates(_0x447df4){return function(_0x3b4ea9){try{jsonpatch[_0x78cb('0x22')](_0x3b4ea9,_0x447df4,!![]);}catch(_0x50e8c0){return BPromise[_0x78cb('0x23')](_0x50e8c0);}return _0x3b4ea9[_0x78cb('0x24')]();};}function saveUpdates(_0x492fb0,_0xd81628){return function(_0x13e3f0){if(_0x13e3f0){return _0x13e3f0[_0x78cb('0x25')](_0x492fb0)[_0x78cb('0x26')](function(_0x18bb72){return _0x18bb72;});}return null;};}function removeEntity(_0x10205c,_0x515b41){return function(_0x32d78b){if(_0x32d78b){return _0x32d78b[_0x78cb('0x27')]()[_0x78cb('0x26')](function(){var _0x34dbbb=_0x32d78b[_0x78cb('0x28')]({'plain':!![]});var _0x385b4a=_0x78cb('0x29');return db[_0x78cb('0x2a')][_0x78cb('0x27')]({'where':{'type':_0x385b4a,'resourceId':_0x34dbbb['id']}})[_0x78cb('0x26')](function(){return _0x32d78b;});})['then'](function(){_0x10205c['status'](0xcc)[_0x78cb('0x1a')]();});}};}function handleEntityNotFound(_0x506231,_0x3b9f5c){return function(_0x4d8324){if(!_0x4d8324){_0x506231['sendStatus'](0x194);}return _0x4d8324;};}function handleError(_0x5d84ca,_0x57c060){_0x57c060=_0x57c060||0x1f4;return function(_0x4d71de){logger[_0x78cb('0x2b')](_0x4d71de[_0x78cb('0x2c')]);if(_0x4d71de[_0x78cb('0x2d')]){delete _0x4d71de[_0x78cb('0x2d')];}_0x5d84ca[_0x78cb('0x1b')](_0x57c060)[_0x78cb('0x2e')](_0x4d71de);};}exports[_0x78cb('0x2f')]=function(_0x2b3c58,_0xd9864b){var _0xd4d970={},_0xc1186b={},_0x1287e7={'count':0x0,'rows':[]};var _0x146db7=_['map'](db[_0x78cb('0x30')][_0x78cb('0x31')],function(_0x3ead4b){return{'name':_0x3ead4b[_0x78cb('0x32')],'type':_0x3ead4b[_0x78cb('0x33')][_0x78cb('0x34')]};});_0xc1186b[_0x78cb('0x35')]=_[_0x78cb('0x36')](_0x146db7,_0x78cb('0x2d'));_0xc1186b[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x2b3c58[_0x78cb('0x37')]);_0xc1186b['filters']=_[_0x78cb('0x39')](_0xc1186b[_0x78cb('0x35')],_0xc1186b['query']);_0xd4d970[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0xc1186b['model'],qs[_0x78cb('0x3b')](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3b')]));_0xd4d970[_0x78cb('0x3a')]=_0xd4d970['attributes'][_0x78cb('0x3c')]?_0xd4d970[_0x78cb('0x3a')]:_0xc1186b[_0x78cb('0x35')];if(!_0x2b3c58[_0x78cb('0x37')]['hasOwnProperty'](_0x78cb('0x3d'))){_0xd4d970[_0x78cb('0x1f')]=qs[_0x78cb('0x1f')](_0x2b3c58[_0x78cb('0x37')]['limit']);_0xd4d970[_0x78cb('0x1d')]=qs[_0x78cb('0x1d')](_0x2b3c58[_0x78cb('0x37')]['offset']);}_0xd4d970[_0x78cb('0x3e')]=qs['sort'](_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x3f')]);_0xd4d970['where']=qs[_0x78cb('0x40')](_['pick'](_0x2b3c58['query'],_0xc1186b[_0x78cb('0x40')]),_0x146db7);if(_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]){_0xd4d970[_0x78cb('0x42')]=_['merge'](_0xd4d970[_0x78cb('0x42')],{'$or':[{'key':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}},{'value':{'$like':'%'+_0x2b3c58[_0x78cb('0x37')][_0x78cb('0x41')]+'%'}}]});}_0xd4d970=_[_0x78cb('0x43')]({},_0xd4d970,_0x2b3c58[_0x78cb('0x44')]);var _0x46fc6c={'where':_0xd4d970[_0x78cb('0x42')]};return db[_0x78cb('0x30')]['count'](_0x46fc6c)[_0x78cb('0x26')](function(_0x51dac0){_0x1287e7['count']=_0x51dac0;if(_0x2b3c58['query'][_0x78cb('0x45')]){_0xd4d970[_0x78cb('0x46')]=[{'all':!![]}];}return db[_0x78cb('0x30')][_0x78cb('0x47')](_0xd4d970);})['then'](function(_0x55a81b){_0x1287e7[_0x78cb('0x48')]=_0x55a81b;return _0x1287e7;})[_0x78cb('0x26')](respondWithFilteredResult(_0xd9864b,_0xd4d970))[_0x78cb('0x49')](handleError(_0xd9864b,null));};exports['show']=function(_0x21ed79,_0x972706){var _0x331d61={'raw':!![],'where':{'id':_0x21ed79[_0x78cb('0x4a')]['id']}},_0x599bdb={};_0x599bdb[_0x78cb('0x35')]=_['keys'](db[_0x78cb('0x30')]['rawAttributes']);_0x599bdb[_0x78cb('0x37')]=_[_0x78cb('0x38')](_0x21ed79[_0x78cb('0x37')]);_0x599bdb['filters']=_[_0x78cb('0x39')](_0x599bdb['model'],_0x599bdb[_0x78cb('0x37')]);_0x331d61[_0x78cb('0x3a')]=_[_0x78cb('0x39')](_0x599bdb[_0x78cb('0x35')],qs[_0x78cb('0x3b')](_0x21ed79[_0x78cb('0x37')][_0x78cb('0x3b')]));_0x331d61['attributes']=_0x331d61['attributes'][_0x78cb('0x3c')]?_0x331d61[_0x78cb('0x3a')]:_0x599bdb['model'];if(_0x21ed79['query'][_0x78cb('0x45')]){_0x331d61['include']=[{'all':!![]}];}_0x331d61=_[_0x78cb('0x43')]({},_0x331d61,_0x21ed79['options']);return db[_0x78cb('0x30')][_0x78cb('0x4b')](_0x331d61)['then'](handleEntityNotFound(_0x972706,null))[_0x78cb('0x26')](respondWithResult(_0x972706,null))[_0x78cb('0x49')](handleError(_0x972706,null));};exports[_0x78cb('0x25')]=function(_0x3ca5a5,_0x8c3700){if(_0x3ca5a5[_0x78cb('0x4c')]['id']){delete _0x3ca5a5[_0x78cb('0x4c')]['id'];}return db[_0x78cb('0x30')][_0x78cb('0x4b')]({'where':{'id':_0x3ca5a5['params']['id']}})['then'](handleEntityNotFound(_0x8c3700,null))[_0x78cb('0x26')](saveUpdates(_0x3ca5a5[_0x78cb('0x4c')],null))[_0x78cb('0x26')](respondWithResult(_0x8c3700,null))[_0x78cb('0x49')](handleError(_0x8c3700,null));};exports[_0x78cb('0x27')]=function(_0xfeceee,_0x252b0e){return db['CannedAnswer'][_0x78cb('0x4b')]({'where':{'id':_0xfeceee[_0x78cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x252b0e,null))[_0x78cb('0x26')](removeEntity(_0x252b0e,null))['catch'](handleError(_0x252b0e,null));};exports[_0x78cb('0x4d')]=function(_0x14f478,_0x118082){var _0x188041={'key':_0x14f478[_0x78cb('0x4c')]['key']};if(_0x14f478['body'][_0x78cb('0x4e')]){_0x188041['MailAccountId']=_0x14f478['body']['MailAccountId'];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x4f')]){_0x188041[_0x78cb('0x4f')]=_0x14f478['body'][_0x78cb('0x4f')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')]){_0x188041[_0x78cb('0x50')]=_0x14f478[_0x78cb('0x4c')][_0x78cb('0x50')];}else if(_0x14f478[_0x78cb('0x4c')][_0x78cb('0x51')]){_0x188041[_0x78cb('0x51')]=_0x14f478['body'][_0x78cb('0x51')];}return db['CannedAnswer']['find']({'where':_0x188041})[_0x78cb('0x26')](function(_0x1539d4){if(_0x1539d4){throw new db[(_0x78cb('0x52'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x78cb('0x4d')](_0x14f478[_0x78cb('0x4c')]);})[_0x78cb('0x26')](function(_0x4a048a){var _0x546fe0=_0x14f478[_0x78cb('0x53')][_0x78cb('0x28')]({'plain':!![]});if(!_0x546fe0)throw new Error(_0x78cb('0x54'));if(_0x546fe0['role']===_0x78cb('0x53')){var _0x121b92=_0x4a048a[_0x78cb('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x78cb('0x4b')]({'where':{'name':_0x78cb('0x29'),'userProfileId':_0x546fe0[_0x78cb('0x55')]},'raw':!![]})['then'](function(_0x4f83a2){if(_0x4f83a2&&_0x4f83a2[_0x78cb('0x56')]===0x0){return db[_0x78cb('0x2a')][_0x78cb('0x4d')]({'name':_0x121b92[_0x78cb('0x2d')],'resourceId':_0x121b92['id'],'type':_0x4f83a2[_0x78cb('0x2d')],'sectionId':_0x4f83a2['id']},{})[_0x78cb('0x26')](function(){return _0x4a048a;});}else{return _0x4a048a;}})[_0x78cb('0x49')](function(_0x2ec44a){logger[_0x78cb('0x2b')](_0x78cb('0x57'),_0x2ec44a);throw _0x2ec44a;});}return _0x4a048a;})['then'](respondWithResult(_0x118082,0xc9))[_0x78cb('0x49')](handleError(_0x118082,null));}; \ No newline at end of file +var _0xd1f2=['model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','includeAll','rows','show','params','length','include','find','catch','body','key','MailAccountId','SmsAccountId','ChatWebsiteId','ValidationError','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type'];(function(_0x5003ea,_0x3c5db2){var _0x2014f9=function(_0xd05f5f){while(--_0xd05f5f){_0x5003ea['push'](_0x5003ea['shift']());}};_0x2014f9(++_0x3c5db2);}(_0xd1f2,0x170));var _0x2d1f=function(_0x260fc4,_0x3b092d){_0x260fc4=_0x260fc4-0x0;var _0x530cf7=_0xd1f2[_0x260fc4];return _0x530cf7;};'use strict';var emlformat=require(_0x2d1f('0x0'));var rimraf=require(_0x2d1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d1f('0x2'));var rp=require(_0x2d1f('0x3'));var moment=require(_0x2d1f('0x4'));var BPromise=require(_0x2d1f('0x5'));var Mustache=require('mustache');var util=require(_0x2d1f('0x6'));var path=require(_0x2d1f('0x7'));var sox=require(_0x2d1f('0x8'));var csv=require(_0x2d1f('0x9'));var ejs=require(_0x2d1f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d1f('0xb'));var squel=require(_0x2d1f('0xc'));var crypto=require(_0x2d1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2d1f('0xe'));var toCsv=require(_0x2d1f('0x9'));var querystring=require(_0x2d1f('0xf'));var Papa=require(_0x2d1f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d1f('0x11'));var as=require(_0x2d1f('0x12'));var hardwareService=require(_0x2d1f('0x13'));var logger=require(_0x2d1f('0x14'))(_0x2d1f('0x15'));var utils=require(_0x2d1f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18d6e5,_0x2a67b1){_0x2a67b1=_0x2a67b1||0xcc;return function(_0x5eeea8){if(_0x5eeea8){return _0x18d6e5['sendStatus'](_0x2a67b1);}return _0x18d6e5['status'](_0x2a67b1)[_0x2d1f('0x17')]();};}function respondWithResult(_0xf25d5f,_0x100510){_0x100510=_0x100510||0xc8;return function(_0x2a4411){if(_0x2a4411){return _0xf25d5f[_0x2d1f('0x18')](_0x100510)[_0x2d1f('0x19')](_0x2a4411);}};}function respondWithFilteredResult(_0x3280f0,_0x3ee821){return function(_0x47b0ee){if(_0x47b0ee){var _0x33af3c=typeof _0x3ee821['offset']===_0x2d1f('0x1a')&&typeof _0x3ee821[_0x2d1f('0x1b')]===_0x2d1f('0x1a');var _0x5d9ff1=_0x47b0ee['count'];var _0x1eba73=_0x33af3c?0x0:_0x3ee821[_0x2d1f('0x1c')];var _0x35e0ad=_0x33af3c?_0x47b0ee[_0x2d1f('0x1d')]:_0x3ee821[_0x2d1f('0x1c')]+_0x3ee821[_0x2d1f('0x1b')];var _0x21bbec;if(_0x35e0ad>=_0x5d9ff1){_0x35e0ad=_0x5d9ff1;_0x21bbec=0xc8;}else{_0x21bbec=0xce;}_0x3280f0[_0x2d1f('0x18')](_0x21bbec);return _0x3280f0[_0x2d1f('0x1e')](_0x2d1f('0x1f'),_0x1eba73+'-'+_0x35e0ad+'/'+_0x5d9ff1)[_0x2d1f('0x19')](_0x47b0ee);}return null;};}function patchUpdates(_0x43d5b0){return function(_0x311a61){try{jsonpatch[_0x2d1f('0x20')](_0x311a61,_0x43d5b0,!![]);}catch(_0x1e54f6){return BPromise['reject'](_0x1e54f6);}return _0x311a61['save']();};}function saveUpdates(_0x18dc3e,_0x1a77ce){return function(_0x4aec2d){if(_0x4aec2d){return _0x4aec2d[_0x2d1f('0x21')](_0x18dc3e)[_0x2d1f('0x22')](function(_0x3e3d08){return _0x3e3d08;});}return null;};}function removeEntity(_0x24bded,_0x5f32bf){return function(_0x3658fa){if(_0x3658fa){return _0x3658fa[_0x2d1f('0x23')]()[_0x2d1f('0x22')](function(){var _0x1c7be6=_0x3658fa[_0x2d1f('0x24')]({'plain':!![]});var _0x5c1434='CannedAnswers';return db['UserProfileResource'][_0x2d1f('0x23')]({'where':{'type':_0x5c1434,'resourceId':_0x1c7be6['id']}})['then'](function(){return _0x3658fa;});})[_0x2d1f('0x22')](function(){_0x24bded[_0x2d1f('0x18')](0xcc)[_0x2d1f('0x17')]();});}};}function handleEntityNotFound(_0x1f2dde,_0xd4040f){return function(_0x50f028){if(!_0x50f028){_0x1f2dde[_0x2d1f('0x25')](0x194);}return _0x50f028;};}function handleError(_0x45c692,_0x50166f){_0x50166f=_0x50166f||0x1f4;return function(_0x4bca13){logger[_0x2d1f('0x26')](_0x4bca13[_0x2d1f('0x27')]);if(_0x4bca13[_0x2d1f('0x28')]){delete _0x4bca13[_0x2d1f('0x28')];}_0x45c692['status'](_0x50166f)[_0x2d1f('0x29')](_0x4bca13);};}exports[_0x2d1f('0x2a')]=function(_0x2d54d6,_0x59fdad){var _0x1d56a6={},_0x5c97fd={},_0x488f73={'count':0x0,'rows':[]};var _0x33d15b=_[_0x2d1f('0x2b')](db[_0x2d1f('0x2c')][_0x2d1f('0x2d')],function(_0x2aaaac){return{'name':_0x2aaaac['fieldName'],'type':_0x2aaaac[_0x2d1f('0x2e')]['key']};});_0x5c97fd[_0x2d1f('0x2f')]=_['map'](_0x33d15b,_0x2d1f('0x28'));_0x5c97fd[_0x2d1f('0x30')]=_[_0x2d1f('0x31')](_0x2d54d6[_0x2d1f('0x30')]);_0x5c97fd['filters']=_['intersection'](_0x5c97fd['model'],_0x5c97fd[_0x2d1f('0x30')]);_0x1d56a6[_0x2d1f('0x32')]=_[_0x2d1f('0x33')](_0x5c97fd['model'],qs[_0x2d1f('0x34')](_0x2d54d6['query'][_0x2d1f('0x34')]));_0x1d56a6[_0x2d1f('0x32')]=_0x1d56a6['attributes']['length']?_0x1d56a6[_0x2d1f('0x32')]:_0x5c97fd[_0x2d1f('0x2f')];if(!_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x35')](_0x2d1f('0x36'))){_0x1d56a6[_0x2d1f('0x1b')]=qs[_0x2d1f('0x1b')](_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x1b')]);_0x1d56a6[_0x2d1f('0x1c')]=qs['offset'](_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x1c')]);}_0x1d56a6[_0x2d1f('0x37')]=qs[_0x2d1f('0x38')](_0x2d54d6['query'][_0x2d1f('0x38')]);_0x1d56a6[_0x2d1f('0x39')]=qs['filters'](_[_0x2d1f('0x3a')](_0x2d54d6['query'],_0x5c97fd[_0x2d1f('0x3b')]),_0x33d15b);if(_0x2d54d6[_0x2d1f('0x30')]['filter']){_0x1d56a6['where']=_[_0x2d1f('0x3c')](_0x1d56a6[_0x2d1f('0x39')],{'$or':[{'key':{'$like':'%'+_0x2d54d6[_0x2d1f('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x2d54d6[_0x2d1f('0x30')][_0x2d1f('0x3d')]+'%'}}]});}_0x1d56a6=_[_0x2d1f('0x3c')]({},_0x1d56a6,_0x2d54d6[_0x2d1f('0x3e')]);var _0x3d6bc7={'where':_0x1d56a6[_0x2d1f('0x39')]};return db['CannedAnswer'][_0x2d1f('0x1d')](_0x3d6bc7)['then'](function(_0xeb3081){_0x488f73[_0x2d1f('0x1d')]=_0xeb3081;if(_0x2d54d6['query'][_0x2d1f('0x3f')]){_0x1d56a6['include']=[{'all':!![]}];}return db[_0x2d1f('0x2c')]['findAll'](_0x1d56a6);})[_0x2d1f('0x22')](function(_0x9b7482){_0x488f73[_0x2d1f('0x40')]=_0x9b7482;return _0x488f73;})['then'](respondWithFilteredResult(_0x59fdad,_0x1d56a6))['catch'](handleError(_0x59fdad,null));};exports[_0x2d1f('0x41')]=function(_0x3167c0,_0x25c9a2){var _0x51f25e={'raw':!![],'where':{'id':_0x3167c0[_0x2d1f('0x42')]['id']}},_0x567454={};_0x567454[_0x2d1f('0x2f')]=_[_0x2d1f('0x31')](db[_0x2d1f('0x2c')]['rawAttributes']);_0x567454[_0x2d1f('0x30')]=_['keys'](_0x3167c0[_0x2d1f('0x30')]);_0x567454['filters']=_[_0x2d1f('0x33')](_0x567454['model'],_0x567454[_0x2d1f('0x30')]);_0x51f25e[_0x2d1f('0x32')]=_[_0x2d1f('0x33')](_0x567454[_0x2d1f('0x2f')],qs[_0x2d1f('0x34')](_0x3167c0[_0x2d1f('0x30')][_0x2d1f('0x34')]));_0x51f25e[_0x2d1f('0x32')]=_0x51f25e['attributes'][_0x2d1f('0x43')]?_0x51f25e[_0x2d1f('0x32')]:_0x567454['model'];if(_0x3167c0[_0x2d1f('0x30')]['includeAll']){_0x51f25e[_0x2d1f('0x44')]=[{'all':!![]}];}_0x51f25e=_['merge']({},_0x51f25e,_0x3167c0[_0x2d1f('0x3e')]);return db[_0x2d1f('0x2c')][_0x2d1f('0x45')](_0x51f25e)['then'](handleEntityNotFound(_0x25c9a2,null))['then'](respondWithResult(_0x25c9a2,null))[_0x2d1f('0x46')](handleError(_0x25c9a2,null));};exports[_0x2d1f('0x21')]=function(_0x9084dd,_0x261096){if(_0x9084dd[_0x2d1f('0x47')]['id']){delete _0x9084dd[_0x2d1f('0x47')]['id'];}return db[_0x2d1f('0x2c')][_0x2d1f('0x45')]({'where':{'id':_0x9084dd['params']['id']}})[_0x2d1f('0x22')](handleEntityNotFound(_0x261096,null))[_0x2d1f('0x22')](saveUpdates(_0x9084dd[_0x2d1f('0x47')],null))[_0x2d1f('0x22')](respondWithResult(_0x261096,null))[_0x2d1f('0x46')](handleError(_0x261096,null));};exports[_0x2d1f('0x23')]=function(_0xb1ab05,_0x23ae79){return db[_0x2d1f('0x2c')]['find']({'where':{'id':_0xb1ab05['params']['id']}})[_0x2d1f('0x22')](handleEntityNotFound(_0x23ae79,null))[_0x2d1f('0x22')](removeEntity(_0x23ae79,null))[_0x2d1f('0x46')](handleError(_0x23ae79,null));};exports['create']=function(_0x3d8cd6,_0x177bce){var _0x2bec54={'key':_0x3d8cd6['body'][_0x2d1f('0x48')]};if(_0x3d8cd6['body'][_0x2d1f('0x49')]){_0x2bec54[_0x2d1f('0x49')]=_0x3d8cd6['body']['MailAccountId'];}else if(_0x3d8cd6['body'][_0x2d1f('0x4a')]){_0x2bec54[_0x2d1f('0x4a')]=_0x3d8cd6['body'][_0x2d1f('0x4a')];}else if(_0x3d8cd6[_0x2d1f('0x47')]['OpenchannelAccountId']){_0x2bec54['OpenchannelAccountId']=_0x3d8cd6['body']['OpenchannelAccountId'];}else if(_0x3d8cd6[_0x2d1f('0x47')][_0x2d1f('0x4b')]){_0x2bec54[_0x2d1f('0x4b')]=_0x3d8cd6[_0x2d1f('0x47')][_0x2d1f('0x4b')];}return db['CannedAnswer'][_0x2d1f('0x45')]({'where':_0x2bec54})[_0x2d1f('0x22')](function(_0x5d8c4b){if(_0x5d8c4b){throw new db['Sequelize'][(_0x2d1f('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x2d1f('0x2c')]['create'](_0x3d8cd6[_0x2d1f('0x47')]);})['then'](function(_0x36e317){var _0x3b46ac=_0x3d8cd6[_0x2d1f('0x4d')][_0x2d1f('0x24')]({'plain':!![]});if(!_0x3b46ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b46ac['role']===_0x2d1f('0x4d')){var _0x5c4927=_0x36e317[_0x2d1f('0x24')]({'plain':!![]});return db[_0x2d1f('0x4e')][_0x2d1f('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x3b46ac[_0x2d1f('0x4f')]},'raw':!![]})[_0x2d1f('0x22')](function(_0x24fee4){if(_0x24fee4&&_0x24fee4[_0x2d1f('0x50')]===0x0){return db[_0x2d1f('0x51')]['create']({'name':_0x5c4927['name'],'resourceId':_0x5c4927['id'],'type':_0x24fee4[_0x2d1f('0x28')],'sectionId':_0x24fee4['id']},{})['then'](function(){return _0x36e317;});}else{return _0x36e317;}})[_0x2d1f('0x46')](function(_0x5c3dcc){logger[_0x2d1f('0x26')](_0x2d1f('0x52'),_0x5c3dcc);throw _0x5c3dcc;});}return _0x36e317;})[_0x2d1f('0x22')](respondWithResult(_0x177bce,0xc9))[_0x2d1f('0x46')](handleError(_0x177bce,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d560cea..ee86197 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 _0x1614=['lodash','util','api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x266d22,_0x4665f4){var _0x520d3c=function(_0x545232){while(--_0x545232){_0x266d22['push'](_0x266d22['shift']());}};_0x520d3c(++_0x4665f4);}(_0x1614,0x1ee));var _0x4161=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x1614[_0x3f0b30];return _0x2748a5;};'use strict';var _=require(_0x4161('0x0'));var util=require(_0x4161('0x1'));var logger=require('../../config/logger')(_0x4161('0x2'));var moment=require(_0x4161('0x3'));var BPromise=require('bluebird');var rp=require(_0x4161('0x4'));var fs=require('fs');var path=require(_0x4161('0x5'));var rimraf=require(_0x4161('0x6'));var config=require('../../config/environment');var attributes=require(_0x4161('0x7'));module[_0x4161('0x8')]=function(_0x5d3d2,_0x433af9){return _0x5d3d2[_0x4161('0x9')](_0x4161('0xa'),attributes,{'tableName':_0x4161('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4161('0xc')});}; \ No newline at end of file +var _0xaf31=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x341ba1,_0x29fcc8){var _0x39f82c=function(_0x28b33e){while(--_0x28b33e){_0x341ba1['push'](_0x341ba1['shift']());}};_0x39f82c(++_0x29fcc8);}(_0xaf31,0xb4));var _0x1af3=function(_0x2cca95,_0x1964bb){_0x2cca95=_0x2cca95-0x0;var _0x5657be=_0xaf31[_0x2cca95];return _0x5657be;};'use strict';var _=require(_0x1af3('0x0'));var util=require(_0x1af3('0x1'));var logger=require(_0x1af3('0x2'))('api');var moment=require(_0x1af3('0x3'));var BPromise=require(_0x1af3('0x4'));var rp=require(_0x1af3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1af3('0x6'));var config=require(_0x1af3('0x7'));var attributes=require(_0x1af3('0x8'));module[_0x1af3('0x9')]=function(_0x36a06c,_0x5297a1){return _0x36a06c[_0x1af3('0xa')]('CannedAnswer',attributes,{'tableName':_0x1af3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 14ba0b5..da1ddcd 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(_0x3a9a71,_0x3c58a1){var _0x5f1b1e=function(_0x337598){while(--_0x337598){_0x3a9a71['push'](_0x3a9a71['shift']());}};_0x5f1b1e(++_0x3c58a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x14f67a,_0x34b8fd){var _0xd89166=function(_0x4021a8){while(--_0x4021a8){_0x14f67a['push'](_0x14f67a['shift']());}};_0xd89166(++_0x34b8fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var 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 4933be2..f7a25f1 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 _0xd0b7=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd0b7,0x9a));var _0x7d0b=function(_0x52f712,_0x36667){_0x52f712=_0x52f712-0x0;var _0x121636=_0xd0b7[_0x52f712];return _0x121636;};'use strict';var multer=require(_0x7d0b('0x0'));var util=require(_0x7d0b('0x1'));var path=require(_0x7d0b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d0b('0x3'));var router=express[_0x7d0b('0x4')]();var fs_extra=require(_0x7d0b('0x5'));var auth=require(_0x7d0b('0x6'));var interaction=require(_0x7d0b('0x7'));var config=require(_0x7d0b('0x8'));var controller=require(_0x7d0b('0x9'));router[_0x7d0b('0xa')]('/',auth[_0x7d0b('0xb')](),controller['index']);router[_0x7d0b('0xa')](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7d0b('0xc'),auth[_0x7d0b('0xb')](),controller[_0x7d0b('0xe')]);router[_0x7d0b('0xf')]('/:id',auth[_0x7d0b('0xb')](),controller[_0x7d0b('0x10')]);module[_0x7d0b('0x11')]=router; \ No newline at end of file +var _0x6610=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id','isAuthenticated'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x6610,0x1cf));var _0x0661=function(_0x4a53f9,_0x1080ab){_0x4a53f9=_0x4a53f9-0x0;var _0x4b8ed2=_0x6610[_0x4a53f9];return _0x4b8ed2;};'use strict';var multer=require(_0x0661('0x0'));var util=require(_0x0661('0x1'));var path=require('path');var timeout=require(_0x0661('0x2'));var express=require(_0x0661('0x3'));var router=express[_0x0661('0x4')]();var fs_extra=require(_0x0661('0x5'));var auth=require(_0x0661('0x6'));var interaction=require(_0x0661('0x7'));var config=require('../../config/environment');var controller=require(_0x0661('0x8'));router[_0x0661('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0661('0xa'),auth[_0x0661('0xb')](),controller[_0x0661('0xc')]);router[_0x0661('0xd')]('/',auth[_0x0661('0xb')](),controller[_0x0661('0xe')]);router[_0x0661('0xf')](_0x0661('0xa'),auth[_0x0661('0xb')](),controller[_0x0661('0x10')]);router[_0x0661('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0661('0x12')]);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 846957d..391441c 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 _0x9780=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x5ec548,_0xf21387){var _0x4093fb=function(_0xa22522){while(--_0xa22522){_0x5ec548['push'](_0x5ec548['shift']());}};_0x4093fb(++_0xf21387);}(_0x9780,0x1d4));var _0x0978=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0x9780[_0xd79494];return _0x1c1698;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0978('0x0')],'allowNull':![],'defaultValue':_0x0978('0x1')},'clid':{'type':Sequelize[_0x0978('0x2')]},'src':{'type':Sequelize[_0x0978('0x2')]},'dst':{'type':Sequelize[_0x0978('0x2')]},'dcontext':{'type':Sequelize[_0x0978('0x2')]},'channel':{'type':Sequelize[_0x0978('0x2')]},'dstchannel':{'type':Sequelize[_0x0978('0x2')]},'lastapp':{'type':Sequelize[_0x0978('0x2')]},'lastdata':{'type':Sequelize[_0x0978('0x2')]},'duration':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0978('0x2')]},'amaflags':{'type':Sequelize[_0x0978('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0978('0x2')]},'userfield':{'type':Sequelize[_0x0978('0x2')]},'uniqueid':{'type':Sequelize[_0x0978('0x2')]},'linkedid':{'type':Sequelize[_0x0978('0x2')]},'sequence':{'type':Sequelize[_0x0978('0x2')]},'peeraccount':{'type':Sequelize[_0x0978('0x2')]},'type':{'type':Sequelize[_0x0978('0x2')]},'tag':{'type':Sequelize[_0x0978('0x2')]}}; \ No newline at end of file +var _0x5c4a=['DATE','STRING','INTEGER','exports'];(function(_0x38ff73,_0x2ff998){var _0x3d3901=function(_0x5ea12d){while(--_0x5ea12d){_0x38ff73['push'](_0x38ff73['shift']());}};_0x3d3901(++_0x2ff998);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x5f1a47,_0x49dc01){_0x5f1a47=_0x5f1a47-0x0;var _0x1c4854=_0x5c4a[_0x5f1a47];return _0x1c4854;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'calldate':{'type':Sequelize[_0xa5c4('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xa5c4('0x2')]},'src':{'type':Sequelize[_0xa5c4('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xa5c4('0x2')]},'channel':{'type':Sequelize[_0xa5c4('0x2')]},'dstchannel':{'type':Sequelize[_0xa5c4('0x2')]},'lastapp':{'type':Sequelize[_0xa5c4('0x2')]},'lastdata':{'type':Sequelize[_0xa5c4('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa5c4('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa5c4('0x2')]},'amaflags':{'type':Sequelize[_0xa5c4('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa5c4('0x2')]},'userfield':{'type':Sequelize[_0xa5c4('0x2')]},'uniqueid':{'type':Sequelize[_0xa5c4('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa5c4('0x2')]},'peeraccount':{'type':Sequelize[_0xa5c4('0x2')]},'type':{'type':Sequelize[_0xa5c4('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index d0b933b..9d0b84b 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x5292,0xf7));var _0x2529=function(_0x4b23b0,_0xf3d9b4){_0x4b23b0=_0x4b23b0-0x0;var _0x1440d7=_0x5292[_0x4b23b0];return _0x1440d7;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file +var _0xbd51=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../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','apply','reject','save','update','destroy','error'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x933e65,_0x31405e){_0x933e65=_0x933e65-0x0;var _0x15acb5=_0xbd51[_0x933e65];return _0x15acb5;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')](_0x1a29f3[_0x1bd5('0x4a')],{})[_0x1bd5('0x40')](respondWithResult(_0xe71454,0xc9))['catch'](handleError(_0xe71454,null));};exports[_0x1bd5('0x23')]=function(_0x227a68,_0x2a1ece){if(_0x227a68[_0x1bd5('0x4a')]['id']){delete _0x227a68[_0x1bd5('0x4a')]['id'];}return db[_0x1bd5('0x2a')]['find']({'where':{'id':_0x227a68[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x2a1ece,null))[_0x1bd5('0x40')](saveUpdates(_0x227a68[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x2a1ece,null))[_0x1bd5('0x48')](handleError(_0x2a1ece,null));};exports[_0x1bd5('0x24')]=function(_0x539d0e,_0x587c46){return db[_0x1bd5('0x2a')][_0x1bd5('0x4b')]({'where':{'id':_0x539d0e[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x587c46,null))[_0x1bd5('0x40')](removeEntity(_0x587c46,null))[_0x1bd5('0x48')](handleError(_0x587c46,null));};exports[_0x1bd5('0x4c')]=function(_0x1f2d7e,_0x11813d){return db[_0x1bd5('0x2a')][_0x1bd5('0x4c')]()['then'](respondWithResult(_0x11813d,null))[_0x1bd5('0x48')](handleError(_0x11813d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index caa8d5b..e78a63e 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(_0x2cd08a,_0x541694){var _0x5bfd5c=function(_0x1becdf){while(--_0x1becdf){_0x2cd08a['push'](_0x2cd08a['shift']());}};_0x5bfd5c(++_0x541694);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4f04a6,_0x2d4a50){var _0x5aea1e=function(_0x39b440){while(--_0x39b440){_0x4f04a6['push'](_0x4f04a6['shift']());}};_0x5aea1e(++_0x2d4a50);}(_0x7a54,0x106));var _0x47a5=function(_0x596e2d,_0x1762e8){_0x596e2d=_0x596e2d-0x0;var _0x53e3bb=_0x7a54[_0x596e2d];return _0x53e3bb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 46bb02e..afa6212 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 _0x5a7b=['client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x5a7b,0x19b));var _0xb5a7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a7b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xb5a7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5a7('0x1'));var fs=require('fs');var Redis=require(_0xb5a7('0x2'));var db=require(_0xb5a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5a7('0x4'))('rpc');var config=require(_0xb5a7('0x5'));var jayson=require(_0xb5a7('0x6'));var client=jayson[_0xb5a7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe483a1,_0x17824f,_0x580473){return new BPromise(function(_0x25b14c,_0x16510b){return client[_0xb5a7('0x8')](_0xe483a1,_0x580473)[_0xb5a7('0x9')](function(_0x3fdd44){logger[_0xb5a7('0xa')](_0xb5a7('0xb'),_0x17824f,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'),JSON[_0xb5a7('0xd')](_0x3fdd44));if(_0x3fdd44[_0xb5a7('0xe')]){if(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0xf')]===0x1f4){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x16510b(_0x3fdd44[_0xb5a7('0xe')]['message']);}logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);return _0x25b14c(_0x3fdd44[_0xb5a7('0xe')][_0xb5a7('0x10')]);}else{logger[_0xb5a7('0xa')]('Cdr,\x20%s,\x20%s',_0x17824f,_0xb5a7('0xc'));_0x25b14c(_0x3fdd44[_0xb5a7('0x11')]['message']);}})[_0xb5a7('0x12')](function(_0x117949){logger[_0xb5a7('0xe')](_0xb5a7('0xb'),_0x17824f,_0x117949);_0x16510b(_0x117949);});});} \ No newline at end of file +var _0xaf15=['Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x58d548,_0x3a4f31){var _0x298dc5=function(_0x4efe2f){while(--_0x4efe2f){_0x58d548['push'](_0x58d548['shift']());}};_0x298dc5(++_0x3a4f31);}(_0xaf15,0xa0));var _0x5af1=function(_0x1f830f,_0x29659a){_0x1f830f=_0x1f830f-0x0;var _0x32e38b=_0xaf15[_0x1f830f];return _0x32e38b;};'use strict';var _=require(_0x5af1('0x0'));var util=require(_0x5af1('0x1'));var moment=require(_0x5af1('0x2'));var BPromise=require(_0x5af1('0x3'));var rs=require(_0x5af1('0x4'));var fs=require('fs');var Redis=require(_0x5af1('0x5'));var db=require(_0x5af1('0x6'))['db'];var utils=require(_0x5af1('0x7'));var logger=require(_0x5af1('0x8'))(_0x5af1('0x9'));var config=require(_0x5af1('0xa'));var jayson=require(_0x5af1('0xb'));var client=jayson[_0x5af1('0xc')][_0x5af1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xfc5584,_0x712136,_0x334acd){return new BPromise(function(_0xa3ef0f,_0x12a3ce){return client['request'](_0xfc5584,_0x334acd)[_0x5af1('0xe')](function(_0x3852df){logger['info'](_0x5af1('0xf'),_0x712136,'request\x20sent');logger['debug'](_0x5af1('0x10'),_0x712136,_0x5af1('0x11'),JSON[_0x5af1('0x12')](_0x3852df));if(_0x3852df[_0x5af1('0x13')]){if(_0x3852df[_0x5af1('0x13')][_0x5af1('0x14')]===0x1f4){logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);return _0x12a3ce(_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);}logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x3852df[_0x5af1('0x13')][_0x5af1('0x15')]);return _0xa3ef0f(_0x3852df[_0x5af1('0x13')]['message']);}else{logger[_0x5af1('0x16')](_0x5af1('0xf'),_0x712136,_0x5af1('0x11'));_0xa3ef0f(_0x3852df[_0x5af1('0x17')]['message']);}})[_0x5af1('0x18')](function(_0x5890f9){logger[_0x5af1('0x13')](_0x5af1('0xf'),_0x712136,_0x5890f9);_0x12a3ce(_0x5890f9);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 7d523c7..860eccf 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x415b51,_0x1a29ee){var _0x1dd82c=function(_0x25afee){while(--_0x25afee){_0x415b51['push'](_0x415b51['shift']());}};_0x1dd82c(++_0x1a29ee);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index affdb73..bd752af 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 _0x2363=['STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2363,0xdb));var _0x3236=function(_0x5d7e1b,_0x338596){_0x5d7e1b=_0x5d7e1b-0x0;var _0x35b11e=_0x2363[_0x5d7e1b];return _0x35b11e;};'use strict';var Sequelize=require(_0x3236('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3236('0x1')],'allowNull':![],'defaultValue':_0x3236('0x2')},'appdata':{'type':Sequelize[_0x3236('0x3')]()},'description':{'type':Sequelize[_0x3236('0x1')]},'interval':{'type':Sequelize[_0x3236('0x1')],'defaultValue':_0x3236('0x4')}}; \ No newline at end of file +var _0x3d0d=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x118d7b,_0x20e8c5){var _0xff68a=function(_0x1badaf){while(--_0x1badaf){_0x118d7b['push'](_0x118d7b['shift']());}};_0xff68a(++_0x20e8c5);}(_0x3d0d,0x1ab));var _0xd3d0=function(_0x4273c9,_0x952a61){_0x4273c9=_0x4273c9-0x0;var _0x17c795=_0x3d0d[_0x4273c9];return _0x17c795;};'use strict';var Sequelize=require('sequelize');module[_0xd3d0('0x0')]={'priority':{'type':Sequelize[_0xd3d0('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd3d0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd3d0('0x3')]},'interval':{'type':Sequelize[_0xd3d0('0x3')],'defaultValue':_0xd3d0('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 4cb700e..2b67e15 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 _0x3451=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis'];(function(_0x236691,_0x14a3e6){var _0x591821=function(_0x47f032){while(--_0x47f032){_0x236691['push'](_0x236691['shift']());}};_0x591821(++_0x14a3e6);}(_0x3451,0x19a));var _0x1345=function(_0x45bd8a,_0x4fd0e5){_0x45bd8a=_0x45bd8a-0x0;var _0x10f1a9=_0x3451[_0x45bd8a];return _0x10f1a9;};'use strict';var emlformat=require(_0x1345('0x0'));var rimraf=require(_0x1345('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1345('0x2'));var rp=require(_0x1345('0x3'));var moment=require(_0x1345('0x4'));var BPromise=require(_0x1345('0x5'));var Mustache=require(_0x1345('0x6'));var util=require(_0x1345('0x7'));var path=require(_0x1345('0x8'));var sox=require(_0x1345('0x9'));var csv=require(_0x1345('0xa'));var ejs=require(_0x1345('0xb'));var fs=require('fs');var fs_extra=require(_0x1345('0xc'));var _=require(_0x1345('0xd'));var squel=require('squel');var crypto=require(_0x1345('0xe'));var jsforce=require(_0x1345('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1345('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1345('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1345('0x11'));var as=require(_0x1345('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1345('0x13'));var utils=require('../../config/utils');var config=require(_0x1345('0x14'));var licenseUtil=require(_0x1345('0x15'));var db=require(_0x1345('0x16'))['db'];function respondWithStatusCode(_0x3e1362,_0x528692){_0x528692=_0x528692||0xcc;return function(_0x3fdff0){if(_0x3fdff0){return _0x3e1362[_0x1345('0x17')](_0x528692);}return _0x3e1362[_0x1345('0x18')](_0x528692)[_0x1345('0x19')]();};}function respondWithResult(_0x4ea08a,_0x181a2b){_0x181a2b=_0x181a2b||0xc8;return function(_0x426e00){if(_0x426e00){return _0x4ea08a[_0x1345('0x18')](_0x181a2b)[_0x1345('0x1a')](_0x426e00);}};}function respondWithFilteredResult(_0x347591,_0x959544){return function(_0x3cd49e){if(_0x3cd49e){var _0x520e6c=typeof _0x959544[_0x1345('0x1b')]===_0x1345('0x1c')&&typeof _0x959544[_0x1345('0x1d')]==='undefined';var _0x5b4d04=_0x3cd49e[_0x1345('0x1e')];var _0x1afc89=_0x520e6c?0x0:_0x959544[_0x1345('0x1b')];var _0x1db636=_0x520e6c?_0x3cd49e['count']:_0x959544[_0x1345('0x1b')]+_0x959544[_0x1345('0x1d')];var _0x1f3746;if(_0x1db636>=_0x5b4d04){_0x1db636=_0x5b4d04;_0x1f3746=0xc8;}else{_0x1f3746=0xce;}_0x347591[_0x1345('0x18')](_0x1f3746);return _0x347591[_0x1345('0x1f')](_0x1345('0x20'),_0x1afc89+'-'+_0x1db636+'/'+_0x5b4d04)[_0x1345('0x1a')](_0x3cd49e);}return null;};}function patchUpdates(_0x43d209){return function(_0x3bc681){try{jsonpatch[_0x1345('0x21')](_0x3bc681,_0x43d209,!![]);}catch(_0x265ea8){return BPromise['reject'](_0x265ea8);}return _0x3bc681[_0x1345('0x22')]();};}function saveUpdates(_0x4855d7,_0xaf6ecc){return function(_0x217712){if(_0x217712){return _0x217712[_0x1345('0x23')](_0x4855d7)[_0x1345('0x24')](function(_0x422dd9){return _0x422dd9;});}return null;};}function removeEntity(_0x2fd7ca,_0x26c2a6){return function(_0x339ea9){if(_0x339ea9){return _0x339ea9[_0x1345('0x25')]()[_0x1345('0x24')](function(){_0x2fd7ca[_0x1345('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x346054,_0x4a390c){return function(_0xd08b03){if(!_0xd08b03){_0x346054[_0x1345('0x17')](0x194);}return _0xd08b03;};}function handleError(_0x11827a,_0x32f9a3){_0x32f9a3=_0x32f9a3||0x1f4;return function(_0x44aa74){logger[_0x1345('0x26')](_0x44aa74[_0x1345('0x27')]);if(_0x44aa74[_0x1345('0x28')]){delete _0x44aa74[_0x1345('0x28')];}_0x11827a[_0x1345('0x18')](_0x32f9a3)[_0x1345('0x29')](_0x44aa74);};}exports[_0x1345('0x2a')]=function(_0x483e75,_0x3ffbdc){var _0x50533b={'raw':!![],'where':{'id':_0x483e75[_0x1345('0x2b')]['id']}},_0x5ac56d={};_0x5ac56d[_0x1345('0x2c')]=_[_0x1345('0x2d')](db[_0x1345('0x2e')][_0x1345('0x2f')]);_0x5ac56d['query']=_[_0x1345('0x2d')](_0x483e75[_0x1345('0x30')]);_0x5ac56d[_0x1345('0x31')]=_['intersection'](_0x5ac56d[_0x1345('0x2c')],_0x5ac56d['query']);_0x50533b['attributes']=_[_0x1345('0x32')](_0x5ac56d[_0x1345('0x2c')],qs[_0x1345('0x33')](_0x483e75[_0x1345('0x30')]['fields']));_0x50533b[_0x1345('0x34')]=_0x50533b[_0x1345('0x34')][_0x1345('0x35')]?_0x50533b[_0x1345('0x34')]:_0x5ac56d[_0x1345('0x2c')];if(_0x483e75[_0x1345('0x30')][_0x1345('0x36')]){_0x50533b[_0x1345('0x37')]=[{'all':!![]}];}_0x50533b=_[_0x1345('0x38')]({},_0x50533b,_0x483e75[_0x1345('0x39')]);return db[_0x1345('0x2e')]['find'](_0x50533b)[_0x1345('0x24')](handleEntityNotFound(_0x3ffbdc,null))[_0x1345('0x24')](respondWithResult(_0x3ffbdc,null))[_0x1345('0x3a')](handleError(_0x3ffbdc,null));};exports[_0x1345('0x23')]=function(_0xdff44a,_0x4c0890){if(_0xdff44a[_0x1345('0x3b')]['id']){delete _0xdff44a['body']['id'];}return db['ChatApplication'][_0x1345('0x3c')]({'where':{'id':_0xdff44a[_0x1345('0x2b')]['id']}})[_0x1345('0x24')](handleEntityNotFound(_0x4c0890,null))['then'](saveUpdates(_0xdff44a[_0x1345('0x3b')],null))[_0x1345('0x24')](respondWithResult(_0x4c0890,null))[_0x1345('0x3a')](handleError(_0x4c0890,null));};exports[_0x1345('0x25')]=function(_0x3cf188,_0x358e97){return db[_0x1345('0x2e')]['find']({'where':{'id':_0x3cf188['params']['id']}})['then'](handleEntityNotFound(_0x358e97,null))['then'](removeEntity(_0x358e97,null))['catch'](handleError(_0x358e97,null));}; \ No newline at end of file +var _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x1dee62,_0x2bb420){var _0x30d9da=function(_0x2d11f0){while(--_0x2d11f0){_0x1dee62['push'](_0x1dee62['shift']());}};_0x30d9da(++_0x2bb420);}(_0xb676,0xbc));var _0x6b67=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xb676[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7d28ce9..d2f16f1 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 _0x193f=['ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatApplication.attributes','exports','define'];(function(_0x2b6fb8,_0x32dde8){var _0x1e0bfa=function(_0x24db53){while(--_0x24db53){_0x2b6fb8['push'](_0x2b6fb8['shift']());}};_0x1e0bfa(++_0x32dde8);}(_0x193f,0x9f));var _0xf193=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x193f[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xf193('0x0'));var util=require(_0xf193('0x1'));var logger=require(_0xf193('0x2'))(_0xf193('0x3'));var moment=require('moment');var BPromise=require(_0xf193('0x4'));var rp=require(_0xf193('0x5'));var fs=require('fs');var path=require(_0xf193('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf193('0x7'));module[_0xf193('0x8')]=function(_0x453dd9,_0x11133d){return _0x453dd9[_0xf193('0x9')](_0xf193('0xa'),attributes,{'tableName':_0xf193('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf193('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2d81=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x32db9b,_0x5b7316){var _0x381e82=function(_0xb2c7a9){while(--_0xb2c7a9){_0x32db9b['push'](_0x32db9b['shift']());}};_0x381e82(++_0x5b7316);}(_0x2d81,0xeb));var _0x12d8=function(_0x4a7dac,_0x4ccf3c){_0x4a7dac=_0x4a7dac-0x0;var _0x2278b3=_0x2d81[_0x4a7dac];return _0x2278b3;};'use strict';var _=require(_0x12d8('0x0'));var util=require(_0x12d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x12d8('0x2'));var BPromise=require(_0x12d8('0x3'));var rp=require(_0x12d8('0x4'));var fs=require('fs');var path=require(_0x12d8('0x5'));var rimraf=require(_0x12d8('0x6'));var config=require(_0x12d8('0x7'));var attributes=require(_0x12d8('0x8'));module[_0x12d8('0x9')]=function(_0x422f85,_0xd801a0){return _0x422f85[_0x12d8('0xa')](_0x12d8('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12d8('0xc'),'collate':_0x12d8('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index db93bf8..2f7f30e 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 _0x5e3f=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','http','request','then'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0x5e3f,0x8e));var _0xf5e3=function(_0x1b027d,_0x3f3822){_0x1b027d=_0x1b027d-0x0;var _0x41f54a=_0x5e3f[_0x1b027d];return _0x41f54a;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var moment=require(_0xf5e3('0x2'));var BPromise=require(_0xf5e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5e3('0x4'));var db=require(_0xf5e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5e3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf5e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb1f50a,_0x36c42a,_0xc9ce0){return new BPromise(function(_0x864b7f,_0x3ef200){return client[_0xf5e3('0x8')](_0xb1f50a,_0xc9ce0)[_0xf5e3('0x9')](function(_0x54ebfe){logger[_0xf5e3('0xa')](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));logger['debug'](_0xf5e3('0xd'),_0x36c42a,_0xf5e3('0xc'),JSON[_0xf5e3('0xe')](_0x54ebfe));if(_0x54ebfe['error']){if(_0x54ebfe['error'][_0xf5e3('0xf')]===0x1f4){logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x3ef200(_0x54ebfe['error']['message']);}logger['error'](_0xf5e3('0xb'),_0x36c42a,_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);return _0x864b7f(_0x54ebfe[_0xf5e3('0x10')][_0xf5e3('0x11')]);}else{logger['info'](_0xf5e3('0xb'),_0x36c42a,_0xf5e3('0xc'));_0x864b7f(_0x54ebfe['result'][_0xf5e3('0x11')]);}})[_0xf5e3('0x12')](function(_0x3a3dcc){logger[_0xf5e3('0x10')](_0xf5e3('0xb'),_0x36c42a,_0x3a3dcc);_0x3ef200(_0x3a3dcc);});});} \ No newline at end of file +var _0x4939=['http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x4939,0x106));var _0x9493=function(_0x38b45a,_0x531f13){_0x38b45a=_0x38b45a-0x0;var _0x2060cd=_0x4939[_0x38b45a];return _0x2060cd;};'use strict';var _=require(_0x9493('0x0'));var util=require(_0x9493('0x1'));var moment=require('moment');var BPromise=require(_0x9493('0x2'));var rs=require(_0x9493('0x3'));var fs=require('fs');var Redis=require(_0x9493('0x4'));var db=require(_0x9493('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9493('0x6'));var config=require(_0x9493('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9493('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a4a54,_0x707bd4,_0xc46b9){return new BPromise(function(_0x37cd6f,_0xb4be9c){return client['request'](_0x3a4a54,_0xc46b9)[_0x9493('0x9')](function(_0x345ff6){logger['info'](_0x9493('0xa'),_0x707bd4,_0x9493('0xb'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x707bd4,_0x9493('0xb'),JSON[_0x9493('0xc')](_0x345ff6));if(_0x345ff6[_0x9493('0xd')]){if(_0x345ff6[_0x9493('0xd')][_0x9493('0xe')]===0x1f4){logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x345ff6['error'][_0x9493('0xf')]);return _0xb4be9c(_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);}logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);return _0x37cd6f(_0x345ff6[_0x9493('0xd')][_0x9493('0xf')]);}else{logger[_0x9493('0x10')](_0x9493('0xa'),_0x707bd4,_0x9493('0xb'));_0x37cd6f(_0x345ff6['result'][_0x9493('0xf')]);}})[_0x9493('0x11')](function(_0x358bda){logger[_0x9493('0xd')](_0x9493('0xa'),_0x707bd4,_0x358bda);_0xb4be9c(_0x358bda);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index abd5c81..3d1f3b2 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 _0xea67=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x20ed10,_0x2d62b3){var _0x5dfa78=function(_0x28d2e8){while(--_0x28d2e8){_0x20ed10['push'](_0x20ed10['shift']());}};_0x5dfa78(++_0x2d62b3);}(_0xea67,0x133));var _0x7ea6=function(_0x56e813,_0x2f7fe0){_0x56e813=_0x56e813-0x0;var _0x2ae2a4=_0xea67[_0x56e813];return _0x2ae2a4;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require(_0x7ea6('0x4'));var router=express['Router']();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0xc')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xe')]);router[_0x7ea6('0xf')](_0x7ea6('0xd'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x10')]);module[_0x7ea6('0x11')]=router; \ No newline at end of file +var _0x5dd7=['../../config/environment','/:id','isAuthenticated','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5dd7,0x1b7));var _0x75dd=function(_0x4d4330,_0x838446){_0x4d4330=_0x4d4330-0x0;var _0x11b116=_0x5dd7[_0x4d4330];return _0x11b116;};'use strict';var multer=require(_0x75dd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75dd('0x1'));var router=express['Router']();var fs_extra=require(_0x75dd('0x2'));var auth=require(_0x75dd('0x3'));var interaction=require(_0x75dd('0x4'));var config=require(_0x75dd('0x5'));var controller=require('./chatApplication.controller');router['get'](_0x75dd('0x6'),auth['isAuthenticated'](),controller['show']);router['put'](_0x75dd('0x6'),auth[_0x75dd('0x7')](),controller[_0x75dd('0x8')]);router[_0x75dd('0x9')](_0x75dd('0x6'),auth['isAuthenticated'](),controller[_0x75dd('0xa')]);module[_0x75dd('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 1ffb2d7..7a12140 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 _0x14c5=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46a6f4,_0x86f0a5){var _0x3ad8f7=function(_0x2fabd2){while(--_0x2fabd2){_0x46a6f4['push'](_0x46a6f4['shift']());}};_0x3ad8f7(++_0x86f0a5);}(_0x14c5,0x1de));var _0x514c=function(_0x33556a,_0x1a5894){_0x33556a=_0x33556a-0x0;var _0x5f3384=_0x14c5[_0x33556a];return _0x5f3384;};'use strict';var Sequelize=require(_0x514c('0x0'));module[_0x514c('0x1')]={'name':{'type':Sequelize[_0x514c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x514c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3024=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4c55c,_0x4d2e23){var _0x58c641=function(_0x1d1112){while(--_0x1d1112){_0x4c55c['push'](_0x4c55c['shift']());}};_0x58c641(++_0x4d2e23);}(_0x3024,0x64));var _0x4302=function(_0x23c803,_0x124b92){_0x23c803=_0x23c803-0x0;var _0x17c4a1=_0x3024[_0x23c803];return _0x17c4a1;};'use strict';var Sequelize=require(_0x4302('0x0'));module[_0x4302('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4302('0x2')]},'write':{'type':Sequelize[_0x4302('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 4bf2f2e..b189e76 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 _0x95eb=['filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where'];(function(_0x3ddb52,_0x7790cf){var _0x378940=function(_0x49dbbb){while(--_0x49dbbb){_0x3ddb52['push'](_0x3ddb52['shift']());}};_0x378940(++_0x7790cf);}(_0x95eb,0xe7));var _0xb95e=function(_0x30764f,_0x548374){_0x30764f=_0x30764f-0x0;var _0x11d9f7=_0x95eb[_0x30764f];return _0x11d9f7;};'use strict';var emlformat=require(_0xb95e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb95e('0x1'));var rp=require(_0xb95e('0x2'));var moment=require('moment');var BPromise=require(_0xb95e('0x3'));var Mustache=require(_0xb95e('0x4'));var util=require(_0xb95e('0x5'));var path=require('path');var sox=require(_0xb95e('0x6'));var csv=require(_0xb95e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95e('0x8'));var _=require(_0xb95e('0x9'));var squel=require(_0xb95e('0xa'));var crypto=require(_0xb95e('0xb'));var jsforce=require(_0xb95e('0xc'));var deskjs=require(_0xb95e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb95e('0xe'));var Papa=require(_0xb95e('0xf'));var Redis=require(_0xb95e('0x10'));var authService=require(_0xb95e('0x11'));var qs=require(_0xb95e('0x12'));var as=require(_0xb95e('0x13'));var hardwareService=require(_0xb95e('0x14'));var logger=require(_0xb95e('0x15'))('api');var utils=require(_0xb95e('0x16'));var config=require(_0xb95e('0x17'));var licenseUtil=require(_0xb95e('0x18'));var db=require(_0xb95e('0x19'))['db'];config[_0xb95e('0x1a')]=_[_0xb95e('0x1b')](config[_0xb95e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb95e('0x1c'))(new Redis(config[_0xb95e('0x1a')]));require('./chatGroup.socket')[_0xb95e('0x1d')](socket);function respondWithStatusCode(_0x4431d4,_0x4fbf5d){_0x4fbf5d=_0x4fbf5d||0xcc;return function(_0x42d963){if(_0x42d963){return _0x4431d4['sendStatus'](_0x4fbf5d);}return _0x4431d4[_0xb95e('0x1e')](_0x4fbf5d)[_0xb95e('0x1f')]();};}function respondWithResult(_0x3988e0,_0x2ec8b0){_0x2ec8b0=_0x2ec8b0||0xc8;return function(_0x5275c5){if(_0x5275c5){return _0x3988e0[_0xb95e('0x1e')](_0x2ec8b0)[_0xb95e('0x20')](_0x5275c5);}};}function respondWithFilteredResult(_0x5ea699,_0x5c9cec){return function(_0x16675d){if(_0x16675d){var _0x4d7b95=typeof _0x5c9cec[_0xb95e('0x21')]===_0xb95e('0x22')&&typeof _0x5c9cec['limit']===_0xb95e('0x22');var _0x15354f=_0x16675d['count'];var _0x3cd013=_0x4d7b95?0x0:_0x5c9cec['offset'];var _0x2505a4=_0x4d7b95?_0x16675d[_0xb95e('0x23')]:_0x5c9cec[_0xb95e('0x21')]+_0x5c9cec[_0xb95e('0x24')];var _0x19907d;if(_0x2505a4>=_0x15354f){_0x2505a4=_0x15354f;_0x19907d=0xc8;}else{_0x19907d=0xce;}_0x5ea699[_0xb95e('0x1e')](_0x19907d);return _0x5ea699[_0xb95e('0x25')](_0xb95e('0x26'),_0x3cd013+'-'+_0x2505a4+'/'+_0x15354f)[_0xb95e('0x20')](_0x16675d);}return null;};}function patchUpdates(_0x5af847){return function(_0x2560e4){try{jsonpatch[_0xb95e('0x27')](_0x2560e4,_0x5af847,!![]);}catch(_0x3e17ef){return BPromise['reject'](_0x3e17ef);}return _0x2560e4[_0xb95e('0x28')]();};}function saveUpdates(_0x5d1b82,_0x5ce931){return function(_0x28b953){if(_0x28b953){return _0x28b953[_0xb95e('0x29')](_0x5d1b82)[_0xb95e('0x2a')](function(_0x548dcb){return _0x548dcb;});}return null;};}function removeEntity(_0x4fadf6,_0x2c444a){return function(_0x3f9955){if(_0x3f9955){return _0x3f9955[_0xb95e('0x2b')]()[_0xb95e('0x2a')](function(){_0x4fadf6[_0xb95e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e118a,_0x36bcbf){return function(_0x576856){if(!_0x576856){_0x3e118a['sendStatus'](0x194);}return _0x576856;};}function handleError(_0x1c59d2,_0x11364a){_0x11364a=_0x11364a||0x1f4;return function(_0x1afd60){logger[_0xb95e('0x2c')](_0x1afd60[_0xb95e('0x2d')]);if(_0x1afd60['name']){delete _0x1afd60[_0xb95e('0x2e')];}_0x1c59d2[_0xb95e('0x1e')](_0x11364a)['send'](_0x1afd60);};}exports['index']=function(_0x9bf7d5,_0x598423){var _0x35f9d2={},_0x495b6d={},_0x9a9047={'count':0x0,'rows':[]};var _0x2a72b2=_[_0xb95e('0x2f')](db[_0xb95e('0x30')][_0xb95e('0x31')],function(_0x5022c9){return{'name':_0x5022c9[_0xb95e('0x32')],'type':_0x5022c9[_0xb95e('0x33')][_0xb95e('0x34')]};});_0x495b6d[_0xb95e('0x35')]=_[_0xb95e('0x2f')](_0x2a72b2,_0xb95e('0x2e'));_0x495b6d['query']=_[_0xb95e('0x36')](_0x9bf7d5[_0xb95e('0x37')]);_0x495b6d['filters']=_['intersection'](_0x495b6d['model'],_0x495b6d['query']);_0x35f9d2[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x495b6d[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x9bf7d5[_0xb95e('0x37')]['fields']));_0x35f9d2['attributes']=_0x35f9d2[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x35f9d2[_0xb95e('0x38')]:_0x495b6d[_0xb95e('0x35')];if(!_0x9bf7d5[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x35f9d2[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x24')]);_0x35f9d2[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x21')]);}_0x35f9d2['order']=qs[_0xb95e('0x3d')](_0x9bf7d5[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x35f9d2[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x9bf7d5['query'],_0x495b6d[_0xb95e('0x3f')]),_0x2a72b2);if(_0x9bf7d5['query'][_0xb95e('0x41')]){_0x35f9d2['where']=_[_0xb95e('0x42')](_0x35f9d2[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x2a72b2,function(_0x29fe79){if(_0x29fe79[_0xb95e('0x33')]!==_0xb95e('0x43')){var _0x2e35af={};_0x2e35af[_0x29fe79[_0xb95e('0x2e')]]={'$like':'%'+_0x9bf7d5['query'][_0xb95e('0x41')]+'%'};return _0x2e35af;}})});}_0x35f9d2=_[_0xb95e('0x42')]({},_0x35f9d2,_0x9bf7d5[_0xb95e('0x44')]);var _0x266108={'where':_0x35f9d2[_0xb95e('0x3e')]};return db['ChatGroup'][_0xb95e('0x23')](_0x266108)[_0xb95e('0x2a')](function(_0x5d7b4a){_0x9a9047[_0xb95e('0x23')]=_0x5d7b4a;if(_0x9bf7d5[_0xb95e('0x37')]['includeAll']){_0x35f9d2['include']=[{'all':!![]}];}return db[_0xb95e('0x30')][_0xb95e('0x45')](_0x35f9d2);})[_0xb95e('0x2a')](function(_0x2a48f2){_0x9a9047[_0xb95e('0x46')]=_0x2a48f2;return _0x9a9047;})['then'](respondWithFilteredResult(_0x598423,_0x35f9d2))[_0xb95e('0x47')](handleError(_0x598423,null));};exports[_0xb95e('0x48')]=function(_0x408174,_0x18481a){var _0x425649={'raw':!![],'where':{'id':_0x408174[_0xb95e('0x49')]['id']}},_0x566571={};_0x566571[_0xb95e('0x35')]=_['keys'](db['ChatGroup'][_0xb95e('0x31')]);_0x566571[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x408174[_0xb95e('0x37')]);_0x566571['filters']=_['intersection'](_0x566571[_0xb95e('0x35')],_0x566571[_0xb95e('0x37')]);_0x425649[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x566571[_0xb95e('0x35')],qs['fields'](_0x408174['query']['fields']));_0x425649['attributes']=_0x425649['attributes'][_0xb95e('0x3b')]?_0x425649[_0xb95e('0x38')]:_0x566571['model'];if(_0x408174['query'][_0xb95e('0x4a')]){_0x425649[_0xb95e('0x4b')]=[{'all':!![]}];}_0x425649=_[_0xb95e('0x42')]({},_0x425649,_0x408174[_0xb95e('0x44')]);return db[_0xb95e('0x30')][_0xb95e('0x4c')](_0x425649)[_0xb95e('0x2a')](handleEntityNotFound(_0x18481a,null))['then'](respondWithResult(_0x18481a,null))[_0xb95e('0x47')](handleError(_0x18481a,null));};exports[_0xb95e('0x4d')]=function(_0x5827e3,_0x2cea8f){return db[_0xb95e('0x30')][_0xb95e('0x4d')](_0x5827e3['body'],{})[_0xb95e('0x2a')](respondWithResult(_0x2cea8f,0xc9))[_0xb95e('0x47')](handleError(_0x2cea8f,null));};exports[_0xb95e('0x29')]=function(_0x434acb,_0x2a28d9){if(_0x434acb[_0xb95e('0x4e')]['id']){delete _0x434acb[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')]['find']({'where':{'id':_0x434acb['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x2a28d9,null))[_0xb95e('0x2a')](saveUpdates(_0x434acb[_0xb95e('0x4e')],null))[_0xb95e('0x2a')](respondWithResult(_0x2a28d9,null))[_0xb95e('0x47')](handleError(_0x2a28d9,null));};exports[_0xb95e('0x2b')]=function(_0x25e9aa,_0x17d3d9){return db['ChatGroup']['find']({'where':{'id':_0x25e9aa[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x17d3d9,null))['then'](removeEntity(_0x17d3d9,null))[_0xb95e('0x47')](handleError(_0x17d3d9,null));};exports[_0xb95e('0x4f')]=function(_0x2771ec,_0x398026){return db['ChatGroup'][_0xb95e('0x4f')]()['then'](respondWithResult(_0x398026,null))[_0xb95e('0x47')](handleError(_0x398026,null));};exports[_0xb95e('0x50')]=function(_0x469f12,_0x2144df,_0x14c520){return db['ChatInternalMessage'][_0xb95e('0x23')]({'where':{'ChatGroupId':_0x469f12[_0xb95e('0x49')]['id'],'ToId':_0x469f12[_0xb95e('0x51')]['id'],'read':![]}})[_0xb95e('0x2a')](function(_0x154145){return{'id':_[_0xb95e('0x52')](_0x469f12['params']['id']),'count':_0x154145};})[_0xb95e('0x2a')](respondWithResult(_0x2144df,null))[_0xb95e('0x47')](handleError(_0x2144df,null));};exports[_0xb95e('0x53')]=function(_0xb1533d,_0x1ae9ee,_0x18f8c9){return db[_0xb95e('0x30')]['find']({'where':{'id':_0xb1533d['params']['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x1ae9ee,null))['then'](function(_0x455f43){if(_0x455f43){return _0x455f43[_0xb95e('0x53')](_0xb1533d['body'][_0xb95e('0x54')],_[_0xb95e('0x55')](_0xb1533d[_0xb95e('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1ae9ee,null))['catch'](handleError(_0x1ae9ee,null));};exports[_0xb95e('0x56')]=function(_0x26fffd,_0x368a4c,_0xeb4539){var _0x5daf09={};var _0x33a570={};var _0x482768;var _0x5c41cd;return db[_0xb95e('0x30')][_0xb95e('0x57')]({'where':{'id':_0x26fffd[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x368a4c,null))[_0xb95e('0x2a')](function(_0x30f5da){if(_0x30f5da){_0x482768=_0x30f5da;_0x33a570[_0xb95e('0x35')]=_[_0xb95e('0x36')](db[_0xb95e('0x58')][_0xb95e('0x31')]);_0x33a570[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x26fffd['query']);_0x33a570[_0xb95e('0x3f')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],_0x33a570['query']);_0x5daf09[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x33a570[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x5daf09['attributes']=_0x5daf09[_0xb95e('0x38')][_0xb95e('0x3b')]?_0x5daf09[_0xb95e('0x38')]:_0x33a570[_0xb95e('0x35')];_0x5daf09[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x5daf09[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_[_0xb95e('0x40')](_0x26fffd[_0xb95e('0x37')],_0x33a570[_0xb95e('0x3f')]));if(_0x26fffd[_0xb95e('0x37')][_0xb95e('0x41')]){_0x5daf09[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x5daf09[_0xb95e('0x3e')],{'$or':_[_0xb95e('0x2f')](_0x5daf09[_0xb95e('0x38')],function(_0x354e1c){var _0xb89dbe={};_0xb89dbe[_0x354e1c]={'$like':'%'+_0x26fffd['query'][_0xb95e('0x41')]+'%'};return _0xb89dbe;})});}_0x5daf09=_[_0xb95e('0x42')]({},_0x5daf09,_0x26fffd[_0xb95e('0x44')]);return _0x482768[_0xb95e('0x56')](_0x5daf09);}})[_0xb95e('0x2a')](function(_0x37d2d5){if(_0x37d2d5){_0x5c41cd=_0x37d2d5['length'];if(!_0x26fffd[_0xb95e('0x37')]['hasOwnProperty']('nolimit')){_0x5daf09[_0xb95e('0x24')]=qs[_0xb95e('0x24')](_0x26fffd[_0xb95e('0x37')]['limit']);_0x5daf09[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x26fffd[_0xb95e('0x37')][_0xb95e('0x21')]);}return _0x482768[_0xb95e('0x56')](_0x5daf09);}})['then'](function(_0x4cc383){if(_0x4cc383){return _0x4cc383?{'count':_0x5c41cd,'rows':_0x4cc383}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x368a4c,null))[_0xb95e('0x47')](handleError(_0x368a4c,null));};exports[_0xb95e('0x5a')]=function(_0x24d8ae,_0x490d23,_0x58d3be){return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x24d8ae[_0xb95e('0x49')]['id']}})['then'](handleEntityNotFound(_0x490d23,null))[_0xb95e('0x2a')](function(_0x30c277){if(_0x30c277){return _0x30c277['removeMembers'](_0x24d8ae[_0xb95e('0x37')][_0xb95e('0x54')]);}})[_0xb95e('0x2a')](respondWithStatusCode(_0x490d23,null))[_0xb95e('0x47')](handleError(_0x490d23,null));};exports[_0xb95e('0x5b')]=function(_0x4d4b87,_0x302556,_0xbf81ab){if(_0x4d4b87[_0xb95e('0x4e')]['id']){delete _0x4d4b87[_0xb95e('0x4e')]['id'];}return db[_0xb95e('0x30')][_0xb95e('0x4c')]({'where':{'id':_0x4d4b87[_0xb95e('0x49')]['id']}})[_0xb95e('0x2a')](handleEntityNotFound(_0x302556,null))['then'](function(_0x133d75){if(_0x133d75){_0x4d4b87[_0xb95e('0x4e')]['ChatGroupId']=_0x133d75['id'];return db[_0xb95e('0x5c')][_0xb95e('0x4d')](_0x4d4b87[_0xb95e('0x4e')]);}})[_0xb95e('0x2a')](respondWithResult(_0x302556,null))[_0xb95e('0x47')](handleError(_0x302556,null));};exports[_0xb95e('0x5d')]=function(_0x4c4204,_0x2a9849,_0x578957){var _0x2ce07d={};var _0x5707e9={};var _0x3e56ce;var _0x3d2a81;return db[_0xb95e('0x30')]['findOne']({'where':{'id':_0x4c4204['params']['id']}})['then'](handleEntityNotFound(_0x2a9849,null))[_0xb95e('0x2a')](function(_0x3746f6){if(_0x3746f6){_0x3e56ce=_0x3746f6;_0x5707e9['model']=_['keys'](db['ChatInternalMessage'][_0xb95e('0x31')]);_0x5707e9[_0xb95e('0x37')]=_[_0xb95e('0x36')](_0x4c4204[_0xb95e('0x37')]);_0x5707e9['filters']=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],_0x5707e9[_0xb95e('0x37')]);_0x2ce07d[_0xb95e('0x38')]=_[_0xb95e('0x39')](_0x5707e9[_0xb95e('0x35')],qs[_0xb95e('0x3a')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3a')]));_0x2ce07d[_0xb95e('0x38')]=_0x2ce07d['attributes'][_0xb95e('0x3b')]?_0x2ce07d[_0xb95e('0x38')]:_0x5707e9[_0xb95e('0x35')];_0x2ce07d[_0xb95e('0x59')]=qs[_0xb95e('0x3d')](_0x4c4204[_0xb95e('0x37')][_0xb95e('0x3d')]);_0x2ce07d[_0xb95e('0x3e')]=qs[_0xb95e('0x3f')](_['pick'](_0x4c4204[_0xb95e('0x37')],_0x5707e9[_0xb95e('0x3f')]));if(_0x4c4204['query'][_0xb95e('0x41')]){_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d['where'],{'$or':_[_0xb95e('0x2f')](_0x2ce07d[_0xb95e('0x38')],function(_0x3cf901){var _0x379738={};_0x379738[_0x3cf901]={'$like':'%'+_0x4c4204[_0xb95e('0x37')][_0xb95e('0x41')]+'%'};return _0x379738;})});}if(_0x4c4204['query'][_0xb95e('0x5e')]){var _0xaa5f19=_0x4c4204[_0xb95e('0x37')][_0xb95e('0x5e')][_0xb95e('0x5f')](',');var _0x46eff8={};_0x46eff8[_0xaa5f19[0x0]]={'$gte':moment(_0xaa5f19[0x1])[_0xb95e('0x60')](_0xb95e('0x61'))};_0x2ce07d[_0xb95e('0x3e')]=_[_0xb95e('0x42')](_0x2ce07d[_0xb95e('0x3e')],_0x46eff8);}_0x2ce07d=_[_0xb95e('0x42')]({},_0x2ce07d,_0x4c4204['options']);return _0x3e56ce[_0xb95e('0x5d')](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x5d0f2e){if(_0x5d0f2e){_0x3d2a81=_0x5d0f2e[_0xb95e('0x3b')];if(!_0x4c4204[_0xb95e('0x37')]['hasOwnProperty'](_0xb95e('0x3c'))){_0x2ce07d['limit']=qs['limit'](_0x4c4204['query'][_0xb95e('0x24')]);_0x2ce07d[_0xb95e('0x21')]=qs[_0xb95e('0x21')](_0x4c4204['query']['offset']);}return _0x3e56ce['getMessages'](_0x2ce07d);}})[_0xb95e('0x2a')](function(_0x2b8870){if(_0x2b8870){return _0x2b8870?{'count':_0x3d2a81,'rows':_0x2b8870}:null;}})[_0xb95e('0x2a')](respondWithResult(_0x2a9849,null))['catch'](handleError(_0x2a9849,null));}; \ No newline at end of file +var _0x22e1=['register','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','ChatGroup','fieldName','type','key','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','rawAttributes','keys','fields','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x22e1,0x17f));var _0x122e=function(_0x1a7415,_0x8b215e){_0x1a7415=_0x1a7415-0x0;var _0x22f558=_0x22e1[_0x1a7415];return _0x22f558;};'use strict';var emlformat=require(_0x122e('0x0'));var rimraf=require(_0x122e('0x1'));var zipdir=require(_0x122e('0x2'));var jsonpatch=require(_0x122e('0x3'));var rp=require(_0x122e('0x4'));var moment=require(_0x122e('0x5'));var BPromise=require(_0x122e('0x6'));var Mustache=require(_0x122e('0x7'));var util=require(_0x122e('0x8'));var path=require(_0x122e('0x9'));var sox=require(_0x122e('0xa'));var csv=require(_0x122e('0xb'));var ejs=require(_0x122e('0xc'));var fs=require('fs');var fs_extra=require(_0x122e('0xd'));var _=require(_0x122e('0xe'));var squel=require(_0x122e('0xf'));var crypto=require('crypto');var jsforce=require(_0x122e('0x10'));var deskjs=require(_0x122e('0x11'));var toCsv=require(_0x122e('0xb'));var querystring=require(_0x122e('0x12'));var Papa=require(_0x122e('0x13'));var Redis=require(_0x122e('0x14'));var authService=require(_0x122e('0x15'));var qs=require(_0x122e('0x16'));var as=require(_0x122e('0x17'));var hardwareService=require(_0x122e('0x18'));var logger=require(_0x122e('0x19'))('api');var utils=require(_0x122e('0x1a'));var config=require(_0x122e('0x1b'));var licenseUtil=require(_0x122e('0x1c'));var db=require(_0x122e('0x1d'))['db'];config[_0x122e('0x1e')]=_[_0x122e('0x1f')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x122e('0x1e')]));require(_0x122e('0x20'))[_0x122e('0x21')](socket);function respondWithStatusCode(_0x3dfed2,_0x33e8fe){_0x33e8fe=_0x33e8fe||0xcc;return function(_0x2431e7){if(_0x2431e7){return _0x3dfed2[_0x122e('0x22')](_0x33e8fe);}return _0x3dfed2[_0x122e('0x23')](_0x33e8fe)[_0x122e('0x24')]();};}function respondWithResult(_0xb8ac0,_0x3583fd){_0x3583fd=_0x3583fd||0xc8;return function(_0x554eab){if(_0x554eab){return _0xb8ac0[_0x122e('0x23')](_0x3583fd)[_0x122e('0x25')](_0x554eab);}};}function respondWithFilteredResult(_0x5ef404,_0x7cb24){return function(_0x174a48){if(_0x174a48){var _0x2d7b33=typeof _0x7cb24[_0x122e('0x26')]==='undefined'&&typeof _0x7cb24['limit']==='undefined';var _0x16abdd=_0x174a48['count'];var _0xb2df14=_0x2d7b33?0x0:_0x7cb24[_0x122e('0x26')];var _0x3c5665=_0x2d7b33?_0x174a48[_0x122e('0x27')]:_0x7cb24['offset']+_0x7cb24[_0x122e('0x28')];var _0x1281f7;if(_0x3c5665>=_0x16abdd){_0x3c5665=_0x16abdd;_0x1281f7=0xc8;}else{_0x1281f7=0xce;}_0x5ef404[_0x122e('0x23')](_0x1281f7);return _0x5ef404['set'](_0x122e('0x29'),_0xb2df14+'-'+_0x3c5665+'/'+_0x16abdd)[_0x122e('0x25')](_0x174a48);}return null;};}function patchUpdates(_0x5f3cb2){return function(_0x25ad83){try{jsonpatch[_0x122e('0x2a')](_0x25ad83,_0x5f3cb2,!![]);}catch(_0x2bb14c){return BPromise[_0x122e('0x2b')](_0x2bb14c);}return _0x25ad83[_0x122e('0x2c')]();};}function saveUpdates(_0x52d5f4,_0x49d888){return function(_0x56841b){if(_0x56841b){return _0x56841b[_0x122e('0x2d')](_0x52d5f4)[_0x122e('0x2e')](function(_0x1771f6){return _0x1771f6;});}return null;};}function removeEntity(_0x4273d5,_0x2e98fc){return function(_0x338575){if(_0x338575){return _0x338575['destroy']()['then'](function(){_0x4273d5['status'](0xcc)[_0x122e('0x24')]();});}};}function handleEntityNotFound(_0x3eb9b0,_0x454ca2){return function(_0x403bcb){if(!_0x403bcb){_0x3eb9b0[_0x122e('0x22')](0x194);}return _0x403bcb;};}function handleError(_0x352474,_0x537fef){_0x537fef=_0x537fef||0x1f4;return function(_0x5a44bf){logger[_0x122e('0x2f')](_0x5a44bf[_0x122e('0x30')]);if(_0x5a44bf[_0x122e('0x31')]){delete _0x5a44bf[_0x122e('0x31')];}_0x352474[_0x122e('0x23')](_0x537fef)['send'](_0x5a44bf);};}exports[_0x122e('0x32')]=function(_0x299af2,_0x28e33b){var _0x20777a={},_0x55ebf0={},_0xcef4ef={'count':0x0,'rows':[]};var _0x1e188f=_[_0x122e('0x33')](db[_0x122e('0x34')]['rawAttributes'],function(_0x4d65ba){return{'name':_0x4d65ba[_0x122e('0x35')],'type':_0x4d65ba[_0x122e('0x36')][_0x122e('0x37')]};});_0x55ebf0['model']=_[_0x122e('0x33')](_0x1e188f,'name');_0x55ebf0[_0x122e('0x38')]=_['keys'](_0x299af2['query']);_0x55ebf0[_0x122e('0x39')]=_[_0x122e('0x3a')](_0x55ebf0['model'],_0x55ebf0[_0x122e('0x38')]);_0x20777a[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x55ebf0[_0x122e('0x3c')],qs['fields'](_0x299af2[_0x122e('0x38')]['fields']));_0x20777a[_0x122e('0x3b')]=_0x20777a[_0x122e('0x3b')][_0x122e('0x3d')]?_0x20777a[_0x122e('0x3b')]:_0x55ebf0[_0x122e('0x3c')];if(!_0x299af2['query'][_0x122e('0x3e')](_0x122e('0x3f'))){_0x20777a[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x299af2[_0x122e('0x38')][_0x122e('0x28')]);_0x20777a[_0x122e('0x26')]=qs[_0x122e('0x26')](_0x299af2[_0x122e('0x38')][_0x122e('0x26')]);}_0x20777a[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x299af2[_0x122e('0x38')][_0x122e('0x41')]);_0x20777a[_0x122e('0x42')]=qs[_0x122e('0x39')](_[_0x122e('0x43')](_0x299af2['query'],_0x55ebf0[_0x122e('0x39')]),_0x1e188f);if(_0x299af2[_0x122e('0x38')]['filter']){_0x20777a[_0x122e('0x42')]=_[_0x122e('0x44')](_0x20777a[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0x1e188f,function(_0x27509c){if(_0x27509c[_0x122e('0x36')]!==_0x122e('0x45')){var _0x5ec557={};_0x5ec557[_0x27509c[_0x122e('0x31')]]={'$like':'%'+_0x299af2['query'][_0x122e('0x46')]+'%'};return _0x5ec557;}})});}_0x20777a=_[_0x122e('0x44')]({},_0x20777a,_0x299af2[_0x122e('0x47')]);var _0x192146={'where':_0x20777a['where']};return db[_0x122e('0x34')][_0x122e('0x27')](_0x192146)[_0x122e('0x2e')](function(_0x52228d){_0xcef4ef[_0x122e('0x27')]=_0x52228d;if(_0x299af2[_0x122e('0x38')][_0x122e('0x48')]){_0x20777a[_0x122e('0x49')]=[{'all':!![]}];}return db[_0x122e('0x34')][_0x122e('0x4a')](_0x20777a);})[_0x122e('0x2e')](function(_0x7e095a){_0xcef4ef[_0x122e('0x4b')]=_0x7e095a;return _0xcef4ef;})[_0x122e('0x2e')](respondWithFilteredResult(_0x28e33b,_0x20777a))['catch'](handleError(_0x28e33b,null));};exports[_0x122e('0x4c')]=function(_0x55b6d4,_0x106e27){var _0xe9151c={'raw':!![],'where':{'id':_0x55b6d4['params']['id']}},_0xc3a3c8={};_0xc3a3c8[_0x122e('0x3c')]=_['keys'](db[_0x122e('0x34')][_0x122e('0x4d')]);_0xc3a3c8[_0x122e('0x38')]=_[_0x122e('0x4e')](_0x55b6d4[_0x122e('0x38')]);_0xc3a3c8[_0x122e('0x39')]=_[_0x122e('0x3a')](_0xc3a3c8[_0x122e('0x3c')],_0xc3a3c8['query']);_0xe9151c['attributes']=_[_0x122e('0x3a')](_0xc3a3c8[_0x122e('0x3c')],qs[_0x122e('0x4f')](_0x55b6d4[_0x122e('0x38')][_0x122e('0x4f')]));_0xe9151c[_0x122e('0x3b')]=_0xe9151c[_0x122e('0x3b')]['length']?_0xe9151c[_0x122e('0x3b')]:_0xc3a3c8[_0x122e('0x3c')];if(_0x55b6d4[_0x122e('0x38')][_0x122e('0x48')]){_0xe9151c['include']=[{'all':!![]}];}_0xe9151c=_[_0x122e('0x44')]({},_0xe9151c,_0x55b6d4['options']);return db['ChatGroup'][_0x122e('0x50')](_0xe9151c)[_0x122e('0x2e')](handleEntityNotFound(_0x106e27,null))[_0x122e('0x2e')](respondWithResult(_0x106e27,null))[_0x122e('0x51')](handleError(_0x106e27,null));};exports[_0x122e('0x52')]=function(_0x218cf5,_0x461e28){return db[_0x122e('0x34')][_0x122e('0x52')](_0x218cf5[_0x122e('0x53')],{})[_0x122e('0x2e')](respondWithResult(_0x461e28,0xc9))[_0x122e('0x51')](handleError(_0x461e28,null));};exports[_0x122e('0x2d')]=function(_0x3a50d0,_0x171add){if(_0x3a50d0['body']['id']){delete _0x3a50d0[_0x122e('0x53')]['id'];}return db['ChatGroup'][_0x122e('0x50')]({'where':{'id':_0x3a50d0['params']['id']}})['then'](handleEntityNotFound(_0x171add,null))[_0x122e('0x2e')](saveUpdates(_0x3a50d0[_0x122e('0x53')],null))[_0x122e('0x2e')](respondWithResult(_0x171add,null))['catch'](handleError(_0x171add,null));};exports['destroy']=function(_0xef4668,_0x420e59){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0xef4668[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x420e59,null))[_0x122e('0x2e')](removeEntity(_0x420e59,null))['catch'](handleError(_0x420e59,null));};exports['describe']=function(_0x2825df,_0x3118a1){return db['ChatGroup'][_0x122e('0x55')]()[_0x122e('0x2e')](respondWithResult(_0x3118a1,null))['catch'](handleError(_0x3118a1,null));};exports[_0x122e('0x56')]=function(_0x5a4608,_0x56a954,_0x55b3f2){return db[_0x122e('0x57')][_0x122e('0x27')]({'where':{'ChatGroupId':_0x5a4608[_0x122e('0x54')]['id'],'ToId':_0x5a4608[_0x122e('0x58')]['id'],'read':![]}})[_0x122e('0x2e')](function(_0x4bce32){return{'id':_[_0x122e('0x59')](_0x5a4608[_0x122e('0x54')]['id']),'count':_0x4bce32};})['then'](respondWithResult(_0x56a954,null))[_0x122e('0x51')](handleError(_0x56a954,null));};exports[_0x122e('0x5a')]=function(_0x4c47f6,_0x4b4627,_0x505db5){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0x4c47f6[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x4b4627,null))[_0x122e('0x2e')](function(_0x36f38c){if(_0x36f38c){return _0x36f38c['addMembers'](_0x4c47f6[_0x122e('0x53')][_0x122e('0x5b')],_[_0x122e('0x5c')](_0x4c47f6[_0x122e('0x53')],[_0x122e('0x5b'),'id'])||{});}})[_0x122e('0x2e')](respondWithResult(_0x4b4627,null))['catch'](handleError(_0x4b4627,null));};exports[_0x122e('0x5d')]=function(_0x56b350,_0x4c7195,_0x19768d){var _0x4988b1={};var _0x18ae89={};var _0x55b3ba;var _0x48dac8;return db[_0x122e('0x34')][_0x122e('0x5e')]({'where':{'id':_0x56b350['params']['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x4c7195,null))[_0x122e('0x2e')](function(_0x403c2d){if(_0x403c2d){_0x55b3ba=_0x403c2d;_0x18ae89['model']=_['keys'](db[_0x122e('0x5f')][_0x122e('0x4d')]);_0x18ae89['query']=_[_0x122e('0x4e')](_0x56b350[_0x122e('0x38')]);_0x18ae89[_0x122e('0x39')]=_['intersection'](_0x18ae89['model'],_0x18ae89[_0x122e('0x38')]);_0x4988b1[_0x122e('0x3b')]=_[_0x122e('0x3a')](_0x18ae89['model'],qs[_0x122e('0x4f')](_0x56b350['query'][_0x122e('0x4f')]));_0x4988b1[_0x122e('0x3b')]=_0x4988b1['attributes'][_0x122e('0x3d')]?_0x4988b1['attributes']:_0x18ae89[_0x122e('0x3c')];_0x4988b1[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x56b350[_0x122e('0x38')][_0x122e('0x41')]);_0x4988b1[_0x122e('0x42')]=qs[_0x122e('0x39')](_[_0x122e('0x43')](_0x56b350[_0x122e('0x38')],_0x18ae89[_0x122e('0x39')]));if(_0x56b350[_0x122e('0x38')][_0x122e('0x46')]){_0x4988b1[_0x122e('0x42')]=_[_0x122e('0x44')](_0x4988b1[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0x4988b1[_0x122e('0x3b')],function(_0x204cae){var _0x556735={};_0x556735[_0x204cae]={'$like':'%'+_0x56b350[_0x122e('0x38')][_0x122e('0x46')]+'%'};return _0x556735;})});}_0x4988b1=_[_0x122e('0x44')]({},_0x4988b1,_0x56b350['options']);return _0x55b3ba[_0x122e('0x5d')](_0x4988b1);}})['then'](function(_0x34ee73){if(_0x34ee73){_0x48dac8=_0x34ee73[_0x122e('0x3d')];if(!_0x56b350[_0x122e('0x38')]['hasOwnProperty'](_0x122e('0x3f'))){_0x4988b1[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x56b350[_0x122e('0x38')]['limit']);_0x4988b1[_0x122e('0x26')]=qs[_0x122e('0x26')](_0x56b350['query'][_0x122e('0x26')]);}return _0x55b3ba['getMembers'](_0x4988b1);}})[_0x122e('0x2e')](function(_0x1a9408){if(_0x1a9408){return _0x1a9408?{'count':_0x48dac8,'rows':_0x1a9408}:null;}})[_0x122e('0x2e')](respondWithResult(_0x4c7195,null))[_0x122e('0x51')](handleError(_0x4c7195,null));};exports[_0x122e('0x60')]=function(_0xf508b4,_0x346f87,_0xa302fe){return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0xf508b4[_0x122e('0x54')]['id']}})['then'](handleEntityNotFound(_0x346f87,null))[_0x122e('0x2e')](function(_0x394932){if(_0x394932){return _0x394932[_0x122e('0x60')](_0xf508b4[_0x122e('0x38')]['ids']);}})[_0x122e('0x2e')](respondWithStatusCode(_0x346f87,null))[_0x122e('0x51')](handleError(_0x346f87,null));};exports[_0x122e('0x61')]=function(_0x2e2f08,_0xda49b5,_0x329a1f){if(_0x2e2f08[_0x122e('0x53')]['id']){delete _0x2e2f08[_0x122e('0x53')]['id'];}return db[_0x122e('0x34')][_0x122e('0x50')]({'where':{'id':_0x2e2f08['params']['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0xda49b5,null))[_0x122e('0x2e')](function(_0x113ead){if(_0x113ead){_0x2e2f08['body'][_0x122e('0x62')]=_0x113ead['id'];return db[_0x122e('0x57')][_0x122e('0x52')](_0x2e2f08[_0x122e('0x53')]);}})['then'](respondWithResult(_0xda49b5,null))[_0x122e('0x51')](handleError(_0xda49b5,null));};exports[_0x122e('0x63')]=function(_0x11363f,_0x3590b6,_0x4a0e5f){var _0xb4bb6d={};var _0xcad6a={};var _0x4ea96f;var _0x4b4f7f;return db[_0x122e('0x34')][_0x122e('0x5e')]({'where':{'id':_0x11363f[_0x122e('0x54')]['id']}})[_0x122e('0x2e')](handleEntityNotFound(_0x3590b6,null))[_0x122e('0x2e')](function(_0x4b5b5){if(_0x4b5b5){_0x4ea96f=_0x4b5b5;_0xcad6a[_0x122e('0x3c')]=_[_0x122e('0x4e')](db[_0x122e('0x57')][_0x122e('0x4d')]);_0xcad6a[_0x122e('0x38')]=_[_0x122e('0x4e')](_0x11363f[_0x122e('0x38')]);_0xcad6a[_0x122e('0x39')]=_[_0x122e('0x3a')](_0xcad6a[_0x122e('0x3c')],_0xcad6a[_0x122e('0x38')]);_0xb4bb6d['attributes']=_[_0x122e('0x3a')](_0xcad6a[_0x122e('0x3c')],qs[_0x122e('0x4f')](_0x11363f['query']['fields']));_0xb4bb6d[_0x122e('0x3b')]=_0xb4bb6d[_0x122e('0x3b')][_0x122e('0x3d')]?_0xb4bb6d['attributes']:_0xcad6a[_0x122e('0x3c')];_0xb4bb6d[_0x122e('0x40')]=qs[_0x122e('0x41')](_0x11363f[_0x122e('0x38')][_0x122e('0x41')]);_0xb4bb6d['where']=qs['filters'](_[_0x122e('0x43')](_0x11363f[_0x122e('0x38')],_0xcad6a['filters']));if(_0x11363f[_0x122e('0x38')][_0x122e('0x46')]){_0xb4bb6d[_0x122e('0x42')]=_[_0x122e('0x44')](_0xb4bb6d[_0x122e('0x42')],{'$or':_[_0x122e('0x33')](_0xb4bb6d[_0x122e('0x3b')],function(_0x2341d5){var _0x33a84d={};_0x33a84d[_0x2341d5]={'$like':'%'+_0x11363f[_0x122e('0x38')][_0x122e('0x46')]+'%'};return _0x33a84d;})});}if(_0x11363f['query'][_0x122e('0x64')]){var _0x47f592=_0x11363f[_0x122e('0x38')]['$gte'][_0x122e('0x65')](',');var _0x2326e4={};_0x2326e4[_0x47f592[0x0]]={'$gte':moment(_0x47f592[0x1])[_0x122e('0x66')](_0x122e('0x67'))};_0xb4bb6d['where']=_[_0x122e('0x44')](_0xb4bb6d[_0x122e('0x42')],_0x2326e4);}_0xb4bb6d=_[_0x122e('0x44')]({},_0xb4bb6d,_0x11363f[_0x122e('0x47')]);return _0x4ea96f[_0x122e('0x63')](_0xb4bb6d);}})['then'](function(_0x532827){if(_0x532827){_0x4b4f7f=_0x532827[_0x122e('0x3d')];if(!_0x11363f[_0x122e('0x38')]['hasOwnProperty'](_0x122e('0x3f'))){_0xb4bb6d[_0x122e('0x28')]=qs[_0x122e('0x28')](_0x11363f[_0x122e('0x38')][_0x122e('0x28')]);_0xb4bb6d['offset']=qs[_0x122e('0x26')](_0x11363f[_0x122e('0x38')][_0x122e('0x26')]);}return _0x4ea96f[_0x122e('0x63')](_0xb4bb6d);}})['then'](function(_0x112b50){if(_0x112b50){return _0x112b50?{'count':_0x4b4f7f,'rows':_0x112b50}:null;}})['then'](respondWithResult(_0x3590b6,null))[_0x122e('0x51')](handleError(_0x3590b6,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index e4a3432..1477c58 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 _0xc274=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a23a9,_0x17a2c0){var _0x18c27f=function(_0x3414e3){while(--_0x3414e3){_0x4a23a9['push'](_0x4a23a9['shift']());}};_0x18c27f(++_0x17a2c0);}(_0xc274,0x151));var _0x4c27=function(_0x164273,_0x44790d){_0x164273=_0x164273-0x0;var _0x2597f9=_0xc274[_0x164273];return _0x2597f9;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x4c27('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c27('0x1'),'afterUpdate':_0x4c27('0x2'),'afterDestroy':_0x4c27('0x3')};function emitEvent(_0x15133d){return function(_0x2771df,_0x17970c,_0x534d34){ChatGroupEvents[_0x4c27('0x4')](_0x15133d+':'+_0x2771df['id'],_0x2771df);ChatGroupEvents['emit'](_0x15133d,_0x2771df);_0x534d34(null);};}for(var e in events){if(events[_0x4c27('0x5')](e)){var event=events[e];ChatGroup[_0x4c27('0x6')](e,emitEvent(event));}}module[_0x4c27('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xfd50=['../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4163b8,_0x51ce44){var _0x4e8b65=function(_0x321a81){while(--_0x321a81){_0x4163b8['push'](_0x4163b8['shift']());}};_0x4e8b65(++_0x51ce44);}(_0xfd50,0x178));var _0x0fd5=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xfd50[_0x4c0622];return _0x1799d8;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x0fd5('0x0'))['db'][_0x0fd5('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0fd5('0x2')](0x0);var events={'afterCreate':_0x0fd5('0x3'),'afterUpdate':_0x0fd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbdfda5){return function(_0x1029f4,_0x4dc01d,_0x50e4ea){ChatGroupEvents[_0x0fd5('0x5')](_0xbdfda5+':'+_0x1029f4['id'],_0x1029f4);ChatGroupEvents[_0x0fd5('0x5')](_0xbdfda5,_0x1029f4);_0x50e4ea(null);};}for(var e in events){if(events[_0x0fd5('0x6')](e)){var event=events[e];ChatGroup[_0x0fd5('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 53d1476..e3eb464 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 _0xa867=['chat_groups','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa867,0x1a5));var _0x7a86=function(_0x9649dd,_0x210d04){_0x9649dd=_0x9649dd-0x0;var _0x2b9b59=_0xa867[_0x9649dd];return _0x2b9b59;};'use strict';var _=require(_0x7a86('0x0'));var util=require('util');var logger=require(_0x7a86('0x1'))(_0x7a86('0x2'));var moment=require(_0x7a86('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a86('0x4'));var fs=require('fs');var path=require(_0x7a86('0x5'));var rimraf=require(_0x7a86('0x6'));var config=require(_0x7a86('0x7'));var attributes=require(_0x7a86('0x8'));module[_0x7a86('0x9')]=function(_0x57c614,_0x53eb13){return _0x57c614[_0x7a86('0xa')]('ChatGroup',attributes,{'tableName':_0x7a86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0348=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x837df5,_0x50f668){var _0x25ca2c=function(_0x5c17e0){while(--_0x5c17e0){_0x837df5['push'](_0x837df5['shift']());}};_0x25ca2c(++_0x50f668);}(_0x0348,0x14d));var _0x8034=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0x0348[_0x497d8c];return _0xeafed7;};'use strict';var _=require(_0x8034('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8034('0x1'));var BPromise=require(_0x8034('0x2'));var rp=require(_0x8034('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8034('0x4'));var config=require(_0x8034('0x5'));var attributes=require(_0x8034('0x6'));module['exports']=function(_0x2735d9,_0x4a86e0){return _0x2735d9[_0x8034('0x7')](_0x8034('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 7d53d4c..d77701d 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 _0xf29c=['request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatGroup.socket','register'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xf29c,0xc7));var _0xcf29=function(_0x115e86,_0x1a216b){_0x115e86=_0x115e86-0x0;var _0x4d9dd0=_0xf29c[_0x115e86];return _0x4d9dd0;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rs=require(_0xcf29('0x3'));var fs=require('fs');var Redis=require(_0xcf29('0x4'));var db=require(_0xcf29('0x5'))['db'];var utils=require(_0xcf29('0x6'));var logger=require(_0xcf29('0x7'))(_0xcf29('0x8'));var config=require(_0xcf29('0x9'));var jayson=require(_0xcf29('0xa'));var client=jayson[_0xcf29('0xb')][_0xcf29('0xc')]({'port':0x232a});config[_0xcf29('0xd')]=_[_0xcf29('0xe')](config[_0xcf29('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf29('0xd')]));require(_0xcf29('0xf'))[_0xcf29('0x10')](socket);function respondWithRpcPromise(_0x18bfa3,_0x4268c6,_0x2f3bd5){return new BPromise(function(_0x2ed7fa,_0x38b122){return client[_0xcf29('0x11')](_0x18bfa3,_0x2f3bd5)[_0xcf29('0x12')](function(_0xb13a72){logger[_0xcf29('0x13')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'));logger[_0xcf29('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'),JSON['stringify'](_0xb13a72));if(_0xb13a72[_0xcf29('0x16')]){if(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x17')]===0x1f4){logger[_0xcf29('0x16')](_0xcf29('0x18'),_0x4268c6,_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);return _0x38b122(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);}logger['error'](_0xcf29('0x18'),_0x4268c6,_0xb13a72['error'][_0xcf29('0x19')]);return _0x2ed7fa(_0xb13a72['error'][_0xcf29('0x19')]);}else{logger['info'](_0xcf29('0x18'),_0x4268c6,'request\x20sent');_0x2ed7fa(_0xb13a72[_0xcf29('0x1a')][_0xcf29('0x19')]);}})['catch'](function(_0xe2b5b1){logger[_0xcf29('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xe2b5b1);_0x38b122(_0xe2b5b1);});});} \ No newline at end of file +var _0x2392=['request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x18a02d,_0x26d0d0){var _0x518e7f=function(_0x1e2586){while(--_0x1e2586){_0x18a02d['push'](_0x18a02d['shift']());}};_0x518e7f(++_0x26d0d0);}(_0x2392,0xd0));var _0x2239=function(_0x29c10d,_0x19f4e9){_0x29c10d=_0x29c10d-0x0;var _0x3bfce7=_0x2392[_0x29c10d];return _0x3bfce7;};'use strict';var _=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var moment=require('moment');var BPromise=require(_0x2239('0x2'));var rs=require(_0x2239('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2239('0x4'));var logger=require(_0x2239('0x5'))(_0x2239('0x6'));var config=require(_0x2239('0x7'));var jayson=require(_0x2239('0x8'));var client=jayson[_0x2239('0x9')][_0x2239('0xa')]({'port':0x232a});config[_0x2239('0xb')]=_[_0x2239('0xc')](config[_0x2239('0xb')],{'host':_0x2239('0xd'),'port':0x18eb});var socket=require(_0x2239('0xe'))(new Redis(config[_0x2239('0xb')]));require('./chatGroup.socket')[_0x2239('0xf')](socket);function respondWithRpcPromise(_0x176ca4,_0x4d0d43,_0x4a8d18){return new BPromise(function(_0x29bc86,_0x27f71d){return client[_0x2239('0x10')](_0x176ca4,_0x4a8d18)[_0x2239('0x11')](function(_0x123b77){logger[_0x2239('0x12')](_0x2239('0x13'),_0x4d0d43,'request\x20sent');logger[_0x2239('0x14')](_0x2239('0x15'),_0x4d0d43,'request\x20sent',JSON[_0x2239('0x16')](_0x123b77));if(_0x123b77[_0x2239('0x17')]){if(_0x123b77[_0x2239('0x17')][_0x2239('0x18')]===0x1f4){logger['error'](_0x2239('0x13'),_0x4d0d43,_0x123b77['error'][_0x2239('0x19')]);return _0x27f71d(_0x123b77[_0x2239('0x17')][_0x2239('0x19')]);}logger[_0x2239('0x17')]('ChatGroup,\x20%s,\x20%s',_0x4d0d43,_0x123b77[_0x2239('0x17')][_0x2239('0x19')]);return _0x29bc86(_0x123b77['error'][_0x2239('0x19')]);}else{logger['info'](_0x2239('0x13'),_0x4d0d43,'request\x20sent');_0x29bc86(_0x123b77[_0x2239('0x1a')]['message']);}})[_0x2239('0x1b')](function(_0x10257f){logger[_0x2239('0x17')](_0x2239('0x13'),_0x4d0d43,_0x10257f);_0x27f71d(_0x10257f);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 466deeb..d4543c7 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 _0xb28a=['emit','register','length','chatGroup:','remove','update'];(function(_0x3054a6,_0x3b172e){var _0x5141a0=function(_0x420436){while(--_0x420436){_0x3054a6['push'](_0x3054a6['shift']());}};_0x5141a0(++_0x3b172e);}(_0xb28a,0x1ae));var _0xab28=function(_0x3d8027,_0x2c6d46){_0x3d8027=_0x3d8027-0x0;var _0x468866=_0xb28a[_0x3d8027];return _0x468866;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xab28('0x0'),_0xab28('0x1')];function createListener(_0x1dc488,_0x3fafae){return function(_0x4a4d1e){_0x3fafae[_0xab28('0x2')](_0x1dc488,_0x4a4d1e);};}function removeListener(_0x4b1e73,_0x4c3485){return function(){ChatGroupEvents['removeListener'](_0x4b1e73,_0x4c3485);};}exports[_0xab28('0x3')]=function(_0x5a8729){for(var _0xc435d4=0x0,_0x237085=events[_0xab28('0x4')];_0xc435d4<_0x237085;_0xc435d4++){var _0x2978e1=events[_0xc435d4];var _0x5b6835=createListener(_0xab28('0x5')+_0x2978e1,_0x5a8729);ChatGroupEvents['on'](_0x2978e1,_0x5b6835);}}; \ No newline at end of file +var _0x3798=['chatGroup:','./chatGroup.events','update','register','length'];(function(_0x48514d,_0x5cf7f6){var _0x4d26ff=function(_0x10c337){while(--_0x10c337){_0x48514d['push'](_0x48514d['shift']());}};_0x4d26ff(++_0x5cf7f6);}(_0x3798,0x1aa));var _0x8379=function(_0x35da13,_0x446643){_0x35da13=_0x35da13-0x0;var _0x5c3781=_0x3798[_0x35da13];return _0x5c3781;};'use strict';var ChatGroupEvents=require(_0x8379('0x0'));var events=['save','remove',_0x8379('0x1')];function createListener(_0x30c68a,_0x38cc5c){return function(_0x1b8a8d){_0x38cc5c['emit'](_0x30c68a,_0x1b8a8d);};}function removeListener(_0x4f6d28,_0x3702dc){return function(){ChatGroupEvents['removeListener'](_0x4f6d28,_0x3702dc);};}exports[_0x8379('0x2')]=function(_0x2fc8f7){for(var _0x3326e9=0x0,_0x44fcef=events[_0x8379('0x3')];_0x3326e9<_0x44fcef;_0x3326e9++){var _0x5e2e92=events[_0x3326e9];var _0x4bc575=createListener(_0x8379('0x4')+_0x5e2e92,_0x2fc8f7);ChatGroupEvents['on'](_0x5e2e92,_0x4bc575);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 05c5995..efc1edc 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 _0x8fa7=['put','update','delete','destroy','/:id/members','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','/:id','getUnread','getMembers','/:id/messages','create','post','addMembers'];(function(_0x2f995b,_0x1af525){var _0x5e84e4=function(_0x234bff){while(--_0x234bff){_0x2f995b['push'](_0x2f995b['shift']());}};_0x5e84e4(++_0x1af525);}(_0x8fa7,0x157));var _0x78fa=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x8fa7[_0x3e6d5d];return _0x238923;};'use strict';var multer=require(_0x78fa('0x0'));var util=require(_0x78fa('0x1'));var path=require(_0x78fa('0x2'));var timeout=require(_0x78fa('0x3'));var express=require(_0x78fa('0x4'));var router=express[_0x78fa('0x5')]();var fs_extra=require(_0x78fa('0x6'));var auth=require(_0x78fa('0x7'));var interaction=require(_0x78fa('0x8'));var config=require(_0x78fa('0x9'));var controller=require(_0x78fa('0xa'));router[_0x78fa('0xb')]('/',auth['isAuthenticated'](),controller[_0x78fa('0xc')]);router[_0x78fa('0xb')]('/describe',auth[_0x78fa('0xd')](),controller['describe']);router['get'](_0x78fa('0xe'),auth[_0x78fa('0xd')](),controller['show']);router[_0x78fa('0xb')]('/:id/unread',auth[_0x78fa('0xd')](),controller[_0x78fa('0xf')]);router[_0x78fa('0xb')]('/:id/members',auth[_0x78fa('0xd')](),controller[_0x78fa('0x10')]);router[_0x78fa('0xb')](_0x78fa('0x11'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0x78fa('0xd')](),controller[_0x78fa('0x12')]);router[_0x78fa('0x13')]('/:id/members',auth['isAuthenticated'](),controller[_0x78fa('0x14')]);router[_0x78fa('0x13')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x78fa('0x15')]('/:id',auth[_0x78fa('0xd')](),controller[_0x78fa('0x16')]);router[_0x78fa('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x78fa('0x18')]);router['delete'](_0x78fa('0x19'),auth[_0x78fa('0xd')](),controller[_0x78fa('0x1a')]);module[_0x78fa('0x1b')]=router; \ No newline at end of file +var _0x6ec5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer'];(function(_0x2a2fd9,_0x33d050){var _0x4b9a3e=function(_0xad8f96){while(--_0xad8f96){_0x2a2fd9['push'](_0x2a2fd9['shift']());}};_0x4b9a3e(++_0x33d050);}(_0x6ec5,0x7f));var _0x56ec=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6ec5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x56ec('0x0'));var util=require(_0x56ec('0x1'));var path=require(_0x56ec('0x2'));var timeout=require(_0x56ec('0x3'));var express=require(_0x56ec('0x4'));var router=express[_0x56ec('0x5')]();var fs_extra=require(_0x56ec('0x6'));var auth=require(_0x56ec('0x7'));var interaction=require(_0x56ec('0x8'));var config=require(_0x56ec('0x9'));var controller=require(_0x56ec('0xa'));router['get']('/',auth[_0x56ec('0xb')](),controller[_0x56ec('0xc')]);router[_0x56ec('0xd')](_0x56ec('0xe'),auth[_0x56ec('0xb')](),controller[_0x56ec('0xf')]);router[_0x56ec('0xd')](_0x56ec('0x10'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x11')]);router[_0x56ec('0xd')]('/:id/unread',auth[_0x56ec('0xb')](),controller[_0x56ec('0x12')]);router['get'](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x14')]);router['get'](_0x56ec('0x15'),auth['isAuthenticated'](),controller[_0x56ec('0x16')]);router['post']('/',auth[_0x56ec('0xb')](),controller[_0x56ec('0x17')]);router[_0x56ec('0x18')](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x19')]);router['post'](_0x56ec('0x15'),auth['isAuthenticated'](),controller[_0x56ec('0x1a')]);router['put'](_0x56ec('0x10'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x1b')]);router[_0x56ec('0x1c')]('/:id',auth[_0x56ec('0xb')](),controller[_0x56ec('0x1d')]);router[_0x56ec('0x1c')](_0x56ec('0x13'),auth[_0x56ec('0xb')](),controller[_0x56ec('0x1e')]);module[_0x56ec('0x1f')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index c0cd909..9bb8c91 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 _0xbee3=['TEXT','DATE','STRING','long','BOOLEAN','exports','ENUM','star'];(function(_0x844a95,_0x5a3ae6){var _0x57f74d=function(_0x149f31){while(--_0x149f31){_0x844a95['push'](_0x844a95['shift']());}};_0x57f74d(++_0x5a3ae6);}(_0xbee3,0xd5));var _0x3bee=function(_0x7c5d6a,_0x3c9f62){_0x7c5d6a=_0x7c5d6a-0x0;var _0x3e6de7=_0xbee3[_0x7c5d6a];return _0x3e6de7;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x3bee('0x1')](_0x3bee('0x2'),'thumb'),'defaultValue':_0x3bee('0x2')},'ratingMessage':{'type':Sequelize[_0x3bee('0x3')]},'pathTranscript':{'type':Sequelize[_0x3bee('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3bee('0x4')]},'disposition':{'type':Sequelize[_0x3bee('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3bee('0x5')]},'note':{'type':Sequelize[_0x3bee('0x5')]},'browserName':{'type':Sequelize[_0x3bee('0x5')]},'browserVersion':{'type':Sequelize[_0x3bee('0x5')]},'osName':{'type':Sequelize[_0x3bee('0x5')]},'osVersion':{'type':Sequelize[_0x3bee('0x5')]},'deviceModel':{'type':Sequelize[_0x3bee('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3bee('0x5')]},'referer':{'type':Sequelize[_0x3bee('0x3')]},'customerIp':{'type':Sequelize[_0x3bee('0x5')]},'formData':{'type':Sequelize[_0x3bee('0x3')](_0x3bee('0x6'))},'read1stAt':{'type':Sequelize[_0x3bee('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3bee('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3bee('0x5')]},'customerPort':{'type':Sequelize[_0x3bee('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x3bee('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x3bee('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8286=['thumb','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x112244,_0x225883){var _0x5d4982=function(_0x95c2d5){while(--_0x95c2d5){_0x112244['push'](_0x112244['shift']());}};_0x5d4982(++_0x225883);}(_0x8286,0x66));var _0x6828=function(_0x529245,_0x3fadff){_0x529245=_0x529245-0x0;var _0x5685ac=_0x8286[_0x529245];return _0x5685ac;};'use strict';var Sequelize=require(_0x6828('0x0'));module[_0x6828('0x1')]={'closed':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6828('0x3')]},'ratingType':{'type':Sequelize[_0x6828('0x4')](_0x6828('0x5'),_0x6828('0x6')),'defaultValue':_0x6828('0x5')},'ratingMessage':{'type':Sequelize[_0x6828('0x7')]},'pathTranscript':{'type':Sequelize[_0x6828('0x7')]},'mailTranscript':{'type':Sequelize[_0x6828('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6828('0x8')]},'secondDisposition':{'type':Sequelize[_0x6828('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6828('0x8')]},'browserName':{'type':Sequelize[_0x6828('0x8')]},'browserVersion':{'type':Sequelize[_0x6828('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x6828('0x8')]},'deviceModel':{'type':Sequelize[_0x6828('0x8')]},'deviceVendor':{'type':Sequelize[_0x6828('0x8')]},'deviceType':{'type':Sequelize[_0x6828('0x8')]},'referer':{'type':Sequelize[_0x6828('0x7')]},'customerIp':{'type':Sequelize[_0x6828('0x8')]},'formData':{'type':Sequelize[_0x6828('0x7')](_0x6828('0x9'))},'read1stAt':{'type':Sequelize[_0x6828('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6828('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6828('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x6828('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2b11372..f5f3809 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 _0x5ff6=['ids','omit','hasOwnProperty','nolimit','order','sort','where','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','filter','includeAgent','push','addTags','setTags','spread','Tag','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','mkdirSync','Chat','toString','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','render','merge','contact','account','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','chat','query','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','user','fullname','email','isNull','vidaooNote','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ContactId','%s%d','System','agentIdentifier','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0x5ff6,0x106));var _0x65ff=function(_0x4dcf1c,_0x3bbf55){_0x4dcf1c=_0x4dcf1c-0x0;var _0x20fa53=_0x5ff6[_0x4dcf1c];return _0x20fa53;};'use strict';var rimraf=require(_0x65ff('0x0'));var zipdir=require('zip-dir');var rp=require(_0x65ff('0x1'));var moment=require(_0x65ff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x65ff('0x3'));var util=require(_0x65ff('0x4'));var path=require(_0x65ff('0x5'));var ejs=require(_0x65ff('0x6'));var fs=require('fs');var _=require(_0x65ff('0x7'));var Redis=require(_0x65ff('0x8'));var interaction=require(_0x65ff('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x65ff('0xa'));var logger=require(_0x65ff('0xb'))(_0x65ff('0xc'));var config=require(_0x65ff('0xd'));var db=require(_0x65ff('0xe'))['db'];config[_0x65ff('0xf')]=_[_0x65ff('0x10')](config[_0x65ff('0xf')],{'host':_0x65ff('0x11'),'port':0x18eb});var socket=require(_0x65ff('0x12'))(new Redis(config[_0x65ff('0xf')]));require(_0x65ff('0x13'))[_0x65ff('0x14')](socket);var jayson=require(_0x65ff('0x15'));var client=jayson['client'][_0x65ff('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x65ff('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5a080d,_0x1f66f3,_0x29e2c5,_0x2b65af){return new BPromise(function(_0x53bad3,_0x57d024){var _0x4aed26=_0x2b65af||client;return _0x4aed26[_0x65ff('0x17')](_0x5a080d,_0x29e2c5)['then'](function(_0x14eab5){logger[_0x65ff('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x65ff('0x19'));logger[_0x65ff('0x1a')](_0x65ff('0x1b'),_0x1f66f3,_0x65ff('0x19'),JSON[_0x65ff('0x1c')](_0x14eab5));if(_0x14eab5[_0x65ff('0x1d')]){if(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1e')]===0x1f4){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x57d024(_0x14eab5[_0x65ff('0x1d')]['message']);}logger[_0x65ff('0x1d')](_0x65ff('0x20'),_0x1f66f3,_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);return _0x53bad3(_0x14eab5[_0x65ff('0x1d')][_0x65ff('0x1f')]);}else{logger[_0x65ff('0x18')](_0x65ff('0x20'),_0x1f66f3,'request\x20sent');_0x53bad3(_0x14eab5[_0x65ff('0x21')]['message']);}})[_0x65ff('0x22')](function(_0xb54ea){logger[_0x65ff('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x1f66f3,_0xb54ea);_0x57d024(_0xb54ea);});});}function respondWithStatusCode(_0x315db4,_0x3981e6){_0x3981e6=_0x3981e6||0xcc;return function(_0x44d125){if(_0x44d125){return _0x315db4[_0x65ff('0x23')](_0x3981e6);}return _0x315db4[_0x65ff('0x24')](_0x3981e6)[_0x65ff('0x25')]();};}function respondWithResult(_0x53cba9,_0x1fa38e){_0x1fa38e=_0x1fa38e||0xc8;return function(_0x3d9a22){if(_0x3d9a22){return _0x53cba9['status'](_0x1fa38e)[_0x65ff('0x26')](_0x3d9a22);}};}function respondWithFilteredResult(_0x328f9c,_0x1a85c4){return function(_0x4cdadb){if(_0x4cdadb){var _0x238d58=typeof _0x1a85c4[_0x65ff('0x27')]===_0x65ff('0x28')&&typeof _0x1a85c4[_0x65ff('0x29')]===_0x65ff('0x28');var _0x496e95=_0x4cdadb[_0x65ff('0x2a')];var _0x398386=_0x238d58?0x0:_0x1a85c4['offset'];var _0xbfb1d2=_0x238d58?_0x4cdadb[_0x65ff('0x2a')]:_0x1a85c4[_0x65ff('0x27')]+_0x1a85c4[_0x65ff('0x29')];var _0x33dadd;if(_0xbfb1d2>=_0x496e95){_0xbfb1d2=_0x496e95;_0x33dadd=0xc8;}else{_0x33dadd=0xce;}_0x328f9c['status'](_0x33dadd);return _0x328f9c[_0x65ff('0x2b')]('Content-Range',_0x398386+'-'+_0xbfb1d2+'/'+_0x496e95)['json'](_0x4cdadb);}return null;};}function saveUpdates(_0x141a72){return function(_0x41e6b3){if(_0x41e6b3){return _0x41e6b3[_0x65ff('0x2c')](_0x141a72)[_0x65ff('0x2d')](function(_0x2bca0c){return _0x2bca0c;});}return null;};}function removeEntity(_0x2f7660){return function(_0x4c3eb7){if(_0x4c3eb7){return _0x4c3eb7[_0x65ff('0x2e')]()[_0x65ff('0x2d')](function(){_0x2f7660['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5aee){return function(_0x16a8e8){if(!_0x16a8e8){_0x4b5aee[_0x65ff('0x23')](0x194);}return _0x16a8e8;};}function handleError(_0xb51a6d,_0x37624c){_0x37624c=_0x37624c||0x1f4;return function(_0x5cd695){logger[_0x65ff('0x1d')](_0x5cd695[_0x65ff('0x2f')]);if(_0x5cd695[_0x65ff('0x30')]){delete _0x5cd695[_0x65ff('0x30')];}_0xb51a6d[_0x65ff('0x24')](_0x37624c)['send'](_0x5cd695);};}function getMustacheRender(_0x3abec3,_0x2acdc4){return Mustache[_0x65ff('0x31')](_0x3abec3,_[_0x65ff('0x32')](_0x2acdc4['body'],{'contact':_0x2acdc4[_0x65ff('0x33')],'message':_0x2acdc4[_0x65ff('0x1f')],'agent':_0x2acdc4['agent'],'interaction':_0x2acdc4['interaction'],'account':_0x2acdc4[_0x65ff('0x34')]}))||'';}exports[_0x65ff('0x35')]=function(_0x59fe7e,_0x8255ab){var _0x273a96={};var _0x389352=_['map'](db[_0x65ff('0x36')][_0x65ff('0x37')],function(_0x445d28){return{'name':_0x445d28[_0x65ff('0x38')],'type':_0x445d28[_0x65ff('0x39')]['key']};});_0x273a96=qs[_0x65ff('0x3a')](_0x389352,_0x59fe7e);return interaction['findAll'](_0x65ff('0x3b'),_0x59fe7e[_0x65ff('0x3c')],_0x59fe7e['user'],_0x273a96,_0x389352)[_0x65ff('0x2d')](respondWithFilteredResult(_0x8255ab,_0x273a96))['catch'](handleError(_0x8255ab,null));};exports[_0x65ff('0x3d')]=function(_0x56c069,_0xb54c14){var _0x1a4058={'raw':![],'where':{'id':_0x56c069[_0x65ff('0x3e')]['id']}},_0x45017e={};_0x45017e[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db['ChatInteraction'][_0x65ff('0x37')]);_0x45017e[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x56c069[_0x65ff('0x3c')]);_0x45017e[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],_0x45017e[_0x65ff('0x3c')]);_0x1a4058['attributes']=_[_0x65ff('0x42')](_0x45017e[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x56c069[_0x65ff('0x3c')][_0x65ff('0x43')]));_0x1a4058[_0x65ff('0x44')]=_0x1a4058[_0x65ff('0x44')][_0x65ff('0x45')]?_0x1a4058[_0x65ff('0x44')]:_0x45017e[_0x65ff('0x3f')];if(_0x56c069['query'][_0x65ff('0x46')]){_0x1a4058[_0x65ff('0x47')]=[{'all':!![]}];}_0x1a4058=_['merge']({},_0x1a4058,_0x56c069[_0x65ff('0x48')]);return db[_0x65ff('0x36')][_0x65ff('0x49')](_0x1a4058)['then'](handleEntityNotFound(_0xb54c14,null))[_0x65ff('0x2d')](respondWithResult(_0xb54c14,null))[_0x65ff('0x22')](handleError(_0xb54c14,null));};exports[_0x65ff('0x4a')]=function(_0x464bc3,_0x438753){return db[_0x65ff('0x36')][_0x65ff('0x4a')](_0x464bc3[_0x65ff('0x4b')],{})[_0x65ff('0x2d')](respondWithResult(_0x438753,0xc9))[_0x65ff('0x22')](handleError(_0x438753,null));};exports[_0x65ff('0x2c')]=function(_0x115335,_0x4697fe){if(_0x115335[_0x65ff('0x4b')]['id']){delete _0x115335['body']['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x115335[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x4697fe,null))[_0x65ff('0x2d')](saveUpdates(_0x115335[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x4697fe,null))[_0x65ff('0x22')](handleError(_0x4697fe,null));};exports[_0x65ff('0x2e')]=function(_0x302906,_0x54c566){return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x302906[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x54c566,null))[_0x65ff('0x2d')](removeEntity(_0x54c566,null))[_0x65ff('0x22')](handleError(_0x54c566,null));};exports[_0x65ff('0x4c')]=function(_0x3be640,_0x321f15){return db[_0x65ff('0x36')]['describe']()[_0x65ff('0x2d')](respondWithResult(_0x321f15,null))['catch'](handleError(_0x321f15,null));};exports[_0x65ff('0x4d')]=function(_0x1c44ad,_0x4c71d8){var _0x550b01=_0x1c44ad[_0x65ff('0x3e')]['id'];var _0x1e8da8;var _0x35647b;var _0x562c6e;return db['ChatInteraction'][_0x65ff('0x4e')]({'where':{'id':_0x550b01}})[_0x65ff('0x2d')](function(_0x30b85b){_0x1e8da8=_0x30b85b;return db['ChatWebsite'][_0x65ff('0x4e')]({'where':{'id':_0x30b85b[_0x65ff('0x4f')]},'attributes':['id',_0x65ff('0x50'),_0x65ff('0x51'),'vidaooTopic','vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65ff('0x2d')](function(_0x423743){if(_0x423743&&_0x423743[_0x65ff('0x50')]&&_0x423743[_0x65ff('0x51')]){_0x35647b=_0x423743;var _0x59002f={'interaction':{'id':_0x550b01},'agent':{'id':_0x1c44ad[_0x65ff('0x52')]['id'],'name':_0x1c44ad[_0x65ff('0x52')]['name'],'fullname':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x53')],'email':_0x1c44ad[_0x65ff('0x52')][_0x65ff('0x54')]},'contact':_0x1c44ad['body'][_0x65ff('0x33')],'account':_0x1c44ad[_0x65ff('0x4b')][_0x65ff('0x34')]};var _0x236b79={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x423743['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c44ad['user'][_0x65ff('0x54')]],'buttons':null,'topic':_0x35647b['vidaooTopic'],'note':_[_0x65ff('0x55')](_0x35647b['vidaooNote'])?null:getMustacheRender(_0x35647b[_0x65ff('0x56')],_0x59002f),'metadata':null},'redirect':_0x65ff('0x57'),'json':!![]};try{if(!_['isNull'](_0x35647b['vidaooMetadata'])){var _0x5a7b7a=getMustacheRender(_0x35647b[_0x65ff('0x58')],_0x59002f);var _0x73b22=JSON['parse'](_0x5a7b7a);_0x236b79[_0x65ff('0x4b')][_0x65ff('0x59')]=_0x73b22;}}catch(_0x47a63c){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x5c'));}return rp(_0x236b79);}else{throw new db['Sequelize']['ValidationError'](_0x65ff('0x5d'));}})['then'](function(_0x26923a){_0x562c6e=_0x26923a;if(_0x562c6e['id']){var _0x30be4c={'body':_0x562c6e[_0x65ff('0x5e')],'ChatWebsiteId':_0x35647b['id'],'ChatInteractionId':_0x1e8da8['id'],'direction':_0x65ff('0x5f'),'UserId':_0x1c44ad[_0x65ff('0x52')]['id']};return db[_0x65ff('0x60')][_0x65ff('0x4a')](_0x30be4c,{});}else{throw new db['Sequelize'][(_0x65ff('0x5b'))](_0x65ff('0x61'));}})[_0x65ff('0x2d')](function(){return _0x1e8da8['updateAttributes']({'vidaooSessionId':_0x562c6e['id']});})[_0x65ff('0x2d')](respondWithResult(_0x4c71d8,null))[_0x65ff('0x22')](handleError(_0x4c71d8,null));};exports[_0x65ff('0x62')]=function(_0x395fd5,_0x38fa78){if(_0x395fd5[_0x65ff('0x4b')]['id']){delete _0x395fd5[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x395fd5[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64')}]})['then'](handleEntityNotFound(_0x38fa78,null))[_0x65ff('0x2d')](saveUpdates(_0x395fd5[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](respondWithResult(_0x38fa78,null))['catch'](handleError(_0x38fa78,null));};exports['abandon']=function(_0x2f2185,_0x546a71){if(_0x2f2185[_0x65ff('0x4b')]['id']){delete _0x2f2185[_0x65ff('0x4b')]['id'];}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x2f2185[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](function(_0x3000f9){if(!_0x3000f9){logger[_0x65ff('0x1d')](_0x65ff('0x65'),_0x65ff('0x66'),0x194,'entity\x20not\x20found');_0x546a71[_0x65ff('0x23')](0x194);}else{if(_0x3000f9[_0x65ff('0x67')]){throw new db[(_0x65ff('0x5a'))][(_0x65ff('0x5b'))](_0x65ff('0x68'));}}return _0x3000f9;})[_0x65ff('0x2d')](function(_0x4c021a){if(_0x4c021a){return _0x4c021a[_0x65ff('0x2c')]({'closed':_0x2f2185[_0x65ff('0x4b')]['closed'],'disposition':_0x2f2185['body'][_0x65ff('0x69')]})[_0x65ff('0x2d')](function(_0x2348b3){return _0x2348b3;});}})[_0x65ff('0x2d')](function(){return respondWithRpcPromise('AbandonInteraction',_0x65ff('0x66'),_0x2f2185['body'],client9004);})[_0x65ff('0x2d')](respondWithResult(_0x546a71,null))['catch'](handleError(_0x546a71,null));};exports['attachmentUpload']=function(_0x4f3ad0,_0x514ddd){_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x30')]=_0x4f3ad0[_0x65ff('0x6a')][_0x65ff('0x6b')];_0x4f3ad0[_0x65ff('0x4b')][_0x65ff('0x6c')]=_0x4f3ad0['file'][_0x65ff('0x6d')];_0x4f3ad0['body'][_0x65ff('0x39')]=_0x4f3ad0['file'][_0x65ff('0x6e')];return db[_0x65ff('0x6f')][_0x65ff('0x4a')](_0x4f3ad0[_0x65ff('0x4b')])[_0x65ff('0x2d')](respondWithResult(_0x514ddd,0xc9))[_0x65ff('0x22')](handleError(_0x514ddd,null));};exports[_0x65ff('0x70')]=function(_0x41641a,_0x23e99a){return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x41641a[_0x65ff('0x3e')]['id']},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null))['then'](function(_0xafcdcd){if(_0xafcdcd){if(_0xafcdcd[_0x65ff('0x71')]){return _0x23e99a[_0x65ff('0x24')](0x193)[_0x65ff('0x26')]({'status':0x193,'message':_0x65ff('0x72')});}return db['Attachment']['findOne']({'where':{'id':_0x41641a[_0x65ff('0x3c')][_0x65ff('0x73')]},'raw':!![]})[_0x65ff('0x2d')](handleEntityNotFound(_0x23e99a,null));}})[_0x65ff('0x2d')](function(_0x529b49){if(_0x529b49){var _0x2a0e86=_0x529b49['ChatOfflineMessageId']!==null;var _0x34d33c=path['join'](config[_0x65ff('0x74')],_0x65ff('0x75'));if(_0x2a0e86){_0x34d33c=path[_0x65ff('0x76')](_0x34d33c,_0x65ff('0x77'));}var _0x46f32a=path[_0x65ff('0x76')](_0x34d33c,_0x529b49[_0x65ff('0x6c')]);return _0x23e99a[_0x65ff('0x78')](_0x46f32a);}})[_0x65ff('0x22')](handleError(_0x23e99a,null));};exports[_0x65ff('0x79')]=function(_0x335210,_0x45f629){var _0x5a3f85=null;var _0x5da9c2=null;var _0x34a7c1=null;if(_0x335210['body']['id']){delete _0x335210[_0x65ff('0x4b')]['id'];}if(_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')]){_0x34a7c1=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0x7b'),util[_0x65ff('0x7c')](_0x65ff('0x7d'),Date[_0x65ff('0x7e')]()));_0x335210[_0x65ff('0x4b')][_0x65ff('0x7f')]=_0x34a7c1;}return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x335210[_0x65ff('0x3e')]['id']},'include':[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'include':[{'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81')}]}]})[_0x65ff('0x2d')](handleEntityNotFound(_0x45f629,null))['then'](saveUpdates(_0x335210[_0x65ff('0x4b')],null))[_0x65ff('0x2d')](function(_0x241c4a){if(_0x241c4a){_0x5a3f85=_0x241c4a;return db[_0x65ff('0x82')][_0x65ff('0x49')]({'where':{'id':_0x5a3f85['ChatWebsiteId']}});}})['then'](function(_0x47b687){if(_0x47b687){_0x5da9c2=_0x47b687;return db['CmContact']['find']({'where':{'id':_0x5a3f85[_0x65ff('0x83')]}});}})[_0x65ff('0x2d')](function(_0x5215ba){if(_0x5215ba){if(_0x34a7c1){var _0x34e4de=null;for(var _0x5370b2=0x1;_0x5370b2<_0x5a3f85[_0x65ff('0x80')][_0x65ff('0x45')];++_0x5370b2){_0x34e4de=_0x5a3f85[_0x65ff('0x80')][_0x5370b2];var _0xf44d8c=_0x34e4de['UserId']?util['format'](_0x65ff('0x84'),_0x5da9c2['agentAlias'],_0x34e4de['UserId']):_0x65ff('0x85');var _0x4d3276=_0x335210[_0x65ff('0x4b')]['customer']||util[_0x65ff('0x7c')](_0x65ff('0x84'),'Visitor',_0x34e4de[_0x65ff('0x83')]);switch(_0x5da9c2[_0x65ff('0x86')]){case'website_alias':_0xf44d8c=_0x34e4de['UserId']?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de['UserId']):'System';break;case _0x65ff('0x88'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de['User'][_0x65ff('0x89')]||_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:'System';break;case _0x65ff('0x8a'):_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?_0x34e4de[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85');break;default:_0xf44d8c=_0x34e4de[_0x65ff('0x67')]?util[_0x65ff('0x7c')](_0x65ff('0x84'),_0x5da9c2[_0x65ff('0x87')],_0x34e4de[_0x65ff('0x67')]):'System';}var _0x3ccf34=util[_0x65ff('0x7c')](_0x65ff('0x8b'),moment(_0x34e4de[_0x65ff('0x8c')])['format'](_0x65ff('0x8d')),_0x34e4de[_0x65ff('0x8e')]==='in'?_0x4d3276:_0xf44d8c,_0x34e4de[_0x65ff('0x4b')]);if(!_0x34e4de[_0x65ff('0x8f')]){fs[_0x65ff('0x90')](_0x34a7c1,_0x3ccf34);}}return db[_0x65ff('0x91')][_0x65ff('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x65ff('0x92')],'as':_0x65ff('0x93'),'raw':!![],'include':[{'model':db[_0x65ff('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x65ff('0x2d')](function(_0x57a2f3){if(!_0x57a2f3||!_0x57a2f3['Smtp']||!_0x335210[_0x65ff('0x4b')])return _0x5a3f85;var _0x31773f=_0x57a2f3[_0x65ff('0x95')]();return respondWithRpcPromise('SendMail',_0x65ff('0x96'),{'account':_0x31773f,'message':{'from':util['format'](_0x65ff('0x97'),_0x57a2f3[_0x65ff('0x30')],_0x57a2f3[_0x65ff('0x54')]||_0x57a2f3[_0x65ff('0x93')][_0x65ff('0x52')]),'to':_0x335210[_0x65ff('0x4b')][_0x65ff('0x7a')],'subject':_0x65ff('0x98'),'text':util[_0x65ff('0x7c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x335210['body'][_0x65ff('0x7a')]),'attachments':[{'path':_0x34a7c1}]}})['then'](function(){return _0x5a3f85;})[_0x65ff('0x22')](function(_0x592bdc){logger[_0x65ff('0x1d')](_0x592bdc);});})[_0x65ff('0x2d')](respondWithStatusCode(_0x45f629,0xc8))['catch'](handleError(_0x45f629,null));};exports['addMessage']=function(_0x39e4a2,_0x59b75a){return db['ChatMessage'][_0x65ff('0x49')]({'where':{'id':_0x39e4a2[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x59b75a,null))[_0x65ff('0x2d')](function(_0x1441c){if(_0x1441c){return _0x1441c[_0x65ff('0x99')](_0x39e4a2[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x39e4a2[_0x65ff('0x4b')],['ids','id'])||{});}})[_0x65ff('0x2d')](respondWithResult(_0x59b75a,null))[_0x65ff('0x22')](handleError(_0x59b75a,null));};exports['getMessages']=function(_0x1ebc73,_0x26099d){var _0x179f06={'raw':![],'where':{}};var _0x4e5641={};var _0x587450={'count':0x0,'rows':[]};return db[_0x65ff('0x36')]['findOne']({'where':{'id':_0x1ebc73[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x26099d,null))['then'](function(_0x3ac77e){if(_0x3ac77e){_0x4e5641[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x4e5641['query']=_[_0x65ff('0x40')](_0x1ebc73['query']);_0x4e5641['filters']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],_0x4e5641[_0x65ff('0x3c')]);_0x179f06['attributes']=_[_0x65ff('0x42')](_0x4e5641[_0x65ff('0x3f')],qs['fields'](_0x1ebc73['query'][_0x65ff('0x43')]));_0x179f06[_0x65ff('0x44')]=_0x179f06[_0x65ff('0x44')][_0x65ff('0x45')]?_0x179f06[_0x65ff('0x44')]:_0x4e5641[_0x65ff('0x3f')];if(!_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x179f06['limit']=qs[_0x65ff('0x29')](_0x1ebc73['query'][_0x65ff('0x29')]);_0x179f06['offset']=qs['offset'](_0x1ebc73[_0x65ff('0x3c')]['offset']);}_0x179f06[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x179f06[_0x65ff('0xa0')]=qs['filters'](_['pick'](_0x1ebc73[_0x65ff('0x3c')],_0x4e5641[_0x65ff('0x41')]));_0x179f06[_0x65ff('0xa0')]['ChatInteractionId']=_0x3ac77e['id'];if(_0x1ebc73[_0x65ff('0x3c')]['filter']){_0x179f06['where']=_[_0x65ff('0x32')](_0x179f06['where'],{'$or':_[_0x65ff('0xa1')](_0x179f06[_0x65ff('0x44')],function(_0x4f6353){var _0x5903fd={};_0x5903fd[_0x4f6353]={'$like':'%'+_0x1ebc73[_0x65ff('0x3c')]['filter']+'%'};return _0x5903fd;})});}if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')]){var _0x2be3db=_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0xa2')][_0x65ff('0xa3')](',');var _0x593585={};_0x593585[_0x2be3db[0x0]]={'$gte':moment(_0x2be3db[0x1])['format'](_0x65ff('0xa4'))};_0x179f06[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x179f06[_0x65ff('0xa0')],_0x593585);}_0x179f06=_[_0x65ff('0x32')]({},_0x179f06,_0x1ebc73[_0x65ff('0x48')]);return db[_0x65ff('0x60')]['count']({'where':_0x179f06['where']})[_0x65ff('0x2d')](function(_0x2349a2){_0x587450['count']=_0x2349a2;if(_0x1ebc73[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x179f06['include']=[{'all':!![]}];}return db[_0x65ff('0x60')][_0x65ff('0xa5')](_0x179f06);})[_0x65ff('0x2d')](function(_0x15a540){_0x587450[_0x65ff('0xa6')]=_0x15a540;return _0x587450;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x26099d,_0x179f06))[_0x65ff('0x22')](handleError(_0x26099d,null));};exports[_0x65ff('0xa7')]=function(_0x33d98c,_0x1670fd){var _0x9ae205={'where':{}},_0x10bf52={},_0x522e6a={'count':0x0,'rows':[]};return db[_0x65ff('0x36')][_0x65ff('0x4e')]({'where':{'id':_0x33d98c[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x1670fd,null))['then'](function(_0x46cbe3){if(_0x46cbe3){_0x10bf52[_0x65ff('0x3f')]=_[_0x65ff('0x40')](db[_0x65ff('0x60')][_0x65ff('0x37')]);_0x10bf52[_0x65ff('0x3c')]=_[_0x65ff('0x40')](_0x33d98c[_0x65ff('0x3c')]);_0x10bf52[_0x65ff('0x41')]=_[_0x65ff('0x42')](_0x10bf52[_0x65ff('0x3f')],_0x10bf52[_0x65ff('0x3c')]);_0x9ae205[_0x65ff('0x44')]=_['intersection'](_0x10bf52[_0x65ff('0x3f')],qs[_0x65ff('0x43')](_0x33d98c['query'][_0x65ff('0x43')]));_0x9ae205[_0x65ff('0x44')]=_0x9ae205['attributes'][_0x65ff('0x45')]?_0x9ae205[_0x65ff('0x44')]:_0x10bf52['model'];if(!_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9c')](_0x65ff('0x9d'))){_0x9ae205[_0x65ff('0x29')]=qs[_0x65ff('0x29')](_0x33d98c['query'][_0x65ff('0x29')]);_0x9ae205['offset']=qs['offset'](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x27')]);}_0x9ae205[_0x65ff('0x9e')]=qs[_0x65ff('0x9f')](_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x9f')]);_0x9ae205[_0x65ff('0xa0')]=qs[_0x65ff('0x41')](_[_0x65ff('0xa8')](_0x33d98c['query'],_0x10bf52[_0x65ff('0x41')]));_0x9ae205[_0x65ff('0xa0')]['ChatInteractionId']=_0x46cbe3['id'];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]){_0x9ae205[_0x65ff('0xa0')]=_[_0x65ff('0x32')](_0x9ae205[_0x65ff('0xa0')],{'$or':_['map'](_0x9ae205[_0x65ff('0x44')],function(_0xe56200){var _0x16cdff={};_0x16cdff[_0xe56200]={'$like':'%'+_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xa9')]+'%'};return _0x16cdff;})});}_0x9ae205[_0x65ff('0xa0')][_0x65ff('0x8f')]=![];if(_0x33d98c[_0x65ff('0x3c')]['id']){_0x9ae205[_0x65ff('0xa0')]['id']={'$gt':_0x33d98c[_0x65ff('0x3c')]['id']};}_0x9ae205=_[_0x65ff('0x32')]({},_0x9ae205,_0x33d98c['options']);return db['ChatMessage'][_0x65ff('0x2a')]({'where':_0x9ae205[_0x65ff('0xa0')]})[_0x65ff('0x2d')](function(_0x212766){_0x522e6a[_0x65ff('0x2a')]=_0x212766;_0x9ae205['include']=[];if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0xaa')]){_0x9ae205[_0x65ff('0x47')][_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id',_0x65ff('0x53'),_0x65ff('0x89')]});}if(_0x33d98c[_0x65ff('0x3c')][_0x65ff('0x46')]){_0x9ae205[_0x65ff('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x65ff('0xa5')](_0x9ae205);})['then'](function(_0x438804){_0x522e6a[_0x65ff('0xa6')]=_0x438804;return _0x522e6a;});}})[_0x65ff('0x2d')](respondWithFilteredResult(_0x1670fd,_0x9ae205))[_0x65ff('0x22')](handleError(_0x1670fd,null));};exports[_0x65ff('0xac')]=function(_0x1ea5b5,_0x3fdfc5){return db[_0x65ff('0x36')]['find']({'where':{'id':_0x1ea5b5[_0x65ff('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0x65ff('0x2d')](function(_0xa26331){if(_0xa26331){return _0xa26331[_0x65ff('0xad')](_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')],_[_0x65ff('0x9b')](_0x1ea5b5[_0x65ff('0x4b')],[_0x65ff('0x9a'),'id'])||{})[_0x65ff('0xae')](function(){return db[_0x65ff('0xaf')][_0x65ff('0xa5')]({'attributes':['id','name','color'],'where':{'id':_0x1ea5b5[_0x65ff('0x4b')][_0x65ff('0x9a')]}});})[_0x65ff('0x2d')](function(_0x1f1b64){socket[_0x65ff('0xb0')]('chatInteractionTags:save',{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]});return{'id':Number(_0x1ea5b5['params']['id']),'tags':_0x1f1b64||[]};});}})[_0x65ff('0x2d')](respondWithResult(_0x3fdfc5,null))[_0x65ff('0x22')](handleError(_0x3fdfc5,null));};exports[_0x65ff('0xb1')]=function(_0x3534c1,_0x33f14f){return db['ChatInteraction'][_0x65ff('0x49')]({'where':{'id':_0x3534c1[_0x65ff('0x3e')]['id']}})[_0x65ff('0x2d')](handleEntityNotFound(_0x33f14f,null))[_0x65ff('0x2d')](function(_0x1ed4b9){if(_0x1ed4b9){return _0x1ed4b9[_0x65ff('0xb1')](_0x3534c1['query'][_0x65ff('0x9a')]);}})[_0x65ff('0x2d')](respondWithStatusCode(_0x33f14f,null))[_0x65ff('0x22')](handleError(_0x33f14f,null));};exports[_0x65ff('0x78')]=function(_0x448cb7,_0x40427e){var _0x3e7fc9=moment()[_0x65ff('0xb2')]()['toString']();var _0x197f54=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),'files',_0x65ff('0xb4'));var _0x3fa5b7=path[_0x65ff('0x76')](config[_0x65ff('0x74')],_0x65ff('0xb3'),_0x65ff('0xb5'),_0x65ff('0xb6'));var _0x488ce7=path[_0x65ff('0x76')](_0x197f54,_0x3e7fc9);var _0x24ae9f=util[_0x65ff('0x7c')](_0x65ff('0xb7'),_0x448cb7['params']['id'],_0x3e7fc9);var _0x55cbf9=path['join'](_0x197f54,_0x24ae9f);var _0x383fe9=[];_0x383fe9['push']({'model':db[_0x65ff('0x81')],'as':_0x65ff('0x81'),'attributes':['id','fullname'],'raw':!![]});_0x383fe9[_0x65ff('0xab')]({'model':db[_0x65ff('0x63')],'as':_0x65ff('0x64'),'attributes':['id',_0x65ff('0xb8'),_0x65ff('0xb9')],'raw':!![]});if(_0x448cb7['query']['attachments']){_0x383fe9[_0x65ff('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x592cde=[{'model':db[_0x65ff('0x60')],'as':_0x65ff('0x80'),'attributes':['id',_0x65ff('0x4b'),_0x65ff('0x8c'),_0x65ff('0x8e'),_0x65ff('0x8f'),_0x65ff('0xba')],'include':_0x383fe9}];_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x82')],'as':_0x65ff('0xbb'),'attributes':['id','name']});_0x592cde[_0x65ff('0xab')]({'model':db[_0x65ff('0x81')],'as':_0x65ff('0xbc'),'attributes':['id',_0x65ff('0x53')]});return db[_0x65ff('0x36')][_0x65ff('0x49')]({'where':{'id':_0x448cb7[_0x65ff('0x3e')]['id']},'include':_0x592cde})[_0x65ff('0x2d')](handleEntityNotFound(_0x40427e,null))['then'](function(_0x37a3f2){if(_0x37a3f2){var _0x44f66a=_0x37a3f2['get']({'plain':!![]});fs[_0x65ff('0xbd')](_0x488ce7);var _0x3e74f2={'channel':_0x65ff('0xbe'),'account':_0x44f66a[_0x65ff('0xbb')][_0x65ff('0x30')],'agent':_0x44f66a[_0x65ff('0xbc')]?_0x44f66a[_0x65ff('0xbc')]['fullname']:'N.A.','createdAt':moment(_0x44f66a[_0x65ff('0x8c')])[_0x65ff('0x7c')](_0x65ff('0xa4'))[_0x65ff('0xbf')](),'closedAt':_0x44f66a[_0x65ff('0x71')]?moment(_0x44f66a['closedAt'])['format'](_0x65ff('0xa4'))[_0x65ff('0xbf')]():'','disposition':_0x44f66a[_0x65ff('0x69')],'chatInfo':{'browser':_0x44f66a[_0x65ff('0xc0')],'os':_0x44f66a[_0x65ff('0xc1')],'referer':_0x44f66a[_0x65ff('0xc2')],'customerIp':_0x44f66a[_0x65ff('0xc3')],'customerPort':_0x44f66a['customerPort']?_0x44f66a[_0x65ff('0xc4')]:_0x65ff('0xc5')},'messages':_(_0x44f66a['Messages'])[_0x65ff('0xc6')]()['filter']({'secret':![]})['map'](function(_0x433eea){if(_0x433eea[_0x65ff('0x6f')]){var _0x16e893=path[_0x65ff('0x76')](_0x3fa5b7,_0x433eea['Attachment']['basename']);if(fs[_0x65ff('0xc7')](_0x16e893)){fs['createReadStream'](_0x16e893)[_0x65ff('0xc8')](fs['createWriteStream'](path['join'](_0x488ce7,_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')])));}}return{'date':moment(_0x433eea[_0x65ff('0x8c')])[_0x65ff('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x65ff('0xbf')](),'sender':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?_0x433eea['User']?_0x433eea[_0x65ff('0x81')][_0x65ff('0x53')]:_0x65ff('0x85'):_0x433eea['Contact'][_0x65ff('0xb8')]+(_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]?'\x20'+_0x433eea[_0x65ff('0x64')][_0x65ff('0xb9')]:''),'body':_0x433eea['Attachment']?_0x433eea[_0x65ff('0x6f')][_0x65ff('0x6c')]:_0x433eea[_0x65ff('0x4b')],'direction':_0x433eea[_0x65ff('0x8e')]===_0x65ff('0x5f')?'A':'C','secret':_0x433eea[_0x65ff('0x8f')],'read':_0x433eea[_0x65ff('0xba')],'attachment':_0x433eea[_0x65ff('0x6f')]};})[_0x65ff('0xc9')]()};return ejs[_0x65ff('0xca')](path[_0x65ff('0x76')](config['root'],'server',_0x65ff('0xcb'),_0x65ff('0xcc')),{'interaction':_0x3e74f2})[_0x65ff('0x2d')](function(_0x465dad){var _0x411545=path[_0x65ff('0x76')](_0x488ce7,_0x65ff('0xcd')+_0x44f66a['id']+'-'+_0x3e7fc9+'.pdf');var _0x1f7569={'path':_0x411545,'channel':'Chat','interactionId':_0x44f66a['id']};return pdf[_0x65ff('0xce')](_0x465dad,_0x1f7569);})[_0x65ff('0x2d')](function(){return new Promise(function(_0x34d1d3,_0x5e6d2b){zipdir(_0x488ce7,{'saveTo':_0x55cbf9},function(_0x666c8a,_0x8e4709){if(_0x666c8a)return _0x5e6d2b(_0x666c8a);return _0x34d1d3(_0x8e4709);});})['then'](function(){return new BPromise(function(_0x51c634,_0x2f7be8){rimraf(_0x488ce7,function(_0xce3ee8){if(_0xce3ee8)_0x2f7be8(_0xce3ee8);return _0x51c634();});});})[_0x65ff('0x2d')](function(){return _0x40427e[_0x65ff('0x78')](_0x55cbf9,_0x24ae9f,function(_0x2cf379){if(_0x2cf379){logger[_0x65ff('0x1d')](_0x65ff('0xcf'),_0x2cf379);}else{fs['unlinkSync'](_0x55cbf9);}});});});}else{return _0x40427e[_0x65ff('0x23')](0xc8);}})[_0x65ff('0x22')](handleError(_0x40427e,null));}; \ No newline at end of file +var _0x9f9f=['mailTranscript','addMessage','omit','hasOwnProperty','order','sort','where','pick','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','filters','ChatInteractionId','include','includeAgent','includeAll','rows','addTags','setTags','ids','spread','emit','removeTags','unix','toString','server','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','closedAt','browserName','osName','customerIp','customerPort','N.A.','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','update','then','stack','name','send','render','merge','contact','agent','rawAttributes','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','options','find','create','body','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','%s%d','System','Visitor','ContactId','agentIdentifier','website_alias','agentAlias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a'];(function(_0x13248d,_0x35184a){var _0x564f27=function(_0x32ce2c){while(--_0x32ce2c){_0x13248d['push'](_0x13248d['shift']());}};_0x564f27(++_0x35184a);}(_0x9f9f,0x101));var _0xf9f9=function(_0x4b1dfb,_0x234bb9){_0x4b1dfb=_0x4b1dfb-0x0;var _0xec6b30=_0x9f9f[_0x4b1dfb];return _0xec6b30;};'use strict';var rimraf=require(_0xf9f9('0x0'));var zipdir=require(_0xf9f9('0x1'));var rp=require('request-promise');var moment=require(_0xf9f9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf9f9('0x3'));var ejs=require(_0xf9f9('0x4'));var fs=require('fs');var _=require(_0xf9f9('0x5'));var Redis=require(_0xf9f9('0x6'));var interaction=require(_0xf9f9('0x7'));var qs=require(_0xf9f9('0x8'));var pdf=require(_0xf9f9('0x9'));var logger=require('../../config/logger')(_0xf9f9('0xa'));var config=require(_0xf9f9('0xb'));var db=require(_0xf9f9('0xc'))['db'];config[_0xf9f9('0xd')]=_[_0xf9f9('0xe')](config[_0xf9f9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9f9('0xf'))(new Redis(config[_0xf9f9('0xd')]));require(_0xf9f9('0x10'))[_0xf9f9('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf9f9('0x12')][_0xf9f9('0x13')]({'port':0x232b});var client9004=jayson[_0xf9f9('0x12')][_0xf9f9('0x13')]({'port':0x232c});function respondWithRpcPromise(_0xe6680d,_0x590420,_0x1e2556,_0x2cd5e3){return new BPromise(function(_0x185559,_0x89f30){var _0xd55728=_0x2cd5e3||client;return _0xd55728[_0xf9f9('0x14')](_0xe6680d,_0x1e2556)['then'](function(_0x9087df){logger[_0xf9f9('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x590420,_0xf9f9('0x16'));logger[_0xf9f9('0x17')](_0xf9f9('0x18'),_0x590420,_0xf9f9('0x16'),JSON['stringify'](_0x9087df));if(_0x9087df[_0xf9f9('0x19')]){if(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1a')]===0x1f4){logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x9087df['error']['message']);return _0x89f30(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);}logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);return _0x185559(_0x9087df[_0xf9f9('0x19')][_0xf9f9('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x590420,'request\x20sent');_0x185559(_0x9087df[_0xf9f9('0x1d')]['message']);}})[_0xf9f9('0x1e')](function(_0x2964df){logger[_0xf9f9('0x19')](_0xf9f9('0x1b'),_0x590420,_0x2964df);_0x89f30(_0x2964df);});});}function respondWithStatusCode(_0x468c50,_0x11ac14){_0x11ac14=_0x11ac14||0xcc;return function(_0x155228){if(_0x155228){return _0x468c50[_0xf9f9('0x1f')](_0x11ac14);}return _0x468c50['status'](_0x11ac14)[_0xf9f9('0x20')]();};}function respondWithResult(_0x17bc9c,_0x2ee140){_0x2ee140=_0x2ee140||0xc8;return function(_0x44227a){if(_0x44227a){return _0x17bc9c[_0xf9f9('0x21')](_0x2ee140)[_0xf9f9('0x22')](_0x44227a);}};}function respondWithFilteredResult(_0x49c85e,_0x525eb8){return function(_0x11b09f){if(_0x11b09f){var _0x1a5704=typeof _0x525eb8['offset']==='undefined'&&typeof _0x525eb8[_0xf9f9('0x23')]===_0xf9f9('0x24');var _0x28836f=_0x11b09f[_0xf9f9('0x25')];var _0x1523f2=_0x1a5704?0x0:_0x525eb8[_0xf9f9('0x26')];var _0x2f54fa=_0x1a5704?_0x11b09f[_0xf9f9('0x25')]:_0x525eb8['offset']+_0x525eb8[_0xf9f9('0x23')];var _0x45909d;if(_0x2f54fa>=_0x28836f){_0x2f54fa=_0x28836f;_0x45909d=0xc8;}else{_0x45909d=0xce;}_0x49c85e[_0xf9f9('0x21')](_0x45909d);return _0x49c85e[_0xf9f9('0x27')](_0xf9f9('0x28'),_0x1523f2+'-'+_0x2f54fa+'/'+_0x28836f)[_0xf9f9('0x22')](_0x11b09f);}return null;};}function saveUpdates(_0x1c85e9){return function(_0x5d1400){if(_0x5d1400){return _0x5d1400[_0xf9f9('0x29')](_0x1c85e9)[_0xf9f9('0x2a')](function(_0x4bb96b){return _0x4bb96b;});}return null;};}function removeEntity(_0x518ec4){return function(_0x639621){if(_0x639621){return _0x639621['destroy']()[_0xf9f9('0x2a')](function(){_0x518ec4[_0xf9f9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ac36){return function(_0x41f7dc){if(!_0x41f7dc){_0x55ac36['sendStatus'](0x194);}return _0x41f7dc;};}function handleError(_0xda921d,_0x2a4f63){_0x2a4f63=_0x2a4f63||0x1f4;return function(_0x1f380c){logger[_0xf9f9('0x19')](_0x1f380c[_0xf9f9('0x2b')]);if(_0x1f380c[_0xf9f9('0x2c')]){delete _0x1f380c[_0xf9f9('0x2c')];}_0xda921d[_0xf9f9('0x21')](_0x2a4f63)[_0xf9f9('0x2d')](_0x1f380c);};}function getMustacheRender(_0x394865,_0x4c3125){return Mustache[_0xf9f9('0x2e')](_0x394865,_[_0xf9f9('0x2f')](_0x4c3125['body'],{'contact':_0x4c3125[_0xf9f9('0x30')],'message':_0x4c3125[_0xf9f9('0x1c')],'agent':_0x4c3125[_0xf9f9('0x31')],'interaction':_0x4c3125['interaction'],'account':_0x4c3125['account']}))||'';}exports['index']=function(_0x351e24,_0x474ca5){var _0x3e68db={};var _0x185d00=_['map'](db['ChatInteraction'][_0xf9f9('0x32')],function(_0x23bf00){return{'name':_0x23bf00['fieldName'],'type':_0x23bf00['type']['key']};});_0x3e68db=qs[_0xf9f9('0x33')](_0x185d00,_0x351e24);return interaction[_0xf9f9('0x34')](_0xf9f9('0x35'),_0x351e24[_0xf9f9('0x36')],_0x351e24[_0xf9f9('0x37')],_0x3e68db,_0x185d00)['then'](respondWithFilteredResult(_0x474ca5,_0x3e68db))['catch'](handleError(_0x474ca5,null));};exports[_0xf9f9('0x38')]=function(_0xe535f,_0x157bc3){var _0x15bf56={'raw':![],'where':{'id':_0xe535f[_0xf9f9('0x39')]['id']}},_0x257db5={};_0x257db5[_0xf9f9('0x3a')]=_[_0xf9f9('0x3b')](db[_0xf9f9('0x3c')][_0xf9f9('0x32')]);_0x257db5[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0xe535f['query']);_0x257db5['filters']=_[_0xf9f9('0x3d')](_0x257db5[_0xf9f9('0x3a')],_0x257db5[_0xf9f9('0x36')]);_0x15bf56[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x257db5[_0xf9f9('0x3a')],qs[_0xf9f9('0x3f')](_0xe535f[_0xf9f9('0x36')][_0xf9f9('0x3f')]));_0x15bf56[_0xf9f9('0x3e')]=_0x15bf56[_0xf9f9('0x3e')][_0xf9f9('0x40')]?_0x15bf56[_0xf9f9('0x3e')]:_0x257db5[_0xf9f9('0x3a')];if(_0xe535f['query']['includeAll']){_0x15bf56['include']=[{'all':!![]}];}_0x15bf56=_[_0xf9f9('0x2f')]({},_0x15bf56,_0xe535f[_0xf9f9('0x41')]);return db[_0xf9f9('0x3c')][_0xf9f9('0x42')](_0x15bf56)[_0xf9f9('0x2a')](handleEntityNotFound(_0x157bc3,null))[_0xf9f9('0x2a')](respondWithResult(_0x157bc3,null))[_0xf9f9('0x1e')](handleError(_0x157bc3,null));};exports['create']=function(_0x271972,_0x565193){return db['ChatInteraction'][_0xf9f9('0x43')](_0x271972['body'],{})[_0xf9f9('0x2a')](respondWithResult(_0x565193,0xc9))[_0xf9f9('0x1e')](handleError(_0x565193,null));};exports[_0xf9f9('0x29')]=function(_0x351cff,_0x4e2d8d){if(_0x351cff[_0xf9f9('0x44')]['id']){delete _0x351cff[_0xf9f9('0x44')]['id'];}return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x351cff['params']['id']}})['then'](handleEntityNotFound(_0x4e2d8d,null))[_0xf9f9('0x2a')](saveUpdates(_0x351cff[_0xf9f9('0x44')],null))['then'](respondWithResult(_0x4e2d8d,null))[_0xf9f9('0x1e')](handleError(_0x4e2d8d,null));};exports[_0xf9f9('0x45')]=function(_0x1b2966,_0x5bba9b){return db[_0xf9f9('0x3c')]['find']({'where':{'id':_0x1b2966[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x5bba9b,null))[_0xf9f9('0x2a')](removeEntity(_0x5bba9b,null))[_0xf9f9('0x1e')](handleError(_0x5bba9b,null));};exports[_0xf9f9('0x46')]=function(_0x1e1f51,_0x4094dd){return db[_0xf9f9('0x3c')][_0xf9f9('0x46')]()['then'](respondWithResult(_0x4094dd,null))['catch'](handleError(_0x4094dd,null));};exports[_0xf9f9('0x47')]=function(_0x3eb2f1,_0x52bdec){var _0x610bb=_0x3eb2f1['params']['id'];var _0x3cc4da;var _0x42d8be;var _0x60dff6;return db['ChatInteraction'][_0xf9f9('0x48')]({'where':{'id':_0x610bb}})[_0xf9f9('0x2a')](function(_0x589423){_0x3cc4da=_0x589423;return db[_0xf9f9('0x49')][_0xf9f9('0x48')]({'where':{'id':_0x589423[_0xf9f9('0x4a')]},'attributes':['id',_0xf9f9('0x4b'),_0xf9f9('0x4c'),'vidaooTopic',_0xf9f9('0x4d'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4d80fb){if(_0x4d80fb&&_0x4d80fb['vidaooApiKey']&&_0x4d80fb[_0xf9f9('0x4c')]){_0x42d8be=_0x4d80fb;var _0x50894c={'interaction':{'id':_0x610bb},'agent':{'id':_0x3eb2f1[_0xf9f9('0x37')]['id'],'name':_0x3eb2f1['user'][_0xf9f9('0x2c')],'fullname':_0x3eb2f1[_0xf9f9('0x37')][_0xf9f9('0x4e')],'email':_0x3eb2f1['user'][_0xf9f9('0x4f')]},'contact':_0x3eb2f1[_0xf9f9('0x44')]['contact'],'account':_0x3eb2f1[_0xf9f9('0x44')]['account']};var _0x2cf55d={'rejectUnauthorized':![],'method':_0xf9f9('0x50'),'url':_0xf9f9('0x51'),'headers':{'X-APIKEY':_0x4d80fb[_0xf9f9('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3eb2f1[_0xf9f9('0x37')][_0xf9f9('0x4f')]],'buttons':null,'topic':_0x42d8be[_0xf9f9('0x52')],'note':_[_0xf9f9('0x53')](_0x42d8be[_0xf9f9('0x4d')])?null:getMustacheRender(_0x42d8be[_0xf9f9('0x4d')],_0x50894c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x42d8be[_0xf9f9('0x54')])){var _0x5c8958=getMustacheRender(_0x42d8be[_0xf9f9('0x54')],_0x50894c);var _0x2489c7=JSON[_0xf9f9('0x55')](_0x5c8958);_0x2cf55d[_0xf9f9('0x44')][_0xf9f9('0x56')]=_0x2489c7;}}catch(_0x10119b){throw new db[(_0xf9f9('0x57'))][(_0xf9f9('0x58'))](_0xf9f9('0x59'));}return rp(_0x2cf55d);}else{throw new db[(_0xf9f9('0x57'))]['ValidationError'](_0xf9f9('0x5a'));}})[_0xf9f9('0x2a')](function(_0x154344){_0x60dff6=_0x154344;if(_0x60dff6['id']){var _0x340d5e={'body':_0x60dff6[_0xf9f9('0x5b')],'ChatWebsiteId':_0x42d8be['id'],'ChatInteractionId':_0x3cc4da['id'],'direction':'out','UserId':_0x3eb2f1['user']['id']};return db[_0xf9f9('0x5c')][_0xf9f9('0x43')](_0x340d5e,{});}else{throw new db['Sequelize'][(_0xf9f9('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xf9f9('0x2a')](function(){return _0x3cc4da[_0xf9f9('0x5d')]({'vidaooSessionId':_0x60dff6['id']});})[_0xf9f9('0x2a')](respondWithResult(_0x52bdec,null))[_0xf9f9('0x1e')](handleError(_0x52bdec,null));};exports[_0xf9f9('0x5e')]=function(_0x5843bc,_0x1e4a7e){if(_0x5843bc[_0xf9f9('0x44')]['id']){delete _0x5843bc[_0xf9f9('0x44')]['id'];}return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0x5843bc[_0xf9f9('0x39')]['id']},'include':[{'model':db[_0xf9f9('0x5f')],'as':_0xf9f9('0x60')}]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x1e4a7e,null))['then'](saveUpdates(_0x5843bc[_0xf9f9('0x44')],null))[_0xf9f9('0x2a')](respondWithResult(_0x1e4a7e,null))['catch'](handleError(_0x1e4a7e,null));};exports[_0xf9f9('0x61')]=function(_0xfedca4,_0x8f931a){if(_0xfedca4[_0xf9f9('0x44')]['id']){delete _0xfedca4[_0xf9f9('0x44')]['id'];}return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0xfedca4[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](function(_0x3ac64e){if(!_0x3ac64e){logger[_0xf9f9('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf9f9('0x61'),0x194,_0xf9f9('0x62'));_0x8f931a[_0xf9f9('0x1f')](0x194);}else{if(_0x3ac64e[_0xf9f9('0x63')]){throw new db[(_0xf9f9('0x57'))]['ValidationError'](_0xf9f9('0x64'));}}return _0x3ac64e;})['then'](function(_0x3e3fc){if(_0x3e3fc){return _0x3e3fc[_0xf9f9('0x29')]({'closed':_0xfedca4['body'][_0xf9f9('0x65')],'disposition':_0xfedca4[_0xf9f9('0x44')][_0xf9f9('0x66')]})['then'](function(_0x36d741){return _0x36d741;});}})['then'](function(){return respondWithRpcPromise(_0xf9f9('0x67'),_0xf9f9('0x61'),_0xfedca4[_0xf9f9('0x44')],client9004);})['then'](respondWithResult(_0x8f931a,null))[_0xf9f9('0x1e')](handleError(_0x8f931a,null));};exports[_0xf9f9('0x68')]=function(_0x5602c5,_0x4133f7){_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x2c')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6a')];_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x6b')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6c')];_0x5602c5[_0xf9f9('0x44')][_0xf9f9('0x6d')]=_0x5602c5[_0xf9f9('0x69')][_0xf9f9('0x6e')];return db[_0xf9f9('0x6f')][_0xf9f9('0x43')](_0x5602c5[_0xf9f9('0x44')])[_0xf9f9('0x2a')](respondWithResult(_0x4133f7,0xc9))[_0xf9f9('0x1e')](handleError(_0x4133f7,null));};exports[_0xf9f9('0x70')]=function(_0xc76538,_0x10e493){return db['ChatInteraction'][_0xf9f9('0x48')]({'where':{'id':_0xc76538[_0xf9f9('0x39')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x10e493,null))[_0xf9f9('0x2a')](function(_0x200e49){if(_0x200e49){if(_0x200e49['closed']){return _0x10e493[_0xf9f9('0x21')](0x193)['json']({'status':0x193,'message':_0xf9f9('0x71')});}return db[_0xf9f9('0x6f')][_0xf9f9('0x48')]({'where':{'id':_0xc76538[_0xf9f9('0x36')][_0xf9f9('0x72')]},'raw':!![]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x10e493,null));}})[_0xf9f9('0x2a')](function(_0x6a9955){if(_0x6a9955){var _0x5854b2=_0x6a9955[_0xf9f9('0x73')]!==null;var _0xe54172=path['join'](config[_0xf9f9('0x74')],'server/files/attachments/');if(_0x5854b2){_0xe54172=path[_0xf9f9('0x75')](_0xe54172,'offline-chat/');}var _0x21f8f1=path['join'](_0xe54172,_0x6a9955[_0xf9f9('0x6b')]);return _0x10e493[_0xf9f9('0x76')](_0x21f8f1);}})['catch'](handleError(_0x10e493,null));};exports[_0xf9f9('0x77')]=function(_0x281757,_0x58808e){var _0x1addcf=null;var _0x10ee5d=null;var _0x2c3ae6=null;if(_0x281757['body']['id']){delete _0x281757[_0xf9f9('0x44')]['id'];}if(_0x281757[_0xf9f9('0x44')]['mailTranscript']){_0x2c3ae6=path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0x78'),util[_0xf9f9('0x79')]('transcript-%s.txt',Date[_0xf9f9('0x7a')]()));_0x281757[_0xf9f9('0x44')][_0xf9f9('0x7b')]=_0x2c3ae6;}return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x281757[_0xf9f9('0x39')]['id']},'include':[{'model':db[_0xf9f9('0x5c')],'as':_0xf9f9('0x7c'),'include':[{'model':db['User'],'as':_0xf9f9('0x7d')}]}]})[_0xf9f9('0x2a')](handleEntityNotFound(_0x58808e,null))[_0xf9f9('0x2a')](saveUpdates(_0x281757[_0xf9f9('0x44')],null))['then'](function(_0x3014b1){if(_0x3014b1){_0x1addcf=_0x3014b1;return db[_0xf9f9('0x49')][_0xf9f9('0x42')]({'where':{'id':_0x1addcf[_0xf9f9('0x4a')]}});}})[_0xf9f9('0x2a')](function(_0x2637d2){if(_0x2637d2){_0x10ee5d=_0x2637d2;return db['CmContact'][_0xf9f9('0x42')]({'where':{'id':_0x1addcf['ContactId']}});}})[_0xf9f9('0x2a')](function(_0x4558c1){if(_0x4558c1){if(_0x2c3ae6){var _0x1dc953=null;for(var _0x439785=0x1;_0x439785<_0x1addcf[_0xf9f9('0x7c')]['length'];++_0x439785){_0x1dc953=_0x1addcf['Messages'][_0x439785];var _0x1b031a=_0x1dc953[_0xf9f9('0x63')]?util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0x10ee5d['agentAlias'],_0x1dc953[_0xf9f9('0x63')]):_0xf9f9('0x7f');var _0x1c86c7=_0x281757['body']['customer']||util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0xf9f9('0x80'),_0x1dc953[_0xf9f9('0x81')]);switch(_0x10ee5d[_0xf9f9('0x82')]){case _0xf9f9('0x83'):_0x1b031a=_0x1dc953['UserId']?util[_0xf9f9('0x79')](_0xf9f9('0x7e'),_0x10ee5d[_0xf9f9('0x84')],_0x1dc953[_0xf9f9('0x63')]):'System';break;case _0xf9f9('0x85'):_0x1b031a=_0x1dc953[_0xf9f9('0x63')]?_0x1dc953['User']['alias']||_0x1dc953[_0xf9f9('0x7d')][_0xf9f9('0x4e')]:_0xf9f9('0x7f');break;case'agent_fullname':_0x1b031a=_0x1dc953[_0xf9f9('0x63')]?_0x1dc953[_0xf9f9('0x7d')][_0xf9f9('0x4e')]:_0xf9f9('0x7f');break;default:_0x1b031a=_0x1dc953['UserId']?util[_0xf9f9('0x79')]('%s%d',_0x10ee5d[_0xf9f9('0x84')],_0x1dc953[_0xf9f9('0x63')]):_0xf9f9('0x7f');}var _0x5c1159=util[_0xf9f9('0x79')](_0xf9f9('0x86'),moment(_0x1dc953[_0xf9f9('0x87')])[_0xf9f9('0x79')](_0xf9f9('0x88')),_0x1dc953[_0xf9f9('0x89')]==='in'?_0x1c86c7:_0x1b031a,_0x1dc953[_0xf9f9('0x44')]);if(!_0x1dc953[_0xf9f9('0x8a')]){fs[_0xf9f9('0x8b')](_0x2c3ae6,_0x5c1159);}}return db[_0xf9f9('0x8c')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf9f9('0x8d')],'as':_0xf9f9('0x8e'),'raw':!![],'include':[{'model':db[_0xf9f9('0x8f')],'as':_0xf9f9('0x8f'),'raw':!![]}]}]});}}})['then'](function(_0x127339){if(!_0x127339||!_0x127339['Smtp']||!_0x281757[_0xf9f9('0x44')])return _0x1addcf;var _0x584ac2=_0x127339[_0xf9f9('0x90')]();return respondWithRpcPromise(_0xf9f9('0x91'),_0xf9f9('0x92'),{'account':_0x584ac2,'message':{'from':util[_0xf9f9('0x79')]('\x22%s\x22\x20<%s>',_0x127339[_0xf9f9('0x2c')],_0x127339['email']||_0x127339[_0xf9f9('0x8e')][_0xf9f9('0x37')]),'to':_0x281757[_0xf9f9('0x44')]['mailTranscript'],'subject':_0xf9f9('0x93'),'text':util[_0xf9f9('0x79')](_0xf9f9('0x94'),_0x281757[_0xf9f9('0x44')][_0xf9f9('0x95')]),'attachments':[{'path':_0x2c3ae6}]}})[_0xf9f9('0x2a')](function(){return _0x1addcf;})[_0xf9f9('0x1e')](function(_0x189dbf){logger[_0xf9f9('0x19')](_0x189dbf);});})[_0xf9f9('0x2a')](respondWithStatusCode(_0x58808e,0xc8))[_0xf9f9('0x1e')](handleError(_0x58808e,null));};exports[_0xf9f9('0x96')]=function(_0x418de6,_0x146bd9){return db[_0xf9f9('0x5c')][_0xf9f9('0x42')]({'where':{'id':_0x418de6[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x146bd9,null))[_0xf9f9('0x2a')](function(_0x50dde5){if(_0x50dde5){return _0x50dde5[_0xf9f9('0x96')](_0x418de6[_0xf9f9('0x44')]['ids'],_[_0xf9f9('0x97')](_0x418de6['body'],['ids','id'])||{});}})[_0xf9f9('0x2a')](respondWithResult(_0x146bd9,null))[_0xf9f9('0x1e')](handleError(_0x146bd9,null));};exports['getMessages']=function(_0x9b823a,_0xf1ed43){var _0x5a9188={'raw':![],'where':{}};var _0x2f76a8={};var _0x4ac70c={'count':0x0,'rows':[]};return db[_0xf9f9('0x3c')][_0xf9f9('0x48')]({'where':{'id':_0x9b823a[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0xf1ed43,null))['then'](function(_0x5a90c8){if(_0x5a90c8){_0x2f76a8[_0xf9f9('0x3a')]=_['keys'](db[_0xf9f9('0x5c')]['rawAttributes']);_0x2f76a8[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0x9b823a[_0xf9f9('0x36')]);_0x2f76a8['filters']=_[_0xf9f9('0x3d')](_0x2f76a8['model'],_0x2f76a8[_0xf9f9('0x36')]);_0x5a9188[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x2f76a8[_0xf9f9('0x3a')],qs['fields'](_0x9b823a['query'][_0xf9f9('0x3f')]));_0x5a9188['attributes']=_0x5a9188[_0xf9f9('0x3e')][_0xf9f9('0x40')]?_0x5a9188[_0xf9f9('0x3e')]:_0x2f76a8[_0xf9f9('0x3a')];if(!_0x9b823a['query'][_0xf9f9('0x98')]('nolimit')){_0x5a9188[_0xf9f9('0x23')]=qs[_0xf9f9('0x23')](_0x9b823a['query'][_0xf9f9('0x23')]);_0x5a9188['offset']=qs[_0xf9f9('0x26')](_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x26')]);}_0x5a9188[_0xf9f9('0x99')]=qs[_0xf9f9('0x9a')](_0x9b823a['query'][_0xf9f9('0x9a')]);_0x5a9188[_0xf9f9('0x9b')]=qs['filters'](_[_0xf9f9('0x9c')](_0x9b823a[_0xf9f9('0x36')],_0x2f76a8['filters']));_0x5a9188[_0xf9f9('0x9b')]['ChatInteractionId']=_0x5a90c8['id'];if(_0x9b823a[_0xf9f9('0x36')]['filter']){_0x5a9188[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x5a9188[_0xf9f9('0x9b')],{'$or':_[_0xf9f9('0x9d')](_0x5a9188['attributes'],function(_0x51e894){var _0x4ad87d={};_0x4ad87d[_0x51e894]={'$like':'%'+_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x9e')]+'%'};return _0x4ad87d;})});}if(_0x9b823a[_0xf9f9('0x36')][_0xf9f9('0x9f')]){var _0x2383b8=_0x9b823a[_0xf9f9('0x36')]['$gte'][_0xf9f9('0xa0')](',');var _0x3c6220={};_0x3c6220[_0x2383b8[0x0]]={'$gte':moment(_0x2383b8[0x1])[_0xf9f9('0x79')](_0xf9f9('0xa1'))};_0x5a9188[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x5a9188[_0xf9f9('0x9b')],_0x3c6220);}_0x5a9188=_[_0xf9f9('0x2f')]({},_0x5a9188,_0x9b823a[_0xf9f9('0x41')]);return db['ChatMessage'][_0xf9f9('0x25')]({'where':_0x5a9188[_0xf9f9('0x9b')]})[_0xf9f9('0x2a')](function(_0x580941){_0x4ac70c[_0xf9f9('0x25')]=_0x580941;if(_0x9b823a[_0xf9f9('0x36')]['includeAll']){_0x5a9188['include']=[{'all':!![]}];}return db['ChatMessage'][_0xf9f9('0x34')](_0x5a9188);})[_0xf9f9('0x2a')](function(_0x432c61){_0x4ac70c['rows']=_0x432c61;return _0x4ac70c;});}})[_0xf9f9('0x2a')](respondWithFilteredResult(_0xf1ed43,_0x5a9188))['catch'](handleError(_0xf1ed43,null));};exports['getMyMessages']=function(_0x207fce,_0x2940c8){var _0x113618={'where':{}},_0x7074b2={},_0x32ad6e={'count':0x0,'rows':[]};return db[_0xf9f9('0x3c')][_0xf9f9('0x48')]({'where':{'id':_0x207fce[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x2940c8,null))[_0xf9f9('0x2a')](function(_0x58c69d){if(_0x58c69d){_0x7074b2[_0xf9f9('0x3a')]=_[_0xf9f9('0x3b')](db[_0xf9f9('0x5c')]['rawAttributes']);_0x7074b2[_0xf9f9('0x36')]=_[_0xf9f9('0x3b')](_0x207fce['query']);_0x7074b2[_0xf9f9('0xa2')]=_[_0xf9f9('0x3d')](_0x7074b2['model'],_0x7074b2[_0xf9f9('0x36')]);_0x113618[_0xf9f9('0x3e')]=_[_0xf9f9('0x3d')](_0x7074b2[_0xf9f9('0x3a')],qs[_0xf9f9('0x3f')](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x3f')]));_0x113618['attributes']=_0x113618[_0xf9f9('0x3e')]['length']?_0x113618['attributes']:_0x7074b2[_0xf9f9('0x3a')];if(!_0x207fce['query'][_0xf9f9('0x98')]('nolimit')){_0x113618[_0xf9f9('0x23')]=qs[_0xf9f9('0x23')](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x23')]);_0x113618['offset']=qs[_0xf9f9('0x26')](_0x207fce['query']['offset']);}_0x113618[_0xf9f9('0x99')]=qs['sort'](_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9a')]);_0x113618['where']=qs[_0xf9f9('0xa2')](_['pick'](_0x207fce[_0xf9f9('0x36')],_0x7074b2['filters']));_0x113618[_0xf9f9('0x9b')][_0xf9f9('0xa3')]=_0x58c69d['id'];if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9e')]){_0x113618[_0xf9f9('0x9b')]=_[_0xf9f9('0x2f')](_0x113618[_0xf9f9('0x9b')],{'$or':_[_0xf9f9('0x9d')](_0x113618[_0xf9f9('0x3e')],function(_0x33cc39){var _0x1d6232={};_0x1d6232[_0x33cc39]={'$like':'%'+_0x207fce[_0xf9f9('0x36')][_0xf9f9('0x9e')]+'%'};return _0x1d6232;})});}_0x113618[_0xf9f9('0x9b')]['secret']=![];if(_0x207fce['query']['id']){_0x113618[_0xf9f9('0x9b')]['id']={'$gt':_0x207fce[_0xf9f9('0x36')]['id']};}_0x113618=_[_0xf9f9('0x2f')]({},_0x113618,_0x207fce[_0xf9f9('0x41')]);return db[_0xf9f9('0x5c')]['count']({'where':_0x113618['where']})['then'](function(_0x4590c7){_0x32ad6e['count']=_0x4590c7;_0x113618[_0xf9f9('0xa4')]=[];if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0xa5')]){_0x113618['include']['push']({'model':db[_0xf9f9('0x7d')],'as':_0xf9f9('0x7d'),'attributes':['id','fullname','alias']});}if(_0x207fce[_0xf9f9('0x36')][_0xf9f9('0xa6')]){_0x113618[_0xf9f9('0xa4')]=[{'all':!![]}];}return db[_0xf9f9('0x5c')][_0xf9f9('0x34')](_0x113618);})['then'](function(_0x3ee65d){_0x32ad6e[_0xf9f9('0xa7')]=_0x3ee65d;return _0x32ad6e;});}})[_0xf9f9('0x2a')](respondWithFilteredResult(_0x2940c8,_0x113618))[_0xf9f9('0x1e')](handleError(_0x2940c8,null));};exports[_0xf9f9('0xa8')]=function(_0x1d9976,_0x2a184c){return db[_0xf9f9('0x3c')]['find']({'where':{'id':_0x1d9976[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x2a184c,null))[_0xf9f9('0x2a')](function(_0x57d769){if(_0x57d769){return _0x57d769[_0xf9f9('0xa9')](_0x1d9976['body'][_0xf9f9('0xaa')],_[_0xf9f9('0x97')](_0x1d9976[_0xf9f9('0x44')],[_0xf9f9('0xaa'),'id'])||{})[_0xf9f9('0xab')](function(){return db['Tag'][_0xf9f9('0x34')]({'attributes':['id',_0xf9f9('0x2c'),'color'],'where':{'id':_0x1d9976[_0xf9f9('0x44')]['ids']}});})[_0xf9f9('0x2a')](function(_0x470dcf){socket[_0xf9f9('0xac')]('chatInteractionTags:save',{'id':Number(_0x1d9976[_0xf9f9('0x39')]['id']),'tags':_0x470dcf||[]});return{'id':Number(_0x1d9976[_0xf9f9('0x39')]['id']),'tags':_0x470dcf||[]};});}})[_0xf9f9('0x2a')](respondWithResult(_0x2a184c,null))['catch'](handleError(_0x2a184c,null));};exports[_0xf9f9('0xad')]=function(_0x2d6828,_0x35f646){return db[_0xf9f9('0x3c')][_0xf9f9('0x42')]({'where':{'id':_0x2d6828[_0xf9f9('0x39')]['id']}})[_0xf9f9('0x2a')](handleEntityNotFound(_0x35f646,null))['then'](function(_0x2e6f30){if(_0x2e6f30){return _0x2e6f30[_0xf9f9('0xad')](_0x2d6828['query']['ids']);}})[_0xf9f9('0x2a')](respondWithStatusCode(_0x35f646,null))[_0xf9f9('0x1e')](handleError(_0x35f646,null));};exports['download']=function(_0x56fe39,_0x309aa7){var _0x722c10=moment()[_0xf9f9('0xae')]()[_0xf9f9('0xaf')]();var _0x923a51=path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0xb0'),'files','tmp');var _0x5b976e=path['join'](config['root'],_0xf9f9('0xb0'),'files',_0xf9f9('0xb1'));var _0x2ba93e=path[_0xf9f9('0x75')](_0x923a51,_0x722c10);var _0x59c41c=util['format'](_0xf9f9('0xb2'),_0x56fe39['params']['id'],_0x722c10);var _0x52f854=path[_0xf9f9('0x75')](_0x923a51,_0x59c41c);var _0x324c42=[];_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x7d')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x5f')],'as':_0xf9f9('0x60'),'attributes':['id',_0xf9f9('0xb4'),_0xf9f9('0xb5')],'raw':!![]});if(_0x56fe39[_0xf9f9('0x36')][_0xf9f9('0xb1')]){_0x324c42[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x6f')],'as':_0xf9f9('0x6f'),'raw':!![]});}var _0xe0701c=[{'model':db['ChatMessage'],'as':_0xf9f9('0x7c'),'attributes':['id',_0xf9f9('0x44'),'createdAt','direction','secret',_0xf9f9('0xb6')],'include':_0x324c42}];_0xe0701c[_0xf9f9('0xb3')]({'model':db[_0xf9f9('0x49')],'as':_0xf9f9('0xb7'),'attributes':['id',_0xf9f9('0x2c')]});_0xe0701c['push']({'model':db[_0xf9f9('0x7d')],'as':_0xf9f9('0xb8'),'attributes':['id',_0xf9f9('0x4e')]});return db['ChatInteraction'][_0xf9f9('0x42')]({'where':{'id':_0x56fe39['params']['id']},'include':_0xe0701c})[_0xf9f9('0x2a')](handleEntityNotFound(_0x309aa7,null))[_0xf9f9('0x2a')](function(_0x119faa){if(_0x119faa){var _0x4a373f=_0x119faa[_0xf9f9('0xb9')]({'plain':!![]});fs[_0xf9f9('0xba')](_0x2ba93e);var _0x4fbee5={'channel':'Chat','account':_0x4a373f[_0xf9f9('0xb7')]['name'],'agent':_0x4a373f['Owner']?_0x4a373f[_0xf9f9('0xb8')][_0xf9f9('0x4e')]:'N.A.','createdAt':moment(_0x4a373f[_0xf9f9('0x87')])[_0xf9f9('0x79')](_0xf9f9('0xa1'))[_0xf9f9('0xaf')](),'closedAt':_0x4a373f[_0xf9f9('0x65')]?moment(_0x4a373f[_0xf9f9('0xbb')])[_0xf9f9('0x79')](_0xf9f9('0xa1'))[_0xf9f9('0xaf')]():'','disposition':_0x4a373f['disposition'],'chatInfo':{'browser':_0x4a373f[_0xf9f9('0xbc')],'os':_0x4a373f[_0xf9f9('0xbd')],'referer':_0x4a373f['referer'],'customerIp':_0x4a373f[_0xf9f9('0xbe')],'customerPort':_0x4a373f[_0xf9f9('0xbf')]?_0x4a373f[_0xf9f9('0xbf')]:_0xf9f9('0xc0')},'messages':_(_0x4a373f[_0xf9f9('0x7c')])['tail']()[_0xf9f9('0x9e')]({'secret':![]})[_0xf9f9('0x9d')](function(_0x266cc1){if(_0x266cc1[_0xf9f9('0x6f')]){var _0x572fe2=path[_0xf9f9('0x75')](_0x5b976e,_0x266cc1[_0xf9f9('0x6f')]['basename']);if(fs[_0xf9f9('0xc1')](_0x572fe2)){fs['createReadStream'](_0x572fe2)['pipe'](fs[_0xf9f9('0xc2')](path[_0xf9f9('0x75')](_0x2ba93e,_0x266cc1[_0xf9f9('0x6f')]['basename'])));}}return{'date':moment(_0x266cc1[_0xf9f9('0x87')])[_0xf9f9('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf9f9('0xaf')](),'sender':_0x266cc1['direction']===_0xf9f9('0xc3')?_0x266cc1[_0xf9f9('0x7d')]?_0x266cc1['User'][_0xf9f9('0x4e')]:_0xf9f9('0x7f'):_0x266cc1['Contact'][_0xf9f9('0xb4')]+(_0x266cc1[_0xf9f9('0x60')][_0xf9f9('0xb5')]?'\x20'+_0x266cc1[_0xf9f9('0x60')][_0xf9f9('0xb5')]:''),'body':_0x266cc1[_0xf9f9('0x6f')]?_0x266cc1[_0xf9f9('0x6f')][_0xf9f9('0x6b')]:_0x266cc1[_0xf9f9('0x44')],'direction':_0x266cc1[_0xf9f9('0x89')]===_0xf9f9('0xc3')?'A':'C','secret':_0x266cc1[_0xf9f9('0x8a')],'read':_0x266cc1[_0xf9f9('0xb6')],'attachment':_0x266cc1['Attachment']};})['value']()};return ejs[_0xf9f9('0xc4')](path[_0xf9f9('0x75')](config[_0xf9f9('0x74')],_0xf9f9('0xb0'),'views',_0xf9f9('0xc5')),{'interaction':_0x4fbee5})['then'](function(_0x59e379){var _0x5f5c18=path[_0xf9f9('0x75')](_0x2ba93e,'transcript-'+_0x4a373f['id']+'-'+_0x722c10+_0xf9f9('0xc6'));var _0x2ae892={'path':_0x5f5c18,'channel':_0xf9f9('0xc7'),'interactionId':_0x4a373f['id']};return pdf[_0xf9f9('0xc8')](_0x59e379,_0x2ae892);})[_0xf9f9('0x2a')](function(){return new Promise(function(_0x22702a,_0x3f1ca2){zipdir(_0x2ba93e,{'saveTo':_0x52f854},function(_0x4fa86e,_0x36076a){if(_0x4fa86e)return _0x3f1ca2(_0x4fa86e);return _0x22702a(_0x36076a);});})['then'](function(){return new BPromise(function(_0x1d7975,_0x412a6f){rimraf(_0x2ba93e,function(_0x4d7926){if(_0x4d7926)_0x412a6f(_0x4d7926);return _0x1d7975();});});})[_0xf9f9('0x2a')](function(){return _0x309aa7['download'](_0x52f854,_0x59c41c,function(_0x2c71b5){if(_0x2c71b5){logger[_0xf9f9('0x19')](_0xf9f9('0xc9'),_0x2c71b5);}else{fs[_0xf9f9('0xca')](_0x52f854);}});});});}else{return _0x309aa7[_0xf9f9('0x1f')](0xc8);}})['catch'](handleError(_0x309aa7,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a204d16..f7c60bf 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 _0xf9bc=['then','setDataValue','Users','map','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0xf9bc,0x159));var _0xcf9b=function(_0x156c95,_0x1760cf){_0x156c95=_0x156c95-0x0;var _0x1a8cf5=_0xf9bc[_0x156c95];return _0x1a8cf5;};'use strict';var EventEmitter=require(_0xcf9b('0x0'));var ChatInteraction=require(_0xcf9b('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xcf9b('0x1'))['db'][_0xcf9b('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xcf9b('0x3')](0x0);var events={'afterCreate':_0xcf9b('0x4'),'afterUpdate':'update','afterDestroy':_0xcf9b('0x5')};function emitEvent(_0x4ce308){return function(_0x4f6890,_0xb60177,_0x957c0d){_0x4f6890[_0xcf9b('0x6')]({'attributes':['id'],'raw':!![]})[_0xcf9b('0x7')](function(_0x1fd958){_0x4f6890[_0xcf9b('0x8')](_0xcf9b('0x9'),_0x1fd958[_0xcf9b('0xa')](function(_0x42461a){return{'id':_0x42461a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4f6890['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcf9b('0x7')](function(_0x44b003){_0x4f6890['setDataValue']('unreadMessages',_0x44b003[_0xcf9b('0xb')]);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308+':'+_0x4f6890['id'],_0x4f6890);ChatInteractionEvents[_0xcf9b('0xc')](_0x4ce308,_0x4f6890);_0x957c0d(null);})[_0xcf9b('0xd')](_0x957c0d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xcf9b('0xe')](e,emitEvent(event));}}module[_0xcf9b('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x2e4f=['setDataValue','length','emit','catch','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','Users','findAll'];(function(_0x10b2b5,_0x4d9c56){var _0x6400f4=function(_0x3e95d9){while(--_0x3e95d9){_0x10b2b5['push'](_0x10b2b5['shift']());}};_0x6400f4(++_0x4d9c56);}(_0x2e4f,0x131));var _0xf2e4=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x2e4f[_0x18d631];return _0x50d708;};'use strict';var EventEmitter=require(_0xf2e4('0x0'));var ChatInteraction=require(_0xf2e4('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xf2e4('0x1'))['db'][_0xf2e4('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf2e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2e4('0x4'),'afterDestroy':_0xf2e4('0x5')};function emitEvent(_0x14269f){return function(_0x10b7b0,_0x2aca2a,_0x2898e5){_0x10b7b0[_0xf2e4('0x6')]({'attributes':['id'],'raw':!![]})[_0xf2e4('0x7')](function(_0x433bcb){_0x10b7b0['setDataValue'](_0xf2e4('0x8'),_0x433bcb['map'](function(_0x3f6655){return{'id':_0x3f6655['id']};}));return ChatMessage[_0xf2e4('0x9')]({'where':{'ChatInteractionId':_0x10b7b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf2e4('0x7')](function(_0x2bf3a3){_0x10b7b0[_0xf2e4('0xa')]('unreadMessages',_0x2bf3a3[_0xf2e4('0xb')]);ChatInteractionEvents[_0xf2e4('0xc')](_0x14269f+':'+_0x10b7b0['id'],_0x10b7b0);ChatInteractionEvents[_0xf2e4('0xc')](_0x14269f,_0x10b7b0);_0x2898e5(null);})[_0xf2e4('0xd')](_0x2898e5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xf2e4('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 274391f..a732deb 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 _0x1646=['rimraf','../../config/environment','exports','define','ChatInteraction','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','moment','bluebird','path'];(function(_0x447f05,_0x1b4295){var _0x4861ff=function(_0x2495f9){while(--_0x2495f9){_0x447f05['push'](_0x447f05['shift']());}};_0x4861ff(++_0x1b4295);}(_0x1646,0x13d));var _0x6164=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x1646[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6164('0x2'));var BPromise=require(_0x6164('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x4'));var rimraf=require(_0x6164('0x5'));var config=require(_0x6164('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6164('0x7')]=function(_0x13b233,_0x41df49){return _0x13b233[_0x6164('0x8')](_0x6164('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x435bcd,_0x3df6ec,_0x2a9365){if(_0x435bcd[_0x6164('0xa')]('closed')){_0x435bcd[_0x6164('0xb')]=moment()['format'](_0x6164('0xc'));}_0x2a9365(null,_0x435bcd);}},'charset':_0x6164('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x27a0=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x4d8b8e,_0x12fb10){var _0x3103ba=function(_0x361cae){while(--_0x361cae){_0x4d8b8e['push'](_0x4d8b8e['shift']());}};_0x3103ba(++_0x12fb10);}(_0x27a0,0xa4));var _0x027a=function(_0x2c500d,_0x2fc5a3){_0x2c500d=_0x2c500d-0x0;var _0xee4d0f=_0x27a0[_0x2c500d];return _0xee4d0f;};'use strict';var _=require(_0x027a('0x0'));var util=require(_0x027a('0x1'));var logger=require(_0x027a('0x2'))('api');var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));var rp=require(_0x027a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x027a('0x6'));var config=require(_0x027a('0x7'));var attributes=require(_0x027a('0x8'));module[_0x027a('0x9')]=function(_0x1d128d,_0x1f0c38){return _0x1d128d[_0x027a('0xa')](_0x027a('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1bfe4d,_0x55d7b4,_0x23bf55){if(_0x1bfe4d['changed'](_0x027a('0xc'))){_0x1bfe4d['closedAt']=moment()[_0x027a('0xd')](_0x027a('0xe'));}_0x23bf55(null,_0x1bfe4d);}},'charset':_0x027a('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a8f568e..edf801f 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 _0x1e24=['ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34a61d,_0x1b9ab0){var _0x101e4d=function(_0x11495c){while(--_0x11495c){_0x34a61d['push'](_0x34a61d['shift']());}};_0x101e4d(++_0x1b9ab0);}(_0x1e24,0x8c));var _0x41e2=function(_0x3eb4ae,_0x493c5b){_0x3eb4ae=_0x3eb4ae-0x0;var _0x1aa0d4=_0x1e24[_0x3eb4ae];return _0x1aa0d4;};'use strict';var _=require(_0x41e2('0x0'));var util=require(_0x41e2('0x1'));var moment=require(_0x41e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x41e2('0x3'));var fs=require('fs');var Redis=require(_0x41e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41e2('0x5'));var logger=require(_0x41e2('0x6'))('rpc');var config=require(_0x41e2('0x7'));var jayson=require(_0x41e2('0x8'));var client=jayson[_0x41e2('0x9')][_0x41e2('0xa')]({'port':0x232a});config[_0x41e2('0xb')]=_['defaults'](config[_0x41e2('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41e2('0xb')]));require(_0x41e2('0xc'))[_0x41e2('0xd')](socket);function respondWithRpcPromise(_0x4fd220,_0x308c49,_0xd06c3c){return new BPromise(function(_0x1e1785,_0x10113c){return client[_0x41e2('0xe')](_0x4fd220,_0xd06c3c)[_0x41e2('0xf')](function(_0x3153ed){logger[_0x41e2('0x10')](_0x41e2('0x11'),_0x308c49,_0x41e2('0x12'));logger[_0x41e2('0x13')](_0x41e2('0x14'),_0x308c49,_0x41e2('0x12'),JSON['stringify'](_0x3153ed));if(_0x3153ed[_0x41e2('0x15')]){if(_0x3153ed[_0x41e2('0x15')][_0x41e2('0x16')]===0x1f4){logger['error'](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')][_0x41e2('0x17')]);return _0x10113c(_0x3153ed[_0x41e2('0x15')]['message']);}logger[_0x41e2('0x15')](_0x41e2('0x11'),_0x308c49,_0x3153ed[_0x41e2('0x15')]['message']);return _0x1e1785(_0x3153ed['error'][_0x41e2('0x17')]);}else{logger['info'](_0x41e2('0x11'),_0x308c49,'request\x20sent');_0x1e1785(_0x3153ed[_0x41e2('0x18')]['message']);}})[_0x41e2('0x19')](function(_0x1eed85){logger['error'](_0x41e2('0x11'),_0x308c49,_0x1eed85);_0x10113c(_0x1eed85);});});}exports[_0x41e2('0x1a')]=function(_0xda20ba){var _0x471394=this;return new Promise(function(_0x309153,_0xeddbed){return db[_0x41e2('0x1b')]['update'](_0xda20ba[_0x41e2('0x1c')],{'raw':_0xda20ba['options']?_0xda20ba[_0x41e2('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1e')]||null:null,'attributes':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba['options'][_0x41e2('0x1f')]||null:null,'limit':_0xda20ba[_0x41e2('0x1d')]?_0xda20ba[_0x41e2('0x1d')]['limit']||null:null})[_0x41e2('0xf')](function(_0x18d9ba){logger[_0x41e2('0x10')](_0x41e2('0x1a'),_0xda20ba);logger[_0x41e2('0x13')](_0x41e2('0x1a'),_0xda20ba,JSON[_0x41e2('0x20')](_0x18d9ba));_0x309153(_0x18d9ba);})[_0x41e2('0x19')](function(_0x5fec0f){logger[_0x41e2('0x15')](_0x41e2('0x1a'),_0x5fec0f[_0x41e2('0x17')],_0xda20ba);_0xeddbed(_0x471394[_0x41e2('0x15')](0x1f4,_0x5fec0f[_0x41e2('0x17')]));});});};exports[_0x41e2('0x21')]=function(_0x2ebf27){return new Promise(function(_0x4b3a27,_0x123fc0){return db[_0x41e2('0x1b')][_0x41e2('0x22')]({'where':_0x2ebf27[_0x41e2('0x1d')]?_0x2ebf27[_0x41e2('0x1d')][_0x41e2('0x1e')]||null:null})[_0x41e2('0xf')](function(_0x12dd4f){if(_0x12dd4f){return _0x12dd4f[_0x41e2('0x23')](_0x2ebf27[_0x41e2('0x1c')][_0x41e2('0x24')],_[_0x41e2('0x25')](_0x2ebf27[_0x41e2('0x1c')],['ids','id'])||{});}})[_0x41e2('0x26')](function(_0x331bcd){logger[_0x41e2('0x10')](_0x41e2('0x27'),_0x2ebf27);logger['debug'](_0x41e2('0x27'),_0x2ebf27,JSON[_0x41e2('0x20')](_0x331bcd));_0x4b3a27(_0x331bcd);})[_0x41e2('0x19')](function(_0xadcfdf){logger[_0x41e2('0x15')](_0x41e2('0x27'),_0xadcfdf[_0x41e2('0x17')],_0x2ebf27);_0x123fc0(_this[_0x41e2('0x15')](0x1f4,_0xadcfdf['message']));});});}; \ No newline at end of file +var _0x0ae7=['ChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToChatInteraction'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x0ae7,0xaa));var _0x70ae=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x0ae7[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x70ae('0x0'));var util=require(_0x70ae('0x1'));var moment=require('moment');var BPromise=require(_0x70ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70ae('0x4'));var logger=require(_0x70ae('0x5'))(_0x70ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x70ae('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x70ae('0x8')](config[_0x70ae('0x9')],{'host':_0x70ae('0xa'),'port':0x18eb});var socket=require(_0x70ae('0xb'))(new Redis(config[_0x70ae('0x9')]));require(_0x70ae('0xc'))[_0x70ae('0xd')](socket);function respondWithRpcPromise(_0xecd9f2,_0x80fb4a,_0x4958fa){return new BPromise(function(_0x14fb34,_0x4afa01){return client[_0x70ae('0xe')](_0xecd9f2,_0x4958fa)[_0x70ae('0xf')](function(_0x1f2b6b){logger[_0x70ae('0x10')](_0x70ae('0x11'),_0x80fb4a,_0x70ae('0x12'));logger[_0x70ae('0x13')](_0x70ae('0x14'),_0x80fb4a,_0x70ae('0x12'),JSON['stringify'](_0x1f2b6b));if(_0x1f2b6b[_0x70ae('0x15')]){if(_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x16')]===0x1f4){logger[_0x70ae('0x15')](_0x70ae('0x11'),_0x80fb4a,_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x17')]);return _0x4afa01(_0x1f2b6b[_0x70ae('0x15')][_0x70ae('0x17')]);}logger[_0x70ae('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x80fb4a,_0x1f2b6b['error'][_0x70ae('0x17')]);return _0x14fb34(_0x1f2b6b['error'][_0x70ae('0x17')]);}else{logger[_0x70ae('0x10')](_0x70ae('0x11'),_0x80fb4a,_0x70ae('0x12'));_0x14fb34(_0x1f2b6b['result'][_0x70ae('0x17')]);}})[_0x70ae('0x18')](function(_0x142f44){logger[_0x70ae('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x80fb4a,_0x142f44);_0x4afa01(_0x142f44);});});}exports[_0x70ae('0x19')]=function(_0x3e5e67){var _0x2afb31=this;return new Promise(function(_0x3afd75,_0x8346a0){return db['ChatInteraction'][_0x70ae('0x1a')](_0x3e5e67[_0x70ae('0x1b')],{'raw':_0x3e5e67['options']?_0x3e5e67['options'][_0x70ae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5e67[_0x70ae('0x1d')]?_0x3e5e67['options'][_0x70ae('0x1e')]||null:null,'attributes':_0x3e5e67['options']?_0x3e5e67[_0x70ae('0x1d')][_0x70ae('0x1f')]||null:null,'limit':_0x3e5e67['options']?_0x3e5e67[_0x70ae('0x1d')][_0x70ae('0x20')]||null:null})[_0x70ae('0xf')](function(_0x1cb530){logger[_0x70ae('0x10')](_0x70ae('0x19'),_0x3e5e67);logger[_0x70ae('0x13')]('UpdateChatInteraction',_0x3e5e67,JSON[_0x70ae('0x21')](_0x1cb530));_0x3afd75(_0x1cb530);})[_0x70ae('0x18')](function(_0x2c163a){logger[_0x70ae('0x15')]('UpdateChatInteraction',_0x2c163a[_0x70ae('0x17')],_0x3e5e67);_0x8346a0(_0x2afb31[_0x70ae('0x15')](0x1f4,_0x2c163a['message']));});});};exports[_0x70ae('0x22')]=function(_0x1b987e){return new Promise(function(_0x45117d,_0x132088){return db[_0x70ae('0x23')]['find']({'where':_0x1b987e[_0x70ae('0x1d')]?_0x1b987e[_0x70ae('0x1d')][_0x70ae('0x1e')]||null:null})[_0x70ae('0xf')](function(_0x22efe8){if(_0x22efe8){return _0x22efe8[_0x70ae('0x24')](_0x1b987e[_0x70ae('0x1b')][_0x70ae('0x25')],_[_0x70ae('0x26')](_0x1b987e['body'],[_0x70ae('0x25'),'id'])||{});}})[_0x70ae('0x27')](function(_0x1d95dd){logger[_0x70ae('0x10')]('AddTags',_0x1b987e);logger[_0x70ae('0x13')]('AddTags',_0x1b987e,JSON[_0x70ae('0x21')](_0x1d95dd));_0x45117d(_0x1d95dd);})['catch'](function(_0x5b1baf){logger['error'](_0x70ae('0x28'),_0x5b1baf['message'],_0x1b987e);_0x132088(_this['error'](0x1f4,_0x5b1baf[_0x70ae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3daa133..f7cdc6a 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 _0x4992=['chatInteraction:','remove','emit','removeListener','register'];(function(_0xf94618,_0x114c5e){var _0x3b550f=function(_0xb2f0a1){while(--_0xb2f0a1){_0xf94618['push'](_0xf94618['shift']());}};_0x3b550f(++_0x114c5e);}(_0x4992,0xf1));var _0x2499=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4992[_0x413feb];return _0x40ee88;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x2499('0x0'),'update'];function createListener(_0xa4d8d8,_0x495d2b){return function(_0x491517){_0x495d2b[_0x2499('0x1')](_0xa4d8d8,_0x491517);};}function removeListener(_0x144673,_0x515056){return function(){ChatInteractionEvents[_0x2499('0x2')](_0x144673,_0x515056);};}exports[_0x2499('0x3')]=function(_0x111536){for(var _0x3a8ada=0x0,_0x41d7b2=events['length'];_0x3a8ada<_0x41d7b2;_0x3a8ada++){var _0x4f693f=events[_0x3a8ada];var _0x385f87=createListener(_0x2499('0x4')+_0x4f693f,_0x111536);ChatInteractionEvents['on'](_0x4f693f,_0x385f87);}}; \ No newline at end of file +var _0x3b55=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x5f156e,_0x1a4b94){var _0x508ef5=function(_0x22ac8a){while(--_0x22ac8a){_0x5f156e['push'](_0x5f156e['shift']());}};_0x508ef5(++_0x1a4b94);}(_0x3b55,0xc2));var _0x53b5=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x3b55[_0x43a5c7];return _0x3b12a2;};'use strict';var ChatInteractionEvents=require(_0x53b5('0x0'));var events=['save',_0x53b5('0x1'),_0x53b5('0x2')];function createListener(_0x519a0b,_0x51e6c6){return function(_0xa461fe){_0x51e6c6[_0x53b5('0x3')](_0x519a0b,_0xa461fe);};}function removeListener(_0x432ebe,_0x561ed6){return function(){ChatInteractionEvents[_0x53b5('0x4')](_0x432ebe,_0x561ed6);};}exports['register']=function(_0x133f78){for(var _0x5cd4dd=0x0,_0x2c9272=events[_0x53b5('0x5')];_0x5cd4dd<_0x2c9272;_0x5cd4dd++){var _0x857d00=events[_0x5cd4dd];var _0x567750=createListener(_0x53b5('0x6')+_0x857d00,_0x133f78);ChatInteractionEvents['on'](_0x857d00,_0x567750);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 88b6668..a82c26b 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 _0x8f68=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','tracked','delete'];(function(_0x35a19c,_0xf88bc8){var _0x25c4b5=function(_0x1a88ec){while(--_0x1a88ec){_0x35a19c['push'](_0x35a19c['shift']());}};_0x25c4b5(++_0xf88bc8);}(_0x8f68,0x145));var _0x88f6=function(_0x20bcaf,_0x26c94a){_0x20bcaf=_0x20bcaf-0x0;var _0x79f764=_0x8f68[_0x20bcaf];return _0x79f764;};'use strict';var multer=require(_0x88f6('0x0'));var util=require(_0x88f6('0x1'));var path=require(_0x88f6('0x2'));var timeout=require(_0x88f6('0x3'));var express=require(_0x88f6('0x4'));var router=express[_0x88f6('0x5')]();var fs_extra=require(_0x88f6('0x6'));var auth=require(_0x88f6('0x7'));var interaction=require(_0x88f6('0x8'));var config=require(_0x88f6('0x9'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x88f6('0xa')]);router[_0x88f6('0xb')](_0x88f6('0xc'),auth[_0x88f6('0xd')](),controller[_0x88f6('0xe')]);router[_0x88f6('0xb')](_0x88f6('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x10')]);router[_0x88f6('0xb')](_0x88f6('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x12')]);router[_0x88f6('0xb')](_0x88f6('0x13'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x14')]);router[_0x88f6('0xb')](_0x88f6('0x15'),auth[_0x88f6('0x16')](),controller['getMyMessages']);router[_0x88f6('0xb')](_0x88f6('0x17'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x18')]);router[_0x88f6('0x19')]('/',auth[_0x88f6('0xd')](),controller[_0x88f6('0x1a')]);router[_0x88f6('0x19')](_0x88f6('0x1b'),auth[_0x88f6('0xd')](),controller[_0x88f6('0x1c')]);var upload=multer({'storage':multer[_0x88f6('0x1d')]({'destination':function(_0x847c9a,_0x4d8c78,_0x3aa919){_0x3aa919(null,path[_0x88f6('0x1e')](config[_0x88f6('0x1f')],'server/files/attachments/'));},'filename':function(_0x3fc66c,_0xbd1fb7,_0xcdc50b){_0xcdc50b(null,util[_0x88f6('0x20')]('%s-%s',Date[_0x88f6('0x21')](),_0xbd1fb7['originalname'][_0x88f6('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88f6('0x23'),upload[_0x88f6('0x24')](_0x88f6('0x25')),controller[_0x88f6('0x26')]);router[_0x88f6('0x19')](_0x88f6('0x13'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x88f6('0x19')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),interaction['tracked'](_0x88f6('0x28'),_0x88f6('0x29')),controller[_0x88f6('0x2a')]);router[_0x88f6('0x2b')](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x88f6('0x2c')]);router[_0x88f6('0x2b')](_0x88f6('0x2d'),controller[_0x88f6('0x2e')]);router['put'](_0x88f6('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0x88f6('0x30')]);router[_0x88f6('0x2b')](_0x88f6('0x31'),controller[_0x88f6('0x32')]);router['delete'](_0x88f6('0xf'),auth[_0x88f6('0xd')](),interaction[_0x88f6('0x33')](_0x88f6('0x28'),'chatinteraction:destroy'),controller['destroy']);router[_0x88f6('0x34')](_0x88f6('0x27'),auth[_0x88f6('0xd')](),controller['removeTags']);module[_0x88f6('0x35')]=router; \ No newline at end of file +var _0xe82e=['join','root','server/files/attachments/','format','originalname','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe82e,0x1ee));var _0xee82=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xe82e[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require('multer');var util=require(_0xee82('0x0'));var path=require(_0xee82('0x1'));var timeout=require(_0xee82('0x2'));var express=require(_0xee82('0x3'));var router=express[_0xee82('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xee82('0x6'));var controller=require('./chatInteraction.controller');router[_0xee82('0x7')]('/',auth['isAuthenticated'](),controller[_0xee82('0x8')]);router[_0xee82('0x7')]('/describe',auth[_0xee82('0x9')](),controller[_0xee82('0xa')]);router[_0xee82('0x7')](_0xee82('0xb'),auth[_0xee82('0xc')](),controller[_0xee82('0xd')]);router[_0xee82('0x7')](_0xee82('0xe'),auth[_0xee82('0xc')](),controller[_0xee82('0xf')]);router[_0xee82('0x7')](_0xee82('0x10'),auth[_0xee82('0x9')](),controller[_0xee82('0x11')]);router['get'](_0xee82('0x12'),auth[_0xee82('0xc')](),controller[_0xee82('0x13')]);router[_0xee82('0x7')](_0xee82('0x14'),auth[_0xee82('0x9')](),controller[_0xee82('0x15')]);router[_0xee82('0x16')]('/',auth[_0xee82('0x9')](),controller[_0xee82('0x17')]);router['post'](_0xee82('0x18'),auth['isAuthenticated'](),controller[_0xee82('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fed2c,_0x34854e,_0x38808d){_0x38808d(null,path[_0xee82('0x1a')](config[_0xee82('0x1b')],_0xee82('0x1c')));},'filename':function(_0x17f1f7,_0x4c9d52,_0x289ea2){_0x289ea2(null,util[_0xee82('0x1d')]('%s-%s',Date['now'](),_0x4c9d52[_0xee82('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xee82('0x16')]('/:id/attachment_upload',upload[_0xee82('0x1f')](_0xee82('0x20')),controller[_0xee82('0x21')]);router[_0xee82('0x16')](_0xee82('0x10'),auth[_0xee82('0xc')](),controller[_0xee82('0x22')]);router[_0xee82('0x16')]('/:id/tags',auth[_0xee82('0x9')](),interaction[_0xee82('0x23')](_0xee82('0x24'),_0xee82('0x25')),controller['addTags']);router[_0xee82('0x26')](_0xee82('0xb'),auth[_0xee82('0x9')](),interaction['tracked']('chat',_0xee82('0x27')),controller['update']);router[_0xee82('0x26')](_0xee82('0x28'),controller[_0xee82('0x29')]);router[_0xee82('0x26')](_0xee82('0x2a'),auth[_0xee82('0xc')](),controller[_0xee82('0x2b')]);router[_0xee82('0x26')](_0xee82('0x2c'),controller[_0xee82('0x2d')]);router[_0xee82('0x2e')](_0xee82('0xb'),auth['isAuthenticated'](),interaction[_0xee82('0x23')]('chat',_0xee82('0x2f')),controller[_0xee82('0x30')]);router[_0xee82('0x2e')](_0xee82('0x31'),auth[_0xee82('0x9')](),controller[_0xee82('0x32')]);module[_0xee82('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ca8dd08..789a692 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 _0xf78d=['TEXT','INTEGER','exports'];(function(_0x1f8d29,_0x295837){var _0x5e5adf=function(_0x533cf5){while(--_0x533cf5){_0x1f8d29['push'](_0x1f8d29['shift']());}};_0x5e5adf(++_0x295837);}(_0xf78d,0x1d0));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdf78('0x0')]={'body':{'type':Sequelize[_0xdf78('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdf78('0x2')]}}; \ No newline at end of file +var _0x3ae5=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x1ccbc9,_0x4764fb){var _0x3b97e1=function(_0x50d5fd){while(--_0x50d5fd){_0x1ccbc9['push'](_0x1ccbc9['shift']());}};_0x3b97e1(++_0x4764fb);}(_0x3ae5,0x1ad));var _0x53ae=function(_0x2ed1d0,_0x51fd0a){_0x2ed1d0=_0x2ed1d0-0x0;var _0x504043=_0x3ae5[_0x2ed1d0];return _0x504043;};'use strict';var Sequelize=require(_0x53ae('0x0'));module['exports']={'body':{'type':Sequelize[_0x53ae('0x1')](_0x53ae('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x53ae('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x53ae('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6c7dfce..7914cb9 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 _0xe0c5=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','get','role','UserProfileSection','Agents','isEmpty','resourceId','push','FromId','ToId','read','sort','-createdAt','all','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','error','name','map','ChatInternalMessage','fieldName','type','key'];(function(_0x2036d2,_0x57e925){var _0x1d8e18=function(_0x28d3e6){while(--_0x28d3e6){_0x2036d2['push'](_0x2036d2['shift']());}};_0x1d8e18(++_0x57e925);}(_0xe0c5,0x1dc));var _0x5e0c=function(_0x26fcfd,_0x2af46f){_0x26fcfd=_0x26fcfd-0x0;var _0x234f68=_0xe0c5[_0x26fcfd];return _0x234f68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e0c('0x0'));var rp=require(_0x5e0c('0x1'));var moment=require(_0x5e0c('0x2'));var BPromise=require(_0x5e0c('0x3'));var Mustache=require(_0x5e0c('0x4'));var util=require('util');var path=require(_0x5e0c('0x5'));var sox=require(_0x5e0c('0x6'));var csv=require('to-csv');var ejs=require(_0x5e0c('0x7'));var fs=require('fs');var fs_extra=require(_0x5e0c('0x8'));var _=require(_0x5e0c('0x9'));var squel=require(_0x5e0c('0xa'));var crypto=require('crypto');var jsforce=require(_0x5e0c('0xb'));var deskjs=require(_0x5e0c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5e0c('0xd'));var Papa=require(_0x5e0c('0xe'));var Redis=require(_0x5e0c('0xf'));var authService=require(_0x5e0c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e0c('0x11'));var hardwareService=require(_0x5e0c('0x12'));var logger=require(_0x5e0c('0x13'))('api');var utils=require(_0x5e0c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5e0c('0x15'));var db=require('../../mysqldb')['db'];config[_0x5e0c('0x16')]=_[_0x5e0c('0x17')](config[_0x5e0c('0x16')],{'host':_0x5e0c('0x18'),'port':0x18eb});var socket=require(_0x5e0c('0x19'))(new Redis(config[_0x5e0c('0x16')]));require(_0x5e0c('0x1a'))[_0x5e0c('0x1b')](socket);function respondWithStatusCode(_0x3c16a1,_0x15d46e){_0x15d46e=_0x15d46e||0xcc;return function(_0x1c043b){if(_0x1c043b){return _0x3c16a1[_0x5e0c('0x1c')](_0x15d46e);}return _0x3c16a1[_0x5e0c('0x1d')](_0x15d46e)[_0x5e0c('0x1e')]();};}function respondWithResult(_0x586adc,_0x1ff2ec){_0x1ff2ec=_0x1ff2ec||0xc8;return function(_0x54885d){if(_0x54885d){return _0x586adc['status'](_0x1ff2ec)[_0x5e0c('0x1f')](_0x54885d);}};}function respondWithFilteredResult(_0x239004,_0x559c59){return function(_0x214f87){if(_0x214f87){var _0x182d16=typeof _0x559c59[_0x5e0c('0x20')]==='undefined'&&typeof _0x559c59[_0x5e0c('0x21')]===_0x5e0c('0x22');var _0xdb6533=_0x214f87[_0x5e0c('0x23')];var _0x24293f=_0x182d16?0x0:_0x559c59['offset'];var _0xe80815=_0x182d16?_0x214f87['count']:_0x559c59[_0x5e0c('0x20')]+_0x559c59['limit'];var _0x223d80;if(_0xe80815>=_0xdb6533){_0xe80815=_0xdb6533;_0x223d80=0xc8;}else{_0x223d80=0xce;}_0x239004[_0x5e0c('0x1d')](_0x223d80);return _0x239004[_0x5e0c('0x24')]('Content-Range',_0x24293f+'-'+_0xe80815+'/'+_0xdb6533)[_0x5e0c('0x1f')](_0x214f87);}return null;};}function patchUpdates(_0x35d159){return function(_0x3afc5e){try{jsonpatch[_0x5e0c('0x25')](_0x3afc5e,_0x35d159,!![]);}catch(_0x263f4c){return BPromise[_0x5e0c('0x26')](_0x263f4c);}return _0x3afc5e['save']();};}function saveUpdates(_0x3df838,_0x5b475a){return function(_0x22dbcf){if(_0x22dbcf){return _0x22dbcf[_0x5e0c('0x27')](_0x3df838)['then'](function(_0x47bb1f){return _0x47bb1f;});}return null;};}function removeEntity(_0xb3b4f4,_0x3c55f0){return function(_0x548149){if(_0x548149){return _0x548149[_0x5e0c('0x28')]()[_0x5e0c('0x29')](function(){_0xb3b4f4[_0x5e0c('0x1d')](0xcc)[_0x5e0c('0x1e')]();});}};}function handleEntityNotFound(_0x3ed0fd,_0x4b802e){return function(_0x4ef4d3){if(!_0x4ef4d3){_0x3ed0fd[_0x5e0c('0x1c')](0x194);}return _0x4ef4d3;};}function handleError(_0x26a4f5,_0x32674d){_0x32674d=_0x32674d||0x1f4;return function(_0x167a39){logger[_0x5e0c('0x2a')](_0x167a39['stack']);if(_0x167a39[_0x5e0c('0x2b')]){delete _0x167a39[_0x5e0c('0x2b')];}_0x26a4f5[_0x5e0c('0x1d')](_0x32674d)['send'](_0x167a39);};}exports['index']=function(_0x2d41e4,_0x5e3ae3){var _0xb2161f={},_0x2d1d9b={},_0x3724f5={'count':0x0,'rows':[]};var _0x4a94fd=_[_0x5e0c('0x2c')](db[_0x5e0c('0x2d')]['rawAttributes'],function(_0x2b1041){return{'name':_0x2b1041[_0x5e0c('0x2e')],'type':_0x2b1041[_0x5e0c('0x2f')][_0x5e0c('0x30')]};});_0x2d1d9b[_0x5e0c('0x31')]=_[_0x5e0c('0x2c')](_0x4a94fd,_0x5e0c('0x2b'));_0x2d1d9b['query']=_[_0x5e0c('0x32')](_0x2d41e4[_0x5e0c('0x33')]);_0x2d1d9b[_0x5e0c('0x34')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],_0x2d1d9b[_0x5e0c('0x33')]);_0xb2161f[_0x5e0c('0x36')]=_[_0x5e0c('0x35')](_0x2d1d9b[_0x5e0c('0x31')],qs['fields'](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0xb2161f[_0x5e0c('0x36')]=_0xb2161f[_0x5e0c('0x36')][_0x5e0c('0x38')]?_0xb2161f[_0x5e0c('0x36')]:_0x2d1d9b[_0x5e0c('0x31')];if(!_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x39')]('nolimit')){_0xb2161f[_0x5e0c('0x21')]=qs[_0x5e0c('0x21')](_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x21')]);_0xb2161f[_0x5e0c('0x20')]=qs['offset'](_0x2d41e4[_0x5e0c('0x33')]['offset']);}_0xb2161f['order']=qs['sort'](_0x2d41e4[_0x5e0c('0x33')]['sort']);_0xb2161f[_0x5e0c('0x3a')]=qs['filters'](_[_0x5e0c('0x3b')](_0x2d41e4[_0x5e0c('0x33')],_0x2d1d9b[_0x5e0c('0x34')]),_0x4a94fd);if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]){_0xb2161f[_0x5e0c('0x3a')]=_[_0x5e0c('0x3d')](_0xb2161f[_0x5e0c('0x3a')],{'$or':_[_0x5e0c('0x2c')](_0x4a94fd,function(_0x2a25cf){if(_0x2a25cf[_0x5e0c('0x2f')]!==_0x5e0c('0x3e')){var _0x12ff65={};_0x12ff65[_0x2a25cf[_0x5e0c('0x2b')]]={'$like':'%'+_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x3c')]+'%'};return _0x12ff65;}})});}_0xb2161f=_['merge']({},_0xb2161f,_0x2d41e4[_0x5e0c('0x3f')]);var _0x4d1de1={'where':_0xb2161f['where']};return db['ChatInternalMessage'][_0x5e0c('0x23')](_0x4d1de1)[_0x5e0c('0x29')](function(_0x2ebf17){_0x3724f5[_0x5e0c('0x23')]=_0x2ebf17;if(_0x2d41e4[_0x5e0c('0x33')][_0x5e0c('0x40')]){_0xb2161f[_0x5e0c('0x41')]=[{'all':!![]}];}return db[_0x5e0c('0x2d')][_0x5e0c('0x42')](_0xb2161f);})['then'](function(_0x1e28a4){_0x3724f5[_0x5e0c('0x43')]=_0x1e28a4;return _0x3724f5;})[_0x5e0c('0x29')](respondWithFilteredResult(_0x5e3ae3,_0xb2161f))[_0x5e0c('0x44')](handleError(_0x5e3ae3,null));};exports[_0x5e0c('0x45')]=function(_0x2c80a3,_0x3fc5d8){var _0x27103f={'raw':!![],'where':{'id':_0x2c80a3['params']['id']}},_0x51fb51={};_0x51fb51[_0x5e0c('0x31')]=_[_0x5e0c('0x32')](db[_0x5e0c('0x2d')]['rawAttributes']);_0x51fb51[_0x5e0c('0x33')]=_[_0x5e0c('0x32')](_0x2c80a3[_0x5e0c('0x33')]);_0x51fb51[_0x5e0c('0x34')]=_['intersection'](_0x51fb51['model'],_0x51fb51[_0x5e0c('0x33')]);_0x27103f[_0x5e0c('0x36')]=_['intersection'](_0x51fb51[_0x5e0c('0x31')],qs[_0x5e0c('0x37')](_0x2c80a3[_0x5e0c('0x33')][_0x5e0c('0x37')]));_0x27103f[_0x5e0c('0x36')]=_0x27103f[_0x5e0c('0x36')]['length']?_0x27103f['attributes']:_0x51fb51[_0x5e0c('0x31')];if(_0x2c80a3[_0x5e0c('0x33')]['includeAll']){_0x27103f[_0x5e0c('0x41')]=[{'all':!![]}];}_0x27103f=_['merge']({},_0x27103f,_0x2c80a3[_0x5e0c('0x3f')]);return db[_0x5e0c('0x2d')][_0x5e0c('0x46')](_0x27103f)[_0x5e0c('0x29')](handleEntityNotFound(_0x3fc5d8,null))[_0x5e0c('0x29')](respondWithResult(_0x3fc5d8,null))['catch'](handleError(_0x3fc5d8,null));};exports[_0x5e0c('0x47')]=function(_0x568df2,_0x3c5f10){return db['ChatInternalMessage'][_0x5e0c('0x47')](_0x568df2[_0x5e0c('0x48')],{})[_0x5e0c('0x29')](respondWithResult(_0x3c5f10,0xc9))['catch'](handleError(_0x3c5f10,null));};exports[_0x5e0c('0x27')]=function(_0x2c3a0a,_0x506e3b){if(_0x2c3a0a[_0x5e0c('0x48')]['id']){delete _0x2c3a0a['body']['id'];}return db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'id':_0x2c3a0a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x506e3b,null))['then'](saveUpdates(_0x2c3a0a[_0x5e0c('0x48')],null))[_0x5e0c('0x29')](respondWithResult(_0x506e3b,null))['catch'](handleError(_0x506e3b,null));};exports[_0x5e0c('0x28')]=function(_0x25986a,_0x7553d9){return db[_0x5e0c('0x2d')]['find']({'where':{'id':_0x25986a[_0x5e0c('0x49')]['id']}})[_0x5e0c('0x29')](handleEntityNotFound(_0x7553d9,null))[_0x5e0c('0x29')](removeEntity(_0x7553d9,null))['catch'](handleError(_0x7553d9,null));};exports[_0x5e0c('0x4a')]=function(_0x22699c,_0xf09940){return db[_0x5e0c('0x2d')][_0x5e0c('0x4a')]()[_0x5e0c('0x29')](respondWithResult(_0xf09940,null))[_0x5e0c('0x44')](handleError(_0xf09940,null));};function wrapUser(_0x11852c){return function(_0x381cef){var _0x244cfb=_0x11852c['get']({'plain':!![]});_0x244cfb[_0x5e0c('0x4b')]=[];if(_0x381cef){_0x244cfb['lastMessageAt']=_0x381cef[_0x5e0c('0x4c')];_0x244cfb['lastMessage']=_0x381cef;}else{_0x244cfb[_0x5e0c('0x4d')]=moment(0x0)[_0x5e0c('0x4e')](_0x5e0c('0x4f'));_0x244cfb[_0x5e0c('0x50')]={};}return _0x244cfb;};}exports[_0x5e0c('0x51')]=function(_0x4cd955,_0x14bb70,_0x50f440){var _0x1b5f23=[];return db[_0x5e0c('0x52')][_0x5e0c('0x42')]({'where':{'role':[_0x5e0c('0x53'),_0x5e0c('0x54'),_0x5e0c('0x55')]},'attributes':['id','fullname',_0x5e0c('0x2b'),'role','userpic',_0x5e0c('0x56'),_0x5e0c('0x57'),_0x5e0c('0x58'),_0x5e0c('0x59'),_0x5e0c('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db[_0x5e0c('0x5b')],'as':'VoiceQueues','attributes':['id',_0x5e0c('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x5e0c('0x29')](function(_0x26c95d){if(_0x26c95d){var _0x39f97a=_0x4cd955['user'][_0x5e0c('0x5c')]({'plain':!![]});if(!_0x39f97a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39f97a[_0x5e0c('0x5d')]===_0x5e0c('0x55')){return db[_0x5e0c('0x5e')][_0x5e0c('0x46')]({'where':{'name':_0x5e0c('0x5f'),'userProfileId':_0x39f97a['userProfileId']},'raw':!![]})[_0x5e0c('0x29')](function(_0x46e4a5){if(_0x46e4a5){if(_0x46e4a5['autoAssociation']===0x0){return db['UserProfileResource'][_0x5e0c('0x42')]({'where':{'sectionId':_0x46e4a5['id']},'raw':!![]})['then'](function(_0x31c19){var _0x436670=[];if(_[_0x5e0c('0x60')](_0x31c19)){_0x436670=_['filter'](_0x26c95d,function(_0x2ff586){if(_0x2ff586[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x2ff586;}});return _0x436670;}else{for(var _0x19a5fd=0x0;_0x19a5fd<_0x26c95d['length'];_0x19a5fd++){var _0x2b79ba=_0x26c95d[_0x19a5fd];if(_0x2b79ba[_0x5e0c('0x5d')]===_0x5e0c('0x53')){var _0x9b7452=_['find'](_0x31c19,function(_0x315dd7){return _0x315dd7[_0x5e0c('0x61')]===_0x2b79ba['id'];});if(_0x9b7452)_0x436670['push'](_0x2b79ba);}else{_0x436670['push'](_0x2b79ba);}}return _0x436670;}});}else{return _0x26c95d;}}else{var _0x1403c7=_[_0x5e0c('0x3c')](_0x26c95d,function(_0x22665d){if(_0x22665d[_0x5e0c('0x5d')]!==_0x5e0c('0x53')){return _0x22665d;}});return _0x1403c7;}});}else{return _0x26c95d;}}})['then'](function(_0x2de3c9){var _0x2b291a=[];if(_0x2de3c9){_0x1b5f23=_0x2de3c9;for(var _0x5df3b1=0x0;_0x5df3b1<_0x2de3c9['length'];_0x5df3b1+=0x1){_0x1b5f23[_0x5df3b1]['messages']=[];_0x2b291a[_0x5e0c('0x62')](db[_0x5e0c('0x2d')][_0x5e0c('0x46')]({'where':{'FromId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ToId':[_0x4cd955[_0x5e0c('0x55')]['id'],_0x2de3c9[_0x5df3b1]['id']],'ChatGroupId':null},'attributes':['id',_0x5e0c('0x4c'),_0x5e0c('0x63'),_0x5e0c('0x64'),_0x5e0c('0x65'),_0x5e0c('0x48')],'order':qs[_0x5e0c('0x66')](_0x5e0c('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e0c('0x29')](wrapUser(_0x2de3c9[_0x5df3b1])));}return BPromise[_0x5e0c('0x68')](_0x2b291a);}return[];})[_0x5e0c('0x29')](function(_0xb4ceea){return{'rows':_0xb4ceea,'count':_0xb4ceea[_0x5e0c('0x38')]};})['then'](respondWithResult(_0x14bb70,null))[_0x5e0c('0x44')](handleError(_0x14bb70,null));}; \ No newline at end of file +var _0x8962=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','rows','catch','params','options','find','create','body','describe','get','lastMessageAt','createdAt','format','lastMessage','User','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5dd661,_0xbfefab){var _0x47672e=function(_0x50d5e5){while(--_0x50d5e5){_0x5dd661['push'](_0x5dd661['shift']());}};_0x47672e(++_0xbfefab);}(_0x8962,0x11f));var _0x2896=function(_0x4285c0,_0x264cbf){_0x4285c0=_0x4285c0-0x0;var _0x443be5=_0x8962[_0x4285c0];return _0x443be5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2896('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2896('0x1'));var BPromise=require(_0x2896('0x2'));var Mustache=require(_0x2896('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2896('0x4'));var csv=require(_0x2896('0x5'));var ejs=require(_0x2896('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2896('0x7'));var squel=require(_0x2896('0x8'));var crypto=require(_0x2896('0x9'));var jsforce=require(_0x2896('0xa'));var deskjs=require(_0x2896('0xb'));var toCsv=require(_0x2896('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2896('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2896('0xd'));var hardwareService=require(_0x2896('0xe'));var logger=require(_0x2896('0xf'))(_0x2896('0x10'));var utils=require(_0x2896('0x11'));var config=require(_0x2896('0x12'));var licenseUtil=require(_0x2896('0x13'));var db=require(_0x2896('0x14'))['db'];config[_0x2896('0x15')]=_[_0x2896('0x16')](config[_0x2896('0x15')],{'host':_0x2896('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2896('0x18'))[_0x2896('0x19')](socket);function respondWithStatusCode(_0x55251a,_0x2a54f4){_0x2a54f4=_0x2a54f4||0xcc;return function(_0x47fab3){if(_0x47fab3){return _0x55251a[_0x2896('0x1a')](_0x2a54f4);}return _0x55251a[_0x2896('0x1b')](_0x2a54f4)['end']();};}function respondWithResult(_0x77e767,_0xbfe192){_0xbfe192=_0xbfe192||0xc8;return function(_0x333fb0){if(_0x333fb0){return _0x77e767[_0x2896('0x1b')](_0xbfe192)[_0x2896('0x1c')](_0x333fb0);}};}function respondWithFilteredResult(_0x4195ac,_0x1ced7){return function(_0x271601){if(_0x271601){var _0x302540=typeof _0x1ced7[_0x2896('0x1d')]===_0x2896('0x1e')&&typeof _0x1ced7['limit']===_0x2896('0x1e');var _0x3f6e87=_0x271601[_0x2896('0x1f')];var _0x2ea422=_0x302540?0x0:_0x1ced7[_0x2896('0x1d')];var _0x4bdb8b=_0x302540?_0x271601['count']:_0x1ced7['offset']+_0x1ced7[_0x2896('0x20')];var _0x23f08c;if(_0x4bdb8b>=_0x3f6e87){_0x4bdb8b=_0x3f6e87;_0x23f08c=0xc8;}else{_0x23f08c=0xce;}_0x4195ac['status'](_0x23f08c);return _0x4195ac[_0x2896('0x21')](_0x2896('0x22'),_0x2ea422+'-'+_0x4bdb8b+'/'+_0x3f6e87)['json'](_0x271601);}return null;};}function patchUpdates(_0x4ab194){return function(_0x9dd7fa){try{jsonpatch['apply'](_0x9dd7fa,_0x4ab194,!![]);}catch(_0xa98d56){return BPromise[_0x2896('0x23')](_0xa98d56);}return _0x9dd7fa[_0x2896('0x24')]();};}function saveUpdates(_0x1e6747,_0x4b6171){return function(_0x767f3f){if(_0x767f3f){return _0x767f3f[_0x2896('0x25')](_0x1e6747)[_0x2896('0x26')](function(_0xf91245){return _0xf91245;});}return null;};}function removeEntity(_0x32797c,_0x5e87d3){return function(_0x51f860){if(_0x51f860){return _0x51f860[_0x2896('0x27')]()[_0x2896('0x26')](function(){_0x32797c[_0x2896('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3521c0,_0x510703){return function(_0x155338){if(!_0x155338){_0x3521c0[_0x2896('0x1a')](0x194);}return _0x155338;};}function handleError(_0x30d8cc,_0x12484a){_0x12484a=_0x12484a||0x1f4;return function(_0x549f77){logger['error'](_0x549f77[_0x2896('0x28')]);if(_0x549f77[_0x2896('0x29')]){delete _0x549f77[_0x2896('0x29')];}_0x30d8cc['status'](_0x12484a)[_0x2896('0x2a')](_0x549f77);};}exports['index']=function(_0x4b4192,_0x1658ba){var _0x3e3b0e={},_0x32fb56={},_0x6f1dd9={'count':0x0,'rows':[]};var _0x57eaf8=_[_0x2896('0x2b')](db['ChatInternalMessage'][_0x2896('0x2c')],function(_0x3f3912){return{'name':_0x3f3912[_0x2896('0x2d')],'type':_0x3f3912[_0x2896('0x2e')][_0x2896('0x2f')]};});_0x32fb56[_0x2896('0x30')]=_['map'](_0x57eaf8,_0x2896('0x29'));_0x32fb56['query']=_[_0x2896('0x31')](_0x4b4192[_0x2896('0x32')]);_0x32fb56[_0x2896('0x33')]=_[_0x2896('0x34')](_0x32fb56[_0x2896('0x30')],_0x32fb56[_0x2896('0x32')]);_0x3e3b0e['attributes']=_[_0x2896('0x34')](_0x32fb56[_0x2896('0x30')],qs[_0x2896('0x35')](_0x4b4192[_0x2896('0x32')][_0x2896('0x35')]));_0x3e3b0e[_0x2896('0x36')]=_0x3e3b0e['attributes'][_0x2896('0x37')]?_0x3e3b0e[_0x2896('0x36')]:_0x32fb56[_0x2896('0x30')];if(!_0x4b4192[_0x2896('0x32')][_0x2896('0x38')](_0x2896('0x39'))){_0x3e3b0e[_0x2896('0x20')]=qs[_0x2896('0x20')](_0x4b4192[_0x2896('0x32')][_0x2896('0x20')]);_0x3e3b0e['offset']=qs[_0x2896('0x1d')](_0x4b4192[_0x2896('0x32')][_0x2896('0x1d')]);}_0x3e3b0e['order']=qs[_0x2896('0x3a')](_0x4b4192[_0x2896('0x32')][_0x2896('0x3a')]);_0x3e3b0e[_0x2896('0x3b')]=qs[_0x2896('0x33')](_['pick'](_0x4b4192[_0x2896('0x32')],_0x32fb56[_0x2896('0x33')]),_0x57eaf8);if(_0x4b4192[_0x2896('0x32')][_0x2896('0x3c')]){_0x3e3b0e[_0x2896('0x3b')]=_[_0x2896('0x3d')](_0x3e3b0e[_0x2896('0x3b')],{'$or':_[_0x2896('0x2b')](_0x57eaf8,function(_0x1657e6){if(_0x1657e6['type']!==_0x2896('0x3e')){var _0x5dcda7={};_0x5dcda7[_0x1657e6['name']]={'$like':'%'+_0x4b4192[_0x2896('0x32')][_0x2896('0x3c')]+'%'};return _0x5dcda7;}})});}_0x3e3b0e=_['merge']({},_0x3e3b0e,_0x4b4192['options']);var _0xf4769={'where':_0x3e3b0e[_0x2896('0x3b')]};return db[_0x2896('0x3f')][_0x2896('0x1f')](_0xf4769)[_0x2896('0x26')](function(_0x4bd0ef){_0x6f1dd9[_0x2896('0x1f')]=_0x4bd0ef;if(_0x4b4192[_0x2896('0x32')][_0x2896('0x40')]){_0x3e3b0e['include']=[{'all':!![]}];}return db[_0x2896('0x3f')][_0x2896('0x41')](_0x3e3b0e);})[_0x2896('0x26')](function(_0x3896e7){_0x6f1dd9[_0x2896('0x42')]=_0x3896e7;return _0x6f1dd9;})[_0x2896('0x26')](respondWithFilteredResult(_0x1658ba,_0x3e3b0e))[_0x2896('0x43')](handleError(_0x1658ba,null));};exports['show']=function(_0x3d5e6d,_0x958156){var _0x2c1f6f={'raw':!![],'where':{'id':_0x3d5e6d[_0x2896('0x44')]['id']}},_0x497975={};_0x497975[_0x2896('0x30')]=_['keys'](db[_0x2896('0x3f')][_0x2896('0x2c')]);_0x497975[_0x2896('0x32')]=_[_0x2896('0x31')](_0x3d5e6d[_0x2896('0x32')]);_0x497975[_0x2896('0x33')]=_[_0x2896('0x34')](_0x497975[_0x2896('0x30')],_0x497975['query']);_0x2c1f6f[_0x2896('0x36')]=_[_0x2896('0x34')](_0x497975['model'],qs[_0x2896('0x35')](_0x3d5e6d['query'][_0x2896('0x35')]));_0x2c1f6f[_0x2896('0x36')]=_0x2c1f6f['attributes'][_0x2896('0x37')]?_0x2c1f6f[_0x2896('0x36')]:_0x497975[_0x2896('0x30')];if(_0x3d5e6d[_0x2896('0x32')][_0x2896('0x40')]){_0x2c1f6f['include']=[{'all':!![]}];}_0x2c1f6f=_[_0x2896('0x3d')]({},_0x2c1f6f,_0x3d5e6d[_0x2896('0x45')]);return db[_0x2896('0x3f')][_0x2896('0x46')](_0x2c1f6f)['then'](handleEntityNotFound(_0x958156,null))[_0x2896('0x26')](respondWithResult(_0x958156,null))[_0x2896('0x43')](handleError(_0x958156,null));};exports[_0x2896('0x47')]=function(_0x2814c8,_0x5b2dff){return db['ChatInternalMessage']['create'](_0x2814c8[_0x2896('0x48')],{})['then'](respondWithResult(_0x5b2dff,0xc9))[_0x2896('0x43')](handleError(_0x5b2dff,null));};exports[_0x2896('0x25')]=function(_0x2ae123,_0x2b9080){if(_0x2ae123[_0x2896('0x48')]['id']){delete _0x2ae123[_0x2896('0x48')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2ae123['params']['id']}})[_0x2896('0x26')](handleEntityNotFound(_0x2b9080,null))[_0x2896('0x26')](saveUpdates(_0x2ae123[_0x2896('0x48')],null))['then'](respondWithResult(_0x2b9080,null))[_0x2896('0x43')](handleError(_0x2b9080,null));};exports[_0x2896('0x27')]=function(_0x56b073,_0x9f1008){return db[_0x2896('0x3f')]['find']({'where':{'id':_0x56b073[_0x2896('0x44')]['id']}})[_0x2896('0x26')](handleEntityNotFound(_0x9f1008,null))[_0x2896('0x26')](removeEntity(_0x9f1008,null))[_0x2896('0x43')](handleError(_0x9f1008,null));};exports[_0x2896('0x49')]=function(_0xfcd2b6,_0x257985){return db[_0x2896('0x3f')][_0x2896('0x49')]()[_0x2896('0x26')](respondWithResult(_0x257985,null))[_0x2896('0x43')](handleError(_0x257985,null));};function wrapUser(_0x23174d){return function(_0xff3753){var _0x396c3b=_0x23174d[_0x2896('0x4a')]({'plain':!![]});_0x396c3b['messages']=[];if(_0xff3753){_0x396c3b[_0x2896('0x4b')]=_0xff3753[_0x2896('0x4c')];_0x396c3b['lastMessage']=_0xff3753;}else{_0x396c3b['lastMessageAt']=moment(0x0)[_0x2896('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x396c3b[_0x2896('0x4e')]={};}return _0x396c3b;};}exports['getUsers']=function(_0x3da91c,_0x27b796,_0x58c940){var _0x5316be=[];return db[_0x2896('0x4f')][_0x2896('0x41')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x2896('0x50'),'name',_0x2896('0x51'),_0x2896('0x52'),'internal','online',_0x2896('0x53'),_0x2896('0x54'),_0x2896('0x55')],'order':qs[_0x2896('0x3a')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x2896('0x56'),'attributes':['id',_0x2896('0x29'),_0x2896('0x2e')],'through':{'attributes':[]}}]})[_0x2896('0x26')](function(_0x1ed21a){if(_0x1ed21a){var _0xe73673=_0x3da91c['user']['get']({'plain':!![]});if(!_0xe73673)throw new Error(_0x2896('0x57'));if(_0xe73673[_0x2896('0x51')]===_0x2896('0x58')){return db[_0x2896('0x59')][_0x2896('0x46')]({'where':{'name':_0x2896('0x5a'),'userProfileId':_0xe73673['userProfileId']},'raw':!![]})['then'](function(_0x57e88e){if(_0x57e88e){if(_0x57e88e[_0x2896('0x5b')]===0x0){return db[_0x2896('0x5c')][_0x2896('0x41')]({'where':{'sectionId':_0x57e88e['id']},'raw':!![]})[_0x2896('0x26')](function(_0xa92599){var _0x39d913=[];if(_[_0x2896('0x5d')](_0xa92599)){_0x39d913=_['filter'](_0x1ed21a,function(_0x49d4fb){if(_0x49d4fb[_0x2896('0x51')]!==_0x2896('0x5e')){return _0x49d4fb;}});return _0x39d913;}else{for(var _0x3ade06=0x0;_0x3ade06<_0x1ed21a['length'];_0x3ade06++){var _0x4135c0=_0x1ed21a[_0x3ade06];if(_0x4135c0['role']===_0x2896('0x5e')){var _0x47adb6=_['find'](_0xa92599,function(_0x1e5ca3){return _0x1e5ca3[_0x2896('0x5f')]===_0x4135c0['id'];});if(_0x47adb6)_0x39d913[_0x2896('0x60')](_0x4135c0);}else{_0x39d913[_0x2896('0x60')](_0x4135c0);}}return _0x39d913;}});}else{return _0x1ed21a;}}else{var _0x261c77=_[_0x2896('0x3c')](_0x1ed21a,function(_0x3e2c03){if(_0x3e2c03[_0x2896('0x51')]!==_0x2896('0x5e')){return _0x3e2c03;}});return _0x261c77;}});}else{return _0x1ed21a;}}})[_0x2896('0x26')](function(_0x30d215){var _0x5384eb=[];if(_0x30d215){_0x5316be=_0x30d215;for(var _0x486a41=0x0;_0x486a41<_0x30d215[_0x2896('0x37')];_0x486a41+=0x1){_0x5316be[_0x486a41]['messages']=[];_0x5384eb[_0x2896('0x60')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x3da91c['user']['id'],_0x30d215[_0x486a41]['id']],'ToId':[_0x3da91c[_0x2896('0x58')]['id'],_0x30d215[_0x486a41]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x2896('0x61'),_0x2896('0x62'),_0x2896('0x63'),'body'],'order':qs[_0x2896('0x3a')](_0x2896('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x30d215[_0x486a41])));}return BPromise['all'](_0x5384eb);}return[];})[_0x2896('0x26')](function(_0x329882){return{'rows':_0x329882,'count':_0x329882['length']};})[_0x2896('0x26')](respondWithResult(_0x27b796,null))[_0x2896('0x43')](handleError(_0x27b796,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 873b0a3..ba3d9f1 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 _0x3a00=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f3195,_0xd55489){var _0x5a16fb=function(_0x3d1aad){while(--_0x3d1aad){_0x2f3195['push'](_0x2f3195['shift']());}};_0x5a16fb(++_0xd55489);}(_0x3a00,0xe0));var _0x03a0=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3a00[_0x587dd0];return _0x56f153;};'use strict';var EventEmitter=require(_0x03a0('0x0'));var ChatInternalMessage=require(_0x03a0('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03a0('0x2')](0x0);var events={'afterCreate':_0x03a0('0x3'),'afterUpdate':'update','afterDestroy':_0x03a0('0x4')};function emitEvent(_0x479cc7){return function(_0x2b6f3a,_0x36a480,_0x3769ca){ChatInternalMessageEvents[_0x03a0('0x5')](_0x479cc7+':'+_0x2b6f3a['id'],_0x2b6f3a);ChatInternalMessageEvents['emit'](_0x479cc7,_0x2b6f3a);_0x3769ca(null);};}for(var e in events){if(events[_0x03a0('0x6')](e)){var event=events[e];ChatInternalMessage[_0x03a0('0x7')](e,emitEvent(event));}}module[_0x03a0('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x8946=['update','remove','emit','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8946,0x130));var _0x6894=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x8946[_0x432fca];return _0x3adba4;};'use strict';var EventEmitter=require(_0x6894('0x0'));var ChatInternalMessage=require(_0x6894('0x1'))['db'][_0x6894('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6894('0x3'),'afterUpdate':_0x6894('0x4'),'afterDestroy':_0x6894('0x5')};function emitEvent(_0x76c9d6){return function(_0x2d9ea8,_0x19fb45,_0x27412f){ChatInternalMessageEvents[_0x6894('0x6')](_0x76c9d6+':'+_0x2d9ea8['id'],_0x2d9ea8);ChatInternalMessageEvents['emit'](_0x76c9d6,_0x2d9ea8);_0x27412f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 74d4c32..78ad587 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 _0xa580=['util','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash'];(function(_0x531ad4,_0x4fdd92){var _0x37fa11=function(_0x2d9e9d){while(--_0x2d9e9d){_0x531ad4['push'](_0x531ad4['shift']());}};_0x37fa11(++_0x4fdd92);}(_0xa580,0x107));var _0x0a58=function(_0x13d6ac,_0x3cc744){_0x13d6ac=_0x13d6ac-0x0;var _0x5f2e28=_0xa580[_0x13d6ac];return _0x5f2e28;};'use strict';var _=require(_0x0a58('0x0'));var util=require(_0x0a58('0x1'));var logger=require('../../config/logger')(_0x0a58('0x2'));var moment=require('moment');var BPromise=require(_0x0a58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a58('0x4'));var rimraf=require(_0x0a58('0x5'));var config=require(_0x0a58('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x0a58('0x7')]=function(_0x235cb3,_0x3f4883){return _0x235cb3[_0x0a58('0x8')](_0x0a58('0x9'),attributes,{'tableName':_0x0a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a58('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x30a6=['../../config/logger','api','moment','request-promise','path','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1e5465,_0x94e77e){var _0x3341b6=function(_0x38fe8d){while(--_0x38fe8d){_0x1e5465['push'](_0x1e5465['shift']());}};_0x3341b6(++_0x94e77e);}(_0x30a6,0x11c));var _0x630a=function(_0xe3b59c,_0x456c5e){_0xe3b59c=_0xe3b59c-0x0;var _0x586a7a=_0x30a6[_0xe3b59c];return _0x586a7a;};'use strict';var _=require(_0x630a('0x0'));var util=require(_0x630a('0x1'));var logger=require(_0x630a('0x2'))(_0x630a('0x3'));var moment=require(_0x630a('0x4'));var BPromise=require('bluebird');var rp=require(_0x630a('0x5'));var fs=require('fs');var path=require(_0x630a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x630a('0x7'));module[_0x630a('0x8')]=function(_0x4f7836,_0x2e34ae){return _0x4f7836[_0x630a('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x630a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x630a('0xb'),'collate':_0x630a('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 3ba2dea..edbb425 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 _0xf3aa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','moment'];(function(_0x58674c,_0x3c35a6){var _0x4102a3=function(_0x2d7031){while(--_0x2d7031){_0x58674c['push'](_0x58674c['shift']());}};_0x4102a3(++_0x3c35a6);}(_0xf3aa,0x16a));var _0xaf3a=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xf3aa[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0xaf3a('0x0'));var util=require('util');var moment=require(_0xaf3a('0x1'));var BPromise=require(_0xaf3a('0x2'));var rs=require(_0xaf3a('0x3'));var fs=require('fs');var Redis=require(_0xaf3a('0x4'));var db=require(_0xaf3a('0x5'))['db'];var utils=require(_0xaf3a('0x6'));var logger=require(_0xaf3a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf3a('0x8')][_0xaf3a('0x9')]({'port':0x232a});config[_0xaf3a('0xa')]=_[_0xaf3a('0xb')](config['redis'],{'host':_0xaf3a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf3a('0xa')]));require(_0xaf3a('0xd'))[_0xaf3a('0xe')](socket);function respondWithRpcPromise(_0x11d0dc,_0x403a69,_0x449086){return new BPromise(function(_0x35be54,_0x452123){return client[_0xaf3a('0xf')](_0x11d0dc,_0x449086)[_0xaf3a('0x10')](function(_0x2083f9){logger['info'](_0xaf3a('0x11'),_0x403a69,'request\x20sent');logger['debug'](_0xaf3a('0x12'),_0x403a69,_0xaf3a('0x13'),JSON['stringify'](_0x2083f9));if(_0x2083f9[_0xaf3a('0x14')]){if(_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x15')]===0x1f4){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x452123(_0x2083f9['error'][_0xaf3a('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0x2083f9[_0xaf3a('0x14')][_0xaf3a('0x16')]);return _0x35be54(_0x2083f9[_0xaf3a('0x14')]['message']);}else{logger[_0xaf3a('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x403a69,_0xaf3a('0x13'));_0x35be54(_0x2083f9[_0xaf3a('0x18')]['message']);}})[_0xaf3a('0x19')](function(_0x178183){logger['error'](_0xaf3a('0x11'),_0x403a69,_0x178183);_0x452123(_0x178183);});});} \ No newline at end of file +var _0xcb79=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcb79,0x15f));var _0x9cb7=function(_0x1abe13,_0x140231){_0x1abe13=_0x1abe13-0x0;var _0x4884b2=_0xcb79[_0x1abe13];return _0x4884b2;};'use strict';var _=require(_0x9cb7('0x0'));var util=require(_0x9cb7('0x1'));var moment=require(_0x9cb7('0x2'));var BPromise=require(_0x9cb7('0x3'));var rs=require(_0x9cb7('0x4'));var fs=require('fs');var Redis=require(_0x9cb7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cb7('0x6'));var logger=require(_0x9cb7('0x7'))(_0x9cb7('0x8'));var config=require(_0x9cb7('0x9'));var jayson=require(_0x9cb7('0xa'));var client=jayson[_0x9cb7('0xb')][_0x9cb7('0xc')]({'port':0x232a});config['redis']=_[_0x9cb7('0xd')](config['redis'],{'host':_0x9cb7('0xe'),'port':0x18eb});var socket=require(_0x9cb7('0xf'))(new Redis(config['redis']));require(_0x9cb7('0x10'))['register'](socket);function respondWithRpcPromise(_0x1d61e1,_0x39e8a9,_0x38de4f){return new BPromise(function(_0x51481d,_0x1e18b0){return client['request'](_0x1d61e1,_0x38de4f)['then'](function(_0x5e626e){logger[_0x9cb7('0x11')](_0x9cb7('0x12'),_0x39e8a9,'request\x20sent');logger[_0x9cb7('0x13')](_0x9cb7('0x14'),_0x39e8a9,'request\x20sent',JSON[_0x9cb7('0x15')](_0x5e626e));if(_0x5e626e[_0x9cb7('0x16')]){if(_0x5e626e['error'][_0x9cb7('0x17')]===0x1f4){logger['error'](_0x9cb7('0x12'),_0x39e8a9,_0x5e626e[_0x9cb7('0x16')][_0x9cb7('0x18')]);return _0x1e18b0(_0x5e626e[_0x9cb7('0x16')][_0x9cb7('0x18')]);}logger[_0x9cb7('0x16')](_0x9cb7('0x12'),_0x39e8a9,_0x5e626e['error'][_0x9cb7('0x18')]);return _0x51481d(_0x5e626e['error']['message']);}else{logger[_0x9cb7('0x11')](_0x9cb7('0x12'),_0x39e8a9,_0x9cb7('0x19'));_0x51481d(_0x5e626e[_0x9cb7('0x1a')][_0x9cb7('0x18')]);}})[_0x9cb7('0x1b')](function(_0x38940f){logger[_0x9cb7('0x16')](_0x9cb7('0x12'),_0x39e8a9,_0x38940f);_0x1e18b0(_0x38940f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f34e170..7a3d5fd 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 _0x84a7=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x84a7,0x137));var _0x784a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84a7[_0x122ef9];return _0x42fba0;};'use strict';var ChatInternalMessageEvents=require(_0x784a('0x0'));var events=['save',_0x784a('0x1'),_0x784a('0x2')];function createListener(_0x54ff97,_0x58ba95){return function(_0xf6d0e6){_0x58ba95[_0x784a('0x3')](_0x54ff97,_0xf6d0e6);};}function removeListener(_0x3ae353,_0x4a31cd){return function(){ChatInternalMessageEvents[_0x784a('0x4')](_0x3ae353,_0x4a31cd);};}exports['register']=function(_0x287db9){for(var _0x1d3ac7=0x0,_0x5562e=events[_0x784a('0x5')];_0x1d3ac7<_0x5562e;_0x1d3ac7++){var _0x4d6e30=events[_0x1d3ac7];var _0x3c8ea1=createListener(_0x784a('0x6')+_0x4d6e30,_0x287db9);ChatInternalMessageEvents['on'](_0x4d6e30,_0x3c8ea1);}}; \ No newline at end of file +var _0xc04b=['./chatInternalMessage.events','save','update','emit','register','chatInternalMessage:'];(function(_0x120b71,_0x5bb618){var _0x50d58f=function(_0x81c860){while(--_0x81c860){_0x120b71['push'](_0x120b71['shift']());}};_0x50d58f(++_0x5bb618);}(_0xc04b,0x1ec));var _0xbc04=function(_0x200a1d,_0x2b4a70){_0x200a1d=_0x200a1d-0x0;var _0x5db63b=_0xc04b[_0x200a1d];return _0x5db63b;};'use strict';var ChatInternalMessageEvents=require(_0xbc04('0x0'));var events=[_0xbc04('0x1'),'remove',_0xbc04('0x2')];function createListener(_0x6d4ef6,_0x3e1854){return function(_0x518716){_0x3e1854[_0xbc04('0x3')](_0x6d4ef6,_0x518716);};}function removeListener(_0x18d14a,_0xac3069){return function(){ChatInternalMessageEvents['removeListener'](_0x18d14a,_0xac3069);};}exports[_0xbc04('0x4')]=function(_0xdffbe6){for(var _0x58f60e=0x0,_0x37708c=events['length'];_0x58f60e<_0x37708c;_0x58f60e++){var _0x323b6b=events[_0x58f60e];var _0x2e6612=createListener(_0xbc04('0x5')+_0x323b6b,_0xdffbe6);ChatInternalMessageEvents['on'](_0x323b6b,_0x2e6612);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5b94e03..bdb90bb 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 _0x7bd7=['isAuthenticated','index','/describe','describe','/users','show','post','create','put','/:id','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x7bd7,0x1c4));var _0x77bd=function(_0x528ef8,_0x1b1681){_0x528ef8=_0x528ef8-0x0;var _0x68c11b=_0x7bd7[_0x528ef8];return _0x68c11b;};'use strict';var multer=require(_0x77bd('0x0'));var util=require(_0x77bd('0x1'));var path=require(_0x77bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x77bd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77bd('0x4'));var interaction=require(_0x77bd('0x5'));var config=require(_0x77bd('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x77bd('0x7')]('/',auth[_0x77bd('0x8')](),controller[_0x77bd('0x9')]);router[_0x77bd('0x7')](_0x77bd('0xa'),auth[_0x77bd('0x8')](),controller[_0x77bd('0xb')]);router[_0x77bd('0x7')](_0x77bd('0xc'),auth[_0x77bd('0x8')](),controller['getUsers']);router['get']('/:id',auth[_0x77bd('0x8')](),controller[_0x77bd('0xd')]);router[_0x77bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x77bd('0xf')]);router[_0x77bd('0x10')]('/:id',controller['update']);router['delete'](_0x77bd('0x11'),auth[_0x77bd('0x8')](),controller[_0x77bd('0x12')]);module[_0x77bd('0x13')]=router; \ No newline at end of file +var _0x2153=['get','isAuthenticated','/describe','/users','show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x592d0e,_0x433837){var _0x29a876=function(_0x2234d5){while(--_0x2234d5){_0x592d0e['push'](_0x592d0e['shift']());}};_0x29a876(++_0x433837);}(_0x2153,0x6f));var _0x3215=function(_0x321df7,_0x5579dd){_0x321df7=_0x321df7-0x0;var _0x1ddef4=_0x2153[_0x321df7];return _0x1ddef4;};'use strict';var multer=require(_0x3215('0x0'));var util=require('util');var path=require(_0x3215('0x1'));var timeout=require(_0x3215('0x2'));var express=require(_0x3215('0x3'));var router=express[_0x3215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3215('0x5'));var interaction=require(_0x3215('0x6'));var config=require(_0x3215('0x7'));var controller=require(_0x3215('0x8'));router[_0x3215('0x9')]('/',auth[_0x3215('0xa')](),controller['index']);router['get'](_0x3215('0xb'),auth[_0x3215('0xa')](),controller['describe']);router[_0x3215('0x9')](_0x3215('0xc'),auth['isAuthenticated'](),controller['getUsers']);router[_0x3215('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3215('0xd')]);router[_0x3215('0xe')]('/',auth[_0x3215('0xa')](),controller['create']);router[_0x3215('0xf')](_0x3215('0x10'),controller[_0x3215('0x11')]);router[_0x3215('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3215('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2062bbb..bf7bca9 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 _0x33d2=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x33d2,0x7f));var _0x233d=function(_0x333160,_0x4c1df7){_0x333160=_0x333160-0x0;var _0x256d5a=_0x33d2[_0x333160];return _0x256d5a;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'body':{'type':Sequelize[_0x233d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x233d('0x4')),'defaultValue':_0x233d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x233d('0x5')]},'providerName':{'type':Sequelize[_0x233d('0x6')]},'providerResponse':{'type':Sequelize[_0x233d('0x2')]}}; \ No newline at end of file +var _0x4e81=['out','DATE','STRING','sequelize','exports','TEXT','ENUM'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4e81,0x1bc));var _0x14e8=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x4e81[_0x3de873];return _0x380b8c;};'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/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index eae0b93..545bb43 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 _0x4dab=['jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','reject','save','then','end','stack','name','send','index','ChatMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','show','rawAttributes','find','create','body','update','params','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','AcceptMessage','ContactId','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','interaction','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','interface','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register'];(function(_0x391fda,_0x39a798){var _0x2540fc=function(_0x2aa516){while(--_0x2aa516){_0x391fda['push'](_0x391fda['shift']());}};_0x2540fc(++_0x39a798);}(_0x4dab,0x66));var _0xb4da=function(_0x31bb4e,_0x2d4db0){_0x31bb4e=_0x31bb4e-0x0;var _0x37defa=_0x4dab[_0x31bb4e];return _0x37defa;};'use strict';var emlformat=require(_0xb4da('0x0'));var rimraf=require(_0xb4da('0x1'));var zipdir=require(_0xb4da('0x2'));var jsonpatch=require(_0xb4da('0x3'));var rp=require(_0xb4da('0x4'));var moment=require('moment');var BPromise=require(_0xb4da('0x5'));var Mustache=require(_0xb4da('0x6'));var util=require('util');var path=require(_0xb4da('0x7'));var sox=require(_0xb4da('0x8'));var csv=require(_0xb4da('0x9'));var ejs=require(_0xb4da('0xa'));var fs=require('fs');var fs_extra=require(_0xb4da('0xb'));var _=require(_0xb4da('0xc'));var squel=require('squel');var crypto=require(_0xb4da('0xd'));var jsforce=require(_0xb4da('0xe'));var deskjs=require(_0xb4da('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4da('0x10'));var Papa=require(_0xb4da('0x11'));var Redis=require(_0xb4da('0x12'));var authService=require(_0xb4da('0x13'));var qs=require(_0xb4da('0x14'));var as=require(_0xb4da('0x15'));var hardwareService=require(_0xb4da('0x16'));var logger=require(_0xb4da('0x17'))('api');var utils=require(_0xb4da('0x18'));var config=require(_0xb4da('0x19'));var licenseUtil=require(_0xb4da('0x1a'));var db=require(_0xb4da('0x1b'))['db'];config['redis']=_[_0xb4da('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb4da('0x1d'))(new Redis(config[_0xb4da('0x1e')]));require('./chatMessage.socket')[_0xb4da('0x1f')](socket);var jayson=require(_0xb4da('0x20'));var client=jayson[_0xb4da('0x21')][_0xb4da('0x22')]({'port':0x232c});var client9002=jayson[_0xb4da('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3d5a,_0x459e82,_0x13f491,_0x4a42a9){return new BPromise(function(_0x4ed159,_0x6f7150){var _0x4cfc86=_0x4a42a9||client;return _0x4cfc86[_0xb4da('0x23')](_0x5f3d5a,_0x13f491)['then'](function(_0x191ab7){logger[_0xb4da('0x24')]('ChatMessage,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'));logger[_0xb4da('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x459e82,_0xb4da('0x25'),JSON[_0xb4da('0x27')](_0x191ab7));if(_0x191ab7['error']){if(_0x191ab7['error'][_0xb4da('0x28')]===0x1f4){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x6f7150(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);return _0x4ed159(_0x191ab7[_0xb4da('0x29')][_0xb4da('0x2b')]);}else{logger[_0xb4da('0x24')](_0xb4da('0x2a'),_0x459e82,_0xb4da('0x25'));_0x4ed159(_0x191ab7[_0xb4da('0x2c')][_0xb4da('0x2b')]);}})[_0xb4da('0x2d')](function(_0x446053){logger[_0xb4da('0x29')](_0xb4da('0x2a'),_0x459e82,_0x446053);_0x6f7150(_0x446053);});});}function respondWithStatusCode(_0x5a0f18,_0x4825a0){_0x4825a0=_0x4825a0||0xcc;return function(_0x377d4f){if(_0x377d4f){return _0x5a0f18['sendStatus'](_0x4825a0);}return _0x5a0f18[_0xb4da('0x2e')](_0x4825a0)['end']();};}function respondWithResult(_0x5a6d5f,_0x2c146c){_0x2c146c=_0x2c146c||0xc8;return function(_0x91d489){if(_0x91d489){return _0x5a6d5f[_0xb4da('0x2e')](_0x2c146c)[_0xb4da('0x2f')](_0x91d489);}};}function respondWithFilteredResult(_0x145ab5,_0x53e51d){return function(_0x4db505){if(_0x4db505){var _0x4c1fff=typeof _0x53e51d[_0xb4da('0x30')]===_0xb4da('0x31')&&typeof _0x53e51d[_0xb4da('0x32')]===_0xb4da('0x31');var _0x157757=_0x4db505[_0xb4da('0x33')];var _0x454fad=_0x4c1fff?0x0:_0x53e51d[_0xb4da('0x30')];var _0x325def=_0x4c1fff?_0x4db505[_0xb4da('0x33')]:_0x53e51d[_0xb4da('0x30')]+_0x53e51d[_0xb4da('0x32')];var _0x1a4333;if(_0x325def>=_0x157757){_0x325def=_0x157757;_0x1a4333=0xc8;}else{_0x1a4333=0xce;}_0x145ab5['status'](_0x1a4333);return _0x145ab5[_0xb4da('0x34')]('Content-Range',_0x454fad+'-'+_0x325def+'/'+_0x157757)[_0xb4da('0x2f')](_0x4db505);}return null;};}function patchUpdates(_0x57163e){return function(_0x10aed8){try{jsonpatch['apply'](_0x10aed8,_0x57163e,!![]);}catch(_0x5dbac7){return BPromise[_0xb4da('0x35')](_0x5dbac7);}return _0x10aed8[_0xb4da('0x36')]();};}function saveUpdates(_0x3978b7,_0x31ba57){return function(_0x20b726){if(_0x20b726){return _0x20b726['update'](_0x3978b7)[_0xb4da('0x37')](function(_0x6d2414){return _0x6d2414;});}return null;};}function removeEntity(_0x4a2d76,_0x386971){return function(_0xa0efb2){if(_0xa0efb2){return _0xa0efb2['destroy']()['then'](function(){_0x4a2d76[_0xb4da('0x2e')](0xcc)[_0xb4da('0x38')]();});}};}function handleEntityNotFound(_0x4252c8,_0x4b872c){return function(_0x20380c){if(!_0x20380c){_0x4252c8['sendStatus'](0x194);}return _0x20380c;};}function handleError(_0x2ec9f1,_0x4863b){_0x4863b=_0x4863b||0x1f4;return function(_0x150e53){logger[_0xb4da('0x29')](_0x150e53[_0xb4da('0x39')]);if(_0x150e53[_0xb4da('0x3a')]){delete _0x150e53['name'];}_0x2ec9f1[_0xb4da('0x2e')](_0x4863b)[_0xb4da('0x3b')](_0x150e53);};}exports[_0xb4da('0x3c')]=function(_0x5b9b62,_0x5b3b0d){var _0x2d618d={},_0x3c9920={},_0x15f376={'count':0x0,'rows':[]};var _0x2ad279=_['map'](db[_0xb4da('0x3d')]['rawAttributes'],function(_0x22aaf7){return{'name':_0x22aaf7['fieldName'],'type':_0x22aaf7[_0xb4da('0x3e')][_0xb4da('0x3f')]};});_0x3c9920[_0xb4da('0x40')]=_[_0xb4da('0x41')](_0x2ad279,_0xb4da('0x3a'));_0x3c9920[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x5b9b62[_0xb4da('0x42')]);_0x3c9920[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3c9920['model'],_0x3c9920[_0xb4da('0x42')]);_0x2d618d[_0xb4da('0x46')]=_[_0xb4da('0x45')](_0x3c9920[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x47')]));_0x2d618d['attributes']=_0x2d618d[_0xb4da('0x46')][_0xb4da('0x48')]?_0x2d618d[_0xb4da('0x46')]:_0x3c9920[_0xb4da('0x40')];if(!_0x5b9b62[_0xb4da('0x42')]['hasOwnProperty'](_0xb4da('0x49'))){_0x2d618d[_0xb4da('0x32')]=qs['limit'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x32')]);_0x2d618d[_0xb4da('0x30')]=qs[_0xb4da('0x30')](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x30')]);}_0x2d618d[_0xb4da('0x4a')]=qs['sort'](_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4b')]);_0x2d618d[_0xb4da('0x4c')]=qs[_0xb4da('0x44')](_['pick'](_0x5b9b62[_0xb4da('0x42')],_0x3c9920[_0xb4da('0x44')]),_0x2ad279);if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]){_0x2d618d[_0xb4da('0x4c')]=_['merge'](_0x2d618d[_0xb4da('0x4c')],{'$or':_['map'](_0x2ad279,function(_0x4c1ca9){if(_0x4c1ca9[_0xb4da('0x3e')]!==_0xb4da('0x4e')){var _0x51158b={};_0x51158b[_0x4c1ca9[_0xb4da('0x3a')]]={'$like':'%'+_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x4d')]+'%'};return _0x51158b;}})});}_0x2d618d=_[_0xb4da('0x4f')]({},_0x2d618d,_0x5b9b62[_0xb4da('0x50')]);var _0x20e785={'where':_0x2d618d['where']};return db['ChatMessage'][_0xb4da('0x33')](_0x20e785)[_0xb4da('0x37')](function(_0x56752d){_0x15f376['count']=_0x56752d;if(_0x5b9b62[_0xb4da('0x42')][_0xb4da('0x51')]){_0x2d618d[_0xb4da('0x52')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2d618d);})[_0xb4da('0x37')](function(_0x40cda3){_0x15f376[_0xb4da('0x53')]=_0x40cda3;return _0x15f376;})[_0xb4da('0x37')](respondWithFilteredResult(_0x5b3b0d,_0x2d618d))['catch'](handleError(_0x5b3b0d,null));};exports[_0xb4da('0x54')]=function(_0x1bd859,_0x576b26){var _0x388eab={'raw':!![],'where':{'id':_0x1bd859['params']['id']}},_0x3745fd={};_0x3745fd[_0xb4da('0x40')]=_[_0xb4da('0x43')](db[_0xb4da('0x3d')][_0xb4da('0x55')]);_0x3745fd[_0xb4da('0x42')]=_[_0xb4da('0x43')](_0x1bd859[_0xb4da('0x42')]);_0x3745fd[_0xb4da('0x44')]=_[_0xb4da('0x45')](_0x3745fd[_0xb4da('0x40')],_0x3745fd[_0xb4da('0x42')]);_0x388eab[_0xb4da('0x46')]=_['intersection'](_0x3745fd[_0xb4da('0x40')],qs[_0xb4da('0x47')](_0x1bd859[_0xb4da('0x42')]['fields']));_0x388eab[_0xb4da('0x46')]=_0x388eab[_0xb4da('0x46')][_0xb4da('0x48')]?_0x388eab['attributes']:_0x3745fd[_0xb4da('0x40')];if(_0x1bd859[_0xb4da('0x42')][_0xb4da('0x51')]){_0x388eab[_0xb4da('0x52')]=[{'all':!![]}];}_0x388eab=_[_0xb4da('0x4f')]({},_0x388eab,_0x1bd859[_0xb4da('0x50')]);return db[_0xb4da('0x3d')][_0xb4da('0x56')](_0x388eab)['then'](handleEntityNotFound(_0x576b26,null))[_0xb4da('0x37')](respondWithResult(_0x576b26,null))[_0xb4da('0x2d')](handleError(_0x576b26,null));};exports[_0xb4da('0x57')]=function(_0x437da9,_0x5f2ce9){return db[_0xb4da('0x3d')][_0xb4da('0x57')](_0x437da9[_0xb4da('0x58')],{})[_0xb4da('0x37')](respondWithResult(_0x5f2ce9,0xc9))[_0xb4da('0x2d')](handleError(_0x5f2ce9,null));};exports[_0xb4da('0x59')]=function(_0x3ac8de,_0x595e6){if(_0x3ac8de[_0xb4da('0x58')]['id']){delete _0x3ac8de[_0xb4da('0x58')]['id'];}return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3ac8de[_0xb4da('0x5a')]['id']}})['then'](handleEntityNotFound(_0x595e6,null))[_0xb4da('0x37')](saveUpdates(_0x3ac8de['body'],null))[_0xb4da('0x37')](respondWithResult(_0x595e6,null))[_0xb4da('0x2d')](handleError(_0x595e6,null));};exports[_0xb4da('0x5b')]=function(_0x273f6d,_0x3e06d9){return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x273f6d[_0xb4da('0x5a')]['id']}})[_0xb4da('0x37')](handleEntityNotFound(_0x3e06d9,null))[_0xb4da('0x37')](removeEntity(_0x3e06d9,null))['catch'](handleError(_0x3e06d9,null));};exports[_0xb4da('0x5c')]=function(_0x2a3ad2,_0x258ecc){return db[_0xb4da('0x3d')]['describe']()[_0xb4da('0x37')](respondWithResult(_0x258ecc,null))[_0xb4da('0x2d')](handleError(_0x258ecc,null));};var interaction_log=require(_0xb4da('0x17'))('chat-interactions');exports['accept']=function(_0x19ef33,_0xcf7d46,_0x419082){var _0x4777d8={'agent':{},'channel':_0xb4da('0x5d')};if(_0x19ef33[_0xb4da('0x58')]['id']){delete _0x19ef33[_0xb4da('0x58')]['id'];}_0x19ef33[_0xb4da('0x58')][_0xb4da('0x5e')]=!![];_0x19ef33['body'][_0xb4da('0x5f')]=moment()[_0xb4da('0x60')](_0xb4da('0x61'));_0x19ef33['body'][_0xb4da('0x62')]=_0x19ef33['body'][_0xb4da('0x62')]||_0x19ef33[_0xb4da('0x63')]['id'];_0x4777d8[_0xb4da('0x64')]['id']=_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')];return db[_0xb4da('0x3d')][_0xb4da('0x56')]({'where':{'id':_0x19ef33[_0xb4da('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xcf7d46,null))['then'](saveUpdates(_0x19ef33[_0xb4da('0x58')],null))[_0xb4da('0x37')](function(_0x5d6cd9){if(_0x5d6cd9){_0x4777d8[_0xb4da('0x2b')]=_0x5d6cd9[_0xb4da('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xb4da('0x56')]({'where':{'id':_0x5d6cd9[_0xb4da('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xcf7d46,null))[_0xb4da('0x37')](function(_0x55b188){if(_0x55b188){return _0x55b188[_0xb4da('0x59')]({'UserId':_0x19ef33[_0xb4da('0x58')][_0xb4da('0x62')],'read1stAt':_['isNil'](_0x55b188[_0xb4da('0x67')])?moment()[_0xb4da('0x60')](_0xb4da('0x61')):undefined});}return null;})['then'](function(_0x555a36){if(_0x555a36){_0x4777d8['interaction']=_0x555a36[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19ef33[_0xb4da('0x63')]['id'],_0x19ef33['user'][_0xb4da('0x3a')],_0x19ef33['user']['role'],_0x4777d8['interaction']['id'],_0x19ef33['body']?JSON[_0xb4da('0x27')](_0x19ef33['body']):'null');return respondWithRpcPromise(_0xb4da('0x68'),'acceptMessage',_0x4777d8);}return null;})['then'](function(_0x37829f){var _0x59a8ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x37829f[_0xb4da('0x2b')][_0xb4da('0x69')];return db['sequelize'][_0xb4da('0x42')](_0x59a8ce,{'type':db['Sequelize']['QueryTypes'][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x125480){return _0x125480;});})['then'](function(_0x41473a){if(_0x41473a){_0x4777d8['message'][_0xb4da('0x6b')]=_0x41473a[0x0];if(!_0x19ef33['body'][_0xb4da('0x62')])return;return db[_0xb4da('0x6c')][_0xb4da('0x56')]({'where':{'id':_0x19ef33['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id',_0xb4da('0x3a'),'fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x1d02d9){if(!_0x1d02d9)return null;_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x64')]=_0x1d02d9;return _0x4777d8;})[_0xb4da('0x37')](function(_0x5b35cc){if(_0x5b35cc){if(_0x19ef33[_0xb4da('0x58')][_0xb4da('0x6f')]){_0x4777d8[_0xb4da('0x2b')]['interface']=util[_0xb4da('0x60')](_0xb4da('0x70'),_0x19ef33['user'][_0xb4da('0x3a')]);_0x4777d8[_0xb4da('0x2b')]['channel']=_0x4777d8[_0xb4da('0x71')];_0x4777d8['message'][_0xb4da('0x72')]=_0x4777d8['channel'];_0x4777d8[_0xb4da('0x2b')][_0xb4da('0x73')]=_0xb4da('0x74');return respondWithRpcPromise(_0xb4da('0x75'),_0xb4da('0x75'),{'event':_0xb4da('0x76'),'message':_[_0xb4da('0x4f')](_0x4777d8[_0xb4da('0x2b')],JSON['parse'](_0x4777d8[_0xb4da('0x77')]['formData']))},client9002)[_0xb4da('0x37')](function(){return _0x4777d8;});}return _0x4777d8;}return null;})['then'](respondWithResult(_0xcf7d46,null))['catch'](handleError(_0xcf7d46,null));};var interaction_log=require('../../config/logger')(_0xb4da('0x78'));exports[_0xb4da('0x35')]=function(_0x3a0b1f,_0x5c0542,_0x20781a){var _0x4d2054={'agent':{},'channel':_0xb4da('0x5d')};if(_0x3a0b1f[_0xb4da('0x58')]['id']){delete _0x3a0b1f[_0xb4da('0x58')]['id'];}_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]=_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')]||_0x3a0b1f[_0xb4da('0x63')]['id'];_0x4d2054[_0xb4da('0x64')]['id']=_0x3a0b1f['body'][_0xb4da('0x62')];return db['ChatMessage'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f[_0xb4da('0x5a')]['id'],'UserId':null}})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))['then'](function(_0x169bd5){if(_0x169bd5){_0x4d2054[_0xb4da('0x2b')]=_0x169bd5['get']({'plain':!![]});return db[_0xb4da('0x79')]['find']({'where':{'id':_0x169bd5['ChatInteractionId']}});}return null;})[_0xb4da('0x37')](handleEntityNotFound(_0x5c0542,null))[_0xb4da('0x37')](function(_0x26634c){if(_0x26634c){_0x4d2054[_0xb4da('0x77')]=_0x26634c[_0xb4da('0x65')]({'plain':!![]});interaction_log[_0xb4da('0x24')](_0xb4da('0x7a'),_0x3a0b1f[_0xb4da('0x63')]['id'],_0x3a0b1f[_0xb4da('0x63')]['name'],_0x3a0b1f['user'][_0xb4da('0x7b')],_0x4d2054[_0xb4da('0x77')]['id'],_0x3a0b1f[_0xb4da('0x58')]?JSON['stringify'](_0x3a0b1f[_0xb4da('0x58')]):_0xb4da('0x7c'));return respondWithRpcPromise(_0xb4da('0x7d'),_0xb4da('0x7e'),_0x4d2054);}return null;})[_0xb4da('0x37')](function(_0xcf607b){var _0x4454dd=_0xb4da('0x7f')+_0xcf607b['message'][_0xb4da('0x69')];return db[_0xb4da('0x80')][_0xb4da('0x42')](_0x4454dd,{'type':db[_0xb4da('0x81')][_0xb4da('0x82')][_0xb4da('0x6a')],'raw':!![]})[_0xb4da('0x37')](function(_0x5c93cb){return _0x5c93cb;});})[_0xb4da('0x37')](function(_0x412725){if(_0x412725){_0x4d2054[_0xb4da('0x2b')][_0xb4da('0x6b')]=_0x412725[0x0];if(!_0x3a0b1f[_0xb4da('0x58')][_0xb4da('0x62')])return;return db['User'][_0xb4da('0x56')]({'where':{'id':_0x3a0b1f['body'][_0xb4da('0x62')],'role':_0xb4da('0x64')},'attributes':['id','name','fullname',_0xb4da('0x6d'),_0xb4da('0x6e')],'raw':!![]});}return null;})['then'](function(_0x5a283a){if(!_0x5a283a)return null;_0x4d2054['message'][_0xb4da('0x64')]=_0x5a283a;return _0x4d2054;})[_0xb4da('0x37')](function(_0x813b54){if(_0x813b54){_0x813b54['message'][_0xb4da('0x83')]=util['format'](_0xb4da('0x70'),_0x3a0b1f[_0xb4da('0x63')][_0xb4da('0x3a')]);_0x813b54['message'][_0xb4da('0x71')]=_0x4d2054[_0xb4da('0x71')];_0x813b54['message']['motionChannel']=_0x4d2054[_0xb4da('0x71')];_0x813b54[_0xb4da('0x2b')][_0xb4da('0x73')]='reject';respondWithRpcPromise('EventManager',_0xb4da('0x75'),{'event':_0xb4da('0x84'),'message':_[_0xb4da('0x4f')](_0x4d2054[_0xb4da('0x2b')],JSON['parse'](_0x4d2054['interaction'][_0xb4da('0x85')]))},client9002);return _0x4d2054;}return null;})[_0xb4da('0x37')](respondWithResult(_0x5c0542,null))[_0xb4da('0x2d')](handleError(_0x5c0542,null));}; \ No newline at end of file +var _0xf16c=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','undefined','offset','set','json','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','../../config/logger','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','agent','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','contact','event','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3b7db6,_0x4690c9){var _0x50b87a=function(_0x3e7294){while(--_0x3e7294){_0x3b7db6['push'](_0x3b7db6['shift']());}};_0x50b87a(++_0x4690c9);}(_0xf16c,0xf3));var _0xcf16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf16c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf16('0x0'));var rp=require(_0xcf16('0x1'));var moment=require(_0xcf16('0x2'));var BPromise=require(_0xcf16('0x3'));var Mustache=require(_0xcf16('0x4'));var util=require(_0xcf16('0x5'));var path=require(_0xcf16('0x6'));var sox=require(_0xcf16('0x7'));var csv=require(_0xcf16('0x8'));var ejs=require(_0xcf16('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf16('0xa'));var jsforce=require(_0xcf16('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcf16('0x8'));var querystring=require('querystring');var Papa=require(_0xcf16('0xc'));var Redis=require(_0xcf16('0xd'));var authService=require(_0xcf16('0xe'));var qs=require(_0xcf16('0xf'));var as=require(_0xcf16('0x10'));var hardwareService=require(_0xcf16('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xcf16('0x12'));var config=require(_0xcf16('0x13'));var licenseUtil=require(_0xcf16('0x14'));var db=require(_0xcf16('0x15'))['db'];config[_0xcf16('0x16')]=_[_0xcf16('0x17')](config[_0xcf16('0x16')],{'host':_0xcf16('0x18'),'port':0x18eb});var socket=require(_0xcf16('0x19'))(new Redis(config[_0xcf16('0x16')]));require(_0xcf16('0x1a'))['register'](socket);var jayson=require(_0xcf16('0x1b'));var client=jayson[_0xcf16('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xcf16('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2c1416,_0x4b8655,_0x508182,_0x3ed4c5){return new BPromise(function(_0x24084c,_0x3cd3e4){var _0x398b70=_0x3ed4c5||client;return _0x398b70[_0xcf16('0x1e')](_0x2c1416,_0x508182)[_0xcf16('0x1f')](function(_0x494d62){logger[_0xcf16('0x20')](_0xcf16('0x21'),_0x4b8655,_0xcf16('0x22'));logger[_0xcf16('0x23')](_0xcf16('0x24'),_0x4b8655,_0xcf16('0x22'),JSON['stringify'](_0x494d62));if(_0x494d62[_0xcf16('0x25')]){if(_0x494d62[_0xcf16('0x25')][_0xcf16('0x26')]===0x1f4){logger[_0xcf16('0x25')](_0xcf16('0x21'),_0x4b8655,_0x494d62['error'][_0xcf16('0x27')]);return _0x3cd3e4(_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);}logger[_0xcf16('0x25')](_0xcf16('0x21'),_0x4b8655,_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);return _0x24084c(_0x494d62[_0xcf16('0x25')][_0xcf16('0x27')]);}else{logger[_0xcf16('0x20')](_0xcf16('0x21'),_0x4b8655,_0xcf16('0x22'));_0x24084c(_0x494d62[_0xcf16('0x28')][_0xcf16('0x27')]);}})['catch'](function(_0x160fba){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4b8655,_0x160fba);_0x3cd3e4(_0x160fba);});});}function respondWithStatusCode(_0x3d32fc,_0x33db32){_0x33db32=_0x33db32||0xcc;return function(_0x5c498f){if(_0x5c498f){return _0x3d32fc[_0xcf16('0x29')](_0x33db32);}return _0x3d32fc[_0xcf16('0x2a')](_0x33db32)[_0xcf16('0x2b')]();};}function respondWithResult(_0x2dad69,_0x4d44c3){_0x4d44c3=_0x4d44c3||0xc8;return function(_0x8978a8){if(_0x8978a8){return _0x2dad69[_0xcf16('0x2a')](_0x4d44c3)['json'](_0x8978a8);}};}function respondWithFilteredResult(_0x396841,_0x55dff0){return function(_0x38e9f0){if(_0x38e9f0){var _0x20cf4c=typeof _0x55dff0['offset']==='undefined'&&typeof _0x55dff0['limit']===_0xcf16('0x2c');var _0x5475d0=_0x38e9f0['count'];var _0x398b07=_0x20cf4c?0x0:_0x55dff0[_0xcf16('0x2d')];var _0x5a4874=_0x20cf4c?_0x38e9f0['count']:_0x55dff0[_0xcf16('0x2d')]+_0x55dff0['limit'];var _0x4d5565;if(_0x5a4874>=_0x5475d0){_0x5a4874=_0x5475d0;_0x4d5565=0xc8;}else{_0x4d5565=0xce;}_0x396841[_0xcf16('0x2a')](_0x4d5565);return _0x396841[_0xcf16('0x2e')]('Content-Range',_0x398b07+'-'+_0x5a4874+'/'+_0x5475d0)[_0xcf16('0x2f')](_0x38e9f0);}return null;};}function patchUpdates(_0x23a042){return function(_0x1daf44){try{jsonpatch[_0xcf16('0x30')](_0x1daf44,_0x23a042,!![]);}catch(_0x4e670f){return BPromise[_0xcf16('0x31')](_0x4e670f);}return _0x1daf44[_0xcf16('0x32')]();};}function saveUpdates(_0x3bbb74,_0x556a01){return function(_0x747766){if(_0x747766){return _0x747766[_0xcf16('0x33')](_0x3bbb74)[_0xcf16('0x1f')](function(_0x17f912){return _0x17f912;});}return null;};}function removeEntity(_0x4cf555,_0x28a87f){return function(_0x409933){if(_0x409933){return _0x409933[_0xcf16('0x34')]()[_0xcf16('0x1f')](function(){_0x4cf555[_0xcf16('0x2a')](0xcc)[_0xcf16('0x2b')]();});}};}function handleEntityNotFound(_0x21e391,_0x396bbd){return function(_0x231ffc){if(!_0x231ffc){_0x21e391[_0xcf16('0x29')](0x194);}return _0x231ffc;};}function handleError(_0x12422f,_0x191da2){_0x191da2=_0x191da2||0x1f4;return function(_0x48c549){logger[_0xcf16('0x25')](_0x48c549[_0xcf16('0x35')]);if(_0x48c549['name']){delete _0x48c549[_0xcf16('0x36')];}_0x12422f[_0xcf16('0x2a')](_0x191da2)[_0xcf16('0x37')](_0x48c549);};}exports[_0xcf16('0x38')]=function(_0x2ee512,_0x1b1efd){var _0x258799={},_0x4cdbc7={},_0x1bad40={'count':0x0,'rows':[]};var _0x2253fd=_[_0xcf16('0x39')](db[_0xcf16('0x3a')]['rawAttributes'],function(_0x2ab950){return{'name':_0x2ab950['fieldName'],'type':_0x2ab950[_0xcf16('0x3b')]['key']};});_0x4cdbc7[_0xcf16('0x3c')]=_[_0xcf16('0x39')](_0x2253fd,'name');_0x4cdbc7[_0xcf16('0x3d')]=_[_0xcf16('0x3e')](_0x2ee512[_0xcf16('0x3d')]);_0x4cdbc7[_0xcf16('0x3f')]=_['intersection'](_0x4cdbc7[_0xcf16('0x3c')],_0x4cdbc7['query']);_0x258799[_0xcf16('0x40')]=_[_0xcf16('0x41')](_0x4cdbc7[_0xcf16('0x3c')],qs[_0xcf16('0x42')](_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x42')]));_0x258799['attributes']=_0x258799[_0xcf16('0x40')][_0xcf16('0x43')]?_0x258799[_0xcf16('0x40')]:_0x4cdbc7[_0xcf16('0x3c')];if(!_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x44')]('nolimit')){_0x258799[_0xcf16('0x45')]=qs[_0xcf16('0x45')](_0x2ee512[_0xcf16('0x3d')]['limit']);_0x258799[_0xcf16('0x2d')]=qs[_0xcf16('0x2d')](_0x2ee512['query'][_0xcf16('0x2d')]);}_0x258799[_0xcf16('0x46')]=qs[_0xcf16('0x47')](_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x47')]);_0x258799[_0xcf16('0x48')]=qs[_0xcf16('0x3f')](_['pick'](_0x2ee512[_0xcf16('0x3d')],_0x4cdbc7[_0xcf16('0x3f')]),_0x2253fd);if(_0x2ee512[_0xcf16('0x3d')]['filter']){_0x258799[_0xcf16('0x48')]=_[_0xcf16('0x49')](_0x258799['where'],{'$or':_[_0xcf16('0x39')](_0x2253fd,function(_0x72b091){if(_0x72b091[_0xcf16('0x3b')]!==_0xcf16('0x4a')){var _0x5439c4={};_0x5439c4[_0x72b091[_0xcf16('0x36')]]={'$like':'%'+_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x4b')]+'%'};return _0x5439c4;}})});}_0x258799=_[_0xcf16('0x49')]({},_0x258799,_0x2ee512[_0xcf16('0x4c')]);var _0x388099={'where':_0x258799[_0xcf16('0x48')]};return db[_0xcf16('0x3a')][_0xcf16('0x4d')](_0x388099)[_0xcf16('0x1f')](function(_0x5bec8d){_0x1bad40[_0xcf16('0x4d')]=_0x5bec8d;if(_0x2ee512[_0xcf16('0x3d')][_0xcf16('0x4e')]){_0x258799[_0xcf16('0x4f')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x258799);})[_0xcf16('0x1f')](function(_0x1994a3){_0x1bad40[_0xcf16('0x50')]=_0x1994a3;return _0x1bad40;})['then'](respondWithFilteredResult(_0x1b1efd,_0x258799))[_0xcf16('0x51')](handleError(_0x1b1efd,null));};exports[_0xcf16('0x52')]=function(_0x2f389c,_0x40aaee){var _0x1d7369={'raw':!![],'where':{'id':_0x2f389c['params']['id']}},_0x544fb1={};_0x544fb1['model']=_[_0xcf16('0x3e')](db[_0xcf16('0x3a')][_0xcf16('0x53')]);_0x544fb1['query']=_[_0xcf16('0x3e')](_0x2f389c[_0xcf16('0x3d')]);_0x544fb1['filters']=_['intersection'](_0x544fb1[_0xcf16('0x3c')],_0x544fb1[_0xcf16('0x3d')]);_0x1d7369[_0xcf16('0x40')]=_[_0xcf16('0x41')](_0x544fb1['model'],qs[_0xcf16('0x42')](_0x2f389c[_0xcf16('0x3d')][_0xcf16('0x42')]));_0x1d7369[_0xcf16('0x40')]=_0x1d7369[_0xcf16('0x40')][_0xcf16('0x43')]?_0x1d7369['attributes']:_0x544fb1[_0xcf16('0x3c')];if(_0x2f389c['query']['includeAll']){_0x1d7369['include']=[{'all':!![]}];}_0x1d7369=_[_0xcf16('0x49')]({},_0x1d7369,_0x2f389c[_0xcf16('0x4c')]);return db[_0xcf16('0x3a')][_0xcf16('0x54')](_0x1d7369)[_0xcf16('0x1f')](handleEntityNotFound(_0x40aaee,null))['then'](respondWithResult(_0x40aaee,null))['catch'](handleError(_0x40aaee,null));};exports[_0xcf16('0x55')]=function(_0xb5410e,_0x58212b){return db[_0xcf16('0x3a')]['create'](_0xb5410e[_0xcf16('0x56')],{})[_0xcf16('0x1f')](respondWithResult(_0x58212b,0xc9))['catch'](handleError(_0x58212b,null));};exports['update']=function(_0x139bbb,_0x73b19e){if(_0x139bbb[_0xcf16('0x56')]['id']){delete _0x139bbb[_0xcf16('0x56')]['id'];}return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x139bbb['params']['id']}})[_0xcf16('0x1f')](handleEntityNotFound(_0x73b19e,null))[_0xcf16('0x1f')](saveUpdates(_0x139bbb[_0xcf16('0x56')],null))[_0xcf16('0x1f')](respondWithResult(_0x73b19e,null))[_0xcf16('0x51')](handleError(_0x73b19e,null));};exports[_0xcf16('0x34')]=function(_0x2a6e07,_0x11fbd4){return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x2a6e07[_0xcf16('0x57')]['id']}})['then'](handleEntityNotFound(_0x11fbd4,null))[_0xcf16('0x1f')](removeEntity(_0x11fbd4,null))['catch'](handleError(_0x11fbd4,null));};exports[_0xcf16('0x58')]=function(_0x1cda21,_0x1b2c05){return db['ChatMessage'][_0xcf16('0x58')]()[_0xcf16('0x1f')](respondWithResult(_0x1b2c05,null))[_0xcf16('0x51')](handleError(_0x1b2c05,null));};var interaction_log=require(_0xcf16('0x59'))('chat-interactions');exports['accept']=function(_0x5b49c8,_0x48b17d,_0x24f662){var _0x1bdd79={'agent':{},'channel':_0xcf16('0x5a')};if(_0x5b49c8[_0xcf16('0x56')]['id']){delete _0x5b49c8[_0xcf16('0x56')]['id'];}_0x5b49c8['body'][_0xcf16('0x5b')]=!![];_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5c')]=moment()['format'](_0xcf16('0x5d'));_0x5b49c8['body']['UserId']=_0x5b49c8[_0xcf16('0x56')]['UserId']||_0x5b49c8['user']['id'];_0x1bdd79['agent']['id']=_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')];return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x5b49c8[_0xcf16('0x57')]['id'],'UserId':null}})[_0xcf16('0x1f')](handleEntityNotFound(_0x48b17d,null))['then'](saveUpdates(_0x5b49c8[_0xcf16('0x56')],null))[_0xcf16('0x1f')](function(_0x17b3f0){if(_0x17b3f0){_0x1bdd79[_0xcf16('0x27')]=_0x17b3f0[_0xcf16('0x5f')]({'plain':!![]});return db[_0xcf16('0x60')][_0xcf16('0x54')]({'where':{'id':_0x17b3f0[_0xcf16('0x61')]}});}return null;})[_0xcf16('0x1f')](handleEntityNotFound(_0x48b17d,null))['then'](function(_0x2e121c){if(_0x2e121c){return _0x2e121c[_0xcf16('0x33')]({'UserId':_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')],'read1stAt':_[_0xcf16('0x62')](_0x2e121c['read1stAt'])?moment()[_0xcf16('0x63')](_0xcf16('0x5d')):undefined});}return null;})['then'](function(_0x471189){if(_0x471189){_0x1bdd79[_0xcf16('0x64')]=_0x471189[_0xcf16('0x5f')]({'plain':!![]});interaction_log[_0xcf16('0x20')](_0xcf16('0x65'),_0x5b49c8[_0xcf16('0x66')]['id'],_0x5b49c8['user']['name'],_0x5b49c8['user'][_0xcf16('0x67')],_0x1bdd79[_0xcf16('0x64')]['id'],_0x5b49c8[_0xcf16('0x56')]?JSON[_0xcf16('0x68')](_0x5b49c8[_0xcf16('0x56')]):_0xcf16('0x69'));return respondWithRpcPromise(_0xcf16('0x6a'),_0xcf16('0x6b'),_0x1bdd79);}return null;})['then'](function(_0x348059){var _0x13c944=_0xcf16('0x6c')+_0x348059[_0xcf16('0x27')][_0xcf16('0x6d')];return db['sequelize'][_0xcf16('0x3d')](_0x13c944,{'type':db[_0xcf16('0x6e')][_0xcf16('0x6f')][_0xcf16('0x70')],'raw':!![]})['then'](function(_0x38da8a){return _0x38da8a;});})[_0xcf16('0x1f')](function(_0x445245){if(_0x445245){_0x1bdd79[_0xcf16('0x27')]['contact']=_0x445245[0x0];if(!_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')])return;return db[_0xcf16('0x71')][_0xcf16('0x54')]({'where':{'id':_0x5b49c8[_0xcf16('0x56')][_0xcf16('0x5e')],'role':'agent'},'attributes':['id',_0xcf16('0x36'),_0xcf16('0x72'),_0xcf16('0x73'),_0xcf16('0x74')],'raw':!![]});}return null;})['then'](function(_0x3ba9e9){if(!_0x3ba9e9)return null;_0x1bdd79['message'][_0xcf16('0x75')]=_0x3ba9e9;return _0x1bdd79;})[_0xcf16('0x1f')](function(_0x342189){if(_0x342189){if(_0x5b49c8[_0xcf16('0x56')]['manual']){_0x1bdd79[_0xcf16('0x27')][_0xcf16('0x76')]=util['format'](_0xcf16('0x77'),_0x5b49c8['user']['name']);_0x1bdd79[_0xcf16('0x27')][_0xcf16('0x78')]=_0x1bdd79[_0xcf16('0x78')];_0x1bdd79['message'][_0xcf16('0x79')]=_0x1bdd79[_0xcf16('0x78')];_0x1bdd79[_0xcf16('0x27')]['event']=_0xcf16('0x7a');return respondWithRpcPromise('EventManager',_0xcf16('0x7b'),{'event':_0xcf16('0x7c'),'message':_[_0xcf16('0x49')](_0x1bdd79[_0xcf16('0x27')],JSON[_0xcf16('0x7d')](_0x1bdd79['interaction'][_0xcf16('0x7e')]))},client9002)[_0xcf16('0x1f')](function(){return _0x1bdd79;});}return _0x1bdd79;}return null;})['then'](respondWithResult(_0x48b17d,null))[_0xcf16('0x51')](handleError(_0x48b17d,null));};var interaction_log=require(_0xcf16('0x59'))('chat-interactions');exports[_0xcf16('0x31')]=function(_0x5c9df3,_0x19db1c,_0x2f8011){var _0xebdf55={'agent':{},'channel':'chat'};if(_0x5c9df3[_0xcf16('0x56')]['id']){delete _0x5c9df3[_0xcf16('0x56')]['id'];}_0x5c9df3['body'][_0xcf16('0x5e')]=_0x5c9df3['body'][_0xcf16('0x5e')]||_0x5c9df3[_0xcf16('0x66')]['id'];_0xebdf55[_0xcf16('0x75')]['id']=_0x5c9df3[_0xcf16('0x56')][_0xcf16('0x5e')];return db[_0xcf16('0x3a')][_0xcf16('0x54')]({'where':{'id':_0x5c9df3['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x19db1c,null))[_0xcf16('0x1f')](function(_0x51c1e8){if(_0x51c1e8){_0xebdf55[_0xcf16('0x27')]=_0x51c1e8[_0xcf16('0x5f')]({'plain':!![]});return db[_0xcf16('0x60')][_0xcf16('0x54')]({'where':{'id':_0x51c1e8['ChatInteractionId']}});}return null;})[_0xcf16('0x1f')](handleEntityNotFound(_0x19db1c,null))['then'](function(_0x17619d){if(_0x17619d){_0xebdf55['interaction']=_0x17619d[_0xcf16('0x5f')]({'plain':!![]});interaction_log[_0xcf16('0x20')](_0xcf16('0x7f'),_0x5c9df3[_0xcf16('0x66')]['id'],_0x5c9df3[_0xcf16('0x66')][_0xcf16('0x36')],_0x5c9df3['user'][_0xcf16('0x67')],_0xebdf55[_0xcf16('0x64')]['id'],_0x5c9df3[_0xcf16('0x56')]?JSON[_0xcf16('0x68')](_0x5c9df3[_0xcf16('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xcf16('0x80'),_0xebdf55);}return null;})[_0xcf16('0x1f')](function(_0x5a6074){var _0x80141d=_0xcf16('0x6c')+_0x5a6074[_0xcf16('0x27')][_0xcf16('0x6d')];return db[_0xcf16('0x81')]['query'](_0x80141d,{'type':db['Sequelize'][_0xcf16('0x6f')][_0xcf16('0x70')],'raw':!![]})[_0xcf16('0x1f')](function(_0x27a4e3){return _0x27a4e3;});})[_0xcf16('0x1f')](function(_0x41e10e){if(_0x41e10e){_0xebdf55['message'][_0xcf16('0x82')]=_0x41e10e[0x0];if(!_0x5c9df3[_0xcf16('0x56')]['UserId'])return;return db[_0xcf16('0x71')][_0xcf16('0x54')]({'where':{'id':_0x5c9df3['body'][_0xcf16('0x5e')],'role':'agent'},'attributes':['id',_0xcf16('0x36'),'fullname',_0xcf16('0x73'),_0xcf16('0x74')],'raw':!![]});}return null;})[_0xcf16('0x1f')](function(_0x2ef6ed){if(!_0x2ef6ed)return null;_0xebdf55[_0xcf16('0x27')][_0xcf16('0x75')]=_0x2ef6ed;return _0xebdf55;})[_0xcf16('0x1f')](function(_0x1810eb){if(_0x1810eb){_0x1810eb['message']['interface']=util[_0xcf16('0x63')](_0xcf16('0x77'),_0x5c9df3[_0xcf16('0x66')][_0xcf16('0x36')]);_0x1810eb['message'][_0xcf16('0x78')]=_0xebdf55[_0xcf16('0x78')];_0x1810eb[_0xcf16('0x27')][_0xcf16('0x79')]=_0xebdf55[_0xcf16('0x78')];_0x1810eb[_0xcf16('0x27')][_0xcf16('0x83')]=_0xcf16('0x31');respondWithRpcPromise(_0xcf16('0x7b'),_0xcf16('0x7b'),{'event':'rejectmessage','message':_[_0xcf16('0x49')](_0xebdf55[_0xcf16('0x27')],JSON[_0xcf16('0x7d')](_0xebdf55[_0xcf16('0x64')]['formData']))},client9002);return _0xebdf55;}return null;})[_0xcf16('0x1f')](respondWithResult(_0x19db1c,null))[_0xcf16('0x51')](handleError(_0x19db1c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c0c81eb..ff0a1f8 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 _0x0e9a=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','update','remove','emit'];(function(_0x2b8764,_0x3f6442){var _0x5010ee=function(_0x2cf0fe){while(--_0x2cf0fe){_0x2b8764['push'](_0x2b8764['shift']());}};_0x5010ee(++_0x3f6442);}(_0x0e9a,0x1c5));var _0xa0e9=function(_0x5d63aa,_0x3278fe){_0x5d63aa=_0x5d63aa-0x0;var _0x5b463f=_0x0e9a[_0x5d63aa];return _0x5b463f;};'use strict';var EventEmitter=require(_0xa0e9('0x0'));var ChatMessage=require(_0xa0e9('0x1'))['db'][_0xa0e9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0e9('0x3'),'afterDestroy':_0xa0e9('0x4')};function emitEvent(_0x4e837b){return function(_0x2b8a11,_0x4b1c3d,_0x392f6c){ChatMessageEvents[_0xa0e9('0x5')](_0x4e837b+':'+_0x2b8a11['id'],_0x2b8a11);ChatMessageEvents['emit'](_0x4e837b,_0x2b8a11);_0x392f6c(null);};}for(var e in events){if(events[_0xa0e9('0x6')](e)){var event=events[e];ChatMessage[_0xa0e9('0x7')](e,emitEvent(event));}}module[_0xa0e9('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x2248=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x15c530,_0x489b22){var _0x3bd24f=function(_0x164499){while(--_0x164499){_0x15c530['push'](_0x15c530['shift']());}};_0x3bd24f(++_0x489b22);}(_0x2248,0x1ac));var _0x8224=function(_0x1c5048,_0xd65dbb){_0x1c5048=_0x1c5048-0x0;var _0x5a77f2=_0x2248[_0x1c5048];return _0x5a77f2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8224('0x0'))['db'][_0x8224('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8224('0x2')](0x0);var events={'afterCreate':_0x8224('0x3'),'afterUpdate':_0x8224('0x4'),'afterDestroy':_0x8224('0x5')};function emitEvent(_0x2c0fb9){return function(_0x4fa6d4,_0x36d79f,_0x59488a){ChatMessageEvents[_0x8224('0x6')](_0x2c0fb9+':'+_0x4fa6d4['id'],_0x4fa6d4);ChatMessageEvents['emit'](_0x2c0fb9,_0x4fa6d4);_0x59488a(null);};}for(var e in events){if(events[_0x8224('0x7')](e)){var event=events[e];ChatMessage[_0x8224('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 008726f..8b7145c 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 _0xf5c0=['chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage'];(function(_0x31799d,_0x440446){var _0x4ea463=function(_0x39ab3e){while(--_0x39ab3e){_0x31799d['push'](_0x31799d['shift']());}};_0x4ea463(++_0x440446);}(_0xf5c0,0x71));var _0x0f5c=function(_0x17a057,_0x51ef19){_0x17a057=_0x17a057-0x0;var _0x5b34d2=_0xf5c0[_0x17a057];return _0x5b34d2;};'use strict';var _=require('lodash');var util=require(_0x0f5c('0x0'));var logger=require('../../config/logger')(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var BPromise=require(_0x0f5c('0x3'));var rp=require(_0x0f5c('0x4'));var fs=require('fs');var path=require(_0x0f5c('0x5'));var rimraf=require(_0x0f5c('0x6'));var config=require(_0x0f5c('0x7'));var attributes=require(_0x0f5c('0x8'));module[_0x0f5c('0x9')]=function(_0x1c69da,_0x2752d2){return _0x1c69da['define'](_0x0f5c('0xa'),attributes,{'tableName':_0x0f5c('0xb'),'paranoid':![],'indexes':[{'name':_0x0f5c('0xc'),'fields':['body'],'type':_0x0f5c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e3edc,_0x569568,_0x385542){var _0x2beb54=_0x1c69da[_0x0f5c('0xe')];var _0x36480d=_0x3e3edc[_0x0f5c('0xf')]({'plain':!![]});if(_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()==='in'||_0x36480d[_0x0f5c('0x10')][_0x0f5c('0x11')]()===_0x0f5c('0x12')&&!_0x36480d[_0x0f5c('0x13')]&&!_[_0x0f5c('0x14')](_0x36480d[_0x0f5c('0x15')])){_0x2beb54['ChatInteraction'][_0x0f5c('0x16')]({'where':{'id':_0x36480d[_0x0f5c('0x17')]}})[_0x0f5c('0x18')](function(_0x2602c1){if(_0x2602c1){_0x2602c1[_0x0f5c('0x19')]({'lastMsgAt':_0x36480d[_0x0f5c('0x1a')],'lastMsgDirection':_0x36480d[_0x0f5c('0x10')]['toLowerCase']()});}})[_0x0f5c('0x1b')](function(_0x7a90cd){console[_0x0f5c('0x1c')](_0x7a90cd);});}_0x385542();}},'charset':_0x0f5c('0x1d'),'collate':_0x0f5c('0x1e')});}; \ No newline at end of file +var _0xd8f6=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body'];(function(_0x57d71f,_0x598a0e){var _0x2d1d26=function(_0x18f209){while(--_0x18f209){_0x57d71f['push'](_0x57d71f['shift']());}};_0x2d1d26(++_0x598a0e);}(_0xd8f6,0xf0));var _0x6d8f=function(_0x3d06cb,_0x1491e8){_0x3d06cb=_0x3d06cb-0x0;var _0x26fcbb=_0xd8f6[_0x3d06cb];return _0x26fcbb;};'use strict';var _=require('lodash');var util=require(_0x6d8f('0x0'));var logger=require(_0x6d8f('0x1'))(_0x6d8f('0x2'));var moment=require(_0x6d8f('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d8f('0x4'));var fs=require('fs');var path=require(_0x6d8f('0x5'));var rimraf=require(_0x6d8f('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d8f('0x7'));module[_0x6d8f('0x8')]=function(_0x226398,_0xb94769){return _0x226398['define'](_0x6d8f('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x6d8f('0xa'),'fields':[_0x6d8f('0xb')],'type':_0x6d8f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46de14,_0x331e84,_0x1253cc){var _0x5823d8=_0x226398[_0x6d8f('0xd')];var _0x4a4a87=_0x46de14[_0x6d8f('0xe')]({'plain':!![]});if(_0x4a4a87[_0x6d8f('0xf')][_0x6d8f('0x10')]()==='in'||_0x4a4a87['direction']['toLowerCase']()===_0x6d8f('0x11')&&!_0x4a4a87[_0x6d8f('0x12')]&&!_['isNil'](_0x4a4a87[_0x6d8f('0x13')])){_0x5823d8[_0x6d8f('0x14')][_0x6d8f('0x15')]({'where':{'id':_0x4a4a87[_0x6d8f('0x16')]}})[_0x6d8f('0x17')](function(_0xa5a49b){if(_0xa5a49b){_0xa5a49b[_0x6d8f('0x18')]({'lastMsgAt':_0x4a4a87[_0x6d8f('0x19')],'lastMsgDirection':_0x4a4a87['direction'][_0x6d8f('0x10')]()});}})[_0x6d8f('0x1a')](function(_0x2bb325){console[_0x6d8f('0x1b')](_0x2bb325);});}_0x1253cc();}},'charset':'utf8mb4','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 5f12509..3cdac32 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 _0xf82c=['message','info','result','catch','CreateChatMessage','create','body','options','raw','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x43bf86,_0x1f4f3e){var _0x223364=function(_0x210204){while(--_0x210204){_0x43bf86['push'](_0x43bf86['shift']());}};_0x223364(++_0x1f4f3e);}(_0xf82c,0x19c));var _0xcf82=function(_0x4e6bfd,_0x38102c){_0x4e6bfd=_0x4e6bfd-0x0;var _0x356bea=_0xf82c[_0x4e6bfd];return _0x356bea;};'use strict';var _=require('lodash');var util=require(_0xcf82('0x0'));var moment=require(_0xcf82('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf82('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf82('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf82('0x4'))(_0xcf82('0x5'));var config=require(_0xcf82('0x6'));var jayson=require(_0xcf82('0x7'));var client=jayson['client'][_0xcf82('0x8')]({'port':0x232a});config[_0xcf82('0x9')]=_[_0xcf82('0xa')](config[_0xcf82('0x9')],{'host':_0xcf82('0xb'),'port':0x18eb});var socket=require(_0xcf82('0xc'))(new Redis(config[_0xcf82('0x9')]));require(_0xcf82('0xd'))[_0xcf82('0xe')](socket);function respondWithRpcPromise(_0x5e29b4,_0x4fb437,_0x42b68f){return new BPromise(function(_0x85b5e,_0x3c129e){return client[_0xcf82('0xf')](_0x5e29b4,_0x42b68f)[_0xcf82('0x10')](function(_0x547ea7){logger['info'](_0xcf82('0x11'),_0x4fb437,_0xcf82('0x12'));logger['debug'](_0xcf82('0x13'),_0x4fb437,_0xcf82('0x12'),JSON['stringify'](_0x547ea7));if(_0x547ea7['error']){if(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x15')]===0x1f4){logger[_0xcf82('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0x547ea7['error'][_0xcf82('0x16')]);return _0x3c129e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}logger['error'](_0xcf82('0x11'),_0x4fb437,_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);return _0x85b5e(_0x547ea7[_0xcf82('0x14')][_0xcf82('0x16')]);}else{logger[_0xcf82('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4fb437,_0xcf82('0x12'));_0x85b5e(_0x547ea7[_0xcf82('0x18')][_0xcf82('0x16')]);}})[_0xcf82('0x19')](function(_0x37e4a6){logger[_0xcf82('0x14')](_0xcf82('0x11'),_0x4fb437,_0x37e4a6);_0x3c129e(_0x37e4a6);});});}exports[_0xcf82('0x1a')]=function(_0x5a4288){var _0x1fd496=this;return new Promise(function(_0x3d9c37,_0x5c54c9){return db['ChatMessage'][_0xcf82('0x1b')](_0x5a4288[_0xcf82('0x1c')],{'raw':_0x5a4288[_0xcf82('0x1d')]?_0x5a4288[_0xcf82('0x1d')][_0xcf82('0x1e')]===undefined?!![]:![]:!![]})[_0xcf82('0x10')](function(_0x2adb88){logger[_0xcf82('0x17')]('CreateChatMessage',_0x5a4288);logger['debug'](_0xcf82('0x1a'),_0x5a4288,JSON['stringify'](_0x2adb88));_0x3d9c37(_0x2adb88);})[_0xcf82('0x19')](function(_0x57f201){logger[_0xcf82('0x14')](_0xcf82('0x1a'),_0x57f201[_0xcf82('0x16')],_0x5a4288);_0x5c54c9(_0x1fd496[_0xcf82('0x14')](0x1f4,_0x57f201[_0xcf82('0x16')]));});});}; \ No newline at end of file +var _0x89ca=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','body','options','CreateChatMessage','lodash','bluebird','randomstring','ioredis'];(function(_0x51b8f1,_0x3c598a){var _0x52ef12=function(_0x518531){while(--_0x518531){_0x51b8f1['push'](_0x51b8f1['shift']());}};_0x52ef12(++_0x3c598a);}(_0x89ca,0xe3));var _0xa89c=function(_0x269fca,_0x4bac77){_0x269fca=_0x269fca-0x0;var _0x1893c6=_0x89ca[_0x269fca];return _0x1893c6;};'use strict';var _=require(_0xa89c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa89c('0x1'));var rs=require(_0xa89c('0x2'));var fs=require('fs');var Redis=require(_0xa89c('0x3'));var db=require(_0xa89c('0x4'))['db'];var utils=require(_0xa89c('0x5'));var logger=require(_0xa89c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa89c('0x7'));var client=jayson[_0xa89c('0x8')][_0xa89c('0x9')]({'port':0x232a});config['redis']=_[_0xa89c('0xa')](config[_0xa89c('0xb')],{'host':_0xa89c('0xc'),'port':0x18eb});var socket=require(_0xa89c('0xd'))(new Redis(config[_0xa89c('0xb')]));require(_0xa89c('0xe'))[_0xa89c('0xf')](socket);function respondWithRpcPromise(_0x5b8db4,_0x591fdb,_0x20f28a){return new BPromise(function(_0x2ce060,_0x3e6f0b){return client[_0xa89c('0x10')](_0x5b8db4,_0x20f28a)[_0xa89c('0x11')](function(_0x3e1c5b){logger[_0xa89c('0x12')](_0xa89c('0x13'),_0x591fdb,_0xa89c('0x14'));logger[_0xa89c('0x15')](_0xa89c('0x16'),_0x591fdb,_0xa89c('0x14'),JSON[_0xa89c('0x17')](_0x3e1c5b));if(_0x3e1c5b[_0xa89c('0x18')]){if(_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x19')]===0x1f4){logger[_0xa89c('0x18')]('ChatMessage,\x20%s,\x20%s',_0x591fdb,_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);return _0x3e6f0b(_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);}logger[_0xa89c('0x18')](_0xa89c('0x13'),_0x591fdb,_0x3e1c5b[_0xa89c('0x18')][_0xa89c('0x1a')]);return _0x2ce060(_0x3e1c5b[_0xa89c('0x18')]['message']);}else{logger[_0xa89c('0x12')](_0xa89c('0x13'),_0x591fdb,'request\x20sent');_0x2ce060(_0x3e1c5b[_0xa89c('0x1b')][_0xa89c('0x1a')]);}})[_0xa89c('0x1c')](function(_0xab5ca1){logger['error'](_0xa89c('0x13'),_0x591fdb,_0xab5ca1);_0x3e6f0b(_0xab5ca1);});});}exports['CreateChatMessage']=function(_0x8075fe){var _0x386585=this;return new Promise(function(_0x2cd3e5,_0x1c18a1){return db[_0xa89c('0x1d')]['create'](_0x8075fe[_0xa89c('0x1e')],{'raw':_0x8075fe[_0xa89c('0x1f')]?_0x8075fe[_0xa89c('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xa89c('0x11')](function(_0x35f041){logger[_0xa89c('0x12')]('CreateChatMessage',_0x8075fe);logger['debug'](_0xa89c('0x20'),_0x8075fe,JSON[_0xa89c('0x17')](_0x35f041));_0x2cd3e5(_0x35f041);})[_0xa89c('0x1c')](function(_0x411267){logger[_0xa89c('0x18')](_0xa89c('0x20'),_0x411267[_0xa89c('0x1a')],_0x8075fe);_0x1c18a1(_0x386585[_0xa89c('0x18')](0x1f4,_0x411267[_0xa89c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index cf55f1e..c6519d3 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 _0x7c1f=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3c253e,_0x98d7d2){var _0x2438d9=function(_0x3a6ad7){while(--_0x3a6ad7){_0x3c253e['push'](_0x3c253e['shift']());}};_0x2438d9(++_0x98d7d2);}(_0x7c1f,0x194));var _0xf7c1=function(_0x233d1f,_0x421885){_0x233d1f=_0x233d1f-0x0;var _0x43d3c9=_0x7c1f[_0x233d1f];return _0x43d3c9;};'use strict';var ChatMessageEvents=require(_0xf7c1('0x0'));var events=[_0xf7c1('0x1'),_0xf7c1('0x2'),_0xf7c1('0x3')];function createListener(_0x3ca7b6,_0x568116){return function(_0x1e3254){_0x568116[_0xf7c1('0x4')](_0x3ca7b6,_0x1e3254);};}function removeListener(_0x18f5a9,_0x485d8d){return function(){ChatMessageEvents[_0xf7c1('0x5')](_0x18f5a9,_0x485d8d);};}exports[_0xf7c1('0x6')]=function(_0x3c21cf){for(var _0x136e1e=0x0,_0x5423bf=events[_0xf7c1('0x7')];_0x136e1e<_0x5423bf;_0x136e1e++){var _0x1a342b=events[_0x136e1e];var _0x329050=createListener(_0xf7c1('0x8')+_0x1a342b,_0x3c21cf);ChatMessageEvents['on'](_0x1a342b,_0x329050);}}; \ No newline at end of file +var _0x975f=['chatMessage:','./chatMessage.events','save','emit','removeListener','length'];(function(_0x44e960,_0x19be2a){var _0xc05f0=function(_0x547fe4){while(--_0x547fe4){_0x44e960['push'](_0x44e960['shift']());}};_0xc05f0(++_0x19be2a);}(_0x975f,0x109));var _0xf975=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x975f[_0x1fc84d];return _0x2658fa;};'use strict';var ChatMessageEvents=require(_0xf975('0x0'));var events=[_0xf975('0x1'),'remove','update'];function createListener(_0x3d087b,_0x274f21){return function(_0x556f63){_0x274f21[_0xf975('0x2')](_0x3d087b,_0x556f63);};}function removeListener(_0x2d047c,_0x26c58b){return function(){ChatMessageEvents[_0xf975('0x3')](_0x2d047c,_0x26c58b);};}exports['register']=function(_0x356f71){for(var _0x5a9aca=0x0,_0x36f6cf=events[_0xf975('0x4')];_0x5a9aca<_0x36f6cf;_0x5a9aca++){var _0x51a37c=events[_0x5a9aca];var _0x194d30=createListener(_0xf975('0x5')+_0x51a37c,_0x356f71);ChatMessageEvents['on'](_0x51a37c,_0x194d30);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index dc51526..110c9a1 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 _0xef40=['chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xef40,0xc0));var _0x0ef4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xef40[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x0ef4('0x0'));var util=require('util');var path=require(_0x0ef4('0x1'));var timeout=require(_0x0ef4('0x2'));var express=require(_0x0ef4('0x3'));var router=express[_0x0ef4('0x4')]();var fs_extra=require(_0x0ef4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ef4('0x6'));var controller=require(_0x0ef4('0x7'));router[_0x0ef4('0x8')]('/',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xa')]);router[_0x0ef4('0x8')]('/describe',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xb')]);router[_0x0ef4('0x8')](_0x0ef4('0xc'),auth[_0x0ef4('0x9')](),controller[_0x0ef4('0xd')]);router[_0x0ef4('0xe')]('/',auth[_0x0ef4('0x9')](),interaction[_0x0ef4('0xf')](_0x0ef4('0x10'),_0x0ef4('0x11')),controller[_0x0ef4('0x12')]);router[_0x0ef4('0x13')]('/:id',controller[_0x0ef4('0x14')]);router['put'](_0x0ef4('0x15'),auth[_0x0ef4('0x9')](),controller['accept']);router[_0x0ef4('0x13')]('/:id/reject',auth[_0x0ef4('0x9')](),controller[_0x0ef4('0x16')]);router[_0x0ef4('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0ef4('0x18')]);module[_0x0ef4('0x19')]=router; \ No newline at end of file +var _0x7589=['chat','create','put','update','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked'];(function(_0x4baf6d,_0x52f43e){var _0x233caf=function(_0x4cf125){while(--_0x4cf125){_0x4baf6d['push'](_0x4baf6d['shift']());}};_0x233caf(++_0x52f43e);}(_0x7589,0x10d));var _0x9758=function(_0x56a631,_0x171ebd){_0x56a631=_0x56a631-0x0;var _0x9462fb=_0x7589[_0x56a631];return _0x9462fb;};'use strict';var multer=require(_0x9758('0x0'));var util=require('util');var path=require(_0x9758('0x1'));var timeout=require('connect-timeout');var express=require(_0x9758('0x2'));var router=express[_0x9758('0x3')]();var fs_extra=require(_0x9758('0x4'));var auth=require(_0x9758('0x5'));var interaction=require(_0x9758('0x6'));var config=require('../../config/environment');var controller=require(_0x9758('0x7'));router[_0x9758('0x8')]('/',auth[_0x9758('0x9')](),controller[_0x9758('0xa')]);router['get'](_0x9758('0xb'),auth[_0x9758('0x9')](),controller[_0x9758('0xc')]);router[_0x9758('0x8')](_0x9758('0xd'),auth[_0x9758('0x9')](),controller[_0x9758('0xe')]);router[_0x9758('0xf')]('/',auth[_0x9758('0x9')](),interaction[_0x9758('0x10')](_0x9758('0x11'),'chatmessage:create'),controller[_0x9758('0x12')]);router[_0x9758('0x13')]('/:id',controller[_0x9758('0x14')]);router[_0x9758('0x13')]('/:id/accept',auth[_0x9758('0x9')](),controller['accept']);router[_0x9758('0x13')](_0x9758('0x15'),auth[_0x9758('0x9')](),controller[_0x9758('0x16')]);router[_0x9758('0x17')](_0x9758('0xd'),auth[_0x9758('0x9')](),controller[_0x9758('0x18')]);module[_0x9758('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b2fe331..b7c3b6c 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 _0x2032=['medium','exports','TEXT'];(function(_0x2d3285,_0x62b9b6){var _0x1b0c7e=function(_0x2adbe4){while(--_0x2adbe4){_0x2d3285['push'](_0x2d3285['shift']());}};_0x1b0c7e(++_0x62b9b6);}(_0x2032,0xd9));var _0x2203=function(_0x376438,_0x2d62c9){_0x376438=_0x376438-0x0;var _0x2b3bfa=_0x2032[_0x376438];return _0x2b3bfa;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x366d6b,_0x28d23c){var _0x22d530=function(_0x5681b2){while(--_0x5681b2){_0x366d6b['push'](_0x366d6b['shift']());}};_0x22d530(++_0x28d23c);}(_0xdb28,0x106));var _0x8db2=function(_0x9bd6a4,_0x4f9ab6){_0x9bd6a4=_0x9bd6a4-0x0;var _0x319e5e=_0xdb28[_0x9bd6a4];return _0x319e5e;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 84c04a4..a7235ab 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d39ea,_0x107836){_0x5d39ea=_0x5d39ea-0x0;var _0x4a6f35=_0x7a54[_0x5d39ea];return _0x4a6f35;};'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(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x4e795d,_0x44a90b){_0x4e795d=_0x4e795d-0x0;var _0x22e79b=_0x7a54[_0x4e795d];return _0x22e79b;};'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 5994aa6..e84504b 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 _0x39f8=['hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2751d8,_0x26bbcb){var _0x2fce41=function(_0x2cb549){while(--_0x2cb549){_0x2751d8['push'](_0x2751d8['shift']());}};_0x2fce41(++_0x26bbcb);}(_0x39f8,0x161));var _0x839f=function(_0x44b433,_0x5498bd){_0x44b433=_0x44b433-0x0;var _0x2e7362=_0x39f8[_0x44b433];return _0x2e7362;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x839f('0x0'))['db'][_0x839f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x839f('0x2')](0x0);var events={'afterCreate':_0x839f('0x3'),'afterUpdate':'update','afterDestroy':_0x839f('0x4')};function emitEvent(_0x2e43ac){return function(_0x50817c,_0x3cb754,_0x4d5611){ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac+':'+_0x50817c['id'],_0x50817c);ChatOfflineMessageEvents[_0x839f('0x5')](_0x2e43ac,_0x50817c);_0x4d5611(null);};}for(var e in events){if(events[_0x839f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x839f('0x7')](e,emitEvent(event));}}module[_0x839f('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xbd15=['ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xe5d54f,_0x143d93){var _0x2a74bf=function(_0x3e56cb){while(--_0x3e56cb){_0xe5d54f['push'](_0xe5d54f['shift']());}};_0x2a74bf(++_0x143d93);}(_0xbd15,0x102));var _0x5bd1=function(_0x1d0b80,_0x41fc24){_0x1d0b80=_0x1d0b80-0x0;var _0x35d642=_0xbd15[_0x1d0b80];return _0x35d642;};'use strict';var EventEmitter=require(_0x5bd1('0x0'));var ChatOfflineMessage=require(_0x5bd1('0x1'))['db'][_0x5bd1('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5bd1('0x3')](0x0);var events={'afterCreate':_0x5bd1('0x4'),'afterUpdate':_0x5bd1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b6b0d){return function(_0xa3f6d5,_0x148d1c,_0x304c2c){ChatOfflineMessageEvents[_0x5bd1('0x6')](_0x5b6b0d+':'+_0xa3f6d5['id'],_0xa3f6d5);ChatOfflineMessageEvents[_0x5bd1('0x6')](_0x5b6b0d,_0xa3f6d5);_0x304c2c(null);};}for(var e in events){if(events[_0x5bd1('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x5bd1('0x8')](e,emitEvent(event));}}module[_0x5bd1('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3fd15ea..2e3d2d6 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 _0x17b8=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x17b8,0x179));var _0x817b=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x17b8[_0x2be240];return _0x123543;};'use strict';var attributes=require(_0x817b('0x0'));module[_0x817b('0x1')]=function(_0x7d8c53){return _0x7d8c53[_0x817b('0x2')](_0x817b('0x3'),attributes,{'tableName':_0x817b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x817b('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x626f=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x2a83bd,_0x4e3265){var _0x52d109=function(_0x236b81){while(--_0x236b81){_0x2a83bd['push'](_0x2a83bd['shift']());}};_0x52d109(++_0x4e3265);}(_0x626f,0x11e));var _0xf626=function(_0x41cb6d,_0x151790){_0x41cb6d=_0x41cb6d-0x0;var _0x37b11f=_0x626f[_0x41cb6d];return _0x37b11f;};'use strict';var attributes=require(_0xf626('0x0'));module[_0xf626('0x1')]=function(_0x41fa33){return _0x41fa33[_0xf626('0x2')](_0xf626('0x3'),attributes,{'tableName':_0xf626('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf626('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index d3a3f39..b38e0ba 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 _0x73f9=['../../config/environment','http','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xf4dfa4,_0x2f9143){var _0x3a5ac1=function(_0x4a1671){while(--_0x4a1671){_0xf4dfa4['push'](_0xf4dfa4['shift']());}};_0x3a5ac1(++_0x2f9143);}(_0x73f9,0x1c6));var _0x973f=function(_0x45c5c5,_0x31fb9b){_0x45c5c5=_0x45c5c5-0x0;var _0x25a41e=_0x73f9[_0x45c5c5];return _0x25a41e;};'use strict';var _=require('lodash');var util=require(_0x973f('0x0'));var moment=require(_0x973f('0x1'));var BPromise=require(_0x973f('0x2'));var rs=require(_0x973f('0x3'));var fs=require('fs');var Redis=require(_0x973f('0x4'));var db=require(_0x973f('0x5'))['db'];var utils=require(_0x973f('0x6'));var logger=require('../../config/logger')(_0x973f('0x7'));var config=require(_0x973f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x973f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f09c1,_0x12b109,_0x48feb6){return new BPromise(function(_0x5cd408,_0x470a73){return client[_0x973f('0xa')](_0x4f09c1,_0x48feb6)['then'](function(_0x3c1d59){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));logger[_0x973f('0xc')](_0x973f('0xd'),_0x12b109,_0x973f('0xb'),JSON[_0x973f('0xe')](_0x3c1d59));if(_0x3c1d59[_0x973f('0xf')]){if(_0x3c1d59[_0x973f('0xf')][_0x973f('0x10')]===0x1f4){logger[_0x973f('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x470a73(_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);}logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x3c1d59[_0x973f('0xf')][_0x973f('0x11')]);return _0x5cd408(_0x3c1d59[_0x973f('0xf')]['message']);}else{logger[_0x973f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x12b109,_0x973f('0xb'));_0x5cd408(_0x3c1d59[_0x973f('0x14')]['message']);}})[_0x973f('0x15')](function(_0x2a4bb6){logger[_0x973f('0xf')](_0x973f('0x12'),_0x12b109,_0x2a4bb6);_0x470a73(_0x2a4bb6);});});} \ No newline at end of file +var _0x5139=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x5139,0x8c));var _0x9513=function(_0x4d9ddb,_0x5041fe){_0x4d9ddb=_0x4d9ddb-0x0;var _0x566f23=_0x5139[_0x4d9ddb];return _0x566f23;};'use strict';var _=require(_0x9513('0x0'));var util=require(_0x9513('0x1'));var moment=require('moment');var BPromise=require(_0x9513('0x2'));var rs=require(_0x9513('0x3'));var fs=require('fs');var Redis=require(_0x9513('0x4'));var db=require(_0x9513('0x5'))['db'];var utils=require(_0x9513('0x6'));var logger=require(_0x9513('0x7'))(_0x9513('0x8'));var config=require('../../config/environment');var jayson=require(_0x9513('0x9'));var client=jayson[_0x9513('0xa')][_0x9513('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2385d8,_0x57c610,_0x45d209){return new BPromise(function(_0x1ce372,_0x120038){return client[_0x9513('0xc')](_0x2385d8,_0x45d209)[_0x9513('0xd')](function(_0x26f76c){logger[_0x9513('0xe')](_0x9513('0xf'),_0x57c610,'request\x20sent');logger[_0x9513('0x10')](_0x9513('0x11'),_0x57c610,_0x9513('0x12'),JSON[_0x9513('0x13')](_0x26f76c));if(_0x26f76c[_0x9513('0x14')]){if(_0x26f76c[_0x9513('0x14')]['code']===0x1f4){logger[_0x9513('0x14')](_0x9513('0xf'),_0x57c610,_0x26f76c[_0x9513('0x14')]['message']);return _0x120038(_0x26f76c['error']['message']);}logger[_0x9513('0x14')](_0x9513('0xf'),_0x57c610,_0x26f76c[_0x9513('0x14')][_0x9513('0x15')]);return _0x1ce372(_0x26f76c[_0x9513('0x14')][_0x9513('0x15')]);}else{logger['info'](_0x9513('0xf'),_0x57c610,_0x9513('0x12'));_0x1ce372(_0x26f76c[_0x9513('0x16')][_0x9513('0x15')]);}})['catch'](function(_0x4fbd9e){logger[_0x9513('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x57c610,_0x4fbd9e);_0x120038(_0x4fbd9e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index f7f4e56..8fc4af4 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 _0xc3a3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x56c1c6,_0x3fb809){var _0x5674a7=function(_0x40232f){while(--_0x40232f){_0x56c1c6['push'](_0x56c1c6['shift']());}};_0x5674a7(++_0x3fb809);}(_0xc3a3,0x75));var _0x3c3a=function(_0x1e2fd2,_0x44bde1){_0x1e2fd2=_0x1e2fd2-0x0;var _0x3872c6=_0xc3a3[_0x1e2fd2];return _0x3872c6;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require(_0x3c3a('0x2'));var timeout=require(_0x3c3a('0x3'));var express=require(_0x3c3a('0x4'));var router=express[_0x3c3a('0x5')]();var fs_extra=require(_0x3c3a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3c3a('0x7'));var config=require(_0x3c3a('0x8'));var controller=require(_0x3c3a('0x9'));router[_0x3c3a('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0xb')]);router['get'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0xe')]);router[_0x3c3a('0xa')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller['show']);router[_0x3c3a('0x10')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x11')]);router[_0x3c3a('0x12')](_0x3c3a('0xf'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x13')]);router[_0x3c3a('0x14')]('/:id',auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x15')]);module[_0x3c3a('0x16')]=router; \ No newline at end of file +var _0xee1d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1a813f,_0x134f96){var _0x2415d7=function(_0x1aeba2){while(--_0x1aeba2){_0x1a813f['push'](_0x1a813f['shift']());}};_0x2415d7(++_0x134f96);}(_0xee1d,0x14e));var _0xdee1=function(_0x41d4e2,_0x542e81){_0x41d4e2=_0x41d4e2-0x0;var _0x53ac2b=_0xee1d[_0x41d4e2];return _0x53ac2b;};'use strict';var multer=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var path=require(_0xdee1('0x2'));var timeout=require(_0xdee1('0x3'));var express=require('express');var router=express[_0xdee1('0x4')]();var fs_extra=require(_0xdee1('0x5'));var auth=require(_0xdee1('0x6'));var interaction=require(_0xdee1('0x7'));var config=require('../../config/environment');var controller=require(_0xdee1('0x8'));router[_0xdee1('0x9')]('/',auth[_0xdee1('0xa')](),controller['index']);router[_0xdee1('0x9')](_0xdee1('0xb'),auth[_0xdee1('0xa')](),controller[_0xdee1('0xc')]);router['get'](_0xdee1('0xd'),auth[_0xdee1('0xa')](),controller['show']);router[_0xdee1('0xe')]('/',auth['isAuthenticated'](),controller[_0xdee1('0xf')]);router[_0xdee1('0x10')](_0xdee1('0xd'),auth[_0xdee1('0xa')](),controller[_0xdee1('0x11')]);router[_0xdee1('0x12')]('/:id',auth[_0xdee1('0xa')](),controller[_0xdee1('0x13')]);module[_0xdee1('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1282354..512298b 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 _0x5d84=['STRING','sequelize','exports','ENUM','mouseOver'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x5d84,0x18c));var _0x45d8=function(_0x39b07f,_0x4ef1dd){_0x39b07f=_0x39b07f-0x0;var _0xe5ae78=_0x5d84[_0x39b07f];return _0xe5ae78;};'use strict';var Sequelize=require(_0x45d8('0x0'));module[_0x45d8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45d8('0x2')](_0x45d8('0x3'),'timeout'),'defaultValue':_0x45d8('0x3')},'selector':{'type':Sequelize[_0x45d8('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa367=['STRING','mouseOver','sequelize','exports'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xa367,0x17e));var _0x7a36=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xa367[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x7a36('0x0'));module[_0x7a36('0x1')]={'name':{'type':Sequelize[_0x7a36('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7a36('0x3'),'timeout'),'defaultValue':_0x7a36('0x3')},'selector':{'type':Sequelize[_0x7a36('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 011587b..ad3e1f6 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 _0x98a7=['undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset'];(function(_0x1b656b,_0x35013f){var _0xabcce7=function(_0x43ddc7){while(--_0x43ddc7){_0x1b656b['push'](_0x1b656b['shift']());}};_0xabcce7(++_0x35013f);}(_0x98a7,0x9e));var _0x798a=function(_0x149d1b,_0xff8b26){_0x149d1b=_0x149d1b-0x0;var _0x5717af=_0x98a7[_0x149d1b];return _0x5717af;};'use strict';var emlformat=require(_0x798a('0x0'));var rimraf=require(_0x798a('0x1'));var zipdir=require(_0x798a('0x2'));var jsonpatch=require(_0x798a('0x3'));var rp=require(_0x798a('0x4'));var moment=require(_0x798a('0x5'));var BPromise=require(_0x798a('0x6'));var Mustache=require('mustache');var util=require(_0x798a('0x7'));var path=require(_0x798a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x798a('0x9'));var fs=require('fs');var fs_extra=require(_0x798a('0xa'));var _=require(_0x798a('0xb'));var squel=require(_0x798a('0xc'));var crypto=require(_0x798a('0xd'));var jsforce=require(_0x798a('0xe'));var deskjs=require(_0x798a('0xf'));var toCsv=require(_0x798a('0x10'));var querystring=require('querystring');var Papa=require(_0x798a('0x11'));var Redis=require(_0x798a('0x12'));var authService=require(_0x798a('0x13'));var qs=require(_0x798a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x798a('0x15'));var logger=require(_0x798a('0x16'))(_0x798a('0x17'));var utils=require(_0x798a('0x18'));var config=require(_0x798a('0x19'));var licenseUtil=require(_0x798a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261b1f,_0x526bd0){_0x526bd0=_0x526bd0||0xcc;return function(_0x223f87){if(_0x223f87){return _0x261b1f[_0x798a('0x1b')](_0x526bd0);}return _0x261b1f['status'](_0x526bd0)[_0x798a('0x1c')]();};}function respondWithResult(_0x3f96f6,_0x5b60ba){_0x5b60ba=_0x5b60ba||0xc8;return function(_0x343764){if(_0x343764){return _0x3f96f6['status'](_0x5b60ba)[_0x798a('0x1d')](_0x343764);}};}function respondWithFilteredResult(_0x1746d2,_0x34bfdb){return function(_0x1f5156){if(_0x1f5156){var _0x560366=typeof _0x34bfdb[_0x798a('0x1e')]===_0x798a('0x1f')&&typeof _0x34bfdb['limit']===_0x798a('0x1f');var _0x2529c9=_0x1f5156[_0x798a('0x20')];var _0x14ddc6=_0x560366?0x0:_0x34bfdb[_0x798a('0x1e')];var _0x11881d=_0x560366?_0x1f5156[_0x798a('0x20')]:_0x34bfdb[_0x798a('0x1e')]+_0x34bfdb[_0x798a('0x21')];var _0x4610f0;if(_0x11881d>=_0x2529c9){_0x11881d=_0x2529c9;_0x4610f0=0xc8;}else{_0x4610f0=0xce;}_0x1746d2[_0x798a('0x22')](_0x4610f0);return _0x1746d2['set'](_0x798a('0x23'),_0x14ddc6+'-'+_0x11881d+'/'+_0x2529c9)[_0x798a('0x1d')](_0x1f5156);}return null;};}function patchUpdates(_0x145295){return function(_0x4715e7){try{jsonpatch[_0x798a('0x24')](_0x4715e7,_0x145295,!![]);}catch(_0xfe15ae){return BPromise[_0x798a('0x25')](_0xfe15ae);}return _0x4715e7[_0x798a('0x26')]();};}function saveUpdates(_0x23e327,_0x2b103c){return function(_0x4c6e5e){if(_0x4c6e5e){return _0x4c6e5e['update'](_0x23e327)[_0x798a('0x27')](function(_0xcaf0df){return _0xcaf0df;});}return null;};}function removeEntity(_0x2bdfd7,_0x54d725){return function(_0x1c08ac){if(_0x1c08ac){return _0x1c08ac[_0x798a('0x28')]()[_0x798a('0x27')](function(){_0x2bdfd7['status'](0xcc)[_0x798a('0x1c')]();});}};}function handleEntityNotFound(_0x55460c,_0x56715e){return function(_0x294475){if(!_0x294475){_0x55460c[_0x798a('0x1b')](0x194);}return _0x294475;};}function handleError(_0x574571,_0x6b3a1d){_0x6b3a1d=_0x6b3a1d||0x1f4;return function(_0x145916){logger[_0x798a('0x29')](_0x145916[_0x798a('0x2a')]);if(_0x145916['name']){delete _0x145916[_0x798a('0x2b')];}_0x574571[_0x798a('0x22')](_0x6b3a1d)[_0x798a('0x2c')](_0x145916);};}exports[_0x798a('0x2d')]=function(_0x5ca780,_0x1f5a18){var _0x4674f6={'raw':!![],'where':{'id':_0x5ca780[_0x798a('0x2e')]['id']}},_0x2203ed={};_0x2203ed[_0x798a('0x2f')]=_[_0x798a('0x30')](db[_0x798a('0x31')]['rawAttributes']);_0x2203ed[_0x798a('0x32')]=_[_0x798a('0x30')](_0x5ca780[_0x798a('0x32')]);_0x2203ed['filters']=_[_0x798a('0x33')](_0x2203ed[_0x798a('0x2f')],_0x2203ed['query']);_0x4674f6['attributes']=_[_0x798a('0x33')](_0x2203ed['model'],qs['fields'](_0x5ca780[_0x798a('0x32')][_0x798a('0x34')]));_0x4674f6['attributes']=_0x4674f6[_0x798a('0x35')][_0x798a('0x36')]?_0x4674f6[_0x798a('0x35')]:_0x2203ed['model'];if(_0x5ca780[_0x798a('0x32')][_0x798a('0x37')]){_0x4674f6[_0x798a('0x38')]=[{'all':!![]}];}_0x4674f6=_[_0x798a('0x39')]({},_0x4674f6,_0x5ca780['options']);return db[_0x798a('0x31')][_0x798a('0x3a')](_0x4674f6)[_0x798a('0x27')](handleEntityNotFound(_0x1f5a18,null))['then'](respondWithResult(_0x1f5a18,null))['catch'](handleError(_0x1f5a18,null));};exports[_0x798a('0x3b')]=function(_0x5e5ccf,_0x11880c){return db[_0x798a('0x31')]['create'](_0x5e5ccf[_0x798a('0x3c')],{})[_0x798a('0x27')](respondWithResult(_0x11880c,0xc9))[_0x798a('0x3d')](handleError(_0x11880c,null));};exports[_0x798a('0x3e')]=function(_0x543dc3,_0x1bac0a){if(_0x543dc3[_0x798a('0x3c')]['id']){delete _0x543dc3[_0x798a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x798a('0x3a')]({'where':{'id':_0x543dc3[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x1bac0a,null))[_0x798a('0x27')](saveUpdates(_0x543dc3[_0x798a('0x3c')],null))[_0x798a('0x27')](respondWithResult(_0x1bac0a,null))['catch'](handleError(_0x1bac0a,null));};exports['destroy']=function(_0x4850f1,_0x45babd){return db[_0x798a('0x31')]['find']({'where':{'id':_0x4850f1[_0x798a('0x2e')]['id']}})[_0x798a('0x27')](handleEntityNotFound(_0x45babd,null))['then'](removeEntity(_0x45babd,null))[_0x798a('0x3d')](handleError(_0x45babd,null));}; \ No newline at end of file +var _0x8e0f=['reject','update','then','end','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4af9b0,_0x14636d){var _0x149170=function(_0x150c2c){while(--_0x150c2c){_0x4af9b0['push'](_0x4af9b0['shift']());}};_0x149170(++_0x14636d);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x477fc5,_0x4e984c){_0x477fc5=_0x477fc5-0x0;var _0x7f323d=_0x8e0f[_0x477fc5];return _0x7f323d;};'use strict';var emlformat=require(_0xf8e0('0x0'));var rimraf=require(_0xf8e0('0x1'));var zipdir=require(_0xf8e0('0x2'));var jsonpatch=require(_0xf8e0('0x3'));var rp=require(_0xf8e0('0x4'));var moment=require(_0xf8e0('0x5'));var BPromise=require(_0xf8e0('0x6'));var Mustache=require('mustache');var util=require(_0xf8e0('0x7'));var path=require('path');var sox=require(_0xf8e0('0x8'));var csv=require(_0xf8e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8e0('0xa'));var _=require(_0xf8e0('0xb'));var squel=require(_0xf8e0('0xc'));var crypto=require(_0xf8e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8e0('0xe'));var toCsv=require(_0xf8e0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8e0('0xf'));var authService=require(_0xf8e0('0x10'));var qs=require(_0xf8e0('0x11'));var as=require(_0xf8e0('0x12'));var hardwareService=require(_0xf8e0('0x13'));var logger=require(_0xf8e0('0x14'))(_0xf8e0('0x15'));var utils=require(_0xf8e0('0x16'));var config=require(_0xf8e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8e0('0x18'))['db'];function respondWithStatusCode(_0x113b45,_0x3edb60){_0x3edb60=_0x3edb60||0xcc;return function(_0x415601){if(_0x415601){return _0x113b45['sendStatus'](_0x3edb60);}return _0x113b45[_0xf8e0('0x19')](_0x3edb60)['end']();};}function respondWithResult(_0xea93ae,_0x443445){_0x443445=_0x443445||0xc8;return function(_0x321785){if(_0x321785){return _0xea93ae['status'](_0x443445)[_0xf8e0('0x1a')](_0x321785);}};}function respondWithFilteredResult(_0x534844,_0x151990){return function(_0x4de3de){if(_0x4de3de){var _0x430b06=typeof _0x151990[_0xf8e0('0x1b')]===_0xf8e0('0x1c')&&typeof _0x151990[_0xf8e0('0x1d')]===_0xf8e0('0x1c');var _0x49e649=_0x4de3de[_0xf8e0('0x1e')];var _0x54ee7c=_0x430b06?0x0:_0x151990[_0xf8e0('0x1b')];var _0x13a29b=_0x430b06?_0x4de3de[_0xf8e0('0x1e')]:_0x151990[_0xf8e0('0x1b')]+_0x151990['limit'];var _0x592936;if(_0x13a29b>=_0x49e649){_0x13a29b=_0x49e649;_0x592936=0xc8;}else{_0x592936=0xce;}_0x534844[_0xf8e0('0x19')](_0x592936);return _0x534844[_0xf8e0('0x1f')](_0xf8e0('0x20'),_0x54ee7c+'-'+_0x13a29b+'/'+_0x49e649)[_0xf8e0('0x1a')](_0x4de3de);}return null;};}function patchUpdates(_0x5e5ad6){return function(_0x21831e){try{jsonpatch['apply'](_0x21831e,_0x5e5ad6,!![]);}catch(_0xd533d){return BPromise[_0xf8e0('0x21')](_0xd533d);}return _0x21831e['save']();};}function saveUpdates(_0x2e3826,_0x1b7c3c){return function(_0x2f844a){if(_0x2f844a){return _0x2f844a[_0xf8e0('0x22')](_0x2e3826)['then'](function(_0x47d885){return _0x47d885;});}return null;};}function removeEntity(_0x8d9993,_0x4cb871){return function(_0x4d5255){if(_0x4d5255){return _0x4d5255['destroy']()[_0xf8e0('0x23')](function(){_0x8d9993[_0xf8e0('0x19')](0xcc)[_0xf8e0('0x24')]();});}};}function handleEntityNotFound(_0x420309,_0x212df8){return function(_0x29b52d){if(!_0x29b52d){_0x420309[_0xf8e0('0x25')](0x194);}return _0x29b52d;};}function handleError(_0x512bb7,_0x26494f){_0x26494f=_0x26494f||0x1f4;return function(_0x1bcaf6){logger['error'](_0x1bcaf6[_0xf8e0('0x26')]);if(_0x1bcaf6[_0xf8e0('0x27')]){delete _0x1bcaf6[_0xf8e0('0x27')];}_0x512bb7[_0xf8e0('0x19')](_0x26494f)['send'](_0x1bcaf6);};}exports[_0xf8e0('0x28')]=function(_0x517f2f,_0x4ec8df){var _0xb1baa7={'raw':!![],'where':{'id':_0x517f2f[_0xf8e0('0x29')]['id']}},_0x327e5f={};_0x327e5f[_0xf8e0('0x2a')]=_[_0xf8e0('0x2b')](db[_0xf8e0('0x2c')][_0xf8e0('0x2d')]);_0x327e5f[_0xf8e0('0x2e')]=_[_0xf8e0('0x2b')](_0x517f2f[_0xf8e0('0x2e')]);_0x327e5f['filters']=_[_0xf8e0('0x2f')](_0x327e5f[_0xf8e0('0x2a')],_0x327e5f[_0xf8e0('0x2e')]);_0xb1baa7['attributes']=_[_0xf8e0('0x2f')](_0x327e5f['model'],qs[_0xf8e0('0x30')](_0x517f2f[_0xf8e0('0x2e')]['fields']));_0xb1baa7[_0xf8e0('0x31')]=_0xb1baa7[_0xf8e0('0x31')]['length']?_0xb1baa7[_0xf8e0('0x31')]:_0x327e5f[_0xf8e0('0x2a')];if(_0x517f2f['query'][_0xf8e0('0x32')]){_0xb1baa7['include']=[{'all':!![]}];}_0xb1baa7=_[_0xf8e0('0x33')]({},_0xb1baa7,_0x517f2f['options']);return db['ChatProactiveAction'][_0xf8e0('0x34')](_0xb1baa7)[_0xf8e0('0x23')](handleEntityNotFound(_0x4ec8df,null))[_0xf8e0('0x23')](respondWithResult(_0x4ec8df,null))[_0xf8e0('0x35')](handleError(_0x4ec8df,null));};exports[_0xf8e0('0x36')]=function(_0x40d9f6,_0x306096){return db[_0xf8e0('0x2c')][_0xf8e0('0x36')](_0x40d9f6[_0xf8e0('0x37')],{})[_0xf8e0('0x23')](respondWithResult(_0x306096,0xc9))[_0xf8e0('0x35')](handleError(_0x306096,null));};exports[_0xf8e0('0x22')]=function(_0x5431dc,_0x2266b0){if(_0x5431dc[_0xf8e0('0x37')]['id']){delete _0x5431dc['body']['id'];}return db['ChatProactiveAction'][_0xf8e0('0x34')]({'where':{'id':_0x5431dc['params']['id']}})['then'](handleEntityNotFound(_0x2266b0,null))[_0xf8e0('0x23')](saveUpdates(_0x5431dc[_0xf8e0('0x37')],null))[_0xf8e0('0x23')](respondWithResult(_0x2266b0,null))[_0xf8e0('0x35')](handleError(_0x2266b0,null));};exports['destroy']=function(_0x1423ab,_0x46e476){return db[_0xf8e0('0x2c')][_0xf8e0('0x34')]({'where':{'id':_0x1423ab[_0xf8e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x46e476,null))[_0xf8e0('0x23')](removeEntity(_0x46e476,null))[_0xf8e0('0x35')](handleError(_0x46e476,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5ad7ef2..fa0534b 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 _0x0982=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','../../config/logger','moment','bluebird'];(function(_0x265184,_0x577b2f){var _0x86b9f6=function(_0x700462){while(--_0x700462){_0x265184['push'](_0x265184['shift']());}};_0x86b9f6(++_0x577b2f);}(_0x0982,0xa7));var _0x2098=function(_0x5a2c7e,_0x2a82b5){_0x5a2c7e=_0x5a2c7e-0x0;var _0x539a11=_0x0982[_0x5a2c7e];return _0x539a11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2098('0x0'))('api');var moment=require(_0x2098('0x1'));var BPromise=require(_0x2098('0x2'));var rp=require(_0x2098('0x3'));var fs=require('fs');var path=require(_0x2098('0x4'));var rimraf=require('rimraf');var config=require(_0x2098('0x5'));var attributes=require(_0x2098('0x6'));module[_0x2098('0x7')]=function(_0x2501fe,_0x2edf62){return _0x2501fe[_0x2098('0x8')](_0x2098('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa50f=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x7d58ca,_0x3d7e04){var _0x3a5c58=function(_0x3a7c68){while(--_0x3a7c68){_0x7d58ca['push'](_0x7d58ca['shift']());}};_0x3a5c58(++_0x3d7e04);}(_0xa50f,0x16c));var _0xfa50=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa50f[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xfa50('0x0'));var util=require(_0xfa50('0x1'));var logger=require(_0xfa50('0x2'))(_0xfa50('0x3'));var moment=require(_0xfa50('0x4'));var BPromise=require(_0xfa50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa50('0x6'));var rimraf=require(_0xfa50('0x7'));var config=require(_0xfa50('0x8'));var attributes=require(_0xfa50('0x9'));module[_0xfa50('0xa')]=function(_0x4ac65b,_0x5b9027){return _0x4ac65b[_0xfa50('0xb')](_0xfa50('0xc'),attributes,{'tableName':_0xfa50('0xd'),'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 f5e1dbf..06e4b89 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 _0xde23=['error','code','message','request\x20sent','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde23,0x16d));var _0x3de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde23[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3de2('0x0'));var BPromise=require('bluebird');var rs=require(_0x3de2('0x1'));var fs=require('fs');var Redis=require(_0x3de2('0x2'));var db=require(_0x3de2('0x3'))['db'];var utils=require(_0x3de2('0x4'));var logger=require(_0x3de2('0x5'))('rpc');var config=require(_0x3de2('0x6'));var jayson=require(_0x3de2('0x7'));var client=jayson[_0x3de2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3437eb,_0x1aaddd,_0x4c747b){return new BPromise(function(_0x1b2f1c,_0x58d302){return client[_0x3de2('0x9')](_0x3437eb,_0x4c747b)[_0x3de2('0xa')](function(_0x427c17){logger[_0x3de2('0xb')](_0x3de2('0xc'),_0x1aaddd,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1aaddd,'request\x20sent',JSON['stringify'](_0x427c17));if(_0x427c17['error']){if(_0x427c17[_0x3de2('0xd')][_0x3de2('0xe')]===0x1f4){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17[_0x3de2('0xd')][_0x3de2('0xf')]);return _0x58d302(_0x427c17['error']['message']);}logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x427c17['error']['message']);return _0x1b2f1c(_0x427c17['error'][_0x3de2('0xf')]);}else{logger['info'](_0x3de2('0xc'),_0x1aaddd,_0x3de2('0x10'));_0x1b2f1c(_0x427c17['result'][_0x3de2('0xf')]);}})[_0x3de2('0x11')](function(_0x2b4f03){logger[_0x3de2('0xd')](_0x3de2('0xc'),_0x1aaddd,_0x2b4f03);_0x58d302(_0x2b4f03);});});} \ No newline at end of file +var _0x7b9a=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2abb3f,_0x7cfad8){var _0x174b28=function(_0x3bc2b9){while(--_0x3bc2b9){_0x2abb3f['push'](_0x2abb3f['shift']());}};_0x174b28(++_0x7cfad8);}(_0x7b9a,0x9d));var _0xa7b9=function(_0x581b13,_0x10c820){_0x581b13=_0x581b13-0x0;var _0x516bdb=_0x7b9a[_0x581b13];return _0x516bdb;};'use strict';var _=require(_0xa7b9('0x0'));var util=require(_0xa7b9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7b9('0x3'))['db'];var utils=require(_0xa7b9('0x4'));var logger=require('../../config/logger')(_0xa7b9('0x5'));var config=require(_0xa7b9('0x6'));var jayson=require(_0xa7b9('0x7'));var client=jayson['client'][_0xa7b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2e60e,_0x943364,_0x16dd7a){return new BPromise(function(_0x554730,_0x4a5394){return client[_0xa7b9('0x9')](_0xa2e60e,_0x16dd7a)[_0xa7b9('0xa')](function(_0x314db6){logger[_0xa7b9('0xb')](_0xa7b9('0xc'),_0x943364,_0xa7b9('0xd'));logger[_0xa7b9('0xe')](_0xa7b9('0xf'),_0x943364,_0xa7b9('0xd'),JSON[_0xa7b9('0x10')](_0x314db6));if(_0x314db6[_0xa7b9('0x11')]){if(_0x314db6['error'][_0xa7b9('0x12')]===0x1f4){logger['error'](_0xa7b9('0xc'),_0x943364,_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);return _0x4a5394(_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);}logger[_0xa7b9('0x11')](_0xa7b9('0xc'),_0x943364,_0x314db6[_0xa7b9('0x11')][_0xa7b9('0x13')]);return _0x554730(_0x314db6[_0xa7b9('0x11')]['message']);}else{logger[_0xa7b9('0xb')](_0xa7b9('0xc'),_0x943364,_0xa7b9('0xd'));_0x554730(_0x314db6['result'][_0xa7b9('0x13')]);}})[_0xa7b9('0x14')](function(_0x885f58){logger['error'](_0xa7b9('0xc'),_0x943364,_0x885f58);_0x4a5394(_0x885f58);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b6bfc32..658da2d 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x348c7c,_0x466bea){var _0x4e4f67=function(_0x4a02e7){while(--_0x4a02e7){_0x348c7c['push'](_0x348c7c['shift']());}};_0x4e4f67(++_0x466bea);}(_0x53ec,0x192));var _0xc53e=function(_0x39d024,_0x5c5797){_0x39d024=_0x39d024-0x0;var _0x311bdd=_0x53ec[_0x39d024];return _0x311bdd;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0xea43a9,_0x458694){var _0xa7f5f7=function(_0x5000e5){while(--_0x5000e5){_0xea43a9['push'](_0xea43a9['shift']());}};_0xa7f5f7(++_0x458694);}(_0x5fd1,0x155));var _0x15fd=function(_0x44e7e1,_0x4d8afb){_0x44e7e1=_0x44e7e1-0x0;var _0x4b8344=_0x5fd1[_0x44e7e1];return _0x4b8344;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 805a1c6..c4734af 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 _0x0ac4=['roundrobin','name','INTEGER','beepall'];(function(_0x5a70c6,_0x2e6807){var _0xbfc6fb=function(_0x23cedd){while(--_0x23cedd){_0x5a70c6['push'](_0x5a70c6['shift']());}};_0xbfc6fb(++_0x2e6807);}(_0x0ac4,0x1b9));var _0x40ac=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x0ac4[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x40ac('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x40ac('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x40ac('0x2'),_0x40ac('0x3'))}}; \ No newline at end of file +var _0x675d=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x675d,0x7a));var _0xd675=function(_0x50d96f,_0x569d24){_0x50d96f=_0x50d96f-0x0;var _0xc45799=_0x675d[_0x50d96f];return _0xc45799;};'use strict';var Sequelize=require(_0xd675('0x0'));module[_0xd675('0x1')]={'name':{'type':Sequelize[_0xd675('0x2')],'unique':_0xd675('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd675('0x2')]},'timeout':{'type':Sequelize[_0xd675('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd675('0x5')](_0xd675('0x6'),_0xd675('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 175a814..903e85b 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 _0x4112=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','UserChatQueue','nolimit','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','userChatQueue:remove','omit','spread','removeAgents','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x4112,0xd6));var _0x2411=function(_0x2e2ec3,_0x19ee9b){_0x2e2ec3=_0x2e2ec3-0x0;var _0x5f4db4=_0x4112[_0x2e2ec3];return _0x5f4db4;};'use strict';var emlformat=require(_0x2411('0x0'));var rimraf=require(_0x2411('0x1'));var zipdir=require(_0x2411('0x2'));var jsonpatch=require(_0x2411('0x3'));var rp=require(_0x2411('0x4'));var moment=require(_0x2411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2411('0x6'));var util=require(_0x2411('0x7'));var path=require(_0x2411('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2411('0x9'));var fs=require('fs');var fs_extra=require(_0x2411('0xa'));var _=require(_0x2411('0xb'));var squel=require(_0x2411('0xc'));var crypto=require(_0x2411('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2411('0xe'));var toCsv=require(_0x2411('0xf'));var querystring=require(_0x2411('0x10'));var Papa=require('papaparse');var Redis=require(_0x2411('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2411('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2411('0x13'));var logger=require(_0x2411('0x14'))(_0x2411('0x15'));var utils=require(_0x2411('0x16'));var config=require(_0x2411('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2411('0x18'))['db'];config[_0x2411('0x19')]=_[_0x2411('0x1a')](config[_0x2411('0x19')],{'host':_0x2411('0x1b'),'port':0x18eb});var socket=require(_0x2411('0x1c'))(new Redis(config[_0x2411('0x19')]));require(_0x2411('0x1d'))[_0x2411('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2411('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b41c,_0x25f000,_0x4f96e3,_0x21b82e){return new BPromise(function(_0x2765f6,_0x195efe){var _0x5c8b67=_0x21b82e||client;return _0x5c8b67['request'](_0x45b41c,_0x4f96e3)[_0x2411('0x20')](function(_0x5e3795){logger[_0x2411('0x21')](_0x2411('0x22'),_0x25f000,_0x2411('0x23'));logger[_0x2411('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x25f000,_0x2411('0x23'),JSON['stringify'](_0x5e3795));if(_0x5e3795['error']){if(_0x5e3795[_0x2411('0x25')][_0x2411('0x26')]===0x1f4){logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x195efe(_0x5e3795['error'][_0x2411('0x27')]);}logger[_0x2411('0x25')](_0x2411('0x22'),_0x25f000,_0x5e3795[_0x2411('0x25')][_0x2411('0x27')]);return _0x2765f6(_0x5e3795['error'][_0x2411('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x25f000,'request\x20sent');_0x2765f6(_0x5e3795[_0x2411('0x28')][_0x2411('0x27')]);}})[_0x2411('0x29')](function(_0x92d66a){logger['error']('ChatQueue,\x20%s,\x20%s',_0x25f000,_0x92d66a);_0x195efe(_0x92d66a);});});}function respondWithStatusCode(_0x5ef5e3,_0x346eb4){_0x346eb4=_0x346eb4||0xcc;return function(_0x4075ca){if(_0x4075ca){return _0x5ef5e3[_0x2411('0x2a')](_0x346eb4);}return _0x5ef5e3[_0x2411('0x2b')](_0x346eb4)[_0x2411('0x2c')]();};}function respondWithResult(_0x5a60d4,_0x17ccbf){_0x17ccbf=_0x17ccbf||0xc8;return function(_0x51a377){if(_0x51a377){return _0x5a60d4['status'](_0x17ccbf)[_0x2411('0x2d')](_0x51a377);}};}function respondWithFilteredResult(_0x3be135,_0x598c63){return function(_0x1cc07b){if(_0x1cc07b){var _0x53663e=typeof _0x598c63[_0x2411('0x2e')]===_0x2411('0x2f')&&typeof _0x598c63[_0x2411('0x30')]===_0x2411('0x2f');var _0x265f8f=_0x1cc07b[_0x2411('0x31')];var _0x5e5a7c=_0x53663e?0x0:_0x598c63[_0x2411('0x2e')];var _0x43f578=_0x53663e?_0x1cc07b[_0x2411('0x31')]:_0x598c63[_0x2411('0x2e')]+_0x598c63[_0x2411('0x30')];var _0x45664f;if(_0x43f578>=_0x265f8f){_0x43f578=_0x265f8f;_0x45664f=0xc8;}else{_0x45664f=0xce;}_0x3be135['status'](_0x45664f);return _0x3be135[_0x2411('0x32')](_0x2411('0x33'),_0x5e5a7c+'-'+_0x43f578+'/'+_0x265f8f)[_0x2411('0x2d')](_0x1cc07b);}return null;};}function patchUpdates(_0x4b4cab){return function(_0xac8eb6){try{jsonpatch[_0x2411('0x34')](_0xac8eb6,_0x4b4cab,!![]);}catch(_0x545147){return BPromise['reject'](_0x545147);}return _0xac8eb6[_0x2411('0x35')]();};}function saveUpdates(_0x2ffa76,_0xfe257c){return function(_0x373b85){if(_0x373b85){return _0x373b85[_0x2411('0x36')](_0x2ffa76)['then'](function(_0x3b983d){return _0x3b983d;});}return null;};}function removeEntity(_0x304a02,_0x3f53da){return function(_0x2ed81f){if(_0x2ed81f){return _0x2ed81f[_0x2411('0x37')]()[_0x2411('0x20')](function(){var _0x4fca70=_0x2ed81f[_0x2411('0x38')]({'plain':!![]});var _0x3ea38a='ChatQueues';return db[_0x2411('0x39')]['destroy']({'where':{'type':_0x3ea38a,'resourceId':_0x4fca70['id']}})[_0x2411('0x20')](function(){return _0x2ed81f;});})[_0x2411('0x20')](function(){_0x304a02['status'](0xcc)[_0x2411('0x2c')]();});}};}function handleEntityNotFound(_0x41b66c,_0x20c64d){return function(_0x53d089){if(!_0x53d089){_0x41b66c[_0x2411('0x2a')](0x194);}return _0x53d089;};}function handleError(_0x343142,_0x9fee2a){_0x9fee2a=_0x9fee2a||0x1f4;return function(_0x2bb229){logger[_0x2411('0x25')](_0x2bb229[_0x2411('0x3a')]);if(_0x2bb229[_0x2411('0x3b')]){delete _0x2bb229[_0x2411('0x3b')];}_0x343142[_0x2411('0x2b')](_0x9fee2a)[_0x2411('0x3c')](_0x2bb229);};}exports[_0x2411('0x3d')]=function(_0x2dfb7c,_0x56ad97){var _0x545b19={},_0x110f1f={},_0x1af7ae={'count':0x0,'rows':[]};var _0x1c13c0=_[_0x2411('0x3e')](db[_0x2411('0x3f')][_0x2411('0x40')],function(_0xe21d9){return{'name':_0xe21d9['fieldName'],'type':_0xe21d9[_0x2411('0x41')][_0x2411('0x42')]};});_0x110f1f[_0x2411('0x43')]=_[_0x2411('0x3e')](_0x1c13c0,'name');_0x110f1f[_0x2411('0x44')]=_[_0x2411('0x45')](_0x2dfb7c[_0x2411('0x44')]);_0x110f1f[_0x2411('0x46')]=_[_0x2411('0x47')](_0x110f1f['model'],_0x110f1f[_0x2411('0x44')]);_0x545b19[_0x2411('0x48')]=_[_0x2411('0x47')](_0x110f1f[_0x2411('0x43')],qs[_0x2411('0x49')](_0x2dfb7c[_0x2411('0x44')]['fields']));_0x545b19['attributes']=_0x545b19[_0x2411('0x48')][_0x2411('0x4a')]?_0x545b19[_0x2411('0x48')]:_0x110f1f['model'];if(!_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4b')]('nolimit')){_0x545b19[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x30')]);_0x545b19[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x2e')]);}_0x545b19['order']=qs['sort'](_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4c')]);_0x545b19[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2dfb7c['query'],_0x110f1f[_0x2411('0x46')]),_0x1c13c0);if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]){_0x545b19[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x545b19['where'],{'$or':_['map'](_0x1c13c0,function(_0x4e7d6f){if(_0x4e7d6f[_0x2411('0x41')]!==_0x2411('0x51')){var _0x3cedb2={};_0x3cedb2[_0x4e7d6f[_0x2411('0x3b')]]={'$like':'%'+_0x2dfb7c[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x3cedb2;}})});}_0x545b19=_[_0x2411('0x50')]({},_0x545b19,_0x2dfb7c[_0x2411('0x52')]);var _0x442960={'where':_0x545b19['where']};return db[_0x2411('0x3f')][_0x2411('0x31')](_0x442960)[_0x2411('0x20')](function(_0x2fee29){_0x1af7ae[_0x2411('0x31')]=_0x2fee29;if(_0x2dfb7c[_0x2411('0x44')][_0x2411('0x53')]){_0x545b19[_0x2411('0x54')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x545b19);})[_0x2411('0x20')](function(_0x3b7324){_0x1af7ae['rows']=_0x3b7324;return _0x1af7ae;})[_0x2411('0x20')](respondWithFilteredResult(_0x56ad97,_0x545b19))[_0x2411('0x29')](handleError(_0x56ad97,null));};exports[_0x2411('0x55')]=function(_0x124816,_0x118d3e){var _0x557e0a={'raw':!![],'where':{'id':_0x124816['params']['id']}},_0x8d5b21={};_0x8d5b21['model']=_[_0x2411('0x45')](db[_0x2411('0x3f')]['rawAttributes']);_0x8d5b21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x124816[_0x2411('0x44')]);_0x8d5b21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x8d5b21['model'],_0x8d5b21[_0x2411('0x44')]);_0x557e0a['attributes']=_[_0x2411('0x47')](_0x8d5b21['model'],qs['fields'](_0x124816['query']['fields']));_0x557e0a[_0x2411('0x48')]=_0x557e0a[_0x2411('0x48')][_0x2411('0x4a')]?_0x557e0a[_0x2411('0x48')]:_0x8d5b21['model'];if(_0x124816['query']['includeAll']){_0x557e0a['include']=[{'all':!![]}];}_0x557e0a=_[_0x2411('0x50')]({},_0x557e0a,_0x124816[_0x2411('0x52')]);return db[_0x2411('0x3f')][_0x2411('0x56')](_0x557e0a)[_0x2411('0x20')](handleEntityNotFound(_0x118d3e,null))[_0x2411('0x20')](respondWithResult(_0x118d3e,null))[_0x2411('0x29')](handleError(_0x118d3e,null));};exports[_0x2411('0x57')]=function(_0x232eb2,_0x38c2d2){return db[_0x2411('0x3f')]['create'](_0x232eb2['body'],{})[_0x2411('0x20')](function(_0x435cb8){var _0x411296=_0x232eb2['user']['get']({'plain':!![]});if(!_0x411296)throw new Error(_0x2411('0x58'));if(_0x411296['role']===_0x2411('0x59')){var _0x12f591=_0x435cb8[_0x2411('0x38')]({'plain':!![]});var _0x288ed7=_0x2411('0x5a');return db[_0x2411('0x5b')]['find']({'where':{'name':_0x288ed7,'userProfileId':_0x411296[_0x2411('0x5c')]},'raw':!![]})[_0x2411('0x20')](function(_0x397dfe){if(_0x397dfe&&_0x397dfe['autoAssociation']===0x0){return db[_0x2411('0x39')]['create']({'name':_0x12f591[_0x2411('0x3b')],'resourceId':_0x12f591['id'],'type':_0x397dfe[_0x2411('0x3b')],'sectionId':_0x397dfe['id']},{})[_0x2411('0x20')](function(){return _0x435cb8;});}else{return _0x435cb8;}})[_0x2411('0x29')](function(_0x1429bc){logger[_0x2411('0x25')](_0x2411('0x5d'),_0x1429bc);throw _0x1429bc;});}return _0x435cb8;})[_0x2411('0x20')](respondWithResult(_0x38c2d2,0xc9))[_0x2411('0x29')](handleError(_0x38c2d2,null));};exports['update']=function(_0x3fc42d,_0x278e90){if(_0x3fc42d[_0x2411('0x5e')]['id']){delete _0x3fc42d['body']['id'];}return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x3fc42d[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x278e90,null))[_0x2411('0x20')](saveUpdates(_0x3fc42d['body'],null))[_0x2411('0x20')](respondWithResult(_0x278e90,null))[_0x2411('0x29')](handleError(_0x278e90,null));};exports[_0x2411('0x37')]=function(_0x1cb32d,_0x4856fc){return db[_0x2411('0x3f')][_0x2411('0x56')]({'where':{'id':_0x1cb32d['params']['id']}})['then'](handleEntityNotFound(_0x4856fc,null))['then'](removeEntity(_0x4856fc,null))[_0x2411('0x29')](handleError(_0x4856fc,null));};exports[_0x2411('0x60')]=function(_0x4ca85a,_0x245eb9){return db[_0x2411('0x3f')]['describe']()[_0x2411('0x20')](respondWithResult(_0x245eb9,null))[_0x2411('0x29')](handleError(_0x245eb9,null));};exports[_0x2411('0x61')]=function(_0x348778,_0x497496,_0x4a4677){var _0x27d2df={'raw':!![],'where':{}},_0x52cb3b={},_0x145f08;return db['ChatQueue']['findOne']({'where':{'id':_0x348778[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x497496,null))[_0x2411('0x20')](function(_0x3a826e){if(_0x3a826e){_0x145f08=_0x3a826e['get']({'plain':!![]});_0x52cb3b[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x62')]['rawAttributes']);_0x52cb3b[_0x2411('0x44')]=_[_0x2411('0x45')](_0x348778[_0x2411('0x44')]);_0x52cb3b[_0x2411('0x46')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],_0x52cb3b[_0x2411('0x44')]);_0x27d2df[_0x2411('0x48')]=_['intersection'](_0x52cb3b[_0x2411('0x43')],qs[_0x2411('0x49')](_0x348778['query'][_0x2411('0x49')]));_0x27d2df[_0x2411('0x48')]=_0x27d2df[_0x2411('0x48')]['length']?_0x27d2df['attributes']:_0x52cb3b['model'];if(!_0x348778[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x27d2df[_0x2411('0x30')]=qs[_0x2411('0x30')](_0x348778[_0x2411('0x44')][_0x2411('0x30')]);_0x27d2df[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x348778[_0x2411('0x44')][_0x2411('0x2e')]);}_0x27d2df['order']=qs['sort'](_0x348778[_0x2411('0x44')]['sort']);_0x27d2df['where']=qs['filters'](_[_0x2411('0x4e')](_0x348778['query'],_0x52cb3b[_0x2411('0x46')]));_0x27d2df[_0x2411('0x4d')]['ChatQueueId']=_0x3a826e['id'];if(_0x348778[_0x2411('0x44')]['filter']){_0x27d2df[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x27d2df[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x27d2df[_0x2411('0x48')],function(_0x147f59){var _0x2819f0={};_0x2819f0[_0x147f59]={'$like':'%'+_0x348778[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x2819f0;})});}_0x27d2df=_['merge']({},_0x27d2df,_0x348778[_0x2411('0x52')]);return db[_0x2411('0x62')][_0x2411('0x64')](_0x27d2df);}})[_0x2411('0x20')](function(_0x5084d5){if(_0x5084d5){return db[_0x2411('0x65')][_0x2411('0x66')]({'where':{'id':_[_0x2411('0x3e')](_0x5084d5,_0x2411('0x67')),'role':_0x2411('0x68')},'attributes':['id',_0x2411('0x3b'),_0x2411('0x69'),_0x2411('0x6a'),_0x2411('0x6b')]});}})['then'](function(_0x15f9e4){if(_0x15f9e4){return{'count':_0x15f9e4[_0x2411('0x31')],'rows':_[_0x2411('0x3e')](_0x15f9e4[_0x2411('0x6c')],function(_0x2fc18b){return{'membername':_0x2fc18b['name'],'UserId':_0x2fc18b['id'],'queue_name':_0x145f08[_0x2411('0x3b')],'ChatQueueId':_0x145f08['id'],'interface':util[_0x2411('0x6d')](_0x2411('0x6e'),'SIP',_0x2fc18b[_0x2411('0x3b')]),'penalty':0x0,'paused':_0x2fc18b['chatPause'],'createdAt':_0x2fc18b[_0x2411('0x6b')],'updatedAt':_0x2fc18b[_0x2411('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2411('0x20')](respondWithFilteredResult(_0x497496,_0x27d2df))[_0x2411('0x29')](handleError(_0x497496,null));};exports[_0x2411('0x6f')]=function(_0x35958a,_0x3e8be5,_0xffa8a7){var _0x38bee3={};var _0x59cf21={};var _0x751de7;var _0x23281b;return db['ChatQueue']['findOne']({'where':{'id':_0x35958a[_0x2411('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e8be5,null))[_0x2411('0x20')](function(_0x13d31e){if(_0x13d31e){_0x751de7=_0x13d31e;_0x59cf21[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x70')]['rawAttributes']);_0x59cf21[_0x2411('0x44')]=_[_0x2411('0x45')](_0x35958a[_0x2411('0x44')]);_0x59cf21[_0x2411('0x46')]=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],_0x59cf21[_0x2411('0x44')]);_0x38bee3['attributes']=_[_0x2411('0x47')](_0x59cf21[_0x2411('0x43')],qs[_0x2411('0x49')](_0x35958a[_0x2411('0x44')][_0x2411('0x49')]));_0x38bee3[_0x2411('0x48')]=_0x38bee3[_0x2411('0x48')][_0x2411('0x4a')]?_0x38bee3['attributes']:_0x59cf21['model'];_0x38bee3[_0x2411('0x71')]=qs[_0x2411('0x4c')](_0x35958a['query'][_0x2411('0x4c')]);_0x38bee3['where']=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x35958a[_0x2411('0x44')],_0x59cf21['filters']));if(_0x35958a[_0x2411('0x44')][_0x2411('0x4f')]){_0x38bee3[_0x2411('0x4d')]=_['merge'](_0x38bee3[_0x2411('0x4d')],{'$or':_[_0x2411('0x3e')](_0x38bee3[_0x2411('0x48')],function(_0x39fcd2){var _0x389197={};_0x389197[_0x39fcd2]={'$like':'%'+_0x35958a['query']['filter']+'%'};return _0x389197;})});}_0x38bee3=_[_0x2411('0x50')]({},_0x38bee3,_0x35958a[_0x2411('0x52')]);return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x3c4320){if(_0x3c4320){_0x23281b=_0x3c4320[_0x2411('0x4a')];if(!_0x35958a[_0x2411('0x44')][_0x2411('0x4b')](_0x2411('0x63'))){_0x38bee3['limit']=qs[_0x2411('0x30')](_0x35958a[_0x2411('0x44')][_0x2411('0x30')]);_0x38bee3[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x35958a[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x751de7[_0x2411('0x6f')](_0x38bee3);}})[_0x2411('0x20')](function(_0x5850ff){if(_0x5850ff){return _0x5850ff?{'count':_0x23281b,'rows':_0x5850ff}:null;}})['then'](respondWithResult(_0x3e8be5,null))[_0x2411('0x29')](handleError(_0x3e8be5,null));};exports[_0x2411('0x72')]=function(_0x6ea3e6,_0x2c8f0a,_0x1a4782){var _0x1b5447=_0x6ea3e6[_0x2411('0x5e')][_0x2411('0x73')];return db[_0x2411('0x70')][_0x2411('0x64')]({'where':{'id':_0x1b5447},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id',_0x2411('0x3b'),_0x2411('0x75'),_0x2411('0x76'),_0x2411('0x77')],'raw':!![]}]})['then'](function(_0x2a3c96){if(_0x2a3c96){var _0x22d980=_['flatMap'](_0x2a3c96,function(_0x1cc1b7){var _0x64e80a=_0x1cc1b7[_0x2411('0x38')]({'plain':!![]});return _0x64e80a['Agents'];});return db[_0x2411('0x3f')]['find']({'where':{'id':_0x6ea3e6['params']['id']}})[_0x2411('0x20')](function(_0x428082){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x127403){return _0x428082[_0x2411('0x72')](_0x1b5447,{'transaction':_0x127403})[_0x2411('0x20')](function(){return BPromise[_0x2411('0x7a')](_0x22d980,function(_0x29b03a){return db[_0x2411('0x62')][_0x2411('0x7b')]({'where':{'UserId':_0x29b03a['id'],'ChatQueueId':_0x6ea3e6[_0x2411('0x5f')]['id']},'transaction':_0x127403});});})[_0x2411('0x20')](function(){_0x22d980[_0x2411('0x7c')](function(_0x1e9121){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':_0x1e9121['id'],'ChatQueueId':_0x428082['id']});});});});});}})[_0x2411('0x20')](respondWithStatusCode(_0x2c8f0a,null))[_0x2411('0x29')](handleError(_0x2c8f0a,null));};exports[_0x2411('0x7f')]=function(_0x5c8ec1,_0x479c65,_0xda5f05){return db[_0x2411('0x70')]['findAll']({'where':{'id':_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')]},'attributes':['id'],'include':[{'model':db[_0x2411('0x65')],'as':_0x2411('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2411('0x20')](handleEntityNotFound(_0x479c65,null))[_0x2411('0x20')](function(_0x52773b){var _0x1050ae=_[_0x2411('0x3e')](_0x52773b,'id');var _0x1f8b3f=[];var _0xbebaea=[];var _0x136d7b=squel[_0x2411('0x80')]();_0x136d7b[_0x2411('0x81')](_0x2411('0x82'))['from'](_0x2411('0x83'),'tq')['join'](_0x2411('0x84'),'ut',_0x2411('0x85'))[_0x2411('0x4d')](_0x2411('0x86'),_0x5c8ec1[_0x2411('0x5f')]['id']);for(var _0x4da8df=0x0;_0x4da8df<_0x52773b['length'];_0x4da8df+=0x1){let _0x45b26e=_0x52773b[_0x4da8df];for(var _0x3eee04=0x0;_0x3eee04<_0x45b26e[_0x2411('0x74')][_0x2411('0x4a')];_0x3eee04+=0x1){let _0x46dc75=_0x45b26e[_0x2411('0x74')][_0x3eee04];var _0x4e9990=_0x136d7b[_0x2411('0x87')]();_0x4e9990[_0x2411('0x4d')](_0x2411('0x88'),_0x46dc75['id']);_0xbebaea[_0x2411('0x89')](db['sequelize'][_0x2411('0x44')](_0x4e9990[_0x2411('0x8a')](),{'type':db['sequelize'][_0x2411('0x8b')]['SELECT']})[_0x2411('0x20')](function(_0x466ed1){if(_0x466ed1['length']===0x1){return _0x46dc75['id'];}else{var _0x4cec58=_[_0x2411('0x8c')](_['map'](_0x466ed1,_0x2411('0x8d')),function(_0x3f053e){return _['includes'](_0x1050ae,_0x3f053e);});if(_0x4cec58){return _0x46dc75['id'];}}}));}}return BPromise[_0x2411('0x8e')](_0xbebaea)[_0x2411('0x20')](function(_0x3e171d){_0x1f8b3f=_(_0x1f8b3f)[_0x2411('0x8f')](_0x3e171d)[_0x2411('0x90')]()[_0x2411('0x91')]();return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x5c8ec1[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](function(_0x1fcc1f){return db[_0x2411('0x78')][_0x2411('0x79')](function(_0x383fac){return _0x1fcc1f[_0x2411('0x7f')](_0x5c8ec1[_0x2411('0x44')][_0x2411('0x73')],{'transaction':_0x383fac})['then'](function(){if(!_['isEmpty'](_0x1f8b3f)){return _0x1fcc1f['removeAgents'](_0x1f8b3f,{'transaction':_0x383fac});}})[_0x2411('0x20')](function(){_0x1f8b3f['forEach'](function(_0x2c4ba1){socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':_0x2c4ba1,'ChatQueueId':_0x1fcc1f['id']});});});});});});})[_0x2411('0x20')](respondWithStatusCode(_0x479c65,null))[_0x2411('0x29')](handleError(_0x479c65,null));};exports['addAgents']=function(_0x173fe6,_0x261441,_0x3e021f){return db[_0x2411('0x3f')]['find']({'where':{'id':_0x173fe6['params']['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x261441,null))[_0x2411('0x20')](function(_0x162131){if(_0x162131){return _0x162131['addAgents'](_0x173fe6['body']['ids'],_[_0x2411('0x93')](_0x173fe6[_0x2411('0x5e')],[_0x2411('0x73'),'id'])||{})[_0x2411('0x94')](function(_0x403662){for(var _0x3c3a20=0x0;_0x3c3a20<_0x173fe6['body']['ids']['length'];_0x3c3a20+=0x1){socket[_0x2411('0x7d')](_0x2411('0x7e'),{'UserId':Number(_0x173fe6['body']['ids'][_0x3c3a20]),'ChatQueueId':Number(_0x173fe6[_0x2411('0x5f')]['id'])});}return _0x403662;});}})['then'](respondWithResult(_0x261441,null))[_0x2411('0x29')](handleError(_0x261441,null));};exports[_0x2411('0x95')]=function(_0x156c56,_0x8081c0,_0x4baa76){return db['ChatQueue'][_0x2411('0x56')]({'where':{'id':_0x156c56[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x8081c0,null))[_0x2411('0x20')](function(_0x11fbbe){if(_0x11fbbe){return _0x11fbbe[_0x2411('0x95')](_0x156c56[_0x2411('0x44')]['ids'])[_0x2411('0x20')](function(){if(_[_0x2411('0x96')](_0x156c56['query'][_0x2411('0x73')])){for(var _0x458045=0x0;_0x458045<_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x2411('0x4a')];_0x458045+=0x1){socket['emit'](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')][_0x458045]),'ChatQueueId':Number(_0x156c56[_0x2411('0x5f')]['id'])});}}else{socket[_0x2411('0x7d')](_0x2411('0x92'),{'UserId':Number(_0x156c56[_0x2411('0x44')][_0x2411('0x73')]),'ChatQueueId':Number(_0x156c56['params']['id'])});}});}})[_0x2411('0x20')](respondWithStatusCode(_0x8081c0,null))[_0x2411('0x29')](handleError(_0x8081c0,null));};exports['getAgents']=function(_0x2e753f,_0x11e330,_0x39e4e2){var _0x5d4cf1={};var _0xdca24c={};var _0x1c637a;var _0x56de17;return db[_0x2411('0x3f')][_0x2411('0x97')]({'where':{'id':_0x2e753f[_0x2411('0x5f')]['id']}})[_0x2411('0x20')](handleEntityNotFound(_0x11e330,null))['then'](function(_0x9f85c0){if(_0x9f85c0){_0x1c637a=_0x9f85c0;_0xdca24c[_0x2411('0x43')]=_[_0x2411('0x45')](db[_0x2411('0x65')][_0x2411('0x40')]);_0xdca24c[_0x2411('0x44')]=_['keys'](_0x2e753f[_0x2411('0x44')]);_0xdca24c['filters']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],_0xdca24c['query']);_0x5d4cf1['attributes']=_[_0x2411('0x47')](_0xdca24c[_0x2411('0x43')],qs['fields'](_0x2e753f[_0x2411('0x44')][_0x2411('0x49')]));_0x5d4cf1[_0x2411('0x48')]=_0x5d4cf1[_0x2411('0x48')][_0x2411('0x4a')]?_0x5d4cf1['attributes']:_0xdca24c[_0x2411('0x43')];_0x5d4cf1['order']=qs[_0x2411('0x4c')](_0x2e753f[_0x2411('0x44')]['sort']);_0x5d4cf1[_0x2411('0x4d')]=qs[_0x2411('0x46')](_[_0x2411('0x4e')](_0x2e753f[_0x2411('0x44')],_0xdca24c[_0x2411('0x46')]));if(_0x2e753f['query'][_0x2411('0x4f')]){_0x5d4cf1[_0x2411('0x4d')]=_[_0x2411('0x50')](_0x5d4cf1['where'],{'$or':_[_0x2411('0x3e')](_0x5d4cf1[_0x2411('0x48')],function(_0x115a1d){var _0x25d525={};_0x25d525[_0x115a1d]={'$like':'%'+_0x2e753f[_0x2411('0x44')][_0x2411('0x4f')]+'%'};return _0x25d525;})});}_0x5d4cf1=_[_0x2411('0x50')]({},_0x5d4cf1,_0x2e753f['options']);return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})['then'](function(_0x3f82bb){if(_0x3f82bb){_0x56de17=_0x3f82bb[_0x2411('0x4a')];if(!_0x2e753f['query'][_0x2411('0x4b')](_0x2411('0x63'))){_0x5d4cf1['limit']=qs['limit'](_0x2e753f[_0x2411('0x44')][_0x2411('0x30')]);_0x5d4cf1[_0x2411('0x2e')]=qs[_0x2411('0x2e')](_0x2e753f[_0x2411('0x44')][_0x2411('0x2e')]);}return _0x1c637a[_0x2411('0x98')](_0x5d4cf1);}})[_0x2411('0x20')](function(_0x4b3793){if(_0x4b3793){return _0x4b3793?{'count':_0x56de17,'rows':_0x4b3793}:null;}})[_0x2411('0x20')](respondWithResult(_0x11e330,null))[_0x2411('0x29')](handleError(_0x11e330,null));}; \ No newline at end of file +var _0x4986=['merge','VIRTUAL','includeAll','ChatQueue','findAll','rows','show','params','keys','attributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','%s/%s','chatPause','findOne','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','removeAgents','isArray','getAgents','options','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x255c20,_0x29e68d){var _0x4aa54f=function(_0x59144f){while(--_0x59144f){_0x255c20['push'](_0x255c20['shift']());}};_0x4aa54f(++_0x29e68d);}(_0x4986,0xe7));var _0x6498=function(_0x29d369,_0x4ebce8){_0x29d369=_0x29d369-0x0;var _0x460deb=_0x4986[_0x29d369];return _0x460deb;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require(_0x6498('0x1'));var zipdir=require(_0x6498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6498('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6498('0x4'));var util=require(_0x6498('0x5'));var path=require(_0x6498('0x6'));var sox=require(_0x6498('0x7'));var csv=require(_0x6498('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6498('0x9'));var _=require(_0x6498('0xa'));var squel=require('squel');var crypto=require(_0x6498('0xb'));var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x8'));var querystring=require(_0x6498('0xe'));var Papa=require('papaparse');var Redis=require(_0x6498('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6498('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6498('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6498('0x12'));var licenseUtil=require(_0x6498('0x13'));var db=require(_0x6498('0x14'))['db'];config['redis']=_['defaults'](config[_0x6498('0x15')],{'host':_0x6498('0x16'),'port':0x18eb});var socket=require(_0x6498('0x17'))(new Redis(config[_0x6498('0x15')]));require(_0x6498('0x18'))[_0x6498('0x19')](socket);var jayson=require(_0x6498('0x1a'));var client=jayson[_0x6498('0x1b')][_0x6498('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x37a1f7,_0x49ccc9,_0x19afbe,_0x208c01){return new BPromise(function(_0x5c6907,_0x4639ce){var _0x4b89c6=_0x208c01||client;return _0x4b89c6[_0x6498('0x1d')](_0x37a1f7,_0x19afbe)[_0x6498('0x1e')](function(_0x5dc0a2){logger['info'](_0x6498('0x1f'),_0x49ccc9,_0x6498('0x20'));logger[_0x6498('0x21')](_0x6498('0x22'),_0x49ccc9,_0x6498('0x20'),JSON['stringify'](_0x5dc0a2));if(_0x5dc0a2['error']){if(_0x5dc0a2[_0x6498('0x23')]['code']===0x1f4){logger[_0x6498('0x23')](_0x6498('0x1f'),_0x49ccc9,_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);return _0x4639ce(_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);}logger[_0x6498('0x23')](_0x6498('0x1f'),_0x49ccc9,_0x5dc0a2['error'][_0x6498('0x24')]);return _0x5c6907(_0x5dc0a2[_0x6498('0x23')][_0x6498('0x24')]);}else{logger[_0x6498('0x25')](_0x6498('0x1f'),_0x49ccc9,_0x6498('0x20'));_0x5c6907(_0x5dc0a2[_0x6498('0x26')][_0x6498('0x24')]);}})[_0x6498('0x27')](function(_0x412e2f){logger['error'](_0x6498('0x1f'),_0x49ccc9,_0x412e2f);_0x4639ce(_0x412e2f);});});}function respondWithStatusCode(_0x13ce31,_0x411033){_0x411033=_0x411033||0xcc;return function(_0x192589){if(_0x192589){return _0x13ce31['sendStatus'](_0x411033);}return _0x13ce31[_0x6498('0x28')](_0x411033)['end']();};}function respondWithResult(_0x20a2ee,_0x1bc630){_0x1bc630=_0x1bc630||0xc8;return function(_0x79efb){if(_0x79efb){return _0x20a2ee[_0x6498('0x28')](_0x1bc630)[_0x6498('0x29')](_0x79efb);}};}function respondWithFilteredResult(_0x1b714a,_0x1e36d0){return function(_0x3915bb){if(_0x3915bb){var _0x238f32=typeof _0x1e36d0[_0x6498('0x2a')]===_0x6498('0x2b')&&typeof _0x1e36d0[_0x6498('0x2c')]===_0x6498('0x2b');var _0x20307d=_0x3915bb['count'];var _0x38a73c=_0x238f32?0x0:_0x1e36d0[_0x6498('0x2a')];var _0x10b362=_0x238f32?_0x3915bb[_0x6498('0x2d')]:_0x1e36d0['offset']+_0x1e36d0[_0x6498('0x2c')];var _0x393534;if(_0x10b362>=_0x20307d){_0x10b362=_0x20307d;_0x393534=0xc8;}else{_0x393534=0xce;}_0x1b714a[_0x6498('0x28')](_0x393534);return _0x1b714a[_0x6498('0x2e')](_0x6498('0x2f'),_0x38a73c+'-'+_0x10b362+'/'+_0x20307d)[_0x6498('0x29')](_0x3915bb);}return null;};}function patchUpdates(_0x2e982c){return function(_0xd80233){try{jsonpatch[_0x6498('0x30')](_0xd80233,_0x2e982c,!![]);}catch(_0x1c42c6){return BPromise[_0x6498('0x31')](_0x1c42c6);}return _0xd80233[_0x6498('0x32')]();};}function saveUpdates(_0x42eb85,_0x157b95){return function(_0x34068a){if(_0x34068a){return _0x34068a[_0x6498('0x33')](_0x42eb85)[_0x6498('0x1e')](function(_0x4d0d96){return _0x4d0d96;});}return null;};}function removeEntity(_0x18b86b,_0x3c58ea){return function(_0x2f73cb){if(_0x2f73cb){return _0x2f73cb[_0x6498('0x34')]()[_0x6498('0x1e')](function(){var _0x545b85=_0x2f73cb[_0x6498('0x35')]({'plain':!![]});var _0x24d119=_0x6498('0x36');return db['UserProfileResource'][_0x6498('0x34')]({'where':{'type':_0x24d119,'resourceId':_0x545b85['id']}})['then'](function(){return _0x2f73cb;});})[_0x6498('0x1e')](function(){_0x18b86b[_0x6498('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x262b6c,_0xfd3c15){return function(_0x493683){if(!_0x493683){_0x262b6c['sendStatus'](0x194);}return _0x493683;};}function handleError(_0x55f66c,_0x31427a){_0x31427a=_0x31427a||0x1f4;return function(_0x1f3073){logger[_0x6498('0x23')](_0x1f3073['stack']);if(_0x1f3073[_0x6498('0x37')]){delete _0x1f3073['name'];}_0x55f66c[_0x6498('0x28')](_0x31427a)[_0x6498('0x38')](_0x1f3073);};}exports[_0x6498('0x39')]=function(_0x2a5903,_0x32b0aa){var _0x3475c3={},_0x38b0d5={},_0x496a22={'count':0x0,'rows':[]};var _0x832980=_[_0x6498('0x3a')](db['ChatQueue'][_0x6498('0x3b')],function(_0x281b6a){return{'name':_0x281b6a[_0x6498('0x3c')],'type':_0x281b6a[_0x6498('0x3d')][_0x6498('0x3e')]};});_0x38b0d5['model']=_[_0x6498('0x3a')](_0x832980,_0x6498('0x37'));_0x38b0d5[_0x6498('0x3f')]=_['keys'](_0x2a5903[_0x6498('0x3f')]);_0x38b0d5[_0x6498('0x40')]=_['intersection'](_0x38b0d5[_0x6498('0x41')],_0x38b0d5[_0x6498('0x3f')]);_0x3475c3['attributes']=_[_0x6498('0x42')](_0x38b0d5[_0x6498('0x41')],qs[_0x6498('0x43')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x43')]));_0x3475c3['attributes']=_0x3475c3['attributes'][_0x6498('0x44')]?_0x3475c3['attributes']:_0x38b0d5['model'];if(!_0x2a5903[_0x6498('0x3f')][_0x6498('0x45')]('nolimit')){_0x3475c3[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x2c')]);_0x3475c3[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x2a5903[_0x6498('0x3f')][_0x6498('0x2a')]);}_0x3475c3[_0x6498('0x46')]=qs[_0x6498('0x47')](_0x2a5903[_0x6498('0x3f')]['sort']);_0x3475c3[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x2a5903[_0x6498('0x3f')],_0x38b0d5[_0x6498('0x40')]),_0x832980);if(_0x2a5903['query'][_0x6498('0x4a')]){_0x3475c3['where']=_[_0x6498('0x4b')](_0x3475c3[_0x6498('0x48')],{'$or':_['map'](_0x832980,function(_0x17dd27){if(_0x17dd27[_0x6498('0x3d')]!==_0x6498('0x4c')){var _0x2890ee={};_0x2890ee[_0x17dd27[_0x6498('0x37')]]={'$like':'%'+_0x2a5903[_0x6498('0x3f')][_0x6498('0x4a')]+'%'};return _0x2890ee;}})});}_0x3475c3=_[_0x6498('0x4b')]({},_0x3475c3,_0x2a5903['options']);var _0x26f525={'where':_0x3475c3[_0x6498('0x48')]};return db['ChatQueue'][_0x6498('0x2d')](_0x26f525)[_0x6498('0x1e')](function(_0x283ca4){_0x496a22[_0x6498('0x2d')]=_0x283ca4;if(_0x2a5903['query'][_0x6498('0x4d')]){_0x3475c3['include']=[{'all':!![]}];}return db[_0x6498('0x4e')][_0x6498('0x4f')](_0x3475c3);})[_0x6498('0x1e')](function(_0x217745){_0x496a22[_0x6498('0x50')]=_0x217745;return _0x496a22;})[_0x6498('0x1e')](respondWithFilteredResult(_0x32b0aa,_0x3475c3))['catch'](handleError(_0x32b0aa,null));};exports[_0x6498('0x51')]=function(_0x1e8dd3,_0x2383b2){var _0x4d61f7={'raw':!![],'where':{'id':_0x1e8dd3[_0x6498('0x52')]['id']}},_0x338f67={};_0x338f67[_0x6498('0x41')]=_[_0x6498('0x53')](db[_0x6498('0x4e')][_0x6498('0x3b')]);_0x338f67[_0x6498('0x3f')]=_[_0x6498('0x53')](_0x1e8dd3[_0x6498('0x3f')]);_0x338f67[_0x6498('0x40')]=_[_0x6498('0x42')](_0x338f67['model'],_0x338f67[_0x6498('0x3f')]);_0x4d61f7[_0x6498('0x54')]=_[_0x6498('0x42')](_0x338f67[_0x6498('0x41')],qs[_0x6498('0x43')](_0x1e8dd3[_0x6498('0x3f')]['fields']));_0x4d61f7[_0x6498('0x54')]=_0x4d61f7['attributes'][_0x6498('0x44')]?_0x4d61f7[_0x6498('0x54')]:_0x338f67[_0x6498('0x41')];if(_0x1e8dd3['query']['includeAll']){_0x4d61f7[_0x6498('0x55')]=[{'all':!![]}];}_0x4d61f7=_[_0x6498('0x4b')]({},_0x4d61f7,_0x1e8dd3['options']);return db[_0x6498('0x4e')]['find'](_0x4d61f7)[_0x6498('0x1e')](handleEntityNotFound(_0x2383b2,null))[_0x6498('0x1e')](respondWithResult(_0x2383b2,null))[_0x6498('0x27')](handleError(_0x2383b2,null));};exports[_0x6498('0x56')]=function(_0x189626,_0x150cdc){return db[_0x6498('0x4e')][_0x6498('0x56')](_0x189626[_0x6498('0x57')],{})['then'](function(_0x21cf8b){var _0x5bd5a9=_0x189626[_0x6498('0x58')][_0x6498('0x35')]({'plain':!![]});if(!_0x5bd5a9)throw new Error(_0x6498('0x59'));if(_0x5bd5a9[_0x6498('0x5a')]===_0x6498('0x58')){var _0x172e07=_0x21cf8b[_0x6498('0x35')]({'plain':!![]});var _0x2ea3bd=_0x6498('0x36');return db[_0x6498('0x5b')][_0x6498('0x5c')]({'where':{'name':_0x2ea3bd,'userProfileId':_0x5bd5a9['userProfileId']},'raw':!![]})[_0x6498('0x1e')](function(_0x3fce39){if(_0x3fce39&&_0x3fce39[_0x6498('0x5d')]===0x0){return db[_0x6498('0x5e')]['create']({'name':_0x172e07[_0x6498('0x37')],'resourceId':_0x172e07['id'],'type':_0x3fce39[_0x6498('0x37')],'sectionId':_0x3fce39['id']},{})['then'](function(){return _0x21cf8b;});}else{return _0x21cf8b;}})[_0x6498('0x27')](function(_0xaa0bca){logger[_0x6498('0x23')](_0x6498('0x5f'),_0xaa0bca);throw _0xaa0bca;});}return _0x21cf8b;})['then'](respondWithResult(_0x150cdc,0xc9))[_0x6498('0x27')](handleError(_0x150cdc,null));};exports[_0x6498('0x33')]=function(_0x3d06a8,_0x444a71){if(_0x3d06a8[_0x6498('0x57')]['id']){delete _0x3d06a8[_0x6498('0x57')]['id'];}return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x3d06a8[_0x6498('0x52')]['id']}})['then'](handleEntityNotFound(_0x444a71,null))[_0x6498('0x1e')](saveUpdates(_0x3d06a8[_0x6498('0x57')],null))[_0x6498('0x1e')](respondWithResult(_0x444a71,null))[_0x6498('0x27')](handleError(_0x444a71,null));};exports[_0x6498('0x34')]=function(_0x701b12,_0x42491a){return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x701b12[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x42491a,null))[_0x6498('0x1e')](removeEntity(_0x42491a,null))[_0x6498('0x27')](handleError(_0x42491a,null));};exports[_0x6498('0x60')]=function(_0x2dbf8c,_0x44eb6e){return db[_0x6498('0x4e')][_0x6498('0x60')]()['then'](respondWithResult(_0x44eb6e,null))[_0x6498('0x27')](handleError(_0x44eb6e,null));};exports[_0x6498('0x61')]=function(_0x5caf11,_0x33a721,_0x2de118){var _0x30b87e={'raw':!![],'where':{}},_0x2c9d50={},_0x36f6f9;return db[_0x6498('0x4e')]['findOne']({'where':{'id':_0x5caf11['params']['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x33a721,null))['then'](function(_0x574625){if(_0x574625){_0x36f6f9=_0x574625[_0x6498('0x35')]({'plain':!![]});_0x2c9d50[_0x6498('0x41')]=_['keys'](db[_0x6498('0x62')][_0x6498('0x3b')]);_0x2c9d50['query']=_[_0x6498('0x53')](_0x5caf11[_0x6498('0x3f')]);_0x2c9d50[_0x6498('0x40')]=_[_0x6498('0x42')](_0x2c9d50[_0x6498('0x41')],_0x2c9d50[_0x6498('0x3f')]);_0x30b87e['attributes']=_[_0x6498('0x42')](_0x2c9d50['model'],qs[_0x6498('0x43')](_0x5caf11[_0x6498('0x3f')]['fields']));_0x30b87e[_0x6498('0x54')]=_0x30b87e[_0x6498('0x54')][_0x6498('0x44')]?_0x30b87e['attributes']:_0x2c9d50[_0x6498('0x41')];if(!_0x5caf11[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x30b87e['limit']=qs[_0x6498('0x2c')](_0x5caf11[_0x6498('0x3f')]['limit']);_0x30b87e['offset']=qs[_0x6498('0x2a')](_0x5caf11[_0x6498('0x3f')][_0x6498('0x2a')]);}_0x30b87e['order']=qs[_0x6498('0x47')](_0x5caf11[_0x6498('0x3f')][_0x6498('0x47')]);_0x30b87e[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x5caf11[_0x6498('0x3f')],_0x2c9d50['filters']));_0x30b87e['where'][_0x6498('0x64')]=_0x574625['id'];if(_0x5caf11[_0x6498('0x3f')][_0x6498('0x4a')]){_0x30b87e[_0x6498('0x48')]=_[_0x6498('0x4b')](_0x30b87e[_0x6498('0x48')],{'$or':_['map'](_0x30b87e[_0x6498('0x54')],function(_0x20b637){var _0x1529d2={};_0x1529d2[_0x20b637]={'$like':'%'+_0x5caf11[_0x6498('0x3f')]['filter']+'%'};return _0x1529d2;})});}_0x30b87e=_['merge']({},_0x30b87e,_0x5caf11['options']);return db['UserChatQueue'][_0x6498('0x4f')](_0x30b87e);}})[_0x6498('0x1e')](function(_0x345d0b){if(_0x345d0b){return db[_0x6498('0x65')][_0x6498('0x66')]({'where':{'id':_[_0x6498('0x3a')](_0x345d0b,_0x6498('0x67')),'role':'agent'},'attributes':['id',_0x6498('0x37'),'chatPause',_0x6498('0x68'),_0x6498('0x69')]});}})['then'](function(_0x3fc3c4){if(_0x3fc3c4){return{'count':_0x3fc3c4[_0x6498('0x2d')],'rows':_[_0x6498('0x3a')](_0x3fc3c4[_0x6498('0x50')],function(_0x3e01b8){return{'membername':_0x3e01b8[_0x6498('0x37')],'UserId':_0x3e01b8['id'],'queue_name':_0x36f6f9['name'],'ChatQueueId':_0x36f6f9['id'],'interface':util['format'](_0x6498('0x6a'),'SIP',_0x3e01b8[_0x6498('0x37')]),'penalty':0x0,'paused':_0x3e01b8[_0x6498('0x6b')],'createdAt':_0x3e01b8[_0x6498('0x69')],'updatedAt':_0x3e01b8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6498('0x1e')](respondWithFilteredResult(_0x33a721,_0x30b87e))[_0x6498('0x27')](handleError(_0x33a721,null));};exports['getTeams']=function(_0x365a6b,_0x5bcead,_0x37e62a){var _0x1a2bef={};var _0x390f81={};var _0x841fe8;var _0x42902f;return db[_0x6498('0x4e')][_0x6498('0x6c')]({'where':{'id':_0x365a6b[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x5bcead,null))['then'](function(_0x15b1e0){if(_0x15b1e0){_0x841fe8=_0x15b1e0;_0x390f81[_0x6498('0x41')]=_[_0x6498('0x53')](db['Team'][_0x6498('0x3b')]);_0x390f81[_0x6498('0x3f')]=_['keys'](_0x365a6b['query']);_0x390f81[_0x6498('0x40')]=_[_0x6498('0x42')](_0x390f81[_0x6498('0x41')],_0x390f81[_0x6498('0x3f')]);_0x1a2bef[_0x6498('0x54')]=_['intersection'](_0x390f81[_0x6498('0x41')],qs[_0x6498('0x43')](_0x365a6b[_0x6498('0x3f')][_0x6498('0x43')]));_0x1a2bef['attributes']=_0x1a2bef[_0x6498('0x54')][_0x6498('0x44')]?_0x1a2bef[_0x6498('0x54')]:_0x390f81[_0x6498('0x41')];_0x1a2bef[_0x6498('0x46')]=qs[_0x6498('0x47')](_0x365a6b[_0x6498('0x3f')][_0x6498('0x47')]);_0x1a2bef[_0x6498('0x48')]=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x365a6b['query'],_0x390f81[_0x6498('0x40')]));if(_0x365a6b[_0x6498('0x3f')][_0x6498('0x4a')]){_0x1a2bef[_0x6498('0x48')]=_[_0x6498('0x4b')](_0x1a2bef[_0x6498('0x48')],{'$or':_[_0x6498('0x3a')](_0x1a2bef[_0x6498('0x54')],function(_0x3f4332){var _0x44e3af={};_0x44e3af[_0x3f4332]={'$like':'%'+_0x365a6b['query']['filter']+'%'};return _0x44e3af;})});}_0x1a2bef=_['merge']({},_0x1a2bef,_0x365a6b['options']);return _0x841fe8['getTeams'](_0x1a2bef);}})['then'](function(_0x585162){if(_0x585162){_0x42902f=_0x585162[_0x6498('0x44')];if(!_0x365a6b[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x1a2bef[_0x6498('0x2c')]=qs['limit'](_0x365a6b[_0x6498('0x3f')][_0x6498('0x2c')]);_0x1a2bef[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x365a6b['query'][_0x6498('0x2a')]);}return _0x841fe8[_0x6498('0x6d')](_0x1a2bef);}})[_0x6498('0x1e')](function(_0x5bc624){if(_0x5bc624){return _0x5bc624?{'count':_0x42902f,'rows':_0x5bc624}:null;}})[_0x6498('0x1e')](respondWithResult(_0x5bcead,null))[_0x6498('0x27')](handleError(_0x5bcead,null));};exports[_0x6498('0x6e')]=function(_0x12209e,_0x40aafd,_0x13347b){var _0x557d67=_0x12209e['body'][_0x6498('0x6f')];return db[_0x6498('0x70')][_0x6498('0x4f')]({'where':{'id':_0x557d67},'attributes':['id'],'include':[{'model':db[_0x6498('0x65')],'as':_0x6498('0x71'),'attributes':['id',_0x6498('0x37'),_0x6498('0x72'),_0x6498('0x73'),_0x6498('0x74')],'raw':!![]}]})[_0x6498('0x1e')](function(_0x4aa67c){if(_0x4aa67c){var _0x3fbcb1=_[_0x6498('0x75')](_0x4aa67c,function(_0x12dfdc){var _0x1ac9ac=_0x12dfdc['get']({'plain':!![]});return _0x1ac9ac[_0x6498('0x71')];});return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x12209e['params']['id']}})[_0x6498('0x1e')](function(_0x3d9d7b){return db[_0x6498('0x76')][_0x6498('0x77')](function(_0x127c54){return _0x3d9d7b[_0x6498('0x6e')](_0x557d67,{'transaction':_0x127c54})[_0x6498('0x1e')](function(){return BPromise[_0x6498('0x78')](_0x3fbcb1,function(_0x2b3f48){return db[_0x6498('0x62')][_0x6498('0x79')]({'where':{'UserId':_0x2b3f48['id'],'ChatQueueId':_0x12209e[_0x6498('0x52')]['id']},'transaction':_0x127c54});});})[_0x6498('0x1e')](function(){_0x3fbcb1[_0x6498('0x7a')](function(_0x3bafcd){socket[_0x6498('0x7b')](_0x6498('0x7c'),{'UserId':_0x3bafcd['id'],'ChatQueueId':_0x3d9d7b['id']});});});});});}})['then'](respondWithStatusCode(_0x40aafd,null))[_0x6498('0x27')](handleError(_0x40aafd,null));};exports[_0x6498('0x7d')]=function(_0x1cdade,_0x2727f7,_0x5386ed){return db[_0x6498('0x70')][_0x6498('0x4f')]({'where':{'id':_0x1cdade[_0x6498('0x3f')][_0x6498('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x6498('0x65')],'as':_0x6498('0x71'),'attributes':['id'],'raw':!![]}]})[_0x6498('0x1e')](handleEntityNotFound(_0x2727f7,null))[_0x6498('0x1e')](function(_0x5b68e3){var _0xbd3a7e=_[_0x6498('0x3a')](_0x5b68e3,'id');var _0x6ed96e=[];var _0x44bf7b=[];var _0x483032=squel[_0x6498('0x7e')]();_0x483032[_0x6498('0x7f')](_0x6498('0x80'))['from'](_0x6498('0x81'),'tq')[_0x6498('0x82')](_0x6498('0x83'),'ut',_0x6498('0x84'))['where'](_0x6498('0x85'),_0x1cdade[_0x6498('0x52')]['id']);for(var _0x5731e6=0x0;_0x5731e6<_0x5b68e3[_0x6498('0x44')];_0x5731e6+=0x1){let _0x3db3c2=_0x5b68e3[_0x5731e6];for(var _0x6105fa=0x0;_0x6105fa<_0x3db3c2[_0x6498('0x71')][_0x6498('0x44')];_0x6105fa+=0x1){let _0x566d71=_0x3db3c2[_0x6498('0x71')][_0x6105fa];var _0x43f265=_0x483032[_0x6498('0x86')]();_0x43f265[_0x6498('0x48')](_0x6498('0x87'),_0x566d71['id']);_0x44bf7b[_0x6498('0x88')](db[_0x6498('0x76')]['query'](_0x43f265[_0x6498('0x89')](),{'type':db['sequelize']['QueryTypes'][_0x6498('0x8a')]})[_0x6498('0x1e')](function(_0x5c2bc3){if(_0x5c2bc3['length']===0x1){return _0x566d71['id'];}else{var _0x2fe0cb=_[_0x6498('0x8b')](_[_0x6498('0x3a')](_0x5c2bc3,_0x6498('0x8c')),function(_0x529cc4){return _[_0x6498('0x8d')](_0xbd3a7e,_0x529cc4);});if(_0x2fe0cb){return _0x566d71['id'];}}}));}}return BPromise[_0x6498('0x8e')](_0x44bf7b)[_0x6498('0x1e')](function(_0x577e11){_0x6ed96e=_(_0x6ed96e)[_0x6498('0x8f')](_0x577e11)[_0x6498('0x90')]()[_0x6498('0x91')]();return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x1cdade['params']['id']}})[_0x6498('0x1e')](function(_0x174e03){return db['sequelize'][_0x6498('0x77')](function(_0x3260dc){return _0x174e03[_0x6498('0x7d')](_0x1cdade[_0x6498('0x3f')][_0x6498('0x6f')],{'transaction':_0x3260dc})[_0x6498('0x1e')](function(){if(!_[_0x6498('0x92')](_0x6ed96e)){return _0x174e03['removeAgents'](_0x6ed96e,{'transaction':_0x3260dc});}})[_0x6498('0x1e')](function(){_0x6ed96e[_0x6498('0x7a')](function(_0x13ce9f){socket[_0x6498('0x7b')](_0x6498('0x93'),{'UserId':_0x13ce9f,'ChatQueueId':_0x174e03['id']});});});});});});})[_0x6498('0x1e')](respondWithStatusCode(_0x2727f7,null))[_0x6498('0x27')](handleError(_0x2727f7,null));};exports[_0x6498('0x94')]=function(_0x3c7c38,_0x484df7,_0x1f2d19){return db['ChatQueue'][_0x6498('0x5c')]({'where':{'id':_0x3c7c38[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x484df7,null))[_0x6498('0x1e')](function(_0x520aa9){if(_0x520aa9){return _0x520aa9[_0x6498('0x94')](_0x3c7c38[_0x6498('0x57')][_0x6498('0x6f')],_['omit'](_0x3c7c38[_0x6498('0x57')],[_0x6498('0x6f'),'id'])||{})['spread'](function(_0x47de8){for(var _0x9388ac=0x0;_0x9388ac<_0x3c7c38[_0x6498('0x57')][_0x6498('0x6f')][_0x6498('0x44')];_0x9388ac+=0x1){socket[_0x6498('0x7b')]('userChatQueue:save',{'UserId':Number(_0x3c7c38['body']['ids'][_0x9388ac]),'ChatQueueId':Number(_0x3c7c38[_0x6498('0x52')]['id'])});}return _0x47de8;});}})[_0x6498('0x1e')](respondWithResult(_0x484df7,null))[_0x6498('0x27')](handleError(_0x484df7,null));};exports['removeAgents']=function(_0x1f5cab,_0x4550e4,_0x3bda1e){return db[_0x6498('0x4e')][_0x6498('0x5c')]({'where':{'id':_0x1f5cab['params']['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x4550e4,null))[_0x6498('0x1e')](function(_0x20f37d){if(_0x20f37d){return _0x20f37d[_0x6498('0x95')](_0x1f5cab['query']['ids'])['then'](function(){if(_[_0x6498('0x96')](_0x1f5cab['query'][_0x6498('0x6f')])){for(var _0x1c0a9b=0x0;_0x1c0a9b<_0x1f5cab[_0x6498('0x3f')][_0x6498('0x6f')][_0x6498('0x44')];_0x1c0a9b+=0x1){socket[_0x6498('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x1f5cab[_0x6498('0x3f')][_0x6498('0x6f')][_0x1c0a9b]),'ChatQueueId':Number(_0x1f5cab[_0x6498('0x52')]['id'])});}}else{socket['emit'](_0x6498('0x93'),{'UserId':Number(_0x1f5cab[_0x6498('0x3f')]['ids']),'ChatQueueId':Number(_0x1f5cab[_0x6498('0x52')]['id'])});}});}})[_0x6498('0x1e')](respondWithStatusCode(_0x4550e4,null))[_0x6498('0x27')](handleError(_0x4550e4,null));};exports[_0x6498('0x97')]=function(_0x248bf5,_0x390f37,_0x7e3990){var _0x430e91={};var _0x1153bc={};var _0x2dc1be;var _0x4bab0f;return db[_0x6498('0x4e')][_0x6498('0x6c')]({'where':{'id':_0x248bf5[_0x6498('0x52')]['id']}})[_0x6498('0x1e')](handleEntityNotFound(_0x390f37,null))[_0x6498('0x1e')](function(_0x593756){if(_0x593756){_0x2dc1be=_0x593756;_0x1153bc[_0x6498('0x41')]=_['keys'](db[_0x6498('0x65')][_0x6498('0x3b')]);_0x1153bc[_0x6498('0x3f')]=_[_0x6498('0x53')](_0x248bf5[_0x6498('0x3f')]);_0x1153bc['filters']=_['intersection'](_0x1153bc['model'],_0x1153bc['query']);_0x430e91[_0x6498('0x54')]=_[_0x6498('0x42')](_0x1153bc['model'],qs[_0x6498('0x43')](_0x248bf5[_0x6498('0x3f')][_0x6498('0x43')]));_0x430e91['attributes']=_0x430e91['attributes']['length']?_0x430e91[_0x6498('0x54')]:_0x1153bc['model'];_0x430e91['order']=qs[_0x6498('0x47')](_0x248bf5[_0x6498('0x3f')][_0x6498('0x47')]);_0x430e91['where']=qs[_0x6498('0x40')](_[_0x6498('0x49')](_0x248bf5[_0x6498('0x3f')],_0x1153bc[_0x6498('0x40')]));if(_0x248bf5[_0x6498('0x3f')][_0x6498('0x4a')]){_0x430e91[_0x6498('0x48')]=_['merge'](_0x430e91[_0x6498('0x48')],{'$or':_[_0x6498('0x3a')](_0x430e91[_0x6498('0x54')],function(_0x4bc624){var _0x264a42={};_0x264a42[_0x4bc624]={'$like':'%'+_0x248bf5['query'][_0x6498('0x4a')]+'%'};return _0x264a42;})});}_0x430e91=_[_0x6498('0x4b')]({},_0x430e91,_0x248bf5[_0x6498('0x98')]);return _0x2dc1be['getAgents'](_0x430e91);}})[_0x6498('0x1e')](function(_0x115e20){if(_0x115e20){_0x4bab0f=_0x115e20[_0x6498('0x44')];if(!_0x248bf5[_0x6498('0x3f')][_0x6498('0x45')](_0x6498('0x63'))){_0x430e91[_0x6498('0x2c')]=qs[_0x6498('0x2c')](_0x248bf5['query'][_0x6498('0x2c')]);_0x430e91[_0x6498('0x2a')]=qs[_0x6498('0x2a')](_0x248bf5[_0x6498('0x3f')]['offset']);}return _0x2dc1be['getAgents'](_0x430e91);}})[_0x6498('0x1e')](function(_0x4a9d01){if(_0x4a9d01){return _0x4a9d01?{'count':_0x4bab0f,'rows':_0x4a9d01}:null;}})[_0x6498('0x1e')](respondWithResult(_0x390f37,null))[_0x6498('0x27')](handleError(_0x390f37,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 386e0d4..e6214ea 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 _0x37cb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x2440df,_0x453be8){var _0x1fa6fb=function(_0x1e0417){while(--_0x1e0417){_0x2440df['push'](_0x2440df['shift']());}};_0x1fa6fb(++_0x453be8);}(_0x37cb,0x12d));var _0xb37c=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x37cb[_0x9fd887];return _0x1a54ab;};'use strict';var EventEmitter=require(_0xb37c('0x0'));var ChatQueue=require(_0xb37c('0x1'))['db'][_0xb37c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb37c('0x3')](0x0);var events={'afterCreate':_0xb37c('0x4'),'afterUpdate':_0xb37c('0x5'),'afterDestroy':_0xb37c('0x6')};function emitEvent(_0x599668){return function(_0x4afd86,_0xe3fad,_0x2ebee6){ChatQueueEvents[_0xb37c('0x7')](_0x599668+':'+_0x4afd86['id'],_0x4afd86);ChatQueueEvents[_0xb37c('0x7')](_0x599668,_0x4afd86);_0x2ebee6(null);};}for(var e in events){if(events[_0xb37c('0x8')](e)){var event=events[e];ChatQueue[_0xb37c('0x9')](e,emitEvent(event));}}module[_0xb37c('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xe39c=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x34357e,_0x5af72a){var _0x488189=function(_0xa54a00){while(--_0xa54a00){_0x34357e['push'](_0x34357e['shift']());}};_0x488189(++_0x5af72a);}(_0xe39c,0x136));var _0xce39=function(_0x2ce6a7,_0x4d5a8e){_0x2ce6a7=_0x2ce6a7-0x0;var _0xd1d644=_0xe39c[_0x2ce6a7];return _0xd1d644;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xce39('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xce39('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4333a4){return function(_0x1c0ca2,_0x1e078c,_0x111082){ChatQueueEvents[_0xce39('0x2')](_0x4333a4+':'+_0x1c0ca2['id'],_0x1c0ca2);ChatQueueEvents[_0xce39('0x2')](_0x4333a4,_0x1c0ca2);_0x111082(null);};}for(var e in events){if(events[_0xce39('0x3')](e)){var event=events[e];ChatQueue[_0xce39('0x4')](e,emitEvent(event));}}module[_0xce39('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 47e2b85..df9f421 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 _0x380f=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','bluebird','rimraf'];(function(_0x43d06a,_0x2d46b6){var _0x4bd34f=function(_0x33a70b){while(--_0x33a70b){_0x43d06a['push'](_0x43d06a['shift']());}};_0x4bd34f(++_0x2d46b6);}(_0x380f,0x1c5));var _0xf380=function(_0x10f76a,_0x49542e){_0x10f76a=_0x10f76a-0x0;var _0x48540c=_0x380f[_0x10f76a];return _0x48540c;};'use strict';var _=require(_0xf380('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf380('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf380('0x2'));var config=require(_0xf380('0x3'));var attributes=require(_0xf380('0x4'));module[_0xf380('0x5')]=function(_0x1cce88,_0x4d1598){return _0x1cce88[_0xf380('0x6')](_0xf380('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3469=['chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','ChatQueue'];(function(_0x2a14ac,_0x17b35d){var _0x506656=function(_0x4b26b8){while(--_0x4b26b8){_0x2a14ac['push'](_0x2a14ac['shift']());}};_0x506656(++_0x17b35d);}(_0x3469,0x90));var _0x9346=function(_0x2ce0c7,_0x708abd){_0x2ce0c7=_0x2ce0c7-0x0;var _0x15a5be=_0x3469[_0x2ce0c7];return _0x15a5be;};'use strict';var _=require('lodash');var util=require(_0x9346('0x0'));var logger=require(_0x9346('0x1'))(_0x9346('0x2'));var moment=require(_0x9346('0x3'));var BPromise=require(_0x9346('0x4'));var rp=require(_0x9346('0x5'));var fs=require('fs');var path=require(_0x9346('0x6'));var rimraf=require('rimraf');var config=require(_0x9346('0x7'));var attributes=require(_0x9346('0x8'));module['exports']=function(_0x1d56ab,_0x1546b5){return _0x1d56ab['define'](_0x9346('0x9'),attributes,{'tableName':_0x9346('0xa'),'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 304e3ab..dd1f232 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 _0x2f56=['request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f56,0xb5));var _0x62f5=function(_0x376edd,_0x320a46){_0x376edd=_0x376edd-0x0;var _0x123ee3=_0x2f56[_0x376edd];return _0x123ee3;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});config[_0x62f5('0xc')]=_['defaults'](config[_0x62f5('0xc')],{'host':_0x62f5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62f5('0xc')]));require(_0x62f5('0xe'))['register'](socket);function respondWithRpcPromise(_0x2150bd,_0x1be97f,_0xceb497){return new BPromise(function(_0x58323f,_0x576754){return client[_0x62f5('0xf')](_0x2150bd,_0xceb497)[_0x62f5('0x10')](function(_0x151753){logger[_0x62f5('0x11')](_0x62f5('0x12'),_0x1be97f,_0x62f5('0x13'));logger[_0x62f5('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'),JSON['stringify'](_0x151753));if(_0x151753[_0x62f5('0x15')]){if(_0x151753[_0x62f5('0x15')][_0x62f5('0x16')]===0x1f4){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x151753[_0x62f5('0x15')]['message']);return _0x576754(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}logger[_0x62f5('0x15')](_0x62f5('0x12'),_0x1be97f,_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);return _0x58323f(_0x151753[_0x62f5('0x15')][_0x62f5('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x62f5('0x13'));_0x58323f(_0x151753[_0x62f5('0x18')]['message']);}})[_0x62f5('0x19')](function(_0x29754f){logger[_0x62f5('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1be97f,_0x29754f);_0x576754(_0x29754f);});});}exports[_0x62f5('0x1a')]=function(_0x160129){var _0x15a397=this;return new Promise(function(_0x5de28a,_0x52fdf6){return db[_0x62f5('0x1b')][_0x62f5('0x1c')]({'raw':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x20')]||null:null,'limit':_0x160129['options']?_0x160129['options'][_0x62f5('0x21')]||null:null,'include':_0x160129[_0x62f5('0x1d')]?_0x160129[_0x62f5('0x1d')][_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x160129[_0x62f5('0x1d')]['include'],function(_0x28e94a){return{'model':db[_0x28e94a['model']],'as':_0x28e94a['as'],'attributes':_0x28e94a[_0x62f5('0x20')],'include':_0x28e94a['include']?_[_0x62f5('0x23')](_0x28e94a[_0x62f5('0x22')],function(_0x131832){return{'model':db[_0x131832[_0x62f5('0x24')]],'as':_0x131832['as'],'attributes':_0x131832[_0x62f5('0x20')],'include':_0x131832[_0x62f5('0x22')]?_[_0x62f5('0x23')](_0x131832['include'],function(_0x21d2c1){return{'model':db[_0x21d2c1['model']],'as':_0x21d2c1['as'],'attributes':_0x21d2c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2426c7){logger[_0x62f5('0x11')](_0x62f5('0x1a'),_0x160129);logger[_0x62f5('0x14')](_0x62f5('0x1a'),_0x160129,JSON[_0x62f5('0x25')](_0x2426c7));_0x5de28a(_0x2426c7);})['catch'](function(_0x12f805){logger[_0x62f5('0x15')](_0x62f5('0x1a'),_0x12f805[_0x62f5('0x17')],_0x160129);_0x52fdf6(_0x15a397[_0x62f5('0x15')](0x1f4,_0x12f805[_0x62f5('0x17')]));});});};exports['ShowChatQueue']=function(_0x177f89){var _0x511421=this;return new Promise(function(_0x1d2541,_0xa08740){return db['ChatQueue'][_0x62f5('0x26')]({'raw':_0x177f89['options']?_0x177f89['options'][_0x62f5('0x1e')]===undefined?!![]:![]:!![],'where':_0x177f89['options']?_0x177f89[_0x62f5('0x1d')][_0x62f5('0x1f')]||null:null,'attributes':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['attributes']||null:null,'include':_0x177f89[_0x62f5('0x1d')]?_0x177f89['options']['include']?_[_0x62f5('0x23')](_0x177f89[_0x62f5('0x1d')]['include'],function(_0x1a277f){return{'model':db[_0x1a277f[_0x62f5('0x24')]],'as':_0x1a277f['as'],'attributes':_0x1a277f[_0x62f5('0x20')],'include':_0x1a277f[_0x62f5('0x22')]?_['map'](_0x1a277f[_0x62f5('0x22')],function(_0x4f6e7d){return{'model':db[_0x4f6e7d[_0x62f5('0x24')]],'as':_0x4f6e7d['as'],'attributes':_0x4f6e7d[_0x62f5('0x20')],'include':_0x4f6e7d[_0x62f5('0x22')]?_['map'](_0x4f6e7d[_0x62f5('0x22')],function(_0x2e4712){return{'model':db[_0x2e4712['model']],'as':_0x2e4712['as'],'attributes':_0x2e4712['attributes']};}):[]};}):[]};}):[]:[]})[_0x62f5('0x10')](function(_0x5ad95d){logger['info']('ShowChatQueue',_0x177f89);logger[_0x62f5('0x14')](_0x62f5('0x27'),_0x177f89,JSON[_0x62f5('0x25')](_0x5ad95d));_0x1d2541(_0x5ad95d);})[_0x62f5('0x19')](function(_0x23edf0){logger['error'](_0x62f5('0x27'),_0x23edf0['message'],_0x177f89);_0xa08740(_0x511421[_0x62f5('0x15')](0x1f4,_0x23edf0[_0x62f5('0x17')]));});});}; \ No newline at end of file +var _0x9ccd=['ChatQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowChatQueue','ChatQueue','find','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x25d1e1,_0x3911ff){var _0xb75e99=function(_0x5e50ce){while(--_0x5e50ce){_0x25d1e1['push'](_0x25d1e1['shift']());}};_0xb75e99(++_0x3911ff);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9cc('0x4'))(_0xd9cc('0x5'));var config=require(_0xd9cc('0x6'));var jayson=require(_0xd9cc('0x7'));var client=jayson[_0xd9cc('0x8')][_0xd9cc('0x9')]({'port':0x232a});config[_0xd9cc('0xa')]=_[_0xd9cc('0xb')](config[_0xd9cc('0xa')],{'host':_0xd9cc('0xc'),'port':0x18eb});var socket=require(_0xd9cc('0xd'))(new Redis(config[_0xd9cc('0xa')]));require(_0xd9cc('0xe'))[_0xd9cc('0xf')](socket);function respondWithRpcPromise(_0xd731e1,_0x383bd4,_0x546ffb){return new BPromise(function(_0x46149b,_0x2b17db){return client[_0xd9cc('0x10')](_0xd731e1,_0x546ffb)[_0xd9cc('0x11')](function(_0x2e8a08){logger[_0xd9cc('0x12')](_0xd9cc('0x13'),_0x383bd4,_0xd9cc('0x14'));logger['debug'](_0xd9cc('0x15'),_0x383bd4,'request\x20sent',JSON['stringify'](_0x2e8a08));if(_0x2e8a08['error']){if(_0x2e8a08['error']['code']===0x1f4){logger[_0xd9cc('0x16')](_0xd9cc('0x13'),_0x383bd4,_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);return _0x2b17db(_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);}logger[_0xd9cc('0x16')]('ChatQueue,\x20%s,\x20%s',_0x383bd4,_0x2e8a08[_0xd9cc('0x16')][_0xd9cc('0x17')]);return _0x46149b(_0x2e8a08['error'][_0xd9cc('0x17')]);}else{logger[_0xd9cc('0x12')](_0xd9cc('0x13'),_0x383bd4,_0xd9cc('0x14'));_0x46149b(_0x2e8a08['result'][_0xd9cc('0x17')]);}})[_0xd9cc('0x18')](function(_0x4fa645){logger[_0xd9cc('0x16')](_0xd9cc('0x13'),_0x383bd4,_0x4fa645);_0x2b17db(_0x4fa645);});});}exports[_0xd9cc('0x19')]=function(_0x4707e3){var _0x471c05=this;return new Promise(function(_0xd69057,_0x59f00d){return db['ChatQueue'][_0xd9cc('0x1a')]({'raw':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1d')]||null:null,'attributes':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1e')]||null:null,'limit':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3[_0xd9cc('0x1b')][_0xd9cc('0x1f')]||null:null,'include':_0x4707e3[_0xd9cc('0x1b')]?_0x4707e3['options'][_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x4707e3['options'][_0xd9cc('0x20')],function(_0x1f2727){return{'model':db[_0x1f2727[_0xd9cc('0x22')]],'as':_0x1f2727['as'],'attributes':_0x1f2727[_0xd9cc('0x1e')],'include':_0x1f2727[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x1f2727[_0xd9cc('0x20')],function(_0xa61ac2){return{'model':db[_0xa61ac2[_0xd9cc('0x22')]],'as':_0xa61ac2['as'],'attributes':_0xa61ac2['attributes'],'include':_0xa61ac2[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0xa61ac2[_0xd9cc('0x20')],function(_0x381b83){return{'model':db[_0x381b83[_0xd9cc('0x22')]],'as':_0x381b83['as'],'attributes':_0x381b83[_0xd9cc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd9cc('0x11')](function(_0x10a7b1){logger['info'](_0xd9cc('0x19'),_0x4707e3);logger[_0xd9cc('0x23')](_0xd9cc('0x19'),_0x4707e3,JSON[_0xd9cc('0x24')](_0x10a7b1));_0xd69057(_0x10a7b1);})[_0xd9cc('0x18')](function(_0x2e147a){logger['error'](_0xd9cc('0x19'),_0x2e147a['message'],_0x4707e3);_0x59f00d(_0x471c05['error'](0x1f4,_0x2e147a[_0xd9cc('0x17')]));});});};exports[_0xd9cc('0x25')]=function(_0x3326ff){var _0x4b20a4=this;return new Promise(function(_0x2b1b5e,_0x4c0c08){return db[_0xd9cc('0x26')][_0xd9cc('0x27')]({'raw':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff['options'][_0xd9cc('0x1c')]===undefined?!![]:![]:!![],'where':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')]['where']||null:null,'attributes':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')][_0xd9cc('0x1e')]||null:null,'include':_0x3326ff[_0xd9cc('0x1b')]?_0x3326ff[_0xd9cc('0x1b')][_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x3326ff['options'][_0xd9cc('0x20')],function(_0x1b9e5c){return{'model':db[_0x1b9e5c[_0xd9cc('0x22')]],'as':_0x1b9e5c['as'],'attributes':_0x1b9e5c['attributes'],'include':_0x1b9e5c[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x1b9e5c[_0xd9cc('0x20')],function(_0x166085){return{'model':db[_0x166085['model']],'as':_0x166085['as'],'attributes':_0x166085[_0xd9cc('0x1e')],'include':_0x166085[_0xd9cc('0x20')]?_[_0xd9cc('0x21')](_0x166085[_0xd9cc('0x20')],function(_0x326441){return{'model':db[_0x326441[_0xd9cc('0x22')]],'as':_0x326441['as'],'attributes':_0x326441[_0xd9cc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd9cc('0x11')](function(_0x42fa8a){logger[_0xd9cc('0x12')](_0xd9cc('0x25'),_0x3326ff);logger['debug'](_0xd9cc('0x25'),_0x3326ff,JSON[_0xd9cc('0x24')](_0x42fa8a));_0x2b1b5e(_0x42fa8a);})[_0xd9cc('0x18')](function(_0x1667c3){logger[_0xd9cc('0x16')](_0xd9cc('0x25'),_0x1667c3['message'],_0x3326ff);_0x4c0c08(_0x4b20a4[_0xd9cc('0x16')](0x1f4,_0x1667c3[_0xd9cc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ed411f8..a8fcb29 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 _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x529111,_0x5988fd){var _0x5afa9a=function(_0x46a0bc){while(--_0x46a0bc){_0x529111['push'](_0x529111['shift']());}};_0x5afa9a(++_0x5988fd);}(_0xbd50,0x196));var _0x0bd5=function(_0x523b6c,_0x1f102c){_0x523b6c=_0x523b6c-0x0;var _0x4f6771=_0xbd50[_0x523b6c];return _0x4f6771;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}}; \ No newline at end of file +var _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x1a189c,_0x460fb7){var _0x2c97a6=function(_0x396728){while(--_0x396728){_0x1a189c['push'](_0x1a189c['shift']());}};_0x2c97a6(++_0x460fb7);}(_0x579c,0xda));var _0xc579=function(_0x39c7bc,_0x52cbca){_0x39c7bc=_0x39c7bc-0x0;var _0x3aaed4=_0x579c[_0x39c7bc];return _0x3aaed4;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ec61e33..b020359 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x189ba7,_0x46a2cf){_0x189ba7=_0x189ba7-0x0;var _0x574ebe=_0x3e74[_0x189ba7];return _0x574ebe;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x560a06,_0x41d936){var _0x1a72eb=function(_0x3d0ce2){while(--_0x3d0ce2){_0x560a06['push'](_0x560a06['shift']());}};_0x1a72eb(++_0x41d936);}(_0x814b,0x1a2));var _0xb814=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0x814b[_0x48c2ae];return _0x8f7531;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index bf4d5e6..00d51f9 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 _0x4fed=['STRING','DATE','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4fed,0x107));var _0xd4fe=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x4fed[_0x946518];return _0x909b69;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd4fe('0x0')]={'uniqueid':{'type':Sequelize[_0xd4fe('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4fe('0x2')]},'leaveAt':{'type':Sequelize[_0xd4fe('0x2')]},'acceptAt':{'type':Sequelize[_0xd4fe('0x2')]},'exitAt':{'type':Sequelize[_0xd4fe('0x2')]},'reason':{'type':Sequelize[_0xd4fe('0x1')]}}; \ No newline at end of file +var _0xdd04=['STRING','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x4dd0('0x0'));module[_0x4dd0('0x1')]={'uniqueid':{'type':Sequelize[_0x4dd0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4dd0('0x2')]},'joinAt':{'type':Sequelize[_0x4dd0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4dd0('0x3')]},'exitAt':{'type':Sequelize[_0x4dd0('0x3')]},'reason':{'type':Sequelize[_0x4dd0('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7a34795..86cbf11 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 _0x0024=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','fast-json-patch','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','rawAttributes','key','model','map','query','keys'];(function(_0x48aca4,_0x470f4f){var _0x39af1b=function(_0x53cf6f){while(--_0x53cf6f){_0x48aca4['push'](_0x48aca4['shift']());}};_0x39af1b(++_0x470f4f);}(_0x0024,0xa8));var _0x4002=function(_0x373d0a,_0x3075d6){_0x373d0a=_0x373d0a-0x0;var _0x2b9b88=_0x0024[_0x373d0a];return _0x2b9b88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4002('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4002('0x1'));var rp=require('request-promise');var moment=require(_0x4002('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4002('0x3'));var path=require(_0x4002('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4002('0x5'));var fs=require('fs');var fs_extra=require(_0x4002('0x6'));var _=require(_0x4002('0x7'));var squel=require(_0x4002('0x8'));var crypto=require('crypto');var jsforce=require(_0x4002('0x9'));var deskjs=require(_0x4002('0xa'));var toCsv=require(_0x4002('0xb'));var querystring=require(_0x4002('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4002('0xd'));var qs=require(_0x4002('0xe'));var as=require(_0x4002('0xf'));var hardwareService=require(_0x4002('0x10'));var logger=require(_0x4002('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4002('0x12'));var db=require(_0x4002('0x13'))['db'];function respondWithStatusCode(_0x1607e1,_0x29705c){_0x29705c=_0x29705c||0xcc;return function(_0x51c3cf){if(_0x51c3cf){return _0x1607e1[_0x4002('0x14')](_0x29705c);}return _0x1607e1[_0x4002('0x15')](_0x29705c)[_0x4002('0x16')]();};}function respondWithResult(_0x2db141,_0x46d1c1){_0x46d1c1=_0x46d1c1||0xc8;return function(_0x50a1a8){if(_0x50a1a8){return _0x2db141[_0x4002('0x15')](_0x46d1c1)['json'](_0x50a1a8);}};}function respondWithFilteredResult(_0x2f512d,_0x9631cb){return function(_0x213c05){if(_0x213c05){var _0x5813ff=typeof _0x9631cb[_0x4002('0x17')]==='undefined'&&typeof _0x9631cb['limit']===_0x4002('0x18');var _0x3facc1=_0x213c05['count'];var _0x1b3401=_0x5813ff?0x0:_0x9631cb['offset'];var _0x553918=_0x5813ff?_0x213c05['count']:_0x9631cb[_0x4002('0x17')]+_0x9631cb[_0x4002('0x19')];var _0x283708;if(_0x553918>=_0x3facc1){_0x553918=_0x3facc1;_0x283708=0xc8;}else{_0x283708=0xce;}_0x2f512d[_0x4002('0x15')](_0x283708);return _0x2f512d['set'](_0x4002('0x1a'),_0x1b3401+'-'+_0x553918+'/'+_0x3facc1)[_0x4002('0x1b')](_0x213c05);}return null;};}function patchUpdates(_0x172317){return function(_0x48ac6f){try{jsonpatch[_0x4002('0x1c')](_0x48ac6f,_0x172317,!![]);}catch(_0x51b709){return BPromise[_0x4002('0x1d')](_0x51b709);}return _0x48ac6f[_0x4002('0x1e')]();};}function saveUpdates(_0x2bc0c4,_0x5f29cb){return function(_0x52add8){if(_0x52add8){return _0x52add8[_0x4002('0x1f')](_0x2bc0c4)[_0x4002('0x20')](function(_0x254b67){return _0x254b67;});}return null;};}function removeEntity(_0x4c0ed7,_0x468d6e){return function(_0x27732c){if(_0x27732c){return _0x27732c[_0x4002('0x21')]()[_0x4002('0x20')](function(){_0x4c0ed7[_0x4002('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3396d8,_0x1dfb81){return function(_0x385c35){if(!_0x385c35){_0x3396d8[_0x4002('0x14')](0x194);}return _0x385c35;};}function handleError(_0x31c601,_0x2087d5){_0x2087d5=_0x2087d5||0x1f4;return function(_0x55aca1){logger[_0x4002('0x22')](_0x55aca1[_0x4002('0x23')]);if(_0x55aca1['name']){delete _0x55aca1[_0x4002('0x24')];}_0x31c601[_0x4002('0x15')](_0x2087d5)['send'](_0x55aca1);};}exports[_0x4002('0x25')]=function(_0x278907,_0x227fc8){var _0x13a8f7={},_0x6e9b00={},_0x37ee79={'count':0x0,'rows':[]};var _0x153f1f=_['map'](db[_0x4002('0x26')][_0x4002('0x27')],function(_0x237704){return{'name':_0x237704['fieldName'],'type':_0x237704['type'][_0x4002('0x28')]};});_0x6e9b00[_0x4002('0x29')]=_[_0x4002('0x2a')](_0x153f1f,_0x4002('0x24'));_0x6e9b00[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x278907[_0x4002('0x2b')]);_0x6e9b00[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],_0x6e9b00['query']);_0x13a8f7[_0x4002('0x2f')]=_[_0x4002('0x2e')](_0x6e9b00[_0x4002('0x29')],qs['fields'](_0x278907[_0x4002('0x2b')][_0x4002('0x30')]));_0x13a8f7[_0x4002('0x2f')]=_0x13a8f7['attributes'][_0x4002('0x31')]?_0x13a8f7[_0x4002('0x2f')]:_0x6e9b00[_0x4002('0x29')];if(!_0x278907[_0x4002('0x2b')][_0x4002('0x32')](_0x4002('0x33'))){_0x13a8f7[_0x4002('0x19')]=qs['limit'](_0x278907[_0x4002('0x2b')][_0x4002('0x19')]);_0x13a8f7['offset']=qs['offset'](_0x278907[_0x4002('0x2b')][_0x4002('0x17')]);}_0x13a8f7[_0x4002('0x34')]=qs[_0x4002('0x35')](_0x278907[_0x4002('0x2b')][_0x4002('0x35')]);_0x13a8f7[_0x4002('0x36')]=qs[_0x4002('0x2d')](_['pick'](_0x278907[_0x4002('0x2b')],_0x6e9b00[_0x4002('0x2d')]),_0x153f1f);if(_0x278907[_0x4002('0x2b')]['filter']){_0x13a8f7[_0x4002('0x36')]=_['merge'](_0x13a8f7[_0x4002('0x36')],{'$or':_['map'](_0x153f1f,function(_0x499bb0){if(_0x499bb0['type']!==_0x4002('0x37')){var _0x51d828={};_0x51d828[_0x499bb0['name']]={'$like':'%'+_0x278907['query'][_0x4002('0x38')]+'%'};return _0x51d828;}})});}_0x13a8f7=_[_0x4002('0x39')]({},_0x13a8f7,_0x278907[_0x4002('0x3a')]);var _0x5d65c1={'where':_0x13a8f7[_0x4002('0x36')]};return db[_0x4002('0x26')][_0x4002('0x3b')](_0x5d65c1)[_0x4002('0x20')](function(_0x14f2f1){_0x37ee79[_0x4002('0x3b')]=_0x14f2f1;if(_0x278907['query'][_0x4002('0x3c')]){_0x13a8f7[_0x4002('0x3d')]=[{'all':!![]}];}return db[_0x4002('0x26')][_0x4002('0x3e')](_0x13a8f7);})[_0x4002('0x20')](function(_0x579e24){_0x37ee79[_0x4002('0x3f')]=_0x579e24;return _0x37ee79;})['then'](respondWithFilteredResult(_0x227fc8,_0x13a8f7))[_0x4002('0x40')](handleError(_0x227fc8,null));};exports[_0x4002('0x41')]=function(_0x488875,_0x5810b4){var _0x39dfba={'raw':!![],'where':{'id':_0x488875['params']['id']}},_0xb0bb62={};_0xb0bb62['model']=_[_0x4002('0x2c')](db[_0x4002('0x26')]['rawAttributes']);_0xb0bb62[_0x4002('0x2b')]=_[_0x4002('0x2c')](_0x488875[_0x4002('0x2b')]);_0xb0bb62[_0x4002('0x2d')]=_[_0x4002('0x2e')](_0xb0bb62[_0x4002('0x29')],_0xb0bb62[_0x4002('0x2b')]);_0x39dfba[_0x4002('0x2f')]=_['intersection'](_0xb0bb62['model'],qs['fields'](_0x488875[_0x4002('0x2b')]['fields']));_0x39dfba[_0x4002('0x2f')]=_0x39dfba['attributes'][_0x4002('0x31')]?_0x39dfba[_0x4002('0x2f')]:_0xb0bb62[_0x4002('0x29')];if(_0x488875['query'][_0x4002('0x3c')]){_0x39dfba['include']=[{'all':!![]}];}_0x39dfba=_['merge']({},_0x39dfba,_0x488875[_0x4002('0x3a')]);return db[_0x4002('0x26')][_0x4002('0x42')](_0x39dfba)[_0x4002('0x20')](handleEntityNotFound(_0x5810b4,null))['then'](respondWithResult(_0x5810b4,null))['catch'](handleError(_0x5810b4,null));};exports[_0x4002('0x43')]=function(_0x27bbb2,_0x424f9b){return db['ChatQueueReport'][_0x4002('0x43')](_0x27bbb2['body'],{})[_0x4002('0x20')](respondWithResult(_0x424f9b,0xc9))['catch'](handleError(_0x424f9b,null));};exports['update']=function(_0x25d4db,_0x2c95e2){if(_0x25d4db['body']['id']){delete _0x25d4db[_0x4002('0x44')]['id'];}return db[_0x4002('0x26')][_0x4002('0x42')]({'where':{'id':_0x25d4db[_0x4002('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c95e2,null))['then'](saveUpdates(_0x25d4db[_0x4002('0x44')],null))['then'](respondWithResult(_0x2c95e2,null))['catch'](handleError(_0x2c95e2,null));};exports['destroy']=function(_0xe374cb,_0x1ac24b){return db['ChatQueueReport'][_0x4002('0x42')]({'where':{'id':_0xe374cb[_0x4002('0x45')]['id']}})[_0x4002('0x20')](handleEntityNotFound(_0x1ac24b,null))[_0x4002('0x20')](removeEntity(_0x1ac24b,null))[_0x4002('0x40')](handleError(_0x1ac24b,null));};exports[_0x4002('0x46')]=function(_0x500af3,_0x450660){return db[_0x4002('0x26')]['describe']()[_0x4002('0x20')](respondWithResult(_0x450660,null))[_0x4002('0x40')](handleError(_0x450660,null));}; \ No newline at end of file +var _0xc319=['zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatQueueReport','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','describe','eml-format','rimraf'];(function(_0x21a60b,_0x23cd68){var _0x170b5f=function(_0x2f813b){while(--_0x2f813b){_0x21a60b['push'](_0x21a60b['shift']());}};_0x170b5f(++_0x23cd68);}(_0xc319,0x12e));var _0x9c31=function(_0x34cd7c,_0x53b0c0){_0x34cd7c=_0x34cd7c-0x0;var _0x2b167a=_0xc319[_0x34cd7c];return _0x2b167a;};'use strict';var emlformat=require(_0x9c31('0x0'));var rimraf=require(_0x9c31('0x1'));var zipdir=require(_0x9c31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c31('0x5'));var util=require(_0x9c31('0x6'));var path=require(_0x9c31('0x7'));var sox=require(_0x9c31('0x8'));var csv=require('to-csv');var ejs=require(_0x9c31('0x9'));var fs=require('fs');var fs_extra=require(_0x9c31('0xa'));var _=require(_0x9c31('0xb'));var squel=require(_0x9c31('0xc'));var crypto=require(_0x9c31('0xd'));var jsforce=require(_0x9c31('0xe'));var deskjs=require(_0x9c31('0xf'));var toCsv=require(_0x9c31('0x10'));var querystring=require(_0x9c31('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c31('0x12'));var as=require(_0x9c31('0x13'));var hardwareService=require(_0x9c31('0x14'));var logger=require(_0x9c31('0x15'))(_0x9c31('0x16'));var utils=require('../../config/utils');var config=require(_0x9c31('0x17'));var licenseUtil=require(_0x9c31('0x18'));var db=require(_0x9c31('0x19'))['db'];function respondWithStatusCode(_0x4d0175,_0x2012b1){_0x2012b1=_0x2012b1||0xcc;return function(_0x30fc7f){if(_0x30fc7f){return _0x4d0175[_0x9c31('0x1a')](_0x2012b1);}return _0x4d0175[_0x9c31('0x1b')](_0x2012b1)[_0x9c31('0x1c')]();};}function respondWithResult(_0x4d9601,_0x52037f){_0x52037f=_0x52037f||0xc8;return function(_0x513815){if(_0x513815){return _0x4d9601['status'](_0x52037f)['json'](_0x513815);}};}function respondWithFilteredResult(_0x13ba85,_0xb2e9b9){return function(_0x57a4ff){if(_0x57a4ff){var _0x3df9ad=typeof _0xb2e9b9[_0x9c31('0x1d')]===_0x9c31('0x1e')&&typeof _0xb2e9b9[_0x9c31('0x1f')]===_0x9c31('0x1e');var _0x5eec43=_0x57a4ff[_0x9c31('0x20')];var _0x47b5a7=_0x3df9ad?0x0:_0xb2e9b9[_0x9c31('0x1d')];var _0x4aacad=_0x3df9ad?_0x57a4ff[_0x9c31('0x20')]:_0xb2e9b9['offset']+_0xb2e9b9[_0x9c31('0x1f')];var _0x3ae089;if(_0x4aacad>=_0x5eec43){_0x4aacad=_0x5eec43;_0x3ae089=0xc8;}else{_0x3ae089=0xce;}_0x13ba85[_0x9c31('0x1b')](_0x3ae089);return _0x13ba85['set'](_0x9c31('0x21'),_0x47b5a7+'-'+_0x4aacad+'/'+_0x5eec43)[_0x9c31('0x22')](_0x57a4ff);}return null;};}function patchUpdates(_0x417360){return function(_0x4f8363){try{jsonpatch[_0x9c31('0x23')](_0x4f8363,_0x417360,!![]);}catch(_0x34eca6){return BPromise['reject'](_0x34eca6);}return _0x4f8363[_0x9c31('0x24')]();};}function saveUpdates(_0x297bc0,_0x316917){return function(_0x9fb534){if(_0x9fb534){return _0x9fb534['update'](_0x297bc0)[_0x9c31('0x25')](function(_0x3f66ee){return _0x3f66ee;});}return null;};}function removeEntity(_0x456d29,_0x438a05){return function(_0x3cfeba){if(_0x3cfeba){return _0x3cfeba[_0x9c31('0x26')]()[_0x9c31('0x25')](function(){_0x456d29['status'](0xcc)[_0x9c31('0x1c')]();});}};}function handleEntityNotFound(_0x1b9600,_0x2b9cd2){return function(_0x28297e){if(!_0x28297e){_0x1b9600[_0x9c31('0x1a')](0x194);}return _0x28297e;};}function handleError(_0x3a9b00,_0x5206c2){_0x5206c2=_0x5206c2||0x1f4;return function(_0x183916){logger['error'](_0x183916['stack']);if(_0x183916[_0x9c31('0x27')]){delete _0x183916[_0x9c31('0x27')];}_0x3a9b00[_0x9c31('0x1b')](_0x5206c2)[_0x9c31('0x28')](_0x183916);};}exports['index']=function(_0xa43ac0,_0x1273dd){var _0x30e8c3={},_0x2f7208={},_0x294039={'count':0x0,'rows':[]};var _0x8f7f55=_[_0x9c31('0x29')](db['ChatQueueReport'][_0x9c31('0x2a')],function(_0x2acfca){return{'name':_0x2acfca[_0x9c31('0x2b')],'type':_0x2acfca[_0x9c31('0x2c')][_0x9c31('0x2d')]};});_0x2f7208[_0x9c31('0x2e')]=_[_0x9c31('0x29')](_0x8f7f55,_0x9c31('0x27'));_0x2f7208[_0x9c31('0x2f')]=_[_0x9c31('0x30')](_0xa43ac0[_0x9c31('0x2f')]);_0x2f7208[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x2f7208['model'],_0x2f7208['query']);_0x30e8c3[_0x9c31('0x33')]=_[_0x9c31('0x32')](_0x2f7208[_0x9c31('0x2e')],qs[_0x9c31('0x34')](_0xa43ac0['query'][_0x9c31('0x34')]));_0x30e8c3[_0x9c31('0x33')]=_0x30e8c3[_0x9c31('0x33')][_0x9c31('0x35')]?_0x30e8c3[_0x9c31('0x33')]:_0x2f7208[_0x9c31('0x2e')];if(!_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x36')]('nolimit')){_0x30e8c3[_0x9c31('0x1f')]=qs[_0x9c31('0x1f')](_0xa43ac0[_0x9c31('0x2f')]['limit']);_0x30e8c3[_0x9c31('0x1d')]=qs[_0x9c31('0x1d')](_0xa43ac0[_0x9c31('0x2f')]['offset']);}_0x30e8c3[_0x9c31('0x37')]=qs[_0x9c31('0x38')](_0xa43ac0['query']['sort']);_0x30e8c3[_0x9c31('0x39')]=qs[_0x9c31('0x31')](_[_0x9c31('0x3a')](_0xa43ac0[_0x9c31('0x2f')],_0x2f7208[_0x9c31('0x31')]),_0x8f7f55);if(_0xa43ac0[_0x9c31('0x2f')]['filter']){_0x30e8c3[_0x9c31('0x39')]=_['merge'](_0x30e8c3[_0x9c31('0x39')],{'$or':_[_0x9c31('0x29')](_0x8f7f55,function(_0xc52dbd){if(_0xc52dbd[_0x9c31('0x2c')]!==_0x9c31('0x3b')){var _0x393439={};_0x393439[_0xc52dbd['name']]={'$like':'%'+_0xa43ac0['query'][_0x9c31('0x3c')]+'%'};return _0x393439;}})});}_0x30e8c3=_[_0x9c31('0x3d')]({},_0x30e8c3,_0xa43ac0[_0x9c31('0x3e')]);var _0x3939a9={'where':_0x30e8c3[_0x9c31('0x39')]};return db[_0x9c31('0x3f')][_0x9c31('0x20')](_0x3939a9)[_0x9c31('0x25')](function(_0x2bb1ab){_0x294039['count']=_0x2bb1ab;if(_0xa43ac0[_0x9c31('0x2f')][_0x9c31('0x40')]){_0x30e8c3[_0x9c31('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x9c31('0x42')](_0x30e8c3);})[_0x9c31('0x25')](function(_0x315b43){_0x294039[_0x9c31('0x43')]=_0x315b43;return _0x294039;})[_0x9c31('0x25')](respondWithFilteredResult(_0x1273dd,_0x30e8c3))['catch'](handleError(_0x1273dd,null));};exports[_0x9c31('0x44')]=function(_0xd294a4,_0x2805ea){var _0x592fce={'raw':!![],'where':{'id':_0xd294a4[_0x9c31('0x45')]['id']}},_0x424c2a={};_0x424c2a[_0x9c31('0x2e')]=_[_0x9c31('0x30')](db[_0x9c31('0x3f')][_0x9c31('0x2a')]);_0x424c2a[_0x9c31('0x2f')]=_['keys'](_0xd294a4['query']);_0x424c2a[_0x9c31('0x31')]=_[_0x9c31('0x32')](_0x424c2a[_0x9c31('0x2e')],_0x424c2a[_0x9c31('0x2f')]);_0x592fce[_0x9c31('0x33')]=_['intersection'](_0x424c2a['model'],qs[_0x9c31('0x34')](_0xd294a4[_0x9c31('0x2f')][_0x9c31('0x34')]));_0x592fce[_0x9c31('0x33')]=_0x592fce[_0x9c31('0x33')][_0x9c31('0x35')]?_0x592fce[_0x9c31('0x33')]:_0x424c2a[_0x9c31('0x2e')];if(_0xd294a4['query'][_0x9c31('0x40')]){_0x592fce['include']=[{'all':!![]}];}_0x592fce=_['merge']({},_0x592fce,_0xd294a4[_0x9c31('0x3e')]);return db[_0x9c31('0x3f')]['find'](_0x592fce)['then'](handleEntityNotFound(_0x2805ea,null))[_0x9c31('0x25')](respondWithResult(_0x2805ea,null))[_0x9c31('0x46')](handleError(_0x2805ea,null));};exports[_0x9c31('0x47')]=function(_0x527057,_0x1dda1c){return db[_0x9c31('0x3f')][_0x9c31('0x47')](_0x527057['body'],{})[_0x9c31('0x25')](respondWithResult(_0x1dda1c,0xc9))[_0x9c31('0x46')](handleError(_0x1dda1c,null));};exports[_0x9c31('0x48')]=function(_0x25cb3d,_0x468b87){if(_0x25cb3d['body']['id']){delete _0x25cb3d['body']['id'];}return db[_0x9c31('0x3f')][_0x9c31('0x49')]({'where':{'id':_0x25cb3d[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x468b87,null))[_0x9c31('0x25')](saveUpdates(_0x25cb3d[_0x9c31('0x4a')],null))['then'](respondWithResult(_0x468b87,null))[_0x9c31('0x46')](handleError(_0x468b87,null));};exports[_0x9c31('0x26')]=function(_0x36faca,_0x13e8f8){return db['ChatQueueReport']['find']({'where':{'id':_0x36faca[_0x9c31('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e8f8,null))[_0x9c31('0x25')](removeEntity(_0x13e8f8,null))[_0x9c31('0x46')](handleError(_0x13e8f8,null));};exports['describe']=function(_0xa57aa9,_0x58ba63){return db['ChatQueueReport'][_0x9c31('0x4b')]()[_0x9c31('0x25')](respondWithResult(_0x58ba63,null))[_0x9c31('0x46')](handleError(_0x58ba63,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 12af40a..fdfbac9 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5cf63c,_0x1bb2a6){var _0xe54df4=function(_0x3b5feb){while(--_0x3b5feb){_0x5cf63c['push'](_0x5cf63c['shift']());}};_0xe54df4(++_0x1bb2a6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e4ee0,_0x37aaf8){var _0x5485ac=function(_0x404942){while(--_0x404942){_0x3e4ee0['push'](_0x3e4ee0['shift']());}};_0x5485ac(++_0x37aaf8);}(_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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e0ecf51..eddf743 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 _0x4f6f=['body','options','raw','debug','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport'];(function(_0x40e83f,_0x4f467a){var _0x17207f=function(_0xbeb1f0){while(--_0xbeb1f0){_0x40e83f['push'](_0x40e83f['shift']());}};_0x17207f(++_0x4f467a);}(_0x4f6f,0x17e));var _0xf4f6=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x4f6f[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var moment=require(_0xf4f6('0x2'));var BPromise=require(_0xf4f6('0x3'));var rs=require(_0xf4f6('0x4'));var fs=require('fs');var Redis=require(_0xf4f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4f6('0x6'));var logger=require(_0xf4f6('0x7'))('rpc');var config=require(_0xf4f6('0x8'));var jayson=require(_0xf4f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5764d8,_0x589c2a,_0x4f286b){return new BPromise(function(_0x8d4ffc,_0x44066c){return client['request'](_0x5764d8,_0x4f286b)[_0xf4f6('0xa')](function(_0x337807){logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,_0xf4f6('0xd'));logger['debug'](_0xf4f6('0xe'),_0x589c2a,'request\x20sent',JSON['stringify'](_0x337807));if(_0x337807[_0xf4f6('0xf')]){if(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x10')]===0x1f4){logger[_0xf4f6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x589c2a,_0x337807['error']['message']);return _0x44066c(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}logger[_0xf4f6('0xf')](_0xf4f6('0xc'),_0x589c2a,_0x337807['error'][_0xf4f6('0x11')]);return _0x8d4ffc(_0x337807[_0xf4f6('0xf')][_0xf4f6('0x11')]);}else{logger[_0xf4f6('0xb')](_0xf4f6('0xc'),_0x589c2a,'request\x20sent');_0x8d4ffc(_0x337807[_0xf4f6('0x12')][_0xf4f6('0x11')]);}})[_0xf4f6('0x13')](function(_0x295806){logger['error'](_0xf4f6('0xc'),_0x589c2a,_0x295806);_0x44066c(_0x295806);});});}exports[_0xf4f6('0x14')]=function(_0x10f445){var _0x3501d7=this;return new Promise(function(_0x1668d9,_0x372d2b){return db['ChatQueueReport']['create'](_0x10f445[_0xf4f6('0x15')],{'raw':_0x10f445['options']?_0x10f445[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![]})[_0xf4f6('0xa')](function(_0x40357a){logger['info'](_0xf4f6('0x14'),_0x10f445);logger[_0xf4f6('0x18')](_0xf4f6('0x14'),_0x10f445,JSON[_0xf4f6('0x19')](_0x40357a));_0x1668d9(_0x40357a);})[_0xf4f6('0x13')](function(_0x2a1eaa){logger[_0xf4f6('0xf')](_0xf4f6('0x14'),_0x2a1eaa['message'],_0x10f445);_0x372d2b(_0x3501d7['error'](0x1f4,_0x2a1eaa['message']));});});};exports[_0xf4f6('0x1a')]=function(_0x1926bd){var _0x1ebc1a=this;return new Promise(function(_0x238212,_0x1efef3){return db[_0xf4f6('0x1b')][_0xf4f6('0x1c')](_0x1926bd[_0xf4f6('0x15')],{'raw':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1926bd['options']?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1d')]||null:null,'attributes':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd[_0xf4f6('0x16')][_0xf4f6('0x1e')]||null:null,'limit':_0x1926bd[_0xf4f6('0x16')]?_0x1926bd['options']['limit']||null:null})[_0xf4f6('0xa')](function(_0x2080ad){logger[_0xf4f6('0xb')](_0xf4f6('0x1a'),_0x1926bd);logger[_0xf4f6('0x18')](_0xf4f6('0x1a'),_0x1926bd,JSON['stringify'](_0x2080ad));_0x238212(_0x2080ad);})['catch'](function(_0x400b83){logger[_0xf4f6('0xf')](_0xf4f6('0x1a'),_0x400b83['message'],_0x1926bd);_0x1efef3(_0x1ebc1a[_0xf4f6('0xf')](0x1f4,_0x400b83[_0xf4f6('0x11')]));});});}; \ No newline at end of file +var _0x9414=['error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x9414,0x90));var _0x4941=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x9414[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0x4941('0x0'));var util=require('util');var moment=require(_0x4941('0x1'));var BPromise=require('bluebird');var rs=require(_0x4941('0x2'));var fs=require('fs');var Redis=require(_0x4941('0x3'));var db=require(_0x4941('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4941('0x5'))(_0x4941('0x6'));var config=require(_0x4941('0x7'));var jayson=require(_0x4941('0x8'));var client=jayson[_0x4941('0x9')][_0x4941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bd3fb,_0x48147a,_0x1bc90e){return new BPromise(function(_0x373246,_0x557583){return client[_0x4941('0xb')](_0x4bd3fb,_0x1bc90e)['then'](function(_0x2ed92a){logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,_0x4941('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48147a,'request\x20sent',JSON[_0x4941('0xf')](_0x2ed92a));if(_0x2ed92a['error']){if(_0x2ed92a[_0x4941('0x10')][_0x4941('0x11')]===0x1f4){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x2ed92a['error'][_0x4941('0x12')]);return _0x557583(_0x2ed92a[_0x4941('0x10')]['message']);}logger[_0x4941('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x48147a,_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);return _0x373246(_0x2ed92a[_0x4941('0x10')][_0x4941('0x12')]);}else{logger[_0x4941('0xc')](_0x4941('0xd'),_0x48147a,'request\x20sent');_0x373246(_0x2ed92a['result'][_0x4941('0x12')]);}})[_0x4941('0x13')](function(_0x495625){logger[_0x4941('0x10')](_0x4941('0xd'),_0x48147a,_0x495625);_0x557583(_0x495625);});});}exports[_0x4941('0x14')]=function(_0x299868){var _0x42d500=this;return new Promise(function(_0x4ea352,_0x23087e){return db[_0x4941('0x15')][_0x4941('0x16')](_0x299868[_0x4941('0x17')],{'raw':_0x299868[_0x4941('0x18')]?_0x299868[_0x4941('0x18')][_0x4941('0x19')]===undefined?!![]:![]:!![]})[_0x4941('0x1a')](function(_0x447327){logger[_0x4941('0xc')](_0x4941('0x14'),_0x299868);logger['debug'](_0x4941('0x14'),_0x299868,JSON[_0x4941('0xf')](_0x447327));_0x4ea352(_0x447327);})[_0x4941('0x13')](function(_0x350f52){logger[_0x4941('0x10')]('CreateChatQueueReport',_0x350f52['message'],_0x299868);_0x23087e(_0x42d500['error'](0x1f4,_0x350f52[_0x4941('0x12')]));});});};exports[_0x4941('0x1b')]=function(_0x4f5998){var _0x5b17d2=this;return new Promise(function(_0x3a628d,_0x4bfe31){return db[_0x4941('0x15')]['update'](_0x4f5998[_0x4941('0x17')],{'raw':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x1c')]||null:null,'attributes':_0x4f5998[_0x4941('0x18')]?_0x4f5998[_0x4941('0x18')][_0x4941('0x1d')]||null:null,'limit':_0x4f5998['options']?_0x4f5998[_0x4941('0x18')][_0x4941('0x1e')]||null:null})[_0x4941('0x1a')](function(_0x360192){logger[_0x4941('0xc')](_0x4941('0x1b'),_0x4f5998);logger[_0x4941('0x1f')](_0x4941('0x1b'),_0x4f5998,JSON[_0x4941('0xf')](_0x360192));_0x3a628d(_0x360192);})['catch'](function(_0xaa9e32){logger[_0x4941('0x10')](_0x4941('0x1b'),_0xaa9e32[_0x4941('0x12')],_0x4f5998);_0x4bfe31(_0x5b17d2[_0x4941('0x10')](0x1f4,_0xaa9e32[_0x4941('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 0f80fb8..af18529 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 _0x3793=['isAuthenticated','index','/describe','/:id','show','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x29c3b9,_0x4adaf7){var _0x637286=function(_0x36b4f3){while(--_0x36b4f3){_0x29c3b9['push'](_0x29c3b9['shift']());}};_0x637286(++_0x4adaf7);}(_0x3793,0xa1));var _0x3379=function(_0x569c5a,_0x9ef4b6){_0x569c5a=_0x569c5a-0x0;var _0x1676d0=_0x3793[_0x569c5a];return _0x1676d0;};'use strict';var multer=require(_0x3379('0x0'));var util=require(_0x3379('0x1'));var path=require('path');var timeout=require(_0x3379('0x2'));var express=require(_0x3379('0x3'));var router=express[_0x3379('0x4')]();var fs_extra=require(_0x3379('0x5'));var auth=require(_0x3379('0x6'));var interaction=require(_0x3379('0x7'));var config=require('../../config/environment');var controller=require(_0x3379('0x8'));router[_0x3379('0x9')]('/',auth[_0x3379('0xa')](),controller[_0x3379('0xb')]);router['get'](_0x3379('0xc'),auth[_0x3379('0xa')](),controller['describe']);router[_0x3379('0x9')](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0xe')]);router[_0x3379('0xf')]('/',auth[_0x3379('0xa')](),controller['create']);router['put'](_0x3379('0xd'),auth['isAuthenticated'](),controller[_0x3379('0x10')]);router['delete'](_0x3379('0xd'),auth[_0x3379('0xa')](),controller[_0x3379('0x11')]);module[_0x3379('0x12')]=router; \ No newline at end of file +var _0x067f=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xf9263f,_0x5cb19d){var _0x448192=function(_0x3cecf0){while(--_0x3cecf0){_0xf9263f['push'](_0xf9263f['shift']());}};_0x448192(++_0x5cb19d);}(_0x067f,0x186));var _0xf067=function(_0x3cce12,_0x5ab156){_0x3cce12=_0x3cce12-0x0;var _0x12ce5d=_0x067f[_0x3cce12];return _0x12ce5d;};'use strict';var multer=require('multer');var util=require(_0xf067('0x0'));var path=require(_0xf067('0x1'));var timeout=require(_0xf067('0x2'));var express=require('express');var router=express[_0xf067('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf067('0x4'));var interaction=require(_0xf067('0x5'));var config=require(_0xf067('0x6'));var controller=require('./chatQueueReport.controller');router[_0xf067('0x7')]('/',auth[_0xf067('0x8')](),controller[_0xf067('0x9')]);router[_0xf067('0x7')](_0xf067('0xa'),auth[_0xf067('0x8')](),controller[_0xf067('0xb')]);router[_0xf067('0x7')](_0xf067('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf067('0x8')](),controller[_0xf067('0xd')]);router[_0xf067('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf067('0xf')]);router[_0xf067('0x10')]('/:id',auth[_0xf067('0x8')](),controller[_0xf067('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 4b60d7c..3e09449 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3c231b,_0xf13470){var _0x394e62=function(_0x226d6f){while(--_0x226d6f){_0x3c231b['push'](_0x3c231b['shift']());}};_0x394e62(++_0xf13470);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xf3cd[_0x564821];return _0x2b604d;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3318c3,_0x35066){var _0x15c002=function(_0xd82271){while(--_0xd82271){_0x3318c3['push'](_0x3318c3['shift']());}};_0x15c002(++_0x35066);}(_0x54ef,0x112));var _0xf54e=function(_0x13147c,_0x22675b){_0x13147c=_0x13147c-0x0;var _0x2009de=_0x54ef[_0x13147c];return _0x2009de;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index deda079..099d552 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 _0x6136=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','include','findAll','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x3dfc68,_0x304d60){var _0x245084=function(_0x3c1e0a){while(--_0x3c1e0a){_0x3dfc68['push'](_0x3dfc68['shift']());}};_0x245084(++_0x304d60);}(_0x6136,0x111));var _0x6613=function(_0x5cfd2a,_0x44a11c){_0x5cfd2a=_0x5cfd2a-0x0;var _0x3a4582=_0x6136[_0x5cfd2a];return _0x3a4582;};'use strict';var emlformat=require(_0x6613('0x0'));var rimraf=require(_0x6613('0x1'));var zipdir=require(_0x6613('0x2'));var jsonpatch=require(_0x6613('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6613('0x4'));var Mustache=require(_0x6613('0x5'));var util=require(_0x6613('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6613('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6613('0x8'));var _=require(_0x6613('0x9'));var squel=require(_0x6613('0xa'));var crypto=require('crypto');var jsforce=require(_0x6613('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6613('0x7'));var querystring=require(_0x6613('0xc'));var Papa=require(_0x6613('0xd'));var Redis=require('ioredis');var authService=require(_0x6613('0xe'));var qs=require(_0x6613('0xf'));var as=require(_0x6613('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6613('0x11'))('api');var utils=require(_0x6613('0x12'));var config=require(_0x6613('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6613('0x14'))['db'];function respondWithStatusCode(_0x1abe66,_0x46e81c){_0x46e81c=_0x46e81c||0xcc;return function(_0x11cf74){if(_0x11cf74){return _0x1abe66[_0x6613('0x15')](_0x46e81c);}return _0x1abe66[_0x6613('0x16')](_0x46e81c)[_0x6613('0x17')]();};}function respondWithResult(_0xfff29c,_0xa3e2ae){_0xa3e2ae=_0xa3e2ae||0xc8;return function(_0x13bc2e){if(_0x13bc2e){return _0xfff29c[_0x6613('0x16')](_0xa3e2ae)[_0x6613('0x18')](_0x13bc2e);}};}function respondWithFilteredResult(_0xb7c796,_0x21f9c7){return function(_0x5180b1){if(_0x5180b1){var _0x4bcac0=typeof _0x21f9c7[_0x6613('0x19')]===_0x6613('0x1a')&&typeof _0x21f9c7[_0x6613('0x1b')]===_0x6613('0x1a');var _0x10f5c5=_0x5180b1['count'];var _0x5b9ab2=_0x4bcac0?0x0:_0x21f9c7[_0x6613('0x19')];var _0x580112=_0x4bcac0?_0x5180b1['count']:_0x21f9c7[_0x6613('0x19')]+_0x21f9c7[_0x6613('0x1b')];var _0x1b1bad;if(_0x580112>=_0x10f5c5){_0x580112=_0x10f5c5;_0x1b1bad=0xc8;}else{_0x1b1bad=0xce;}_0xb7c796[_0x6613('0x16')](_0x1b1bad);return _0xb7c796[_0x6613('0x1c')](_0x6613('0x1d'),_0x5b9ab2+'-'+_0x580112+'/'+_0x10f5c5)[_0x6613('0x18')](_0x5180b1);}return null;};}function patchUpdates(_0x27f83e){return function(_0x4707c0){try{jsonpatch[_0x6613('0x1e')](_0x4707c0,_0x27f83e,!![]);}catch(_0x39c0fe){return BPromise[_0x6613('0x1f')](_0x39c0fe);}return _0x4707c0[_0x6613('0x20')]();};}function saveUpdates(_0x109abb,_0x5cef72){return function(_0x387a0c){if(_0x387a0c){return _0x387a0c['update'](_0x109abb)[_0x6613('0x21')](function(_0x20b373){return _0x20b373;});}return null;};}function removeEntity(_0x37fef1,_0x300179){return function(_0x62ed55){if(_0x62ed55){return _0x62ed55[_0x6613('0x22')]()['then'](function(){_0x37fef1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e892,_0xc15507){return function(_0x23254b){if(!_0x23254b){_0x39e892[_0x6613('0x15')](0x194);}return _0x23254b;};}function handleError(_0x4a2448,_0x30fcc4){_0x30fcc4=_0x30fcc4||0x1f4;return function(_0x281488){logger[_0x6613('0x23')](_0x281488[_0x6613('0x24')]);if(_0x281488['name']){delete _0x281488[_0x6613('0x25')];}_0x4a2448[_0x6613('0x16')](_0x30fcc4)['send'](_0x281488);};}exports[_0x6613('0x26')]=function(_0x20e4f0,_0x2a85e6){var _0x433827={},_0x2ed167={},_0xc33d23={'count':0x0,'rows':[]};var _0x196bbf=_['map'](db[_0x6613('0x27')][_0x6613('0x28')],function(_0x4a4822){return{'name':_0x4a4822[_0x6613('0x29')],'type':_0x4a4822[_0x6613('0x2a')][_0x6613('0x2b')]};});_0x2ed167['model']=_[_0x6613('0x2c')](_0x196bbf,_0x6613('0x25'));_0x2ed167[_0x6613('0x2d')]=_[_0x6613('0x2e')](_0x20e4f0[_0x6613('0x2d')]);_0x2ed167[_0x6613('0x2f')]=_[_0x6613('0x30')](_0x2ed167[_0x6613('0x31')],_0x2ed167[_0x6613('0x2d')]);_0x433827[_0x6613('0x32')]=_['intersection'](_0x2ed167[_0x6613('0x31')],qs[_0x6613('0x33')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x33')]));_0x433827[_0x6613('0x32')]=_0x433827[_0x6613('0x32')][_0x6613('0x34')]?_0x433827[_0x6613('0x32')]:_0x2ed167[_0x6613('0x31')];if(!_0x20e4f0[_0x6613('0x2d')][_0x6613('0x35')]('nolimit')){_0x433827['limit']=qs[_0x6613('0x1b')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x1b')]);_0x433827[_0x6613('0x19')]=qs['offset'](_0x20e4f0[_0x6613('0x2d')]['offset']);}_0x433827[_0x6613('0x36')]=qs[_0x6613('0x37')](_0x20e4f0[_0x6613('0x2d')][_0x6613('0x37')]);_0x433827[_0x6613('0x38')]=qs[_0x6613('0x2f')](_[_0x6613('0x39')](_0x20e4f0[_0x6613('0x2d')],_0x2ed167['filters']),_0x196bbf);if(_0x20e4f0[_0x6613('0x2d')][_0x6613('0x3a')]){_0x433827[_0x6613('0x38')]=_[_0x6613('0x3b')](_0x433827[_0x6613('0x38')],{'$or':_[_0x6613('0x2c')](_0x196bbf,function(_0x56519a){if(_0x56519a['type']!=='VIRTUAL'){var _0x2512f7={};_0x2512f7[_0x56519a[_0x6613('0x25')]]={'$like':'%'+_0x20e4f0['query'][_0x6613('0x3a')]+'%'};return _0x2512f7;}})});}_0x433827=_[_0x6613('0x3b')]({},_0x433827,_0x20e4f0[_0x6613('0x3c')]);var _0x30061a={'where':_0x433827['where']};return db[_0x6613('0x27')][_0x6613('0x3d')](_0x30061a)['then'](function(_0x34f61c){_0xc33d23[_0x6613('0x3d')]=_0x34f61c;if(_0x20e4f0[_0x6613('0x2d')]['includeAll']){_0x433827[_0x6613('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6613('0x3f')](_0x433827);})[_0x6613('0x21')](function(_0x2466cd){_0xc33d23['rows']=_0x2466cd;return _0xc33d23;})[_0x6613('0x21')](respondWithFilteredResult(_0x2a85e6,_0x433827))[_0x6613('0x40')](handleError(_0x2a85e6,null));};exports[_0x6613('0x41')]=function(_0x53db74,_0x1c0828){var _0xd421b8={'raw':!![],'where':{'id':_0x53db74[_0x6613('0x42')]['id']}},_0x4d142c={};_0x4d142c['model']=_[_0x6613('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x4d142c['query']=_[_0x6613('0x2e')](_0x53db74[_0x6613('0x2d')]);_0x4d142c['filters']=_[_0x6613('0x30')](_0x4d142c[_0x6613('0x31')],_0x4d142c[_0x6613('0x2d')]);_0xd421b8['attributes']=_[_0x6613('0x30')](_0x4d142c['model'],qs[_0x6613('0x33')](_0x53db74[_0x6613('0x2d')]['fields']));_0xd421b8[_0x6613('0x32')]=_0xd421b8[_0x6613('0x32')][_0x6613('0x34')]?_0xd421b8['attributes']:_0x4d142c[_0x6613('0x31')];if(_0x53db74[_0x6613('0x2d')][_0x6613('0x43')]){_0xd421b8['include']=[{'all':!![]}];}_0xd421b8=_[_0x6613('0x3b')]({},_0xd421b8,_0x53db74['options']);return db[_0x6613('0x27')][_0x6613('0x44')](_0xd421b8)[_0x6613('0x21')](handleEntityNotFound(_0x1c0828,null))['then'](respondWithResult(_0x1c0828,null))[_0x6613('0x40')](handleError(_0x1c0828,null));};exports[_0x6613('0x45')]=function(_0x14f3b8,_0x58d500){return db[_0x6613('0x27')]['create'](_0x14f3b8[_0x6613('0x46')],{})['then'](respondWithResult(_0x58d500,0xc9))[_0x6613('0x40')](handleError(_0x58d500,null));};exports[_0x6613('0x47')]=function(_0x5860e0,_0x5af460){if(_0x5860e0[_0x6613('0x46')]['id']){delete _0x5860e0[_0x6613('0x46')]['id'];}return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x5860e0['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x5af460,null))[_0x6613('0x21')](saveUpdates(_0x5860e0['body'],null))[_0x6613('0x21')](respondWithResult(_0x5af460,null))[_0x6613('0x40')](handleError(_0x5af460,null));};exports['destroy']=function(_0x595cd6,_0x4fd625){return db[_0x6613('0x27')][_0x6613('0x44')]({'where':{'id':_0x595cd6['params']['id']}})[_0x6613('0x21')](handleEntityNotFound(_0x4fd625,null))[_0x6613('0x21')](removeEntity(_0x4fd625,null))['catch'](handleError(_0x4fd625,null));};exports[_0x6613('0x48')]=function(_0x2f13c4,_0x23855d){return db[_0x6613('0x27')]['describe']()['then'](respondWithResult(_0x23855d,null))[_0x6613('0x40')](handleError(_0x23855d,null));}; \ No newline at end of file +var _0x685a=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','where','pick','merge','options','ChatTransferReport','includeAll','findAll','catch','show','rawAttributes','find','create','params','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4dac30,_0x3b1e61){var _0x4ae741=function(_0x1a22c3){while(--_0x1a22c3){_0x4dac30['push'](_0x4dac30['shift']());}};_0x4ae741(++_0x3b1e61);}(_0x685a,0x1b2));var _0xa685=function(_0x2d318e,_0x4780c0){_0x2d318e=_0x2d318e-0x0;var _0x105f8f=_0x685a[_0x2d318e];return _0x105f8f;};'use strict';var emlformat=require(_0xa685('0x0'));var rimraf=require(_0xa685('0x1'));var zipdir=require(_0xa685('0x2'));var jsonpatch=require(_0xa685('0x3'));var rp=require(_0xa685('0x4'));var moment=require(_0xa685('0x5'));var BPromise=require(_0xa685('0x6'));var Mustache=require(_0xa685('0x7'));var util=require(_0xa685('0x8'));var path=require(_0xa685('0x9'));var sox=require(_0xa685('0xa'));var csv=require('to-csv');var ejs=require(_0xa685('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa685('0xc'));var squel=require(_0xa685('0xd'));var crypto=require(_0xa685('0xe'));var jsforce=require(_0xa685('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa685('0x10'));var Papa=require(_0xa685('0x11'));var Redis=require(_0xa685('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa685('0x13'));var as=require(_0xa685('0x14'));var hardwareService=require(_0xa685('0x15'));var logger=require(_0xa685('0x16'))('api');var utils=require(_0xa685('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa685('0x18'));var db=require(_0xa685('0x19'))['db'];function respondWithStatusCode(_0x40cfa3,_0x506ea9){_0x506ea9=_0x506ea9||0xcc;return function(_0x5e0bdd){if(_0x5e0bdd){return _0x40cfa3[_0xa685('0x1a')](_0x506ea9);}return _0x40cfa3['status'](_0x506ea9)[_0xa685('0x1b')]();};}function respondWithResult(_0x13b37f,_0x5db52b){_0x5db52b=_0x5db52b||0xc8;return function(_0x252341){if(_0x252341){return _0x13b37f['status'](_0x5db52b)[_0xa685('0x1c')](_0x252341);}};}function respondWithFilteredResult(_0x10e311,_0x4516d8){return function(_0xb75c60){if(_0xb75c60){var _0xf85345=typeof _0x4516d8['offset']===_0xa685('0x1d')&&typeof _0x4516d8['limit']===_0xa685('0x1d');var _0x1eec42=_0xb75c60[_0xa685('0x1e')];var _0xbe0580=_0xf85345?0x0:_0x4516d8['offset'];var _0x5ba311=_0xf85345?_0xb75c60[_0xa685('0x1e')]:_0x4516d8['offset']+_0x4516d8[_0xa685('0x1f')];var _0x2877ca;if(_0x5ba311>=_0x1eec42){_0x5ba311=_0x1eec42;_0x2877ca=0xc8;}else{_0x2877ca=0xce;}_0x10e311[_0xa685('0x20')](_0x2877ca);return _0x10e311[_0xa685('0x21')](_0xa685('0x22'),_0xbe0580+'-'+_0x5ba311+'/'+_0x1eec42)['json'](_0xb75c60);}return null;};}function patchUpdates(_0x27e73c){return function(_0x1adb51){try{jsonpatch[_0xa685('0x23')](_0x1adb51,_0x27e73c,!![]);}catch(_0x83af21){return BPromise[_0xa685('0x24')](_0x83af21);}return _0x1adb51[_0xa685('0x25')]();};}function saveUpdates(_0x30d5a1,_0x4b4768){return function(_0xbf7583){if(_0xbf7583){return _0xbf7583[_0xa685('0x26')](_0x30d5a1)[_0xa685('0x27')](function(_0x2861cc){return _0x2861cc;});}return null;};}function removeEntity(_0x1d034d,_0x2869b8){return function(_0x4789af){if(_0x4789af){return _0x4789af[_0xa685('0x28')]()['then'](function(){_0x1d034d[_0xa685('0x20')](0xcc)[_0xa685('0x1b')]();});}};}function handleEntityNotFound(_0x3c848f,_0x3e6e51){return function(_0x3907c3){if(!_0x3907c3){_0x3c848f[_0xa685('0x1a')](0x194);}return _0x3907c3;};}function handleError(_0x441af4,_0x1ee61e){_0x1ee61e=_0x1ee61e||0x1f4;return function(_0x1b9aae){logger[_0xa685('0x29')](_0x1b9aae[_0xa685('0x2a')]);if(_0x1b9aae[_0xa685('0x2b')]){delete _0x1b9aae[_0xa685('0x2b')];}_0x441af4[_0xa685('0x20')](_0x1ee61e)[_0xa685('0x2c')](_0x1b9aae);};}exports[_0xa685('0x2d')]=function(_0x2690eb,_0x1ef89c){var _0x3d16d8={},_0x11c759={},_0x198fd0={'count':0x0,'rows':[]};var _0x14ff5d=_[_0xa685('0x2e')](db['ChatTransferReport']['rawAttributes'],function(_0x413fa3){return{'name':_0x413fa3['fieldName'],'type':_0x413fa3[_0xa685('0x2f')]['key']};});_0x11c759[_0xa685('0x30')]=_[_0xa685('0x2e')](_0x14ff5d,_0xa685('0x2b'));_0x11c759[_0xa685('0x31')]=_[_0xa685('0x32')](_0x2690eb['query']);_0x11c759[_0xa685('0x33')]=_[_0xa685('0x34')](_0x11c759[_0xa685('0x30')],_0x11c759['query']);_0x3d16d8['attributes']=_['intersection'](_0x11c759[_0xa685('0x30')],qs[_0xa685('0x35')](_0x2690eb[_0xa685('0x31')][_0xa685('0x35')]));_0x3d16d8['attributes']=_0x3d16d8[_0xa685('0x36')][_0xa685('0x37')]?_0x3d16d8[_0xa685('0x36')]:_0x11c759[_0xa685('0x30')];if(!_0x2690eb[_0xa685('0x31')][_0xa685('0x38')](_0xa685('0x39'))){_0x3d16d8['limit']=qs[_0xa685('0x1f')](_0x2690eb[_0xa685('0x31')][_0xa685('0x1f')]);_0x3d16d8[_0xa685('0x3a')]=qs[_0xa685('0x3a')](_0x2690eb[_0xa685('0x31')][_0xa685('0x3a')]);}_0x3d16d8['order']=qs['sort'](_0x2690eb[_0xa685('0x31')]['sort']);_0x3d16d8[_0xa685('0x3b')]=qs['filters'](_[_0xa685('0x3c')](_0x2690eb[_0xa685('0x31')],_0x11c759[_0xa685('0x33')]),_0x14ff5d);if(_0x2690eb[_0xa685('0x31')]['filter']){_0x3d16d8['where']=_[_0xa685('0x3d')](_0x3d16d8[_0xa685('0x3b')],{'$or':_[_0xa685('0x2e')](_0x14ff5d,function(_0x5647b3){if(_0x5647b3[_0xa685('0x2f')]!=='VIRTUAL'){var _0x26ac6c={};_0x26ac6c[_0x5647b3[_0xa685('0x2b')]]={'$like':'%'+_0x2690eb[_0xa685('0x31')]['filter']+'%'};return _0x26ac6c;}})});}_0x3d16d8=_['merge']({},_0x3d16d8,_0x2690eb[_0xa685('0x3e')]);var _0x4065af={'where':_0x3d16d8['where']};return db[_0xa685('0x3f')][_0xa685('0x1e')](_0x4065af)['then'](function(_0x10ad39){_0x198fd0[_0xa685('0x1e')]=_0x10ad39;if(_0x2690eb[_0xa685('0x31')][_0xa685('0x40')]){_0x3d16d8['include']=[{'all':!![]}];}return db[_0xa685('0x3f')][_0xa685('0x41')](_0x3d16d8);})[_0xa685('0x27')](function(_0x2bff6f){_0x198fd0['rows']=_0x2bff6f;return _0x198fd0;})[_0xa685('0x27')](respondWithFilteredResult(_0x1ef89c,_0x3d16d8))[_0xa685('0x42')](handleError(_0x1ef89c,null));};exports[_0xa685('0x43')]=function(_0x2a761b,_0x60eff7){var _0x55375c={'raw':!![],'where':{'id':_0x2a761b['params']['id']}},_0x2dfbcd={};_0x2dfbcd['model']=_['keys'](db[_0xa685('0x3f')][_0xa685('0x44')]);_0x2dfbcd['query']=_[_0xa685('0x32')](_0x2a761b[_0xa685('0x31')]);_0x2dfbcd['filters']=_[_0xa685('0x34')](_0x2dfbcd[_0xa685('0x30')],_0x2dfbcd[_0xa685('0x31')]);_0x55375c['attributes']=_[_0xa685('0x34')](_0x2dfbcd['model'],qs[_0xa685('0x35')](_0x2a761b[_0xa685('0x31')][_0xa685('0x35')]));_0x55375c['attributes']=_0x55375c[_0xa685('0x36')]['length']?_0x55375c[_0xa685('0x36')]:_0x2dfbcd[_0xa685('0x30')];if(_0x2a761b[_0xa685('0x31')][_0xa685('0x40')]){_0x55375c['include']=[{'all':!![]}];}_0x55375c=_[_0xa685('0x3d')]({},_0x55375c,_0x2a761b[_0xa685('0x3e')]);return db[_0xa685('0x3f')][_0xa685('0x45')](_0x55375c)[_0xa685('0x27')](handleEntityNotFound(_0x60eff7,null))['then'](respondWithResult(_0x60eff7,null))[_0xa685('0x42')](handleError(_0x60eff7,null));};exports[_0xa685('0x46')]=function(_0x3a2bdf,_0x3d7db3){return db[_0xa685('0x3f')][_0xa685('0x46')](_0x3a2bdf['body'],{})[_0xa685('0x27')](respondWithResult(_0x3d7db3,0xc9))['catch'](handleError(_0x3d7db3,null));};exports[_0xa685('0x26')]=function(_0x395dfe,_0x533a01){if(_0x395dfe['body']['id']){delete _0x395dfe['body']['id'];}return db['ChatTransferReport'][_0xa685('0x45')]({'where':{'id':_0x395dfe[_0xa685('0x47')]['id']}})[_0xa685('0x27')](handleEntityNotFound(_0x533a01,null))[_0xa685('0x27')](saveUpdates(_0x395dfe['body'],null))[_0xa685('0x27')](respondWithResult(_0x533a01,null))[_0xa685('0x42')](handleError(_0x533a01,null));};exports[_0xa685('0x28')]=function(_0x56a0a9,_0x1a2c74){return db[_0xa685('0x3f')][_0xa685('0x45')]({'where':{'id':_0x56a0a9[_0xa685('0x47')]['id']}})[_0xa685('0x27')](handleEntityNotFound(_0x1a2c74,null))['then'](removeEntity(_0x1a2c74,null))[_0xa685('0x42')](handleError(_0x1a2c74,null));};exports['describe']=function(_0x195d3f,_0x2727e1){return db['ChatTransferReport'][_0xa685('0x48')]()[_0xa685('0x27')](respondWithResult(_0x2727e1,null))[_0xa685('0x42')](handleError(_0x2727e1,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 1e0edb0..0bfb0e9 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 _0xf40b=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x13bb95,_0x5e079f){var _0x58a3f1=function(_0x3fe115){while(--_0x3fe115){_0x13bb95['push'](_0x13bb95['shift']());}};_0x58a3f1(++_0x5e079f);}(_0xf40b,0x7f));var _0xbf40=function(_0xc4a608,_0x45fecd){_0xc4a608=_0xc4a608-0x0;var _0x5e2730=_0xf40b[_0xc4a608];return _0x5e2730;};'use strict';var _=require(_0xbf40('0x0'));var util=require('util');var logger=require(_0xbf40('0x1'))(_0xbf40('0x2'));var moment=require(_0xbf40('0x3'));var BPromise=require(_0xbf40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require(_0xbf40('0x7'));var attributes=require(_0xbf40('0x8'));module[_0xbf40('0x9')]=function(_0x56b19e,_0x13707e){return _0x56b19e[_0xbf40('0xa')](_0xbf40('0xb'),attributes,{'tableName':_0xbf40('0xc'),'paranoid':![],'indexes':[{'name':_0xbf40('0xd'),'fields':[_0xbf40('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf89a=['bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment'];(function(_0x374ba0,_0x27ee7b){var _0x2c9388=function(_0x318869){while(--_0x318869){_0x374ba0['push'](_0x374ba0['shift']());}};_0x2c9388(++_0x27ee7b);}(_0xf89a,0x81));var _0xaf89=function(_0xb252a,_0x45867e){_0xb252a=_0xb252a-0x0;var _0x2d2bb5=_0xf89a[_0xb252a];return _0x2d2bb5;};'use strict';var _=require(_0xaf89('0x0'));var util=require(_0xaf89('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaf89('0x2'));var BPromise=require(_0xaf89('0x3'));var rp=require(_0xaf89('0x4'));var fs=require('fs');var path=require(_0xaf89('0x5'));var rimraf=require('rimraf');var config=require(_0xaf89('0x6'));var attributes=require(_0xaf89('0x7'));module['exports']=function(_0x4ed04c,_0x36f637){return _0x4ed04c[_0xaf89('0x8')](_0xaf89('0x9'),attributes,{'tableName':_0xaf89('0xa'),'paranoid':![],'indexes':[{'name':_0xaf89('0xb'),'fields':[_0xaf89('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5dae12d..f48c040 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 _0x976c=['bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x312b25,_0xc2aa){var _0x5818f6=function(_0x1bfc44){while(--_0x1bfc44){_0x312b25['push'](_0x312b25['shift']());}};_0x5818f6(++_0xc2aa);}(_0x976c,0x67));var _0xc976=function(_0x4ddec0,_0x4d6267){_0x4ddec0=_0x4ddec0-0x0;var _0xc20418=_0x976c[_0x4ddec0];return _0xc20418;};'use strict';var _=require(_0xc976('0x0'));var util=require('util');var moment=require(_0xc976('0x1'));var BPromise=require(_0xc976('0x2'));var rs=require(_0xc976('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc976('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc976('0x5'));var jayson=require(_0xc976('0x6'));var client=jayson[_0xc976('0x7')][_0xc976('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f1bf,_0x5efa21,_0x2a19b9){return new BPromise(function(_0x5324ac,_0x471107){return client[_0xc976('0x9')](_0x26f1bf,_0x2a19b9)[_0xc976('0xa')](function(_0xe17884){logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));logger[_0xc976('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5efa21,'request\x20sent',JSON[_0xc976('0xf')](_0xe17884));if(_0xe17884[_0xc976('0x10')]){if(_0xe17884[_0xc976('0x10')][_0xc976('0x11')]===0x1f4){logger['error'](_0xc976('0xc'),_0x5efa21,_0xe17884['error']['message']);return _0x471107(_0xe17884[_0xc976('0x10')][_0xc976('0x12')]);}logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0xe17884[_0xc976('0x10')]['message']);return _0x5324ac(_0xe17884['error']['message']);}else{logger[_0xc976('0xb')](_0xc976('0xc'),_0x5efa21,_0xc976('0xd'));_0x5324ac(_0xe17884[_0xc976('0x13')]['message']);}})[_0xc976('0x14')](function(_0x5e09c8){logger[_0xc976('0x10')](_0xc976('0xc'),_0x5efa21,_0x5e09c8);_0x471107(_0x5e09c8);});});} \ No newline at end of file +var _0xc7bb=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0xb130db,_0x2950da){var _0x3aae0d=function(_0x5a5b0c){while(--_0x5a5b0c){_0xb130db['push'](_0xb130db['shift']());}};_0x3aae0d(++_0x2950da);}(_0xc7bb,0xa1));var _0xbc7b=function(_0x55d147,_0xbff6ef){_0x55d147=_0x55d147-0x0;var _0x2e4880=_0xc7bb[_0x55d147];return _0x2e4880;};'use strict';var _=require('lodash');var util=require(_0xbc7b('0x0'));var moment=require(_0xbc7b('0x1'));var BPromise=require(_0xbc7b('0x2'));var rs=require(_0xbc7b('0x3'));var fs=require('fs');var Redis=require(_0xbc7b('0x4'));var db=require(_0xbc7b('0x5'))['db'];var utils=require(_0xbc7b('0x6'));var logger=require(_0xbc7b('0x7'))(_0xbc7b('0x8'));var config=require(_0xbc7b('0x9'));var jayson=require(_0xbc7b('0xa'));var client=jayson['client'][_0xbc7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0d82,_0x3da410,_0xaac7b1){return new BPromise(function(_0x23cb2d,_0x2a2a02){return client[_0xbc7b('0xc')](_0x4b0d82,_0xaac7b1)[_0xbc7b('0xd')](function(_0x1136dc){logger[_0xbc7b('0xe')](_0xbc7b('0xf'),_0x3da410,_0xbc7b('0x10'));logger[_0xbc7b('0x11')](_0xbc7b('0x12'),_0x3da410,_0xbc7b('0x10'),JSON[_0xbc7b('0x13')](_0x1136dc));if(_0x1136dc[_0xbc7b('0x14')]){if(_0x1136dc[_0xbc7b('0x14')][_0xbc7b('0x15')]===0x1f4){logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x1136dc['error'][_0xbc7b('0x16')]);return _0x2a2a02(_0x1136dc[_0xbc7b('0x14')][_0xbc7b('0x16')]);}logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x1136dc['error'][_0xbc7b('0x16')]);return _0x23cb2d(_0x1136dc['error'][_0xbc7b('0x16')]);}else{logger[_0xbc7b('0xe')](_0xbc7b('0xf'),_0x3da410,'request\x20sent');_0x23cb2d(_0x1136dc[_0xbc7b('0x17')]['message']);}})[_0xbc7b('0x18')](function(_0x51557b){logger[_0xbc7b('0x14')](_0xbc7b('0xf'),_0x3da410,_0x51557b);_0x2a2a02(_0x51557b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index f9cc0a7..6bed48f 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 _0x86b2=['describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x1fc55d,_0x37e2f5){var _0x1652d4=function(_0x268ee0){while(--_0x268ee0){_0x1fc55d['push'](_0x1fc55d['shift']());}};_0x1652d4(++_0x37e2f5);}(_0x86b2,0xb1));var _0x286b=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x86b2[_0x486f4a];return _0x135d99;};'use strict';var multer=require('multer');var util=require(_0x286b('0x0'));var path=require(_0x286b('0x1'));var timeout=require(_0x286b('0x2'));var express=require(_0x286b('0x3'));var router=express['Router']();var fs_extra=require(_0x286b('0x4'));var auth=require(_0x286b('0x5'));var interaction=require(_0x286b('0x6'));var config=require(_0x286b('0x7'));var controller=require(_0x286b('0x8'));router[_0x286b('0x9')]('/',auth[_0x286b('0xa')](),controller['index']);router[_0x286b('0x9')](_0x286b('0xb'),auth[_0x286b('0xa')](),controller[_0x286b('0xc')]);router[_0x286b('0x9')](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0xe')]);router[_0x286b('0xf')]('/',auth[_0x286b('0xa')](),controller[_0x286b('0x10')]);router['put'](_0x286b('0xd'),auth[_0x286b('0xa')](),controller[_0x286b('0x11')]);router[_0x286b('0x12')]('/:id',auth[_0x286b('0xa')](),controller[_0x286b('0x13')]);module[_0x286b('0x14')]=router; \ No newline at end of file +var _0xf3d7=['util','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xf3d7,0x1d3));var _0x7f3d=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0xf3d7[_0x3b0e76];return _0x1e4af4;};'use strict';var multer=require(_0x7f3d('0x0'));var util=require(_0x7f3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7f3d('0x2'));var router=express[_0x7f3d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f3d('0x4'));var config=require(_0x7f3d('0x5'));var controller=require('./chatTransferReport.controller');router[_0x7f3d('0x6')]('/',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0x8')]);router[_0x7f3d('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x7f3d('0x9')]);router[_0x7f3d('0x6')](_0x7f3d('0xa'),auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xb')]);router[_0x7f3d('0xc')]('/',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xd')]);router['put']('/:id',auth[_0x7f3d('0x7')](),controller[_0x7f3d('0xe')]);router[_0x7f3d('0xf')](_0x7f3d('0xa'),auth['isAuthenticated'](),controller[_0x7f3d('0x10')]);module[_0x7f3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7e115cb..87c7d1b 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 _0x22fb=['email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','TEXT','stringify','input','name','text','getDataValue','parse','setDataValue','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address'];(function(_0x50b0bb,_0x4afe99){var _0x2002be=function(_0x59d745){while(--_0x59d745){_0x50b0bb['push'](_0x50b0bb['shift']());}};_0x2002be(++_0x4afe99);}(_0x22fb,0x192));var _0xb22f=function(_0x44690f,_0x1306b8){_0x44690f=_0x44690f-0x0;var _0x13d2a7=_0x22fb[_0x44690f];return _0x13d2a7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'unique':_0xb22f('0x2')},'description':{'type':Sequelize[_0xb22f('0x1')]},'mapKey':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x3')},'key':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x4')},'customerAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb22f('0x1')]},'animation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0xc')},'header_offline':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xd')},'download_transcript':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xf')},'noteTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x10')},'closingMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'skipMessageButton':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x12')},'ratingType':{'type':Sequelize[_0xb22f('0x9')](_0xb22f('0x13'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'variable':null,'config':{'placeholder':_0xb22f('0x17'),'type':_0xb22f('0x18'),'required':!![]},'props':{'title':_0xb22f('0x17'),'helpText':''}},{'type':_0xb22f('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb22f('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb22f('0x19')]('onlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')]('onlineForm')):{};},'set':function(_0x4687f2){return this[_0xb22f('0x1b')]('onlineForm',JSON[_0xb22f('0x15')](_0x4687f2));}},'offlineForm':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return JSON[_0xb22f('0x15')]({'items':[{'type':_0xb22f('0x16'),'props':{'title':_0xb22f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb22f('0x3'),'type':_0xb22f('0x3')},'variable':null},{'type':_0xb22f('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb22f('0x19')]('offlineForm')?JSON[_0xb22f('0x1a')](this[_0xb22f('0x19')](_0xb22f('0x1d'))):{};},'set':function(_0x413575){return this[_0xb22f('0x1b')]('offlineForm',JSON['stringify'](_0x413575));}},'token':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return rs[_0xb22f('0x1e')]();}},'autoclose':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb22f('0x1')]},'forwardOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x1f')},'waitingMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb22f('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x22')},'skipUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x11')},'sendUnmanaged':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':function(){return _0xb22f('0x23');}},'notificationSound':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb22f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x25')},'verticalAlignment':{'type':Sequelize[_0xb22f('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':_0xb22f('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb22f('0x1')]},'customerAvatar':{'type':Sequelize[_0xb22f('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb22f('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0x7')],'comment':_0xb22f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb22f('0x29'),'set':function(_0x2d265c){if(!_0x2d265c)this[_0xb22f('0x1b')]('mandatoryDispositionPauseId',null);this[_0xb22f('0x1b')](_0xb22f('0x2a'),_0x2d265c);}},'vidaooEscalation':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb22f('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb22f('0x1')],'allowNull':![],'defaultValue':_0xb22f('0x2b')},'vidaooNote':{'type':Sequelize[_0xb22f('0x1')],'defaultValue':function(){return _0xb22f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xb22f('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb22f('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','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','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x63e7e8,_0x59eb07){var _0x249c2b=function(_0x1a0431){while(--_0x1a0431){_0x63e7e8['push'](_0x63e7e8['shift']());}};_0x249c2b(++_0x59eb07);}(_0x9f62,0x154));var _0x29f6=function(_0x382b75,_0x5669ba){_0x382b75=_0x382b75-0x0;var _0x150923=_0x9f62[_0x382b75];return _0x150923;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 0985ff2..294ef4d 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 _0xb6bc=['push','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','MailAccountId','subjectOffline','offlineMessageSubject','NotifyMailAccount','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','../../config/license/util','virtual','custom','License','increment','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','length','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','sitepic','download','getAvatar','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','autoclose'];(function(_0x3537ba,_0x2d30d8){var _0x393f1e=function(_0x45aba0){while(--_0x45aba0){_0x3537ba['push'](_0x3537ba['shift']());}};_0x393f1e(++_0x2d30d8);}(_0xb6bc,0x70));var _0xcb6b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb6bc[_0x13e741];return _0x3f8bb3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcb6b('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xcb6b('0x1'));var fs=require('fs');var fs_extra=require(_0xcb6b('0x2'));var _=require(_0xcb6b('0x3'));var querystring=require(_0xcb6b('0x4'));var Redis=require(_0xcb6b('0x5'));var qs=require(_0xcb6b('0x6'));var logger=require(_0xcb6b('0x7'))(_0xcb6b('0x8'));var config=require(_0xcb6b('0x9'));var url=require(_0xcb6b('0xa'));var db=require(_0xcb6b('0xb'))['db'];config[_0xcb6b('0xc')]=_[_0xcb6b('0xd')](config[_0xcb6b('0xc')],{'host':_0xcb6b('0xe'),'port':0x18eb});var socket=require(_0xcb6b('0xf'))(new Redis(config[_0xcb6b('0xc')]));require('./chatWebsite.socket')[_0xcb6b('0x10')](socket);var htmlToText=require(_0xcb6b('0x11'));var jayson=require(_0xcb6b('0x12'));var client=jayson[_0xcb6b('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x232a});var client9003=jayson['client'][_0xcb6b('0x14')]({'port':0x232b});var client9001=jayson[_0xcb6b('0x13')][_0xcb6b('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x34b262,_0x322e16,_0x4e31fd,_0x44a21a){return new BPromise(function(_0x76a4c,_0x34dad0){var _0x1e0cf1=_0x44a21a||client;return _0x1e0cf1['request'](_0x34b262,_0x4e31fd)[_0xcb6b('0x15')](function(_0x2e7d15){logger[_0xcb6b('0x16')](_0xcb6b('0x17'),_0x322e16,_0xcb6b('0x18'));logger[_0xcb6b('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x322e16,_0xcb6b('0x18'),JSON[_0xcb6b('0x1a')](_0x2e7d15));if(_0x2e7d15[_0xcb6b('0x1b')]){if(_0x2e7d15['error'][_0xcb6b('0x1c')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x34dad0(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}logger[_0xcb6b('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,_0x2e7d15[_0xcb6b('0x1b')]['message']);return _0x76a4c(_0x2e7d15[_0xcb6b('0x1b')][_0xcb6b('0x1d')]);}else{logger[_0xcb6b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x322e16,'request\x20sent');_0x76a4c(_0x2e7d15['result'][_0xcb6b('0x1d')]);}})[_0xcb6b('0x1e')](function(_0x13b3e4){logger[_0xcb6b('0x1b')](_0xcb6b('0x17'),_0x322e16,_0x13b3e4);_0x34dad0(_0x13b3e4);});});}function respondWithStatusCode(_0x326aee,_0x3394a8){_0x3394a8=_0x3394a8||0xcc;return function(_0x433809){if(_0x433809){return _0x326aee[_0xcb6b('0x1f')](_0x3394a8);}return _0x326aee[_0xcb6b('0x20')](_0x3394a8)[_0xcb6b('0x21')]();};}function respondWithResult(_0x54947b,_0x14bfb0){_0x14bfb0=_0x14bfb0||0xc8;return function(_0x5397ce){if(_0x5397ce){return _0x54947b[_0xcb6b('0x20')](_0x14bfb0)[_0xcb6b('0x22')](_0x5397ce);}};}function respondWithFilteredResult(_0x20bfe5,_0x31ccf5){return function(_0xd8ba2b){if(_0xd8ba2b){var _0x2719d1=typeof _0x31ccf5[_0xcb6b('0x23')]===_0xcb6b('0x24')&&typeof _0x31ccf5['limit']===_0xcb6b('0x24');var _0x1ba8d6=_0xd8ba2b['count'];var _0x3386e3=_0x2719d1?0x0:_0x31ccf5[_0xcb6b('0x23')];var _0xc2652e=_0x2719d1?_0xd8ba2b[_0xcb6b('0x25')]:_0x31ccf5[_0xcb6b('0x23')]+_0x31ccf5[_0xcb6b('0x26')];var _0x3ee695;if(_0xc2652e>=_0x1ba8d6){_0xc2652e=_0x1ba8d6;_0x3ee695=0xc8;}else{_0x3ee695=0xce;}_0x20bfe5['status'](_0x3ee695);return _0x20bfe5[_0xcb6b('0x27')](_0xcb6b('0x28'),_0x3386e3+'-'+_0xc2652e+'/'+_0x1ba8d6)[_0xcb6b('0x22')](_0xd8ba2b);}return null;};}function saveUpdates(_0x3da9a7){return function(_0x5a193f){if(_0x5a193f){return _0x5a193f['update'](_0x3da9a7)[_0xcb6b('0x15')](function(_0x59539f){return _0x59539f;});}return null;};}function removeEntity(_0x2e7399){return function(_0x528c5e){if(_0x528c5e){return _0x528c5e[_0xcb6b('0x29')]()[_0xcb6b('0x15')](function(){var _0x42e4e8=_0x528c5e[_0xcb6b('0x2a')]({'plain':!![]});var _0x3317a7=_0xcb6b('0x2b');return db['UserProfileResource'][_0xcb6b('0x29')]({'where':{'type':_0x3317a7,'resourceId':_0x42e4e8['id']}})[_0xcb6b('0x15')](function(){return _0x528c5e;});})[_0xcb6b('0x15')](function(){_0x2e7399[_0xcb6b('0x20')](0xcc)[_0xcb6b('0x21')]();});}};}function handleEntityNotFound(_0xc8d9fa){return function(_0x5928f3){if(!_0x5928f3){_0xc8d9fa[_0xcb6b('0x1f')](0x194);}return _0x5928f3;};}function handleError(_0x298609,_0x2ed878){_0x2ed878=_0x2ed878||0x1f4;return function(_0x2f654a){logger['error'](_0x2f654a[_0xcb6b('0x2c')]);if(_0x2f654a[_0xcb6b('0x2d')]){delete _0x2f654a[_0xcb6b('0x2d')];}_0x298609['status'](_0x2ed878)[_0xcb6b('0x2e')](_0x2f654a);};}exports[_0xcb6b('0x2f')]=function(_0x17ee5f,_0x3fb597){var _0xd39505={'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x226ab2={},_0x5a77cb={'count':0x0,'rows':[]};var _0x3aa1de=_[_0xcb6b('0x32')](db[_0xcb6b('0x33')][_0xcb6b('0x34')],function(_0x5eb3a8){return{'name':_0x5eb3a8['fieldName'],'type':_0x5eb3a8[_0xcb6b('0x35')][_0xcb6b('0x36')]};});_0x226ab2[_0xcb6b('0x37')]=_['map'](_0x3aa1de,_0xcb6b('0x2d'));_0x226ab2[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x17ee5f['query']);_0x226ab2[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],_0x226ab2[_0xcb6b('0x38')]);_0xd39505['attributes']=_[_0xcb6b('0x3b')](_0x226ab2[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0xd39505[_0xcb6b('0x3d')]=_0xd39505[_0xcb6b('0x3d')]['length']?_0xd39505[_0xcb6b('0x3d')]:_0x226ab2[_0xcb6b('0x37')];if(!_0x17ee5f[_0xcb6b('0x38')]['hasOwnProperty'](_0xcb6b('0x3e'))){_0xd39505['limit']=qs[_0xcb6b('0x26')](_0x17ee5f['query'][_0xcb6b('0x26')]);_0xd39505[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x17ee5f[_0xcb6b('0x38')]['offset']);}_0xd39505[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0xd39505[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x17ee5f['query'],_0x226ab2[_0xcb6b('0x3a')]),_0x3aa1de);if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0xd39505[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0xd39505['where'],{'$or':_['map'](_0x3aa1de,function(_0x162381){if(_0x162381[_0xcb6b('0x35')]!==_0xcb6b('0x45')){var _0x5033bb={};_0x5033bb[_0x162381[_0xcb6b('0x2d')]]={'$like':'%'+_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x5033bb;}})});}_0xd39505=_[_0xcb6b('0x44')]({},_0xd39505,_0x17ee5f[_0xcb6b('0x46')]);var _0x253f48={'where':_0xd39505[_0xcb6b('0x41')]};return db[_0xcb6b('0x33')][_0xcb6b('0x25')](_0x253f48)[_0xcb6b('0x15')](function(_0x282d9e){_0x5a77cb['count']=_0x282d9e;if(_0x17ee5f[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0xd39505['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xcb6b('0x48')](_0xd39505);})['then'](function(_0x59b960){_0x5a77cb[_0xcb6b('0x49')]=_0x59b960;return _0x5a77cb;})[_0xcb6b('0x15')](respondWithFilteredResult(_0x3fb597,_0xd39505))[_0xcb6b('0x1e')](handleError(_0x3fb597,null));};exports[_0xcb6b('0x4a')]=function(_0x32f23a,_0x41bbf4){var _0x44957f={'raw':![],'where':{'id':_0x32f23a['params']['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]},_0x9bc740={};_0x9bc740[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatWebsite'][_0xcb6b('0x34')]);_0x9bc740[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x32f23a[_0xcb6b('0x38')]);_0x9bc740['filters']=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],_0x9bc740[_0xcb6b('0x38')]);_0x44957f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x9bc740[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x44957f[_0xcb6b('0x3d')]=_0x44957f['attributes'][_0xcb6b('0x4b')]?_0x44957f['attributes']:_0x9bc740[_0xcb6b('0x37')];if(_0x32f23a[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x44957f[_0xcb6b('0x4c')]=[{'all':!![]}];}_0x44957f=_[_0xcb6b('0x44')]({},_0x44957f,_0x32f23a[_0xcb6b('0x46')]);return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x44957f)[_0xcb6b('0x15')](handleEntityNotFound(_0x41bbf4,null))[_0xcb6b('0x15')](respondWithResult(_0x41bbf4,null))['catch'](handleError(_0x41bbf4,null));};exports[_0xcb6b('0x4e')]=function(_0x39222e,_0x2a8b26){return db[_0xcb6b('0x33')][_0xcb6b('0x4e')](_0x39222e[_0xcb6b('0x4f')],{})[_0xcb6b('0x15')](function(_0x640dbc){var _0x599255=_0x39222e[_0xcb6b('0x50')][_0xcb6b('0x2a')]({'plain':!![]});if(!_0x599255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599255['role']===_0xcb6b('0x50')){var _0x5bf453=_0x640dbc['get']({'plain':!![]});var _0x1d0b0b='ChatWebsites';return db[_0xcb6b('0x51')][_0xcb6b('0x4d')]({'where':{'name':_0x1d0b0b,'userProfileId':_0x599255[_0xcb6b('0x52')]},'raw':!![]})['then'](function(_0x387017){if(_0x387017&&_0x387017[_0xcb6b('0x53')]===0x0){return db['UserProfileResource'][_0xcb6b('0x4e')]({'name':_0x5bf453[_0xcb6b('0x2d')],'resourceId':_0x5bf453['id'],'type':_0x387017[_0xcb6b('0x2d')],'sectionId':_0x387017['id']},{})[_0xcb6b('0x15')](function(){return _0x640dbc;});}else{return _0x640dbc;}})[_0xcb6b('0x1e')](function(_0x5b7333){logger[_0xcb6b('0x1b')](_0xcb6b('0x54'),_0x5b7333);throw _0x5b7333;});}return _0x640dbc;})[_0xcb6b('0x15')](respondWithResult(_0x2a8b26,0xc9))[_0xcb6b('0x1e')](handleError(_0x2a8b26,null));};exports[_0xcb6b('0x55')]=function(_0x125869,_0x1c9978){if(_0x125869[_0xcb6b('0x4f')]['id']){delete _0x125869[_0xcb6b('0x4f')]['id'];}return db['ChatWebsite'][_0xcb6b('0x4d')]({'where':{'id':_0x125869[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0x30')],'as':_0xcb6b('0x31')}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c9978,null))[_0xcb6b('0x15')](saveUpdates(_0x125869[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x1c9978,null))[_0xcb6b('0x1e')](handleError(_0x1c9978,null));};exports[_0xcb6b('0x29')]=function(_0x4c3194,_0x14ad23){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4c3194[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x14ad23,null))[_0xcb6b('0x15')](removeEntity(_0x14ad23,null))[_0xcb6b('0x1e')](handleError(_0x14ad23,null));};exports['describe']=function(_0x5293e1,_0xf71291){return db[_0xcb6b('0x33')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](respondWithResult(_0xf71291,null))[_0xcb6b('0x1e')](handleError(_0xf71291,null));};exports[_0xcb6b('0x58')]=function(_0x3a4bd9,_0x1c60e7){if(_0x3a4bd9[_0xcb6b('0x4f')]['id']){delete _0x3a4bd9[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3a4bd9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1c60e7,null))[_0xcb6b('0x15')](function(_0x3c7c8e){if(_0x3c7c8e){_0x3a4bd9['body']['ChatWebsiteId']=_0x3c7c8e['id'];return db[_0xcb6b('0x59')][_0xcb6b('0x4e')](_0x3a4bd9[_0xcb6b('0x4f')]);}})['then'](respondWithResult(_0x1c60e7,null))[_0xcb6b('0x1e')](handleError(_0x1c60e7,null));};exports[_0xcb6b('0x5a')]=function(_0x1821f3,_0x408dc8){var _0x531ffe={'raw':![],'where':{}};var _0x502f85={};var _0x5399ac={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')][_0xcb6b('0x5b')]({'where':{'id':_0x1821f3[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x408dc8,null))[_0xcb6b('0x15')](function(_0x1a4623){if(_0x1a4623){_0x502f85[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db[_0xcb6b('0x59')][_0xcb6b('0x34')]);_0x502f85[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x1821f3[_0xcb6b('0x38')]);_0x502f85[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x502f85[_0xcb6b('0x37')],_0x502f85[_0xcb6b('0x38')]);_0x531ffe[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x502f85['model'],qs[_0xcb6b('0x3c')](_0x1821f3['query'][_0xcb6b('0x3c')]));_0x531ffe[_0xcb6b('0x3d')]=_0x531ffe[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x531ffe[_0xcb6b('0x3d')]:_0x502f85[_0xcb6b('0x37')];if(!_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x531ffe[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x531ffe[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x1821f3['query'][_0xcb6b('0x23')]);}_0x531ffe[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x1821f3[_0xcb6b('0x38')]['sort']);_0x531ffe[_0xcb6b('0x41')]=qs['filters'](_[_0xcb6b('0x42')](_0x1821f3[_0xcb6b('0x38')],_0x502f85['filters']));_0x531ffe['where']['ChatWebsiteId']=_0x1a4623['id'];if(_0x1821f3[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x531ffe[_0xcb6b('0x41')]=_['merge'](_0x531ffe[_0xcb6b('0x41')],{'$or':_['map'](_0x531ffe['attributes'],function(_0x5d9c79){var _0x21ba25={};_0x21ba25[_0x5d9c79]={'$like':'%'+_0x1821f3['query']['filter']+'%'};return _0x21ba25;})});}_0x531ffe=_[_0xcb6b('0x44')]({},_0x531ffe,_0x1821f3[_0xcb6b('0x46')]);return db[_0xcb6b('0x59')][_0xcb6b('0x25')]({'where':_0x531ffe[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x1a6039){_0x5399ac['count']=_0x1a6039;if(_0x1821f3['query'][_0xcb6b('0x47')]){_0x531ffe[_0xcb6b('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0xcb6b('0x48')](_0x531ffe);})['then'](function(_0x1f6aa5){_0x5399ac[_0xcb6b('0x49')]=_0x1f6aa5;return _0x5399ac;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x408dc8,_0x531ffe))[_0xcb6b('0x1e')](handleError(_0x408dc8,null));};exports[_0xcb6b('0x5d')]=function(_0x55bd84,_0x1bd80b){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x55bd84['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1bd80b,null))['then'](function(_0x3c5ebe){if(_0x3c5ebe){return _0x3c5ebe['removeDispositions'](_0x55bd84[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x1bd80b,null))[_0xcb6b('0x1e')](handleError(_0x1bd80b,null));};exports['addAnswer']=function(_0x49501d,_0x37b4ad){if(_0x49501d[_0xcb6b('0x4f')]['id']){delete _0x49501d[_0xcb6b('0x4f')]['id'];}return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x49501d[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x37b4ad,null))[_0xcb6b('0x15')](function(_0x266acb){if(_0x266acb){_0x49501d['body'][_0xcb6b('0x5f')]=_0x266acb['id'];return db[_0xcb6b('0x60')]['create'](_0x49501d[_0xcb6b('0x4f')]);}})[_0xcb6b('0x15')](respondWithResult(_0x37b4ad,null))[_0xcb6b('0x1e')](handleError(_0x37b4ad,null));};exports[_0xcb6b('0x61')]=function(_0x4e584c,_0x42bec8){var _0x4d741a={'raw':![],'where':{}};var _0x113097={};var _0x123473={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4e584c[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x42bec8,null))[_0xcb6b('0x15')](function(_0x1adb9b){if(_0x1adb9b){_0x113097[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0x60')][_0xcb6b('0x34')]);_0x113097[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4e584c[_0xcb6b('0x38')]);_0x113097[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],_0x113097[_0xcb6b('0x38')]);_0x4d741a[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x113097[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x4e584c[_0xcb6b('0x38')]['fields']));_0x4d741a[_0xcb6b('0x3d')]=_0x4d741a['attributes'][_0xcb6b('0x4b')]?_0x4d741a[_0xcb6b('0x3d')]:_0x113097[_0xcb6b('0x37')];if(!_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x4d741a[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4e584c['query']['limit']);_0x4d741a[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4e584c['query'][_0xcb6b('0x23')]);}_0x4d741a['order']=qs[_0xcb6b('0x40')](_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x4d741a[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4e584c['query'],_0x113097[_0xcb6b('0x3a')]));_0x4d741a[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x1adb9b['id'];if(_0x4e584c['query']['filter']){_0x4d741a[_0xcb6b('0x41')]=_[_0xcb6b('0x44')](_0x4d741a[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x4d741a[_0xcb6b('0x3d')],function(_0x5196e7){var _0x5931b4={};_0x5931b4[_0x5196e7]={'$like':'%'+_0x4e584c['query']['filter']+'%'};return _0x5931b4;})});}_0x4d741a=_['merge']({},_0x4d741a,_0x4e584c[_0xcb6b('0x46')]);return db[_0xcb6b('0x60')]['count']({'where':_0x4d741a['where']})[_0xcb6b('0x15')](function(_0x16e496){_0x123473[_0xcb6b('0x25')]=_0x16e496;if(_0x4e584c[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x4d741a[_0xcb6b('0x4c')]=[{'all':!![]}];}return db[_0xcb6b('0x60')]['findAll'](_0x4d741a);})['then'](function(_0x61ddad){_0x123473[_0xcb6b('0x49')]=_0x61ddad;return _0x123473;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x42bec8,_0x4d741a))['catch'](handleError(_0x42bec8,null));};exports[_0xcb6b('0x62')]=function(_0x5544ea,_0x56c4f6){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5544ea[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x56c4f6,null))[_0xcb6b('0x15')](function(_0x56a002){if(_0x56a002){return _0x56a002[_0xcb6b('0x62')](_0x5544ea[_0xcb6b('0x38')][_0xcb6b('0x5e')]);}})[_0xcb6b('0x15')](respondWithStatusCode(_0x56c4f6,null))[_0xcb6b('0x1e')](handleError(_0x56c4f6,null));};exports[_0xcb6b('0x63')]=function(_0x4a7615,_0x383992){_0x4a7615[_0xcb6b('0x4f')]['sitepic']=_0x4a7615['file'][_0xcb6b('0x64')];return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x4a7615[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x383992,null))[_0xcb6b('0x15')](saveUpdates(_0x4a7615[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x383992,null))[_0xcb6b('0x1e')](handleError(_0x383992,null));};exports['addAvatar']=function(_0x4e9e35,_0x24ce74){_0x4e9e35[_0xcb6b('0x4f')][_0xcb6b('0x65')]=_0x4e9e35[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4e9e35[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x24ce74,null))[_0xcb6b('0x15')](saveUpdates(_0x4e9e35['body'],null))['then'](respondWithResult(_0x24ce74,null))[_0xcb6b('0x1e')](handleError(_0x24ce74,null));};exports[_0xcb6b('0x67')]=function(_0x5b2633,_0x5b4a56){_0x5b2633[_0xcb6b('0x4f')][_0xcb6b('0x68')]=_0x5b2633[_0xcb6b('0x66')][_0xcb6b('0x64')];return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x5b2633[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5b4a56,null))[_0xcb6b('0x15')](saveUpdates(_0x5b2633['body'],null))[_0xcb6b('0x15')](respondWithResult(_0x5b4a56,null))[_0xcb6b('0x1e')](handleError(_0x5b4a56,null));};exports[_0xcb6b('0x69')]=function(_0x23549f,_0x414932){_0x23549f['body']['systemAvatar']=_0x23549f[_0xcb6b('0x66')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x23549f['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x414932,null))[_0xcb6b('0x15')](saveUpdates(_0x23549f[_0xcb6b('0x4f')],null))[_0xcb6b('0x15')](respondWithResult(_0x414932,null))['catch'](handleError(_0x414932,null));};exports[_0xcb6b('0x6a')]=function(_0x5b57d2,_0x5650a6){var _0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x6d'));var _0x12a87a={'where':{'id':_0x5b57d2['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5cf140=![];return require('../../config/license/util')[_0xcb6b('0x6e')]()[_0xcb6b('0x15')](function(_0x162e0e){if(_0x162e0e){_0x5cf140=_0x162e0e['custom'];}})['then'](function(){return db[_0xcb6b('0x33')]['find'](_0x12a87a);})[_0xcb6b('0x15')](handleEntityNotFound(_0x5650a6,null))[_0xcb6b('0x15')](function(_0x5e6c66){if(_0x5e6c66){if(!_[_0xcb6b('0x6f')](_0x5e6c66[_0xcb6b('0x70')])){if(fs['existsSync'](path['join'](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66[_0xcb6b('0x70')]))&&_0x5cf140){_0x44959d=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/logos/',_0x5e6c66['sitepic']);}}return _0x5650a6[_0xcb6b('0x71')](_0x44959d);}})[_0xcb6b('0x1e')](handleError(_0x5650a6,null));};exports[_0xcb6b('0x72')]=function(_0x354d9b,_0x50f977){var _0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/default_avatar.png');var _0x4dbdd2={'where':{'id':_0x354d9b[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x65')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x4dbdd2)[_0xcb6b('0x15')](handleEntityNotFound(_0x50f977,null))['then'](function(_0x102acb){if(_0x102acb){if(!_['isNil'](_0x102acb[_0xcb6b('0x65')])){if(fs[_0xcb6b('0x73')](path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x102acb['agentAvatar']))){_0x9d8b67=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x102acb[_0xcb6b('0x65')]);}}return _0x50f977[_0xcb6b('0x71')](_0x9d8b67);}})['catch'](handleError(_0x50f977,null));};exports['getCustomerAvatar']=function(_0x23c4d4,_0x5c5418){var _0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x75'));var _0x418e71={'where':{'id':_0x23c4d4[_0xcb6b('0x56')]['id']},'attributes':['id',_0xcb6b('0x68'),_0xcb6b('0x76')],'raw':!![]};return db[_0xcb6b('0x33')]['find'](_0x418e71)['then'](handleEntityNotFound(_0x5c5418,null))[_0xcb6b('0x15')](function(_0x1186ce){if(_0x1186ce){if(!_[_0xcb6b('0x6f')](_0x1186ce[_0xcb6b('0x68')])){if(fs['existsSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/images/avatars/',_0x1186ce['customerAvatar']))&&_0x1186ce[_0xcb6b('0x76')]){_0x3674ad=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x1186ce[_0xcb6b('0x68')]);}}return _0x5c5418[_0xcb6b('0x71')](_0x3674ad);}})[_0xcb6b('0x1e')](handleError(_0x5c5418,null));};exports[_0xcb6b('0x77')]=function(_0x4cb1b0,_0x98e193){var _0x725003=path['join'](config[_0xcb6b('0x6c')],_0xcb6b('0x78'));var _0x3b4087={'where':{'id':_0x4cb1b0[_0xcb6b('0x56')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcb6b('0x33')][_0xcb6b('0x4d')](_0x3b4087)[_0xcb6b('0x15')](handleEntityNotFound(_0x98e193,null))[_0xcb6b('0x15')](function(_0x2d4bbc){if(_0x2d4bbc){if(!_['isNil'](_0x2d4bbc[_0xcb6b('0x79')])){if(fs[_0xcb6b('0x73')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0x74'),_0x2d4bbc[_0xcb6b('0x79')]))){_0x725003=path[_0xcb6b('0x6b')](config['root'],'server/files/images/avatars/',_0x2d4bbc['systemAvatar']);}}return _0x98e193['download'](_0x725003);}})['catch'](handleError(_0x98e193,null));};exports['notify']=function(_0x213f41,_0x26af19){var _0x53d0e1=require(_0xcb6b('0x7a'));var _0x6af048=new _0x53d0e1();var _0xdb70d9=_0x6af048[_0xcb6b('0x7b')](_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x7d')])['getResult']();var _0x5dcd41={'body':_0x213f41['body'],'channel':_0xcb6b('0x7e')};var _0x1db364=[];var _0x228733=[];var _0x8dad9b={};var _0x197341=![];return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x1c8895){if(!_0x1c8895){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0x1db364=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),['createdAt','updatedAt']);_0x228733=_[_0xcb6b('0x83')](_[_0xcb6b('0x39')](_0x1c8895),[_0xcb6b('0x84'),_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x213f41[_0xcb6b('0x4f')]['id']){delete _0x213f41[_0xcb6b('0x4f')]['id'];}if(_[_0xcb6b('0x6f')](_0x213f41['body'][_0xcb6b('0x88')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xcb6b('0x6f')](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x213f41[_0xcb6b('0x4f')]['body']===''){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x89'));}if(_['isNil'](_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8b')+_0x228733);}if(!_[_0xcb6b('0x8c')](_0x228733,_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')])){throw new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0x8d')+_0x228733);}_0x8dad9b[_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x8a')]]=_0x213f41['body']['from'];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x213f41[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e'),'include':[{'model':db['CmContact'],'as':_0xcb6b('0x8f'),'where':_0x8dad9b,'limit':0x1,'order':[[_0xcb6b('0x85'),'DESC']]}]},{'model':db[_0xcb6b('0x90')],'as':_0xcb6b('0x91')}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x368fc8){if(_0x368fc8&&_0x368fc8[_0xcb6b('0x8e')]){_0x5dcd41[_0xcb6b('0x92')]=_0x368fc8;_0x5dcd41[_0xcb6b('0x93')]=_0x368fc8[_0xcb6b('0x91')];_0x5dcd41['list']=_0x368fc8[_0xcb6b('0x8e')];_0x5dcd41[_0xcb6b('0x93')]=_[_0xcb6b('0x94')](_0x5dcd41[_0xcb6b('0x93')],[_0xcb6b('0x95')],[_0xcb6b('0x96')]);if(_0x5dcd41['account'][_0xcb6b('0x91')]){delete _0x5dcd41[_0xcb6b('0x92')]['Applications'];}if(_0x5dcd41['account'][_0xcb6b('0x8e')]&&_0x5dcd41[_0xcb6b('0x92')]['List']['Contacts'][_0xcb6b('0x4b')]){return _0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0x8e')][_0xcb6b('0x8f')][0x0];}var _0xcbd5af=_[_0xcb6b('0xd')](_0x213f41[_0xcb6b('0x4f')],{'firstName':_0x213f41['body'][_0xcb6b('0x88')],'ListId':_0x368fc8[_0xcb6b('0x87')]});_0xcbd5af[_0x213f41['body'][_0xcb6b('0x8a')]]=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0x4e')](_0xcbd5af,{'fields':_0x1db364,'raw':!![]});}})[_0xcb6b('0x15')](handleEntityNotFound(_0x26af19,null))[_0xcb6b('0x15')](function(_0x51aff8){_0x5dcd41[_0xcb6b('0x97')]=_0x51aff8;var _0x17e057=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x98')];if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')]){_0x17e057=_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x99')];}else if(_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9a')]){_0x17e057=_[_0xcb6b('0x9b')](_0x213f41['headers'][_0xcb6b('0x9a')][_0xcb6b('0x9c')](','));}if(_0x51aff8){var _0x52fffb={'ContactId':_0x51aff8['id'],'ChatWebsiteId':_0x213f41['params']['id'],'from':(_0x51aff8[_0xcb6b('0x9d')]||'')+'\x20'+(_0x51aff8[_0xcb6b('0x9e')]||''),'customerIp':_0x17e057,'customerPort':_0x213f41[_0xcb6b('0x7c')][_0xcb6b('0x9f')]?_0x213f41[_0xcb6b('0x7c')]['x-real-port']:null,'referer':_0x213f41[_0xcb6b('0x4f')]['referer'],'browserName':_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')]&&_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]?util['format']('%s\x20%s',_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0x2d')],_0xdb70d9[_0xcb6b('0xa0')][_0xcb6b('0xa1')]):_0xcb6b('0xa2'),'browserVersion':_0xdb70d9['browser']['version']||_0xcb6b('0xa2'),'osName':util[_0xcb6b('0xa3')](_0xcb6b('0xa4'),_0xdb70d9['os'][_0xcb6b('0x2d')],_0xdb70d9['os']['version']),'osVersion':_0xdb70d9['os'][_0xcb6b('0xa1')],'deviceModel':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x37')]&&_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0xa6')]?util[_0xcb6b('0xa3')](_0xcb6b('0xa7'),_0xdb70d9['device'][_0xcb6b('0x37')],_0xdb70d9[_0xcb6b('0xa5')]['vendor'],_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')]):null,'deviceVendor':_0xdb70d9['device'][_0xcb6b('0xa6')],'deviceType':_0xdb70d9[_0xcb6b('0xa5')][_0xcb6b('0x35')],'formData':JSON[_0xcb6b('0x1a')](_0x213f41[_0xcb6b('0x4f')])};var _0x5830ba={'ChatWebsiteId':_0x213f41['params']['id'],'closed':![]};if(_0x213f41[_0xcb6b('0x4f')]['threadId']){_0x5830ba[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x22d1d7){if(_0x22d1d7){return[_0x22d1d7,![]];}_0x52fffb[_0xcb6b('0xa8')]=_0x213f41[_0xcb6b('0x4f')]['threadId'];_0x52fffb[_0xcb6b('0xaa')]=_0x213f41['body'][_0xcb6b('0xaa')];return db[_0xcb6b('0xa9')][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x12b7b1){return[_0x12b7b1,!![]];});});}_0x5830ba[_0xcb6b('0xab')]=_0x51aff8['id'];if(_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]&&_0x213f41['body'][_0xcb6b('0xac')]['id']){_0x5830ba['id']=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xac')]['id'];return db[_0xcb6b('0xa9')][_0xcb6b('0x4d')]({'where':_0x5830ba})[_0xcb6b('0x15')](function(_0x3ef06a){if(_0x3ef06a){return[_0x3ef06a,![]];}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x4a5a20){return[_0x4a5a20,!![]];});});}return db['ChatInteraction'][_0xcb6b('0x4e')](_0x52fffb)[_0xcb6b('0x15')](function(_0x316e4b){return[_0x316e4b,!![]];});}})[_0xcb6b('0xad')](function(_0x1143fb,_0xc23e2f){if(_0x1143fb){_0x197341=_0xc23e2f;if(!_0xc23e2f){var _0x1753a8={'from':(_0x5dcd41[_0xcb6b('0x97')][_0xcb6b('0x9d')]||'')+'\x20'+(_0x5dcd41[_0xcb6b('0x97')]['lastName']||'')};if(_0x213f41['body'][_0xcb6b('0xa8')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]&&_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xa8')]!=_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xae')]){_0x1753a8['threadId']=_0x213f41['body'][_0xcb6b('0xae')];}return _0x1143fb[_0xcb6b('0x55')](_0x1753a8);}else{return _0x1143fb;}}})['then'](function(_0x24a5f3){_0x5dcd41[_0xcb6b('0xac')]=_0x24a5f3['get']({'plain':!![]});_0x5dcd41[_0xcb6b('0xac')]['created']=_0x197341;if(_0x5dcd41[_0xcb6b('0xac')]['created']){if(_0x5dcd41[_0xcb6b('0x92')][_0xcb6b('0xaf')]){_0x5dcd41['applications'][_0xcb6b('0xb0')]({'id':0x0,'priority':_0x5dcd41['applications'][_0xcb6b('0x4b')]+0x1,'app':_0xcb6b('0xb1'),'appdata':'unmanaged','interval':_0xcb6b('0xb2')});}}return db['ChatMessage']['create']({'body':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0x4f')],'ChatWebsiteId':_0x213f41[_0xcb6b('0x56')]['id'],'ChatInteractionId':_0x24a5f3['id'],'direction':'in','ContactId':_0x5dcd41[_0xcb6b('0x97')]['id'],'AttachmentId':_0x213f41[_0xcb6b('0x4f')][_0xcb6b('0xb3')]});})['then'](function(_0x59bbd7){_0x5dcd41[_0xcb6b('0x1d')]=_0x59bbd7;if(_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]){return db[_0xcb6b('0xb5')]['find']({'attributes':['id','name'],'where':{'id':_0x5dcd41[_0xcb6b('0xac')][_0xcb6b('0xb4')]}})[_0xcb6b('0x15')](function(_0x18380e){if(_0x18380e){_0x5dcd41['applications'][_0xcb6b('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x18380e[_0xcb6b('0x2d')]+','+(_0x5dcd41['account'][_0xcb6b('0xb7')]||0xa),'interval':'*,*,*,*'});_0x5dcd41[_0xcb6b('0xb8')]=!![];}return respondWithRpcPromise(_0xcb6b('0xb9'),_0xcb6b('0xba'),_0x5dcd41);});}return respondWithRpcPromise(_0xcb6b('0xb9'),'startRouting',_0x5dcd41);})[_0xcb6b('0x15')](function(_0xe64709){respondWithRpcPromise('EventManager',_0xcb6b('0xbb'),{'event':_0xcb6b('0xbc'),'message':_0xe64709},client9002);return _0xe64709;})[_0xcb6b('0x15')](respondWithResult(_0x26af19,null))[_0xcb6b('0x1e')](handleError(_0x26af19,null));};exports[_0xcb6b('0xbd')]=function(_0x3475c8,_0x37f5a3){var _0x2a9a26,_0x4945c2,_0x4e4324;var _0xea7466=[];var _0x1c923d={};var _0x219d06=_0x3475c8[_0xcb6b('0xbe')]||[];var _0x19f79b=[];var _0x2e6b98;return db[_0xcb6b('0x7f')][_0xcb6b('0x57')]()[_0xcb6b('0x15')](function(_0x7a05a6){if(!_0x7a05a6){throw new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x82'));}_0xea7466=_['difference'](_[_0xcb6b('0x39')](_0x7a05a6),['createdAt',_0xcb6b('0x85'),_0xcb6b('0x86'),_0xcb6b('0x87')]);if(_0x3475c8[_0xcb6b('0x4f')]['id']){delete _0x3475c8[_0xcb6b('0x4f')]['id'];}if(_['isNil'](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xcb6b('0x6f')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')])||_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]===''){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)['send'](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0x89')));}if(_['isNil'](_0x3475c8['body']['mapKeyOffline'])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))]['ValidationError'](_0xcb6b('0xbf')+_0xea7466));}if(!_[_0xcb6b('0x8c')](_0xea7466,_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')])){throw _0x37f5a3[_0xcb6b('0x20')](0x1f4)[_0xcb6b('0x2e')](new db[(_0xcb6b('0x80'))][(_0xcb6b('0x81'))](_0xcb6b('0xc1')+_0xea7466));}_0x1c923d[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')];})[_0xcb6b('0x15')](function(){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x3475c8[_0xcb6b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb6b('0x8e')},{'model':db[_0xcb6b('0xc2')],'as':'MailAccount'}]});})[_0xcb6b('0x15')](handleEntityNotFound(_0x37f5a3,null))[_0xcb6b('0x15')](function(_0x511521){if(_0x511521&&_0x511521[_0xcb6b('0x8e')]){_0x4945c2=_0x511521;var _0x136fbc=_['defaults'](_0x3475c8[_0xcb6b('0x4f')],{'firstName':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'phone':_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x88')],'ListId':_0x511521['ListId']});_0x136fbc[_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0xc0')]]=_0x3475c8['body'][_0xcb6b('0x88')];return db[_0xcb6b('0x7f')][_0xcb6b('0xc3')]({'where':_0x1c923d,'defaults':_0x136fbc});}})['spread'](function(_0x20ac01){if(_0x20ac01){_0x4e4324=_0x20ac01;var _0x3bc481=fs[_0xcb6b('0xc4')](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0xcb6b('0xc5'));var _0x10912e=ejs[_0xcb6b('0xc6')](_0x3bc481,{'body':_[_0xcb6b('0xc7')](_0x3475c8[_0xcb6b('0x4f')][_0xcb6b('0x4f')]),'bodyTitle':_0x4945c2['offlineMessageBody']});return db[_0xcb6b('0xc8')][_0xcb6b('0x4e')]({'body':_0x10912e,'plainBody':htmlToText[_0xcb6b('0xc9')](_0x10912e),'ContactId':_0x20ac01['id'],'ChatWebsiteId':_0x4945c2['id']});}})[_0xcb6b('0x15')](function(_0x54af07){_0x2e6b98=_0x54af07;if(_0x219d06[_0xcb6b('0x4b')]){var _0x562ca5=_0x219d06[_0xcb6b('0x32')](function(_0x35bb9d){return{'name':_0x35bb9d[_0xcb6b('0xca')],'basename':_0x35bb9d[_0xcb6b('0x64')],'type':_0x35bb9d[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x54af07['id']};});_0x19f79b=_0x562ca5[_0xcb6b('0x32')](_0x15fa4a=>{var _0x5c85f2={'filename':_0x15fa4a[_0xcb6b('0x2d')],'path':path[_0xcb6b('0x6b')](config['root'],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x15fa4a[_0xcb6b('0xcf')])};return _0x5c85f2;});if(!_0x4945c2[_0xcb6b('0xd0')]){return db[_0xcb6b('0xd1')]['transaction'](function(_0x5c29ee){return db['Attachment'][_0xcb6b('0xd2')](_0x562ca5,{'transaction':_0x5c29ee});});}}})[_0xcb6b('0x15')](function(){if(_0x2e6b98){_0x2a9a26=_0x2e6b98;return db[_0xcb6b('0xc2')][_0xcb6b('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xcb6b('0xd3'),'raw':!![],'include':[{'model':db[_0xcb6b('0xd4')],'as':_0xcb6b('0xd4'),'raw':!![]}]}]});}})[_0xcb6b('0x15')](function(_0x436b0f){if(_0x436b0f&&_0x436b0f[_0xcb6b('0xd3')]&&_0x4945c2[_0xcb6b('0xd5')]&&_0x4945c2['forwardOfflineAddress']){var _0x3b0d70=_0x436b0f[_0xcb6b('0xd6')]();return respondWithRpcPromise(_0xcb6b('0xd7'),_0xcb6b('0xd8'),{'account':_0x3b0d70,'message':{'from':util[_0xcb6b('0xa3')]('\x22%s\x22\x20<%s>',_0x436b0f[_0xcb6b('0x2d')],_0x436b0f[_0xcb6b('0xd9')]||_0x436b0f[_0xcb6b('0xd3')]['user']),'to':_0x4945c2[_0xcb6b('0xda')],'subject':_0x4945c2['offlineMessageSubject'],'html':_0x2a9a26['body'],'attachments':_0x19f79b}},client9003)[_0xcb6b('0x15')](function(){return _0x2a9a26;})['catch'](function(_0x3da4e9){logger['error'](_0x3da4e9);});}})[_0xcb6b('0x15')](function(){if(_0x4945c2&&_0x4945c2[_0xcb6b('0xd0')]&&_0x4945c2[_0xcb6b('0xdb')]){var _0xb16c65=[];if(_0x219d06[_0xcb6b('0x4b')]){_0xb16c65=_0x219d06['map'](function(_0x101d65){return{'name':_0x101d65[_0xcb6b('0xca')],'basename':_0x101d65['filename'],'type':_0x101d65[_0xcb6b('0xcb')],'ChatOfflineMessageId':_0x2e6b98['id']};});}var _0x1b3e27;if(!_[_0xcb6b('0x6f')](_0x4945c2['subjectOffline'])){var _0x3ae418=_[_0xcb6b('0x32')](_0x3475c8[_0xcb6b('0x4f')],function(_0x15f252){return _0x15f252;});var _0x178fb8=_['toPairsIn'](_0x3ae418)[0x0];var _0x476a9c=_['mapValues'](_0x178fb8,function(_0x560650){return _0x560650;});_0x1b3e27=_0x476a9c[0x1][_0x4945c2[_0xcb6b('0xdc')]];}var _0x22c977={'from':_0x4e4324['email'],'firstName':_0x4e4324[_0xcb6b('0x9d')],'lastName':_0x4e4324[_0xcb6b('0x9e')],'mapKey':'email','message':{'from':_0x4e4324[_0xcb6b('0xd9')],'to':_0x4945c2[_0xcb6b('0xc2')][_0xcb6b('0xd9')],'cc':'','subject':_[_0xcb6b('0x6f')](_0x1b3e27)?_0x4945c2[_0xcb6b('0xdd')]:_0x1b3e27,'messageId':'','sentAt':new Date(),'attach':_0xb16c65[_0xcb6b('0x4b')],'attachments':_0xb16c65,'originChannel':'Chat','ChatWebsiteId':_0x4945c2['id'],'ChatOfflineMessageId':_0x2a9a26['id'],'originTo':_0x4945c2[_0xcb6b('0xc2')]['email']},'body':_0x2a9a26[_0xcb6b('0x4f')]};var _0xf3fa27={'account':{'id':_0x4945c2[_0xcb6b('0xdb')]},'body':_0x22c977,'log':_0xcb6b('0xde')};return respondWithRpcPromise(_0xcb6b('0xde'),'notifyMail',_0xf3fa27,client9001)[_0xcb6b('0x15')](function(){return _0x2a9a26;})[_0xcb6b('0x1e')](function(_0x2e4c0b){logger[_0xcb6b('0x1b')](_0x2e4c0b);});}return;})[_0xcb6b('0x15')](function(){if(_0x2a9a26){return _0x2a9a26;}})[_0xcb6b('0x15')](respondWithResult(_0x37f5a3,null))[_0xcb6b('0x1e')](function(_0x16be04){logger[_0xcb6b('0x1b')](_0xcb6b('0x1e'),_0x16be04);for(var _0x134b46 of _0x219d06){var _0x38aa77=path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xcc'),'files',_0xcb6b('0xcd'),_0xcb6b('0xce'),_0x134b46[_0xcb6b('0x64')]);fs_extra[_0xcb6b('0xdf')](_0x38aa77)[_0xcb6b('0x1e')](function(_0x35f529){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x38aa77,_0x35f529);});}});};exports[_0xcb6b('0xe0')]=function(_0x4c6339,_0x2e7151){return db[_0xcb6b('0xa9')]['find']({'where':{'id':_0x4c6339[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e7151,null))[_0xcb6b('0x15')](function(_0x121fd0){if(_0x121fd0){return _0x121fd0[_0xcb6b('0xe0')](_0x4c6339[_0xcb6b('0x4f')][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4c6339[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x2e7151,null))[_0xcb6b('0x1e')](handleError(_0x2e7151,null));};exports['getInteractions']=function(_0x4380e6,_0x1205de){var _0x129df8={'raw':![],'where':{}};var _0x5093d6={};var _0x2f63d0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x4380e6['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1205de,null))[_0xcb6b('0x15')](function(_0x26a54e){if(_0x26a54e){_0x5093d6['model']=_[_0xcb6b('0x39')](db[_0xcb6b('0xa9')][_0xcb6b('0x34')]);_0x5093d6[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x4380e6['query']);_0x5093d6['filters']=_[_0xcb6b('0x3b')](_0x5093d6[_0xcb6b('0x37')],_0x5093d6[_0xcb6b('0x38')]);_0x129df8[_0xcb6b('0x3d')]=_['intersection'](_0x5093d6[_0xcb6b('0x37')],qs['fields'](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x129df8['attributes']=_0x129df8['attributes'][_0xcb6b('0x4b')]?_0x129df8[_0xcb6b('0x3d')]:_0x5093d6[_0xcb6b('0x37')];if(!_0x4380e6['query'][_0xcb6b('0x5c')]('nolimit')){_0x129df8[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x4380e6['query'][_0xcb6b('0x26')]);_0x129df8[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x129df8[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x129df8[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x4380e6[_0xcb6b('0x38')],_0x5093d6['filters']));_0x129df8[_0xcb6b('0x41')][_0xcb6b('0x5f')]=_0x26a54e['id'];if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x129df8[_0xcb6b('0x41')]=_['merge'](_0x129df8['where'],{'$or':_[_0xcb6b('0x32')](_0x129df8[_0xcb6b('0x3d')],function(_0x1b2223){var _0x3112dc={};_0x3112dc[_0x1b2223]={'$like':'%'+_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x3112dc;})});}_0x129df8=_[_0xcb6b('0x44')]({},_0x129df8,_0x4380e6['options']);return db[_0xcb6b('0xa9')]['count']({'where':_0x129df8[_0xcb6b('0x41')]})['then'](function(_0x50b9c2){_0x2f63d0[_0xcb6b('0x25')]=_0x50b9c2;if(_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0x47')]){_0x129df8[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':_0xcb6b('0xe2'),'required':![]},{'model':db[_0xcb6b('0xb5')],'as':_0xcb6b('0xe3'),'attributes':[_0xcb6b('0x2d'),_0xcb6b('0xe4'),_0xcb6b('0xe5')],'required':![]},{'model':db[_0xcb6b('0xe6')],'as':'Tags','attributes':['id',_0xcb6b('0x2d'),_0xcb6b('0xe7')],'where':_0x4380e6[_0xcb6b('0x38')]['tag']?{'id':_0x4380e6[_0xcb6b('0x38')][_0xcb6b('0xe8')]}:undefined,'required':_0x4380e6[_0xcb6b('0x38')]['tag']?!![]:![]}];}return db[_0xcb6b('0xa9')][_0xcb6b('0x48')](_0x129df8);})[_0xcb6b('0x15')](function(_0x2b064b){_0x2f63d0[_0xcb6b('0x49')]=_0x2b064b;return _0x2f63d0;});}})['then'](respondWithFilteredResult(_0x1205de,_0x129df8))['catch'](handleError(_0x1205de,null));};function iftimePromise(_0xe1f1de,_0x529295){return respondWithRpcPromise(_0xcb6b('0xe9'),_0xcb6b('0xea'),{'command':_0x529295[_0xcb6b('0xeb')]?util[_0xcb6b('0xa3')]('iftime\x20%s,%s',_0xe1f1de['interval'],_0x529295[_0xcb6b('0xeb')]):util['format'](_0xcb6b('0xec'),_0xe1f1de[_0xcb6b('0xed')])},client9002)['then'](function(_0x24ca97){var _0x38efc9=_0x24ca97&&_0x24ca97[_0xcb6b('0xee')]('true')>=0x0?!![]:![];logger[_0xcb6b('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x529295['id'],_0xe1f1de['id'],_0xe1f1de['interval'],_0x38efc9?_0xcb6b('0xef'):_0xcb6b('0xf0'),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return _0x38efc9;})['catch'](function(_0x57c0b9){logger[_0xcb6b('0x1b')](_0xcb6b('0xf2'),_0x529295['id'],_0xe1f1de['id'],_0xe1f1de[_0xcb6b('0xed')],util[_0xcb6b('0xf3')](_0x57c0b9,{'showHidden':![],'depth':null}),_0x529295[_0xcb6b('0xeb')]?_0x529295[_0xcb6b('0xeb')]:_0xcb6b('0xf1'));return![];});}exports['getSnippet']=function(_0x30f305,_0x44431e){var _0x25afd6=0x0;var _0x1fe8f0=0x0;var _0x116cda=![];var _0x363052;var _0x25310f;return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x30f305[_0xcb6b('0x56')]['id']},'include':[{'model':db[_0xcb6b('0xf4')],'as':'Interval','include':[{'model':db[_0xcb6b('0xf4')],'as':_0xcb6b('0xf5'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xcb6b('0x15')](handleEntityNotFound(_0x44431e,null))[_0xcb6b('0x15')](function(_0x23fe0a){if(_0x23fe0a){_0x363052=_0x23fe0a;return _0x23fe0a['getProactiveActions']({'raw':!![]});}})[_0xcb6b('0x15')](function(_0x13874e){if(_0x363052){if(_0x13874e){_0x25310f=_0x13874e;}}return require(_0xcb6b('0xf6'))[_0xcb6b('0x6e')]();})[_0xcb6b('0x15')](function(_0x5c7273){if(_0x5c7273){_0x1fe8f0=_0x5c7273[_0xcb6b('0xf7')];_0x116cda=_0x5c7273[_0xcb6b('0xf8')];}})['then'](function(){return db[_0xcb6b('0xa9')][_0xcb6b('0x25')]({'where':{'closed':![]}});})['then'](function(_0x3b85f8){_0x25afd6=_0x3b85f8;if(_0x1fe8f0&&_0x3b85f8>_0x1fe8f0){return db[_0xcb6b('0xf9')][_0xcb6b('0x5b')]({'where':{'id':0x1}})[_0xcb6b('0x15')](function(_0x1191d2){if(_0x1191d2){_0x1191d2[_0xcb6b('0xfa')]('chatLicenseExceeded');}});}})[_0xcb6b('0x15')](function(){if(_0x363052[_0xcb6b('0xf4')]&&_0x363052[_0xcb6b('0xf4')]['Intervals']){var _0x302697=[];for(var _0x528369=0x0;_0x528369<_0x363052[_0xcb6b('0xf4')][_0xcb6b('0xf5')]['length'];_0x528369++){var _0x4186ec=_0x363052[_0xcb6b('0xf4')]['Intervals'][_0x528369][_0xcb6b('0x2a')]({'plain':!![]});_0x302697['push'](iftimePromise(_0x4186ec,_0x363052));}return BPromise['all'](_0x302697)[_0xcb6b('0x15')](function(_0x305f61){return _[_0xcb6b('0xfb')](_0x305f61);});}else{return!![];}})[_0xcb6b('0x15')](function(_0x4727a3){var _0x5082e4=fs['readFileSync'](path[_0xcb6b('0x6b')](config[_0xcb6b('0x6c')],_0xcb6b('0xfc')),_0xcb6b('0xc5'));var _0x39b3e1=new url[(_0xcb6b('0xfd'))](_0x363052[_0xcb6b('0xfe')])[_0xcb6b('0xff')];var _0x25d05d=_0xcb6b('0x100');var _0x52762a=![];var _0xd0e91b={'chatVersion':_0x25d05d,'chatWebsiteAddressOrigin':_0x39b3e1,'remote':_0x363052[_0xcb6b('0x101')],'query':querystring['stringify'](_['merge'](_0x363052[_0xcb6b('0x2a')]({'plain':!![]}),{'customerIp':_0x30f305['headers'][_0xcb6b('0x9a')]||_0x30f305[_0xcb6b('0x7c')][_0xcb6b('0x102')]||_0x30f305[_0xcb6b('0x103')][_0xcb6b('0x104')]||_0x30f305['ip'],'referer':_0x30f305[_0xcb6b('0x7c')]['referer'],'openedInteractions':_0x25afd6,'maxInteractions':_0x1fe8f0,'virtual':_0x116cda['virtual'],'online':_0x4727a3,'custom':_0x116cda}))[_0xcb6b('0x105')](/'/g,'\x5c\x27')};_0x44431e[_0xcb6b('0x2e')](ejs[_0xcb6b('0xc6')](Mustache[_0xcb6b('0xc6')](_0x5082e4,_0xd0e91b),{'proactiveActions':_0x25310f,'alignment':_0x363052['alignment'],'verticalAlignment':_0x363052['verticalAlignment'],'div_color':_0x363052[_0xcb6b('0xe7')],'labelText':_0x363052['labelText'],'text_color':_0x363052[_0xcb6b('0x106')],'text_button_color':_0x363052[_0xcb6b('0x107')],'button_color':_0x363052[_0xcb6b('0x108')],'background_color':_0x363052['backgroundColor'],'hideWhenOffline':_0x363052[_0xcb6b('0x109')],'intervalId':_0x363052[_0xcb6b('0x10a')],'isDevelopment':_0x52762a,'chatVersion':_0x25d05d}));})[_0xcb6b('0x1e')](handleError(_0x44431e,null));};exports[_0xcb6b('0x10b')]=function(_0xa22435,_0x4fe803){var _0x536ea1=_0xa22435[_0xcb6b('0x56')]['id'];var _0x139a40=_0xa22435[_0xcb6b('0x4f')];var _0x9a923a=0xc8;var _0x2c14fe=null;return db[_0xcb6b('0xd1')][_0xcb6b('0x10c')]({'isolationLevel':db['sequelize']['Transaction'][_0xcb6b('0x10d')]['READ_COMMITTED']},function(_0x1c5415){return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(_0x4d6fd7){if(_0x4d6fd7){return db[_0xcb6b('0x90')][_0xcb6b('0x29')]({'where':{'ChatWebsiteId':_0x536ea1},'transaction':_0x1c5415})[_0xcb6b('0x15')](function(){var _0x3842c2=_[_0xcb6b('0x32')](_0x139a40,function(_0x57ebeb){_0x57ebeb[_0xcb6b('0x5f')]=_0x536ea1;return _0x57ebeb;});return db[_0xcb6b('0x90')][_0xcb6b('0xd2')](_0x3842c2,{'transaction':_0x1c5415});});}else{_0x9a923a=0x194;_0x2c14fe=[];}});})['then'](function(){if(_0x9a923a!==0x194){return db[_0xcb6b('0x90')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x536ea1},'order':_0xcb6b('0x95')})[_0xcb6b('0x15')](function(_0x2421bd){_0x2c14fe=_0x2421bd;});}})[_0xcb6b('0x1e')](function(_0x32aabe){_0x9a923a=0x1f4;logger[_0xcb6b('0x1b')](_0x32aabe[_0xcb6b('0x2c')]);if(_0x32aabe['name']){delete _0x32aabe[_0xcb6b('0x2d')];}_0x2c14fe=_0x32aabe;})[_0xcb6b('0x10e')](function(){if(_0x2c14fe===null){_0x4fe803[_0xcb6b('0x1f')](_0x9a923a);}else{if(_0x9a923a===0x1f4){_0x4fe803['status'](_0x9a923a)['send'](_0x2c14fe);}else{_0x4fe803['status'](_0x9a923a)[_0xcb6b('0x22')](_0x2c14fe);}}});};exports[_0xcb6b('0x10f')]=function(_0x470997,_0x5d88ed){var _0x18f6cf={};var _0x3e56ea={};var _0x4374d6;var _0x1b800a;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x470997['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x5d88ed,null))[_0xcb6b('0x15')](function(_0xe760cc){if(_0xe760cc){_0x4374d6=_0xe760cc;_0x3e56ea[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatApplication'][_0xcb6b('0x34')]);_0x3e56ea[_0xcb6b('0x38')]=_['keys'](_0x470997[_0xcb6b('0x38')]);_0x3e56ea[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3e56ea['model'],_0x3e56ea[_0xcb6b('0x38')]);_0x18f6cf['attributes']=_[_0xcb6b('0x3b')](_0x3e56ea[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x470997[_0xcb6b('0x38')]['fields']));_0x18f6cf[_0xcb6b('0x3d')]=_0x18f6cf[_0xcb6b('0x3d')]['length']?_0x18f6cf[_0xcb6b('0x3d')]:_0x3e56ea['model'];_0x18f6cf['order']=qs[_0xcb6b('0x40')](_0x470997[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x18f6cf[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_['pick'](_0x470997[_0xcb6b('0x38')],_0x3e56ea[_0xcb6b('0x3a')]));if(_0x470997['query'][_0xcb6b('0x43')]){_0x18f6cf[_0xcb6b('0x41')]=_['merge'](_0x18f6cf[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x18f6cf[_0xcb6b('0x3d')],function(_0x5180f6){var _0x1cfae5={};_0x1cfae5[_0x5180f6]={'$like':'%'+_0x470997['query'][_0xcb6b('0x43')]+'%'};return _0x1cfae5;})});}_0x18f6cf=_[_0xcb6b('0x44')]({},_0x18f6cf,_0x470997[_0xcb6b('0x46')]);return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x5c06fe){if(_0x5c06fe){_0x1b800a=_0x5c06fe[_0xcb6b('0x4b')];if(!_0x470997[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x18f6cf[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x470997['query']['limit']);_0x18f6cf['offset']=qs['offset'](_0x470997[_0xcb6b('0x38')]['offset']);}return _0x4374d6['getApplications'](_0x18f6cf);}})[_0xcb6b('0x15')](function(_0x429158){if(_0x429158){return _0x429158?{'count':_0x1b800a,'rows':_0x429158}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5d88ed,null))[_0xcb6b('0x1e')](handleError(_0x5d88ed,null));};exports['addProactiveActions']=function(_0x2cbe1e,_0x3a1654){return db[_0xcb6b('0x110')][_0xcb6b('0x4d')]({'where':{'id':_0x2cbe1e['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3a1654,null))[_0xcb6b('0x15')](function(_0x1af52b){if(_0x1af52b){return _0x1af52b[_0xcb6b('0x111')](_0x2cbe1e['body'][_0xcb6b('0x5e')],_['omit'](_0x2cbe1e[_0xcb6b('0x4f')],['ids','id'])||{});}})[_0xcb6b('0x15')](respondWithResult(_0x3a1654,null))[_0xcb6b('0x1e')](handleError(_0x3a1654,null));};exports['getProactiveActions']=function(_0x2a7966,_0x5ef03e){var _0x233716={};var _0x299ea4={};var _0x27e6ae;var _0x4b4af2;return db['ChatWebsite'][_0xcb6b('0x5b')]({'where':{'id':_0x2a7966[_0xcb6b('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ef03e,null))[_0xcb6b('0x15')](function(_0x50dd58){if(_0x50dd58){_0x27e6ae=_0x50dd58;_0x299ea4[_0xcb6b('0x37')]=_[_0xcb6b('0x39')](db['ChatProactiveAction'][_0xcb6b('0x34')]);_0x299ea4[_0xcb6b('0x38')]=_[_0xcb6b('0x39')](_0x2a7966[_0xcb6b('0x38')]);_0x299ea4[_0xcb6b('0x3a')]=_['intersection'](_0x299ea4['model'],_0x299ea4['query']);_0x233716[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x299ea4[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x2a7966['query'][_0xcb6b('0x3c')]));_0x233716[_0xcb6b('0x3d')]=_0x233716[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x233716['attributes']:_0x299ea4[_0xcb6b('0x37')];_0x233716[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x233716[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x2a7966['query'],_0x299ea4['filters']));if(_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x233716['where']=_[_0xcb6b('0x44')](_0x233716['where'],{'$or':_[_0xcb6b('0x32')](_0x233716['attributes'],function(_0x12c015){var _0x2e7dee={};_0x2e7dee[_0x12c015]={'$like':'%'+_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x2e7dee;})});}_0x233716=_[_0xcb6b('0x44')]({},_0x233716,_0x2a7966['options']);return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})['then'](function(_0x47d06b){if(_0x47d06b){_0x4b4af2=_0x47d06b[_0xcb6b('0x4b')];if(!_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x5c')]('nolimit')){_0x233716[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x2a7966['query'][_0xcb6b('0x26')]);_0x233716[_0xcb6b('0x23')]=qs['offset'](_0x2a7966[_0xcb6b('0x38')][_0xcb6b('0x23')]);}return _0x27e6ae[_0xcb6b('0x112')](_0x233716);}})[_0xcb6b('0x15')](function(_0x549741){if(_0x549741){return _0x549741?{'count':_0x4b4af2,'rows':_0x549741}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x5ef03e,null))['catch'](handleError(_0x5ef03e,null));};exports[_0xcb6b('0x113')]=function(_0xea4e91,_0x3bca24){var _0x5e2a57=_0xea4e91[_0xcb6b('0x38')][_0xcb6b('0x114')]==='false'?_0xcb6b('0x115'):'onlineForm';return db[_0xcb6b('0x33')]['find']({'attributes':['id',_0x5e2a57],'where':{'id':_0xea4e91[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x3bca24,null))['then'](function(_0x279e55){if(_0x279e55){var _0x2614c9=_0x279e55[_0x5e2a57];var _0x13eeb6=_0x2614c9&&_0x2614c9['items']?_0x2614c9[_0xcb6b('0x116')]:[];_0x3bca24[_0xcb6b('0x2e')]({'fromKey':_[_0xcb6b('0x6f')](_0x2614c9[_0xcb6b('0x117')])?undefined:_0x2614c9[_0xcb6b('0x117')],'count':_0x13eeb6[_0xcb6b('0x4b')],'rows':_0x13eeb6});}})[_0xcb6b('0x1e')](handleError(_0x3bca24,null));};exports[_0xcb6b('0x118')]=function(_0x3f39b0,_0x2e0d03){var _0x1201a4={'raw':![],'where':{}};var _0xeedc59={};var _0x3e70c3={'count':0x0,'rows':[]};return db[_0xcb6b('0x33')]['findOne']({'where':{'id':_0x3f39b0[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x2e0d03,null))[_0xcb6b('0x15')](function(_0x147cef){if(_0x147cef){_0xeedc59[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xc8')]['rawAttributes']);_0xeedc59['query']=_[_0xcb6b('0x39')](_0x3f39b0[_0xcb6b('0x38')]);_0xeedc59[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0xeedc59['model'],_0xeedc59[_0xcb6b('0x38')]);_0x1201a4[_0xcb6b('0x3d')]=_['intersection'](_0xeedc59['model'],qs[_0xcb6b('0x3c')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x1201a4[_0xcb6b('0x3d')]=_0x1201a4['attributes']['length']?_0x1201a4['attributes']:_0xeedc59['model'];if(!_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x5c')](_0xcb6b('0x3e'))){_0x1201a4[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x1201a4[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x23')]);}_0x1201a4[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x1201a4[_0xcb6b('0x41')]=qs[_0xcb6b('0x3a')](_[_0xcb6b('0x42')](_0x3f39b0['query'],_0xeedc59['filters']));_0x1201a4[_0xcb6b('0x41')]['ChatWebsiteId']=_0x147cef['id'];if(_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]){_0x1201a4['where']=_[_0xcb6b('0x44')](_0x1201a4[_0xcb6b('0x41')],{'$or':_[_0xcb6b('0x32')](_0x1201a4[_0xcb6b('0x3d')],function(_0x115c10){var _0x553848={};_0x553848[_0x115c10]={'$like':'%'+_0x3f39b0[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x553848;})});}_0x1201a4=_[_0xcb6b('0x44')]({},_0x1201a4,_0x3f39b0['options']);return db[_0xcb6b('0xc8')][_0xcb6b('0x25')]({'where':_0x1201a4[_0xcb6b('0x41')]})[_0xcb6b('0x15')](function(_0x549be0){_0x3e70c3[_0xcb6b('0x25')]=_0x549be0;if(_0x3f39b0[_0xcb6b('0x38')]['includeAll']){_0x1201a4[_0xcb6b('0x4c')]=[{'all':!![]}];}else{_0x1201a4[_0xcb6b('0x4c')]=[{'model':db[_0xcb6b('0x7f')],'as':'Contact','required':![]},{'model':db[_0xcb6b('0x119')],'as':_0xcb6b('0x11a'),'required':![]}];}return db[_0xcb6b('0xc8')]['findAll'](_0x1201a4);})[_0xcb6b('0x15')](function(_0x37e7c8){_0x3e70c3[_0xcb6b('0x49')]=_0x37e7c8;return _0x3e70c3;});}})[_0xcb6b('0x15')](respondWithFilteredResult(_0x2e0d03,_0x1201a4))[_0xcb6b('0x1e')](handleError(_0x2e0d03,null));};exports[_0xcb6b('0x11b')]=function(_0x4d873e,_0x1ace33){return db[_0xcb6b('0x33')]['find']({'where':{'id':_0x4d873e[_0xcb6b('0x56')]['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x1ace33,null))['then'](function(_0xaf382){if(_0xaf382){return _0xaf382[_0xcb6b('0x11b')](_0x4d873e['body'][_0xcb6b('0x5e')],_[_0xcb6b('0xe1')](_0x4d873e[_0xcb6b('0x4f')],[_0xcb6b('0x5e'),'id'])||{})[_0xcb6b('0xad')](function(_0x1252cb){for(var _0x46a072=0x0;_0x46a072<_0x4d873e[_0xcb6b('0x4f')][_0xcb6b('0x5e')][_0xcb6b('0x4b')];_0x46a072+=0x1){socket[_0xcb6b('0x11c')]('userChatWebsite:save',{'UserId':Number(_0x4d873e['body'][_0xcb6b('0x5e')][_0x46a072]),'ChatWebsiteId':Number(_0x4d873e[_0xcb6b('0x56')]['id'])});}return _0x1252cb;});}})['then'](respondWithResult(_0x1ace33,null))['catch'](handleError(_0x1ace33,null));};exports[_0xcb6b('0x11d')]=function(_0x5428c9,_0x349b6a){return db[_0xcb6b('0x33')][_0xcb6b('0x4d')]({'where':{'id':_0x5428c9['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x349b6a,null))['then'](function(_0x4af03c){if(_0x4af03c){return _0x4af03c['removeAgents'](_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')])['then'](function(){if(_['isArray'](_0x5428c9['query'][_0xcb6b('0x5e')])){for(var _0x2663f9=0x0;_0x2663f9<_0x5428c9[_0xcb6b('0x38')]['ids'][_0xcb6b('0x4b')];_0x2663f9+=0x1){socket[_0xcb6b('0x11c')](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9[_0xcb6b('0x38')][_0xcb6b('0x5e')][_0x2663f9]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}}else{socket['emit'](_0xcb6b('0x11e'),{'UserId':Number(_0x5428c9['query'][_0xcb6b('0x5e')]),'ChatWebsiteId':Number(_0x5428c9[_0xcb6b('0x56')]['id'])});}});}})[_0xcb6b('0x15')](respondWithStatusCode(_0x349b6a,null))['catch'](handleError(_0x349b6a,null));};exports[_0xcb6b('0x11f')]=function(_0x5f3c08,_0x367382){var _0x16294f={};var _0x3a5783={};var _0x1b4c8e;var _0x197a40;return db['ChatWebsite']['findOne']({'where':{'id':_0x5f3c08['params']['id']}})[_0xcb6b('0x15')](handleEntityNotFound(_0x367382,null))[_0xcb6b('0x15')](function(_0x2e2a4f){if(_0x2e2a4f){_0x1b4c8e=_0x2e2a4f;_0x3a5783[_0xcb6b('0x37')]=_['keys'](db[_0xcb6b('0xb5')][_0xcb6b('0x34')]);_0x3a5783[_0xcb6b('0x38')]=_['keys'](_0x5f3c08[_0xcb6b('0x38')]);_0x3a5783[_0xcb6b('0x3a')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],_0x3a5783[_0xcb6b('0x38')]);_0x16294f[_0xcb6b('0x3d')]=_[_0xcb6b('0x3b')](_0x3a5783[_0xcb6b('0x37')],qs[_0xcb6b('0x3c')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x3c')]));_0x16294f[_0xcb6b('0x3d')]=_0x16294f[_0xcb6b('0x3d')][_0xcb6b('0x4b')]?_0x16294f['attributes']:_0x3a5783[_0xcb6b('0x37')];_0x16294f[_0xcb6b('0x3f')]=qs[_0xcb6b('0x40')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x40')]);_0x16294f['where']=qs['filters'](_['pick'](_0x5f3c08[_0xcb6b('0x38')],_0x3a5783[_0xcb6b('0x3a')]));if(_0x5f3c08['query'][_0xcb6b('0x43')]){_0x16294f['where']=_[_0xcb6b('0x44')](_0x16294f['where'],{'$or':_[_0xcb6b('0x32')](_0x16294f[_0xcb6b('0x3d')],function(_0x5871ac){var _0x4522e0={};_0x4522e0[_0x5871ac]={'$like':'%'+_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x43')]+'%'};return _0x4522e0;})});}_0x16294f=_[_0xcb6b('0x44')]({},_0x16294f,_0x5f3c08[_0xcb6b('0x46')]);return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x580d99){if(_0x580d99){_0x197a40=_0x580d99[_0xcb6b('0x4b')];if(!_0x5f3c08['query']['hasOwnProperty'](_0xcb6b('0x3e'))){_0x16294f[_0xcb6b('0x26')]=qs[_0xcb6b('0x26')](_0x5f3c08[_0xcb6b('0x38')][_0xcb6b('0x26')]);_0x16294f[_0xcb6b('0x23')]=qs[_0xcb6b('0x23')](_0x5f3c08[_0xcb6b('0x38')]['offset']);}return _0x1b4c8e[_0xcb6b('0x11f')](_0x16294f);}})[_0xcb6b('0x15')](function(_0x44b508){if(_0x44b508){return _0x44b508?{'count':_0x197a40,'rows':_0x44b508}:null;}})[_0xcb6b('0x15')](respondWithResult(_0x367382,null))[_0xcb6b('0x1e')](handleError(_0x367382,null));}; \ No newline at end of file +var _0x8af9=['userChatWebsite:save','userChatWebsite:remove','getAgents','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','create','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','options','removeDispositions','ids','addAnswer','CannedAnswer','findOne','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','asc','account','ListId','from','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','%s\x20%s','version','unknown','format','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','offline-chat','basename','openNewInteraction','sequelize','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','NotifyMailAccount','notifyMail','server','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','push','all','some','server/files/chat/iframe.ejs','address','origin','3.1.0','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit'];(function(_0x1a5d42,_0x51e6a1){var _0x23208b=function(_0x379b6f){while(--_0x379b6f){_0x1a5d42['push'](_0x1a5d42['shift']());}};_0x23208b(++_0x51e6a1);}(_0x8af9,0x12d));var _0x98af=function(_0x397b73,_0x365fca){_0x397b73=_0x397b73-0x0;var _0x477a3f=_0x8af9[_0x397b73];return _0x477a3f;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98af('0x0'));var path=require('path');var ejs=require(_0x98af('0x1'));var fs=require('fs');var fs_extra=require(_0x98af('0x2'));var _=require(_0x98af('0x3'));var querystring=require(_0x98af('0x4'));var Redis=require(_0x98af('0x5'));var qs=require(_0x98af('0x6'));var logger=require(_0x98af('0x7'))(_0x98af('0x8'));var config=require(_0x98af('0x9'));var db=require(_0x98af('0xa'))['db'];config[_0x98af('0xb')]=_[_0x98af('0xc')](config[_0x98af('0xb')],{'host':_0x98af('0xd'),'port':0x18eb});var socket=require(_0x98af('0xe'))(new Redis(config[_0x98af('0xb')]));require(_0x98af('0xf'))[_0x98af('0x10')](socket);var htmlToText=require(_0x98af('0x11'));var jayson=require(_0x98af('0x12'));var client=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232c});var client9002=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232a});var client9003=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x232b});var client9001=jayson[_0x98af('0x13')][_0x98af('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x43615f,_0x564a9c,_0x24a1b1,_0x1e5a94){return new BPromise(function(_0x14184b,_0x1ae467){var _0x22fb7b=_0x1e5a94||client;return _0x22fb7b['request'](_0x43615f,_0x24a1b1)[_0x98af('0x15')](function(_0x5c6949){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x564a9c,_0x98af('0x16'));logger['debug'](_0x98af('0x17'),_0x564a9c,_0x98af('0x16'),JSON['stringify'](_0x5c6949));if(_0x5c6949[_0x98af('0x18')]){if(_0x5c6949[_0x98af('0x18')]['code']===0x1f4){logger['error'](_0x98af('0x19'),_0x564a9c,_0x5c6949['error']['message']);return _0x1ae467(_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);}logger[_0x98af('0x18')](_0x98af('0x19'),_0x564a9c,_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);return _0x14184b(_0x5c6949[_0x98af('0x18')][_0x98af('0x1a')]);}else{logger[_0x98af('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x564a9c,_0x98af('0x16'));_0x14184b(_0x5c6949[_0x98af('0x1c')][_0x98af('0x1a')]);}})[_0x98af('0x1d')](function(_0x287c23){logger[_0x98af('0x18')](_0x98af('0x19'),_0x564a9c,_0x287c23);_0x1ae467(_0x287c23);});});}function respondWithStatusCode(_0x340d2d,_0x4272c6){_0x4272c6=_0x4272c6||0xcc;return function(_0x23b3b3){if(_0x23b3b3){return _0x340d2d[_0x98af('0x1e')](_0x4272c6);}return _0x340d2d[_0x98af('0x1f')](_0x4272c6)[_0x98af('0x20')]();};}function respondWithResult(_0xf831a5,_0x55cfe2){_0x55cfe2=_0x55cfe2||0xc8;return function(_0x54e709){if(_0x54e709){return _0xf831a5[_0x98af('0x1f')](_0x55cfe2)[_0x98af('0x21')](_0x54e709);}};}function respondWithFilteredResult(_0x33d253,_0x59266c){return function(_0x12d5ac){if(_0x12d5ac){var _0x202cb6=typeof _0x59266c[_0x98af('0x22')]===_0x98af('0x23')&&typeof _0x59266c[_0x98af('0x24')]===_0x98af('0x23');var _0x960429=_0x12d5ac['count'];var _0x53cea3=_0x202cb6?0x0:_0x59266c[_0x98af('0x22')];var _0x4d99c8=_0x202cb6?_0x12d5ac[_0x98af('0x25')]:_0x59266c[_0x98af('0x22')]+_0x59266c[_0x98af('0x24')];var _0x52bc3f;if(_0x4d99c8>=_0x960429){_0x4d99c8=_0x960429;_0x52bc3f=0xc8;}else{_0x52bc3f=0xce;}_0x33d253[_0x98af('0x1f')](_0x52bc3f);return _0x33d253[_0x98af('0x26')](_0x98af('0x27'),_0x53cea3+'-'+_0x4d99c8+'/'+_0x960429)['json'](_0x12d5ac);}return null;};}function saveUpdates(_0x36aaaa){return function(_0x36293a){if(_0x36293a){return _0x36293a[_0x98af('0x28')](_0x36aaaa)[_0x98af('0x15')](function(_0xf1cc99){return _0xf1cc99;});}return null;};}function removeEntity(_0x518a11){return function(_0x21c21c){if(_0x21c21c){return _0x21c21c[_0x98af('0x29')]()[_0x98af('0x15')](function(){var _0x1cfacc=_0x21c21c[_0x98af('0x2a')]({'plain':!![]});var _0x29f29b=_0x98af('0x2b');return db[_0x98af('0x2c')][_0x98af('0x29')]({'where':{'type':_0x29f29b,'resourceId':_0x1cfacc['id']}})[_0x98af('0x15')](function(){return _0x21c21c;});})[_0x98af('0x15')](function(){_0x518a11['status'](0xcc)[_0x98af('0x20')]();});}};}function handleEntityNotFound(_0x3581f9){return function(_0x35a674){if(!_0x35a674){_0x3581f9[_0x98af('0x1e')](0x194);}return _0x35a674;};}function handleError(_0x21c9e3,_0x77b491){_0x77b491=_0x77b491||0x1f4;return function(_0x391b61){logger[_0x98af('0x18')](_0x391b61['stack']);if(_0x391b61[_0x98af('0x2d')]){delete _0x391b61[_0x98af('0x2d')];}_0x21c9e3['status'](_0x77b491)[_0x98af('0x2e')](_0x391b61);};}exports[_0x98af('0x2f')]=function(_0x25c997,_0x26dd0b){var _0x30f93b={'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]},_0x1996fd={},_0x262fd1={'count':0x0,'rows':[]};var _0x4303cb=_[_0x98af('0x32')](db[_0x98af('0x33')][_0x98af('0x34')],function(_0x1e814c){return{'name':_0x1e814c['fieldName'],'type':_0x1e814c[_0x98af('0x35')][_0x98af('0x36')]};});_0x1996fd['model']=_['map'](_0x4303cb,'name');_0x1996fd[_0x98af('0x37')]=_[_0x98af('0x38')](_0x25c997['query']);_0x1996fd[_0x98af('0x39')]=_['intersection'](_0x1996fd[_0x98af('0x3a')],_0x1996fd[_0x98af('0x37')]);_0x30f93b['attributes']=_[_0x98af('0x3b')](_0x1996fd[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x25c997[_0x98af('0x37')][_0x98af('0x3c')]));_0x30f93b['attributes']=_0x30f93b[_0x98af('0x3d')][_0x98af('0x3e')]?_0x30f93b[_0x98af('0x3d')]:_0x1996fd[_0x98af('0x3a')];if(!_0x25c997[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x30f93b['limit']=qs['limit'](_0x25c997[_0x98af('0x37')]['limit']);_0x30f93b[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x25c997[_0x98af('0x37')]['offset']);}_0x30f93b['order']=qs[_0x98af('0x41')](_0x25c997[_0x98af('0x37')]['sort']);_0x30f93b[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x25c997[_0x98af('0x37')],_0x1996fd[_0x98af('0x39')]),_0x4303cb);if(_0x25c997['query'][_0x98af('0x44')]){_0x30f93b[_0x98af('0x42')]=_[_0x98af('0x45')](_0x30f93b['where'],{'$or':_[_0x98af('0x32')](_0x4303cb,function(_0x4f162b){if(_0x4f162b['type']!==_0x98af('0x46')){var _0x3f3ec2={};_0x3f3ec2[_0x4f162b[_0x98af('0x2d')]]={'$like':'%'+_0x25c997[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x3f3ec2;}})});}_0x30f93b=_[_0x98af('0x45')]({},_0x30f93b,_0x25c997['options']);var _0x4c9335={'where':_0x30f93b['where']};return db['ChatWebsite'][_0x98af('0x25')](_0x4c9335)[_0x98af('0x15')](function(_0x2bede5){_0x262fd1['count']=_0x2bede5;if(_0x25c997[_0x98af('0x37')][_0x98af('0x47')]){_0x30f93b[_0x98af('0x48')]=[{'all':!![]}];}return db[_0x98af('0x33')][_0x98af('0x49')](_0x30f93b);})[_0x98af('0x15')](function(_0x2c3303){_0x262fd1[_0x98af('0x4a')]=_0x2c3303;return _0x262fd1;})[_0x98af('0x15')](respondWithFilteredResult(_0x26dd0b,_0x30f93b))[_0x98af('0x1d')](handleError(_0x26dd0b,null));};exports[_0x98af('0x4b')]=function(_0x5473f6,_0x29e445){var _0x163fc6={'raw':![],'where':{'id':_0x5473f6[_0x98af('0x4c')]['id']},'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]},_0x101a23={};_0x101a23[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x33')][_0x98af('0x34')]);_0x101a23[_0x98af('0x37')]=_[_0x98af('0x38')](_0x5473f6[_0x98af('0x37')]);_0x101a23['filters']=_['intersection'](_0x101a23['model'],_0x101a23['query']);_0x163fc6[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x101a23[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x5473f6[_0x98af('0x37')]['fields']));_0x163fc6['attributes']=_0x163fc6[_0x98af('0x3d')]['length']?_0x163fc6[_0x98af('0x3d')]:_0x101a23[_0x98af('0x3a')];if(_0x5473f6[_0x98af('0x37')][_0x98af('0x47')]){_0x163fc6['include']=[{'all':!![]}];}_0x163fc6=_[_0x98af('0x45')]({},_0x163fc6,_0x5473f6['options']);return db[_0x98af('0x33')][_0x98af('0x4d')](_0x163fc6)['then'](handleEntityNotFound(_0x29e445,null))[_0x98af('0x15')](respondWithResult(_0x29e445,null))[_0x98af('0x1d')](handleError(_0x29e445,null));};exports['create']=function(_0x1a4586,_0x39c586){return db[_0x98af('0x33')]['create'](_0x1a4586[_0x98af('0x4e')],{})[_0x98af('0x15')](function(_0x114148){var _0x30738b=_0x1a4586['user']['get']({'plain':!![]});if(!_0x30738b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30738b[_0x98af('0x4f')]===_0x98af('0x50')){var _0x4ec475=_0x114148['get']({'plain':!![]});var _0x33c65b=_0x98af('0x2b');return db[_0x98af('0x51')][_0x98af('0x4d')]({'where':{'name':_0x33c65b,'userProfileId':_0x30738b[_0x98af('0x52')]},'raw':!![]})[_0x98af('0x15')](function(_0x12ab9a){if(_0x12ab9a&&_0x12ab9a[_0x98af('0x53')]===0x0){return db[_0x98af('0x2c')][_0x98af('0x54')]({'name':_0x4ec475['name'],'resourceId':_0x4ec475['id'],'type':_0x12ab9a[_0x98af('0x2d')],'sectionId':_0x12ab9a['id']},{})['then'](function(){return _0x114148;});}else{return _0x114148;}})['catch'](function(_0x516419){logger[_0x98af('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x516419);throw _0x516419;});}return _0x114148;})[_0x98af('0x15')](respondWithResult(_0x39c586,0xc9))[_0x98af('0x1d')](handleError(_0x39c586,null));};exports[_0x98af('0x28')]=function(_0x33dd84,_0x59189a){if(_0x33dd84['body']['id']){delete _0x33dd84[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x33dd84[_0x98af('0x4c')]['id']},'include':[{'model':db[_0x98af('0x30')],'as':_0x98af('0x31')}]})[_0x98af('0x15')](handleEntityNotFound(_0x59189a,null))['then'](saveUpdates(_0x33dd84[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x59189a,null))[_0x98af('0x1d')](handleError(_0x59189a,null));};exports['destroy']=function(_0x28d340,_0x5723fe){return db[_0x98af('0x33')]['find']({'where':{'id':_0x28d340[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x5723fe,null))['then'](removeEntity(_0x5723fe,null))['catch'](handleError(_0x5723fe,null));};exports[_0x98af('0x55')]=function(_0x14eec8,_0x582413){return db['ChatWebsite'][_0x98af('0x55')]()['then'](respondWithResult(_0x582413,null))[_0x98af('0x1d')](handleError(_0x582413,null));};exports[_0x98af('0x56')]=function(_0x348a3b,_0x4442d6){if(_0x348a3b[_0x98af('0x4e')]['id']){delete _0x348a3b[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x348a3b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4442d6,null))['then'](function(_0x354309){if(_0x354309){_0x348a3b[_0x98af('0x4e')][_0x98af('0x57')]=_0x354309['id'];return db[_0x98af('0x58')][_0x98af('0x54')](_0x348a3b[_0x98af('0x4e')]);}})[_0x98af('0x15')](respondWithResult(_0x4442d6,null))[_0x98af('0x1d')](handleError(_0x4442d6,null));};exports[_0x98af('0x59')]=function(_0x118d56,_0x4eab9f){var _0x10736e={'raw':![],'where':{}};var _0x5e95f1={};var _0x1a2b06={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x118d56['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4eab9f,null))['then'](function(_0x4d01d4){if(_0x4d01d4){_0x5e95f1[_0x98af('0x3a')]=_[_0x98af('0x38')](db['Disposition']['rawAttributes']);_0x5e95f1[_0x98af('0x37')]=_[_0x98af('0x38')](_0x118d56[_0x98af('0x37')]);_0x5e95f1[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x5e95f1[_0x98af('0x3a')],_0x5e95f1[_0x98af('0x37')]);_0x10736e[_0x98af('0x3d')]=_['intersection'](_0x5e95f1[_0x98af('0x3a')],qs['fields'](_0x118d56[_0x98af('0x37')][_0x98af('0x3c')]));_0x10736e[_0x98af('0x3d')]=_0x10736e[_0x98af('0x3d')][_0x98af('0x3e')]?_0x10736e[_0x98af('0x3d')]:_0x5e95f1['model'];if(!_0x118d56['query']['hasOwnProperty'](_0x98af('0x40'))){_0x10736e['limit']=qs['limit'](_0x118d56[_0x98af('0x37')][_0x98af('0x24')]);_0x10736e[_0x98af('0x22')]=qs['offset'](_0x118d56['query']['offset']);}_0x10736e['order']=qs[_0x98af('0x41')](_0x118d56['query'][_0x98af('0x41')]);_0x10736e[_0x98af('0x42')]=qs['filters'](_[_0x98af('0x43')](_0x118d56[_0x98af('0x37')],_0x5e95f1[_0x98af('0x39')]));_0x10736e['where'][_0x98af('0x57')]=_0x4d01d4['id'];if(_0x118d56[_0x98af('0x37')][_0x98af('0x44')]){_0x10736e[_0x98af('0x42')]=_[_0x98af('0x45')](_0x10736e[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x10736e[_0x98af('0x3d')],function(_0x1feced){var _0x37ae9b={};_0x37ae9b[_0x1feced]={'$like':'%'+_0x118d56['query']['filter']+'%'};return _0x37ae9b;})});}_0x10736e=_['merge']({},_0x10736e,_0x118d56[_0x98af('0x5a')]);return db['Disposition']['count']({'where':_0x10736e[_0x98af('0x42')]})['then'](function(_0x3ced85){_0x1a2b06['count']=_0x3ced85;if(_0x118d56[_0x98af('0x37')][_0x98af('0x47')]){_0x10736e[_0x98af('0x48')]=[{'all':!![]}];}return db['Disposition'][_0x98af('0x49')](_0x10736e);})[_0x98af('0x15')](function(_0xd41825){_0x1a2b06[_0x98af('0x4a')]=_0xd41825;return _0x1a2b06;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x4eab9f,_0x10736e))[_0x98af('0x1d')](handleError(_0x4eab9f,null));};exports['removeDispositions']=function(_0x28056f,_0x4b1992){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x28056f[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b1992,null))[_0x98af('0x15')](function(_0x2f6736){if(_0x2f6736){return _0x2f6736[_0x98af('0x5b')](_0x28056f[_0x98af('0x37')][_0x98af('0x5c')]);}})[_0x98af('0x15')](respondWithStatusCode(_0x4b1992,null))[_0x98af('0x1d')](handleError(_0x4b1992,null));};exports[_0x98af('0x5d')]=function(_0xd90037,_0x40a315){if(_0xd90037[_0x98af('0x4e')]['id']){delete _0xd90037[_0x98af('0x4e')]['id'];}return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0xd90037['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x40a315,null))[_0x98af('0x15')](function(_0x46ea60){if(_0x46ea60){_0xd90037[_0x98af('0x4e')]['ChatWebsiteId']=_0x46ea60['id'];return db[_0x98af('0x5e')][_0x98af('0x54')](_0xd90037[_0x98af('0x4e')]);}})[_0x98af('0x15')](respondWithResult(_0x40a315,null))['catch'](handleError(_0x40a315,null));};exports['getAnswers']=function(_0x135cb0,_0x357f7b){var _0x57c8c5={'raw':![],'where':{}};var _0x24d079={};var _0x302e69={'count':0x0,'rows':[]};return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x135cb0[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x357f7b,null))[_0x98af('0x15')](function(_0x201f4d){if(_0x201f4d){_0x24d079[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x5e')]['rawAttributes']);_0x24d079[_0x98af('0x37')]=_[_0x98af('0x38')](_0x135cb0['query']);_0x24d079[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x24d079['model'],_0x24d079['query']);_0x57c8c5['attributes']=_[_0x98af('0x3b')](_0x24d079[_0x98af('0x3a')],qs['fields'](_0x135cb0[_0x98af('0x37')][_0x98af('0x3c')]));_0x57c8c5[_0x98af('0x3d')]=_0x57c8c5[_0x98af('0x3d')][_0x98af('0x3e')]?_0x57c8c5[_0x98af('0x3d')]:_0x24d079[_0x98af('0x3a')];if(!_0x135cb0[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x57c8c5[_0x98af('0x24')]=qs[_0x98af('0x24')](_0x135cb0['query']['limit']);_0x57c8c5[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x135cb0[_0x98af('0x37')][_0x98af('0x22')]);}_0x57c8c5[_0x98af('0x60')]=qs[_0x98af('0x41')](_0x135cb0[_0x98af('0x37')][_0x98af('0x41')]);_0x57c8c5[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x135cb0[_0x98af('0x37')],_0x24d079[_0x98af('0x39')]));_0x57c8c5[_0x98af('0x42')][_0x98af('0x57')]=_0x201f4d['id'];if(_0x135cb0['query'][_0x98af('0x44')]){_0x57c8c5[_0x98af('0x42')]=_['merge'](_0x57c8c5['where'],{'$or':_['map'](_0x57c8c5[_0x98af('0x3d')],function(_0x1b1fac){var _0x14b338={};_0x14b338[_0x1b1fac]={'$like':'%'+_0x135cb0[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x14b338;})});}_0x57c8c5=_['merge']({},_0x57c8c5,_0x135cb0['options']);return db[_0x98af('0x5e')]['count']({'where':_0x57c8c5[_0x98af('0x42')]})['then'](function(_0x441888){_0x302e69[_0x98af('0x25')]=_0x441888;if(_0x135cb0[_0x98af('0x37')]['includeAll']){_0x57c8c5[_0x98af('0x48')]=[{'all':!![]}];}return db[_0x98af('0x5e')][_0x98af('0x49')](_0x57c8c5);})[_0x98af('0x15')](function(_0x257e62){_0x302e69['rows']=_0x257e62;return _0x302e69;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x357f7b,_0x57c8c5))[_0x98af('0x1d')](handleError(_0x357f7b,null));};exports[_0x98af('0x61')]=function(_0xfed27a,_0x3c46ca){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0xfed27a['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3c46ca,null))[_0x98af('0x15')](function(_0x17cf6b){if(_0x17cf6b){return _0x17cf6b[_0x98af('0x61')](_0xfed27a[_0x98af('0x37')][_0x98af('0x5c')]);}})['then'](respondWithStatusCode(_0x3c46ca,null))[_0x98af('0x1d')](handleError(_0x3c46ca,null));};exports[_0x98af('0x62')]=function(_0x149de3,_0x52daa6){_0x149de3['body'][_0x98af('0x63')]=_0x149de3[_0x98af('0x64')][_0x98af('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x149de3[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x52daa6,null))['then'](saveUpdates(_0x149de3[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x52daa6,null))['catch'](handleError(_0x52daa6,null));};exports[_0x98af('0x66')]=function(_0x2bf3c8,_0x284e93){_0x2bf3c8['body'][_0x98af('0x67')]=_0x2bf3c8[_0x98af('0x64')][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x2bf3c8[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x284e93,null))[_0x98af('0x15')](saveUpdates(_0x2bf3c8[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x284e93,null))[_0x98af('0x1d')](handleError(_0x284e93,null));};exports[_0x98af('0x68')]=function(_0x4bc60d,_0x1b320a){_0x4bc60d[_0x98af('0x4e')][_0x98af('0x69')]=_0x4bc60d[_0x98af('0x64')][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x4bc60d['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1b320a,null))[_0x98af('0x15')](saveUpdates(_0x4bc60d[_0x98af('0x4e')],null))[_0x98af('0x15')](respondWithResult(_0x1b320a,null))[_0x98af('0x1d')](handleError(_0x1b320a,null));};exports[_0x98af('0x6a')]=function(_0x3b0f94,_0x30d049){_0x3b0f94[_0x98af('0x4e')][_0x98af('0x6b')]=_0x3b0f94['file'][_0x98af('0x65')];return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x3b0f94[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x30d049,null))[_0x98af('0x15')](saveUpdates(_0x3b0f94['body'],null))['then'](respondWithResult(_0x30d049,null))[_0x98af('0x1d')](handleError(_0x30d049,null));};exports[_0x98af('0x6c')]=function(_0x5b2b2e,_0x37a75b){var _0x2935e4=path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x6f'));var _0x39078d={'where':{'id':_0x5b2b2e[_0x98af('0x4c')]['id']},'attributes':['id',_0x98af('0x63')],'raw':!![]};var _0x47bcba=![];return require(_0x98af('0x70'))[_0x98af('0x71')]()['then'](function(_0xa06665){if(_0xa06665){_0x47bcba=_0xa06665[_0x98af('0x72')];}})['then'](function(){return db['ChatWebsite']['find'](_0x39078d);})['then'](handleEntityNotFound(_0x37a75b,null))[_0x98af('0x15')](function(_0x3b6ba5){if(_0x3b6ba5){if(!_[_0x98af('0x73')](_0x3b6ba5['sitepic'])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server/files/images/logos/',_0x3b6ba5[_0x98af('0x63')]))&&_0x47bcba){_0x2935e4=path['join'](config[_0x98af('0x6e')],_0x98af('0x75'),_0x3b6ba5['sitepic']);}}return _0x37a75b['download'](_0x2935e4);}})['catch'](handleError(_0x37a75b,null));};exports['getAvatar']=function(_0x147bab,_0x2fe422){var _0x1db641=path['join'](config[_0x98af('0x6e')],_0x98af('0x76'));var _0xe1427a={'where':{'id':_0x147bab['params']['id']},'attributes':['id',_0x98af('0x67')],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0xe1427a)[_0x98af('0x15')](handleEntityNotFound(_0x2fe422,null))[_0x98af('0x15')](function(_0x38f05d){if(_0x38f05d){if(!_[_0x98af('0x73')](_0x38f05d['agentAvatar'])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config['root'],_0x98af('0x77'),_0x38f05d['agentAvatar']))){_0x1db641=path[_0x98af('0x6d')](config['root'],'server/files/images/avatars/',_0x38f05d[_0x98af('0x67')]);}}return _0x2fe422[_0x98af('0x78')](_0x1db641);}})[_0x98af('0x1d')](handleError(_0x2fe422,null));};exports[_0x98af('0x79')]=function(_0x4e64d5,_0x1d170c){var _0x167607=path[_0x98af('0x6d')](config['root'],_0x98af('0x7a'));var _0x4ab8ff={'where':{'id':_0x4e64d5['params']['id']},'attributes':['id',_0x98af('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0x4ab8ff)[_0x98af('0x15')](handleEntityNotFound(_0x1d170c,null))[_0x98af('0x15')](function(_0x3ba31b){if(_0x3ba31b){if(!_['isNil'](_0x3ba31b[_0x98af('0x69')])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x77'),_0x3ba31b['customerAvatar']))&&_0x3ba31b[_0x98af('0x7b')]){_0x167607=path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server/files/images/avatars/',_0x3ba31b[_0x98af('0x69')]);}}return _0x1d170c[_0x98af('0x78')](_0x167607);}})['catch'](handleError(_0x1d170c,null));};exports[_0x98af('0x7c')]=function(_0x1b3948,_0x56932c){var _0x594a2b=path['join'](config[_0x98af('0x6e')],_0x98af('0x7d'));var _0x4e2971={'where':{'id':_0x1b3948[_0x98af('0x4c')]['id']},'attributes':['id',_0x98af('0x6b')],'raw':!![]};return db[_0x98af('0x33')][_0x98af('0x4d')](_0x4e2971)[_0x98af('0x15')](handleEntityNotFound(_0x56932c,null))[_0x98af('0x15')](function(_0x3c1dda){if(_0x3c1dda){if(!_[_0x98af('0x73')](_0x3c1dda[_0x98af('0x6b')])){if(fs[_0x98af('0x74')](path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0x77'),_0x3c1dda['systemAvatar']))){_0x594a2b=path[_0x98af('0x6d')](config['root'],_0x98af('0x77'),_0x3c1dda['systemAvatar']);}}return _0x56932c[_0x98af('0x78')](_0x594a2b);}})['catch'](handleError(_0x56932c,null));};exports[_0x98af('0x7e')]=function(_0x18a432,_0x38e57a){var _0x5d35f6=require('user-agent-parser');var _0x2f3949=new _0x5d35f6();var _0x10ec3d=_0x2f3949[_0x98af('0x7f')](_0x18a432['headers']['user-agent'])[_0x98af('0x80')]();var _0x21d1ee={'body':_0x18a432[_0x98af('0x4e')],'channel':_0x98af('0x81')};var _0x10aacc=[];var _0x54f010=[];var _0x332f16={};var _0x2ff79f=![];return db[_0x98af('0x82')][_0x98af('0x55')]()[_0x98af('0x15')](function(_0x359f01){if(!_0x359f01){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x85'));}_0x10aacc=_[_0x98af('0x86')](_[_0x98af('0x38')](_0x359f01),['createdAt','updatedAt']);_0x54f010=_['difference'](_[_0x98af('0x38')](_0x359f01),['createdAt',_0x98af('0x87'),_0x98af('0x88'),'ListId']);if(_0x18a432[_0x98af('0x4e')]['id']){delete _0x18a432[_0x98af('0x4e')]['id'];}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')]['from'])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x89'));}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')])||_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')]===''){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x98af('0x73')](_0x18a432[_0x98af('0x4e')]['mapKey'])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x8a')+_0x54f010);}if(!_[_0x98af('0x8b')](_0x54f010,_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')])){throw new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0x8d')+_0x54f010);}_0x332f16[_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')]]=_0x18a432[_0x98af('0x4e')]['from'];})['then'](function(){return db[_0x98af('0x33')]['find']({'where':{'id':_0x18a432['params']['id']},'include':[{'model':db[_0x98af('0x8e')],'as':_0x98af('0x8f'),'include':[{'model':db[_0x98af('0x82')],'as':_0x98af('0x90'),'where':_0x332f16,'limit':0x1,'order':[[_0x98af('0x87'),_0x98af('0x91')]]}]},{'model':db[_0x98af('0x92')],'as':_0x98af('0x93')}]});})['then'](handleEntityNotFound(_0x38e57a,null))[_0x98af('0x15')](function(_0x5850c3){if(_0x5850c3&&_0x5850c3['List']){_0x21d1ee['account']=_0x5850c3;_0x21d1ee[_0x98af('0x94')]=_0x5850c3[_0x98af('0x93')];_0x21d1ee[_0x98af('0x95')]=_0x5850c3[_0x98af('0x8f')];_0x21d1ee[_0x98af('0x94')]=_['orderBy'](_0x21d1ee[_0x98af('0x94')],['priority'],[_0x98af('0x96')]);if(_0x21d1ee[_0x98af('0x97')]['Applications']){delete _0x21d1ee['account'][_0x98af('0x93')];}if(_0x21d1ee['account'][_0x98af('0x8f')]&&_0x21d1ee[_0x98af('0x97')]['List'][_0x98af('0x90')][_0x98af('0x3e')]){return _0x21d1ee[_0x98af('0x97')]['List']['Contacts'][0x0];}var _0x578cda=_[_0x98af('0xc')](_0x18a432[_0x98af('0x4e')],{'firstName':_0x18a432[_0x98af('0x4e')]['from'],'ListId':_0x5850c3[_0x98af('0x98')]});_0x578cda[_0x18a432[_0x98af('0x4e')][_0x98af('0x8c')]]=_0x18a432[_0x98af('0x4e')][_0x98af('0x99')];return db[_0x98af('0x82')][_0x98af('0x54')](_0x578cda,{'fields':_0x10aacc,'raw':!![]});}})['then'](handleEntityNotFound(_0x38e57a,null))[_0x98af('0x15')](function(_0x428e57){_0x21d1ee[_0x98af('0x9a')]=_0x428e57;var _0x2b67af=_0x18a432[_0x98af('0x4e')][_0x98af('0x9b')];if(_0x18a432[_0x98af('0x9c')][_0x98af('0x9d')]){_0x2b67af=_0x18a432[_0x98af('0x9c')][_0x98af('0x9d')];}else if(_0x18a432['headers'][_0x98af('0x9e')]){_0x2b67af=_[_0x98af('0x9f')](_0x18a432[_0x98af('0x9c')]['x-forwarded-for'][_0x98af('0xa0')](','));}if(_0x428e57){var _0x4854bd={'ContactId':_0x428e57['id'],'ChatWebsiteId':_0x18a432['params']['id'],'from':(_0x428e57[_0x98af('0xa1')]||'')+'\x20'+(_0x428e57[_0x98af('0xa2')]||''),'customerIp':_0x2b67af,'customerPort':_0x18a432[_0x98af('0x9c')][_0x98af('0xa3')]?_0x18a432['headers'][_0x98af('0xa3')]:null,'referer':_0x18a432[_0x98af('0x4e')]['referer'],'browserName':_0x10ec3d['browser'][_0x98af('0x2d')]&&_0x10ec3d[_0x98af('0xa4')]['version']?util['format'](_0x98af('0xa5'),_0x10ec3d[_0x98af('0xa4')][_0x98af('0x2d')],_0x10ec3d[_0x98af('0xa4')][_0x98af('0xa6')]):_0x98af('0xa7'),'browserVersion':_0x10ec3d[_0x98af('0xa4')]['version']||_0x98af('0xa7'),'osName':util[_0x98af('0xa8')](_0x98af('0xa5'),_0x10ec3d['os'][_0x98af('0x2d')],_0x10ec3d['os'][_0x98af('0xa6')]),'osVersion':_0x10ec3d['os']['version'],'deviceModel':_0x10ec3d[_0x98af('0xa9')][_0x98af('0x3a')]&&_0x10ec3d[_0x98af('0xa9')]['vendor']?util['format']('%s\x20%s\x20%s',_0x10ec3d[_0x98af('0xa9')][_0x98af('0x3a')],_0x10ec3d[_0x98af('0xa9')][_0x98af('0xaa')],_0x10ec3d[_0x98af('0xa9')][_0x98af('0x35')]):null,'deviceVendor':_0x10ec3d[_0x98af('0xa9')]['vendor'],'deviceType':_0x10ec3d['device'][_0x98af('0x35')],'formData':JSON[_0x98af('0xab')](_0x18a432[_0x98af('0x4e')])};var _0x109aa7={'ChatWebsiteId':_0x18a432[_0x98af('0x4c')]['id'],'closed':![]};if(_0x18a432[_0x98af('0x4e')]['threadId']){_0x109aa7[_0x98af('0xac')]=_0x18a432['body'][_0x98af('0xac')];return db[_0x98af('0xad')][_0x98af('0x4d')]({'where':_0x109aa7})[_0x98af('0x15')](function(_0x2ed791){if(_0x2ed791){return[_0x2ed791,![]];}_0x4854bd['threadId']=_0x18a432[_0x98af('0x4e')]['threadId'];_0x4854bd[_0x98af('0xae')]=_0x18a432['body'][_0x98af('0xae')];return db[_0x98af('0xad')]['create'](_0x4854bd)[_0x98af('0x15')](function(_0x139ae8){return[_0x139ae8,!![]];});});}_0x109aa7[_0x98af('0xaf')]=_0x428e57['id'];if(_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]&&_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]['id']){_0x109aa7['id']=_0x18a432[_0x98af('0x4e')][_0x98af('0xb0')]['id'];return db['ChatInteraction'][_0x98af('0x4d')]({'where':_0x109aa7})['then'](function(_0x173af1){if(_0x173af1){return[_0x173af1,![]];}return db['ChatInteraction'][_0x98af('0x54')](_0x4854bd)['then'](function(_0x54e78b){return[_0x54e78b,!![]];});});}return db[_0x98af('0xad')]['create'](_0x4854bd)[_0x98af('0x15')](function(_0x32b654){return[_0x32b654,!![]];});}})['spread'](function(_0x228d6c,_0x3d2f2d){if(_0x228d6c){_0x2ff79f=_0x3d2f2d;if(!_0x3d2f2d){var _0x1d9c2d={'from':(_0x21d1ee[_0x98af('0x9a')][_0x98af('0xa1')]||'')+'\x20'+(_0x21d1ee[_0x98af('0x9a')][_0x98af('0xa2')]||'')};if(_0x18a432[_0x98af('0x4e')][_0x98af('0xac')]&&_0x18a432['body']['messageId']&&_0x18a432[_0x98af('0x4e')][_0x98af('0xac')]!=_0x18a432['body'][_0x98af('0xb1')]){_0x1d9c2d['threadId']=_0x18a432[_0x98af('0x4e')]['messageId'];}return _0x228d6c[_0x98af('0x28')](_0x1d9c2d);}else{return _0x228d6c;}}})[_0x98af('0x15')](function(_0x12dd46){_0x21d1ee[_0x98af('0xb0')]=_0x12dd46[_0x98af('0x2a')]({'plain':!![]});_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb2')]=_0x2ff79f;if(_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb2')]){if(_0x21d1ee[_0x98af('0x97')][_0x98af('0xb3')]){_0x21d1ee[_0x98af('0x94')]['push']({'id':0x0,'priority':_0x21d1ee['applications'][_0x98af('0x3e')]+0x1,'app':_0x98af('0xb4'),'appdata':_0x98af('0xb5'),'interval':_0x98af('0xb6')});}}return db[_0x98af('0xb7')][_0x98af('0x54')]({'body':_0x18a432[_0x98af('0x4e')][_0x98af('0x4e')],'ChatWebsiteId':_0x18a432[_0x98af('0x4c')]['id'],'ChatInteractionId':_0x12dd46['id'],'direction':'in','ContactId':_0x21d1ee['contact']['id'],'AttachmentId':_0x18a432['body']['AttachmentId']});})[_0x98af('0x15')](function(_0x5960c9){_0x21d1ee[_0x98af('0x1a')]=_0x5960c9;if(_0x21d1ee[_0x98af('0xb0')][_0x98af('0xb8')]){return db[_0x98af('0xb9')][_0x98af('0x4d')]({'attributes':['id',_0x98af('0x2d')],'where':{'id':_0x21d1ee[_0x98af('0xb0')]['UserId']}})[_0x98af('0x15')](function(_0x25e1fc){if(_0x25e1fc){_0x21d1ee[_0x98af('0x94')][_0x98af('0xba')]({'id':0x0,'priority':0x0,'app':_0x98af('0xbb'),'appdata':_0x25e1fc[_0x98af('0x2d')]+','+(_0x21d1ee[_0x98af('0x97')][_0x98af('0xbc')]||0xa),'interval':'*,*,*,*'});_0x21d1ee[_0x98af('0xbd')]=!![];}return respondWithRpcPromise(_0x98af('0xbe'),_0x98af('0xbf'),_0x21d1ee);});}return respondWithRpcPromise('Start',_0x98af('0xbf'),_0x21d1ee);})['then'](function(_0x27869c){respondWithRpcPromise('EventManager',_0x98af('0xc0'),{'event':_0x98af('0x7e'),'message':_0x27869c},client9002);return _0x27869c;})[_0x98af('0x15')](respondWithResult(_0x38e57a,null))[_0x98af('0x1d')](handleError(_0x38e57a,null));};exports[_0x98af('0xc1')]=function(_0x574be8,_0x5ac0f4){var _0x20c13a,_0x51cbcf,_0x4fbad7;var _0x536301=[];var _0x15dc20={};var _0x2045f2=_0x574be8[_0x98af('0xc2')]||[];var _0x55a55b=[];var _0x38da84;return db[_0x98af('0x82')][_0x98af('0x55')]()[_0x98af('0x15')](function(_0x2ef849){if(!_0x2ef849){throw new db['Sequelize'][(_0x98af('0x84'))](_0x98af('0x85'));}_0x536301=_[_0x98af('0x86')](_[_0x98af('0x38')](_0x2ef849),[_0x98af('0xc3'),_0x98af('0x87'),_0x98af('0x88'),_0x98af('0x98')]);if(_0x574be8[_0x98af('0x4e')]['id']){delete _0x574be8[_0x98af('0x4e')]['id'];}if(_[_0x98af('0x73')](_0x574be8['body'][_0x98af('0x99')])){throw _0x5ac0f4['status'](0x1f4)[_0x98af('0x2e')](new db['Sequelize'][(_0x98af('0x84'))](_0x98af('0x89')));}if(_[_0x98af('0x73')](_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')])||_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')]===''){throw _0x5ac0f4[_0x98af('0x1f')](0x1f4)[_0x98af('0x2e')](new db[(_0x98af('0x83'))]['ValidationError'](_0x98af('0xc4')));}if(_[_0x98af('0x73')](_0x574be8[_0x98af('0x4e')]['mapKeyOffline'])){throw _0x5ac0f4['status'](0x1f4)[_0x98af('0x2e')](new db[(_0x98af('0x83'))][(_0x98af('0x84'))](_0x98af('0xc5')+_0x536301));}if(!_[_0x98af('0x8b')](_0x536301,_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')])){throw _0x5ac0f4[_0x98af('0x1f')](0x1f4)['send'](new db[(_0x98af('0x83'))][(_0x98af('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x536301));}_0x15dc20[_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')]]=_0x574be8[_0x98af('0x4e')][_0x98af('0x99')];})[_0x98af('0x15')](function(){return db[_0x98af('0x33')]['find']({'where':{'id':_0x574be8['params']['id']},'include':[{'model':db[_0x98af('0x8e')],'as':_0x98af('0x8f')},{'model':db[_0x98af('0xc7')],'as':_0x98af('0xc7')}]});})[_0x98af('0x15')](handleEntityNotFound(_0x5ac0f4,null))[_0x98af('0x15')](function(_0x46bf74){if(_0x46bf74&&_0x46bf74['List']){_0x51cbcf=_0x46bf74;var _0x2f6af4=_['defaults'](_0x574be8[_0x98af('0x4e')],{'firstName':_0x574be8['body']['from'],'phone':_0x574be8[_0x98af('0x4e')]['from'],'ListId':_0x46bf74[_0x98af('0x98')]});_0x2f6af4[_0x574be8[_0x98af('0x4e')][_0x98af('0xc6')]]=_0x574be8[_0x98af('0x4e')][_0x98af('0x99')];return db[_0x98af('0x82')][_0x98af('0xc8')]({'where':_0x15dc20,'defaults':_0x2f6af4});}})['spread'](function(_0x308ec5){if(_0x308ec5){_0x4fbad7=_0x308ec5;var _0x59c49f=fs[_0x98af('0xc9')](path[_0x98af('0x6d')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x98af('0xca'));var _0x4c9dbf=ejs[_0x98af('0xcb')](_0x59c49f,{'body':_[_0x98af('0xcc')](_0x574be8[_0x98af('0x4e')][_0x98af('0x4e')]),'bodyTitle':_0x51cbcf['offlineMessageBody']});return db[_0x98af('0xcd')]['create']({'body':_0x4c9dbf,'plainBody':htmlToText[_0x98af('0xce')](_0x4c9dbf),'ContactId':_0x308ec5['id'],'ChatWebsiteId':_0x51cbcf['id']});}})[_0x98af('0x15')](function(_0x1c10a1){_0x38da84=_0x1c10a1;if(_0x2045f2[_0x98af('0x3e')]){var _0x125501=_0x2045f2[_0x98af('0x32')](function(_0x339704){return{'name':_0x339704['originalname'],'basename':_0x339704[_0x98af('0x65')],'type':_0x339704[_0x98af('0xcf')],'ChatOfflineMessageId':_0x1c10a1['id']};});_0x55a55b=_0x125501[_0x98af('0x32')](_0x210d73=>{var _0x150e1b={'filename':_0x210d73[_0x98af('0x2d')],'path':path[_0x98af('0x6d')](config[_0x98af('0x6e')],'server','files','attachments',_0x98af('0xd0'),_0x210d73[_0x98af('0xd1')])};return _0x150e1b;});if(!_0x51cbcf[_0x98af('0xd2')]){return db[_0x98af('0xd3')]['transaction'](function(_0x343389){return db['Attachment']['bulkCreate'](_0x125501,{'transaction':_0x343389});});}}})[_0x98af('0x15')](function(){if(_0x38da84){_0x20c13a=_0x38da84;return db[_0x98af('0xc7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x98af('0xd4')],'as':_0x98af('0xd4'),'raw':!![]}]}]});}})[_0x98af('0x15')](function(_0x1dda47){if(_0x1dda47&&_0x1dda47[_0x98af('0xd5')]&&_0x51cbcf[_0x98af('0xd6')]&&_0x51cbcf[_0x98af('0xd7')]){var _0x292587=_0x1dda47['getSmtpOptions']();return respondWithRpcPromise(_0x98af('0xd8'),_0x98af('0xd9'),{'account':_0x292587,'message':{'from':util['format'](_0x98af('0xda'),_0x1dda47[_0x98af('0x2d')],_0x1dda47[_0x98af('0xdb')]||_0x1dda47['Smtp']['user']),'to':_0x51cbcf['forwardOfflineAddress'],'subject':_0x51cbcf[_0x98af('0xdc')],'html':_0x20c13a[_0x98af('0x4e')],'attachments':_0x55a55b}},client9003)[_0x98af('0x15')](function(){return _0x20c13a;})[_0x98af('0x1d')](function(_0x28323b){logger[_0x98af('0x18')](_0x28323b);});}})[_0x98af('0x15')](function(){if(_0x51cbcf&&_0x51cbcf['openNewInteraction']&&_0x51cbcf[_0x98af('0xdd')]){var _0x27d761=[];if(_0x2045f2[_0x98af('0x3e')]){_0x27d761=_0x2045f2[_0x98af('0x32')](function(_0x18f03e){return{'name':_0x18f03e[_0x98af('0xde')],'basename':_0x18f03e['filename'],'type':_0x18f03e['mimetype'],'ChatOfflineMessageId':_0x38da84['id']};});}var _0x30de15;if(!_[_0x98af('0x73')](_0x51cbcf[_0x98af('0xdf')])){var _0xe9a78c=_[_0x98af('0x32')](_0x574be8[_0x98af('0x4e')],function(_0xf240f7){return _0xf240f7;});var _0x14af43=_['toPairsIn'](_0xe9a78c)[0x0];var _0x1546d5=_['mapValues'](_0x14af43,function(_0xb04e09){return _0xb04e09;});_0x30de15=_0x1546d5[0x1][_0x51cbcf['subjectOffline']];}var _0x506488={'from':_0x4fbad7[_0x98af('0xdb')],'firstName':_0x4fbad7['firstName'],'lastName':_0x4fbad7[_0x98af('0xa2')],'mapKey':_0x98af('0xdb'),'message':{'from':_0x4fbad7[_0x98af('0xdb')],'to':_0x51cbcf[_0x98af('0xc7')][_0x98af('0xdb')],'cc':'','subject':_[_0x98af('0x73')](_0x30de15)?_0x51cbcf[_0x98af('0xdc')]:_0x30de15,'messageId':'','sentAt':new Date(),'attach':_0x27d761[_0x98af('0x3e')],'attachments':_0x27d761,'originChannel':'Chat','ChatWebsiteId':_0x51cbcf['id'],'ChatOfflineMessageId':_0x20c13a['id'],'originTo':_0x51cbcf[_0x98af('0xc7')][_0x98af('0xdb')]},'body':_0x20c13a['body']};var _0xbccc61={'account':{'id':_0x51cbcf[_0x98af('0xdd')]},'body':_0x506488,'log':_0x98af('0xe0')};return respondWithRpcPromise(_0x98af('0xe0'),_0x98af('0xe1'),_0xbccc61,client9001)[_0x98af('0x15')](function(){return _0x20c13a;})[_0x98af('0x1d')](function(_0x120c07){logger[_0x98af('0x18')](_0x120c07);});}return;})[_0x98af('0x15')](function(){if(_0x20c13a){return _0x20c13a;}})['then'](respondWithResult(_0x5ac0f4,null))[_0x98af('0x1d')](function(_0x446be8){logger[_0x98af('0x18')](_0x98af('0x1d'),_0x446be8);for(var _0x2b971e of _0x2045f2){var _0xbc1106=path[_0x98af('0x6d')](config[_0x98af('0x6e')],_0x98af('0xe2'),_0x98af('0xc2'),_0x98af('0xe3'),_0x98af('0xd0'),_0x2b971e[_0x98af('0x65')]);fs_extra['remove'](_0xbc1106)[_0x98af('0x1d')](function(_0x6d9665){logger[_0x98af('0x18')](_0x98af('0xe4'),_0xbc1106,_0x6d9665);});}});};exports['addInteraction']=function(_0x4ded1c,_0x21e169){return db[_0x98af('0xad')][_0x98af('0x4d')]({'where':{'id':_0x4ded1c[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x21e169,null))[_0x98af('0x15')](function(_0x48f290){if(_0x48f290){return _0x48f290[_0x98af('0xe5')](_0x4ded1c[_0x98af('0x4e')]['ids'],_[_0x98af('0xe6')](_0x4ded1c[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{});}})[_0x98af('0x15')](respondWithResult(_0x21e169,null))['catch'](handleError(_0x21e169,null));};exports[_0x98af('0xe7')]=function(_0x19fe23,_0x1bacc5){var _0x2f11a7={'raw':![],'where':{}};var _0x30c7ff={};var _0x46f829={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x98af('0x5f')]({'where':{'id':_0x19fe23[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1bacc5,null))[_0x98af('0x15')](function(_0x200cdf){if(_0x200cdf){_0x30c7ff['model']=_[_0x98af('0x38')](db[_0x98af('0xad')]['rawAttributes']);_0x30c7ff[_0x98af('0x37')]=_['keys'](_0x19fe23['query']);_0x30c7ff[_0x98af('0x39')]=_[_0x98af('0x3b')](_0x30c7ff['model'],_0x30c7ff[_0x98af('0x37')]);_0x2f11a7[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x30c7ff[_0x98af('0x3a')],qs['fields'](_0x19fe23[_0x98af('0x37')][_0x98af('0x3c')]));_0x2f11a7[_0x98af('0x3d')]=_0x2f11a7[_0x98af('0x3d')][_0x98af('0x3e')]?_0x2f11a7[_0x98af('0x3d')]:_0x30c7ff[_0x98af('0x3a')];if(!_0x19fe23[_0x98af('0x37')]['hasOwnProperty'](_0x98af('0x40'))){_0x2f11a7[_0x98af('0x24')]=qs['limit'](_0x19fe23[_0x98af('0x37')]['limit']);_0x2f11a7[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x19fe23[_0x98af('0x37')][_0x98af('0x22')]);}_0x2f11a7[_0x98af('0x60')]=qs['sort'](_0x19fe23[_0x98af('0x37')][_0x98af('0x41')]);_0x2f11a7[_0x98af('0x42')]=qs[_0x98af('0x39')](_['pick'](_0x19fe23[_0x98af('0x37')],_0x30c7ff[_0x98af('0x39')]));_0x2f11a7[_0x98af('0x42')][_0x98af('0x57')]=_0x200cdf['id'];if(_0x19fe23['query'][_0x98af('0x44')]){_0x2f11a7['where']=_[_0x98af('0x45')](_0x2f11a7['where'],{'$or':_[_0x98af('0x32')](_0x2f11a7[_0x98af('0x3d')],function(_0x1c39d9){var _0x4c9d84={};_0x4c9d84[_0x1c39d9]={'$like':'%'+_0x19fe23[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x4c9d84;})});}_0x2f11a7=_[_0x98af('0x45')]({},_0x2f11a7,_0x19fe23[_0x98af('0x5a')]);return db[_0x98af('0xad')]['count']({'where':_0x2f11a7[_0x98af('0x42')]})[_0x98af('0x15')](function(_0x194bd6){_0x46f829['count']=_0x194bd6;if(_0x19fe23[_0x98af('0x37')][_0x98af('0x47')]){_0x2f11a7[_0x98af('0x48')]=[{'model':db[_0x98af('0x82')],'as':_0x98af('0xe8'),'required':![]},{'model':db[_0x98af('0xb9')],'as':_0x98af('0xe9'),'attributes':['name',_0x98af('0xea'),_0x98af('0xeb')],'required':![]},{'model':db[_0x98af('0xec')],'as':_0x98af('0xed'),'attributes':['id','name',_0x98af('0xee')],'where':_0x19fe23[_0x98af('0x37')][_0x98af('0xef')]?{'id':_0x19fe23[_0x98af('0x37')][_0x98af('0xef')]}:undefined,'required':_0x19fe23['query']['tag']?!![]:![]}];}return db[_0x98af('0xad')]['findAll'](_0x2f11a7);})['then'](function(_0x2e93a2){_0x46f829['rows']=_0x2e93a2;return _0x46f829;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x1bacc5,_0x2f11a7))[_0x98af('0x1d')](handleError(_0x1bacc5,null));};function iftimePromise(_0x45cef5,_0x4c561b){return respondWithRpcPromise(_0x98af('0xf0'),_0x98af('0xf1'),{'command':_0x4c561b[_0x98af('0xf2')]?util[_0x98af('0xa8')](_0x98af('0xf3'),_0x45cef5[_0x98af('0xf4')],_0x4c561b[_0x98af('0xf2')]):util[_0x98af('0xa8')](_0x98af('0xf5'),_0x45cef5[_0x98af('0xf4')])},client9002)['then'](function(_0x2bc6cb){var _0x31326a=_0x2bc6cb&&_0x2bc6cb[_0x98af('0xf6')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4c561b['id'],_0x45cef5['id'],_0x45cef5[_0x98af('0xf4')],_0x31326a?'ONLINE':_0x98af('0xf7'),_0x4c561b[_0x98af('0xf2')]?_0x4c561b[_0x98af('0xf2')]:_0x98af('0xf8'));return _0x31326a;})[_0x98af('0x1d')](function(_0xe96fcb){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4c561b['id'],_0x45cef5['id'],_0x45cef5[_0x98af('0xf4')],util[_0x98af('0xf9')](_0xe96fcb,{'showHidden':![],'depth':null}),_0x4c561b[_0x98af('0xf2')]?_0x4c561b[_0x98af('0xf2')]:_0x98af('0xf8'));return![];});}exports[_0x98af('0xf1')]=function(_0x3d78f9,_0x220e58){var _0x4b0b63=0x0;var _0x11df48=0x0;var _0x3e93a4=![];var _0x4f1346;var _0x31265b;return db['ChatWebsite']['find']({'where':{'id':_0x3d78f9[_0x98af('0x4c')]['id']},'include':[{'model':db['Interval'],'as':_0x98af('0xfa'),'include':[{'model':db[_0x98af('0xfa')],'as':_0x98af('0xfb'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x98af('0x15')](handleEntityNotFound(_0x220e58,null))[_0x98af('0x15')](function(_0x15ed70){if(_0x15ed70){_0x4f1346=_0x15ed70;return _0x15ed70[_0x98af('0xfc')]({'raw':!![]});}})[_0x98af('0x15')](function(_0x182c04){if(_0x4f1346){if(_0x182c04){_0x31265b=_0x182c04;}}return require('../../config/license/util')['getLicense']();})[_0x98af('0x15')](function(_0x1f46b1){if(_0x1f46b1){_0x11df48=_0x1f46b1['virtual'];_0x3e93a4=_0x1f46b1[_0x98af('0x72')];}})[_0x98af('0x15')](function(){return db[_0x98af('0xad')][_0x98af('0x25')]({'where':{'closed':![]}});})['then'](function(_0x2d3c08){_0x4b0b63=_0x2d3c08;if(_0x11df48&&_0x2d3c08>_0x11df48){return db[_0x98af('0xfd')][_0x98af('0x5f')]({'where':{'id':0x1}})[_0x98af('0x15')](function(_0xe48b46){if(_0xe48b46){_0xe48b46[_0x98af('0xfe')]('chatLicenseExceeded');}});}})[_0x98af('0x15')](function(){if(_0x4f1346['Interval']&&_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')]){var _0x1a8942=[];for(var _0x1b711d=0x0;_0x1b711d<_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')][_0x98af('0x3e')];_0x1b711d++){var _0x262c79=_0x4f1346[_0x98af('0xfa')][_0x98af('0xfb')][_0x1b711d][_0x98af('0x2a')]({'plain':!![]});_0x1a8942[_0x98af('0xff')](iftimePromise(_0x262c79,_0x4f1346));}return BPromise[_0x98af('0x100')](_0x1a8942)[_0x98af('0x15')](function(_0x324803){return _[_0x98af('0x101')](_0x324803);});}else{return!![];}})[_0x98af('0x15')](function(_0x46cba0){var _0xbed2d1=fs['readFileSync'](path[_0x98af('0x6d')](config['root'],_0x98af('0x102')),_0x98af('0xca'));var _0x93f81e=new URL(_0x4f1346[_0x98af('0x103')])[_0x98af('0x104')];var _0x1a3257=_0x98af('0x105');var _0x2ef657=![];var _0x4296c2={'chatVersion':_0x1a3257,'chatWebsiteAddressOrigin':_0x93f81e,'remote':_0x4f1346['remote'],'query':querystring[_0x98af('0xab')](_[_0x98af('0x45')](_0x4f1346[_0x98af('0x2a')]({'plain':!![]}),{'customerIp':_0x3d78f9[_0x98af('0x9c')][_0x98af('0x9e')]||_0x3d78f9['headers']['x-real-ip']||_0x3d78f9[_0x98af('0x106')][_0x98af('0x107')]||_0x3d78f9['ip'],'referer':_0x3d78f9[_0x98af('0x9c')]['referer'],'openedInteractions':_0x4b0b63,'maxInteractions':_0x11df48,'virtual':_0x3e93a4['virtual'],'online':_0x46cba0,'custom':_0x3e93a4}))[_0x98af('0x108')](/'/g,'\x5c\x27')};_0x220e58[_0x98af('0x2e')](ejs['render'](Mustache['render'](_0xbed2d1,_0x4296c2),{'proactiveActions':_0x31265b,'alignment':_0x4f1346[_0x98af('0x109')],'verticalAlignment':_0x4f1346[_0x98af('0x10a')],'div_color':_0x4f1346[_0x98af('0xee')],'labelText':_0x4f1346['labelText'],'text_color':_0x4f1346[_0x98af('0x10b')],'text_button_color':_0x4f1346[_0x98af('0x10c')],'button_color':_0x4f1346[_0x98af('0x10d')],'background_color':_0x4f1346[_0x98af('0x10e')],'hideWhenOffline':_0x4f1346['hideWhenOffline'],'intervalId':_0x4f1346[_0x98af('0x10f')],'isDevelopment':_0x2ef657,'chatVersion':_0x1a3257}));})['catch'](handleError(_0x220e58,null));};exports[_0x98af('0x110')]=function(_0xf96560,_0x24e187){var _0x26d8ae=_0xf96560[_0x98af('0x4c')]['id'];var _0x5c803c=_0xf96560['body'];var _0x1aec67=0xc8;var _0x50bdb9=null;return db[_0x98af('0xd3')][_0x98af('0x111')]({'isolationLevel':db['sequelize'][_0x98af('0x112')][_0x98af('0x113')][_0x98af('0x114')]},function(_0x3ae736){return db['ChatWebsite']['findOne']({'where':{'id':_0x26d8ae},'transaction':_0x3ae736})[_0x98af('0x15')](function(_0x44fa43){if(_0x44fa43){return db[_0x98af('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x26d8ae},'transaction':_0x3ae736})[_0x98af('0x15')](function(){var _0x2be0d8=_[_0x98af('0x32')](_0x5c803c,function(_0x128c06){_0x128c06[_0x98af('0x57')]=_0x26d8ae;return _0x128c06;});return db[_0x98af('0x92')][_0x98af('0x115')](_0x2be0d8,{'transaction':_0x3ae736});});}else{_0x1aec67=0x194;_0x50bdb9=[];}});})[_0x98af('0x15')](function(){if(_0x1aec67!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x26d8ae},'order':_0x98af('0x116')})['then'](function(_0x30e291){_0x50bdb9=_0x30e291;});}})[_0x98af('0x1d')](function(_0x4e1b54){_0x1aec67=0x1f4;logger[_0x98af('0x18')](_0x4e1b54[_0x98af('0x117')]);if(_0x4e1b54['name']){delete _0x4e1b54[_0x98af('0x2d')];}_0x50bdb9=_0x4e1b54;})['finally'](function(){if(_0x50bdb9===null){_0x24e187[_0x98af('0x1e')](_0x1aec67);}else{if(_0x1aec67===0x1f4){_0x24e187[_0x98af('0x1f')](_0x1aec67)[_0x98af('0x2e')](_0x50bdb9);}else{_0x24e187[_0x98af('0x1f')](_0x1aec67)[_0x98af('0x21')](_0x50bdb9);}}});};exports[_0x98af('0x118')]=function(_0x5810e7,_0x3b47d1){var _0x455baa={};var _0x1a5358={};var _0x410912;var _0x46e082;return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x5810e7[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3b47d1,null))['then'](function(_0x4851f0){if(_0x4851f0){_0x410912=_0x4851f0;_0x1a5358[_0x98af('0x3a')]=_[_0x98af('0x38')](db[_0x98af('0x92')]['rawAttributes']);_0x1a5358[_0x98af('0x37')]=_[_0x98af('0x38')](_0x5810e7[_0x98af('0x37')]);_0x1a5358['filters']=_['intersection'](_0x1a5358[_0x98af('0x3a')],_0x1a5358['query']);_0x455baa[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x1a5358[_0x98af('0x3a')],qs['fields'](_0x5810e7[_0x98af('0x37')][_0x98af('0x3c')]));_0x455baa[_0x98af('0x3d')]=_0x455baa[_0x98af('0x3d')]['length']?_0x455baa['attributes']:_0x1a5358[_0x98af('0x3a')];_0x455baa['order']=qs['sort'](_0x5810e7[_0x98af('0x37')][_0x98af('0x41')]);_0x455baa[_0x98af('0x42')]=qs['filters'](_['pick'](_0x5810e7[_0x98af('0x37')],_0x1a5358[_0x98af('0x39')]));if(_0x5810e7[_0x98af('0x37')][_0x98af('0x44')]){_0x455baa[_0x98af('0x42')]=_[_0x98af('0x45')](_0x455baa[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x455baa[_0x98af('0x3d')],function(_0x23bcd8){var _0x5c040d={};_0x5c040d[_0x23bcd8]={'$like':'%'+_0x5810e7[_0x98af('0x37')][_0x98af('0x44')]+'%'};return _0x5c040d;})});}_0x455baa=_[_0x98af('0x45')]({},_0x455baa,_0x5810e7[_0x98af('0x5a')]);return _0x410912['getApplications'](_0x455baa);}})[_0x98af('0x15')](function(_0x2fe842){if(_0x2fe842){_0x46e082=_0x2fe842[_0x98af('0x3e')];if(!_0x5810e7[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x455baa['limit']=qs['limit'](_0x5810e7['query']['limit']);_0x455baa[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x5810e7[_0x98af('0x37')][_0x98af('0x22')]);}return _0x410912[_0x98af('0x118')](_0x455baa);}})[_0x98af('0x15')](function(_0x13ccc9){if(_0x13ccc9){return _0x13ccc9?{'count':_0x46e082,'rows':_0x13ccc9}:null;}})[_0x98af('0x15')](respondWithResult(_0x3b47d1,null))[_0x98af('0x1d')](handleError(_0x3b47d1,null));};exports[_0x98af('0x119')]=function(_0x29acad,_0x1c1985){return db['chatProactiveAction'][_0x98af('0x4d')]({'where':{'id':_0x29acad[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c1985,null))[_0x98af('0x15')](function(_0x8532fb){if(_0x8532fb){return _0x8532fb['addProactiveActions'](_0x29acad[_0x98af('0x4e')]['ids'],_['omit'](_0x29acad[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{});}})[_0x98af('0x15')](respondWithResult(_0x1c1985,null))[_0x98af('0x1d')](handleError(_0x1c1985,null));};exports[_0x98af('0xfc')]=function(_0x25ce99,_0x58790f){var _0xd188ed={};var _0x342f27={};var _0x2fddaa;var _0x2bfcc4;return db[_0x98af('0x33')]['findOne']({'where':{'id':_0x25ce99[_0x98af('0x4c')]['id']}})['then'](handleEntityNotFound(_0x58790f,null))['then'](function(_0x3adc8f){if(_0x3adc8f){_0x2fddaa=_0x3adc8f;_0x342f27[_0x98af('0x3a')]=_['keys'](db[_0x98af('0x11a')][_0x98af('0x34')]);_0x342f27[_0x98af('0x37')]=_[_0x98af('0x38')](_0x25ce99[_0x98af('0x37')]);_0x342f27['filters']=_[_0x98af('0x3b')](_0x342f27[_0x98af('0x3a')],_0x342f27[_0x98af('0x37')]);_0xd188ed[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x342f27[_0x98af('0x3a')],qs[_0x98af('0x3c')](_0x25ce99[_0x98af('0x37')]['fields']));_0xd188ed[_0x98af('0x3d')]=_0xd188ed[_0x98af('0x3d')]['length']?_0xd188ed[_0x98af('0x3d')]:_0x342f27[_0x98af('0x3a')];_0xd188ed['order']=qs[_0x98af('0x41')](_0x25ce99[_0x98af('0x37')]['sort']);_0xd188ed[_0x98af('0x42')]=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x25ce99['query'],_0x342f27[_0x98af('0x39')]));if(_0x25ce99[_0x98af('0x37')]['filter']){_0xd188ed[_0x98af('0x42')]=_[_0x98af('0x45')](_0xd188ed['where'],{'$or':_[_0x98af('0x32')](_0xd188ed[_0x98af('0x3d')],function(_0x2ca474){var _0x110d92={};_0x110d92[_0x2ca474]={'$like':'%'+_0x25ce99[_0x98af('0x37')]['filter']+'%'};return _0x110d92;})});}_0xd188ed=_[_0x98af('0x45')]({},_0xd188ed,_0x25ce99['options']);return _0x2fddaa['getProactiveActions'](_0xd188ed);}})[_0x98af('0x15')](function(_0x13ad68){if(_0x13ad68){_0x2bfcc4=_0x13ad68[_0x98af('0x3e')];if(!_0x25ce99['query']['hasOwnProperty']('nolimit')){_0xd188ed[_0x98af('0x24')]=qs[_0x98af('0x24')](_0x25ce99[_0x98af('0x37')][_0x98af('0x24')]);_0xd188ed['offset']=qs[_0x98af('0x22')](_0x25ce99[_0x98af('0x37')][_0x98af('0x22')]);}return _0x2fddaa[_0x98af('0xfc')](_0xd188ed);}})[_0x98af('0x15')](function(_0x177a03){if(_0x177a03){return _0x177a03?{'count':_0x2bfcc4,'rows':_0x177a03}:null;}})['then'](respondWithResult(_0x58790f,null))[_0x98af('0x1d')](handleError(_0x58790f,null));};exports[_0x98af('0x11b')]=function(_0x172a32,_0x4ed7ce){var _0x2c461b=_0x172a32[_0x98af('0x37')][_0x98af('0x11c')]===_0x98af('0x11d')?'offlineForm':_0x98af('0x11e');return db[_0x98af('0x33')][_0x98af('0x4d')]({'attributes':['id',_0x2c461b],'where':{'id':_0x172a32[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x4ed7ce,null))[_0x98af('0x15')](function(_0x99f006){if(_0x99f006){var _0x676dd1=_0x99f006[_0x2c461b];var _0x103bf2=_0x676dd1&&_0x676dd1['items']?_0x676dd1[_0x98af('0x11f')]:[];_0x4ed7ce['send']({'fromKey':_[_0x98af('0x73')](_0x676dd1[_0x98af('0x120')])?undefined:_0x676dd1[_0x98af('0x120')],'count':_0x103bf2[_0x98af('0x3e')],'rows':_0x103bf2});}})[_0x98af('0x1d')](handleError(_0x4ed7ce,null));};exports[_0x98af('0x121')]=function(_0x39a53b,_0x3b76a1){var _0x125c1f={'raw':![],'where':{}};var _0x335eb2={};var _0x236ee0={'count':0x0,'rows':[]};return db[_0x98af('0x33')][_0x98af('0x5f')]({'where':{'id':_0x39a53b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3b76a1,null))['then'](function(_0x467244){if(_0x467244){_0x335eb2[_0x98af('0x3a')]=_['keys'](db[_0x98af('0xcd')][_0x98af('0x34')]);_0x335eb2[_0x98af('0x37')]=_[_0x98af('0x38')](_0x39a53b[_0x98af('0x37')]);_0x335eb2['filters']=_[_0x98af('0x3b')](_0x335eb2[_0x98af('0x3a')],_0x335eb2[_0x98af('0x37')]);_0x125c1f[_0x98af('0x3d')]=_['intersection'](_0x335eb2['model'],qs['fields'](_0x39a53b['query'][_0x98af('0x3c')]));_0x125c1f[_0x98af('0x3d')]=_0x125c1f[_0x98af('0x3d')][_0x98af('0x3e')]?_0x125c1f['attributes']:_0x335eb2['model'];if(!_0x39a53b[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0x125c1f['limit']=qs['limit'](_0x39a53b[_0x98af('0x37')][_0x98af('0x24')]);_0x125c1f[_0x98af('0x22')]=qs[_0x98af('0x22')](_0x39a53b['query'][_0x98af('0x22')]);}_0x125c1f[_0x98af('0x60')]=qs[_0x98af('0x41')](_0x39a53b[_0x98af('0x37')]['sort']);_0x125c1f['where']=qs[_0x98af('0x39')](_[_0x98af('0x43')](_0x39a53b['query'],_0x335eb2[_0x98af('0x39')]));_0x125c1f[_0x98af('0x42')][_0x98af('0x57')]=_0x467244['id'];if(_0x39a53b[_0x98af('0x37')][_0x98af('0x44')]){_0x125c1f[_0x98af('0x42')]=_['merge'](_0x125c1f[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0x125c1f[_0x98af('0x3d')],function(_0x173666){var _0x39d6af={};_0x39d6af[_0x173666]={'$like':'%'+_0x39a53b['query'][_0x98af('0x44')]+'%'};return _0x39d6af;})});}_0x125c1f=_[_0x98af('0x45')]({},_0x125c1f,_0x39a53b[_0x98af('0x5a')]);return db[_0x98af('0xcd')]['count']({'where':_0x125c1f['where']})['then'](function(_0x711f5f){_0x236ee0['count']=_0x711f5f;if(_0x39a53b[_0x98af('0x37')][_0x98af('0x47')]){_0x125c1f[_0x98af('0x48')]=[{'all':!![]}];}else{_0x125c1f['include']=[{'model':db['CmContact'],'as':_0x98af('0xe8'),'required':![]},{'model':db[_0x98af('0x122')],'as':_0x98af('0x123'),'required':![]}];}return db[_0x98af('0xcd')][_0x98af('0x49')](_0x125c1f);})[_0x98af('0x15')](function(_0x452b2c){_0x236ee0[_0x98af('0x4a')]=_0x452b2c;return _0x236ee0;});}})[_0x98af('0x15')](respondWithFilteredResult(_0x3b76a1,_0x125c1f))[_0x98af('0x1d')](handleError(_0x3b76a1,null));};exports[_0x98af('0x124')]=function(_0x983fad,_0x1f7832){return db[_0x98af('0x33')][_0x98af('0x4d')]({'where':{'id':_0x983fad[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x1f7832,null))[_0x98af('0x15')](function(_0x43bfbe){if(_0x43bfbe){return _0x43bfbe[_0x98af('0x124')](_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')],_[_0x98af('0xe6')](_0x983fad[_0x98af('0x4e')],[_0x98af('0x5c'),'id'])||{})[_0x98af('0x125')](function(_0x1f1a32){for(var _0x29dae4=0x0;_0x29dae4<_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')][_0x98af('0x3e')];_0x29dae4+=0x1){socket[_0x98af('0x126')](_0x98af('0x127'),{'UserId':Number(_0x983fad[_0x98af('0x4e')][_0x98af('0x5c')][_0x29dae4]),'ChatWebsiteId':Number(_0x983fad[_0x98af('0x4c')]['id'])});}return _0x1f1a32;});}})[_0x98af('0x15')](respondWithResult(_0x1f7832,null))['catch'](handleError(_0x1f7832,null));};exports['removeAgents']=function(_0x5a19d7,_0x3af7f8){return db['ChatWebsite'][_0x98af('0x4d')]({'where':{'id':_0x5a19d7['params']['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x3af7f8,null))[_0x98af('0x15')](function(_0x362283){if(_0x362283){return _0x362283['removeAgents'](_0x5a19d7['query']['ids'])[_0x98af('0x15')](function(){if(_['isArray'](_0x5a19d7['query'][_0x98af('0x5c')])){for(var _0x3e967e=0x0;_0x3e967e<_0x5a19d7[_0x98af('0x37')][_0x98af('0x5c')][_0x98af('0x3e')];_0x3e967e+=0x1){socket['emit'](_0x98af('0x128'),{'UserId':Number(_0x5a19d7['query']['ids'][_0x3e967e]),'ChatWebsiteId':Number(_0x5a19d7['params']['id'])});}}else{socket[_0x98af('0x126')](_0x98af('0x128'),{'UserId':Number(_0x5a19d7[_0x98af('0x37')]['ids']),'ChatWebsiteId':Number(_0x5a19d7[_0x98af('0x4c')]['id'])});}});}})[_0x98af('0x15')](respondWithStatusCode(_0x3af7f8,null))['catch'](handleError(_0x3af7f8,null));};exports['getAgents']=function(_0x5af45b,_0x23d3fc){var _0xfa0f1a={};var _0x476588={};var _0x105aed;var _0x5620ed;return db['ChatWebsite'][_0x98af('0x5f')]({'where':{'id':_0x5af45b[_0x98af('0x4c')]['id']}})[_0x98af('0x15')](handleEntityNotFound(_0x23d3fc,null))[_0x98af('0x15')](function(_0x23658f){if(_0x23658f){_0x105aed=_0x23658f;_0x476588['model']=_['keys'](db[_0x98af('0xb9')][_0x98af('0x34')]);_0x476588[_0x98af('0x37')]=_['keys'](_0x5af45b[_0x98af('0x37')]);_0x476588['filters']=_['intersection'](_0x476588['model'],_0x476588[_0x98af('0x37')]);_0xfa0f1a[_0x98af('0x3d')]=_[_0x98af('0x3b')](_0x476588['model'],qs[_0x98af('0x3c')](_0x5af45b[_0x98af('0x37')]['fields']));_0xfa0f1a[_0x98af('0x3d')]=_0xfa0f1a[_0x98af('0x3d')][_0x98af('0x3e')]?_0xfa0f1a[_0x98af('0x3d')]:_0x476588[_0x98af('0x3a')];_0xfa0f1a[_0x98af('0x60')]=qs['sort'](_0x5af45b[_0x98af('0x37')]['sort']);_0xfa0f1a[_0x98af('0x42')]=qs['filters'](_[_0x98af('0x43')](_0x5af45b[_0x98af('0x37')],_0x476588['filters']));if(_0x5af45b['query']['filter']){_0xfa0f1a[_0x98af('0x42')]=_[_0x98af('0x45')](_0xfa0f1a[_0x98af('0x42')],{'$or':_[_0x98af('0x32')](_0xfa0f1a[_0x98af('0x3d')],function(_0x162a37){var _0x332c05={};_0x332c05[_0x162a37]={'$like':'%'+_0x5af45b[_0x98af('0x37')]['filter']+'%'};return _0x332c05;})});}_0xfa0f1a=_['merge']({},_0xfa0f1a,_0x5af45b['options']);return _0x105aed[_0x98af('0x129')](_0xfa0f1a);}})['then'](function(_0x16e53f){if(_0x16e53f){_0x5620ed=_0x16e53f[_0x98af('0x3e')];if(!_0x5af45b[_0x98af('0x37')][_0x98af('0x3f')](_0x98af('0x40'))){_0xfa0f1a[_0x98af('0x24')]=qs['limit'](_0x5af45b[_0x98af('0x37')][_0x98af('0x24')]);_0xfa0f1a[_0x98af('0x22')]=qs['offset'](_0x5af45b[_0x98af('0x37')][_0x98af('0x22')]);}return _0x105aed['getAgents'](_0xfa0f1a);}})['then'](function(_0x45cb85){if(_0x45cb85){return _0x45cb85?{'count':_0x5620ed,'rows':_0x45cb85}:null;}})[_0x98af('0x15')](respondWithResult(_0x23d3fc,null))[_0x98af('0x1d')](handleError(_0x23d3fc,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 6dc3993..3fc5062 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 _0x5eb8=['exports','../../mysqldb','ChatWebsite','update','remove','emit','hasOwnProperty','hook'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5eb8,0x1d1));var _0x85eb=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x5eb8[_0xd1c39b];return _0x58f5bc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x85eb('0x0'))['db'][_0x85eb('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85eb('0x2'),'afterDestroy':_0x85eb('0x3')};function emitEvent(_0x4aa372){return function(_0x41b11e,_0x30ac6a,_0x3174ce){ChatWebsiteEvents[_0x85eb('0x4')](_0x4aa372+':'+_0x41b11e['id'],_0x41b11e);ChatWebsiteEvents['emit'](_0x4aa372,_0x41b11e);_0x3174ce(null);};}for(var e in events){if(events[_0x85eb('0x5')](e)){var event=events[e];ChatWebsite[_0x85eb('0x6')](e,emitEvent(event));}}module[_0x85eb('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x9a22=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x1ec938,_0x109d26){var _0x220f91=function(_0x413cf5){while(--_0x413cf5){_0x1ec938['push'](_0x1ec938['shift']());}};_0x220f91(++_0x109d26);}(_0x9a22,0x75));var _0x29a2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9a22[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x29a2('0x0'));var ChatWebsite=require(_0x29a2('0x1'))['db'][_0x29a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x29a2('0x3')](0x0);var events={'afterCreate':_0x29a2('0x4'),'afterUpdate':_0x29a2('0x5'),'afterDestroy':_0x29a2('0x6')};function emitEvent(_0x4cbd7e){return function(_0x4e617e,_0x427d51,_0x2855c8){ChatWebsiteEvents[_0x29a2('0x7')](_0x4cbd7e+':'+_0x4e617e['id'],_0x4e617e);ChatWebsiteEvents[_0x29a2('0x7')](_0x4cbd7e,_0x4e617e);_0x2855c8(null);};}for(var e in events){if(events[_0x29a2('0x8')](e)){var event=events[e];ChatWebsite[_0x29a2('0x9')](e,emitEvent(event));}}module[_0x29a2('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0a72a6d..134ea35 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 _0x5930=['api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','lodash'];(function(_0x117260,_0x14e08f){var _0x4d32f7=function(_0x1c5446){while(--_0x1c5446){_0x117260['push'](_0x117260['shift']());}};_0x4d32f7(++_0x14e08f);}(_0x5930,0x1af));var _0x0593=function(_0x5ad8dd,_0x27ec37){_0x5ad8dd=_0x5ad8dd-0x0;var _0x51d484=_0x5930[_0x5ad8dd];return _0x51d484;};'use strict';var _=require(_0x0593('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0593('0x1'));var moment=require(_0x0593('0x2'));var BPromise=require(_0x0593('0x3'));var rp=require(_0x0593('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0593('0x5'));var attributes=require(_0x0593('0x6'));module[_0x0593('0x7')]=function(_0x3e070a,_0x1bf28b){return _0x3e070a[_0x0593('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eeb=['moment','path','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','util','../../config/logger','api'];(function(_0x315109,_0x447bfb){var _0x8c20ee=function(_0x2284a9){while(--_0x2284a9){_0x315109['push'](_0x315109['shift']());}};_0x8c20ee(++_0x447bfb);}(_0x7eeb,0x1d1));var _0xb7ee=function(_0x58b6d8,_0x3f3cb1){_0x58b6d8=_0x58b6d8-0x0;var _0x928a75=_0x7eeb[_0x58b6d8];return _0x928a75;};'use strict';var _=require('lodash');var util=require(_0xb7ee('0x0'));var logger=require(_0xb7ee('0x1'))(_0xb7ee('0x2'));var moment=require(_0xb7ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ee('0x4'));var rimraf=require('rimraf');var config=require(_0xb7ee('0x5'));var attributes=require(_0xb7ee('0x6'));module['exports']=function(_0x416583,_0x49e287){return _0x416583[_0xb7ee('0x7')](_0xb7ee('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 66900d5..f028acd 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 _0x511d=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./chatWebsite.socket','request','then','info'];(function(_0x5671c9,_0x15f47e){var _0x24c8de=function(_0x533836){while(--_0x533836){_0x5671c9['push'](_0x5671c9['shift']());}};_0x24c8de(++_0x15f47e);}(_0x511d,0x165));var _0xd511=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x511d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd511('0x0'));var util=require(_0xd511('0x1'));var moment=require(_0xd511('0x2'));var BPromise=require(_0xd511('0x3'));var rs=require(_0xd511('0x4'));var fs=require('fs');var Redis=require(_0xd511('0x5'));var db=require(_0xd511('0x6'))['db'];var utils=require(_0xd511('0x7'));var logger=require(_0xd511('0x8'))(_0xd511('0x9'));var config=require(_0xd511('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd511('0xb')]({'port':0x232a});config[_0xd511('0xc')]=_['defaults'](config[_0xd511('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd511('0xd'))(new Redis(config[_0xd511('0xc')]));require(_0xd511('0xe'))['register'](socket);function respondWithRpcPromise(_0x515808,_0x24112d,_0x14758e){return new BPromise(function(_0x56b990,_0x279e05){return client[_0xd511('0xf')](_0x515808,_0x14758e)[_0xd511('0x10')](function(_0x5181cd){logger[_0xd511('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0xd511('0x12'));logger[_0xd511('0x13')](_0xd511('0x14'),_0x24112d,'request\x20sent',JSON[_0xd511('0x15')](_0x5181cd));if(_0x5181cd[_0xd511('0x16')]){if(_0x5181cd[_0xd511('0x16')]['code']===0x1f4){logger[_0xd511('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x24112d,_0x5181cd[_0xd511('0x16')]['message']);return _0x279e05(_0x5181cd[_0xd511('0x16')][_0xd511('0x17')]);}logger['error'](_0xd511('0x18'),_0x24112d,_0x5181cd['error']['message']);return _0x56b990(_0x5181cd['error'][_0xd511('0x17')]);}else{logger[_0xd511('0x11')](_0xd511('0x18'),_0x24112d,'request\x20sent');_0x56b990(_0x5181cd['result'][_0xd511('0x17')]);}})['catch'](function(_0xd9daae){logger[_0xd511('0x16')](_0xd511('0x18'),_0x24112d,_0xd9daae);_0x279e05(_0xd9daae);});});} \ No newline at end of file +var _0x51cf=['client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x27cba8,_0x14f174){var _0x1b0776=function(_0x5848bf){while(--_0x5848bf){_0x27cba8['push'](_0x27cba8['shift']());}};_0x1b0776(++_0x14f174);}(_0x51cf,0x15d));var _0xf51c=function(_0x2f42ec,_0x5ddc9d){_0x2f42ec=_0x2f42ec-0x0;var _0x26ed3e=_0x51cf[_0x2f42ec];return _0x26ed3e;};'use strict';var _=require(_0xf51c('0x0'));var util=require(_0xf51c('0x1'));var moment=require(_0xf51c('0x2'));var BPromise=require(_0xf51c('0x3'));var rs=require(_0xf51c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf51c('0x5'))['db'];var utils=require(_0xf51c('0x6'));var logger=require(_0xf51c('0x7'))(_0xf51c('0x8'));var config=require(_0xf51c('0x9'));var jayson=require(_0xf51c('0xa'));var client=jayson[_0xf51c('0xb')][_0xf51c('0xc')]({'port':0x232a});config[_0xf51c('0xd')]=_[_0xf51c('0xe')](config[_0xf51c('0xd')],{'host':_0xf51c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf51c('0x10'))['register'](socket);function respondWithRpcPromise(_0x2898b,_0x1b770e,_0xb86791){return new BPromise(function(_0x2bd6a9,_0x2e31bc){return client[_0xf51c('0x11')](_0x2898b,_0xb86791)[_0xf51c('0x12')](function(_0x5b3d9d){logger[_0xf51c('0x13')](_0xf51c('0x14'),_0x1b770e,_0xf51c('0x15'));logger[_0xf51c('0x16')](_0xf51c('0x17'),_0x1b770e,_0xf51c('0x15'),JSON[_0xf51c('0x18')](_0x5b3d9d));if(_0x5b3d9d[_0xf51c('0x19')]){if(_0x5b3d9d['error'][_0xf51c('0x1a')]===0x1f4){logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);return _0x2e31bc(_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);}logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x5b3d9d[_0xf51c('0x19')][_0xf51c('0x1b')]);return _0x2bd6a9(_0x5b3d9d['error']['message']);}else{logger[_0xf51c('0x13')](_0xf51c('0x14'),_0x1b770e,_0xf51c('0x15'));_0x2bd6a9(_0x5b3d9d[_0xf51c('0x1c')][_0xf51c('0x1b')]);}})[_0xf51c('0x1d')](function(_0x6621a9){logger[_0xf51c('0x19')](_0xf51c('0x14'),_0x1b770e,_0x6621a9);_0x2e31bc(_0x6621a9);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 67049ce..9b2ac41 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 _0x48f8=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x48f8,0x15d));var _0x848f=function(_0x2b58d4,_0x2685bd){_0x2b58d4=_0x2b58d4-0x0;var _0x148fcd=_0x48f8[_0x2b58d4];return _0x148fcd;};'use strict';var ChatWebsiteEvents=require(_0x848f('0x0'));var events=['save',_0x848f('0x1'),_0x848f('0x2')];function createListener(_0x4536f8,_0x1c30e8){return function(_0x1da110){_0x1c30e8[_0x848f('0x3')](_0x4536f8,_0x1da110);};}function removeListener(_0x43aeea,_0x16e587){return function(){ChatWebsiteEvents[_0x848f('0x4')](_0x43aeea,_0x16e587);};}exports['register']=function(_0x61d051){for(var _0x3a8a27=0x0,_0x104d96=events[_0x848f('0x5')];_0x3a8a27<_0x104d96;_0x3a8a27++){var _0x4e6e01=events[_0x3a8a27];var _0x16188f=createListener(_0x848f('0x6')+_0x4e6e01,_0x61d051);ChatWebsiteEvents['on'](_0x4e6e01,_0x16188f);}}; \ No newline at end of file +var _0x5533=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x5533,0x1d5));var _0x3553=function(_0x46c223,_0x5119b0){_0x46c223=_0x46c223-0x0;var _0x44d9f3=_0x5533[_0x46c223];return _0x44d9f3;};'use strict';var ChatWebsiteEvents=require(_0x3553('0x0'));var events=[_0x3553('0x1'),_0x3553('0x2'),_0x3553('0x3')];function createListener(_0x4b9945,_0xbb9b4){return function(_0x344262){_0xbb9b4[_0x3553('0x4')](_0x4b9945,_0x344262);};}function removeListener(_0x55d782,_0x3b8bdb){return function(){ChatWebsiteEvents[_0x3553('0x5')](_0x55d782,_0x3b8bdb);};}exports[_0x3553('0x6')]=function(_0x1d1613){for(var _0x994635=0x0,_0x3c04c1=events[_0x3553('0x7')];_0x994635<_0x3c04c1;_0x994635++){var _0x30326c=events[_0x994635];var _0x3aa311=createListener(_0x3553('0x8')+_0x30326c,_0x1d1613);ChatWebsiteEvents['on'](_0x30326c,_0x3aa311);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5470ac7..2673a54 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 _0xa61b=['/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','diskStorage','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','join','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa61b,0x1e8));var _0xba61=function(_0x9d2283,_0x451e89){_0x9d2283=_0x9d2283-0x0;var _0x1466d9=_0xa61b[_0x9d2283];return _0x1466d9;};'use strict';var multer=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var path=require(_0xba61('0x2'));var timeout=require('connect-timeout');var express=require(_0xba61('0x3'));var router=express[_0xba61('0x4')]();var fs_extra=require(_0xba61('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xba61('0x6'));var config=require(_0xba61('0x7'));var controller=require(_0xba61('0x8'));router[_0xba61('0x9')]('/',auth[_0xba61('0xa')](),controller[_0xba61('0xb')]);router[_0xba61('0x9')](_0xba61('0xc'),auth['isAuthenticated'](),controller[_0xba61('0xd')]);router[_0xba61('0x9')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller[_0xba61('0xf')]);router['get'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x11')]);router[_0xba61('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xba61('0x9')](_0xba61('0x12'),controller[_0xba61('0x13')]);router['get'](_0xba61('0x14'),controller[_0xba61('0x15')]);router['get'](_0xba61('0x16'),controller['getCustomerAvatar']);router[_0xba61('0x9')]('/:id/system_avatar',controller[_0xba61('0x17')]);router[_0xba61('0x9')](_0xba61('0x18'),auth[_0xba61('0xa')](),controller['getInteractions']);router[_0xba61('0x9')](_0xba61('0x19'),controller[_0xba61('0x1a')]);router[_0xba61('0x9')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x1c')]);router[_0xba61('0x9')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['getProactiveActions']);router[_0xba61('0x9')](_0xba61('0x1e'),controller[_0xba61('0x1f')]);router[_0xba61('0x9')](_0xba61('0x20'),auth[_0xba61('0xa')](),controller[_0xba61('0x21')]);router[_0xba61('0x9')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xba61('0x23')]);router[_0xba61('0x24')](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x25')]);router[_0xba61('0x24')]('/:id/canned_answers',auth[_0xba61('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x482c12,_0x2a5808,_0x2a5965){_0x2a5965(null,path['join'](config[_0xba61('0x27')],'server/files/images/logos/'));},'filename':function(_0x176eee,_0x5e306c,_0x591dc9){_0x591dc9(null,util[_0xba61('0x28')]('%s-%s',Date[_0xba61('0x29')](),_0x5e306c[_0xba61('0x2a')]));}})});router['post'](_0xba61('0x12'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x2d')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x393cb0,_0x128d0a,_0x37d8a7){_0x37d8a7(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x288d6d,_0x1960db,_0x4a16ea){_0x4a16ea(null,util['format'](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x1960db['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x14'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller[_0xba61('0x30')]);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x3e0fbc,_0x426d16,_0x4c025b){_0x4c025b(null,path[_0xba61('0x31')](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x8ae8e3,_0x3a4875,_0x5a8308){_0x5a8308(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x3a4875['originalname']));}})});router[_0xba61('0x24')](_0xba61('0x16'),upload[_0xba61('0x2b')](_0xba61('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x14c672,_0x43d810,_0x515904){_0x515904(null,path['join'](config[_0xba61('0x27')],_0xba61('0x2e')));},'filename':function(_0x76816f,_0x307938,_0x12c2d9){_0x12c2d9(null,util[_0xba61('0x28')](_0xba61('0x2f'),Date[_0xba61('0x29')](),_0x307938[_0xba61('0x2a')]));}})});router[_0xba61('0x24')](_0xba61('0x32'),upload[_0xba61('0x2b')]('file'),controller[_0xba61('0x33')]);router[_0xba61('0x24')](_0xba61('0x34'),controller[_0xba61('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xba61('0x26')]({'destination':function(_0x48a265,_0x19b0d4,_0x353cd0){const _0xad53a1=path['join'](config[_0xba61('0x27')],'server/files',_0xba61('0x36'),'offline-chat');fs_extra[_0xba61('0x37')](_0xad53a1,function(){_0x353cd0(null,_0xad53a1);});},'filename':function(_0x5ab8bb,_0x39d21a,_0x461cfe){const _0x3d0471=_0x39d21a[_0xba61('0x2a')][_0xba61('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1ac680=path[_0xba61('0x39')](_0x3d0471);const _0x32f431=Date[_0xba61('0x29')]()+'-'+_0x3d0471[_0xba61('0x38')](_0x1ac680,'')+_0x1ac680;_0x461cfe(null,_0x32f431);}})});router[_0xba61('0x24')](_0xba61('0x3a'),offlineUploadMulter[_0xba61('0x3b')](),controller[_0xba61('0x3c')]);router[_0xba61('0x24')]('/:id/interactions',auth[_0xba61('0xa')](),controller[_0xba61('0x3d')]);router[_0xba61('0x24')](_0xba61('0x1b'),auth[_0xba61('0xa')](),controller[_0xba61('0x3e')]);router[_0xba61('0x24')](_0xba61('0x1d'),auth[_0xba61('0xa')](),controller['addProactiveActions']);router['post'](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x3f')]);router[_0xba61('0x40')](_0xba61('0xe'),auth[_0xba61('0xa')](),controller['update']);router[_0xba61('0x41')](_0xba61('0xe'),auth['isAuthenticated'](),controller[_0xba61('0x42')]);router['delete'](_0xba61('0x10'),auth[_0xba61('0xa')](),controller[_0xba61('0x43')]);router[_0xba61('0x41')](_0xba61('0x44'),auth[_0xba61('0xa')](),controller[_0xba61('0x45')]);router[_0xba61('0x41')](_0xba61('0x22'),auth[_0xba61('0xa')](),controller[_0xba61('0x46')]);module[_0xba61('0x47')]=router; \ No newline at end of file +var _0xb507=['/:id/interactions','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','server/files/images/avatars/','originalname','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','any','addInteraction','/:id/applications','addApplications','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x28d1b9,_0x4d4388){var _0x3302c2=function(_0x324166){while(--_0x324166){_0x28d1b9['push'](_0x28d1b9['shift']());}};_0x3302c2(++_0x4d4388);}(_0xb507,0x1ca));var _0x7b50=function(_0x4ec42,_0x36177b){_0x4ec42=_0x4ec42-0x0;var _0x385e11=_0xb507[_0x4ec42];return _0x385e11;};'use strict';var multer=require(_0x7b50('0x0'));var util=require(_0x7b50('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7b50('0x2'));var router=express[_0x7b50('0x3')]();var fs_extra=require(_0x7b50('0x4'));var auth=require(_0x7b50('0x5'));var interaction=require(_0x7b50('0x6'));var config=require(_0x7b50('0x7'));var controller=require('./chatWebsite.controller');router[_0x7b50('0x8')]('/',auth['isAuthenticated'](),controller[_0x7b50('0x9')]);router[_0x7b50('0x8')](_0x7b50('0xa'),auth[_0x7b50('0xb')](),controller['describe']);router[_0x7b50('0x8')](_0x7b50('0xc'),auth[_0x7b50('0xb')](),controller[_0x7b50('0xd')]);router[_0x7b50('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7b50('0xe')]);router[_0x7b50('0x8')](_0x7b50('0xf'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x10')]);router[_0x7b50('0x8')](_0x7b50('0x11'),controller[_0x7b50('0x12')]);router[_0x7b50('0x8')](_0x7b50('0x13'),controller[_0x7b50('0x14')]);router[_0x7b50('0x8')](_0x7b50('0x15'),controller[_0x7b50('0x16')]);router[_0x7b50('0x8')](_0x7b50('0x17'),controller[_0x7b50('0x18')]);router[_0x7b50('0x8')](_0x7b50('0x19'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x7b50('0x8')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0x7b50('0xb')](),controller[_0x7b50('0x1a')]);router[_0x7b50('0x8')](_0x7b50('0x1b'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x1c')]);router[_0x7b50('0x8')](_0x7b50('0x1d'),controller['getFields']);router[_0x7b50('0x8')]('/:id/offline_messages',auth[_0x7b50('0xb')](),controller['getOfflineMessages']);router[_0x7b50('0x8')](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller['getAgents']);router[_0x7b50('0x1f')]('/',auth[_0x7b50('0xb')](),controller[_0x7b50('0x20')]);router[_0x7b50('0x1f')](_0x7b50('0x21'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x22')]);router[_0x7b50('0x1f')](_0x7b50('0xf'),auth['isAuthenticated'](),controller[_0x7b50('0x23')]);var upload=multer({'storage':multer[_0x7b50('0x24')]({'destination':function(_0x34f826,_0x336130,_0x52e494){_0x52e494(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x27')));},'filename':function(_0x3b065e,_0x108b30,_0x26913c){_0x26913c(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x108b30['originalname']));}})});router['post']('/:id/logo',upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2de558,_0x8681b9,_0x18fa86){_0x18fa86(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x2e')));},'filename':function(_0x4eefdc,_0x9a1b60,_0x4f83cd){_0x4f83cd(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x9a1b60[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x13'),upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40890b,_0x4a9c9e,_0x3ac260){_0x3ac260(null,path[_0x7b50('0x25')](config[_0x7b50('0x26')],_0x7b50('0x2e')));},'filename':function(_0x5c914b,_0x28dc7b,_0xfcd410){_0xfcd410(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date['now'](),_0x28dc7b[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x15'),upload[_0x7b50('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7b50('0x24')]({'destination':function(_0xc2c3b9,_0x6861e3,_0x23dbd3){_0x23dbd3(null,path[_0x7b50('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x28f533,_0x55e96d,_0x4e5b0c){_0x4e5b0c(null,util[_0x7b50('0x28')](_0x7b50('0x29'),Date[_0x7b50('0x2a')](),_0x55e96d[_0x7b50('0x2f')]));}})});router[_0x7b50('0x1f')](_0x7b50('0x17'),upload[_0x7b50('0x2b')](_0x7b50('0x2c')),controller[_0x7b50('0x31')]);router[_0x7b50('0x1f')](_0x7b50('0x32'),controller[_0x7b50('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3f2ce0,_0x51cd9f,_0x31cd3f){const _0x239cf3=path[_0x7b50('0x25')](config['root'],_0x7b50('0x34'),_0x7b50('0x35'),_0x7b50('0x36'));fs_extra['ensureDir'](_0x239cf3,function(){_0x31cd3f(null,_0x239cf3);});},'filename':function(_0x115b22,_0x20e27c,_0x226d6a){const _0x51bd70=_0x20e27c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e754d=path['extname'](_0x51bd70);const _0x1a8ea6=Date['now']()+'-'+_0x51bd70[_0x7b50('0x37')](_0x1e754d,'')+_0x1e754d;_0x226d6a(null,_0x1a8ea6);}})});router[_0x7b50('0x1f')](_0x7b50('0x38'),offlineUploadMulter[_0x7b50('0x39')](),controller['offline']);router['post'](_0x7b50('0x19'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x3a')]);router[_0x7b50('0x1f')](_0x7b50('0x3b'),auth['isAuthenticated'](),controller[_0x7b50('0x3c')]);router[_0x7b50('0x1f')](_0x7b50('0x1b'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x3d')]);router[_0x7b50('0x1f')](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller['addAgents']);router[_0x7b50('0x3e')](_0x7b50('0xc'),auth['isAuthenticated'](),controller[_0x7b50('0x3f')]);router[_0x7b50('0x40')]('/:id',auth['isAuthenticated'](),controller[_0x7b50('0x41')]);router['delete']('/:id/dispositions',auth[_0x7b50('0xb')](),controller[_0x7b50('0x42')]);router['delete'](_0x7b50('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x7b50('0x1e'),auth[_0x7b50('0xb')](),controller[_0x7b50('0x43')]);module[_0x7b50('0x44')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 838ecb8..74b74b4 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 _0x80e6=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../config/environment','env','production','get'];(function(_0x116a96,_0xb3cb8c){var _0x57ad04=function(_0x556765){while(--_0x556765){_0x116a96['push'](_0x116a96['shift']());}};_0x57ad04(++_0xb3cb8c);}(_0x80e6,0xb5));var _0x680e=function(_0x2f534f,_0x3a4391){_0x2f534f=_0x2f534f-0x0;var _0x3ac9b8=_0x80e6[_0x2f534f];return _0x3ac9b8;};var beaverLogger=require(_0x680e('0x0'));var express=require(_0x680e('0x1'));var auth=require('../components/auth/service');var config=require(_0x680e('0x2'));var router=express['Router']();var isProduction=config[_0x680e('0x3')]===_0x680e('0x4')||![];function clientSideLogs(_0x47ee7b,_0x7cafb4,_0x36d976){var _0x2f1984=_0x47ee7b['app'][_0x680e('0x5')]('client-side-logger');if(!_0x2f1984){throw new Error(_0x680e('0x6'));}return beaverLogger[_0x680e('0x7')]({'uri':_0x680e('0x8'),'logger':_0x2f1984,'enableCors':!isProduction})(_0x47ee7b,_0x7cafb4,_0x36d976);}router[_0x680e('0x9')](auth[_0x680e('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xc382=['env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','Router'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xc382,0x1ad));var _0x2c38=function(_0x16da8f,_0x4ddb80){_0x16da8f=_0x16da8f-0x0;var _0xd5dca8=_0xc382[_0x16da8f];return _0xd5dca8;};var beaverLogger=require(_0x2c38('0x0'));var express=require(_0x2c38('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x2c38('0x2')]();var isProduction=config[_0x2c38('0x3')]===_0x2c38('0x4')||![];function clientSideLogs(_0x480728,_0x28e9b6,_0x3b9781){var _0x292150=_0x480728[_0x2c38('0x5')][_0x2c38('0x6')]('client-side-logger');if(!_0x292150){throw new Error(_0x2c38('0x7'));}return beaverLogger[_0x2c38('0x8')]({'uri':'/client-logs','logger':_0x292150,'enableCors':!isProduction})(_0x480728,_0x28e9b6,_0x3b9781);}router[_0x2c38('0x9')](auth[_0x2c38('0xa')](),clientSideLogs);module[_0x2c38('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index a2bd237..6b13536 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 _0xffed=['exports','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0xffed,0x1a4));var _0xdffe=function(_0xf20de,_0x297b52){_0xf20de=_0xf20de-0x0;var _0x172295=_0xffed[_0xf20de];return _0x172295;};'use strict';var Sequelize=require('sequelize');module[_0xdffe('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x2'),_0xdffe('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdffe('0x1')](_0xdffe('0x4'),_0xdffe('0x5'))},'data1':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdffe('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdffe('0x6')],'comment':_0xdffe('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':_0xdffe('0x8')},'data6':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xa')},'data7':{'type':Sequelize[_0xdffe('0x9')],'comment':_0xdffe('0xb')}}; \ No newline at end of file +var _0x0dc2=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','Google','MicrosoftAzure'];(function(_0x3bd792,_0x171a3e){var _0x405c0f=function(_0x3c2cae){while(--_0x3c2cae){_0x3bd792['push'](_0x3bd792['shift']());}};_0x405c0f(++_0x171a3e);}(_0x0dc2,0x167));var _0x20dc=function(_0x45c61a,_0x1b9fd4){_0x45c61a=_0x45c61a-0x0;var _0x2b4bd2=_0x0dc2[_0x45c61a];return _0x2b4bd2;};'use strict';var Sequelize=require('sequelize');module[_0x20dc('0x0')]={'name':{'type':Sequelize[_0x20dc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x20dc('0x2')]('AmazonAWS',_0x20dc('0x3'),_0x20dc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x20dc('0x2')](_0x20dc('0x5'),_0x20dc('0x6'))},'data1':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x7')},'data2':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x8')},'data3':{'type':Sequelize[_0x20dc('0x1')],'comment':_0x20dc('0x9')},'data4':{'type':Sequelize[_0x20dc('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0x20dc('0xa')},'data6':{'type':Sequelize[_0x20dc('0xb')],'comment':_0x20dc('0xc')},'data7':{'type':Sequelize[_0x20dc('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index fad38c8..b176b8a 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 _0x2d9c=['from','toString','id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','end','offset','count','limit','status','set','Content-Range','json','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','data3','catch','show','params','keys','filters','includeAll','find','service','MicrosoftAzure','decryptString','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse'];(function(_0x310cfb,_0x10b5ac){var _0x33735a=function(_0x1e1ae4){while(--_0x1e1ae4){_0x310cfb['push'](_0x310cfb['shift']());}};_0x33735a(++_0x10b5ac);}(_0x2d9c,0x1db));var _0xc2d9=function(_0x2d97d1,_0x5cc175){_0x2d97d1=_0x2d97d1-0x0;var _0xb912ef=_0x2d9c[_0x2d97d1];return _0xb912ef;};'use strict';var _=require('lodash');var Redis=require(_0xc2d9('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc2d9('0x1'));var config=require(_0xc2d9('0x2'));var logger=require('../../config/logger')(_0xc2d9('0x3'));var db=require(_0xc2d9('0x4'))['db'];var oauth=require(_0xc2d9('0x5'));config[_0xc2d9('0x6')]=_[_0xc2d9('0x7')](config[_0xc2d9('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2d9('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xc2d9('0x6')]);function respondWithStatusCode(_0x108faa,_0x169f14){_0x169f14=_0x169f14||0xcc;return function(_0x2cc8ad){if(_0x2cc8ad){return _0x108faa[_0xc2d9('0x9')](_0x169f14);}return _0x108faa['status'](_0x169f14)[_0xc2d9('0xa')]();};}function respondWithResult(_0x51354f,_0x37da75){_0x37da75=_0x37da75||0xc8;return function(_0x5ebe70){if(_0x5ebe70){return _0x51354f['status'](_0x37da75)['json'](_0x5ebe70);}};}function respondWithFilteredResult(_0x3d2756,_0x1c0d9c){return function(_0x484d0c){if(_0x484d0c){var _0x35027b=typeof _0x1c0d9c[_0xc2d9('0xb')]==='undefined'&&typeof _0x1c0d9c['limit']==='undefined';var _0x380137=_0x484d0c['count'];var _0x407f57=_0x35027b?0x0:_0x1c0d9c['offset'];var _0x5c1d29=_0x35027b?_0x484d0c[_0xc2d9('0xc')]:_0x1c0d9c[_0xc2d9('0xb')]+_0x1c0d9c[_0xc2d9('0xd')];var _0x52a5d1;if(_0x5c1d29>=_0x380137){_0x5c1d29=_0x380137;_0x52a5d1=0xc8;}else{_0x52a5d1=0xce;}_0x3d2756[_0xc2d9('0xe')](_0x52a5d1);return _0x3d2756[_0xc2d9('0xf')](_0xc2d9('0x10'),_0x407f57+'-'+_0x5c1d29+'/'+_0x380137)[_0xc2d9('0x11')](_0x484d0c);}return null;};}function saveUpdates(_0x1ad084){return function(_0x32d9b7){if(_0x32d9b7){return _0x32d9b7[_0xc2d9('0x12')](_0x1ad084)[_0xc2d9('0x13')](function(_0x80edda){return _0x80edda;});}return null;};}function removeEntity(_0x2bc4a9){return function(_0x88b13d){if(_0x88b13d){return _0x88b13d[_0xc2d9('0x14')]()[_0xc2d9('0x13')](function(){_0x2bc4a9[_0xc2d9('0xe')](0xcc)[_0xc2d9('0xa')]();});}};}function handleEntityNotFound(_0x188d37){return function(_0xebd15b){if(!_0xebd15b){_0x188d37[_0xc2d9('0x9')](0x194);}return _0xebd15b;};}function handleError(_0x14d60b,_0x5b0b85){_0x5b0b85=_0x5b0b85||0x1f4;return function(_0x3d974d){logger[_0xc2d9('0x15')](_0x3d974d['stack']);if(_0x3d974d[_0xc2d9('0x16')]){delete _0x3d974d[_0xc2d9('0x16')];}_0x14d60b[_0xc2d9('0xe')](_0x5b0b85)[_0xc2d9('0x17')](_0x3d974d);};}function maskClientSecret(_0xfba82b){return _[_0xc2d9('0x18')](_0xfba82b[_0xc2d9('0x19')](0x0,0x3),0x14,'*');}exports[_0xc2d9('0x1a')]=function(_0x2db643,_0x110060){var _0x1dff47={},_0x3a20a3={},_0x7876aa={'count':0x0,'rows':[]};var _0x13f678=_[_0xc2d9('0x1b')](db[_0xc2d9('0x1c')][_0xc2d9('0x1d')],function(_0x324ae3){return{'name':_0x324ae3[_0xc2d9('0x1e')],'type':_0x324ae3[_0xc2d9('0x1f')][_0xc2d9('0x20')]};});_0x3a20a3[_0xc2d9('0x21')]=_[_0xc2d9('0x1b')](_0x13f678,_0xc2d9('0x16'));_0x3a20a3[_0xc2d9('0x22')]=_['keys'](_0x2db643[_0xc2d9('0x22')]);_0x3a20a3['filters']=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],_0x3a20a3[_0xc2d9('0x22')]);_0x1dff47[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x3a20a3[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1dff47[_0xc2d9('0x24')]=_0x1dff47[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1dff47[_0xc2d9('0x24')]:_0x3a20a3['model'];if(!_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x27')](_0xc2d9('0x28'))){_0x1dff47[_0xc2d9('0xd')]=qs[_0xc2d9('0xd')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xd')]);_0x1dff47[_0xc2d9('0xb')]=qs[_0xc2d9('0xb')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0xb')]);}_0x1dff47[_0xc2d9('0x29')]=qs[_0xc2d9('0x2a')](_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2a')]);_0x1dff47[_0xc2d9('0x2b')]=qs['filters'](_[_0xc2d9('0x2c')](_0x2db643['query'],_0x3a20a3['filters']),_0x13f678);if(_0x2db643[_0xc2d9('0x22')]['filter']){_0x1dff47[_0xc2d9('0x2b')]=_[_0xc2d9('0x2d')](_0x1dff47[_0xc2d9('0x2b')],{'$or':_[_0xc2d9('0x1b')](_0x13f678,function(_0x7089d5){if(_0x7089d5['type']!==_0xc2d9('0x2e')){var _0x242e07={};_0x242e07[_0x7089d5[_0xc2d9('0x16')]]={'$like':'%'+_0x2db643[_0xc2d9('0x22')][_0xc2d9('0x2f')]+'%'};return _0x242e07;}})});}_0x1dff47=_['merge']({},_0x1dff47,_0x2db643[_0xc2d9('0x30')]);var _0x4e363b={'where':_0x1dff47[_0xc2d9('0x2b')]};return db['CloudProvider']['count'](_0x4e363b)['then'](function(_0x102587){_0x7876aa['count']=_0x102587;if(_0x2db643[_0xc2d9('0x22')]['includeAll']){_0x1dff47['include']=[{'all':!![]}];}return db[_0xc2d9('0x1c')][_0xc2d9('0x31')](_0x1dff47);})[_0xc2d9('0x13')](function(_0x4a6243){_0x7876aa['rows']=_[_0xc2d9('0x1b')](_0x4a6243,function(_0x28f516){if(_0x28f516['service']==='MicrosoftAzure'){var _0x3bf291=encryptor['decryptString'](_0x28f516[_0xc2d9('0x32')]);_0x28f516[_0xc2d9('0x32')]=maskClientSecret(_0x3bf291);}return _0x28f516;});return _0x7876aa;})[_0xc2d9('0x13')](respondWithFilteredResult(_0x110060,_0x1dff47))[_0xc2d9('0x33')](handleError(_0x110060,null));};exports[_0xc2d9('0x34')]=function(_0x4a586c,_0x578303){var _0x1c1bad={'raw':!![],'where':{'id':_0x4a586c[_0xc2d9('0x35')]['id']}},_0x449f4e={};_0x449f4e[_0xc2d9('0x21')]=_[_0xc2d9('0x36')](db[_0xc2d9('0x1c')]['rawAttributes']);_0x449f4e[_0xc2d9('0x22')]=_[_0xc2d9('0x36')](_0x4a586c['query']);_0x449f4e[_0xc2d9('0x37')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],_0x449f4e[_0xc2d9('0x22')]);_0x1c1bad[_0xc2d9('0x24')]=_[_0xc2d9('0x23')](_0x449f4e[_0xc2d9('0x21')],qs[_0xc2d9('0x25')](_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x25')]));_0x1c1bad['attributes']=_0x1c1bad[_0xc2d9('0x24')][_0xc2d9('0x26')]?_0x1c1bad[_0xc2d9('0x24')]:_0x449f4e[_0xc2d9('0x21')];if(_0x4a586c[_0xc2d9('0x22')][_0xc2d9('0x38')]){_0x1c1bad['include']=[{'all':!![]}];}_0x1c1bad=_[_0xc2d9('0x2d')]({},_0x1c1bad,_0x4a586c[_0xc2d9('0x30')]);return db[_0xc2d9('0x1c')][_0xc2d9('0x39')](_0x1c1bad)[_0xc2d9('0x13')](handleEntityNotFound(_0x578303,null))[_0xc2d9('0x13')](function(_0x321e35){if(_0x321e35[_0xc2d9('0x3a')]===_0xc2d9('0x3b')){var _0x3a5a2a=encryptor[_0xc2d9('0x3c')](_0x321e35['data3']);_0x321e35['data3']=maskClientSecret(_0x3a5a2a);}return _0x321e35;})[_0xc2d9('0x13')](respondWithResult(_0x578303,null))['catch'](handleError(_0x578303,null));};exports[_0xc2d9('0x3d')]=function(_0x10e3ab,_0x1aa50a){if(!_0x10e3ab['body'][_0xc2d9('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x3a')])throw new Error(_0xc2d9('0x3f'));var _0xe35171=db[_0xc2d9('0x1c')][_0xc2d9('0x1d')][_0xc2d9('0x3a')][_0xc2d9('0x40')];if(!_0xe35171[_0xc2d9('0x41')](_0x10e3ab['body'][_0xc2d9('0x3a')]))throw new Error(_0xc2d9('0x42')+_0xe35171[_0xc2d9('0x43')](',\x20'));if(_0x10e3ab[_0xc2d9('0x3e')]['service']===_0xc2d9('0x3b')&&_0x10e3ab[_0xc2d9('0x3e')]['data3']){_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x10e3ab[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return db['CloudProvider'][_0xc2d9('0x3d')](_0x10e3ab[_0xc2d9('0x3e')],{})[_0xc2d9('0x13')](respondWithResult(_0x1aa50a,0xc9))[_0xc2d9('0x33')](handleError(_0x1aa50a,null));};exports[_0xc2d9('0x12')]=function(_0x1c9a02,_0x999125){if(_0x1c9a02['body']['id']){delete _0x1c9a02[_0xc2d9('0x3e')]['id'];}return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x1c9a02['params']['id']}})[_0xc2d9('0x13')](handleEntityNotFound(_0x999125,null))['then'](function(_0x3d611e){if(_0x3d611e[_0xc2d9('0x3a')]===_0xc2d9('0x3b')&&_0x1c9a02['body'][_0xc2d9('0x32')]){_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]=encryptor[_0xc2d9('0x44')](_0x1c9a02[_0xc2d9('0x3e')][_0xc2d9('0x32')]);}return _0x3d611e;})[_0xc2d9('0x13')](saveUpdates(_0x1c9a02['body'],null))[_0xc2d9('0x13')](respondWithResult(_0x999125,null))[_0xc2d9('0x33')](handleError(_0x999125,null));};exports[_0xc2d9('0x14')]=function(_0x206055,_0x1bb2ab){return db[_0xc2d9('0x1c')][_0xc2d9('0x39')]({'where':{'id':_0x206055[_0xc2d9('0x35')]['id']}})['then'](handleEntityNotFound(_0x1bb2ab,null))['then'](removeEntity(_0x1bb2ab,null))['catch'](handleError(_0x1bb2ab,null));};exports[_0xc2d9('0x45')]=function(_0x155eb2,_0x5695d4){return db[_0xc2d9('0x1c')][_0xc2d9('0x46')]({'where':{'id':_0x155eb2['params']['id']},'raw':!![]})[_0xc2d9('0x13')](function(_0x3d361f){if(!_0x3d361f)return _0x5695d4[_0xc2d9('0x9')](0x194);return{'url':oauth[_0xc2d9('0x47')](_0x3d361f,_0x155eb2[_0xc2d9('0x48')]['id'])};})[_0xc2d9('0x13')](respondWithResult(_0x5695d4,null))[_0xc2d9('0x33')](handleError(_0x5695d4,null));};exports['oauth2MicrosoftCallback']=function(_0x36723e,_0x15b328){var _0x35bcf2=_0x36723e[_0xc2d9('0x3e')];var _0x28e773;var _0xe4a535;if(_0x35bcf2[_0xc2d9('0x15')])throw _0x35bcf2;redis[_0xc2d9('0x49')](_0x35bcf2[_0xc2d9('0x4a')])[_0xc2d9('0x13')](function(_0x37997f){if(!_0x37997f)throw new Error(_0xc2d9('0x4b'));_0x28e773=JSON[_0xc2d9('0x4c')](_0x37997f);var _0x1b5338=Buffer[_0xc2d9('0x4d')](_0x35bcf2['state'],'base64')[_0xc2d9('0x4e')]('ascii');_0xe4a535=JSON[_0xc2d9('0x4c')](_0x1b5338);if(!oauth['isValidIdToken'](_0x35bcf2[_0xc2d9('0x4f')],_0x28e773['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x35bcf2['state']);return oauth[_0xc2d9('0x50')](_0x35bcf2['code'],_0x28e773);})['then'](function(_0x3111a0){_0x28e773[_0xc2d9('0x51')]=_0x3111a0[_0xc2d9('0x52')];_0x28e773[_0xc2d9('0x53')]=_0x3111a0['refresh_token'];return db[_0xc2d9('0x1c')][_0xc2d9('0x12')]({'data5':_0x28e773[_0xc2d9('0x51')],'data6':_0x28e773['data6']},{'where':{'id':_0x28e773['id']}});})[_0xc2d9('0x13')](function(){oauth[_0xc2d9('0x54')](_0x28e773);socket[_0xc2d9('0x55')](_0xc2d9('0x56'),{'id':_0xe4a535['id']});return;})['then'](respondWithStatusCode(_0x15b328,null))['catch'](function(_0x58181e){if(_0xe4a535){socket[_0xc2d9('0x55')](_0xc2d9('0x57'),{'id':_0xe4a535['id']});}if(!_0x28e773){logger[_0xc2d9('0x15')](_0xc2d9('0x58'),_0x58181e);return _0x15b328[_0xc2d9('0xe')](0x1f4)[_0xc2d9('0x17')](_0x58181e[_0xc2d9('0x59')]);}logger['error'](_0xc2d9('0x5a'),_0x28e773['id'],JSON[_0xc2d9('0x5b')](_0x58181e));});}; \ No newline at end of file +var _0x1c5a=['data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','set','update','destroy','then','end','sendStatus','error','stack','name','send','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','catch','show','rawAttributes','length','find','service','data3','create','body','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token'];(function(_0xf3e4a0,_0x16a172){var _0x43f1cc=function(_0x3abdf5){while(--_0x3abdf5){_0xf3e4a0['push'](_0xf3e4a0['shift']());}};_0x43f1cc(++_0x16a172);}(_0x1c5a,0xc7));var _0xa1c5=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x1c5a[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xa1c5('0x0'));var Redis=require(_0xa1c5('0x1'));var qs=require(_0xa1c5('0x2'));var encryptor=require(_0xa1c5('0x3'));var config=require(_0xa1c5('0x4'));var logger=require('../../config/logger')(_0xa1c5('0x5'));var db=require(_0xa1c5('0x6'))['db'];var oauth=require(_0xa1c5('0x7'));config[_0xa1c5('0x8')]=_[_0xa1c5('0x9')](config[_0xa1c5('0x8')],{'host':_0xa1c5('0xa'),'port':0x18eb});var socket=require(_0xa1c5('0xb'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5c3be3,_0x108d71){_0x108d71=_0x108d71||0xcc;return function(_0x3d4bf4){if(_0x3d4bf4){return _0x5c3be3['sendStatus'](_0x108d71);}return _0x5c3be3[_0xa1c5('0xc')](_0x108d71)['end']();};}function respondWithResult(_0x555906,_0x57691b){_0x57691b=_0x57691b||0xc8;return function(_0x4ce488){if(_0x4ce488){return _0x555906['status'](_0x57691b)[_0xa1c5('0xd')](_0x4ce488);}};}function respondWithFilteredResult(_0x35d25a,_0x1523b6){return function(_0x111683){if(_0x111683){var _0x102d8b=typeof _0x1523b6[_0xa1c5('0xe')]==='undefined'&&typeof _0x1523b6[_0xa1c5('0xf')]===_0xa1c5('0x10');var _0x395b63=_0x111683[_0xa1c5('0x11')];var _0x436cd3=_0x102d8b?0x0:_0x1523b6[_0xa1c5('0xe')];var _0x3a639c=_0x102d8b?_0x111683[_0xa1c5('0x11')]:_0x1523b6[_0xa1c5('0xe')]+_0x1523b6[_0xa1c5('0xf')];var _0xa34a5e;if(_0x3a639c>=_0x395b63){_0x3a639c=_0x395b63;_0xa34a5e=0xc8;}else{_0xa34a5e=0xce;}_0x35d25a[_0xa1c5('0xc')](_0xa34a5e);return _0x35d25a[_0xa1c5('0x12')]('Content-Range',_0x436cd3+'-'+_0x3a639c+'/'+_0x395b63)[_0xa1c5('0xd')](_0x111683);}return null;};}function saveUpdates(_0x415554){return function(_0x13c4a9){if(_0x13c4a9){return _0x13c4a9[_0xa1c5('0x13')](_0x415554)['then'](function(_0x67ffb3){return _0x67ffb3;});}return null;};}function removeEntity(_0x31f54d){return function(_0x280ece){if(_0x280ece){return _0x280ece[_0xa1c5('0x14')]()[_0xa1c5('0x15')](function(){_0x31f54d[_0xa1c5('0xc')](0xcc)[_0xa1c5('0x16')]();});}};}function handleEntityNotFound(_0x1e1528){return function(_0x49f199){if(!_0x49f199){_0x1e1528[_0xa1c5('0x17')](0x194);}return _0x49f199;};}function handleError(_0x2bd23c,_0x269a2d){_0x269a2d=_0x269a2d||0x1f4;return function(_0x3068fd){logger[_0xa1c5('0x18')](_0x3068fd[_0xa1c5('0x19')]);if(_0x3068fd['name']){delete _0x3068fd[_0xa1c5('0x1a')];}_0x2bd23c[_0xa1c5('0xc')](_0x269a2d)[_0xa1c5('0x1b')](_0x3068fd);};}function maskClientSecret(_0xa8c14c){return _['padEnd'](_0xa8c14c[_0xa1c5('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x25a57a,_0x1435d7){var _0x41c9d4={},_0x44bf8e={},_0x262549={'count':0x0,'rows':[]};var _0x3d06c8=_[_0xa1c5('0x1d')](db[_0xa1c5('0x1e')]['rawAttributes'],function(_0x48faef){return{'name':_0x48faef[_0xa1c5('0x1f')],'type':_0x48faef[_0xa1c5('0x20')][_0xa1c5('0x21')]};});_0x44bf8e[_0xa1c5('0x22')]=_[_0xa1c5('0x1d')](_0x3d06c8,_0xa1c5('0x1a'));_0x44bf8e['query']=_[_0xa1c5('0x23')](_0x25a57a[_0xa1c5('0x24')]);_0x44bf8e[_0xa1c5('0x25')]=_[_0xa1c5('0x26')](_0x44bf8e[_0xa1c5('0x22')],_0x44bf8e[_0xa1c5('0x24')]);_0x41c9d4[_0xa1c5('0x27')]=_[_0xa1c5('0x26')](_0x44bf8e[_0xa1c5('0x22')],qs[_0xa1c5('0x28')](_0x25a57a['query']['fields']));_0x41c9d4[_0xa1c5('0x27')]=_0x41c9d4['attributes']['length']?_0x41c9d4[_0xa1c5('0x27')]:_0x44bf8e[_0xa1c5('0x22')];if(!_0x25a57a[_0xa1c5('0x24')]['hasOwnProperty'](_0xa1c5('0x29'))){_0x41c9d4[_0xa1c5('0xf')]=qs[_0xa1c5('0xf')](_0x25a57a['query'][_0xa1c5('0xf')]);_0x41c9d4[_0xa1c5('0xe')]=qs[_0xa1c5('0xe')](_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0xe')]);}_0x41c9d4[_0xa1c5('0x2a')]=qs[_0xa1c5('0x2b')](_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0x2b')]);_0x41c9d4[_0xa1c5('0x2c')]=qs[_0xa1c5('0x25')](_[_0xa1c5('0x2d')](_0x25a57a['query'],_0x44bf8e['filters']),_0x3d06c8);if(_0x25a57a['query'][_0xa1c5('0x2e')]){_0x41c9d4[_0xa1c5('0x2c')]=_[_0xa1c5('0x2f')](_0x41c9d4[_0xa1c5('0x2c')],{'$or':_['map'](_0x3d06c8,function(_0x2b8ec0){if(_0x2b8ec0[_0xa1c5('0x20')]!==_0xa1c5('0x30')){var _0xf59b58={};_0xf59b58[_0x2b8ec0[_0xa1c5('0x1a')]]={'$like':'%'+_0x25a57a['query']['filter']+'%'};return _0xf59b58;}})});}_0x41c9d4=_['merge']({},_0x41c9d4,_0x25a57a[_0xa1c5('0x31')]);var _0x569fe4={'where':_0x41c9d4[_0xa1c5('0x2c')]};return db[_0xa1c5('0x1e')][_0xa1c5('0x11')](_0x569fe4)[_0xa1c5('0x15')](function(_0x18f65a){_0x262549['count']=_0x18f65a;if(_0x25a57a[_0xa1c5('0x24')][_0xa1c5('0x32')]){_0x41c9d4[_0xa1c5('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0xa1c5('0x34')](_0x41c9d4);})[_0xa1c5('0x15')](function(_0x5ab8fb){_0x262549[_0xa1c5('0x35')]=_[_0xa1c5('0x1d')](_0x5ab8fb,function(_0x133974){if(_0x133974['service']===_0xa1c5('0x36')){var _0x4b3fae=encryptor[_0xa1c5('0x37')](_0x133974['data3']);_0x133974['data3']=maskClientSecret(_0x4b3fae);}return _0x133974;});return _0x262549;})[_0xa1c5('0x15')](respondWithFilteredResult(_0x1435d7,_0x41c9d4))[_0xa1c5('0x38')](handleError(_0x1435d7,null));};exports[_0xa1c5('0x39')]=function(_0x29a245,_0x2e1632){var _0x4f1b18={'raw':!![],'where':{'id':_0x29a245['params']['id']}},_0x254ee5={};_0x254ee5[_0xa1c5('0x22')]=_['keys'](db['CloudProvider'][_0xa1c5('0x3a')]);_0x254ee5[_0xa1c5('0x24')]=_[_0xa1c5('0x23')](_0x29a245['query']);_0x254ee5[_0xa1c5('0x25')]=_[_0xa1c5('0x26')](_0x254ee5[_0xa1c5('0x22')],_0x254ee5[_0xa1c5('0x24')]);_0x4f1b18[_0xa1c5('0x27')]=_[_0xa1c5('0x26')](_0x254ee5[_0xa1c5('0x22')],qs[_0xa1c5('0x28')](_0x29a245[_0xa1c5('0x24')][_0xa1c5('0x28')]));_0x4f1b18[_0xa1c5('0x27')]=_0x4f1b18[_0xa1c5('0x27')][_0xa1c5('0x3b')]?_0x4f1b18[_0xa1c5('0x27')]:_0x254ee5[_0xa1c5('0x22')];if(_0x29a245[_0xa1c5('0x24')][_0xa1c5('0x32')]){_0x4f1b18['include']=[{'all':!![]}];}_0x4f1b18=_[_0xa1c5('0x2f')]({},_0x4f1b18,_0x29a245[_0xa1c5('0x31')]);return db['CloudProvider'][_0xa1c5('0x3c')](_0x4f1b18)[_0xa1c5('0x15')](handleEntityNotFound(_0x2e1632,null))[_0xa1c5('0x15')](function(_0x2ae69c){if(_0x2ae69c[_0xa1c5('0x3d')]===_0xa1c5('0x36')){var _0x50eee8=encryptor[_0xa1c5('0x37')](_0x2ae69c[_0xa1c5('0x3e')]);_0x2ae69c[_0xa1c5('0x3e')]=maskClientSecret(_0x50eee8);}return _0x2ae69c;})[_0xa1c5('0x15')](respondWithResult(_0x2e1632,null))[_0xa1c5('0x38')](handleError(_0x2e1632,null));};exports[_0xa1c5('0x3f')]=function(_0x5c9b0b,_0x370a4b){if(!_0x5c9b0b['body'][_0xa1c5('0x1a')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3d')])throw new Error(_0xa1c5('0x41'));var _0x192090=db[_0xa1c5('0x1e')]['rawAttributes'][_0xa1c5('0x3d')]['values'];if(!_0x192090['includes'](_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3d')]))throw new Error(_0xa1c5('0x42')+_0x192090[_0xa1c5('0x43')](',\x20'));if(_0x5c9b0b['body'][_0xa1c5('0x3d')]===_0xa1c5('0x36')&&_0x5c9b0b[_0xa1c5('0x40')][_0xa1c5('0x3e')]){_0x5c9b0b['body'][_0xa1c5('0x3e')]=encryptor[_0xa1c5('0x44')](_0x5c9b0b[_0xa1c5('0x40')]['data3']);}return db[_0xa1c5('0x1e')]['create'](_0x5c9b0b[_0xa1c5('0x40')],{})[_0xa1c5('0x15')](respondWithResult(_0x370a4b,0xc9))[_0xa1c5('0x38')](handleError(_0x370a4b,null));};exports[_0xa1c5('0x13')]=function(_0x39a062,_0xa1eb1){if(_0x39a062[_0xa1c5('0x40')]['id']){delete _0x39a062[_0xa1c5('0x40')]['id'];}return db[_0xa1c5('0x1e')][_0xa1c5('0x3c')]({'where':{'id':_0x39a062['params']['id']}})['then'](handleEntityNotFound(_0xa1eb1,null))[_0xa1c5('0x15')](function(_0x2b15aa){if(_0x2b15aa[_0xa1c5('0x3d')]===_0xa1c5('0x36')&&_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]){_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]=encryptor[_0xa1c5('0x44')](_0x39a062[_0xa1c5('0x40')][_0xa1c5('0x3e')]);}return _0x2b15aa;})[_0xa1c5('0x15')](saveUpdates(_0x39a062[_0xa1c5('0x40')],null))[_0xa1c5('0x15')](respondWithResult(_0xa1eb1,null))[_0xa1c5('0x38')](handleError(_0xa1eb1,null));};exports[_0xa1c5('0x14')]=function(_0x592909,_0x1a93be){return db[_0xa1c5('0x1e')]['find']({'where':{'id':_0x592909['params']['id']}})[_0xa1c5('0x15')](handleEntityNotFound(_0x1a93be,null))[_0xa1c5('0x15')](removeEntity(_0x1a93be,null))[_0xa1c5('0x38')](handleError(_0x1a93be,null));};exports[_0xa1c5('0x45')]=function(_0x567546,_0x840112){return db[_0xa1c5('0x1e')][_0xa1c5('0x46')]({'where':{'id':_0x567546['params']['id']},'raw':!![]})['then'](function(_0x362aa4){if(!_0x362aa4)return _0x840112[_0xa1c5('0x17')](0x194);return{'url':oauth[_0xa1c5('0x47')](_0x362aa4,_0x567546['user']['id'])};})['then'](respondWithResult(_0x840112,null))['catch'](handleError(_0x840112,null));};exports[_0xa1c5('0x48')]=function(_0x527015,_0x36dbdc){var _0x36e39a=_0x527015['body'];var _0x18dd47;var _0x2a54fb;if(_0x36e39a[_0xa1c5('0x18')])throw _0x36e39a;redis[_0xa1c5('0x49')](_0x36e39a[_0xa1c5('0x4a')])['then'](function(_0x6a4eab){if(!_0x6a4eab)throw new Error(_0xa1c5('0x4b'));_0x18dd47=JSON[_0xa1c5('0x4c')](_0x6a4eab);var _0x2aa4b7=Buffer['from'](_0x36e39a['state'],_0xa1c5('0x4d'))['toString']('ascii');_0x2a54fb=JSON['parse'](_0x2aa4b7);if(!oauth['isValidIdToken'](_0x36e39a['id_token'],_0x18dd47[_0xa1c5('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xa1c5('0x4f')](_0x36e39a['state']);return oauth[_0xa1c5('0x50')](_0x36e39a[_0xa1c5('0x51')],_0x18dd47);})[_0xa1c5('0x15')](function(_0xa42eb9){_0x18dd47['data5']=_0xa42eb9[_0xa1c5('0x52')];_0x18dd47[_0xa1c5('0x53')]=_0xa42eb9[_0xa1c5('0x54')];return db[_0xa1c5('0x1e')][_0xa1c5('0x13')]({'data5':_0x18dd47[_0xa1c5('0x55')],'data6':_0x18dd47[_0xa1c5('0x53')]},{'where':{'id':_0x18dd47['id']}});})[_0xa1c5('0x15')](function(){oauth[_0xa1c5('0x56')](_0x18dd47);socket[_0xa1c5('0x57')](_0xa1c5('0x58'),{'id':_0x2a54fb['id']});return;})[_0xa1c5('0x15')](respondWithStatusCode(_0x36dbdc,null))['catch'](function(_0x5ce9a0){if(_0x2a54fb){socket[_0xa1c5('0x57')](_0xa1c5('0x59'),{'id':_0x2a54fb['id']});}if(!_0x18dd47){logger['error'](_0xa1c5('0x5a'),_0x5ce9a0);return _0x36dbdc[_0xa1c5('0xc')](0x1f4)['send'](_0x5ce9a0[_0xa1c5('0x5b')]);}logger[_0xa1c5('0x18')](_0xa1c5('0x5c'),_0x18dd47['id'],JSON[_0xa1c5('0x5d')](_0x5ce9a0));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index bb8e51d..b94ee99 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 _0xf920=['cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x59117e,_0x444da3){var _0x59cf49=function(_0x53f9ba){while(--_0x53f9ba){_0x59117e['push'](_0x59117e['shift']());}};_0x59cf49(++_0x444da3);}(_0xf920,0x1b9));var _0x0f92=function(_0x4c1ad8,_0x55e28d){_0x4c1ad8=_0x4c1ad8-0x0;var _0x2c617b=_0xf920[_0x4c1ad8];return _0x2c617b;};'use strict';var _=require(_0x0f92('0x0'));var util=require(_0x0f92('0x1'));var logger=require(_0x0f92('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f92('0x3'));var rp=require(_0x0f92('0x4'));var fs=require('fs');var path=require(_0x0f92('0x5'));var rimraf=require(_0x0f92('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f92('0x7'));module[_0x0f92('0x8')]=function(_0x4d50e0,_0x58570a){return _0x4d50e0['define'](_0x0f92('0x9'),attributes,{'tableName':_0x0f92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc81=['bluebird','request-promise','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment'];(function(_0x29140f,_0x5a52ea){var _0x5f5428=function(_0x1c63cb){while(--_0x1c63cb){_0x29140f['push'](_0x29140f['shift']());}};_0x5f5428(++_0x5a52ea);}(_0xfc81,0x1e7));var _0x1fc8=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0xfc81[_0x5eca50];return _0x41fb84;};'use strict';var _=require(_0x1fc8('0x0'));var util=require(_0x1fc8('0x1'));var logger=require(_0x1fc8('0x2'))(_0x1fc8('0x3'));var moment=require(_0x1fc8('0x4'));var BPromise=require(_0x1fc8('0x5'));var rp=require(_0x1fc8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fc8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1fc8('0x8'));module[_0x1fc8('0x9')]=function(_0x4d63d2,_0x42cfc4){return _0x4d63d2[_0x1fc8('0xa')](_0x1fc8('0xb'),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 dcdac19..cada408 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 _0x028d=['../../components/encryptor','../../config/logger','../../mysqldb','defaults','localhost','redis','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','type','Dynamics365','push','data7','/.default','join','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','code','from','stringify','toString','base64','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','map','value','oauth2/','set','iss','issuer','aud','audience','exp','then','data3','CloudProvider','refresh_token','data6','decryptString','POST','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util'];(function(_0x4525fc,_0x1ef6d7){var _0x2be4de=function(_0x5b0757){while(--_0x5b0757){_0x4525fc['push'](_0x4525fc['shift']());}};_0x2be4de(++_0x1ef6d7);}(_0x028d,0x1b6));var _0xd028=function(_0x3d9390,_0x4e6d7b){_0x3d9390=_0x3d9390-0x0;var _0x4e4cb4=_0x028d[_0x3d9390];return _0x4e4cb4;};'use strict';var _=require('lodash');var crypto=require(_0xd028('0x0'));var jwt=require(_0xd028('0x1'));var moment=require(_0xd028('0x2'));var Redis=require(_0xd028('0x3'));var rp=require(_0xd028('0x4'));var util=require(_0xd028('0x5'));var encryptor=require(_0xd028('0x6'));var config=require('../../config/environment');var logger=require(_0xd028('0x7'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd028('0x8'))['db'];config['redis']=_[_0xd028('0x9')](config['redis'],{'host':_0xd028('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd028('0xb')]);var MICROSOFT_AUTH_URL=_0xd028('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd028('0xd'),_0xd028('0xe'),_0xd028('0xf'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xd028('0x10'),_0xd028('0x11')],'Dynamics365':[_0xd028('0xd'),_0xd028('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xd028('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xd028('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2283b3){var _0x5cfb34=_['map'](AZURE_AUTH_SCOPES[_0x2283b3['type']]);if(_0x2283b3[_0xd028('0x15')]===_0xd028('0x16'))_0x5cfb34[_0xd028('0x17')](_0x2283b3[_0xd028('0x18')]+_0xd028('0x19'));return _0x5cfb34[_0xd028('0x1a')]('\x20');}function getAccessTokenScope(_0x27fbd2){if(_0x27fbd2[_0xd028('0x15')]==='Outlook365')return _0xd028('0x1b');if(_0x27fbd2['type']===_0xd028('0x16'))return _0x27fbd2[_0xd028('0x18')]+_0xd028('0x19');}function generateMicrosoftAuthorizationUrl(_0x3fd50e,_0x4ad8c3){var _0x5e831e=MICROSOFT_AUTH_URL[_0xd028('0x1c')](_0xd028('0x1d'),_0x3fd50e['data2']);var _0x20d1c7=[_0xd028('0x1e'),'id_token'];var _0x2d9648=Buffer[_0xd028('0x1f')](JSON[_0xd028('0x20')]({'id':_0x4ad8c3}))[_0xd028('0x21')](_0xd028('0x22'));var _0x529455=crypto['randomBytes'](0x10)['toString']('hex');var _0x4405f3=getAuthorizationScopes(_0x3fd50e);var _0x4e6b1=[{'key':_0xd028('0x23'),'value':_0x3fd50e[_0xd028('0x24')]},{'key':_0xd028('0x25'),'value':encodeURIComponent(_0x20d1c7[_0xd028('0x1a')]('\x20'))},{'key':_0xd028('0x26'),'value':_0x3fd50e[_0xd028('0x27')]},{'key':_0xd028('0x28'),'value':'form_post'},{'key':_0xd028('0x29'),'value':encodeURIComponent(_0x4405f3)},{'key':_0xd028('0x2a'),'value':_0x2d9648},{'key':_0xd028('0x2b'),'value':_0x529455},{'key':_0xd028('0x2c'),'value':'login'}];var _0x90e917=_0x5e831e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd028('0x2d')](_0x4e6b1,function(_0x1845c3){return _0x1845c3['key']+'='+_0x1845c3[_0xd028('0x2e')];})[_0xd028('0x1a')]('&');_0x3fd50e['oauth2Claims']={'issuer':_0x5e831e[_0xd028('0x1c')](_0xd028('0x2f'),''),'audience':_0x3fd50e[_0xd028('0x24')],'state':_0x2d9648,'nonce':_0x529455};redis[_0xd028('0x30')](_0x2d9648,JSON[_0xd028('0x20')](_0x3fd50e));return _0x90e917;}function isValidIdToken(_0xa6ddd0,_0x210454){try{var _0x24b44f=jwt['decode'](_0xa6ddd0,{'complete':!![]});var _0x3aa511=_0x24b44f['payload'];if(_0x3aa511[_0xd028('0x31')]!==_0x210454[_0xd028('0x32')])return![];if(_0x3aa511[_0xd028('0x33')]!==_0x210454[_0xd028('0x34')])return![];if(_0x3aa511['nonce']!==_0x210454[_0xd028('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x3aa511[_0xd028('0x35')])))return![];return!![];}catch(_0x2504d5){throw _0x2504d5;}}function refreshOauth2MicrosoftAccessToken(_0x47c9a6){return Promise['resolve']()[_0xd028('0x36')](function(){if(_0x47c9a6[_0xd028('0x37')])return _0x47c9a6;return db[_0xd028('0x38')]['findOne']({'where':{'id':_0x47c9a6['id']},'raw':!![]});})[_0xd028('0x36')](function(_0xa09c4e){var _0x55c3ef={'grant_type':_0xd028('0x39'),'refresh_token':_0xa09c4e[_0xd028('0x3a')],'scope':getAccessTokenScope(_0xa09c4e),'redirect_uri':_0xa09c4e[_0xd028('0x27')],'client_id':_0xa09c4e[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0xa09c4e[_0xd028('0x37')])};var _0xdc9589={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd028('0x1d'),_0xa09c4e[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55c3ef,'json':!![]};return rp(_0xdc9589);})[_0xd028('0x36')](function(_0xa17273){_0x47c9a6[_0xd028('0x3e')]=_0xa17273[_0xd028('0x3f')];_0x47c9a6[_0xd028('0x3a')]=_0xa17273[_0xd028('0x39')];return db[_0xd028('0x38')][_0xd028('0x40')]({'data5':_0x47c9a6[_0xd028('0x3e')],'data6':_0x47c9a6['data6']},{'where':{'id':_0x47c9a6['id']}});})[_0xd028('0x36')](function(){return _0x47c9a6;})[_0xd028('0x41')](function(_0x325adc){logger[_0xd028('0x42')](_0xd028('0x43'),_0x47c9a6['id'],_0x325adc);});}function getOauth2MicrosoftAccessToken(_0x5bc529,_0x35bf33){var _0x192138={'grant_type':_0xd028('0x44'),'code':_0x5bc529,'scope':getAccessTokenScope(_0x35bf33),'redirect_uri':_0x35bf33[_0xd028('0x27')],'client_id':_0x35bf33[_0xd028('0x24')],'client_secret':encryptor[_0xd028('0x3b')](_0x35bf33[_0xd028('0x37')])};var _0x3ebd9a={'method':_0xd028('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd028('0x1c')]('{TENANT_ID}',_0x35bf33[_0xd028('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x192138,'json':!![]};return rp(_0x3ebd9a);}function startRefreshInterval(_0x5638f1){var _0x3404a8=schedule[_0xd028('0x45')];if(_0x3404a8[_0x5638f1['id']])clearInterval(_0x3404a8[_0x5638f1['id']]);_0x3404a8[_0x5638f1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5638f1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3404a8;}function startAllRefreshIntervals(){return db[_0xd028('0x38')][_0xd028('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd028('0x36')](function(_0x54742){var _0x44e220=_0x54742[_0xd028('0x2d')](function(_0x1365d4){return refreshOauth2MicrosoftAccessToken(_0x1365d4)[_0xd028('0x36')](function(_0x15c1cd){startRefreshInterval(_0x15c1cd);});});return Promise['all'](_0x44e220);})[_0xd028('0x41')](function(_0x5f0ea8){var _0x151a73=_0x5f0ea8?util[_0xd028('0x47')](_0x5f0ea8,{'showHidden':![],'depth':null}):'';logger[_0xd028('0x42')](_0xd028('0x48'),_0x151a73);});}module[_0xd028('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1a83=['stringify','toString','randomBytes','hex','client_id','data1','response_type','join','redirect_uri','data4','state','nonce','prompt','oauth2/','set','decode','payload','iss','issuer','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data2','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','from'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1a83,0x1de));var _0x31a8=function(_0x542869,_0x5ec5e5){_0x542869=_0x542869-0x0;var _0x1fd6d3=_0x1a83[_0x542869];return _0x1fd6d3;};'use strict';var _=require('lodash');var crypto=require(_0x31a8('0x0'));var jwt=require(_0x31a8('0x1'));var moment=require(_0x31a8('0x2'));var Redis=require('ioredis');var rp=require(_0x31a8('0x3'));var util=require('util');var encryptor=require(_0x31a8('0x4'));var config=require(_0x31a8('0x5'));var logger=require(_0x31a8('0x6'))(_0x31a8('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x31a8('0x8'))['db'];config['redis']=_['defaults'](config[_0x31a8('0x9')],{'host':_0x31a8('0xa'),'port':0x18eb});var redis=new Redis(config[_0x31a8('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile','email',_0x31a8('0xb'),_0x31a8('0xc'),_0x31a8('0xd'),_0x31a8('0xe')],'Dynamics365':[_0x31a8('0xf'),_0x31a8('0xb')]};var MICROSOFT_AUTH_ENDPOINT=_0x31a8('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x302e32){var _0x105ce8=_[_0x31a8('0x11')](AZURE_AUTH_SCOPES[_0x302e32['type']]);if(_0x302e32[_0x31a8('0x12')]===_0x31a8('0x13'))_0x105ce8[_0x31a8('0x14')](_0x302e32[_0x31a8('0x15')]+_0x31a8('0x16'));return _0x105ce8['join']('\x20');}function getAccessTokenScope(_0x20017c){if(_0x20017c[_0x31a8('0x12')]===_0x31a8('0x17'))return _0x31a8('0xc');if(_0x20017c[_0x31a8('0x12')]===_0x31a8('0x13'))return _0x20017c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x30a566,_0x2504be){var _0x2fe1d2=MICROSOFT_AUTH_URL[_0x31a8('0x18')]('{TENANT_ID}',_0x30a566['data2']);var _0x23ede3=['code','id_token'];var _0x4d7160=Buffer[_0x31a8('0x19')](JSON[_0x31a8('0x1a')]({'id':_0x2504be}))[_0x31a8('0x1b')]('base64');var _0x2d8ec1=crypto[_0x31a8('0x1c')](0x10)[_0x31a8('0x1b')](_0x31a8('0x1d'));var _0x45fdb2=getAuthorizationScopes(_0x30a566);var _0x107ad3=[{'key':_0x31a8('0x1e'),'value':_0x30a566[_0x31a8('0x1f')]},{'key':_0x31a8('0x20'),'value':encodeURIComponent(_0x23ede3[_0x31a8('0x21')]('\x20'))},{'key':_0x31a8('0x22'),'value':_0x30a566[_0x31a8('0x23')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x45fdb2)},{'key':_0x31a8('0x24'),'value':_0x4d7160},{'key':_0x31a8('0x25'),'value':_0x2d8ec1},{'key':_0x31a8('0x26'),'value':'login'}];var _0x46d640=_0x2fe1d2+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x107ad3,function(_0x1af06a){return _0x1af06a['key']+'='+_0x1af06a['value'];})[_0x31a8('0x21')]('&');_0x30a566['oauth2Claims']={'issuer':_0x2fe1d2[_0x31a8('0x18')](_0x31a8('0x27'),''),'audience':_0x30a566['data1'],'state':_0x4d7160,'nonce':_0x2d8ec1};redis[_0x31a8('0x28')](_0x4d7160,JSON[_0x31a8('0x1a')](_0x30a566));return _0x46d640;}function isValidIdToken(_0xfb08fb,_0x4f87aa){try{var _0x20eba=jwt[_0x31a8('0x29')](_0xfb08fb,{'complete':!![]});var _0x5d8f86=_0x20eba[_0x31a8('0x2a')];if(_0x5d8f86[_0x31a8('0x2b')]!==_0x4f87aa[_0x31a8('0x2c')])return![];if(_0x5d8f86['aud']!==_0x4f87aa[_0x31a8('0x2d')])return![];if(_0x5d8f86[_0x31a8('0x25')]!==_0x4f87aa[_0x31a8('0x25')])return![];if(moment()[_0x31a8('0x2e')](moment[_0x31a8('0x2f')](_0x5d8f86[_0x31a8('0x30')])))return![];return!![];}catch(_0x55e65e){throw _0x55e65e;}}function refreshOauth2MicrosoftAccessToken(_0x2ce133){return Promise['resolve']()[_0x31a8('0x31')](function(){if(_0x2ce133[_0x31a8('0x32')])return _0x2ce133;return db[_0x31a8('0x33')][_0x31a8('0x34')]({'where':{'id':_0x2ce133['id']},'raw':!![]});})[_0x31a8('0x31')](function(_0x5d504d){var _0xf09bdd={'grant_type':_0x31a8('0x35'),'refresh_token':_0x5d504d['data6'],'scope':getAccessTokenScope(_0x5d504d),'redirect_uri':_0x5d504d[_0x31a8('0x23')],'client_id':_0x5d504d[_0x31a8('0x1f')],'client_secret':encryptor[_0x31a8('0x36')](_0x5d504d[_0x31a8('0x32')])};var _0x1dcf86={'method':_0x31a8('0x37'),'uri':MICROSOFT_AUTH_URL[_0x31a8('0x18')]('{TENANT_ID}',_0x5d504d[_0x31a8('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf09bdd,'json':!![]};return rp(_0x1dcf86);})[_0x31a8('0x31')](function(_0x104532){_0x2ce133['data5']=_0x104532[_0x31a8('0x39')];_0x2ce133[_0x31a8('0x3a')]=_0x104532[_0x31a8('0x35')];return db[_0x31a8('0x33')][_0x31a8('0x3b')]({'data5':_0x2ce133[_0x31a8('0x3c')],'data6':_0x2ce133[_0x31a8('0x3a')]},{'where':{'id':_0x2ce133['id']}});})[_0x31a8('0x31')](function(){return _0x2ce133;})[_0x31a8('0x3d')](function(_0x2a22b6){logger[_0x31a8('0x3e')](_0x31a8('0x3f'),_0x2ce133['id'],_0x2a22b6);});}function getOauth2MicrosoftAccessToken(_0x466246,_0x579fd5){var _0x561828={'grant_type':_0x31a8('0x40'),'code':_0x466246,'scope':getAccessTokenScope(_0x579fd5),'redirect_uri':_0x579fd5[_0x31a8('0x23')],'client_id':_0x579fd5[_0x31a8('0x1f')],'client_secret':encryptor[_0x31a8('0x36')](_0x579fd5[_0x31a8('0x32')])};var _0x1bf7a6={'method':_0x31a8('0x37'),'uri':MICROSOFT_AUTH_URL[_0x31a8('0x18')](_0x31a8('0x41'),_0x579fd5[_0x31a8('0x38')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x561828,'json':!![]};return rp(_0x1bf7a6);}function startRefreshInterval(_0x5855b3){var _0x5db3ee=schedule[_0x31a8('0x42')];if(_0x5db3ee[_0x5855b3['id']])clearInterval(_0x5db3ee[_0x5855b3['id']]);_0x5db3ee[_0x5855b3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x31a8('0x43')](this,{'id':_0x5855b3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x31a8('0x42')]=_0x5db3ee;}function startAllRefreshIntervals(){return db[_0x31a8('0x33')][_0x31a8('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x31a8('0x31')](function(_0xb3471e){var _0xeebaee=_0xb3471e[_0x31a8('0x11')](function(_0x51a4ee){return refreshOauth2MicrosoftAccessToken(_0x51a4ee)[_0x31a8('0x31')](function(_0x12a073){startRefreshInterval(_0x12a073);});});return Promise[_0x31a8('0x45')](_0xeebaee);})[_0x31a8('0x3d')](function(_0x111adc){var _0x185f74=_0x111adc?util['inspect'](_0x111adc,{'showHidden':![],'depth':null}):'';logger[_0x31a8('0x3e')](_0x31a8('0x46'),_0x185f74);});}module[_0x31a8('0x47')]={'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 0909705..569e61c 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 _0xb6a6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x5c3649,_0x51f4e3){_0x5c3649=_0x5c3649-0x0;var _0x57ce71=_0xb6a6[_0x5c3649];return _0x57ce71;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b6a('0x2'));var fs=require('fs');var Redis=require(_0x6b6a('0x3'));var db=require(_0x6b6a('0x4'))['db'];var utils=require(_0x6b6a('0x5'));var logger=require(_0x6b6a('0x6'))('rpc');var config=require(_0x6b6a('0x7'));var jayson=require(_0x6b6a('0x8'));var client=jayson[_0x6b6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad201,_0x1895f7,_0x59e90c){return new BPromise(function(_0x43f878,_0x15ccc9){return client['request'](_0x3ad201,_0x59e90c)[_0x6b6a('0xa')](function(_0x58ff98){logger[_0x6b6a('0xb')](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1895f7,_0x6b6a('0xd'),JSON[_0x6b6a('0xe')](_0x58ff98));if(_0x58ff98['error']){if(_0x58ff98['error'][_0x6b6a('0xf')]===0x1f4){logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x15ccc9(_0x58ff98['error'][_0x6b6a('0x11')]);}logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x43f878(_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);}else{logger['info'](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));_0x43f878(_0x58ff98['result'][_0x6b6a('0x11')]);}})[_0x6b6a('0x12')](function(_0x126189){logger[_0x6b6a('0x10')](_0x6b6a('0xc'),_0x1895f7,_0x126189);_0x15ccc9(_0x126189);});});} \ No newline at end of file +var _0x3266=['../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x3266,0x6a));var _0x6326=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3266[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14208e,_0x5402e5,_0x161f4e){return new BPromise(function(_0x5730e7,_0x2af571){return client[_0x6326('0xc')](_0x14208e,_0x161f4e)[_0x6326('0xd')](function(_0x1aee60){logger[_0x6326('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5402e5,_0x6326('0xf'));logger[_0x6326('0x10')](_0x6326('0x11'),_0x5402e5,_0x6326('0xf'),JSON[_0x6326('0x12')](_0x1aee60));if(_0x1aee60[_0x6326('0x13')]){if(_0x1aee60[_0x6326('0x13')][_0x6326('0x14')]===0x1f4){logger[_0x6326('0x13')](_0x6326('0x15'),_0x5402e5,_0x1aee60['error']['message']);return _0x2af571(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}logger['error'](_0x6326('0x15'),_0x5402e5,_0x1aee60['error'][_0x6326('0x16')]);return _0x5730e7(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}else{logger[_0x6326('0xe')](_0x6326('0x15'),_0x5402e5,_0x6326('0xf'));_0x5730e7(_0x1aee60['result'][_0x6326('0x16')]);}})['catch'](function(_0x5945ee){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5402e5,_0x5945ee);_0x2af571(_0x5945ee);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5be8123..ae53579 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x1261,0x144));var _0x1126=function(_0x165718,_0x49ae0b){_0x165718=_0x165718-0x0;var _0x2e57b2=_0x1261[_0x165718];return _0x2e57b2;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1cedfd,_0x2a4c73){var _0x4b854c=function(_0x77dd26){while(--_0x77dd26){_0x1cedfd['push'](_0x1cedfd['shift']());}};_0x4b854c(++_0x2a4c73);}(_0xadb5,0xad));var _0x5adb=function(_0x166d1e,_0x287db2){_0x166d1e=_0x166d1e-0x0;var _0x53dc60=_0xadb5[_0x166d1e];return _0x53dc60;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index ddff57d..b1dccb0 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 _0x5b7c=['STRING','name','exports'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x5b7c,0x107));var _0xc5b7=function(_0x4036aa,_0x514bb5){_0x4036aa=_0x4036aa-0x0;var _0x429d34=_0x5b7c[_0x4036aa];return _0x429d34;};'use strict';var Sequelize=require('sequelize');module[_0xc5b7('0x0')]={'name':{'type':Sequelize[_0xc5b7('0x1')],'unique':_0xc5b7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc5b7('0x1')]},'companyId':{'type':Sequelize[_0xc5b7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc5b7('0x1')]},'type':{'type':Sequelize[_0xc5b7('0x1')]},'street':{'type':Sequelize[_0xc5b7('0x1')]},'postalCode':{'type':Sequelize[_0xc5b7('0x1')]},'city':{'type':Sequelize[_0xc5b7('0x1')]},'country':{'type':Sequelize[_0xc5b7('0x1')]},'email':{'type':Sequelize[_0xc5b7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc5b7('0x1')]},'sStreet':{'type':Sequelize[_0xc5b7('0x1')]},'sPostalCode':{'type':Sequelize[_0xc5b7('0x1')]},'sCity':{'type':Sequelize[_0xc5b7('0x1')]},'sCountry':{'type':Sequelize[_0xc5b7('0x1')]},'description':{'type':Sequelize[_0xc5b7('0x1')]}}; \ No newline at end of file +var _0xda9c=['exports','STRING','name','sequelize'];(function(_0x40d484,_0x32dbd9){var _0x85631c=function(_0x4fe3a0){while(--_0x4fe3a0){_0x40d484['push'](_0x40d484['shift']());}};_0x85631c(++_0x32dbd9);}(_0xda9c,0x7b));var _0xcda9=function(_0x5b6062,_0xc9963b){_0x5b6062=_0x5b6062-0x0;var _0x4b5a48=_0xda9c[_0x5b6062];return _0x4b5a48;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':_0xcda9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcda9('0x2')]},'companyId':{'type':Sequelize[_0xcda9('0x2')]},'website':{'type':Sequelize[_0xcda9('0x2')]},'phone':{'type':Sequelize[_0xcda9('0x2')]},'fax':{'type':Sequelize[_0xcda9('0x2')]},'type':{'type':Sequelize[_0xcda9('0x2')]},'street':{'type':Sequelize[_0xcda9('0x2')]},'postalCode':{'type':Sequelize[_0xcda9('0x2')]},'city':{'type':Sequelize[_0xcda9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcda9('0x2')]},'sCity':{'type':Sequelize[_0xcda9('0x2')]},'sCountry':{'type':Sequelize[_0xcda9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index fefc468..65ad10c 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 _0x12eb=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','get','Companies','destroy','error','stack','name','send','describe','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','findOne','rawAttributes','getContacts','rimraf','zip-dir','fast-json-patch'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x12eb,0x1a6));var _0xb12e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x12eb[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb12e('0x0'));var zipdir=require(_0xb12e('0x1'));var jsonpatch=require(_0xb12e('0x2'));var rp=require(_0xb12e('0x3'));var moment=require('moment');var BPromise=require(_0xb12e('0x4'));var Mustache=require(_0xb12e('0x5'));var util=require(_0xb12e('0x6'));var path=require('path');var sox=require(_0xb12e('0x7'));var csv=require(_0xb12e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb12e('0x9'));var _=require('lodash');var squel=require(_0xb12e('0xa'));var crypto=require(_0xb12e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb12e('0xc'));var toCsv=require(_0xb12e('0x8'));var querystring=require(_0xb12e('0xd'));var Papa=require(_0xb12e('0xe'));var Redis=require(_0xb12e('0xf'));var authService=require(_0xb12e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb12e('0x11'));var hardwareService=require(_0xb12e('0x12'));var logger=require(_0xb12e('0x13'))(_0xb12e('0x14'));var utils=require(_0xb12e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb12e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cac3f,_0x52d2fe){_0x52d2fe=_0x52d2fe||0xcc;return function(_0x44641c){if(_0x44641c){return _0x5cac3f[_0xb12e('0x17')](_0x52d2fe);}return _0x5cac3f[_0xb12e('0x18')](_0x52d2fe)[_0xb12e('0x19')]();};}function respondWithResult(_0x17ec95,_0x1227bb){_0x1227bb=_0x1227bb||0xc8;return function(_0x1215a0){if(_0x1215a0){return _0x17ec95[_0xb12e('0x18')](_0x1227bb)[_0xb12e('0x1a')](_0x1215a0);}};}function respondWithFilteredResult(_0xa4dc7d,_0x460c38){return function(_0x312ec0){if(_0x312ec0){var _0x5891f0=typeof _0x460c38[_0xb12e('0x1b')]===_0xb12e('0x1c')&&typeof _0x460c38[_0xb12e('0x1d')]===_0xb12e('0x1c');var _0x33f09e=_0x312ec0[_0xb12e('0x1e')];var _0x21fd27=_0x5891f0?0x0:_0x460c38[_0xb12e('0x1b')];var _0x5a7ed1=_0x5891f0?_0x312ec0[_0xb12e('0x1e')]:_0x460c38['offset']+_0x460c38['limit'];var _0x538bbf;if(_0x5a7ed1>=_0x33f09e){_0x5a7ed1=_0x33f09e;_0x538bbf=0xc8;}else{_0x538bbf=0xce;}_0xa4dc7d[_0xb12e('0x18')](_0x538bbf);return _0xa4dc7d['set'](_0xb12e('0x1f'),_0x21fd27+'-'+_0x5a7ed1+'/'+_0x33f09e)[_0xb12e('0x1a')](_0x312ec0);}return null;};}function patchUpdates(_0x4707a3){return function(_0x1537f6){try{jsonpatch[_0xb12e('0x20')](_0x1537f6,_0x4707a3,!![]);}catch(_0x2faad5){return BPromise['reject'](_0x2faad5);}return _0x1537f6[_0xb12e('0x21')]();};}function saveUpdates(_0x16508b,_0x4cb3fb){return function(_0x77d349){if(_0x77d349){return _0x77d349['update'](_0x16508b)[_0xb12e('0x22')](function(_0x19984d){return _0x19984d;});}return null;};}function removeEntity(_0x4e5af4,_0x27b7e1){return function(_0x488269){if(_0x488269){return _0x488269['destroy']()[_0xb12e('0x22')](function(){var _0x136a8a=_0x488269[_0xb12e('0x23')]({'plain':!![]});var _0x489650=_0xb12e('0x24');return db['UserProfileResource'][_0xb12e('0x25')]({'where':{'type':_0x489650,'resourceId':_0x136a8a['id']}})[_0xb12e('0x22')](function(){return _0x488269;});})[_0xb12e('0x22')](function(){_0x4e5af4[_0xb12e('0x18')](0xcc)[_0xb12e('0x19')]();});}};}function handleEntityNotFound(_0x5c77bf,_0x49d2db){return function(_0x31420b){if(!_0x31420b){_0x5c77bf[_0xb12e('0x17')](0x194);}return _0x31420b;};}function handleError(_0x251d19,_0xc41455){_0xc41455=_0xc41455||0x1f4;return function(_0x5dd180){logger[_0xb12e('0x26')](_0x5dd180[_0xb12e('0x27')]);if(_0x5dd180[_0xb12e('0x28')]){delete _0x5dd180['name'];}_0x251d19[_0xb12e('0x18')](_0xc41455)[_0xb12e('0x29')](_0x5dd180);};}exports['index']=function(_0xbec460,_0x3f79fd){var _0x4d826c={},_0x5a38c8={},_0xee58e4={'count':0x0,'rows':[]};return db['CmCompany'][_0xb12e('0x2a')]()[_0xb12e('0x22')](function(_0x14dbe9){_0x5a38c8['model']=_['keys'](_0x14dbe9);_0x5a38c8['query']=_['keys'](_0xbec460[_0xb12e('0x2b')]);_0x5a38c8['filters']=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],_0x5a38c8[_0xb12e('0x2b')]);_0x4d826c[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0x5a38c8[_0xb12e('0x2d')],qs[_0xb12e('0x2f')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4d826c[_0xb12e('0x2e')]=_0x4d826c[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x4d826c['attributes']:_0x5a38c8[_0xb12e('0x2d')];if(!_0xbec460['query'][_0xb12e('0x31')](_0xb12e('0x32'))){_0x4d826c[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1d')]);_0x4d826c['offset']=qs[_0xb12e('0x1b')](_0xbec460[_0xb12e('0x2b')][_0xb12e('0x1b')]);}_0x4d826c[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0xbec460['query'][_0xb12e('0x34')]);_0x4d826c[_0xb12e('0x35')]=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0xbec460[_0xb12e('0x2b')],_0x5a38c8[_0xb12e('0x36')]),_0x14dbe9);if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x4d826c[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x4d826c[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x4d826c[_0xb12e('0x2e')],function(_0x34bee9){var _0x3940d9={};_0x3940d9[_0x34bee9]={'$like':'%'+_0xbec460[_0xb12e('0x2b')][_0xb12e('0x38')]+'%'};return _0x3940d9;})});}_0x4d826c=_['merge']({},_0x4d826c,_0xbec460[_0xb12e('0x3b')]);var _0x259056={'where':_0x4d826c[_0xb12e('0x35')]};return db[_0xb12e('0x3c')]['count'](_0x259056)[_0xb12e('0x22')](function(_0xe765e2){_0xee58e4[_0xb12e('0x1e')]=_0xe765e2;if(_0xbec460[_0xb12e('0x2b')][_0xb12e('0x3d')]){_0x4d826c[_0xb12e('0x3e')]=[{'all':!![]}];}return db[_0xb12e('0x3c')][_0xb12e('0x3f')](_0x4d826c);})[_0xb12e('0x22')](function(_0x517432){_0xee58e4['rows']=_0x517432;return _0xee58e4;})[_0xb12e('0x22')](respondWithFilteredResult(_0x3f79fd,_0x4d826c))[_0xb12e('0x40')](handleError(_0x3f79fd,null));})[_0xb12e('0x40')](handleError(_0x3f79fd,null));};exports[_0xb12e('0x41')]=function(_0x472c8b,_0x4f7ef7){var _0x4e4633={'raw':![],'where':{'id':_0x472c8b[_0xb12e('0x42')]['id']}},_0xa3e1ff={};_0xa3e1ff[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x3c')]['rawAttributes']);_0xa3e1ff['query']=_['keys'](_0x472c8b['query']);_0xa3e1ff['filters']=_[_0xb12e('0x2c')](_0xa3e1ff[_0xb12e('0x2d')],_0xa3e1ff['query']);_0x4e4633[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xa3e1ff['model'],qs[_0xb12e('0x2f')](_0x472c8b[_0xb12e('0x2b')][_0xb12e('0x2f')]));_0x4e4633[_0xb12e('0x2e')]=_0x4e4633[_0xb12e('0x2e')]['length']?_0x4e4633[_0xb12e('0x2e')]:_0xa3e1ff[_0xb12e('0x2d')];if(_0x472c8b['query'][_0xb12e('0x3d')]){_0x4e4633[_0xb12e('0x3e')]=[{'all':!![]}];}_0x4e4633=_[_0xb12e('0x39')]({},_0x4e4633,_0x472c8b[_0xb12e('0x3b')]);return db[_0xb12e('0x3c')][_0xb12e('0x44')](_0x4e4633)[_0xb12e('0x22')](handleEntityNotFound(_0x4f7ef7,null))[_0xb12e('0x22')](respondWithResult(_0x4f7ef7,null))[_0xb12e('0x40')](handleError(_0x4f7ef7,null));};exports['create']=function(_0x2e7506,_0x4a3e1f){return db[_0xb12e('0x3c')][_0xb12e('0x45')](_0x2e7506[_0xb12e('0x46')],{})[_0xb12e('0x22')](function(_0x28584e){var _0x11fee8=_0x2e7506[_0xb12e('0x47')][_0xb12e('0x23')]({'plain':!![]});if(!_0x11fee8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11fee8[_0xb12e('0x48')]===_0xb12e('0x47')){var _0x55065b=_0x28584e[_0xb12e('0x23')]({'plain':!![]});var _0xd5d1f6='Companies';return db[_0xb12e('0x49')]['find']({'where':{'name':_0xd5d1f6,'userProfileId':_0x11fee8[_0xb12e('0x4a')]},'raw':!![]})[_0xb12e('0x22')](function(_0x8f02a8){if(_0x8f02a8&&_0x8f02a8['autoAssociation']===0x0){return db[_0xb12e('0x4b')][_0xb12e('0x45')]({'name':_0x55065b[_0xb12e('0x28')],'resourceId':_0x55065b['id'],'type':_0x8f02a8[_0xb12e('0x28')],'sectionId':_0x8f02a8['id']},{})['then'](function(){return _0x28584e;});}else{return _0x28584e;}})[_0xb12e('0x40')](function(_0x2a2e7c){logger[_0xb12e('0x26')](_0xb12e('0x4c'),_0x2a2e7c);throw _0x2a2e7c;});}return _0x28584e;})[_0xb12e('0x22')](respondWithResult(_0x4a3e1f,0xc9))['catch'](handleError(_0x4a3e1f,null));};exports[_0xb12e('0x4d')]=function(_0x1e7f1d,_0x1a1920){if(_0x1e7f1d[_0xb12e('0x46')]['id']){delete _0x1e7f1d[_0xb12e('0x46')]['id'];}return db[_0xb12e('0x3c')][_0xb12e('0x44')]({'where':{'id':_0x1e7f1d['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x1a1920,null))[_0xb12e('0x22')](saveUpdates(_0x1e7f1d[_0xb12e('0x46')],null))['then'](respondWithResult(_0x1a1920,null))[_0xb12e('0x40')](handleError(_0x1a1920,null));};exports[_0xb12e('0x25')]=function(_0x54312e,_0x2aecf8){return db['CmCompany'][_0xb12e('0x44')]({'where':{'id':_0x54312e[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x2aecf8,null))[_0xb12e('0x22')](removeEntity(_0x2aecf8,null))[_0xb12e('0x40')](handleError(_0x2aecf8,null));};exports['describe']=function(_0x202c1c,_0x165466){return db[_0xb12e('0x3c')][_0xb12e('0x2a')]()['then'](respondWithResult(_0x165466,null))[_0xb12e('0x40')](handleError(_0x165466,null));};exports[_0xb12e('0x4e')]=function(_0x122e0d,_0x3220e3,_0x5b4c8b){return db[_0xb12e('0x4f')][_0xb12e('0x44')]({'where':{'id':_0x122e0d[_0xb12e('0x42')]['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x3220e3,null))[_0xb12e('0x22')](function(_0x128b58){if(_0x128b58){return _0x128b58[_0xb12e('0x4e')](_0x122e0d['body'][_0xb12e('0x50')],_[_0xb12e('0x51')](_0x122e0d[_0xb12e('0x46')],['ids','id'])||{});}})[_0xb12e('0x22')](respondWithResult(_0x3220e3,null))['catch'](handleError(_0x3220e3,null));};exports['getContacts']=function(_0x56e621,_0x391c57,_0xb1be65){var _0x3af7f4={};var _0xaf364f={};var _0x1b2111;var _0x5aeecd;return db[_0xb12e('0x3c')][_0xb12e('0x52')]({'where':{'id':_0x56e621['params']['id']}})[_0xb12e('0x22')](handleEntityNotFound(_0x391c57,null))[_0xb12e('0x22')](function(_0x4f7692){if(_0x4f7692){_0x1b2111=_0x4f7692;_0xaf364f[_0xb12e('0x2d')]=_[_0xb12e('0x43')](db[_0xb12e('0x4f')][_0xb12e('0x53')]);_0xaf364f[_0xb12e('0x2b')]=_['keys'](_0x56e621['query']);_0xaf364f[_0xb12e('0x36')]=_['intersection'](_0xaf364f[_0xb12e('0x2d')],_0xaf364f[_0xb12e('0x2b')]);_0x3af7f4[_0xb12e('0x2e')]=_[_0xb12e('0x2c')](_0xaf364f[_0xb12e('0x2d')],qs['fields'](_0x56e621[_0xb12e('0x2b')]['fields']));_0x3af7f4[_0xb12e('0x2e')]=_0x3af7f4[_0xb12e('0x2e')][_0xb12e('0x30')]?_0x3af7f4[_0xb12e('0x2e')]:_0xaf364f['model'];_0x3af7f4[_0xb12e('0x33')]=qs[_0xb12e('0x34')](_0x56e621[_0xb12e('0x2b')]['sort']);_0x3af7f4['where']=qs[_0xb12e('0x36')](_[_0xb12e('0x37')](_0x56e621[_0xb12e('0x2b')],_0xaf364f[_0xb12e('0x36')]));if(_0x56e621[_0xb12e('0x2b')][_0xb12e('0x38')]){_0x3af7f4[_0xb12e('0x35')]=_[_0xb12e('0x39')](_0x3af7f4[_0xb12e('0x35')],{'$or':_[_0xb12e('0x3a')](_0x3af7f4[_0xb12e('0x2e')],function(_0x11accb){var _0x517660={};_0x517660[_0x11accb]={'$like':'%'+_0x56e621['query'][_0xb12e('0x38')]+'%'};return _0x517660;})});}_0x3af7f4=_[_0xb12e('0x39')]({},_0x3af7f4,_0x56e621['options']);return _0x1b2111['getContacts'](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x18a594){if(_0x18a594){_0x5aeecd=_0x18a594[_0xb12e('0x30')];if(!_0x56e621[_0xb12e('0x2b')][_0xb12e('0x31')](_0xb12e('0x32'))){_0x3af7f4[_0xb12e('0x1d')]=qs[_0xb12e('0x1d')](_0x56e621[_0xb12e('0x2b')]['limit']);_0x3af7f4['offset']=qs[_0xb12e('0x1b')](_0x56e621[_0xb12e('0x2b')]['offset']);}return _0x1b2111[_0xb12e('0x54')](_0x3af7f4);}})[_0xb12e('0x22')](function(_0x2f3103){if(_0x2f3103){return _0x2f3103?{'count':_0x5aeecd,'rows':_0x2f3103}:null;}})[_0xb12e('0x22')](respondWithResult(_0x391c57,null))[_0xb12e('0x40')](handleError(_0x391c57,null));}; \ No newline at end of file +var _0x9452=['offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','map','options','includeAll','include','CmCompany','findAll','rows','catch','rawAttributes','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','params','addContacts','CmContact','ids','omit','getContacts','findOne','sort','filter','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json'];(function(_0x377e4d,_0x340622){var _0x5e1808=function(_0x2bf3dc){while(--_0x2bf3dc){_0x377e4d['push'](_0x377e4d['shift']());}};_0x5e1808(++_0x340622);}(_0x9452,0x139));var _0x2945=function(_0x113a43,_0x346326){_0x113a43=_0x113a43-0x0;var _0x2dc5e1=_0x9452[_0x113a43];return _0x2dc5e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2945('0x0'));var jsonpatch=require(_0x2945('0x1'));var rp=require(_0x2945('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2945('0x3'));var path=require('path');var sox=require(_0x2945('0x4'));var csv=require(_0x2945('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2945('0x6'));var squel=require(_0x2945('0x7'));var crypto=require(_0x2945('0x8'));var jsforce=require(_0x2945('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2945('0x5'));var querystring=require(_0x2945('0xa'));var Papa=require(_0x2945('0xb'));var Redis=require('ioredis');var authService=require(_0x2945('0xc'));var qs=require(_0x2945('0xd'));var as=require(_0x2945('0xe'));var hardwareService=require(_0x2945('0xf'));var logger=require(_0x2945('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2945('0x11'));var licenseUtil=require(_0x2945('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45d8a2,_0x4235bf){_0x4235bf=_0x4235bf||0xcc;return function(_0x4fe014){if(_0x4fe014){return _0x45d8a2[_0x2945('0x13')](_0x4235bf);}return _0x45d8a2['status'](_0x4235bf)[_0x2945('0x14')]();};}function respondWithResult(_0x524571,_0x255c9b){_0x255c9b=_0x255c9b||0xc8;return function(_0x283e0e){if(_0x283e0e){return _0x524571[_0x2945('0x15')](_0x255c9b)[_0x2945('0x16')](_0x283e0e);}};}function respondWithFilteredResult(_0x1a1904,_0x388279){return function(_0x2d8689){if(_0x2d8689){var _0x3057b7=typeof _0x388279[_0x2945('0x17')]==='undefined'&&typeof _0x388279['limit']===_0x2945('0x18');var _0x25cf31=_0x2d8689[_0x2945('0x19')];var _0x28784b=_0x3057b7?0x0:_0x388279['offset'];var _0x333993=_0x3057b7?_0x2d8689['count']:_0x388279[_0x2945('0x17')]+_0x388279[_0x2945('0x1a')];var _0x5b64c4;if(_0x333993>=_0x25cf31){_0x333993=_0x25cf31;_0x5b64c4=0xc8;}else{_0x5b64c4=0xce;}_0x1a1904[_0x2945('0x15')](_0x5b64c4);return _0x1a1904[_0x2945('0x1b')](_0x2945('0x1c'),_0x28784b+'-'+_0x333993+'/'+_0x25cf31)['json'](_0x2d8689);}return null;};}function patchUpdates(_0x296e8e){return function(_0x211c26){try{jsonpatch['apply'](_0x211c26,_0x296e8e,!![]);}catch(_0x253cf7){return BPromise[_0x2945('0x1d')](_0x253cf7);}return _0x211c26[_0x2945('0x1e')]();};}function saveUpdates(_0x46595b,_0xa3716b){return function(_0x5e43f4){if(_0x5e43f4){return _0x5e43f4[_0x2945('0x1f')](_0x46595b)['then'](function(_0x44ec14){return _0x44ec14;});}return null;};}function removeEntity(_0x33721a,_0x3964fc){return function(_0x175cf9){if(_0x175cf9){return _0x175cf9[_0x2945('0x20')]()[_0x2945('0x21')](function(){var _0xc146fe=_0x175cf9[_0x2945('0x22')]({'plain':!![]});var _0x15fb0e=_0x2945('0x23');return db[_0x2945('0x24')][_0x2945('0x20')]({'where':{'type':_0x15fb0e,'resourceId':_0xc146fe['id']}})['then'](function(){return _0x175cf9;});})[_0x2945('0x21')](function(){_0x33721a[_0x2945('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x189435,_0x130524){return function(_0x5d37e0){if(!_0x5d37e0){_0x189435['sendStatus'](0x194);}return _0x5d37e0;};}function handleError(_0x447987,_0xc99cd0){_0xc99cd0=_0xc99cd0||0x1f4;return function(_0x57dafa){logger[_0x2945('0x25')](_0x57dafa[_0x2945('0x26')]);if(_0x57dafa['name']){delete _0x57dafa[_0x2945('0x27')];}_0x447987['status'](_0xc99cd0)[_0x2945('0x28')](_0x57dafa);};}exports[_0x2945('0x29')]=function(_0x2c644e,_0x1587dd){var _0x114ef2={},_0x312553={},_0x5b6656={'count':0x0,'rows':[]};return db['CmCompany'][_0x2945('0x2a')]()[_0x2945('0x21')](function(_0x234c5e){_0x312553['model']=_[_0x2945('0x2b')](_0x234c5e);_0x312553[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x2c644e[_0x2945('0x2c')]);_0x312553[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x312553[_0x2945('0x2f')],_0x312553[_0x2945('0x2c')]);_0x114ef2[_0x2945('0x30')]=_[_0x2945('0x2e')](_0x312553[_0x2945('0x2f')],qs[_0x2945('0x31')](_0x2c644e[_0x2945('0x2c')][_0x2945('0x31')]));_0x114ef2['attributes']=_0x114ef2[_0x2945('0x30')][_0x2945('0x32')]?_0x114ef2[_0x2945('0x30')]:_0x312553[_0x2945('0x2f')];if(!_0x2c644e[_0x2945('0x2c')][_0x2945('0x33')](_0x2945('0x34'))){_0x114ef2[_0x2945('0x1a')]=qs[_0x2945('0x1a')](_0x2c644e[_0x2945('0x2c')][_0x2945('0x1a')]);_0x114ef2[_0x2945('0x17')]=qs[_0x2945('0x17')](_0x2c644e[_0x2945('0x2c')]['offset']);}_0x114ef2['order']=qs['sort'](_0x2c644e[_0x2945('0x2c')]['sort']);_0x114ef2[_0x2945('0x35')]=qs['filters'](_[_0x2945('0x36')](_0x2c644e[_0x2945('0x2c')],_0x312553[_0x2945('0x2d')]),_0x234c5e);if(_0x2c644e[_0x2945('0x2c')]['filter']){_0x114ef2[_0x2945('0x35')]=_[_0x2945('0x37')](_0x114ef2[_0x2945('0x35')],{'$or':_[_0x2945('0x38')](_0x114ef2['attributes'],function(_0x36699e){var _0x4b2326={};_0x4b2326[_0x36699e]={'$like':'%'+_0x2c644e[_0x2945('0x2c')]['filter']+'%'};return _0x4b2326;})});}_0x114ef2=_[_0x2945('0x37')]({},_0x114ef2,_0x2c644e[_0x2945('0x39')]);var _0x4893c1={'where':_0x114ef2[_0x2945('0x35')]};return db['CmCompany'][_0x2945('0x19')](_0x4893c1)[_0x2945('0x21')](function(_0x43301d){_0x5b6656[_0x2945('0x19')]=_0x43301d;if(_0x2c644e[_0x2945('0x2c')][_0x2945('0x3a')]){_0x114ef2[_0x2945('0x3b')]=[{'all':!![]}];}return db[_0x2945('0x3c')][_0x2945('0x3d')](_0x114ef2);})[_0x2945('0x21')](function(_0x58b0d5){_0x5b6656[_0x2945('0x3e')]=_0x58b0d5;return _0x5b6656;})[_0x2945('0x21')](respondWithFilteredResult(_0x1587dd,_0x114ef2))[_0x2945('0x3f')](handleError(_0x1587dd,null));})[_0x2945('0x3f')](handleError(_0x1587dd,null));};exports['show']=function(_0x18c483,_0x4a6a97){var _0x2a5e8c={'raw':![],'where':{'id':_0x18c483['params']['id']}},_0x4e4192={};_0x4e4192[_0x2945('0x2f')]=_['keys'](db[_0x2945('0x3c')][_0x2945('0x40')]);_0x4e4192[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x18c483['query']);_0x4e4192[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x4e4192[_0x2945('0x2f')],_0x4e4192[_0x2945('0x2c')]);_0x2a5e8c['attributes']=_[_0x2945('0x2e')](_0x4e4192['model'],qs[_0x2945('0x31')](_0x18c483['query']['fields']));_0x2a5e8c[_0x2945('0x30')]=_0x2a5e8c[_0x2945('0x30')][_0x2945('0x32')]?_0x2a5e8c[_0x2945('0x30')]:_0x4e4192[_0x2945('0x2f')];if(_0x18c483[_0x2945('0x2c')]['includeAll']){_0x2a5e8c[_0x2945('0x3b')]=[{'all':!![]}];}_0x2a5e8c=_['merge']({},_0x2a5e8c,_0x18c483[_0x2945('0x39')]);return db[_0x2945('0x3c')]['find'](_0x2a5e8c)[_0x2945('0x21')](handleEntityNotFound(_0x4a6a97,null))[_0x2945('0x21')](respondWithResult(_0x4a6a97,null))[_0x2945('0x3f')](handleError(_0x4a6a97,null));};exports[_0x2945('0x41')]=function(_0x5d1a0b,_0x11096a){return db['CmCompany']['create'](_0x5d1a0b['body'],{})['then'](function(_0x2a3180){var _0x85a80f=_0x5d1a0b[_0x2945('0x42')]['get']({'plain':!![]});if(!_0x85a80f)throw new Error(_0x2945('0x43'));if(_0x85a80f[_0x2945('0x44')]===_0x2945('0x42')){var _0x24e3f0=_0x2a3180[_0x2945('0x22')]({'plain':!![]});var _0x4fcb33='Companies';return db[_0x2945('0x45')][_0x2945('0x46')]({'where':{'name':_0x4fcb33,'userProfileId':_0x85a80f[_0x2945('0x47')]},'raw':!![]})[_0x2945('0x21')](function(_0x5a9238){if(_0x5a9238&&_0x5a9238[_0x2945('0x48')]===0x0){return db[_0x2945('0x24')][_0x2945('0x41')]({'name':_0x24e3f0[_0x2945('0x27')],'resourceId':_0x24e3f0['id'],'type':_0x5a9238[_0x2945('0x27')],'sectionId':_0x5a9238['id']},{})[_0x2945('0x21')](function(){return _0x2a3180;});}else{return _0x2a3180;}})[_0x2945('0x3f')](function(_0x27f609){logger['error'](_0x2945('0x49'),_0x27f609);throw _0x27f609;});}return _0x2a3180;})[_0x2945('0x21')](respondWithResult(_0x11096a,0xc9))[_0x2945('0x3f')](handleError(_0x11096a,null));};exports[_0x2945('0x1f')]=function(_0x3cfb82,_0x1d0f28){if(_0x3cfb82[_0x2945('0x4a')]['id']){delete _0x3cfb82['body']['id'];}return db[_0x2945('0x3c')][_0x2945('0x46')]({'where':{'id':_0x3cfb82[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x1d0f28,null))[_0x2945('0x21')](saveUpdates(_0x3cfb82[_0x2945('0x4a')],null))[_0x2945('0x21')](respondWithResult(_0x1d0f28,null))[_0x2945('0x3f')](handleError(_0x1d0f28,null));};exports['destroy']=function(_0x3f9718,_0x1cee35){return db[_0x2945('0x3c')][_0x2945('0x46')]({'where':{'id':_0x3f9718[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x1cee35,null))[_0x2945('0x21')](removeEntity(_0x1cee35,null))[_0x2945('0x3f')](handleError(_0x1cee35,null));};exports[_0x2945('0x2a')]=function(_0x3e5fc8,_0x3af17f){return db[_0x2945('0x3c')][_0x2945('0x2a')]()[_0x2945('0x21')](respondWithResult(_0x3af17f,null))['catch'](handleError(_0x3af17f,null));};exports[_0x2945('0x4c')]=function(_0xca3caa,_0x367841,_0x7e1d84){return db[_0x2945('0x4d')]['find']({'where':{'id':_0xca3caa[_0x2945('0x4b')]['id']}})[_0x2945('0x21')](handleEntityNotFound(_0x367841,null))[_0x2945('0x21')](function(_0x243f55){if(_0x243f55){return _0x243f55['addContacts'](_0xca3caa[_0x2945('0x4a')][_0x2945('0x4e')],_[_0x2945('0x4f')](_0xca3caa['body'],[_0x2945('0x4e'),'id'])||{});}})[_0x2945('0x21')](respondWithResult(_0x367841,null))[_0x2945('0x3f')](handleError(_0x367841,null));};exports[_0x2945('0x50')]=function(_0x985b10,_0x3f1905,_0x61b812){var _0x2420bc={};var _0x174fc4={};var _0x17f7d5;var _0x387472;return db[_0x2945('0x3c')][_0x2945('0x51')]({'where':{'id':_0x985b10['params']['id']}})['then'](handleEntityNotFound(_0x3f1905,null))[_0x2945('0x21')](function(_0x49d437){if(_0x49d437){_0x17f7d5=_0x49d437;_0x174fc4[_0x2945('0x2f')]=_[_0x2945('0x2b')](db[_0x2945('0x4d')]['rawAttributes']);_0x174fc4[_0x2945('0x2c')]=_[_0x2945('0x2b')](_0x985b10[_0x2945('0x2c')]);_0x174fc4[_0x2945('0x2d')]=_[_0x2945('0x2e')](_0x174fc4[_0x2945('0x2f')],_0x174fc4['query']);_0x2420bc[_0x2945('0x30')]=_[_0x2945('0x2e')](_0x174fc4[_0x2945('0x2f')],qs[_0x2945('0x31')](_0x985b10[_0x2945('0x2c')]['fields']));_0x2420bc[_0x2945('0x30')]=_0x2420bc[_0x2945('0x30')][_0x2945('0x32')]?_0x2420bc[_0x2945('0x30')]:_0x174fc4[_0x2945('0x2f')];_0x2420bc['order']=qs[_0x2945('0x52')](_0x985b10[_0x2945('0x2c')][_0x2945('0x52')]);_0x2420bc[_0x2945('0x35')]=qs[_0x2945('0x2d')](_[_0x2945('0x36')](_0x985b10[_0x2945('0x2c')],_0x174fc4[_0x2945('0x2d')]));if(_0x985b10[_0x2945('0x2c')]['filter']){_0x2420bc[_0x2945('0x35')]=_['merge'](_0x2420bc[_0x2945('0x35')],{'$or':_['map'](_0x2420bc[_0x2945('0x30')],function(_0x36ea65){var _0x54ca0b={};_0x54ca0b[_0x36ea65]={'$like':'%'+_0x985b10[_0x2945('0x2c')][_0x2945('0x53')]+'%'};return _0x54ca0b;})});}_0x2420bc=_['merge']({},_0x2420bc,_0x985b10['options']);return _0x17f7d5[_0x2945('0x50')](_0x2420bc);}})[_0x2945('0x21')](function(_0x3b0d37){if(_0x3b0d37){_0x387472=_0x3b0d37[_0x2945('0x32')];if(!_0x985b10['query'][_0x2945('0x33')](_0x2945('0x34'))){_0x2420bc[_0x2945('0x1a')]=qs['limit'](_0x985b10[_0x2945('0x2c')][_0x2945('0x1a')]);_0x2420bc[_0x2945('0x17')]=qs[_0x2945('0x17')](_0x985b10[_0x2945('0x2c')][_0x2945('0x17')]);}return _0x17f7d5['getContacts'](_0x2420bc);}})[_0x2945('0x21')](function(_0xeb1f0d){if(_0xeb1f0d){return _0xeb1f0d?{'count':_0x387472,'rows':_0xeb1f0d}:null;}})[_0x2945('0x21')](respondWithResult(_0x3f1905,null))[_0x2945('0x3f')](handleError(_0x3f1905,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index f79404e..02babea 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 _0x420d=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','request-promise'];(function(_0xb4f705,_0x39327b){var _0x48e5b6=function(_0x37527e){while(--_0x37527e){_0xb4f705['push'](_0xb4f705['shift']());}};_0x48e5b6(++_0x39327b);}(_0x420d,0x126));var _0xd420=function(_0x5f1e00,_0x32a120){_0x5f1e00=_0x5f1e00-0x0;var _0x5d1743=_0x420d[_0x5f1e00];return _0x5d1743;};'use strict';var _=require(_0xd420('0x0'));var util=require('util');var logger=require(_0xd420('0x1'))(_0xd420('0x2'));var moment=require(_0xd420('0x3'));var BPromise=require('bluebird');var rp=require(_0xd420('0x4'));var fs=require('fs');var path=require(_0xd420('0x5'));var rimraf=require(_0xd420('0x6'));var config=require(_0xd420('0x7'));var attributes=require(_0xd420('0x8'));module[_0xd420('0x9')]=function(_0x44f838,_0x2cb500){return _0x44f838[_0xd420('0xa')](_0xd420('0xb'),attributes,{'tableName':_0xd420('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89b0=['define','cm_companies','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x89b0,0xda));var _0x089b=function(_0x4936e7,_0x3fc583){_0x4936e7=_0x4936e7-0x0;var _0x3e3f17=_0x89b0[_0x4936e7];return _0x3e3f17;};'use strict';var _=require('lodash');var util=require(_0x089b('0x0'));var logger=require(_0x089b('0x1'))(_0x089b('0x2'));var moment=require(_0x089b('0x3'));var BPromise=require(_0x089b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x089b('0x5'));var rimraf=require(_0x089b('0x6'));var config=require(_0x089b('0x7'));var attributes=require(_0x089b('0x8'));module[_0x089b('0x9')]=function(_0x303c97,_0x516d9e){return _0x303c97[_0x089b('0xa')]('CmCompany',attributes,{'tableName':_0x089b('0xb'),'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 b12a161..b18f9de 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 _0x1894=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x2f82e7,_0x50f448){var _0x483927=function(_0x1f9d9c){while(--_0x1f9d9c){_0x2f82e7['push'](_0x2f82e7['shift']());}};_0x483927(++_0x50f448);}(_0x1894,0x1ce));var _0x4189=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x1894[_0x8a30cf];return _0x20f439;};'use strict';var _=require(_0x4189('0x0'));var util=require('util');var moment=require(_0x4189('0x1'));var BPromise=require(_0x4189('0x2'));var rs=require(_0x4189('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4189('0x4'))['db'];var utils=require(_0x4189('0x5'));var logger=require('../../config/logger')(_0x4189('0x6'));var config=require(_0x4189('0x7'));var jayson=require(_0x4189('0x8'));var client=jayson[_0x4189('0x9')][_0x4189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448b,_0x342614,_0x4d4d43){return new BPromise(function(_0x2c7f64,_0x56bebd){return client[_0x4189('0xb')](_0x448b,_0x4d4d43)[_0x4189('0xc')](function(_0xb69e81){logger['info'](_0x4189('0xd'),_0x342614,_0x4189('0xe'));logger[_0x4189('0xf')](_0x4189('0x10'),_0x342614,_0x4189('0xe'),JSON['stringify'](_0xb69e81));if(_0xb69e81[_0x4189('0x11')]){if(_0xb69e81[_0x4189('0x11')][_0x4189('0x12')]===0x1f4){logger[_0x4189('0x11')](_0x4189('0xd'),_0x342614,_0xb69e81['error']['message']);return _0x56bebd(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}logger[_0x4189('0x11')]('CmCompany,\x20%s,\x20%s',_0x342614,_0xb69e81['error'][_0x4189('0x13')]);return _0x2c7f64(_0xb69e81[_0x4189('0x11')][_0x4189('0x13')]);}else{logger[_0x4189('0x14')]('CmCompany,\x20%s,\x20%s',_0x342614,_0x4189('0xe'));_0x2c7f64(_0xb69e81[_0x4189('0x15')][_0x4189('0x13')]);}})[_0x4189('0x16')](function(_0xa7730b){logger['error'](_0x4189('0xd'),_0x342614,_0xa7730b);_0x56bebd(_0xa7730b);});});} \ No newline at end of file +var _0x0efe=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0efe,0xd8));var _0xe0ef=function(_0x2fc7a2,_0x32ef0a){_0x2fc7a2=_0x2fc7a2-0x0;var _0x26cc9f=_0x0efe[_0x2fc7a2];return _0x26cc9f;};'use strict';var _=require(_0xe0ef('0x0'));var util=require(_0xe0ef('0x1'));var moment=require(_0xe0ef('0x2'));var BPromise=require(_0xe0ef('0x3'));var rs=require(_0xe0ef('0x4'));var fs=require('fs');var Redis=require(_0xe0ef('0x5'));var db=require(_0xe0ef('0x6'))['db'];var utils=require(_0xe0ef('0x7'));var logger=require(_0xe0ef('0x8'))(_0xe0ef('0x9'));var config=require(_0xe0ef('0xa'));var jayson=require(_0xe0ef('0xb'));var client=jayson[_0xe0ef('0xc')][_0xe0ef('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x462c61,_0x2d8717,_0x34533e){return new BPromise(function(_0x701945,_0x1502c6){return client[_0xe0ef('0xe')](_0x462c61,_0x34533e)['then'](function(_0x81f8b8){logger[_0xe0ef('0xf')](_0xe0ef('0x10'),_0x2d8717,_0xe0ef('0x11'));logger[_0xe0ef('0x12')](_0xe0ef('0x13'),_0x2d8717,'request\x20sent',JSON[_0xe0ef('0x14')](_0x81f8b8));if(_0x81f8b8[_0xe0ef('0x15')]){if(_0x81f8b8[_0xe0ef('0x15')]['code']===0x1f4){logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);return _0x1502c6(_0x81f8b8[_0xe0ef('0x15')]['message']);}logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);return _0x701945(_0x81f8b8[_0xe0ef('0x15')][_0xe0ef('0x16')]);}else{logger['info'](_0xe0ef('0x10'),_0x2d8717,_0xe0ef('0x11'));_0x701945(_0x81f8b8['result'][_0xe0ef('0x16')]);}})[_0xe0ef('0x17')](function(_0x1fe7a0){logger[_0xe0ef('0x15')](_0xe0ef('0x10'),_0x2d8717,_0x1fe7a0);_0x1502c6(_0x1fe7a0);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4f83709..312cd79 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 _0xb48e=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x1e22c0,_0x1b0aec){var _0x2b9f0b=function(_0x25403d){while(--_0x25403d){_0x1e22c0['push'](_0x1e22c0['shift']());}};_0x2b9f0b(++_0x1b0aec);}(_0xb48e,0x1d1));var _0xeb48=function(_0x52ac2f,_0x1d478a){_0x52ac2f=_0x52ac2f-0x0;var _0x58e4ec=_0xb48e[_0x52ac2f];return _0x58e4ec;};'use strict';var multer=require('multer');var util=require(_0xeb48('0x0'));var path=require(_0xeb48('0x1'));var timeout=require(_0xeb48('0x2'));var express=require(_0xeb48('0x3'));var router=express[_0xeb48('0x4')]();var fs_extra=require(_0xeb48('0x5'));var auth=require(_0xeb48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb48('0x7'));var controller=require('./cmCompany.controller');router[_0xeb48('0x8')]('/',auth['isAuthenticated'](),controller[_0xeb48('0x9')]);router['get'](_0xeb48('0xa'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xc')]);router[_0xeb48('0x8')](_0xeb48('0xd'),auth[_0xeb48('0xb')](),controller[_0xeb48('0xe')]);router[_0xeb48('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xeb48('0xf')]);router[_0xeb48('0x10')]('/',auth[_0xeb48('0xb')](),controller[_0xeb48('0x11')]);router[_0xeb48('0x10')]('/:id/contacts',auth[_0xeb48('0xb')](),controller[_0xeb48('0x12')]);router[_0xeb48('0x13')]('/:id',auth[_0xeb48('0xb')](),controller[_0xeb48('0x14')]);router[_0xeb48('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xeb48('0x16')]);module[_0xeb48('0x17')]=router; \ No newline at end of file +var _0xb03e=['../../config/environment','get','isAuthenticated','/describe','show','/:id/contacts','getContacts','post','create','addContacts','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xb03e,0x6f));var _0xeb03=function(_0x410c76,_0xcbe5de){_0x410c76=_0x410c76-0x0;var _0x1a9850=_0xb03e[_0x410c76];return _0x1a9850;};'use strict';var multer=require(_0xeb03('0x0'));var util=require(_0xeb03('0x1'));var path=require(_0xeb03('0x2'));var timeout=require(_0xeb03('0x3'));var express=require(_0xeb03('0x4'));var router=express[_0xeb03('0x5')]();var fs_extra=require(_0xeb03('0x6'));var auth=require(_0xeb03('0x7'));var interaction=require(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var controller=require('./cmCompany.controller');router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller['describe']);router[_0xeb03('0xa')]('/:id',auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xf')]);router[_0xeb03('0x10')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x11')]);router[_0xeb03('0x10')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x12')]);router[_0xeb03('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xeb03('0x14')](_0xeb03('0x15'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);module[_0xeb03('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 7afc6a3..24ec6d5 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 _0x1101=['NOW','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4fb528,_0xc63eda){var _0x531ede=function(_0x8ee2c5){while(--_0x8ee2c5){_0x4fb528['push'](_0x4fb528['shift']());}};_0x531ede(++_0xc63eda);}(_0x1101,0x1b3));var _0x1110=function(_0x402fc0,_0x2f2b08){_0x402fc0=_0x402fc0-0x0;var _0xef0202=_0x1101[_0x402fc0];return _0xef0202;};'use strict';var _=require('lodash');var Sequelize=require(_0x1110('0x0'));module[_0x1110('0x1')]={'firstName':{'type':Sequelize[_0x1110('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1110('0x2')]},'city':{'type':Sequelize[_0x1110('0x2')]},'country':{'type':Sequelize[_0x1110('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1110('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1110('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1110('0x2')]},'email':{'type':Sequelize[_0x1110('0x2')]},'url':{'type':Sequelize[_0x1110('0x2')]},'facebook':{'type':Sequelize[_0x1110('0x2')]},'fb_data':{'type':Sequelize[_0x1110('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1110('0x2')]},'viber':{'type':Sequelize[_0x1110('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1110('0x2')]},'UserId':{'type':Sequelize[_0x1110('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x1110('0x2')]},'priority':{'type':Sequelize[_0x1110('0x3')](0x2)[_0x1110('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1110('0x5')],'defaultValue':Sequelize[_0x1110('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x14fb=['UNSIGNED','NOW','lodash','sequelize','STRING','INTEGER'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0x14fb,0x1ac));var _0xb14f=function(_0x500c46,_0x20da10){_0x500c46=_0x500c46-0x0;var _0x5ee964=_0x14fb[_0x500c46];return _0x5ee964;};'use strict';var _=require(_0xb14f('0x0'));var Sequelize=require(_0xb14f('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xb14f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb14f('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xb14f('0x2')]},'city':{'type':Sequelize[_0xb14f('0x2')]},'country':{'type':Sequelize[_0xb14f('0x2')]},'dateOfBirth':{'type':Sequelize[_0xb14f('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xb14f('0x2')]},'mobile':{'type':Sequelize[_0xb14f('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb14f('0x2')]},'url':{'type':Sequelize[_0xb14f('0x2')]},'facebook':{'type':Sequelize[_0xb14f('0x2')]},'fb_data':{'type':Sequelize[_0xb14f('0x2')]},'twitter':{'type':Sequelize[_0xb14f('0x2')]},'skype':{'type':Sequelize[_0xb14f('0x2')]},'teams':{'type':Sequelize[_0xb14f('0x2')]},'viber':{'type':Sequelize[_0xb14f('0x2')]},'line':{'type':Sequelize[_0xb14f('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xb14f('0x2')]},'UserId':{'type':Sequelize[_0xb14f('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xb14f('0x2')]},'priority':{'type':Sequelize[_0xb14f('0x3')](0x2)[_0xb14f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb14f('0x5')]},'dialTimezone':{'type':Sequelize[_0xb14f('0x2')]},'utcOffset':{'type':Sequelize[_0xb14f('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2a5b88c..7e71771 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 0b507c7..2364993 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 _0x7a9b=['save','update','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x19f53e,_0x567042){var _0x45c7d8=function(_0x3c62dd){while(--_0x3c62dd){_0x19f53e['push'](_0x19f53e['shift']());}};_0x45c7d8(++_0x567042);}(_0x7a9b,0xde));var _0xb7a9=function(_0x589dbb,_0x54338d){_0x589dbb=_0x589dbb-0x0;var _0x3972ab=_0x7a9b[_0x589dbb];return _0x3972ab;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xb7a9('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb7a9('0x1')](0x0);var events={'afterCreate':_0xb7a9('0x2'),'afterUpdate':_0xb7a9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d45e0){return function(_0x2f4dc7,_0x2dd9aa,_0x3bec92){CmContactEvents['emit'](_0x5d45e0+':'+_0x2f4dc7['id'],_0x2f4dc7);CmContactEvents['emit'](_0x5d45e0,_0x2f4dc7);_0x3bec92(null);};}for(var e in events){if(events[_0xb7a9('0x4')](e)){var event=events[e];CmContact[_0xb7a9('0x5')](e,emitEvent(event));}}module[_0xb7a9('0x6')]=CmContactEvents; \ No newline at end of file +var _0xc97e=['../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x2f3810,_0xd81355){var _0x18938c=function(_0x1fd5e8){while(--_0x1fd5e8){_0x2f3810['push'](_0x2f3810['shift']());}};_0x18938c(++_0xd81355);}(_0xc97e,0x1df));var _0xec97=function(_0x3c6743,_0x544a90){_0x3c6743=_0x3c6743-0x0;var _0x1e2b85=_0xc97e[_0x3c6743];return _0x1e2b85;};'use strict';var EventEmitter=require(_0xec97('0x0'));var CmContact=require(_0xec97('0x1'))['db'][_0xec97('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xec97('0x3')](0x0);var events={'afterCreate':_0xec97('0x4'),'afterUpdate':_0xec97('0x5'),'afterDestroy':_0xec97('0x6')};function emitEvent(_0x440167){return function(_0x48f092,_0x585e4f,_0x1f1d6f){CmContactEvents['emit'](_0x440167+':'+_0x48f092['id'],_0x48f092);CmContactEvents[_0xec97('0x7')](_0x440167,_0x48f092);_0x1f1d6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xec97('0x8')](e,emitEvent(event));}}module[_0xec97('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 41a02ad..a1c8108 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 _0x67ce=['api','moment','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','add','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','Lists','length','findAll','BlackLists','get','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','always','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger'];(function(_0x4c8f01,_0x170514){var _0x30c1f7=function(_0x2aae01){while(--_0x2aae01){_0x4c8f01['push'](_0x4c8f01['shift']());}};_0x30c1f7(++_0x170514);}(_0x67ce,0x93));var _0xe67c=function(_0x3b08cf,_0x274018){_0x3b08cf=_0x3b08cf-0x0;var _0x8d8103=_0x67ce[_0x3b08cf];return _0x8d8103;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe67c('0x0'))(_0xe67c('0x1'));var moment=require(_0xe67c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe67c('0x3'));var rimraf=require(_0xe67c('0x4'));var config=require(_0xe67c('0x5'));var shared=require(_0xe67c('0x6'));var attributes=require(_0xe67c('0x7'));module[_0xe67c('0x8')]=function(_0xcad6d3,_0x2c27c8){return _0xcad6d3[_0xe67c('0x9')](_0xe67c('0xa'),attributes,{'tableName':_0xe67c('0xb'),'paranoid':!![],'indexes':[{'name':_0xe67c('0xc'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0xe67c('0xd'),_0xe67c('0xe'),_0xe67c('0xc'),'mobile',_0xe67c('0xf'),_0xe67c('0x10')],'type':_0xe67c('0x11')}],'timestamps':!![],'charset':_0xe67c('0x12'),'collate':_0xe67c('0x13'),'hooks':{'afterCreate':function(_0xd950dc,_0xe6874c,_0x24e71e){var _0x475370=_0xcad6d3[_0xe67c('0x14')];var _0x2cad1c=_0xd950dc['get']({'plain':!![]});function _0x1ce207(){return function(_0x1c7d63){logger[_0xe67c('0x15')]('cmContact','afterCreate',util[_0xe67c('0x16')](_0x1c7d63,{'showHidden':![],'depth':null}));};}function _0x1d2de1(_0x1f827b,_0x2df5fd){var _0x4a70fb=_0x2df5fd[_0xe67c('0x17')]?_0x2df5fd['scheduledat']:moment()[_0xe67c('0x18')](_0xe67c('0x19'));return new BPromise(function(_0x45d135,_0x1e622d){if(_[_0xe67c('0x1a')](_0x2df5fd[_0xe67c('0x1b')])){_0x45d135({'ret':_0x4a70fb});}else{_0x475370[_0xe67c('0x1c')][_0xe67c('0x1d')]({'where':{'id':_0x1f827b['id']}})[_0xe67c('0x1e')](function(_0x47a46){if(!_[_0xe67c('0x1a')](_0x47a46)){var _0x2e2e40=_0x47a46[_0xe67c('0x1b')];if(!_[_0xe67c('0x1a')](_0x2e2e40)){var _0x23c013=shared[_0xe67c('0x1f')];var _0x5292e0=_0x23c013[_0x2e2e40];var _0xd2db3f=_0x23c013[_0x2df5fd['dialTimezone']];if(!_[_0xe67c('0x1a')](_0x5292e0)&&!_[_0xe67c('0x1a')](_0xd2db3f)){var _0x301bb3=_0x5292e0[_0xe67c('0x20')]-_0xd2db3f[_0xe67c('0x20')];_0x4a70fb=_0x2df5fd[_0xe67c('0x17')]?_0x2df5fd[_0xe67c('0x17')]:moment();var _0x17d38=moment(_0x4a70fb)['add'](_0x301bb3,_0xe67c('0x21'));_0x45d135({'ret':_0x17d38[_0xe67c('0x18')](_0xe67c('0x19'))});}else _0x45d135({'ret':_0x4a70fb});}else _0x45d135({'ret':_0x4a70fb});}else{_0x45d135({'ret':_0x4a70fb});}});}});return 0xa;}var _0x5f0851=function(_0x20883c){return new BPromise(function(_0x56245d,_0x4e0182){_0x1d2de1(_0x20883c,_0x2cad1c)[_0xe67c('0x1e')](function(_0x795cf0){_0x2cad1c['scheduledat']=_0x795cf0['ret'];_0x475370[_0xe67c('0x22')][_0xe67c('0x1d')]({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x20883c['id']}})[_0xe67c('0x1e')](function(_0x5091d6){if(!_[_0xe67c('0x1a')](_0x5091d6)){throw new Error(_0xe67c('0x23')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x24')+_0x20883c['id']);}return _0x475370[_0xe67c('0x22')][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c['priority']?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()['format'](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x20883c['id']});})[_0xe67c('0x29')](function(_0x406b66){_0x4e0182(_0x406b66);});});});};var _0x32bcf4=function(_0x363132){return new BPromise(function(_0x5ea542,_0x1864d7){_0x1d2de1(_0x363132,_0x2cad1c)[_0xe67c('0x1e')](function(_0x8c6a5e){_0x2cad1c[_0xe67c('0x17')]=_0x8c6a5e[_0xe67c('0x2a')];_0x475370[_0xe67c('0x22')][_0xe67c('0x1d')]({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x363132['id']}})['then'](function(_0x2898e0){if(!_['isNil'](_0x2898e0)){throw new Error(_0xe67c('0x23')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x2b')+_0x363132['id']);}return _0x475370[_0xe67c('0x2c')]['findOne']({'where':{'calleridnum':_0x2cad1c[_0xe67c('0xc')],'VoiceQueueId':_0x363132['id']}});})['then'](function(_0x43bc3c){if(!_['isNil'](_0x43bc3c)){throw new Error(_0xe67c('0x2d')+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x2e')+_0x363132['id']);}return _0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c['callbackUniqueid']?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x363132['id']});})[_0xe67c('0x29')](function(_0x21a120){_0x1864d7(_0x21a120);});});});};function _0x32e49b(){return function(_0x59461d){logger[_0xe67c('0x15')](_0xe67c('0x2f'),'afterCreate',util['inspect'](_0x59461d,{'showHidden':![],'depth':null}));};}function _0x8230ca(_0x19b806,_0x3a516e){var _0x3c848e=_0x3a516e[_0xe67c('0x17')]?_0x3a516e[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19'));return new BPromise(function(_0x1ecc67,_0x1b922a){if(_['isNil'](_0x3a516e[_0xe67c('0x1b')])){_0x1ecc67({'ret':_0x3c848e});}else{_0x475370[_0xe67c('0x30')]['findOne']({'where':{'id':_0x19b806['id']}})['then'](function(_0x166172){if(!_[_0xe67c('0x1a')](_0x166172)){var _0x481082=_0x166172[_0xe67c('0x1b')];if(!_['isNil'](_0x481082)){var _0x35ded9=shared[_0xe67c('0x1f')];var _0x5803d7=_0x35ded9[_0x481082];var _0x501338=_0x35ded9[_0x3a516e[_0xe67c('0x1b')]];if(!_['isNil'](_0x5803d7)&&!_[_0xe67c('0x1a')](_0x501338)){var _0x5125a3=_0x5803d7[_0xe67c('0x20')]-_0x501338[_0xe67c('0x20')];_0x3c848e=_0x3a516e[_0xe67c('0x17')]?_0x3a516e['scheduledat']:moment();var _0x4b60bb=moment(_0x3c848e)[_0xe67c('0x31')](_0x5125a3,_0xe67c('0x21'));_0x1ecc67({'ret':_0x4b60bb[_0xe67c('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1ecc67({'ret':_0x3c848e});}else _0x1ecc67({'ret':_0x3c848e});}else{_0x1ecc67({'ret':_0x3c848e});}});}});return 0xa;}var _0x55241a=function(_0x17a985){return new BPromise(function(_0x27373a,_0x5aa697){_0x8230ca(_0x17a985,_0x2cad1c)[_0xe67c('0x1e')](function(_0x3c3d96){_0x2cad1c[_0xe67c('0x17')]=_0x3c3d96['ret'];_0x475370[_0xe67c('0x22')]['findOne']({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x17a985['id']}})['then'](function(_0x513076){if(!_[_0xe67c('0x1a')](_0x513076)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x32')+_0x17a985['id']);}return _0x475370['CmHopper'][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c['priority']:0x2,'scheduledat':_0x2cad1c['scheduledat']?_0x2cad1c['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c['callbackUniqueid']?_0x2cad1c['callbackUniqueid']:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()['format'](_0xe67c('0x19')):undefined,'CampaignId':_0x17a985['id']});})[_0xe67c('0x29')](function(_0x58ea52){_0x5aa697(_0x58ea52);});});});};var _0x44d148=function(_0x40024f){return new BPromise(function(_0x11e39e,_0x3e1469){_0x8230ca(_0x40024f,_0x2cad1c)[_0xe67c('0x1e')](function(_0x31ad99){_0x2cad1c[_0xe67c('0x17')]=_0x31ad99[_0xe67c('0x2a')];_0x475370['CmHopper']['findOne']({'where':{'phone':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x40024f['id']}})['then'](function(_0x2cc262){if(!_[_0xe67c('0x1a')](_0x2cc262)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2cad1c[_0xe67c('0xc')]+_0xe67c('0x33')+_0x40024f['id']);}return _0x475370[_0xe67c('0x2c')][_0xe67c('0x1d')]({'where':{'calleridnum':_0x2cad1c[_0xe67c('0xc')],'CampaignId':_0x40024f['id']}});})[_0xe67c('0x1e')](function(_0x2b8c4f){if(!_[_0xe67c('0x1a')](_0x2b8c4f)){throw new Error(_0xe67c('0x2d')+_0x2cad1c['phone']+_0xe67c('0x34')+_0x40024f['id']);}return _0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c['phone'],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c['callbackUniqueid']?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'CampaignId':_0x40024f['id']});})[_0xe67c('0x29')](function(_0x5b73cb){_0x3e1469(_0x5b73cb);});});});};if(_0x2cad1c[_0xe67c('0x26')]){_0x475370['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xe67c('0x35'),_0xe67c('0x1b')],'include':[{'model':_0x475370[_0xe67c('0x36')],'as':_0xe67c('0x37'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x41bd34){if(_0x41bd34){var _0x18eb34=[];for(var _0x8110d6=0x0,_0x126907;_0x8110d6<_0x41bd34[_0xe67c('0x38')];_0x8110d6+=0x1){_0x126907=_0x41bd34[_0x8110d6]['get']({'plain':!![]});switch(_0x126907[_0xe67c('0x35')]){case'always':_0x32bcf4(_0x126907)['catch'](_0x1ce207());break;case'onlyIfOpen':_0x5f0851(_0x126907)[_0xe67c('0x29')](_0x1ce207());break;default:_0x8230ca(_0x126907,_0x2cad1c)[_0xe67c('0x1e')](function(_0x3b40f5){_0x2cad1c[_0xe67c('0x17')]=_0x3b40f5[_0xe67c('0x2a')];_0x475370[_0xe67c('0x22')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()[_0xe67c('0x18')](_0xe67c('0x19')),'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c['callbackUniqueid']:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()[_0xe67c('0x18')](_0xe67c('0x19')):undefined,'VoiceQueueId':_0x126907['id']})[_0xe67c('0x29')](_0x1ce207());});}}}})[_0xe67c('0x1e')](function(){return _0x475370[_0xe67c('0x1c')][_0xe67c('0x39')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x475370[_0xe67c('0x36')],'as':_0xe67c('0x3a'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x40633f){if(_0x40633f){var _0x29ac8d=[];for(var _0x3f9b52=0x0,_0x2ae13c;_0x3f9b52<_0x40633f[_0xe67c('0x38')];_0x3f9b52+=0x1){_0x2ae13c=_0x40633f[_0x3f9b52][_0xe67c('0x3b')]({'plain':!![]});_0x475370[_0xe67c('0x3c')][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'VoiceQueueId':_0x2ae13c['id']})[_0xe67c('0x29')](function(_0x4c3c36){logger[_0xe67c('0x15')](_0xe67c('0x3d'),_0xe67c('0x3e'),_0x4c3c36[_0xe67c('0x3f')]);});}}});})[_0xe67c('0x1e')](function(){return _0x475370['Campaign'][_0xe67c('0x39')]({'attributes':['id',_0xe67c('0x35'),_0xe67c('0x1b')],'include':[{'model':_0x475370['CmList'],'as':'Lists','where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x4ddf42){if(_0x4ddf42){var _0x16ac4f=[];for(var _0x4a18c3=0x0,_0x32f3ab;_0x4a18c3<_0x4ddf42[_0xe67c('0x38')];_0x4a18c3+=0x1){_0x32f3ab=_0x4ddf42[_0x4a18c3][_0xe67c('0x3b')]({'plain':!![]});switch(_0x32f3ab[_0xe67c('0x35')]){case _0xe67c('0x40'):_0x44d148(_0x32f3ab)[_0xe67c('0x29')](_0x32e49b());break;case'onlyIfOpen':_0x55241a(_0x32f3ab)[_0xe67c('0x29')](_0x32e49b());break;default:_0x475370['CmHopper'][_0xe67c('0x25')]({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c['ListId'],'scheduledat':_0x2cad1c[_0xe67c('0x17')]?_0x2cad1c[_0xe67c('0x17')]:moment()['format'](_0xe67c('0x19')),'priority':_0x2cad1c[_0xe67c('0x27')]?_0x2cad1c[_0xe67c('0x27')]:0x2,'callback':_0x2cad1c[_0xe67c('0x28')]?!![]:![],'callbackuniqueid':_0x2cad1c[_0xe67c('0x28')]?_0x2cad1c[_0xe67c('0x28')]:undefined,'callbackat':_0x2cad1c[_0xe67c('0x28')]?moment()['format'](_0xe67c('0x19')):undefined,'CampaignId':_0x32f3ab['id']})['catch'](_0x32e49b());}}}});})[_0xe67c('0x1e')](function(){return _0x475370[_0xe67c('0x30')][_0xe67c('0x39')]({'attributes':['id'],'include':[{'model':_0x475370['CmList'],'as':_0xe67c('0x3a'),'where':{'id':_0x2cad1c[_0xe67c('0x26')]}}]})[_0xe67c('0x1e')](function(_0x4fad37){if(_0x4fad37){var _0x1de6d9=[];for(var _0x395192=0x0,_0xd793d0;_0x395192<_0x4fad37[_0xe67c('0x38')];_0x395192+=0x1){_0xd793d0=_0x4fad37[_0x395192]['get']({'plain':!![]});_0x475370[_0xe67c('0x3c')]['create']({'phone':_0x2cad1c[_0xe67c('0xc')],'ContactId':_0x2cad1c['id'],'ListId':_0x2cad1c[_0xe67c('0x26')],'CampaignId':_0xd793d0['id']})['catch'](function(_0x58e7cf){logger[_0xe67c('0x15')](_0xe67c('0x3d'),_0xe67c('0x3e'),_0x58e7cf[_0xe67c('0x3f')]);});}}});})[_0xe67c('0x1e')](function(){_0x24e71e();})[_0xe67c('0x29')](function(_0x713c08){logger[_0xe67c('0x15')](_0xe67c('0x3d'),'afterCreate',_0x713c08[_0xe67c('0x3f')]);_0x24e71e(_0x713c08);});}else{_0x24e71e(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x179b35,_0x2ebb44,_0x1ab2ae){var _0x307e9b=_0xcad6d3['models'];var _0x12691b=_0x179b35[_0xe67c('0x3b')]({'plain':!![]});return _0x307e9b[_0xe67c('0x22')][_0xe67c('0x39')]({'raw':!![],'where':{'ListId':_0x12691b['ListId'],'ContactId':_0x12691b['id']}})[_0xe67c('0x1e')](function(_0x419303){if(!_[_0xe67c('0x41')](_0x419303)){var _0x224911=[];for(var _0x19419c=0x0;_0x19419c<_0x419303[_0xe67c('0x38')];_0x19419c+=0x1){var _0x789841=_0x307e9b['CmHopper'][_0xe67c('0x42')]({'where':{'ListId':_0x419303[_0x19419c][_0xe67c('0x26')],'ContactId':_0x419303[_0x19419c][_0xe67c('0x43')],'VoiceQueueId':_0x419303[_0x19419c][_0xe67c('0x44')],'CampaignId':_0x419303[_0x19419c]['CampaignId']}});_0x224911[_0xe67c('0x45')](_0x789841);}return BPromise[_0xe67c('0x46')](_0x224911);}})[_0xe67c('0x1e')](function(_0x2d520b){logger[_0xe67c('0x47')](_0xe67c('0x48'),util[_0xe67c('0x16')](_0x2d520b,{'showHidden':![],'depth':null}));_0x1ab2ae();})['catch'](function(_0x56f77a){logger[_0xe67c('0x15')](_0xe67c('0x49'),util['inspect'](_0x56f77a,{'showHidden':![],'depth':null}));_0x1ab2ae(_0x56f77a);});}}});}; \ No newline at end of file +var _0xcaf2=['add','minutes','format','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','destroy','ContactId','VoiceQueueId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','moment','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','timezones','utcOffset'];(function(_0x3a0f20,_0x48cbe8){var _0x2029e1=function(_0x538c4d){while(--_0x538c4d){_0x3a0f20['push'](_0x3a0f20['shift']());}};_0x2029e1(++_0x48cbe8);}(_0xcaf2,0x135));var _0x2caf=function(_0x554b32,_0x577efd){_0x554b32=_0x554b32-0x0;var _0x2d896d=_0xcaf2[_0x554b32];return _0x2d896d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2caf('0x0'))('api');var moment=require(_0x2caf('0x1'));var BPromise=require('bluebird');var rp=require(_0x2caf('0x2'));var fs=require('fs');var path=require(_0x2caf('0x3'));var rimraf=require('rimraf');var config=require(_0x2caf('0x4'));var shared=require(_0x2caf('0x5'));var attributes=require(_0x2caf('0x6'));module['exports']=function(_0x233483,_0x46ebd9){return _0x233483['define'](_0x2caf('0x7'),attributes,{'tableName':_0x2caf('0x8'),'paranoid':!![],'indexes':[{'name':_0x2caf('0x9'),'fields':[_0x2caf('0x9')]},{'name':_0x2caf('0xa'),'fields':[_0x2caf('0xb'),_0x2caf('0xc'),'phone',_0x2caf('0xd'),_0x2caf('0xe'),_0x2caf('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x2caf('0x10'),'hooks':{'afterCreate':function(_0xc728f,_0x1d8eb8,_0x3d2136){var _0xc19073=_0x233483[_0x2caf('0x11')];var _0x32c225=_0xc728f[_0x2caf('0x12')]({'plain':!![]});function _0x1f9b13(){return function(_0x4a9776){logger[_0x2caf('0x13')](_0x2caf('0x14'),_0x2caf('0x15'),util[_0x2caf('0x16')](_0x4a9776,{'showHidden':![],'depth':null}));};}function _0x304a26(_0x59b514,_0x1a110f){var _0x2e1b13=_0x1a110f[_0x2caf('0x17')]?_0x1a110f[_0x2caf('0x17')]:moment()['format'](_0x2caf('0x18'));return new BPromise(function(_0x22d039,_0x29b53d){if(_[_0x2caf('0x19')](_0x1a110f[_0x2caf('0x1a')])){_0x22d039({'ret':_0x2e1b13});}else{_0xc19073['VoiceQueue'][_0x2caf('0x1b')]({'where':{'id':_0x59b514['id']}})[_0x2caf('0x1c')](function(_0x3c23c9){if(!_[_0x2caf('0x19')](_0x3c23c9)){var _0x2e5ca2=_0x3c23c9[_0x2caf('0x1a')];if(!_[_0x2caf('0x19')](_0x2e5ca2)){var _0x513334=shared[_0x2caf('0x1d')];var _0x619bd3=_0x513334[_0x2e5ca2];var _0x5f48d9=_0x513334[_0x1a110f[_0x2caf('0x1a')]];if(!_[_0x2caf('0x19')](_0x619bd3)&&!_[_0x2caf('0x19')](_0x5f48d9)){var _0x2ef5f8=_0x619bd3[_0x2caf('0x1e')]-_0x5f48d9[_0x2caf('0x1e')];_0x2e1b13=_0x1a110f[_0x2caf('0x17')]?_0x1a110f['scheduledat']:moment();var _0x4037b2=moment(_0x2e1b13)[_0x2caf('0x1f')](_0x2ef5f8,_0x2caf('0x20'));_0x22d039({'ret':_0x4037b2[_0x2caf('0x21')](_0x2caf('0x18'))});}else _0x22d039({'ret':_0x2e1b13});}else _0x22d039({'ret':_0x2e1b13});}else{_0x22d039({'ret':_0x2e1b13});}});}});return 0xa;}var _0x10f7b8=function(_0x425c77){return new BPromise(function(_0x5df040,_0x489163){_0x304a26(_0x425c77,_0x32c225)[_0x2caf('0x1c')](function(_0x1097cd){_0x32c225[_0x2caf('0x17')]=_0x1097cd[_0x2caf('0x22')];_0xc19073[_0x2caf('0x23')][_0x2caf('0x1b')]({'where':{'phone':_0x32c225[_0x2caf('0x9')],'VoiceQueueId':_0x425c77['id']}})[_0x2caf('0x1c')](function(_0x5854f1){if(!_[_0x2caf('0x19')](_0x5854f1)){throw new Error(_0x2caf('0x24')+_0x32c225[_0x2caf('0x9')]+_0x2caf('0x25')+_0x425c77['id']);}return _0xc19073[_0x2caf('0x23')][_0x2caf('0x26')]({'phone':_0x32c225['phone'],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'priority':_0x32c225[_0x2caf('0x28')]?_0x32c225['priority']:0x2,'scheduledat':_0x32c225[_0x2caf('0x17')]?_0x32c225[_0x2caf('0x17')]:moment()[_0x2caf('0x21')](_0x2caf('0x18')),'callback':_0x32c225[_0x2caf('0x29')]?!![]:![],'callbackuniqueid':_0x32c225[_0x2caf('0x29')]?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()[_0x2caf('0x21')](_0x2caf('0x18')):undefined,'VoiceQueueId':_0x425c77['id']});})[_0x2caf('0x2a')](function(_0x6e234){_0x489163(_0x6e234);});});});};var _0x56b7ce=function(_0x527d00){return new BPromise(function(_0x326a4f,_0x16689b){_0x304a26(_0x527d00,_0x32c225)[_0x2caf('0x1c')](function(_0x34bbd1){_0x32c225[_0x2caf('0x17')]=_0x34bbd1[_0x2caf('0x22')];_0xc19073[_0x2caf('0x23')][_0x2caf('0x1b')]({'where':{'phone':_0x32c225[_0x2caf('0x9')],'VoiceQueueId':_0x527d00['id']}})[_0x2caf('0x1c')](function(_0xea5a34){if(!_[_0x2caf('0x19')](_0xea5a34)){throw new Error(_0x2caf('0x24')+_0x32c225['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x527d00['id']);}return _0xc19073[_0x2caf('0x2b')][_0x2caf('0x1b')]({'where':{'calleridnum':_0x32c225[_0x2caf('0x9')],'VoiceQueueId':_0x527d00['id']}});})[_0x2caf('0x1c')](function(_0xae6e18){if(!_[_0x2caf('0x19')](_0xae6e18)){throw new Error(_0x2caf('0x2c')+_0x32c225[_0x2caf('0x9')]+_0x2caf('0x2d')+_0x527d00['id']);}return _0xc19073[_0x2caf('0x23')][_0x2caf('0x26')]({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'priority':_0x32c225[_0x2caf('0x28')]?_0x32c225[_0x2caf('0x28')]:0x2,'scheduledat':_0x32c225[_0x2caf('0x17')]?_0x32c225['scheduledat']:moment()[_0x2caf('0x21')](_0x2caf('0x18')),'callback':_0x32c225[_0x2caf('0x29')]?!![]:![],'callbackuniqueid':_0x32c225[_0x2caf('0x29')]?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()[_0x2caf('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x527d00['id']});})['catch'](function(_0x22960b){_0x16689b(_0x22960b);});});});};function _0xbba8d2(){return function(_0x108fe4){logger[_0x2caf('0x13')](_0x2caf('0x14'),'afterCreate',util[_0x2caf('0x16')](_0x108fe4,{'showHidden':![],'depth':null}));};}function _0x269727(_0x329baf,_0x5eccbf){var _0x5135f6=_0x5eccbf[_0x2caf('0x17')]?_0x5eccbf[_0x2caf('0x17')]:moment()[_0x2caf('0x21')](_0x2caf('0x18'));return new BPromise(function(_0x2a22ea,_0x39be9){if(_['isNil'](_0x5eccbf[_0x2caf('0x1a')])){_0x2a22ea({'ret':_0x5135f6});}else{_0xc19073[_0x2caf('0x2e')]['findOne']({'where':{'id':_0x329baf['id']}})['then'](function(_0x5e579a){if(!_[_0x2caf('0x19')](_0x5e579a)){var _0x13d6e2=_0x5e579a['dialTimezone'];if(!_[_0x2caf('0x19')](_0x13d6e2)){var _0x4bc895=shared[_0x2caf('0x1d')];var _0x1e486d=_0x4bc895[_0x13d6e2];var _0x558b53=_0x4bc895[_0x5eccbf[_0x2caf('0x1a')]];if(!_['isNil'](_0x1e486d)&&!_[_0x2caf('0x19')](_0x558b53)){var _0x44b245=_0x1e486d[_0x2caf('0x1e')]-_0x558b53['utcOffset'];_0x5135f6=_0x5eccbf['scheduledat']?_0x5eccbf[_0x2caf('0x17')]:moment();var _0x1c7e93=moment(_0x5135f6)[_0x2caf('0x1f')](_0x44b245,_0x2caf('0x20'));_0x2a22ea({'ret':_0x1c7e93[_0x2caf('0x21')](_0x2caf('0x18'))});}else _0x2a22ea({'ret':_0x5135f6});}else _0x2a22ea({'ret':_0x5135f6});}else{_0x2a22ea({'ret':_0x5135f6});}});}});return 0xa;}var _0x1e8056=function(_0x36b434){return new BPromise(function(_0x1935fa,_0x17a807){_0x269727(_0x36b434,_0x32c225)[_0x2caf('0x1c')](function(_0x51fd08){_0x32c225[_0x2caf('0x17')]=_0x51fd08[_0x2caf('0x22')];_0xc19073[_0x2caf('0x23')][_0x2caf('0x1b')]({'where':{'phone':_0x32c225[_0x2caf('0x9')],'CampaignId':_0x36b434['id']}})[_0x2caf('0x1c')](function(_0x5d702b){if(!_[_0x2caf('0x19')](_0x5d702b)){throw new Error(_0x2caf('0x24')+_0x32c225[_0x2caf('0x9')]+_0x2caf('0x2f')+_0x36b434['id']);}return _0xc19073[_0x2caf('0x23')]['create']({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'priority':_0x32c225['priority']?_0x32c225['priority']:0x2,'scheduledat':_0x32c225[_0x2caf('0x17')]?_0x32c225[_0x2caf('0x17')]:moment()[_0x2caf('0x21')](_0x2caf('0x18')),'callback':_0x32c225[_0x2caf('0x29')]?!![]:![],'callbackuniqueid':_0x32c225['callbackUniqueid']?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x36b434['id']});})[_0x2caf('0x2a')](function(_0x1d3fb3){_0x17a807(_0x1d3fb3);});});});};var _0x546120=function(_0xf40cb){return new BPromise(function(_0x5ce1ad,_0x223cd4){_0x269727(_0xf40cb,_0x32c225)[_0x2caf('0x1c')](function(_0x350ff6){_0x32c225[_0x2caf('0x17')]=_0x350ff6[_0x2caf('0x22')];_0xc19073[_0x2caf('0x23')][_0x2caf('0x1b')]({'where':{'phone':_0x32c225[_0x2caf('0x9')],'CampaignId':_0xf40cb['id']}})[_0x2caf('0x1c')](function(_0x1dc07e){if(!_[_0x2caf('0x19')](_0x1dc07e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32c225[_0x2caf('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0xf40cb['id']);}return _0xc19073[_0x2caf('0x2b')][_0x2caf('0x1b')]({'where':{'calleridnum':_0x32c225[_0x2caf('0x9')],'CampaignId':_0xf40cb['id']}});})['then'](function(_0x28cf37){if(!_[_0x2caf('0x19')](_0x28cf37)){throw new Error(_0x2caf('0x2c')+_0x32c225[_0x2caf('0x9')]+_0x2caf('0x30')+_0xf40cb['id']);}return _0xc19073['CmHopper'][_0x2caf('0x26')]({'phone':_0x32c225['phone'],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'priority':_0x32c225[_0x2caf('0x28')]?_0x32c225[_0x2caf('0x28')]:0x2,'scheduledat':_0x32c225[_0x2caf('0x17')]?_0x32c225['scheduledat']:moment()[_0x2caf('0x21')](_0x2caf('0x18')),'callback':_0x32c225[_0x2caf('0x29')]?!![]:![],'callbackuniqueid':_0x32c225['callbackUniqueid']?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()[_0x2caf('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xf40cb['id']});})[_0x2caf('0x2a')](function(_0x5301ac){_0x223cd4(_0x5301ac);});});});};if(_0x32c225[_0x2caf('0x27')]){_0xc19073[_0x2caf('0x31')][_0x2caf('0x32')]({'where':{'type':_0x2caf('0x33')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0xc19073[_0x2caf('0x34')],'as':_0x2caf('0x35'),'where':{'id':_0x32c225[_0x2caf('0x27')]}}]})[_0x2caf('0x1c')](function(_0x228318){if(_0x228318){var _0x2823c2=[];for(var _0x2953f5=0x0,_0x9b639a;_0x2953f5<_0x228318[_0x2caf('0x36')];_0x2953f5+=0x1){_0x9b639a=_0x228318[_0x2953f5][_0x2caf('0x12')]({'plain':!![]});switch(_0x9b639a[_0x2caf('0x37')]){case _0x2caf('0x38'):_0x56b7ce(_0x9b639a)[_0x2caf('0x2a')](_0x1f9b13());break;case'onlyIfOpen':_0x10f7b8(_0x9b639a)[_0x2caf('0x2a')](_0x1f9b13());break;default:_0x269727(_0x9b639a,_0x32c225)[_0x2caf('0x1c')](function(_0x4f70b6){_0x32c225[_0x2caf('0x17')]=_0x4f70b6[_0x2caf('0x22')];_0xc19073['CmHopper']['create']({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'scheduledat':_0x32c225[_0x2caf('0x17')]?_0x32c225[_0x2caf('0x17')]:moment()['format'](_0x2caf('0x18')),'priority':_0x32c225['priority']?_0x32c225[_0x2caf('0x28')]:0x2,'callback':_0x32c225['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32c225[_0x2caf('0x29')]?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()[_0x2caf('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x9b639a['id']})['catch'](_0x1f9b13());});}}}})[_0x2caf('0x1c')](function(){return _0xc19073['VoiceQueue'][_0x2caf('0x32')]({'where':{'type':_0x2caf('0x33')},'attributes':['id'],'include':[{'model':_0xc19073[_0x2caf('0x34')],'as':_0x2caf('0x39'),'where':{'id':_0x32c225['ListId']}}]})['then'](function(_0x51e8ad){if(_0x51e8ad){var _0x2b7bbe=[];for(var _0x31827a=0x0,_0x3ab8d3;_0x31827a<_0x51e8ad[_0x2caf('0x36')];_0x31827a+=0x1){_0x3ab8d3=_0x51e8ad[_0x31827a][_0x2caf('0x12')]({'plain':!![]});_0xc19073[_0x2caf('0x3a')][_0x2caf('0x26')]({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'VoiceQueueId':_0x3ab8d3['id']})[_0x2caf('0x2a')](function(_0x58f50c){logger[_0x2caf('0x13')](_0x2caf('0x3b'),_0x2caf('0x15'),_0x58f50c[_0x2caf('0x3c')]);});}}});})[_0x2caf('0x1c')](function(){return _0xc19073[_0x2caf('0x2e')][_0x2caf('0x32')]({'attributes':['id',_0x2caf('0x37'),_0x2caf('0x1a')],'include':[{'model':_0xc19073[_0x2caf('0x34')],'as':'Lists','where':{'id':_0x32c225[_0x2caf('0x27')]}}]})['then'](function(_0x15a539){if(_0x15a539){var _0xb47c88=[];for(var _0x2e32f3=0x0,_0x336db9;_0x2e32f3<_0x15a539[_0x2caf('0x36')];_0x2e32f3+=0x1){_0x336db9=_0x15a539[_0x2e32f3][_0x2caf('0x12')]({'plain':!![]});switch(_0x336db9[_0x2caf('0x37')]){case _0x2caf('0x38'):_0x546120(_0x336db9)['catch'](_0xbba8d2());break;case'onlyIfOpen':_0x1e8056(_0x336db9)[_0x2caf('0x2a')](_0xbba8d2());break;default:_0xc19073['CmHopper'][_0x2caf('0x26')]({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225[_0x2caf('0x27')],'scheduledat':_0x32c225['scheduledat']?_0x32c225[_0x2caf('0x17')]:moment()[_0x2caf('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x32c225[_0x2caf('0x28')]?_0x32c225[_0x2caf('0x28')]:0x2,'callback':_0x32c225[_0x2caf('0x29')]?!![]:![],'callbackuniqueid':_0x32c225[_0x2caf('0x29')]?_0x32c225[_0x2caf('0x29')]:undefined,'callbackat':_0x32c225[_0x2caf('0x29')]?moment()['format'](_0x2caf('0x18')):undefined,'CampaignId':_0x336db9['id']})['catch'](_0xbba8d2());}}}});})['then'](function(){return _0xc19073[_0x2caf('0x2e')][_0x2caf('0x32')]({'attributes':['id'],'include':[{'model':_0xc19073[_0x2caf('0x34')],'as':_0x2caf('0x39'),'where':{'id':_0x32c225[_0x2caf('0x27')]}}]})['then'](function(_0x1bf094){if(_0x1bf094){var _0x34851f=[];for(var _0x196633=0x0,_0x49fb8d;_0x196633<_0x1bf094[_0x2caf('0x36')];_0x196633+=0x1){_0x49fb8d=_0x1bf094[_0x196633]['get']({'plain':!![]});_0xc19073[_0x2caf('0x3a')][_0x2caf('0x26')]({'phone':_0x32c225[_0x2caf('0x9')],'ContactId':_0x32c225['id'],'ListId':_0x32c225['ListId'],'CampaignId':_0x49fb8d['id']})[_0x2caf('0x2a')](function(_0x36e6a9){logger['error'](_0x2caf('0x3b'),'afterCreate',_0x36e6a9[_0x2caf('0x3c')]);});}}});})[_0x2caf('0x1c')](function(){_0x3d2136();})['catch'](function(_0x14b227){logger[_0x2caf('0x13')](_0x2caf('0x3b'),_0x2caf('0x15'),_0x14b227[_0x2caf('0x3c')]);_0x3d2136(_0x14b227);});}else{_0x3d2136(new Error(_0x2caf('0x3d')));}},'afterDestroy':function(_0x190fa8,_0x1f4a93,_0x1c4a9a){var _0x48c5f0=_0x233483[_0x2caf('0x11')];var _0xc09598=_0x190fa8[_0x2caf('0x12')]({'plain':!![]});return _0x48c5f0[_0x2caf('0x23')][_0x2caf('0x32')]({'raw':!![],'where':{'ListId':_0xc09598[_0x2caf('0x27')],'ContactId':_0xc09598['id']}})['then'](function(_0x14ea31){if(!_['isEmpty'](_0x14ea31)){var _0x18f09f=[];for(var _0x22f548=0x0;_0x22f548<_0x14ea31[_0x2caf('0x36')];_0x22f548+=0x1){var _0xe483e9=_0x48c5f0['CmHopper'][_0x2caf('0x3e')]({'where':{'ListId':_0x14ea31[_0x22f548][_0x2caf('0x27')],'ContactId':_0x14ea31[_0x22f548][_0x2caf('0x3f')],'VoiceQueueId':_0x14ea31[_0x22f548][_0x2caf('0x40')],'CampaignId':_0x14ea31[_0x22f548]['CampaignId']}});_0x18f09f['push'](_0xe483e9);}return BPromise['all'](_0x18f09f);}})['then'](function(_0x4840b2){logger[_0x2caf('0x41')](_0x2caf('0x42'),util[_0x2caf('0x16')](_0x4840b2,{'showHidden':![],'depth':null}));_0x1c4a9a();})[_0x2caf('0x2a')](function(_0x51774e){logger[_0x2caf('0x13')](_0x2caf('0x43'),util[_0x2caf('0x16')](_0x51774e,{'showHidden':![],'depth':null}));_0x1c4a9a(_0x51774e);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 1705669..d0bbd9d 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(_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 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(_0x2b79e3,_0x1aec9c){var _0x3d9d86=function(_0x4a3abe){while(--_0x4a3abe){_0x2b79e3['push'](_0x2b79e3['shift']());}};_0x3d9d86(++_0x1aec9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 4068afb..fb7df94 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 _0x3e25=['sequelize','exports','INTEGER','PHONE','STRING'];(function(_0x3653e7,_0x26c282){var _0x123183=function(_0xeab97f){while(--_0xeab97f){_0x3653e7['push'](_0x3653e7['shift']());}};_0x123183(++_0x26c282);}(_0x3e25,0x14f));var _0x53e2=function(_0x528038,_0x5474b6){_0x528038=_0x528038-0x0;var _0x190ae1=_0x3e25[_0x528038];return _0x190ae1;};'use strict';var Sequelize=require(_0x53e2('0x0'));module[_0x53e2('0x1')]={'CmContactId':{'type':Sequelize[_0x53e2('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x53e2('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x53e2('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x53e2('0x4')],'defaultValue':null}}; \ No newline at end of file +var _0x851e=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x4384f1,_0x289b53){var _0x4b6ae7=function(_0x4e7211){while(--_0x4e7211){_0x4384f1['push'](_0x4384f1['shift']());}};_0x4b6ae7(++_0x289b53);}(_0x851e,0x1e8));var _0xe851=function(_0x1cab41,_0x4bfa57){_0x1cab41=_0x1cab41-0x0;var _0x511deb=_0x851e[_0x1cab41];return _0x511deb;};'use strict';var Sequelize=require(_0xe851('0x0'));module[_0xe851('0x1')]={'CmContactId':{'type':Sequelize[_0xe851('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe851('0x3')],'defaultValue':_0xe851('0x4')},'OrderBy':{'type':Sequelize[_0xe851('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xe851('0x3')],'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 7953090..b44ef83 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 _0x0046=['type','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','then','get','CmContactHasItems','UserProfileResource','destroy','stack','name','send','map','CmContactHasItem','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x4b3b17,_0x1a0000){var _0x1f1bbe=function(_0x4c2326){while(--_0x4c2326){_0x4b3b17['push'](_0x4b3b17['shift']());}};_0x1f1bbe(++_0x1a0000);}(_0x0046,0x17e));var _0x6004=function(_0x2b0171,_0x316c5c){_0x2b0171=_0x2b0171-0x0;var _0x3820ad=_0x0046[_0x2b0171];return _0x3820ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6004('0x0'));var zipdir=require(_0x6004('0x1'));var jsonpatch=require(_0x6004('0x2'));var rp=require('request-promise');var moment=require(_0x6004('0x3'));var BPromise=require(_0x6004('0x4'));var Mustache=require('mustache');var util=require(_0x6004('0x5'));var path=require('path');var sox=require(_0x6004('0x6'));var csv=require(_0x6004('0x7'));var ejs=require(_0x6004('0x8'));var fs=require('fs');var fs_extra=require(_0x6004('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6004('0xa'));var jsforce=require(_0x6004('0xb'));var deskjs=require(_0x6004('0xc'));var toCsv=require(_0x6004('0x7'));var querystring=require(_0x6004('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6004('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6004('0xf'));var hardwareService=require(_0x6004('0x10'));var logger=require('../../config/logger')(_0x6004('0x11'));var utils=require('../../config/utils');var config=require(_0x6004('0x12'));var licenseUtil=require(_0x6004('0x13'));var db=require(_0x6004('0x14'))['db'];function respondWithStatusCode(_0x1e3076,_0x37f66a){_0x37f66a=_0x37f66a||0xcc;return function(_0x37013e){if(_0x37013e){return _0x1e3076[_0x6004('0x15')](_0x37f66a);}return _0x1e3076[_0x6004('0x16')](_0x37f66a)[_0x6004('0x17')]();};}function respondWithResult(_0x1fa0dc,_0x265d53){_0x265d53=_0x265d53||0xc8;return function(_0x8e15ba){if(_0x8e15ba){return _0x1fa0dc[_0x6004('0x16')](_0x265d53)['json'](_0x8e15ba);}};}function respondWithFilteredResult(_0x7dc574,_0x53ecd3){return function(_0x183299){if(_0x183299){var _0x496cbb=typeof _0x53ecd3[_0x6004('0x18')]===_0x6004('0x19')&&typeof _0x53ecd3[_0x6004('0x1a')]===_0x6004('0x19');var _0x2eb4eb=_0x183299[_0x6004('0x1b')];var _0x1b733e=_0x496cbb?0x0:_0x53ecd3[_0x6004('0x18')];var _0x310dac=_0x496cbb?_0x183299[_0x6004('0x1b')]:_0x53ecd3[_0x6004('0x18')]+_0x53ecd3['limit'];var _0x3b8938;if(_0x310dac>=_0x2eb4eb){_0x310dac=_0x2eb4eb;_0x3b8938=0xc8;}else{_0x3b8938=0xce;}_0x7dc574[_0x6004('0x16')](_0x3b8938);return _0x7dc574['set'](_0x6004('0x1c'),_0x1b733e+'-'+_0x310dac+'/'+_0x2eb4eb)['json'](_0x183299);}return null;};}function patchUpdates(_0x1d3c85){return function(_0x40c3ef){try{jsonpatch['apply'](_0x40c3ef,_0x1d3c85,!![]);}catch(_0x1fdbbb){return BPromise[_0x6004('0x1d')](_0x1fdbbb);}return _0x40c3ef['save']();};}function saveUpdates(_0x1d4bc8,_0x5e4238){return function(_0x4889d4){if(_0x4889d4){return _0x4889d4['update'](_0x1d4bc8)[_0x6004('0x1e')](function(_0x38d3b8){return _0x38d3b8;});}return null;};}function removeEntity(_0x1ab055,_0x1870f2){return function(_0x9a8771){if(_0x9a8771){return _0x9a8771['destroy']()['then'](function(){var _0x54d513=_0x9a8771[_0x6004('0x1f')]({'plain':!![]});var _0x42a36c=_0x6004('0x20');return db[_0x6004('0x21')][_0x6004('0x22')]({'where':{'type':_0x42a36c,'resourceId':_0x54d513['id']}})['then'](function(){return _0x9a8771;});})['then'](function(){_0x1ab055[_0x6004('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1a28,_0x5a4417){return function(_0x4f9349){if(!_0x4f9349){_0x3f1a28[_0x6004('0x15')](0x194);}return _0x4f9349;};}function handleError(_0x9061e,_0x3064e6){_0x3064e6=_0x3064e6||0x1f4;return function(_0x35f19b){logger['error'](_0x35f19b[_0x6004('0x23')]);if(_0x35f19b[_0x6004('0x24')]){delete _0x35f19b[_0x6004('0x24')];}_0x9061e[_0x6004('0x16')](_0x3064e6)[_0x6004('0x25')](_0x35f19b);};}exports['index']=function(_0x227239,_0x15413a){var _0x3b8765={},_0x29fcce={},_0x1b65ed={'count':0x0,'rows':[]};var _0x239c48=_[_0x6004('0x26')](db[_0x6004('0x27')]['rawAttributes'],function(_0x114c40){return{'name':_0x114c40['fieldName'],'type':_0x114c40['type'][_0x6004('0x28')]};});_0x29fcce[_0x6004('0x29')]=_[_0x6004('0x26')](_0x239c48,_0x6004('0x24'));_0x29fcce[_0x6004('0x2a')]=_[_0x6004('0x2b')](_0x227239[_0x6004('0x2a')]);_0x29fcce[_0x6004('0x2c')]=_[_0x6004('0x2d')](_0x29fcce[_0x6004('0x29')],_0x29fcce[_0x6004('0x2a')]);_0x3b8765[_0x6004('0x2e')]=_[_0x6004('0x2d')](_0x29fcce[_0x6004('0x29')],qs[_0x6004('0x2f')](_0x227239['query'][_0x6004('0x2f')]));_0x3b8765['attributes']=_0x3b8765[_0x6004('0x2e')][_0x6004('0x30')]?_0x3b8765[_0x6004('0x2e')]:_0x29fcce[_0x6004('0x29')];if(!_0x227239[_0x6004('0x2a')][_0x6004('0x31')]('nolimit')){_0x3b8765[_0x6004('0x1a')]=qs[_0x6004('0x1a')](_0x227239[_0x6004('0x2a')][_0x6004('0x1a')]);_0x3b8765[_0x6004('0x18')]=qs[_0x6004('0x18')](_0x227239[_0x6004('0x2a')][_0x6004('0x18')]);}_0x3b8765[_0x6004('0x32')]=qs['sort'](_0x227239['query'][_0x6004('0x33')]);_0x3b8765[_0x6004('0x34')]=qs[_0x6004('0x2c')](_[_0x6004('0x35')](_0x227239['query'],_0x29fcce['filters']),_0x239c48);if(_0x227239['query'][_0x6004('0x36')]){_0x3b8765[_0x6004('0x34')]=_[_0x6004('0x37')](_0x3b8765[_0x6004('0x34')],{'$or':_[_0x6004('0x26')](_0x239c48,function(_0x327923){if(_0x327923[_0x6004('0x38')]!==_0x6004('0x39')){var _0x28d5f4={};_0x28d5f4[_0x327923[_0x6004('0x24')]]={'$like':'%'+_0x227239[_0x6004('0x2a')]['filter']+'%'};return _0x28d5f4;}})});}_0x3b8765=_[_0x6004('0x37')]({},_0x3b8765,_0x227239['options']);var _0x1d41c8={'where':_0x3b8765[_0x6004('0x34')]};return db['CmContactHasItem'][_0x6004('0x1b')](_0x1d41c8)[_0x6004('0x1e')](function(_0x4ed171){_0x1b65ed[_0x6004('0x1b')]=_0x4ed171;if(_0x227239['query'][_0x6004('0x3a')]){_0x3b8765[_0x6004('0x3b')]=[{'all':!![]}];}return db[_0x6004('0x27')][_0x6004('0x3c')](_0x3b8765);})[_0x6004('0x1e')](function(_0x3ffcf2){_0x1b65ed[_0x6004('0x3d')]=_0x3ffcf2;return _0x1b65ed;})[_0x6004('0x1e')](respondWithFilteredResult(_0x15413a,_0x3b8765))[_0x6004('0x3e')](handleError(_0x15413a,null));};exports['show']=function(_0x322224,_0x16a56e){var _0x10c5c={'raw':!![],'where':{'id':_0x322224[_0x6004('0x3f')]['id']}},_0x17c06b={};_0x17c06b[_0x6004('0x29')]=_[_0x6004('0x2b')](db[_0x6004('0x27')]['rawAttributes']);_0x17c06b[_0x6004('0x2a')]=_[_0x6004('0x2b')](_0x322224[_0x6004('0x2a')]);_0x17c06b['filters']=_[_0x6004('0x2d')](_0x17c06b[_0x6004('0x29')],_0x17c06b[_0x6004('0x2a')]);_0x10c5c['attributes']=_[_0x6004('0x2d')](_0x17c06b['model'],qs['fields'](_0x322224[_0x6004('0x2a')]['fields']));_0x10c5c[_0x6004('0x2e')]=_0x10c5c[_0x6004('0x2e')]['length']?_0x10c5c[_0x6004('0x2e')]:_0x17c06b['model'];if(_0x322224[_0x6004('0x2a')][_0x6004('0x3a')]){_0x10c5c[_0x6004('0x3b')]=[{'all':!![]}];}_0x10c5c=_['merge']({},_0x10c5c,_0x322224['options']);return db[_0x6004('0x27')][_0x6004('0x40')](_0x10c5c)[_0x6004('0x1e')](handleEntityNotFound(_0x16a56e,null))[_0x6004('0x1e')](respondWithResult(_0x16a56e,null))[_0x6004('0x3e')](handleError(_0x16a56e,null));};exports['create']=function(_0x54cde1,_0x4c6dea){return db[_0x6004('0x27')]['create'](_0x54cde1[_0x6004('0x41')],{})[_0x6004('0x1e')](function(_0x1af244){var _0x58cb40=_0x54cde1[_0x6004('0x42')]['get']({'plain':!![]});if(!_0x58cb40)throw new Error(_0x6004('0x43'));if(_0x58cb40[_0x6004('0x44')]==='user'){var _0x39c545=_0x1af244[_0x6004('0x1f')]({'plain':!![]});var _0x4b1dd1='CmContactHasItems';return db[_0x6004('0x45')][_0x6004('0x40')]({'where':{'name':_0x4b1dd1,'userProfileId':_0x58cb40[_0x6004('0x46')]},'raw':!![]})[_0x6004('0x1e')](function(_0x5926ba){if(_0x5926ba&&_0x5926ba['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x39c545[_0x6004('0x24')],'resourceId':_0x39c545['id'],'type':_0x5926ba[_0x6004('0x24')],'sectionId':_0x5926ba['id']},{})['then'](function(){return _0x1af244;});}else{return _0x1af244;}})[_0x6004('0x3e')](function(_0x5b31eb){logger[_0x6004('0x47')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b31eb);throw _0x5b31eb;});}return _0x1af244;})[_0x6004('0x1e')](respondWithResult(_0x4c6dea,0xc9))[_0x6004('0x3e')](handleError(_0x4c6dea,null));};exports[_0x6004('0x48')]=function(_0x58c23b,_0x564e61){if(_0x58c23b[_0x6004('0x41')]['id']){delete _0x58c23b['body']['id'];}return db[_0x6004('0x27')]['find']({'where':{'id':_0x58c23b['params']['id']}})[_0x6004('0x1e')](handleEntityNotFound(_0x564e61,null))[_0x6004('0x1e')](saveUpdates(_0x58c23b['body'],null))['then'](respondWithResult(_0x564e61,null))[_0x6004('0x3e')](handleError(_0x564e61,null));};exports['destroy']=function(_0x67cb1b,_0x414a52){return db[_0x6004('0x27')][_0x6004('0x40')]({'where':{'id':_0x67cb1b[_0x6004('0x3f')]['id']}})['then'](handleEntityNotFound(_0x414a52,null))['then'](removeEntity(_0x414a52,null))[_0x6004('0x3e')](handleError(_0x414a52,null));}; \ No newline at end of file +var _0xef9a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','CmContactHasItems','error','stack','send','index','CmContactHasItem','rawAttributes','fieldName','key','map','name','query','intersection','model','attributes','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','count','include','rows','catch','params','keys','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format'];(function(_0x3cc36e,_0x44e1f4){var _0x3fcb74=function(_0x53c4ad){while(--_0x53c4ad){_0x3cc36e['push'](_0x3cc36e['shift']());}};_0x3fcb74(++_0x44e1f4);}(_0xef9a,0xef));var _0xaef9=function(_0x11cc1e,_0x1f7f10){_0x11cc1e=_0x11cc1e-0x0;var _0xcdadad=_0xef9a[_0x11cc1e];return _0xcdadad;};'use strict';var emlformat=require(_0xaef9('0x0'));var rimraf=require(_0xaef9('0x1'));var zipdir=require(_0xaef9('0x2'));var jsonpatch=require(_0xaef9('0x3'));var rp=require(_0xaef9('0x4'));var moment=require(_0xaef9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaef9('0x6'));var util=require(_0xaef9('0x7'));var path=require(_0xaef9('0x8'));var sox=require(_0xaef9('0x9'));var csv=require(_0xaef9('0xa'));var ejs=require(_0xaef9('0xb'));var fs=require('fs');var fs_extra=require(_0xaef9('0xc'));var _=require(_0xaef9('0xd'));var squel=require(_0xaef9('0xe'));var crypto=require('crypto');var jsforce=require(_0xaef9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaef9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaef9('0x10'));var authService=require(_0xaef9('0x11'));var qs=require(_0xaef9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaef9('0x13'))(_0xaef9('0x14'));var utils=require('../../config/utils');var config=require(_0xaef9('0x15'));var licenseUtil=require(_0xaef9('0x16'));var db=require(_0xaef9('0x17'))['db'];function respondWithStatusCode(_0x1f9901,_0x1aa15f){_0x1aa15f=_0x1aa15f||0xcc;return function(_0x2a3fe5){if(_0x2a3fe5){return _0x1f9901[_0xaef9('0x18')](_0x1aa15f);}return _0x1f9901['status'](_0x1aa15f)[_0xaef9('0x19')]();};}function respondWithResult(_0xf2a067,_0x284665){_0x284665=_0x284665||0xc8;return function(_0x22e887){if(_0x22e887){return _0xf2a067[_0xaef9('0x1a')](_0x284665)[_0xaef9('0x1b')](_0x22e887);}};}function respondWithFilteredResult(_0xd4607c,_0x5eaa7a){return function(_0x6e693e){if(_0x6e693e){var _0x5a8edc=typeof _0x5eaa7a[_0xaef9('0x1c')]===_0xaef9('0x1d')&&typeof _0x5eaa7a[_0xaef9('0x1e')]===_0xaef9('0x1d');var _0x4edda0=_0x6e693e['count'];var _0x3e0ae8=_0x5a8edc?0x0:_0x5eaa7a[_0xaef9('0x1c')];var _0x51d47a=_0x5a8edc?_0x6e693e['count']:_0x5eaa7a[_0xaef9('0x1c')]+_0x5eaa7a[_0xaef9('0x1e')];var _0x14af61;if(_0x51d47a>=_0x4edda0){_0x51d47a=_0x4edda0;_0x14af61=0xc8;}else{_0x14af61=0xce;}_0xd4607c[_0xaef9('0x1a')](_0x14af61);return _0xd4607c[_0xaef9('0x1f')](_0xaef9('0x20'),_0x3e0ae8+'-'+_0x51d47a+'/'+_0x4edda0)[_0xaef9('0x1b')](_0x6e693e);}return null;};}function patchUpdates(_0x2161fd){return function(_0x5c6c79){try{jsonpatch[_0xaef9('0x21')](_0x5c6c79,_0x2161fd,!![]);}catch(_0x1993ca){return BPromise['reject'](_0x1993ca);}return _0x5c6c79['save']();};}function saveUpdates(_0x7a94c,_0x436fc4){return function(_0x4fa8ac){if(_0x4fa8ac){return _0x4fa8ac[_0xaef9('0x22')](_0x7a94c)[_0xaef9('0x23')](function(_0xd51b93){return _0xd51b93;});}return null;};}function removeEntity(_0x3c316e,_0x4182e1){return function(_0x27257a){if(_0x27257a){return _0x27257a[_0xaef9('0x24')]()[_0xaef9('0x23')](function(){var _0x46beb3=_0x27257a[_0xaef9('0x25')]({'plain':!![]});var _0x2a2f87=_0xaef9('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2a2f87,'resourceId':_0x46beb3['id']}})[_0xaef9('0x23')](function(){return _0x27257a;});})[_0xaef9('0x23')](function(){_0x3c316e[_0xaef9('0x1a')](0xcc)[_0xaef9('0x19')]();});}};}function handleEntityNotFound(_0x9ba9d1,_0x18b14f){return function(_0x5e274f){if(!_0x5e274f){_0x9ba9d1[_0xaef9('0x18')](0x194);}return _0x5e274f;};}function handleError(_0x5c41b4,_0x2ff220){_0x2ff220=_0x2ff220||0x1f4;return function(_0x40ce2b){logger[_0xaef9('0x27')](_0x40ce2b[_0xaef9('0x28')]);if(_0x40ce2b['name']){delete _0x40ce2b['name'];}_0x5c41b4[_0xaef9('0x1a')](_0x2ff220)[_0xaef9('0x29')](_0x40ce2b);};}exports[_0xaef9('0x2a')]=function(_0x2b87b4,_0x4e8d0a){var _0x1eaffa={},_0x172cc3={},_0x4cb6ff={'count':0x0,'rows':[]};var _0x2b7c9e=_['map'](db[_0xaef9('0x2b')][_0xaef9('0x2c')],function(_0x28b3b0){return{'name':_0x28b3b0[_0xaef9('0x2d')],'type':_0x28b3b0['type'][_0xaef9('0x2e')]};});_0x172cc3['model']=_[_0xaef9('0x2f')](_0x2b7c9e,_0xaef9('0x30'));_0x172cc3[_0xaef9('0x31')]=_['keys'](_0x2b87b4['query']);_0x172cc3['filters']=_[_0xaef9('0x32')](_0x172cc3[_0xaef9('0x33')],_0x172cc3[_0xaef9('0x31')]);_0x1eaffa[_0xaef9('0x34')]=_[_0xaef9('0x32')](_0x172cc3[_0xaef9('0x33')],qs['fields'](_0x2b87b4[_0xaef9('0x31')]['fields']));_0x1eaffa['attributes']=_0x1eaffa[_0xaef9('0x34')][_0xaef9('0x35')]?_0x1eaffa[_0xaef9('0x34')]:_0x172cc3[_0xaef9('0x33')];if(!_0x2b87b4['query']['hasOwnProperty']('nolimit')){_0x1eaffa[_0xaef9('0x1e')]=qs[_0xaef9('0x1e')](_0x2b87b4[_0xaef9('0x31')][_0xaef9('0x1e')]);_0x1eaffa[_0xaef9('0x1c')]=qs['offset'](_0x2b87b4[_0xaef9('0x31')][_0xaef9('0x1c')]);}_0x1eaffa[_0xaef9('0x36')]=qs[_0xaef9('0x37')](_0x2b87b4[_0xaef9('0x31')][_0xaef9('0x37')]);_0x1eaffa[_0xaef9('0x38')]=qs[_0xaef9('0x39')](_[_0xaef9('0x3a')](_0x2b87b4[_0xaef9('0x31')],_0x172cc3['filters']),_0x2b7c9e);if(_0x2b87b4['query'][_0xaef9('0x3b')]){_0x1eaffa['where']=_[_0xaef9('0x3c')](_0x1eaffa['where'],{'$or':_['map'](_0x2b7c9e,function(_0x583e9b){if(_0x583e9b[_0xaef9('0x3d')]!==_0xaef9('0x3e')){var _0x271284={};_0x271284[_0x583e9b[_0xaef9('0x30')]]={'$like':'%'+_0x2b87b4[_0xaef9('0x31')]['filter']+'%'};return _0x271284;}})});}_0x1eaffa=_['merge']({},_0x1eaffa,_0x2b87b4['options']);var _0x49e337={'where':_0x1eaffa['where']};return db[_0xaef9('0x2b')][_0xaef9('0x3f')](_0x49e337)[_0xaef9('0x23')](function(_0x3b416f){_0x4cb6ff['count']=_0x3b416f;if(_0x2b87b4['query']['includeAll']){_0x1eaffa[_0xaef9('0x40')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x1eaffa);})[_0xaef9('0x23')](function(_0x1dcdee){_0x4cb6ff[_0xaef9('0x41')]=_0x1dcdee;return _0x4cb6ff;})[_0xaef9('0x23')](respondWithFilteredResult(_0x4e8d0a,_0x1eaffa))[_0xaef9('0x42')](handleError(_0x4e8d0a,null));};exports['show']=function(_0xd5cd87,_0x528460){var _0xb0e731={'raw':!![],'where':{'id':_0xd5cd87[_0xaef9('0x43')]['id']}},_0xaedfcc={};_0xaedfcc[_0xaef9('0x33')]=_['keys'](db[_0xaef9('0x2b')][_0xaef9('0x2c')]);_0xaedfcc['query']=_[_0xaef9('0x44')](_0xd5cd87[_0xaef9('0x31')]);_0xaedfcc[_0xaef9('0x39')]=_[_0xaef9('0x32')](_0xaedfcc['model'],_0xaedfcc[_0xaef9('0x31')]);_0xb0e731['attributes']=_[_0xaef9('0x32')](_0xaedfcc['model'],qs[_0xaef9('0x45')](_0xd5cd87[_0xaef9('0x31')]['fields']));_0xb0e731[_0xaef9('0x34')]=_0xb0e731[_0xaef9('0x34')]['length']?_0xb0e731[_0xaef9('0x34')]:_0xaedfcc['model'];if(_0xd5cd87[_0xaef9('0x31')][_0xaef9('0x46')]){_0xb0e731[_0xaef9('0x40')]=[{'all':!![]}];}_0xb0e731=_[_0xaef9('0x3c')]({},_0xb0e731,_0xd5cd87['options']);return db[_0xaef9('0x2b')][_0xaef9('0x47')](_0xb0e731)[_0xaef9('0x23')](handleEntityNotFound(_0x528460,null))[_0xaef9('0x23')](respondWithResult(_0x528460,null))[_0xaef9('0x42')](handleError(_0x528460,null));};exports['create']=function(_0x492b73,_0x241631){return db[_0xaef9('0x2b')][_0xaef9('0x48')](_0x492b73['body'],{})['then'](function(_0x40cfad){var _0x400014=_0x492b73[_0xaef9('0x49')][_0xaef9('0x25')]({'plain':!![]});if(!_0x400014)throw new Error(_0xaef9('0x4a'));if(_0x400014['role']==='user'){var _0x3ba169=_0x40cfad[_0xaef9('0x25')]({'plain':!![]});var _0x3e31d4=_0xaef9('0x26');return db['UserProfileSection'][_0xaef9('0x47')]({'where':{'name':_0x3e31d4,'userProfileId':_0x400014[_0xaef9('0x4b')]},'raw':!![]})[_0xaef9('0x23')](function(_0x38b3ce){if(_0x38b3ce&&_0x38b3ce[_0xaef9('0x4c')]===0x0){return db[_0xaef9('0x4d')]['create']({'name':_0x3ba169[_0xaef9('0x30')],'resourceId':_0x3ba169['id'],'type':_0x38b3ce[_0xaef9('0x30')],'sectionId':_0x38b3ce['id']},{})[_0xaef9('0x23')](function(){return _0x40cfad;});}else{return _0x40cfad;}})['catch'](function(_0x2c3f73){logger[_0xaef9('0x27')](_0xaef9('0x4e'),_0x2c3f73);throw _0x2c3f73;});}return _0x40cfad;})['then'](respondWithResult(_0x241631,0xc9))[_0xaef9('0x42')](handleError(_0x241631,null));};exports[_0xaef9('0x22')]=function(_0x352287,_0x549a85){if(_0x352287[_0xaef9('0x4f')]['id']){delete _0x352287[_0xaef9('0x4f')]['id'];}return db[_0xaef9('0x2b')][_0xaef9('0x47')]({'where':{'id':_0x352287[_0xaef9('0x43')]['id']}})[_0xaef9('0x23')](handleEntityNotFound(_0x549a85,null))[_0xaef9('0x23')](saveUpdates(_0x352287['body'],null))['then'](respondWithResult(_0x549a85,null))['catch'](handleError(_0x549a85,null));};exports[_0xaef9('0x24')]=function(_0x5aaccd,_0x10a3ed){return db[_0xaef9('0x2b')]['find']({'where':{'id':_0x5aaccd[_0xaef9('0x43')]['id']}})['then'](handleEntityNotFound(_0x10a3ed,null))[_0xaef9('0x23')](removeEntity(_0x10a3ed,null))[_0xaef9('0x42')](handleError(_0x10a3ed,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index d247633..ebb0d9d 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 _0xc942=['exports','cm_contact_has_items','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f5fdf,_0x2e563a){var _0x2f1cc7=function(_0x15e786){while(--_0x15e786){_0x4f5fdf['push'](_0x4f5fdf['shift']());}};_0x2f1cc7(++_0x2e563a);}(_0xc942,0x14f));var _0x2c94=function(_0x6080ae,_0x566f1b){_0x6080ae=_0x6080ae-0x0;var _0x3d568b=_0xc942[_0x6080ae];return _0x3d568b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c94('0x0'))('api');var moment=require(_0x2c94('0x1'));var BPromise=require(_0x2c94('0x2'));var rp=require(_0x2c94('0x3'));var fs=require('fs');var path=require(_0x2c94('0x4'));var rimraf=require(_0x2c94('0x5'));var config=require(_0x2c94('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x2c94('0x7')]=function(_0x3e7fc9,_0x346c87){return _0x3e7fc9['define']('CmContactHasItem',attributes,{'tableName':_0x2c94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x633e=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items'];(function(_0x5ed388,_0x19a555){var _0x301e3=function(_0x266894){while(--_0x266894){_0x5ed388['push'](_0x5ed388['shift']());}};_0x301e3(++_0x19a555);}(_0x633e,0x197));var _0xe633=function(_0x58ffcb,_0x5d8e7a){_0x58ffcb=_0x58ffcb-0x0;var _0x4ebe88=_0x633e[_0x58ffcb];return _0x4ebe88;};'use strict';var _=require(_0xe633('0x0'));var util=require(_0xe633('0x1'));var logger=require(_0xe633('0x2'))('api');var moment=require(_0xe633('0x3'));var BPromise=require('bluebird');var rp=require(_0xe633('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe633('0x5'));var config=require(_0xe633('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0xe633('0x7')]=function(_0xe6e05b,_0x13ed01){return _0xe6e05b[_0xe633('0x8')](_0xe633('0x9'),attributes,{'tableName':_0xe633('0xa'),'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 24ba0d4..c08b07c 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 _0x2b8e=['client','http','request','info','request\x20sent','debug','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1782f4,_0x221f66){var _0x305f6f=function(_0x46c8bd){while(--_0x46c8bd){_0x1782f4['push'](_0x1782f4['shift']());}};_0x305f6f(++_0x221f66);}(_0x2b8e,0x124));var _0xe2b8=function(_0x59f76e,_0x2756bd){_0x59f76e=_0x59f76e-0x0;var _0x3a5181=_0x2b8e[_0x59f76e];return _0x3a5181;};'use strict';var _=require(_0xe2b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe2b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2b8('0x2'));var db=require(_0xe2b8('0x3'))['db'];var utils=require(_0xe2b8('0x4'));var logger=require(_0xe2b8('0x5'))(_0xe2b8('0x6'));var config=require('../../config/environment');var jayson=require(_0xe2b8('0x7'));var client=jayson[_0xe2b8('0x8')][_0xe2b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x494d91,_0x3fd403,_0x4259ca){return new BPromise(function(_0xa3b703,_0x15d202){return client[_0xe2b8('0xa')](_0x494d91,_0x4259ca)['then'](function(_0xd2bd11){logger[_0xe2b8('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x3fd403,_0xe2b8('0xc'));logger[_0xe2b8('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3fd403,_0xe2b8('0xc'),JSON[_0xe2b8('0xe')](_0xd2bd11));if(_0xd2bd11[_0xe2b8('0xf')]){if(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x10')]===0x1f4){logger[_0xe2b8('0xf')](_0xe2b8('0x11'),_0x3fd403,_0xd2bd11[_0xe2b8('0xf')]['message']);return _0x15d202(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x12')]);}logger[_0xe2b8('0xf')](_0xe2b8('0x11'),_0x3fd403,_0xd2bd11['error'][_0xe2b8('0x12')]);return _0xa3b703(_0xd2bd11[_0xe2b8('0xf')][_0xe2b8('0x12')]);}else{logger[_0xe2b8('0xb')](_0xe2b8('0x11'),_0x3fd403,_0xe2b8('0xc'));_0xa3b703(_0xd2bd11[_0xe2b8('0x13')][_0xe2b8('0x12')]);}})['catch'](function(_0x568238){logger['error'](_0xe2b8('0x11'),_0x3fd403,_0x568238);_0x15d202(_0x568238);});});} \ No newline at end of file +var _0xd4f3=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x546805,_0x1344a4){var _0x510e81=function(_0x59d0f){while(--_0x59d0f){_0x546805['push'](_0x546805['shift']());}};_0x510e81(++_0x1344a4);}(_0xd4f3,0x1e5));var _0x3d4f=function(_0x2205fb,_0x2421dd){_0x2205fb=_0x2205fb-0x0;var _0x256cbb=_0xd4f3[_0x2205fb];return _0x256cbb;};'use strict';var _=require(_0x3d4f('0x0'));var util=require(_0x3d4f('0x1'));var moment=require(_0x3d4f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d4f('0x3'));var fs=require('fs');var Redis=require(_0x3d4f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d4f('0x5'));var logger=require(_0x3d4f('0x6'))(_0x3d4f('0x7'));var config=require(_0x3d4f('0x8'));var jayson=require(_0x3d4f('0x9'));var client=jayson[_0x3d4f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1040f4,_0x32c5bc,_0x3fa893){return new BPromise(function(_0x394b96,_0x46fe09){return client[_0x3d4f('0xb')](_0x1040f4,_0x3fa893)[_0x3d4f('0xc')](function(_0x475a78){logger['info'](_0x3d4f('0xd'),_0x32c5bc,_0x3d4f('0xe'));logger[_0x3d4f('0xf')](_0x3d4f('0x10'),_0x32c5bc,'request\x20sent',JSON[_0x3d4f('0x11')](_0x475a78));if(_0x475a78[_0x3d4f('0x12')]){if(_0x475a78[_0x3d4f('0x12')][_0x3d4f('0x13')]===0x1f4){logger[_0x3d4f('0x12')](_0x3d4f('0xd'),_0x32c5bc,_0x475a78['error'][_0x3d4f('0x14')]);return _0x46fe09(_0x475a78[_0x3d4f('0x12')][_0x3d4f('0x14')]);}logger[_0x3d4f('0x12')](_0x3d4f('0xd'),_0x32c5bc,_0x475a78['error'][_0x3d4f('0x14')]);return _0x394b96(_0x475a78[_0x3d4f('0x12')][_0x3d4f('0x14')]);}else{logger[_0x3d4f('0x15')](_0x3d4f('0xd'),_0x32c5bc,'request\x20sent');_0x394b96(_0x475a78[_0x3d4f('0x16')][_0x3d4f('0x14')]);}})[_0x3d4f('0x17')](function(_0x41440a){logger[_0x3d4f('0x12')](_0x3d4f('0xd'),_0x32c5bc,_0x41440a);_0x46fe09(_0x41440a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index fb12488..5fabb9d 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 _0x2a84=['../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4981b3,_0x236e0f){var _0x578d72=function(_0xb750){while(--_0xb750){_0x4981b3['push'](_0x4981b3['shift']());}};_0x578d72(++_0x236e0f);}(_0x2a84,0x170));var _0x42a8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a84[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x42a8('0x0'));var util=require(_0x42a8('0x1'));var path=require('path');var timeout=require(_0x42a8('0x2'));var express=require(_0x42a8('0x3'));var router=express[_0x42a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42a8('0x6'));var controller=require(_0x42a8('0x7'));router[_0x42a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x42a8('0x9')]);router['get'](_0x42a8('0xa'),auth[_0x42a8('0xb')](),controller['show']);router[_0x42a8('0xc')]('/',auth[_0x42a8('0xb')](),controller['create']);router[_0x42a8('0xd')](_0x42a8('0xa'),auth['isAuthenticated'](),controller[_0x42a8('0xe')]);router[_0x42a8('0xf')](_0x42a8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x42a8('0x10')]=router; \ No newline at end of file +var _0xa8c8=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show'];(function(_0x30f2b5,_0x3858d0){var _0x3df69d=function(_0x5d7cc2){while(--_0x5d7cc2){_0x30f2b5['push'](_0x30f2b5['shift']());}};_0x3df69d(++_0x3858d0);}(_0xa8c8,0x1d2));var _0x8a8c=function(_0x595fb0,_0x46aeb0){_0x595fb0=_0x595fb0-0x0;var _0x5265ea=_0xa8c8[_0x595fb0];return _0x5265ea;};'use strict';var multer=require(_0x8a8c('0x0'));var util=require(_0x8a8c('0x1'));var path=require('path');var timeout=require(_0x8a8c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a8c('0x3'));var config=require(_0x8a8c('0x4'));var controller=require(_0x8a8c('0x5'));router[_0x8a8c('0x6')]('/',auth[_0x8a8c('0x7')](),controller['index']);router[_0x8a8c('0x6')](_0x8a8c('0x8'),auth[_0x8a8c('0x7')](),controller[_0x8a8c('0x9')]);router[_0x8a8c('0xa')]('/',auth['isAuthenticated'](),controller[_0x8a8c('0xb')]);router[_0x8a8c('0xc')]('/:id',auth[_0x8a8c('0x7')](),controller[_0x8a8c('0xd')]);router[_0x8a8c('0xe')](_0x8a8c('0x8'),auth[_0x8a8c('0x7')](),controller[_0x8a8c('0xf')]);module[_0x8a8c('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4d08b69..084c5d0 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 _0xca01=['type','select','parse','values','isArray','stringify','ENUM','voice','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0xf3b644,_0x4165eb){var _0x234768=function(_0xd3cb97){while(--_0xd3cb97){_0xf3b644['push'](_0xf3b644['shift']());}};_0x234768(++_0x4165eb);}(_0xca01,0x138));var _0x1ca0=function(_0x292b93,_0x2dde42){_0x292b93=_0x292b93-0x0;var _0x286a6c=_0xca01[_0x292b93];return _0x286a6c;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x1ca0('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a357f){return this[_0x1ca0('0x1')](_0x1ca0('0x2'));}},'alias':{'type':Sequelize[_0x1ca0('0x3')],'allowNull':![],'set':function(_0x3bd61a){this[_0x1ca0('0x4')](_0x1ca0('0x2'),_0x3bd61a?_0x3bd61a:this[_0x1ca0('0x1')](_0x1ca0('0x5')));}},'type':{'type':Sequelize[_0x1ca0('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x1ca0('0x6')](_0x1ca0('0x7')),'get':function(){if(this[_0x1ca0('0x1')](_0x1ca0('0x8'))===_0x1ca0('0x9')){return JSON[_0x1ca0('0xa')](this[_0x1ca0('0x1')](_0x1ca0('0xb')));}else{return this[_0x1ca0('0x1')]('values');}},'set':function(_0x43f7ad){if(Array[_0x1ca0('0xc')](_0x43f7ad)){this[_0x1ca0('0x4')](_0x1ca0('0xb'),JSON[_0x1ca0('0xd')](_0x43f7ad));}else{this[_0x1ca0('0x4')](_0x1ca0('0xb'),_0x43f7ad);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1ca0('0xe')](_0x1ca0('0xf'))}}; \ No newline at end of file +var _0xa5ea=['values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','getDataValue','STRING','setDataValue','alias','name','TEXT','long','select'];(function(_0x4d94ec,_0x11227e){var _0x4ff8d3=function(_0x53ee31){while(--_0x53ee31){_0x4d94ec['push'](_0x4d94ec['shift']());}};_0x4ff8d3(++_0x11227e);}(_0xa5ea,0xe7));var _0xaa5e=function(_0x2b3784,_0xe9093a){_0x2b3784=_0x2b3784-0x0;var _0x51f6c2=_0xa5ea[_0x2b3784];return _0x51f6c2;};'use strict';var Sequelize=require(_0xaa5e('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1b4271){return this[_0xaa5e('0x1')]('alias');}},'alias':{'type':Sequelize[_0xaa5e('0x2')],'allowNull':![],'set':function(_0x5974c3){this[_0xaa5e('0x3')](_0xaa5e('0x4'),_0x5974c3?_0x5974c3:this['getDataValue'](_0xaa5e('0x5')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xaa5e('0x6')](_0xaa5e('0x7')),'get':function(){if(this['getDataValue']('type')===_0xaa5e('0x8')){return JSON['parse'](this['getDataValue'](_0xaa5e('0x9')));}else{return this['getDataValue']('values');}},'set':function(_0x3e22c4){if(Array[_0xaa5e('0xa')](_0x3e22c4)){this[_0xaa5e('0x3')](_0xaa5e('0x9'),JSON[_0xaa5e('0xb')](_0x3e22c4));}else{this[_0xaa5e('0x3')](_0xaa5e('0x9'),_0x3e22c4);}}},'required':{'type':Sequelize[_0xaa5e('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xaa5e('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xaa5e('0xd')](_0xaa5e('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 87913a6..300e6ac 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 _0x1f1b=['update','then','sendStatus','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','keys','length','body','find','catch','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%d','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f1b,0x1f1));var _0xb1f1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1f1b[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1f1('0x0'));var zipdir=require(_0xb1f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1f1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1f1('0x3'));var util=require(_0xb1f1('0x4'));var path=require(_0xb1f1('0x5'));var sox=require(_0xb1f1('0x6'));var csv=require(_0xb1f1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1f1('0x8'));var _=require(_0xb1f1('0x9'));var squel=require(_0xb1f1('0xa'));var crypto=require(_0xb1f1('0xb'));var jsforce=require(_0xb1f1('0xc'));var deskjs=require(_0xb1f1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb1f1('0xe'));var Papa=require(_0xb1f1('0xf'));var Redis=require(_0xb1f1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb1f1('0x11'));var as=require(_0xb1f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1f1('0x13'))(_0xb1f1('0x14'));var utils=require(_0xb1f1('0x15'));var config=require(_0xb1f1('0x16'));var licenseUtil=require(_0xb1f1('0x17'));var db=require(_0xb1f1('0x18'))['db'];function respondWithStatusCode(_0xd94d9e,_0x38acd3){_0x38acd3=_0x38acd3||0xcc;return function(_0x485e5c){if(_0x485e5c){return _0xd94d9e['sendStatus'](_0x38acd3);}return _0xd94d9e[_0xb1f1('0x19')](_0x38acd3)[_0xb1f1('0x1a')]();};}function respondWithResult(_0x8561a3,_0x48184a){_0x48184a=_0x48184a||0xc8;return function(_0x124781){if(_0x124781){return _0x8561a3[_0xb1f1('0x19')](_0x48184a)[_0xb1f1('0x1b')](_0x124781);}};}function respondWithFilteredResult(_0x391ca9,_0x1d6190){return function(_0x1fec02){if(_0x1fec02){var _0x35941a=typeof _0x1d6190[_0xb1f1('0x1c')]===_0xb1f1('0x1d')&&typeof _0x1d6190[_0xb1f1('0x1e')]==='undefined';var _0x2092bf=_0x1fec02[_0xb1f1('0x1f')];var _0x385cf8=_0x35941a?0x0:_0x1d6190[_0xb1f1('0x1c')];var _0x1dea76=_0x35941a?_0x1fec02[_0xb1f1('0x1f')]:_0x1d6190[_0xb1f1('0x1c')]+_0x1d6190['limit'];var _0x4f3e5d;if(_0x1dea76>=_0x2092bf){_0x1dea76=_0x2092bf;_0x4f3e5d=0xc8;}else{_0x4f3e5d=0xce;}_0x391ca9[_0xb1f1('0x19')](_0x4f3e5d);return _0x391ca9[_0xb1f1('0x20')](_0xb1f1('0x21'),_0x385cf8+'-'+_0x1dea76+'/'+_0x2092bf)['json'](_0x1fec02);}return null;};}function patchUpdates(_0xbfaf3c){return function(_0x2afca3){try{jsonpatch[_0xb1f1('0x22')](_0x2afca3,_0xbfaf3c,!![]);}catch(_0x4fcb80){return BPromise[_0xb1f1('0x23')](_0x4fcb80);}return _0x2afca3[_0xb1f1('0x24')]();};}function saveUpdates(_0x3bb692,_0x37f7c2){return function(_0x29da38){if(_0x29da38){return _0x29da38[_0xb1f1('0x25')](_0x3bb692)[_0xb1f1('0x26')](function(_0x73bf72){return _0x73bf72;});}return null;};}function removeEntity(_0x21efdc,_0x270d70){return function(_0x321ca2){if(_0x321ca2){return _0x321ca2['destroy']()[_0xb1f1('0x26')](function(){_0x21efdc['status'](0xcc)[_0xb1f1('0x1a')]();});}};}function handleEntityNotFound(_0x1cdb07,_0x4fb82a){return function(_0x2cf561){if(!_0x2cf561){_0x1cdb07[_0xb1f1('0x27')](0x194);}return _0x2cf561;};}function handleError(_0x2568ac,_0x2f054e){_0x2f054e=_0x2f054e||0x1f4;return function(_0x44d205){logger[_0xb1f1('0x28')](_0x44d205[_0xb1f1('0x29')]);if(_0x44d205[_0xb1f1('0x2a')]){delete _0x44d205['name'];}_0x2568ac[_0xb1f1('0x19')](_0x2f054e)[_0xb1f1('0x2b')](_0x44d205);};}exports[_0xb1f1('0x2c')]=function(_0x10b788,_0x3e74f5){var _0x3b4891={},_0x1d4d52={},_0x4db82d={'count':0x0,'rows':[]};var _0x32e953=_[_0xb1f1('0x2d')](db[_0xb1f1('0x2e')][_0xb1f1('0x2f')],function(_0x261ad5){return{'name':_0x261ad5[_0xb1f1('0x30')],'type':_0x261ad5[_0xb1f1('0x31')][_0xb1f1('0x32')]};});_0x1d4d52[_0xb1f1('0x33')]=_[_0xb1f1('0x34')](_['map'](_0x32e953,_0xb1f1('0x2a')),[_0xb1f1('0x2a')]);_0x1d4d52[_0xb1f1('0x35')]=_['keys'](_0x10b788['query']);_0x1d4d52[_0xb1f1('0x36')]=_[_0xb1f1('0x37')](_0x1d4d52['model'],_0x1d4d52['query']);_0x3b4891[_0xb1f1('0x38')]=_[_0xb1f1('0x37')](_0x1d4d52[_0xb1f1('0x33')],qs[_0xb1f1('0x39')](_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x39')]));_0x3b4891[_0xb1f1('0x38')]=_0x3b4891['attributes']['length']?_0x3b4891['attributes']:_0x1d4d52['model'];if(!_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x3a')](_0xb1f1('0x3b'))){_0x3b4891[_0xb1f1('0x1e')]=qs[_0xb1f1('0x1e')](_0x10b788['query'][_0xb1f1('0x1e')]);_0x3b4891['offset']=qs['offset'](_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x1c')]);}_0x3b4891[_0xb1f1('0x3c')]=qs[_0xb1f1('0x3d')](_0x10b788['query'][_0xb1f1('0x3d')]);_0x3b4891[_0xb1f1('0x3e')]=qs[_0xb1f1('0x36')](_[_0xb1f1('0x3f')](_0x10b788[_0xb1f1('0x35')],_0x1d4d52['filters']),_0x32e953);if(_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x40')]){_0x3b4891[_0xb1f1('0x3e')]=_[_0xb1f1('0x41')](_0x3b4891[_0xb1f1('0x3e')],{'$or':_[_0xb1f1('0x2d')](_0x32e953,function(_0x35a24a){if(_0x35a24a['type']!=='VIRTUAL'){var _0x3b4f6d={};_0x3b4f6d[_0x35a24a[_0xb1f1('0x2a')]]={'$like':'%'+_0x10b788['query'][_0xb1f1('0x40')]+'%'};return _0x3b4f6d;}})});}_0x3b4891=_['merge']({},_0x3b4891,_0x10b788[_0xb1f1('0x42')]);var _0x163b5e={'where':_0x3b4891[_0xb1f1('0x3e')]};return db[_0xb1f1('0x2e')]['count'](_0x163b5e)['then'](function(_0x199273){_0x4db82d[_0xb1f1('0x1f')]=_0x199273;if(_0x10b788[_0xb1f1('0x35')][_0xb1f1('0x43')]){_0x3b4891[_0xb1f1('0x44')]=[{'all':!![]}];}return db[_0xb1f1('0x2e')][_0xb1f1('0x45')](_0x3b4891);})[_0xb1f1('0x26')](function(_0x243c7d){_0x4db82d[_0xb1f1('0x46')]=_0x243c7d;return _0x4db82d;})[_0xb1f1('0x26')](respondWithFilteredResult(_0x3e74f5,_0x3b4891))['catch'](handleError(_0x3e74f5,null));};exports['show']=function(_0x4c732b,_0x3a2a6b){var _0x11ed09={'raw':!![],'where':{'id':_0x4c732b['params']['id']}},_0x12ffec={};_0x12ffec[_0xb1f1('0x33')]=_['keys'](db[_0xb1f1('0x2e')]['rawAttributes']);_0x12ffec['query']=_[_0xb1f1('0x47')](_0x4c732b[_0xb1f1('0x35')]);_0x12ffec['filters']=_['intersection'](_0x12ffec['model'],_0x12ffec['query']);_0x11ed09[_0xb1f1('0x38')]=_[_0xb1f1('0x37')](_0x12ffec[_0xb1f1('0x33')],qs[_0xb1f1('0x39')](_0x4c732b[_0xb1f1('0x35')][_0xb1f1('0x39')]));_0x11ed09[_0xb1f1('0x38')]=_0x11ed09[_0xb1f1('0x38')][_0xb1f1('0x48')]?_0x11ed09[_0xb1f1('0x38')]:_0x12ffec[_0xb1f1('0x33')];if(_0x4c732b[_0xb1f1('0x35')][_0xb1f1('0x43')]){_0x11ed09[_0xb1f1('0x44')]=[{'all':!![]}];}_0x11ed09=_[_0xb1f1('0x41')]({},_0x11ed09,_0x4c732b[_0xb1f1('0x42')]);return db[_0xb1f1('0x2e')]['find'](_0x11ed09)[_0xb1f1('0x26')](handleEntityNotFound(_0x3a2a6b,null))[_0xb1f1('0x26')](respondWithResult(_0x3a2a6b,null))['catch'](handleError(_0x3a2a6b,null));};exports[_0xb1f1('0x25')]=function(_0x5d206f,_0x36e50f){if(_0x5d206f['body']['id']){delete _0x5d206f[_0xb1f1('0x49')]['id'];}return db[_0xb1f1('0x2e')][_0xb1f1('0x4a')]({'where':{'id':_0x5d206f['params']['id']}})[_0xb1f1('0x26')](handleEntityNotFound(_0x36e50f,null))[_0xb1f1('0x26')](saveUpdates(_0x5d206f['body'],null))[_0xb1f1('0x26')](respondWithResult(_0x36e50f,null))[_0xb1f1('0x4b')](handleError(_0x36e50f,null));};exports['destroy']=function(_0xb8bc01,_0x3a1596){return db['CmCustomField'][_0xb1f1('0x4a')]({'where':{'id':_0xb8bc01['params']['id']}})[_0xb1f1('0x26')](handleEntityNotFound(_0x3a1596,null))[_0xb1f1('0x26')](removeEntity(_0x3a1596,null))[_0xb1f1('0x4b')](handleError(_0x3a1596,null));};exports[_0xb1f1('0x4c')]=function(_0x3b8290,_0xadc23a){var _0x1b58ab;return db[_0xb1f1('0x4d')][_0xb1f1('0x4e')](function(_0x1c122a){return db['CmCustomField'][_0xb1f1('0x4c')](_0x3b8290[_0xb1f1('0x49')],{'transaction':_0x1c122a})['then'](function(_0x357b1c){_0x1b58ab=_0x357b1c;var _0x28a83a={'type':db[_0xb1f1('0x4f')][_0xb1f1('0x50')],'transaction':_0x1c122a};switch(_0x3b8290[_0xb1f1('0x49')]['type']){case _0xb1f1('0x51'):_0x28a83a[_0xb1f1('0x31')]=db[_0xb1f1('0x4f')][_0xb1f1('0x50')];break;case'number':_0x28a83a[_0xb1f1('0x31')]=db['Sequelize'][_0xb1f1('0x52')];break;case _0xb1f1('0x53'):_0x28a83a['type']=db[_0xb1f1('0x4f')][_0xb1f1('0x54')];_0x28a83a[_0xb1f1('0x55')]=![];break;default:}return db[_0xb1f1('0x4d')][_0xb1f1('0x56')]['addColumn'](_0xb1f1('0x57'),util['format'](_0xb1f1('0x58'),_0x1b58ab['id']),_0x28a83a);})[_0xb1f1('0x26')](function(){return _0x1b58ab;});})[_0xb1f1('0x26')](respondWithResult(_0xadc23a,0xc9))['catch'](handleError(_0xadc23a,null));}; \ No newline at end of file +var _0x254c=['sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','find','body','create','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','filters','intersection','fields','attributes','length','nolimit','order'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x254c,0x126));var _0xc254=function(_0xe81067,_0x5000b5){_0xe81067=_0xe81067-0x0;var _0xd31dca=_0x254c[_0xe81067];return _0xd31dca;};'use strict';var emlformat=require(_0xc254('0x0'));var rimraf=require(_0xc254('0x1'));var zipdir=require(_0xc254('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc254('0x3'));var moment=require(_0xc254('0x4'));var BPromise=require(_0xc254('0x5'));var Mustache=require(_0xc254('0x6'));var util=require(_0xc254('0x7'));var path=require('path');var sox=require(_0xc254('0x8'));var csv=require(_0xc254('0x9'));var ejs=require(_0xc254('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc254('0xb'));var squel=require(_0xc254('0xc'));var crypto=require(_0xc254('0xd'));var jsforce=require(_0xc254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc254('0xf'));var authService=require(_0xc254('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc254('0x11'));var logger=require(_0xc254('0x12'))(_0xc254('0x13'));var utils=require(_0xc254('0x14'));var config=require(_0xc254('0x15'));var licenseUtil=require(_0xc254('0x16'));var db=require(_0xc254('0x17'))['db'];function respondWithStatusCode(_0x4010f3,_0x311fc6){_0x311fc6=_0x311fc6||0xcc;return function(_0x1a92cc){if(_0x1a92cc){return _0x4010f3['sendStatus'](_0x311fc6);}return _0x4010f3[_0xc254('0x18')](_0x311fc6)[_0xc254('0x19')]();};}function respondWithResult(_0x48b4bc,_0x385ced){_0x385ced=_0x385ced||0xc8;return function(_0x1857e4){if(_0x1857e4){return _0x48b4bc['status'](_0x385ced)[_0xc254('0x1a')](_0x1857e4);}};}function respondWithFilteredResult(_0x40fb2f,_0x37e387){return function(_0x52894b){if(_0x52894b){var _0x3e80b1=typeof _0x37e387['offset']===_0xc254('0x1b')&&typeof _0x37e387['limit']===_0xc254('0x1b');var _0xd7a4c1=_0x52894b[_0xc254('0x1c')];var _0x2a4d00=_0x3e80b1?0x0:_0x37e387[_0xc254('0x1d')];var _0x560079=_0x3e80b1?_0x52894b[_0xc254('0x1c')]:_0x37e387[_0xc254('0x1d')]+_0x37e387[_0xc254('0x1e')];var _0x52b4e0;if(_0x560079>=_0xd7a4c1){_0x560079=_0xd7a4c1;_0x52b4e0=0xc8;}else{_0x52b4e0=0xce;}_0x40fb2f[_0xc254('0x18')](_0x52b4e0);return _0x40fb2f['set'](_0xc254('0x1f'),_0x2a4d00+'-'+_0x560079+'/'+_0xd7a4c1)['json'](_0x52894b);}return null;};}function patchUpdates(_0x12ca15){return function(_0x370a88){try{jsonpatch[_0xc254('0x20')](_0x370a88,_0x12ca15,!![]);}catch(_0x5b47c3){return BPromise[_0xc254('0x21')](_0x5b47c3);}return _0x370a88[_0xc254('0x22')]();};}function saveUpdates(_0x309528,_0x980be2){return function(_0x189f31){if(_0x189f31){return _0x189f31[_0xc254('0x23')](_0x309528)[_0xc254('0x24')](function(_0x134781){return _0x134781;});}return null;};}function removeEntity(_0x1a0844,_0x5c0cb9){return function(_0xff12b2){if(_0xff12b2){return _0xff12b2[_0xc254('0x25')]()[_0xc254('0x24')](function(){_0x1a0844[_0xc254('0x18')](0xcc)[_0xc254('0x19')]();});}};}function handleEntityNotFound(_0x4cc120,_0x5c9e3e){return function(_0x360c02){if(!_0x360c02){_0x4cc120['sendStatus'](0x194);}return _0x360c02;};}function handleError(_0x48eb16,_0x4d1ed7){_0x4d1ed7=_0x4d1ed7||0x1f4;return function(_0x1b3374){logger[_0xc254('0x26')](_0x1b3374[_0xc254('0x27')]);if(_0x1b3374[_0xc254('0x28')]){delete _0x1b3374[_0xc254('0x28')];}_0x48eb16[_0xc254('0x18')](_0x4d1ed7)[_0xc254('0x29')](_0x1b3374);};}exports[_0xc254('0x2a')]=function(_0x1dfe0c,_0x6ade5c){var _0x4109a4={},_0x9f1014={},_0x1b35be={'count':0x0,'rows':[]};var _0x171b37=_[_0xc254('0x2b')](db[_0xc254('0x2c')][_0xc254('0x2d')],function(_0x7b2b5d){return{'name':_0x7b2b5d['fieldName'],'type':_0x7b2b5d[_0xc254('0x2e')][_0xc254('0x2f')]};});_0x9f1014[_0xc254('0x30')]=_[_0xc254('0x31')](_[_0xc254('0x2b')](_0x171b37,_0xc254('0x28')),[_0xc254('0x28')]);_0x9f1014[_0xc254('0x32')]=_['keys'](_0x1dfe0c[_0xc254('0x32')]);_0x9f1014[_0xc254('0x33')]=_[_0xc254('0x34')](_0x9f1014['model'],_0x9f1014[_0xc254('0x32')]);_0x4109a4['attributes']=_[_0xc254('0x34')](_0x9f1014[_0xc254('0x30')],qs[_0xc254('0x35')](_0x1dfe0c[_0xc254('0x32')][_0xc254('0x35')]));_0x4109a4['attributes']=_0x4109a4[_0xc254('0x36')][_0xc254('0x37')]?_0x4109a4[_0xc254('0x36')]:_0x9f1014[_0xc254('0x30')];if(!_0x1dfe0c['query']['hasOwnProperty'](_0xc254('0x38'))){_0x4109a4['limit']=qs[_0xc254('0x1e')](_0x1dfe0c[_0xc254('0x32')][_0xc254('0x1e')]);_0x4109a4[_0xc254('0x1d')]=qs[_0xc254('0x1d')](_0x1dfe0c[_0xc254('0x32')][_0xc254('0x1d')]);}_0x4109a4[_0xc254('0x39')]=qs['sort'](_0x1dfe0c[_0xc254('0x32')][_0xc254('0x3a')]);_0x4109a4[_0xc254('0x3b')]=qs[_0xc254('0x33')](_[_0xc254('0x3c')](_0x1dfe0c[_0xc254('0x32')],_0x9f1014['filters']),_0x171b37);if(_0x1dfe0c[_0xc254('0x32')][_0xc254('0x3d')]){_0x4109a4['where']=_[_0xc254('0x3e')](_0x4109a4[_0xc254('0x3b')],{'$or':_[_0xc254('0x2b')](_0x171b37,function(_0x2ecce9){if(_0x2ecce9[_0xc254('0x2e')]!==_0xc254('0x3f')){var _0x35fcb6={};_0x35fcb6[_0x2ecce9['name']]={'$like':'%'+_0x1dfe0c[_0xc254('0x32')]['filter']+'%'};return _0x35fcb6;}})});}_0x4109a4=_[_0xc254('0x3e')]({},_0x4109a4,_0x1dfe0c['options']);var _0x4ef118={'where':_0x4109a4[_0xc254('0x3b')]};return db[_0xc254('0x2c')][_0xc254('0x1c')](_0x4ef118)[_0xc254('0x24')](function(_0x4aed9e){_0x1b35be['count']=_0x4aed9e;if(_0x1dfe0c[_0xc254('0x32')][_0xc254('0x40')]){_0x4109a4[_0xc254('0x41')]=[{'all':!![]}];}return db[_0xc254('0x2c')]['findAll'](_0x4109a4);})[_0xc254('0x24')](function(_0x3b7d21){_0x1b35be[_0xc254('0x42')]=_0x3b7d21;return _0x1b35be;})[_0xc254('0x24')](respondWithFilteredResult(_0x6ade5c,_0x4109a4))[_0xc254('0x43')](handleError(_0x6ade5c,null));};exports[_0xc254('0x44')]=function(_0x2386f6,_0x5f76fa){var _0x3c6807={'raw':!![],'where':{'id':_0x2386f6[_0xc254('0x45')]['id']}},_0x4cae73={};_0x4cae73[_0xc254('0x30')]=_['keys'](db[_0xc254('0x2c')][_0xc254('0x2d')]);_0x4cae73[_0xc254('0x32')]=_[_0xc254('0x46')](_0x2386f6['query']);_0x4cae73[_0xc254('0x33')]=_[_0xc254('0x34')](_0x4cae73[_0xc254('0x30')],_0x4cae73['query']);_0x3c6807[_0xc254('0x36')]=_[_0xc254('0x34')](_0x4cae73['model'],qs[_0xc254('0x35')](_0x2386f6[_0xc254('0x32')][_0xc254('0x35')]));_0x3c6807['attributes']=_0x3c6807[_0xc254('0x36')][_0xc254('0x37')]?_0x3c6807[_0xc254('0x36')]:_0x4cae73['model'];if(_0x2386f6['query']['includeAll']){_0x3c6807[_0xc254('0x41')]=[{'all':!![]}];}_0x3c6807=_[_0xc254('0x3e')]({},_0x3c6807,_0x2386f6['options']);return db[_0xc254('0x2c')][_0xc254('0x47')](_0x3c6807)[_0xc254('0x24')](handleEntityNotFound(_0x5f76fa,null))[_0xc254('0x24')](respondWithResult(_0x5f76fa,null))['catch'](handleError(_0x5f76fa,null));};exports[_0xc254('0x23')]=function(_0x410d4c,_0x48d66f){if(_0x410d4c[_0xc254('0x48')]['id']){delete _0x410d4c[_0xc254('0x48')]['id'];}return db[_0xc254('0x2c')][_0xc254('0x47')]({'where':{'id':_0x410d4c['params']['id']}})[_0xc254('0x24')](handleEntityNotFound(_0x48d66f,null))['then'](saveUpdates(_0x410d4c[_0xc254('0x48')],null))[_0xc254('0x24')](respondWithResult(_0x48d66f,null))['catch'](handleError(_0x48d66f,null));};exports[_0xc254('0x25')]=function(_0x5e03d9,_0x3d4977){return db[_0xc254('0x2c')][_0xc254('0x47')]({'where':{'id':_0x5e03d9[_0xc254('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d4977,null))[_0xc254('0x24')](removeEntity(_0x3d4977,null))['catch'](handleError(_0x3d4977,null));};exports[_0xc254('0x49')]=function(_0xe18dbc,_0x24c053){var _0xacc00f;return db['sequelize'][_0xc254('0x4a')](function(_0x320749){return db[_0xc254('0x2c')][_0xc254('0x49')](_0xe18dbc[_0xc254('0x48')],{'transaction':_0x320749})[_0xc254('0x24')](function(_0x498bcf){_0xacc00f=_0x498bcf;var _0x280f1e={'type':db[_0xc254('0x4b')]['TEXT'],'transaction':_0x320749};switch(_0xe18dbc[_0xc254('0x48')][_0xc254('0x2e')]){case _0xc254('0x4c'):_0x280f1e[_0xc254('0x2e')]=db[_0xc254('0x4b')][_0xc254('0x4d')];break;case _0xc254('0x4e'):_0x280f1e[_0xc254('0x2e')]=db[_0xc254('0x4b')][_0xc254('0x4f')];break;case _0xc254('0x50'):_0x280f1e[_0xc254('0x2e')]=db[_0xc254('0x4b')][_0xc254('0x51')];_0x280f1e[_0xc254('0x52')]=![];break;default:}return db[_0xc254('0x53')][_0xc254('0x54')][_0xc254('0x55')]('cm_contacts',util[_0xc254('0x56')](_0xc254('0x57'),_0xacc00f['id']),_0x280f1e);})[_0xc254('0x24')](function(){return _0xacc00f;});})[_0xc254('0x24')](respondWithResult(_0x24c053,0xc9))[_0xc254('0x43')](handleError(_0x24c053,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d2b9c3d..c8bb3c9 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 _0x1c1d=['./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util','moment','rimraf'];(function(_0x3c9da7,_0x355469){var _0x157f66=function(_0x4ec6ab){while(--_0x4ec6ab){_0x3c9da7['push'](_0x3c9da7['shift']());}};_0x157f66(++_0x355469);}(_0x1c1d,0x176));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1c1('0x0'));var util=require(_0xd1c1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd1c1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd1c1('0x3'));var config=require('../../config/environment');var attributes=require(_0xd1c1('0x4'));module['exports']=function(_0x32466b,_0xc090fb){return _0x32466b['define'](_0xd1c1('0x5'),attributes,{'tableName':_0xd1c1('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf4b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x589e87,_0x2881b5){var _0x264a6e=function(_0x463bca){while(--_0x463bca){_0x589e87['push'](_0x589e87['shift']());}};_0x264a6e(++_0x2881b5);}(_0xcf4b,0x1a3));var _0xbcf4=function(_0x3a4a79,_0x161079){_0x3a4a79=_0x3a4a79-0x0;var _0x1ee2ec=_0xcf4b[_0x3a4a79];return _0x1ee2ec;};'use strict';var _=require(_0xbcf4('0x0'));var util=require(_0xbcf4('0x1'));var logger=require(_0xbcf4('0x2'))(_0xbcf4('0x3'));var moment=require(_0xbcf4('0x4'));var BPromise=require(_0xbcf4('0x5'));var rp=require(_0xbcf4('0x6'));var fs=require('fs');var path=require(_0xbcf4('0x7'));var rimraf=require(_0xbcf4('0x8'));var config=require(_0xbcf4('0x9'));var attributes=require(_0xbcf4('0xa'));module[_0xbcf4('0xb')]=function(_0x23a38b,_0x550a85){return _0x23a38b[_0xbcf4('0xc')](_0xbcf4('0xd'),attributes,{'tableName':_0xbcf4('0xe'),'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 740a845..8a19284 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 _0x6dd1=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c0d15,_0x27303b){var _0x21b633=function(_0x2373d2){while(--_0x2373d2){_0x3c0d15['push'](_0x3c0d15['shift']());}};_0x21b633(++_0x27303b);}(_0x6dd1,0x194));var _0x16dd=function(_0x1d62ee,_0x1f2fbc){_0x1d62ee=_0x1d62ee-0x0;var _0x82f1da=_0x6dd1[_0x1d62ee];return _0x82f1da;};'use strict';var _=require(_0x16dd('0x0'));var util=require(_0x16dd('0x1'));var moment=require('moment');var BPromise=require(_0x16dd('0x2'));var rs=require(_0x16dd('0x3'));var fs=require('fs');var Redis=require(_0x16dd('0x4'));var db=require(_0x16dd('0x5'))['db'];var utils=require(_0x16dd('0x6'));var logger=require(_0x16dd('0x7'))(_0x16dd('0x8'));var config=require(_0x16dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x16dd('0xa')][_0x16dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dddfe,_0x542b92,_0x3aa903){return new BPromise(function(_0x4b047e,_0x2653b9){return client[_0x16dd('0xc')](_0x1dddfe,_0x3aa903)[_0x16dd('0xd')](function(_0x9a4289){logger['info'](_0x16dd('0xe'),_0x542b92,_0x16dd('0xf'));logger[_0x16dd('0x10')](_0x16dd('0x11'),_0x542b92,_0x16dd('0xf'),JSON[_0x16dd('0x12')](_0x9a4289));if(_0x9a4289[_0x16dd('0x13')]){if(_0x9a4289[_0x16dd('0x13')][_0x16dd('0x14')]===0x1f4){logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0x9a4289['error'][_0x16dd('0x15')]);return _0x2653b9(_0x9a4289['error'][_0x16dd('0x15')]);}logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0x9a4289[_0x16dd('0x13')][_0x16dd('0x15')]);return _0x4b047e(_0x9a4289[_0x16dd('0x13')]['message']);}else{logger[_0x16dd('0x16')]('CmCustomField,\x20%s,\x20%s',_0x542b92,_0x16dd('0xf'));_0x4b047e(_0x9a4289[_0x16dd('0x17')]['message']);}})[_0x16dd('0x18')](function(_0xe0fd22){logger[_0x16dd('0x13')](_0x16dd('0xe'),_0x542b92,_0xe0fd22);_0x2653b9(_0xe0fd22);});});} \ No newline at end of file +var _0x0dfa=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x573a29,_0x4753c8){var _0x36201f=function(_0x4bd7d3){while(--_0x4bd7d3){_0x573a29['push'](_0x573a29['shift']());}};_0x36201f(++_0x4753c8);}(_0x0dfa,0x170));var _0xa0df=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0dfa[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xa0df('0x0'));var util=require(_0xa0df('0x1'));var moment=require('moment');var BPromise=require(_0xa0df('0x2'));var rs=require(_0xa0df('0x3'));var fs=require('fs');var Redis=require(_0xa0df('0x4'));var db=require(_0xa0df('0x5'))['db'];var utils=require(_0xa0df('0x6'));var logger=require(_0xa0df('0x7'))(_0xa0df('0x8'));var config=require(_0xa0df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa0df('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407cf7,_0x11cd10,_0x4227b9){return new BPromise(function(_0x408d90,_0x2175d1){return client[_0xa0df('0xb')](_0x407cf7,_0x4227b9)[_0xa0df('0xc')](function(_0x3b6c03){logger[_0xa0df('0xd')](_0xa0df('0xe'),_0x11cd10,'request\x20sent');logger['debug'](_0xa0df('0xf'),_0x11cd10,'request\x20sent',JSON['stringify'](_0x3b6c03));if(_0x3b6c03['error']){if(_0x3b6c03[_0xa0df('0x10')][_0xa0df('0x11')]===0x1f4){logger['error'](_0xa0df('0xe'),_0x11cd10,_0x3b6c03[_0xa0df('0x10')][_0xa0df('0x12')]);return _0x2175d1(_0x3b6c03[_0xa0df('0x10')][_0xa0df('0x12')]);}logger[_0xa0df('0x10')](_0xa0df('0xe'),_0x11cd10,_0x3b6c03[_0xa0df('0x10')]['message']);return _0x408d90(_0x3b6c03[_0xa0df('0x10')][_0xa0df('0x12')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x11cd10,_0xa0df('0x13'));_0x408d90(_0x3b6c03[_0xa0df('0x14')][_0xa0df('0x12')]);}})[_0xa0df('0x15')](function(_0x1307b5){logger[_0xa0df('0x10')]('CmCustomField,\x20%s,\x20%s',_0x11cd10,_0x1307b5);_0x2175d1(_0x1307b5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 5d9961f..327c8c9 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 _0xe4d4=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0xe4d4,0x184));var _0x4e4d=function(_0xe132b0,_0x963b2){_0xe132b0=_0xe132b0-0x0;var _0x4868f3=_0xe4d4[_0xe132b0];return _0x4868f3;};'use strict';var multer=require(_0x4e4d('0x0'));var util=require(_0x4e4d('0x1'));var path=require(_0x4e4d('0x2'));var timeout=require(_0x4e4d('0x3'));var express=require('express');var router=express[_0x4e4d('0x4')]();var fs_extra=require(_0x4e4d('0x5'));var auth=require(_0x4e4d('0x6'));var interaction=require(_0x4e4d('0x7'));var config=require(_0x4e4d('0x8'));var controller=require(_0x4e4d('0x9'));router[_0x4e4d('0xa')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xc')]);router[_0x4e4d('0xa')](_0x4e4d('0xd'),auth[_0x4e4d('0xb')](),controller['show']);router[_0x4e4d('0xe')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xf')]);router[_0x4e4d('0x10')]('/:id',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0x11')]);router[_0x4e4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4e4d('0x13')]);module[_0x4e4d('0x14')]=router; \ No newline at end of file +var _0xb194=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','update','delete'];(function(_0x417612,_0x26de30){var _0x32cb9b=function(_0x2688eb){while(--_0x2688eb){_0x417612['push'](_0x417612['shift']());}};_0x32cb9b(++_0x26de30);}(_0xb194,0x1b2));var _0x4b19=function(_0x34f942,_0x491219){_0x34f942=_0x34f942-0x0;var _0x436530=_0xb194[_0x34f942];return _0x436530;};'use strict';var multer=require(_0x4b19('0x0'));var util=require('util');var path=require(_0x4b19('0x1'));var timeout=require(_0x4b19('0x2'));var express=require(_0x4b19('0x3'));var router=express[_0x4b19('0x4')]();var fs_extra=require(_0x4b19('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var controller=require('./cmCustomField.controller');router[_0x4b19('0x8')]('/',auth['isAuthenticated'](),controller[_0x4b19('0x9')]);router['get'](_0x4b19('0xa'),auth[_0x4b19('0xb')](),controller[_0x4b19('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4b19('0xd')]);router['put'](_0x4b19('0xa'),auth[_0x4b19('0xb')](),controller[_0x4b19('0xe')]);router[_0x4b19('0xf')](_0x4b19('0xa'),auth[_0x4b19('0xb')](),controller[_0x4b19('0x10')]);module[_0x4b19('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index d9f5fc4..df9d3f2 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 _0x0a11=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0a11,0x135));var _0x10a1=function(_0x4a310d,_0x33322d){_0x4a310d=_0x4a310d-0x0;var _0x5eaf36=_0x0a11[_0x4a310d];return _0x5eaf36;};'use strict';var moment=require(_0x10a1('0x0'));var Sequelize=require(_0x10a1('0x1'));module[_0x10a1('0x2')]={'phone':{'type':Sequelize[_0x10a1('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x10a1('0x5')](_0x10a1('0x6'))},'countbusyretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x10a1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x10a1('0x8')]},'priority':{'type':Sequelize[_0x10a1('0x7')](0x2)[_0x10a1('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x10a1('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x10a1('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x10a1('0xa')},'UserId':{'type':Sequelize[_0x10a1('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x10a1('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x10a1('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x10a1('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x10a1('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x10a1('0x8')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xc326=['moment','sequelize','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','DATE','UNSIGNED','BOOLEAN','contactListQueue'];(function(_0x2ed0e6,_0x725ec4){var _0x54a58d=function(_0x30446a){while(--_0x30446a){_0x2ed0e6['push'](_0x2ed0e6['shift']());}};_0x54a58d(++_0x725ec4);}(_0xc326,0x78));var _0x6c32=function(_0x57b08d,_0x3fc95f){_0x57b08d=_0x57b08d-0x0;var _0xa7eb7f=_0xc326[_0x57b08d];return _0xa7eb7f;};'use strict';var moment=require(_0x6c32('0x0'));var Sequelize=require(_0x6c32('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6c32('0x2')](_0x6c32('0x3'))},'countbusyretry':{'type':Sequelize[_0x6c32('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6c32('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6c32('0x6')]},'priority':{'type':Sequelize[_0x6c32('0x4')](0x2)[_0x6c32('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6c32('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6c32('0x4')],'unique':_0x6c32('0x9')},'ListId':{'type':Sequelize[_0x6c32('0x4')],'unique':_0x6c32('0x9')},'UserId':{'type':Sequelize[_0x6c32('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x6c32('0x4')],'unique':_0x6c32('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x6c32('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6c32('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6c32('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6c32('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6c32('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6c32('0x5')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6c32('0x6')],'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 ea96fb1..274f82c 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 _0x56e7=['index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$overlap','$contained','$any','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','dialPreviewAutoRecallMe','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','List','VoiceQueue','dialActive','getPreviewRecall','transaction','CmCompany','Company','CmList','Queue','getOpenContacts','isNumber','json','error','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','undefined','count','offset','limit','set','update','then','sendStatus','stack','name','send'];(function(_0x215c81,_0x5839dc){var _0x848f90=function(_0x322a3f){while(--_0x322a3f){_0x215c81['push'](_0x215c81['shift']());}};_0x848f90(++_0x5839dc);}(_0x56e7,0x7b));var _0x756e=function(_0x5b57c1,_0x5c1b07){_0x5b57c1=_0x5b57c1-0x0;var _0x551c14=_0x56e7[_0x5b57c1];return _0x551c14;};'use strict';var moment=require('moment');var _=require(_0x756e('0x0'));var qs=require(_0x756e('0x1'));var logger=require('../../config/logger')(_0x756e('0x2'));var shared=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];function respondWithResult(_0xb850c9,_0x11ce5f){_0x11ce5f=_0x11ce5f||0xc8;return function(_0x38546a){if(_0x38546a){return _0xb850c9[_0x756e('0x5')](_0x11ce5f)['json'](_0x38546a);}};}function respondWithFilteredResult(_0x3b3b8f,_0x404189){return function(_0x26519d){if(_0x26519d){var _0xcf58ec=typeof _0x404189['offset']===_0x756e('0x6')&&typeof _0x404189['limit']===_0x756e('0x6');var _0x401181=_0x26519d[_0x756e('0x7')];var _0x4738dc=_0xcf58ec?0x0:_0x404189['offset'];var _0x5d5b90=_0xcf58ec?_0x26519d[_0x756e('0x7')]:_0x404189[_0x756e('0x8')]+_0x404189[_0x756e('0x9')];var _0x4c4d7c;if(_0x5d5b90>=_0x401181){_0x5d5b90=_0x401181;_0x4c4d7c=0xc8;}else{_0x4c4d7c=0xce;}_0x3b3b8f[_0x756e('0x5')](_0x4c4d7c);return _0x3b3b8f[_0x756e('0xa')]('Content-Range',_0x4738dc+'-'+_0x5d5b90+'/'+_0x401181)['json'](_0x26519d);}return null;};}function saveUpdates(_0x1b68ef,_0x569e8f){return function(_0x459237){if(_0x459237){return _0x459237[_0x756e('0xb')](_0x1b68ef)[_0x756e('0xc')](function(_0x136052){return _0x136052;});}return null;};}function handleEntityNotFound(_0x252333,_0x4ae32a){return function(_0x4b3660){if(!_0x4b3660){_0x252333[_0x756e('0xd')](0x194);}return _0x4b3660;};}function handleError(_0x11f37b,_0xccccd4){_0xccccd4=_0xccccd4||0x1f4;return function(_0x59956f){logger['error'](_0x59956f[_0x756e('0xe')]);if(_0x59956f[_0x756e('0xf')]){delete _0x59956f[_0x756e('0xf')];}_0x11f37b[_0x756e('0x5')](_0xccccd4)[_0x756e('0x10')](_0x59956f);};}exports[_0x756e('0x11')]=function(_0x124ac0,_0x1a8614){var _0xb17214={},_0x4da91f={},_0x216ffd={'count':0x0,'rows':[]};var _0x47c3c4=_['map'](db[_0x756e('0x12')][_0x756e('0x13')],function(_0x30bc11){return{'name':_0x30bc11[_0x756e('0x14')],'type':_0x30bc11[_0x756e('0x15')][_0x756e('0x16')]};});_0x4da91f[_0x756e('0x17')]=_[_0x756e('0x18')](_0x47c3c4,_0x756e('0xf'));_0x4da91f[_0x756e('0x19')]=_[_0x756e('0x1a')](_0x124ac0[_0x756e('0x19')]);_0x4da91f[_0x756e('0x1b')]=_[_0x756e('0x1c')](_0x4da91f[_0x756e('0x17')],_0x4da91f[_0x756e('0x19')]);_0x4da91f['filters']=_[_0x756e('0x1d')](_0x4da91f['filters'],[_0x756e('0x1e'),_0x756e('0x1f'),_0x756e('0x20'),_0x756e('0x21'),'$lt',_0x756e('0x22'),_0x756e('0x23'),_0x756e('0x24'),'$not',_0x756e('0x25'),_0x756e('0x26'),_0x756e('0x27'),'$notIn',_0x756e('0x28'),_0x756e('0x29'),'$iLike',_0x756e('0x2a'),_0x756e('0x28'),_0x756e('0x2b'),'$contains',_0x756e('0x2c'),_0x756e('0x2d')]);_0xb17214['attributes']=_[_0x756e('0x1c')](_0x4da91f[_0x756e('0x17')],qs['fields'](_0x124ac0[_0x756e('0x19')][_0x756e('0x2e')]));_0xb17214[_0x756e('0x2f')]=_0xb17214[_0x756e('0x2f')][_0x756e('0x30')]?_0xb17214['attributes']:_0x4da91f[_0x756e('0x17')];if(!_0x124ac0['query']['hasOwnProperty'](_0x756e('0x31'))){_0xb17214['limit']=qs[_0x756e('0x9')](_0x124ac0[_0x756e('0x19')][_0x756e('0x9')]);_0xb17214[_0x756e('0x8')]=qs[_0x756e('0x8')](_0x124ac0[_0x756e('0x19')][_0x756e('0x8')]);}_0xb17214[_0x756e('0x32')]=qs[_0x756e('0x33')](_0x124ac0[_0x756e('0x19')][_0x756e('0x33')]);_0xb17214[_0x756e('0x34')]=qs['filters'](_['pick'](_0x124ac0[_0x756e('0x19')],_0x4da91f[_0x756e('0x1b')]),_0x47c3c4);if(_0x124ac0[_0x756e('0x19')][_0x756e('0x35')]){_0xb17214[_0x756e('0x34')]=_[_0x756e('0x36')](_0xb17214[_0x756e('0x34')],{'$or':_['map'](_0x47c3c4,function(_0x5b2b59){if(_0x5b2b59['type']!==_0x756e('0x37')){var _0xa63bf={};_0xa63bf[_0x5b2b59[_0x756e('0xf')]]={'$like':'%'+_0x124ac0['query'][_0x756e('0x35')]+'%'};return _0xa63bf;}})});}_0xb17214=_[_0x756e('0x36')]({},_0xb17214,_0x124ac0['options']);var _0x3ece0f={'where':_0xb17214[_0x756e('0x34')]};return db[_0x756e('0x12')][_0x756e('0x7')](_0x3ece0f)[_0x756e('0xc')](function(_0x26965c){_0x216ffd[_0x756e('0x7')]=_0x26965c;if(_0x124ac0[_0x756e('0x19')]['includeAll']){_0xb17214[_0x756e('0x38')]=[{'all':!![]}];}return db[_0x756e('0x12')][_0x756e('0x39')](_0xb17214);})[_0x756e('0xc')](function(_0x36b7de){_0x216ffd[_0x756e('0x3a')]=_0x36b7de;return _0x216ffd;})[_0x756e('0xc')](respondWithFilteredResult(_0x1a8614,_0xb17214))[_0x756e('0x3b')](handleError(_0x1a8614,null));};exports[_0x756e('0x3c')]=function(_0x64b70d,_0x5bb3bd){var _0x41a100={'raw':!![],'where':{'id':_0x64b70d['params']['id']}},_0x38274c={};_0x38274c[_0x756e('0x17')]=_[_0x756e('0x1a')](db[_0x756e('0x12')]['rawAttributes']);_0x38274c[_0x756e('0x19')]=_[_0x756e('0x1a')](_0x64b70d[_0x756e('0x19')]);_0x38274c['filters']=_[_0x756e('0x1c')](_0x38274c[_0x756e('0x17')],_0x38274c[_0x756e('0x19')]);_0x41a100[_0x756e('0x2f')]=_[_0x756e('0x1c')](_0x38274c[_0x756e('0x17')],qs['fields'](_0x64b70d[_0x756e('0x19')][_0x756e('0x2e')]));_0x41a100['attributes']=_0x41a100[_0x756e('0x2f')][_0x756e('0x30')]?_0x41a100[_0x756e('0x2f')]:_0x38274c[_0x756e('0x17')];if(_0x64b70d[_0x756e('0x19')][_0x756e('0x3d')]){_0x41a100[_0x756e('0x38')]=[{'all':!![]}];}_0x41a100=_[_0x756e('0x36')]({},_0x41a100,_0x64b70d[_0x756e('0x3e')]);return db['CmHopper'][_0x756e('0x3f')](_0x41a100)['then'](handleEntityNotFound(_0x5bb3bd,null))[_0x756e('0xc')](respondWithResult(_0x5bb3bd,null))[_0x756e('0x3b')](handleError(_0x5bb3bd,null));};exports[_0x756e('0x40')]=function(_0x54248c,_0x3fc697){return db[_0x756e('0x12')][_0x756e('0x40')](_0x54248c['body'],{})['then'](respondWithResult(_0x3fc697,0xc9))[_0x756e('0x3b')](handleError(_0x3fc697,null));};exports[_0x756e('0xb')]=function(_0x5a6d3e,_0x499da2){if(_0x5a6d3e[_0x756e('0x41')]['id']){delete _0x5a6d3e[_0x756e('0x41')]['id'];}return db[_0x756e('0x12')]['find']({'where':{'id':_0x5a6d3e[_0x756e('0x42')]['id']}})['then'](handleEntityNotFound(_0x499da2,null))[_0x756e('0xc')](saveUpdates(_0x5a6d3e[_0x756e('0x41')],null))[_0x756e('0xc')](respondWithResult(_0x499da2,null))['catch'](handleError(_0x499da2,null));};exports[_0x756e('0x43')]=function(_0x5224f2,_0x5064a3){return db[_0x756e('0x12')]['describe']()[_0x756e('0xc')](respondWithResult(_0x5064a3,null))[_0x756e('0x3b')](handleError(_0x5064a3,null));};exports[_0x756e('0x44')]=function(_0x2512d3,_0x95061c){var _0x2fb384;var _0x50b86e=_0x2512d3[_0x756e('0x42')]['id'];return db['CmHopper'][_0x756e('0x3f')]({'where':{'id':_0x2512d3['params']['id']}})[_0x756e('0xc')](handleEntityNotFound(_0x95061c,null))['then'](function(_0x2f08d5){if(_0x2f08d5){return _0x2f08d5['destroy']()[_0x756e('0xc')](function(_0x37ddd0){return _0x37ddd0;});}})[_0x756e('0xc')](function(_0x52c976){_0x2fb384=_0x52c976;if(_0x52c976){if(_0x52c976[_0x756e('0x45')]||_0x52c976[_0x756e('0x46')]){return db[_0x52c976['VoiceQueueId']?'VoiceQueue':_0x756e('0x47')][_0x756e('0x3f')]({'where':{'id':_0x52c976[_0x756e('0x45')]?_0x52c976[_0x756e('0x45')]:_0x52c976[_0x756e('0x46')]},'attributes':['id',_0x756e('0xf')],'raw':!![]});}}})[_0x756e('0xc')](function(_0x9e8559){var _0x33f923={};if(_0x9e8559){_['merge'](_0x33f923,_[_0x756e('0x48')](_0x2fb384[_0x756e('0x49')],[_0x756e('0x4a'),_0x756e('0x4b'),'id']));_0x33f923[_0x756e('0x4c')]=0x15;_0x33f923[_0x756e('0x4d')]=_0x756e('0x4e');_0x33f923[_0x756e('0x4f')]=_0x9e8559['name'];_0x33f923[_0x756e('0x50')]=_0x2512d3[_0x756e('0x51')]['name'];_0x33f923[_0x756e('0x52')]=_0x2512d3['user']['id'];_0x33f923[_0x756e('0x4e')]=!![];_0x33f923[_0x756e('0x53')]=moment()[_0x756e('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x33f923[_0x756e('0x55')]=_0x2fb384[_0x756e('0x56')];_0x33f923[_0x756e('0x57')]=_0x2fb384['VoiceQueueId']?_0x756e('0x58'):'ivr';return db[_0x756e('0x59')][_0x756e('0x3f')]({'where':{'id':_0x33f923[_0x756e('0x5a')]},'attributes':[_0x756e('0x5b'),_0x756e('0x5c')]})[_0x756e('0xc')](function(_0x1f0be1){if(!_[_0x756e('0x5d')](_0x95061c)&&!_['isNil'](_0x1f0be1[_0x756e('0x5b')])){_0x33f923[_0x756e('0x5e')]=_0x1f0be1[_0x756e('0x5b')];if(!_[_0x756e('0x5d')](_0x1f0be1[_0x756e('0x5c')])){_0x33f923[_0x756e('0x5e')]+='\x20'+_0x1f0be1[_0x756e('0x5c')];}}})[_0x756e('0x5f')](function(){return db[_0x756e('0x60')][_0x756e('0x40')](_0x33f923);});}})[_0x756e('0xc')](function(_0x176d84){return db[_0x756e('0x61')][_0x756e('0x44')]({'where':{'CmHopperId':_0x50b86e}});})['then'](function(){return _0x95061c[_0x756e('0x5')](0xcc)[_0x756e('0x62')]();})[_0x756e('0x3b')](handleError(_0x95061c,null));};exports[_0x756e('0x63')]=function(_0x674b74,_0xe91378){var _0x58198e=[];return db[_0x756e('0x59')][_0x756e('0x43')]()[_0x756e('0xc')](function(_0x3c5976){_0x58198e=_['keys'](_0x3c5976);return _0x674b74['user'][_0x756e('0x64')]({'where':{'type':_0x756e('0x65'),'dialActive':!![],'dialMethod':_0x756e('0x66')},'attributes':['id',_0x756e('0x67'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x756e('0xc')](function(_0x312715){if(_0x312715&&_0x312715[_0x756e('0x30')]){return db[_0x756e('0x68')]['transaction'](function(_0x5c580b){var _0x207228={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x756e('0x54')](_0x756e('0x69'))},'VoiceQueueId':{'$in':_[_0x756e('0x18')](_0x312715,'id')},'$or':[{'UserId':null},{'UserId':_0x674b74[_0x756e('0x51')]['id']}]};var _0x366dfe={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x312715)[_0x756e('0x35')]([_0x756e('0x6a'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x674b74[_0x756e('0x51')]['id']}]};var _0x86477e={'$or':[_0x207228,_0x366dfe]};var _0x4740ae=[];if(_0x674b74[_0x756e('0x41')][_0x756e('0x6b')]&&_0x674b74[_0x756e('0x41')][_0x756e('0x6b')]==='prev'){if(!_[_0x756e('0x6c')](_0x674b74['body'][_0x756e('0x6d')])){_0x86477e['id']={'$in':_0x674b74['body'][_0x756e('0x6d')]};}_0x4740ae=[[_0x756e('0x6e'),_0x756e('0x6f')],['scheduledAt',_0x312715[0x0][_0x756e('0x67')]===_0x756e('0x6f')?_0x756e('0x70'):_0x756e('0x6f')],db[_0x756e('0x68')][_0x756e('0x71')](_0x756e('0x72')),['id','DESC']];}else{if(!_['isEmpty'](_0x674b74[_0x756e('0x41')][_0x756e('0x6d')])){_0x86477e['id']={'$notIn':_0x674b74[_0x756e('0x41')][_0x756e('0x6d')]};}_0x4740ae=[[_0x756e('0x6e'),_0x756e('0x70')],['scheduledAt',_0x312715[0x0][_0x756e('0x67')]],db[_0x756e('0x68')][_0x756e('0x71')](_0x756e('0x73')),['id',_0x756e('0x6f')]];}return db[_0x756e('0x12')][_0x756e('0x74')]({'attributes':['id',_0x756e('0x75'),'phone',_0x756e('0x76')],'where':_0x86477e,'order':_0x4740ae,'transaction':_0x5c580b,'lock':_0x5c580b[_0x756e('0x77')][_0x756e('0x78')],'include':[{'model':db[_0x756e('0x59')],'as':_0x756e('0x79'),'attributes':_0x58198e,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x756e('0xf')]}]},{'model':db['CmList'],'as':_0x756e('0x7a'),'attributes':['id','name']},{'model':db[_0x756e('0x7b')],'as':'Queue','attributes':['id',_0x756e('0xf'),_0x756e('0x7c')]}]})[_0x756e('0xc')](function(_0x4afbc4){if(_0x4afbc4){return _0x4afbc4[_0x756e('0xb')]({'UserId':_0x674b74['user']['id']},{'transaction':_0x5c580b});}});});}})[_0x756e('0xc')](handleEntityNotFound(_0xe91378,null))[_0x756e('0xc')](respondWithResult(_0xe91378,null))[_0x756e('0x3b')](handleError(_0xe91378,null));};exports[_0x756e('0x7d')]=function(_0x53b551,_0x3b5d8e,_0x38c0c7){var _0x5b087a=[];var _0xe3e3b6=_0x53b551[_0x756e('0x42')]['id'];var _0x5d690a=_0x53b551[_0x756e('0x51')]['id'];return db['CmContact']['describe']()[_0x756e('0xc')](function(_0x50728b){_0x5b087a=_[_0x756e('0x1a')](_0x50728b);return db['sequelize'][_0x756e('0x7e')](function(_0x51a2ec){const _0x4456c0={'id':_0xe3e3b6};return db[_0x756e('0x12')][_0x756e('0x74')]({'attributes':['id',_0x756e('0x75'),_0x756e('0x76')],'where':_0x4456c0,'transaction':_0x51a2ec,'lock':_0x51a2ec[_0x756e('0x77')][_0x756e('0x78')],'include':[{'model':db[_0x756e('0x59')],'as':_0x756e('0x79'),'attributes':_0x5b087a,'include':[{'model':db[_0x756e('0x7f')],'as':_0x756e('0x80'),'attributes':['id',_0x756e('0xf')]}]},{'model':db[_0x756e('0x81')],'as':'List','attributes':['id','name']},{'model':db[_0x756e('0x7b')],'as':_0x756e('0x82'),'attributes':['id',_0x756e('0xf'),_0x756e('0x7c')]}]})[_0x756e('0xc')](function(_0x18df88){if(_0x18df88){return _0x18df88[_0x756e('0xb')]({'UserId':_0x5d690a},{'transaction':_0x51a2ec});}});});})['then'](handleEntityNotFound(_0x3b5d8e,null))[_0x756e('0xc')](respondWithResult(_0x3b5d8e,null))[_0x756e('0x3b')](handleError(_0x3b5d8e,null));};exports[_0x756e('0x83')]=function(_0x421a80,_0xcfaaba){return _0x421a80['user'][_0x756e('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x756e('0xc')](function(_0x48b8e8){if(_0x48b8e8&&_0x48b8e8[_0x756e('0x30')]){return db[_0x756e('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x756e('0x54')](_0x756e('0x69'))},'VoiceQueueId':{'$in':_[_0x756e('0x18')](_0x48b8e8,'id')},'$or':[{'UserId':null},{'UserId':_0x421a80[_0x756e('0x51')]['id']}]}});}return 0x0;})[_0x756e('0xc')](function(_0x5aeb07){if(!_[_0x756e('0x5d')](_0x5aeb07)&&_[_0x756e('0x84')](_0x5aeb07)){return _0xcfaaba[_0x756e('0x5')](0xc8)[_0x756e('0x85')]({'contacts':_0x5aeb07});}else{logger[_0x756e('0x86')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,'entity\x20not\x20found');_0xcfaaba[_0x756e('0xd')](0x194);}})['catch'](handleError(_0xcfaaba,null));};exports[_0x756e('0x87')]=function(_0x1e5942,_0x23127a){var _0x4e31a8=shared[_0x756e('0x88')];var _0x5d7bd8=[];_[_0x756e('0x18')](_0x4e31a8,function(_0x59cdd4){_0x5d7bd8[_0x756e('0x89')]({'id':_0x59cdd4[_0x756e('0xf')],'name':_0x59cdd4[_0x756e('0xf')],'utcOffset':_0x59cdd4[_0x756e('0x8a')]});});return _0x23127a[_0x756e('0x5')](0xc8)[_0x756e('0x85')]({'tz':_0x5d7bd8});};exports[_0x756e('0x8b')]=function(_0x3e72d6,_0x3b1b92){var _0x51dc21=shared[_0x756e('0x88')];var _0x3b4d66={};if(!_[_0x756e('0x5d')](_0x51dc21[_0x3e72d6[_0x756e('0x41')]['id']]))_0x3b4d66=_0x51dc21[_0x3e72d6[_0x756e('0x41')]['id']];return _0x3b1b92[_0x756e('0x5')](0xc8)[_0x756e('0x85')](_0x3b4d66);}; \ No newline at end of file +var _0xf2cb=['transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','DESC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','CmCompany','getOpenContacts','format','isNil','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','../../config/environment','json','offset','limit','count','status','set','Content-Range','update','then','sendStatus','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','query','keys','filters','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','statedesc','deleted','campaign','user','deletedat','campaigntype','queue','ivr','CmContact','ContactId','firstName','calleridname','lastName','finally','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2cb,0x130));var _0xbf2c=function(_0x176721,_0x147dbe){_0x176721=_0x176721-0x0;var _0x3f8fcf=_0xf2cb[_0x176721];return _0x3f8fcf;};'use strict';var moment=require('moment');var _=require(_0xbf2c('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xbf2c('0x1'))('api');var shared=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x1ecb79,_0x41c649){_0x41c649=_0x41c649||0xc8;return function(_0x5abeb3){if(_0x5abeb3){return _0x1ecb79['status'](_0x41c649)[_0xbf2c('0x3')](_0x5abeb3);}};}function respondWithFilteredResult(_0x46d282,_0x1fc371){return function(_0xaacd25){if(_0xaacd25){var _0x516715=typeof _0x1fc371[_0xbf2c('0x4')]==='undefined'&&typeof _0x1fc371[_0xbf2c('0x5')]==='undefined';var _0x5f25ea=_0xaacd25[_0xbf2c('0x6')];var _0x16c303=_0x516715?0x0:_0x1fc371[_0xbf2c('0x4')];var _0x5e10f4=_0x516715?_0xaacd25[_0xbf2c('0x6')]:_0x1fc371[_0xbf2c('0x4')]+_0x1fc371[_0xbf2c('0x5')];var _0x27be1c;if(_0x5e10f4>=_0x5f25ea){_0x5e10f4=_0x5f25ea;_0x27be1c=0xc8;}else{_0x27be1c=0xce;}_0x46d282[_0xbf2c('0x7')](_0x27be1c);return _0x46d282[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x16c303+'-'+_0x5e10f4+'/'+_0x5f25ea)[_0xbf2c('0x3')](_0xaacd25);}return null;};}function saveUpdates(_0x52983d,_0x149235){return function(_0x294d0d){if(_0x294d0d){return _0x294d0d[_0xbf2c('0xa')](_0x52983d)[_0xbf2c('0xb')](function(_0x5220e2){return _0x5220e2;});}return null;};}function handleEntityNotFound(_0x7665b1,_0x5a160b){return function(_0x557740){if(!_0x557740){_0x7665b1[_0xbf2c('0xc')](0x194);}return _0x557740;};}function handleError(_0x4f58c7,_0x47df49){_0x47df49=_0x47df49||0x1f4;return function(_0x3ed1c3){logger[_0xbf2c('0xd')](_0x3ed1c3[_0xbf2c('0xe')]);if(_0x3ed1c3[_0xbf2c('0xf')]){delete _0x3ed1c3[_0xbf2c('0xf')];}_0x4f58c7['status'](_0x47df49)[_0xbf2c('0x10')](_0x3ed1c3);};}exports['index']=function(_0x4ced7f,_0x1df2ab){var _0x298329={},_0x32a44d={},_0x266035={'count':0x0,'rows':[]};var _0x57e01a=_[_0xbf2c('0x11')](db[_0xbf2c('0x12')][_0xbf2c('0x13')],function(_0x5353e7){return{'name':_0x5353e7[_0xbf2c('0x14')],'type':_0x5353e7[_0xbf2c('0x15')][_0xbf2c('0x16')]};});_0x32a44d['model']=_[_0xbf2c('0x11')](_0x57e01a,_0xbf2c('0xf'));_0x32a44d[_0xbf2c('0x17')]=_[_0xbf2c('0x18')](_0x4ced7f['query']);_0x32a44d[_0xbf2c('0x19')]=_[_0xbf2c('0x1a')](_0x32a44d['model'],_0x32a44d[_0xbf2c('0x17')]);_0x32a44d[_0xbf2c('0x19')]=_[_0xbf2c('0x1b')](_0x32a44d['filters'],['$and',_0xbf2c('0x1c'),_0xbf2c('0x1d'),_0xbf2c('0x1e'),_0xbf2c('0x1f'),_0xbf2c('0x20'),_0xbf2c('0x21'),_0xbf2c('0x22'),'$not','$between',_0xbf2c('0x23'),_0xbf2c('0x24'),_0xbf2c('0x25'),_0xbf2c('0x26'),_0xbf2c('0x27'),_0xbf2c('0x28'),_0xbf2c('0x29'),_0xbf2c('0x26'),_0xbf2c('0x2a'),'$contains',_0xbf2c('0x2b'),'$any']);_0x298329[_0xbf2c('0x2c')]=_[_0xbf2c('0x1a')](_0x32a44d[_0xbf2c('0x2d')],qs[_0xbf2c('0x2e')](_0x4ced7f[_0xbf2c('0x17')]['fields']));_0x298329[_0xbf2c('0x2c')]=_0x298329[_0xbf2c('0x2c')][_0xbf2c('0x2f')]?_0x298329[_0xbf2c('0x2c')]:_0x32a44d[_0xbf2c('0x2d')];if(!_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x30')](_0xbf2c('0x31'))){_0x298329['limit']=qs[_0xbf2c('0x5')](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x5')]);_0x298329['offset']=qs['offset'](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x4')]);}_0x298329[_0xbf2c('0x32')]=qs[_0xbf2c('0x33')](_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x33')]);_0x298329[_0xbf2c('0x34')]=qs[_0xbf2c('0x19')](_[_0xbf2c('0x35')](_0x4ced7f['query'],_0x32a44d[_0xbf2c('0x19')]),_0x57e01a);if(_0x4ced7f[_0xbf2c('0x17')][_0xbf2c('0x36')]){_0x298329[_0xbf2c('0x34')]=_[_0xbf2c('0x37')](_0x298329[_0xbf2c('0x34')],{'$or':_[_0xbf2c('0x11')](_0x57e01a,function(_0x4722b3){if(_0x4722b3['type']!==_0xbf2c('0x38')){var _0x475594={};_0x475594[_0x4722b3[_0xbf2c('0xf')]]={'$like':'%'+_0x4ced7f['query'][_0xbf2c('0x36')]+'%'};return _0x475594;}})});}_0x298329=_[_0xbf2c('0x37')]({},_0x298329,_0x4ced7f[_0xbf2c('0x39')]);var _0x5402ff={'where':_0x298329[_0xbf2c('0x34')]};return db[_0xbf2c('0x12')]['count'](_0x5402ff)['then'](function(_0x47ab9a){_0x266035['count']=_0x47ab9a;if(_0x4ced7f['query'][_0xbf2c('0x3a')]){_0x298329[_0xbf2c('0x3b')]=[{'all':!![]}];}return db[_0xbf2c('0x12')][_0xbf2c('0x3c')](_0x298329);})[_0xbf2c('0xb')](function(_0x16fbd5){_0x266035[_0xbf2c('0x3d')]=_0x16fbd5;return _0x266035;})[_0xbf2c('0xb')](respondWithFilteredResult(_0x1df2ab,_0x298329))[_0xbf2c('0x3e')](handleError(_0x1df2ab,null));};exports[_0xbf2c('0x3f')]=function(_0x245eaf,_0x99abc8){var _0x3fbf90={'raw':!![],'where':{'id':_0x245eaf[_0xbf2c('0x40')]['id']}},_0x1eac50={};_0x1eac50[_0xbf2c('0x2d')]=_['keys'](db[_0xbf2c('0x12')][_0xbf2c('0x13')]);_0x1eac50[_0xbf2c('0x17')]=_[_0xbf2c('0x18')](_0x245eaf[_0xbf2c('0x17')]);_0x1eac50[_0xbf2c('0x19')]=_[_0xbf2c('0x1a')](_0x1eac50[_0xbf2c('0x2d')],_0x1eac50['query']);_0x3fbf90[_0xbf2c('0x2c')]=_[_0xbf2c('0x1a')](_0x1eac50[_0xbf2c('0x2d')],qs[_0xbf2c('0x2e')](_0x245eaf['query'][_0xbf2c('0x2e')]));_0x3fbf90['attributes']=_0x3fbf90[_0xbf2c('0x2c')][_0xbf2c('0x2f')]?_0x3fbf90[_0xbf2c('0x2c')]:_0x1eac50[_0xbf2c('0x2d')];if(_0x245eaf[_0xbf2c('0x17')][_0xbf2c('0x3a')]){_0x3fbf90['include']=[{'all':!![]}];}_0x3fbf90=_[_0xbf2c('0x37')]({},_0x3fbf90,_0x245eaf['options']);return db['CmHopper'][_0xbf2c('0x41')](_0x3fbf90)['then'](handleEntityNotFound(_0x99abc8,null))['then'](respondWithResult(_0x99abc8,null))[_0xbf2c('0x3e')](handleError(_0x99abc8,null));};exports[_0xbf2c('0x42')]=function(_0x56fc01,_0x403568){return db['CmHopper'][_0xbf2c('0x42')](_0x56fc01['body'],{})[_0xbf2c('0xb')](respondWithResult(_0x403568,0xc9))[_0xbf2c('0x3e')](handleError(_0x403568,null));};exports[_0xbf2c('0xa')]=function(_0x343255,_0x222721){if(_0x343255[_0xbf2c('0x43')]['id']){delete _0x343255['body']['id'];}return db[_0xbf2c('0x12')][_0xbf2c('0x41')]({'where':{'id':_0x343255[_0xbf2c('0x40')]['id']}})[_0xbf2c('0xb')](handleEntityNotFound(_0x222721,null))[_0xbf2c('0xb')](saveUpdates(_0x343255['body'],null))['then'](respondWithResult(_0x222721,null))[_0xbf2c('0x3e')](handleError(_0x222721,null));};exports['describe']=function(_0xa08482,_0x1c64e0){return db[_0xbf2c('0x12')][_0xbf2c('0x44')]()[_0xbf2c('0xb')](respondWithResult(_0x1c64e0,null))[_0xbf2c('0x3e')](handleError(_0x1c64e0,null));};exports[_0xbf2c('0x45')]=function(_0x1c3b78,_0x128e97){var _0x23912d;var _0x31791b=_0x1c3b78['params']['id'];return db[_0xbf2c('0x12')][_0xbf2c('0x41')]({'where':{'id':_0x1c3b78[_0xbf2c('0x40')]['id']}})[_0xbf2c('0xb')](handleEntityNotFound(_0x128e97,null))['then'](function(_0x4edca4){if(_0x4edca4){return _0x4edca4['destroy']()[_0xbf2c('0xb')](function(_0x2451ba){return _0x2451ba;});}})['then'](function(_0x5a0c37){_0x23912d=_0x5a0c37;if(_0x5a0c37){if(_0x5a0c37['VoiceQueueId']||_0x5a0c37[_0xbf2c('0x46')]){return db[_0x5a0c37[_0xbf2c('0x47')]?_0xbf2c('0x48'):_0xbf2c('0x49')][_0xbf2c('0x41')]({'where':{'id':_0x5a0c37[_0xbf2c('0x47')]?_0x5a0c37['VoiceQueueId']:_0x5a0c37[_0xbf2c('0x46')]},'attributes':['id',_0xbf2c('0xf')],'raw':!![]});}}})[_0xbf2c('0xb')](function(_0x3fa07e){var _0x36d1ec={};if(_0x3fa07e){_[_0xbf2c('0x37')](_0x36d1ec,_[_0xbf2c('0x4a')](_0x23912d[_0xbf2c('0x4b')],['createdAt','updatedAt','id']));_0x36d1ec['state']=0x15;_0x36d1ec[_0xbf2c('0x4c')]=_0xbf2c('0x4d');_0x36d1ec[_0xbf2c('0x4e')]=_0x3fa07e[_0xbf2c('0xf')];_0x36d1ec['membername']=_0x1c3b78[_0xbf2c('0x4f')][_0xbf2c('0xf')];_0x36d1ec['UserId']=_0x1c3b78[_0xbf2c('0x4f')]['id'];_0x36d1ec[_0xbf2c('0x4d')]=!![];_0x36d1ec[_0xbf2c('0x50')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36d1ec['calleridnum']=_0x23912d['phone'];_0x36d1ec[_0xbf2c('0x51')]=_0x23912d[_0xbf2c('0x47')]?_0xbf2c('0x52'):_0xbf2c('0x53');return db[_0xbf2c('0x54')]['find']({'where':{'id':_0x36d1ec[_0xbf2c('0x55')]},'attributes':[_0xbf2c('0x56'),'lastName']})[_0xbf2c('0xb')](function(_0x3f0129){if(!_['isNil'](_0x128e97)&&!_['isNil'](_0x3f0129['firstName'])){_0x36d1ec[_0xbf2c('0x57')]=_0x3f0129['firstName'];if(!_['isNil'](_0x3f0129[_0xbf2c('0x58')])){_0x36d1ec[_0xbf2c('0x57')]+='\x20'+_0x3f0129[_0xbf2c('0x58')];}}})[_0xbf2c('0x59')](function(){return db['CmHopperFinal']['create'](_0x36d1ec);});}})[_0xbf2c('0xb')](function(_0xc0b6ff){return db[_0xbf2c('0x5a')][_0xbf2c('0x45')]({'where':{'CmHopperId':_0x31791b}});})[_0xbf2c('0xb')](function(){return _0x128e97['status'](0xcc)['end']();})[_0xbf2c('0x3e')](handleError(_0x128e97,null));};exports[_0xbf2c('0x5b')]=function(_0x40f93e,_0x45b91c){var _0x1f984e=[];return db[_0xbf2c('0x54')]['describe']()['then'](function(_0x47b287){_0x1f984e=_[_0xbf2c('0x18')](_0x47b287);return _0x40f93e[_0xbf2c('0x4f')][_0xbf2c('0x5c')]({'where':{'type':_0xbf2c('0x5d'),'dialActive':!![],'dialMethod':_0xbf2c('0x5e')},'attributes':['id',_0xbf2c('0x5f'),_0xbf2c('0x60')],'raw':!![]});})[_0xbf2c('0xb')](function(_0x50d44d){if(_0x50d44d&&_0x50d44d['length']){return db[_0xbf2c('0x61')][_0xbf2c('0x62')](function(_0x38ce66){var _0x42f789={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xbf2c('0x63'))},'VoiceQueueId':{'$in':_[_0xbf2c('0x11')](_0x50d44d,'id')},'$or':[{'UserId':null},{'UserId':_0x40f93e[_0xbf2c('0x4f')]['id']}]};var _0x4ed155={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x50d44d)[_0xbf2c('0x36')]([_0xbf2c('0x60'),0x0])[_0xbf2c('0x11')]('id')[_0xbf2c('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x40f93e['user']['id']}]};var _0x3e9448={'$or':[_0x42f789,_0x4ed155]};var _0x12bee7=[];if(_0x40f93e[_0xbf2c('0x43')]['direction']&&_0x40f93e['body'][_0xbf2c('0x65')]==='prev'){if(!_['isEmpty'](_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')])){_0x3e9448['id']={'$in':_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')]};}_0x12bee7=[[_0xbf2c('0x67'),'ASC'],['scheduledAt',_0x50d44d[0x0][_0xbf2c('0x5f')]===_0xbf2c('0x68')?'DESC':_0xbf2c('0x68')],db[_0xbf2c('0x61')]['literal'](_0xbf2c('0x69')),['id','DESC']];}else{if(!_[_0xbf2c('0x6a')](_0x40f93e[_0xbf2c('0x43')][_0xbf2c('0x66')])){_0x3e9448['id']={'$notIn':_0x40f93e['body'][_0xbf2c('0x66')]};}_0x12bee7=[[_0xbf2c('0x67'),_0xbf2c('0x6b')],[_0xbf2c('0x6c'),_0x50d44d[0x0][_0xbf2c('0x5f')]],db[_0xbf2c('0x61')][_0xbf2c('0x6d')](_0xbf2c('0x6e')),['id',_0xbf2c('0x68')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xbf2c('0x6f'),_0xbf2c('0x70'),_0xbf2c('0x71')],'where':_0x3e9448,'order':_0x12bee7,'transaction':_0x38ce66,'lock':_0x38ce66[_0xbf2c('0x72')][_0xbf2c('0x73')],'include':[{'model':db[_0xbf2c('0x54')],'as':_0xbf2c('0x74'),'attributes':_0x1f984e,'include':[{'model':db['CmCompany'],'as':_0xbf2c('0x75'),'attributes':['id',_0xbf2c('0xf')]}]},{'model':db[_0xbf2c('0x76')],'as':_0xbf2c('0x77'),'attributes':['id',_0xbf2c('0xf')]},{'model':db['VoiceQueue'],'as':_0xbf2c('0x78'),'attributes':['id',_0xbf2c('0xf'),_0xbf2c('0x79')]}]})[_0xbf2c('0xb')](function(_0x4e7b32){if(_0x4e7b32){return _0x4e7b32[_0xbf2c('0xa')]({'UserId':_0x40f93e[_0xbf2c('0x4f')]['id']},{'transaction':_0x38ce66});}});});}})[_0xbf2c('0xb')](handleEntityNotFound(_0x45b91c,null))[_0xbf2c('0xb')](respondWithResult(_0x45b91c,null))[_0xbf2c('0x3e')](handleError(_0x45b91c,null));};exports[_0xbf2c('0x7a')]=function(_0x2029f7,_0x290f8c,_0x51617d){var _0x79cc7=[];var _0x5440a8=_0x2029f7[_0xbf2c('0x40')]['id'];var _0x12b821=_0x2029f7[_0xbf2c('0x4f')]['id'];return db['CmContact'][_0xbf2c('0x44')]()[_0xbf2c('0xb')](function(_0x4ff5c3){_0x79cc7=_[_0xbf2c('0x18')](_0x4ff5c3);return db['sequelize'][_0xbf2c('0x62')](function(_0x357989){const _0x307e46={'id':_0x5440a8};return db[_0xbf2c('0x12')]['findOne']({'attributes':['id','scheduledat',_0xbf2c('0x71')],'where':_0x307e46,'transaction':_0x357989,'lock':_0x357989[_0xbf2c('0x72')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xbf2c('0x74'),'attributes':_0x79cc7,'include':[{'model':db[_0xbf2c('0x7b')],'as':_0xbf2c('0x75'),'attributes':['id',_0xbf2c('0xf')]}]},{'model':db[_0xbf2c('0x76')],'as':'List','attributes':['id',_0xbf2c('0xf')]},{'model':db[_0xbf2c('0x48')],'as':_0xbf2c('0x78'),'attributes':['id',_0xbf2c('0xf'),_0xbf2c('0x79')]}]})[_0xbf2c('0xb')](function(_0x26fdee){if(_0x26fdee){return _0x26fdee[_0xbf2c('0xa')]({'UserId':_0x12b821},{'transaction':_0x357989});}});});})[_0xbf2c('0xb')](handleEntityNotFound(_0x290f8c,null))[_0xbf2c('0xb')](respondWithResult(_0x290f8c,null))[_0xbf2c('0x3e')](handleError(_0x290f8c,null));};exports[_0xbf2c('0x7c')]=function(_0x5ecd37,_0x3ab5ac){return _0x5ecd37[_0xbf2c('0x4f')][_0xbf2c('0x5c')]({'where':{'type':_0xbf2c('0x5d'),'dialActive':!![],'dialMethod':_0xbf2c('0x5e')},'attributes':['id'],'raw':!![]})[_0xbf2c('0xb')](function(_0x545447){if(_0x545447&&_0x545447[_0xbf2c('0x2f')]){return db[_0xbf2c('0x12')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbf2c('0x7d')](_0xbf2c('0x63'))},'VoiceQueueId':{'$in':_[_0xbf2c('0x11')](_0x545447,'id')},'$or':[{'UserId':null},{'UserId':_0x5ecd37[_0xbf2c('0x4f')]['id']}]}});}return 0x0;})['then'](function(_0x2c7cf7){if(!_[_0xbf2c('0x7e')](_0x2c7cf7)&&_['isNumber'](_0x2c7cf7)){return _0x3ab5ac[_0xbf2c('0x7')](0xc8)[_0xbf2c('0x3')]({'contacts':_0x2c7cf7});}else{logger[_0xbf2c('0xd')](_0xbf2c('0x7f'),_0xbf2c('0x7c'),0x194,_0xbf2c('0x80'));_0x3ab5ac['sendStatus'](0x194);}})[_0xbf2c('0x3e')](handleError(_0x3ab5ac,null));};exports[_0xbf2c('0x81')]=function(_0x1377c1,_0x4fa011){var _0x2aa3c3=shared[_0xbf2c('0x82')];var _0x40681f=[];_[_0xbf2c('0x11')](_0x2aa3c3,function(_0x5f4f90){_0x40681f[_0xbf2c('0x83')]({'id':_0x5f4f90[_0xbf2c('0xf')],'name':_0x5f4f90[_0xbf2c('0xf')],'utcOffset':_0x5f4f90[_0xbf2c('0x84')]});});return _0x4fa011[_0xbf2c('0x7')](0xc8)[_0xbf2c('0x3')]({'tz':_0x40681f});};exports[_0xbf2c('0x85')]=function(_0x31d6f,_0x2fcb0a){var _0x391208=shared[_0xbf2c('0x82')];var _0x560da4={};if(!_[_0xbf2c('0x7e')](_0x391208[_0x31d6f['body']['id']]))_0x560da4=_0x391208[_0x31d6f[_0xbf2c('0x43')]['id']];return _0x2fcb0a[_0xbf2c('0x7')](0xc8)['json'](_0x560da4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1cc4e32..61f4552 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 _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x571de9,_0x1babf0){var _0x4f9c8f=function(_0x12eee3){while(--_0x12eee3){_0x571de9['push'](_0x571de9['shift']());}};_0x4f9c8f(++_0x1babf0);}(_0x2542,0x169));var _0x2254=function(_0x5ec9d6,_0x10760e){_0x5ec9d6=_0x5ec9d6-0x0;var _0x39bea5=_0x2542[_0x5ec9d6];return _0x39bea5;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x90b1,0x1bb));var _0x190b=function(_0x1cd9a9,_0x226b55){_0x1cd9a9=_0x1cd9a9-0x0;var _0x15795d=_0x90b1[_0x1cd9a9];return _0x15795d;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index e5bb95c..7701789 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 _0xf4d6=['Agent','name','voicePause','length','UserId','push','update','includes','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','literal','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','LOCK','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Contact','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info','debug','stringify','error','message','find','ShowCmHopper','catch','create','CreateCmHopper','UpdateCmHopper','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','describe','sequelize','UPDATE','CmContact'];(function(_0x343b56,_0x27ebbf){var _0x4bdc57=function(_0x46cccd){while(--_0x46cccd){_0x343b56['push'](_0x343b56['shift']());}};_0x4bdc57(++_0x27ebbf);}(_0xf4d6,0xc6));var _0x6f4d=function(_0x589864,_0x28fb68){_0x589864=_0x589864-0x0;var _0x1a1448=_0xf4d6[_0x589864];return _0x1a1448;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var moment=require(_0x6f4d('0x2'));var BPromise=require(_0x6f4d('0x3'));var db=require(_0x6f4d('0x4'))['db'];var logger=require(_0x6f4d('0x5'))(_0x6f4d('0x6'));exports[_0x6f4d('0x7')]=function(_0x362f2d){var _0x465e7c=this;return new Promise(function(_0x2e05e0,_0x5dc513){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d['options'][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x362f2d['options']?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')]['limit']||null:null,'include':_0x362f2d[_0x6f4d('0xa')]?_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x362f2d[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x525724){return{'model':db[_0x525724[_0x6f4d('0x10')]],'as':_0x525724['as'],'attributes':_0x525724[_0x6f4d('0xd')],'include':_0x525724[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x525724[_0x6f4d('0xe')],function(_0x2734af){return{'model':db[_0x2734af[_0x6f4d('0x10')]],'as':_0x2734af['as'],'attributes':_0x2734af[_0x6f4d('0xd')],'include':_0x2734af[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x2734af['include'],function(_0x430e32){return{'model':db[_0x430e32[_0x6f4d('0x10')]],'as':_0x430e32['as'],'attributes':_0x430e32[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0x595334){logger[_0x6f4d('0x12')]('GetCmHopper',_0x362f2d);logger[_0x6f4d('0x13')]('GetCmHopper',_0x362f2d,JSON[_0x6f4d('0x14')](_0x595334));_0x2e05e0(_0x595334);})['catch'](function(_0x6b63f8){logger[_0x6f4d('0x15')](_0x6f4d('0x7'),_0x6b63f8['message'],_0x362f2d);_0x5dc513(_0x465e7c[_0x6f4d('0x15')](0x1f4,_0x6b63f8[_0x6f4d('0x16')]));});});};exports['ShowCmHopper']=function(_0x4df258){var _0x128df0=this;return new Promise(function(_0x232ede,_0x3285cd){return db[_0x6f4d('0x8')][_0x6f4d('0x17')]({'raw':_0x4df258[_0x6f4d('0xa')]?_0x4df258[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x4df258[_0x6f4d('0xa')]?_0x4df258['options']['where']||null:null,'attributes':_0x4df258['options']?_0x4df258[_0x6f4d('0xa')]['attributes']||null:null,'include':_0x4df258['options']?_0x4df258[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x4df258['options'][_0x6f4d('0xe')],function(_0x497af5){return{'model':db[_0x497af5[_0x6f4d('0x10')]],'as':_0x497af5['as'],'attributes':_0x497af5[_0x6f4d('0xd')],'include':_0x497af5[_0x6f4d('0xe')]?_['map'](_0x497af5['include'],function(_0x24157a){return{'model':db[_0x24157a[_0x6f4d('0x10')]],'as':_0x24157a['as'],'attributes':_0x24157a[_0x6f4d('0xd')],'include':_0x24157a[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x24157a[_0x6f4d('0xe')],function(_0x27d103){return{'model':db[_0x27d103['model']],'as':_0x27d103['as'],'attributes':_0x27d103['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0xb3015b){logger['info'](_0x6f4d('0x18'),_0x4df258);logger[_0x6f4d('0x13')](_0x6f4d('0x18'),_0x4df258,JSON[_0x6f4d('0x14')](_0xb3015b));_0x232ede(_0xb3015b);})[_0x6f4d('0x19')](function(_0x523c3c){logger[_0x6f4d('0x15')](_0x6f4d('0x18'),_0x523c3c[_0x6f4d('0x16')],_0x4df258);_0x3285cd(_0x128df0[_0x6f4d('0x15')](0x1f4,_0x523c3c[_0x6f4d('0x16')]));});});};exports['CreateCmHopper']=function(_0x13ca12){var _0x24ff5d=this;return new Promise(function(_0x50168a,_0x96d437){return db[_0x6f4d('0x8')][_0x6f4d('0x1a')](_0x13ca12['body'],{'raw':_0x13ca12[_0x6f4d('0xa')]?_0x13ca12[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![]})[_0x6f4d('0x11')](function(_0x3abd0b){logger[_0x6f4d('0x12')](_0x6f4d('0x1b'),_0x13ca12);logger['debug'](_0x6f4d('0x1b'),_0x13ca12,JSON[_0x6f4d('0x14')](_0x3abd0b));_0x50168a(_0x3abd0b);})[_0x6f4d('0x19')](function(_0x4ed8f2){logger[_0x6f4d('0x15')](_0x6f4d('0x1b'),_0x4ed8f2[_0x6f4d('0x16')],_0x13ca12);_0x96d437(_0x24ff5d[_0x6f4d('0x15')](0x1f4,_0x4ed8f2[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x1c')]=function(_0x5e4a3f){var _0x22d690=this;return new Promise(function(_0x54dc92,_0x3c9759){return db['CmHopper']['update'](_0x5e4a3f[_0x6f4d('0x1d')],{'raw':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4a3f['options']?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')]['attributes']||null:null,'limit':_0x5e4a3f[_0x6f4d('0xa')]?_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0x1e')]||null:null})[_0x6f4d('0x11')](function(_0x3aa59a){logger[_0x6f4d('0x12')]('UpdateCmHopper',_0x5e4a3f);logger['info'](_0x6f4d('0x1f'),JSON[_0x6f4d('0x14')](_0x5e4a3f[_0x6f4d('0xa')][_0x6f4d('0xc')]),_0x5e4a3f[_0x6f4d('0x1d')][_0x6f4d('0x20')]);logger[_0x6f4d('0x13')]('UpdateCmHopper',_0x5e4a3f,JSON[_0x6f4d('0x14')](_0x3aa59a));_0x54dc92(_0x3aa59a);})['catch'](function(_0x26c7d4){logger[_0x6f4d('0x15')]('UpdateCmHopper',_0x26c7d4[_0x6f4d('0x16')],_0x5e4a3f);_0x3c9759(_0x22d690[_0x6f4d('0x15')](0x1f4,_0x26c7d4[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x21')]=function(_0x584d98){var _0x9758ad=this;return new Promise(function(_0x37783f,_0x5a87df){return db[_0x6f4d('0x8')]['destroy']({'where':_0x584d98[_0x6f4d('0xa')]?_0x584d98[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null})[_0x6f4d('0x11')](function(_0x30c058){logger[_0x6f4d('0x12')](_0x6f4d('0x21'),_0x584d98);logger[_0x6f4d('0x13')]('DestroyCmHopper',_0x584d98,JSON['stringify'](_0x30c058));_0x37783f(_0x30c058);})[_0x6f4d('0x19')](function(_0x50bc24){logger['error'](_0x6f4d('0x21'),_0x50bc24[_0x6f4d('0x16')],_0x584d98);_0x5a87df(_0x9758ad[_0x6f4d('0x15')](0x1f4,_0x50bc24[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x22')]=function(_0x2bd41d){var _0x2ca438=this;return new Promise(function(_0x3f404c,_0x1c12ef){return db['CmContact'][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(_0x4a678b){return db[_0x6f4d('0x24')]['transaction'](function(_0x501e3c){return db[_0x6f4d('0x8')]['findAll']({'where':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d['options'][_0x6f4d('0x1e')]||null:null,'order':_0x2bd41d[_0x6f4d('0xa')]?_0x2bd41d[_0x6f4d('0xa')]['order']||null:null,'transaction':_0x501e3c,'lock':_0x501e3c['LOCK'][_0x6f4d('0x25')],'include':[{'model':db[_0x6f4d('0x26')],'as':'Contact','attributes':_['keys'](_0x4a678b)},{'model':db['User'],'as':_0x6f4d('0x27'),'attributes':['id',_0x6f4d('0x28'),_0x6f4d('0x29')]}]})[_0x6f4d('0x11')](function(_0x21099b){var _0x3e7d80=[];var _0x3c3709=[];for(var _0x19a686=0x0;_0x19a686<_0x21099b[_0x6f4d('0x2a')];_0x19a686+=0x1){var _0x3d27c3=_0x21099b[_0x19a686][_0x6f4d('0x2b')];if(_0x3d27c3===null){_0x3e7d80[_0x6f4d('0x2c')](_0x21099b[_0x19a686][_0x6f4d('0x2d')](_0x2bd41d[_0x6f4d('0x1d')],{'transaction':_0x501e3c}));}else if(!_0x3c3709[_0x6f4d('0x2e')](_0x3d27c3)){_0x3c3709[_0x6f4d('0x2c')](_0x3d27c3);_0x3e7d80[_0x6f4d('0x2c')](_0x21099b[_0x19a686]['update'](_0x2bd41d[_0x6f4d('0x1d')],{'transaction':_0x501e3c}));}}return BPromise['all'](_0x3e7d80);});})[_0x6f4d('0x11')](function(_0x37aee0){logger['info']('GetContactDialer',_0x2bd41d);if(_0x37aee0[_0x6f4d('0x2a')]>0x0){logger[_0x6f4d('0x12')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x37aee0[0x0]['dataValues']['id'],_0x37aee0[0x0][_0x6f4d('0x2f')][_0x6f4d('0x30')],_0x37aee0[0x0][_0x6f4d('0x2f')]['active']);}logger[_0x6f4d('0x13')](_0x6f4d('0x22'),_0x2bd41d,JSON[_0x6f4d('0x14')](_0x37aee0));_0x3f404c(_0x37aee0);})[_0x6f4d('0x19')](function(_0x31f287){logger[_0x6f4d('0x15')](_0x6f4d('0x22'),_0x31f287[_0x6f4d('0x16')],_0x2bd41d);_0x1c12ef(_0x2ca438[_0x6f4d('0x15')](0x1f4,_0x31f287[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x31')]=function(_0x1d8a17){var _0x56ee19=this;return new Promise(function(_0x266765,_0x4b2998){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x19208f){return db[_0x6f4d('0x33')]['create'](_0x1d8a17['body'],{'raw':_0x1d8a17['options']?_0x1d8a17['options'][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'transaction':_0x19208f})[_0x6f4d('0x11')](function(){logger[_0x6f4d('0x12')](_0x6f4d('0x34'),JSON[_0x6f4d('0x14')](_0x1d8a17['options'][_0x6f4d('0xc')]),_0x1d8a17[_0x6f4d('0xa')][_0x6f4d('0xc')][_0x6f4d('0x20')]);return db[_0x6f4d('0x8')][_0x6f4d('0x35')]({'where':_0x1d8a17[_0x6f4d('0xa')]?_0x1d8a17[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'transaction':_0x19208f});});})[_0x6f4d('0x11')](function(_0x4d1060){logger[_0x6f4d('0x12')](_0x6f4d('0x31'),_0x1d8a17);logger[_0x6f4d('0x13')](_0x6f4d('0x31'),_0x1d8a17,JSON[_0x6f4d('0x14')](_0x4d1060));_0x266765(_0x4d1060);})[_0x6f4d('0x19')](function(_0x59ca15){logger['error'](_0x6f4d('0x31'),_0x59ca15[_0x6f4d('0x16')],_0x1d8a17);_0x4b2998(_0x56ee19[_0x6f4d('0x15')](0x1f4,_0x59ca15['message']));});});};exports[_0x6f4d('0x36')]=function(_0x44f597){var _0x2b78f1=this;return new Promise(function(_0x3fec94,_0xa4d739){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x44f597[_0x6f4d('0xa')]?_0x44f597[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x44f597[_0x6f4d('0xa')]?_0x44f597[_0x6f4d('0xa')]['where']||null:null,'attributes':[[db[_0x6f4d('0x24')]['fn']('COUNT',db[_0x6f4d('0x24')]['fn']('IF',db[_0x6f4d('0x24')][_0x6f4d('0x37')]('`scheduledat`\x20>=\x20'+util['format'](_0x6f4d('0x38'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x6f4d('0x39')))),_0x6f4d('0x3a')]]})[_0x6f4d('0x11')](function(_0x9f0e24){logger[_0x6f4d('0x12')](_0x6f4d('0x36'),_0x44f597);logger[_0x6f4d('0x13')](_0x6f4d('0x36'),_0x44f597,JSON[_0x6f4d('0x14')](_0x9f0e24));_0x3fec94(_0x9f0e24);})['catch'](function(_0x8ee292){logger['error'](_0x6f4d('0x36'),_0x8ee292[_0x6f4d('0x16')],_0x44f597);_0xa4d739(_0x2b78f1['error'](0x1f4,_0x8ee292[_0x6f4d('0x16')]));});});};exports[_0x6f4d('0x3b')]=function(_0x23b9c4){var _0x460c37=this;return new Promise(function(_0x28e766,_0x1e09a8){return db[_0x6f4d('0x26')][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(){return db[_0x6f4d('0x24')]['transaction'](function(_0x39c919){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'where':_0x23b9c4['options']?_0x23b9c4['options']['where']||null:null,'attributes':_0x23b9c4['options']?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xd')]||null:null,'limit':0x1,'order':_0x23b9c4[_0x6f4d('0xa')]?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0x3c')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x39c919,'lock':_0x39c919[_0x6f4d('0x3d')][_0x6f4d('0x25')],'include':_0x23b9c4[_0x6f4d('0xa')]?_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xe')]?_['map'](_0x23b9c4[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x37b01){return{'model':db[_0x37b01[_0x6f4d('0x10')]],'as':_0x37b01['as'],'attributes':_0x37b01[_0x6f4d('0xd')],'include':_0x37b01[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x37b01['include'],function(_0x2c23b6){return{'model':db[_0x2c23b6[_0x6f4d('0x10')]],'as':_0x2c23b6['as'],'attributes':_0x2c23b6['attributes'],'include':_0x2c23b6[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x2c23b6[_0x6f4d('0xe')],function(_0x4d72db){return{'model':db[_0x4d72db['model']],'as':_0x4d72db['as'],'attributes':_0x4d72db[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5632d5){var _0x2bcf46=[];for(var _0x551430=0x0;_0x551430<_0x5632d5[_0x6f4d('0x2a')];_0x551430+=0x1){_0x2bcf46[_0x6f4d('0x2c')](_0x5632d5[_0x551430]['update'](_0x23b9c4[_0x6f4d('0x1d')],{'transaction':_0x39c919}));}return BPromise['all'](_0x2bcf46);});})[_0x6f4d('0x11')](function(_0xf256d3){logger[_0x6f4d('0x12')](_0x6f4d('0x3b'),_0x23b9c4);logger[_0x6f4d('0x13')](_0x6f4d('0x3b'),_0x23b9c4,JSON[_0x6f4d('0x14')](_0xf256d3));_0x28e766(_0xf256d3);})['catch'](function(_0x2dbdcf){logger[_0x6f4d('0x15')](_0x6f4d('0x3b'),_0x2dbdcf['message'],_0x23b9c4);_0x1e09a8(_0x460c37[_0x6f4d('0x15')](0x1f4,_0x2dbdcf[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x3e')]=function(_0x3e1376){var _0x49f19e=this;return new Promise(function(_0x48c3ae,_0x2b04ef){db[_0x6f4d('0x26')][_0x6f4d('0x23')]()[_0x6f4d('0x11')](function(_0x330500){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'raw':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xb')]===undefined?!![]:![]:!![],'where':_0x3e1376['options']?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xc')]||null:null,'attributes':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376['options'][_0x6f4d('0xd')]||null:null,'limit':_0x3e1376[_0x6f4d('0xa')]?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0x1e')]||null:null,'include':_0x3e1376['options']?_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x3e1376[_0x6f4d('0xa')][_0x6f4d('0xe')],function(_0x21ab8c){return{'model':db[_0x21ab8c[_0x6f4d('0x10')]],'as':_0x21ab8c['as'],'attributes':_0x21ab8c['as']==='Contact'?_[_0x6f4d('0x3f')](_0x330500):_0x21ab8c['attributes'],'include':_0x21ab8c[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x21ab8c[_0x6f4d('0xe')],function(_0x263dfa){return{'model':db[_0x263dfa[_0x6f4d('0x10')]],'as':_0x263dfa['as'],'attributes':_0x263dfa[_0x6f4d('0xd')],'include':_0x263dfa[_0x6f4d('0xe')]?_[_0x6f4d('0xf')](_0x263dfa['include'],function(_0x23dac0){return{'model':db[_0x23dac0['model']],'as':_0x23dac0['as'],'attributes':_0x23dac0[_0x6f4d('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6f4d('0x11')](function(_0x3fc587){logger[_0x6f4d('0x12')]('GetCmHopper',_0x3e1376);logger[_0x6f4d('0x13')](_0x6f4d('0x7'),_0x3e1376,JSON[_0x6f4d('0x14')](_0x3fc587));_0x48c3ae(_0x3fc587);})[_0x6f4d('0x19')](function(_0x2fa361){logger['error']('GetCmHopper',_0x2fa361[_0x6f4d('0x16')],_0x3e1376);_0x2b04ef(_0x49f19e[_0x6f4d('0x15')](0x1f4,_0x2fa361[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x40')]=function(_0x22105f){var _0x4a3447=this;return new Promise(function(_0x18ca91,_0x104b66){return db[_0x6f4d('0x26')][_0x6f4d('0x41')]({'raw':!![],'where':{'phone':_0x22105f[_0x6f4d('0xa')]['where']['phone']},'attributes':['id',_0x6f4d('0x42')],'order':[['id',_0x6f4d('0x43')]]})[_0x6f4d('0x11')](function(_0x56ef2e){logger[_0x6f4d('0x12')](_0x6f4d('0x44'),_0x22105f);logger[_0x6f4d('0x13')](_0x6f4d('0x44'),_0x22105f,JSON[_0x6f4d('0x14')](_0x56ef2e));_0x18ca91(_0x56ef2e);})[_0x6f4d('0x19')](function(_0x2ed89c){logger[_0x6f4d('0x15')](_0x6f4d('0x44'),_0x2ed89c['message'],_0x22105f);_0x104b66(_0x4a3447[_0x6f4d('0x15')](0x1f4,_0x2ed89c[_0x6f4d('0x16')]));});});};exports['ResetActiveCalls']=function(_0x4f620c){var _0x1c3845=this;return new Promise(function(_0x195569,_0x413e1e){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x273b10){var _0x24d801=_0x4f620c[_0x6f4d('0xa')]&&_0x4f620c[_0x6f4d('0xa')][_0x6f4d('0xc')]?_0x4f620c[_0x6f4d('0xa')]['where']:{};return db[_0x6f4d('0x8')][_0x6f4d('0x2d')](_0x4f620c['body'],{'where':_0x24d801,'transaction':_0x273b10})['then'](function(_0x24eb46){logger['info'](_0x6f4d('0x45'),_0x4f620c);logger[_0x6f4d('0x13')]('ResetActiveCalls',_0x4f620c,JSON[_0x6f4d('0x14')](_0x24eb46));_0x195569(_0x24eb46);})[_0x6f4d('0x19')](function(_0x187681){logger[_0x6f4d('0x15')](_0x6f4d('0x45'),_0x187681[_0x6f4d('0x16')],_0x4f620c);_0x413e1e(_0x1c3845[_0x6f4d('0x15')](0x1f4,_0x187681[_0x6f4d('0x16')]));});});});};exports[_0x6f4d('0x46')]=function(_0x10db7c){var _0x4fe6c0=this;var _0x5872b9=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')]['voiceQueueIds'];var _0x5441d8=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')][_0x6f4d('0x47')];var _0x5ef9b7=_0x10db7c[_0x6f4d('0x1d')][_0x6f4d('0xc')][_0x6f4d('0x48')];return new Promise(function(_0x11bbe1,_0x59c7b1){return db[_0x6f4d('0x8')][_0x6f4d('0x9')]({'where':{'voiceQueueId':{'$in':_0x5872b9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x6f4d('0x37')](_0x6f4d('0x49')+_0x5441d8+_0x6f4d('0x4a')),'$gt':db['sequelize'][_0x6f4d('0x37')](_0x6f4d('0x4b'))}},'UserId':{'$in':_0x5ef9b7}},'include':[{'model':db['CmContact'],'as':_0x6f4d('0x4c')},{'model':db['User'],'as':_0x6f4d('0x27'),'attributes':['id','name',_0x6f4d('0x29')]},{'model':db[_0x6f4d('0x4d')],'as':_0x6f4d('0x4e')}]})['then'](function(_0x330be6){if(_0x330be6['length']>0x0){return db[_0x6f4d('0x24')][_0x6f4d('0x32')](function(_0x338859){return db[_0x6f4d('0x8')][_0x6f4d('0x2d')]({'recallmeNotifiedDate':db[_0x6f4d('0x24')][_0x6f4d('0x37')](_0x6f4d('0x4b'))},{'where':{'id':{'$in':_[_0x6f4d('0xf')](_0x330be6,'id')}},'transaction':_0x338859})[_0x6f4d('0x11')](function(){_0x11bbe1(_0x330be6);})['catch'](function(_0x3b1d99){logger['error'](_0x6f4d('0x46'),_0x3b1d99['message'],_0x10db7c);_0x59c7b1(_0x4fe6c0[_0x6f4d('0x15')](0x1f4,_0x3b1d99[_0x6f4d('0x16')]));});})[_0x6f4d('0x19')](function(_0x2f3f4e){logger[_0x6f4d('0x15')]('CmHopperHandlePreviewRecallNotifications',_0x2f3f4e[_0x6f4d('0x16')],_0x10db7c);_0x59c7b1(_0x4fe6c0[_0x6f4d('0x15')](0x1f4,_0x2f3f4e[_0x6f4d('0x16')]));});}else{_0x11bbe1(_0x330be6);}});});}; \ No newline at end of file +var _0x7d3f=['active','debug','DestroyCmHopper','GetContactDialer','CmContact','transaction','LOCK','UPDATE','Contact','keys','User','Agent','length','UserId','update','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','describe','order','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','voicePause','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','message','ShowCmHopper','find','error','create','body','CreateCmHopper','UpdateCmHopper'];(function(_0x32fe70,_0x480268){var _0x5ef4e5=function(_0x1c34b5){while(--_0x1c34b5){_0x32fe70['push'](_0x32fe70['shift']());}};_0x5ef4e5(++_0x480268);}(_0x7d3f,0xd2));var _0xf7d3=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x7d3f[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var moment=require(_0xf7d3('0x2'));var BPromise=require(_0xf7d3('0x3'));var db=require(_0xf7d3('0x4'))['db'];var logger=require(_0xf7d3('0x5'))(_0xf7d3('0x6'));exports[_0xf7d3('0x7')]=function(_0x3344e2){var _0x16973a=this;return new Promise(function(_0x5d1f6b,_0x11be61){return db[_0xf7d3('0x8')][_0xf7d3('0x9')]({'raw':_0x3344e2[_0xf7d3('0xa')]?_0x3344e2[_0xf7d3('0xa')][_0xf7d3('0xb')]===undefined?!![]:![]:!![],'where':_0x3344e2[_0xf7d3('0xa')]?_0x3344e2[_0xf7d3('0xa')][_0xf7d3('0xc')]||null:null,'attributes':_0x3344e2['options']?_0x3344e2[_0xf7d3('0xa')][_0xf7d3('0xd')]||null:null,'limit':_0x3344e2['options']?_0x3344e2[_0xf7d3('0xa')][_0xf7d3('0xe')]||null:null,'include':_0x3344e2['options']?_0x3344e2[_0xf7d3('0xa')][_0xf7d3('0xf')]?_[_0xf7d3('0x10')](_0x3344e2['options'][_0xf7d3('0xf')],function(_0x12f058){return{'model':db[_0x12f058[_0xf7d3('0x11')]],'as':_0x12f058['as'],'attributes':_0x12f058['attributes'],'include':_0x12f058[_0xf7d3('0xf')]?_[_0xf7d3('0x10')](_0x12f058[_0xf7d3('0xf')],function(_0x41f10c){return{'model':db[_0x41f10c[_0xf7d3('0x11')]],'as':_0x41f10c['as'],'attributes':_0x41f10c[_0xf7d3('0xd')],'include':_0x41f10c[_0xf7d3('0xf')]?_['map'](_0x41f10c[_0xf7d3('0xf')],function(_0x45f958){return{'model':db[_0x45f958['model']],'as':_0x45f958['as'],'attributes':_0x45f958[_0xf7d3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf7d3('0x12')](function(_0x8a91ee){logger[_0xf7d3('0x13')](_0xf7d3('0x7'),_0x3344e2);logger['debug'](_0xf7d3('0x7'),_0x3344e2,JSON[_0xf7d3('0x14')](_0x8a91ee));_0x5d1f6b(_0x8a91ee);})[_0xf7d3('0x15')](function(_0x3be2c6){logger['error'](_0xf7d3('0x7'),_0x3be2c6[_0xf7d3('0x16')],_0x3344e2);_0x11be61(_0x16973a['error'](0x1f4,_0x3be2c6['message']));});});};exports[_0xf7d3('0x17')]=function(_0xdb70ef){var _0x6773a5=this;return new Promise(function(_0x21f754,_0x3be02f){return db[_0xf7d3('0x8')][_0xf7d3('0x18')]({'raw':_0xdb70ef[_0xf7d3('0xa')]?_0xdb70ef['options']['raw']===undefined?!![]:![]:!![],'where':_0xdb70ef[_0xf7d3('0xa')]?_0xdb70ef[_0xf7d3('0xa')]['where']||null:null,'attributes':_0xdb70ef[_0xf7d3('0xa')]?_0xdb70ef[_0xf7d3('0xa')]['attributes']||null:null,'include':_0xdb70ef[_0xf7d3('0xa')]?_0xdb70ef[_0xf7d3('0xa')]['include']?_[_0xf7d3('0x10')](_0xdb70ef['options']['include'],function(_0x3a1941){return{'model':db[_0x3a1941[_0xf7d3('0x11')]],'as':_0x3a1941['as'],'attributes':_0x3a1941[_0xf7d3('0xd')],'include':_0x3a1941[_0xf7d3('0xf')]?_[_0xf7d3('0x10')](_0x3a1941[_0xf7d3('0xf')],function(_0x7e6731){return{'model':db[_0x7e6731[_0xf7d3('0x11')]],'as':_0x7e6731['as'],'attributes':_0x7e6731[_0xf7d3('0xd')],'include':_0x7e6731[_0xf7d3('0xf')]?_[_0xf7d3('0x10')](_0x7e6731[_0xf7d3('0xf')],function(_0xd4b830){return{'model':db[_0xd4b830['model']],'as':_0xd4b830['as'],'attributes':_0xd4b830[_0xf7d3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf7d3('0x12')](function(_0x722722){logger[_0xf7d3('0x13')]('ShowCmHopper',_0xdb70ef);logger['debug']('ShowCmHopper',_0xdb70ef,JSON[_0xf7d3('0x14')](_0x722722));_0x21f754(_0x722722);})[_0xf7d3('0x15')](function(_0x656582){logger[_0xf7d3('0x19')]('ShowCmHopper',_0x656582[_0xf7d3('0x16')],_0xdb70ef);_0x3be02f(_0x6773a5[_0xf7d3('0x19')](0x1f4,_0x656582[_0xf7d3('0x16')]));});});};exports['CreateCmHopper']=function(_0x159a5a){var _0x507ec5=this;return new Promise(function(_0x1b9d42,_0x4e3efe){return db[_0xf7d3('0x8')][_0xf7d3('0x1a')](_0x159a5a[_0xf7d3('0x1b')],{'raw':_0x159a5a[_0xf7d3('0xa')]?_0x159a5a['options'][_0xf7d3('0xb')]===undefined?!![]:![]:!![]})[_0xf7d3('0x12')](function(_0x118d60){logger[_0xf7d3('0x13')](_0xf7d3('0x1c'),_0x159a5a);logger['debug'](_0xf7d3('0x1c'),_0x159a5a,JSON[_0xf7d3('0x14')](_0x118d60));_0x1b9d42(_0x118d60);})[_0xf7d3('0x15')](function(_0x30b1d1){logger[_0xf7d3('0x19')](_0xf7d3('0x1c'),_0x30b1d1[_0xf7d3('0x16')],_0x159a5a);_0x4e3efe(_0x507ec5[_0xf7d3('0x19')](0x1f4,_0x30b1d1[_0xf7d3('0x16')]));});});};exports[_0xf7d3('0x1d')]=function(_0x4e0539){var _0x2f5597=this;return new Promise(function(_0x46d878,_0x17d84c){return db[_0xf7d3('0x8')]['update'](_0x4e0539['body'],{'raw':_0x4e0539['options']?_0x4e0539[_0xf7d3('0xa')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e0539[_0xf7d3('0xa')]?_0x4e0539[_0xf7d3('0xa')][_0xf7d3('0xc')]||null:null,'attributes':_0x4e0539[_0xf7d3('0xa')]?_0x4e0539[_0xf7d3('0xa')][_0xf7d3('0xd')]||null:null,'limit':_0x4e0539[_0xf7d3('0xa')]?_0x4e0539[_0xf7d3('0xa')][_0xf7d3('0xe')]||null:null})['then'](function(_0x5d6666){logger[_0xf7d3('0x13')](_0xf7d3('0x1d'),_0x4e0539);logger[_0xf7d3('0x13')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xf7d3('0x14')](_0x4e0539[_0xf7d3('0xa')][_0xf7d3('0xc')]),_0x4e0539[_0xf7d3('0x1b')][_0xf7d3('0x1e')]);logger[_0xf7d3('0x1f')](_0xf7d3('0x1d'),_0x4e0539,JSON[_0xf7d3('0x14')](_0x5d6666));_0x46d878(_0x5d6666);})[_0xf7d3('0x15')](function(_0x4811f7){logger[_0xf7d3('0x19')](_0xf7d3('0x1d'),_0x4811f7[_0xf7d3('0x16')],_0x4e0539);_0x17d84c(_0x2f5597[_0xf7d3('0x19')](0x1f4,_0x4811f7[_0xf7d3('0x16')]));});});};exports['DestroyCmHopper']=function(_0x5fcd96){var _0x154de9=this;return new Promise(function(_0x314be0,_0x53c894){return db[_0xf7d3('0x8')]['destroy']({'where':_0x5fcd96[_0xf7d3('0xa')]?_0x5fcd96['options'][_0xf7d3('0xc')]||null:null})['then'](function(_0x409e1b){logger['info'](_0xf7d3('0x20'),_0x5fcd96);logger['debug'](_0xf7d3('0x20'),_0x5fcd96,JSON['stringify'](_0x409e1b));_0x314be0(_0x409e1b);})[_0xf7d3('0x15')](function(_0x1de25b){logger[_0xf7d3('0x19')]('DestroyCmHopper',_0x1de25b[_0xf7d3('0x16')],_0x5fcd96);_0x53c894(_0x154de9[_0xf7d3('0x19')](0x1f4,_0x1de25b[_0xf7d3('0x16')]));});});};exports[_0xf7d3('0x21')]=function(_0x40da9c){var _0x2cfb0c=this;return new Promise(function(_0x57f862,_0x3dca81){return db[_0xf7d3('0x22')]['describe']()[_0xf7d3('0x12')](function(_0xb7db69){return db['sequelize'][_0xf7d3('0x23')](function(_0x47ad3e){return db[_0xf7d3('0x8')]['findAll']({'where':_0x40da9c[_0xf7d3('0xa')]?_0x40da9c['options'][_0xf7d3('0xc')]||null:null,'attributes':_0x40da9c[_0xf7d3('0xa')]?_0x40da9c[_0xf7d3('0xa')][_0xf7d3('0xd')]||null:null,'limit':_0x40da9c[_0xf7d3('0xa')]?_0x40da9c['options'][_0xf7d3('0xe')]||null:null,'order':_0x40da9c['options']?_0x40da9c[_0xf7d3('0xa')]['order']||null:null,'transaction':_0x47ad3e,'lock':_0x47ad3e[_0xf7d3('0x24')][_0xf7d3('0x25')],'include':[{'model':db[_0xf7d3('0x22')],'as':_0xf7d3('0x26'),'attributes':_[_0xf7d3('0x27')](_0xb7db69)},{'model':db[_0xf7d3('0x28')],'as':_0xf7d3('0x29'),'attributes':['id','name','voicePause']}]})[_0xf7d3('0x12')](function(_0x45c0d9){var _0x6430b6=[];var _0x46a22f=[];for(var _0x48a3c1=0x0;_0x48a3c1<_0x45c0d9[_0xf7d3('0x2a')];_0x48a3c1+=0x1){var _0x561451=_0x45c0d9[_0x48a3c1][_0xf7d3('0x2b')];if(_0x561451===null){_0x6430b6['push'](_0x45c0d9[_0x48a3c1][_0xf7d3('0x2c')](_0x40da9c['body'],{'transaction':_0x47ad3e}));}else if(!_0x46a22f['includes'](_0x561451)){_0x46a22f[_0xf7d3('0x2d')](_0x561451);_0x6430b6['push'](_0x45c0d9[_0x48a3c1][_0xf7d3('0x2c')](_0x40da9c[_0xf7d3('0x1b')],{'transaction':_0x47ad3e}));}}return BPromise[_0xf7d3('0x2e')](_0x6430b6);});})[_0xf7d3('0x12')](function(_0x1aac5c){logger[_0xf7d3('0x13')]('GetContactDialer',_0x40da9c);if(_0x1aac5c['length']>0x0){logger[_0xf7d3('0x13')](_0xf7d3('0x2f'),_0x1aac5c[0x0][_0xf7d3('0x30')]['id'],_0x1aac5c[0x0]['dataValues'][_0xf7d3('0x31')],_0x1aac5c[0x0][_0xf7d3('0x30')][_0xf7d3('0x1e')]);}logger['debug'](_0xf7d3('0x21'),_0x40da9c,JSON[_0xf7d3('0x14')](_0x1aac5c));_0x57f862(_0x1aac5c);})[_0xf7d3('0x15')](function(_0x2abccf){logger['error']('GetContactDialer',_0x2abccf[_0xf7d3('0x16')],_0x40da9c);_0x3dca81(_0x2cfb0c[_0xf7d3('0x19')](0x1f4,_0x2abccf[_0xf7d3('0x16')]));});});});};exports[_0xf7d3('0x32')]=function(_0x2923fe){var _0xf0d476=this;return new Promise(function(_0x1e1f72,_0x4a5ba9){return db[_0xf7d3('0x33')]['transaction'](function(_0x53838c){return db[_0xf7d3('0x34')][_0xf7d3('0x1a')](_0x2923fe[_0xf7d3('0x1b')],{'raw':_0x2923fe[_0xf7d3('0xa')]?_0x2923fe[_0xf7d3('0xa')]['raw']===undefined?!![]:![]:!![],'transaction':_0x53838c})[_0xf7d3('0x12')](function(){logger[_0xf7d3('0x13')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xf7d3('0x14')](_0x2923fe[_0xf7d3('0xa')][_0xf7d3('0xc')]),_0x2923fe[_0xf7d3('0xa')][_0xf7d3('0xc')][_0xf7d3('0x1e')]);return db['CmHopper'][_0xf7d3('0x35')]({'where':_0x2923fe['options']?_0x2923fe[_0xf7d3('0xa')]['where']||null:null,'transaction':_0x53838c});});})[_0xf7d3('0x12')](function(_0x4bfce6){logger[_0xf7d3('0x13')]('MoveContactManagedDialer',_0x2923fe);logger['debug'](_0xf7d3('0x32'),_0x2923fe,JSON['stringify'](_0x4bfce6));_0x1e1f72(_0x4bfce6);})[_0xf7d3('0x15')](function(_0xc4526){logger[_0xf7d3('0x19')](_0xf7d3('0x32'),_0xc4526[_0xf7d3('0x16')],_0x2923fe);_0x4a5ba9(_0xf0d476['error'](0x1f4,_0xc4526[_0xf7d3('0x16')]));});});};exports[_0xf7d3('0x36')]=function(_0x224e1f){var _0x136fc1=this;return new Promise(function(_0x18072f,_0x2f350f){return db[_0xf7d3('0x8')][_0xf7d3('0x9')]({'raw':_0x224e1f['options']?_0x224e1f[_0xf7d3('0xa')][_0xf7d3('0xb')]===undefined?!![]:![]:!![],'where':_0x224e1f[_0xf7d3('0xa')]?_0x224e1f[_0xf7d3('0xa')][_0xf7d3('0xc')]||null:null,'attributes':[[db[_0xf7d3('0x33')]['fn'](_0xf7d3('0x37'),db[_0xf7d3('0x33')]['fn']('IF',db['sequelize'][_0xf7d3('0x38')](_0xf7d3('0x39')+util[_0xf7d3('0x3a')](_0xf7d3('0x3b'),moment()[_0xf7d3('0x3a')](_0xf7d3('0x3c')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xf7d3('0x12')](function(_0x5143b5){logger['info']('CountReScheduled',_0x224e1f);logger['debug']('CountReScheduled',_0x224e1f,JSON[_0xf7d3('0x14')](_0x5143b5));_0x18072f(_0x5143b5);})[_0xf7d3('0x15')](function(_0x5c72d1){logger[_0xf7d3('0x19')](_0xf7d3('0x36'),_0x5c72d1[_0xf7d3('0x16')],_0x224e1f);_0x2f350f(_0x136fc1[_0xf7d3('0x19')](0x1f4,_0x5c72d1[_0xf7d3('0x16')]));});});};exports[_0xf7d3('0x3d')]=function(_0x24db07){var _0x4e8db9=this;return new Promise(function(_0x17be67,_0x7a7d34){return db[_0xf7d3('0x22')][_0xf7d3('0x3e')]()['then'](function(){return db['sequelize']['transaction'](function(_0x6db963){return db[_0xf7d3('0x8')][_0xf7d3('0x9')]({'where':_0x24db07['options']?_0x24db07[_0xf7d3('0xa')][_0xf7d3('0xc')]||null:null,'attributes':_0x24db07[_0xf7d3('0xa')]?_0x24db07[_0xf7d3('0xa')]['attributes']||null:null,'limit':0x1,'order':_0x24db07['options']?_0x24db07[_0xf7d3('0xa')][_0xf7d3('0x3f')]||null:null,'group':db['CmHopper'][_0xf7d3('0x2b')],'transaction':_0x6db963,'lock':_0x6db963[_0xf7d3('0x24')][_0xf7d3('0x25')],'include':_0x24db07['options']?_0x24db07[_0xf7d3('0xa')]['include']?_[_0xf7d3('0x10')](_0x24db07[_0xf7d3('0xa')][_0xf7d3('0xf')],function(_0x2eec73){return{'model':db[_0x2eec73[_0xf7d3('0x11')]],'as':_0x2eec73['as'],'attributes':_0x2eec73[_0xf7d3('0xd')],'include':_0x2eec73['include']?_[_0xf7d3('0x10')](_0x2eec73[_0xf7d3('0xf')],function(_0x2a5930){return{'model':db[_0x2a5930[_0xf7d3('0x11')]],'as':_0x2a5930['as'],'attributes':_0x2a5930[_0xf7d3('0xd')],'include':_0x2a5930[_0xf7d3('0xf')]?_['map'](_0x2a5930['include'],function(_0x1950c2){return{'model':db[_0x1950c2[_0xf7d3('0x11')]],'as':_0x1950c2['as'],'attributes':_0x1950c2[_0xf7d3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf7d3('0x12')](function(_0x101c4a){var _0x285352=[];for(var _0x465951=0x0;_0x465951<_0x101c4a[_0xf7d3('0x2a')];_0x465951+=0x1){_0x285352[_0xf7d3('0x2d')](_0x101c4a[_0x465951]['update'](_0x24db07[_0xf7d3('0x1b')],{'transaction':_0x6db963}));}return BPromise[_0xf7d3('0x2e')](_0x285352);});})[_0xf7d3('0x12')](function(_0x39e8b2){logger['info'](_0xf7d3('0x3d'),_0x24db07);logger[_0xf7d3('0x1f')](_0xf7d3('0x3d'),_0x24db07,JSON[_0xf7d3('0x14')](_0x39e8b2));_0x17be67(_0x39e8b2);})[_0xf7d3('0x15')](function(_0x4a03bf){logger[_0xf7d3('0x19')]('GetContactRecallMe',_0x4a03bf[_0xf7d3('0x16')],_0x24db07);_0x7a7d34(_0x4e8db9[_0xf7d3('0x19')](0x1f4,_0x4a03bf[_0xf7d3('0x16')]));});});});};exports[_0xf7d3('0x40')]=function(_0x562e7e){var _0x16e571=this;return new Promise(function(_0xa160f4,_0x5b47db){db[_0xf7d3('0x22')][_0xf7d3('0x3e')]()[_0xf7d3('0x12')](function(_0x4a8c81){return db[_0xf7d3('0x8')][_0xf7d3('0x9')]({'raw':_0x562e7e[_0xf7d3('0xa')]?_0x562e7e[_0xf7d3('0xa')][_0xf7d3('0xb')]===undefined?!![]:![]:!![],'where':_0x562e7e['options']?_0x562e7e[_0xf7d3('0xa')][_0xf7d3('0xc')]||null:null,'attributes':_0x562e7e[_0xf7d3('0xa')]?_0x562e7e[_0xf7d3('0xa')][_0xf7d3('0xd')]||null:null,'limit':_0x562e7e['options']?_0x562e7e[_0xf7d3('0xa')][_0xf7d3('0xe')]||null:null,'include':_0x562e7e[_0xf7d3('0xa')]?_0x562e7e['options']['include']?_[_0xf7d3('0x10')](_0x562e7e[_0xf7d3('0xa')]['include'],function(_0x4ce447){return{'model':db[_0x4ce447[_0xf7d3('0x11')]],'as':_0x4ce447['as'],'attributes':_0x4ce447['as']===_0xf7d3('0x26')?_['keys'](_0x4a8c81):_0x4ce447[_0xf7d3('0xd')],'include':_0x4ce447['include']?_[_0xf7d3('0x10')](_0x4ce447[_0xf7d3('0xf')],function(_0x912af2){return{'model':db[_0x912af2[_0xf7d3('0x11')]],'as':_0x912af2['as'],'attributes':_0x912af2[_0xf7d3('0xd')],'include':_0x912af2[_0xf7d3('0xf')]?_[_0xf7d3('0x10')](_0x912af2[_0xf7d3('0xf')],function(_0x2625a9){return{'model':db[_0x2625a9[_0xf7d3('0x11')]],'as':_0x2625a9['as'],'attributes':_0x2625a9[_0xf7d3('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf7d3('0x12')](function(_0x47f7f0){logger[_0xf7d3('0x13')](_0xf7d3('0x7'),_0x562e7e);logger[_0xf7d3('0x1f')](_0xf7d3('0x7'),_0x562e7e,JSON[_0xf7d3('0x14')](_0x47f7f0));_0xa160f4(_0x47f7f0);})[_0xf7d3('0x15')](function(_0x363301){logger[_0xf7d3('0x19')](_0xf7d3('0x7'),_0x363301[_0xf7d3('0x16')],_0x562e7e);_0x5b47db(_0x16e571['error'](0x1f4,_0x363301[_0xf7d3('0x16')]));});});});};exports[_0xf7d3('0x41')]=function(_0x33dbeb){var _0x4c294f=this;return new Promise(function(_0x3f4dfb,_0x2a61ca){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0x33dbeb[_0xf7d3('0xa')][_0xf7d3('0xc')][_0xf7d3('0x42')]},'attributes':['id',_0xf7d3('0x43')],'order':[['id','DESC']]})[_0xf7d3('0x12')](function(_0x1b0049){logger[_0xf7d3('0x13')](_0xf7d3('0x44'),_0x33dbeb);logger['debug']('getContactByPhone',_0x33dbeb,JSON['stringify'](_0x1b0049));_0x3f4dfb(_0x1b0049);})['catch'](function(_0x4bf85a){logger[_0xf7d3('0x19')](_0xf7d3('0x44'),_0x4bf85a[_0xf7d3('0x16')],_0x33dbeb);_0x2a61ca(_0x4c294f[_0xf7d3('0x19')](0x1f4,_0x4bf85a[_0xf7d3('0x16')]));});});};exports[_0xf7d3('0x45')]=function(_0x3e8657){var _0x28fc8a=this;return new Promise(function(_0x5dde6d,_0x56ce02){return db[_0xf7d3('0x33')][_0xf7d3('0x23')](function(_0x2e9428){var _0x5a1d32=_0x3e8657[_0xf7d3('0xa')]&&_0x3e8657[_0xf7d3('0xa')][_0xf7d3('0xc')]?_0x3e8657[_0xf7d3('0xa')]['where']:{};return db[_0xf7d3('0x8')]['update'](_0x3e8657[_0xf7d3('0x1b')],{'where':_0x5a1d32,'transaction':_0x2e9428})['then'](function(_0x10f426){logger[_0xf7d3('0x13')](_0xf7d3('0x45'),_0x3e8657);logger[_0xf7d3('0x1f')](_0xf7d3('0x45'),_0x3e8657,JSON['stringify'](_0x10f426));_0x5dde6d(_0x10f426);})['catch'](function(_0x124ccd){logger['error']('ResetActiveCalls',_0x124ccd[_0xf7d3('0x16')],_0x3e8657);_0x56ce02(_0x28fc8a[_0xf7d3('0x19')](0x1f4,_0x124ccd[_0xf7d3('0x16')]));});});});};exports[_0xf7d3('0x46')]=function(_0x3e721f){var _0x12239c=this;var _0x218ee4=_0x3e721f['body']['where'][_0xf7d3('0x47')];var _0x59b0e9=_0x3e721f[_0xf7d3('0x1b')][_0xf7d3('0xc')]['interval'];var _0x2ddcea=_0x3e721f['body'][_0xf7d3('0xc')][_0xf7d3('0x48')];return new Promise(function(_0x1fd65e,_0x138236){return db[_0xf7d3('0x8')][_0xf7d3('0x9')]({'where':{'voiceQueueId':{'$in':_0x218ee4},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf7d3('0x33')][_0xf7d3('0x38')](_0xf7d3('0x49')+_0x59b0e9+_0xf7d3('0x4a')),'$gt':db[_0xf7d3('0x33')][_0xf7d3('0x38')](_0xf7d3('0x4b'))}},'UserId':{'$in':_0x2ddcea}},'include':[{'model':db[_0xf7d3('0x22')],'as':_0xf7d3('0x26')},{'model':db[_0xf7d3('0x28')],'as':_0xf7d3('0x29'),'attributes':['id',_0xf7d3('0x4c'),_0xf7d3('0x4d')]},{'model':db[_0xf7d3('0x4e')],'as':_0xf7d3('0x4f')}]})[_0xf7d3('0x12')](function(_0x56746b){if(_0x56746b[_0xf7d3('0x2a')]>0x0){return db['sequelize'][_0xf7d3('0x23')](function(_0x28c0d7){return db[_0xf7d3('0x8')][_0xf7d3('0x2c')]({'recallmeNotifiedDate':db[_0xf7d3('0x33')][_0xf7d3('0x38')](_0xf7d3('0x4b'))},{'where':{'id':{'$in':_[_0xf7d3('0x10')](_0x56746b,'id')}},'transaction':_0x28c0d7})['then'](function(){_0x1fd65e(_0x56746b);})[_0xf7d3('0x15')](function(_0x34f257){logger[_0xf7d3('0x19')](_0xf7d3('0x46'),_0x34f257[_0xf7d3('0x16')],_0x3e721f);_0x138236(_0x12239c[_0xf7d3('0x19')](0x1f4,_0x34f257[_0xf7d3('0x16')]));});})['catch'](function(_0xcab550){logger[_0xf7d3('0x19')](_0xf7d3('0x46'),_0xcab550[_0xf7d3('0x16')],_0x3e721f);_0x138236(_0x12239c[_0xf7d3('0x19')](0x1f4,_0xcab550[_0xf7d3('0x16')]));});}else{_0x1fd65e(_0x56746b);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2a5f651..49bd5d7 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 _0x5f33=['./cmHopper.controller','get','isAuthenticated','describe','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','delete','destroy','exports','express'];(function(_0x46647b,_0x4e8678){var _0x2bef5d=function(_0x336266){while(--_0x336266){_0x46647b['push'](_0x46647b['shift']());}};_0x2bef5d(++_0x4e8678);}(_0x5f33,0x18f));var _0x35f3=function(_0x548af0,_0x2f9fd8){_0x548af0=_0x548af0-0x0;var _0x595aeb=_0x5f33[_0x548af0];return _0x595aeb;};'use strict';var express=require(_0x35f3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x35f3('0x1'));router[_0x35f3('0x2')]('/',auth[_0x35f3('0x3')](),controller['index']);router[_0x35f3('0x2')]('/describe',auth[_0x35f3('0x3')](),controller[_0x35f3('0x4')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x35f3('0x2')](_0x35f3('0x5'),auth[_0x35f3('0x3')](),controller['getTimezones']);router['get'](_0x35f3('0x6'),auth['isAuthenticated'](),controller[_0x35f3('0x7')]);router['get'](_0x35f3('0x8'),auth['isAuthenticated'](),controller[_0x35f3('0x9')]);router[_0x35f3('0xa')]('/',auth[_0x35f3('0x3')](),controller[_0x35f3('0xb')]);router[_0x35f3('0xa')](_0x35f3('0xc'),auth[_0x35f3('0x3')](),controller[_0x35f3('0xd')]);router[_0x35f3('0xa')]('/timezone',auth['isAuthenticated'](),controller[_0x35f3('0xe')]);router[_0x35f3('0xf')](_0x35f3('0x6'),auth[_0x35f3('0x3')](),controller[_0x35f3('0x10')]);router[_0x35f3('0x11')](_0x35f3('0x6'),auth[_0x35f3('0x3')](),controller[_0x35f3('0x12')]);module[_0x35f3('0x13')]=router; \ No newline at end of file +var _0x46ad=['describe','/opencontacts','/timezones','getTimezones','/:id','show','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','update','delete','destroy','exports','express','Router','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x20b2ee,_0x2f5f73){var _0xa9ec2e=function(_0x440897){while(--_0x440897){_0x20b2ee['push'](_0x20b2ee['shift']());}};_0xa9ec2e(++_0x2f5f73);}(_0x46ad,0x1af));var _0xd46a=function(_0x8efab8,_0x17a6e5){_0x8efab8=_0x8efab8-0x0;var _0x18de9=_0x46ad[_0x8efab8];return _0x18de9;};'use strict';var express=require(_0xd46a('0x0'));var router=express[_0xd46a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd46a('0x2'));router[_0xd46a('0x3')]('/',auth[_0xd46a('0x4')](),controller[_0xd46a('0x5')]);router['get']('/describe',auth[_0xd46a('0x4')](),controller[_0xd46a('0x6')]);router[_0xd46a('0x3')](_0xd46a('0x7'),auth[_0xd46a('0x4')](),controller['getOpenContacts']);router[_0xd46a('0x3')](_0xd46a('0x8'),auth[_0xd46a('0x4')](),controller[_0xd46a('0x9')]);router[_0xd46a('0x3')](_0xd46a('0xa'),auth[_0xd46a('0x4')](),controller[_0xd46a('0xb')]);router['get']('/:id/previewrecall',auth[_0xd46a('0x4')](),controller[_0xd46a('0xc')]);router[_0xd46a('0xd')]('/',auth[_0xd46a('0x4')](),controller[_0xd46a('0xe')]);router[_0xd46a('0xd')](_0xd46a('0xf'),auth['isAuthenticated'](),controller[_0xd46a('0x10')]);router[_0xd46a('0xd')](_0xd46a('0x11'),auth[_0xd46a('0x4')](),controller['getTimezone']);router[_0xd46a('0x12')](_0xd46a('0xa'),auth['isAuthenticated'](),controller[_0xd46a('0x13')]);router[_0xd46a('0x14')]('/:id',auth[_0xd46a('0x4')](),controller[_0xd46a('0x15')]);module[_0xd46a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 7ec6e06..4f6cd56 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 _0x87a0=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','format'];(function(_0x1c5152,_0x252e48){var _0x171edd=function(_0x255ce6){while(--_0x255ce6){_0x1c5152['push'](_0x1c5152['shift']());}};_0x171edd(++_0x252e48);}(_0x87a0,0x122));var _0x087a=function(_0x16abe4,_0x55558f){_0x16abe4=_0x16abe4-0x0;var _0x55e2e3=_0x87a0[_0x16abe4];return _0x55e2e3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x087a('0x0')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x087a('0x1')](_0x087a('0x2'))},'countbusyretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x087a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3b99=['INTEGER','format','moment','sequelize','exports'];(function(_0x5743e3,_0x4a2aab){var _0x24d100=function(_0x10737c){while(--_0x10737c){_0x5743e3['push'](_0x5743e3['shift']());}};_0x24d100(++_0x4a2aab);}(_0x3b99,0xca));var _0x93b9=function(_0x3a418c,_0x5e5d4a){_0x3a418c=_0x3a418c-0x0;var _0x10b7e3=_0x3b99[_0x3a418c];return _0x10b7e3;};'use strict';var moment=require(_0x93b9('0x0'));var Sequelize=require(_0x93b9('0x1'));module[_0x93b9('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x93b9('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x93b9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 099ad35..74dbc55 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 _0xfdb7=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','then','destroy','UserProfileResource','error','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x31d387,_0x4a30d7){var _0x382a79=function(_0x143510){while(--_0x143510){_0x31d387['push'](_0x31d387['shift']());}};_0x382a79(++_0x4a30d7);}(_0xfdb7,0x1d3));var _0x7fdb=function(_0x4111b6,_0x44fccd){_0x4111b6=_0x4111b6-0x0;var _0x306158=_0xfdb7[_0x4111b6];return _0x306158;};'use strict';var emlformat=require(_0x7fdb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fdb('0x1'));var jsonpatch=require(_0x7fdb('0x2'));var rp=require(_0x7fdb('0x3'));var moment=require(_0x7fdb('0x4'));var BPromise=require(_0x7fdb('0x5'));var Mustache=require(_0x7fdb('0x6'));var util=require(_0x7fdb('0x7'));var path=require(_0x7fdb('0x8'));var sox=require('sox');var csv=require(_0x7fdb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fdb('0xa'));var _=require(_0x7fdb('0xb'));var squel=require(_0x7fdb('0xc'));var crypto=require(_0x7fdb('0xd'));var jsforce=require(_0x7fdb('0xe'));var deskjs=require(_0x7fdb('0xf'));var toCsv=require(_0x7fdb('0x9'));var querystring=require(_0x7fdb('0x10'));var Papa=require(_0x7fdb('0x11'));var Redis=require(_0x7fdb('0x12'));var authService=require(_0x7fdb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7fdb('0x14'));var hardwareService=require(_0x7fdb('0x15'));var logger=require(_0x7fdb('0x16'))(_0x7fdb('0x17'));var utils=require(_0x7fdb('0x18'));var config=require(_0x7fdb('0x19'));var licenseUtil=require(_0x7fdb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x422092,_0x30c066){_0x30c066=_0x30c066||0xcc;return function(_0x1a7c48){if(_0x1a7c48){return _0x422092['sendStatus'](_0x30c066);}return _0x422092[_0x7fdb('0x1b')](_0x30c066)['end']();};}function respondWithResult(_0xda5abd,_0x2e630e){_0x2e630e=_0x2e630e||0xc8;return function(_0x1530a0){if(_0x1530a0){return _0xda5abd[_0x7fdb('0x1b')](_0x2e630e)[_0x7fdb('0x1c')](_0x1530a0);}};}function respondWithFilteredResult(_0x504a6a,_0x426bfa){return function(_0x851819){if(_0x851819){var _0x4b10fb=typeof _0x426bfa[_0x7fdb('0x1d')]===_0x7fdb('0x1e')&&typeof _0x426bfa['limit']===_0x7fdb('0x1e');var _0x5c55ba=_0x851819[_0x7fdb('0x1f')];var _0x25edd1=_0x4b10fb?0x0:_0x426bfa[_0x7fdb('0x1d')];var _0x2b993c=_0x4b10fb?_0x851819[_0x7fdb('0x1f')]:_0x426bfa[_0x7fdb('0x1d')]+_0x426bfa[_0x7fdb('0x20')];var _0x56a375;if(_0x2b993c>=_0x5c55ba){_0x2b993c=_0x5c55ba;_0x56a375=0xc8;}else{_0x56a375=0xce;}_0x504a6a['status'](_0x56a375);return _0x504a6a['set']('Content-Range',_0x25edd1+'-'+_0x2b993c+'/'+_0x5c55ba)['json'](_0x851819);}return null;};}function patchUpdates(_0x332c5e){return function(_0x896abe){try{jsonpatch[_0x7fdb('0x21')](_0x896abe,_0x332c5e,!![]);}catch(_0x3163a0){return BPromise['reject'](_0x3163a0);}return _0x896abe['save']();};}function saveUpdates(_0x5ae9d5,_0x6d2a8c){return function(_0x271641){if(_0x271641){return _0x271641['update'](_0x5ae9d5)[_0x7fdb('0x22')](function(_0x32af99){return _0x32af99;});}return null;};}function removeEntity(_0x33eac2,_0x258441){return function(_0x46c8b2){if(_0x46c8b2){return _0x46c8b2[_0x7fdb('0x23')]()[_0x7fdb('0x22')](function(){var _0x3675ed=_0x46c8b2['get']({'plain':!![]});var _0x2ac93e='CmHopperAdditionalPhones';return db[_0x7fdb('0x24')][_0x7fdb('0x23')]({'where':{'type':_0x2ac93e,'resourceId':_0x3675ed['id']}})[_0x7fdb('0x22')](function(){return _0x46c8b2;});})[_0x7fdb('0x22')](function(){_0x33eac2[_0x7fdb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192a8e,_0x15989b){return function(_0x358a90){if(!_0x358a90){_0x192a8e['sendStatus'](0x194);}return _0x358a90;};}function handleError(_0x52025b,_0x13ecc2){_0x13ecc2=_0x13ecc2||0x1f4;return function(_0x2eba49){logger[_0x7fdb('0x25')](_0x2eba49['stack']);if(_0x2eba49[_0x7fdb('0x26')]){delete _0x2eba49[_0x7fdb('0x26')];}_0x52025b['status'](_0x13ecc2)['send'](_0x2eba49);};}exports[_0x7fdb('0x27')]=function(_0x4cecf7,_0x36d013){var _0xcd7cb3={},_0x2e0ea2={},_0x4d67a2={'count':0x0,'rows':[]};var _0x1a98f0=_[_0x7fdb('0x28')](db[_0x7fdb('0x29')][_0x7fdb('0x2a')],function(_0x3e51b9){return{'name':_0x3e51b9[_0x7fdb('0x2b')],'type':_0x3e51b9[_0x7fdb('0x2c')][_0x7fdb('0x2d')]};});_0x2e0ea2['model']=_[_0x7fdb('0x28')](_0x1a98f0,_0x7fdb('0x26'));_0x2e0ea2[_0x7fdb('0x2e')]=_[_0x7fdb('0x2f')](_0x4cecf7['query']);_0x2e0ea2[_0x7fdb('0x30')]=_[_0x7fdb('0x31')](_0x2e0ea2[_0x7fdb('0x32')],_0x2e0ea2[_0x7fdb('0x2e')]);_0xcd7cb3['attributes']=_['intersection'](_0x2e0ea2[_0x7fdb('0x32')],qs[_0x7fdb('0x33')](_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x33')]));_0xcd7cb3[_0x7fdb('0x34')]=_0xcd7cb3[_0x7fdb('0x34')][_0x7fdb('0x35')]?_0xcd7cb3[_0x7fdb('0x34')]:_0x2e0ea2['model'];if(!_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x36')](_0x7fdb('0x37'))){_0xcd7cb3[_0x7fdb('0x20')]=qs[_0x7fdb('0x20')](_0x4cecf7[_0x7fdb('0x2e')]['limit']);_0xcd7cb3[_0x7fdb('0x1d')]=qs['offset'](_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x1d')]);}_0xcd7cb3[_0x7fdb('0x38')]=qs[_0x7fdb('0x39')](_0x4cecf7['query'][_0x7fdb('0x39')]);_0xcd7cb3['where']=qs[_0x7fdb('0x30')](_[_0x7fdb('0x3a')](_0x4cecf7[_0x7fdb('0x2e')],_0x2e0ea2[_0x7fdb('0x30')]),_0x1a98f0);if(_0x4cecf7[_0x7fdb('0x2e')][_0x7fdb('0x3b')]){_0xcd7cb3[_0x7fdb('0x3c')]=_[_0x7fdb('0x3d')](_0xcd7cb3[_0x7fdb('0x3c')],{'$or':_['map'](_0x1a98f0,function(_0x37cffa){if(_0x37cffa[_0x7fdb('0x2c')]!==_0x7fdb('0x3e')){var _0x4de381={};_0x4de381[_0x37cffa['name']]={'$like':'%'+_0x4cecf7['query'][_0x7fdb('0x3b')]+'%'};return _0x4de381;}})});}_0xcd7cb3=_[_0x7fdb('0x3d')]({},_0xcd7cb3,_0x4cecf7[_0x7fdb('0x3f')]);var _0x2da46e={'where':_0xcd7cb3[_0x7fdb('0x3c')]};return db[_0x7fdb('0x29')][_0x7fdb('0x1f')](_0x2da46e)[_0x7fdb('0x22')](function(_0x5504eb){_0x4d67a2[_0x7fdb('0x1f')]=_0x5504eb;if(_0x4cecf7['query'][_0x7fdb('0x40')]){_0xcd7cb3[_0x7fdb('0x41')]=[{'all':!![]}];}return db[_0x7fdb('0x29')][_0x7fdb('0x42')](_0xcd7cb3);})[_0x7fdb('0x22')](function(_0x5bfe69){_0x4d67a2['rows']=_0x5bfe69;return _0x4d67a2;})[_0x7fdb('0x22')](respondWithFilteredResult(_0x36d013,_0xcd7cb3))[_0x7fdb('0x43')](handleError(_0x36d013,null));};exports[_0x7fdb('0x44')]=function(_0xf429ef,_0xeadcdf){var _0x288f37={'raw':!![],'where':{'id':_0xf429ef[_0x7fdb('0x45')]['id']}},_0x12a593={};_0x12a593[_0x7fdb('0x32')]=_[_0x7fdb('0x2f')](db['CmHopperAdditionalPhone'][_0x7fdb('0x2a')]);_0x12a593['query']=_['keys'](_0xf429ef['query']);_0x12a593['filters']=_['intersection'](_0x12a593[_0x7fdb('0x32')],_0x12a593[_0x7fdb('0x2e')]);_0x288f37['attributes']=_[_0x7fdb('0x31')](_0x12a593['model'],qs[_0x7fdb('0x33')](_0xf429ef['query']['fields']));_0x288f37['attributes']=_0x288f37[_0x7fdb('0x34')][_0x7fdb('0x35')]?_0x288f37[_0x7fdb('0x34')]:_0x12a593['model'];if(_0xf429ef[_0x7fdb('0x2e')]['includeAll']){_0x288f37[_0x7fdb('0x41')]=[{'all':!![]}];}_0x288f37=_[_0x7fdb('0x3d')]({},_0x288f37,_0xf429ef['options']);return db['CmHopperAdditionalPhone'][_0x7fdb('0x46')](_0x288f37)[_0x7fdb('0x22')](handleEntityNotFound(_0xeadcdf,null))[_0x7fdb('0x22')](respondWithResult(_0xeadcdf,null))['catch'](handleError(_0xeadcdf,null));};exports[_0x7fdb('0x47')]=function(_0x16ca4a,_0x3ea1a1){return db[_0x7fdb('0x29')]['create'](_0x16ca4a[_0x7fdb('0x48')],{})['then'](function(_0x5a04a8){var _0x5160ac=_0x16ca4a[_0x7fdb('0x49')][_0x7fdb('0x4a')]({'plain':!![]});if(!_0x5160ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5160ac[_0x7fdb('0x4b')]===_0x7fdb('0x49')){var _0x4a9ed0=_0x5a04a8[_0x7fdb('0x4a')]({'plain':!![]});var _0x270d62='CmHopperAdditionalPhones';return db[_0x7fdb('0x4c')][_0x7fdb('0x46')]({'where':{'name':_0x270d62,'userProfileId':_0x5160ac[_0x7fdb('0x4d')]},'raw':!![]})[_0x7fdb('0x22')](function(_0x493165){if(_0x493165&&_0x493165[_0x7fdb('0x4e')]===0x0){return db[_0x7fdb('0x24')]['create']({'name':_0x4a9ed0[_0x7fdb('0x26')],'resourceId':_0x4a9ed0['id'],'type':_0x493165[_0x7fdb('0x26')],'sectionId':_0x493165['id']},{})['then'](function(){return _0x5a04a8;});}else{return _0x5a04a8;}})['catch'](function(_0x3e0b13){logger[_0x7fdb('0x25')](_0x7fdb('0x4f'),_0x3e0b13);throw _0x3e0b13;});}return _0x5a04a8;})[_0x7fdb('0x22')](respondWithResult(_0x3ea1a1,0xc9))[_0x7fdb('0x43')](handleError(_0x3ea1a1,null));};exports[_0x7fdb('0x50')]=function(_0x36ad3d,_0x34fa2e){if(_0x36ad3d[_0x7fdb('0x48')]['id']){delete _0x36ad3d[_0x7fdb('0x48')]['id'];}return db[_0x7fdb('0x29')][_0x7fdb('0x46')]({'where':{'id':_0x36ad3d[_0x7fdb('0x45')]['id']}})[_0x7fdb('0x22')](handleEntityNotFound(_0x34fa2e,null))[_0x7fdb('0x22')](saveUpdates(_0x36ad3d[_0x7fdb('0x48')],null))[_0x7fdb('0x22')](respondWithResult(_0x34fa2e,null))[_0x7fdb('0x43')](handleError(_0x34fa2e,null));};exports[_0x7fdb('0x23')]=function(_0x44b741,_0x2dc4b2){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x44b741[_0x7fdb('0x45')]['id']}})[_0x7fdb('0x22')](handleEntityNotFound(_0x2dc4b2,null))[_0x7fdb('0x22')](removeEntity(_0x2dc4b2,null))[_0x7fdb('0x43')](handleError(_0x2dc4b2,null));}; \ No newline at end of file +var _0x465b=['destroy','get','CmHopperAdditionalPhones','end','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','rows','catch','show','params','rawAttributes','include','merge','find','create','body','user','role','userProfileId','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','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then'];(function(_0x10229d,_0x5caa45){var _0x428fab=function(_0x30eed5){while(--_0x30eed5){_0x10229d['push'](_0x10229d['shift']());}};_0x428fab(++_0x5caa45);}(_0x465b,0x81));var _0xb465=function(_0x1e7296,_0x348d18){_0x1e7296=_0x1e7296-0x0;var _0xb78708=_0x465b[_0x1e7296];return _0xb78708;};'use strict';var emlformat=require(_0xb465('0x0'));var rimraf=require(_0xb465('0x1'));var zipdir=require(_0xb465('0x2'));var jsonpatch=require(_0xb465('0x3'));var rp=require('request-promise');var moment=require(_0xb465('0x4'));var BPromise=require(_0xb465('0x5'));var Mustache=require(_0xb465('0x6'));var util=require(_0xb465('0x7'));var path=require(_0xb465('0x8'));var sox=require(_0xb465('0x9'));var csv=require(_0xb465('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb465('0xb'));var _=require(_0xb465('0xc'));var squel=require(_0xb465('0xd'));var crypto=require(_0xb465('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb465('0xf'));var toCsv=require(_0xb465('0xa'));var querystring=require(_0xb465('0x10'));var Papa=require(_0xb465('0x11'));var Redis=require(_0xb465('0x12'));var authService=require(_0xb465('0x13'));var qs=require(_0xb465('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb465('0x15'));var logger=require('../../config/logger')(_0xb465('0x16'));var utils=require(_0xb465('0x17'));var config=require(_0xb465('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb465('0x19'))['db'];function respondWithStatusCode(_0x56d88c,_0x274783){_0x274783=_0x274783||0xcc;return function(_0x427320){if(_0x427320){return _0x56d88c[_0xb465('0x1a')](_0x274783);}return _0x56d88c['status'](_0x274783)['end']();};}function respondWithResult(_0x2f20b1,_0x28cafd){_0x28cafd=_0x28cafd||0xc8;return function(_0x22c881){if(_0x22c881){return _0x2f20b1[_0xb465('0x1b')](_0x28cafd)[_0xb465('0x1c')](_0x22c881);}};}function respondWithFilteredResult(_0x57177b,_0xb14405){return function(_0x541ef3){if(_0x541ef3){var _0x17de6e=typeof _0xb14405[_0xb465('0x1d')]==='undefined'&&typeof _0xb14405[_0xb465('0x1e')]===_0xb465('0x1f');var _0x31a1a7=_0x541ef3[_0xb465('0x20')];var _0x17a7a5=_0x17de6e?0x0:_0xb14405[_0xb465('0x1d')];var _0x513c95=_0x17de6e?_0x541ef3[_0xb465('0x20')]:_0xb14405[_0xb465('0x1d')]+_0xb14405[_0xb465('0x1e')];var _0x1d1149;if(_0x513c95>=_0x31a1a7){_0x513c95=_0x31a1a7;_0x1d1149=0xc8;}else{_0x1d1149=0xce;}_0x57177b['status'](_0x1d1149);return _0x57177b[_0xb465('0x21')](_0xb465('0x22'),_0x17a7a5+'-'+_0x513c95+'/'+_0x31a1a7)[_0xb465('0x1c')](_0x541ef3);}return null;};}function patchUpdates(_0x41d83e){return function(_0x58b675){try{jsonpatch['apply'](_0x58b675,_0x41d83e,!![]);}catch(_0x1d2f81){return BPromise[_0xb465('0x23')](_0x1d2f81);}return _0x58b675[_0xb465('0x24')]();};}function saveUpdates(_0x279386,_0x18dead){return function(_0x2f4877){if(_0x2f4877){return _0x2f4877[_0xb465('0x25')](_0x279386)[_0xb465('0x26')](function(_0x24cc68){return _0x24cc68;});}return null;};}function removeEntity(_0x3f6cd3,_0x2c710e){return function(_0x550e6d){if(_0x550e6d){return _0x550e6d[_0xb465('0x27')]()[_0xb465('0x26')](function(){var _0x537c7c=_0x550e6d[_0xb465('0x28')]({'plain':!![]});var _0xf377dc=_0xb465('0x29');return db['UserProfileResource'][_0xb465('0x27')]({'where':{'type':_0xf377dc,'resourceId':_0x537c7c['id']}})[_0xb465('0x26')](function(){return _0x550e6d;});})[_0xb465('0x26')](function(){_0x3f6cd3['status'](0xcc)[_0xb465('0x2a')]();});}};}function handleEntityNotFound(_0x18f3fa,_0x4aec92){return function(_0x1f36c5){if(!_0x1f36c5){_0x18f3fa['sendStatus'](0x194);}return _0x1f36c5;};}function handleError(_0x5f5225,_0x1b64a6){_0x1b64a6=_0x1b64a6||0x1f4;return function(_0x4ab6eb){logger['error'](_0x4ab6eb[_0xb465('0x2b')]);if(_0x4ab6eb[_0xb465('0x2c')]){delete _0x4ab6eb[_0xb465('0x2c')];}_0x5f5225['status'](_0x1b64a6)[_0xb465('0x2d')](_0x4ab6eb);};}exports[_0xb465('0x2e')]=function(_0x264830,_0x578197){var _0x5d1809={},_0x289309={},_0x40960f={'count':0x0,'rows':[]};var _0x51326c=_[_0xb465('0x2f')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x253eea){return{'name':_0x253eea[_0xb465('0x30')],'type':_0x253eea[_0xb465('0x31')][_0xb465('0x32')]};});_0x289309[_0xb465('0x33')]=_[_0xb465('0x2f')](_0x51326c,_0xb465('0x2c'));_0x289309['query']=_[_0xb465('0x34')](_0x264830[_0xb465('0x35')]);_0x289309[_0xb465('0x36')]=_[_0xb465('0x37')](_0x289309[_0xb465('0x33')],_0x289309['query']);_0x5d1809[_0xb465('0x38')]=_[_0xb465('0x37')](_0x289309[_0xb465('0x33')],qs[_0xb465('0x39')](_0x264830['query'][_0xb465('0x39')]));_0x5d1809['attributes']=_0x5d1809[_0xb465('0x38')][_0xb465('0x3a')]?_0x5d1809[_0xb465('0x38')]:_0x289309[_0xb465('0x33')];if(!_0x264830[_0xb465('0x35')][_0xb465('0x3b')]('nolimit')){_0x5d1809[_0xb465('0x1e')]=qs[_0xb465('0x1e')](_0x264830[_0xb465('0x35')]['limit']);_0x5d1809[_0xb465('0x1d')]=qs[_0xb465('0x1d')](_0x264830[_0xb465('0x35')][_0xb465('0x1d')]);}_0x5d1809[_0xb465('0x3c')]=qs[_0xb465('0x3d')](_0x264830[_0xb465('0x35')]['sort']);_0x5d1809[_0xb465('0x3e')]=qs['filters'](_[_0xb465('0x3f')](_0x264830['query'],_0x289309[_0xb465('0x36')]),_0x51326c);if(_0x264830[_0xb465('0x35')]['filter']){_0x5d1809[_0xb465('0x3e')]=_['merge'](_0x5d1809[_0xb465('0x3e')],{'$or':_['map'](_0x51326c,function(_0x2e51d6){if(_0x2e51d6[_0xb465('0x31')]!==_0xb465('0x40')){var _0xba2cea={};_0xba2cea[_0x2e51d6['name']]={'$like':'%'+_0x264830['query'][_0xb465('0x41')]+'%'};return _0xba2cea;}})});}_0x5d1809=_['merge']({},_0x5d1809,_0x264830[_0xb465('0x42')]);var _0x4f1a99={'where':_0x5d1809[_0xb465('0x3e')]};return db[_0xb465('0x43')]['count'](_0x4f1a99)[_0xb465('0x26')](function(_0xa49174){_0x40960f['count']=_0xa49174;if(_0x264830[_0xb465('0x35')][_0xb465('0x44')]){_0x5d1809['include']=[{'all':!![]}];}return db[_0xb465('0x43')]['findAll'](_0x5d1809);})[_0xb465('0x26')](function(_0x98f3c6){_0x40960f[_0xb465('0x45')]=_0x98f3c6;return _0x40960f;})[_0xb465('0x26')](respondWithFilteredResult(_0x578197,_0x5d1809))[_0xb465('0x46')](handleError(_0x578197,null));};exports[_0xb465('0x47')]=function(_0x15d634,_0x5e4c83){var _0x574f9f={'raw':!![],'where':{'id':_0x15d634[_0xb465('0x48')]['id']}},_0x31c3c2={};_0x31c3c2[_0xb465('0x33')]=_[_0xb465('0x34')](db[_0xb465('0x43')][_0xb465('0x49')]);_0x31c3c2[_0xb465('0x35')]=_['keys'](_0x15d634[_0xb465('0x35')]);_0x31c3c2['filters']=_[_0xb465('0x37')](_0x31c3c2[_0xb465('0x33')],_0x31c3c2['query']);_0x574f9f[_0xb465('0x38')]=_[_0xb465('0x37')](_0x31c3c2[_0xb465('0x33')],qs[_0xb465('0x39')](_0x15d634[_0xb465('0x35')][_0xb465('0x39')]));_0x574f9f['attributes']=_0x574f9f[_0xb465('0x38')][_0xb465('0x3a')]?_0x574f9f[_0xb465('0x38')]:_0x31c3c2[_0xb465('0x33')];if(_0x15d634[_0xb465('0x35')][_0xb465('0x44')]){_0x574f9f[_0xb465('0x4a')]=[{'all':!![]}];}_0x574f9f=_[_0xb465('0x4b')]({},_0x574f9f,_0x15d634[_0xb465('0x42')]);return db['CmHopperAdditionalPhone'][_0xb465('0x4c')](_0x574f9f)[_0xb465('0x26')](handleEntityNotFound(_0x5e4c83,null))['then'](respondWithResult(_0x5e4c83,null))[_0xb465('0x46')](handleError(_0x5e4c83,null));};exports[_0xb465('0x4d')]=function(_0x4cb2f1,_0x7f50fe){return db[_0xb465('0x43')][_0xb465('0x4d')](_0x4cb2f1[_0xb465('0x4e')],{})['then'](function(_0xe44e53){var _0xdc6d6c=_0x4cb2f1[_0xb465('0x4f')]['get']({'plain':!![]});if(!_0xdc6d6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdc6d6c[_0xb465('0x50')]===_0xb465('0x4f')){var _0x2ec303=_0xe44e53[_0xb465('0x28')]({'plain':!![]});var _0x312350=_0xb465('0x29');return db['UserProfileSection'][_0xb465('0x4c')]({'where':{'name':_0x312350,'userProfileId':_0xdc6d6c[_0xb465('0x51')]},'raw':!![]})[_0xb465('0x26')](function(_0x4f2e84){if(_0x4f2e84&&_0x4f2e84['autoAssociation']===0x0){return db['UserProfileResource'][_0xb465('0x4d')]({'name':_0x2ec303['name'],'resourceId':_0x2ec303['id'],'type':_0x4f2e84['name'],'sectionId':_0x4f2e84['id']},{})['then'](function(){return _0xe44e53;});}else{return _0xe44e53;}})[_0xb465('0x46')](function(_0x6b746d){logger[_0xb465('0x52')](_0xb465('0x53'),_0x6b746d);throw _0x6b746d;});}return _0xe44e53;})[_0xb465('0x26')](respondWithResult(_0x7f50fe,0xc9))[_0xb465('0x46')](handleError(_0x7f50fe,null));};exports[_0xb465('0x25')]=function(_0x181688,_0x11ad00){if(_0x181688[_0xb465('0x4e')]['id']){delete _0x181688[_0xb465('0x4e')]['id'];}return db[_0xb465('0x43')]['find']({'where':{'id':_0x181688[_0xb465('0x48')]['id']}})[_0xb465('0x26')](handleEntityNotFound(_0x11ad00,null))[_0xb465('0x26')](saveUpdates(_0x181688[_0xb465('0x4e')],null))[_0xb465('0x26')](respondWithResult(_0x11ad00,null))['catch'](handleError(_0x11ad00,null));};exports[_0xb465('0x27')]=function(_0x53c3bc,_0x2ff61e){return db[_0xb465('0x43')][_0xb465('0x4c')]({'where':{'id':_0x53c3bc[_0xb465('0x48')]['id']}})[_0xb465('0x26')](handleEntityNotFound(_0x2ff61e,null))['then'](removeEntity(_0x2ff61e,null))[_0xb465('0x46')](handleError(_0x2ff61e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 361f537..d77c51e 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 _0x3fed=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x54c5bb,_0x398bf4){var _0x12f42d=function(_0x915a6f){while(--_0x915a6f){_0x54c5bb['push'](_0x54c5bb['shift']());}};_0x12f42d(++_0x398bf4);}(_0x3fed,0x1a4));var _0xd3fe=function(_0x28d91b,_0x2c8709){_0x28d91b=_0x28d91b-0x0;var _0x1f364b=_0x3fed[_0x28d91b];return _0x1f364b;};'use strict';var _=require(_0xd3fe('0x0'));var util=require(_0xd3fe('0x1'));var logger=require(_0xd3fe('0x2'))(_0xd3fe('0x3'));var moment=require(_0xd3fe('0x4'));var BPromise=require(_0xd3fe('0x5'));var rp=require(_0xd3fe('0x6'));var fs=require('fs');var path=require(_0xd3fe('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3fe('0x8'));module['exports']=function(_0x693071,_0x2d44d2){return _0x693071[_0xd3fe('0x9')](_0xd3fe('0xa'),attributes,{'tableName':_0xd3fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7345=['rimraf','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','moment','path'];(function(_0x1b4336,_0x55ed29){var _0x65a337=function(_0x5f26d9){while(--_0x5f26d9){_0x1b4336['push'](_0x1b4336['shift']());}};_0x65a337(++_0x55ed29);}(_0x7345,0x163));var _0x5734=function(_0x140ea3,_0xd0d9bd){_0x140ea3=_0x140ea3-0x0;var _0x309b6e=_0x7345[_0x140ea3];return _0x309b6e;};'use strict';var _=require(_0x5734('0x0'));var util=require(_0x5734('0x1'));var logger=require(_0x5734('0x2'))('api');var moment=require(_0x5734('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5734('0x4'));var rimraf=require(_0x5734('0x5'));var config=require('../../config/environment');var attributes=require(_0x5734('0x6'));module['exports']=function(_0x4253a4,_0x152395){return _0x4253a4[_0x5734('0x7')](_0x5734('0x8'),attributes,{'tableName':_0x5734('0x9'),'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 8ceb0c3..1392971 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 _0xb6f3=['then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','OrderBy','ASC','countagentrejectretry','duration','waitTime','scheduledat','add','minutes','phone','createdAt','updatedAt','countcongestionretry','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2f3d0c,_0x25c4ad){var _0x551819=function(_0x58a7e8){while(--_0x58a7e8){_0x2f3d0c['push'](_0x2f3d0c['shift']());}};_0x551819(++_0x25c4ad);}(_0xb6f3,0x146));var _0x3b6f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb6f3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3b6f('0x0'));var util=require(_0x3b6f('0x1'));var moment=require(_0x3b6f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b6f('0x4'));var logger=require(_0x3b6f('0x5'))('rpc');var config=require(_0x3b6f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3b6f('0x7')][_0x3b6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b1a2d,_0x5091dc,_0x15c266){return new BPromise(function(_0x489a3a,_0x170328){return client[_0x3b6f('0x9')](_0x3b1a2d,_0x15c266)[_0x3b6f('0xa')](function(_0x345919){logger['info'](_0x3b6f('0xb'),_0x5091dc,_0x3b6f('0xc'));logger[_0x3b6f('0xd')](_0x3b6f('0xe'),_0x5091dc,_0x3b6f('0xc'),JSON[_0x3b6f('0xf')](_0x345919));if(_0x345919[_0x3b6f('0x10')]){if(_0x345919['error'][_0x3b6f('0x11')]===0x1f4){logger[_0x3b6f('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5091dc,_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);return _0x170328(_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);}logger[_0x3b6f('0x10')](_0x3b6f('0xb'),_0x5091dc,_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);return _0x489a3a(_0x345919[_0x3b6f('0x10')][_0x3b6f('0x12')]);}else{logger[_0x3b6f('0x13')](_0x3b6f('0xb'),_0x5091dc,_0x3b6f('0xc'));_0x489a3a(_0x345919[_0x3b6f('0x14')][_0x3b6f('0x12')]);}})[_0x3b6f('0x15')](function(_0x1d541d){logger[_0x3b6f('0x10')](_0x3b6f('0xb'),_0x5091dc,_0x1d541d);_0x170328(_0x1d541d);});});}exports[_0x3b6f('0x16')]=function(_0x58c650){var _0x4e36f0=this;return new Promise(function(_0x3622a8,_0x56cd69){return db[_0x3b6f('0x17')][_0x3b6f('0x18')]({'raw':!![],'where':{'ContactId':_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1a')],'ListId':_0x58c650['body'][_0x3b6f('0x1b')],'VoiceQueueId':_0x58c650[_0x3b6f('0x19')]['VoiceQueueId']===undefined?null:_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1c')],'CampaignId':_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1d')]===undefined?null:_0x58c650[_0x3b6f('0x19')][_0x3b6f('0x1d')]}})[_0x3b6f('0xa')](function(_0x413d27){if(_0x413d27!=null){return db[_0x3b6f('0x1e')][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x413d27['id'],'OrderBy':{'$gt':_0x413d27['OrderBy']}},'order':[['OrderBy','ASC']]})[_0x3b6f('0xa')](function(_0x5f5168){var _0x1587c7=0x0;if(_0x5f5168){if(_0x5f5168[_0x3b6f('0x1f')]+_0x5f5168['countcongestionretry']+_0x5f5168[_0x3b6f('0x20')]+_0x5f5168[_0x3b6f('0x21')]+_0x5f5168[_0x3b6f('0x22')]+_0x5f5168[_0x3b6f('0x23')]+_0x5f5168[_0x3b6f('0x24')]+_0x5f5168['countagentrejectretry']<_0x58c650[_0x3b6f('0x25')][_0x3b6f('0x26')])_0x1587c7=0x1;_0x3622a8({'additional':_0x1587c7});}else{return db[_0x3b6f('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x413d27['id']},'order':[[_0x3b6f('0x27'),_0x3b6f('0x28')]]})[_0x3b6f('0xa')](function(_0x43bc8b){var _0x13a804=0x0;if(_0x43bc8b){if(_0x43bc8b[_0x3b6f('0x1f')]+_0x43bc8b['countcongestionretry']+_0x43bc8b['countnoanswerretry']+_0x43bc8b[_0x3b6f('0x21')]+_0x43bc8b['countdropretry']+_0x43bc8b[_0x3b6f('0x23')]+_0x43bc8b[_0x3b6f('0x24')]+_0x43bc8b[_0x3b6f('0x29')]<_0x58c650[_0x3b6f('0x25')][_0x3b6f('0x26')])_0x13a804=0x1;_0x3622a8({'additional':_0x13a804});}else{_0x3622a8({'additional':0x0});}})[_0x3b6f('0x15')](function(_0x71be1d){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x71be1d['message']);_0x56cd69(_0x4e36f0[_0x3b6f('0x10')](0x1f4,_0x71be1d[_0x3b6f('0x12')]));});}})[_0x3b6f('0x15')](function(_0x49ab74){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x49ab74['message']);_0x56cd69(_0x4e36f0[_0x3b6f('0x10')](0x1f4,_0x49ab74[_0x3b6f('0x12')]));});}else _0x3622a8({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x431c94){var _0x358ea8=this;return new Promise(function(_0x454ad9,_0x44592d){return db[_0x3b6f('0x17')][_0x3b6f('0x18')]({'raw':!![],'where':{'ContactId':_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1a')],'ListId':_0x431c94['body'][_0x3b6f('0x1b')],'VoiceQueueId':_0x431c94['body'][_0x3b6f('0x1c')]===undefined?null:_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1c')],'CampaignId':_0x431c94['body'][_0x3b6f('0x1d')]===undefined?null:_0x431c94[_0x3b6f('0x19')][_0x3b6f('0x1d')]}})['then'](function(_0xb9420a){if(_0xb9420a!=null){return db['CmHopperAdditionalPhone'][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0xb9420a['id'],'OrderBy':{'$gte':_0xb9420a[_0x3b6f('0x27')]}},'order':[['OrderBy','ASC']]})[_0x3b6f('0xa')](function(_0x1f7250){if(_0x1f7250)return activateAdditionalPhone(_0xb9420a,_0x431c94[_0x3b6f('0x19')],_0x1f7250,_0x431c94[_0x3b6f('0x2a')],_0x431c94[_0x3b6f('0x2b')])[_0x3b6f('0xa')](function(_0x6a5211){_0x454ad9(_0x6a5211);});else{return db['CmHopperAdditionalPhone'][_0x3b6f('0x18')]({'raw':!![],'where':{'CmHopperId':_0xb9420a['id']},'order':[[_0x3b6f('0x27'),'ASC']]})[_0x3b6f('0xa')](function(_0x545dc2){if(_0x545dc2)return activateAdditionalPhone(_0xb9420a,_0x431c94[_0x3b6f('0x19')],_0x545dc2,_0x431c94['duration'],_0x431c94['waitTime'])[_0x3b6f('0xa')](function(_0x150301){_0x454ad9(_0x150301);});else{_0x454ad9({'id':_0xb9420a['id'],'phone':''});}})['catch'](function(_0x4ed107){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x4ed107[_0x3b6f('0x12')]);_0x44592d(_0x358ea8[_0x3b6f('0x10')](0x1f4,_0x4ed107[_0x3b6f('0x12')]));});}})[_0x3b6f('0x15')](function(_0x5c6cb6){logger[_0x3b6f('0x10')](_0x3b6f('0x16'),_0x5c6cb6[_0x3b6f('0x12')]);_0x44592d(_0x358ea8[_0x3b6f('0x10')](0x1f4,_0x5c6cb6[_0x3b6f('0x12')]));});}else _0x454ad9(0x1);});});};function activateAdditionalPhone(_0x369ab0,_0x2e8bc1,_0x213478,_0x4367a9,_0xb5b4f9){return new Promise(function(_0x2ba88,_0x2f5404){var _0x538e37;if(_['isNil'](_0x213478[_0x3b6f('0x2c')])){_0x213478['scheduledat']=moment();}if(moment()>moment(_0x213478[_0x3b6f('0x2c')])){_0x538e37=moment()[_0x3b6f('0x2d')](_0xb5b4f9||0x3,'minutes');}else{if(_0x213478[_0x3b6f('0x27')]==0x0){_0x538e37=moment(_0x213478['scheduledat']);}else{_0x538e37=moment()['add'](_0xb5b4f9||0x3,'minutes');}}if(_['isNil'](_0x538e37)){_0x538e37=moment()[_0x3b6f('0x2d')](_0xb5b4f9||0x3,_0x3b6f('0x2e'));}var _0x31224b={'phone':_0x369ab0[_0x3b6f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x369ab0[_0x3b6f('0x27')])?0x0:_0x369ab0[_0x3b6f('0x27')],'scheduledat':moment()[_0x3b6f('0x2d')](_0x4367a9||0x1,'minutes'),'countbusyretry':_0x2e8bc1[_0x3b6f('0x1f')],'countcongestionretry':_0x2e8bc1['countcongestionretry'],'countnoanswerretry':_0x2e8bc1[_0x3b6f('0x20')],'countnosuchnumberretry':_0x2e8bc1[_0x3b6f('0x21')],'countdropretry':_0x2e8bc1['countdropretry'],'countabandonedretry':_0x2e8bc1[_0x3b6f('0x23')],'countmachineretry':_0x2e8bc1['countmachineretry'],'countagentrejectretry':_0x2e8bc1[_0x3b6f('0x29')],'createdAt':_0x2e8bc1[_0x3b6f('0x30')],'updatedAt':_0x2e8bc1[_0x3b6f('0x31')]};var _0x54c94b={'CmHopperId':_0x369ab0['id'],'phone':_0x213478[_0x3b6f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x213478[_0x3b6f('0x27')])?0x0:_0x213478['OrderBy'],'scheduledat':_0x538e37,'countbusyretry':_0x213478[_0x3b6f('0x1f')],'countcongestionretry':_0x213478[_0x3b6f('0x32')],'countnoanswerretry':_0x213478[_0x3b6f('0x20')],'countnosuchnumberretry':_0x213478[_0x3b6f('0x21')],'countdropretry':_0x213478[_0x3b6f('0x22')],'countabandonedretry':_0x213478[_0x3b6f('0x23')],'countmachineretry':_0x213478[_0x3b6f('0x24')],'countagentrejectretry':_0x213478[_0x3b6f('0x29')],'createdAt':_0x213478['createdAt'],'updatedAt':_0x213478[_0x3b6f('0x31')]};return db[_0x3b6f('0x33')][_0x3b6f('0x34')](function(_0x5ed6f0){return db[_0x3b6f('0x1e')]['update'](_0x31224b,{'where':{'id':_0x213478['id']}},{'transaction':_0x5ed6f0})[_0x3b6f('0xa')](function(){return db[_0x3b6f('0x17')]['update'](_0x54c94b,{'where':{'id':_0x369ab0['id']}},{'transaction':_0x5ed6f0});});})[_0x3b6f('0xa')](function(_0x184ecf){_0x2ba88({'id':_0x369ab0['id'],'phone':_0x213478['phone']});})['catch'](function(_0x2354df){logger[_0x3b6f('0x10')]('activateAdditionalPhone',_0x2354df[_0x3b6f('0x12')]);_0x2f5404({'error':_0x2354df['message']});});});}exports[_0x3b6f('0x35')]=function(_0x44569d){var _0x3ba97a=this;return new Promise(function(_0x5e34a1,_0x3254d7){return db['CmHopper'][_0x3b6f('0x36')](_0x44569d['body'][_0x3b6f('0x37')],{'where':{'id':_0x44569d[_0x3b6f('0x19')]['id']}})[_0x3b6f('0xa')](function(_0x1e7e6f){_0x5e34a1(_0x1e7e6f);})['catch'](function(_0x13e51e){logger[_0x3b6f('0x10')](_0x3b6f('0x35'),_0x13e51e[_0x3b6f('0x12')]);_0x3254d7(_0x3ba97a[_0x3b6f('0x10')](0x1f4,_0x13e51e[_0x3b6f('0x12')]));});});}; \ No newline at end of file +var _0x4396=['CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','ASC','countnosuchnumberretry','catch','SwapAdditionalPhones','waitTime','duration','scheduledat','minutes','add','isNil','phone','createdAt','updatedAt','sequelize','update','IncrementPreviewCounters','field','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x5082cd,_0xefc947){var _0x474e19=function(_0x4c19a4){while(--_0x4c19a4){_0x5082cd['push'](_0x5082cd['shift']());}};_0x474e19(++_0xefc947);}(_0x4396,0x138));var _0x6439=function(_0x142156,_0x5169f8){_0x142156=_0x142156-0x0;var _0x5b1ea3=_0x4396[_0x142156];return _0x5b1ea3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6439('0x0'));var BPromise=require(_0x6439('0x1'));var rs=require(_0x6439('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6439('0x3'))['db'];var utils=require(_0x6439('0x4'));var logger=require(_0x6439('0x5'))(_0x6439('0x6'));var config=require(_0x6439('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6439('0x8')][_0x6439('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20679b,_0x3d1b8b,_0x32bfcf){return new BPromise(function(_0x456302,_0x10ea21){return client[_0x6439('0xa')](_0x20679b,_0x32bfcf)['then'](function(_0x3cf63b){logger['info'](_0x6439('0xb'),_0x3d1b8b,'request\x20sent');logger['debug'](_0x6439('0xc'),_0x3d1b8b,_0x6439('0xd'),JSON['stringify'](_0x3cf63b));if(_0x3cf63b[_0x6439('0xe')]){if(_0x3cf63b[_0x6439('0xe')][_0x6439('0xf')]===0x1f4){logger[_0x6439('0xe')](_0x6439('0xb'),_0x3d1b8b,_0x3cf63b[_0x6439('0xe')][_0x6439('0x10')]);return _0x10ea21(_0x3cf63b['error'][_0x6439('0x10')]);}logger[_0x6439('0xe')](_0x6439('0xb'),_0x3d1b8b,_0x3cf63b['error'][_0x6439('0x10')]);return _0x456302(_0x3cf63b[_0x6439('0xe')]['message']);}else{logger[_0x6439('0x11')](_0x6439('0xb'),_0x3d1b8b,'request\x20sent');_0x456302(_0x3cf63b['result']['message']);}})['catch'](function(_0x1b4bd0){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3d1b8b,_0x1b4bd0);_0x10ea21(_0x1b4bd0);});});}exports[_0x6439('0x12')]=function(_0x11f3f1){var _0x34b78c=this;return new Promise(function(_0x23b4cd,_0x2d476e){return db[_0x6439('0x13')]['findOne']({'raw':!![],'where':{'ContactId':_0x11f3f1[_0x6439('0x14')][_0x6439('0x15')],'ListId':_0x11f3f1[_0x6439('0x14')][_0x6439('0x16')],'VoiceQueueId':_0x11f3f1[_0x6439('0x14')][_0x6439('0x17')]===undefined?null:_0x11f3f1[_0x6439('0x14')][_0x6439('0x17')],'CampaignId':_0x11f3f1[_0x6439('0x14')][_0x6439('0x18')]===undefined?null:_0x11f3f1['body'][_0x6439('0x18')]}})[_0x6439('0x19')](function(_0x19ac22){if(_0x19ac22!=null){return db[_0x6439('0x1a')][_0x6439('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x19ac22['id'],'OrderBy':{'$gt':_0x19ac22['OrderBy']}},'order':[[_0x6439('0x1c'),'ASC']]})['then'](function(_0x11505c){var _0x16f140=0x0;if(_0x11505c){if(_0x11505c[_0x6439('0x1d')]+_0x11505c[_0x6439('0x1e')]+_0x11505c[_0x6439('0x1f')]+_0x11505c['countnosuchnumberretry']+_0x11505c[_0x6439('0x20')]+_0x11505c[_0x6439('0x21')]+_0x11505c[_0x6439('0x22')]+_0x11505c[_0x6439('0x23')]<_0x11f3f1[_0x6439('0x24')]['dialGlobalMaxRetry'])_0x16f140=0x1;_0x23b4cd({'additional':_0x16f140});}else{return db[_0x6439('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x19ac22['id']},'order':[[_0x6439('0x1c'),_0x6439('0x25')]]})[_0x6439('0x19')](function(_0x2b3faa){var _0x2f36cc=0x0;if(_0x2b3faa){if(_0x2b3faa[_0x6439('0x1d')]+_0x2b3faa[_0x6439('0x1e')]+_0x2b3faa['countnoanswerretry']+_0x2b3faa[_0x6439('0x26')]+_0x2b3faa['countdropretry']+_0x2b3faa[_0x6439('0x21')]+_0x2b3faa[_0x6439('0x22')]+_0x2b3faa[_0x6439('0x23')]<_0x11f3f1['entity']['dialGlobalMaxRetry'])_0x2f36cc=0x1;_0x23b4cd({'additional':_0x2f36cc});}else{_0x23b4cd({'additional':0x0});}})['catch'](function(_0xf7048d){logger[_0x6439('0xe')]('VerifyAdditionalPhones',_0xf7048d[_0x6439('0x10')]);_0x2d476e(_0x34b78c[_0x6439('0xe')](0x1f4,_0xf7048d[_0x6439('0x10')]));});}})[_0x6439('0x27')](function(_0x39f283){logger[_0x6439('0xe')]('VerifyAdditionalPhones',_0x39f283[_0x6439('0x10')]);_0x2d476e(_0x34b78c[_0x6439('0xe')](0x1f4,_0x39f283[_0x6439('0x10')]));});}else _0x23b4cd({'additional':0x0});});});};exports[_0x6439('0x28')]=function(_0xe6c622){var _0x170ed3=this;return new Promise(function(_0x337df2,_0x23b144){return db[_0x6439('0x13')]['findOne']({'raw':!![],'where':{'ContactId':_0xe6c622[_0x6439('0x14')][_0x6439('0x15')],'ListId':_0xe6c622[_0x6439('0x14')][_0x6439('0x16')],'VoiceQueueId':_0xe6c622['body'][_0x6439('0x17')]===undefined?null:_0xe6c622['body'][_0x6439('0x17')],'CampaignId':_0xe6c622[_0x6439('0x14')][_0x6439('0x18')]===undefined?null:_0xe6c622[_0x6439('0x14')][_0x6439('0x18')]}})[_0x6439('0x19')](function(_0x5d2a7d){if(_0x5d2a7d!=null){return db[_0x6439('0x1a')][_0x6439('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x5d2a7d['id'],'OrderBy':{'$gte':_0x5d2a7d[_0x6439('0x1c')]}},'order':[[_0x6439('0x1c'),_0x6439('0x25')]]})[_0x6439('0x19')](function(_0x3d9e63){if(_0x3d9e63)return activateAdditionalPhone(_0x5d2a7d,_0xe6c622['body'],_0x3d9e63,_0xe6c622['duration'],_0xe6c622[_0x6439('0x29')])[_0x6439('0x19')](function(_0x4e2850){_0x337df2(_0x4e2850);});else{return db[_0x6439('0x1a')][_0x6439('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x5d2a7d['id']},'order':[[_0x6439('0x1c'),_0x6439('0x25')]]})[_0x6439('0x19')](function(_0x3c7f86){if(_0x3c7f86)return activateAdditionalPhone(_0x5d2a7d,_0xe6c622[_0x6439('0x14')],_0x3c7f86,_0xe6c622[_0x6439('0x2a')],_0xe6c622[_0x6439('0x29')])[_0x6439('0x19')](function(_0x29215a){_0x337df2(_0x29215a);});else{_0x337df2({'id':_0x5d2a7d['id'],'phone':''});}})['catch'](function(_0x4a215c){logger[_0x6439('0xe')](_0x6439('0x12'),_0x4a215c[_0x6439('0x10')]);_0x23b144(_0x170ed3[_0x6439('0xe')](0x1f4,_0x4a215c[_0x6439('0x10')]));});}})[_0x6439('0x27')](function(_0x3dadd2){logger[_0x6439('0xe')]('VerifyAdditionalPhones',_0x3dadd2['message']);_0x23b144(_0x170ed3['error'](0x1f4,_0x3dadd2[_0x6439('0x10')]));});}else _0x337df2(0x1);});});};function activateAdditionalPhone(_0x1003ff,_0x3f40f6,_0x5ba02b,_0x4970e1,_0x2c1600){return new Promise(function(_0x46a9a3,_0xb87dbc){var _0x4e7821;if(_['isNil'](_0x5ba02b[_0x6439('0x2b')])){_0x5ba02b[_0x6439('0x2b')]=moment();}if(moment()>moment(_0x5ba02b[_0x6439('0x2b')])){_0x4e7821=moment()['add'](_0x2c1600||0x3,_0x6439('0x2c'));}else{if(_0x5ba02b['OrderBy']==0x0){_0x4e7821=moment(_0x5ba02b[_0x6439('0x2b')]);}else{_0x4e7821=moment()[_0x6439('0x2d')](_0x2c1600||0x3,_0x6439('0x2c'));}}if(_[_0x6439('0x2e')](_0x4e7821)){_0x4e7821=moment()[_0x6439('0x2d')](_0x2c1600||0x3,_0x6439('0x2c'));}var _0x88750b={'phone':_0x1003ff[_0x6439('0x2f')],'active':0x0,'OrderBy':_[_0x6439('0x2e')](_0x1003ff[_0x6439('0x1c')])?0x0:_0x1003ff[_0x6439('0x1c')],'scheduledat':moment()[_0x6439('0x2d')](_0x4970e1||0x1,'minutes'),'countbusyretry':_0x3f40f6['countbusyretry'],'countcongestionretry':_0x3f40f6[_0x6439('0x1e')],'countnoanswerretry':_0x3f40f6['countnoanswerretry'],'countnosuchnumberretry':_0x3f40f6[_0x6439('0x26')],'countdropretry':_0x3f40f6['countdropretry'],'countabandonedretry':_0x3f40f6[_0x6439('0x21')],'countmachineretry':_0x3f40f6[_0x6439('0x22')],'countagentrejectretry':_0x3f40f6[_0x6439('0x23')],'createdAt':_0x3f40f6[_0x6439('0x30')],'updatedAt':_0x3f40f6['updatedAt']};var _0x449071={'CmHopperId':_0x1003ff['id'],'phone':_0x5ba02b[_0x6439('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x5ba02b['OrderBy'])?0x0:_0x5ba02b[_0x6439('0x1c')],'scheduledat':_0x4e7821,'countbusyretry':_0x5ba02b[_0x6439('0x1d')],'countcongestionretry':_0x5ba02b[_0x6439('0x1e')],'countnoanswerretry':_0x5ba02b[_0x6439('0x1f')],'countnosuchnumberretry':_0x5ba02b[_0x6439('0x26')],'countdropretry':_0x5ba02b[_0x6439('0x20')],'countabandonedretry':_0x5ba02b[_0x6439('0x21')],'countmachineretry':_0x5ba02b[_0x6439('0x22')],'countagentrejectretry':_0x5ba02b['countagentrejectretry'],'createdAt':_0x5ba02b[_0x6439('0x30')],'updatedAt':_0x5ba02b[_0x6439('0x31')]};return db[_0x6439('0x32')]['transaction'](function(_0x6bd6b5){return db['CmHopperAdditionalPhone'][_0x6439('0x33')](_0x88750b,{'where':{'id':_0x5ba02b['id']}},{'transaction':_0x6bd6b5})[_0x6439('0x19')](function(){return db[_0x6439('0x13')][_0x6439('0x33')](_0x449071,{'where':{'id':_0x1003ff['id']}},{'transaction':_0x6bd6b5});});})['then'](function(_0x4f86c1){_0x46a9a3({'id':_0x1003ff['id'],'phone':_0x5ba02b[_0x6439('0x2f')]});})['catch'](function(_0x4107c4){logger[_0x6439('0xe')]('activateAdditionalPhone',_0x4107c4['message']);_0xb87dbc({'error':_0x4107c4[_0x6439('0x10')]});});});}exports[_0x6439('0x34')]=function(_0x48fd29){var _0x2b8598=this;return new Promise(function(_0x1f9c44,_0x4eee29){return db[_0x6439('0x13')][_0x6439('0x33')](_0x48fd29[_0x6439('0x14')][_0x6439('0x35')],{'where':{'id':_0x48fd29[_0x6439('0x14')]['id']}})['then'](function(_0x260a68){_0x1f9c44(_0x260a68);})[_0x6439('0x27')](function(_0x404e34){logger[_0x6439('0xe')](_0x6439('0x34'),_0x404e34['message']);_0x4eee29(_0x2b8598[_0x6439('0xe')](0x1f4,_0x404e34['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index d330d54..bcd9af7 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 _0xecac=['multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports'];(function(_0x4a3240,_0x3a3cb6){var _0x3e8e83=function(_0x592703){while(--_0x592703){_0x4a3240['push'](_0x4a3240['shift']());}};_0x3e8e83(++_0x3a3cb6);}(_0xecac,0x100));var _0xceca=function(_0xc932c3,_0x1ebbcc){_0xc932c3=_0xc932c3-0x0;var _0x331fd1=_0xecac[_0xc932c3];return _0x331fd1;};'use strict';var multer=require(_0xceca('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xceca('0x1'));var router=express[_0xceca('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xceca('0x3'));var interaction=require(_0xceca('0x4'));var config=require(_0xceca('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xceca('0x6')](),controller[_0xceca('0x7')]);router['get']('/:id',auth[_0xceca('0x6')](),controller[_0xceca('0x8')]);router[_0xceca('0x9')]('/',auth[_0xceca('0x6')](),controller[_0xceca('0xa')]);router['put'](_0xceca('0xb'),auth[_0xceca('0x6')](),controller[_0xceca('0xc')]);router[_0xceca('0xd')](_0xceca('0xb'),auth[_0xceca('0x6')](),controller[_0xceca('0xe')]);module[_0xceca('0xf')]=router; \ No newline at end of file +var _0x4443=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0xb2702d,_0x445e4e){var _0x56b206=function(_0x30bd90){while(--_0x30bd90){_0xb2702d['push'](_0xb2702d['shift']());}};_0x56b206(++_0x445e4e);}(_0x4443,0x71));var _0x3444=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4443[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x3444('0x0'));var util=require('util');var path=require(_0x3444('0x1'));var timeout=require(_0x3444('0x2'));var express=require(_0x3444('0x3'));var router=express[_0x3444('0x4')]();var fs_extra=require(_0x3444('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3444('0x6'));var config=require(_0x3444('0x7'));var controller=require(_0x3444('0x8'));router[_0x3444('0x9')]('/',auth[_0x3444('0xa')](),controller[_0x3444('0xb')]);router[_0x3444('0x9')](_0x3444('0xc'),auth['isAuthenticated'](),controller[_0x3444('0xd')]);router[_0x3444('0xe')]('/',auth[_0x3444('0xa')](),controller['create']);router[_0x3444('0xf')](_0x3444('0xc'),auth[_0x3444('0xa')](),controller[_0x3444('0x10')]);router[_0x3444('0x11')]('/:id',auth[_0x3444('0xa')](),controller['destroy']);module[_0x3444('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 419a879..2edb1bb 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 _0x4873=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x25a392,_0x5c88c7){var _0x1b1e67=function(_0x219417){while(--_0x219417){_0x25a392['push'](_0x25a392['shift']());}};_0x1b1e67(++_0x5c88c7);}(_0x4873,0x1df));var _0x3487=function(_0x2785f9,_0xdc7878){_0x2785f9=_0x2785f9-0x0;var _0x435e59=_0x4873[_0x2785f9];return _0x435e59;};'use strict';var moment=require(_0x3487('0x0'));var Sequelize=require(_0x3487('0x1'));module[_0x3487('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3487('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3487('0x4')},'VoiceQueueId':{'type':Sequelize[_0x3487('0x3')],'unique':_0x3487('0x4')}}; \ No newline at end of file +var _0x1d63=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x14da3f,_0x46a465){var _0x5816be=function(_0x1218d9){while(--_0x1218d9){_0x14da3f['push'](_0x14da3f['shift']());}};_0x5816be(++_0x46a465);}(_0x1d63,0x16f));var _0x31d6=function(_0x897249,_0x3f98ee){_0x897249=_0x897249-0x0;var _0x95fed=_0x1d63[_0x897249];return _0x95fed;};'use strict';var moment=require(_0x31d6('0x0'));var Sequelize=require('sequelize');module[_0x31d6('0x1')]={'phone':{'type':Sequelize[_0x31d6('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x31d6('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x31d6('0x3')],'unique':_0x31d6('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x31d6('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 3d1b420..4502fcb 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 _0xbade=['fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','end','stack','name','send','index','map','CmHopperBlack','rawAttributes'];(function(_0x40f5ba,_0x3efba3){var _0x5197b7=function(_0x4e032b){while(--_0x4e032b){_0x40f5ba['push'](_0x40f5ba['shift']());}};_0x5197b7(++_0x3efba3);}(_0xbade,0x1ce));var _0xebad=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xbade[_0x5f5cce];return _0x705ecf;};'use strict';var emlformat=require(_0xebad('0x0'));var rimraf=require(_0xebad('0x1'));var zipdir=require(_0xebad('0x2'));var jsonpatch=require(_0xebad('0x3'));var rp=require('request-promise');var moment=require(_0xebad('0x4'));var BPromise=require(_0xebad('0x5'));var Mustache=require(_0xebad('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xebad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xebad('0x8'));var crypto=require(_0xebad('0x9'));var jsforce=require(_0xebad('0xa'));var deskjs=require(_0xebad('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xebad('0xc'));var Redis=require(_0xebad('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xebad('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebad('0xf'))(_0xebad('0x10'));var utils=require(_0xebad('0x11'));var config=require(_0xebad('0x12'));var licenseUtil=require(_0xebad('0x13'));var db=require(_0xebad('0x14'))['db'];function respondWithStatusCode(_0x24618a,_0x371738){_0x371738=_0x371738||0xcc;return function(_0x55e571){if(_0x55e571){return _0x24618a[_0xebad('0x15')](_0x371738);}return _0x24618a[_0xebad('0x16')](_0x371738)['end']();};}function respondWithResult(_0x630e5f,_0x599c02){_0x599c02=_0x599c02||0xc8;return function(_0x25dd13){if(_0x25dd13){return _0x630e5f[_0xebad('0x16')](_0x599c02)['json'](_0x25dd13);}};}function respondWithFilteredResult(_0x28f1d3,_0x57067e){return function(_0x364436){if(_0x364436){var _0x5c98f2=typeof _0x57067e[_0xebad('0x17')]===_0xebad('0x18')&&typeof _0x57067e[_0xebad('0x19')]===_0xebad('0x18');var _0x4f5807=_0x364436[_0xebad('0x1a')];var _0xb28f3=_0x5c98f2?0x0:_0x57067e['offset'];var _0x2dfc2a=_0x5c98f2?_0x364436[_0xebad('0x1a')]:_0x57067e[_0xebad('0x17')]+_0x57067e['limit'];var _0x483283;if(_0x2dfc2a>=_0x4f5807){_0x2dfc2a=_0x4f5807;_0x483283=0xc8;}else{_0x483283=0xce;}_0x28f1d3[_0xebad('0x16')](_0x483283);return _0x28f1d3[_0xebad('0x1b')](_0xebad('0x1c'),_0xb28f3+'-'+_0x2dfc2a+'/'+_0x4f5807)[_0xebad('0x1d')](_0x364436);}return null;};}function patchUpdates(_0x4854b3){return function(_0xdf20f5){try{jsonpatch[_0xebad('0x1e')](_0xdf20f5,_0x4854b3,!![]);}catch(_0x42dbdf){return BPromise['reject'](_0x42dbdf);}return _0xdf20f5[_0xebad('0x1f')]();};}function saveUpdates(_0x5ad594,_0x28c87b){return function(_0x146515){if(_0x146515){return _0x146515['update'](_0x5ad594)[_0xebad('0x20')](function(_0x5a241d){return _0x5a241d;});}return null;};}function removeEntity(_0x1c6577,_0x2d9c7a){return function(_0x30fa50){if(_0x30fa50){return _0x30fa50[_0xebad('0x21')]()[_0xebad('0x20')](function(){_0x1c6577[_0xebad('0x16')](0xcc)[_0xebad('0x22')]();});}};}function handleEntityNotFound(_0x12c181,_0x2809f7){return function(_0x329552){if(!_0x329552){_0x12c181[_0xebad('0x15')](0x194);}return _0x329552;};}function handleError(_0xdf1bee,_0x47d28a){_0x47d28a=_0x47d28a||0x1f4;return function(_0x223bf8){logger['error'](_0x223bf8[_0xebad('0x23')]);if(_0x223bf8['name']){delete _0x223bf8[_0xebad('0x24')];}_0xdf1bee['status'](_0x47d28a)[_0xebad('0x25')](_0x223bf8);};}exports[_0xebad('0x26')]=function(_0x39cd9f,_0x4a6009){var _0x5103a1={},_0x564826={},_0x45f9be={'count':0x0,'rows':[]};var _0x1380a3=_[_0xebad('0x27')](db[_0xebad('0x28')][_0xebad('0x29')],function(_0x10aa41){return{'name':_0x10aa41[_0xebad('0x2a')],'type':_0x10aa41[_0xebad('0x2b')][_0xebad('0x2c')]};});_0x564826['model']=_[_0xebad('0x27')](_0x1380a3,'name');_0x564826[_0xebad('0x2d')]=_[_0xebad('0x2e')](_0x39cd9f[_0xebad('0x2d')]);_0x564826['filters']=_[_0xebad('0x2f')](_0x564826[_0xebad('0x30')],_0x564826[_0xebad('0x2d')]);_0x5103a1[_0xebad('0x31')]=_[_0xebad('0x2f')](_0x564826[_0xebad('0x30')],qs[_0xebad('0x32')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x32')]));_0x5103a1['attributes']=_0x5103a1[_0xebad('0x31')][_0xebad('0x33')]?_0x5103a1[_0xebad('0x31')]:_0x564826[_0xebad('0x30')];if(!_0x39cd9f[_0xebad('0x2d')][_0xebad('0x34')](_0xebad('0x35'))){_0x5103a1[_0xebad('0x19')]=qs[_0xebad('0x19')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x19')]);_0x5103a1['offset']=qs[_0xebad('0x17')](_0x39cd9f[_0xebad('0x2d')][_0xebad('0x17')]);}_0x5103a1[_0xebad('0x36')]=qs[_0xebad('0x37')](_0x39cd9f['query'][_0xebad('0x37')]);_0x5103a1['where']=qs[_0xebad('0x38')](_[_0xebad('0x39')](_0x39cd9f[_0xebad('0x2d')],_0x564826[_0xebad('0x38')]),_0x1380a3);if(_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3a')]){_0x5103a1[_0xebad('0x3b')]=_[_0xebad('0x3c')](_0x5103a1['where'],{'$or':_[_0xebad('0x27')](_0x1380a3,function(_0x4feaba){if(_0x4feaba[_0xebad('0x2b')]!==_0xebad('0x3d')){var _0x11433c={};_0x11433c[_0x4feaba['name']]={'$like':'%'+_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3a')]+'%'};return _0x11433c;}})});}_0x5103a1=_[_0xebad('0x3c')]({},_0x5103a1,_0x39cd9f['options']);var _0x3e85bd={'where':_0x5103a1[_0xebad('0x3b')]};return db[_0xebad('0x28')][_0xebad('0x1a')](_0x3e85bd)[_0xebad('0x20')](function(_0x168f14){_0x45f9be[_0xebad('0x1a')]=_0x168f14;if(_0x39cd9f[_0xebad('0x2d')][_0xebad('0x3e')]){_0x5103a1['include']=[{'all':!![]}];}return db[_0xebad('0x28')]['findAll'](_0x5103a1);})[_0xebad('0x20')](function(_0x508ae7){_0x45f9be[_0xebad('0x3f')]=_0x508ae7;return _0x45f9be;})['then'](respondWithFilteredResult(_0x4a6009,_0x5103a1))[_0xebad('0x40')](handleError(_0x4a6009,null));};exports[_0xebad('0x41')]=function(_0x19ab22,_0x2dfd5e){var _0xd6ae04={'raw':!![],'where':{'id':_0x19ab22[_0xebad('0x42')]['id']}},_0x38496a={};_0x38496a['model']=_['keys'](db['CmHopperBlack'][_0xebad('0x29')]);_0x38496a[_0xebad('0x2d')]=_[_0xebad('0x2e')](_0x19ab22[_0xebad('0x2d')]);_0x38496a[_0xebad('0x38')]=_[_0xebad('0x2f')](_0x38496a[_0xebad('0x30')],_0x38496a[_0xebad('0x2d')]);_0xd6ae04[_0xebad('0x31')]=_[_0xebad('0x2f')](_0x38496a[_0xebad('0x30')],qs['fields'](_0x19ab22[_0xebad('0x2d')]['fields']));_0xd6ae04['attributes']=_0xd6ae04[_0xebad('0x31')]['length']?_0xd6ae04[_0xebad('0x31')]:_0x38496a[_0xebad('0x30')];if(_0x19ab22[_0xebad('0x2d')][_0xebad('0x3e')]){_0xd6ae04[_0xebad('0x43')]=[{'all':!![]}];}_0xd6ae04=_[_0xebad('0x3c')]({},_0xd6ae04,_0x19ab22['options']);return db[_0xebad('0x28')]['find'](_0xd6ae04)[_0xebad('0x20')](handleEntityNotFound(_0x2dfd5e,null))[_0xebad('0x20')](respondWithResult(_0x2dfd5e,null))[_0xebad('0x40')](handleError(_0x2dfd5e,null));};exports[_0xebad('0x44')]=function(_0x5cc982,_0x45d025){if(_0x5cc982[_0xebad('0x45')]['id']){delete _0x5cc982[_0xebad('0x45')]['id'];}return db['CmHopperBlack'][_0xebad('0x46')]({'where':{'id':_0x5cc982[_0xebad('0x42')]['id']}})[_0xebad('0x20')](handleEntityNotFound(_0x45d025,null))[_0xebad('0x20')](saveUpdates(_0x5cc982[_0xebad('0x45')],null))['then'](respondWithResult(_0x45d025,null))[_0xebad('0x40')](handleError(_0x45d025,null));};exports['destroy']=function(_0x53f638,_0x46279a){return db[_0xebad('0x28')][_0xebad('0x46')]({'where':{'id':_0x53f638[_0xebad('0x42')]['id']}})[_0xebad('0x20')](handleEntityNotFound(_0x46279a,null))[_0xebad('0x20')](removeEntity(_0x46279a,null))['catch'](handleError(_0x46279a,null));};exports[_0xebad('0x47')]=function(_0x9c740a,_0x51a650){return db['CmHopperBlack'][_0xebad('0x47')]()[_0xebad('0x20')](respondWithResult(_0x51a650,null))[_0xebad('0x40')](handleError(_0x51a650,null));}; \ No newline at end of file +var _0x8e8c=['stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','intersection','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy'];(function(_0x128c87,_0x3abd38){var _0x250f8a=function(_0x1975eb){while(--_0x1975eb){_0x128c87['push'](_0x128c87['shift']());}};_0x250f8a(++_0x3abd38);}(_0x8e8c,0x1cc));var _0xc8e8=function(_0x2ba609,_0x391585){_0x2ba609=_0x2ba609-0x0;var _0x563793=_0x8e8c[_0x2ba609];return _0x563793;};'use strict';var emlformat=require(_0xc8e8('0x0'));var rimraf=require(_0xc8e8('0x1'));var zipdir=require(_0xc8e8('0x2'));var jsonpatch=require(_0xc8e8('0x3'));var rp=require(_0xc8e8('0x4'));var moment=require(_0xc8e8('0x5'));var BPromise=require(_0xc8e8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc8e8('0x7'));var sox=require(_0xc8e8('0x8'));var csv=require('to-csv');var ejs=require(_0xc8e8('0x9'));var fs=require('fs');var fs_extra=require(_0xc8e8('0xa'));var _=require(_0xc8e8('0xb'));var squel=require(_0xc8e8('0xc'));var crypto=require(_0xc8e8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc8e8('0xe'));var toCsv=require(_0xc8e8('0xf'));var querystring=require(_0xc8e8('0x10'));var Papa=require(_0xc8e8('0x11'));var Redis=require('ioredis');var authService=require(_0xc8e8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8e8('0x13'));var logger=require('../../config/logger')(_0xc8e8('0x14'));var utils=require('../../config/utils');var config=require(_0xc8e8('0x15'));var licenseUtil=require(_0xc8e8('0x16'));var db=require(_0xc8e8('0x17'))['db'];function respondWithStatusCode(_0x57a96e,_0x5cca18){_0x5cca18=_0x5cca18||0xcc;return function(_0x599f61){if(_0x599f61){return _0x57a96e[_0xc8e8('0x18')](_0x5cca18);}return _0x57a96e[_0xc8e8('0x19')](_0x5cca18)['end']();};}function respondWithResult(_0x18fb99,_0x5a5510){_0x5a5510=_0x5a5510||0xc8;return function(_0x42acfe){if(_0x42acfe){return _0x18fb99[_0xc8e8('0x19')](_0x5a5510)[_0xc8e8('0x1a')](_0x42acfe);}};}function respondWithFilteredResult(_0x1d4df3,_0x45c75c){return function(_0x4bf21f){if(_0x4bf21f){var _0x141433=typeof _0x45c75c['offset']===_0xc8e8('0x1b')&&typeof _0x45c75c[_0xc8e8('0x1c')]===_0xc8e8('0x1b');var _0x5ed4cc=_0x4bf21f[_0xc8e8('0x1d')];var _0x46c2dd=_0x141433?0x0:_0x45c75c['offset'];var _0x51387f=_0x141433?_0x4bf21f['count']:_0x45c75c[_0xc8e8('0x1e')]+_0x45c75c[_0xc8e8('0x1c')];var _0x2d88eb;if(_0x51387f>=_0x5ed4cc){_0x51387f=_0x5ed4cc;_0x2d88eb=0xc8;}else{_0x2d88eb=0xce;}_0x1d4df3[_0xc8e8('0x19')](_0x2d88eb);return _0x1d4df3['set'](_0xc8e8('0x1f'),_0x46c2dd+'-'+_0x51387f+'/'+_0x5ed4cc)[_0xc8e8('0x1a')](_0x4bf21f);}return null;};}function patchUpdates(_0x10ba8f){return function(_0x7d6dc2){try{jsonpatch[_0xc8e8('0x20')](_0x7d6dc2,_0x10ba8f,!![]);}catch(_0x1a9618){return BPromise['reject'](_0x1a9618);}return _0x7d6dc2[_0xc8e8('0x21')]();};}function saveUpdates(_0x1240d7,_0x39eb62){return function(_0xd4114b){if(_0xd4114b){return _0xd4114b[_0xc8e8('0x22')](_0x1240d7)[_0xc8e8('0x23')](function(_0x313413){return _0x313413;});}return null;};}function removeEntity(_0x5e1f45,_0x1b2199){return function(_0x56bb5d){if(_0x56bb5d){return _0x56bb5d[_0xc8e8('0x24')]()['then'](function(){_0x5e1f45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1583a5,_0x5c11e0){return function(_0x2b0b2b){if(!_0x2b0b2b){_0x1583a5['sendStatus'](0x194);}return _0x2b0b2b;};}function handleError(_0x4f36c8,_0x1b8999){_0x1b8999=_0x1b8999||0x1f4;return function(_0x3e2806){logger['error'](_0x3e2806[_0xc8e8('0x25')]);if(_0x3e2806['name']){delete _0x3e2806[_0xc8e8('0x26')];}_0x4f36c8[_0xc8e8('0x19')](_0x1b8999)[_0xc8e8('0x27')](_0x3e2806);};}exports['index']=function(_0x35d62e,_0x30d17c){var _0x2427f5={},_0x4fda3b={},_0x18a8a5={'count':0x0,'rows':[]};var _0x44344e=_[_0xc8e8('0x28')](db[_0xc8e8('0x29')][_0xc8e8('0x2a')],function(_0x16f56c){return{'name':_0x16f56c[_0xc8e8('0x2b')],'type':_0x16f56c[_0xc8e8('0x2c')]['key']};});_0x4fda3b[_0xc8e8('0x2d')]=_[_0xc8e8('0x28')](_0x44344e,_0xc8e8('0x26'));_0x4fda3b[_0xc8e8('0x2e')]=_[_0xc8e8('0x2f')](_0x35d62e[_0xc8e8('0x2e')]);_0x4fda3b[_0xc8e8('0x30')]=_['intersection'](_0x4fda3b['model'],_0x4fda3b[_0xc8e8('0x2e')]);_0x2427f5[_0xc8e8('0x31')]=_['intersection'](_0x4fda3b[_0xc8e8('0x2d')],qs[_0xc8e8('0x32')](_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x32')]));_0x2427f5['attributes']=_0x2427f5[_0xc8e8('0x31')][_0xc8e8('0x33')]?_0x2427f5[_0xc8e8('0x31')]:_0x4fda3b['model'];if(!_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x34')](_0xc8e8('0x35'))){_0x2427f5[_0xc8e8('0x1c')]=qs[_0xc8e8('0x1c')](_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x1c')]);_0x2427f5[_0xc8e8('0x1e')]=qs[_0xc8e8('0x1e')](_0x35d62e[_0xc8e8('0x2e')]['offset']);}_0x2427f5[_0xc8e8('0x36')]=qs['sort'](_0x35d62e['query'][_0xc8e8('0x37')]);_0x2427f5[_0xc8e8('0x38')]=qs[_0xc8e8('0x30')](_[_0xc8e8('0x39')](_0x35d62e[_0xc8e8('0x2e')],_0x4fda3b[_0xc8e8('0x30')]),_0x44344e);if(_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x3a')]){_0x2427f5[_0xc8e8('0x38')]=_[_0xc8e8('0x3b')](_0x2427f5['where'],{'$or':_[_0xc8e8('0x28')](_0x44344e,function(_0x312ea8){if(_0x312ea8[_0xc8e8('0x2c')]!=='VIRTUAL'){var _0x58b8ed={};_0x58b8ed[_0x312ea8[_0xc8e8('0x26')]]={'$like':'%'+_0x35d62e[_0xc8e8('0x2e')][_0xc8e8('0x3a')]+'%'};return _0x58b8ed;}})});}_0x2427f5=_[_0xc8e8('0x3b')]({},_0x2427f5,_0x35d62e[_0xc8e8('0x3c')]);var _0x3104aa={'where':_0x2427f5[_0xc8e8('0x38')]};return db[_0xc8e8('0x29')][_0xc8e8('0x1d')](_0x3104aa)[_0xc8e8('0x23')](function(_0x572c1d){_0x18a8a5[_0xc8e8('0x1d')]=_0x572c1d;if(_0x35d62e['query'][_0xc8e8('0x3d')]){_0x2427f5[_0xc8e8('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc8e8('0x3f')](_0x2427f5);})[_0xc8e8('0x23')](function(_0x260c8a){_0x18a8a5['rows']=_0x260c8a;return _0x18a8a5;})[_0xc8e8('0x23')](respondWithFilteredResult(_0x30d17c,_0x2427f5))[_0xc8e8('0x40')](handleError(_0x30d17c,null));};exports[_0xc8e8('0x41')]=function(_0x8c7b70,_0x41b245){var _0x5585ed={'raw':!![],'where':{'id':_0x8c7b70[_0xc8e8('0x42')]['id']}},_0x52db48={};_0x52db48['model']=_['keys'](db[_0xc8e8('0x29')][_0xc8e8('0x2a')]);_0x52db48[_0xc8e8('0x2e')]=_[_0xc8e8('0x2f')](_0x8c7b70[_0xc8e8('0x2e')]);_0x52db48[_0xc8e8('0x30')]=_['intersection'](_0x52db48[_0xc8e8('0x2d')],_0x52db48[_0xc8e8('0x2e')]);_0x5585ed[_0xc8e8('0x31')]=_[_0xc8e8('0x43')](_0x52db48[_0xc8e8('0x2d')],qs[_0xc8e8('0x32')](_0x8c7b70['query'][_0xc8e8('0x32')]));_0x5585ed['attributes']=_0x5585ed['attributes'][_0xc8e8('0x33')]?_0x5585ed[_0xc8e8('0x31')]:_0x52db48[_0xc8e8('0x2d')];if(_0x8c7b70['query'][_0xc8e8('0x3d')]){_0x5585ed['include']=[{'all':!![]}];}_0x5585ed=_[_0xc8e8('0x3b')]({},_0x5585ed,_0x8c7b70['options']);return db[_0xc8e8('0x29')][_0xc8e8('0x44')](_0x5585ed)[_0xc8e8('0x23')](handleEntityNotFound(_0x41b245,null))[_0xc8e8('0x23')](respondWithResult(_0x41b245,null))[_0xc8e8('0x40')](handleError(_0x41b245,null));};exports['update']=function(_0x47f450,_0x4c5fa8){if(_0x47f450[_0xc8e8('0x45')]['id']){delete _0x47f450[_0xc8e8('0x45')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x47f450['params']['id']}})[_0xc8e8('0x23')](handleEntityNotFound(_0x4c5fa8,null))[_0xc8e8('0x23')](saveUpdates(_0x47f450['body'],null))['then'](respondWithResult(_0x4c5fa8,null))[_0xc8e8('0x40')](handleError(_0x4c5fa8,null));};exports['destroy']=function(_0x45e0c3,_0x5c0735){return db[_0xc8e8('0x29')][_0xc8e8('0x44')]({'where':{'id':_0x45e0c3[_0xc8e8('0x42')]['id']}})[_0xc8e8('0x23')](handleEntityNotFound(_0x5c0735,null))['then'](removeEntity(_0x5c0735,null))[_0xc8e8('0x40')](handleError(_0x5c0735,null));};exports['describe']=function(_0x1e185a,_0x3d7624){return db[_0xc8e8('0x29')][_0xc8e8('0x46')]()['then'](respondWithResult(_0x3d7624,null))[_0xc8e8('0x40')](handleError(_0x3d7624,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index c546de5..c76ef74 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 _0xd27b=['cm_hopper_black','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xd27b,0x161));var _0xbd27=function(_0x328ac9,_0x2f7225){_0x328ac9=_0x328ac9-0x0;var _0x2b3a0a=_0xd27b[_0x328ac9];return _0x2b3a0a;};'use strict';var _=require(_0xbd27('0x0'));var util=require('util');var logger=require(_0xbd27('0x1'))('api');var moment=require(_0xbd27('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd27('0x3'));var rimraf=require(_0xbd27('0x4'));var config=require(_0xbd27('0x5'));var attributes=require(_0xbd27('0x6'));module[_0xbd27('0x7')]=function(_0x1c22ff,_0x2be0b7){return _0x1c22ff[_0xbd27('0x8')](_0xbd27('0x9'),attributes,{'tableName':_0xbd27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd88f=['moment','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x49794a,_0x1f5c08){var _0x36b52f=function(_0x22a19a){while(--_0x22a19a){_0x49794a['push'](_0x49794a['shift']());}};_0x36b52f(++_0x1f5c08);}(_0xd88f,0x8c));var _0xfd88=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xd88f[_0xdefbc3];return _0x367798;};'use strict';var _=require(_0xfd88('0x0'));var util=require(_0xfd88('0x1'));var logger=require(_0xfd88('0x2'))('api');var moment=require(_0xfd88('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd88('0x4'));var rimraf=require(_0xfd88('0x5'));var config=require(_0xfd88('0x6'));var attributes=require(_0xfd88('0x7'));module['exports']=function(_0x11929e,_0x39fc9c){return _0x11929e[_0xfd88('0x8')](_0xfd88('0x9'),attributes,{'tableName':_0xfd88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 49e7514..4f27975 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 _0xac77=['limit','include','map','model','attributes','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where'];(function(_0x30e4e5,_0x313702){var _0x17ebb1=function(_0x2dba30){while(--_0x2dba30){_0x30e4e5['push'](_0x30e4e5['shift']());}};_0x17ebb1(++_0x313702);}(_0xac77,0x121));var _0x7ac7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xac77[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0x7ac7('0x0'));var moment=require(_0x7ac7('0x1'));var BPromise=require(_0x7ac7('0x2'));var rs=require(_0x7ac7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ac7('0x4'));var logger=require(_0x7ac7('0x5'))(_0x7ac7('0x6'));var config=require(_0x7ac7('0x7'));var jayson=require(_0x7ac7('0x8'));var client=jayson['client'][_0x7ac7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d20d8,_0x272f54,_0x961701){return new BPromise(function(_0x126de9,_0x2ec9c8){return client[_0x7ac7('0xa')](_0x3d20d8,_0x961701)['then'](function(_0x38a47d){logger[_0x7ac7('0xb')](_0x7ac7('0xc'),_0x272f54,_0x7ac7('0xd'));logger[_0x7ac7('0xe')](_0x7ac7('0xf'),_0x272f54,_0x7ac7('0xd'),JSON[_0x7ac7('0x10')](_0x38a47d));if(_0x38a47d['error']){if(_0x38a47d[_0x7ac7('0x11')]['code']===0x1f4){logger[_0x7ac7('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x272f54,_0x38a47d['error']['message']);return _0x2ec9c8(_0x38a47d[_0x7ac7('0x11')][_0x7ac7('0x12')]);}logger[_0x7ac7('0x11')](_0x7ac7('0xc'),_0x272f54,_0x38a47d['error'][_0x7ac7('0x12')]);return _0x126de9(_0x38a47d[_0x7ac7('0x11')][_0x7ac7('0x12')]);}else{logger['info'](_0x7ac7('0xc'),_0x272f54,_0x7ac7('0xd'));_0x126de9(_0x38a47d['result'][_0x7ac7('0x12')]);}})[_0x7ac7('0x13')](function(_0x4785f6){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x272f54,_0x4785f6);_0x2ec9c8(_0x4785f6);});});}exports[_0x7ac7('0x14')]=function(_0x2b822f){var _0x3a7298=this;return new Promise(function(_0x5476ac,_0x2b7736){return db[_0x7ac7('0x15')][_0x7ac7('0x16')]({'raw':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x18')]===undefined?!![]:![]:!![],'where':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x19')]||null:null,'attributes':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')]['attributes']||null:null,'limit':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x1a')]||null:null,'include':_0x2b822f[_0x7ac7('0x17')]?_0x2b822f[_0x7ac7('0x17')][_0x7ac7('0x1b')]?_[_0x7ac7('0x1c')](_0x2b822f[_0x7ac7('0x17')]['include'],function(_0x4554da){return{'model':db[_0x4554da[_0x7ac7('0x1d')]],'as':_0x4554da['as'],'attributes':_0x4554da[_0x7ac7('0x1e')],'include':_0x4554da[_0x7ac7('0x1b')]?_[_0x7ac7('0x1c')](_0x4554da[_0x7ac7('0x1b')],function(_0x40005f){return{'model':db[_0x40005f['model']],'as':_0x40005f['as'],'attributes':_0x40005f[_0x7ac7('0x1e')],'include':_0x40005f['include']?_['map'](_0x40005f[_0x7ac7('0x1b')],function(_0x25d1dd){return{'model':db[_0x25d1dd[_0x7ac7('0x1d')]],'as':_0x25d1dd['as'],'attributes':_0x25d1dd[_0x7ac7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ac7('0x1f')](function(_0x505020){logger[_0x7ac7('0xb')](_0x7ac7('0x14'),_0x2b822f);logger[_0x7ac7('0xe')]('GetCmHopperBlack',_0x2b822f,JSON['stringify'](_0x505020));_0x5476ac(_0x505020);})['catch'](function(_0x231490){logger[_0x7ac7('0x11')]('GetCmHopperBlack',_0x231490['message'],_0x2b822f);_0x2b7736(_0x3a7298[_0x7ac7('0x11')](0x1f4,_0x231490[_0x7ac7('0x12')]));});});};exports[_0x7ac7('0x20')]=function(_0x520191){var _0x2d3d8b=this;return new Promise(function(_0x6ba91d,_0x5319a4){return db[_0x7ac7('0x15')]['update'](_0x520191['body'],{'raw':_0x520191[_0x7ac7('0x17')]?_0x520191['options'][_0x7ac7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520191['options']?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x19')]||null:null,'attributes':_0x520191['options']?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x1e')]||null:null,'limit':_0x520191[_0x7ac7('0x17')]?_0x520191[_0x7ac7('0x17')][_0x7ac7('0x1a')]||null:null})['then'](function(_0xc078d4){logger[_0x7ac7('0xb')]('UpdateCmHopperBlack',_0x520191);logger[_0x7ac7('0xe')]('UpdateCmHopperBlack',_0x520191,JSON[_0x7ac7('0x10')](_0xc078d4));_0x6ba91d(_0xc078d4);})['catch'](function(_0xe7b5e0){logger['error'](_0x7ac7('0x20'),_0xe7b5e0['message'],_0x520191);_0x5319a4(_0x2d3d8b['error'](0x1f4,_0xe7b5e0[_0x7ac7('0x12')]));});});};exports[_0x7ac7('0x21')]=function(_0x173bdd){var _0x5107df=this;return new Promise(function(_0x5b470e,_0x1863d4){return db[_0x7ac7('0x15')][_0x7ac7('0x22')]({'where':_0x173bdd[_0x7ac7('0x17')]?_0x173bdd['options'][_0x7ac7('0x19')]||null:null})[_0x7ac7('0x1f')](function(_0x4d9f26){logger[_0x7ac7('0xb')](_0x7ac7('0x21'),_0x173bdd);logger[_0x7ac7('0xe')](_0x7ac7('0x21'),_0x173bdd,JSON[_0x7ac7('0x10')](_0x4d9f26));_0x5b470e(_0x4d9f26);})[_0x7ac7('0x13')](function(_0x3c6ce4){logger[_0x7ac7('0x11')](_0x7ac7('0x21'),_0x3c6ce4[_0x7ac7('0x12')],_0x173bdd);_0x1863d4(_0x5107df[_0x7ac7('0x11')](0x1f4,_0x3c6ce4[_0x7ac7('0x12')]));});});}; \ No newline at end of file +var _0x7d3f=['map','model','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x7d3f,0x96));var _0xf7d3=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0x7d3f[_0x1e3c02];return _0x4d26d7;};'use strict';var _=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var moment=require(_0xf7d3('0x2'));var BPromise=require(_0xf7d3('0x3'));var rs=require(_0xf7d3('0x4'));var fs=require('fs');var Redis=require(_0xf7d3('0x5'));var db=require(_0xf7d3('0x6'))['db'];var utils=require(_0xf7d3('0x7'));var logger=require(_0xf7d3('0x8'))(_0xf7d3('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7d3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95a345,_0x22893d,_0x40f9b7){return new BPromise(function(_0x48e60e,_0xe6d19){return client['request'](_0x95a345,_0x40f9b7)[_0xf7d3('0xb')](function(_0x31062f){logger['info'](_0xf7d3('0xc'),_0x22893d,_0xf7d3('0xd'));logger[_0xf7d3('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x22893d,_0xf7d3('0xd'),JSON[_0xf7d3('0xf')](_0x31062f));if(_0x31062f[_0xf7d3('0x10')]){if(_0x31062f[_0xf7d3('0x10')][_0xf7d3('0x11')]===0x1f4){logger[_0xf7d3('0x10')](_0xf7d3('0xc'),_0x22893d,_0x31062f['error'][_0xf7d3('0x12')]);return _0xe6d19(_0x31062f[_0xf7d3('0x10')][_0xf7d3('0x12')]);}logger[_0xf7d3('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x22893d,_0x31062f[_0xf7d3('0x10')][_0xf7d3('0x12')]);return _0x48e60e(_0x31062f['error'][_0xf7d3('0x12')]);}else{logger[_0xf7d3('0x13')](_0xf7d3('0xc'),_0x22893d,_0xf7d3('0xd'));_0x48e60e(_0x31062f['result'][_0xf7d3('0x12')]);}})[_0xf7d3('0x14')](function(_0x4fe2c6){logger['error'](_0xf7d3('0xc'),_0x22893d,_0x4fe2c6);_0xe6d19(_0x4fe2c6);});});}exports[_0xf7d3('0x15')]=function(_0x23ecb7){var _0x216fe0=this;return new Promise(function(_0x58119f,_0x2b74b1){return db[_0xf7d3('0x16')][_0xf7d3('0x17')]({'raw':_0x23ecb7[_0xf7d3('0x18')]?_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x19')]===undefined?!![]:![]:!![],'where':_0x23ecb7[_0xf7d3('0x18')]?_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x1a')]||null:null,'attributes':_0x23ecb7[_0xf7d3('0x18')]?_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x1b')]||null:null,'limit':_0x23ecb7[_0xf7d3('0x18')]?_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x1c')]||null:null,'include':_0x23ecb7[_0xf7d3('0x18')]?_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x1d')]?_[_0xf7d3('0x1e')](_0x23ecb7[_0xf7d3('0x18')][_0xf7d3('0x1d')],function(_0x3cac20){return{'model':db[_0x3cac20[_0xf7d3('0x1f')]],'as':_0x3cac20['as'],'attributes':_0x3cac20[_0xf7d3('0x1b')],'include':_0x3cac20[_0xf7d3('0x1d')]?_[_0xf7d3('0x1e')](_0x3cac20['include'],function(_0x95ea3){return{'model':db[_0x95ea3['model']],'as':_0x95ea3['as'],'attributes':_0x95ea3[_0xf7d3('0x1b')],'include':_0x95ea3[_0xf7d3('0x1d')]?_[_0xf7d3('0x1e')](_0x95ea3[_0xf7d3('0x1d')],function(_0x14ebd8){return{'model':db[_0x14ebd8[_0xf7d3('0x1f')]],'as':_0x14ebd8['as'],'attributes':_0x14ebd8[_0xf7d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7d3('0xb')](function(_0x4da1c5){logger[_0xf7d3('0x13')](_0xf7d3('0x15'),_0x23ecb7);logger[_0xf7d3('0xe')](_0xf7d3('0x15'),_0x23ecb7,JSON[_0xf7d3('0xf')](_0x4da1c5));_0x58119f(_0x4da1c5);})['catch'](function(_0x3e6ced){logger['error'](_0xf7d3('0x15'),_0x3e6ced[_0xf7d3('0x12')],_0x23ecb7);_0x2b74b1(_0x216fe0[_0xf7d3('0x10')](0x1f4,_0x3e6ced['message']));});});};exports['UpdateCmHopperBlack']=function(_0x11c2c9){var _0x12756e=this;return new Promise(function(_0x29a780,_0x4c86a4){return db[_0xf7d3('0x16')][_0xf7d3('0x20')](_0x11c2c9[_0xf7d3('0x21')],{'raw':_0x11c2c9[_0xf7d3('0x18')]?_0x11c2c9[_0xf7d3('0x18')][_0xf7d3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11c2c9['options']?_0x11c2c9['options']['where']||null:null,'attributes':_0x11c2c9['options']?_0x11c2c9[_0xf7d3('0x18')]['attributes']||null:null,'limit':_0x11c2c9['options']?_0x11c2c9[_0xf7d3('0x18')][_0xf7d3('0x1c')]||null:null})[_0xf7d3('0xb')](function(_0x4c59eb){logger['info'](_0xf7d3('0x22'),_0x11c2c9);logger[_0xf7d3('0xe')](_0xf7d3('0x22'),_0x11c2c9,JSON[_0xf7d3('0xf')](_0x4c59eb));_0x29a780(_0x4c59eb);})[_0xf7d3('0x14')](function(_0x2d62a3){logger[_0xf7d3('0x10')]('UpdateCmHopperBlack',_0x2d62a3[_0xf7d3('0x12')],_0x11c2c9);_0x4c86a4(_0x12756e[_0xf7d3('0x10')](0x1f4,_0x2d62a3[_0xf7d3('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x15cd0c){var _0x4a57c1=this;return new Promise(function(_0x29cc17,_0x185183){return db[_0xf7d3('0x16')]['destroy']({'where':_0x15cd0c[_0xf7d3('0x18')]?_0x15cd0c['options'][_0xf7d3('0x1a')]||null:null})[_0xf7d3('0xb')](function(_0x3e53e8){logger['info']('DestroyCmHopperBlack',_0x15cd0c);logger['debug'](_0xf7d3('0x23'),_0x15cd0c,JSON[_0xf7d3('0xf')](_0x3e53e8));_0x29cc17(_0x3e53e8);})[_0xf7d3('0x14')](function(_0x1ad8fb){logger[_0xf7d3('0x10')](_0xf7d3('0x23'),_0x1ad8fb[_0xf7d3('0x12')],_0x15cd0c);_0x185183(_0x4a57c1['error'](0x1f4,_0x1ad8fb[_0xf7d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ccac2c6..01f1bf5 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 _0x1261=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','/:id','put','delete','destroy'];(function(_0x4815dd,_0x3abac5){var _0x2c4c6a=function(_0x382cc){while(--_0x382cc){_0x4815dd['push'](_0x4815dd['shift']());}};_0x2c4c6a(++_0x3abac5);}(_0x1261,0x144));var _0x1126=function(_0x2384bb,_0x12f81b){_0x2384bb=_0x2384bb-0x0;var _0x3f2bac=_0x1261[_0x2384bb];return _0x3f2bac;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['update']);router[_0x1126('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1883=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5974d1,_0xcaba6a){var _0x36b7a7=function(_0x479f71){while(--_0x479f71){_0x5974d1['push'](_0x5974d1['shift']());}};_0x36b7a7(++_0xcaba6a);}(_0x1883,0xab));var _0x3188=function(_0x35e879,_0x5464c7){_0x35e879=_0x35e879-0x0;var _0x14874f=_0x1883[_0x35e879];return _0x14874f;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')]('/:id',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 2540198..09a60cf 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 _0x761f=['DATE','endtime','setDataValue','followuptime','diff','BOOLEAN','moment','INTEGER','STRING'];(function(_0x31f15b,_0xa486f7){var _0x15e504=function(_0x137b00){while(--_0x137b00){_0x31f15b['push'](_0x31f15b['shift']());}};_0x15e504(++_0xa486f7);}(_0x761f,0xb1));var _0xf761=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0x761f[_0x127c7b];return _0x1708eb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf761('0x0'));module['exports']={'state':{'type':Sequelize[_0xf761('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf761('0x2')]},'scheduledat':{'type':Sequelize[_0xf761('0x3')]},'countbusyretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf761('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf761('0x2')]},'calleridnum':{'type':Sequelize[_0xf761('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf761('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf761('0x3')]},'droptime':{'type':Sequelize[_0xf761('0x3')]},'endtime':{'type':Sequelize[_0xf761('0x3')]},'ringtime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf761('0x2')]},'campaign':{'type':Sequelize[_0xf761('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf761('0x2')]},'reason':{'type':Sequelize[_0xf761('0x2')]},'disposition':{'type':Sequelize[_0xf761('0x2')]},'secondDisposition':{'type':Sequelize[_0xf761('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf761('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2747b3){var _0x3fea37=this['getDataValue'](_0xf761('0x4'));if(_0x3fea37&&_0x2747b3){this[_0xf761('0x5')](_0xf761('0x6'),moment(_0x2747b3)[_0xf761('0x7')](moment(_0x3fea37),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf761('0x3')]},'callback':{'type':Sequelize[_0xf761('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf761('0x3')]},'deleted':{'type':Sequelize[_0xf761('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf761('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf761('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf761('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf846=['seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime'];(function(_0x511d0f,_0x4218ef){var _0x563949=function(_0x26af25){while(--_0x26af25){_0x511d0f['push'](_0x511d0f['shift']());}};_0x563949(++_0x4218ef);}(_0xf846,0x98));var _0x6f84=function(_0x19788e,_0x34a56d){_0x19788e=_0x19788e-0x0;var _0x16916b=_0xf846[_0x19788e];return _0x16916b;};'use strict';var Sequelize=require(_0x6f84('0x0'));var moment=require(_0x6f84('0x1'));module[_0x6f84('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6f84('0x3')]},'scheduledat':{'type':Sequelize[_0x6f84('0x4')]},'countbusyretry':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x6f84('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6f84('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6f84('0x4')]},'responsetime':{'type':Sequelize[_0x6f84('0x4')]},'answertime':{'type':Sequelize[_0x6f84('0x4')]},'droptime':{'type':Sequelize[_0x6f84('0x4')]},'endtime':{'type':Sequelize[_0x6f84('0x4')]},'ringtime':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6f84('0x3')]},'campaign':{'type':Sequelize[_0x6f84('0x3')]},'campaigntype':{'type':Sequelize[_0x6f84('0x3')]},'membername':{'type':Sequelize[_0x6f84('0x3')]},'reason':{'type':Sequelize[_0x6f84('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6f84('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6f84('0x3')]},'dispositionat':{'type':Sequelize[_0x6f84('0x4')],'set':function(_0xea763b){var _0x52c792=this[_0x6f84('0x6')](_0x6f84('0x7'));if(_0x52c792&&_0xea763b){this['setDataValue']('followuptime',moment(_0xea763b)['diff'](moment(_0x52c792),_0x6f84('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6f84('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6f84('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6f84('0x4')]},'callback':{'type':Sequelize[_0x6f84('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f84('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f84('0x4')]},'deleted':{'type':Sequelize[_0x6f84('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6f84('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6f84('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6f84('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f84('0x5')],'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 903e204..1e714a0 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 _0xadb5=['`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','Campaign','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','VoiceQueueId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x3d6570,_0x482f5f){var _0x30b1c5=function(_0x3b81f6){while(--_0x3b81f6){_0x3d6570['push'](_0x3d6570['shift']());}};_0x30b1c5(++_0x482f5f);}(_0xadb5,0xad));var _0x5adb=function(_0x3849e7,_0x1eb83c){_0x3849e7=_0x3849e7-0x0;var _0x3557fd=_0xadb5[_0x3849e7];return _0x3557fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CmHopperFinal']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')]()['then'](respondWithResult(_0x3a5409,null))[_0x5adb('0x42')](handleError(_0x3a5409,null));};exports['update']=function(_0x51bc49,_0x5015ee){if(_0x51bc49[_0x5adb('0x47')][_0x5adb('0x48')]){delete _0x51bc49[_0x5adb('0x47')]['uniqueid'];}return db[_0x5adb('0x2a')]['find']({'where':{'uniqueid':_0x51bc49[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x5015ee,null))[_0x5adb('0x22')](saveUpdates(_0x51bc49['body'],null))[_0x5adb('0x22')](respondWithResult(_0x5015ee,null))['catch'](handleError(_0x5015ee,null));};exports[_0x5adb('0x49')]=function(_0x6dc067,_0x55c535,_0x2402a3){return db[_0x5adb('0x2a')][_0x5adb('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x6dc067[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x4c')))),'noSuchContacts'],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize'][_0x5adb('0x4b')](_0x5adb('0x4e')))),_0x5adb('0x4f')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x52')))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),_0x5adb('0x58')],[db[_0x5adb('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})['then'](handleEntityNotFound(_0x55c535,null))[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x42')](handleError(_0x55c535,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5cb50e,_0x476e62,_0x1505f7){return db['CmHopperFinal'][_0x5adb('0x40')]({'raw':![],'where':{'CampaignId':_0x5cb50e[_0x5adb('0x44')]['id']},'attributes':[[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x4c')))),_0x5adb('0x5b')],[db[_0x5adb('0x4a')]['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x5adb('0x4f')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x50')))),_0x5adb('0x51')],[db['sequelize']['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x5adb('0x53')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x5adb('0x54')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')]['literal'](_0x5adb('0x55')))),_0x5adb('0x56')],[db[_0x5adb('0x4a')]['fn'](_0x5adb('0x4d'),db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x57')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0x5adb('0x4a')]['fn']('IF',db[_0x5adb('0x4a')][_0x5adb('0x4b')](_0x5adb('0x59')))),_0x5adb('0x5a')]]})[_0x5adb('0x22')](handleEntityNotFound(_0x476e62,null))[_0x5adb('0x22')](respondWithResult(_0x476e62,null))[_0x5adb('0x42')](handleError(_0x476e62,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5e55c2,_0x1fc73b,_0x56df90){return db[_0x5adb('0x5c')][_0x5adb('0x5d')]({'where':{'id':_0x5e55c2[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x1fc73b,null))[_0x5adb('0x22')](function(_0x236f59){var _0x338aee;if(_0x236f59){_0x338aee=squel[_0x5adb('0x5e')]()['into'](_0x5adb('0x5f'))[_0x5adb('0x60')]([_0x5adb('0x61'),'scheduledAt',_0x5adb('0x62'),_0x5adb('0x63'),'VoiceQueueId',_0x5adb('0x64'),'updatedAt'],squel[_0x5adb('0x65')]()[_0x5adb('0x66')]('ANY_VALUE(calleridnum)',_0x5adb('0x61'))[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')]('ANY_VALUE(ListId)',_0x5adb('0x63'))[_0x5adb('0x66')](_0x5adb('0x6a'),'VoiceQueueId')['field'](_0x5adb('0x67'),'createdAt')[_0x5adb('0x66')](_0x5adb('0x67'),_0x5adb('0x6b'))['from'](_0x5adb('0x6c'))[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())['where'](_0x5adb('0x6f'),_0x5e55c2[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())['where'](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x61'))[_0x5adb('0x73')]('cm_hopper')[_0x5adb('0x37')](_0x5adb('0x6d'),_0x5e55c2['params']['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x5adb('0x65')]()['field'](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')]('VoiceQueueId\x20=\x20?',_0x5e55c2[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')]('ContactId'))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')][_0x5adb('0x2f')](_0x338aee);}return[];})[_0x5adb('0x22')](respondWithResult(_0x1fc73b,null))['catch'](handleError(_0x1fc73b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3f3db9,_0x461a07,_0x2e5c96){return db[_0x5adb('0x77')][_0x5adb('0x5d')]({'where':{'id':_0x3f3db9[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x461a07,null))['then'](function(_0xda26cc){var _0x14bada;if(_0xda26cc){_0x14bada=squel[_0x5adb('0x5e')]()[_0x5adb('0x78')]('cm_hopper')[_0x5adb('0x60')]([_0x5adb('0x61'),_0x5adb('0x68'),_0x5adb('0x62'),_0x5adb('0x63'),_0x5adb('0x79'),_0x5adb('0x64'),_0x5adb('0x6b')],squel[_0x5adb('0x65')]()['field'](_0x5adb('0x7a'),_0x5adb('0x61'))['field'](_0x5adb('0x67'),_0x5adb('0x68'))[_0x5adb('0x66')](_0x5adb('0x69'),_0x5adb('0x62'))[_0x5adb('0x66')](_0x5adb('0x7b'),_0x5adb('0x63'))['field'](_0x5adb('0x7c'),_0x5adb('0x79'))['field'](_0x5adb('0x67'),_0x5adb('0x64'))[_0x5adb('0x66')]('NOW()','updatedAt')[_0x5adb('0x73')](_0x5adb('0x6c'))[_0x5adb('0x37')]('CampaignId\x20=\x20?',_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x6f'),_0x3f3db9[_0x5adb('0x47')][_0x5adb('0x70')][_0x5adb('0x6e')]())[_0x5adb('0x37')](_0x5adb('0x71'))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()['field']('phone')[_0x5adb('0x73')](_0x5adb('0x5f'))['where'](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id'][_0x5adb('0x6e')]()))[_0x5adb('0x37')](_0x5adb('0x72'),squel[_0x5adb('0x65')]()[_0x5adb('0x66')](_0x5adb('0x74'))[_0x5adb('0x73')]('cm_hopper_final')[_0x5adb('0x37')](_0x5adb('0x7d'),_0x3f3db9[_0x5adb('0x44')]['id']['toString']())[_0x5adb('0x37')](_0x5adb('0x75')))[_0x5adb('0x76')](_0x5adb('0x62')))[_0x5adb('0x6e')]();return db[_0x5adb('0x4a')]['query'](_0x14bada);}return[];})[_0x5adb('0x22')](respondWithResult(_0x461a07,null))[_0x5adb('0x42')](handleError(_0x461a07,null));};exports[_0x5adb('0x7e')]=function(_0x1e5532,_0x2c3af8,_0x3a201a){return db[_0x5adb('0x7f')][_0x5adb('0x80')]({'where':{'VoiceQueueId':_0x1e5532[_0x5adb('0x47')][_0x5adb('0x81')],'CampaignId':_0x1e5532['body'][_0x5adb('0x79')],'ContactId':_0x1e5532['body'][_0x5adb('0x62')]}})[_0x5adb('0x22')](handleEntityNotFound(_0x2c3af8,null))[_0x5adb('0x22')](function(_0x193a29){if(_0x193a29){return _0x193a29;}return null;})[_0x5adb('0x22')](respondWithResult(_0x2c3af8,null))['catch'](handleError(_0x2c3af8,null));}; \ No newline at end of file +var _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x814b,0x1a2));var _0xb814=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0x814b[_0x1b1f88];return _0x5045b9;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8ee973c..a666b6f 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 _0xcec3=['define','CmHopperFinal','cm_hopper_final','calleridnum','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x25a6cc,_0x3af539){var _0x58d054=function(_0x2d8096){while(--_0x2d8096){_0x25a6cc['push'](_0x25a6cc['shift']());}};_0x58d054(++_0x3af539);}(_0xcec3,0x197));var _0x3cec=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcec3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3cec('0x0'));var util=require('util');var logger=require(_0x3cec('0x1'))(_0x3cec('0x2'));var moment=require(_0x3cec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3cec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cec('0x5'));var config=require(_0x3cec('0x6'));var attributes=require(_0x3cec('0x7'));module[_0x3cec('0x8')]=function(_0x32e1ad,_0x5b70ad){return _0x32e1ad[_0x3cec('0x9')](_0x3cec('0xa'),attributes,{'tableName':_0x3cec('0xb'),'paranoid':![],'indexes':[{'name':_0x3cec('0xc'),'fields':[_0x3cec('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc0c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0xbc0c,0x152));var _0xcbc0=function(_0x3ffd98,_0x2e0a13){_0x3ffd98=_0x3ffd98-0x0;var _0x3e8ecc=_0xbc0c[_0x3ffd98];return _0x3e8ecc;};'use strict';var _=require(_0xcbc0('0x0'));var util=require(_0xcbc0('0x1'));var logger=require(_0xcbc0('0x2'))(_0xcbc0('0x3'));var moment=require(_0xcbc0('0x4'));var BPromise=require(_0xcbc0('0x5'));var rp=require(_0xcbc0('0x6'));var fs=require('fs');var path=require(_0xcbc0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbc0('0x8'));module[_0xcbc0('0x9')]=function(_0x3b05b0,_0x4e8407){return _0x3b05b0[_0xcbc0('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xcbc0('0xb')]},{'name':'uniqueid','fields':[_0xcbc0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 16b1381..18ca4e4 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x947959,_0xe60e92){var _0xf2b815=function(_0x1e9f1b){while(--_0x1e9f1b){_0x947959['push'](_0x947959['shift']());}};_0xf2b815(++_0xe60e92);}(_0xb10b,0x12a));var _0xbb10=function(_0x24b3fd,_0x3d7922){_0x24b3fd=_0x24b3fd-0x0;var _0x5bebf4=_0xb10b[_0x24b3fd];return _0x5bebf4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x594cc6,_0x1b18fe){var _0x446979=function(_0x42dd0a){while(--_0x42dd0a){_0x594cc6['push'](_0x594cc6['shift']());}};_0x446979(++_0x1b18fe);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xb10b[_0x5e8d3e];return _0x1348c0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 23bb7d9..1fcf64e 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 _0x9169=['checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0x9169,0xdd));var _0x9916=function(_0x59e537,_0x139c12){_0x59e537=_0x59e537-0x0;var _0x3b9cc6=_0x9169[_0x59e537];return _0x3b9cc6;};'use strict';var multer=require(_0x9916('0x0'));var util=require(_0x9916('0x1'));var path=require(_0x9916('0x2'));var timeout=require(_0x9916('0x3'));var express=require(_0x9916('0x4'));var router=express[_0x9916('0x5')]();var fs_extra=require(_0x9916('0x6'));var auth=require(_0x9916('0x7'));var interaction=require(_0x9916('0x8'));var config=require(_0x9916('0x9'));var controller=require(_0x9916('0xa'));router['get']('/',auth[_0x9916('0xb')](),controller[_0x9916('0xc')]);router[_0x9916('0xd')](_0x9916('0xe'),auth[_0x9916('0xb')](),controller[_0x9916('0xf')]);router[_0x9916('0xd')](_0x9916('0x10'),auth['isAuthenticated'](),controller[_0x9916('0x11')]);router[_0x9916('0xd')](_0x9916('0x12'),auth[_0x9916('0xb')](),controller[_0x9916('0x13')]);router[_0x9916('0xd')](_0x9916('0x14'),auth[_0x9916('0xb')](),controller[_0x9916('0x15')]);router[_0x9916('0x16')](_0x9916('0x17'),auth[_0x9916('0xb')](),controller[_0x9916('0x18')]);router['post'](_0x9916('0x19'),auth[_0x9916('0xb')](),controller[_0x9916('0x1a')]);router[_0x9916('0x16')]('/checkContactHopper',auth[_0x9916('0xb')](),controller[_0x9916('0x1b')]);router[_0x9916('0x1c')](_0x9916('0x10'),auth[_0x9916('0xb')](),controller[_0x9916('0x1d')]);module[_0x9916('0x1e')]=router; \ No newline at end of file +var _0xb396=['/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','describe','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x36cda1,_0x378afd){var _0x555968=function(_0x378322){while(--_0x378322){_0x36cda1['push'](_0x36cda1['shift']());}};_0x555968(++_0x378afd);}(_0xb396,0x1e8));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6b39('0x0'));var util=require(_0x6b39('0x1'));var path=require(_0x6b39('0x2'));var timeout=require(_0x6b39('0x3'));var express=require('express');var router=express[_0x6b39('0x4')]();var fs_extra=require(_0x6b39('0x5'));var auth=require(_0x6b39('0x6'));var interaction=require(_0x6b39('0x7'));var config=require(_0x6b39('0x8'));var controller=require(_0x6b39('0x9'));router['get']('/',auth[_0x6b39('0xa')](),controller['index']);router[_0x6b39('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x6b39('0xc')]);router[_0x6b39('0xb')](_0x6b39('0xd'),auth[_0x6b39('0xa')](),controller[_0x6b39('0xe')]);router[_0x6b39('0xb')](_0x6b39('0xf'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x6b39('0x10'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x6b39('0x11'),auth[_0x6b39('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x6b39('0x12'),auth[_0x6b39('0xa')](),controller[_0x6b39('0x13')]);router[_0x6b39('0x14')](_0x6b39('0x15'),auth['isAuthenticated'](),controller[_0x6b39('0x16')]);router['put'](_0x6b39('0xd'),auth[_0x6b39('0xa')](),controller[_0x6b39('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 13694a2..bd52e1d 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 _0xdbc6=['DATE','STRING','BOOLEAN','INTEGER'];(function(_0x5efe23,_0x5c9338){var _0x351a7e=function(_0x2d24ac){while(--_0x2d24ac){_0x5efe23['push'](_0x5efe23['shift']());}};_0x351a7e(++_0x5c9338);}(_0xdbc6,0x13b));var _0x6dbc=function(_0xe42513,_0x24ac6b){_0xe42513=_0xe42513-0x0;var _0x2ad4af=_0xdbc6[_0xe42513];return _0x2ad4af;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x6dbc('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6dbc('0x1')]},'countbusyretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6dbc('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6dbc('0x2')]},'calleridnum':{'type':Sequelize[_0x6dbc('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6dbc('0x1')]},'responsetime':{'type':Sequelize[_0x6dbc('0x1')]},'answertime':{'type':Sequelize[_0x6dbc('0x1')]},'droptime':{'type':Sequelize[_0x6dbc('0x1')]},'endtime':{'type':Sequelize[_0x6dbc('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6dbc('0x2')]},'campaign':{'type':Sequelize[_0x6dbc('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6dbc('0x2')]},'reason':{'type':Sequelize[_0x6dbc('0x2')]},'amd':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6dbc('0x1')]},'edited':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6dbc('0x2')]}}; \ No newline at end of file +var _0x214e=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x3323e2,_0xc17df){var _0x57771e=function(_0x5a71c9){while(--_0x5a71c9){_0x3323e2['push'](_0x3323e2['shift']());}};_0x57771e(++_0xc17df);}(_0x214e,0xda));var _0xe214=function(_0x5c8fd0,_0x4f0387){_0x5c8fd0=_0x5c8fd0-0x0;var _0x42d639=_0x214e[_0x5c8fd0];return _0x42d639;};'use strict';var Sequelize=require(_0xe214('0x0'));module[_0xe214('0x1')]={'state':{'type':Sequelize[_0xe214('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe214('0x3')]},'scheduledat':{'type':Sequelize[_0xe214('0x4')]},'countbusyretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe214('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xe214('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe214('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe214('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xe214('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe214('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe214('0x3')]},'membername':{'type':Sequelize[_0xe214('0x3')]},'reason':{'type':Sequelize[_0xe214('0x3')]},'amd':{'type':Sequelize[_0xe214('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe214('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe214('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe214('0x4')]},'edited':{'type':Sequelize[_0xe214('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe214('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe214('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index edd5e46..f8f026e 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 _0xa4dc=['reject','save','update','then','end','error','name','send','index','CmHopperHistory','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','describe','uniqueid','body','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply'];(function(_0x4bd40e,_0x7701b4){var _0x544e09=function(_0x2288de){while(--_0x2288de){_0x4bd40e['push'](_0x4bd40e['shift']());}};_0x544e09(++_0x7701b4);}(_0xa4dc,0xc0));var _0xca4d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xa4dc[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0xca4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca4d('0x1'));var jsonpatch=require(_0xca4d('0x2'));var rp=require(_0xca4d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca4d('0x4'));var path=require(_0xca4d('0x5'));var sox=require(_0xca4d('0x6'));var csv=require(_0xca4d('0x7'));var ejs=require(_0xca4d('0x8'));var fs=require('fs');var fs_extra=require(_0xca4d('0x9'));var _=require(_0xca4d('0xa'));var squel=require(_0xca4d('0xb'));var crypto=require(_0xca4d('0xc'));var jsforce=require(_0xca4d('0xd'));var deskjs=require(_0xca4d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xca4d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca4d('0x10'));var as=require(_0xca4d('0x11'));var hardwareService=require(_0xca4d('0x12'));var logger=require(_0xca4d('0x13'))('api');var utils=require(_0xca4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xca4d('0x15'));var db=require(_0xca4d('0x16'))['db'];function respondWithStatusCode(_0x45d629,_0x1d79c7){_0x1d79c7=_0x1d79c7||0xcc;return function(_0x15908b){if(_0x15908b){return _0x45d629[_0xca4d('0x17')](_0x1d79c7);}return _0x45d629['status'](_0x1d79c7)['end']();};}function respondWithResult(_0x37fb67,_0x4c42f8){_0x4c42f8=_0x4c42f8||0xc8;return function(_0x4e38dd){if(_0x4e38dd){return _0x37fb67[_0xca4d('0x18')](_0x4c42f8)['json'](_0x4e38dd);}};}function respondWithFilteredResult(_0x9652a9,_0x202f4f){return function(_0x40dab2){if(_0x40dab2){var _0x47af13=typeof _0x202f4f[_0xca4d('0x19')]==='undefined'&&typeof _0x202f4f[_0xca4d('0x1a')]===_0xca4d('0x1b');var _0x537c7c=_0x40dab2['count'];var _0x35e4ec=_0x47af13?0x0:_0x202f4f[_0xca4d('0x19')];var _0x4a1494=_0x47af13?_0x40dab2[_0xca4d('0x1c')]:_0x202f4f[_0xca4d('0x19')]+_0x202f4f[_0xca4d('0x1a')];var _0x1645b0;if(_0x4a1494>=_0x537c7c){_0x4a1494=_0x537c7c;_0x1645b0=0xc8;}else{_0x1645b0=0xce;}_0x9652a9[_0xca4d('0x18')](_0x1645b0);return _0x9652a9[_0xca4d('0x1d')](_0xca4d('0x1e'),_0x35e4ec+'-'+_0x4a1494+'/'+_0x537c7c)[_0xca4d('0x1f')](_0x40dab2);}return null;};}function patchUpdates(_0x21dd7e){return function(_0x16b300){try{jsonpatch[_0xca4d('0x20')](_0x16b300,_0x21dd7e,!![]);}catch(_0x494db4){return BPromise[_0xca4d('0x21')](_0x494db4);}return _0x16b300[_0xca4d('0x22')]();};}function saveUpdates(_0x4d6aa8,_0x3af6bc){return function(_0x5ed272){if(_0x5ed272){return _0x5ed272[_0xca4d('0x23')](_0x4d6aa8)[_0xca4d('0x24')](function(_0x30bace){return _0x30bace;});}return null;};}function removeEntity(_0x3fd2b7,_0x242681){return function(_0x537bc0){if(_0x537bc0){return _0x537bc0['destroy']()['then'](function(){_0x3fd2b7[_0xca4d('0x18')](0xcc)[_0xca4d('0x25')]();});}};}function handleEntityNotFound(_0x136e3e,_0x99afa9){return function(_0x37412a){if(!_0x37412a){_0x136e3e['sendStatus'](0x194);}return _0x37412a;};}function handleError(_0x442a2d,_0x37b272){_0x37b272=_0x37b272||0x1f4;return function(_0x451c95){logger[_0xca4d('0x26')](_0x451c95['stack']);if(_0x451c95[_0xca4d('0x27')]){delete _0x451c95['name'];}_0x442a2d[_0xca4d('0x18')](_0x37b272)[_0xca4d('0x28')](_0x451c95);};}exports[_0xca4d('0x29')]=function(_0x582545,_0x1f62e0){var _0x398a77={},_0x28ac90={},_0x4b701b={'count':0x0,'rows':[]};var _0x129a29=_['map'](db[_0xca4d('0x2a')][_0xca4d('0x2b')],function(_0x105e0b){return{'name':_0x105e0b[_0xca4d('0x2c')],'type':_0x105e0b['type'][_0xca4d('0x2d')]};});_0x28ac90['model']=_[_0xca4d('0x2e')](_0x129a29,_0xca4d('0x27'));_0x28ac90[_0xca4d('0x2f')]=_['keys'](_0x582545['query']);_0x28ac90[_0xca4d('0x30')]=_[_0xca4d('0x31')](_0x28ac90[_0xca4d('0x32')],_0x28ac90[_0xca4d('0x2f')]);_0x398a77[_0xca4d('0x33')]=_[_0xca4d('0x31')](_0x28ac90[_0xca4d('0x32')],qs[_0xca4d('0x34')](_0x582545[_0xca4d('0x2f')][_0xca4d('0x34')]));_0x398a77[_0xca4d('0x33')]=_0x398a77[_0xca4d('0x33')][_0xca4d('0x35')]?_0x398a77[_0xca4d('0x33')]:_0x28ac90[_0xca4d('0x32')];if(!_0x582545[_0xca4d('0x2f')]['hasOwnProperty'](_0xca4d('0x36'))){_0x398a77[_0xca4d('0x1a')]=qs['limit'](_0x582545['query'][_0xca4d('0x1a')]);_0x398a77['offset']=qs[_0xca4d('0x19')](_0x582545[_0xca4d('0x2f')]['offset']);}_0x398a77[_0xca4d('0x37')]=qs[_0xca4d('0x38')](_0x582545[_0xca4d('0x2f')][_0xca4d('0x38')]);_0x398a77[_0xca4d('0x39')]=qs[_0xca4d('0x30')](_['pick'](_0x582545[_0xca4d('0x2f')],_0x28ac90[_0xca4d('0x30')]),_0x129a29);if(_0x582545[_0xca4d('0x2f')][_0xca4d('0x3a')]){_0x398a77['where']=_['merge'](_0x398a77[_0xca4d('0x39')],{'$or':_[_0xca4d('0x2e')](_0x129a29,function(_0x2c46dd){if(_0x2c46dd[_0xca4d('0x3b')]!==_0xca4d('0x3c')){var _0x3c3a87={};_0x3c3a87[_0x2c46dd['name']]={'$like':'%'+_0x582545[_0xca4d('0x2f')][_0xca4d('0x3a')]+'%'};return _0x3c3a87;}})});}_0x398a77=_[_0xca4d('0x3d')]({},_0x398a77,_0x582545[_0xca4d('0x3e')]);var _0x21680d={'where':_0x398a77[_0xca4d('0x39')]};return db[_0xca4d('0x2a')][_0xca4d('0x1c')](_0x21680d)['then'](function(_0x29e4f9){_0x4b701b[_0xca4d('0x1c')]=_0x29e4f9;if(_0x582545[_0xca4d('0x2f')][_0xca4d('0x3f')]){_0x398a77['include']=[{'all':!![]}];}return db[_0xca4d('0x2a')][_0xca4d('0x40')](_0x398a77);})[_0xca4d('0x24')](function(_0x230cca){_0x4b701b[_0xca4d('0x41')]=_0x230cca;return _0x4b701b;})[_0xca4d('0x24')](respondWithFilteredResult(_0x1f62e0,_0x398a77))[_0xca4d('0x42')](handleError(_0x1f62e0,null));};exports['show']=function(_0x46e985,_0x198fbf){var _0x10cf82={'raw':!![],'where':{'id':_0x46e985[_0xca4d('0x43')]['id']}},_0xe7061e={};_0xe7061e['model']=_['keys'](db[_0xca4d('0x2a')][_0xca4d('0x2b')]);_0xe7061e[_0xca4d('0x2f')]=_[_0xca4d('0x44')](_0x46e985[_0xca4d('0x2f')]);_0xe7061e[_0xca4d('0x30')]=_[_0xca4d('0x31')](_0xe7061e[_0xca4d('0x32')],_0xe7061e['query']);_0x10cf82[_0xca4d('0x33')]=_[_0xca4d('0x31')](_0xe7061e[_0xca4d('0x32')],qs[_0xca4d('0x34')](_0x46e985[_0xca4d('0x2f')][_0xca4d('0x34')]));_0x10cf82[_0xca4d('0x33')]=_0x10cf82[_0xca4d('0x33')][_0xca4d('0x35')]?_0x10cf82[_0xca4d('0x33')]:_0xe7061e[_0xca4d('0x32')];if(_0x46e985[_0xca4d('0x2f')][_0xca4d('0x3f')]){_0x10cf82[_0xca4d('0x45')]=[{'all':!![]}];}_0x10cf82=_[_0xca4d('0x3d')]({},_0x10cf82,_0x46e985[_0xca4d('0x3e')]);return db['CmHopperHistory'][_0xca4d('0x46')](_0x10cf82)[_0xca4d('0x24')](handleEntityNotFound(_0x198fbf,null))[_0xca4d('0x24')](respondWithResult(_0x198fbf,null))[_0xca4d('0x42')](handleError(_0x198fbf,null));};exports[_0xca4d('0x47')]=function(_0x275e67,_0x554efb){return db[_0xca4d('0x2a')][_0xca4d('0x47')](_0x275e67['body'],{})[_0xca4d('0x24')](respondWithResult(_0x554efb,0xc9))[_0xca4d('0x42')](handleError(_0x554efb,null));};exports[_0xca4d('0x48')]=function(_0x4f3561,_0xa20c36){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0xa20c36,null))[_0xca4d('0x42')](handleError(_0xa20c36,null));};exports['update']=function(_0x20bc1e,_0x264d17){if(_0x20bc1e['body'][_0xca4d('0x49')]){delete _0x20bc1e[_0xca4d('0x4a')][_0xca4d('0x49')];}return db[_0xca4d('0x2a')][_0xca4d('0x46')]({'where':{'uniqueid':_0x20bc1e[_0xca4d('0x43')]['id']}})[_0xca4d('0x24')](handleEntityNotFound(_0x264d17,null))[_0xca4d('0x24')](saveUpdates(_0x20bc1e['body'],null))['then'](respondWithResult(_0x264d17,null))[_0xca4d('0x42')](handleError(_0x264d17,null));}; \ No newline at end of file +var _0xc843=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','end','error','name','index','CmHopperHistory','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','describe','uniqueid','params'];(function(_0x2bb479,_0x4793e5){var _0x163f37=function(_0x359a48){while(--_0x359a48){_0x2bb479['push'](_0x2bb479['shift']());}};_0x163f37(++_0x4793e5);}(_0xc843,0x130));var _0x3c84=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0xc843[_0x2b55b5];return _0x103d28;};'use strict';var emlformat=require(_0x3c84('0x0'));var rimraf=require(_0x3c84('0x1'));var zipdir=require(_0x3c84('0x2'));var jsonpatch=require(_0x3c84('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c84('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3c84('0x5'));var csv=require(_0x3c84('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c84('0x7'));var _=require(_0x3c84('0x8'));var squel=require(_0x3c84('0x9'));var crypto=require(_0x3c84('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3c84('0xb'));var toCsv=require(_0x3c84('0x6'));var querystring=require(_0x3c84('0xc'));var Papa=require(_0x3c84('0xd'));var Redis=require(_0x3c84('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3c84('0xf'));var as=require(_0x3c84('0x10'));var hardwareService=require(_0x3c84('0x11'));var logger=require(_0x3c84('0x12'))(_0x3c84('0x13'));var utils=require(_0x3c84('0x14'));var config=require(_0x3c84('0x15'));var licenseUtil=require(_0x3c84('0x16'));var db=require(_0x3c84('0x17'))['db'];function respondWithStatusCode(_0x30f825,_0x2de7e8){_0x2de7e8=_0x2de7e8||0xcc;return function(_0x125ec9){if(_0x125ec9){return _0x30f825[_0x3c84('0x18')](_0x2de7e8);}return _0x30f825[_0x3c84('0x19')](_0x2de7e8)['end']();};}function respondWithResult(_0x246b9d,_0x4ea93e){_0x4ea93e=_0x4ea93e||0xc8;return function(_0x371c92){if(_0x371c92){return _0x246b9d[_0x3c84('0x19')](_0x4ea93e)[_0x3c84('0x1a')](_0x371c92);}};}function respondWithFilteredResult(_0x4f4d52,_0x11aaa8){return function(_0x55f7b2){if(_0x55f7b2){var _0xd586b3=typeof _0x11aaa8['offset']==='undefined'&&typeof _0x11aaa8[_0x3c84('0x1b')]===_0x3c84('0x1c');var _0x3a9e2d=_0x55f7b2[_0x3c84('0x1d')];var _0x503a51=_0xd586b3?0x0:_0x11aaa8['offset'];var _0x46cf35=_0xd586b3?_0x55f7b2['count']:_0x11aaa8[_0x3c84('0x1e')]+_0x11aaa8[_0x3c84('0x1b')];var _0x393f45;if(_0x46cf35>=_0x3a9e2d){_0x46cf35=_0x3a9e2d;_0x393f45=0xc8;}else{_0x393f45=0xce;}_0x4f4d52['status'](_0x393f45);return _0x4f4d52[_0x3c84('0x1f')]('Content-Range',_0x503a51+'-'+_0x46cf35+'/'+_0x3a9e2d)[_0x3c84('0x1a')](_0x55f7b2);}return null;};}function patchUpdates(_0x53736a){return function(_0x21b466){try{jsonpatch[_0x3c84('0x20')](_0x21b466,_0x53736a,!![]);}catch(_0x8822a9){return BPromise[_0x3c84('0x21')](_0x8822a9);}return _0x21b466['save']();};}function saveUpdates(_0x21edeb,_0x5d6f31){return function(_0x5a5b9d){if(_0x5a5b9d){return _0x5a5b9d[_0x3c84('0x22')](_0x21edeb)[_0x3c84('0x23')](function(_0x13b57d){return _0x13b57d;});}return null;};}function removeEntity(_0x2faa4a,_0x35fb1b){return function(_0x1765e6){if(_0x1765e6){return _0x1765e6[_0x3c84('0x24')]()[_0x3c84('0x23')](function(){_0x2faa4a[_0x3c84('0x19')](0xcc)[_0x3c84('0x25')]();});}};}function handleEntityNotFound(_0x580878,_0x561df6){return function(_0x2b5969){if(!_0x2b5969){_0x580878[_0x3c84('0x18')](0x194);}return _0x2b5969;};}function handleError(_0x37d699,_0x348d63){_0x348d63=_0x348d63||0x1f4;return function(_0x2a10c9){logger[_0x3c84('0x26')](_0x2a10c9['stack']);if(_0x2a10c9[_0x3c84('0x27')]){delete _0x2a10c9[_0x3c84('0x27')];}_0x37d699['status'](_0x348d63)['send'](_0x2a10c9);};}exports[_0x3c84('0x28')]=function(_0x31dfdb,_0x2874a7){var _0x168cd1={},_0x551ab1={},_0x36acbe={'count':0x0,'rows':[]};var _0x1e6fe7=_['map'](db[_0x3c84('0x29')][_0x3c84('0x2a')],function(_0x2058c2){return{'name':_0x2058c2[_0x3c84('0x2b')],'type':_0x2058c2[_0x3c84('0x2c')]['key']};});_0x551ab1[_0x3c84('0x2d')]=_[_0x3c84('0x2e')](_0x1e6fe7,_0x3c84('0x27'));_0x551ab1['query']=_[_0x3c84('0x2f')](_0x31dfdb['query']);_0x551ab1[_0x3c84('0x30')]=_[_0x3c84('0x31')](_0x551ab1[_0x3c84('0x2d')],_0x551ab1[_0x3c84('0x32')]);_0x168cd1['attributes']=_[_0x3c84('0x31')](_0x551ab1[_0x3c84('0x2d')],qs[_0x3c84('0x33')](_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x33')]));_0x168cd1[_0x3c84('0x34')]=_0x168cd1[_0x3c84('0x34')][_0x3c84('0x35')]?_0x168cd1['attributes']:_0x551ab1[_0x3c84('0x2d')];if(!_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x36')](_0x3c84('0x37'))){_0x168cd1['limit']=qs['limit'](_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x1b')]);_0x168cd1[_0x3c84('0x1e')]=qs[_0x3c84('0x1e')](_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x1e')]);}_0x168cd1[_0x3c84('0x38')]=qs[_0x3c84('0x39')](_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x39')]);_0x168cd1[_0x3c84('0x3a')]=qs[_0x3c84('0x30')](_[_0x3c84('0x3b')](_0x31dfdb[_0x3c84('0x32')],_0x551ab1[_0x3c84('0x30')]),_0x1e6fe7);if(_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x3c')]){_0x168cd1[_0x3c84('0x3a')]=_[_0x3c84('0x3d')](_0x168cd1[_0x3c84('0x3a')],{'$or':_[_0x3c84('0x2e')](_0x1e6fe7,function(_0x46836b){if(_0x46836b['type']!==_0x3c84('0x3e')){var _0x5bc9bf={};_0x5bc9bf[_0x46836b['name']]={'$like':'%'+_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x3c')]+'%'};return _0x5bc9bf;}})});}_0x168cd1=_[_0x3c84('0x3d')]({},_0x168cd1,_0x31dfdb[_0x3c84('0x3f')]);var _0xb418a={'where':_0x168cd1[_0x3c84('0x3a')]};return db['CmHopperHistory'][_0x3c84('0x1d')](_0xb418a)[_0x3c84('0x23')](function(_0x5e9f85){_0x36acbe[_0x3c84('0x1d')]=_0x5e9f85;if(_0x31dfdb[_0x3c84('0x32')][_0x3c84('0x40')]){_0x168cd1[_0x3c84('0x41')]=[{'all':!![]}];}return db[_0x3c84('0x29')][_0x3c84('0x42')](_0x168cd1);})['then'](function(_0x5e2763){_0x36acbe[_0x3c84('0x43')]=_0x5e2763;return _0x36acbe;})['then'](respondWithFilteredResult(_0x2874a7,_0x168cd1))[_0x3c84('0x44')](handleError(_0x2874a7,null));};exports[_0x3c84('0x45')]=function(_0x27261c,_0x19537c){var _0x4dc72c={'raw':!![],'where':{'id':_0x27261c['params']['id']}},_0x30ed20={};_0x30ed20[_0x3c84('0x2d')]=_[_0x3c84('0x2f')](db[_0x3c84('0x29')][_0x3c84('0x2a')]);_0x30ed20[_0x3c84('0x32')]=_[_0x3c84('0x2f')](_0x27261c[_0x3c84('0x32')]);_0x30ed20[_0x3c84('0x30')]=_[_0x3c84('0x31')](_0x30ed20[_0x3c84('0x2d')],_0x30ed20['query']);_0x4dc72c[_0x3c84('0x34')]=_[_0x3c84('0x31')](_0x30ed20[_0x3c84('0x2d')],qs[_0x3c84('0x33')](_0x27261c['query'][_0x3c84('0x33')]));_0x4dc72c[_0x3c84('0x34')]=_0x4dc72c[_0x3c84('0x34')][_0x3c84('0x35')]?_0x4dc72c[_0x3c84('0x34')]:_0x30ed20[_0x3c84('0x2d')];if(_0x27261c[_0x3c84('0x32')][_0x3c84('0x40')]){_0x4dc72c[_0x3c84('0x41')]=[{'all':!![]}];}_0x4dc72c=_['merge']({},_0x4dc72c,_0x27261c[_0x3c84('0x3f')]);return db[_0x3c84('0x29')][_0x3c84('0x46')](_0x4dc72c)['then'](handleEntityNotFound(_0x19537c,null))['then'](respondWithResult(_0x19537c,null))['catch'](handleError(_0x19537c,null));};exports[_0x3c84('0x47')]=function(_0x29bd94,_0xebf582){return db['CmHopperHistory'][_0x3c84('0x47')](_0x29bd94[_0x3c84('0x48')],{})[_0x3c84('0x23')](respondWithResult(_0xebf582,0xc9))['catch'](handleError(_0xebf582,null));};exports[_0x3c84('0x49')]=function(_0x21b9a7,_0x10e2e4){return db[_0x3c84('0x29')][_0x3c84('0x49')]()[_0x3c84('0x23')](respondWithResult(_0x10e2e4,null))['catch'](handleError(_0x10e2e4,null));};exports['update']=function(_0x3aea38,_0x24d23a){if(_0x3aea38['body'][_0x3c84('0x4a')]){delete _0x3aea38[_0x3c84('0x48')]['uniqueid'];}return db[_0x3c84('0x29')]['find']({'where':{'uniqueid':_0x3aea38[_0x3c84('0x4b')]['id']}})[_0x3c84('0x23')](handleEntityNotFound(_0x24d23a,null))[_0x3c84('0x23')](saveUpdates(_0x3aea38[_0x3c84('0x48')],null))[_0x3c84('0x23')](respondWithResult(_0x24d23a,null))[_0x3c84('0x44')](handleError(_0x24d23a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 601cc7d..18afdd4 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 _0x7ea9=['endtime','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','cm_hopper_history'];(function(_0x19a03e,_0x17b45e){var _0x50e88a=function(_0x5b0e1a){while(--_0x5b0e1a){_0x19a03e['push'](_0x19a03e['shift']());}};_0x50e88a(++_0x17b45e);}(_0x7ea9,0xec));var _0x97ea=function(_0x34e0e0,_0x201475){_0x34e0e0=_0x34e0e0-0x0;var _0x4b612c=_0x7ea9[_0x34e0e0];return _0x4b612c;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var logger=require(_0x97ea('0x1'))(_0x97ea('0x2'));var moment=require(_0x97ea('0x3'));var BPromise=require(_0x97ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97ea('0x5'));var rimraf=require(_0x97ea('0x6'));var config=require(_0x97ea('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x97ea('0x8')]=function(_0x112297,_0x74638c){return _0x112297[_0x97ea('0x9')]('CmHopperHistory',attributes,{'tableName':_0x97ea('0xa'),'paranoid':![],'indexes':[{'name':_0x97ea('0xb'),'fields':['endtime']},{'name':_0x97ea('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3a8=['util','../../config/logger','moment','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x571a66,_0x1c0c01){var _0x2a8432=function(_0x3af2d1){while(--_0x3af2d1){_0x571a66['push'](_0x571a66['shift']());}};_0x2a8432(++_0x1c0c01);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x258b2b,_0x23d381){_0x258b2b=_0x258b2b-0x0;var _0x16a6df=_0xf3a8[_0x258b2b];return _0x16a6df;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3a('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3a('0x4'));var attributes=require('./cmHopperHistory.attributes');module[_0x8f3a('0x5')]=function(_0x3d6e2d,_0x109997){return _0x3d6e2d[_0x8f3a('0x6')](_0x8f3a('0x7'),attributes,{'tableName':_0x8f3a('0x8'),'paranoid':![],'indexes':[{'name':_0x8f3a('0x9'),'fields':[_0x8f3a('0x9')]},{'name':_0x8f3a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 04760b2..3dd065a 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 _0x2dae=['jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopperHistory','body','options','raw','info','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xcb409d,_0x506635){var _0x1c0d2f=function(_0x588d55){while(--_0x588d55){_0xcb409d['push'](_0xcb409d['shift']());}};_0x1c0d2f(++_0x506635);}(_0x2dae,0xc3));var _0xe2da=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x2dae[_0x307bf6];return _0x2878fc;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});}exports['CreateCmHopperHistory']=function(_0x45bb92){var _0x1f7d33=this;return new Promise(function(_0x417363,_0x2e5730){return db[_0xe2da('0x16')]['create'](_0x45bb92[_0xe2da('0x17')],{'raw':_0x45bb92[_0xe2da('0x18')]?_0x45bb92['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![]})[_0xe2da('0xc')](function(_0x332193){logger[_0xe2da('0x1a')](_0xe2da('0x1b'),_0x45bb92);logger[_0xe2da('0xf')]('CreateCmHopperHistory',_0x45bb92,JSON[_0xe2da('0x11')](_0x332193));_0x417363(_0x332193);})['catch'](function(_0x30efdc){logger[_0xe2da('0x12')](_0xe2da('0x1b'),_0x30efdc[_0xe2da('0x13')],_0x45bb92);_0x2e5730(_0x1f7d33[_0xe2da('0x12')](0x1f4,_0x30efdc[_0xe2da('0x13')]));});});};exports[_0xe2da('0x1c')]=function(_0x221e98){var _0x5a08d6=this;return new Promise(function(_0x1c901e,_0x357bff){return db[_0xe2da('0x16')][_0xe2da('0x1d')]({'raw':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x221e98['options']?_0x221e98[_0xe2da('0x18')][_0xe2da('0x1e')]||null:null,'attributes':[[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')][_0xe2da('0x21')]('id')),_0xe2da('0x22')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x24')))),_0xe2da('0x25')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x26')))),_0xe2da('0x27')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x28'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x29')))),_0xe2da('0x2a')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x28'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x2b')))),_0xe2da('0x2c')]]})[_0xe2da('0xc')](function(_0x2618a1){logger[_0xe2da('0x1a')](_0xe2da('0x1c'),_0x221e98);logger['debug'](_0xe2da('0x1c'),_0x221e98,JSON[_0xe2da('0x11')](_0x2618a1));_0x1c901e(_0x2618a1);})[_0xe2da('0x15')](function(_0x5e1f39){logger[_0xe2da('0x12')](_0xe2da('0x1c'),_0x5e1f39[_0xe2da('0x13')],_0x221e98);_0x357bff(_0x5a08d6['error'](0x1f4,_0x5e1f39['message']));});});};exports[_0xe2da('0x2d')]=function(_0x1f4a5a){var _0x4d6e6c=this;return new Promise(function(_0x2e7324,_0x15df09){return db[_0xe2da('0x16')][_0xe2da('0x1d')]({'raw':_0x1f4a5a[_0xe2da('0x18')]?_0x1f4a5a['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x1f4a5a['options']?_0x1f4a5a['options'][_0xe2da('0x1e')]||null:null,'attributes':[['campaign',_0xe2da('0x2e')],[db[_0xe2da('0x1f')]['fn']('COUNT',db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x2f')))),_0xe2da('0x30')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x24')))),'outboundAnswerCallsDay'],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x31')))),_0xe2da('0x32')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xe2da('0x33')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x34')))),_0xe2da('0x35')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xe2da('0x36')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x37')))),_0xe2da('0x38')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x39')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xe2da('0x20'),db['sequelize']['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),_0xe2da('0x3a')],[db[_0xe2da('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x3b')))),_0xe2da('0x3c')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')](_0xe2da('0x3d')))),_0xe2da('0x3e')],[db['sequelize']['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')]['literal'](_0xe2da('0x3f')))),_0xe2da('0x3c')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db[_0xe2da('0x1f')][_0xe2da('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xe2da('0x40')]})[_0xe2da('0xc')](function(_0x28f916){logger['info']('GetVoiceQueueHopperHistory',_0x1f4a5a);logger[_0xe2da('0xf')]('GetVoiceQueueHopperHistory',_0x1f4a5a,JSON[_0xe2da('0x11')](_0x28f916));_0x2e7324(_0x28f916);})[_0xe2da('0x15')](function(_0x8e78b9){logger[_0xe2da('0x12')](_0xe2da('0x2d'),_0x8e78b9[_0xe2da('0x13')],_0x1f4a5a);_0x15df09(_0x4d6e6c[_0xe2da('0x12')](0x1f4,_0x8e78b9[_0xe2da('0x13')]));});});};exports[_0xe2da('0x41')]=function(_0x4aa686){var _0x26a9f0=this;return new Promise(function(_0x2f763b,_0x98136a){return db[_0xe2da('0x16')]['findAll']({'raw':_0x4aa686[_0xe2da('0x18')]?_0x4aa686[_0xe2da('0x18')][_0xe2da('0x19')]===undefined?!![]:![]:!![],'where':_0x4aa686['options']?_0x4aa686[_0xe2da('0x18')][_0xe2da('0x1e')]||null:null,'attributes':[[_0xe2da('0x40'),_0xe2da('0x2e')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')][_0xe2da('0x21')]('id')),_0xe2da('0x42')],[db[_0xe2da('0x1f')]['fn'](_0xe2da('0x20'),db[_0xe2da('0x1f')]['fn']('IF',db['sequelize'][_0xe2da('0x23')](_0xe2da('0x24')))),_0xe2da('0x43')]],'group':[_0xe2da('0x40')]})[_0xe2da('0xc')](function(_0x277e8c){logger[_0xe2da('0x1a')]('GetCampaignHopperHistory',_0x4aa686);logger[_0xe2da('0xf')]('GetCampaignHopperHistory',_0x4aa686,JSON[_0xe2da('0x11')](_0x277e8c));_0x2f763b(_0x277e8c);})[_0xe2da('0x15')](function(_0x5b0c33){logger['error'](_0xe2da('0x41'),_0x5b0c33['message'],_0x4aa686);_0x98136a(_0x26a9f0[_0xe2da('0x12')](0x1f4,_0x5b0c33['message']));});});}; \ No newline at end of file +var _0xb447=['request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','AvgHandleTime','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`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','campaign','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','findAll','name','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xb447,0xd5));var _0x7b44=function(_0xbbac67,_0x2d50b8){_0xbbac67=_0xbbac67-0x0;var _0x13d205=_0xb447[_0xbbac67];return _0x13d205;};'use strict';var _=require(_0x7b44('0x0'));var util=require(_0x7b44('0x1'));var moment=require(_0x7b44('0x2'));var BPromise=require(_0x7b44('0x3'));var rs=require(_0x7b44('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7b44('0x5'))('rpc');var config=require(_0x7b44('0x6'));var jayson=require(_0x7b44('0x7'));var client=jayson['client'][_0x7b44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e3ab5,_0xf59bfc,_0x8667c0){return new BPromise(function(_0x163e8f,_0x308162){return client[_0x7b44('0x9')](_0x2e3ab5,_0x8667c0)[_0x7b44('0xa')](function(_0x415d37){logger['info'](_0x7b44('0xb'),_0xf59bfc,_0x7b44('0xc'));logger[_0x7b44('0xd')](_0x7b44('0xe'),_0xf59bfc,_0x7b44('0xc'),JSON[_0x7b44('0xf')](_0x415d37));if(_0x415d37[_0x7b44('0x10')]){if(_0x415d37[_0x7b44('0x10')][_0x7b44('0x11')]===0x1f4){logger[_0x7b44('0x10')](_0x7b44('0xb'),_0xf59bfc,_0x415d37[_0x7b44('0x10')][_0x7b44('0x12')]);return _0x308162(_0x415d37[_0x7b44('0x10')][_0x7b44('0x12')]);}logger[_0x7b44('0x10')](_0x7b44('0xb'),_0xf59bfc,_0x415d37[_0x7b44('0x10')][_0x7b44('0x12')]);return _0x163e8f(_0x415d37[_0x7b44('0x10')][_0x7b44('0x12')]);}else{logger[_0x7b44('0x13')](_0x7b44('0xb'),_0xf59bfc,_0x7b44('0xc'));_0x163e8f(_0x415d37[_0x7b44('0x14')][_0x7b44('0x12')]);}})[_0x7b44('0x15')](function(_0x6f63e7){logger[_0x7b44('0x10')](_0x7b44('0xb'),_0xf59bfc,_0x6f63e7);_0x308162(_0x6f63e7);});});}exports[_0x7b44('0x16')]=function(_0x22b3d1){var _0x24a543=this;return new Promise(function(_0x2d50e1,_0x8d4330){return db[_0x7b44('0x17')][_0x7b44('0x18')](_0x22b3d1['body'],{'raw':_0x22b3d1['options']?_0x22b3d1[_0x7b44('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7b44('0xa')](function(_0x132249){logger[_0x7b44('0x13')](_0x7b44('0x16'),_0x22b3d1);logger[_0x7b44('0xd')](_0x7b44('0x16'),_0x22b3d1,JSON[_0x7b44('0xf')](_0x132249));_0x2d50e1(_0x132249);})[_0x7b44('0x15')](function(_0x1fa569){logger[_0x7b44('0x10')](_0x7b44('0x16'),_0x1fa569[_0x7b44('0x12')],_0x22b3d1);_0x8d4330(_0x24a543[_0x7b44('0x10')](0x1f4,_0x1fa569[_0x7b44('0x12')]));});});};exports[_0x7b44('0x1a')]=function(_0x1e245a){var _0x1d381d=this;return new Promise(function(_0x5ece38,_0x13845c){return db[_0x7b44('0x17')]['findAll']({'raw':_0x1e245a[_0x7b44('0x19')]?_0x1e245a[_0x7b44('0x19')][_0x7b44('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e245a[_0x7b44('0x19')]?_0x1e245a[_0x7b44('0x19')][_0x7b44('0x1c')]||null:null,'attributes':[[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')][_0x7b44('0x1f')]('id')),_0x7b44('0x20')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db['sequelize'][_0x7b44('0x21')](_0x7b44('0x22')))),_0x7b44('0x23')],[db['sequelize']['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x24')))),_0x7b44('0x25')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x26')))),_0x7b44('0x27')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x28'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x29')))),_0x7b44('0x2a')],[db[_0x7b44('0x1d')]['fn']('AVG',db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')]['literal'](_0x7b44('0x2b')))),_0x7b44('0x2c')]]})[_0x7b44('0xa')](function(_0x283665){logger[_0x7b44('0x13')]('AvgHandleTime',_0x1e245a);logger[_0x7b44('0xd')]('AvgHandleTime',_0x1e245a,JSON[_0x7b44('0xf')](_0x283665));_0x5ece38(_0x283665);})[_0x7b44('0x15')](function(_0x4c1315){logger[_0x7b44('0x10')](_0x7b44('0x1a'),_0x4c1315[_0x7b44('0x12')],_0x1e245a);_0x13845c(_0x1d381d[_0x7b44('0x10')](0x1f4,_0x4c1315['message']));});});};exports[_0x7b44('0x2d')]=function(_0x87d5e2){var _0x9c7736=this;return new Promise(function(_0x24f8c9,_0x220d88){return db[_0x7b44('0x17')]['findAll']({'raw':_0x87d5e2[_0x7b44('0x19')]?_0x87d5e2[_0x7b44('0x19')][_0x7b44('0x1b')]===undefined?!![]:![]:!![],'where':_0x87d5e2[_0x7b44('0x19')]?_0x87d5e2[_0x7b44('0x19')][_0x7b44('0x1c')]||null:null,'attributes':[[_0x7b44('0x2e'),'name'],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0x7b44('0x2f')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db['sequelize']['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x30')))),_0x7b44('0x31')],[db[_0x7b44('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x7b44('0x21')](_0x7b44('0x22')))),_0x7b44('0x32')],[db['sequelize']['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db['sequelize'][_0x7b44('0x21')](_0x7b44('0x33')))),_0x7b44('0x34')],[db[_0x7b44('0x1d')]['fn']('COUNT',db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')]['literal'](_0x7b44('0x35')))),_0x7b44('0x36')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db['sequelize']['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x37')))),_0x7b44('0x38')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db['sequelize']['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x39')))),_0x7b44('0x3a')],[db[_0x7b44('0x1d')]['fn']('COUNT',db[_0x7b44('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x7b44('0x3b')))),'outboundUnknownCallsDay'],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x3c')))),_0x7b44('0x3d')],[db[_0x7b44('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7b44('0x3e')))),_0x7b44('0x3f')],[db['sequelize']['fn'](_0x7b44('0x1e'),db['sequelize']['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x40')))),_0x7b44('0x41')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')][_0x7b44('0x21')](_0x7b44('0x42')))),'outboundAnswerAgiCallsDay'],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')]['literal'](_0x7b44('0x43')))),_0x7b44('0x41')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db['sequelize'][_0x7b44('0x21')](_0x7b44('0x44')))),_0x7b44('0x45')]],'group':[_0x7b44('0x2e')]})[_0x7b44('0xa')](function(_0x19f6ff){logger[_0x7b44('0x13')](_0x7b44('0x2d'),_0x87d5e2);logger['debug'](_0x7b44('0x2d'),_0x87d5e2,JSON[_0x7b44('0xf')](_0x19f6ff));_0x24f8c9(_0x19f6ff);})[_0x7b44('0x15')](function(_0x149e17){logger['error'](_0x7b44('0x2d'),_0x149e17[_0x7b44('0x12')],_0x87d5e2);_0x220d88(_0x9c7736[_0x7b44('0x10')](0x1f4,_0x149e17[_0x7b44('0x12')]));});});};exports[_0x7b44('0x46')]=function(_0x4362ae){var _0xab727f=this;return new Promise(function(_0x138cf7,_0x1c069a){return db[_0x7b44('0x17')][_0x7b44('0x47')]({'raw':_0x4362ae['options']?_0x4362ae[_0x7b44('0x19')][_0x7b44('0x1b')]===undefined?!![]:![]:!![],'where':_0x4362ae[_0x7b44('0x19')]?_0x4362ae[_0x7b44('0x19')][_0x7b44('0x1c')]||null:null,'attributes':[[_0x7b44('0x2e'),_0x7b44('0x48')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')][_0x7b44('0x1f')]('id')),_0x7b44('0x49')],[db[_0x7b44('0x1d')]['fn'](_0x7b44('0x1e'),db[_0x7b44('0x1d')]['fn']('IF',db[_0x7b44('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x7b44('0x2e')]})[_0x7b44('0xa')](function(_0x7db97d){logger['info'](_0x7b44('0x46'),_0x4362ae);logger[_0x7b44('0xd')](_0x7b44('0x46'),_0x4362ae,JSON[_0x7b44('0xf')](_0x7db97d));_0x138cf7(_0x7db97d);})['catch'](function(_0x497956){logger[_0x7b44('0x10')](_0x7b44('0x46'),_0x497956[_0x7b44('0x12')],_0x4362ae);_0x1c069a(_0xab727f['error'](0x1f4,_0x497956[_0x7b44('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b6847da..f10294c 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 _0xdac0=['/:id','show','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get'];(function(_0x516302,_0x1b166f){var _0x1cfc8a=function(_0x157faa){while(--_0x157faa){_0x516302['push'](_0x516302['shift']());}};_0x1cfc8a(++_0x1b166f);}(_0xdac0,0xb4));var _0x0dac=function(_0xc9840a,_0xaee017){_0xc9840a=_0xc9840a-0x0;var _0x297efc=_0xdac0[_0xc9840a];return _0x297efc;};'use strict';var multer=require(_0x0dac('0x0'));var util=require(_0x0dac('0x1'));var path=require(_0x0dac('0x2'));var timeout=require(_0x0dac('0x3'));var express=require(_0x0dac('0x4'));var router=express[_0x0dac('0x5')]();var fs_extra=require(_0x0dac('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0dac('0x7'));var controller=require(_0x0dac('0x8'));router['get']('/',auth[_0x0dac('0x9')](),controller[_0x0dac('0xa')]);router[_0x0dac('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0dac('0xb')](_0x0dac('0xc'),auth['isAuthenticated'](),controller[_0x0dac('0xd')]);router['post']('/',auth[_0x0dac('0x9')](),controller[_0x0dac('0xe')]);router[_0x0dac('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x303b=['get','isAuthenticated','index','/describe','describe','/:id','show','post','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x303b,0x1b9));var _0xb303=function(_0x186e2a,_0x593a2e){_0x186e2a=_0x186e2a-0x0;var _0x5b6e5f=_0x303b[_0x186e2a];return _0x5b6e5f;};'use strict';var multer=require(_0xb303('0x0'));var util=require('util');var path=require(_0xb303('0x1'));var timeout=require(_0xb303('0x2'));var express=require(_0xb303('0x3'));var router=express[_0xb303('0x4')]();var fs_extra=require(_0xb303('0x5'));var auth=require(_0xb303('0x6'));var interaction=require(_0xb303('0x7'));var config=require(_0xb303('0x8'));var controller=require('./cmHopperHistory.controller');router[_0xb303('0x9')]('/',auth[_0xb303('0xa')](),controller[_0xb303('0xb')]);router[_0xb303('0x9')](_0xb303('0xc'),auth[_0xb303('0xa')](),controller[_0xb303('0xd')]);router[_0xb303('0x9')](_0xb303('0xe'),auth[_0xb303('0xa')](),controller[_0xb303('0xf')]);router[_0xb303('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xb303('0xa')](),controller[_0xb303('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ca99155..9fd17aa 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 _0x6c84=['STRING','name','sequelize','exports'];(function(_0x18b26a,_0xb3d99a){var _0x38264a=function(_0x4f8c26){while(--_0x4f8c26){_0x18b26a['push'](_0x18b26a['shift']());}};_0x38264a(++_0xb3d99a);}(_0x6c84,0x112));var _0x46c8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6c84[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x46c8('0x0'));module[_0x46c8('0x1')]={'name':{'type':Sequelize[_0x46c8('0x2')],'unique':_0x46c8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x46c8('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x00b3=['STRING','sequelize','name'];(function(_0x3f40c9,_0x151436){var _0x4f8ec1=function(_0x187598){while(--_0x187598){_0x3f40c9['push'](_0x3f40c9['shift']());}};_0x4f8ec1(++_0x151436);}(_0x00b3,0x97));var _0x300b=function(_0x2b7cbf,_0x237612){_0x2b7cbf=_0x2b7cbf-0x0;var _0x11caec=_0x00b3[_0x2b7cbf];return _0x11caec;};'use strict';var Sequelize=require(_0x300b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x300b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x300b('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 073940a..7cf6be2 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 _0xd606=['findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','findOne','keys','Disposition','nolimit','ListId','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','message','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','CmList','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','options','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd606,0x1a1));var _0x6d60=function(_0x21c2bd,_0x52779a){_0x21c2bd=_0x21c2bd-0x0;var _0x54d40d=_0xd606[_0x21c2bd];return _0x54d40d;};'use strict';var emlformat=require(_0x6d60('0x0'));var rimraf=require(_0x6d60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d60('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d60('0x3'));var util=require(_0x6d60('0x4'));var path=require(_0x6d60('0x5'));var sox=require('sox');var csv=require(_0x6d60('0x6'));var ejs=require(_0x6d60('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6d60('0x8'));var crypto=require(_0x6d60('0x9'));var jsforce=require(_0x6d60('0xa'));var deskjs=require(_0x6d60('0xb'));var toCsv=require(_0x6d60('0x6'));var querystring=require('querystring');var Papa=require(_0x6d60('0xc'));var Redis=require(_0x6d60('0xd'));var authService=require(_0x6d60('0xe'));var qs=require(_0x6d60('0xf'));var as=require(_0x6d60('0x10'));var hardwareService=require(_0x6d60('0x11'));var logger=require(_0x6d60('0x12'))(_0x6d60('0x13'));var utils=require(_0x6d60('0x14'));var config=require(_0x6d60('0x15'));var licenseUtil=require(_0x6d60('0x16'));var db=require(_0x6d60('0x17'))['db'];var csv_results;config[_0x6d60('0x18')]=_[_0x6d60('0x19')](config[_0x6d60('0x18')],{'host':_0x6d60('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6d60('0x1b'))[_0x6d60('0x1c')](socket);function respondWithStatusCode(_0x1b420d,_0x3c2dd8){_0x3c2dd8=_0x3c2dd8||0xcc;return function(_0xe396a5){if(_0xe396a5){return _0x1b420d['sendStatus'](_0x3c2dd8);}return _0x1b420d[_0x6d60('0x1d')](_0x3c2dd8)[_0x6d60('0x1e')]();};}function respondWithResult(_0x3178cb,_0x590e36){_0x590e36=_0x590e36||0xc8;return function(_0x591aaa){if(_0x591aaa){return _0x3178cb['status'](_0x590e36)[_0x6d60('0x1f')](_0x591aaa);}};}function respondWithFilteredResult(_0x431706,_0x5584b7){return function(_0x43e29f){if(_0x43e29f){var _0x44aa9e=typeof _0x5584b7[_0x6d60('0x20')]==='undefined'&&typeof _0x5584b7[_0x6d60('0x21')]===_0x6d60('0x22');var _0x5ea304=_0x43e29f['count'];var _0x43b087=_0x44aa9e?0x0:_0x5584b7[_0x6d60('0x20')];var _0x355035=_0x44aa9e?_0x43e29f[_0x6d60('0x23')]:_0x5584b7[_0x6d60('0x20')]+_0x5584b7['limit'];var _0x3136d2;if(_0x355035>=_0x5ea304){_0x355035=_0x5ea304;_0x3136d2=0xc8;}else{_0x3136d2=0xce;}_0x431706[_0x6d60('0x1d')](_0x3136d2);return _0x431706[_0x6d60('0x24')](_0x6d60('0x25'),_0x43b087+'-'+_0x355035+'/'+_0x5ea304)[_0x6d60('0x1f')](_0x43e29f);}return null;};}function patchUpdates(_0x3079f9){return function(_0x137158){try{jsonpatch[_0x6d60('0x26')](_0x137158,_0x3079f9,!![]);}catch(_0x25fd75){return BPromise['reject'](_0x25fd75);}return _0x137158[_0x6d60('0x27')]();};}function saveUpdates(_0x4a0d68,_0x29a854){return function(_0x4747d7){if(_0x4747d7){return _0x4747d7[_0x6d60('0x28')](_0x4a0d68)[_0x6d60('0x29')](function(_0x34ee9e){return _0x34ee9e;});}return null;};}function removeEntity(_0x51dae7,_0x48cc05){return function(_0x120081){if(_0x120081){return _0x120081['destroy']()[_0x6d60('0x29')](function(){var _0x37c2c6=_0x120081[_0x6d60('0x2a')]({'plain':!![]});var _0x43f120='Lists';return db[_0x6d60('0x2b')]['destroy']({'where':{'type':_0x43f120,'resourceId':_0x37c2c6['id']}})[_0x6d60('0x29')](function(){return _0x120081;});})[_0x6d60('0x29')](function(){_0x51dae7[_0x6d60('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198863,_0x667106){return function(_0x4c1131){if(!_0x4c1131){_0x198863[_0x6d60('0x2c')](0x194);}return _0x4c1131;};}function handleError(_0x3623a5,_0x32ad2c){_0x32ad2c=_0x32ad2c||0x1f4;return function(_0x37a478){logger[_0x6d60('0x2d')](_0x37a478[_0x6d60('0x2e')]);if(_0x37a478[_0x6d60('0x2f')]){delete _0x37a478[_0x6d60('0x2f')];}_0x3623a5[_0x6d60('0x1d')](_0x32ad2c)[_0x6d60('0x30')](_0x37a478);};}exports[_0x6d60('0x31')]=function(_0x2237fc,_0x507699){var _0x92c007={},_0x3dc04c={},_0x385be1={'count':0x0,'rows':[]};var _0x188fee=_['map'](db[_0x6d60('0x32')]['rawAttributes'],function(_0x56a18e){return{'name':_0x56a18e[_0x6d60('0x33')],'type':_0x56a18e[_0x6d60('0x34')]['key']};});_0x3dc04c[_0x6d60('0x35')]=_['map'](_0x188fee,_0x6d60('0x2f'));_0x3dc04c[_0x6d60('0x36')]=_['keys'](_0x2237fc[_0x6d60('0x36')]);_0x3dc04c['filters']=_[_0x6d60('0x37')](_0x3dc04c[_0x6d60('0x35')],_0x3dc04c['query']);_0x92c007['attributes']=_[_0x6d60('0x37')](_0x3dc04c['model'],qs[_0x6d60('0x38')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x38')]));_0x92c007[_0x6d60('0x39')]=_0x92c007['attributes'][_0x6d60('0x3a')]?_0x92c007[_0x6d60('0x39')]:_0x3dc04c[_0x6d60('0x35')];if(!_0x2237fc[_0x6d60('0x36')][_0x6d60('0x3b')]('nolimit')){_0x92c007[_0x6d60('0x21')]=qs['limit'](_0x2237fc[_0x6d60('0x36')]['limit']);_0x92c007['offset']=qs[_0x6d60('0x20')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x92c007[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x2237fc[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x92c007[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x2237fc['query'],_0x3dc04c[_0x6d60('0x3f')]),_0x188fee);if(_0x2237fc[_0x6d60('0x36')][_0x6d60('0x41')]){_0x92c007[_0x6d60('0x3e')]=_['merge'](_0x92c007[_0x6d60('0x3e')],{'$or':_[_0x6d60('0x42')](_0x188fee,function(_0x1e6b1c){if(_0x1e6b1c['type']!=='VIRTUAL'){var _0xd107da={};_0xd107da[_0x1e6b1c[_0x6d60('0x2f')]]={'$like':'%'+_0x2237fc[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0xd107da;}})});}_0x92c007=_['merge']({},_0x92c007,_0x2237fc[_0x6d60('0x43')]);var _0x5c0e24={'where':_0x92c007['where']};return db[_0x6d60('0x32')][_0x6d60('0x23')](_0x5c0e24)[_0x6d60('0x29')](function(_0x517843){_0x385be1[_0x6d60('0x23')]=_0x517843;if(_0x2237fc[_0x6d60('0x36')]['includeAll']){_0x92c007[_0x6d60('0x44')]=[{'all':!![]}];}return db['CmList'][_0x6d60('0x45')](_0x92c007);})[_0x6d60('0x29')](function(_0x33881e){_0x385be1[_0x6d60('0x46')]=_0x33881e;return _0x385be1;})[_0x6d60('0x29')](respondWithFilteredResult(_0x507699,_0x92c007))[_0x6d60('0x47')](handleError(_0x507699,null));};exports[_0x6d60('0x48')]=function(_0x2b0772,_0x3c5dbe){var _0x48db3d={'raw':![],'where':{'id':_0x2b0772[_0x6d60('0x49')]['id']}},_0x209c55={};_0x209c55['model']=_['keys'](db[_0x6d60('0x32')][_0x6d60('0x4a')]);_0x209c55[_0x6d60('0x36')]=_['keys'](_0x2b0772[_0x6d60('0x36')]);_0x209c55['filters']=_['intersection'](_0x209c55['model'],_0x209c55['query']);_0x48db3d[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x209c55[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x2b0772['query'][_0x6d60('0x38')]));_0x48db3d[_0x6d60('0x39')]=_0x48db3d[_0x6d60('0x39')][_0x6d60('0x3a')]?_0x48db3d[_0x6d60('0x39')]:_0x209c55[_0x6d60('0x35')];if(_0x2b0772[_0x6d60('0x36')][_0x6d60('0x4b')]){_0x48db3d['include']=[{'all':!![]}];}_0x48db3d=_[_0x6d60('0x4c')]({},_0x48db3d,_0x2b0772[_0x6d60('0x43')]);return db[_0x6d60('0x32')][_0x6d60('0x4d')](_0x48db3d)[_0x6d60('0x29')](handleEntityNotFound(_0x3c5dbe,null))[_0x6d60('0x29')](respondWithResult(_0x3c5dbe,null))['catch'](handleError(_0x3c5dbe,null));};exports[_0x6d60('0x4e')]=function(_0x19e323,_0x4cc661){return db['CmList'][_0x6d60('0x4e')](_0x19e323[_0x6d60('0x4f')],{})[_0x6d60('0x29')](function(_0x13474e){var _0x37fedd=_0x19e323[_0x6d60('0x50')][_0x6d60('0x2a')]({'plain':!![]});if(!_0x37fedd)throw new Error(_0x6d60('0x51'));if(_0x37fedd[_0x6d60('0x52')]===_0x6d60('0x50')){var _0x51259c=_0x13474e[_0x6d60('0x2a')]({'plain':!![]});var _0x4e9571=_0x6d60('0x53');return db[_0x6d60('0x54')]['find']({'where':{'name':_0x4e9571,'userProfileId':_0x37fedd['userProfileId']},'raw':!![]})[_0x6d60('0x29')](function(_0x5452c3){if(_0x5452c3&&_0x5452c3[_0x6d60('0x55')]===0x0){return db[_0x6d60('0x2b')]['create']({'name':_0x51259c[_0x6d60('0x2f')],'resourceId':_0x51259c['id'],'type':_0x5452c3[_0x6d60('0x2f')],'sectionId':_0x5452c3['id']},{})[_0x6d60('0x29')](function(){return _0x13474e;});}else{return _0x13474e;}})[_0x6d60('0x47')](function(_0x4fbaec){logger[_0x6d60('0x2d')](_0x6d60('0x56'),_0x4fbaec);throw _0x4fbaec;});}return _0x13474e;})[_0x6d60('0x29')](respondWithResult(_0x4cc661,0xc9))[_0x6d60('0x47')](handleError(_0x4cc661,null));};exports[_0x6d60('0x28')]=function(_0x40a231,_0x359ee1){if(_0x40a231['body']['id']){delete _0x40a231[_0x6d60('0x4f')]['id'];}return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x40a231[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x359ee1,null))[_0x6d60('0x29')](saveUpdates(_0x40a231[_0x6d60('0x4f')],null))[_0x6d60('0x29')](respondWithResult(_0x359ee1,null))[_0x6d60('0x47')](handleError(_0x359ee1,null));};exports[_0x6d60('0x57')]=function(_0xc18800,_0x53af26){return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0xc18800[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x53af26,null))['then'](removeEntity(_0x53af26,null))[_0x6d60('0x47')](handleError(_0x53af26,null));};exports[_0x6d60('0x58')]=function(_0x4eb8c2,_0x310d6d){return db[_0x6d60('0x32')][_0x6d60('0x58')]()[_0x6d60('0x29')](respondWithResult(_0x310d6d,null))[_0x6d60('0x47')](handleError(_0x310d6d,null));};exports[_0x6d60('0x59')]=function(_0x10b516,_0x19423a,_0x4cdff1){if(_0x10b516['body']['id']){delete _0x10b516[_0x6d60('0x4f')]['id'];}return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x10b516[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x19423a,null))[_0x6d60('0x29')](function(_0x161906){if(_0x161906){_0x10b516[_0x6d60('0x4f')]['ListId']=_0x161906['id'];return db['Disposition'][_0x6d60('0x4e')](_0x10b516[_0x6d60('0x4f')]);}})[_0x6d60('0x29')](respondWithResult(_0x19423a,null))[_0x6d60('0x47')](handleError(_0x19423a,null));};exports['getDispositions']=function(_0x119216,_0x5d9fa8,_0x20ce63){var _0x3dd16d={'raw':![],'where':{}};var _0x37e6a7={};var _0x53b5bb={'count':0x0,'rows':[]};return db['CmList'][_0x6d60('0x5a')]({'where':{'id':_0x119216[_0x6d60('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d9fa8,null))[_0x6d60('0x29')](function(_0x5da59a){if(_0x5da59a){_0x37e6a7[_0x6d60('0x35')]=_[_0x6d60('0x5b')](db[_0x6d60('0x5c')][_0x6d60('0x4a')]);_0x37e6a7[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x119216[_0x6d60('0x36')]);_0x37e6a7['filters']=_['intersection'](_0x37e6a7['model'],_0x37e6a7[_0x6d60('0x36')]);_0x3dd16d[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x37e6a7[_0x6d60('0x35')],qs['fields'](_0x119216['query'][_0x6d60('0x38')]));_0x3dd16d[_0x6d60('0x39')]=_0x3dd16d['attributes'][_0x6d60('0x3a')]?_0x3dd16d[_0x6d60('0x39')]:_0x37e6a7[_0x6d60('0x35')];if(!_0x119216[_0x6d60('0x36')]['hasOwnProperty'](_0x6d60('0x5d'))){_0x3dd16d[_0x6d60('0x21')]=qs['limit'](_0x119216[_0x6d60('0x36')][_0x6d60('0x21')]);_0x3dd16d['offset']=qs[_0x6d60('0x20')](_0x119216[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x3dd16d[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x119216[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x3dd16d[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x119216[_0x6d60('0x36')],_0x37e6a7['filters']));_0x3dd16d[_0x6d60('0x3e')][_0x6d60('0x5e')]=_0x5da59a['id'];if(_0x119216['query'][_0x6d60('0x41')]){_0x3dd16d[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x3dd16d[_0x6d60('0x3e')],{'$or':_['map'](_0x3dd16d['attributes'],function(_0x20688f){var _0xb8af8d={};_0xb8af8d[_0x20688f]={'$like':'%'+_0x119216[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0xb8af8d;})});}_0x3dd16d=_['merge']({},_0x3dd16d,_0x119216['options']);return db[_0x6d60('0x5c')]['count']({'where':_0x3dd16d[_0x6d60('0x3e')]})[_0x6d60('0x29')](function(_0x452245){_0x53b5bb[_0x6d60('0x23')]=_0x452245;if(_0x119216[_0x6d60('0x36')]['includeAll']){_0x3dd16d[_0x6d60('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x6d60('0x45')](_0x3dd16d);})[_0x6d60('0x29')](function(_0x49618c){_0x53b5bb['rows']=_0x49618c;return _0x53b5bb;});}})[_0x6d60('0x29')](respondWithFilteredResult(_0x5d9fa8,_0x3dd16d))[_0x6d60('0x47')](handleError(_0x5d9fa8,null));};exports['removeDispositions']=function(_0x4787c0,_0x1b6788,_0x1ce87c){return db[_0x6d60('0x32')][_0x6d60('0x4d')]({'where':{'id':_0x4787c0[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x1b6788,null))[_0x6d60('0x29')](function(_0x54a2e9){if(_0x54a2e9){return _0x54a2e9[_0x6d60('0x5f')](_0x4787c0['query'][_0x6d60('0x60')]);}})[_0x6d60('0x29')](respondWithStatusCode(_0x1b6788,null))[_0x6d60('0x47')](handleError(_0x1b6788,null));};exports[_0x6d60('0x61')]=function(_0x458a3a,_0x48ee16,_0x84c92f){return db[_0x6d60('0x32')]['find']({'where':{'id':_0x458a3a['params']['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x48ee16,null))[_0x6d60('0x29')](function(_0x56f70d){if(_0x56f70d){var _0x365a74=[];var _0x1a4520={'success':[],'errors':[]};return db[_0x6d60('0x62')][_0x6d60('0x58')]()[_0x6d60('0x29')](function(_0xc52f8){if(_0x458a3a['body']['tags']&&_['isArray'](_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')])){if(_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]['length']){_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]=_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')][_0x6d60('0x64')](';')+';';}else{_0x458a3a[_0x6d60('0x4f')]['tags']=null;}}else{_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x63')]=null;}if(_0x458a3a[_0x6d60('0x4f')]&&_[_0x6d60('0x65')](_0x458a3a[_0x6d60('0x4f')])){for(var _0x34e0f2=0x0;_0x34e0f2<_0x458a3a[_0x6d60('0x4f')][_0x6d60('0x3a')];_0x34e0f2+=0x1){_0x458a3a[_0x6d60('0x4f')][_0x34e0f2][_0x6d60('0x5e')]=_0x458a3a[_0x6d60('0x49')]['id'];_0x365a74[_0x6d60('0x66')](_0x458a3a[_0x6d60('0x4f')][_0x34e0f2]);}return BPromise[_0x6d60('0x67')](_0x365a74,function(_0x317d9f){return db['CmContact'][_0x6d60('0x4e')](_[_0x6d60('0x68')](_0x317d9f,[_0x6d60('0x60'),'id'])||{},{'fields':_[_0x6d60('0x5b')](_0xc52f8),'raw':!![]})['then'](function(_0x3c96c8){_0x1a4520[_0x6d60('0x69')][_0x6d60('0x66')](_0x3c96c8[_0x6d60('0x6a')]);})['catch'](function(_0x2fc388){_0x1a4520[_0x6d60('0x6b')]['push']({'data':_0x317d9f,'error':_0x2fc388['message']});});})['then'](function(_0x24c21c){return _0x1a4520;})[_0x6d60('0x47')](function(_0x495d6b){return _0x495d6b;});}else{_0x48ee16[_0x6d60('0x1d')](0x190)[_0x6d60('0x1f')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6d60('0x29')](respondWithResult(_0x48ee16,null))[_0x6d60('0x47')](handleError(_0x48ee16,null));};exports[_0x6d60('0x6c')]=function(_0x71216a,_0x2d83aa,_0xb6bf3c){var _0x5f189b;return db[_0x6d60('0x32')]['find']({'where':{'id':_0x71216a[_0x6d60('0x49')]['id']},'include':[{'model':db[_0x6d60('0x6d')],'as':_0x6d60('0x6e')}]})['then'](handleEntityNotFound(_0x2d83aa,null))['then'](function(_0x4a7037){if(_0x4a7037){_0x5f189b=_0x4a7037;return db[_0x6d60('0x62')][_0x6d60('0x4a')];}})[_0x6d60('0x29')](function(_0x4f913b){if(_0x4f913b){var _0x435ab8={};var _0x581dc7={};_0x581dc7['model']=_['concat'](_['keys'](_0x4f913b),_[_0x6d60('0x42')](_0x5f189b[_0x6d60('0x6e')],function(_0x26291){return util[_0x6d60('0x6f')](_0x6d60('0x70'),_0x26291['id']);}));_0x581dc7['query']=_[_0x6d60('0x5b')](_0x71216a[_0x6d60('0x36')]);_0x581dc7[_0x6d60('0x3f')]=_['intersection'](_0x581dc7['model'],_0x581dc7['query']);_0x435ab8[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x581dc7[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x71216a['query'][_0x6d60('0x38')]));_0x435ab8[_0x6d60('0x39')]=_0x435ab8[_0x6d60('0x39')]['length']?_0x435ab8[_0x6d60('0x39')]:_0x581dc7[_0x6d60('0x35')];if(!_0x71216a[_0x6d60('0x36')][_0x6d60('0x3b')](_0x6d60('0x5d'))){_0x435ab8[_0x6d60('0x21')]=qs[_0x6d60('0x21')](_0x71216a[_0x6d60('0x36')][_0x6d60('0x21')]);_0x435ab8[_0x6d60('0x20')]=qs[_0x6d60('0x20')](_0x71216a[_0x6d60('0x36')][_0x6d60('0x20')]);}_0x435ab8['order']=qs[_0x6d60('0x3d')](_0x71216a['query'][_0x6d60('0x3d')]);_0x435ab8[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x71216a['query'],_0x581dc7[_0x6d60('0x3f')]));_0x435ab8['raw']=!![];if(_0x71216a['query']['filter']){_0x435ab8[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x435ab8[_0x6d60('0x3e')],{'$or':_['map'](_0x435ab8[_0x6d60('0x39')],function(_0x237b17){var _0x33e8ec={};_0x33e8ec[_0x237b17]={'$like':'%'+_0x71216a[_0x6d60('0x36')]['filter']+'%'};return _0x33e8ec;})});}_0x435ab8=_[_0x6d60('0x4c')]({},_0x435ab8,_0x71216a[_0x6d60('0x43')]);return _0x5f189b['getContacts'](_0x435ab8);}})['then'](respondWithResult(_0x2d83aa,null))['catch'](handleError(_0x2d83aa,null));};exports[_0x6d60('0x71')]=function(_0x5b56c0,_0x4164d1,_0x4916ef){var _0x1c3452;var _0x1f4b5d;var _0x4c0822;var _0x5c5a27=_0x5b56c0[_0x6d60('0x49')]['id'];csv_results=[];return db['ContactItemType'][_0x6d60('0x45')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x6d60('0x29')](function(_0xd54dab){_0x1c3452=_0xd54dab;var _0x39926c=_[_0x6d60('0x5b')](db[_0x6d60('0x62')][_0x6d60('0x4a')]);return db[_0x6d60('0x6d')][_0x6d60('0x45')]({'raw':!![],'attributes':['id',_0x6d60('0x72')]})['then'](function(_0x35fa82){_0x1f4b5d=_0x35fa82;var _0x3c4b57=squel[_0x6d60('0x73')]()[_0x6d60('0x38')](_0x39926c)[_0x6d60('0x74')](_0x6d60('0x75'),'c')[_0x6d60('0x3e')](_0x6d60('0x76'),_0x5c5a27)['where'](_0x6d60('0x77'))[_0x6d60('0x78')]();for(var _0x290110=0x0;_0x290110<_0x1f4b5d['length'];_0x290110++){_0x3c4b57[_0x6d60('0x79')](_0x6d60('0x7a')+_0x1f4b5d[_0x290110]['id'],_0x6d60('0x7b')+_0x1f4b5d[_0x290110][_0x6d60('0x72')]);}for(var _0x290110=0x0;_0x290110<_0x1c3452[_0x6d60('0x3a')];_0x290110++){_0x3c4b57[_0x6d60('0x79')](squel['select']()[_0x6d60('0x79')](_0x6d60('0x7c'))[_0x6d60('0x74')](_0x6d60('0x7d'))[_0x6d60('0x3e')](_0x6d60('0x7e'),_0x1c3452[_0x290110]['id'])[_0x6d60('0x3e')](_0x6d60('0x7f')),_0x6d60('0x80')+_0x1c3452[_0x290110][_0x6d60('0x2f')]);_0x3c4b57[_0x6d60('0x79')](squel[_0x6d60('0x73')]()[_0x6d60('0x79')](_0x6d60('0x81'))[_0x6d60('0x74')]('cm_contact_has_items')[_0x6d60('0x3e')]('ItemTypeId\x20=\x20?',_0x1c3452[_0x290110]['id'])[_0x6d60('0x3e')](_0x6d60('0x7f')),_0x6d60('0x82')+_0x1c3452[_0x290110][_0x6d60('0x2f')]);}var _0x2a0b33=[];_0x2a0b33[_0x6d60('0x66')](_0x3c4b57[_0x6d60('0x83')]());BPromise[_0x6d60('0x67')](_0x2a0b33,handleQuery)[_0x6d60('0x29')](function(_0x47fa90){handleQuery(_0x3c4b57['toString']());var _0x3d3823=csv_results[0x0];if(!_[_0x6d60('0x84')](_0x3d3823)){var _0x464068=toCsv(_0x3d3823);var _0x35eb5b=Date[_0x6d60('0x85')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x5c5a27,_0x35eb5b),_0x464068);_0x4164d1[_0x6d60('0x86')](_0x6d60('0x87'),_0x6d60('0x88')+util[_0x6d60('0x6f')]('list_%d_%s.csv',_0x5c5a27,_0x35eb5b));_0x4164d1[_0x6d60('0x86')](_0x6d60('0x89'),'text/csv');return _0x4164d1[_0x6d60('0x8a')](util['format']('/tmp/list_%d_%s.csv',_0x5c5a27,_0x35eb5b));}else{return _0x4164d1[_0x6d60('0x2c')](0xcc);}});});});};exports[_0x6d60('0x8b')]=function(_0x1d4284,_0x490419,_0x4d53c5){var _0x46f18b;delete _0x1d4284['body']['id'];return db[_0x6d60('0x32')]['findOne']({'where':{'id':_0x1d4284['params']['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x490419,null))[_0x6d60('0x29')](function(_0x412b05){if(_0x412b05){return db[_0x6d60('0x8c')]['transaction'](function(_0x342914){return db[_0x6d60('0x6d')][_0x6d60('0x4e')](_0x1d4284[_0x6d60('0x4f')],{'transaction':_0x342914})[_0x6d60('0x29')](function(_0x108c2c){_0x46f18b=_0x108c2c;return _0x412b05[_0x6d60('0x8d')](_0x108c2c,{'transaction':_0x342914});})['then'](function(){var _0x4768da={'type':db[_0x6d60('0x8e')]['TEXT'],'transaction':_0x342914};switch(_0x1d4284[_0x6d60('0x4f')][_0x6d60('0x34')]){case _0x6d60('0x8f'):_0x4768da[_0x6d60('0x34')]=db[_0x6d60('0x8e')][_0x6d60('0x90')];break;case _0x6d60('0x91'):_0x4768da['type']=db[_0x6d60('0x8e')]['INTEGER'];break;case'switch':_0x4768da[_0x6d60('0x34')]=db['Sequelize'][_0x6d60('0x92')];_0x4768da[_0x6d60('0x93')]=![];break;default:}return db[_0x6d60('0x8c')][_0x6d60('0x94')][_0x6d60('0x95')]('cm_contacts',util[_0x6d60('0x6f')](_0x6d60('0x96'),_0x46f18b['id']),_0x4768da);})[_0x6d60('0x29')](function(){return _0x46f18b;});});}})[_0x6d60('0x29')](respondWithResult(_0x490419,null))[_0x6d60('0x47')](handleError(_0x490419,null));};exports[_0x6d60('0x97')]=function(_0x18b8e9,_0x41d96a,_0x193f63){var _0x416ee9={};var _0x316a78={};var _0xe97026;var _0x3b310f;return db['CmList'][_0x6d60('0x5a')]({'where':{'id':_0x18b8e9[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x41d96a,null))[_0x6d60('0x29')](function(_0x49d7e4){if(_0x49d7e4){_0xe97026=_0x49d7e4;_0x316a78[_0x6d60('0x35')]=_['keys'](db[_0x6d60('0x6d')][_0x6d60('0x4a')]);_0x316a78[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x18b8e9[_0x6d60('0x36')]);_0x316a78['filters']=_[_0x6d60('0x37')](_0x316a78[_0x6d60('0x35')],_0x316a78[_0x6d60('0x36')]);_0x416ee9[_0x6d60('0x39')]=_[_0x6d60('0x37')](_0x316a78[_0x6d60('0x35')],qs[_0x6d60('0x38')](_0x18b8e9['query'][_0x6d60('0x38')]));_0x416ee9[_0x6d60('0x39')]=_0x416ee9['attributes'][_0x6d60('0x3a')]?_0x416ee9['attributes']:_0x316a78[_0x6d60('0x35')];_0x416ee9[_0x6d60('0x3c')]=qs[_0x6d60('0x3d')](_0x18b8e9[_0x6d60('0x36')][_0x6d60('0x3d')]);_0x416ee9[_0x6d60('0x3e')]=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x18b8e9[_0x6d60('0x36')],_0x316a78[_0x6d60('0x3f')]));_0x416ee9[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x416ee9['where'],{'$or':[{'ListId':_0x49d7e4['id']},{'ListId':null}]});if(_0x18b8e9[_0x6d60('0x36')]['filter']){_0x416ee9[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x416ee9['where'],{'$or':_['map'](_0x416ee9[_0x6d60('0x39')],function(_0x16a47d){var _0x59ca9e={};_0x59ca9e[_0x16a47d]={'$like':'%'+_0x18b8e9[_0x6d60('0x36')]['filter']+'%'};return _0x59ca9e;})});}_0x416ee9=_[_0x6d60('0x4c')]({},_0x416ee9,_0x18b8e9['options']);return db[_0x6d60('0x6d')][_0x6d60('0x98')](_0x416ee9);}})[_0x6d60('0x29')](respondWithResult(_0x41d96a,null))['catch'](handleError(_0x41d96a,null));};exports['getGlobalCustomFields']=function(_0x406558,_0x100522){return db[_0x6d60('0x6d')][_0x6d60('0x98')]({'where':{'ListId':null}})[_0x6d60('0x29')](handleEntityNotFound(_0x100522,null))['then'](function(_0x3c57c3){return _0x3c57c3;})[_0x6d60('0x29')](respondWithResult(_0x100522,null))[_0x6d60('0x47')](handleError(_0x100522,null));};exports[_0x6d60('0x99')]=function(_0x332b36,_0x175277,_0x315307){return db['CmList'][_0x6d60('0x4d')]({'where':{'id':_0x332b36[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x175277,null))[_0x6d60('0x29')](function(_0x2f2055){if(_0x2f2055){return _0x2f2055[_0x6d60('0x99')](_0x332b36['body'][_0x6d60('0x60')],_['omit'](_0x332b36[_0x6d60('0x4f')],[_0x6d60('0x60'),'id'])||{})[_0x6d60('0x9a')](function(_0x5e58bf){for(var _0x4d8262=0x0;_0x4d8262<_0x332b36[_0x6d60('0x4f')][_0x6d60('0x60')][_0x6d60('0x3a')];_0x4d8262+=0x1){socket[_0x6d60('0x9b')](_0x6d60('0x9c'),{'UserId':Number(_0x332b36[_0x6d60('0x4f')][_0x6d60('0x60')][_0x4d8262]),'CmListId':Number(_0x332b36[_0x6d60('0x49')]['id'])});}return _0x5e58bf;});}})['then'](respondWithResult(_0x175277,null))[_0x6d60('0x47')](handleError(_0x175277,null));};exports[_0x6d60('0x9d')]=function(_0x3e69ad,_0x34ae31,_0x82d88b){return db['CmList'][_0x6d60('0x4d')]({'where':{'id':_0x3e69ad[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x34ae31,null))[_0x6d60('0x29')](function(_0xdf8e69){if(_0xdf8e69){return _0xdf8e69[_0x6d60('0x9d')](_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')])[_0x6d60('0x29')](function(){if(_[_0x6d60('0x65')](_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')])){for(var _0x4dc7a9=0x0;_0x4dc7a9<_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')][_0x6d60('0x3a')];_0x4dc7a9+=0x1){socket[_0x6d60('0x9b')](_0x6d60('0x9e'),{'UserId':Number(_0x3e69ad['query'][_0x6d60('0x60')][_0x4dc7a9]),'CmListId':Number(_0x3e69ad[_0x6d60('0x49')]['id'])});}}else{socket['emit'](_0x6d60('0x9e'),{'UserId':Number(_0x3e69ad[_0x6d60('0x36')][_0x6d60('0x60')]),'CmListId':Number(_0x3e69ad[_0x6d60('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x34ae31,null))[_0x6d60('0x47')](handleError(_0x34ae31,null));};exports['getAgents']=function(_0x5e8499,_0x45ca62,_0x28407a){var _0x48841f={};var _0x53bcb9={};var _0x2fbf0f;var _0x5eda3f;return db[_0x6d60('0x32')][_0x6d60('0x5a')]({'where':{'id':_0x5e8499[_0x6d60('0x49')]['id']}})[_0x6d60('0x29')](handleEntityNotFound(_0x45ca62,null))[_0x6d60('0x29')](function(_0x43b44c){if(_0x43b44c){_0x2fbf0f=_0x43b44c;_0x53bcb9['model']=_['keys'](db['User'][_0x6d60('0x4a')]);_0x53bcb9[_0x6d60('0x36')]=_[_0x6d60('0x5b')](_0x5e8499['query']);_0x53bcb9[_0x6d60('0x3f')]=_[_0x6d60('0x37')](_0x53bcb9[_0x6d60('0x35')],_0x53bcb9[_0x6d60('0x36')]);_0x48841f['attributes']=_[_0x6d60('0x37')](_0x53bcb9[_0x6d60('0x35')],qs['fields'](_0x5e8499[_0x6d60('0x36')]['fields']));_0x48841f[_0x6d60('0x39')]=_0x48841f[_0x6d60('0x39')][_0x6d60('0x3a')]?_0x48841f[_0x6d60('0x39')]:_0x53bcb9['model'];_0x48841f[_0x6d60('0x3c')]=qs['sort'](_0x5e8499['query'][_0x6d60('0x3d')]);_0x48841f['where']=qs[_0x6d60('0x3f')](_[_0x6d60('0x40')](_0x5e8499[_0x6d60('0x36')],_0x53bcb9[_0x6d60('0x3f')]));if(_0x5e8499[_0x6d60('0x36')]['filter']){_0x48841f[_0x6d60('0x3e')]=_[_0x6d60('0x4c')](_0x48841f[_0x6d60('0x3e')],{'$or':_[_0x6d60('0x42')](_0x48841f['attributes'],function(_0x34605e){var _0x10b914={};_0x10b914[_0x34605e]={'$like':'%'+_0x5e8499[_0x6d60('0x36')][_0x6d60('0x41')]+'%'};return _0x10b914;})});}_0x48841f=_[_0x6d60('0x4c')]({},_0x48841f,_0x5e8499[_0x6d60('0x43')]);return _0x2fbf0f[_0x6d60('0x9f')](_0x48841f);}})['then'](function(_0xa6639){if(_0xa6639){_0x5eda3f=_0xa6639[_0x6d60('0x3a')];if(!_0x5e8499[_0x6d60('0x36')][_0x6d60('0x3b')](_0x6d60('0x5d'))){_0x48841f[_0x6d60('0x21')]=qs[_0x6d60('0x21')](_0x5e8499['query'][_0x6d60('0x21')]);_0x48841f[_0x6d60('0x20')]=qs[_0x6d60('0x20')](_0x5e8499['query'][_0x6d60('0x20')]);}return _0x2fbf0f['getAgents'](_0x48841f);}})[_0x6d60('0x29')](function(_0x303e9b){if(_0x303e9b){return _0x303e9b?{'count':_0x5eda3f,'rows':_0x303e9b}:null;}})[_0x6d60('0x29')](respondWithResult(_0x45ca62,null))[_0x6d60('0x47')](handleError(_0x45ca62,null));};function handleQuery(_0x972124){logger[_0x6d60('0xa0')](_0x972124);return db[_0x6d60('0x8c')][_0x6d60('0x36')](_0x972124)[_0x6d60('0x9a')](function(_0x1e7f99){csv_results['push'](_0x1e7f99);})['catch'](function(_0x53a1b3){logger[_0x6d60('0x2d')](_0x53a1b3[_0x6d60('0xa1')]);});} \ No newline at end of file +var _0xf01f=['text','INTEGER','switch','BOOLEAN','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmList','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','removeDispositions','ids','CmContact','isArray','tags','join','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','download','sequelize','transaction','Sequelize','TEXT'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf01f,0xaf));var _0xff01=function(_0x490461,_0x5e46d3){_0x490461=_0x490461-0x0;var _0x3d2344=_0xf01f[_0x490461];return _0x3d2344;};'use strict';var emlformat=require(_0xff01('0x0'));var rimraf=require(_0xff01('0x1'));var zipdir=require(_0xff01('0x2'));var jsonpatch=require(_0xff01('0x3'));var rp=require(_0xff01('0x4'));var moment=require(_0xff01('0x5'));var BPromise=require(_0xff01('0x6'));var Mustache=require('mustache');var util=require(_0xff01('0x7'));var path=require(_0xff01('0x8'));var sox=require(_0xff01('0x9'));var csv=require(_0xff01('0xa'));var ejs=require(_0xff01('0xb'));var fs=require('fs');var fs_extra=require(_0xff01('0xc'));var _=require('lodash');var squel=require(_0xff01('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff01('0xe'));var toCsv=require(_0xff01('0xa'));var querystring=require(_0xff01('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xff01('0x10'));var qs=require(_0xff01('0x11'));var as=require(_0xff01('0x12'));var hardwareService=require(_0xff01('0x13'));var logger=require(_0xff01('0x14'))(_0xff01('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff01('0x16'))['db'];var csv_results;config[_0xff01('0x17')]=_[_0xff01('0x18')](config[_0xff01('0x17')],{'host':_0xff01('0x19'),'port':0x18eb});var socket=require(_0xff01('0x1a'))(new Redis(config[_0xff01('0x17')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x2790ef,_0x1e6197){_0x1e6197=_0x1e6197||0xcc;return function(_0xbbf3c6){if(_0xbbf3c6){return _0x2790ef[_0xff01('0x1b')](_0x1e6197);}return _0x2790ef[_0xff01('0x1c')](_0x1e6197)[_0xff01('0x1d')]();};}function respondWithResult(_0x305e7f,_0x49a414){_0x49a414=_0x49a414||0xc8;return function(_0x508a3d){if(_0x508a3d){return _0x305e7f[_0xff01('0x1c')](_0x49a414)[_0xff01('0x1e')](_0x508a3d);}};}function respondWithFilteredResult(_0xf3ed88,_0x6331f9){return function(_0xa097b1){if(_0xa097b1){var _0x1fb1f3=typeof _0x6331f9[_0xff01('0x1f')]===_0xff01('0x20')&&typeof _0x6331f9[_0xff01('0x21')]===_0xff01('0x20');var _0x264dfb=_0xa097b1[_0xff01('0x22')];var _0x535e16=_0x1fb1f3?0x0:_0x6331f9['offset'];var _0x214b42=_0x1fb1f3?_0xa097b1['count']:_0x6331f9['offset']+_0x6331f9[_0xff01('0x21')];var _0x543d61;if(_0x214b42>=_0x264dfb){_0x214b42=_0x264dfb;_0x543d61=0xc8;}else{_0x543d61=0xce;}_0xf3ed88[_0xff01('0x1c')](_0x543d61);return _0xf3ed88[_0xff01('0x23')](_0xff01('0x24'),_0x535e16+'-'+_0x214b42+'/'+_0x264dfb)[_0xff01('0x1e')](_0xa097b1);}return null;};}function patchUpdates(_0x165f69){return function(_0x3d7936){try{jsonpatch[_0xff01('0x25')](_0x3d7936,_0x165f69,!![]);}catch(_0x2d662d){return BPromise[_0xff01('0x26')](_0x2d662d);}return _0x3d7936[_0xff01('0x27')]();};}function saveUpdates(_0x4e214c,_0x406937){return function(_0x454d30){if(_0x454d30){return _0x454d30[_0xff01('0x28')](_0x4e214c)[_0xff01('0x29')](function(_0x172c80){return _0x172c80;});}return null;};}function removeEntity(_0x2aa989,_0x57be43){return function(_0x54e90c){if(_0x54e90c){return _0x54e90c['destroy']()[_0xff01('0x29')](function(){var _0x1cb507=_0x54e90c[_0xff01('0x2a')]({'plain':!![]});var _0x4e357a='Lists';return db['UserProfileResource'][_0xff01('0x2b')]({'where':{'type':_0x4e357a,'resourceId':_0x1cb507['id']}})['then'](function(){return _0x54e90c;});})['then'](function(){_0x2aa989[_0xff01('0x1c')](0xcc)[_0xff01('0x1d')]();});}};}function handleEntityNotFound(_0x25a95e,_0x105aa5){return function(_0x40c95){if(!_0x40c95){_0x25a95e[_0xff01('0x1b')](0x194);}return _0x40c95;};}function handleError(_0x5d86b5,_0x2fba65){_0x2fba65=_0x2fba65||0x1f4;return function(_0x162f8c){logger[_0xff01('0x2c')](_0x162f8c[_0xff01('0x2d')]);if(_0x162f8c[_0xff01('0x2e')]){delete _0x162f8c[_0xff01('0x2e')];}_0x5d86b5['status'](_0x2fba65)[_0xff01('0x2f')](_0x162f8c);};}exports[_0xff01('0x30')]=function(_0x292174,_0x167f7a){var _0x1ca21d={},_0x553d63={},_0x4bfc3b={'count':0x0,'rows':[]};var _0x21ed16=_[_0xff01('0x31')](db['CmList'][_0xff01('0x32')],function(_0x3f4442){return{'name':_0x3f4442[_0xff01('0x33')],'type':_0x3f4442[_0xff01('0x34')][_0xff01('0x35')]};});_0x553d63[_0xff01('0x36')]=_[_0xff01('0x31')](_0x21ed16,_0xff01('0x2e'));_0x553d63[_0xff01('0x37')]=_[_0xff01('0x38')](_0x292174[_0xff01('0x37')]);_0x553d63[_0xff01('0x39')]=_[_0xff01('0x3a')](_0x553d63[_0xff01('0x36')],_0x553d63[_0xff01('0x37')]);_0x1ca21d[_0xff01('0x3b')]=_['intersection'](_0x553d63[_0xff01('0x36')],qs[_0xff01('0x3c')](_0x292174[_0xff01('0x37')][_0xff01('0x3c')]));_0x1ca21d[_0xff01('0x3b')]=_0x1ca21d[_0xff01('0x3b')][_0xff01('0x3d')]?_0x1ca21d[_0xff01('0x3b')]:_0x553d63[_0xff01('0x36')];if(!_0x292174[_0xff01('0x37')][_0xff01('0x3e')](_0xff01('0x3f'))){_0x1ca21d['limit']=qs[_0xff01('0x21')](_0x292174[_0xff01('0x37')]['limit']);_0x1ca21d[_0xff01('0x1f')]=qs['offset'](_0x292174[_0xff01('0x37')][_0xff01('0x1f')]);}_0x1ca21d['order']=qs[_0xff01('0x40')](_0x292174['query'][_0xff01('0x40')]);_0x1ca21d[_0xff01('0x41')]=qs[_0xff01('0x39')](_[_0xff01('0x42')](_0x292174[_0xff01('0x37')],_0x553d63[_0xff01('0x39')]),_0x21ed16);if(_0x292174[_0xff01('0x37')][_0xff01('0x43')]){_0x1ca21d[_0xff01('0x41')]=_[_0xff01('0x44')](_0x1ca21d[_0xff01('0x41')],{'$or':_[_0xff01('0x31')](_0x21ed16,function(_0x3b5ff0){if(_0x3b5ff0[_0xff01('0x34')]!=='VIRTUAL'){var _0x2abb70={};_0x2abb70[_0x3b5ff0[_0xff01('0x2e')]]={'$like':'%'+_0x292174['query'][_0xff01('0x43')]+'%'};return _0x2abb70;}})});}_0x1ca21d=_[_0xff01('0x44')]({},_0x1ca21d,_0x292174[_0xff01('0x45')]);var _0x6aa319={'where':_0x1ca21d[_0xff01('0x41')]};return db[_0xff01('0x46')]['count'](_0x6aa319)[_0xff01('0x29')](function(_0x44a88a){_0x4bfc3b[_0xff01('0x22')]=_0x44a88a;if(_0x292174[_0xff01('0x37')][_0xff01('0x47')]){_0x1ca21d[_0xff01('0x48')]=[{'all':!![]}];}return db[_0xff01('0x46')][_0xff01('0x49')](_0x1ca21d);})[_0xff01('0x29')](function(_0x24ac85){_0x4bfc3b[_0xff01('0x4a')]=_0x24ac85;return _0x4bfc3b;})[_0xff01('0x29')](respondWithFilteredResult(_0x167f7a,_0x1ca21d))['catch'](handleError(_0x167f7a,null));};exports[_0xff01('0x4b')]=function(_0x34effd,_0x5a874c){var _0x5b5e69={'raw':![],'where':{'id':_0x34effd[_0xff01('0x4c')]['id']}},_0x5ef4c1={};_0x5ef4c1[_0xff01('0x36')]=_[_0xff01('0x38')](db[_0xff01('0x46')][_0xff01('0x32')]);_0x5ef4c1['query']=_[_0xff01('0x38')](_0x34effd[_0xff01('0x37')]);_0x5ef4c1[_0xff01('0x39')]=_[_0xff01('0x3a')](_0x5ef4c1[_0xff01('0x36')],_0x5ef4c1[_0xff01('0x37')]);_0x5b5e69[_0xff01('0x3b')]=_[_0xff01('0x3a')](_0x5ef4c1[_0xff01('0x36')],qs['fields'](_0x34effd[_0xff01('0x37')][_0xff01('0x3c')]));_0x5b5e69[_0xff01('0x3b')]=_0x5b5e69[_0xff01('0x3b')][_0xff01('0x3d')]?_0x5b5e69[_0xff01('0x3b')]:_0x5ef4c1['model'];if(_0x34effd[_0xff01('0x37')][_0xff01('0x47')]){_0x5b5e69[_0xff01('0x48')]=[{'all':!![]}];}_0x5b5e69=_[_0xff01('0x44')]({},_0x5b5e69,_0x34effd['options']);return db[_0xff01('0x46')][_0xff01('0x4d')](_0x5b5e69)[_0xff01('0x29')](handleEntityNotFound(_0x5a874c,null))[_0xff01('0x29')](respondWithResult(_0x5a874c,null))[_0xff01('0x4e')](handleError(_0x5a874c,null));};exports['create']=function(_0x2ee990,_0x4ed81e){return db[_0xff01('0x46')][_0xff01('0x4f')](_0x2ee990[_0xff01('0x50')],{})['then'](function(_0xfa8e70){var _0x246a66=_0x2ee990['user'][_0xff01('0x2a')]({'plain':!![]});if(!_0x246a66)throw new Error(_0xff01('0x51'));if(_0x246a66[_0xff01('0x52')]===_0xff01('0x53')){var _0x6511de=_0xfa8e70[_0xff01('0x2a')]({'plain':!![]});var _0x54cc10=_0xff01('0x54');return db[_0xff01('0x55')][_0xff01('0x4d')]({'where':{'name':_0x54cc10,'userProfileId':_0x246a66[_0xff01('0x56')]},'raw':!![]})['then'](function(_0x1ca065){if(_0x1ca065&&_0x1ca065[_0xff01('0x57')]===0x0){return db[_0xff01('0x58')][_0xff01('0x4f')]({'name':_0x6511de[_0xff01('0x2e')],'resourceId':_0x6511de['id'],'type':_0x1ca065[_0xff01('0x2e')],'sectionId':_0x1ca065['id']},{})[_0xff01('0x29')](function(){return _0xfa8e70;});}else{return _0xfa8e70;}})[_0xff01('0x4e')](function(_0x11c2ea){logger[_0xff01('0x2c')](_0xff01('0x59'),_0x11c2ea);throw _0x11c2ea;});}return _0xfa8e70;})[_0xff01('0x29')](respondWithResult(_0x4ed81e,0xc9))[_0xff01('0x4e')](handleError(_0x4ed81e,null));};exports[_0xff01('0x28')]=function(_0x1451be,_0x2db284){if(_0x1451be[_0xff01('0x50')]['id']){delete _0x1451be[_0xff01('0x50')]['id'];}return db[_0xff01('0x46')]['find']({'where':{'id':_0x1451be['params']['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x2db284,null))[_0xff01('0x29')](saveUpdates(_0x1451be[_0xff01('0x50')],null))['then'](respondWithResult(_0x2db284,null))[_0xff01('0x4e')](handleError(_0x2db284,null));};exports[_0xff01('0x2b')]=function(_0x2c30bf,_0x54fa95){return db[_0xff01('0x46')][_0xff01('0x4d')]({'where':{'id':_0x2c30bf[_0xff01('0x4c')]['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x54fa95,null))[_0xff01('0x29')](removeEntity(_0x54fa95,null))[_0xff01('0x4e')](handleError(_0x54fa95,null));};exports[_0xff01('0x5a')]=function(_0x351d2d,_0x5a0147){return db[_0xff01('0x46')][_0xff01('0x5a')]()['then'](respondWithResult(_0x5a0147,null))['catch'](handleError(_0x5a0147,null));};exports[_0xff01('0x5b')]=function(_0x424753,_0x57c8e4,_0x3f26e4){if(_0x424753[_0xff01('0x50')]['id']){delete _0x424753[_0xff01('0x50')]['id'];}return db[_0xff01('0x46')]['find']({'where':{'id':_0x424753[_0xff01('0x4c')]['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x57c8e4,null))[_0xff01('0x29')](function(_0x556985){if(_0x556985){_0x424753[_0xff01('0x50')][_0xff01('0x5c')]=_0x556985['id'];return db[_0xff01('0x5d')][_0xff01('0x4f')](_0x424753['body']);}})[_0xff01('0x29')](respondWithResult(_0x57c8e4,null))[_0xff01('0x4e')](handleError(_0x57c8e4,null));};exports[_0xff01('0x5e')]=function(_0x13804d,_0x2b151,_0x138634){var _0x386d14={'raw':![],'where':{}};var _0xbb61e5={};var _0x58f035={'count':0x0,'rows':[]};return db[_0xff01('0x46')][_0xff01('0x5f')]({'where':{'id':_0x13804d[_0xff01('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b151,null))['then'](function(_0x53dacb){if(_0x53dacb){_0xbb61e5['model']=_[_0xff01('0x38')](db[_0xff01('0x5d')][_0xff01('0x32')]);_0xbb61e5[_0xff01('0x37')]=_[_0xff01('0x38')](_0x13804d[_0xff01('0x37')]);_0xbb61e5[_0xff01('0x39')]=_[_0xff01('0x3a')](_0xbb61e5[_0xff01('0x36')],_0xbb61e5[_0xff01('0x37')]);_0x386d14[_0xff01('0x3b')]=_[_0xff01('0x3a')](_0xbb61e5[_0xff01('0x36')],qs[_0xff01('0x3c')](_0x13804d[_0xff01('0x37')][_0xff01('0x3c')]));_0x386d14['attributes']=_0x386d14[_0xff01('0x3b')][_0xff01('0x3d')]?_0x386d14[_0xff01('0x3b')]:_0xbb61e5[_0xff01('0x36')];if(!_0x13804d[_0xff01('0x37')]['hasOwnProperty'](_0xff01('0x3f'))){_0x386d14['limit']=qs[_0xff01('0x21')](_0x13804d['query'][_0xff01('0x21')]);_0x386d14['offset']=qs[_0xff01('0x1f')](_0x13804d[_0xff01('0x37')][_0xff01('0x1f')]);}_0x386d14[_0xff01('0x60')]=qs['sort'](_0x13804d[_0xff01('0x37')][_0xff01('0x40')]);_0x386d14[_0xff01('0x41')]=qs['filters'](_[_0xff01('0x42')](_0x13804d[_0xff01('0x37')],_0xbb61e5['filters']));_0x386d14['where'][_0xff01('0x5c')]=_0x53dacb['id'];if(_0x13804d[_0xff01('0x37')]['filter']){_0x386d14[_0xff01('0x41')]=_[_0xff01('0x44')](_0x386d14[_0xff01('0x41')],{'$or':_[_0xff01('0x31')](_0x386d14[_0xff01('0x3b')],function(_0x441f62){var _0xbfb75a={};_0xbfb75a[_0x441f62]={'$like':'%'+_0x13804d[_0xff01('0x37')][_0xff01('0x43')]+'%'};return _0xbfb75a;})});}_0x386d14=_[_0xff01('0x44')]({},_0x386d14,_0x13804d[_0xff01('0x45')]);return db[_0xff01('0x5d')][_0xff01('0x22')]({'where':_0x386d14[_0xff01('0x41')]})['then'](function(_0x36bba3){_0x58f035[_0xff01('0x22')]=_0x36bba3;if(_0x13804d[_0xff01('0x37')][_0xff01('0x47')]){_0x386d14[_0xff01('0x48')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x386d14);})[_0xff01('0x29')](function(_0x32dc7d){_0x58f035[_0xff01('0x4a')]=_0x32dc7d;return _0x58f035;});}})[_0xff01('0x29')](respondWithFilteredResult(_0x2b151,_0x386d14))['catch'](handleError(_0x2b151,null));};exports[_0xff01('0x61')]=function(_0x1f3a5b,_0x4875eb,_0x6e4730){return db[_0xff01('0x46')][_0xff01('0x4d')]({'where':{'id':_0x1f3a5b[_0xff01('0x4c')]['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x4875eb,null))[_0xff01('0x29')](function(_0x43826e){if(_0x43826e){return _0x43826e[_0xff01('0x61')](_0x1f3a5b[_0xff01('0x37')][_0xff01('0x62')]);}})[_0xff01('0x29')](respondWithStatusCode(_0x4875eb,null))[_0xff01('0x4e')](handleError(_0x4875eb,null));};exports['addContacts']=function(_0x1ca898,_0x36b466,_0xa7a9ed){return db[_0xff01('0x46')][_0xff01('0x4d')]({'where':{'id':_0x1ca898[_0xff01('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36b466,null))[_0xff01('0x29')](function(_0x101691){if(_0x101691){var _0xf0978c=[];var _0x5b525f={'success':[],'errors':[]};return db[_0xff01('0x63')][_0xff01('0x5a')]()[_0xff01('0x29')](function(_0x34726a){if(_0x1ca898[_0xff01('0x50')]['tags']&&_[_0xff01('0x64')](_0x1ca898[_0xff01('0x50')][_0xff01('0x65')])){if(_0x1ca898[_0xff01('0x50')][_0xff01('0x65')][_0xff01('0x3d')]){_0x1ca898[_0xff01('0x50')]['tags']=_0x1ca898[_0xff01('0x50')][_0xff01('0x65')][_0xff01('0x66')](';')+';';}else{_0x1ca898[_0xff01('0x50')][_0xff01('0x65')]=null;}}else{_0x1ca898[_0xff01('0x50')]['tags']=null;}if(_0x1ca898[_0xff01('0x50')]&&_[_0xff01('0x64')](_0x1ca898[_0xff01('0x50')])){for(var _0x195c54=0x0;_0x195c54<_0x1ca898['body'][_0xff01('0x3d')];_0x195c54+=0x1){_0x1ca898[_0xff01('0x50')][_0x195c54]['ListId']=_0x1ca898[_0xff01('0x4c')]['id'];_0xf0978c['push'](_0x1ca898[_0xff01('0x50')][_0x195c54]);}return BPromise[_0xff01('0x67')](_0xf0978c,function(_0x436ab8){return db[_0xff01('0x63')][_0xff01('0x4f')](_[_0xff01('0x68')](_0x436ab8,[_0xff01('0x62'),'id'])||{},{'fields':_[_0xff01('0x38')](_0x34726a),'raw':!![]})[_0xff01('0x29')](function(_0x238e2a){_0x5b525f[_0xff01('0x69')][_0xff01('0x6a')](_0x238e2a[_0xff01('0x6b')]);})[_0xff01('0x4e')](function(_0x1ab52a){_0x5b525f['errors'][_0xff01('0x6a')]({'data':_0x436ab8,'error':_0x1ab52a[_0xff01('0x6c')]});});})[_0xff01('0x29')](function(_0x5b9616){return _0x5b525f;})[_0xff01('0x4e')](function(_0x46ac31){return _0x46ac31;});}else{_0x36b466[_0xff01('0x1c')](0x190)[_0xff01('0x1e')]({'message':_0xff01('0x6d')});}});}})[_0xff01('0x29')](respondWithResult(_0x36b466,null))['catch'](handleError(_0x36b466,null));};exports[_0xff01('0x6e')]=function(_0x36b372,_0x23c90d,_0x901db0){var _0x1bdab9;return db[_0xff01('0x46')][_0xff01('0x4d')]({'where':{'id':_0x36b372[_0xff01('0x4c')]['id']},'include':[{'model':db[_0xff01('0x6f')],'as':'CustomFields'}]})[_0xff01('0x29')](handleEntityNotFound(_0x23c90d,null))[_0xff01('0x29')](function(_0x4cee28){if(_0x4cee28){_0x1bdab9=_0x4cee28;return db[_0xff01('0x63')][_0xff01('0x32')];}})[_0xff01('0x29')](function(_0x26474f){if(_0x26474f){var _0x2d30fd={};var _0x3c75a5={};_0x3c75a5[_0xff01('0x36')]=_[_0xff01('0x70')](_[_0xff01('0x38')](_0x26474f),_[_0xff01('0x31')](_0x1bdab9[_0xff01('0x71')],function(_0x58ea69){return util[_0xff01('0x72')](_0xff01('0x73'),_0x58ea69['id']);}));_0x3c75a5[_0xff01('0x37')]=_[_0xff01('0x38')](_0x36b372[_0xff01('0x37')]);_0x3c75a5[_0xff01('0x39')]=_[_0xff01('0x3a')](_0x3c75a5[_0xff01('0x36')],_0x3c75a5[_0xff01('0x37')]);_0x2d30fd[_0xff01('0x3b')]=_[_0xff01('0x3a')](_0x3c75a5[_0xff01('0x36')],qs[_0xff01('0x3c')](_0x36b372[_0xff01('0x37')][_0xff01('0x3c')]));_0x2d30fd[_0xff01('0x3b')]=_0x2d30fd[_0xff01('0x3b')][_0xff01('0x3d')]?_0x2d30fd['attributes']:_0x3c75a5[_0xff01('0x36')];if(!_0x36b372[_0xff01('0x37')]['hasOwnProperty'](_0xff01('0x3f'))){_0x2d30fd[_0xff01('0x21')]=qs[_0xff01('0x21')](_0x36b372[_0xff01('0x37')][_0xff01('0x21')]);_0x2d30fd['offset']=qs[_0xff01('0x1f')](_0x36b372[_0xff01('0x37')][_0xff01('0x1f')]);}_0x2d30fd['order']=qs[_0xff01('0x40')](_0x36b372[_0xff01('0x37')][_0xff01('0x40')]);_0x2d30fd[_0xff01('0x41')]=qs[_0xff01('0x39')](_[_0xff01('0x42')](_0x36b372[_0xff01('0x37')],_0x3c75a5[_0xff01('0x39')]));_0x2d30fd['raw']=!![];if(_0x36b372[_0xff01('0x37')][_0xff01('0x43')]){_0x2d30fd[_0xff01('0x41')]=_[_0xff01('0x44')](_0x2d30fd['where'],{'$or':_[_0xff01('0x31')](_0x2d30fd[_0xff01('0x3b')],function(_0x1da014){var _0x65cff4={};_0x65cff4[_0x1da014]={'$like':'%'+_0x36b372[_0xff01('0x37')][_0xff01('0x43')]+'%'};return _0x65cff4;})});}_0x2d30fd=_[_0xff01('0x44')]({},_0x2d30fd,_0x36b372[_0xff01('0x45')]);return _0x1bdab9[_0xff01('0x6e')](_0x2d30fd);}})[_0xff01('0x29')](respondWithResult(_0x23c90d,null))['catch'](handleError(_0x23c90d,null));};exports['getContactsCsv']=function(_0x8677db,_0x1f6dbe,_0x364273){var _0xcb493;var _0xf56033;var _0x4c478d;var _0x1273cb=_0x8677db['params']['id'];csv_results=[];return db['ContactItemType'][_0xff01('0x49')]({'attributes':['id','name'],'raw':!![],'order':[_0xff01('0x74')]})['then'](function(_0x1b5371){_0xcb493=_0x1b5371;var _0xac3d0=_[_0xff01('0x38')](db[_0xff01('0x63')][_0xff01('0x32')]);return db[_0xff01('0x6f')]['findAll']({'raw':!![],'attributes':['id',_0xff01('0x75')]})[_0xff01('0x29')](function(_0x5766b5){_0xf56033=_0x5766b5;var _0x4484ad=squel[_0xff01('0x76')]()['fields'](_0xac3d0)[_0xff01('0x77')](_0xff01('0x78'),'c')[_0xff01('0x41')](_0xff01('0x79'),_0x1273cb)[_0xff01('0x41')](_0xff01('0x7a'))[_0xff01('0x7b')]();for(var _0x37878e=0x0;_0x37878e<_0xf56033[_0xff01('0x3d')];_0x37878e++){_0x4484ad[_0xff01('0x7c')](_0xff01('0x7d')+_0xf56033[_0x37878e]['id'],_0xff01('0x7e')+_0xf56033[_0x37878e][_0xff01('0x75')]);}for(var _0x37878e=0x0;_0x37878e<_0xcb493[_0xff01('0x3d')];_0x37878e++){_0x4484ad[_0xff01('0x7c')](squel['select']()[_0xff01('0x7c')]('item')['from'](_0xff01('0x7f'))[_0xff01('0x41')]('ItemTypeId\x20=\x20?',_0xcb493[_0x37878e]['id'])['where'](_0xff01('0x80')),_0xff01('0x81')+_0xcb493[_0x37878e][_0xff01('0x2e')]);_0x4484ad[_0xff01('0x7c')](squel[_0xff01('0x76')]()[_0xff01('0x7c')](_0xff01('0x82'))[_0xff01('0x77')]('cm_contact_has_items')['where'](_0xff01('0x83'),_0xcb493[_0x37878e]['id'])[_0xff01('0x41')](_0xff01('0x80')),_0xff01('0x84')+_0xcb493[_0x37878e]['name']);}var _0x2a1734=[];_0x2a1734[_0xff01('0x6a')](_0x4484ad[_0xff01('0x85')]());BPromise['each'](_0x2a1734,handleQuery)[_0xff01('0x29')](function(_0x924a4a){handleQuery(_0x4484ad[_0xff01('0x85')]());var _0x356e8f=csv_results[0x0];if(!_['isEmpty'](_0x356e8f)){var _0x527a20=toCsv(_0x356e8f);var _0x5c1db4=Date[_0xff01('0x86')]();fs[_0xff01('0x87')](util[_0xff01('0x72')](_0xff01('0x88'),_0x1273cb,_0x5c1db4),_0x527a20);_0x1f6dbe[_0xff01('0x89')]('Content-disposition','attachment;\x20filename='+util[_0xff01('0x72')](_0xff01('0x8a'),_0x1273cb,_0x5c1db4));_0x1f6dbe[_0xff01('0x89')](_0xff01('0x8b'),'text/csv');return _0x1f6dbe[_0xff01('0x8c')](util[_0xff01('0x72')](_0xff01('0x88'),_0x1273cb,_0x5c1db4));}else{return _0x1f6dbe[_0xff01('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x3a2735,_0x4cd900,_0x16e5fe){var _0xea8c37;delete _0x3a2735[_0xff01('0x50')]['id'];return db['CmList'][_0xff01('0x5f')]({'where':{'id':_0x3a2735[_0xff01('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4cd900,null))['then'](function(_0x9adade){if(_0x9adade){return db[_0xff01('0x8d')][_0xff01('0x8e')](function(_0x50a25f){return db[_0xff01('0x6f')][_0xff01('0x4f')](_0x3a2735['body'],{'transaction':_0x50a25f})['then'](function(_0x43ad7d){_0xea8c37=_0x43ad7d;return _0x9adade['addCustomFields'](_0x43ad7d,{'transaction':_0x50a25f});})['then'](function(){var _0x56c4aa={'type':db[_0xff01('0x8f')][_0xff01('0x90')],'transaction':_0x50a25f};switch(_0x3a2735[_0xff01('0x50')]['type']){case _0xff01('0x91'):_0x56c4aa[_0xff01('0x34')]=db['Sequelize'][_0xff01('0x90')];break;case'number':_0x56c4aa[_0xff01('0x34')]=db[_0xff01('0x8f')][_0xff01('0x92')];break;case _0xff01('0x93'):_0x56c4aa['type']=db[_0xff01('0x8f')][_0xff01('0x94')];_0x56c4aa['defaultValue']=![];break;default:}return db[_0xff01('0x8d')]['queryInterface'][_0xff01('0x95')]('cm_contacts',util[_0xff01('0x72')](_0xff01('0x96'),_0xea8c37['id']),_0x56c4aa);})[_0xff01('0x29')](function(){return _0xea8c37;});});}})[_0xff01('0x29')](respondWithResult(_0x4cd900,null))[_0xff01('0x4e')](handleError(_0x4cd900,null));};exports['getCustomFields']=function(_0x764c51,_0x177efe,_0x124171){var _0x42a6e6={};var _0x19c341={};var _0x3bfbc5;var _0x28495e;return db['CmList'][_0xff01('0x5f')]({'where':{'id':_0x764c51['params']['id']}})['then'](handleEntityNotFound(_0x177efe,null))[_0xff01('0x29')](function(_0x3b8689){if(_0x3b8689){_0x3bfbc5=_0x3b8689;_0x19c341[_0xff01('0x36')]=_[_0xff01('0x38')](db[_0xff01('0x6f')][_0xff01('0x32')]);_0x19c341[_0xff01('0x37')]=_[_0xff01('0x38')](_0x764c51[_0xff01('0x37')]);_0x19c341[_0xff01('0x39')]=_[_0xff01('0x3a')](_0x19c341[_0xff01('0x36')],_0x19c341['query']);_0x42a6e6[_0xff01('0x3b')]=_[_0xff01('0x3a')](_0x19c341['model'],qs[_0xff01('0x3c')](_0x764c51[_0xff01('0x37')]['fields']));_0x42a6e6[_0xff01('0x3b')]=_0x42a6e6[_0xff01('0x3b')][_0xff01('0x3d')]?_0x42a6e6[_0xff01('0x3b')]:_0x19c341[_0xff01('0x36')];_0x42a6e6[_0xff01('0x60')]=qs[_0xff01('0x40')](_0x764c51[_0xff01('0x37')][_0xff01('0x40')]);_0x42a6e6[_0xff01('0x41')]=qs[_0xff01('0x39')](_[_0xff01('0x42')](_0x764c51[_0xff01('0x37')],_0x19c341['filters']));_0x42a6e6[_0xff01('0x41')]=_[_0xff01('0x44')](_0x42a6e6['where'],{'$or':[{'ListId':_0x3b8689['id']},{'ListId':null}]});if(_0x764c51[_0xff01('0x37')][_0xff01('0x43')]){_0x42a6e6[_0xff01('0x41')]=_[_0xff01('0x44')](_0x42a6e6[_0xff01('0x41')],{'$or':_[_0xff01('0x31')](_0x42a6e6[_0xff01('0x3b')],function(_0x1c79a3){var _0x108977={};_0x108977[_0x1c79a3]={'$like':'%'+_0x764c51['query'][_0xff01('0x43')]+'%'};return _0x108977;})});}_0x42a6e6=_[_0xff01('0x44')]({},_0x42a6e6,_0x764c51[_0xff01('0x45')]);return db[_0xff01('0x6f')][_0xff01('0x97')](_0x42a6e6);}})['then'](respondWithResult(_0x177efe,null))['catch'](handleError(_0x177efe,null));};exports[_0xff01('0x98')]=function(_0x128f6a,_0x337b16){return db['CmCustomField'][_0xff01('0x97')]({'where':{'ListId':null}})[_0xff01('0x29')](handleEntityNotFound(_0x337b16,null))[_0xff01('0x29')](function(_0x15d56e){return _0x15d56e;})[_0xff01('0x29')](respondWithResult(_0x337b16,null))[_0xff01('0x4e')](handleError(_0x337b16,null));};exports[_0xff01('0x99')]=function(_0x1c594c,_0x134afc,_0x22ba59){return db[_0xff01('0x46')]['find']({'where':{'id':_0x1c594c[_0xff01('0x4c')]['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x134afc,null))['then'](function(_0x470630){if(_0x470630){return _0x470630[_0xff01('0x99')](_0x1c594c[_0xff01('0x50')][_0xff01('0x62')],_[_0xff01('0x68')](_0x1c594c[_0xff01('0x50')],[_0xff01('0x62'),'id'])||{})[_0xff01('0x9a')](function(_0x5f30be){for(var _0x95b4af=0x0;_0x95b4af<_0x1c594c['body']['ids']['length'];_0x95b4af+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x1c594c[_0xff01('0x50')][_0xff01('0x62')][_0x95b4af]),'CmListId':Number(_0x1c594c[_0xff01('0x4c')]['id'])});}return _0x5f30be;});}})[_0xff01('0x29')](respondWithResult(_0x134afc,null))[_0xff01('0x4e')](handleError(_0x134afc,null));};exports[_0xff01('0x9b')]=function(_0x1d1605,_0x144fde,_0x3e70f0){return db['CmList']['find']({'where':{'id':_0x1d1605[_0xff01('0x4c')]['id']}})['then'](handleEntityNotFound(_0x144fde,null))[_0xff01('0x29')](function(_0x5d303a){if(_0x5d303a){return _0x5d303a[_0xff01('0x9b')](_0x1d1605['query'][_0xff01('0x62')])['then'](function(){if(_[_0xff01('0x64')](_0x1d1605[_0xff01('0x37')]['ids'])){for(var _0x26e0c5=0x0;_0x26e0c5<_0x1d1605[_0xff01('0x37')][_0xff01('0x62')][_0xff01('0x3d')];_0x26e0c5+=0x1){socket[_0xff01('0x9c')](_0xff01('0x9d'),{'UserId':Number(_0x1d1605[_0xff01('0x37')]['ids'][_0x26e0c5]),'CmListId':Number(_0x1d1605['params']['id'])});}}else{socket[_0xff01('0x9c')]('userCmList:remove',{'UserId':Number(_0x1d1605[_0xff01('0x37')][_0xff01('0x62')]),'CmListId':Number(_0x1d1605[_0xff01('0x4c')]['id'])});}});}})[_0xff01('0x29')](respondWithStatusCode(_0x144fde,null))[_0xff01('0x4e')](handleError(_0x144fde,null));};exports[_0xff01('0x9e')]=function(_0xbd1e53,_0x462cf9,_0x5eeff4){var _0x25cd89={};var _0x1e65c7={};var _0x1eb601;var _0x49f930;return db[_0xff01('0x46')][_0xff01('0x5f')]({'where':{'id':_0xbd1e53[_0xff01('0x4c')]['id']}})[_0xff01('0x29')](handleEntityNotFound(_0x462cf9,null))['then'](function(_0x4112b7){if(_0x4112b7){_0x1eb601=_0x4112b7;_0x1e65c7['model']=_[_0xff01('0x38')](db['User'][_0xff01('0x32')]);_0x1e65c7[_0xff01('0x37')]=_[_0xff01('0x38')](_0xbd1e53[_0xff01('0x37')]);_0x1e65c7['filters']=_[_0xff01('0x3a')](_0x1e65c7[_0xff01('0x36')],_0x1e65c7[_0xff01('0x37')]);_0x25cd89[_0xff01('0x3b')]=_[_0xff01('0x3a')](_0x1e65c7['model'],qs['fields'](_0xbd1e53[_0xff01('0x37')][_0xff01('0x3c')]));_0x25cd89[_0xff01('0x3b')]=_0x25cd89['attributes']['length']?_0x25cd89[_0xff01('0x3b')]:_0x1e65c7[_0xff01('0x36')];_0x25cd89[_0xff01('0x60')]=qs[_0xff01('0x40')](_0xbd1e53['query'][_0xff01('0x40')]);_0x25cd89[_0xff01('0x41')]=qs[_0xff01('0x39')](_[_0xff01('0x42')](_0xbd1e53['query'],_0x1e65c7[_0xff01('0x39')]));if(_0xbd1e53['query'][_0xff01('0x43')]){_0x25cd89[_0xff01('0x41')]=_[_0xff01('0x44')](_0x25cd89[_0xff01('0x41')],{'$or':_[_0xff01('0x31')](_0x25cd89['attributes'],function(_0x4ed5db){var _0x4c85c2={};_0x4c85c2[_0x4ed5db]={'$like':'%'+_0xbd1e53[_0xff01('0x37')][_0xff01('0x43')]+'%'};return _0x4c85c2;})});}_0x25cd89=_[_0xff01('0x44')]({},_0x25cd89,_0xbd1e53[_0xff01('0x45')]);return _0x1eb601['getAgents'](_0x25cd89);}})['then'](function(_0x208a45){if(_0x208a45){_0x49f930=_0x208a45['length'];if(!_0xbd1e53[_0xff01('0x37')][_0xff01('0x3e')](_0xff01('0x3f'))){_0x25cd89['limit']=qs[_0xff01('0x21')](_0xbd1e53[_0xff01('0x37')][_0xff01('0x21')]);_0x25cd89['offset']=qs[_0xff01('0x1f')](_0xbd1e53[_0xff01('0x37')][_0xff01('0x1f')]);}return _0x1eb601['getAgents'](_0x25cd89);}})[_0xff01('0x29')](function(_0x5495f8){if(_0x5495f8){return _0x5495f8?{'count':_0x49f930,'rows':_0x5495f8}:null;}})[_0xff01('0x29')](respondWithResult(_0x462cf9,null))[_0xff01('0x4e')](handleError(_0x462cf9,null));};function handleQuery(_0x253dcd){logger[_0xff01('0x9f')](_0x253dcd);return db[_0xff01('0x8d')]['query'](_0x253dcd)[_0xff01('0x9a')](function(_0x3be6e3){csv_results['push'](_0x3be6e3);})['catch'](function(_0x425675){logger[_0xff01('0x2c')](_0x425675[_0xff01('0x6c')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 4bd07bf..4433454 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(_0x5337b7,_0x20e927){var _0x813f10=function(_0xd95cb8){while(--_0xd95cb8){_0x5337b7['push'](_0x5337b7['shift']());}};_0x813f10(++_0x20e927);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x5a9612,_0x5b07fc){_0x5a9612=_0x5a9612-0x0;var _0x1cea83=_0x326f[_0x5a9612];return _0x1cea83;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 8262ecf..ad35cf6 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 _0x3c81=['moment','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','util','api'];(function(_0x54bfcf,_0x334ebc){var _0xbbf9f8=function(_0x278df8){while(--_0x278df8){_0x54bfcf['push'](_0x54bfcf['shift']());}};_0xbbf9f8(++_0x334ebc);}(_0x3c81,0x102));var _0x13c8=function(_0x12e823,_0x4893a3){_0x12e823=_0x12e823-0x0;var _0x2a2ecc=_0x3c81[_0x12e823];return _0x2a2ecc;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var logger=require('../../config/logger')(_0x13c8('0x2'));var moment=require(_0x13c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c8('0x4'));var attributes=require(_0x13c8('0x5'));module[_0x13c8('0x6')]=function(_0x1c16f1,_0x2a4d66){return _0x1c16f1[_0x13c8('0x7')](_0x13c8('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x2a6293,_0x481299){var _0xfcc234=function(_0x2af147){while(--_0x2af147){_0x2a6293['push'](_0x2a6293['shift']());}};_0xfcc234(++_0x481299);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2fb339,_0x47be22){_0x2fb339=_0x2fb339-0x0;var _0x35a3cf=_0x5ff3[_0x2fb339];return _0x35a3cf;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'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 1ee1fe5..462a8dd 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 _0x62eb=['http','redis','localhost','socket.io-emitter','./cmList.socket','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x28288a,_0x39866c){var _0x358327=function(_0x1e932d){while(--_0x1e932d){_0x28288a['push'](_0x28288a['shift']());}};_0x358327(++_0x39866c);}(_0x62eb,0x8d));var _0xb62e=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x62eb[_0x2642cb];return _0xe6e41;};'use strict';var _=require('lodash');var util=require(_0xb62e('0x0'));var moment=require('moment');var BPromise=require(_0xb62e('0x1'));var rs=require(_0xb62e('0x2'));var fs=require('fs');var Redis=require(_0xb62e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb62e('0x4'));var logger=require('../../config/logger')(_0xb62e('0x5'));var config=require(_0xb62e('0x6'));var jayson=require(_0xb62e('0x7'));var client=jayson[_0xb62e('0x8')][_0xb62e('0x9')]({'port':0x232a});config[_0xb62e('0xa')]=_['defaults'](config[_0xb62e('0xa')],{'host':_0xb62e('0xb'),'port':0x18eb});var socket=require(_0xb62e('0xc'))(new Redis(config['redis']));require(_0xb62e('0xd'))['register'](socket);function respondWithRpcPromise(_0x4b2736,_0xb26637,_0x5f1dac){return new BPromise(function(_0x2c745b,_0x455505){return client['request'](_0x4b2736,_0x5f1dac)[_0xb62e('0xe')](function(_0x373ed1){logger['info']('CmList,\x20%s,\x20%s',_0xb26637,_0xb62e('0xf'));logger[_0xb62e('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0xb26637,_0xb62e('0xf'),JSON[_0xb62e('0x11')](_0x373ed1));if(_0x373ed1[_0xb62e('0x12')]){if(_0x373ed1[_0xb62e('0x12')][_0xb62e('0x13')]===0x1f4){logger[_0xb62e('0x12')](_0xb62e('0x14'),_0xb26637,_0x373ed1[_0xb62e('0x12')][_0xb62e('0x15')]);return _0x455505(_0x373ed1[_0xb62e('0x12')][_0xb62e('0x15')]);}logger['error'](_0xb62e('0x14'),_0xb26637,_0x373ed1[_0xb62e('0x12')]['message']);return _0x2c745b(_0x373ed1[_0xb62e('0x12')]['message']);}else{logger[_0xb62e('0x16')](_0xb62e('0x14'),_0xb26637,_0xb62e('0xf'));_0x2c745b(_0x373ed1[_0xb62e('0x17')][_0xb62e('0x15')]);}})[_0xb62e('0x18')](function(_0xf5aaf){logger[_0xb62e('0x12')]('CmList,\x20%s,\x20%s',_0xb26637,_0xf5aaf);_0x455505(_0xf5aaf);});});} \ No newline at end of file +var _0xe925=['rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0xe925,0x105));var _0x5e92=function(_0x17534b,_0x1e02d8){_0x17534b=_0x17534b-0x0;var _0x5bcab7=_0xe925[_0x17534b];return _0x5bcab7;};'use strict';var _=require(_0x5e92('0x0'));var util=require(_0x5e92('0x1'));var moment=require(_0x5e92('0x2'));var BPromise=require(_0x5e92('0x3'));var rs=require(_0x5e92('0x4'));var fs=require('fs');var Redis=require(_0x5e92('0x5'));var db=require(_0x5e92('0x6'))['db'];var utils=require(_0x5e92('0x7'));var logger=require(_0x5e92('0x8'))(_0x5e92('0x9'));var config=require('../../config/environment');var jayson=require(_0x5e92('0xa'));var client=jayson[_0x5e92('0xb')]['http']({'port':0x232a});config['redis']=_[_0x5e92('0xc')](config['redis'],{'host':_0x5e92('0xd'),'port':0x18eb});var socket=require(_0x5e92('0xe'))(new Redis(config[_0x5e92('0xf')]));require(_0x5e92('0x10'))[_0x5e92('0x11')](socket);function respondWithRpcPromise(_0x34bc10,_0x535884,_0x2ba2c7){return new BPromise(function(_0x474e47,_0x19de44){return client[_0x5e92('0x12')](_0x34bc10,_0x2ba2c7)['then'](function(_0x2e529a){logger[_0x5e92('0x13')](_0x5e92('0x14'),_0x535884,_0x5e92('0x15'));logger[_0x5e92('0x16')]('CmList,\x20%s,\x20%s,\x20%s',_0x535884,'request\x20sent',JSON[_0x5e92('0x17')](_0x2e529a));if(_0x2e529a[_0x5e92('0x18')]){if(_0x2e529a[_0x5e92('0x18')]['code']===0x1f4){logger[_0x5e92('0x18')](_0x5e92('0x14'),_0x535884,_0x2e529a[_0x5e92('0x18')]['message']);return _0x19de44(_0x2e529a[_0x5e92('0x18')][_0x5e92('0x19')]);}logger[_0x5e92('0x18')]('CmList,\x20%s,\x20%s',_0x535884,_0x2e529a[_0x5e92('0x18')][_0x5e92('0x19')]);return _0x474e47(_0x2e529a['error'][_0x5e92('0x19')]);}else{logger[_0x5e92('0x13')](_0x5e92('0x14'),_0x535884,_0x5e92('0x15'));_0x474e47(_0x2e529a[_0x5e92('0x1a')][_0x5e92('0x19')]);}})['catch'](function(_0x56377d){logger[_0x5e92('0x18')](_0x5e92('0x14'),_0x535884,_0x56377d);_0x19de44(_0x56377d);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 88a8f5f..485c8f2 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 _0x335a=['update','emit','removeListener','length','cmList:','save','remove'];(function(_0x3be45e,_0x25a05c){var _0x511c0e=function(_0x10bfaa){while(--_0x10bfaa){_0x3be45e['push'](_0x3be45e['shift']());}};_0x511c0e(++_0x25a05c);}(_0x335a,0xc2));var _0xa335=function(_0x5c339f,_0x3f993e){_0x5c339f=_0x5c339f-0x0;var _0x10aae5=_0x335a[_0x5c339f];return _0x10aae5;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xa335('0x0'),_0xa335('0x1'),_0xa335('0x2')];function createListener(_0x157dd2,_0x1d315b){return function(_0x295312){_0x1d315b[_0xa335('0x3')](_0x157dd2,_0x295312);};}function removeListener(_0x32758c,_0x1a92d4){return function(){CmListEvents[_0xa335('0x4')](_0x32758c,_0x1a92d4);};}exports['register']=function(_0x38bc2b){for(var _0x3f7f83=0x0,_0x45a566=events[_0xa335('0x5')];_0x3f7f83<_0x45a566;_0x3f7f83++){var _0x12e174=events[_0x3f7f83];var _0x4c4fc1=createListener(_0xa335('0x6')+_0x12e174,_0x38bc2b);CmListEvents['on'](_0x12e174,_0x4c4fc1);}}; \ No newline at end of file +var _0x5d6d=['update','removeListener','length','cmList:','./cmList.events','save','remove'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0x5d6d,0x1ee));var _0xd5d6=function(_0x5b8958,_0x14dc4b){_0x5b8958=_0x5b8958-0x0;var _0xf6082b=_0x5d6d[_0x5b8958];return _0xf6082b;};'use strict';var CmListEvents=require(_0xd5d6('0x0'));var events=[_0xd5d6('0x1'),_0xd5d6('0x2'),_0xd5d6('0x3')];function createListener(_0x38db19,_0x75aab1){return function(_0x31ed04){_0x75aab1['emit'](_0x38db19,_0x31ed04);};}function removeListener(_0x4934a0,_0x21a458){return function(){CmListEvents[_0xd5d6('0x4')](_0x4934a0,_0x21a458);};}exports['register']=function(_0x16be36){for(var _0x113fed=0x0,_0x41e18c=events[_0xd5d6('0x5')];_0x113fed<_0x41e18c;_0x113fed++){var _0x2ed09a=events[_0x113fed];var _0x19ab2c=createListener(_0xd5d6('0x6')+_0x2ed09a,_0x16be36);CmListEvents['on'](_0x2ed09a,_0x19ab2c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0b1b96e..5a12855 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 _0x0439=['delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','/describe','get','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','create','/:id/dispositions','addDisposition','addCustomField','/:id/users','put','update'];(function(_0x7a7bd1,_0x4b424b){var _0x21475b=function(_0x25806a){while(--_0x25806a){_0x7a7bd1['push'](_0x7a7bd1['shift']());}};_0x21475b(++_0x4b424b);}(_0x0439,0xdd));var _0x9043=function(_0x4d98b8,_0x539839){_0x4d98b8=_0x4d98b8-0x0;var _0x5e271b=_0x0439[_0x4d98b8];return _0x5e271b;};'use strict';var multer=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var path=require(_0x9043('0x2'));var timeout=require(_0x9043('0x3'));var express=require(_0x9043('0x4'));var router=express[_0x9043('0x5')]();var fs_extra=require(_0x9043('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9043('0x7'));var config=require(_0x9043('0x8'));var controller=require(_0x9043('0x9'));router['get']('/',auth[_0x9043('0xa')](),controller['index']);router['get'](_0x9043('0xb'),auth[_0x9043('0xa')](),controller['describe']);router[_0x9043('0xc')]('/global_fields',auth[_0x9043('0xa')](),controller[_0x9043('0xd')]);router['get'](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0xf')]);router['get']('/:id/dispositions',auth[_0x9043('0xa')](),controller[_0x9043('0x10')]);router['get'](_0x9043('0x11'),auth[_0x9043('0xa')](),controller[_0x9043('0x12')]);router[_0x9043('0xc')](_0x9043('0x13'),auth[_0x9043('0xa')](),controller['getContactsCsv']);router[_0x9043('0xc')](_0x9043('0x14'),auth['isAuthenticated'](),controller[_0x9043('0x15')]);router[_0x9043('0xc')]('/:id/users',auth[_0x9043('0xa')](),controller[_0x9043('0x16')]);router[_0x9043('0x17')]('/',auth[_0x9043('0xa')](),controller[_0x9043('0x18')]);router[_0x9043('0x17')](_0x9043('0x19'),auth[_0x9043('0xa')](),controller[_0x9043('0x1a')]);router[_0x9043('0x17')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x9043('0x17')](_0x9043('0x14'),auth[_0x9043('0xa')](),controller[_0x9043('0x1b')]);router['post'](_0x9043('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9043('0x1d')](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0x1e')]);router[_0x9043('0x1f')](_0x9043('0xe'),auth[_0x9043('0xa')](),controller[_0x9043('0x20')]);router['delete'](_0x9043('0x19'),auth[_0x9043('0xa')](),controller[_0x9043('0x21')]);router['delete'](_0x9043('0x1c'),auth[_0x9043('0xa')](),controller[_0x9043('0x22')]);module[_0x9043('0x23')]=router; \ No newline at end of file +var _0x066d=['get','index','/describe','isAuthenticated','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','addDisposition','addContacts','put','delete','removeDispositions','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x066d,0x1b0));var _0xd066=function(_0x2d32df,_0x32640a){_0x2d32df=_0x2d32df-0x0;var _0x2c8c12=_0x066d[_0x2d32df];return _0x2c8c12;};'use strict';var multer=require(_0xd066('0x0'));var util=require(_0xd066('0x1'));var path=require(_0xd066('0x2'));var timeout=require(_0xd066('0x3'));var express=require('express');var router=express[_0xd066('0x4')]();var fs_extra=require(_0xd066('0x5'));var auth=require(_0xd066('0x6'));var interaction=require(_0xd066('0x7'));var config=require(_0xd066('0x8'));var controller=require(_0xd066('0x9'));router[_0xd066('0xa')]('/',auth['isAuthenticated'](),controller[_0xd066('0xb')]);router[_0xd066('0xa')](_0xd066('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xd066('0xa')]('/global_fields',auth[_0xd066('0xd')](),controller[_0xd066('0xe')]);router['get'](_0xd066('0xf'),auth[_0xd066('0xd')](),controller[_0xd066('0x10')]);router[_0xd066('0xa')](_0xd066('0x11'),auth[_0xd066('0xd')](),controller[_0xd066('0x12')]);router[_0xd066('0xa')](_0xd066('0x13'),auth[_0xd066('0xd')](),controller['getContacts']);router['get'](_0xd066('0x14'),auth[_0xd066('0xd')](),controller[_0xd066('0x15')]);router[_0xd066('0xa')](_0xd066('0x16'),auth['isAuthenticated'](),controller[_0xd066('0x17')]);router[_0xd066('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xd066('0x18')]('/',auth['isAuthenticated'](),controller[_0xd066('0x19')]);router[_0xd066('0x18')]('/:id/dispositions',auth[_0xd066('0xd')](),controller[_0xd066('0x1a')]);router[_0xd066('0x18')](_0xd066('0x13'),auth[_0xd066('0xd')](),controller[_0xd066('0x1b')]);router[_0xd066('0x18')]('/:id/fields',auth[_0xd066('0xd')](),controller['addCustomField']);router[_0xd066('0x18')]('/:id/users',auth[_0xd066('0xd')](),controller['addAgents']);router[_0xd066('0x1c')](_0xd066('0xf'),auth[_0xd066('0xd')](),controller['update']);router[_0xd066('0x1d')](_0xd066('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0xd066('0x1d')](_0xd066('0x11'),auth[_0xd066('0xd')](),controller[_0xd066('0x1e')]);router['delete'](_0xd066('0x1f'),auth[_0xd066('0xd')](),controller[_0xd066('0x20')]);module[_0xd066('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 9d6090f..92352e2 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 _0xd51d=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd51d,0x1b1));var _0xdd51=function(_0x4f9f5a,_0x19c14a){_0x4f9f5a=_0x4f9f5a-0x0;var _0x103607=_0xd51d[_0x4f9f5a];return _0x103607;};'use strict';var Sequelize=require(_0xdd51('0x0'));module[_0xdd51('0x1')]={'name':{'type':Sequelize[_0xdd51('0x2')],'get':function(_0x4eddfa){return this[_0xdd51('0x3')](_0xdd51('0x4'));}},'field':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xdd51('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xc9ad=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc9ad,0x119));var _0xdc9a=function(_0x33b4ad,_0xb6a977){_0x33b4ad=_0x33b4ad-0x0;var _0x2280e9=_0xc9ad[_0x33b4ad];return _0x2280e9;};'use strict';var Sequelize=require(_0xdc9a('0x0'));module[_0xdc9a('0x1')]={'name':{'type':Sequelize[_0xdc9a('0x2')],'get':function(_0xd41de0){return this[_0xdc9a('0x3')](_0xdc9a('0x4'));}},'field':{'type':Sequelize[_0xdc9a('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xdc9a('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xdc9a('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 441f80f..6128ad3 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(_0x100f9d,_0x4f685e){var _0x23eb3d=function(_0x25151e){while(--_0x25151e){_0x100f9d['push'](_0x100f9d['shift']());}};_0x23eb3d(++_0x4f685e);}(_0x7a54,0x106));var _0x47a5=function(_0x4d2d0f,_0x2b7519){_0x4d2d0f=_0x4d2d0f-0x0;var _0xbcbc3c=_0x7a54[_0x4d2d0f];return _0xbcbc3c;};'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(_0x57535a,_0x513a3d){var _0x2e5c27=function(_0x33860f){while(--_0x33860f){_0x57535a['push'](_0x57535a['shift']());}};_0x2e5c27(++_0x513a3d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index fdada41..afbb85f 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 _0x9a2b=['./condition.attributes','exports','define','Condition','tools_conditions','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d09b6,_0x1ac12c){var _0x2f1a26=function(_0x27e496){while(--_0x27e496){_0x1d09b6['push'](_0x1d09b6['shift']());}};_0x2f1a26(++_0x1ac12c);}(_0x9a2b,0x1b5));var _0xb9a2=function(_0x171ca6,_0x2f8f9d){_0x171ca6=_0x171ca6-0x0;var _0x244768=_0x9a2b[_0x171ca6];return _0x244768;};'use strict';var _=require('lodash');var util=require(_0xb9a2('0x0'));var logger=require('../../config/logger')(_0xb9a2('0x1'));var moment=require('moment');var BPromise=require(_0xb9a2('0x2'));var rp=require(_0xb9a2('0x3'));var fs=require('fs');var path=require(_0xb9a2('0x4'));var rimraf=require(_0xb9a2('0x5'));var config=require(_0xb9a2('0x6'));var attributes=require(_0xb9a2('0x7'));module[_0xb9a2('0x8')]=function(_0x377107,_0x20661a){return _0x377107[_0xb9a2('0x9')](_0xb9a2('0xa'),attributes,{'tableName':_0xb9a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c18=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','util'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x3c18,0x175));var _0x83c1=function(_0x3e84f2,_0x5c6b2d){_0x3e84f2=_0x3e84f2-0x0;var _0x5dbe06=_0x3c18[_0x3e84f2];return _0x5dbe06;};'use strict';var _=require('lodash');var util=require(_0x83c1('0x0'));var logger=require(_0x83c1('0x1'))(_0x83c1('0x2'));var moment=require(_0x83c1('0x3'));var BPromise=require('bluebird');var rp=require(_0x83c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83c1('0x5'));var config=require(_0x83c1('0x6'));var attributes=require(_0x83c1('0x7'));module['exports']=function(_0x349af1,_0x5d5b4a){return _0x349af1[_0x83c1('0x8')](_0x83c1('0x9'),attributes,{'tableName':_0x83c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 3da0d48..99c5ec3 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 _0xdfe6=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4238e3,_0x5bbe65){var _0x1545c1=function(_0x4fca42){while(--_0x4fca42){_0x4238e3['push'](_0x4238e3['shift']());}};_0x1545c1(++_0x5bbe65);}(_0xdfe6,0xb1));var _0x6dfe=function(_0x969465,_0x171ff2){_0x969465=_0x969465-0x0;var _0x1c02a6=_0xdfe6[_0x969465];return _0x1c02a6;};'use strict';var _=require(_0x6dfe('0x0'));var util=require(_0x6dfe('0x1'));var moment=require(_0x6dfe('0x2'));var BPromise=require(_0x6dfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6dfe('0x5'))(_0x6dfe('0x6'));var config=require(_0x6dfe('0x7'));var jayson=require(_0x6dfe('0x8'));var client=jayson[_0x6dfe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33699b,_0xe0d17a,_0x47804d){return new BPromise(function(_0x558222,_0x3f87ee){return client['request'](_0x33699b,_0x47804d)[_0x6dfe('0xa')](function(_0x5a3f83){logger[_0x6dfe('0xb')](_0x6dfe('0xc'),_0xe0d17a,'request\x20sent');logger[_0x6dfe('0xd')](_0x6dfe('0xe'),_0xe0d17a,_0x6dfe('0xf'),JSON[_0x6dfe('0x10')](_0x5a3f83));if(_0x5a3f83[_0x6dfe('0x11')]){if(_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x12')]===0x1f4){logger[_0x6dfe('0x11')]('Condition,\x20%s,\x20%s',_0xe0d17a,_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);return _0x3f87ee(_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);}logger['error'](_0x6dfe('0xc'),_0xe0d17a,_0x5a3f83[_0x6dfe('0x11')][_0x6dfe('0x13')]);return _0x558222(_0x5a3f83[_0x6dfe('0x11')]['message']);}else{logger[_0x6dfe('0xb')](_0x6dfe('0xc'),_0xe0d17a,'request\x20sent');_0x558222(_0x5a3f83[_0x6dfe('0x14')][_0x6dfe('0x13')]);}})[_0x6dfe('0x15')](function(_0x4dbfd3){logger[_0x6dfe('0x11')]('Condition,\x20%s,\x20%s',_0xe0d17a,_0x4dbfd3);_0x3f87ee(_0x4dbfd3);});});} \ No newline at end of file +var _0xebc0=['message','Condition,\x20%s,\x20%s','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55ee7c,_0x579575){var _0x640d1f=function(_0x5d0548){while(--_0x5d0548){_0x55ee7c['push'](_0x55ee7c['shift']());}};_0x640d1f(++_0x579575);}(_0xebc0,0x72));var _0x0ebc=function(_0x279bf1,_0xb4e981){_0x279bf1=_0x279bf1-0x0;var _0x24ec63=_0xebc0[_0x279bf1];return _0x24ec63;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ebc('0x2'))['db'];var utils=require(_0x0ebc('0x3'));var logger=require(_0x0ebc('0x4'))(_0x0ebc('0x5'));var config=require(_0x0ebc('0x6'));var jayson=require(_0x0ebc('0x7'));var client=jayson[_0x0ebc('0x8')][_0x0ebc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf957db,_0x4e6b74,_0x530273){return new BPromise(function(_0x3c48a3,_0x595006){return client[_0x0ebc('0xa')](_0xf957db,_0x530273)[_0x0ebc('0xb')](function(_0x419ffa){logger[_0x0ebc('0xc')]('Condition,\x20%s,\x20%s',_0x4e6b74,_0x0ebc('0xd'));logger['debug'](_0x0ebc('0xe'),_0x4e6b74,'request\x20sent',JSON[_0x0ebc('0xf')](_0x419ffa));if(_0x419ffa[_0x0ebc('0x10')]){if(_0x419ffa['error'][_0x0ebc('0x11')]===0x1f4){logger[_0x0ebc('0x10')]('Condition,\x20%s,\x20%s',_0x4e6b74,_0x419ffa[_0x0ebc('0x10')]['message']);return _0x595006(_0x419ffa['error'][_0x0ebc('0x12')]);}logger['error'](_0x0ebc('0x13'),_0x4e6b74,_0x419ffa[_0x0ebc('0x10')]['message']);return _0x3c48a3(_0x419ffa[_0x0ebc('0x10')][_0x0ebc('0x12')]);}else{logger[_0x0ebc('0xc')](_0x0ebc('0x13'),_0x4e6b74,'request\x20sent');_0x3c48a3(_0x419ffa[_0x0ebc('0x14')]['message']);}})[_0x0ebc('0x15')](function(_0x3fdbc7){logger[_0x0ebc('0x10')](_0x0ebc('0x13'),_0x4e6b74,_0x3fdbc7);_0x595006(_0x3fdbc7);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 24c50b9..6f22051 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 _0xe6c4=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe6c4,0xa1));var _0x4e6c=function(_0x4c76df,_0x521a85){_0x4c76df=_0x4c76df-0x0;var _0x5e4aa5=_0xe6c4[_0x4c76df];return _0x5e4aa5;};'use strict';var multer=require(_0x4e6c('0x0'));var util=require(_0x4e6c('0x1'));var path=require(_0x4e6c('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e6c('0x3'));var router=express[_0x4e6c('0x4')]();var fs_extra=require(_0x4e6c('0x5'));var auth=require(_0x4e6c('0x6'));var interaction=require(_0x4e6c('0x7'));var config=require(_0x4e6c('0x8'));var controller=require(_0x4e6c('0x9'));router[_0x4e6c('0xa')](_0x4e6c('0xb'),auth[_0x4e6c('0xc')](),controller[_0x4e6c('0xd')]);router['delete']('/:id',auth[_0x4e6c('0xc')](),controller[_0x4e6c('0xe')]);module[_0x4e6c('0xf')]=router; \ No newline at end of file +var _0x42e6=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x28b6a2,_0x3bddb9){var _0x2eea6d=function(_0x2c0e4b){while(--_0x2c0e4b){_0x28b6a2['push'](_0x28b6a2['shift']());}};_0x2eea6d(++_0x3bddb9);}(_0x42e6,0x183));var _0x642e=function(_0x4073f5,_0x1e8254){_0x4073f5=_0x4073f5-0x0;var _0x1fb861=_0x42e6[_0x4073f5];return _0x1fb861;};'use strict';var multer=require(_0x642e('0x0'));var util=require('util');var path=require(_0x642e('0x1'));var timeout=require(_0x642e('0x2'));var express=require(_0x642e('0x3'));var router=express['Router']();var fs_extra=require(_0x642e('0x4'));var auth=require(_0x642e('0x5'));var interaction=require(_0x642e('0x6'));var config=require(_0x642e('0x7'));var controller=require('./condition.controller');router[_0x642e('0x8')](_0x642e('0x9'),auth[_0x642e('0xa')](),controller[_0x642e('0xb')]);router[_0x642e('0xc')](_0x642e('0x9'),auth[_0x642e('0xa')](),controller[_0x642e('0xd')]);module[_0x642e('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 abbe3bb..2d9bed6 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 _0x03a4=['STRING','name','exports'];(function(_0x32374e,_0x44eb45){var _0x3b3491=function(_0xe4b5eb){while(--_0xe4b5eb){_0x32374e['push'](_0x32374e['shift']());}};_0x3b3491(++_0x44eb45);}(_0x03a4,0x152));var _0x403a=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x03a4[_0x592e40];return _0x5d4288;};'use strict';var Sequelize=require('sequelize');module[_0x403a('0x0')]={'name':{'type':Sequelize[_0x403a('0x1')],'allowNull':![],'unique':_0x403a('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x5426=['INTEGER','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5426,0x71));var _0x6542=function(_0x742ffa,_0x2978a4){_0x742ffa=_0x742ffa-0x0;var _0x4f611a=_0x5426[_0x742ffa];return _0x4f611a;};'use strict';var Sequelize=require('sequelize');module[_0x6542('0x0')]={'name':{'type':Sequelize[_0x6542('0x1')],'allowNull':![],'unique':_0x6542('0x2')},'OrderBy':{'type':Sequelize[_0x6542('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6542('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 643b418..6b39170 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 _0x955f=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','user','catch'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x955f,0x1eb));var _0xf955=function(_0x20ab55,_0x1dfeb2){_0x20ab55=_0x20ab55-0x0;var _0x4edbb9=_0x955f[_0x20ab55];return _0x4edbb9;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){var _0x102e36=_0x3585c7[_0xf955('0x26')]({'plain':!![]});var _0x552cf3=_0xf955('0x27');return db[_0xf955('0x28')][_0xf955('0x25')]({'where':{'type':_0x552cf3,'resourceId':_0x102e36['id']}})[_0xf955('0x24')](function(){return _0x3585c7;});})[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x51f3ab,_0x3caea6){return function(_0x145098){if(!_0x145098){_0x51f3ab[_0xf955('0x17')](0x194);}return _0x145098;};}function handleError(_0xbd0b74,_0x28fa9c){_0x28fa9c=_0x28fa9c||0x1f4;return function(_0x264f6d){logger['error'](_0x264f6d[_0xf955('0x29')]);if(_0x264f6d[_0xf955('0x2a')]){delete _0x264f6d['name'];}_0xbd0b74[_0xf955('0x18')](_0x28fa9c)[_0xf955('0x2b')](_0x264f6d);};}exports[_0xf955('0x2c')]=function(_0x1ef794,_0x59bfb5){var _0x3a951c={},_0x518fb3={},_0x227104={'count':0x0,'rows':[]};var _0x2c222a=_[_0xf955('0x2d')](db[_0xf955('0x2e')][_0xf955('0x2f')],function(_0x32121b){return{'name':_0x32121b[_0xf955('0x30')],'type':_0x32121b[_0xf955('0x31')]['key']};});_0x518fb3[_0xf955('0x32')]=_[_0xf955('0x2d')](_0x2c222a,_0xf955('0x2a'));_0x518fb3[_0xf955('0x33')]=_['keys'](_0x1ef794[_0xf955('0x33')]);_0x518fb3[_0xf955('0x34')]=_[_0xf955('0x35')](_0x518fb3[_0xf955('0x32')],_0x518fb3[_0xf955('0x33')]);_0x3a951c['attributes']=_['intersection'](_0x518fb3['model'],qs[_0xf955('0x36')](_0x1ef794[_0xf955('0x33')][_0xf955('0x36')]));_0x3a951c[_0xf955('0x37')]=_0x3a951c[_0xf955('0x37')][_0xf955('0x38')]?_0x3a951c['attributes']:_0x518fb3[_0xf955('0x32')];if(!_0x1ef794['query'][_0xf955('0x39')](_0xf955('0x3a'))){_0x3a951c[_0xf955('0x1c')]=qs['limit'](_0x1ef794[_0xf955('0x33')]['limit']);_0x3a951c[_0xf955('0x1d')]=qs[_0xf955('0x1d')](_0x1ef794[_0xf955('0x33')][_0xf955('0x1d')]);}_0x3a951c['order']=qs[_0xf955('0x3b')](_0x1ef794[_0xf955('0x33')]['sort']);_0x3a951c[_0xf955('0x3c')]=qs[_0xf955('0x34')](_[_0xf955('0x3d')](_0x1ef794['query'],_0x518fb3[_0xf955('0x34')]),_0x2c222a);if(_0x1ef794[_0xf955('0x33')][_0xf955('0x3e')]){_0x3a951c['where']=_[_0xf955('0x3f')](_0x3a951c[_0xf955('0x3c')],{'$or':_[_0xf955('0x2d')](_0x2c222a,function(_0x2069f3){if(_0x2069f3[_0xf955('0x31')]!==_0xf955('0x40')){var _0x2b614d={};_0x2b614d[_0x2069f3[_0xf955('0x2a')]]={'$like':'%'+_0x1ef794['query'][_0xf955('0x3e')]+'%'};return _0x2b614d;}})});}_0x3a951c=_[_0xf955('0x3f')]({},_0x3a951c,_0x1ef794[_0xf955('0x41')]);var _0xe633fa={'where':_0x3a951c[_0xf955('0x3c')]};return db[_0xf955('0x2e')][_0xf955('0x1e')](_0xe633fa)[_0xf955('0x24')](function(_0x47651b){_0x227104[_0xf955('0x1e')]=_0x47651b;if(_0x1ef794[_0xf955('0x33')][_0xf955('0x42')]){_0x3a951c[_0xf955('0x43')]=[{'all':!![]}];}return db[_0xf955('0x2e')][_0xf955('0x44')](_0x3a951c);})[_0xf955('0x24')](function(_0x356ec2){_0x227104[_0xf955('0x45')]=_0x356ec2;return _0x227104;})[_0xf955('0x24')](respondWithFilteredResult(_0x59bfb5,_0x3a951c))['catch'](handleError(_0x59bfb5,null));};exports[_0xf955('0x46')]=function(_0x25d809,_0x2db18d){var _0x5f0ef9={'raw':!![],'where':{'id':_0x25d809['params']['id']}},_0x16fc1a={};_0x16fc1a[_0xf955('0x32')]=_['keys'](db[_0xf955('0x2e')][_0xf955('0x2f')]);_0x16fc1a[_0xf955('0x33')]=_[_0xf955('0x47')](_0x25d809['query']);_0x16fc1a[_0xf955('0x34')]=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],_0x16fc1a['query']);_0x5f0ef9['attributes']=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],qs[_0xf955('0x36')](_0x25d809[_0xf955('0x33')]['fields']));_0x5f0ef9[_0xf955('0x37')]=_0x5f0ef9[_0xf955('0x37')][_0xf955('0x38')]?_0x5f0ef9['attributes']:_0x16fc1a[_0xf955('0x32')];if(_0x25d809['query'][_0xf955('0x42')]){_0x5f0ef9[_0xf955('0x43')]=[{'all':!![]}];}_0x5f0ef9=_[_0xf955('0x3f')]({},_0x5f0ef9,_0x25d809['options']);return db[_0xf955('0x2e')][_0xf955('0x48')](_0x5f0ef9)[_0xf955('0x24')](handleEntityNotFound(_0x2db18d,null))[_0xf955('0x24')](respondWithResult(_0x2db18d,null))['catch'](handleError(_0x2db18d,null));};exports[_0xf955('0x49')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x2e')][_0xf955('0x49')](_0x4ff0f1['body'],{})[_0xf955('0x24')](function(_0x4e7269){var _0x35c23c=_0x4ff0f1['user'][_0xf955('0x26')]({'plain':!![]});if(!_0x35c23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c23c['role']===_0xf955('0x4a')){var _0x45c7fe=_0x4e7269['get']({'plain':!![]});var _0x142e8f='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x142e8f,'userProfileId':_0x35c23c['userProfileId']},'raw':!![]})[_0xf955('0x24')](function(_0x1abe1c){if(_0x1abe1c&&_0x1abe1c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf955('0x49')]({'name':_0x45c7fe[_0xf955('0x2a')],'resourceId':_0x45c7fe['id'],'type':_0x1abe1c[_0xf955('0x2a')],'sectionId':_0x1abe1c['id']},{})[_0xf955('0x24')](function(){return _0x4e7269;});}else{return _0x4e7269;}})[_0xf955('0x4b')](function(_0xa56483){logger[_0xf955('0x4c')](_0xf955('0x4d'),_0xa56483);throw _0xa56483;});}return _0x4e7269;})[_0xf955('0x24')](respondWithResult(_0x1c6d76,0xc9))[_0xf955('0x4b')](handleError(_0x1c6d76,null));};exports[_0xf955('0x23')]=function(_0x350873,_0x47a3a6){if(_0x350873[_0xf955('0x4e')]['id']){delete _0x350873[_0xf955('0x4e')]['id'];}return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x350873[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47a3a6,null))[_0xf955('0x24')](saveUpdates(_0x350873[_0xf955('0x4e')],null))[_0xf955('0x24')](respondWithResult(_0x47a3a6,null))[_0xf955('0x4b')](handleError(_0x47a3a6,null));};exports[_0xf955('0x25')]=function(_0x9057df,_0x228d59){return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x9057df[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x228d59,null))[_0xf955('0x24')](db[_0xf955('0x50')][_0xf955('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x9057df[_0xf955('0x4f')]['id']}}))[_0xf955('0x24')](removeEntity(_0x228d59,null))[_0xf955('0x4b')](handleError(_0x228d59,null));}; \ No newline at end of file +var _0x8952=['name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','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','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','ContactItemTypes','UserProfileResource','stack'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x8952,0x17e));var _0x2895=function(_0x548b24,_0xf1b55a){_0x548b24=_0x548b24-0x0;var _0x3e8f2e=_0x8952[_0x548b24];return _0x3e8f2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){var _0x4569b5=_0x511286[_0x2895('0x22')]({'plain':!![]});var _0x4a21cf=_0x2895('0x23');return db[_0x2895('0x24')]['destroy']({'where':{'type':_0x4a21cf,'resourceId':_0x4569b5['id']}})[_0x2895('0x21')](function(){return _0x511286;});})[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320661,_0x30f491){return function(_0x5eedfc){if(!_0x5eedfc){_0x320661[_0x2895('0x15')](0x194);}return _0x5eedfc;};}function handleError(_0x501898,_0x5d70f5){_0x5d70f5=_0x5d70f5||0x1f4;return function(_0x18a935){logger['error'](_0x18a935[_0x2895('0x25')]);if(_0x18a935[_0x2895('0x26')]){delete _0x18a935['name'];}_0x501898['status'](_0x5d70f5)[_0x2895('0x27')](_0x18a935);};}exports[_0x2895('0x28')]=function(_0x190e07,_0x14e343){var _0x14d150={},_0xa61689={},_0x34e110={'count':0x0,'rows':[]};var _0x546514=_[_0x2895('0x29')](db[_0x2895('0x2a')][_0x2895('0x2b')],function(_0x5546eb){return{'name':_0x5546eb[_0x2895('0x2c')],'type':_0x5546eb[_0x2895('0x2d')][_0x2895('0x2e')]};});_0xa61689[_0x2895('0x2f')]=_['map'](_0x546514,_0x2895('0x26'));_0xa61689[_0x2895('0x30')]=_[_0x2895('0x31')](_0x190e07[_0x2895('0x30')]);_0xa61689[_0x2895('0x32')]=_['intersection'](_0xa61689['model'],_0xa61689[_0x2895('0x30')]);_0x14d150[_0x2895('0x33')]=_['intersection'](_0xa61689[_0x2895('0x2f')],qs['fields'](_0x190e07[_0x2895('0x30')][_0x2895('0x34')]));_0x14d150['attributes']=_0x14d150[_0x2895('0x33')]['length']?_0x14d150[_0x2895('0x33')]:_0xa61689['model'];if(!_0x190e07['query'][_0x2895('0x35')](_0x2895('0x36'))){_0x14d150[_0x2895('0x1a')]=qs['limit'](_0x190e07[_0x2895('0x30')][_0x2895('0x1a')]);_0x14d150[_0x2895('0x18')]=qs[_0x2895('0x18')](_0x190e07[_0x2895('0x30')][_0x2895('0x18')]);}_0x14d150[_0x2895('0x37')]=qs[_0x2895('0x38')](_0x190e07[_0x2895('0x30')][_0x2895('0x38')]);_0x14d150['where']=qs[_0x2895('0x32')](_[_0x2895('0x39')](_0x190e07[_0x2895('0x30')],_0xa61689[_0x2895('0x32')]),_0x546514);if(_0x190e07[_0x2895('0x30')][_0x2895('0x3a')]){_0x14d150[_0x2895('0x3b')]=_['merge'](_0x14d150['where'],{'$or':_[_0x2895('0x29')](_0x546514,function(_0x29dc63){if(_0x29dc63[_0x2895('0x2d')]!==_0x2895('0x3c')){var _0x21bf07={};_0x21bf07[_0x29dc63[_0x2895('0x26')]]={'$like':'%'+_0x190e07['query']['filter']+'%'};return _0x21bf07;}})});}_0x14d150=_[_0x2895('0x3d')]({},_0x14d150,_0x190e07[_0x2895('0x3e')]);var _0x5ce598={'where':_0x14d150['where']};return db[_0x2895('0x2a')][_0x2895('0x1b')](_0x5ce598)[_0x2895('0x21')](function(_0x28967f){_0x34e110[_0x2895('0x1b')]=_0x28967f;if(_0x190e07[_0x2895('0x30')]['includeAll']){_0x14d150[_0x2895('0x3f')]=[{'all':!![]}];}return db[_0x2895('0x2a')][_0x2895('0x40')](_0x14d150);})[_0x2895('0x21')](function(_0x4af6d6){_0x34e110[_0x2895('0x41')]=_0x4af6d6;return _0x34e110;})[_0x2895('0x21')](respondWithFilteredResult(_0x14e343,_0x14d150))[_0x2895('0x42')](handleError(_0x14e343,null));};exports[_0x2895('0x43')]=function(_0x564983,_0x4ef9fe){var _0x46580f={'raw':!![],'where':{'id':_0x564983[_0x2895('0x44')]['id']}},_0x19ce85={};_0x19ce85[_0x2895('0x2f')]=_[_0x2895('0x31')](db['ContactItemType']['rawAttributes']);_0x19ce85[_0x2895('0x30')]=_[_0x2895('0x31')](_0x564983[_0x2895('0x30')]);_0x19ce85[_0x2895('0x32')]=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],_0x19ce85[_0x2895('0x30')]);_0x46580f['attributes']=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],qs[_0x2895('0x34')](_0x564983[_0x2895('0x30')][_0x2895('0x34')]));_0x46580f[_0x2895('0x33')]=_0x46580f[_0x2895('0x33')][_0x2895('0x46')]?_0x46580f['attributes']:_0x19ce85[_0x2895('0x2f')];if(_0x564983[_0x2895('0x30')][_0x2895('0x47')]){_0x46580f['include']=[{'all':!![]}];}_0x46580f=_[_0x2895('0x3d')]({},_0x46580f,_0x564983[_0x2895('0x3e')]);return db['ContactItemType'][_0x2895('0x48')](_0x46580f)[_0x2895('0x21')](handleEntityNotFound(_0x4ef9fe,null))[_0x2895('0x21')](respondWithResult(_0x4ef9fe,null))[_0x2895('0x42')](handleError(_0x4ef9fe,null));};exports[_0x2895('0x49')]=function(_0x3cc331,_0x11e53a){return db['ContactItemType'][_0x2895('0x49')](_0x3cc331[_0x2895('0x4a')],{})['then'](function(_0x4e1d47){var _0x574839=_0x3cc331[_0x2895('0x4b')][_0x2895('0x22')]({'plain':!![]});if(!_0x574839)throw new Error(_0x2895('0x4c'));if(_0x574839[_0x2895('0x4d')]===_0x2895('0x4b')){var _0x3c5261=_0x4e1d47[_0x2895('0x22')]({'plain':!![]});var _0x7df911=_0x2895('0x23');return db[_0x2895('0x4e')][_0x2895('0x48')]({'where':{'name':_0x7df911,'userProfileId':_0x574839[_0x2895('0x4f')]},'raw':!![]})[_0x2895('0x21')](function(_0x1481f5){if(_0x1481f5&&_0x1481f5[_0x2895('0x50')]===0x0){return db[_0x2895('0x24')][_0x2895('0x49')]({'name':_0x3c5261[_0x2895('0x26')],'resourceId':_0x3c5261['id'],'type':_0x1481f5[_0x2895('0x26')],'sectionId':_0x1481f5['id']},{})[_0x2895('0x21')](function(){return _0x4e1d47;});}else{return _0x4e1d47;}})[_0x2895('0x42')](function(_0x90ed5d){logger[_0x2895('0x51')](_0x2895('0x52'),_0x90ed5d);throw _0x90ed5d;});}return _0x4e1d47;})[_0x2895('0x21')](respondWithResult(_0x11e53a,0xc9))[_0x2895('0x42')](handleError(_0x11e53a,null));};exports[_0x2895('0x20')]=function(_0x290ed7,_0xc9e24e){if(_0x290ed7[_0x2895('0x4a')]['id']){delete _0x290ed7[_0x2895('0x4a')]['id'];}return db['ContactItemType'][_0x2895('0x48')]({'where':{'id':_0x290ed7[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xc9e24e,null))[_0x2895('0x21')](saveUpdates(_0x290ed7[_0x2895('0x4a')],null))[_0x2895('0x21')](respondWithResult(_0xc9e24e,null))['catch'](handleError(_0xc9e24e,null));};exports[_0x2895('0x53')]=function(_0x5579b3,_0xc31867){return db[_0x2895('0x2a')][_0x2895('0x48')]({'where':{'id':_0x5579b3[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xc31867,null))['then'](db['CmContactHasItem'][_0x2895('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5579b3[_0x2895('0x44')]['id']}}))[_0x2895('0x21')](removeEntity(_0xc31867,null))['catch'](handleError(_0xc31867,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index e4124ad..9e9195a 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 _0x5962=['exports','define','ContactItemType','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes'];(function(_0x43fb6c,_0x360ecd){var _0x37e001=function(_0x2a256f){while(--_0x2a256f){_0x43fb6c['push'](_0x43fb6c['shift']());}};_0x37e001(++_0x360ecd);}(_0x5962,0x163));var _0x2596=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0x5962[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require(_0x2596('0x0'));var util=require('util');var logger=require(_0x2596('0x1'))(_0x2596('0x2'));var moment=require(_0x2596('0x3'));var BPromise=require(_0x2596('0x4'));var rp=require(_0x2596('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2596('0x6'));var attributes=require(_0x2596('0x7'));module[_0x2596('0x8')]=function(_0x26236a,_0x39faeb){return _0x26236a[_0x2596('0x9')](_0x2596('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ad2=['lodash','util','../../config/logger','api','request-promise','rimraf','exports','tools_contact_item_types'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x3ad2,0x1f0));var _0x23ad=function(_0x513119,_0x425e6f){_0x513119=_0x513119-0x0;var _0x587511=_0x3ad2[_0x513119];return _0x587511;};'use strict';var _=require(_0x23ad('0x0'));var util=require(_0x23ad('0x1'));var logger=require(_0x23ad('0x2'))(_0x23ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23ad('0x5'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x23ad('0x6')]=function(_0x2c9db1,_0x4cc46a){return _0x2c9db1['define']('ContactItemType',attributes,{'tableName':_0x23ad('0x7'),'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 9a0fb73..beea5c8 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 _0xcb39=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb39,0xee));var _0x9cb3=function(_0x3ef5a9,_0x4a2ac6){_0x3ef5a9=_0x3ef5a9-0x0;var _0x272e9a=_0xcb39[_0x3ef5a9];return _0x272e9a;};'use strict';var _=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var moment=require(_0x9cb3('0x2'));var BPromise=require(_0x9cb3('0x3'));var rs=require(_0x9cb3('0x4'));var fs=require('fs');var Redis=require(_0x9cb3('0x5'));var db=require(_0x9cb3('0x6'))['db'];var utils=require(_0x9cb3('0x7'));var logger=require(_0x9cb3('0x8'))(_0x9cb3('0x9'));var config=require(_0x9cb3('0xa'));var jayson=require(_0x9cb3('0xb'));var client=jayson[_0x9cb3('0xc')][_0x9cb3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4ad852,_0x3b17b0,_0x486ce9){return new BPromise(function(_0x5801ed,_0x474c39){return client[_0x9cb3('0xe')](_0x4ad852,_0x486ce9)[_0x9cb3('0xf')](function(_0x384357){logger[_0x9cb3('0x10')](_0x9cb3('0x11'),_0x3b17b0,_0x9cb3('0x12'));logger[_0x9cb3('0x13')](_0x9cb3('0x14'),_0x3b17b0,_0x9cb3('0x12'),JSON[_0x9cb3('0x15')](_0x384357));if(_0x384357['error']){if(_0x384357[_0x9cb3('0x16')][_0x9cb3('0x17')]===0x1f4){logger['error'](_0x9cb3('0x11'),_0x3b17b0,_0x384357[_0x9cb3('0x16')][_0x9cb3('0x18')]);return _0x474c39(_0x384357['error'][_0x9cb3('0x18')]);}logger[_0x9cb3('0x16')]('ContactItemType,\x20%s,\x20%s',_0x3b17b0,_0x384357[_0x9cb3('0x16')][_0x9cb3('0x18')]);return _0x5801ed(_0x384357[_0x9cb3('0x16')]['message']);}else{logger[_0x9cb3('0x10')](_0x9cb3('0x11'),_0x3b17b0,_0x9cb3('0x12'));_0x5801ed(_0x384357[_0x9cb3('0x19')][_0x9cb3('0x18')]);}})[_0x9cb3('0x1a')](function(_0x50b518){logger['error']('ContactItemType,\x20%s,\x20%s',_0x3b17b0,_0x50b518);_0x474c39(_0x50b518);});});} \ No newline at end of file +var _0xbc78=['code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1371d1,_0x4381a0){var _0x445eb4=function(_0x720725){while(--_0x720725){_0x1371d1['push'](_0x1371d1['shift']());}};_0x445eb4(++_0x4381a0);}(_0xbc78,0x191));var _0x8bc7=function(_0x29c5cb,_0x106fed){_0x29c5cb=_0x29c5cb-0x0;var _0x135e26=_0xbc78[_0x29c5cb];return _0x135e26;};'use strict';var _=require(_0x8bc7('0x0'));var util=require(_0x8bc7('0x1'));var moment=require(_0x8bc7('0x2'));var BPromise=require(_0x8bc7('0x3'));var rs=require(_0x8bc7('0x4'));var fs=require('fs');var Redis=require(_0x8bc7('0x5'));var db=require(_0x8bc7('0x6'))['db'];var utils=require(_0x8bc7('0x7'));var logger=require('../../config/logger')(_0x8bc7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8bc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x810769,_0x37ad7c,_0x23df47){return new BPromise(function(_0x3d810d,_0x10e649){return client[_0x8bc7('0xa')](_0x810769,_0x23df47)['then'](function(_0x15cb30){logger[_0x8bc7('0xb')]('ContactItemType,\x20%s,\x20%s',_0x37ad7c,_0x8bc7('0xc'));logger[_0x8bc7('0xd')](_0x8bc7('0xe'),_0x37ad7c,_0x8bc7('0xc'),JSON[_0x8bc7('0xf')](_0x15cb30));if(_0x15cb30[_0x8bc7('0x10')]){if(_0x15cb30[_0x8bc7('0x10')][_0x8bc7('0x11')]===0x1f4){logger[_0x8bc7('0x10')](_0x8bc7('0x12'),_0x37ad7c,_0x15cb30[_0x8bc7('0x10')][_0x8bc7('0x13')]);return _0x10e649(_0x15cb30[_0x8bc7('0x10')][_0x8bc7('0x13')]);}logger['error'](_0x8bc7('0x12'),_0x37ad7c,_0x15cb30['error'][_0x8bc7('0x13')]);return _0x3d810d(_0x15cb30['error'][_0x8bc7('0x13')]);}else{logger[_0x8bc7('0xb')](_0x8bc7('0x12'),_0x37ad7c,_0x8bc7('0xc'));_0x3d810d(_0x15cb30[_0x8bc7('0x14')][_0x8bc7('0x13')]);}})[_0x8bc7('0x15')](function(_0x5065fa){logger['error'](_0x8bc7('0x12'),_0x37ad7c,_0x5065fa);_0x10e649(_0x5065fa);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 5d39dfb..e4b9023 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 _0x33fd=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id'];(function(_0x3fb56a,_0x5b610b){var _0x1f0af6=function(_0x1a82e3){while(--_0x1a82e3){_0x3fb56a['push'](_0x3fb56a['shift']());}};_0x1f0af6(++_0x5b610b);}(_0x33fd,0xb9));var _0xd33f=function(_0x1a44e3,_0x1efb77){_0x1a44e3=_0x1a44e3-0x0;var _0x27ebb4=_0x33fd[_0x1a44e3];return _0x27ebb4;};'use strict';var multer=require(_0xd33f('0x0'));var util=require(_0xd33f('0x1'));var path=require(_0xd33f('0x2'));var timeout=require(_0xd33f('0x3'));var express=require(_0xd33f('0x4'));var router=express[_0xd33f('0x5')]();var fs_extra=require(_0xd33f('0x6'));var auth=require(_0xd33f('0x7'));var interaction=require(_0xd33f('0x8'));var config=require(_0xd33f('0x9'));var controller=require(_0xd33f('0xa'));router[_0xd33f('0xb')]('/',auth[_0xd33f('0xc')](),controller[_0xd33f('0xd')]);router[_0xd33f('0xb')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller['show']);router[_0xd33f('0xf')]('/',auth[_0xd33f('0xc')](),controller['create']);router[_0xd33f('0x10')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller[_0xd33f('0x11')]);router[_0xd33f('0x12')](_0xd33f('0xe'),auth[_0xd33f('0xc')](),controller[_0xd33f('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe0e2=['/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe0e2,0x170));var _0x2e0e=function(_0x4ebd76,_0x2ff5e8){_0x4ebd76=_0x4ebd76-0x0;var _0x42c3ab=_0xe0e2[_0x4ebd76];return _0x42c3ab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2e0e('0x0'));var timeout=require(_0x2e0e('0x1'));var express=require('express');var router=express[_0x2e0e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2e0e('0x3'));var interaction=require(_0x2e0e('0x4'));var config=require(_0x2e0e('0x5'));var controller=require(_0x2e0e('0x6'));router[_0x2e0e('0x7')]('/',auth[_0x2e0e('0x8')](),controller[_0x2e0e('0x9')]);router[_0x2e0e('0x7')](_0x2e0e('0xa'),auth[_0x2e0e('0x8')](),controller['show']);router[_0x2e0e('0xb')]('/',auth[_0x2e0e('0x8')](),controller[_0x2e0e('0xc')]);router[_0x2e0e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x2e0e('0xe')]);router[_0x2e0e('0xf')](_0x2e0e('0xa'),auth['isAuthenticated'](),controller[_0x2e0e('0x10')]);module[_0x2e0e('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 21cb309..f0053e0 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0xb942dd,_0x11bb9f){var _0x3e3113=function(_0x279352){while(--_0x279352){_0xb942dd['push'](_0xb942dd['shift']());}};_0x3e3113(++_0x11bb9f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x1027e7,_0x3ab818){var _0x369242=function(_0x263c71){while(--_0x263c71){_0x1027e7['push'](_0x1027e7['shift']());}};_0x369242(++_0x3ab818);}(_0x2032,0xd9));var _0x2203=function(_0x3124a7,_0x1efd8f){_0x3124a7=_0x3124a7-0x0;var _0x37e41d=_0x2032[_0x3124a7];return _0x37e41d;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 84b1318..24bcda9 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 _0xdfb4=['omit','createdAt','updatedAt','role','update','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrOpenchannelAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','order','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','Dashboard','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','keys','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0xf37b8d,_0x42ce54){var _0x3b0b62=function(_0x41a7cc){while(--_0x41a7cc){_0xf37b8d['push'](_0xf37b8d['shift']());}};_0x3b0b62(++_0x42ce54);}(_0xdfb4,0x131));var _0x4dfb=function(_0xc7a0e1,_0x2ed7c5){_0xc7a0e1=_0xc7a0e1-0x0;var _0x19698c=_0xdfb4[_0xc7a0e1];return _0x19698c;};'use strict';var emlformat=require(_0x4dfb('0x0'));var rimraf=require(_0x4dfb('0x1'));var zipdir=require(_0x4dfb('0x2'));var jsonpatch=require(_0x4dfb('0x3'));var rp=require(_0x4dfb('0x4'));var moment=require('moment');var BPromise=require(_0x4dfb('0x5'));var Mustache=require('mustache');var util=require(_0x4dfb('0x6'));var path=require(_0x4dfb('0x7'));var sox=require('sox');var csv=require(_0x4dfb('0x8'));var ejs=require(_0x4dfb('0x9'));var fs=require('fs');var fs_extra=require(_0x4dfb('0xa'));var _=require(_0x4dfb('0xb'));var squel=require(_0x4dfb('0xc'));var crypto=require(_0x4dfb('0xd'));var jsforce=require(_0x4dfb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4dfb('0x8'));var querystring=require('querystring');var Papa=require(_0x4dfb('0xf'));var Redis=require('ioredis');var authService=require(_0x4dfb('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4dfb('0x11'));var logger=require(_0x4dfb('0x12'))(_0x4dfb('0x13'));var utils=require(_0x4dfb('0x14'));var config=require(_0x4dfb('0x15'));var licenseUtil=require(_0x4dfb('0x16'));var db=require('../../mysqldb')['db'];config[_0x4dfb('0x17')]=_[_0x4dfb('0x18')](config['redis'],{'host':_0x4dfb('0x19'),'port':0x18eb});var socket=require(_0x4dfb('0x1a'))(new Redis(config[_0x4dfb('0x17')]));require(_0x4dfb('0x1b'))[_0x4dfb('0x1c')](socket);function respondWithStatusCode(_0x1d51f9,_0x84105e){_0x84105e=_0x84105e||0xcc;return function(_0x2f2457){if(_0x2f2457){return _0x1d51f9[_0x4dfb('0x1d')](_0x84105e);}return _0x1d51f9[_0x4dfb('0x1e')](_0x84105e)[_0x4dfb('0x1f')]();};}function respondWithResult(_0x3fc365,_0x1eb348){_0x1eb348=_0x1eb348||0xc8;return function(_0x59e6fd){if(_0x59e6fd){return _0x3fc365['status'](_0x1eb348)[_0x4dfb('0x20')](_0x59e6fd);}};}function respondWithFilteredResult(_0x470fc4,_0x535bed){return function(_0x289ef6){if(_0x289ef6){var _0x1f8714=typeof _0x535bed[_0x4dfb('0x21')]===_0x4dfb('0x22')&&typeof _0x535bed[_0x4dfb('0x23')]===_0x4dfb('0x22');var _0x15e1b2=_0x289ef6['count'];var _0x9b6575=_0x1f8714?0x0:_0x535bed[_0x4dfb('0x21')];var _0x3b8eec=_0x1f8714?_0x289ef6[_0x4dfb('0x24')]:_0x535bed[_0x4dfb('0x21')]+_0x535bed[_0x4dfb('0x23')];var _0x689fde;if(_0x3b8eec>=_0x15e1b2){_0x3b8eec=_0x15e1b2;_0x689fde=0xc8;}else{_0x689fde=0xce;}_0x470fc4[_0x4dfb('0x1e')](_0x689fde);return _0x470fc4[_0x4dfb('0x25')](_0x4dfb('0x26'),_0x9b6575+'-'+_0x3b8eec+'/'+_0x15e1b2)[_0x4dfb('0x20')](_0x289ef6);}return null;};}function patchUpdates(_0x5f46bb){return function(_0x5b3659){try{jsonpatch[_0x4dfb('0x27')](_0x5b3659,_0x5f46bb,!![]);}catch(_0x58ff86){return BPromise[_0x4dfb('0x28')](_0x58ff86);}return _0x5b3659[_0x4dfb('0x29')]();};}function saveUpdates(_0x59d036,_0xf38e58){return function(_0x1ef2dd){if(_0x1ef2dd){return _0x1ef2dd['update'](_0x59d036)[_0x4dfb('0x2a')](function(_0x516584){return _0x516584;});}return null;};}function removeEntity(_0x243d15,_0x3a4df2){return function(_0x9a81bf){if(_0x9a81bf){return _0x9a81bf[_0x4dfb('0x2b')]()['then'](function(){var _0x236e7a=_0x9a81bf[_0x4dfb('0x2c')]({'plain':!![]});var _0x3de456=_0x4dfb('0x2d');return db[_0x4dfb('0x2e')][_0x4dfb('0x2b')]({'where':{'type':_0x3de456,'resourceId':_0x236e7a['id']}})[_0x4dfb('0x2a')](function(){return _0x9a81bf;});})[_0x4dfb('0x2a')](function(){_0x243d15[_0x4dfb('0x1e')](0xcc)[_0x4dfb('0x1f')]();});}};}function handleEntityNotFound(_0x499b45,_0x3bb9f4){return function(_0x9e61da){if(!_0x9e61da){_0x499b45['sendStatus'](0x194);}return _0x9e61da;};}function handleError(_0x583096,_0x563541){_0x563541=_0x563541||0x1f4;return function(_0x50d091){logger[_0x4dfb('0x2f')](_0x50d091[_0x4dfb('0x30')]);if(_0x50d091[_0x4dfb('0x31')]){delete _0x50d091[_0x4dfb('0x31')];}_0x583096[_0x4dfb('0x1e')](_0x563541)['send'](_0x50d091);};}exports['index']=function(_0x218673,_0x43c1cd){var _0x478b55={},_0x59fb0a={},_0x5a29e5={'count':0x0,'rows':[]};var _0x10015e=_['map'](db[_0x4dfb('0x32')][_0x4dfb('0x33')],function(_0x310c4e){return{'name':_0x310c4e[_0x4dfb('0x34')],'type':_0x310c4e[_0x4dfb('0x35')][_0x4dfb('0x36')]};});_0x59fb0a[_0x4dfb('0x37')]=_[_0x4dfb('0x38')](_0x10015e,'name');_0x59fb0a['query']=_['keys'](_0x218673['query']);_0x59fb0a['filters']=_[_0x4dfb('0x39')](_0x59fb0a[_0x4dfb('0x37')],_0x59fb0a['query']);_0x478b55[_0x4dfb('0x3a')]=_[_0x4dfb('0x39')](_0x59fb0a[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x218673[_0x4dfb('0x3c')]['fields']));_0x478b55[_0x4dfb('0x3a')]=_0x478b55[_0x4dfb('0x3a')][_0x4dfb('0x3d')]?_0x478b55['attributes']:_0x59fb0a[_0x4dfb('0x37')];if(!_0x218673['query'][_0x4dfb('0x3e')](_0x4dfb('0x3f'))){_0x478b55[_0x4dfb('0x23')]=qs['limit'](_0x218673['query'][_0x4dfb('0x23')]);_0x478b55[_0x4dfb('0x21')]=qs[_0x4dfb('0x21')](_0x218673[_0x4dfb('0x3c')][_0x4dfb('0x21')]);}_0x478b55['order']=qs[_0x4dfb('0x40')](_0x218673[_0x4dfb('0x3c')]['sort']);_0x478b55['where']=qs['filters'](_[_0x4dfb('0x41')](_0x218673['query'],_0x59fb0a['filters']),_0x10015e);if(_0x218673['query'][_0x4dfb('0x42')]){_0x478b55['where']=_['merge'](_0x478b55[_0x4dfb('0x43')],{'$or':_[_0x4dfb('0x38')](_0x10015e,function(_0x2f1214){if(_0x2f1214[_0x4dfb('0x35')]!==_0x4dfb('0x44')){var _0x389d5a={};_0x389d5a[_0x2f1214[_0x4dfb('0x31')]]={'$like':'%'+_0x218673['query']['filter']+'%'};return _0x389d5a;}})});}_0x478b55=_[_0x4dfb('0x45')]({},_0x478b55,_0x218673['options']);var _0x38cd88={'where':_0x478b55['where']};return db[_0x4dfb('0x32')][_0x4dfb('0x24')](_0x38cd88)[_0x4dfb('0x2a')](function(_0x4a8321){_0x5a29e5[_0x4dfb('0x24')]=_0x4a8321;if(_0x218673[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x478b55[_0x4dfb('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x4dfb('0x48')](_0x478b55);})[_0x4dfb('0x2a')](function(_0x4d4ed2){_0x5a29e5[_0x4dfb('0x49')]=_0x4d4ed2;return _0x5a29e5;})[_0x4dfb('0x2a')](respondWithFilteredResult(_0x43c1cd,_0x478b55))[_0x4dfb('0x4a')](handleError(_0x43c1cd,null));};exports[_0x4dfb('0x4b')]=function(_0x3ca90c,_0x1dde5b){var _0x138e3b={'raw':![],'where':{'id':_0x3ca90c['params']['id']}},_0x5592d8={};_0x5592d8[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x32')]['rawAttributes']);_0x5592d8[_0x4dfb('0x3c')]=_[_0x4dfb('0x4c')](_0x3ca90c[_0x4dfb('0x3c')]);_0x5592d8[_0x4dfb('0x4d')]=_[_0x4dfb('0x39')](_0x5592d8[_0x4dfb('0x37')],_0x5592d8[_0x4dfb('0x3c')]);_0x138e3b['attributes']=_[_0x4dfb('0x39')](_0x5592d8['model'],qs[_0x4dfb('0x3b')](_0x3ca90c[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x138e3b[_0x4dfb('0x3a')]=_0x138e3b['attributes'][_0x4dfb('0x3d')]?_0x138e3b[_0x4dfb('0x3a')]:_0x5592d8[_0x4dfb('0x37')];if(_0x3ca90c[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x138e3b[_0x4dfb('0x47')]=[{'all':!![]}];}_0x138e3b=_[_0x4dfb('0x45')]({},_0x138e3b,_0x3ca90c['options']);return db[_0x4dfb('0x32')][_0x4dfb('0x4e')](_0x138e3b)['then'](handleEntityNotFound(_0x1dde5b,null))[_0x4dfb('0x2a')](respondWithResult(_0x1dde5b,null))[_0x4dfb('0x4a')](handleError(_0x1dde5b,null));};exports[_0x4dfb('0x4f')]=function(_0x5aa90e,_0x45b6ad){return db[_0x4dfb('0x32')][_0x4dfb('0x4f')](_0x5aa90e[_0x4dfb('0x50')],{})[_0x4dfb('0x2a')](function(_0x76dc9c){var _0x1da471=_0x5aa90e[_0x4dfb('0x51')][_0x4dfb('0x2c')]({'plain':!![]});if(!_0x1da471)throw new Error(_0x4dfb('0x52'));if(_0x1da471['role']===_0x4dfb('0x51')){var _0x4b12db=_0x76dc9c['get']({'plain':!![]});var _0xdd6156='CustomDashboards';return db[_0x4dfb('0x53')][_0x4dfb('0x4e')]({'where':{'name':_0xdd6156,'userProfileId':_0x1da471[_0x4dfb('0x54')]},'raw':!![]})[_0x4dfb('0x2a')](function(_0x20d720){if(_0x20d720&&_0x20d720[_0x4dfb('0x55')]===0x0){return db[_0x4dfb('0x2e')][_0x4dfb('0x4f')]({'name':_0x4b12db[_0x4dfb('0x31')],'resourceId':_0x4b12db['id'],'type':_0x20d720['name'],'sectionId':_0x20d720['id']},{})[_0x4dfb('0x2a')](function(){return _0x76dc9c;});}else{return _0x76dc9c;}})['catch'](function(_0x2678da){logger[_0x4dfb('0x2f')](_0x4dfb('0x56'),_0x2678da);throw _0x2678da;});}return _0x76dc9c;})['then'](respondWithResult(_0x45b6ad,0xc9))['catch'](handleError(_0x45b6ad,null));};exports['clone']=function(_0x47030d,_0x4893dc){var _0x505fd7={'where':{'id':_0x47030d[_0x4dfb('0x57')]['id']}},_0x1fd1ae={};_0x1fd1ae[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x32')]['rawAttributes']);_0x505fd7['attributes']=_[_0x4dfb('0x39')](_0x1fd1ae[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x505fd7[_0x4dfb('0x3a')]=_0x505fd7['attributes'][_0x4dfb('0x3d')]?_0x505fd7['attributes']:_0x1fd1ae[_0x4dfb('0x37')];if(_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x46')]){_0x505fd7[_0x4dfb('0x47')]=[{'all':!![]}];}_0x505fd7=_[_0x4dfb('0x45')]({},_0x505fd7,_0x47030d['options']);return db[_0x4dfb('0x32')][_0x4dfb('0x4e')](_0x505fd7)[_0x4dfb('0x2a')](handleEntityNotFound(_0x4893dc,null))[_0x4dfb('0x2a')](function(_0x24c2aa){if(_0x24c2aa){var _0x113ebb=_0x24c2aa[_0x4dfb('0x2c')]({'plain':!![]});_0x113ebb=qs[_0x4dfb('0x58')](_0x113ebb,['id',_0x4dfb('0x59'),_0x4dfb('0x5a')]);_0x47030d['body']=_[_0x4dfb('0x58')](_0x47030d[_0x4dfb('0x50')],['id',_0x4dfb('0x59'),'updatedAt']);return db[_0x4dfb('0x32')][_0x4dfb('0x4f')](_[_0x4dfb('0x45')](_0x113ebb,_0x47030d[_0x4dfb('0x50')]),{'include':_0x47030d[_0x4dfb('0x3c')][_0x4dfb('0x46')]?[{'all':!![]}]:undefined})[_0x4dfb('0x2a')](function(_0x3af576){var _0x10567c=_0x47030d[_0x4dfb('0x51')][_0x4dfb('0x2c')]({'plain':!![]});if(!_0x10567c)throw new Error(_0x4dfb('0x52'));if(_0x10567c[_0x4dfb('0x5b')]===_0x4dfb('0x51')){var _0x321470=_0x3af576[_0x4dfb('0x2c')]({'plain':!![]});var _0x45cd35='CustomDashboards';return db[_0x4dfb('0x53')]['find']({'where':{'name':_0x45cd35,'userProfileId':_0x10567c[_0x4dfb('0x54')]},'raw':!![]})[_0x4dfb('0x2a')](function(_0x2e9964){if(_0x2e9964&&_0x2e9964['autoAssociation']===0x0){return db[_0x4dfb('0x2e')][_0x4dfb('0x4f')]({'name':_0x321470[_0x4dfb('0x31')],'resourceId':_0x321470['id'],'type':_0x2e9964['name'],'sectionId':_0x2e9964['id']},{})[_0x4dfb('0x2a')](function(){return _0x3af576;});}else{return _0x3af576;}})[_0x4dfb('0x4a')](function(_0xfa380b){logger[_0x4dfb('0x2f')](_0x4dfb('0x56'),_0xfa380b);throw _0xfa380b;});}return _0x3af576;});}})[_0x4dfb('0x2a')](respondWithResult(_0x4893dc,0xc9))[_0x4dfb('0x4a')](handleError(_0x4893dc,null));};exports[_0x4dfb('0x5c')]=function(_0x2009a9,_0xd90120){if(_0x2009a9[_0x4dfb('0x50')]['id']){delete _0x2009a9[_0x4dfb('0x50')]['id'];}return db['Dashboard'][_0x4dfb('0x4e')]({'where':{'id':_0x2009a9[_0x4dfb('0x57')]['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0xd90120,null))['then'](saveUpdates(_0x2009a9[_0x4dfb('0x50')],null))[_0x4dfb('0x2a')](respondWithResult(_0xd90120,null))[_0x4dfb('0x4a')](handleError(_0xd90120,null));};exports[_0x4dfb('0x2b')]=function(_0x350534,_0x3d8397){return db[_0x4dfb('0x32')]['find']({'where':{'id':_0x350534[_0x4dfb('0x57')]['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0x3d8397,null))[_0x4dfb('0x2a')](removeEntity(_0x3d8397,null))[_0x4dfb('0x4a')](handleError(_0x3d8397,null));};function widgetAttributes(_0x2c56a7){try{switch(_0x2c56a7[_0x4dfb('0x35')]){case _0x4dfb('0x5d'):return[{'name':'attrUrl','value':_0x2c56a7['attrUrl']||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x60')}];case _0x4dfb('0x61'):return[{'name':_0x4dfb('0x62'),'value':_0x2c56a7[_0x4dfb('0x62')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x4dfb('0x63'),'value':_0x2c56a7[_0x4dfb('0x63')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x64')},{'name':_0x4dfb('0x65'),'value':_0x2c56a7[_0x4dfb('0x65')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x66')},{'name':_0x4dfb('0x67'),'value':_0x2c56a7[_0x4dfb('0x67')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x2]?_0x2c56a7['attrs'][0x2][_0x4dfb('0x5f')]:undefined)||0xc}];case _0x4dfb('0x68'):return[{'name':_0x4dfb('0x69'),'value':_0x2c56a7['attrMetric']||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['value']:undefined)||_0x4dfb('0x6a')},{'name':_0x4dfb('0x6b'),'value':_0x2c56a7[_0x4dfb('0x6b')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||[]},{'name':_0x4dfb('0x67'),'value':_0x2c56a7[_0x4dfb('0x67')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x2]?_0x2c56a7['attrs'][0x2][_0x4dfb('0x5f')]:undefined)||0x14},{'name':_0x4dfb('0x6c'),'value':_0x2c56a7[_0x4dfb('0x6c')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x3]?_0x2c56a7[_0x4dfb('0x5e')][0x3][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x6d')},{'name':'attrEmailAccounts','value':_0x2c56a7[_0x4dfb('0x6e')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x4]?_0x2c56a7[_0x4dfb('0x5e')][0x4][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2c56a7[_0x4dfb('0x6f')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x5]?_0x2c56a7['attrs'][0x5][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x70'),'value':_0x2c56a7[_0x4dfb('0x70')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x6]?_0x2c56a7['attrs'][0x6][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c56a7['attrOpenchannelAccounts']||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x7]?_0x2c56a7['attrs'][0x7]['value']:undefined)||''},{'name':_0x4dfb('0x71'),'value':_0x2c56a7[_0x4dfb('0x71')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x8]?_0x2c56a7['attrs'][0x8][_0x4dfb('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c56a7[_0x4dfb('0x72')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x9]?_0x2c56a7[_0x4dfb('0x5e')][0x9][_0x4dfb('0x5f')]:undefined)||''}];case _0x4dfb('0x73'):case'pie-chart':return[{'name':'attrSerie1','value':_0x2c56a7[_0x4dfb('0x74')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['value']:undefined)||_0x4dfb('0x6a')},{'name':_0x4dfb('0x75'),'value':_0x2c56a7[_0x4dfb('0x75')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1]['value']:undefined)||null},{'name':_0x4dfb('0x76'),'value':_0x2c56a7['attrSerie3']||(_0x2c56a7['attrs']&&_0x2c56a7['attrs'][0x2]?_0x2c56a7[_0x4dfb('0x5e')][0x2][_0x4dfb('0x5f')]:undefined)||null},{'name':_0x4dfb('0x6b'),'value':_0x2c56a7[_0x4dfb('0x6b')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x3]?_0x2c56a7['attrs'][0x3][_0x4dfb('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x2c56a7[_0x4dfb('0x6c')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x4]?_0x2c56a7[_0x4dfb('0x5e')][0x4][_0x4dfb('0x5f')]:undefined)||_0x4dfb('0x6d')},{'name':_0x4dfb('0x6e'),'value':_0x2c56a7[_0x4dfb('0x6e')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x5]?_0x2c56a7['attrs'][0x5][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x6f'),'value':_0x2c56a7[_0x4dfb('0x6f')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x6]?_0x2c56a7[_0x4dfb('0x5e')][0x6][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x70'),'value':_0x2c56a7[_0x4dfb('0x70')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7['attrs'][0x7]?_0x2c56a7['attrs'][0x7][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x77'),'value':_0x2c56a7[_0x4dfb('0x77')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x8]?_0x2c56a7['attrs'][0x8][_0x4dfb('0x5f')]:undefined)||''},{'name':_0x4dfb('0x71'),'value':_0x2c56a7[_0x4dfb('0x71')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x9]?_0x2c56a7[_0x4dfb('0x5e')][0x9]['value']:undefined)||''},{'name':_0x4dfb('0x72'),'value':_0x2c56a7[_0x4dfb('0x72')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0xa]?_0x2c56a7[_0x4dfb('0x5e')][0xa][_0x4dfb('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0x4dfb('0x78'),'type':_0x2c56a7[_0x4dfb('0x79')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7[_0x4dfb('0x5e')][0x0]['type']:undefined)||null,'value':_0x2c56a7[_0x4dfb('0x78')]||(_0x2c56a7[_0x4dfb('0x5e')]&&_0x2c56a7[_0x4dfb('0x5e')][0x0]?_0x2c56a7['attrs'][0x0][_0x4dfb('0x5f')]:undefined)||null},{'name':_0x4dfb('0x7a'),'value':_0x2c56a7[_0x4dfb('0x7a')]||(_0x2c56a7['attrs']&&_0x2c56a7[_0x4dfb('0x5e')][0x1]?_0x2c56a7[_0x4dfb('0x5e')][0x1][_0x4dfb('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x417f19){logger[_0x4dfb('0x2f')](_0x4dfb('0x7b'),JSON[_0x4dfb('0x7c')](_0x417f19));return[];}}exports['addItem']=function(_0x1d649c,_0xf33622,_0x4b3774){if(_0x1d649c[_0x4dfb('0x50')]['id']){delete _0x1d649c[_0x4dfb('0x50')]['id'];}return db[_0x4dfb('0x32')][_0x4dfb('0x4e')]({'where':{'id':_0x1d649c['params']['id']}})[_0x4dfb('0x2a')](handleEntityNotFound(_0xf33622,null))[_0x4dfb('0x2a')](function(_0x107a7e){if(_0x107a7e){_0x1d649c[_0x4dfb('0x50')][_0x4dfb('0x7d')]=_0x107a7e['id'];_0x1d649c[_0x4dfb('0x50')]['attrs']=widgetAttributes(_0x1d649c['body']);return db[_0x4dfb('0x7e')]['create'](_0x1d649c[_0x4dfb('0x50')]);}})[_0x4dfb('0x2a')](respondWithResult(_0xf33622,null))['catch'](handleError(_0xf33622,null));};exports[_0x4dfb('0x7f')]=function(_0x1dca6e,_0x42a03e,_0x427b28){var _0x38a594={};var _0x38c7ef={};var _0x198cd4;var _0x8b3638;return db[_0x4dfb('0x32')][_0x4dfb('0x80')]({'where':{'id':_0x1dca6e[_0x4dfb('0x57')]['id']}})['then'](handleEntityNotFound(_0x42a03e,null))[_0x4dfb('0x2a')](function(_0x521c0a){if(_0x521c0a){_0x198cd4=_0x521c0a;_0x38c7ef[_0x4dfb('0x37')]=_[_0x4dfb('0x4c')](db[_0x4dfb('0x7e')][_0x4dfb('0x33')]);_0x38c7ef['query']=_[_0x4dfb('0x4c')](_0x1dca6e[_0x4dfb('0x3c')]);_0x38c7ef[_0x4dfb('0x4d')]=_[_0x4dfb('0x39')](_0x38c7ef[_0x4dfb('0x37')],_0x38c7ef[_0x4dfb('0x3c')]);_0x38a594['attributes']=_[_0x4dfb('0x39')](_0x38c7ef[_0x4dfb('0x37')],qs[_0x4dfb('0x3b')](_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x3b')]));_0x38a594[_0x4dfb('0x3a')]=_0x38a594[_0x4dfb('0x3a')][_0x4dfb('0x3d')]?_0x38a594['attributes']:_0x38c7ef[_0x4dfb('0x37')];_0x38a594[_0x4dfb('0x81')]=qs[_0x4dfb('0x40')](_0x1dca6e['query'][_0x4dfb('0x40')]);_0x38a594[_0x4dfb('0x43')]=qs['filters'](_[_0x4dfb('0x41')](_0x1dca6e['query'],_0x38c7ef[_0x4dfb('0x4d')]));if(_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x42')]){_0x38a594[_0x4dfb('0x43')]=_['merge'](_0x38a594[_0x4dfb('0x43')],{'$or':_[_0x4dfb('0x38')](_0x38a594[_0x4dfb('0x3a')],function(_0x1c1920){var _0x194d7f={};_0x194d7f[_0x1c1920]={'$like':'%'+_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x42')]+'%'};return _0x194d7f;})});}_0x38a594=_['merge']({},_0x38a594,_0x1dca6e[_0x4dfb('0x82')]);return _0x198cd4['getItems'](_0x38a594);}})['then'](function(_0x3bfa58){if(_0x3bfa58){_0x8b3638=_0x3bfa58[_0x4dfb('0x3d')];if(!_0x1dca6e[_0x4dfb('0x3c')][_0x4dfb('0x3e')](_0x4dfb('0x3f'))){_0x38a594['limit']=qs[_0x4dfb('0x23')](_0x1dca6e[_0x4dfb('0x3c')]['limit']);_0x38a594[_0x4dfb('0x21')]=qs[_0x4dfb('0x21')](_0x1dca6e[_0x4dfb('0x3c')]['offset']);}return _0x198cd4[_0x4dfb('0x7f')](_0x38a594);}})[_0x4dfb('0x2a')](function(_0xc6c898){if(_0xc6c898){return _0xc6c898?{'count':_0x8b3638,'rows':_0xc6c898}:null;}})[_0x4dfb('0x2a')](respondWithResult(_0x42a03e,null))[_0x4dfb('0x4a')](handleError(_0x42a03e,null));}; \ No newline at end of file +var _0x64f1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','CustomDashboards','UserProfileResource','end','error','stack','name','map','Dashboard','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','voice','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x64f1,0x175));var _0x164f=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x64f1[_0x680821];return _0x3f132c;};'use strict';var emlformat=require(_0x164f('0x0'));var rimraf=require(_0x164f('0x1'));var zipdir=require(_0x164f('0x2'));var jsonpatch=require(_0x164f('0x3'));var rp=require(_0x164f('0x4'));var moment=require(_0x164f('0x5'));var BPromise=require(_0x164f('0x6'));var Mustache=require(_0x164f('0x7'));var util=require(_0x164f('0x8'));var path=require(_0x164f('0x9'));var sox=require(_0x164f('0xa'));var csv=require(_0x164f('0xb'));var ejs=require(_0x164f('0xc'));var fs=require('fs');var fs_extra=require(_0x164f('0xd'));var _=require(_0x164f('0xe'));var squel=require(_0x164f('0xf'));var crypto=require(_0x164f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x164f('0x11'));var toCsv=require(_0x164f('0xb'));var querystring=require(_0x164f('0x12'));var Papa=require('papaparse');var Redis=require(_0x164f('0x13'));var authService=require(_0x164f('0x14'));var qs=require(_0x164f('0x15'));var as=require(_0x164f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x164f('0x17'));var utils=require(_0x164f('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x164f('0x19')]=_[_0x164f('0x1a')](config[_0x164f('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x164f('0x1b'))[_0x164f('0x1c')](socket);function respondWithStatusCode(_0x25eed9,_0xabbcfd){_0xabbcfd=_0xabbcfd||0xcc;return function(_0x370b77){if(_0x370b77){return _0x25eed9[_0x164f('0x1d')](_0xabbcfd);}return _0x25eed9[_0x164f('0x1e')](_0xabbcfd)['end']();};}function respondWithResult(_0x2a6c02,_0x1de842){_0x1de842=_0x1de842||0xc8;return function(_0x5c483f){if(_0x5c483f){return _0x2a6c02[_0x164f('0x1e')](_0x1de842)[_0x164f('0x1f')](_0x5c483f);}};}function respondWithFilteredResult(_0x4b3e24,_0x42784b){return function(_0x32c965){if(_0x32c965){var _0x32cf36=typeof _0x42784b[_0x164f('0x20')]===_0x164f('0x21')&&typeof _0x42784b[_0x164f('0x22')]===_0x164f('0x21');var _0x399e2b=_0x32c965[_0x164f('0x23')];var _0x59f7e1=_0x32cf36?0x0:_0x42784b[_0x164f('0x20')];var _0xc24a6c=_0x32cf36?_0x32c965[_0x164f('0x23')]:_0x42784b['offset']+_0x42784b[_0x164f('0x22')];var _0x4db555;if(_0xc24a6c>=_0x399e2b){_0xc24a6c=_0x399e2b;_0x4db555=0xc8;}else{_0x4db555=0xce;}_0x4b3e24['status'](_0x4db555);return _0x4b3e24[_0x164f('0x24')](_0x164f('0x25'),_0x59f7e1+'-'+_0xc24a6c+'/'+_0x399e2b)[_0x164f('0x1f')](_0x32c965);}return null;};}function patchUpdates(_0x29f1fc){return function(_0x33b2c9){try{jsonpatch['apply'](_0x33b2c9,_0x29f1fc,!![]);}catch(_0x1f2a29){return BPromise['reject'](_0x1f2a29);}return _0x33b2c9[_0x164f('0x26')]();};}function saveUpdates(_0x654af1,_0x26dd81){return function(_0x93bc37){if(_0x93bc37){return _0x93bc37[_0x164f('0x27')](_0x654af1)[_0x164f('0x28')](function(_0x4bccd4){return _0x4bccd4;});}return null;};}function removeEntity(_0x42a15a,_0xca85bd){return function(_0x5953ea){if(_0x5953ea){return _0x5953ea[_0x164f('0x29')]()['then'](function(){var _0x3ca2bd=_0x5953ea['get']({'plain':!![]});var _0x9c5b71=_0x164f('0x2a');return db[_0x164f('0x2b')][_0x164f('0x29')]({'where':{'type':_0x9c5b71,'resourceId':_0x3ca2bd['id']}})[_0x164f('0x28')](function(){return _0x5953ea;});})['then'](function(){_0x42a15a[_0x164f('0x1e')](0xcc)[_0x164f('0x2c')]();});}};}function handleEntityNotFound(_0x1f0d93,_0x962c74){return function(_0x23e383){if(!_0x23e383){_0x1f0d93[_0x164f('0x1d')](0x194);}return _0x23e383;};}function handleError(_0x487fe6,_0x5e671e){_0x5e671e=_0x5e671e||0x1f4;return function(_0x57fc1f){logger[_0x164f('0x2d')](_0x57fc1f[_0x164f('0x2e')]);if(_0x57fc1f[_0x164f('0x2f')]){delete _0x57fc1f[_0x164f('0x2f')];}_0x487fe6['status'](_0x5e671e)['send'](_0x57fc1f);};}exports['index']=function(_0x52193d,_0x221fe8){var _0x55a6a5={},_0x45edab={},_0x17cdcb={'count':0x0,'rows':[]};var _0x3c1b9e=_[_0x164f('0x30')](db[_0x164f('0x31')]['rawAttributes'],function(_0x35336d){return{'name':_0x35336d['fieldName'],'type':_0x35336d[_0x164f('0x32')][_0x164f('0x33')]};});_0x45edab[_0x164f('0x34')]=_[_0x164f('0x30')](_0x3c1b9e,_0x164f('0x2f'));_0x45edab[_0x164f('0x35')]=_[_0x164f('0x36')](_0x52193d[_0x164f('0x35')]);_0x45edab[_0x164f('0x37')]=_[_0x164f('0x38')](_0x45edab[_0x164f('0x34')],_0x45edab['query']);_0x55a6a5[_0x164f('0x39')]=_[_0x164f('0x38')](_0x45edab['model'],qs['fields'](_0x52193d[_0x164f('0x35')][_0x164f('0x3a')]));_0x55a6a5['attributes']=_0x55a6a5[_0x164f('0x39')][_0x164f('0x3b')]?_0x55a6a5[_0x164f('0x39')]:_0x45edab['model'];if(!_0x52193d[_0x164f('0x35')]['hasOwnProperty'](_0x164f('0x3c'))){_0x55a6a5[_0x164f('0x22')]=qs['limit'](_0x52193d[_0x164f('0x35')][_0x164f('0x22')]);_0x55a6a5['offset']=qs['offset'](_0x52193d[_0x164f('0x35')][_0x164f('0x20')]);}_0x55a6a5[_0x164f('0x3d')]=qs['sort'](_0x52193d[_0x164f('0x35')][_0x164f('0x3e')]);_0x55a6a5['where']=qs['filters'](_[_0x164f('0x3f')](_0x52193d[_0x164f('0x35')],_0x45edab[_0x164f('0x37')]),_0x3c1b9e);if(_0x52193d[_0x164f('0x35')][_0x164f('0x40')]){_0x55a6a5[_0x164f('0x41')]=_['merge'](_0x55a6a5[_0x164f('0x41')],{'$or':_[_0x164f('0x30')](_0x3c1b9e,function(_0xa98b09){if(_0xa98b09['type']!==_0x164f('0x42')){var _0x2b0657={};_0x2b0657[_0xa98b09[_0x164f('0x2f')]]={'$like':'%'+_0x52193d['query'][_0x164f('0x40')]+'%'};return _0x2b0657;}})});}_0x55a6a5=_[_0x164f('0x43')]({},_0x55a6a5,_0x52193d[_0x164f('0x44')]);var _0x36b38b={'where':_0x55a6a5['where']};return db[_0x164f('0x31')][_0x164f('0x23')](_0x36b38b)[_0x164f('0x28')](function(_0x9b981f){_0x17cdcb[_0x164f('0x23')]=_0x9b981f;if(_0x52193d[_0x164f('0x35')][_0x164f('0x45')]){_0x55a6a5[_0x164f('0x46')]=[{'all':!![]}];}return db[_0x164f('0x31')][_0x164f('0x47')](_0x55a6a5);})[_0x164f('0x28')](function(_0x5dd927){_0x17cdcb[_0x164f('0x48')]=_0x5dd927;return _0x17cdcb;})[_0x164f('0x28')](respondWithFilteredResult(_0x221fe8,_0x55a6a5))['catch'](handleError(_0x221fe8,null));};exports[_0x164f('0x49')]=function(_0x513558,_0x440574){var _0x411c67={'raw':![],'where':{'id':_0x513558[_0x164f('0x4a')]['id']}},_0x4fbb97={};_0x4fbb97[_0x164f('0x34')]=_['keys'](db[_0x164f('0x31')][_0x164f('0x4b')]);_0x4fbb97['query']=_[_0x164f('0x36')](_0x513558['query']);_0x4fbb97[_0x164f('0x37')]=_[_0x164f('0x38')](_0x4fbb97[_0x164f('0x34')],_0x4fbb97['query']);_0x411c67['attributes']=_[_0x164f('0x38')](_0x4fbb97[_0x164f('0x34')],qs[_0x164f('0x3a')](_0x513558['query'][_0x164f('0x3a')]));_0x411c67[_0x164f('0x39')]=_0x411c67['attributes']['length']?_0x411c67[_0x164f('0x39')]:_0x4fbb97['model'];if(_0x513558[_0x164f('0x35')][_0x164f('0x45')]){_0x411c67[_0x164f('0x46')]=[{'all':!![]}];}_0x411c67=_[_0x164f('0x43')]({},_0x411c67,_0x513558[_0x164f('0x44')]);return db[_0x164f('0x31')][_0x164f('0x4c')](_0x411c67)['then'](handleEntityNotFound(_0x440574,null))['then'](respondWithResult(_0x440574,null))[_0x164f('0x4d')](handleError(_0x440574,null));};exports[_0x164f('0x4e')]=function(_0x1422a0,_0x151caa){return db[_0x164f('0x31')]['create'](_0x1422a0[_0x164f('0x4f')],{})['then'](function(_0x3793bb){var _0x2bb109=_0x1422a0['user'][_0x164f('0x50')]({'plain':!![]});if(!_0x2bb109)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bb109[_0x164f('0x51')]===_0x164f('0x52')){var _0x2b776e=_0x3793bb[_0x164f('0x50')]({'plain':!![]});var _0x4b0aa1=_0x164f('0x2a');return db[_0x164f('0x53')]['find']({'where':{'name':_0x4b0aa1,'userProfileId':_0x2bb109[_0x164f('0x54')]},'raw':!![]})[_0x164f('0x28')](function(_0x4b4bd5){if(_0x4b4bd5&&_0x4b4bd5[_0x164f('0x55')]===0x0){return db[_0x164f('0x2b')][_0x164f('0x4e')]({'name':_0x2b776e['name'],'resourceId':_0x2b776e['id'],'type':_0x4b4bd5[_0x164f('0x2f')],'sectionId':_0x4b4bd5['id']},{})[_0x164f('0x28')](function(){return _0x3793bb;});}else{return _0x3793bb;}})['catch'](function(_0x28101d){logger[_0x164f('0x2d')](_0x164f('0x56'),_0x28101d);throw _0x28101d;});}return _0x3793bb;})[_0x164f('0x28')](respondWithResult(_0x151caa,0xc9))[_0x164f('0x4d')](handleError(_0x151caa,null));};exports[_0x164f('0x57')]=function(_0x51f2c6,_0x539f2d){var _0x26a490={'where':{'id':_0x51f2c6[_0x164f('0x4a')]['id']}},_0x4f83be={};_0x4f83be['model']=_[_0x164f('0x36')](db[_0x164f('0x31')][_0x164f('0x4b')]);_0x26a490[_0x164f('0x39')]=_[_0x164f('0x38')](_0x4f83be[_0x164f('0x34')],qs[_0x164f('0x3a')](_0x51f2c6['query'][_0x164f('0x3a')]));_0x26a490[_0x164f('0x39')]=_0x26a490[_0x164f('0x39')][_0x164f('0x3b')]?_0x26a490[_0x164f('0x39')]:_0x4f83be[_0x164f('0x34')];if(_0x51f2c6[_0x164f('0x35')][_0x164f('0x45')]){_0x26a490['include']=[{'all':!![]}];}_0x26a490=_[_0x164f('0x43')]({},_0x26a490,_0x51f2c6[_0x164f('0x44')]);return db[_0x164f('0x31')][_0x164f('0x4c')](_0x26a490)[_0x164f('0x28')](handleEntityNotFound(_0x539f2d,null))[_0x164f('0x28')](function(_0xd7b28d){if(_0xd7b28d){var _0x4de887=_0xd7b28d[_0x164f('0x50')]({'plain':!![]});_0x4de887=qs['omit'](_0x4de887,['id',_0x164f('0x58'),'updatedAt']);_0x51f2c6[_0x164f('0x4f')]=_[_0x164f('0x59')](_0x51f2c6[_0x164f('0x4f')],['id',_0x164f('0x58'),'updatedAt']);return db[_0x164f('0x31')]['create'](_['merge'](_0x4de887,_0x51f2c6[_0x164f('0x4f')]),{'include':_0x51f2c6['query'][_0x164f('0x45')]?[{'all':!![]}]:undefined})[_0x164f('0x28')](function(_0x312227){var _0x39e023=_0x51f2c6[_0x164f('0x52')][_0x164f('0x50')]({'plain':!![]});if(!_0x39e023)throw new Error(_0x164f('0x5a'));if(_0x39e023[_0x164f('0x51')]===_0x164f('0x52')){var _0x53a76e=_0x312227['get']({'plain':!![]});var _0x20c5e5=_0x164f('0x2a');return db['UserProfileSection'][_0x164f('0x4c')]({'where':{'name':_0x20c5e5,'userProfileId':_0x39e023[_0x164f('0x54')]},'raw':!![]})[_0x164f('0x28')](function(_0x55468f){if(_0x55468f&&_0x55468f['autoAssociation']===0x0){return db[_0x164f('0x2b')]['create']({'name':_0x53a76e[_0x164f('0x2f')],'resourceId':_0x53a76e['id'],'type':_0x55468f[_0x164f('0x2f')],'sectionId':_0x55468f['id']},{})[_0x164f('0x28')](function(){return _0x312227;});}else{return _0x312227;}})[_0x164f('0x4d')](function(_0x2e89db){logger[_0x164f('0x2d')](_0x164f('0x56'),_0x2e89db);throw _0x2e89db;});}return _0x312227;});}})[_0x164f('0x28')](respondWithResult(_0x539f2d,0xc9))[_0x164f('0x4d')](handleError(_0x539f2d,null));};exports['update']=function(_0x2c2378,_0x1a189b){if(_0x2c2378[_0x164f('0x4f')]['id']){delete _0x2c2378[_0x164f('0x4f')]['id'];}return db[_0x164f('0x31')][_0x164f('0x4c')]({'where':{'id':_0x2c2378[_0x164f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a189b,null))[_0x164f('0x28')](saveUpdates(_0x2c2378[_0x164f('0x4f')],null))[_0x164f('0x28')](respondWithResult(_0x1a189b,null))[_0x164f('0x4d')](handleError(_0x1a189b,null));};exports[_0x164f('0x29')]=function(_0x13de02,_0x2f9815){return db[_0x164f('0x31')]['find']({'where':{'id':_0x13de02[_0x164f('0x4a')]['id']}})[_0x164f('0x28')](handleEntityNotFound(_0x2f9815,null))[_0x164f('0x28')](removeEntity(_0x2f9815,null))[_0x164f('0x4d')](handleError(_0x2f9815,null));};function widgetAttributes(_0x47dad2){try{switch(_0x47dad2['type']){case'iframe':return[{'name':_0x164f('0x5b'),'value':_0x47dad2[_0x164f('0x5b')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x0]?_0x47dad2[_0x164f('0x5c')][0x0][_0x164f('0x5d')]:undefined)||_0x164f('0x5e')}];case _0x164f('0x5f'):return[{'name':_0x164f('0x60'),'value':_0x47dad2[_0x164f('0x60')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x0]?_0x47dad2[_0x164f('0x5c')][0x0][_0x164f('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x164f('0x61'),'value':_0x47dad2[_0x164f('0x61')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x0]?_0x47dad2[_0x164f('0x5c')][0x0][_0x164f('0x5d')]:undefined)||_0x164f('0x62')},{'name':'attrTimezone','value':_0x47dad2[_0x164f('0x63')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x1]?_0x47dad2[_0x164f('0x5c')][0x1][_0x164f('0x5d')]:undefined)||'0.00'},{'name':_0x164f('0x64'),'value':_0x47dad2['attrFontSize']||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x2]?_0x47dad2[_0x164f('0x5c')][0x2]['value']:undefined)||0xc}];case _0x164f('0x65'):return[{'name':_0x164f('0x66'),'value':_0x47dad2[_0x164f('0x66')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x0]?_0x47dad2[_0x164f('0x5c')][0x0][_0x164f('0x5d')]:undefined)||_0x164f('0x67')},{'name':_0x164f('0x68'),'value':_0x47dad2[_0x164f('0x68')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x1]?_0x47dad2['attrs'][0x1][_0x164f('0x5d')]:undefined)||[]},{'name':_0x164f('0x64'),'value':_0x47dad2[_0x164f('0x64')]||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x2]?_0x47dad2[_0x164f('0x5c')][0x2][_0x164f('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x47dad2['attrChannel']||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x3]?_0x47dad2[_0x164f('0x5c')][0x3][_0x164f('0x5d')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x47dad2[_0x164f('0x69')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x4]?_0x47dad2[_0x164f('0x5c')][0x4][_0x164f('0x5d')]:undefined)||''},{'name':_0x164f('0x6a'),'value':_0x47dad2[_0x164f('0x6a')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x5]?_0x47dad2[_0x164f('0x5c')][0x5]['value']:undefined)||''},{'name':_0x164f('0x6b'),'value':_0x47dad2[_0x164f('0x6b')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x6]?_0x47dad2[_0x164f('0x5c')][0x6][_0x164f('0x5d')]:undefined)||''},{'name':_0x164f('0x6c'),'value':_0x47dad2[_0x164f('0x6c')]||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x7]?_0x47dad2[_0x164f('0x5c')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x47dad2[_0x164f('0x6d')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x8]?_0x47dad2[_0x164f('0x5c')][0x8][_0x164f('0x5d')]:undefined)||''},{'name':_0x164f('0x6e'),'value':_0x47dad2['attrChatWebsites']||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x9]?_0x47dad2[_0x164f('0x5c')][0x9][_0x164f('0x5d')]:undefined)||''}];case'multibar-chart':case _0x164f('0x6f'):return[{'name':_0x164f('0x70'),'value':_0x47dad2[_0x164f('0x70')]||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x0]?_0x47dad2['attrs'][0x0][_0x164f('0x5d')]:undefined)||_0x164f('0x67')},{'name':_0x164f('0x71'),'value':_0x47dad2[_0x164f('0x71')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x1]?_0x47dad2['attrs'][0x1][_0x164f('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x47dad2[_0x164f('0x72')]||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x2]?_0x47dad2[_0x164f('0x5c')][0x2][_0x164f('0x5d')]:undefined)||null},{'name':_0x164f('0x68'),'value':_0x47dad2[_0x164f('0x68')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x3]?_0x47dad2[_0x164f('0x5c')][0x3]['value']:undefined)||[]},{'name':_0x164f('0x73'),'value':_0x47dad2[_0x164f('0x73')]||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x4]?_0x47dad2[_0x164f('0x5c')][0x4][_0x164f('0x5d')]:undefined)||_0x164f('0x74')},{'name':_0x164f('0x69'),'value':_0x47dad2[_0x164f('0x69')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x5]?_0x47dad2[_0x164f('0x5c')][0x5]['value']:undefined)||''},{'name':_0x164f('0x6a'),'value':_0x47dad2[_0x164f('0x6a')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x6]?_0x47dad2[_0x164f('0x5c')][0x6][_0x164f('0x5d')]:undefined)||''},{'name':_0x164f('0x6b'),'value':_0x47dad2[_0x164f('0x6b')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x7]?_0x47dad2[_0x164f('0x5c')][0x7][_0x164f('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x47dad2[_0x164f('0x6c')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x8]?_0x47dad2[_0x164f('0x5c')][0x8][_0x164f('0x5d')]:undefined)||''},{'name':_0x164f('0x6d'),'value':_0x47dad2[_0x164f('0x6d')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0x9]?_0x47dad2[_0x164f('0x5c')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x47dad2['attrChatWebsites']||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2[_0x164f('0x5c')][0xa]?_0x47dad2['attrs'][0xa][_0x164f('0x5d')]:undefined)||''}];case _0x164f('0x75'):return[{'name':_0x164f('0x76'),'type':_0x47dad2['reportType']||(_0x47dad2['attrs']&&_0x47dad2[_0x164f('0x5c')][0x0]?_0x47dad2[_0x164f('0x5c')][0x0][_0x164f('0x32')]:undefined)||null,'value':_0x47dad2[_0x164f('0x76')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x0]?_0x47dad2['attrs'][0x0][_0x164f('0x5d')]:undefined)||null},{'name':_0x164f('0x77'),'value':_0x47dad2[_0x164f('0x77')]||(_0x47dad2[_0x164f('0x5c')]&&_0x47dad2['attrs'][0x1]?_0x47dad2[_0x164f('0x5c')][0x1][_0x164f('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x428cbc){logger['error'](_0x164f('0x78'),JSON['stringify'](_0x428cbc));return[];}}exports[_0x164f('0x79')]=function(_0x1b9c05,_0x3544bb,_0x355898){if(_0x1b9c05[_0x164f('0x4f')]['id']){delete _0x1b9c05[_0x164f('0x4f')]['id'];}return db[_0x164f('0x31')][_0x164f('0x4c')]({'where':{'id':_0x1b9c05[_0x164f('0x4a')]['id']}})[_0x164f('0x28')](handleEntityNotFound(_0x3544bb,null))['then'](function(_0x521cae){if(_0x521cae){_0x1b9c05[_0x164f('0x4f')][_0x164f('0x7a')]=_0x521cae['id'];_0x1b9c05[_0x164f('0x4f')][_0x164f('0x5c')]=widgetAttributes(_0x1b9c05[_0x164f('0x4f')]);return db['DashboardItem'][_0x164f('0x4e')](_0x1b9c05[_0x164f('0x4f')]);}})[_0x164f('0x28')](respondWithResult(_0x3544bb,null))['catch'](handleError(_0x3544bb,null));};exports[_0x164f('0x7b')]=function(_0x265c4a,_0x1a24ce,_0xc2ff6d){var _0x273ad4={};var _0x11ba7f={};var _0x1cfa2e;var _0x1e6135;return db[_0x164f('0x31')][_0x164f('0x7c')]({'where':{'id':_0x265c4a[_0x164f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a24ce,null))[_0x164f('0x28')](function(_0x19ea0f){if(_0x19ea0f){_0x1cfa2e=_0x19ea0f;_0x11ba7f[_0x164f('0x34')]=_[_0x164f('0x36')](db[_0x164f('0x7d')][_0x164f('0x4b')]);_0x11ba7f[_0x164f('0x35')]=_['keys'](_0x265c4a[_0x164f('0x35')]);_0x11ba7f[_0x164f('0x37')]=_['intersection'](_0x11ba7f['model'],_0x11ba7f[_0x164f('0x35')]);_0x273ad4[_0x164f('0x39')]=_[_0x164f('0x38')](_0x11ba7f['model'],qs['fields'](_0x265c4a[_0x164f('0x35')]['fields']));_0x273ad4['attributes']=_0x273ad4[_0x164f('0x39')][_0x164f('0x3b')]?_0x273ad4[_0x164f('0x39')]:_0x11ba7f['model'];_0x273ad4[_0x164f('0x3d')]=qs[_0x164f('0x3e')](_0x265c4a[_0x164f('0x35')][_0x164f('0x3e')]);_0x273ad4[_0x164f('0x41')]=qs[_0x164f('0x37')](_[_0x164f('0x3f')](_0x265c4a[_0x164f('0x35')],_0x11ba7f[_0x164f('0x37')]));if(_0x265c4a[_0x164f('0x35')][_0x164f('0x40')]){_0x273ad4[_0x164f('0x41')]=_['merge'](_0x273ad4[_0x164f('0x41')],{'$or':_[_0x164f('0x30')](_0x273ad4[_0x164f('0x39')],function(_0x21573b){var _0x496b5b={};_0x496b5b[_0x21573b]={'$like':'%'+_0x265c4a[_0x164f('0x35')]['filter']+'%'};return _0x496b5b;})});}_0x273ad4=_[_0x164f('0x43')]({},_0x273ad4,_0x265c4a[_0x164f('0x44')]);return _0x1cfa2e[_0x164f('0x7b')](_0x273ad4);}})[_0x164f('0x28')](function(_0x1f9c9){if(_0x1f9c9){_0x1e6135=_0x1f9c9[_0x164f('0x3b')];if(!_0x265c4a[_0x164f('0x35')][_0x164f('0x7e')]('nolimit')){_0x273ad4[_0x164f('0x22')]=qs['limit'](_0x265c4a[_0x164f('0x35')][_0x164f('0x22')]);_0x273ad4[_0x164f('0x20')]=qs[_0x164f('0x20')](_0x265c4a[_0x164f('0x35')][_0x164f('0x20')]);}return _0x1cfa2e[_0x164f('0x7b')](_0x273ad4);}})[_0x164f('0x28')](function(_0x5668b8){if(_0x5668b8){return _0x5668b8?{'count':_0x1e6135,'rows':_0x5668b8}:null;}})[_0x164f('0x28')](respondWithResult(_0x1a24ce,null))['catch'](handleError(_0x1a24ce,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 67a4b22..bcdc299 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 _0xf8af=['Dashboard','setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x470c21,_0x4575dc){var _0x4d80b5=function(_0x249e59){while(--_0x249e59){_0x470c21['push'](_0x470c21['shift']());}};_0x4d80b5(++_0x4575dc);}(_0xf8af,0x8b));var _0xff8a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf8af[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0xff8a('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xff8a('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xff8a('0x2')](0x0);var events={'afterCreate':_0xff8a('0x3'),'afterUpdate':_0xff8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b1bb0){return function(_0x460bf6,_0x11cfa2,_0x3bd9c2){DashboardEvents['emit'](_0x7b1bb0+':'+_0x460bf6['id'],_0x460bf6);DashboardEvents['emit'](_0x7b1bb0,_0x460bf6);_0x3bd9c2(null);};}for(var e in events){if(events[_0xff8a('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xff8a('0x6')]=DashboardEvents; \ No newline at end of file +var _0x6515=['../../mysqldb','Dashboard','save','update','remove','emit','hook','exports','events'];(function(_0x1803b6,_0x26e18e){var _0x54a55f=function(_0x5dff0){while(--_0x5dff0){_0x1803b6['push'](_0x1803b6['shift']());}};_0x54a55f(++_0x26e18e);}(_0x6515,0x1e5));var _0x5651=function(_0x473cd8,_0x505ae6){_0x473cd8=_0x473cd8-0x0;var _0x5b940e=_0x6515[_0x473cd8];return _0x5b940e;};'use strict';var EventEmitter=require(_0x5651('0x0'));var Dashboard=require(_0x5651('0x1'))['db'][_0x5651('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5651('0x3'),'afterUpdate':_0x5651('0x4'),'afterDestroy':_0x5651('0x5')};function emitEvent(_0x299ab0){return function(_0x1f4316,_0x188390,_0x27f505){DashboardEvents[_0x5651('0x6')](_0x299ab0+':'+_0x1f4316['id'],_0x1f4316);DashboardEvents[_0x5651('0x6')](_0x299ab0,_0x1f4316);_0x27f505(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x5651('0x7')](e,emitEvent(event));}}module[_0x5651('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 1f09c38..3a0d754 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 _0xe469=['bluebird','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x2c0720,_0x1db601){var _0x19f1aa=function(_0x4c34f4){while(--_0x4c34f4){_0x2c0720['push'](_0x2c0720['shift']());}};_0x19f1aa(++_0x1db601);}(_0xe469,0x79));var _0x9e46=function(_0x9c22da,_0xd059c3){_0x9c22da=_0x9c22da-0x0;var _0x386c9a=_0xe469[_0x9c22da];return _0x386c9a;};'use strict';var _=require(_0x9e46('0x0'));var util=require(_0x9e46('0x1'));var logger=require(_0x9e46('0x2'))(_0x9e46('0x3'));var moment=require(_0x9e46('0x4'));var BPromise=require(_0x9e46('0x5'));var rp=require(_0x9e46('0x6'));var fs=require('fs');var path=require(_0x9e46('0x7'));var rimraf=require(_0x9e46('0x8'));var config=require('../../config/environment');var attributes=require(_0x9e46('0x9'));module[_0x9e46('0xa')]=function(_0x1acda9,_0xc9d837){return _0x1acda9[_0x9e46('0xb')](_0x9e46('0xc'),attributes,{'tableName':_0x9e46('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87d0=['moment','bluebird','request-promise','../../config/environment','./dashboard.attributes','define','dashboards','lodash','util','../../config/logger','api'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x87d0,0x193));var _0x087d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x87d0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x087d('0x0'));var util=require(_0x087d('0x1'));var logger=require(_0x087d('0x2'))(_0x087d('0x3'));var moment=require(_0x087d('0x4'));var BPromise=require(_0x087d('0x5'));var rp=require(_0x087d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x087d('0x7'));var attributes=require(_0x087d('0x8'));module['exports']=function(_0x3e90de,_0x23946c){return _0x3e90de[_0x087d('0x9')]('Dashboard',attributes,{'tableName':_0x087d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 25cc0e5..7fd776e 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 _0x00c9=['client','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x244bcb,_0x3feee2){var _0xdae57a=function(_0x27e0c7){while(--_0x27e0c7){_0x244bcb['push'](_0x244bcb['shift']());}};_0xdae57a(++_0x3feee2);}(_0x00c9,0x1ce));var _0x900c=function(_0x32d4ed,_0x328178){_0x32d4ed=_0x32d4ed-0x0;var _0x1c48e1=_0x00c9[_0x32d4ed];return _0x1c48e1;};'use strict';var _=require('lodash');var util=require(_0x900c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x900c('0x1'));var fs=require('fs');var Redis=require(_0x900c('0x2'));var db=require(_0x900c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x900c('0x4'));var config=require(_0x900c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x900c('0x6')]['http']({'port':0x232a});config['redis']=_[_0x900c('0x7')](config[_0x900c('0x8')],{'host':_0x900c('0x9'),'port':0x18eb});var socket=require(_0x900c('0xa'))(new Redis(config[_0x900c('0x8')]));require(_0x900c('0xb'))[_0x900c('0xc')](socket);function respondWithRpcPromise(_0x329b83,_0xcdca3,_0x40d978){return new BPromise(function(_0x3937ca,_0x583622){return client[_0x900c('0xd')](_0x329b83,_0x40d978)[_0x900c('0xe')](function(_0x505eff){logger[_0x900c('0xf')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x900c('0x10'));logger[_0x900c('0x11')](_0x900c('0x12'),_0xcdca3,'request\x20sent',JSON[_0x900c('0x13')](_0x505eff));if(_0x505eff[_0x900c('0x14')]){if(_0x505eff[_0x900c('0x14')][_0x900c('0x15')]===0x1f4){logger['error'](_0x900c('0x16'),_0xcdca3,_0x505eff['error'][_0x900c('0x17')]);return _0x583622(_0x505eff['error'][_0x900c('0x17')]);}logger[_0x900c('0x14')](_0x900c('0x16'),_0xcdca3,_0x505eff[_0x900c('0x14')][_0x900c('0x17')]);return _0x3937ca(_0x505eff[_0x900c('0x14')]['message']);}else{logger[_0x900c('0xf')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x900c('0x10'));_0x3937ca(_0x505eff[_0x900c('0x18')][_0x900c('0x17')]);}})[_0x900c('0x19')](function(_0x154d06){logger[_0x900c('0x14')]('Dashboard,\x20%s,\x20%s',_0xcdca3,_0x154d06);_0x583622(_0x154d06);});});} \ No newline at end of file +var _0xb0fc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','request\x20sent','stringify','code','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x483351,_0xb26b44){var _0x2f9d65=function(_0x4b88eb){while(--_0x4b88eb){_0x483351['push'](_0x483351['shift']());}};_0x2f9d65(++_0xb26b44);}(_0xb0fc,0x138));var _0xcb0f=function(_0x513a56,_0x2b2a73){_0x513a56=_0x513a56-0x0;var _0x220be6=_0xb0fc[_0x513a56];return _0x220be6;};'use strict';var _=require(_0xcb0f('0x0'));var util=require(_0xcb0f('0x1'));var moment=require(_0xcb0f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb0f('0x3'));var fs=require('fs');var Redis=require(_0xcb0f('0x4'));var db=require(_0xcb0f('0x5'))['db'];var utils=require(_0xcb0f('0x6'));var logger=require(_0xcb0f('0x7'))(_0xcb0f('0x8'));var config=require(_0xcb0f('0x9'));var jayson=require(_0xcb0f('0xa'));var client=jayson[_0xcb0f('0xb')][_0xcb0f('0xc')]({'port':0x232a});config['redis']=_[_0xcb0f('0xd')](config['redis'],{'host':_0xcb0f('0xe'),'port':0x18eb});var socket=require(_0xcb0f('0xf'))(new Redis(config[_0xcb0f('0x10')]));require('./dashboard.socket')[_0xcb0f('0x11')](socket);function respondWithRpcPromise(_0x1b780f,_0x2d4b31,_0x240b2f){return new BPromise(function(_0x2ce8f2,_0x103ae4){return client[_0xcb0f('0x12')](_0x1b780f,_0x240b2f)[_0xcb0f('0x13')](function(_0x2383c3){logger[_0xcb0f('0x14')]('Dashboard,\x20%s,\x20%s',_0x2d4b31,_0xcb0f('0x15'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x2d4b31,_0xcb0f('0x15'),JSON[_0xcb0f('0x16')](_0x2383c3));if(_0x2383c3['error']){if(_0x2383c3['error'][_0xcb0f('0x17')]===0x1f4){logger[_0xcb0f('0x18')](_0xcb0f('0x19'),_0x2d4b31,_0x2383c3[_0xcb0f('0x18')]['message']);return _0x103ae4(_0x2383c3[_0xcb0f('0x18')][_0xcb0f('0x1a')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x2d4b31,_0x2383c3[_0xcb0f('0x18')][_0xcb0f('0x1a')]);return _0x2ce8f2(_0x2383c3[_0xcb0f('0x18')]['message']);}else{logger[_0xcb0f('0x14')](_0xcb0f('0x19'),_0x2d4b31,'request\x20sent');_0x2ce8f2(_0x2383c3[_0xcb0f('0x1b')][_0xcb0f('0x1a')]);}})[_0xcb0f('0x1c')](function(_0x4d2006){logger['error'](_0xcb0f('0x19'),_0x2d4b31,_0x4d2006);_0x103ae4(_0x4d2006);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index a1dd93b..2693879 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 _0xa347=['dashboard:','update','removeListener','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa347,0x79));var _0x7a34=function(_0x3543e7,_0x501fcf){_0x3543e7=_0x3543e7-0x0;var _0x42df23=_0xa347[_0x3543e7];return _0x42df23;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save','remove',_0x7a34('0x0')];function createListener(_0x2c645c,_0x229822){return function(_0xc52d7c){_0x229822['emit'](_0x2c645c,_0xc52d7c);};}function removeListener(_0x40519e,_0x4aba74){return function(){DashboardEvents[_0x7a34('0x1')](_0x40519e,_0x4aba74);};}exports['register']=function(_0x311661){for(var _0x36e3f9=0x0,_0x215898=events[_0x7a34('0x2')];_0x36e3f9<_0x215898;_0x36e3f9++){var _0x153338=events[_0x36e3f9];var _0x2e0fe1=createListener(_0x7a34('0x3')+_0x153338,_0x311661);DashboardEvents['on'](_0x153338,_0x2e0fe1);}}; \ No newline at end of file +var _0x3299=['length','dashboard:','./dashboard.events','save','update','emit','removeListener','register'];(function(_0x2c9f51,_0xb44186){var _0x3f20f1=function(_0x3a1b4d){while(--_0x3a1b4d){_0x2c9f51['push'](_0x2c9f51['shift']());}};_0x3f20f1(++_0xb44186);}(_0x3299,0x172));var _0x9329=function(_0x508a9d,_0x5e9b02){_0x508a9d=_0x508a9d-0x0;var _0x17fb8e=_0x3299[_0x508a9d];return _0x17fb8e;};'use strict';var DashboardEvents=require(_0x9329('0x0'));var events=[_0x9329('0x1'),'remove',_0x9329('0x2')];function createListener(_0x16d4ab,_0x22efd8){return function(_0x114868){_0x22efd8[_0x9329('0x3')](_0x16d4ab,_0x114868);};}function removeListener(_0x55f89a,_0x241b21){return function(){DashboardEvents[_0x9329('0x4')](_0x55f89a,_0x241b21);};}exports[_0x9329('0x5')]=function(_0x4b7158){for(var _0x233d09=0x0,_0x4df635=events[_0x9329('0x6')];_0x233d09<_0x4df635;_0x233d09++){var _0x129725=events[_0x233d09];var _0x46b3e8=createListener(_0x9329('0x7')+_0x129725,_0x4b7158);DashboardEvents['on'](_0x129725,_0x46b3e8);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 733fdbb..beba888 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 _0x9fe2=['isAuthenticated','index','/:id','/:id/items','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get'];(function(_0x3c5163,_0xac9816){var _0x2943c=function(_0x5daca7){while(--_0x5daca7){_0x3c5163['push'](_0x3c5163['shift']());}};_0x2943c(++_0xac9816);}(_0x9fe2,0x68));var _0x29fe=function(_0x43e628,_0x55c96a){_0x43e628=_0x43e628-0x0;var _0x3193da=_0x9fe2[_0x43e628];return _0x3193da;};'use strict';var multer=require(_0x29fe('0x0'));var util=require(_0x29fe('0x1'));var path=require(_0x29fe('0x2'));var timeout=require(_0x29fe('0x3'));var express=require(_0x29fe('0x4'));var router=express[_0x29fe('0x5')]();var fs_extra=require(_0x29fe('0x6'));var auth=require(_0x29fe('0x7'));var interaction=require(_0x29fe('0x8'));var config=require('../../config/environment');var controller=require(_0x29fe('0x9'));router[_0x29fe('0xa')]('/',auth[_0x29fe('0xb')](),controller[_0x29fe('0xc')]);router[_0x29fe('0xa')](_0x29fe('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x29fe('0xe'),auth[_0x29fe('0xb')](),controller['getItems']);router[_0x29fe('0xf')]('/',auth[_0x29fe('0xb')](),controller['create']);router['post'](_0x29fe('0x10'),auth['isAuthenticated'](),controller[_0x29fe('0x11')]);router[_0x29fe('0xf')](_0x29fe('0xe'),auth[_0x29fe('0xb')](),controller['addItem']);router[_0x29fe('0x12')](_0x29fe('0xd'),auth[_0x29fe('0xb')](),controller[_0x29fe('0x13')]);router[_0x29fe('0x14')](_0x29fe('0xd'),auth[_0x29fe('0xb')](),controller[_0x29fe('0x15')]);module[_0x29fe('0x16')]=router; \ No newline at end of file +var _0x5b32=['create','/:id/clone','clone','addItem','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post'];(function(_0x153219,_0x3ad675){var _0x54ffee=function(_0x5e3b1d){while(--_0x5e3b1d){_0x153219['push'](_0x153219['shift']());}};_0x54ffee(++_0x3ad675);}(_0x5b32,0x140));var _0x25b3=function(_0x372b53,_0x376a30){_0x372b53=_0x372b53-0x0;var _0x10b540=_0x5b32[_0x372b53];return _0x10b540;};'use strict';var multer=require(_0x25b3('0x0'));var util=require(_0x25b3('0x1'));var path=require(_0x25b3('0x2'));var timeout=require(_0x25b3('0x3'));var express=require('express');var router=express[_0x25b3('0x4')]();var fs_extra=require(_0x25b3('0x5'));var auth=require(_0x25b3('0x6'));var interaction=require(_0x25b3('0x7'));var config=require('../../config/environment');var controller=require(_0x25b3('0x8'));router[_0x25b3('0x9')]('/',auth[_0x25b3('0xa')](),controller[_0x25b3('0xb')]);router[_0x25b3('0x9')](_0x25b3('0xc'),auth[_0x25b3('0xa')](),controller[_0x25b3('0xd')]);router[_0x25b3('0x9')](_0x25b3('0xe'),auth[_0x25b3('0xa')](),controller['getItems']);router[_0x25b3('0xf')]('/',auth['isAuthenticated'](),controller[_0x25b3('0x10')]);router[_0x25b3('0xf')](_0x25b3('0x11'),auth['isAuthenticated'](),controller[_0x25b3('0x12')]);router[_0x25b3('0xf')]('/:id/items',auth['isAuthenticated'](),controller[_0x25b3('0x13')]);router[_0x25b3('0x14')]('/:id',auth[_0x25b3('0xa')](),controller[_0x25b3('0x15')]);router[_0x25b3('0x16')](_0x25b3('0xc'),auth['isAuthenticated'](),controller[_0x25b3('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 25cdd71..7b4d8c9 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 _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x2c039d,_0x2b43fe){var _0x40b446=function(_0x558253){while(--_0x558253){_0x2c039d['push'](_0x2c039d['shift']());}};_0x40b446(++_0x2b43fe);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2618eb,_0x235b1d){_0x2618eb=_0x2618eb-0x0;var _0x41a50b=_0xc6ac[_0x2618eb];return _0x41a50b;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x219a85,_0xc6db76){var _0x2c7128=function(_0x3c4bc6){while(--_0x3c4bc6){_0x219a85['push'](_0x219a85['shift']());}};_0x2c7128(++_0xc6db76);}(_0x687b,0x14a));var _0xb687=function(_0x5ace25,_0x536239){_0x5ace25=_0x5ace25-0x0;var _0x4ba17a=_0x687b[_0x5ace25];return _0x4ba17a;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'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 fb1ccfc..1682f11 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 _0x82f8=['update','then','destroy','end','stack','name','send','show','params','model','keys','rawAttributes','intersection','attributes','fields','query','includeAll','options','DashboardItem','catch','find','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','stringify','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save'];(function(_0x4defce,_0x17354f){var _0x21a214=function(_0x48936c){while(--_0x48936c){_0x4defce['push'](_0x4defce['shift']());}};_0x21a214(++_0x17354f);}(_0x82f8,0x157));var _0x882f=function(_0x12a5cb,_0xa34c3f){_0x12a5cb=_0x12a5cb-0x0;var _0x2246e6=_0x82f8[_0x12a5cb];return _0x2246e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x882f('0x0'));var zipdir=require(_0x882f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x882f('0x2'));var moment=require(_0x882f('0x3'));var BPromise=require(_0x882f('0x4'));var Mustache=require(_0x882f('0x5'));var util=require(_0x882f('0x6'));var path=require(_0x882f('0x7'));var sox=require(_0x882f('0x8'));var csv=require(_0x882f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x882f('0xa'));var squel=require(_0x882f('0xb'));var crypto=require(_0x882f('0xc'));var jsforce=require(_0x882f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x882f('0x9'));var querystring=require('querystring');var Papa=require(_0x882f('0xe'));var Redis=require('ioredis');var authService=require(_0x882f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x882f('0x10'));var logger=require(_0x882f('0x11'))(_0x882f('0x12'));var utils=require(_0x882f('0x13'));var config=require(_0x882f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x882f('0x15')]=_[_0x882f('0x16')](config[_0x882f('0x15')],{'host':_0x882f('0x17'),'port':0x18eb});var socket=require(_0x882f('0x18'))(new Redis(config[_0x882f('0x15')]));require(_0x882f('0x19'))['register'](socket);function respondWithStatusCode(_0x33740b,_0x422e91){_0x422e91=_0x422e91||0xcc;return function(_0x21381d){if(_0x21381d){return _0x33740b[_0x882f('0x1a')](_0x422e91);}return _0x33740b['status'](_0x422e91)['end']();};}function respondWithResult(_0x4e9b6e,_0x264da8){_0x264da8=_0x264da8||0xc8;return function(_0x187ce1){if(_0x187ce1){return _0x4e9b6e[_0x882f('0x1b')](_0x264da8)[_0x882f('0x1c')](_0x187ce1);}};}function respondWithFilteredResult(_0x3f72c2,_0x1420bf){return function(_0x3bd47c){if(_0x3bd47c){var _0x67cc4b=typeof _0x1420bf['offset']===_0x882f('0x1d')&&typeof _0x1420bf['limit']==='undefined';var _0xaa6bcb=_0x3bd47c[_0x882f('0x1e')];var _0x4242ed=_0x67cc4b?0x0:_0x1420bf[_0x882f('0x1f')];var _0x54957a=_0x67cc4b?_0x3bd47c[_0x882f('0x1e')]:_0x1420bf[_0x882f('0x1f')]+_0x1420bf[_0x882f('0x20')];var _0x421aaf;if(_0x54957a>=_0xaa6bcb){_0x54957a=_0xaa6bcb;_0x421aaf=0xc8;}else{_0x421aaf=0xce;}_0x3f72c2[_0x882f('0x1b')](_0x421aaf);return _0x3f72c2[_0x882f('0x21')](_0x882f('0x22'),_0x4242ed+'-'+_0x54957a+'/'+_0xaa6bcb)[_0x882f('0x1c')](_0x3bd47c);}return null;};}function patchUpdates(_0x251ed0){return function(_0x4b72ca){try{jsonpatch['apply'](_0x4b72ca,_0x251ed0,!![]);}catch(_0x4c0a93){return BPromise[_0x882f('0x23')](_0x4c0a93);}return _0x4b72ca[_0x882f('0x24')]();};}function saveUpdates(_0x11298b,_0x9ce278){return function(_0x1eea66){if(_0x1eea66){return _0x1eea66[_0x882f('0x25')](_0x11298b)[_0x882f('0x26')](function(_0x2d6f58){return _0x2d6f58;});}return null;};}function removeEntity(_0x1bfc1d,_0x4f24f1){return function(_0x42a827){if(_0x42a827){return _0x42a827[_0x882f('0x27')]()['then'](function(){_0x1bfc1d['status'](0xcc)[_0x882f('0x28')]();});}};}function handleEntityNotFound(_0x46b9e8,_0xd284e0){return function(_0x4cf987){if(!_0x4cf987){_0x46b9e8[_0x882f('0x1a')](0x194);}return _0x4cf987;};}function handleError(_0x2a84a4,_0x101711){_0x101711=_0x101711||0x1f4;return function(_0x29fc23){logger['error'](_0x29fc23[_0x882f('0x29')]);if(_0x29fc23[_0x882f('0x2a')]){delete _0x29fc23[_0x882f('0x2a')];}_0x2a84a4[_0x882f('0x1b')](_0x101711)[_0x882f('0x2b')](_0x29fc23);};}exports[_0x882f('0x2c')]=function(_0x340e9b,_0x862f1b){var _0x299f62={'raw':![],'where':{'id':_0x340e9b[_0x882f('0x2d')]['id']}},_0x46cb78={};_0x46cb78[_0x882f('0x2e')]=_[_0x882f('0x2f')](db['DashboardItem'][_0x882f('0x30')]);_0x46cb78['query']=_[_0x882f('0x2f')](_0x340e9b['query']);_0x46cb78['filters']=_[_0x882f('0x31')](_0x46cb78[_0x882f('0x2e')],_0x46cb78['query']);_0x299f62[_0x882f('0x32')]=_[_0x882f('0x31')](_0x46cb78[_0x882f('0x2e')],qs[_0x882f('0x33')](_0x340e9b[_0x882f('0x34')][_0x882f('0x33')]));_0x299f62['attributes']=_0x299f62['attributes']['length']?_0x299f62[_0x882f('0x32')]:_0x46cb78['model'];if(_0x340e9b[_0x882f('0x34')][_0x882f('0x35')]){_0x299f62['include']=[{'all':!![]}];}_0x299f62=_['merge']({},_0x299f62,_0x340e9b[_0x882f('0x36')]);return db[_0x882f('0x37')]['find'](_0x299f62)[_0x882f('0x26')](handleEntityNotFound(_0x862f1b,null))[_0x882f('0x26')](respondWithResult(_0x862f1b,null))[_0x882f('0x38')](handleError(_0x862f1b,null));};exports[_0x882f('0x27')]=function(_0xafbe46,_0x4d343d){return db[_0x882f('0x37')][_0x882f('0x39')]({'where':{'id':_0xafbe46[_0x882f('0x2d')]['id']}})[_0x882f('0x26')](handleEntityNotFound(_0x4d343d,null))[_0x882f('0x26')](removeEntity(_0x4d343d,null))[_0x882f('0x38')](handleError(_0x4d343d,null));};function widgetAttributes(_0x1a6210){try{switch(_0x1a6210[_0x882f('0x3a')]){case'iframe':return[{'name':_0x882f('0x3b'),'value':_0x1a6210[_0x882f('0x3b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||_0x882f('0x3e')}];case _0x882f('0x3f'):return[{'name':'attrPath','value':_0x1a6210[_0x882f('0x40')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x41'):return[{'name':'attrHourFormat','value':_0x1a6210[_0x882f('0x42')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210['attrs'][0x0]['value']:undefined)||_0x882f('0x43')},{'name':_0x882f('0x44'),'value':_0x1a6210[_0x882f('0x44')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1][_0x882f('0x3d')]:undefined)||_0x882f('0x45')},{'name':_0x882f('0x46'),'value':_0x1a6210[_0x882f('0x46')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||0xc}];case _0x882f('0x47'):return[{'name':_0x882f('0x48'),'value':_0x1a6210[_0x882f('0x48')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1a6210['attrVoiceQueues']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x1]?_0x1a6210['attrs'][0x1][_0x882f('0x3d')]:undefined)||[]},{'name':_0x882f('0x46'),'value':_0x1a6210[_0x882f('0x46')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||0x14},{'name':_0x882f('0x49'),'value':_0x1a6210['attrChannel']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x3]?_0x1a6210[_0x882f('0x3c')][0x3][_0x882f('0x3d')]:undefined)||_0x882f('0x4a')},{'name':'attrEmailAccounts','value':_0x1a6210[_0x882f('0x4b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x4]?_0x1a6210[_0x882f('0x3c')][0x4][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4c'),'value':_0x1a6210['attrFaxAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x5]?_0x1a6210[_0x882f('0x3c')][0x5][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4d'),'value':_0x1a6210[_0x882f('0x4d')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x6]?_0x1a6210[_0x882f('0x3c')][0x6][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4e'),'value':_0x1a6210['attrOpenchannelAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x7]?_0x1a6210[_0x882f('0x3c')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1a6210[_0x882f('0x4f')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x8]?_0x1a6210[_0x882f('0x3c')][0x8][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x50'),'value':_0x1a6210[_0x882f('0x50')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x9]?_0x1a6210['attrs'][0x9][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x51'):case _0x882f('0x52'):return[{'name':_0x882f('0x53'),'value':_0x1a6210[_0x882f('0x53')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||_0x882f('0x54')},{'name':_0x882f('0x55'),'value':_0x1a6210[_0x882f('0x55')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1][_0x882f('0x3d')]:undefined)||null},{'name':_0x882f('0x56'),'value':_0x1a6210[_0x882f('0x56')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x2]?_0x1a6210[_0x882f('0x3c')][0x2][_0x882f('0x3d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1a6210[_0x882f('0x57')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x3]?_0x1a6210[_0x882f('0x3c')][0x3][_0x882f('0x3d')]:undefined)||[]},{'name':_0x882f('0x49'),'value':_0x1a6210[_0x882f('0x49')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x4]?_0x1a6210[_0x882f('0x3c')][0x4][_0x882f('0x3d')]:undefined)||_0x882f('0x4a')},{'name':_0x882f('0x4b'),'value':_0x1a6210[_0x882f('0x4b')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0x5]?_0x1a6210[_0x882f('0x3c')][0x5][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4c'),'value':_0x1a6210[_0x882f('0x4c')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x6]?_0x1a6210[_0x882f('0x3c')][0x6]['value']:undefined)||''},{'name':_0x882f('0x4d'),'value':_0x1a6210[_0x882f('0x4d')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x7]?_0x1a6210['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1a6210['attrOpenchannelAccounts']||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x8]?_0x1a6210[_0x882f('0x3c')][0x8][_0x882f('0x3d')]:undefined)||''},{'name':_0x882f('0x4f'),'value':_0x1a6210['attrWhatsappAccounts']||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x9]?_0x1a6210[_0x882f('0x3c')][0x9][_0x882f('0x3d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a6210[_0x882f('0x50')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210[_0x882f('0x3c')][0xa]?_0x1a6210[_0x882f('0x3c')][0xa][_0x882f('0x3d')]:undefined)||''}];case _0x882f('0x58'):return[{'name':_0x882f('0x59'),'type':_0x1a6210[_0x882f('0x5a')]||(_0x1a6210[_0x882f('0x3c')]&&_0x1a6210['attrs'][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3a')]:undefined)||null,'value':_0x1a6210['attrReport']||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x0]?_0x1a6210[_0x882f('0x3c')][0x0][_0x882f('0x3d')]:undefined)||null},{'name':_0x882f('0x5b'),'value':_0x1a6210[_0x882f('0x5b')]||(_0x1a6210['attrs']&&_0x1a6210[_0x882f('0x3c')][0x1]?_0x1a6210[_0x882f('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3557f3){logger['error']('widgetAttributes:\x20%s',JSON[_0x882f('0x5c')](_0x3557f3));return[];}}exports[_0x882f('0x5d')]=function(_0x5b185c,_0x2d0784){if(_0x5b185c['body']){_0x5b185c['body'][_0x882f('0x3c')]=widgetAttributes(_0x5b185c[_0x882f('0x5e')]);}return db[_0x882f('0x37')][_0x882f('0x5d')](_0x5b185c['body'],{})[_0x882f('0x26')](respondWithResult(_0x2d0784,0xc9))[_0x882f('0x38')](handleError(_0x2d0784,null));};exports[_0x882f('0x25')]=function(_0x222f5d,_0x262c62){if(_0x222f5d[_0x882f('0x5e')]['id']){delete _0x222f5d['body']['id'];}_0x222f5d['body'][_0x882f('0x3c')]=widgetAttributes(_0x222f5d['body']);return db[_0x882f('0x37')]['find']({'where':{'id':_0x222f5d['params']['id']}})['then'](handleEntityNotFound(_0x262c62,null))[_0x882f('0x26')](saveUpdates(_0x222f5d[_0x882f('0x5e')],null))['then'](respondWithResult(_0x262c62,null))[_0x882f('0x38')](handleError(_0x262c62,null));}; \ No newline at end of file +var _0x96aa=['body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','sendStatus','name','send','show','params','model','DashboardItem','rawAttributes','keys','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','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','attrReport','reportType','type','attrRefresh','error','create'];(function(_0x50d28c,_0x4a582e){var _0x167e7c=function(_0x584889){while(--_0x584889){_0x50d28c['push'](_0x50d28c['shift']());}};_0x167e7c(++_0x4a582e);}(_0x96aa,0x67));var _0xa96a=function(_0x80090e,_0x1e4d75){_0x80090e=_0x80090e-0x0;var _0x2da906=_0x96aa[_0x80090e];return _0x2da906;};'use strict';var emlformat=require(_0xa96a('0x0'));var rimraf=require(_0xa96a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa96a('0x2'));var rp=require(_0xa96a('0x3'));var moment=require(_0xa96a('0x4'));var BPromise=require(_0xa96a('0x5'));var Mustache=require(_0xa96a('0x6'));var util=require('util');var path=require(_0xa96a('0x7'));var sox=require(_0xa96a('0x8'));var csv=require('to-csv');var ejs=require(_0xa96a('0x9'));var fs=require('fs');var fs_extra=require(_0xa96a('0xa'));var _=require(_0xa96a('0xb'));var squel=require(_0xa96a('0xc'));var crypto=require(_0xa96a('0xd'));var jsforce=require(_0xa96a('0xe'));var deskjs=require(_0xa96a('0xf'));var toCsv=require(_0xa96a('0x10'));var querystring=require(_0xa96a('0x11'));var Papa=require(_0xa96a('0x12'));var Redis=require(_0xa96a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa96a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa96a('0x15'));var logger=require(_0xa96a('0x16'))('api');var utils=require(_0xa96a('0x17'));var config=require(_0xa96a('0x18'));var licenseUtil=require(_0xa96a('0x19'));var db=require(_0xa96a('0x1a'))['db'];config[_0xa96a('0x1b')]=_[_0xa96a('0x1c')](config[_0xa96a('0x1b')],{'host':_0xa96a('0x1d'),'port':0x18eb});var socket=require(_0xa96a('0x1e'))(new Redis(config[_0xa96a('0x1b')]));require(_0xa96a('0x1f'))[_0xa96a('0x20')](socket);function respondWithStatusCode(_0x4dc5a8,_0x49327a){_0x49327a=_0x49327a||0xcc;return function(_0x945af){if(_0x945af){return _0x4dc5a8['sendStatus'](_0x49327a);}return _0x4dc5a8[_0xa96a('0x21')](_0x49327a)['end']();};}function respondWithResult(_0x170e3d,_0x163f73){_0x163f73=_0x163f73||0xc8;return function(_0x1f623e){if(_0x1f623e){return _0x170e3d[_0xa96a('0x21')](_0x163f73)[_0xa96a('0x22')](_0x1f623e);}};}function respondWithFilteredResult(_0x16257d,_0x5013f8){return function(_0x8d32c0){if(_0x8d32c0){var _0xbcc80a=typeof _0x5013f8['offset']===_0xa96a('0x23')&&typeof _0x5013f8[_0xa96a('0x24')]===_0xa96a('0x23');var _0x2e8c75=_0x8d32c0[_0xa96a('0x25')];var _0x14c8e5=_0xbcc80a?0x0:_0x5013f8[_0xa96a('0x26')];var _0x190e94=_0xbcc80a?_0x8d32c0[_0xa96a('0x25')]:_0x5013f8['offset']+_0x5013f8[_0xa96a('0x24')];var _0x5b7cbc;if(_0x190e94>=_0x2e8c75){_0x190e94=_0x2e8c75;_0x5b7cbc=0xc8;}else{_0x5b7cbc=0xce;}_0x16257d[_0xa96a('0x21')](_0x5b7cbc);return _0x16257d['set'](_0xa96a('0x27'),_0x14c8e5+'-'+_0x190e94+'/'+_0x2e8c75)[_0xa96a('0x22')](_0x8d32c0);}return null;};}function patchUpdates(_0x484ee7){return function(_0x4c8fa8){try{jsonpatch[_0xa96a('0x28')](_0x4c8fa8,_0x484ee7,!![]);}catch(_0x33feeb){return BPromise[_0xa96a('0x29')](_0x33feeb);}return _0x4c8fa8[_0xa96a('0x2a')]();};}function saveUpdates(_0x3eca00,_0x7ea334){return function(_0x4d4b40){if(_0x4d4b40){return _0x4d4b40['update'](_0x3eca00)[_0xa96a('0x2b')](function(_0x5916af){return _0x5916af;});}return null;};}function removeEntity(_0x36f3ae,_0x44c4ee){return function(_0x23d4fd){if(_0x23d4fd){return _0x23d4fd['destroy']()[_0xa96a('0x2b')](function(){_0x36f3ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4310a9,_0x4f76e0){return function(_0xf259a9){if(!_0xf259a9){_0x4310a9[_0xa96a('0x2c')](0x194);}return _0xf259a9;};}function handleError(_0x3c1690,_0x481663){_0x481663=_0x481663||0x1f4;return function(_0x1bb965){logger['error'](_0x1bb965['stack']);if(_0x1bb965[_0xa96a('0x2d')]){delete _0x1bb965['name'];}_0x3c1690['status'](_0x481663)[_0xa96a('0x2e')](_0x1bb965);};}exports[_0xa96a('0x2f')]=function(_0x4c69f3,_0x34ef72){var _0x2e3995={'raw':![],'where':{'id':_0x4c69f3[_0xa96a('0x30')]['id']}},_0x472d59={};_0x472d59[_0xa96a('0x31')]=_['keys'](db[_0xa96a('0x32')][_0xa96a('0x33')]);_0x472d59['query']=_[_0xa96a('0x34')](_0x4c69f3[_0xa96a('0x35')]);_0x472d59[_0xa96a('0x36')]=_[_0xa96a('0x37')](_0x472d59[_0xa96a('0x31')],_0x472d59[_0xa96a('0x35')]);_0x2e3995[_0xa96a('0x38')]=_['intersection'](_0x472d59[_0xa96a('0x31')],qs[_0xa96a('0x39')](_0x4c69f3[_0xa96a('0x35')][_0xa96a('0x39')]));_0x2e3995[_0xa96a('0x38')]=_0x2e3995[_0xa96a('0x38')]['length']?_0x2e3995['attributes']:_0x472d59['model'];if(_0x4c69f3['query'][_0xa96a('0x3a')]){_0x2e3995[_0xa96a('0x3b')]=[{'all':!![]}];}_0x2e3995=_[_0xa96a('0x3c')]({},_0x2e3995,_0x4c69f3[_0xa96a('0x3d')]);return db[_0xa96a('0x32')][_0xa96a('0x3e')](_0x2e3995)[_0xa96a('0x2b')](handleEntityNotFound(_0x34ef72,null))[_0xa96a('0x2b')](respondWithResult(_0x34ef72,null))[_0xa96a('0x3f')](handleError(_0x34ef72,null));};exports[_0xa96a('0x40')]=function(_0x233a64,_0x39ee3f){return db['DashboardItem']['find']({'where':{'id':_0x233a64[_0xa96a('0x30')]['id']}})[_0xa96a('0x2b')](handleEntityNotFound(_0x39ee3f,null))['then'](removeEntity(_0x39ee3f,null))[_0xa96a('0x3f')](handleError(_0x39ee3f,null));};function widgetAttributes(_0x535019){try{switch(_0x535019['type']){case _0xa96a('0x41'):return[{'name':_0xa96a('0x42'),'value':_0x535019[_0xa96a('0x42')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x44')]:undefined)||_0xa96a('0x45')}];case _0xa96a('0x46'):return[{'name':'attrPath','value':_0x535019[_0xa96a('0x47')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x0]?_0x535019['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x535019[_0xa96a('0x48')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x44')]:undefined)||_0xa96a('0x49')},{'name':_0xa96a('0x4a'),'value':_0x535019[_0xa96a('0x4a')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x1]?_0x535019['attrs'][0x1]['value']:undefined)||_0xa96a('0x4b')},{'name':_0xa96a('0x4c'),'value':_0x535019[_0xa96a('0x4c')]||(_0x535019['attrs']&&_0x535019[_0xa96a('0x43')][0x2]?_0x535019[_0xa96a('0x43')][0x2][_0xa96a('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0xa96a('0x4d'),'value':_0x535019[_0xa96a('0x4d')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x44')]:undefined)||_0xa96a('0x4e')},{'name':'attrVoiceQueues','value':_0x535019[_0xa96a('0x4f')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x1]?_0x535019['attrs'][0x1][_0xa96a('0x44')]:undefined)||[]},{'name':_0xa96a('0x4c'),'value':_0x535019['attrFontSize']||(_0x535019['attrs']&&_0x535019[_0xa96a('0x43')][0x2]?_0x535019[_0xa96a('0x43')][0x2][_0xa96a('0x44')]:undefined)||0x14},{'name':_0xa96a('0x50'),'value':_0x535019[_0xa96a('0x50')]||(_0x535019['attrs']&&_0x535019[_0xa96a('0x43')][0x3]?_0x535019[_0xa96a('0x43')][0x3][_0xa96a('0x44')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x535019[_0xa96a('0x51')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x4]?_0x535019['attrs'][0x4]['value']:undefined)||''},{'name':_0xa96a('0x52'),'value':_0x535019[_0xa96a('0x52')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x5]?_0x535019[_0xa96a('0x43')][0x5][_0xa96a('0x44')]:undefined)||''},{'name':_0xa96a('0x53'),'value':_0x535019[_0xa96a('0x53')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x6]?_0x535019[_0xa96a('0x43')][0x6][_0xa96a('0x44')]:undefined)||''},{'name':_0xa96a('0x54'),'value':_0x535019[_0xa96a('0x54')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x7]?_0x535019[_0xa96a('0x43')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x535019[_0xa96a('0x55')]||(_0x535019['attrs']&&_0x535019[_0xa96a('0x43')][0x8]?_0x535019[_0xa96a('0x43')][0x8][_0xa96a('0x44')]:undefined)||''},{'name':_0xa96a('0x56'),'value':_0x535019[_0xa96a('0x56')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x9]?_0x535019[_0xa96a('0x43')][0x9][_0xa96a('0x44')]:undefined)||''}];case _0xa96a('0x57'):case _0xa96a('0x58'):return[{'name':'attrSerie1','value':_0x535019[_0xa96a('0x59')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x44')]:undefined)||'total'},{'name':_0xa96a('0x5a'),'value':_0x535019['attrSerie2']||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x1]?_0x535019[_0xa96a('0x43')][0x1][_0xa96a('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x535019[_0xa96a('0x5b')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x2]?_0x535019[_0xa96a('0x43')][0x2][_0xa96a('0x44')]:undefined)||null},{'name':_0xa96a('0x4f'),'value':_0x535019[_0xa96a('0x4f')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x3]?_0x535019[_0xa96a('0x43')][0x3][_0xa96a('0x44')]:undefined)||[]},{'name':_0xa96a('0x50'),'value':_0x535019[_0xa96a('0x50')]||(_0x535019['attrs']&&_0x535019[_0xa96a('0x43')][0x4]?_0x535019['attrs'][0x4][_0xa96a('0x44')]:undefined)||_0xa96a('0x5c')},{'name':'attrEmailAccounts','value':_0x535019['attrEmailAccounts']||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x5]?_0x535019[_0xa96a('0x43')][0x5]['value']:undefined)||''},{'name':_0xa96a('0x52'),'value':_0x535019['attrFaxAccounts']||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x6]?_0x535019[_0xa96a('0x43')][0x6][_0xa96a('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x535019[_0xa96a('0x53')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x7]?_0x535019[_0xa96a('0x43')][0x7][_0xa96a('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x535019[_0xa96a('0x54')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x8]?_0x535019[_0xa96a('0x43')][0x8][_0xa96a('0x44')]:undefined)||''},{'name':_0xa96a('0x55'),'value':_0x535019[_0xa96a('0x55')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x9]?_0x535019[_0xa96a('0x43')][0x9][_0xa96a('0x44')]:undefined)||''},{'name':_0xa96a('0x56'),'value':_0x535019[_0xa96a('0x56')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0xa]?_0x535019[_0xa96a('0x43')][0xa][_0xa96a('0x44')]:undefined)||''}];case'web-report':return[{'name':_0xa96a('0x5d'),'type':_0x535019[_0xa96a('0x5e')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x5f')]:undefined)||null,'value':_0x535019[_0xa96a('0x5d')]||(_0x535019[_0xa96a('0x43')]&&_0x535019[_0xa96a('0x43')][0x0]?_0x535019[_0xa96a('0x43')][0x0][_0xa96a('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x535019[_0xa96a('0x60')]||(_0x535019[_0xa96a('0x43')]&&_0x535019['attrs'][0x1]?_0x535019[_0xa96a('0x43')][0x1][_0xa96a('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x4a9153){logger[_0xa96a('0x61')]('widgetAttributes:\x20%s',JSON['stringify'](_0x4a9153));return[];}}exports[_0xa96a('0x62')]=function(_0x4ad453,_0x1cf4c6){if(_0x4ad453[_0xa96a('0x63')]){_0x4ad453[_0xa96a('0x63')]['attrs']=widgetAttributes(_0x4ad453[_0xa96a('0x63')]);}return db[_0xa96a('0x32')][_0xa96a('0x62')](_0x4ad453[_0xa96a('0x63')],{})[_0xa96a('0x2b')](respondWithResult(_0x1cf4c6,0xc9))[_0xa96a('0x3f')](handleError(_0x1cf4c6,null));};exports[_0xa96a('0x64')]=function(_0x9659ce,_0x4859c7){if(_0x9659ce['body']['id']){delete _0x9659ce[_0xa96a('0x63')]['id'];}_0x9659ce[_0xa96a('0x63')][_0xa96a('0x43')]=widgetAttributes(_0x9659ce[_0xa96a('0x63')]);return db[_0xa96a('0x32')][_0xa96a('0x3e')]({'where':{'id':_0x9659ce[_0xa96a('0x30')]['id']}})[_0xa96a('0x2b')](handleEntityNotFound(_0x4859c7,null))[_0xa96a('0x2b')](saveUpdates(_0x9659ce['body'],null))[_0xa96a('0x2b')](respondWithResult(_0x4859c7,null))[_0xa96a('0x3f')](handleError(_0x4859c7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 87a96bb..d7b4fe6 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 _0xde25=['DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x41d2c6,_0x3cf817){var _0x87d147=function(_0x4a66e7){while(--_0x4a66e7){_0x41d2c6['push'](_0x41d2c6['shift']());}};_0x87d147(++_0x3cf817);}(_0xde25,0x104));var _0x5de2=function(_0x1b1411,_0xebef84){_0x1b1411=_0x1b1411-0x0;var _0x196b28=_0xde25[_0x1b1411];return _0x196b28;};'use strict';var EventEmitter=require(_0x5de2('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x5de2('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5de2('0x2')](0x0);var events={'afterCreate':_0x5de2('0x3'),'afterUpdate':_0x5de2('0x4'),'afterDestroy':_0x5de2('0x5')};function emitEvent(_0x58d416){return function(_0x81a80f,_0x2a6a90,_0xd98d97){DashboardItemEvents['emit'](_0x58d416+':'+_0x81a80f['id'],_0x81a80f);DashboardItemEvents[_0x5de2('0x6')](_0x58d416,_0x81a80f);_0xd98d97(null);};}for(var e in events){if(events[_0x5de2('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x5de2('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x33de=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x33de,0x19f));var _0xe33d=function(_0x326f81,_0x57c9d8){_0x326f81=_0x326f81-0x0;var _0x8a3c6e=_0x33de[_0x326f81];return _0x8a3c6e;};'use strict';var EventEmitter=require(_0xe33d('0x0'));var DashboardItem=require(_0xe33d('0x1'))['db'][_0xe33d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xe33d('0x3')](0x0);var events={'afterCreate':_0xe33d('0x4'),'afterUpdate':_0xe33d('0x5'),'afterDestroy':_0xe33d('0x6')};function emitEvent(_0x52e323){return function(_0x87ce04,_0x132132,_0x131814){DashboardItemEvents['emit'](_0x52e323+':'+_0x87ce04['id'],_0x87ce04);DashboardItemEvents[_0xe33d('0x7')](_0x52e323,_0x87ce04);_0x131814(null);};}for(var e in events){if(events[_0xe33d('0x8')](e)){var event=events[e];DashboardItem[_0xe33d('0x9')](e,emitEvent(event));}}module[_0xe33d('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b725bf5..be4738c 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 _0x2b44=['../../config/environment','./dashboardItem.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4215e4,_0x3fb09f){var _0x4a4574=function(_0x2906c0){while(--_0x2906c0){_0x4215e4['push'](_0x4215e4['shift']());}};_0x4a4574(++_0x3fb09f);}(_0x2b44,0x122));var _0x42b4=function(_0x54000a,_0x210194){_0x54000a=_0x54000a-0x0;var _0x4e7381=_0x2b44[_0x54000a];return _0x4e7381;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require(_0x42b4('0x2'))(_0x42b4('0x3'));var moment=require(_0x42b4('0x4'));var BPromise=require(_0x42b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x42b4('0x6'));var config=require(_0x42b4('0x7'));var attributes=require(_0x42b4('0x8'));module[_0x42b4('0x9')]=function(_0x4cc6c5,_0xe54897){return _0x4cc6c5[_0x42b4('0xa')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf808=['dashboard_items','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','DashboardItem'];(function(_0x389021,_0x41280f){var _0x22562d=function(_0x197bb1){while(--_0x197bb1){_0x389021['push'](_0x389021['shift']());}};_0x22562d(++_0x41280f);}(_0xf808,0x83));var _0x8f80=function(_0x5a51ac,_0x4c62bc){_0x5a51ac=_0x5a51ac-0x0;var _0x3a6cb3=_0xf808[_0x5a51ac];return _0x3a6cb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f80('0x0'))(_0x8f80('0x1'));var moment=require(_0x8f80('0x2'));var BPromise=require('bluebird');var rp=require(_0x8f80('0x3'));var fs=require('fs');var path=require(_0x8f80('0x4'));var rimraf=require(_0x8f80('0x5'));var config=require(_0x8f80('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x8f80('0x7')]=function(_0x5a386c,_0x23064e){return _0x5a386c['define'](_0x8f80('0x8'),attributes,{'tableName':_0x8f80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index ea09ea0..420692e 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 _0x80e6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x912d43,_0x181d0c){var _0x323b7e=function(_0x8b62d7){while(--_0x8b62d7){_0x912d43['push'](_0x912d43['shift']());}};_0x323b7e(++_0x181d0c);}(_0x80e6,0x187));var _0x680e=function(_0x207905,_0x28aa09){_0x207905=_0x207905-0x0;var _0x5b791f=_0x80e6[_0x207905];return _0x5b791f;};'use strict';var _=require(_0x680e('0x0'));var util=require('util');var moment=require(_0x680e('0x1'));var BPromise=require(_0x680e('0x2'));var rs=require(_0x680e('0x3'));var fs=require('fs');var Redis=require(_0x680e('0x4'));var db=require(_0x680e('0x5'))['db'];var utils=require(_0x680e('0x6'));var logger=require(_0x680e('0x7'))(_0x680e('0x8'));var config=require(_0x680e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x680e('0xa')][_0x680e('0xb')]({'port':0x232a});config['redis']=_[_0x680e('0xc')](config[_0x680e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x680e('0xd')]));require('./dashboardItem.socket')[_0x680e('0xe')](socket);function respondWithRpcPromise(_0x9db8f4,_0x2ccb63,_0x2b4135){return new BPromise(function(_0x5b2822,_0xd4dae9){return client[_0x680e('0xf')](_0x9db8f4,_0x2b4135)[_0x680e('0x10')](function(_0x3eb771){logger[_0x680e('0x11')](_0x680e('0x12'),_0x2ccb63,_0x680e('0x13'));logger[_0x680e('0x14')](_0x680e('0x15'),_0x2ccb63,_0x680e('0x13'),JSON[_0x680e('0x16')](_0x3eb771));if(_0x3eb771[_0x680e('0x17')]){if(_0x3eb771['error'][_0x680e('0x18')]===0x1f4){logger['error'](_0x680e('0x12'),_0x2ccb63,_0x3eb771[_0x680e('0x17')][_0x680e('0x19')]);return _0xd4dae9(_0x3eb771[_0x680e('0x17')]['message']);}logger['error'](_0x680e('0x12'),_0x2ccb63,_0x3eb771['error'][_0x680e('0x19')]);return _0x5b2822(_0x3eb771[_0x680e('0x17')][_0x680e('0x19')]);}else{logger['info'](_0x680e('0x12'),_0x2ccb63,_0x680e('0x13'));_0x5b2822(_0x3eb771[_0x680e('0x1a')]['message']);}})[_0x680e('0x1b')](function(_0x50dd5e){logger['error'](_0x680e('0x12'),_0x2ccb63,_0x50dd5e);_0xd4dae9(_0x50dd5e);});});} \ No newline at end of file +var _0xed43=['http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4f668f,_0x2e75c0){var _0x313d61=function(_0x5ddb8d){while(--_0x5ddb8d){_0x4f668f['push'](_0x4f668f['shift']());}};_0x313d61(++_0x2e75c0);}(_0xed43,0x163));var _0x3ed4=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0xed43[_0x52e68e];return _0x3211a4;};'use strict';var _=require('lodash');var util=require(_0x3ed4('0x0'));var moment=require('moment');var BPromise=require(_0x3ed4('0x1'));var rs=require(_0x3ed4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed4('0x4'))(_0x3ed4('0x5'));var config=require(_0x3ed4('0x6'));var jayson=require(_0x3ed4('0x7'));var client=jayson[_0x3ed4('0x8')][_0x3ed4('0x9')]({'port':0x232a});config[_0x3ed4('0xa')]=_[_0x3ed4('0xb')](config[_0x3ed4('0xa')],{'host':_0x3ed4('0xc'),'port':0x18eb});var socket=require(_0x3ed4('0xd'))(new Redis(config['redis']));require(_0x3ed4('0xe'))[_0x3ed4('0xf')](socket);function respondWithRpcPromise(_0xa9e26,_0x214e0c,_0xc18eab){return new BPromise(function(_0x35a4c6,_0x544ea7){return client[_0x3ed4('0x10')](_0xa9e26,_0xc18eab)[_0x3ed4('0x11')](function(_0x44c38a){logger[_0x3ed4('0x12')]('DashboardItem,\x20%s,\x20%s',_0x214e0c,_0x3ed4('0x13'));logger[_0x3ed4('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x214e0c,'request\x20sent',JSON[_0x3ed4('0x15')](_0x44c38a));if(_0x44c38a[_0x3ed4('0x16')]){if(_0x44c38a['error'][_0x3ed4('0x17')]===0x1f4){logger[_0x3ed4('0x16')]('DashboardItem,\x20%s,\x20%s',_0x214e0c,_0x44c38a[_0x3ed4('0x16')][_0x3ed4('0x18')]);return _0x544ea7(_0x44c38a[_0x3ed4('0x16')]['message']);}logger[_0x3ed4('0x16')](_0x3ed4('0x19'),_0x214e0c,_0x44c38a[_0x3ed4('0x16')][_0x3ed4('0x18')]);return _0x35a4c6(_0x44c38a['error']['message']);}else{logger['info'](_0x3ed4('0x19'),_0x214e0c,_0x3ed4('0x13'));_0x35a4c6(_0x44c38a[_0x3ed4('0x1a')][_0x3ed4('0x18')]);}})[_0x3ed4('0x1b')](function(_0x96723a){logger[_0x3ed4('0x16')](_0x3ed4('0x19'),_0x214e0c,_0x96723a);_0x544ea7(_0x96723a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 59c9060..5b68ef4 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 _0x47fa=['register','dashboardItem:','./dashboardItem.events','emit','removeListener'];(function(_0x51dff1,_0xc1da67){var _0x2a4c2c=function(_0x3b9de0){while(--_0x3b9de0){_0x51dff1['push'](_0x51dff1['shift']());}};_0x2a4c2c(++_0xc1da67);}(_0x47fa,0xd9));var _0xa47f=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x47fa[_0x11c573];return _0x6b72de;};'use strict';var DashboardItemEvents=require(_0xa47f('0x0'));var events=['save','remove','update'];function createListener(_0x352c6b,_0x371506){return function(_0x36d1aa){_0x371506[_0xa47f('0x1')](_0x352c6b,_0x36d1aa);};}function removeListener(_0x5ddcae,_0x5c5f5f){return function(){DashboardItemEvents[_0xa47f('0x2')](_0x5ddcae,_0x5c5f5f);};}exports[_0xa47f('0x3')]=function(_0x5bed3c){for(var _0x91e0ed=0x0,_0x5cfa2b=events['length'];_0x91e0ed<_0x5cfa2b;_0x91e0ed++){var _0x2a8e82=events[_0x91e0ed];var _0x444732=createListener(_0xa47f('0x4')+_0x2a8e82,_0x5bed3c);DashboardItemEvents['on'](_0x2a8e82,_0x444732);}}; \ No newline at end of file +var _0xfa34=['update','emit','removeListener','length','dashboardItem:','save','remove'];(function(_0x357810,_0xb4ebf7){var _0x2d10b2=function(_0x5db15f){while(--_0x5db15f){_0x357810['push'](_0x357810['shift']());}};_0x2d10b2(++_0xb4ebf7);}(_0xfa34,0xb4));var _0x4fa3=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xfa34[_0x1bb812];return _0x372adb;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x4fa3('0x0'),_0x4fa3('0x1'),_0x4fa3('0x2')];function createListener(_0x4186e3,_0x477e9b){return function(_0x41c78b){_0x477e9b[_0x4fa3('0x3')](_0x4186e3,_0x41c78b);};}function removeListener(_0x342967,_0x1b5df1){return function(){DashboardItemEvents[_0x4fa3('0x4')](_0x342967,_0x1b5df1);};}exports['register']=function(_0x5baf3c){for(var _0x3964e6=0x0,_0x4062ac=events[_0x4fa3('0x5')];_0x3964e6<_0x4062ac;_0x3964e6++){var _0x1bb7d7=events[_0x3964e6];var _0x3a4bcc=createListener(_0x4fa3('0x6')+_0x1bb7d7,_0x5baf3c);DashboardItemEvents['on'](_0x1bb7d7,_0x3a4bcc);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 7c9eb5f..3321522 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 _0x8ad3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','exports','multer','util','path'];(function(_0x25c3d4,_0x57008c){var _0x1d0655=function(_0x1a8c1b){while(--_0x1a8c1b){_0x25c3d4['push'](_0x25c3d4['shift']());}};_0x1d0655(++_0x57008c);}(_0x8ad3,0x11e));var _0x38ad=function(_0xbe58b4,_0x434613){_0xbe58b4=_0xbe58b4-0x0;var _0x497c5e=_0x8ad3[_0xbe58b4];return _0x497c5e;};'use strict';var multer=require(_0x38ad('0x0'));var util=require(_0x38ad('0x1'));var path=require(_0x38ad('0x2'));var timeout=require(_0x38ad('0x3'));var express=require(_0x38ad('0x4'));var router=express[_0x38ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x38ad('0x6'));var interaction=require(_0x38ad('0x7'));var config=require(_0x38ad('0x8'));var controller=require(_0x38ad('0x9'));router[_0x38ad('0xa')](_0x38ad('0xb'),auth['isAuthenticated'](),controller[_0x38ad('0xc')]);router[_0x38ad('0xd')]('/',auth[_0x38ad('0xe')](),controller[_0x38ad('0xf')]);router['put'](_0x38ad('0xb'),auth[_0x38ad('0xe')](),controller['update']);router['delete'](_0x38ad('0xb'),auth[_0x38ad('0xe')](),controller['destroy']);module[_0x38ad('0x10')]=router; \ No newline at end of file +var _0x80f9=['express','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x466b2a,_0xceceb7){var _0x5db328=function(_0x38bf45){while(--_0x38bf45){_0x466b2a['push'](_0x466b2a['shift']());}};_0x5db328(++_0xceceb7);}(_0x80f9,0x177));var _0x980f=function(_0x3a95fa,_0x785909){_0x3a95fa=_0x3a95fa-0x0;var _0xcaaede=_0x80f9[_0x3a95fa];return _0xcaaede;};'use strict';var multer=require('multer');var util=require(_0x980f('0x0'));var path=require(_0x980f('0x1'));var timeout=require(_0x980f('0x2'));var express=require(_0x980f('0x3'));var router=express['Router']();var fs_extra=require(_0x980f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x980f('0x5'));var config=require(_0x980f('0x6'));var controller=require(_0x980f('0x7'));router[_0x980f('0x8')](_0x980f('0x9'),auth['isAuthenticated'](),controller[_0x980f('0xa')]);router[_0x980f('0xb')]('/',auth[_0x980f('0xc')](),controller[_0x980f('0xd')]);router[_0x980f('0xe')](_0x980f('0x9'),auth[_0x980f('0xc')](),controller['update']);router[_0x980f('0xf')](_0x980f('0x9'),auth[_0x980f('0xc')](),controller[_0x980f('0x10')]);module[_0x980f('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 9a23f11..5a324a2 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 _0x1e85=['ENUM','third','STRING','sequelize','exports'];(function(_0x291e6d,_0x9a3412){var _0x4f0fa5=function(_0x43eaa8){while(--_0x43eaa8){_0x291e6d['push'](_0x291e6d['shift']());}};_0x4f0fa5(++_0x9a3412);}(_0x1e85,0x166));var _0x51e8=function(_0x156c90,_0x5e880a){_0x156c90=_0x156c90-0x0;var _0x35700f=_0x1e85[_0x156c90];return _0x35700f;};'use strict';var Sequelize=require(_0x51e8('0x0'));module[_0x51e8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x51e8('0x2')]('first','second',_0x51e8('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x51e8('0x4')]}}; \ No newline at end of file +var _0x1957=['third','sequelize','STRING','ENUM','second'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x1957,0x10a));var _0x7195=function(_0x11a3bb,_0x5c5466){_0x11a3bb=_0x11a3bb-0x0;var _0x3c3e36=_0x1957[_0x11a3bb];return _0x3c3e36;};'use strict';var Sequelize=require(_0x7195('0x0'));module['exports']={'name':{'type':Sequelize[_0x7195('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x7195('0x2')]('first',_0x7195('0x3'),_0x7195('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7195('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 887ec69..87d2dfb 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 _0xc0aa=['catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','options','count','findAll','show','params','fields','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0x180e42,_0x5b0d63){var _0x507a1c=function(_0x33714c){while(--_0x33714c){_0x180e42['push'](_0x180e42['shift']());}};_0x507a1c(++_0x5b0d63);}(_0xc0aa,0x1f3));var _0xac0a=function(_0x456512,_0x1b2d25){_0x456512=_0x456512-0x0;var _0xcd2e1b=_0xc0aa[_0x456512];return _0xcd2e1b;};'use strict';var emlformat=require(_0xac0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac0a('0x1'));var jsonpatch=require(_0xac0a('0x2'));var rp=require('request-promise');var moment=require(_0xac0a('0x3'));var BPromise=require(_0xac0a('0x4'));var Mustache=require(_0xac0a('0x5'));var util=require('util');var path=require(_0xac0a('0x6'));var sox=require(_0xac0a('0x7'));var csv=require(_0xac0a('0x8'));var ejs=require(_0xac0a('0x9'));var fs=require('fs');var fs_extra=require(_0xac0a('0xa'));var _=require(_0xac0a('0xb'));var squel=require(_0xac0a('0xc'));var crypto=require(_0xac0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac0a('0xe'));var toCsv=require(_0xac0a('0x8'));var querystring=require(_0xac0a('0xf'));var Papa=require(_0xac0a('0x10'));var Redis=require(_0xac0a('0x11'));var authService=require(_0xac0a('0x12'));var qs=require(_0xac0a('0x13'));var as=require(_0xac0a('0x14'));var hardwareService=require(_0xac0a('0x15'));var logger=require(_0xac0a('0x16'))(_0xac0a('0x17'));var utils=require('../../config/utils');var config=require(_0xac0a('0x18'));var licenseUtil=require(_0xac0a('0x19'));var db=require(_0xac0a('0x1a'))['db'];function respondWithStatusCode(_0x644ca9,_0x2e10a4){_0x2e10a4=_0x2e10a4||0xcc;return function(_0x2a3f14){if(_0x2a3f14){return _0x644ca9[_0xac0a('0x1b')](_0x2e10a4);}return _0x644ca9[_0xac0a('0x1c')](_0x2e10a4)[_0xac0a('0x1d')]();};}function respondWithResult(_0x4ad006,_0x1f2a87){_0x1f2a87=_0x1f2a87||0xc8;return function(_0xff1ed7){if(_0xff1ed7){return _0x4ad006[_0xac0a('0x1c')](_0x1f2a87)[_0xac0a('0x1e')](_0xff1ed7);}};}function respondWithFilteredResult(_0x1e75f4,_0x433dc1){return function(_0xf0d5b7){if(_0xf0d5b7){var _0x20276a=typeof _0x433dc1[_0xac0a('0x1f')]==='undefined'&&typeof _0x433dc1['limit']===_0xac0a('0x20');var _0x12d0e5=_0xf0d5b7['count'];var _0x224e35=_0x20276a?0x0:_0x433dc1[_0xac0a('0x1f')];var _0x4c8f66=_0x20276a?_0xf0d5b7['count']:_0x433dc1[_0xac0a('0x1f')]+_0x433dc1['limit'];var _0x27515f;if(_0x4c8f66>=_0x12d0e5){_0x4c8f66=_0x12d0e5;_0x27515f=0xc8;}else{_0x27515f=0xce;}_0x1e75f4[_0xac0a('0x1c')](_0x27515f);return _0x1e75f4[_0xac0a('0x21')]('Content-Range',_0x224e35+'-'+_0x4c8f66+'/'+_0x12d0e5)[_0xac0a('0x1e')](_0xf0d5b7);}return null;};}function patchUpdates(_0x46eb9c){return function(_0x2dcc60){try{jsonpatch['apply'](_0x2dcc60,_0x46eb9c,!![]);}catch(_0x433763){return BPromise['reject'](_0x433763);}return _0x2dcc60[_0xac0a('0x22')]();};}function saveUpdates(_0x543a6b,_0x5d8385){return function(_0x3b576e){if(_0x3b576e){return _0x3b576e[_0xac0a('0x23')](_0x543a6b)[_0xac0a('0x24')](function(_0x2bb526){return _0x2bb526;});}return null;};}function removeEntity(_0x29c30d,_0x2b694a){return function(_0x18910d){if(_0x18910d){return _0x18910d[_0xac0a('0x25')]()[_0xac0a('0x24')](function(){var _0x258959=_0x18910d[_0xac0a('0x26')]({'plain':!![]});var _0x3420a8=_0xac0a('0x27');return db[_0xac0a('0x28')][_0xac0a('0x25')]({'where':{'type':_0x3420a8,'resourceId':_0x258959['id']}})[_0xac0a('0x24')](function(){return _0x18910d;});})[_0xac0a('0x24')](function(){_0x29c30d[_0xac0a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277585,_0x1b4819){return function(_0x5c5f6d){if(!_0x5c5f6d){_0x277585[_0xac0a('0x1b')](0x194);}return _0x5c5f6d;};}function handleError(_0x5d92a1,_0x1a1870){_0x1a1870=_0x1a1870||0x1f4;return function(_0x144f65){logger[_0xac0a('0x29')](_0x144f65[_0xac0a('0x2a')]);if(_0x144f65[_0xac0a('0x2b')]){delete _0x144f65[_0xac0a('0x2b')];}_0x5d92a1[_0xac0a('0x1c')](_0x1a1870)[_0xac0a('0x2c')](_0x144f65);};}exports['index']=function(_0x1a2de2,_0x2f0a27){var _0x506388={},_0x1288ee={},_0x419ad1={'count':0x0,'rows':[]};var _0x34a841=_['map'](db[_0xac0a('0x2d')][_0xac0a('0x2e')],function(_0x282b3d){return{'name':_0x282b3d[_0xac0a('0x2f')],'type':_0x282b3d[_0xac0a('0x30')][_0xac0a('0x31')]};});_0x1288ee[_0xac0a('0x32')]=_[_0xac0a('0x33')](_0x34a841,_0xac0a('0x2b'));_0x1288ee[_0xac0a('0x34')]=_[_0xac0a('0x35')](_0x1a2de2['query']);_0x1288ee[_0xac0a('0x36')]=_[_0xac0a('0x37')](_0x1288ee[_0xac0a('0x32')],_0x1288ee[_0xac0a('0x34')]);_0x506388[_0xac0a('0x38')]=_[_0xac0a('0x37')](_0x1288ee['model'],qs['fields'](_0x1a2de2[_0xac0a('0x34')]['fields']));_0x506388[_0xac0a('0x38')]=_0x506388[_0xac0a('0x38')][_0xac0a('0x39')]?_0x506388[_0xac0a('0x38')]:_0x1288ee[_0xac0a('0x32')];if(!_0x1a2de2[_0xac0a('0x34')]['hasOwnProperty'](_0xac0a('0x3a'))){_0x506388[_0xac0a('0x3b')]=qs[_0xac0a('0x3b')](_0x1a2de2[_0xac0a('0x34')]['limit']);_0x506388['offset']=qs[_0xac0a('0x1f')](_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x1f')]);}_0x506388[_0xac0a('0x3c')]=qs[_0xac0a('0x3d')](_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3d')]);_0x506388['where']=qs[_0xac0a('0x36')](_[_0xac0a('0x3e')](_0x1a2de2['query'],_0x1288ee[_0xac0a('0x36')]),_0x34a841);if(_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3f')]){_0x506388['where']=_['merge'](_0x506388[_0xac0a('0x40')],{'$or':_['map'](_0x34a841,function(_0x220322){if(_0x220322[_0xac0a('0x30')]!==_0xac0a('0x41')){var _0x362937={};_0x362937[_0x220322[_0xac0a('0x2b')]]={'$like':'%'+_0x1a2de2[_0xac0a('0x34')][_0xac0a('0x3f')]+'%'};return _0x362937;}})});}_0x506388=_['merge']({},_0x506388,_0x1a2de2[_0xac0a('0x42')]);var _0x151f85={'where':_0x506388[_0xac0a('0x40')]};return db[_0xac0a('0x2d')][_0xac0a('0x43')](_0x151f85)[_0xac0a('0x24')](function(_0x20db82){_0x419ad1['count']=_0x20db82;if(_0x1a2de2[_0xac0a('0x34')]['includeAll']){_0x506388['include']=[{'all':!![]}];}return db['Disposition'][_0xac0a('0x44')](_0x506388);})['then'](function(_0x12680f){_0x419ad1['rows']=_0x12680f;return _0x419ad1;})[_0xac0a('0x24')](respondWithFilteredResult(_0x2f0a27,_0x506388))['catch'](handleError(_0x2f0a27,null));};exports[_0xac0a('0x45')]=function(_0x33e239,_0x206ddd){var _0x3229cb={'raw':!![],'where':{'id':_0x33e239[_0xac0a('0x46')]['id']}},_0x222654={};_0x222654[_0xac0a('0x32')]=_[_0xac0a('0x35')](db[_0xac0a('0x2d')][_0xac0a('0x2e')]);_0x222654[_0xac0a('0x34')]=_[_0xac0a('0x35')](_0x33e239[_0xac0a('0x34')]);_0x222654[_0xac0a('0x36')]=_[_0xac0a('0x37')](_0x222654['model'],_0x222654[_0xac0a('0x34')]);_0x3229cb[_0xac0a('0x38')]=_[_0xac0a('0x37')](_0x222654['model'],qs[_0xac0a('0x47')](_0x33e239[_0xac0a('0x34')]['fields']));_0x3229cb[_0xac0a('0x38')]=_0x3229cb['attributes'][_0xac0a('0x39')]?_0x3229cb['attributes']:_0x222654['model'];if(_0x33e239[_0xac0a('0x34')][_0xac0a('0x48')]){_0x3229cb[_0xac0a('0x49')]=[{'all':!![]}];}_0x3229cb=_[_0xac0a('0x4a')]({},_0x3229cb,_0x33e239[_0xac0a('0x42')]);return db['Disposition'][_0xac0a('0x4b')](_0x3229cb)[_0xac0a('0x24')](handleEntityNotFound(_0x206ddd,null))['then'](respondWithResult(_0x206ddd,null))['catch'](handleError(_0x206ddd,null));};exports[_0xac0a('0x4c')]=function(_0x8e186d,_0x385823){return db[_0xac0a('0x2d')][_0xac0a('0x4c')](_0x8e186d[_0xac0a('0x4d')],{})[_0xac0a('0x24')](function(_0xcd557d){var _0x25280=_0x8e186d[_0xac0a('0x4e')]['get']({'plain':!![]});if(!_0x25280)throw new Error(_0xac0a('0x4f'));if(_0x25280['role']==='user'){var _0x423d8b=_0xcd557d[_0xac0a('0x26')]({'plain':!![]});var _0x4179cc=_0xac0a('0x27');return db[_0xac0a('0x50')][_0xac0a('0x4b')]({'where':{'name':_0x4179cc,'userProfileId':_0x25280['userProfileId']},'raw':!![]})[_0xac0a('0x24')](function(_0x144700){if(_0x144700&&_0x144700[_0xac0a('0x51')]===0x0){return db['UserProfileResource'][_0xac0a('0x4c')]({'name':_0x423d8b[_0xac0a('0x2b')],'resourceId':_0x423d8b['id'],'type':_0x144700['name'],'sectionId':_0x144700['id']},{})[_0xac0a('0x24')](function(){return _0xcd557d;});}else{return _0xcd557d;}})[_0xac0a('0x52')](function(_0x43981d){logger[_0xac0a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43981d);throw _0x43981d;});}return _0xcd557d;})['then'](respondWithResult(_0x385823,0xc9))[_0xac0a('0x52')](handleError(_0x385823,null));};exports[_0xac0a('0x23')]=function(_0x52fe10,_0x5a12e){if(_0x52fe10[_0xac0a('0x4d')]['id']){delete _0x52fe10[_0xac0a('0x4d')]['id'];}return db[_0xac0a('0x2d')][_0xac0a('0x4b')]({'where':{'id':_0x52fe10['params']['id']}})[_0xac0a('0x24')](handleEntityNotFound(_0x5a12e,null))['then'](saveUpdates(_0x52fe10[_0xac0a('0x4d')],null))[_0xac0a('0x24')](respondWithResult(_0x5a12e,null))[_0xac0a('0x52')](handleError(_0x5a12e,null));};exports[_0xac0a('0x25')]=function(_0x394462,_0x5623a4){return db[_0xac0a('0x2d')]['find']({'where':{'id':_0x394462['params']['id']}})[_0xac0a('0x24')](handleEntityNotFound(_0x5623a4,null))[_0xac0a('0x24')](removeEntity(_0x5623a4,null))[_0xac0a('0x52')](handleError(_0x5623a4,null));}; \ No newline at end of file +var _0x5855=['save','then','destroy','Dispositions','UserProfileResource','error','name','send','index','Disposition','fieldName','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','create','user','get','UserProfileSection','find','userProfileId','autoAssociation','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x5855,0xc9));var _0x5585=function(_0x54fbed,_0x3c77a7){_0x54fbed=_0x54fbed-0x0;var _0x333bbc=_0x5855[_0x54fbed];return _0x333bbc;};'use strict';var emlformat=require(_0x5585('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5585('0x1'));var rp=require(_0x5585('0x2'));var moment=require(_0x5585('0x3'));var BPromise=require(_0x5585('0x4'));var Mustache=require(_0x5585('0x5'));var util=require(_0x5585('0x6'));var path=require(_0x5585('0x7'));var sox=require('sox');var csv=require(_0x5585('0x8'));var ejs=require(_0x5585('0x9'));var fs=require('fs');var fs_extra=require(_0x5585('0xa'));var _=require(_0x5585('0xb'));var squel=require(_0x5585('0xc'));var crypto=require(_0x5585('0xd'));var jsforce=require(_0x5585('0xe'));var deskjs=require(_0x5585('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5585('0x10'));var Papa=require(_0x5585('0x11'));var Redis=require('ioredis');var authService=require(_0x5585('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5585('0x13'));var hardwareService=require(_0x5585('0x14'));var logger=require('../../config/logger')(_0x5585('0x15'));var utils=require(_0x5585('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5585('0x17'));var db=require(_0x5585('0x18'))['db'];function respondWithStatusCode(_0x2df6c0,_0x47f04b){_0x47f04b=_0x47f04b||0xcc;return function(_0x1a2b05){if(_0x1a2b05){return _0x2df6c0[_0x5585('0x19')](_0x47f04b);}return _0x2df6c0[_0x5585('0x1a')](_0x47f04b)[_0x5585('0x1b')]();};}function respondWithResult(_0x51a2e8,_0x228387){_0x228387=_0x228387||0xc8;return function(_0xa6deab){if(_0xa6deab){return _0x51a2e8['status'](_0x228387)[_0x5585('0x1c')](_0xa6deab);}};}function respondWithFilteredResult(_0x549b69,_0x32d30c){return function(_0x2240d0){if(_0x2240d0){var _0x448f6d=typeof _0x32d30c[_0x5585('0x1d')]===_0x5585('0x1e')&&typeof _0x32d30c[_0x5585('0x1f')]===_0x5585('0x1e');var _0xb9663a=_0x2240d0[_0x5585('0x20')];var _0x14d726=_0x448f6d?0x0:_0x32d30c['offset'];var _0x536ec2=_0x448f6d?_0x2240d0[_0x5585('0x20')]:_0x32d30c[_0x5585('0x1d')]+_0x32d30c['limit'];var _0x4a1991;if(_0x536ec2>=_0xb9663a){_0x536ec2=_0xb9663a;_0x4a1991=0xc8;}else{_0x4a1991=0xce;}_0x549b69[_0x5585('0x1a')](_0x4a1991);return _0x549b69['set'](_0x5585('0x21'),_0x14d726+'-'+_0x536ec2+'/'+_0xb9663a)[_0x5585('0x1c')](_0x2240d0);}return null;};}function patchUpdates(_0x3fed9a){return function(_0x69881f){try{jsonpatch[_0x5585('0x22')](_0x69881f,_0x3fed9a,!![]);}catch(_0x57ee8d){return BPromise[_0x5585('0x23')](_0x57ee8d);}return _0x69881f[_0x5585('0x24')]();};}function saveUpdates(_0x24177a,_0x42e440){return function(_0x4cc3c3){if(_0x4cc3c3){return _0x4cc3c3['update'](_0x24177a)[_0x5585('0x25')](function(_0x5261ef){return _0x5261ef;});}return null;};}function removeEntity(_0xb0aa87,_0x46884d){return function(_0x450dac){if(_0x450dac){return _0x450dac[_0x5585('0x26')]()[_0x5585('0x25')](function(){var _0x4a807e=_0x450dac['get']({'plain':!![]});var _0x254264=_0x5585('0x27');return db[_0x5585('0x28')]['destroy']({'where':{'type':_0x254264,'resourceId':_0x4a807e['id']}})[_0x5585('0x25')](function(){return _0x450dac;});})['then'](function(){_0xb0aa87[_0x5585('0x1a')](0xcc)[_0x5585('0x1b')]();});}};}function handleEntityNotFound(_0x1f783b,_0x4bb91a){return function(_0x331912){if(!_0x331912){_0x1f783b[_0x5585('0x19')](0x194);}return _0x331912;};}function handleError(_0x2d9846,_0x5ed7ef){_0x5ed7ef=_0x5ed7ef||0x1f4;return function(_0x5bc0a3){logger[_0x5585('0x29')](_0x5bc0a3['stack']);if(_0x5bc0a3[_0x5585('0x2a')]){delete _0x5bc0a3[_0x5585('0x2a')];}_0x2d9846[_0x5585('0x1a')](_0x5ed7ef)[_0x5585('0x2b')](_0x5bc0a3);};}exports[_0x5585('0x2c')]=function(_0x26c373,_0xeeb367){var _0x232f1f={},_0x5ce048={},_0x224d0c={'count':0x0,'rows':[]};var _0x463b4c=_['map'](db[_0x5585('0x2d')]['rawAttributes'],function(_0x49088a){return{'name':_0x49088a[_0x5585('0x2e')],'type':_0x49088a['type']['key']};});_0x5ce048[_0x5585('0x2f')]=_[_0x5585('0x30')](_0x463b4c,_0x5585('0x2a'));_0x5ce048[_0x5585('0x31')]=_[_0x5585('0x32')](_0x26c373[_0x5585('0x31')]);_0x5ce048[_0x5585('0x33')]=_['intersection'](_0x5ce048[_0x5585('0x2f')],_0x5ce048[_0x5585('0x31')]);_0x232f1f[_0x5585('0x34')]=_[_0x5585('0x35')](_0x5ce048[_0x5585('0x2f')],qs[_0x5585('0x36')](_0x26c373['query'][_0x5585('0x36')]));_0x232f1f[_0x5585('0x34')]=_0x232f1f['attributes']['length']?_0x232f1f['attributes']:_0x5ce048[_0x5585('0x2f')];if(!_0x26c373['query'][_0x5585('0x37')]('nolimit')){_0x232f1f[_0x5585('0x1f')]=qs[_0x5585('0x1f')](_0x26c373[_0x5585('0x31')][_0x5585('0x1f')]);_0x232f1f[_0x5585('0x1d')]=qs[_0x5585('0x1d')](_0x26c373['query'][_0x5585('0x1d')]);}_0x232f1f[_0x5585('0x38')]=qs[_0x5585('0x39')](_0x26c373[_0x5585('0x31')][_0x5585('0x39')]);_0x232f1f['where']=qs[_0x5585('0x33')](_['pick'](_0x26c373[_0x5585('0x31')],_0x5ce048[_0x5585('0x33')]),_0x463b4c);if(_0x26c373['query'][_0x5585('0x3a')]){_0x232f1f[_0x5585('0x3b')]=_[_0x5585('0x3c')](_0x232f1f[_0x5585('0x3b')],{'$or':_[_0x5585('0x30')](_0x463b4c,function(_0xd98fc1){if(_0xd98fc1['type']!=='VIRTUAL'){var _0xe6fb72={};_0xe6fb72[_0xd98fc1[_0x5585('0x2a')]]={'$like':'%'+_0x26c373[_0x5585('0x31')][_0x5585('0x3a')]+'%'};return _0xe6fb72;}})});}_0x232f1f=_['merge']({},_0x232f1f,_0x26c373[_0x5585('0x3d')]);var _0x47f4b1={'where':_0x232f1f[_0x5585('0x3b')]};return db['Disposition'][_0x5585('0x20')](_0x47f4b1)['then'](function(_0x5c0218){_0x224d0c[_0x5585('0x20')]=_0x5c0218;if(_0x26c373[_0x5585('0x31')][_0x5585('0x3e')]){_0x232f1f[_0x5585('0x3f')]=[{'all':!![]}];}return db[_0x5585('0x2d')]['findAll'](_0x232f1f);})[_0x5585('0x25')](function(_0x3a23fe){_0x224d0c[_0x5585('0x40')]=_0x3a23fe;return _0x224d0c;})[_0x5585('0x25')](respondWithFilteredResult(_0xeeb367,_0x232f1f))[_0x5585('0x41')](handleError(_0xeeb367,null));};exports[_0x5585('0x42')]=function(_0x4a5d29,_0x22fe4c){var _0x1d3113={'raw':!![],'where':{'id':_0x4a5d29[_0x5585('0x43')]['id']}},_0x172be5={};_0x172be5[_0x5585('0x2f')]=_[_0x5585('0x32')](db[_0x5585('0x2d')][_0x5585('0x44')]);_0x172be5[_0x5585('0x31')]=_['keys'](_0x4a5d29[_0x5585('0x31')]);_0x172be5[_0x5585('0x33')]=_['intersection'](_0x172be5[_0x5585('0x2f')],_0x172be5[_0x5585('0x31')]);_0x1d3113[_0x5585('0x34')]=_[_0x5585('0x35')](_0x172be5[_0x5585('0x2f')],qs['fields'](_0x4a5d29['query']['fields']));_0x1d3113[_0x5585('0x34')]=_0x1d3113['attributes'][_0x5585('0x45')]?_0x1d3113[_0x5585('0x34')]:_0x172be5[_0x5585('0x2f')];if(_0x4a5d29[_0x5585('0x31')][_0x5585('0x3e')]){_0x1d3113[_0x5585('0x3f')]=[{'all':!![]}];}_0x1d3113=_[_0x5585('0x3c')]({},_0x1d3113,_0x4a5d29[_0x5585('0x3d')]);return db[_0x5585('0x2d')]['find'](_0x1d3113)[_0x5585('0x25')](handleEntityNotFound(_0x22fe4c,null))[_0x5585('0x25')](respondWithResult(_0x22fe4c,null))[_0x5585('0x41')](handleError(_0x22fe4c,null));};exports['create']=function(_0x590d37,_0x3c3b12){return db[_0x5585('0x2d')][_0x5585('0x46')](_0x590d37['body'],{})[_0x5585('0x25')](function(_0x28493e){var _0xe02ff3=_0x590d37[_0x5585('0x47')][_0x5585('0x48')]({'plain':!![]});if(!_0xe02ff3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe02ff3['role']==='user'){var _0x20cf4f=_0x28493e['get']({'plain':!![]});var _0x1fbce8=_0x5585('0x27');return db[_0x5585('0x49')][_0x5585('0x4a')]({'where':{'name':_0x1fbce8,'userProfileId':_0xe02ff3[_0x5585('0x4b')]},'raw':!![]})['then'](function(_0x1b661d){if(_0x1b661d&&_0x1b661d[_0x5585('0x4c')]===0x0){return db[_0x5585('0x28')][_0x5585('0x46')]({'name':_0x20cf4f[_0x5585('0x2a')],'resourceId':_0x20cf4f['id'],'type':_0x1b661d[_0x5585('0x2a')],'sectionId':_0x1b661d['id']},{})['then'](function(){return _0x28493e;});}else{return _0x28493e;}})[_0x5585('0x41')](function(_0x4daf3b){logger[_0x5585('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4daf3b);throw _0x4daf3b;});}return _0x28493e;})[_0x5585('0x25')](respondWithResult(_0x3c3b12,0xc9))['catch'](handleError(_0x3c3b12,null));};exports[_0x5585('0x4d')]=function(_0x5503cb,_0x29cb0b){if(_0x5503cb[_0x5585('0x4e')]['id']){delete _0x5503cb[_0x5585('0x4e')]['id'];}return db[_0x5585('0x2d')][_0x5585('0x4a')]({'where':{'id':_0x5503cb['params']['id']}})['then'](handleEntityNotFound(_0x29cb0b,null))[_0x5585('0x25')](saveUpdates(_0x5503cb[_0x5585('0x4e')],null))[_0x5585('0x25')](respondWithResult(_0x29cb0b,null))['catch'](handleError(_0x29cb0b,null));};exports[_0x5585('0x26')]=function(_0x280338,_0x17e67f){return db[_0x5585('0x2d')][_0x5585('0x4a')]({'where':{'id':_0x280338[_0x5585('0x43')]['id']}})[_0x5585('0x25')](handleEntityNotFound(_0x17e67f,null))[_0x5585('0x25')](removeEntity(_0x17e67f,null))[_0x5585('0x41')](handleError(_0x17e67f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1fc0a7e..cce39d3 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 _0xd4ea=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','name_mail','name_sms','SmsAccountId','FaxAccountId'];(function(_0x108398,_0x5a4de0){var _0x43d99e=function(_0x49969f){while(--_0x49969f){_0x108398['push'](_0x108398['shift']());}};_0x43d99e(++_0x5a4de0);}(_0xd4ea,0x12f));var _0xad4e=function(_0x2d7039,_0x270c15){_0x2d7039=_0x2d7039-0x0;var _0x415738=_0xd4ea[_0x2d7039];return _0x415738;};'use strict';var _=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));var logger=require(_0xad4e('0x2'))(_0xad4e('0x3'));var moment=require('moment');var BPromise=require(_0xad4e('0x4'));var rp=require(_0xad4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad4e('0x6'));var config=require('../../config/environment');var attributes=require(_0xad4e('0x7'));module[_0xad4e('0x8')]=function(_0x460bd6,_0x2cd57f){return _0x460bd6[_0xad4e('0x9')](_0xad4e('0xa'),attributes,{'tableName':_0xad4e('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xad4e('0xc'),'fields':['name',_0xad4e('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0xad4e('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xad4e('0xf'),'fields':[_0xad4e('0xe'),'MailAccountId']},{'unique':!![],'name':_0xad4e('0x10'),'fields':[_0xad4e('0xe'),_0xad4e('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0xad4e('0xe'),_0xad4e('0x12')]},{'unique':!![],'name':_0xad4e('0x13'),'fields':[_0xad4e('0xe'),_0xad4e('0x14')]},{'unique':!![],'name':_0xad4e('0x15'),'fields':[_0xad4e('0xe'),_0xad4e('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c46=['exports','define','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','WhatsappAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x1a799d,_0xd570cc){var _0x4c8837=function(_0xf0c406){while(--_0xf0c406){_0x1a799d['push'](_0x1a799d['shift']());}};_0x4c8837(++_0xd570cc);}(_0x5c46,0x1ef));var _0x65c4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5c46[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x65c4('0x0'));var util=require('util');var logger=require(_0x65c4('0x1'))('api');var moment=require(_0x65c4('0x2'));var BPromise=require(_0x65c4('0x3'));var rp=require(_0x65c4('0x4'));var fs=require('fs');var path=require(_0x65c4('0x5'));var rimraf=require(_0x65c4('0x6'));var config=require(_0x65c4('0x7'));var attributes=require(_0x65c4('0x8'));module[_0x65c4('0x9')]=function(_0x5a8884,_0x240684){return _0x5a8884[_0x65c4('0xa')](_0x65c4('0xb'),attributes,{'tableName':_0x65c4('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x65c4('0xd'),'fields':['name',_0x65c4('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0x65c4('0xf'),_0x65c4('0x10')]},{'unique':!![],'name':_0x65c4('0x11'),'fields':[_0x65c4('0xf'),_0x65c4('0x12')]},{'unique':!![],'name':_0x65c4('0x13'),'fields':[_0x65c4('0xf'),_0x65c4('0x14')]},{'unique':!![],'name':_0x65c4('0x15'),'fields':[_0x65c4('0xf'),'FaxAccountId']},{'unique':!![],'name':_0x65c4('0x16'),'fields':[_0x65c4('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x65c4('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e82fa2f..d85a49e 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(_0x9ebdee,_0x1f1cb4){var _0x33bb83=function(_0x599f78){while(--_0x599f78){_0x9ebdee['push'](_0x9ebdee['shift']());}};_0x33bb83(++_0x1f1cb4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x34e0ac,_0x51891a){var _0x5e3b7d=function(_0x1ffbe4){while(--_0x1ffbe4){_0x34e0ac['push'](_0x34e0ac['shift']());}};_0x5e3b7d(++_0x51891a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 e0523d9..ef3669b 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 _0xab85=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x30ebcc,_0x307cf4){var _0x19b3d8=function(_0x315965){while(--_0x315965){_0x30ebcc['push'](_0x30ebcc['shift']());}};_0x19b3d8(++_0x307cf4);}(_0xab85,0xe3));var _0x5ab8=function(_0x5d0e90,_0x28c3a7){_0x5d0e90=_0x5d0e90-0x0;var _0x217bac=_0xab85[_0x5d0e90];return _0x217bac;};'use strict';var multer=require(_0x5ab8('0x0'));var util=require('util');var path=require(_0x5ab8('0x1'));var timeout=require(_0x5ab8('0x2'));var express=require(_0x5ab8('0x3'));var router=express[_0x5ab8('0x4')]();var fs_extra=require(_0x5ab8('0x5'));var auth=require(_0x5ab8('0x6'));var interaction=require(_0x5ab8('0x7'));var config=require(_0x5ab8('0x8'));var controller=require(_0x5ab8('0x9'));router[_0x5ab8('0xa')]('/',auth[_0x5ab8('0xb')](),controller[_0x5ab8('0xc')]);router[_0x5ab8('0xa')](_0x5ab8('0xd'),auth[_0x5ab8('0xb')](),controller['show']);router[_0x5ab8('0xe')]('/',auth[_0x5ab8('0xb')](),controller[_0x5ab8('0xf')]);router[_0x5ab8('0x10')](_0x5ab8('0xd'),auth[_0x5ab8('0xb')](),controller[_0x5ab8('0x11')]);router[_0x5ab8('0x12')](_0x5ab8('0xd'),auth['isAuthenticated'](),controller[_0x5ab8('0x13')]);module[_0x5ab8('0x14')]=router; \ No newline at end of file +var _0x082c=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports'];(function(_0x319422,_0x51aea6){var _0x39f300=function(_0x1e6199){while(--_0x1e6199){_0x319422['push'](_0x319422['shift']());}};_0x39f300(++_0x51aea6);}(_0x082c,0x72));var _0xc082=function(_0x4534e3,_0x56de6e){_0x4534e3=_0x4534e3-0x0;var _0x50c3a3=_0x082c[_0x4534e3];return _0x50c3a3;};'use strict';var multer=require('multer');var util=require(_0xc082('0x0'));var path=require('path');var timeout=require(_0xc082('0x1'));var express=require(_0xc082('0x2'));var router=express[_0xc082('0x3')]();var fs_extra=require(_0xc082('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc082('0x5'));var config=require(_0xc082('0x6'));var controller=require(_0xc082('0x7'));router[_0xc082('0x8')]('/',auth[_0xc082('0x9')](),controller[_0xc082('0xa')]);router[_0xc082('0x8')]('/:id',auth[_0xc082('0x9')](),controller[_0xc082('0xb')]);router[_0xc082('0xc')]('/',auth[_0xc082('0x9')](),controller[_0xc082('0xd')]);router[_0xc082('0xe')](_0xc082('0xf'),auth[_0xc082('0x9')](),controller[_0xc082('0x10')]);router[_0xc082('0x11')](_0xc082('0xf'),auth[_0xc082('0x9')](),controller['destroy']);module[_0xc082('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0571037..22ff10c 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 _0x8867=['SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','localstationid','ENUM','4800','7200','12000','14400','2400','9600','v17,v27,v29','INTEGER'];(function(_0x3d13ac,_0x23a64a){var _0xd85820=function(_0x549e7c){while(--_0x549e7c){_0x3d13ac['push'](_0x3d13ac['shift']());}};_0xd85820(++_0x23a64a);}(_0x8867,0x17f));var _0x7886=function(_0x4fabbe,_0xc514f3){_0x4fabbe=_0x4fabbe-0x0;var _0x5510dd=_0x8867[_0x4fabbe];return _0x5510dd;};'use strict';var Sequelize=require('sequelize');module[_0x7886('0x0')]={'name':{'type':Sequelize[_0x7886('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7886('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x7886('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x7886('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x7886('0x3')},'minrate':{'type':Sequelize[_0x7886('0x4')]('2400',_0x7886('0x5'),_0x7886('0x6'),'9600',_0x7886('0x7'),_0x7886('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x7886('0x4')](_0x7886('0x9'),_0x7886('0x5'),_0x7886('0x6'),_0x7886('0xa'),_0x7886('0x7'),_0x7886('0x8')),'defaultValue':_0x7886('0x8')},'modem':{'type':Sequelize[_0x7886('0x1')],'defaultValue':_0x7886('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7886('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7886('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7886('0x4')](_0x7886('0xd'),'IAX','DADHI',_0x7886('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7886('0xf')],'defaultValue':function(){return _0x7886('0x10');}},'notificationSound':{'type':Sequelize[_0x7886('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7886('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7886('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7886('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7886('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x7886('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x41e99c){if(!_0x41e99c)this[_0x7886('0x13')](_0x7886('0x14'),null);this[_0x7886('0x13')](_0x7886('0x15'),_0x41e99c);}}}; \ No newline at end of file +var _0x530c=['setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','9600','12000','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x530c,0xe9));var _0xc530=function(_0x146979,_0x4dfc32){_0x146979=_0x146979-0x0;var _0x103856=_0x530c[_0x146979];return _0x103856;};'use strict';var Sequelize=require(_0xc530('0x0'));module[_0xc530('0x1')]={'name':{'type':Sequelize[_0xc530('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc530('0x2')]},'ecm':{'type':Sequelize[_0xc530('0x3')](_0xc530('0x4'),'no'),'defaultValue':_0xc530('0x4')},'headerinfo':{'type':Sequelize[_0xc530('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xc530('0x5')},'minrate':{'type':Sequelize[_0xc530('0x3')](_0xc530('0x6'),_0xc530('0x7'),'7200',_0xc530('0x8'),_0xc530('0x9'),_0xc530('0xa')),'defaultValue':_0xc530('0x7')},'maxrate':{'type':Sequelize[_0xc530('0x3')]('2400',_0xc530('0x7'),_0xc530('0xb'),'9600',_0xc530('0x9'),_0xc530('0xa')),'defaultValue':_0xc530('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc530('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc530('0x3')](_0xc530('0xd'),_0xc530('0xe'),_0xc530('0xf'),_0xc530('0x10')),'defaultValue':_0xc530('0xd')},'key':{'type':Sequelize[_0xc530('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc530('0x11');}},'notificationSound':{'type':Sequelize[_0xc530('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc530('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc530('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc530('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc530('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc530('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc530('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x449fa2){if(!_0x449fa2)this[_0xc530('0x13')](_0xc530('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x449fa2);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index fbcc224..106926a 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 _0x172d=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','UserProfileResource','destroy','end','stack','name','send','index','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','Pause','mandatoryDispositionPause','find','create','body','user','FaxAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','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','get','VoiceExtension','updateAccountApplications','bulkCreate','key','createdAt','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x172d,0xb5));var _0xd172=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x172d[_0x64aff8];return _0x5488a3;};'use strict';var emlformat=require(_0xd172('0x0'));var rimraf=require(_0xd172('0x1'));var zipdir=require(_0xd172('0x2'));var jsonpatch=require(_0xd172('0x3'));var rp=require(_0xd172('0x4'));var moment=require(_0xd172('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd172('0x6'));var path=require(_0xd172('0x7'));var sox=require(_0xd172('0x8'));var csv=require('to-csv');var ejs=require(_0xd172('0x9'));var fs=require('fs');var fs_extra=require(_0xd172('0xa'));var _=require(_0xd172('0xb'));var squel=require('squel');var crypto=require(_0xd172('0xc'));var jsforce=require(_0xd172('0xd'));var deskjs=require(_0xd172('0xe'));var toCsv=require(_0xd172('0xf'));var querystring=require('querystring');var Papa=require(_0xd172('0x10'));var Redis=require(_0xd172('0x11'));var authService=require(_0xd172('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd172('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd172('0x14'));var config=require(_0xd172('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd172('0x16'))['db'];config['redis']=_['defaults'](config[_0xd172('0x17')],{'host':_0xd172('0x18'),'port':0x18eb});var socket=require(_0xd172('0x19'))(new Redis(config[_0xd172('0x17')]));require(_0xd172('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd172('0x1b')][_0xd172('0x1c')]({'port':0x232c});var client9002=jayson[_0xd172('0x1b')][_0xd172('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x55b194,_0x41a28d,_0x28641e,_0x31df17){return new BPromise(function(_0xa841f,_0x1d142d){var _0x16c966=_0x31df17||client;return _0x16c966[_0xd172('0x1d')](_0x55b194,_0x28641e)[_0xd172('0x1e')](function(_0x420f5c){logger[_0xd172('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x41a28d,_0xd172('0x20'));logger[_0xd172('0x21')](_0xd172('0x22'),_0x41a28d,_0xd172('0x20'),JSON[_0xd172('0x23')](_0x420f5c));if(_0x420f5c[_0xd172('0x24')]){if(_0x420f5c['error'][_0xd172('0x25')]===0x1f4){logger['error'](_0xd172('0x26'),_0x41a28d,_0x420f5c[_0xd172('0x24')][_0xd172('0x27')]);return _0x1d142d(_0x420f5c['error'][_0xd172('0x27')]);}logger[_0xd172('0x24')](_0xd172('0x26'),_0x41a28d,_0x420f5c['error'][_0xd172('0x27')]);return _0xa841f(_0x420f5c[_0xd172('0x24')][_0xd172('0x27')]);}else{logger[_0xd172('0x1f')](_0xd172('0x26'),_0x41a28d,_0xd172('0x20'));_0xa841f(_0x420f5c[_0xd172('0x28')][_0xd172('0x27')]);}})[_0xd172('0x29')](function(_0x45cbe7){logger[_0xd172('0x24')]('FaxAccount,\x20%s,\x20%s',_0x41a28d,_0x45cbe7);_0x1d142d(_0x45cbe7);});});}function respondWithStatusCode(_0x458edf,_0x3c8da7){_0x3c8da7=_0x3c8da7||0xcc;return function(_0x2fcb6b){if(_0x2fcb6b){return _0x458edf[_0xd172('0x2a')](_0x3c8da7);}return _0x458edf[_0xd172('0x2b')](_0x3c8da7)['end']();};}function respondWithResult(_0x2de5ed,_0x3d6a50){_0x3d6a50=_0x3d6a50||0xc8;return function(_0x3713cd){if(_0x3713cd){return _0x2de5ed[_0xd172('0x2b')](_0x3d6a50)[_0xd172('0x2c')](_0x3713cd);}};}function respondWithFilteredResult(_0x589e5b,_0x1891e7){return function(_0x332dbc){if(_0x332dbc){var _0x1d8ea8=typeof _0x1891e7[_0xd172('0x2d')]==='undefined'&&typeof _0x1891e7[_0xd172('0x2e')]===_0xd172('0x2f');var _0x4bede9=_0x332dbc[_0xd172('0x30')];var _0x496159=_0x1d8ea8?0x0:_0x1891e7[_0xd172('0x2d')];var _0x249cba=_0x1d8ea8?_0x332dbc[_0xd172('0x30')]:_0x1891e7['offset']+_0x1891e7[_0xd172('0x2e')];var _0x78f4d7;if(_0x249cba>=_0x4bede9){_0x249cba=_0x4bede9;_0x78f4d7=0xc8;}else{_0x78f4d7=0xce;}_0x589e5b[_0xd172('0x2b')](_0x78f4d7);return _0x589e5b[_0xd172('0x31')](_0xd172('0x32'),_0x496159+'-'+_0x249cba+'/'+_0x4bede9)[_0xd172('0x2c')](_0x332dbc);}return null;};}function patchUpdates(_0x4d8828){return function(_0x4f73e4){try{jsonpatch['apply'](_0x4f73e4,_0x4d8828,!![]);}catch(_0x1bc1d4){return BPromise['reject'](_0x1bc1d4);}return _0x4f73e4['save']();};}function saveUpdates(_0x3c0636,_0x17d84e){return function(_0x365f89){if(_0x365f89){return _0x365f89[_0xd172('0x33')](_0x3c0636)[_0xd172('0x1e')](function(_0x3f6c31){return _0x3f6c31;});}return null;};}function removeEntity(_0x2409a9,_0x28aa45){return function(_0x202fd6){if(_0x202fd6){return _0x202fd6['destroy']()[_0xd172('0x1e')](function(){var _0x212e20=_0x202fd6['get']({'plain':!![]});var _0xf393a8='FaxAccounts';return db[_0xd172('0x34')][_0xd172('0x35')]({'where':{'type':_0xf393a8,'resourceId':_0x212e20['id']}})['then'](function(){return _0x202fd6;});})[_0xd172('0x1e')](function(){_0x2409a9[_0xd172('0x2b')](0xcc)[_0xd172('0x36')]();});}};}function handleEntityNotFound(_0x5911c5,_0x3a0883){return function(_0x5af7cf){if(!_0x5af7cf){_0x5911c5[_0xd172('0x2a')](0x194);}return _0x5af7cf;};}function handleError(_0x5c54fd,_0x37533d){_0x37533d=_0x37533d||0x1f4;return function(_0x5d3983){logger['error'](_0x5d3983[_0xd172('0x37')]);if(_0x5d3983[_0xd172('0x38')]){delete _0x5d3983[_0xd172('0x38')];}_0x5c54fd[_0xd172('0x2b')](_0x37533d)[_0xd172('0x39')](_0x5d3983);};}exports[_0xd172('0x3a')]=function(_0x25eef4,_0x7986be){var _0x344230={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5389cf={},_0x251dc8={'count':0x0,'rows':[]};var _0x4b3f82=_[_0xd172('0x3b')](db[_0xd172('0x3c')][_0xd172('0x3d')],function(_0x3142c0){return{'name':_0x3142c0[_0xd172('0x3e')],'type':_0x3142c0[_0xd172('0x3f')]['key']};});_0x5389cf[_0xd172('0x40')]=_[_0xd172('0x3b')](_0x4b3f82,_0xd172('0x38'));_0x5389cf[_0xd172('0x41')]=_[_0xd172('0x42')](_0x25eef4[_0xd172('0x41')]);_0x5389cf[_0xd172('0x43')]=_['intersection'](_0x5389cf[_0xd172('0x40')],_0x5389cf[_0xd172('0x41')]);_0x344230[_0xd172('0x44')]=_[_0xd172('0x45')](_0x5389cf['model'],qs[_0xd172('0x46')](_0x25eef4[_0xd172('0x41')]['fields']));_0x344230[_0xd172('0x44')]=_0x344230[_0xd172('0x44')][_0xd172('0x47')]?_0x344230['attributes']:_0x5389cf[_0xd172('0x40')];if(!_0x25eef4[_0xd172('0x41')][_0xd172('0x48')](_0xd172('0x49'))){_0x344230[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x25eef4[_0xd172('0x41')][_0xd172('0x2e')]);_0x344230[_0xd172('0x2d')]=qs[_0xd172('0x2d')](_0x25eef4[_0xd172('0x41')]['offset']);}_0x344230['order']=qs[_0xd172('0x4a')](_0x25eef4['query'][_0xd172('0x4a')]);_0x344230['where']=qs[_0xd172('0x43')](_[_0xd172('0x4b')](_0x25eef4[_0xd172('0x41')],_0x5389cf[_0xd172('0x43')]),_0x4b3f82);if(_0x25eef4['query'][_0xd172('0x4c')]){_0x344230['where']=_['merge'](_0x344230[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x4b3f82,function(_0x4b6023){if(_0x4b6023[_0xd172('0x3f')]!==_0xd172('0x4e')){var _0x138a59={};_0x138a59[_0x4b6023[_0xd172('0x38')]]={'$like':'%'+_0x25eef4['query'][_0xd172('0x4c')]+'%'};return _0x138a59;}})});}_0x344230=_[_0xd172('0x4f')]({},_0x344230,_0x25eef4[_0xd172('0x50')]);var _0x57d77d={'where':_0x344230[_0xd172('0x4d')]};return db[_0xd172('0x3c')][_0xd172('0x30')](_0x57d77d)[_0xd172('0x1e')](function(_0x402e1a){_0x251dc8[_0xd172('0x30')]=_0x402e1a;if(_0x25eef4['query'][_0xd172('0x51')]){_0x344230[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x3c')][_0xd172('0x53')](_0x344230);})['then'](function(_0x59c8e6){_0x251dc8[_0xd172('0x54')]=_0x59c8e6;return _0x251dc8;})[_0xd172('0x1e')](respondWithFilteredResult(_0x7986be,_0x344230))[_0xd172('0x29')](handleError(_0x7986be,null));};exports['show']=function(_0x33720a,_0x438e96){var _0x858c01={'raw':![],'where':{'id':_0x33720a['params']['id']},'include':[{'model':db[_0xd172('0x55')],'as':_0xd172('0x56')}]},_0x344670={};_0x344670[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x3c')][_0xd172('0x3d')]);_0x344670[_0xd172('0x41')]=_['keys'](_0x33720a[_0xd172('0x41')]);_0x344670[_0xd172('0x43')]=_[_0xd172('0x45')](_0x344670[_0xd172('0x40')],_0x344670['query']);_0x858c01[_0xd172('0x44')]=_[_0xd172('0x45')](_0x344670[_0xd172('0x40')],qs[_0xd172('0x46')](_0x33720a[_0xd172('0x41')][_0xd172('0x46')]));_0x858c01['attributes']=_0x858c01[_0xd172('0x44')][_0xd172('0x47')]?_0x858c01['attributes']:_0x344670[_0xd172('0x40')];if(_0x33720a[_0xd172('0x41')][_0xd172('0x51')]){_0x858c01['include']=[{'all':!![]}];}_0x858c01=_['merge']({},_0x858c01,_0x33720a['options']);return db[_0xd172('0x3c')][_0xd172('0x57')](_0x858c01)[_0xd172('0x1e')](handleEntityNotFound(_0x438e96,null))[_0xd172('0x1e')](respondWithResult(_0x438e96,null))[_0xd172('0x29')](handleError(_0x438e96,null));};exports[_0xd172('0x58')]=function(_0x5dd10b,_0x57487a){return db[_0xd172('0x3c')]['create'](_0x5dd10b[_0xd172('0x59')],{})[_0xd172('0x1e')](function(_0xd6043f){var _0x5766cd=_0x5dd10b['user']['get']({'plain':!![]});if(!_0x5766cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5766cd['role']===_0xd172('0x5a')){var _0x1793d6=_0xd6043f['get']({'plain':!![]});var _0x242616=_0xd172('0x5b');return db[_0xd172('0x5c')][_0xd172('0x57')]({'where':{'name':_0x242616,'userProfileId':_0x5766cd['userProfileId']},'raw':!![]})['then'](function(_0x5bee83){if(_0x5bee83&&_0x5bee83[_0xd172('0x5d')]===0x0){return db[_0xd172('0x34')]['create']({'name':_0x1793d6['name'],'resourceId':_0x1793d6['id'],'type':_0x5bee83[_0xd172('0x38')],'sectionId':_0x5bee83['id']},{})[_0xd172('0x1e')](function(){return _0xd6043f;});}else{return _0xd6043f;}})[_0xd172('0x29')](function(_0x22edf2){logger[_0xd172('0x24')](_0xd172('0x5e'),_0x22edf2);throw _0x22edf2;});}return _0xd6043f;})[_0xd172('0x1e')](respondWithResult(_0x57487a,0xc9))[_0xd172('0x29')](handleError(_0x57487a,null));};exports[_0xd172('0x33')]=function(_0x5e8236,_0x46b5df){if(_0x5e8236[_0xd172('0x59')]['id']){delete _0x5e8236[_0xd172('0x59')]['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x5e8236[_0xd172('0x5f')]['id']},'include':[{'model':db[_0xd172('0x55')],'as':_0xd172('0x56')}]})[_0xd172('0x1e')](handleEntityNotFound(_0x46b5df,null))[_0xd172('0x1e')](saveUpdates(_0x5e8236[_0xd172('0x59')],null))['then'](respondWithResult(_0x46b5df,null))[_0xd172('0x29')](handleError(_0x46b5df,null));};exports[_0xd172('0x35')]=function(_0x3015c8,_0x29b640){return db[_0xd172('0x3c')]['find']({'where':{'id':_0x3015c8[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x29b640,null))['then'](removeEntity(_0x29b640,null))['catch'](handleError(_0x29b640,null));};exports[_0xd172('0x60')]=function(_0x21e8cc,_0x21c08e){return db['FaxAccount'][_0xd172('0x60')]()[_0xd172('0x1e')](respondWithResult(_0x21c08e,null))[_0xd172('0x29')](handleError(_0x21c08e,null));};exports[_0xd172('0x61')]=function(_0x2df21e,_0xae3a58,_0x4f012e){if(_0x2df21e[_0xd172('0x59')]['id']){delete _0x2df21e[_0xd172('0x59')]['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x2df21e['params']['id']}})['then'](handleEntityNotFound(_0xae3a58,null))[_0xd172('0x1e')](function(_0x4907b6){if(_0x4907b6){_0x2df21e[_0xd172('0x59')][_0xd172('0x62')]=_0x4907b6['id'];return db[_0xd172('0x63')]['create'](_0x2df21e[_0xd172('0x59')]);}})['then'](respondWithResult(_0xae3a58,null))[_0xd172('0x29')](handleError(_0xae3a58,null));};exports[_0xd172('0x64')]=function(_0xe899d6,_0x658f58,_0xf30643){var _0x8a182b={'raw':![],'where':{}};var _0x468501={};var _0x4e34eb={'count':0x0,'rows':[]};return db[_0xd172('0x3c')]['findOne']({'where':{'id':_0xe899d6['params']['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x658f58,null))[_0xd172('0x1e')](function(_0x315af1){if(_0x315af1){_0x468501[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x63')][_0xd172('0x3d')]);_0x468501[_0xd172('0x41')]=_[_0xd172('0x42')](_0xe899d6[_0xd172('0x41')]);_0x468501[_0xd172('0x43')]=_[_0xd172('0x45')](_0x468501[_0xd172('0x40')],_0x468501['query']);_0x8a182b[_0xd172('0x44')]=_['intersection'](_0x468501[_0xd172('0x40')],qs[_0xd172('0x46')](_0xe899d6[_0xd172('0x41')]['fields']));_0x8a182b['attributes']=_0x8a182b[_0xd172('0x44')][_0xd172('0x47')]?_0x8a182b[_0xd172('0x44')]:_0x468501[_0xd172('0x40')];if(!_0xe899d6[_0xd172('0x41')]['hasOwnProperty']('nolimit')){_0x8a182b[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0xe899d6[_0xd172('0x41')][_0xd172('0x2e')]);_0x8a182b[_0xd172('0x2d')]=qs['offset'](_0xe899d6[_0xd172('0x41')][_0xd172('0x2d')]);}_0x8a182b[_0xd172('0x65')]=qs['sort'](_0xe899d6[_0xd172('0x41')][_0xd172('0x4a')]);_0x8a182b[_0xd172('0x4d')]=qs[_0xd172('0x43')](_[_0xd172('0x4b')](_0xe899d6[_0xd172('0x41')],_0x468501[_0xd172('0x43')]));_0x8a182b['where'][_0xd172('0x62')]=_0x315af1['id'];if(_0xe899d6[_0xd172('0x41')][_0xd172('0x4c')]){_0x8a182b['where']=_['merge'](_0x8a182b[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x8a182b['attributes'],function(_0x2a2b8f){var _0x374429={};_0x374429[_0x2a2b8f]={'$like':'%'+_0xe899d6[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x374429;})});}_0x8a182b=_[_0xd172('0x4f')]({},_0x8a182b,_0xe899d6[_0xd172('0x50')]);return db[_0xd172('0x63')][_0xd172('0x30')]({'where':_0x8a182b[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0x29be89){_0x4e34eb['count']=_0x29be89;if(_0xe899d6[_0xd172('0x41')][_0xd172('0x51')]){_0x8a182b[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x63')][_0xd172('0x53')](_0x8a182b);})[_0xd172('0x1e')](function(_0x5eaa0e){_0x4e34eb[_0xd172('0x54')]=_0x5eaa0e;return _0x4e34eb;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x658f58,_0x8a182b))[_0xd172('0x29')](handleError(_0x658f58,null));};exports[_0xd172('0x66')]=function(_0x57408a,_0x4115aa,_0x30392a){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x57408a[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x4115aa,null))[_0xd172('0x1e')](function(_0x36e81c){if(_0x36e81c){return _0x36e81c['removeDispositions'](_0x57408a[_0xd172('0x41')][_0xd172('0x67')]);}})['then'](respondWithStatusCode(_0x4115aa,null))[_0xd172('0x29')](handleError(_0x4115aa,null));};exports[_0xd172('0x68')]=function(_0x199692,_0x2d6448,_0x516459){if(_0x199692[_0xd172('0x59')]['id']){delete _0x199692['body']['id'];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x199692[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x2d6448,null))['then'](function(_0xdcc686){if(_0xdcc686){_0x199692[_0xd172('0x59')]['FaxAccountId']=_0xdcc686['id'];return db[_0xd172('0x69')][_0xd172('0x58')](_0x199692['body']);}})[_0xd172('0x1e')](respondWithResult(_0x2d6448,null))[_0xd172('0x29')](handleError(_0x2d6448,null));};exports[_0xd172('0x6a')]=function(_0x413fd1,_0x14aaf3,_0x4921b4){var _0xd157cf={'raw':![],'where':{}};var _0x1e771b={};var _0x23bcd3={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x413fd1[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x14aaf3,null))[_0xd172('0x1e')](function(_0x223322){if(_0x223322){_0x1e771b[_0xd172('0x40')]=_['keys'](db[_0xd172('0x69')]['rawAttributes']);_0x1e771b['query']=_['keys'](_0x413fd1[_0xd172('0x41')]);_0x1e771b[_0xd172('0x43')]=_[_0xd172('0x45')](_0x1e771b[_0xd172('0x40')],_0x1e771b[_0xd172('0x41')]);_0xd157cf[_0xd172('0x44')]=_['intersection'](_0x1e771b[_0xd172('0x40')],qs['fields'](_0x413fd1[_0xd172('0x41')][_0xd172('0x46')]));_0xd157cf['attributes']=_0xd157cf[_0xd172('0x44')][_0xd172('0x47')]?_0xd157cf['attributes']:_0x1e771b[_0xd172('0x40')];if(!_0x413fd1['query'][_0xd172('0x48')](_0xd172('0x49'))){_0xd157cf[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x413fd1[_0xd172('0x41')]['limit']);_0xd157cf['offset']=qs[_0xd172('0x2d')](_0x413fd1[_0xd172('0x41')][_0xd172('0x2d')]);}_0xd157cf[_0xd172('0x65')]=qs[_0xd172('0x4a')](_0x413fd1[_0xd172('0x41')][_0xd172('0x4a')]);_0xd157cf[_0xd172('0x4d')]=qs[_0xd172('0x43')](_['pick'](_0x413fd1['query'],_0x1e771b[_0xd172('0x43')]));_0xd157cf[_0xd172('0x4d')][_0xd172('0x62')]=_0x223322['id'];if(_0x413fd1[_0xd172('0x41')][_0xd172('0x4c')]){_0xd157cf[_0xd172('0x4d')]=_['merge'](_0xd157cf[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0xd157cf['attributes'],function(_0x1ec81e){var _0x1bcfae={};_0x1bcfae[_0x1ec81e]={'$like':'%'+_0x413fd1['query'][_0xd172('0x4c')]+'%'};return _0x1bcfae;})});}_0xd157cf=_['merge']({},_0xd157cf,_0x413fd1['options']);return db[_0xd172('0x69')]['count']({'where':_0xd157cf[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0x1c4dcd){_0x23bcd3[_0xd172('0x30')]=_0x1c4dcd;if(_0x413fd1['query'][_0xd172('0x51')]){_0xd157cf[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0x69')][_0xd172('0x53')](_0xd157cf);})[_0xd172('0x1e')](function(_0x4d42be){_0x23bcd3[_0xd172('0x54')]=_0x4d42be;return _0x23bcd3;});}})['then'](respondWithFilteredResult(_0x14aaf3,_0xd157cf))[_0xd172('0x29')](handleError(_0x14aaf3,null));};exports['removeAnswers']=function(_0x18f3a8,_0x585cde,_0x5bec4c){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x18f3a8[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x585cde,null))['then'](function(_0x57c240){if(_0x57c240){return _0x57c240[_0xd172('0x6c')](_0x18f3a8[_0xd172('0x41')][_0xd172('0x67')]);}})[_0xd172('0x1e')](respondWithStatusCode(_0x585cde,null))[_0xd172('0x29')](handleError(_0x585cde,null));};exports[_0xd172('0x6d')]=function(_0x423d46,_0x13571d,_0x479ca4){return db[_0xd172('0x6e')][_0xd172('0x57')]({'where':{'id':_0x423d46[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x13571d,null))[_0xd172('0x1e')](function(_0x56b77d){if(_0x56b77d){return _0x56b77d[_0xd172('0x6d')](_0x423d46['body'][_0xd172('0x67')],_[_0xd172('0x6f')](_0x423d46['body'],['ids','id'])||{});}})[_0xd172('0x1e')](respondWithResult(_0x13571d,null))[_0xd172('0x29')](handleError(_0x13571d,null));};exports[_0xd172('0x70')]=function(_0x154837,_0x576edf,_0x2d1ae2){var _0x1ac8c5={'raw':![],'where':{}};var _0x134a1a={};var _0x2855cb={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x154837[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x576edf,null))[_0xd172('0x1e')](function(_0x1128d6){if(_0x1128d6){_0x134a1a['model']=_[_0xd172('0x42')](db['FaxInteraction'][_0xd172('0x3d')]);_0x134a1a[_0xd172('0x41')]=_['keys'](_0x154837[_0xd172('0x41')]);_0x134a1a[_0xd172('0x43')]=_[_0xd172('0x45')](_0x134a1a[_0xd172('0x40')],_0x134a1a[_0xd172('0x41')]);_0x1ac8c5[_0xd172('0x44')]=_[_0xd172('0x45')](_0x134a1a[_0xd172('0x40')],qs[_0xd172('0x46')](_0x154837[_0xd172('0x41')][_0xd172('0x46')]));_0x1ac8c5[_0xd172('0x44')]=_0x1ac8c5['attributes'][_0xd172('0x47')]?_0x1ac8c5[_0xd172('0x44')]:_0x134a1a[_0xd172('0x40')];if(!_0x154837[_0xd172('0x41')]['hasOwnProperty'](_0xd172('0x49'))){_0x1ac8c5['limit']=qs[_0xd172('0x2e')](_0x154837['query'][_0xd172('0x2e')]);_0x1ac8c5['offset']=qs['offset'](_0x154837['query'][_0xd172('0x2d')]);}_0x1ac8c5['order']=qs[_0xd172('0x4a')](_0x154837[_0xd172('0x41')][_0xd172('0x4a')]);_0x1ac8c5[_0xd172('0x4d')]=qs['filters'](_[_0xd172('0x4b')](_0x154837[_0xd172('0x41')],_0x134a1a['filters']));_0x1ac8c5['where'][_0xd172('0x62')]=_0x1128d6['id'];if(_0x154837['query'][_0xd172('0x4c')]){_0x1ac8c5['where']=_[_0xd172('0x4f')](_0x1ac8c5['where'],{'$or':_[_0xd172('0x3b')](_0x1ac8c5[_0xd172('0x44')],function(_0x25de74){var _0x42a21d={};_0x42a21d[_0x25de74]={'$like':'%'+_0x154837[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x42a21d;})});}_0x1ac8c5=_['merge']({},_0x1ac8c5,_0x154837['options']);return db['FaxInteraction'][_0xd172('0x30')]({'where':_0x1ac8c5[_0xd172('0x4d')]})[_0xd172('0x1e')](function(_0xea4758){_0x2855cb[_0xd172('0x30')]=_0xea4758;if(_0x154837[_0xd172('0x41')][_0xd172('0x51')]){_0x1ac8c5[_0xd172('0x52')]=[{'model':db[_0xd172('0x71')],'as':_0xd172('0x72'),'required':![]},{'model':db[_0xd172('0x73')],'as':_0xd172('0x74'),'attributes':[_0xd172('0x38'),_0xd172('0x75'),_0xd172('0x76')],'required':![]},{'model':db['Tag'],'as':_0xd172('0x77'),'attributes':['id',_0xd172('0x38'),_0xd172('0x78')],'where':_0x154837[_0xd172('0x41')][_0xd172('0x79')]?{'id':_0x154837[_0xd172('0x41')][_0xd172('0x79')]}:undefined,'required':_0x154837[_0xd172('0x41')]['tag']?!![]:![]}];}return db[_0xd172('0x6e')]['findAll'](_0x1ac8c5);})[_0xd172('0x1e')](function(_0x546d1e){_0x2855cb[_0xd172('0x54')]=_0x546d1e;return _0x2855cb;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x576edf,_0x1ac8c5))[_0xd172('0x29')](handleError(_0x576edf,null));};exports[_0xd172('0x7a')]=function(_0x44e5c3,_0x1f72a6){var _0x1ef868=_0x44e5c3['params']['id'];var _0x478d16=_0x44e5c3[_0xd172('0x59')];var _0x250a87=0xc8;var _0xb8353d=null;return db[_0xd172('0x7b')][_0xd172('0x7c')]({'isolationLevel':db[_0xd172('0x7b')][_0xd172('0x7d')]['ISOLATION_LEVELS'][_0xd172('0x7e')]},function(_0x19f8b9){return db['FaxAccount'][_0xd172('0x6b')]({'where':{'id':_0x1ef868},'transaction':_0x19f8b9})[_0xd172('0x1e')](function(_0x3a1554){if(_0x3a1554){return db[_0xd172('0x7f')][_0xd172('0x35')]({'where':{'FaxAccountId':_0x1ef868},'transaction':_0x19f8b9})[_0xd172('0x1e')](function(){var _0xa6b5b4=_[_0xd172('0x3b')](_0x478d16,function(_0x635ca4){_0x635ca4[_0xd172('0x62')]=_0x1ef868;return _0x635ca4;});return db[_0xd172('0x7f')]['bulkCreate'](_0xa6b5b4,{'transaction':_0x19f8b9});});}else{_0x250a87=0x194;_0xb8353d=[];}});})[_0xd172('0x1e')](function(){if(_0x250a87!==0x194){return db['FaxApplication'][_0xd172('0x80')]({'where':{'FaxAccountId':_0x1ef868},'order':_0xd172('0x81')})['then'](function(_0x329a55){_0xb8353d=_0x329a55;});}})[_0xd172('0x29')](function(_0x30586a){_0x250a87=0x1f4;logger['error'](_0x30586a[_0xd172('0x37')]);if(_0x30586a[_0xd172('0x38')]){delete _0x30586a[_0xd172('0x38')];}_0xb8353d=_0x30586a;})['finally'](function(){if(_0xb8353d===null){_0x1f72a6[_0xd172('0x2a')](_0x250a87);}else{if(_0x250a87===0x1f4){_0x1f72a6[_0xd172('0x2b')](_0x250a87)[_0xd172('0x39')](_0xb8353d);}else{_0x1f72a6[_0xd172('0x2b')](_0x250a87)[_0xd172('0x2c')](_0xb8353d);}}});};exports[_0xd172('0x82')]=function(_0x456fc5,_0x25a0bc,_0x113880){var _0x18cb59={};var _0x383a8f={};var _0x1fb701;var _0x2a5c15;return db['FaxAccount'][_0xd172('0x6b')]({'where':{'id':_0x456fc5[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x25a0bc,null))[_0xd172('0x1e')](function(_0x2cdd28){if(_0x2cdd28){_0x1fb701=_0x2cdd28;_0x383a8f['model']=_[_0xd172('0x42')](db[_0xd172('0x7f')][_0xd172('0x3d')]);_0x383a8f[_0xd172('0x41')]=_['keys'](_0x456fc5[_0xd172('0x41')]);_0x383a8f[_0xd172('0x43')]=_[_0xd172('0x45')](_0x383a8f['model'],_0x383a8f[_0xd172('0x41')]);_0x18cb59[_0xd172('0x44')]=_[_0xd172('0x45')](_0x383a8f['model'],qs[_0xd172('0x46')](_0x456fc5[_0xd172('0x41')][_0xd172('0x46')]));_0x18cb59[_0xd172('0x44')]=_0x18cb59[_0xd172('0x44')]['length']?_0x18cb59[_0xd172('0x44')]:_0x383a8f[_0xd172('0x40')];_0x18cb59[_0xd172('0x65')]=qs['sort'](_0x456fc5[_0xd172('0x41')]['sort']);_0x18cb59[_0xd172('0x4d')]=qs[_0xd172('0x43')](_['pick'](_0x456fc5[_0xd172('0x41')],_0x383a8f[_0xd172('0x43')]));if(_0x456fc5['query'][_0xd172('0x4c')]){_0x18cb59[_0xd172('0x4d')]=_[_0xd172('0x4f')](_0x18cb59[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x18cb59[_0xd172('0x44')],function(_0xee35b7){var _0x442f91={};_0x442f91[_0xee35b7]={'$like':'%'+_0x456fc5[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x442f91;})});}_0x18cb59=_[_0xd172('0x4f')]({},_0x18cb59,_0x456fc5['options']);return _0x1fb701['getApplications'](_0x18cb59);}})['then'](function(_0xcc9685){if(_0xcc9685){_0x2a5c15=_0xcc9685['length'];if(!_0x456fc5[_0xd172('0x41')][_0xd172('0x48')](_0xd172('0x49'))){_0x18cb59[_0xd172('0x2e')]=qs[_0xd172('0x2e')](_0x456fc5[_0xd172('0x41')][_0xd172('0x2e')]);_0x18cb59['offset']=qs['offset'](_0x456fc5['query'][_0xd172('0x2d')]);}return _0x1fb701[_0xd172('0x82')](_0x18cb59);}})['then'](function(_0x45f53e){if(_0x45f53e){return _0x45f53e?{'count':_0x2a5c15,'rows':_0x45f53e}:null;}})['then'](respondWithResult(_0x25a0bc,null))['catch'](handleError(_0x25a0bc,null));};function Extension(_0x5c3cce,_0x5b5477,_0x2b79cd,_0x33745c){this[_0xd172('0x83')]=_0xd172('0x84');this[_0xd172('0x85')]=_0x5c3cce[_0xd172('0x86')];this[_0xd172('0x87')]=_0x33745c;this[_0xd172('0x3f')]=_0xd172('0x88');this[_0xd172('0x89')]=_0xd172('0x8a');this[_0xd172('0x62')]=_0x5c3cce['id'];this[_0xd172('0x81')]=_0x5b5477;this[_0xd172('0x8b')]=_0x2b79cd;}function createExtensionsReciveFax(_0xd8fca1){var _0x391d4c=0x1;var _0x4746df=[];_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'',_0xd172('0x8d')));_0x391d4c+=0x1;_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'CDR(type)=inbound-fax',_0xd172('0x8e')));_0x391d4c+=0x1;for(var _0x36cc7a in _0xd8fca1){if(_0xd8fca1['hasOwnProperty'](_0x36cc7a)&&(_0x36cc7a===_0xd172('0x8f')||_0x36cc7a===_0xd172('0x86')||_0x36cc7a===_0xd172('0x90')||_0x36cc7a===_0xd172('0x91')||_0x36cc7a===_0xd172('0x92')||_0x36cc7a==='maxrate'||_0x36cc7a===_0xd172('0x93')||_0x36cc7a===_0xd172('0x94')||_0x36cc7a==='t38timeout')){_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'FAXOPT('+_0x36cc7a+')='+_0xd8fca1[_0x36cc7a],_0xd172('0x8e')));_0x391d4c+=0x1;}}_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,'6',_0xd172('0x95')));_0x391d4c+=0x1;_0x4746df[_0xd172('0x8c')](new Extension(_0xd8fca1,_0x391d4c,_0xd172('0x96'),_0xd172('0x97')));_0x391d4c=0x0;return _0x4746df;}exports[_0xd172('0x98')]=function(_0x396e52,_0x335f1a,_0x258346){var _0x1d9940;return db[_0xd172('0x7b')][_0xd172('0x7c')](function(_0x482912){return db[_0xd172('0x3c')][_0xd172('0x58')](_0x396e52[_0xd172('0x59')],{'transaction':_0x482912})[_0xd172('0x1e')](function(_0x2d2760){_0x1d9940=_0x2d2760[_0xd172('0x99')]({'plain':!![]});return db[_0xd172('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x1d9940),{'transaction':_0x482912});});})['then'](function(){return _0x1d9940;})['then'](respondWithResult(_0x335f1a,null))[_0xd172('0x29')](handleError(_0x335f1a,null));};exports[_0xd172('0x9b')]=function(_0x2fcfa8,_0x539c8d,_0x58ca5a){var _0xd94a50;return db[_0xd172('0x7b')]['transaction'](function(_0x34f4cf){return db[_0xd172('0x3c')][_0xd172('0x33')](_0x2fcfa8[_0xd172('0x59')],{'where':{'id':_0x2fcfa8['body']['id']},'transaction':_0x34f4cf})[_0xd172('0x1e')](function(_0xa6d71e){return db[_0xd172('0x9a')][_0xd172('0x35')]({'where':{'FaxAccountId':_0x2fcfa8['body']['id']},'transaction':_0x34f4cf})[_0xd172('0x1e')](function(_0x2e6e79){return db[_0xd172('0x9a')][_0xd172('0x9c')](createExtensionsReciveFax(_['omit'](_0x2fcfa8[_0xd172('0x59')],['tech',_0xd172('0x9d'),_0xd172('0x9e'),_0xd172('0x9f'),'TrunkId',_0xd172('0xa0')])),{'transaction':_0x34f4cf});});});})['then'](function(){return db[_0xd172('0x3c')][_0xd172('0xa1')](_0x2fcfa8[_0xd172('0x59')]['id']);})[_0xd172('0x1e')](respondWithResult(_0x539c8d,null))['catch'](handleError(_0x539c8d,null));};exports[_0xd172('0xa2')]=function(_0x1ebb0b,_0x28a8fe,_0x38ad27){var _0x30541c={'raw':!![],'where':{}};var _0x5b5a56={};var _0x2ec67e={'count':0x0,'rows':[]};return db[_0xd172('0x3c')][_0xd172('0x6b')]({'where':{'id':_0x1ebb0b[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x28a8fe,null))['then'](function(_0x300c74){if(_0x300c74){_0x5b5a56[_0xd172('0x40')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x5b5a56[_0xd172('0x41')]=_[_0xd172('0x42')](_0x1ebb0b[_0xd172('0x41')]);_0x5b5a56[_0xd172('0x43')]=_[_0xd172('0x45')](_0x5b5a56['model'],_0x5b5a56[_0xd172('0x41')]);_0x30541c[_0xd172('0x44')]=_['intersection'](_0x5b5a56[_0xd172('0x40')],qs['fields'](_0x1ebb0b[_0xd172('0x41')][_0xd172('0x46')]));_0x30541c['attributes']=_0x30541c[_0xd172('0x44')][_0xd172('0x47')]?_0x30541c[_0xd172('0x44')]:_0x5b5a56['model'];if(!_0x1ebb0b['query']['hasOwnProperty']('nolimit')){_0x30541c['limit']=qs[_0xd172('0x2e')](_0x1ebb0b[_0xd172('0x41')][_0xd172('0x2e')]);_0x30541c['offset']=qs['offset'](_0x1ebb0b[_0xd172('0x41')]['offset']);}_0x30541c[_0xd172('0x65')]=qs['sort'](_0x1ebb0b[_0xd172('0x41')]['sort']);_0x30541c[_0xd172('0x4d')]=qs['filters'](_[_0xd172('0x4b')](_0x1ebb0b[_0xd172('0x41')],_0x5b5a56[_0xd172('0x43')]));_0x30541c[_0xd172('0x4d')][_0xd172('0x62')]=_0x300c74['id'];if(_0x1ebb0b['query'][_0xd172('0x4c')]){_0x30541c[_0xd172('0x4d')]=_[_0xd172('0x4f')](_0x30541c[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x30541c['attributes'],function(_0x112c8e){var _0x27bf97={};_0x27bf97[_0x112c8e]={'$like':'%'+_0x1ebb0b['query'][_0xd172('0x4c')]+'%'};return _0x27bf97;})});}if(_0x1ebb0b[_0xd172('0x41')][_0xd172('0xa3')]){var _0x51f617=_0x1ebb0b['query'][_0xd172('0xa3')][_0xd172('0xa4')](',');var _0x1f99b7={};_0x1f99b7[_0x51f617[0x0]]={'$gte':moment(_0x51f617[0x1])[_0xd172('0xa5')](_0xd172('0xa6'))};_0x30541c['where']=_['merge'](_0x30541c[_0xd172('0x4d')],_0x1f99b7);}_0x30541c=_[_0xd172('0x4f')]({},_0x30541c,_0x1ebb0b[_0xd172('0x50')]);return db[_0xd172('0xa7')][_0xd172('0x30')]({'where':_0x30541c['where']})['then'](function(_0x3601cb){_0x2ec67e['count']=_0x3601cb;if(_0x1ebb0b['query'][_0xd172('0x51')]){_0x30541c[_0xd172('0x52')]=[{'all':!![]}];}return db[_0xd172('0xa7')][_0xd172('0x53')](_0x30541c);})[_0xd172('0x1e')](function(_0x5c1534){_0x2ec67e[_0xd172('0x54')]=_0x5c1534;return _0x2ec67e;});}})[_0xd172('0x1e')](respondWithFilteredResult(_0x28a8fe,_0x30541c))[_0xd172('0x29')](handleError(_0x28a8fe,null));};exports[_0xd172('0x39')]=function(_0x137b0a,_0x5ea5fc,_0x2451ed){var _0x16ffb3,_0xf0bdbd={},_0x1f3238;if(_0x137b0a[_0xd172('0x59')]['to']){_0x1f3238=_0x137b0a[_0xd172('0x59')]['to'][0x0];}return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x137b0a[_0xd172('0x5f')]['id']},'include':[{'model':db[_0xd172('0xa8')],'as':_0xd172('0xa9'),'include':[{'model':db[_0xd172('0x71')],'as':'Contacts','where':{'fax':_0x1f3238},'limit':0x1,'order':[[_0xd172('0x9f'),_0xd172('0xaa')]]}]}]})[_0xd172('0x1e')](handleEntityNotFound(_0x5ea5fc,null))[_0xd172('0x1e')](function(_0x5e70ca){_0x16ffb3=_0x5e70ca;if(_0x137b0a[_0xd172('0x59')]['attachments']&&_0x137b0a['body']['attachments'][_0xd172('0x47')]){for(var _0x5d9dd7=0x0;_0x5d9dd7<_0x137b0a['body'][_0xd172('0xab')][_0xd172('0x47')];_0x5d9dd7+=0x1){_0x137b0a['body']['attachments'][_0x5d9dd7]={'filename':_0x137b0a['body']['attachments'][_0x5d9dd7][_0xd172('0x38')],'id':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][_0x5d9dd7]['id'],'path':path['join'](config[_0xd172('0xac')],_0xd172('0xad'),_0x137b0a['body']['attachments'][_0x5d9dd7][_0xd172('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0xd172('0xaf'),{'FaxAccountId':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x5f')]['id'])?undefined:_0x137b0a[_0xd172('0x5f')]['id'],'path':_[_0xd172('0xb0')](_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0x7')])?undefined:_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0x7')],'fax':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')]['to'][0x0])?undefined:_0x137b0a[_0xd172('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x16ffb3){if(_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')]['from'])){_0x137b0a[_0xd172('0x59')][_0xd172('0xb1')]=util[_0xd172('0xa5')](_0xd172('0xb2'),_0x16ffb3[_0xd172('0x38')],_0x16ffb3[_0xd172('0xb3')]);}if(_0x16ffb3[_0xd172('0xa9')]){if(_0x16ffb3[_0xd172('0xa9')][_0xd172('0xb4')][_0xd172('0x47')]){return _0x16ffb3[_0xd172('0xa9')][_0xd172('0xb4')][0x0];}else{return db['CmContact'][_0xd172('0x58')](_[_0xd172('0xb5')](_0x137b0a[_0xd172('0x59')],{'firstName':_0x137b0a[_0xd172('0x59')]['to'][0x0],'phone':_0x137b0a[_0xd172('0x59')]['to'][0x0],'fax':_0x137b0a['body']['to'][0x0],'ListId':_0x16ffb3[_0xd172('0xa0')]}));}}else{throw new Error(_0xd172('0xb6'));}}else{throw new Error(_0xd172('0xb7'));}})[_0xd172('0x1e')](function(_0x8d4f8f){if(_0x8d4f8f){return db[_0xd172('0x6e')]['find']({'where':{'ContactId':_0x8d4f8f['id'],'closed':![],'FaxAccountId':_0x16ffb3['id']}})[_0xd172('0x1e')](function(_0x360f57){if(_0x360f57){return[_0x360f57,![]];}return db[_0xd172('0x6e')][_0xd172('0x58')]({'UserId':_0x137b0a['user']['id'],'ContactId':_0x8d4f8f['id'],'FaxAccountId':_0x16ffb3['id'],'fax':_0x137b0a[_0xd172('0x59')]['to'][0x0],'firstMsgDirection':_0xd172('0xb8'),'Messages':[_['merge'](_0x137b0a[_0xd172('0x59')],{'read':![],'body':_0x137b0a['body'][_0xd172('0xab')][0x0][_0xd172('0xb9')],'FaxAccountId':_0x16ffb3['id'],'UserId':_0x137b0a[_0xd172('0x5a')]['id'],'ContactId':_0x8d4f8f['id'],'AttachmentId':_0x137b0a[_0xd172('0x59')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xd172('0xa7')],'as':_0xd172('0xba')}]})[_0xd172('0x1e')](function(_0x3d5981){return[_0x3d5981,!![]];});});}else{throw new Error(_0xd172('0xbb'));}})[_0xd172('0xbc')](function(_0x5ee489,_0x3c5219){if(_0x3c5219){return _0x5ee489;}return db['FaxMessage'][_0xd172('0x58')]({'direction':'out','read':![],'body':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0][_0xd172('0xb9')],'FaxAccountId':_0x16ffb3['id'],'FaxInteractionId':_0x5ee489['id'],'UserId':_0x137b0a[_0xd172('0x5a')]['id'],'ContactId':_0x5ee489[_0xd172('0xbd')],'AttachmentId':_0x137b0a['body']['attachments'][0x0]['id']})[_0xd172('0x1e')](function(_0x2dca04){_0x5ee489[_0xd172('0xbe')]['Messages']=[];_0x5ee489['dataValues'][_0xd172('0xba')]['push'](_0x2dca04[_0xd172('0xbe')]);return _0x5ee489;});})[_0xd172('0x1e')](function(_0x4be4d4){respondWithRpcPromise(_0xd172('0xbf'),_0xd172('0xbf'),{'FaxAccountId':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x5f')]['id'])?undefined:_0x137b0a['params']['id'],'path':_[_0xd172('0xb0')](_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0][_0xd172('0x7')])?undefined:_0x137b0a['body']['attachments'][0x0][_0xd172('0x7')],'fax':_[_0xd172('0xb0')](_0x137b0a['body']['to'][0x0])?undefined:_0x137b0a['body']['to'][0x0],'AttachmentId':_0x137b0a[_0xd172('0x59')][_0xd172('0xab')][0x0]['id']},client9002)[_0xd172('0x1e')](function(_0x104edf){logger[_0xd172('0x1f')](_0xd172('0xc0'),_0x104edf);})['catch'](function(_0x575ffd){logger['info'](_0xd172('0xc0'),_0x575ffd);});return _0x4be4d4;})['then'](respondWithResult(_0x5ea5fc,null))[_0xd172('0x29')](handleError(_0x5ea5fc,null));};exports[_0xd172('0xc1')]=function(_0x179a83,_0x1c99ce,_0x224be0){return db[_0xd172('0x3c')][_0xd172('0x57')]({'where':{'id':_0x179a83[_0xd172('0x5f')]['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x1c99ce,null))[_0xd172('0x1e')](function(_0x40737e){if(_0x40737e){return _0x40737e['addAgents'](_0x179a83[_0xd172('0x59')]['ids'],_[_0xd172('0x6f')](_0x179a83['body'],['ids','id'])||{})['spread'](function(_0xeeb724){for(var _0x55369c=0x0;_0x55369c<_0x179a83[_0xd172('0x59')][_0xd172('0x67')][_0xd172('0x47')];_0x55369c+=0x1){socket[_0xd172('0xc2')](_0xd172('0xc3'),{'UserId':Number(_0x179a83[_0xd172('0x59')][_0xd172('0x67')][_0x55369c]),'FaxAccountId':Number(_0x179a83[_0xd172('0x5f')]['id'])});}return _0xeeb724;});}})[_0xd172('0x1e')](respondWithResult(_0x1c99ce,null))[_0xd172('0x29')](handleError(_0x1c99ce,null));};exports[_0xd172('0xc4')]=function(_0x15d9b0,_0x151d65,_0x891479){return db[_0xd172('0x3c')]['find']({'where':{'id':_0x15d9b0['params']['id']}})['then'](handleEntityNotFound(_0x151d65,null))[_0xd172('0x1e')](function(_0x190688){if(_0x190688){return _0x190688[_0xd172('0xc4')](_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')])[_0xd172('0x1e')](function(){if(_[_0xd172('0xc5')](_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')])){for(var _0x241873=0x0;_0x241873<_0x15d9b0[_0xd172('0x41')][_0xd172('0x67')][_0xd172('0x47')];_0x241873+=0x1){socket[_0xd172('0xc2')](_0xd172('0xc6'),{'UserId':Number(_0x15d9b0[_0xd172('0x41')]['ids'][_0x241873]),'FaxAccountId':Number(_0x15d9b0[_0xd172('0x5f')]['id'])});}}else{socket[_0xd172('0xc2')](_0xd172('0xc6'),{'UserId':Number(_0x15d9b0['query']['ids']),'FaxAccountId':Number(_0x15d9b0[_0xd172('0x5f')]['id'])});}});}})[_0xd172('0x1e')](respondWithStatusCode(_0x151d65,null))[_0xd172('0x29')](handleError(_0x151d65,null));};exports['getAgents']=function(_0xe664d9,_0x8b4f8f,_0x406824){var _0x10dea5={};var _0x214dad={};var _0x35ab9a;var _0x18fd2b;return db[_0xd172('0x3c')]['findOne']({'where':{'id':_0xe664d9['params']['id']}})[_0xd172('0x1e')](handleEntityNotFound(_0x8b4f8f,null))[_0xd172('0x1e')](function(_0x235826){if(_0x235826){_0x35ab9a=_0x235826;_0x214dad[_0xd172('0x40')]=_[_0xd172('0x42')](db[_0xd172('0x73')]['rawAttributes']);_0x214dad[_0xd172('0x41')]=_['keys'](_0xe664d9['query']);_0x214dad[_0xd172('0x43')]=_['intersection'](_0x214dad[_0xd172('0x40')],_0x214dad['query']);_0x10dea5[_0xd172('0x44')]=_['intersection'](_0x214dad[_0xd172('0x40')],qs['fields'](_0xe664d9[_0xd172('0x41')]['fields']));_0x10dea5[_0xd172('0x44')]=_0x10dea5[_0xd172('0x44')][_0xd172('0x47')]?_0x10dea5[_0xd172('0x44')]:_0x214dad[_0xd172('0x40')];_0x10dea5[_0xd172('0x65')]=qs[_0xd172('0x4a')](_0xe664d9[_0xd172('0x41')][_0xd172('0x4a')]);_0x10dea5['where']=qs[_0xd172('0x43')](_['pick'](_0xe664d9[_0xd172('0x41')],_0x214dad['filters']));if(_0xe664d9['query'][_0xd172('0x4c')]){_0x10dea5['where']=_['merge'](_0x10dea5[_0xd172('0x4d')],{'$or':_[_0xd172('0x3b')](_0x10dea5[_0xd172('0x44')],function(_0x34e1d4){var _0x44e090={};_0x44e090[_0x34e1d4]={'$like':'%'+_0xe664d9[_0xd172('0x41')][_0xd172('0x4c')]+'%'};return _0x44e090;})});}_0x10dea5=_['merge']({},_0x10dea5,_0xe664d9[_0xd172('0x50')]);return _0x35ab9a[_0xd172('0xc7')](_0x10dea5);}})[_0xd172('0x1e')](function(_0x2aebc7){if(_0x2aebc7){_0x18fd2b=_0x2aebc7[_0xd172('0x47')];if(!_0xe664d9[_0xd172('0x41')]['hasOwnProperty']('nolimit')){_0x10dea5['limit']=qs[_0xd172('0x2e')](_0xe664d9['query'][_0xd172('0x2e')]);_0x10dea5['offset']=qs[_0xd172('0x2d')](_0xe664d9[_0xd172('0x41')][_0xd172('0x2d')]);}return _0x35ab9a[_0xd172('0xc7')](_0x10dea5);}})['then'](function(_0x3ac61c){if(_0x3ac61c){return _0x3ac61c?{'count':_0x18fd2b,'rows':_0x3ac61c}:null;}})[_0xd172('0x1e')](respondWithResult(_0x8b4f8f,null))[_0xd172('0x29')](handleError(_0x8b4f8f,null));}; \ No newline at end of file +var _0x81a4=['t38timeout','FAXOPT(','Set','/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','VoiceExtension','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','UserProfileResource','end','stack','name','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','create','body','get','role','user','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','FaxAccountId','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','ids','FaxInteraction','addInteraction','omit','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','type','system','description','Fax\x20Extension','appdata','push','Answer','ecm','faxdetect','headerinfo','maxrate','minrate','modem'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x81a4,0x1a7));var _0x481a=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x81a4[_0x56f7e2];return _0x36240b;};'use strict';var emlformat=require(_0x481a('0x0'));var rimraf=require(_0x481a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x481a('0x2'));var moment=require(_0x481a('0x3'));var BPromise=require(_0x481a('0x4'));var Mustache=require(_0x481a('0x5'));var util=require(_0x481a('0x6'));var path=require(_0x481a('0x7'));var sox=require('sox');var csv=require(_0x481a('0x8'));var ejs=require(_0x481a('0x9'));var fs=require('fs');var fs_extra=require(_0x481a('0xa'));var _=require('lodash');var squel=require(_0x481a('0xb'));var crypto=require(_0x481a('0xc'));var jsforce=require(_0x481a('0xd'));var deskjs=require(_0x481a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x481a('0xf'));var Papa=require('papaparse');var Redis=require(_0x481a('0x10'));var authService=require(_0x481a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x481a('0x12'));var logger=require(_0x481a('0x13'))(_0x481a('0x14'));var utils=require(_0x481a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x481a('0x16'));var db=require(_0x481a('0x17'))['db'];config[_0x481a('0x18')]=_['defaults'](config[_0x481a('0x18')],{'host':_0x481a('0x19'),'port':0x18eb});var socket=require(_0x481a('0x1a'))(new Redis(config[_0x481a('0x18')]));require(_0x481a('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x481a('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x481a('0x1c')][_0x481a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x416d33,_0x4525bd,_0x16b96c,_0x47dbde){return new BPromise(function(_0x45bf26,_0x70c399){var _0xa648c6=_0x47dbde||client;return _0xa648c6[_0x481a('0x1e')](_0x416d33,_0x16b96c)['then'](function(_0x171ad2){logger['info'](_0x481a('0x1f'),_0x4525bd,_0x481a('0x20'));logger['debug'](_0x481a('0x21'),_0x4525bd,_0x481a('0x20'),JSON[_0x481a('0x22')](_0x171ad2));if(_0x171ad2[_0x481a('0x23')]){if(_0x171ad2[_0x481a('0x23')][_0x481a('0x24')]===0x1f4){logger[_0x481a('0x23')](_0x481a('0x1f'),_0x4525bd,_0x171ad2[_0x481a('0x23')][_0x481a('0x25')]);return _0x70c399(_0x171ad2[_0x481a('0x23')][_0x481a('0x25')]);}logger[_0x481a('0x23')](_0x481a('0x1f'),_0x4525bd,_0x171ad2[_0x481a('0x23')][_0x481a('0x25')]);return _0x45bf26(_0x171ad2['error'][_0x481a('0x25')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4525bd,_0x481a('0x20'));_0x45bf26(_0x171ad2[_0x481a('0x26')]['message']);}})[_0x481a('0x27')](function(_0x231f94){logger[_0x481a('0x23')](_0x481a('0x1f'),_0x4525bd,_0x231f94);_0x70c399(_0x231f94);});});}function respondWithStatusCode(_0x317057,_0x25967c){_0x25967c=_0x25967c||0xcc;return function(_0x58f4ea){if(_0x58f4ea){return _0x317057['sendStatus'](_0x25967c);}return _0x317057[_0x481a('0x28')](_0x25967c)['end']();};}function respondWithResult(_0x3cf4a3,_0x53e55d){_0x53e55d=_0x53e55d||0xc8;return function(_0x1c7e64){if(_0x1c7e64){return _0x3cf4a3['status'](_0x53e55d)[_0x481a('0x29')](_0x1c7e64);}};}function respondWithFilteredResult(_0x2264a3,_0x38deeb){return function(_0x59ffb6){if(_0x59ffb6){var _0x2c63d9=typeof _0x38deeb[_0x481a('0x2a')]===_0x481a('0x2b')&&typeof _0x38deeb[_0x481a('0x2c')]===_0x481a('0x2b');var _0x2ef50c=_0x59ffb6['count'];var _0xad6d3e=_0x2c63d9?0x0:_0x38deeb[_0x481a('0x2a')];var _0x474e31=_0x2c63d9?_0x59ffb6[_0x481a('0x2d')]:_0x38deeb[_0x481a('0x2a')]+_0x38deeb[_0x481a('0x2c')];var _0x49f6b4;if(_0x474e31>=_0x2ef50c){_0x474e31=_0x2ef50c;_0x49f6b4=0xc8;}else{_0x49f6b4=0xce;}_0x2264a3['status'](_0x49f6b4);return _0x2264a3['set']('Content-Range',_0xad6d3e+'-'+_0x474e31+'/'+_0x2ef50c)[_0x481a('0x29')](_0x59ffb6);}return null;};}function patchUpdates(_0x2ba8cd){return function(_0x2af5e5){try{jsonpatch[_0x481a('0x2e')](_0x2af5e5,_0x2ba8cd,!![]);}catch(_0xff1461){return BPromise[_0x481a('0x2f')](_0xff1461);}return _0x2af5e5[_0x481a('0x30')]();};}function saveUpdates(_0x194ac0,_0x4c3235){return function(_0x44da22){if(_0x44da22){return _0x44da22[_0x481a('0x31')](_0x194ac0)[_0x481a('0x32')](function(_0x7de4b6){return _0x7de4b6;});}return null;};}function removeEntity(_0x2057be,_0x149caf){return function(_0xc944e1){if(_0xc944e1){return _0xc944e1[_0x481a('0x33')]()[_0x481a('0x32')](function(){var _0xbaf10b=_0xc944e1['get']({'plain':!![]});var _0x4ce4a1='FaxAccounts';return db[_0x481a('0x34')][_0x481a('0x33')]({'where':{'type':_0x4ce4a1,'resourceId':_0xbaf10b['id']}})['then'](function(){return _0xc944e1;});})[_0x481a('0x32')](function(){_0x2057be['status'](0xcc)[_0x481a('0x35')]();});}};}function handleEntityNotFound(_0x3cf1e2,_0x2e8753){return function(_0x5570c2){if(!_0x5570c2){_0x3cf1e2['sendStatus'](0x194);}return _0x5570c2;};}function handleError(_0x105c91,_0x55f92c){_0x55f92c=_0x55f92c||0x1f4;return function(_0x582b73){logger['error'](_0x582b73[_0x481a('0x36')]);if(_0x582b73[_0x481a('0x37')]){delete _0x582b73[_0x481a('0x37')];}_0x105c91[_0x481a('0x28')](_0x55f92c)['send'](_0x582b73);};}exports['index']=function(_0xb0261e,_0x4cc102){var _0x5275c7={'include':[{'model':db[_0x481a('0x38')],'as':_0x481a('0x39')}]},_0x3de702={},_0x3ebab6={'count':0x0,'rows':[]};var _0x57f55e=_['map'](db[_0x481a('0x3a')][_0x481a('0x3b')],function(_0x622318){return{'name':_0x622318['fieldName'],'type':_0x622318['type'][_0x481a('0x3c')]};});_0x3de702[_0x481a('0x3d')]=_[_0x481a('0x3e')](_0x57f55e,'name');_0x3de702[_0x481a('0x3f')]=_[_0x481a('0x40')](_0xb0261e[_0x481a('0x3f')]);_0x3de702[_0x481a('0x41')]=_[_0x481a('0x42')](_0x3de702[_0x481a('0x3d')],_0x3de702[_0x481a('0x3f')]);_0x5275c7[_0x481a('0x43')]=_[_0x481a('0x42')](_0x3de702[_0x481a('0x3d')],qs['fields'](_0xb0261e['query'][_0x481a('0x44')]));_0x5275c7['attributes']=_0x5275c7[_0x481a('0x43')][_0x481a('0x45')]?_0x5275c7['attributes']:_0x3de702[_0x481a('0x3d')];if(!_0xb0261e[_0x481a('0x3f')][_0x481a('0x46')](_0x481a('0x47'))){_0x5275c7[_0x481a('0x2c')]=qs[_0x481a('0x2c')](_0xb0261e[_0x481a('0x3f')][_0x481a('0x2c')]);_0x5275c7[_0x481a('0x2a')]=qs['offset'](_0xb0261e[_0x481a('0x3f')][_0x481a('0x2a')]);}_0x5275c7[_0x481a('0x48')]=qs[_0x481a('0x49')](_0xb0261e[_0x481a('0x3f')][_0x481a('0x49')]);_0x5275c7[_0x481a('0x4a')]=qs[_0x481a('0x41')](_['pick'](_0xb0261e[_0x481a('0x3f')],_0x3de702['filters']),_0x57f55e);if(_0xb0261e[_0x481a('0x3f')][_0x481a('0x4b')]){_0x5275c7[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x5275c7[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0x57f55e,function(_0x5cf6e4){if(_0x5cf6e4['type']!==_0x481a('0x4d')){var _0x2ca46b={};_0x2ca46b[_0x5cf6e4[_0x481a('0x37')]]={'$like':'%'+_0xb0261e['query'][_0x481a('0x4b')]+'%'};return _0x2ca46b;}})});}_0x5275c7=_[_0x481a('0x4c')]({},_0x5275c7,_0xb0261e['options']);var _0x1343aa={'where':_0x5275c7['where']};return db[_0x481a('0x3a')]['count'](_0x1343aa)[_0x481a('0x32')](function(_0x38402a){_0x3ebab6['count']=_0x38402a;if(_0xb0261e[_0x481a('0x3f')][_0x481a('0x4e')]){_0x5275c7['include']=[{'all':!![]}];}return db['FaxAccount'][_0x481a('0x4f')](_0x5275c7);})[_0x481a('0x32')](function(_0x2e805f){_0x3ebab6[_0x481a('0x50')]=_0x2e805f;return _0x3ebab6;})[_0x481a('0x32')](respondWithFilteredResult(_0x4cc102,_0x5275c7))[_0x481a('0x27')](handleError(_0x4cc102,null));};exports[_0x481a('0x51')]=function(_0x221817,_0x331665){var _0x48bcde={'raw':![],'where':{'id':_0x221817[_0x481a('0x52')]['id']},'include':[{'model':db[_0x481a('0x38')],'as':_0x481a('0x39')}]},_0x2ad03a={};_0x2ad03a['model']=_['keys'](db[_0x481a('0x3a')][_0x481a('0x3b')]);_0x2ad03a[_0x481a('0x3f')]=_[_0x481a('0x40')](_0x221817[_0x481a('0x3f')]);_0x2ad03a['filters']=_[_0x481a('0x42')](_0x2ad03a[_0x481a('0x3d')],_0x2ad03a[_0x481a('0x3f')]);_0x48bcde[_0x481a('0x43')]=_[_0x481a('0x42')](_0x2ad03a[_0x481a('0x3d')],qs[_0x481a('0x44')](_0x221817[_0x481a('0x3f')][_0x481a('0x44')]));_0x48bcde[_0x481a('0x43')]=_0x48bcde[_0x481a('0x43')][_0x481a('0x45')]?_0x48bcde[_0x481a('0x43')]:_0x2ad03a[_0x481a('0x3d')];if(_0x221817['query'][_0x481a('0x4e')]){_0x48bcde[_0x481a('0x53')]=[{'all':!![]}];}_0x48bcde=_[_0x481a('0x4c')]({},_0x48bcde,_0x221817[_0x481a('0x54')]);return db[_0x481a('0x3a')]['find'](_0x48bcde)[_0x481a('0x32')](handleEntityNotFound(_0x331665,null))['then'](respondWithResult(_0x331665,null))[_0x481a('0x27')](handleError(_0x331665,null));};exports['create']=function(_0x444db8,_0x40d7d6){return db['FaxAccount'][_0x481a('0x55')](_0x444db8[_0x481a('0x56')],{})[_0x481a('0x32')](function(_0x246df9){var _0x204efc=_0x444db8['user'][_0x481a('0x57')]({'plain':!![]});if(!_0x204efc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x204efc[_0x481a('0x58')]===_0x481a('0x59')){var _0x1a15e9=_0x246df9['get']({'plain':!![]});var _0x38bdab=_0x481a('0x5a');return db[_0x481a('0x5b')]['find']({'where':{'name':_0x38bdab,'userProfileId':_0x204efc[_0x481a('0x5c')]},'raw':!![]})[_0x481a('0x32')](function(_0x2c1ada){if(_0x2c1ada&&_0x2c1ada['autoAssociation']===0x0){return db[_0x481a('0x34')][_0x481a('0x55')]({'name':_0x1a15e9[_0x481a('0x37')],'resourceId':_0x1a15e9['id'],'type':_0x2c1ada[_0x481a('0x37')],'sectionId':_0x2c1ada['id']},{})[_0x481a('0x32')](function(){return _0x246df9;});}else{return _0x246df9;}})[_0x481a('0x27')](function(_0x18c4a3){logger[_0x481a('0x23')](_0x481a('0x5d'),_0x18c4a3);throw _0x18c4a3;});}return _0x246df9;})[_0x481a('0x32')](respondWithResult(_0x40d7d6,0xc9))[_0x481a('0x27')](handleError(_0x40d7d6,null));};exports[_0x481a('0x31')]=function(_0x3e0a84,_0x549b9a){if(_0x3e0a84[_0x481a('0x56')]['id']){delete _0x3e0a84[_0x481a('0x56')]['id'];}return db['FaxAccount'][_0x481a('0x5e')]({'where':{'id':_0x3e0a84[_0x481a('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x481a('0x39')}]})['then'](handleEntityNotFound(_0x549b9a,null))[_0x481a('0x32')](saveUpdates(_0x3e0a84[_0x481a('0x56')],null))[_0x481a('0x32')](respondWithResult(_0x549b9a,null))['catch'](handleError(_0x549b9a,null));};exports['destroy']=function(_0x3d50d3,_0x371597){return db[_0x481a('0x3a')][_0x481a('0x5e')]({'where':{'id':_0x3d50d3[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x371597,null))[_0x481a('0x32')](removeEntity(_0x371597,null))[_0x481a('0x27')](handleError(_0x371597,null));};exports[_0x481a('0x5f')]=function(_0x2ba6e1,_0x5cc104){return db[_0x481a('0x3a')]['describe']()['then'](respondWithResult(_0x5cc104,null))[_0x481a('0x27')](handleError(_0x5cc104,null));};exports['addDisposition']=function(_0x4cff59,_0x4e79ba,_0xb2e31e){if(_0x4cff59[_0x481a('0x56')]['id']){delete _0x4cff59[_0x481a('0x56')]['id'];}return db['FaxAccount'][_0x481a('0x5e')]({'where':{'id':_0x4cff59[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x4e79ba,null))[_0x481a('0x32')](function(_0x3be6ef){if(_0x3be6ef){_0x4cff59[_0x481a('0x56')][_0x481a('0x60')]=_0x3be6ef['id'];return db['Disposition'][_0x481a('0x55')](_0x4cff59['body']);}})[_0x481a('0x32')](respondWithResult(_0x4e79ba,null))['catch'](handleError(_0x4e79ba,null));};exports['getDispositions']=function(_0x3a6d4e,_0x3c3225,_0x40dd5e){var _0xd5650d={'raw':![],'where':{}};var _0x3030d3={};var _0x359b4d={'count':0x0,'rows':[]};return db[_0x481a('0x3a')][_0x481a('0x61')]({'where':{'id':_0x3a6d4e[_0x481a('0x52')]['id']}})['then'](handleEntityNotFound(_0x3c3225,null))[_0x481a('0x32')](function(_0x1bd361){if(_0x1bd361){_0x3030d3[_0x481a('0x3d')]=_[_0x481a('0x40')](db['Disposition']['rawAttributes']);_0x3030d3[_0x481a('0x3f')]=_[_0x481a('0x40')](_0x3a6d4e[_0x481a('0x3f')]);_0x3030d3[_0x481a('0x41')]=_['intersection'](_0x3030d3[_0x481a('0x3d')],_0x3030d3['query']);_0xd5650d['attributes']=_['intersection'](_0x3030d3[_0x481a('0x3d')],qs['fields'](_0x3a6d4e[_0x481a('0x3f')][_0x481a('0x44')]));_0xd5650d[_0x481a('0x43')]=_0xd5650d[_0x481a('0x43')][_0x481a('0x45')]?_0xd5650d[_0x481a('0x43')]:_0x3030d3[_0x481a('0x3d')];if(!_0x3a6d4e[_0x481a('0x3f')]['hasOwnProperty']('nolimit')){_0xd5650d['limit']=qs['limit'](_0x3a6d4e[_0x481a('0x3f')]['limit']);_0xd5650d['offset']=qs[_0x481a('0x2a')](_0x3a6d4e[_0x481a('0x3f')][_0x481a('0x2a')]);}_0xd5650d[_0x481a('0x48')]=qs[_0x481a('0x49')](_0x3a6d4e['query'][_0x481a('0x49')]);_0xd5650d['where']=qs['filters'](_['pick'](_0x3a6d4e[_0x481a('0x3f')],_0x3030d3[_0x481a('0x41')]));_0xd5650d[_0x481a('0x4a')][_0x481a('0x60')]=_0x1bd361['id'];if(_0x3a6d4e['query']['filter']){_0xd5650d[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0xd5650d[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0xd5650d['attributes'],function(_0x1bdfc0){var _0x1ca23f={};_0x1ca23f[_0x1bdfc0]={'$like':'%'+_0x3a6d4e[_0x481a('0x3f')][_0x481a('0x4b')]+'%'};return _0x1ca23f;})});}_0xd5650d=_[_0x481a('0x4c')]({},_0xd5650d,_0x3a6d4e[_0x481a('0x54')]);return db[_0x481a('0x62')][_0x481a('0x2d')]({'where':_0xd5650d[_0x481a('0x4a')]})[_0x481a('0x32')](function(_0x443af8){_0x359b4d[_0x481a('0x2d')]=_0x443af8;if(_0x3a6d4e[_0x481a('0x3f')][_0x481a('0x4e')]){_0xd5650d[_0x481a('0x53')]=[{'all':!![]}];}return db[_0x481a('0x62')][_0x481a('0x4f')](_0xd5650d);})[_0x481a('0x32')](function(_0x5cd5dc){_0x359b4d[_0x481a('0x50')]=_0x5cd5dc;return _0x359b4d;});}})[_0x481a('0x32')](respondWithFilteredResult(_0x3c3225,_0xd5650d))['catch'](handleError(_0x3c3225,null));};exports['removeDispositions']=function(_0x32925e,_0x23dc07,_0x29205c){return db[_0x481a('0x3a')][_0x481a('0x5e')]({'where':{'id':_0x32925e[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x23dc07,null))['then'](function(_0x476ec2){if(_0x476ec2){return _0x476ec2[_0x481a('0x63')](_0x32925e['query']['ids']);}})[_0x481a('0x32')](respondWithStatusCode(_0x23dc07,null))[_0x481a('0x27')](handleError(_0x23dc07,null));};exports[_0x481a('0x64')]=function(_0xaf31f8,_0x291fa1,_0x30b6a8){if(_0xaf31f8['body']['id']){delete _0xaf31f8[_0x481a('0x56')]['id'];}return db[_0x481a('0x3a')]['find']({'where':{'id':_0xaf31f8['params']['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x291fa1,null))['then'](function(_0x2d8c37){if(_0x2d8c37){_0xaf31f8[_0x481a('0x56')][_0x481a('0x60')]=_0x2d8c37['id'];return db[_0x481a('0x65')][_0x481a('0x55')](_0xaf31f8[_0x481a('0x56')]);}})[_0x481a('0x32')](respondWithResult(_0x291fa1,null))[_0x481a('0x27')](handleError(_0x291fa1,null));};exports[_0x481a('0x66')]=function(_0x552ecb,_0xe7b5ad,_0x1e59ba){var _0x502992={'raw':![],'where':{}};var _0xe7e3ea={};var _0x44a2d5={'count':0x0,'rows':[]};return db[_0x481a('0x3a')]['findOne']({'where':{'id':_0x552ecb[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0xe7b5ad,null))[_0x481a('0x32')](function(_0x315080){if(_0x315080){_0xe7e3ea['model']=_[_0x481a('0x40')](db[_0x481a('0x65')][_0x481a('0x3b')]);_0xe7e3ea['query']=_['keys'](_0x552ecb[_0x481a('0x3f')]);_0xe7e3ea[_0x481a('0x41')]=_[_0x481a('0x42')](_0xe7e3ea[_0x481a('0x3d')],_0xe7e3ea[_0x481a('0x3f')]);_0x502992['attributes']=_[_0x481a('0x42')](_0xe7e3ea[_0x481a('0x3d')],qs[_0x481a('0x44')](_0x552ecb[_0x481a('0x3f')][_0x481a('0x44')]));_0x502992[_0x481a('0x43')]=_0x502992[_0x481a('0x43')][_0x481a('0x45')]?_0x502992['attributes']:_0xe7e3ea[_0x481a('0x3d')];if(!_0x552ecb[_0x481a('0x3f')][_0x481a('0x46')](_0x481a('0x47'))){_0x502992[_0x481a('0x2c')]=qs[_0x481a('0x2c')](_0x552ecb['query']['limit']);_0x502992[_0x481a('0x2a')]=qs[_0x481a('0x2a')](_0x552ecb['query']['offset']);}_0x502992['order']=qs[_0x481a('0x49')](_0x552ecb[_0x481a('0x3f')]['sort']);_0x502992[_0x481a('0x4a')]=qs[_0x481a('0x41')](_[_0x481a('0x67')](_0x552ecb[_0x481a('0x3f')],_0xe7e3ea[_0x481a('0x41')]));_0x502992[_0x481a('0x4a')]['FaxAccountId']=_0x315080['id'];if(_0x552ecb[_0x481a('0x3f')][_0x481a('0x4b')]){_0x502992[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x502992['where'],{'$or':_[_0x481a('0x3e')](_0x502992[_0x481a('0x43')],function(_0xb9a3a4){var _0x560ef1={};_0x560ef1[_0xb9a3a4]={'$like':'%'+_0x552ecb[_0x481a('0x3f')][_0x481a('0x4b')]+'%'};return _0x560ef1;})});}_0x502992=_['merge']({},_0x502992,_0x552ecb['options']);return db[_0x481a('0x65')][_0x481a('0x2d')]({'where':_0x502992[_0x481a('0x4a')]})[_0x481a('0x32')](function(_0x21be93){_0x44a2d5[_0x481a('0x2d')]=_0x21be93;if(_0x552ecb[_0x481a('0x3f')][_0x481a('0x4e')]){_0x502992[_0x481a('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x481a('0x4f')](_0x502992);})[_0x481a('0x32')](function(_0x5cedd2){_0x44a2d5[_0x481a('0x50')]=_0x5cedd2;return _0x44a2d5;});}})[_0x481a('0x32')](respondWithFilteredResult(_0xe7b5ad,_0x502992))[_0x481a('0x27')](handleError(_0xe7b5ad,null));};exports['removeAnswers']=function(_0x424459,_0x27c369,_0x414c47){return db[_0x481a('0x3a')]['find']({'where':{'id':_0x424459[_0x481a('0x52')]['id']}})['then'](handleEntityNotFound(_0x27c369,null))[_0x481a('0x32')](function(_0x4459df){if(_0x4459df){return _0x4459df[_0x481a('0x68')](_0x424459[_0x481a('0x3f')][_0x481a('0x69')]);}})[_0x481a('0x32')](respondWithStatusCode(_0x27c369,null))[_0x481a('0x27')](handleError(_0x27c369,null));};exports['addInteraction']=function(_0x21d951,_0x221c4b,_0x17e64a){return db[_0x481a('0x6a')][_0x481a('0x5e')]({'where':{'id':_0x21d951[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x221c4b,null))[_0x481a('0x32')](function(_0x283ae8){if(_0x283ae8){return _0x283ae8[_0x481a('0x6b')](_0x21d951[_0x481a('0x56')][_0x481a('0x69')],_[_0x481a('0x6c')](_0x21d951[_0x481a('0x56')],[_0x481a('0x69'),'id'])||{});}})['then'](respondWithResult(_0x221c4b,null))[_0x481a('0x27')](handleError(_0x221c4b,null));};exports['getInteractions']=function(_0x593d71,_0x41b5bb,_0x2e26de){var _0x3134d9={'raw':![],'where':{}};var _0x3505f8={};var _0x41d893={'count':0x0,'rows':[]};return db[_0x481a('0x3a')][_0x481a('0x61')]({'where':{'id':_0x593d71['params']['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x41b5bb,null))[_0x481a('0x32')](function(_0x5cb332){if(_0x5cb332){_0x3505f8[_0x481a('0x3d')]=_[_0x481a('0x40')](db[_0x481a('0x6a')][_0x481a('0x3b')]);_0x3505f8[_0x481a('0x3f')]=_['keys'](_0x593d71[_0x481a('0x3f')]);_0x3505f8[_0x481a('0x41')]=_[_0x481a('0x42')](_0x3505f8[_0x481a('0x3d')],_0x3505f8[_0x481a('0x3f')]);_0x3134d9[_0x481a('0x43')]=_[_0x481a('0x42')](_0x3505f8['model'],qs[_0x481a('0x44')](_0x593d71[_0x481a('0x3f')]['fields']));_0x3134d9[_0x481a('0x43')]=_0x3134d9['attributes']['length']?_0x3134d9[_0x481a('0x43')]:_0x3505f8[_0x481a('0x3d')];if(!_0x593d71['query'][_0x481a('0x46')](_0x481a('0x47'))){_0x3134d9[_0x481a('0x2c')]=qs[_0x481a('0x2c')](_0x593d71['query'][_0x481a('0x2c')]);_0x3134d9[_0x481a('0x2a')]=qs['offset'](_0x593d71[_0x481a('0x3f')]['offset']);}_0x3134d9[_0x481a('0x48')]=qs[_0x481a('0x49')](_0x593d71[_0x481a('0x3f')]['sort']);_0x3134d9[_0x481a('0x4a')]=qs[_0x481a('0x41')](_[_0x481a('0x67')](_0x593d71[_0x481a('0x3f')],_0x3505f8[_0x481a('0x41')]));_0x3134d9['where']['FaxAccountId']=_0x5cb332['id'];if(_0x593d71[_0x481a('0x3f')]['filter']){_0x3134d9[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x3134d9[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0x3134d9[_0x481a('0x43')],function(_0x8bedae){var _0x1be320={};_0x1be320[_0x8bedae]={'$like':'%'+_0x593d71[_0x481a('0x3f')][_0x481a('0x4b')]+'%'};return _0x1be320;})});}_0x3134d9=_[_0x481a('0x4c')]({},_0x3134d9,_0x593d71[_0x481a('0x54')]);return db['FaxInteraction']['count']({'where':_0x3134d9[_0x481a('0x4a')]})[_0x481a('0x32')](function(_0x34e983){_0x41d893[_0x481a('0x2d')]=_0x34e983;if(_0x593d71[_0x481a('0x3f')]['includeAll']){_0x3134d9['include']=[{'model':db[_0x481a('0x6d')],'as':'Contact','required':![]},{'model':db[_0x481a('0x6e')],'as':_0x481a('0x6f'),'attributes':['name',_0x481a('0x70'),_0x481a('0x71')],'required':![]},{'model':db['Tag'],'as':_0x481a('0x72'),'attributes':['id',_0x481a('0x37'),_0x481a('0x73')],'where':_0x593d71[_0x481a('0x3f')][_0x481a('0x74')]?{'id':_0x593d71[_0x481a('0x3f')][_0x481a('0x74')]}:undefined,'required':_0x593d71['query']['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x3134d9);})['then'](function(_0x3d3f11){_0x41d893[_0x481a('0x50')]=_0x3d3f11;return _0x41d893;});}})[_0x481a('0x32')](respondWithFilteredResult(_0x41b5bb,_0x3134d9))[_0x481a('0x27')](handleError(_0x41b5bb,null));};exports[_0x481a('0x75')]=function(_0x49fd25,_0x2fa064){var _0x903492=_0x49fd25['params']['id'];var _0x2a9e1b=_0x49fd25[_0x481a('0x56')];var _0x524ef1=0xc8;var _0xc0da2d=null;return db[_0x481a('0x76')][_0x481a('0x77')]({'isolationLevel':db[_0x481a('0x76')][_0x481a('0x78')][_0x481a('0x79')]['READ_COMMITTED']},function(_0x4b9198){return db[_0x481a('0x3a')][_0x481a('0x61')]({'where':{'id':_0x903492},'transaction':_0x4b9198})[_0x481a('0x32')](function(_0x5aec65){if(_0x5aec65){return db[_0x481a('0x7a')][_0x481a('0x33')]({'where':{'FaxAccountId':_0x903492},'transaction':_0x4b9198})[_0x481a('0x32')](function(){var _0x3200de=_['map'](_0x2a9e1b,function(_0x40fe13){_0x40fe13[_0x481a('0x60')]=_0x903492;return _0x40fe13;});return db[_0x481a('0x7a')][_0x481a('0x7b')](_0x3200de,{'transaction':_0x4b9198});});}else{_0x524ef1=0x194;_0xc0da2d=[];}});})[_0x481a('0x32')](function(){if(_0x524ef1!==0x194){return db['FaxApplication'][_0x481a('0x7c')]({'where':{'FaxAccountId':_0x903492},'order':_0x481a('0x7d')})[_0x481a('0x32')](function(_0x4844a3){_0xc0da2d=_0x4844a3;});}})[_0x481a('0x27')](function(_0x3b0b01){_0x524ef1=0x1f4;logger[_0x481a('0x23')](_0x3b0b01['stack']);if(_0x3b0b01[_0x481a('0x37')]){delete _0x3b0b01[_0x481a('0x37')];}_0xc0da2d=_0x3b0b01;})[_0x481a('0x7e')](function(){if(_0xc0da2d===null){_0x2fa064['sendStatus'](_0x524ef1);}else{if(_0x524ef1===0x1f4){_0x2fa064['status'](_0x524ef1)[_0x481a('0x7f')](_0xc0da2d);}else{_0x2fa064[_0x481a('0x28')](_0x524ef1)[_0x481a('0x29')](_0xc0da2d);}}});};exports[_0x481a('0x80')]=function(_0x3cf29a,_0x120f69,_0x30c2f4){var _0x22afa6={};var _0x45ceac={};var _0xadc5e1;var _0x3858ee;return db[_0x481a('0x3a')][_0x481a('0x61')]({'where':{'id':_0x3cf29a[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x120f69,null))['then'](function(_0x189e1a){if(_0x189e1a){_0xadc5e1=_0x189e1a;_0x45ceac[_0x481a('0x3d')]=_[_0x481a('0x40')](db['FaxApplication']['rawAttributes']);_0x45ceac[_0x481a('0x3f')]=_[_0x481a('0x40')](_0x3cf29a[_0x481a('0x3f')]);_0x45ceac[_0x481a('0x41')]=_['intersection'](_0x45ceac[_0x481a('0x3d')],_0x45ceac[_0x481a('0x3f')]);_0x22afa6[_0x481a('0x43')]=_['intersection'](_0x45ceac[_0x481a('0x3d')],qs[_0x481a('0x44')](_0x3cf29a['query']['fields']));_0x22afa6[_0x481a('0x43')]=_0x22afa6[_0x481a('0x43')][_0x481a('0x45')]?_0x22afa6[_0x481a('0x43')]:_0x45ceac[_0x481a('0x3d')];_0x22afa6[_0x481a('0x48')]=qs[_0x481a('0x49')](_0x3cf29a['query'][_0x481a('0x49')]);_0x22afa6[_0x481a('0x4a')]=qs[_0x481a('0x41')](_[_0x481a('0x67')](_0x3cf29a[_0x481a('0x3f')],_0x45ceac[_0x481a('0x41')]));if(_0x3cf29a['query'][_0x481a('0x4b')]){_0x22afa6[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x22afa6[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0x22afa6[_0x481a('0x43')],function(_0x988fa9){var _0x32a71f={};_0x32a71f[_0x988fa9]={'$like':'%'+_0x3cf29a['query'][_0x481a('0x4b')]+'%'};return _0x32a71f;})});}_0x22afa6=_[_0x481a('0x4c')]({},_0x22afa6,_0x3cf29a[_0x481a('0x54')]);return _0xadc5e1['getApplications'](_0x22afa6);}})['then'](function(_0x5f22cd){if(_0x5f22cd){_0x3858ee=_0x5f22cd[_0x481a('0x45')];if(!_0x3cf29a[_0x481a('0x3f')][_0x481a('0x46')](_0x481a('0x47'))){_0x22afa6['limit']=qs[_0x481a('0x2c')](_0x3cf29a[_0x481a('0x3f')]['limit']);_0x22afa6[_0x481a('0x2a')]=qs[_0x481a('0x2a')](_0x3cf29a['query'][_0x481a('0x2a')]);}return _0xadc5e1[_0x481a('0x80')](_0x22afa6);}})['then'](function(_0x539a1d){if(_0x539a1d){return _0x539a1d?{'count':_0x3858ee,'rows':_0x539a1d}:null;}})[_0x481a('0x32')](respondWithResult(_0x120f69,null))[_0x481a('0x27')](handleError(_0x120f69,null));};function Extension(_0x17f280,_0x5f3270,_0x557bbe,_0x3cc154){this[_0x481a('0x81')]=_0x481a('0x82');this[_0x481a('0x83')]=_0x17f280[_0x481a('0x84')];this[_0x481a('0x85')]=_0x3cc154;this[_0x481a('0x86')]=_0x481a('0x87');this[_0x481a('0x88')]=_0x481a('0x89');this['FaxAccountId']=_0x17f280['id'];this[_0x481a('0x7d')]=_0x5f3270;this[_0x481a('0x8a')]=_0x557bbe;}function createExtensionsReciveFax(_0x38dba4){var _0x4d6c96=0x1;var _0x6eedb8=[];_0x6eedb8[_0x481a('0x8b')](new Extension(_0x38dba4,_0x4d6c96,'',_0x481a('0x8c')));_0x4d6c96+=0x1;_0x6eedb8['push'](new Extension(_0x38dba4,_0x4d6c96,'CDR(type)=inbound-fax','Set'));_0x4d6c96+=0x1;for(var _0x45b423 in _0x38dba4){if(_0x38dba4[_0x481a('0x46')](_0x45b423)&&(_0x45b423===_0x481a('0x8d')||_0x45b423===_0x481a('0x84')||_0x45b423==='gateway'||_0x45b423===_0x481a('0x8e')||_0x45b423===_0x481a('0x8f')||_0x45b423===_0x481a('0x90')||_0x45b423===_0x481a('0x91')||_0x45b423===_0x481a('0x92')||_0x45b423===_0x481a('0x93'))){_0x6eedb8[_0x481a('0x8b')](new Extension(_0x38dba4,_0x4d6c96,_0x481a('0x94')+_0x45b423+')='+_0x38dba4[_0x45b423],_0x481a('0x95')));_0x4d6c96+=0x1;}}_0x6eedb8[_0x481a('0x8b')](new Extension(_0x38dba4,_0x4d6c96,'6','Wait'));_0x4d6c96+=0x1;_0x6eedb8[_0x481a('0x8b')](new Extension(_0x38dba4,_0x4d6c96,_0x481a('0x96'),'ReceiveFax'));_0x4d6c96=0x0;return _0x6eedb8;}exports['addAccountApplications']=function(_0x295fc7,_0x5b4246,_0x20983e){var _0x1e5b00;return db['sequelize'][_0x481a('0x77')](function(_0x5b12ec){return db[_0x481a('0x3a')][_0x481a('0x55')](_0x295fc7[_0x481a('0x56')],{'transaction':_0x5b12ec})[_0x481a('0x32')](function(_0x336c08){_0x1e5b00=_0x336c08[_0x481a('0x57')]({'plain':!![]});return db['VoiceExtension'][_0x481a('0x7b')](createExtensionsReciveFax(_0x1e5b00),{'transaction':_0x5b12ec});});})[_0x481a('0x32')](function(){return _0x1e5b00;})['then'](respondWithResult(_0x5b4246,null))[_0x481a('0x27')](handleError(_0x5b4246,null));};exports['updateAccountApplications']=function(_0xa53b73,_0x26f0ba,_0x5b1a08){var _0x2692cf;return db[_0x481a('0x76')][_0x481a('0x77')](function(_0x44c63a){return db['FaxAccount'][_0x481a('0x31')](_0xa53b73[_0x481a('0x56')],{'where':{'id':_0xa53b73['body']['id']},'transaction':_0x44c63a})[_0x481a('0x32')](function(_0x433ce8){return db[_0x481a('0x97')][_0x481a('0x33')]({'where':{'FaxAccountId':_0xa53b73[_0x481a('0x56')]['id']},'transaction':_0x44c63a})[_0x481a('0x32')](function(_0x9d266a){return db[_0x481a('0x97')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0xa53b73[_0x481a('0x56')],['tech',_0x481a('0x3c'),'createdAt','updatedAt',_0x481a('0x98'),_0x481a('0x99')])),{'transaction':_0x44c63a});});});})[_0x481a('0x32')](function(){return db[_0x481a('0x3a')][_0x481a('0x9a')](_0xa53b73[_0x481a('0x56')]['id']);})[_0x481a('0x32')](respondWithResult(_0x26f0ba,null))['catch'](handleError(_0x26f0ba,null));};exports[_0x481a('0x9b')]=function(_0xc04154,_0x5e8e88,_0x457fed){var _0x217e5f={'raw':!![],'where':{}};var _0x543104={};var _0x201b85={'count':0x0,'rows':[]};return db[_0x481a('0x3a')]['findOne']({'where':{'id':_0xc04154['params']['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x5e8e88,null))[_0x481a('0x32')](function(_0x4e36ce){if(_0x4e36ce){_0x543104['model']=_[_0x481a('0x40')](db[_0x481a('0x9c')][_0x481a('0x3b')]);_0x543104['query']=_['keys'](_0xc04154['query']);_0x543104[_0x481a('0x41')]=_[_0x481a('0x42')](_0x543104['model'],_0x543104['query']);_0x217e5f['attributes']=_[_0x481a('0x42')](_0x543104[_0x481a('0x3d')],qs[_0x481a('0x44')](_0xc04154[_0x481a('0x3f')][_0x481a('0x44')]));_0x217e5f[_0x481a('0x43')]=_0x217e5f[_0x481a('0x43')][_0x481a('0x45')]?_0x217e5f[_0x481a('0x43')]:_0x543104['model'];if(!_0xc04154[_0x481a('0x3f')][_0x481a('0x46')](_0x481a('0x47'))){_0x217e5f[_0x481a('0x2c')]=qs['limit'](_0xc04154['query'][_0x481a('0x2c')]);_0x217e5f[_0x481a('0x2a')]=qs[_0x481a('0x2a')](_0xc04154['query']['offset']);}_0x217e5f[_0x481a('0x48')]=qs[_0x481a('0x49')](_0xc04154[_0x481a('0x3f')][_0x481a('0x49')]);_0x217e5f[_0x481a('0x4a')]=qs[_0x481a('0x41')](_[_0x481a('0x67')](_0xc04154[_0x481a('0x3f')],_0x543104['filters']));_0x217e5f[_0x481a('0x4a')][_0x481a('0x60')]=_0x4e36ce['id'];if(_0xc04154[_0x481a('0x3f')][_0x481a('0x4b')]){_0x217e5f[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x217e5f[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0x217e5f[_0x481a('0x43')],function(_0x399c2e){var _0x343986={};_0x343986[_0x399c2e]={'$like':'%'+_0xc04154[_0x481a('0x3f')]['filter']+'%'};return _0x343986;})});}if(_0xc04154['query'][_0x481a('0x9d')]){var _0x434497=_0xc04154[_0x481a('0x3f')][_0x481a('0x9d')]['split'](',');var _0x321dd={};_0x321dd[_0x434497[0x0]]={'$gte':moment(_0x434497[0x1])[_0x481a('0x9e')](_0x481a('0x9f'))};_0x217e5f['where']=_[_0x481a('0x4c')](_0x217e5f[_0x481a('0x4a')],_0x321dd);}_0x217e5f=_[_0x481a('0x4c')]({},_0x217e5f,_0xc04154[_0x481a('0x54')]);return db[_0x481a('0x9c')][_0x481a('0x2d')]({'where':_0x217e5f[_0x481a('0x4a')]})[_0x481a('0x32')](function(_0x20d22b){_0x201b85[_0x481a('0x2d')]=_0x20d22b;if(_0xc04154[_0x481a('0x3f')]['includeAll']){_0x217e5f[_0x481a('0x53')]=[{'all':!![]}];}return db[_0x481a('0x9c')][_0x481a('0x4f')](_0x217e5f);})[_0x481a('0x32')](function(_0x2884ce){_0x201b85[_0x481a('0x50')]=_0x2884ce;return _0x201b85;});}})[_0x481a('0x32')](respondWithFilteredResult(_0x5e8e88,_0x217e5f))['catch'](handleError(_0x5e8e88,null));};exports['send']=function(_0x3ff3cb,_0x17e7d7,_0x5effba){var _0x59e1ba,_0x1ff82a={},_0x1dc60d;if(_0x3ff3cb[_0x481a('0x56')]['to']){_0x1dc60d=_0x3ff3cb[_0x481a('0x56')]['to'][0x0];}return db[_0x481a('0x3a')][_0x481a('0x5e')]({'where':{'id':_0x3ff3cb[_0x481a('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x481a('0xa0'),'include':[{'model':db['CmContact'],'as':_0x481a('0xa1'),'where':{'fax':_0x1dc60d},'limit':0x1,'order':[[_0x481a('0xa2'),_0x481a('0xa3')]]}]}]})[_0x481a('0x32')](handleEntityNotFound(_0x17e7d7,null))[_0x481a('0x32')](function(_0x306671){_0x59e1ba=_0x306671;if(_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')]&&_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][_0x481a('0x45')]){for(var _0x12ca23=0x0;_0x12ca23<_0x3ff3cb['body'][_0x481a('0xa4')][_0x481a('0x45')];_0x12ca23+=0x1){_0x3ff3cb['body'][_0x481a('0xa4')][_0x12ca23]={'filename':_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][_0x12ca23][_0x481a('0x37')],'id':_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][_0x12ca23]['id'],'path':path[_0x481a('0xa5')](config['root'],_0x481a('0xa6'),_0x3ff3cb[_0x481a('0x56')]['attachments'][_0x12ca23]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x481a('0xa7'),{'FaxAccountId':_['isNil'](_0x3ff3cb[_0x481a('0x52')]['id'])?undefined:_0x3ff3cb[_0x481a('0x52')]['id'],'path':_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0][_0x481a('0x7')])?undefined:_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0]['path'],'fax':_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x56')]['to'][0x0])?undefined:_0x3ff3cb[_0x481a('0x56')]['to'][0x0]},client9002);})[_0x481a('0x32')](function(){if(_0x59e1ba){if(_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa9')])){_0x3ff3cb['body'][_0x481a('0xa9')]=util[_0x481a('0x9e')]('\x22%s\x22\x20<%s>',_0x59e1ba['name'],_0x59e1ba[_0x481a('0xaa')]);}if(_0x59e1ba['List']){if(_0x59e1ba[_0x481a('0xa0')][_0x481a('0xa1')][_0x481a('0x45')]){return _0x59e1ba[_0x481a('0xa0')][_0x481a('0xa1')][0x0];}else{return db[_0x481a('0x6d')][_0x481a('0x55')](_[_0x481a('0xab')](_0x3ff3cb[_0x481a('0x56')],{'firstName':_0x3ff3cb[_0x481a('0x56')]['to'][0x0],'phone':_0x3ff3cb[_0x481a('0x56')]['to'][0x0],'fax':_0x3ff3cb[_0x481a('0x56')]['to'][0x0],'ListId':_0x59e1ba['ListId']}));}}else{throw new Error(_0x481a('0xac'));}}else{throw new Error(_0x481a('0xad'));}})[_0x481a('0x32')](function(_0x29866e){if(_0x29866e){return db[_0x481a('0x6a')][_0x481a('0x5e')]({'where':{'ContactId':_0x29866e['id'],'closed':![],'FaxAccountId':_0x59e1ba['id']}})['then'](function(_0x334f2f){if(_0x334f2f){return[_0x334f2f,![]];}return db[_0x481a('0x6a')][_0x481a('0x55')]({'UserId':_0x3ff3cb[_0x481a('0x59')]['id'],'ContactId':_0x29866e['id'],'FaxAccountId':_0x59e1ba['id'],'fax':_0x3ff3cb[_0x481a('0x56')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x481a('0x4c')](_0x3ff3cb[_0x481a('0x56')],{'read':![],'body':_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0]['filename'],'FaxAccountId':_0x59e1ba['id'],'UserId':_0x3ff3cb[_0x481a('0x59')]['id'],'ContactId':_0x29866e['id'],'AttachmentId':_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x481a('0xae')}]})[_0x481a('0x32')](function(_0x4a07af){return[_0x4a07af,!![]];});});}else{throw new Error(_0x481a('0xaf'));}})[_0x481a('0xb0')](function(_0x16dbaa,_0x48d26b){if(_0x48d26b){return _0x16dbaa;}return db[_0x481a('0x9c')][_0x481a('0x55')]({'direction':_0x481a('0xb1'),'read':![],'body':_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0][_0x481a('0xb2')],'FaxAccountId':_0x59e1ba['id'],'FaxInteractionId':_0x16dbaa['id'],'UserId':_0x3ff3cb[_0x481a('0x59')]['id'],'ContactId':_0x16dbaa[_0x481a('0xb3')],'AttachmentId':_0x3ff3cb['body']['attachments'][0x0]['id']})['then'](function(_0x198f0a){_0x16dbaa[_0x481a('0xb4')][_0x481a('0xae')]=[];_0x16dbaa['dataValues'][_0x481a('0xae')][_0x481a('0x8b')](_0x198f0a[_0x481a('0xb4')]);return _0x16dbaa;});})['then'](function(_0xdd2b4f){respondWithRpcPromise(_0x481a('0xb5'),_0x481a('0xb5'),{'FaxAccountId':_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x52')]['id'])?undefined:_0x3ff3cb[_0x481a('0x52')]['id'],'path':_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x56')]['attachments'][0x0]['path'])?undefined:_0x3ff3cb[_0x481a('0x56')][_0x481a('0xa4')][0x0][_0x481a('0x7')],'fax':_[_0x481a('0xa8')](_0x3ff3cb[_0x481a('0x56')]['to'][0x0])?undefined:_0x3ff3cb['body']['to'][0x0],'AttachmentId':_0x3ff3cb[_0x481a('0x56')]['attachments'][0x0]['id']},client9002)['then'](function(_0x2295a6){logger[_0x481a('0xb6')](_0x481a('0xb7'),_0x2295a6);})[_0x481a('0x27')](function(_0x1a1ec3){logger[_0x481a('0xb6')](_0x481a('0xb7'),_0x1a1ec3);});return _0xdd2b4f;})[_0x481a('0x32')](respondWithResult(_0x17e7d7,null))[_0x481a('0x27')](handleError(_0x17e7d7,null));};exports[_0x481a('0xb8')]=function(_0xcf872b,_0x2a4e9e,_0x2cc100){return db[_0x481a('0x3a')][_0x481a('0x5e')]({'where':{'id':_0xcf872b['params']['id']}})['then'](handleEntityNotFound(_0x2a4e9e,null))[_0x481a('0x32')](function(_0x4d3860){if(_0x4d3860){return _0x4d3860['addAgents'](_0xcf872b[_0x481a('0x56')][_0x481a('0x69')],_[_0x481a('0x6c')](_0xcf872b['body'],[_0x481a('0x69'),'id'])||{})[_0x481a('0xb0')](function(_0x5318ef){for(var _0x5aa2bd=0x0;_0x5aa2bd<_0xcf872b[_0x481a('0x56')][_0x481a('0x69')][_0x481a('0x45')];_0x5aa2bd+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0xcf872b[_0x481a('0x56')]['ids'][_0x5aa2bd]),'FaxAccountId':Number(_0xcf872b[_0x481a('0x52')]['id'])});}return _0x5318ef;});}})['then'](respondWithResult(_0x2a4e9e,null))['catch'](handleError(_0x2a4e9e,null));};exports[_0x481a('0xb9')]=function(_0xf6d212,_0x27f21a,_0x416cbb){return db[_0x481a('0x3a')][_0x481a('0x5e')]({'where':{'id':_0xf6d212[_0x481a('0x52')]['id']}})['then'](handleEntityNotFound(_0x27f21a,null))['then'](function(_0x43b5a2){if(_0x43b5a2){return _0x43b5a2['removeAgents'](_0xf6d212['query'][_0x481a('0x69')])[_0x481a('0x32')](function(){if(_[_0x481a('0xba')](_0xf6d212[_0x481a('0x3f')][_0x481a('0x69')])){for(var _0x503a54=0x0;_0x503a54<_0xf6d212[_0x481a('0x3f')][_0x481a('0x69')][_0x481a('0x45')];_0x503a54+=0x1){socket[_0x481a('0xbb')](_0x481a('0xbc'),{'UserId':Number(_0xf6d212[_0x481a('0x3f')][_0x481a('0x69')][_0x503a54]),'FaxAccountId':Number(_0xf6d212['params']['id'])});}}else{socket[_0x481a('0xbb')]('userFaxAccount:remove',{'UserId':Number(_0xf6d212[_0x481a('0x3f')]['ids']),'FaxAccountId':Number(_0xf6d212[_0x481a('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x27f21a,null))['catch'](handleError(_0x27f21a,null));};exports[_0x481a('0xbd')]=function(_0x317d31,_0x2c5f17,_0x5b6c89){var _0x57d954={};var _0x18cf60={};var _0x2d04fa;var _0x5a4cfd;return db[_0x481a('0x3a')]['findOne']({'where':{'id':_0x317d31[_0x481a('0x52')]['id']}})[_0x481a('0x32')](handleEntityNotFound(_0x2c5f17,null))['then'](function(_0x2add7){if(_0x2add7){_0x2d04fa=_0x2add7;_0x18cf60[_0x481a('0x3d')]=_[_0x481a('0x40')](db[_0x481a('0x6e')][_0x481a('0x3b')]);_0x18cf60[_0x481a('0x3f')]=_['keys'](_0x317d31[_0x481a('0x3f')]);_0x18cf60['filters']=_[_0x481a('0x42')](_0x18cf60['model'],_0x18cf60[_0x481a('0x3f')]);_0x57d954[_0x481a('0x43')]=_[_0x481a('0x42')](_0x18cf60['model'],qs[_0x481a('0x44')](_0x317d31[_0x481a('0x3f')][_0x481a('0x44')]));_0x57d954[_0x481a('0x43')]=_0x57d954[_0x481a('0x43')][_0x481a('0x45')]?_0x57d954[_0x481a('0x43')]:_0x18cf60[_0x481a('0x3d')];_0x57d954[_0x481a('0x48')]=qs[_0x481a('0x49')](_0x317d31['query']['sort']);_0x57d954[_0x481a('0x4a')]=qs['filters'](_['pick'](_0x317d31[_0x481a('0x3f')],_0x18cf60[_0x481a('0x41')]));if(_0x317d31['query'][_0x481a('0x4b')]){_0x57d954[_0x481a('0x4a')]=_[_0x481a('0x4c')](_0x57d954[_0x481a('0x4a')],{'$or':_[_0x481a('0x3e')](_0x57d954['attributes'],function(_0x14651c){var _0x4c1d13={};_0x4c1d13[_0x14651c]={'$like':'%'+_0x317d31[_0x481a('0x3f')][_0x481a('0x4b')]+'%'};return _0x4c1d13;})});}_0x57d954=_[_0x481a('0x4c')]({},_0x57d954,_0x317d31[_0x481a('0x54')]);return _0x2d04fa[_0x481a('0xbd')](_0x57d954);}})[_0x481a('0x32')](function(_0x784b4b){if(_0x784b4b){_0x5a4cfd=_0x784b4b[_0x481a('0x45')];if(!_0x317d31[_0x481a('0x3f')][_0x481a('0x46')]('nolimit')){_0x57d954[_0x481a('0x2c')]=qs[_0x481a('0x2c')](_0x317d31[_0x481a('0x3f')][_0x481a('0x2c')]);_0x57d954[_0x481a('0x2a')]=qs[_0x481a('0x2a')](_0x317d31[_0x481a('0x3f')][_0x481a('0x2a')]);}return _0x2d04fa[_0x481a('0xbd')](_0x57d954);}})[_0x481a('0x32')](function(_0x1d0df9){if(_0x1d0df9){return _0x1d0df9?{'count':_0x5a4cfd,'rows':_0x1d0df9}:null;}})[_0x481a('0x32')](respondWithResult(_0x2c5f17,null))['catch'](handleError(_0x2c5f17,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index d3c4f6d..c7b210d 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 _0xe19a=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','FaxAccount'];(function(_0x1c73a0,_0x2e32ec){var _0x44e724=function(_0x59be7b){while(--_0x59be7b){_0x1c73a0['push'](_0x1c73a0['shift']());}};_0x44e724(++_0x2e32ec);}(_0xe19a,0xd6));var _0xae19=function(_0x253889,_0x4d077f){_0x253889=_0x253889-0x0;var _0x3dd963=_0xe19a[_0x253889];return _0x3dd963;};'use strict';var EventEmitter=require(_0xae19('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xae19('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xae19('0x2')](0x0);var events={'afterCreate':_0xae19('0x3'),'afterUpdate':_0xae19('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc709e8){return function(_0x32604f,_0x4d1326,_0x2181a0){FaxAccountEvents[_0xae19('0x5')](_0xc709e8+':'+_0x32604f['id'],_0x32604f);FaxAccountEvents[_0xae19('0x5')](_0xc709e8,_0x32604f);_0x2181a0(null);};}for(var e in events){if(events[_0xae19('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xae19('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x9b37=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','save'];(function(_0xe7a99e,_0x4902a1){var _0x3bef5c=function(_0x60e02b){while(--_0x60e02b){_0xe7a99e['push'](_0xe7a99e['shift']());}};_0x3bef5c(++_0x4902a1);}(_0x9b37,0x184));var _0x79b3=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x9b37[_0x259d17];return _0x407535;};'use strict';var EventEmitter=require(_0x79b3('0x0'));var FaxAccount=require(_0x79b3('0x1'))['db'][_0x79b3('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x79b3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x219aa3){return function(_0x3c5bf4,_0x3f7e48,_0x35a1cc){FaxAccountEvents[_0x79b3('0x4')](_0x219aa3+':'+_0x3c5bf4['id'],_0x3c5bf4);FaxAccountEvents[_0x79b3('0x4')](_0x219aa3,_0x3c5bf4);_0x35a1cc(null);};}for(var e in events){if(events[_0x79b3('0x5')](e)){var event=events[e];FaxAccount[_0x79b3('0x6')](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 6422e47..4e181d4 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 _0x7c70=['bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7c70,0xa2));var _0x07c7=function(_0x42157a,_0x198d83){_0x42157a=_0x42157a-0x0;var _0x41c6c5=_0x7c70[_0x42157a];return _0x41c6c5;};'use strict';var _=require(_0x07c7('0x0'));var util=require(_0x07c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x07c7('0x2'));var BPromise=require(_0x07c7('0x3'));var rp=require(_0x07c7('0x4'));var fs=require('fs');var path=require(_0x07c7('0x5'));var rimraf=require(_0x07c7('0x6'));var config=require('../../config/environment');var attributes=require(_0x07c7('0x7'));module[_0x07c7('0x8')]=function(_0x3b4874,_0x41d902){return _0x3b4874[_0x07c7('0x9')](_0x07c7('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5785=['util','../../config/logger','api','bluebird','path','../../config/environment','./faxAccount.attributes','define','fax_accounts','lodash'];(function(_0x5970aa,_0x438c13){var _0x174917=function(_0x252abd){while(--_0x252abd){_0x5970aa['push'](_0x5970aa['shift']());}};_0x174917(++_0x438c13);}(_0x5785,0x6d));var _0x5578=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5785[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var logger=require(_0x5578('0x2'))(_0x5578('0x3'));var moment=require('moment');var BPromise=require(_0x5578('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5578('0x5'));var rimraf=require('rimraf');var config=require(_0x5578('0x6'));var attributes=require(_0x5578('0x7'));module['exports']=function(_0x59f100,_0x2af25e){return _0x59f100[_0x5578('0x8')]('FaxAccount',attributes,{'tableName':_0x5578('0x9'),'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 8191c36..ba40235 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 _0x9749=['orderBy','priority','asc','length','FaxInteraction','create','Contact\x20not\x20found','spread','get','push','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','applications','list'];(function(_0x74b2d6,_0x5aba96){var _0x3a5eed=function(_0x4d77c3){while(--_0x4d77c3){_0x74b2d6['push'](_0x74b2d6['shift']());}};_0x3a5eed(++_0x5aba96);}(_0x9749,0xd0));var _0x9974=function(_0x2bd67f,_0x137730){_0x2bd67f=_0x2bd67f-0x0;var _0x102e07=_0x9749[_0x2bd67f];return _0x102e07;};'use strict';var _=require(_0x9974('0x0'));var util=require(_0x9974('0x1'));var moment=require('moment');var BPromise=require(_0x9974('0x2'));var rs=require(_0x9974('0x3'));var fs=require('fs');var Redis=require(_0x9974('0x4'));var db=require(_0x9974('0x5'))['db'];var utils=require(_0x9974('0x6'));var logger=require(_0x9974('0x7'))(_0x9974('0x8'));var config=require(_0x9974('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9974('0xa')][_0x9974('0xb')]({'port':0x232c});config['redis']=_[_0x9974('0xc')](config['redis'],{'host':_0x9974('0xd'),'port':0x18eb});var socket=require(_0x9974('0xe'))(new Redis(config[_0x9974('0xf')]));require(_0x9974('0x10'))[_0x9974('0x11')](socket);function respondWithRpcPromise(_0x4d2c17,_0x1d365e,_0x16818c){return new BPromise(function(_0x256c32,_0x124490){return client[_0x9974('0x12')](_0x4d2c17,_0x16818c)[_0x9974('0x13')](function(_0xca56ec){logger['info'](_0x9974('0x14'),_0x1d365e,'request\x20sent');logger[_0x9974('0x15')](_0x9974('0x16'),_0x1d365e,_0x9974('0x17'),JSON[_0x9974('0x18')](_0xca56ec));if(_0xca56ec['error']){if(_0xca56ec[_0x9974('0x19')]['code']===0x1f4){logger[_0x9974('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1d365e,_0xca56ec[_0x9974('0x19')][_0x9974('0x1a')]);return _0x124490(_0xca56ec[_0x9974('0x19')]['message']);}logger['error'](_0x9974('0x14'),_0x1d365e,_0xca56ec[_0x9974('0x19')]['message']);return _0x256c32(_0xca56ec[_0x9974('0x19')][_0x9974('0x1a')]);}else{logger[_0x9974('0x1b')](_0x9974('0x14'),_0x1d365e,_0x9974('0x17'));_0x256c32(_0xca56ec['result']['message']);}})[_0x9974('0x1c')](function(_0xb5c902){logger['error'](_0x9974('0x14'),_0x1d365e,_0xb5c902);_0x124490(_0xb5c902);});});}exports[_0x9974('0x1d')]=function(_0x94acfe){var _0x24cb4c=this;return new Promise(function(_0x41bd66,_0x26e43d){return db[_0x9974('0x1e')][_0x9974('0x1f')]({'raw':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x21')]===undefined?!![]:![]:!![],'where':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')]['where']||null:null,'attributes':_0x94acfe[_0x9974('0x20')]?_0x94acfe['options'][_0x9974('0x22')]||null:null,'limit':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x23')]||null:null,'include':_0x94acfe[_0x9974('0x20')]?_0x94acfe[_0x9974('0x20')][_0x9974('0x24')]?_[_0x9974('0x25')](_0x94acfe['options'][_0x9974('0x24')],function(_0x215ba5){return{'model':db[_0x215ba5[_0x9974('0x26')]],'as':_0x215ba5['as'],'attributes':_0x215ba5[_0x9974('0x22')],'include':_0x215ba5[_0x9974('0x24')]?_[_0x9974('0x25')](_0x215ba5['include'],function(_0x12713c){return{'model':db[_0x12713c[_0x9974('0x26')]],'as':_0x12713c['as'],'attributes':_0x12713c[_0x9974('0x22')],'include':_0x12713c[_0x9974('0x24')]?_['map'](_0x12713c[_0x9974('0x24')],function(_0x4ad9b0){return{'model':db[_0x4ad9b0['model']],'as':_0x4ad9b0['as'],'attributes':_0x4ad9b0[_0x9974('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9974('0x13')](function(_0x1f11a6){logger[_0x9974('0x1b')](_0x9974('0x1d'),_0x94acfe);logger[_0x9974('0x15')](_0x9974('0x1d'),_0x94acfe,JSON[_0x9974('0x18')](_0x1f11a6));_0x41bd66(_0x1f11a6);})[_0x9974('0x1c')](function(_0x2925a2){logger[_0x9974('0x19')](_0x9974('0x1d'),_0x2925a2[_0x9974('0x1a')],_0x94acfe);_0x26e43d(_0x24cb4c[_0x9974('0x19')](0x1f4,_0x2925a2['message']));});});};exports[_0x9974('0x27')]=function(_0xa0e15a,_0x20ac3d,_0x2e825e){var _0x249db4=this;return new Promise(function(_0x2752cb,_0x500101){var _0x161735={'body':_0xa0e15a[_0x9974('0x28')],'channel':_0x9974('0x29')};var _0x2a3dd2=[];var _0x1d947a=[];var _0x565345={};return db[_0x9974('0x2a')][_0x9974('0x2b')]()[_0x9974('0x13')](function(_0x2f3df1){if(!_0x2f3df1){throw new db[(_0x9974('0x2c'))][(_0x9974('0x2d'))](_0x9974('0x2e'));}_0x2a3dd2=_[_0x9974('0x2f')](_['keys'](_0x2f3df1),[_0x9974('0x30'),_0x9974('0x31')]);_0x1d947a=_['difference'](_['keys'](_0x2f3df1),['createdAt','updatedAt','CompanyId',_0x9974('0x32')]);if(_0xa0e15a[_0x9974('0x28')]['id']){delete _0xa0e15a[_0x9974('0x28')]['id'];}if(_['isNil'](_0xa0e15a[_0x9974('0x28')][_0x9974('0x33')])){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x34'));}if(_['isNil'](_0xa0e15a[_0x9974('0x28')][_0x9974('0x28')])||_0xa0e15a['body'][_0x9974('0x28')]===''){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x35'));}if(_[_0x9974('0x36')](_0xa0e15a[_0x9974('0x28')]['mapKey'])){throw new db['Sequelize'][(_0x9974('0x2d'))](_0x9974('0x37')+_0x1d947a);}if(!_[_0x9974('0x38')](_0x1d947a,_0xa0e15a[_0x9974('0x28')][_0x9974('0x39')])){throw new db[(_0x9974('0x2c'))]['ValidationError'](_0x9974('0x3a')+_0x1d947a);}_0x565345[_0xa0e15a[_0x9974('0x28')]['mapKey']]=_0xa0e15a[_0x9974('0x28')][_0x9974('0x33')];})[_0x9974('0x13')](function(){return db[_0x9974('0x1e')][_0x9974('0x3b')]({'where':{'id':_0xa0e15a[_0x9974('0x3c')]['id']},'include':[{'model':db[_0x9974('0x3d')],'as':_0x9974('0x3e'),'include':[{'model':db[_0x9974('0x2a')],'as':_0x9974('0x3f'),'where':_0x565345,'limit':0x1,'order':[[_0x9974('0x31'),'DESC']]}]},{'model':db[_0x9974('0x40')],'as':_0x9974('0x41')}]});})[_0x9974('0x13')](function(_0x235312){if(_0x235312&&_0x235312[_0x9974('0x3e')]){var _0x3478e2=_0x235312['get']({'plain':!![]});_0x161735[_0x9974('0x3c')]=_0x3478e2;_0x161735[_0x9974('0x42')]=_0x3478e2[_0x9974('0x41')];_0x161735[_0x9974('0x43')]=_0x3478e2[_0x9974('0x3e')];_0x161735[_0x9974('0x42')]=_[_0x9974('0x44')](_0x161735[_0x9974('0x42')],[_0x9974('0x45')],[_0x9974('0x46')]);if(_0x161735[_0x9974('0x3c')][_0x9974('0x41')]){delete _0x161735[_0x9974('0x3c')]['Applications'];}if(_0x161735[_0x9974('0x3c')][_0x9974('0x3e')]&&_0x161735[_0x9974('0x3c')][_0x9974('0x3e')]['Contacts'][_0x9974('0x47')]){return _0x161735[_0x9974('0x3c')][_0x9974('0x3e')][_0x9974('0x3f')][0x0];}var _0x525c5e=_[_0x9974('0xc')](_0xa0e15a[_0x9974('0x28')],{'firstName':_0xa0e15a[_0x9974('0x28')]['from'],'ListId':_0x3478e2[_0x9974('0x32')]});_0x525c5e[_0xa0e15a['body'][_0x9974('0x39')]]=_0xa0e15a['body']['from'];return db[_0x9974('0x2a')]['create'](_0x525c5e,{'fields':_0x2a3dd2,'raw':!![]});}})[_0x9974('0x13')](function(_0x3bd4a1){_0x161735['contact']=_0x3bd4a1;if(_0x3bd4a1){var _0x4cd207={'ContactId':_0x3bd4a1['id'],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id'],'fax':_0x3bd4a1[_0x9974('0x29')]};return db[_0x9974('0x48')][_0x9974('0x3b')]({'where':{'ContactId':_0x3bd4a1['id'],'closed':![],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id']}})['then'](function(_0xb97b97){if(_0xb97b97){return[_0xb97b97,![]];}return db[_0x9974('0x48')][_0x9974('0x49')](_0x4cd207)['then'](function(_0x2dcd60){return[_0x2dcd60,!![]];});});}else{throw new Error(_0x9974('0x4a'));}})[_0x9974('0x4b')](function(_0x424698,_0x58e356){var _0x31cd64=_0x424698[_0x9974('0x4c')]({'plain':!![]});if(_0x58e356){if(_0x161735[_0x9974('0x3c')]['autoclose']){_0x161735[_0x9974('0x42')][_0x9974('0x4d')]({'id':0x0,'priority':_0x161735[_0x9974('0x42')][_0x9974('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9974('0x4e')});}_0x31cd64[_0x9974('0x4f')]=!![];}else{_0x31cd64['created']=![];}_0x161735[_0x9974('0x50')]=_0x31cd64;return db[_0x9974('0x51')][_0x9974('0x49')]({'body':_0xa0e15a['body']['body'],'FaxAccountId':_0xa0e15a[_0x9974('0x3c')]['id'],'FaxInteractionId':_0x424698['id'],'direction':'in','ContactId':_0x424698[_0x9974('0x52')],'AttachmentId':_0xa0e15a['body'][_0x9974('0x53')]});})[_0x9974('0x13')](function(_0x2cbc58){_0x161735[_0x9974('0x1a')]=_0x2cbc58;if(_0x161735[_0x9974('0x50')]['UserId']){return db[_0x9974('0x54')][_0x9974('0x3b')]({'attributes':['id','name'],'where':{'id':_0x161735[_0x9974('0x50')][_0x9974('0x55')]}})[_0x9974('0x13')](function(_0x12fb15){if(_0x12fb15){_0x161735['applications'][_0x9974('0x56')]({'id':0x0,'priority':0x0,'app':_0x9974('0x57'),'appdata':_0x12fb15[_0x9974('0x58')]+','+(_0x161735[_0x9974('0x3c')][_0x9974('0x59')]||0xa),'interval':_0x9974('0x4e')});}return respondWithRpcPromise(_0x9974('0x5a'),_0x9974('0x5b'),_0x161735);});}return respondWithRpcPromise('Start','startRouting',_0x161735);})[_0x9974('0x13')](function(_0x4337c7){_0x2752cb(_0x4337c7);})['catch'](function(_0x40c81d){_0x500101(_0x249db4['error'](0x1f4,_0x40c81d[_0x9974('0x1a')]));});});}; \ No newline at end of file +var _0xdf12=['options','raw','where','attributes','limit','map','include','model','stringify','catch','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','keys','CompanyId','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','DESC','Applications','List','get','applications','list','priority','asc','length','ListId','contact','fax','FaxInteraction','find','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetFaxAccount','findAll'];(function(_0x54fb01,_0xe79896){var _0xa8561e=function(_0x5cb865){while(--_0x5cb865){_0x54fb01['push'](_0x54fb01['shift']());}};_0xa8561e(++_0xe79896);}(_0xdf12,0x99));var _0x2df1=function(_0x279f2a,_0x2095b2){_0x279f2a=_0x279f2a-0x0;var _0x517714=_0xdf12[_0x279f2a];return _0x517714;};'use strict';var _=require(_0x2df1('0x0'));var util=require('util');var moment=require(_0x2df1('0x1'));var BPromise=require(_0x2df1('0x2'));var rs=require(_0x2df1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2df1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2df1('0x5'));var config=require(_0x2df1('0x6'));var jayson=require(_0x2df1('0x7'));var client=jayson[_0x2df1('0x8')][_0x2df1('0x9')]({'port':0x232c});config[_0x2df1('0xa')]=_[_0x2df1('0xb')](config[_0x2df1('0xa')],{'host':_0x2df1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2df1('0xa')]));require('./faxAccount.socket')[_0x2df1('0xd')](socket);function respondWithRpcPromise(_0x405aca,_0x5dd3d9,_0x21311e){return new BPromise(function(_0x199879,_0x87bde1){return client['request'](_0x405aca,_0x21311e)[_0x2df1('0xe')](function(_0x27c5dc){logger[_0x2df1('0xf')](_0x2df1('0x10'),_0x5dd3d9,_0x2df1('0x11'));logger[_0x2df1('0x12')](_0x2df1('0x13'),_0x5dd3d9,_0x2df1('0x11'),JSON['stringify'](_0x27c5dc));if(_0x27c5dc[_0x2df1('0x14')]){if(_0x27c5dc['error']['code']===0x1f4){logger[_0x2df1('0x14')]('FaxAccount,\x20%s,\x20%s',_0x5dd3d9,_0x27c5dc['error'][_0x2df1('0x15')]);return _0x87bde1(_0x27c5dc[_0x2df1('0x14')]['message']);}logger['error'](_0x2df1('0x10'),_0x5dd3d9,_0x27c5dc['error']['message']);return _0x199879(_0x27c5dc[_0x2df1('0x14')]['message']);}else{logger[_0x2df1('0xf')](_0x2df1('0x10'),_0x5dd3d9,_0x2df1('0x11'));_0x199879(_0x27c5dc[_0x2df1('0x16')][_0x2df1('0x15')]);}})['catch'](function(_0x470324){logger[_0x2df1('0x14')](_0x2df1('0x10'),_0x5dd3d9,_0x470324);_0x87bde1(_0x470324);});});}exports[_0x2df1('0x17')]=function(_0x16e2a3){var _0x18795b=this;return new Promise(function(_0x17fb4c,_0x6b0675){return db['FaxAccount'][_0x2df1('0x18')]({'raw':_0x16e2a3[_0x2df1('0x19')]?_0x16e2a3['options'][_0x2df1('0x1a')]===undefined?!![]:![]:!![],'where':_0x16e2a3[_0x2df1('0x19')]?_0x16e2a3['options'][_0x2df1('0x1b')]||null:null,'attributes':_0x16e2a3['options']?_0x16e2a3[_0x2df1('0x19')][_0x2df1('0x1c')]||null:null,'limit':_0x16e2a3[_0x2df1('0x19')]?_0x16e2a3[_0x2df1('0x19')][_0x2df1('0x1d')]||null:null,'include':_0x16e2a3[_0x2df1('0x19')]?_0x16e2a3[_0x2df1('0x19')]['include']?_[_0x2df1('0x1e')](_0x16e2a3[_0x2df1('0x19')][_0x2df1('0x1f')],function(_0x395027){return{'model':db[_0x395027[_0x2df1('0x20')]],'as':_0x395027['as'],'attributes':_0x395027[_0x2df1('0x1c')],'include':_0x395027[_0x2df1('0x1f')]?_[_0x2df1('0x1e')](_0x395027[_0x2df1('0x1f')],function(_0x4208b4){return{'model':db[_0x4208b4[_0x2df1('0x20')]],'as':_0x4208b4['as'],'attributes':_0x4208b4[_0x2df1('0x1c')],'include':_0x4208b4['include']?_[_0x2df1('0x1e')](_0x4208b4['include'],function(_0x179c79){return{'model':db[_0x179c79[_0x2df1('0x20')]],'as':_0x179c79['as'],'attributes':_0x179c79[_0x2df1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9611){logger['info'](_0x2df1('0x17'),_0x16e2a3);logger['debug'](_0x2df1('0x17'),_0x16e2a3,JSON[_0x2df1('0x21')](_0x3f9611));_0x17fb4c(_0x3f9611);})[_0x2df1('0x22')](function(_0x37c7e7){logger['error'](_0x2df1('0x17'),_0x37c7e7[_0x2df1('0x15')],_0x16e2a3);_0x6b0675(_0x18795b[_0x2df1('0x14')](0x1f4,_0x37c7e7['message']));});});};exports['NotifyFaxAccount']=function(_0xe98f7c,_0x519a7a,_0x3089ee){var _0x476c89=this;return new Promise(function(_0x2a76c4,_0x2d4062){var _0x2e0b52={'body':_0xe98f7c[_0x2df1('0x23')],'channel':'fax'};var _0x3e7396=[];var _0x453b3a=[];var _0x503152={};return db[_0x2df1('0x24')][_0x2df1('0x25')]()['then'](function(_0x7853c2){if(!_0x7853c2){throw new db[(_0x2df1('0x26'))]['ValidationError'](_0x2df1('0x27'));}_0x3e7396=_[_0x2df1('0x28')](_['keys'](_0x7853c2),['createdAt',_0x2df1('0x29')]);_0x453b3a=_['difference'](_[_0x2df1('0x2a')](_0x7853c2),['createdAt',_0x2df1('0x29'),_0x2df1('0x2b'),'ListId']);if(_0xe98f7c[_0x2df1('0x23')]['id']){delete _0xe98f7c[_0x2df1('0x23')]['id'];}if(_['isNil'](_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x2c')])){throw new db[(_0x2df1('0x26'))]['ValidationError'](_0x2df1('0x2d'));}if(_['isNil'](_0xe98f7c['body'][_0x2df1('0x23')])||_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x23')]===''){throw new db['Sequelize'][(_0x2df1('0x2e'))](_0x2df1('0x2f'));}if(_[_0x2df1('0x30')](_0xe98f7c[_0x2df1('0x23')]['mapKey'])){throw new db[(_0x2df1('0x26'))][(_0x2df1('0x2e'))](_0x2df1('0x31')+_0x453b3a);}if(!_[_0x2df1('0x32')](_0x453b3a,_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x33')])){throw new db[(_0x2df1('0x26'))][(_0x2df1('0x2e'))](_0x2df1('0x34')+_0x453b3a);}_0x503152[_0xe98f7c['body']['mapKey']]=_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x2c')];})['then'](function(){return db['FaxAccount']['find']({'where':{'id':_0xe98f7c[_0x2df1('0x35')]['id']},'include':[{'model':db[_0x2df1('0x36')],'as':'List','include':[{'model':db[_0x2df1('0x24')],'as':'Contacts','where':_0x503152,'limit':0x1,'order':[[_0x2df1('0x29'),_0x2df1('0x37')]]}]},{'model':db['FaxApplication'],'as':_0x2df1('0x38')}]});})[_0x2df1('0xe')](function(_0x50d6b4){if(_0x50d6b4&&_0x50d6b4[_0x2df1('0x39')]){var _0x28df11=_0x50d6b4[_0x2df1('0x3a')]({'plain':!![]});_0x2e0b52[_0x2df1('0x35')]=_0x28df11;_0x2e0b52[_0x2df1('0x3b')]=_0x28df11[_0x2df1('0x38')];_0x2e0b52[_0x2df1('0x3c')]=_0x28df11[_0x2df1('0x39')];_0x2e0b52[_0x2df1('0x3b')]=_['orderBy'](_0x2e0b52[_0x2df1('0x3b')],[_0x2df1('0x3d')],[_0x2df1('0x3e')]);if(_0x2e0b52[_0x2df1('0x35')][_0x2df1('0x38')]){delete _0x2e0b52[_0x2df1('0x35')][_0x2df1('0x38')];}if(_0x2e0b52[_0x2df1('0x35')][_0x2df1('0x39')]&&_0x2e0b52[_0x2df1('0x35')]['List']['Contacts'][_0x2df1('0x3f')]){return _0x2e0b52['account'][_0x2df1('0x39')]['Contacts'][0x0];}var _0x4800d7=_[_0x2df1('0xb')](_0xe98f7c[_0x2df1('0x23')],{'firstName':_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x2c')],'ListId':_0x28df11[_0x2df1('0x40')]});_0x4800d7[_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x33')]]=_0xe98f7c[_0x2df1('0x23')]['from'];return db[_0x2df1('0x24')]['create'](_0x4800d7,{'fields':_0x3e7396,'raw':!![]});}})[_0x2df1('0xe')](function(_0x2ba319){_0x2e0b52[_0x2df1('0x41')]=_0x2ba319;if(_0x2ba319){var _0x64d912={'ContactId':_0x2ba319['id'],'FaxAccountId':_0xe98f7c[_0x2df1('0x35')]['id'],'fax':_0x2ba319[_0x2df1('0x42')]};return db[_0x2df1('0x43')][_0x2df1('0x44')]({'where':{'ContactId':_0x2ba319['id'],'closed':![],'FaxAccountId':_0xe98f7c[_0x2df1('0x35')]['id']}})[_0x2df1('0xe')](function(_0x42b0de){if(_0x42b0de){return[_0x42b0de,![]];}return db[_0x2df1('0x43')][_0x2df1('0x45')](_0x64d912)[_0x2df1('0xe')](function(_0x5ae8f8){return[_0x5ae8f8,!![]];});});}else{throw new Error(_0x2df1('0x46'));}})[_0x2df1('0x47')](function(_0x39bb35,_0x5ba625){var _0x1fd0bf=_0x39bb35[_0x2df1('0x3a')]({'plain':!![]});if(_0x5ba625){if(_0x2e0b52['account'][_0x2df1('0x48')]){_0x2e0b52[_0x2df1('0x3b')][_0x2df1('0x49')]({'id':0x0,'priority':_0x2e0b52[_0x2df1('0x3b')]['length']+0x1,'app':_0x2df1('0x4a'),'appdata':_0x2df1('0x4b'),'interval':_0x2df1('0x4c')});}_0x1fd0bf[_0x2df1('0x4d')]=!![];}else{_0x1fd0bf[_0x2df1('0x4d')]=![];}_0x2e0b52[_0x2df1('0x4e')]=_0x1fd0bf;return db[_0x2df1('0x4f')]['create']({'body':_0xe98f7c['body'][_0x2df1('0x23')],'FaxAccountId':_0xe98f7c[_0x2df1('0x35')]['id'],'FaxInteractionId':_0x39bb35['id'],'direction':'in','ContactId':_0x39bb35[_0x2df1('0x50')],'AttachmentId':_0xe98f7c[_0x2df1('0x23')][_0x2df1('0x51')]});})[_0x2df1('0xe')](function(_0x6ff5b4){_0x2e0b52[_0x2df1('0x15')]=_0x6ff5b4;if(_0x2e0b52[_0x2df1('0x4e')]['UserId']){return db['User'][_0x2df1('0x44')]({'attributes':['id','name'],'where':{'id':_0x2e0b52[_0x2df1('0x4e')][_0x2df1('0x52')]}})[_0x2df1('0xe')](function(_0x429b62){if(_0x429b62){_0x2e0b52[_0x2df1('0x3b')][_0x2df1('0x53')]({'id':0x0,'priority':0x0,'app':_0x2df1('0x54'),'appdata':_0x429b62[_0x2df1('0x55')]+','+(_0x2e0b52[_0x2df1('0x35')][_0x2df1('0x56')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2df1('0x57'),_0x2df1('0x58'),_0x2e0b52);});}return respondWithRpcPromise('Start','startRouting',_0x2e0b52);})[_0x2df1('0xe')](function(_0x3b3877){_0x2a76c4(_0x3b3877);})[_0x2df1('0x22')](function(_0x3c6b5f){_0x2d4062(_0x476c89['error'](0x1f4,_0x3c6b5f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 82b9ac1..7d2e98c 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 _0xe904=['save','removeListener','register','./faxAccount.events'];(function(_0x541056,_0x1b4d2c){var _0x576c06=function(_0x292b5e){while(--_0x292b5e){_0x541056['push'](_0x541056['shift']());}};_0x576c06(++_0x1b4d2c);}(_0xe904,0x16b));var _0x4e90=function(_0x13f5d1,_0x43d446){_0x13f5d1=_0x13f5d1-0x0;var _0x17aabf=_0xe904[_0x13f5d1];return _0x17aabf;};'use strict';var FaxAccountEvents=require(_0x4e90('0x0'));var events=[_0x4e90('0x1'),'remove','update'];function createListener(_0xb303f5,_0x279d0d){return function(_0x1ca1a5){_0x279d0d['emit'](_0xb303f5,_0x1ca1a5);};}function removeListener(_0x43acc7,_0x3a54fa){return function(){FaxAccountEvents[_0x4e90('0x2')](_0x43acc7,_0x3a54fa);};}exports[_0x4e90('0x3')]=function(_0x500fbc){for(var _0xc23466=0x0,_0xe05f76=events['length'];_0xc23466<_0xe05f76;_0xc23466++){var _0x447d23=events[_0xc23466];var _0x8b1abe=createListener('faxAccount:'+_0x447d23,_0x500fbc);FaxAccountEvents['on'](_0x447d23,_0x8b1abe);}}; \ No newline at end of file +var _0xfe2b=['faxAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0xd06a8b,_0x3ce43e){var _0xe9b203=function(_0x50b56b){while(--_0x50b56b){_0xd06a8b['push'](_0xd06a8b['shift']());}};_0xe9b203(++_0x3ce43e);}(_0xfe2b,0x191));var _0xbfe2=function(_0x5206fb,_0x27aaf0){_0x5206fb=_0x5206fb-0x0;var _0x28cf2d=_0xfe2b[_0x5206fb];return _0x28cf2d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xbfe2('0x0'),_0xbfe2('0x1'),_0xbfe2('0x2')];function createListener(_0x5cadb1,_0x40b118){return function(_0x401359){_0x40b118[_0xbfe2('0x3')](_0x5cadb1,_0x401359);};}function removeListener(_0x1717fe,_0x3992b2){return function(){FaxAccountEvents[_0xbfe2('0x4')](_0x1717fe,_0x3992b2);};}exports[_0xbfe2('0x5')]=function(_0x2dfb48){for(var _0x4bb571=0x0,_0x4e27ed=events[_0xbfe2('0x6')];_0x4bb571<_0x4e27ed;_0x4bb571++){var _0x3e5e30=events[_0x4bb571];var _0xbb40a4=createListener(_0xbfe2('0x7')+_0x3e5e30,_0x2dfb48);FaxAccountEvents['on'](_0x3e5e30,_0xbb40a4);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 6652cd7..1e07849 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5530d0,_0x56bac6){var _0x4b4285=function(_0x448aac){while(--_0x448aac){_0x5530d0['push'](_0x5530d0['shift']());}};_0x4b4285(++_0x56bac6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3b74e6,_0x1bc8b0){var _0x4cbbd4=function(_0x33197c){while(--_0x33197c){_0x3b74e6['push'](_0x3b74e6['shift']());}};_0x4cbbd4(++_0x1bc8b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 993785a..c894f07 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 _0xeb74=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x166436,_0x257244){var _0x1d4447=function(_0x9645ff){while(--_0x9645ff){_0x166436['push'](_0x166436['shift']());}};_0x1d4447(++_0x257244);}(_0xeb74,0x66));var _0x4eb7=function(_0x2be07b,_0xd9e535){_0x2be07b=_0x2be07b-0x0;var _0x4138c0=_0xeb74[_0x2be07b];return _0x4138c0;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'priority':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![],'defaultValue':_0x4eb7('0x4')},'appdata':{'type':Sequelize[_0x4eb7('0x5')]()},'description':{'type':Sequelize[_0x4eb7('0x3')]},'interval':{'type':Sequelize[_0x4eb7('0x3')],'defaultValue':_0x4eb7('0x6')}}; \ No newline at end of file +var _0x8c6d=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x8c6d,0x79));var _0xd8c6=function(_0x436633,_0x57341c){_0x436633=_0x436633-0x0;var _0x252b90=_0x8c6d[_0x436633];return _0x252b90;};'use strict';var Sequelize=require(_0xd8c6('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd8c6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd8c6('0x2')],'allowNull':![],'defaultValue':_0xd8c6('0x3')},'appdata':{'type':Sequelize[_0xd8c6('0x4')]()},'description':{'type':Sequelize[_0xd8c6('0x2')]},'interval':{'type':Sequelize[_0xd8c6('0x2')],'defaultValue':_0xd8c6('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b73c61d..9f2675c 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 _0xdd57=['hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','options','FaxApplication','count','includeAll','findAll','rows','catch','keys','find','create','body','update','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length'];(function(_0x6d1c65,_0x22df6e){var _0x1e96b4=function(_0xc1aac4){while(--_0xc1aac4){_0x6d1c65['push'](_0x6d1c65['shift']());}};_0x1e96b4(++_0x22df6e);}(_0xdd57,0x1d3));var _0x7dd5=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xdd57[_0x1f6f84];return _0x177f40;};'use strict';var emlformat=require(_0x7dd5('0x0'));var rimraf=require(_0x7dd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dd5('0x2'));var rp=require('request-promise');var moment=require(_0x7dd5('0x3'));var BPromise=require(_0x7dd5('0x4'));var Mustache=require(_0x7dd5('0x5'));var util=require(_0x7dd5('0x6'));var path=require(_0x7dd5('0x7'));var sox=require(_0x7dd5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7dd5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7dd5('0xa'));var jsforce=require(_0x7dd5('0xb'));var deskjs=require(_0x7dd5('0xc'));var toCsv=require(_0x7dd5('0xd'));var querystring=require(_0x7dd5('0xe'));var Papa=require(_0x7dd5('0xf'));var Redis=require(_0x7dd5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7dd5('0x11'));var as=require(_0x7dd5('0x12'));var hardwareService=require(_0x7dd5('0x13'));var logger=require(_0x7dd5('0x14'))(_0x7dd5('0x15'));var utils=require(_0x7dd5('0x16'));var config=require(_0x7dd5('0x17'));var licenseUtil=require(_0x7dd5('0x18'));var db=require(_0x7dd5('0x19'))['db'];function respondWithStatusCode(_0x1719ca,_0x14047f){_0x14047f=_0x14047f||0xcc;return function(_0x5c7fe8){if(_0x5c7fe8){return _0x1719ca[_0x7dd5('0x1a')](_0x14047f);}return _0x1719ca[_0x7dd5('0x1b')](_0x14047f)['end']();};}function respondWithResult(_0x2d9edb,_0x32f416){_0x32f416=_0x32f416||0xc8;return function(_0x51186e){if(_0x51186e){return _0x2d9edb[_0x7dd5('0x1b')](_0x32f416)[_0x7dd5('0x1c')](_0x51186e);}};}function respondWithFilteredResult(_0x266a96,_0x429ad5){return function(_0x49101d){if(_0x49101d){var _0x49dee9=typeof _0x429ad5['offset']===_0x7dd5('0x1d')&&typeof _0x429ad5[_0x7dd5('0x1e')]===_0x7dd5('0x1d');var _0x42591e=_0x49101d['count'];var _0x524993=_0x49dee9?0x0:_0x429ad5['offset'];var _0xa7c642=_0x49dee9?_0x49101d['count']:_0x429ad5['offset']+_0x429ad5['limit'];var _0x151297;if(_0xa7c642>=_0x42591e){_0xa7c642=_0x42591e;_0x151297=0xc8;}else{_0x151297=0xce;}_0x266a96['status'](_0x151297);return _0x266a96[_0x7dd5('0x1f')](_0x7dd5('0x20'),_0x524993+'-'+_0xa7c642+'/'+_0x42591e)[_0x7dd5('0x1c')](_0x49101d);}return null;};}function patchUpdates(_0x451b34){return function(_0x19ec4b){try{jsonpatch[_0x7dd5('0x21')](_0x19ec4b,_0x451b34,!![]);}catch(_0x4b3397){return BPromise[_0x7dd5('0x22')](_0x4b3397);}return _0x19ec4b[_0x7dd5('0x23')]();};}function saveUpdates(_0x5233ee,_0x4837de){return function(_0x334e03){if(_0x334e03){return _0x334e03['update'](_0x5233ee)[_0x7dd5('0x24')](function(_0x1cbd11){return _0x1cbd11;});}return null;};}function removeEntity(_0xa0f3b4,_0x4fed3b){return function(_0xa52c89){if(_0xa52c89){return _0xa52c89['destroy']()[_0x7dd5('0x24')](function(){_0xa0f3b4[_0x7dd5('0x1b')](0xcc)[_0x7dd5('0x25')]();});}};}function handleEntityNotFound(_0x153ada,_0x3fb53f){return function(_0x1fb0a2){if(!_0x1fb0a2){_0x153ada[_0x7dd5('0x1a')](0x194);}return _0x1fb0a2;};}function handleError(_0x279e48,_0x45077d){_0x45077d=_0x45077d||0x1f4;return function(_0x3d066f){logger[_0x7dd5('0x26')](_0x3d066f[_0x7dd5('0x27')]);if(_0x3d066f[_0x7dd5('0x28')]){delete _0x3d066f[_0x7dd5('0x28')];}_0x279e48['status'](_0x45077d)['send'](_0x3d066f);};}exports['index']=function(_0x57a620,_0x511a04){var _0x1bba45={},_0x56f0af={},_0x44a047={'count':0x0,'rows':[]};var _0xe04ba1=_[_0x7dd5('0x29')](db['FaxApplication'][_0x7dd5('0x2a')],function(_0x2d3ca3){return{'name':_0x2d3ca3[_0x7dd5('0x2b')],'type':_0x2d3ca3['type'][_0x7dd5('0x2c')]};});_0x56f0af[_0x7dd5('0x2d')]=_[_0x7dd5('0x29')](_0xe04ba1,'name');_0x56f0af[_0x7dd5('0x2e')]=_['keys'](_0x57a620[_0x7dd5('0x2e')]);_0x56f0af['filters']=_[_0x7dd5('0x2f')](_0x56f0af['model'],_0x56f0af[_0x7dd5('0x2e')]);_0x1bba45['attributes']=_['intersection'](_0x56f0af[_0x7dd5('0x2d')],qs['fields'](_0x57a620['query'][_0x7dd5('0x30')]));_0x1bba45['attributes']=_0x1bba45[_0x7dd5('0x31')][_0x7dd5('0x32')]?_0x1bba45[_0x7dd5('0x31')]:_0x56f0af[_0x7dd5('0x2d')];if(!_0x57a620['query'][_0x7dd5('0x33')](_0x7dd5('0x34'))){_0x1bba45[_0x7dd5('0x1e')]=qs[_0x7dd5('0x1e')](_0x57a620['query'][_0x7dd5('0x1e')]);_0x1bba45[_0x7dd5('0x35')]=qs['offset'](_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x35')]);}_0x1bba45[_0x7dd5('0x36')]=qs[_0x7dd5('0x37')](_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x37')]);_0x1bba45[_0x7dd5('0x38')]=qs[_0x7dd5('0x39')](_['pick'](_0x57a620[_0x7dd5('0x2e')],_0x56f0af[_0x7dd5('0x39')]),_0xe04ba1);if(_0x57a620['query'][_0x7dd5('0x3a')]){_0x1bba45[_0x7dd5('0x38')]=_[_0x7dd5('0x3b')](_0x1bba45[_0x7dd5('0x38')],{'$or':_[_0x7dd5('0x29')](_0xe04ba1,function(_0x118bca){if(_0x118bca[_0x7dd5('0x3c')]!=='VIRTUAL'){var _0x2a5b28={};_0x2a5b28[_0x118bca[_0x7dd5('0x28')]]={'$like':'%'+_0x57a620[_0x7dd5('0x2e')][_0x7dd5('0x3a')]+'%'};return _0x2a5b28;}})});}_0x1bba45=_[_0x7dd5('0x3b')]({},_0x1bba45,_0x57a620[_0x7dd5('0x3d')]);var _0xd34fd8={'where':_0x1bba45['where']};return db[_0x7dd5('0x3e')][_0x7dd5('0x3f')](_0xd34fd8)[_0x7dd5('0x24')](function(_0x2e8a1b){_0x44a047['count']=_0x2e8a1b;if(_0x57a620['query'][_0x7dd5('0x40')]){_0x1bba45['include']=[{'all':!![]}];}return db[_0x7dd5('0x3e')][_0x7dd5('0x41')](_0x1bba45);})['then'](function(_0x574524){_0x44a047[_0x7dd5('0x42')]=_0x574524;return _0x44a047;})[_0x7dd5('0x24')](respondWithFilteredResult(_0x511a04,_0x1bba45))[_0x7dd5('0x43')](handleError(_0x511a04,null));};exports['show']=function(_0x53705e,_0x2d8591){var _0x423ce9={'raw':!![],'where':{'id':_0x53705e['params']['id']}},_0x48487d={};_0x48487d[_0x7dd5('0x2d')]=_[_0x7dd5('0x44')](db[_0x7dd5('0x3e')][_0x7dd5('0x2a')]);_0x48487d[_0x7dd5('0x2e')]=_[_0x7dd5('0x44')](_0x53705e[_0x7dd5('0x2e')]);_0x48487d[_0x7dd5('0x39')]=_[_0x7dd5('0x2f')](_0x48487d['model'],_0x48487d['query']);_0x423ce9[_0x7dd5('0x31')]=_[_0x7dd5('0x2f')](_0x48487d[_0x7dd5('0x2d')],qs[_0x7dd5('0x30')](_0x53705e[_0x7dd5('0x2e')][_0x7dd5('0x30')]));_0x423ce9[_0x7dd5('0x31')]=_0x423ce9[_0x7dd5('0x31')][_0x7dd5('0x32')]?_0x423ce9[_0x7dd5('0x31')]:_0x48487d[_0x7dd5('0x2d')];if(_0x53705e[_0x7dd5('0x2e')][_0x7dd5('0x40')]){_0x423ce9['include']=[{'all':!![]}];}_0x423ce9=_['merge']({},_0x423ce9,_0x53705e[_0x7dd5('0x3d')]);return db[_0x7dd5('0x3e')][_0x7dd5('0x45')](_0x423ce9)['then'](handleEntityNotFound(_0x2d8591,null))[_0x7dd5('0x24')](respondWithResult(_0x2d8591,null))['catch'](handleError(_0x2d8591,null));};exports[_0x7dd5('0x46')]=function(_0x262686,_0x30a763){return db['FaxApplication'][_0x7dd5('0x46')](_0x262686[_0x7dd5('0x47')],{})[_0x7dd5('0x24')](respondWithResult(_0x30a763,0xc9))['catch'](handleError(_0x30a763,null));};exports[_0x7dd5('0x48')]=function(_0x27ab6d,_0x251f20){if(_0x27ab6d[_0x7dd5('0x47')]['id']){delete _0x27ab6d[_0x7dd5('0x47')]['id'];}return db[_0x7dd5('0x3e')][_0x7dd5('0x45')]({'where':{'id':_0x27ab6d[_0x7dd5('0x49')]['id']}})[_0x7dd5('0x24')](handleEntityNotFound(_0x251f20,null))['then'](saveUpdates(_0x27ab6d[_0x7dd5('0x47')],null))[_0x7dd5('0x24')](respondWithResult(_0x251f20,null))[_0x7dd5('0x43')](handleError(_0x251f20,null));};exports['destroy']=function(_0x2c05b7,_0x1d3e0d){return db[_0x7dd5('0x3e')][_0x7dd5('0x45')]({'where':{'id':_0x2c05b7[_0x7dd5('0x49')]['id']}})[_0x7dd5('0x24')](handleEntityNotFound(_0x1d3e0d,null))[_0x7dd5('0x24')](removeEntity(_0x1d3e0d,null))[_0x7dd5('0x43')](handleError(_0x1d3e0d,null));}; \ No newline at end of file +var _0x4981=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','FaxApplication','includeAll','findAll','show','include','options','catch','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x442fc5,_0x5cc78e){var _0x51e73a=function(_0x82a4b4){while(--_0x82a4b4){_0x442fc5['push'](_0x442fc5['shift']());}};_0x51e73a(++_0x5cc78e);}(_0x4981,0xe3));var _0x1498=function(_0x23a275,_0x87d9d0){_0x23a275=_0x23a275-0x0;var _0x2dc038=_0x4981[_0x23a275];return _0x2dc038;};'use strict';var emlformat=require(_0x1498('0x0'));var rimraf=require(_0x1498('0x1'));var zipdir=require(_0x1498('0x2'));var jsonpatch=require(_0x1498('0x3'));var rp=require(_0x1498('0x4'));var moment=require(_0x1498('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1498('0x6'));var util=require(_0x1498('0x7'));var path=require(_0x1498('0x8'));var sox=require(_0x1498('0x9'));var csv=require(_0x1498('0xa'));var ejs=require(_0x1498('0xb'));var fs=require('fs');var fs_extra=require(_0x1498('0xc'));var _=require('lodash');var squel=require(_0x1498('0xd'));var crypto=require('crypto');var jsforce=require(_0x1498('0xe'));var deskjs=require(_0x1498('0xf'));var toCsv=require(_0x1498('0xa'));var querystring=require(_0x1498('0x10'));var Papa=require(_0x1498('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1498('0x12'));var hardwareService=require(_0x1498('0x13'));var logger=require(_0x1498('0x14'))(_0x1498('0x15'));var utils=require(_0x1498('0x16'));var config=require(_0x1498('0x17'));var licenseUtil=require(_0x1498('0x18'));var db=require(_0x1498('0x19'))['db'];function respondWithStatusCode(_0x14b286,_0x2f2ca6){_0x2f2ca6=_0x2f2ca6||0xcc;return function(_0x4f109e){if(_0x4f109e){return _0x14b286[_0x1498('0x1a')](_0x2f2ca6);}return _0x14b286[_0x1498('0x1b')](_0x2f2ca6)[_0x1498('0x1c')]();};}function respondWithResult(_0x5d9e5e,_0x54c742){_0x54c742=_0x54c742||0xc8;return function(_0x12f0f2){if(_0x12f0f2){return _0x5d9e5e['status'](_0x54c742)[_0x1498('0x1d')](_0x12f0f2);}};}function respondWithFilteredResult(_0x2f6771,_0x3d0ed0){return function(_0x567df9){if(_0x567df9){var _0x3d52cf=typeof _0x3d0ed0[_0x1498('0x1e')]===_0x1498('0x1f')&&typeof _0x3d0ed0[_0x1498('0x20')]===_0x1498('0x1f');var _0x4b5596=_0x567df9[_0x1498('0x21')];var _0x246ba6=_0x3d52cf?0x0:_0x3d0ed0[_0x1498('0x1e')];var _0x4f725b=_0x3d52cf?_0x567df9['count']:_0x3d0ed0['offset']+_0x3d0ed0[_0x1498('0x20')];var _0x189540;if(_0x4f725b>=_0x4b5596){_0x4f725b=_0x4b5596;_0x189540=0xc8;}else{_0x189540=0xce;}_0x2f6771[_0x1498('0x1b')](_0x189540);return _0x2f6771[_0x1498('0x22')](_0x1498('0x23'),_0x246ba6+'-'+_0x4f725b+'/'+_0x4b5596)[_0x1498('0x1d')](_0x567df9);}return null;};}function patchUpdates(_0xf20ff4){return function(_0x4a2108){try{jsonpatch[_0x1498('0x24')](_0x4a2108,_0xf20ff4,!![]);}catch(_0x416e8a){return BPromise[_0x1498('0x25')](_0x416e8a);}return _0x4a2108[_0x1498('0x26')]();};}function saveUpdates(_0x30a4d0,_0x1579b5){return function(_0x2f161d){if(_0x2f161d){return _0x2f161d[_0x1498('0x27')](_0x30a4d0)['then'](function(_0x28b7cb){return _0x28b7cb;});}return null;};}function removeEntity(_0xd72b95,_0x2aec66){return function(_0x3c5750){if(_0x3c5750){return _0x3c5750['destroy']()[_0x1498('0x28')](function(){_0xd72b95['status'](0xcc)[_0x1498('0x1c')]();});}};}function handleEntityNotFound(_0x4d6124,_0x3219fc){return function(_0x28a3d3){if(!_0x28a3d3){_0x4d6124['sendStatus'](0x194);}return _0x28a3d3;};}function handleError(_0x3d139b,_0x36b02e){_0x36b02e=_0x36b02e||0x1f4;return function(_0x30acc8){logger[_0x1498('0x29')](_0x30acc8[_0x1498('0x2a')]);if(_0x30acc8[_0x1498('0x2b')]){delete _0x30acc8[_0x1498('0x2b')];}_0x3d139b['status'](_0x36b02e)[_0x1498('0x2c')](_0x30acc8);};}exports[_0x1498('0x2d')]=function(_0x46ca7a,_0x2bca5a){var _0x203234={},_0x324443={},_0x320a1e={'count':0x0,'rows':[]};var _0x45f90c=_['map'](db['FaxApplication'][_0x1498('0x2e')],function(_0x24789c){return{'name':_0x24789c[_0x1498('0x2f')],'type':_0x24789c[_0x1498('0x30')][_0x1498('0x31')]};});_0x324443[_0x1498('0x32')]=_[_0x1498('0x33')](_0x45f90c,_0x1498('0x2b'));_0x324443[_0x1498('0x34')]=_[_0x1498('0x35')](_0x46ca7a['query']);_0x324443[_0x1498('0x36')]=_[_0x1498('0x37')](_0x324443[_0x1498('0x32')],_0x324443['query']);_0x203234['attributes']=_[_0x1498('0x37')](_0x324443[_0x1498('0x32')],qs['fields'](_0x46ca7a['query'][_0x1498('0x38')]));_0x203234[_0x1498('0x39')]=_0x203234[_0x1498('0x39')][_0x1498('0x3a')]?_0x203234[_0x1498('0x39')]:_0x324443[_0x1498('0x32')];if(!_0x46ca7a['query'][_0x1498('0x3b')](_0x1498('0x3c'))){_0x203234['limit']=qs['limit'](_0x46ca7a[_0x1498('0x34')][_0x1498('0x20')]);_0x203234[_0x1498('0x1e')]=qs['offset'](_0x46ca7a[_0x1498('0x34')][_0x1498('0x1e')]);}_0x203234[_0x1498('0x3d')]=qs[_0x1498('0x3e')](_0x46ca7a['query'][_0x1498('0x3e')]);_0x203234[_0x1498('0x3f')]=qs['filters'](_[_0x1498('0x40')](_0x46ca7a['query'],_0x324443['filters']),_0x45f90c);if(_0x46ca7a[_0x1498('0x34')]['filter']){_0x203234[_0x1498('0x3f')]=_[_0x1498('0x41')](_0x203234[_0x1498('0x3f')],{'$or':_[_0x1498('0x33')](_0x45f90c,function(_0x14f8e9){if(_0x14f8e9[_0x1498('0x30')]!==_0x1498('0x42')){var _0x51f02d={};_0x51f02d[_0x14f8e9[_0x1498('0x2b')]]={'$like':'%'+_0x46ca7a[_0x1498('0x34')][_0x1498('0x43')]+'%'};return _0x51f02d;}})});}_0x203234=_[_0x1498('0x41')]({},_0x203234,_0x46ca7a['options']);var _0x20957d={'where':_0x203234[_0x1498('0x3f')]};return db[_0x1498('0x44')]['count'](_0x20957d)[_0x1498('0x28')](function(_0x5f0ae0){_0x320a1e[_0x1498('0x21')]=_0x5f0ae0;if(_0x46ca7a[_0x1498('0x34')][_0x1498('0x45')]){_0x203234['include']=[{'all':!![]}];}return db['FaxApplication'][_0x1498('0x46')](_0x203234);})[_0x1498('0x28')](function(_0x12ae3f){_0x320a1e['rows']=_0x12ae3f;return _0x320a1e;})['then'](respondWithFilteredResult(_0x2bca5a,_0x203234))['catch'](handleError(_0x2bca5a,null));};exports[_0x1498('0x47')]=function(_0x5cbca7,_0x299530){var _0x192976={'raw':!![],'where':{'id':_0x5cbca7['params']['id']}},_0x4bb81d={};_0x4bb81d['model']=_['keys'](db[_0x1498('0x44')][_0x1498('0x2e')]);_0x4bb81d['query']=_['keys'](_0x5cbca7['query']);_0x4bb81d[_0x1498('0x36')]=_['intersection'](_0x4bb81d[_0x1498('0x32')],_0x4bb81d['query']);_0x192976[_0x1498('0x39')]=_[_0x1498('0x37')](_0x4bb81d[_0x1498('0x32')],qs[_0x1498('0x38')](_0x5cbca7[_0x1498('0x34')][_0x1498('0x38')]));_0x192976[_0x1498('0x39')]=_0x192976['attributes'][_0x1498('0x3a')]?_0x192976[_0x1498('0x39')]:_0x4bb81d[_0x1498('0x32')];if(_0x5cbca7[_0x1498('0x34')][_0x1498('0x45')]){_0x192976[_0x1498('0x48')]=[{'all':!![]}];}_0x192976=_['merge']({},_0x192976,_0x5cbca7[_0x1498('0x49')]);return db[_0x1498('0x44')]['find'](_0x192976)[_0x1498('0x28')](handleEntityNotFound(_0x299530,null))['then'](respondWithResult(_0x299530,null))[_0x1498('0x4a')](handleError(_0x299530,null));};exports[_0x1498('0x4b')]=function(_0x3037e6,_0x2211c7){return db[_0x1498('0x44')]['create'](_0x3037e6[_0x1498('0x4c')],{})[_0x1498('0x28')](respondWithResult(_0x2211c7,0xc9))['catch'](handleError(_0x2211c7,null));};exports[_0x1498('0x27')]=function(_0x51bf1f,_0x47ec22){if(_0x51bf1f[_0x1498('0x4c')]['id']){delete _0x51bf1f['body']['id'];}return db['FaxApplication'][_0x1498('0x4d')]({'where':{'id':_0x51bf1f[_0x1498('0x4e')]['id']}})[_0x1498('0x28')](handleEntityNotFound(_0x47ec22,null))[_0x1498('0x28')](saveUpdates(_0x51bf1f[_0x1498('0x4c')],null))[_0x1498('0x28')](respondWithResult(_0x47ec22,null))['catch'](handleError(_0x47ec22,null));};exports[_0x1498('0x4f')]=function(_0x347d02,_0x468cec){return db[_0x1498('0x44')][_0x1498('0x4d')]({'where':{'id':_0x347d02[_0x1498('0x4e')]['id']}})['then'](handleEntityNotFound(_0x468cec,null))[_0x1498('0x28')](removeEntity(_0x468cec,null))[_0x1498('0x4a')](handleError(_0x468cec,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f77e1e2..4bd8d01 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 _0xae59=['fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxApplication.attributes','exports','FaxApplication'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xae59,0x17c));var _0x9ae5=function(_0x5d4779,_0x2e3fb8){_0x5d4779=_0x5d4779-0x0;var _0x1ad4e6=_0xae59[_0x5d4779];return _0x1ad4e6;};'use strict';var _=require('lodash');var util=require(_0x9ae5('0x0'));var logger=require(_0x9ae5('0x1'))(_0x9ae5('0x2'));var moment=require(_0x9ae5('0x3'));var BPromise=require(_0x9ae5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ae5('0x5'));var rimraf=require(_0x9ae5('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ae5('0x7'));module[_0x9ae5('0x8')]=function(_0x33a9ed,_0x2622ca){return _0x33a9ed['define'](_0x9ae5('0x9'),attributes,{'tableName':_0x9ae5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ae5('0xb'),'collate':_0x9ae5('0xc')});}; \ No newline at end of file +var _0x08d5=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','fax_applications'];(function(_0x209107,_0xfdc807){var _0x512d06=function(_0xc496b1){while(--_0xc496b1){_0x209107['push'](_0x209107['shift']());}};_0x512d06(++_0xfdc807);}(_0x08d5,0x86));var _0x508d=function(_0x1fa3a8,_0x1d0a19){_0x1fa3a8=_0x1fa3a8-0x0;var _0x2e4c02=_0x08d5[_0x1fa3a8];return _0x2e4c02;};'use strict';var _=require('lodash');var util=require(_0x508d('0x0'));var logger=require('../../config/logger')(_0x508d('0x1'));var moment=require('moment');var BPromise=require(_0x508d('0x2'));var rp=require(_0x508d('0x3'));var fs=require('fs');var path=require(_0x508d('0x4'));var rimraf=require(_0x508d('0x5'));var config=require(_0x508d('0x6'));var attributes=require('./faxApplication.attributes');module[_0x508d('0x7')]=function(_0x357a57,_0x50da86){return _0x357a57['define']('FaxApplication',attributes,{'tableName':_0x508d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x508d('0x9'),'collate':_0x508d('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9e69f16..3f1a2b8 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 _0xe20d=['attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where'];(function(_0x68c1f5,_0xf9567){var _0x53ed77=function(_0x54feff){while(--_0x54feff){_0x68c1f5['push'](_0x68c1f5['shift']());}};_0x53ed77(++_0xf9567);}(_0xe20d,0x1bd));var _0xde20=function(_0x35c84e,_0xd7ebb9){_0x35c84e=_0x35c84e-0x0;var _0x5d7aa7=_0xe20d[_0x35c84e];return _0x5d7aa7;};'use strict';var _=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var moment=require(_0xde20('0x2'));var BPromise=require(_0xde20('0x3'));var rs=require(_0xde20('0x4'));var fs=require('fs');var Redis=require(_0xde20('0x5'));var db=require(_0xde20('0x6'))['db'];var utils=require(_0xde20('0x7'));var logger=require(_0xde20('0x8'))(_0xde20('0x9'));var config=require(_0xde20('0xa'));var jayson=require(_0xde20('0xb'));var client=jayson[_0xde20('0xc')][_0xde20('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x10c321,_0x3a4bad,_0x5e0d99){return new BPromise(function(_0x185dd4,_0x3f9053){return client[_0xde20('0xe')](_0x10c321,_0x5e0d99)[_0xde20('0xf')](function(_0x4dbf22){logger[_0xde20('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0xde20('0x11'));logger[_0xde20('0x12')](_0xde20('0x13'),_0x3a4bad,_0xde20('0x11'),JSON['stringify'](_0x4dbf22));if(_0x4dbf22['error']){if(_0x4dbf22[_0xde20('0x14')][_0xde20('0x15')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0x4dbf22[_0xde20('0x14')][_0xde20('0x16')]);return _0x3f9053(_0x4dbf22['error'][_0xde20('0x16')]);}logger[_0xde20('0x14')](_0xde20('0x17'),_0x3a4bad,_0x4dbf22['error'][_0xde20('0x16')]);return _0x185dd4(_0x4dbf22['error'][_0xde20('0x16')]);}else{logger[_0xde20('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3a4bad,_0xde20('0x11'));_0x185dd4(_0x4dbf22[_0xde20('0x18')][_0xde20('0x16')]);}})[_0xde20('0x19')](function(_0x87e9b6){logger[_0xde20('0x14')](_0xde20('0x17'),_0x3a4bad,_0x87e9b6);_0x3f9053(_0x87e9b6);});});}exports[_0xde20('0x1a')]=function(_0x1d2272){var _0x57fe5a=this;return new Promise(function(_0x4868fd,_0x2a8a0f){return db[_0xde20('0x1b')]['update'](_0x1d2272['body'],{'raw':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d2272[_0xde20('0x1c')]?_0x1d2272['options'][_0xde20('0x1e')]||null:null,'attributes':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x1f')]||null:null,'limit':_0x1d2272[_0xde20('0x1c')]?_0x1d2272[_0xde20('0x1c')][_0xde20('0x20')]||null:null})[_0xde20('0xf')](function(_0x400c0f){logger[_0xde20('0x10')](_0xde20('0x1a'),_0x1d2272);logger[_0xde20('0x12')]('UpdateFaxApplication',_0x1d2272,JSON[_0xde20('0x21')](_0x400c0f));_0x4868fd(_0x400c0f);})['catch'](function(_0x20ea13){logger[_0xde20('0x14')](_0xde20('0x1a'),_0x20ea13[_0xde20('0x16')],_0x1d2272);_0x2a8a0f(_0x57fe5a[_0xde20('0x14')](0x1f4,_0x20ea13[_0xde20('0x16')]));});});}; \ No newline at end of file +var _0xa23a=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','options','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x240c30,_0x4399f5){var _0x1b6c11=function(_0x3970d1){while(--_0x3970d1){_0x240c30['push'](_0x240c30['shift']());}};_0x1b6c11(++_0x4399f5);}(_0xa23a,0xe1));var _0xaa23=function(_0x1afd3b,_0x212a08){_0x1afd3b=_0x1afd3b-0x0;var _0x21dd50=_0xa23a[_0x1afd3b];return _0x21dd50;};'use strict';var _=require(_0xaa23('0x0'));var util=require(_0xaa23('0x1'));var moment=require('moment');var BPromise=require(_0xaa23('0x2'));var rs=require(_0xaa23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa23('0x4'))['db'];var utils=require(_0xaa23('0x5'));var logger=require(_0xaa23('0x6'))('rpc');var config=require(_0xaa23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaa23('0x8')][_0xaa23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33396f,_0x9a5888,_0x16b63f){return new BPromise(function(_0x8c677a,_0x228979){return client[_0xaa23('0xa')](_0x33396f,_0x16b63f)[_0xaa23('0xb')](function(_0x12949b){logger[_0xaa23('0xc')](_0xaa23('0xd'),_0x9a5888,_0xaa23('0xe'));logger[_0xaa23('0xf')](_0xaa23('0x10'),_0x9a5888,_0xaa23('0xe'),JSON[_0xaa23('0x11')](_0x12949b));if(_0x12949b['error']){if(_0x12949b[_0xaa23('0x12')][_0xaa23('0x13')]===0x1f4){logger[_0xaa23('0x12')](_0xaa23('0xd'),_0x9a5888,_0x12949b['error']['message']);return _0x228979(_0x12949b[_0xaa23('0x12')][_0xaa23('0x14')]);}logger[_0xaa23('0x12')](_0xaa23('0xd'),_0x9a5888,_0x12949b[_0xaa23('0x12')][_0xaa23('0x14')]);return _0x8c677a(_0x12949b[_0xaa23('0x12')][_0xaa23('0x14')]);}else{logger[_0xaa23('0xc')]('FaxApplication,\x20%s,\x20%s',_0x9a5888,_0xaa23('0xe'));_0x8c677a(_0x12949b[_0xaa23('0x15')][_0xaa23('0x14')]);}})[_0xaa23('0x16')](function(_0x2e2d26){logger['error']('FaxApplication,\x20%s,\x20%s',_0x9a5888,_0x2e2d26);_0x228979(_0x2e2d26);});});}exports['UpdateFaxApplication']=function(_0x4e1cd4){var _0x226b9e=this;return new Promise(function(_0x1de10a,_0x273ac9){return db[_0xaa23('0x17')][_0xaa23('0x18')](_0x4e1cd4[_0xaa23('0x19')],{'raw':_0x4e1cd4[_0xaa23('0x1a')]?_0x4e1cd4[_0xaa23('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e1cd4[_0xaa23('0x1a')]?_0x4e1cd4['options']['where']||null:null,'attributes':_0x4e1cd4[_0xaa23('0x1a')]?_0x4e1cd4[_0xaa23('0x1a')][_0xaa23('0x1b')]||null:null,'limit':_0x4e1cd4[_0xaa23('0x1a')]?_0x4e1cd4[_0xaa23('0x1a')][_0xaa23('0x1c')]||null:null})[_0xaa23('0xb')](function(_0x2fac04){logger[_0xaa23('0xc')]('UpdateFaxApplication',_0x4e1cd4);logger['debug']('UpdateFaxApplication',_0x4e1cd4,JSON[_0xaa23('0x11')](_0x2fac04));_0x1de10a(_0x2fac04);})[_0xaa23('0x16')](function(_0x2fa606){logger['error'](_0xaa23('0x1d'),_0x2fa606[_0xaa23('0x14')],_0x4e1cd4);_0x273ac9(_0x226b9e[_0xaa23('0x12')](0x1f4,_0x2fa606[_0xaa23('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index b06a866..9505e8d 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 _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x283de8,_0x2a77d8){var _0x448f9b=function(_0xd214d8){while(--_0xd214d8){_0x283de8['push'](_0x283de8['shift']());}};_0x448f9b(++_0x2a77d8);}(_0x4213,0x77));var _0x3421=function(_0x264b10,_0x510e2e){_0x264b10=_0x264b10-0x0;var _0xc3722d=_0x4213[_0x264b10];return _0xc3722d;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23a277,_0x4a8c57){var _0x4a7df5=function(_0x2d418e){while(--_0x2d418e){_0x23a277['push'](_0x23a277['shift']());}};_0x4a7df5(++_0x4a8c57);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 799b8a5..8347135 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 _0xb020=['BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x5dbe75,_0x5d23e0){var _0x528bd3=function(_0x208192){while(--_0x208192){_0x5dbe75['push'](_0x5dbe75['shift']());}};_0x528bd3(++_0x5d23e0);}(_0xb020,0x86));var _0x0b02=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xb020[_0x9b3efc];return _0x200f05;};'use strict';var Sequelize=require(_0x0b02('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0b02('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0b02('0x2')]},'disposition':{'type':Sequelize[_0x0b02('0x3')]},'secondDisposition':{'type':Sequelize[_0x0b02('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0b02('0x3')]},'note':{'type':Sequelize[_0x0b02('0x3')]},'read1stAt':{'type':Sequelize[_0x0b02('0x2')]},'fax':{'type':Sequelize[_0x0b02('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b02('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0b02('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b02('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1661=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x2e9a0e,_0x333283){var _0x29cee0=function(_0x23cb14){while(--_0x23cb14){_0x2e9a0e['push'](_0x2e9a0e['shift']());}};_0x29cee0(++_0x333283);}(_0x1661,0x18b));var _0x1166=function(_0x253e45,_0x25f479){_0x253e45=_0x253e45-0x0;var _0x35f5c0=_0x1661[_0x253e45];return _0x35f5c0;};'use strict';var Sequelize=require(_0x1166('0x0'));module[_0x1166('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1166('0x2')]},'disposition':{'type':Sequelize[_0x1166('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1166('0x3')]},'note':{'type':Sequelize[_0x1166('0x3')]},'read1stAt':{'type':Sequelize[_0x1166('0x2')]},'fax':{'type':Sequelize[_0x1166('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1166('0x4')]('in',_0x1166('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1166('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x1166('0x4')]('in',_0x1166('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 7e8c244..6a24539 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 _0xa214=['color','emit','faxInteractionTags:save','download','unix','toString','join','root','files','tmp','server','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','log','err','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','length','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xa214,0x1b1));var _0x4a21=function(_0x236935,_0x7072eb){_0x236935=_0x236935-0x0;var _0x41c2fa=_0xa214[_0x236935];return _0x41c2fa;};'use strict';var rimraf=require(_0x4a21('0x0'));var zipdir=require(_0x4a21('0x1'));var moment=require(_0x4a21('0x2'));var BPromise=require(_0x4a21('0x3'));var util=require('util');var path=require(_0x4a21('0x4'));var fs=require('fs');var _=require(_0x4a21('0x5'));var Redis=require(_0x4a21('0x6'));var interaction=require(_0x4a21('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4a21('0x8'));var config=require(_0x4a21('0x9'));var db=require(_0x4a21('0xa'))['db'];config[_0x4a21('0xb')]=_['defaults'](config[_0x4a21('0xb')],{'host':_0x4a21('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a21('0xb')]));require(_0x4a21('0xd'))[_0x4a21('0xe')](socket);function respondWithStatusCode(_0x44572e,_0x14f53c){_0x14f53c=_0x14f53c||0xcc;return function(_0x5820c8){if(_0x5820c8){return _0x44572e[_0x4a21('0xf')](_0x14f53c);}return _0x44572e[_0x4a21('0x10')](_0x14f53c)['end']();};}function respondWithResult(_0x3fcae9,_0x52978e){_0x52978e=_0x52978e||0xc8;return function(_0x20c29e){if(_0x20c29e){return _0x3fcae9[_0x4a21('0x10')](_0x52978e)[_0x4a21('0x11')](_0x20c29e);}};}function respondWithFilteredResult(_0x36bc4b,_0x1aed01){return function(_0x2f8335){if(_0x2f8335){var _0x14dc61=typeof _0x1aed01['offset']===_0x4a21('0x12')&&typeof _0x1aed01[_0x4a21('0x13')]===_0x4a21('0x12');var _0x53a0a9=_0x2f8335[_0x4a21('0x14')];var _0x51b1a8=_0x14dc61?0x0:_0x1aed01[_0x4a21('0x15')];var _0x11300e=_0x14dc61?_0x2f8335['count']:_0x1aed01['offset']+_0x1aed01[_0x4a21('0x13')];var _0xc77f49;if(_0x11300e>=_0x53a0a9){_0x11300e=_0x53a0a9;_0xc77f49=0xc8;}else{_0xc77f49=0xce;}_0x36bc4b[_0x4a21('0x10')](_0xc77f49);return _0x36bc4b[_0x4a21('0x16')](_0x4a21('0x17'),_0x51b1a8+'-'+_0x11300e+'/'+_0x53a0a9)[_0x4a21('0x11')](_0x2f8335);}return null;};}function saveUpdates(_0x4eb42d){return function(_0x6ba035){if(_0x6ba035){return _0x6ba035[_0x4a21('0x18')](_0x4eb42d)[_0x4a21('0x19')](function(_0x327ecb){return _0x327ecb;});}return null;};}function removeEntity(_0x14d18c){return function(_0x4845ce){if(_0x4845ce){return _0x4845ce[_0x4a21('0x1a')]()[_0x4a21('0x19')](function(){_0x14d18c[_0x4a21('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b06fc){return function(_0x236a1c){if(!_0x236a1c){_0x1b06fc[_0x4a21('0xf')](0x194);}return _0x236a1c;};}function handleError(_0x5e0d7b,_0x42ead2){_0x42ead2=_0x42ead2||0x1f4;return function(_0x388dd4){logger['error'](_0x388dd4[_0x4a21('0x1b')]);if(_0x388dd4[_0x4a21('0x1c')]){delete _0x388dd4[_0x4a21('0x1c')];}_0x5e0d7b[_0x4a21('0x10')](_0x42ead2)[_0x4a21('0x1d')](_0x388dd4);};}exports[_0x4a21('0x1e')]=function(_0x3b9334,_0x1ca5ee){var _0x2e6586={};var _0x3f9b3e=_[_0x4a21('0x1f')](db[_0x4a21('0x20')][_0x4a21('0x21')],function(_0x2ba230){return{'name':_0x2ba230[_0x4a21('0x22')],'type':_0x2ba230[_0x4a21('0x23')][_0x4a21('0x24')]};});_0x2e6586=qs[_0x4a21('0x25')](_0x3f9b3e,_0x3b9334);return interaction[_0x4a21('0x26')](_0x4a21('0x27'),_0x3b9334[_0x4a21('0x28')],_0x3b9334[_0x4a21('0x29')],_0x2e6586,_0x3f9b3e)[_0x4a21('0x19')](respondWithFilteredResult(_0x1ca5ee,_0x2e6586))[_0x4a21('0x2a')](handleError(_0x1ca5ee,null));};exports[_0x4a21('0x2b')]=function(_0xc0e500,_0xad1bfe){var _0x18b994={'raw':![],'where':{'id':_0xc0e500[_0x4a21('0x2c')]['id']}},_0x1bd6d6={};_0x1bd6d6[_0x4a21('0x2d')]=_[_0x4a21('0x2e')](db['FaxInteraction']['rawAttributes']);_0x1bd6d6[_0x4a21('0x28')]=_[_0x4a21('0x2e')](_0xc0e500[_0x4a21('0x28')]);_0x1bd6d6[_0x4a21('0x2f')]=_[_0x4a21('0x30')](_0x1bd6d6[_0x4a21('0x2d')],_0x1bd6d6['query']);_0x18b994['attributes']=_[_0x4a21('0x30')](_0x1bd6d6[_0x4a21('0x2d')],qs['fields'](_0xc0e500[_0x4a21('0x28')][_0x4a21('0x31')]));_0x18b994['attributes']=_0x18b994[_0x4a21('0x32')]['length']?_0x18b994[_0x4a21('0x32')]:_0x1bd6d6[_0x4a21('0x2d')];if(_0xc0e500[_0x4a21('0x28')][_0x4a21('0x33')]){_0x18b994[_0x4a21('0x34')]=[{'all':!![]}];}_0x18b994=_[_0x4a21('0x35')]({},_0x18b994,_0xc0e500[_0x4a21('0x36')]);return db[_0x4a21('0x20')][_0x4a21('0x37')](_0x18b994)['then'](handleEntityNotFound(_0xad1bfe,null))['then'](respondWithResult(_0xad1bfe,null))[_0x4a21('0x2a')](handleError(_0xad1bfe,null));};exports['create']=function(_0x24b3a6,_0x482312){return db[_0x4a21('0x20')][_0x4a21('0x38')](_0x24b3a6[_0x4a21('0x39')],{})[_0x4a21('0x19')](respondWithResult(_0x482312,0xc9))[_0x4a21('0x2a')](handleError(_0x482312,null));};exports[_0x4a21('0x18')]=function(_0x3b4b89,_0x270726){if(_0x3b4b89[_0x4a21('0x39')]['id']){delete _0x3b4b89[_0x4a21('0x39')]['id'];}return db[_0x4a21('0x20')]['find']({'where':{'id':_0x3b4b89[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x270726,null))[_0x4a21('0x19')](saveUpdates(_0x3b4b89['body'],null))[_0x4a21('0x19')](respondWithResult(_0x270726,null))[_0x4a21('0x2a')](handleError(_0x270726,null));};exports[_0x4a21('0x1a')]=function(_0x5b4c83,_0x5a9b95){return db['FaxInteraction'][_0x4a21('0x37')]({'where':{'id':_0x5b4c83[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x5a9b95,null))[_0x4a21('0x19')](removeEntity(_0x5a9b95,null))[_0x4a21('0x2a')](handleError(_0x5a9b95,null));};exports[_0x4a21('0x3a')]=function(_0x261db1,_0x1d311a){return db['FaxInteraction']['describe']()[_0x4a21('0x19')](respondWithResult(_0x1d311a,null))[_0x4a21('0x2a')](handleError(_0x1d311a,null));};exports[_0x4a21('0x3b')]=function(_0x1a047b,_0xe40f7b){return db[_0x4a21('0x3c')][_0x4a21('0x37')]({'where':{'id':_0x1a047b[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0xe40f7b,null))['then'](function(_0x2c99ad){if(_0x2c99ad){return _0x2c99ad['addMessage'](_0x1a047b[_0x4a21('0x39')][_0x4a21('0x3d')],_[_0x4a21('0x3e')](_0x1a047b[_0x4a21('0x39')],[_0x4a21('0x3d'),'id'])||{});}})[_0x4a21('0x19')](respondWithResult(_0xe40f7b,null))['catch'](handleError(_0xe40f7b,null));};exports[_0x4a21('0x3f')]=function(_0x5da71d,_0x38ef0e){var _0xb15503={'raw':![],'where':{}};var _0x3eb16b={};var _0x135d29={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x4a21('0x40')]({'where':{'id':_0x5da71d[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x38ef0e,null))[_0x4a21('0x19')](function(_0x1a5202){if(_0x1a5202){_0x3eb16b[_0x4a21('0x2d')]=_[_0x4a21('0x2e')](db['FaxMessage']['rawAttributes']);_0x3eb16b[_0x4a21('0x28')]=_[_0x4a21('0x2e')](_0x5da71d[_0x4a21('0x28')]);_0x3eb16b['filters']=_[_0x4a21('0x30')](_0x3eb16b[_0x4a21('0x2d')],_0x3eb16b[_0x4a21('0x28')]);_0xb15503[_0x4a21('0x32')]=_[_0x4a21('0x30')](_0x3eb16b[_0x4a21('0x2d')],qs['fields'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x31')]));_0xb15503[_0x4a21('0x32')]=_0xb15503[_0x4a21('0x32')][_0x4a21('0x41')]?_0xb15503[_0x4a21('0x32')]:_0x3eb16b[_0x4a21('0x2d')];if(!_0x5da71d['query']['hasOwnProperty'](_0x4a21('0x42'))){_0xb15503[_0x4a21('0x13')]=qs['limit'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x13')]);_0xb15503[_0x4a21('0x15')]=qs['offset'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x15')]);}_0xb15503[_0x4a21('0x43')]=qs['sort'](_0x5da71d[_0x4a21('0x28')][_0x4a21('0x44')]);_0xb15503[_0x4a21('0x45')]=qs['filters'](_['pick'](_0x5da71d[_0x4a21('0x28')],_0x3eb16b['filters']));_0xb15503[_0x4a21('0x45')]['FaxInteractionId']=_0x1a5202['id'];if(_0x5da71d[_0x4a21('0x28')]['filter']){_0xb15503[_0x4a21('0x45')]=_[_0x4a21('0x35')](_0xb15503['where'],{'$or':_['map'](_0xb15503[_0x4a21('0x32')],function(_0x2bdd11){var _0x13daf4={};_0x13daf4[_0x2bdd11]={'$like':'%'+_0x5da71d[_0x4a21('0x28')][_0x4a21('0x46')]+'%'};return _0x13daf4;})});}if(_0x5da71d[_0x4a21('0x28')][_0x4a21('0x47')]){var _0x334fb9=_0x5da71d[_0x4a21('0x28')][_0x4a21('0x47')][_0x4a21('0x48')](',');var _0x314846={};_0x314846[_0x334fb9[0x0]]={'$gte':moment(_0x334fb9[0x1])[_0x4a21('0x49')](_0x4a21('0x4a'))};_0xb15503[_0x4a21('0x45')]=_[_0x4a21('0x35')](_0xb15503[_0x4a21('0x45')],_0x314846);}_0xb15503=_[_0x4a21('0x35')]({},_0xb15503,_0x5da71d[_0x4a21('0x36')]);return db['FaxMessage'][_0x4a21('0x14')]({'where':_0xb15503[_0x4a21('0x45')]})['then'](function(_0x51aa90){_0x135d29[_0x4a21('0x14')]=_0x51aa90;if(_0x5da71d[_0x4a21('0x28')][_0x4a21('0x33')]){_0xb15503[_0x4a21('0x34')]=[{'all':!![]}];}return db[_0x4a21('0x3c')][_0x4a21('0x26')](_0xb15503);})[_0x4a21('0x19')](function(_0x35625b){_0x135d29['rows']=_0x35625b;return _0x135d29;});}})[_0x4a21('0x19')](respondWithFilteredResult(_0x38ef0e,_0xb15503))['catch'](handleError(_0x38ef0e,null));};exports[_0x4a21('0x4b')]=function(_0x886fbc,_0xb40c74){return db[_0x4a21('0x20')][_0x4a21('0x37')]({'where':{'id':_0x886fbc['params']['id']}})['then'](handleEntityNotFound(_0xb40c74,null))[_0x4a21('0x19')](function(_0x28c060){if(_0x28c060){return _0x28c060['setTags'](_0x886fbc[_0x4a21('0x39')][_0x4a21('0x3d')],_['omit'](_0x886fbc[_0x4a21('0x39')],[_0x4a21('0x3d'),'id'])||{})[_0x4a21('0x4c')](function(){return db['Tag'][_0x4a21('0x26')]({'attributes':['id',_0x4a21('0x1c'),_0x4a21('0x4d')],'where':{'id':_0x886fbc['body'][_0x4a21('0x3d')]}});})[_0x4a21('0x19')](function(_0x13fbf2){socket[_0x4a21('0x4e')](_0x4a21('0x4f'),{'id':Number(_0x886fbc[_0x4a21('0x2c')]['id']),'tags':_0x13fbf2||[]});return{'id':Number(_0x886fbc[_0x4a21('0x2c')]['id']),'tags':_0x13fbf2||[]};});}})[_0x4a21('0x19')](respondWithResult(_0xb40c74,null))[_0x4a21('0x2a')](handleError(_0xb40c74,null));};exports['removeTags']=function(_0x1caa62,_0x1f75a0){return db[_0x4a21('0x20')][_0x4a21('0x37')]({'where':{'id':_0x1caa62[_0x4a21('0x2c')]['id']}})[_0x4a21('0x19')](handleEntityNotFound(_0x1f75a0,null))[_0x4a21('0x19')](function(_0x564748){if(_0x564748){return _0x564748['removeTags'](_0x1caa62[_0x4a21('0x28')][_0x4a21('0x3d')]);}})[_0x4a21('0x19')](respondWithStatusCode(_0x1f75a0,null))['catch'](handleError(_0x1f75a0,null));};exports[_0x4a21('0x50')]=function(_0x18454d,_0x5eed39){var _0x21158d=moment()[_0x4a21('0x51')]()[_0x4a21('0x52')]();var _0x5ecb84=path[_0x4a21('0x53')](config[_0x4a21('0x54')],'server',_0x4a21('0x55'),_0x4a21('0x56'));var _0x147cac=path[_0x4a21('0x53')](config[_0x4a21('0x54')],_0x4a21('0x57'),_0x4a21('0x55'),'attachments');var _0x813b77=path[_0x4a21('0x53')](_0x5ecb84,_0x21158d);var _0x1ee2c7=util[_0x4a21('0x49')](_0x4a21('0x58'),_0x18454d['params']['id'],_0x21158d);var _0x477881=path['join'](_0x5ecb84,_0x1ee2c7);var _0x32f7e5=[];_0x32f7e5[_0x4a21('0x59')]({'model':db[_0x4a21('0x5a')],'as':_0x4a21('0x5a'),'raw':!![]});var _0x15fd9a=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x4a21('0x5b')],'include':_0x32f7e5}];return db['FaxInteraction']['find']({'where':{'id':_0x18454d[_0x4a21('0x2c')]['id']},'include':_0x15fd9a})['then'](handleEntityNotFound(_0x5eed39,null))[_0x4a21('0x19')](function(_0x29719f){if(_0x29719f&&_0x29719f[_0x4a21('0x5c')]){var _0x424fbb=_0x29719f[_0x4a21('0x5d')]({'plain':!![]});fs[_0x4a21('0x5e')](_0x813b77);for(var _0x3d6380=0x0;_0x3d6380<_0x424fbb[_0x4a21('0x5c')]['length'];_0x3d6380++){var _0x1c416b=_0x424fbb[_0x4a21('0x5c')][_0x3d6380][_0x4a21('0x5a')];if(_0x1c416b){var _0x155e91=path[_0x4a21('0x53')](_0x147cac,_0x1c416b[_0x4a21('0x5f')]);if(fs[_0x4a21('0x60')](_0x155e91)){fs[_0x4a21('0x61')](_0x155e91)[_0x4a21('0x62')](fs['createWriteStream'](path['join'](_0x813b77,_0x1c416b[_0x4a21('0x5f')])));}}}return BPromise[_0x4a21('0x63')]()[_0x4a21('0x19')](function(){return new BPromise(function(_0x1c12f6,_0x25dab5){zipdir(_0x813b77,{'saveTo':_0x477881},function(_0x35053f,_0x38ee7e){if(_0x35053f)return _0x25dab5(_0x35053f);return _0x1c12f6(_0x38ee7e);});})[_0x4a21('0x19')](function(){return new BPromise(function(_0x308c54,_0x538275){rimraf(_0x813b77,function(_0x5acb13){if(_0x5acb13)_0x538275(_0x5acb13);return _0x308c54();});});})[_0x4a21('0x19')](function(){return _0x5eed39[_0x4a21('0x50')](_0x477881,_0x1ee2c7,function(_0x207e02){if(_0x207e02){console[_0x4a21('0x64')](_0x4a21('0x65'),_0x207e02);}else{fs['unlinkSync'](_0x477881);}});});});}else{return _0x5eed39[_0x4a21('0xf')](0xc8);}})[_0x4a21('0x2a')](handleError(_0x5eed39,null));}; \ No newline at end of file +var _0x6e8e=['count','Content-Range','update','then','sendStatus','error','stack','name','send','index','FaxInteraction','type','key','findAll','query','user','catch','show','model','keys','rawAttributes','filters','intersection','attributes','includeAll','options','find','create','body','destroy','params','describe','addMessage','FaxMessage','omit','ids','findOne','fields','nolimit','limit','order','sort','where','FaxInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','length','basename','existsSync','pipe','createWriteStream','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined'];(function(_0x20a63c,_0xe0867d){var _0x38f500=function(_0x4c1e4d){while(--_0x4c1e4d){_0x20a63c['push'](_0x20a63c['shift']());}};_0x38f500(++_0xe0867d);}(_0x6e8e,0x17e));var _0xe6e8=function(_0x4f0d44,_0x5de3dd){_0x4f0d44=_0x4f0d44-0x0;var _0x3e8fc3=_0x6e8e[_0x4f0d44];return _0x3e8fc3;};'use strict';var rimraf=require(_0xe6e8('0x0'));var zipdir=require(_0xe6e8('0x1'));var moment=require(_0xe6e8('0x2'));var BPromise=require(_0xe6e8('0x3'));var util=require(_0xe6e8('0x4'));var path=require(_0xe6e8('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe6e8('0x6'));var interaction=require(_0xe6e8('0x7'));var qs=require(_0xe6e8('0x8'));var logger=require(_0xe6e8('0x9'))('api');var config=require(_0xe6e8('0xa'));var db=require(_0xe6e8('0xb'))['db'];config['redis']=_[_0xe6e8('0xc')](config[_0xe6e8('0xd')],{'host':_0xe6e8('0xe'),'port':0x18eb});var socket=require(_0xe6e8('0xf'))(new Redis(config[_0xe6e8('0xd')]));require('./faxInteraction.socket')[_0xe6e8('0x10')](socket);function respondWithStatusCode(_0x2ca807,_0x34c2a6){_0x34c2a6=_0x34c2a6||0xcc;return function(_0x21141f){if(_0x21141f){return _0x2ca807['sendStatus'](_0x34c2a6);}return _0x2ca807['status'](_0x34c2a6)[_0xe6e8('0x11')]();};}function respondWithResult(_0x3086e1,_0x2c22c9){_0x2c22c9=_0x2c22c9||0xc8;return function(_0x4a5675){if(_0x4a5675){return _0x3086e1[_0xe6e8('0x12')](_0x2c22c9)[_0xe6e8('0x13')](_0x4a5675);}};}function respondWithFilteredResult(_0x1ee130,_0x42623a){return function(_0x121a15){if(_0x121a15){var _0x13f13b=typeof _0x42623a[_0xe6e8('0x14')]===_0xe6e8('0x15')&&typeof _0x42623a['limit']==='undefined';var _0x103f48=_0x121a15[_0xe6e8('0x16')];var _0x4bdd25=_0x13f13b?0x0:_0x42623a[_0xe6e8('0x14')];var _0x1b7dc7=_0x13f13b?_0x121a15[_0xe6e8('0x16')]:_0x42623a['offset']+_0x42623a['limit'];var _0x2502e1;if(_0x1b7dc7>=_0x103f48){_0x1b7dc7=_0x103f48;_0x2502e1=0xc8;}else{_0x2502e1=0xce;}_0x1ee130[_0xe6e8('0x12')](_0x2502e1);return _0x1ee130['set'](_0xe6e8('0x17'),_0x4bdd25+'-'+_0x1b7dc7+'/'+_0x103f48)[_0xe6e8('0x13')](_0x121a15);}return null;};}function saveUpdates(_0x531684){return function(_0x5af771){if(_0x5af771){return _0x5af771[_0xe6e8('0x18')](_0x531684)[_0xe6e8('0x19')](function(_0x4cb0fb){return _0x4cb0fb;});}return null;};}function removeEntity(_0x511f44){return function(_0x8ef0cd){if(_0x8ef0cd){return _0x8ef0cd['destroy']()[_0xe6e8('0x19')](function(){_0x511f44[_0xe6e8('0x12')](0xcc)[_0xe6e8('0x11')]();});}};}function handleEntityNotFound(_0x1105ca){return function(_0x144b8b){if(!_0x144b8b){_0x1105ca[_0xe6e8('0x1a')](0x194);}return _0x144b8b;};}function handleError(_0x512375,_0x150889){_0x150889=_0x150889||0x1f4;return function(_0x5142b1){logger[_0xe6e8('0x1b')](_0x5142b1[_0xe6e8('0x1c')]);if(_0x5142b1['name']){delete _0x5142b1[_0xe6e8('0x1d')];}_0x512375[_0xe6e8('0x12')](_0x150889)[_0xe6e8('0x1e')](_0x5142b1);};}exports[_0xe6e8('0x1f')]=function(_0x2887e0,_0x112a15){var _0x356669={};var _0x5f18fe=_['map'](db[_0xe6e8('0x20')]['rawAttributes'],function(_0x36cfe1){return{'name':_0x36cfe1['fieldName'],'type':_0x36cfe1[_0xe6e8('0x21')][_0xe6e8('0x22')]};});_0x356669=qs['getOptions'](_0x5f18fe,_0x2887e0);return interaction[_0xe6e8('0x23')]('fax',_0x2887e0[_0xe6e8('0x24')],_0x2887e0[_0xe6e8('0x25')],_0x356669,_0x5f18fe)[_0xe6e8('0x19')](respondWithFilteredResult(_0x112a15,_0x356669))[_0xe6e8('0x26')](handleError(_0x112a15,null));};exports[_0xe6e8('0x27')]=function(_0x31d155,_0x2e0ae1){var _0x4335f0={'raw':![],'where':{'id':_0x31d155['params']['id']}},_0x1e136f={};_0x1e136f[_0xe6e8('0x28')]=_[_0xe6e8('0x29')](db[_0xe6e8('0x20')][_0xe6e8('0x2a')]);_0x1e136f[_0xe6e8('0x24')]=_[_0xe6e8('0x29')](_0x31d155[_0xe6e8('0x24')]);_0x1e136f[_0xe6e8('0x2b')]=_[_0xe6e8('0x2c')](_0x1e136f[_0xe6e8('0x28')],_0x1e136f['query']);_0x4335f0[_0xe6e8('0x2d')]=_[_0xe6e8('0x2c')](_0x1e136f[_0xe6e8('0x28')],qs['fields'](_0x31d155[_0xe6e8('0x24')]['fields']));_0x4335f0['attributes']=_0x4335f0[_0xe6e8('0x2d')]['length']?_0x4335f0[_0xe6e8('0x2d')]:_0x1e136f[_0xe6e8('0x28')];if(_0x31d155['query'][_0xe6e8('0x2e')]){_0x4335f0['include']=[{'all':!![]}];}_0x4335f0=_['merge']({},_0x4335f0,_0x31d155[_0xe6e8('0x2f')]);return db[_0xe6e8('0x20')][_0xe6e8('0x30')](_0x4335f0)[_0xe6e8('0x19')](handleEntityNotFound(_0x2e0ae1,null))['then'](respondWithResult(_0x2e0ae1,null))[_0xe6e8('0x26')](handleError(_0x2e0ae1,null));};exports[_0xe6e8('0x31')]=function(_0x567312,_0x12e731){return db[_0xe6e8('0x20')]['create'](_0x567312[_0xe6e8('0x32')],{})[_0xe6e8('0x19')](respondWithResult(_0x12e731,0xc9))[_0xe6e8('0x26')](handleError(_0x12e731,null));};exports[_0xe6e8('0x18')]=function(_0x20e95e,_0x1f516e){if(_0x20e95e[_0xe6e8('0x32')]['id']){delete _0x20e95e[_0xe6e8('0x32')]['id'];}return db['FaxInteraction'][_0xe6e8('0x30')]({'where':{'id':_0x20e95e['params']['id']}})[_0xe6e8('0x19')](handleEntityNotFound(_0x1f516e,null))[_0xe6e8('0x19')](saveUpdates(_0x20e95e[_0xe6e8('0x32')],null))['then'](respondWithResult(_0x1f516e,null))['catch'](handleError(_0x1f516e,null));};exports[_0xe6e8('0x33')]=function(_0x5cbbc6,_0x69b4a4){return db['FaxInteraction'][_0xe6e8('0x30')]({'where':{'id':_0x5cbbc6[_0xe6e8('0x34')]['id']}})[_0xe6e8('0x19')](handleEntityNotFound(_0x69b4a4,null))[_0xe6e8('0x19')](removeEntity(_0x69b4a4,null))[_0xe6e8('0x26')](handleError(_0x69b4a4,null));};exports[_0xe6e8('0x35')]=function(_0x2a7411,_0x4c7429){return db[_0xe6e8('0x20')]['describe']()[_0xe6e8('0x19')](respondWithResult(_0x4c7429,null))['catch'](handleError(_0x4c7429,null));};exports[_0xe6e8('0x36')]=function(_0x21b943,_0x530ef6){return db[_0xe6e8('0x37')][_0xe6e8('0x30')]({'where':{'id':_0x21b943[_0xe6e8('0x34')]['id']}})[_0xe6e8('0x19')](handleEntityNotFound(_0x530ef6,null))[_0xe6e8('0x19')](function(_0x4f33ee){if(_0x4f33ee){return _0x4f33ee[_0xe6e8('0x36')](_0x21b943[_0xe6e8('0x32')]['ids'],_[_0xe6e8('0x38')](_0x21b943[_0xe6e8('0x32')],[_0xe6e8('0x39'),'id'])||{});}})['then'](respondWithResult(_0x530ef6,null))['catch'](handleError(_0x530ef6,null));};exports['getMessages']=function(_0x656c28,_0x27abaf){var _0x2f4af8={'raw':![],'where':{}};var _0x4b711e={};var _0x2c64ba={'count':0x0,'rows':[]};return db[_0xe6e8('0x20')][_0xe6e8('0x3a')]({'where':{'id':_0x656c28[_0xe6e8('0x34')]['id']}})['then'](handleEntityNotFound(_0x27abaf,null))[_0xe6e8('0x19')](function(_0x14b7f4){if(_0x14b7f4){_0x4b711e[_0xe6e8('0x28')]=_[_0xe6e8('0x29')](db[_0xe6e8('0x37')][_0xe6e8('0x2a')]);_0x4b711e[_0xe6e8('0x24')]=_[_0xe6e8('0x29')](_0x656c28[_0xe6e8('0x24')]);_0x4b711e['filters']=_[_0xe6e8('0x2c')](_0x4b711e[_0xe6e8('0x28')],_0x4b711e[_0xe6e8('0x24')]);_0x2f4af8[_0xe6e8('0x2d')]=_[_0xe6e8('0x2c')](_0x4b711e[_0xe6e8('0x28')],qs[_0xe6e8('0x3b')](_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x3b')]));_0x2f4af8[_0xe6e8('0x2d')]=_0x2f4af8['attributes']['length']?_0x2f4af8[_0xe6e8('0x2d')]:_0x4b711e[_0xe6e8('0x28')];if(!_0x656c28['query']['hasOwnProperty'](_0xe6e8('0x3c'))){_0x2f4af8[_0xe6e8('0x3d')]=qs[_0xe6e8('0x3d')](_0x656c28[_0xe6e8('0x24')]['limit']);_0x2f4af8['offset']=qs[_0xe6e8('0x14')](_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x14')]);}_0x2f4af8[_0xe6e8('0x3e')]=qs[_0xe6e8('0x3f')](_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x3f')]);_0x2f4af8[_0xe6e8('0x40')]=qs[_0xe6e8('0x2b')](_['pick'](_0x656c28[_0xe6e8('0x24')],_0x4b711e['filters']));_0x2f4af8[_0xe6e8('0x40')][_0xe6e8('0x41')]=_0x14b7f4['id'];if(_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x42')]){_0x2f4af8[_0xe6e8('0x40')]=_[_0xe6e8('0x43')](_0x2f4af8[_0xe6e8('0x40')],{'$or':_[_0xe6e8('0x44')](_0x2f4af8[_0xe6e8('0x2d')],function(_0x5d1b3f){var _0x4177e9={};_0x4177e9[_0x5d1b3f]={'$like':'%'+_0x656c28[_0xe6e8('0x24')]['filter']+'%'};return _0x4177e9;})});}if(_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x45')]){var _0x3ab700=_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x45')][_0xe6e8('0x46')](',');var _0x110da7={};_0x110da7[_0x3ab700[0x0]]={'$gte':moment(_0x3ab700[0x1])[_0xe6e8('0x47')](_0xe6e8('0x48'))};_0x2f4af8[_0xe6e8('0x40')]=_[_0xe6e8('0x43')](_0x2f4af8[_0xe6e8('0x40')],_0x110da7);}_0x2f4af8=_[_0xe6e8('0x43')]({},_0x2f4af8,_0x656c28[_0xe6e8('0x2f')]);return db[_0xe6e8('0x37')][_0xe6e8('0x16')]({'where':_0x2f4af8[_0xe6e8('0x40')]})[_0xe6e8('0x19')](function(_0x578a6d){_0x2c64ba[_0xe6e8('0x16')]=_0x578a6d;if(_0x656c28[_0xe6e8('0x24')][_0xe6e8('0x2e')]){_0x2f4af8['include']=[{'all':!![]}];}return db[_0xe6e8('0x37')][_0xe6e8('0x23')](_0x2f4af8);})[_0xe6e8('0x19')](function(_0x42f978){_0x2c64ba[_0xe6e8('0x49')]=_0x42f978;return _0x2c64ba;});}})[_0xe6e8('0x19')](respondWithFilteredResult(_0x27abaf,_0x2f4af8))[_0xe6e8('0x26')](handleError(_0x27abaf,null));};exports['addTags']=function(_0x2ef275,_0xdce96a){return db[_0xe6e8('0x20')][_0xe6e8('0x30')]({'where':{'id':_0x2ef275[_0xe6e8('0x34')]['id']}})[_0xe6e8('0x19')](handleEntityNotFound(_0xdce96a,null))[_0xe6e8('0x19')](function(_0x830d9b){if(_0x830d9b){return _0x830d9b[_0xe6e8('0x4a')](_0x2ef275[_0xe6e8('0x32')][_0xe6e8('0x39')],_[_0xe6e8('0x38')](_0x2ef275[_0xe6e8('0x32')],[_0xe6e8('0x39'),'id'])||{})[_0xe6e8('0x4b')](function(){return db[_0xe6e8('0x4c')][_0xe6e8('0x23')]({'attributes':['id','name',_0xe6e8('0x4d')],'where':{'id':_0x2ef275[_0xe6e8('0x32')][_0xe6e8('0x39')]}});})[_0xe6e8('0x19')](function(_0x4d08b3){socket['emit'](_0xe6e8('0x4e'),{'id':Number(_0x2ef275[_0xe6e8('0x34')]['id']),'tags':_0x4d08b3||[]});return{'id':Number(_0x2ef275[_0xe6e8('0x34')]['id']),'tags':_0x4d08b3||[]};});}})[_0xe6e8('0x19')](respondWithResult(_0xdce96a,null))[_0xe6e8('0x26')](handleError(_0xdce96a,null));};exports[_0xe6e8('0x4f')]=function(_0x11607a,_0x399c04){return db['FaxInteraction'][_0xe6e8('0x30')]({'where':{'id':_0x11607a[_0xe6e8('0x34')]['id']}})['then'](handleEntityNotFound(_0x399c04,null))[_0xe6e8('0x19')](function(_0x3a5ba9){if(_0x3a5ba9){return _0x3a5ba9[_0xe6e8('0x4f')](_0x11607a['query'][_0xe6e8('0x39')]);}})['then'](respondWithStatusCode(_0x399c04,null))[_0xe6e8('0x26')](handleError(_0x399c04,null));};exports[_0xe6e8('0x50')]=function(_0x30ec81,_0x3f9e11){var _0x2a8db0=moment()[_0xe6e8('0x51')]()['toString']();var _0x31ca2f=path[_0xe6e8('0x52')](config[_0xe6e8('0x53')],_0xe6e8('0x54'),_0xe6e8('0x55'),_0xe6e8('0x56'));var _0x1b4e4a=path[_0xe6e8('0x52')](config['root'],_0xe6e8('0x54'),_0xe6e8('0x55'),_0xe6e8('0x57'));var _0x2e42a4=path['join'](_0x31ca2f,_0x2a8db0);var _0x38283c=util[_0xe6e8('0x47')]('transcript-%d-%s.zip',_0x30ec81[_0xe6e8('0x34')]['id'],_0x2a8db0);var _0x5298d8=path['join'](_0x31ca2f,_0x38283c);var _0x2e8362=[];_0x2e8362[_0xe6e8('0x58')]({'model':db[_0xe6e8('0x59')],'as':_0xe6e8('0x59'),'raw':!![]});var _0x5a6b3b=[{'model':db['FaxMessage'],'as':_0xe6e8('0x5a'),'attributes':['id',_0xe6e8('0x32'),_0xe6e8('0x5b')],'include':_0x2e8362}];return db[_0xe6e8('0x20')][_0xe6e8('0x30')]({'where':{'id':_0x30ec81[_0xe6e8('0x34')]['id']},'include':_0x5a6b3b})[_0xe6e8('0x19')](handleEntityNotFound(_0x3f9e11,null))[_0xe6e8('0x19')](function(_0x250fe1){if(_0x250fe1&&_0x250fe1[_0xe6e8('0x5a')]){var _0xb3db37=_0x250fe1[_0xe6e8('0x5c')]({'plain':!![]});fs[_0xe6e8('0x5d')](_0x2e42a4);for(var _0x46264d=0x0;_0x46264d<_0xb3db37[_0xe6e8('0x5a')][_0xe6e8('0x5e')];_0x46264d++){var _0x15e6c3=_0xb3db37['Messages'][_0x46264d]['Attachment'];if(_0x15e6c3){var _0x366045=path[_0xe6e8('0x52')](_0x1b4e4a,_0x15e6c3[_0xe6e8('0x5f')]);if(fs[_0xe6e8('0x60')](_0x366045)){fs['createReadStream'](_0x366045)[_0xe6e8('0x61')](fs[_0xe6e8('0x62')](path[_0xe6e8('0x52')](_0x2e42a4,_0x15e6c3[_0xe6e8('0x5f')])));}}}return BPromise['resolve']()[_0xe6e8('0x19')](function(){return new BPromise(function(_0x95e01e,_0x2034ec){zipdir(_0x2e42a4,{'saveTo':_0x5298d8},function(_0x8f8c,_0x12a266){if(_0x8f8c)return _0x2034ec(_0x8f8c);return _0x95e01e(_0x12a266);});})[_0xe6e8('0x19')](function(){return new BPromise(function(_0x1ee046,_0xde1ae2){rimraf(_0x2e42a4,function(_0x4e25a3){if(_0x4e25a3)_0xde1ae2(_0x4e25a3);return _0x1ee046();});});})['then'](function(){return _0x3f9e11['download'](_0x5298d8,_0x38283c,function(_0x274f9b){if(_0x274f9b){console['log'](_0xe6e8('0x63'),_0x274f9b);}else{fs[_0xe6e8('0x64')](_0x5298d8);}});});});}else{return _0x3f9e11[_0xe6e8('0x1a')](0xc8);}})[_0xe6e8('0x26')](handleError(_0x3f9e11,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 35290d0..c9eba34 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 _0xd412=['update','remove','then','setDataValue','Users','map','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save'];(function(_0x4c9f70,_0x53990b){var _0x3b1dd9=function(_0x1548fa){while(--_0x1548fa){_0x4c9f70['push'](_0x4c9f70['shift']());}};_0x3b1dd9(++_0x53990b);}(_0xd412,0x83));var _0x2d41=function(_0x46f01a,_0xc5ab14){_0x46f01a=_0x46f01a-0x0;var _0xfe8a59=_0xd412[_0x46f01a];return _0xfe8a59;};'use strict';var EventEmitter=require(_0x2d41('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x2d41('0x1'))['db'][_0x2d41('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d41('0x3'),'afterUpdate':_0x2d41('0x4'),'afterDestroy':_0x2d41('0x5')};function emitEvent(_0x4b8675){return function(_0x438191,_0x40c933,_0x3fde68){_0x438191['getUsers']({'attributes':['id'],'raw':!![]})[_0x2d41('0x6')](function(_0x4601ba){_0x438191[_0x2d41('0x7')](_0x2d41('0x8'),_0x4601ba[_0x2d41('0x9')](function(_0x3850fd){return{'id':_0x3850fd['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x438191['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2d41('0x6')](function(_0x2ec36e){_0x438191[_0x2d41('0x7')]('unreadMessages',_0x2ec36e['length']);FaxInteractionEvents[_0x2d41('0xa')](_0x4b8675+':'+_0x438191['id'],_0x438191);FaxInteractionEvents[_0x2d41('0xa')](_0x4b8675,_0x438191);_0x3fde68(null);})[_0x2d41('0xb')](_0x3fde68(null));};}for(var e in events){if(events[_0x2d41('0xc')](e)){var event=events[e];FaxInteraction[_0x2d41('0xd')](e,emitEvent(event));}}module[_0x2d41('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x7ee5=['findAll','unreadMessages','emit','exports','events','../../mysqldb','save','remove','getUsers','then','Users','map'];(function(_0x395b58,_0x23518d){var _0x43c80a=function(_0x4f5687){while(--_0x4f5687){_0x395b58['push'](_0x395b58['shift']());}};_0x43c80a(++_0x23518d);}(_0x7ee5,0x118));var _0x57ee=function(_0x436073,_0x11b1d6){_0x436073=_0x436073-0x0;var _0x564463=_0x7ee5[_0x436073];return _0x564463;};'use strict';var EventEmitter=require(_0x57ee('0x0'));var FaxInteraction=require(_0x57ee('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x57ee('0x2'),'afterUpdate':'update','afterDestroy':_0x57ee('0x3')};function emitEvent(_0x368d41){return function(_0x27bb37,_0x15a16b,_0x33c1bd){_0x27bb37[_0x57ee('0x4')]({'attributes':['id'],'raw':!![]})[_0x57ee('0x5')](function(_0xfacd5b){_0x27bb37['setDataValue'](_0x57ee('0x6'),_0xfacd5b[_0x57ee('0x7')](function(_0x316371){return{'id':_0x316371['id']};}));return FaxMessage[_0x57ee('0x8')]({'where':{'FaxInteractionId':_0x27bb37['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57ee('0x5')](function(_0x48148d){_0x27bb37['setDataValue'](_0x57ee('0x9'),_0x48148d['length']);FaxInteractionEvents[_0x57ee('0xa')](_0x368d41+':'+_0x27bb37['id'],_0x27bb37);FaxInteractionEvents[_0x57ee('0xa')](_0x368d41,_0x27bb37);_0x33c1bd(null);})['catch'](_0x33c1bd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x57ee('0xb')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 96df28d..96dc66e 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 _0xdba3=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdba3,0x19f));var _0x3dba=function(_0x234490,_0x55a83c){_0x234490=_0x234490-0x0;var _0x5d4081=_0xdba3[_0x234490];return _0x5d4081;};'use strict';var _=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var logger=require('../../config/logger')(_0x3dba('0x2'));var moment=require(_0x3dba('0x3'));var BPromise=require(_0x3dba('0x4'));var rp=require(_0x3dba('0x5'));var fs=require('fs');var path=require(_0x3dba('0x6'));var rimraf=require(_0x3dba('0x7'));var config=require(_0x3dba('0x8'));var attributes=require(_0x3dba('0x9'));module[_0x3dba('0xa')]=function(_0x374134,_0x50995d){return _0x374134[_0x3dba('0xb')](_0x3dba('0xc'),attributes,{'tableName':_0x3dba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c1f2a,_0x4b33d8,_0x56e4ed){if(_0x5c1f2a[_0x3dba('0xe')](_0x3dba('0xf'))){_0x5c1f2a['closedAt']=moment()[_0x3dba('0x10')](_0x3dba('0x11'));}_0x56e4ed(null,_0x5c1f2a);}}});}; \ No newline at end of file +var _0x8b24=['../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','changed','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x18eb9d,_0x5d9c1e){var _0xbb16ab=function(_0x154f7e){while(--_0x154f7e){_0x18eb9d['push'](_0x18eb9d['shift']());}};_0xbb16ab(++_0x5d9c1e);}(_0x8b24,0x178));var _0x48b2=function(_0x552b3c,_0x1f9bae){_0x552b3c=_0x552b3c-0x0;var _0x15c9c3=_0x8b24[_0x552b3c];return _0x15c9c3;};'use strict';var _=require(_0x48b2('0x0'));var util=require(_0x48b2('0x1'));var logger=require(_0x48b2('0x2'))('api');var moment=require(_0x48b2('0x3'));var BPromise=require(_0x48b2('0x4'));var rp=require(_0x48b2('0x5'));var fs=require('fs');var path=require(_0x48b2('0x6'));var rimraf=require(_0x48b2('0x7'));var config=require(_0x48b2('0x8'));var attributes=require(_0x48b2('0x9'));module[_0x48b2('0xa')]=function(_0x182a9e,_0x320694){return _0x182a9e['define'](_0x48b2('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c312b,_0x3febea,_0x19d876){if(_0x1c312b[_0x48b2('0xc')](_0x48b2('0xd'))){_0x1c312b[_0x48b2('0xe')]=moment()[_0x48b2('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x19d876(null,_0x1c312b);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 4518d21..c8dab2e 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 _0x2287=['client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','FaxInteraction','update','body','options','raw','where','attributes','info','UpdateFaxInteraction','find','addTags','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x38f366,_0x1eda8b){var _0x4b00a2=function(_0x1d3da9){while(--_0x1d3da9){_0x38f366['push'](_0x38f366['shift']());}};_0x4b00a2(++_0x1eda8b);}(_0x2287,0x77));var _0x7228=function(_0x31fe47,_0x32640f){_0x31fe47=_0x31fe47-0x0;var _0x2e78a8=_0x2287[_0x31fe47];return _0x2e78a8;};'use strict';var _=require(_0x7228('0x0'));var util=require(_0x7228('0x1'));var moment=require(_0x7228('0x2'));var BPromise=require(_0x7228('0x3'));var rs=require(_0x7228('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7228('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7228('0x6'))(_0x7228('0x7'));var config=require(_0x7228('0x8'));var jayson=require(_0x7228('0x9'));var client=jayson[_0x7228('0xa')][_0x7228('0xb')]({'port':0x232a});config[_0x7228('0xc')]=_[_0x7228('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7228('0xe'))(new Redis(config[_0x7228('0xc')]));require(_0x7228('0xf'))[_0x7228('0x10')](socket);function respondWithRpcPromise(_0x99cb2b,_0x299897,_0x3458c1){return new BPromise(function(_0x25c0df,_0x12e426){return client[_0x7228('0x11')](_0x99cb2b,_0x3458c1)[_0x7228('0x12')](function(_0xe9687a){logger['info'](_0x7228('0x13'),_0x299897,'request\x20sent');logger['debug'](_0x7228('0x14'),_0x299897,'request\x20sent',JSON[_0x7228('0x15')](_0xe9687a));if(_0xe9687a[_0x7228('0x16')]){if(_0xe9687a[_0x7228('0x16')]['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x299897,_0xe9687a[_0x7228('0x16')]['message']);return _0x12e426(_0xe9687a[_0x7228('0x16')][_0x7228('0x17')]);}logger['error'](_0x7228('0x13'),_0x299897,_0xe9687a[_0x7228('0x16')]['message']);return _0x25c0df(_0xe9687a[_0x7228('0x16')][_0x7228('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x299897,_0x7228('0x18'));_0x25c0df(_0xe9687a[_0x7228('0x19')][_0x7228('0x17')]);}})[_0x7228('0x1a')](function(_0x40b57a){logger[_0x7228('0x16')](_0x7228('0x13'),_0x299897,_0x40b57a);_0x12e426(_0x40b57a);});});}exports['UpdateFaxInteraction']=function(_0x12c0a5){var _0x2794c6=this;return new Promise(function(_0x5495a8,_0x1febfa){return db[_0x7228('0x1b')][_0x7228('0x1c')](_0x12c0a5[_0x7228('0x1d')],{'raw':_0x12c0a5['options']?_0x12c0a5[_0x7228('0x1e')][_0x7228('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c0a5[_0x7228('0x1e')]?_0x12c0a5['options'][_0x7228('0x20')]||null:null,'attributes':_0x12c0a5[_0x7228('0x1e')]?_0x12c0a5[_0x7228('0x1e')][_0x7228('0x21')]||null:null,'limit':_0x12c0a5['options']?_0x12c0a5[_0x7228('0x1e')]['limit']||null:null})[_0x7228('0x12')](function(_0x3132a9){logger[_0x7228('0x22')](_0x7228('0x23'),_0x12c0a5);logger['debug']('UpdateFaxInteraction',_0x12c0a5,JSON[_0x7228('0x15')](_0x3132a9));_0x5495a8(_0x3132a9);})['catch'](function(_0x313205){logger[_0x7228('0x16')]('UpdateFaxInteraction',_0x313205[_0x7228('0x17')],_0x12c0a5);_0x1febfa(_0x2794c6[_0x7228('0x16')](0x1f4,_0x313205[_0x7228('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2e3a20){return new Promise(function(_0x144cf9,_0x840a90){return db[_0x7228('0x1b')][_0x7228('0x24')]({'where':_0x2e3a20[_0x7228('0x1e')]?_0x2e3a20[_0x7228('0x1e')][_0x7228('0x20')]||null:null})['then'](function(_0x1be5ca){if(_0x1be5ca){return _0x1be5ca[_0x7228('0x25')](_0x2e3a20[_0x7228('0x1d')][_0x7228('0x26')],_[_0x7228('0x27')](_0x2e3a20[_0x7228('0x1d')],['ids','id'])||{});}})[_0x7228('0x28')](function(_0x11f62b){logger[_0x7228('0x22')]('AddTags',_0x2e3a20);logger[_0x7228('0x29')](_0x7228('0x2a'),_0x2e3a20,JSON[_0x7228('0x15')](_0x11f62b));_0x144cf9(_0x11f62b);})['catch'](function(_0x9718b2){logger[_0x7228('0x16')]('AddTags',_0x9718b2[_0x7228('0x17')],_0x2e3a20);_0x840a90(_this[_0x7228('0x16')](0x1f4,_0x9718b2[_0x7228('0x17')]));});});}; \ No newline at end of file +var _0x163d=['AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateFaxInteraction','body','options','raw','where','attributes','limit','then','debug','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread'];(function(_0x14b989,_0x46995a){var _0x3e33af=function(_0x412a14){while(--_0x412a14){_0x14b989['push'](_0x14b989['shift']());}};_0x3e33af(++_0x46995a);}(_0x163d,0x119));var _0xd163=function(_0x86ee6b,_0x327128){_0x86ee6b=_0x86ee6b-0x0;var _0x26a449=_0x163d[_0x86ee6b];return _0x26a449;};'use strict';var _=require(_0xd163('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd163('0x1'));var rs=require(_0xd163('0x2'));var fs=require('fs');var Redis=require(_0xd163('0x3'));var db=require(_0xd163('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd163('0x5'))('rpc');var config=require(_0xd163('0x6'));var jayson=require(_0xd163('0x7'));var client=jayson[_0xd163('0x8')][_0xd163('0x9')]({'port':0x232a});config[_0xd163('0xa')]=_[_0xd163('0xb')](config[_0xd163('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd163('0xc'))(new Redis(config['redis']));require(_0xd163('0xd'))[_0xd163('0xe')](socket);function respondWithRpcPromise(_0x4d541f,_0x47d807,_0x506c0f){return new BPromise(function(_0x113284,_0x4c7212){return client['request'](_0x4d541f,_0x506c0f)['then'](function(_0xeeece6){logger[_0xd163('0xf')](_0xd163('0x10'),_0x47d807,_0xd163('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x47d807,_0xd163('0x11'),JSON['stringify'](_0xeeece6));if(_0xeeece6['error']){if(_0xeeece6[_0xd163('0x12')][_0xd163('0x13')]===0x1f4){logger['error'](_0xd163('0x10'),_0x47d807,_0xeeece6['error'][_0xd163('0x14')]);return _0x4c7212(_0xeeece6[_0xd163('0x12')]['message']);}logger[_0xd163('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x47d807,_0xeeece6['error'][_0xd163('0x14')]);return _0x113284(_0xeeece6['error'][_0xd163('0x14')]);}else{logger[_0xd163('0xf')](_0xd163('0x10'),_0x47d807,'request\x20sent');_0x113284(_0xeeece6[_0xd163('0x15')][_0xd163('0x14')]);}})[_0xd163('0x16')](function(_0x978e38){logger[_0xd163('0x12')](_0xd163('0x10'),_0x47d807,_0x978e38);_0x4c7212(_0x978e38);});});}exports[_0xd163('0x17')]=function(_0x564e02){var _0x495fe1=this;return new Promise(function(_0x3f1905,_0x2d566f){return db['FaxInteraction']['update'](_0x564e02[_0xd163('0x18')],{'raw':_0x564e02['options']?_0x564e02[_0xd163('0x19')][_0xd163('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564e02[_0xd163('0x19')]?_0x564e02['options'][_0xd163('0x1b')]||null:null,'attributes':_0x564e02['options']?_0x564e02['options'][_0xd163('0x1c')]||null:null,'limit':_0x564e02['options']?_0x564e02['options'][_0xd163('0x1d')]||null:null})[_0xd163('0x1e')](function(_0x4e1b6e){logger['info'](_0xd163('0x17'),_0x564e02);logger[_0xd163('0x1f')](_0xd163('0x17'),_0x564e02,JSON[_0xd163('0x20')](_0x4e1b6e));_0x3f1905(_0x4e1b6e);})[_0xd163('0x16')](function(_0x367874){logger[_0xd163('0x12')](_0xd163('0x17'),_0x367874['message'],_0x564e02);_0x2d566f(_0x495fe1['error'](0x1f4,_0x367874[_0xd163('0x14')]));});});};exports[_0xd163('0x21')]=function(_0x5144ee){return new Promise(function(_0x357d5a,_0x27eb0c){return db[_0xd163('0x22')][_0xd163('0x23')]({'where':_0x5144ee[_0xd163('0x19')]?_0x5144ee[_0xd163('0x19')][_0xd163('0x1b')]||null:null})['then'](function(_0xcadac){if(_0xcadac){return _0xcadac[_0xd163('0x24')](_0x5144ee[_0xd163('0x18')]['ids'],_['omit'](_0x5144ee['body'],[_0xd163('0x25'),'id'])||{});}})[_0xd163('0x26')](function(_0x43c426){logger[_0xd163('0xf')](_0xd163('0x27'),_0x5144ee);logger[_0xd163('0x1f')](_0xd163('0x27'),_0x5144ee,JSON[_0xd163('0x20')](_0x43c426));_0x357d5a(_0x43c426);})['catch'](function(_0x454436){logger[_0xd163('0x12')](_0xd163('0x27'),_0x454436[_0xd163('0x14')],_0x5144ee);_0x27eb0c(_this[_0xd163('0x12')](0x1f4,_0x454436[_0xd163('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0300d81..d8c0d4d 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 _0x63b3=['./faxInteraction.events','save','update','removeListener','register','length','faxInteraction:'];(function(_0x5c54ff,_0x58e42c){var _0x5406db=function(_0x53b411){while(--_0x53b411){_0x5c54ff['push'](_0x5c54ff['shift']());}};_0x5406db(++_0x58e42c);}(_0x63b3,0x173));var _0x363b=function(_0x3a7dfb,_0x591ca1){_0x3a7dfb=_0x3a7dfb-0x0;var _0x42a20=_0x63b3[_0x3a7dfb];return _0x42a20;};'use strict';var FaxInteractionEvents=require(_0x363b('0x0'));var events=[_0x363b('0x1'),'remove',_0x363b('0x2')];function createListener(_0x456be2,_0x1a28f7){return function(_0x34682e){_0x1a28f7['emit'](_0x456be2,_0x34682e);};}function removeListener(_0x3e7999,_0x6043a7){return function(){FaxInteractionEvents[_0x363b('0x3')](_0x3e7999,_0x6043a7);};}exports[_0x363b('0x4')]=function(_0x5a1926){for(var _0x47d3d8=0x0,_0x7614b9=events[_0x363b('0x5')];_0x47d3d8<_0x7614b9;_0x47d3d8++){var _0x1b1b92=events[_0x47d3d8];var _0x522299=createListener(_0x363b('0x6')+_0x1b1b92,_0x5a1926);FaxInteractionEvents['on'](_0x1b1b92,_0x522299);}}; \ No newline at end of file +var _0x2d72=['register','length','faxInteraction:','save','update','emit','removeListener'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0x2d72,0x168));var _0x22d7=function(_0x58f4af,_0x3e0e98){_0x58f4af=_0x58f4af-0x0;var _0x2f5d8a=_0x2d72[_0x58f4af];return _0x2f5d8a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x22d7('0x0'),'remove',_0x22d7('0x1')];function createListener(_0x15b0da,_0x35868e){return function(_0x453ca6){_0x35868e[_0x22d7('0x2')](_0x15b0da,_0x453ca6);};}function removeListener(_0x35d39e,_0x31a4b9){return function(){FaxInteractionEvents[_0x22d7('0x3')](_0x35d39e,_0x31a4b9);};}exports[_0x22d7('0x4')]=function(_0x48275e){for(var _0x31e430=0x0,_0x1dcebc=events[_0x22d7('0x5')];_0x31e430<_0x1dcebc;_0x31e430++){var _0x1ec963=events[_0x31e430];var _0x3a5bd1=createListener(_0x22d7('0x6')+_0x1ec963,_0x48275e);FaxInteractionEvents['on'](_0x1ec963,_0x3a5bd1);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 212f3cc..bb0ad17 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 _0x23fc=['/:id/tags','fax','addTags','put','tracked','update','destroy','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage'];(function(_0x1c89fa,_0xfbba1a){var _0x4bee68=function(_0x47a5fa){while(--_0x47a5fa){_0x1c89fa['push'](_0x1c89fa['shift']());}};_0x4bee68(++_0xfbba1a);}(_0x23fc,0x10e));var _0xc23f=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x23fc[_0x2eb3db];return _0x358f33;};'use strict';var multer=require(_0xc23f('0x0'));var util=require(_0xc23f('0x1'));var path=require(_0xc23f('0x2'));var timeout=require(_0xc23f('0x3'));var express=require('express');var router=express[_0xc23f('0x4')]();var fs_extra=require(_0xc23f('0x5'));var auth=require(_0xc23f('0x6'));var interaction=require(_0xc23f('0x7'));var config=require('../../config/environment');var controller=require(_0xc23f('0x8'));router[_0xc23f('0x9')]('/',auth[_0xc23f('0xa')](),controller['index']);router[_0xc23f('0x9')](_0xc23f('0xb'),auth[_0xc23f('0xa')](),controller['describe']);router[_0xc23f('0x9')](_0xc23f('0xc'),auth[_0xc23f('0xa')](),controller[_0xc23f('0xd')]);router['get'](_0xc23f('0xe'),auth['isAuthenticated'](),controller[_0xc23f('0xf')]);router[_0xc23f('0x9')]('/:id/download',auth[_0xc23f('0xa')](),controller[_0xc23f('0x10')]);router[_0xc23f('0x11')]('/',auth[_0xc23f('0xa')](),controller[_0xc23f('0x12')]);router[_0xc23f('0x11')](_0xc23f('0xe'),auth['isAuthenticated'](),controller[_0xc23f('0x13')]);router[_0xc23f('0x11')](_0xc23f('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xc23f('0x15'),'faxinteraction:addtags'),controller[_0xc23f('0x16')]);router[_0xc23f('0x17')](_0xc23f('0xc'),auth[_0xc23f('0xa')](),interaction[_0xc23f('0x18')](_0xc23f('0x15'),'faxinteraction:update'),controller[_0xc23f('0x19')]);router['delete'](_0xc23f('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xc23f('0x15'),'faxinteraction:destroy'),controller[_0xc23f('0x1a')]);router[_0xc23f('0x1b')](_0xc23f('0x14'),auth[_0xc23f('0xa')](),controller['removeTags']);module[_0xc23f('0x1c')]=router; \ No newline at end of file +var _0xf7d5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout'];(function(_0x457c96,_0x13785c){var _0x4e5ebc=function(_0x2fddc2){while(--_0x2fddc2){_0x457c96['push'](_0x457c96['shift']());}};_0x4e5ebc(++_0x13785c);}(_0xf7d5,0x189));var _0x5f7d=function(_0x5c619e,_0xd5d312){_0x5c619e=_0x5c619e-0x0;var _0x4e4572=_0xf7d5[_0x5c619e];return _0x4e4572;};'use strict';var multer=require('multer');var util=require(_0x5f7d('0x0'));var path=require(_0x5f7d('0x1'));var timeout=require(_0x5f7d('0x2'));var express=require(_0x5f7d('0x3'));var router=express[_0x5f7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5f7d('0x5'));var interaction=require(_0x5f7d('0x6'));var config=require(_0x5f7d('0x7'));var controller=require(_0x5f7d('0x8'));router['get']('/',auth[_0x5f7d('0x9')](),controller[_0x5f7d('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5f7d('0xb')]);router[_0x5f7d('0xc')](_0x5f7d('0xd'),auth['isAuthenticated'](),controller[_0x5f7d('0xe')]);router[_0x5f7d('0xc')](_0x5f7d('0xf'),auth[_0x5f7d('0x9')](),controller[_0x5f7d('0x10')]);router[_0x5f7d('0xc')]('/:id/download',auth[_0x5f7d('0x9')](),controller[_0x5f7d('0x11')]);router[_0x5f7d('0x12')]('/',auth[_0x5f7d('0x9')](),controller[_0x5f7d('0x13')]);router[_0x5f7d('0x12')](_0x5f7d('0xf'),auth[_0x5f7d('0x9')](),controller['addMessage']);router[_0x5f7d('0x12')](_0x5f7d('0x14'),auth['isAuthenticated'](),interaction[_0x5f7d('0x15')]('fax',_0x5f7d('0x16')),controller[_0x5f7d('0x17')]);router[_0x5f7d('0x18')]('/:id',auth[_0x5f7d('0x9')](),interaction[_0x5f7d('0x15')](_0x5f7d('0x19'),_0x5f7d('0x1a')),controller[_0x5f7d('0x1b')]);router[_0x5f7d('0x1c')](_0x5f7d('0xd'),auth[_0x5f7d('0x9')](),interaction['tracked']('fax',_0x5f7d('0x1d')),controller[_0x5f7d('0x1e')]);router['delete'](_0x5f7d('0x14'),auth[_0x5f7d('0x9')](),controller[_0x5f7d('0x1f')]);module[_0x5f7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 7df7b79..ff57bc5 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 _0x207d=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x99a230,_0xe70e96){var _0xd903cf=function(_0x2bf598){while(--_0x2bf598){_0x99a230['push'](_0x99a230['shift']());}};_0xd903cf(++_0xe70e96);}(_0x207d,0x10d));var _0xd207=function(_0x711ebd,_0x393e61){_0x711ebd=_0x711ebd-0x0;var _0x41ec9e=_0x207d[_0x711ebd];return _0x41ec9e;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'body':{'type':Sequelize[_0xd207('0x2')](_0xd207('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd207('0x4')]('in','out'),'defaultValue':_0xd207('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd207('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xf9f7=['exports','TEXT','medium','BOOLEAN','ENUM','DATE','sequelize'];(function(_0x1ce5c1,_0x5cb123){var _0x17c3d8=function(_0x4e9b44){while(--_0x4e9b44){_0x1ce5c1['push'](_0x1ce5c1['shift']());}};_0x17c3d8(++_0x5cb123);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0xf9f7[_0x3cb7c1];return _0x3f6ffc;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'body':{'type':Sequelize[_0x7f9f('0x2')](_0x7f9f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7f9f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f9f('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x7f9f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7f9f('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b45ee59..73c52b9 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 _0x4c96=['read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','motionChannel','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','fax','download','join','root','server','files','Attachment','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','end','json','offset','undefined','count','status','set','apply','reject','save','update','destroy','name','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','FaxMessage','rows','catch','show','body','find','params','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c96,0x1eb));var _0x64c9=function(_0x369e2b,_0x384403){_0x369e2b=_0x369e2b-0x0;var _0x62676e=_0x4c96[_0x369e2b];return _0x62676e;};'use strict';var emlformat=require(_0x64c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x64c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64c9('0x2'));var moment=require(_0x64c9('0x3'));var BPromise=require(_0x64c9('0x4'));var Mustache=require(_0x64c9('0x5'));var util=require(_0x64c9('0x6'));var path=require(_0x64c9('0x7'));var sox=require('sox');var csv=require(_0x64c9('0x8'));var ejs=require(_0x64c9('0x9'));var fs=require('fs');var fs_extra=require(_0x64c9('0xa'));var _=require('lodash');var squel=require(_0x64c9('0xb'));var crypto=require(_0x64c9('0xc'));var jsforce=require(_0x64c9('0xd'));var deskjs=require(_0x64c9('0xe'));var toCsv=require(_0x64c9('0x8'));var querystring=require(_0x64c9('0xf'));var Papa=require(_0x64c9('0x10'));var Redis=require(_0x64c9('0x11'));var authService=require(_0x64c9('0x12'));var qs=require(_0x64c9('0x13'));var as=require(_0x64c9('0x14'));var hardwareService=require(_0x64c9('0x15'));var logger=require(_0x64c9('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x64c9('0x17'));var licenseUtil=require(_0x64c9('0x18'));var db=require(_0x64c9('0x19'))['db'];config['redis']=_[_0x64c9('0x1a')](config[_0x64c9('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x64c9('0x1c'))(new Redis(config[_0x64c9('0x1b')]));require(_0x64c9('0x1d'))[_0x64c9('0x1e')](socket);var jayson=require(_0x64c9('0x1f'));var client=jayson['client'][_0x64c9('0x20')]({'port':0x232c});var client9002=jayson[_0x64c9('0x21')][_0x64c9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x518475,_0x9cdcae,_0x7d7188,_0x2d3bfa){return new BPromise(function(_0x1442a4,_0x4c481e){var _0x3f6f93=_0x2d3bfa||client;return _0x3f6f93[_0x64c9('0x22')](_0x518475,_0x7d7188)[_0x64c9('0x23')](function(_0x356a6c){logger[_0x64c9('0x24')](_0x64c9('0x25'),_0x9cdcae,'request\x20sent');logger['debug'](_0x64c9('0x26'),_0x9cdcae,_0x64c9('0x27'),JSON[_0x64c9('0x28')](_0x356a6c));if(_0x356a6c['error']){if(_0x356a6c[_0x64c9('0x29')]['code']===0x1f4){logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);return _0x4c481e(_0x356a6c['error'][_0x64c9('0x2a')]);}logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);return _0x1442a4(_0x356a6c[_0x64c9('0x29')][_0x64c9('0x2a')]);}else{logger['info'](_0x64c9('0x25'),_0x9cdcae,_0x64c9('0x27'));_0x1442a4(_0x356a6c[_0x64c9('0x2b')][_0x64c9('0x2a')]);}})['catch'](function(_0x153d47){logger[_0x64c9('0x29')](_0x64c9('0x25'),_0x9cdcae,_0x153d47);_0x4c481e(_0x153d47);});});}function respondWithStatusCode(_0x6ae0d0,_0x1b9c85){_0x1b9c85=_0x1b9c85||0xcc;return function(_0x174d0a){if(_0x174d0a){return _0x6ae0d0[_0x64c9('0x2c')](_0x1b9c85);}return _0x6ae0d0['status'](_0x1b9c85)[_0x64c9('0x2d')]();};}function respondWithResult(_0x1d0431,_0x10e534){_0x10e534=_0x10e534||0xc8;return function(_0x1aeb15){if(_0x1aeb15){return _0x1d0431['status'](_0x10e534)[_0x64c9('0x2e')](_0x1aeb15);}};}function respondWithFilteredResult(_0x42af8d,_0x30fa4a){return function(_0x2424d6){if(_0x2424d6){var _0x515952=typeof _0x30fa4a[_0x64c9('0x2f')]==='undefined'&&typeof _0x30fa4a['limit']===_0x64c9('0x30');var _0xd8a713=_0x2424d6[_0x64c9('0x31')];var _0x396261=_0x515952?0x0:_0x30fa4a['offset'];var _0x23da06=_0x515952?_0x2424d6[_0x64c9('0x31')]:_0x30fa4a[_0x64c9('0x2f')]+_0x30fa4a['limit'];var _0x3e13cc;if(_0x23da06>=_0xd8a713){_0x23da06=_0xd8a713;_0x3e13cc=0xc8;}else{_0x3e13cc=0xce;}_0x42af8d[_0x64c9('0x32')](_0x3e13cc);return _0x42af8d[_0x64c9('0x33')]('Content-Range',_0x396261+'-'+_0x23da06+'/'+_0xd8a713)[_0x64c9('0x2e')](_0x2424d6);}return null;};}function patchUpdates(_0x2c8895){return function(_0x57f619){try{jsonpatch[_0x64c9('0x34')](_0x57f619,_0x2c8895,!![]);}catch(_0x56bc8b){return BPromise[_0x64c9('0x35')](_0x56bc8b);}return _0x57f619[_0x64c9('0x36')]();};}function saveUpdates(_0x4eaad2,_0x53ba02){return function(_0x5a21a7){if(_0x5a21a7){return _0x5a21a7[_0x64c9('0x37')](_0x4eaad2)[_0x64c9('0x23')](function(_0x5e0fcb){return _0x5e0fcb;});}return null;};}function removeEntity(_0x4b3923,_0x17072e){return function(_0x2c43e3){if(_0x2c43e3){return _0x2c43e3[_0x64c9('0x38')]()[_0x64c9('0x23')](function(){_0x4b3923[_0x64c9('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171c8f,_0x1463cf){return function(_0x7b44e9){if(!_0x7b44e9){_0x171c8f['sendStatus'](0x194);}return _0x7b44e9;};}function handleError(_0x397410,_0x30e67c){_0x30e67c=_0x30e67c||0x1f4;return function(_0x305f92){logger[_0x64c9('0x29')](_0x305f92['stack']);if(_0x305f92[_0x64c9('0x39')]){delete _0x305f92[_0x64c9('0x39')];}_0x397410[_0x64c9('0x32')](_0x30e67c)['send'](_0x305f92);};}exports[_0x64c9('0x3a')]=function(_0x114559,_0xe34005){var _0x20a3a3={},_0x383adb={},_0x1a9caf={'count':0x0,'rows':[]};var _0x7546f0=_['map'](db['FaxMessage'][_0x64c9('0x3b')],function(_0x4cd595){return{'name':_0x4cd595[_0x64c9('0x3c')],'type':_0x4cd595['type'][_0x64c9('0x3d')]};});_0x383adb[_0x64c9('0x3e')]=_[_0x64c9('0x3f')](_0x7546f0,_0x64c9('0x39'));_0x383adb['query']=_[_0x64c9('0x40')](_0x114559['query']);_0x383adb[_0x64c9('0x41')]=_[_0x64c9('0x42')](_0x383adb[_0x64c9('0x3e')],_0x383adb[_0x64c9('0x43')]);_0x20a3a3[_0x64c9('0x44')]=_[_0x64c9('0x42')](_0x383adb[_0x64c9('0x3e')],qs[_0x64c9('0x45')](_0x114559[_0x64c9('0x43')][_0x64c9('0x45')]));_0x20a3a3['attributes']=_0x20a3a3['attributes'][_0x64c9('0x46')]?_0x20a3a3['attributes']:_0x383adb['model'];if(!_0x114559[_0x64c9('0x43')][_0x64c9('0x47')](_0x64c9('0x48'))){_0x20a3a3[_0x64c9('0x49')]=qs[_0x64c9('0x49')](_0x114559['query'][_0x64c9('0x49')]);_0x20a3a3[_0x64c9('0x2f')]=qs[_0x64c9('0x2f')](_0x114559['query']['offset']);}_0x20a3a3[_0x64c9('0x4a')]=qs[_0x64c9('0x4b')](_0x114559['query'][_0x64c9('0x4b')]);_0x20a3a3[_0x64c9('0x4c')]=qs[_0x64c9('0x41')](_['pick'](_0x114559[_0x64c9('0x43')],_0x383adb[_0x64c9('0x41')]),_0x7546f0);if(_0x114559[_0x64c9('0x43')][_0x64c9('0x4d')]){_0x20a3a3[_0x64c9('0x4c')]=_[_0x64c9('0x4e')](_0x20a3a3['where'],{'$or':_['map'](_0x7546f0,function(_0x1151e7){if(_0x1151e7['type']!=='VIRTUAL'){var _0x1c835c={};_0x1c835c[_0x1151e7['name']]={'$like':'%'+_0x114559['query'][_0x64c9('0x4d')]+'%'};return _0x1c835c;}})});}_0x20a3a3=_[_0x64c9('0x4e')]({},_0x20a3a3,_0x114559[_0x64c9('0x4f')]);var _0x329d3a={'where':_0x20a3a3[_0x64c9('0x4c')]};return db['FaxMessage']['count'](_0x329d3a)['then'](function(_0x4c4654){_0x1a9caf[_0x64c9('0x31')]=_0x4c4654;if(_0x114559[_0x64c9('0x43')][_0x64c9('0x50')]){_0x20a3a3['include']=[{'all':!![]}];}return db[_0x64c9('0x51')]['findAll'](_0x20a3a3);})[_0x64c9('0x23')](function(_0x40b8d7){_0x1a9caf[_0x64c9('0x52')]=_0x40b8d7;return _0x1a9caf;})[_0x64c9('0x23')](respondWithFilteredResult(_0xe34005,_0x20a3a3))[_0x64c9('0x53')](handleError(_0xe34005,null));};exports[_0x64c9('0x54')]=function(_0x9c0d31,_0x47eb11){var _0x5cb819={'raw':!![],'where':{'id':_0x9c0d31['params']['id']}},_0x3bcc6a={};_0x3bcc6a[_0x64c9('0x3e')]=_[_0x64c9('0x40')](db['FaxMessage'][_0x64c9('0x3b')]);_0x3bcc6a[_0x64c9('0x43')]=_['keys'](_0x9c0d31[_0x64c9('0x43')]);_0x3bcc6a[_0x64c9('0x41')]=_[_0x64c9('0x42')](_0x3bcc6a['model'],_0x3bcc6a[_0x64c9('0x43')]);_0x5cb819[_0x64c9('0x44')]=_[_0x64c9('0x42')](_0x3bcc6a['model'],qs['fields'](_0x9c0d31[_0x64c9('0x43')][_0x64c9('0x45')]));_0x5cb819[_0x64c9('0x44')]=_0x5cb819[_0x64c9('0x44')]['length']?_0x5cb819[_0x64c9('0x44')]:_0x3bcc6a[_0x64c9('0x3e')];if(_0x9c0d31[_0x64c9('0x43')][_0x64c9('0x50')]){_0x5cb819['include']=[{'all':!![]}];}_0x5cb819=_[_0x64c9('0x4e')]({},_0x5cb819,_0x9c0d31[_0x64c9('0x4f')]);return db[_0x64c9('0x51')]['find'](_0x5cb819)[_0x64c9('0x23')](handleEntityNotFound(_0x47eb11,null))['then'](respondWithResult(_0x47eb11,null))[_0x64c9('0x53')](handleError(_0x47eb11,null));};exports[_0x64c9('0x37')]=function(_0x571dce,_0x3ae7d5){if(_0x571dce[_0x64c9('0x55')]['id']){delete _0x571dce[_0x64c9('0x55')]['id'];}return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x571dce[_0x64c9('0x57')]['id']}})[_0x64c9('0x23')](handleEntityNotFound(_0x3ae7d5,null))['then'](saveUpdates(_0x571dce['body'],null))['then'](respondWithResult(_0x3ae7d5,null))['catch'](handleError(_0x3ae7d5,null));};exports[_0x64c9('0x38')]=function(_0xdd811b,_0x3755e2){return db['FaxMessage'][_0x64c9('0x56')]({'where':{'id':_0xdd811b[_0x64c9('0x57')]['id']}})['then'](handleEntityNotFound(_0x3755e2,null))[_0x64c9('0x23')](removeEntity(_0x3755e2,null))[_0x64c9('0x53')](handleError(_0x3755e2,null));};exports[_0x64c9('0x58')]=function(_0x48333d,_0xb4f53b){return db['FaxMessage'][_0x64c9('0x58')]()[_0x64c9('0x23')](respondWithResult(_0xb4f53b,null))[_0x64c9('0x53')](handleError(_0xb4f53b,null));};var interaction_log=require(_0x64c9('0x16'))('fax-interactions');exports['accept']=function(_0x3d483a,_0x4d7fc4,_0x4b619e){var _0x1825e3={'agent':{},'channel':'fax'};if(_0x3d483a[_0x64c9('0x55')]['id']){delete _0x3d483a[_0x64c9('0x55')]['id'];}_0x3d483a[_0x64c9('0x55')][_0x64c9('0x59')]=!![];_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5a')]=moment()['format'](_0x64c9('0x5b'));_0x3d483a['body'][_0x64c9('0x5c')]=_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')]||_0x3d483a[_0x64c9('0x5d')]['id'];_0x1825e3[_0x64c9('0x5e')]['id']=_0x3d483a[_0x64c9('0x55')]['UserId'];return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x3d483a[_0x64c9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d7fc4,null))[_0x64c9('0x23')](saveUpdates(_0x3d483a[_0x64c9('0x55')],null))[_0x64c9('0x23')](function(_0x3c4dbe){if(_0x3c4dbe){_0x1825e3[_0x64c9('0x2a')]=_0x3c4dbe['get']({'plain':!![]});return db[_0x64c9('0x5f')]['find']({'where':{'id':_0x3c4dbe[_0x64c9('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x4d7fc4,null))[_0x64c9('0x23')](function(_0x25d260){if(_0x25d260){return _0x25d260[_0x64c9('0x37')]({'UserId':_0x3d483a[_0x64c9('0x55')]['UserId'],'read1stAt':_['isNil'](_0x25d260[_0x64c9('0x61')])?moment()[_0x64c9('0x62')](_0x64c9('0x5b')):undefined});}return null;})[_0x64c9('0x23')](function(_0x5acf1b){if(_0x5acf1b){_0x1825e3[_0x64c9('0x63')]=_0x5acf1b[_0x64c9('0x64')]({'plain':!![]});interaction_log[_0x64c9('0x24')](_0x64c9('0x65'),_0x3d483a['user']['id'],_0x3d483a[_0x64c9('0x5d')][_0x64c9('0x39')],_0x3d483a[_0x64c9('0x5d')]['role'],_0x1825e3['interaction']['id'],_0x3d483a[_0x64c9('0x55')]?JSON[_0x64c9('0x28')](_0x3d483a[_0x64c9('0x55')]):_0x64c9('0x66'));return respondWithRpcPromise(_0x64c9('0x67'),_0x64c9('0x68'),_0x1825e3);}return null;})['then'](function(_0x1eb962){var _0xdd8855='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1eb962[_0x64c9('0x2a')][_0x64c9('0x69')];return db['sequelize'][_0x64c9('0x43')](_0xdd8855,{'type':db[_0x64c9('0x6a')]['QueryTypes'][_0x64c9('0x6b')],'raw':!![]})[_0x64c9('0x23')](function(_0x353b69){return _0x353b69;});})[_0x64c9('0x23')](function(_0x49e4ae){if(_0x49e4ae){_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x6c')]=_0x49e4ae[0x0];if(!_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')])return;return db[_0x64c9('0x6d')]['find']({'where':{'id':_0x3d483a[_0x64c9('0x55')][_0x64c9('0x5c')],'role':'agent'},'attributes':['id','name',_0x64c9('0x6e'),_0x64c9('0x6f'),_0x64c9('0x70')],'raw':!![]});}return null;})[_0x64c9('0x23')](function(_0x75f07c){if(!_0x75f07c)return null;_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x5e')]=_0x75f07c;return _0x1825e3;})['then'](function(_0x29199d){if(_0x29199d){if(_0x3d483a[_0x64c9('0x55')][_0x64c9('0x71')]){_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x72')]=util[_0x64c9('0x62')](_0x64c9('0x73'),_0x3d483a[_0x64c9('0x5d')]['name']);_0x1825e3[_0x64c9('0x2a')][_0x64c9('0x74')]=_0x1825e3[_0x64c9('0x74')];_0x1825e3[_0x64c9('0x2a')]['motionChannel']=_0x1825e3['channel'];_0x1825e3['message'][_0x64c9('0x75')]=_0x64c9('0x76');return respondWithRpcPromise(_0x64c9('0x77'),'EventManager',{'event':_0x64c9('0x78'),'message':_0x1825e3[_0x64c9('0x2a')]},client9002)[_0x64c9('0x23')](function(){return _0x1825e3;});}return _0x1825e3;}return null;})[_0x64c9('0x23')](respondWithResult(_0x4d7fc4,null))['catch'](handleError(_0x4d7fc4,null));};var interaction_log=require(_0x64c9('0x16'))(_0x64c9('0x79'));exports[_0x64c9('0x35')]=function(_0x2b5a45,_0x11ca37,_0x31e16e){var _0x1944f9={'agent':{},'channel':'fax'};if(_0x2b5a45[_0x64c9('0x55')]['id']){delete _0x2b5a45[_0x64c9('0x55')]['id'];}_0x2b5a45['body']['UserId']=_0x2b5a45['body'][_0x64c9('0x5c')]||_0x2b5a45[_0x64c9('0x5d')]['id'];_0x1944f9['agent']['id']=_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')];return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x2b5a45['params']['id'],'UserId':null}})[_0x64c9('0x23')](handleEntityNotFound(_0x11ca37,null))[_0x64c9('0x23')](function(_0x2885a7){if(_0x2885a7){_0x1944f9[_0x64c9('0x2a')]=_0x2885a7['get']({'plain':!![]});return db[_0x64c9('0x5f')][_0x64c9('0x56')]({'where':{'id':_0x2885a7['FaxInteractionId']}});}return null;})[_0x64c9('0x23')](handleEntityNotFound(_0x11ca37,null))['then'](function(_0x10ae8b){if(_0x10ae8b){_0x1944f9[_0x64c9('0x63')]=_0x10ae8b[_0x64c9('0x64')]({'plain':!![]});interaction_log['info'](_0x64c9('0x7a'),_0x2b5a45[_0x64c9('0x5d')]['id'],_0x2b5a45['user'][_0x64c9('0x39')],_0x2b5a45[_0x64c9('0x5d')][_0x64c9('0x7b')],_0x1944f9['interaction']['id'],_0x2b5a45[_0x64c9('0x55')]?JSON['stringify'](_0x2b5a45['body']):_0x64c9('0x66'));return respondWithRpcPromise(_0x64c9('0x7c'),'rejectMessage',_0x1944f9);}return null;})[_0x64c9('0x23')](function(_0x2a4d63){var _0x17b536=_0x64c9('0x7d')+_0x2a4d63[_0x64c9('0x2a')][_0x64c9('0x69')];return db[_0x64c9('0x7e')][_0x64c9('0x43')](_0x17b536,{'type':db[_0x64c9('0x6a')][_0x64c9('0x7f')][_0x64c9('0x6b')],'raw':!![]})['then'](function(_0x408b4d){return _0x408b4d;});})[_0x64c9('0x23')](function(_0x277f8d){if(_0x277f8d){_0x1944f9[_0x64c9('0x2a')]['contact']=_0x277f8d[0x0];if(!_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')])return;return db[_0x64c9('0x6d')][_0x64c9('0x56')]({'where':{'id':_0x2b5a45[_0x64c9('0x55')][_0x64c9('0x5c')],'role':'agent'},'attributes':['id','name',_0x64c9('0x6e'),_0x64c9('0x6f'),_0x64c9('0x70')],'raw':!![]});}return null;})[_0x64c9('0x23')](function(_0x2e4a15){if(!_0x2e4a15)return null;_0x1944f9['message'][_0x64c9('0x5e')]=_0x2e4a15;return _0x1944f9;})[_0x64c9('0x23')](function(_0x294aab){if(_0x294aab){_0x294aab[_0x64c9('0x2a')][_0x64c9('0x72')]=util[_0x64c9('0x62')](_0x64c9('0x73'),_0x2b5a45[_0x64c9('0x5d')][_0x64c9('0x39')]);_0x294aab[_0x64c9('0x2a')]['channel']=_0x1944f9[_0x64c9('0x74')];_0x294aab['message'][_0x64c9('0x80')]=_0x1944f9[_0x64c9('0x74')];_0x294aab['message'][_0x64c9('0x75')]=_0x64c9('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x64c9('0x81'),'message':_0x294aab[_0x64c9('0x2a')]},client9002);return _0x1944f9;}return null;})[_0x64c9('0x23')](respondWithResult(_0x11ca37,null))['catch'](handleError(_0x11ca37,null));};exports[_0x64c9('0x82')]=function(_0x58180e,_0x445e73){var _0x1e88b8;return db[_0x64c9('0x51')]['create'](_0x58180e[_0x64c9('0x55')],{})[_0x64c9('0x23')](function(_0x206040){_0x1e88b8=_0x206040;return db[_0x64c9('0x83')][_0x64c9('0x84')]({'where':{'id':_0x1e88b8[_0x64c9('0x69')]}});})['then'](function(_0x2eb95d){if(_[_0x64c9('0x85')](_0x2eb95d)){return;}else{_0x1e88b8['fax']=_0x2eb95d['fax'];return db['Attachment'][_0x64c9('0x84')]({'where':{'id':_0x1e88b8[_0x64c9('0x86')]}});}})[_0x64c9('0x23')](function(_0x1fb0a0){return respondWithRpcPromise('SendFax',_0x64c9('0x87'),{'FaxAccountId':_[_0x64c9('0x85')](_0x58180e['body'])?undefined:_0x58180e[_0x64c9('0x55')]['FaxAccountId'],'path':_[_0x64c9('0x85')](_0x1fb0a0)?undefined:util[_0x64c9('0x62')](_0x64c9('0x88'),_0x1fb0a0[_0x64c9('0x89')]),'fax':_[_0x64c9('0x85')](_0x1e88b8[_0x64c9('0x8a')])?undefined:_0x1e88b8[_0x64c9('0x8a')],'AttachmentId':_0x1e88b8[_0x64c9('0x86')]},client9002);})[_0x64c9('0x23')](respondWithResult(_0x445e73,0xc9))['catch'](handleError(_0x445e73,null));};exports[_0x64c9('0x8b')]=function(_0x259275,_0x571220){var _0x3b8170=path[_0x64c9('0x8c')](config[_0x64c9('0x8d')],_0x64c9('0x8e'),_0x64c9('0x8f'),'attachments');return db[_0x64c9('0x51')][_0x64c9('0x56')]({'where':{'id':_0x259275['params']['id']},'include':[{'model':db[_0x64c9('0x90')],'as':_0x64c9('0x90')}]})['then'](handleEntityNotFound(_0x571220,null))[_0x64c9('0x23')](function(_0x46f90f){if(_0x46f90f){return _0x571220['download'](path[_0x64c9('0x8c')](_0x3b8170,_0x46f90f[_0x64c9('0x90')][_0x64c9('0x89')]));}})[_0x64c9('0x53')](handleError(_0x571220,null));}; \ No newline at end of file +var _0x429e=['count','set','apply','reject','save','update','destroy','end','stack','send','index','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','FaxMessage','show','params','include','find','body','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','fax-interactions','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','Sequelize','SELECT','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','files','attachments','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','undefined'];(function(_0x48245e,_0x178e51){var _0x4e5e30=function(_0x428bfd){while(--_0x428bfd){_0x48245e['push'](_0x48245e['shift']());}};_0x4e5e30(++_0x178e51);}(_0x429e,0x179));var _0xe429=function(_0x7e08b0,_0xa659d6){_0x7e08b0=_0x7e08b0-0x0;var _0x4b1661=_0x429e[_0x7e08b0];return _0x4b1661;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe429('0x0'));var rp=require(_0xe429('0x1'));var moment=require(_0xe429('0x2'));var BPromise=require(_0xe429('0x3'));var Mustache=require(_0xe429('0x4'));var util=require(_0xe429('0x5'));var path=require(_0xe429('0x6'));var sox=require(_0xe429('0x7'));var csv=require(_0xe429('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe429('0x9'));var _=require(_0xe429('0xa'));var squel=require(_0xe429('0xb'));var crypto=require(_0xe429('0xc'));var jsforce=require(_0xe429('0xd'));var deskjs=require(_0xe429('0xe'));var toCsv=require(_0xe429('0x8'));var querystring=require(_0xe429('0xf'));var Papa=require(_0xe429('0x10'));var Redis=require(_0xe429('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe429('0x12'));var hardwareService=require(_0xe429('0x13'));var logger=require(_0xe429('0x14'))(_0xe429('0x15'));var utils=require(_0xe429('0x16'));var config=require(_0xe429('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe429('0x18'))['db'];config[_0xe429('0x19')]=_[_0xe429('0x1a')](config[_0xe429('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe429('0x1b'))(new Redis(config[_0xe429('0x19')]));require(_0xe429('0x1c'))[_0xe429('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe429('0x1e')][_0xe429('0x1f')]({'port':0x232c});var client9002=jayson[_0xe429('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x425e9a,_0x3fc43d,_0x50f63f,_0x4e45c2){return new BPromise(function(_0x30e186,_0x2d479c){var _0x263a61=_0x4e45c2||client;return _0x263a61[_0xe429('0x20')](_0x425e9a,_0x50f63f)[_0xe429('0x21')](function(_0x79e231){logger[_0xe429('0x22')](_0xe429('0x23'),_0x3fc43d,_0xe429('0x24'));logger[_0xe429('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3fc43d,_0xe429('0x24'),JSON[_0xe429('0x26')](_0x79e231));if(_0x79e231[_0xe429('0x27')]){if(_0x79e231[_0xe429('0x27')][_0xe429('0x28')]===0x1f4){logger['error'](_0xe429('0x23'),_0x3fc43d,_0x79e231[_0xe429('0x27')][_0xe429('0x29')]);return _0x2d479c(_0x79e231['error']['message']);}logger[_0xe429('0x27')](_0xe429('0x23'),_0x3fc43d,_0x79e231[_0xe429('0x27')][_0xe429('0x29')]);return _0x30e186(_0x79e231[_0xe429('0x27')][_0xe429('0x29')]);}else{logger[_0xe429('0x22')](_0xe429('0x23'),_0x3fc43d,_0xe429('0x24'));_0x30e186(_0x79e231['result'][_0xe429('0x29')]);}})[_0xe429('0x2a')](function(_0x331cec){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3fc43d,_0x331cec);_0x2d479c(_0x331cec);});});}function respondWithStatusCode(_0x9be66,_0x2111d6){_0x2111d6=_0x2111d6||0xcc;return function(_0x459337){if(_0x459337){return _0x9be66[_0xe429('0x2b')](_0x2111d6);}return _0x9be66[_0xe429('0x2c')](_0x2111d6)['end']();};}function respondWithResult(_0x3cb8ea,_0x4e2b05){_0x4e2b05=_0x4e2b05||0xc8;return function(_0x15b120){if(_0x15b120){return _0x3cb8ea['status'](_0x4e2b05)[_0xe429('0x2d')](_0x15b120);}};}function respondWithFilteredResult(_0x4dcb7f,_0x16c168){return function(_0x4d1b6f){if(_0x4d1b6f){var _0x26c719=typeof _0x16c168[_0xe429('0x2e')]==='undefined'&&typeof _0x16c168[_0xe429('0x2f')]===_0xe429('0x30');var _0xbd9c57=_0x4d1b6f[_0xe429('0x31')];var _0x331c39=_0x26c719?0x0:_0x16c168[_0xe429('0x2e')];var _0x294c52=_0x26c719?_0x4d1b6f[_0xe429('0x31')]:_0x16c168['offset']+_0x16c168['limit'];var _0x1118c8;if(_0x294c52>=_0xbd9c57){_0x294c52=_0xbd9c57;_0x1118c8=0xc8;}else{_0x1118c8=0xce;}_0x4dcb7f[_0xe429('0x2c')](_0x1118c8);return _0x4dcb7f[_0xe429('0x32')]('Content-Range',_0x331c39+'-'+_0x294c52+'/'+_0xbd9c57)[_0xe429('0x2d')](_0x4d1b6f);}return null;};}function patchUpdates(_0x3b05fe){return function(_0x450cab){try{jsonpatch[_0xe429('0x33')](_0x450cab,_0x3b05fe,!![]);}catch(_0x1c6c25){return BPromise[_0xe429('0x34')](_0x1c6c25);}return _0x450cab[_0xe429('0x35')]();};}function saveUpdates(_0x735f99,_0x4c5d76){return function(_0x2d73c1){if(_0x2d73c1){return _0x2d73c1[_0xe429('0x36')](_0x735f99)[_0xe429('0x21')](function(_0x20dc4d){return _0x20dc4d;});}return null;};}function removeEntity(_0x5805ce,_0x14acc7){return function(_0x302102){if(_0x302102){return _0x302102[_0xe429('0x37')]()[_0xe429('0x21')](function(){_0x5805ce['status'](0xcc)[_0xe429('0x38')]();});}};}function handleEntityNotFound(_0x567926,_0x2168c8){return function(_0x542cbf){if(!_0x542cbf){_0x567926[_0xe429('0x2b')](0x194);}return _0x542cbf;};}function handleError(_0x3e8e21,_0x30b7dc){_0x30b7dc=_0x30b7dc||0x1f4;return function(_0x3570e4){logger[_0xe429('0x27')](_0x3570e4[_0xe429('0x39')]);if(_0x3570e4['name']){delete _0x3570e4['name'];}_0x3e8e21[_0xe429('0x2c')](_0x30b7dc)[_0xe429('0x3a')](_0x3570e4);};}exports[_0xe429('0x3b')]=function(_0x3e08b7,_0x5b75ba){var _0x218051={},_0x312bf4={},_0x2ea9c5={'count':0x0,'rows':[]};var _0x1a63be=_['map'](db['FaxMessage'][_0xe429('0x3c')],function(_0x567dfc){return{'name':_0x567dfc[_0xe429('0x3d')],'type':_0x567dfc['type'][_0xe429('0x3e')]};});_0x312bf4[_0xe429('0x3f')]=_[_0xe429('0x40')](_0x1a63be,_0xe429('0x41'));_0x312bf4[_0xe429('0x42')]=_[_0xe429('0x43')](_0x3e08b7['query']);_0x312bf4[_0xe429('0x44')]=_[_0xe429('0x45')](_0x312bf4[_0xe429('0x3f')],_0x312bf4[_0xe429('0x42')]);_0x218051[_0xe429('0x46')]=_[_0xe429('0x45')](_0x312bf4['model'],qs[_0xe429('0x47')](_0x3e08b7['query'][_0xe429('0x47')]));_0x218051[_0xe429('0x46')]=_0x218051[_0xe429('0x46')][_0xe429('0x48')]?_0x218051[_0xe429('0x46')]:_0x312bf4[_0xe429('0x3f')];if(!_0x3e08b7[_0xe429('0x42')][_0xe429('0x49')](_0xe429('0x4a'))){_0x218051['limit']=qs[_0xe429('0x2f')](_0x3e08b7[_0xe429('0x42')]['limit']);_0x218051[_0xe429('0x2e')]=qs[_0xe429('0x2e')](_0x3e08b7[_0xe429('0x42')][_0xe429('0x2e')]);}_0x218051[_0xe429('0x4b')]=qs['sort'](_0x3e08b7[_0xe429('0x42')][_0xe429('0x4c')]);_0x218051[_0xe429('0x4d')]=qs[_0xe429('0x44')](_[_0xe429('0x4e')](_0x3e08b7[_0xe429('0x42')],_0x312bf4[_0xe429('0x44')]),_0x1a63be);if(_0x3e08b7[_0xe429('0x42')][_0xe429('0x4f')]){_0x218051[_0xe429('0x4d')]=_[_0xe429('0x50')](_0x218051['where'],{'$or':_[_0xe429('0x40')](_0x1a63be,function(_0x380b9f){if(_0x380b9f[_0xe429('0x51')]!==_0xe429('0x52')){var _0x540fa1={};_0x540fa1[_0x380b9f['name']]={'$like':'%'+_0x3e08b7[_0xe429('0x42')]['filter']+'%'};return _0x540fa1;}})});}_0x218051=_[_0xe429('0x50')]({},_0x218051,_0x3e08b7[_0xe429('0x53')]);var _0x52755d={'where':_0x218051[_0xe429('0x4d')]};return db['FaxMessage'][_0xe429('0x31')](_0x52755d)[_0xe429('0x21')](function(_0x575305){_0x2ea9c5[_0xe429('0x31')]=_0x575305;if(_0x3e08b7['query'][_0xe429('0x54')]){_0x218051['include']=[{'all':!![]}];}return db[_0xe429('0x55')]['findAll'](_0x218051);})[_0xe429('0x21')](function(_0x459c68){_0x2ea9c5['rows']=_0x459c68;return _0x2ea9c5;})[_0xe429('0x21')](respondWithFilteredResult(_0x5b75ba,_0x218051))[_0xe429('0x2a')](handleError(_0x5b75ba,null));};exports[_0xe429('0x56')]=function(_0x5c62a9,_0x48d178){var _0xe51ae1={'raw':!![],'where':{'id':_0x5c62a9[_0xe429('0x57')]['id']}},_0x199049={};_0x199049['model']=_[_0xe429('0x43')](db[_0xe429('0x55')][_0xe429('0x3c')]);_0x199049[_0xe429('0x42')]=_['keys'](_0x5c62a9[_0xe429('0x42')]);_0x199049['filters']=_[_0xe429('0x45')](_0x199049['model'],_0x199049[_0xe429('0x42')]);_0xe51ae1[_0xe429('0x46')]=_[_0xe429('0x45')](_0x199049[_0xe429('0x3f')],qs[_0xe429('0x47')](_0x5c62a9[_0xe429('0x42')][_0xe429('0x47')]));_0xe51ae1[_0xe429('0x46')]=_0xe51ae1[_0xe429('0x46')][_0xe429('0x48')]?_0xe51ae1[_0xe429('0x46')]:_0x199049[_0xe429('0x3f')];if(_0x5c62a9[_0xe429('0x42')][_0xe429('0x54')]){_0xe51ae1[_0xe429('0x58')]=[{'all':!![]}];}_0xe51ae1=_[_0xe429('0x50')]({},_0xe51ae1,_0x5c62a9[_0xe429('0x53')]);return db[_0xe429('0x55')][_0xe429('0x59')](_0xe51ae1)['then'](handleEntityNotFound(_0x48d178,null))[_0xe429('0x21')](respondWithResult(_0x48d178,null))['catch'](handleError(_0x48d178,null));};exports[_0xe429('0x36')]=function(_0x461f4c,_0x485082){if(_0x461f4c[_0xe429('0x5a')]['id']){delete _0x461f4c['body']['id'];}return db[_0xe429('0x55')][_0xe429('0x59')]({'where':{'id':_0x461f4c[_0xe429('0x57')]['id']}})['then'](handleEntityNotFound(_0x485082,null))['then'](saveUpdates(_0x461f4c[_0xe429('0x5a')],null))[_0xe429('0x21')](respondWithResult(_0x485082,null))[_0xe429('0x2a')](handleError(_0x485082,null));};exports[_0xe429('0x37')]=function(_0x15e3e8,_0x1db88e){return db['FaxMessage'][_0xe429('0x59')]({'where':{'id':_0x15e3e8[_0xe429('0x57')]['id']}})[_0xe429('0x21')](handleEntityNotFound(_0x1db88e,null))[_0xe429('0x21')](removeEntity(_0x1db88e,null))[_0xe429('0x2a')](handleError(_0x1db88e,null));};exports[_0xe429('0x5b')]=function(_0x114972,_0x2be970){return db['FaxMessage'][_0xe429('0x5b')]()[_0xe429('0x21')](respondWithResult(_0x2be970,null))[_0xe429('0x2a')](handleError(_0x2be970,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe429('0x5c')]=function(_0x3c577a,_0x48176d,_0x4231a3){var _0x2d3d76={'agent':{},'channel':_0xe429('0x5d')};if(_0x3c577a[_0xe429('0x5a')]['id']){delete _0x3c577a[_0xe429('0x5a')]['id'];}_0x3c577a[_0xe429('0x5a')][_0xe429('0x5e')]=!![];_0x3c577a[_0xe429('0x5a')]['readAt']=moment()[_0xe429('0x5f')](_0xe429('0x60'));_0x3c577a[_0xe429('0x5a')][_0xe429('0x61')]=_0x3c577a[_0xe429('0x5a')][_0xe429('0x61')]||_0x3c577a['user']['id'];_0x2d3d76['agent']['id']=_0x3c577a[_0xe429('0x5a')]['UserId'];return db[_0xe429('0x55')][_0xe429('0x59')]({'where':{'id':_0x3c577a[_0xe429('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48176d,null))['then'](saveUpdates(_0x3c577a[_0xe429('0x5a')],null))[_0xe429('0x21')](function(_0x3c959a){if(_0x3c959a){_0x2d3d76['message']=_0x3c959a[_0xe429('0x62')]({'plain':!![]});return db[_0xe429('0x63')][_0xe429('0x59')]({'where':{'id':_0x3c959a['FaxInteractionId']}});}return null;})[_0xe429('0x21')](handleEntityNotFound(_0x48176d,null))[_0xe429('0x21')](function(_0x13e1d3){if(_0x13e1d3){return _0x13e1d3['update']({'UserId':_0x3c577a[_0xe429('0x5a')][_0xe429('0x61')],'read1stAt':_[_0xe429('0x64')](_0x13e1d3['read1stAt'])?moment()[_0xe429('0x5f')](_0xe429('0x60')):undefined});}return null;})['then'](function(_0x37cc9a){if(_0x37cc9a){_0x2d3d76[_0xe429('0x65')]=_0x37cc9a[_0xe429('0x62')]({'plain':!![]});interaction_log[_0xe429('0x22')](_0xe429('0x66'),_0x3c577a[_0xe429('0x67')]['id'],_0x3c577a[_0xe429('0x67')]['name'],_0x3c577a[_0xe429('0x67')]['role'],_0x2d3d76[_0xe429('0x65')]['id'],_0x3c577a['body']?JSON[_0xe429('0x26')](_0x3c577a[_0xe429('0x5a')]):'null');return respondWithRpcPromise(_0xe429('0x68'),_0xe429('0x69'),_0x2d3d76);}return null;})[_0xe429('0x21')](function(_0x51adb4){var _0x33b641=_0xe429('0x6a')+_0x51adb4['message'][_0xe429('0x6b')];return db['sequelize'][_0xe429('0x42')](_0x33b641,{'type':db['Sequelize'][_0xe429('0x6c')]['SELECT'],'raw':!![]})[_0xe429('0x21')](function(_0x286cd6){return _0x286cd6;});})[_0xe429('0x21')](function(_0x5deba5){if(_0x5deba5){_0x2d3d76[_0xe429('0x29')][_0xe429('0x6d')]=_0x5deba5[0x0];if(!_0x3c577a[_0xe429('0x5a')][_0xe429('0x61')])return;return db[_0xe429('0x6e')][_0xe429('0x59')]({'where':{'id':_0x3c577a[_0xe429('0x5a')][_0xe429('0x61')],'role':_0xe429('0x6f')},'attributes':['id',_0xe429('0x41'),_0xe429('0x70'),_0xe429('0x71'),_0xe429('0x72')],'raw':!![]});}return null;})[_0xe429('0x21')](function(_0x2c8a4a){if(!_0x2c8a4a)return null;_0x2d3d76[_0xe429('0x29')][_0xe429('0x6f')]=_0x2c8a4a;return _0x2d3d76;})[_0xe429('0x21')](function(_0x34838d){if(_0x34838d){if(_0x3c577a[_0xe429('0x5a')][_0xe429('0x73')]){_0x2d3d76[_0xe429('0x29')][_0xe429('0x74')]=util[_0xe429('0x5f')]('SIP/%s',_0x3c577a[_0xe429('0x67')][_0xe429('0x41')]);_0x2d3d76[_0xe429('0x29')][_0xe429('0x75')]=_0x2d3d76[_0xe429('0x75')];_0x2d3d76[_0xe429('0x29')][_0xe429('0x76')]=_0x2d3d76[_0xe429('0x75')];_0x2d3d76['message'][_0xe429('0x77')]=_0xe429('0x5c');return respondWithRpcPromise(_0xe429('0x78'),_0xe429('0x78'),{'event':'acceptmessage','message':_0x2d3d76[_0xe429('0x29')]},client9002)[_0xe429('0x21')](function(){return _0x2d3d76;});}return _0x2d3d76;}return null;})[_0xe429('0x21')](respondWithResult(_0x48176d,null))['catch'](handleError(_0x48176d,null));};var interaction_log=require('../../config/logger')(_0xe429('0x79'));exports[_0xe429('0x34')]=function(_0x551291,_0x3b53b5,_0x24bd53){var _0x330624={'agent':{},'channel':_0xe429('0x5d')};if(_0x551291[_0xe429('0x5a')]['id']){delete _0x551291[_0xe429('0x5a')]['id'];}_0x551291[_0xe429('0x5a')][_0xe429('0x61')]=_0x551291[_0xe429('0x5a')][_0xe429('0x61')]||_0x551291['user']['id'];_0x330624[_0xe429('0x6f')]['id']=_0x551291[_0xe429('0x5a')][_0xe429('0x61')];return db[_0xe429('0x55')]['find']({'where':{'id':_0x551291[_0xe429('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b53b5,null))['then'](function(_0x2c828f){if(_0x2c828f){_0x330624[_0xe429('0x29')]=_0x2c828f['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x2c828f[_0xe429('0x7a')]}});}return null;})[_0xe429('0x21')](handleEntityNotFound(_0x3b53b5,null))['then'](function(_0x3ab630){if(_0x3ab630){_0x330624[_0xe429('0x65')]=_0x3ab630[_0xe429('0x62')]({'plain':!![]});interaction_log[_0xe429('0x22')](_0xe429('0x7b'),_0x551291[_0xe429('0x67')]['id'],_0x551291[_0xe429('0x67')][_0xe429('0x41')],_0x551291['user']['role'],_0x330624[_0xe429('0x65')]['id'],_0x551291[_0xe429('0x5a')]?JSON[_0xe429('0x26')](_0x551291[_0xe429('0x5a')]):_0xe429('0x7c'));return respondWithRpcPromise(_0xe429('0x7d'),'rejectMessage',_0x330624);}return null;})[_0xe429('0x21')](function(_0x48c9e9){var _0x317f4a=_0xe429('0x6a')+_0x48c9e9[_0xe429('0x29')][_0xe429('0x6b')];return db['sequelize'][_0xe429('0x42')](_0x317f4a,{'type':db[_0xe429('0x7e')][_0xe429('0x6c')][_0xe429('0x7f')],'raw':!![]})['then'](function(_0x327ada){return _0x327ada;});})[_0xe429('0x21')](function(_0x269e27){if(_0x269e27){_0x330624[_0xe429('0x29')][_0xe429('0x6d')]=_0x269e27[0x0];if(!_0x551291[_0xe429('0x5a')]['UserId'])return;return db['User'][_0xe429('0x59')]({'where':{'id':_0x551291['body'][_0xe429('0x61')],'role':_0xe429('0x6f')},'attributes':['id',_0xe429('0x41'),'fullname',_0xe429('0x71'),_0xe429('0x72')],'raw':!![]});}return null;})[_0xe429('0x21')](function(_0x13ff79){if(!_0x13ff79)return null;_0x330624['message'][_0xe429('0x6f')]=_0x13ff79;return _0x330624;})[_0xe429('0x21')](function(_0x550373){if(_0x550373){_0x550373[_0xe429('0x29')][_0xe429('0x74')]=util[_0xe429('0x5f')]('SIP/%s',_0x551291[_0xe429('0x67')][_0xe429('0x41')]);_0x550373[_0xe429('0x29')]['channel']=_0x330624[_0xe429('0x75')];_0x550373[_0xe429('0x29')][_0xe429('0x76')]=_0x330624[_0xe429('0x75')];_0x550373[_0xe429('0x29')][_0xe429('0x77')]=_0xe429('0x34');respondWithRpcPromise('EventManager',_0xe429('0x78'),{'event':_0xe429('0x80'),'message':_0x550373[_0xe429('0x29')]},client9002);return _0x330624;}return null;})[_0xe429('0x21')](respondWithResult(_0x3b53b5,null))[_0xe429('0x2a')](handleError(_0x3b53b5,null));};exports[_0xe429('0x81')]=function(_0x5883b2,_0x15597d){var _0x12f134;return db[_0xe429('0x55')][_0xe429('0x81')](_0x5883b2[_0xe429('0x5a')],{})[_0xe429('0x21')](function(_0x29559f){_0x12f134=_0x29559f;return db[_0xe429('0x82')]['findOne']({'where':{'id':_0x12f134[_0xe429('0x6b')]}});})[_0xe429('0x21')](function(_0x27dd13){if(_['isNil'](_0x27dd13)){return;}else{_0x12f134[_0xe429('0x5d')]=_0x27dd13[_0xe429('0x5d')];return db[_0xe429('0x83')][_0xe429('0x84')]({'where':{'id':_0x12f134[_0xe429('0x85')]}});}})['then'](function(_0x2c4c4b){return respondWithRpcPromise(_0xe429('0x86'),_0xe429('0x86'),{'FaxAccountId':_[_0xe429('0x64')](_0x5883b2[_0xe429('0x5a')])?undefined:_0x5883b2[_0xe429('0x5a')][_0xe429('0x87')],'path':_[_0xe429('0x64')](_0x2c4c4b)?undefined:util[_0xe429('0x5f')]('/var/opt/motion2/server/files/attachments/%s',_0x2c4c4b[_0xe429('0x88')]),'fax':_[_0xe429('0x64')](_0x12f134['fax'])?undefined:_0x12f134['fax'],'AttachmentId':_0x12f134[_0xe429('0x85')]},client9002);})[_0xe429('0x21')](respondWithResult(_0x15597d,0xc9))[_0xe429('0x2a')](handleError(_0x15597d,null));};exports[_0xe429('0x89')]=function(_0x53e274,_0x3e0fce){var _0x22ce8c=path[_0xe429('0x8a')](config['root'],_0xe429('0x8b'),_0xe429('0x8c'),_0xe429('0x8d'));return db[_0xe429('0x55')][_0xe429('0x59')]({'where':{'id':_0x53e274[_0xe429('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x3e0fce,null))[_0xe429('0x21')](function(_0x203642){if(_0x203642){return _0x3e0fce[_0xe429('0x89')](path[_0xe429('0x8a')](_0x22ce8c,_0x203642[_0xe429('0x83')][_0xe429('0x88')]));}})[_0xe429('0x2a')](handleError(_0x3e0fce,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7813a35..b66f925 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 _0x960c=['emit','hasOwnProperty','hook','events','FaxMessage','save','update','remove'];(function(_0x59ce18,_0x2b6286){var _0x4c2c9c=function(_0x5b3386){while(--_0x5b3386){_0x59ce18['push'](_0x59ce18['shift']());}};_0x4c2c9c(++_0x2b6286);}(_0x960c,0x113));var _0xc960=function(_0x394662,_0x42e8e3){_0x394662=_0x394662-0x0;var _0x11683d=_0x960c[_0x394662];return _0x11683d;};'use strict';var EventEmitter=require(_0xc960('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xc960('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc960('0x2'),'afterUpdate':_0xc960('0x3'),'afterDestroy':_0xc960('0x4')};function emitEvent(_0x5c6ea5){return function(_0x1b54d7,_0x3ff69d,_0x485db9){FaxMessageEvents['emit'](_0x5c6ea5+':'+_0x1b54d7['id'],_0x1b54d7);FaxMessageEvents[_0xc960('0x5')](_0x5c6ea5,_0x1b54d7);_0x485db9(null);};}for(var e in events){if(events[_0xc960('0x6')](e)){var event=events[e];FaxMessage[_0xc960('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x68b3=['hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x54b45c,_0xbfb39b){var _0x101941=function(_0x54eea5){while(--_0x54eea5){_0x54b45c['push'](_0x54b45c['shift']());}};_0x101941(++_0xbfb39b);}(_0x68b3,0x1d8));var _0x368b=function(_0x4a225c,_0x4dea28){_0x4a225c=_0x4a225c-0x0;var _0xe9270e=_0x68b3[_0x4a225c];return _0xe9270e;};'use strict';var EventEmitter=require(_0x368b('0x0'));var FaxMessage=require(_0x368b('0x1'))['db'][_0x368b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x368b('0x3')](0x0);var events={'afterCreate':_0x368b('0x4'),'afterUpdate':'update','afterDestroy':_0x368b('0x5')};function emitEvent(_0x3325ac){return function(_0xc40116,_0x404282,_0x5d68cb){FaxMessageEvents[_0x368b('0x6')](_0x3325ac+':'+_0xc40116['id'],_0xc40116);FaxMessageEvents[_0x368b('0x6')](_0x3325ac,_0xc40116);_0x5d68cb(null);};}for(var e in events){if(events[_0x368b('0x7')](e)){var event=events[e];FaxMessage[_0x368b('0x8')](e,emitEvent(event));}}module[_0x368b('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 150c218..4f2305c 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 _0x3b9b=['exports','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','direction','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf','./faxMessage.attributes'];(function(_0x166e33,_0x127e77){var _0x1a2409=function(_0x48edd3){while(--_0x48edd3){_0x166e33['push'](_0x166e33['shift']());}};_0x1a2409(++_0x127e77);}(_0x3b9b,0x18a));var _0xb3b9=function(_0x73b74c,_0x11dcb0){_0x73b74c=_0x73b74c-0x0;var _0x5488d0=_0x3b9b[_0x73b74c];return _0x5488d0;};'use strict';var _=require(_0xb3b9('0x0'));var util=require('util');var logger=require(_0xb3b9('0x1'))(_0xb3b9('0x2'));var moment=require('moment');var BPromise=require(_0xb3b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb3b9('0x4'));var config=require('../../config/environment');var attributes=require(_0xb3b9('0x5'));module[_0xb3b9('0x6')]=function(_0x5ad26e,_0x3c2e26){return _0x5ad26e['define'](_0xb3b9('0x7'),attributes,{'tableName':_0xb3b9('0x8'),'paranoid':![],'indexes':[{'name':_0xb3b9('0x9'),'fields':['body'],'type':_0xb3b9('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6028ee,_0x339a98,_0x374d93){var _0x2baeb9=_0x5ad26e[_0xb3b9('0xb')];var _0x50c86a=_0x6028ee[_0xb3b9('0xc')]({'plain':!![]});if(_0x50c86a['direction'][_0xb3b9('0xd')]()==='in'||_0x50c86a['direction'][_0xb3b9('0xd')]()===_0xb3b9('0xe')&&!_0x50c86a[_0xb3b9('0xf')]&&!_['isNil'](_0x50c86a[_0xb3b9('0x10')])){_0x2baeb9[_0xb3b9('0x11')][_0xb3b9('0x12')]({'where':{'id':_0x50c86a[_0xb3b9('0x13')]}})['then'](function(_0x127142){if(_0x127142){_0x127142[_0xb3b9('0x14')]({'lastMsgAt':_0x50c86a['createdAt'],'lastMsgDirection':_0x50c86a[_0xb3b9('0x15')][_0xb3b9('0xd')]()});}})[_0xb3b9('0x16')](function(_0x3963b7){console['error'](_0x3963b7);});}_0x374d93();}},'charset':_0xb3b9('0x17'),'collate':_0xb3b9('0x18')});}; \ No newline at end of file +var _0x7335=['error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','body','FULLTEXT','direction','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch'];(function(_0x535bf6,_0x485d9d){var _0x2b7a9d=function(_0x6c983b){while(--_0x6c983b){_0x535bf6['push'](_0x535bf6['shift']());}};_0x2b7a9d(++_0x485d9d);}(_0x7335,0x1b3));var _0x5733=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7335[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5733('0x0'))(_0x5733('0x1'));var moment=require('moment');var BPromise=require(_0x5733('0x2'));var rp=require(_0x5733('0x3'));var fs=require('fs');var path=require(_0x5733('0x4'));var rimraf=require(_0x5733('0x5'));var config=require(_0x5733('0x6'));var attributes=require(_0x5733('0x7'));module[_0x5733('0x8')]=function(_0x37697f,_0x1410c1){return _0x37697f[_0x5733('0x9')]('FaxMessage',attributes,{'tableName':_0x5733('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x5733('0xb')],'type':_0x5733('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x412782,_0xc9e6d5,_0x18f04f){var _0x2f0aa4=_0x37697f['models'];var _0xc48986=_0x412782['get']({'plain':!![]});if(_0xc48986[_0x5733('0xd')]['toLowerCase']()==='in'||_0xc48986[_0x5733('0xd')]['toLowerCase']()==='out'&&!_0xc48986[_0x5733('0xe')]&&!_[_0x5733('0xf')](_0xc48986[_0x5733('0x10')])){_0x2f0aa4[_0x5733('0x11')][_0x5733('0x12')]({'where':{'id':_0xc48986[_0x5733('0x13')]}})[_0x5733('0x14')](function(_0x3fc13c){if(_0x3fc13c){_0x3fc13c[_0x5733('0x15')]({'lastMsgAt':_0xc48986[_0x5733('0x16')],'lastMsgDirection':_0xc48986[_0x5733('0xd')]['toLowerCase']()});}})[_0x5733('0x17')](function(_0x61c971){console[_0x5733('0x18')](_0x61c971);});}_0x18f04f();}},'charset':_0x5733('0x19'),'collate':_0x5733('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b8323f2..c97ec4a 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 _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x17f9f7,_0x25bbd7){_0x17f9f7=_0x17f9f7-0x0;var _0x3f3b86=_0x5fd1[_0x17f9f7];return _0x3f3b86;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0xeec6,0x1c2));var _0x6eec=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xeec6[_0x397e5f];return _0x5302b8;};'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});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8b2d0d6..8dd27de 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 _0xd54c=['removeListener','register','length','faxMessage:','./faxMessage.events','save','emit'];(function(_0x31bdbc,_0x2c5332){var _0x44cb63=function(_0x44e188){while(--_0x44e188){_0x31bdbc['push'](_0x31bdbc['shift']());}};_0x44cb63(++_0x2c5332);}(_0xd54c,0x89));var _0xcd54=function(_0x4ed4e7,_0x30a2a7){_0x4ed4e7=_0x4ed4e7-0x0;var _0x2a8e13=_0xd54c[_0x4ed4e7];return _0x2a8e13;};'use strict';var FaxMessageEvents=require(_0xcd54('0x0'));var events=[_0xcd54('0x1'),'remove','update'];function createListener(_0x48fa31,_0x5ac443){return function(_0x4da0ef){_0x5ac443[_0xcd54('0x2')](_0x48fa31,_0x4da0ef);};}function removeListener(_0x262beb,_0x2d3450){return function(){FaxMessageEvents[_0xcd54('0x3')](_0x262beb,_0x2d3450);};}exports[_0xcd54('0x4')]=function(_0x5b09e6){for(var _0x11942a=0x0,_0x30cd46=events[_0xcd54('0x5')];_0x11942a<_0x30cd46;_0x11942a++){var _0x53b1ac=events[_0x11942a];var _0x459643=createListener(_0xcd54('0x6')+_0x53b1ac,_0x5b09e6);FaxMessageEvents['on'](_0x53b1ac,_0x459643);}}; \ No newline at end of file +var _0x8ec4=['faxMessage:','./faxMessage.events','remove','update','emit','removeListener','register'];(function(_0x4ffc34,_0x5db65f){var _0x46b4df=function(_0x39f86b){while(--_0x39f86b){_0x4ffc34['push'](_0x4ffc34['shift']());}};_0x46b4df(++_0x5db65f);}(_0x8ec4,0xa2));var _0x48ec=function(_0x14dab5,_0x30766d){_0x14dab5=_0x14dab5-0x0;var _0x40c9bc=_0x8ec4[_0x14dab5];return _0x40c9bc;};'use strict';var FaxMessageEvents=require(_0x48ec('0x0'));var events=['save',_0x48ec('0x1'),_0x48ec('0x2')];function createListener(_0x2003c9,_0x2c6204){return function(_0x271c5c){_0x2c6204[_0x48ec('0x3')](_0x2003c9,_0x271c5c);};}function removeListener(_0x17ecbc,_0x1860a1){return function(){FaxMessageEvents[_0x48ec('0x4')](_0x17ecbc,_0x1860a1);};}exports[_0x48ec('0x5')]=function(_0x909d4b){for(var _0x4c7e7d=0x0,_0x1c5185=events['length'];_0x4c7e7d<_0x1c5185;_0x4c7e7d++){var _0x55a4b2=events[_0x4c7e7d];var _0xc1ee24=createListener(_0x48ec('0x6')+_0x55a4b2,_0x909d4b);FaxMessageEvents['on'](_0x55a4b2,_0xc1ee24);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 85fe3e8..613a239 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 _0x04b8=['/:id','update','put','/:id/accept','/:id/reject','reject','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','isAuthenticated','show','/:id/download','post','tracked','fax','faxmessage:create','create'];(function(_0x1d203d,_0x1a5b2b){var _0x2e5a5b=function(_0x46b403){while(--_0x46b403){_0x1d203d['push'](_0x1d203d['shift']());}};_0x2e5a5b(++_0x1a5b2b);}(_0x04b8,0x159));var _0x804b=function(_0x3e23e8,_0x57b812){_0x3e23e8=_0x3e23e8-0x0;var _0x16ab10=_0x04b8[_0x3e23e8];return _0x16ab10;};'use strict';var multer=require('multer');var util=require(_0x804b('0x0'));var path=require('path');var timeout=require(_0x804b('0x1'));var express=require(_0x804b('0x2'));var router=express['Router']();var fs_extra=require(_0x804b('0x3'));var auth=require(_0x804b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x804b('0x5'));var controller=require(_0x804b('0x6'));router[_0x804b('0x7')]('/',auth['isAuthenticated'](),controller[_0x804b('0x8')]);router[_0x804b('0x7')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0xa')]);router[_0x804b('0x7')]('/:id',auth[_0x804b('0xb')](),controller[_0x804b('0xc')]);router[_0x804b('0x7')](_0x804b('0xd'),auth[_0x804b('0xb')](),controller['download']);router[_0x804b('0xe')]('/',auth[_0x804b('0xb')](),interaction[_0x804b('0xf')](_0x804b('0x10'),_0x804b('0x11')),controller[_0x804b('0x12')]);router['put'](_0x804b('0x13'),auth['isAuthenticated'](),controller[_0x804b('0x14')]);router[_0x804b('0x15')](_0x804b('0x16'),auth[_0x804b('0xb')](),controller['accept']);router[_0x804b('0x15')](_0x804b('0x17'),auth[_0x804b('0xb')](),controller[_0x804b('0x18')]);router['delete'](_0x804b('0x13'),auth[_0x804b('0xb')](),controller['destroy']);module[_0x804b('0x19')]=router; \ No newline at end of file +var _0xc788=['describe','/:id','show','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc788,0xc4));var _0x8c78=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xc788[_0x2d2e85];return _0x3e9f5e;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./faxMessage.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/download',auth[_0x8c78('0x9')](),controller['download']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),interaction['tracked'](_0x8c78('0x10'),_0x8c78('0x11')),controller['create']);router[_0x8c78('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8c78('0x13')]);router[_0x8c78('0x12')](_0x8c78('0x14'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x15')]);router[_0x8c78('0x12')](_0x8c78('0x16'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x17')]);router[_0x8c78('0x18')]('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x19')]);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 f29f168..3e4cc8f 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 _0x0a2e=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1d7c83,_0x2d8f2d){var _0x283ef2=function(_0x68da53){while(--_0x68da53){_0x1d7c83['push'](_0x1d7c83['shift']());}};_0x283ef2(++_0x2d8f2d);}(_0x0a2e,0xe1));var _0xe0a2=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x0a2e[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require(_0xe0a2('0x0'));module[_0xe0a2('0x1')]={'name':{'type':Sequelize[_0xe0a2('0x2')],'unique':_0xe0a2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe0a2('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe0a2('0x5')](_0xe0a2('0x6'),_0xe0a2('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3301=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x3301,0x69));var _0x1330=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0x3301[_0x5067db];return _0x2771e4;};'use strict';var Sequelize=require(_0x1330('0x0'));module[_0x1330('0x1')]={'name':{'type':Sequelize[_0x1330('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1330('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1330('0x3')](_0x1330('0x4'),'beepall',_0x1330('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 ff59124..eb1837a 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 _0x66c7=['create','body','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','length','FaxQueueId','UserFaxQueue','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','pick','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','stack','name','send','index','FaxQueue','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find'];(function(_0x15ba65,_0x530bcb){var _0x54e383=function(_0x538bf4){while(--_0x538bf4){_0x15ba65['push'](_0x15ba65['shift']());}};_0x54e383(++_0x530bcb);}(_0x66c7,0x15e));var _0x766c=function(_0x389a6a,_0x26cb60){_0x389a6a=_0x389a6a-0x0;var _0x4ba642=_0x66c7[_0x389a6a];return _0x4ba642;};'use strict';var emlformat=require(_0x766c('0x0'));var rimraf=require(_0x766c('0x1'));var zipdir=require(_0x766c('0x2'));var jsonpatch=require(_0x766c('0x3'));var rp=require(_0x766c('0x4'));var moment=require(_0x766c('0x5'));var BPromise=require(_0x766c('0x6'));var Mustache=require(_0x766c('0x7'));var util=require(_0x766c('0x8'));var path=require(_0x766c('0x9'));var sox=require(_0x766c('0xa'));var csv=require(_0x766c('0xb'));var ejs=require(_0x766c('0xc'));var fs=require('fs');var fs_extra=require(_0x766c('0xd'));var _=require(_0x766c('0xe'));var squel=require(_0x766c('0xf'));var crypto=require(_0x766c('0x10'));var jsforce=require(_0x766c('0x11'));var deskjs=require(_0x766c('0x12'));var toCsv=require(_0x766c('0xb'));var querystring=require(_0x766c('0x13'));var Papa=require(_0x766c('0x14'));var Redis=require(_0x766c('0x15'));var authService=require(_0x766c('0x16'));var qs=require(_0x766c('0x17'));var as=require(_0x766c('0x18'));var hardwareService=require(_0x766c('0x19'));var logger=require('../../config/logger')('api');var utils=require(_0x766c('0x1a'));var config=require(_0x766c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x766c('0x1c'))['db'];config[_0x766c('0x1d')]=_[_0x766c('0x1e')](config['redis'],{'host':_0x766c('0x1f'),'port':0x18eb});var socket=require(_0x766c('0x20'))(new Redis(config[_0x766c('0x1d')]));require(_0x766c('0x21'))['register'](socket);function respondWithStatusCode(_0x40e16f,_0x43b071){_0x43b071=_0x43b071||0xcc;return function(_0x54950e){if(_0x54950e){return _0x40e16f[_0x766c('0x22')](_0x43b071);}return _0x40e16f[_0x766c('0x23')](_0x43b071)[_0x766c('0x24')]();};}function respondWithResult(_0xdba366,_0x344aa4){_0x344aa4=_0x344aa4||0xc8;return function(_0x49a57b){if(_0x49a57b){return _0xdba366[_0x766c('0x23')](_0x344aa4)[_0x766c('0x25')](_0x49a57b);}};}function respondWithFilteredResult(_0x434c0e,_0x296b19){return function(_0x3da47e){if(_0x3da47e){var _0x5b3a9c=typeof _0x296b19[_0x766c('0x26')]===_0x766c('0x27')&&typeof _0x296b19['limit']===_0x766c('0x27');var _0x2271d2=_0x3da47e[_0x766c('0x28')];var _0xb464bb=_0x5b3a9c?0x0:_0x296b19[_0x766c('0x26')];var _0xafcb7a=_0x5b3a9c?_0x3da47e[_0x766c('0x28')]:_0x296b19[_0x766c('0x26')]+_0x296b19[_0x766c('0x29')];var _0x48d24c;if(_0xafcb7a>=_0x2271d2){_0xafcb7a=_0x2271d2;_0x48d24c=0xc8;}else{_0x48d24c=0xce;}_0x434c0e['status'](_0x48d24c);return _0x434c0e[_0x766c('0x2a')](_0x766c('0x2b'),_0xb464bb+'-'+_0xafcb7a+'/'+_0x2271d2)[_0x766c('0x25')](_0x3da47e);}return null;};}function patchUpdates(_0x368cbe){return function(_0x1532ba){try{jsonpatch[_0x766c('0x2c')](_0x1532ba,_0x368cbe,!![]);}catch(_0x24c7a0){return BPromise[_0x766c('0x2d')](_0x24c7a0);}return _0x1532ba[_0x766c('0x2e')]();};}function saveUpdates(_0x3cbcc7,_0x38fd18){return function(_0x32ca5e){if(_0x32ca5e){return _0x32ca5e[_0x766c('0x2f')](_0x3cbcc7)['then'](function(_0xb34afc){return _0xb34afc;});}return null;};}function removeEntity(_0x31736c,_0x2da0ec){return function(_0x23f7b0){if(_0x23f7b0){return _0x23f7b0['destroy']()[_0x766c('0x30')](function(){var _0x350618=_0x23f7b0[_0x766c('0x31')]({'plain':!![]});var _0x466165=_0x766c('0x32');return db[_0x766c('0x33')][_0x766c('0x34')]({'where':{'type':_0x466165,'resourceId':_0x350618['id']}})['then'](function(){return _0x23f7b0;});})[_0x766c('0x30')](function(){_0x31736c[_0x766c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x431c12,_0x22a712){return function(_0x27e3cd){if(!_0x27e3cd){_0x431c12['sendStatus'](0x194);}return _0x27e3cd;};}function handleError(_0x2f917d,_0x17b968){_0x17b968=_0x17b968||0x1f4;return function(_0x3519c8){logger['error'](_0x3519c8[_0x766c('0x35')]);if(_0x3519c8[_0x766c('0x36')]){delete _0x3519c8[_0x766c('0x36')];}_0x2f917d[_0x766c('0x23')](_0x17b968)[_0x766c('0x37')](_0x3519c8);};}exports[_0x766c('0x38')]=function(_0x5d3c68,_0x312999){var _0x30694b={},_0x19f16d={},_0x488dd7={'count':0x0,'rows':[]};var _0x5d5e8f=_['map'](db[_0x766c('0x39')][_0x766c('0x3a')],function(_0x3804ac){return{'name':_0x3804ac['fieldName'],'type':_0x3804ac['type'][_0x766c('0x3b')]};});_0x19f16d['model']=_[_0x766c('0x3c')](_0x5d5e8f,_0x766c('0x36'));_0x19f16d[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x5d3c68[_0x766c('0x3d')]);_0x19f16d[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x19f16d[_0x766c('0x41')],_0x19f16d['query']);_0x30694b['attributes']=_['intersection'](_0x19f16d[_0x766c('0x41')],qs[_0x766c('0x42')](_0x5d3c68[_0x766c('0x3d')][_0x766c('0x42')]));_0x30694b[_0x766c('0x43')]=_0x30694b['attributes']['length']?_0x30694b[_0x766c('0x43')]:_0x19f16d[_0x766c('0x41')];if(!_0x5d3c68['query'][_0x766c('0x44')](_0x766c('0x45'))){_0x30694b[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x5d3c68[_0x766c('0x3d')]['limit']);_0x30694b[_0x766c('0x26')]=qs[_0x766c('0x26')](_0x5d3c68['query'][_0x766c('0x26')]);}_0x30694b[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x5d3c68[_0x766c('0x3d')]['sort']);_0x30694b['where']=qs['filters'](_['pick'](_0x5d3c68[_0x766c('0x3d')],_0x19f16d['filters']),_0x5d5e8f);if(_0x5d3c68[_0x766c('0x3d')][_0x766c('0x48')]){_0x30694b[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x30694b[_0x766c('0x49')],{'$or':_['map'](_0x5d5e8f,function(_0x10d676){if(_0x10d676[_0x766c('0x4b')]!==_0x766c('0x4c')){var _0x5ab60e={};_0x5ab60e[_0x10d676[_0x766c('0x36')]]={'$like':'%'+_0x5d3c68[_0x766c('0x3d')][_0x766c('0x48')]+'%'};return _0x5ab60e;}})});}_0x30694b=_[_0x766c('0x4a')]({},_0x30694b,_0x5d3c68[_0x766c('0x4d')]);var _0x1d7b11={'where':_0x30694b[_0x766c('0x49')]};return db['FaxQueue'][_0x766c('0x28')](_0x1d7b11)[_0x766c('0x30')](function(_0x141f9c){_0x488dd7['count']=_0x141f9c;if(_0x5d3c68[_0x766c('0x3d')][_0x766c('0x4e')]){_0x30694b['include']=[{'all':!![]}];}return db['FaxQueue'][_0x766c('0x4f')](_0x30694b);})[_0x766c('0x30')](function(_0x762acd){_0x488dd7[_0x766c('0x50')]=_0x762acd;return _0x488dd7;})[_0x766c('0x30')](respondWithFilteredResult(_0x312999,_0x30694b))[_0x766c('0x51')](handleError(_0x312999,null));};exports['show']=function(_0x48e031,_0x1c5e11){var _0x12004c={'raw':!![],'where':{'id':_0x48e031[_0x766c('0x52')]['id']}},_0x71d271={};_0x71d271[_0x766c('0x41')]=_[_0x766c('0x3e')](db['FaxQueue'][_0x766c('0x3a')]);_0x71d271['query']=_['keys'](_0x48e031[_0x766c('0x3d')]);_0x71d271['filters']=_['intersection'](_0x71d271[_0x766c('0x41')],_0x71d271['query']);_0x12004c[_0x766c('0x43')]=_['intersection'](_0x71d271[_0x766c('0x41')],qs[_0x766c('0x42')](_0x48e031[_0x766c('0x3d')][_0x766c('0x42')]));_0x12004c[_0x766c('0x43')]=_0x12004c[_0x766c('0x43')]['length']?_0x12004c[_0x766c('0x43')]:_0x71d271['model'];if(_0x48e031[_0x766c('0x3d')]['includeAll']){_0x12004c[_0x766c('0x53')]=[{'all':!![]}];}_0x12004c=_[_0x766c('0x4a')]({},_0x12004c,_0x48e031[_0x766c('0x4d')]);return db['FaxQueue'][_0x766c('0x54')](_0x12004c)[_0x766c('0x30')](handleEntityNotFound(_0x1c5e11,null))['then'](respondWithResult(_0x1c5e11,null))[_0x766c('0x51')](handleError(_0x1c5e11,null));};exports['create']=function(_0x395c6a,_0x3c711a){return db[_0x766c('0x39')][_0x766c('0x55')](_0x395c6a[_0x766c('0x56')],{})[_0x766c('0x30')](function(_0x124ab6){var _0x191561=_0x395c6a['user'][_0x766c('0x31')]({'plain':!![]});if(!_0x191561)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x191561[_0x766c('0x57')]===_0x766c('0x58')){var _0x355813=_0x124ab6[_0x766c('0x31')]({'plain':!![]});var _0xebfd09=_0x766c('0x32');return db['UserProfileSection'][_0x766c('0x54')]({'where':{'name':_0xebfd09,'userProfileId':_0x191561[_0x766c('0x59')]},'raw':!![]})[_0x766c('0x30')](function(_0x351b09){if(_0x351b09&&_0x351b09[_0x766c('0x5a')]===0x0){return db[_0x766c('0x33')][_0x766c('0x55')]({'name':_0x355813['name'],'resourceId':_0x355813['id'],'type':_0x351b09[_0x766c('0x36')],'sectionId':_0x351b09['id']},{})['then'](function(){return _0x124ab6;});}else{return _0x124ab6;}})[_0x766c('0x51')](function(_0x50c7a6){logger[_0x766c('0x5b')](_0x766c('0x5c'),_0x50c7a6);throw _0x50c7a6;});}return _0x124ab6;})[_0x766c('0x30')](respondWithResult(_0x3c711a,0xc9))[_0x766c('0x51')](handleError(_0x3c711a,null));};exports[_0x766c('0x2f')]=function(_0x3f3cad,_0x489b22){if(_0x3f3cad[_0x766c('0x56')]['id']){delete _0x3f3cad[_0x766c('0x56')]['id'];}return db[_0x766c('0x39')][_0x766c('0x54')]({'where':{'id':_0x3f3cad[_0x766c('0x52')]['id']}})['then'](handleEntityNotFound(_0x489b22,null))['then'](saveUpdates(_0x3f3cad['body'],null))[_0x766c('0x30')](respondWithResult(_0x489b22,null))[_0x766c('0x51')](handleError(_0x489b22,null));};exports['destroy']=function(_0x824317,_0x5bb799){return db[_0x766c('0x39')][_0x766c('0x54')]({'where':{'id':_0x824317[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x5bb799,null))[_0x766c('0x30')](removeEntity(_0x5bb799,null))[_0x766c('0x51')](handleError(_0x5bb799,null));};exports[_0x766c('0x5d')]=function(_0x35382e,_0x120730){return db[_0x766c('0x39')][_0x766c('0x5d')]()['then'](respondWithResult(_0x120730,null))[_0x766c('0x51')](handleError(_0x120730,null));};exports[_0x766c('0x5e')]=function(_0x389533,_0xb76bf5,_0x3a86b9){var _0x5c6f6f={'raw':!![],'where':{}},_0x3c0e65={},_0x67bef2;return db['FaxQueue'][_0x766c('0x5f')]({'where':{'id':_0x389533[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0xb76bf5,null))[_0x766c('0x30')](function(_0x3db40d){if(_0x3db40d){_0x67bef2=_0x3db40d['get']({'plain':!![]});_0x3c0e65[_0x766c('0x41')]=_[_0x766c('0x3e')](db['UserFaxQueue']['rawAttributes']);_0x3c0e65[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x389533[_0x766c('0x3d')]);_0x3c0e65[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x3c0e65[_0x766c('0x41')],_0x3c0e65['query']);_0x5c6f6f[_0x766c('0x43')]=_['intersection'](_0x3c0e65[_0x766c('0x41')],qs[_0x766c('0x42')](_0x389533[_0x766c('0x3d')][_0x766c('0x42')]));_0x5c6f6f[_0x766c('0x43')]=_0x5c6f6f[_0x766c('0x43')][_0x766c('0x60')]?_0x5c6f6f['attributes']:_0x3c0e65[_0x766c('0x41')];if(!_0x389533[_0x766c('0x3d')][_0x766c('0x44')](_0x766c('0x45'))){_0x5c6f6f[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x389533[_0x766c('0x3d')][_0x766c('0x29')]);_0x5c6f6f['offset']=qs[_0x766c('0x26')](_0x389533[_0x766c('0x3d')]['offset']);}_0x5c6f6f[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x389533[_0x766c('0x3d')][_0x766c('0x47')]);_0x5c6f6f[_0x766c('0x49')]=qs[_0x766c('0x3f')](_['pick'](_0x389533[_0x766c('0x3d')],_0x3c0e65[_0x766c('0x3f')]));_0x5c6f6f['where'][_0x766c('0x61')]=_0x3db40d['id'];if(_0x389533[_0x766c('0x3d')][_0x766c('0x48')]){_0x5c6f6f[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x5c6f6f['where'],{'$or':_['map'](_0x5c6f6f[_0x766c('0x43')],function(_0x17f8d6){var _0x2a2ac7={};_0x2a2ac7[_0x17f8d6]={'$like':'%'+_0x389533[_0x766c('0x3d')][_0x766c('0x48')]+'%'};return _0x2a2ac7;})});}_0x5c6f6f=_['merge']({},_0x5c6f6f,_0x389533[_0x766c('0x4d')]);return db[_0x766c('0x62')][_0x766c('0x4f')](_0x5c6f6f);}})['then'](function(_0x576418){if(_0x576418){return db['User'][_0x766c('0x63')]({'where':{'id':_['map'](_0x576418,'UserId'),'role':_0x766c('0x64')},'attributes':['id',_0x766c('0x36'),_0x766c('0x65'),_0x766c('0x66'),_0x766c('0x67')]});}})[_0x766c('0x30')](function(_0x28ed3a){if(_0x28ed3a){return{'count':_0x28ed3a[_0x766c('0x28')],'rows':_[_0x766c('0x3c')](_0x28ed3a[_0x766c('0x50')],function(_0x49a5d0){return{'membername':_0x49a5d0[_0x766c('0x36')],'UserId':_0x49a5d0['id'],'queue_name':_0x67bef2[_0x766c('0x36')],'FaxQueueId':_0x67bef2['id'],'interface':util[_0x766c('0x68')]('%s/%s','SIP',_0x49a5d0[_0x766c('0x36')]),'penalty':0x0,'paused':_0x49a5d0['faxPause'],'createdAt':_0x49a5d0['createdAt'],'updatedAt':_0x49a5d0[_0x766c('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x766c('0x30')](respondWithFilteredResult(_0xb76bf5,_0x5c6f6f))[_0x766c('0x51')](handleError(_0xb76bf5,null));};exports[_0x766c('0x69')]=function(_0x1b664c,_0x1b9264,_0x19132a){var _0x507f1a={};var _0x104e81={};var _0x275be2;var _0x514fed;return db[_0x766c('0x39')][_0x766c('0x5f')]({'where':{'id':_0x1b664c[_0x766c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b9264,null))[_0x766c('0x30')](function(_0x49a7b4){if(_0x49a7b4){_0x275be2=_0x49a7b4;_0x104e81['model']=_[_0x766c('0x3e')](db[_0x766c('0x6a')][_0x766c('0x3a')]);_0x104e81[_0x766c('0x3d')]=_[_0x766c('0x3e')](_0x1b664c['query']);_0x104e81[_0x766c('0x3f')]=_[_0x766c('0x40')](_0x104e81[_0x766c('0x41')],_0x104e81['query']);_0x507f1a[_0x766c('0x43')]=_[_0x766c('0x40')](_0x104e81[_0x766c('0x41')],qs[_0x766c('0x42')](_0x1b664c[_0x766c('0x3d')][_0x766c('0x42')]));_0x507f1a[_0x766c('0x43')]=_0x507f1a['attributes']['length']?_0x507f1a[_0x766c('0x43')]:_0x104e81[_0x766c('0x41')];_0x507f1a[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x1b664c['query']['sort']);_0x507f1a[_0x766c('0x49')]=qs['filters'](_[_0x766c('0x6b')](_0x1b664c[_0x766c('0x3d')],_0x104e81[_0x766c('0x3f')]));if(_0x1b664c[_0x766c('0x3d')][_0x766c('0x48')]){_0x507f1a[_0x766c('0x49')]=_['merge'](_0x507f1a[_0x766c('0x49')],{'$or':_[_0x766c('0x3c')](_0x507f1a[_0x766c('0x43')],function(_0x2be17e){var _0x5c3f2f={};_0x5c3f2f[_0x2be17e]={'$like':'%'+_0x1b664c['query']['filter']+'%'};return _0x5c3f2f;})});}_0x507f1a=_[_0x766c('0x4a')]({},_0x507f1a,_0x1b664c[_0x766c('0x4d')]);return _0x275be2[_0x766c('0x69')](_0x507f1a);}})[_0x766c('0x30')](function(_0x1ddd75){if(_0x1ddd75){_0x514fed=_0x1ddd75[_0x766c('0x60')];if(!_0x1b664c['query'][_0x766c('0x44')](_0x766c('0x45'))){_0x507f1a[_0x766c('0x29')]=qs[_0x766c('0x29')](_0x1b664c[_0x766c('0x3d')]['limit']);_0x507f1a[_0x766c('0x26')]=qs[_0x766c('0x26')](_0x1b664c[_0x766c('0x3d')]['offset']);}return _0x275be2[_0x766c('0x69')](_0x507f1a);}})[_0x766c('0x30')](function(_0xab2c1c){if(_0xab2c1c){return _0xab2c1c?{'count':_0x514fed,'rows':_0xab2c1c}:null;}})[_0x766c('0x30')](respondWithResult(_0x1b9264,null))[_0x766c('0x51')](handleError(_0x1b9264,null));};exports['addTeams']=function(_0x544b16,_0x4e3b07,_0xad1d0e){var _0x4521e5=_0x544b16[_0x766c('0x56')][_0x766c('0x6c')];return db['Team'][_0x766c('0x4f')]({'where':{'id':_0x4521e5},'attributes':['id'],'include':[{'model':db[_0x766c('0x6d')],'as':_0x766c('0x6e'),'attributes':['id',_0x766c('0x36'),_0x766c('0x6f'),_0x766c('0x70'),_0x766c('0x71')],'raw':!![]}]})[_0x766c('0x30')](function(_0x56262f){if(_0x56262f){var _0x2df477=_[_0x766c('0x72')](_0x56262f,function(_0x49483f){var _0x2d52fe=_0x49483f[_0x766c('0x31')]({'plain':!![]});return _0x2d52fe[_0x766c('0x6e')];});return db[_0x766c('0x39')]['find']({'where':{'id':_0x544b16['params']['id']}})[_0x766c('0x30')](function(_0x4960ff){return db[_0x766c('0x73')][_0x766c('0x74')](function(_0xe85781){return _0x4960ff[_0x766c('0x75')](_0x4521e5,{'transaction':_0xe85781})['then'](function(){return BPromise['each'](_0x2df477,function(_0xfbb4e2){return db[_0x766c('0x62')][_0x766c('0x76')]({'where':{'UserId':_0xfbb4e2['id'],'FaxQueueId':_0x544b16[_0x766c('0x52')]['id']},'transaction':_0xe85781});});})[_0x766c('0x30')](function(){_0x2df477[_0x766c('0x77')](function(_0x29fd0c){socket[_0x766c('0x78')](_0x766c('0x79'),{'UserId':_0x29fd0c['id'],'FaxQueueId':_0x4960ff['id']});});});});});}})['then'](respondWithStatusCode(_0x4e3b07,null))[_0x766c('0x51')](handleError(_0x4e3b07,null));};exports[_0x766c('0x7a')]=function(_0x3e5922,_0x3b2e36,_0xdbfabd){return db[_0x766c('0x6a')]['findAll']({'where':{'id':_0x3e5922[_0x766c('0x3d')][_0x766c('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x766c('0x6d')],'as':_0x766c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3b2e36,null))[_0x766c('0x30')](function(_0x188b18){var _0x443691=_[_0x766c('0x3c')](_0x188b18,'id');var _0x527e63=[];var _0x40a86c=[];var _0x540d0=squel[_0x766c('0x7b')]();_0x540d0[_0x766c('0x7c')](_0x766c('0x7d'))['from']('team_has_fax_queues','tq')['join'](_0x766c('0x7e'),'ut',_0x766c('0x7f'))[_0x766c('0x49')](_0x766c('0x80'),_0x3e5922[_0x766c('0x52')]['id']);for(var _0x5884f5=0x0;_0x5884f5<_0x188b18['length'];_0x5884f5+=0x1){let _0x2178c8=_0x188b18[_0x5884f5];for(var _0x23c93a=0x0;_0x23c93a<_0x2178c8[_0x766c('0x6e')][_0x766c('0x60')];_0x23c93a+=0x1){let _0x4480dc=_0x2178c8[_0x766c('0x6e')][_0x23c93a];var _0x4fcb7b=_0x540d0[_0x766c('0x81')]();_0x4fcb7b[_0x766c('0x49')](_0x766c('0x82'),_0x4480dc['id']);_0x40a86c[_0x766c('0x83')](db[_0x766c('0x73')]['query'](_0x4fcb7b['toString'](),{'type':db[_0x766c('0x73')][_0x766c('0x84')][_0x766c('0x85')]})[_0x766c('0x30')](function(_0x360a9c){if(_0x360a9c[_0x766c('0x60')]===0x1){return _0x4480dc['id'];}else{var _0x3ea801=_[_0x766c('0x86')](_[_0x766c('0x3c')](_0x360a9c,'TeamId'),function(_0x1edbe5){return _[_0x766c('0x87')](_0x443691,_0x1edbe5);});if(_0x3ea801){return _0x4480dc['id'];}}}));}}return BPromise['all'](_0x40a86c)['then'](function(_0x459cfc){_0x527e63=_(_0x527e63)['union'](_0x459cfc)[_0x766c('0x88')]()[_0x766c('0x89')]();return db[_0x766c('0x39')]['find']({'where':{'id':_0x3e5922[_0x766c('0x52')]['id']}})['then'](function(_0x3d03e3){return db[_0x766c('0x73')]['transaction'](function(_0x4a1d77){return _0x3d03e3[_0x766c('0x7a')](_0x3e5922[_0x766c('0x3d')][_0x766c('0x6c')],{'transaction':_0x4a1d77})['then'](function(){if(!_[_0x766c('0x8a')](_0x527e63)){return _0x3d03e3[_0x766c('0x8b')](_0x527e63,{'transaction':_0x4a1d77});}})[_0x766c('0x30')](function(){_0x527e63['forEach'](function(_0x15082b){socket[_0x766c('0x78')]('userFaxQueue:remove',{'UserId':_0x15082b,'FaxQueueId':_0x3d03e3['id']});});});});});});})[_0x766c('0x30')](respondWithStatusCode(_0x3b2e36,null))[_0x766c('0x51')](handleError(_0x3b2e36,null));};exports[_0x766c('0x8c')]=function(_0x4f56fe,_0x20f96f,_0x57a1f0){return db[_0x766c('0x39')]['find']({'where':{'id':_0x4f56fe[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x20f96f,null))[_0x766c('0x30')](function(_0x127a0a){if(_0x127a0a){return _0x127a0a[_0x766c('0x8c')](_0x4f56fe['body'][_0x766c('0x6c')],_['omit'](_0x4f56fe['body'],[_0x766c('0x6c'),'id'])||{})[_0x766c('0x8d')](function(_0x37e030){for(var _0x458900=0x0;_0x458900<_0x4f56fe[_0x766c('0x56')]['ids'][_0x766c('0x60')];_0x458900+=0x1){socket['emit'](_0x766c('0x79'),{'UserId':Number(_0x4f56fe[_0x766c('0x56')][_0x766c('0x6c')][_0x458900]),'FaxQueueId':Number(_0x4f56fe['params']['id'])});}return _0x37e030;});}})[_0x766c('0x30')](respondWithResult(_0x20f96f,null))['catch'](handleError(_0x20f96f,null));};exports['removeAgents']=function(_0xbac95,_0x50ec3e,_0x51b6dd){return db['FaxQueue'][_0x766c('0x54')]({'where':{'id':_0xbac95['params']['id']}})['then'](handleEntityNotFound(_0x50ec3e,null))[_0x766c('0x30')](function(_0x1d3c12){if(_0x1d3c12){return _0x1d3c12['removeAgents'](_0xbac95['query'][_0x766c('0x6c')])[_0x766c('0x30')](function(){if(_[_0x766c('0x8e')](_0xbac95[_0x766c('0x3d')]['ids'])){for(var _0x1c01b8=0x0;_0x1c01b8<_0xbac95[_0x766c('0x3d')]['ids'][_0x766c('0x60')];_0x1c01b8+=0x1){socket[_0x766c('0x78')](_0x766c('0x8f'),{'UserId':Number(_0xbac95[_0x766c('0x3d')][_0x766c('0x6c')][_0x1c01b8]),'FaxQueueId':Number(_0xbac95[_0x766c('0x52')]['id'])});}}else{socket[_0x766c('0x78')]('userFaxQueue:remove',{'UserId':Number(_0xbac95[_0x766c('0x3d')][_0x766c('0x6c')]),'FaxQueueId':Number(_0xbac95['params']['id'])});}});}})[_0x766c('0x30')](respondWithStatusCode(_0x50ec3e,null))['catch'](handleError(_0x50ec3e,null));};exports[_0x766c('0x90')]=function(_0x2eaf79,_0x4fada5,_0x208824){var _0x40277e={};var _0xb15814={};var _0x2d3e98;var _0x2d7d74;return db['FaxQueue'][_0x766c('0x5f')]({'where':{'id':_0x2eaf79[_0x766c('0x52')]['id']}})[_0x766c('0x30')](handleEntityNotFound(_0x4fada5,null))[_0x766c('0x30')](function(_0x5d82ac){if(_0x5d82ac){_0x2d3e98=_0x5d82ac;_0xb15814['model']=_[_0x766c('0x3e')](db[_0x766c('0x6d')][_0x766c('0x3a')]);_0xb15814['query']=_[_0x766c('0x3e')](_0x2eaf79[_0x766c('0x3d')]);_0xb15814['filters']=_[_0x766c('0x40')](_0xb15814[_0x766c('0x41')],_0xb15814[_0x766c('0x3d')]);_0x40277e['attributes']=_[_0x766c('0x40')](_0xb15814[_0x766c('0x41')],qs[_0x766c('0x42')](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x42')]));_0x40277e['attributes']=_0x40277e[_0x766c('0x43')][_0x766c('0x60')]?_0x40277e[_0x766c('0x43')]:_0xb15814[_0x766c('0x41')];_0x40277e[_0x766c('0x46')]=qs[_0x766c('0x47')](_0x2eaf79[_0x766c('0x3d')]['sort']);_0x40277e['where']=qs[_0x766c('0x3f')](_[_0x766c('0x6b')](_0x2eaf79['query'],_0xb15814[_0x766c('0x3f')]));if(_0x2eaf79[_0x766c('0x3d')][_0x766c('0x48')]){_0x40277e[_0x766c('0x49')]=_[_0x766c('0x4a')](_0x40277e['where'],{'$or':_[_0x766c('0x3c')](_0x40277e[_0x766c('0x43')],function(_0x1ecc53){var _0x4eabba={};_0x4eabba[_0x1ecc53]={'$like':'%'+_0x2eaf79[_0x766c('0x3d')]['filter']+'%'};return _0x4eabba;})});}_0x40277e=_['merge']({},_0x40277e,_0x2eaf79['options']);return _0x2d3e98['getAgents'](_0x40277e);}})[_0x766c('0x30')](function(_0x360db0){if(_0x360db0){_0x2d7d74=_0x360db0[_0x766c('0x60')];if(!_0x2eaf79[_0x766c('0x3d')][_0x766c('0x44')]('nolimit')){_0x40277e[_0x766c('0x29')]=qs['limit'](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x29')]);_0x40277e['offset']=qs[_0x766c('0x26')](_0x2eaf79[_0x766c('0x3d')][_0x766c('0x26')]);}return _0x2d3e98[_0x766c('0x90')](_0x40277e);}})[_0x766c('0x30')](function(_0x50181f){if(_0x50181f){return _0x50181f?{'count':_0x2d7d74,'rows':_0x50181f}:null;}})['then'](respondWithResult(_0x4fada5,null))[_0x766c('0x51')](handleError(_0x4fada5,null));}; \ No newline at end of file +var _0xb1ce=['stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','FaxQueues','UserProfileResource','destroy','error'];(function(_0x4c9ff6,_0xf88a4c){var _0x13a8f2=function(_0x22264e){while(--_0x22264e){_0x4c9ff6['push'](_0x4c9ff6['shift']());}};_0x13a8f2(++_0xf88a4c);}(_0xb1ce,0x177));var _0xeb1c=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0xb1ce[_0x2ff739];return _0x12dc13;};'use strict';var emlformat=require(_0xeb1c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb1c('0x1'));var rp=require(_0xeb1c('0x2'));var moment=require(_0xeb1c('0x3'));var BPromise=require(_0xeb1c('0x4'));var Mustache=require(_0xeb1c('0x5'));var util=require(_0xeb1c('0x6'));var path=require(_0xeb1c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb1c('0x8'));var _=require(_0xeb1c('0x9'));var squel=require('squel');var crypto=require(_0xeb1c('0xa'));var jsforce=require(_0xeb1c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb1c('0xc'));var Papa=require(_0xeb1c('0xd'));var Redis=require(_0xeb1c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xeb1c('0xf'));var as=require(_0xeb1c('0x10'));var hardwareService=require(_0xeb1c('0x11'));var logger=require(_0xeb1c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xeb1c('0x13'));var licenseUtil=require(_0xeb1c('0x14'));var db=require(_0xeb1c('0x15'))['db'];config[_0xeb1c('0x16')]=_[_0xeb1c('0x17')](config[_0xeb1c('0x16')],{'host':_0xeb1c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb1c('0x16')]));require(_0xeb1c('0x19'))[_0xeb1c('0x1a')](socket);function respondWithStatusCode(_0x1522a0,_0x1a803d){_0x1a803d=_0x1a803d||0xcc;return function(_0xb123d2){if(_0xb123d2){return _0x1522a0[_0xeb1c('0x1b')](_0x1a803d);}return _0x1522a0[_0xeb1c('0x1c')](_0x1a803d)[_0xeb1c('0x1d')]();};}function respondWithResult(_0xeb7cd,_0x256ccc){_0x256ccc=_0x256ccc||0xc8;return function(_0x3ee069){if(_0x3ee069){return _0xeb7cd[_0xeb1c('0x1c')](_0x256ccc)['json'](_0x3ee069);}};}function respondWithFilteredResult(_0x4665e1,_0x5e6290){return function(_0x37ea40){if(_0x37ea40){var _0x33d95e=typeof _0x5e6290[_0xeb1c('0x1e')]==='undefined'&&typeof _0x5e6290[_0xeb1c('0x1f')]===_0xeb1c('0x20');var _0x57c054=_0x37ea40[_0xeb1c('0x21')];var _0x55b3dc=_0x33d95e?0x0:_0x5e6290['offset'];var _0x2ea7f3=_0x33d95e?_0x37ea40[_0xeb1c('0x21')]:_0x5e6290[_0xeb1c('0x1e')]+_0x5e6290[_0xeb1c('0x1f')];var _0x360bc9;if(_0x2ea7f3>=_0x57c054){_0x2ea7f3=_0x57c054;_0x360bc9=0xc8;}else{_0x360bc9=0xce;}_0x4665e1[_0xeb1c('0x1c')](_0x360bc9);return _0x4665e1[_0xeb1c('0x22')](_0xeb1c('0x23'),_0x55b3dc+'-'+_0x2ea7f3+'/'+_0x57c054)[_0xeb1c('0x24')](_0x37ea40);}return null;};}function patchUpdates(_0x29db2a){return function(_0x432fe1){try{jsonpatch[_0xeb1c('0x25')](_0x432fe1,_0x29db2a,!![]);}catch(_0x2ab492){return BPromise[_0xeb1c('0x26')](_0x2ab492);}return _0x432fe1['save']();};}function saveUpdates(_0xcfd7f9,_0x3839d1){return function(_0x1a01eb){if(_0x1a01eb){return _0x1a01eb[_0xeb1c('0x27')](_0xcfd7f9)[_0xeb1c('0x28')](function(_0x1a513c){return _0x1a513c;});}return null;};}function removeEntity(_0x5017c2,_0x33f0ce){return function(_0x11cecb){if(_0x11cecb){return _0x11cecb['destroy']()['then'](function(){var _0x2194a9=_0x11cecb['get']({'plain':!![]});var _0x1e4d53=_0xeb1c('0x29');return db[_0xeb1c('0x2a')][_0xeb1c('0x2b')]({'where':{'type':_0x1e4d53,'resourceId':_0x2194a9['id']}})['then'](function(){return _0x11cecb;});})[_0xeb1c('0x28')](function(){_0x5017c2[_0xeb1c('0x1c')](0xcc)[_0xeb1c('0x1d')]();});}};}function handleEntityNotFound(_0x5b554a,_0x526eb7){return function(_0x5b051a){if(!_0x5b051a){_0x5b554a[_0xeb1c('0x1b')](0x194);}return _0x5b051a;};}function handleError(_0x420e87,_0x5c196e){_0x5c196e=_0x5c196e||0x1f4;return function(_0x221d5b){logger[_0xeb1c('0x2c')](_0x221d5b[_0xeb1c('0x2d')]);if(_0x221d5b[_0xeb1c('0x2e')]){delete _0x221d5b[_0xeb1c('0x2e')];}_0x420e87[_0xeb1c('0x1c')](_0x5c196e)[_0xeb1c('0x2f')](_0x221d5b);};}exports[_0xeb1c('0x30')]=function(_0x7c9707,_0x327aa1){var _0x495352={},_0x3eb33b={},_0x2bd62e={'count':0x0,'rows':[]};var _0x4456fd=_[_0xeb1c('0x31')](db[_0xeb1c('0x32')][_0xeb1c('0x33')],function(_0x499016){return{'name':_0x499016[_0xeb1c('0x34')],'type':_0x499016['type']['key']};});_0x3eb33b[_0xeb1c('0x35')]=_[_0xeb1c('0x31')](_0x4456fd,'name');_0x3eb33b[_0xeb1c('0x36')]=_[_0xeb1c('0x37')](_0x7c9707[_0xeb1c('0x36')]);_0x3eb33b['filters']=_[_0xeb1c('0x38')](_0x3eb33b['model'],_0x3eb33b['query']);_0x495352['attributes']=_[_0xeb1c('0x38')](_0x3eb33b['model'],qs[_0xeb1c('0x39')](_0x7c9707[_0xeb1c('0x36')]['fields']));_0x495352[_0xeb1c('0x3a')]=_0x495352[_0xeb1c('0x3a')][_0xeb1c('0x3b')]?_0x495352[_0xeb1c('0x3a')]:_0x3eb33b[_0xeb1c('0x35')];if(!_0x7c9707[_0xeb1c('0x36')][_0xeb1c('0x3c')](_0xeb1c('0x3d'))){_0x495352[_0xeb1c('0x1f')]=qs[_0xeb1c('0x1f')](_0x7c9707[_0xeb1c('0x36')][_0xeb1c('0x1f')]);_0x495352['offset']=qs[_0xeb1c('0x1e')](_0x7c9707['query'][_0xeb1c('0x1e')]);}_0x495352[_0xeb1c('0x3e')]=qs[_0xeb1c('0x3f')](_0x7c9707[_0xeb1c('0x36')]['sort']);_0x495352[_0xeb1c('0x40')]=qs[_0xeb1c('0x41')](_[_0xeb1c('0x42')](_0x7c9707['query'],_0x3eb33b[_0xeb1c('0x41')]),_0x4456fd);if(_0x7c9707[_0xeb1c('0x36')][_0xeb1c('0x43')]){_0x495352[_0xeb1c('0x40')]=_[_0xeb1c('0x44')](_0x495352[_0xeb1c('0x40')],{'$or':_['map'](_0x4456fd,function(_0x556b18){if(_0x556b18[_0xeb1c('0x45')]!=='VIRTUAL'){var _0x26d779={};_0x26d779[_0x556b18[_0xeb1c('0x2e')]]={'$like':'%'+_0x7c9707[_0xeb1c('0x36')]['filter']+'%'};return _0x26d779;}})});}_0x495352=_[_0xeb1c('0x44')]({},_0x495352,_0x7c9707[_0xeb1c('0x46')]);var _0x25ea5b={'where':_0x495352[_0xeb1c('0x40')]};return db[_0xeb1c('0x32')][_0xeb1c('0x21')](_0x25ea5b)[_0xeb1c('0x28')](function(_0x53a88d){_0x2bd62e[_0xeb1c('0x21')]=_0x53a88d;if(_0x7c9707['query'][_0xeb1c('0x47')]){_0x495352[_0xeb1c('0x48')]=[{'all':!![]}];}return db[_0xeb1c('0x32')][_0xeb1c('0x49')](_0x495352);})[_0xeb1c('0x28')](function(_0x508b29){_0x2bd62e[_0xeb1c('0x4a')]=_0x508b29;return _0x2bd62e;})[_0xeb1c('0x28')](respondWithFilteredResult(_0x327aa1,_0x495352))[_0xeb1c('0x4b')](handleError(_0x327aa1,null));};exports[_0xeb1c('0x4c')]=function(_0x3f00f8,_0x5bc1da){var _0x178fb3={'raw':!![],'where':{'id':_0x3f00f8[_0xeb1c('0x4d')]['id']}},_0x51b479={};_0x51b479[_0xeb1c('0x35')]=_['keys'](db[_0xeb1c('0x32')][_0xeb1c('0x33')]);_0x51b479[_0xeb1c('0x36')]=_[_0xeb1c('0x37')](_0x3f00f8[_0xeb1c('0x36')]);_0x51b479[_0xeb1c('0x41')]=_[_0xeb1c('0x38')](_0x51b479['model'],_0x51b479['query']);_0x178fb3[_0xeb1c('0x3a')]=_[_0xeb1c('0x38')](_0x51b479[_0xeb1c('0x35')],qs['fields'](_0x3f00f8[_0xeb1c('0x36')][_0xeb1c('0x39')]));_0x178fb3[_0xeb1c('0x3a')]=_0x178fb3[_0xeb1c('0x3a')][_0xeb1c('0x3b')]?_0x178fb3[_0xeb1c('0x3a')]:_0x51b479[_0xeb1c('0x35')];if(_0x3f00f8[_0xeb1c('0x36')][_0xeb1c('0x47')]){_0x178fb3[_0xeb1c('0x48')]=[{'all':!![]}];}_0x178fb3=_[_0xeb1c('0x44')]({},_0x178fb3,_0x3f00f8[_0xeb1c('0x46')]);return db[_0xeb1c('0x32')]['find'](_0x178fb3)[_0xeb1c('0x28')](handleEntityNotFound(_0x5bc1da,null))['then'](respondWithResult(_0x5bc1da,null))['catch'](handleError(_0x5bc1da,null));};exports['create']=function(_0x353431,_0x3e83b2){return db[_0xeb1c('0x32')][_0xeb1c('0x4e')](_0x353431[_0xeb1c('0x4f')],{})[_0xeb1c('0x28')](function(_0x374522){var _0x3f0487=_0x353431['user'][_0xeb1c('0x50')]({'plain':!![]});if(!_0x3f0487)throw new Error(_0xeb1c('0x51'));if(_0x3f0487[_0xeb1c('0x52')]===_0xeb1c('0x53')){var _0x214789=_0x374522[_0xeb1c('0x50')]({'plain':!![]});var _0x4d9e89=_0xeb1c('0x29');return db[_0xeb1c('0x54')]['find']({'where':{'name':_0x4d9e89,'userProfileId':_0x3f0487['userProfileId']},'raw':!![]})[_0xeb1c('0x28')](function(_0x4f20fc){if(_0x4f20fc&&_0x4f20fc[_0xeb1c('0x55')]===0x0){return db[_0xeb1c('0x2a')]['create']({'name':_0x214789[_0xeb1c('0x2e')],'resourceId':_0x214789['id'],'type':_0x4f20fc['name'],'sectionId':_0x4f20fc['id']},{})['then'](function(){return _0x374522;});}else{return _0x374522;}})['catch'](function(_0x9f1bcc){logger[_0xeb1c('0x2c')](_0xeb1c('0x56'),_0x9f1bcc);throw _0x9f1bcc;});}return _0x374522;})['then'](respondWithResult(_0x3e83b2,0xc9))[_0xeb1c('0x4b')](handleError(_0x3e83b2,null));};exports[_0xeb1c('0x27')]=function(_0x375066,_0x1dbd13){if(_0x375066[_0xeb1c('0x4f')]['id']){delete _0x375066[_0xeb1c('0x4f')]['id'];}return db[_0xeb1c('0x32')][_0xeb1c('0x57')]({'where':{'id':_0x375066['params']['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0x1dbd13,null))[_0xeb1c('0x28')](saveUpdates(_0x375066[_0xeb1c('0x4f')],null))[_0xeb1c('0x28')](respondWithResult(_0x1dbd13,null))['catch'](handleError(_0x1dbd13,null));};exports[_0xeb1c('0x2b')]=function(_0x2c636d,_0xc7d35c){return db[_0xeb1c('0x32')]['find']({'where':{'id':_0x2c636d[_0xeb1c('0x4d')]['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0xc7d35c,null))[_0xeb1c('0x28')](removeEntity(_0xc7d35c,null))['catch'](handleError(_0xc7d35c,null));};exports[_0xeb1c('0x58')]=function(_0x56b145,_0x18c366){return db['FaxQueue'][_0xeb1c('0x58')]()[_0xeb1c('0x28')](respondWithResult(_0x18c366,null))[_0xeb1c('0x4b')](handleError(_0x18c366,null));};exports[_0xeb1c('0x59')]=function(_0x2565db,_0xdc9764,_0x3ee57c){var _0x2927d7={'raw':!![],'where':{}},_0x34c29c={},_0x56d5e4;return db['FaxQueue'][_0xeb1c('0x5a')]({'where':{'id':_0x2565db['params']['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0xdc9764,null))['then'](function(_0x1bc348){if(_0x1bc348){_0x56d5e4=_0x1bc348['get']({'plain':!![]});_0x34c29c[_0xeb1c('0x35')]=_[_0xeb1c('0x37')](db['UserFaxQueue'][_0xeb1c('0x33')]);_0x34c29c['query']=_[_0xeb1c('0x37')](_0x2565db[_0xeb1c('0x36')]);_0x34c29c[_0xeb1c('0x41')]=_[_0xeb1c('0x38')](_0x34c29c[_0xeb1c('0x35')],_0x34c29c[_0xeb1c('0x36')]);_0x2927d7['attributes']=_[_0xeb1c('0x38')](_0x34c29c['model'],qs[_0xeb1c('0x39')](_0x2565db[_0xeb1c('0x36')][_0xeb1c('0x39')]));_0x2927d7['attributes']=_0x2927d7[_0xeb1c('0x3a')]['length']?_0x2927d7[_0xeb1c('0x3a')]:_0x34c29c[_0xeb1c('0x35')];if(!_0x2565db[_0xeb1c('0x36')][_0xeb1c('0x3c')]('nolimit')){_0x2927d7[_0xeb1c('0x1f')]=qs['limit'](_0x2565db[_0xeb1c('0x36')]['limit']);_0x2927d7['offset']=qs[_0xeb1c('0x1e')](_0x2565db[_0xeb1c('0x36')]['offset']);}_0x2927d7[_0xeb1c('0x3e')]=qs[_0xeb1c('0x3f')](_0x2565db[_0xeb1c('0x36')][_0xeb1c('0x3f')]);_0x2927d7['where']=qs[_0xeb1c('0x41')](_[_0xeb1c('0x42')](_0x2565db[_0xeb1c('0x36')],_0x34c29c['filters']));_0x2927d7[_0xeb1c('0x40')]['FaxQueueId']=_0x1bc348['id'];if(_0x2565db[_0xeb1c('0x36')][_0xeb1c('0x43')]){_0x2927d7[_0xeb1c('0x40')]=_[_0xeb1c('0x44')](_0x2927d7['where'],{'$or':_[_0xeb1c('0x31')](_0x2927d7[_0xeb1c('0x3a')],function(_0x12180d){var _0x4e284f={};_0x4e284f[_0x12180d]={'$like':'%'+_0x2565db[_0xeb1c('0x36')][_0xeb1c('0x43')]+'%'};return _0x4e284f;})});}_0x2927d7=_[_0xeb1c('0x44')]({},_0x2927d7,_0x2565db[_0xeb1c('0x46')]);return db[_0xeb1c('0x5b')][_0xeb1c('0x49')](_0x2927d7);}})[_0xeb1c('0x28')](function(_0x55cb04){if(_0x55cb04){return db[_0xeb1c('0x5c')][_0xeb1c('0x5d')]({'where':{'id':_['map'](_0x55cb04,_0xeb1c('0x5e')),'role':_0xeb1c('0x5f')},'attributes':['id',_0xeb1c('0x2e'),_0xeb1c('0x60'),_0xeb1c('0x61'),'createdAt']});}})[_0xeb1c('0x28')](function(_0x33aeab){if(_0x33aeab){return{'count':_0x33aeab[_0xeb1c('0x21')],'rows':_[_0xeb1c('0x31')](_0x33aeab[_0xeb1c('0x4a')],function(_0x1057c7){return{'membername':_0x1057c7[_0xeb1c('0x2e')],'UserId':_0x1057c7['id'],'queue_name':_0x56d5e4[_0xeb1c('0x2e')],'FaxQueueId':_0x56d5e4['id'],'interface':util[_0xeb1c('0x62')](_0xeb1c('0x63'),_0xeb1c('0x64'),_0x1057c7[_0xeb1c('0x2e')]),'penalty':0x0,'paused':_0x1057c7[_0xeb1c('0x60')],'createdAt':_0x1057c7[_0xeb1c('0x65')],'updatedAt':_0x1057c7[_0xeb1c('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeb1c('0x28')](respondWithFilteredResult(_0xdc9764,_0x2927d7))[_0xeb1c('0x4b')](handleError(_0xdc9764,null));};exports[_0xeb1c('0x66')]=function(_0x352abc,_0x4e734a,_0x1cfb82){var _0x37d655={};var _0x2a2926={};var _0x2552e5;var _0x2533e8;return db['FaxQueue'][_0xeb1c('0x5a')]({'where':{'id':_0x352abc[_0xeb1c('0x4d')]['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0x4e734a,null))['then'](function(_0x40f1f0){if(_0x40f1f0){_0x2552e5=_0x40f1f0;_0x2a2926[_0xeb1c('0x35')]=_[_0xeb1c('0x37')](db['Team'][_0xeb1c('0x33')]);_0x2a2926[_0xeb1c('0x36')]=_['keys'](_0x352abc[_0xeb1c('0x36')]);_0x2a2926[_0xeb1c('0x41')]=_[_0xeb1c('0x38')](_0x2a2926[_0xeb1c('0x35')],_0x2a2926[_0xeb1c('0x36')]);_0x37d655[_0xeb1c('0x3a')]=_[_0xeb1c('0x38')](_0x2a2926['model'],qs['fields'](_0x352abc[_0xeb1c('0x36')][_0xeb1c('0x39')]));_0x37d655[_0xeb1c('0x3a')]=_0x37d655['attributes'][_0xeb1c('0x3b')]?_0x37d655[_0xeb1c('0x3a')]:_0x2a2926[_0xeb1c('0x35')];_0x37d655['order']=qs[_0xeb1c('0x3f')](_0x352abc[_0xeb1c('0x36')]['sort']);_0x37d655['where']=qs[_0xeb1c('0x41')](_[_0xeb1c('0x42')](_0x352abc['query'],_0x2a2926[_0xeb1c('0x41')]));if(_0x352abc['query']['filter']){_0x37d655[_0xeb1c('0x40')]=_[_0xeb1c('0x44')](_0x37d655[_0xeb1c('0x40')],{'$or':_[_0xeb1c('0x31')](_0x37d655[_0xeb1c('0x3a')],function(_0x150b72){var _0x574bcc={};_0x574bcc[_0x150b72]={'$like':'%'+_0x352abc[_0xeb1c('0x36')][_0xeb1c('0x43')]+'%'};return _0x574bcc;})});}_0x37d655=_[_0xeb1c('0x44')]({},_0x37d655,_0x352abc['options']);return _0x2552e5[_0xeb1c('0x66')](_0x37d655);}})['then'](function(_0x42d58f){if(_0x42d58f){_0x2533e8=_0x42d58f[_0xeb1c('0x3b')];if(!_0x352abc[_0xeb1c('0x36')][_0xeb1c('0x3c')](_0xeb1c('0x3d'))){_0x37d655['limit']=qs[_0xeb1c('0x1f')](_0x352abc[_0xeb1c('0x36')][_0xeb1c('0x1f')]);_0x37d655[_0xeb1c('0x1e')]=qs['offset'](_0x352abc[_0xeb1c('0x36')]['offset']);}return _0x2552e5[_0xeb1c('0x66')](_0x37d655);}})[_0xeb1c('0x28')](function(_0x4a78ae){if(_0x4a78ae){return _0x4a78ae?{'count':_0x2533e8,'rows':_0x4a78ae}:null;}})[_0xeb1c('0x28')](respondWithResult(_0x4e734a,null))[_0xeb1c('0x4b')](handleError(_0x4e734a,null));};exports[_0xeb1c('0x67')]=function(_0xc098bb,_0x9b2bfe,_0x102221){var _0xde9363=_0xc098bb['body'][_0xeb1c('0x68')];return db[_0xeb1c('0x69')][_0xeb1c('0x49')]({'where':{'id':_0xde9363},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb1c('0x6a'),'attributes':['id',_0xeb1c('0x2e'),'online',_0xeb1c('0x6b'),_0xeb1c('0x6c')],'raw':!![]}]})['then'](function(_0x1ec15c){if(_0x1ec15c){var _0x171cbd=_[_0xeb1c('0x6d')](_0x1ec15c,function(_0x23e4d3){var _0x320ffa=_0x23e4d3[_0xeb1c('0x50')]({'plain':!![]});return _0x320ffa[_0xeb1c('0x6a')];});return db[_0xeb1c('0x32')][_0xeb1c('0x57')]({'where':{'id':_0xc098bb[_0xeb1c('0x4d')]['id']}})[_0xeb1c('0x28')](function(_0x31e889){return db[_0xeb1c('0x6e')]['transaction'](function(_0x5a5def){return _0x31e889[_0xeb1c('0x67')](_0xde9363,{'transaction':_0x5a5def})[_0xeb1c('0x28')](function(){return BPromise[_0xeb1c('0x6f')](_0x171cbd,function(_0x166d8a){return db[_0xeb1c('0x5b')][_0xeb1c('0x70')]({'where':{'UserId':_0x166d8a['id'],'FaxQueueId':_0xc098bb[_0xeb1c('0x4d')]['id']},'transaction':_0x5a5def});});})[_0xeb1c('0x28')](function(){_0x171cbd[_0xeb1c('0x71')](function(_0x39ccf5){socket[_0xeb1c('0x72')](_0xeb1c('0x73'),{'UserId':_0x39ccf5['id'],'FaxQueueId':_0x31e889['id']});});});});});}})['then'](respondWithStatusCode(_0x9b2bfe,null))[_0xeb1c('0x4b')](handleError(_0x9b2bfe,null));};exports[_0xeb1c('0x74')]=function(_0x255d4a,_0x1279ac,_0x1cfd51){return db[_0xeb1c('0x69')][_0xeb1c('0x49')]({'where':{'id':_0x255d4a[_0xeb1c('0x36')][_0xeb1c('0x68')]},'attributes':['id'],'include':[{'model':db[_0xeb1c('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeb1c('0x28')](handleEntityNotFound(_0x1279ac,null))['then'](function(_0xfaf1a8){var _0x190c4d=_[_0xeb1c('0x31')](_0xfaf1a8,'id');var _0x42156e=[];var _0x3efcfb=[];var _0x1eee48=squel[_0xeb1c('0x75')]();_0x1eee48['field'](_0xeb1c('0x76'))[_0xeb1c('0x77')]('team_has_fax_queues','tq')['join'](_0xeb1c('0x78'),'ut',_0xeb1c('0x79'))['where'](_0xeb1c('0x7a'),_0x255d4a[_0xeb1c('0x4d')]['id']);for(var _0x239a4a=0x0;_0x239a4a<_0xfaf1a8['length'];_0x239a4a+=0x1){let _0x66bb4e=_0xfaf1a8[_0x239a4a];for(var _0x49b521=0x0;_0x49b521<_0x66bb4e[_0xeb1c('0x6a')]['length'];_0x49b521+=0x1){let _0x3cd7a8=_0x66bb4e[_0xeb1c('0x6a')][_0x49b521];var _0x855820=_0x1eee48[_0xeb1c('0x7b')]();_0x855820['where'](_0xeb1c('0x7c'),_0x3cd7a8['id']);_0x3efcfb[_0xeb1c('0x7d')](db[_0xeb1c('0x6e')]['query'](_0x855820[_0xeb1c('0x7e')](),{'type':db[_0xeb1c('0x6e')][_0xeb1c('0x7f')]['SELECT']})[_0xeb1c('0x28')](function(_0x39777b){if(_0x39777b[_0xeb1c('0x3b')]===0x1){return _0x3cd7a8['id'];}else{var _0xf92a00=_[_0xeb1c('0x80')](_['map'](_0x39777b,_0xeb1c('0x81')),function(_0x2d9c61){return _['includes'](_0x190c4d,_0x2d9c61);});if(_0xf92a00){return _0x3cd7a8['id'];}}}));}}return BPromise[_0xeb1c('0x82')](_0x3efcfb)['then'](function(_0x40123d){_0x42156e=_(_0x42156e)[_0xeb1c('0x83')](_0x40123d)[_0xeb1c('0x84')]()['value']();return db[_0xeb1c('0x32')][_0xeb1c('0x57')]({'where':{'id':_0x255d4a['params']['id']}})['then'](function(_0x944261){return db[_0xeb1c('0x6e')]['transaction'](function(_0x5a01db){return _0x944261['removeTeams'](_0x255d4a[_0xeb1c('0x36')][_0xeb1c('0x68')],{'transaction':_0x5a01db})[_0xeb1c('0x28')](function(){if(!_[_0xeb1c('0x85')](_0x42156e)){return _0x944261[_0xeb1c('0x86')](_0x42156e,{'transaction':_0x5a01db});}})[_0xeb1c('0x28')](function(){_0x42156e[_0xeb1c('0x71')](function(_0x327f46){socket['emit'](_0xeb1c('0x87'),{'UserId':_0x327f46,'FaxQueueId':_0x944261['id']});});});});});});})[_0xeb1c('0x28')](respondWithStatusCode(_0x1279ac,null))[_0xeb1c('0x4b')](handleError(_0x1279ac,null));};exports[_0xeb1c('0x88')]=function(_0xb27cae,_0x133757,_0x3b6e59){return db[_0xeb1c('0x32')][_0xeb1c('0x57')]({'where':{'id':_0xb27cae[_0xeb1c('0x4d')]['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0x133757,null))[_0xeb1c('0x28')](function(_0xeed95c){if(_0xeed95c){return _0xeed95c['addAgents'](_0xb27cae[_0xeb1c('0x4f')][_0xeb1c('0x68')],_['omit'](_0xb27cae[_0xeb1c('0x4f')],[_0xeb1c('0x68'),'id'])||{})[_0xeb1c('0x89')](function(_0x300123){for(var _0x54eadf=0x0;_0x54eadf<_0xb27cae[_0xeb1c('0x4f')][_0xeb1c('0x68')][_0xeb1c('0x3b')];_0x54eadf+=0x1){socket[_0xeb1c('0x72')](_0xeb1c('0x73'),{'UserId':Number(_0xb27cae['body'][_0xeb1c('0x68')][_0x54eadf]),'FaxQueueId':Number(_0xb27cae['params']['id'])});}return _0x300123;});}})[_0xeb1c('0x28')](respondWithResult(_0x133757,null))[_0xeb1c('0x4b')](handleError(_0x133757,null));};exports[_0xeb1c('0x86')]=function(_0x4d293d,_0x5d4fc9,_0x41c4c3){return db[_0xeb1c('0x32')][_0xeb1c('0x57')]({'where':{'id':_0x4d293d[_0xeb1c('0x4d')]['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0x5d4fc9,null))['then'](function(_0x32ad73){if(_0x32ad73){return _0x32ad73['removeAgents'](_0x4d293d[_0xeb1c('0x36')][_0xeb1c('0x68')])[_0xeb1c('0x28')](function(){if(_[_0xeb1c('0x8a')](_0x4d293d[_0xeb1c('0x36')]['ids'])){for(var _0x586886=0x0;_0x586886<_0x4d293d[_0xeb1c('0x36')][_0xeb1c('0x68')][_0xeb1c('0x3b')];_0x586886+=0x1){socket[_0xeb1c('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x4d293d[_0xeb1c('0x36')]['ids'][_0x586886]),'FaxQueueId':Number(_0x4d293d[_0xeb1c('0x4d')]['id'])});}}else{socket[_0xeb1c('0x72')](_0xeb1c('0x87'),{'UserId':Number(_0x4d293d[_0xeb1c('0x36')][_0xeb1c('0x68')]),'FaxQueueId':Number(_0x4d293d[_0xeb1c('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d4fc9,null))[_0xeb1c('0x4b')](handleError(_0x5d4fc9,null));};exports[_0xeb1c('0x8b')]=function(_0x46e4d7,_0x1d2556,_0x184aed){var _0x45c326={};var _0x1b91c9={};var _0x18f07b;var _0x572663;return db[_0xeb1c('0x32')]['findOne']({'where':{'id':_0x46e4d7['params']['id']}})[_0xeb1c('0x28')](handleEntityNotFound(_0x1d2556,null))[_0xeb1c('0x28')](function(_0x11c0e8){if(_0x11c0e8){_0x18f07b=_0x11c0e8;_0x1b91c9[_0xeb1c('0x35')]=_[_0xeb1c('0x37')](db['User']['rawAttributes']);_0x1b91c9[_0xeb1c('0x36')]=_[_0xeb1c('0x37')](_0x46e4d7[_0xeb1c('0x36')]);_0x1b91c9[_0xeb1c('0x41')]=_['intersection'](_0x1b91c9[_0xeb1c('0x35')],_0x1b91c9[_0xeb1c('0x36')]);_0x45c326[_0xeb1c('0x3a')]=_[_0xeb1c('0x38')](_0x1b91c9[_0xeb1c('0x35')],qs[_0xeb1c('0x39')](_0x46e4d7['query'][_0xeb1c('0x39')]));_0x45c326['attributes']=_0x45c326[_0xeb1c('0x3a')][_0xeb1c('0x3b')]?_0x45c326[_0xeb1c('0x3a')]:_0x1b91c9[_0xeb1c('0x35')];_0x45c326[_0xeb1c('0x3e')]=qs[_0xeb1c('0x3f')](_0x46e4d7[_0xeb1c('0x36')]['sort']);_0x45c326[_0xeb1c('0x40')]=qs[_0xeb1c('0x41')](_[_0xeb1c('0x42')](_0x46e4d7[_0xeb1c('0x36')],_0x1b91c9['filters']));if(_0x46e4d7[_0xeb1c('0x36')][_0xeb1c('0x43')]){_0x45c326[_0xeb1c('0x40')]=_[_0xeb1c('0x44')](_0x45c326['where'],{'$or':_[_0xeb1c('0x31')](_0x45c326[_0xeb1c('0x3a')],function(_0x52390f){var _0x3b75d8={};_0x3b75d8[_0x52390f]={'$like':'%'+_0x46e4d7['query'][_0xeb1c('0x43')]+'%'};return _0x3b75d8;})});}_0x45c326=_['merge']({},_0x45c326,_0x46e4d7[_0xeb1c('0x46')]);return _0x18f07b[_0xeb1c('0x8b')](_0x45c326);}})[_0xeb1c('0x28')](function(_0x140059){if(_0x140059){_0x572663=_0x140059[_0xeb1c('0x3b')];if(!_0x46e4d7[_0xeb1c('0x36')][_0xeb1c('0x3c')]('nolimit')){_0x45c326[_0xeb1c('0x1f')]=qs[_0xeb1c('0x1f')](_0x46e4d7['query']['limit']);_0x45c326[_0xeb1c('0x1e')]=qs[_0xeb1c('0x1e')](_0x46e4d7[_0xeb1c('0x36')][_0xeb1c('0x1e')]);}return _0x18f07b[_0xeb1c('0x8b')](_0x45c326);}})[_0xeb1c('0x28')](function(_0x477083){if(_0x477083){return _0x477083?{'count':_0x572663,'rows':_0x477083}:null;}})[_0xeb1c('0x28')](respondWithResult(_0x1d2556,null))[_0xeb1c('0x4b')](handleError(_0x1d2556,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 5bf1c49..b283487 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 _0x6fb1=['hook','events','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2d29c6,_0x479187){var _0x1363e7=function(_0x440d7a){while(--_0x440d7a){_0x2d29c6['push'](_0x2d29c6['shift']());}};_0x1363e7(++_0x479187);}(_0x6fb1,0xb1));var _0x16fb=function(_0x175bdc,_0x18d6c7){_0x175bdc=_0x175bdc-0x0;var _0x2d6f88=_0x6fb1[_0x175bdc];return _0x2d6f88;};'use strict';var EventEmitter=require(_0x16fb('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x16fb('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x16fb('0x2')](0x0);var events={'afterCreate':_0x16fb('0x3'),'afterUpdate':_0x16fb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7c6381){return function(_0x1b7cc9,_0x39e272,_0x25bce8){FaxQueueEvents[_0x16fb('0x5')](_0x7c6381+':'+_0x1b7cc9['id'],_0x1b7cc9);FaxQueueEvents[_0x16fb('0x5')](_0x7c6381,_0x1b7cc9);_0x25bce8(null);};}for(var e in events){if(events[_0x16fb('0x6')](e)){var event=events[e];FaxQueue[_0x16fb('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xa6e7=['setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x39cd2e,_0x3f44bf){var _0x24f526=function(_0x3723c9){while(--_0x3723c9){_0x39cd2e['push'](_0x39cd2e['shift']());}};_0x24f526(++_0x3f44bf);}(_0xa6e7,0x9d));var _0x7a6e=function(_0x1d4df0,_0x433fd5){_0x1d4df0=_0x1d4df0-0x0;var _0x34f3d3=_0xa6e7[_0x1d4df0];return _0x34f3d3;};'use strict';var EventEmitter=require(_0x7a6e('0x0'));var FaxQueue=require(_0x7a6e('0x1'))['db'][_0x7a6e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7a6e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7a6e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47c9a1){return function(_0x5b1ee8,_0x37c946,_0x49887b){FaxQueueEvents[_0x7a6e('0x5')](_0x47c9a1+':'+_0x5b1ee8['id'],_0x5b1ee8);FaxQueueEvents[_0x7a6e('0x5')](_0x47c9a1,_0x5b1ee8);_0x49887b(null);};}for(var e in events){if(events[_0x7a6e('0x6')](e)){var event=events[e];FaxQueue[_0x7a6e('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 6361403..e2960c6 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 _0x43e3=['fax_queues','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x43e3,0x182));var _0x343e=function(_0x5d99ad,_0x15d2b5){_0x5d99ad=_0x5d99ad-0x0;var _0x453124=_0x43e3[_0x5d99ad];return _0x453124;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x343e('0x0'))(_0x343e('0x1'));var moment=require(_0x343e('0x2'));var BPromise=require('bluebird');var rp=require(_0x343e('0x3'));var fs=require('fs');var path=require(_0x343e('0x4'));var rimraf=require(_0x343e('0x5'));var config=require(_0x343e('0x6'));var attributes=require(_0x343e('0x7'));module['exports']=function(_0x12f34c,_0x5d5c45){return _0x12f34c[_0x343e('0x8')](_0x343e('0x9'),attributes,{'tableName':_0x343e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c76=['moment','bluebird','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0x3e2fd0,_0x210388){var _0x207ac3=function(_0x439bda){while(--_0x439bda){_0x3e2fd0['push'](_0x3e2fd0['shift']());}};_0x207ac3(++_0x210388);}(_0x8c76,0x8c));var _0x68c7=function(_0x398d0b,_0x5b4614){_0x398d0b=_0x398d0b-0x0;var _0x279d65=_0x8c76[_0x398d0b];return _0x279d65;};'use strict';var _=require(_0x68c7('0x0'));var util=require(_0x68c7('0x1'));var logger=require(_0x68c7('0x2'))('api');var moment=require(_0x68c7('0x3'));var BPromise=require(_0x68c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x68c7('0x5'));var config=require(_0x68c7('0x6'));var attributes=require('./faxQueue.attributes');module[_0x68c7('0x7')]=function(_0x35a007,_0x207580){return _0x35a007[_0x68c7('0x8')](_0x68c7('0x9'),attributes,{'tableName':_0x68c7('0xa'),'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 6c9229b..4b38d34 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 _0xa091=['then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxQueue','findAll','raw','options','attributes','limit','include','map','GetFaxQueue','debug','catch','ShowFaxQueue','find','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','request'];(function(_0x218912,_0x313c41){var _0x5c2ce3=function(_0x369ed9){while(--_0x369ed9){_0x218912['push'](_0x218912['shift']());}};_0x5c2ce3(++_0x313c41);}(_0xa091,0xae));var _0x1a09=function(_0x54f605,_0x2fdb29){_0x54f605=_0x54f605-0x0;var _0x43a9ac=_0xa091[_0x54f605];return _0x43a9ac;};'use strict';var _=require('lodash');var util=require(_0x1a09('0x0'));var moment=require(_0x1a09('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a09('0x2'));var fs=require('fs');var Redis=require(_0x1a09('0x3'));var db=require(_0x1a09('0x4'))['db'];var utils=require(_0x1a09('0x5'));var logger=require(_0x1a09('0x6'))('rpc');var config=require(_0x1a09('0x7'));var jayson=require(_0x1a09('0x8'));var client=jayson[_0x1a09('0x9')][_0x1a09('0xa')]({'port':0x232a});config[_0x1a09('0xb')]=_['defaults'](config[_0x1a09('0xb')],{'host':_0x1a09('0xc'),'port':0x18eb});var socket=require(_0x1a09('0xd'))(new Redis(config[_0x1a09('0xb')]));require(_0x1a09('0xe'))['register'](socket);function respondWithRpcPromise(_0x540766,_0x2ed413,_0x4b52be){return new BPromise(function(_0x4f6695,_0x479d31){return client[_0x1a09('0xf')](_0x540766,_0x4b52be)[_0x1a09('0x10')](function(_0x4df99b){logger[_0x1a09('0x11')](_0x1a09('0x12'),_0x2ed413,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2ed413,_0x1a09('0x13'),JSON[_0x1a09('0x14')](_0x4df99b));if(_0x4df99b[_0x1a09('0x15')]){if(_0x4df99b['error'][_0x1a09('0x16')]===0x1f4){logger[_0x1a09('0x15')]('FaxQueue,\x20%s,\x20%s',_0x2ed413,_0x4df99b[_0x1a09('0x15')]['message']);return _0x479d31(_0x4df99b['error']['message']);}logger[_0x1a09('0x15')]('FaxQueue,\x20%s,\x20%s',_0x2ed413,_0x4df99b['error'][_0x1a09('0x17')]);return _0x4f6695(_0x4df99b['error'][_0x1a09('0x17')]);}else{logger[_0x1a09('0x11')](_0x1a09('0x12'),_0x2ed413,_0x1a09('0x13'));_0x4f6695(_0x4df99b['result'][_0x1a09('0x17')]);}})['catch'](function(_0xe5a5ff){logger[_0x1a09('0x15')](_0x1a09('0x12'),_0x2ed413,_0xe5a5ff);_0x479d31(_0xe5a5ff);});});}exports['GetFaxQueue']=function(_0x1abbd5){var _0x373007=this;return new Promise(function(_0x57e2a6,_0x4a36d6){return db[_0x1a09('0x18')][_0x1a09('0x19')]({'raw':_0x1abbd5['options']?_0x1abbd5['options'][_0x1a09('0x1a')]===undefined?!![]:![]:!![],'where':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')]['where']||null:null,'attributes':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1c')]||null:null,'limit':_0x1abbd5[_0x1a09('0x1b')]?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1d')]||null:null,'include':_0x1abbd5['options']?_0x1abbd5[_0x1a09('0x1b')][_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x1abbd5['options']['include'],function(_0xbed326){return{'model':db[_0xbed326['model']],'as':_0xbed326['as'],'attributes':_0xbed326[_0x1a09('0x1c')],'include':_0xbed326[_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0xbed326[_0x1a09('0x1e')],function(_0x44f6ed){return{'model':db[_0x44f6ed['model']],'as':_0x44f6ed['as'],'attributes':_0x44f6ed[_0x1a09('0x1c')],'include':_0x44f6ed[_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x44f6ed[_0x1a09('0x1e')],function(_0x45c791){return{'model':db[_0x45c791['model']],'as':_0x45c791['as'],'attributes':_0x45c791['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a09('0x10')](function(_0x11d29d){logger[_0x1a09('0x11')](_0x1a09('0x20'),_0x1abbd5);logger[_0x1a09('0x21')](_0x1a09('0x20'),_0x1abbd5,JSON[_0x1a09('0x14')](_0x11d29d));_0x57e2a6(_0x11d29d);})[_0x1a09('0x22')](function(_0x36f51a){logger[_0x1a09('0x15')](_0x1a09('0x20'),_0x36f51a[_0x1a09('0x17')],_0x1abbd5);_0x4a36d6(_0x373007['error'](0x1f4,_0x36f51a[_0x1a09('0x17')]));});});};exports[_0x1a09('0x23')]=function(_0x127e7a){var _0x338935=this;return new Promise(function(_0x480e45,_0x59e5d3){return db['FaxQueue'][_0x1a09('0x24')]({'raw':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a['options']['raw']===undefined?!![]:![]:!![],'where':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')]['where']||null:null,'attributes':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')][_0x1a09('0x1c')]||null:null,'include':_0x127e7a[_0x1a09('0x1b')]?_0x127e7a[_0x1a09('0x1b')][_0x1a09('0x1e')]?_[_0x1a09('0x1f')](_0x127e7a[_0x1a09('0x1b')]['include'],function(_0x2bd287){return{'model':db[_0x2bd287['model']],'as':_0x2bd287['as'],'attributes':_0x2bd287['attributes'],'include':_0x2bd287['include']?_[_0x1a09('0x1f')](_0x2bd287[_0x1a09('0x1e')],function(_0x41e592){return{'model':db[_0x41e592[_0x1a09('0x25')]],'as':_0x41e592['as'],'attributes':_0x41e592[_0x1a09('0x1c')],'include':_0x41e592[_0x1a09('0x1e')]?_['map'](_0x41e592[_0x1a09('0x1e')],function(_0x468eb3){return{'model':db[_0x468eb3[_0x1a09('0x25')]],'as':_0x468eb3['as'],'attributes':_0x468eb3[_0x1a09('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a09('0x10')](function(_0x5b1f09){logger[_0x1a09('0x11')](_0x1a09('0x23'),_0x127e7a);logger['debug'](_0x1a09('0x23'),_0x127e7a,JSON[_0x1a09('0x14')](_0x5b1f09));_0x480e45(_0x5b1f09);})[_0x1a09('0x22')](function(_0xb2b016){logger[_0x1a09('0x15')](_0x1a09('0x23'),_0xb2b016['message'],_0x127e7a);_0x59e5d3(_0x338935[_0x1a09('0x15')](0x1f4,_0xb2b016['message']));});});}; \ No newline at end of file +var _0x124b=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetFaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b077a,_0x232369){var _0x437a54=function(_0x1afd62){while(--_0x1afd62){_0x1b077a['push'](_0x1b077a['shift']());}};_0x437a54(++_0x232369);}(_0x124b,0xbd));var _0xb124=function(_0x32f582,_0x2ac357){_0x32f582=_0x32f582-0x0;var _0x1cbfa0=_0x124b[_0x32f582];return _0x1cbfa0;};'use strict';var _=require('lodash');var util=require(_0xb124('0x0'));var moment=require(_0xb124('0x1'));var BPromise=require(_0xb124('0x2'));var rs=require(_0xb124('0x3'));var fs=require('fs');var Redis=require(_0xb124('0x4'));var db=require(_0xb124('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb124('0x6'))(_0xb124('0x7'));var config=require(_0xb124('0x8'));var jayson=require(_0xb124('0x9'));var client=jayson[_0xb124('0xa')]['http']({'port':0x232a});config[_0xb124('0xb')]=_[_0xb124('0xc')](config[_0xb124('0xb')],{'host':_0xb124('0xd'),'port':0x18eb});var socket=require(_0xb124('0xe'))(new Redis(config[_0xb124('0xb')]));require('./faxQueue.socket')[_0xb124('0xf')](socket);function respondWithRpcPromise(_0x2b5b65,_0x2527c0,_0x2d1c2e){return new BPromise(function(_0x5d9468,_0x4e719d){return client[_0xb124('0x10')](_0x2b5b65,_0x2d1c2e)[_0xb124('0x11')](function(_0x1553be){logger[_0xb124('0x12')](_0xb124('0x13'),_0x2527c0,'request\x20sent');logger[_0xb124('0x14')](_0xb124('0x15'),_0x2527c0,'request\x20sent',JSON[_0xb124('0x16')](_0x1553be));if(_0x1553be['error']){if(_0x1553be['error']['code']===0x1f4){logger['error'](_0xb124('0x13'),_0x2527c0,_0x1553be[_0xb124('0x17')]['message']);return _0x4e719d(_0x1553be[_0xb124('0x17')][_0xb124('0x18')]);}logger[_0xb124('0x17')](_0xb124('0x13'),_0x2527c0,_0x1553be[_0xb124('0x17')]['message']);return _0x5d9468(_0x1553be[_0xb124('0x17')]['message']);}else{logger['info'](_0xb124('0x13'),_0x2527c0,_0xb124('0x19'));_0x5d9468(_0x1553be[_0xb124('0x1a')][_0xb124('0x18')]);}})['catch'](function(_0x34250e){logger[_0xb124('0x17')](_0xb124('0x13'),_0x2527c0,_0x34250e);_0x4e719d(_0x34250e);});});}exports[_0xb124('0x1b')]=function(_0x5827ef){var _0x5ec71e=this;return new Promise(function(_0x49ed81,_0x21b5c9){return db['FaxQueue'][_0xb124('0x1c')]({'raw':_0x5827ef[_0xb124('0x1d')]?_0x5827ef[_0xb124('0x1d')][_0xb124('0x1e')]===undefined?!![]:![]:!![],'where':_0x5827ef[_0xb124('0x1d')]?_0x5827ef[_0xb124('0x1d')][_0xb124('0x1f')]||null:null,'attributes':_0x5827ef['options']?_0x5827ef[_0xb124('0x1d')]['attributes']||null:null,'limit':_0x5827ef[_0xb124('0x1d')]?_0x5827ef['options'][_0xb124('0x20')]||null:null,'include':_0x5827ef[_0xb124('0x1d')]?_0x5827ef['options'][_0xb124('0x21')]?_[_0xb124('0x22')](_0x5827ef[_0xb124('0x1d')][_0xb124('0x21')],function(_0x30bf04){return{'model':db[_0x30bf04[_0xb124('0x23')]],'as':_0x30bf04['as'],'attributes':_0x30bf04[_0xb124('0x24')],'include':_0x30bf04['include']?_[_0xb124('0x22')](_0x30bf04['include'],function(_0x2256a1){return{'model':db[_0x2256a1[_0xb124('0x23')]],'as':_0x2256a1['as'],'attributes':_0x2256a1[_0xb124('0x24')],'include':_0x2256a1['include']?_[_0xb124('0x22')](_0x2256a1[_0xb124('0x21')],function(_0x320f24){return{'model':db[_0x320f24[_0xb124('0x23')]],'as':_0x320f24['as'],'attributes':_0x320f24[_0xb124('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295384){logger['info']('GetFaxQueue',_0x5827ef);logger[_0xb124('0x14')](_0xb124('0x1b'),_0x5827ef,JSON[_0xb124('0x16')](_0x295384));_0x49ed81(_0x295384);})[_0xb124('0x25')](function(_0x48b4be){logger[_0xb124('0x17')](_0xb124('0x1b'),_0x48b4be[_0xb124('0x18')],_0x5827ef);_0x21b5c9(_0x5ec71e[_0xb124('0x17')](0x1f4,_0x48b4be[_0xb124('0x18')]));});});};exports[_0xb124('0x26')]=function(_0x5a1ad0){var _0x4b4b5c=this;return new Promise(function(_0x5b756d,_0x5171f8){return db['FaxQueue'][_0xb124('0x27')]({'raw':_0x5a1ad0[_0xb124('0x1d')]?_0x5a1ad0['options'][_0xb124('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a1ad0['options']?_0x5a1ad0[_0xb124('0x1d')]['where']||null:null,'attributes':_0x5a1ad0[_0xb124('0x1d')]?_0x5a1ad0['options'][_0xb124('0x24')]||null:null,'include':_0x5a1ad0[_0xb124('0x1d')]?_0x5a1ad0['options']['include']?_[_0xb124('0x22')](_0x5a1ad0[_0xb124('0x1d')][_0xb124('0x21')],function(_0x498042){return{'model':db[_0x498042['model']],'as':_0x498042['as'],'attributes':_0x498042['attributes'],'include':_0x498042['include']?_[_0xb124('0x22')](_0x498042[_0xb124('0x21')],function(_0x7c5d39){return{'model':db[_0x7c5d39['model']],'as':_0x7c5d39['as'],'attributes':_0x7c5d39[_0xb124('0x24')],'include':_0x7c5d39['include']?_[_0xb124('0x22')](_0x7c5d39[_0xb124('0x21')],function(_0xd629e){return{'model':db[_0xd629e[_0xb124('0x23')]],'as':_0xd629e['as'],'attributes':_0xd629e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb124('0x11')](function(_0x5ea424){logger[_0xb124('0x12')]('ShowFaxQueue',_0x5a1ad0);logger[_0xb124('0x14')](_0xb124('0x26'),_0x5a1ad0,JSON[_0xb124('0x16')](_0x5ea424));_0x5b756d(_0x5ea424);})[_0xb124('0x25')](function(_0x4350b8){logger['error'](_0xb124('0x26'),_0x4350b8[_0xb124('0x18')],_0x5a1ad0);_0x5171f8(_0x4b4b5c['error'](0x1f4,_0x4350b8[_0xb124('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9d0fac4..650cb9e 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 _0xbccb=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2d36bf,_0x3bfcd6){var _0x293ad3=function(_0x5ab295){while(--_0x5ab295){_0x2d36bf['push'](_0x2d36bf['shift']());}};_0x293ad3(++_0x3bfcd6);}(_0xbccb,0x157));var _0xbbcc=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0xbccb[_0x34a087];return _0x5c15d7;};'use strict';var FaxQueueEvents=require(_0xbbcc('0x0'));var events=[_0xbbcc('0x1'),_0xbbcc('0x2'),_0xbbcc('0x3')];function createListener(_0x5ba09d,_0x3edfb4){return function(_0x4315d0){_0x3edfb4[_0xbbcc('0x4')](_0x5ba09d,_0x4315d0);};}function removeListener(_0x37c840,_0x1d534d){return function(){FaxQueueEvents[_0xbbcc('0x5')](_0x37c840,_0x1d534d);};}exports[_0xbbcc('0x6')]=function(_0x2ddc03){for(var _0x57f169=0x0,_0xc6f889=events[_0xbbcc('0x7')];_0x57f169<_0xc6f889;_0x57f169++){var _0x2379ab=events[_0x57f169];var _0x2d090e=createListener(_0xbbcc('0x8')+_0x2379ab,_0x2ddc03);FaxQueueEvents['on'](_0x2379ab,_0x2d090e);}}; \ No newline at end of file +var _0xb170=['remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x35ccfa,_0x2acd94){var _0x53cda4=function(_0x4b57db){while(--_0x4b57db){_0x35ccfa['push'](_0x35ccfa['shift']());}};_0x53cda4(++_0x2acd94);}(_0xb170,0xbd));var _0x0b17=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb170[_0x321bb2];return _0x9c12ed;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x0b17('0x0'),_0x0b17('0x1')];function createListener(_0x4a37a7,_0x5e2cdd){return function(_0x3b54a9){_0x5e2cdd[_0x0b17('0x2')](_0x4a37a7,_0x3b54a9);};}function removeListener(_0x547260,_0x2eae0a){return function(){FaxQueueEvents[_0x0b17('0x3')](_0x547260,_0x2eae0a);};}exports[_0x0b17('0x4')]=function(_0x1eb7c3){for(var _0x170093=0x0,_0x499bc2=events[_0x0b17('0x5')];_0x170093<_0x499bc2;_0x170093++){var _0x120029=events[_0x170093];var _0x20041f=createListener(_0x0b17('0x6')+_0x120029,_0x1eb7c3);FaxQueueEvents['on'](_0x120029,_0x20041f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3c6b1e6..2cb7b7a 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 _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0x4adce1,_0x41d240){var _0x9110fa=function(_0x4c3c85){while(--_0x4c3c85){_0x4adce1['push'](_0x4adce1['shift']());}};_0x9110fa(++_0x41d240);}(_0xef17,0x136));var _0x7ef1=function(_0xa0e64,_0x2dc25b){_0xa0e64=_0xa0e64-0x0;var _0x73fd92=_0xef17[_0xa0e64];return _0x73fd92;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router; \ No newline at end of file +var _0x5f6f=['get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller'];(function(_0x443c31,_0x552a80){var _0x31a18c=function(_0x2bd774){while(--_0x2bd774){_0x443c31['push'](_0x443c31['shift']());}};_0x31a18c(++_0x552a80);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x4f7d1,_0x50fa31){_0x4f7d1=_0x4f7d1-0x0;var _0x5ce698=_0x5f6f[_0x4f7d1];return _0x5ce698;};'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/members',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xf')]);router['get'](_0xf5f6('0x10'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x11')]);router[_0xf5f6('0x9')](_0xf5f6('0x12'),auth['isAuthenticated'](),controller[_0xf5f6('0x13')]);router['post']('/',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x14')]);router[_0xf5f6('0x15')](_0xf5f6('0x10'),auth['isAuthenticated'](),controller[_0xf5f6('0x16')]);router[_0xf5f6('0x15')](_0xf5f6('0x12'),auth[_0xf5f6('0xa')](),controller['addAgents']);router[_0xf5f6('0x17')](_0xf5f6('0xd'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x18')]);router['delete']('/:id',auth[_0xf5f6('0xa')](),controller['destroy']);router[_0xf5f6('0x19')]('/:id/teams',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x1a')]);router[_0xf5f6('0x19')](_0xf5f6('0x12'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3cdfe60..063db95 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 _0xf46b=['DATE','moment','sequelize','exports','STRING'];(function(_0x526631,_0x36130d){var _0x3c0945=function(_0x4095a3){while(--_0x4095a3){_0x526631['push'](_0x526631['shift']());}};_0x3c0945(++_0x36130d);}(_0xf46b,0x11e));var _0xbf46=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf46b[_0x27af45];return _0x18df21;};'use strict';var moment=require(_0xbf46('0x0'));var Sequelize=require(_0xbf46('0x1'));module[_0xbf46('0x2')]={'uniqueid':{'type':Sequelize[_0xbf46('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbf46('0x4')]},'leaveAt':{'type':Sequelize[_0xbf46('0x4')]},'acceptAt':{'type':Sequelize[_0xbf46('0x4')]},'exitAt':{'type':Sequelize[_0xbf46('0x4')]},'reason':{'type':Sequelize[_0xbf46('0x3')]}}; \ No newline at end of file +var _0x55cd=['exports','STRING','DATE'];(function(_0x28b207,_0x394906){var _0x1aeed1=function(_0x8e5221){while(--_0x8e5221){_0x28b207['push'](_0x28b207['shift']());}};_0x1aeed1(++_0x394906);}(_0x55cd,0xdb));var _0xd55c=function(_0x4a4e59,_0x488469){_0x4a4e59=_0x4a4e59-0x0;var _0x4a7c90=_0x55cd[_0x4a4e59];return _0x4a7c90;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd55c('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd55c('0x1')]},'joinAt':{'type':Sequelize[_0xd55c('0x2')]},'leaveAt':{'type':Sequelize[_0xd55c('0x2')]},'acceptAt':{'type':Sequelize[_0xd55c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd55c('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a2de25a..e253f69 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 _0xf72b=['catch','params','find','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0xf72b,0x1d9));var _0xbf72=function(_0x10e601,_0x143e7c){_0x10e601=_0x10e601-0x0;var _0x4552e6=_0xf72b[_0x10e601];return _0x4552e6;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf72('0x2'));var moment=require(_0xbf72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbf72('0x4'));var util=require(_0xbf72('0x5'));var path=require(_0xbf72('0x6'));var sox=require(_0xbf72('0x7'));var csv=require(_0xbf72('0x8'));var ejs=require(_0xbf72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf72('0xa'));var squel=require(_0xbf72('0xb'));var crypto=require(_0xbf72('0xc'));var jsforce=require(_0xbf72('0xd'));var deskjs=require(_0xbf72('0xe'));var toCsv=require(_0xbf72('0x8'));var querystring=require('querystring');var Papa=require(_0xbf72('0xf'));var Redis=require('ioredis');var authService=require(_0xbf72('0x10'));var qs=require(_0xbf72('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf72('0x12'));var logger=require(_0xbf72('0x13'))(_0xbf72('0x14'));var utils=require(_0xbf72('0x15'));var config=require(_0xbf72('0x16'));var licenseUtil=require(_0xbf72('0x17'));var db=require(_0xbf72('0x18'))['db'];function respondWithStatusCode(_0x5eb4cc,_0x5967f5){_0x5967f5=_0x5967f5||0xcc;return function(_0x3bd500){if(_0x3bd500){return _0x5eb4cc[_0xbf72('0x19')](_0x5967f5);}return _0x5eb4cc[_0xbf72('0x1a')](_0x5967f5)['end']();};}function respondWithResult(_0x25255e,_0x4f4fa5){_0x4f4fa5=_0x4f4fa5||0xc8;return function(_0x5625b3){if(_0x5625b3){return _0x25255e['status'](_0x4f4fa5)[_0xbf72('0x1b')](_0x5625b3);}};}function respondWithFilteredResult(_0xb96906,_0x3af48d){return function(_0x723eb1){if(_0x723eb1){var _0x39d0cd=typeof _0x3af48d[_0xbf72('0x1c')]==='undefined'&&typeof _0x3af48d[_0xbf72('0x1d')]===_0xbf72('0x1e');var _0x2a8609=_0x723eb1[_0xbf72('0x1f')];var _0x27dadc=_0x39d0cd?0x0:_0x3af48d['offset'];var _0x51d4c9=_0x39d0cd?_0x723eb1[_0xbf72('0x1f')]:_0x3af48d[_0xbf72('0x1c')]+_0x3af48d[_0xbf72('0x1d')];var _0x2584d9;if(_0x51d4c9>=_0x2a8609){_0x51d4c9=_0x2a8609;_0x2584d9=0xc8;}else{_0x2584d9=0xce;}_0xb96906[_0xbf72('0x1a')](_0x2584d9);return _0xb96906[_0xbf72('0x20')](_0xbf72('0x21'),_0x27dadc+'-'+_0x51d4c9+'/'+_0x2a8609)['json'](_0x723eb1);}return null;};}function patchUpdates(_0x2aecae){return function(_0x42a193){try{jsonpatch[_0xbf72('0x22')](_0x42a193,_0x2aecae,!![]);}catch(_0x200139){return BPromise[_0xbf72('0x23')](_0x200139);}return _0x42a193['save']();};}function saveUpdates(_0x3cd181,_0x1de926){return function(_0x536071){if(_0x536071){return _0x536071[_0xbf72('0x24')](_0x3cd181)[_0xbf72('0x25')](function(_0x267c41){return _0x267c41;});}return null;};}function removeEntity(_0x4c7f3d,_0x44f3f9){return function(_0x428361){if(_0x428361){return _0x428361[_0xbf72('0x26')]()[_0xbf72('0x25')](function(){_0x4c7f3d['status'](0xcc)[_0xbf72('0x27')]();});}};}function handleEntityNotFound(_0x392a8c,_0x1c8b8b){return function(_0x54fdfe){if(!_0x54fdfe){_0x392a8c[_0xbf72('0x19')](0x194);}return _0x54fdfe;};}function handleError(_0xd8fefc,_0x3df816){_0x3df816=_0x3df816||0x1f4;return function(_0x1a2f55){logger[_0xbf72('0x28')](_0x1a2f55[_0xbf72('0x29')]);if(_0x1a2f55[_0xbf72('0x2a')]){delete _0x1a2f55[_0xbf72('0x2a')];}_0xd8fefc[_0xbf72('0x1a')](_0x3df816)[_0xbf72('0x2b')](_0x1a2f55);};}exports[_0xbf72('0x2c')]=function(_0x20e747,_0x4a6ccf){var _0xb648f2={},_0x37a233={},_0x51f481={'count':0x0,'rows':[]};var _0x708fcb=_[_0xbf72('0x2d')](db[_0xbf72('0x2e')][_0xbf72('0x2f')],function(_0xb1ee4e){return{'name':_0xb1ee4e[_0xbf72('0x30')],'type':_0xb1ee4e[_0xbf72('0x31')][_0xbf72('0x32')]};});_0x37a233[_0xbf72('0x33')]=_[_0xbf72('0x2d')](_0x708fcb,_0xbf72('0x2a'));_0x37a233[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x20e747[_0xbf72('0x34')]);_0x37a233['filters']=_[_0xbf72('0x36')](_0x37a233[_0xbf72('0x33')],_0x37a233[_0xbf72('0x34')]);_0xb648f2['attributes']=_['intersection'](_0x37a233['model'],qs[_0xbf72('0x37')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x37')]));_0xb648f2['attributes']=_0xb648f2[_0xbf72('0x38')][_0xbf72('0x39')]?_0xb648f2['attributes']:_0x37a233[_0xbf72('0x33')];if(!_0x20e747['query'][_0xbf72('0x3a')](_0xbf72('0x3b'))){_0xb648f2['limit']=qs['limit'](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1d')]);_0xb648f2[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x20e747[_0xbf72('0x34')][_0xbf72('0x1c')]);}_0xb648f2[_0xbf72('0x3c')]=qs[_0xbf72('0x3d')](_0x20e747[_0xbf72('0x34')]['sort']);_0xb648f2[_0xbf72('0x3e')]=qs[_0xbf72('0x3f')](_[_0xbf72('0x40')](_0x20e747[_0xbf72('0x34')],_0x37a233['filters']),_0x708fcb);if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x41')]){_0xb648f2['where']=_[_0xbf72('0x42')](_0xb648f2['where'],{'$or':_['map'](_0x708fcb,function(_0x515ae8){if(_0x515ae8['type']!==_0xbf72('0x43')){var _0x4ed723={};_0x4ed723[_0x515ae8['name']]={'$like':'%'+_0x20e747[_0xbf72('0x34')]['filter']+'%'};return _0x4ed723;}})});}_0xb648f2=_[_0xbf72('0x42')]({},_0xb648f2,_0x20e747[_0xbf72('0x44')]);var _0x4bc204={'where':_0xb648f2[_0xbf72('0x3e')]};return db['FaxQueueReport']['count'](_0x4bc204)[_0xbf72('0x25')](function(_0x13e1d6){_0x51f481[_0xbf72('0x1f')]=_0x13e1d6;if(_0x20e747[_0xbf72('0x34')][_0xbf72('0x45')]){_0xb648f2[_0xbf72('0x46')]=[{'all':!![]}];}return db[_0xbf72('0x2e')][_0xbf72('0x47')](_0xb648f2);})['then'](function(_0x311a0c){_0x51f481[_0xbf72('0x48')]=_0x311a0c;return _0x51f481;})['then'](respondWithFilteredResult(_0x4a6ccf,_0xb648f2))[_0xbf72('0x49')](handleError(_0x4a6ccf,null));};exports['show']=function(_0x5851b8,_0x396ff7){var _0x15e4c7={'raw':!![],'where':{'id':_0x5851b8[_0xbf72('0x4a')]['id']}},_0x3992fd={};_0x3992fd[_0xbf72('0x33')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x3992fd[_0xbf72('0x34')]=_[_0xbf72('0x35')](_0x5851b8[_0xbf72('0x34')]);_0x3992fd[_0xbf72('0x3f')]=_['intersection'](_0x3992fd['model'],_0x3992fd[_0xbf72('0x34')]);_0x15e4c7['attributes']=_[_0xbf72('0x36')](_0x3992fd[_0xbf72('0x33')],qs[_0xbf72('0x37')](_0x5851b8[_0xbf72('0x34')]['fields']));_0x15e4c7[_0xbf72('0x38')]=_0x15e4c7[_0xbf72('0x38')][_0xbf72('0x39')]?_0x15e4c7[_0xbf72('0x38')]:_0x3992fd['model'];if(_0x5851b8[_0xbf72('0x34')][_0xbf72('0x45')]){_0x15e4c7['include']=[{'all':!![]}];}_0x15e4c7=_[_0xbf72('0x42')]({},_0x15e4c7,_0x5851b8[_0xbf72('0x44')]);return db[_0xbf72('0x2e')][_0xbf72('0x4b')](_0x15e4c7)[_0xbf72('0x25')](handleEntityNotFound(_0x396ff7,null))[_0xbf72('0x25')](respondWithResult(_0x396ff7,null))[_0xbf72('0x49')](handleError(_0x396ff7,null));};exports['create']=function(_0x4ec7eb,_0x5b4bbb){return db[_0xbf72('0x2e')]['create'](_0x4ec7eb[_0xbf72('0x4c')],{})['then'](respondWithResult(_0x5b4bbb,0xc9))['catch'](handleError(_0x5b4bbb,null));};exports['update']=function(_0x9f94ea,_0x15a271){if(_0x9f94ea[_0xbf72('0x4c')]['id']){delete _0x9f94ea[_0xbf72('0x4c')]['id'];}return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x9f94ea['params']['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x15a271,null))['then'](saveUpdates(_0x9f94ea[_0xbf72('0x4c')],null))['then'](respondWithResult(_0x15a271,null))[_0xbf72('0x49')](handleError(_0x15a271,null));};exports[_0xbf72('0x26')]=function(_0x45e4d5,_0x1fd1f8){return db[_0xbf72('0x2e')][_0xbf72('0x4b')]({'where':{'id':_0x45e4d5[_0xbf72('0x4a')]['id']}})[_0xbf72('0x25')](handleEntityNotFound(_0x1fd1f8,null))[_0xbf72('0x25')](removeEntity(_0x1fd1f8,null))['catch'](handleError(_0x1fd1f8,null));};exports[_0xbf72('0x4d')]=function(_0x2f9816,_0x46f22e){return db['FaxQueueReport'][_0xbf72('0x4d')]()[_0xbf72('0x25')](respondWithResult(_0x46f22e,null))[_0xbf72('0x49')](handleError(_0x46f22e,null));}; \ No newline at end of file +var _0xf109=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','FaxQueueReport','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x1f88b3,_0x3560e0){var _0x5e0463=function(_0x8999c6){while(--_0x8999c6){_0x1f88b3['push'](_0x1f88b3['shift']());}};_0x5e0463(++_0x3560e0);}(_0xf109,0xce));var _0x9f10=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xf109[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x9f10('0x0'));var rimraf=require(_0x9f10('0x1'));var zipdir=require(_0x9f10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f10('0x3'));var Mustache=require(_0x9f10('0x4'));var util=require(_0x9f10('0x5'));var path=require(_0x9f10('0x6'));var sox=require(_0x9f10('0x7'));var csv=require(_0x9f10('0x8'));var ejs=require(_0x9f10('0x9'));var fs=require('fs');var fs_extra=require(_0x9f10('0xa'));var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x8'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var as=require(_0x9f10('0x13'));var hardwareService=require(_0x9f10('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9f10('0x15'));var config=require(_0x9f10('0x16'));var licenseUtil=require(_0x9f10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289164,_0x260606){_0x260606=_0x260606||0xcc;return function(_0x35c529){if(_0x35c529){return _0x289164['sendStatus'](_0x260606);}return _0x289164[_0x9f10('0x18')](_0x260606)[_0x9f10('0x19')]();};}function respondWithResult(_0x5be443,_0x40a48a){_0x40a48a=_0x40a48a||0xc8;return function(_0x236e28){if(_0x236e28){return _0x5be443['status'](_0x40a48a)['json'](_0x236e28);}};}function respondWithFilteredResult(_0x2b6c4c,_0x177918){return function(_0x549217){if(_0x549217){var _0x11154b=typeof _0x177918['offset']===_0x9f10('0x1a')&&typeof _0x177918[_0x9f10('0x1b')]==='undefined';var _0x11cc56=_0x549217[_0x9f10('0x1c')];var _0x509fba=_0x11154b?0x0:_0x177918[_0x9f10('0x1d')];var _0x53bfbd=_0x11154b?_0x549217[_0x9f10('0x1c')]:_0x177918['offset']+_0x177918[_0x9f10('0x1b')];var _0x56fb44;if(_0x53bfbd>=_0x11cc56){_0x53bfbd=_0x11cc56;_0x56fb44=0xc8;}else{_0x56fb44=0xce;}_0x2b6c4c['status'](_0x56fb44);return _0x2b6c4c[_0x9f10('0x1e')](_0x9f10('0x1f'),_0x509fba+'-'+_0x53bfbd+'/'+_0x11cc56)[_0x9f10('0x20')](_0x549217);}return null;};}function patchUpdates(_0x3a78be){return function(_0xa810c){try{jsonpatch[_0x9f10('0x21')](_0xa810c,_0x3a78be,!![]);}catch(_0x27843d){return BPromise['reject'](_0x27843d);}return _0xa810c[_0x9f10('0x22')]();};}function saveUpdates(_0x58e6ba,_0x293990){return function(_0x36ace4){if(_0x36ace4){return _0x36ace4[_0x9f10('0x23')](_0x58e6ba)['then'](function(_0x2f31fb){return _0x2f31fb;});}return null;};}function removeEntity(_0x3dde2e,_0x213567){return function(_0x4d21c5){if(_0x4d21c5){return _0x4d21c5[_0x9f10('0x24')]()[_0x9f10('0x25')](function(){_0x3dde2e[_0x9f10('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(!_0x11cae7){_0x2ec07d[_0x9f10('0x26')](0x194);}return _0x11cae7;};}function handleError(_0x5e80de,_0x57539b){_0x57539b=_0x57539b||0x1f4;return function(_0x5c1800){logger[_0x9f10('0x27')](_0x5c1800['stack']);if(_0x5c1800[_0x9f10('0x28')]){delete _0x5c1800[_0x9f10('0x28')];}_0x5e80de[_0x9f10('0x18')](_0x57539b)[_0x9f10('0x29')](_0x5c1800);};}exports[_0x9f10('0x2a')]=function(_0x4f6b0c,_0x522805){var _0x22814f={},_0x40f96b={},_0xfbb37f={'count':0x0,'rows':[]};var _0x181aec=_[_0x9f10('0x2b')](db['FaxQueueReport'][_0x9f10('0x2c')],function(_0x501ee){return{'name':_0x501ee[_0x9f10('0x2d')],'type':_0x501ee[_0x9f10('0x2e')]['key']};});_0x40f96b[_0x9f10('0x2f')]=_[_0x9f10('0x2b')](_0x181aec,_0x9f10('0x28'));_0x40f96b['query']=_[_0x9f10('0x30')](_0x4f6b0c['query']);_0x40f96b[_0x9f10('0x31')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],_0x40f96b['query']);_0x22814f[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0x40f96b[_0x9f10('0x2f')],qs[_0x9f10('0x34')](_0x4f6b0c[_0x9f10('0x35')]['fields']));_0x22814f[_0x9f10('0x33')]=_0x22814f['attributes'][_0x9f10('0x36')]?_0x22814f[_0x9f10('0x33')]:_0x40f96b[_0x9f10('0x2f')];if(!_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x37')](_0x9f10('0x38'))){_0x22814f['limit']=qs[_0x9f10('0x1b')](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x1b')]);_0x22814f['offset']=qs[_0x9f10('0x1d')](_0x4f6b0c[_0x9f10('0x35')]['offset']);}_0x22814f[_0x9f10('0x39')]=qs['sort'](_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x3a')]);_0x22814f[_0x9f10('0x3b')]=qs[_0x9f10('0x31')](_[_0x9f10('0x3c')](_0x4f6b0c[_0x9f10('0x35')],_0x40f96b[_0x9f10('0x31')]),_0x181aec);if(_0x4f6b0c[_0x9f10('0x35')]['filter']){_0x22814f[_0x9f10('0x3b')]=_[_0x9f10('0x3d')](_0x22814f[_0x9f10('0x3b')],{'$or':_['map'](_0x181aec,function(_0x233bab){if(_0x233bab[_0x9f10('0x2e')]!=='VIRTUAL'){var _0x30b04b={};_0x30b04b[_0x233bab[_0x9f10('0x28')]]={'$like':'%'+_0x4f6b0c[_0x9f10('0x35')]['filter']+'%'};return _0x30b04b;}})});}_0x22814f=_['merge']({},_0x22814f,_0x4f6b0c[_0x9f10('0x3e')]);var _0x2ff98d={'where':_0x22814f[_0x9f10('0x3b')]};return db[_0x9f10('0x3f')][_0x9f10('0x1c')](_0x2ff98d)[_0x9f10('0x25')](function(_0x15929f){_0xfbb37f[_0x9f10('0x1c')]=_0x15929f;if(_0x4f6b0c[_0x9f10('0x35')][_0x9f10('0x40')]){_0x22814f[_0x9f10('0x41')]=[{'all':!![]}];}return db[_0x9f10('0x3f')]['findAll'](_0x22814f);})['then'](function(_0x4bb805){_0xfbb37f[_0x9f10('0x42')]=_0x4bb805;return _0xfbb37f;})['then'](respondWithFilteredResult(_0x522805,_0x22814f))[_0x9f10('0x43')](handleError(_0x522805,null));};exports[_0x9f10('0x44')]=function(_0x426d30,_0x47d25c){var _0x3cfce6={'raw':!![],'where':{'id':_0x426d30[_0x9f10('0x45')]['id']}},_0xf1164={};_0xf1164[_0x9f10('0x2f')]=_[_0x9f10('0x30')](db['FaxQueueReport']['rawAttributes']);_0xf1164['query']=_[_0x9f10('0x30')](_0x426d30['query']);_0xf1164[_0x9f10('0x31')]=_['intersection'](_0xf1164[_0x9f10('0x2f')],_0xf1164[_0x9f10('0x35')]);_0x3cfce6[_0x9f10('0x33')]=_[_0x9f10('0x32')](_0xf1164['model'],qs[_0x9f10('0x34')](_0x426d30[_0x9f10('0x35')]['fields']));_0x3cfce6[_0x9f10('0x33')]=_0x3cfce6[_0x9f10('0x33')][_0x9f10('0x36')]?_0x3cfce6[_0x9f10('0x33')]:_0xf1164[_0x9f10('0x2f')];if(_0x426d30[_0x9f10('0x35')][_0x9f10('0x40')]){_0x3cfce6[_0x9f10('0x41')]=[{'all':!![]}];}_0x3cfce6=_[_0x9f10('0x3d')]({},_0x3cfce6,_0x426d30[_0x9f10('0x3e')]);return db['FaxQueueReport'][_0x9f10('0x46')](_0x3cfce6)[_0x9f10('0x25')](handleEntityNotFound(_0x47d25c,null))['then'](respondWithResult(_0x47d25c,null))[_0x9f10('0x43')](handleError(_0x47d25c,null));};exports[_0x9f10('0x47')]=function(_0x1cf3eb,_0x1807b3){return db['FaxQueueReport'][_0x9f10('0x47')](_0x1cf3eb[_0x9f10('0x48')],{})[_0x9f10('0x25')](respondWithResult(_0x1807b3,0xc9))[_0x9f10('0x43')](handleError(_0x1807b3,null));};exports[_0x9f10('0x23')]=function(_0x43cb31,_0x479b46){if(_0x43cb31[_0x9f10('0x48')]['id']){delete _0x43cb31[_0x9f10('0x48')]['id'];}return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x43cb31[_0x9f10('0x45')]['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x479b46,null))['then'](saveUpdates(_0x43cb31[_0x9f10('0x48')],null))[_0x9f10('0x25')](respondWithResult(_0x479b46,null))[_0x9f10('0x43')](handleError(_0x479b46,null));};exports[_0x9f10('0x24')]=function(_0x39dae3,_0x15d676){return db[_0x9f10('0x3f')][_0x9f10('0x46')]({'where':{'id':_0x39dae3['params']['id']}})[_0x9f10('0x25')](handleEntityNotFound(_0x15d676,null))['then'](removeEntity(_0x15d676,null))[_0x9f10('0x43')](handleError(_0x15d676,null));};exports['describe']=function(_0x2c9eb3,_0x2d06b2){return db[_0x9f10('0x3f')][_0x9f10('0x49')]()[_0x9f10('0x25')](respondWithResult(_0x2d06b2,null))['catch'](handleError(_0x2d06b2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a0208ea..5db7925 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x4df106,_0x23f0f1){var _0x4f2246=function(_0x3d2c48){while(--_0x3d2c48){_0x4df106['push'](_0x4df106['shift']());}};_0x4f2246(++_0x23f0f1);}(_0x7a54,0x106));var _0x47a5=function(_0x327c41,_0x66357f){_0x327c41=_0x327c41-0x0;var _0x180c98=_0x7a54[_0x327c41];return _0x180c98;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x27643f,_0x496cc0){var _0x33f5f9=function(_0x41da36){while(--_0x41da36){_0x27643f['push'](_0x27643f['shift']());}};_0x33f5f9(++_0x496cc0);}(_0x7a54,0x106));var _0x47a5=function(_0x136043,_0x169740){_0x136043=_0x136043-0x0;var _0x267e03=_0x7a54[_0x136043];return _0x267e03;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 81e368c..b3ee83d 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 _0x7d76=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','create','options','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','body','raw','where','attributes','limit'];(function(_0xffa865,_0x467c66){var _0x1e6e46=function(_0x236806){while(--_0x236806){_0xffa865['push'](_0xffa865['shift']());}};_0x1e6e46(++_0x467c66);}(_0x7d76,0x160));var _0x67d7=function(_0x41108d,_0x44020b){_0x41108d=_0x41108d-0x0;var _0x463864=_0x7d76[_0x41108d];return _0x463864;};'use strict';var _=require(_0x67d7('0x0'));var util=require(_0x67d7('0x1'));var moment=require(_0x67d7('0x2'));var BPromise=require(_0x67d7('0x3'));var rs=require(_0x67d7('0x4'));var fs=require('fs');var Redis=require(_0x67d7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67d7('0x6'))(_0x67d7('0x7'));var config=require(_0x67d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x67d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28e6f9,_0xdeb599,_0x3db593){return new BPromise(function(_0x4c3138,_0x3b735d){return client['request'](_0x28e6f9,_0x3db593)[_0x67d7('0xa')](function(_0x525ee5){logger[_0x67d7('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0xdeb599,'request\x20sent');logger[_0x67d7('0xc')](_0x67d7('0xd'),_0xdeb599,_0x67d7('0xe'),JSON[_0x67d7('0xf')](_0x525ee5));if(_0x525ee5[_0x67d7('0x10')]){if(_0x525ee5[_0x67d7('0x10')][_0x67d7('0x11')]===0x1f4){logger[_0x67d7('0x10')](_0x67d7('0x12'),_0xdeb599,_0x525ee5[_0x67d7('0x10')]['message']);return _0x3b735d(_0x525ee5['error'][_0x67d7('0x13')]);}logger['error'](_0x67d7('0x12'),_0xdeb599,_0x525ee5[_0x67d7('0x10')][_0x67d7('0x13')]);return _0x4c3138(_0x525ee5[_0x67d7('0x10')][_0x67d7('0x13')]);}else{logger['info'](_0x67d7('0x12'),_0xdeb599,'request\x20sent');_0x4c3138(_0x525ee5[_0x67d7('0x14')][_0x67d7('0x13')]);}})[_0x67d7('0x15')](function(_0x4b712f){logger[_0x67d7('0x10')](_0x67d7('0x12'),_0xdeb599,_0x4b712f);_0x3b735d(_0x4b712f);});});}exports['CreateFaxQueueReport']=function(_0x135eed){var _0x4c4da3=this;return new Promise(function(_0x266cf6,_0x15f2b0){return db['FaxQueueReport'][_0x67d7('0x16')](_0x135eed['body'],{'raw':_0x135eed[_0x67d7('0x17')]?_0x135eed['options']['raw']===undefined?!![]:![]:!![]})[_0x67d7('0xa')](function(_0x2a5ee4){logger[_0x67d7('0xb')]('CreateFaxQueueReport',_0x135eed);logger[_0x67d7('0xc')](_0x67d7('0x18'),_0x135eed,JSON[_0x67d7('0xf')](_0x2a5ee4));_0x266cf6(_0x2a5ee4);})['catch'](function(_0x522828){logger[_0x67d7('0x10')](_0x67d7('0x18'),_0x522828[_0x67d7('0x13')],_0x135eed);_0x15f2b0(_0x4c4da3[_0x67d7('0x10')](0x1f4,_0x522828[_0x67d7('0x13')]));});});};exports[_0x67d7('0x19')]=function(_0x4bc11c){var _0x42ce09=this;return new Promise(function(_0x21969b,_0x547ff9){return db[_0x67d7('0x1a')]['update'](_0x4bc11c[_0x67d7('0x1b')],{'raw':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1d')]||null:null,'attributes':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c['options'][_0x67d7('0x1e')]||null:null,'limit':_0x4bc11c[_0x67d7('0x17')]?_0x4bc11c[_0x67d7('0x17')][_0x67d7('0x1f')]||null:null})[_0x67d7('0xa')](function(_0x2e01f3){logger[_0x67d7('0xb')]('UpdateFaxQueueReport',_0x4bc11c);logger[_0x67d7('0xc')]('UpdateFaxQueueReport',_0x4bc11c,JSON[_0x67d7('0xf')](_0x2e01f3));_0x21969b(_0x2e01f3);})[_0x67d7('0x15')](function(_0x4dfab9){logger[_0x67d7('0x10')](_0x67d7('0x19'),_0x4dfab9[_0x67d7('0x13')],_0x4bc11c);_0x547ff9(_0x42ce09[_0x67d7('0x10')](0x1f4,_0x4dfab9['message']));});});}; \ No newline at end of file +var _0x7822=['FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','then','UpdateFaxQueueReport','update','body','options','raw','where','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf4f467,_0x10cda8){var _0x55cf49=function(_0xa2ddd9){while(--_0xa2ddd9){_0xf4f467['push'](_0xf4f467['shift']());}};_0x55cf49(++_0x10cda8);}(_0x7822,0xa5));var _0x2782=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7822[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2782('0x0'));var util=require(_0x2782('0x1'));var moment=require(_0x2782('0x2'));var BPromise=require('bluebird');var rs=require(_0x2782('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2782('0x4'))['db'];var utils=require(_0x2782('0x5'));var logger=require(_0x2782('0x6'))(_0x2782('0x7'));var config=require('../../config/environment');var jayson=require(_0x2782('0x8'));var client=jayson[_0x2782('0x9')][_0x2782('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb73b,_0x439b6e,_0x33c0f1){return new BPromise(function(_0x3cc344,_0x43d1eb){return client['request'](_0x5cb73b,_0x33c0f1)['then'](function(_0x5678bb){logger[_0x2782('0xb')](_0x2782('0xc'),_0x439b6e,_0x2782('0xd'));logger[_0x2782('0xe')](_0x2782('0xf'),_0x439b6e,'request\x20sent',JSON[_0x2782('0x10')](_0x5678bb));if(_0x5678bb[_0x2782('0x11')]){if(_0x5678bb[_0x2782('0x11')]['code']===0x1f4){logger[_0x2782('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x439b6e,_0x5678bb[_0x2782('0x11')][_0x2782('0x12')]);return _0x43d1eb(_0x5678bb[_0x2782('0x11')][_0x2782('0x12')]);}logger[_0x2782('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x439b6e,_0x5678bb[_0x2782('0x11')][_0x2782('0x12')]);return _0x3cc344(_0x5678bb[_0x2782('0x11')]['message']);}else{logger[_0x2782('0xb')](_0x2782('0xc'),_0x439b6e,_0x2782('0xd'));_0x3cc344(_0x5678bb[_0x2782('0x13')][_0x2782('0x12')]);}})[_0x2782('0x14')](function(_0x3692fa){logger[_0x2782('0x11')](_0x2782('0xc'),_0x439b6e,_0x3692fa);_0x43d1eb(_0x3692fa);});});}exports[_0x2782('0x15')]=function(_0x1f9154){var _0x853273=this;return new Promise(function(_0x2f4bc3,_0x4846e9){return db['FaxQueueReport']['create'](_0x1f9154['body'],{'raw':_0x1f9154['options']?_0x1f9154['options']['raw']===undefined?!![]:![]:!![]})[_0x2782('0x16')](function(_0x1098fa){logger[_0x2782('0xb')](_0x2782('0x15'),_0x1f9154);logger['debug'](_0x2782('0x15'),_0x1f9154,JSON[_0x2782('0x10')](_0x1098fa));_0x2f4bc3(_0x1098fa);})[_0x2782('0x14')](function(_0x1e8326){logger[_0x2782('0x11')](_0x2782('0x15'),_0x1e8326[_0x2782('0x12')],_0x1f9154);_0x4846e9(_0x853273['error'](0x1f4,_0x1e8326[_0x2782('0x12')]));});});};exports[_0x2782('0x17')]=function(_0x2097db){var _0x17e634=this;return new Promise(function(_0x27de88,_0x273950){return db['FaxQueueReport'][_0x2782('0x18')](_0x2097db[_0x2782('0x19')],{'raw':_0x2097db[_0x2782('0x1a')]?_0x2097db['options'][_0x2782('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2097db[_0x2782('0x1a')]?_0x2097db[_0x2782('0x1a')][_0x2782('0x1c')]||null:null,'attributes':_0x2097db['options']?_0x2097db[_0x2782('0x1a')]['attributes']||null:null,'limit':_0x2097db['options']?_0x2097db[_0x2782('0x1a')][_0x2782('0x1d')]||null:null})[_0x2782('0x16')](function(_0x32a2a4){logger['info'](_0x2782('0x17'),_0x2097db);logger[_0x2782('0xe')]('UpdateFaxQueueReport',_0x2097db,JSON[_0x2782('0x10')](_0x32a2a4));_0x27de88(_0x32a2a4);})[_0x2782('0x14')](function(_0x2e7c75){logger[_0x2782('0x11')](_0x2782('0x17'),_0x2e7c75[_0x2782('0x12')],_0x2097db);_0x273950(_0x17e634[_0x2782('0x11')](0x1f4,_0x2e7c75[_0x2782('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 16f8aae..35f9e81 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 _0x002c=['./faxQueueReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x002c,0xe7));var _0xc002=function(_0xd40717,_0x523966){_0xd40717=_0xd40717-0x0;var _0x3bb342=_0x002c[_0xd40717];return _0x3bb342;};'use strict';var multer=require(_0xc002('0x0'));var util=require(_0xc002('0x1'));var path=require(_0xc002('0x2'));var timeout=require(_0xc002('0x3'));var express=require(_0xc002('0x4'));var router=express[_0xc002('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc002('0x6'));var interaction=require(_0xc002('0x7'));var config=require(_0xc002('0x8'));var controller=require(_0xc002('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc002('0xa')]);router[_0xc002('0xb')](_0xc002('0xc'),auth[_0xc002('0xd')](),controller['describe']);router[_0xc002('0xb')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller[_0xc002('0xf')]);router[_0xc002('0x10')]('/',auth[_0xc002('0xd')](),controller[_0xc002('0x11')]);router[_0xc002('0x12')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller['update']);router[_0xc002('0x13')](_0xc002('0xe'),auth[_0xc002('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd528=['../../config/environment','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ffa16,_0x420a60){var _0x3160a5=function(_0x863d18){while(--_0x863d18){_0x4ffa16['push'](_0x4ffa16['shift']());}};_0x3160a5(++_0x420a60);}(_0xd528,0xcb));var _0x8d52=function(_0x5a4812,_0x389986){_0x5a4812=_0x5a4812-0x0;var _0x5737cd=_0xd528[_0x5a4812];return _0x5737cd;};'use strict';var multer=require(_0x8d52('0x0'));var util=require('util');var path=require(_0x8d52('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d52('0x2'));var router=express['Router']();var fs_extra=require(_0x8d52('0x3'));var auth=require(_0x8d52('0x4'));var interaction=require(_0x8d52('0x5'));var config=require(_0x8d52('0x6'));var controller=require('./faxQueueReport.controller');router[_0x8d52('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8d52('0x7')](_0x8d52('0x8'),auth[_0x8d52('0x9')](),controller['describe']);router[_0x8d52('0x7')](_0x8d52('0xa'),auth['isAuthenticated'](),controller[_0x8d52('0xb')]);router[_0x8d52('0xc')]('/',auth[_0x8d52('0x9')](),controller[_0x8d52('0xd')]);router[_0x8d52('0xe')](_0x8d52('0xa'),auth[_0x8d52('0x9')](),controller[_0x8d52('0xf')]);router[_0x8d52('0x10')](_0x8d52('0xa'),auth[_0x8d52('0x9')](),controller[_0x8d52('0x11')]);module[_0x8d52('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index eb5a18e..1a5c51e 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2b430a,_0x20b60b){var _0x7e016b=function(_0xccbc5f){while(--_0xccbc5f){_0x2b430a['push'](_0x2b430a['shift']());}};_0x7e016b(++_0x20b60b);}(_0xaa88,0x137));var _0x8aa8=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0xaa88[_0x387dc1];return _0x17567c;};'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(_0x32ef5a,_0x38647a){var _0x31c603=function(_0x249484){while(--_0x249484){_0x32ef5a['push'](_0x32ef5a['shift']());}};_0x31c603(++_0x38647a);}(_0x008c,0x188));var _0xc008=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0x008c[_0x5bd4f6];return _0x33a165;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 70ee910..d4d3fc6 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 _0x6245=['offset','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','FaxTransferReport','findAll','rows','catch','show','params','intersection','fields','include','options','find','create','body','update','describe','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6245,0x7a));var _0x5624=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x6245[_0x7729b1];return _0x349504;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5624('0x0'));var zipdir=require(_0x5624('0x1'));var jsonpatch=require(_0x5624('0x2'));var rp=require('request-promise');var moment=require(_0x5624('0x3'));var BPromise=require(_0x5624('0x4'));var Mustache=require(_0x5624('0x5'));var util=require(_0x5624('0x6'));var path=require(_0x5624('0x7'));var sox=require(_0x5624('0x8'));var csv=require(_0x5624('0x9'));var ejs=require(_0x5624('0xa'));var fs=require('fs');var fs_extra=require(_0x5624('0xb'));var _=require(_0x5624('0xc'));var squel=require(_0x5624('0xd'));var crypto=require(_0x5624('0xe'));var jsforce=require(_0x5624('0xf'));var deskjs=require(_0x5624('0x10'));var toCsv=require(_0x5624('0x9'));var querystring=require(_0x5624('0x11'));var Papa=require(_0x5624('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5624('0x13'));var as=require(_0x5624('0x14'));var hardwareService=require(_0x5624('0x15'));var logger=require(_0x5624('0x16'))('api');var utils=require(_0x5624('0x17'));var config=require(_0x5624('0x18'));var licenseUtil=require(_0x5624('0x19'));var db=require(_0x5624('0x1a'))['db'];function respondWithStatusCode(_0x59c734,_0x2ff160){_0x2ff160=_0x2ff160||0xcc;return function(_0x2d4c1b){if(_0x2d4c1b){return _0x59c734[_0x5624('0x1b')](_0x2ff160);}return _0x59c734[_0x5624('0x1c')](_0x2ff160)[_0x5624('0x1d')]();};}function respondWithResult(_0x1c1361,_0x3ed220){_0x3ed220=_0x3ed220||0xc8;return function(_0x456672){if(_0x456672){return _0x1c1361[_0x5624('0x1c')](_0x3ed220)[_0x5624('0x1e')](_0x456672);}};}function respondWithFilteredResult(_0xcd18bc,_0x5db462){return function(_0x222ec3){if(_0x222ec3){var _0x1f123d=typeof _0x5db462['offset']==='undefined'&&typeof _0x5db462['limit']===_0x5624('0x1f');var _0x3dcf85=_0x222ec3['count'];var _0x43baf5=_0x1f123d?0x0:_0x5db462[_0x5624('0x20')];var _0x23d93f=_0x1f123d?_0x222ec3[_0x5624('0x21')]:_0x5db462[_0x5624('0x20')]+_0x5db462['limit'];var _0x53883c;if(_0x23d93f>=_0x3dcf85){_0x23d93f=_0x3dcf85;_0x53883c=0xc8;}else{_0x53883c=0xce;}_0xcd18bc[_0x5624('0x1c')](_0x53883c);return _0xcd18bc[_0x5624('0x22')](_0x5624('0x23'),_0x43baf5+'-'+_0x23d93f+'/'+_0x3dcf85)[_0x5624('0x1e')](_0x222ec3);}return null;};}function patchUpdates(_0x2682af){return function(_0x4d85ef){try{jsonpatch['apply'](_0x4d85ef,_0x2682af,!![]);}catch(_0x4430b5){return BPromise[_0x5624('0x24')](_0x4430b5);}return _0x4d85ef[_0x5624('0x25')]();};}function saveUpdates(_0x12f5ca,_0x5d18c0){return function(_0x36ea1a){if(_0x36ea1a){return _0x36ea1a['update'](_0x12f5ca)[_0x5624('0x26')](function(_0x2370d8){return _0x2370d8;});}return null;};}function removeEntity(_0x5a4f10,_0x3cd7aa){return function(_0x635cd7){if(_0x635cd7){return _0x635cd7[_0x5624('0x27')]()['then'](function(){_0x5a4f10[_0x5624('0x1c')](0xcc)[_0x5624('0x1d')]();});}};}function handleEntityNotFound(_0x196c5b,_0x14da57){return function(_0x19782d){if(!_0x19782d){_0x196c5b[_0x5624('0x1b')](0x194);}return _0x19782d;};}function handleError(_0xa186ad,_0x496bc7){_0x496bc7=_0x496bc7||0x1f4;return function(_0x5225ee){logger[_0x5624('0x28')](_0x5225ee[_0x5624('0x29')]);if(_0x5225ee[_0x5624('0x2a')]){delete _0x5225ee[_0x5624('0x2a')];}_0xa186ad[_0x5624('0x1c')](_0x496bc7)[_0x5624('0x2b')](_0x5225ee);};}exports['index']=function(_0x1787c8,_0x5f1710){var _0x4e793c={},_0x4aa754={},_0x470696={'count':0x0,'rows':[]};var _0x2d2fed=_['map'](db['FaxTransferReport'][_0x5624('0x2c')],function(_0x60ecac){return{'name':_0x60ecac[_0x5624('0x2d')],'type':_0x60ecac[_0x5624('0x2e')][_0x5624('0x2f')]};});_0x4aa754['model']=_[_0x5624('0x30')](_0x2d2fed,_0x5624('0x2a'));_0x4aa754['query']=_[_0x5624('0x31')](_0x1787c8[_0x5624('0x32')]);_0x4aa754[_0x5624('0x33')]=_['intersection'](_0x4aa754[_0x5624('0x34')],_0x4aa754['query']);_0x4e793c['attributes']=_['intersection'](_0x4aa754[_0x5624('0x34')],qs['fields'](_0x1787c8[_0x5624('0x32')]['fields']));_0x4e793c[_0x5624('0x35')]=_0x4e793c[_0x5624('0x35')][_0x5624('0x36')]?_0x4e793c[_0x5624('0x35')]:_0x4aa754[_0x5624('0x34')];if(!_0x1787c8['query']['hasOwnProperty']('nolimit')){_0x4e793c['limit']=qs['limit'](_0x1787c8['query']['limit']);_0x4e793c[_0x5624('0x20')]=qs['offset'](_0x1787c8[_0x5624('0x32')][_0x5624('0x20')]);}_0x4e793c[_0x5624('0x37')]=qs[_0x5624('0x38')](_0x1787c8[_0x5624('0x32')][_0x5624('0x38')]);_0x4e793c[_0x5624('0x39')]=qs[_0x5624('0x33')](_[_0x5624('0x3a')](_0x1787c8[_0x5624('0x32')],_0x4aa754[_0x5624('0x33')]),_0x2d2fed);if(_0x1787c8[_0x5624('0x32')][_0x5624('0x3b')]){_0x4e793c[_0x5624('0x39')]=_[_0x5624('0x3c')](_0x4e793c[_0x5624('0x39')],{'$or':_['map'](_0x2d2fed,function(_0x3b779c){if(_0x3b779c[_0x5624('0x2e')]!==_0x5624('0x3d')){var _0x5af3a6={};_0x5af3a6[_0x3b779c[_0x5624('0x2a')]]={'$like':'%'+_0x1787c8[_0x5624('0x32')][_0x5624('0x3b')]+'%'};return _0x5af3a6;}})});}_0x4e793c=_[_0x5624('0x3c')]({},_0x4e793c,_0x1787c8['options']);var _0x355322={'where':_0x4e793c[_0x5624('0x39')]};return db[_0x5624('0x3e')]['count'](_0x355322)[_0x5624('0x26')](function(_0x461a93){_0x470696[_0x5624('0x21')]=_0x461a93;if(_0x1787c8[_0x5624('0x32')]['includeAll']){_0x4e793c['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x5624('0x3f')](_0x4e793c);})[_0x5624('0x26')](function(_0x59ab5a){_0x470696[_0x5624('0x40')]=_0x59ab5a;return _0x470696;})['then'](respondWithFilteredResult(_0x5f1710,_0x4e793c))[_0x5624('0x41')](handleError(_0x5f1710,null));};exports[_0x5624('0x42')]=function(_0x5b068e,_0x1990e6){var _0x34b5c3={'raw':!![],'where':{'id':_0x5b068e[_0x5624('0x43')]['id']}},_0x4a42df={};_0x4a42df['model']=_[_0x5624('0x31')](db[_0x5624('0x3e')][_0x5624('0x2c')]);_0x4a42df[_0x5624('0x32')]=_[_0x5624('0x31')](_0x5b068e['query']);_0x4a42df['filters']=_[_0x5624('0x44')](_0x4a42df[_0x5624('0x34')],_0x4a42df[_0x5624('0x32')]);_0x34b5c3['attributes']=_['intersection'](_0x4a42df[_0x5624('0x34')],qs[_0x5624('0x45')](_0x5b068e[_0x5624('0x32')]['fields']));_0x34b5c3['attributes']=_0x34b5c3['attributes']['length']?_0x34b5c3[_0x5624('0x35')]:_0x4a42df['model'];if(_0x5b068e['query']['includeAll']){_0x34b5c3[_0x5624('0x46')]=[{'all':!![]}];}_0x34b5c3=_[_0x5624('0x3c')]({},_0x34b5c3,_0x5b068e[_0x5624('0x47')]);return db[_0x5624('0x3e')][_0x5624('0x48')](_0x34b5c3)[_0x5624('0x26')](handleEntityNotFound(_0x1990e6,null))[_0x5624('0x26')](respondWithResult(_0x1990e6,null))['catch'](handleError(_0x1990e6,null));};exports[_0x5624('0x49')]=function(_0x3df8c7,_0x33700a){return db[_0x5624('0x3e')]['create'](_0x3df8c7[_0x5624('0x4a')],{})['then'](respondWithResult(_0x33700a,0xc9))[_0x5624('0x41')](handleError(_0x33700a,null));};exports[_0x5624('0x4b')]=function(_0x4ff769,_0x2dd9f6){if(_0x4ff769[_0x5624('0x4a')]['id']){delete _0x4ff769['body']['id'];}return db[_0x5624('0x3e')][_0x5624('0x48')]({'where':{'id':_0x4ff769[_0x5624('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dd9f6,null))[_0x5624('0x26')](saveUpdates(_0x4ff769['body'],null))[_0x5624('0x26')](respondWithResult(_0x2dd9f6,null))[_0x5624('0x41')](handleError(_0x2dd9f6,null));};exports[_0x5624('0x27')]=function(_0x26be7b,_0x5a9e3f){return db['FaxTransferReport'][_0x5624('0x48')]({'where':{'id':_0x26be7b[_0x5624('0x43')]['id']}})[_0x5624('0x26')](handleEntityNotFound(_0x5a9e3f,null))[_0x5624('0x26')](removeEntity(_0x5a9e3f,null))[_0x5624('0x41')](handleError(_0x5a9e3f,null));};exports[_0x5624('0x4c')]=function(_0x22589a,_0x47daaf){return db[_0x5624('0x3e')][_0x5624('0x4c')]()[_0x5624('0x26')](respondWithResult(_0x47daaf,null))[_0x5624('0x41')](handleError(_0x47daaf,null));}; \ No newline at end of file +var _0x14ad=['findAll','catch','show','params','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll'];(function(_0x39c9f5,_0x2f4c88){var _0x20e4b0=function(_0x4c553a){while(--_0x4c553a){_0x39c9f5['push'](_0x39c9f5['shift']());}};_0x20e4b0(++_0x2f4c88);}(_0x14ad,0x180));var _0xd14a=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x14ad[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0xd14a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd14a('0x1'));var jsonpatch=require(_0xd14a('0x2'));var rp=require(_0xd14a('0x3'));var moment=require(_0xd14a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd14a('0x5'));var util=require(_0xd14a('0x6'));var path=require('path');var sox=require(_0xd14a('0x7'));var csv=require(_0xd14a('0x8'));var ejs=require(_0xd14a('0x9'));var fs=require('fs');var fs_extra=require(_0xd14a('0xa'));var _=require(_0xd14a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd14a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd14a('0x8'));var querystring=require(_0xd14a('0xd'));var Papa=require('papaparse');var Redis=require(_0xd14a('0xe'));var authService=require(_0xd14a('0xf'));var qs=require(_0xd14a('0x10'));var as=require(_0xd14a('0x11'));var hardwareService=require(_0xd14a('0x12'));var logger=require(_0xd14a('0x13'))(_0xd14a('0x14'));var utils=require(_0xd14a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd14a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a58ab,_0x1a7ec2){_0x1a7ec2=_0x1a7ec2||0xcc;return function(_0xa9e95a){if(_0xa9e95a){return _0x4a58ab[_0xd14a('0x17')](_0x1a7ec2);}return _0x4a58ab[_0xd14a('0x18')](_0x1a7ec2)[_0xd14a('0x19')]();};}function respondWithResult(_0x53e35d,_0x517448){_0x517448=_0x517448||0xc8;return function(_0x38d767){if(_0x38d767){return _0x53e35d[_0xd14a('0x18')](_0x517448)[_0xd14a('0x1a')](_0x38d767);}};}function respondWithFilteredResult(_0x48d4bb,_0x28a378){return function(_0x3e1a2b){if(_0x3e1a2b){var _0x417b38=typeof _0x28a378[_0xd14a('0x1b')]===_0xd14a('0x1c')&&typeof _0x28a378[_0xd14a('0x1d')]==='undefined';var _0x50bc7d=_0x3e1a2b[_0xd14a('0x1e')];var _0x3ef5bc=_0x417b38?0x0:_0x28a378[_0xd14a('0x1b')];var _0x11d712=_0x417b38?_0x3e1a2b[_0xd14a('0x1e')]:_0x28a378[_0xd14a('0x1b')]+_0x28a378[_0xd14a('0x1d')];var _0x45fd5a;if(_0x11d712>=_0x50bc7d){_0x11d712=_0x50bc7d;_0x45fd5a=0xc8;}else{_0x45fd5a=0xce;}_0x48d4bb[_0xd14a('0x18')](_0x45fd5a);return _0x48d4bb[_0xd14a('0x1f')]('Content-Range',_0x3ef5bc+'-'+_0x11d712+'/'+_0x50bc7d)['json'](_0x3e1a2b);}return null;};}function patchUpdates(_0x4abd14){return function(_0xfb61a9){try{jsonpatch[_0xd14a('0x20')](_0xfb61a9,_0x4abd14,!![]);}catch(_0x57b2f4){return BPromise[_0xd14a('0x21')](_0x57b2f4);}return _0xfb61a9[_0xd14a('0x22')]();};}function saveUpdates(_0x13147b,_0x235323){return function(_0x2c97b5){if(_0x2c97b5){return _0x2c97b5[_0xd14a('0x23')](_0x13147b)[_0xd14a('0x24')](function(_0x45572e){return _0x45572e;});}return null;};}function removeEntity(_0xb7415f,_0x34b582){return function(_0x38c4f1){if(_0x38c4f1){return _0x38c4f1[_0xd14a('0x25')]()['then'](function(){_0xb7415f['status'](0xcc)[_0xd14a('0x19')]();});}};}function handleEntityNotFound(_0x588715,_0xa6c4e0){return function(_0x48b46c){if(!_0x48b46c){_0x588715[_0xd14a('0x17')](0x194);}return _0x48b46c;};}function handleError(_0x3d064a,_0x4883e4){_0x4883e4=_0x4883e4||0x1f4;return function(_0x35e70e){logger[_0xd14a('0x26')](_0x35e70e[_0xd14a('0x27')]);if(_0x35e70e[_0xd14a('0x28')]){delete _0x35e70e[_0xd14a('0x28')];}_0x3d064a['status'](_0x4883e4)[_0xd14a('0x29')](_0x35e70e);};}exports[_0xd14a('0x2a')]=function(_0x293264,_0x8d892e){var _0x454c5a={},_0x521774={},_0x2c9901={'count':0x0,'rows':[]};var _0x105eab=_[_0xd14a('0x2b')](db[_0xd14a('0x2c')][_0xd14a('0x2d')],function(_0x1349e4){return{'name':_0x1349e4[_0xd14a('0x2e')],'type':_0x1349e4[_0xd14a('0x2f')]['key']};});_0x521774[_0xd14a('0x30')]=_[_0xd14a('0x2b')](_0x105eab,_0xd14a('0x28'));_0x521774[_0xd14a('0x31')]=_[_0xd14a('0x32')](_0x293264['query']);_0x521774[_0xd14a('0x33')]=_[_0xd14a('0x34')](_0x521774[_0xd14a('0x30')],_0x521774[_0xd14a('0x31')]);_0x454c5a[_0xd14a('0x35')]=_[_0xd14a('0x34')](_0x521774[_0xd14a('0x30')],qs[_0xd14a('0x36')](_0x293264[_0xd14a('0x31')][_0xd14a('0x36')]));_0x454c5a[_0xd14a('0x35')]=_0x454c5a[_0xd14a('0x35')][_0xd14a('0x37')]?_0x454c5a['attributes']:_0x521774['model'];if(!_0x293264[_0xd14a('0x31')][_0xd14a('0x38')]('nolimit')){_0x454c5a[_0xd14a('0x1d')]=qs[_0xd14a('0x1d')](_0x293264[_0xd14a('0x31')][_0xd14a('0x1d')]);_0x454c5a[_0xd14a('0x1b')]=qs[_0xd14a('0x1b')](_0x293264[_0xd14a('0x31')][_0xd14a('0x1b')]);}_0x454c5a[_0xd14a('0x39')]=qs[_0xd14a('0x3a')](_0x293264[_0xd14a('0x31')]['sort']);_0x454c5a[_0xd14a('0x3b')]=qs['filters'](_[_0xd14a('0x3c')](_0x293264[_0xd14a('0x31')],_0x521774[_0xd14a('0x33')]),_0x105eab);if(_0x293264['query'][_0xd14a('0x3d')]){_0x454c5a[_0xd14a('0x3b')]=_['merge'](_0x454c5a['where'],{'$or':_[_0xd14a('0x2b')](_0x105eab,function(_0x177fd7){if(_0x177fd7[_0xd14a('0x2f')]!==_0xd14a('0x3e')){var _0x5d0b94={};_0x5d0b94[_0x177fd7[_0xd14a('0x28')]]={'$like':'%'+_0x293264[_0xd14a('0x31')][_0xd14a('0x3d')]+'%'};return _0x5d0b94;}})});}_0x454c5a=_[_0xd14a('0x3f')]({},_0x454c5a,_0x293264[_0xd14a('0x40')]);var _0x35a500={'where':_0x454c5a['where']};return db[_0xd14a('0x2c')]['count'](_0x35a500)[_0xd14a('0x24')](function(_0x14df9f){_0x2c9901[_0xd14a('0x1e')]=_0x14df9f;if(_0x293264[_0xd14a('0x31')][_0xd14a('0x41')]){_0x454c5a['include']=[{'all':!![]}];}return db[_0xd14a('0x2c')][_0xd14a('0x42')](_0x454c5a);})[_0xd14a('0x24')](function(_0x579515){_0x2c9901['rows']=_0x579515;return _0x2c9901;})[_0xd14a('0x24')](respondWithFilteredResult(_0x8d892e,_0x454c5a))[_0xd14a('0x43')](handleError(_0x8d892e,null));};exports[_0xd14a('0x44')]=function(_0x7a1bc0,_0x1011df){var _0x20c5eb={'raw':!![],'where':{'id':_0x7a1bc0[_0xd14a('0x45')]['id']}},_0x59a41a={};_0x59a41a[_0xd14a('0x30')]=_[_0xd14a('0x32')](db[_0xd14a('0x2c')][_0xd14a('0x2d')]);_0x59a41a[_0xd14a('0x31')]=_[_0xd14a('0x32')](_0x7a1bc0['query']);_0x59a41a[_0xd14a('0x33')]=_[_0xd14a('0x34')](_0x59a41a[_0xd14a('0x30')],_0x59a41a[_0xd14a('0x31')]);_0x20c5eb[_0xd14a('0x35')]=_[_0xd14a('0x34')](_0x59a41a[_0xd14a('0x30')],qs['fields'](_0x7a1bc0[_0xd14a('0x31')][_0xd14a('0x36')]));_0x20c5eb[_0xd14a('0x35')]=_0x20c5eb[_0xd14a('0x35')][_0xd14a('0x37')]?_0x20c5eb['attributes']:_0x59a41a[_0xd14a('0x30')];if(_0x7a1bc0[_0xd14a('0x31')][_0xd14a('0x41')]){_0x20c5eb[_0xd14a('0x46')]=[{'all':!![]}];}_0x20c5eb=_[_0xd14a('0x3f')]({},_0x20c5eb,_0x7a1bc0[_0xd14a('0x40')]);return db[_0xd14a('0x2c')]['find'](_0x20c5eb)[_0xd14a('0x24')](handleEntityNotFound(_0x1011df,null))[_0xd14a('0x24')](respondWithResult(_0x1011df,null))[_0xd14a('0x43')](handleError(_0x1011df,null));};exports[_0xd14a('0x47')]=function(_0x27e41d,_0xd86cff){return db[_0xd14a('0x2c')][_0xd14a('0x47')](_0x27e41d['body'],{})[_0xd14a('0x24')](respondWithResult(_0xd86cff,0xc9))['catch'](handleError(_0xd86cff,null));};exports[_0xd14a('0x23')]=function(_0x55b5ea,_0x29c164){if(_0x55b5ea['body']['id']){delete _0x55b5ea[_0xd14a('0x48')]['id'];}return db[_0xd14a('0x2c')][_0xd14a('0x49')]({'where':{'id':_0x55b5ea['params']['id']}})[_0xd14a('0x24')](handleEntityNotFound(_0x29c164,null))[_0xd14a('0x24')](saveUpdates(_0x55b5ea['body'],null))[_0xd14a('0x24')](respondWithResult(_0x29c164,null))[_0xd14a('0x43')](handleError(_0x29c164,null));};exports[_0xd14a('0x25')]=function(_0x1faa91,_0xab09ed){return db['FaxTransferReport']['find']({'where':{'id':_0x1faa91['params']['id']}})[_0xd14a('0x24')](handleEntityNotFound(_0xab09ed,null))[_0xd14a('0x24')](removeEntity(_0xab09ed,null))[_0xd14a('0x43')](handleError(_0xab09ed,null));};exports['describe']=function(_0x1db1be,_0x485f8a){return db['FaxTransferReport'][_0xd14a('0x4a')]()[_0xd14a('0x24')](respondWithResult(_0x485f8a,null))['catch'](handleError(_0x485f8a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 00ef872..695ac7d 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 _0x9571=['FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x9571,0x1c2));var _0x1957=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0x9571[_0x104993];return _0x105a96;};'use strict';var _=require(_0x1957('0x0'));var util=require(_0x1957('0x1'));var logger=require(_0x1957('0x2'))(_0x1957('0x3'));var moment=require(_0x1957('0x4'));var BPromise=require(_0x1957('0x5'));var rp=require(_0x1957('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1957('0x7'));var config=require(_0x1957('0x8'));var attributes=require(_0x1957('0x9'));module[_0x1957('0xa')]=function(_0x1d0c37,_0x37bc29){return _0x1d0c37[_0x1957('0xb')](_0x1957('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1957('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9769=['request-promise','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','api','moment','bluebird'];(function(_0x4ea015,_0x1c3296){var _0x5e4ca0=function(_0x1365fa){while(--_0x1365fa){_0x4ea015['push'](_0x4ea015['shift']());}};_0x5e4ca0(++_0x1c3296);}(_0x9769,0x74));var _0x9976=function(_0x59ae65,_0x54fdd7){_0x59ae65=_0x59ae65-0x0;var _0x2d5db1=_0x9769[_0x59ae65];return _0x2d5db1;};'use strict';var _=require('lodash');var util=require(_0x9976('0x0'));var logger=require('../../config/logger')(_0x9976('0x1'));var moment=require(_0x9976('0x2'));var BPromise=require(_0x9976('0x3'));var rp=require(_0x9976('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9976('0x5'));var config=require(_0x9976('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x9976('0x7')]=function(_0x3dbc69,_0x3a9c2b){return _0x3dbc69[_0x9976('0x8')](_0x9976('0x9'),attributes,{'tableName':_0x9976('0xa'),'paranoid':![],'indexes':[{'name':_0x9976('0xb'),'fields':[_0x9976('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6b2988a..6eaca6a 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 _0x4d03=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x274dda,_0x17793a){var _0x1a0c75=function(_0x226ff0){while(--_0x226ff0){_0x274dda['push'](_0x274dda['shift']());}};_0x1a0c75(++_0x17793a);}(_0x4d03,0x172));var _0x34d0=function(_0xee9423,_0x1f99ab){_0xee9423=_0xee9423-0x0;var _0x4fad34=_0x4d03[_0xee9423];return _0x4fad34;};'use strict';var _=require('lodash');var util=require(_0x34d0('0x0'));var moment=require(_0x34d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x34d0('0x2'));var fs=require('fs');var Redis=require(_0x34d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34d0('0x4'));var logger=require('../../config/logger')(_0x34d0('0x5'));var config=require('../../config/environment');var jayson=require(_0x34d0('0x6'));var client=jayson['client'][_0x34d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x978bb3,_0x2318e2,_0x398f1b){return new BPromise(function(_0x173d01,_0x193f88){return client[_0x34d0('0x8')](_0x978bb3,_0x398f1b)[_0x34d0('0x9')](function(_0x2857e3){logger[_0x34d0('0xa')](_0x34d0('0xb'),_0x2318e2,_0x34d0('0xc'));logger['debug'](_0x34d0('0xd'),_0x2318e2,'request\x20sent',JSON[_0x34d0('0xe')](_0x2857e3));if(_0x2857e3['error']){if(_0x2857e3[_0x34d0('0xf')][_0x34d0('0x10')]===0x1f4){logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x2857e3[_0x34d0('0xf')][_0x34d0('0x11')]);return _0x193f88(_0x2857e3['error']['message']);}logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x2857e3[_0x34d0('0xf')][_0x34d0('0x11')]);return _0x173d01(_0x2857e3['error'][_0x34d0('0x11')]);}else{logger['info'](_0x34d0('0xb'),_0x2318e2,_0x34d0('0xc'));_0x173d01(_0x2857e3[_0x34d0('0x12')][_0x34d0('0x11')]);}})[_0x34d0('0x13')](function(_0x390401){logger[_0x34d0('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2318e2,_0x390401);_0x193f88(_0x390401);});});} \ No newline at end of file +var _0xcf5f=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','rpc','../../config/environment','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf5f,0xc6));var _0xfcf5=function(_0x84d3d1,_0x3389d1){_0x84d3d1=_0x84d3d1-0x0;var _0x14bf16=_0xcf5f[_0x84d3d1];return _0x14bf16;};'use strict';var _=require(_0xfcf5('0x0'));var util=require(_0xfcf5('0x1'));var moment=require(_0xfcf5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcf5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfcf5('0x4'));var config=require(_0xfcf5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xfcf5('0x6')][_0xfcf5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cf6c6,_0x38b8b4,_0x4dcd04){return new BPromise(function(_0x4d2f43,_0x4d3b79){return client[_0xfcf5('0x8')](_0x4cf6c6,_0x4dcd04)[_0xfcf5('0x9')](function(_0x2ea921){logger[_0xfcf5('0xa')](_0xfcf5('0xb'),_0x38b8b4,_0xfcf5('0xc'));logger['debug'](_0xfcf5('0xd'),_0x38b8b4,_0xfcf5('0xc'),JSON['stringify'](_0x2ea921));if(_0x2ea921[_0xfcf5('0xe')]){if(_0x2ea921[_0xfcf5('0xe')][_0xfcf5('0xf')]===0x1f4){logger['error'](_0xfcf5('0xb'),_0x38b8b4,_0x2ea921[_0xfcf5('0xe')][_0xfcf5('0x10')]);return _0x4d3b79(_0x2ea921[_0xfcf5('0xe')]['message']);}logger[_0xfcf5('0xe')](_0xfcf5('0xb'),_0x38b8b4,_0x2ea921[_0xfcf5('0xe')][_0xfcf5('0x10')]);return _0x4d2f43(_0x2ea921[_0xfcf5('0xe')]['message']);}else{logger['info'](_0xfcf5('0xb'),_0x38b8b4,_0xfcf5('0xc'));_0x4d2f43(_0x2ea921[_0xfcf5('0x11')][_0xfcf5('0x10')]);}})[_0xfcf5('0x12')](function(_0xc53b2e){logger[_0xfcf5('0xe')](_0xfcf5('0xb'),_0x38b8b4,_0xc53b2e);_0x4d3b79(_0xc53b2e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0a2a552..ed5581c 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 _0x7f5e=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ba877,_0x173618){var _0x28c592=function(_0x578368){while(--_0x578368){_0x4ba877['push'](_0x4ba877['shift']());}};_0x28c592(++_0x173618);}(_0x7f5e,0x78));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xe7f5('0x0'));var path=require(_0xe7f5('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7f5('0x2'));var router=express[_0xe7f5('0x3')]();var fs_extra=require(_0xe7f5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7f5('0x5'));var config=require(_0xe7f5('0x6'));var controller=require(_0xe7f5('0x7'));router[_0xe7f5('0x8')]('/',auth[_0xe7f5('0x9')](),controller['index']);router[_0xe7f5('0x8')](_0xe7f5('0xa'),auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xb')]);router[_0xe7f5('0x8')]('/:id',auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xc')]);router[_0xe7f5('0xd')]('/',auth[_0xe7f5('0x9')](),controller[_0xe7f5('0xe')]);router[_0xe7f5('0xf')](_0xe7f5('0x10'),auth['isAuthenticated'](),controller[_0xe7f5('0x11')]);router[_0xe7f5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe7f5('0x13')]);module[_0xe7f5('0x14')]=router; \ No newline at end of file +var _0xc0e5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','describe','/:id','isAuthenticated','post','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x282fcc,_0x2fa4ed){var _0x56a893=function(_0x4cc0ec){while(--_0x4cc0ec){_0x282fcc['push'](_0x282fcc['shift']());}};_0x56a893(++_0x2fa4ed);}(_0xc0e5,0x84));var _0x5c0e=function(_0x335840,_0xd1b8de){_0x335840=_0x335840-0x0;var _0x5e133f=_0xc0e5[_0x335840];return _0x5e133f;};'use strict';var multer=require(_0x5c0e('0x0'));var util=require(_0x5c0e('0x1'));var path=require(_0x5c0e('0x2'));var timeout=require(_0x5c0e('0x3'));var express=require(_0x5c0e('0x4'));var router=express[_0x5c0e('0x5')]();var fs_extra=require(_0x5c0e('0x6'));var auth=require(_0x5c0e('0x7'));var interaction=require(_0x5c0e('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5c0e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x5c0e('0xa')]);router[_0x5c0e('0x9')](_0x5c0e('0xb'),auth[_0x5c0e('0xc')](),controller['show']);router[_0x5c0e('0xd')]('/',auth[_0x5c0e('0xc')](),controller['create']);router[_0x5c0e('0xe')]('/:id',auth[_0x5c0e('0xc')](),controller['update']);router[_0x5c0e('0xf')](_0x5c0e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5c0e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a6c0e91..0a0e2de 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 _0xc6b3=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xc6b3,0x6c));var _0x3c6b=function(_0x211f66,_0x6d409f){_0x211f66=_0x211f66-0x0;var _0x324240=_0xc6b3[_0x211f66];return _0x324240;};'use strict';var multer=require(_0x3c6b('0x0'));var util=require(_0x3c6b('0x1'));var path=require(_0x3c6b('0x2'));var timeout=require(_0x3c6b('0x3'));var express=require(_0x3c6b('0x4'));var router=express[_0x3c6b('0x5')]();var fs_extra=require(_0x3c6b('0x6'));var auth=require(_0x3c6b('0x7'));var interaction=require(_0x3c6b('0x8'));var config=require(_0x3c6b('0x9'));var controller=require(_0x3c6b('0xa'));router['get']('/',auth[_0x3c6b('0xb')](),controller[_0x3c6b('0xc')]);router['get'](_0x3c6b('0xd'),auth['isAuthenticated'](),controller[_0x3c6b('0xe')]);router[_0x3c6b('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3c6b('0x10')]);router[_0x3c6b('0xf')](_0x3c6b('0x11'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x12')]);router[_0x3c6b('0x13')]('/',auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x14')]);router[_0x3c6b('0x13')](_0x3c6b('0x15'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x16')]);router[_0x3c6b('0x17')](_0x3c6b('0xd'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x18')]);router[_0x3c6b('0x19')](_0x3c6b('0xd'),auth[_0x3c6b('0xb')](),controller[_0x3c6b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x502f=['post','put','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields'];(function(_0x2e0e5b,_0x9791e3){var _0x314646=function(_0x94bcd0){while(--_0x94bcd0){_0x2e0e5b['push'](_0x2e0e5b['shift']());}};_0x314646(++_0x9791e3);}(_0x502f,0x16d));var _0xf502=function(_0xd57ca7,_0xa8dbda){_0xd57ca7=_0xd57ca7-0x0;var _0x426389=_0x502f[_0xd57ca7];return _0x426389;};'use strict';var multer=require(_0xf502('0x0'));var util=require(_0xf502('0x1'));var path=require(_0xf502('0x2'));var timeout=require('connect-timeout');var express=require(_0xf502('0x3'));var router=express[_0xf502('0x4')]();var fs_extra=require(_0xf502('0x5'));var auth=require(_0xf502('0x6'));var interaction=require(_0xf502('0x7'));var config=require(_0xf502('0x8'));var controller=require('./intDeskAccount.controller');router[_0xf502('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf502('0x9')]('/:id',auth[_0xf502('0xa')](),controller[_0xf502('0xb')]);router[_0xf502('0x9')](_0xf502('0xc'),auth[_0xf502('0xa')](),controller['getConfigurations']);router[_0xf502('0x9')](_0xf502('0xd'),auth[_0xf502('0xa')](),controller[_0xf502('0xe')]);router[_0xf502('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf502('0xf')](_0xf502('0xc'),auth[_0xf502('0xa')](),controller['addConfiguration']);router[_0xf502('0x10')](_0xf502('0x11'),auth[_0xf502('0xa')](),controller['update']);router[_0xf502('0x12')](_0xf502('0x11'),auth[_0xf502('0xa')](),controller[_0xf502('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 94383c3..1af6fc3 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 _0xd071=['basic','newTab','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x33c56d,_0x45e310){var _0x4c817d=function(_0x5dab38){while(--_0x5dab38){_0x33c56d['push'](_0x33c56d['shift']());}};_0x4c817d(++_0x45e310);}(_0xd071,0xf1));var _0x1d07=function(_0x593d57,_0x58e667){_0x593d57=_0x593d57-0x0;var _0xf7676a=_0xd071[_0x593d57];return _0xf7676a;};'use strict';var Sequelize=require(_0x1d07('0x0'));module[_0x1d07('0x1')]={'name':{'type':Sequelize[_0x1d07('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1d07('0x2')]},'authType':{'type':Sequelize[_0x1d07('0x3')](_0x1d07('0x4')),'defaultValue':_0x1d07('0x4')},'password':{'type':Sequelize[_0x1d07('0x2')]},'consumerKey':{'type':Sequelize[_0x1d07('0x2')]},'consumerSecret':{'type':Sequelize[_0x1d07('0x2')]},'token':{'type':Sequelize[_0x1d07('0x2')]},'tokenSecret':{'type':Sequelize[_0x1d07('0x2')]},'serverUrl':{'type':Sequelize[_0x1d07('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1d07('0x3')]('integrationTab',_0x1d07('0x5')),'defaultValue':_0x1d07('0x6')}}; \ No newline at end of file +var _0x00dc=['newTab','integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x00dc,0x18a));var _0xc00d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00dc[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xc00d('0x0'));module[_0xc00d('0x1')]={'name':{'type':Sequelize[_0xc00d('0x2')]},'description':{'type':Sequelize[_0xc00d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc00d('0x2')]},'authType':{'type':Sequelize[_0xc00d('0x3')](_0xc00d('0x4')),'defaultValue':_0xc00d('0x4')},'password':{'type':Sequelize[_0xc00d('0x2')]},'consumerKey':{'type':Sequelize[_0xc00d('0x2')]},'consumerSecret':{'type':Sequelize[_0xc00d('0x2')]},'token':{'type':Sequelize[_0xc00d('0x2')]},'tokenSecret':{'type':Sequelize[_0xc00d('0x2')]},'serverUrl':{'type':Sequelize[_0xc00d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc00d('0x3')]('integrationTab',_0xc00d('0x5')),'defaultValue':_0xc00d('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 0359933..8608522 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 _0x5e39=['order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','basic','headers','format','Basic\x20%s','%s:%s','toString','base64','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','DeskAccount','rawAttributes','type','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x5e39,0x11a));var _0x95e3=function(_0x3a2fa0,_0x5a64a0){_0x3a2fa0=_0x3a2fa0-0x0;var _0xad899c=_0x5e39[_0x3a2fa0];return _0xad899c;};'use strict';var emlformat=require(_0x95e3('0x0'));var rimraf=require(_0x95e3('0x1'));var zipdir=require(_0x95e3('0x2'));var jsonpatch=require(_0x95e3('0x3'));var rp=require(_0x95e3('0x4'));var moment=require(_0x95e3('0x5'));var BPromise=require(_0x95e3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x95e3('0x7'));var sox=require('sox');var csv=require(_0x95e3('0x8'));var ejs=require(_0x95e3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e3('0xa'));var squel=require(_0x95e3('0xb'));var crypto=require(_0x95e3('0xc'));var jsforce=require(_0x95e3('0xd'));var deskjs=require(_0x95e3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95e3('0xf'));var Redis=require(_0x95e3('0x10'));var authService=require(_0x95e3('0x11'));var qs=require(_0x95e3('0x12'));var as=require(_0x95e3('0x13'));var hardwareService=require(_0x95e3('0x14'));var logger=require(_0x95e3('0x15'))(_0x95e3('0x16'));var utils=require('../../config/utils');var config=require(_0x95e3('0x17'));var licenseUtil=require(_0x95e3('0x18'));var db=require(_0x95e3('0x19'))['db'];var integrations=require(_0x95e3('0x1a'));function respondWithStatusCode(_0x48498b,_0x183b1d){_0x183b1d=_0x183b1d||0xcc;return function(_0x48e68e){if(_0x48e68e){return _0x48498b[_0x95e3('0x1b')](_0x183b1d);}return _0x48498b['status'](_0x183b1d)['end']();};}function respondWithResult(_0x500103,_0x5199be){_0x5199be=_0x5199be||0xc8;return function(_0x59b255){if(_0x59b255){return _0x500103[_0x95e3('0x1c')](_0x5199be)[_0x95e3('0x1d')](_0x59b255);}};}function respondWithFilteredResult(_0x5d1f4c,_0x3d4664){return function(_0x537256){if(_0x537256){var _0x260853=typeof _0x3d4664[_0x95e3('0x1e')]===_0x95e3('0x1f')&&typeof _0x3d4664[_0x95e3('0x20')]===_0x95e3('0x1f');var _0x3f6127=_0x537256[_0x95e3('0x21')];var _0x5c06c4=_0x260853?0x0:_0x3d4664[_0x95e3('0x1e')];var _0x3978f5=_0x260853?_0x537256[_0x95e3('0x21')]:_0x3d4664[_0x95e3('0x1e')]+_0x3d4664['limit'];var _0x29f962;if(_0x3978f5>=_0x3f6127){_0x3978f5=_0x3f6127;_0x29f962=0xc8;}else{_0x29f962=0xce;}_0x5d1f4c[_0x95e3('0x1c')](_0x29f962);return _0x5d1f4c[_0x95e3('0x22')]('Content-Range',_0x5c06c4+'-'+_0x3978f5+'/'+_0x3f6127)['json'](_0x537256);}return null;};}function patchUpdates(_0x22bd40){return function(_0x57d331){try{jsonpatch[_0x95e3('0x23')](_0x57d331,_0x22bd40,!![]);}catch(_0x2b785f){return BPromise[_0x95e3('0x24')](_0x2b785f);}return _0x57d331[_0x95e3('0x25')]();};}function saveUpdates(_0x31ead3,_0x1746f7){return function(_0x5324cb){if(_0x5324cb){return _0x5324cb[_0x95e3('0x26')](_0x31ead3)['then'](function(_0x4689d1){return _0x4689d1;});}return null;};}function removeEntity(_0x53120d,_0x24efac){return function(_0x4e147c){if(_0x4e147c){return _0x4e147c[_0x95e3('0x27')]()[_0x95e3('0x28')](function(){_0x53120d[_0x95e3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209d30,_0x56d88c){return function(_0x1f6ffb){if(!_0x1f6ffb){_0x209d30[_0x95e3('0x1b')](0x194);}return _0x1f6ffb;};}function handleError(_0x4af696,_0x53298b){_0x53298b=_0x53298b||0x1f4;return function(_0x3a8496){logger['error'](_0x3a8496[_0x95e3('0x29')]);if(_0x3a8496[_0x95e3('0x2a')]){delete _0x3a8496[_0x95e3('0x2a')];}_0x4af696[_0x95e3('0x1c')](_0x53298b)[_0x95e3('0x2b')](_0x3a8496);};}exports[_0x95e3('0x2c')]=function(_0x46c4e5,_0xbd1929){var _0x19f7ae={},_0x51433c={},_0x134ace={'count':0x0,'rows':[]};var _0x433993=_[_0x95e3('0x2d')](db[_0x95e3('0x2e')][_0x95e3('0x2f')],function(_0x365c2f){return{'name':_0x365c2f['fieldName'],'type':_0x365c2f[_0x95e3('0x30')]['key']};});_0x51433c['model']=_[_0x95e3('0x2d')](_0x433993,_0x95e3('0x2a'));_0x51433c['query']=_['keys'](_0x46c4e5['query']);_0x51433c[_0x95e3('0x31')]=_[_0x95e3('0x32')](_0x51433c[_0x95e3('0x33')],_0x51433c[_0x95e3('0x34')]);_0x19f7ae[_0x95e3('0x35')]=_['intersection'](_0x51433c[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x36')]));_0x19f7ae[_0x95e3('0x35')]=_0x19f7ae[_0x95e3('0x35')][_0x95e3('0x37')]?_0x19f7ae[_0x95e3('0x35')]:_0x51433c[_0x95e3('0x33')];if(!_0x46c4e5[_0x95e3('0x34')]['hasOwnProperty'](_0x95e3('0x38'))){_0x19f7ae[_0x95e3('0x20')]=qs[_0x95e3('0x20')](_0x46c4e5['query'][_0x95e3('0x20')]);_0x19f7ae[_0x95e3('0x1e')]=qs[_0x95e3('0x1e')](_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x1e')]);}_0x19f7ae[_0x95e3('0x39')]=qs[_0x95e3('0x3a')](_0x46c4e5[_0x95e3('0x34')]['sort']);_0x19f7ae['where']=qs[_0x95e3('0x31')](_[_0x95e3('0x3b')](_0x46c4e5[_0x95e3('0x34')],_0x51433c[_0x95e3('0x31')]),_0x433993);if(_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x3c')]){_0x19f7ae[_0x95e3('0x3d')]=_[_0x95e3('0x3e')](_0x19f7ae['where'],{'$or':_['map'](_0x433993,function(_0x1c5170){if(_0x1c5170[_0x95e3('0x30')]!==_0x95e3('0x3f')){var _0x195292={};_0x195292[_0x1c5170['name']]={'$like':'%'+_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x3c')]+'%'};return _0x195292;}})});}_0x19f7ae=_[_0x95e3('0x3e')]({},_0x19f7ae,_0x46c4e5[_0x95e3('0x40')]);var _0x380ced={'where':_0x19f7ae['where']};return db[_0x95e3('0x2e')]['count'](_0x380ced)[_0x95e3('0x28')](function(_0x502163){_0x134ace['count']=_0x502163;if(_0x46c4e5[_0x95e3('0x34')][_0x95e3('0x41')]){_0x19f7ae[_0x95e3('0x42')]=[{'all':!![]}];}return db[_0x95e3('0x2e')]['findAll'](_0x19f7ae);})[_0x95e3('0x28')](function(_0x52c373){_0x134ace[_0x95e3('0x43')]=_0x52c373;return _0x134ace;})[_0x95e3('0x28')](respondWithFilteredResult(_0xbd1929,_0x19f7ae))[_0x95e3('0x44')](handleError(_0xbd1929,null));};exports[_0x95e3('0x45')]=function(_0x37bec8,_0x14bbfc){var _0x4f98c2={'raw':![],'where':{'id':_0x37bec8[_0x95e3('0x46')]['id']}},_0x5777d4={};_0x5777d4['model']=_[_0x95e3('0x47')](db[_0x95e3('0x2e')][_0x95e3('0x2f')]);_0x5777d4['query']=_[_0x95e3('0x47')](_0x37bec8[_0x95e3('0x34')]);_0x5777d4[_0x95e3('0x31')]=_[_0x95e3('0x32')](_0x5777d4[_0x95e3('0x33')],_0x5777d4[_0x95e3('0x34')]);_0x4f98c2[_0x95e3('0x35')]=_[_0x95e3('0x32')](_0x5777d4[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x37bec8[_0x95e3('0x34')]['fields']));_0x4f98c2[_0x95e3('0x35')]=_0x4f98c2[_0x95e3('0x35')]['length']?_0x4f98c2[_0x95e3('0x35')]:_0x5777d4[_0x95e3('0x33')];if(_0x37bec8['query'][_0x95e3('0x41')]){_0x4f98c2[_0x95e3('0x42')]=[{'all':!![]}];}_0x4f98c2=_[_0x95e3('0x3e')]({},_0x4f98c2,_0x37bec8[_0x95e3('0x40')]);return db[_0x95e3('0x2e')]['find'](_0x4f98c2)[_0x95e3('0x28')](handleEntityNotFound(_0x14bbfc,null))['then'](respondWithResult(_0x14bbfc,null))[_0x95e3('0x44')](handleError(_0x14bbfc,null));};exports[_0x95e3('0x48')]=function(_0x471e37,_0x4998e3){return db[_0x95e3('0x2e')][_0x95e3('0x48')](_0x471e37[_0x95e3('0x49')],{})[_0x95e3('0x28')](respondWithResult(_0x4998e3,0xc9))['catch'](handleError(_0x4998e3,null));};exports[_0x95e3('0x26')]=function(_0x12dc30,_0x5c4fa1){if(_0x12dc30[_0x95e3('0x49')]['id']){delete _0x12dc30[_0x95e3('0x49')]['id'];}return db[_0x95e3('0x2e')][_0x95e3('0x4a')]({'where':{'id':_0x12dc30[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x5c4fa1,null))[_0x95e3('0x28')](saveUpdates(_0x12dc30[_0x95e3('0x49')],null))['then'](respondWithResult(_0x5c4fa1,null))[_0x95e3('0x44')](handleError(_0x5c4fa1,null));};exports['destroy']=function(_0x33709c,_0x2cc2ed){return db[_0x95e3('0x2e')][_0x95e3('0x4a')]({'where':{'id':_0x33709c['params']['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x2cc2ed,null))[_0x95e3('0x28')](removeEntity(_0x2cc2ed,null))[_0x95e3('0x44')](handleError(_0x2cc2ed,null));};exports[_0x95e3('0x4b')]=function(_0x20d628,_0x1fb8b0,_0x30609c){var _0x1f0574={};var _0x312cf8={};var _0x392206;var _0x10593a;return db[_0x95e3('0x2e')][_0x95e3('0x4c')]({'where':{'id':_0x20d628[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x1fb8b0,null))[_0x95e3('0x28')](function(_0x7d637c){if(_0x7d637c){_0x392206=_0x7d637c;_0x312cf8['model']=_[_0x95e3('0x47')](db[_0x95e3('0x4d')][_0x95e3('0x2f')]);_0x312cf8[_0x95e3('0x34')]=_[_0x95e3('0x47')](_0x20d628[_0x95e3('0x34')]);_0x312cf8['filters']=_['intersection'](_0x312cf8[_0x95e3('0x33')],_0x312cf8[_0x95e3('0x34')]);_0x1f0574[_0x95e3('0x35')]=_['intersection'](_0x312cf8[_0x95e3('0x33')],qs[_0x95e3('0x36')](_0x20d628[_0x95e3('0x34')]['fields']));_0x1f0574[_0x95e3('0x35')]=_0x1f0574[_0x95e3('0x35')][_0x95e3('0x37')]?_0x1f0574[_0x95e3('0x35')]:_0x312cf8[_0x95e3('0x33')];_0x1f0574['order']=qs['sort'](_0x20d628['query'][_0x95e3('0x3a')]);_0x1f0574[_0x95e3('0x3d')]=qs[_0x95e3('0x31')](_[_0x95e3('0x3b')](_0x20d628[_0x95e3('0x34')],_0x312cf8[_0x95e3('0x31')]));if(_0x20d628['query'][_0x95e3('0x3c')]){_0x1f0574['where']=_['merge'](_0x1f0574[_0x95e3('0x3d')],{'$or':_[_0x95e3('0x2d')](_0x1f0574[_0x95e3('0x35')],function(_0x5bdde8){var _0x267499={};_0x267499[_0x5bdde8]={'$like':'%'+_0x20d628['query'][_0x95e3('0x3c')]+'%'};return _0x267499;})});}_0x1f0574=_[_0x95e3('0x3e')]({},_0x1f0574,_0x20d628[_0x95e3('0x40')]);return _0x392206['getConfigurations'](_0x1f0574);}})[_0x95e3('0x28')](function(_0x43ebd2){if(_0x43ebd2){_0x10593a=_0x43ebd2[_0x95e3('0x37')];if(!_0x20d628[_0x95e3('0x34')][_0x95e3('0x4e')](_0x95e3('0x38'))){_0x1f0574[_0x95e3('0x20')]=qs[_0x95e3('0x20')](_0x20d628[_0x95e3('0x34')][_0x95e3('0x20')]);_0x1f0574[_0x95e3('0x1e')]=qs[_0x95e3('0x1e')](_0x20d628[_0x95e3('0x34')][_0x95e3('0x1e')]);}return _0x392206[_0x95e3('0x4b')](_0x1f0574);}})[_0x95e3('0x28')](function(_0x815703){if(_0x815703){return _0x815703?{'count':_0x10593a,'rows':_0x815703}:null;}})[_0x95e3('0x28')](respondWithResult(_0x1fb8b0,null))[_0x95e3('0x44')](handleError(_0x1fb8b0,null));};exports['addConfiguration']=function(_0x3d19e8,_0x2ef78b,_0x108aff){if(_0x3d19e8[_0x95e3('0x49')]['id']){delete _0x3d19e8[_0x95e3('0x49')]['id'];}return db['DeskAccount'][_0x95e3('0x4c')]({'where':{'id':_0x3d19e8[_0x95e3('0x46')]['id']}})[_0x95e3('0x28')](handleEntityNotFound(_0x2ef78b,null))['then'](function(_0x2673ed){if(_0x2673ed){_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x4f')]=_0x2673ed['id'];_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x50')]=integrations[_0x95e3('0x51')](_0x3d19e8['body'][_0x95e3('0x52')],_0x3d19e8[_0x95e3('0x49')][_0x95e3('0x30')]);_0x3d19e8['body'][_0x95e3('0x53')]=integrations[_0x95e3('0x54')](_0x3d19e8[_0x95e3('0x49')]['channel'],_0x3d19e8[_0x95e3('0x49')]['type']);return db[_0x95e3('0x4d')][_0x95e3('0x48')](_0x3d19e8['body'],{'include':[{'model':db[_0x95e3('0x55')],'as':_0x95e3('0x50')},{'model':db[_0x95e3('0x55')],'as':_0x95e3('0x53')}]});}return null;})[_0x95e3('0x28')](respondWithResult(_0x2ef78b,null))[_0x95e3('0x44')](handleError(_0x2ef78b,null));};exports['getFields']=function(_0x4c9919,_0x235fd6,_0x81433b){var _0x350637=[{'name':_0x95e3('0x56'),'label':_0x95e3('0x56'),'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 _0x532ef4='';return db[_0x95e3('0x2e')]['findOne']({'where':{'id':_0x4c9919['params']['id']},'attributes':['id','remoteUri','authType','username',_0x95e3('0x57'),_0x95e3('0x58'),_0x95e3('0x59'),_0x95e3('0x5a'),_0x95e3('0x5b')]})[_0x95e3('0x28')](handleEntityNotFound(_0x235fd6,null))['then'](function(_0x5223ea){if(_0x5223ea){_0x532ef4=_0x5223ea['remoteUri'];var _0x25aa72=_0x532ef4['slice'](-0x1);if(_0x25aa72==='/'){_0x532ef4=_0x532ef4[_0x95e3('0x5c')](0x0,_0x532ef4[_0x95e3('0x5d')](_0x25aa72));}var _0x489ba8={'method':_0x95e3('0x5e'),'uri':util['format'](_0x95e3('0x5f'),_0x532ef4),'headers':{'Content-Type':_0x95e3('0x60'),'Accept':_0x95e3('0x60')},'json':!![]};if(_0x5223ea[_0x95e3('0x61')]===_0x95e3('0x62')){_0x489ba8[_0x95e3('0x63')]['Authorization']=util[_0x95e3('0x64')](_0x95e3('0x65'),new Buffer(util[_0x95e3('0x64')](_0x95e3('0x66'),_0x5223ea['username'],_0x5223ea[_0x95e3('0x57')]))[_0x95e3('0x67')](_0x95e3('0x68')));}return rp(_0x489ba8)['then'](function(_0x3925d9){return _0x350637['concat'](_['map'](_0x3925d9['_embedded'][_0x95e3('0x69')],function(_0x12bb3f){return{'id':_0x12bb3f[_0x95e3('0x2a')],'name':_0x12bb3f[_0x95e3('0x2a')],'type':_0x12bb3f[_0x95e3('0x30')],'active':_0x12bb3f['active'],'label':_0x12bb3f[_0x95e3('0x6a')],'custom':!![]};}));});}})[_0x95e3('0x28')](function(_0x8600b8){return{'count':_0x8600b8['length'],'rows':_0x8600b8};})[_0x95e3('0x28')](respondWithResult(_0x235fd6,null))['catch'](function(_0x4de792){var _0x588fff=_0x4c9919[_0x95e3('0x34')]['test']?0x1f4:_0x4de792[_0x95e3('0x6b')]||0x1f4;logger['error'](_0x95e3('0x6c'),_0x95e3('0x6d'),_0x588fff,JSON[_0x95e3('0x6e')](_0x4de792));delete _0x4de792[_0x95e3('0x2a')];if(_0x588fff===0x191){_0x588fff=0x190;}_0x235fd6[_0x95e3('0x1c')](_0x588fff)['send'](_0x4c9919[_0x95e3('0x34')][_0x95e3('0x6f')]?{'message':_0x95e3('0x70'),'statusCode':_0x4de792[_0x95e3('0x6b')]}:_0x4de792);});}; \ No newline at end of file +var _0x5233=['getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','base64','_embedded','entries','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','limit','count','offset','status','Content-Range','apply','save','update','then','destroy','error','name','send','map','DeskAccount','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','rawAttributes','create','body','find','findOne','DeskConfiguration','sort','nolimit'];(function(_0x568571,_0x28e2b4){var _0xb7d14b=function(_0x2090f7){while(--_0x2090f7){_0x568571['push'](_0x568571['shift']());}};_0xb7d14b(++_0x28e2b4);}(_0x5233,0x8f));var _0x3523=function(_0x33f262,_0x554664){_0x33f262=_0x33f262-0x0;var _0x127196=_0x5233[_0x33f262];return _0x127196;};'use strict';var emlformat=require(_0x3523('0x0'));var rimraf=require(_0x3523('0x1'));var zipdir=require(_0x3523('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3523('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3523('0x4'));var util=require(_0x3523('0x5'));var path=require('path');var sox=require(_0x3523('0x6'));var csv=require('to-csv');var ejs=require(_0x3523('0x7'));var fs=require('fs');var fs_extra=require(_0x3523('0x8'));var _=require(_0x3523('0x9'));var squel=require(_0x3523('0xa'));var crypto=require(_0x3523('0xb'));var jsforce=require(_0x3523('0xc'));var deskjs=require(_0x3523('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3523('0xe'));var Papa=require(_0x3523('0xf'));var Redis=require(_0x3523('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3523('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3523('0x12'));var logger=require('../../config/logger')(_0x3523('0x13'));var utils=require('../../config/utils');var config=require(_0x3523('0x14'));var licenseUtil=require(_0x3523('0x15'));var db=require(_0x3523('0x16'))['db'];var integrations=require(_0x3523('0x17'));function respondWithStatusCode(_0x44386b,_0xdc3ad5){_0xdc3ad5=_0xdc3ad5||0xcc;return function(_0xf12477){if(_0xf12477){return _0x44386b[_0x3523('0x18')](_0xdc3ad5);}return _0x44386b['status'](_0xdc3ad5)[_0x3523('0x19')]();};}function respondWithResult(_0x52f983,_0x39cba8){_0x39cba8=_0x39cba8||0xc8;return function(_0x6d548c){if(_0x6d548c){return _0x52f983['status'](_0x39cba8)[_0x3523('0x1a')](_0x6d548c);}};}function respondWithFilteredResult(_0x1534f6,_0x53c445){return function(_0xed3b69){if(_0xed3b69){var _0x16df37=typeof _0x53c445['offset']==='undefined'&&typeof _0x53c445[_0x3523('0x1b')]==='undefined';var _0x429123=_0xed3b69[_0x3523('0x1c')];var _0x13eb3a=_0x16df37?0x0:_0x53c445['offset'];var _0x37c7fb=_0x16df37?_0xed3b69[_0x3523('0x1c')]:_0x53c445[_0x3523('0x1d')]+_0x53c445[_0x3523('0x1b')];var _0x31524b;if(_0x37c7fb>=_0x429123){_0x37c7fb=_0x429123;_0x31524b=0xc8;}else{_0x31524b=0xce;}_0x1534f6[_0x3523('0x1e')](_0x31524b);return _0x1534f6['set'](_0x3523('0x1f'),_0x13eb3a+'-'+_0x37c7fb+'/'+_0x429123)[_0x3523('0x1a')](_0xed3b69);}return null;};}function patchUpdates(_0x29ff89){return function(_0x578207){try{jsonpatch[_0x3523('0x20')](_0x578207,_0x29ff89,!![]);}catch(_0x2f6b68){return BPromise['reject'](_0x2f6b68);}return _0x578207[_0x3523('0x21')]();};}function saveUpdates(_0xfb5afd,_0x42962d){return function(_0x2448a5){if(_0x2448a5){return _0x2448a5[_0x3523('0x22')](_0xfb5afd)[_0x3523('0x23')](function(_0x5d0292){return _0x5d0292;});}return null;};}function removeEntity(_0x519ae2,_0x650bca){return function(_0x35bee2){if(_0x35bee2){return _0x35bee2[_0x3523('0x24')]()[_0x3523('0x23')](function(){_0x519ae2[_0x3523('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57a0a0,_0x562eda){return function(_0x49458c){if(!_0x49458c){_0x57a0a0['sendStatus'](0x194);}return _0x49458c;};}function handleError(_0x5413a5,_0x28fd9c){_0x28fd9c=_0x28fd9c||0x1f4;return function(_0x1d2663){logger[_0x3523('0x25')](_0x1d2663['stack']);if(_0x1d2663[_0x3523('0x26')]){delete _0x1d2663['name'];}_0x5413a5[_0x3523('0x1e')](_0x28fd9c)[_0x3523('0x27')](_0x1d2663);};}exports['index']=function(_0x8212c1,_0x32cdf0){var _0x48379f={},_0x5603d4={},_0x53babe={'count':0x0,'rows':[]};var _0x3c3a64=_[_0x3523('0x28')](db[_0x3523('0x29')]['rawAttributes'],function(_0x1cf4e8){return{'name':_0x1cf4e8[_0x3523('0x2a')],'type':_0x1cf4e8[_0x3523('0x2b')]['key']};});_0x5603d4[_0x3523('0x2c')]=_[_0x3523('0x28')](_0x3c3a64,_0x3523('0x26'));_0x5603d4[_0x3523('0x2d')]=_['keys'](_0x8212c1[_0x3523('0x2d')]);_0x5603d4[_0x3523('0x2e')]=_[_0x3523('0x2f')](_0x5603d4['model'],_0x5603d4[_0x3523('0x2d')]);_0x48379f['attributes']=_[_0x3523('0x2f')](_0x5603d4[_0x3523('0x2c')],qs['fields'](_0x8212c1['query'][_0x3523('0x30')]));_0x48379f[_0x3523('0x31')]=_0x48379f[_0x3523('0x31')][_0x3523('0x32')]?_0x48379f[_0x3523('0x31')]:_0x5603d4['model'];if(!_0x8212c1[_0x3523('0x2d')][_0x3523('0x33')]('nolimit')){_0x48379f[_0x3523('0x1b')]=qs[_0x3523('0x1b')](_0x8212c1[_0x3523('0x2d')][_0x3523('0x1b')]);_0x48379f[_0x3523('0x1d')]=qs[_0x3523('0x1d')](_0x8212c1[_0x3523('0x2d')][_0x3523('0x1d')]);}_0x48379f[_0x3523('0x34')]=qs['sort'](_0x8212c1['query']['sort']);_0x48379f['where']=qs[_0x3523('0x2e')](_[_0x3523('0x35')](_0x8212c1['query'],_0x5603d4[_0x3523('0x2e')]),_0x3c3a64);if(_0x8212c1[_0x3523('0x2d')]['filter']){_0x48379f[_0x3523('0x36')]=_[_0x3523('0x37')](_0x48379f[_0x3523('0x36')],{'$or':_[_0x3523('0x28')](_0x3c3a64,function(_0x126adb){if(_0x126adb[_0x3523('0x2b')]!==_0x3523('0x38')){var _0x4b3c43={};_0x4b3c43[_0x126adb['name']]={'$like':'%'+_0x8212c1[_0x3523('0x2d')][_0x3523('0x39')]+'%'};return _0x4b3c43;}})});}_0x48379f=_[_0x3523('0x37')]({},_0x48379f,_0x8212c1[_0x3523('0x3a')]);var _0x3183d4={'where':_0x48379f[_0x3523('0x36')]};return db['DeskAccount'][_0x3523('0x1c')](_0x3183d4)['then'](function(_0x1a027d){_0x53babe[_0x3523('0x1c')]=_0x1a027d;if(_0x8212c1[_0x3523('0x2d')][_0x3523('0x3b')]){_0x48379f['include']=[{'all':!![]}];}return db[_0x3523('0x29')][_0x3523('0x3c')](_0x48379f);})['then'](function(_0x2e11c2){_0x53babe['rows']=_0x2e11c2;return _0x53babe;})[_0x3523('0x23')](respondWithFilteredResult(_0x32cdf0,_0x48379f))[_0x3523('0x3d')](handleError(_0x32cdf0,null));};exports[_0x3523('0x3e')]=function(_0x31f1d3,_0x482495){var _0x2c61b9={'raw':![],'where':{'id':_0x31f1d3[_0x3523('0x3f')]['id']}},_0x3e815f={};_0x3e815f['model']=_[_0x3523('0x40')](db['DeskAccount'][_0x3523('0x41')]);_0x3e815f[_0x3523('0x2d')]=_['keys'](_0x31f1d3['query']);_0x3e815f['filters']=_[_0x3523('0x2f')](_0x3e815f[_0x3523('0x2c')],_0x3e815f[_0x3523('0x2d')]);_0x2c61b9[_0x3523('0x31')]=_[_0x3523('0x2f')](_0x3e815f[_0x3523('0x2c')],qs[_0x3523('0x30')](_0x31f1d3[_0x3523('0x2d')]['fields']));_0x2c61b9[_0x3523('0x31')]=_0x2c61b9[_0x3523('0x31')][_0x3523('0x32')]?_0x2c61b9[_0x3523('0x31')]:_0x3e815f['model'];if(_0x31f1d3['query'][_0x3523('0x3b')]){_0x2c61b9['include']=[{'all':!![]}];}_0x2c61b9=_[_0x3523('0x37')]({},_0x2c61b9,_0x31f1d3[_0x3523('0x3a')]);return db[_0x3523('0x29')]['find'](_0x2c61b9)[_0x3523('0x23')](handleEntityNotFound(_0x482495,null))[_0x3523('0x23')](respondWithResult(_0x482495,null))[_0x3523('0x3d')](handleError(_0x482495,null));};exports[_0x3523('0x42')]=function(_0x1b5169,_0x1ae645){return db[_0x3523('0x29')]['create'](_0x1b5169[_0x3523('0x43')],{})[_0x3523('0x23')](respondWithResult(_0x1ae645,0xc9))[_0x3523('0x3d')](handleError(_0x1ae645,null));};exports[_0x3523('0x22')]=function(_0x15838b,_0x265984){if(_0x15838b[_0x3523('0x43')]['id']){delete _0x15838b[_0x3523('0x43')]['id'];}return db[_0x3523('0x29')][_0x3523('0x44')]({'where':{'id':_0x15838b[_0x3523('0x3f')]['id']}})[_0x3523('0x23')](handleEntityNotFound(_0x265984,null))[_0x3523('0x23')](saveUpdates(_0x15838b[_0x3523('0x43')],null))[_0x3523('0x23')](respondWithResult(_0x265984,null))['catch'](handleError(_0x265984,null));};exports[_0x3523('0x24')]=function(_0x221fe0,_0x2b202f){return db[_0x3523('0x29')]['find']({'where':{'id':_0x221fe0[_0x3523('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2b202f,null))[_0x3523('0x23')](removeEntity(_0x2b202f,null))[_0x3523('0x3d')](handleError(_0x2b202f,null));};exports['getConfigurations']=function(_0x5671ca,_0x9f7701,_0x1cbc53){var _0x3fc412={};var _0x3810f8={};var _0x13fad3;var _0x15bb8e;return db['DeskAccount'][_0x3523('0x45')]({'where':{'id':_0x5671ca[_0x3523('0x3f')]['id']}})[_0x3523('0x23')](handleEntityNotFound(_0x9f7701,null))['then'](function(_0xcbbdf4){if(_0xcbbdf4){_0x13fad3=_0xcbbdf4;_0x3810f8[_0x3523('0x2c')]=_[_0x3523('0x40')](db[_0x3523('0x46')][_0x3523('0x41')]);_0x3810f8[_0x3523('0x2d')]=_[_0x3523('0x40')](_0x5671ca[_0x3523('0x2d')]);_0x3810f8['filters']=_['intersection'](_0x3810f8['model'],_0x3810f8[_0x3523('0x2d')]);_0x3fc412['attributes']=_[_0x3523('0x2f')](_0x3810f8[_0x3523('0x2c')],qs[_0x3523('0x30')](_0x5671ca[_0x3523('0x2d')]['fields']));_0x3fc412[_0x3523('0x31')]=_0x3fc412[_0x3523('0x31')][_0x3523('0x32')]?_0x3fc412['attributes']:_0x3810f8['model'];_0x3fc412['order']=qs[_0x3523('0x47')](_0x5671ca[_0x3523('0x2d')]['sort']);_0x3fc412[_0x3523('0x36')]=qs[_0x3523('0x2e')](_[_0x3523('0x35')](_0x5671ca[_0x3523('0x2d')],_0x3810f8['filters']));if(_0x5671ca['query'][_0x3523('0x39')]){_0x3fc412[_0x3523('0x36')]=_[_0x3523('0x37')](_0x3fc412[_0x3523('0x36')],{'$or':_[_0x3523('0x28')](_0x3fc412['attributes'],function(_0x1be540){var _0x2c23c8={};_0x2c23c8[_0x1be540]={'$like':'%'+_0x5671ca[_0x3523('0x2d')][_0x3523('0x39')]+'%'};return _0x2c23c8;})});}_0x3fc412=_[_0x3523('0x37')]({},_0x3fc412,_0x5671ca['options']);return _0x13fad3['getConfigurations'](_0x3fc412);}})[_0x3523('0x23')](function(_0x16cb06){if(_0x16cb06){_0x15bb8e=_0x16cb06['length'];if(!_0x5671ca['query'][_0x3523('0x33')](_0x3523('0x48'))){_0x3fc412[_0x3523('0x1b')]=qs[_0x3523('0x1b')](_0x5671ca[_0x3523('0x2d')]['limit']);_0x3fc412[_0x3523('0x1d')]=qs['offset'](_0x5671ca[_0x3523('0x2d')][_0x3523('0x1d')]);}return _0x13fad3[_0x3523('0x49')](_0x3fc412);}})[_0x3523('0x23')](function(_0x453a67){if(_0x453a67){return _0x453a67?{'count':_0x15bb8e,'rows':_0x453a67}:null;}})[_0x3523('0x23')](respondWithResult(_0x9f7701,null))[_0x3523('0x3d')](handleError(_0x9f7701,null));};exports['addConfiguration']=function(_0x4ff737,_0x19a76f,_0x6709f7){if(_0x4ff737[_0x3523('0x43')]['id']){delete _0x4ff737[_0x3523('0x43')]['id'];}return db[_0x3523('0x29')]['findOne']({'where':{'id':_0x4ff737[_0x3523('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19a76f,null))[_0x3523('0x23')](function(_0x4320b3){if(_0x4320b3){_0x4ff737[_0x3523('0x43')][_0x3523('0x4a')]=_0x4320b3['id'];_0x4ff737[_0x3523('0x43')][_0x3523('0x4b')]=integrations[_0x3523('0x4c')](_0x4ff737[_0x3523('0x43')]['channel'],_0x4ff737[_0x3523('0x43')][_0x3523('0x2b')]);_0x4ff737[_0x3523('0x43')][_0x3523('0x4d')]=integrations[_0x3523('0x4e')](_0x4ff737['body'][_0x3523('0x4f')],_0x4ff737['body'][_0x3523('0x2b')]);return db[_0x3523('0x46')][_0x3523('0x42')](_0x4ff737[_0x3523('0x43')],{'include':[{'model':db[_0x3523('0x50')],'as':'Subjects'},{'model':db[_0x3523('0x50')],'as':'Descriptions'}]});}return null;})[_0x3523('0x23')](respondWithResult(_0x19a76f,null))[_0x3523('0x3d')](handleError(_0x19a76f,null));};exports[_0x3523('0x51')]=function(_0x1d1fe1,_0x5d20cd,_0xa8d343){var _0x2cd8ad=[{'name':_0x3523('0x52'),'label':_0x3523('0x52'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xf4910f='';return db[_0x3523('0x29')]['findOne']({'where':{'id':_0x1d1fe1[_0x3523('0x3f')]['id']},'attributes':['id',_0x3523('0x53'),_0x3523('0x54'),_0x3523('0x55'),_0x3523('0x56'),'consumerKey',_0x3523('0x57'),'token',_0x3523('0x58')]})[_0x3523('0x23')](handleEntityNotFound(_0x5d20cd,null))[_0x3523('0x23')](function(_0x4c1fc5){if(_0x4c1fc5){_0xf4910f=_0x4c1fc5[_0x3523('0x53')];var _0x2196c1=_0xf4910f[_0x3523('0x59')](-0x1);if(_0x2196c1==='/'){_0xf4910f=_0xf4910f[_0x3523('0x5a')](0x0,_0xf4910f[_0x3523('0x5b')](_0x2196c1));}var _0x1253a6={'method':'GET','uri':util[_0x3523('0x5c')](_0x3523('0x5d'),_0xf4910f),'headers':{'Content-Type':_0x3523('0x5e'),'Accept':'application/json'},'json':!![]};if(_0x4c1fc5[_0x3523('0x54')]===_0x3523('0x5f')){_0x1253a6[_0x3523('0x60')][_0x3523('0x61')]=util[_0x3523('0x5c')](_0x3523('0x62'),new Buffer(util[_0x3523('0x5c')](_0x3523('0x63'),_0x4c1fc5[_0x3523('0x55')],_0x4c1fc5[_0x3523('0x56')]))['toString'](_0x3523('0x64')));}return rp(_0x1253a6)[_0x3523('0x23')](function(_0x161313){return _0x2cd8ad['concat'](_['map'](_0x161313[_0x3523('0x65')][_0x3523('0x66')],function(_0x230d15){return{'id':_0x230d15['name'],'name':_0x230d15[_0x3523('0x26')],'type':_0x230d15[_0x3523('0x2b')],'active':_0x230d15['active'],'label':_0x230d15['label'],'custom':!![]};}));});}})[_0x3523('0x23')](function(_0x42b0ad){return{'count':_0x42b0ad['length'],'rows':_0x42b0ad};})[_0x3523('0x23')](respondWithResult(_0x5d20cd,null))[_0x3523('0x3d')](function(_0x33ac96){var _0x4125ed=_0x1d1fe1[_0x3523('0x2d')][_0x3523('0x67')]?0x1f4:_0x33ac96[_0x3523('0x68')]||0x1f4;logger[_0x3523('0x25')](_0x3523('0x69'),_0x3523('0x51'),_0x4125ed,JSON[_0x3523('0x6a')](_0x33ac96));delete _0x33ac96[_0x3523('0x26')];if(_0x4125ed===0x191){_0x4125ed=0x190;}_0x5d20cd[_0x3523('0x1e')](_0x4125ed)[_0x3523('0x27')](_0x1d1fe1[_0x3523('0x2d')][_0x3523('0x67')]?{'message':_0x3523('0x6b'),'statusCode':_0x33ac96['statusCode']}:_0x33ac96);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 155e5d6..700deee 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 _0xcbd4=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','bluebird'];(function(_0x418730,_0x39ee1f){var _0x561e14=function(_0x4d250d){while(--_0x4d250d){_0x418730['push'](_0x418730['shift']());}};_0x561e14(++_0x39ee1f);}(_0xcbd4,0x64));var _0x4cbd=function(_0x24dcc8,_0x3c79f3){_0x24dcc8=_0x24dcc8-0x0;var _0xe6ebac=_0xcbd4[_0x24dcc8];return _0xe6ebac;};'use strict';var _=require(_0x4cbd('0x0'));var util=require('util');var logger=require(_0x4cbd('0x1'))(_0x4cbd('0x2'));var moment=require('moment');var BPromise=require(_0x4cbd('0x3'));var rp=require(_0x4cbd('0x4'));var fs=require('fs');var path=require(_0x4cbd('0x5'));var rimraf=require(_0x4cbd('0x6'));var config=require(_0x4cbd('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x4cbd('0x8'));module[_0x4cbd('0x9')]=function(_0x537180,_0x2c7119){return _0x537180[_0x4cbd('0xa')](_0x4cbd('0xb'),attributes,{'tableName':_0x4cbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40a1=['request-promise','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger','moment'];(function(_0x1780ec,_0x3af2fa){var _0x5c5663=function(_0x23eac9){while(--_0x23eac9){_0x1780ec['push'](_0x1780ec['shift']());}};_0x5c5663(++_0x3af2fa);}(_0x40a1,0xbb));var _0x140a=function(_0x10377d,_0x1e7e5b){_0x10377d=_0x10377d-0x0;var _0x53d46f=_0x40a1[_0x10377d];return _0x53d46f;};'use strict';var _=require(_0x140a('0x0'));var util=require('util');var logger=require(_0x140a('0x1'))('api');var moment=require(_0x140a('0x2'));var BPromise=require('bluebird');var rp=require(_0x140a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x140a('0x4'));var config=require('../../config/environment');var attributes=require(_0x140a('0x5'));var integrations=require(_0x140a('0x6'));module[_0x140a('0x7')]=function(_0x45a29d,_0x515bd0){return _0x45a29d['define'](_0x140a('0x8'),attributes,{'tableName':_0x140a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 1cae291..94883ee 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 _0x3612=['catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x3612,0xa2));var _0x2361=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x3612[_0x1098db];return _0x14f090;};'use strict';var _=require(_0x2361('0x0'));var util=require(_0x2361('0x1'));var moment=require('moment');var BPromise=require(_0x2361('0x2'));var rs=require(_0x2361('0x3'));var fs=require('fs');var Redis=require(_0x2361('0x4'));var db=require(_0x2361('0x5'))['db'];var utils=require(_0x2361('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2361('0x7'));var jayson=require(_0x2361('0x8'));var client=jayson[_0x2361('0x9')][_0x2361('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345dcf,_0x22214d,_0x332e6a){return new BPromise(function(_0x109a6a,_0x1d204a){return client[_0x2361('0xb')](_0x345dcf,_0x332e6a)[_0x2361('0xc')](function(_0x4ff4f3){logger[_0x2361('0xd')](_0x2361('0xe'),_0x22214d,_0x2361('0xf'));logger[_0x2361('0x10')](_0x2361('0x11'),_0x22214d,'request\x20sent',JSON[_0x2361('0x12')](_0x4ff4f3));if(_0x4ff4f3[_0x2361('0x13')]){if(_0x4ff4f3['error'][_0x2361('0x14')]===0x1f4){logger[_0x2361('0x13')](_0x2361('0xe'),_0x22214d,_0x4ff4f3[_0x2361('0x13')]['message']);return _0x1d204a(_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);}logger[_0x2361('0x13')]('DeskAccount,\x20%s,\x20%s',_0x22214d,_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);return _0x109a6a(_0x4ff4f3[_0x2361('0x13')][_0x2361('0x15')]);}else{logger[_0x2361('0xd')](_0x2361('0xe'),_0x22214d,_0x2361('0xf'));_0x109a6a(_0x4ff4f3[_0x2361('0x16')][_0x2361('0x15')]);}})[_0x2361('0x17')](function(_0x40ffeb){logger['error'](_0x2361('0xe'),_0x22214d,_0x40ffeb);_0x1d204a(_0x40ffeb);});});}exports['GetDeskAccount']=function(_0x359bc5){var _0x119a1c=this;return new Promise(function(_0x5a36f5,_0x53bc6e){return db[_0x2361('0x18')][_0x2361('0x19')]({'raw':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')][_0x2361('0x1b')]===undefined?!![]:![]:!![],'where':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')][_0x2361('0x1c')]||null:null,'attributes':_0x359bc5[_0x2361('0x1a')]?_0x359bc5['options'][_0x2361('0x1d')]||null:null,'limit':_0x359bc5[_0x2361('0x1a')]?_0x359bc5['options'][_0x2361('0x1e')]||null:null,'include':_0x359bc5[_0x2361('0x1a')]?_0x359bc5[_0x2361('0x1a')]['include']?_['map'](_0x359bc5[_0x2361('0x1a')]['include'],function(_0x5d2368){return{'model':db[_0x5d2368['model']],'as':_0x5d2368['as'],'attributes':_0x5d2368['attributes'],'include':_0x5d2368[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x5d2368['include'],function(_0x53bc76){return{'model':db[_0x53bc76[_0x2361('0x21')]],'as':_0x53bc76['as'],'attributes':_0x53bc76['attributes'],'include':_0x53bc76[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x53bc76[_0x2361('0x1f')],function(_0x362a9d){return{'model':db[_0x362a9d[_0x2361('0x21')]],'as':_0x362a9d['as'],'attributes':_0x362a9d[_0x2361('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2548a0){logger[_0x2361('0xd')](_0x2361('0x22'),_0x359bc5);logger[_0x2361('0x10')](_0x2361('0x22'),_0x359bc5,JSON[_0x2361('0x12')](_0x2548a0));_0x5a36f5(_0x2548a0);})['catch'](function(_0x5556c8){logger[_0x2361('0x13')](_0x2361('0x22'),_0x5556c8[_0x2361('0x15')],_0x359bc5);_0x53bc6e(_0x119a1c['error'](0x1f4,_0x5556c8['message']));});});};exports[_0x2361('0x23')]=function(_0x4cae27){var _0x498aee=this;return new Promise(function(_0x423a33,_0x54e35c){return db[_0x2361('0x18')][_0x2361('0x24')]({'raw':_0x4cae27[_0x2361('0x1a')]?_0x4cae27[_0x2361('0x1a')][_0x2361('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cae27['options']?_0x4cae27[_0x2361('0x1a')][_0x2361('0x1c')]||null:null,'attributes':_0x4cae27[_0x2361('0x1a')]?_0x4cae27['options'][_0x2361('0x1d')]||null:null,'include':_0x4cae27[_0x2361('0x1a')]?_0x4cae27['options'][_0x2361('0x1f')]?_[_0x2361('0x20')](_0x4cae27['options'][_0x2361('0x1f')],function(_0x4c18d8){return{'model':db[_0x4c18d8['model']],'as':_0x4c18d8['as'],'attributes':_0x4c18d8[_0x2361('0x1d')],'include':_0x4c18d8[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x4c18d8[_0x2361('0x1f')],function(_0x17b2c7){return{'model':db[_0x17b2c7['model']],'as':_0x17b2c7['as'],'attributes':_0x17b2c7[_0x2361('0x1d')],'include':_0x17b2c7[_0x2361('0x1f')]?_[_0x2361('0x20')](_0x17b2c7[_0x2361('0x1f')],function(_0x2f6c35){return{'model':db[_0x2f6c35[_0x2361('0x21')]],'as':_0x2f6c35['as'],'attributes':_0x2f6c35['attributes']};}):[]};}):[]};}):[]:[]})[_0x2361('0xc')](function(_0x2902ce){logger['info']('ShowDeskAccount',_0x4cae27);logger['debug'](_0x2361('0x23'),_0x4cae27,JSON['stringify'](_0x2902ce));_0x423a33(_0x2902ce);})[_0x2361('0x17')](function(_0x55fcaa){logger['error'](_0x2361('0x23'),_0x55fcaa['message'],_0x4cae27);_0x54e35c(_0x498aee[_0x2361('0x13')](0x1f4,_0x55fcaa[_0x2361('0x15')]));});});}; \ No newline at end of file +var _0x5bce=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','DeskAccount','find','lodash','util','moment'];(function(_0x6ef6a3,_0x28919a){var _0x39dcb7=function(_0x2e69f6){while(--_0x2e69f6){_0x6ef6a3['push'](_0x6ef6a3['shift']());}};_0x39dcb7(++_0x28919a);}(_0x5bce,0x12d));var _0xe5bc=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0x5bce[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0xe5bc('0x0'));var util=require(_0xe5bc('0x1'));var moment=require(_0xe5bc('0x2'));var BPromise=require(_0xe5bc('0x3'));var rs=require(_0xe5bc('0x4'));var fs=require('fs');var Redis=require(_0xe5bc('0x5'));var db=require(_0xe5bc('0x6'))['db'];var utils=require(_0xe5bc('0x7'));var logger=require(_0xe5bc('0x8'))('rpc');var config=require(_0xe5bc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe5bc('0xa')][_0xe5bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x149222,_0x3df8e8,_0x229a83){return new BPromise(function(_0x26db42,_0x54a242){return client[_0xe5bc('0xc')](_0x149222,_0x229a83)[_0xe5bc('0xd')](function(_0x2c71fe){logger[_0xe5bc('0xe')](_0xe5bc('0xf'),_0x3df8e8,'request\x20sent');logger[_0xe5bc('0x10')](_0xe5bc('0x11'),_0x3df8e8,_0xe5bc('0x12'),JSON[_0xe5bc('0x13')](_0x2c71fe));if(_0x2c71fe[_0xe5bc('0x14')]){if(_0x2c71fe['error'][_0xe5bc('0x15')]===0x1f4){logger[_0xe5bc('0x14')]('DeskAccount,\x20%s,\x20%s',_0x3df8e8,_0x2c71fe[_0xe5bc('0x14')][_0xe5bc('0x16')]);return _0x54a242(_0x2c71fe[_0xe5bc('0x14')]['message']);}logger[_0xe5bc('0x14')](_0xe5bc('0xf'),_0x3df8e8,_0x2c71fe[_0xe5bc('0x14')][_0xe5bc('0x16')]);return _0x26db42(_0x2c71fe[_0xe5bc('0x14')][_0xe5bc('0x16')]);}else{logger[_0xe5bc('0xe')](_0xe5bc('0xf'),_0x3df8e8,_0xe5bc('0x12'));_0x26db42(_0x2c71fe[_0xe5bc('0x17')][_0xe5bc('0x16')]);}})['catch'](function(_0x3d2b28){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3df8e8,_0x3d2b28);_0x54a242(_0x3d2b28);});});}exports[_0xe5bc('0x18')]=function(_0x333b80){var _0x2d6ebc=this;return new Promise(function(_0x26f796,_0xa8785f){return db['DeskAccount'][_0xe5bc('0x19')]({'raw':_0x333b80['options']?_0x333b80[_0xe5bc('0x1a')][_0xe5bc('0x1b')]===undefined?!![]:![]:!![],'where':_0x333b80['options']?_0x333b80['options'][_0xe5bc('0x1c')]||null:null,'attributes':_0x333b80[_0xe5bc('0x1a')]?_0x333b80[_0xe5bc('0x1a')][_0xe5bc('0x1d')]||null:null,'limit':_0x333b80[_0xe5bc('0x1a')]?_0x333b80[_0xe5bc('0x1a')][_0xe5bc('0x1e')]||null:null,'include':_0x333b80[_0xe5bc('0x1a')]?_0x333b80[_0xe5bc('0x1a')][_0xe5bc('0x1f')]?_[_0xe5bc('0x20')](_0x333b80[_0xe5bc('0x1a')][_0xe5bc('0x1f')],function(_0x440a3d){return{'model':db[_0x440a3d[_0xe5bc('0x21')]],'as':_0x440a3d['as'],'attributes':_0x440a3d[_0xe5bc('0x1d')],'include':_0x440a3d[_0xe5bc('0x1f')]?_[_0xe5bc('0x20')](_0x440a3d[_0xe5bc('0x1f')],function(_0x10776e){return{'model':db[_0x10776e[_0xe5bc('0x21')]],'as':_0x10776e['as'],'attributes':_0x10776e[_0xe5bc('0x1d')],'include':_0x10776e[_0xe5bc('0x1f')]?_['map'](_0x10776e['include'],function(_0x5f6161){return{'model':db[_0x5f6161['model']],'as':_0x5f6161['as'],'attributes':_0x5f6161[_0xe5bc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe5bc('0xd')](function(_0x464cdf){logger['info'](_0xe5bc('0x18'),_0x333b80);logger[_0xe5bc('0x10')](_0xe5bc('0x18'),_0x333b80,JSON['stringify'](_0x464cdf));_0x26f796(_0x464cdf);})[_0xe5bc('0x22')](function(_0x37f4c8){logger['error']('GetDeskAccount',_0x37f4c8[_0xe5bc('0x16')],_0x333b80);_0xa8785f(_0x2d6ebc[_0xe5bc('0x14')](0x1f4,_0x37f4c8[_0xe5bc('0x16')]));});});};exports[_0xe5bc('0x23')]=function(_0xae4067){var _0x41b779=this;return new Promise(function(_0x12fa8e,_0x298f9e){return db[_0xe5bc('0x24')][_0xe5bc('0x25')]({'raw':_0xae4067[_0xe5bc('0x1a')]?_0xae4067[_0xe5bc('0x1a')][_0xe5bc('0x1b')]===undefined?!![]:![]:!![],'where':_0xae4067[_0xe5bc('0x1a')]?_0xae4067[_0xe5bc('0x1a')]['where']||null:null,'attributes':_0xae4067[_0xe5bc('0x1a')]?_0xae4067['options'][_0xe5bc('0x1d')]||null:null,'include':_0xae4067['options']?_0xae4067[_0xe5bc('0x1a')][_0xe5bc('0x1f')]?_[_0xe5bc('0x20')](_0xae4067[_0xe5bc('0x1a')][_0xe5bc('0x1f')],function(_0x4da39c){return{'model':db[_0x4da39c[_0xe5bc('0x21')]],'as':_0x4da39c['as'],'attributes':_0x4da39c[_0xe5bc('0x1d')],'include':_0x4da39c[_0xe5bc('0x1f')]?_[_0xe5bc('0x20')](_0x4da39c[_0xe5bc('0x1f')],function(_0x1f1652){return{'model':db[_0x1f1652[_0xe5bc('0x21')]],'as':_0x1f1652['as'],'attributes':_0x1f1652['attributes'],'include':_0x1f1652['include']?_[_0xe5bc('0x20')](_0x1f1652[_0xe5bc('0x1f')],function(_0x4b9ec1){return{'model':db[_0x4b9ec1['model']],'as':_0x4b9ec1['as'],'attributes':_0x4b9ec1[_0xe5bc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46c96a){logger[_0xe5bc('0xe')](_0xe5bc('0x23'),_0xae4067);logger[_0xe5bc('0x10')]('ShowDeskAccount',_0xae4067,JSON[_0xe5bc('0x13')](_0x46c96a));_0x12fa8e(_0x46c96a);})[_0xe5bc('0x22')](function(_0x597fd6){logger['error'](_0xe5bc('0x23'),_0x597fd6[_0xe5bc('0x16')],_0xae4067);_0x298f9e(_0x41b779['error'](0x1f4,_0x597fd6[_0xe5bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b550c00..1d3b5a2 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0x55ca,0x126));var _0xa55c=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x55ca[_0x4cee4b];return _0x4d891d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1b13ec,_0x433da9){var _0x5fdc7f=function(_0x53f3cd){while(--_0x53f3cd){_0x1b13ec['push'](_0x1b13ec['shift']());}};_0x5fdc7f(++_0x433da9);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6674453..9d46f28 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 _0xc39a=['STRING','exports'];(function(_0x4d442d,_0x31af2d){var _0x58c92f=function(_0x188d29){while(--_0x188d29){_0x4d442d['push'](_0x4d442d['shift']());}};_0x58c92f(++_0x31af2d);}(_0xc39a,0x77));var _0xac39=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xc39a[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require('sequelize');module[_0xac39('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac39('0x1')]}}; \ No newline at end of file +var _0xab81=['STRING','sequelize','exports'];(function(_0x43a5b3,_0x4d14b3){var _0x824c95=function(_0x252858){while(--_0x252858){_0x43a5b3['push'](_0x43a5b3['shift']());}};_0x824c95(++_0x4d14b3);}(_0xab81,0xa9));var _0x1ab8=function(_0x772a64,_0x49650b){_0x772a64=_0x772a64-0x0;var _0x560fb0=_0xab81[_0x772a64];return _0x560fb0;};'use strict';var Sequelize=require(_0x1ab8('0x0'));module[_0x1ab8('0x1')]={'name':{'type':Sequelize[_0x1ab8('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b826d2a..77a5fec 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 _0x44a4=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','findOne','DeskField','getFields','nolimit','getSubjects','hasOwnProperty','getDescriptions','order','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set'];(function(_0x31d73d,_0x280c02){var _0x53e143=function(_0x19deaa){while(--_0x19deaa){_0x31d73d['push'](_0x31d73d['shift']());}};_0x53e143(++_0x280c02);}(_0x44a4,0xe2));var _0x444a=function(_0x2bb84e,_0x4405ff){_0x2bb84e=_0x2bb84e-0x0;var _0x37d33d=_0x44a4[_0x2bb84e];return _0x37d33d;};'use strict';var emlformat=require(_0x444a('0x0'));var rimraf=require(_0x444a('0x1'));var zipdir=require(_0x444a('0x2'));var jsonpatch=require(_0x444a('0x3'));var rp=require(_0x444a('0x4'));var moment=require(_0x444a('0x5'));var BPromise=require(_0x444a('0x6'));var Mustache=require(_0x444a('0x7'));var util=require(_0x444a('0x8'));var path=require(_0x444a('0x9'));var sox=require(_0x444a('0xa'));var csv=require(_0x444a('0xb'));var ejs=require(_0x444a('0xc'));var fs=require('fs');var fs_extra=require(_0x444a('0xd'));var _=require('lodash');var squel=require(_0x444a('0xe'));var crypto=require('crypto');var jsforce=require(_0x444a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x444a('0xb'));var querystring=require(_0x444a('0x10'));var Papa=require(_0x444a('0x11'));var Redis=require('ioredis');var authService=require(_0x444a('0x12'));var qs=require(_0x444a('0x13'));var as=require(_0x444a('0x14'));var hardwareService=require(_0x444a('0x15'));var logger=require(_0x444a('0x16'))(_0x444a('0x17'));var utils=require(_0x444a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x444a('0x19'));var db=require(_0x444a('0x1a'))['db'];function respondWithStatusCode(_0x3f223b,_0x14a07f){_0x14a07f=_0x14a07f||0xcc;return function(_0x5afccd){if(_0x5afccd){return _0x3f223b['sendStatus'](_0x14a07f);}return _0x3f223b['status'](_0x14a07f)[_0x444a('0x1b')]();};}function respondWithResult(_0x2e95da,_0x2ed7c7){_0x2ed7c7=_0x2ed7c7||0xc8;return function(_0x457d29){if(_0x457d29){return _0x2e95da[_0x444a('0x1c')](_0x2ed7c7)[_0x444a('0x1d')](_0x457d29);}};}function respondWithFilteredResult(_0x2d5678,_0x57cf46){return function(_0x109014){if(_0x109014){var _0xa2529c=typeof _0x57cf46[_0x444a('0x1e')]===_0x444a('0x1f')&&typeof _0x57cf46[_0x444a('0x20')]===_0x444a('0x1f');var _0x24b845=_0x109014['count'];var _0x4476e3=_0xa2529c?0x0:_0x57cf46['offset'];var _0x433441=_0xa2529c?_0x109014[_0x444a('0x21')]:_0x57cf46[_0x444a('0x1e')]+_0x57cf46[_0x444a('0x20')];var _0x39871d;if(_0x433441>=_0x24b845){_0x433441=_0x24b845;_0x39871d=0xc8;}else{_0x39871d=0xce;}_0x2d5678[_0x444a('0x1c')](_0x39871d);return _0x2d5678[_0x444a('0x22')](_0x444a('0x23'),_0x4476e3+'-'+_0x433441+'/'+_0x24b845)[_0x444a('0x1d')](_0x109014);}return null;};}function patchUpdates(_0x5d4a60){return function(_0x89cadf){try{jsonpatch[_0x444a('0x24')](_0x89cadf,_0x5d4a60,!![]);}catch(_0x19d149){return BPromise[_0x444a('0x25')](_0x19d149);}return _0x89cadf[_0x444a('0x26')]();};}function saveUpdates(_0x18fb0d,_0x45f9ea){return function(_0x3aadfc){if(_0x3aadfc){return _0x3aadfc[_0x444a('0x27')](_0x18fb0d)[_0x444a('0x28')](function(_0x4fe8ab){return _0x4fe8ab;});}return null;};}function removeEntity(_0x43090f,_0x588750){return function(_0x4665dd){if(_0x4665dd){return _0x4665dd[_0x444a('0x29')]()['then'](function(){_0x43090f[_0x444a('0x1c')](0xcc)[_0x444a('0x1b')]();});}};}function handleEntityNotFound(_0x15ffce,_0x2642c2){return function(_0x2f935f){if(!_0x2f935f){_0x15ffce['sendStatus'](0x194);}return _0x2f935f;};}function handleError(_0x2a7539,_0x31e8ed){_0x31e8ed=_0x31e8ed||0x1f4;return function(_0x4c6e60){logger[_0x444a('0x2a')](_0x4c6e60[_0x444a('0x2b')]);if(_0x4c6e60[_0x444a('0x2c')]){delete _0x4c6e60[_0x444a('0x2c')];}_0x2a7539[_0x444a('0x1c')](_0x31e8ed)[_0x444a('0x2d')](_0x4c6e60);};}exports[_0x444a('0x2e')]=function(_0x286796,_0x4e3dc3){var _0x25bf2c={},_0x5332c4={},_0x3cad5f={'count':0x0,'rows':[]};var _0x10fc99=_[_0x444a('0x2f')](db[_0x444a('0x30')][_0x444a('0x31')],function(_0x4bb1f6){return{'name':_0x4bb1f6['fieldName'],'type':_0x4bb1f6['type'][_0x444a('0x32')]};});_0x5332c4[_0x444a('0x33')]=_[_0x444a('0x2f')](_0x10fc99,_0x444a('0x2c'));_0x5332c4[_0x444a('0x34')]=_['keys'](_0x286796[_0x444a('0x34')]);_0x5332c4[_0x444a('0x35')]=_['intersection'](_0x5332c4[_0x444a('0x33')],_0x5332c4[_0x444a('0x34')]);_0x25bf2c[_0x444a('0x36')]=_[_0x444a('0x37')](_0x5332c4[_0x444a('0x33')],qs['fields'](_0x286796[_0x444a('0x34')][_0x444a('0x38')]));_0x25bf2c[_0x444a('0x36')]=_0x25bf2c['attributes'][_0x444a('0x39')]?_0x25bf2c['attributes']:_0x5332c4[_0x444a('0x33')];if(!_0x286796[_0x444a('0x34')]['hasOwnProperty']('nolimit')){_0x25bf2c[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x286796[_0x444a('0x34')]['limit']);_0x25bf2c[_0x444a('0x1e')]=qs[_0x444a('0x1e')](_0x286796[_0x444a('0x34')][_0x444a('0x1e')]);}_0x25bf2c['order']=qs[_0x444a('0x3a')](_0x286796['query']['sort']);_0x25bf2c[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x286796[_0x444a('0x34')],_0x5332c4[_0x444a('0x35')]),_0x10fc99);if(_0x286796[_0x444a('0x34')][_0x444a('0x3d')]){_0x25bf2c[_0x444a('0x3b')]=_[_0x444a('0x3e')](_0x25bf2c[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x10fc99,function(_0x11ae95){if(_0x11ae95[_0x444a('0x3f')]!=='VIRTUAL'){var _0x3c280d={};_0x3c280d[_0x11ae95['name']]={'$like':'%'+_0x286796[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x3c280d;}})});}_0x25bf2c=_[_0x444a('0x3e')]({},_0x25bf2c,_0x286796[_0x444a('0x40')]);var _0x1bacb4={'where':_0x25bf2c[_0x444a('0x3b')]};return db[_0x444a('0x30')][_0x444a('0x21')](_0x1bacb4)['then'](function(_0x5646b5){_0x3cad5f['count']=_0x5646b5;if(_0x286796[_0x444a('0x34')][_0x444a('0x41')]){_0x25bf2c[_0x444a('0x42')]=[{'all':!![]}];}return db[_0x444a('0x30')][_0x444a('0x43')](_0x25bf2c);})[_0x444a('0x28')](function(_0x3e1298){_0x3cad5f['rows']=_0x3e1298;return _0x3cad5f;})['then'](respondWithFilteredResult(_0x4e3dc3,_0x25bf2c))[_0x444a('0x44')](handleError(_0x4e3dc3,null));};exports[_0x444a('0x45')]=function(_0x3e10bc,_0x5c392b){var _0x275983={'raw':![],'where':{'id':_0x3e10bc[_0x444a('0x46')]['id']}},_0xea3efc={};_0xea3efc[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x30')][_0x444a('0x31')]);_0xea3efc[_0x444a('0x34')]=_[_0x444a('0x47')](_0x3e10bc[_0x444a('0x34')]);_0xea3efc[_0x444a('0x35')]=_[_0x444a('0x37')](_0xea3efc[_0x444a('0x33')],_0xea3efc[_0x444a('0x34')]);_0x275983[_0x444a('0x36')]=_[_0x444a('0x37')](_0xea3efc['model'],qs[_0x444a('0x38')](_0x3e10bc[_0x444a('0x34')][_0x444a('0x38')]));_0x275983['attributes']=_0x275983[_0x444a('0x36')]['length']?_0x275983[_0x444a('0x36')]:_0xea3efc[_0x444a('0x33')];if(_0x3e10bc[_0x444a('0x34')]['includeAll']){_0x275983[_0x444a('0x42')]=[{'all':!![]}];}_0x275983=_[_0x444a('0x3e')]({},_0x275983,_0x3e10bc[_0x444a('0x40')]);return db[_0x444a('0x30')][_0x444a('0x48')](_0x275983)[_0x444a('0x28')](handleEntityNotFound(_0x5c392b,null))[_0x444a('0x28')](respondWithResult(_0x5c392b,null))['catch'](handleError(_0x5c392b,null));};exports[_0x444a('0x49')]=function(_0x26fac1,_0x5bbd25){return db[_0x444a('0x30')]['create'](_0x26fac1[_0x444a('0x4a')],{})['then'](respondWithResult(_0x5bbd25,0xc9))[_0x444a('0x44')](handleError(_0x5bbd25,null));};exports[_0x444a('0x27')]=function(_0x5ab9c8,_0x589650){if(_0x5ab9c8[_0x444a('0x4a')]['id']){delete _0x5ab9c8[_0x444a('0x4a')]['id'];}return db[_0x444a('0x30')][_0x444a('0x48')]({'where':{'id':_0x5ab9c8[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x589650,null))[_0x444a('0x28')](saveUpdates(_0x5ab9c8[_0x444a('0x4a')],null))['then'](respondWithResult(_0x589650,null))[_0x444a('0x44')](handleError(_0x589650,null));};exports['destroy']=function(_0x14b9bb,_0x2bc1a2){return db[_0x444a('0x30')][_0x444a('0x48')]({'where':{'id':_0x14b9bb['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x2bc1a2,null))['then'](removeEntity(_0x2bc1a2,null))[_0x444a('0x44')](handleError(_0x2bc1a2,null));};exports['getFields']=function(_0x10ea90,_0x2d28d3,_0x492a3a){var _0x4a7cbb={};var _0x51007a={};var _0x41ff95;var _0x580f4f;return db['DeskConfiguration'][_0x444a('0x4b')]({'where':{'id':_0x10ea90['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x2d28d3,null))[_0x444a('0x28')](function(_0x35ae74){if(_0x35ae74){_0x41ff95=_0x35ae74;_0x51007a[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x4c')][_0x444a('0x31')]);_0x51007a[_0x444a('0x34')]=_['keys'](_0x10ea90[_0x444a('0x34')]);_0x51007a[_0x444a('0x35')]=_[_0x444a('0x37')](_0x51007a[_0x444a('0x33')],_0x51007a[_0x444a('0x34')]);_0x4a7cbb[_0x444a('0x36')]=_['intersection'](_0x51007a[_0x444a('0x33')],qs[_0x444a('0x38')](_0x10ea90[_0x444a('0x34')][_0x444a('0x38')]));_0x4a7cbb['attributes']=_0x4a7cbb[_0x444a('0x36')][_0x444a('0x39')]?_0x4a7cbb[_0x444a('0x36')]:_0x51007a[_0x444a('0x33')];_0x4a7cbb['order']=qs[_0x444a('0x3a')](_0x10ea90[_0x444a('0x34')][_0x444a('0x3a')]);_0x4a7cbb[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x10ea90[_0x444a('0x34')],_0x51007a['filters']));if(_0x10ea90[_0x444a('0x34')][_0x444a('0x3d')]){_0x4a7cbb[_0x444a('0x3b')]=_['merge'](_0x4a7cbb[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x4a7cbb[_0x444a('0x36')],function(_0x7930a9){var _0x1ed837={};_0x1ed837[_0x7930a9]={'$like':'%'+_0x10ea90[_0x444a('0x34')]['filter']+'%'};return _0x1ed837;})});}_0x4a7cbb=_[_0x444a('0x3e')]({},_0x4a7cbb,_0x10ea90[_0x444a('0x40')]);return _0x41ff95[_0x444a('0x4d')](_0x4a7cbb);}})['then'](function(_0x2c1869){if(_0x2c1869){_0x580f4f=_0x2c1869[_0x444a('0x39')];if(!_0x10ea90[_0x444a('0x34')]['hasOwnProperty'](_0x444a('0x4e'))){_0x4a7cbb[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x10ea90[_0x444a('0x34')]['limit']);_0x4a7cbb[_0x444a('0x1e')]=qs['offset'](_0x10ea90['query'][_0x444a('0x1e')]);}return _0x41ff95[_0x444a('0x4d')](_0x4a7cbb);}})[_0x444a('0x28')](function(_0x39e633){if(_0x39e633){return _0x39e633?{'count':_0x580f4f,'rows':_0x39e633}:null;}})[_0x444a('0x28')](respondWithResult(_0x2d28d3,null))[_0x444a('0x44')](handleError(_0x2d28d3,null));};exports[_0x444a('0x4f')]=function(_0x5efa04,_0x3bfc59,_0x26fbae){var _0x2c2d00={};var _0x52c01c={};var _0x3a5cf1;var _0x1e4361;return db[_0x444a('0x30')][_0x444a('0x4b')]({'where':{'id':_0x5efa04[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x3bfc59,null))[_0x444a('0x28')](function(_0x16ae76){if(_0x16ae76){_0x3a5cf1=_0x16ae76;_0x52c01c[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x4c')]['rawAttributes']);_0x52c01c[_0x444a('0x34')]=_[_0x444a('0x47')](_0x5efa04['query']);_0x52c01c['filters']=_[_0x444a('0x37')](_0x52c01c['model'],_0x52c01c[_0x444a('0x34')]);_0x2c2d00[_0x444a('0x36')]=_[_0x444a('0x37')](_0x52c01c['model'],qs[_0x444a('0x38')](_0x5efa04[_0x444a('0x34')][_0x444a('0x38')]));_0x2c2d00['attributes']=_0x2c2d00['attributes']['length']?_0x2c2d00['attributes']:_0x52c01c['model'];_0x2c2d00['order']=qs['sort'](_0x5efa04[_0x444a('0x34')][_0x444a('0x3a')]);_0x2c2d00[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x5efa04[_0x444a('0x34')],_0x52c01c[_0x444a('0x35')]));if(_0x5efa04[_0x444a('0x34')][_0x444a('0x3d')]){_0x2c2d00[_0x444a('0x3b')]=_['merge'](_0x2c2d00[_0x444a('0x3b')],{'$or':_['map'](_0x2c2d00['attributes'],function(_0x23a7b1){var _0x18178c={};_0x18178c[_0x23a7b1]={'$like':'%'+_0x5efa04[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x18178c;})});}_0x2c2d00=_[_0x444a('0x3e')]({},_0x2c2d00,_0x5efa04['options']);return _0x3a5cf1[_0x444a('0x4f')](_0x2c2d00);}})[_0x444a('0x28')](function(_0xe3a4c0){if(_0xe3a4c0){_0x1e4361=_0xe3a4c0[_0x444a('0x39')];if(!_0x5efa04[_0x444a('0x34')][_0x444a('0x50')](_0x444a('0x4e'))){_0x2c2d00['limit']=qs[_0x444a('0x20')](_0x5efa04[_0x444a('0x34')]['limit']);_0x2c2d00[_0x444a('0x1e')]=qs['offset'](_0x5efa04[_0x444a('0x34')][_0x444a('0x1e')]);}return _0x3a5cf1[_0x444a('0x4f')](_0x2c2d00);}})[_0x444a('0x28')](function(_0xe685bc){if(_0xe685bc){return _0xe685bc?{'count':_0x1e4361,'rows':_0xe685bc}:null;}})['then'](respondWithResult(_0x3bfc59,null))['catch'](handleError(_0x3bfc59,null));};exports[_0x444a('0x51')]=function(_0x1c733c,_0x4f04e0,_0x28ce13){var _0x42aaf3={};var _0x27a7df={};var _0x3d664c;var _0x2ea405;return db[_0x444a('0x30')]['findOne']({'where':{'id':_0x1c733c[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x4f04e0,null))[_0x444a('0x28')](function(_0x1a94af){if(_0x1a94af){_0x3d664c=_0x1a94af;_0x27a7df['model']=_['keys'](db[_0x444a('0x4c')][_0x444a('0x31')]);_0x27a7df[_0x444a('0x34')]=_['keys'](_0x1c733c[_0x444a('0x34')]);_0x27a7df[_0x444a('0x35')]=_['intersection'](_0x27a7df[_0x444a('0x33')],_0x27a7df[_0x444a('0x34')]);_0x42aaf3[_0x444a('0x36')]=_[_0x444a('0x37')](_0x27a7df[_0x444a('0x33')],qs[_0x444a('0x38')](_0x1c733c[_0x444a('0x34')][_0x444a('0x38')]));_0x42aaf3[_0x444a('0x36')]=_0x42aaf3['attributes'][_0x444a('0x39')]?_0x42aaf3['attributes']:_0x27a7df['model'];_0x42aaf3[_0x444a('0x52')]=qs['sort'](_0x1c733c[_0x444a('0x34')]['sort']);_0x42aaf3[_0x444a('0x3b')]=qs[_0x444a('0x35')](_[_0x444a('0x3c')](_0x1c733c[_0x444a('0x34')],_0x27a7df['filters']));if(_0x1c733c[_0x444a('0x34')][_0x444a('0x3d')]){_0x42aaf3['where']=_[_0x444a('0x3e')](_0x42aaf3['where'],{'$or':_[_0x444a('0x2f')](_0x42aaf3[_0x444a('0x36')],function(_0x42a7bf){var _0x44db2a={};_0x44db2a[_0x42a7bf]={'$like':'%'+_0x1c733c[_0x444a('0x34')][_0x444a('0x3d')]+'%'};return _0x44db2a;})});}_0x42aaf3=_['merge']({},_0x42aaf3,_0x1c733c['options']);return _0x3d664c[_0x444a('0x51')](_0x42aaf3);}})[_0x444a('0x28')](function(_0x5dc3b8){if(_0x5dc3b8){_0x2ea405=_0x5dc3b8[_0x444a('0x39')];if(!_0x1c733c[_0x444a('0x34')][_0x444a('0x50')](_0x444a('0x4e'))){_0x42aaf3['limit']=qs[_0x444a('0x20')](_0x1c733c[_0x444a('0x34')][_0x444a('0x20')]);_0x42aaf3[_0x444a('0x1e')]=qs['offset'](_0x1c733c['query']['offset']);}return _0x3d664c[_0x444a('0x51')](_0x42aaf3);}})[_0x444a('0x28')](function(_0x49aca9){if(_0x49aca9){return _0x49aca9?{'count':_0x2ea405,'rows':_0x49aca9}:null;}})[_0x444a('0x28')](respondWithResult(_0x4f04e0,null))[_0x444a('0x44')](handleError(_0x4f04e0,null));};exports['getTags']=function(_0x5e35c1,_0x5722d3,_0x226435){var _0x3a0d55={};var _0x5b0166={};var _0x80047;var _0x4d41ad;return db['DeskConfiguration'][_0x444a('0x4b')]({'where':{'id':_0x5e35c1['params']['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x5722d3,null))[_0x444a('0x28')](function(_0xb54351){if(_0xb54351){_0x80047=_0xb54351;_0x5b0166[_0x444a('0x33')]=_[_0x444a('0x47')](db[_0x444a('0x53')][_0x444a('0x31')]);_0x5b0166[_0x444a('0x34')]=_[_0x444a('0x47')](_0x5e35c1[_0x444a('0x34')]);_0x5b0166[_0x444a('0x35')]=_[_0x444a('0x37')](_0x5b0166[_0x444a('0x33')],_0x5b0166[_0x444a('0x34')]);_0x3a0d55[_0x444a('0x36')]=_[_0x444a('0x37')](_0x5b0166[_0x444a('0x33')],qs[_0x444a('0x38')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x38')]));_0x3a0d55['attributes']=_0x3a0d55[_0x444a('0x36')][_0x444a('0x39')]?_0x3a0d55[_0x444a('0x36')]:_0x5b0166[_0x444a('0x33')];_0x3a0d55[_0x444a('0x52')]=qs[_0x444a('0x3a')](_0x5e35c1[_0x444a('0x34')]['sort']);_0x3a0d55[_0x444a('0x3b')]=qs[_0x444a('0x35')](_['pick'](_0x5e35c1[_0x444a('0x34')],_0x5b0166[_0x444a('0x35')]));if(_0x5e35c1['query'][_0x444a('0x3d')]){_0x3a0d55['where']=_[_0x444a('0x3e')](_0x3a0d55[_0x444a('0x3b')],{'$or':_[_0x444a('0x2f')](_0x3a0d55[_0x444a('0x36')],function(_0x8c5516){var _0x40de3f={};_0x40de3f[_0x8c5516]={'$like':'%'+_0x5e35c1[_0x444a('0x34')]['filter']+'%'};return _0x40de3f;})});}_0x3a0d55=_[_0x444a('0x3e')]({},_0x3a0d55,_0x5e35c1[_0x444a('0x40')]);return _0x80047[_0x444a('0x54')](_0x3a0d55);}})[_0x444a('0x28')](function(_0x27819a){if(_0x27819a){_0x4d41ad=_0x27819a[_0x444a('0x39')];if(!_0x5e35c1[_0x444a('0x34')]['hasOwnProperty'](_0x444a('0x4e'))){_0x3a0d55[_0x444a('0x20')]=qs[_0x444a('0x20')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x20')]);_0x3a0d55[_0x444a('0x1e')]=qs[_0x444a('0x1e')](_0x5e35c1[_0x444a('0x34')][_0x444a('0x1e')]);}return _0x80047[_0x444a('0x54')](_0x3a0d55);}})['then'](function(_0x278bb1){if(_0x278bb1){return _0x278bb1?{'count':_0x4d41ad,'rows':_0x278bb1}:null;}})[_0x444a('0x28')](respondWithResult(_0x5722d3,null))['catch'](handleError(_0x5722d3,null));};exports[_0x444a('0x55')]=function(_0x1c0057,_0x31a044,_0xf754f){if(_0x1c0057[_0x444a('0x4a')]['id']){delete _0x1c0057['body']['id'];}return db[_0x444a('0x30')][_0x444a('0x4b')]({'where':{'id':_0x1c0057[_0x444a('0x46')]['id']}})[_0x444a('0x28')](handleEntityNotFound(_0x31a044,null))[_0x444a('0x28')](function(_0x21356d){if(_0x21356d){return _0x21356d[_0x444a('0x55')](_0x1c0057[_0x444a('0x4a')][_0x444a('0x56')]||[]);}return null;})[_0x444a('0x28')](respondWithResult(_0x31a044,null))[_0x444a('0x44')](handleError(_0x31a044,null));}; \ No newline at end of file +var _0xdf78=['limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','params','find','catch','create','body','getFields','findOne','filter','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','bluebird','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','sendStatus','status','json','offset'];(function(_0x3746b0,_0x6dfbce){var _0x434afa=function(_0x25b55b){while(--_0x25b55b){_0x3746b0['push'](_0x3746b0['shift']());}};_0x434afa(++_0x6dfbce);}(_0xdf78,0xdb));var _0x8df7=function(_0x249667,_0x4b4575){_0x249667=_0x249667-0x0;var _0x1b9944=_0xdf78[_0x249667];return _0x1b9944;};'use strict';var emlformat=require(_0x8df7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8df7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8df7('0x2'));var moment=require('moment');var BPromise=require(_0x8df7('0x3'));var Mustache=require('mustache');var util=require(_0x8df7('0x4'));var path=require(_0x8df7('0x5'));var sox=require(_0x8df7('0x6'));var csv=require(_0x8df7('0x7'));var ejs=require(_0x8df7('0x8'));var fs=require('fs');var fs_extra=require(_0x8df7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8df7('0xa'));var jsforce=require(_0x8df7('0xb'));var deskjs=require(_0x8df7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8df7('0xd'));var Papa=require(_0x8df7('0xe'));var Redis=require('ioredis');var authService=require(_0x8df7('0xf'));var qs=require(_0x8df7('0x10'));var as=require(_0x8df7('0x11'));var hardwareService=require(_0x8df7('0x12'));var logger=require(_0x8df7('0x13'))(_0x8df7('0x14'));var utils=require('../../config/utils');var config=require(_0x8df7('0x15'));var licenseUtil=require(_0x8df7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138494,_0x31e5c9){_0x31e5c9=_0x31e5c9||0xcc;return function(_0x3dbfb5){if(_0x3dbfb5){return _0x138494[_0x8df7('0x17')](_0x31e5c9);}return _0x138494[_0x8df7('0x18')](_0x31e5c9)['end']();};}function respondWithResult(_0x15c2ce,_0x163b8b){_0x163b8b=_0x163b8b||0xc8;return function(_0x8337db){if(_0x8337db){return _0x15c2ce[_0x8df7('0x18')](_0x163b8b)[_0x8df7('0x19')](_0x8337db);}};}function respondWithFilteredResult(_0x528fe5,_0x2660c6){return function(_0x26ae86){if(_0x26ae86){var _0x40341d=typeof _0x2660c6[_0x8df7('0x1a')]==='undefined'&&typeof _0x2660c6[_0x8df7('0x1b')]==='undefined';var _0x4295ed=_0x26ae86[_0x8df7('0x1c')];var _0x20c944=_0x40341d?0x0:_0x2660c6[_0x8df7('0x1a')];var _0x43a587=_0x40341d?_0x26ae86[_0x8df7('0x1c')]:_0x2660c6[_0x8df7('0x1a')]+_0x2660c6[_0x8df7('0x1b')];var _0x210d3c;if(_0x43a587>=_0x4295ed){_0x43a587=_0x4295ed;_0x210d3c=0xc8;}else{_0x210d3c=0xce;}_0x528fe5[_0x8df7('0x18')](_0x210d3c);return _0x528fe5[_0x8df7('0x1d')](_0x8df7('0x1e'),_0x20c944+'-'+_0x43a587+'/'+_0x4295ed)[_0x8df7('0x19')](_0x26ae86);}return null;};}function patchUpdates(_0x598a74){return function(_0x3acbc1){try{jsonpatch[_0x8df7('0x1f')](_0x3acbc1,_0x598a74,!![]);}catch(_0x2dfa16){return BPromise[_0x8df7('0x20')](_0x2dfa16);}return _0x3acbc1['save']();};}function saveUpdates(_0x167e2a,_0x58e26a){return function(_0x611de5){if(_0x611de5){return _0x611de5[_0x8df7('0x21')](_0x167e2a)['then'](function(_0x4d70fa){return _0x4d70fa;});}return null;};}function removeEntity(_0x27403b,_0x3b8dd4){return function(_0x2fd737){if(_0x2fd737){return _0x2fd737[_0x8df7('0x22')]()['then'](function(){_0x27403b[_0x8df7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9c05,_0x264633){return function(_0x4aafea){if(!_0x4aafea){_0x1c9c05[_0x8df7('0x17')](0x194);}return _0x4aafea;};}function handleError(_0x22907c,_0x325014){_0x325014=_0x325014||0x1f4;return function(_0x129206){logger[_0x8df7('0x23')](_0x129206[_0x8df7('0x24')]);if(_0x129206[_0x8df7('0x25')]){delete _0x129206['name'];}_0x22907c[_0x8df7('0x18')](_0x325014)[_0x8df7('0x26')](_0x129206);};}exports[_0x8df7('0x27')]=function(_0x502613,_0x32f588){var _0xdf03d4={},_0x428bc4={},_0x3170e4={'count':0x0,'rows':[]};var _0x1f4a75=_['map'](db[_0x8df7('0x28')][_0x8df7('0x29')],function(_0x171490){return{'name':_0x171490[_0x8df7('0x2a')],'type':_0x171490[_0x8df7('0x2b')]['key']};});_0x428bc4['model']=_[_0x8df7('0x2c')](_0x1f4a75,_0x8df7('0x25'));_0x428bc4[_0x8df7('0x2d')]=_[_0x8df7('0x2e')](_0x502613[_0x8df7('0x2d')]);_0x428bc4[_0x8df7('0x2f')]=_['intersection'](_0x428bc4['model'],_0x428bc4[_0x8df7('0x2d')]);_0xdf03d4[_0x8df7('0x30')]=_[_0x8df7('0x31')](_0x428bc4[_0x8df7('0x32')],qs[_0x8df7('0x33')](_0x502613[_0x8df7('0x2d')][_0x8df7('0x33')]));_0xdf03d4['attributes']=_0xdf03d4[_0x8df7('0x30')][_0x8df7('0x34')]?_0xdf03d4[_0x8df7('0x30')]:_0x428bc4[_0x8df7('0x32')];if(!_0x502613[_0x8df7('0x2d')][_0x8df7('0x35')](_0x8df7('0x36'))){_0xdf03d4[_0x8df7('0x1b')]=qs[_0x8df7('0x1b')](_0x502613[_0x8df7('0x2d')][_0x8df7('0x1b')]);_0xdf03d4[_0x8df7('0x1a')]=qs[_0x8df7('0x1a')](_0x502613[_0x8df7('0x2d')][_0x8df7('0x1a')]);}_0xdf03d4[_0x8df7('0x37')]=qs['sort'](_0x502613['query'][_0x8df7('0x38')]);_0xdf03d4[_0x8df7('0x39')]=qs[_0x8df7('0x2f')](_[_0x8df7('0x3a')](_0x502613[_0x8df7('0x2d')],_0x428bc4[_0x8df7('0x2f')]),_0x1f4a75);if(_0x502613[_0x8df7('0x2d')]['filter']){_0xdf03d4[_0x8df7('0x39')]=_[_0x8df7('0x3b')](_0xdf03d4[_0x8df7('0x39')],{'$or':_[_0x8df7('0x2c')](_0x1f4a75,function(_0x4e66d6){if(_0x4e66d6[_0x8df7('0x2b')]!==_0x8df7('0x3c')){var _0x1f6aa5={};_0x1f6aa5[_0x4e66d6[_0x8df7('0x25')]]={'$like':'%'+_0x502613[_0x8df7('0x2d')]['filter']+'%'};return _0x1f6aa5;}})});}_0xdf03d4=_[_0x8df7('0x3b')]({},_0xdf03d4,_0x502613[_0x8df7('0x3d')]);var _0x482e91={'where':_0xdf03d4[_0x8df7('0x39')]};return db[_0x8df7('0x28')][_0x8df7('0x1c')](_0x482e91)[_0x8df7('0x3e')](function(_0x307829){_0x3170e4['count']=_0x307829;if(_0x502613[_0x8df7('0x2d')][_0x8df7('0x3f')]){_0xdf03d4[_0x8df7('0x40')]=[{'all':!![]}];}return db[_0x8df7('0x28')][_0x8df7('0x41')](_0xdf03d4);})['then'](function(_0x2ca678){_0x3170e4[_0x8df7('0x42')]=_0x2ca678;return _0x3170e4;})[_0x8df7('0x3e')](respondWithFilteredResult(_0x32f588,_0xdf03d4))['catch'](handleError(_0x32f588,null));};exports['show']=function(_0x2172fe,_0x17a301){var _0x414f0a={'raw':![],'where':{'id':_0x2172fe[_0x8df7('0x43')]['id']}},_0x17b2f1={};_0x17b2f1[_0x8df7('0x32')]=_[_0x8df7('0x2e')](db['DeskConfiguration'][_0x8df7('0x29')]);_0x17b2f1['query']=_[_0x8df7('0x2e')](_0x2172fe[_0x8df7('0x2d')]);_0x17b2f1['filters']=_['intersection'](_0x17b2f1[_0x8df7('0x32')],_0x17b2f1['query']);_0x414f0a['attributes']=_[_0x8df7('0x31')](_0x17b2f1[_0x8df7('0x32')],qs['fields'](_0x2172fe[_0x8df7('0x2d')][_0x8df7('0x33')]));_0x414f0a[_0x8df7('0x30')]=_0x414f0a[_0x8df7('0x30')]['length']?_0x414f0a[_0x8df7('0x30')]:_0x17b2f1[_0x8df7('0x32')];if(_0x2172fe[_0x8df7('0x2d')][_0x8df7('0x3f')]){_0x414f0a[_0x8df7('0x40')]=[{'all':!![]}];}_0x414f0a=_['merge']({},_0x414f0a,_0x2172fe[_0x8df7('0x3d')]);return db[_0x8df7('0x28')][_0x8df7('0x44')](_0x414f0a)[_0x8df7('0x3e')](handleEntityNotFound(_0x17a301,null))['then'](respondWithResult(_0x17a301,null))[_0x8df7('0x45')](handleError(_0x17a301,null));};exports[_0x8df7('0x46')]=function(_0x1f5eab,_0x3ee905){return db[_0x8df7('0x28')]['create'](_0x1f5eab['body'],{})['then'](respondWithResult(_0x3ee905,0xc9))[_0x8df7('0x45')](handleError(_0x3ee905,null));};exports[_0x8df7('0x21')]=function(_0x9b2b6c,_0x3e765f){if(_0x9b2b6c['body']['id']){delete _0x9b2b6c[_0x8df7('0x47')]['id'];}return db[_0x8df7('0x28')][_0x8df7('0x44')]({'where':{'id':_0x9b2b6c[_0x8df7('0x43')]['id']}})[_0x8df7('0x3e')](handleEntityNotFound(_0x3e765f,null))[_0x8df7('0x3e')](saveUpdates(_0x9b2b6c[_0x8df7('0x47')],null))[_0x8df7('0x3e')](respondWithResult(_0x3e765f,null))[_0x8df7('0x45')](handleError(_0x3e765f,null));};exports[_0x8df7('0x22')]=function(_0x18a0c4,_0x598fc9){return db['DeskConfiguration']['find']({'where':{'id':_0x18a0c4['params']['id']}})['then'](handleEntityNotFound(_0x598fc9,null))[_0x8df7('0x3e')](removeEntity(_0x598fc9,null))[_0x8df7('0x45')](handleError(_0x598fc9,null));};exports[_0x8df7('0x48')]=function(_0x285e67,_0x40958c,_0x7e312b){var _0xb4d300={};var _0x86cd32={};var _0x4f61eb;var _0x4c1380;return db[_0x8df7('0x28')][_0x8df7('0x49')]({'where':{'id':_0x285e67[_0x8df7('0x43')]['id']}})[_0x8df7('0x3e')](handleEntityNotFound(_0x40958c,null))[_0x8df7('0x3e')](function(_0x2e94fa){if(_0x2e94fa){_0x4f61eb=_0x2e94fa;_0x86cd32[_0x8df7('0x32')]=_[_0x8df7('0x2e')](db['DeskField'][_0x8df7('0x29')]);_0x86cd32['query']=_['keys'](_0x285e67['query']);_0x86cd32[_0x8df7('0x2f')]=_[_0x8df7('0x31')](_0x86cd32[_0x8df7('0x32')],_0x86cd32['query']);_0xb4d300[_0x8df7('0x30')]=_[_0x8df7('0x31')](_0x86cd32['model'],qs[_0x8df7('0x33')](_0x285e67['query']['fields']));_0xb4d300[_0x8df7('0x30')]=_0xb4d300[_0x8df7('0x30')]['length']?_0xb4d300[_0x8df7('0x30')]:_0x86cd32['model'];_0xb4d300['order']=qs[_0x8df7('0x38')](_0x285e67[_0x8df7('0x2d')][_0x8df7('0x38')]);_0xb4d300[_0x8df7('0x39')]=qs[_0x8df7('0x2f')](_[_0x8df7('0x3a')](_0x285e67[_0x8df7('0x2d')],_0x86cd32['filters']));if(_0x285e67[_0x8df7('0x2d')][_0x8df7('0x4a')]){_0xb4d300[_0x8df7('0x39')]=_[_0x8df7('0x3b')](_0xb4d300[_0x8df7('0x39')],{'$or':_[_0x8df7('0x2c')](_0xb4d300[_0x8df7('0x30')],function(_0x4322a6){var _0x55ee4b={};_0x55ee4b[_0x4322a6]={'$like':'%'+_0x285e67['query']['filter']+'%'};return _0x55ee4b;})});}_0xb4d300=_[_0x8df7('0x3b')]({},_0xb4d300,_0x285e67['options']);return _0x4f61eb[_0x8df7('0x48')](_0xb4d300);}})['then'](function(_0x697f8c){if(_0x697f8c){_0x4c1380=_0x697f8c['length'];if(!_0x285e67[_0x8df7('0x2d')][_0x8df7('0x35')](_0x8df7('0x36'))){_0xb4d300[_0x8df7('0x1b')]=qs[_0x8df7('0x1b')](_0x285e67[_0x8df7('0x2d')][_0x8df7('0x1b')]);_0xb4d300['offset']=qs[_0x8df7('0x1a')](_0x285e67['query'][_0x8df7('0x1a')]);}return _0x4f61eb[_0x8df7('0x48')](_0xb4d300);}})[_0x8df7('0x3e')](function(_0x130539){if(_0x130539){return _0x130539?{'count':_0x4c1380,'rows':_0x130539}:null;}})['then'](respondWithResult(_0x40958c,null))[_0x8df7('0x45')](handleError(_0x40958c,null));};exports[_0x8df7('0x4b')]=function(_0x167501,_0x57b341,_0x5cea37){var _0x5cb3c7={};var _0x5d4b33={};var _0x32dacc;var _0x495c07;return db['DeskConfiguration'][_0x8df7('0x49')]({'where':{'id':_0x167501[_0x8df7('0x43')]['id']}})[_0x8df7('0x3e')](handleEntityNotFound(_0x57b341,null))['then'](function(_0x78b6dc){if(_0x78b6dc){_0x32dacc=_0x78b6dc;_0x5d4b33[_0x8df7('0x32')]=_[_0x8df7('0x2e')](db[_0x8df7('0x4c')][_0x8df7('0x29')]);_0x5d4b33['query']=_[_0x8df7('0x2e')](_0x167501[_0x8df7('0x2d')]);_0x5d4b33['filters']=_['intersection'](_0x5d4b33[_0x8df7('0x32')],_0x5d4b33[_0x8df7('0x2d')]);_0x5cb3c7['attributes']=_['intersection'](_0x5d4b33[_0x8df7('0x32')],qs['fields'](_0x167501[_0x8df7('0x2d')][_0x8df7('0x33')]));_0x5cb3c7[_0x8df7('0x30')]=_0x5cb3c7[_0x8df7('0x30')][_0x8df7('0x34')]?_0x5cb3c7[_0x8df7('0x30')]:_0x5d4b33[_0x8df7('0x32')];_0x5cb3c7[_0x8df7('0x37')]=qs['sort'](_0x167501[_0x8df7('0x2d')][_0x8df7('0x38')]);_0x5cb3c7[_0x8df7('0x39')]=qs['filters'](_[_0x8df7('0x3a')](_0x167501['query'],_0x5d4b33['filters']));if(_0x167501[_0x8df7('0x2d')][_0x8df7('0x4a')]){_0x5cb3c7[_0x8df7('0x39')]=_[_0x8df7('0x3b')](_0x5cb3c7['where'],{'$or':_[_0x8df7('0x2c')](_0x5cb3c7[_0x8df7('0x30')],function(_0x3c3387){var _0x31d961={};_0x31d961[_0x3c3387]={'$like':'%'+_0x167501[_0x8df7('0x2d')][_0x8df7('0x4a')]+'%'};return _0x31d961;})});}_0x5cb3c7=_[_0x8df7('0x3b')]({},_0x5cb3c7,_0x167501[_0x8df7('0x3d')]);return _0x32dacc[_0x8df7('0x4b')](_0x5cb3c7);}})[_0x8df7('0x3e')](function(_0x2ca461){if(_0x2ca461){_0x495c07=_0x2ca461[_0x8df7('0x34')];if(!_0x167501['query']['hasOwnProperty']('nolimit')){_0x5cb3c7[_0x8df7('0x1b')]=qs[_0x8df7('0x1b')](_0x167501[_0x8df7('0x2d')][_0x8df7('0x1b')]);_0x5cb3c7[_0x8df7('0x1a')]=qs[_0x8df7('0x1a')](_0x167501[_0x8df7('0x2d')][_0x8df7('0x1a')]);}return _0x32dacc[_0x8df7('0x4b')](_0x5cb3c7);}})[_0x8df7('0x3e')](function(_0x3ffc4c){if(_0x3ffc4c){return _0x3ffc4c?{'count':_0x495c07,'rows':_0x3ffc4c}:null;}})[_0x8df7('0x3e')](respondWithResult(_0x57b341,null))['catch'](handleError(_0x57b341,null));};exports[_0x8df7('0x4d')]=function(_0x5b0fe8,_0x17df62,_0x465a34){var _0x5ae436={};var _0x592614={};var _0x653f74;var _0x19494b;return db[_0x8df7('0x28')][_0x8df7('0x49')]({'where':{'id':_0x5b0fe8[_0x8df7('0x43')]['id']}})['then'](handleEntityNotFound(_0x17df62,null))[_0x8df7('0x3e')](function(_0x10dba4){if(_0x10dba4){_0x653f74=_0x10dba4;_0x592614[_0x8df7('0x32')]=_[_0x8df7('0x2e')](db[_0x8df7('0x4c')]['rawAttributes']);_0x592614[_0x8df7('0x2d')]=_[_0x8df7('0x2e')](_0x5b0fe8[_0x8df7('0x2d')]);_0x592614[_0x8df7('0x2f')]=_[_0x8df7('0x31')](_0x592614[_0x8df7('0x32')],_0x592614[_0x8df7('0x2d')]);_0x5ae436[_0x8df7('0x30')]=_[_0x8df7('0x31')](_0x592614[_0x8df7('0x32')],qs[_0x8df7('0x33')](_0x5b0fe8[_0x8df7('0x2d')][_0x8df7('0x33')]));_0x5ae436[_0x8df7('0x30')]=_0x5ae436[_0x8df7('0x30')][_0x8df7('0x34')]?_0x5ae436[_0x8df7('0x30')]:_0x592614[_0x8df7('0x32')];_0x5ae436[_0x8df7('0x37')]=qs[_0x8df7('0x38')](_0x5b0fe8[_0x8df7('0x2d')][_0x8df7('0x38')]);_0x5ae436[_0x8df7('0x39')]=qs[_0x8df7('0x2f')](_[_0x8df7('0x3a')](_0x5b0fe8['query'],_0x592614[_0x8df7('0x2f')]));if(_0x5b0fe8[_0x8df7('0x2d')][_0x8df7('0x4a')]){_0x5ae436['where']=_[_0x8df7('0x3b')](_0x5ae436[_0x8df7('0x39')],{'$or':_['map'](_0x5ae436[_0x8df7('0x30')],function(_0x346a9f){var _0xeccb9f={};_0xeccb9f[_0x346a9f]={'$like':'%'+_0x5b0fe8['query'][_0x8df7('0x4a')]+'%'};return _0xeccb9f;})});}_0x5ae436=_[_0x8df7('0x3b')]({},_0x5ae436,_0x5b0fe8['options']);return _0x653f74[_0x8df7('0x4d')](_0x5ae436);}})[_0x8df7('0x3e')](function(_0xbc0c1b){if(_0xbc0c1b){_0x19494b=_0xbc0c1b[_0x8df7('0x34')];if(!_0x5b0fe8[_0x8df7('0x2d')]['hasOwnProperty'](_0x8df7('0x36'))){_0x5ae436['limit']=qs['limit'](_0x5b0fe8[_0x8df7('0x2d')]['limit']);_0x5ae436[_0x8df7('0x1a')]=qs[_0x8df7('0x1a')](_0x5b0fe8[_0x8df7('0x2d')][_0x8df7('0x1a')]);}return _0x653f74[_0x8df7('0x4d')](_0x5ae436);}})[_0x8df7('0x3e')](function(_0x1c3b4a){if(_0x1c3b4a){return _0x1c3b4a?{'count':_0x19494b,'rows':_0x1c3b4a}:null;}})[_0x8df7('0x3e')](respondWithResult(_0x17df62,null))[_0x8df7('0x45')](handleError(_0x17df62,null));};exports[_0x8df7('0x4e')]=function(_0x1cafc8,_0x51aab6,_0x4f5ad3){var _0x53f2d9={};var _0x264e3a={};var _0x267acf;var _0x1664c6;return db['DeskConfiguration'][_0x8df7('0x49')]({'where':{'id':_0x1cafc8['params']['id']}})[_0x8df7('0x3e')](handleEntityNotFound(_0x51aab6,null))[_0x8df7('0x3e')](function(_0x20419d){if(_0x20419d){_0x267acf=_0x20419d;_0x264e3a[_0x8df7('0x32')]=_['keys'](db[_0x8df7('0x4f')][_0x8df7('0x29')]);_0x264e3a[_0x8df7('0x2d')]=_[_0x8df7('0x2e')](_0x1cafc8[_0x8df7('0x2d')]);_0x264e3a[_0x8df7('0x2f')]=_[_0x8df7('0x31')](_0x264e3a['model'],_0x264e3a[_0x8df7('0x2d')]);_0x53f2d9[_0x8df7('0x30')]=_[_0x8df7('0x31')](_0x264e3a[_0x8df7('0x32')],qs[_0x8df7('0x33')](_0x1cafc8[_0x8df7('0x2d')]['fields']));_0x53f2d9['attributes']=_0x53f2d9[_0x8df7('0x30')]['length']?_0x53f2d9[_0x8df7('0x30')]:_0x264e3a[_0x8df7('0x32')];_0x53f2d9[_0x8df7('0x37')]=qs['sort'](_0x1cafc8[_0x8df7('0x2d')][_0x8df7('0x38')]);_0x53f2d9[_0x8df7('0x39')]=qs['filters'](_[_0x8df7('0x3a')](_0x1cafc8['query'],_0x264e3a['filters']));if(_0x1cafc8['query']['filter']){_0x53f2d9['where']=_[_0x8df7('0x3b')](_0x53f2d9[_0x8df7('0x39')],{'$or':_[_0x8df7('0x2c')](_0x53f2d9['attributes'],function(_0x5f0b66){var _0x5a6ae8={};_0x5a6ae8[_0x5f0b66]={'$like':'%'+_0x1cafc8[_0x8df7('0x2d')][_0x8df7('0x4a')]+'%'};return _0x5a6ae8;})});}_0x53f2d9=_['merge']({},_0x53f2d9,_0x1cafc8[_0x8df7('0x3d')]);return _0x267acf['getTags'](_0x53f2d9);}})[_0x8df7('0x3e')](function(_0x1812ab){if(_0x1812ab){_0x1664c6=_0x1812ab[_0x8df7('0x34')];if(!_0x1cafc8['query'][_0x8df7('0x35')](_0x8df7('0x36'))){_0x53f2d9[_0x8df7('0x1b')]=qs[_0x8df7('0x1b')](_0x1cafc8[_0x8df7('0x2d')][_0x8df7('0x1b')]);_0x53f2d9[_0x8df7('0x1a')]=qs[_0x8df7('0x1a')](_0x1cafc8[_0x8df7('0x2d')][_0x8df7('0x1a')]);}return _0x267acf[_0x8df7('0x4e')](_0x53f2d9);}})[_0x8df7('0x3e')](function(_0x2343ce){if(_0x2343ce){return _0x2343ce?{'count':_0x1664c6,'rows':_0x2343ce}:null;}})[_0x8df7('0x3e')](respondWithResult(_0x51aab6,null))[_0x8df7('0x45')](handleError(_0x51aab6,null));};exports[_0x8df7('0x50')]=function(_0x55d209,_0x3568c8,_0x191c21){if(_0x55d209[_0x8df7('0x47')]['id']){delete _0x55d209['body']['id'];}return db[_0x8df7('0x28')][_0x8df7('0x49')]({'where':{'id':_0x55d209['params']['id']}})['then'](handleEntityNotFound(_0x3568c8,null))[_0x8df7('0x3e')](function(_0xad4810){if(_0xad4810){return _0xad4810[_0x8df7('0x50')](_0x55d209['body'][_0x8df7('0x51')]||[]);}return null;})[_0x8df7('0x3e')](respondWithResult(_0x3568c8,null))[_0x8df7('0x45')](handleError(_0x3568c8,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 1a4b04a..264cd97 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 _0x3d5d=['api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger'];(function(_0xebb14a,_0x7375a2){var _0x2024a8=function(_0x1784b3){while(--_0x1784b3){_0xebb14a['push'](_0xebb14a['shift']());}};_0x2024a8(++_0x7375a2);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x3d5d[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var logger=require(_0xd3d5('0x1'))(_0xd3d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3d5('0x3'));var fs=require('fs');var path=require(_0xd3d5('0x4'));var rimraf=require(_0xd3d5('0x5'));var config=require(_0xd3d5('0x6'));var attributes=require(_0xd3d5('0x7'));module[_0xd3d5('0x8')]=function(_0x52d8ae,_0x440936){return _0x52d8ae[_0xd3d5('0x9')](_0xd3d5('0xa'),attributes,{'tableName':_0xd3d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe617=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment'];(function(_0x281e44,_0x2a2e7a){var _0x1c9bd8=function(_0xdc7c00){while(--_0xdc7c00){_0x281e44['push'](_0x281e44['shift']());}};_0x1c9bd8(++_0x2a2e7a);}(_0xe617,0xea));var _0x7e61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe617[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7e61('0x0'));var util=require(_0x7e61('0x1'));var logger=require('../../config/logger')(_0x7e61('0x2'));var moment=require(_0x7e61('0x3'));var BPromise=require(_0x7e61('0x4'));var rp=require(_0x7e61('0x5'));var fs=require('fs');var path=require(_0x7e61('0x6'));var rimraf=require(_0x7e61('0x7'));var config=require(_0x7e61('0x8'));var attributes=require(_0x7e61('0x9'));module[_0x7e61('0xa')]=function(_0x52150f,_0x46d4fa){return _0x52150f[_0x7e61('0xb')](_0x7e61('0xc'),attributes,{'tableName':_0x7e61('0xd'),'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 fcf41ab..b812380 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 _0x5386=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util'];(function(_0x24de1b,_0x3dd173){var _0x47ff0a=function(_0x242017){while(--_0x242017){_0x24de1b['push'](_0x24de1b['shift']());}};_0x47ff0a(++_0x3dd173);}(_0x5386,0x1e1));var _0x6538=function(_0x2bafde,_0x39326c){_0x2bafde=_0x2bafde-0x0;var _0x5733dc=_0x5386[_0x2bafde];return _0x5733dc;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var moment=require(_0x6538('0x2'));var BPromise=require(_0x6538('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6538('0x4'));var db=require(_0x6538('0x5'))['db'];var utils=require(_0x6538('0x6'));var logger=require(_0x6538('0x7'))(_0x6538('0x8'));var config=require(_0x6538('0x9'));var jayson=require(_0x6538('0xa'));var client=jayson[_0x6538('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16c291,_0x4b0e05,_0x16d67){return new BPromise(function(_0x28e83b,_0x113fe4){return client[_0x6538('0xc')](_0x16c291,_0x16d67)[_0x6538('0xd')](function(_0x2bce05){logger[_0x6538('0xe')](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));logger[_0x6538('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4b0e05,_0x6538('0x10'),JSON[_0x6538('0x12')](_0x2bce05));if(_0x2bce05[_0x6538('0x13')]){if(_0x2bce05['error'][_0x6538('0x14')]===0x1f4){logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')]['message']);return _0x113fe4(_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);}logger['error'](_0x6538('0xf'),_0x4b0e05,_0x2bce05[_0x6538('0x13')][_0x6538('0x15')]);return _0x28e83b(_0x2bce05['error'][_0x6538('0x15')]);}else{logger['info'](_0x6538('0xf'),_0x4b0e05,_0x6538('0x10'));_0x28e83b(_0x2bce05[_0x6538('0x16')][_0x6538('0x15')]);}})['catch'](function(_0x7caa07){logger[_0x6538('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x4b0e05,_0x7caa07);_0x113fe4(_0x7caa07);});});} \ No newline at end of file +var _0x5ec3=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0xbc1a4b,_0x4dfbe4){var _0x108b87=function(_0x409062){while(--_0x409062){_0xbc1a4b['push'](_0xbc1a4b['shift']());}};_0x108b87(++_0x4dfbe4);}(_0x5ec3,0xf2));var _0x35ec=function(_0xfe1037,_0x40cf28){_0xfe1037=_0xfe1037-0x0;var _0x226c11=_0x5ec3[_0xfe1037];return _0x226c11;};'use strict';var _=require(_0x35ec('0x0'));var util=require('util');var moment=require(_0x35ec('0x1'));var BPromise=require(_0x35ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ec('0x3'));var db=require(_0x35ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x35ec('0x5'))(_0x35ec('0x6'));var config=require(_0x35ec('0x7'));var jayson=require(_0x35ec('0x8'));var client=jayson[_0x35ec('0x9')][_0x35ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc6c653,_0x13b8a1,_0x40528f){return new BPromise(function(_0x4dacf4,_0x1659d0){return client[_0x35ec('0xb')](_0xc6c653,_0x40528f)[_0x35ec('0xc')](function(_0x166fb6){logger['info'](_0x35ec('0xd'),_0x13b8a1,_0x35ec('0xe'));logger['debug'](_0x35ec('0xf'),_0x13b8a1,_0x35ec('0xe'),JSON[_0x35ec('0x10')](_0x166fb6));if(_0x166fb6[_0x35ec('0x11')]){if(_0x166fb6[_0x35ec('0x11')]['code']===0x1f4){logger[_0x35ec('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x13b8a1,_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);return _0x1659d0(_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);}logger[_0x35ec('0x11')](_0x35ec('0xd'),_0x13b8a1,_0x166fb6['error']['message']);return _0x4dacf4(_0x166fb6[_0x35ec('0x11')][_0x35ec('0x12')]);}else{logger[_0x35ec('0x13')](_0x35ec('0xd'),_0x13b8a1,'request\x20sent');_0x4dacf4(_0x166fb6[_0x35ec('0x14')][_0x35ec('0x12')]);}})[_0x35ec('0x15')](function(_0x588f50){logger[_0x35ec('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x13b8a1,_0x588f50);_0x1659d0(_0x588f50);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 8d12ee4..bc3a846 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 _0x4373=['get','isAuthenticated','index','/:id','create','update','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c6e25,_0x3b40d9){var _0x1250c1=function(_0x58859b){while(--_0x58859b){_0x3c6e25['push'](_0x3c6e25['shift']());}};_0x1250c1(++_0x3b40d9);}(_0x4373,0xfe));var _0x3437=function(_0x2c9c36,_0x11d199){_0x2c9c36=_0x2c9c36-0x0;var _0x4f2f55=_0x4373[_0x2c9c36];return _0x4f2f55;};'use strict';var multer=require(_0x3437('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3437('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3437('0x2'));var auth=require(_0x3437('0x3'));var interaction=require(_0x3437('0x4'));var config=require(_0x3437('0x5'));var controller=require('./intDeskField.controller');router[_0x3437('0x6')]('/',auth[_0x3437('0x7')](),controller[_0x3437('0x8')]);router[_0x3437('0x6')](_0x3437('0x9'),auth[_0x3437('0x7')](),controller['show']);router['post']('/',auth[_0x3437('0x7')](),controller[_0x3437('0xa')]);router['put'](_0x3437('0x9'),auth[_0x3437('0x7')](),controller[_0x3437('0xb')]);router['delete'](_0x3437('0x9'),auth['isAuthenticated'](),controller[_0x3437('0xc')]);module['exports']=router; \ No newline at end of file +var _0x706c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x58b603,_0x450f6d){var _0xf76126=function(_0x5688da){while(--_0x5688da){_0x58b603['push'](_0x58b603['shift']());}};_0xf76126(++_0x450f6d);}(_0x706c,0xd1));var _0xc706=function(_0x455e82,_0x522f6f){_0x455e82=_0x455e82-0x0;var _0x2d0520=_0x706c[_0x455e82];return _0x2d0520;};'use strict';var multer=require(_0xc706('0x0'));var util=require(_0xc706('0x1'));var path=require(_0xc706('0x2'));var timeout=require(_0xc706('0x3'));var express=require(_0xc706('0x4'));var router=express[_0xc706('0x5')]();var fs_extra=require(_0xc706('0x6'));var auth=require(_0xc706('0x7'));var interaction=require(_0xc706('0x8'));var config=require('../../config/environment');var controller=require(_0xc706('0x9'));router[_0xc706('0xa')]('/',auth[_0xc706('0xb')](),controller['index']);router[_0xc706('0xa')](_0xc706('0xc'),auth[_0xc706('0xb')](),controller[_0xc706('0xd')]);router[_0xc706('0xe')]('/',auth[_0xc706('0xb')](),controller['create']);router[_0xc706('0xf')](_0xc706('0xc'),auth['isAuthenticated'](),controller[_0xc706('0x10')]);router[_0xc706('0x11')](_0xc706('0xc'),auth[_0xc706('0xb')](),controller[_0xc706('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3f6bd32..372c527 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 _0xcc2b=['ENUM','string','variable','customVariable','picklist','BOOLEAN','sequelize','exports'];(function(_0x343dea,_0x45fe7f){var _0x5eab0b=function(_0x53e9e5){while(--_0x53e9e5){_0x343dea['push'](_0x343dea['shift']());}};_0x5eab0b(++_0x45fe7f);}(_0xcc2b,0xb6));var _0xbcc2=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xcc2b[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require(_0xbcc2('0x0'));module[_0xbcc2('0x1')]={'type':{'type':Sequelize[_0xbcc2('0x2')](_0xbcc2('0x3'),_0xbcc2('0x4'),_0xbcc2('0x5'),'keyValue',_0xbcc2('0x6')),'defaultValue':_0xbcc2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xbcc2('0x3'),_0xbcc2('0x4'),_0xbcc2('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbcc2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b7e=['customVariable','BOOLEAN','exports','ENUM','string','variable','picklist','STRING'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0x7b7e,0x152));var _0xe7b7=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x7b7e[_0x438fe1];return _0x3c8e1b;};'use strict';var Sequelize=require('sequelize');module[_0xe7b7('0x0')]={'type':{'type':Sequelize[_0xe7b7('0x1')](_0xe7b7('0x2'),_0xe7b7('0x3'),'customVariable','keyValue',_0xe7b7('0x4')),'defaultValue':_0xe7b7('0x2')},'content':{'type':Sequelize[_0xe7b7('0x5')]},'key':{'type':Sequelize[_0xe7b7('0x5')]},'keyType':{'type':Sequelize[_0xe7b7('0x1')]('string',_0xe7b7('0x3'),_0xe7b7('0x6'))},'keyContent':{'type':Sequelize[_0xe7b7('0x5')]},'idField':{'type':Sequelize[_0xe7b7('0x5')]},'nameField':{'type':Sequelize[_0xe7b7('0x5')]},'customField':{'type':Sequelize[_0xe7b7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe7b7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index a6a8faf..2a781f6 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 _0x83e3=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','index','map','DeskField','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x274509,_0x1353f7){var _0x47298c=function(_0x514eaf){while(--_0x514eaf){_0x274509['push'](_0x274509['shift']());}};_0x47298c(++_0x1353f7);}(_0x83e3,0xc1));var _0x383e=function(_0x5c0eb9,_0x1e0fa9){_0x5c0eb9=_0x5c0eb9-0x0;var _0x168f80=_0x83e3[_0x5c0eb9];return _0x168f80;};'use strict';var emlformat=require(_0x383e('0x0'));var rimraf=require(_0x383e('0x1'));var zipdir=require(_0x383e('0x2'));var jsonpatch=require(_0x383e('0x3'));var rp=require(_0x383e('0x4'));var moment=require(_0x383e('0x5'));var BPromise=require(_0x383e('0x6'));var Mustache=require(_0x383e('0x7'));var util=require(_0x383e('0x8'));var path=require(_0x383e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x383e('0xa'));var fs=require('fs');var fs_extra=require(_0x383e('0xb'));var _=require(_0x383e('0xc'));var squel=require(_0x383e('0xd'));var crypto=require('crypto');var jsforce=require(_0x383e('0xe'));var deskjs=require(_0x383e('0xf'));var toCsv=require(_0x383e('0x10'));var querystring=require('querystring');var Papa=require(_0x383e('0x11'));var Redis=require(_0x383e('0x12'));var authService=require(_0x383e('0x13'));var qs=require(_0x383e('0x14'));var as=require(_0x383e('0x15'));var hardwareService=require(_0x383e('0x16'));var logger=require(_0x383e('0x17'))(_0x383e('0x18'));var utils=require('../../config/utils');var config=require(_0x383e('0x19'));var licenseUtil=require(_0x383e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1247db,_0x493fc3){_0x493fc3=_0x493fc3||0xcc;return function(_0x3ea872){if(_0x3ea872){return _0x1247db[_0x383e('0x1b')](_0x493fc3);}return _0x1247db[_0x383e('0x1c')](_0x493fc3)[_0x383e('0x1d')]();};}function respondWithResult(_0x3eaf4d,_0xd4ccc5){_0xd4ccc5=_0xd4ccc5||0xc8;return function(_0x263471){if(_0x263471){return _0x3eaf4d['status'](_0xd4ccc5)[_0x383e('0x1e')](_0x263471);}};}function respondWithFilteredResult(_0x93f2ff,_0x5b336e){return function(_0x1b707e){if(_0x1b707e){var _0xaf3351=typeof _0x5b336e[_0x383e('0x1f')]===_0x383e('0x20')&&typeof _0x5b336e[_0x383e('0x21')]===_0x383e('0x20');var _0x426328=_0x1b707e[_0x383e('0x22')];var _0x5815b5=_0xaf3351?0x0:_0x5b336e['offset'];var _0x3a468c=_0xaf3351?_0x1b707e[_0x383e('0x22')]:_0x5b336e['offset']+_0x5b336e[_0x383e('0x21')];var _0x5bef1a;if(_0x3a468c>=_0x426328){_0x3a468c=_0x426328;_0x5bef1a=0xc8;}else{_0x5bef1a=0xce;}_0x93f2ff[_0x383e('0x1c')](_0x5bef1a);return _0x93f2ff['set']('Content-Range',_0x5815b5+'-'+_0x3a468c+'/'+_0x426328)[_0x383e('0x1e')](_0x1b707e);}return null;};}function patchUpdates(_0x351701){return function(_0x520a53){try{jsonpatch[_0x383e('0x23')](_0x520a53,_0x351701,!![]);}catch(_0x5d9c62){return BPromise[_0x383e('0x24')](_0x5d9c62);}return _0x520a53[_0x383e('0x25')]();};}function saveUpdates(_0x127289,_0x4e16aa){return function(_0x543348){if(_0x543348){return _0x543348[_0x383e('0x26')](_0x127289)['then'](function(_0x5cf631){return _0x5cf631;});}return null;};}function removeEntity(_0x33ac89,_0x228334){return function(_0x4fe863){if(_0x4fe863){return _0x4fe863[_0x383e('0x27')]()[_0x383e('0x28')](function(){_0x33ac89[_0x383e('0x1c')](0xcc)[_0x383e('0x1d')]();});}};}function handleEntityNotFound(_0x5bb812,_0x119ed9){return function(_0x4acf35){if(!_0x4acf35){_0x5bb812[_0x383e('0x1b')](0x194);}return _0x4acf35;};}function handleError(_0x16a0e7,_0xedc826){_0xedc826=_0xedc826||0x1f4;return function(_0x1a9ba1){logger[_0x383e('0x29')](_0x1a9ba1[_0x383e('0x2a')]);if(_0x1a9ba1[_0x383e('0x2b')]){delete _0x1a9ba1[_0x383e('0x2b')];}_0x16a0e7[_0x383e('0x1c')](_0xedc826)['send'](_0x1a9ba1);};}exports[_0x383e('0x2c')]=function(_0xbcfa21,_0x1d6801){var _0x5902bf={},_0x44999c={},_0x51f788={'count':0x0,'rows':[]};var _0x5237bf=_[_0x383e('0x2d')](db[_0x383e('0x2e')][_0x383e('0x2f')],function(_0x4de918){return{'name':_0x4de918['fieldName'],'type':_0x4de918[_0x383e('0x30')][_0x383e('0x31')]};});_0x44999c['model']=_[_0x383e('0x2d')](_0x5237bf,_0x383e('0x2b'));_0x44999c['query']=_['keys'](_0xbcfa21[_0x383e('0x32')]);_0x44999c[_0x383e('0x33')]=_[_0x383e('0x34')](_0x44999c[_0x383e('0x35')],_0x44999c[_0x383e('0x32')]);_0x5902bf[_0x383e('0x36')]=_[_0x383e('0x34')](_0x44999c[_0x383e('0x35')],qs[_0x383e('0x37')](_0xbcfa21['query'][_0x383e('0x37')]));_0x5902bf[_0x383e('0x36')]=_0x5902bf[_0x383e('0x36')][_0x383e('0x38')]?_0x5902bf['attributes']:_0x44999c[_0x383e('0x35')];if(!_0xbcfa21[_0x383e('0x32')][_0x383e('0x39')](_0x383e('0x3a'))){_0x5902bf['limit']=qs[_0x383e('0x21')](_0xbcfa21[_0x383e('0x32')][_0x383e('0x21')]);_0x5902bf[_0x383e('0x1f')]=qs[_0x383e('0x1f')](_0xbcfa21[_0x383e('0x32')][_0x383e('0x1f')]);}_0x5902bf['order']=qs['sort'](_0xbcfa21[_0x383e('0x32')]['sort']);_0x5902bf[_0x383e('0x3b')]=qs[_0x383e('0x33')](_['pick'](_0xbcfa21[_0x383e('0x32')],_0x44999c[_0x383e('0x33')]),_0x5237bf);if(_0xbcfa21['query']['filter']){_0x5902bf['where']=_[_0x383e('0x3c')](_0x5902bf[_0x383e('0x3b')],{'$or':_[_0x383e('0x2d')](_0x5237bf,function(_0x8ee763){if(_0x8ee763[_0x383e('0x30')]!=='VIRTUAL'){var _0x522475={};_0x522475[_0x8ee763[_0x383e('0x2b')]]={'$like':'%'+_0xbcfa21[_0x383e('0x32')]['filter']+'%'};return _0x522475;}})});}_0x5902bf=_[_0x383e('0x3c')]({},_0x5902bf,_0xbcfa21['options']);var _0x4c2bfb={'where':_0x5902bf['where']};return db[_0x383e('0x2e')][_0x383e('0x22')](_0x4c2bfb)[_0x383e('0x28')](function(_0x321939){_0x51f788[_0x383e('0x22')]=_0x321939;if(_0xbcfa21[_0x383e('0x32')][_0x383e('0x3d')]){_0x5902bf[_0x383e('0x3e')]=[{'all':!![]}];}return db[_0x383e('0x2e')][_0x383e('0x3f')](_0x5902bf);})[_0x383e('0x28')](function(_0x4c75eb){_0x51f788[_0x383e('0x40')]=_0x4c75eb;return _0x51f788;})[_0x383e('0x28')](respondWithFilteredResult(_0x1d6801,_0x5902bf))[_0x383e('0x41')](handleError(_0x1d6801,null));};exports[_0x383e('0x42')]=function(_0x1e8732,_0x281202){var _0x561753={'raw':!![],'where':{'id':_0x1e8732['params']['id']}},_0x2d8153={};_0x2d8153[_0x383e('0x35')]=_[_0x383e('0x43')](db['DeskField'][_0x383e('0x2f')]);_0x2d8153['query']=_['keys'](_0x1e8732[_0x383e('0x32')]);_0x2d8153[_0x383e('0x33')]=_[_0x383e('0x34')](_0x2d8153[_0x383e('0x35')],_0x2d8153[_0x383e('0x32')]);_0x561753['attributes']=_[_0x383e('0x34')](_0x2d8153[_0x383e('0x35')],qs['fields'](_0x1e8732['query'][_0x383e('0x37')]));_0x561753['attributes']=_0x561753[_0x383e('0x36')][_0x383e('0x38')]?_0x561753[_0x383e('0x36')]:_0x2d8153[_0x383e('0x35')];if(_0x1e8732[_0x383e('0x32')]['includeAll']){_0x561753[_0x383e('0x3e')]=[{'all':!![]}];}_0x561753=_['merge']({},_0x561753,_0x1e8732[_0x383e('0x44')]);return db['DeskField'][_0x383e('0x45')](_0x561753)[_0x383e('0x28')](handleEntityNotFound(_0x281202,null))['then'](respondWithResult(_0x281202,null))[_0x383e('0x41')](handleError(_0x281202,null));};exports[_0x383e('0x46')]=function(_0x44c08e,_0x476af9){return db[_0x383e('0x2e')][_0x383e('0x46')](_0x44c08e[_0x383e('0x47')],{})['then'](respondWithResult(_0x476af9,0xc9))[_0x383e('0x41')](handleError(_0x476af9,null));};exports[_0x383e('0x26')]=function(_0x1cb120,_0x1f7a22){if(_0x1cb120[_0x383e('0x47')]['id']){delete _0x1cb120[_0x383e('0x47')]['id'];}return db[_0x383e('0x2e')][_0x383e('0x45')]({'where':{'id':_0x1cb120[_0x383e('0x48')]['id']}})[_0x383e('0x28')](handleEntityNotFound(_0x1f7a22,null))[_0x383e('0x28')](saveUpdates(_0x1cb120[_0x383e('0x47')],null))[_0x383e('0x28')](respondWithResult(_0x1f7a22,null))[_0x383e('0x41')](handleError(_0x1f7a22,null));};exports[_0x383e('0x27')]=function(_0x11e795,_0x150558){return db[_0x383e('0x2e')][_0x383e('0x45')]({'where':{'id':_0x11e795[_0x383e('0x48')]['id']}})[_0x383e('0x28')](handleEntityNotFound(_0x150558,null))[_0x383e('0x28')](removeEntity(_0x150558,null))[_0x383e('0x41')](handleError(_0x150558,null));}; \ No newline at end of file +var _0x38e4=['params','keys','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show'];(function(_0x38ff2e,_0x256a7f){var _0x38be98=function(_0x38bfba){while(--_0x38bfba){_0x38ff2e['push'](_0x38ff2e['shift']());}};_0x38be98(++_0x256a7f);}(_0x38e4,0x9e));var _0x438e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x38e4[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x438e('0x0'));var rimraf=require(_0x438e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x438e('0x2'));var rp=require(_0x438e('0x3'));var moment=require('moment');var BPromise=require(_0x438e('0x4'));var Mustache=require(_0x438e('0x5'));var util=require(_0x438e('0x6'));var path=require('path');var sox=require(_0x438e('0x7'));var csv=require(_0x438e('0x8'));var ejs=require(_0x438e('0x9'));var fs=require('fs');var fs_extra=require(_0x438e('0xa'));var _=require(_0x438e('0xb'));var squel=require(_0x438e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x438e('0xd'));var Papa=require(_0x438e('0xe'));var Redis=require(_0x438e('0xf'));var authService=require(_0x438e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x438e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x438e('0x12'))('api');var utils=require(_0x438e('0x13'));var config=require(_0x438e('0x14'));var licenseUtil=require(_0x438e('0x15'));var db=require(_0x438e('0x16'))['db'];function respondWithStatusCode(_0x245564,_0x58bf98){_0x58bf98=_0x58bf98||0xcc;return function(_0x170831){if(_0x170831){return _0x245564[_0x438e('0x17')](_0x58bf98);}return _0x245564[_0x438e('0x18')](_0x58bf98)[_0x438e('0x19')]();};}function respondWithResult(_0x56e395,_0x4ebaee){_0x4ebaee=_0x4ebaee||0xc8;return function(_0x52baf3){if(_0x52baf3){return _0x56e395[_0x438e('0x18')](_0x4ebaee)[_0x438e('0x1a')](_0x52baf3);}};}function respondWithFilteredResult(_0xdeb59,_0x7f016d){return function(_0x421771){if(_0x421771){var _0x159ff6=typeof _0x7f016d[_0x438e('0x1b')]==='undefined'&&typeof _0x7f016d[_0x438e('0x1c')]===_0x438e('0x1d');var _0x28c40e=_0x421771[_0x438e('0x1e')];var _0x117250=_0x159ff6?0x0:_0x7f016d[_0x438e('0x1b')];var _0x47db26=_0x159ff6?_0x421771[_0x438e('0x1e')]:_0x7f016d['offset']+_0x7f016d['limit'];var _0x2ddcf9;if(_0x47db26>=_0x28c40e){_0x47db26=_0x28c40e;_0x2ddcf9=0xc8;}else{_0x2ddcf9=0xce;}_0xdeb59[_0x438e('0x18')](_0x2ddcf9);return _0xdeb59[_0x438e('0x1f')](_0x438e('0x20'),_0x117250+'-'+_0x47db26+'/'+_0x28c40e)['json'](_0x421771);}return null;};}function patchUpdates(_0x4cf06d){return function(_0xea3053){try{jsonpatch[_0x438e('0x21')](_0xea3053,_0x4cf06d,!![]);}catch(_0x2f9e65){return BPromise[_0x438e('0x22')](_0x2f9e65);}return _0xea3053['save']();};}function saveUpdates(_0x5bf513,_0x585bd0){return function(_0x99f2be){if(_0x99f2be){return _0x99f2be[_0x438e('0x23')](_0x5bf513)[_0x438e('0x24')](function(_0x68639c){return _0x68639c;});}return null;};}function removeEntity(_0x4270ff,_0x4b4785){return function(_0x22eb66){if(_0x22eb66){return _0x22eb66['destroy']()[_0x438e('0x24')](function(){_0x4270ff[_0x438e('0x18')](0xcc)[_0x438e('0x19')]();});}};}function handleEntityNotFound(_0xa00035,_0x3af05d){return function(_0x1caa87){if(!_0x1caa87){_0xa00035['sendStatus'](0x194);}return _0x1caa87;};}function handleError(_0x1faba6,_0xcbfec1){_0xcbfec1=_0xcbfec1||0x1f4;return function(_0x52f85c){logger[_0x438e('0x25')](_0x52f85c[_0x438e('0x26')]);if(_0x52f85c[_0x438e('0x27')]){delete _0x52f85c['name'];}_0x1faba6[_0x438e('0x18')](_0xcbfec1)[_0x438e('0x28')](_0x52f85c);};}exports[_0x438e('0x29')]=function(_0x4703c4,_0x5213ce){var _0x277bb3={},_0x65f587={},_0x5b53af={'count':0x0,'rows':[]};var _0x5da9a4=_[_0x438e('0x2a')](db[_0x438e('0x2b')][_0x438e('0x2c')],function(_0x460fea){return{'name':_0x460fea['fieldName'],'type':_0x460fea[_0x438e('0x2d')][_0x438e('0x2e')]};});_0x65f587['model']=_[_0x438e('0x2a')](_0x5da9a4,_0x438e('0x27'));_0x65f587[_0x438e('0x2f')]=_['keys'](_0x4703c4[_0x438e('0x2f')]);_0x65f587[_0x438e('0x30')]=_[_0x438e('0x31')](_0x65f587[_0x438e('0x32')],_0x65f587[_0x438e('0x2f')]);_0x277bb3['attributes']=_[_0x438e('0x31')](_0x65f587['model'],qs[_0x438e('0x33')](_0x4703c4['query'][_0x438e('0x33')]));_0x277bb3[_0x438e('0x34')]=_0x277bb3[_0x438e('0x34')][_0x438e('0x35')]?_0x277bb3[_0x438e('0x34')]:_0x65f587[_0x438e('0x32')];if(!_0x4703c4[_0x438e('0x2f')][_0x438e('0x36')](_0x438e('0x37'))){_0x277bb3['limit']=qs[_0x438e('0x1c')](_0x4703c4[_0x438e('0x2f')][_0x438e('0x1c')]);_0x277bb3[_0x438e('0x1b')]=qs[_0x438e('0x1b')](_0x4703c4[_0x438e('0x2f')][_0x438e('0x1b')]);}_0x277bb3[_0x438e('0x38')]=qs[_0x438e('0x39')](_0x4703c4[_0x438e('0x2f')][_0x438e('0x39')]);_0x277bb3['where']=qs['filters'](_['pick'](_0x4703c4[_0x438e('0x2f')],_0x65f587[_0x438e('0x30')]),_0x5da9a4);if(_0x4703c4['query'][_0x438e('0x3a')]){_0x277bb3[_0x438e('0x3b')]=_[_0x438e('0x3c')](_0x277bb3['where'],{'$or':_[_0x438e('0x2a')](_0x5da9a4,function(_0x3352c2){if(_0x3352c2[_0x438e('0x2d')]!==_0x438e('0x3d')){var _0xb47d90={};_0xb47d90[_0x3352c2[_0x438e('0x27')]]={'$like':'%'+_0x4703c4[_0x438e('0x2f')][_0x438e('0x3a')]+'%'};return _0xb47d90;}})});}_0x277bb3=_[_0x438e('0x3c')]({},_0x277bb3,_0x4703c4['options']);var _0x38064e={'where':_0x277bb3[_0x438e('0x3b')]};return db[_0x438e('0x2b')][_0x438e('0x1e')](_0x38064e)[_0x438e('0x24')](function(_0xb39b9){_0x5b53af[_0x438e('0x1e')]=_0xb39b9;if(_0x4703c4[_0x438e('0x2f')][_0x438e('0x3e')]){_0x277bb3[_0x438e('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x438e('0x40')](_0x277bb3);})[_0x438e('0x24')](function(_0x5985fd){_0x5b53af[_0x438e('0x41')]=_0x5985fd;return _0x5b53af;})[_0x438e('0x24')](respondWithFilteredResult(_0x5213ce,_0x277bb3))['catch'](handleError(_0x5213ce,null));};exports[_0x438e('0x42')]=function(_0x20d08c,_0x1d78fd){var _0x2bea8c={'raw':!![],'where':{'id':_0x20d08c[_0x438e('0x43')]['id']}},_0x525dec={};_0x525dec[_0x438e('0x32')]=_[_0x438e('0x44')](db[_0x438e('0x2b')][_0x438e('0x2c')]);_0x525dec[_0x438e('0x2f')]=_['keys'](_0x20d08c['query']);_0x525dec[_0x438e('0x30')]=_[_0x438e('0x31')](_0x525dec['model'],_0x525dec['query']);_0x2bea8c[_0x438e('0x34')]=_[_0x438e('0x31')](_0x525dec['model'],qs[_0x438e('0x33')](_0x20d08c[_0x438e('0x2f')][_0x438e('0x33')]));_0x2bea8c[_0x438e('0x34')]=_0x2bea8c[_0x438e('0x34')][_0x438e('0x35')]?_0x2bea8c[_0x438e('0x34')]:_0x525dec[_0x438e('0x32')];if(_0x20d08c['query'][_0x438e('0x3e')]){_0x2bea8c[_0x438e('0x3f')]=[{'all':!![]}];}_0x2bea8c=_['merge']({},_0x2bea8c,_0x20d08c[_0x438e('0x45')]);return db[_0x438e('0x2b')][_0x438e('0x46')](_0x2bea8c)[_0x438e('0x24')](handleEntityNotFound(_0x1d78fd,null))[_0x438e('0x24')](respondWithResult(_0x1d78fd,null))[_0x438e('0x47')](handleError(_0x1d78fd,null));};exports[_0x438e('0x48')]=function(_0x305429,_0x215501){return db['DeskField'][_0x438e('0x48')](_0x305429[_0x438e('0x49')],{})['then'](respondWithResult(_0x215501,0xc9))[_0x438e('0x47')](handleError(_0x215501,null));};exports['update']=function(_0x2960fb,_0x57e2d5){if(_0x2960fb[_0x438e('0x49')]['id']){delete _0x2960fb[_0x438e('0x49')]['id'];}return db[_0x438e('0x2b')][_0x438e('0x46')]({'where':{'id':_0x2960fb[_0x438e('0x43')]['id']}})[_0x438e('0x24')](handleEntityNotFound(_0x57e2d5,null))['then'](saveUpdates(_0x2960fb['body'],null))[_0x438e('0x24')](respondWithResult(_0x57e2d5,null))[_0x438e('0x47')](handleError(_0x57e2d5,null));};exports[_0x438e('0x4a')]=function(_0x30abbd,_0x2e9923){return db[_0x438e('0x2b')][_0x438e('0x46')]({'where':{'id':_0x30abbd[_0x438e('0x43')]['id']}})[_0x438e('0x24')](handleEntityNotFound(_0x2e9923,null))['then'](removeEntity(_0x2e9923,null))['catch'](handleError(_0x2e9923,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 254c534..dab6650 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 _0x56b2=['bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x55b659,_0x55bc0d){var _0xc174fd=function(_0xfd1904){while(--_0xfd1904){_0x55b659['push'](_0x55b659['shift']());}};_0xc174fd(++_0x55bc0d);}(_0x56b2,0x19c));var _0x256b=function(_0x130575,_0x559a21){_0x130575=_0x130575-0x0;var _0x748d58=_0x56b2[_0x130575];return _0x748d58;};'use strict';var _=require(_0x256b('0x0'));var util=require(_0x256b('0x1'));var logger=require(_0x256b('0x2'))(_0x256b('0x3'));var moment=require('moment');var BPromise=require(_0x256b('0x4'));var rp=require(_0x256b('0x5'));var fs=require('fs');var path=require(_0x256b('0x6'));var rimraf=require('rimraf');var config=require(_0x256b('0x7'));var attributes=require(_0x256b('0x8'));module[_0x256b('0x9')]=function(_0x35b5d4,_0x5a45f3){return _0x35b5d4[_0x256b('0xa')](_0x256b('0xb'),attributes,{'tableName':_0x256b('0xc'),'paranoid':![],'indexes':[{'name':_0x256b('0xd'),'fields':[_0x256b('0xe'),_0x256b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed1f=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','desk_unique_index','idField'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0xed1f,0x8d));var _0xfed1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed1f[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var util=require(_0xfed1('0x0'));var logger=require(_0xfed1('0x1'))(_0xfed1('0x2'));var moment=require(_0xfed1('0x3'));var BPromise=require(_0xfed1('0x4'));var rp=require(_0xfed1('0x5'));var fs=require('fs');var path=require(_0xfed1('0x6'));var rimraf=require('rimraf');var config=require(_0xfed1('0x7'));var attributes=require(_0xfed1('0x8'));module[_0xfed1('0x9')]=function(_0x29ef57,_0x18e40b){return _0x29ef57[_0xfed1('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xfed1('0xb'),'fields':[_0xfed1('0xc'),_0xfed1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 437bfe1..7c73fe8 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 _0x27e1=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','DeskField,\x20%s,\x20%s'];(function(_0x1b5738,_0x5e6b11){var _0x4d8a1e=function(_0x5c7ab3){while(--_0x5c7ab3){_0x1b5738['push'](_0x1b5738['shift']());}};_0x4d8a1e(++_0x5e6b11);}(_0x27e1,0x1a7));var _0x127e=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x27e1[_0x1602ef];return _0x5870ee;};'use strict';var _=require(_0x127e('0x0'));var util=require(_0x127e('0x1'));var moment=require(_0x127e('0x2'));var BPromise=require('bluebird');var rs=require(_0x127e('0x3'));var fs=require('fs');var Redis=require(_0x127e('0x4'));var db=require(_0x127e('0x5'))['db'];var utils=require(_0x127e('0x6'));var logger=require(_0x127e('0x7'))(_0x127e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x127e('0x9')][_0x127e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3643f6,_0x15fc88,_0x3bbd76){return new BPromise(function(_0x520fc3,_0x18e119){return client[_0x127e('0xb')](_0x3643f6,_0x3bbd76)[_0x127e('0xc')](function(_0x20390d){logger['info'](_0x127e('0xd'),_0x15fc88,'request\x20sent');logger[_0x127e('0xe')](_0x127e('0xf'),_0x15fc88,_0x127e('0x10'),JSON[_0x127e('0x11')](_0x20390d));if(_0x20390d['error']){if(_0x20390d['error'][_0x127e('0x12')]===0x1f4){logger[_0x127e('0x13')](_0x127e('0xd'),_0x15fc88,_0x20390d['error'][_0x127e('0x14')]);return _0x18e119(_0x20390d[_0x127e('0x13')][_0x127e('0x14')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x15fc88,_0x20390d[_0x127e('0x13')][_0x127e('0x14')]);return _0x520fc3(_0x20390d[_0x127e('0x13')]['message']);}else{logger[_0x127e('0x15')](_0x127e('0xd'),_0x15fc88,_0x127e('0x10'));_0x520fc3(_0x20390d[_0x127e('0x16')][_0x127e('0x14')]);}})['catch'](function(_0x5bbd3f){logger[_0x127e('0x13')](_0x127e('0xd'),_0x15fc88,_0x5bbd3f);_0x18e119(_0x5bbd3f);});});} \ No newline at end of file +var _0xc717=['http','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x358e25,_0x40883e){var _0x877395=function(_0x39d4ad){while(--_0x39d4ad){_0x358e25['push'](_0x358e25['shift']());}};_0x877395(++_0x40883e);}(_0xc717,0x197));var _0x7c71=function(_0x3bde47,_0x1c8594){_0x3bde47=_0x3bde47-0x0;var _0x270d67=_0xc717[_0x3bde47];return _0x270d67;};'use strict';var _=require(_0x7c71('0x0'));var util=require(_0x7c71('0x1'));var moment=require(_0x7c71('0x2'));var BPromise=require(_0x7c71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c71('0x4'));var db=require(_0x7c71('0x5'))['db'];var utils=require(_0x7c71('0x6'));var logger=require(_0x7c71('0x7'))('rpc');var config=require(_0x7c71('0x8'));var jayson=require(_0x7c71('0x9'));var client=jayson[_0x7c71('0xa')][_0x7c71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dc0bc,_0x373761,_0x1e39cf){return new BPromise(function(_0x455a9c,_0x47bb11){return client['request'](_0x4dc0bc,_0x1e39cf)['then'](function(_0x1b144a){logger[_0x7c71('0xc')](_0x7c71('0xd'),_0x373761,_0x7c71('0xe'));logger['debug'](_0x7c71('0xf'),_0x373761,'request\x20sent',JSON[_0x7c71('0x10')](_0x1b144a));if(_0x1b144a[_0x7c71('0x11')]){if(_0x1b144a[_0x7c71('0x11')][_0x7c71('0x12')]===0x1f4){logger[_0x7c71('0x11')](_0x7c71('0xd'),_0x373761,_0x1b144a[_0x7c71('0x11')]['message']);return _0x47bb11(_0x1b144a[_0x7c71('0x11')][_0x7c71('0x13')]);}logger[_0x7c71('0x11')](_0x7c71('0xd'),_0x373761,_0x1b144a[_0x7c71('0x11')][_0x7c71('0x13')]);return _0x455a9c(_0x1b144a[_0x7c71('0x11')][_0x7c71('0x13')]);}else{logger[_0x7c71('0xc')](_0x7c71('0xd'),_0x373761,_0x7c71('0xe'));_0x455a9c(_0x1b144a[_0x7c71('0x14')][_0x7c71('0x13')]);}})[_0x7c71('0x15')](function(_0x108e9c){logger[_0x7c71('0x11')](_0x7c71('0xd'),_0x373761,_0x108e9c);_0x47bb11(_0x108e9c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 08ea7d8..71f424b 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 _0x8a92=['addConfiguration','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post'];(function(_0x326954,_0x29b6c9){var _0x9ce015=function(_0x59d6cf){while(--_0x59d6cf){_0x326954['push'](_0x326954['shift']());}};_0x9ce015(++_0x29b6c9);}(_0x8a92,0x114));var _0x28a9=function(_0x14aafd,_0x37abfa){_0x14aafd=_0x14aafd-0x0;var _0x5129ae=_0x8a92[_0x14aafd];return _0x5129ae;};'use strict';var multer=require(_0x28a9('0x0'));var util=require(_0x28a9('0x1'));var path=require(_0x28a9('0x2'));var timeout=require(_0x28a9('0x3'));var express=require(_0x28a9('0x4'));var router=express[_0x28a9('0x5')]();var fs_extra=require(_0x28a9('0x6'));var auth=require(_0x28a9('0x7'));var interaction=require(_0x28a9('0x8'));var config=require(_0x28a9('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x28a9('0xa')]('/',auth[_0x28a9('0xb')](),controller[_0x28a9('0xc')]);router['get'](_0x28a9('0xd'),auth[_0x28a9('0xb')](),controller[_0x28a9('0xe')]);router[_0x28a9('0xa')](_0x28a9('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x28a9('0xa')](_0x28a9('0x10'),auth[_0x28a9('0xb')](),controller['getFields']);router[_0x28a9('0x11')]('/',auth[_0x28a9('0xb')](),controller['create']);router[_0x28a9('0x11')]('/:id/configurations',auth[_0x28a9('0xb')](),controller[_0x28a9('0x12')]);router[_0x28a9('0x13')](_0x28a9('0xd'),auth[_0x28a9('0xb')](),controller['update']);router['delete'](_0x28a9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x28a9('0x14')]=router; \ No newline at end of file +var _0x9864=['/:id/fields','create','put','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations'];(function(_0x13ec3b,_0x38d211){var _0x4b836e=function(_0x4bed1f){while(--_0x4bed1f){_0x13ec3b['push'](_0x13ec3b['shift']());}};_0x4b836e(++_0x38d211);}(_0x9864,0x70));var _0x4986=function(_0x3d72a9,_0xbe490b){_0x3d72a9=_0x3d72a9-0x0;var _0x4a8e91=_0x9864[_0x3d72a9];return _0x4a8e91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4986('0x0'));var timeout=require(_0x4986('0x1'));var express=require('express');var router=express[_0x4986('0x2')]();var fs_extra=require(_0x4986('0x3'));var auth=require(_0x4986('0x4'));var interaction=require(_0x4986('0x5'));var config=require(_0x4986('0x6'));var controller=require(_0x4986('0x7'));router['get']('/',auth[_0x4986('0x8')](),controller[_0x4986('0x9')]);router[_0x4986('0xa')](_0x4986('0xb'),auth[_0x4986('0x8')](),controller['show']);router[_0x4986('0xa')](_0x4986('0xc'),auth['isAuthenticated'](),controller[_0x4986('0xd')]);router[_0x4986('0xa')](_0x4986('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x4986('0x8')](),controller[_0x4986('0xf')]);router['post'](_0x4986('0xc'),auth[_0x4986('0x8')](),controller['addConfiguration']);router[_0x4986('0x10')](_0x4986('0xb'),auth[_0x4986('0x8')](),controller['update']);router['delete'](_0x4986('0xb'),auth[_0x4986('0x8')](),controller[_0x4986('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a65787e..368164f 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 _0xcb66=['BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb66,0x19f));var _0x6cb6=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xcb66[_0x3718b7];return _0xf8c91e;};'use strict';var Sequelize=require('sequelize');module[_0x6cb6('0x0')]={'name':{'type':Sequelize[_0x6cb6('0x1')]},'username':{'type':Sequelize[_0x6cb6('0x1')]},'password':{'type':Sequelize[_0x6cb6('0x1')]},'remoteUri':{'type':Sequelize[_0x6cb6('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6cb6('0x1')]},'clientSecret':{'type':Sequelize[_0x6cb6('0x1')]},'serverUrl':{'type':Sequelize[_0x6cb6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6cb6('0x1')]},'modernAuthentication':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2123=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f4676,_0x7ecc76){var _0x4566d5=function(_0x592d68){while(--_0x592d68){_0x2f4676['push'](_0x2f4676['shift']());}};_0x4566d5(++_0x7ecc76);}(_0x2123,0x190));var _0x3212=function(_0x1cfb74,_0x4dbeca){_0x1cfb74=_0x1cfb74-0x0;var _0x4ca325=_0x2123[_0x1cfb74];return _0x4ca325;};'use strict';var Sequelize=require(_0x3212('0x0'));module[_0x3212('0x1')]={'name':{'type':Sequelize[_0x3212('0x2')]},'username':{'type':Sequelize[_0x3212('0x2')]},'password':{'type':Sequelize[_0x3212('0x2')]},'remoteUri':{'type':Sequelize[_0x3212('0x2')]},'tenantId':{'type':Sequelize[_0x3212('0x2')]},'clientId':{'type':Sequelize[_0x3212('0x2')]},'clientSecret':{'type':Sequelize[_0x3212('0x2')]},'serverUrl':{'type':Sequelize[_0x3212('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3212('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3212('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 264cda7..91e6da6 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 _0xf635=['intersection','attributes','fields','length','nolimit','sort','filter','merge','where','VIRTUAL','options','Dynamics365Account','includeAll','include','catch','show','params','create','body','find','findOne','Dynamics365Configuration','order','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','/oauth2/token','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','LogicalName','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Attributes(','lodash','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf635,0x158));var _0x5f63=function(_0x20bbe5,_0x189723){_0x20bbe5=_0x20bbe5-0x0;var _0x1d94c7=_0xf635[_0x20bbe5];return _0x1d94c7;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x5f63('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f63('0x1'))(_0x5f63('0x2'));var db=require(_0x5f63('0x3'))['db'];var integrations=require(_0x5f63('0x4'));function respondWithResult(_0x437b2b,_0x411e8a){_0x411e8a=_0x411e8a||0xc8;return function(_0x15ca06){if(_0x15ca06){return _0x437b2b[_0x5f63('0x5')](_0x411e8a)[_0x5f63('0x6')](_0x15ca06);}};}function respondWithFilteredResult(_0x2098f7,_0x100e78){return function(_0x535bfe){if(_0x535bfe){var _0x4fe0fb=typeof _0x100e78[_0x5f63('0x7')]===_0x5f63('0x8')&&typeof _0x100e78[_0x5f63('0x9')]==='undefined';var _0x5317c3=_0x535bfe[_0x5f63('0xa')];var _0xeb061b=_0x4fe0fb?0x0:_0x100e78[_0x5f63('0x7')];var _0x214112=_0x4fe0fb?_0x535bfe[_0x5f63('0xa')]:_0x100e78[_0x5f63('0x7')]+_0x100e78[_0x5f63('0x9')];var _0x536656;if(_0x214112>=_0x5317c3){_0x214112=_0x5317c3;_0x536656=0xc8;}else{_0x536656=0xce;}_0x2098f7['status'](_0x536656);return _0x2098f7[_0x5f63('0xb')](_0x5f63('0xc'),_0xeb061b+'-'+_0x214112+'/'+_0x5317c3)[_0x5f63('0x6')](_0x535bfe);}return null;};}function saveUpdates(_0x4a5f26){return function(_0x13d641){if(_0x13d641){return _0x13d641[_0x5f63('0xd')](_0x4a5f26)[_0x5f63('0xe')](function(_0x24b786){return _0x24b786;});}return null;};}function removeEntity(_0xe9c3d3){return function(_0x1bc845){if(_0x1bc845){return _0x1bc845[_0x5f63('0xf')]()['then'](function(){_0xe9c3d3[_0x5f63('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dde6){return function(_0x381cc5){if(!_0x381cc5){_0x32dde6['sendStatus'](0x194);}return _0x381cc5;};}function handleError(_0x3ba95a,_0x19feaf){_0x19feaf=_0x19feaf||0x1f4;return function(_0x2ea48d){logger[_0x5f63('0x10')](_0x2ea48d[_0x5f63('0x11')]);if(_0x2ea48d[_0x5f63('0x12')]){delete _0x2ea48d[_0x5f63('0x12')];}_0x3ba95a[_0x5f63('0x5')](_0x19feaf)[_0x5f63('0x13')](_0x2ea48d);};}exports[_0x5f63('0x14')]=function(_0x26b97f,_0x3593f3){var _0x462118={},_0x3fdc4d={},_0x75af48={'count':0x0,'rows':[]};var _0x4860b4=_[_0x5f63('0x15')](db['Dynamics365Account'][_0x5f63('0x16')],function(_0x42d2a5){return{'name':_0x42d2a5[_0x5f63('0x17')],'type':_0x42d2a5['type']['key']};});_0x3fdc4d[_0x5f63('0x18')]=_[_0x5f63('0x15')](_0x4860b4,_0x5f63('0x12'));_0x3fdc4d[_0x5f63('0x19')]=_[_0x5f63('0x1a')](_0x26b97f['query']);_0x3fdc4d[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x3fdc4d['model'],_0x3fdc4d[_0x5f63('0x19')]);_0x462118[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x3fdc4d['model'],qs[_0x5f63('0x1e')](_0x26b97f['query'][_0x5f63('0x1e')]));_0x462118[_0x5f63('0x1d')]=_0x462118[_0x5f63('0x1d')][_0x5f63('0x1f')]?_0x462118[_0x5f63('0x1d')]:_0x3fdc4d[_0x5f63('0x18')];if(!_0x26b97f[_0x5f63('0x19')]['hasOwnProperty'](_0x5f63('0x20'))){_0x462118[_0x5f63('0x9')]=qs[_0x5f63('0x9')](_0x26b97f[_0x5f63('0x19')][_0x5f63('0x9')]);_0x462118[_0x5f63('0x7')]=qs[_0x5f63('0x7')](_0x26b97f[_0x5f63('0x19')]['offset']);}_0x462118['order']=qs[_0x5f63('0x21')](_0x26b97f['query'][_0x5f63('0x21')]);_0x462118['where']=qs[_0x5f63('0x1b')](_['pick'](_0x26b97f[_0x5f63('0x19')],_0x3fdc4d[_0x5f63('0x1b')]),_0x4860b4);if(_0x26b97f['query'][_0x5f63('0x22')]){_0x462118['where']=_[_0x5f63('0x23')](_0x462118[_0x5f63('0x24')],{'$or':_[_0x5f63('0x15')](_0x4860b4,function(_0x194037){if(_0x194037['type']!==_0x5f63('0x25')){var _0x325c4b={};_0x325c4b[_0x194037[_0x5f63('0x12')]]={'$like':'%'+_0x26b97f[_0x5f63('0x19')][_0x5f63('0x22')]+'%'};return _0x325c4b;}})});}_0x462118=_[_0x5f63('0x23')]({},_0x462118,_0x26b97f[_0x5f63('0x26')]);var _0x4b1980={'where':_0x462118[_0x5f63('0x24')]};return db[_0x5f63('0x27')]['count'](_0x4b1980)[_0x5f63('0xe')](function(_0x2d489e){_0x75af48[_0x5f63('0xa')]=_0x2d489e;if(_0x26b97f[_0x5f63('0x19')][_0x5f63('0x28')]){_0x462118[_0x5f63('0x29')]=[{'all':!![]}];}return db[_0x5f63('0x27')]['findAll'](_0x462118);})[_0x5f63('0xe')](function(_0x3547fe){_0x75af48['rows']=_0x3547fe;return _0x75af48;})[_0x5f63('0xe')](respondWithFilteredResult(_0x3593f3,_0x462118))[_0x5f63('0x2a')](handleError(_0x3593f3,null));};exports[_0x5f63('0x2b')]=function(_0x3626ef,_0x47aacd){var _0x59ebef={'raw':![],'where':{'id':_0x3626ef[_0x5f63('0x2c')]['id']}},_0x1a0524={};_0x1a0524['model']=_[_0x5f63('0x1a')](db[_0x5f63('0x27')]['rawAttributes']);_0x1a0524['query']=_[_0x5f63('0x1a')](_0x3626ef['query']);_0x1a0524[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x1a0524[_0x5f63('0x18')],_0x1a0524[_0x5f63('0x19')]);_0x59ebef[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x1a0524['model'],qs[_0x5f63('0x1e')](_0x3626ef[_0x5f63('0x19')][_0x5f63('0x1e')]));_0x59ebef[_0x5f63('0x1d')]=_0x59ebef[_0x5f63('0x1d')][_0x5f63('0x1f')]?_0x59ebef[_0x5f63('0x1d')]:_0x1a0524[_0x5f63('0x18')];if(_0x3626ef[_0x5f63('0x19')]['includeAll']){_0x59ebef[_0x5f63('0x29')]=[{'all':!![]}];}_0x59ebef=_['merge']({},_0x59ebef,_0x3626ef[_0x5f63('0x26')]);return db[_0x5f63('0x27')]['find'](_0x59ebef)[_0x5f63('0xe')](handleEntityNotFound(_0x47aacd,null))[_0x5f63('0xe')](respondWithResult(_0x47aacd,null))['catch'](handleError(_0x47aacd,null));};exports[_0x5f63('0x2d')]=function(_0x31ad4e,_0x55ac21){return db[_0x5f63('0x27')]['create'](_0x31ad4e[_0x5f63('0x2e')],{})[_0x5f63('0xe')](respondWithResult(_0x55ac21,0xc9))[_0x5f63('0x2a')](handleError(_0x55ac21,null));};exports[_0x5f63('0xd')]=function(_0x5f560d,_0x2c59d9){if(_0x5f560d[_0x5f63('0x2e')]['id']){delete _0x5f560d[_0x5f63('0x2e')]['id'];}return db[_0x5f63('0x27')][_0x5f63('0x2f')]({'where':{'id':_0x5f560d[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x2c59d9,null))[_0x5f63('0xe')](saveUpdates(_0x5f560d['body'],null))['then'](respondWithResult(_0x2c59d9,null))[_0x5f63('0x2a')](handleError(_0x2c59d9,null));};exports[_0x5f63('0xf')]=function(_0x512d51,_0x5ea7f3){return db[_0x5f63('0x27')][_0x5f63('0x2f')]({'where':{'id':_0x512d51[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x5ea7f3,null))[_0x5f63('0xe')](removeEntity(_0x5ea7f3,null))['catch'](handleError(_0x5ea7f3,null));};exports['getConfigurations']=function(_0x8e5ef9,_0x281704){var _0x41c9ee={};var _0x378ce4={};var _0x138009;var _0x40eb69;return db['Dynamics365Account'][_0x5f63('0x30')]({'where':{'id':_0x8e5ef9[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x281704,null))[_0x5f63('0xe')](function(_0x4a17c8){if(_0x4a17c8){_0x138009=_0x4a17c8;_0x378ce4[_0x5f63('0x18')]=_[_0x5f63('0x1a')](db[_0x5f63('0x31')][_0x5f63('0x16')]);_0x378ce4[_0x5f63('0x19')]=_[_0x5f63('0x1a')](_0x8e5ef9[_0x5f63('0x19')]);_0x378ce4[_0x5f63('0x1b')]=_[_0x5f63('0x1c')](_0x378ce4[_0x5f63('0x18')],_0x378ce4[_0x5f63('0x19')]);_0x41c9ee[_0x5f63('0x1d')]=_[_0x5f63('0x1c')](_0x378ce4[_0x5f63('0x18')],qs[_0x5f63('0x1e')](_0x8e5ef9[_0x5f63('0x19')]['fields']));_0x41c9ee[_0x5f63('0x1d')]=_0x41c9ee[_0x5f63('0x1d')]['length']?_0x41c9ee['attributes']:_0x378ce4[_0x5f63('0x18')];_0x41c9ee[_0x5f63('0x32')]=qs[_0x5f63('0x21')](_0x8e5ef9['query'][_0x5f63('0x21')]);_0x41c9ee[_0x5f63('0x24')]=qs[_0x5f63('0x1b')](_[_0x5f63('0x33')](_0x8e5ef9[_0x5f63('0x19')],_0x378ce4['filters']));if(_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x22')]){_0x41c9ee[_0x5f63('0x24')]=_['merge'](_0x41c9ee[_0x5f63('0x24')],{'$or':_[_0x5f63('0x15')](_0x41c9ee[_0x5f63('0x1d')],function(_0x3bee2d){var _0x23f365={};_0x23f365[_0x3bee2d]={'$like':'%'+_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x22')]+'%'};return _0x23f365;})});}_0x41c9ee=_['merge']({},_0x41c9ee,_0x8e5ef9[_0x5f63('0x26')]);return _0x138009[_0x5f63('0x34')](_0x41c9ee);}})[_0x5f63('0xe')](function(_0x4a8b5c){if(_0x4a8b5c){_0x40eb69=_0x4a8b5c[_0x5f63('0x1f')];if(!_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x35')](_0x5f63('0x20'))){_0x41c9ee[_0x5f63('0x9')]=qs[_0x5f63('0x9')](_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x9')]);_0x41c9ee[_0x5f63('0x7')]=qs[_0x5f63('0x7')](_0x8e5ef9[_0x5f63('0x19')][_0x5f63('0x7')]);}return _0x138009['getConfigurations'](_0x41c9ee);}})[_0x5f63('0xe')](function(_0x6e56){if(_0x6e56){return _0x6e56?{'count':_0x40eb69,'rows':_0x6e56}:null;}})[_0x5f63('0xe')](respondWithResult(_0x281704,null))['catch'](handleError(_0x281704,null));};exports[_0x5f63('0x36')]=function(_0x2a83c2,_0x4c16d9){if(_0x2a83c2['body']['id']){delete _0x2a83c2[_0x5f63('0x2e')]['id'];}return db[_0x5f63('0x27')][_0x5f63('0x30')]({'where':{'id':_0x2a83c2[_0x5f63('0x2c')]['id']}})[_0x5f63('0xe')](handleEntityNotFound(_0x4c16d9,null))[_0x5f63('0xe')](function(_0x1732d4){if(_0x1732d4){_0x2a83c2['body'][_0x5f63('0x37')]=_0x1732d4['id'];_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x38')]=integrations[_0x5f63('0x39')](_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3a')],_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3b')]);_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3c')]=integrations[_0x5f63('0x3d')](_0x2a83c2[_0x5f63('0x2e')][_0x5f63('0x3a')],_0x2a83c2[_0x5f63('0x2e')]['type']);return db[_0x5f63('0x31')][_0x5f63('0x2d')](_0x2a83c2[_0x5f63('0x2e')],{'include':[{'model':db['Dynamics365Field'],'as':_0x5f63('0x38')},{'model':db[_0x5f63('0x3e')],'as':_0x5f63('0x3c')}]});}return null;})['then'](respondWithResult(_0x4c16d9,null))[_0x5f63('0x2a')](handleError(_0x4c16d9,null));};function sanitizeRemoteUri(_0x400d19){var _0x4d1088=_0x400d19[_0x5f63('0x3f')](-0x1);if(_0x4d1088==='/')return _0x400d19[_0x5f63('0x40')](0x0,_0x400d19[_0x5f63('0x41')](_0x4d1088));return _0x400d19;}function getWebApiUrl(_0x5b7805){return util[_0x5f63('0x42')](_0x5f63('0x43'),_0x5b7805);}exports['getFields']=function(_0x4c5f85,_0x25b0d7){var _0x399faa=_0x4c5f85[_0x5f63('0x19')][_0x5f63('0x44')];var _0x22d2ec=_0x399faa===_0x5f63('0x45')?_0x5f63('0x46'):_0x5f63('0x47');var _0x8d5505='';var _0x2a33a1='';var _0x3fa0b0='';var _0x4f2cce='';var _0xd7df56='';var _0x3bc597='';var _0x24777d='';var _0x3d57ce='';var _0x8d4a1a=['title','description',_0x5f63('0x48'),_0x5f63('0x49'),_0x5f63('0x4a'),_0x5f63('0x4b'),_0x5f63('0x4c'),_0x5f63('0x4d'),_0x5f63('0x4e'),_0x5f63('0x4f')];var _0x14b8fe=[_0x5f63('0x50'),_0x5f63('0x51'),_0x5f63('0x52'),_0x5f63('0x53'),'contactidname','contactidyominame',_0x5f63('0x54'),_0x5f63('0x55'),_0x5f63('0x56'),'createdbyexternalpartyyominame','createdbyname',_0x5f63('0x57'),'createdon',_0x5f63('0x58'),_0x5f63('0x59'),_0x5f63('0x5a'),_0x5f63('0x5b'),_0x5f63('0x5c'),_0x5f63('0x5d'),'entitlementidname','entityimage_timestamp',_0x5f63('0x5e'),_0x5f63('0x5f'),_0x5f63('0x60'),_0x5f63('0x61'),_0x5f63('0x62'),'importsequencenumber','influencescore','kbarticleidname',_0x5f63('0x63'),_0x5f63('0x64'),_0x5f63('0x65'),_0x5f63('0x66'),_0x5f63('0x67'),_0x5f63('0x68'),_0x5f63('0x69'),_0x5f63('0x6a'),_0x5f63('0x6b'),_0x5f63('0x6c'),'msdyn_iotalertname',_0x5f63('0x6d'),_0x5f63('0x6e'),_0x5f63('0x6f'),_0x5f63('0x70'),_0x5f63('0x71'),_0x5f63('0x72'),_0x5f63('0x73'),_0x5f63('0x74'),_0x5f63('0x75'),'prioritycodename',_0x5f63('0x76'),_0x5f63('0x77'),_0x5f63('0x78'),'resolvebykpiidname',_0x5f63('0x79'),_0x5f63('0x7a'),_0x5f63('0x7b'),_0x5f63('0x7c'),_0x5f63('0x7d'),'slaname',_0x5f63('0x7e'),_0x5f63('0x7f'),_0x5f63('0x80'),'subjectidname',_0x5f63('0x81'),_0x5f63('0x82'),'transactioncurrencyidname','traversedpath',_0x5f63('0x83'),_0x5f63('0x84')];var _0xd7c461=_0x8d4a1a[_0x5f63('0x85')](_0x14b8fe);return db[_0x5f63('0x27')][_0x5f63('0x30')]({'where':{'id':_0x4c5f85['params']['id']},'attributes':['id',_0x5f63('0x86'),_0x5f63('0x87'),_0x5f63('0x88'),_0x5f63('0x89'),_0x5f63('0x8a'),_0x5f63('0x8b'),_0x5f63('0x8c')],'include':[{'model':db[_0x5f63('0x8d')],'as':'CloudProvider','attributes':['id',_0x5f63('0x8e'),_0x5f63('0x8f')]}]})[_0x5f63('0xe')](handleEntityNotFound(_0x25b0d7,null))[_0x5f63('0xe')](function(_0x4ab0a4){if(_0x4ab0a4){if(_0x4ab0a4['modernAuthentication']){_0x4ab0a4[_0x5f63('0x90')]=_0x4ab0a4['CloudProvider'][_0x5f63('0x8e')];_0x3d57ce=sanitizeRemoteUri(_0x4ab0a4[_0x5f63('0x8d')][_0x5f63('0x8f')]);_0x24777d=getWebApiUrl(_0x3d57ce);return _0x4ab0a4;}_0x3d57ce=sanitizeRemoteUri(_0x4ab0a4[_0x5f63('0x88')]);_0x24777d=getWebApiUrl(_0x3d57ce);var _0x3b3ebd={'method':'POST','uri':_0x5f63('0x91')+_0x4ab0a4['tenantId']+_0x5f63('0x92'),'form':{'client_id':_0x4ab0a4['clientId'],'resource':_0x3d57ce,'username':_0x4ab0a4['username'],'password':_0x4ab0a4['password'],'grant_type':_0x5f63('0x87'),'client_secret':_0x4ab0a4[_0x5f63('0x8b')]},'json':!![]};return rp(_0x3b3ebd);}})['then'](function(_0x1264af){_0x3bc597=_0x1264af['access_token'];var _0x52912f={'method':'GET','uri':encodeURI(_0x24777d+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x22d2ec+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3bc597,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52912f);})[_0x5f63('0xe')](function(_0x4bd10f){var _0x5cb068=_0x4bd10f[_0x5f63('0x93')][0x0];var _0x19b091=_0x5cb068[_0x5f63('0x94')];var _0x47396b={'method':'GET','uri':_0x24777d+'EntityDefinitions('+_0x19b091+_0x5f63('0x95'),'headers':{'Authorization':_0x5f63('0x96')+_0x3bc597,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x47396b);})[_0x5f63('0xe')](function(_0x38d615){_0x8d5505=_0x38d615;_0x2a33a1=_0x8d5505[_0x5f63('0x98')];_0x2a33a1=_[_0x5f63('0x99')](_0x2a33a1,function(_0x522876){return!_0xd7c461[_0x5f63('0x9a')](_0x522876['LogicalName']);});var _0x19cef5=[];var _0x2cf921=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x283cc6){if(_0x283cc6[_0x5f63('0x9c')]){var _0x2dc622=_0x283cc6[_0x5f63('0x9c')][_0x5f63('0x40')](_0x283cc6[_0x5f63('0x9c')]['lastIndexOf']('.')+0x1);if(_0x2dc622==='PicklistAttributeMetadata'){_0x19cef5['push'](getSelectList(_0x24777d,_0x399faa,_0x2cf921,_0x8d5505[_0x5f63('0x94')],_0x283cc6[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x19cef5);})[_0x5f63('0xe')](function(_0x1eadb8){_0x3fa0b0=_0x1eadb8[0x0];var _0x3a8691=[];var _0x478a9d=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x3a8d7e){if(!_[_0x5f63('0x9e')](_0x3a8d7e['@odata.type'])){var _0x12fb38=_0x3a8d7e['@odata.type']['substring'](_0x3a8d7e['@odata.type'][_0x5f63('0x41')]('.')+0x1);if(_0x12fb38===_0x5f63('0x9f')){_0x3a8691[_0x5f63('0xa0')](getBooleanList(_0x24777d,_0x399faa,_0x478a9d,_0x8d5505[_0x5f63('0x94')],_0x3a8d7e[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x3a8691);})[_0x5f63('0xe')](function(_0x1663e5){_0x4f2cce=_0x1663e5[0x0];var _0x4fd710=[];var _0x3355d2=[];_0x2a33a1[_0x5f63('0x9b')](function(_0x153ba7){if(_0x153ba7[_0x5f63('0x9c')]){var _0x1bd285=_0x153ba7[_0x5f63('0x9c')][_0x5f63('0x40')](_0x153ba7['@odata.type'][_0x5f63('0x41')]('.')+0x1);if(_0x1bd285===_0x5f63('0xa1')||_0x1bd285==='DoubleAttributeMetadata'||_0x1bd285==='BigIntAttributeMetadata'||_0x1bd285===_0x5f63('0xa2')||_0x1bd285===_0x5f63('0xa3')||_0x1bd285===_0x5f63('0xa4')||_0x1bd285===_0x5f63('0xa5')||_0x1bd285===_0x5f63('0xa6')||_0x1bd285===_0x5f63('0xa7')||_0x1bd285===_0x5f63('0xa8')){_0x4fd710['push'](getInputList(_0x24777d,_0x399faa,_0x1bd285,_0x3355d2,_0x8d5505[_0x5f63('0x94')],_0x153ba7[_0x5f63('0x94')],_0x3bc597));}}});return Promise[_0x5f63('0x9d')](_0x4fd710);})[_0x5f63('0xe')](function(_0x30ed7e){_0xd7df56=_0x30ed7e[0x0];var _0x28a611=_0x3fa0b0[_0x5f63('0x85')](_0x4f2cce)[_0x5f63('0x85')](_0xd7df56);var _0x215f20={'count':_0x28a611['length'],'rows':_0x28a611};return _0x215f20;})[_0x5f63('0xe')](respondWithResult(_0x25b0d7,null))[_0x5f63('0x2a')](function(_0x1e84e9){var _0x413575=_0x4c5f85[_0x5f63('0x19')][_0x5f63('0xa9')]?0x1f4:_0x1e84e9[_0x5f63('0xaa')]||0x1f4;logger['error'](_0x1e84e9[_0x5f63('0x11')]);delete _0x1e84e9['name'];if(_0x413575===0x191){_0x413575=0x190;}_0x25b0d7[_0x5f63('0x5')](_0x413575)['send'](_0x4c5f85[_0x5f63('0x19')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1e84e9[_0x5f63('0xaa')]}:_0x1e84e9);});};function getSelectList(_0x31bbc1,_0xbf4a2f,_0x265e24,_0x59a913,_0x9ca6a2,_0x5626db){var _0x90a94b={'method':'GET','uri':_0x31bbc1+_0x5f63('0xab')+_0x59a913+')/Attributes('+_0x9ca6a2+_0x5f63('0xac')+_0x5f63('0xad'),'headers':{'Authorization':'Bearer\x20'+_0x5626db,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x90a94b)[_0x5f63('0xe')](function(_0x5df1c7){var _0x304c3a=[];var _0x2d9ad3=_0x5df1c7[_0x5f63('0xae')]['Options'];_0x2d9ad3['forEach'](function(_0x267fb4){_0x304c3a[_0x5f63('0xa0')]({'name':_0x267fb4[_0x5f63('0xaf')][_0x5f63('0xb0')][_0x5f63('0xaf')],'value':String(_0x267fb4['Value'])});});var _0x4f4459={'id':_0xbf4a2f+'_'+_0x5df1c7[_0x5f63('0xb1')],'name':_0x5df1c7['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x304c3a};_0x265e24[_0x5f63('0xa0')](_0x4f4459);return _0x265e24;});}function getBooleanList(_0x1c40a2,_0x4640c8,_0xd33485,_0x12c7c4,_0x3d569c,_0x589b66){var _0x3c2201={'method':_0x5f63('0xb2'),'uri':_0x1c40a2+_0x5f63('0xab')+_0x12c7c4+')/Attributes('+_0x3d569c+_0x5f63('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x589b66,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x3c2201)[_0x5f63('0xe')](function(_0x4f5bd2){var _0x5b43b9=[];_0x5b43b9[_0x5f63('0xa0')]({'name':_0x4f5bd2[_0x5f63('0xae')][_0x5f63('0xb4')][_0x5f63('0xaf')][_0x5f63('0xb0')]['Label'],'value':_0x5f63('0xb5')},{'name':_0x4f5bd2[_0x5f63('0xae')][_0x5f63('0xb6')]['Label'][_0x5f63('0xb0')][_0x5f63('0xaf')],'value':_0x5f63('0xb7')});var _0x1094a1={'id':_0x4640c8+'_'+_0x4f5bd2['LogicalName'],'name':_0x4f5bd2[_0x5f63('0xb8')]['UserLocalizedLabel'][_0x5f63('0xaf')],'custom':![],'options':_0x5b43b9};_0xd33485[_0x5f63('0xa0')](_0x1094a1);return _0xd33485;});}function getInputList(_0xddf7f1,_0x22cdbf,_0x2f5698,_0x4b4e59,_0x1f2e18,_0x235198,_0x27ee93){var _0x595310={'method':_0x5f63('0xb2'),'uri':_0xddf7f1+_0x5f63('0xab')+_0x1f2e18+_0x5f63('0xb9')+_0x235198+')/Microsoft.Dynamics.CRM.'+_0x2f5698+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5f63('0x96')+_0x27ee93,'If-None-Match':null,'OData-Version':_0x5f63('0x97')},'json':!![]};return rp(_0x595310)['then'](function(_0x4f3326){var _0x36c688={'id':_0x22cdbf+'_'+_0x4f3326[_0x5f63('0xb1')],'name':_0x4f3326['DisplayName'][_0x5f63('0xb0')]?_0x4f3326[_0x5f63('0xb8')][_0x5f63('0xb0')][_0x5f63('0xaf')]:_0x4f3326[_0x5f63('0xb1')],'custom':![],'options':[]};_0x4b4e59[_0x5f63('0xa0')](_0x36c688);return _0x4b4e59;});} \ No newline at end of file +var _0x7c80=['fieldName','type','key','map','query','filters','intersection','model','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','findAll','rows','catch','show','params','keys','fields','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','AccountId','Subjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','title','description','customerid','ownerid','subject','regardingobjectid','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','remoteUri','tenantId','modernAuthentication','CloudProvider','data5','access_token','data7','https://login.microsoftonline.com/','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','GET','EntityDefinitions(','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false','request-promise','util','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes'];(function(_0x45a630,_0x528778){var _0x506c63=function(_0x50608d){while(--_0x50608d){_0x45a630['push'](_0x45a630['shift']());}};_0x506c63(++_0x528778);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x07c8('0x0'));var util=require(_0x07c8('0x1'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x07c8('0x2'))(_0x07c8('0x3'));var db=require(_0x07c8('0x4'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x19356e,_0x750fb2){_0x750fb2=_0x750fb2||0xc8;return function(_0x2f652b){if(_0x2f652b){return _0x19356e['status'](_0x750fb2)[_0x07c8('0x5')](_0x2f652b);}};}function respondWithFilteredResult(_0x56b8ca,_0x4a5354){return function(_0x204052){if(_0x204052){var _0xc0c7bf=typeof _0x4a5354[_0x07c8('0x6')]===_0x07c8('0x7')&&typeof _0x4a5354[_0x07c8('0x8')]===_0x07c8('0x7');var _0x58ae16=_0x204052[_0x07c8('0x9')];var _0x5cc84d=_0xc0c7bf?0x0:_0x4a5354['offset'];var _0x1e1f17=_0xc0c7bf?_0x204052['count']:_0x4a5354[_0x07c8('0x6')]+_0x4a5354['limit'];var _0x48ba40;if(_0x1e1f17>=_0x58ae16){_0x1e1f17=_0x58ae16;_0x48ba40=0xc8;}else{_0x48ba40=0xce;}_0x56b8ca[_0x07c8('0xa')](_0x48ba40);return _0x56b8ca[_0x07c8('0xb')](_0x07c8('0xc'),_0x5cc84d+'-'+_0x1e1f17+'/'+_0x58ae16)[_0x07c8('0x5')](_0x204052);}return null;};}function saveUpdates(_0x5c2abf){return function(_0x338d94){if(_0x338d94){return _0x338d94[_0x07c8('0xd')](_0x5c2abf)[_0x07c8('0xe')](function(_0x2370f5){return _0x2370f5;});}return null;};}function removeEntity(_0x5d84de){return function(_0x5da90b){if(_0x5da90b){return _0x5da90b[_0x07c8('0xf')]()['then'](function(){_0x5d84de[_0x07c8('0xa')](0xcc)[_0x07c8('0x10')]();});}};}function handleEntityNotFound(_0x3d2e32){return function(_0x3997e7){if(!_0x3997e7){_0x3d2e32[_0x07c8('0x11')](0x194);}return _0x3997e7;};}function handleError(_0xb6b94b,_0x119d94){_0x119d94=_0x119d94||0x1f4;return function(_0x33a4e4){logger[_0x07c8('0x12')](_0x33a4e4[_0x07c8('0x13')]);if(_0x33a4e4[_0x07c8('0x14')]){delete _0x33a4e4[_0x07c8('0x14')];}_0xb6b94b[_0x07c8('0xa')](_0x119d94)[_0x07c8('0x15')](_0x33a4e4);};}exports[_0x07c8('0x16')]=function(_0x3a41cb,_0xcf3a78){var _0x12aeb1={},_0x53421c={},_0xf3adc7={'count':0x0,'rows':[]};var _0x4eb47b=_['map'](db['Dynamics365Account'][_0x07c8('0x17')],function(_0x270875){return{'name':_0x270875[_0x07c8('0x18')],'type':_0x270875[_0x07c8('0x19')][_0x07c8('0x1a')]};});_0x53421c['model']=_[_0x07c8('0x1b')](_0x4eb47b,_0x07c8('0x14'));_0x53421c[_0x07c8('0x1c')]=_['keys'](_0x3a41cb[_0x07c8('0x1c')]);_0x53421c[_0x07c8('0x1d')]=_[_0x07c8('0x1e')](_0x53421c[_0x07c8('0x1f')],_0x53421c[_0x07c8('0x1c')]);_0x12aeb1[_0x07c8('0x20')]=_[_0x07c8('0x1e')](_0x53421c[_0x07c8('0x1f')],qs['fields'](_0x3a41cb['query']['fields']));_0x12aeb1['attributes']=_0x12aeb1[_0x07c8('0x20')][_0x07c8('0x21')]?_0x12aeb1[_0x07c8('0x20')]:_0x53421c['model'];if(!_0x3a41cb['query']['hasOwnProperty'](_0x07c8('0x22'))){_0x12aeb1[_0x07c8('0x8')]=qs[_0x07c8('0x8')](_0x3a41cb[_0x07c8('0x1c')][_0x07c8('0x8')]);_0x12aeb1[_0x07c8('0x6')]=qs[_0x07c8('0x6')](_0x3a41cb['query'][_0x07c8('0x6')]);}_0x12aeb1['order']=qs[_0x07c8('0x23')](_0x3a41cb[_0x07c8('0x1c')]['sort']);_0x12aeb1[_0x07c8('0x24')]=qs[_0x07c8('0x1d')](_[_0x07c8('0x25')](_0x3a41cb[_0x07c8('0x1c')],_0x53421c[_0x07c8('0x1d')]),_0x4eb47b);if(_0x3a41cb[_0x07c8('0x1c')][_0x07c8('0x26')]){_0x12aeb1[_0x07c8('0x24')]=_[_0x07c8('0x27')](_0x12aeb1[_0x07c8('0x24')],{'$or':_[_0x07c8('0x1b')](_0x4eb47b,function(_0x768439){if(_0x768439[_0x07c8('0x19')]!==_0x07c8('0x28')){var _0xa6997c={};_0xa6997c[_0x768439[_0x07c8('0x14')]]={'$like':'%'+_0x3a41cb[_0x07c8('0x1c')][_0x07c8('0x26')]+'%'};return _0xa6997c;}})});}_0x12aeb1=_['merge']({},_0x12aeb1,_0x3a41cb[_0x07c8('0x29')]);var _0x1616c6={'where':_0x12aeb1['where']};return db[_0x07c8('0x2a')][_0x07c8('0x9')](_0x1616c6)[_0x07c8('0xe')](function(_0x351d6e){_0xf3adc7[_0x07c8('0x9')]=_0x351d6e;if(_0x3a41cb[_0x07c8('0x1c')][_0x07c8('0x2b')]){_0x12aeb1['include']=[{'all':!![]}];}return db[_0x07c8('0x2a')][_0x07c8('0x2c')](_0x12aeb1);})[_0x07c8('0xe')](function(_0x16e574){_0xf3adc7[_0x07c8('0x2d')]=_0x16e574;return _0xf3adc7;})[_0x07c8('0xe')](respondWithFilteredResult(_0xcf3a78,_0x12aeb1))[_0x07c8('0x2e')](handleError(_0xcf3a78,null));};exports[_0x07c8('0x2f')]=function(_0x3b92ea,_0x5c46ab){var _0x45eaea={'raw':![],'where':{'id':_0x3b92ea[_0x07c8('0x30')]['id']}},_0x2246cc={};_0x2246cc[_0x07c8('0x1f')]=_[_0x07c8('0x31')](db[_0x07c8('0x2a')][_0x07c8('0x17')]);_0x2246cc[_0x07c8('0x1c')]=_['keys'](_0x3b92ea['query']);_0x2246cc[_0x07c8('0x1d')]=_[_0x07c8('0x1e')](_0x2246cc['model'],_0x2246cc[_0x07c8('0x1c')]);_0x45eaea[_0x07c8('0x20')]=_['intersection'](_0x2246cc[_0x07c8('0x1f')],qs[_0x07c8('0x32')](_0x3b92ea[_0x07c8('0x1c')][_0x07c8('0x32')]));_0x45eaea[_0x07c8('0x20')]=_0x45eaea[_0x07c8('0x20')][_0x07c8('0x21')]?_0x45eaea[_0x07c8('0x20')]:_0x2246cc['model'];if(_0x3b92ea[_0x07c8('0x1c')]['includeAll']){_0x45eaea[_0x07c8('0x33')]=[{'all':!![]}];}_0x45eaea=_[_0x07c8('0x27')]({},_0x45eaea,_0x3b92ea[_0x07c8('0x29')]);return db[_0x07c8('0x2a')][_0x07c8('0x34')](_0x45eaea)['then'](handleEntityNotFound(_0x5c46ab,null))[_0x07c8('0xe')](respondWithResult(_0x5c46ab,null))[_0x07c8('0x2e')](handleError(_0x5c46ab,null));};exports[_0x07c8('0x35')]=function(_0x5e70da,_0x5f21a3){return db[_0x07c8('0x2a')][_0x07c8('0x35')](_0x5e70da[_0x07c8('0x36')],{})[_0x07c8('0xe')](respondWithResult(_0x5f21a3,0xc9))['catch'](handleError(_0x5f21a3,null));};exports[_0x07c8('0xd')]=function(_0x3571a2,_0xbe2795){if(_0x3571a2[_0x07c8('0x36')]['id']){delete _0x3571a2[_0x07c8('0x36')]['id'];}return db[_0x07c8('0x2a')][_0x07c8('0x34')]({'where':{'id':_0x3571a2[_0x07c8('0x30')]['id']}})['then'](handleEntityNotFound(_0xbe2795,null))['then'](saveUpdates(_0x3571a2[_0x07c8('0x36')],null))['then'](respondWithResult(_0xbe2795,null))[_0x07c8('0x2e')](handleError(_0xbe2795,null));};exports['destroy']=function(_0x1820b9,_0x5d0e04){return db['Dynamics365Account'][_0x07c8('0x34')]({'where':{'id':_0x1820b9[_0x07c8('0x30')]['id']}})[_0x07c8('0xe')](handleEntityNotFound(_0x5d0e04,null))[_0x07c8('0xe')](removeEntity(_0x5d0e04,null))[_0x07c8('0x2e')](handleError(_0x5d0e04,null));};exports[_0x07c8('0x37')]=function(_0x2c1f88,_0x11417e){var _0xd0ce72={};var _0x3dd09e={};var _0x5a5d74;var _0x5000ef;return db['Dynamics365Account'][_0x07c8('0x38')]({'where':{'id':_0x2c1f88[_0x07c8('0x30')]['id']}})[_0x07c8('0xe')](handleEntityNotFound(_0x11417e,null))[_0x07c8('0xe')](function(_0x5ea5c0){if(_0x5ea5c0){_0x5a5d74=_0x5ea5c0;_0x3dd09e[_0x07c8('0x1f')]=_['keys'](db[_0x07c8('0x39')]['rawAttributes']);_0x3dd09e[_0x07c8('0x1c')]=_[_0x07c8('0x31')](_0x2c1f88[_0x07c8('0x1c')]);_0x3dd09e[_0x07c8('0x1d')]=_[_0x07c8('0x1e')](_0x3dd09e[_0x07c8('0x1f')],_0x3dd09e[_0x07c8('0x1c')]);_0xd0ce72[_0x07c8('0x20')]=_['intersection'](_0x3dd09e[_0x07c8('0x1f')],qs['fields'](_0x2c1f88[_0x07c8('0x1c')][_0x07c8('0x32')]));_0xd0ce72[_0x07c8('0x20')]=_0xd0ce72[_0x07c8('0x20')]['length']?_0xd0ce72[_0x07c8('0x20')]:_0x3dd09e[_0x07c8('0x1f')];_0xd0ce72[_0x07c8('0x3a')]=qs['sort'](_0x2c1f88[_0x07c8('0x1c')][_0x07c8('0x23')]);_0xd0ce72[_0x07c8('0x24')]=qs['filters'](_['pick'](_0x2c1f88[_0x07c8('0x1c')],_0x3dd09e['filters']));if(_0x2c1f88['query']['filter']){_0xd0ce72[_0x07c8('0x24')]=_[_0x07c8('0x27')](_0xd0ce72['where'],{'$or':_[_0x07c8('0x1b')](_0xd0ce72['attributes'],function(_0x1c9647){var _0x5db34a={};_0x5db34a[_0x1c9647]={'$like':'%'+_0x2c1f88['query'][_0x07c8('0x26')]+'%'};return _0x5db34a;})});}_0xd0ce72=_[_0x07c8('0x27')]({},_0xd0ce72,_0x2c1f88['options']);return _0x5a5d74[_0x07c8('0x37')](_0xd0ce72);}})['then'](function(_0x115d29){if(_0x115d29){_0x5000ef=_0x115d29[_0x07c8('0x21')];if(!_0x2c1f88[_0x07c8('0x1c')][_0x07c8('0x3b')](_0x07c8('0x22'))){_0xd0ce72[_0x07c8('0x8')]=qs[_0x07c8('0x8')](_0x2c1f88[_0x07c8('0x1c')][_0x07c8('0x8')]);_0xd0ce72[_0x07c8('0x6')]=qs[_0x07c8('0x6')](_0x2c1f88[_0x07c8('0x1c')][_0x07c8('0x6')]);}return _0x5a5d74[_0x07c8('0x37')](_0xd0ce72);}})[_0x07c8('0xe')](function(_0xb1352){if(_0xb1352){return _0xb1352?{'count':_0x5000ef,'rows':_0xb1352}:null;}})[_0x07c8('0xe')](respondWithResult(_0x11417e,null))['catch'](handleError(_0x11417e,null));};exports['addConfiguration']=function(_0x1f5849,_0x52007b){if(_0x1f5849['body']['id']){delete _0x1f5849['body']['id'];}return db[_0x07c8('0x2a')][_0x07c8('0x38')]({'where':{'id':_0x1f5849['params']['id']}})[_0x07c8('0xe')](handleEntityNotFound(_0x52007b,null))[_0x07c8('0xe')](function(_0xdb52ab){if(_0xdb52ab){_0x1f5849[_0x07c8('0x36')][_0x07c8('0x3c')]=_0xdb52ab['id'];_0x1f5849[_0x07c8('0x36')][_0x07c8('0x3d')]=integrations['getSubjects'](_0x1f5849[_0x07c8('0x36')]['channel'],_0x1f5849[_0x07c8('0x36')][_0x07c8('0x19')]);_0x1f5849['body'][_0x07c8('0x3e')]=integrations[_0x07c8('0x3f')](_0x1f5849[_0x07c8('0x36')]['channel'],_0x1f5849[_0x07c8('0x36')][_0x07c8('0x19')]);return db[_0x07c8('0x39')][_0x07c8('0x35')](_0x1f5849[_0x07c8('0x36')],{'include':[{'model':db[_0x07c8('0x40')],'as':_0x07c8('0x3d')},{'model':db[_0x07c8('0x40')],'as':_0x07c8('0x3e')}]});}return null;})[_0x07c8('0xe')](respondWithResult(_0x52007b,null))[_0x07c8('0x2e')](handleError(_0x52007b,null));};function sanitizeRemoteUri(_0x4f674a){var _0x4d8ae7=_0x4f674a[_0x07c8('0x41')](-0x1);if(_0x4d8ae7==='/')return _0x4f674a[_0x07c8('0x42')](0x0,_0x4f674a[_0x07c8('0x43')](_0x4d8ae7));return _0x4f674a;}function getWebApiUrl(_0x52ee1a){return util[_0x07c8('0x44')](_0x07c8('0x45'),_0x52ee1a);}exports[_0x07c8('0x46')]=function(_0x36b127,_0x1fa8d2){var _0x4a6c60=_0x36b127[_0x07c8('0x1c')]['ticketType'];var _0x710e8=_0x4a6c60===_0x07c8('0x47')?_0x07c8('0x48'):_0x07c8('0x49');var _0x484e3d='';var _0x1823dd='';var _0x319785='';var _0x5ef2f3='';var _0x2b4c4e='';var _0x1c8d0f='';var _0x4ffc6a='';var _0xcf4d3d='';var _0x3ff57c=[_0x07c8('0x4a'),_0x07c8('0x4b'),_0x07c8('0x4c'),_0x07c8('0x4d'),'caseorigincode',_0x07c8('0x4e'),'phonenumber',_0x07c8('0x4f'),'directioncode','phonecall_activity_parties'];var _0x41812f=[_0x07c8('0x50'),'accountidyominame',_0x07c8('0x51'),_0x07c8('0x52'),_0x07c8('0x53'),'contactidyominame',_0x07c8('0x54'),_0x07c8('0x55'),_0x07c8('0x56'),_0x07c8('0x57'),_0x07c8('0x58'),_0x07c8('0x59'),_0x07c8('0x5a'),_0x07c8('0x5b'),'createdonbehalfbyyominame',_0x07c8('0x5c'),'customeridtype',_0x07c8('0x5d'),'emailaddress',_0x07c8('0x5e'),_0x07c8('0x5f'),_0x07c8('0x60'),'escalatedon',_0x07c8('0x61'),_0x07c8('0x62'),_0x07c8('0x63'),_0x07c8('0x64'),_0x07c8('0x65'),_0x07c8('0x66'),'lastonholdtime',_0x07c8('0x67'),_0x07c8('0x68'),'modifiedbyexternalpartyyominame',_0x07c8('0x69'),_0x07c8('0x6a'),_0x07c8('0x6b'),_0x07c8('0x6c'),_0x07c8('0x6d'),_0x07c8('0x6e'),_0x07c8('0x6f'),_0x07c8('0x70'),'onholdtime',_0x07c8('0x71'),_0x07c8('0x72'),_0x07c8('0x73'),'owneridyominame',_0x07c8('0x74'),'primarycontactidname',_0x07c8('0x75'),_0x07c8('0x76'),_0x07c8('0x77'),'productserialnumber',_0x07c8('0x78'),'resolvebykpiidname','responseby',_0x07c8('0x79'),_0x07c8('0x7a'),_0x07c8('0x7b'),_0x07c8('0x7c'),_0x07c8('0x7d'),'socialprofileidname',_0x07c8('0x7e'),_0x07c8('0x7f'),_0x07c8('0x80'),_0x07c8('0x81'),_0x07c8('0x82'),_0x07c8('0x83'),_0x07c8('0x84'),'utcconversiontimezonecode',_0x07c8('0x85')];var _0x3b7c68=_0x3ff57c[_0x07c8('0x86')](_0x41812f);return db[_0x07c8('0x2a')][_0x07c8('0x38')]({'where':{'id':_0x36b127[_0x07c8('0x30')]['id']},'attributes':['id',_0x07c8('0x87'),'password',_0x07c8('0x88'),_0x07c8('0x89'),'clientId','clientSecret',_0x07c8('0x8a')],'include':[{'model':db[_0x07c8('0x8b')],'as':'CloudProvider','attributes':['id',_0x07c8('0x8c'),'data7']}]})[_0x07c8('0xe')](handleEntityNotFound(_0x1fa8d2,null))[_0x07c8('0xe')](function(_0x3342da){if(_0x3342da){if(_0x3342da[_0x07c8('0x8a')]){_0x3342da[_0x07c8('0x8d')]=_0x3342da[_0x07c8('0x8b')][_0x07c8('0x8c')];_0xcf4d3d=sanitizeRemoteUri(_0x3342da[_0x07c8('0x8b')][_0x07c8('0x8e')]);_0x4ffc6a=getWebApiUrl(_0xcf4d3d);return _0x3342da;}_0xcf4d3d=sanitizeRemoteUri(_0x3342da[_0x07c8('0x88')]);_0x4ffc6a=getWebApiUrl(_0xcf4d3d);var _0x3c89c6={'method':'POST','uri':_0x07c8('0x8f')+_0x3342da[_0x07c8('0x89')]+'/oauth2/token','form':{'client_id':_0x3342da['clientId'],'resource':_0xcf4d3d,'username':_0x3342da['username'],'password':_0x3342da[_0x07c8('0x90')],'grant_type':_0x07c8('0x90'),'client_secret':_0x3342da[_0x07c8('0x91')]},'json':!![]};return rp(_0x3c89c6);}})[_0x07c8('0xe')](function(_0x545499){_0x1c8d0f=_0x545499[_0x07c8('0x8d')];var _0x592a65={'method':'GET','uri':encodeURI(_0x4ffc6a+_0x07c8('0x92')+_0x710e8+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x1c8d0f,'If-None-Match':null,'OData-Version':_0x07c8('0x93')},'json':!![]};return rp(_0x592a65);})[_0x07c8('0xe')](function(_0x3f0d1e){var _0x593c0d=_0x3f0d1e[_0x07c8('0x94')][0x0];var _0x5ae63c=_0x593c0d['MetadataId'];var _0x484e3e={'method':_0x07c8('0x95'),'uri':_0x4ffc6a+_0x07c8('0x96')+_0x5ae63c+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x07c8('0x97')+_0x1c8d0f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x484e3e);})[_0x07c8('0xe')](function(_0x408336){_0x484e3d=_0x408336;_0x1823dd=_0x484e3d[_0x07c8('0x98')];_0x1823dd=_[_0x07c8('0x99')](_0x1823dd,function(_0x4f45b0){return!_0x3b7c68[_0x07c8('0x9a')](_0x4f45b0['LogicalName']);});var _0x1829ab=[];var _0x5747b0=[];_0x1823dd[_0x07c8('0x9b')](function(_0x4888f7){if(_0x4888f7[_0x07c8('0x9c')]){var _0xede531=_0x4888f7['@odata.type'][_0x07c8('0x42')](_0x4888f7[_0x07c8('0x9c')][_0x07c8('0x43')]('.')+0x1);if(_0xede531===_0x07c8('0x9d')){_0x1829ab['push'](getSelectList(_0x4ffc6a,_0x4a6c60,_0x5747b0,_0x484e3d[_0x07c8('0x9e')],_0x4888f7['MetadataId'],_0x1c8d0f));}}});return Promise[_0x07c8('0x9f')](_0x1829ab);})['then'](function(_0x15a7e1){_0x319785=_0x15a7e1[0x0];var _0x468c17=[];var _0x3890d0=[];_0x1823dd[_0x07c8('0x9b')](function(_0x338d67){if(!_[_0x07c8('0xa0')](_0x338d67[_0x07c8('0x9c')])){var _0x5c4c0=_0x338d67['@odata.type'][_0x07c8('0x42')](_0x338d67[_0x07c8('0x9c')]['lastIndexOf']('.')+0x1);if(_0x5c4c0===_0x07c8('0xa1')){_0x468c17['push'](getBooleanList(_0x4ffc6a,_0x4a6c60,_0x3890d0,_0x484e3d[_0x07c8('0x9e')],_0x338d67[_0x07c8('0x9e')],_0x1c8d0f));}}});return Promise[_0x07c8('0x9f')](_0x468c17);})[_0x07c8('0xe')](function(_0x533c03){_0x5ef2f3=_0x533c03[0x0];var _0x2eb084=[];var _0x367a7e=[];_0x1823dd[_0x07c8('0x9b')](function(_0x4cf7d9){if(_0x4cf7d9['@odata.type']){var _0x52bf45=_0x4cf7d9[_0x07c8('0x9c')][_0x07c8('0x42')](_0x4cf7d9[_0x07c8('0x9c')][_0x07c8('0x43')]('.')+0x1);if(_0x52bf45===_0x07c8('0xa2')||_0x52bf45===_0x07c8('0xa3')||_0x52bf45===_0x07c8('0xa4')||_0x52bf45===_0x07c8('0xa5')||_0x52bf45===_0x07c8('0xa6')||_0x52bf45===_0x07c8('0xa7')||_0x52bf45===_0x07c8('0xa8')||_0x52bf45==='EntityNameAttributeMetadata'||_0x52bf45===_0x07c8('0xa9')||_0x52bf45===_0x07c8('0xaa')){_0x2eb084[_0x07c8('0xab')](getInputList(_0x4ffc6a,_0x4a6c60,_0x52bf45,_0x367a7e,_0x484e3d[_0x07c8('0x9e')],_0x4cf7d9[_0x07c8('0x9e')],_0x1c8d0f));}}});return Promise[_0x07c8('0x9f')](_0x2eb084);})[_0x07c8('0xe')](function(_0x139e5c){_0x2b4c4e=_0x139e5c[0x0];var _0x5b36d8=_0x319785[_0x07c8('0x86')](_0x5ef2f3)[_0x07c8('0x86')](_0x2b4c4e);var _0x28dadc={'count':_0x5b36d8[_0x07c8('0x21')],'rows':_0x5b36d8};return _0x28dadc;})['then'](respondWithResult(_0x1fa8d2,null))[_0x07c8('0x2e')](function(_0x56e022){var _0x4c9d14=_0x36b127[_0x07c8('0x1c')][_0x07c8('0xac')]?0x1f4:_0x56e022['statusCode']||0x1f4;logger[_0x07c8('0x12')](_0x56e022[_0x07c8('0x13')]);delete _0x56e022[_0x07c8('0x14')];if(_0x4c9d14===0x191){_0x4c9d14=0x190;}_0x1fa8d2[_0x07c8('0xa')](_0x4c9d14)['send'](_0x36b127[_0x07c8('0x1c')][_0x07c8('0xac')]?{'message':_0x07c8('0xad'),'statusCode':_0x56e022[_0x07c8('0xae')]}:_0x56e022);});};function getSelectList(_0x524e27,_0xcc0edc,_0x493968,_0x50d965,_0x5891bc,_0x2ce952){var _0x347f68={'method':_0x07c8('0x95'),'uri':_0x524e27+_0x07c8('0x96')+_0x50d965+_0x07c8('0xaf')+_0x5891bc+_0x07c8('0xb0')+_0x07c8('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x2ce952,'If-None-Match':null,'OData-Version':_0x07c8('0x93')},'json':!![]};return rp(_0x347f68)['then'](function(_0x589ac3){var _0x2aa164=[];var _0x4c06dd=_0x589ac3[_0x07c8('0xb2')][_0x07c8('0xb3')];_0x4c06dd['forEach'](function(_0x1930b3){_0x2aa164[_0x07c8('0xab')]({'name':_0x1930b3[_0x07c8('0xb4')][_0x07c8('0xb5')]['Label'],'value':String(_0x1930b3[_0x07c8('0xb6')])});});var _0xf8fb7b={'id':_0xcc0edc+'_'+_0x589ac3[_0x07c8('0xb7')],'name':_0x589ac3[_0x07c8('0xb8')][_0x07c8('0xb5')][_0x07c8('0xb4')],'custom':![],'options':_0x2aa164};_0x493968[_0x07c8('0xab')](_0xf8fb7b);return _0x493968;});}function getBooleanList(_0x57c1d8,_0x3ec7f4,_0x30a748,_0x5486d2,_0x50eedd,_0x13ddc1){var _0x366b49={'method':'GET','uri':_0x57c1d8+_0x07c8('0x96')+_0x5486d2+_0x07c8('0xaf')+_0x50eedd+_0x07c8('0xb9'),'headers':{'Authorization':_0x07c8('0x97')+_0x13ddc1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x366b49)[_0x07c8('0xe')](function(_0x1dd977){var _0xa9cc9=[];_0xa9cc9[_0x07c8('0xab')]({'name':_0x1dd977['OptionSet'][_0x07c8('0xba')][_0x07c8('0xb4')][_0x07c8('0xb5')][_0x07c8('0xb4')],'value':'true'},{'name':_0x1dd977[_0x07c8('0xb2')]['FalseOption'][_0x07c8('0xb4')][_0x07c8('0xb5')][_0x07c8('0xb4')],'value':_0x07c8('0xbb')});var _0x28c943={'id':_0x3ec7f4+'_'+_0x1dd977['LogicalName'],'name':_0x1dd977[_0x07c8('0xb8')][_0x07c8('0xb5')][_0x07c8('0xb4')],'custom':![],'options':_0xa9cc9};_0x30a748[_0x07c8('0xab')](_0x28c943);return _0x30a748;});}function getInputList(_0x3412d3,_0x1d06c4,_0x1939ed,_0x57e723,_0x22f21c,_0x3e48d,_0x51837a){var _0x84eabb={'method':_0x07c8('0x95'),'uri':_0x3412d3+'EntityDefinitions('+_0x22f21c+_0x07c8('0xaf')+_0x3e48d+')/Microsoft.Dynamics.CRM.'+_0x1939ed+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x07c8('0x97')+_0x51837a,'If-None-Match':null,'OData-Version':_0x07c8('0x93')},'json':!![]};return rp(_0x84eabb)[_0x07c8('0xe')](function(_0x4fd29f){var _0x3768cb={'id':_0x1d06c4+'_'+_0x4fd29f[_0x07c8('0xb7')],'name':_0x4fd29f['DisplayName'][_0x07c8('0xb5')]?_0x4fd29f['DisplayName'][_0x07c8('0xb5')]['Label']:_0x4fd29f[_0x07c8('0xb7')],'custom':![],'options':[]};_0x57e723[_0x07c8('0xab')](_0x3768cb);return _0x57e723;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f876cb4..1694111 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x581502,_0xbe9358){var _0x35277e=function(_0x1446b2){while(--_0x1446b2){_0x581502['push'](_0x581502['shift']());}};_0x35277e(++_0xbe9358);}(_0x757a,0xde));var _0xa757=function(_0x1e31f0,_0x53b362){_0x1e31f0=_0x1e31f0-0x0;var _0x22cad4=_0x757a[_0x1e31f0];return _0x22cad4;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3bcf81,_0x3b5b89){var _0x1f264f=function(_0x12cc21){while(--_0x12cc21){_0x3bcf81['push'](_0x3bcf81['shift']());}};_0x1f264f(++_0x3b5b89);}(_0x757a,0xde));var _0xa757=function(_0x242bac,_0x479c2e){_0x242bac=_0x242bac-0x0;var _0xaa31a1=_0x757a[_0x242bac];return _0xaa31a1;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index a203790..06df742 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 _0x02e6=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','include','map','attributes','model','ShowDynamics365Account','raw','lodash'];(function(_0x2bd440,_0xfb5a9d){var _0x58f325=function(_0x19847f){while(--_0x19847f){_0x2bd440['push'](_0x2bd440['shift']());}};_0x58f325(++_0xfb5a9d);}(_0x02e6,0xa9));var _0x602e=function(_0x1d505a,_0x1d6144){_0x1d505a=_0x1d505a-0x0;var _0xe10353=_0x02e6[_0x1d505a];return _0xe10353;};'use strict';var _=require(_0x602e('0x0'));var util=require('util');var moment=require(_0x602e('0x1'));var BPromise=require('bluebird');var rs=require(_0x602e('0x2'));var fs=require('fs');var Redis=require(_0x602e('0x3'));var db=require(_0x602e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x602e('0x5'))(_0x602e('0x6'));var config=require(_0x602e('0x7'));var jayson=require(_0x602e('0x8'));var client=jayson[_0x602e('0x9')][_0x602e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dd22c,_0x336a64,_0x3e3092){return new BPromise(function(_0x17670c,_0x186d71){return client[_0x602e('0xb')](_0x1dd22c,_0x3e3092)[_0x602e('0xc')](function(_0x2b5eda){logger[_0x602e('0xd')](_0x602e('0xe'),_0x336a64,'request\x20sent');logger[_0x602e('0xf')](_0x602e('0x10'),_0x336a64,'request\x20sent',JSON[_0x602e('0x11')](_0x2b5eda));if(_0x2b5eda[_0x602e('0x12')]){if(_0x2b5eda[_0x602e('0x12')][_0x602e('0x13')]===0x1f4){logger['error'](_0x602e('0xe'),_0x336a64,_0x2b5eda[_0x602e('0x12')]['message']);return _0x186d71(_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);}logger[_0x602e('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x336a64,_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);return _0x17670c(_0x2b5eda[_0x602e('0x12')][_0x602e('0x14')]);}else{logger[_0x602e('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x336a64,_0x602e('0x15'));_0x17670c(_0x2b5eda['result']['message']);}})[_0x602e('0x16')](function(_0xd1b796){logger[_0x602e('0x12')](_0x602e('0xe'),_0x336a64,_0xd1b796);_0x186d71(_0xd1b796);});});}exports[_0x602e('0x17')]=function(_0xcda370){var _0x3d58a2=this;return new Promise(function(_0xdf1ba,_0x36ab6e){return db[_0x602e('0x18')][_0x602e('0x19')]({'raw':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')][_0x602e('0x1b')]||null:null,'attributes':_0xcda370['options']?_0xcda370[_0x602e('0x1a')]['attributes']||null:null,'limit':_0xcda370[_0x602e('0x1a')]?_0xcda370[_0x602e('0x1a')]['limit']||null:null,'include':_0xcda370[_0x602e('0x1a')]?_0xcda370['options'][_0x602e('0x1c')]?_[_0x602e('0x1d')](_0xcda370[_0x602e('0x1a')][_0x602e('0x1c')],function(_0x4547b1){return{'model':db[_0x4547b1['model']],'as':_0x4547b1['as'],'attributes':_0x4547b1[_0x602e('0x1e')],'include':_0x4547b1[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x4547b1[_0x602e('0x1c')],function(_0x5bb993){return{'model':db[_0x5bb993[_0x602e('0x1f')]],'as':_0x5bb993['as'],'attributes':_0x5bb993[_0x602e('0x1e')],'include':_0x5bb993[_0x602e('0x1c')]?_['map'](_0x5bb993[_0x602e('0x1c')],function(_0x52247e){return{'model':db[_0x52247e[_0x602e('0x1f')]],'as':_0x52247e['as'],'attributes':_0x52247e[_0x602e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x602e('0xc')](function(_0x4de926){logger[_0x602e('0xd')](_0x602e('0x17'),_0xcda370);logger[_0x602e('0xf')](_0x602e('0x17'),_0xcda370,JSON[_0x602e('0x11')](_0x4de926));_0xdf1ba(_0x4de926);})['catch'](function(_0x12716b){logger['error'](_0x602e('0x17'),_0x12716b[_0x602e('0x14')],_0xcda370);_0x36ab6e(_0x3d58a2[_0x602e('0x12')](0x1f4,_0x12716b[_0x602e('0x14')]));});});};exports[_0x602e('0x20')]=function(_0x12b906){var _0x19f918=this;return new Promise(function(_0x39a0a8,_0x487e80){return db[_0x602e('0x18')]['find']({'raw':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x21')]===undefined?!![]:![]:!![],'where':_0x12b906['options']?_0x12b906[_0x602e('0x1a')][_0x602e('0x1b')]||null:null,'attributes':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x1e')]||null:null,'include':_0x12b906[_0x602e('0x1a')]?_0x12b906[_0x602e('0x1a')][_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x12b906[_0x602e('0x1a')][_0x602e('0x1c')],function(_0x531296){return{'model':db[_0x531296['model']],'as':_0x531296['as'],'attributes':_0x531296[_0x602e('0x1e')],'include':_0x531296[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x531296[_0x602e('0x1c')],function(_0x2285c5){return{'model':db[_0x2285c5[_0x602e('0x1f')]],'as':_0x2285c5['as'],'attributes':_0x2285c5[_0x602e('0x1e')],'include':_0x2285c5[_0x602e('0x1c')]?_[_0x602e('0x1d')](_0x2285c5[_0x602e('0x1c')],function(_0x35dbbf){return{'model':db[_0x35dbbf[_0x602e('0x1f')]],'as':_0x35dbbf['as'],'attributes':_0x35dbbf[_0x602e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x602e('0xc')](function(_0x40d0a4){logger['info'](_0x602e('0x20'),_0x12b906);logger[_0x602e('0xf')](_0x602e('0x20'),_0x12b906,JSON[_0x602e('0x11')](_0x40d0a4));_0x39a0a8(_0x40d0a4);})[_0x602e('0x16')](function(_0x162d2b){logger[_0x602e('0x12')](_0x602e('0x20'),_0x162d2b[_0x602e('0x14')],_0x12b906);_0x487e80(_0x19f918[_0x602e('0x12')](0x1f4,_0x162d2b['message']));});});}; \ No newline at end of file +var _0x472d=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','findAll','raw','where','options','attributes','limit','include','map','model','then','GetDynamics365Account','ShowDynamics365Account','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x349b79,_0x1e2422){var _0xf8b502=function(_0xcf96e2){while(--_0xcf96e2){_0x349b79['push'](_0x349b79['shift']());}};_0xf8b502(++_0x1e2422);}(_0x472d,0xaf));var _0xd472=function(_0x55bab6,_0x51faf6){_0x55bab6=_0x55bab6-0x0;var _0x102dd0=_0x472d[_0x55bab6];return _0x102dd0;};'use strict';var _=require(_0xd472('0x0'));var util=require('util');var moment=require(_0xd472('0x1'));var BPromise=require(_0xd472('0x2'));var rs=require(_0xd472('0x3'));var fs=require('fs');var Redis=require(_0xd472('0x4'));var db=require(_0xd472('0x5'))['db'];var utils=require(_0xd472('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd472('0x7'));var jayson=require(_0xd472('0x8'));var client=jayson[_0xd472('0x9')][_0xd472('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x536d67,_0x453550,_0x26f9b0){return new BPromise(function(_0x1e4c44,_0x2bd816){return client[_0xd472('0xb')](_0x536d67,_0x26f9b0)['then'](function(_0x23d650){logger[_0xd472('0xc')](_0xd472('0xd'),_0x453550,_0xd472('0xe'));logger[_0xd472('0xf')](_0xd472('0x10'),_0x453550,_0xd472('0xe'),JSON[_0xd472('0x11')](_0x23d650));if(_0x23d650[_0xd472('0x12')]){if(_0x23d650[_0xd472('0x12')][_0xd472('0x13')]===0x1f4){logger['error'](_0xd472('0xd'),_0x453550,_0x23d650['error'][_0xd472('0x14')]);return _0x2bd816(_0x23d650[_0xd472('0x12')][_0xd472('0x14')]);}logger['error'](_0xd472('0xd'),_0x453550,_0x23d650['error'][_0xd472('0x14')]);return _0x1e4c44(_0x23d650[_0xd472('0x12')]['message']);}else{logger['info'](_0xd472('0xd'),_0x453550,_0xd472('0xe'));_0x1e4c44(_0x23d650[_0xd472('0x15')][_0xd472('0x14')]);}})['catch'](function(_0x3b23e9){logger[_0xd472('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x453550,_0x3b23e9);_0x2bd816(_0x3b23e9);});});}exports['GetDynamics365Account']=function(_0x4e10c8){var _0x110eff=this;return new Promise(function(_0x15884f,_0x17076a){return db[_0xd472('0x16')][_0xd472('0x17')]({'raw':_0x4e10c8['options']?_0x4e10c8['options'][_0xd472('0x18')]===undefined?!![]:![]:!![],'where':_0x4e10c8['options']?_0x4e10c8['options'][_0xd472('0x19')]||null:null,'attributes':_0x4e10c8['options']?_0x4e10c8[_0xd472('0x1a')][_0xd472('0x1b')]||null:null,'limit':_0x4e10c8[_0xd472('0x1a')]?_0x4e10c8[_0xd472('0x1a')][_0xd472('0x1c')]||null:null,'include':_0x4e10c8[_0xd472('0x1a')]?_0x4e10c8[_0xd472('0x1a')][_0xd472('0x1d')]?_[_0xd472('0x1e')](_0x4e10c8[_0xd472('0x1a')][_0xd472('0x1d')],function(_0x16c0ae){return{'model':db[_0x16c0ae['model']],'as':_0x16c0ae['as'],'attributes':_0x16c0ae[_0xd472('0x1b')],'include':_0x16c0ae[_0xd472('0x1d')]?_[_0xd472('0x1e')](_0x16c0ae[_0xd472('0x1d')],function(_0x5a46ef){return{'model':db[_0x5a46ef[_0xd472('0x1f')]],'as':_0x5a46ef['as'],'attributes':_0x5a46ef[_0xd472('0x1b')],'include':_0x5a46ef[_0xd472('0x1d')]?_['map'](_0x5a46ef[_0xd472('0x1d')],function(_0x1840d8){return{'model':db[_0x1840d8['model']],'as':_0x1840d8['as'],'attributes':_0x1840d8[_0xd472('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd472('0x20')](function(_0x490b26){logger[_0xd472('0xc')](_0xd472('0x21'),_0x4e10c8);logger[_0xd472('0xf')](_0xd472('0x21'),_0x4e10c8,JSON['stringify'](_0x490b26));_0x15884f(_0x490b26);})['catch'](function(_0x57b222){logger[_0xd472('0x12')](_0xd472('0x21'),_0x57b222[_0xd472('0x14')],_0x4e10c8);_0x17076a(_0x110eff[_0xd472('0x12')](0x1f4,_0x57b222[_0xd472('0x14')]));});});};exports[_0xd472('0x22')]=function(_0x131d0d){var _0x4eabba=this;return new Promise(function(_0x1e85de,_0x464e29){return db[_0xd472('0x16')]['find']({'raw':_0x131d0d[_0xd472('0x1a')]?_0x131d0d[_0xd472('0x1a')][_0xd472('0x18')]===undefined?!![]:![]:!![],'where':_0x131d0d[_0xd472('0x1a')]?_0x131d0d['options'][_0xd472('0x19')]||null:null,'attributes':_0x131d0d[_0xd472('0x1a')]?_0x131d0d[_0xd472('0x1a')][_0xd472('0x1b')]||null:null,'include':_0x131d0d[_0xd472('0x1a')]?_0x131d0d['options'][_0xd472('0x1d')]?_['map'](_0x131d0d['options'][_0xd472('0x1d')],function(_0x5ca325){return{'model':db[_0x5ca325[_0xd472('0x1f')]],'as':_0x5ca325['as'],'attributes':_0x5ca325[_0xd472('0x1b')],'include':_0x5ca325['include']?_[_0xd472('0x1e')](_0x5ca325['include'],function(_0x3104aa){return{'model':db[_0x3104aa[_0xd472('0x1f')]],'as':_0x3104aa['as'],'attributes':_0x3104aa['attributes'],'include':_0x3104aa[_0xd472('0x1d')]?_[_0xd472('0x1e')](_0x3104aa[_0xd472('0x1d')],function(_0xfecb0c){return{'model':db[_0xfecb0c[_0xd472('0x1f')]],'as':_0xfecb0c['as'],'attributes':_0xfecb0c[_0xd472('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd472('0x20')](function(_0x53a3ae){logger[_0xd472('0xc')](_0xd472('0x22'),_0x131d0d);logger[_0xd472('0xf')]('ShowDynamics365Account',_0x131d0d,JSON[_0xd472('0x11')](_0x53a3ae));_0x1e85de(_0x53a3ae);})[_0xd472('0x23')](function(_0x4f5929){logger[_0xd472('0x12')](_0xd472('0x22'),_0x4f5929[_0xd472('0x14')],_0x131d0d);_0x464e29(_0x4eabba[_0xd472('0x12')](0x1f4,_0x4f5929[_0xd472('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index bdf850f..4ba2ba8 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 _0x96bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','getDescriptions','put','update','exports','util','path','connect-timeout','express'];(function(_0x197d72,_0x19b07b){var _0x1e3507=function(_0x34e0b6){while(--_0x34e0b6){_0x197d72['push'](_0x197d72['shift']());}};_0x1e3507(++_0x19b07b);}(_0x96bb,0x9c));var _0xb96b=function(_0x27d66e,_0x1eeff6){_0x27d66e=_0x27d66e-0x0;var _0x2f7081=_0x96bb[_0x27d66e];return _0x2f7081;};'use strict';var multer=require('multer');var util=require(_0xb96b('0x0'));var path=require(_0xb96b('0x1'));var timeout=require(_0xb96b('0x2'));var express=require(_0xb96b('0x3'));var router=express[_0xb96b('0x4')]();var fs_extra=require(_0xb96b('0x5'));var auth=require(_0xb96b('0x6'));var interaction=require(_0xb96b('0x7'));var config=require(_0xb96b('0x8'));var controller=require(_0xb96b('0x9'));router[_0xb96b('0xa')]('/',auth[_0xb96b('0xb')](),controller['index']);router['get'](_0xb96b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb96b('0xa')](_0xb96b('0xd'),auth[_0xb96b('0xb')](),controller[_0xb96b('0xe')]);router[_0xb96b('0xa')]('/:id/subjects',auth[_0xb96b('0xb')](),controller[_0xb96b('0xf')]);router['get']('/:id/descriptions',auth[_0xb96b('0xb')](),controller[_0xb96b('0x10')]);router['post']('/',auth[_0xb96b('0xb')](),controller['create']);router[_0xb96b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb96b('0x12')]);router['delete'](_0xb96b('0xc'),auth[_0xb96b('0xb')](),controller['destroy']);module[_0xb96b('0x13')]=router; \ No newline at end of file +var _0xce2f=['../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getDescriptions','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4673bb,_0x8ce21f){var _0xe3b0a5=function(_0x2a0cfc){while(--_0x2a0cfc){_0x4673bb['push'](_0x4673bb['shift']());}};_0xe3b0a5(++_0x8ce21f);}(_0xce2f,0x18a));var _0xfce2=function(_0x2d8d19,_0x752d4e){_0x2d8d19=_0x2d8d19-0x0;var _0x1ac5fa=_0xce2f[_0x2d8d19];return _0x1ac5fa;};'use strict';var multer=require('multer');var util=require(_0xfce2('0x0'));var path=require(_0xfce2('0x1'));var timeout=require(_0xfce2('0x2'));var express=require(_0xfce2('0x3'));var router=express[_0xfce2('0x4')]();var fs_extra=require(_0xfce2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfce2('0x6'));var config=require('../../config/environment');var controller=require(_0xfce2('0x7'));router['get']('/',auth[_0xfce2('0x8')](),controller[_0xfce2('0x9')]);router[_0xfce2('0xa')](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0xc')]);router[_0xfce2('0xa')](_0xfce2('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xfce2('0xa')]('/:id/subjects',auth[_0xfce2('0x8')](),controller['getSubjects']);router[_0xfce2('0xa')]('/:id/descriptions',auth[_0xfce2('0x8')](),controller[_0xfce2('0xe')]);router[_0xfce2('0xf')]('/',auth['isAuthenticated'](),controller[_0xfce2('0x10')]);router['put'](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0x11')]);router[_0xfce2('0x12')](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 0237cbe..aeda75f 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 _0x615e=['phonecall','nothing','contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x615e,0xb8));var _0xe615=function(_0x263676,_0x55bc00){_0x263676=_0x263676-0x0;var _0x16e3c3=_0x615e[_0x263676];return _0x16e3c3;};'use strict';var Sequelize=require(_0xe615('0x0'));module[_0xe615('0x1')]={'name':{'type':Sequelize[_0xe615('0x2')]},'description':{'type':Sequelize[_0xe615('0x2')]},'ticketType':{'type':Sequelize[_0xe615('0x3')](_0xe615('0x4'),_0xe615('0x5')),'defaultValue':_0xe615('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xe615('0x6')),'defaultValue':_0xe615('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe615('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd06f=['ENUM','incident','phonecall','contact','nothing','sequelize','exports','STRING'];(function(_0x4fa5c0,_0x4b743b){var _0x200c41=function(_0x443cea){while(--_0x443cea){_0x4fa5c0['push'](_0x4fa5c0['shift']());}};_0x200c41(++_0x4b743b);}(_0xd06f,0x16d));var _0xfd06=function(_0x3d7fa1,_0x340c0e){_0x3d7fa1=_0x3d7fa1-0x0;var _0x4f5e46=_0xd06f[_0x3d7fa1];return _0x4f5e46;};'use strict';var Sequelize=require(_0xfd06('0x0'));module[_0xfd06('0x1')]={'name':{'type':Sequelize[_0xfd06('0x2')]},'description':{'type':Sequelize[_0xfd06('0x2')]},'ticketType':{'type':Sequelize[_0xfd06('0x3')](_0xfd06('0x4'),_0xfd06('0x5')),'defaultValue':_0xfd06('0x4')},'moduleCreate':{'type':Sequelize[_0xfd06('0x3')](_0xfd06('0x6'),_0xfd06('0x7')),'defaultValue':_0xfd06('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xfd06('0x2')],'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 e35d715..4359785 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 _0xa079=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','options','create','body','catch','find','getFields','getSubjects','findOne','Dynamics365Field','rawAttributes','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x188495,_0x58eedf){var _0x874b0a=function(_0xa900b1){while(--_0xa900b1){_0x188495['push'](_0x188495['shift']());}};_0x874b0a(++_0x58eedf);}(_0xa079,0x88));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a07('0x0'));var zipdir=require(_0x9a07('0x1'));var jsonpatch=require(_0x9a07('0x2'));var rp=require(_0x9a07('0x3'));var moment=require(_0x9a07('0x4'));var BPromise=require(_0x9a07('0x5'));var Mustache=require(_0x9a07('0x6'));var util=require(_0x9a07('0x7'));var path=require(_0x9a07('0x8'));var sox=require('sox');var csv=require(_0x9a07('0x9'));var ejs=require(_0x9a07('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a07('0xb'));var squel=require('squel');var crypto=require(_0x9a07('0xc'));var jsforce=require(_0x9a07('0xd'));var deskjs=require(_0x9a07('0xe'));var toCsv=require(_0x9a07('0x9'));var querystring=require(_0x9a07('0xf'));var Papa=require(_0x9a07('0x10'));var Redis=require(_0x9a07('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a07('0x12'));var as=require(_0x9a07('0x13'));var hardwareService=require(_0x9a07('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9a07('0x15'));var config=require(_0x9a07('0x16'));var licenseUtil=require(_0x9a07('0x17'));var db=require(_0x9a07('0x18'))['db'];function respondWithStatusCode(_0x43720c,_0x47dd06){_0x47dd06=_0x47dd06||0xcc;return function(_0xc4e7ec){if(_0xc4e7ec){return _0x43720c[_0x9a07('0x19')](_0x47dd06);}return _0x43720c[_0x9a07('0x1a')](_0x47dd06)[_0x9a07('0x1b')]();};}function respondWithResult(_0x4e0757,_0x1de35e){_0x1de35e=_0x1de35e||0xc8;return function(_0x893d9e){if(_0x893d9e){return _0x4e0757[_0x9a07('0x1a')](_0x1de35e)[_0x9a07('0x1c')](_0x893d9e);}};}function respondWithFilteredResult(_0x155c15,_0x21cf0d){return function(_0x196e87){if(_0x196e87){var _0x4d342f=typeof _0x21cf0d[_0x9a07('0x1d')]===_0x9a07('0x1e')&&typeof _0x21cf0d[_0x9a07('0x1f')]===_0x9a07('0x1e');var _0x1b54ed=_0x196e87[_0x9a07('0x20')];var _0x3113a5=_0x4d342f?0x0:_0x21cf0d[_0x9a07('0x1d')];var _0xd680fb=_0x4d342f?_0x196e87[_0x9a07('0x20')]:_0x21cf0d[_0x9a07('0x1d')]+_0x21cf0d[_0x9a07('0x1f')];var _0x584c30;if(_0xd680fb>=_0x1b54ed){_0xd680fb=_0x1b54ed;_0x584c30=0xc8;}else{_0x584c30=0xce;}_0x155c15[_0x9a07('0x1a')](_0x584c30);return _0x155c15['set'](_0x9a07('0x21'),_0x3113a5+'-'+_0xd680fb+'/'+_0x1b54ed)[_0x9a07('0x1c')](_0x196e87);}return null;};}function patchUpdates(_0x3f366f){return function(_0x12b2f6){try{jsonpatch[_0x9a07('0x22')](_0x12b2f6,_0x3f366f,!![]);}catch(_0x2416a1){return BPromise[_0x9a07('0x23')](_0x2416a1);}return _0x12b2f6[_0x9a07('0x24')]();};}function saveUpdates(_0x394193,_0x4b8d61){return function(_0x328112){if(_0x328112){return _0x328112[_0x9a07('0x25')](_0x394193)[_0x9a07('0x26')](function(_0x57b3e4){return _0x57b3e4;});}return null;};}function removeEntity(_0x505bde,_0x633d7f){return function(_0x55c290){if(_0x55c290){return _0x55c290[_0x9a07('0x27')]()[_0x9a07('0x26')](function(){_0x505bde['status'](0xcc)[_0x9a07('0x1b')]();});}};}function handleEntityNotFound(_0x4a1b39,_0x3cf647){return function(_0x53d93b){if(!_0x53d93b){_0x4a1b39[_0x9a07('0x19')](0x194);}return _0x53d93b;};}function handleError(_0x58d62b,_0x206ac9){_0x206ac9=_0x206ac9||0x1f4;return function(_0x4c8b57){logger[_0x9a07('0x28')](_0x4c8b57[_0x9a07('0x29')]);if(_0x4c8b57[_0x9a07('0x2a')]){delete _0x4c8b57[_0x9a07('0x2a')];}_0x58d62b[_0x9a07('0x1a')](_0x206ac9)[_0x9a07('0x2b')](_0x4c8b57);};}exports[_0x9a07('0x2c')]=function(_0x2d741a,_0x42b2aa){var _0x54c12d={},_0x21c7be={},_0x22fe29={'count':0x0,'rows':[]};var _0x17e766=_[_0x9a07('0x2d')](db[_0x9a07('0x2e')]['rawAttributes'],function(_0x111512){return{'name':_0x111512[_0x9a07('0x2f')],'type':_0x111512[_0x9a07('0x30')][_0x9a07('0x31')]};});_0x21c7be[_0x9a07('0x32')]=_[_0x9a07('0x2d')](_0x17e766,_0x9a07('0x2a'));_0x21c7be[_0x9a07('0x33')]=_[_0x9a07('0x34')](_0x2d741a[_0x9a07('0x33')]);_0x21c7be[_0x9a07('0x35')]=_['intersection'](_0x21c7be[_0x9a07('0x32')],_0x21c7be['query']);_0x54c12d[_0x9a07('0x36')]=_[_0x9a07('0x37')](_0x21c7be[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x2d741a[_0x9a07('0x33')]['fields']));_0x54c12d[_0x9a07('0x36')]=_0x54c12d[_0x9a07('0x36')][_0x9a07('0x39')]?_0x54c12d[_0x9a07('0x36')]:_0x21c7be[_0x9a07('0x32')];if(!_0x2d741a[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x54c12d['limit']=qs[_0x9a07('0x1f')](_0x2d741a[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x54c12d[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x2d741a['query'][_0x9a07('0x1d')]);}_0x54c12d[_0x9a07('0x3c')]=qs['sort'](_0x2d741a['query'][_0x9a07('0x3d')]);_0x54c12d[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_[_0x9a07('0x3f')](_0x2d741a[_0x9a07('0x33')],_0x21c7be[_0x9a07('0x35')]),_0x17e766);if(_0x2d741a[_0x9a07('0x33')][_0x9a07('0x40')]){_0x54c12d[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x54c12d[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x17e766,function(_0xd43b10){if(_0xd43b10['type']!==_0x9a07('0x42')){var _0x257018={};_0x257018[_0xd43b10['name']]={'$like':'%'+_0x2d741a['query'][_0x9a07('0x40')]+'%'};return _0x257018;}})});}_0x54c12d=_[_0x9a07('0x41')]({},_0x54c12d,_0x2d741a['options']);var _0xd6f0df={'where':_0x54c12d[_0x9a07('0x3e')]};return db[_0x9a07('0x2e')][_0x9a07('0x20')](_0xd6f0df)[_0x9a07('0x26')](function(_0xe485f2){_0x22fe29[_0x9a07('0x20')]=_0xe485f2;if(_0x2d741a[_0x9a07('0x33')][_0x9a07('0x43')]){_0x54c12d[_0x9a07('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x54c12d);})[_0x9a07('0x26')](function(_0x42d6bf){_0x22fe29['rows']=_0x42d6bf;return _0x22fe29;})['then'](respondWithFilteredResult(_0x42b2aa,_0x54c12d))['catch'](handleError(_0x42b2aa,null));};exports[_0x9a07('0x45')]=function(_0x24e47f,_0x2b97b2){var _0x38b813={'raw':![],'where':{'id':_0x24e47f[_0x9a07('0x46')]['id']}},_0x40f049={};_0x40f049['model']=_[_0x9a07('0x34')](db[_0x9a07('0x2e')]['rawAttributes']);_0x40f049['query']=_['keys'](_0x24e47f[_0x9a07('0x33')]);_0x40f049[_0x9a07('0x35')]=_['intersection'](_0x40f049[_0x9a07('0x32')],_0x40f049[_0x9a07('0x33')]);_0x38b813[_0x9a07('0x36')]=_[_0x9a07('0x37')](_0x40f049[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x24e47f['query'][_0x9a07('0x38')]));_0x38b813[_0x9a07('0x36')]=_0x38b813[_0x9a07('0x36')]['length']?_0x38b813[_0x9a07('0x36')]:_0x40f049[_0x9a07('0x32')];if(_0x24e47f[_0x9a07('0x33')]['includeAll']){_0x38b813[_0x9a07('0x44')]=[{'all':!![]}];}_0x38b813=_[_0x9a07('0x41')]({},_0x38b813,_0x24e47f[_0x9a07('0x47')]);return db[_0x9a07('0x2e')]['find'](_0x38b813)[_0x9a07('0x26')](handleEntityNotFound(_0x2b97b2,null))[_0x9a07('0x26')](respondWithResult(_0x2b97b2,null))['catch'](handleError(_0x2b97b2,null));};exports[_0x9a07('0x48')]=function(_0x159993,_0x44f3e8){return db['Dynamics365Configuration'][_0x9a07('0x48')](_0x159993[_0x9a07('0x49')],{})['then'](respondWithResult(_0x44f3e8,0xc9))[_0x9a07('0x4a')](handleError(_0x44f3e8,null));};exports['update']=function(_0x344894,_0x42a1ae){if(_0x344894[_0x9a07('0x49')]['id']){delete _0x344894[_0x9a07('0x49')]['id'];}return db[_0x9a07('0x2e')][_0x9a07('0x4b')]({'where':{'id':_0x344894[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x42a1ae,null))[_0x9a07('0x26')](saveUpdates(_0x344894['body'],null))[_0x9a07('0x26')](respondWithResult(_0x42a1ae,null))['catch'](handleError(_0x42a1ae,null));};exports['destroy']=function(_0x44a2e7,_0x2586bb){return db[_0x9a07('0x2e')][_0x9a07('0x4b')]({'where':{'id':_0x44a2e7[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x2586bb,null))[_0x9a07('0x26')](removeEntity(_0x2586bb,null))['catch'](handleError(_0x2586bb,null));};exports[_0x9a07('0x4c')]=function(_0x26240a,_0x268731,_0x2ea25c){var _0x3fa7c9={};var _0x2223ae={};var _0x4574ed;var _0x4c2b35;return db[_0x9a07('0x2e')]['findOne']({'where':{'id':_0x26240a[_0x9a07('0x46')]['id']}})[_0x9a07('0x26')](handleEntityNotFound(_0x268731,null))[_0x9a07('0x26')](function(_0x4abdf1){if(_0x4abdf1){_0x4574ed=_0x4abdf1;_0x2223ae[_0x9a07('0x32')]=_[_0x9a07('0x34')](db['Dynamics365Field']['rawAttributes']);_0x2223ae['query']=_[_0x9a07('0x34')](_0x26240a[_0x9a07('0x33')]);_0x2223ae[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0x2223ae['model'],_0x2223ae[_0x9a07('0x33')]);_0x3fa7c9['attributes']=_[_0x9a07('0x37')](_0x2223ae[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x26240a[_0x9a07('0x33')][_0x9a07('0x38')]));_0x3fa7c9['attributes']=_0x3fa7c9[_0x9a07('0x36')][_0x9a07('0x39')]?_0x3fa7c9[_0x9a07('0x36')]:_0x2223ae[_0x9a07('0x32')];_0x3fa7c9[_0x9a07('0x3c')]=qs['sort'](_0x26240a[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x3fa7c9[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_['pick'](_0x26240a[_0x9a07('0x33')],_0x2223ae[_0x9a07('0x35')]));if(_0x26240a[_0x9a07('0x33')][_0x9a07('0x40')]){_0x3fa7c9[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x3fa7c9['where'],{'$or':_[_0x9a07('0x2d')](_0x3fa7c9[_0x9a07('0x36')],function(_0x52bab2){var _0x5e0626={};_0x5e0626[_0x52bab2]={'$like':'%'+_0x26240a[_0x9a07('0x33')][_0x9a07('0x40')]+'%'};return _0x5e0626;})});}_0x3fa7c9=_[_0x9a07('0x41')]({},_0x3fa7c9,_0x26240a[_0x9a07('0x47')]);return _0x4574ed[_0x9a07('0x4c')](_0x3fa7c9);}})['then'](function(_0x88e005){if(_0x88e005){_0x4c2b35=_0x88e005[_0x9a07('0x39')];if(!_0x26240a[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x3fa7c9[_0x9a07('0x1f')]=qs['limit'](_0x26240a[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x3fa7c9['offset']=qs[_0x9a07('0x1d')](_0x26240a[_0x9a07('0x33')][_0x9a07('0x1d')]);}return _0x4574ed['getFields'](_0x3fa7c9);}})[_0x9a07('0x26')](function(_0x27dac3){if(_0x27dac3){return _0x27dac3?{'count':_0x4c2b35,'rows':_0x27dac3}:null;}})['then'](respondWithResult(_0x268731,null))[_0x9a07('0x4a')](handleError(_0x268731,null));};exports[_0x9a07('0x4d')]=function(_0x38edea,_0x3c19f4,_0x1508a0){var _0x3c2848={};var _0x40395={};var _0x37da64;var _0x1158e6;return db[_0x9a07('0x2e')][_0x9a07('0x4e')]({'where':{'id':_0x38edea['params']['id']}})['then'](handleEntityNotFound(_0x3c19f4,null))['then'](function(_0x5027c7){if(_0x5027c7){_0x37da64=_0x5027c7;_0x40395[_0x9a07('0x32')]=_[_0x9a07('0x34')](db[_0x9a07('0x4f')][_0x9a07('0x50')]);_0x40395[_0x9a07('0x33')]=_['keys'](_0x38edea[_0x9a07('0x33')]);_0x40395[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0x40395[_0x9a07('0x32')],_0x40395[_0x9a07('0x33')]);_0x3c2848[_0x9a07('0x36')]=_['intersection'](_0x40395[_0x9a07('0x32')],qs[_0x9a07('0x38')](_0x38edea[_0x9a07('0x33')][_0x9a07('0x38')]));_0x3c2848['attributes']=_0x3c2848['attributes'][_0x9a07('0x39')]?_0x3c2848['attributes']:_0x40395[_0x9a07('0x32')];_0x3c2848[_0x9a07('0x3c')]=qs[_0x9a07('0x3d')](_0x38edea[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x3c2848[_0x9a07('0x3e')]=qs[_0x9a07('0x35')](_[_0x9a07('0x3f')](_0x38edea['query'],_0x40395['filters']));if(_0x38edea[_0x9a07('0x33')][_0x9a07('0x40')]){_0x3c2848[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x3c2848[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x3c2848[_0x9a07('0x36')],function(_0x2b45c4){var _0x392ebb={};_0x392ebb[_0x2b45c4]={'$like':'%'+_0x38edea[_0x9a07('0x33')]['filter']+'%'};return _0x392ebb;})});}_0x3c2848=_[_0x9a07('0x41')]({},_0x3c2848,_0x38edea['options']);return _0x37da64[_0x9a07('0x4d')](_0x3c2848);}})[_0x9a07('0x26')](function(_0x209c1c){if(_0x209c1c){_0x1158e6=_0x209c1c[_0x9a07('0x39')];if(!_0x38edea[_0x9a07('0x33')][_0x9a07('0x3a')](_0x9a07('0x3b'))){_0x3c2848[_0x9a07('0x1f')]=qs['limit'](_0x38edea[_0x9a07('0x33')]['limit']);_0x3c2848[_0x9a07('0x1d')]=qs['offset'](_0x38edea['query'][_0x9a07('0x1d')]);}return _0x37da64['getSubjects'](_0x3c2848);}})[_0x9a07('0x26')](function(_0x3a70e5){if(_0x3a70e5){return _0x3a70e5?{'count':_0x1158e6,'rows':_0x3a70e5}:null;}})[_0x9a07('0x26')](respondWithResult(_0x3c19f4,null))[_0x9a07('0x4a')](handleError(_0x3c19f4,null));};exports[_0x9a07('0x51')]=function(_0x2edcc5,_0x4c559d,_0x3db352){var _0x45aa96={};var _0xf3ac9e={};var _0x34d506;var _0x27ce90;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2edcc5['params']['id']}})['then'](handleEntityNotFound(_0x4c559d,null))[_0x9a07('0x26')](function(_0x392a23){if(_0x392a23){_0x34d506=_0x392a23;_0xf3ac9e[_0x9a07('0x32')]=_[_0x9a07('0x34')](db[_0x9a07('0x4f')]['rawAttributes']);_0xf3ac9e[_0x9a07('0x33')]=_[_0x9a07('0x34')](_0x2edcc5[_0x9a07('0x33')]);_0xf3ac9e[_0x9a07('0x35')]=_[_0x9a07('0x37')](_0xf3ac9e[_0x9a07('0x32')],_0xf3ac9e[_0x9a07('0x33')]);_0x45aa96['attributes']=_['intersection'](_0xf3ac9e['model'],qs[_0x9a07('0x38')](_0x2edcc5[_0x9a07('0x33')]['fields']));_0x45aa96[_0x9a07('0x36')]=_0x45aa96['attributes'][_0x9a07('0x39')]?_0x45aa96[_0x9a07('0x36')]:_0xf3ac9e[_0x9a07('0x32')];_0x45aa96[_0x9a07('0x3c')]=qs[_0x9a07('0x3d')](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x3d')]);_0x45aa96[_0x9a07('0x3e')]=qs['filters'](_['pick'](_0x2edcc5[_0x9a07('0x33')],_0xf3ac9e[_0x9a07('0x35')]));if(_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x40')]){_0x45aa96[_0x9a07('0x3e')]=_[_0x9a07('0x41')](_0x45aa96[_0x9a07('0x3e')],{'$or':_[_0x9a07('0x2d')](_0x45aa96[_0x9a07('0x36')],function(_0x1f70e4){var _0x27975b={};_0x27975b[_0x1f70e4]={'$like':'%'+_0x2edcc5['query'][_0x9a07('0x40')]+'%'};return _0x27975b;})});}_0x45aa96=_[_0x9a07('0x41')]({},_0x45aa96,_0x2edcc5['options']);return _0x34d506[_0x9a07('0x51')](_0x45aa96);}})[_0x9a07('0x26')](function(_0x47026a){if(_0x47026a){_0x27ce90=_0x47026a[_0x9a07('0x39')];if(!_0x2edcc5['query']['hasOwnProperty'](_0x9a07('0x3b'))){_0x45aa96[_0x9a07('0x1f')]=qs['limit'](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x1f')]);_0x45aa96[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x2edcc5[_0x9a07('0x33')][_0x9a07('0x1d')]);}return _0x34d506[_0x9a07('0x51')](_0x45aa96);}})['then'](function(_0x138449){if(_0x138449){return _0x138449?{'count':_0x27ce90,'rows':_0x138449}:null;}})[_0x9a07('0x26')](respondWithResult(_0x4c559d,null))[_0x9a07('0x4a')](handleError(_0x4c559d,null));}; \ No newline at end of file +var _0x9c6d=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','stack','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','params','length','options','find','catch','create','body','Dynamics365Field','hasOwnProperty','getFields','getSubjects','findOne','nolimit','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x52f4d6,_0x2f4818){var _0xaa4059=function(_0x1ecfb3){while(--_0x1ecfb3){_0x52f4d6['push'](_0x52f4d6['shift']());}};_0xaa4059(++_0x2f4818);}(_0x9c6d,0x81));var _0xd9c6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c6d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xd9c6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd9c6('0x1'));var rp=require(_0xd9c6('0x2'));var moment=require('moment');var BPromise=require(_0xd9c6('0x3'));var Mustache=require(_0xd9c6('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd9c6('0x5'));var csv=require(_0xd9c6('0x6'));var ejs=require(_0xd9c6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9c6('0x8'));var squel=require(_0xd9c6('0x9'));var crypto=require(_0xd9c6('0xa'));var jsforce=require(_0xd9c6('0xb'));var deskjs=require(_0xd9c6('0xc'));var toCsv=require(_0xd9c6('0x6'));var querystring=require(_0xd9c6('0xd'));var Papa=require(_0xd9c6('0xe'));var Redis=require(_0xd9c6('0xf'));var authService=require(_0xd9c6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd9c6('0x11'));var hardwareService=require(_0xd9c6('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd9c6('0x13'));var licenseUtil=require(_0xd9c6('0x14'));var db=require(_0xd9c6('0x15'))['db'];function respondWithStatusCode(_0x5a0a4f,_0x56f326){_0x56f326=_0x56f326||0xcc;return function(_0x40973b){if(_0x40973b){return _0x5a0a4f[_0xd9c6('0x16')](_0x56f326);}return _0x5a0a4f[_0xd9c6('0x17')](_0x56f326)[_0xd9c6('0x18')]();};}function respondWithResult(_0x4ded8f,_0xa276fa){_0xa276fa=_0xa276fa||0xc8;return function(_0x5e587d){if(_0x5e587d){return _0x4ded8f[_0xd9c6('0x17')](_0xa276fa)[_0xd9c6('0x19')](_0x5e587d);}};}function respondWithFilteredResult(_0x49aee2,_0x1b1aea){return function(_0x35bc61){if(_0x35bc61){var _0xbd784d=typeof _0x1b1aea[_0xd9c6('0x1a')]==='undefined'&&typeof _0x1b1aea[_0xd9c6('0x1b')]===_0xd9c6('0x1c');var _0x255166=_0x35bc61[_0xd9c6('0x1d')];var _0x55a8f2=_0xbd784d?0x0:_0x1b1aea['offset'];var _0x1682d9=_0xbd784d?_0x35bc61[_0xd9c6('0x1d')]:_0x1b1aea[_0xd9c6('0x1a')]+_0x1b1aea['limit'];var _0x48d497;if(_0x1682d9>=_0x255166){_0x1682d9=_0x255166;_0x48d497=0xc8;}else{_0x48d497=0xce;}_0x49aee2[_0xd9c6('0x17')](_0x48d497);return _0x49aee2['set'](_0xd9c6('0x1e'),_0x55a8f2+'-'+_0x1682d9+'/'+_0x255166)[_0xd9c6('0x19')](_0x35bc61);}return null;};}function patchUpdates(_0x574bc3){return function(_0x15c169){try{jsonpatch[_0xd9c6('0x1f')](_0x15c169,_0x574bc3,!![]);}catch(_0x5ea95a){return BPromise[_0xd9c6('0x20')](_0x5ea95a);}return _0x15c169[_0xd9c6('0x21')]();};}function saveUpdates(_0x36bb7c,_0xa28a8c){return function(_0x968a65){if(_0x968a65){return _0x968a65['update'](_0x36bb7c)[_0xd9c6('0x22')](function(_0x21410f){return _0x21410f;});}return null;};}function removeEntity(_0x2c3818,_0x57d89){return function(_0xab1808){if(_0xab1808){return _0xab1808[_0xd9c6('0x23')]()[_0xd9c6('0x22')](function(){_0x2c3818[_0xd9c6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ea1e,_0x3d0b75){return function(_0x347680){if(!_0x347680){_0x56ea1e[_0xd9c6('0x16')](0x194);}return _0x347680;};}function handleError(_0x68f6a2,_0x7f0d5f){_0x7f0d5f=_0x7f0d5f||0x1f4;return function(_0x51232e){logger['error'](_0x51232e[_0xd9c6('0x24')]);if(_0x51232e['name']){delete _0x51232e['name'];}_0x68f6a2['status'](_0x7f0d5f)[_0xd9c6('0x25')](_0x51232e);};}exports['index']=function(_0x3444b7,_0x5b6a82){var _0x4a69f3={},_0x1c6409={},_0x2c4f9a={'count':0x0,'rows':[]};var _0x14c51f=_[_0xd9c6('0x26')](db[_0xd9c6('0x27')][_0xd9c6('0x28')],function(_0x1f9c1c){return{'name':_0x1f9c1c[_0xd9c6('0x29')],'type':_0x1f9c1c['type'][_0xd9c6('0x2a')]};});_0x1c6409[_0xd9c6('0x2b')]=_[_0xd9c6('0x26')](_0x14c51f,_0xd9c6('0x2c'));_0x1c6409[_0xd9c6('0x2d')]=_[_0xd9c6('0x2e')](_0x3444b7[_0xd9c6('0x2d')]);_0x1c6409[_0xd9c6('0x2f')]=_[_0xd9c6('0x30')](_0x1c6409[_0xd9c6('0x2b')],_0x1c6409['query']);_0x4a69f3[_0xd9c6('0x31')]=_[_0xd9c6('0x30')](_0x1c6409[_0xd9c6('0x2b')],qs[_0xd9c6('0x32')](_0x3444b7[_0xd9c6('0x2d')][_0xd9c6('0x32')]));_0x4a69f3[_0xd9c6('0x31')]=_0x4a69f3[_0xd9c6('0x31')]['length']?_0x4a69f3['attributes']:_0x1c6409[_0xd9c6('0x2b')];if(!_0x3444b7[_0xd9c6('0x2d')]['hasOwnProperty']('nolimit')){_0x4a69f3[_0xd9c6('0x1b')]=qs[_0xd9c6('0x1b')](_0x3444b7[_0xd9c6('0x2d')]['limit']);_0x4a69f3[_0xd9c6('0x1a')]=qs[_0xd9c6('0x1a')](_0x3444b7[_0xd9c6('0x2d')][_0xd9c6('0x1a')]);}_0x4a69f3[_0xd9c6('0x33')]=qs[_0xd9c6('0x34')](_0x3444b7['query'][_0xd9c6('0x34')]);_0x4a69f3[_0xd9c6('0x35')]=qs[_0xd9c6('0x2f')](_[_0xd9c6('0x36')](_0x3444b7[_0xd9c6('0x2d')],_0x1c6409[_0xd9c6('0x2f')]),_0x14c51f);if(_0x3444b7[_0xd9c6('0x2d')][_0xd9c6('0x37')]){_0x4a69f3[_0xd9c6('0x35')]=_[_0xd9c6('0x38')](_0x4a69f3[_0xd9c6('0x35')],{'$or':_['map'](_0x14c51f,function(_0x53b10b){if(_0x53b10b[_0xd9c6('0x39')]!==_0xd9c6('0x3a')){var _0x4d6f0b={};_0x4d6f0b[_0x53b10b['name']]={'$like':'%'+_0x3444b7[_0xd9c6('0x2d')][_0xd9c6('0x37')]+'%'};return _0x4d6f0b;}})});}_0x4a69f3=_[_0xd9c6('0x38')]({},_0x4a69f3,_0x3444b7['options']);var _0x427ef4={'where':_0x4a69f3[_0xd9c6('0x35')]};return db['Dynamics365Configuration'][_0xd9c6('0x1d')](_0x427ef4)[_0xd9c6('0x22')](function(_0x3b373d){_0x2c4f9a[_0xd9c6('0x1d')]=_0x3b373d;if(_0x3444b7[_0xd9c6('0x2d')]['includeAll']){_0x4a69f3[_0xd9c6('0x3b')]=[{'all':!![]}];}return db[_0xd9c6('0x27')][_0xd9c6('0x3c')](_0x4a69f3);})['then'](function(_0x1d1549){_0x2c4f9a[_0xd9c6('0x3d')]=_0x1d1549;return _0x2c4f9a;})[_0xd9c6('0x22')](respondWithFilteredResult(_0x5b6a82,_0x4a69f3))['catch'](handleError(_0x5b6a82,null));};exports['show']=function(_0x57d0fa,_0x24af3f){var _0x30738e={'raw':![],'where':{'id':_0x57d0fa[_0xd9c6('0x3e')]['id']}},_0x192d88={};_0x192d88[_0xd9c6('0x2b')]=_[_0xd9c6('0x2e')](db[_0xd9c6('0x27')][_0xd9c6('0x28')]);_0x192d88[_0xd9c6('0x2d')]=_[_0xd9c6('0x2e')](_0x57d0fa[_0xd9c6('0x2d')]);_0x192d88[_0xd9c6('0x2f')]=_[_0xd9c6('0x30')](_0x192d88['model'],_0x192d88[_0xd9c6('0x2d')]);_0x30738e['attributes']=_['intersection'](_0x192d88[_0xd9c6('0x2b')],qs[_0xd9c6('0x32')](_0x57d0fa[_0xd9c6('0x2d')][_0xd9c6('0x32')]));_0x30738e[_0xd9c6('0x31')]=_0x30738e[_0xd9c6('0x31')][_0xd9c6('0x3f')]?_0x30738e[_0xd9c6('0x31')]:_0x192d88[_0xd9c6('0x2b')];if(_0x57d0fa[_0xd9c6('0x2d')]['includeAll']){_0x30738e['include']=[{'all':!![]}];}_0x30738e=_[_0xd9c6('0x38')]({},_0x30738e,_0x57d0fa[_0xd9c6('0x40')]);return db['Dynamics365Configuration'][_0xd9c6('0x41')](_0x30738e)[_0xd9c6('0x22')](handleEntityNotFound(_0x24af3f,null))[_0xd9c6('0x22')](respondWithResult(_0x24af3f,null))[_0xd9c6('0x42')](handleError(_0x24af3f,null));};exports[_0xd9c6('0x43')]=function(_0x12f85d,_0x16c027){return db['Dynamics365Configuration'][_0xd9c6('0x43')](_0x12f85d[_0xd9c6('0x44')],{})[_0xd9c6('0x22')](respondWithResult(_0x16c027,0xc9))[_0xd9c6('0x42')](handleError(_0x16c027,null));};exports['update']=function(_0x1c5a5a,_0x5bf757){if(_0x1c5a5a[_0xd9c6('0x44')]['id']){delete _0x1c5a5a['body']['id'];}return db[_0xd9c6('0x27')][_0xd9c6('0x41')]({'where':{'id':_0x1c5a5a[_0xd9c6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5bf757,null))[_0xd9c6('0x22')](saveUpdates(_0x1c5a5a[_0xd9c6('0x44')],null))[_0xd9c6('0x22')](respondWithResult(_0x5bf757,null))[_0xd9c6('0x42')](handleError(_0x5bf757,null));};exports[_0xd9c6('0x23')]=function(_0x221c96,_0x53d5a7){return db[_0xd9c6('0x27')][_0xd9c6('0x41')]({'where':{'id':_0x221c96[_0xd9c6('0x3e')]['id']}})[_0xd9c6('0x22')](handleEntityNotFound(_0x53d5a7,null))[_0xd9c6('0x22')](removeEntity(_0x53d5a7,null))[_0xd9c6('0x42')](handleError(_0x53d5a7,null));};exports['getFields']=function(_0x439496,_0x5a001a,_0x456bf2){var _0x5f0f06={};var _0x4a3817={};var _0x4404f5;var _0x4b228f;return db[_0xd9c6('0x27')]['findOne']({'where':{'id':_0x439496[_0xd9c6('0x3e')]['id']}})[_0xd9c6('0x22')](handleEntityNotFound(_0x5a001a,null))['then'](function(_0x32754e){if(_0x32754e){_0x4404f5=_0x32754e;_0x4a3817[_0xd9c6('0x2b')]=_['keys'](db[_0xd9c6('0x45')]['rawAttributes']);_0x4a3817[_0xd9c6('0x2d')]=_['keys'](_0x439496['query']);_0x4a3817[_0xd9c6('0x2f')]=_[_0xd9c6('0x30')](_0x4a3817['model'],_0x4a3817[_0xd9c6('0x2d')]);_0x5f0f06[_0xd9c6('0x31')]=_['intersection'](_0x4a3817[_0xd9c6('0x2b')],qs[_0xd9c6('0x32')](_0x439496[_0xd9c6('0x2d')][_0xd9c6('0x32')]));_0x5f0f06[_0xd9c6('0x31')]=_0x5f0f06['attributes']['length']?_0x5f0f06[_0xd9c6('0x31')]:_0x4a3817[_0xd9c6('0x2b')];_0x5f0f06['order']=qs[_0xd9c6('0x34')](_0x439496[_0xd9c6('0x2d')][_0xd9c6('0x34')]);_0x5f0f06['where']=qs[_0xd9c6('0x2f')](_[_0xd9c6('0x36')](_0x439496[_0xd9c6('0x2d')],_0x4a3817[_0xd9c6('0x2f')]));if(_0x439496[_0xd9c6('0x2d')][_0xd9c6('0x37')]){_0x5f0f06[_0xd9c6('0x35')]=_['merge'](_0x5f0f06[_0xd9c6('0x35')],{'$or':_[_0xd9c6('0x26')](_0x5f0f06[_0xd9c6('0x31')],function(_0x5e761c){var _0x481fba={};_0x481fba[_0x5e761c]={'$like':'%'+_0x439496['query'][_0xd9c6('0x37')]+'%'};return _0x481fba;})});}_0x5f0f06=_['merge']({},_0x5f0f06,_0x439496[_0xd9c6('0x40')]);return _0x4404f5['getFields'](_0x5f0f06);}})['then'](function(_0x18bd44){if(_0x18bd44){_0x4b228f=_0x18bd44[_0xd9c6('0x3f')];if(!_0x439496[_0xd9c6('0x2d')][_0xd9c6('0x46')]('nolimit')){_0x5f0f06[_0xd9c6('0x1b')]=qs[_0xd9c6('0x1b')](_0x439496[_0xd9c6('0x2d')][_0xd9c6('0x1b')]);_0x5f0f06['offset']=qs[_0xd9c6('0x1a')](_0x439496['query'][_0xd9c6('0x1a')]);}return _0x4404f5[_0xd9c6('0x47')](_0x5f0f06);}})[_0xd9c6('0x22')](function(_0x5738f4){if(_0x5738f4){return _0x5738f4?{'count':_0x4b228f,'rows':_0x5738f4}:null;}})[_0xd9c6('0x22')](respondWithResult(_0x5a001a,null))[_0xd9c6('0x42')](handleError(_0x5a001a,null));};exports[_0xd9c6('0x48')]=function(_0x7bf6d2,_0x3dbfe9,_0x53d00d){var _0x573667={};var _0x52d852={};var _0x2ad6c1;var _0x34fa09;return db[_0xd9c6('0x27')][_0xd9c6('0x49')]({'where':{'id':_0x7bf6d2[_0xd9c6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3dbfe9,null))[_0xd9c6('0x22')](function(_0x51edf7){if(_0x51edf7){_0x2ad6c1=_0x51edf7;_0x52d852[_0xd9c6('0x2b')]=_[_0xd9c6('0x2e')](db[_0xd9c6('0x45')][_0xd9c6('0x28')]);_0x52d852['query']=_[_0xd9c6('0x2e')](_0x7bf6d2[_0xd9c6('0x2d')]);_0x52d852['filters']=_[_0xd9c6('0x30')](_0x52d852[_0xd9c6('0x2b')],_0x52d852['query']);_0x573667[_0xd9c6('0x31')]=_['intersection'](_0x52d852['model'],qs[_0xd9c6('0x32')](_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x32')]));_0x573667['attributes']=_0x573667[_0xd9c6('0x31')]['length']?_0x573667[_0xd9c6('0x31')]:_0x52d852['model'];_0x573667['order']=qs[_0xd9c6('0x34')](_0x7bf6d2['query'][_0xd9c6('0x34')]);_0x573667[_0xd9c6('0x35')]=qs[_0xd9c6('0x2f')](_[_0xd9c6('0x36')](_0x7bf6d2['query'],_0x52d852['filters']));if(_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x37')]){_0x573667['where']=_[_0xd9c6('0x38')](_0x573667['where'],{'$or':_[_0xd9c6('0x26')](_0x573667['attributes'],function(_0x15dfb5){var _0x385211={};_0x385211[_0x15dfb5]={'$like':'%'+_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x37')]+'%'};return _0x385211;})});}_0x573667=_['merge']({},_0x573667,_0x7bf6d2['options']);return _0x2ad6c1[_0xd9c6('0x48')](_0x573667);}})[_0xd9c6('0x22')](function(_0xcd8ecd){if(_0xcd8ecd){_0x34fa09=_0xcd8ecd[_0xd9c6('0x3f')];if(!_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x46')](_0xd9c6('0x4a'))){_0x573667[_0xd9c6('0x1b')]=qs[_0xd9c6('0x1b')](_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x1b')]);_0x573667[_0xd9c6('0x1a')]=qs['offset'](_0x7bf6d2[_0xd9c6('0x2d')][_0xd9c6('0x1a')]);}return _0x2ad6c1['getSubjects'](_0x573667);}})['then'](function(_0x553f75){if(_0x553f75){return _0x553f75?{'count':_0x34fa09,'rows':_0x553f75}:null;}})[_0xd9c6('0x22')](respondWithResult(_0x3dbfe9,null))['catch'](handleError(_0x3dbfe9,null));};exports['getDescriptions']=function(_0x524977,_0x42df4c,_0xcb80e7){var _0x1c4a11={};var _0x249d16={};var _0x5ecfa6;var _0x342970;return db['Dynamics365Configuration'][_0xd9c6('0x49')]({'where':{'id':_0x524977[_0xd9c6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42df4c,null))['then'](function(_0x1bcd91){if(_0x1bcd91){_0x5ecfa6=_0x1bcd91;_0x249d16[_0xd9c6('0x2b')]=_['keys'](db[_0xd9c6('0x45')][_0xd9c6('0x28')]);_0x249d16['query']=_[_0xd9c6('0x2e')](_0x524977[_0xd9c6('0x2d')]);_0x249d16[_0xd9c6('0x2f')]=_['intersection'](_0x249d16[_0xd9c6('0x2b')],_0x249d16[_0xd9c6('0x2d')]);_0x1c4a11[_0xd9c6('0x31')]=_['intersection'](_0x249d16[_0xd9c6('0x2b')],qs[_0xd9c6('0x32')](_0x524977[_0xd9c6('0x2d')]['fields']));_0x1c4a11[_0xd9c6('0x31')]=_0x1c4a11[_0xd9c6('0x31')][_0xd9c6('0x3f')]?_0x1c4a11[_0xd9c6('0x31')]:_0x249d16[_0xd9c6('0x2b')];_0x1c4a11['order']=qs[_0xd9c6('0x34')](_0x524977[_0xd9c6('0x2d')][_0xd9c6('0x34')]);_0x1c4a11[_0xd9c6('0x35')]=qs[_0xd9c6('0x2f')](_[_0xd9c6('0x36')](_0x524977[_0xd9c6('0x2d')],_0x249d16['filters']));if(_0x524977[_0xd9c6('0x2d')][_0xd9c6('0x37')]){_0x1c4a11[_0xd9c6('0x35')]=_[_0xd9c6('0x38')](_0x1c4a11['where'],{'$or':_[_0xd9c6('0x26')](_0x1c4a11['attributes'],function(_0x29cb88){var _0x1917b4={};_0x1917b4[_0x29cb88]={'$like':'%'+_0x524977['query']['filter']+'%'};return _0x1917b4;})});}_0x1c4a11=_[_0xd9c6('0x38')]({},_0x1c4a11,_0x524977[_0xd9c6('0x40')]);return _0x5ecfa6[_0xd9c6('0x4b')](_0x1c4a11);}})['then'](function(_0x4d5f28){if(_0x4d5f28){_0x342970=_0x4d5f28[_0xd9c6('0x3f')];if(!_0x524977[_0xd9c6('0x2d')][_0xd9c6('0x46')](_0xd9c6('0x4a'))){_0x1c4a11[_0xd9c6('0x1b')]=qs['limit'](_0x524977[_0xd9c6('0x2d')]['limit']);_0x1c4a11[_0xd9c6('0x1a')]=qs[_0xd9c6('0x1a')](_0x524977[_0xd9c6('0x2d')]['offset']);}return _0x5ecfa6[_0xd9c6('0x4b')](_0x1c4a11);}})[_0xd9c6('0x22')](function(_0x2c2fa5){if(_0x2c2fa5){return _0x2c2fa5?{'count':_0x342970,'rows':_0x2c2fa5}:null;}})[_0xd9c6('0x22')](respondWithResult(_0x42df4c,null))['catch'](handleError(_0x42df4c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3bb8e9a..490e7de 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 _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e6413,_0x33a376){var _0x331e31=function(_0x495bec){while(--_0x495bec){_0x2e6413['push'](_0x2e6413['shift']());}};_0x331e31(++_0x33a376);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf3cd[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x2384d1,_0x2e970c){var _0x3689ff=function(_0x42cbdb){while(--_0x42cbdb){_0x2384d1['push'](_0x2384d1['shift']());}};_0x3689ff(++_0x2e970c);}(_0x9f62,0x154));var _0x29f6=function(_0xaf35d5,_0x1053b0){_0xaf35d5=_0xaf35d5-0x0;var _0x3346ae=_0x9f62[_0xaf35d5];return _0x3346ae;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 8d080dd..d66895b 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 _0xf59f=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0xf4f343,_0x41fe4a){var _0x4cda68=function(_0x3850e6){while(--_0x3850e6){_0xf4f343['push'](_0xf4f343['shift']());}};_0x4cda68(++_0x41fe4a);}(_0xf59f,0x182));var _0xff59=function(_0x3a3a1b,_0x23ec74){_0x3a3a1b=_0x3a3a1b-0x0;var _0x1a30a9=_0xf59f[_0x3a3a1b];return _0x1a30a9;};'use strict';var _=require(_0xff59('0x0'));var util=require(_0xff59('0x1'));var moment=require('moment');var BPromise=require(_0xff59('0x2'));var rs=require(_0xff59('0x3'));var fs=require('fs');var Redis=require(_0xff59('0x4'));var db=require(_0xff59('0x5'))['db'];var utils=require(_0xff59('0x6'));var logger=require('../../config/logger')(_0xff59('0x7'));var config=require(_0xff59('0x8'));var jayson=require(_0xff59('0x9'));var client=jayson[_0xff59('0xa')][_0xff59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x505512,_0x4ad54e,_0x3673f0){return new BPromise(function(_0x2d837e,_0x51df2d){return client[_0xff59('0xc')](_0x505512,_0x3673f0)[_0xff59('0xd')](function(_0x4063bc){logger[_0xff59('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'));logger[_0xff59('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'),JSON[_0xff59('0x11')](_0x4063bc));if(_0x4063bc[_0xff59('0x12')]){if(_0x4063bc[_0xff59('0x12')][_0xff59('0x13')]===0x1f4){logger[_0xff59('0x12')](_0xff59('0x14'),_0x4ad54e,_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);return _0x51df2d(_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);}logger[_0xff59('0x12')](_0xff59('0x14'),_0x4ad54e,_0x4063bc[_0xff59('0x12')][_0xff59('0x15')]);return _0x2d837e(_0x4063bc['error'][_0xff59('0x15')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0xff59('0xf'));_0x2d837e(_0x4063bc[_0xff59('0x16')][_0xff59('0x15')]);}})[_0xff59('0x17')](function(_0x502fe3){logger[_0xff59('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4ad54e,_0x502fe3);_0x51df2d(_0x502fe3);});});} \ No newline at end of file +var _0x00e7=['error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4da3b6,_0x233aff){var _0x574d38=function(_0x4fa45b){while(--_0x4fa45b){_0x4da3b6['push'](_0x4da3b6['shift']());}};_0x574d38(++_0x233aff);}(_0x00e7,0x14e));var _0x700e=function(_0x12efa0,_0x579590){_0x12efa0=_0x12efa0-0x0;var _0x158c02=_0x00e7[_0x12efa0];return _0x158c02;};'use strict';var _=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var moment=require(_0x700e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x700e('0x3'));var db=require(_0x700e('0x4'))['db'];var utils=require(_0x700e('0x5'));var logger=require(_0x700e('0x6'))(_0x700e('0x7'));var config=require(_0x700e('0x8'));var jayson=require(_0x700e('0x9'));var client=jayson[_0x700e('0xa')][_0x700e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe5057,_0x3ed4d7,_0x5e2d99){return new BPromise(function(_0x42d8dd,_0x3924bc){return client[_0x700e('0xc')](_0xbe5057,_0x5e2d99)['then'](function(_0x1663dc){logger[_0x700e('0xd')](_0x700e('0xe'),_0x3ed4d7,'request\x20sent');logger['debug'](_0x700e('0xf'),_0x3ed4d7,_0x700e('0x10'),JSON[_0x700e('0x11')](_0x1663dc));if(_0x1663dc[_0x700e('0x12')]){if(_0x1663dc[_0x700e('0x12')]['code']===0x1f4){logger[_0x700e('0x12')](_0x700e('0xe'),_0x3ed4d7,_0x1663dc[_0x700e('0x12')][_0x700e('0x13')]);return _0x3924bc(_0x1663dc[_0x700e('0x12')]['message']);}logger[_0x700e('0x12')](_0x700e('0xe'),_0x3ed4d7,_0x1663dc['error'][_0x700e('0x13')]);return _0x42d8dd(_0x1663dc['error'][_0x700e('0x13')]);}else{logger[_0x700e('0xd')](_0x700e('0xe'),_0x3ed4d7,'request\x20sent');_0x42d8dd(_0x1663dc[_0x700e('0x14')][_0x700e('0x13')]);}})[_0x700e('0x15')](function(_0x233703){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3ed4d7,_0x233703);_0x3924bc(_0x233703);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 15ac67c..746b7af 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 _0xf28f=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f2802,_0x29263f){var _0x1bb4d9=function(_0x32d9bd){while(--_0x32d9bd){_0x1f2802['push'](_0x1f2802['shift']());}};_0x1bb4d9(++_0x29263f);}(_0xf28f,0x19b));var _0xff28=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf28f[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xff28('0x0'));var util=require(_0xff28('0x1'));var path=require('path');var timeout=require(_0xff28('0x2'));var express=require(_0xff28('0x3'));var router=express[_0xff28('0x4')]();var fs_extra=require(_0xff28('0x5'));var auth=require(_0xff28('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff28('0x7'));var controller=require(_0xff28('0x8'));router[_0xff28('0x9')]('/',auth[_0xff28('0xa')](),controller[_0xff28('0xb')]);router[_0xff28('0x9')](_0xff28('0xc'),auth[_0xff28('0xa')](),controller[_0xff28('0xd')]);router[_0xff28('0xe')]('/',auth[_0xff28('0xa')](),controller[_0xff28('0xf')]);router[_0xff28('0x10')](_0xff28('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xff28('0x11')](_0xff28('0xc'),auth[_0xff28('0xa')](),controller['destroy']);module[_0xff28('0x12')]=router; \ No newline at end of file +var _0xd036=['../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x463ab1,_0x46bf6a){var _0x349abe=function(_0xf851b){while(--_0xf851b){_0x463ab1['push'](_0x463ab1['shift']());}};_0x349abe(++_0x46bf6a);}(_0xd036,0x127));var _0x6d03=function(_0x4e215b,_0x597fbc){_0x4e215b=_0x4e215b-0x0;var _0x56d77a=_0xd036[_0x4e215b];return _0x56d77a;};'use strict';var multer=require(_0x6d03('0x0'));var util=require(_0x6d03('0x1'));var path=require(_0x6d03('0x2'));var timeout=require(_0x6d03('0x3'));var express=require(_0x6d03('0x4'));var router=express[_0x6d03('0x5')]();var fs_extra=require(_0x6d03('0x6'));var auth=require(_0x6d03('0x7'));var interaction=require(_0x6d03('0x8'));var config=require(_0x6d03('0x9'));var controller=require(_0x6d03('0xa'));router['get']('/',auth[_0x6d03('0xb')](),controller[_0x6d03('0xc')]);router['get'](_0x6d03('0xd'),auth['isAuthenticated'](),controller[_0x6d03('0xe')]);router['post']('/',auth[_0x6d03('0xb')](),controller['create']);router[_0x6d03('0xf')](_0x6d03('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6d03('0x10')](_0x6d03('0xd'),auth[_0x6d03('0xb')](),controller[_0x6d03('0x11')]);module[_0x6d03('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index eaaca62..1c0be27 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 _0x35eb=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x35eb,0x1f3));var _0xb35e=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x35eb[_0x4169d8];return _0x32084a;};'use strict';var Sequelize=require('sequelize');module[_0xb35e('0x0')]={'type':{'type':Sequelize[_0xb35e('0x1')](_0xb35e('0x2'),_0xb35e('0x3'),_0xb35e('0x4'),_0xb35e('0x5'),_0xb35e('0x6')),'defaultValue':_0xb35e('0x2')},'content':{'type':Sequelize[_0xb35e('0x7')]},'key':{'type':Sequelize[_0xb35e('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xb35e('0x3'),_0xb35e('0x4'))},'keyContent':{'type':Sequelize[_0xb35e('0x7')]},'idField':{'type':Sequelize[_0xb35e('0x7')]},'nameField':{'type':Sequelize[_0xb35e('0x7')]},'customField':{'type':Sequelize[_0xb35e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x769b=['string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x3a8b11,_0x45d5bf){var _0x12bde4=function(_0x17df2e){while(--_0x17df2e){_0x3a8b11['push'](_0x3a8b11['shift']());}};_0x12bde4(++_0x45d5bf);}(_0x769b,0xd8));var _0xb769=function(_0x3834ad,_0x59badd){_0x3834ad=_0x3834ad-0x0;var _0x1d8920=_0x769b[_0x3834ad];return _0x1d8920;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb769('0x0')](_0xb769('0x1'),_0xb769('0x2'),_0xb769('0x3'),_0xb769('0x4'),_0xb769('0x5')),'defaultValue':_0xb769('0x1')},'content':{'type':Sequelize[_0xb769('0x6')]},'key':{'type':Sequelize[_0xb769('0x6')]},'keyType':{'type':Sequelize[_0xb769('0x0')](_0xb769('0x1'),_0xb769('0x2'),_0xb769('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb769('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 96fe8e6..14b8d76 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 _0x9481=['map','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','rawAttributes','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Dynamics365Field','type','key'];(function(_0x4a04de,_0x2e342c){var _0xbbe018=function(_0x39639c){while(--_0x39639c){_0x4a04de['push'](_0x4a04de['shift']());}};_0xbbe018(++_0x2e342c);}(_0x9481,0x137));var _0x1948=function(_0x38b7bb,_0x21fd02){_0x38b7bb=_0x38b7bb-0x0;var _0x183069=_0x9481[_0x38b7bb];return _0x183069;};'use strict';var emlformat=require(_0x1948('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1948('0x1'));var jsonpatch=require(_0x1948('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1948('0x3'));var util=require(_0x1948('0x4'));var path=require(_0x1948('0x5'));var sox=require('sox');var csv=require(_0x1948('0x6'));var ejs=require(_0x1948('0x7'));var fs=require('fs');var fs_extra=require(_0x1948('0x8'));var _=require(_0x1948('0x9'));var squel=require(_0x1948('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1948('0xb'));var toCsv=require(_0x1948('0x6'));var querystring=require(_0x1948('0xc'));var Papa=require(_0x1948('0xd'));var Redis=require(_0x1948('0xe'));var authService=require(_0x1948('0xf'));var qs=require(_0x1948('0x10'));var as=require(_0x1948('0x11'));var hardwareService=require(_0x1948('0x12'));var logger=require(_0x1948('0x13'))('api');var utils=require(_0x1948('0x14'));var config=require(_0x1948('0x15'));var licenseUtil=require(_0x1948('0x16'));var db=require(_0x1948('0x17'))['db'];function respondWithStatusCode(_0x2af8d4,_0xacd78e){_0xacd78e=_0xacd78e||0xcc;return function(_0xff1f8b){if(_0xff1f8b){return _0x2af8d4['sendStatus'](_0xacd78e);}return _0x2af8d4['status'](_0xacd78e)[_0x1948('0x18')]();};}function respondWithResult(_0x3e3046,_0x5f2304){_0x5f2304=_0x5f2304||0xc8;return function(_0x6f6e2a){if(_0x6f6e2a){return _0x3e3046[_0x1948('0x19')](_0x5f2304)['json'](_0x6f6e2a);}};}function respondWithFilteredResult(_0x3140bf,_0x2f9a2b){return function(_0x2d4c16){if(_0x2d4c16){var _0x47ca7e=typeof _0x2f9a2b[_0x1948('0x1a')]===_0x1948('0x1b')&&typeof _0x2f9a2b[_0x1948('0x1c')]===_0x1948('0x1b');var _0x2b4b1e=_0x2d4c16[_0x1948('0x1d')];var _0x586b7a=_0x47ca7e?0x0:_0x2f9a2b[_0x1948('0x1a')];var _0x5dd045=_0x47ca7e?_0x2d4c16[_0x1948('0x1d')]:_0x2f9a2b[_0x1948('0x1a')]+_0x2f9a2b['limit'];var _0x29f3be;if(_0x5dd045>=_0x2b4b1e){_0x5dd045=_0x2b4b1e;_0x29f3be=0xc8;}else{_0x29f3be=0xce;}_0x3140bf[_0x1948('0x19')](_0x29f3be);return _0x3140bf['set'](_0x1948('0x1e'),_0x586b7a+'-'+_0x5dd045+'/'+_0x2b4b1e)[_0x1948('0x1f')](_0x2d4c16);}return null;};}function patchUpdates(_0x324f46){return function(_0x500dce){try{jsonpatch[_0x1948('0x20')](_0x500dce,_0x324f46,!![]);}catch(_0x22ced7){return BPromise['reject'](_0x22ced7);}return _0x500dce[_0x1948('0x21')]();};}function saveUpdates(_0x2a22ab,_0x69b37b){return function(_0x4472bb){if(_0x4472bb){return _0x4472bb[_0x1948('0x22')](_0x2a22ab)[_0x1948('0x23')](function(_0x3826f9){return _0x3826f9;});}return null;};}function removeEntity(_0x40664c,_0xbdd7cb){return function(_0x276d6a){if(_0x276d6a){return _0x276d6a[_0x1948('0x24')]()[_0x1948('0x23')](function(){_0x40664c['status'](0xcc)[_0x1948('0x18')]();});}};}function handleEntityNotFound(_0x45a5ed,_0x147032){return function(_0x2ca71c){if(!_0x2ca71c){_0x45a5ed['sendStatus'](0x194);}return _0x2ca71c;};}function handleError(_0xc7cc62,_0x58716c){_0x58716c=_0x58716c||0x1f4;return function(_0x29252c){logger[_0x1948('0x25')](_0x29252c[_0x1948('0x26')]);if(_0x29252c[_0x1948('0x27')]){delete _0x29252c[_0x1948('0x27')];}_0xc7cc62['status'](_0x58716c)[_0x1948('0x28')](_0x29252c);};}exports['index']=function(_0x80497e,_0x53f0ed){var _0x4cf3f8={},_0x297d93={},_0x52729c={'count':0x0,'rows':[]};var _0x55931d=_['map'](db[_0x1948('0x29')]['rawAttributes'],function(_0x4491d6){return{'name':_0x4491d6['fieldName'],'type':_0x4491d6[_0x1948('0x2a')][_0x1948('0x2b')]};});_0x297d93['model']=_[_0x1948('0x2c')](_0x55931d,_0x1948('0x27'));_0x297d93['query']=_[_0x1948('0x2d')](_0x80497e['query']);_0x297d93[_0x1948('0x2e')]=_['intersection'](_0x297d93[_0x1948('0x2f')],_0x297d93[_0x1948('0x30')]);_0x4cf3f8[_0x1948('0x31')]=_[_0x1948('0x32')](_0x297d93[_0x1948('0x2f')],qs[_0x1948('0x33')](_0x80497e['query']['fields']));_0x4cf3f8[_0x1948('0x31')]=_0x4cf3f8[_0x1948('0x31')][_0x1948('0x34')]?_0x4cf3f8[_0x1948('0x31')]:_0x297d93[_0x1948('0x2f')];if(!_0x80497e[_0x1948('0x30')][_0x1948('0x35')]('nolimit')){_0x4cf3f8[_0x1948('0x1c')]=qs[_0x1948('0x1c')](_0x80497e[_0x1948('0x30')][_0x1948('0x1c')]);_0x4cf3f8[_0x1948('0x1a')]=qs['offset'](_0x80497e[_0x1948('0x30')][_0x1948('0x1a')]);}_0x4cf3f8[_0x1948('0x36')]=qs[_0x1948('0x37')](_0x80497e[_0x1948('0x30')][_0x1948('0x37')]);_0x4cf3f8['where']=qs[_0x1948('0x2e')](_[_0x1948('0x38')](_0x80497e[_0x1948('0x30')],_0x297d93['filters']),_0x55931d);if(_0x80497e[_0x1948('0x30')]['filter']){_0x4cf3f8[_0x1948('0x39')]=_[_0x1948('0x3a')](_0x4cf3f8['where'],{'$or':_[_0x1948('0x2c')](_0x55931d,function(_0x204496){if(_0x204496['type']!==_0x1948('0x3b')){var _0x2856f3={};_0x2856f3[_0x204496[_0x1948('0x27')]]={'$like':'%'+_0x80497e[_0x1948('0x30')][_0x1948('0x3c')]+'%'};return _0x2856f3;}})});}_0x4cf3f8=_[_0x1948('0x3a')]({},_0x4cf3f8,_0x80497e[_0x1948('0x3d')]);var _0x401cbb={'where':_0x4cf3f8[_0x1948('0x39')]};return db[_0x1948('0x29')][_0x1948('0x1d')](_0x401cbb)[_0x1948('0x23')](function(_0x4495d2){_0x52729c[_0x1948('0x1d')]=_0x4495d2;if(_0x80497e['query']['includeAll']){_0x4cf3f8[_0x1948('0x3e')]=[{'all':!![]}];}return db[_0x1948('0x29')][_0x1948('0x3f')](_0x4cf3f8);})['then'](function(_0x2a3f07){_0x52729c['rows']=_0x2a3f07;return _0x52729c;})[_0x1948('0x23')](respondWithFilteredResult(_0x53f0ed,_0x4cf3f8))[_0x1948('0x40')](handleError(_0x53f0ed,null));};exports['show']=function(_0x3ad42b,_0x19b5b4){var _0x93144={'raw':!![],'where':{'id':_0x3ad42b['params']['id']}},_0x32f9f7={};_0x32f9f7[_0x1948('0x2f')]=_['keys'](db['Dynamics365Field'][_0x1948('0x41')]);_0x32f9f7[_0x1948('0x30')]=_[_0x1948('0x2d')](_0x3ad42b[_0x1948('0x30')]);_0x32f9f7[_0x1948('0x2e')]=_[_0x1948('0x32')](_0x32f9f7[_0x1948('0x2f')],_0x32f9f7[_0x1948('0x30')]);_0x93144['attributes']=_[_0x1948('0x32')](_0x32f9f7[_0x1948('0x2f')],qs[_0x1948('0x33')](_0x3ad42b[_0x1948('0x30')]['fields']));_0x93144['attributes']=_0x93144[_0x1948('0x31')][_0x1948('0x34')]?_0x93144['attributes']:_0x32f9f7[_0x1948('0x2f')];if(_0x3ad42b['query'][_0x1948('0x42')]){_0x93144['include']=[{'all':!![]}];}_0x93144=_[_0x1948('0x3a')]({},_0x93144,_0x3ad42b[_0x1948('0x3d')]);return db[_0x1948('0x29')][_0x1948('0x43')](_0x93144)[_0x1948('0x23')](handleEntityNotFound(_0x19b5b4,null))['then'](respondWithResult(_0x19b5b4,null))['catch'](handleError(_0x19b5b4,null));};exports['create']=function(_0x4ff4f8,_0x3e564b){return db[_0x1948('0x29')][_0x1948('0x44')](_0x4ff4f8['body'],{})[_0x1948('0x23')](respondWithResult(_0x3e564b,0xc9))[_0x1948('0x40')](handleError(_0x3e564b,null));};exports[_0x1948('0x22')]=function(_0x514f55,_0x4652e2){if(_0x514f55['body']['id']){delete _0x514f55[_0x1948('0x45')]['id'];}return db[_0x1948('0x29')][_0x1948('0x43')]({'where':{'id':_0x514f55[_0x1948('0x46')]['id']}})['then'](handleEntityNotFound(_0x4652e2,null))[_0x1948('0x23')](saveUpdates(_0x514f55[_0x1948('0x45')],null))[_0x1948('0x23')](respondWithResult(_0x4652e2,null))[_0x1948('0x40')](handleError(_0x4652e2,null));};exports['destroy']=function(_0x305a75,_0x205398){return db[_0x1948('0x29')][_0x1948('0x43')]({'where':{'id':_0x305a75[_0x1948('0x46')]['id']}})[_0x1948('0x23')](handleEntityNotFound(_0x205398,null))[_0x1948('0x23')](removeEntity(_0x205398,null))[_0x1948('0x40')](handleError(_0x205398,null));}; \ No newline at end of file +var _0x1b03=['where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Field','then','includeAll','include','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','reject','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x5b8c15,_0x31b66e){var _0x593243=function(_0xd68421){while(--_0xd68421){_0x5b8c15['push'](_0x5b8c15['shift']());}};_0x593243(++_0x31b66e);}(_0x1b03,0x16c));var _0x31b0=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x1b03[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x31b0('0x0'));var rimraf=require(_0x31b0('0x1'));var zipdir=require(_0x31b0('0x2'));var jsonpatch=require(_0x31b0('0x3'));var rp=require(_0x31b0('0x4'));var moment=require(_0x31b0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31b0('0x6'));var path=require(_0x31b0('0x7'));var sox=require(_0x31b0('0x8'));var csv=require(_0x31b0('0x9'));var ejs=require(_0x31b0('0xa'));var fs=require('fs');var fs_extra=require(_0x31b0('0xb'));var _=require('lodash');var squel=require(_0x31b0('0xc'));var crypto=require('crypto');var jsforce=require(_0x31b0('0xd'));var deskjs=require(_0x31b0('0xe'));var toCsv=require(_0x31b0('0x9'));var querystring=require(_0x31b0('0xf'));var Papa=require(_0x31b0('0x10'));var Redis=require('ioredis');var authService=require(_0x31b0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x31b0('0x12'));var licenseUtil=require(_0x31b0('0x13'));var db=require(_0x31b0('0x14'))['db'];function respondWithStatusCode(_0x47d52f,_0x61f56a){_0x61f56a=_0x61f56a||0xcc;return function(_0x2667c6){if(_0x2667c6){return _0x47d52f['sendStatus'](_0x61f56a);}return _0x47d52f['status'](_0x61f56a)[_0x31b0('0x15')]();};}function respondWithResult(_0x2125b0,_0x21c13e){_0x21c13e=_0x21c13e||0xc8;return function(_0x52e77b){if(_0x52e77b){return _0x2125b0[_0x31b0('0x16')](_0x21c13e)[_0x31b0('0x17')](_0x52e77b);}};}function respondWithFilteredResult(_0x335cb8,_0x373419){return function(_0x223eb5){if(_0x223eb5){var _0x19db77=typeof _0x373419[_0x31b0('0x18')]===_0x31b0('0x19')&&typeof _0x373419[_0x31b0('0x1a')]===_0x31b0('0x19');var _0x445eb2=_0x223eb5[_0x31b0('0x1b')];var _0x5d3e64=_0x19db77?0x0:_0x373419[_0x31b0('0x18')];var _0x408e03=_0x19db77?_0x223eb5[_0x31b0('0x1b')]:_0x373419[_0x31b0('0x18')]+_0x373419['limit'];var _0x426aeb;if(_0x408e03>=_0x445eb2){_0x408e03=_0x445eb2;_0x426aeb=0xc8;}else{_0x426aeb=0xce;}_0x335cb8[_0x31b0('0x16')](_0x426aeb);return _0x335cb8['set'](_0x31b0('0x1c'),_0x5d3e64+'-'+_0x408e03+'/'+_0x445eb2)['json'](_0x223eb5);}return null;};}function patchUpdates(_0x562e62){return function(_0x271486){try{jsonpatch['apply'](_0x271486,_0x562e62,!![]);}catch(_0x3909ee){return BPromise[_0x31b0('0x1d')](_0x3909ee);}return _0x271486['save']();};}function saveUpdates(_0xa11576,_0x1fd19c){return function(_0x4a80bb){if(_0x4a80bb){return _0x4a80bb['update'](_0xa11576)['then'](function(_0x30312b){return _0x30312b;});}return null;};}function removeEntity(_0x510bd7,_0x147cfc){return function(_0x57d9c6){if(_0x57d9c6){return _0x57d9c6[_0x31b0('0x1e')]()['then'](function(){_0x510bd7['status'](0xcc)[_0x31b0('0x15')]();});}};}function handleEntityNotFound(_0x310b09,_0x51e515){return function(_0x525432){if(!_0x525432){_0x310b09[_0x31b0('0x1f')](0x194);}return _0x525432;};}function handleError(_0x454d53,_0x6a9c2){_0x6a9c2=_0x6a9c2||0x1f4;return function(_0x17e6d4){logger['error'](_0x17e6d4[_0x31b0('0x20')]);if(_0x17e6d4[_0x31b0('0x21')]){delete _0x17e6d4[_0x31b0('0x21')];}_0x454d53[_0x31b0('0x16')](_0x6a9c2)[_0x31b0('0x22')](_0x17e6d4);};}exports[_0x31b0('0x23')]=function(_0x150a9b,_0x4238af){var _0xd2c15b={},_0x3f8bcc={},_0x4ee77e={'count':0x0,'rows':[]};var _0x594824=_[_0x31b0('0x24')](db['Dynamics365Field'][_0x31b0('0x25')],function(_0x58da3c){return{'name':_0x58da3c[_0x31b0('0x26')],'type':_0x58da3c[_0x31b0('0x27')][_0x31b0('0x28')]};});_0x3f8bcc[_0x31b0('0x29')]=_['map'](_0x594824,_0x31b0('0x21'));_0x3f8bcc[_0x31b0('0x2a')]=_['keys'](_0x150a9b['query']);_0x3f8bcc['filters']=_[_0x31b0('0x2b')](_0x3f8bcc['model'],_0x3f8bcc[_0x31b0('0x2a')]);_0xd2c15b[_0x31b0('0x2c')]=_['intersection'](_0x3f8bcc[_0x31b0('0x29')],qs[_0x31b0('0x2d')](_0x150a9b[_0x31b0('0x2a')]['fields']));_0xd2c15b[_0x31b0('0x2c')]=_0xd2c15b[_0x31b0('0x2c')][_0x31b0('0x2e')]?_0xd2c15b[_0x31b0('0x2c')]:_0x3f8bcc[_0x31b0('0x29')];if(!_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x2f')](_0x31b0('0x30'))){_0xd2c15b[_0x31b0('0x1a')]=qs[_0x31b0('0x1a')](_0x150a9b['query'][_0x31b0('0x1a')]);_0xd2c15b[_0x31b0('0x18')]=qs['offset'](_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x18')]);}_0xd2c15b['order']=qs[_0x31b0('0x31')](_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x31')]);_0xd2c15b[_0x31b0('0x32')]=qs[_0x31b0('0x33')](_[_0x31b0('0x34')](_0x150a9b[_0x31b0('0x2a')],_0x3f8bcc['filters']),_0x594824);if(_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x35')]){_0xd2c15b[_0x31b0('0x32')]=_[_0x31b0('0x36')](_0xd2c15b[_0x31b0('0x32')],{'$or':_[_0x31b0('0x24')](_0x594824,function(_0x351e49){if(_0x351e49[_0x31b0('0x27')]!==_0x31b0('0x37')){var _0x23ddc1={};_0x23ddc1[_0x351e49[_0x31b0('0x21')]]={'$like':'%'+_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x35')]+'%'};return _0x23ddc1;}})});}_0xd2c15b=_[_0x31b0('0x36')]({},_0xd2c15b,_0x150a9b[_0x31b0('0x38')]);var _0x3df46e={'where':_0xd2c15b[_0x31b0('0x32')]};return db[_0x31b0('0x39')]['count'](_0x3df46e)[_0x31b0('0x3a')](function(_0x5cd7a1){_0x4ee77e[_0x31b0('0x1b')]=_0x5cd7a1;if(_0x150a9b[_0x31b0('0x2a')][_0x31b0('0x3b')]){_0xd2c15b[_0x31b0('0x3c')]=[{'all':!![]}];}return db[_0x31b0('0x39')]['findAll'](_0xd2c15b);})[_0x31b0('0x3a')](function(_0x1bb886){_0x4ee77e['rows']=_0x1bb886;return _0x4ee77e;})[_0x31b0('0x3a')](respondWithFilteredResult(_0x4238af,_0xd2c15b))[_0x31b0('0x3d')](handleError(_0x4238af,null));};exports[_0x31b0('0x3e')]=function(_0x5241eb,_0x25ef2a){var _0x5ecf51={'raw':!![],'where':{'id':_0x5241eb[_0x31b0('0x3f')]['id']}},_0x1dbe6c={};_0x1dbe6c[_0x31b0('0x29')]=_[_0x31b0('0x40')](db[_0x31b0('0x39')][_0x31b0('0x25')]);_0x1dbe6c['query']=_[_0x31b0('0x40')](_0x5241eb[_0x31b0('0x2a')]);_0x1dbe6c[_0x31b0('0x33')]=_[_0x31b0('0x2b')](_0x1dbe6c['model'],_0x1dbe6c[_0x31b0('0x2a')]);_0x5ecf51[_0x31b0('0x2c')]=_[_0x31b0('0x2b')](_0x1dbe6c[_0x31b0('0x29')],qs[_0x31b0('0x2d')](_0x5241eb['query'][_0x31b0('0x2d')]));_0x5ecf51[_0x31b0('0x2c')]=_0x5ecf51[_0x31b0('0x2c')]['length']?_0x5ecf51[_0x31b0('0x2c')]:_0x1dbe6c[_0x31b0('0x29')];if(_0x5241eb['query'][_0x31b0('0x3b')]){_0x5ecf51[_0x31b0('0x3c')]=[{'all':!![]}];}_0x5ecf51=_['merge']({},_0x5ecf51,_0x5241eb[_0x31b0('0x38')]);return db[_0x31b0('0x39')][_0x31b0('0x41')](_0x5ecf51)[_0x31b0('0x3a')](handleEntityNotFound(_0x25ef2a,null))[_0x31b0('0x3a')](respondWithResult(_0x25ef2a,null))[_0x31b0('0x3d')](handleError(_0x25ef2a,null));};exports[_0x31b0('0x42')]=function(_0x4b2929,_0x54ff73){return db[_0x31b0('0x39')][_0x31b0('0x42')](_0x4b2929[_0x31b0('0x43')],{})[_0x31b0('0x3a')](respondWithResult(_0x54ff73,0xc9))[_0x31b0('0x3d')](handleError(_0x54ff73,null));};exports[_0x31b0('0x44')]=function(_0x5ec743,_0x5f491b){if(_0x5ec743[_0x31b0('0x43')]['id']){delete _0x5ec743[_0x31b0('0x43')]['id'];}return db['Dynamics365Field'][_0x31b0('0x41')]({'where':{'id':_0x5ec743[_0x31b0('0x3f')]['id']}})[_0x31b0('0x3a')](handleEntityNotFound(_0x5f491b,null))[_0x31b0('0x3a')](saveUpdates(_0x5ec743[_0x31b0('0x43')],null))[_0x31b0('0x3a')](respondWithResult(_0x5f491b,null))[_0x31b0('0x3d')](handleError(_0x5f491b,null));};exports[_0x31b0('0x1e')]=function(_0x3d0129,_0x50c67e){return db[_0x31b0('0x39')][_0x31b0('0x41')]({'where':{'id':_0x3d0129[_0x31b0('0x3f')]['id']}})[_0x31b0('0x3a')](handleEntityNotFound(_0x50c67e,null))[_0x31b0('0x3a')](removeEntity(_0x50c67e,null))[_0x31b0('0x3d')](handleError(_0x50c67e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 166af33..9d3bb89 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 _0x60b8=['dynamics365_unique_index','FieldId','util','../../config/logger','api','moment','request-promise','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x60b8,0x1bc));var _0x860b=function(_0x235323,_0x26096a){_0x235323=_0x235323-0x0;var _0x5f37da=_0x60b8[_0x235323];return _0x5f37da;};'use strict';var _=require('lodash');var util=require(_0x860b('0x0'));var logger=require(_0x860b('0x1'))(_0x860b('0x2'));var moment=require(_0x860b('0x3'));var BPromise=require('bluebird');var rp=require(_0x860b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x860b('0x5'));var config=require('../../config/environment');var attributes=require(_0x860b('0x6'));module[_0x860b('0x7')]=function(_0x4a65e6,_0x4a4c6d){return _0x4a65e6[_0x860b('0x8')](_0x860b('0x9'),attributes,{'tableName':_0x860b('0xa'),'paranoid':![],'indexes':[{'name':_0x860b('0xb'),'fields':['idField',_0x860b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x157e=['int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','./intDynamics365Field.attributes','Dynamics365Field'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x157e,0x149));var _0xe157=function(_0x87e0dc,_0x577dce){_0x87e0dc=_0x87e0dc-0x0;var _0x2cd2d1=_0x157e[_0x87e0dc];return _0x2cd2d1;};'use strict';var _=require(_0xe157('0x0'));var util=require(_0xe157('0x1'));var logger=require(_0xe157('0x2'))(_0xe157('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe157('0x4'));var fs=require('fs');var path=require(_0xe157('0x5'));var rimraf=require(_0xe157('0x6'));var config=require('../../config/environment');var attributes=require(_0xe157('0x7'));module['exports']=function(_0x364edf,_0x2c9570){return _0x364edf['define'](_0xe157('0x8'),attributes,{'tableName':_0xe157('0x9'),'paranoid':![],'indexes':[{'name':_0xe157('0xa'),'fields':[_0xe157('0xb'),_0xe157('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 06ef5f5..605642c 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 _0x4781=['Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0xbab899,_0x4b734e){var _0x1e7712=function(_0x59b5fb){while(--_0x59b5fb){_0xbab899['push'](_0xbab899['shift']());}};_0x1e7712(++_0x4b734e);}(_0x4781,0x172));var _0x1478=function(_0x302b68,_0x284f81){_0x302b68=_0x302b68-0x0;var _0x2bf1b4=_0x4781[_0x302b68];return _0x2bf1b4;};'use strict';var _=require('lodash');var util=require(_0x1478('0x0'));var moment=require(_0x1478('0x1'));var BPromise=require(_0x1478('0x2'));var rs=require(_0x1478('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1478('0x4'))['db'];var utils=require(_0x1478('0x5'));var logger=require('../../config/logger')(_0x1478('0x6'));var config=require(_0x1478('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1478('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52b4b6,_0x4fc7de,_0x355d7e){return new BPromise(function(_0xb20c2b,_0x1c3abd){return client[_0x1478('0x9')](_0x52b4b6,_0x355d7e)['then'](function(_0x3f23a9){logger['info'](_0x1478('0xa'),_0x4fc7de,'request\x20sent');logger[_0x1478('0xb')](_0x1478('0xc'),_0x4fc7de,_0x1478('0xd'),JSON[_0x1478('0xe')](_0x3f23a9));if(_0x3f23a9[_0x1478('0xf')]){if(_0x3f23a9[_0x1478('0xf')][_0x1478('0x10')]===0x1f4){logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x3f23a9[_0x1478('0xf')][_0x1478('0x11')]);return _0x1c3abd(_0x3f23a9['error'][_0x1478('0x11')]);}logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x3f23a9[_0x1478('0xf')]['message']);return _0xb20c2b(_0x3f23a9[_0x1478('0xf')][_0x1478('0x11')]);}else{logger['info'](_0x1478('0xa'),_0x4fc7de,'request\x20sent');_0xb20c2b(_0x3f23a9['result']['message']);}})[_0x1478('0x12')](function(_0x5e058d){logger[_0x1478('0xf')](_0x1478('0xa'),_0x4fc7de,_0x5e058d);_0x1c3abd(_0x5e058d);});});} \ No newline at end of file +var _0x209f=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x1ea8dc,_0x43c2a5){var _0x2f9abf=function(_0x39658b){while(--_0x39658b){_0x1ea8dc['push'](_0x1ea8dc['shift']());}};_0x2f9abf(++_0x43c2a5);}(_0x209f,0x18b));var _0xf209=function(_0xb5806c,_0x5593cc){_0xb5806c=_0xb5806c-0x0;var _0x3e4fe7=_0x209f[_0xb5806c];return _0x3e4fe7;};'use strict';var _=require(_0xf209('0x0'));var util=require(_0xf209('0x1'));var moment=require(_0xf209('0x2'));var BPromise=require(_0xf209('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf209('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf209('0x5'));var logger=require('../../config/logger')(_0xf209('0x6'));var config=require(_0xf209('0x7'));var jayson=require(_0xf209('0x8'));var client=jayson[_0xf209('0x9')][_0xf209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ede0,_0x637806,_0xeab809){return new BPromise(function(_0x1edf25,_0x4f5e64){return client[_0xf209('0xb')](_0x45ede0,_0xeab809)[_0xf209('0xc')](function(_0x5b5e96){logger[_0xf209('0xd')](_0xf209('0xe'),_0x637806,_0xf209('0xf'));logger['debug'](_0xf209('0x10'),_0x637806,'request\x20sent',JSON[_0xf209('0x11')](_0x5b5e96));if(_0x5b5e96[_0xf209('0x12')]){if(_0x5b5e96[_0xf209('0x12')][_0xf209('0x13')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x637806,_0x5b5e96[_0xf209('0x12')][_0xf209('0x14')]);return _0x4f5e64(_0x5b5e96[_0xf209('0x12')]['message']);}logger[_0xf209('0x12')](_0xf209('0xe'),_0x637806,_0x5b5e96[_0xf209('0x12')][_0xf209('0x14')]);return _0x1edf25(_0x5b5e96['error'][_0xf209('0x14')]);}else{logger[_0xf209('0xd')](_0xf209('0xe'),_0x637806,'request\x20sent');_0x1edf25(_0x5b5e96['result'][_0xf209('0x14')]);}})[_0xf209('0x15')](function(_0x2e0206){logger[_0xf209('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x637806,_0x2e0206);_0x4f5e64(_0x2e0206);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 60eab34..e356a95 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 _0x3f01=['/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete'];(function(_0x2094b5,_0x54c8ae){var _0x2edab9=function(_0x395898){while(--_0x395898){_0x2094b5['push'](_0x2094b5['shift']());}};_0x2edab9(++_0x54c8ae);}(_0x3f01,0x18f));var _0x13f0=function(_0x1ae2b9,_0x1eaf30){_0x1ae2b9=_0x1ae2b9-0x0;var _0x587a19=_0x3f01[_0x1ae2b9];return _0x587a19;};'use strict';var multer=require(_0x13f0('0x0'));var util=require('util');var path=require(_0x13f0('0x1'));var timeout=require(_0x13f0('0x2'));var express=require(_0x13f0('0x3'));var router=express['Router']();var fs_extra=require(_0x13f0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13f0('0x5'));var controller=require(_0x13f0('0x6'));router[_0x13f0('0x7')]('/',auth[_0x13f0('0x8')](),controller['index']);router[_0x13f0('0x7')]('/:id',auth[_0x13f0('0x8')](),controller[_0x13f0('0x9')]);router['get'](_0x13f0('0xa'),auth[_0x13f0('0x8')](),controller[_0x13f0('0xb')]);router[_0x13f0('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x13f0('0xc')]);router['post']('/',auth[_0x13f0('0x8')](),controller[_0x13f0('0xd')]);router[_0x13f0('0xe')](_0x13f0('0xa'),auth['isAuthenticated'](),controller[_0x13f0('0xf')]);router[_0x13f0('0x10')]('/:id',auth[_0x13f0('0x8')](),controller[_0x13f0('0x11')]);router[_0x13f0('0x12')](_0x13f0('0x13'),auth[_0x13f0('0x8')](),controller[_0x13f0('0x14')]);module[_0x13f0('0x15')]=router; \ No newline at end of file +var _0x6550=['post','/:id/configurations','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x49b3d5,_0x55d024){var _0x17a0e8=function(_0x58b48c){while(--_0x58b48c){_0x49b3d5['push'](_0x49b3d5['shift']());}};_0x17a0e8(++_0x55d024);}(_0x6550,0x156));var _0x0655=function(_0x193a0c,_0x20e4b0){_0x193a0c=_0x193a0c-0x0;var _0x371d3f=_0x6550[_0x193a0c];return _0x371d3f;};'use strict';var multer=require('multer');var util=require(_0x0655('0x0'));var path=require('path');var timeout=require(_0x0655('0x1'));var express=require('express');var router=express[_0x0655('0x2')]();var fs_extra=require(_0x0655('0x3'));var auth=require(_0x0655('0x4'));var interaction=require(_0x0655('0x5'));var config=require(_0x0655('0x6'));var controller=require(_0x0655('0x7'));router[_0x0655('0x8')]('/',auth[_0x0655('0x9')](),controller['index']);router[_0x0655('0x8')](_0x0655('0xa'),auth['isAuthenticated'](),controller[_0x0655('0xb')]);router[_0x0655('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0655('0xc')]);router[_0x0655('0x8')](_0x0655('0xd'),auth[_0x0655('0x9')](),controller[_0x0655('0xe')]);router[_0x0655('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0655('0xf')](_0x0655('0x10'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x0655('0x11')]('/:id',auth[_0x0655('0x9')](),controller[_0x0655('0x12')]);router[_0x0655('0x13')](_0x0655('0xa'),auth['isAuthenticated'](),controller[_0x0655('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 9feb89d..be53395 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 _0xd117=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5ace1f,_0x50e292){var _0x3ed55b=function(_0x1cb843){while(--_0x1cb843){_0x5ace1f['push'](_0x5ace1f['shift']());}};_0x3ed55b(++_0x50e292);}(_0xd117,0x182));var _0x7d11=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0xd117[_0x1304c6];return _0x2e6654;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'apiKey':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa30a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x3a01f5,_0x33cb85){var _0x5cb35b=function(_0x58441e){while(--_0x58441e){_0x3a01f5['push'](_0x3a01f5['shift']());}};_0x5cb35b(++_0x33cb85);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x3')},'apiKey':{'type':Sequelize[_0xaa30('0x2')]},'remoteUri':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x4')},'serverUrl':{'type':Sequelize[_0xaa30('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 8496b40..9ef2f35 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 _0x9234=['error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','lastIndexOf','%s/%s','Basic\x20%s','format','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9234,0x1bd));var _0x4923=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x9234[_0xb0de07];return _0x4633d8;};'use strict';var emlformat=require(_0x4923('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4923('0x1'));var jsonpatch=require(_0x4923('0x2'));var rp=require(_0x4923('0x3'));var moment=require(_0x4923('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4923('0x5'));var util=require(_0x4923('0x6'));var path=require('path');var sox=require(_0x4923('0x7'));var csv=require(_0x4923('0x8'));var ejs=require(_0x4923('0x9'));var fs=require('fs');var fs_extra=require(_0x4923('0xa'));var _=require(_0x4923('0xb'));var squel=require(_0x4923('0xc'));var crypto=require(_0x4923('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4923('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4923('0xf'));var Papa=require(_0x4923('0x10'));var Redis=require(_0x4923('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4923('0x12'));var as=require(_0x4923('0x13'));var hardwareService=require(_0x4923('0x14'));var logger=require(_0x4923('0x15'))(_0x4923('0x16'));var utils=require(_0x4923('0x17'));var config=require(_0x4923('0x18'));var licenseUtil=require(_0x4923('0x19'));var db=require(_0x4923('0x1a'))['db'];var integrations=require(_0x4923('0x1b'));function respondWithStatusCode(_0x5b950f,_0x4d6fda){_0x4d6fda=_0x4d6fda||0xcc;return function(_0x292799){if(_0x292799){return _0x5b950f[_0x4923('0x1c')](_0x4d6fda);}return _0x5b950f[_0x4923('0x1d')](_0x4d6fda)['end']();};}function respondWithResult(_0x31a469,_0x27a52b){_0x27a52b=_0x27a52b||0xc8;return function(_0x191257){if(_0x191257){return _0x31a469[_0x4923('0x1d')](_0x27a52b)[_0x4923('0x1e')](_0x191257);}};}function respondWithFilteredResult(_0x29a354,_0x1f8375){return function(_0x2897da){if(_0x2897da){var _0x2e9944=typeof _0x1f8375[_0x4923('0x1f')]==='undefined'&&typeof _0x1f8375[_0x4923('0x20')]===_0x4923('0x21');var _0x5dbb86=_0x2897da[_0x4923('0x22')];var _0x517b95=_0x2e9944?0x0:_0x1f8375['offset'];var _0x16955b=_0x2e9944?_0x2897da['count']:_0x1f8375[_0x4923('0x1f')]+_0x1f8375[_0x4923('0x20')];var _0x5dbddb;if(_0x16955b>=_0x5dbb86){_0x16955b=_0x5dbb86;_0x5dbddb=0xc8;}else{_0x5dbddb=0xce;}_0x29a354[_0x4923('0x1d')](_0x5dbddb);return _0x29a354[_0x4923('0x23')](_0x4923('0x24'),_0x517b95+'-'+_0x16955b+'/'+_0x5dbb86)[_0x4923('0x1e')](_0x2897da);}return null;};}function patchUpdates(_0x528b6b){return function(_0x3742d0){try{jsonpatch[_0x4923('0x25')](_0x3742d0,_0x528b6b,!![]);}catch(_0x5f4d43){return BPromise[_0x4923('0x26')](_0x5f4d43);}return _0x3742d0['save']();};}function saveUpdates(_0x3de8f5,_0x168bb4){return function(_0x569b36){if(_0x569b36){return _0x569b36[_0x4923('0x27')](_0x3de8f5)[_0x4923('0x28')](function(_0x2eb1b7){return _0x2eb1b7;});}return null;};}function removeEntity(_0x161cf9,_0x3aaede){return function(_0x8a09e7){if(_0x8a09e7){return _0x8a09e7[_0x4923('0x29')]()['then'](function(){_0x161cf9['status'](0xcc)[_0x4923('0x2a')]();});}};}function handleEntityNotFound(_0x36cc38,_0xdb893b){return function(_0x32d508){if(!_0x32d508){_0x36cc38[_0x4923('0x1c')](0x194);}return _0x32d508;};}function handleError(_0x4473a3,_0x13681b){_0x13681b=_0x13681b||0x1f4;return function(_0x2c2a66){logger[_0x4923('0x2b')](_0x2c2a66[_0x4923('0x2c')]);if(_0x2c2a66[_0x4923('0x2d')]){delete _0x2c2a66['name'];}_0x4473a3[_0x4923('0x1d')](_0x13681b)[_0x4923('0x2e')](_0x2c2a66);};}exports[_0x4923('0x2f')]=function(_0x39decd,_0x21c229){var _0x47158c={},_0x158a30={},_0x7a97f3={'count':0x0,'rows':[]};var _0xb88ca4=_[_0x4923('0x30')](db[_0x4923('0x31')][_0x4923('0x32')],function(_0x140ecb){return{'name':_0x140ecb[_0x4923('0x33')],'type':_0x140ecb['type'][_0x4923('0x34')]};});_0x158a30[_0x4923('0x35')]=_[_0x4923('0x30')](_0xb88ca4,_0x4923('0x2d'));_0x158a30[_0x4923('0x36')]=_[_0x4923('0x37')](_0x39decd[_0x4923('0x36')]);_0x158a30[_0x4923('0x38')]=_['intersection'](_0x158a30['model'],_0x158a30[_0x4923('0x36')]);_0x47158c['attributes']=_['intersection'](_0x158a30['model'],qs[_0x4923('0x39')](_0x39decd[_0x4923('0x36')][_0x4923('0x39')]));_0x47158c[_0x4923('0x3a')]=_0x47158c['attributes'][_0x4923('0x3b')]?_0x47158c['attributes']:_0x158a30[_0x4923('0x35')];if(!_0x39decd[_0x4923('0x36')][_0x4923('0x3c')](_0x4923('0x3d'))){_0x47158c[_0x4923('0x20')]=qs['limit'](_0x39decd[_0x4923('0x36')]['limit']);_0x47158c['offset']=qs[_0x4923('0x1f')](_0x39decd[_0x4923('0x36')][_0x4923('0x1f')]);}_0x47158c[_0x4923('0x3e')]=qs[_0x4923('0x3f')](_0x39decd[_0x4923('0x36')][_0x4923('0x3f')]);_0x47158c['where']=qs[_0x4923('0x38')](_['pick'](_0x39decd['query'],_0x158a30[_0x4923('0x38')]),_0xb88ca4);if(_0x39decd[_0x4923('0x36')]['filter']){_0x47158c[_0x4923('0x40')]=_[_0x4923('0x41')](_0x47158c['where'],{'$or':_['map'](_0xb88ca4,function(_0x999016){if(_0x999016[_0x4923('0x42')]!=='VIRTUAL'){var _0x51cb0e={};_0x51cb0e[_0x999016[_0x4923('0x2d')]]={'$like':'%'+_0x39decd[_0x4923('0x36')][_0x4923('0x43')]+'%'};return _0x51cb0e;}})});}_0x47158c=_[_0x4923('0x41')]({},_0x47158c,_0x39decd[_0x4923('0x44')]);var _0x524057={'where':_0x47158c[_0x4923('0x40')]};return db[_0x4923('0x31')]['count'](_0x524057)[_0x4923('0x28')](function(_0x5c419d){_0x7a97f3[_0x4923('0x22')]=_0x5c419d;if(_0x39decd[_0x4923('0x36')]['includeAll']){_0x47158c[_0x4923('0x45')]=[{'all':!![]}];}return db[_0x4923('0x31')][_0x4923('0x46')](_0x47158c);})[_0x4923('0x28')](function(_0x2e25c6){_0x7a97f3[_0x4923('0x47')]=_0x2e25c6;return _0x7a97f3;})['then'](respondWithFilteredResult(_0x21c229,_0x47158c))[_0x4923('0x48')](handleError(_0x21c229,null));};exports[_0x4923('0x49')]=function(_0x53d37e,_0x2a7355){var _0x4de4d0={'raw':![],'where':{'id':_0x53d37e[_0x4923('0x4a')]['id']}},_0x147d0d={};_0x147d0d[_0x4923('0x35')]=_[_0x4923('0x37')](db[_0x4923('0x31')][_0x4923('0x32')]);_0x147d0d[_0x4923('0x36')]=_[_0x4923('0x37')](_0x53d37e['query']);_0x147d0d[_0x4923('0x38')]=_[_0x4923('0x4b')](_0x147d0d[_0x4923('0x35')],_0x147d0d[_0x4923('0x36')]);_0x4de4d0[_0x4923('0x3a')]=_[_0x4923('0x4b')](_0x147d0d[_0x4923('0x35')],qs[_0x4923('0x39')](_0x53d37e[_0x4923('0x36')]['fields']));_0x4de4d0[_0x4923('0x3a')]=_0x4de4d0[_0x4923('0x3a')]['length']?_0x4de4d0[_0x4923('0x3a')]:_0x147d0d[_0x4923('0x35')];if(_0x53d37e[_0x4923('0x36')][_0x4923('0x4c')]){_0x4de4d0[_0x4923('0x45')]=[{'all':!![]}];}_0x4de4d0=_[_0x4923('0x41')]({},_0x4de4d0,_0x53d37e[_0x4923('0x44')]);return db[_0x4923('0x31')][_0x4923('0x4d')](_0x4de4d0)['then'](handleEntityNotFound(_0x2a7355,null))['then'](respondWithResult(_0x2a7355,null))['catch'](handleError(_0x2a7355,null));};exports[_0x4923('0x4e')]=function(_0x58c1c7,_0x239777){return db['FreshdeskAccount'][_0x4923('0x4e')](_0x58c1c7[_0x4923('0x4f')],{})[_0x4923('0x28')](respondWithResult(_0x239777,0xc9))[_0x4923('0x48')](handleError(_0x239777,null));};exports[_0x4923('0x27')]=function(_0x444b99,_0x34ebdf){if(_0x444b99[_0x4923('0x4f')]['id']){delete _0x444b99['body']['id'];}return db[_0x4923('0x31')][_0x4923('0x4d')]({'where':{'id':_0x444b99[_0x4923('0x4a')]['id']}})[_0x4923('0x28')](handleEntityNotFound(_0x34ebdf,null))[_0x4923('0x28')](saveUpdates(_0x444b99[_0x4923('0x4f')],null))[_0x4923('0x28')](respondWithResult(_0x34ebdf,null))[_0x4923('0x48')](handleError(_0x34ebdf,null));};exports['destroy']=function(_0x218f49,_0x282201){return db[_0x4923('0x31')][_0x4923('0x4d')]({'where':{'id':_0x218f49['params']['id']}})[_0x4923('0x28')](handleEntityNotFound(_0x282201,null))[_0x4923('0x28')](removeEntity(_0x282201,null))[_0x4923('0x48')](handleError(_0x282201,null));};exports[_0x4923('0x50')]=function(_0x43718e,_0x2ee03b,_0x1b9e94){var _0x562e38={};var _0x4527da={};var _0x48c2d4;var _0x4b73a6;return db[_0x4923('0x31')][_0x4923('0x51')]({'where':{'id':_0x43718e[_0x4923('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ee03b,null))[_0x4923('0x28')](function(_0x5cd6e4){if(_0x5cd6e4){_0x48c2d4=_0x5cd6e4;_0x4527da[_0x4923('0x35')]=_['keys'](db[_0x4923('0x52')][_0x4923('0x32')]);_0x4527da[_0x4923('0x36')]=_[_0x4923('0x37')](_0x43718e[_0x4923('0x36')]);_0x4527da['filters']=_[_0x4923('0x4b')](_0x4527da[_0x4923('0x35')],_0x4527da[_0x4923('0x36')]);_0x562e38[_0x4923('0x3a')]=_[_0x4923('0x4b')](_0x4527da[_0x4923('0x35')],qs['fields'](_0x43718e[_0x4923('0x36')][_0x4923('0x39')]));_0x562e38[_0x4923('0x3a')]=_0x562e38[_0x4923('0x3a')][_0x4923('0x3b')]?_0x562e38[_0x4923('0x3a')]:_0x4527da[_0x4923('0x35')];_0x562e38['order']=qs[_0x4923('0x3f')](_0x43718e[_0x4923('0x36')][_0x4923('0x3f')]);_0x562e38[_0x4923('0x40')]=qs[_0x4923('0x38')](_[_0x4923('0x53')](_0x43718e[_0x4923('0x36')],_0x4527da['filters']));if(_0x43718e[_0x4923('0x36')][_0x4923('0x43')]){_0x562e38[_0x4923('0x40')]=_['merge'](_0x562e38[_0x4923('0x40')],{'$or':_[_0x4923('0x30')](_0x562e38['attributes'],function(_0x50efb9){var _0x219de2={};_0x219de2[_0x50efb9]={'$like':'%'+_0x43718e[_0x4923('0x36')][_0x4923('0x43')]+'%'};return _0x219de2;})});}_0x562e38=_[_0x4923('0x41')]({},_0x562e38,_0x43718e[_0x4923('0x44')]);return _0x48c2d4[_0x4923('0x50')](_0x562e38);}})[_0x4923('0x28')](function(_0x4d5e14){if(_0x4d5e14){_0x4b73a6=_0x4d5e14['length'];if(!_0x43718e[_0x4923('0x36')][_0x4923('0x3c')](_0x4923('0x3d'))){_0x562e38[_0x4923('0x20')]=qs[_0x4923('0x20')](_0x43718e['query'][_0x4923('0x20')]);_0x562e38[_0x4923('0x1f')]=qs[_0x4923('0x1f')](_0x43718e['query']['offset']);}return _0x48c2d4[_0x4923('0x50')](_0x562e38);}})[_0x4923('0x28')](function(_0x5be67b){if(_0x5be67b){return _0x5be67b?{'count':_0x4b73a6,'rows':_0x5be67b}:null;}})['then'](respondWithResult(_0x2ee03b,null))[_0x4923('0x48')](handleError(_0x2ee03b,null));};exports[_0x4923('0x54')]=function(_0x2a988f,_0x478fc3,_0x2ed5cb){if(_0x2a988f[_0x4923('0x4f')]['id']){delete _0x2a988f['body']['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2a988f[_0x4923('0x4a')]['id']}})['then'](handleEntityNotFound(_0x478fc3,null))[_0x4923('0x28')](function(_0xbfea42){if(_0xbfea42){_0x2a988f[_0x4923('0x4f')][_0x4923('0x55')]=_0xbfea42['id'];_0x2a988f[_0x4923('0x4f')][_0x4923('0x56')]=integrations[_0x4923('0x57')](_0x2a988f['body'][_0x4923('0x58')],_0x2a988f[_0x4923('0x4f')][_0x4923('0x42')]);_0x2a988f['body'][_0x4923('0x59')]=integrations[_0x4923('0x5a')](_0x2a988f['body'][_0x4923('0x58')],_0x2a988f[_0x4923('0x4f')][_0x4923('0x42')]);return db[_0x4923('0x52')]['create'](_0x2a988f[_0x4923('0x4f')],{'include':[{'model':db['FreshdeskField'],'as':_0x4923('0x56')},{'model':db[_0x4923('0x5b')],'as':'Descriptions'}]});}return null;})[_0x4923('0x28')](respondWithResult(_0x478fc3,null))['catch'](handleError(_0x478fc3,null));};exports[_0x4923('0x5c')]=function(_0x352d13,_0x476679,_0x536bb8){var _0x49e04a='';return db[_0x4923('0x31')]['findOne']({'where':{'id':_0x352d13['params']['id']},'attributes':['id',_0x4923('0x5d'),_0x4923('0x5e')]})[_0x4923('0x28')](handleEntityNotFound(_0x476679,null))[_0x4923('0x28')](function(_0x942cc8){if(_0x942cc8){_0x49e04a=_0x942cc8['remoteUri'];var _0x4b691b=_0x49e04a['slice'](-0x1);if(_0x4b691b==='/'){_0x49e04a=_0x49e04a['substring'](0x0,_0x49e04a[_0x4923('0x5f')](_0x4b691b));}return rp({'method':'GET','uri':util['format'](_0x4923('0x60'),_0x49e04a,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x4923('0x61'),new Buffer(util[_0x4923('0x62')](_0x4923('0x63'),_0x942cc8[_0x4923('0x5e')]))[_0x4923('0x64')](_0x4923('0x65')))},'json':!![]});}})[_0x4923('0x28')](function(_0x16a1a5){if(_0x16a1a5){var _0x12c22e=[_0x4923('0x66'),_0x4923('0x67'),_0x4923('0x68'),_0x4923('0x69'),_0x4923('0x1d'),_0x4923('0x6a'),_0x4923('0x6b'),_0x4923('0x6c'),'ticket_type','group',_0x4923('0x6d')];_[_0x4923('0x6e')](_0x16a1a5,function(_0x10e65c){return _0x12c22e[_0x4923('0x6f')](_0x10e65c[_0x4923('0x2d')])||!_0x10e65c[_0x4923('0x70')]&&_0x10e65c[_0x4923('0x42')]!==_0x4923('0x71')&&_0x10e65c['type']!==_0x4923('0x72');});return{'count':_0x16a1a5[_0x4923('0x3b')],'rows':_[_0x4923('0x30')](_0x16a1a5,function(_0x1ab966){return{'id':_0x1ab966[_0x4923('0x2d')],'name':_0x1ab966['label'],'custom':!_0x1ab966['default'],'options':_0x1ab966[_0x4923('0x73')]?_[_0x4923('0x30')](_0x1ab966[_0x4923('0x73')],function(_0x45778b){return{'name':_[_0x4923('0x74')](_0x45778b),'value':_0x45778b};}):[]};})};}})['then'](respondWithResult(_0x476679,null))[_0x4923('0x48')](function(_0x424b64){var _0x3ad1af=_0x352d13[_0x4923('0x36')][_0x4923('0x75')]?0x1f4:_0x424b64[_0x4923('0x76')]||0x1f4;logger[_0x4923('0x2b')](_0x4923('0x77'),_0x4923('0x5c'),_0x3ad1af,JSON[_0x4923('0x78')](_0x424b64));delete _0x424b64[_0x4923('0x2d')];if(_0x3ad1af===0x191){_0x3ad1af=0x190;}_0x476679[_0x4923('0x1d')](_0x3ad1af)[_0x4923('0x2e')](_0x352d13[_0x4923('0x36')][_0x4923('0x75')]?{'message':_0x4923('0x79'),'statusCode':_0x424b64[_0x4923('0x76')]}:_0x424b64);});}; \ No newline at end of file +var _0xc5cf=['lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskAccount','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','priority','source','ticket_type','group','company','includes','default','custom_text','custom_dropdown','choices','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x4dca7b,_0x5460b9){var _0x14bf60=function(_0x5a4bee){while(--_0x5a4bee){_0x4dca7b['push'](_0x4dca7b['shift']());}};_0x14bf60(++_0x5460b9);}(_0xc5cf,0x15b));var _0xfc5c=function(_0x52393d,_0x335ddb){_0x52393d=_0x52393d-0x0;var _0x2d8a2e=_0xc5cf[_0x52393d];return _0x2d8a2e;};'use strict';var emlformat=require(_0xfc5c('0x0'));var rimraf=require(_0xfc5c('0x1'));var zipdir=require(_0xfc5c('0x2'));var jsonpatch=require(_0xfc5c('0x3'));var rp=require(_0xfc5c('0x4'));var moment=require(_0xfc5c('0x5'));var BPromise=require(_0xfc5c('0x6'));var Mustache=require(_0xfc5c('0x7'));var util=require(_0xfc5c('0x8'));var path=require('path');var sox=require(_0xfc5c('0x9'));var csv=require(_0xfc5c('0xa'));var ejs=require(_0xfc5c('0xb'));var fs=require('fs');var fs_extra=require(_0xfc5c('0xc'));var _=require(_0xfc5c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc5c('0xe'));var toCsv=require(_0xfc5c('0xa'));var querystring=require(_0xfc5c('0xf'));var Papa=require(_0xfc5c('0x10'));var Redis=require('ioredis');var authService=require(_0xfc5c('0x11'));var qs=require(_0xfc5c('0x12'));var as=require(_0xfc5c('0x13'));var hardwareService=require(_0xfc5c('0x14'));var logger=require(_0xfc5c('0x15'))(_0xfc5c('0x16'));var utils=require(_0xfc5c('0x17'));var config=require(_0xfc5c('0x18'));var licenseUtil=require(_0xfc5c('0x19'));var db=require(_0xfc5c('0x1a'))['db'];var integrations=require(_0xfc5c('0x1b'));function respondWithStatusCode(_0x2cc07c,_0x139644){_0x139644=_0x139644||0xcc;return function(_0xe0e356){if(_0xe0e356){return _0x2cc07c[_0xfc5c('0x1c')](_0x139644);}return _0x2cc07c['status'](_0x139644)[_0xfc5c('0x1d')]();};}function respondWithResult(_0x570d2b,_0x25d9af){_0x25d9af=_0x25d9af||0xc8;return function(_0x440e3a){if(_0x440e3a){return _0x570d2b[_0xfc5c('0x1e')](_0x25d9af)['json'](_0x440e3a);}};}function respondWithFilteredResult(_0x30861f,_0x592f66){return function(_0x5ed8bd){if(_0x5ed8bd){var _0x5eb25b=typeof _0x592f66['offset']===_0xfc5c('0x1f')&&typeof _0x592f66['limit']===_0xfc5c('0x1f');var _0x4e2c18=_0x5ed8bd[_0xfc5c('0x20')];var _0x3b90f4=_0x5eb25b?0x0:_0x592f66[_0xfc5c('0x21')];var _0x161230=_0x5eb25b?_0x5ed8bd[_0xfc5c('0x20')]:_0x592f66['offset']+_0x592f66['limit'];var _0x2324f5;if(_0x161230>=_0x4e2c18){_0x161230=_0x4e2c18;_0x2324f5=0xc8;}else{_0x2324f5=0xce;}_0x30861f['status'](_0x2324f5);return _0x30861f[_0xfc5c('0x22')]('Content-Range',_0x3b90f4+'-'+_0x161230+'/'+_0x4e2c18)[_0xfc5c('0x23')](_0x5ed8bd);}return null;};}function patchUpdates(_0x18d7d7){return function(_0x308714){try{jsonpatch[_0xfc5c('0x24')](_0x308714,_0x18d7d7,!![]);}catch(_0x127672){return BPromise[_0xfc5c('0x25')](_0x127672);}return _0x308714[_0xfc5c('0x26')]();};}function saveUpdates(_0x189f80,_0xba5643){return function(_0x3cfdd){if(_0x3cfdd){return _0x3cfdd[_0xfc5c('0x27')](_0x189f80)[_0xfc5c('0x28')](function(_0x354217){return _0x354217;});}return null;};}function removeEntity(_0x58ec6a,_0x580a99){return function(_0x507d06){if(_0x507d06){return _0x507d06[_0xfc5c('0x29')]()['then'](function(){_0x58ec6a['status'](0xcc)[_0xfc5c('0x1d')]();});}};}function handleEntityNotFound(_0x42d703,_0x19d4aa){return function(_0xb8a1e9){if(!_0xb8a1e9){_0x42d703[_0xfc5c('0x1c')](0x194);}return _0xb8a1e9;};}function handleError(_0x3ad3e5,_0x14f03a){_0x14f03a=_0x14f03a||0x1f4;return function(_0x31e890){logger[_0xfc5c('0x2a')](_0x31e890[_0xfc5c('0x2b')]);if(_0x31e890[_0xfc5c('0x2c')]){delete _0x31e890[_0xfc5c('0x2c')];}_0x3ad3e5[_0xfc5c('0x1e')](_0x14f03a)[_0xfc5c('0x2d')](_0x31e890);};}exports[_0xfc5c('0x2e')]=function(_0x33efd0,_0x191c5d){var _0xa8b734={},_0x5121ca={},_0x155150={'count':0x0,'rows':[]};var _0x2050f2=_['map'](db[_0xfc5c('0x2f')]['rawAttributes'],function(_0x42cc94){return{'name':_0x42cc94[_0xfc5c('0x30')],'type':_0x42cc94[_0xfc5c('0x31')]['key']};});_0x5121ca[_0xfc5c('0x32')]=_[_0xfc5c('0x33')](_0x2050f2,_0xfc5c('0x2c'));_0x5121ca[_0xfc5c('0x34')]=_[_0xfc5c('0x35')](_0x33efd0['query']);_0x5121ca['filters']=_[_0xfc5c('0x36')](_0x5121ca['model'],_0x5121ca[_0xfc5c('0x34')]);_0xa8b734['attributes']=_[_0xfc5c('0x36')](_0x5121ca[_0xfc5c('0x32')],qs[_0xfc5c('0x37')](_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x37')]));_0xa8b734[_0xfc5c('0x38')]=_0xa8b734[_0xfc5c('0x38')][_0xfc5c('0x39')]?_0xa8b734[_0xfc5c('0x38')]:_0x5121ca[_0xfc5c('0x32')];if(!_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x3a')](_0xfc5c('0x3b'))){_0xa8b734[_0xfc5c('0x3c')]=qs[_0xfc5c('0x3c')](_0x33efd0['query']['limit']);_0xa8b734[_0xfc5c('0x21')]=qs[_0xfc5c('0x21')](_0x33efd0['query'][_0xfc5c('0x21')]);}_0xa8b734[_0xfc5c('0x3d')]=qs[_0xfc5c('0x3e')](_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x3e')]);_0xa8b734[_0xfc5c('0x3f')]=qs[_0xfc5c('0x40')](_[_0xfc5c('0x41')](_0x33efd0['query'],_0x5121ca[_0xfc5c('0x40')]),_0x2050f2);if(_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x42')]){_0xa8b734[_0xfc5c('0x3f')]=_[_0xfc5c('0x43')](_0xa8b734[_0xfc5c('0x3f')],{'$or':_[_0xfc5c('0x33')](_0x2050f2,function(_0x15a39d){if(_0x15a39d[_0xfc5c('0x31')]!==_0xfc5c('0x44')){var _0x3defe8={};_0x3defe8[_0x15a39d[_0xfc5c('0x2c')]]={'$like':'%'+_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x42')]+'%'};return _0x3defe8;}})});}_0xa8b734=_[_0xfc5c('0x43')]({},_0xa8b734,_0x33efd0[_0xfc5c('0x45')]);var _0x415cd1={'where':_0xa8b734['where']};return db[_0xfc5c('0x2f')][_0xfc5c('0x20')](_0x415cd1)[_0xfc5c('0x28')](function(_0x846d0e){_0x155150[_0xfc5c('0x20')]=_0x846d0e;if(_0x33efd0[_0xfc5c('0x34')][_0xfc5c('0x46')]){_0xa8b734[_0xfc5c('0x47')]=[{'all':!![]}];}return db[_0xfc5c('0x2f')][_0xfc5c('0x48')](_0xa8b734);})[_0xfc5c('0x28')](function(_0x36ba3f){_0x155150[_0xfc5c('0x49')]=_0x36ba3f;return _0x155150;})[_0xfc5c('0x28')](respondWithFilteredResult(_0x191c5d,_0xa8b734))[_0xfc5c('0x4a')](handleError(_0x191c5d,null));};exports[_0xfc5c('0x4b')]=function(_0x59cb44,_0x1de4a9){var _0x332697={'raw':![],'where':{'id':_0x59cb44[_0xfc5c('0x4c')]['id']}},_0x5720c7={};_0x5720c7[_0xfc5c('0x32')]=_['keys'](db[_0xfc5c('0x2f')][_0xfc5c('0x4d')]);_0x5720c7[_0xfc5c('0x34')]=_[_0xfc5c('0x35')](_0x59cb44[_0xfc5c('0x34')]);_0x5720c7[_0xfc5c('0x40')]=_[_0xfc5c('0x36')](_0x5720c7[_0xfc5c('0x32')],_0x5720c7[_0xfc5c('0x34')]);_0x332697[_0xfc5c('0x38')]=_[_0xfc5c('0x36')](_0x5720c7[_0xfc5c('0x32')],qs[_0xfc5c('0x37')](_0x59cb44[_0xfc5c('0x34')][_0xfc5c('0x37')]));_0x332697['attributes']=_0x332697[_0xfc5c('0x38')][_0xfc5c('0x39')]?_0x332697['attributes']:_0x5720c7[_0xfc5c('0x32')];if(_0x59cb44[_0xfc5c('0x34')][_0xfc5c('0x46')]){_0x332697[_0xfc5c('0x47')]=[{'all':!![]}];}_0x332697=_[_0xfc5c('0x43')]({},_0x332697,_0x59cb44[_0xfc5c('0x45')]);return db['FreshdeskAccount'][_0xfc5c('0x4e')](_0x332697)['then'](handleEntityNotFound(_0x1de4a9,null))[_0xfc5c('0x28')](respondWithResult(_0x1de4a9,null))[_0xfc5c('0x4a')](handleError(_0x1de4a9,null));};exports[_0xfc5c('0x4f')]=function(_0x18a74a,_0x39f054){return db[_0xfc5c('0x2f')][_0xfc5c('0x4f')](_0x18a74a['body'],{})[_0xfc5c('0x28')](respondWithResult(_0x39f054,0xc9))[_0xfc5c('0x4a')](handleError(_0x39f054,null));};exports[_0xfc5c('0x27')]=function(_0x5ed16a,_0x5467f7){if(_0x5ed16a[_0xfc5c('0x50')]['id']){delete _0x5ed16a[_0xfc5c('0x50')]['id'];}return db[_0xfc5c('0x2f')][_0xfc5c('0x4e')]({'where':{'id':_0x5ed16a['params']['id']}})['then'](handleEntityNotFound(_0x5467f7,null))[_0xfc5c('0x28')](saveUpdates(_0x5ed16a['body'],null))[_0xfc5c('0x28')](respondWithResult(_0x5467f7,null))['catch'](handleError(_0x5467f7,null));};exports[_0xfc5c('0x29')]=function(_0x40cdaa,_0x2757f3){return db[_0xfc5c('0x2f')][_0xfc5c('0x4e')]({'where':{'id':_0x40cdaa[_0xfc5c('0x4c')]['id']}})[_0xfc5c('0x28')](handleEntityNotFound(_0x2757f3,null))[_0xfc5c('0x28')](removeEntity(_0x2757f3,null))['catch'](handleError(_0x2757f3,null));};exports[_0xfc5c('0x51')]=function(_0x550a59,_0x55a36b,_0x2d0b3b){var _0x34a947={};var _0x544421={};var _0x1a9c75;var _0x5f231b;return db[_0xfc5c('0x2f')][_0xfc5c('0x52')]({'where':{'id':_0x550a59[_0xfc5c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55a36b,null))[_0xfc5c('0x28')](function(_0x54c29e){if(_0x54c29e){_0x1a9c75=_0x54c29e;_0x544421[_0xfc5c('0x32')]=_[_0xfc5c('0x35')](db[_0xfc5c('0x53')][_0xfc5c('0x4d')]);_0x544421[_0xfc5c('0x34')]=_['keys'](_0x550a59[_0xfc5c('0x34')]);_0x544421[_0xfc5c('0x40')]=_[_0xfc5c('0x36')](_0x544421[_0xfc5c('0x32')],_0x544421['query']);_0x34a947[_0xfc5c('0x38')]=_[_0xfc5c('0x36')](_0x544421['model'],qs[_0xfc5c('0x37')](_0x550a59[_0xfc5c('0x34')]['fields']));_0x34a947['attributes']=_0x34a947[_0xfc5c('0x38')][_0xfc5c('0x39')]?_0x34a947[_0xfc5c('0x38')]:_0x544421[_0xfc5c('0x32')];_0x34a947[_0xfc5c('0x3d')]=qs[_0xfc5c('0x3e')](_0x550a59[_0xfc5c('0x34')][_0xfc5c('0x3e')]);_0x34a947[_0xfc5c('0x3f')]=qs['filters'](_[_0xfc5c('0x41')](_0x550a59[_0xfc5c('0x34')],_0x544421[_0xfc5c('0x40')]));if(_0x550a59[_0xfc5c('0x34')][_0xfc5c('0x42')]){_0x34a947[_0xfc5c('0x3f')]=_[_0xfc5c('0x43')](_0x34a947[_0xfc5c('0x3f')],{'$or':_[_0xfc5c('0x33')](_0x34a947[_0xfc5c('0x38')],function(_0x25fbb7){var _0x84dc5={};_0x84dc5[_0x25fbb7]={'$like':'%'+_0x550a59['query'][_0xfc5c('0x42')]+'%'};return _0x84dc5;})});}_0x34a947=_[_0xfc5c('0x43')]({},_0x34a947,_0x550a59[_0xfc5c('0x45')]);return _0x1a9c75['getConfigurations'](_0x34a947);}})[_0xfc5c('0x28')](function(_0x3cb65f){if(_0x3cb65f){_0x5f231b=_0x3cb65f[_0xfc5c('0x39')];if(!_0x550a59[_0xfc5c('0x34')][_0xfc5c('0x3a')](_0xfc5c('0x3b'))){_0x34a947[_0xfc5c('0x3c')]=qs[_0xfc5c('0x3c')](_0x550a59[_0xfc5c('0x34')][_0xfc5c('0x3c')]);_0x34a947[_0xfc5c('0x21')]=qs[_0xfc5c('0x21')](_0x550a59[_0xfc5c('0x34')][_0xfc5c('0x21')]);}return _0x1a9c75[_0xfc5c('0x51')](_0x34a947);}})[_0xfc5c('0x28')](function(_0xf64b6e){if(_0xf64b6e){return _0xf64b6e?{'count':_0x5f231b,'rows':_0xf64b6e}:null;}})[_0xfc5c('0x28')](respondWithResult(_0x55a36b,null))[_0xfc5c('0x4a')](handleError(_0x55a36b,null));};exports[_0xfc5c('0x54')]=function(_0xbc336c,_0x10aa1a,_0x499aed){if(_0xbc336c[_0xfc5c('0x50')]['id']){delete _0xbc336c[_0xfc5c('0x50')]['id'];}return db[_0xfc5c('0x2f')][_0xfc5c('0x52')]({'where':{'id':_0xbc336c[_0xfc5c('0x4c')]['id']}})[_0xfc5c('0x28')](handleEntityNotFound(_0x10aa1a,null))[_0xfc5c('0x28')](function(_0x407a7d){if(_0x407a7d){_0xbc336c[_0xfc5c('0x50')][_0xfc5c('0x55')]=_0x407a7d['id'];_0xbc336c[_0xfc5c('0x50')]['Subjects']=integrations['getSubjects'](_0xbc336c[_0xfc5c('0x50')][_0xfc5c('0x56')],_0xbc336c['body']['type']);_0xbc336c[_0xfc5c('0x50')]['Descriptions']=integrations[_0xfc5c('0x57')](_0xbc336c['body'][_0xfc5c('0x56')],_0xbc336c['body'][_0xfc5c('0x31')]);return db[_0xfc5c('0x53')]['create'](_0xbc336c[_0xfc5c('0x50')],{'include':[{'model':db[_0xfc5c('0x58')],'as':_0xfc5c('0x59')},{'model':db['FreshdeskField'],'as':_0xfc5c('0x5a')}]});}return null;})[_0xfc5c('0x28')](respondWithResult(_0x10aa1a,null))['catch'](handleError(_0x10aa1a,null));};exports[_0xfc5c('0x5b')]=function(_0x114f31,_0x2174cc,_0x263de2){var _0x99c450='';return db[_0xfc5c('0x2f')][_0xfc5c('0x52')]({'where':{'id':_0x114f31[_0xfc5c('0x4c')]['id']},'attributes':['id',_0xfc5c('0x5c'),_0xfc5c('0x5d')]})[_0xfc5c('0x28')](handleEntityNotFound(_0x2174cc,null))['then'](function(_0x20218c){if(_0x20218c){_0x99c450=_0x20218c[_0xfc5c('0x5c')];var _0x3d1df2=_0x99c450[_0xfc5c('0x5e')](-0x1);if(_0x3d1df2==='/'){_0x99c450=_0x99c450[_0xfc5c('0x5f')](0x0,_0x99c450[_0xfc5c('0x60')](_0x3d1df2));}return rp({'method':_0xfc5c('0x61'),'uri':util[_0xfc5c('0x62')](_0xfc5c('0x63'),_0x99c450,_0xfc5c('0x64')),'headers':{'Authorization':util['format'](_0xfc5c('0x65'),new Buffer(util[_0xfc5c('0x62')](_0xfc5c('0x66'),_0x20218c[_0xfc5c('0x5d')]))['toString'](_0xfc5c('0x67')))},'json':!![]});}})[_0xfc5c('0x28')](function(_0x5abf27){if(_0x5abf27){var _0x108d10=[_0xfc5c('0x68'),_0xfc5c('0x69'),_0xfc5c('0x6a'),'description',_0xfc5c('0x1e'),_0xfc5c('0x6b'),'group',_0xfc5c('0x6c'),_0xfc5c('0x6d'),_0xfc5c('0x6e'),_0xfc5c('0x6f')];_['remove'](_0x5abf27,function(_0x5725db){return _0x108d10[_0xfc5c('0x70')](_0x5725db[_0xfc5c('0x2c')])||!_0x5725db[_0xfc5c('0x71')]&&_0x5725db['type']!==_0xfc5c('0x72')&&_0x5725db[_0xfc5c('0x31')]!==_0xfc5c('0x73');});return{'count':_0x5abf27[_0xfc5c('0x39')],'rows':_[_0xfc5c('0x33')](_0x5abf27,function(_0x19da23){return{'id':_0x19da23[_0xfc5c('0x2c')],'name':_0x19da23['label'],'custom':!_0x19da23[_0xfc5c('0x71')],'options':_0x19da23['choices']?_[_0xfc5c('0x33')](_0x19da23[_0xfc5c('0x74')],function(_0x2c1a18){return{'name':_['capitalize'](_0x2c1a18),'value':_0x2c1a18};}):[]};})};}})[_0xfc5c('0x28')](respondWithResult(_0x2174cc,null))['catch'](function(_0xfc7ecb){var _0x3a0d56=_0x114f31[_0xfc5c('0x34')][_0xfc5c('0x75')]?0x1f4:_0xfc7ecb['statusCode']||0x1f4;logger[_0xfc5c('0x2a')](_0xfc5c('0x76'),_0xfc5c('0x5b'),_0x3a0d56,JSON['stringify'](_0xfc7ecb));delete _0xfc7ecb['name'];if(_0x3a0d56===0x191){_0x3a0d56=0x190;}_0x2174cc[_0xfc5c('0x1e')](_0x3a0d56)[_0xfc5c('0x2d')](_0x114f31['query'][_0xfc5c('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0xfc7ecb[_0xfc5c('0x77')]}:_0xfc7ecb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 57bf95d..3f9ce83 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 _0xc406=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','int_freshdesk_accounts'];(function(_0x2f2d9f,_0x53eae6){var _0x2872d4=function(_0x57a7cf){while(--_0x57a7cf){_0x2f2d9f['push'](_0x2f2d9f['shift']());}};_0x2872d4(++_0x53eae6);}(_0xc406,0x18c));var _0x6c40=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc406[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6c40('0x0'))('api');var moment=require(_0x6c40('0x1'));var BPromise=require('bluebird');var rp=require(_0x6c40('0x2'));var fs=require('fs');var path=require(_0x6c40('0x3'));var rimraf=require(_0x6c40('0x4'));var config=require(_0x6c40('0x5'));var attributes=require(_0x6c40('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3c8d56,_0x5e6473){return _0x3c8d56[_0x6c40('0x7')]('FreshdeskAccount',attributes,{'tableName':_0x6c40('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe639=['FreshdeskAccount','util','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define'];(function(_0x44330c,_0x22f9b5){var _0x5b3cd9=function(_0x3fa058){while(--_0x3fa058){_0x44330c['push'](_0x44330c['shift']());}};_0x5b3cd9(++_0x22f9b5);}(_0xe639,0xeb));var _0x9e63=function(_0x497666,_0xe51c4b){_0x497666=_0x497666-0x0;var _0x13c58d=_0xe639[_0x497666];return _0x13c58d;};'use strict';var _=require('lodash');var util=require(_0x9e63('0x0'));var logger=require('../../config/logger')(_0x9e63('0x1'));var moment=require(_0x9e63('0x2'));var BPromise=require(_0x9e63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e63('0x4'));var config=require(_0x9e63('0x5'));var attributes=require(_0x9e63('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5dba51,_0xfe77b){return _0x5dba51[_0x9e63('0x7')](_0x9e63('0x8'),attributes,{'tableName':'int_freshdesk_accounts','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 ff66669..e32d551 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 _0xbd50=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','map','include','model','attributes','info','debug','stringify','catch','ShowFreshdeskAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x24e2a3,_0x534875){var _0x3e82f4=function(_0x48a8ee){while(--_0x48a8ee){_0x24e2a3['push'](_0x24e2a3['shift']());}};_0x3e82f4(++_0x534875);}(_0xbd50,0x196));var _0x0bd5=function(_0x2bfc70,_0x35c0f5){_0x2bfc70=_0x2bfc70-0x0;var _0x3af2ad=_0xbd50[_0x2bfc70];return _0x3af2ad;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}exports[_0x0bd5('0x13')]=function(_0x833c14){var _0x23be38=this;return new Promise(function(_0xc58e12,_0x19fe20){return db[_0x0bd5('0x14')][_0x0bd5('0x15')]({'raw':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x833c14[_0x0bd5('0x16')]?_0x833c14['options']['where']||null:null,'attributes':_0x833c14['options']?_0x833c14['options']['attributes']||null:null,'limit':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x18')]||null:null,'include':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')]['include']?_[_0x0bd5('0x19')](_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x5a8139){return{'model':db[_0x5a8139[_0x0bd5('0x1b')]],'as':_0x5a8139['as'],'attributes':_0x5a8139['attributes'],'include':_0x5a8139['include']?_[_0x0bd5('0x19')](_0x5a8139[_0x0bd5('0x1a')],function(_0x184db3){return{'model':db[_0x184db3['model']],'as':_0x184db3['as'],'attributes':_0x184db3[_0x0bd5('0x1c')],'include':_0x184db3['include']?_[_0x0bd5('0x19')](_0x184db3[_0x0bd5('0x1a')],function(_0x18cec3){return{'model':db[_0x18cec3[_0x0bd5('0x1b')]],'as':_0x18cec3['as'],'attributes':_0x18cec3[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x19bb5e){logger[_0x0bd5('0x1d')](_0x0bd5('0x13'),_0x833c14);logger[_0x0bd5('0x1e')](_0x0bd5('0x13'),_0x833c14,JSON[_0x0bd5('0x1f')](_0x19bb5e));_0xc58e12(_0x19bb5e);})[_0x0bd5('0x20')](function(_0x2704ee){logger['error'](_0x0bd5('0x13'),_0x2704ee[_0x0bd5('0x11')],_0x833c14);_0x19fe20(_0x23be38['error'](0x1f4,_0x2704ee[_0x0bd5('0x11')]));});});};exports[_0x0bd5('0x21')]=function(_0x5d9d20){var _0x11f482=this;return new Promise(function(_0x1b7cf4,_0x28ab82){return db[_0x0bd5('0x14')]['find']({'raw':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x22')]||null:null,'attributes':_0x5d9d20['options']?_0x5d9d20[_0x0bd5('0x16')]['attributes']||null:null,'include':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x15e380){return{'model':db[_0x15e380[_0x0bd5('0x1b')]],'as':_0x15e380['as'],'attributes':_0x15e380[_0x0bd5('0x1c')],'include':_0x15e380[_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x15e380[_0x0bd5('0x1a')],function(_0x3cfb74){return{'model':db[_0x3cfb74['model']],'as':_0x3cfb74['as'],'attributes':_0x3cfb74[_0x0bd5('0x1c')],'include':_0x3cfb74[_0x0bd5('0x1a')]?_['map'](_0x3cfb74['include'],function(_0x6b93ed){return{'model':db[_0x6b93ed[_0x0bd5('0x1b')]],'as':_0x6b93ed['as'],'attributes':_0x6b93ed[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x1dd2e1){logger[_0x0bd5('0x1d')](_0x0bd5('0x21'),_0x5d9d20);logger[_0x0bd5('0x1e')](_0x0bd5('0x21'),_0x5d9d20,JSON[_0x0bd5('0x1f')](_0x1dd2e1));_0x1b7cf4(_0x1dd2e1);})[_0x0bd5('0x20')](function(_0x3c6aa5){logger[_0x0bd5('0xf')]('ShowFreshdeskAccount',_0x3c6aa5[_0x0bd5('0x11')],_0x5d9d20);_0x28ab82(_0x11f482['error'](0x1f4,_0x3c6aa5[_0x0bd5('0x11')]));});});}; \ No newline at end of file +var _0xb9b3=['FreshdeskAccount','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshdeskAccount'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x269ba8,_0x4c1f9e){_0x269ba8=_0x269ba8-0x0;var _0x22c092=_0xb9b3[_0x269ba8];return _0x22c092;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var moment=require('moment');var BPromise=require(_0x3b9b('0x2'));var rs=require(_0x3b9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b9b('0x4'));var logger=require(_0x3b9b('0x5'))(_0x3b9b('0x6'));var config=require(_0x3b9b('0x7'));var jayson=require(_0x3b9b('0x8'));var client=jayson['client'][_0x3b9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58a355,_0x1b34b5,_0x3cd0eb){return new BPromise(function(_0x3269c5,_0x560a21){return client[_0x3b9b('0xa')](_0x58a355,_0x3cd0eb)['then'](function(_0x51e228){logger[_0x3b9b('0xb')](_0x3b9b('0xc'),_0x1b34b5,_0x3b9b('0xd'));logger['debug'](_0x3b9b('0xe'),_0x1b34b5,_0x3b9b('0xd'),JSON['stringify'](_0x51e228));if(_0x51e228['error']){if(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x10')]===0x1f4){logger[_0x3b9b('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b34b5,_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);return _0x560a21(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);}logger[_0x3b9b('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b34b5,_0x51e228[_0x3b9b('0xf')]['message']);return _0x3269c5(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);}else{logger[_0x3b9b('0xb')](_0x3b9b('0xc'),_0x1b34b5,'request\x20sent');_0x3269c5(_0x51e228[_0x3b9b('0x12')][_0x3b9b('0x11')]);}})['catch'](function(_0xe43335){logger[_0x3b9b('0xf')](_0x3b9b('0xc'),_0x1b34b5,_0xe43335);_0x560a21(_0xe43335);});});}exports[_0x3b9b('0x13')]=function(_0xb98c02){var _0x28a2f3=this;return new Promise(function(_0x1b1c71,_0x21da71){return db[_0x3b9b('0x14')]['findAll']({'raw':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x16')]===undefined?!![]:![]:!![],'where':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x17')]||null:null,'attributes':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x18')]||null:null,'limit':_0xb98c02['options']?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x19')]||null:null,'include':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')]['include']?_['map'](_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x1a')],function(_0x329003){return{'model':db[_0x329003[_0x3b9b('0x1b')]],'as':_0x329003['as'],'attributes':_0x329003['attributes'],'include':_0x329003[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x329003[_0x3b9b('0x1a')],function(_0x338f22){return{'model':db[_0x338f22[_0x3b9b('0x1b')]],'as':_0x338f22['as'],'attributes':_0x338f22[_0x3b9b('0x18')],'include':_0x338f22[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x338f22[_0x3b9b('0x1a')],function(_0x328d13){return{'model':db[_0x328d13['model']],'as':_0x328d13['as'],'attributes':_0x328d13[_0x3b9b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b9b('0x1d')](function(_0x56f7e5){logger[_0x3b9b('0xb')](_0x3b9b('0x13'),_0xb98c02);logger['debug'](_0x3b9b('0x13'),_0xb98c02,JSON[_0x3b9b('0x1e')](_0x56f7e5));_0x1b1c71(_0x56f7e5);})[_0x3b9b('0x1f')](function(_0x5ab12a){logger[_0x3b9b('0xf')]('GetFreshdeskAccount',_0x5ab12a[_0x3b9b('0x11')],_0xb98c02);_0x21da71(_0x28a2f3[_0x3b9b('0xf')](0x1f4,_0x5ab12a[_0x3b9b('0x11')]));});});};exports[_0x3b9b('0x20')]=function(_0x5d6364){var _0x1edfb8=this;return new Promise(function(_0x542c21,_0x66fba1){return db[_0x3b9b('0x14')][_0x3b9b('0x21')]({'raw':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x16')]===undefined?!![]:![]:!![],'where':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x17')]||null:null,'attributes':_0x5d6364['options']?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x18')]||null:null,'include':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')]['include']?_['map'](_0x5d6364['options'][_0x3b9b('0x1a')],function(_0x32ed0b){return{'model':db[_0x32ed0b['model']],'as':_0x32ed0b['as'],'attributes':_0x32ed0b[_0x3b9b('0x18')],'include':_0x32ed0b[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x32ed0b['include'],function(_0x4dd7e7){return{'model':db[_0x4dd7e7[_0x3b9b('0x1b')]],'as':_0x4dd7e7['as'],'attributes':_0x4dd7e7['attributes'],'include':_0x4dd7e7[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x4dd7e7[_0x3b9b('0x1a')],function(_0x3594e9){return{'model':db[_0x3594e9[_0x3b9b('0x1b')]],'as':_0x3594e9['as'],'attributes':_0x3594e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b9b('0x1d')](function(_0x2a97e2){logger[_0x3b9b('0xb')](_0x3b9b('0x20'),_0x5d6364);logger['debug'](_0x3b9b('0x20'),_0x5d6364,JSON[_0x3b9b('0x1e')](_0x2a97e2));_0x542c21(_0x2a97e2);})[_0x3b9b('0x1f')](function(_0x41f6f2){logger[_0x3b9b('0xf')]('ShowFreshdeskAccount',_0x41f6f2[_0x3b9b('0x11')],_0x5d6364);_0x66fba1(_0x1edfb8[_0x3b9b('0xf')](0x1f4,_0x41f6f2[_0x3b9b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 239cc74..4db1b92 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 _0xe138=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','setTags','update','delete','exports','util','path','Router','fs-extra'];(function(_0x100b33,_0x198689){var _0x449e51=function(_0x58ad6e){while(--_0x58ad6e){_0x100b33['push'](_0x100b33['shift']());}};_0x449e51(++_0x198689);}(_0xe138,0x1b4));var _0x8e13=function(_0x4c2c52,_0x38b31a){_0x4c2c52=_0x4c2c52-0x0;var _0x1123c4=_0xe138[_0x4c2c52];return _0x1123c4;};'use strict';var multer=require('multer');var util=require(_0x8e13('0x0'));var path=require(_0x8e13('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e13('0x2')]();var fs_extra=require(_0x8e13('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8e13('0x4'));var config=require(_0x8e13('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8e13('0x6')]('/',auth['isAuthenticated'](),controller[_0x8e13('0x7')]);router['get'](_0x8e13('0x8'),auth[_0x8e13('0x9')](),controller[_0x8e13('0xa')]);router[_0x8e13('0x6')](_0x8e13('0xb'),auth[_0x8e13('0x9')](),controller['getFields']);router[_0x8e13('0x6')](_0x8e13('0xc'),auth[_0x8e13('0x9')](),controller[_0x8e13('0xd')]);router[_0x8e13('0x6')](_0x8e13('0xe'),auth[_0x8e13('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x8e13('0xf')]);router[_0x8e13('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e13('0x11')]);router['post']('/:id/tags',auth[_0x8e13('0x9')](),controller[_0x8e13('0x12')]);router['put'](_0x8e13('0x8'),auth[_0x8e13('0x9')](),controller[_0x8e13('0x13')]);router[_0x8e13('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8e13('0x15')]=router; \ No newline at end of file +var _0x56c8=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x33b8b4,_0x214d64){var _0xdc407a=function(_0x3ec043){while(--_0x3ec043){_0x33b8b4['push'](_0x33b8b4['shift']());}};_0xdc407a(++_0x214d64);}(_0x56c8,0xf9));var _0x856c=function(_0x212b15,_0x45d14d){_0x212b15=_0x212b15-0x0;var _0x1e5ed4=_0x56c8[_0x212b15];return _0x1e5ed4;};'use strict';var multer=require(_0x856c('0x0'));var util=require('util');var path=require(_0x856c('0x1'));var timeout=require('connect-timeout');var express=require(_0x856c('0x2'));var router=express[_0x856c('0x3')]();var fs_extra=require(_0x856c('0x4'));var auth=require(_0x856c('0x5'));var interaction=require(_0x856c('0x6'));var config=require(_0x856c('0x7'));var controller=require(_0x856c('0x8'));router[_0x856c('0x9')]('/',auth[_0x856c('0xa')](),controller[_0x856c('0xb')]);router[_0x856c('0x9')](_0x856c('0xc'),auth[_0x856c('0xa')](),controller[_0x856c('0xd')]);router['get'](_0x856c('0xe'),auth[_0x856c('0xa')](),controller['getFields']);router[_0x856c('0x9')](_0x856c('0xf'),auth[_0x856c('0xa')](),controller[_0x856c('0x10')]);router[_0x856c('0x9')]('/:id/descriptions',auth[_0x856c('0xa')](),controller[_0x856c('0x11')]);router[_0x856c('0x9')](_0x856c('0x12'),auth[_0x856c('0xa')](),controller[_0x856c('0x13')]);router[_0x856c('0x14')]('/',auth[_0x856c('0xa')](),controller[_0x856c('0x15')]);router[_0x856c('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x856c('0x16')]);router[_0x856c('0x17')](_0x856c('0xc'),auth[_0x856c('0xa')](),controller['update']);router['delete']('/:id',auth[_0x856c('0xa')](),controller[_0x856c('0x18')]);module[_0x856c('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 75d0d86..6c9b816 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 _0xb5d2=['sequelize','exports','STRING'];(function(_0x2a99f5,_0x50eed0){var _0x818f8f=function(_0x33302c){while(--_0x33302c){_0x2a99f5['push'](_0x2a99f5['shift']());}};_0x818f8f(++_0x50eed0);}(_0xb5d2,0x1b6));var _0x2b5d=function(_0xb61753,_0x566e13){_0xb61753=_0xb61753-0x0;var _0x36a409=_0xb5d2[_0xb61753];return _0x36a409;};'use strict';var Sequelize=require(_0x2b5d('0x0'));module[_0x2b5d('0x1')]={'name':{'type':Sequelize[_0x2b5d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa257=['STRING','sequelize','exports'];(function(_0x2d958d,_0x24619c){var _0x57295e=function(_0x5d10a1){while(--_0x5d10a1){_0x2d958d['push'](_0x2d958d['shift']());}};_0x57295e(++_0x24619c);}(_0xa257,0xaf));var _0x7a25=function(_0x1f0bd4,_0x2f06b7){_0x1f0bd4=_0x1f0bd4-0x0;var _0x3f6ad2=_0xa257[_0x1f0bd4];return _0x3f6ad2;};'use strict';var Sequelize=require(_0x7a25('0x0'));module[_0x7a25('0x1')]={'name':{'type':Sequelize[_0x7a25('0x2')]},'description':{'type':Sequelize[_0x7a25('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e48079b..97ae145 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 _0xab5b=['findAll','catch','show','intersection','find','create','body','destroy','getFields','findOne','params','FreshdeskField','pick','merge','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','include'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xab5b,0xb8));var _0xbab5=function(_0x1f7459,_0x13631f){_0x1f7459=_0x1f7459-0x0;var _0xc77774=_0xab5b[_0x1f7459];return _0xc77774;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require(_0xbab5('0x2'));var jsonpatch=require(_0xbab5('0x3'));var rp=require(_0xbab5('0x4'));var moment=require('moment');var BPromise=require(_0xbab5('0x5'));var Mustache=require(_0xbab5('0x6'));var util=require(_0xbab5('0x7'));var path=require(_0xbab5('0x8'));var sox=require(_0xbab5('0x9'));var csv=require(_0xbab5('0xa'));var ejs=require(_0xbab5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbab5('0xc'));var crypto=require('crypto');var jsforce=require(_0xbab5('0xd'));var deskjs=require(_0xbab5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbab5('0xf'));var Papa=require('papaparse');var Redis=require(_0xbab5('0x10'));var authService=require(_0xbab5('0x11'));var qs=require(_0xbab5('0x12'));var as=require(_0xbab5('0x13'));var hardwareService=require(_0xbab5('0x14'));var logger=require(_0xbab5('0x15'))('api');var utils=require(_0xbab5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbab5('0x17'));var db=require(_0xbab5('0x18'))['db'];function respondWithStatusCode(_0x40e7f0,_0x156684){_0x156684=_0x156684||0xcc;return function(_0x2cd638){if(_0x2cd638){return _0x40e7f0['sendStatus'](_0x156684);}return _0x40e7f0[_0xbab5('0x19')](_0x156684)[_0xbab5('0x1a')]();};}function respondWithResult(_0x5c56bd,_0x33da09){_0x33da09=_0x33da09||0xc8;return function(_0x2dd719){if(_0x2dd719){return _0x5c56bd[_0xbab5('0x19')](_0x33da09)[_0xbab5('0x1b')](_0x2dd719);}};}function respondWithFilteredResult(_0x2bcb42,_0x538b39){return function(_0x26f8b9){if(_0x26f8b9){var _0x5ea2ea=typeof _0x538b39[_0xbab5('0x1c')]===_0xbab5('0x1d')&&typeof _0x538b39[_0xbab5('0x1e')]===_0xbab5('0x1d');var _0x8eefdf=_0x26f8b9[_0xbab5('0x1f')];var _0x571840=_0x5ea2ea?0x0:_0x538b39['offset'];var _0x2bbc1d=_0x5ea2ea?_0x26f8b9[_0xbab5('0x1f')]:_0x538b39['offset']+_0x538b39[_0xbab5('0x1e')];var _0x2c8214;if(_0x2bbc1d>=_0x8eefdf){_0x2bbc1d=_0x8eefdf;_0x2c8214=0xc8;}else{_0x2c8214=0xce;}_0x2bcb42['status'](_0x2c8214);return _0x2bcb42[_0xbab5('0x20')](_0xbab5('0x21'),_0x571840+'-'+_0x2bbc1d+'/'+_0x8eefdf)['json'](_0x26f8b9);}return null;};}function patchUpdates(_0x99ac81){return function(_0x1da272){try{jsonpatch[_0xbab5('0x22')](_0x1da272,_0x99ac81,!![]);}catch(_0x46bc90){return BPromise[_0xbab5('0x23')](_0x46bc90);}return _0x1da272['save']();};}function saveUpdates(_0x771438,_0x8a357b){return function(_0x2d9f42){if(_0x2d9f42){return _0x2d9f42[_0xbab5('0x24')](_0x771438)[_0xbab5('0x25')](function(_0x35060f){return _0x35060f;});}return null;};}function removeEntity(_0x5eb291,_0x2b27a3){return function(_0x2dfc0e){if(_0x2dfc0e){return _0x2dfc0e['destroy']()[_0xbab5('0x25')](function(){_0x5eb291[_0xbab5('0x19')](0xcc)[_0xbab5('0x1a')]();});}};}function handleEntityNotFound(_0xcf5925,_0x19827a){return function(_0x54ccae){if(!_0x54ccae){_0xcf5925['sendStatus'](0x194);}return _0x54ccae;};}function handleError(_0x55fb2f,_0xcfd5de){_0xcfd5de=_0xcfd5de||0x1f4;return function(_0x23d47e){logger[_0xbab5('0x26')](_0x23d47e[_0xbab5('0x27')]);if(_0x23d47e[_0xbab5('0x28')]){delete _0x23d47e[_0xbab5('0x28')];}_0x55fb2f[_0xbab5('0x19')](_0xcfd5de)[_0xbab5('0x29')](_0x23d47e);};}exports[_0xbab5('0x2a')]=function(_0x281cda,_0x1d8b9c){var _0x1e93fc={},_0xb35673={},_0x5c395e={'count':0x0,'rows':[]};var _0x2b0e89=_[_0xbab5('0x2b')](db[_0xbab5('0x2c')][_0xbab5('0x2d')],function(_0x4dcfba){return{'name':_0x4dcfba['fieldName'],'type':_0x4dcfba[_0xbab5('0x2e')][_0xbab5('0x2f')]};});_0xb35673[_0xbab5('0x30')]=_[_0xbab5('0x2b')](_0x2b0e89,_0xbab5('0x28'));_0xb35673[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x281cda[_0xbab5('0x31')]);_0xb35673[_0xbab5('0x33')]=_['intersection'](_0xb35673[_0xbab5('0x30')],_0xb35673[_0xbab5('0x31')]);_0x1e93fc[_0xbab5('0x34')]=_['intersection'](_0xb35673['model'],qs[_0xbab5('0x35')](_0x281cda[_0xbab5('0x31')][_0xbab5('0x35')]));_0x1e93fc[_0xbab5('0x34')]=_0x1e93fc[_0xbab5('0x34')][_0xbab5('0x36')]?_0x1e93fc['attributes']:_0xb35673[_0xbab5('0x30')];if(!_0x281cda[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x1e93fc['limit']=qs[_0xbab5('0x1e')](_0x281cda['query'][_0xbab5('0x1e')]);_0x1e93fc[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x281cda[_0xbab5('0x31')]['offset']);}_0x1e93fc[_0xbab5('0x38')]=qs[_0xbab5('0x39')](_0x281cda[_0xbab5('0x31')][_0xbab5('0x39')]);_0x1e93fc[_0xbab5('0x3a')]=qs[_0xbab5('0x33')](_['pick'](_0x281cda[_0xbab5('0x31')],_0xb35673[_0xbab5('0x33')]),_0x2b0e89);if(_0x281cda[_0xbab5('0x31')]['filter']){_0x1e93fc[_0xbab5('0x3a')]=_['merge'](_0x1e93fc[_0xbab5('0x3a')],{'$or':_['map'](_0x2b0e89,function(_0x564c0a){if(_0x564c0a['type']!=='VIRTUAL'){var _0x50f297={};_0x50f297[_0x564c0a['name']]={'$like':'%'+_0x281cda[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x50f297;}})});}_0x1e93fc=_['merge']({},_0x1e93fc,_0x281cda[_0xbab5('0x3c')]);var _0x37704a={'where':_0x1e93fc[_0xbab5('0x3a')]};return db[_0xbab5('0x2c')][_0xbab5('0x1f')](_0x37704a)[_0xbab5('0x25')](function(_0x226987){_0x5c395e[_0xbab5('0x1f')]=_0x226987;if(_0x281cda[_0xbab5('0x31')]['includeAll']){_0x1e93fc[_0xbab5('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xbab5('0x3e')](_0x1e93fc);})[_0xbab5('0x25')](function(_0x270981){_0x5c395e['rows']=_0x270981;return _0x5c395e;})['then'](respondWithFilteredResult(_0x1d8b9c,_0x1e93fc))[_0xbab5('0x3f')](handleError(_0x1d8b9c,null));};exports[_0xbab5('0x40')]=function(_0x12366a,_0x1f4b7a){var _0x36b667={'raw':![],'where':{'id':_0x12366a['params']['id']}},_0x6d1db3={};_0x6d1db3[_0xbab5('0x30')]=_[_0xbab5('0x32')](db[_0xbab5('0x2c')][_0xbab5('0x2d')]);_0x6d1db3[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x12366a['query']);_0x6d1db3['filters']=_[_0xbab5('0x41')](_0x6d1db3[_0xbab5('0x30')],_0x6d1db3[_0xbab5('0x31')]);_0x36b667[_0xbab5('0x34')]=_[_0xbab5('0x41')](_0x6d1db3[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0x12366a[_0xbab5('0x31')]['fields']));_0x36b667[_0xbab5('0x34')]=_0x36b667[_0xbab5('0x34')][_0xbab5('0x36')]?_0x36b667['attributes']:_0x6d1db3['model'];if(_0x12366a[_0xbab5('0x31')]['includeAll']){_0x36b667[_0xbab5('0x3d')]=[{'all':!![]}];}_0x36b667=_['merge']({},_0x36b667,_0x12366a['options']);return db[_0xbab5('0x2c')][_0xbab5('0x42')](_0x36b667)['then'](handleEntityNotFound(_0x1f4b7a,null))[_0xbab5('0x25')](respondWithResult(_0x1f4b7a,null))['catch'](handleError(_0x1f4b7a,null));};exports[_0xbab5('0x43')]=function(_0x5ca8f0,_0x3ebaae){return db[_0xbab5('0x2c')][_0xbab5('0x43')](_0x5ca8f0['body'],{})[_0xbab5('0x25')](respondWithResult(_0x3ebaae,0xc9))[_0xbab5('0x3f')](handleError(_0x3ebaae,null));};exports['update']=function(_0x58482e,_0x45484a){if(_0x58482e['body']['id']){delete _0x58482e['body']['id'];}return db[_0xbab5('0x2c')]['find']({'where':{'id':_0x58482e['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x45484a,null))[_0xbab5('0x25')](saveUpdates(_0x58482e[_0xbab5('0x44')],null))[_0xbab5('0x25')](respondWithResult(_0x45484a,null))['catch'](handleError(_0x45484a,null));};exports[_0xbab5('0x45')]=function(_0x3731ea,_0x25acef){return db[_0xbab5('0x2c')][_0xbab5('0x42')]({'where':{'id':_0x3731ea['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x25acef,null))[_0xbab5('0x25')](removeEntity(_0x25acef,null))[_0xbab5('0x3f')](handleError(_0x25acef,null));};exports[_0xbab5('0x46')]=function(_0x3fcb64,_0x3bd566,_0x449a38){var _0x181bc0={};var _0x43b4d8={};var _0x3cbe07;var _0x42369c;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x3fcb64[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x3bd566,null))['then'](function(_0x448326){if(_0x448326){_0x3cbe07=_0x448326;_0x43b4d8['model']=_[_0xbab5('0x32')](db[_0xbab5('0x49')][_0xbab5('0x2d')]);_0x43b4d8['query']=_[_0xbab5('0x32')](_0x3fcb64[_0xbab5('0x31')]);_0x43b4d8[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x43b4d8[_0xbab5('0x30')],_0x43b4d8[_0xbab5('0x31')]);_0x181bc0[_0xbab5('0x34')]=_['intersection'](_0x43b4d8[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x35')]));_0x181bc0[_0xbab5('0x34')]=_0x181bc0[_0xbab5('0x34')][_0xbab5('0x36')]?_0x181bc0[_0xbab5('0x34')]:_0x43b4d8[_0xbab5('0x30')];_0x181bc0[_0xbab5('0x38')]=qs[_0xbab5('0x39')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x39')]);_0x181bc0['where']=qs[_0xbab5('0x33')](_[_0xbab5('0x4a')](_0x3fcb64[_0xbab5('0x31')],_0x43b4d8['filters']));if(_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x3b')]){_0x181bc0['where']=_[_0xbab5('0x4b')](_0x181bc0[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x181bc0[_0xbab5('0x34')],function(_0x1bc637){var _0x354609={};_0x354609[_0x1bc637]={'$like':'%'+_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x354609;})});}_0x181bc0=_[_0xbab5('0x4b')]({},_0x181bc0,_0x3fcb64[_0xbab5('0x3c')]);return _0x3cbe07[_0xbab5('0x46')](_0x181bc0);}})[_0xbab5('0x25')](function(_0x233bc7){if(_0x233bc7){_0x42369c=_0x233bc7['length'];if(!_0x3fcb64[_0xbab5('0x31')]['hasOwnProperty'](_0xbab5('0x4c'))){_0x181bc0[_0xbab5('0x1e')]=qs['limit'](_0x3fcb64['query'][_0xbab5('0x1e')]);_0x181bc0[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x3fcb64[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x3cbe07[_0xbab5('0x46')](_0x181bc0);}})[_0xbab5('0x25')](function(_0x3e54d9){if(_0x3e54d9){return _0x3e54d9?{'count':_0x42369c,'rows':_0x3e54d9}:null;}})[_0xbab5('0x25')](respondWithResult(_0x3bd566,null))[_0xbab5('0x3f')](handleError(_0x3bd566,null));};exports[_0xbab5('0x4d')]=function(_0xf517bb,_0x152720,_0xbc840f){var _0x5e2858={};var _0x1a39e0={};var _0x2c740e;var _0x20ac0a;return db[_0xbab5('0x2c')]['findOne']({'where':{'id':_0xf517bb['params']['id']}})['then'](handleEntityNotFound(_0x152720,null))[_0xbab5('0x25')](function(_0x2045a8){if(_0x2045a8){_0x2c740e=_0x2045a8;_0x1a39e0[_0xbab5('0x30')]=_[_0xbab5('0x32')](db['FreshdeskField'][_0xbab5('0x2d')]);_0x1a39e0[_0xbab5('0x31')]=_['keys'](_0xf517bb[_0xbab5('0x31')]);_0x1a39e0[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x1a39e0['model'],_0x1a39e0[_0xbab5('0x31')]);_0x5e2858['attributes']=_['intersection'](_0x1a39e0[_0xbab5('0x30')],qs[_0xbab5('0x35')](_0xf517bb['query'][_0xbab5('0x35')]));_0x5e2858[_0xbab5('0x34')]=_0x5e2858[_0xbab5('0x34')][_0xbab5('0x36')]?_0x5e2858[_0xbab5('0x34')]:_0x1a39e0[_0xbab5('0x30')];_0x5e2858[_0xbab5('0x38')]=qs['sort'](_0xf517bb[_0xbab5('0x31')][_0xbab5('0x39')]);_0x5e2858['where']=qs[_0xbab5('0x33')](_['pick'](_0xf517bb[_0xbab5('0x31')],_0x1a39e0['filters']));if(_0xf517bb[_0xbab5('0x31')]['filter']){_0x5e2858[_0xbab5('0x3a')]=_['merge'](_0x5e2858['where'],{'$or':_[_0xbab5('0x2b')](_0x5e2858[_0xbab5('0x34')],function(_0x202ef7){var _0x30221c={};_0x30221c[_0x202ef7]={'$like':'%'+_0xf517bb[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0x30221c;})});}_0x5e2858=_[_0xbab5('0x4b')]({},_0x5e2858,_0xf517bb['options']);return _0x2c740e['getSubjects'](_0x5e2858);}})['then'](function(_0x23e29d){if(_0x23e29d){_0x20ac0a=_0x23e29d[_0xbab5('0x36')];if(!_0xf517bb[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x5e2858[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0xf517bb['query'][_0xbab5('0x1e')]);_0x5e2858['offset']=qs[_0xbab5('0x1c')](_0xf517bb[_0xbab5('0x31')]['offset']);}return _0x2c740e[_0xbab5('0x4d')](_0x5e2858);}})['then'](function(_0x3faa7e){if(_0x3faa7e){return _0x3faa7e?{'count':_0x20ac0a,'rows':_0x3faa7e}:null;}})[_0xbab5('0x25')](respondWithResult(_0x152720,null))[_0xbab5('0x3f')](handleError(_0x152720,null));};exports[_0xbab5('0x4e')]=function(_0x749d5e,_0x187a11,_0xd2489b){var _0x34a991={};var _0x25d7cc={};var _0x357618;var _0x52e7e5;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x749d5e[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x187a11,null))[_0xbab5('0x25')](function(_0x6e50fa){if(_0x6e50fa){_0x357618=_0x6e50fa;_0x25d7cc['model']=_[_0xbab5('0x32')](db['FreshdeskField'][_0xbab5('0x2d')]);_0x25d7cc[_0xbab5('0x31')]=_[_0xbab5('0x32')](_0x749d5e[_0xbab5('0x31')]);_0x25d7cc[_0xbab5('0x33')]=_[_0xbab5('0x41')](_0x25d7cc[_0xbab5('0x30')],_0x25d7cc[_0xbab5('0x31')]);_0x34a991[_0xbab5('0x34')]=_['intersection'](_0x25d7cc['model'],qs[_0xbab5('0x35')](_0x749d5e[_0xbab5('0x31')]['fields']));_0x34a991[_0xbab5('0x34')]=_0x34a991[_0xbab5('0x34')]['length']?_0x34a991[_0xbab5('0x34')]:_0x25d7cc[_0xbab5('0x30')];_0x34a991[_0xbab5('0x38')]=qs['sort'](_0x749d5e[_0xbab5('0x31')][_0xbab5('0x39')]);_0x34a991[_0xbab5('0x3a')]=qs['filters'](_[_0xbab5('0x4a')](_0x749d5e[_0xbab5('0x31')],_0x25d7cc[_0xbab5('0x33')]));if(_0x749d5e[_0xbab5('0x31')][_0xbab5('0x3b')]){_0x34a991[_0xbab5('0x3a')]=_['merge'](_0x34a991[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x34a991[_0xbab5('0x34')],function(_0x566a83){var _0xaa648d={};_0xaa648d[_0x566a83]={'$like':'%'+_0x749d5e[_0xbab5('0x31')][_0xbab5('0x3b')]+'%'};return _0xaa648d;})});}_0x34a991=_[_0xbab5('0x4b')]({},_0x34a991,_0x749d5e['options']);return _0x357618[_0xbab5('0x4e')](_0x34a991);}})['then'](function(_0x42b9b4){if(_0x42b9b4){_0x52e7e5=_0x42b9b4[_0xbab5('0x36')];if(!_0x749d5e[_0xbab5('0x31')]['hasOwnProperty'](_0xbab5('0x4c'))){_0x34a991[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x749d5e['query'][_0xbab5('0x1e')]);_0x34a991[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x749d5e[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x357618[_0xbab5('0x4e')](_0x34a991);}})[_0xbab5('0x25')](function(_0x184732){if(_0x184732){return _0x184732?{'count':_0x52e7e5,'rows':_0x184732}:null;}})[_0xbab5('0x25')](respondWithResult(_0x187a11,null))['catch'](handleError(_0x187a11,null));};exports['getTags']=function(_0x40c080,_0x552d65,_0x4073df){var _0x1cce42={};var _0x38d71a={};var _0x5bc38f;var _0x3180af;return db[_0xbab5('0x2c')][_0xbab5('0x47')]({'where':{'id':_0x40c080['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x552d65,null))[_0xbab5('0x25')](function(_0x270dcd){if(_0x270dcd){_0x5bc38f=_0x270dcd;_0x38d71a['model']=_[_0xbab5('0x32')](db['Tag'][_0xbab5('0x2d')]);_0x38d71a['query']=_[_0xbab5('0x32')](_0x40c080[_0xbab5('0x31')]);_0x38d71a[_0xbab5('0x33')]=_['intersection'](_0x38d71a[_0xbab5('0x30')],_0x38d71a['query']);_0x1cce42[_0xbab5('0x34')]=_[_0xbab5('0x41')](_0x38d71a['model'],qs[_0xbab5('0x35')](_0x40c080['query'][_0xbab5('0x35')]));_0x1cce42[_0xbab5('0x34')]=_0x1cce42[_0xbab5('0x34')][_0xbab5('0x36')]?_0x1cce42[_0xbab5('0x34')]:_0x38d71a['model'];_0x1cce42[_0xbab5('0x38')]=qs['sort'](_0x40c080[_0xbab5('0x31')][_0xbab5('0x39')]);_0x1cce42[_0xbab5('0x3a')]=qs[_0xbab5('0x33')](_[_0xbab5('0x4a')](_0x40c080[_0xbab5('0x31')],_0x38d71a[_0xbab5('0x33')]));if(_0x40c080['query'][_0xbab5('0x3b')]){_0x1cce42['where']=_['merge'](_0x1cce42[_0xbab5('0x3a')],{'$or':_[_0xbab5('0x2b')](_0x1cce42['attributes'],function(_0x217b13){var _0x4a1e22={};_0x4a1e22[_0x217b13]={'$like':'%'+_0x40c080[_0xbab5('0x31')]['filter']+'%'};return _0x4a1e22;})});}_0x1cce42=_[_0xbab5('0x4b')]({},_0x1cce42,_0x40c080[_0xbab5('0x3c')]);return _0x5bc38f[_0xbab5('0x4f')](_0x1cce42);}})['then'](function(_0x4513d6){if(_0x4513d6){_0x3180af=_0x4513d6[_0xbab5('0x36')];if(!_0x40c080[_0xbab5('0x31')][_0xbab5('0x37')]('nolimit')){_0x1cce42[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x40c080[_0xbab5('0x31')]['limit']);_0x1cce42['offset']=qs[_0xbab5('0x1c')](_0x40c080[_0xbab5('0x31')][_0xbab5('0x1c')]);}return _0x5bc38f[_0xbab5('0x4f')](_0x1cce42);}})[_0xbab5('0x25')](function(_0x402a98){if(_0x402a98){return _0x402a98?{'count':_0x3180af,'rows':_0x402a98}:null;}})[_0xbab5('0x25')](respondWithResult(_0x552d65,null))['catch'](handleError(_0x552d65,null));};exports['setTags']=function(_0x18ff4e,_0x21d9a9,_0x3256a3){if(_0x18ff4e[_0xbab5('0x44')]['id']){delete _0x18ff4e['body']['id'];}return db[_0xbab5('0x2c')]['findOne']({'where':{'id':_0x18ff4e[_0xbab5('0x48')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x21d9a9,null))[_0xbab5('0x25')](function(_0x525fcb){if(_0x525fcb){return _0x525fcb[_0xbab5('0x50')](_0x18ff4e[_0xbab5('0x44')][_0xbab5('0x51')]||[]);}return null;})[_0xbab5('0x25')](respondWithResult(_0x21d9a9,null))[_0xbab5('0x3f')](handleError(_0x21d9a9,null));}; \ No newline at end of file +var _0xc64a=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','getFields','findOne','sort','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter'];(function(_0x4112ae,_0x5a916b){var _0x4c7b69=function(_0x935ca8){while(--_0x935ca8){_0x4112ae['push'](_0x4112ae['shift']());}};_0x4c7b69(++_0x5a916b);}(_0xc64a,0x1cf));var _0xac64=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc64a[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0xac64('0x0'));var rimraf=require(_0xac64('0x1'));var zipdir=require(_0xac64('0x2'));var jsonpatch=require(_0xac64('0x3'));var rp=require(_0xac64('0x4'));var moment=require(_0xac64('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xac64('0x6'));var util=require(_0xac64('0x7'));var path=require(_0xac64('0x8'));var sox=require(_0xac64('0x9'));var csv=require(_0xac64('0xa'));var ejs=require(_0xac64('0xb'));var fs=require('fs');var fs_extra=require(_0xac64('0xc'));var _=require(_0xac64('0xd'));var squel=require(_0xac64('0xe'));var crypto=require(_0xac64('0xf'));var jsforce=require(_0xac64('0x10'));var deskjs=require(_0xac64('0x11'));var toCsv=require(_0xac64('0xa'));var querystring=require(_0xac64('0x12'));var Papa=require(_0xac64('0x13'));var Redis=require(_0xac64('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xac64('0x15'));var as=require(_0xac64('0x16'));var hardwareService=require(_0xac64('0x17'));var logger=require('../../config/logger')(_0xac64('0x18'));var utils=require(_0xac64('0x19'));var config=require(_0xac64('0x1a'));var licenseUtil=require(_0xac64('0x1b'));var db=require(_0xac64('0x1c'))['db'];function respondWithStatusCode(_0x2ed664,_0x5d8292){_0x5d8292=_0x5d8292||0xcc;return function(_0x7b51b3){if(_0x7b51b3){return _0x2ed664[_0xac64('0x1d')](_0x5d8292);}return _0x2ed664[_0xac64('0x1e')](_0x5d8292)['end']();};}function respondWithResult(_0x15bdf7,_0x76876a){_0x76876a=_0x76876a||0xc8;return function(_0x424024){if(_0x424024){return _0x15bdf7['status'](_0x76876a)[_0xac64('0x1f')](_0x424024);}};}function respondWithFilteredResult(_0x58001d,_0x2aa971){return function(_0x43f26d){if(_0x43f26d){var _0x1d0a08=typeof _0x2aa971[_0xac64('0x20')]===_0xac64('0x21')&&typeof _0x2aa971[_0xac64('0x22')]==='undefined';var _0x197c3b=_0x43f26d[_0xac64('0x23')];var _0x2ae052=_0x1d0a08?0x0:_0x2aa971[_0xac64('0x20')];var _0x3a969a=_0x1d0a08?_0x43f26d[_0xac64('0x23')]:_0x2aa971['offset']+_0x2aa971[_0xac64('0x22')];var _0x180abe;if(_0x3a969a>=_0x197c3b){_0x3a969a=_0x197c3b;_0x180abe=0xc8;}else{_0x180abe=0xce;}_0x58001d[_0xac64('0x1e')](_0x180abe);return _0x58001d[_0xac64('0x24')]('Content-Range',_0x2ae052+'-'+_0x3a969a+'/'+_0x197c3b)['json'](_0x43f26d);}return null;};}function patchUpdates(_0x4db2ed){return function(_0x40af3d){try{jsonpatch['apply'](_0x40af3d,_0x4db2ed,!![]);}catch(_0x2ce49b){return BPromise[_0xac64('0x25')](_0x2ce49b);}return _0x40af3d[_0xac64('0x26')]();};}function saveUpdates(_0x3f2e4c,_0x299c1e){return function(_0x5938c6){if(_0x5938c6){return _0x5938c6[_0xac64('0x27')](_0x3f2e4c)[_0xac64('0x28')](function(_0x29ae96){return _0x29ae96;});}return null;};}function removeEntity(_0x13f9d7,_0xfda4a0){return function(_0xefcaea){if(_0xefcaea){return _0xefcaea[_0xac64('0x29')]()[_0xac64('0x28')](function(){_0x13f9d7['status'](0xcc)[_0xac64('0x2a')]();});}};}function handleEntityNotFound(_0x516b3e,_0xc23926){return function(_0x20c920){if(!_0x20c920){_0x516b3e[_0xac64('0x1d')](0x194);}return _0x20c920;};}function handleError(_0x57e46a,_0x40d960){_0x40d960=_0x40d960||0x1f4;return function(_0x187e11){logger[_0xac64('0x2b')](_0x187e11[_0xac64('0x2c')]);if(_0x187e11[_0xac64('0x2d')]){delete _0x187e11[_0xac64('0x2d')];}_0x57e46a[_0xac64('0x1e')](_0x40d960)[_0xac64('0x2e')](_0x187e11);};}exports[_0xac64('0x2f')]=function(_0x16e758,_0x112dde){var _0x3f2e8c={},_0x58b7c6={},_0x1d756f={'count':0x0,'rows':[]};var _0x37ace8=_[_0xac64('0x30')](db[_0xac64('0x31')][_0xac64('0x32')],function(_0x30386e){return{'name':_0x30386e[_0xac64('0x33')],'type':_0x30386e['type']['key']};});_0x58b7c6[_0xac64('0x34')]=_[_0xac64('0x30')](_0x37ace8,_0xac64('0x2d'));_0x58b7c6[_0xac64('0x35')]=_['keys'](_0x16e758[_0xac64('0x35')]);_0x58b7c6['filters']=_[_0xac64('0x36')](_0x58b7c6[_0xac64('0x34')],_0x58b7c6[_0xac64('0x35')]);_0x3f2e8c[_0xac64('0x37')]=_[_0xac64('0x36')](_0x58b7c6[_0xac64('0x34')],qs[_0xac64('0x38')](_0x16e758[_0xac64('0x35')][_0xac64('0x38')]));_0x3f2e8c[_0xac64('0x37')]=_0x3f2e8c[_0xac64('0x37')][_0xac64('0x39')]?_0x3f2e8c['attributes']:_0x58b7c6[_0xac64('0x34')];if(!_0x16e758[_0xac64('0x35')][_0xac64('0x3a')](_0xac64('0x3b'))){_0x3f2e8c['limit']=qs[_0xac64('0x22')](_0x16e758[_0xac64('0x35')][_0xac64('0x22')]);_0x3f2e8c[_0xac64('0x20')]=qs[_0xac64('0x20')](_0x16e758[_0xac64('0x35')]['offset']);}_0x3f2e8c[_0xac64('0x3c')]=qs['sort'](_0x16e758[_0xac64('0x35')]['sort']);_0x3f2e8c[_0xac64('0x3d')]=qs[_0xac64('0x3e')](_[_0xac64('0x3f')](_0x16e758[_0xac64('0x35')],_0x58b7c6[_0xac64('0x3e')]),_0x37ace8);if(_0x16e758['query'][_0xac64('0x40')]){_0x3f2e8c['where']=_[_0xac64('0x41')](_0x3f2e8c['where'],{'$or':_['map'](_0x37ace8,function(_0x5a79f1){if(_0x5a79f1['type']!==_0xac64('0x42')){var _0x35fd0b={};_0x35fd0b[_0x5a79f1[_0xac64('0x2d')]]={'$like':'%'+_0x16e758[_0xac64('0x35')][_0xac64('0x40')]+'%'};return _0x35fd0b;}})});}_0x3f2e8c=_[_0xac64('0x41')]({},_0x3f2e8c,_0x16e758['options']);var _0x5e7da9={'where':_0x3f2e8c[_0xac64('0x3d')]};return db[_0xac64('0x31')][_0xac64('0x23')](_0x5e7da9)['then'](function(_0x4459e7){_0x1d756f[_0xac64('0x23')]=_0x4459e7;if(_0x16e758[_0xac64('0x35')][_0xac64('0x43')]){_0x3f2e8c[_0xac64('0x44')]=[{'all':!![]}];}return db[_0xac64('0x31')][_0xac64('0x45')](_0x3f2e8c);})[_0xac64('0x28')](function(_0x45ac06){_0x1d756f[_0xac64('0x46')]=_0x45ac06;return _0x1d756f;})[_0xac64('0x28')](respondWithFilteredResult(_0x112dde,_0x3f2e8c))[_0xac64('0x47')](handleError(_0x112dde,null));};exports[_0xac64('0x48')]=function(_0x33e050,_0xc0e193){var _0x307859={'raw':![],'where':{'id':_0x33e050[_0xac64('0x49')]['id']}},_0x4770b7={};_0x4770b7[_0xac64('0x34')]=_[_0xac64('0x4a')](db['FreshdeskConfiguration'][_0xac64('0x32')]);_0x4770b7['query']=_[_0xac64('0x4a')](_0x33e050[_0xac64('0x35')]);_0x4770b7['filters']=_[_0xac64('0x36')](_0x4770b7['model'],_0x4770b7[_0xac64('0x35')]);_0x307859['attributes']=_[_0xac64('0x36')](_0x4770b7[_0xac64('0x34')],qs[_0xac64('0x38')](_0x33e050[_0xac64('0x35')][_0xac64('0x38')]));_0x307859['attributes']=_0x307859[_0xac64('0x37')]['length']?_0x307859[_0xac64('0x37')]:_0x4770b7['model'];if(_0x33e050[_0xac64('0x35')][_0xac64('0x43')]){_0x307859[_0xac64('0x44')]=[{'all':!![]}];}_0x307859=_[_0xac64('0x41')]({},_0x307859,_0x33e050[_0xac64('0x4b')]);return db['FreshdeskConfiguration'][_0xac64('0x4c')](_0x307859)[_0xac64('0x28')](handleEntityNotFound(_0xc0e193,null))[_0xac64('0x28')](respondWithResult(_0xc0e193,null))['catch'](handleError(_0xc0e193,null));};exports[_0xac64('0x4d')]=function(_0xed9490,_0x44ded7){return db[_0xac64('0x31')][_0xac64('0x4d')](_0xed9490[_0xac64('0x4e')],{})[_0xac64('0x28')](respondWithResult(_0x44ded7,0xc9))['catch'](handleError(_0x44ded7,null));};exports[_0xac64('0x27')]=function(_0x5ba262,_0x33e4e0){if(_0x5ba262[_0xac64('0x4e')]['id']){delete _0x5ba262[_0xac64('0x4e')]['id'];}return db[_0xac64('0x31')][_0xac64('0x4c')]({'where':{'id':_0x5ba262[_0xac64('0x49')]['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x33e4e0,null))['then'](saveUpdates(_0x5ba262['body'],null))[_0xac64('0x28')](respondWithResult(_0x33e4e0,null))[_0xac64('0x47')](handleError(_0x33e4e0,null));};exports['destroy']=function(_0x4e9d8f,_0x49028d){return db[_0xac64('0x31')][_0xac64('0x4c')]({'where':{'id':_0x4e9d8f[_0xac64('0x49')]['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x49028d,null))['then'](removeEntity(_0x49028d,null))['catch'](handleError(_0x49028d,null));};exports[_0xac64('0x4f')]=function(_0x1d8620,_0xb45806,_0xd97476){var _0x33ffed={};var _0x21730a={};var _0x25848e;var _0x1eb516;return db['FreshdeskConfiguration'][_0xac64('0x50')]({'where':{'id':_0x1d8620[_0xac64('0x49')]['id']}})['then'](handleEntityNotFound(_0xb45806,null))['then'](function(_0xb757e3){if(_0xb757e3){_0x25848e=_0xb757e3;_0x21730a[_0xac64('0x34')]=_['keys'](db['FreshdeskField'][_0xac64('0x32')]);_0x21730a['query']=_[_0xac64('0x4a')](_0x1d8620[_0xac64('0x35')]);_0x21730a[_0xac64('0x3e')]=_[_0xac64('0x36')](_0x21730a[_0xac64('0x34')],_0x21730a[_0xac64('0x35')]);_0x33ffed['attributes']=_[_0xac64('0x36')](_0x21730a[_0xac64('0x34')],qs['fields'](_0x1d8620[_0xac64('0x35')][_0xac64('0x38')]));_0x33ffed[_0xac64('0x37')]=_0x33ffed['attributes'][_0xac64('0x39')]?_0x33ffed[_0xac64('0x37')]:_0x21730a[_0xac64('0x34')];_0x33ffed[_0xac64('0x3c')]=qs[_0xac64('0x51')](_0x1d8620[_0xac64('0x35')][_0xac64('0x51')]);_0x33ffed[_0xac64('0x3d')]=qs[_0xac64('0x3e')](_[_0xac64('0x3f')](_0x1d8620['query'],_0x21730a['filters']));if(_0x1d8620[_0xac64('0x35')][_0xac64('0x40')]){_0x33ffed['where']=_[_0xac64('0x41')](_0x33ffed['where'],{'$or':_[_0xac64('0x30')](_0x33ffed[_0xac64('0x37')],function(_0x41933f){var _0x471319={};_0x471319[_0x41933f]={'$like':'%'+_0x1d8620[_0xac64('0x35')][_0xac64('0x40')]+'%'};return _0x471319;})});}_0x33ffed=_[_0xac64('0x41')]({},_0x33ffed,_0x1d8620[_0xac64('0x4b')]);return _0x25848e[_0xac64('0x4f')](_0x33ffed);}})[_0xac64('0x28')](function(_0x1d5dad){if(_0x1d5dad){_0x1eb516=_0x1d5dad[_0xac64('0x39')];if(!_0x1d8620['query'][_0xac64('0x3a')]('nolimit')){_0x33ffed[_0xac64('0x22')]=qs[_0xac64('0x22')](_0x1d8620['query'][_0xac64('0x22')]);_0x33ffed[_0xac64('0x20')]=qs[_0xac64('0x20')](_0x1d8620['query']['offset']);}return _0x25848e[_0xac64('0x4f')](_0x33ffed);}})[_0xac64('0x28')](function(_0x164c03){if(_0x164c03){return _0x164c03?{'count':_0x1eb516,'rows':_0x164c03}:null;}})['then'](respondWithResult(_0xb45806,null))[_0xac64('0x47')](handleError(_0xb45806,null));};exports[_0xac64('0x52')]=function(_0x5aab90,_0x203864,_0x8e984){var _0x2e1720={};var _0x59fd51={};var _0x46cef1;var _0x269ff0;return db[_0xac64('0x31')][_0xac64('0x50')]({'where':{'id':_0x5aab90[_0xac64('0x49')]['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x203864,null))[_0xac64('0x28')](function(_0x12d5c4){if(_0x12d5c4){_0x46cef1=_0x12d5c4;_0x59fd51[_0xac64('0x34')]=_[_0xac64('0x4a')](db[_0xac64('0x53')][_0xac64('0x32')]);_0x59fd51[_0xac64('0x35')]=_['keys'](_0x5aab90['query']);_0x59fd51[_0xac64('0x3e')]=_['intersection'](_0x59fd51[_0xac64('0x34')],_0x59fd51[_0xac64('0x35')]);_0x2e1720[_0xac64('0x37')]=_[_0xac64('0x36')](_0x59fd51[_0xac64('0x34')],qs[_0xac64('0x38')](_0x5aab90[_0xac64('0x35')][_0xac64('0x38')]));_0x2e1720[_0xac64('0x37')]=_0x2e1720[_0xac64('0x37')]['length']?_0x2e1720[_0xac64('0x37')]:_0x59fd51[_0xac64('0x34')];_0x2e1720[_0xac64('0x3c')]=qs[_0xac64('0x51')](_0x5aab90[_0xac64('0x35')]['sort']);_0x2e1720[_0xac64('0x3d')]=qs[_0xac64('0x3e')](_['pick'](_0x5aab90[_0xac64('0x35')],_0x59fd51['filters']));if(_0x5aab90[_0xac64('0x35')][_0xac64('0x40')]){_0x2e1720[_0xac64('0x3d')]=_['merge'](_0x2e1720[_0xac64('0x3d')],{'$or':_[_0xac64('0x30')](_0x2e1720[_0xac64('0x37')],function(_0x300dcf){var _0x5309a8={};_0x5309a8[_0x300dcf]={'$like':'%'+_0x5aab90[_0xac64('0x35')][_0xac64('0x40')]+'%'};return _0x5309a8;})});}_0x2e1720=_[_0xac64('0x41')]({},_0x2e1720,_0x5aab90['options']);return _0x46cef1[_0xac64('0x52')](_0x2e1720);}})[_0xac64('0x28')](function(_0x47843b){if(_0x47843b){_0x269ff0=_0x47843b[_0xac64('0x39')];if(!_0x5aab90[_0xac64('0x35')][_0xac64('0x3a')](_0xac64('0x3b'))){_0x2e1720[_0xac64('0x22')]=qs[_0xac64('0x22')](_0x5aab90['query'][_0xac64('0x22')]);_0x2e1720[_0xac64('0x20')]=qs[_0xac64('0x20')](_0x5aab90[_0xac64('0x35')]['offset']);}return _0x46cef1[_0xac64('0x52')](_0x2e1720);}})[_0xac64('0x28')](function(_0x101421){if(_0x101421){return _0x101421?{'count':_0x269ff0,'rows':_0x101421}:null;}})['then'](respondWithResult(_0x203864,null))['catch'](handleError(_0x203864,null));};exports[_0xac64('0x54')]=function(_0x3279e8,_0x35ec1d,_0x10235e){var _0x1522ac={};var _0x76fee={};var _0x3f457f;var _0x29f236;return db[_0xac64('0x31')][_0xac64('0x50')]({'where':{'id':_0x3279e8[_0xac64('0x49')]['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x35ec1d,null))[_0xac64('0x28')](function(_0x3a27bf){if(_0x3a27bf){_0x3f457f=_0x3a27bf;_0x76fee[_0xac64('0x34')]=_[_0xac64('0x4a')](db[_0xac64('0x53')][_0xac64('0x32')]);_0x76fee[_0xac64('0x35')]=_[_0xac64('0x4a')](_0x3279e8[_0xac64('0x35')]);_0x76fee[_0xac64('0x3e')]=_[_0xac64('0x36')](_0x76fee[_0xac64('0x34')],_0x76fee[_0xac64('0x35')]);_0x1522ac[_0xac64('0x37')]=_['intersection'](_0x76fee[_0xac64('0x34')],qs[_0xac64('0x38')](_0x3279e8[_0xac64('0x35')][_0xac64('0x38')]));_0x1522ac[_0xac64('0x37')]=_0x1522ac['attributes'][_0xac64('0x39')]?_0x1522ac[_0xac64('0x37')]:_0x76fee[_0xac64('0x34')];_0x1522ac[_0xac64('0x3c')]=qs[_0xac64('0x51')](_0x3279e8['query'][_0xac64('0x51')]);_0x1522ac[_0xac64('0x3d')]=qs['filters'](_['pick'](_0x3279e8[_0xac64('0x35')],_0x76fee['filters']));if(_0x3279e8[_0xac64('0x35')]['filter']){_0x1522ac['where']=_[_0xac64('0x41')](_0x1522ac['where'],{'$or':_[_0xac64('0x30')](_0x1522ac['attributes'],function(_0x46c641){var _0x2bf5f3={};_0x2bf5f3[_0x46c641]={'$like':'%'+_0x3279e8[_0xac64('0x35')][_0xac64('0x40')]+'%'};return _0x2bf5f3;})});}_0x1522ac=_[_0xac64('0x41')]({},_0x1522ac,_0x3279e8[_0xac64('0x4b')]);return _0x3f457f[_0xac64('0x54')](_0x1522ac);}})[_0xac64('0x28')](function(_0x271eab){if(_0x271eab){_0x29f236=_0x271eab[_0xac64('0x39')];if(!_0x3279e8[_0xac64('0x35')]['hasOwnProperty']('nolimit')){_0x1522ac[_0xac64('0x22')]=qs[_0xac64('0x22')](_0x3279e8[_0xac64('0x35')][_0xac64('0x22')]);_0x1522ac[_0xac64('0x20')]=qs[_0xac64('0x20')](_0x3279e8[_0xac64('0x35')][_0xac64('0x20')]);}return _0x3f457f['getDescriptions'](_0x1522ac);}})[_0xac64('0x28')](function(_0x4d51e8){if(_0x4d51e8){return _0x4d51e8?{'count':_0x29f236,'rows':_0x4d51e8}:null;}})['then'](respondWithResult(_0x35ec1d,null))['catch'](handleError(_0x35ec1d,null));};exports[_0xac64('0x55')]=function(_0x3e2570,_0x22397a,_0x2d14e9){var _0x2bb6d1={};var _0x4d2ae4={};var _0x323328;var _0x444850;return db[_0xac64('0x31')][_0xac64('0x50')]({'where':{'id':_0x3e2570[_0xac64('0x49')]['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x22397a,null))['then'](function(_0x4dfd59){if(_0x4dfd59){_0x323328=_0x4dfd59;_0x4d2ae4[_0xac64('0x34')]=_[_0xac64('0x4a')](db['Tag'][_0xac64('0x32')]);_0x4d2ae4[_0xac64('0x35')]=_[_0xac64('0x4a')](_0x3e2570[_0xac64('0x35')]);_0x4d2ae4[_0xac64('0x3e')]=_[_0xac64('0x36')](_0x4d2ae4[_0xac64('0x34')],_0x4d2ae4['query']);_0x2bb6d1['attributes']=_[_0xac64('0x36')](_0x4d2ae4['model'],qs[_0xac64('0x38')](_0x3e2570[_0xac64('0x35')][_0xac64('0x38')]));_0x2bb6d1['attributes']=_0x2bb6d1['attributes']['length']?_0x2bb6d1[_0xac64('0x37')]:_0x4d2ae4[_0xac64('0x34')];_0x2bb6d1[_0xac64('0x3c')]=qs['sort'](_0x3e2570[_0xac64('0x35')][_0xac64('0x51')]);_0x2bb6d1[_0xac64('0x3d')]=qs[_0xac64('0x3e')](_['pick'](_0x3e2570[_0xac64('0x35')],_0x4d2ae4[_0xac64('0x3e')]));if(_0x3e2570['query'][_0xac64('0x40')]){_0x2bb6d1[_0xac64('0x3d')]=_['merge'](_0x2bb6d1['where'],{'$or':_[_0xac64('0x30')](_0x2bb6d1['attributes'],function(_0x2572bb){var _0x579e9a={};_0x579e9a[_0x2572bb]={'$like':'%'+_0x3e2570['query'][_0xac64('0x40')]+'%'};return _0x579e9a;})});}_0x2bb6d1=_[_0xac64('0x41')]({},_0x2bb6d1,_0x3e2570[_0xac64('0x4b')]);return _0x323328[_0xac64('0x55')](_0x2bb6d1);}})['then'](function(_0x48a2ba){if(_0x48a2ba){_0x444850=_0x48a2ba['length'];if(!_0x3e2570[_0xac64('0x35')][_0xac64('0x3a')]('nolimit')){_0x2bb6d1[_0xac64('0x22')]=qs[_0xac64('0x22')](_0x3e2570[_0xac64('0x35')]['limit']);_0x2bb6d1[_0xac64('0x20')]=qs[_0xac64('0x20')](_0x3e2570[_0xac64('0x35')][_0xac64('0x20')]);}return _0x323328[_0xac64('0x55')](_0x2bb6d1);}})['then'](function(_0x4df4d4){if(_0x4df4d4){return _0x4df4d4?{'count':_0x444850,'rows':_0x4df4d4}:null;}})[_0xac64('0x28')](respondWithResult(_0x22397a,null))[_0xac64('0x47')](handleError(_0x22397a,null));};exports[_0xac64('0x56')]=function(_0x1a052b,_0x5e165d,_0x461a35){if(_0x1a052b[_0xac64('0x4e')]['id']){delete _0x1a052b['body']['id'];}return db[_0xac64('0x31')][_0xac64('0x50')]({'where':{'id':_0x1a052b['params']['id']}})[_0xac64('0x28')](handleEntityNotFound(_0x5e165d,null))['then'](function(_0xadb24c){if(_0xadb24c){return _0xadb24c[_0xac64('0x56')](_0x1a052b['body'][_0xac64('0x57')]||[]);}return null;})['then'](respondWithResult(_0x5e165d,null))[_0xac64('0x47')](handleError(_0x5e165d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c747c44..2f4ff00 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 _0x54d6=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x27a16c,_0x13b849){var _0x322bf1=function(_0x1c7bf0){while(--_0x1c7bf0){_0x27a16c['push'](_0x27a16c['shift']());}};_0x322bf1(++_0x13b849);}(_0x54d6,0x1d9));var _0x654d=function(_0x2b3c82,_0x127b8a){_0x2b3c82=_0x2b3c82-0x0;var _0x99a562=_0x54d6[_0x2b3c82];return _0x99a562;};'use strict';var _=require(_0x654d('0x0'));var util=require('util');var logger=require(_0x654d('0x1'))(_0x654d('0x2'));var moment=require(_0x654d('0x3'));var BPromise=require('bluebird');var rp=require(_0x654d('0x4'));var fs=require('fs');var path=require(_0x654d('0x5'));var rimraf=require(_0x654d('0x6'));var config=require(_0x654d('0x7'));var attributes=require(_0x654d('0x8'));module[_0x654d('0x9')]=function(_0x4ab299,_0x2255c8){return _0x4ab299[_0x654d('0xa')](_0x654d('0xb'),attributes,{'tableName':_0x654d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3aa2=['int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x3aa2,0xf3));var _0x23aa=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0x3aa2[_0x1b2667];return _0x179ae8;};'use strict';var _=require(_0x23aa('0x0'));var util=require('util');var logger=require(_0x23aa('0x1'))(_0x23aa('0x2'));var moment=require(_0x23aa('0x3'));var BPromise=require(_0x23aa('0x4'));var rp=require(_0x23aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23aa('0x6'));var attributes=require(_0x23aa('0x7'));module[_0x23aa('0x8')]=function(_0x3e366e,_0x32b5a5){return _0x3e366e['define'](_0x23aa('0x9'),attributes,{'tableName':_0x23aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 6af3792..5384c41 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 _0x9d23=['error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x472209,_0x423db0){var _0x4a1fe2=function(_0x3141d9){while(--_0x3141d9){_0x472209['push'](_0x472209['shift']());}};_0x4a1fe2(++_0x423db0);}(_0x9d23,0xdc));var _0x39d2=function(_0x508aa8,_0x2daa29){_0x508aa8=_0x508aa8-0x0;var _0x2e6b6f=_0x9d23[_0x508aa8];return _0x2e6b6f;};'use strict';var _=require(_0x39d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39d2('0x1'));var fs=require('fs');var Redis=require(_0x39d2('0x2'));var db=require(_0x39d2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x39d2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x39d2('0x5')][_0x39d2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x370593,_0x41d438,_0x8a1a1e){return new BPromise(function(_0x1d46a5,_0x3875c3){return client[_0x39d2('0x7')](_0x370593,_0x8a1a1e)['then'](function(_0x1e06a5){logger[_0x39d2('0x8')](_0x39d2('0x9'),_0x41d438,'request\x20sent');logger[_0x39d2('0xa')](_0x39d2('0xb'),_0x41d438,_0x39d2('0xc'),JSON[_0x39d2('0xd')](_0x1e06a5));if(_0x1e06a5[_0x39d2('0xe')]){if(_0x1e06a5[_0x39d2('0xe')][_0x39d2('0xf')]===0x1f4){logger['error'](_0x39d2('0x9'),_0x41d438,_0x1e06a5['error'][_0x39d2('0x10')]);return _0x3875c3(_0x1e06a5[_0x39d2('0xe')]['message']);}logger[_0x39d2('0xe')](_0x39d2('0x9'),_0x41d438,_0x1e06a5[_0x39d2('0xe')][_0x39d2('0x10')]);return _0x1d46a5(_0x1e06a5[_0x39d2('0xe')][_0x39d2('0x10')]);}else{logger[_0x39d2('0x8')](_0x39d2('0x9'),_0x41d438,_0x39d2('0xc'));_0x1d46a5(_0x1e06a5[_0x39d2('0x11')][_0x39d2('0x10')]);}})['catch'](function(_0x37fd0b){logger[_0x39d2('0xe')](_0x39d2('0x9'),_0x41d438,_0x37fd0b);_0x3875c3(_0x37fd0b);});});} \ No newline at end of file +var _0xe3aa=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0xe3aa,0x18f));var _0xae3a=function(_0xd9bd25,_0x143a07){_0xd9bd25=_0xd9bd25-0x0;var _0x356b29=_0xe3aa[_0xd9bd25];return _0x356b29;};'use strict';var _=require(_0xae3a('0x0'));var util=require(_0xae3a('0x1'));var moment=require(_0xae3a('0x2'));var BPromise=require(_0xae3a('0x3'));var rs=require(_0xae3a('0x4'));var fs=require('fs');var Redis=require(_0xae3a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae3a('0x6'))(_0xae3a('0x7'));var config=require(_0xae3a('0x8'));var jayson=require(_0xae3a('0x9'));var client=jayson[_0xae3a('0xa')][_0xae3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b5f51,_0x20c9fc,_0x51e60d){return new BPromise(function(_0x1f2059,_0x29d194){return client[_0xae3a('0xc')](_0x5b5f51,_0x51e60d)[_0xae3a('0xd')](function(_0x386342){logger[_0xae3a('0xe')](_0xae3a('0xf'),_0x20c9fc,'request\x20sent');logger[_0xae3a('0x10')](_0xae3a('0x11'),_0x20c9fc,_0xae3a('0x12'),JSON[_0xae3a('0x13')](_0x386342));if(_0x386342[_0xae3a('0x14')]){if(_0x386342[_0xae3a('0x14')][_0xae3a('0x15')]===0x1f4){logger[_0xae3a('0x14')](_0xae3a('0xf'),_0x20c9fc,_0x386342['error']['message']);return _0x29d194(_0x386342[_0xae3a('0x14')][_0xae3a('0x16')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x20c9fc,_0x386342[_0xae3a('0x14')][_0xae3a('0x16')]);return _0x1f2059(_0x386342[_0xae3a('0x14')]['message']);}else{logger[_0xae3a('0xe')](_0xae3a('0xf'),_0x20c9fc,_0xae3a('0x12'));_0x1f2059(_0x386342[_0xae3a('0x17')][_0xae3a('0x16')]);}})[_0xae3a('0x18')](function(_0x3f30f0){logger[_0xae3a('0x14')](_0xae3a('0xf'),_0x20c9fc,_0x3f30f0);_0x29d194(_0x3f30f0);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e009e39..39e1d53 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 _0xe838=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path'];(function(_0x1f70e1,_0x3b2b60){var _0x52fe71=function(_0x45861d){while(--_0x45861d){_0x1f70e1['push'](_0x1f70e1['shift']());}};_0x52fe71(++_0x3b2b60);}(_0xe838,0x1c9));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x8e83('0x0'));var util=require(_0x8e83('0x1'));var path=require(_0x8e83('0x2'));var timeout=require(_0x8e83('0x3'));var express=require(_0x8e83('0x4'));var router=express[_0x8e83('0x5')]();var fs_extra=require(_0x8e83('0x6'));var auth=require(_0x8e83('0x7'));var interaction=require(_0x8e83('0x8'));var config=require(_0x8e83('0x9'));var controller=require(_0x8e83('0xa'));router[_0x8e83('0xb')]('/',auth[_0x8e83('0xc')](),controller[_0x8e83('0xd')]);router[_0x8e83('0xb')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller[_0x8e83('0xf')]);router[_0x8e83('0x10')]('/',auth[_0x8e83('0xc')](),controller['create']);router[_0x8e83('0x11')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller[_0x8e83('0x12')]);router[_0x8e83('0x13')](_0x8e83('0xe'),auth[_0x8e83('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7ed0=['exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x1a620d,_0x5f05e7){var _0x2a402a=function(_0x232554){while(--_0x232554){_0x1a620d['push'](_0x1a620d['shift']());}};_0x2a402a(++_0x5f05e7);}(_0x7ed0,0x144));var _0x07ed=function(_0x5cd6fa,_0x88ad08){_0x5cd6fa=_0x5cd6fa-0x0;var _0x3906da=_0x7ed0[_0x5cd6fa];return _0x3906da;};'use strict';var multer=require(_0x07ed('0x0'));var util=require('util');var path=require(_0x07ed('0x1'));var timeout=require(_0x07ed('0x2'));var express=require(_0x07ed('0x3'));var router=express['Router']();var fs_extra=require(_0x07ed('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x07ed('0x5'));var controller=require(_0x07ed('0x6'));router[_0x07ed('0x7')]('/',auth[_0x07ed('0x8')](),controller['index']);router[_0x07ed('0x7')](_0x07ed('0x9'),auth[_0x07ed('0x8')](),controller[_0x07ed('0xa')]);router[_0x07ed('0xb')]('/',auth[_0x07ed('0x8')](),controller[_0x07ed('0xc')]);router[_0x07ed('0xd')](_0x07ed('0x9'),auth[_0x07ed('0x8')](),controller[_0x07ed('0xe')]);router[_0x07ed('0xf')](_0x07ed('0x9'),auth[_0x07ed('0x8')](),controller['destroy']);module[_0x07ed('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index c3413c0..9d0a85e 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 _0xa3cf=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5da9e1,_0xc580f8){var _0x21a139=function(_0x35b0cd){while(--_0x35b0cd){_0x5da9e1['push'](_0x5da9e1['shift']());}};_0x21a139(++_0xc580f8);}(_0xa3cf,0xad));var _0xfa3c=function(_0x212cc5,_0x2f415c){_0x212cc5=_0x212cc5-0x0;var _0x5a2c40=_0xa3cf[_0x212cc5];return _0x5a2c40;};'use strict';var Sequelize=require(_0xfa3c('0x0'));module[_0xfa3c('0x1')]={'type':{'type':Sequelize[_0xfa3c('0x2')](_0xfa3c('0x3'),_0xfa3c('0x4'),_0xfa3c('0x5'),_0xfa3c('0x6'),_0xfa3c('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa3c('0x8')]},'key':{'type':Sequelize[_0xfa3c('0x8')]},'keyType':{'type':Sequelize[_0xfa3c('0x2')]('string',_0xfa3c('0x4'),_0xfa3c('0x5'))},'keyContent':{'type':Sequelize[_0xfa3c('0x8')]},'idField':{'type':Sequelize[_0xfa3c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb934=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3dce18,_0x53b680){var _0xf9ce3e=function(_0x152155){while(--_0x152155){_0x3dce18['push'](_0x3dce18['shift']());}};_0xf9ce3e(++_0x53b680);}(_0xb934,0x6a));var _0x4b93=function(_0x1795f5,_0x41922c){_0x1795f5=_0x1795f5-0x0;var _0x50ef29=_0xb934[_0x1795f5];return _0x50ef29;};'use strict';var Sequelize=require(_0x4b93('0x0'));module[_0x4b93('0x1')]={'type':{'type':Sequelize[_0x4b93('0x2')](_0x4b93('0x3'),_0x4b93('0x4'),'customVariable',_0x4b93('0x5'),_0x4b93('0x6')),'defaultValue':_0x4b93('0x3')},'content':{'type':Sequelize[_0x4b93('0x7')]},'key':{'type':Sequelize[_0x4b93('0x7')]},'keyType':{'type':Sequelize[_0x4b93('0x2')](_0x4b93('0x3'),_0x4b93('0x4'),_0x4b93('0x8'))},'keyContent':{'type':Sequelize[_0x4b93('0x7')]},'idField':{'type':Sequelize[_0x4b93('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4b93('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b93('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7e9aa42..7f1da46 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 _0x9bde=['catch','show','params','includeAll','include','create','body','update','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','rows'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9bde,0xe1));var _0xe9bd=function(_0x597691,_0x140fed){_0x597691=_0x597691-0x0;var _0x24c8ef=_0x9bde[_0x597691];return _0x24c8ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={},_0x1de54c={},_0x56e409={'count':0x0,'rows':[]};var _0xa45eb0=_[_0xe9bd('0x2b')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')],function(_0x4057df){return{'name':_0x4057df['fieldName'],'type':_0x4057df['type'][_0xe9bd('0x2e')]};});_0x1de54c[_0xe9bd('0x2f')]=_[_0xe9bd('0x2b')](_0xa45eb0,_0xe9bd('0x28'));_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x183601[_0xe9bd('0x30')]);_0x1de54c[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1de54c['model'],_0x1de54c[_0xe9bd('0x30')]);_0x5b7f1d[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1de54c['model'],qs['fields'](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x5b7f1d[_0xe9bd('0x34')]=_0x5b7f1d[_0xe9bd('0x34')][_0xe9bd('0x36')]?_0x5b7f1d[_0xe9bd('0x34')]:_0x1de54c[_0xe9bd('0x2f')];if(!_0x183601[_0xe9bd('0x30')][_0xe9bd('0x37')](_0xe9bd('0x38'))){_0x5b7f1d[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x1e')]);_0x5b7f1d[_0xe9bd('0x20')]=qs[_0xe9bd('0x20')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x20')]);}_0x5b7f1d['order']=qs[_0xe9bd('0x39')](_0x183601[_0xe9bd('0x30')]['sort']);_0x5b7f1d[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_['pick'](_0x183601['query'],_0x1de54c[_0xe9bd('0x32')]),_0xa45eb0);if(_0x183601[_0xe9bd('0x30')]['filter']){_0x5b7f1d[_0xe9bd('0x3a')]=_[_0xe9bd('0x3b')](_0x5b7f1d[_0xe9bd('0x3a')],{'$or':_['map'](_0xa45eb0,function(_0x19740b){if(_0x19740b['type']!==_0xe9bd('0x3c')){var _0x42238a={};_0x42238a[_0x19740b[_0xe9bd('0x28')]]={'$like':'%'+_0x183601[_0xe9bd('0x30')]['filter']+'%'};return _0x42238a;}})});}_0x5b7f1d=_[_0xe9bd('0x3b')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x3d')]);var _0x327e1a={'where':_0x5b7f1d[_0xe9bd('0x3a')]};return db[_0xe9bd('0x2c')][_0xe9bd('0x1f')](_0x327e1a)[_0xe9bd('0x25')](function(_0xacfd19){_0x56e409[_0xe9bd('0x1f')]=_0xacfd19;if(_0x183601[_0xe9bd('0x30')]['includeAll']){_0x5b7f1d['include']=[{'all':!![]}];}return db[_0xe9bd('0x2c')]['findAll'](_0x5b7f1d);})[_0xe9bd('0x25')](function(_0x340819){_0x56e409[_0xe9bd('0x3e')]=_0x340819;return _0x56e409;})['then'](respondWithFilteredResult(_0x519f48,_0x5b7f1d))[_0xe9bd('0x3f')](handleError(_0x519f48,null));};exports[_0xe9bd('0x40')]=function(_0x1a2d94,_0x5a4460){var _0x2ef01b={'raw':!![],'where':{'id':_0x1a2d94[_0xe9bd('0x41')]['id']}},_0x3a5703={};_0x3a5703[_0xe9bd('0x2f')]=_[_0xe9bd('0x31')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')]);_0x3a5703[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1a2d94[_0xe9bd('0x30')]);_0x3a5703[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x3a5703[_0xe9bd('0x2f')],_0x3a5703[_0xe9bd('0x30')]);_0x2ef01b[_0xe9bd('0x34')]=_['intersection'](_0x3a5703['model'],qs[_0xe9bd('0x35')](_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x2ef01b['attributes']=_0x2ef01b['attributes'][_0xe9bd('0x36')]?_0x2ef01b[_0xe9bd('0x34')]:_0x3a5703[_0xe9bd('0x2f')];if(_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x42')]){_0x2ef01b[_0xe9bd('0x43')]=[{'all':!![]}];}_0x2ef01b=_[_0xe9bd('0x3b')]({},_0x2ef01b,_0x1a2d94['options']);return db[_0xe9bd('0x2c')]['find'](_0x2ef01b)[_0xe9bd('0x25')](handleEntityNotFound(_0x5a4460,null))[_0xe9bd('0x25')](respondWithResult(_0x5a4460,null))[_0xe9bd('0x3f')](handleError(_0x5a4460,null));};exports[_0xe9bd('0x44')]=function(_0x74ea23,_0x4b7b67){return db[_0xe9bd('0x2c')][_0xe9bd('0x44')](_0x74ea23[_0xe9bd('0x45')],{})['then'](respondWithResult(_0x4b7b67,0xc9))[_0xe9bd('0x3f')](handleError(_0x4b7b67,null));};exports[_0xe9bd('0x46')]=function(_0x34f787,_0x5a466b){if(_0x34f787[_0xe9bd('0x45')]['id']){delete _0x34f787[_0xe9bd('0x45')]['id'];}return db[_0xe9bd('0x2c')][_0xe9bd('0x47')]({'where':{'id':_0x34f787[_0xe9bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a466b,null))[_0xe9bd('0x25')](saveUpdates(_0x34f787['body'],null))[_0xe9bd('0x25')](respondWithResult(_0x5a466b,null))[_0xe9bd('0x3f')](handleError(_0x5a466b,null));};exports[_0xe9bd('0x26')]=function(_0x14b06b,_0x194b7d){return db['FreshdeskField'][_0xe9bd('0x47')]({'where':{'id':_0x14b06b['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x194b7d,null))[_0xe9bd('0x25')](removeEntity(_0x194b7d,null))['catch'](handleError(_0x194b7d,null));}; \ No newline at end of file +var _0x6f7a=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','sendStatus','error','name','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x10bb5a,_0x1d922a){var _0x52aa04=function(_0x5c1f45){while(--_0x5c1f45){_0x10bb5a['push'](_0x10bb5a['shift']());}};_0x52aa04(++_0x1d922a);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x393d0d,_0x5b36f3){_0x393d0d=_0x393d0d-0x0;var _0x166238=_0x6f7a[_0x393d0d];return _0x166238;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ef97,_0x402d25){return function(_0x5efdce){if(!_0x5efdce){_0x47ef97[_0xa6f7('0x23')](0x194);}return _0x5efdce;};}function handleError(_0x126d24,_0x3c79ea){_0x3c79ea=_0x3c79ea||0x1f4;return function(_0x2b4c6c){logger[_0xa6f7('0x24')](_0x2b4c6c['stack']);if(_0x2b4c6c['name']){delete _0x2b4c6c[_0xa6f7('0x25')];}_0x126d24[_0xa6f7('0x19')](_0x3c79ea)['send'](_0x2b4c6c);};}exports[_0xa6f7('0x26')]=function(_0x27babb,_0x87bccc){var _0x3a7ff9={},_0x224f5a={},_0x10bf77={'count':0x0,'rows':[]};var _0x353de8=_[_0xa6f7('0x27')](db[_0xa6f7('0x28')][_0xa6f7('0x29')],function(_0x40b0f8){return{'name':_0x40b0f8[_0xa6f7('0x2a')],'type':_0x40b0f8['type'][_0xa6f7('0x2b')]};});_0x224f5a[_0xa6f7('0x2c')]=_['map'](_0x353de8,_0xa6f7('0x25'));_0x224f5a[_0xa6f7('0x2d')]=_['keys'](_0x27babb['query']);_0x224f5a[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x224f5a[_0xa6f7('0x2c')],_0x224f5a[_0xa6f7('0x2d')]);_0x3a7ff9[_0xa6f7('0x30')]=_['intersection'](_0x224f5a['model'],qs[_0xa6f7('0x31')](_0x27babb['query'][_0xa6f7('0x31')]));_0x3a7ff9[_0xa6f7('0x30')]=_0x3a7ff9[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x3a7ff9[_0xa6f7('0x30')]:_0x224f5a[_0xa6f7('0x2c')];if(!_0x27babb['query'][_0xa6f7('0x33')](_0xa6f7('0x34'))){_0x3a7ff9[_0xa6f7('0x1d')]=qs['limit'](_0x27babb[_0xa6f7('0x2d')]['limit']);_0x3a7ff9[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x27babb[_0xa6f7('0x2d')]['offset']);}_0x3a7ff9[_0xa6f7('0x35')]=qs[_0xa6f7('0x36')](_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x36')]);_0x3a7ff9[_0xa6f7('0x37')]=qs[_0xa6f7('0x2e')](_['pick'](_0x27babb[_0xa6f7('0x2d')],_0x224f5a[_0xa6f7('0x2e')]),_0x353de8);if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]){_0x3a7ff9[_0xa6f7('0x37')]=_[_0xa6f7('0x39')](_0x3a7ff9[_0xa6f7('0x37')],{'$or':_[_0xa6f7('0x27')](_0x353de8,function(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x3a')]!==_0xa6f7('0x3b')){var _0x353e54={};_0x353e54[_0x4c2d2e['name']]={'$like':'%'+_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]+'%'};return _0x353e54;}})});}_0x3a7ff9=_['merge']({},_0x3a7ff9,_0x27babb[_0xa6f7('0x3c')]);var _0x13c7c4={'where':_0x3a7ff9[_0xa6f7('0x37')]};return db[_0xa6f7('0x28')][_0xa6f7('0x1f')](_0x13c7c4)['then'](function(_0x2e3eb2){_0x10bf77[_0xa6f7('0x1f')]=_0x2e3eb2;if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x3a7ff9[_0xa6f7('0x3e')]=[{'all':!![]}];}return db[_0xa6f7('0x28')][_0xa6f7('0x3f')](_0x3a7ff9);})[_0xa6f7('0x40')](function(_0x5646b9){_0x10bf77['rows']=_0x5646b9;return _0x10bf77;})[_0xa6f7('0x40')](respondWithFilteredResult(_0x87bccc,_0x3a7ff9))[_0xa6f7('0x41')](handleError(_0x87bccc,null));};exports[_0xa6f7('0x42')]=function(_0x2546a3,_0x2ac07f){var _0x387714={'raw':!![],'where':{'id':_0x2546a3[_0xa6f7('0x43')]['id']}},_0x21fdd7={};_0x21fdd7[_0xa6f7('0x2c')]=_[_0xa6f7('0x44')](db['FreshdeskField'][_0xa6f7('0x29')]);_0x21fdd7[_0xa6f7('0x2d')]=_['keys'](_0x2546a3[_0xa6f7('0x2d')]);_0x21fdd7[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x21fdd7[_0xa6f7('0x2c')],_0x21fdd7['query']);_0x387714[_0xa6f7('0x30')]=_['intersection'](_0x21fdd7['model'],qs[_0xa6f7('0x31')](_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x31')]));_0x387714[_0xa6f7('0x30')]=_0x387714[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x387714[_0xa6f7('0x30')]:_0x21fdd7['model'];if(_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x387714['include']=[{'all':!![]}];}_0x387714=_[_0xa6f7('0x39')]({},_0x387714,_0x2546a3[_0xa6f7('0x3c')]);return db[_0xa6f7('0x28')]['find'](_0x387714)[_0xa6f7('0x40')](handleEntityNotFound(_0x2ac07f,null))['then'](respondWithResult(_0x2ac07f,null))[_0xa6f7('0x41')](handleError(_0x2ac07f,null));};exports[_0xa6f7('0x45')]=function(_0x260e77,_0x5f3c84){return db['FreshdeskField'][_0xa6f7('0x45')](_0x260e77['body'],{})[_0xa6f7('0x40')](respondWithResult(_0x5f3c84,0xc9))['catch'](handleError(_0x5f3c84,null));};exports['update']=function(_0x1e7089,_0x2e3a04){if(_0x1e7089[_0xa6f7('0x46')]['id']){delete _0x1e7089[_0xa6f7('0x46')]['id'];}return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x1e7089['params']['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x2e3a04,null))[_0xa6f7('0x40')](saveUpdates(_0x1e7089['body'],null))[_0xa6f7('0x40')](respondWithResult(_0x2e3a04,null))['catch'](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x48')]=function(_0x59091a,_0x488efc){return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x59091a[_0xa6f7('0x43')]['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x488efc,null))[_0xa6f7('0x40')](removeEntity(_0x488efc,null))['catch'](handleError(_0x488efc,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 4d0d392..d8ca36f 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 _0x4ac8=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path'];(function(_0x186683,_0x39ea45){var _0x29e712=function(_0x4b2a65){while(--_0x4b2a65){_0x186683['push'](_0x186683['shift']());}};_0x29e712(++_0x39ea45);}(_0x4ac8,0x72));var _0x84ac=function(_0x2f92e0,_0x424b37){_0x2f92e0=_0x2f92e0-0x0;var _0x5918d5=_0x4ac8[_0x2f92e0];return _0x5918d5;};'use strict';var _=require('lodash');var util=require(_0x84ac('0x0'));var logger=require(_0x84ac('0x1'))(_0x84ac('0x2'));var moment=require(_0x84ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x84ac('0x4'));var fs=require('fs');var path=require(_0x84ac('0x5'));var rimraf=require(_0x84ac('0x6'));var config=require(_0x84ac('0x7'));var attributes=require(_0x84ac('0x8'));module[_0x84ac('0x9')]=function(_0x347353,_0x126fdc){return _0x347353[_0x84ac('0xa')](_0x84ac('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x84ac('0xc'),'fields':[_0x84ac('0xd'),_0x84ac('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63c9=['rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c0412,_0x2ab04b){var _0xf4c7a5=function(_0x48df4c){while(--_0x48df4c){_0x5c0412['push'](_0x5c0412['shift']());}};_0xf4c7a5(++_0x2ab04b);}(_0x63c9,0x140));var _0x963c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x63c9[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x963c('0x0'))(_0x963c('0x1'));var moment=require(_0x963c('0x2'));var BPromise=require(_0x963c('0x3'));var rp=require(_0x963c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x963c('0x5'));var config=require('../../config/environment');var attributes=require(_0x963c('0x6'));module[_0x963c('0x7')]=function(_0x2c2ebe,_0x3e5757){return _0x2c2ebe[_0x963c('0x8')]('FreshdeskField',attributes,{'tableName':_0x963c('0x9'),'paranoid':![],'indexes':[{'name':_0x963c('0xa'),'fields':[_0x963c('0xb'),_0x963c('0xc')],'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 070b0c0..eed18ca 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 _0x7a97=['../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x19d183,_0x46212c){var _0x300293=function(_0x3a5185){while(--_0x3a5185){_0x19d183['push'](_0x19d183['shift']());}};_0x300293(++_0x46212c);}(_0x7a97,0x1db));var _0x77a9=function(_0x59fc88,_0x49f15d){_0x59fc88=_0x59fc88-0x0;var _0x47baed=_0x7a97[_0x59fc88];return _0x47baed;};'use strict';var _=require(_0x77a9('0x0'));var util=require(_0x77a9('0x1'));var moment=require(_0x77a9('0x2'));var BPromise=require(_0x77a9('0x3'));var rs=require(_0x77a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77a9('0x5'))['db'];var utils=require(_0x77a9('0x6'));var logger=require('../../config/logger')(_0x77a9('0x7'));var config=require(_0x77a9('0x8'));var jayson=require(_0x77a9('0x9'));var client=jayson[_0x77a9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x493a8b,_0x22bc95,_0x5ac332){return new BPromise(function(_0x1f5b9f,_0x149200){return client[_0x77a9('0xb')](_0x493a8b,_0x5ac332)[_0x77a9('0xc')](function(_0x390651){logger[_0x77a9('0xd')](_0x77a9('0xe'),_0x22bc95,'request\x20sent');logger[_0x77a9('0xf')](_0x77a9('0x10'),_0x22bc95,'request\x20sent',JSON['stringify'](_0x390651));if(_0x390651['error']){if(_0x390651[_0x77a9('0x11')][_0x77a9('0x12')]===0x1f4){logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);return _0x149200(_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);}logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x390651[_0x77a9('0x11')]['message']);return _0x1f5b9f(_0x390651[_0x77a9('0x11')][_0x77a9('0x13')]);}else{logger[_0x77a9('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x22bc95,_0x77a9('0x14'));_0x1f5b9f(_0x390651[_0x77a9('0x15')][_0x77a9('0x13')]);}})[_0x77a9('0x16')](function(_0x14448d){logger[_0x77a9('0x11')](_0x77a9('0xe'),_0x22bc95,_0x14448d);_0x149200(_0x14448d);});});} \ No newline at end of file +var _0x6fde=['rpc','../../config/environment','client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x36b57e,_0x30aa66){var _0x2b9282=function(_0x4b195c){while(--_0x4b195c){_0x36b57e['push'](_0x36b57e['shift']());}};_0x2b9282(++_0x30aa66);}(_0x6fde,0x1ab));var _0xe6fd=function(_0x34ceba,_0x16935c){_0x34ceba=_0x34ceba-0x0;var _0x5864c8=_0x6fde[_0x34ceba];return _0x5864c8;};'use strict';var _=require(_0xe6fd('0x0'));var util=require(_0xe6fd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe6fd('0x2'));var fs=require('fs');var Redis=require(_0xe6fd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6fd('0x4'));var logger=require('../../config/logger')(_0xe6fd('0x5'));var config=require(_0xe6fd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe6fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x313833,_0x39d63b,_0x4b55a4){return new BPromise(function(_0x1154c6,_0x54bd6d){return client['request'](_0x313833,_0x4b55a4)[_0xe6fd('0x8')](function(_0x5609a0){logger['info'](_0xe6fd('0x9'),_0x39d63b,_0xe6fd('0xa'));logger[_0xe6fd('0xb')](_0xe6fd('0xc'),_0x39d63b,'request\x20sent',JSON[_0xe6fd('0xd')](_0x5609a0));if(_0x5609a0[_0xe6fd('0xe')]){if(_0x5609a0[_0xe6fd('0xe')][_0xe6fd('0xf')]===0x1f4){logger[_0xe6fd('0xe')](_0xe6fd('0x9'),_0x39d63b,_0x5609a0[_0xe6fd('0xe')][_0xe6fd('0x10')]);return _0x54bd6d(_0x5609a0[_0xe6fd('0xe')]['message']);}logger[_0xe6fd('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x39d63b,_0x5609a0[_0xe6fd('0xe')][_0xe6fd('0x10')]);return _0x1154c6(_0x5609a0['error'][_0xe6fd('0x10')]);}else{logger[_0xe6fd('0x11')](_0xe6fd('0x9'),_0x39d63b,_0xe6fd('0xa'));_0x1154c6(_0x5609a0['result'][_0xe6fd('0x10')]);}})['catch'](function(_0x552f61){logger[_0xe6fd('0xe')](_0xe6fd('0x9'),_0x39d63b,_0x552f61);_0x54bd6d(_0x552f61);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 580dec0..c2aafab 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 _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x1ea866,_0x254f7d){var _0x2ccb4d=function(_0x34aa7c){while(--_0x34aa7c){_0x1ea866['push'](_0x1ea866['shift']());}};_0x2ccb4d(++_0x254f7d);}(_0xe511,0x16f));var _0x1e51=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0xe511[_0x451959];return _0x490269;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file +var _0x80ed=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','multer','path'];(function(_0x35084d,_0x195954){var _0x4cfe59=function(_0x1cbd67){while(--_0x1cbd67){_0x35084d['push'](_0x35084d['shift']());}};_0x4cfe59(++_0x195954);}(_0x80ed,0x11c));var _0xd80e=function(_0x40de4a,_0x35a709){_0x40de4a=_0x40de4a-0x0;var _0x4b1514=_0x80ed[_0x40de4a];return _0x4b1514;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getFields']);router[_0xd80e('0x10')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x10')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x12')]);router[_0xd80e('0x13')](_0xd80e('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd80e('0x9')](),controller[_0xd80e('0x14')]);module[_0xd80e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b15c1a8..5bac878 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 _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xb78e,0x1c9));var _0xeb78=function(_0x381d42,_0x1593ec){_0x381d42=_0x381d42-0x0;var _0x2c9ff1=_0xb78e[_0x381d42];return _0x2c9ff1;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x46bda5,_0x50f30a){var _0x25a43b=function(_0xecfeb0){while(--_0xecfeb0){_0x46bda5['push'](_0x46bda5['shift']());}};_0x25a43b(++_0x50f30a);}(_0x7916,0x128));var _0x6791=function(_0x1188a1,_0x7563ba){_0x1188a1=_0x1188a1-0x0;var _0x3e43b5=_0x7916[_0x1188a1];return _0x3e43b5;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 5200aaf..ada36aa 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 _0x9bbc=['email','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','type','Descriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','%s%s','Token\x20token=','users'];(function(_0x1a6ced,_0x337b70){var _0x7925c2=function(_0x5b84d3){while(--_0x5b84d3){_0x1a6ced['push'](_0x1a6ced['shift']());}};_0x7925c2(++_0x337b70);}(_0x9bbc,0x1a6));var _0xc9bb=function(_0x41c2df,_0x1d24e2){_0x41c2df=_0x41c2df-0x0;var _0x2fbe2f=_0x9bbc[_0x41c2df];return _0x2fbe2f;};'use strict';var emlformat=require(_0xc9bb('0x0'));var rimraf=require(_0xc9bb('0x1'));var zipdir=require(_0xc9bb('0x2'));var jsonpatch=require(_0xc9bb('0x3'));var rp=require(_0xc9bb('0x4'));var moment=require(_0xc9bb('0x5'));var BPromise=require(_0xc9bb('0x6'));var Mustache=require(_0xc9bb('0x7'));var util=require(_0xc9bb('0x8'));var path=require(_0xc9bb('0x9'));var sox=require(_0xc9bb('0xa'));var csv=require(_0xc9bb('0xb'));var ejs=require(_0xc9bb('0xc'));var fs=require('fs');var fs_extra=require(_0xc9bb('0xd'));var _=require(_0xc9bb('0xe'));var squel=require(_0xc9bb('0xf'));var crypto=require(_0xc9bb('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xc9bb('0x11'));var toCsv=require(_0xc9bb('0xb'));var querystring=require(_0xc9bb('0x12'));var Papa=require(_0xc9bb('0x13'));var Redis=require(_0xc9bb('0x14'));var authService=require(_0xc9bb('0x15'));var qs=require(_0xc9bb('0x16'));var as=require(_0xc9bb('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9bb('0x18'))(_0xc9bb('0x19'));var utils=require(_0xc9bb('0x1a'));var config=require(_0xc9bb('0x1b'));var licenseUtil=require(_0xc9bb('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc9bb('0x1d'));function respondWithStatusCode(_0x3890b7,_0x486625){_0x486625=_0x486625||0xcc;return function(_0x3f5126){if(_0x3f5126){return _0x3890b7[_0xc9bb('0x1e')](_0x486625);}return _0x3890b7[_0xc9bb('0x1f')](_0x486625)[_0xc9bb('0x20')]();};}function respondWithResult(_0x19f065,_0xd8a552){_0xd8a552=_0xd8a552||0xc8;return function(_0xa5b10c){if(_0xa5b10c){return _0x19f065[_0xc9bb('0x1f')](_0xd8a552)[_0xc9bb('0x21')](_0xa5b10c);}};}function respondWithFilteredResult(_0x3ee77b,_0x1806ec){return function(_0x2af7b0){if(_0x2af7b0){var _0x5124ff=typeof _0x1806ec[_0xc9bb('0x22')]===_0xc9bb('0x23')&&typeof _0x1806ec[_0xc9bb('0x24')]===_0xc9bb('0x23');var _0x58f82d=_0x2af7b0[_0xc9bb('0x25')];var _0x539dda=_0x5124ff?0x0:_0x1806ec[_0xc9bb('0x22')];var _0x2b4a83=_0x5124ff?_0x2af7b0['count']:_0x1806ec[_0xc9bb('0x22')]+_0x1806ec[_0xc9bb('0x24')];var _0x75b05f;if(_0x2b4a83>=_0x58f82d){_0x2b4a83=_0x58f82d;_0x75b05f=0xc8;}else{_0x75b05f=0xce;}_0x3ee77b[_0xc9bb('0x1f')](_0x75b05f);return _0x3ee77b[_0xc9bb('0x26')]('Content-Range',_0x539dda+'-'+_0x2b4a83+'/'+_0x58f82d)[_0xc9bb('0x21')](_0x2af7b0);}return null;};}function patchUpdates(_0x55197f){return function(_0xfe2177){try{jsonpatch['apply'](_0xfe2177,_0x55197f,!![]);}catch(_0x4fffdf){return BPromise[_0xc9bb('0x27')](_0x4fffdf);}return _0xfe2177[_0xc9bb('0x28')]();};}function saveUpdates(_0x44123e,_0x1358e3){return function(_0x1a2c8c){if(_0x1a2c8c){return _0x1a2c8c[_0xc9bb('0x29')](_0x44123e)[_0xc9bb('0x2a')](function(_0x499253){return _0x499253;});}return null;};}function removeEntity(_0x2fadd7,_0x209b4d){return function(_0x304a46){if(_0x304a46){return _0x304a46[_0xc9bb('0x2b')]()[_0xc9bb('0x2a')](function(){_0x2fadd7['status'](0xcc)[_0xc9bb('0x20')]();});}};}function handleEntityNotFound(_0xb39b6d,_0x13c8c0){return function(_0x1e420a){if(!_0x1e420a){_0xb39b6d[_0xc9bb('0x1e')](0x194);}return _0x1e420a;};}function handleError(_0x369ae7,_0x5c1a8a){_0x5c1a8a=_0x5c1a8a||0x1f4;return function(_0x45b994){logger['error'](_0x45b994[_0xc9bb('0x2c')]);if(_0x45b994['name']){delete _0x45b994[_0xc9bb('0x2d')];}_0x369ae7[_0xc9bb('0x1f')](_0x5c1a8a)[_0xc9bb('0x2e')](_0x45b994);};}exports['index']=function(_0x5e2a91,_0x560232){var _0x118389={},_0x138a48={},_0x487a08={'count':0x0,'rows':[]};var _0x15385d=_[_0xc9bb('0x2f')](db[_0xc9bb('0x30')][_0xc9bb('0x31')],function(_0x456b8f){return{'name':_0x456b8f[_0xc9bb('0x32')],'type':_0x456b8f['type'][_0xc9bb('0x33')]};});_0x138a48[_0xc9bb('0x34')]=_[_0xc9bb('0x2f')](_0x15385d,_0xc9bb('0x2d'));_0x138a48[_0xc9bb('0x35')]=_[_0xc9bb('0x36')](_0x5e2a91[_0xc9bb('0x35')]);_0x138a48[_0xc9bb('0x37')]=_[_0xc9bb('0x38')](_0x138a48['model'],_0x138a48[_0xc9bb('0x35')]);_0x118389[_0xc9bb('0x39')]=_[_0xc9bb('0x38')](_0x138a48[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x5e2a91[_0xc9bb('0x35')]['fields']));_0x118389[_0xc9bb('0x39')]=_0x118389[_0xc9bb('0x39')][_0xc9bb('0x3b')]?_0x118389[_0xc9bb('0x39')]:_0x138a48[_0xc9bb('0x34')];if(!_0x5e2a91[_0xc9bb('0x35')]['hasOwnProperty'](_0xc9bb('0x3c'))){_0x118389[_0xc9bb('0x24')]=qs['limit'](_0x5e2a91['query'][_0xc9bb('0x24')]);_0x118389[_0xc9bb('0x22')]=qs[_0xc9bb('0x22')](_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x22')]);}_0x118389['order']=qs['sort'](_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3d')]);_0x118389['where']=qs[_0xc9bb('0x37')](_[_0xc9bb('0x3e')](_0x5e2a91['query'],_0x138a48['filters']),_0x15385d);if(_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3f')]){_0x118389[_0xc9bb('0x40')]=_[_0xc9bb('0x41')](_0x118389[_0xc9bb('0x40')],{'$or':_[_0xc9bb('0x2f')](_0x15385d,function(_0x1ab084){if(_0x1ab084['type']!==_0xc9bb('0x42')){var _0x21b55e={};_0x21b55e[_0x1ab084[_0xc9bb('0x2d')]]={'$like':'%'+_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x3f')]+'%'};return _0x21b55e;}})});}_0x118389=_[_0xc9bb('0x41')]({},_0x118389,_0x5e2a91['options']);var _0xc46780={'where':_0x118389[_0xc9bb('0x40')]};return db[_0xc9bb('0x30')][_0xc9bb('0x25')](_0xc46780)[_0xc9bb('0x2a')](function(_0x331189){_0x487a08[_0xc9bb('0x25')]=_0x331189;if(_0x5e2a91[_0xc9bb('0x35')][_0xc9bb('0x43')]){_0x118389[_0xc9bb('0x44')]=[{'all':!![]}];}return db[_0xc9bb('0x30')][_0xc9bb('0x45')](_0x118389);})['then'](function(_0x56c709){_0x487a08[_0xc9bb('0x46')]=_0x56c709;return _0x487a08;})['then'](respondWithFilteredResult(_0x560232,_0x118389))[_0xc9bb('0x47')](handleError(_0x560232,null));};exports['show']=function(_0x13fa24,_0x19dec4){var _0x270594={'raw':![],'where':{'id':_0x13fa24['params']['id']}},_0x51bc87={};_0x51bc87[_0xc9bb('0x34')]=_['keys'](db[_0xc9bb('0x30')][_0xc9bb('0x31')]);_0x51bc87['query']=_['keys'](_0x13fa24[_0xc9bb('0x35')]);_0x51bc87[_0xc9bb('0x37')]=_[_0xc9bb('0x38')](_0x51bc87[_0xc9bb('0x34')],_0x51bc87[_0xc9bb('0x35')]);_0x270594[_0xc9bb('0x39')]=_[_0xc9bb('0x38')](_0x51bc87[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x13fa24[_0xc9bb('0x35')]['fields']));_0x270594[_0xc9bb('0x39')]=_0x270594['attributes'][_0xc9bb('0x3b')]?_0x270594[_0xc9bb('0x39')]:_0x51bc87[_0xc9bb('0x34')];if(_0x13fa24[_0xc9bb('0x35')]['includeAll']){_0x270594[_0xc9bb('0x44')]=[{'all':!![]}];}_0x270594=_[_0xc9bb('0x41')]({},_0x270594,_0x13fa24[_0xc9bb('0x48')]);return db[_0xc9bb('0x30')][_0xc9bb('0x49')](_0x270594)[_0xc9bb('0x2a')](handleEntityNotFound(_0x19dec4,null))[_0xc9bb('0x2a')](respondWithResult(_0x19dec4,null))[_0xc9bb('0x47')](handleError(_0x19dec4,null));};exports[_0xc9bb('0x4a')]=function(_0x36356b,_0x2a609d){return db[_0xc9bb('0x30')][_0xc9bb('0x4a')](_0x36356b[_0xc9bb('0x4b')],{})[_0xc9bb('0x2a')](respondWithResult(_0x2a609d,0xc9))[_0xc9bb('0x47')](handleError(_0x2a609d,null));};exports[_0xc9bb('0x29')]=function(_0x374edd,_0x33ad6c){if(_0x374edd[_0xc9bb('0x4b')]['id']){delete _0x374edd[_0xc9bb('0x4b')]['id'];}return db[_0xc9bb('0x30')]['find']({'where':{'id':_0x374edd[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x33ad6c,null))[_0xc9bb('0x2a')](saveUpdates(_0x374edd[_0xc9bb('0x4b')],null))[_0xc9bb('0x2a')](respondWithResult(_0x33ad6c,null))[_0xc9bb('0x47')](handleError(_0x33ad6c,null));};exports['destroy']=function(_0x5686ed,_0x46ef50){return db[_0xc9bb('0x30')][_0xc9bb('0x49')]({'where':{'id':_0x5686ed[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x46ef50,null))['then'](removeEntity(_0x46ef50,null))[_0xc9bb('0x47')](handleError(_0x46ef50,null));};exports[_0xc9bb('0x4d')]=function(_0x394ee0,_0x16dca8,_0x3d5155){var _0x1caa17={};var _0x884688={};var _0x1063fe;var _0x2a15d7;return db[_0xc9bb('0x30')][_0xc9bb('0x4e')]({'where':{'id':_0x394ee0[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x16dca8,null))[_0xc9bb('0x2a')](function(_0x9b53fa){if(_0x9b53fa){_0x1063fe=_0x9b53fa;_0x884688[_0xc9bb('0x34')]=_[_0xc9bb('0x36')](db[_0xc9bb('0x4f')][_0xc9bb('0x31')]);_0x884688[_0xc9bb('0x35')]=_['keys'](_0x394ee0[_0xc9bb('0x35')]);_0x884688['filters']=_[_0xc9bb('0x38')](_0x884688[_0xc9bb('0x34')],_0x884688[_0xc9bb('0x35')]);_0x1caa17['attributes']=_[_0xc9bb('0x38')](_0x884688[_0xc9bb('0x34')],qs[_0xc9bb('0x3a')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3a')]));_0x1caa17['attributes']=_0x1caa17[_0xc9bb('0x39')][_0xc9bb('0x3b')]?_0x1caa17['attributes']:_0x884688[_0xc9bb('0x34')];_0x1caa17[_0xc9bb('0x50')]=qs[_0xc9bb('0x3d')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3d')]);_0x1caa17[_0xc9bb('0x40')]=qs[_0xc9bb('0x37')](_[_0xc9bb('0x3e')](_0x394ee0['query'],_0x884688['filters']));if(_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3f')]){_0x1caa17[_0xc9bb('0x40')]=_[_0xc9bb('0x41')](_0x1caa17[_0xc9bb('0x40')],{'$or':_[_0xc9bb('0x2f')](_0x1caa17[_0xc9bb('0x39')],function(_0x569fcf){var _0x1ffdb9={};_0x1ffdb9[_0x569fcf]={'$like':'%'+_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x3f')]+'%'};return _0x1ffdb9;})});}_0x1caa17=_[_0xc9bb('0x41')]({},_0x1caa17,_0x394ee0['options']);return _0x1063fe['getConfigurations'](_0x1caa17);}})[_0xc9bb('0x2a')](function(_0x136c70){if(_0x136c70){_0x2a15d7=_0x136c70[_0xc9bb('0x3b')];if(!_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x51')]('nolimit')){_0x1caa17[_0xc9bb('0x24')]=qs[_0xc9bb('0x24')](_0x394ee0[_0xc9bb('0x35')][_0xc9bb('0x24')]);_0x1caa17[_0xc9bb('0x22')]=qs['offset'](_0x394ee0[_0xc9bb('0x35')]['offset']);}return _0x1063fe['getConfigurations'](_0x1caa17);}})[_0xc9bb('0x2a')](function(_0x4d3334){if(_0x4d3334){return _0x4d3334?{'count':_0x2a15d7,'rows':_0x4d3334}:null;}})[_0xc9bb('0x2a')](respondWithResult(_0x16dca8,null))[_0xc9bb('0x47')](handleError(_0x16dca8,null));};exports[_0xc9bb('0x52')]=function(_0x5ee89b,_0x1cc5bd,_0x4199d8){if(_0x5ee89b['body']['id']){delete _0x5ee89b[_0xc9bb('0x4b')]['id'];}return db['FreshsalesAccount'][_0xc9bb('0x4e')]({'where':{'id':_0x5ee89b[_0xc9bb('0x4c')]['id']}})[_0xc9bb('0x2a')](handleEntityNotFound(_0x1cc5bd,null))[_0xc9bb('0x2a')](function(_0x6d1b4e){if(_0x6d1b4e){_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x53')]=_0x6d1b4e['id'];_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x54')]=integrations['getSubjects'](_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x55')],_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x56')]);_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x57')]=integrations['getDescriptions'](_0x5ee89b['body'][_0xc9bb('0x55')],_0x5ee89b[_0xc9bb('0x4b')][_0xc9bb('0x56')]);return db[_0xc9bb('0x4f')]['create'](_0x5ee89b['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xc9bb('0x54')},{'model':db[_0xc9bb('0x58')],'as':_0xc9bb('0x57')}]});}return null;})[_0xc9bb('0x2a')](respondWithResult(_0x1cc5bd,null))['catch'](handleError(_0x1cc5bd,null));};exports[_0xc9bb('0x59')]=function(_0x14c5ba,_0x413a3d,_0x118dff){var _0x40f3b6='';var _0x3f2036='';return db[_0xc9bb('0x30')][_0xc9bb('0x4e')]({'where':{'id':_0x14c5ba['params']['id']},'attributes':['id',_0xc9bb('0x5a'),_0xc9bb('0x5b'),'apiKey']})[_0xc9bb('0x2a')](handleEntityNotFound(_0x413a3d,null))[_0xc9bb('0x2a')](function(_0x1d98fa){if(_0x1d98fa){_0x3f2036=_0x1d98fa['username'];_0x40f3b6=_0x1d98fa[_0xc9bb('0x5b')];var _0x166e5c=_0x1d98fa['remoteUri'][_0xc9bb('0x5c')](-0x1);if(_0x166e5c==='/'){_0x40f3b6=_0x40f3b6[_0xc9bb('0x5d')](0x0,_0x40f3b6[_0xc9bb('0x5e')](_0x166e5c));}return rp({'method':'GET','uri':util['format'](_0xc9bb('0x5f'),_0x40f3b6,'/api/selector/owners'),'headers':{'Authorization':_0xc9bb('0x60')+_0x1d98fa['apiKey']},'json':!![]});}})[_0xc9bb('0x2a')](function(_0x38d1b2){if(_0x38d1b2){var _0x3e1e56=_0x38d1b2[_0xc9bb('0x61')];var _0x51d5d0=![];var _0x3a686f=null;for(_0x3a686f=0x0;_0x3a686f<_0x3e1e56[_0xc9bb('0x3b')];_0x3a686f++){if(_0x3e1e56[_0x3a686f][_0xc9bb('0x62')]===_0x3f2036){_0x51d5d0=!![];}}if(_0x51d5d0){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc9bb('0x2a')](respondWithResult(_0x413a3d,null))['catch'](function(_0x4cef4b){var _0x3ce521=_0x14c5ba[_0xc9bb('0x35')][_0xc9bb('0x63')]?0x1f4:_0x4cef4b[_0xc9bb('0x64')]||0x1f4;logger[_0xc9bb('0x65')](_0xc9bb('0x66'),_0xc9bb('0x59'),_0x3ce521,JSON['stringify'](_0x4cef4b));delete _0x4cef4b[_0xc9bb('0x2d')];if(_0x3ce521===0x191){_0x3ce521=0x190;}_0x413a3d[_0xc9bb('0x1f')](_0x3ce521)[_0xc9bb('0x2e')](_0x14c5ba['query'][_0xc9bb('0x63')]?{'message':_0xc9bb('0x67'),'statusCode':_0x4cef4b[_0xc9bb('0x64')]}:_0x4cef4b);});}; \ No newline at end of file +var _0x7fa6=['name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','util','path','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack'];(function(_0x4cee4b,_0x1dfff3){var _0x4d891d=function(_0x3722ba){while(--_0x3722ba){_0x4cee4b['push'](_0x4cee4b['shift']());}};_0x4d891d(++_0x1dfff3);}(_0x7fa6,0x178));var _0x67fa=function(_0x3b477a,_0x1e22ed){_0x3b477a=_0x3b477a-0x0;var _0x338aba=_0x7fa6[_0x3b477a];return _0x338aba;};'use strict';var emlformat=require(_0x67fa('0x0'));var rimraf=require(_0x67fa('0x1'));var zipdir=require(_0x67fa('0x2'));var jsonpatch=require(_0x67fa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67fa('0x4'));var path=require(_0x67fa('0x5'));var sox=require('sox');var csv=require(_0x67fa('0x6'));var ejs=require(_0x67fa('0x7'));var fs=require('fs');var fs_extra=require(_0x67fa('0x8'));var _=require(_0x67fa('0x9'));var squel=require(_0x67fa('0xa'));var crypto=require(_0x67fa('0xb'));var jsforce=require(_0x67fa('0xc'));var deskjs=require(_0x67fa('0xd'));var toCsv=require(_0x67fa('0x6'));var querystring=require('querystring');var Papa=require(_0x67fa('0xe'));var Redis=require(_0x67fa('0xf'));var authService=require(_0x67fa('0x10'));var qs=require(_0x67fa('0x11'));var as=require(_0x67fa('0x12'));var hardwareService=require(_0x67fa('0x13'));var logger=require(_0x67fa('0x14'))(_0x67fa('0x15'));var utils=require(_0x67fa('0x16'));var config=require(_0x67fa('0x17'));var licenseUtil=require(_0x67fa('0x18'));var db=require(_0x67fa('0x19'))['db'];var integrations=require(_0x67fa('0x1a'));function respondWithStatusCode(_0x456cb5,_0x1e5cce){_0x1e5cce=_0x1e5cce||0xcc;return function(_0x2e02aa){if(_0x2e02aa){return _0x456cb5[_0x67fa('0x1b')](_0x1e5cce);}return _0x456cb5[_0x67fa('0x1c')](_0x1e5cce)[_0x67fa('0x1d')]();};}function respondWithResult(_0x2a78c1,_0x5dfa47){_0x5dfa47=_0x5dfa47||0xc8;return function(_0x392f38){if(_0x392f38){return _0x2a78c1[_0x67fa('0x1c')](_0x5dfa47)[_0x67fa('0x1e')](_0x392f38);}};}function respondWithFilteredResult(_0x502056,_0x207592){return function(_0x517abd){if(_0x517abd){var _0x338c07=typeof _0x207592[_0x67fa('0x1f')]===_0x67fa('0x20')&&typeof _0x207592[_0x67fa('0x21')]===_0x67fa('0x20');var _0x242c5c=_0x517abd[_0x67fa('0x22')];var _0x5bc908=_0x338c07?0x0:_0x207592[_0x67fa('0x1f')];var _0x2976cb=_0x338c07?_0x517abd['count']:_0x207592[_0x67fa('0x1f')]+_0x207592[_0x67fa('0x21')];var _0x4fef51;if(_0x2976cb>=_0x242c5c){_0x2976cb=_0x242c5c;_0x4fef51=0xc8;}else{_0x4fef51=0xce;}_0x502056[_0x67fa('0x1c')](_0x4fef51);return _0x502056[_0x67fa('0x23')]('Content-Range',_0x5bc908+'-'+_0x2976cb+'/'+_0x242c5c)[_0x67fa('0x1e')](_0x517abd);}return null;};}function patchUpdates(_0xcb093b){return function(_0x4bad4b){try{jsonpatch[_0x67fa('0x24')](_0x4bad4b,_0xcb093b,!![]);}catch(_0x493895){return BPromise[_0x67fa('0x25')](_0x493895);}return _0x4bad4b[_0x67fa('0x26')]();};}function saveUpdates(_0x142809,_0x30916c){return function(_0x1c408b){if(_0x1c408b){return _0x1c408b[_0x67fa('0x27')](_0x142809)[_0x67fa('0x28')](function(_0x540aad){return _0x540aad;});}return null;};}function removeEntity(_0x2415e5,_0x2bae6c){return function(_0x1b9dc5){if(_0x1b9dc5){return _0x1b9dc5[_0x67fa('0x29')]()[_0x67fa('0x28')](function(){_0x2415e5[_0x67fa('0x1c')](0xcc)[_0x67fa('0x1d')]();});}};}function handleEntityNotFound(_0x1c4590,_0x1cfa30){return function(_0x759e6c){if(!_0x759e6c){_0x1c4590[_0x67fa('0x1b')](0x194);}return _0x759e6c;};}function handleError(_0x5f3c5c,_0x5aaf61){_0x5aaf61=_0x5aaf61||0x1f4;return function(_0x1be53a){logger[_0x67fa('0x2a')](_0x1be53a[_0x67fa('0x2b')]);if(_0x1be53a[_0x67fa('0x2c')]){delete _0x1be53a[_0x67fa('0x2c')];}_0x5f3c5c['status'](_0x5aaf61)[_0x67fa('0x2d')](_0x1be53a);};}exports[_0x67fa('0x2e')]=function(_0x4e4988,_0x2fcc08){var _0x5cd83c={},_0x691158={},_0x15abad={'count':0x0,'rows':[]};var _0x4a234b=_[_0x67fa('0x2f')](db[_0x67fa('0x30')][_0x67fa('0x31')],function(_0x144771){return{'name':_0x144771[_0x67fa('0x32')],'type':_0x144771[_0x67fa('0x33')][_0x67fa('0x34')]};});_0x691158[_0x67fa('0x35')]=_['map'](_0x4a234b,_0x67fa('0x2c'));_0x691158[_0x67fa('0x36')]=_[_0x67fa('0x37')](_0x4e4988['query']);_0x691158[_0x67fa('0x38')]=_[_0x67fa('0x39')](_0x691158[_0x67fa('0x35')],_0x691158[_0x67fa('0x36')]);_0x5cd83c[_0x67fa('0x3a')]=_[_0x67fa('0x39')](_0x691158[_0x67fa('0x35')],qs['fields'](_0x4e4988['query'][_0x67fa('0x3b')]));_0x5cd83c['attributes']=_0x5cd83c[_0x67fa('0x3a')][_0x67fa('0x3c')]?_0x5cd83c[_0x67fa('0x3a')]:_0x691158[_0x67fa('0x35')];if(!_0x4e4988[_0x67fa('0x36')][_0x67fa('0x3d')]('nolimit')){_0x5cd83c['limit']=qs[_0x67fa('0x21')](_0x4e4988[_0x67fa('0x36')][_0x67fa('0x21')]);_0x5cd83c[_0x67fa('0x1f')]=qs[_0x67fa('0x1f')](_0x4e4988[_0x67fa('0x36')][_0x67fa('0x1f')]);}_0x5cd83c[_0x67fa('0x3e')]=qs[_0x67fa('0x3f')](_0x4e4988[_0x67fa('0x36')][_0x67fa('0x3f')]);_0x5cd83c[_0x67fa('0x40')]=qs[_0x67fa('0x38')](_['pick'](_0x4e4988[_0x67fa('0x36')],_0x691158['filters']),_0x4a234b);if(_0x4e4988['query'][_0x67fa('0x41')]){_0x5cd83c[_0x67fa('0x40')]=_[_0x67fa('0x42')](_0x5cd83c[_0x67fa('0x40')],{'$or':_[_0x67fa('0x2f')](_0x4a234b,function(_0x259166){if(_0x259166[_0x67fa('0x33')]!=='VIRTUAL'){var _0x121116={};_0x121116[_0x259166[_0x67fa('0x2c')]]={'$like':'%'+_0x4e4988[_0x67fa('0x36')][_0x67fa('0x41')]+'%'};return _0x121116;}})});}_0x5cd83c=_[_0x67fa('0x42')]({},_0x5cd83c,_0x4e4988[_0x67fa('0x43')]);var _0x596755={'where':_0x5cd83c[_0x67fa('0x40')]};return db[_0x67fa('0x30')][_0x67fa('0x22')](_0x596755)[_0x67fa('0x28')](function(_0x15b047){_0x15abad[_0x67fa('0x22')]=_0x15b047;if(_0x4e4988[_0x67fa('0x36')]['includeAll']){_0x5cd83c['include']=[{'all':!![]}];}return db[_0x67fa('0x30')][_0x67fa('0x44')](_0x5cd83c);})[_0x67fa('0x28')](function(_0x3b525c){_0x15abad[_0x67fa('0x45')]=_0x3b525c;return _0x15abad;})[_0x67fa('0x28')](respondWithFilteredResult(_0x2fcc08,_0x5cd83c))[_0x67fa('0x46')](handleError(_0x2fcc08,null));};exports[_0x67fa('0x47')]=function(_0x456476,_0x1bda2f){var _0x429b4c={'raw':![],'where':{'id':_0x456476[_0x67fa('0x48')]['id']}},_0x37abc1={};_0x37abc1[_0x67fa('0x35')]=_[_0x67fa('0x37')](db[_0x67fa('0x30')][_0x67fa('0x31')]);_0x37abc1[_0x67fa('0x36')]=_[_0x67fa('0x37')](_0x456476[_0x67fa('0x36')]);_0x37abc1[_0x67fa('0x38')]=_[_0x67fa('0x39')](_0x37abc1[_0x67fa('0x35')],_0x37abc1['query']);_0x429b4c['attributes']=_['intersection'](_0x37abc1['model'],qs[_0x67fa('0x3b')](_0x456476[_0x67fa('0x36')][_0x67fa('0x3b')]));_0x429b4c[_0x67fa('0x3a')]=_0x429b4c[_0x67fa('0x3a')][_0x67fa('0x3c')]?_0x429b4c[_0x67fa('0x3a')]:_0x37abc1[_0x67fa('0x35')];if(_0x456476[_0x67fa('0x36')]['includeAll']){_0x429b4c['include']=[{'all':!![]}];}_0x429b4c=_[_0x67fa('0x42')]({},_0x429b4c,_0x456476[_0x67fa('0x43')]);return db['FreshsalesAccount'][_0x67fa('0x49')](_0x429b4c)[_0x67fa('0x28')](handleEntityNotFound(_0x1bda2f,null))[_0x67fa('0x28')](respondWithResult(_0x1bda2f,null))[_0x67fa('0x46')](handleError(_0x1bda2f,null));};exports['create']=function(_0xb1318a,_0x162f4a){return db[_0x67fa('0x30')][_0x67fa('0x4a')](_0xb1318a[_0x67fa('0x4b')],{})['then'](respondWithResult(_0x162f4a,0xc9))[_0x67fa('0x46')](handleError(_0x162f4a,null));};exports[_0x67fa('0x27')]=function(_0x36bdb3,_0x549043){if(_0x36bdb3[_0x67fa('0x4b')]['id']){delete _0x36bdb3[_0x67fa('0x4b')]['id'];}return db[_0x67fa('0x30')]['find']({'where':{'id':_0x36bdb3['params']['id']}})['then'](handleEntityNotFound(_0x549043,null))[_0x67fa('0x28')](saveUpdates(_0x36bdb3[_0x67fa('0x4b')],null))[_0x67fa('0x28')](respondWithResult(_0x549043,null))[_0x67fa('0x46')](handleError(_0x549043,null));};exports['destroy']=function(_0x2bb205,_0x35f9cc){return db[_0x67fa('0x30')][_0x67fa('0x49')]({'where':{'id':_0x2bb205[_0x67fa('0x48')]['id']}})['then'](handleEntityNotFound(_0x35f9cc,null))[_0x67fa('0x28')](removeEntity(_0x35f9cc,null))['catch'](handleError(_0x35f9cc,null));};exports[_0x67fa('0x4c')]=function(_0x1a709f,_0x210f49,_0xc699d){var _0x3e235c={};var _0x4b487a={};var _0x23bc9f;var _0x99cec9;return db[_0x67fa('0x30')][_0x67fa('0x4d')]({'where':{'id':_0x1a709f[_0x67fa('0x48')]['id']}})[_0x67fa('0x28')](handleEntityNotFound(_0x210f49,null))[_0x67fa('0x28')](function(_0x16ba18){if(_0x16ba18){_0x23bc9f=_0x16ba18;_0x4b487a[_0x67fa('0x35')]=_[_0x67fa('0x37')](db[_0x67fa('0x4e')][_0x67fa('0x31')]);_0x4b487a['query']=_[_0x67fa('0x37')](_0x1a709f[_0x67fa('0x36')]);_0x4b487a[_0x67fa('0x38')]=_[_0x67fa('0x39')](_0x4b487a[_0x67fa('0x35')],_0x4b487a['query']);_0x3e235c[_0x67fa('0x3a')]=_[_0x67fa('0x39')](_0x4b487a['model'],qs[_0x67fa('0x3b')](_0x1a709f[_0x67fa('0x36')][_0x67fa('0x3b')]));_0x3e235c['attributes']=_0x3e235c['attributes'][_0x67fa('0x3c')]?_0x3e235c[_0x67fa('0x3a')]:_0x4b487a[_0x67fa('0x35')];_0x3e235c[_0x67fa('0x3e')]=qs[_0x67fa('0x3f')](_0x1a709f[_0x67fa('0x36')][_0x67fa('0x3f')]);_0x3e235c[_0x67fa('0x40')]=qs['filters'](_[_0x67fa('0x4f')](_0x1a709f[_0x67fa('0x36')],_0x4b487a[_0x67fa('0x38')]));if(_0x1a709f[_0x67fa('0x36')][_0x67fa('0x41')]){_0x3e235c[_0x67fa('0x40')]=_[_0x67fa('0x42')](_0x3e235c[_0x67fa('0x40')],{'$or':_[_0x67fa('0x2f')](_0x3e235c[_0x67fa('0x3a')],function(_0x3a5140){var _0x5a4858={};_0x5a4858[_0x3a5140]={'$like':'%'+_0x1a709f[_0x67fa('0x36')][_0x67fa('0x41')]+'%'};return _0x5a4858;})});}_0x3e235c=_['merge']({},_0x3e235c,_0x1a709f[_0x67fa('0x43')]);return _0x23bc9f[_0x67fa('0x4c')](_0x3e235c);}})['then'](function(_0x472a19){if(_0x472a19){_0x99cec9=_0x472a19[_0x67fa('0x3c')];if(!_0x1a709f[_0x67fa('0x36')][_0x67fa('0x3d')]('nolimit')){_0x3e235c['limit']=qs['limit'](_0x1a709f[_0x67fa('0x36')][_0x67fa('0x21')]);_0x3e235c[_0x67fa('0x1f')]=qs[_0x67fa('0x1f')](_0x1a709f[_0x67fa('0x36')][_0x67fa('0x1f')]);}return _0x23bc9f[_0x67fa('0x4c')](_0x3e235c);}})[_0x67fa('0x28')](function(_0x2d40d2){if(_0x2d40d2){return _0x2d40d2?{'count':_0x99cec9,'rows':_0x2d40d2}:null;}})[_0x67fa('0x28')](respondWithResult(_0x210f49,null))[_0x67fa('0x46')](handleError(_0x210f49,null));};exports[_0x67fa('0x50')]=function(_0x38ebe6,_0x49db5b,_0x74e460){if(_0x38ebe6[_0x67fa('0x4b')]['id']){delete _0x38ebe6['body']['id'];}return db[_0x67fa('0x30')]['findOne']({'where':{'id':_0x38ebe6[_0x67fa('0x48')]['id']}})[_0x67fa('0x28')](handleEntityNotFound(_0x49db5b,null))[_0x67fa('0x28')](function(_0x190bdb){if(_0x190bdb){_0x38ebe6['body'][_0x67fa('0x51')]=_0x190bdb['id'];_0x38ebe6[_0x67fa('0x4b')][_0x67fa('0x52')]=integrations[_0x67fa('0x53')](_0x38ebe6['body']['channel'],_0x38ebe6[_0x67fa('0x4b')]['type']);_0x38ebe6[_0x67fa('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x38ebe6['body'][_0x67fa('0x54')],_0x38ebe6[_0x67fa('0x4b')][_0x67fa('0x33')]);return db[_0x67fa('0x4e')][_0x67fa('0x4a')](_0x38ebe6[_0x67fa('0x4b')],{'include':[{'model':db[_0x67fa('0x55')],'as':_0x67fa('0x52')},{'model':db[_0x67fa('0x55')],'as':'Descriptions'}]});}return null;})[_0x67fa('0x28')](respondWithResult(_0x49db5b,null))['catch'](handleError(_0x49db5b,null));};exports[_0x67fa('0x56')]=function(_0x6af83,_0x5e1fea,_0x3cf6db){var _0x50f5f7='';var _0x3e185f='';return db['FreshsalesAccount'][_0x67fa('0x4d')]({'where':{'id':_0x6af83[_0x67fa('0x48')]['id']},'attributes':['id',_0x67fa('0x57'),_0x67fa('0x58'),_0x67fa('0x59')]})[_0x67fa('0x28')](handleEntityNotFound(_0x5e1fea,null))[_0x67fa('0x28')](function(_0xc30d54){if(_0xc30d54){_0x3e185f=_0xc30d54[_0x67fa('0x57')];_0x50f5f7=_0xc30d54[_0x67fa('0x58')];var _0x51e89b=_0xc30d54[_0x67fa('0x58')][_0x67fa('0x5a')](-0x1);if(_0x51e89b==='/'){_0x50f5f7=_0x50f5f7[_0x67fa('0x5b')](0x0,_0x50f5f7[_0x67fa('0x5c')](_0x51e89b));}return rp({'method':_0x67fa('0x5d'),'uri':util[_0x67fa('0x5e')](_0x67fa('0x5f'),_0x50f5f7,_0x67fa('0x60')),'headers':{'Authorization':_0x67fa('0x61')+_0xc30d54[_0x67fa('0x59')]},'json':!![]});}})[_0x67fa('0x28')](function(_0x59f5f2){if(_0x59f5f2){var _0x2e4ac9=_0x59f5f2[_0x67fa('0x62')];var _0x1bf2f4=![];var _0x141ef5=null;for(_0x141ef5=0x0;_0x141ef5<_0x2e4ac9[_0x67fa('0x3c')];_0x141ef5++){if(_0x2e4ac9[_0x141ef5][_0x67fa('0x63')]===_0x3e185f){_0x1bf2f4=!![];}}if(_0x1bf2f4){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x67fa('0x28')](respondWithResult(_0x5e1fea,null))[_0x67fa('0x46')](function(_0x5f4a4d){var _0x3d410b=_0x6af83[_0x67fa('0x36')][_0x67fa('0x64')]?0x1f4:_0x5f4a4d[_0x67fa('0x65')]||0x1f4;logger[_0x67fa('0x2a')](_0x67fa('0x66'),'getFields',_0x3d410b,JSON[_0x67fa('0x67')](_0x5f4a4d));delete _0x5f4a4d[_0x67fa('0x2c')];if(_0x3d410b===0x191){_0x3d410b=0x190;}_0x5e1fea[_0x67fa('0x1c')](_0x3d410b)['send'](_0x6af83[_0x67fa('0x36')][_0x67fa('0x64')]?{'message':_0x67fa('0x68'),'statusCode':_0x5f4a4d[_0x67fa('0x65')]}:_0x5f4a4d);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 1010fee..c61777e 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 _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0xdb28,0x106));var _0x8db2=function(_0x2cb226,_0x15ea55){_0x2cb226=_0x2cb226-0x0;var _0x11f485=_0xdb28[_0x2cb226];return _0x11f485;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4df3c7,_0x520d68){var _0x2081c9=function(_0x345f8d){while(--_0x345f8d){_0x4df3c7['push'](_0x4df3c7['shift']());}};_0x2081c9(++_0x520d68);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'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 2c28675..4cd8ebb 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 _0xb016=['include','model','debug','ShowFreshsalesAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb016,0x159));var _0x6b01=function(_0x234e0e,_0x344b33){_0x234e0e=_0x234e0e-0x0;var _0x22dae2=_0xb016[_0x234e0e];return _0x22dae2;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')]({'raw':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x18')]===undefined?!![]:![]:!![],'where':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x9c6571['options']?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1b')]||null:null,'include':_0x9c6571[_0x6b01('0x17')]?_0x9c6571[_0x6b01('0x17')]['include']?_[_0x6b01('0x1c')](_0x9c6571[_0x6b01('0x17')][_0x6b01('0x1d')],function(_0x51243c){return{'model':db[_0x51243c[_0x6b01('0x1e')]],'as':_0x51243c['as'],'attributes':_0x51243c[_0x6b01('0x1a')],'include':_0x51243c[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x51243c[_0x6b01('0x1d')],function(_0x2456e9){return{'model':db[_0x2456e9[_0x6b01('0x1e')]],'as':_0x2456e9['as'],'attributes':_0x2456e9[_0x6b01('0x1a')],'include':_0x2456e9[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2456e9[_0x6b01('0x1d')],function(_0xa846d8){return{'model':db[_0xa846d8[_0x6b01('0x1e')]],'as':_0xa846d8['as'],'attributes':_0xa846d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x220efb){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1f')]('GetFreshsalesAccount',_0x9c6571,JSON['stringify'](_0x220efb));_0x18f336(_0x220efb);})[_0x6b01('0x13')](function(_0x3df3d4){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x3df3d4[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x3df3d4['message']));});});};exports[_0x6b01('0x20')]=function(_0x5482a8){var _0x3942d7=this;return new Promise(function(_0x4e7e32,_0x6920cf){return db[_0x6b01('0x15')][_0x6b01('0x21')]({'raw':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5482a8[_0x6b01('0x17')]?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x19')]||null:null,'attributes':_0x5482a8['options']?_0x5482a8['options'][_0x6b01('0x1a')]||null:null,'include':_0x5482a8['options']?_0x5482a8[_0x6b01('0x17')][_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x5482a8['options'][_0x6b01('0x1d')],function(_0x42d5f7){return{'model':db[_0x42d5f7[_0x6b01('0x1e')]],'as':_0x42d5f7['as'],'attributes':_0x42d5f7['attributes'],'include':_0x42d5f7[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x42d5f7[_0x6b01('0x1d')],function(_0x2eb34f){return{'model':db[_0x2eb34f[_0x6b01('0x1e')]],'as':_0x2eb34f['as'],'attributes':_0x2eb34f['attributes'],'include':_0x2eb34f[_0x6b01('0x1d')]?_[_0x6b01('0x1c')](_0x2eb34f[_0x6b01('0x1d')],function(_0x5269c7){return{'model':db[_0x5269c7[_0x6b01('0x1e')]],'as':_0x5269c7['as'],'attributes':_0x5269c7[_0x6b01('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6b01('0xa')](function(_0x3154d7){logger['info'](_0x6b01('0x20'),_0x5482a8);logger['debug'](_0x6b01('0x20'),_0x5482a8,JSON[_0x6b01('0xe')](_0x3154d7));_0x4e7e32(_0x3154d7);})[_0x6b01('0x13')](function(_0x318b8b){logger[_0x6b01('0xf')](_0x6b01('0x20'),_0x318b8b[_0x6b01('0x11')],_0x5482a8);_0x6920cf(_0x3942d7['error'](0x1f4,_0x318b8b[_0x6b01('0x11')]));});});}; \ No newline at end of file +var _0x781d=['model','map','GetFreshsalesAccount','find','ShowFreshsalesAccount','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0x781d,0x14a));var _0xd781=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x781d[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['GetFreshsalesAccount']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')]({'raw':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'limit':_0x1407fc[_0xd781('0x19')]?_0x1407fc['options'][_0xd781('0x1c')]||null:null,'include':_0x1407fc['options']?_0x1407fc['options'][_0xd781('0x1d')]?_['map'](_0x1407fc[_0xd781('0x19')][_0xd781('0x1d')],function(_0x395087){return{'model':db[_0x395087[_0xd781('0x1e')]],'as':_0x395087['as'],'attributes':_0x395087[_0xd781('0x1b')],'include':_0x395087[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x395087[_0xd781('0x1d')],function(_0x10940b){return{'model':db[_0x10940b['model']],'as':_0x10940b['as'],'attributes':_0x10940b['attributes'],'include':_0x10940b[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x10940b[_0xd781('0x1d')],function(_0x57b41e){return{'model':db[_0x57b41e[_0xd781('0x1e')]],'as':_0x57b41e['as'],'attributes':_0x57b41e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e29c8){logger['info'](_0xd781('0x20'),_0x1407fc);logger[_0xd781('0xf')]('GetFreshsalesAccount',_0x1407fc,JSON['stringify'](_0x1e29c8));_0x395d9c(_0x1e29c8);})[_0xd781('0x16')](function(_0x5b0464){logger[_0xd781('0x11')]('GetFreshsalesAccount',_0x5b0464[_0xd781('0x13')],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x5b0464['message']));});});};exports['ShowFreshsalesAccount']=function(_0x432d14){var _0x29e81a=this;return new Promise(function(_0x1c7d83,_0x5a389c){return db['FreshsalesAccount'][_0xd781('0x21')]({'raw':_0x432d14[_0xd781('0x19')]?_0x432d14[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'include':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x432d14[_0xd781('0x19')]['include'],function(_0x23dffb){return{'model':db[_0x23dffb[_0xd781('0x1e')]],'as':_0x23dffb['as'],'attributes':_0x23dffb[_0xd781('0x1b')],'include':_0x23dffb[_0xd781('0x1d')]?_['map'](_0x23dffb[_0xd781('0x1d')],function(_0x3f20e2){return{'model':db[_0x3f20e2['model']],'as':_0x3f20e2['as'],'attributes':_0x3f20e2[_0xd781('0x1b')],'include':_0x3f20e2['include']?_[_0xd781('0x1f')](_0x3f20e2[_0xd781('0x1d')],function(_0x57fdb6){return{'model':db[_0x57fdb6[_0xd781('0x1e')]],'as':_0x57fdb6['as'],'attributes':_0x57fdb6[_0xd781('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a29b7){logger['info'](_0xd781('0x22'),_0x432d14);logger[_0xd781('0xf')]('ShowFreshsalesAccount',_0x432d14,JSON[_0xd781('0x23')](_0x2a29b7));_0x1c7d83(_0x2a29b7);})[_0xd781('0x16')](function(_0x5651de){logger[_0xd781('0x11')](_0xd781('0x22'),_0x5651de[_0xd781('0x13')],_0x432d14);_0x5a389c(_0x29e81a['error'](0x1f4,_0x5651de[_0xd781('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d3dc0f0..082cb7d 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 _0xdf06=['create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post'];(function(_0x4a5b14,_0x239ab9){var _0x2c1cb1=function(_0x22078d){while(--_0x22078d){_0x4a5b14['push'](_0x4a5b14['shift']());}};_0x2c1cb1(++_0x239ab9);}(_0xdf06,0xb5));var _0x6df0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xdf06[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x6df0('0x0'));var util=require('util');var path=require(_0x6df0('0x1'));var timeout=require('connect-timeout');var express=require(_0x6df0('0x2'));var router=express[_0x6df0('0x3')]();var fs_extra=require(_0x6df0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6df0('0x5'));var config=require(_0x6df0('0x6'));var controller=require(_0x6df0('0x7'));router[_0x6df0('0x8')]('/',auth[_0x6df0('0x9')](),controller[_0x6df0('0xa')]);router[_0x6df0('0x8')](_0x6df0('0xb'),auth[_0x6df0('0x9')](),controller[_0x6df0('0xc')]);router[_0x6df0('0x8')](_0x6df0('0xd'),auth[_0x6df0('0x9')](),controller[_0x6df0('0xe')]);router[_0x6df0('0x8')](_0x6df0('0xf'),auth['isAuthenticated'](),controller[_0x6df0('0x10')]);router[_0x6df0('0x8')]('/:id/fields',auth[_0x6df0('0x9')](),controller[_0x6df0('0x11')]);router[_0x6df0('0x12')]('/',auth['isAuthenticated'](),controller[_0x6df0('0x13')]);router[_0x6df0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6df0('0x15')]);router[_0x6df0('0x16')]('/:id',auth[_0x6df0('0x9')](),controller[_0x6df0('0x17')]);module[_0x6df0('0x18')]=router; \ No newline at end of file +var _0xbe97=['./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xbe97,0x191));var _0x7be9=function(_0x543f08,_0x4b1582){_0x543f08=_0x543f08-0x0;var _0x515e96=_0xbe97[_0x543f08];return _0x515e96;};'use strict';var multer=require('multer');var util=require(_0x7be9('0x0'));var path=require(_0x7be9('0x1'));var timeout=require(_0x7be9('0x2'));var express=require(_0x7be9('0x3'));var router=express['Router']();var fs_extra=require(_0x7be9('0x4'));var auth=require(_0x7be9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7be9('0x6'));var controller=require(_0x7be9('0x7'));router['get']('/',auth[_0x7be9('0x8')](),controller[_0x7be9('0x9')]);router[_0x7be9('0xa')](_0x7be9('0xb'),auth[_0x7be9('0x8')](),controller[_0x7be9('0xc')]);router[_0x7be9('0xa')](_0x7be9('0xd'),auth['isAuthenticated'](),controller[_0x7be9('0xe')]);router[_0x7be9('0xa')](_0x7be9('0xf'),auth['isAuthenticated'](),controller[_0x7be9('0x10')]);router[_0x7be9('0xa')](_0x7be9('0x11'),auth[_0x7be9('0x8')](),controller['getFields']);router[_0x7be9('0x12')]('/',auth['isAuthenticated'](),controller[_0x7be9('0x13')]);router['put'](_0x7be9('0xb'),auth[_0x7be9('0x8')](),controller[_0x7be9('0x14')]);router[_0x7be9('0x15')]('/:id',auth[_0x7be9('0x8')](),controller[_0x7be9('0x16')]);module[_0x7be9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 7aee2ec..ae4b25f 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 _0xaabd=['STRING','sequelize'];(function(_0xd990,_0x558eba){var _0x5a827b=function(_0x2e8cb1){while(--_0x2e8cb1){_0xd990['push'](_0xd990['shift']());}};_0x5a827b(++_0x558eba);}(_0xaabd,0xf7));var _0xdaab=function(_0x4152fb,_0x382ecb){_0x4152fb=_0x4152fb-0x0;var _0x53b04d=_0xaabd[_0x4152fb];return _0x53b04d;};'use strict';var Sequelize=require(_0xdaab('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaab('0x1')]},'description':{'type':Sequelize[_0xdaab('0x1')]}}; \ No newline at end of file +var _0x7cd4=['STRING','sequelize','exports'];(function(_0x5d2a16,_0x5ca1ca){var _0x2fd4b7=function(_0x1d4c8a){while(--_0x1d4c8a){_0x5d2a16['push'](_0x5d2a16['shift']());}};_0x2fd4b7(++_0x5ca1ca);}(_0x7cd4,0xdc));var _0x47cd=function(_0x4b6523,_0x2aa60e){_0x4b6523=_0x4b6523-0x0;var _0x45b680=_0x7cd4[_0x4b6523];return _0x45b680;};'use strict';var Sequelize=require(_0x47cd('0x0'));module[_0x47cd('0x1')]={'name':{'type':Sequelize[_0x47cd('0x2')]},'description':{'type':Sequelize[_0x47cd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 54c8cb1..abf4ce8 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 _0x0267=['error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','find','create','body','params','getSubjects','findOne','keys','getDescriptions','getFields','FreshsalesField','order','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','end'];(function(_0x456f95,_0x27b85d){var _0x214fe7=function(_0xf1dbcc){while(--_0xf1dbcc){_0x456f95['push'](_0x456f95['shift']());}};_0x214fe7(++_0x27b85d);}(_0x0267,0x17c));var _0x7026=function(_0x31ccfc,_0x57c7b8){_0x31ccfc=_0x31ccfc-0x0;var _0x3e312f=_0x0267[_0x31ccfc];return _0x3e312f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7026('0x0'));var zipdir=require(_0x7026('0x1'));var jsonpatch=require(_0x7026('0x2'));var rp=require('request-promise');var moment=require(_0x7026('0x3'));var BPromise=require(_0x7026('0x4'));var Mustache=require(_0x7026('0x5'));var util=require(_0x7026('0x6'));var path=require(_0x7026('0x7'));var sox=require(_0x7026('0x8'));var csv=require(_0x7026('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7026('0xa'));var _=require(_0x7026('0xb'));var squel=require(_0x7026('0xc'));var crypto=require(_0x7026('0xd'));var jsforce=require(_0x7026('0xe'));var deskjs=require(_0x7026('0xf'));var toCsv=require(_0x7026('0x9'));var querystring=require(_0x7026('0x10'));var Papa=require(_0x7026('0x11'));var Redis=require(_0x7026('0x12'));var authService=require(_0x7026('0x13'));var qs=require(_0x7026('0x14'));var as=require(_0x7026('0x15'));var hardwareService=require(_0x7026('0x16'));var logger=require(_0x7026('0x17'))(_0x7026('0x18'));var utils=require(_0x7026('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7026('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386a1f,_0x1f9b86){_0x1f9b86=_0x1f9b86||0xcc;return function(_0x46f0e1){if(_0x46f0e1){return _0x386a1f[_0x7026('0x1b')](_0x1f9b86);}return _0x386a1f[_0x7026('0x1c')](_0x1f9b86)['end']();};}function respondWithResult(_0x4dbcb9,_0xa195fb){_0xa195fb=_0xa195fb||0xc8;return function(_0x5c42f8){if(_0x5c42f8){return _0x4dbcb9['status'](_0xa195fb)[_0x7026('0x1d')](_0x5c42f8);}};}function respondWithFilteredResult(_0x4718c4,_0x463f4b){return function(_0x5294db){if(_0x5294db){var _0x2b6011=typeof _0x463f4b[_0x7026('0x1e')]===_0x7026('0x1f')&&typeof _0x463f4b['limit']===_0x7026('0x1f');var _0x40e4ae=_0x5294db['count'];var _0x4b5e45=_0x2b6011?0x0:_0x463f4b[_0x7026('0x1e')];var _0x45009c=_0x2b6011?_0x5294db['count']:_0x463f4b[_0x7026('0x1e')]+_0x463f4b[_0x7026('0x20')];var _0x5ea910;if(_0x45009c>=_0x40e4ae){_0x45009c=_0x40e4ae;_0x5ea910=0xc8;}else{_0x5ea910=0xce;}_0x4718c4[_0x7026('0x1c')](_0x5ea910);return _0x4718c4['set'](_0x7026('0x21'),_0x4b5e45+'-'+_0x45009c+'/'+_0x40e4ae)[_0x7026('0x1d')](_0x5294db);}return null;};}function patchUpdates(_0x3da1b4){return function(_0x200cbc){try{jsonpatch[_0x7026('0x22')](_0x200cbc,_0x3da1b4,!![]);}catch(_0x373101){return BPromise['reject'](_0x373101);}return _0x200cbc[_0x7026('0x23')]();};}function saveUpdates(_0x1da6f9,_0x5cb29b){return function(_0x741e8d){if(_0x741e8d){return _0x741e8d[_0x7026('0x24')](_0x1da6f9)[_0x7026('0x25')](function(_0x5e83aa){return _0x5e83aa;});}return null;};}function removeEntity(_0x4a9f3e,_0x54ba62){return function(_0x23b2d0){if(_0x23b2d0){return _0x23b2d0[_0x7026('0x26')]()[_0x7026('0x25')](function(){_0x4a9f3e[_0x7026('0x1c')](0xcc)[_0x7026('0x27')]();});}};}function handleEntityNotFound(_0x59436a,_0x3a848b){return function(_0x4c6141){if(!_0x4c6141){_0x59436a[_0x7026('0x1b')](0x194);}return _0x4c6141;};}function handleError(_0x1c524c,_0x39d5e6){_0x39d5e6=_0x39d5e6||0x1f4;return function(_0x534006){logger[_0x7026('0x28')](_0x534006[_0x7026('0x29')]);if(_0x534006[_0x7026('0x2a')]){delete _0x534006[_0x7026('0x2a')];}_0x1c524c[_0x7026('0x1c')](_0x39d5e6)[_0x7026('0x2b')](_0x534006);};}exports[_0x7026('0x2c')]=function(_0x11f610,_0x4b1100){var _0x1fbbf3={},_0x374e25={},_0x185e41={'count':0x0,'rows':[]};var _0x4aa440=_[_0x7026('0x2d')](db[_0x7026('0x2e')][_0x7026('0x2f')],function(_0x17e959){return{'name':_0x17e959[_0x7026('0x30')],'type':_0x17e959[_0x7026('0x31')][_0x7026('0x32')]};});_0x374e25['model']=_[_0x7026('0x2d')](_0x4aa440,_0x7026('0x2a'));_0x374e25[_0x7026('0x33')]=_['keys'](_0x11f610[_0x7026('0x33')]);_0x374e25[_0x7026('0x34')]=_[_0x7026('0x35')](_0x374e25[_0x7026('0x36')],_0x374e25[_0x7026('0x33')]);_0x1fbbf3[_0x7026('0x37')]=_['intersection'](_0x374e25['model'],qs[_0x7026('0x38')](_0x11f610['query'][_0x7026('0x38')]));_0x1fbbf3[_0x7026('0x37')]=_0x1fbbf3['attributes'][_0x7026('0x39')]?_0x1fbbf3['attributes']:_0x374e25[_0x7026('0x36')];if(!_0x11f610[_0x7026('0x33')][_0x7026('0x3a')](_0x7026('0x3b'))){_0x1fbbf3[_0x7026('0x20')]=qs['limit'](_0x11f610['query'][_0x7026('0x20')]);_0x1fbbf3[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x11f610['query'][_0x7026('0x1e')]);}_0x1fbbf3['order']=qs[_0x7026('0x3c')](_0x11f610['query'][_0x7026('0x3c')]);_0x1fbbf3[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x11f610[_0x7026('0x33')],_0x374e25[_0x7026('0x34')]),_0x4aa440);if(_0x11f610['query'][_0x7026('0x3f')]){_0x1fbbf3['where']=_[_0x7026('0x40')](_0x1fbbf3[_0x7026('0x3d')],{'$or':_[_0x7026('0x2d')](_0x4aa440,function(_0x392c7c){if(_0x392c7c[_0x7026('0x31')]!==_0x7026('0x41')){var _0x282ed6={};_0x282ed6[_0x392c7c[_0x7026('0x2a')]]={'$like':'%'+_0x11f610[_0x7026('0x33')][_0x7026('0x3f')]+'%'};return _0x282ed6;}})});}_0x1fbbf3=_[_0x7026('0x40')]({},_0x1fbbf3,_0x11f610[_0x7026('0x42')]);var _0x6b3bb6={'where':_0x1fbbf3[_0x7026('0x3d')]};return db[_0x7026('0x2e')][_0x7026('0x43')](_0x6b3bb6)[_0x7026('0x25')](function(_0x277632){_0x185e41[_0x7026('0x43')]=_0x277632;if(_0x11f610[_0x7026('0x33')][_0x7026('0x44')]){_0x1fbbf3[_0x7026('0x45')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1fbbf3);})['then'](function(_0x5902e6){_0x185e41[_0x7026('0x46')]=_0x5902e6;return _0x185e41;})['then'](respondWithFilteredResult(_0x4b1100,_0x1fbbf3))[_0x7026('0x47')](handleError(_0x4b1100,null));};exports[_0x7026('0x48')]=function(_0x63f446,_0x539536){var _0x1b5182={'raw':![],'where':{'id':_0x63f446['params']['id']}},_0xe70819={};_0xe70819[_0x7026('0x36')]=_['keys'](db[_0x7026('0x2e')][_0x7026('0x2f')]);_0xe70819['query']=_['keys'](_0x63f446[_0x7026('0x33')]);_0xe70819[_0x7026('0x34')]=_['intersection'](_0xe70819[_0x7026('0x36')],_0xe70819[_0x7026('0x33')]);_0x1b5182[_0x7026('0x37')]=_[_0x7026('0x35')](_0xe70819[_0x7026('0x36')],qs[_0x7026('0x38')](_0x63f446[_0x7026('0x33')][_0x7026('0x38')]));_0x1b5182['attributes']=_0x1b5182['attributes']['length']?_0x1b5182[_0x7026('0x37')]:_0xe70819['model'];if(_0x63f446[_0x7026('0x33')][_0x7026('0x44')]){_0x1b5182[_0x7026('0x45')]=[{'all':!![]}];}_0x1b5182=_['merge']({},_0x1b5182,_0x63f446[_0x7026('0x42')]);return db[_0x7026('0x2e')][_0x7026('0x49')](_0x1b5182)[_0x7026('0x25')](handleEntityNotFound(_0x539536,null))['then'](respondWithResult(_0x539536,null))['catch'](handleError(_0x539536,null));};exports[_0x7026('0x4a')]=function(_0x384856,_0x271b55){return db[_0x7026('0x2e')][_0x7026('0x4a')](_0x384856[_0x7026('0x4b')],{})['then'](respondWithResult(_0x271b55,0xc9))['catch'](handleError(_0x271b55,null));};exports['update']=function(_0x4bd5b1,_0x3a6f67){if(_0x4bd5b1[_0x7026('0x4b')]['id']){delete _0x4bd5b1[_0x7026('0x4b')]['id'];}return db[_0x7026('0x2e')][_0x7026('0x49')]({'where':{'id':_0x4bd5b1[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x3a6f67,null))[_0x7026('0x25')](saveUpdates(_0x4bd5b1[_0x7026('0x4b')],null))[_0x7026('0x25')](respondWithResult(_0x3a6f67,null))['catch'](handleError(_0x3a6f67,null));};exports[_0x7026('0x26')]=function(_0x442fb3,_0x1a430e){return db['FreshsalesConfiguration'][_0x7026('0x49')]({'where':{'id':_0x442fb3[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x1a430e,null))['then'](removeEntity(_0x1a430e,null))['catch'](handleError(_0x1a430e,null));};exports[_0x7026('0x4d')]=function(_0x55d25e,_0xd2adeb,_0x38e3d9){var _0x1c403f={};var _0xffedf9={};var _0x12943d;var _0x3719b6;return db[_0x7026('0x2e')][_0x7026('0x4e')]({'where':{'id':_0x55d25e[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0xd2adeb,null))[_0x7026('0x25')](function(_0x296a9b){if(_0x296a9b){_0x12943d=_0x296a9b;_0xffedf9[_0x7026('0x36')]=_[_0x7026('0x4f')](db['FreshsalesField'][_0x7026('0x2f')]);_0xffedf9[_0x7026('0x33')]=_['keys'](_0x55d25e['query']);_0xffedf9[_0x7026('0x34')]=_[_0x7026('0x35')](_0xffedf9[_0x7026('0x36')],_0xffedf9[_0x7026('0x33')]);_0x1c403f['attributes']=_[_0x7026('0x35')](_0xffedf9[_0x7026('0x36')],qs['fields'](_0x55d25e['query'][_0x7026('0x38')]));_0x1c403f[_0x7026('0x37')]=_0x1c403f[_0x7026('0x37')][_0x7026('0x39')]?_0x1c403f['attributes']:_0xffedf9['model'];_0x1c403f['order']=qs[_0x7026('0x3c')](_0x55d25e[_0x7026('0x33')]['sort']);_0x1c403f[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x55d25e[_0x7026('0x33')],_0xffedf9[_0x7026('0x34')]));if(_0x55d25e[_0x7026('0x33')][_0x7026('0x3f')]){_0x1c403f['where']=_['merge'](_0x1c403f[_0x7026('0x3d')],{'$or':_[_0x7026('0x2d')](_0x1c403f[_0x7026('0x37')],function(_0x5afb7b){var _0x23d58b={};_0x23d58b[_0x5afb7b]={'$like':'%'+_0x55d25e[_0x7026('0x33')][_0x7026('0x3f')]+'%'};return _0x23d58b;})});}_0x1c403f=_['merge']({},_0x1c403f,_0x55d25e['options']);return _0x12943d[_0x7026('0x4d')](_0x1c403f);}})['then'](function(_0x78c9a){if(_0x78c9a){_0x3719b6=_0x78c9a[_0x7026('0x39')];if(!_0x55d25e['query'][_0x7026('0x3a')](_0x7026('0x3b'))){_0x1c403f['limit']=qs[_0x7026('0x20')](_0x55d25e[_0x7026('0x33')][_0x7026('0x20')]);_0x1c403f[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x55d25e['query'][_0x7026('0x1e')]);}return _0x12943d['getSubjects'](_0x1c403f);}})[_0x7026('0x25')](function(_0x44cac6){if(_0x44cac6){return _0x44cac6?{'count':_0x3719b6,'rows':_0x44cac6}:null;}})[_0x7026('0x25')](respondWithResult(_0xd2adeb,null))[_0x7026('0x47')](handleError(_0xd2adeb,null));};exports[_0x7026('0x50')]=function(_0x2afe87,_0x5cc346,_0x2e87fb){var _0x456b15={};var _0x37a44a={};var _0x3866ab;var _0x37a6a8;return db[_0x7026('0x2e')][_0x7026('0x4e')]({'where':{'id':_0x2afe87[_0x7026('0x4c')]['id']}})[_0x7026('0x25')](handleEntityNotFound(_0x5cc346,null))['then'](function(_0x484b5b){if(_0x484b5b){_0x3866ab=_0x484b5b;_0x37a44a[_0x7026('0x36')]=_[_0x7026('0x4f')](db['FreshsalesField'][_0x7026('0x2f')]);_0x37a44a[_0x7026('0x33')]=_[_0x7026('0x4f')](_0x2afe87['query']);_0x37a44a[_0x7026('0x34')]=_['intersection'](_0x37a44a['model'],_0x37a44a[_0x7026('0x33')]);_0x456b15[_0x7026('0x37')]=_[_0x7026('0x35')](_0x37a44a[_0x7026('0x36')],qs['fields'](_0x2afe87[_0x7026('0x33')][_0x7026('0x38')]));_0x456b15['attributes']=_0x456b15['attributes'][_0x7026('0x39')]?_0x456b15[_0x7026('0x37')]:_0x37a44a['model'];_0x456b15['order']=qs[_0x7026('0x3c')](_0x2afe87[_0x7026('0x33')]['sort']);_0x456b15[_0x7026('0x3d')]=qs[_0x7026('0x34')](_[_0x7026('0x3e')](_0x2afe87[_0x7026('0x33')],_0x37a44a[_0x7026('0x34')]));if(_0x2afe87['query'][_0x7026('0x3f')]){_0x456b15[_0x7026('0x3d')]=_[_0x7026('0x40')](_0x456b15['where'],{'$or':_['map'](_0x456b15['attributes'],function(_0x4fcccb){var _0x554bbb={};_0x554bbb[_0x4fcccb]={'$like':'%'+_0x2afe87['query'][_0x7026('0x3f')]+'%'};return _0x554bbb;})});}_0x456b15=_[_0x7026('0x40')]({},_0x456b15,_0x2afe87[_0x7026('0x42')]);return _0x3866ab['getDescriptions'](_0x456b15);}})['then'](function(_0x21a762){if(_0x21a762){_0x37a6a8=_0x21a762[_0x7026('0x39')];if(!_0x2afe87[_0x7026('0x33')][_0x7026('0x3a')]('nolimit')){_0x456b15[_0x7026('0x20')]=qs['limit'](_0x2afe87[_0x7026('0x33')][_0x7026('0x20')]);_0x456b15[_0x7026('0x1e')]=qs['offset'](_0x2afe87['query'][_0x7026('0x1e')]);}return _0x3866ab[_0x7026('0x50')](_0x456b15);}})[_0x7026('0x25')](function(_0x57d32a){if(_0x57d32a){return _0x57d32a?{'count':_0x37a6a8,'rows':_0x57d32a}:null;}})[_0x7026('0x25')](respondWithResult(_0x5cc346,null))['catch'](handleError(_0x5cc346,null));};exports[_0x7026('0x51')]=function(_0x2382db,_0x552d2b,_0x210c77){var _0x4c7585={};var _0x41e89e={};var _0x5aad0c;var _0x204484;return db[_0x7026('0x2e')]['findOne']({'where':{'id':_0x2382db[_0x7026('0x4c')]['id']}})['then'](handleEntityNotFound(_0x552d2b,null))[_0x7026('0x25')](function(_0x1b8bea){if(_0x1b8bea){_0x5aad0c=_0x1b8bea;_0x41e89e[_0x7026('0x36')]=_[_0x7026('0x4f')](db[_0x7026('0x52')][_0x7026('0x2f')]);_0x41e89e['query']=_[_0x7026('0x4f')](_0x2382db[_0x7026('0x33')]);_0x41e89e['filters']=_[_0x7026('0x35')](_0x41e89e[_0x7026('0x36')],_0x41e89e[_0x7026('0x33')]);_0x4c7585[_0x7026('0x37')]=_[_0x7026('0x35')](_0x41e89e[_0x7026('0x36')],qs[_0x7026('0x38')](_0x2382db[_0x7026('0x33')]['fields']));_0x4c7585[_0x7026('0x37')]=_0x4c7585['attributes']['length']?_0x4c7585[_0x7026('0x37')]:_0x41e89e[_0x7026('0x36')];_0x4c7585[_0x7026('0x53')]=qs[_0x7026('0x3c')](_0x2382db[_0x7026('0x33')]['sort']);_0x4c7585[_0x7026('0x3d')]=qs['filters'](_[_0x7026('0x3e')](_0x2382db[_0x7026('0x33')],_0x41e89e[_0x7026('0x34')]));if(_0x2382db[_0x7026('0x33')][_0x7026('0x3f')]){_0x4c7585['where']=_[_0x7026('0x40')](_0x4c7585[_0x7026('0x3d')],{'$or':_['map'](_0x4c7585[_0x7026('0x37')],function(_0x26a30a){var _0x3b60a1={};_0x3b60a1[_0x26a30a]={'$like':'%'+_0x2382db['query'][_0x7026('0x3f')]+'%'};return _0x3b60a1;})});}_0x4c7585=_['merge']({},_0x4c7585,_0x2382db['options']);return _0x5aad0c[_0x7026('0x51')](_0x4c7585);}})['then'](function(_0x2e8980){if(_0x2e8980){_0x204484=_0x2e8980[_0x7026('0x39')];if(!_0x2382db[_0x7026('0x33')][_0x7026('0x3a')](_0x7026('0x3b'))){_0x4c7585['limit']=qs[_0x7026('0x20')](_0x2382db[_0x7026('0x33')][_0x7026('0x20')]);_0x4c7585[_0x7026('0x1e')]=qs[_0x7026('0x1e')](_0x2382db[_0x7026('0x33')][_0x7026('0x1e')]);}return _0x5aad0c[_0x7026('0x51')](_0x4c7585);}})[_0x7026('0x25')](function(_0x508a1b){if(_0x508a1b){return _0x508a1b?{'count':_0x204484,'rows':_0x508a1b}:null;}})[_0x7026('0x25')](respondWithResult(_0x552d2b,null))[_0x7026('0x47')](handleError(_0x552d2b,null));}; \ No newline at end of file +var _0x6d77=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','update','body','getSubjects','findOne','FreshsalesField','sort','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x6d77,0x13c));var _0x76d7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6d77[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x76d7('0x0'));var rimraf=require(_0x76d7('0x1'));var zipdir=require(_0x76d7('0x2'));var jsonpatch=require(_0x76d7('0x3'));var rp=require(_0x76d7('0x4'));var moment=require(_0x76d7('0x5'));var BPromise=require(_0x76d7('0x6'));var Mustache=require(_0x76d7('0x7'));var util=require(_0x76d7('0x8'));var path=require(_0x76d7('0x9'));var sox=require('sox');var csv=require(_0x76d7('0xa'));var ejs=require(_0x76d7('0xb'));var fs=require('fs');var fs_extra=require(_0x76d7('0xc'));var _=require(_0x76d7('0xd'));var squel=require(_0x76d7('0xe'));var crypto=require(_0x76d7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x76d7('0x10'));var toCsv=require(_0x76d7('0xa'));var querystring=require(_0x76d7('0x11'));var Papa=require(_0x76d7('0x12'));var Redis=require(_0x76d7('0x13'));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(_0x76d7('0x14'))(_0x76d7('0x15'));var utils=require(_0x76d7('0x16'));var config=require(_0x76d7('0x17'));var licenseUtil=require(_0x76d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10637b,_0x733e91){_0x733e91=_0x733e91||0xcc;return function(_0x3bf6a7){if(_0x3bf6a7){return _0x10637b[_0x76d7('0x19')](_0x733e91);}return _0x10637b[_0x76d7('0x1a')](_0x733e91)[_0x76d7('0x1b')]();};}function respondWithResult(_0x4258f3,_0x3485b6){_0x3485b6=_0x3485b6||0xc8;return function(_0x1ad0f6){if(_0x1ad0f6){return _0x4258f3[_0x76d7('0x1a')](_0x3485b6)[_0x76d7('0x1c')](_0x1ad0f6);}};}function respondWithFilteredResult(_0x469b02,_0x247697){return function(_0x826ac){if(_0x826ac){var _0x30a00c=typeof _0x247697[_0x76d7('0x1d')]===_0x76d7('0x1e')&&typeof _0x247697[_0x76d7('0x1f')]===_0x76d7('0x1e');var _0x11f28c=_0x826ac[_0x76d7('0x20')];var _0xead0b=_0x30a00c?0x0:_0x247697[_0x76d7('0x1d')];var _0x5681ec=_0x30a00c?_0x826ac['count']:_0x247697[_0x76d7('0x1d')]+_0x247697['limit'];var _0x1cbfac;if(_0x5681ec>=_0x11f28c){_0x5681ec=_0x11f28c;_0x1cbfac=0xc8;}else{_0x1cbfac=0xce;}_0x469b02[_0x76d7('0x1a')](_0x1cbfac);return _0x469b02[_0x76d7('0x21')](_0x76d7('0x22'),_0xead0b+'-'+_0x5681ec+'/'+_0x11f28c)[_0x76d7('0x1c')](_0x826ac);}return null;};}function patchUpdates(_0x210c1f){return function(_0x3f2ed6){try{jsonpatch[_0x76d7('0x23')](_0x3f2ed6,_0x210c1f,!![]);}catch(_0x46f42a){return BPromise[_0x76d7('0x24')](_0x46f42a);}return _0x3f2ed6['save']();};}function saveUpdates(_0x4f1a4d,_0x3768fa){return function(_0x32012d){if(_0x32012d){return _0x32012d['update'](_0x4f1a4d)[_0x76d7('0x25')](function(_0x17755e){return _0x17755e;});}return null;};}function removeEntity(_0x293565,_0x12d323){return function(_0x55e952){if(_0x55e952){return _0x55e952[_0x76d7('0x26')]()[_0x76d7('0x25')](function(){_0x293565[_0x76d7('0x1a')](0xcc)[_0x76d7('0x1b')]();});}};}function handleEntityNotFound(_0x4064f6,_0x472b9f){return function(_0x4454ad){if(!_0x4454ad){_0x4064f6[_0x76d7('0x19')](0x194);}return _0x4454ad;};}function handleError(_0x432d2a,_0x5917b8){_0x5917b8=_0x5917b8||0x1f4;return function(_0x19ea1a){logger[_0x76d7('0x27')](_0x19ea1a['stack']);if(_0x19ea1a[_0x76d7('0x28')]){delete _0x19ea1a['name'];}_0x432d2a[_0x76d7('0x1a')](_0x5917b8)[_0x76d7('0x29')](_0x19ea1a);};}exports[_0x76d7('0x2a')]=function(_0x5601e6,_0x1c6901){var _0x4ddfb5={},_0x1fe232={},_0x1a0174={'count':0x0,'rows':[]};var _0x3908dd=_[_0x76d7('0x2b')](db[_0x76d7('0x2c')][_0x76d7('0x2d')],function(_0x3f1d36){return{'name':_0x3f1d36['fieldName'],'type':_0x3f1d36[_0x76d7('0x2e')][_0x76d7('0x2f')]};});_0x1fe232[_0x76d7('0x30')]=_[_0x76d7('0x2b')](_0x3908dd,_0x76d7('0x28'));_0x1fe232[_0x76d7('0x31')]=_['keys'](_0x5601e6['query']);_0x1fe232[_0x76d7('0x32')]=_['intersection'](_0x1fe232['model'],_0x1fe232[_0x76d7('0x31')]);_0x4ddfb5[_0x76d7('0x33')]=_[_0x76d7('0x34')](_0x1fe232[_0x76d7('0x30')],qs[_0x76d7('0x35')](_0x5601e6['query'][_0x76d7('0x35')]));_0x4ddfb5[_0x76d7('0x33')]=_0x4ddfb5['attributes'][_0x76d7('0x36')]?_0x4ddfb5['attributes']:_0x1fe232[_0x76d7('0x30')];if(!_0x5601e6[_0x76d7('0x31')]['hasOwnProperty'](_0x76d7('0x37'))){_0x4ddfb5[_0x76d7('0x1f')]=qs[_0x76d7('0x1f')](_0x5601e6['query'][_0x76d7('0x1f')]);_0x4ddfb5['offset']=qs[_0x76d7('0x1d')](_0x5601e6['query'][_0x76d7('0x1d')]);}_0x4ddfb5[_0x76d7('0x38')]=qs['sort'](_0x5601e6[_0x76d7('0x31')]['sort']);_0x4ddfb5['where']=qs[_0x76d7('0x32')](_[_0x76d7('0x39')](_0x5601e6[_0x76d7('0x31')],_0x1fe232[_0x76d7('0x32')]),_0x3908dd);if(_0x5601e6[_0x76d7('0x31')][_0x76d7('0x3a')]){_0x4ddfb5[_0x76d7('0x3b')]=_[_0x76d7('0x3c')](_0x4ddfb5['where'],{'$or':_[_0x76d7('0x2b')](_0x3908dd,function(_0x1c78f0){if(_0x1c78f0[_0x76d7('0x2e')]!==_0x76d7('0x3d')){var _0x2bfd43={};_0x2bfd43[_0x1c78f0[_0x76d7('0x28')]]={'$like':'%'+_0x5601e6['query'][_0x76d7('0x3a')]+'%'};return _0x2bfd43;}})});}_0x4ddfb5=_['merge']({},_0x4ddfb5,_0x5601e6[_0x76d7('0x3e')]);var _0x4b87a7={'where':_0x4ddfb5[_0x76d7('0x3b')]};return db[_0x76d7('0x2c')]['count'](_0x4b87a7)['then'](function(_0x537501){_0x1a0174[_0x76d7('0x20')]=_0x537501;if(_0x5601e6[_0x76d7('0x31')][_0x76d7('0x3f')]){_0x4ddfb5['include']=[{'all':!![]}];}return db[_0x76d7('0x2c')]['findAll'](_0x4ddfb5);})[_0x76d7('0x25')](function(_0x231634){_0x1a0174[_0x76d7('0x40')]=_0x231634;return _0x1a0174;})[_0x76d7('0x25')](respondWithFilteredResult(_0x1c6901,_0x4ddfb5))[_0x76d7('0x41')](handleError(_0x1c6901,null));};exports[_0x76d7('0x42')]=function(_0x211771,_0x1ad781){var _0x2d5bb5={'raw':![],'where':{'id':_0x211771[_0x76d7('0x43')]['id']}},_0x474bb2={};_0x474bb2[_0x76d7('0x30')]=_[_0x76d7('0x44')](db[_0x76d7('0x2c')][_0x76d7('0x2d')]);_0x474bb2['query']=_[_0x76d7('0x44')](_0x211771[_0x76d7('0x31')]);_0x474bb2[_0x76d7('0x32')]=_[_0x76d7('0x34')](_0x474bb2[_0x76d7('0x30')],_0x474bb2['query']);_0x2d5bb5[_0x76d7('0x33')]=_[_0x76d7('0x34')](_0x474bb2[_0x76d7('0x30')],qs[_0x76d7('0x35')](_0x211771[_0x76d7('0x31')]['fields']));_0x2d5bb5[_0x76d7('0x33')]=_0x2d5bb5[_0x76d7('0x33')][_0x76d7('0x36')]?_0x2d5bb5[_0x76d7('0x33')]:_0x474bb2[_0x76d7('0x30')];if(_0x211771[_0x76d7('0x31')][_0x76d7('0x3f')]){_0x2d5bb5['include']=[{'all':!![]}];}_0x2d5bb5=_[_0x76d7('0x3c')]({},_0x2d5bb5,_0x211771['options']);return db['FreshsalesConfiguration'][_0x76d7('0x45')](_0x2d5bb5)['then'](handleEntityNotFound(_0x1ad781,null))['then'](respondWithResult(_0x1ad781,null))[_0x76d7('0x41')](handleError(_0x1ad781,null));};exports[_0x76d7('0x46')]=function(_0x4aafea,_0x1452a4){return db[_0x76d7('0x2c')][_0x76d7('0x46')](_0x4aafea['body'],{})[_0x76d7('0x25')](respondWithResult(_0x1452a4,0xc9))[_0x76d7('0x41')](handleError(_0x1452a4,null));};exports[_0x76d7('0x47')]=function(_0x4e853c,_0x4d515c){if(_0x4e853c[_0x76d7('0x48')]['id']){delete _0x4e853c[_0x76d7('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x76d7('0x45')]({'where':{'id':_0x4e853c['params']['id']}})[_0x76d7('0x25')](handleEntityNotFound(_0x4d515c,null))[_0x76d7('0x25')](saveUpdates(_0x4e853c['body'],null))[_0x76d7('0x25')](respondWithResult(_0x4d515c,null))[_0x76d7('0x41')](handleError(_0x4d515c,null));};exports['destroy']=function(_0x891afa,_0x96b898){return db['FreshsalesConfiguration'][_0x76d7('0x45')]({'where':{'id':_0x891afa['params']['id']}})[_0x76d7('0x25')](handleEntityNotFound(_0x96b898,null))['then'](removeEntity(_0x96b898,null))[_0x76d7('0x41')](handleError(_0x96b898,null));};exports[_0x76d7('0x49')]=function(_0x3ec4d5,_0x1bb510,_0x142db6){var _0x29fbe2={};var _0x55aed2={};var _0x3084f1;var _0x1e1896;return db[_0x76d7('0x2c')][_0x76d7('0x4a')]({'where':{'id':_0x3ec4d5[_0x76d7('0x43')]['id']}})['then'](handleEntityNotFound(_0x1bb510,null))[_0x76d7('0x25')](function(_0x3af301){if(_0x3af301){_0x3084f1=_0x3af301;_0x55aed2['model']=_[_0x76d7('0x44')](db[_0x76d7('0x4b')]['rawAttributes']);_0x55aed2['query']=_['keys'](_0x3ec4d5[_0x76d7('0x31')]);_0x55aed2[_0x76d7('0x32')]=_['intersection'](_0x55aed2['model'],_0x55aed2['query']);_0x29fbe2['attributes']=_['intersection'](_0x55aed2[_0x76d7('0x30')],qs[_0x76d7('0x35')](_0x3ec4d5['query'][_0x76d7('0x35')]));_0x29fbe2[_0x76d7('0x33')]=_0x29fbe2[_0x76d7('0x33')]['length']?_0x29fbe2[_0x76d7('0x33')]:_0x55aed2[_0x76d7('0x30')];_0x29fbe2[_0x76d7('0x38')]=qs[_0x76d7('0x4c')](_0x3ec4d5[_0x76d7('0x31')]['sort']);_0x29fbe2[_0x76d7('0x3b')]=qs[_0x76d7('0x32')](_[_0x76d7('0x39')](_0x3ec4d5[_0x76d7('0x31')],_0x55aed2[_0x76d7('0x32')]));if(_0x3ec4d5[_0x76d7('0x31')][_0x76d7('0x3a')]){_0x29fbe2[_0x76d7('0x3b')]=_[_0x76d7('0x3c')](_0x29fbe2[_0x76d7('0x3b')],{'$or':_[_0x76d7('0x2b')](_0x29fbe2[_0x76d7('0x33')],function(_0x10f3ce){var _0x52aeb8={};_0x52aeb8[_0x10f3ce]={'$like':'%'+_0x3ec4d5[_0x76d7('0x31')][_0x76d7('0x3a')]+'%'};return _0x52aeb8;})});}_0x29fbe2=_[_0x76d7('0x3c')]({},_0x29fbe2,_0x3ec4d5[_0x76d7('0x3e')]);return _0x3084f1[_0x76d7('0x49')](_0x29fbe2);}})[_0x76d7('0x25')](function(_0x1336df){if(_0x1336df){_0x1e1896=_0x1336df[_0x76d7('0x36')];if(!_0x3ec4d5[_0x76d7('0x31')][_0x76d7('0x4d')]('nolimit')){_0x29fbe2[_0x76d7('0x1f')]=qs[_0x76d7('0x1f')](_0x3ec4d5[_0x76d7('0x31')][_0x76d7('0x1f')]);_0x29fbe2[_0x76d7('0x1d')]=qs[_0x76d7('0x1d')](_0x3ec4d5[_0x76d7('0x31')][_0x76d7('0x1d')]);}return _0x3084f1[_0x76d7('0x49')](_0x29fbe2);}})['then'](function(_0x27c4ab){if(_0x27c4ab){return _0x27c4ab?{'count':_0x1e1896,'rows':_0x27c4ab}:null;}})['then'](respondWithResult(_0x1bb510,null))[_0x76d7('0x41')](handleError(_0x1bb510,null));};exports[_0x76d7('0x4e')]=function(_0x19daa0,_0x5160eb,_0x1d8d4e){var _0x2d34dd={};var _0x3ff5d9={};var _0x4972f4;var _0x559243;return db['FreshsalesConfiguration'][_0x76d7('0x4a')]({'where':{'id':_0x19daa0[_0x76d7('0x43')]['id']}})['then'](handleEntityNotFound(_0x5160eb,null))['then'](function(_0x102178){if(_0x102178){_0x4972f4=_0x102178;_0x3ff5d9[_0x76d7('0x30')]=_['keys'](db[_0x76d7('0x4b')]['rawAttributes']);_0x3ff5d9[_0x76d7('0x31')]=_['keys'](_0x19daa0[_0x76d7('0x31')]);_0x3ff5d9[_0x76d7('0x32')]=_['intersection'](_0x3ff5d9[_0x76d7('0x30')],_0x3ff5d9['query']);_0x2d34dd[_0x76d7('0x33')]=_[_0x76d7('0x34')](_0x3ff5d9[_0x76d7('0x30')],qs['fields'](_0x19daa0[_0x76d7('0x31')][_0x76d7('0x35')]));_0x2d34dd[_0x76d7('0x33')]=_0x2d34dd['attributes'][_0x76d7('0x36')]?_0x2d34dd[_0x76d7('0x33')]:_0x3ff5d9[_0x76d7('0x30')];_0x2d34dd[_0x76d7('0x38')]=qs[_0x76d7('0x4c')](_0x19daa0[_0x76d7('0x31')][_0x76d7('0x4c')]);_0x2d34dd[_0x76d7('0x3b')]=qs['filters'](_['pick'](_0x19daa0[_0x76d7('0x31')],_0x3ff5d9['filters']));if(_0x19daa0['query'][_0x76d7('0x3a')]){_0x2d34dd[_0x76d7('0x3b')]=_['merge'](_0x2d34dd[_0x76d7('0x3b')],{'$or':_[_0x76d7('0x2b')](_0x2d34dd['attributes'],function(_0x39957d){var _0x35b643={};_0x35b643[_0x39957d]={'$like':'%'+_0x19daa0[_0x76d7('0x31')][_0x76d7('0x3a')]+'%'};return _0x35b643;})});}_0x2d34dd=_['merge']({},_0x2d34dd,_0x19daa0['options']);return _0x4972f4[_0x76d7('0x4e')](_0x2d34dd);}})[_0x76d7('0x25')](function(_0x47201b){if(_0x47201b){_0x559243=_0x47201b[_0x76d7('0x36')];if(!_0x19daa0['query'][_0x76d7('0x4d')](_0x76d7('0x37'))){_0x2d34dd[_0x76d7('0x1f')]=qs[_0x76d7('0x1f')](_0x19daa0[_0x76d7('0x31')][_0x76d7('0x1f')]);_0x2d34dd[_0x76d7('0x1d')]=qs['offset'](_0x19daa0[_0x76d7('0x31')]['offset']);}return _0x4972f4[_0x76d7('0x4e')](_0x2d34dd);}})[_0x76d7('0x25')](function(_0x5cb149){if(_0x5cb149){return _0x5cb149?{'count':_0x559243,'rows':_0x5cb149}:null;}})['then'](respondWithResult(_0x5160eb,null))[_0x76d7('0x41')](handleError(_0x5160eb,null));};exports['getFields']=function(_0x5e1a8b,_0x3e5bf9,_0x318f07){var _0x46ddae={};var _0x220e04={};var _0x5bcb60;var _0x7dd3b4;return db[_0x76d7('0x2c')][_0x76d7('0x4a')]({'where':{'id':_0x5e1a8b[_0x76d7('0x43')]['id']}})[_0x76d7('0x25')](handleEntityNotFound(_0x3e5bf9,null))[_0x76d7('0x25')](function(_0x18eb9f){if(_0x18eb9f){_0x5bcb60=_0x18eb9f;_0x220e04[_0x76d7('0x30')]=_[_0x76d7('0x44')](db['FreshsalesField']['rawAttributes']);_0x220e04['query']=_['keys'](_0x5e1a8b[_0x76d7('0x31')]);_0x220e04[_0x76d7('0x32')]=_[_0x76d7('0x34')](_0x220e04['model'],_0x220e04[_0x76d7('0x31')]);_0x46ddae['attributes']=_['intersection'](_0x220e04[_0x76d7('0x30')],qs['fields'](_0x5e1a8b[_0x76d7('0x31')][_0x76d7('0x35')]));_0x46ddae['attributes']=_0x46ddae[_0x76d7('0x33')]['length']?_0x46ddae[_0x76d7('0x33')]:_0x220e04['model'];_0x46ddae[_0x76d7('0x38')]=qs['sort'](_0x5e1a8b[_0x76d7('0x31')][_0x76d7('0x4c')]);_0x46ddae[_0x76d7('0x3b')]=qs[_0x76d7('0x32')](_[_0x76d7('0x39')](_0x5e1a8b[_0x76d7('0x31')],_0x220e04[_0x76d7('0x32')]));if(_0x5e1a8b[_0x76d7('0x31')]['filter']){_0x46ddae[_0x76d7('0x3b')]=_[_0x76d7('0x3c')](_0x46ddae['where'],{'$or':_[_0x76d7('0x2b')](_0x46ddae[_0x76d7('0x33')],function(_0x330089){var _0x41c86c={};_0x41c86c[_0x330089]={'$like':'%'+_0x5e1a8b['query'][_0x76d7('0x3a')]+'%'};return _0x41c86c;})});}_0x46ddae=_[_0x76d7('0x3c')]({},_0x46ddae,_0x5e1a8b[_0x76d7('0x3e')]);return _0x5bcb60[_0x76d7('0x4f')](_0x46ddae);}})['then'](function(_0x12819b){if(_0x12819b){_0x7dd3b4=_0x12819b[_0x76d7('0x36')];if(!_0x5e1a8b[_0x76d7('0x31')][_0x76d7('0x4d')](_0x76d7('0x37'))){_0x46ddae[_0x76d7('0x1f')]=qs[_0x76d7('0x1f')](_0x5e1a8b[_0x76d7('0x31')][_0x76d7('0x1f')]);_0x46ddae['offset']=qs['offset'](_0x5e1a8b[_0x76d7('0x31')]['offset']);}return _0x5bcb60[_0x76d7('0x4f')](_0x46ddae);}})['then'](function(_0x353291){if(_0x353291){return _0x353291?{'count':_0x7dd3b4,'rows':_0x353291}:null;}})[_0x76d7('0x25')](respondWithResult(_0x3e5bf9,null))[_0x76d7('0x41')](handleError(_0x3e5bf9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 556f2a7..82e229b 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 _0x9b4f=['request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0xe6d97c,_0x4920f9){var _0x22bb22=function(_0x284ead){while(--_0x284ead){_0xe6d97c['push'](_0xe6d97c['shift']());}};_0x22bb22(++_0x4920f9);}(_0x9b4f,0x1ad));var _0xf9b4=function(_0x5eaeb0,_0x496576){_0x5eaeb0=_0x5eaeb0-0x0;var _0x5f1407=_0x9b4f[_0x5eaeb0];return _0x5f1407;};'use strict';var _=require(_0xf9b4('0x0'));var util=require('util');var logger=require(_0xf9b4('0x1'))(_0xf9b4('0x2'));var moment=require(_0xf9b4('0x3'));var BPromise=require(_0xf9b4('0x4'));var rp=require(_0xf9b4('0x5'));var fs=require('fs');var path=require(_0xf9b4('0x6'));var rimraf=require(_0xf9b4('0x7'));var config=require(_0xf9b4('0x8'));var attributes=require(_0xf9b4('0x9'));module[_0xf9b4('0xa')]=function(_0x556fc5,_0x4ddfa9){return _0x556fc5[_0xf9b4('0xb')](_0xf9b4('0xc'),attributes,{'tableName':_0xf9b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e92=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intFreshsalesConfiguration.attributes','exports'];(function(_0xdb3a14,_0x3eff59){var _0x5880e9=function(_0x1e4440){while(--_0x1e4440){_0xdb3a14['push'](_0xdb3a14['shift']());}};_0x5880e9(++_0x3eff59);}(_0x7e92,0x6f));var _0x27e9=function(_0x13e85f,_0x6f1db0){_0x13e85f=_0x13e85f-0x0;var _0xd34aa9=_0x7e92[_0x13e85f];return _0xd34aa9;};'use strict';var _=require(_0x27e9('0x0'));var util=require(_0x27e9('0x1'));var logger=require(_0x27e9('0x2'))(_0x27e9('0x3'));var moment=require(_0x27e9('0x4'));var BPromise=require(_0x27e9('0x5'));var rp=require(_0x27e9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27e9('0x7'));module[_0x27e9('0x8')]=function(_0x50f238,_0xf2486c){return _0x50f238['define']('FreshsalesConfiguration',attributes,{'tableName':_0x27e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index ec0c35c..e377a80 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 _0x2362=['moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x4ac12c,_0x197626){var _0x111e2a=function(_0x532335){while(--_0x532335){_0x4ac12c['push'](_0x4ac12c['shift']());}};_0x111e2a(++_0x197626);}(_0x2362,0xee));var _0x2236=function(_0x433502,_0x1fd975){_0x433502=_0x433502-0x0;var _0x4a28de=_0x2362[_0x433502];return _0x4a28de;};'use strict';var _=require(_0x2236('0x0'));var util=require(_0x2236('0x1'));var moment=require(_0x2236('0x2'));var BPromise=require('bluebird');var rs=require(_0x2236('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2236('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2236('0x5'))(_0x2236('0x6'));var config=require('../../config/environment');var jayson=require(_0x2236('0x7'));var client=jayson[_0x2236('0x8')][_0x2236('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e036,_0x5d2c47,_0x329df3){return new BPromise(function(_0x10b798,_0x93c766){return client[_0x2236('0xa')](_0x22e036,_0x329df3)[_0x2236('0xb')](function(_0x4958ad){logger[_0x2236('0xc')](_0x2236('0xd'),_0x5d2c47,'request\x20sent');logger['debug'](_0x2236('0xe'),_0x5d2c47,_0x2236('0xf'),JSON[_0x2236('0x10')](_0x4958ad));if(_0x4958ad['error']){if(_0x4958ad['error']['code']===0x1f4){logger[_0x2236('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d2c47,_0x4958ad[_0x2236('0x11')][_0x2236('0x12')]);return _0x93c766(_0x4958ad[_0x2236('0x11')][_0x2236('0x12')]);}logger['error'](_0x2236('0xd'),_0x5d2c47,_0x4958ad[_0x2236('0x11')]['message']);return _0x10b798(_0x4958ad[_0x2236('0x11')]['message']);}else{logger[_0x2236('0xc')](_0x2236('0xd'),_0x5d2c47,_0x2236('0xf'));_0x10b798(_0x4958ad['result'][_0x2236('0x12')]);}})[_0x2236('0x13')](function(_0x3648ee){logger['error'](_0x2236('0xd'),_0x5d2c47,_0x3648ee);_0x93c766(_0x3648ee);});});} \ No newline at end of file +var _0xfcec=['randomstring','../../mysqldb','rpc','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfcec,0x88));var _0xcfce=function(_0x4610f6,_0x5fe8c3){_0x4610f6=_0x4610f6-0x0;var _0x422a4d=_0xfcec[_0x4610f6];return _0x422a4d;};'use strict';var _=require(_0xcfce('0x0'));var util=require(_0xcfce('0x1'));var moment=require(_0xcfce('0x2'));var BPromise=require(_0xcfce('0x3'));var rs=require(_0xcfce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfce('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfce('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcfce('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43fff0,_0x2fdc12,_0x1f19cb){return new BPromise(function(_0x21e83d,_0x2cf29b){return client[_0xcfce('0x8')](_0x43fff0,_0x1f19cb)['then'](function(_0x503420){logger[_0xcfce('0x9')](_0xcfce('0xa'),_0x2fdc12,_0xcfce('0xb'));logger[_0xcfce('0xc')](_0xcfce('0xd'),_0x2fdc12,'request\x20sent',JSON[_0xcfce('0xe')](_0x503420));if(_0x503420[_0xcfce('0xf')]){if(_0x503420[_0xcfce('0xf')][_0xcfce('0x10')]===0x1f4){logger[_0xcfce('0xf')](_0xcfce('0xa'),_0x2fdc12,_0x503420['error'][_0xcfce('0x11')]);return _0x2cf29b(_0x503420[_0xcfce('0xf')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2fdc12,_0x503420[_0xcfce('0xf')][_0xcfce('0x11')]);return _0x21e83d(_0x503420[_0xcfce('0xf')][_0xcfce('0x11')]);}else{logger[_0xcfce('0x9')](_0xcfce('0xa'),_0x2fdc12,_0xcfce('0xb'));_0x21e83d(_0x503420[_0xcfce('0x12')]['message']);}})[_0xcfce('0x13')](function(_0x4d4762){logger[_0xcfce('0xf')](_0xcfce('0xa'),_0x2fdc12,_0x4d4762);_0x2cf29b(_0x4d4762);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fd068d7..ec358c7 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 _0x00b3=['delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','create','put','update'];(function(_0xad8701,_0x4a1695){var _0xbf8c66=function(_0x4d33fc){while(--_0x4d33fc){_0xad8701['push'](_0xad8701['shift']());}};_0xbf8c66(++_0x4a1695);}(_0x00b3,0x17a));var _0x300b=function(_0x371d96,_0x43b332){_0x371d96=_0x371d96-0x0;var _0x18aaea=_0x00b3[_0x371d96];return _0x18aaea;};'use strict';var multer=require('multer');var util=require(_0x300b('0x0'));var path=require(_0x300b('0x1'));var timeout=require(_0x300b('0x2'));var express=require(_0x300b('0x3'));var router=express['Router']();var fs_extra=require(_0x300b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x300b('0x5'));var config=require('../../config/environment');var controller=require(_0x300b('0x6'));router[_0x300b('0x7')]('/',auth[_0x300b('0x8')](),controller[_0x300b('0x9')]);router['get']('/:id',auth[_0x300b('0x8')](),controller['show']);router['post']('/',auth[_0x300b('0x8')](),controller[_0x300b('0xa')]);router[_0x300b('0xb')]('/:id',auth[_0x300b('0x8')](),controller[_0x300b('0xc')]);router[_0x300b('0xd')](_0x300b('0xe'),auth['isAuthenticated'](),controller[_0x300b('0xf')]);module[_0x300b('0x10')]=router; \ No newline at end of file +var _0xb790=['put','delete','destroy','exports','util','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb790,0xe5));var _0x0b79=function(_0x5dd351,_0x19ebc5){_0x5dd351=_0x5dd351-0x0;var _0x1fbdba=_0xb790[_0x5dd351];return _0x1fbdba;};'use strict';var multer=require('multer');var util=require(_0x0b79('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0b79('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0b79('0x2'));var config=require(_0x0b79('0x3'));var controller=require('./intFreshsalesField.controller');router[_0x0b79('0x4')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0x6')]);router[_0x0b79('0x4')](_0x0b79('0x7'),auth[_0x0b79('0x5')](),controller[_0x0b79('0x8')]);router[_0x0b79('0x9')]('/',auth[_0x0b79('0x5')](),controller[_0x0b79('0xa')]);router[_0x0b79('0xb')](_0x0b79('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x0b79('0xc')](_0x0b79('0x7'),auth[_0x0b79('0x5')](),controller[_0x0b79('0xd')]);module[_0x0b79('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5e5c480..b05038b 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 _0x7cb5=['BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','ENUM','variable','customVariable'];(function(_0x792e6b,_0x1949c4){var _0x1627c2=function(_0xa89bb1){while(--_0xa89bb1){_0x792e6b['push'](_0x792e6b['shift']());}};_0x1627c2(++_0x1949c4);}(_0x7cb5,0xbf));var _0x57cb=function(_0x3fc56b,_0x4a6575){_0x3fc56b=_0x3fc56b-0x0;var _0x4ff874=_0x7cb5[_0x3fc56b];return _0x4ff874;};'use strict';var Sequelize=require(_0x57cb('0x0'));module[_0x57cb('0x1')]={'type':{'type':Sequelize['ENUM'](_0x57cb('0x2'),'variable','customVariable',_0x57cb('0x3'),_0x57cb('0x4')),'defaultValue':_0x57cb('0x2')},'content':{'type':Sequelize[_0x57cb('0x5')]},'key':{'type':Sequelize[_0x57cb('0x5')]},'keyType':{'type':Sequelize[_0x57cb('0x6')]('string',_0x57cb('0x7'),_0x57cb('0x8'))},'keyContent':{'type':Sequelize[_0x57cb('0x5')]},'idField':{'type':Sequelize[_0x57cb('0x5')]},'nameField':{'type':Sequelize[_0x57cb('0x5')]},'customField':{'type':Sequelize[_0x57cb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57cb('0x5')]}}; \ No newline at end of file +var _0xa1e1=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa1e1,0x160));var _0x1a1e=function(_0x184e56,_0x1f6825){_0x184e56=_0x184e56-0x0;var _0x28fc82=_0xa1e1[_0x184e56];return _0x28fc82;};'use strict';var Sequelize=require('sequelize');module[_0x1a1e('0x0')]={'type':{'type':Sequelize[_0x1a1e('0x1')](_0x1a1e('0x2'),_0x1a1e('0x3'),_0x1a1e('0x4'),'keyValue','picklist'),'defaultValue':_0x1a1e('0x2')},'content':{'type':Sequelize[_0x1a1e('0x5')]},'key':{'type':Sequelize[_0x1a1e('0x5')]},'keyType':{'type':Sequelize[_0x1a1e('0x1')](_0x1a1e('0x2'),_0x1a1e('0x3'),_0x1a1e('0x4'))},'keyContent':{'type':Sequelize[_0x1a1e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1a1e('0x5')]},'customField':{'type':Sequelize[_0x1a1e('0x6')],'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 0d89cf6..1876867 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 _0x85f6=['options','includeAll','findAll','catch','params','keys','length','include','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x5cc711,_0x1a95c7){var _0x1ce5bb=function(_0x4a8188){while(--_0x4a8188){_0x5cc711['push'](_0x5cc711['shift']());}};_0x1ce5bb(++_0x1a95c7);}(_0x85f6,0x183));var _0x685f=function(_0xae0e2f,_0x33eb71){_0xae0e2f=_0xae0e2f-0x0;var _0xe48894=_0x85f6[_0xae0e2f];return _0xe48894;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x685f('0x0'));var zipdir=require(_0x685f('0x1'));var jsonpatch=require(_0x685f('0x2'));var rp=require(_0x685f('0x3'));var moment=require(_0x685f('0x4'));var BPromise=require(_0x685f('0x5'));var Mustache=require('mustache');var util=require(_0x685f('0x6'));var path=require(_0x685f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x685f('0x8'));var fs=require('fs');var fs_extra=require(_0x685f('0x9'));var _=require(_0x685f('0xa'));var squel=require(_0x685f('0xb'));var crypto=require(_0x685f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x685f('0xd'));var toCsv=require(_0x685f('0xe'));var querystring=require(_0x685f('0xf'));var Papa=require(_0x685f('0x10'));var Redis=require(_0x685f('0x11'));var authService=require(_0x685f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x685f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x685f('0x14'))(_0x685f('0x15'));var utils=require('../../config/utils');var config=require(_0x685f('0x16'));var licenseUtil=require(_0x685f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a0174,_0x3bd1ca){_0x3bd1ca=_0x3bd1ca||0xcc;return function(_0x29d54c){if(_0x29d54c){return _0x1a0174[_0x685f('0x18')](_0x3bd1ca);}return _0x1a0174[_0x685f('0x19')](_0x3bd1ca)[_0x685f('0x1a')]();};}function respondWithResult(_0x16da06,_0x5c3f42){_0x5c3f42=_0x5c3f42||0xc8;return function(_0x51277a){if(_0x51277a){return _0x16da06[_0x685f('0x19')](_0x5c3f42)[_0x685f('0x1b')](_0x51277a);}};}function respondWithFilteredResult(_0x2a3a50,_0x579ea7){return function(_0x415074){if(_0x415074){var _0x5a2c46=typeof _0x579ea7[_0x685f('0x1c')]===_0x685f('0x1d')&&typeof _0x579ea7[_0x685f('0x1e')]===_0x685f('0x1d');var _0x4fc5b1=_0x415074[_0x685f('0x1f')];var _0x106e06=_0x5a2c46?0x0:_0x579ea7['offset'];var _0x165fa4=_0x5a2c46?_0x415074[_0x685f('0x1f')]:_0x579ea7[_0x685f('0x1c')]+_0x579ea7['limit'];var _0x322ee1;if(_0x165fa4>=_0x4fc5b1){_0x165fa4=_0x4fc5b1;_0x322ee1=0xc8;}else{_0x322ee1=0xce;}_0x2a3a50[_0x685f('0x19')](_0x322ee1);return _0x2a3a50[_0x685f('0x20')](_0x685f('0x21'),_0x106e06+'-'+_0x165fa4+'/'+_0x4fc5b1)[_0x685f('0x1b')](_0x415074);}return null;};}function patchUpdates(_0x5c2324){return function(_0x524f30){try{jsonpatch[_0x685f('0x22')](_0x524f30,_0x5c2324,!![]);}catch(_0x21c9b3){return BPromise[_0x685f('0x23')](_0x21c9b3);}return _0x524f30[_0x685f('0x24')]();};}function saveUpdates(_0x24844b,_0x34b140){return function(_0xbb831){if(_0xbb831){return _0xbb831['update'](_0x24844b)[_0x685f('0x25')](function(_0x3e69d3){return _0x3e69d3;});}return null;};}function removeEntity(_0x3dc4bc,_0x1e399c){return function(_0x14516a){if(_0x14516a){return _0x14516a[_0x685f('0x26')]()[_0x685f('0x25')](function(){_0x3dc4bc[_0x685f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377e98,_0x412ef8){return function(_0x1e9c2e){if(!_0x1e9c2e){_0x377e98[_0x685f('0x18')](0x194);}return _0x1e9c2e;};}function handleError(_0x58eb7e,_0x4c5deb){_0x4c5deb=_0x4c5deb||0x1f4;return function(_0x413c6c){logger[_0x685f('0x27')](_0x413c6c[_0x685f('0x28')]);if(_0x413c6c[_0x685f('0x29')]){delete _0x413c6c[_0x685f('0x29')];}_0x58eb7e[_0x685f('0x19')](_0x4c5deb)[_0x685f('0x2a')](_0x413c6c);};}exports['index']=function(_0x16c51c,_0x619c42){var _0x563a81={},_0x5d40b3={},_0x57b40a={'count':0x0,'rows':[]};var _0x10f053=_[_0x685f('0x2b')](db[_0x685f('0x2c')][_0x685f('0x2d')],function(_0x3f5fe4){return{'name':_0x3f5fe4[_0x685f('0x2e')],'type':_0x3f5fe4[_0x685f('0x2f')]['key']};});_0x5d40b3['model']=_[_0x685f('0x2b')](_0x10f053,_0x685f('0x29'));_0x5d40b3['query']=_['keys'](_0x16c51c[_0x685f('0x30')]);_0x5d40b3['filters']=_[_0x685f('0x31')](_0x5d40b3[_0x685f('0x32')],_0x5d40b3['query']);_0x563a81['attributes']=_['intersection'](_0x5d40b3[_0x685f('0x32')],qs[_0x685f('0x33')](_0x16c51c[_0x685f('0x30')][_0x685f('0x33')]));_0x563a81[_0x685f('0x34')]=_0x563a81['attributes']['length']?_0x563a81[_0x685f('0x34')]:_0x5d40b3['model'];if(!_0x16c51c['query'][_0x685f('0x35')](_0x685f('0x36'))){_0x563a81[_0x685f('0x1e')]=qs[_0x685f('0x1e')](_0x16c51c[_0x685f('0x30')][_0x685f('0x1e')]);_0x563a81[_0x685f('0x1c')]=qs[_0x685f('0x1c')](_0x16c51c[_0x685f('0x30')][_0x685f('0x1c')]);}_0x563a81[_0x685f('0x37')]=qs['sort'](_0x16c51c[_0x685f('0x30')][_0x685f('0x38')]);_0x563a81[_0x685f('0x39')]=qs[_0x685f('0x3a')](_[_0x685f('0x3b')](_0x16c51c[_0x685f('0x30')],_0x5d40b3[_0x685f('0x3a')]),_0x10f053);if(_0x16c51c[_0x685f('0x30')]['filter']){_0x563a81['where']=_[_0x685f('0x3c')](_0x563a81['where'],{'$or':_[_0x685f('0x2b')](_0x10f053,function(_0x20f713){if(_0x20f713['type']!==_0x685f('0x3d')){var _0xdd3213={};_0xdd3213[_0x20f713[_0x685f('0x29')]]={'$like':'%'+_0x16c51c[_0x685f('0x30')][_0x685f('0x3e')]+'%'};return _0xdd3213;}})});}_0x563a81=_[_0x685f('0x3c')]({},_0x563a81,_0x16c51c[_0x685f('0x3f')]);var _0x5bdb95={'where':_0x563a81['where']};return db['FreshsalesField'][_0x685f('0x1f')](_0x5bdb95)['then'](function(_0x387b1e){_0x57b40a[_0x685f('0x1f')]=_0x387b1e;if(_0x16c51c[_0x685f('0x30')][_0x685f('0x40')]){_0x563a81['include']=[{'all':!![]}];}return db[_0x685f('0x2c')][_0x685f('0x41')](_0x563a81);})[_0x685f('0x25')](function(_0x1cf99c){_0x57b40a['rows']=_0x1cf99c;return _0x57b40a;})[_0x685f('0x25')](respondWithFilteredResult(_0x619c42,_0x563a81))[_0x685f('0x42')](handleError(_0x619c42,null));};exports['show']=function(_0x3bfb03,_0x3cc909){var _0x54841a={'raw':!![],'where':{'id':_0x3bfb03[_0x685f('0x43')]['id']}},_0x7eba9a={};_0x7eba9a['model']=_['keys'](db[_0x685f('0x2c')]['rawAttributes']);_0x7eba9a[_0x685f('0x30')]=_[_0x685f('0x44')](_0x3bfb03['query']);_0x7eba9a[_0x685f('0x3a')]=_[_0x685f('0x31')](_0x7eba9a[_0x685f('0x32')],_0x7eba9a[_0x685f('0x30')]);_0x54841a[_0x685f('0x34')]=_['intersection'](_0x7eba9a[_0x685f('0x32')],qs['fields'](_0x3bfb03[_0x685f('0x30')]['fields']));_0x54841a['attributes']=_0x54841a['attributes'][_0x685f('0x45')]?_0x54841a[_0x685f('0x34')]:_0x7eba9a[_0x685f('0x32')];if(_0x3bfb03['query'][_0x685f('0x40')]){_0x54841a[_0x685f('0x46')]=[{'all':!![]}];}_0x54841a=_[_0x685f('0x3c')]({},_0x54841a,_0x3bfb03[_0x685f('0x3f')]);return db[_0x685f('0x2c')][_0x685f('0x47')](_0x54841a)[_0x685f('0x25')](handleEntityNotFound(_0x3cc909,null))['then'](respondWithResult(_0x3cc909,null))['catch'](handleError(_0x3cc909,null));};exports[_0x685f('0x48')]=function(_0x122cde,_0x15cf1d){return db[_0x685f('0x2c')]['create'](_0x122cde['body'],{})[_0x685f('0x25')](respondWithResult(_0x15cf1d,0xc9))[_0x685f('0x42')](handleError(_0x15cf1d,null));};exports[_0x685f('0x49')]=function(_0x2ef42b,_0xf757d){if(_0x2ef42b['body']['id']){delete _0x2ef42b[_0x685f('0x4a')]['id'];}return db['FreshsalesField'][_0x685f('0x47')]({'where':{'id':_0x2ef42b[_0x685f('0x43')]['id']}})[_0x685f('0x25')](handleEntityNotFound(_0xf757d,null))[_0x685f('0x25')](saveUpdates(_0x2ef42b[_0x685f('0x4a')],null))[_0x685f('0x25')](respondWithResult(_0xf757d,null))['catch'](handleError(_0xf757d,null));};exports[_0x685f('0x26')]=function(_0x543d87,_0x37987b){return db['FreshsalesField'][_0x685f('0x47')]({'where':{'id':_0x543d87[_0x685f('0x43')]['id']}})['then'](handleEntityNotFound(_0x37987b,null))[_0x685f('0x25')](removeEntity(_0x37987b,null))[_0x685f('0x42')](handleError(_0x37987b,null));}; \ No newline at end of file +var _0x5148=['then','end','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','params','keys','fields','includeAll','include','create','body','find','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','../../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','save','update'];(function(_0x5009ed,_0x476a42){var _0x326706=function(_0x5e1050){while(--_0x5e1050){_0x5009ed['push'](_0x5009ed['shift']());}};_0x326706(++_0x476a42);}(_0x5148,0x6c));var _0x8514=function(_0x2e7087,_0x112eec){_0x2e7087=_0x2e7087-0x0;var _0xb5b3a6=_0x5148[_0x2e7087];return _0xb5b3a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8514('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8514('0x1'));var moment=require(_0x8514('0x2'));var BPromise=require(_0x8514('0x3'));var Mustache=require(_0x8514('0x4'));var util=require(_0x8514('0x5'));var path=require(_0x8514('0x6'));var sox=require('sox');var csv=require(_0x8514('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8514('0x8'));var _=require(_0x8514('0x9'));var squel=require(_0x8514('0xa'));var crypto=require(_0x8514('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8514('0xc'));var toCsv=require(_0x8514('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8514('0xd'));var qs=require(_0x8514('0xe'));var as=require(_0x8514('0xf'));var hardwareService=require(_0x8514('0x10'));var logger=require('../../config/logger')(_0x8514('0x11'));var utils=require(_0x8514('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8514('0x13'));var db=require(_0x8514('0x14'))['db'];function respondWithStatusCode(_0x348e08,_0x4f0f35){_0x4f0f35=_0x4f0f35||0xcc;return function(_0x25f4d7){if(_0x25f4d7){return _0x348e08[_0x8514('0x15')](_0x4f0f35);}return _0x348e08[_0x8514('0x16')](_0x4f0f35)['end']();};}function respondWithResult(_0x4be69d,_0x15651b){_0x15651b=_0x15651b||0xc8;return function(_0x49d04e){if(_0x49d04e){return _0x4be69d['status'](_0x15651b)[_0x8514('0x17')](_0x49d04e);}};}function respondWithFilteredResult(_0x54790d,_0x3f3dc4){return function(_0x130a1e){if(_0x130a1e){var _0x2b7cfd=typeof _0x3f3dc4['offset']===_0x8514('0x18')&&typeof _0x3f3dc4['limit']===_0x8514('0x18');var _0x52e833=_0x130a1e[_0x8514('0x19')];var _0x32913f=_0x2b7cfd?0x0:_0x3f3dc4['offset'];var _0x570cfc=_0x2b7cfd?_0x130a1e[_0x8514('0x19')]:_0x3f3dc4[_0x8514('0x1a')]+_0x3f3dc4[_0x8514('0x1b')];var _0x490c11;if(_0x570cfc>=_0x52e833){_0x570cfc=_0x52e833;_0x490c11=0xc8;}else{_0x490c11=0xce;}_0x54790d[_0x8514('0x16')](_0x490c11);return _0x54790d[_0x8514('0x1c')](_0x8514('0x1d'),_0x32913f+'-'+_0x570cfc+'/'+_0x52e833)['json'](_0x130a1e);}return null;};}function patchUpdates(_0x2e8ff2){return function(_0x16b70e){try{jsonpatch['apply'](_0x16b70e,_0x2e8ff2,!![]);}catch(_0x5ae182){return BPromise['reject'](_0x5ae182);}return _0x16b70e[_0x8514('0x1e')]();};}function saveUpdates(_0x30602b,_0x48e967){return function(_0x45a10b){if(_0x45a10b){return _0x45a10b[_0x8514('0x1f')](_0x30602b)[_0x8514('0x20')](function(_0xdb25cb){return _0xdb25cb;});}return null;};}function removeEntity(_0x3b4941,_0x50b42f){return function(_0x47ae7e){if(_0x47ae7e){return _0x47ae7e['destroy']()[_0x8514('0x20')](function(){_0x3b4941['status'](0xcc)[_0x8514('0x21')]();});}};}function handleEntityNotFound(_0x358c3f,_0x13274e){return function(_0x31a9b3){if(!_0x31a9b3){_0x358c3f[_0x8514('0x15')](0x194);}return _0x31a9b3;};}function handleError(_0x598da9,_0x437d3f){_0x437d3f=_0x437d3f||0x1f4;return function(_0x5c8ac7){logger[_0x8514('0x22')](_0x5c8ac7[_0x8514('0x23')]);if(_0x5c8ac7['name']){delete _0x5c8ac7[_0x8514('0x24')];}_0x598da9[_0x8514('0x16')](_0x437d3f)['send'](_0x5c8ac7);};}exports[_0x8514('0x25')]=function(_0x59fedb,_0x4d2031){var _0x53b1af={},_0x2e238b={},_0x3b8afb={'count':0x0,'rows':[]};var _0x636c40=_[_0x8514('0x26')](db[_0x8514('0x27')][_0x8514('0x28')],function(_0x3de0fe){return{'name':_0x3de0fe[_0x8514('0x29')],'type':_0x3de0fe[_0x8514('0x2a')][_0x8514('0x2b')]};});_0x2e238b[_0x8514('0x2c')]=_['map'](_0x636c40,_0x8514('0x24'));_0x2e238b[_0x8514('0x2d')]=_['keys'](_0x59fedb[_0x8514('0x2d')]);_0x2e238b['filters']=_[_0x8514('0x2e')](_0x2e238b[_0x8514('0x2c')],_0x2e238b['query']);_0x53b1af[_0x8514('0x2f')]=_['intersection'](_0x2e238b[_0x8514('0x2c')],qs['fields'](_0x59fedb[_0x8514('0x2d')]['fields']));_0x53b1af['attributes']=_0x53b1af[_0x8514('0x2f')][_0x8514('0x30')]?_0x53b1af[_0x8514('0x2f')]:_0x2e238b[_0x8514('0x2c')];if(!_0x59fedb[_0x8514('0x2d')][_0x8514('0x31')](_0x8514('0x32'))){_0x53b1af['limit']=qs[_0x8514('0x1b')](_0x59fedb[_0x8514('0x2d')]['limit']);_0x53b1af[_0x8514('0x1a')]=qs['offset'](_0x59fedb['query']['offset']);}_0x53b1af[_0x8514('0x33')]=qs[_0x8514('0x34')](_0x59fedb[_0x8514('0x2d')][_0x8514('0x34')]);_0x53b1af[_0x8514('0x35')]=qs[_0x8514('0x36')](_[_0x8514('0x37')](_0x59fedb['query'],_0x2e238b[_0x8514('0x36')]),_0x636c40);if(_0x59fedb[_0x8514('0x2d')][_0x8514('0x38')]){_0x53b1af[_0x8514('0x35')]=_[_0x8514('0x39')](_0x53b1af['where'],{'$or':_['map'](_0x636c40,function(_0x56cb5c){if(_0x56cb5c[_0x8514('0x2a')]!==_0x8514('0x3a')){var _0x27472b={};_0x27472b[_0x56cb5c[_0x8514('0x24')]]={'$like':'%'+_0x59fedb[_0x8514('0x2d')][_0x8514('0x38')]+'%'};return _0x27472b;}})});}_0x53b1af=_['merge']({},_0x53b1af,_0x59fedb[_0x8514('0x3b')]);var _0x44aff2={'where':_0x53b1af['where']};return db[_0x8514('0x27')][_0x8514('0x19')](_0x44aff2)['then'](function(_0x3f0abb){_0x3b8afb['count']=_0x3f0abb;if(_0x59fedb[_0x8514('0x2d')]['includeAll']){_0x53b1af['include']=[{'all':!![]}];}return db[_0x8514('0x27')]['findAll'](_0x53b1af);})[_0x8514('0x20')](function(_0x5395a6){_0x3b8afb[_0x8514('0x3c')]=_0x5395a6;return _0x3b8afb;})[_0x8514('0x20')](respondWithFilteredResult(_0x4d2031,_0x53b1af))[_0x8514('0x3d')](handleError(_0x4d2031,null));};exports['show']=function(_0xc6595e,_0x26b1a1){var _0x3fc94b={'raw':!![],'where':{'id':_0xc6595e[_0x8514('0x3e')]['id']}},_0xd71c1b={};_0xd71c1b[_0x8514('0x2c')]=_[_0x8514('0x3f')](db['FreshsalesField'][_0x8514('0x28')]);_0xd71c1b[_0x8514('0x2d')]=_[_0x8514('0x3f')](_0xc6595e[_0x8514('0x2d')]);_0xd71c1b[_0x8514('0x36')]=_['intersection'](_0xd71c1b[_0x8514('0x2c')],_0xd71c1b[_0x8514('0x2d')]);_0x3fc94b[_0x8514('0x2f')]=_[_0x8514('0x2e')](_0xd71c1b[_0x8514('0x2c')],qs['fields'](_0xc6595e[_0x8514('0x2d')][_0x8514('0x40')]));_0x3fc94b[_0x8514('0x2f')]=_0x3fc94b['attributes'][_0x8514('0x30')]?_0x3fc94b[_0x8514('0x2f')]:_0xd71c1b[_0x8514('0x2c')];if(_0xc6595e[_0x8514('0x2d')][_0x8514('0x41')]){_0x3fc94b[_0x8514('0x42')]=[{'all':!![]}];}_0x3fc94b=_[_0x8514('0x39')]({},_0x3fc94b,_0xc6595e['options']);return db[_0x8514('0x27')]['find'](_0x3fc94b)[_0x8514('0x20')](handleEntityNotFound(_0x26b1a1,null))[_0x8514('0x20')](respondWithResult(_0x26b1a1,null))[_0x8514('0x3d')](handleError(_0x26b1a1,null));};exports[_0x8514('0x43')]=function(_0x236e5e,_0x593af3){return db[_0x8514('0x27')][_0x8514('0x43')](_0x236e5e[_0x8514('0x44')],{})[_0x8514('0x20')](respondWithResult(_0x593af3,0xc9))['catch'](handleError(_0x593af3,null));};exports[_0x8514('0x1f')]=function(_0x5b0173,_0x1aca31){if(_0x5b0173['body']['id']){delete _0x5b0173[_0x8514('0x44')]['id'];}return db[_0x8514('0x27')][_0x8514('0x45')]({'where':{'id':_0x5b0173[_0x8514('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1aca31,null))[_0x8514('0x20')](saveUpdates(_0x5b0173['body'],null))[_0x8514('0x20')](respondWithResult(_0x1aca31,null))[_0x8514('0x3d')](handleError(_0x1aca31,null));};exports['destroy']=function(_0x2e4f3c,_0x300e9c){return db[_0x8514('0x27')][_0x8514('0x45')]({'where':{'id':_0x2e4f3c[_0x8514('0x3e')]['id']}})['then'](handleEntityNotFound(_0x300e9c,null))[_0x8514('0x20')](removeEntity(_0x300e9c,null))[_0x8514('0x3d')](handleError(_0x300e9c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 441a8eb..1d114f7 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 _0xeda7=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14eac5,_0x5d7549){var _0x223eb6=function(_0x892d56){while(--_0x892d56){_0x14eac5['push'](_0x14eac5['shift']());}};_0x223eb6(++_0x5d7549);}(_0xeda7,0x196));var _0x7eda=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xeda7[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var logger=require(_0x7eda('0x2'))(_0x7eda('0x3'));var moment=require(_0x7eda('0x4'));var BPromise=require(_0x7eda('0x5'));var rp=require(_0x7eda('0x6'));var fs=require('fs');var path=require(_0x7eda('0x7'));var rimraf=require(_0x7eda('0x8'));var config=require(_0x7eda('0x9'));var attributes=require(_0x7eda('0xa'));module[_0x7eda('0xb')]=function(_0x6ee7be,_0x328430){return _0x6ee7be[_0x7eda('0xc')](_0x7eda('0xd'),attributes,{'tableName':_0x7eda('0xe'),'paranoid':![],'indexes':[{'name':_0x7eda('0xf'),'fields':[_0x7eda('0x10'),_0x7eda('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0x0120,0x6f));var _0x0012=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0120[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'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 d5d270e..780e491 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 _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0xfcf0,0x138));var _0x0fcf=function(_0x121b1a,_0x42fdb7){_0x121b1a=_0x121b1a-0x0;var _0x2d89a6=_0xfcf0[_0x121b1a];return _0x2d89a6;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0xcacbb5,_0x2fea03){var _0x4b82d0=function(_0x76e232){while(--_0x76e232){_0xcacbb5['push'](_0xcacbb5['shift']());}};_0x4b82d0(++_0x2fea03);}(_0xba34,0x119));var _0x4ba3=function(_0x19daf3,_0x3adf14){_0x19daf3=_0x19daf3-0x0;var _0x5860da=_0xba34[_0x19daf3];return _0x5860da;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ab3710e..78c3640 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(_0x233e75,_0x3b4eb3){var _0x19e0b3=function(_0x44d41a){while(--_0x44d41a){_0x233e75['push'](_0x233e75['shift']());}};_0x19e0b3(++_0x3b4eb3);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x559dd0,_0x101608){var _0x32676a=function(_0x11a5d5){while(--_0x11a5d5){_0x559dd0['push'](_0x559dd0['shift']());}};_0x32676a(++_0x101608);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 5a690b3..aed122a 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 _0xebae=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x2c7c7a,_0x4b2a89){var _0x4c733a=function(_0x5d6813){while(--_0x5d6813){_0x2c7c7a['push'](_0x2c7c7a['shift']());}};_0x4c733a(++_0x4b2a89);}(_0xebae,0x83));var _0xeeba=function(_0x416eed,_0x3a2a24){_0x416eed=_0x416eed-0x0;var _0x325487=_0xebae[_0x416eed];return _0x325487;};'use strict';var Sequelize=require(_0xeeba('0x0'));module[_0xeeba('0x1')]={'name':{'type':Sequelize[_0xeeba('0x2')]},'description':{'type':Sequelize[_0xeeba('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xeeba('0x2')]},'password':{'type':Sequelize[_0xeeba('0x2')]},'clientId':{'type':Sequelize[_0xeeba('0x2')]},'clientSecret':{'type':Sequelize[_0xeeba('0x2')]},'securityToken':{'type':Sequelize[_0xeeba('0x2')]},'serverUrl':{'type':Sequelize[_0xeeba('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeeba('0x3')](_0xeeba('0x4'),_0xeeba('0x5')),'defaultValue':_0xeeba('0x4')}}; \ No newline at end of file +var _0x161a=['STRING','username','ENUM','integrationTab','newTab'];(function(_0x24cc5b,_0x34035c){var _0x510b0f=function(_0x46d5e6){while(--_0x46d5e6){_0x24cc5b['push'](_0x24cc5b['shift']());}};_0x510b0f(++_0x34035c);}(_0x161a,0x140));var _0xa161=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x161a[_0x5a1a51];return _0x47edd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa161('0x0')]},'description':{'type':Sequelize[_0xa161('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0xa161('0x1')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa161('0x0')]},'clientId':{'type':Sequelize[_0xa161('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa161('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xa161('0x2')](_0xa161('0x3'),_0xa161('0x4')),'defaultValue':_0xa161('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 003bdf9..0297642 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 _0x9c1e=['SalesforceField','getFields','Task','clientId','clientSecret','username','remoteUri','slice','substring','lastIndexOf','Connection','password','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','includes','label','custom','picklistValues','value','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','includeAll','include','rows','catch','show','find','create','body','update','params','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9c1e,0x1a9));var _0xe9c1=function(_0x34ebe1,_0x4e7a03){_0x34ebe1=_0x34ebe1-0x0;var _0x1151b5=_0x9c1e[_0x34ebe1];return _0x1151b5;};'use strict';var emlformat=require(_0xe9c1('0x0'));var rimraf=require(_0xe9c1('0x1'));var zipdir=require(_0xe9c1('0x2'));var jsonpatch=require(_0xe9c1('0x3'));var rp=require(_0xe9c1('0x4'));var moment=require('moment');var BPromise=require(_0xe9c1('0x5'));var Mustache=require(_0xe9c1('0x6'));var util=require(_0xe9c1('0x7'));var path=require(_0xe9c1('0x8'));var sox=require(_0xe9c1('0x9'));var csv=require(_0xe9c1('0xa'));var ejs=require(_0xe9c1('0xb'));var fs=require('fs');var fs_extra=require(_0xe9c1('0xc'));var _=require(_0xe9c1('0xd'));var squel=require(_0xe9c1('0xe'));var crypto=require(_0xe9c1('0xf'));var jsforce=require(_0xe9c1('0x10'));var deskjs=require(_0xe9c1('0x11'));var toCsv=require(_0xe9c1('0xa'));var querystring=require(_0xe9c1('0x12'));var Papa=require(_0xe9c1('0x13'));var Redis=require(_0xe9c1('0x14'));var authService=require(_0xe9c1('0x15'));var qs=require(_0xe9c1('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9c1('0x17'))(_0xe9c1('0x18'));var utils=require('../../config/utils');var config=require(_0xe9c1('0x19'));var licenseUtil=require(_0xe9c1('0x1a'));var db=require(_0xe9c1('0x1b'))['db'];var integrations=require(_0xe9c1('0x1c'));function respondWithStatusCode(_0x1eaa6d,_0x41ef00){_0x41ef00=_0x41ef00||0xcc;return function(_0x4d63fe){if(_0x4d63fe){return _0x1eaa6d[_0xe9c1('0x1d')](_0x41ef00);}return _0x1eaa6d['status'](_0x41ef00)[_0xe9c1('0x1e')]();};}function respondWithResult(_0x32e1a9,_0x505d05){_0x505d05=_0x505d05||0xc8;return function(_0x51e07f){if(_0x51e07f){return _0x32e1a9[_0xe9c1('0x1f')](_0x505d05)[_0xe9c1('0x20')](_0x51e07f);}};}function respondWithFilteredResult(_0x4faaf4,_0x1524c0){return function(_0x1272b2){if(_0x1272b2){var _0x4ee92e=typeof _0x1524c0[_0xe9c1('0x21')]===_0xe9c1('0x22')&&typeof _0x1524c0[_0xe9c1('0x23')]===_0xe9c1('0x22');var _0x1a42f5=_0x1272b2[_0xe9c1('0x24')];var _0x21f9ba=_0x4ee92e?0x0:_0x1524c0[_0xe9c1('0x21')];var _0x2f6dd6=_0x4ee92e?_0x1272b2[_0xe9c1('0x24')]:_0x1524c0[_0xe9c1('0x21')]+_0x1524c0[_0xe9c1('0x23')];var _0x42b4d2;if(_0x2f6dd6>=_0x1a42f5){_0x2f6dd6=_0x1a42f5;_0x42b4d2=0xc8;}else{_0x42b4d2=0xce;}_0x4faaf4['status'](_0x42b4d2);return _0x4faaf4[_0xe9c1('0x25')]('Content-Range',_0x21f9ba+'-'+_0x2f6dd6+'/'+_0x1a42f5)[_0xe9c1('0x20')](_0x1272b2);}return null;};}function patchUpdates(_0x460af9){return function(_0xce8018){try{jsonpatch['apply'](_0xce8018,_0x460af9,!![]);}catch(_0x4013d2){return BPromise['reject'](_0x4013d2);}return _0xce8018[_0xe9c1('0x26')]();};}function saveUpdates(_0x4de533,_0x2c3ba6){return function(_0x3131df){if(_0x3131df){return _0x3131df['update'](_0x4de533)[_0xe9c1('0x27')](function(_0xd9641d){return _0xd9641d;});}return null;};}function removeEntity(_0x42082b,_0x139f35){return function(_0x1527e7){if(_0x1527e7){return _0x1527e7[_0xe9c1('0x28')]()['then'](function(){_0x42082b[_0xe9c1('0x1f')](0xcc)[_0xe9c1('0x1e')]();});}};}function handleEntityNotFound(_0x436daf,_0x22a906){return function(_0x2c587f){if(!_0x2c587f){_0x436daf[_0xe9c1('0x1d')](0x194);}return _0x2c587f;};}function handleError(_0x471e56,_0x5c9d6e){_0x5c9d6e=_0x5c9d6e||0x1f4;return function(_0x37507c){logger[_0xe9c1('0x29')](_0x37507c[_0xe9c1('0x2a')]);if(_0x37507c['name']){delete _0x37507c[_0xe9c1('0x2b')];}_0x471e56[_0xe9c1('0x1f')](_0x5c9d6e)[_0xe9c1('0x2c')](_0x37507c);};}exports[_0xe9c1('0x2d')]=function(_0xd60d63,_0x1c8b17){var _0x476102={},_0x568325={},_0x59399b={'count':0x0,'rows':[]};var _0x37ad7b=_[_0xe9c1('0x2e')](db['SalesforceAccount'][_0xe9c1('0x2f')],function(_0x4c4be9){return{'name':_0x4c4be9[_0xe9c1('0x30')],'type':_0x4c4be9[_0xe9c1('0x31')][_0xe9c1('0x32')]};});_0x568325[_0xe9c1('0x33')]=_['map'](_0x37ad7b,_0xe9c1('0x2b'));_0x568325[_0xe9c1('0x34')]=_[_0xe9c1('0x35')](_0xd60d63[_0xe9c1('0x34')]);_0x568325[_0xe9c1('0x36')]=_['intersection'](_0x568325[_0xe9c1('0x33')],_0x568325[_0xe9c1('0x34')]);_0x476102[_0xe9c1('0x37')]=_[_0xe9c1('0x38')](_0x568325[_0xe9c1('0x33')],qs[_0xe9c1('0x39')](_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x39')]));_0x476102['attributes']=_0x476102[_0xe9c1('0x37')][_0xe9c1('0x3a')]?_0x476102[_0xe9c1('0x37')]:_0x568325[_0xe9c1('0x33')];if(!_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x3b')](_0xe9c1('0x3c'))){_0x476102[_0xe9c1('0x23')]=qs[_0xe9c1('0x23')](_0xd60d63['query'][_0xe9c1('0x23')]);_0x476102[_0xe9c1('0x21')]=qs[_0xe9c1('0x21')](_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x21')]);}_0x476102[_0xe9c1('0x3d')]=qs[_0xe9c1('0x3e')](_0xd60d63['query'][_0xe9c1('0x3e')]);_0x476102[_0xe9c1('0x3f')]=qs[_0xe9c1('0x36')](_[_0xe9c1('0x40')](_0xd60d63[_0xe9c1('0x34')],_0x568325[_0xe9c1('0x36')]),_0x37ad7b);if(_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x41')]){_0x476102[_0xe9c1('0x3f')]=_[_0xe9c1('0x42')](_0x476102[_0xe9c1('0x3f')],{'$or':_[_0xe9c1('0x2e')](_0x37ad7b,function(_0x4b8a6a){if(_0x4b8a6a['type']!=='VIRTUAL'){var _0x661c5e={};_0x661c5e[_0x4b8a6a[_0xe9c1('0x2b')]]={'$like':'%'+_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x41')]+'%'};return _0x661c5e;}})});}_0x476102=_[_0xe9c1('0x42')]({},_0x476102,_0xd60d63[_0xe9c1('0x43')]);var _0x2b5dfe={'where':_0x476102[_0xe9c1('0x3f')]};return db[_0xe9c1('0x44')][_0xe9c1('0x24')](_0x2b5dfe)[_0xe9c1('0x27')](function(_0x387148){_0x59399b['count']=_0x387148;if(_0xd60d63[_0xe9c1('0x34')][_0xe9c1('0x45')]){_0x476102[_0xe9c1('0x46')]=[{'all':!![]}];}return db[_0xe9c1('0x44')]['findAll'](_0x476102);})[_0xe9c1('0x27')](function(_0x812058){_0x59399b[_0xe9c1('0x47')]=_0x812058;return _0x59399b;})[_0xe9c1('0x27')](respondWithFilteredResult(_0x1c8b17,_0x476102))[_0xe9c1('0x48')](handleError(_0x1c8b17,null));};exports[_0xe9c1('0x49')]=function(_0x5ac45c,_0x444ba7){var _0x32f7d9={'raw':![],'where':{'id':_0x5ac45c['params']['id']}},_0x3b859f={};_0x3b859f['model']=_[_0xe9c1('0x35')](db[_0xe9c1('0x44')][_0xe9c1('0x2f')]);_0x3b859f[_0xe9c1('0x34')]=_['keys'](_0x5ac45c[_0xe9c1('0x34')]);_0x3b859f['filters']=_[_0xe9c1('0x38')](_0x3b859f[_0xe9c1('0x33')],_0x3b859f[_0xe9c1('0x34')]);_0x32f7d9['attributes']=_[_0xe9c1('0x38')](_0x3b859f[_0xe9c1('0x33')],qs['fields'](_0x5ac45c['query'][_0xe9c1('0x39')]));_0x32f7d9['attributes']=_0x32f7d9[_0xe9c1('0x37')][_0xe9c1('0x3a')]?_0x32f7d9[_0xe9c1('0x37')]:_0x3b859f[_0xe9c1('0x33')];if(_0x5ac45c[_0xe9c1('0x34')]['includeAll']){_0x32f7d9[_0xe9c1('0x46')]=[{'all':!![]}];}_0x32f7d9=_[_0xe9c1('0x42')]({},_0x32f7d9,_0x5ac45c[_0xe9c1('0x43')]);return db[_0xe9c1('0x44')][_0xe9c1('0x4a')](_0x32f7d9)[_0xe9c1('0x27')](handleEntityNotFound(_0x444ba7,null))[_0xe9c1('0x27')](respondWithResult(_0x444ba7,null))[_0xe9c1('0x48')](handleError(_0x444ba7,null));};exports[_0xe9c1('0x4b')]=function(_0x168450,_0x2cf238){return db[_0xe9c1('0x44')]['create'](_0x168450[_0xe9c1('0x4c')],{})[_0xe9c1('0x27')](respondWithResult(_0x2cf238,0xc9))[_0xe9c1('0x48')](handleError(_0x2cf238,null));};exports[_0xe9c1('0x4d')]=function(_0x437757,_0x316aa8){if(_0x437757['body']['id']){delete _0x437757[_0xe9c1('0x4c')]['id'];}return db[_0xe9c1('0x44')][_0xe9c1('0x4a')]({'where':{'id':_0x437757['params']['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x316aa8,null))[_0xe9c1('0x27')](saveUpdates(_0x437757[_0xe9c1('0x4c')],null))[_0xe9c1('0x27')](respondWithResult(_0x316aa8,null))['catch'](handleError(_0x316aa8,null));};exports[_0xe9c1('0x28')]=function(_0x2567f0,_0x50b3a9){return db['SalesforceAccount'][_0xe9c1('0x4a')]({'where':{'id':_0x2567f0[_0xe9c1('0x4e')]['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x50b3a9,null))[_0xe9c1('0x27')](removeEntity(_0x50b3a9,null))['catch'](handleError(_0x50b3a9,null));};exports['getConfigurations']=function(_0x13ee6c,_0x10eca4,_0x4a8c42){var _0x33d678={};var _0x834f95={};var _0x4f8439;var _0x16b932;return db[_0xe9c1('0x44')][_0xe9c1('0x4f')]({'where':{'id':_0x13ee6c[_0xe9c1('0x4e')]['id']}})[_0xe9c1('0x27')](handleEntityNotFound(_0x10eca4,null))['then'](function(_0x6b87d0){if(_0x6b87d0){_0x4f8439=_0x6b87d0;_0x834f95['model']=_[_0xe9c1('0x35')](db[_0xe9c1('0x50')][_0xe9c1('0x2f')]);_0x834f95[_0xe9c1('0x34')]=_['keys'](_0x13ee6c['query']);_0x834f95['filters']=_[_0xe9c1('0x38')](_0x834f95[_0xe9c1('0x33')],_0x834f95[_0xe9c1('0x34')]);_0x33d678['attributes']=_['intersection'](_0x834f95[_0xe9c1('0x33')],qs[_0xe9c1('0x39')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x39')]));_0x33d678['attributes']=_0x33d678['attributes'][_0xe9c1('0x3a')]?_0x33d678[_0xe9c1('0x37')]:_0x834f95[_0xe9c1('0x33')];_0x33d678[_0xe9c1('0x3d')]=qs[_0xe9c1('0x3e')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x3e')]);_0x33d678['where']=qs['filters'](_['pick'](_0x13ee6c[_0xe9c1('0x34')],_0x834f95[_0xe9c1('0x36')]));if(_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x41')]){_0x33d678['where']=_[_0xe9c1('0x42')](_0x33d678[_0xe9c1('0x3f')],{'$or':_[_0xe9c1('0x2e')](_0x33d678['attributes'],function(_0x20f99){var _0x5546c0={};_0x5546c0[_0x20f99]={'$like':'%'+_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x41')]+'%'};return _0x5546c0;})});}_0x33d678=_[_0xe9c1('0x42')]({},_0x33d678,_0x13ee6c[_0xe9c1('0x43')]);return _0x4f8439[_0xe9c1('0x51')](_0x33d678);}})['then'](function(_0xb5287c){if(_0xb5287c){_0x16b932=_0xb5287c[_0xe9c1('0x3a')];if(!_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x3b')](_0xe9c1('0x3c'))){_0x33d678[_0xe9c1('0x23')]=qs[_0xe9c1('0x23')](_0x13ee6c['query']['limit']);_0x33d678[_0xe9c1('0x21')]=qs[_0xe9c1('0x21')](_0x13ee6c[_0xe9c1('0x34')][_0xe9c1('0x21')]);}return _0x4f8439[_0xe9c1('0x51')](_0x33d678);}})[_0xe9c1('0x27')](function(_0x368436){if(_0x368436){return _0x368436?{'count':_0x16b932,'rows':_0x368436}:null;}})[_0xe9c1('0x27')](respondWithResult(_0x10eca4,null))[_0xe9c1('0x48')](handleError(_0x10eca4,null));};exports[_0xe9c1('0x52')]=function(_0x564aca,_0x5f00fa,_0x41c4e9){if(_0x564aca[_0xe9c1('0x4c')]['id']){delete _0x564aca['body']['id'];}return db['SalesforceAccount'][_0xe9c1('0x4f')]({'where':{'id':_0x564aca[_0xe9c1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5f00fa,null))[_0xe9c1('0x27')](function(_0x4b9aa8){if(_0x4b9aa8){_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x53')]=_0x4b9aa8['id'];_0x564aca['body'][_0xe9c1('0x54')]=integrations['getSubjects'](_0x564aca['body'][_0xe9c1('0x55')],_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x31')]);_0x564aca[_0xe9c1('0x4c')]['Descriptions']=integrations[_0xe9c1('0x56')](_0x564aca[_0xe9c1('0x4c')]['channel'],_0x564aca[_0xe9c1('0x4c')][_0xe9c1('0x31')]);return db[_0xe9c1('0x50')][_0xe9c1('0x4b')](_0x564aca[_0xe9c1('0x4c')],{'include':[{'model':db[_0xe9c1('0x57')],'as':_0xe9c1('0x54')},{'model':db[_0xe9c1('0x57')],'as':'Descriptions'}]});}return null;})[_0xe9c1('0x27')](respondWithResult(_0x5f00fa,null))['catch'](handleError(_0x5f00fa,null));};exports[_0xe9c1('0x58')]=function(_0x115612,_0x305d39,_0x1b08e9){var _0x468db1;var _0x2279cf='';var _0x1f6bc5=_0xe9c1('0x59');return db[_0xe9c1('0x44')][_0xe9c1('0x4f')]({'where':{'id':_0x115612[_0xe9c1('0x4e')]['id']},'attributes':['id','remoteUri',_0xe9c1('0x5a'),_0xe9c1('0x5b'),_0xe9c1('0x5c'),'password','securityToken']})['then'](handleEntityNotFound(_0x305d39,null))[_0xe9c1('0x27')](function(_0x142e65){if(_0x142e65){_0x2279cf=_0x142e65[_0xe9c1('0x5d')];var _0x2cc4b8=_0x2279cf[_0xe9c1('0x5e')](-0x1);if(_0x2cc4b8==='/'){_0x2279cf=_0x2279cf[_0xe9c1('0x5f')](0x0,_0x2279cf[_0xe9c1('0x60')](_0x2cc4b8));}_0x468db1=new jsforce[(_0xe9c1('0x61'))]({'oauth2':{'loginUrl':_0x2279cf,'clientId':_0x142e65[_0xe9c1('0x5a')],'clientSecret':_0x142e65[_0xe9c1('0x5b')]}});return _0x468db1['login'](_0x142e65[_0xe9c1('0x5c')],_0x142e65[_0xe9c1('0x62')][_0xe9c1('0x63')](_0x142e65[_0xe9c1('0x64')]));}})[_0xe9c1('0x27')](function(_0x3972d2){if(_0x3972d2){if(!_[_0xe9c1('0x65')](_0x115612[_0xe9c1('0x34')][_0xe9c1('0x66')])){_0x1f6bc5=_0x115612['query'][_0xe9c1('0x66')];}return _0x468db1[_0xe9c1('0x67')](_0x1f6bc5)[_0xe9c1('0x68')]();}})[_0xe9c1('0x27')](function(_0x278339){var _0xd686fd=[_0xe9c1('0x69'),_0xe9c1('0x6a'),'IsReminderSet',_0xe9c1('0x6b'),'Subject',_0xe9c1('0x6c')];var _0x598b75=[_0xe9c1('0x6d'),_0xe9c1('0x6e'),_0xe9c1('0x6f'),_0xe9c1('0x70'),_0xe9c1('0x71'),_0xe9c1('0x72'),_0xe9c1('0x73')];if(_0x278339){_['remove'](_0x278339[_0xe9c1('0x39')],function(_0x6ed8a9){return _0xd686fd['includes'](_0x6ed8a9['name'])||!_0x598b75[_0xe9c1('0x74')](_0x6ed8a9[_0xe9c1('0x31')]);});return{'count':_0x278339['fields'][_0xe9c1('0x3a')],'rows':_[_0xe9c1('0x2e')](_0x278339[_0xe9c1('0x39')],function(_0x3d316f){return{'id':_0x3d316f[_0xe9c1('0x2b')],'name':_0x3d316f[_0xe9c1('0x75')],'custom':_0x3d316f[_0xe9c1('0x76')],'options':_0x3d316f[_0xe9c1('0x77')][_0xe9c1('0x3a')]>0x0?_[_0xe9c1('0x2e')](_0x3d316f[_0xe9c1('0x77')],function(_0x3c8ed3){return{'name':_0x3c8ed3[_0xe9c1('0x75')],'value':_0x3c8ed3[_0xe9c1('0x78')]};}):_0x3d316f[_0xe9c1('0x31')]==_0xe9c1('0x70')?[{'name':_0xe9c1('0x79'),'value':_0xe9c1('0x7a')},{'name':'False','value':_0xe9c1('0x7b')}]:[]};})};}})[_0xe9c1('0x27')](respondWithResult(_0x305d39,null))[_0xe9c1('0x48')](function(_0x4fea25){var _0x5d6cbc=_0x115612[_0xe9c1('0x34')]['test']?0x1f4:_0x4fea25[_0xe9c1('0x7c')]||0x1f4;logger[_0xe9c1('0x29')](_0xe9c1('0x7d'),_0xe9c1('0x58'),_0x5d6cbc,JSON['stringify'](_0x4fea25));delete _0x4fea25[_0xe9c1('0x2b')];if(_0x5d6cbc===0x191){_0x5d6cbc=0x190;}_0x305d39[_0xe9c1('0x1f')](_0x5d6cbc)[_0xe9c1('0x2c')](_0x115612['query'][_0xe9c1('0x7e')]?{'message':_0xe9c1('0x7f'),'statusCode':_0x4fea25[_0xe9c1('0x7c')]}:_0x4fea25);});}; \ No newline at end of file +var _0x4cef=['destroy','getConfigurations','findOne','SalesforceConfiguration','sort','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','login','concat','ticketType','sobject','ActivityDate','IsReminderSet','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','label','custom','picklistValues','value','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','params','fields','find','create','body'];(function(_0x213bbd,_0x5a610b){var _0x479862=function(_0x409563){while(--_0x409563){_0x213bbd['push'](_0x213bbd['shift']());}};_0x479862(++_0x5a610b);}(_0x4cef,0x19f));var _0xf4ce=function(_0x20c4a2,_0x83cf29){_0x20c4a2=_0x20c4a2-0x0;var _0x151d44=_0x4cef[_0x20c4a2];return _0x151d44;};'use strict';var emlformat=require(_0xf4ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4ce('0x1'));var jsonpatch=require(_0xf4ce('0x2'));var rp=require(_0xf4ce('0x3'));var moment=require(_0xf4ce('0x4'));var BPromise=require(_0xf4ce('0x5'));var Mustache=require('mustache');var util=require(_0xf4ce('0x6'));var path=require(_0xf4ce('0x7'));var sox=require('sox');var csv=require(_0xf4ce('0x8'));var ejs=require(_0xf4ce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4ce('0xa'));var squel=require(_0xf4ce('0xb'));var crypto=require(_0xf4ce('0xc'));var jsforce=require(_0xf4ce('0xd'));var deskjs=require(_0xf4ce('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4ce('0xf'));var Papa=require('papaparse');var Redis=require(_0xf4ce('0x10'));var authService=require(_0xf4ce('0x11'));var qs=require(_0xf4ce('0x12'));var as=require(_0xf4ce('0x13'));var hardwareService=require(_0xf4ce('0x14'));var logger=require('../../config/logger')(_0xf4ce('0x15'));var utils=require(_0xf4ce('0x16'));var config=require(_0xf4ce('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4ce('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x512ca1,_0x5a3087){_0x5a3087=_0x5a3087||0xcc;return function(_0x3bc07a){if(_0x3bc07a){return _0x512ca1[_0xf4ce('0x19')](_0x5a3087);}return _0x512ca1['status'](_0x5a3087)[_0xf4ce('0x1a')]();};}function respondWithResult(_0x2364dd,_0x47c465){_0x47c465=_0x47c465||0xc8;return function(_0x2872b2){if(_0x2872b2){return _0x2364dd[_0xf4ce('0x1b')](_0x47c465)[_0xf4ce('0x1c')](_0x2872b2);}};}function respondWithFilteredResult(_0x44d36f,_0x3e7ef8){return function(_0x510957){if(_0x510957){var _0x353a72=typeof _0x3e7ef8[_0xf4ce('0x1d')]===_0xf4ce('0x1e')&&typeof _0x3e7ef8[_0xf4ce('0x1f')]==='undefined';var _0x3fe801=_0x510957[_0xf4ce('0x20')];var _0x1ffc2b=_0x353a72?0x0:_0x3e7ef8[_0xf4ce('0x1d')];var _0x2794a8=_0x353a72?_0x510957[_0xf4ce('0x20')]:_0x3e7ef8[_0xf4ce('0x1d')]+_0x3e7ef8[_0xf4ce('0x1f')];var _0x4db90e;if(_0x2794a8>=_0x3fe801){_0x2794a8=_0x3fe801;_0x4db90e=0xc8;}else{_0x4db90e=0xce;}_0x44d36f['status'](_0x4db90e);return _0x44d36f[_0xf4ce('0x21')](_0xf4ce('0x22'),_0x1ffc2b+'-'+_0x2794a8+'/'+_0x3fe801)['json'](_0x510957);}return null;};}function patchUpdates(_0x5160a5){return function(_0x279fe3){try{jsonpatch[_0xf4ce('0x23')](_0x279fe3,_0x5160a5,!![]);}catch(_0x4cfcf7){return BPromise[_0xf4ce('0x24')](_0x4cfcf7);}return _0x279fe3[_0xf4ce('0x25')]();};}function saveUpdates(_0x59686d,_0x2906f1){return function(_0x411da1){if(_0x411da1){return _0x411da1[_0xf4ce('0x26')](_0x59686d)[_0xf4ce('0x27')](function(_0x1af6c6){return _0x1af6c6;});}return null;};}function removeEntity(_0x15a59f,_0x3d78ea){return function(_0x10d633){if(_0x10d633){return _0x10d633['destroy']()[_0xf4ce('0x27')](function(){_0x15a59f[_0xf4ce('0x1b')](0xcc)[_0xf4ce('0x1a')]();});}};}function handleEntityNotFound(_0x2f95be,_0x38cf44){return function(_0x57d63e){if(!_0x57d63e){_0x2f95be[_0xf4ce('0x19')](0x194);}return _0x57d63e;};}function handleError(_0x1c418e,_0x11266a){_0x11266a=_0x11266a||0x1f4;return function(_0x32f65b){logger[_0xf4ce('0x28')](_0x32f65b['stack']);if(_0x32f65b['name']){delete _0x32f65b[_0xf4ce('0x29')];}_0x1c418e['status'](_0x11266a)[_0xf4ce('0x2a')](_0x32f65b);};}exports[_0xf4ce('0x2b')]=function(_0x24c619,_0x328789){var _0x281ff0={},_0x3eaf0a={},_0x10f8dd={'count':0x0,'rows':[]};var _0x2a64ce=_['map'](db[_0xf4ce('0x2c')][_0xf4ce('0x2d')],function(_0x1cfbf7){return{'name':_0x1cfbf7[_0xf4ce('0x2e')],'type':_0x1cfbf7[_0xf4ce('0x2f')][_0xf4ce('0x30')]};});_0x3eaf0a[_0xf4ce('0x31')]=_['map'](_0x2a64ce,_0xf4ce('0x29'));_0x3eaf0a[_0xf4ce('0x32')]=_[_0xf4ce('0x33')](_0x24c619[_0xf4ce('0x32')]);_0x3eaf0a[_0xf4ce('0x34')]=_[_0xf4ce('0x35')](_0x3eaf0a[_0xf4ce('0x31')],_0x3eaf0a[_0xf4ce('0x32')]);_0x281ff0[_0xf4ce('0x36')]=_[_0xf4ce('0x35')](_0x3eaf0a[_0xf4ce('0x31')],qs['fields'](_0x24c619[_0xf4ce('0x32')]['fields']));_0x281ff0[_0xf4ce('0x36')]=_0x281ff0[_0xf4ce('0x36')][_0xf4ce('0x37')]?_0x281ff0[_0xf4ce('0x36')]:_0x3eaf0a[_0xf4ce('0x31')];if(!_0x24c619[_0xf4ce('0x32')][_0xf4ce('0x38')]('nolimit')){_0x281ff0['limit']=qs['limit'](_0x24c619[_0xf4ce('0x32')]['limit']);_0x281ff0[_0xf4ce('0x1d')]=qs[_0xf4ce('0x1d')](_0x24c619['query'][_0xf4ce('0x1d')]);}_0x281ff0[_0xf4ce('0x39')]=qs['sort'](_0x24c619[_0xf4ce('0x32')]['sort']);_0x281ff0[_0xf4ce('0x3a')]=qs[_0xf4ce('0x34')](_[_0xf4ce('0x3b')](_0x24c619[_0xf4ce('0x32')],_0x3eaf0a[_0xf4ce('0x34')]),_0x2a64ce);if(_0x24c619['query'][_0xf4ce('0x3c')]){_0x281ff0[_0xf4ce('0x3a')]=_[_0xf4ce('0x3d')](_0x281ff0[_0xf4ce('0x3a')],{'$or':_[_0xf4ce('0x3e')](_0x2a64ce,function(_0x2abdd2){if(_0x2abdd2[_0xf4ce('0x2f')]!=='VIRTUAL'){var _0xe6259={};_0xe6259[_0x2abdd2['name']]={'$like':'%'+_0x24c619['query'][_0xf4ce('0x3c')]+'%'};return _0xe6259;}})});}_0x281ff0=_['merge']({},_0x281ff0,_0x24c619[_0xf4ce('0x3f')]);var _0xddf70f={'where':_0x281ff0[_0xf4ce('0x3a')]};return db['SalesforceAccount']['count'](_0xddf70f)[_0xf4ce('0x27')](function(_0x282199){_0x10f8dd[_0xf4ce('0x20')]=_0x282199;if(_0x24c619[_0xf4ce('0x32')][_0xf4ce('0x40')]){_0x281ff0['include']=[{'all':!![]}];}return db[_0xf4ce('0x2c')][_0xf4ce('0x41')](_0x281ff0);})[_0xf4ce('0x27')](function(_0x23ce7f){_0x10f8dd[_0xf4ce('0x42')]=_0x23ce7f;return _0x10f8dd;})['then'](respondWithFilteredResult(_0x328789,_0x281ff0))[_0xf4ce('0x43')](handleError(_0x328789,null));};exports['show']=function(_0xdf74a6,_0x307496){var _0x41ac42={'raw':![],'where':{'id':_0xdf74a6[_0xf4ce('0x44')]['id']}},_0x94866a={};_0x94866a[_0xf4ce('0x31')]=_[_0xf4ce('0x33')](db['SalesforceAccount'][_0xf4ce('0x2d')]);_0x94866a['query']=_['keys'](_0xdf74a6[_0xf4ce('0x32')]);_0x94866a[_0xf4ce('0x34')]=_[_0xf4ce('0x35')](_0x94866a[_0xf4ce('0x31')],_0x94866a['query']);_0x41ac42[_0xf4ce('0x36')]=_['intersection'](_0x94866a['model'],qs[_0xf4ce('0x45')](_0xdf74a6[_0xf4ce('0x32')][_0xf4ce('0x45')]));_0x41ac42[_0xf4ce('0x36')]=_0x41ac42[_0xf4ce('0x36')][_0xf4ce('0x37')]?_0x41ac42[_0xf4ce('0x36')]:_0x94866a[_0xf4ce('0x31')];if(_0xdf74a6[_0xf4ce('0x32')][_0xf4ce('0x40')]){_0x41ac42['include']=[{'all':!![]}];}_0x41ac42=_['merge']({},_0x41ac42,_0xdf74a6[_0xf4ce('0x3f')]);return db[_0xf4ce('0x2c')][_0xf4ce('0x46')](_0x41ac42)[_0xf4ce('0x27')](handleEntityNotFound(_0x307496,null))['then'](respondWithResult(_0x307496,null))['catch'](handleError(_0x307496,null));};exports[_0xf4ce('0x47')]=function(_0x175925,_0x4876ca){return db[_0xf4ce('0x2c')][_0xf4ce('0x47')](_0x175925[_0xf4ce('0x48')],{})[_0xf4ce('0x27')](respondWithResult(_0x4876ca,0xc9))[_0xf4ce('0x43')](handleError(_0x4876ca,null));};exports[_0xf4ce('0x26')]=function(_0x5c9e01,_0x3e0d24){if(_0x5c9e01[_0xf4ce('0x48')]['id']){delete _0x5c9e01['body']['id'];}return db[_0xf4ce('0x2c')][_0xf4ce('0x46')]({'where':{'id':_0x5c9e01[_0xf4ce('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e0d24,null))[_0xf4ce('0x27')](saveUpdates(_0x5c9e01[_0xf4ce('0x48')],null))[_0xf4ce('0x27')](respondWithResult(_0x3e0d24,null))[_0xf4ce('0x43')](handleError(_0x3e0d24,null));};exports[_0xf4ce('0x49')]=function(_0x14ac33,_0x1434b0){return db['SalesforceAccount'][_0xf4ce('0x46')]({'where':{'id':_0x14ac33['params']['id']}})[_0xf4ce('0x27')](handleEntityNotFound(_0x1434b0,null))[_0xf4ce('0x27')](removeEntity(_0x1434b0,null))[_0xf4ce('0x43')](handleError(_0x1434b0,null));};exports[_0xf4ce('0x4a')]=function(_0x41323e,_0x338a46,_0x44d55d){var _0xb6c720={};var _0x4ea929={};var _0x4adc7c;var _0x57f9ce;return db[_0xf4ce('0x2c')][_0xf4ce('0x4b')]({'where':{'id':_0x41323e['params']['id']}})[_0xf4ce('0x27')](handleEntityNotFound(_0x338a46,null))[_0xf4ce('0x27')](function(_0x423335){if(_0x423335){_0x4adc7c=_0x423335;_0x4ea929[_0xf4ce('0x31')]=_['keys'](db[_0xf4ce('0x4c')][_0xf4ce('0x2d')]);_0x4ea929[_0xf4ce('0x32')]=_['keys'](_0x41323e['query']);_0x4ea929[_0xf4ce('0x34')]=_[_0xf4ce('0x35')](_0x4ea929[_0xf4ce('0x31')],_0x4ea929['query']);_0xb6c720[_0xf4ce('0x36')]=_['intersection'](_0x4ea929[_0xf4ce('0x31')],qs[_0xf4ce('0x45')](_0x41323e['query'][_0xf4ce('0x45')]));_0xb6c720[_0xf4ce('0x36')]=_0xb6c720[_0xf4ce('0x36')][_0xf4ce('0x37')]?_0xb6c720['attributes']:_0x4ea929['model'];_0xb6c720['order']=qs[_0xf4ce('0x4d')](_0x41323e['query'][_0xf4ce('0x4d')]);_0xb6c720[_0xf4ce('0x3a')]=qs[_0xf4ce('0x34')](_[_0xf4ce('0x3b')](_0x41323e['query'],_0x4ea929[_0xf4ce('0x34')]));if(_0x41323e[_0xf4ce('0x32')][_0xf4ce('0x3c')]){_0xb6c720[_0xf4ce('0x3a')]=_['merge'](_0xb6c720[_0xf4ce('0x3a')],{'$or':_[_0xf4ce('0x3e')](_0xb6c720[_0xf4ce('0x36')],function(_0x492d82){var _0x29e06a={};_0x29e06a[_0x492d82]={'$like':'%'+_0x41323e[_0xf4ce('0x32')][_0xf4ce('0x3c')]+'%'};return _0x29e06a;})});}_0xb6c720=_[_0xf4ce('0x3d')]({},_0xb6c720,_0x41323e[_0xf4ce('0x3f')]);return _0x4adc7c[_0xf4ce('0x4a')](_0xb6c720);}})[_0xf4ce('0x27')](function(_0x268457){if(_0x268457){_0x57f9ce=_0x268457[_0xf4ce('0x37')];if(!_0x41323e[_0xf4ce('0x32')][_0xf4ce('0x38')]('nolimit')){_0xb6c720[_0xf4ce('0x1f')]=qs[_0xf4ce('0x1f')](_0x41323e['query'][_0xf4ce('0x1f')]);_0xb6c720[_0xf4ce('0x1d')]=qs['offset'](_0x41323e['query'][_0xf4ce('0x1d')]);}return _0x4adc7c[_0xf4ce('0x4a')](_0xb6c720);}})[_0xf4ce('0x27')](function(_0x4fcda1){if(_0x4fcda1){return _0x4fcda1?{'count':_0x57f9ce,'rows':_0x4fcda1}:null;}})[_0xf4ce('0x27')](respondWithResult(_0x338a46,null))['catch'](handleError(_0x338a46,null));};exports[_0xf4ce('0x4e')]=function(_0x4de717,_0x28505e,_0x1c3442){if(_0x4de717[_0xf4ce('0x48')]['id']){delete _0x4de717[_0xf4ce('0x48')]['id'];}return db[_0xf4ce('0x2c')][_0xf4ce('0x4b')]({'where':{'id':_0x4de717[_0xf4ce('0x44')]['id']}})['then'](handleEntityNotFound(_0x28505e,null))[_0xf4ce('0x27')](function(_0x37ade7){if(_0x37ade7){_0x4de717[_0xf4ce('0x48')][_0xf4ce('0x4f')]=_0x37ade7['id'];_0x4de717[_0xf4ce('0x48')][_0xf4ce('0x50')]=integrations['getSubjects'](_0x4de717['body'][_0xf4ce('0x51')],_0x4de717['body'][_0xf4ce('0x2f')]);_0x4de717[_0xf4ce('0x48')][_0xf4ce('0x52')]=integrations[_0xf4ce('0x53')](_0x4de717[_0xf4ce('0x48')]['channel'],_0x4de717['body'][_0xf4ce('0x2f')]);return db[_0xf4ce('0x4c')][_0xf4ce('0x47')](_0x4de717[_0xf4ce('0x48')],{'include':[{'model':db[_0xf4ce('0x54')],'as':_0xf4ce('0x50')},{'model':db[_0xf4ce('0x54')],'as':_0xf4ce('0x52')}]});}return null;})[_0xf4ce('0x27')](respondWithResult(_0x28505e,null))[_0xf4ce('0x43')](handleError(_0x28505e,null));};exports[_0xf4ce('0x55')]=function(_0xc8f0eb,_0x5c98e8,_0x7caf15){var _0x2e9fa4;var _0xd19e6f='';var _0xf1ff98=_0xf4ce('0x56');return db[_0xf4ce('0x2c')]['findOne']({'where':{'id':_0xc8f0eb['params']['id']},'attributes':['id','remoteUri',_0xf4ce('0x57'),_0xf4ce('0x58'),_0xf4ce('0x59'),_0xf4ce('0x5a'),_0xf4ce('0x5b')]})['then'](handleEntityNotFound(_0x5c98e8,null))[_0xf4ce('0x27')](function(_0x1cd0d0){if(_0x1cd0d0){_0xd19e6f=_0x1cd0d0[_0xf4ce('0x5c')];var _0xb79c99=_0xd19e6f[_0xf4ce('0x5d')](-0x1);if(_0xb79c99==='/'){_0xd19e6f=_0xd19e6f[_0xf4ce('0x5e')](0x0,_0xd19e6f['lastIndexOf'](_0xb79c99));}_0x2e9fa4=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd19e6f,'clientId':_0x1cd0d0['clientId'],'clientSecret':_0x1cd0d0[_0xf4ce('0x58')]}});return _0x2e9fa4[_0xf4ce('0x5f')](_0x1cd0d0[_0xf4ce('0x59')],_0x1cd0d0[_0xf4ce('0x5a')][_0xf4ce('0x60')](_0x1cd0d0[_0xf4ce('0x5b')]));}})[_0xf4ce('0x27')](function(_0x31ae03){if(_0x31ae03){if(!_['isNil'](_0xc8f0eb[_0xf4ce('0x32')][_0xf4ce('0x61')])){_0xf1ff98=_0xc8f0eb[_0xf4ce('0x32')][_0xf4ce('0x61')];}return _0x2e9fa4[_0xf4ce('0x62')](_0xf1ff98)['describe']();}})[_0xf4ce('0x27')](function(_0x25c5f0){var _0x5d7fc7=['OwnerId',_0xf4ce('0x63'),_0xf4ce('0x64'),'IsRecurrence',_0xf4ce('0x65'),_0xf4ce('0x66')];var _0x22c4a1=[_0xf4ce('0x67'),'int',_0xf4ce('0x68'),_0xf4ce('0x69'),_0xf4ce('0x6a'),_0xf4ce('0x6b'),_0xf4ce('0x6c')];if(_0x25c5f0){_[_0xf4ce('0x6d')](_0x25c5f0[_0xf4ce('0x45')],function(_0x2027eb){return _0x5d7fc7['includes'](_0x2027eb[_0xf4ce('0x29')])||!_0x22c4a1['includes'](_0x2027eb[_0xf4ce('0x2f')]);});return{'count':_0x25c5f0[_0xf4ce('0x45')][_0xf4ce('0x37')],'rows':_[_0xf4ce('0x3e')](_0x25c5f0[_0xf4ce('0x45')],function(_0xd1f305){return{'id':_0xd1f305[_0xf4ce('0x29')],'name':_0xd1f305[_0xf4ce('0x6e')],'custom':_0xd1f305[_0xf4ce('0x6f')],'options':_0xd1f305[_0xf4ce('0x70')][_0xf4ce('0x37')]>0x0?_[_0xf4ce('0x3e')](_0xd1f305[_0xf4ce('0x70')],function(_0x404748){return{'name':_0x404748['label'],'value':_0x404748[_0xf4ce('0x71')]};}):_0xd1f305[_0xf4ce('0x2f')]==_0xf4ce('0x69')?[{'name':_0xf4ce('0x72'),'value':_0xf4ce('0x73')},{'name':_0xf4ce('0x74'),'value':_0xf4ce('0x75')}]:[]};})};}})[_0xf4ce('0x27')](respondWithResult(_0x5c98e8,null))[_0xf4ce('0x43')](function(_0x585a40){var _0x408fc0=_0xc8f0eb[_0xf4ce('0x32')]['test']?0x1f4:_0x585a40[_0xf4ce('0x76')]||0x1f4;logger['error'](_0xf4ce('0x77'),_0xf4ce('0x55'),_0x408fc0,JSON['stringify'](_0x585a40));delete _0x585a40['name'];if(_0x408fc0===0x191){_0x408fc0=0x190;}_0x5c98e8[_0xf4ce('0x1b')](_0x408fc0)['send'](_0xc8f0eb['query'][_0xf4ce('0x78')]?{'message':_0xf4ce('0x79'),'statusCode':_0x585a40[_0xf4ce('0x76')]}:_0x585a40);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 759b5d8..ba972f0 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 _0x9d5b=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2c4fea,_0x36366f){var _0x770b8c=function(_0x27cc3b){while(--_0x27cc3b){_0x2c4fea['push'](_0x2c4fea['shift']());}};_0x770b8c(++_0x36366f);}(_0x9d5b,0x71));var _0xb9d5=function(_0x7d3de7,_0x286519){_0x7d3de7=_0x7d3de7-0x0;var _0x3b74a2=_0x9d5b[_0x7d3de7];return _0x3b74a2;};'use strict';var _=require(_0xb9d5('0x0'));var util=require('util');var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xb9d5('0x4'));var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));var integrations=require(_0xb9d5('0x8'));module[_0xb9d5('0x9')]=function(_0x858576,_0x30cd32){return _0x858576[_0xb9d5('0xa')](_0xb9d5('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf93b=['api','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf93b,0x1d1));var _0xbf93=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xf93b[_0x406696];return _0x10e35c;};'use strict';var _=require(_0xbf93('0x0'));var util=require(_0xbf93('0x1'));var logger=require(_0xbf93('0x2'))(_0xbf93('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf93('0x4'));var fs=require('fs');var path=require(_0xbf93('0x5'));var rimraf=require(_0xbf93('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf93('0x7'));var integrations=require(_0xbf93('0x8'));module[_0xbf93('0x9')]=function(_0x2f1240,_0x69b566){return _0x2f1240[_0xbf93('0xa')]('SalesforceAccount',attributes,{'tableName':_0xbf93('0xb'),'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 21f81ef..4ef5f25 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 _0xc6df=['map','model','attributes','ShowSalesforceAccount','find','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include'];(function(_0x18c23c,_0x5d31df){var _0xa3b55=function(_0x59ce50){while(--_0x59ce50){_0x18c23c['push'](_0x18c23c['shift']());}};_0xa3b55(++_0x5d31df);}(_0xc6df,0x115));var _0xfc6d=function(_0x5788fd,_0x1b27fa){_0x5788fd=_0x5788fd-0x0;var _0x24ec06=_0xc6df[_0x5788fd];return _0x24ec06;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc6d('0x0'));var BPromise=require(_0xfc6d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc6d('0x2'))['db'];var utils=require(_0xfc6d('0x3'));var logger=require(_0xfc6d('0x4'))(_0xfc6d('0x5'));var config=require(_0xfc6d('0x6'));var jayson=require(_0xfc6d('0x7'));var client=jayson[_0xfc6d('0x8')][_0xfc6d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c9ead,_0x33714f,_0x1df6a7){return new BPromise(function(_0x17b466,_0x5067a0){return client['request'](_0x4c9ead,_0x1df6a7)[_0xfc6d('0xa')](function(_0x394ffa){logger['info'](_0xfc6d('0xb'),_0x33714f,'request\x20sent');logger[_0xfc6d('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x33714f,_0xfc6d('0xd'),JSON[_0xfc6d('0xe')](_0x394ffa));if(_0x394ffa[_0xfc6d('0xf')]){if(_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x10')]===0x1f4){logger[_0xfc6d('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x33714f,_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);return _0x5067a0(_0x394ffa[_0xfc6d('0xf')]['message']);}logger['error'](_0xfc6d('0xb'),_0x33714f,_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);return _0x17b466(_0x394ffa[_0xfc6d('0xf')][_0xfc6d('0x11')]);}else{logger[_0xfc6d('0x12')](_0xfc6d('0xb'),_0x33714f,_0xfc6d('0xd'));_0x17b466(_0x394ffa[_0xfc6d('0x13')][_0xfc6d('0x11')]);}})[_0xfc6d('0x14')](function(_0x1d892d){logger[_0xfc6d('0xf')](_0xfc6d('0xb'),_0x33714f,_0x1d892d);_0x5067a0(_0x1d892d);});});}exports[_0xfc6d('0x15')]=function(_0x56cc8f){var _0x8b8ceb=this;return new Promise(function(_0x4b0a5f,_0x1f702a){return db[_0xfc6d('0x16')][_0xfc6d('0x17')]({'raw':_0x56cc8f[_0xfc6d('0x18')]?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x19')]===undefined?!![]:![]:!![],'where':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1a')]||null:null,'attributes':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')]['attributes']||null:null,'limit':_0x56cc8f[_0xfc6d('0x18')]?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1b')]||null:null,'include':_0x56cc8f['options']?_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x56cc8f[_0xfc6d('0x18')][_0xfc6d('0x1c')],function(_0x105b2e){return{'model':db[_0x105b2e[_0xfc6d('0x1e')]],'as':_0x105b2e['as'],'attributes':_0x105b2e['attributes'],'include':_0x105b2e[_0xfc6d('0x1c')]?_['map'](_0x105b2e[_0xfc6d('0x1c')],function(_0x494bd9){return{'model':db[_0x494bd9[_0xfc6d('0x1e')]],'as':_0x494bd9['as'],'attributes':_0x494bd9[_0xfc6d('0x1f')],'include':_0x494bd9[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x494bd9[_0xfc6d('0x1c')],function(_0x5bb04f){return{'model':db[_0x5bb04f[_0xfc6d('0x1e')]],'as':_0x5bb04f['as'],'attributes':_0x5bb04f[_0xfc6d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfc6d('0xa')](function(_0x5c88f8){logger['info'](_0xfc6d('0x15'),_0x56cc8f);logger[_0xfc6d('0xc')](_0xfc6d('0x15'),_0x56cc8f,JSON[_0xfc6d('0xe')](_0x5c88f8));_0x4b0a5f(_0x5c88f8);})[_0xfc6d('0x14')](function(_0x3fd304){logger['error'](_0xfc6d('0x15'),_0x3fd304[_0xfc6d('0x11')],_0x56cc8f);_0x1f702a(_0x8b8ceb[_0xfc6d('0xf')](0x1f4,_0x3fd304[_0xfc6d('0x11')]));});});};exports[_0xfc6d('0x20')]=function(_0x47c574){var _0x87de60=this;return new Promise(function(_0x5c02d9,_0x5b70b2){return db['SalesforceAccount'][_0xfc6d('0x21')]({'raw':_0x47c574[_0xfc6d('0x18')]?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x19')]===undefined?!![]:![]:!![],'where':_0x47c574['options']?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x1a')]||null:null,'attributes':_0x47c574[_0xfc6d('0x18')]?_0x47c574['options'][_0xfc6d('0x1f')]||null:null,'include':_0x47c574['options']?_0x47c574[_0xfc6d('0x18')][_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x47c574[_0xfc6d('0x18')]['include'],function(_0x32b293){return{'model':db[_0x32b293[_0xfc6d('0x1e')]],'as':_0x32b293['as'],'attributes':_0x32b293['attributes'],'include':_0x32b293[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x32b293[_0xfc6d('0x1c')],function(_0x3b8bad){return{'model':db[_0x3b8bad[_0xfc6d('0x1e')]],'as':_0x3b8bad['as'],'attributes':_0x3b8bad['attributes'],'include':_0x3b8bad[_0xfc6d('0x1c')]?_[_0xfc6d('0x1d')](_0x3b8bad[_0xfc6d('0x1c')],function(_0x1e215e){return{'model':db[_0x1e215e[_0xfc6d('0x1e')]],'as':_0x1e215e['as'],'attributes':_0x1e215e[_0xfc6d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4238da){logger[_0xfc6d('0x12')](_0xfc6d('0x20'),_0x47c574);logger[_0xfc6d('0xc')](_0xfc6d('0x20'),_0x47c574,JSON[_0xfc6d('0xe')](_0x4238da));_0x5c02d9(_0x4238da);})[_0xfc6d('0x14')](function(_0x2d9d3f){logger['error'](_0xfc6d('0x20'),_0x2d9d3f[_0xfc6d('0x11')],_0x47c574);_0x5b70b2(_0x87de60['error'](0x1f4,_0x2d9d3f[_0xfc6d('0x11')]));});});}; \ No newline at end of file +var _0xf780=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','debug','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','include','map','model','ShowSalesforceAccount','find','raw','where','lodash','util','moment','bluebird','randomstring'];(function(_0xe9f4a2,_0x50f0c4){var _0x25e066=function(_0x32557f){while(--_0x32557f){_0xe9f4a2['push'](_0xe9f4a2['shift']());}};_0x25e066(++_0x50f0c4);}(_0xf780,0xd3));var _0x0f78=function(_0x52b449,_0x120e19){_0x52b449=_0x52b449-0x0;var _0x55c25b=_0xf780[_0x52b449];return _0x55c25b;};'use strict';var _=require(_0x0f78('0x0'));var util=require(_0x0f78('0x1'));var moment=require(_0x0f78('0x2'));var BPromise=require(_0x0f78('0x3'));var rs=require(_0x0f78('0x4'));var fs=require('fs');var Redis=require(_0x0f78('0x5'));var db=require(_0x0f78('0x6'))['db'];var utils=require(_0x0f78('0x7'));var logger=require('../../config/logger')(_0x0f78('0x8'));var config=require(_0x0f78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0f78('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1222ef,_0x432032,_0x3364c9){return new BPromise(function(_0x1cebb3,_0x80a08b){return client[_0x0f78('0xb')](_0x1222ef,_0x3364c9)[_0x0f78('0xc')](function(_0x18a765){logger[_0x0f78('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x432032,'request\x20sent');logger[_0x0f78('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x432032,_0x0f78('0xf'),JSON[_0x0f78('0x10')](_0x18a765));if(_0x18a765['error']){if(_0x18a765[_0x0f78('0x11')][_0x0f78('0x12')]===0x1f4){logger['error'](_0x0f78('0x13'),_0x432032,_0x18a765[_0x0f78('0x11')][_0x0f78('0x14')]);return _0x80a08b(_0x18a765[_0x0f78('0x11')]['message']);}logger[_0x0f78('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x432032,_0x18a765['error']['message']);return _0x1cebb3(_0x18a765['error']['message']);}else{logger[_0x0f78('0xd')](_0x0f78('0x13'),_0x432032,_0x0f78('0xf'));_0x1cebb3(_0x18a765[_0x0f78('0x15')][_0x0f78('0x14')]);}})[_0x0f78('0x16')](function(_0x4c62bf){logger[_0x0f78('0x11')](_0x0f78('0x13'),_0x432032,_0x4c62bf);_0x80a08b(_0x4c62bf);});});}exports[_0x0f78('0x17')]=function(_0x40bccf){var _0x358b85=this;return new Promise(function(_0x53ee9b,_0x1f8ef7){return db[_0x0f78('0x18')][_0x0f78('0x19')]({'raw':_0x40bccf[_0x0f78('0x1a')]?_0x40bccf[_0x0f78('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40bccf[_0x0f78('0x1a')]?_0x40bccf[_0x0f78('0x1a')]['where']||null:null,'attributes':_0x40bccf[_0x0f78('0x1a')]?_0x40bccf[_0x0f78('0x1a')][_0x0f78('0x1b')]||null:null,'limit':_0x40bccf[_0x0f78('0x1a')]?_0x40bccf[_0x0f78('0x1a')][_0x0f78('0x1c')]||null:null,'include':_0x40bccf[_0x0f78('0x1a')]?_0x40bccf[_0x0f78('0x1a')][_0x0f78('0x1d')]?_['map'](_0x40bccf[_0x0f78('0x1a')]['include'],function(_0x54fc6f){return{'model':db[_0x54fc6f['model']],'as':_0x54fc6f['as'],'attributes':_0x54fc6f[_0x0f78('0x1b')],'include':_0x54fc6f['include']?_[_0x0f78('0x1e')](_0x54fc6f['include'],function(_0x1eb02c){return{'model':db[_0x1eb02c[_0x0f78('0x1f')]],'as':_0x1eb02c['as'],'attributes':_0x1eb02c[_0x0f78('0x1b')],'include':_0x1eb02c[_0x0f78('0x1d')]?_[_0x0f78('0x1e')](_0x1eb02c['include'],function(_0x4c4c16){return{'model':db[_0x4c4c16[_0x0f78('0x1f')]],'as':_0x4c4c16['as'],'attributes':_0x4c4c16['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f78('0xc')](function(_0x56d09b){logger[_0x0f78('0xd')](_0x0f78('0x17'),_0x40bccf);logger[_0x0f78('0xe')](_0x0f78('0x17'),_0x40bccf,JSON['stringify'](_0x56d09b));_0x53ee9b(_0x56d09b);})['catch'](function(_0x541e34){logger[_0x0f78('0x11')](_0x0f78('0x17'),_0x541e34[_0x0f78('0x14')],_0x40bccf);_0x1f8ef7(_0x358b85['error'](0x1f4,_0x541e34[_0x0f78('0x14')]));});});};exports[_0x0f78('0x20')]=function(_0x3511c8){var _0xd11365=this;return new Promise(function(_0x52dba3,_0x1176dd){return db[_0x0f78('0x18')][_0x0f78('0x21')]({'raw':_0x3511c8[_0x0f78('0x1a')]?_0x3511c8[_0x0f78('0x1a')][_0x0f78('0x22')]===undefined?!![]:![]:!![],'where':_0x3511c8[_0x0f78('0x1a')]?_0x3511c8[_0x0f78('0x1a')][_0x0f78('0x23')]||null:null,'attributes':_0x3511c8[_0x0f78('0x1a')]?_0x3511c8['options'][_0x0f78('0x1b')]||null:null,'include':_0x3511c8['options']?_0x3511c8[_0x0f78('0x1a')][_0x0f78('0x1d')]?_[_0x0f78('0x1e')](_0x3511c8[_0x0f78('0x1a')]['include'],function(_0x395bec){return{'model':db[_0x395bec['model']],'as':_0x395bec['as'],'attributes':_0x395bec['attributes'],'include':_0x395bec[_0x0f78('0x1d')]?_[_0x0f78('0x1e')](_0x395bec[_0x0f78('0x1d')],function(_0x186e27){return{'model':db[_0x186e27['model']],'as':_0x186e27['as'],'attributes':_0x186e27[_0x0f78('0x1b')],'include':_0x186e27[_0x0f78('0x1d')]?_[_0x0f78('0x1e')](_0x186e27[_0x0f78('0x1d')],function(_0x276f53){return{'model':db[_0x276f53[_0x0f78('0x1f')]],'as':_0x276f53['as'],'attributes':_0x276f53[_0x0f78('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x530248){logger['info'](_0x0f78('0x20'),_0x3511c8);logger[_0x0f78('0xe')]('ShowSalesforceAccount',_0x3511c8,JSON[_0x0f78('0x10')](_0x530248));_0x52dba3(_0x530248);})['catch'](function(_0x4be3b0){logger['error'](_0x0f78('0x20'),_0x4be3b0[_0x0f78('0x14')],_0x3511c8);_0x1176dd(_0xd11365[_0x0f78('0x11')](0x1f4,_0x4be3b0[_0x0f78('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f1c2568..9425480 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb28,0x106));var _0x8db2=function(_0x8a6253,_0x60fc8f){_0x8a6253=_0x8a6253-0x0;var _0x505ccd=_0xdb28[_0x8a6253];return _0x505ccd;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _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(_0x26a559,_0x488e57){var _0x1a4890=function(_0x2bf1fc){while(--_0x2bf1fc){_0x26a559['push'](_0x26a559['shift']());}};_0x1a4890(++_0x488e57);}(_0x5f2f,0x73));var _0xf5f2=function(_0x16d198,_0x504d5e){_0x16d198=_0x16d198-0x0;var _0xcea7d=_0x5f2f[_0x16d198];return _0xcea7d;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 03821d2..6dd9ad7 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 _0xfd96=['nothing','sequelize','STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xfd96,0xe7));var _0x6fd9=function(_0x19babc,_0x50a993){_0x19babc=_0x19babc-0x0;var _0x13e3e8=_0xfd96[_0x19babc];return _0x13e3e8;};'use strict';var Sequelize=require(_0x6fd9('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fd9('0x1')]},'description':{'type':Sequelize[_0x6fd9('0x1')]},'ticketType':{'type':Sequelize[_0x6fd9('0x2')](_0x6fd9('0x3'),'Case'),'defaultValue':_0x6fd9('0x3')},'moduleSearch':{'type':Sequelize[_0x6fd9('0x2')](_0x6fd9('0x4'),_0x6fd9('0x5'),_0x6fd9('0x6'),_0x6fd9('0x7'),_0x6fd9('0x8')),'defaultValue':_0x6fd9('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6fd9('0x9'),'contact',_0x6fd9('0x6'),_0x6fd9('0x8')),'defaultValue':_0x6fd9('0x6')},'leadId':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x6fd9('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x6fd9('0x1')]}}; \ No newline at end of file +var _0xbff3=['contact','account','contact_lead','lead','sequelize','STRING','ENUM','Task','Case'];(function(_0x55e0f8,_0x2e00ba){var _0x6f317e=function(_0x32b9f2){while(--_0x32b9f2){_0x55e0f8['push'](_0x55e0f8['shift']());}};_0x6f317e(++_0x2e00ba);}(_0xbff3,0xdc));var _0x3bff=function(_0x12f169,_0x51d4d1){_0x12f169=_0x12f169-0x0;var _0x17fa0d=_0xbff3[_0x12f169];return _0x17fa0d;};'use strict';var Sequelize=require(_0x3bff('0x0'));module['exports']={'name':{'type':Sequelize[_0x3bff('0x1')]},'description':{'type':Sequelize[_0x3bff('0x1')]},'ticketType':{'type':Sequelize[_0x3bff('0x2')](_0x3bff('0x3'),_0x3bff('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x3bff('0x2')]('contact_lead',_0x3bff('0x5'),'lead','account_contact_lead',_0x3bff('0x6')),'defaultValue':_0x3bff('0x7')},'moduleCreate':{'type':Sequelize[_0x3bff('0x2')]('nothing',_0x3bff('0x5'),_0x3bff('0x8'),_0x3bff('0x6')),'defaultValue':_0x3bff('0x8')},'leadId':{'type':Sequelize[_0x3bff('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x3bff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 87c2f27..d701639 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 _0x6a8e=['index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','findOne','SalesforceField','order','getFields','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','end','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send'];(function(_0x4f3acd,_0x528a2c){var _0x1abbcb=function(_0x53779e){while(--_0x53779e){_0x4f3acd['push'](_0x4f3acd['shift']());}};_0x1abbcb(++_0x528a2c);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x14f53d,_0xd6db59){_0x14f53d=_0x14f53d-0x0;var _0x3cea5b=_0x6a8e[_0x14f53d];return _0x3cea5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6a8('0x1'));var rp=require(_0xe6a8('0x2'));var moment=require('moment');var BPromise=require(_0xe6a8('0x3'));var Mustache=require(_0xe6a8('0x4'));var util=require(_0xe6a8('0x5'));var path=require(_0xe6a8('0x6'));var sox=require(_0xe6a8('0x7'));var csv=require('to-csv');var ejs=require(_0xe6a8('0x8'));var fs=require('fs');var fs_extra=require(_0xe6a8('0x9'));var _=require(_0xe6a8('0xa'));var squel=require(_0xe6a8('0xb'));var crypto=require(_0xe6a8('0xc'));var jsforce=require(_0xe6a8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6a8('0xe'));var Papa=require(_0xe6a8('0xf'));var Redis=require('ioredis');var authService=require(_0xe6a8('0x10'));var qs=require(_0xe6a8('0x11'));var as=require(_0xe6a8('0x12'));var hardwareService=require(_0xe6a8('0x13'));var logger=require('../../config/logger')(_0xe6a8('0x14'));var utils=require('../../config/utils');var config=require(_0xe6a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21ac6c,_0x383182){_0x383182=_0x383182||0xcc;return function(_0x32054e){if(_0x32054e){return _0x21ac6c['sendStatus'](_0x383182);}return _0x21ac6c[_0xe6a8('0x16')](_0x383182)[_0xe6a8('0x17')]();};}function respondWithResult(_0x4eb784,_0x405498){_0x405498=_0x405498||0xc8;return function(_0x408fec){if(_0x408fec){return _0x4eb784[_0xe6a8('0x16')](_0x405498)['json'](_0x408fec);}};}function respondWithFilteredResult(_0x1ebc64,_0x59ca94){return function(_0x19fc1a){if(_0x19fc1a){var _0xfa7897=typeof _0x59ca94[_0xe6a8('0x18')]==='undefined'&&typeof _0x59ca94[_0xe6a8('0x19')]===_0xe6a8('0x1a');var _0x144ff7=_0x19fc1a['count'];var _0x1c0c5a=_0xfa7897?0x0:_0x59ca94['offset'];var _0x39ade4=_0xfa7897?_0x19fc1a['count']:_0x59ca94[_0xe6a8('0x18')]+_0x59ca94[_0xe6a8('0x19')];var _0x4b6d4f;if(_0x39ade4>=_0x144ff7){_0x39ade4=_0x144ff7;_0x4b6d4f=0xc8;}else{_0x4b6d4f=0xce;}_0x1ebc64[_0xe6a8('0x16')](_0x4b6d4f);return _0x1ebc64[_0xe6a8('0x1b')](_0xe6a8('0x1c'),_0x1c0c5a+'-'+_0x39ade4+'/'+_0x144ff7)[_0xe6a8('0x1d')](_0x19fc1a);}return null;};}function patchUpdates(_0x39caee){return function(_0x5e02f4){try{jsonpatch[_0xe6a8('0x1e')](_0x5e02f4,_0x39caee,!![]);}catch(_0x5b600e){return BPromise[_0xe6a8('0x1f')](_0x5b600e);}return _0x5e02f4['save']();};}function saveUpdates(_0x21d384,_0x2e6109){return function(_0x1fd3d2){if(_0x1fd3d2){return _0x1fd3d2[_0xe6a8('0x20')](_0x21d384)[_0xe6a8('0x21')](function(_0x289c65){return _0x289c65;});}return null;};}function removeEntity(_0x3e5d98,_0x313486){return function(_0x5e405c){if(_0x5e405c){return _0x5e405c[_0xe6a8('0x22')]()[_0xe6a8('0x21')](function(){_0x3e5d98[_0xe6a8('0x16')](0xcc)[_0xe6a8('0x17')]();});}};}function handleEntityNotFound(_0x352a3b,_0x264468){return function(_0x372594){if(!_0x372594){_0x352a3b['sendStatus'](0x194);}return _0x372594;};}function handleError(_0x8683bd,_0x20eec9){_0x20eec9=_0x20eec9||0x1f4;return function(_0x224721){logger['error'](_0x224721[_0xe6a8('0x23')]);if(_0x224721[_0xe6a8('0x24')]){delete _0x224721[_0xe6a8('0x24')];}_0x8683bd[_0xe6a8('0x16')](_0x20eec9)[_0xe6a8('0x25')](_0x224721);};}exports[_0xe6a8('0x26')]=function(_0x263110,_0x2a21ff){var _0x122984={},_0x4d6a6f={},_0xd5655d={'count':0x0,'rows':[]};var _0x401694=_[_0xe6a8('0x27')](db[_0xe6a8('0x28')][_0xe6a8('0x29')],function(_0x5293a2){return{'name':_0x5293a2[_0xe6a8('0x2a')],'type':_0x5293a2['type'][_0xe6a8('0x2b')]};});_0x4d6a6f[_0xe6a8('0x2c')]=_[_0xe6a8('0x27')](_0x401694,_0xe6a8('0x24'));_0x4d6a6f['query']=_['keys'](_0x263110[_0xe6a8('0x2d')]);_0x4d6a6f[_0xe6a8('0x2e')]=_[_0xe6a8('0x2f')](_0x4d6a6f[_0xe6a8('0x2c')],_0x4d6a6f[_0xe6a8('0x2d')]);_0x122984[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x4d6a6f[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x122984[_0xe6a8('0x30')]=_0x122984['attributes'][_0xe6a8('0x32')]?_0x122984[_0xe6a8('0x30')]:_0x4d6a6f[_0xe6a8('0x2c')];if(!_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x33')](_0xe6a8('0x34'))){_0x122984[_0xe6a8('0x19')]=qs['limit'](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x122984[_0xe6a8('0x18')]=qs[_0xe6a8('0x18')](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}_0x122984['order']=qs['sort'](_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x122984[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0x263110[_0xe6a8('0x2d')],_0x4d6a6f[_0xe6a8('0x2e')]),_0x401694);if(_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x122984['where']=_[_0xe6a8('0x39')](_0x122984[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x401694,function(_0x2852ca){if(_0x2852ca[_0xe6a8('0x3a')]!=='VIRTUAL'){var _0x719f0f={};_0x719f0f[_0x2852ca[_0xe6a8('0x24')]]={'$like':'%'+_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x38')]+'%'};return _0x719f0f;}})});}_0x122984=_[_0xe6a8('0x39')]({},_0x122984,_0x263110['options']);var _0x3b9de0={'where':_0x122984[_0xe6a8('0x36')]};return db[_0xe6a8('0x28')][_0xe6a8('0x3b')](_0x3b9de0)['then'](function(_0x3e6c96){_0xd5655d[_0xe6a8('0x3b')]=_0x3e6c96;if(_0x263110[_0xe6a8('0x2d')][_0xe6a8('0x3c')]){_0x122984[_0xe6a8('0x3d')]=[{'all':!![]}];}return db[_0xe6a8('0x28')][_0xe6a8('0x3e')](_0x122984);})[_0xe6a8('0x21')](function(_0xb6f46e){_0xd5655d[_0xe6a8('0x3f')]=_0xb6f46e;return _0xd5655d;})[_0xe6a8('0x21')](respondWithFilteredResult(_0x2a21ff,_0x122984))[_0xe6a8('0x40')](handleError(_0x2a21ff,null));};exports[_0xe6a8('0x41')]=function(_0x6209cb,_0x47cdf5){var _0x518e04={'raw':![],'where':{'id':_0x6209cb[_0xe6a8('0x42')]['id']}},_0x38b324={};_0x38b324[_0xe6a8('0x2c')]=_[_0xe6a8('0x43')](db[_0xe6a8('0x28')][_0xe6a8('0x29')]);_0x38b324['query']=_[_0xe6a8('0x43')](_0x6209cb['query']);_0x38b324[_0xe6a8('0x2e')]=_['intersection'](_0x38b324[_0xe6a8('0x2c')],_0x38b324[_0xe6a8('0x2d')]);_0x518e04[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x38b324[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x6209cb['query'][_0xe6a8('0x31')]));_0x518e04[_0xe6a8('0x30')]=_0x518e04[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x518e04[_0xe6a8('0x30')]:_0x38b324[_0xe6a8('0x2c')];if(_0x6209cb[_0xe6a8('0x2d')][_0xe6a8('0x3c')]){_0x518e04[_0xe6a8('0x3d')]=[{'all':!![]}];}_0x518e04=_[_0xe6a8('0x39')]({},_0x518e04,_0x6209cb[_0xe6a8('0x44')]);return db[_0xe6a8('0x28')]['find'](_0x518e04)[_0xe6a8('0x21')](handleEntityNotFound(_0x47cdf5,null))[_0xe6a8('0x21')](respondWithResult(_0x47cdf5,null))['catch'](handleError(_0x47cdf5,null));};exports[_0xe6a8('0x45')]=function(_0x3217b7,_0x30007d){return db[_0xe6a8('0x28')][_0xe6a8('0x45')](_0x3217b7['body'],{})[_0xe6a8('0x21')](respondWithResult(_0x30007d,0xc9))[_0xe6a8('0x40')](handleError(_0x30007d,null));};exports['update']=function(_0x42e8ce,_0x196ce6){if(_0x42e8ce['body']['id']){delete _0x42e8ce[_0xe6a8('0x46')]['id'];}return db[_0xe6a8('0x28')][_0xe6a8('0x47')]({'where':{'id':_0x42e8ce[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x196ce6,null))[_0xe6a8('0x21')](saveUpdates(_0x42e8ce[_0xe6a8('0x46')],null))[_0xe6a8('0x21')](respondWithResult(_0x196ce6,null))['catch'](handleError(_0x196ce6,null));};exports[_0xe6a8('0x22')]=function(_0x3e02f4,_0x2e278f){return db[_0xe6a8('0x28')]['find']({'where':{'id':_0x3e02f4[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x2e278f,null))[_0xe6a8('0x21')](removeEntity(_0x2e278f,null))[_0xe6a8('0x40')](handleError(_0x2e278f,null));};exports['getFields']=function(_0x56d42d,_0x581d14,_0x2b3a62){var _0x5e3fec={};var _0x4fe657={};var _0x302f33;var _0x2b42e7;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0x56d42d['params']['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x581d14,null))['then'](function(_0x501701){if(_0x501701){_0x302f33=_0x501701;_0x4fe657['model']=_[_0xe6a8('0x43')](db[_0xe6a8('0x49')][_0xe6a8('0x29')]);_0x4fe657[_0xe6a8('0x2d')]=_[_0xe6a8('0x43')](_0x56d42d[_0xe6a8('0x2d')]);_0x4fe657[_0xe6a8('0x2e')]=_['intersection'](_0x4fe657['model'],_0x4fe657[_0xe6a8('0x2d')]);_0x5e3fec[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x4fe657[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x5e3fec['attributes']=_0x5e3fec[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x5e3fec['attributes']:_0x4fe657['model'];_0x5e3fec[_0xe6a8('0x4a')]=qs[_0xe6a8('0x35')](_0x56d42d['query'][_0xe6a8('0x35')]);_0x5e3fec[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0x56d42d['query'],_0x4fe657['filters']));if(_0x56d42d['query']['filter']){_0x5e3fec[_0xe6a8('0x36')]=_['merge'](_0x5e3fec[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x5e3fec[_0xe6a8('0x30')],function(_0x20cf41){var _0x295c59={};_0x295c59[_0x20cf41]={'$like':'%'+_0x56d42d['query'][_0xe6a8('0x38')]+'%'};return _0x295c59;})});}_0x5e3fec=_[_0xe6a8('0x39')]({},_0x5e3fec,_0x56d42d[_0xe6a8('0x44')]);return _0x302f33[_0xe6a8('0x4b')](_0x5e3fec);}})[_0xe6a8('0x21')](function(_0x3d82e1){if(_0x3d82e1){_0x2b42e7=_0x3d82e1[_0xe6a8('0x32')];if(!_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x5e3fec[_0xe6a8('0x19')]=qs['limit'](_0x56d42d[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x5e3fec['offset']=qs['offset'](_0x56d42d['query'][_0xe6a8('0x18')]);}return _0x302f33[_0xe6a8('0x4b')](_0x5e3fec);}})[_0xe6a8('0x21')](function(_0xb36401){if(_0xb36401){return _0xb36401?{'count':_0x2b42e7,'rows':_0xb36401}:null;}})[_0xe6a8('0x21')](respondWithResult(_0x581d14,null))['catch'](handleError(_0x581d14,null));};exports['getSubjects']=function(_0xc8caa7,_0x2a2b7d,_0x547fc0){var _0x42c700={};var _0x4342fd={};var _0x6b8025;var _0x4a052c;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0xc8caa7[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x2a2b7d,null))[_0xe6a8('0x21')](function(_0x14d77e){if(_0x14d77e){_0x6b8025=_0x14d77e;_0x4342fd[_0xe6a8('0x2c')]=_[_0xe6a8('0x43')](db[_0xe6a8('0x49')][_0xe6a8('0x29')]);_0x4342fd[_0xe6a8('0x2d')]=_[_0xe6a8('0x43')](_0xc8caa7[_0xe6a8('0x2d')]);_0x4342fd[_0xe6a8('0x2e')]=_['intersection'](_0x4342fd[_0xe6a8('0x2c')],_0x4342fd[_0xe6a8('0x2d')]);_0x42c700['attributes']=_[_0xe6a8('0x2f')](_0x4342fd[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x42c700[_0xe6a8('0x30')]=_0x42c700[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x42c700[_0xe6a8('0x30')]:_0x4342fd[_0xe6a8('0x2c')];_0x42c700['order']=qs[_0xe6a8('0x35')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x42c700[_0xe6a8('0x36')]=qs[_0xe6a8('0x2e')](_[_0xe6a8('0x37')](_0xc8caa7[_0xe6a8('0x2d')],_0x4342fd[_0xe6a8('0x2e')]));if(_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x42c700[_0xe6a8('0x36')]=_[_0xe6a8('0x39')](_0x42c700[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x42c700[_0xe6a8('0x30')],function(_0x1fc933){var _0x46969e={};_0x46969e[_0x1fc933]={'$like':'%'+_0xc8caa7['query'][_0xe6a8('0x38')]+'%'};return _0x46969e;})});}_0x42c700=_['merge']({},_0x42c700,_0xc8caa7['options']);return _0x6b8025['getSubjects'](_0x42c700);}})[_0xe6a8('0x21')](function(_0x2bb6e6){if(_0x2bb6e6){_0x4a052c=_0x2bb6e6['length'];if(!_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x42c700[_0xe6a8('0x19')]=qs[_0xe6a8('0x19')](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x42c700[_0xe6a8('0x18')]=qs['offset'](_0xc8caa7[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}return _0x6b8025[_0xe6a8('0x4c')](_0x42c700);}})[_0xe6a8('0x21')](function(_0x4fc910){if(_0x4fc910){return _0x4fc910?{'count':_0x4a052c,'rows':_0x4fc910}:null;}})[_0xe6a8('0x21')](respondWithResult(_0x2a2b7d,null))[_0xe6a8('0x40')](handleError(_0x2a2b7d,null));};exports[_0xe6a8('0x4d')]=function(_0x2935de,_0x24222b,_0x1d946f){var _0x2f980e={};var _0x2b187d={};var _0x4997d2;var _0x3b19eb;return db[_0xe6a8('0x28')][_0xe6a8('0x48')]({'where':{'id':_0x2935de[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x21')](handleEntityNotFound(_0x24222b,null))[_0xe6a8('0x21')](function(_0x1316f5){if(_0x1316f5){_0x4997d2=_0x1316f5;_0x2b187d[_0xe6a8('0x2c')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x2b187d[_0xe6a8('0x2d')]=_['keys'](_0x2935de[_0xe6a8('0x2d')]);_0x2b187d[_0xe6a8('0x2e')]=_['intersection'](_0x2b187d[_0xe6a8('0x2c')],_0x2b187d[_0xe6a8('0x2d')]);_0x2f980e[_0xe6a8('0x30')]=_[_0xe6a8('0x2f')](_0x2b187d[_0xe6a8('0x2c')],qs[_0xe6a8('0x31')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x31')]));_0x2f980e[_0xe6a8('0x30')]=_0x2f980e[_0xe6a8('0x30')][_0xe6a8('0x32')]?_0x2f980e[_0xe6a8('0x30')]:_0x2b187d[_0xe6a8('0x2c')];_0x2f980e[_0xe6a8('0x4a')]=qs[_0xe6a8('0x35')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x35')]);_0x2f980e['where']=qs[_0xe6a8('0x2e')](_['pick'](_0x2935de[_0xe6a8('0x2d')],_0x2b187d[_0xe6a8('0x2e')]));if(_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x38')]){_0x2f980e[_0xe6a8('0x36')]=_['merge'](_0x2f980e[_0xe6a8('0x36')],{'$or':_[_0xe6a8('0x27')](_0x2f980e['attributes'],function(_0x60436a){var _0x4aab78={};_0x4aab78[_0x60436a]={'$like':'%'+_0x2935de['query'][_0xe6a8('0x38')]+'%'};return _0x4aab78;})});}_0x2f980e=_[_0xe6a8('0x39')]({},_0x2f980e,_0x2935de[_0xe6a8('0x44')]);return _0x4997d2[_0xe6a8('0x4d')](_0x2f980e);}})[_0xe6a8('0x21')](function(_0x3a8964){if(_0x3a8964){_0x3b19eb=_0x3a8964['length'];if(!_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x33')]('nolimit')){_0x2f980e['limit']=qs['limit'](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x19')]);_0x2f980e['offset']=qs[_0xe6a8('0x18')](_0x2935de[_0xe6a8('0x2d')][_0xe6a8('0x18')]);}return _0x4997d2[_0xe6a8('0x4d')](_0x2f980e);}})[_0xe6a8('0x21')](function(_0x38c63f){if(_0x38c63f){return _0x38c63f?{'count':_0x3b19eb,'rows':_0x38c63f}:null;}})['then'](respondWithResult(_0x24222b,null))[_0xe6a8('0x40')](handleError(_0x24222b,null));}; \ No newline at end of file +var _0x48a5=['reject','save','update','destroy','then','error','stack','name','send','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','params','keys','create','body','catch','find','findOne','SalesforceField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x48a5,0x7b));var _0x548a=function(_0x579ccc,_0x487692){_0x579ccc=_0x579ccc-0x0;var _0x1895a3=_0x48a5[_0x579ccc];return _0x1895a3;};'use strict';var emlformat=require(_0x548a('0x0'));var rimraf=require(_0x548a('0x1'));var zipdir=require(_0x548a('0x2'));var jsonpatch=require(_0x548a('0x3'));var rp=require('request-promise');var moment=require(_0x548a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x548a('0x5'));var util=require(_0x548a('0x6'));var path=require(_0x548a('0x7'));var sox=require(_0x548a('0x8'));var csv=require(_0x548a('0x9'));var ejs=require(_0x548a('0xa'));var fs=require('fs');var fs_extra=require(_0x548a('0xb'));var _=require(_0x548a('0xc'));var squel=require(_0x548a('0xd'));var crypto=require(_0x548a('0xe'));var jsforce=require(_0x548a('0xf'));var deskjs=require(_0x548a('0x10'));var toCsv=require(_0x548a('0x9'));var querystring=require(_0x548a('0x11'));var Papa=require(_0x548a('0x12'));var Redis=require(_0x548a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x548a('0x14'));var logger=require(_0x548a('0x15'))('api');var utils=require(_0x548a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x548a('0x17'))['db'];function respondWithStatusCode(_0x212562,_0x2bff55){_0x2bff55=_0x2bff55||0xcc;return function(_0x371111){if(_0x371111){return _0x212562[_0x548a('0x18')](_0x2bff55);}return _0x212562[_0x548a('0x19')](_0x2bff55)[_0x548a('0x1a')]();};}function respondWithResult(_0x2e04da,_0x170d7a){_0x170d7a=_0x170d7a||0xc8;return function(_0x2834be){if(_0x2834be){return _0x2e04da[_0x548a('0x19')](_0x170d7a)[_0x548a('0x1b')](_0x2834be);}};}function respondWithFilteredResult(_0xa59278,_0x30979d){return function(_0xc34da4){if(_0xc34da4){var _0x588195=typeof _0x30979d[_0x548a('0x1c')]===_0x548a('0x1d')&&typeof _0x30979d[_0x548a('0x1e')]===_0x548a('0x1d');var _0x47cbe2=_0xc34da4['count'];var _0x23439e=_0x588195?0x0:_0x30979d[_0x548a('0x1c')];var _0x3d133c=_0x588195?_0xc34da4[_0x548a('0x1f')]:_0x30979d[_0x548a('0x1c')]+_0x30979d['limit'];var _0x5943b4;if(_0x3d133c>=_0x47cbe2){_0x3d133c=_0x47cbe2;_0x5943b4=0xc8;}else{_0x5943b4=0xce;}_0xa59278[_0x548a('0x19')](_0x5943b4);return _0xa59278[_0x548a('0x20')](_0x548a('0x21'),_0x23439e+'-'+_0x3d133c+'/'+_0x47cbe2)[_0x548a('0x1b')](_0xc34da4);}return null;};}function patchUpdates(_0x458870){return function(_0x2af54a){try{jsonpatch[_0x548a('0x22')](_0x2af54a,_0x458870,!![]);}catch(_0x5602c1){return BPromise[_0x548a('0x23')](_0x5602c1);}return _0x2af54a[_0x548a('0x24')]();};}function saveUpdates(_0x4f6b28,_0x37c2ca){return function(_0x11d25a){if(_0x11d25a){return _0x11d25a[_0x548a('0x25')](_0x4f6b28)['then'](function(_0x195a0e){return _0x195a0e;});}return null;};}function removeEntity(_0x1ba0b4,_0x2cbf2d){return function(_0x450bcb){if(_0x450bcb){return _0x450bcb[_0x548a('0x26')]()[_0x548a('0x27')](function(){_0x1ba0b4[_0x548a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583118,_0x44c609){return function(_0x589045){if(!_0x589045){_0x583118['sendStatus'](0x194);}return _0x589045;};}function handleError(_0x250cd5,_0x2b30a4){_0x2b30a4=_0x2b30a4||0x1f4;return function(_0x18b28f){logger[_0x548a('0x28')](_0x18b28f[_0x548a('0x29')]);if(_0x18b28f['name']){delete _0x18b28f[_0x548a('0x2a')];}_0x250cd5['status'](_0x2b30a4)[_0x548a('0x2b')](_0x18b28f);};}exports['index']=function(_0xfe6a17,_0x1e9f26){var _0x2d8bf7={},_0x317a6d={},_0x1e7ce1={'count':0x0,'rows':[]};var _0x156cfc=_['map'](db['SalesforceConfiguration'][_0x548a('0x2c')],function(_0x4822a5){return{'name':_0x4822a5['fieldName'],'type':_0x4822a5[_0x548a('0x2d')][_0x548a('0x2e')]};});_0x317a6d[_0x548a('0x2f')]=_[_0x548a('0x30')](_0x156cfc,_0x548a('0x2a'));_0x317a6d[_0x548a('0x31')]=_['keys'](_0xfe6a17['query']);_0x317a6d['filters']=_[_0x548a('0x32')](_0x317a6d[_0x548a('0x2f')],_0x317a6d['query']);_0x2d8bf7[_0x548a('0x33')]=_[_0x548a('0x32')](_0x317a6d['model'],qs[_0x548a('0x34')](_0xfe6a17[_0x548a('0x31')][_0x548a('0x34')]));_0x2d8bf7['attributes']=_0x2d8bf7[_0x548a('0x33')][_0x548a('0x35')]?_0x2d8bf7[_0x548a('0x33')]:_0x317a6d[_0x548a('0x2f')];if(!_0xfe6a17[_0x548a('0x31')][_0x548a('0x36')](_0x548a('0x37'))){_0x2d8bf7[_0x548a('0x1e')]=qs['limit'](_0xfe6a17[_0x548a('0x31')]['limit']);_0x2d8bf7[_0x548a('0x1c')]=qs[_0x548a('0x1c')](_0xfe6a17[_0x548a('0x31')][_0x548a('0x1c')]);}_0x2d8bf7[_0x548a('0x38')]=qs[_0x548a('0x39')](_0xfe6a17['query'][_0x548a('0x39')]);_0x2d8bf7[_0x548a('0x3a')]=qs[_0x548a('0x3b')](_[_0x548a('0x3c')](_0xfe6a17[_0x548a('0x31')],_0x317a6d[_0x548a('0x3b')]),_0x156cfc);if(_0xfe6a17[_0x548a('0x31')][_0x548a('0x3d')]){_0x2d8bf7['where']=_[_0x548a('0x3e')](_0x2d8bf7[_0x548a('0x3a')],{'$or':_[_0x548a('0x30')](_0x156cfc,function(_0x18f357){if(_0x18f357[_0x548a('0x2d')]!==_0x548a('0x3f')){var _0x52575a={};_0x52575a[_0x18f357[_0x548a('0x2a')]]={'$like':'%'+_0xfe6a17[_0x548a('0x31')][_0x548a('0x3d')]+'%'};return _0x52575a;}})});}_0x2d8bf7=_[_0x548a('0x3e')]({},_0x2d8bf7,_0xfe6a17[_0x548a('0x40')]);var _0x383111={'where':_0x2d8bf7['where']};return db[_0x548a('0x41')][_0x548a('0x1f')](_0x383111)[_0x548a('0x27')](function(_0x528948){_0x1e7ce1[_0x548a('0x1f')]=_0x528948;if(_0xfe6a17[_0x548a('0x31')][_0x548a('0x42')]){_0x2d8bf7[_0x548a('0x43')]=[{'all':!![]}];}return db[_0x548a('0x41')]['findAll'](_0x2d8bf7);})[_0x548a('0x27')](function(_0x432b43){_0x1e7ce1['rows']=_0x432b43;return _0x1e7ce1;})[_0x548a('0x27')](respondWithFilteredResult(_0x1e9f26,_0x2d8bf7))['catch'](handleError(_0x1e9f26,null));};exports['show']=function(_0x8827d1,_0x51dfbf){var _0x3db77e={'raw':![],'where':{'id':_0x8827d1[_0x548a('0x44')]['id']}},_0x596f08={};_0x596f08['model']=_[_0x548a('0x45')](db[_0x548a('0x41')]['rawAttributes']);_0x596f08[_0x548a('0x31')]=_['keys'](_0x8827d1[_0x548a('0x31')]);_0x596f08[_0x548a('0x3b')]=_[_0x548a('0x32')](_0x596f08['model'],_0x596f08[_0x548a('0x31')]);_0x3db77e['attributes']=_[_0x548a('0x32')](_0x596f08[_0x548a('0x2f')],qs['fields'](_0x8827d1['query'][_0x548a('0x34')]));_0x3db77e[_0x548a('0x33')]=_0x3db77e[_0x548a('0x33')][_0x548a('0x35')]?_0x3db77e[_0x548a('0x33')]:_0x596f08['model'];if(_0x8827d1[_0x548a('0x31')]['includeAll']){_0x3db77e[_0x548a('0x43')]=[{'all':!![]}];}_0x3db77e=_[_0x548a('0x3e')]({},_0x3db77e,_0x8827d1[_0x548a('0x40')]);return db[_0x548a('0x41')]['find'](_0x3db77e)[_0x548a('0x27')](handleEntityNotFound(_0x51dfbf,null))[_0x548a('0x27')](respondWithResult(_0x51dfbf,null))['catch'](handleError(_0x51dfbf,null));};exports[_0x548a('0x46')]=function(_0x5bdc5c,_0x4dbdfd){return db['SalesforceConfiguration'][_0x548a('0x46')](_0x5bdc5c[_0x548a('0x47')],{})[_0x548a('0x27')](respondWithResult(_0x4dbdfd,0xc9))[_0x548a('0x48')](handleError(_0x4dbdfd,null));};exports[_0x548a('0x25')]=function(_0xf01af9,_0xc21df5){if(_0xf01af9[_0x548a('0x47')]['id']){delete _0xf01af9['body']['id'];}return db[_0x548a('0x41')][_0x548a('0x49')]({'where':{'id':_0xf01af9[_0x548a('0x44')]['id']}})['then'](handleEntityNotFound(_0xc21df5,null))[_0x548a('0x27')](saveUpdates(_0xf01af9['body'],null))[_0x548a('0x27')](respondWithResult(_0xc21df5,null))[_0x548a('0x48')](handleError(_0xc21df5,null));};exports[_0x548a('0x26')]=function(_0x2d5a0a,_0x54c5cb){return db['SalesforceConfiguration'][_0x548a('0x49')]({'where':{'id':_0x2d5a0a[_0x548a('0x44')]['id']}})[_0x548a('0x27')](handleEntityNotFound(_0x54c5cb,null))['then'](removeEntity(_0x54c5cb,null))[_0x548a('0x48')](handleError(_0x54c5cb,null));};exports['getFields']=function(_0x7cc5aa,_0x2fd3ea,_0x9c5a33){var _0x38c2e7={};var _0x2ab042={};var _0x25063f;var _0x175767;return db[_0x548a('0x41')][_0x548a('0x4a')]({'where':{'id':_0x7cc5aa[_0x548a('0x44')]['id']}})[_0x548a('0x27')](handleEntityNotFound(_0x2fd3ea,null))[_0x548a('0x27')](function(_0x55c34d){if(_0x55c34d){_0x25063f=_0x55c34d;_0x2ab042[_0x548a('0x2f')]=_[_0x548a('0x45')](db[_0x548a('0x4b')][_0x548a('0x2c')]);_0x2ab042[_0x548a('0x31')]=_[_0x548a('0x45')](_0x7cc5aa[_0x548a('0x31')]);_0x2ab042[_0x548a('0x3b')]=_[_0x548a('0x32')](_0x2ab042['model'],_0x2ab042[_0x548a('0x31')]);_0x38c2e7['attributes']=_['intersection'](_0x2ab042[_0x548a('0x2f')],qs[_0x548a('0x34')](_0x7cc5aa['query'][_0x548a('0x34')]));_0x38c2e7[_0x548a('0x33')]=_0x38c2e7[_0x548a('0x33')]['length']?_0x38c2e7['attributes']:_0x2ab042[_0x548a('0x2f')];_0x38c2e7['order']=qs[_0x548a('0x39')](_0x7cc5aa[_0x548a('0x31')][_0x548a('0x39')]);_0x38c2e7[_0x548a('0x3a')]=qs[_0x548a('0x3b')](_[_0x548a('0x3c')](_0x7cc5aa[_0x548a('0x31')],_0x2ab042[_0x548a('0x3b')]));if(_0x7cc5aa[_0x548a('0x31')][_0x548a('0x3d')]){_0x38c2e7[_0x548a('0x3a')]=_[_0x548a('0x3e')](_0x38c2e7[_0x548a('0x3a')],{'$or':_[_0x548a('0x30')](_0x38c2e7[_0x548a('0x33')],function(_0x2b961c){var _0x5c1bd3={};_0x5c1bd3[_0x2b961c]={'$like':'%'+_0x7cc5aa[_0x548a('0x31')][_0x548a('0x3d')]+'%'};return _0x5c1bd3;})});}_0x38c2e7=_[_0x548a('0x3e')]({},_0x38c2e7,_0x7cc5aa[_0x548a('0x40')]);return _0x25063f['getFields'](_0x38c2e7);}})[_0x548a('0x27')](function(_0x205810){if(_0x205810){_0x175767=_0x205810[_0x548a('0x35')];if(!_0x7cc5aa[_0x548a('0x31')][_0x548a('0x36')](_0x548a('0x37'))){_0x38c2e7[_0x548a('0x1e')]=qs[_0x548a('0x1e')](_0x7cc5aa['query'][_0x548a('0x1e')]);_0x38c2e7[_0x548a('0x1c')]=qs[_0x548a('0x1c')](_0x7cc5aa[_0x548a('0x31')]['offset']);}return _0x25063f[_0x548a('0x4c')](_0x38c2e7);}})[_0x548a('0x27')](function(_0x4ec1e4){if(_0x4ec1e4){return _0x4ec1e4?{'count':_0x175767,'rows':_0x4ec1e4}:null;}})[_0x548a('0x27')](respondWithResult(_0x2fd3ea,null))['catch'](handleError(_0x2fd3ea,null));};exports['getSubjects']=function(_0xb951b7,_0x382d75,_0x303560){var _0x449469={};var _0x244c7b={};var _0x4a5a8e;var _0x7d7d1f;return db[_0x548a('0x41')][_0x548a('0x4a')]({'where':{'id':_0xb951b7[_0x548a('0x44')]['id']}})['then'](handleEntityNotFound(_0x382d75,null))[_0x548a('0x27')](function(_0x49a2e1){if(_0x49a2e1){_0x4a5a8e=_0x49a2e1;_0x244c7b[_0x548a('0x2f')]=_[_0x548a('0x45')](db[_0x548a('0x4b')]['rawAttributes']);_0x244c7b[_0x548a('0x31')]=_[_0x548a('0x45')](_0xb951b7[_0x548a('0x31')]);_0x244c7b[_0x548a('0x3b')]=_['intersection'](_0x244c7b['model'],_0x244c7b['query']);_0x449469['attributes']=_[_0x548a('0x32')](_0x244c7b[_0x548a('0x2f')],qs[_0x548a('0x34')](_0xb951b7['query'][_0x548a('0x34')]));_0x449469[_0x548a('0x33')]=_0x449469[_0x548a('0x33')]['length']?_0x449469[_0x548a('0x33')]:_0x244c7b[_0x548a('0x2f')];_0x449469[_0x548a('0x38')]=qs[_0x548a('0x39')](_0xb951b7[_0x548a('0x31')][_0x548a('0x39')]);_0x449469['where']=qs[_0x548a('0x3b')](_[_0x548a('0x3c')](_0xb951b7['query'],_0x244c7b[_0x548a('0x3b')]));if(_0xb951b7[_0x548a('0x31')]['filter']){_0x449469[_0x548a('0x3a')]=_[_0x548a('0x3e')](_0x449469[_0x548a('0x3a')],{'$or':_[_0x548a('0x30')](_0x449469[_0x548a('0x33')],function(_0x37b1e2){var _0x5acfb8={};_0x5acfb8[_0x37b1e2]={'$like':'%'+_0xb951b7[_0x548a('0x31')]['filter']+'%'};return _0x5acfb8;})});}_0x449469=_[_0x548a('0x3e')]({},_0x449469,_0xb951b7[_0x548a('0x40')]);return _0x4a5a8e['getSubjects'](_0x449469);}})['then'](function(_0x39f856){if(_0x39f856){_0x7d7d1f=_0x39f856[_0x548a('0x35')];if(!_0xb951b7['query'][_0x548a('0x36')](_0x548a('0x37'))){_0x449469[_0x548a('0x1e')]=qs['limit'](_0xb951b7['query'][_0x548a('0x1e')]);_0x449469[_0x548a('0x1c')]=qs[_0x548a('0x1c')](_0xb951b7[_0x548a('0x31')][_0x548a('0x1c')]);}return _0x4a5a8e[_0x548a('0x4d')](_0x449469);}})[_0x548a('0x27')](function(_0x5e9188){if(_0x5e9188){return _0x5e9188?{'count':_0x7d7d1f,'rows':_0x5e9188}:null;}})['then'](respondWithResult(_0x382d75,null))[_0x548a('0x48')](handleError(_0x382d75,null));};exports[_0x548a('0x4e')]=function(_0x2f1cec,_0x196771,_0x25cfd8){var _0x2010cc={};var _0x1fc223={};var _0x4e8b3;var _0x46a45e;return db['SalesforceConfiguration'][_0x548a('0x4a')]({'where':{'id':_0x2f1cec[_0x548a('0x44')]['id']}})[_0x548a('0x27')](handleEntityNotFound(_0x196771,null))['then'](function(_0x4cb380){if(_0x4cb380){_0x4e8b3=_0x4cb380;_0x1fc223['model']=_[_0x548a('0x45')](db[_0x548a('0x4b')]['rawAttributes']);_0x1fc223[_0x548a('0x31')]=_[_0x548a('0x45')](_0x2f1cec[_0x548a('0x31')]);_0x1fc223[_0x548a('0x3b')]=_[_0x548a('0x32')](_0x1fc223[_0x548a('0x2f')],_0x1fc223['query']);_0x2010cc['attributes']=_[_0x548a('0x32')](_0x1fc223['model'],qs['fields'](_0x2f1cec[_0x548a('0x31')][_0x548a('0x34')]));_0x2010cc['attributes']=_0x2010cc[_0x548a('0x33')][_0x548a('0x35')]?_0x2010cc[_0x548a('0x33')]:_0x1fc223['model'];_0x2010cc[_0x548a('0x38')]=qs['sort'](_0x2f1cec[_0x548a('0x31')][_0x548a('0x39')]);_0x2010cc[_0x548a('0x3a')]=qs[_0x548a('0x3b')](_[_0x548a('0x3c')](_0x2f1cec['query'],_0x1fc223[_0x548a('0x3b')]));if(_0x2f1cec[_0x548a('0x31')][_0x548a('0x3d')]){_0x2010cc[_0x548a('0x3a')]=_[_0x548a('0x3e')](_0x2010cc[_0x548a('0x3a')],{'$or':_['map'](_0x2010cc[_0x548a('0x33')],function(_0x3d528a){var _0x2ef4e7={};_0x2ef4e7[_0x3d528a]={'$like':'%'+_0x2f1cec['query']['filter']+'%'};return _0x2ef4e7;})});}_0x2010cc=_[_0x548a('0x3e')]({},_0x2010cc,_0x2f1cec[_0x548a('0x40')]);return _0x4e8b3['getDescriptions'](_0x2010cc);}})[_0x548a('0x27')](function(_0x204806){if(_0x204806){_0x46a45e=_0x204806['length'];if(!_0x2f1cec[_0x548a('0x31')][_0x548a('0x36')](_0x548a('0x37'))){_0x2010cc['limit']=qs[_0x548a('0x1e')](_0x2f1cec[_0x548a('0x31')][_0x548a('0x1e')]);_0x2010cc[_0x548a('0x1c')]=qs[_0x548a('0x1c')](_0x2f1cec[_0x548a('0x31')][_0x548a('0x1c')]);}return _0x4e8b3[_0x548a('0x4e')](_0x2010cc);}})[_0x548a('0x27')](function(_0xfccae1){if(_0xfccae1){return _0xfccae1?{'count':_0x46a45e,'rows':_0xfccae1}:null;}})[_0x548a('0x27')](respondWithResult(_0x196771,null))[_0x548a('0x48')](handleError(_0x196771,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 5977dc4..8e40711 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 _0xa0e0=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0xa0e0,0xad));var _0x0a0e=function(_0x5e604c,_0x308935){_0x5e604c=_0x5e604c-0x0;var _0x5c9e6b=_0xa0e0[_0x5e604c];return _0x5c9e6b;};'use strict';var _=require(_0x0a0e('0x0'));var util=require('util');var logger=require(_0x0a0e('0x1'))(_0x0a0e('0x2'));var moment=require(_0x0a0e('0x3'));var BPromise=require(_0x0a0e('0x4'));var rp=require(_0x0a0e('0x5'));var fs=require('fs');var path=require(_0x0a0e('0x6'));var rimraf=require(_0x0a0e('0x7'));var config=require(_0x0a0e('0x8'));var attributes=require(_0x0a0e('0x9'));module[_0x0a0e('0xa')]=function(_0x71a772,_0x59b1b3){return _0x71a772[_0x0a0e('0xb')](_0x0a0e('0xc'),attributes,{'tableName':_0x0a0e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeae3=['api','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceConfiguration','lodash'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xeae3,0x19d));var _0x3eae=function(_0x12c7e3,_0x417a84){_0x12c7e3=_0x12c7e3-0x0;var _0x348f08=_0xeae3[_0x12c7e3];return _0x348f08;};'use strict';var _=require(_0x3eae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3eae('0x1'));var moment=require('moment');var BPromise=require(_0x3eae('0x2'));var rp=require(_0x3eae('0x3'));var fs=require('fs');var path=require(_0x3eae('0x4'));var rimraf=require('rimraf');var config=require(_0x3eae('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x3eae('0x6')]=function(_0x9eba6d,_0x9d45bc){return _0x9eba6d[_0x3eae('0x7')](_0x3eae('0x8'),attributes,{'tableName':'int_salesforce_configurations','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 cc3751c..c3d1e1f 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 _0xb699=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1ec734,_0x5a0993){var _0x504326=function(_0x51c73f){while(--_0x51c73f){_0x1ec734['push'](_0x1ec734['shift']());}};_0x504326(++_0x5a0993);}(_0xb699,0x17d));var _0x9b69=function(_0x252818,_0x36274d){_0x252818=_0x252818-0x0;var _0x22fdfe=_0xb699[_0x252818];return _0x22fdfe;};'use strict';var _=require(_0x9b69('0x0'));var util=require(_0x9b69('0x1'));var moment=require(_0x9b69('0x2'));var BPromise=require(_0x9b69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b69('0x4'));var db=require(_0x9b69('0x5'))['db'];var utils=require(_0x9b69('0x6'));var logger=require(_0x9b69('0x7'))('rpc');var config=require(_0x9b69('0x8'));var jayson=require(_0x9b69('0x9'));var client=jayson[_0x9b69('0xa')][_0x9b69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e0087,_0x4758d0,_0x544ac8){return new BPromise(function(_0x419a4b,_0xb96c57){return client[_0x9b69('0xc')](_0x4e0087,_0x544ac8)[_0x9b69('0xd')](function(_0x466995){logger[_0x9b69('0xe')](_0x9b69('0xf'),_0x4758d0,_0x9b69('0x10'));logger[_0x9b69('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4758d0,_0x9b69('0x10'),JSON[_0x9b69('0x12')](_0x466995));if(_0x466995[_0x9b69('0x13')]){if(_0x466995[_0x9b69('0x13')]['code']===0x1f4){logger['error'](_0x9b69('0xf'),_0x4758d0,_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);return _0xb96c57(_0x466995['error']['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4758d0,_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);return _0x419a4b(_0x466995[_0x9b69('0x13')][_0x9b69('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4758d0,'request\x20sent');_0x419a4b(_0x466995['result'][_0x9b69('0x14')]);}})[_0x9b69('0x15')](function(_0x53fd0a){logger[_0x9b69('0x13')](_0x9b69('0xf'),_0x4758d0,_0x53fd0a);_0xb96c57(_0x53fd0a);});});} \ No newline at end of file +var _0xe6d8=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring'];(function(_0xd0c32f,_0x5139a1){var _0x31a56a=function(_0x18af7d){while(--_0x18af7d){_0xd0c32f['push'](_0xd0c32f['shift']());}};_0x31a56a(++_0x5139a1);}(_0xe6d8,0x17b));var _0x8e6d=function(_0x1ee396,_0x374bec){_0x1ee396=_0x1ee396-0x0;var _0x1d6466=_0xe6d8[_0x1ee396];return _0x1d6466;};'use strict';var _=require(_0x8e6d('0x0'));var util=require(_0x8e6d('0x1'));var moment=require(_0x8e6d('0x2'));var BPromise=require(_0x8e6d('0x3'));var rs=require(_0x8e6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e6d('0x5'))['db'];var utils=require(_0x8e6d('0x6'));var logger=require('../../config/logger')(_0x8e6d('0x7'));var config=require(_0x8e6d('0x8'));var jayson=require(_0x8e6d('0x9'));var client=jayson[_0x8e6d('0xa')][_0x8e6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x323e36,_0x111de5,_0x575526){return new BPromise(function(_0x17304,_0x1aef95){return client[_0x8e6d('0xc')](_0x323e36,_0x575526)[_0x8e6d('0xd')](function(_0x234682){logger[_0x8e6d('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x111de5,'request\x20sent');logger[_0x8e6d('0xf')](_0x8e6d('0x10'),_0x111de5,_0x8e6d('0x11'),JSON[_0x8e6d('0x12')](_0x234682));if(_0x234682['error']){if(_0x234682[_0x8e6d('0x13')][_0x8e6d('0x14')]===0x1f4){logger[_0x8e6d('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x111de5,_0x234682[_0x8e6d('0x13')][_0x8e6d('0x15')]);return _0x1aef95(_0x234682[_0x8e6d('0x13')][_0x8e6d('0x15')]);}logger[_0x8e6d('0x13')](_0x8e6d('0x16'),_0x111de5,_0x234682[_0x8e6d('0x13')][_0x8e6d('0x15')]);return _0x17304(_0x234682[_0x8e6d('0x13')]['message']);}else{logger[_0x8e6d('0xe')](_0x8e6d('0x16'),_0x111de5,_0x8e6d('0x11'));_0x17304(_0x234682[_0x8e6d('0x17')][_0x8e6d('0x15')]);}})['catch'](function(_0x2885c7){logger[_0x8e6d('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x111de5,_0x2885c7);_0x1aef95(_0x2885c7);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e68fed2..f381e71 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 _0x85f4=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c26c4,_0x4ab76e){var _0x57bfd5=function(_0x57ff70){while(--_0x57ff70){_0x3c26c4['push'](_0x3c26c4['shift']());}};_0x57bfd5(++_0x4ab76e);}(_0x85f4,0x83));var _0x485f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x85f4[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x485f('0x0'));var util=require(_0x485f('0x1'));var path=require(_0x485f('0x2'));var timeout=require('connect-timeout');var express=require(_0x485f('0x3'));var router=express[_0x485f('0x4')]();var fs_extra=require(_0x485f('0x5'));var auth=require(_0x485f('0x6'));var interaction=require(_0x485f('0x7'));var config=require(_0x485f('0x8'));var controller=require(_0x485f('0x9'));router[_0x485f('0xa')]('/',auth[_0x485f('0xb')](),controller[_0x485f('0xc')]);router[_0x485f('0xa')](_0x485f('0xd'),auth[_0x485f('0xb')](),controller[_0x485f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x485f('0xf')]);router[_0x485f('0x10')](_0x485f('0xd'),auth[_0x485f('0xb')](),controller[_0x485f('0x11')]);router[_0x485f('0x12')](_0x485f('0xd'),auth['isAuthenticated'](),controller[_0x485f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x18d9=['show','post','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x18d9,0x1bc));var _0x918d=function(_0x81ecb8,_0x59bed5){_0x81ecb8=_0x81ecb8-0x0;var _0x4f3c7d=_0x18d9[_0x81ecb8];return _0x4f3c7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x918d('0x0'));var timeout=require('connect-timeout');var express=require(_0x918d('0x1'));var router=express[_0x918d('0x2')]();var fs_extra=require(_0x918d('0x3'));var auth=require(_0x918d('0x4'));var interaction=require(_0x918d('0x5'));var config=require(_0x918d('0x6'));var controller=require(_0x918d('0x7'));router['get']('/',auth[_0x918d('0x8')](),controller[_0x918d('0x9')]);router[_0x918d('0xa')](_0x918d('0xb'),auth['isAuthenticated'](),controller[_0x918d('0xc')]);router[_0x918d('0xd')]('/',auth[_0x918d('0x8')](),controller[_0x918d('0xe')]);router[_0x918d('0xf')](_0x918d('0xb'),auth['isAuthenticated'](),controller[_0x918d('0x10')]);router[_0x918d('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x918d('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 2955f9c..264ae1f 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 _0xaa21=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x16fab5,_0x3203cd){var _0x1746ba=function(_0x5638fc){while(--_0x5638fc){_0x16fab5['push'](_0x16fab5['shift']());}};_0x1746ba(++_0x3203cd);}(_0xaa21,0x153));var _0x1aa2=function(_0x2ff3ac,_0x2c2417){_0x2ff3ac=_0x2ff3ac-0x0;var _0x2c8ef1=_0xaa21[_0x2ff3ac];return _0x2c8ef1;};'use strict';var Sequelize=require(_0x1aa2('0x0'));module[_0x1aa2('0x1')]={'type':{'type':Sequelize[_0x1aa2('0x2')]('string',_0x1aa2('0x3'),_0x1aa2('0x4'),_0x1aa2('0x5'),_0x1aa2('0x6')),'defaultValue':_0x1aa2('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1aa2('0x8')]},'keyType':{'type':Sequelize[_0x1aa2('0x2')](_0x1aa2('0x7'),'variable',_0x1aa2('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1aa2('0x8')]}}; \ No newline at end of file +var _0x7d1e=['ENUM','variable','keyValue','picklist','string','STRING','customVariable','sequelize'];(function(_0x4a370f,_0x5da124){var _0x23de07=function(_0xd28536){while(--_0xd28536){_0x4a370f['push'](_0x4a370f['shift']());}};_0x23de07(++_0x5da124);}(_0x7d1e,0x1d7));var _0xe7d1=function(_0x13357f,_0x210dc8){_0x13357f=_0x13357f-0x0;var _0x1fbbf1=_0x7d1e[_0x13357f];return _0x1fbbf1;};'use strict';var Sequelize=require(_0xe7d1('0x0'));module['exports']={'type':{'type':Sequelize[_0xe7d1('0x1')]('string',_0xe7d1('0x2'),'customVariable',_0xe7d1('0x3'),_0xe7d1('0x4')),'defaultValue':_0xe7d1('0x5')},'content':{'type':Sequelize[_0xe7d1('0x6')]},'key':{'type':Sequelize[_0xe7d1('0x6')]},'keyType':{'type':Sequelize[_0xe7d1('0x1')](_0xe7d1('0x5'),_0xe7d1('0x2'),_0xe7d1('0x7'))},'keyContent':{'type':Sequelize[_0xe7d1('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a1467a2..4d502d4 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 _0x875e=['error','name','send','index','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','destroy','then'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0x875e,0x72));var _0xe875=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x875e[_0x3ae96c];return _0x1b0c90;};'use strict';var emlformat=require(_0xe875('0x0'));var rimraf=require(_0xe875('0x1'));var zipdir=require(_0xe875('0x2'));var jsonpatch=require(_0xe875('0x3'));var rp=require(_0xe875('0x4'));var moment=require(_0xe875('0x5'));var BPromise=require(_0xe875('0x6'));var Mustache=require(_0xe875('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe875('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe875('0x9'));var _=require(_0xe875('0xa'));var squel=require(_0xe875('0xb'));var crypto=require('crypto');var jsforce=require(_0xe875('0xc'));var deskjs=require(_0xe875('0xd'));var toCsv=require(_0xe875('0xe'));var querystring=require(_0xe875('0xf'));var Papa=require(_0xe875('0x10'));var Redis=require(_0xe875('0x11'));var authService=require(_0xe875('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe875('0x13'));var hardwareService=require(_0xe875('0x14'));var logger=require(_0xe875('0x15'))(_0xe875('0x16'));var utils=require('../../config/utils');var config=require(_0xe875('0x17'));var licenseUtil=require(_0xe875('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7b10,_0x108440){_0x108440=_0x108440||0xcc;return function(_0x4d3d30){if(_0x4d3d30){return _0x5a7b10[_0xe875('0x19')](_0x108440);}return _0x5a7b10[_0xe875('0x1a')](_0x108440)[_0xe875('0x1b')]();};}function respondWithResult(_0x100417,_0x4c898d){_0x4c898d=_0x4c898d||0xc8;return function(_0xf11f3e){if(_0xf11f3e){return _0x100417[_0xe875('0x1a')](_0x4c898d)[_0xe875('0x1c')](_0xf11f3e);}};}function respondWithFilteredResult(_0x4f1cbd,_0x45a09c){return function(_0x9e7a29){if(_0x9e7a29){var _0x552dc5=typeof _0x45a09c['offset']==='undefined'&&typeof _0x45a09c[_0xe875('0x1d')]===_0xe875('0x1e');var _0x4b010b=_0x9e7a29[_0xe875('0x1f')];var _0x11983b=_0x552dc5?0x0:_0x45a09c[_0xe875('0x20')];var _0x28fcd8=_0x552dc5?_0x9e7a29[_0xe875('0x1f')]:_0x45a09c[_0xe875('0x20')]+_0x45a09c[_0xe875('0x1d')];var _0x33f3e2;if(_0x28fcd8>=_0x4b010b){_0x28fcd8=_0x4b010b;_0x33f3e2=0xc8;}else{_0x33f3e2=0xce;}_0x4f1cbd['status'](_0x33f3e2);return _0x4f1cbd[_0xe875('0x21')](_0xe875('0x22'),_0x11983b+'-'+_0x28fcd8+'/'+_0x4b010b)[_0xe875('0x1c')](_0x9e7a29);}return null;};}function patchUpdates(_0x7f5625){return function(_0x3ec67a){try{jsonpatch['apply'](_0x3ec67a,_0x7f5625,!![]);}catch(_0x3461af){return BPromise['reject'](_0x3461af);}return _0x3ec67a[_0xe875('0x23')]();};}function saveUpdates(_0x1ba608,_0x20f494){return function(_0x59b0d5){if(_0x59b0d5){return _0x59b0d5['update'](_0x1ba608)['then'](function(_0x41f036){return _0x41f036;});}return null;};}function removeEntity(_0x30c360,_0x474091){return function(_0xd59c27){if(_0xd59c27){return _0xd59c27[_0xe875('0x24')]()[_0xe875('0x25')](function(){_0x30c360[_0xe875('0x1a')](0xcc)[_0xe875('0x1b')]();});}};}function handleEntityNotFound(_0x5dcbbf,_0x3bf5a7){return function(_0x432328){if(!_0x432328){_0x5dcbbf[_0xe875('0x19')](0x194);}return _0x432328;};}function handleError(_0x3b6f3f,_0x3c4bc5){_0x3c4bc5=_0x3c4bc5||0x1f4;return function(_0x2195df){logger[_0xe875('0x26')](_0x2195df['stack']);if(_0x2195df[_0xe875('0x27')]){delete _0x2195df[_0xe875('0x27')];}_0x3b6f3f[_0xe875('0x1a')](_0x3c4bc5)[_0xe875('0x28')](_0x2195df);};}exports[_0xe875('0x29')]=function(_0x83b741,_0x33d36f){var _0x15a917={},_0x53e561={},_0x40a4ee={'count':0x0,'rows':[]};var _0x243631=_[_0xe875('0x2a')](db[_0xe875('0x2b')]['rawAttributes'],function(_0x1e3457){return{'name':_0x1e3457[_0xe875('0x2c')],'type':_0x1e3457[_0xe875('0x2d')][_0xe875('0x2e')]};});_0x53e561[_0xe875('0x2f')]=_[_0xe875('0x2a')](_0x243631,_0xe875('0x27'));_0x53e561[_0xe875('0x30')]=_[_0xe875('0x31')](_0x83b741[_0xe875('0x30')]);_0x53e561[_0xe875('0x32')]=_[_0xe875('0x33')](_0x53e561['model'],_0x53e561['query']);_0x15a917[_0xe875('0x34')]=_[_0xe875('0x33')](_0x53e561[_0xe875('0x2f')],qs[_0xe875('0x35')](_0x83b741[_0xe875('0x30')][_0xe875('0x35')]));_0x15a917[_0xe875('0x34')]=_0x15a917['attributes'][_0xe875('0x36')]?_0x15a917['attributes']:_0x53e561[_0xe875('0x2f')];if(!_0x83b741[_0xe875('0x30')]['hasOwnProperty'](_0xe875('0x37'))){_0x15a917[_0xe875('0x1d')]=qs[_0xe875('0x1d')](_0x83b741['query'][_0xe875('0x1d')]);_0x15a917[_0xe875('0x20')]=qs[_0xe875('0x20')](_0x83b741[_0xe875('0x30')][_0xe875('0x20')]);}_0x15a917[_0xe875('0x38')]=qs[_0xe875('0x39')](_0x83b741[_0xe875('0x30')][_0xe875('0x39')]);_0x15a917['where']=qs[_0xe875('0x32')](_[_0xe875('0x3a')](_0x83b741[_0xe875('0x30')],_0x53e561['filters']),_0x243631);if(_0x83b741[_0xe875('0x30')][_0xe875('0x3b')]){_0x15a917[_0xe875('0x3c')]=_[_0xe875('0x3d')](_0x15a917[_0xe875('0x3c')],{'$or':_['map'](_0x243631,function(_0x25aa84){if(_0x25aa84[_0xe875('0x2d')]!==_0xe875('0x3e')){var _0x11dae4={};_0x11dae4[_0x25aa84[_0xe875('0x27')]]={'$like':'%'+_0x83b741[_0xe875('0x30')][_0xe875('0x3b')]+'%'};return _0x11dae4;}})});}_0x15a917=_[_0xe875('0x3d')]({},_0x15a917,_0x83b741[_0xe875('0x3f')]);var _0x2fe983={'where':_0x15a917[_0xe875('0x3c')]};return db['SalesforceField'][_0xe875('0x1f')](_0x2fe983)[_0xe875('0x25')](function(_0x579f75){_0x40a4ee['count']=_0x579f75;if(_0x83b741[_0xe875('0x30')][_0xe875('0x40')]){_0x15a917['include']=[{'all':!![]}];}return db[_0xe875('0x2b')][_0xe875('0x41')](_0x15a917);})['then'](function(_0x54a45c){_0x40a4ee[_0xe875('0x42')]=_0x54a45c;return _0x40a4ee;})[_0xe875('0x25')](respondWithFilteredResult(_0x33d36f,_0x15a917))[_0xe875('0x43')](handleError(_0x33d36f,null));};exports[_0xe875('0x44')]=function(_0x4f3d92,_0x36aa58){var _0x1d2592={'raw':!![],'where':{'id':_0x4f3d92['params']['id']}},_0x31f460={};_0x31f460[_0xe875('0x2f')]=_[_0xe875('0x31')](db['SalesforceField'][_0xe875('0x45')]);_0x31f460[_0xe875('0x30')]=_['keys'](_0x4f3d92[_0xe875('0x30')]);_0x31f460[_0xe875('0x32')]=_[_0xe875('0x33')](_0x31f460[_0xe875('0x2f')],_0x31f460[_0xe875('0x30')]);_0x1d2592[_0xe875('0x34')]=_[_0xe875('0x33')](_0x31f460[_0xe875('0x2f')],qs[_0xe875('0x35')](_0x4f3d92[_0xe875('0x30')][_0xe875('0x35')]));_0x1d2592[_0xe875('0x34')]=_0x1d2592[_0xe875('0x34')]['length']?_0x1d2592[_0xe875('0x34')]:_0x31f460[_0xe875('0x2f')];if(_0x4f3d92['query']['includeAll']){_0x1d2592[_0xe875('0x46')]=[{'all':!![]}];}_0x1d2592=_[_0xe875('0x3d')]({},_0x1d2592,_0x4f3d92[_0xe875('0x3f')]);return db[_0xe875('0x2b')][_0xe875('0x47')](_0x1d2592)[_0xe875('0x25')](handleEntityNotFound(_0x36aa58,null))[_0xe875('0x25')](respondWithResult(_0x36aa58,null))[_0xe875('0x43')](handleError(_0x36aa58,null));};exports['create']=function(_0x904063,_0x3d94cf){return db['SalesforceField'][_0xe875('0x48')](_0x904063[_0xe875('0x49')],{})['then'](respondWithResult(_0x3d94cf,0xc9))['catch'](handleError(_0x3d94cf,null));};exports[_0xe875('0x4a')]=function(_0x3b4eeb,_0x37627c){if(_0x3b4eeb[_0xe875('0x49')]['id']){delete _0x3b4eeb[_0xe875('0x49')]['id'];}return db[_0xe875('0x2b')][_0xe875('0x47')]({'where':{'id':_0x3b4eeb[_0xe875('0x4b')]['id']}})[_0xe875('0x25')](handleEntityNotFound(_0x37627c,null))[_0xe875('0x25')](saveUpdates(_0x3b4eeb[_0xe875('0x49')],null))[_0xe875('0x25')](respondWithResult(_0x37627c,null))[_0xe875('0x43')](handleError(_0x37627c,null));};exports[_0xe875('0x24')]=function(_0x17b057,_0x35e3f6){return db[_0xe875('0x2b')][_0xe875('0x47')]({'where':{'id':_0x17b057['params']['id']}})[_0xe875('0x25')](handleEntityNotFound(_0x35e3f6,null))['then'](removeEntity(_0x35e3f6,null))[_0xe875('0x43')](handleError(_0x35e3f6,null));}; \ No newline at end of file +var _0xd87a=['limit','count','reject','update','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','query','keys','filters','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','model','intersection','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x27952c,_0x26b865){var _0x374711=function(_0x48ad44){while(--_0x48ad44){_0x27952c['push'](_0x27952c['shift']());}};_0x374711(++_0x26b865);}(_0xd87a,0xf1));var _0xad87=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0xd87a[_0x568496];return _0x26c5c1;};'use strict';var emlformat=require(_0xad87('0x0'));var rimraf=require(_0xad87('0x1'));var zipdir=require(_0xad87('0x2'));var jsonpatch=require(_0xad87('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad87('0x4'));var Mustache=require(_0xad87('0x5'));var util=require(_0xad87('0x6'));var path=require(_0xad87('0x7'));var sox=require(_0xad87('0x8'));var csv=require('to-csv');var ejs=require(_0xad87('0x9'));var fs=require('fs');var fs_extra=require(_0xad87('0xa'));var _=require('lodash');var squel=require(_0xad87('0xb'));var crypto=require(_0xad87('0xc'));var jsforce=require(_0xad87('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xad87('0xe'));var Papa=require(_0xad87('0xf'));var Redis=require(_0xad87('0x10'));var authService=require(_0xad87('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad87('0x12'));var logger=require('../../config/logger')(_0xad87('0x13'));var utils=require(_0xad87('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad87('0x15'))['db'];function respondWithStatusCode(_0x25941e,_0x11c0b1){_0x11c0b1=_0x11c0b1||0xcc;return function(_0x595fad){if(_0x595fad){return _0x25941e[_0xad87('0x16')](_0x11c0b1);}return _0x25941e[_0xad87('0x17')](_0x11c0b1)[_0xad87('0x18')]();};}function respondWithResult(_0x426617,_0x838a0e){_0x838a0e=_0x838a0e||0xc8;return function(_0x5a4f7f){if(_0x5a4f7f){return _0x426617[_0xad87('0x17')](_0x838a0e)[_0xad87('0x19')](_0x5a4f7f);}};}function respondWithFilteredResult(_0x4c1761,_0x109cc8){return function(_0x4ea837){if(_0x4ea837){var _0x33362e=typeof _0x109cc8[_0xad87('0x1a')]==='undefined'&&typeof _0x109cc8[_0xad87('0x1b')]==='undefined';var _0x1dc2d4=_0x4ea837[_0xad87('0x1c')];var _0x159f40=_0x33362e?0x0:_0x109cc8[_0xad87('0x1a')];var _0x2ab44e=_0x33362e?_0x4ea837[_0xad87('0x1c')]:_0x109cc8[_0xad87('0x1a')]+_0x109cc8[_0xad87('0x1b')];var _0xa70135;if(_0x2ab44e>=_0x1dc2d4){_0x2ab44e=_0x1dc2d4;_0xa70135=0xc8;}else{_0xa70135=0xce;}_0x4c1761['status'](_0xa70135);return _0x4c1761['set']('Content-Range',_0x159f40+'-'+_0x2ab44e+'/'+_0x1dc2d4)[_0xad87('0x19')](_0x4ea837);}return null;};}function patchUpdates(_0x5713f7){return function(_0x29c798){try{jsonpatch['apply'](_0x29c798,_0x5713f7,!![]);}catch(_0x5c460a){return BPromise[_0xad87('0x1d')](_0x5c460a);}return _0x29c798['save']();};}function saveUpdates(_0x18f057,_0x8f447){return function(_0x551c2e){if(_0x551c2e){return _0x551c2e[_0xad87('0x1e')](_0x18f057)[_0xad87('0x1f')](function(_0x4c1427){return _0x4c1427;});}return null;};}function removeEntity(_0xcba640,_0xbce5a1){return function(_0x8246ca){if(_0x8246ca){return _0x8246ca['destroy']()[_0xad87('0x1f')](function(){_0xcba640['status'](0xcc)[_0xad87('0x18')]();});}};}function handleEntityNotFound(_0x479f61,_0x31e8bd){return function(_0x285a3f){if(!_0x285a3f){_0x479f61[_0xad87('0x16')](0x194);}return _0x285a3f;};}function handleError(_0x45d19f,_0x5072d0){_0x5072d0=_0x5072d0||0x1f4;return function(_0x5886b6){logger[_0xad87('0x20')](_0x5886b6['stack']);if(_0x5886b6[_0xad87('0x21')]){delete _0x5886b6[_0xad87('0x21')];}_0x45d19f[_0xad87('0x17')](_0x5072d0)[_0xad87('0x22')](_0x5886b6);};}exports[_0xad87('0x23')]=function(_0x2cf75b,_0x22ddb6){var _0x1d9922={},_0x2774dc={},_0x2d2b17={'count':0x0,'rows':[]};var _0x4a5f98=_[_0xad87('0x24')](db[_0xad87('0x25')][_0xad87('0x26')],function(_0x9ec53c){return{'name':_0x9ec53c[_0xad87('0x27')],'type':_0x9ec53c[_0xad87('0x28')]['key']};});_0x2774dc['model']=_['map'](_0x4a5f98,_0xad87('0x21'));_0x2774dc[_0xad87('0x29')]=_[_0xad87('0x2a')](_0x2cf75b[_0xad87('0x29')]);_0x2774dc[_0xad87('0x2b')]=_['intersection'](_0x2774dc['model'],_0x2774dc[_0xad87('0x29')]);_0x1d9922['attributes']=_['intersection'](_0x2774dc['model'],qs[_0xad87('0x2c')](_0x2cf75b[_0xad87('0x29')]['fields']));_0x1d9922[_0xad87('0x2d')]=_0x1d9922[_0xad87('0x2d')][_0xad87('0x2e')]?_0x1d9922[_0xad87('0x2d')]:_0x2774dc['model'];if(!_0x2cf75b[_0xad87('0x29')]['hasOwnProperty'](_0xad87('0x2f'))){_0x1d9922[_0xad87('0x1b')]=qs[_0xad87('0x1b')](_0x2cf75b[_0xad87('0x29')][_0xad87('0x1b')]);_0x1d9922['offset']=qs[_0xad87('0x1a')](_0x2cf75b[_0xad87('0x29')][_0xad87('0x1a')]);}_0x1d9922[_0xad87('0x30')]=qs[_0xad87('0x31')](_0x2cf75b[_0xad87('0x29')][_0xad87('0x31')]);_0x1d9922['where']=qs[_0xad87('0x2b')](_[_0xad87('0x32')](_0x2cf75b[_0xad87('0x29')],_0x2774dc[_0xad87('0x2b')]),_0x4a5f98);if(_0x2cf75b[_0xad87('0x29')][_0xad87('0x33')]){_0x1d9922['where']=_['merge'](_0x1d9922[_0xad87('0x34')],{'$or':_[_0xad87('0x24')](_0x4a5f98,function(_0xa126b5){if(_0xa126b5[_0xad87('0x28')]!=='VIRTUAL'){var _0x1cebcb={};_0x1cebcb[_0xa126b5[_0xad87('0x21')]]={'$like':'%'+_0x2cf75b[_0xad87('0x29')]['filter']+'%'};return _0x1cebcb;}})});}_0x1d9922=_[_0xad87('0x35')]({},_0x1d9922,_0x2cf75b[_0xad87('0x36')]);var _0x4f9911={'where':_0x1d9922[_0xad87('0x34')]};return db[_0xad87('0x25')][_0xad87('0x1c')](_0x4f9911)['then'](function(_0x41dfce){_0x2d2b17[_0xad87('0x1c')]=_0x41dfce;if(_0x2cf75b[_0xad87('0x29')][_0xad87('0x37')]){_0x1d9922[_0xad87('0x38')]=[{'all':!![]}];}return db['SalesforceField'][_0xad87('0x39')](_0x1d9922);})[_0xad87('0x1f')](function(_0x51fff6){_0x2d2b17[_0xad87('0x3a')]=_0x51fff6;return _0x2d2b17;})[_0xad87('0x1f')](respondWithFilteredResult(_0x22ddb6,_0x1d9922))[_0xad87('0x3b')](handleError(_0x22ddb6,null));};exports[_0xad87('0x3c')]=function(_0x539654,_0x28b44d){var _0x4346e1={'raw':!![],'where':{'id':_0x539654[_0xad87('0x3d')]['id']}},_0x373848={};_0x373848[_0xad87('0x3e')]=_[_0xad87('0x2a')](db[_0xad87('0x25')][_0xad87('0x26')]);_0x373848[_0xad87('0x29')]=_['keys'](_0x539654[_0xad87('0x29')]);_0x373848[_0xad87('0x2b')]=_[_0xad87('0x3f')](_0x373848[_0xad87('0x3e')],_0x373848[_0xad87('0x29')]);_0x4346e1[_0xad87('0x2d')]=_[_0xad87('0x3f')](_0x373848[_0xad87('0x3e')],qs[_0xad87('0x2c')](_0x539654[_0xad87('0x29')][_0xad87('0x2c')]));_0x4346e1['attributes']=_0x4346e1['attributes']['length']?_0x4346e1['attributes']:_0x373848['model'];if(_0x539654[_0xad87('0x29')]['includeAll']){_0x4346e1[_0xad87('0x38')]=[{'all':!![]}];}_0x4346e1=_[_0xad87('0x35')]({},_0x4346e1,_0x539654[_0xad87('0x36')]);return db[_0xad87('0x25')][_0xad87('0x40')](_0x4346e1)[_0xad87('0x1f')](handleEntityNotFound(_0x28b44d,null))[_0xad87('0x1f')](respondWithResult(_0x28b44d,null))[_0xad87('0x3b')](handleError(_0x28b44d,null));};exports['create']=function(_0x83aa85,_0x4e4483){return db[_0xad87('0x25')]['create'](_0x83aa85[_0xad87('0x41')],{})[_0xad87('0x1f')](respondWithResult(_0x4e4483,0xc9))['catch'](handleError(_0x4e4483,null));};exports[_0xad87('0x1e')]=function(_0x513c81,_0x249aba){if(_0x513c81[_0xad87('0x41')]['id']){delete _0x513c81[_0xad87('0x41')]['id'];}return db[_0xad87('0x25')][_0xad87('0x40')]({'where':{'id':_0x513c81[_0xad87('0x3d')]['id']}})[_0xad87('0x1f')](handleEntityNotFound(_0x249aba,null))[_0xad87('0x1f')](saveUpdates(_0x513c81[_0xad87('0x41')],null))['then'](respondWithResult(_0x249aba,null))[_0xad87('0x3b')](handleError(_0x249aba,null));};exports[_0xad87('0x42')]=function(_0x39dcc3,_0x237edb){return db['SalesforceField'][_0xad87('0x40')]({'where':{'id':_0x39dcc3['params']['id']}})['then'](handleEntityNotFound(_0x237edb,null))[_0xad87('0x1f')](removeEntity(_0x237edb,null))[_0xad87('0x3b')](handleError(_0x237edb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 177e424..6a14da2 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 _0x87f8=['./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2eae67,_0x2c1de0){var _0x3900cd=function(_0x8002fb){while(--_0x8002fb){_0x2eae67['push'](_0x2eae67['shift']());}};_0x3900cd(++_0x2c1de0);}(_0x87f8,0x11f));var _0x887f=function(_0x59c2b2,_0x1aa634){_0x59c2b2=_0x59c2b2-0x0;var _0x410c32=_0x87f8[_0x59c2b2];return _0x410c32;};'use strict';var _=require('lodash');var util=require(_0x887f('0x0'));var logger=require(_0x887f('0x1'))(_0x887f('0x2'));var moment=require('moment');var BPromise=require(_0x887f('0x3'));var rp=require(_0x887f('0x4'));var fs=require('fs');var path=require(_0x887f('0x5'));var rimraf=require(_0x887f('0x6'));var config=require('../../config/environment');var attributes=require(_0x887f('0x7'));module[_0x887f('0x8')]=function(_0x192758,_0x3a0be6){return _0x192758['define'](_0x887f('0x9'),attributes,{'tableName':_0x887f('0xa'),'paranoid':![],'indexes':[{'name':_0x887f('0xb'),'fields':[_0x887f('0xc'),_0x887f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x95df=['salesforce_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x232f5d,_0x18c951){var _0x19ba4a=function(_0x5162d1){while(--_0x5162d1){_0x232f5d['push'](_0x232f5d['shift']());}};_0x19ba4a(++_0x18c951);}(_0x95df,0x15b));var _0xf95d=function(_0xb7aea1,_0x4560bd){_0xb7aea1=_0xb7aea1-0x0;var _0x36d8ee=_0x95df[_0xb7aea1];return _0x36d8ee;};'use strict';var _=require(_0xf95d('0x0'));var util=require(_0xf95d('0x1'));var logger=require(_0xf95d('0x2'))(_0xf95d('0x3'));var moment=require(_0xf95d('0x4'));var BPromise=require(_0xf95d('0x5'));var rp=require(_0xf95d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf95d('0x7'));var config=require(_0xf95d('0x8'));var attributes=require(_0xf95d('0x9'));module[_0xf95d('0xa')]=function(_0x59af42,_0x1dea2e){return _0x59af42['define'](_0xf95d('0xb'),attributes,{'tableName':_0xf95d('0xc'),'paranoid':![],'indexes':[{'name':_0xf95d('0xd'),'fields':[_0xf95d('0xe'),'FieldId'],'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 b73cebf..1c6adf7 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 _0x04ab=['SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x04ab,0x18d));var _0xb04a=function(_0x3105df,_0x55b187){_0x3105df=_0x3105df-0x0;var _0x4d5626=_0x04ab[_0x3105df];return _0x4d5626;};'use strict';var _=require('lodash');var util=require(_0xb04a('0x0'));var moment=require(_0xb04a('0x1'));var BPromise=require(_0xb04a('0x2'));var rs=require(_0xb04a('0x3'));var fs=require('fs');var Redis=require(_0xb04a('0x4'));var db=require(_0xb04a('0x5'))['db'];var utils=require(_0xb04a('0x6'));var logger=require(_0xb04a('0x7'))(_0xb04a('0x8'));var config=require(_0xb04a('0x9'));var jayson=require(_0xb04a('0xa'));var client=jayson[_0xb04a('0xb')][_0xb04a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23e742,_0x4efe8a,_0x503044){return new BPromise(function(_0x55eb92,_0x20eedc){return client[_0xb04a('0xd')](_0x23e742,_0x503044)['then'](function(_0x150e27){logger[_0xb04a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0xb04a('0xf'));logger[_0xb04a('0x10')](_0xb04a('0x11'),_0x4efe8a,'request\x20sent',JSON[_0xb04a('0x12')](_0x150e27));if(_0x150e27[_0xb04a('0x13')]){if(_0x150e27[_0xb04a('0x13')]['code']===0x1f4){logger[_0xb04a('0x13')](_0xb04a('0x14'),_0x4efe8a,_0x150e27['error'][_0xb04a('0x15')]);return _0x20eedc(_0x150e27[_0xb04a('0x13')][_0xb04a('0x15')]);}logger[_0xb04a('0x13')](_0xb04a('0x14'),_0x4efe8a,_0x150e27[_0xb04a('0x13')]['message']);return _0x55eb92(_0x150e27[_0xb04a('0x13')][_0xb04a('0x15')]);}else{logger[_0xb04a('0xe')]('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0xb04a('0xf'));_0x55eb92(_0x150e27[_0xb04a('0x16')][_0xb04a('0x15')]);}})['catch'](function(_0x3eaa16){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4efe8a,_0x3eaa16);_0x20eedc(_0x3eaa16);});});} \ No newline at end of file +var _0x5994=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x56e05a,_0x462361){var _0x282aa5=function(_0x1820d6){while(--_0x1820d6){_0x56e05a['push'](_0x56e05a['shift']());}};_0x282aa5(++_0x462361);}(_0x5994,0xd3));var _0x4599=function(_0x5a9e69,_0x5a4db2){_0x5a9e69=_0x5a9e69-0x0;var _0x59b16f=_0x5994[_0x5a9e69];return _0x59b16f;};'use strict';var _=require(_0x4599('0x0'));var util=require(_0x4599('0x1'));var moment=require('moment');var BPromise=require(_0x4599('0x2'));var rs=require(_0x4599('0x3'));var fs=require('fs');var Redis=require(_0x4599('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4599('0x5'))(_0x4599('0x6'));var config=require(_0x4599('0x7'));var jayson=require(_0x4599('0x8'));var client=jayson['client'][_0x4599('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb55d73,_0x5f3625,_0x194f87){return new BPromise(function(_0x2ec3de,_0x319585){return client['request'](_0xb55d73,_0x194f87)[_0x4599('0xa')](function(_0x3e2b7b){logger[_0x4599('0xb')](_0x4599('0xc'),_0x5f3625,_0x4599('0xd'));logger['debug'](_0x4599('0xe'),_0x5f3625,'request\x20sent',JSON[_0x4599('0xf')](_0x3e2b7b));if(_0x3e2b7b[_0x4599('0x10')]){if(_0x3e2b7b[_0x4599('0x10')][_0x4599('0x11')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x5f3625,_0x3e2b7b[_0x4599('0x10')][_0x4599('0x12')]);return _0x319585(_0x3e2b7b['error']['message']);}logger[_0x4599('0x10')](_0x4599('0xc'),_0x5f3625,_0x3e2b7b[_0x4599('0x10')][_0x4599('0x12')]);return _0x2ec3de(_0x3e2b7b[_0x4599('0x10')][_0x4599('0x12')]);}else{logger[_0x4599('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5f3625,_0x4599('0xd'));_0x2ec3de(_0x3e2b7b[_0x4599('0x13')][_0x4599('0x12')]);}})[_0x4599('0x14')](function(_0x1371d6){logger['error'](_0x4599('0xc'),_0x5f3625,_0x1371d6);_0x319585(_0x1371d6);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 6d3d75b..ded4966 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 _0x64e9=['../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','delete','exports','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x200316,_0x37b1ba){var _0x1126b7=function(_0x2e0579){while(--_0x2e0579){_0x200316['push'](_0x200316['shift']());}};_0x1126b7(++_0x37b1ba);}(_0x64e9,0x136));var _0x964e=function(_0x3f7786,_0x1dbe8a){_0x3f7786=_0x3f7786-0x0;var _0x1551af=_0x64e9[_0x3f7786];return _0x1551af;};'use strict';var multer=require(_0x964e('0x0'));var util=require('util');var path=require(_0x964e('0x1'));var timeout=require('connect-timeout');var express=require(_0x964e('0x2'));var router=express['Router']();var fs_extra=require(_0x964e('0x3'));var auth=require(_0x964e('0x4'));var interaction=require(_0x964e('0x5'));var config=require('../../config/environment');var controller=require(_0x964e('0x6'));router[_0x964e('0x7')]('/',auth[_0x964e('0x8')](),controller[_0x964e('0x9')]);router['get']('/:id',auth[_0x964e('0x8')](),controller['show']);router[_0x964e('0x7')](_0x964e('0xa'),auth[_0x964e('0x8')](),controller[_0x964e('0xb')]);router[_0x964e('0x7')](_0x964e('0xc'),auth['isAuthenticated'](),controller[_0x964e('0xd')]);router['post']('/',auth[_0x964e('0x8')](),controller[_0x964e('0xe')]);router[_0x964e('0xf')](_0x964e('0xa'),auth[_0x964e('0x8')](),controller[_0x964e('0x10')]);router['put'](_0x964e('0x11'),auth['isAuthenticated'](),controller[_0x964e('0x12')]);router[_0x964e('0x13')](_0x964e('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x964e('0x14')]=router; \ No newline at end of file +var _0xb3cd=['create','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0xa1d55a,_0x18ecc7){var _0x2b6c9c=function(_0x5b7119){while(--_0x5b7119){_0xa1d55a['push'](_0xa1d55a['shift']());}};_0x2b6c9c(++_0x18ecc7);}(_0xb3cd,0xae));var _0xdb3c=function(_0x1b964a,_0x40fdc2){_0x1b964a=_0x1b964a-0x0;var _0x2559fa=_0xb3cd[_0x1b964a];return _0x2559fa;};'use strict';var multer=require('multer');var util=require(_0xdb3c('0x0'));var path=require(_0xdb3c('0x1'));var timeout=require(_0xdb3c('0x2'));var express=require(_0xdb3c('0x3'));var router=express[_0xdb3c('0x4')]();var fs_extra=require(_0xdb3c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb3c('0x6'));var config=require(_0xdb3c('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x9')]);router[_0xdb3c('0xa')](_0xdb3c('0xb'),auth['isAuthenticated'](),controller[_0xdb3c('0xc')]);router[_0xdb3c('0xa')](_0xdb3c('0xd'),auth[_0xdb3c('0x8')](),controller[_0xdb3c('0xe')]);router[_0xdb3c('0xa')](_0xdb3c('0xf'),auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x10')]);router[_0xdb3c('0x11')]('/',auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x12')]);router[_0xdb3c('0x11')](_0xdb3c('0xd'),auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x13')]);router[_0xdb3c('0x14')](_0xdb3c('0xb'),auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x15')]);router[_0xdb3c('0x16')]('/:id',auth[_0xdb3c('0x8')](),controller[_0xdb3c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 69ebcb4..e9bca74 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 _0x0c24=['exports','STRING','remoteUri','sequelize'];(function(_0x4093da,_0x57c930){var _0x5ca0cb=function(_0x1ebb66){while(--_0x1ebb66){_0x4093da['push'](_0x4093da['shift']());}};_0x5ca0cb(++_0x57c930);}(_0x0c24,0x183));var _0x40c2=function(_0x2b6593,_0x2c5e04){_0x2b6593=_0x2b6593-0x0;var _0x59ccf4=_0x0c24[_0x2b6593];return _0x59ccf4;};'use strict';var Sequelize=require(_0x40c2('0x0'));module[_0x40c2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x40c2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x40c2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x40c2('0x2')],'unique':_0x40c2('0x3')},'serverUrl':{'type':Sequelize[_0x40c2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x269e=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4a8b77,_0x1b1f95){var _0x3b06b5=function(_0xf339df){while(--_0xf339df){_0x4a8b77['push'](_0x4a8b77['shift']());}};_0x3b06b5(++_0x1b1f95);}(_0x269e,0x1df));var _0xe269=function(_0x422ce5,_0x23be97){_0x422ce5=_0x422ce5-0x0;var _0x426c7c=_0x269e[_0x422ce5];return _0x426c7c;};'use strict';var Sequelize=require(_0xe269('0x0'));module[_0xe269('0x1')]={'name':{'type':Sequelize[_0xe269('0x2')]},'description':{'type':Sequelize[_0xe269('0x2')]},'username':{'type':Sequelize[_0xe269('0x2')],'unique':_0xe269('0x3')},'password':{'type':Sequelize[_0xe269('0x2')]},'email':{'type':Sequelize[_0xe269('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe269('0x4')},'serverUrl':{'type':Sequelize[_0xe269('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 ddf4069..917b208 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 _0xdbb9=['status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','body','find','getConfigurations','findOne','ServicenowConfiguration','filter','AccountId','Subjects','getSubjects','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','reopened_by','problem_id','activity_due','assigned_to','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','username','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','test','statusCode','error','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xdbb9,0x9f));var _0x9dbb=function(_0x5532e1,_0x4ad6d4){_0x5532e1=_0x5532e1-0x0;var _0x4534a0=_0xdbb9[_0x5532e1];return _0x4534a0;};'use strict';var emlformat=require(_0x9dbb('0x0'));var rimraf=require(_0x9dbb('0x1'));var zipdir=require(_0x9dbb('0x2'));var jsonpatch=require(_0x9dbb('0x3'));var rp=require(_0x9dbb('0x4'));var moment=require(_0x9dbb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9dbb('0x6'));var util=require(_0x9dbb('0x7'));var path=require(_0x9dbb('0x8'));var sox=require(_0x9dbb('0x9'));var csv=require(_0x9dbb('0xa'));var ejs=require(_0x9dbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9dbb('0xc'));var squel=require(_0x9dbb('0xd'));var crypto=require(_0x9dbb('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dbb('0xa'));var querystring=require(_0x9dbb('0xf'));var Papa=require('papaparse');var Redis=require(_0x9dbb('0x10'));var authService=require(_0x9dbb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))(_0x9dbb('0x14'));var utils=require('../../config/utils');var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];var integrations=require(_0x9dbb('0x18'));function respondWithStatusCode(_0x22f17b,_0x35b547){_0x35b547=_0x35b547||0xcc;return function(_0x1f4158){if(_0x1f4158){return _0x22f17b[_0x9dbb('0x19')](_0x35b547);}return _0x22f17b['status'](_0x35b547)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x325d48,_0x457b71){_0x457b71=_0x457b71||0xc8;return function(_0x372657){if(_0x372657){return _0x325d48[_0x9dbb('0x1b')](_0x457b71)['json'](_0x372657);}};}function respondWithFilteredResult(_0x56e1be,_0x4f3741){return function(_0x3f72e7){if(_0x3f72e7){var _0x4f17c9=typeof _0x4f3741[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x4f3741['limit']===_0x9dbb('0x1d');var _0x3f775a=_0x3f72e7[_0x9dbb('0x1e')];var _0x228716=_0x4f17c9?0x0:_0x4f3741[_0x9dbb('0x1c')];var _0xbf40dc=_0x4f17c9?_0x3f72e7[_0x9dbb('0x1e')]:_0x4f3741[_0x9dbb('0x1c')]+_0x4f3741[_0x9dbb('0x1f')];var _0x133225;if(_0xbf40dc>=_0x3f775a){_0xbf40dc=_0x3f775a;_0x133225=0xc8;}else{_0x133225=0xce;}_0x56e1be[_0x9dbb('0x1b')](_0x133225);return _0x56e1be[_0x9dbb('0x20')](_0x9dbb('0x21'),_0x228716+'-'+_0xbf40dc+'/'+_0x3f775a)[_0x9dbb('0x22')](_0x3f72e7);}return null;};}function patchUpdates(_0x4492d0){return function(_0x5066ec){try{jsonpatch[_0x9dbb('0x23')](_0x5066ec,_0x4492d0,!![]);}catch(_0x7d13a3){return BPromise[_0x9dbb('0x24')](_0x7d13a3);}return _0x5066ec['save']();};}function saveUpdates(_0x282315,_0x31b3d4){return function(_0x3f5d6d){if(_0x3f5d6d){return _0x3f5d6d[_0x9dbb('0x25')](_0x282315)[_0x9dbb('0x26')](function(_0x46b9c5){return _0x46b9c5;});}return null;};}function removeEntity(_0xc194ac,_0x4f468f){return function(_0x56276c){if(_0x56276c){return _0x56276c[_0x9dbb('0x27')]()[_0x9dbb('0x26')](function(){_0xc194ac[_0x9dbb('0x1b')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x7e6f0a,_0x22536e){return function(_0xebc210){if(!_0xebc210){_0x7e6f0a[_0x9dbb('0x19')](0x194);}return _0xebc210;};}function handleError(_0x7579f,_0x2749e6){_0x2749e6=_0x2749e6||0x1f4;return function(_0x16c406){logger['error'](_0x16c406[_0x9dbb('0x28')]);if(_0x16c406['name']){delete _0x16c406[_0x9dbb('0x29')];}_0x7579f['status'](_0x2749e6)[_0x9dbb('0x2a')](_0x16c406);};}exports[_0x9dbb('0x2b')]=function(_0x4e8a9a,_0x3bfaef){var _0x1a9ca8={},_0x4981d0={},_0x2c727e={'count':0x0,'rows':[]};var _0x4858cb=_[_0x9dbb('0x2c')](db[_0x9dbb('0x2d')]['rawAttributes'],function(_0x193363){return{'name':_0x193363[_0x9dbb('0x2e')],'type':_0x193363[_0x9dbb('0x2f')][_0x9dbb('0x30')]};});_0x4981d0['model']=_[_0x9dbb('0x2c')](_0x4858cb,'name');_0x4981d0['query']=_['keys'](_0x4e8a9a[_0x9dbb('0x31')]);_0x4981d0[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0x4981d0['model'],_0x4981d0[_0x9dbb('0x31')]);_0x1a9ca8[_0x9dbb('0x34')]=_['intersection'](_0x4981d0['model'],qs['fields'](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x35')]));_0x1a9ca8[_0x9dbb('0x34')]=_0x1a9ca8[_0x9dbb('0x34')][_0x9dbb('0x36')]?_0x1a9ca8[_0x9dbb('0x34')]:_0x4981d0[_0x9dbb('0x37')];if(!_0x4e8a9a['query'][_0x9dbb('0x38')](_0x9dbb('0x39'))){_0x1a9ca8['limit']=qs[_0x9dbb('0x1f')](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x1f')]);_0x1a9ca8[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x1c')]);}_0x1a9ca8[_0x9dbb('0x3a')]=qs[_0x9dbb('0x3b')](_0x4e8a9a['query'][_0x9dbb('0x3b')]);_0x1a9ca8[_0x9dbb('0x3c')]=qs['filters'](_[_0x9dbb('0x3d')](_0x4e8a9a[_0x9dbb('0x31')],_0x4981d0[_0x9dbb('0x32')]),_0x4858cb);if(_0x4e8a9a[_0x9dbb('0x31')]['filter']){_0x1a9ca8['where']=_[_0x9dbb('0x3e')](_0x1a9ca8[_0x9dbb('0x3c')],{'$or':_['map'](_0x4858cb,function(_0x27056d){if(_0x27056d[_0x9dbb('0x2f')]!=='VIRTUAL'){var _0x579334={};_0x579334[_0x27056d[_0x9dbb('0x29')]]={'$like':'%'+_0x4e8a9a[_0x9dbb('0x31')]['filter']+'%'};return _0x579334;}})});}_0x1a9ca8=_['merge']({},_0x1a9ca8,_0x4e8a9a[_0x9dbb('0x3f')]);var _0x391f3b={'where':_0x1a9ca8['where']};return db[_0x9dbb('0x2d')]['count'](_0x391f3b)[_0x9dbb('0x26')](function(_0x24390a){_0x2c727e[_0x9dbb('0x1e')]=_0x24390a;if(_0x4e8a9a[_0x9dbb('0x31')][_0x9dbb('0x40')]){_0x1a9ca8['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x9dbb('0x41')](_0x1a9ca8);})['then'](function(_0x8714f2){_0x2c727e[_0x9dbb('0x42')]=_0x8714f2;return _0x2c727e;})[_0x9dbb('0x26')](respondWithFilteredResult(_0x3bfaef,_0x1a9ca8))[_0x9dbb('0x43')](handleError(_0x3bfaef,null));};exports[_0x9dbb('0x44')]=function(_0x19cdfe,_0x516067){var _0x110407={'raw':![],'where':{'id':_0x19cdfe[_0x9dbb('0x45')]['id']}},_0x4185c0={};_0x4185c0[_0x9dbb('0x37')]=_[_0x9dbb('0x46')](db[_0x9dbb('0x2d')][_0x9dbb('0x47')]);_0x4185c0['query']=_[_0x9dbb('0x46')](_0x19cdfe[_0x9dbb('0x31')]);_0x4185c0[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0x4185c0[_0x9dbb('0x37')],_0x4185c0[_0x9dbb('0x31')]);_0x110407['attributes']=_['intersection'](_0x4185c0[_0x9dbb('0x37')],qs[_0x9dbb('0x35')](_0x19cdfe['query'][_0x9dbb('0x35')]));_0x110407['attributes']=_0x110407['attributes'][_0x9dbb('0x36')]?_0x110407[_0x9dbb('0x34')]:_0x4185c0[_0x9dbb('0x37')];if(_0x19cdfe[_0x9dbb('0x31')][_0x9dbb('0x40')]){_0x110407[_0x9dbb('0x48')]=[{'all':!![]}];}_0x110407=_[_0x9dbb('0x3e')]({},_0x110407,_0x19cdfe[_0x9dbb('0x3f')]);return db[_0x9dbb('0x2d')]['find'](_0x110407)[_0x9dbb('0x26')](handleEntityNotFound(_0x516067,null))[_0x9dbb('0x26')](respondWithResult(_0x516067,null))[_0x9dbb('0x43')](handleError(_0x516067,null));};exports[_0x9dbb('0x49')]=function(_0x328288,_0x1fa9b4){return db[_0x9dbb('0x2d')][_0x9dbb('0x49')](_0x328288[_0x9dbb('0x4a')],{})[_0x9dbb('0x26')](respondWithResult(_0x1fa9b4,0xc9))[_0x9dbb('0x43')](handleError(_0x1fa9b4,null));};exports[_0x9dbb('0x25')]=function(_0x372e68,_0x5e15c3){if(_0x372e68[_0x9dbb('0x4a')]['id']){delete _0x372e68['body']['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x372e68[_0x9dbb('0x45')]['id']}})[_0x9dbb('0x26')](handleEntityNotFound(_0x5e15c3,null))[_0x9dbb('0x26')](saveUpdates(_0x372e68[_0x9dbb('0x4a')],null))['then'](respondWithResult(_0x5e15c3,null))[_0x9dbb('0x43')](handleError(_0x5e15c3,null));};exports['destroy']=function(_0x343f14,_0x2dc48a){return db[_0x9dbb('0x2d')][_0x9dbb('0x4b')]({'where':{'id':_0x343f14[_0x9dbb('0x45')]['id']}})[_0x9dbb('0x26')](handleEntityNotFound(_0x2dc48a,null))['then'](removeEntity(_0x2dc48a,null))[_0x9dbb('0x43')](handleError(_0x2dc48a,null));};exports[_0x9dbb('0x4c')]=function(_0x33ff6d,_0x40c09c,_0x1ada55){var _0x482f8e={};var _0x2e3726={};var _0x511f43;var _0x2eb213;return db['ServicenowAccount'][_0x9dbb('0x4d')]({'where':{'id':_0x33ff6d['params']['id']}})['then'](handleEntityNotFound(_0x40c09c,null))[_0x9dbb('0x26')](function(_0xccfb05){if(_0xccfb05){_0x511f43=_0xccfb05;_0x2e3726[_0x9dbb('0x37')]=_[_0x9dbb('0x46')](db[_0x9dbb('0x4e')][_0x9dbb('0x47')]);_0x2e3726[_0x9dbb('0x31')]=_[_0x9dbb('0x46')](_0x33ff6d[_0x9dbb('0x31')]);_0x2e3726[_0x9dbb('0x32')]=_['intersection'](_0x2e3726['model'],_0x2e3726[_0x9dbb('0x31')]);_0x482f8e[_0x9dbb('0x34')]=_[_0x9dbb('0x33')](_0x2e3726[_0x9dbb('0x37')],qs['fields'](_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x35')]));_0x482f8e[_0x9dbb('0x34')]=_0x482f8e[_0x9dbb('0x34')][_0x9dbb('0x36')]?_0x482f8e['attributes']:_0x2e3726[_0x9dbb('0x37')];_0x482f8e[_0x9dbb('0x3a')]=qs[_0x9dbb('0x3b')](_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x3b')]);_0x482f8e[_0x9dbb('0x3c')]=qs[_0x9dbb('0x32')](_['pick'](_0x33ff6d[_0x9dbb('0x31')],_0x2e3726[_0x9dbb('0x32')]));if(_0x33ff6d['query']['filter']){_0x482f8e[_0x9dbb('0x3c')]=_[_0x9dbb('0x3e')](_0x482f8e['where'],{'$or':_[_0x9dbb('0x2c')](_0x482f8e[_0x9dbb('0x34')],function(_0x1d1197){var _0x15e073={};_0x15e073[_0x1d1197]={'$like':'%'+_0x33ff6d[_0x9dbb('0x31')][_0x9dbb('0x4f')]+'%'};return _0x15e073;})});}_0x482f8e=_[_0x9dbb('0x3e')]({},_0x482f8e,_0x33ff6d[_0x9dbb('0x3f')]);return _0x511f43[_0x9dbb('0x4c')](_0x482f8e);}})[_0x9dbb('0x26')](function(_0x5b850e){if(_0x5b850e){_0x2eb213=_0x5b850e[_0x9dbb('0x36')];if(!_0x33ff6d['query'][_0x9dbb('0x38')]('nolimit')){_0x482f8e[_0x9dbb('0x1f')]=qs['limit'](_0x33ff6d[_0x9dbb('0x31')]['limit']);_0x482f8e[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x33ff6d[_0x9dbb('0x31')]['offset']);}return _0x511f43[_0x9dbb('0x4c')](_0x482f8e);}})[_0x9dbb('0x26')](function(_0x1bfa52){if(_0x1bfa52){return _0x1bfa52?{'count':_0x2eb213,'rows':_0x1bfa52}:null;}})['then'](respondWithResult(_0x40c09c,null))[_0x9dbb('0x43')](handleError(_0x40c09c,null));};exports['addConfiguration']=function(_0x14695a,_0x45118f,_0x4466ae){if(_0x14695a[_0x9dbb('0x4a')]['id']){delete _0x14695a[_0x9dbb('0x4a')]['id'];}return db[_0x9dbb('0x2d')][_0x9dbb('0x4d')]({'where':{'id':_0x14695a[_0x9dbb('0x45')]['id']}})['then'](handleEntityNotFound(_0x45118f,null))[_0x9dbb('0x26')](function(_0x1c2077){if(_0x1c2077){_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x50')]=_0x1c2077['id'];_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x51')]=integrations[_0x9dbb('0x52')](_0x14695a['body']['channel'],_0x14695a['body'][_0x9dbb('0x2f')]);_0x14695a[_0x9dbb('0x4a')]['Descriptions']=integrations[_0x9dbb('0x53')](_0x14695a[_0x9dbb('0x4a')]['channel'],_0x14695a[_0x9dbb('0x4a')][_0x9dbb('0x2f')]);return db['ServicenowConfiguration']['create'](_0x14695a[_0x9dbb('0x4a')],{'include':[{'model':db[_0x9dbb('0x54')],'as':_0x9dbb('0x51')},{'model':db['ServicenowField'],'as':_0x9dbb('0x55')}]});}return null;})[_0x9dbb('0x26')](respondWithResult(_0x45118f,null))[_0x9dbb('0x43')](handleError(_0x45118f,null));};exports[_0x9dbb('0x56')]=function(_0x476c75,_0x341787,_0x5b6f6c){var _0x40469c=[_0x9dbb('0x57'),_0x9dbb('0x58'),_0x9dbb('0x59'),_0x9dbb('0x5a'),_0x9dbb('0x5b'),_0x9dbb('0x5c'),_0x9dbb('0x5d'),_0x9dbb('0x5e'),_0x9dbb('0x5f')];var _0x47adf5=[_0x9dbb('0x60'),_0x9dbb('0x57'),_0x9dbb('0x61'),'watch_list',_0x9dbb('0x62'),'sys_updated_on','child_incidents',_0x9dbb('0x58'),_0x9dbb('0x63'),_0x9dbb('0x64'),_0x9dbb('0x65'),_0x9dbb('0x66'),_0x9dbb('0x67'),_0x9dbb('0x68'),_0x9dbb('0x69'),_0x9dbb('0x6a'),_0x9dbb('0x6b'),_0x9dbb('0x6c'),'knowledge',_0x9dbb('0x3a'),'calendar_stc',_0x9dbb('0x6d'),_0x9dbb('0x6e'),_0x9dbb('0x6f'),_0x9dbb('0x70'),_0x9dbb('0x71'),_0x9dbb('0x72'),_0x9dbb('0x73'),_0x9dbb('0x74'),_0x9dbb('0x75'),_0x9dbb('0x76'),_0x9dbb('0x77'),_0x9dbb('0x78'),_0x9dbb('0x79'),'business_duration','group_list',_0x9dbb('0x7a'),_0x9dbb('0x7b'),_0x9dbb('0x7c'),_0x9dbb('0x7d'),_0x9dbb('0x7e'),_0x9dbb('0x5a'),_0x9dbb('0x7f'),_0x9dbb('0x80'),'close_code',_0x9dbb('0x81'),_0x9dbb('0x82'),_0x9dbb('0x83'),'assignment_group',_0x9dbb('0x84'),_0x9dbb('0x85'),'description',_0x9dbb('0x86'),_0x9dbb('0x5c'),_0x9dbb('0x87'),_0x9dbb('0x88'),_0x9dbb('0x89'),_0x9dbb('0x8a'),_0x9dbb('0x8b'),'sys_id','contact_type',_0x9dbb('0x8c'),_0x9dbb('0x5d'),'urgency',_0x9dbb('0x8d'),'company','reassignment_count',_0x9dbb('0x8e'),_0x9dbb('0x8f'),_0x9dbb('0x5e'),'comments','sla_due',_0x9dbb('0x90'),_0x9dbb('0x91'),_0x9dbb('0x92'),_0x9dbb('0x93'),_0x9dbb('0x94'),'sys_tags','escalation',_0x9dbb('0x95'),_0x9dbb('0x96'),_0x9dbb('0x97'),_0x9dbb('0x5f')];var _0x327a5d='';var _0x46be6c='';var _0x3f65f4=[];var _0x4a350a='';var _0x325a42='';var _0x300043=[];var _0xedce4a='';var _0x5f0df0='';var _0x17ffe6={};var _0x49b1c1='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x476c75['params']['id']},'attributes':['id',_0x9dbb('0x98'),'password','email','remoteUri','serverUrl']})[_0x9dbb('0x26')](handleEntityNotFound(_0x341787,null))[_0x9dbb('0x26')](function(_0xdebf9a){if(_0xdebf9a){_0x49b1c1=_0xdebf9a[_0x9dbb('0x99')];var _0x3cb5e6=_0x49b1c1[_0x9dbb('0x9a')](-0x1);if(_0x3cb5e6==='/'){_0x49b1c1=_0x49b1c1['substring'](0x0,_0x49b1c1['lastIndexOf'](_0x3cb5e6));}_0x5f0df0=util[_0x9dbb('0x9b')](_0x9dbb('0x9c'),_0x49b1c1);_0xedce4a=util[_0x9dbb('0x9b')](_0x9dbb('0x9d'),_0x49b1c1);_0x17ffe6={'user':_0xdebf9a[_0x9dbb('0x98')],'pass':_0xdebf9a[_0x9dbb('0x9e')]};var _0x4ff3f4={'method':_0x9dbb('0x9f'),'uri':_0x5f0df0+_0x9dbb('0xa0'),'auth':_0x17ffe6,'json':!![]};return rp(_0x4ff3f4);}})[_0x9dbb('0x26')](function(_0x56b27b){if(_0x56b27b[_0x9dbb('0xa1')][_0x9dbb('0x36')]>0x0){_0x327a5d=_0x56b27b['result'];}console[_0x9dbb('0xa2')](_0x9dbb('0xa3'),_0x327a5d);_0x300043=[];_0x46be6c=Object['assign']([],_0x327a5d);_[_0x9dbb('0xa4')](_0x46be6c,function(_0x1f5a4c){return!_0x40469c[_0x9dbb('0xa5')](_0x1f5a4c[_0x9dbb('0x29')]);});_0x46be6c[_0x9dbb('0xa6')](function(_0x95f388){var _0x5f325f=createFieldObject(_0xedce4a,_0x17ffe6,_0x95f388[_0x9dbb('0xa7')],_0x95f388[_0x9dbb('0x29')],_0x95f388['label'],![]);_0x300043['push'](_0x5f325f);});return Promise[_0x9dbb('0xa8')](_0x300043);})[_0x9dbb('0x26')](function(_0x30f222){_0x3f65f4=_0x30f222;_0x4a350a=Object[_0x9dbb('0xa9')]([],_0x327a5d);console[_0x9dbb('0xa2')](_0x9dbb('0xaa'),_0x327a5d);_[_0x9dbb('0xa4')](_0x4a350a,function(_0xe0a118){return _0x47adf5['includes'](_0xe0a118[_0x9dbb('0x29')]);});console['log'](_0x9dbb('0xab'),_0x4a350a);_0x300043=[];_0x4a350a[_0x9dbb('0xa6')](function(_0x250ace){var _0x224a2e=createFieldObject(_0xedce4a,_0x17ffe6,_0x250ace[_0x9dbb('0xa7')],_0x250ace['name'],_0x250ace[_0x9dbb('0xac')],!![]);_0x300043[_0x9dbb('0xad')](_0x224a2e);});return Promise[_0x9dbb('0xa8')](_0x300043);})['then'](function(_0x4f4c3b){_0x325a42=_0x4f4c3b;var _0x155804=_0x3f65f4[_0x9dbb('0xae')](_0x325a42);return{'count':_0x155804['length'],'rows':_0x155804};})[_0x9dbb('0x26')](respondWithResult(_0x341787,null))[_0x9dbb('0x43')](function(_0x5a5b10){console['log'](_0x9dbb('0xaf')+_0x5a5b10);var _0x12b70e=_0x476c75[_0x9dbb('0x31')][_0x9dbb('0xb0')]?0x1f4:_0x5a5b10[_0x9dbb('0xb1')]||0x1f4;logger[_0x9dbb('0xb2')](_0x5a5b10['stack']);delete _0x5a5b10[_0x9dbb('0x29')];if(_0x12b70e===0x191){_0x12b70e=0x190;}_0x341787[_0x9dbb('0x1b')](_0x12b70e)[_0x9dbb('0x2a')](_0x476c75[_0x9dbb('0x31')][_0x9dbb('0xb0')]?{'message':_0x9dbb('0xb3'),'statusCode':_0x5a5b10[_0x9dbb('0xb1')]}:_0x5a5b10);});};function createFieldObject(_0x57975b,_0x2373b4,_0x494f61,_0x3e4425,_0xd105f8,_0x1a13bb){return new Promise(function(_0x455d0b,_0x5e3c16){var _0x6f1009={'id':_0x3e4425,'name':_0xd105f8,'custom':_0x1a13bb};if(_0x494f61===_0x9dbb('0xb4')){_0x6f1009[_0x9dbb('0x3f')]=[{'name':_0x9dbb('0xb5'),'value':_0x9dbb('0xb6')},{'name':_0x9dbb('0xb7'),'value':'false'}];_0x455d0b(_0x6f1009);}else{var _0x18b56b={'method':_0x9dbb('0x9f'),'uri':_0x57975b+_0x9dbb('0xb8')+_0x3e4425,'auth':_0x2373b4,'json':!![]};return rp(_0x18b56b)[_0x9dbb('0x26')](function(_0x1fe6e3){var _0x4faff9=[];if(_0x1fe6e3[_0x9dbb('0xa1')]['length']>0x0){_0x1fe6e3[_0x9dbb('0xa1')][_0x9dbb('0xa6')](function(_0x2f5055){if(_0x2f5055['inactive']===_0x9dbb('0xb9')){var _0x3488cb={'name':_0x2f5055[_0x9dbb('0xac')],'value':_0x2f5055['value']};_0x4faff9[_0x9dbb('0xad')](_0x3488cb);}});}_0x6f1009[_0x9dbb('0x3f')]=_0x4faff9;if(_0x6f1009[_0x9dbb('0x3f')][_0x9dbb('0x36')]>0x0){_0x455d0b(_0x6f1009);}else{if(_0x1a13bb==![]){_0x455d0b();}else{_0x455d0b(_0x6f1009);}}});}});} \ No newline at end of file +var _0xdf2e=['send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','fields','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','opened_by','user_input','sys_domain','state','closed_at','cmdb_ci','impact','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','business_duration','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','Wrong\x20credentials','True','true','result','false','value','push','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name'];(function(_0x565dc8,_0x4261e5){var _0x46d643=function(_0x90b2f7){while(--_0x90b2f7){_0x565dc8['push'](_0x565dc8['shift']());}};_0x46d643(++_0x4261e5);}(_0xdf2e,0x8b));var _0xedf2=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0xdf2e[_0x573c9e];return _0x5d0714;};'use strict';var emlformat=require(_0xedf2('0x0'));var rimraf=require(_0xedf2('0x1'));var zipdir=require(_0xedf2('0x2'));var jsonpatch=require(_0xedf2('0x3'));var rp=require('request-promise');var moment=require(_0xedf2('0x4'));var BPromise=require(_0xedf2('0x5'));var Mustache=require('mustache');var util=require(_0xedf2('0x6'));var path=require(_0xedf2('0x7'));var sox=require(_0xedf2('0x8'));var csv=require(_0xedf2('0x9'));var ejs=require(_0xedf2('0xa'));var fs=require('fs');var fs_extra=require(_0xedf2('0xb'));var _=require(_0xedf2('0xc'));var squel=require(_0xedf2('0xd'));var crypto=require(_0xedf2('0xe'));var jsforce=require(_0xedf2('0xf'));var deskjs=require(_0xedf2('0x10'));var toCsv=require('to-csv');var querystring=require(_0xedf2('0x11'));var Papa=require(_0xedf2('0x12'));var Redis=require(_0xedf2('0x13'));var authService=require(_0xedf2('0x14'));var qs=require(_0xedf2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedf2('0x16'));var logger=require(_0xedf2('0x17'))('api');var utils=require(_0xedf2('0x18'));var config=require(_0xedf2('0x19'));var licenseUtil=require(_0xedf2('0x1a'));var db=require(_0xedf2('0x1b'))['db'];var integrations=require(_0xedf2('0x1c'));function respondWithStatusCode(_0x37e6e0,_0x4844a5){_0x4844a5=_0x4844a5||0xcc;return function(_0x5aa727){if(_0x5aa727){return _0x37e6e0['sendStatus'](_0x4844a5);}return _0x37e6e0[_0xedf2('0x1d')](_0x4844a5)['end']();};}function respondWithResult(_0x328dee,_0x492dcb){_0x492dcb=_0x492dcb||0xc8;return function(_0x11d0dc){if(_0x11d0dc){return _0x328dee['status'](_0x492dcb)[_0xedf2('0x1e')](_0x11d0dc);}};}function respondWithFilteredResult(_0x3026ea,_0x5e2621){return function(_0x48fb34){if(_0x48fb34){var _0x559c4d=typeof _0x5e2621['offset']===_0xedf2('0x1f')&&typeof _0x5e2621[_0xedf2('0x20')]===_0xedf2('0x1f');var _0x57e553=_0x48fb34[_0xedf2('0x21')];var _0x1abc7b=_0x559c4d?0x0:_0x5e2621[_0xedf2('0x22')];var _0x43dd07=_0x559c4d?_0x48fb34[_0xedf2('0x21')]:_0x5e2621[_0xedf2('0x22')]+_0x5e2621[_0xedf2('0x20')];var _0x306194;if(_0x43dd07>=_0x57e553){_0x43dd07=_0x57e553;_0x306194=0xc8;}else{_0x306194=0xce;}_0x3026ea['status'](_0x306194);return _0x3026ea[_0xedf2('0x23')](_0xedf2('0x24'),_0x1abc7b+'-'+_0x43dd07+'/'+_0x57e553)[_0xedf2('0x1e')](_0x48fb34);}return null;};}function patchUpdates(_0x507a84){return function(_0x4c98e8){try{jsonpatch[_0xedf2('0x25')](_0x4c98e8,_0x507a84,!![]);}catch(_0x152d0f){return BPromise[_0xedf2('0x26')](_0x152d0f);}return _0x4c98e8[_0xedf2('0x27')]();};}function saveUpdates(_0x11b15b,_0x3dc204){return function(_0x3f3504){if(_0x3f3504){return _0x3f3504[_0xedf2('0x28')](_0x11b15b)[_0xedf2('0x29')](function(_0x49b933){return _0x49b933;});}return null;};}function removeEntity(_0x26c3ae,_0x185464){return function(_0x57cece){if(_0x57cece){return _0x57cece['destroy']()[_0xedf2('0x29')](function(){_0x26c3ae[_0xedf2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x486a77,_0x8b152a){return function(_0x391f9d){if(!_0x391f9d){_0x486a77[_0xedf2('0x2a')](0x194);}return _0x391f9d;};}function handleError(_0x26456f,_0x1d8fa0){_0x1d8fa0=_0x1d8fa0||0x1f4;return function(_0x5c3a7a){logger[_0xedf2('0x2b')](_0x5c3a7a[_0xedf2('0x2c')]);if(_0x5c3a7a[_0xedf2('0x2d')]){delete _0x5c3a7a[_0xedf2('0x2d')];}_0x26456f['status'](_0x1d8fa0)[_0xedf2('0x2e')](_0x5c3a7a);};}exports[_0xedf2('0x2f')]=function(_0x398904,_0x4144ca){var _0x5aade7={},_0x2d3743={},_0x44dcc5={'count':0x0,'rows':[]};var _0x319055=_[_0xedf2('0x30')](db[_0xedf2('0x31')][_0xedf2('0x32')],function(_0x3a40f8){return{'name':_0x3a40f8[_0xedf2('0x33')],'type':_0x3a40f8[_0xedf2('0x34')][_0xedf2('0x35')]};});_0x2d3743['model']=_[_0xedf2('0x30')](_0x319055,_0xedf2('0x2d'));_0x2d3743[_0xedf2('0x36')]=_[_0xedf2('0x37')](_0x398904['query']);_0x2d3743[_0xedf2('0x38')]=_['intersection'](_0x2d3743[_0xedf2('0x39')],_0x2d3743[_0xedf2('0x36')]);_0x5aade7['attributes']=_['intersection'](_0x2d3743[_0xedf2('0x39')],qs['fields'](_0x398904[_0xedf2('0x36')]['fields']));_0x5aade7[_0xedf2('0x3a')]=_0x5aade7[_0xedf2('0x3a')][_0xedf2('0x3b')]?_0x5aade7[_0xedf2('0x3a')]:_0x2d3743['model'];if(!_0x398904[_0xedf2('0x36')][_0xedf2('0x3c')](_0xedf2('0x3d'))){_0x5aade7[_0xedf2('0x20')]=qs[_0xedf2('0x20')](_0x398904[_0xedf2('0x36')][_0xedf2('0x20')]);_0x5aade7['offset']=qs['offset'](_0x398904[_0xedf2('0x36')][_0xedf2('0x22')]);}_0x5aade7[_0xedf2('0x3e')]=qs[_0xedf2('0x3f')](_0x398904['query']['sort']);_0x5aade7[_0xedf2('0x40')]=qs[_0xedf2('0x38')](_[_0xedf2('0x41')](_0x398904['query'],_0x2d3743[_0xedf2('0x38')]),_0x319055);if(_0x398904[_0xedf2('0x36')]['filter']){_0x5aade7[_0xedf2('0x40')]=_[_0xedf2('0x42')](_0x5aade7[_0xedf2('0x40')],{'$or':_['map'](_0x319055,function(_0x47a336){if(_0x47a336[_0xedf2('0x34')]!==_0xedf2('0x43')){var _0x1f106a={};_0x1f106a[_0x47a336[_0xedf2('0x2d')]]={'$like':'%'+_0x398904['query'][_0xedf2('0x44')]+'%'};return _0x1f106a;}})});}_0x5aade7=_['merge']({},_0x5aade7,_0x398904[_0xedf2('0x45')]);var _0x489895={'where':_0x5aade7[_0xedf2('0x40')]};return db[_0xedf2('0x31')]['count'](_0x489895)[_0xedf2('0x29')](function(_0x555cdd){_0x44dcc5[_0xedf2('0x21')]=_0x555cdd;if(_0x398904[_0xedf2('0x36')][_0xedf2('0x46')]){_0x5aade7[_0xedf2('0x47')]=[{'all':!![]}];}return db[_0xedf2('0x31')]['findAll'](_0x5aade7);})['then'](function(_0xd19319){_0x44dcc5[_0xedf2('0x48')]=_0xd19319;return _0x44dcc5;})['then'](respondWithFilteredResult(_0x4144ca,_0x5aade7))[_0xedf2('0x49')](handleError(_0x4144ca,null));};exports[_0xedf2('0x4a')]=function(_0x2b213c,_0x2760bc){var _0x16546b={'raw':![],'where':{'id':_0x2b213c[_0xedf2('0x4b')]['id']}},_0x7cf1a2={};_0x7cf1a2[_0xedf2('0x39')]=_['keys'](db['ServicenowAccount'][_0xedf2('0x32')]);_0x7cf1a2[_0xedf2('0x36')]=_[_0xedf2('0x37')](_0x2b213c['query']);_0x7cf1a2[_0xedf2('0x38')]=_['intersection'](_0x7cf1a2[_0xedf2('0x39')],_0x7cf1a2[_0xedf2('0x36')]);_0x16546b[_0xedf2('0x3a')]=_[_0xedf2('0x4c')](_0x7cf1a2[_0xedf2('0x39')],qs[_0xedf2('0x4d')](_0x2b213c[_0xedf2('0x36')]['fields']));_0x16546b['attributes']=_0x16546b[_0xedf2('0x3a')][_0xedf2('0x3b')]?_0x16546b[_0xedf2('0x3a')]:_0x7cf1a2[_0xedf2('0x39')];if(_0x2b213c[_0xedf2('0x36')][_0xedf2('0x46')]){_0x16546b[_0xedf2('0x47')]=[{'all':!![]}];}_0x16546b=_[_0xedf2('0x42')]({},_0x16546b,_0x2b213c[_0xedf2('0x45')]);return db[_0xedf2('0x31')][_0xedf2('0x4e')](_0x16546b)['then'](handleEntityNotFound(_0x2760bc,null))['then'](respondWithResult(_0x2760bc,null))['catch'](handleError(_0x2760bc,null));};exports[_0xedf2('0x4f')]=function(_0x38c50e,_0x57f2fd){return db[_0xedf2('0x31')][_0xedf2('0x4f')](_0x38c50e[_0xedf2('0x50')],{})[_0xedf2('0x29')](respondWithResult(_0x57f2fd,0xc9))['catch'](handleError(_0x57f2fd,null));};exports[_0xedf2('0x28')]=function(_0x1ef387,_0x27f8d8){if(_0x1ef387[_0xedf2('0x50')]['id']){delete _0x1ef387[_0xedf2('0x50')]['id'];}return db[_0xedf2('0x31')]['find']({'where':{'id':_0x1ef387[_0xedf2('0x4b')]['id']}})[_0xedf2('0x29')](handleEntityNotFound(_0x27f8d8,null))[_0xedf2('0x29')](saveUpdates(_0x1ef387[_0xedf2('0x50')],null))[_0xedf2('0x29')](respondWithResult(_0x27f8d8,null))['catch'](handleError(_0x27f8d8,null));};exports[_0xedf2('0x51')]=function(_0x302129,_0x552c2a){return db['ServicenowAccount'][_0xedf2('0x4e')]({'where':{'id':_0x302129[_0xedf2('0x4b')]['id']}})[_0xedf2('0x29')](handleEntityNotFound(_0x552c2a,null))[_0xedf2('0x29')](removeEntity(_0x552c2a,null))[_0xedf2('0x49')](handleError(_0x552c2a,null));};exports[_0xedf2('0x52')]=function(_0xe70eff,_0x1b2a29,_0x5834aa){var _0xb846e2={};var _0xb5e5ca={};var _0x2f6971;var _0x6b2b1a;return db[_0xedf2('0x31')][_0xedf2('0x53')]({'where':{'id':_0xe70eff[_0xedf2('0x4b')]['id']}})[_0xedf2('0x29')](handleEntityNotFound(_0x1b2a29,null))[_0xedf2('0x29')](function(_0x548000){if(_0x548000){_0x2f6971=_0x548000;_0xb5e5ca['model']=_['keys'](db[_0xedf2('0x54')][_0xedf2('0x32')]);_0xb5e5ca[_0xedf2('0x36')]=_[_0xedf2('0x37')](_0xe70eff['query']);_0xb5e5ca[_0xedf2('0x38')]=_[_0xedf2('0x4c')](_0xb5e5ca['model'],_0xb5e5ca['query']);_0xb846e2[_0xedf2('0x3a')]=_[_0xedf2('0x4c')](_0xb5e5ca['model'],qs[_0xedf2('0x4d')](_0xe70eff['query']['fields']));_0xb846e2[_0xedf2('0x3a')]=_0xb846e2[_0xedf2('0x3a')][_0xedf2('0x3b')]?_0xb846e2['attributes']:_0xb5e5ca['model'];_0xb846e2['order']=qs[_0xedf2('0x3f')](_0xe70eff[_0xedf2('0x36')][_0xedf2('0x3f')]);_0xb846e2[_0xedf2('0x40')]=qs[_0xedf2('0x38')](_['pick'](_0xe70eff[_0xedf2('0x36')],_0xb5e5ca['filters']));if(_0xe70eff[_0xedf2('0x36')]['filter']){_0xb846e2['where']=_[_0xedf2('0x42')](_0xb846e2[_0xedf2('0x40')],{'$or':_[_0xedf2('0x30')](_0xb846e2['attributes'],function(_0x30f5cb){var _0x1e1253={};_0x1e1253[_0x30f5cb]={'$like':'%'+_0xe70eff[_0xedf2('0x36')][_0xedf2('0x44')]+'%'};return _0x1e1253;})});}_0xb846e2=_[_0xedf2('0x42')]({},_0xb846e2,_0xe70eff[_0xedf2('0x45')]);return _0x2f6971[_0xedf2('0x52')](_0xb846e2);}})[_0xedf2('0x29')](function(_0x4ad44d){if(_0x4ad44d){_0x6b2b1a=_0x4ad44d[_0xedf2('0x3b')];if(!_0xe70eff[_0xedf2('0x36')][_0xedf2('0x3c')](_0xedf2('0x3d'))){_0xb846e2[_0xedf2('0x20')]=qs['limit'](_0xe70eff[_0xedf2('0x36')][_0xedf2('0x20')]);_0xb846e2['offset']=qs[_0xedf2('0x22')](_0xe70eff[_0xedf2('0x36')][_0xedf2('0x22')]);}return _0x2f6971[_0xedf2('0x52')](_0xb846e2);}})[_0xedf2('0x29')](function(_0x2276f0){if(_0x2276f0){return _0x2276f0?{'count':_0x6b2b1a,'rows':_0x2276f0}:null;}})[_0xedf2('0x29')](respondWithResult(_0x1b2a29,null))[_0xedf2('0x49')](handleError(_0x1b2a29,null));};exports[_0xedf2('0x55')]=function(_0x5d1c0e,_0x166da6,_0x1dcdee){if(_0x5d1c0e[_0xedf2('0x50')]['id']){delete _0x5d1c0e[_0xedf2('0x50')]['id'];}return db[_0xedf2('0x31')]['findOne']({'where':{'id':_0x5d1c0e['params']['id']}})[_0xedf2('0x29')](handleEntityNotFound(_0x166da6,null))[_0xedf2('0x29')](function(_0x5105e4){if(_0x5105e4){_0x5d1c0e['body'][_0xedf2('0x56')]=_0x5105e4['id'];_0x5d1c0e[_0xedf2('0x50')][_0xedf2('0x57')]=integrations[_0xedf2('0x58')](_0x5d1c0e[_0xedf2('0x50')][_0xedf2('0x59')],_0x5d1c0e[_0xedf2('0x50')][_0xedf2('0x34')]);_0x5d1c0e[_0xedf2('0x50')]['Descriptions']=integrations['getDescriptions'](_0x5d1c0e[_0xedf2('0x50')][_0xedf2('0x59')],_0x5d1c0e['body']['type']);return db[_0xedf2('0x54')]['create'](_0x5d1c0e[_0xedf2('0x50')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0xedf2('0x5a')],'as':_0xedf2('0x5b')}]});}return null;})[_0xedf2('0x29')](respondWithResult(_0x166da6,null))[_0xedf2('0x49')](handleError(_0x166da6,null));};exports[_0xedf2('0x5c')]=function(_0x3ce318,_0x32cd20,_0xf696f5){var _0x4ff2c1=['made_sla',_0xedf2('0x5d'),_0xedf2('0x5e'),_0xedf2('0x5f'),'close_code',_0xedf2('0x60'),'incident_state',_0xedf2('0x61'),_0xedf2('0x62')];var _0x2ae79f=[_0xedf2('0x63'),_0xedf2('0x64'),_0xedf2('0x65'),_0xedf2('0x66'),_0xedf2('0x67'),_0xedf2('0x68'),'child_incidents',_0xedf2('0x5d'),_0xedf2('0x69'),_0xedf2('0x6a'),_0xedf2('0x6b'),'sys_updated_by',_0xedf2('0x6c'),_0xedf2('0x6d'),'sys_created_on',_0xedf2('0x6e'),_0xedf2('0x6f'),'sys_created_by','knowledge','order','calendar_stc',_0xedf2('0x70'),_0xedf2('0x71'),'delivery_plan',_0xedf2('0x72'),_0xedf2('0x73'),_0xedf2('0x74'),'business_service',_0xedf2('0x75'),_0xedf2('0x76'),'rfc',_0xedf2('0x77'),_0xedf2('0x78'),'opened_at',_0xedf2('0x79'),'group_list','work_end',_0xedf2('0x7a'),_0xedf2('0x7b'),'caller_id',_0xedf2('0x7c'),_0xedf2('0x5f'),_0xedf2('0x7d'),_0xedf2('0x7e'),'close_code',_0xedf2('0x7f'),_0xedf2('0x80'),_0xedf2('0x81'),_0xedf2('0x82'),'business_stc',_0xedf2('0x83'),'description',_0xedf2('0x84'),'notify',_0xedf2('0x85'),'close_notes',_0xedf2('0x86'),_0xedf2('0x87'),_0xedf2('0x88'),_0xedf2('0x89'),_0xedf2('0x8a'),'reopened_by',_0xedf2('0x8b'),_0xedf2('0x8c'),_0xedf2('0x8d'),_0xedf2('0x8e'),_0xedf2('0x8f'),_0xedf2('0x90'),'assigned_to','severity',_0xedf2('0x91'),_0xedf2('0x92'),_0xedf2('0x93'),_0xedf2('0x94'),_0xedf2('0x95'),_0xedf2('0x96'),_0xedf2('0x97'),_0xedf2('0x98'),_0xedf2('0x99'),'upon_approval',_0xedf2('0x9a'),'location','category'];var _0x461a01='';var _0x49e87f='';var _0xca21d0=[];var _0x3908e0='';var _0x36e599='';var _0x1d529a=[];var _0x71abdd='';var _0xbffe14='';var _0x591a58={};var _0x134779='';return db['ServicenowAccount'][_0xedf2('0x53')]({'where':{'id':_0x3ce318[_0xedf2('0x4b')]['id']},'attributes':['id',_0xedf2('0x9b'),_0xedf2('0x9c'),_0xedf2('0x9d'),_0xedf2('0x9e'),'serverUrl']})[_0xedf2('0x29')](handleEntityNotFound(_0x32cd20,null))[_0xedf2('0x29')](function(_0x96fc19){if(_0x96fc19){_0x134779=_0x96fc19[_0xedf2('0x9e')];var _0x17038b=_0x134779[_0xedf2('0x9f')](-0x1);if(_0x17038b==='/'){_0x134779=_0x134779[_0xedf2('0xa0')](0x0,_0x134779[_0xedf2('0xa1')](_0x17038b));}_0xbffe14=util[_0xedf2('0xa2')](_0xedf2('0xa3'),_0x134779);_0x71abdd=util[_0xedf2('0xa2')]('%s/api/now/table/',_0x134779);_0x591a58={'user':_0x96fc19['username'],'pass':_0x96fc19[_0xedf2('0x9c')]};var _0xa3409c={'method':'GET','uri':_0xbffe14+'incident?sysparm_display_value=all','auth':_0x591a58,'json':!![]};return rp(_0xa3409c);}})[_0xedf2('0x29')](function(_0x5b812b){if(_0x5b812b['result']['length']>0x0){_0x461a01=_0x5b812b['result'];}console['log'](_0xedf2('0xa4'),_0x461a01);_0x1d529a=[];_0x49e87f=Object[_0xedf2('0xa5')]([],_0x461a01);_[_0xedf2('0xa6')](_0x49e87f,function(_0x1a9773){return!_0x4ff2c1[_0xedf2('0xa7')](_0x1a9773['name']);});_0x49e87f[_0xedf2('0xa8')](function(_0x350957){var _0x2eda31=createFieldObject(_0x71abdd,_0x591a58,_0x350957[_0xedf2('0xa9')],_0x350957['name'],_0x350957[_0xedf2('0xaa')],![]);_0x1d529a['push'](_0x2eda31);});return Promise[_0xedf2('0xab')](_0x1d529a);})[_0xedf2('0x29')](function(_0x52e5dc){_0xca21d0=_0x52e5dc;_0x3908e0=Object[_0xedf2('0xa5')]([],_0x461a01);console[_0xedf2('0xac')](_0xedf2('0xad'),_0x461a01);_[_0xedf2('0xa6')](_0x3908e0,function(_0x2479e1){return _0x2ae79f[_0xedf2('0xa7')](_0x2479e1[_0xedf2('0x2d')]);});console[_0xedf2('0xac')](_0xedf2('0xae'),_0x3908e0);_0x1d529a=[];_0x3908e0[_0xedf2('0xa8')](function(_0x5e2d50){var _0x4aadb8=createFieldObject(_0x71abdd,_0x591a58,_0x5e2d50[_0xedf2('0xa9')],_0x5e2d50[_0xedf2('0x2d')],_0x5e2d50['label'],!![]);_0x1d529a['push'](_0x4aadb8);});return Promise['all'](_0x1d529a);})[_0xedf2('0x29')](function(_0x3e7a2a){_0x36e599=_0x3e7a2a;var _0xc3ca04=_0xca21d0[_0xedf2('0xaf')](_0x36e599);return{'count':_0xc3ca04[_0xedf2('0x3b')],'rows':_0xc3ca04};})[_0xedf2('0x29')](respondWithResult(_0x32cd20,null))[_0xedf2('0x49')](function(_0x165e30){console[_0xedf2('0xac')]('ServiceNow\x20error:\x20'+_0x165e30);var _0x45c0eb=_0x3ce318[_0xedf2('0x36')][_0xedf2('0xb0')]?0x1f4:_0x165e30[_0xedf2('0xb1')]||0x1f4;logger[_0xedf2('0x2b')](_0x165e30[_0xedf2('0x2c')]);delete _0x165e30['name'];if(_0x45c0eb===0x191){_0x45c0eb=0x190;}_0x32cd20[_0xedf2('0x1d')](_0x45c0eb)[_0xedf2('0x2e')](_0x3ce318[_0xedf2('0x36')][_0xedf2('0xb0')]?{'message':_0xedf2('0xb2'),'statusCode':_0x165e30['statusCode']}:_0x165e30);});};function createFieldObject(_0x2ecb39,_0x324624,_0x44618b,_0x4a0b56,_0x5121b1,_0x183893){return new Promise(function(_0x578482,_0x1e90b4){var _0x568873={'id':_0x4a0b56,'name':_0x5121b1,'custom':_0x183893};if(_0x44618b==='boolean'){_0x568873[_0xedf2('0x45')]=[{'name':_0xedf2('0xb3'),'value':_0xedf2('0xb4')},{'name':'False','value':'false'}];_0x578482(_0x568873);}else{var _0x4a25b4={'method':'GET','uri':_0x2ecb39+'sys_choice?sysparm_query=name=incident^element='+_0x4a0b56,'auth':_0x324624,'json':!![]};return rp(_0x4a25b4)['then'](function(_0x444556){var _0xe4592c=[];if(_0x444556[_0xedf2('0xb5')][_0xedf2('0x3b')]>0x0){_0x444556['result'][_0xedf2('0xa8')](function(_0x327b00){if(_0x327b00['inactive']===_0xedf2('0xb6')){var _0x5807ff={'name':_0x327b00['label'],'value':_0x327b00[_0xedf2('0xb7')]};_0xe4592c[_0xedf2('0xb8')](_0x5807ff);}});}_0x568873[_0xedf2('0x45')]=_0xe4592c;if(_0x568873['options']['length']>0x0){_0x578482(_0x568873);}else{if(_0x183893==![]){_0x578482();}else{_0x578482(_0x568873);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1e033fb..a164b0b 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 _0xdbf5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x327c40,_0x72ce79){var _0x3bba2d=function(_0x42d50f){while(--_0x42d50f){_0x327c40['push'](_0x327c40['shift']());}};_0x3bba2d(++_0x72ce79);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x317f15,_0xe676bc){_0x317f15=_0x317f15-0x0;var _0x4ecc99=_0xdbf5[_0x317f15];return _0x4ecc99;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));var integrations=require(_0x5dbf('0x8'));module[_0x5dbf('0x9')]=function(_0x3f8222,_0x209b7d){return _0x3f8222[_0x5dbf('0xa')](_0x5dbf('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x326c20,_0x5eaf59){_0x326c20=_0x326c20-0x0;var _0x2b41f3=_0x3f8a[_0x326c20];return _0x2b41f3;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'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 cf00de4..c239e93 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 _0xf0db=['raw','where','limit','map','include','model','attributes','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','findAll','options'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf0db,0x1c8));var _0xbf0d=function(_0x1bafb1,_0x3f4d43){_0x1bafb1=_0x1bafb1-0x0;var _0x1e9aa9=_0xf0db[_0x1bafb1];return _0x1e9aa9;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var moment=require(_0xbf0d('0x2'));var BPromise=require(_0xbf0d('0x3'));var rs=require(_0xbf0d('0x4'));var fs=require('fs');var Redis=require(_0xbf0d('0x5'));var db=require(_0xbf0d('0x6'))['db'];var utils=require(_0xbf0d('0x7'));var logger=require(_0xbf0d('0x8'))(_0xbf0d('0x9'));var config=require('../../config/environment');var jayson=require(_0xbf0d('0xa'));var client=jayson[_0xbf0d('0xb')][_0xbf0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4bbd1f,_0x2b2772,_0x3ca03c){return new BPromise(function(_0x45ec6a,_0x123bc4){return client['request'](_0x4bbd1f,_0x3ca03c)[_0xbf0d('0xd')](function(_0x39cf04){logger['info'](_0xbf0d('0xe'),_0x2b2772,_0xbf0d('0xf'));logger[_0xbf0d('0x10')](_0xbf0d('0x11'),_0x2b2772,'request\x20sent',JSON['stringify'](_0x39cf04));if(_0x39cf04[_0xbf0d('0x12')]){if(_0x39cf04['error'][_0xbf0d('0x13')]===0x1f4){logger[_0xbf0d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x2b2772,_0x39cf04[_0xbf0d('0x12')][_0xbf0d('0x14')]);return _0x123bc4(_0x39cf04[_0xbf0d('0x12')][_0xbf0d('0x14')]);}logger[_0xbf0d('0x12')](_0xbf0d('0xe'),_0x2b2772,_0x39cf04[_0xbf0d('0x12')]['message']);return _0x45ec6a(_0x39cf04[_0xbf0d('0x12')]['message']);}else{logger[_0xbf0d('0x15')](_0xbf0d('0xe'),_0x2b2772,_0xbf0d('0xf'));_0x45ec6a(_0x39cf04[_0xbf0d('0x16')][_0xbf0d('0x14')]);}})['catch'](function(_0x43e943){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2b2772,_0x43e943);_0x123bc4(_0x43e943);});});}exports['GetServicenowAccount']=function(_0x161390){var _0xff867e=this;return new Promise(function(_0x2dfed8,_0x4ea94a){return db['ServicenowAccount'][_0xbf0d('0x17')]({'raw':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')][_0xbf0d('0x19')]===undefined?!![]:![]:!![],'where':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')][_0xbf0d('0x1a')]||null:null,'attributes':_0x161390[_0xbf0d('0x18')]?_0x161390[_0xbf0d('0x18')]['attributes']||null:null,'limit':_0x161390['options']?_0x161390['options'][_0xbf0d('0x1b')]||null:null,'include':_0x161390['options']?_0x161390[_0xbf0d('0x18')]['include']?_[_0xbf0d('0x1c')](_0x161390[_0xbf0d('0x18')][_0xbf0d('0x1d')],function(_0x27356d){return{'model':db[_0x27356d[_0xbf0d('0x1e')]],'as':_0x27356d['as'],'attributes':_0x27356d[_0xbf0d('0x1f')],'include':_0x27356d[_0xbf0d('0x1d')]?_['map'](_0x27356d[_0xbf0d('0x1d')],function(_0x5506e5){return{'model':db[_0x5506e5[_0xbf0d('0x1e')]],'as':_0x5506e5['as'],'attributes':_0x5506e5['attributes'],'include':_0x5506e5[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x5506e5[_0xbf0d('0x1d')],function(_0x3992e6){return{'model':db[_0x3992e6['model']],'as':_0x3992e6['as'],'attributes':_0x3992e6[_0xbf0d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf0d('0xd')](function(_0x4f01e4){logger[_0xbf0d('0x15')](_0xbf0d('0x20'),_0x161390);logger[_0xbf0d('0x10')](_0xbf0d('0x20'),_0x161390,JSON[_0xbf0d('0x21')](_0x4f01e4));_0x2dfed8(_0x4f01e4);})['catch'](function(_0x5e7123){logger[_0xbf0d('0x12')](_0xbf0d('0x20'),_0x5e7123[_0xbf0d('0x14')],_0x161390);_0x4ea94a(_0xff867e['error'](0x1f4,_0x5e7123[_0xbf0d('0x14')]));});});};exports[_0xbf0d('0x22')]=function(_0x1c4b58){var _0x3ebf0c=this;return new Promise(function(_0x243f37,_0x26e9d2){return db[_0xbf0d('0x23')][_0xbf0d('0x24')]({'raw':_0x1c4b58[_0xbf0d('0x18')]?_0x1c4b58[_0xbf0d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1c4b58[_0xbf0d('0x18')]?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1a')]||null:null,'attributes':_0x1c4b58['options']?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1f')]||null:null,'include':_0x1c4b58['options']?_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x1c4b58[_0xbf0d('0x18')][_0xbf0d('0x1d')],function(_0x5ef1f1){return{'model':db[_0x5ef1f1['model']],'as':_0x5ef1f1['as'],'attributes':_0x5ef1f1[_0xbf0d('0x1f')],'include':_0x5ef1f1[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x5ef1f1[_0xbf0d('0x1d')],function(_0x232987){return{'model':db[_0x232987[_0xbf0d('0x1e')]],'as':_0x232987['as'],'attributes':_0x232987['attributes'],'include':_0x232987[_0xbf0d('0x1d')]?_[_0xbf0d('0x1c')](_0x232987['include'],function(_0x207452){return{'model':db[_0x207452[_0xbf0d('0x1e')]],'as':_0x207452['as'],'attributes':_0x207452['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf0d('0xd')](function(_0x4857ff){logger[_0xbf0d('0x15')](_0xbf0d('0x22'),_0x1c4b58);logger[_0xbf0d('0x10')](_0xbf0d('0x22'),_0x1c4b58,JSON[_0xbf0d('0x21')](_0x4857ff));_0x243f37(_0x4857ff);})['catch'](function(_0x555a91){logger['error'](_0xbf0d('0x22'),_0x555a91[_0xbf0d('0x14')],_0x1c4b58);_0x26e9d2(_0x3ebf0c[_0xbf0d('0x12')](0x1f4,_0x555a91[_0xbf0d('0x14')]));});});}; \ No newline at end of file +var _0x6e2a=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57d615,_0xfed276){var _0x593c99=function(_0x1d3eb1){while(--_0x1d3eb1){_0x57d615['push'](_0x57d615['shift']());}};_0x593c99(++_0xfed276);}(_0x6e2a,0x12b));var _0xa6e2=function(_0x2d946d,_0x4c2c73){_0x2d946d=_0x2d946d-0x0;var _0x4872fa=_0x6e2a[_0x2d946d];return _0x4872fa;};'use strict';var _=require(_0xa6e2('0x0'));var util=require(_0xa6e2('0x1'));var moment=require(_0xa6e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6e2('0x3'));var fs=require('fs');var Redis=require(_0xa6e2('0x4'));var db=require(_0xa6e2('0x5'))['db'];var utils=require(_0xa6e2('0x6'));var logger=require(_0xa6e2('0x7'))(_0xa6e2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa6e2('0x9')][_0xa6e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57b386,_0x11071a,_0x5023f7){return new BPromise(function(_0x23a198,_0x4da2bd){return client[_0xa6e2('0xb')](_0x57b386,_0x5023f7)[_0xa6e2('0xc')](function(_0x1c69d6){logger['info'](_0xa6e2('0xd'),_0x11071a,_0xa6e2('0xe'));logger[_0xa6e2('0xf')](_0xa6e2('0x10'),_0x11071a,_0xa6e2('0xe'),JSON[_0xa6e2('0x11')](_0x1c69d6));if(_0x1c69d6[_0xa6e2('0x12')]){if(_0x1c69d6[_0xa6e2('0x12')][_0xa6e2('0x13')]===0x1f4){logger[_0xa6e2('0x12')](_0xa6e2('0xd'),_0x11071a,_0x1c69d6[_0xa6e2('0x12')][_0xa6e2('0x14')]);return _0x4da2bd(_0x1c69d6['error'][_0xa6e2('0x14')]);}logger[_0xa6e2('0x12')](_0xa6e2('0xd'),_0x11071a,_0x1c69d6[_0xa6e2('0x12')][_0xa6e2('0x14')]);return _0x23a198(_0x1c69d6[_0xa6e2('0x12')][_0xa6e2('0x14')]);}else{logger[_0xa6e2('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x11071a,_0xa6e2('0xe'));_0x23a198(_0x1c69d6['result'][_0xa6e2('0x14')]);}})[_0xa6e2('0x16')](function(_0x115e43){logger[_0xa6e2('0x12')](_0xa6e2('0xd'),_0x11071a,_0x115e43);_0x4da2bd(_0x115e43);});});}exports[_0xa6e2('0x17')]=function(_0x3d4f18){var _0x192bd7=this;return new Promise(function(_0x5c9f48,_0x501b2f){return db[_0xa6e2('0x18')][_0xa6e2('0x19')]({'raw':_0x3d4f18['options']?_0x3d4f18[_0xa6e2('0x1a')][_0xa6e2('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d4f18[_0xa6e2('0x1a')]?_0x3d4f18[_0xa6e2('0x1a')][_0xa6e2('0x1c')]||null:null,'attributes':_0x3d4f18[_0xa6e2('0x1a')]?_0x3d4f18['options'][_0xa6e2('0x1d')]||null:null,'limit':_0x3d4f18['options']?_0x3d4f18[_0xa6e2('0x1a')][_0xa6e2('0x1e')]||null:null,'include':_0x3d4f18[_0xa6e2('0x1a')]?_0x3d4f18[_0xa6e2('0x1a')]['include']?_[_0xa6e2('0x1f')](_0x3d4f18[_0xa6e2('0x1a')][_0xa6e2('0x20')],function(_0x207670){return{'model':db[_0x207670['model']],'as':_0x207670['as'],'attributes':_0x207670['attributes'],'include':_0x207670[_0xa6e2('0x20')]?_['map'](_0x207670['include'],function(_0xb78c8d){return{'model':db[_0xb78c8d[_0xa6e2('0x21')]],'as':_0xb78c8d['as'],'attributes':_0xb78c8d[_0xa6e2('0x1d')],'include':_0xb78c8d[_0xa6e2('0x20')]?_[_0xa6e2('0x1f')](_0xb78c8d[_0xa6e2('0x20')],function(_0x43f8ab){return{'model':db[_0x43f8ab[_0xa6e2('0x21')]],'as':_0x43f8ab['as'],'attributes':_0x43f8ab[_0xa6e2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa6e2('0xc')](function(_0x4b7f5d){logger[_0xa6e2('0x15')](_0xa6e2('0x17'),_0x3d4f18);logger['debug']('GetServicenowAccount',_0x3d4f18,JSON[_0xa6e2('0x11')](_0x4b7f5d));_0x5c9f48(_0x4b7f5d);})[_0xa6e2('0x16')](function(_0x28d8fb){logger[_0xa6e2('0x12')](_0xa6e2('0x17'),_0x28d8fb[_0xa6e2('0x14')],_0x3d4f18);_0x501b2f(_0x192bd7[_0xa6e2('0x12')](0x1f4,_0x28d8fb[_0xa6e2('0x14')]));});});};exports[_0xa6e2('0x22')]=function(_0x21674b){var _0x5d9bf1=this;return new Promise(function(_0x225ef3,_0x194b09){return db[_0xa6e2('0x18')]['find']({'raw':_0x21674b[_0xa6e2('0x1a')]?_0x21674b['options'][_0xa6e2('0x1b')]===undefined?!![]:![]:!![],'where':_0x21674b[_0xa6e2('0x1a')]?_0x21674b[_0xa6e2('0x1a')][_0xa6e2('0x1c')]||null:null,'attributes':_0x21674b[_0xa6e2('0x1a')]?_0x21674b[_0xa6e2('0x1a')][_0xa6e2('0x1d')]||null:null,'include':_0x21674b[_0xa6e2('0x1a')]?_0x21674b[_0xa6e2('0x1a')][_0xa6e2('0x20')]?_[_0xa6e2('0x1f')](_0x21674b['options']['include'],function(_0x3f3cf5){return{'model':db[_0x3f3cf5[_0xa6e2('0x21')]],'as':_0x3f3cf5['as'],'attributes':_0x3f3cf5[_0xa6e2('0x1d')],'include':_0x3f3cf5[_0xa6e2('0x20')]?_[_0xa6e2('0x1f')](_0x3f3cf5[_0xa6e2('0x20')],function(_0x2c2bd4){return{'model':db[_0x2c2bd4[_0xa6e2('0x21')]],'as':_0x2c2bd4['as'],'attributes':_0x2c2bd4[_0xa6e2('0x1d')],'include':_0x2c2bd4[_0xa6e2('0x20')]?_['map'](_0x2c2bd4['include'],function(_0x567f2e){return{'model':db[_0x567f2e[_0xa6e2('0x21')]],'as':_0x567f2e['as'],'attributes':_0x567f2e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa6e2('0xc')](function(_0xcb8a3){logger['info'](_0xa6e2('0x22'),_0x21674b);logger[_0xa6e2('0xf')](_0xa6e2('0x22'),_0x21674b,JSON[_0xa6e2('0x11')](_0xcb8a3));_0x225ef3(_0xcb8a3);})[_0xa6e2('0x16')](function(_0x115481){logger['error']('ShowServicenowAccount',_0x115481[_0xa6e2('0x14')],_0x21674b);_0x194b09(_0x5d9bf1[_0xa6e2('0x12')](0x1f4,_0x115481[_0xa6e2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c21bb89..9861b03 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 _0xb16d=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x26df53,_0xb72f1f){var _0x347d69=function(_0x1e01ca){while(--_0x1e01ca){_0x26df53['push'](_0x26df53['shift']());}};_0x347d69(++_0xb72f1f);}(_0xb16d,0x191));var _0xdb16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb16d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdb16('0x0'));var util=require(_0xdb16('0x1'));var path=require(_0xdb16('0x2'));var timeout=require(_0xdb16('0x3'));var express=require('express');var router=express[_0xdb16('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdb16('0x5'));var interaction=require(_0xdb16('0x6'));var config=require(_0xdb16('0x7'));var controller=require(_0xdb16('0x8'));router['get']('/',auth[_0xdb16('0x9')](),controller[_0xdb16('0xa')]);router[_0xdb16('0xb')](_0xdb16('0xc'),auth[_0xdb16('0x9')](),controller[_0xdb16('0xd')]);router[_0xdb16('0xb')](_0xdb16('0xe'),auth[_0xdb16('0x9')](),controller[_0xdb16('0xf')]);router[_0xdb16('0xb')](_0xdb16('0x10'),auth[_0xdb16('0x9')](),controller[_0xdb16('0x11')]);router[_0xdb16('0xb')](_0xdb16('0x12'),auth['isAuthenticated'](),controller[_0xdb16('0x13')]);router['post']('/',auth[_0xdb16('0x9')](),controller['create']);router[_0xdb16('0x14')](_0xdb16('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb16('0xc'),auth[_0xdb16('0x9')](),controller[_0xdb16('0x15')]);module[_0xdb16('0x16')]=router; \ No newline at end of file +var _0x1d5c=['express','fs-extra','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x26f7c9,_0x1f8e83){var _0x44712d=function(_0x2a7967){while(--_0x2a7967){_0x26f7c9['push'](_0x26f7c9['shift']());}};_0x44712d(++_0x1f8e83);}(_0x1d5c,0x8f));var _0xc1d5=function(_0x178d95,_0x5880c1){_0x178d95=_0x178d95-0x0;var _0x55688c=_0x1d5c[_0x178d95];return _0x55688c;};'use strict';var multer=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var path=require(_0xc1d5('0x2'));var timeout=require(_0xc1d5('0x3'));var express=require(_0xc1d5('0x4'));var router=express['Router']();var fs_extra=require(_0xc1d5('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc1d5('0x6'));router['get']('/',auth[_0xc1d5('0x7')](),controller[_0xc1d5('0x8')]);router[_0xc1d5('0x9')](_0xc1d5('0xa'),auth[_0xc1d5('0x7')](),controller[_0xc1d5('0xb')]);router[_0xc1d5('0x9')]('/:id/fields',auth[_0xc1d5('0x7')](),controller[_0xc1d5('0xc')]);router['get']('/:id/subjects',auth[_0xc1d5('0x7')](),controller[_0xc1d5('0xd')]);router[_0xc1d5('0x9')](_0xc1d5('0xe'),auth[_0xc1d5('0x7')](),controller[_0xc1d5('0xf')]);router[_0xc1d5('0x10')]('/',auth[_0xc1d5('0x7')](),controller['create']);router[_0xc1d5('0x11')]('/:id',auth[_0xc1d5('0x7')](),controller['update']);router[_0xc1d5('0x12')](_0xc1d5('0xa'),auth[_0xc1d5('0x7')](),controller[_0xc1d5('0x13')]);module[_0xc1d5('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d6e02fd..c1554fe 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 _0xde6a=['sequelize','exports','STRING'];(function(_0x4ee9c1,_0x55003e){var _0x49ce20=function(_0x129721){while(--_0x129721){_0x4ee9c1['push'](_0x4ee9c1['shift']());}};_0x49ce20(++_0x55003e);}(_0xde6a,0x11a));var _0xade6=function(_0x4e2337,_0x196364){_0x4e2337=_0x4e2337-0x0;var _0x9afca2=_0xde6a[_0x4e2337];return _0x9afca2;};'use strict';var Sequelize=require(_0xade6('0x0'));module[_0xade6('0x1')]={'name':{'type':Sequelize[_0xade6('0x2')]},'description':{'type':Sequelize[_0xade6('0x2')]}}; \ No newline at end of file +var _0x050c=['sequelize','STRING'];(function(_0x56df3b,_0x3353df){var _0x44684c=function(_0x4c7b7d){while(--_0x4c7b7d){_0x56df3b['push'](_0x56df3b['shift']());}};_0x44684c(++_0x3353df);}(_0x050c,0xdc));var _0xc050=function(_0x298219,_0x1eee25){_0x298219=_0x298219-0x0;var _0x1f2118=_0x050c[_0x298219];return _0x1f2118;};'use strict';var Sequelize=require(_0xc050('0x0'));module['exports']={'name':{'type':Sequelize[_0xc050('0x1')]},'description':{'type':Sequelize[_0xc050('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a9398c3..9bf28f1 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 _0x1a19=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','destroy','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1a19,0xf4));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91a1('0x0'));var rimraf=require(_0x91a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91a1('0x2'));var rp=require(_0x91a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x91a1('0x4'));var ejs=require(_0x91a1('0x5'));var fs=require('fs');var fs_extra=require(_0x91a1('0x6'));var _=require(_0x91a1('0x7'));var squel=require(_0x91a1('0x8'));var crypto=require(_0x91a1('0x9'));var jsforce=require(_0x91a1('0xa'));var deskjs=require(_0x91a1('0xb'));var toCsv=require(_0x91a1('0x4'));var querystring=require(_0x91a1('0xc'));var Papa=require(_0x91a1('0xd'));var Redis=require(_0x91a1('0xe'));var authService=require(_0x91a1('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91a1('0x10'));var logger=require(_0x91a1('0x11'))(_0x91a1('0x12'));var utils=require(_0x91a1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1cb9,_0x1ab19f){_0x1ab19f=_0x1ab19f||0xcc;return function(_0x3203c0){if(_0x3203c0){return _0x4b1cb9[_0x91a1('0x14')](_0x1ab19f);}return _0x4b1cb9[_0x91a1('0x15')](_0x1ab19f)[_0x91a1('0x16')]();};}function respondWithResult(_0x3699d0,_0x2ef964){_0x2ef964=_0x2ef964||0xc8;return function(_0x2d8b96){if(_0x2d8b96){return _0x3699d0[_0x91a1('0x15')](_0x2ef964)[_0x91a1('0x17')](_0x2d8b96);}};}function respondWithFilteredResult(_0x1a1e8f,_0xf228d4){return function(_0x386604){if(_0x386604){var _0x4ecb67=typeof _0xf228d4['offset']==='undefined'&&typeof _0xf228d4[_0x91a1('0x18')]===_0x91a1('0x19');var _0x48dd7e=_0x386604[_0x91a1('0x1a')];var _0x11d294=_0x4ecb67?0x0:_0xf228d4[_0x91a1('0x1b')];var _0x4b4c6a=_0x4ecb67?_0x386604['count']:_0xf228d4[_0x91a1('0x1b')]+_0xf228d4[_0x91a1('0x18')];var _0x990c54;if(_0x4b4c6a>=_0x48dd7e){_0x4b4c6a=_0x48dd7e;_0x990c54=0xc8;}else{_0x990c54=0xce;}_0x1a1e8f[_0x91a1('0x15')](_0x990c54);return _0x1a1e8f[_0x91a1('0x1c')](_0x91a1('0x1d'),_0x11d294+'-'+_0x4b4c6a+'/'+_0x48dd7e)[_0x91a1('0x17')](_0x386604);}return null;};}function patchUpdates(_0xf32e72){return function(_0x536412){try{jsonpatch['apply'](_0x536412,_0xf32e72,!![]);}catch(_0x4f173f){return BPromise[_0x91a1('0x1e')](_0x4f173f);}return _0x536412[_0x91a1('0x1f')]();};}function saveUpdates(_0x37acbe,_0x58986e){return function(_0x50e83a){if(_0x50e83a){return _0x50e83a['update'](_0x37acbe)['then'](function(_0x3e7d29){return _0x3e7d29;});}return null;};}function removeEntity(_0x1ac24c,_0xa0e6a4){return function(_0x321067){if(_0x321067){return _0x321067['destroy']()[_0x91a1('0x20')](function(){_0x1ac24c['status'](0xcc)[_0x91a1('0x16')]();});}};}function handleEntityNotFound(_0xc7b3a,_0x3c7e16){return function(_0x2b15fa){if(!_0x2b15fa){_0xc7b3a[_0x91a1('0x14')](0x194);}return _0x2b15fa;};}function handleError(_0x193234,_0x102096){_0x102096=_0x102096||0x1f4;return function(_0x13669f){logger['error'](_0x13669f['stack']);if(_0x13669f['name']){delete _0x13669f[_0x91a1('0x21')];}_0x193234[_0x91a1('0x15')](_0x102096)[_0x91a1('0x22')](_0x13669f);};}exports[_0x91a1('0x23')]=function(_0x48d21b,_0x5268f0){var _0x1e194d={},_0x5b2c25={},_0x13acd2={'count':0x0,'rows':[]};var _0x31778b=_[_0x91a1('0x24')](db[_0x91a1('0x25')][_0x91a1('0x26')],function(_0x591d63){return{'name':_0x591d63[_0x91a1('0x27')],'type':_0x591d63[_0x91a1('0x28')]['key']};});_0x5b2c25[_0x91a1('0x29')]=_[_0x91a1('0x24')](_0x31778b,_0x91a1('0x21'));_0x5b2c25[_0x91a1('0x2a')]=_['keys'](_0x48d21b['query']);_0x5b2c25[_0x91a1('0x2b')]=_['intersection'](_0x5b2c25['model'],_0x5b2c25[_0x91a1('0x2a')]);_0x1e194d[_0x91a1('0x2c')]=_['intersection'](_0x5b2c25[_0x91a1('0x29')],qs[_0x91a1('0x2d')](_0x48d21b['query'][_0x91a1('0x2d')]));_0x1e194d[_0x91a1('0x2c')]=_0x1e194d[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0x1e194d[_0x91a1('0x2c')]:_0x5b2c25[_0x91a1('0x29')];if(!_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0x1e194d[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x48d21b['query'][_0x91a1('0x18')]);_0x1e194d[_0x91a1('0x1b')]=qs['offset'](_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x1b')]);}_0x1e194d[_0x91a1('0x31')]=qs['sort'](_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x32')]);_0x1e194d[_0x91a1('0x33')]=qs['filters'](_['pick'](_0x48d21b['query'],_0x5b2c25[_0x91a1('0x2b')]),_0x31778b);if(_0x48d21b['query'][_0x91a1('0x34')]){_0x1e194d['where']=_[_0x91a1('0x35')](_0x1e194d[_0x91a1('0x33')],{'$or':_[_0x91a1('0x24')](_0x31778b,function(_0xb344a6){if(_0xb344a6['type']!==_0x91a1('0x36')){var _0x4de763={};_0x4de763[_0xb344a6[_0x91a1('0x21')]]={'$like':'%'+_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x4de763;}})});}_0x1e194d=_[_0x91a1('0x35')]({},_0x1e194d,_0x48d21b[_0x91a1('0x37')]);var _0x28b6ab={'where':_0x1e194d[_0x91a1('0x33')]};return db[_0x91a1('0x25')][_0x91a1('0x1a')](_0x28b6ab)['then'](function(_0x505691){_0x13acd2[_0x91a1('0x1a')]=_0x505691;if(_0x48d21b[_0x91a1('0x2a')][_0x91a1('0x38')]){_0x1e194d[_0x91a1('0x39')]=[{'all':!![]}];}return db[_0x91a1('0x25')][_0x91a1('0x3a')](_0x1e194d);})[_0x91a1('0x20')](function(_0x3a4381){_0x13acd2[_0x91a1('0x3b')]=_0x3a4381;return _0x13acd2;})[_0x91a1('0x20')](respondWithFilteredResult(_0x5268f0,_0x1e194d))[_0x91a1('0x3c')](handleError(_0x5268f0,null));};exports[_0x91a1('0x3d')]=function(_0x562b89,_0x48e53b){var _0x3fa231={'raw':![],'where':{'id':_0x562b89[_0x91a1('0x3e')]['id']}},_0x2ff80b={};_0x2ff80b[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db[_0x91a1('0x25')]['rawAttributes']);_0x2ff80b['query']=_[_0x91a1('0x3f')](_0x562b89['query']);_0x2ff80b[_0x91a1('0x2b')]=_['intersection'](_0x2ff80b['model'],_0x2ff80b[_0x91a1('0x2a')]);_0x3fa231[_0x91a1('0x2c')]=_[_0x91a1('0x40')](_0x2ff80b[_0x91a1('0x29')],qs['fields'](_0x562b89[_0x91a1('0x2a')][_0x91a1('0x2d')]));_0x3fa231[_0x91a1('0x2c')]=_0x3fa231['attributes'][_0x91a1('0x2e')]?_0x3fa231['attributes']:_0x2ff80b[_0x91a1('0x29')];if(_0x562b89['query'][_0x91a1('0x38')]){_0x3fa231[_0x91a1('0x39')]=[{'all':!![]}];}_0x3fa231=_[_0x91a1('0x35')]({},_0x3fa231,_0x562b89[_0x91a1('0x37')]);return db[_0x91a1('0x25')][_0x91a1('0x41')](_0x3fa231)['then'](handleEntityNotFound(_0x48e53b,null))['then'](respondWithResult(_0x48e53b,null))[_0x91a1('0x3c')](handleError(_0x48e53b,null));};exports[_0x91a1('0x42')]=function(_0x5b4f56,_0x44b578){return db['ServicenowConfiguration'][_0x91a1('0x42')](_0x5b4f56[_0x91a1('0x43')],{})['then'](respondWithResult(_0x44b578,0xc9))['catch'](handleError(_0x44b578,null));};exports['update']=function(_0x1c849f,_0x11885c){if(_0x1c849f[_0x91a1('0x43')]['id']){delete _0x1c849f['body']['id'];}return db[_0x91a1('0x25')][_0x91a1('0x41')]({'where':{'id':_0x1c849f[_0x91a1('0x3e')]['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x11885c,null))[_0x91a1('0x20')](saveUpdates(_0x1c849f[_0x91a1('0x43')],null))['then'](respondWithResult(_0x11885c,null))[_0x91a1('0x3c')](handleError(_0x11885c,null));};exports[_0x91a1('0x44')]=function(_0x1575f3,_0x5a7818){return db[_0x91a1('0x25')][_0x91a1('0x41')]({'where':{'id':_0x1575f3['params']['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x5a7818,null))[_0x91a1('0x20')](removeEntity(_0x5a7818,null))[_0x91a1('0x3c')](handleError(_0x5a7818,null));};exports[_0x91a1('0x45')]=function(_0x2af1f8,_0x351af1,_0x3a7255){var _0xbe6753={};var _0x334c75={};var _0x48ad7f;var _0x3bc64c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x2af1f8['params']['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x351af1,null))['then'](function(_0x508097){if(_0x508097){_0x48ad7f=_0x508097;_0x334c75[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db[_0x91a1('0x47')][_0x91a1('0x26')]);_0x334c75['query']=_[_0x91a1('0x3f')](_0x2af1f8['query']);_0x334c75[_0x91a1('0x2b')]=_[_0x91a1('0x40')](_0x334c75[_0x91a1('0x29')],_0x334c75['query']);_0xbe6753['attributes']=_[_0x91a1('0x40')](_0x334c75['model'],qs[_0x91a1('0x2d')](_0x2af1f8['query'][_0x91a1('0x2d')]));_0xbe6753[_0x91a1('0x2c')]=_0xbe6753[_0x91a1('0x2c')]['length']?_0xbe6753[_0x91a1('0x2c')]:_0x334c75[_0x91a1('0x29')];_0xbe6753[_0x91a1('0x31')]=qs[_0x91a1('0x32')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x32')]);_0xbe6753[_0x91a1('0x33')]=qs['filters'](_['pick'](_0x2af1f8[_0x91a1('0x2a')],_0x334c75[_0x91a1('0x2b')]));if(_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x34')]){_0xbe6753[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0xbe6753[_0x91a1('0x33')],{'$or':_['map'](_0xbe6753[_0x91a1('0x2c')],function(_0x2b198c){var _0x1ce397={};_0x1ce397[_0x2b198c]={'$like':'%'+_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x1ce397;})});}_0xbe6753=_[_0x91a1('0x35')]({},_0xbe6753,_0x2af1f8[_0x91a1('0x37')]);return _0x48ad7f[_0x91a1('0x45')](_0xbe6753);}})['then'](function(_0x56fcc0){if(_0x56fcc0){_0x3bc64c=_0x56fcc0[_0x91a1('0x2e')];if(!_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0xbe6753[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x18')]);_0xbe6753[_0x91a1('0x1b')]=qs[_0x91a1('0x1b')](_0x2af1f8[_0x91a1('0x2a')][_0x91a1('0x1b')]);}return _0x48ad7f[_0x91a1('0x45')](_0xbe6753);}})[_0x91a1('0x20')](function(_0x124bcd){if(_0x124bcd){return _0x124bcd?{'count':_0x3bc64c,'rows':_0x124bcd}:null;}})[_0x91a1('0x20')](respondWithResult(_0x351af1,null))[_0x91a1('0x3c')](handleError(_0x351af1,null));};exports['getSubjects']=function(_0x121ff9,_0x4d71fc,_0x4416a1){var _0xb4310a={};var _0x254916={};var _0x4ad9e7;var _0x26214c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x121ff9[_0x91a1('0x3e')]['id']}})[_0x91a1('0x20')](handleEntityNotFound(_0x4d71fc,null))[_0x91a1('0x20')](function(_0x46a53f){if(_0x46a53f){_0x4ad9e7=_0x46a53f;_0x254916[_0x91a1('0x29')]=_[_0x91a1('0x3f')](db['ServicenowField'][_0x91a1('0x26')]);_0x254916[_0x91a1('0x2a')]=_[_0x91a1('0x3f')](_0x121ff9[_0x91a1('0x2a')]);_0x254916[_0x91a1('0x2b')]=_[_0x91a1('0x40')](_0x254916[_0x91a1('0x29')],_0x254916[_0x91a1('0x2a')]);_0xb4310a[_0x91a1('0x2c')]=_[_0x91a1('0x40')](_0x254916['model'],qs[_0x91a1('0x2d')](_0x121ff9[_0x91a1('0x2a')]['fields']));_0xb4310a[_0x91a1('0x2c')]=_0xb4310a[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0xb4310a[_0x91a1('0x2c')]:_0x254916['model'];_0xb4310a[_0x91a1('0x31')]=qs[_0x91a1('0x32')](_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x32')]);_0xb4310a[_0x91a1('0x33')]=qs[_0x91a1('0x2b')](_[_0x91a1('0x48')](_0x121ff9['query'],_0x254916[_0x91a1('0x2b')]));if(_0x121ff9[_0x91a1('0x2a')]['filter']){_0xb4310a[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0xb4310a[_0x91a1('0x33')],{'$or':_['map'](_0xb4310a[_0x91a1('0x2c')],function(_0x41f8fd){var _0x3b7788={};_0x3b7788[_0x41f8fd]={'$like':'%'+_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x34')]+'%'};return _0x3b7788;})});}_0xb4310a=_[_0x91a1('0x35')]({},_0xb4310a,_0x121ff9[_0x91a1('0x37')]);return _0x4ad9e7[_0x91a1('0x49')](_0xb4310a);}})['then'](function(_0xe368e9){if(_0xe368e9){_0x26214c=_0xe368e9[_0x91a1('0x2e')];if(!_0x121ff9['query'][_0x91a1('0x2f')](_0x91a1('0x30'))){_0xb4310a['limit']=qs['limit'](_0x121ff9[_0x91a1('0x2a')][_0x91a1('0x18')]);_0xb4310a['offset']=qs[_0x91a1('0x1b')](_0x121ff9['query'][_0x91a1('0x1b')]);}return _0x4ad9e7[_0x91a1('0x49')](_0xb4310a);}})[_0x91a1('0x20')](function(_0x4d6626){if(_0x4d6626){return _0x4d6626?{'count':_0x26214c,'rows':_0x4d6626}:null;}})[_0x91a1('0x20')](respondWithResult(_0x4d71fc,null))[_0x91a1('0x3c')](handleError(_0x4d71fc,null));};exports[_0x91a1('0x4a')]=function(_0x36a529,_0x556bfb,_0x357508){var _0x1a37f9={};var _0x248633={};var _0x25678d;var _0x13e74c;return db[_0x91a1('0x25')][_0x91a1('0x46')]({'where':{'id':_0x36a529['params']['id']}})['then'](handleEntityNotFound(_0x556bfb,null))[_0x91a1('0x20')](function(_0x15a412){if(_0x15a412){_0x25678d=_0x15a412;_0x248633['model']=_[_0x91a1('0x3f')](db['ServicenowField'][_0x91a1('0x26')]);_0x248633[_0x91a1('0x2a')]=_[_0x91a1('0x3f')](_0x36a529[_0x91a1('0x2a')]);_0x248633['filters']=_['intersection'](_0x248633[_0x91a1('0x29')],_0x248633[_0x91a1('0x2a')]);_0x1a37f9['attributes']=_[_0x91a1('0x40')](_0x248633['model'],qs[_0x91a1('0x2d')](_0x36a529[_0x91a1('0x2a')]['fields']));_0x1a37f9['attributes']=_0x1a37f9[_0x91a1('0x2c')][_0x91a1('0x2e')]?_0x1a37f9[_0x91a1('0x2c')]:_0x248633[_0x91a1('0x29')];_0x1a37f9['order']=qs['sort'](_0x36a529[_0x91a1('0x2a')]['sort']);_0x1a37f9[_0x91a1('0x33')]=qs[_0x91a1('0x2b')](_[_0x91a1('0x48')](_0x36a529[_0x91a1('0x2a')],_0x248633['filters']));if(_0x36a529[_0x91a1('0x2a')][_0x91a1('0x34')]){_0x1a37f9[_0x91a1('0x33')]=_[_0x91a1('0x35')](_0x1a37f9['where'],{'$or':_[_0x91a1('0x24')](_0x1a37f9[_0x91a1('0x2c')],function(_0x167d5e){var _0x47c51e={};_0x47c51e[_0x167d5e]={'$like':'%'+_0x36a529['query'][_0x91a1('0x34')]+'%'};return _0x47c51e;})});}_0x1a37f9=_[_0x91a1('0x35')]({},_0x1a37f9,_0x36a529[_0x91a1('0x37')]);return _0x25678d['getDescriptions'](_0x1a37f9);}})[_0x91a1('0x20')](function(_0x3f0c8a){if(_0x3f0c8a){_0x13e74c=_0x3f0c8a[_0x91a1('0x2e')];if(!_0x36a529[_0x91a1('0x2a')][_0x91a1('0x2f')](_0x91a1('0x30'))){_0x1a37f9[_0x91a1('0x18')]=qs[_0x91a1('0x18')](_0x36a529[_0x91a1('0x2a')]['limit']);_0x1a37f9['offset']=qs[_0x91a1('0x1b')](_0x36a529[_0x91a1('0x2a')][_0x91a1('0x1b')]);}return _0x25678d[_0x91a1('0x4a')](_0x1a37f9);}})['then'](function(_0x577349){if(_0x577349){return _0x577349?{'count':_0x13e74c,'rows':_0x577349}:null;}})[_0x91a1('0x20')](respondWithResult(_0x556bfb,null))[_0x91a1('0x3c')](handleError(_0x556bfb,null));}; \ No newline at end of file +var _0xbad6=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2263d6,_0x23ef72){var _0x392795=function(_0x555ceb){while(--_0x555ceb){_0x2263d6['push'](_0x2263d6['shift']());}};_0x392795(++_0x23ef72);}(_0xbad6,0x177));var _0x6bad=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbad6[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6bad('0x0'));var jsonpatch=require(_0x6bad('0x1'));var rp=require(_0x6bad('0x2'));var moment=require(_0x6bad('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6bad('0x4'));var path=require(_0x6bad('0x5'));var sox=require(_0x6bad('0x6'));var csv=require(_0x6bad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bad('0x8'));var _=require(_0x6bad('0x9'));var squel=require(_0x6bad('0xa'));var crypto=require(_0x6bad('0xb'));var jsforce=require(_0x6bad('0xc'));var deskjs=require(_0x6bad('0xd'));var toCsv=require(_0x6bad('0x7'));var querystring=require(_0x6bad('0xe'));var Papa=require(_0x6bad('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6bad('0x10'));var as=require(_0x6bad('0x11'));var hardwareService=require(_0x6bad('0x12'));var logger=require('../../config/logger')(_0x6bad('0x13'));var utils=require(_0x6bad('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6bad('0x15'));var db=require(_0x6bad('0x16'))['db'];function respondWithStatusCode(_0x3fef34,_0x55c13a){_0x55c13a=_0x55c13a||0xcc;return function(_0x3df9a3){if(_0x3df9a3){return _0x3fef34[_0x6bad('0x17')](_0x55c13a);}return _0x3fef34[_0x6bad('0x18')](_0x55c13a)[_0x6bad('0x19')]();};}function respondWithResult(_0x4e887d,_0x4a1d83){_0x4a1d83=_0x4a1d83||0xc8;return function(_0x228bb2){if(_0x228bb2){return _0x4e887d[_0x6bad('0x18')](_0x4a1d83)[_0x6bad('0x1a')](_0x228bb2);}};}function respondWithFilteredResult(_0x33ca67,_0xbe2f1d){return function(_0x547564){if(_0x547564){var _0x4a9542=typeof _0xbe2f1d['offset']==='undefined'&&typeof _0xbe2f1d[_0x6bad('0x1b')]===_0x6bad('0x1c');var _0x368bf3=_0x547564[_0x6bad('0x1d')];var _0x13625f=_0x4a9542?0x0:_0xbe2f1d[_0x6bad('0x1e')];var _0x48aa67=_0x4a9542?_0x547564['count']:_0xbe2f1d[_0x6bad('0x1e')]+_0xbe2f1d[_0x6bad('0x1b')];var _0x52a1d6;if(_0x48aa67>=_0x368bf3){_0x48aa67=_0x368bf3;_0x52a1d6=0xc8;}else{_0x52a1d6=0xce;}_0x33ca67[_0x6bad('0x18')](_0x52a1d6);return _0x33ca67[_0x6bad('0x1f')]('Content-Range',_0x13625f+'-'+_0x48aa67+'/'+_0x368bf3)[_0x6bad('0x1a')](_0x547564);}return null;};}function patchUpdates(_0x2db12b){return function(_0x2abc8b){try{jsonpatch[_0x6bad('0x20')](_0x2abc8b,_0x2db12b,!![]);}catch(_0x4f05dd){return BPromise[_0x6bad('0x21')](_0x4f05dd);}return _0x2abc8b[_0x6bad('0x22')]();};}function saveUpdates(_0x3d5d2d,_0x249a00){return function(_0x49b9ba){if(_0x49b9ba){return _0x49b9ba[_0x6bad('0x23')](_0x3d5d2d)[_0x6bad('0x24')](function(_0x46e294){return _0x46e294;});}return null;};}function removeEntity(_0x739d9d,_0x39ae0d){return function(_0x481071){if(_0x481071){return _0x481071[_0x6bad('0x25')]()[_0x6bad('0x24')](function(){_0x739d9d[_0x6bad('0x18')](0xcc)[_0x6bad('0x19')]();});}};}function handleEntityNotFound(_0x40fc4a,_0x59efaa){return function(_0xd35f03){if(!_0xd35f03){_0x40fc4a[_0x6bad('0x17')](0x194);}return _0xd35f03;};}function handleError(_0x43db12,_0x5cefa0){_0x5cefa0=_0x5cefa0||0x1f4;return function(_0x3b47e0){logger[_0x6bad('0x26')](_0x3b47e0[_0x6bad('0x27')]);if(_0x3b47e0[_0x6bad('0x28')]){delete _0x3b47e0['name'];}_0x43db12[_0x6bad('0x18')](_0x5cefa0)['send'](_0x3b47e0);};}exports[_0x6bad('0x29')]=function(_0x1176c1,_0x3badb8){var _0x5cc62e={},_0x145f08={},_0x5bc9d5={'count':0x0,'rows':[]};var _0x3db5a3=_[_0x6bad('0x2a')](db[_0x6bad('0x2b')][_0x6bad('0x2c')],function(_0xda36d6){return{'name':_0xda36d6['fieldName'],'type':_0xda36d6[_0x6bad('0x2d')]['key']};});_0x145f08[_0x6bad('0x2e')]=_[_0x6bad('0x2a')](_0x3db5a3,_0x6bad('0x28'));_0x145f08['query']=_[_0x6bad('0x2f')](_0x1176c1[_0x6bad('0x30')]);_0x145f08[_0x6bad('0x31')]=_[_0x6bad('0x32')](_0x145f08['model'],_0x145f08['query']);_0x5cc62e[_0x6bad('0x33')]=_[_0x6bad('0x32')](_0x145f08[_0x6bad('0x2e')],qs[_0x6bad('0x34')](_0x1176c1[_0x6bad('0x30')][_0x6bad('0x34')]));_0x5cc62e['attributes']=_0x5cc62e['attributes'][_0x6bad('0x35')]?_0x5cc62e[_0x6bad('0x33')]:_0x145f08[_0x6bad('0x2e')];if(!_0x1176c1['query'][_0x6bad('0x36')](_0x6bad('0x37'))){_0x5cc62e[_0x6bad('0x1b')]=qs[_0x6bad('0x1b')](_0x1176c1['query']['limit']);_0x5cc62e['offset']=qs[_0x6bad('0x1e')](_0x1176c1[_0x6bad('0x30')][_0x6bad('0x1e')]);}_0x5cc62e['order']=qs[_0x6bad('0x38')](_0x1176c1[_0x6bad('0x30')]['sort']);_0x5cc62e[_0x6bad('0x39')]=qs[_0x6bad('0x31')](_[_0x6bad('0x3a')](_0x1176c1[_0x6bad('0x30')],_0x145f08[_0x6bad('0x31')]),_0x3db5a3);if(_0x1176c1[_0x6bad('0x30')]['filter']){_0x5cc62e[_0x6bad('0x39')]=_['merge'](_0x5cc62e['where'],{'$or':_[_0x6bad('0x2a')](_0x3db5a3,function(_0x29feae){if(_0x29feae[_0x6bad('0x2d')]!=='VIRTUAL'){var _0x2f9d09={};_0x2f9d09[_0x29feae[_0x6bad('0x28')]]={'$like':'%'+_0x1176c1[_0x6bad('0x30')][_0x6bad('0x3b')]+'%'};return _0x2f9d09;}})});}_0x5cc62e=_[_0x6bad('0x3c')]({},_0x5cc62e,_0x1176c1[_0x6bad('0x3d')]);var _0x4c917c={'where':_0x5cc62e[_0x6bad('0x39')]};return db[_0x6bad('0x2b')][_0x6bad('0x1d')](_0x4c917c)[_0x6bad('0x24')](function(_0x596c87){_0x5bc9d5[_0x6bad('0x1d')]=_0x596c87;if(_0x1176c1[_0x6bad('0x30')][_0x6bad('0x3e')]){_0x5cc62e['include']=[{'all':!![]}];}return db[_0x6bad('0x2b')][_0x6bad('0x3f')](_0x5cc62e);})[_0x6bad('0x24')](function(_0x4ddfa0){_0x5bc9d5[_0x6bad('0x40')]=_0x4ddfa0;return _0x5bc9d5;})[_0x6bad('0x24')](respondWithFilteredResult(_0x3badb8,_0x5cc62e))[_0x6bad('0x41')](handleError(_0x3badb8,null));};exports['show']=function(_0x54bdd1,_0xbd4d2){var _0x445ac7={'raw':![],'where':{'id':_0x54bdd1[_0x6bad('0x42')]['id']}},_0x3ce782={};_0x3ce782[_0x6bad('0x2e')]=_[_0x6bad('0x2f')](db[_0x6bad('0x2b')][_0x6bad('0x2c')]);_0x3ce782[_0x6bad('0x30')]=_['keys'](_0x54bdd1[_0x6bad('0x30')]);_0x3ce782['filters']=_[_0x6bad('0x32')](_0x3ce782[_0x6bad('0x2e')],_0x3ce782['query']);_0x445ac7[_0x6bad('0x33')]=_['intersection'](_0x3ce782['model'],qs[_0x6bad('0x34')](_0x54bdd1['query']['fields']));_0x445ac7[_0x6bad('0x33')]=_0x445ac7['attributes'][_0x6bad('0x35')]?_0x445ac7['attributes']:_0x3ce782[_0x6bad('0x2e')];if(_0x54bdd1[_0x6bad('0x30')]['includeAll']){_0x445ac7[_0x6bad('0x43')]=[{'all':!![]}];}_0x445ac7=_['merge']({},_0x445ac7,_0x54bdd1[_0x6bad('0x3d')]);return db[_0x6bad('0x2b')][_0x6bad('0x44')](_0x445ac7)[_0x6bad('0x24')](handleEntityNotFound(_0xbd4d2,null))['then'](respondWithResult(_0xbd4d2,null))[_0x6bad('0x41')](handleError(_0xbd4d2,null));};exports[_0x6bad('0x45')]=function(_0xc221d4,_0x45f225){return db['ServicenowConfiguration'][_0x6bad('0x45')](_0xc221d4[_0x6bad('0x46')],{})[_0x6bad('0x24')](respondWithResult(_0x45f225,0xc9))['catch'](handleError(_0x45f225,null));};exports['update']=function(_0xca21c2,_0xa039ca){if(_0xca21c2['body']['id']){delete _0xca21c2[_0x6bad('0x46')]['id'];}return db[_0x6bad('0x2b')][_0x6bad('0x44')]({'where':{'id':_0xca21c2['params']['id']}})[_0x6bad('0x24')](handleEntityNotFound(_0xa039ca,null))['then'](saveUpdates(_0xca21c2[_0x6bad('0x46')],null))[_0x6bad('0x24')](respondWithResult(_0xa039ca,null))['catch'](handleError(_0xa039ca,null));};exports[_0x6bad('0x25')]=function(_0x36203a,_0x6cff72){return db[_0x6bad('0x2b')][_0x6bad('0x44')]({'where':{'id':_0x36203a['params']['id']}})[_0x6bad('0x24')](handleEntityNotFound(_0x6cff72,null))['then'](removeEntity(_0x6cff72,null))[_0x6bad('0x41')](handleError(_0x6cff72,null));};exports[_0x6bad('0x47')]=function(_0x2160d5,_0x25081e,_0x24770d){var _0x1fd7d7={};var _0x3d016f={};var _0x2be385;var _0x2c019b;return db[_0x6bad('0x2b')][_0x6bad('0x48')]({'where':{'id':_0x2160d5[_0x6bad('0x42')]['id']}})['then'](handleEntityNotFound(_0x25081e,null))[_0x6bad('0x24')](function(_0x92f953){if(_0x92f953){_0x2be385=_0x92f953;_0x3d016f['model']=_[_0x6bad('0x2f')](db[_0x6bad('0x49')][_0x6bad('0x2c')]);_0x3d016f[_0x6bad('0x30')]=_[_0x6bad('0x2f')](_0x2160d5[_0x6bad('0x30')]);_0x3d016f[_0x6bad('0x31')]=_['intersection'](_0x3d016f['model'],_0x3d016f[_0x6bad('0x30')]);_0x1fd7d7[_0x6bad('0x33')]=_[_0x6bad('0x32')](_0x3d016f['model'],qs['fields'](_0x2160d5['query'][_0x6bad('0x34')]));_0x1fd7d7[_0x6bad('0x33')]=_0x1fd7d7[_0x6bad('0x33')]['length']?_0x1fd7d7['attributes']:_0x3d016f['model'];_0x1fd7d7[_0x6bad('0x4a')]=qs[_0x6bad('0x38')](_0x2160d5[_0x6bad('0x30')]['sort']);_0x1fd7d7[_0x6bad('0x39')]=qs[_0x6bad('0x31')](_[_0x6bad('0x3a')](_0x2160d5['query'],_0x3d016f[_0x6bad('0x31')]));if(_0x2160d5[_0x6bad('0x30')][_0x6bad('0x3b')]){_0x1fd7d7['where']=_[_0x6bad('0x3c')](_0x1fd7d7[_0x6bad('0x39')],{'$or':_['map'](_0x1fd7d7['attributes'],function(_0x5e4eb6){var _0x44fc3b={};_0x44fc3b[_0x5e4eb6]={'$like':'%'+_0x2160d5['query'][_0x6bad('0x3b')]+'%'};return _0x44fc3b;})});}_0x1fd7d7=_[_0x6bad('0x3c')]({},_0x1fd7d7,_0x2160d5[_0x6bad('0x3d')]);return _0x2be385[_0x6bad('0x47')](_0x1fd7d7);}})[_0x6bad('0x24')](function(_0x3691d9){if(_0x3691d9){_0x2c019b=_0x3691d9[_0x6bad('0x35')];if(!_0x2160d5[_0x6bad('0x30')][_0x6bad('0x36')]('nolimit')){_0x1fd7d7[_0x6bad('0x1b')]=qs['limit'](_0x2160d5['query'][_0x6bad('0x1b')]);_0x1fd7d7[_0x6bad('0x1e')]=qs[_0x6bad('0x1e')](_0x2160d5[_0x6bad('0x30')][_0x6bad('0x1e')]);}return _0x2be385[_0x6bad('0x47')](_0x1fd7d7);}})[_0x6bad('0x24')](function(_0x1febd2){if(_0x1febd2){return _0x1febd2?{'count':_0x2c019b,'rows':_0x1febd2}:null;}})['then'](respondWithResult(_0x25081e,null))[_0x6bad('0x41')](handleError(_0x25081e,null));};exports[_0x6bad('0x4b')]=function(_0x4e3d6b,_0x47eae8,_0xb03378){var _0x4207b6={};var _0x119bed={};var _0x3758a3;var _0x35b127;return db[_0x6bad('0x2b')][_0x6bad('0x48')]({'where':{'id':_0x4e3d6b[_0x6bad('0x42')]['id']}})[_0x6bad('0x24')](handleEntityNotFound(_0x47eae8,null))[_0x6bad('0x24')](function(_0x5e2309){if(_0x5e2309){_0x3758a3=_0x5e2309;_0x119bed[_0x6bad('0x2e')]=_['keys'](db['ServicenowField'][_0x6bad('0x2c')]);_0x119bed[_0x6bad('0x30')]=_[_0x6bad('0x2f')](_0x4e3d6b[_0x6bad('0x30')]);_0x119bed[_0x6bad('0x31')]=_[_0x6bad('0x32')](_0x119bed[_0x6bad('0x2e')],_0x119bed[_0x6bad('0x30')]);_0x4207b6[_0x6bad('0x33')]=_[_0x6bad('0x32')](_0x119bed['model'],qs[_0x6bad('0x34')](_0x4e3d6b['query'][_0x6bad('0x34')]));_0x4207b6[_0x6bad('0x33')]=_0x4207b6[_0x6bad('0x33')]['length']?_0x4207b6[_0x6bad('0x33')]:_0x119bed[_0x6bad('0x2e')];_0x4207b6[_0x6bad('0x4a')]=qs[_0x6bad('0x38')](_0x4e3d6b[_0x6bad('0x30')][_0x6bad('0x38')]);_0x4207b6[_0x6bad('0x39')]=qs['filters'](_[_0x6bad('0x3a')](_0x4e3d6b[_0x6bad('0x30')],_0x119bed[_0x6bad('0x31')]));if(_0x4e3d6b[_0x6bad('0x30')]['filter']){_0x4207b6[_0x6bad('0x39')]=_['merge'](_0x4207b6[_0x6bad('0x39')],{'$or':_['map'](_0x4207b6[_0x6bad('0x33')],function(_0x2f2d73){var _0x56c6af={};_0x56c6af[_0x2f2d73]={'$like':'%'+_0x4e3d6b[_0x6bad('0x30')][_0x6bad('0x3b')]+'%'};return _0x56c6af;})});}_0x4207b6=_['merge']({},_0x4207b6,_0x4e3d6b[_0x6bad('0x3d')]);return _0x3758a3[_0x6bad('0x4b')](_0x4207b6);}})['then'](function(_0x22876c){if(_0x22876c){_0x35b127=_0x22876c[_0x6bad('0x35')];if(!_0x4e3d6b[_0x6bad('0x30')][_0x6bad('0x36')](_0x6bad('0x37'))){_0x4207b6[_0x6bad('0x1b')]=qs[_0x6bad('0x1b')](_0x4e3d6b['query'][_0x6bad('0x1b')]);_0x4207b6[_0x6bad('0x1e')]=qs[_0x6bad('0x1e')](_0x4e3d6b['query'][_0x6bad('0x1e')]);}return _0x3758a3[_0x6bad('0x4b')](_0x4207b6);}})[_0x6bad('0x24')](function(_0x341518){if(_0x341518){return _0x341518?{'count':_0x35b127,'rows':_0x341518}:null;}})[_0x6bad('0x24')](respondWithResult(_0x47eae8,null))[_0x6bad('0x41')](handleError(_0x47eae8,null));};exports[_0x6bad('0x4c')]=function(_0x5c724a,_0x11a0b5,_0x28c400){var _0x1d74e4={};var _0x207a10={};var _0x40a0e8;var _0x5441d2;return db[_0x6bad('0x2b')][_0x6bad('0x48')]({'where':{'id':_0x5c724a[_0x6bad('0x42')]['id']}})[_0x6bad('0x24')](handleEntityNotFound(_0x11a0b5,null))[_0x6bad('0x24')](function(_0x143e28){if(_0x143e28){_0x40a0e8=_0x143e28;_0x207a10[_0x6bad('0x2e')]=_[_0x6bad('0x2f')](db[_0x6bad('0x49')][_0x6bad('0x2c')]);_0x207a10[_0x6bad('0x30')]=_['keys'](_0x5c724a[_0x6bad('0x30')]);_0x207a10[_0x6bad('0x31')]=_[_0x6bad('0x32')](_0x207a10[_0x6bad('0x2e')],_0x207a10[_0x6bad('0x30')]);_0x1d74e4[_0x6bad('0x33')]=_[_0x6bad('0x32')](_0x207a10[_0x6bad('0x2e')],qs[_0x6bad('0x34')](_0x5c724a[_0x6bad('0x30')][_0x6bad('0x34')]));_0x1d74e4[_0x6bad('0x33')]=_0x1d74e4[_0x6bad('0x33')][_0x6bad('0x35')]?_0x1d74e4[_0x6bad('0x33')]:_0x207a10['model'];_0x1d74e4['order']=qs[_0x6bad('0x38')](_0x5c724a[_0x6bad('0x30')][_0x6bad('0x38')]);_0x1d74e4[_0x6bad('0x39')]=qs[_0x6bad('0x31')](_[_0x6bad('0x3a')](_0x5c724a[_0x6bad('0x30')],_0x207a10[_0x6bad('0x31')]));if(_0x5c724a[_0x6bad('0x30')]['filter']){_0x1d74e4[_0x6bad('0x39')]=_[_0x6bad('0x3c')](_0x1d74e4[_0x6bad('0x39')],{'$or':_[_0x6bad('0x2a')](_0x1d74e4[_0x6bad('0x33')],function(_0x529c98){var _0x20beaf={};_0x20beaf[_0x529c98]={'$like':'%'+_0x5c724a[_0x6bad('0x30')][_0x6bad('0x3b')]+'%'};return _0x20beaf;})});}_0x1d74e4=_[_0x6bad('0x3c')]({},_0x1d74e4,_0x5c724a['options']);return _0x40a0e8[_0x6bad('0x4c')](_0x1d74e4);}})[_0x6bad('0x24')](function(_0x18b2ca){if(_0x18b2ca){_0x5441d2=_0x18b2ca[_0x6bad('0x35')];if(!_0x5c724a[_0x6bad('0x30')][_0x6bad('0x36')]('nolimit')){_0x1d74e4[_0x6bad('0x1b')]=qs[_0x6bad('0x1b')](_0x5c724a[_0x6bad('0x30')][_0x6bad('0x1b')]);_0x1d74e4['offset']=qs[_0x6bad('0x1e')](_0x5c724a[_0x6bad('0x30')][_0x6bad('0x1e')]);}return _0x40a0e8[_0x6bad('0x4c')](_0x1d74e4);}})['then'](function(_0x5a54e2){if(_0x5a54e2){return _0x5a54e2?{'count':_0x5441d2,'rows':_0x5a54e2}:null;}})['then'](respondWithResult(_0x11a0b5,null))[_0x6bad('0x41')](handleError(_0x11a0b5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 594eba9..1ebc612 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 _0xcf66=['exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x540a78,_0x2d44e0){var _0x4793b9=function(_0x44234c){while(--_0x44234c){_0x540a78['push'](_0x540a78['shift']());}};_0x4793b9(++_0x2d44e0);}(_0xcf66,0x71));var _0x6cf6=function(_0x4f10b1,_0x579118){_0x4f10b1=_0x4f10b1-0x0;var _0x142a5e=_0xcf66[_0x4f10b1];return _0x142a5e;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))('api');var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x6cf6('0x7')]=function(_0x1fbedd,_0x2a573e){return _0x1fbedd['define'](_0x6cf6('0x8'),attributes,{'tableName':_0x6cf6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa49b=['moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util','../../config/logger','api'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa49b,0x126));var _0xba49=function(_0x41b17b,_0x20a7ec){_0x41b17b=_0x41b17b-0x0;var _0x375acc=_0xa49b[_0x41b17b];return _0x375acc;};'use strict';var _=require('lodash');var util=require(_0xba49('0x0'));var logger=require(_0xba49('0x1'))(_0xba49('0x2'));var moment=require(_0xba49('0x3'));var BPromise=require('bluebird');var rp=require(_0xba49('0x4'));var fs=require('fs');var path=require(_0xba49('0x5'));var rimraf=require(_0xba49('0x6'));var config=require('../../config/environment');var attributes=require(_0xba49('0x7'));module[_0xba49('0x8')]=function(_0x3315bc,_0x525dfd){return _0x3315bc[_0xba49('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0xba49('0xa'),'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 de19115..c439c3d 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 _0x496e=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment'];(function(_0x3f2870,_0x458e97){var _0x112ce4=function(_0x35e831){while(--_0x35e831){_0x3f2870['push'](_0x3f2870['shift']());}};_0x112ce4(++_0x458e97);}(_0x496e,0x1a0));var _0xe496=function(_0x3e20e3,_0x333575){_0x3e20e3=_0x3e20e3-0x0;var _0x2eb98c=_0x496e[_0x3e20e3];return _0x2eb98c;};'use strict';var _=require('lodash');var util=require(_0xe496('0x0'));var moment=require(_0xe496('0x1'));var BPromise=require(_0xe496('0x2'));var rs=require(_0xe496('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe496('0x4'))('rpc');var config=require(_0xe496('0x5'));var jayson=require(_0xe496('0x6'));var client=jayson[_0xe496('0x7')][_0xe496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ba6bf,_0x22d4ad,_0x19970b){return new BPromise(function(_0x42b1b6,_0x43cedd){return client[_0xe496('0x9')](_0x2ba6bf,_0x19970b)[_0xe496('0xa')](function(_0x519f3a){logger['info'](_0xe496('0xb'),_0x22d4ad,'request\x20sent');logger[_0xe496('0xc')](_0xe496('0xd'),_0x22d4ad,_0xe496('0xe'),JSON[_0xe496('0xf')](_0x519f3a));if(_0x519f3a[_0xe496('0x10')]){if(_0x519f3a[_0xe496('0x10')]['code']===0x1f4){logger['error'](_0xe496('0xb'),_0x22d4ad,_0x519f3a[_0xe496('0x10')]['message']);return _0x43cedd(_0x519f3a[_0xe496('0x10')][_0xe496('0x11')]);}logger[_0xe496('0x10')](_0xe496('0xb'),_0x22d4ad,_0x519f3a['error'][_0xe496('0x11')]);return _0x42b1b6(_0x519f3a['error'][_0xe496('0x11')]);}else{logger['info'](_0xe496('0xb'),_0x22d4ad,_0xe496('0xe'));_0x42b1b6(_0x519f3a[_0xe496('0x12')][_0xe496('0x11')]);}})['catch'](function(_0x2acc36){logger[_0xe496('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x22d4ad,_0x2acc36);_0x43cedd(_0x2acc36);});});} \ No newline at end of file +var _0x622a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x529c18,_0xb0de0c){var _0x493f83=function(_0x386313){while(--_0x386313){_0x529c18['push'](_0x529c18['shift']());}};_0x493f83(++_0xb0de0c);}(_0x622a,0x1ce));var _0xa622=function(_0x1fa205,_0x13b61f){_0x1fa205=_0x1fa205-0x0;var _0x2a30b6=_0x622a[_0x1fa205];return _0x2a30b6;};'use strict';var _=require('lodash');var util=require(_0xa622('0x0'));var moment=require(_0xa622('0x1'));var BPromise=require(_0xa622('0x2'));var rs=require(_0xa622('0x3'));var fs=require('fs');var Redis=require(_0xa622('0x4'));var db=require(_0xa622('0x5'))['db'];var utils=require(_0xa622('0x6'));var logger=require(_0xa622('0x7'))(_0xa622('0x8'));var config=require('../../config/environment');var jayson=require(_0xa622('0x9'));var client=jayson[_0xa622('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cf6b3,_0x145e8a,_0x167f17){return new BPromise(function(_0x1b3144,_0x39ed3f){return client[_0xa622('0xb')](_0x3cf6b3,_0x167f17)['then'](function(_0x1bdf98){logger[_0xa622('0xc')](_0xa622('0xd'),_0x145e8a,_0xa622('0xe'));logger['debug'](_0xa622('0xf'),_0x145e8a,_0xa622('0xe'),JSON[_0xa622('0x10')](_0x1bdf98));if(_0x1bdf98[_0xa622('0x11')]){if(_0x1bdf98[_0xa622('0x11')][_0xa622('0x12')]===0x1f4){logger[_0xa622('0x11')](_0xa622('0xd'),_0x145e8a,_0x1bdf98[_0xa622('0x11')][_0xa622('0x13')]);return _0x39ed3f(_0x1bdf98[_0xa622('0x11')][_0xa622('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x145e8a,_0x1bdf98[_0xa622('0x11')][_0xa622('0x13')]);return _0x1b3144(_0x1bdf98[_0xa622('0x11')]['message']);}else{logger[_0xa622('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x145e8a,_0xa622('0xe'));_0x1b3144(_0x1bdf98[_0xa622('0x14')]['message']);}})['catch'](function(_0x1a1397){logger[_0xa622('0x11')](_0xa622('0xd'),_0x145e8a,_0x1a1397);_0x39ed3f(_0x1a1397);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 6e8a314..afb8e41 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 _0x164b=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x1c68f5,_0x49fa9b){var _0x41edda=function(_0x373b6c){while(--_0x373b6c){_0x1c68f5['push'](_0x1c68f5['shift']());}};_0x41edda(++_0x49fa9b);}(_0x164b,0x101));var _0xb164=function(_0x117d20,_0x3ce068){_0x117d20=_0x117d20-0x0;var _0x2586f1=_0x164b[_0x117d20];return _0x2586f1;};'use strict';var multer=require(_0xb164('0x0'));var util=require(_0xb164('0x1'));var path=require(_0xb164('0x2'));var timeout=require(_0xb164('0x3'));var express=require(_0xb164('0x4'));var router=express[_0xb164('0x5')]();var fs_extra=require(_0xb164('0x6'));var auth=require(_0xb164('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb164('0x8'));var controller=require(_0xb164('0x9'));router[_0xb164('0xa')]('/',auth['isAuthenticated'](),controller[_0xb164('0xb')]);router[_0xb164('0xa')](_0xb164('0xc'),auth['isAuthenticated'](),controller[_0xb164('0xd')]);router[_0xb164('0xe')]('/',auth[_0xb164('0xf')](),controller[_0xb164('0x10')]);router[_0xb164('0x11')](_0xb164('0xc'),auth[_0xb164('0xf')](),controller[_0xb164('0x12')]);router['delete'](_0xb164('0xc'),auth['isAuthenticated'](),controller[_0xb164('0x13')]);module[_0xb164('0x14')]=router; \ No newline at end of file +var _0x3bae=['get','isAuthenticated','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x37d870,_0x43470b){var _0x4b2c5f=function(_0x2018bd){while(--_0x2018bd){_0x37d870['push'](_0x37d870['shift']());}};_0x4b2c5f(++_0x43470b);}(_0x3bae,0x15e));var _0xe3ba=function(_0x978037,_0x731e6b){_0x978037=_0x978037-0x0;var _0xed75c9=_0x3bae[_0x978037];return _0xed75c9;};'use strict';var multer=require('multer');var util=require(_0xe3ba('0x0'));var path=require(_0xe3ba('0x1'));var timeout=require(_0xe3ba('0x2'));var express=require(_0xe3ba('0x3'));var router=express[_0xe3ba('0x4')]();var fs_extra=require(_0xe3ba('0x5'));var auth=require(_0xe3ba('0x6'));var interaction=require(_0xe3ba('0x7'));var config=require(_0xe3ba('0x8'));var controller=require(_0xe3ba('0x9'));router[_0xe3ba('0xa')]('/',auth[_0xe3ba('0xb')](),controller['index']);router['get'](_0xe3ba('0xc'),auth[_0xe3ba('0xb')](),controller[_0xe3ba('0xd')]);router[_0xe3ba('0xe')]('/',auth[_0xe3ba('0xb')](),controller[_0xe3ba('0xf')]);router['put']('/:id',auth[_0xe3ba('0xb')](),controller[_0xe3ba('0x10')]);router['delete'](_0xe3ba('0xc'),auth['isAuthenticated'](),controller[_0xe3ba('0x11')]);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 c57e322..d1510cd 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 _0xf3c3=['customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1e1fe9,_0x216dd9){var _0x4eeb06=function(_0x3c69c2){while(--_0x3c69c2){_0x1e1fe9['push'](_0x1e1fe9['shift']());}};_0x4eeb06(++_0x216dd9);}(_0xf3c3,0xf9));var _0x3f3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f3c('0x0'));module['exports']={'type':{'type':Sequelize[_0x3f3c('0x1')](_0x3f3c('0x2'),'variable',_0x3f3c('0x3'),'keyValue',_0x3f3c('0x4')),'defaultValue':_0x3f3c('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3f3c('0x5')]},'keyType':{'type':Sequelize[_0x3f3c('0x1')](_0x3f3c('0x2'),'variable',_0x3f3c('0x3'))},'keyContent':{'type':Sequelize[_0x3f3c('0x5')]},'idField':{'type':Sequelize[_0x3f3c('0x5')]},'nameField':{'type':Sequelize[_0x3f3c('0x5')]},'customField':{'type':Sequelize[_0x3f3c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x08f8=['customVariable','BOOLEAN','exports','ENUM','string','variable','picklist','STRING'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x08f8,0x16a));var _0x808f=function(_0x2b1ed9,_0x3a1b4a){_0x2b1ed9=_0x2b1ed9-0x0;var _0x4a8b3f=_0x08f8[_0x2b1ed9];return _0x4a8b3f;};'use strict';var Sequelize=require('sequelize');module[_0x808f('0x0')]={'type':{'type':Sequelize[_0x808f('0x1')](_0x808f('0x2'),_0x808f('0x3'),'customVariable','keyValue',_0x808f('0x4')),'defaultValue':_0x808f('0x2')},'content':{'type':Sequelize[_0x808f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x808f('0x1')]('string','variable',_0x808f('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x808f('0x5')]},'nameField':{'type':Sequelize[_0x808f('0x5')]},'customField':{'type':Sequelize[_0x808f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x808f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 92377d7..c7dc250 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 _0xc6bc=['desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','ServicenowField','include','rows','catch','show','params','keys','includeAll','create','body','update','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1b6430,_0xe8e545){var _0x5d8a2b=function(_0x3ca552){while(--_0x3ca552){_0x1b6430['push'](_0x1b6430['shift']());}};_0x5d8a2b(++_0xe8e545);}(_0xc6bc,0x87));var _0xcc6b=function(_0x3ebff1,_0x1302d6){_0x3ebff1=_0x3ebff1-0x0;var _0x551748=_0xc6bc[_0x3ebff1];return _0x551748;};'use strict';var emlformat=require(_0xcc6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc6b('0x1'));var jsonpatch=require(_0xcc6b('0x2'));var rp=require('request-promise');var moment=require(_0xcc6b('0x3'));var BPromise=require(_0xcc6b('0x4'));var Mustache=require(_0xcc6b('0x5'));var util=require(_0xcc6b('0x6'));var path=require(_0xcc6b('0x7'));var sox=require(_0xcc6b('0x8'));var csv=require('to-csv');var ejs=require(_0xcc6b('0x9'));var fs=require('fs');var fs_extra=require(_0xcc6b('0xa'));var _=require(_0xcc6b('0xb'));var squel=require(_0xcc6b('0xc'));var crypto=require(_0xcc6b('0xd'));var jsforce=require(_0xcc6b('0xe'));var deskjs=require(_0xcc6b('0xf'));var toCsv=require(_0xcc6b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc6b('0x11'));var authService=require(_0xcc6b('0x12'));var qs=require(_0xcc6b('0x13'));var as=require(_0xcc6b('0x14'));var hardwareService=require(_0xcc6b('0x15'));var logger=require('../../config/logger')(_0xcc6b('0x16'));var utils=require(_0xcc6b('0x17'));var config=require(_0xcc6b('0x18'));var licenseUtil=require(_0xcc6b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3487,_0xe74b07){_0xe74b07=_0xe74b07||0xcc;return function(_0xeee163){if(_0xeee163){return _0x1a3487[_0xcc6b('0x1a')](_0xe74b07);}return _0x1a3487[_0xcc6b('0x1b')](_0xe74b07)['end']();};}function respondWithResult(_0x4d1351,_0x5e89b4){_0x5e89b4=_0x5e89b4||0xc8;return function(_0x43b20a){if(_0x43b20a){return _0x4d1351[_0xcc6b('0x1b')](_0x5e89b4)['json'](_0x43b20a);}};}function respondWithFilteredResult(_0xeba955,_0x250df2){return function(_0x463276){if(_0x463276){var _0x2ca841=typeof _0x250df2[_0xcc6b('0x1c')]===_0xcc6b('0x1d')&&typeof _0x250df2[_0xcc6b('0x1e')]==='undefined';var _0x30a03b=_0x463276[_0xcc6b('0x1f')];var _0x2d1ac1=_0x2ca841?0x0:_0x250df2['offset'];var _0x1f4ab6=_0x2ca841?_0x463276['count']:_0x250df2[_0xcc6b('0x1c')]+_0x250df2[_0xcc6b('0x1e')];var _0x4d8c52;if(_0x1f4ab6>=_0x30a03b){_0x1f4ab6=_0x30a03b;_0x4d8c52=0xc8;}else{_0x4d8c52=0xce;}_0xeba955[_0xcc6b('0x1b')](_0x4d8c52);return _0xeba955[_0xcc6b('0x20')](_0xcc6b('0x21'),_0x2d1ac1+'-'+_0x1f4ab6+'/'+_0x30a03b)['json'](_0x463276);}return null;};}function patchUpdates(_0x49c3d9){return function(_0x3e9ec3){try{jsonpatch[_0xcc6b('0x22')](_0x3e9ec3,_0x49c3d9,!![]);}catch(_0x29f735){return BPromise['reject'](_0x29f735);}return _0x3e9ec3[_0xcc6b('0x23')]();};}function saveUpdates(_0x103112,_0x57cfd6){return function(_0x413aaf){if(_0x413aaf){return _0x413aaf['update'](_0x103112)[_0xcc6b('0x24')](function(_0x13b5f6){return _0x13b5f6;});}return null;};}function removeEntity(_0x260589,_0x511125){return function(_0x393e89){if(_0x393e89){return _0x393e89[_0xcc6b('0x25')]()[_0xcc6b('0x24')](function(){_0x260589[_0xcc6b('0x1b')](0xcc)[_0xcc6b('0x26')]();});}};}function handleEntityNotFound(_0x94df1b,_0x15c70b){return function(_0x23db24){if(!_0x23db24){_0x94df1b[_0xcc6b('0x1a')](0x194);}return _0x23db24;};}function handleError(_0x2915f0,_0x582ade){_0x582ade=_0x582ade||0x1f4;return function(_0xa10cd4){logger[_0xcc6b('0x27')](_0xa10cd4[_0xcc6b('0x28')]);if(_0xa10cd4[_0xcc6b('0x29')]){delete _0xa10cd4[_0xcc6b('0x29')];}_0x2915f0[_0xcc6b('0x1b')](_0x582ade)[_0xcc6b('0x2a')](_0xa10cd4);};}exports[_0xcc6b('0x2b')]=function(_0x736992,_0x2d9a54){var _0x3e3590={},_0x16fd92={},_0x1af011={'count':0x0,'rows':[]};var _0x2cfb30=_[_0xcc6b('0x2c')](db['ServicenowField'][_0xcc6b('0x2d')],function(_0x1ba9a4){return{'name':_0x1ba9a4[_0xcc6b('0x2e')],'type':_0x1ba9a4[_0xcc6b('0x2f')]['key']};});_0x16fd92[_0xcc6b('0x30')]=_[_0xcc6b('0x2c')](_0x2cfb30,_0xcc6b('0x29'));_0x16fd92['query']=_['keys'](_0x736992[_0xcc6b('0x31')]);_0x16fd92[_0xcc6b('0x32')]=_[_0xcc6b('0x33')](_0x16fd92['model'],_0x16fd92['query']);_0x3e3590['attributes']=_[_0xcc6b('0x33')](_0x16fd92['model'],qs[_0xcc6b('0x34')](_0x736992['query'][_0xcc6b('0x34')]));_0x3e3590[_0xcc6b('0x35')]=_0x3e3590[_0xcc6b('0x35')][_0xcc6b('0x36')]?_0x3e3590[_0xcc6b('0x35')]:_0x16fd92[_0xcc6b('0x30')];if(!_0x736992[_0xcc6b('0x31')][_0xcc6b('0x37')](_0xcc6b('0x38'))){_0x3e3590[_0xcc6b('0x1e')]=qs[_0xcc6b('0x1e')](_0x736992['query'][_0xcc6b('0x1e')]);_0x3e3590[_0xcc6b('0x1c')]=qs[_0xcc6b('0x1c')](_0x736992['query'][_0xcc6b('0x1c')]);}_0x3e3590[_0xcc6b('0x39')]=qs[_0xcc6b('0x3a')](_0x736992[_0xcc6b('0x31')]['sort']);_0x3e3590['where']=qs['filters'](_['pick'](_0x736992[_0xcc6b('0x31')],_0x16fd92[_0xcc6b('0x32')]),_0x2cfb30);if(_0x736992[_0xcc6b('0x31')][_0xcc6b('0x3b')]){_0x3e3590['where']=_[_0xcc6b('0x3c')](_0x3e3590[_0xcc6b('0x3d')],{'$or':_[_0xcc6b('0x2c')](_0x2cfb30,function(_0x577a46){if(_0x577a46['type']!==_0xcc6b('0x3e')){var _0x2891f1={};_0x2891f1[_0x577a46[_0xcc6b('0x29')]]={'$like':'%'+_0x736992[_0xcc6b('0x31')][_0xcc6b('0x3b')]+'%'};return _0x2891f1;}})});}_0x3e3590=_['merge']({},_0x3e3590,_0x736992['options']);var _0x411d1f={'where':_0x3e3590['where']};return db[_0xcc6b('0x3f')][_0xcc6b('0x1f')](_0x411d1f)[_0xcc6b('0x24')](function(_0x435602){_0x1af011[_0xcc6b('0x1f')]=_0x435602;if(_0x736992['query']['includeAll']){_0x3e3590[_0xcc6b('0x40')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x3e3590);})[_0xcc6b('0x24')](function(_0x41bfb2){_0x1af011[_0xcc6b('0x41')]=_0x41bfb2;return _0x1af011;})[_0xcc6b('0x24')](respondWithFilteredResult(_0x2d9a54,_0x3e3590))[_0xcc6b('0x42')](handleError(_0x2d9a54,null));};exports[_0xcc6b('0x43')]=function(_0x4482de,_0x59d1d4){var _0x262968={'raw':!![],'where':{'id':_0x4482de[_0xcc6b('0x44')]['id']}},_0xabeef8={};_0xabeef8[_0xcc6b('0x30')]=_[_0xcc6b('0x45')](db[_0xcc6b('0x3f')][_0xcc6b('0x2d')]);_0xabeef8['query']=_[_0xcc6b('0x45')](_0x4482de[_0xcc6b('0x31')]);_0xabeef8[_0xcc6b('0x32')]=_['intersection'](_0xabeef8[_0xcc6b('0x30')],_0xabeef8['query']);_0x262968['attributes']=_[_0xcc6b('0x33')](_0xabeef8[_0xcc6b('0x30')],qs[_0xcc6b('0x34')](_0x4482de[_0xcc6b('0x31')][_0xcc6b('0x34')]));_0x262968[_0xcc6b('0x35')]=_0x262968[_0xcc6b('0x35')][_0xcc6b('0x36')]?_0x262968[_0xcc6b('0x35')]:_0xabeef8['model'];if(_0x4482de[_0xcc6b('0x31')][_0xcc6b('0x46')]){_0x262968[_0xcc6b('0x40')]=[{'all':!![]}];}_0x262968=_['merge']({},_0x262968,_0x4482de['options']);return db[_0xcc6b('0x3f')]['find'](_0x262968)[_0xcc6b('0x24')](handleEntityNotFound(_0x59d1d4,null))[_0xcc6b('0x24')](respondWithResult(_0x59d1d4,null))[_0xcc6b('0x42')](handleError(_0x59d1d4,null));};exports['create']=function(_0x36263c,_0xc643f3){return db['ServicenowField'][_0xcc6b('0x47')](_0x36263c[_0xcc6b('0x48')],{})['then'](respondWithResult(_0xc643f3,0xc9))[_0xcc6b('0x42')](handleError(_0xc643f3,null));};exports[_0xcc6b('0x49')]=function(_0x239efc,_0x565a7d){if(_0x239efc[_0xcc6b('0x48')]['id']){delete _0x239efc[_0xcc6b('0x48')]['id'];}return db[_0xcc6b('0x3f')][_0xcc6b('0x4a')]({'where':{'id':_0x239efc[_0xcc6b('0x44')]['id']}})[_0xcc6b('0x24')](handleEntityNotFound(_0x565a7d,null))[_0xcc6b('0x24')](saveUpdates(_0x239efc[_0xcc6b('0x48')],null))[_0xcc6b('0x24')](respondWithResult(_0x565a7d,null))['catch'](handleError(_0x565a7d,null));};exports['destroy']=function(_0x524f09,_0x5e3a0c){return db[_0xcc6b('0x3f')][_0xcc6b('0x4a')]({'where':{'id':_0x524f09['params']['id']}})[_0xcc6b('0x24')](handleEntityNotFound(_0x5e3a0c,null))[_0xcc6b('0x24')](removeEntity(_0x5e3a0c,null))[_0xcc6b('0x42')](handleError(_0x5e3a0c,null));}; \ No newline at end of file +var _0xbbd8=['where','merge','VIRTUAL','options','ServicenowField','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','catch','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','limit','count','offset','status','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','order','sort','filters','filter'];(function(_0x3cc9b5,_0x14c1bf){var _0x31731d=function(_0x11a740){while(--_0x11a740){_0x3cc9b5['push'](_0x3cc9b5['shift']());}};_0x31731d(++_0x14c1bf);}(_0xbbd8,0x135));var _0x8bbd=function(_0x220de2,_0x30aec2){_0x220de2=_0x220de2-0x0;var _0x136f36=_0xbbd8[_0x220de2];return _0x136f36;};'use strict';var emlformat=require(_0x8bbd('0x0'));var rimraf=require(_0x8bbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bbd('0x2'));var rp=require('request-promise');var moment=require(_0x8bbd('0x3'));var BPromise=require(_0x8bbd('0x4'));var Mustache=require(_0x8bbd('0x5'));var util=require('util');var path=require(_0x8bbd('0x6'));var sox=require(_0x8bbd('0x7'));var csv=require(_0x8bbd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bbd('0x9'));var _=require(_0x8bbd('0xa'));var squel=require(_0x8bbd('0xb'));var crypto=require(_0x8bbd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8bbd('0xd'));var Papa=require(_0x8bbd('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bbd('0xf'));var as=require(_0x8bbd('0x10'));var hardwareService=require(_0x8bbd('0x11'));var logger=require(_0x8bbd('0x12'))(_0x8bbd('0x13'));var utils=require(_0x8bbd('0x14'));var config=require(_0x8bbd('0x15'));var licenseUtil=require(_0x8bbd('0x16'));var db=require(_0x8bbd('0x17'))['db'];function respondWithStatusCode(_0x5258d5,_0xee21fd){_0xee21fd=_0xee21fd||0xcc;return function(_0x5b9b47){if(_0x5b9b47){return _0x5258d5['sendStatus'](_0xee21fd);}return _0x5258d5['status'](_0xee21fd)[_0x8bbd('0x18')]();};}function respondWithResult(_0x348e8e,_0x57ce49){_0x57ce49=_0x57ce49||0xc8;return function(_0x2e3618){if(_0x2e3618){return _0x348e8e['status'](_0x57ce49)['json'](_0x2e3618);}};}function respondWithFilteredResult(_0x38966d,_0x326d71){return function(_0xeb445f){if(_0xeb445f){var _0x14225c=typeof _0x326d71['offset']===_0x8bbd('0x19')&&typeof _0x326d71[_0x8bbd('0x1a')]==='undefined';var _0x1f354c=_0xeb445f[_0x8bbd('0x1b')];var _0x23a23d=_0x14225c?0x0:_0x326d71[_0x8bbd('0x1c')];var _0x4d7e84=_0x14225c?_0xeb445f['count']:_0x326d71[_0x8bbd('0x1c')]+_0x326d71['limit'];var _0x38fba4;if(_0x4d7e84>=_0x1f354c){_0x4d7e84=_0x1f354c;_0x38fba4=0xc8;}else{_0x38fba4=0xce;}_0x38966d[_0x8bbd('0x1d')](_0x38fba4);return _0x38966d['set'](_0x8bbd('0x1e'),_0x23a23d+'-'+_0x4d7e84+'/'+_0x1f354c)[_0x8bbd('0x1f')](_0xeb445f);}return null;};}function patchUpdates(_0x1e8b75){return function(_0x256c7d){try{jsonpatch[_0x8bbd('0x20')](_0x256c7d,_0x1e8b75,!![]);}catch(_0x5bc9ac){return BPromise[_0x8bbd('0x21')](_0x5bc9ac);}return _0x256c7d['save']();};}function saveUpdates(_0x54e62d,_0xdfdf0){return function(_0x3e3fda){if(_0x3e3fda){return _0x3e3fda[_0x8bbd('0x22')](_0x54e62d)[_0x8bbd('0x23')](function(_0x3fdac0){return _0x3fdac0;});}return null;};}function removeEntity(_0x1a7bef,_0x5d71e4){return function(_0x369660){if(_0x369660){return _0x369660[_0x8bbd('0x24')]()[_0x8bbd('0x23')](function(){_0x1a7bef['status'](0xcc)[_0x8bbd('0x18')]();});}};}function handleEntityNotFound(_0x1b443b,_0x4058d9){return function(_0xf128bf){if(!_0xf128bf){_0x1b443b[_0x8bbd('0x25')](0x194);}return _0xf128bf;};}function handleError(_0xc01cde,_0x4e010b){_0x4e010b=_0x4e010b||0x1f4;return function(_0x14636c){logger['error'](_0x14636c[_0x8bbd('0x26')]);if(_0x14636c[_0x8bbd('0x27')]){delete _0x14636c[_0x8bbd('0x27')];}_0xc01cde['status'](_0x4e010b)[_0x8bbd('0x28')](_0x14636c);};}exports[_0x8bbd('0x29')]=function(_0x404716,_0x122b4c){var _0xe6646c={},_0x54137a={},_0x4d237c={'count':0x0,'rows':[]};var _0xf3c9c0=_[_0x8bbd('0x2a')](db['ServicenowField']['rawAttributes'],function(_0x3afa7d){return{'name':_0x3afa7d['fieldName'],'type':_0x3afa7d[_0x8bbd('0x2b')][_0x8bbd('0x2c')]};});_0x54137a[_0x8bbd('0x2d')]=_[_0x8bbd('0x2a')](_0xf3c9c0,_0x8bbd('0x27'));_0x54137a['query']=_[_0x8bbd('0x2e')](_0x404716[_0x8bbd('0x2f')]);_0x54137a['filters']=_['intersection'](_0x54137a[_0x8bbd('0x2d')],_0x54137a[_0x8bbd('0x2f')]);_0xe6646c[_0x8bbd('0x30')]=_['intersection'](_0x54137a[_0x8bbd('0x2d')],qs[_0x8bbd('0x31')](_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x31')]));_0xe6646c[_0x8bbd('0x30')]=_0xe6646c['attributes'][_0x8bbd('0x32')]?_0xe6646c['attributes']:_0x54137a[_0x8bbd('0x2d')];if(!_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x33')]('nolimit')){_0xe6646c[_0x8bbd('0x1a')]=qs['limit'](_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x1a')]);_0xe6646c['offset']=qs[_0x8bbd('0x1c')](_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x1c')]);}_0xe6646c[_0x8bbd('0x34')]=qs['sort'](_0x404716['query'][_0x8bbd('0x35')]);_0xe6646c['where']=qs[_0x8bbd('0x36')](_['pick'](_0x404716[_0x8bbd('0x2f')],_0x54137a[_0x8bbd('0x36')]),_0xf3c9c0);if(_0x404716['query'][_0x8bbd('0x37')]){_0xe6646c[_0x8bbd('0x38')]=_[_0x8bbd('0x39')](_0xe6646c[_0x8bbd('0x38')],{'$or':_[_0x8bbd('0x2a')](_0xf3c9c0,function(_0x55c999){if(_0x55c999['type']!==_0x8bbd('0x3a')){var _0x73ead5={};_0x73ead5[_0x55c999['name']]={'$like':'%'+_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x37')]+'%'};return _0x73ead5;}})});}_0xe6646c=_[_0x8bbd('0x39')]({},_0xe6646c,_0x404716[_0x8bbd('0x3b')]);var _0x20f56b={'where':_0xe6646c[_0x8bbd('0x38')]};return db[_0x8bbd('0x3c')][_0x8bbd('0x1b')](_0x20f56b)[_0x8bbd('0x23')](function(_0x119775){_0x4d237c['count']=_0x119775;if(_0x404716[_0x8bbd('0x2f')][_0x8bbd('0x3d')]){_0xe6646c['include']=[{'all':!![]}];}return db[_0x8bbd('0x3c')][_0x8bbd('0x3e')](_0xe6646c);})['then'](function(_0x51e4f6){_0x4d237c[_0x8bbd('0x3f')]=_0x51e4f6;return _0x4d237c;})[_0x8bbd('0x23')](respondWithFilteredResult(_0x122b4c,_0xe6646c))['catch'](handleError(_0x122b4c,null));};exports[_0x8bbd('0x40')]=function(_0x119f8e,_0x4d2be0){var _0x34d9df={'raw':!![],'where':{'id':_0x119f8e[_0x8bbd('0x41')]['id']}},_0x6855c6={};_0x6855c6['model']=_[_0x8bbd('0x2e')](db[_0x8bbd('0x3c')][_0x8bbd('0x42')]);_0x6855c6[_0x8bbd('0x2f')]=_[_0x8bbd('0x2e')](_0x119f8e[_0x8bbd('0x2f')]);_0x6855c6[_0x8bbd('0x36')]=_[_0x8bbd('0x43')](_0x6855c6[_0x8bbd('0x2d')],_0x6855c6[_0x8bbd('0x2f')]);_0x34d9df['attributes']=_['intersection'](_0x6855c6[_0x8bbd('0x2d')],qs[_0x8bbd('0x31')](_0x119f8e[_0x8bbd('0x2f')][_0x8bbd('0x31')]));_0x34d9df['attributes']=_0x34d9df[_0x8bbd('0x30')][_0x8bbd('0x32')]?_0x34d9df['attributes']:_0x6855c6[_0x8bbd('0x2d')];if(_0x119f8e[_0x8bbd('0x2f')]['includeAll']){_0x34d9df[_0x8bbd('0x44')]=[{'all':!![]}];}_0x34d9df=_['merge']({},_0x34d9df,_0x119f8e['options']);return db['ServicenowField']['find'](_0x34d9df)[_0x8bbd('0x23')](handleEntityNotFound(_0x4d2be0,null))[_0x8bbd('0x23')](respondWithResult(_0x4d2be0,null))[_0x8bbd('0x45')](handleError(_0x4d2be0,null));};exports[_0x8bbd('0x46')]=function(_0x242a7c,_0x58830e){return db[_0x8bbd('0x3c')][_0x8bbd('0x46')](_0x242a7c['body'],{})[_0x8bbd('0x23')](respondWithResult(_0x58830e,0xc9))[_0x8bbd('0x45')](handleError(_0x58830e,null));};exports[_0x8bbd('0x22')]=function(_0x19e2dd,_0x3319e8){if(_0x19e2dd[_0x8bbd('0x47')]['id']){delete _0x19e2dd[_0x8bbd('0x47')]['id'];}return db[_0x8bbd('0x3c')][_0x8bbd('0x48')]({'where':{'id':_0x19e2dd[_0x8bbd('0x41')]['id']}})['then'](handleEntityNotFound(_0x3319e8,null))[_0x8bbd('0x23')](saveUpdates(_0x19e2dd['body'],null))[_0x8bbd('0x23')](respondWithResult(_0x3319e8,null))[_0x8bbd('0x45')](handleError(_0x3319e8,null));};exports[_0x8bbd('0x24')]=function(_0x2c5bfb,_0x5a1029){return db[_0x8bbd('0x3c')][_0x8bbd('0x48')]({'where':{'id':_0x2c5bfb['params']['id']}})[_0x8bbd('0x23')](handleEntityNotFound(_0x5a1029,null))['then'](removeEntity(_0x5a1029,null))['catch'](handleError(_0x5a1029,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 9800bed..821fbd7 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 _0xb3b3=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','idField'];(function(_0x338e4b,_0x4a5778){var _0xbab8e5=function(_0xbe313c){while(--_0xbe313c){_0x338e4b['push'](_0x338e4b['shift']());}};_0xbab8e5(++_0x4a5778);}(_0xb3b3,0x146));var _0x3b3b=function(_0xffcd26,_0x43ddfb){_0xffcd26=_0xffcd26-0x0;var _0x34d12b=_0xb3b3[_0xffcd26];return _0x34d12b;};'use strict';var _=require('lodash');var util=require(_0x3b3b('0x0'));var logger=require(_0x3b3b('0x1'))(_0x3b3b('0x2'));var moment=require(_0x3b3b('0x3'));var BPromise=require(_0x3b3b('0x4'));var rp=require(_0x3b3b('0x5'));var fs=require('fs');var path=require(_0x3b3b('0x6'));var rimraf=require(_0x3b3b('0x7'));var config=require(_0x3b3b('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x3b3b('0x9')]=function(_0x372e13,_0x58a6f4){return _0x372e13[_0x3b3b('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3b3b('0xb'),_0x3b3b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb892=['exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','util','../../config/logger','api','moment','request-promise','../../config/environment','./intServicenowField.attributes'];(function(_0x3567d3,_0x28cf6a){var _0x52391c=function(_0x256a53){while(--_0x256a53){_0x3567d3['push'](_0x3567d3['shift']());}};_0x52391c(++_0x28cf6a);}(_0xb892,0x172));var _0x2b89=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xb892[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require(_0x2b89('0x0'));var logger=require(_0x2b89('0x1'))(_0x2b89('0x2'));var moment=require(_0x2b89('0x3'));var BPromise=require('bluebird');var rp=require(_0x2b89('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b89('0x5'));var attributes=require(_0x2b89('0x6'));module[_0x2b89('0x7')]=function(_0xc73f93,_0x1d0971){return _0xc73f93[_0x2b89('0x8')](_0x2b89('0x9'),attributes,{'tableName':_0x2b89('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x2b89('0xb'),_0x2b89('0xc')],'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 a63b1ed..c4ef152 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 _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(_0x1d664a,_0x149a34){var _0x335345=function(_0x461fac){while(--_0x461fac){_0x1d664a['push'](_0x1d664a['shift']());}};_0x335345(++_0x149a34);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _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(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_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 c9a3806..ca16ae6 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c2794,_0x3e3dbc){var _0x5e258f=function(_0x24228c){while(--_0x24228c){_0x5c2794['push'](_0x5c2794['shift']());}};_0x5e258f(++_0x3e3dbc);}(_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('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x344f1e,_0x2a4197){var _0x21b1df=function(_0x41c725){while(--_0x41c725){_0x344f1e['push'](_0x344f1e['shift']());}};_0x21b1df(++_0x2a4197);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 aeecc38..91e0a5d 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(_0xd2ec32,_0x555f90){var _0x55671b=function(_0x3a22bf){while(--_0x3a22bf){_0xd2ec32['push'](_0xd2ec32['shift']());}};_0x55671b(++_0x555f90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x3b6f73,_0x27ba8b){var _0x21ca74=function(_0x27c756){while(--_0x27c756){_0x3b6f73['push'](_0x3b6f73['shift']());}};_0x21ca74(++_0x27ba8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 10258df..06154b0 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 _0xc9a5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','findOne','length','order','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','parent_id','password','remoteUri','slice','substring','POST','format','%s%s','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x45a33f,_0x2db610){var _0x174e40=function(_0xbc03d1){while(--_0xbc03d1){_0x45a33f['push'](_0x45a33f['shift']());}};_0x174e40(++_0x2db610);}(_0xc9a5,0x65));var _0x5c9a=function(_0x564767,_0x4b1d69){_0x564767=_0x564767-0x0;var _0x1516d3=_0xc9a5[_0x564767];return _0x1516d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c9a('0x1'));var rp=require('request-promise');var moment=require(_0x5c9a('0x2'));var BPromise=require(_0x5c9a('0x3'));var Mustache=require('mustache');var util=require(_0x5c9a('0x4'));var path=require(_0x5c9a('0x5'));var sox=require(_0x5c9a('0x6'));var csv=require(_0x5c9a('0x7'));var ejs=require(_0x5c9a('0x8'));var fs=require('fs');var fs_extra=require(_0x5c9a('0x9'));var _=require(_0x5c9a('0xa'));var squel=require(_0x5c9a('0xb'));var crypto=require(_0x5c9a('0xc'));var jsforce=require(_0x5c9a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c9a('0x7'));var querystring=require(_0x5c9a('0xe'));var Papa=require(_0x5c9a('0xf'));var Redis=require(_0x5c9a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c9a('0x11'));var as=require(_0x5c9a('0x12'));var hardwareService=require(_0x5c9a('0x13'));var logger=require(_0x5c9a('0x14'))(_0x5c9a('0x15'));var utils=require(_0x5c9a('0x16'));var config=require(_0x5c9a('0x17'));var licenseUtil=require(_0x5c9a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5c9a('0x19'));function respondWithStatusCode(_0x602ad1,_0x45a97d){_0x45a97d=_0x45a97d||0xcc;return function(_0x2e826c){if(_0x2e826c){return _0x602ad1['sendStatus'](_0x45a97d);}return _0x602ad1[_0x5c9a('0x1a')](_0x45a97d)[_0x5c9a('0x1b')]();};}function respondWithResult(_0x5a9dc0,_0x117311){_0x117311=_0x117311||0xc8;return function(_0x29e97c){if(_0x29e97c){return _0x5a9dc0[_0x5c9a('0x1a')](_0x117311)[_0x5c9a('0x1c')](_0x29e97c);}};}function respondWithFilteredResult(_0x34d9eb,_0x149e30){return function(_0x1e92a6){if(_0x1e92a6){var _0x30cfc8=typeof _0x149e30[_0x5c9a('0x1d')]==='undefined'&&typeof _0x149e30[_0x5c9a('0x1e')]===_0x5c9a('0x1f');var _0x5b3020=_0x1e92a6[_0x5c9a('0x20')];var _0x350b00=_0x30cfc8?0x0:_0x149e30['offset'];var _0x3df7f5=_0x30cfc8?_0x1e92a6[_0x5c9a('0x20')]:_0x149e30[_0x5c9a('0x1d')]+_0x149e30[_0x5c9a('0x1e')];var _0x1c84bb;if(_0x3df7f5>=_0x5b3020){_0x3df7f5=_0x5b3020;_0x1c84bb=0xc8;}else{_0x1c84bb=0xce;}_0x34d9eb[_0x5c9a('0x1a')](_0x1c84bb);return _0x34d9eb[_0x5c9a('0x21')](_0x5c9a('0x22'),_0x350b00+'-'+_0x3df7f5+'/'+_0x5b3020)[_0x5c9a('0x1c')](_0x1e92a6);}return null;};}function patchUpdates(_0x40cc58){return function(_0x22a7e6){try{jsonpatch[_0x5c9a('0x23')](_0x22a7e6,_0x40cc58,!![]);}catch(_0x59d05a){return BPromise[_0x5c9a('0x24')](_0x59d05a);}return _0x22a7e6['save']();};}function saveUpdates(_0x152026,_0x2dbf73){return function(_0x1fde16){if(_0x1fde16){return _0x1fde16[_0x5c9a('0x25')](_0x152026)[_0x5c9a('0x26')](function(_0x5d609f){return _0x5d609f;});}return null;};}function removeEntity(_0x589ea0,_0xd4475d){return function(_0x191e2c){if(_0x191e2c){return _0x191e2c[_0x5c9a('0x27')]()[_0x5c9a('0x26')](function(){_0x589ea0['status'](0xcc)[_0x5c9a('0x1b')]();});}};}function handleEntityNotFound(_0x143abb,_0x4da8b9){return function(_0x41187f){if(!_0x41187f){_0x143abb[_0x5c9a('0x28')](0x194);}return _0x41187f;};}function handleError(_0x5aab3d,_0xf59712){_0xf59712=_0xf59712||0x1f4;return function(_0x2b0a27){logger['error'](_0x2b0a27[_0x5c9a('0x29')]);if(_0x2b0a27[_0x5c9a('0x2a')]){delete _0x2b0a27[_0x5c9a('0x2a')];}_0x5aab3d[_0x5c9a('0x1a')](_0xf59712)['send'](_0x2b0a27);};}exports[_0x5c9a('0x2b')]=function(_0x5f264c,_0x54cdb2){var _0x36c415={},_0x539a6f={},_0x29cd07={'count':0x0,'rows':[]};var _0x147ced=_[_0x5c9a('0x2c')](db[_0x5c9a('0x2d')][_0x5c9a('0x2e')],function(_0x32023c){return{'name':_0x32023c[_0x5c9a('0x2f')],'type':_0x32023c['type'][_0x5c9a('0x30')]};});_0x539a6f['model']=_['map'](_0x147ced,_0x5c9a('0x2a'));_0x539a6f['query']=_['keys'](_0x5f264c[_0x5c9a('0x31')]);_0x539a6f['filters']=_[_0x5c9a('0x32')](_0x539a6f[_0x5c9a('0x33')],_0x539a6f[_0x5c9a('0x31')]);_0x36c415[_0x5c9a('0x34')]=_[_0x5c9a('0x32')](_0x539a6f['model'],qs['fields'](_0x5f264c['query'][_0x5c9a('0x35')]));_0x36c415[_0x5c9a('0x34')]=_0x36c415['attributes']['length']?_0x36c415['attributes']:_0x539a6f[_0x5c9a('0x33')];if(!_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x36')](_0x5c9a('0x37'))){_0x36c415[_0x5c9a('0x1e')]=qs['limit'](_0x5f264c['query'][_0x5c9a('0x1e')]);_0x36c415[_0x5c9a('0x1d')]=qs[_0x5c9a('0x1d')](_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x1d')]);}_0x36c415['order']=qs[_0x5c9a('0x38')](_0x5f264c[_0x5c9a('0x31')][_0x5c9a('0x38')]);_0x36c415[_0x5c9a('0x39')]=qs[_0x5c9a('0x3a')](_[_0x5c9a('0x3b')](_0x5f264c[_0x5c9a('0x31')],_0x539a6f[_0x5c9a('0x3a')]),_0x147ced);if(_0x5f264c['query'][_0x5c9a('0x3c')]){_0x36c415[_0x5c9a('0x39')]=_[_0x5c9a('0x3d')](_0x36c415[_0x5c9a('0x39')],{'$or':_[_0x5c9a('0x2c')](_0x147ced,function(_0x32c2a7){if(_0x32c2a7['type']!==_0x5c9a('0x3e')){var _0x576cad={};_0x576cad[_0x32c2a7['name']]={'$like':'%'+_0x5f264c['query'][_0x5c9a('0x3c')]+'%'};return _0x576cad;}})});}_0x36c415=_[_0x5c9a('0x3d')]({},_0x36c415,_0x5f264c['options']);var _0x196d11={'where':_0x36c415[_0x5c9a('0x39')]};return db[_0x5c9a('0x2d')][_0x5c9a('0x20')](_0x196d11)['then'](function(_0x13376e){_0x29cd07[_0x5c9a('0x20')]=_0x13376e;if(_0x5f264c['query'][_0x5c9a('0x3f')]){_0x36c415[_0x5c9a('0x40')]=[{'all':!![]}];}return db[_0x5c9a('0x2d')][_0x5c9a('0x41')](_0x36c415);})[_0x5c9a('0x26')](function(_0x3ac4df){_0x29cd07[_0x5c9a('0x42')]=_0x3ac4df;return _0x29cd07;})[_0x5c9a('0x26')](respondWithFilteredResult(_0x54cdb2,_0x36c415))[_0x5c9a('0x43')](handleError(_0x54cdb2,null));};exports['show']=function(_0x31ed42,_0x272492){var _0x39aad6={'raw':![],'where':{'id':_0x31ed42[_0x5c9a('0x44')]['id']}},_0x236623={};_0x236623[_0x5c9a('0x33')]=_[_0x5c9a('0x45')](db[_0x5c9a('0x2d')][_0x5c9a('0x2e')]);_0x236623[_0x5c9a('0x31')]=_[_0x5c9a('0x45')](_0x31ed42[_0x5c9a('0x31')]);_0x236623[_0x5c9a('0x3a')]=_[_0x5c9a('0x32')](_0x236623['model'],_0x236623[_0x5c9a('0x31')]);_0x39aad6['attributes']=_[_0x5c9a('0x32')](_0x236623[_0x5c9a('0x33')],qs['fields'](_0x31ed42[_0x5c9a('0x31')][_0x5c9a('0x35')]));_0x39aad6['attributes']=_0x39aad6['attributes']['length']?_0x39aad6['attributes']:_0x236623[_0x5c9a('0x33')];if(_0x31ed42[_0x5c9a('0x31')][_0x5c9a('0x3f')]){_0x39aad6[_0x5c9a('0x40')]=[{'all':!![]}];}_0x39aad6=_['merge']({},_0x39aad6,_0x31ed42[_0x5c9a('0x46')]);return db[_0x5c9a('0x2d')][_0x5c9a('0x47')](_0x39aad6)[_0x5c9a('0x26')](handleEntityNotFound(_0x272492,null))[_0x5c9a('0x26')](respondWithResult(_0x272492,null))[_0x5c9a('0x43')](handleError(_0x272492,null));};exports[_0x5c9a('0x48')]=function(_0x5e8e66,_0x788c99){return db['SugarcrmAccount']['create'](_0x5e8e66[_0x5c9a('0x49')],{})[_0x5c9a('0x26')](respondWithResult(_0x788c99,0xc9))[_0x5c9a('0x43')](handleError(_0x788c99,null));};exports[_0x5c9a('0x25')]=function(_0x379ad5,_0x229809){if(_0x379ad5[_0x5c9a('0x49')]['id']){delete _0x379ad5[_0x5c9a('0x49')]['id'];}return db[_0x5c9a('0x2d')]['find']({'where':{'id':_0x379ad5[_0x5c9a('0x44')]['id']}})['then'](handleEntityNotFound(_0x229809,null))[_0x5c9a('0x26')](saveUpdates(_0x379ad5[_0x5c9a('0x49')],null))[_0x5c9a('0x26')](respondWithResult(_0x229809,null))[_0x5c9a('0x43')](handleError(_0x229809,null));};exports[_0x5c9a('0x27')]=function(_0xe8a0f2,_0x53a58f){return db[_0x5c9a('0x2d')][_0x5c9a('0x47')]({'where':{'id':_0xe8a0f2[_0x5c9a('0x44')]['id']}})['then'](handleEntityNotFound(_0x53a58f,null))['then'](removeEntity(_0x53a58f,null))[_0x5c9a('0x43')](handleError(_0x53a58f,null));};exports['getConfigurations']=function(_0x43b896,_0x3d9eab,_0x5642fd){var _0x39d4dc={};var _0x2c3df3={};var _0x1fd0c9;var _0x30b3d9;return db[_0x5c9a('0x2d')][_0x5c9a('0x4a')]({'where':{'id':_0x43b896[_0x5c9a('0x44')]['id']}})[_0x5c9a('0x26')](handleEntityNotFound(_0x3d9eab,null))[_0x5c9a('0x26')](function(_0x4daf35){if(_0x4daf35){_0x1fd0c9=_0x4daf35;_0x2c3df3[_0x5c9a('0x33')]=_[_0x5c9a('0x45')](db['SugarcrmConfiguration'][_0x5c9a('0x2e')]);_0x2c3df3['query']=_['keys'](_0x43b896[_0x5c9a('0x31')]);_0x2c3df3[_0x5c9a('0x3a')]=_[_0x5c9a('0x32')](_0x2c3df3[_0x5c9a('0x33')],_0x2c3df3[_0x5c9a('0x31')]);_0x39d4dc['attributes']=_[_0x5c9a('0x32')](_0x2c3df3[_0x5c9a('0x33')],qs[_0x5c9a('0x35')](_0x43b896['query'][_0x5c9a('0x35')]));_0x39d4dc[_0x5c9a('0x34')]=_0x39d4dc[_0x5c9a('0x34')][_0x5c9a('0x4b')]?_0x39d4dc['attributes']:_0x2c3df3[_0x5c9a('0x33')];_0x39d4dc[_0x5c9a('0x4c')]=qs['sort'](_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x38')]);_0x39d4dc[_0x5c9a('0x39')]=qs[_0x5c9a('0x3a')](_[_0x5c9a('0x3b')](_0x43b896[_0x5c9a('0x31')],_0x2c3df3[_0x5c9a('0x3a')]));if(_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x3c')]){_0x39d4dc['where']=_[_0x5c9a('0x3d')](_0x39d4dc[_0x5c9a('0x39')],{'$or':_[_0x5c9a('0x2c')](_0x39d4dc['attributes'],function(_0x5e8e95){var _0x401a80={};_0x401a80[_0x5e8e95]={'$like':'%'+_0x43b896['query']['filter']+'%'};return _0x401a80;})});}_0x39d4dc=_[_0x5c9a('0x3d')]({},_0x39d4dc,_0x43b896[_0x5c9a('0x46')]);return _0x1fd0c9[_0x5c9a('0x4d')](_0x39d4dc);}})[_0x5c9a('0x26')](function(_0x257bba){if(_0x257bba){_0x30b3d9=_0x257bba['length'];if(!_0x43b896[_0x5c9a('0x31')]['hasOwnProperty'](_0x5c9a('0x37'))){_0x39d4dc[_0x5c9a('0x1e')]=qs[_0x5c9a('0x1e')](_0x43b896[_0x5c9a('0x31')][_0x5c9a('0x1e')]);_0x39d4dc['offset']=qs[_0x5c9a('0x1d')](_0x43b896[_0x5c9a('0x31')]['offset']);}return _0x1fd0c9['getConfigurations'](_0x39d4dc);}})[_0x5c9a('0x26')](function(_0x4b8f6b){if(_0x4b8f6b){return _0x4b8f6b?{'count':_0x30b3d9,'rows':_0x4b8f6b}:null;}})[_0x5c9a('0x26')](respondWithResult(_0x3d9eab,null))[_0x5c9a('0x43')](handleError(_0x3d9eab,null));};exports[_0x5c9a('0x4e')]=function(_0x3cf3d4,_0x5e3cbe,_0x5262f4){if(_0x3cf3d4['body']['id']){delete _0x3cf3d4['body']['id'];}return db[_0x5c9a('0x2d')]['findOne']({'where':{'id':_0x3cf3d4[_0x5c9a('0x44')]['id']}})[_0x5c9a('0x26')](handleEntityNotFound(_0x5e3cbe,null))['then'](function(_0x2fac5f){if(_0x2fac5f){_0x3cf3d4[_0x5c9a('0x49')][_0x5c9a('0x4f')]=_0x2fac5f['id'];_0x3cf3d4[_0x5c9a('0x49')]['Subjects']=integrations[_0x5c9a('0x50')](_0x3cf3d4[_0x5c9a('0x49')]['channel'],_0x3cf3d4[_0x5c9a('0x49')]['type']);_0x3cf3d4[_0x5c9a('0x49')][_0x5c9a('0x51')]=integrations[_0x5c9a('0x52')](_0x3cf3d4[_0x5c9a('0x49')]['channel'],_0x3cf3d4[_0x5c9a('0x49')]['type']);return db['SugarcrmConfiguration'][_0x5c9a('0x48')](_0x3cf3d4['body'],{'include':[{'model':db[_0x5c9a('0x53')],'as':'Subjects'},{'model':db[_0x5c9a('0x53')],'as':_0x5c9a('0x51')}]});}return null;})['then'](respondWithResult(_0x5e3cbe,null))[_0x5c9a('0x43')](handleError(_0x5e3cbe,null));};exports['getFields']=function(_0x42fc46,_0x378e59,_0xec3138){var _0x4477a3='';var _0x27635b=['id',_0x5c9a('0x2a'),'assigned_user_id',_0x5c9a('0x54'),_0x5c9a('0x55'),_0x5c9a('0x56'),_0x5c9a('0x57'),_0x5c9a('0x58'),_0x5c9a('0x59'),'parent_type','parent_name','direction'];return db[_0x5c9a('0x2d')]['findOne']({'where':{'id':_0x42fc46[_0x5c9a('0x44')]['id']},'attributes':['id','username',_0x5c9a('0x5a'),_0x5c9a('0x5b')]})[_0x5c9a('0x26')](handleEntityNotFound(_0x378e59,null))[_0x5c9a('0x26')](function(_0x556b6e){if(_0x556b6e){_0x4477a3=_0x556b6e['remoteUri'];var _0x303cbf=_0x4477a3[_0x5c9a('0x5c')](-0x1);if(_0x303cbf==='/'){_0x4477a3=_0x4477a3[_0x5c9a('0x5d')](0x0,_0x4477a3['lastIndexOf'](_0x303cbf));}return rp({'method':_0x5c9a('0x5e'),'uri':util[_0x5c9a('0x5f')](_0x5c9a('0x60'),_0x4477a3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x5c9a('0x61'),'response_type':_0x5c9a('0x61'),'rest_data':JSON[_0x5c9a('0x62')]({'user_auth':{'user_name':_0x556b6e[_0x5c9a('0x63')],'password':_0x556b6e[_0x5c9a('0x5a')],'encryption':_0x5c9a('0x64')},'application':_0x5c9a('0x65')})}});}})[_0x5c9a('0x26')](function(_0x359d38){if(_0x359d38&&_0x359d38['name']!=='Invalid\x20Login'&&_0x359d38[_0x5c9a('0x2a')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x5c9a('0x5f')](_0x5c9a('0x60'),_0x4477a3,_0x5c9a('0x66')),'json':!![],'form':{'method':_0x5c9a('0x67'),'input_type':_0x5c9a('0x61'),'response_type':_0x5c9a('0x61'),'rest_data':JSON['stringify']({'session':_0x359d38['id'],'module_name':_0x5c9a('0x68')})}})[_0x5c9a('0x26')](function(_0x4ffda0){if(_0x4ffda0){var _0x140203=_[_0x5c9a('0x69')](_0x4ffda0[_0x5c9a('0x6a')]);_['remove'](_0x140203,function(_0x2ebab7){return _0x27635b[_0x5c9a('0x6b')](_0x2ebab7[_0x5c9a('0x2a')]);});return{'count':_0x140203[_0x5c9a('0x4b')],'rows':_['map'](_0x140203,function(_0x390e02){return{'id':_0x390e02[_0x5c9a('0x2a')],'name':_0x390e02[_0x5c9a('0x6c')],'custom':_[_0x5c9a('0x6d')](_0x390e02[_0x5c9a('0x2a')],'_c')?!![]:![],'options':_0x390e02[_0x5c9a('0x46')]?_[_0x5c9a('0x2c')](_[_0x5c9a('0x69')](_0x390e02[_0x5c9a('0x46')]),function(_0x51db37){return{'name':_0x51db37[_0x5c9a('0x6e')],'value':_0x51db37[_0x5c9a('0x2a')]};}):[]};})};}})[_0x5c9a('0x26')](respondWithResult(_0x378e59,null))[_0x5c9a('0x43')](function(_0x318bec){var _0x2d30c9=_0x42fc46['query'][_0x5c9a('0x6f')]?0x1f4:_0x318bec['statusCode']||0x1f4;logger[_0x5c9a('0x70')](_0x5c9a('0x71'),_0x5c9a('0x72'),_0x2d30c9,JSON[_0x5c9a('0x62')](_0x318bec));delete _0x318bec[_0x5c9a('0x2a')];if(_0x2d30c9===0x191){_0x2d30c9=0x190;}_0x378e59[_0x5c9a('0x1a')](_0x2d30c9)[_0x5c9a('0x73')](_0x42fc46['query'][_0x5c9a('0x6f')]?{'message':_0x5c9a('0x74'),'statusCode':_0x318bec[_0x5c9a('0x75')]}:_0x318bec);});}else{var _0x5b9ad9=0x1f4;_0x378e59[_0x5c9a('0x1a')](_0x5b9ad9)[_0x5c9a('0x73')]({'message':_0x5c9a('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7f79=['lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','params','includeAll','include','options','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','name','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri'];(function(_0x206ba9,_0x568623){var _0xc470bb=function(_0x30b8fa){while(--_0x30b8fa){_0x206ba9['push'](_0x206ba9['shift']());}};_0xc470bb(++_0x568623);}(_0x7f79,0x8a));var _0x97f7=function(_0x3fa288,_0x3c1beb){_0x3fa288=_0x3fa288-0x0;var _0x5538ac=_0x7f79[_0x3fa288];return _0x5538ac;};'use strict';var emlformat=require(_0x97f7('0x0'));var rimraf=require(_0x97f7('0x1'));var zipdir=require(_0x97f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97f7('0x3'));var moment=require(_0x97f7('0x4'));var BPromise=require(_0x97f7('0x5'));var Mustache=require(_0x97f7('0x6'));var util=require(_0x97f7('0x7'));var path=require(_0x97f7('0x8'));var sox=require('sox');var csv=require(_0x97f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97f7('0xa'));var _=require(_0x97f7('0xb'));var squel=require('squel');var crypto=require(_0x97f7('0xc'));var jsforce=require(_0x97f7('0xd'));var deskjs=require(_0x97f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97f7('0xf'));var Papa=require(_0x97f7('0x10'));var Redis=require(_0x97f7('0x11'));var authService=require(_0x97f7('0x12'));var qs=require(_0x97f7('0x13'));var as=require(_0x97f7('0x14'));var hardwareService=require(_0x97f7('0x15'));var logger=require(_0x97f7('0x16'))(_0x97f7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97f7('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x34ee8e,_0x363ecc){_0x363ecc=_0x363ecc||0xcc;return function(_0xf91f9f){if(_0xf91f9f){return _0x34ee8e[_0x97f7('0x19')](_0x363ecc);}return _0x34ee8e[_0x97f7('0x1a')](_0x363ecc)['end']();};}function respondWithResult(_0x2cbb58,_0x413344){_0x413344=_0x413344||0xc8;return function(_0x2abbb3){if(_0x2abbb3){return _0x2cbb58[_0x97f7('0x1a')](_0x413344)[_0x97f7('0x1b')](_0x2abbb3);}};}function respondWithFilteredResult(_0x2586ed,_0x307713){return function(_0x406057){if(_0x406057){var _0x453aab=typeof _0x307713[_0x97f7('0x1c')]===_0x97f7('0x1d')&&typeof _0x307713[_0x97f7('0x1e')]===_0x97f7('0x1d');var _0x2115f2=_0x406057[_0x97f7('0x1f')];var _0x31029b=_0x453aab?0x0:_0x307713[_0x97f7('0x1c')];var _0x33cb4f=_0x453aab?_0x406057[_0x97f7('0x1f')]:_0x307713[_0x97f7('0x1c')]+_0x307713['limit'];var _0x14b51b;if(_0x33cb4f>=_0x2115f2){_0x33cb4f=_0x2115f2;_0x14b51b=0xc8;}else{_0x14b51b=0xce;}_0x2586ed[_0x97f7('0x1a')](_0x14b51b);return _0x2586ed[_0x97f7('0x20')]('Content-Range',_0x31029b+'-'+_0x33cb4f+'/'+_0x2115f2)[_0x97f7('0x1b')](_0x406057);}return null;};}function patchUpdates(_0x10e9f5){return function(_0x137235){try{jsonpatch[_0x97f7('0x21')](_0x137235,_0x10e9f5,!![]);}catch(_0xe7043a){return BPromise[_0x97f7('0x22')](_0xe7043a);}return _0x137235['save']();};}function saveUpdates(_0x2884f3,_0x5b7ccd){return function(_0x2002bd){if(_0x2002bd){return _0x2002bd[_0x97f7('0x23')](_0x2884f3)[_0x97f7('0x24')](function(_0x21fb4e){return _0x21fb4e;});}return null;};}function removeEntity(_0x567df4,_0x20786c){return function(_0x5e8da7){if(_0x5e8da7){return _0x5e8da7[_0x97f7('0x25')]()[_0x97f7('0x24')](function(){_0x567df4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d566f,_0x5d1f1b){return function(_0x5bf176){if(!_0x5bf176){_0x5d566f[_0x97f7('0x19')](0x194);}return _0x5bf176;};}function handleError(_0x2dc435,_0xfaabd){_0xfaabd=_0xfaabd||0x1f4;return function(_0xe81fd3){logger[_0x97f7('0x26')](_0xe81fd3[_0x97f7('0x27')]);if(_0xe81fd3['name']){delete _0xe81fd3['name'];}_0x2dc435[_0x97f7('0x1a')](_0xfaabd)['send'](_0xe81fd3);};}exports['index']=function(_0x3e35d2,_0x5a94d5){var _0x11c5e2={},_0x57f093={},_0x2d55dc={'count':0x0,'rows':[]};var _0x3bdcb4=_[_0x97f7('0x28')](db[_0x97f7('0x29')][_0x97f7('0x2a')],function(_0x524076){return{'name':_0x524076['fieldName'],'type':_0x524076[_0x97f7('0x2b')][_0x97f7('0x2c')]};});_0x57f093[_0x97f7('0x2d')]=_[_0x97f7('0x28')](_0x3bdcb4,'name');_0x57f093[_0x97f7('0x2e')]=_[_0x97f7('0x2f')](_0x3e35d2[_0x97f7('0x2e')]);_0x57f093[_0x97f7('0x30')]=_[_0x97f7('0x31')](_0x57f093[_0x97f7('0x2d')],_0x57f093[_0x97f7('0x2e')]);_0x11c5e2['attributes']=_[_0x97f7('0x31')](_0x57f093[_0x97f7('0x2d')],qs[_0x97f7('0x32')](_0x3e35d2[_0x97f7('0x2e')][_0x97f7('0x32')]));_0x11c5e2[_0x97f7('0x33')]=_0x11c5e2[_0x97f7('0x33')][_0x97f7('0x34')]?_0x11c5e2['attributes']:_0x57f093[_0x97f7('0x2d')];if(!_0x3e35d2[_0x97f7('0x2e')][_0x97f7('0x35')](_0x97f7('0x36'))){_0x11c5e2['limit']=qs[_0x97f7('0x1e')](_0x3e35d2['query'][_0x97f7('0x1e')]);_0x11c5e2[_0x97f7('0x1c')]=qs[_0x97f7('0x1c')](_0x3e35d2[_0x97f7('0x2e')][_0x97f7('0x1c')]);}_0x11c5e2[_0x97f7('0x37')]=qs[_0x97f7('0x38')](_0x3e35d2[_0x97f7('0x2e')][_0x97f7('0x38')]);_0x11c5e2[_0x97f7('0x39')]=qs[_0x97f7('0x30')](_[_0x97f7('0x3a')](_0x3e35d2['query'],_0x57f093[_0x97f7('0x30')]),_0x3bdcb4);if(_0x3e35d2['query'][_0x97f7('0x3b')]){_0x11c5e2[_0x97f7('0x39')]=_[_0x97f7('0x3c')](_0x11c5e2[_0x97f7('0x39')],{'$or':_['map'](_0x3bdcb4,function(_0x1fc176){if(_0x1fc176[_0x97f7('0x2b')]!==_0x97f7('0x3d')){var _0x2626cc={};_0x2626cc[_0x1fc176['name']]={'$like':'%'+_0x3e35d2[_0x97f7('0x2e')][_0x97f7('0x3b')]+'%'};return _0x2626cc;}})});}_0x11c5e2=_['merge']({},_0x11c5e2,_0x3e35d2['options']);var _0x515b2a={'where':_0x11c5e2['where']};return db[_0x97f7('0x29')]['count'](_0x515b2a)[_0x97f7('0x24')](function(_0x251c45){_0x2d55dc[_0x97f7('0x1f')]=_0x251c45;if(_0x3e35d2[_0x97f7('0x2e')]['includeAll']){_0x11c5e2['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x97f7('0x3e')](_0x11c5e2);})[_0x97f7('0x24')](function(_0x6045d6){_0x2d55dc[_0x97f7('0x3f')]=_0x6045d6;return _0x2d55dc;})[_0x97f7('0x24')](respondWithFilteredResult(_0x5a94d5,_0x11c5e2))[_0x97f7('0x40')](handleError(_0x5a94d5,null));};exports['show']=function(_0x3b47fa,_0xc84d23){var _0x59127b={'raw':![],'where':{'id':_0x3b47fa[_0x97f7('0x41')]['id']}},_0x452877={};_0x452877[_0x97f7('0x2d')]=_[_0x97f7('0x2f')](db[_0x97f7('0x29')]['rawAttributes']);_0x452877[_0x97f7('0x2e')]=_[_0x97f7('0x2f')](_0x3b47fa[_0x97f7('0x2e')]);_0x452877[_0x97f7('0x30')]=_['intersection'](_0x452877[_0x97f7('0x2d')],_0x452877[_0x97f7('0x2e')]);_0x59127b['attributes']=_[_0x97f7('0x31')](_0x452877[_0x97f7('0x2d')],qs[_0x97f7('0x32')](_0x3b47fa[_0x97f7('0x2e')][_0x97f7('0x32')]));_0x59127b['attributes']=_0x59127b['attributes']['length']?_0x59127b[_0x97f7('0x33')]:_0x452877[_0x97f7('0x2d')];if(_0x3b47fa[_0x97f7('0x2e')][_0x97f7('0x42')]){_0x59127b[_0x97f7('0x43')]=[{'all':!![]}];}_0x59127b=_['merge']({},_0x59127b,_0x3b47fa[_0x97f7('0x44')]);return db[_0x97f7('0x29')][_0x97f7('0x45')](_0x59127b)[_0x97f7('0x24')](handleEntityNotFound(_0xc84d23,null))[_0x97f7('0x24')](respondWithResult(_0xc84d23,null))[_0x97f7('0x40')](handleError(_0xc84d23,null));};exports[_0x97f7('0x46')]=function(_0x82c29e,_0x705c6){return db['SugarcrmAccount'][_0x97f7('0x46')](_0x82c29e[_0x97f7('0x47')],{})[_0x97f7('0x24')](respondWithResult(_0x705c6,0xc9))['catch'](handleError(_0x705c6,null));};exports[_0x97f7('0x23')]=function(_0x142f01,_0x8c9a56){if(_0x142f01['body']['id']){delete _0x142f01['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x142f01[_0x97f7('0x41')]['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x8c9a56,null))['then'](saveUpdates(_0x142f01[_0x97f7('0x47')],null))[_0x97f7('0x24')](respondWithResult(_0x8c9a56,null))[_0x97f7('0x40')](handleError(_0x8c9a56,null));};exports[_0x97f7('0x25')]=function(_0x2b9e95,_0x246c93){return db[_0x97f7('0x29')][_0x97f7('0x45')]({'where':{'id':_0x2b9e95[_0x97f7('0x41')]['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x246c93,null))[_0x97f7('0x24')](removeEntity(_0x246c93,null))[_0x97f7('0x40')](handleError(_0x246c93,null));};exports[_0x97f7('0x48')]=function(_0x3cde49,_0x164fd8,_0x161804){var _0x11a4cc={};var _0x5dbf5f={};var _0x226133;var _0x371c75;return db['SugarcrmAccount'][_0x97f7('0x49')]({'where':{'id':_0x3cde49['params']['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x164fd8,null))[_0x97f7('0x24')](function(_0x4ac4bb){if(_0x4ac4bb){_0x226133=_0x4ac4bb;_0x5dbf5f[_0x97f7('0x2d')]=_[_0x97f7('0x2f')](db['SugarcrmConfiguration'][_0x97f7('0x2a')]);_0x5dbf5f['query']=_[_0x97f7('0x2f')](_0x3cde49['query']);_0x5dbf5f[_0x97f7('0x30')]=_['intersection'](_0x5dbf5f[_0x97f7('0x2d')],_0x5dbf5f[_0x97f7('0x2e')]);_0x11a4cc[_0x97f7('0x33')]=_[_0x97f7('0x31')](_0x5dbf5f['model'],qs[_0x97f7('0x32')](_0x3cde49[_0x97f7('0x2e')][_0x97f7('0x32')]));_0x11a4cc[_0x97f7('0x33')]=_0x11a4cc[_0x97f7('0x33')][_0x97f7('0x34')]?_0x11a4cc[_0x97f7('0x33')]:_0x5dbf5f[_0x97f7('0x2d')];_0x11a4cc[_0x97f7('0x37')]=qs[_0x97f7('0x38')](_0x3cde49['query'][_0x97f7('0x38')]);_0x11a4cc[_0x97f7('0x39')]=qs[_0x97f7('0x30')](_[_0x97f7('0x3a')](_0x3cde49['query'],_0x5dbf5f[_0x97f7('0x30')]));if(_0x3cde49[_0x97f7('0x2e')]['filter']){_0x11a4cc['where']=_[_0x97f7('0x3c')](_0x11a4cc['where'],{'$or':_[_0x97f7('0x28')](_0x11a4cc[_0x97f7('0x33')],function(_0xd70c6a){var _0x162322={};_0x162322[_0xd70c6a]={'$like':'%'+_0x3cde49['query']['filter']+'%'};return _0x162322;})});}_0x11a4cc=_[_0x97f7('0x3c')]({},_0x11a4cc,_0x3cde49[_0x97f7('0x44')]);return _0x226133[_0x97f7('0x48')](_0x11a4cc);}})['then'](function(_0x53351f){if(_0x53351f){_0x371c75=_0x53351f[_0x97f7('0x34')];if(!_0x3cde49[_0x97f7('0x2e')]['hasOwnProperty'](_0x97f7('0x36'))){_0x11a4cc[_0x97f7('0x1e')]=qs[_0x97f7('0x1e')](_0x3cde49['query'][_0x97f7('0x1e')]);_0x11a4cc['offset']=qs[_0x97f7('0x1c')](_0x3cde49[_0x97f7('0x2e')][_0x97f7('0x1c')]);}return _0x226133['getConfigurations'](_0x11a4cc);}})[_0x97f7('0x24')](function(_0x56f713){if(_0x56f713){return _0x56f713?{'count':_0x371c75,'rows':_0x56f713}:null;}})[_0x97f7('0x24')](respondWithResult(_0x164fd8,null))[_0x97f7('0x40')](handleError(_0x164fd8,null));};exports[_0x97f7('0x4a')]=function(_0x26f4a7,_0x50ab79,_0x29d18f){if(_0x26f4a7[_0x97f7('0x47')]['id']){delete _0x26f4a7['body']['id'];}return db['SugarcrmAccount'][_0x97f7('0x49')]({'where':{'id':_0x26f4a7[_0x97f7('0x41')]['id']}})[_0x97f7('0x24')](handleEntityNotFound(_0x50ab79,null))[_0x97f7('0x24')](function(_0x5f2932){if(_0x5f2932){_0x26f4a7[_0x97f7('0x47')]['AccountId']=_0x5f2932['id'];_0x26f4a7[_0x97f7('0x47')][_0x97f7('0x4b')]=integrations[_0x97f7('0x4c')](_0x26f4a7[_0x97f7('0x47')][_0x97f7('0x4d')],_0x26f4a7[_0x97f7('0x47')][_0x97f7('0x2b')]);_0x26f4a7[_0x97f7('0x47')]['Descriptions']=integrations[_0x97f7('0x4e')](_0x26f4a7[_0x97f7('0x47')][_0x97f7('0x4d')],_0x26f4a7[_0x97f7('0x47')][_0x97f7('0x2b')]);return db[_0x97f7('0x4f')][_0x97f7('0x46')](_0x26f4a7[_0x97f7('0x47')],{'include':[{'model':db[_0x97f7('0x50')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x97f7('0x51')}]});}return null;})[_0x97f7('0x24')](respondWithResult(_0x50ab79,null))['catch'](handleError(_0x50ab79,null));};exports['getFields']=function(_0x33dbf0,_0x37b65a,_0x3d4b3d){var _0x3a851c='';var _0x5cf721=['id',_0x97f7('0x52'),_0x97f7('0x53'),_0x97f7('0x54'),_0x97f7('0x55'),'date_start',_0x97f7('0x56'),_0x97f7('0x57'),'parent_id',_0x97f7('0x58'),_0x97f7('0x59'),_0x97f7('0x5a')];return db['SugarcrmAccount'][_0x97f7('0x49')]({'where':{'id':_0x33dbf0[_0x97f7('0x41')]['id']},'attributes':['id',_0x97f7('0x5b'),_0x97f7('0x5c'),_0x97f7('0x5d')]})[_0x97f7('0x24')](handleEntityNotFound(_0x37b65a,null))[_0x97f7('0x24')](function(_0xee37d6){if(_0xee37d6){_0x3a851c=_0xee37d6['remoteUri'];var _0x14b676=_0x3a851c['slice'](-0x1);if(_0x14b676==='/'){_0x3a851c=_0x3a851c['substring'](0x0,_0x3a851c[_0x97f7('0x5e')](_0x14b676));}return rp({'method':_0x97f7('0x5f'),'uri':util[_0x97f7('0x60')](_0x97f7('0x61'),_0x3a851c,_0x97f7('0x62')),'json':!![],'form':{'method':_0x97f7('0x63'),'input_type':_0x97f7('0x64'),'response_type':_0x97f7('0x64'),'rest_data':JSON[_0x97f7('0x65')]({'user_auth':{'user_name':_0xee37d6[_0x97f7('0x5b')],'password':_0xee37d6[_0x97f7('0x5c')],'encryption':'PLAIN'},'application':_0x97f7('0x66')})}});}})[_0x97f7('0x24')](function(_0x2298fe){if(_0x2298fe&&_0x2298fe[_0x97f7('0x52')]!=='Invalid\x20Login'&&_0x2298fe[_0x97f7('0x52')]!==_0x97f7('0x67')){return rp({'method':_0x97f7('0x5f'),'uri':util[_0x97f7('0x60')]('%s%s',_0x3a851c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x97f7('0x68'),'input_type':_0x97f7('0x64'),'response_type':_0x97f7('0x64'),'rest_data':JSON['stringify']({'session':_0x2298fe['id'],'module_name':_0x97f7('0x69')})}})['then'](function(_0x36e4f0){if(_0x36e4f0){var _0x248742=_[_0x97f7('0x6a')](_0x36e4f0[_0x97f7('0x6b')]);_[_0x97f7('0x6c')](_0x248742,function(_0x408f9d){return _0x5cf721[_0x97f7('0x6d')](_0x408f9d[_0x97f7('0x52')]);});return{'count':_0x248742[_0x97f7('0x34')],'rows':_['map'](_0x248742,function(_0x2ac979){return{'id':_0x2ac979[_0x97f7('0x52')],'name':_0x2ac979[_0x97f7('0x6e')],'custom':_['endsWith'](_0x2ac979['name'],'_c')?!![]:![],'options':_0x2ac979['options']?_[_0x97f7('0x28')](_[_0x97f7('0x6a')](_0x2ac979[_0x97f7('0x44')]),function(_0x45a312){return{'name':_0x45a312['value'],'value':_0x45a312[_0x97f7('0x52')]};}):[]};})};}})[_0x97f7('0x24')](respondWithResult(_0x37b65a,null))[_0x97f7('0x40')](function(_0x1d11e6){var _0x8a3073=_0x33dbf0[_0x97f7('0x2e')][_0x97f7('0x6f')]?0x1f4:_0x1d11e6[_0x97f7('0x70')]||0x1f4;logger[_0x97f7('0x26')](_0x97f7('0x71'),'getFields',_0x8a3073,JSON[_0x97f7('0x65')](_0x1d11e6));delete _0x1d11e6[_0x97f7('0x52')];if(_0x8a3073===0x191){_0x8a3073=0x190;}_0x37b65a[_0x97f7('0x1a')](_0x8a3073)[_0x97f7('0x72')](_0x33dbf0[_0x97f7('0x2e')][_0x97f7('0x6f')]?{'message':_0x97f7('0x73'),'statusCode':_0x1d11e6[_0x97f7('0x70')]}:_0x1d11e6);});}else{var _0x4f9687=0x1f4;_0x37b65a[_0x97f7('0x1a')](_0x4f9687)[_0x97f7('0x72')]({'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 0675168..7425f7c 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 _0x142a=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x5e0adc,_0x430b66){var _0xb9565b=function(_0x511dc5){while(--_0x511dc5){_0x5e0adc['push'](_0x5e0adc['shift']());}};_0xb9565b(++_0x430b66);}(_0x142a,0x18b));var _0xa142=function(_0x5cc9e4,_0x2d1a8f){_0x5cc9e4=_0x5cc9e4-0x0;var _0x3914df=_0x142a[_0x5cc9e4];return _0x3914df;};'use strict';var _=require(_0xa142('0x0'));var util=require(_0xa142('0x1'));var logger=require(_0xa142('0x2'))(_0xa142('0x3'));var moment=require(_0xa142('0x4'));var BPromise=require('bluebird');var rp=require(_0xa142('0x5'));var fs=require('fs');var path=require(_0xa142('0x6'));var rimraf=require(_0xa142('0x7'));var config=require('../../config/environment');var attributes=require(_0xa142('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3784a1,_0x4857c8){return _0x3784a1[_0xa142('0x9')](_0xa142('0xa'),attributes,{'tableName':_0xa142('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa60=['path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xfa60,0x8a));var _0x0fa6=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xfa60[_0x18546c];return _0x46ef43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0fa6('0x0'))(_0x0fa6('0x1'));var moment=require(_0x0fa6('0x2'));var BPromise=require(_0x0fa6('0x3'));var rp=require(_0x0fa6('0x4'));var fs=require('fs');var path=require(_0x0fa6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0fa6('0x6'));var integrations=require(_0x0fa6('0x7'));module[_0x0fa6('0x8')]=function(_0x518e69,_0x535139){return _0x518e69[_0x0fa6('0x9')](_0x0fa6('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','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 9c2d52d..aa8d336 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 _0x7719=['SugarcrmAccount','options','raw','attributes','include','map','model','find','where','ShowSugarcrmAccount','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x7719,0xa5));var _0x9771=function(_0x3268bb,_0x4ca217){_0x3268bb=_0x3268bb-0x0;var _0xe835=_0x7719[_0x3268bb];return _0xe835;};'use strict';var _=require('lodash');var util=require(_0x9771('0x0'));var moment=require(_0x9771('0x1'));var BPromise=require(_0x9771('0x2'));var rs=require(_0x9771('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9771('0x4'));var logger=require('../../config/logger')(_0x9771('0x5'));var config=require(_0x9771('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9771('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ace58,_0x3396ee,_0x20647f){return new BPromise(function(_0x3b08fc,_0x518b13){return client['request'](_0x1ace58,_0x20647f)[_0x9771('0x8')](function(_0x1101e5){logger[_0x9771('0x9')](_0x9771('0xa'),_0x3396ee,_0x9771('0xb'));logger[_0x9771('0xc')](_0x9771('0xd'),_0x3396ee,_0x9771('0xb'),JSON[_0x9771('0xe')](_0x1101e5));if(_0x1101e5[_0x9771('0xf')]){if(_0x1101e5[_0x9771('0xf')][_0x9771('0x10')]===0x1f4){logger[_0x9771('0xf')](_0x9771('0xa'),_0x3396ee,_0x1101e5['error']['message']);return _0x518b13(_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);}logger[_0x9771('0xf')](_0x9771('0xa'),_0x3396ee,_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);return _0x3b08fc(_0x1101e5[_0x9771('0xf')][_0x9771('0x11')]);}else{logger[_0x9771('0x9')](_0x9771('0xa'),_0x3396ee,'request\x20sent');_0x3b08fc(_0x1101e5[_0x9771('0x12')][_0x9771('0x11')]);}})[_0x9771('0x13')](function(_0xa23734){logger[_0x9771('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x3396ee,_0xa23734);_0x518b13(_0xa23734);});});}exports[_0x9771('0x14')]=function(_0x10d3d0){var _0x5c23d8=this;return new Promise(function(_0x13acf8,_0x3d292c){return db[_0x9771('0x15')]['findAll']({'raw':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')][_0x9771('0x17')]===undefined?!![]:![]:!![],'where':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')]['where']||null:null,'attributes':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0['options'][_0x9771('0x18')]||null:null,'limit':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0['options']['limit']||null:null,'include':_0x10d3d0[_0x9771('0x16')]?_0x10d3d0[_0x9771('0x16')][_0x9771('0x19')]?_[_0x9771('0x1a')](_0x10d3d0[_0x9771('0x16')]['include'],function(_0x1fe053){return{'model':db[_0x1fe053[_0x9771('0x1b')]],'as':_0x1fe053['as'],'attributes':_0x1fe053[_0x9771('0x18')],'include':_0x1fe053[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x1fe053[_0x9771('0x19')],function(_0x143419){return{'model':db[_0x143419[_0x9771('0x1b')]],'as':_0x143419['as'],'attributes':_0x143419[_0x9771('0x18')],'include':_0x143419[_0x9771('0x19')]?_['map'](_0x143419[_0x9771('0x19')],function(_0x525ac){return{'model':db[_0x525ac[_0x9771('0x1b')]],'as':_0x525ac['as'],'attributes':_0x525ac[_0x9771('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9771('0x8')](function(_0xd617c8){logger[_0x9771('0x9')](_0x9771('0x14'),_0x10d3d0);logger['debug'](_0x9771('0x14'),_0x10d3d0,JSON[_0x9771('0xe')](_0xd617c8));_0x13acf8(_0xd617c8);})[_0x9771('0x13')](function(_0x352231){logger[_0x9771('0xf')](_0x9771('0x14'),_0x352231['message'],_0x10d3d0);_0x3d292c(_0x5c23d8[_0x9771('0xf')](0x1f4,_0x352231[_0x9771('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x559e22){var _0x5b795f=this;return new Promise(function(_0x43eb10,_0x2ddc75){return db[_0x9771('0x15')][_0x9771('0x1c')]({'raw':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')][_0x9771('0x17')]===undefined?!![]:![]:!![],'where':_0x559e22['options']?_0x559e22[_0x9771('0x16')][_0x9771('0x1d')]||null:null,'attributes':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')][_0x9771('0x18')]||null:null,'include':_0x559e22[_0x9771('0x16')]?_0x559e22[_0x9771('0x16')]['include']?_[_0x9771('0x1a')](_0x559e22[_0x9771('0x16')][_0x9771('0x19')],function(_0x2dc373){return{'model':db[_0x2dc373[_0x9771('0x1b')]],'as':_0x2dc373['as'],'attributes':_0x2dc373[_0x9771('0x18')],'include':_0x2dc373[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x2dc373[_0x9771('0x19')],function(_0x26d5cb){return{'model':db[_0x26d5cb[_0x9771('0x1b')]],'as':_0x26d5cb['as'],'attributes':_0x26d5cb[_0x9771('0x18')],'include':_0x26d5cb[_0x9771('0x19')]?_[_0x9771('0x1a')](_0x26d5cb[_0x9771('0x19')],function(_0x402a81){return{'model':db[_0x402a81[_0x9771('0x1b')]],'as':_0x402a81['as'],'attributes':_0x402a81[_0x9771('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9771('0x8')](function(_0x153bf2){logger[_0x9771('0x9')](_0x9771('0x1e'),_0x559e22);logger['debug']('ShowSugarcrmAccount',_0x559e22,JSON[_0x9771('0xe')](_0x153bf2));_0x43eb10(_0x153bf2);})[_0x9771('0x13')](function(_0x1cd310){logger['error'](_0x9771('0x1e'),_0x1cd310[_0x9771('0x11')],_0x559e22);_0x2ddc75(_0x5b795f['error'](0x1f4,_0x1cd310[_0x9771('0x11')]));});});}; \ No newline at end of file +var _0xe1c3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe1c3,0x1db));var _0x3e1c=function(_0x5a4c4f,_0xefb174){_0x5a4c4f=_0x5a4c4f-0x0;var _0x34279b=_0xe1c3[_0x5a4c4f];return _0x34279b;};'use strict';var _=require(_0x3e1c('0x0'));var util=require(_0x3e1c('0x1'));var moment=require('moment');var BPromise=require(_0x3e1c('0x2'));var rs=require(_0x3e1c('0x3'));var fs=require('fs');var Redis=require(_0x3e1c('0x4'));var db=require(_0x3e1c('0x5'))['db'];var utils=require(_0x3e1c('0x6'));var logger=require(_0x3e1c('0x7'))(_0x3e1c('0x8'));var config=require(_0x3e1c('0x9'));var jayson=require(_0x3e1c('0xa'));var client=jayson['client'][_0x3e1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55e109,_0x4e9a3c,_0x506b24){return new BPromise(function(_0x4d2781,_0x1fc4d5){return client[_0x3e1c('0xc')](_0x55e109,_0x506b24)[_0x3e1c('0xd')](function(_0x31da21){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4e9a3c,_0x3e1c('0xe'));logger[_0x3e1c('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4e9a3c,_0x3e1c('0xe'),JSON[_0x3e1c('0x10')](_0x31da21));if(_0x31da21['error']){if(_0x31da21[_0x3e1c('0x11')][_0x3e1c('0x12')]===0x1f4){logger[_0x3e1c('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x4e9a3c,_0x31da21[_0x3e1c('0x11')][_0x3e1c('0x13')]);return _0x1fc4d5(_0x31da21[_0x3e1c('0x11')]['message']);}logger[_0x3e1c('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x4e9a3c,_0x31da21[_0x3e1c('0x11')]['message']);return _0x4d2781(_0x31da21[_0x3e1c('0x11')][_0x3e1c('0x13')]);}else{logger['info'](_0x3e1c('0x14'),_0x4e9a3c,'request\x20sent');_0x4d2781(_0x31da21[_0x3e1c('0x15')][_0x3e1c('0x13')]);}})[_0x3e1c('0x16')](function(_0x194ae1){logger['error'](_0x3e1c('0x14'),_0x4e9a3c,_0x194ae1);_0x1fc4d5(_0x194ae1);});});}exports[_0x3e1c('0x17')]=function(_0x3fc820){var _0x41a1f6=this;return new Promise(function(_0x2646cd,_0x52ddb0){return db[_0x3e1c('0x18')][_0x3e1c('0x19')]({'raw':_0x3fc820[_0x3e1c('0x1a')]?_0x3fc820[_0x3e1c('0x1a')][_0x3e1c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc820[_0x3e1c('0x1a')]?_0x3fc820['options'][_0x3e1c('0x1c')]||null:null,'attributes':_0x3fc820[_0x3e1c('0x1a')]?_0x3fc820[_0x3e1c('0x1a')][_0x3e1c('0x1d')]||null:null,'limit':_0x3fc820[_0x3e1c('0x1a')]?_0x3fc820['options'][_0x3e1c('0x1e')]||null:null,'include':_0x3fc820[_0x3e1c('0x1a')]?_0x3fc820[_0x3e1c('0x1a')][_0x3e1c('0x1f')]?_[_0x3e1c('0x20')](_0x3fc820['options'][_0x3e1c('0x1f')],function(_0x34bde3){return{'model':db[_0x34bde3[_0x3e1c('0x21')]],'as':_0x34bde3['as'],'attributes':_0x34bde3[_0x3e1c('0x1d')],'include':_0x34bde3[_0x3e1c('0x1f')]?_['map'](_0x34bde3[_0x3e1c('0x1f')],function(_0x39193a){return{'model':db[_0x39193a['model']],'as':_0x39193a['as'],'attributes':_0x39193a[_0x3e1c('0x1d')],'include':_0x39193a[_0x3e1c('0x1f')]?_[_0x3e1c('0x20')](_0x39193a[_0x3e1c('0x1f')],function(_0x374009){return{'model':db[_0x374009[_0x3e1c('0x21')]],'as':_0x374009['as'],'attributes':_0x374009[_0x3e1c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e1c('0xd')](function(_0x4a07d8){logger[_0x3e1c('0x22')](_0x3e1c('0x17'),_0x3fc820);logger[_0x3e1c('0xf')]('GetSugarcrmAccount',_0x3fc820,JSON[_0x3e1c('0x10')](_0x4a07d8));_0x2646cd(_0x4a07d8);})['catch'](function(_0x14b7c4){logger[_0x3e1c('0x11')]('GetSugarcrmAccount',_0x14b7c4['message'],_0x3fc820);_0x52ddb0(_0x41a1f6['error'](0x1f4,_0x14b7c4[_0x3e1c('0x13')]));});});};exports[_0x3e1c('0x23')]=function(_0x2b807d){var _0x46db9f=this;return new Promise(function(_0x1c0212,_0x32af56){return db[_0x3e1c('0x18')][_0x3e1c('0x24')]({'raw':_0x2b807d[_0x3e1c('0x1a')]?_0x2b807d['options'][_0x3e1c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b807d[_0x3e1c('0x1a')]?_0x2b807d[_0x3e1c('0x1a')][_0x3e1c('0x1c')]||null:null,'attributes':_0x2b807d['options']?_0x2b807d['options'][_0x3e1c('0x1d')]||null:null,'include':_0x2b807d[_0x3e1c('0x1a')]?_0x2b807d[_0x3e1c('0x1a')]['include']?_[_0x3e1c('0x20')](_0x2b807d[_0x3e1c('0x1a')]['include'],function(_0x57116a){return{'model':db[_0x57116a[_0x3e1c('0x21')]],'as':_0x57116a['as'],'attributes':_0x57116a[_0x3e1c('0x1d')],'include':_0x57116a[_0x3e1c('0x1f')]?_[_0x3e1c('0x20')](_0x57116a[_0x3e1c('0x1f')],function(_0x3c04e0){return{'model':db[_0x3c04e0['model']],'as':_0x3c04e0['as'],'attributes':_0x3c04e0[_0x3e1c('0x1d')],'include':_0x3c04e0[_0x3e1c('0x1f')]?_[_0x3e1c('0x20')](_0x3c04e0[_0x3e1c('0x1f')],function(_0x2da152){return{'model':db[_0x2da152[_0x3e1c('0x21')]],'as':_0x2da152['as'],'attributes':_0x2da152[_0x3e1c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e1c('0xd')](function(_0x2b4e5c){logger[_0x3e1c('0x22')](_0x3e1c('0x23'),_0x2b807d);logger[_0x3e1c('0xf')]('ShowSugarcrmAccount',_0x2b807d,JSON['stringify'](_0x2b4e5c));_0x1c0212(_0x2b4e5c);})[_0x3e1c('0x16')](function(_0x31bf6d){logger[_0x3e1c('0x11')](_0x3e1c('0x23'),_0x31bf6d[_0x3e1c('0x13')],_0x2b807d);_0x32af56(_0x46db9f[_0x3e1c('0x11')](0x1f4,_0x31bf6d[_0x3e1c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 584a7cc..459d5de 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 _0x3dac=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x3dac,0x1ad));var _0xc3da=function(_0x174774,_0x295daf){_0x174774=_0x174774-0x0;var _0x465a72=_0x3dac[_0x174774];return _0x465a72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3da('0x0'));var timeout=require(_0xc3da('0x1'));var express=require(_0xc3da('0x2'));var router=express[_0xc3da('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc3da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc3da('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xc3da('0x6')]('/',auth[_0xc3da('0x7')](),controller[_0xc3da('0x8')]);router[_0xc3da('0x6')]('/:id',auth[_0xc3da('0x7')](),controller[_0xc3da('0x9')]);router[_0xc3da('0x6')](_0xc3da('0xa'),auth['isAuthenticated'](),controller[_0xc3da('0xb')]);router['get'](_0xc3da('0xc'),auth[_0xc3da('0x7')](),controller[_0xc3da('0xd')]);router[_0xc3da('0x6')](_0xc3da('0xe'),auth[_0xc3da('0x7')](),controller[_0xc3da('0xf')]);router[_0xc3da('0x10')]('/',auth['isAuthenticated'](),controller[_0xc3da('0x11')]);router[_0xc3da('0x12')]('/:id',auth[_0xc3da('0x7')](),controller[_0xc3da('0x13')]);router['delete'](_0xc3da('0x14'),auth[_0xc3da('0x7')](),controller['destroy']);module[_0xc3da('0x15')]=router; \ No newline at end of file +var _0x4498=['delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x67c742,_0x24d70d){var _0x2b36c6=function(_0x22c36b){while(--_0x22c36b){_0x67c742['push'](_0x67c742['shift']());}};_0x2b36c6(++_0x24d70d);}(_0x4498,0xc8));var _0x8449=function(_0x53f218,_0x27514c){_0x53f218=_0x53f218-0x0;var _0x21890a=_0x4498[_0x53f218];return _0x21890a;};'use strict';var multer=require(_0x8449('0x0'));var util=require(_0x8449('0x1'));var path=require('path');var timeout=require(_0x8449('0x2'));var express=require(_0x8449('0x3'));var router=express[_0x8449('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8449('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8449('0x6'));var controller=require(_0x8449('0x7'));router[_0x8449('0x8')]('/',auth[_0x8449('0x9')](),controller[_0x8449('0xa')]);router[_0x8449('0x8')]('/:id',auth[_0x8449('0x9')](),controller[_0x8449('0xb')]);router[_0x8449('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8449('0xc')]);router[_0x8449('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x8449('0x8')](_0x8449('0xd'),auth[_0x8449('0x9')](),controller[_0x8449('0xe')]);router[_0x8449('0xf')]('/',auth[_0x8449('0x9')](),controller[_0x8449('0x10')]);router[_0x8449('0x11')](_0x8449('0x12'),auth[_0x8449('0x9')](),controller[_0x8449('0x13')]);router[_0x8449('0x14')](_0x8449('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x8449('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1a12c95..be1fa8e 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 _0x4cda=['STRING','sequelize','exports'];(function(_0x26248b,_0xc0cd2b){var _0x2810a2=function(_0x4326d1){while(--_0x4326d1){_0x26248b['push'](_0x26248b['shift']());}};_0x2810a2(++_0xc0cd2b);}(_0x4cda,0x172));var _0xa4cd=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x4cda[_0x329664];return _0x4e346e;};'use strict';var Sequelize=require(_0xa4cd('0x0'));module[_0xa4cd('0x1')]={'name':{'type':Sequelize[_0xa4cd('0x2')]},'description':{'type':Sequelize[_0xa4cd('0x2')]}}; \ No newline at end of file +var _0x21d7=['STRING','sequelize','exports'];(function(_0x17b778,_0x419ff9){var _0x317213=function(_0x5333d0){while(--_0x5333d0){_0x17b778['push'](_0x17b778['shift']());}};_0x317213(++_0x419ff9);}(_0x21d7,0x1de));var _0x721d=function(_0x3793c0,_0x1198be){_0x3793c0=_0x3793c0-0x0;var _0x4e8c25=_0x21d7[_0x3793c0];return _0x4e8c25;};'use strict';var Sequelize=require(_0x721d('0x0'));module[_0x721d('0x1')]={'name':{'type':Sequelize[_0x721d('0x2')]},'description':{'type':Sequelize[_0x721d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e5e3aa1..3f50e96 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 _0x012e=['name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','getFields','findOne','nolimit','getSubjects','SugarcrmField','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x012e,0x112));var _0xe012=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x012e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe012('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe012('0x1'));var rp=require('request-promise');var moment=require(_0xe012('0x2'));var BPromise=require(_0xe012('0x3'));var Mustache=require(_0xe012('0x4'));var util=require('util');var path=require(_0xe012('0x5'));var sox=require('sox');var csv=require(_0xe012('0x6'));var ejs=require(_0xe012('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe012('0x8'));var squel=require(_0xe012('0x9'));var crypto=require(_0xe012('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe012('0x6'));var querystring=require(_0xe012('0xb'));var Papa=require('papaparse');var Redis=require(_0xe012('0xc'));var authService=require(_0xe012('0xd'));var qs=require(_0xe012('0xe'));var as=require(_0xe012('0xf'));var hardwareService=require(_0xe012('0x10'));var logger=require(_0xe012('0x11'))('api');var utils=require(_0xe012('0x12'));var config=require(_0xe012('0x13'));var licenseUtil=require(_0xe012('0x14'));var db=require(_0xe012('0x15'))['db'];function respondWithStatusCode(_0x466754,_0x11a136){_0x11a136=_0x11a136||0xcc;return function(_0x49dbec){if(_0x49dbec){return _0x466754[_0xe012('0x16')](_0x11a136);}return _0x466754[_0xe012('0x17')](_0x11a136)[_0xe012('0x18')]();};}function respondWithResult(_0x2b9ccc,_0x2b9ad8){_0x2b9ad8=_0x2b9ad8||0xc8;return function(_0x26a492){if(_0x26a492){return _0x2b9ccc['status'](_0x2b9ad8)[_0xe012('0x19')](_0x26a492);}};}function respondWithFilteredResult(_0x510685,_0x1107c1){return function(_0x100f8d){if(_0x100f8d){var _0x3ecc21=typeof _0x1107c1[_0xe012('0x1a')]===_0xe012('0x1b')&&typeof _0x1107c1['limit']==='undefined';var _0x4a53b4=_0x100f8d[_0xe012('0x1c')];var _0x2a4609=_0x3ecc21?0x0:_0x1107c1[_0xe012('0x1a')];var _0x25eb2f=_0x3ecc21?_0x100f8d['count']:_0x1107c1[_0xe012('0x1a')]+_0x1107c1[_0xe012('0x1d')];var _0x81b09e;if(_0x25eb2f>=_0x4a53b4){_0x25eb2f=_0x4a53b4;_0x81b09e=0xc8;}else{_0x81b09e=0xce;}_0x510685[_0xe012('0x17')](_0x81b09e);return _0x510685[_0xe012('0x1e')](_0xe012('0x1f'),_0x2a4609+'-'+_0x25eb2f+'/'+_0x4a53b4)[_0xe012('0x19')](_0x100f8d);}return null;};}function patchUpdates(_0x34116e){return function(_0x55c3e4){try{jsonpatch[_0xe012('0x20')](_0x55c3e4,_0x34116e,!![]);}catch(_0x4ddbff){return BPromise[_0xe012('0x21')](_0x4ddbff);}return _0x55c3e4[_0xe012('0x22')]();};}function saveUpdates(_0x8b8556,_0x488511){return function(_0x3e5aca){if(_0x3e5aca){return _0x3e5aca[_0xe012('0x23')](_0x8b8556)['then'](function(_0xaa5ab4){return _0xaa5ab4;});}return null;};}function removeEntity(_0x597442,_0x401306){return function(_0x3e0452){if(_0x3e0452){return _0x3e0452['destroy']()[_0xe012('0x24')](function(){_0x597442[_0xe012('0x17')](0xcc)[_0xe012('0x18')]();});}};}function handleEntityNotFound(_0x23a9e8,_0x123026){return function(_0x1b3094){if(!_0x1b3094){_0x23a9e8[_0xe012('0x16')](0x194);}return _0x1b3094;};}function handleError(_0x360b3d,_0x169547){_0x169547=_0x169547||0x1f4;return function(_0x5b897e){logger[_0xe012('0x25')](_0x5b897e['stack']);if(_0x5b897e['name']){delete _0x5b897e[_0xe012('0x26')];}_0x360b3d[_0xe012('0x17')](_0x169547)[_0xe012('0x27')](_0x5b897e);};}exports['index']=function(_0x51d61c,_0x438f3d){var _0x2f66dd={},_0x19bb1b={},_0x20b018={'count':0x0,'rows':[]};var _0x1d3979=_['map'](db[_0xe012('0x28')][_0xe012('0x29')],function(_0x25ea14){return{'name':_0x25ea14[_0xe012('0x2a')],'type':_0x25ea14[_0xe012('0x2b')]['key']};});_0x19bb1b['model']=_[_0xe012('0x2c')](_0x1d3979,_0xe012('0x26'));_0x19bb1b[_0xe012('0x2d')]=_[_0xe012('0x2e')](_0x51d61c[_0xe012('0x2d')]);_0x19bb1b['filters']=_[_0xe012('0x2f')](_0x19bb1b['model'],_0x19bb1b[_0xe012('0x2d')]);_0x2f66dd[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x19bb1b[_0xe012('0x31')],qs[_0xe012('0x32')](_0x51d61c[_0xe012('0x2d')]['fields']));_0x2f66dd[_0xe012('0x30')]=_0x2f66dd[_0xe012('0x30')][_0xe012('0x33')]?_0x2f66dd[_0xe012('0x30')]:_0x19bb1b[_0xe012('0x31')];if(!_0x51d61c['query'][_0xe012('0x34')]('nolimit')){_0x2f66dd[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x51d61c['query'][_0xe012('0x1d')]);_0x2f66dd[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x51d61c[_0xe012('0x2d')][_0xe012('0x1a')]);}_0x2f66dd[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x51d61c[_0xe012('0x2d')][_0xe012('0x36')]);_0x2f66dd[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x51d61c[_0xe012('0x2d')],_0x19bb1b['filters']),_0x1d3979);if(_0x51d61c[_0xe012('0x2d')][_0xe012('0x3a')]){_0x2f66dd['where']=_[_0xe012('0x3b')](_0x2f66dd[_0xe012('0x37')],{'$or':_[_0xe012('0x2c')](_0x1d3979,function(_0x10419e){if(_0x10419e[_0xe012('0x2b')]!==_0xe012('0x3c')){var _0x4230cd={};_0x4230cd[_0x10419e[_0xe012('0x26')]]={'$like':'%'+_0x51d61c[_0xe012('0x2d')][_0xe012('0x3a')]+'%'};return _0x4230cd;}})});}_0x2f66dd=_[_0xe012('0x3b')]({},_0x2f66dd,_0x51d61c[_0xe012('0x3d')]);var _0x57a5d5={'where':_0x2f66dd['where']};return db[_0xe012('0x28')]['count'](_0x57a5d5)[_0xe012('0x24')](function(_0x51ab52){_0x20b018[_0xe012('0x1c')]=_0x51ab52;if(_0x51d61c[_0xe012('0x2d')][_0xe012('0x3e')]){_0x2f66dd[_0xe012('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x2f66dd);})[_0xe012('0x24')](function(_0x26d50c){_0x20b018[_0xe012('0x40')]=_0x26d50c;return _0x20b018;})[_0xe012('0x24')](respondWithFilteredResult(_0x438f3d,_0x2f66dd))[_0xe012('0x41')](handleError(_0x438f3d,null));};exports[_0xe012('0x42')]=function(_0x1f30dc,_0x1e2d60){var _0xc4d59b={'raw':![],'where':{'id':_0x1f30dc['params']['id']}},_0x23f86e={};_0x23f86e[_0xe012('0x31')]=_[_0xe012('0x2e')](db[_0xe012('0x28')][_0xe012('0x29')]);_0x23f86e[_0xe012('0x2d')]=_['keys'](_0x1f30dc[_0xe012('0x2d')]);_0x23f86e[_0xe012('0x38')]=_[_0xe012('0x2f')](_0x23f86e[_0xe012('0x31')],_0x23f86e[_0xe012('0x2d')]);_0xc4d59b[_0xe012('0x30')]=_['intersection'](_0x23f86e[_0xe012('0x31')],qs['fields'](_0x1f30dc[_0xe012('0x2d')][_0xe012('0x32')]));_0xc4d59b[_0xe012('0x30')]=_0xc4d59b['attributes'][_0xe012('0x33')]?_0xc4d59b[_0xe012('0x30')]:_0x23f86e[_0xe012('0x31')];if(_0x1f30dc['query'][_0xe012('0x3e')]){_0xc4d59b[_0xe012('0x3f')]=[{'all':!![]}];}_0xc4d59b=_['merge']({},_0xc4d59b,_0x1f30dc['options']);return db[_0xe012('0x28')][_0xe012('0x43')](_0xc4d59b)[_0xe012('0x24')](handleEntityNotFound(_0x1e2d60,null))[_0xe012('0x24')](respondWithResult(_0x1e2d60,null))[_0xe012('0x41')](handleError(_0x1e2d60,null));};exports[_0xe012('0x44')]=function(_0xa46047,_0x2c5f49){return db[_0xe012('0x28')][_0xe012('0x44')](_0xa46047[_0xe012('0x45')],{})['then'](respondWithResult(_0x2c5f49,0xc9))['catch'](handleError(_0x2c5f49,null));};exports[_0xe012('0x23')]=function(_0x55b909,_0x91b007){if(_0x55b909[_0xe012('0x45')]['id']){delete _0x55b909['body']['id'];}return db[_0xe012('0x28')][_0xe012('0x43')]({'where':{'id':_0x55b909[_0xe012('0x46')]['id']}})['then'](handleEntityNotFound(_0x91b007,null))[_0xe012('0x24')](saveUpdates(_0x55b909[_0xe012('0x45')],null))['then'](respondWithResult(_0x91b007,null))[_0xe012('0x41')](handleError(_0x91b007,null));};exports[_0xe012('0x47')]=function(_0x40416e,_0x3859e0){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x40416e[_0xe012('0x46')]['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x3859e0,null))['then'](removeEntity(_0x3859e0,null))['catch'](handleError(_0x3859e0,null));};exports[_0xe012('0x48')]=function(_0x4dc4fa,_0x488e8f,_0x5982f6){var _0x1bd07c={};var _0x2d5b02={};var _0x4b9fbb;var _0x210ced;return db[_0xe012('0x28')][_0xe012('0x49')]({'where':{'id':_0x4dc4fa['params']['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x488e8f,null))[_0xe012('0x24')](function(_0x424e8a){if(_0x424e8a){_0x4b9fbb=_0x424e8a;_0x2d5b02[_0xe012('0x31')]=_['keys'](db['SugarcrmField'][_0xe012('0x29')]);_0x2d5b02['query']=_[_0xe012('0x2e')](_0x4dc4fa['query']);_0x2d5b02[_0xe012('0x38')]=_['intersection'](_0x2d5b02[_0xe012('0x31')],_0x2d5b02['query']);_0x1bd07c[_0xe012('0x30')]=_['intersection'](_0x2d5b02[_0xe012('0x31')],qs[_0xe012('0x32')](_0x4dc4fa[_0xe012('0x2d')]['fields']));_0x1bd07c['attributes']=_0x1bd07c['attributes'][_0xe012('0x33')]?_0x1bd07c[_0xe012('0x30')]:_0x2d5b02['model'];_0x1bd07c[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x36')]);_0x1bd07c[_0xe012('0x37')]=qs['filters'](_['pick'](_0x4dc4fa['query'],_0x2d5b02[_0xe012('0x38')]));if(_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x3a')]){_0x1bd07c[_0xe012('0x37')]=_[_0xe012('0x3b')](_0x1bd07c[_0xe012('0x37')],{'$or':_['map'](_0x1bd07c['attributes'],function(_0x6e36f9){var _0x5327f3={};_0x5327f3[_0x6e36f9]={'$like':'%'+_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x3a')]+'%'};return _0x5327f3;})});}_0x1bd07c=_[_0xe012('0x3b')]({},_0x1bd07c,_0x4dc4fa[_0xe012('0x3d')]);return _0x4b9fbb['getFields'](_0x1bd07c);}})[_0xe012('0x24')](function(_0x4e463c){if(_0x4e463c){_0x210ced=_0x4e463c[_0xe012('0x33')];if(!_0x4dc4fa[_0xe012('0x2d')]['hasOwnProperty'](_0xe012('0x4a'))){_0x1bd07c[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x1d')]);_0x1bd07c[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x4dc4fa[_0xe012('0x2d')][_0xe012('0x1a')]);}return _0x4b9fbb['getFields'](_0x1bd07c);}})[_0xe012('0x24')](function(_0x57545f){if(_0x57545f){return _0x57545f?{'count':_0x210ced,'rows':_0x57545f}:null;}})[_0xe012('0x24')](respondWithResult(_0x488e8f,null))[_0xe012('0x41')](handleError(_0x488e8f,null));};exports[_0xe012('0x4b')]=function(_0x3777fb,_0x34a651,_0x12f98d){var _0x224d79={};var _0x154d9a={};var _0x5ba8ea;var _0x3382a5;return db['SugarcrmConfiguration'][_0xe012('0x49')]({'where':{'id':_0x3777fb[_0xe012('0x46')]['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x34a651,null))[_0xe012('0x24')](function(_0x25b82a){if(_0x25b82a){_0x5ba8ea=_0x25b82a;_0x154d9a[_0xe012('0x31')]=_[_0xe012('0x2e')](db[_0xe012('0x4c')][_0xe012('0x29')]);_0x154d9a['query']=_[_0xe012('0x2e')](_0x3777fb[_0xe012('0x2d')]);_0x154d9a[_0xe012('0x38')]=_['intersection'](_0x154d9a[_0xe012('0x31')],_0x154d9a[_0xe012('0x2d')]);_0x224d79[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x154d9a[_0xe012('0x31')],qs['fields'](_0x3777fb[_0xe012('0x2d')][_0xe012('0x32')]));_0x224d79[_0xe012('0x30')]=_0x224d79['attributes'][_0xe012('0x33')]?_0x224d79[_0xe012('0x30')]:_0x154d9a['model'];_0x224d79[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x3777fb['query'][_0xe012('0x36')]);_0x224d79[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x3777fb[_0xe012('0x2d')],_0x154d9a[_0xe012('0x38')]));if(_0x3777fb[_0xe012('0x2d')][_0xe012('0x3a')]){_0x224d79[_0xe012('0x37')]=_[_0xe012('0x3b')](_0x224d79['where'],{'$or':_[_0xe012('0x2c')](_0x224d79[_0xe012('0x30')],function(_0x231245){var _0x400be5={};_0x400be5[_0x231245]={'$like':'%'+_0x3777fb['query']['filter']+'%'};return _0x400be5;})});}_0x224d79=_[_0xe012('0x3b')]({},_0x224d79,_0x3777fb[_0xe012('0x3d')]);return _0x5ba8ea[_0xe012('0x4b')](_0x224d79);}})[_0xe012('0x24')](function(_0x47e9d3){if(_0x47e9d3){_0x3382a5=_0x47e9d3[_0xe012('0x33')];if(!_0x3777fb[_0xe012('0x2d')][_0xe012('0x34')](_0xe012('0x4a'))){_0x224d79[_0xe012('0x1d')]=qs[_0xe012('0x1d')](_0x3777fb[_0xe012('0x2d')][_0xe012('0x1d')]);_0x224d79[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x3777fb[_0xe012('0x2d')]['offset']);}return _0x5ba8ea[_0xe012('0x4b')](_0x224d79);}})[_0xe012('0x24')](function(_0x26912f){if(_0x26912f){return _0x26912f?{'count':_0x3382a5,'rows':_0x26912f}:null;}})['then'](respondWithResult(_0x34a651,null))['catch'](handleError(_0x34a651,null));};exports[_0xe012('0x4d')]=function(_0x3e271b,_0x338277,_0x3238ae){var _0x393b53={};var _0x3715ec={};var _0x7f9202;var _0xd0f021;return db[_0xe012('0x28')]['findOne']({'where':{'id':_0x3e271b['params']['id']}})[_0xe012('0x24')](handleEntityNotFound(_0x338277,null))[_0xe012('0x24')](function(_0x3a0d31){if(_0x3a0d31){_0x7f9202=_0x3a0d31;_0x3715ec['model']=_['keys'](db['SugarcrmField'][_0xe012('0x29')]);_0x3715ec[_0xe012('0x2d')]=_[_0xe012('0x2e')](_0x3e271b[_0xe012('0x2d')]);_0x3715ec['filters']=_[_0xe012('0x2f')](_0x3715ec['model'],_0x3715ec[_0xe012('0x2d')]);_0x393b53[_0xe012('0x30')]=_[_0xe012('0x2f')](_0x3715ec['model'],qs['fields'](_0x3e271b[_0xe012('0x2d')][_0xe012('0x32')]));_0x393b53[_0xe012('0x30')]=_0x393b53[_0xe012('0x30')]['length']?_0x393b53[_0xe012('0x30')]:_0x3715ec[_0xe012('0x31')];_0x393b53[_0xe012('0x35')]=qs[_0xe012('0x36')](_0x3e271b[_0xe012('0x2d')]['sort']);_0x393b53[_0xe012('0x37')]=qs[_0xe012('0x38')](_[_0xe012('0x39')](_0x3e271b[_0xe012('0x2d')],_0x3715ec[_0xe012('0x38')]));if(_0x3e271b[_0xe012('0x2d')][_0xe012('0x3a')]){_0x393b53['where']=_[_0xe012('0x3b')](_0x393b53[_0xe012('0x37')],{'$or':_['map'](_0x393b53[_0xe012('0x30')],function(_0x20ac52){var _0x5c04d4={};_0x5c04d4[_0x20ac52]={'$like':'%'+_0x3e271b[_0xe012('0x2d')]['filter']+'%'};return _0x5c04d4;})});}_0x393b53=_[_0xe012('0x3b')]({},_0x393b53,_0x3e271b[_0xe012('0x3d')]);return _0x7f9202['getDescriptions'](_0x393b53);}})['then'](function(_0x4c220f){if(_0x4c220f){_0xd0f021=_0x4c220f['length'];if(!_0x3e271b[_0xe012('0x2d')][_0xe012('0x34')](_0xe012('0x4a'))){_0x393b53[_0xe012('0x1d')]=qs['limit'](_0x3e271b['query'][_0xe012('0x1d')]);_0x393b53[_0xe012('0x1a')]=qs[_0xe012('0x1a')](_0x3e271b[_0xe012('0x2d')][_0xe012('0x1a')]);}return _0x7f9202[_0xe012('0x4d')](_0x393b53);}})['then'](function(_0x757654){if(_0x757654){return _0x757654?{'count':_0xd0f021,'rows':_0x757654}:null;}})[_0xe012('0x24')](respondWithResult(_0x338277,null))['catch'](handleError(_0x338277,null));}; \ No newline at end of file +var _0xeb6e=['end','sendStatus','stack','name','status','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','findOne','params','SugarcrmField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xeb6e,0xca));var _0xeeb6=function(_0x3e901e,_0x2a9013){_0x3e901e=_0x3e901e-0x0;var _0x319c79=_0xeb6e[_0x3e901e];return _0x319c79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeb6('0x0'));var zipdir=require(_0xeeb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeeb6('0x2'));var moment=require(_0xeeb6('0x3'));var BPromise=require(_0xeeb6('0x4'));var Mustache=require(_0xeeb6('0x5'));var util=require(_0xeeb6('0x6'));var path=require(_0xeeb6('0x7'));var sox=require(_0xeeb6('0x8'));var csv=require(_0xeeb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeeb6('0xa'));var _=require(_0xeeb6('0xb'));var squel=require('squel');var crypto=require(_0xeeb6('0xc'));var jsforce=require(_0xeeb6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeeb6('0xe'));var Papa=require(_0xeeb6('0xf'));var Redis=require(_0xeeb6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeeb6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeeb6('0x12'));var logger=require(_0xeeb6('0x13'))(_0xeeb6('0x14'));var utils=require(_0xeeb6('0x15'));var config=require(_0xeeb6('0x16'));var licenseUtil=require(_0xeeb6('0x17'));var db=require(_0xeeb6('0x18'))['db'];function respondWithStatusCode(_0x4e30c4,_0x2ae516){_0x2ae516=_0x2ae516||0xcc;return function(_0x69775a){if(_0x69775a){return _0x4e30c4['sendStatus'](_0x2ae516);}return _0x4e30c4['status'](_0x2ae516)['end']();};}function respondWithResult(_0x512011,_0x446e50){_0x446e50=_0x446e50||0xc8;return function(_0xda95df){if(_0xda95df){return _0x512011['status'](_0x446e50)[_0xeeb6('0x19')](_0xda95df);}};}function respondWithFilteredResult(_0x37194a,_0x104200){return function(_0x44d8ee){if(_0x44d8ee){var _0x35ea1a=typeof _0x104200[_0xeeb6('0x1a')]===_0xeeb6('0x1b')&&typeof _0x104200[_0xeeb6('0x1c')]===_0xeeb6('0x1b');var _0xca238e=_0x44d8ee['count'];var _0x1beeae=_0x35ea1a?0x0:_0x104200[_0xeeb6('0x1a')];var _0x599297=_0x35ea1a?_0x44d8ee[_0xeeb6('0x1d')]:_0x104200[_0xeeb6('0x1a')]+_0x104200['limit'];var _0x3ec9c7;if(_0x599297>=_0xca238e){_0x599297=_0xca238e;_0x3ec9c7=0xc8;}else{_0x3ec9c7=0xce;}_0x37194a['status'](_0x3ec9c7);return _0x37194a['set'](_0xeeb6('0x1e'),_0x1beeae+'-'+_0x599297+'/'+_0xca238e)[_0xeeb6('0x19')](_0x44d8ee);}return null;};}function patchUpdates(_0x3b33ba){return function(_0x568e6e){try{jsonpatch[_0xeeb6('0x1f')](_0x568e6e,_0x3b33ba,!![]);}catch(_0x1e3637){return BPromise['reject'](_0x1e3637);}return _0x568e6e['save']();};}function saveUpdates(_0x58de44,_0xe26ac0){return function(_0x479bd6){if(_0x479bd6){return _0x479bd6[_0xeeb6('0x20')](_0x58de44)['then'](function(_0x1eae8f){return _0x1eae8f;});}return null;};}function removeEntity(_0x557811,_0x2e9b54){return function(_0x39cbc0){if(_0x39cbc0){return _0x39cbc0[_0xeeb6('0x21')]()[_0xeeb6('0x22')](function(){_0x557811['status'](0xcc)[_0xeeb6('0x23')]();});}};}function handleEntityNotFound(_0x180c5a,_0x5eee40){return function(_0x53d827){if(!_0x53d827){_0x180c5a[_0xeeb6('0x24')](0x194);}return _0x53d827;};}function handleError(_0x45b06d,_0x379ef2){_0x379ef2=_0x379ef2||0x1f4;return function(_0x5899f6){logger['error'](_0x5899f6[_0xeeb6('0x25')]);if(_0x5899f6[_0xeeb6('0x26')]){delete _0x5899f6[_0xeeb6('0x26')];}_0x45b06d[_0xeeb6('0x27')](_0x379ef2)['send'](_0x5899f6);};}exports[_0xeeb6('0x28')]=function(_0x53f578,_0x1ffcec){var _0xc10f93={},_0x375cb2={},_0x6a6122={'count':0x0,'rows':[]};var _0x35e290=_[_0xeeb6('0x29')](db[_0xeeb6('0x2a')][_0xeeb6('0x2b')],function(_0x3aa14c){return{'name':_0x3aa14c[_0xeeb6('0x2c')],'type':_0x3aa14c['type'][_0xeeb6('0x2d')]};});_0x375cb2[_0xeeb6('0x2e')]=_[_0xeeb6('0x29')](_0x35e290,'name');_0x375cb2[_0xeeb6('0x2f')]=_[_0xeeb6('0x30')](_0x53f578['query']);_0x375cb2[_0xeeb6('0x31')]=_[_0xeeb6('0x32')](_0x375cb2[_0xeeb6('0x2e')],_0x375cb2[_0xeeb6('0x2f')]);_0xc10f93[_0xeeb6('0x33')]=_[_0xeeb6('0x32')](_0x375cb2[_0xeeb6('0x2e')],qs[_0xeeb6('0x34')](_0x53f578['query'][_0xeeb6('0x34')]));_0xc10f93[_0xeeb6('0x33')]=_0xc10f93[_0xeeb6('0x33')][_0xeeb6('0x35')]?_0xc10f93['attributes']:_0x375cb2[_0xeeb6('0x2e')];if(!_0x53f578['query'][_0xeeb6('0x36')](_0xeeb6('0x37'))){_0xc10f93[_0xeeb6('0x1c')]=qs[_0xeeb6('0x1c')](_0x53f578['query'][_0xeeb6('0x1c')]);_0xc10f93[_0xeeb6('0x1a')]=qs[_0xeeb6('0x1a')](_0x53f578[_0xeeb6('0x2f')][_0xeeb6('0x1a')]);}_0xc10f93[_0xeeb6('0x38')]=qs[_0xeeb6('0x39')](_0x53f578[_0xeeb6('0x2f')][_0xeeb6('0x39')]);_0xc10f93['where']=qs[_0xeeb6('0x31')](_[_0xeeb6('0x3a')](_0x53f578['query'],_0x375cb2[_0xeeb6('0x31')]),_0x35e290);if(_0x53f578[_0xeeb6('0x2f')]['filter']){_0xc10f93[_0xeeb6('0x3b')]=_[_0xeeb6('0x3c')](_0xc10f93['where'],{'$or':_['map'](_0x35e290,function(_0xeac547){if(_0xeac547['type']!==_0xeeb6('0x3d')){var _0x216f94={};_0x216f94[_0xeac547['name']]={'$like':'%'+_0x53f578['query'][_0xeeb6('0x3e')]+'%'};return _0x216f94;}})});}_0xc10f93=_[_0xeeb6('0x3c')]({},_0xc10f93,_0x53f578[_0xeeb6('0x3f')]);var _0x5a3cf0={'where':_0xc10f93['where']};return db['SugarcrmConfiguration'][_0xeeb6('0x1d')](_0x5a3cf0)['then'](function(_0x3c9139){_0x6a6122[_0xeeb6('0x1d')]=_0x3c9139;if(_0x53f578[_0xeeb6('0x2f')][_0xeeb6('0x40')]){_0xc10f93[_0xeeb6('0x41')]=[{'all':!![]}];}return db[_0xeeb6('0x2a')][_0xeeb6('0x42')](_0xc10f93);})[_0xeeb6('0x22')](function(_0x4ca371){_0x6a6122[_0xeeb6('0x43')]=_0x4ca371;return _0x6a6122;})['then'](respondWithFilteredResult(_0x1ffcec,_0xc10f93))[_0xeeb6('0x44')](handleError(_0x1ffcec,null));};exports[_0xeeb6('0x45')]=function(_0x34624b,_0x44dfb5){var _0x5c5eb2={'raw':![],'where':{'id':_0x34624b['params']['id']}},_0x5d92af={};_0x5d92af[_0xeeb6('0x2e')]=_[_0xeeb6('0x30')](db[_0xeeb6('0x2a')][_0xeeb6('0x2b')]);_0x5d92af['query']=_['keys'](_0x34624b[_0xeeb6('0x2f')]);_0x5d92af['filters']=_['intersection'](_0x5d92af[_0xeeb6('0x2e')],_0x5d92af[_0xeeb6('0x2f')]);_0x5c5eb2[_0xeeb6('0x33')]=_[_0xeeb6('0x32')](_0x5d92af[_0xeeb6('0x2e')],qs[_0xeeb6('0x34')](_0x34624b[_0xeeb6('0x2f')][_0xeeb6('0x34')]));_0x5c5eb2[_0xeeb6('0x33')]=_0x5c5eb2[_0xeeb6('0x33')][_0xeeb6('0x35')]?_0x5c5eb2[_0xeeb6('0x33')]:_0x5d92af[_0xeeb6('0x2e')];if(_0x34624b['query'][_0xeeb6('0x40')]){_0x5c5eb2['include']=[{'all':!![]}];}_0x5c5eb2=_[_0xeeb6('0x3c')]({},_0x5c5eb2,_0x34624b['options']);return db['SugarcrmConfiguration'][_0xeeb6('0x46')](_0x5c5eb2)['then'](handleEntityNotFound(_0x44dfb5,null))[_0xeeb6('0x22')](respondWithResult(_0x44dfb5,null))[_0xeeb6('0x44')](handleError(_0x44dfb5,null));};exports[_0xeeb6('0x47')]=function(_0x4690b9,_0x392e59){return db[_0xeeb6('0x2a')][_0xeeb6('0x47')](_0x4690b9[_0xeeb6('0x48')],{})[_0xeeb6('0x22')](respondWithResult(_0x392e59,0xc9))[_0xeeb6('0x44')](handleError(_0x392e59,null));};exports[_0xeeb6('0x20')]=function(_0x130c9c,_0x15f706){if(_0x130c9c['body']['id']){delete _0x130c9c['body']['id'];}return db['SugarcrmConfiguration'][_0xeeb6('0x46')]({'where':{'id':_0x130c9c['params']['id']}})[_0xeeb6('0x22')](handleEntityNotFound(_0x15f706,null))[_0xeeb6('0x22')](saveUpdates(_0x130c9c[_0xeeb6('0x48')],null))[_0xeeb6('0x22')](respondWithResult(_0x15f706,null))['catch'](handleError(_0x15f706,null));};exports[_0xeeb6('0x21')]=function(_0x5e7005,_0x737f4){return db[_0xeeb6('0x2a')][_0xeeb6('0x46')]({'where':{'id':_0x5e7005['params']['id']}})[_0xeeb6('0x22')](handleEntityNotFound(_0x737f4,null))[_0xeeb6('0x22')](removeEntity(_0x737f4,null))[_0xeeb6('0x44')](handleError(_0x737f4,null));};exports['getFields']=function(_0xa79850,_0x30add6,_0x477456){var _0x52115a={};var _0x8a62ae={};var _0x48bfbd;var _0x56d1b9;return db['SugarcrmConfiguration'][_0xeeb6('0x49')]({'where':{'id':_0xa79850[_0xeeb6('0x4a')]['id']}})[_0xeeb6('0x22')](handleEntityNotFound(_0x30add6,null))[_0xeeb6('0x22')](function(_0x5384f4){if(_0x5384f4){_0x48bfbd=_0x5384f4;_0x8a62ae['model']=_[_0xeeb6('0x30')](db[_0xeeb6('0x4b')][_0xeeb6('0x2b')]);_0x8a62ae[_0xeeb6('0x2f')]=_[_0xeeb6('0x30')](_0xa79850[_0xeeb6('0x2f')]);_0x8a62ae[_0xeeb6('0x31')]=_[_0xeeb6('0x32')](_0x8a62ae[_0xeeb6('0x2e')],_0x8a62ae[_0xeeb6('0x2f')]);_0x52115a[_0xeeb6('0x33')]=_[_0xeeb6('0x32')](_0x8a62ae[_0xeeb6('0x2e')],qs['fields'](_0xa79850[_0xeeb6('0x2f')]['fields']));_0x52115a[_0xeeb6('0x33')]=_0x52115a[_0xeeb6('0x33')][_0xeeb6('0x35')]?_0x52115a[_0xeeb6('0x33')]:_0x8a62ae[_0xeeb6('0x2e')];_0x52115a[_0xeeb6('0x38')]=qs[_0xeeb6('0x39')](_0xa79850['query'][_0xeeb6('0x39')]);_0x52115a[_0xeeb6('0x3b')]=qs[_0xeeb6('0x31')](_[_0xeeb6('0x3a')](_0xa79850[_0xeeb6('0x2f')],_0x8a62ae[_0xeeb6('0x31')]));if(_0xa79850[_0xeeb6('0x2f')][_0xeeb6('0x3e')]){_0x52115a[_0xeeb6('0x3b')]=_[_0xeeb6('0x3c')](_0x52115a['where'],{'$or':_[_0xeeb6('0x29')](_0x52115a[_0xeeb6('0x33')],function(_0x1b9a7e){var _0x2a769e={};_0x2a769e[_0x1b9a7e]={'$like':'%'+_0xa79850[_0xeeb6('0x2f')][_0xeeb6('0x3e')]+'%'};return _0x2a769e;})});}_0x52115a=_[_0xeeb6('0x3c')]({},_0x52115a,_0xa79850[_0xeeb6('0x3f')]);return _0x48bfbd[_0xeeb6('0x4c')](_0x52115a);}})['then'](function(_0x332eb8){if(_0x332eb8){_0x56d1b9=_0x332eb8[_0xeeb6('0x35')];if(!_0xa79850[_0xeeb6('0x2f')][_0xeeb6('0x36')](_0xeeb6('0x37'))){_0x52115a[_0xeeb6('0x1c')]=qs['limit'](_0xa79850[_0xeeb6('0x2f')]['limit']);_0x52115a['offset']=qs[_0xeeb6('0x1a')](_0xa79850[_0xeeb6('0x2f')][_0xeeb6('0x1a')]);}return _0x48bfbd[_0xeeb6('0x4c')](_0x52115a);}})['then'](function(_0x3a13e9){if(_0x3a13e9){return _0x3a13e9?{'count':_0x56d1b9,'rows':_0x3a13e9}:null;}})['then'](respondWithResult(_0x30add6,null))[_0xeeb6('0x44')](handleError(_0x30add6,null));};exports[_0xeeb6('0x4d')]=function(_0x51c4b1,_0x274e63,_0x2cafce){var _0x4f857c={};var _0x419f9d={};var _0x2b3e74;var _0x927058;return db[_0xeeb6('0x2a')]['findOne']({'where':{'id':_0x51c4b1[_0xeeb6('0x4a')]['id']}})[_0xeeb6('0x22')](handleEntityNotFound(_0x274e63,null))['then'](function(_0x13d5fb){if(_0x13d5fb){_0x2b3e74=_0x13d5fb;_0x419f9d['model']=_['keys'](db[_0xeeb6('0x4b')]['rawAttributes']);_0x419f9d['query']=_[_0xeeb6('0x30')](_0x51c4b1[_0xeeb6('0x2f')]);_0x419f9d[_0xeeb6('0x31')]=_[_0xeeb6('0x32')](_0x419f9d[_0xeeb6('0x2e')],_0x419f9d['query']);_0x4f857c[_0xeeb6('0x33')]=_[_0xeeb6('0x32')](_0x419f9d[_0xeeb6('0x2e')],qs[_0xeeb6('0x34')](_0x51c4b1['query'][_0xeeb6('0x34')]));_0x4f857c['attributes']=_0x4f857c[_0xeeb6('0x33')][_0xeeb6('0x35')]?_0x4f857c[_0xeeb6('0x33')]:_0x419f9d[_0xeeb6('0x2e')];_0x4f857c[_0xeeb6('0x38')]=qs['sort'](_0x51c4b1[_0xeeb6('0x2f')][_0xeeb6('0x39')]);_0x4f857c['where']=qs[_0xeeb6('0x31')](_[_0xeeb6('0x3a')](_0x51c4b1[_0xeeb6('0x2f')],_0x419f9d[_0xeeb6('0x31')]));if(_0x51c4b1[_0xeeb6('0x2f')][_0xeeb6('0x3e')]){_0x4f857c[_0xeeb6('0x3b')]=_['merge'](_0x4f857c[_0xeeb6('0x3b')],{'$or':_[_0xeeb6('0x29')](_0x4f857c[_0xeeb6('0x33')],function(_0x366dc4){var _0x25e206={};_0x25e206[_0x366dc4]={'$like':'%'+_0x51c4b1[_0xeeb6('0x2f')][_0xeeb6('0x3e')]+'%'};return _0x25e206;})});}_0x4f857c=_[_0xeeb6('0x3c')]({},_0x4f857c,_0x51c4b1['options']);return _0x2b3e74[_0xeeb6('0x4d')](_0x4f857c);}})['then'](function(_0x5eda79){if(_0x5eda79){_0x927058=_0x5eda79[_0xeeb6('0x35')];if(!_0x51c4b1[_0xeeb6('0x2f')][_0xeeb6('0x36')](_0xeeb6('0x37'))){_0x4f857c[_0xeeb6('0x1c')]=qs['limit'](_0x51c4b1['query']['limit']);_0x4f857c[_0xeeb6('0x1a')]=qs[_0xeeb6('0x1a')](_0x51c4b1[_0xeeb6('0x2f')][_0xeeb6('0x1a')]);}return _0x2b3e74[_0xeeb6('0x4d')](_0x4f857c);}})['then'](function(_0xb1ac15){if(_0xb1ac15){return _0xb1ac15?{'count':_0x927058,'rows':_0xb1ac15}:null;}})['then'](respondWithResult(_0x274e63,null))[_0xeeb6('0x44')](handleError(_0x274e63,null));};exports[_0xeeb6('0x4e')]=function(_0x7ddce6,_0x3cdd47,_0x5d5cda){var _0x42e161={};var _0x40f13b={};var _0x9b8c2c;var _0x1d97f5;return db[_0xeeb6('0x2a')]['findOne']({'where':{'id':_0x7ddce6[_0xeeb6('0x4a')]['id']}})[_0xeeb6('0x22')](handleEntityNotFound(_0x3cdd47,null))['then'](function(_0xc504e3){if(_0xc504e3){_0x9b8c2c=_0xc504e3;_0x40f13b['model']=_[_0xeeb6('0x30')](db[_0xeeb6('0x4b')]['rawAttributes']);_0x40f13b[_0xeeb6('0x2f')]=_['keys'](_0x7ddce6['query']);_0x40f13b['filters']=_[_0xeeb6('0x32')](_0x40f13b['model'],_0x40f13b[_0xeeb6('0x2f')]);_0x42e161[_0xeeb6('0x33')]=_['intersection'](_0x40f13b[_0xeeb6('0x2e')],qs['fields'](_0x7ddce6[_0xeeb6('0x2f')][_0xeeb6('0x34')]));_0x42e161[_0xeeb6('0x33')]=_0x42e161['attributes'][_0xeeb6('0x35')]?_0x42e161[_0xeeb6('0x33')]:_0x40f13b['model'];_0x42e161[_0xeeb6('0x38')]=qs[_0xeeb6('0x39')](_0x7ddce6[_0xeeb6('0x2f')][_0xeeb6('0x39')]);_0x42e161[_0xeeb6('0x3b')]=qs[_0xeeb6('0x31')](_[_0xeeb6('0x3a')](_0x7ddce6['query'],_0x40f13b['filters']));if(_0x7ddce6[_0xeeb6('0x2f')][_0xeeb6('0x3e')]){_0x42e161['where']=_['merge'](_0x42e161[_0xeeb6('0x3b')],{'$or':_[_0xeeb6('0x29')](_0x42e161[_0xeeb6('0x33')],function(_0x5f3720){var _0x5d3d21={};_0x5d3d21[_0x5f3720]={'$like':'%'+_0x7ddce6[_0xeeb6('0x2f')][_0xeeb6('0x3e')]+'%'};return _0x5d3d21;})});}_0x42e161=_[_0xeeb6('0x3c')]({},_0x42e161,_0x7ddce6[_0xeeb6('0x3f')]);return _0x9b8c2c['getDescriptions'](_0x42e161);}})[_0xeeb6('0x22')](function(_0x24c25b){if(_0x24c25b){_0x1d97f5=_0x24c25b[_0xeeb6('0x35')];if(!_0x7ddce6[_0xeeb6('0x2f')]['hasOwnProperty'](_0xeeb6('0x37'))){_0x42e161[_0xeeb6('0x1c')]=qs[_0xeeb6('0x1c')](_0x7ddce6[_0xeeb6('0x2f')][_0xeeb6('0x1c')]);_0x42e161[_0xeeb6('0x1a')]=qs[_0xeeb6('0x1a')](_0x7ddce6['query'][_0xeeb6('0x1a')]);}return _0x9b8c2c[_0xeeb6('0x4e')](_0x42e161);}})[_0xeeb6('0x22')](function(_0xafd7d5){if(_0xafd7d5){return _0xafd7d5?{'count':_0x1d97f5,'rows':_0xafd7d5}:null;}})[_0xeeb6('0x22')](respondWithResult(_0x3cdd47,null))['catch'](handleError(_0x3cdd47,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 50a1104..fb6c2e5 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 _0xffed=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xffed,0x158));var _0xdffe=function(_0x4af7cd,_0x4f9b31){_0x4af7cd=_0x4af7cd-0x0;var _0x44c82f=_0xffed[_0x4af7cd];return _0x44c82f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdffe('0x0'));var moment=require(_0xdffe('0x1'));var BPromise=require(_0xdffe('0x2'));var rp=require(_0xdffe('0x3'));var fs=require('fs');var path=require(_0xdffe('0x4'));var rimraf=require('rimraf');var config=require(_0xdffe('0x5'));var attributes=require(_0xdffe('0x6'));module[_0xdffe('0x7')]=function(_0x362367,_0x372e67){return _0x362367['define'](_0xdffe('0x8'),attributes,{'tableName':_0xdffe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95db=['SugarcrmConfiguration','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','exports'];(function(_0x5ddd87,_0x4cee42){var _0x4e4161=function(_0x50fb9d){while(--_0x50fb9d){_0x5ddd87['push'](_0x5ddd87['shift']());}};_0x4e4161(++_0x4cee42);}(_0x95db,0x1e1));var _0xb95d=function(_0x3c0eaf,_0x4ae998){_0x3c0eaf=_0x3c0eaf-0x0;var _0x246c8f=_0x95db[_0x3c0eaf];return _0x246c8f;};'use strict';var _=require(_0xb95d('0x0'));var util=require('util');var logger=require(_0xb95d('0x1'))(_0xb95d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb95d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb95d('0x4'));var config=require(_0xb95d('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xb95d('0x6')]=function(_0x2f4b29,_0x5cbdea){return _0x2f4b29['define'](_0xb95d('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8ece035..484d1c6 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 _0xb03c=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xb03c,0x14f));var _0xcb03=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xb03c[_0x53b8e0];return _0x10630c;};'use strict';var _=require(_0xcb03('0x0'));var util=require(_0xcb03('0x1'));var moment=require(_0xcb03('0x2'));var BPromise=require(_0xcb03('0x3'));var rs=require(_0xcb03('0x4'));var fs=require('fs');var Redis=require(_0xcb03('0x5'));var db=require(_0xcb03('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb03('0x7'))('rpc');var config=require(_0xcb03('0x8'));var jayson=require(_0xcb03('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd239e7,_0x34551c,_0x5d5806){return new BPromise(function(_0x34994a,_0xad6287){return client[_0xcb03('0xa')](_0xd239e7,_0x5d5806)[_0xcb03('0xb')](function(_0x22fb4a){logger['info'](_0xcb03('0xc'),_0x34551c,_0xcb03('0xd'));logger[_0xcb03('0xe')](_0xcb03('0xf'),_0x34551c,_0xcb03('0xd'),JSON[_0xcb03('0x10')](_0x22fb4a));if(_0x22fb4a[_0xcb03('0x11')]){if(_0x22fb4a[_0xcb03('0x11')][_0xcb03('0x12')]===0x1f4){logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0x22fb4a['error']['message']);return _0xad6287(_0x22fb4a[_0xcb03('0x11')][_0xcb03('0x13')]);}logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0x22fb4a[_0xcb03('0x11')]['message']);return _0x34994a(_0x22fb4a[_0xcb03('0x11')]['message']);}else{logger[_0xcb03('0x14')](_0xcb03('0xc'),_0x34551c,_0xcb03('0xd'));_0x34994a(_0x22fb4a[_0xcb03('0x15')][_0xcb03('0x13')]);}})[_0xcb03('0x16')](function(_0xd6923f){logger[_0xcb03('0x11')](_0xcb03('0xc'),_0x34551c,_0xd6923f);_0xad6287(_0xd6923f);});});} \ No newline at end of file +var _0x7dd5=['http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x7dd5,0x1ae));var _0x57dd=function(_0x59f719,_0x35fe88){_0x59f719=_0x59f719-0x0;var _0x10e06b=_0x7dd5[_0x59f719];return _0x10e06b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57dd('0x0'));var BPromise=require(_0x57dd('0x1'));var rs=require(_0x57dd('0x2'));var fs=require('fs');var Redis=require(_0x57dd('0x3'));var db=require(_0x57dd('0x4'))['db'];var utils=require(_0x57dd('0x5'));var logger=require(_0x57dd('0x6'))('rpc');var config=require(_0x57dd('0x7'));var jayson=require(_0x57dd('0x8'));var client=jayson[_0x57dd('0x9')][_0x57dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x76f6d0,_0x4d5c9c,_0xf5f06f){return new BPromise(function(_0x2144d4,_0x31735a){return client[_0x57dd('0xb')](_0x76f6d0,_0xf5f06f)[_0x57dd('0xc')](function(_0x2f22cd){logger[_0x57dd('0xd')](_0x57dd('0xe'),_0x4d5c9c,'request\x20sent');logger['debug'](_0x57dd('0xf'),_0x4d5c9c,_0x57dd('0x10'),JSON['stringify'](_0x2f22cd));if(_0x2f22cd[_0x57dd('0x11')]){if(_0x2f22cd[_0x57dd('0x11')][_0x57dd('0x12')]===0x1f4){logger[_0x57dd('0x11')](_0x57dd('0xe'),_0x4d5c9c,_0x2f22cd['error'][_0x57dd('0x13')]);return _0x31735a(_0x2f22cd[_0x57dd('0x11')][_0x57dd('0x13')]);}logger[_0x57dd('0x11')](_0x57dd('0xe'),_0x4d5c9c,_0x2f22cd['error'][_0x57dd('0x13')]);return _0x2144d4(_0x2f22cd['error'][_0x57dd('0x13')]);}else{logger['info'](_0x57dd('0xe'),_0x4d5c9c,_0x57dd('0x10'));_0x2144d4(_0x2f22cd[_0x57dd('0x14')][_0x57dd('0x13')]);}})[_0x57dd('0x15')](function(_0x24eaa5){logger[_0x57dd('0x11')](_0x57dd('0xe'),_0x4d5c9c,_0x24eaa5);_0x31735a(_0x24eaa5);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f7f7c8e..154bcc2 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 _0x6d85=['../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4e8b57,_0x3e1302){var _0x340834=function(_0x52cd77){while(--_0x52cd77){_0x4e8b57['push'](_0x4e8b57['shift']());}};_0x340834(++_0x3e1302);}(_0x6d85,0x104));var _0x56d8=function(_0x455380,_0x2a1448){_0x455380=_0x455380-0x0;var _0x2c2bb7=_0x6d85[_0x455380];return _0x2c2bb7;};'use strict';var multer=require(_0x56d8('0x0'));var util=require(_0x56d8('0x1'));var path=require('path');var timeout=require(_0x56d8('0x2'));var express=require(_0x56d8('0x3'));var router=express[_0x56d8('0x4')]();var fs_extra=require(_0x56d8('0x5'));var auth=require(_0x56d8('0x6'));var interaction=require(_0x56d8('0x7'));var config=require('../../config/environment');var controller=require(_0x56d8('0x8'));router[_0x56d8('0x9')]('/',auth[_0x56d8('0xa')](),controller[_0x56d8('0xb')]);router[_0x56d8('0x9')]('/:id',auth[_0x56d8('0xa')](),controller['show']);router[_0x56d8('0xc')]('/',auth[_0x56d8('0xa')](),controller[_0x56d8('0xd')]);router[_0x56d8('0xe')](_0x56d8('0xf'),auth['isAuthenticated'](),controller[_0x56d8('0x10')]);router['delete'](_0x56d8('0xf'),auth['isAuthenticated'](),controller[_0x56d8('0x11')]);module[_0x56d8('0x12')]=router; \ No newline at end of file +var _0x3e32=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x2cd04b,_0xd130f9){var _0x213da5=function(_0x2e0e68){while(--_0x2e0e68){_0x2cd04b['push'](_0x2cd04b['shift']());}};_0x213da5(++_0xd130f9);}(_0x3e32,0xc8));var _0x23e3=function(_0x57a5e5,_0x18b0d6){_0x57a5e5=_0x57a5e5-0x0;var _0x354012=_0x3e32[_0x57a5e5];return _0x354012;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23e3('0x0'));var timeout=require(_0x23e3('0x1'));var express=require(_0x23e3('0x2'));var router=express[_0x23e3('0x3')]();var fs_extra=require(_0x23e3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x23e3('0x5'));var controller=require(_0x23e3('0x6'));router['get']('/',auth[_0x23e3('0x7')](),controller[_0x23e3('0x8')]);router[_0x23e3('0x9')](_0x23e3('0xa'),auth[_0x23e3('0x7')](),controller[_0x23e3('0xb')]);router[_0x23e3('0xc')]('/',auth[_0x23e3('0x7')](),controller[_0x23e3('0xd')]);router[_0x23e3('0xe')](_0x23e3('0xa'),auth[_0x23e3('0x7')](),controller[_0x23e3('0xf')]);router[_0x23e3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x23e3('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index c8dcde6..a459ee9 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 _0xc5ec=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5ec,0x101));var _0xcc5e=function(_0x4f6719,_0x59e265){_0x4f6719=_0x4f6719-0x0;var _0xce7d75=_0xc5ec[_0x4f6719];return _0xce7d75;};'use strict';var Sequelize=require(_0xcc5e('0x0'));module[_0xcc5e('0x1')]={'type':{'type':Sequelize[_0xcc5e('0x2')](_0xcc5e('0x3'),_0xcc5e('0x4'),_0xcc5e('0x5'),_0xcc5e('0x6'),_0xcc5e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcc5e('0x8')]},'key':{'type':Sequelize[_0xcc5e('0x8')]},'keyType':{'type':Sequelize[_0xcc5e('0x2')]('string',_0xcc5e('0x4'),_0xcc5e('0x5'))},'keyContent':{'type':Sequelize[_0xcc5e('0x8')]},'idField':{'type':Sequelize[_0xcc5e('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcc5e('0x8')]}}; \ No newline at end of file +var _0xbd15=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xbd15,0xd6));var _0x5bd1=function(_0x35e7fb,_0x57b674){_0x35e7fb=_0x35e7fb-0x0;var _0x4257e1=_0xbd15[_0x35e7fb];return _0x4257e1;};'use strict';var Sequelize=require(_0x5bd1('0x0'));module[_0x5bd1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5bd1('0x2'),'variable',_0x5bd1('0x3'),_0x5bd1('0x4'),'picklist'),'defaultValue':_0x5bd1('0x2')},'content':{'type':Sequelize[_0x5bd1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5bd1('0x6')](_0x5bd1('0x2'),_0x5bd1('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5bd1('0x5')]},'nameField':{'type':Sequelize[_0x5bd1('0x5')]},'customField':{'type':Sequelize[_0x5bd1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5bd1('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 75c1f4f..f400919 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 _0x7c29=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','query'];(function(_0x4a7193,_0x556c6a){var _0xc33d94=function(_0x3b7b34){while(--_0x3b7b34){_0x4a7193['push'](_0x4a7193['shift']());}};_0xc33d94(++_0x556c6a);}(_0x7c29,0x139));var _0x97c2=function(_0x7ca8b6,_0x10e63e){_0x7ca8b6=_0x7ca8b6-0x0;var _0x31f53c=_0x7c29[_0x7ca8b6];return _0x31f53c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c2('0x0'));var zipdir=require(_0x97c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c2('0x2'));var moment=require(_0x97c2('0x3'));var BPromise=require(_0x97c2('0x4'));var Mustache=require(_0x97c2('0x5'));var util=require(_0x97c2('0x6'));var path=require(_0x97c2('0x7'));var sox=require(_0x97c2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97c2('0x9'));var _=require('lodash');var squel=require(_0x97c2('0xa'));var crypto=require(_0x97c2('0xb'));var jsforce=require(_0x97c2('0xc'));var deskjs=require(_0x97c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c2('0xe'));var Papa=require(_0x97c2('0xf'));var Redis=require(_0x97c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x97c2('0x11'));var as=require(_0x97c2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97c2('0x13'))(_0x97c2('0x14'));var utils=require('../../config/utils');var config=require(_0x97c2('0x15'));var licenseUtil=require(_0x97c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6e16,_0x195e6c){_0x195e6c=_0x195e6c||0xcc;return function(_0x21921a){if(_0x21921a){return _0x3f6e16[_0x97c2('0x17')](_0x195e6c);}return _0x3f6e16[_0x97c2('0x18')](_0x195e6c)[_0x97c2('0x19')]();};}function respondWithResult(_0x1b7a85,_0x5bc2bc){_0x5bc2bc=_0x5bc2bc||0xc8;return function(_0x53e6ab){if(_0x53e6ab){return _0x1b7a85['status'](_0x5bc2bc)[_0x97c2('0x1a')](_0x53e6ab);}};}function respondWithFilteredResult(_0x582934,_0x416087){return function(_0x53a69a){if(_0x53a69a){var _0xe61c4d=typeof _0x416087['offset']===_0x97c2('0x1b')&&typeof _0x416087[_0x97c2('0x1c')]===_0x97c2('0x1b');var _0x121eb8=_0x53a69a[_0x97c2('0x1d')];var _0x30ab13=_0xe61c4d?0x0:_0x416087[_0x97c2('0x1e')];var _0x342e9b=_0xe61c4d?_0x53a69a[_0x97c2('0x1d')]:_0x416087[_0x97c2('0x1e')]+_0x416087[_0x97c2('0x1c')];var _0x535e39;if(_0x342e9b>=_0x121eb8){_0x342e9b=_0x121eb8;_0x535e39=0xc8;}else{_0x535e39=0xce;}_0x582934[_0x97c2('0x18')](_0x535e39);return _0x582934['set']('Content-Range',_0x30ab13+'-'+_0x342e9b+'/'+_0x121eb8)[_0x97c2('0x1a')](_0x53a69a);}return null;};}function patchUpdates(_0x1a4c44){return function(_0xe3de62){try{jsonpatch[_0x97c2('0x1f')](_0xe3de62,_0x1a4c44,!![]);}catch(_0x3b6edb){return BPromise[_0x97c2('0x20')](_0x3b6edb);}return _0xe3de62[_0x97c2('0x21')]();};}function saveUpdates(_0x49433c,_0x236eb6){return function(_0x3b16ed){if(_0x3b16ed){return _0x3b16ed[_0x97c2('0x22')](_0x49433c)[_0x97c2('0x23')](function(_0x41d1a6){return _0x41d1a6;});}return null;};}function removeEntity(_0x579db3,_0x4b4038){return function(_0x1a8ddb){if(_0x1a8ddb){return _0x1a8ddb[_0x97c2('0x24')]()[_0x97c2('0x23')](function(){_0x579db3['status'](0xcc)[_0x97c2('0x19')]();});}};}function handleEntityNotFound(_0x3f8596,_0x393f7b){return function(_0x5bace2){if(!_0x5bace2){_0x3f8596[_0x97c2('0x17')](0x194);}return _0x5bace2;};}function handleError(_0x323512,_0x38d333){_0x38d333=_0x38d333||0x1f4;return function(_0x57364a){logger['error'](_0x57364a[_0x97c2('0x25')]);if(_0x57364a[_0x97c2('0x26')]){delete _0x57364a[_0x97c2('0x26')];}_0x323512[_0x97c2('0x18')](_0x38d333)[_0x97c2('0x27')](_0x57364a);};}exports['index']=function(_0x25803d,_0x213cc9){var _0x430cdc={},_0x4809e7={},_0xc26f1={'count':0x0,'rows':[]};var _0x33a499=_[_0x97c2('0x28')](db[_0x97c2('0x29')][_0x97c2('0x2a')],function(_0x2e6002){return{'name':_0x2e6002[_0x97c2('0x2b')],'type':_0x2e6002[_0x97c2('0x2c')][_0x97c2('0x2d')]};});_0x4809e7['model']=_[_0x97c2('0x28')](_0x33a499,_0x97c2('0x26'));_0x4809e7[_0x97c2('0x2e')]=_['keys'](_0x25803d[_0x97c2('0x2e')]);_0x4809e7['filters']=_[_0x97c2('0x2f')](_0x4809e7['model'],_0x4809e7[_0x97c2('0x2e')]);_0x430cdc['attributes']=_['intersection'](_0x4809e7[_0x97c2('0x30')],qs[_0x97c2('0x31')](_0x25803d['query'][_0x97c2('0x31')]));_0x430cdc[_0x97c2('0x32')]=_0x430cdc['attributes'][_0x97c2('0x33')]?_0x430cdc[_0x97c2('0x32')]:_0x4809e7['model'];if(!_0x25803d[_0x97c2('0x2e')][_0x97c2('0x34')](_0x97c2('0x35'))){_0x430cdc['limit']=qs[_0x97c2('0x1c')](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x1c')]);_0x430cdc['offset']=qs['offset'](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x1e')]);}_0x430cdc[_0x97c2('0x36')]=qs[_0x97c2('0x37')](_0x25803d[_0x97c2('0x2e')][_0x97c2('0x37')]);_0x430cdc[_0x97c2('0x38')]=qs['filters'](_[_0x97c2('0x39')](_0x25803d[_0x97c2('0x2e')],_0x4809e7[_0x97c2('0x3a')]),_0x33a499);if(_0x25803d[_0x97c2('0x2e')]['filter']){_0x430cdc[_0x97c2('0x38')]=_[_0x97c2('0x3b')](_0x430cdc[_0x97c2('0x38')],{'$or':_[_0x97c2('0x28')](_0x33a499,function(_0x4c8962){if(_0x4c8962['type']!==_0x97c2('0x3c')){var _0x5f18cf={};_0x5f18cf[_0x4c8962['name']]={'$like':'%'+_0x25803d[_0x97c2('0x2e')][_0x97c2('0x3d')]+'%'};return _0x5f18cf;}})});}_0x430cdc=_[_0x97c2('0x3b')]({},_0x430cdc,_0x25803d[_0x97c2('0x3e')]);var _0x1433d2={'where':_0x430cdc[_0x97c2('0x38')]};return db[_0x97c2('0x29')][_0x97c2('0x1d')](_0x1433d2)['then'](function(_0xdc3c9c){_0xc26f1[_0x97c2('0x1d')]=_0xdc3c9c;if(_0x25803d[_0x97c2('0x2e')][_0x97c2('0x3f')]){_0x430cdc[_0x97c2('0x40')]=[{'all':!![]}];}return db[_0x97c2('0x29')]['findAll'](_0x430cdc);})[_0x97c2('0x23')](function(_0x2f1cea){_0xc26f1[_0x97c2('0x41')]=_0x2f1cea;return _0xc26f1;})[_0x97c2('0x23')](respondWithFilteredResult(_0x213cc9,_0x430cdc))[_0x97c2('0x42')](handleError(_0x213cc9,null));};exports['show']=function(_0x2b812b,_0x497303){var _0x5b4eb5={'raw':!![],'where':{'id':_0x2b812b[_0x97c2('0x43')]['id']}},_0x2f5180={};_0x2f5180[_0x97c2('0x30')]=_[_0x97c2('0x44')](db['SugarcrmField'][_0x97c2('0x2a')]);_0x2f5180[_0x97c2('0x2e')]=_[_0x97c2('0x44')](_0x2b812b[_0x97c2('0x2e')]);_0x2f5180[_0x97c2('0x3a')]=_[_0x97c2('0x2f')](_0x2f5180[_0x97c2('0x30')],_0x2f5180[_0x97c2('0x2e')]);_0x5b4eb5[_0x97c2('0x32')]=_[_0x97c2('0x2f')](_0x2f5180['model'],qs[_0x97c2('0x31')](_0x2b812b[_0x97c2('0x2e')][_0x97c2('0x31')]));_0x5b4eb5[_0x97c2('0x32')]=_0x5b4eb5[_0x97c2('0x32')]['length']?_0x5b4eb5[_0x97c2('0x32')]:_0x2f5180[_0x97c2('0x30')];if(_0x2b812b['query']['includeAll']){_0x5b4eb5[_0x97c2('0x40')]=[{'all':!![]}];}_0x5b4eb5=_[_0x97c2('0x3b')]({},_0x5b4eb5,_0x2b812b[_0x97c2('0x3e')]);return db[_0x97c2('0x29')][_0x97c2('0x45')](_0x5b4eb5)['then'](handleEntityNotFound(_0x497303,null))['then'](respondWithResult(_0x497303,null))['catch'](handleError(_0x497303,null));};exports[_0x97c2('0x46')]=function(_0x170d5d,_0x2423a5){return db[_0x97c2('0x29')]['create'](_0x170d5d['body'],{})['then'](respondWithResult(_0x2423a5,0xc9))[_0x97c2('0x42')](handleError(_0x2423a5,null));};exports[_0x97c2('0x22')]=function(_0xad5929,_0x90dac2){if(_0xad5929[_0x97c2('0x47')]['id']){delete _0xad5929[_0x97c2('0x47')]['id'];}return db[_0x97c2('0x29')][_0x97c2('0x45')]({'where':{'id':_0xad5929[_0x97c2('0x43')]['id']}})[_0x97c2('0x23')](handleEntityNotFound(_0x90dac2,null))[_0x97c2('0x23')](saveUpdates(_0xad5929[_0x97c2('0x47')],null))[_0x97c2('0x23')](respondWithResult(_0x90dac2,null))[_0x97c2('0x42')](handleError(_0x90dac2,null));};exports[_0x97c2('0x24')]=function(_0x252772,_0x5be835){return db[_0x97c2('0x29')][_0x97c2('0x45')]({'where':{'id':_0x252772[_0x97c2('0x43')]['id']}})[_0x97c2('0x23')](handleEntityNotFound(_0x5be835,null))['then'](removeEntity(_0x5be835,null))[_0x97c2('0x42')](handleError(_0x5be835,null));}; \ No newline at end of file +var _0xb97e=['query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmField','rows','show','params','keys','catch','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','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','limit','count','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key'];(function(_0x7e3946,_0x2afb82){var _0x2380aa=function(_0x1de314){while(--_0x1de314){_0x7e3946['push'](_0x7e3946['shift']());}};_0x2380aa(++_0x2afb82);}(_0xb97e,0x197));var _0xeb97=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb97e[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xeb97('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb97('0x1'));var rp=require(_0xeb97('0x2'));var moment=require(_0xeb97('0x3'));var BPromise=require(_0xeb97('0x4'));var Mustache=require(_0xeb97('0x5'));var util=require('util');var path=require(_0xeb97('0x6'));var sox=require(_0xeb97('0x7'));var csv=require(_0xeb97('0x8'));var ejs=require(_0xeb97('0x9'));var fs=require('fs');var fs_extra=require(_0xeb97('0xa'));var _=require('lodash');var squel=require(_0xeb97('0xb'));var crypto=require(_0xeb97('0xc'));var jsforce=require(_0xeb97('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeb97('0x8'));var querystring=require(_0xeb97('0xe'));var Papa=require(_0xeb97('0xf'));var Redis=require(_0xeb97('0x10'));var authService=require(_0xeb97('0x11'));var qs=require(_0xeb97('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb97('0x13'));var logger=require(_0xeb97('0x14'))(_0xeb97('0x15'));var utils=require(_0xeb97('0x16'));var config=require(_0xeb97('0x17'));var licenseUtil=require(_0xeb97('0x18'));var db=require(_0xeb97('0x19'))['db'];function respondWithStatusCode(_0xb82bbc,_0x1a8cd3){_0x1a8cd3=_0x1a8cd3||0xcc;return function(_0x59dc96){if(_0x59dc96){return _0xb82bbc[_0xeb97('0x1a')](_0x1a8cd3);}return _0xb82bbc[_0xeb97('0x1b')](_0x1a8cd3)[_0xeb97('0x1c')]();};}function respondWithResult(_0x49b98c,_0x48be00){_0x48be00=_0x48be00||0xc8;return function(_0x456d5b){if(_0x456d5b){return _0x49b98c[_0xeb97('0x1b')](_0x48be00)['json'](_0x456d5b);}};}function respondWithFilteredResult(_0x5d556a,_0x1c583f){return function(_0x29531b){if(_0x29531b){var _0x560b6c=typeof _0x1c583f[_0xeb97('0x1d')]===_0xeb97('0x1e')&&typeof _0x1c583f[_0xeb97('0x1f')]==='undefined';var _0x4bdf2a=_0x29531b[_0xeb97('0x20')];var _0x1f77ce=_0x560b6c?0x0:_0x1c583f[_0xeb97('0x1d')];var _0x3a7909=_0x560b6c?_0x29531b[_0xeb97('0x20')]:_0x1c583f[_0xeb97('0x1d')]+_0x1c583f[_0xeb97('0x1f')];var _0x5ba250;if(_0x3a7909>=_0x4bdf2a){_0x3a7909=_0x4bdf2a;_0x5ba250=0xc8;}else{_0x5ba250=0xce;}_0x5d556a[_0xeb97('0x1b')](_0x5ba250);return _0x5d556a[_0xeb97('0x21')]('Content-Range',_0x1f77ce+'-'+_0x3a7909+'/'+_0x4bdf2a)[_0xeb97('0x22')](_0x29531b);}return null;};}function patchUpdates(_0x1ea9c2){return function(_0x499b16){try{jsonpatch[_0xeb97('0x23')](_0x499b16,_0x1ea9c2,!![]);}catch(_0x514a2d){return BPromise[_0xeb97('0x24')](_0x514a2d);}return _0x499b16[_0xeb97('0x25')]();};}function saveUpdates(_0x27e2eb,_0x47a2d0){return function(_0xca5da8){if(_0xca5da8){return _0xca5da8[_0xeb97('0x26')](_0x27e2eb)[_0xeb97('0x27')](function(_0x55ede2){return _0x55ede2;});}return null;};}function removeEntity(_0x4b1803,_0x853d8){return function(_0x1822e1){if(_0x1822e1){return _0x1822e1[_0xeb97('0x28')]()['then'](function(){_0x4b1803['status'](0xcc)[_0xeb97('0x1c')]();});}};}function handleEntityNotFound(_0x1f6d53,_0x5817e8){return function(_0x4fa75c){if(!_0x4fa75c){_0x1f6d53['sendStatus'](0x194);}return _0x4fa75c;};}function handleError(_0x20c472,_0x4a889){_0x4a889=_0x4a889||0x1f4;return function(_0x5496f0){logger['error'](_0x5496f0[_0xeb97('0x29')]);if(_0x5496f0[_0xeb97('0x2a')]){delete _0x5496f0[_0xeb97('0x2a')];}_0x20c472[_0xeb97('0x1b')](_0x4a889)['send'](_0x5496f0);};}exports[_0xeb97('0x2b')]=function(_0x36de33,_0x4bc81e){var _0x435bbf={},_0x541cfa={},_0x1e33db={'count':0x0,'rows':[]};var _0x51a32b=_[_0xeb97('0x2c')](db['SugarcrmField'][_0xeb97('0x2d')],function(_0x1ad48d){return{'name':_0x1ad48d[_0xeb97('0x2e')],'type':_0x1ad48d[_0xeb97('0x2f')][_0xeb97('0x30')]};});_0x541cfa['model']=_[_0xeb97('0x2c')](_0x51a32b,_0xeb97('0x2a'));_0x541cfa['query']=_['keys'](_0x36de33[_0xeb97('0x31')]);_0x541cfa[_0xeb97('0x32')]=_[_0xeb97('0x33')](_0x541cfa[_0xeb97('0x34')],_0x541cfa[_0xeb97('0x31')]);_0x435bbf[_0xeb97('0x35')]=_[_0xeb97('0x33')](_0x541cfa[_0xeb97('0x34')],qs[_0xeb97('0x36')](_0x36de33[_0xeb97('0x31')][_0xeb97('0x36')]));_0x435bbf['attributes']=_0x435bbf[_0xeb97('0x35')]['length']?_0x435bbf['attributes']:_0x541cfa['model'];if(!_0x36de33[_0xeb97('0x31')][_0xeb97('0x37')](_0xeb97('0x38'))){_0x435bbf['limit']=qs[_0xeb97('0x1f')](_0x36de33[_0xeb97('0x31')][_0xeb97('0x1f')]);_0x435bbf[_0xeb97('0x1d')]=qs['offset'](_0x36de33[_0xeb97('0x31')][_0xeb97('0x1d')]);}_0x435bbf[_0xeb97('0x39')]=qs[_0xeb97('0x3a')](_0x36de33['query']['sort']);_0x435bbf[_0xeb97('0x3b')]=qs[_0xeb97('0x32')](_[_0xeb97('0x3c')](_0x36de33['query'],_0x541cfa[_0xeb97('0x32')]),_0x51a32b);if(_0x36de33['query'][_0xeb97('0x3d')]){_0x435bbf[_0xeb97('0x3b')]=_[_0xeb97('0x3e')](_0x435bbf[_0xeb97('0x3b')],{'$or':_[_0xeb97('0x2c')](_0x51a32b,function(_0x2ad87e){if(_0x2ad87e[_0xeb97('0x2f')]!==_0xeb97('0x3f')){var _0x10ed5={};_0x10ed5[_0x2ad87e[_0xeb97('0x2a')]]={'$like':'%'+_0x36de33['query'][_0xeb97('0x3d')]+'%'};return _0x10ed5;}})});}_0x435bbf=_[_0xeb97('0x3e')]({},_0x435bbf,_0x36de33[_0xeb97('0x40')]);var _0x2e4928={'where':_0x435bbf[_0xeb97('0x3b')]};return db['SugarcrmField'][_0xeb97('0x20')](_0x2e4928)[_0xeb97('0x27')](function(_0x23e5b9){_0x1e33db[_0xeb97('0x20')]=_0x23e5b9;if(_0x36de33['query'][_0xeb97('0x41')]){_0x435bbf[_0xeb97('0x42')]=[{'all':!![]}];}return db[_0xeb97('0x43')]['findAll'](_0x435bbf);})[_0xeb97('0x27')](function(_0x45fe96){_0x1e33db[_0xeb97('0x44')]=_0x45fe96;return _0x1e33db;})[_0xeb97('0x27')](respondWithFilteredResult(_0x4bc81e,_0x435bbf))['catch'](handleError(_0x4bc81e,null));};exports[_0xeb97('0x45')]=function(_0x431aab,_0x56f351){var _0x139e55={'raw':!![],'where':{'id':_0x431aab[_0xeb97('0x46')]['id']}},_0x13b1ef={};_0x13b1ef['model']=_[_0xeb97('0x47')](db['SugarcrmField'][_0xeb97('0x2d')]);_0x13b1ef[_0xeb97('0x31')]=_['keys'](_0x431aab[_0xeb97('0x31')]);_0x13b1ef[_0xeb97('0x32')]=_['intersection'](_0x13b1ef[_0xeb97('0x34')],_0x13b1ef['query']);_0x139e55[_0xeb97('0x35')]=_[_0xeb97('0x33')](_0x13b1ef[_0xeb97('0x34')],qs['fields'](_0x431aab[_0xeb97('0x31')][_0xeb97('0x36')]));_0x139e55[_0xeb97('0x35')]=_0x139e55[_0xeb97('0x35')]['length']?_0x139e55[_0xeb97('0x35')]:_0x13b1ef[_0xeb97('0x34')];if(_0x431aab[_0xeb97('0x31')][_0xeb97('0x41')]){_0x139e55['include']=[{'all':!![]}];}_0x139e55=_['merge']({},_0x139e55,_0x431aab[_0xeb97('0x40')]);return db[_0xeb97('0x43')]['find'](_0x139e55)[_0xeb97('0x27')](handleEntityNotFound(_0x56f351,null))[_0xeb97('0x27')](respondWithResult(_0x56f351,null))[_0xeb97('0x48')](handleError(_0x56f351,null));};exports['create']=function(_0x5972ef,_0x18f134){return db[_0xeb97('0x43')][_0xeb97('0x49')](_0x5972ef[_0xeb97('0x4a')],{})[_0xeb97('0x27')](respondWithResult(_0x18f134,0xc9))[_0xeb97('0x48')](handleError(_0x18f134,null));};exports[_0xeb97('0x26')]=function(_0x4ce602,_0x10ac1a){if(_0x4ce602[_0xeb97('0x4a')]['id']){delete _0x4ce602['body']['id'];}return db[_0xeb97('0x43')][_0xeb97('0x4b')]({'where':{'id':_0x4ce602[_0xeb97('0x46')]['id']}})[_0xeb97('0x27')](handleEntityNotFound(_0x10ac1a,null))[_0xeb97('0x27')](saveUpdates(_0x4ce602['body'],null))[_0xeb97('0x27')](respondWithResult(_0x10ac1a,null))[_0xeb97('0x48')](handleError(_0x10ac1a,null));};exports[_0xeb97('0x28')]=function(_0x2340dd,_0x46a3a5){return db[_0xeb97('0x43')][_0xeb97('0x4b')]({'where':{'id':_0x2340dd[_0xeb97('0x46')]['id']}})[_0xeb97('0x27')](handleEntityNotFound(_0x46a3a5,null))['then'](removeEntity(_0x46a3a5,null))[_0xeb97('0x48')](handleError(_0x46a3a5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 09e22c9..160ae26 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 _0xaa22=['int_sugarcrm_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xaa22,0x12f));var _0x2aa2=function(_0x544bf2,_0x3a0218){_0x544bf2=_0x544bf2-0x0;var _0x5e2e3e=_0xaa22[_0x544bf2];return _0x5e2e3e;};'use strict';var _=require('lodash');var util=require(_0x2aa2('0x0'));var logger=require(_0x2aa2('0x1'))(_0x2aa2('0x2'));var moment=require(_0x2aa2('0x3'));var BPromise=require(_0x2aa2('0x4'));var rp=require(_0x2aa2('0x5'));var fs=require('fs');var path=require(_0x2aa2('0x6'));var rimraf=require(_0x2aa2('0x7'));var config=require(_0x2aa2('0x8'));var attributes=require(_0x2aa2('0x9'));module['exports']=function(_0x5c6ad8,_0x5ea8ce){return _0x5c6ad8[_0x2aa2('0xa')](_0x2aa2('0xb'),attributes,{'tableName':_0x2aa2('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x2aa2('0xd'),_0x2aa2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9fa1=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x2c1845,_0x55954e){var _0x2e1433=function(_0x2573b2){while(--_0x2573b2){_0x2c1845['push'](_0x2c1845['shift']());}};_0x2e1433(++_0x55954e);}(_0x9fa1,0x137));var _0x19fa=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x9fa1[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x19fa('0x0'));var util=require(_0x19fa('0x1'));var logger=require(_0x19fa('0x2'))(_0x19fa('0x3'));var moment=require(_0x19fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x19fa('0x5'));var fs=require('fs');var path=require(_0x19fa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x19fa('0x7'));module[_0x19fa('0x8')]=function(_0x1e7621,_0x300877){return _0x1e7621[_0x19fa('0x9')](_0x19fa('0xa'),attributes,{'tableName':_0x19fa('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x19fa('0xc'),_0x19fa('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index c73297a..6b5897a 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 _0xaf9b=['message','request\x20sent','result','catch','util','bluebird','randomstring','../../config/logger','rpc','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2a5ad4,_0xb80fb1){var _0x3d2a67=function(_0x53de6e){while(--_0x53de6e){_0x2a5ad4['push'](_0x2a5ad4['shift']());}};_0x3d2a67(++_0xb80fb1);}(_0xaf9b,0x89));var _0xbaf9=function(_0x954f7d,_0x211eed){_0x954f7d=_0x954f7d-0x0;var _0x2b190f=_0xaf9b[_0x954f7d];return _0x2b190f;};'use strict';var _=require('lodash');var util=require(_0xbaf9('0x0'));var moment=require('moment');var BPromise=require(_0xbaf9('0x1'));var rs=require(_0xbaf9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbaf9('0x3'))(_0xbaf9('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbaf9('0x5')][_0xbaf9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x50ede2,_0x2a1fbc,_0x5b80a6){return new BPromise(function(_0x5955b0,_0x3c9211){return client[_0xbaf9('0x7')](_0x50ede2,_0x5b80a6)[_0xbaf9('0x8')](function(_0x518131){logger[_0xbaf9('0x9')](_0xbaf9('0xa'),_0x2a1fbc,'request\x20sent');logger[_0xbaf9('0xb')](_0xbaf9('0xc'),_0x2a1fbc,'request\x20sent',JSON['stringify'](_0x518131));if(_0x518131[_0xbaf9('0xd')]){if(_0x518131[_0xbaf9('0xd')][_0xbaf9('0xe')]===0x1f4){logger[_0xbaf9('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x2a1fbc,_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);return _0x3c9211(_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);}logger[_0xbaf9('0xd')](_0xbaf9('0xa'),_0x2a1fbc,_0x518131[_0xbaf9('0xd')][_0xbaf9('0xf')]);return _0x5955b0(_0x518131['error'][_0xbaf9('0xf')]);}else{logger[_0xbaf9('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x2a1fbc,_0xbaf9('0x10'));_0x5955b0(_0x518131[_0xbaf9('0x11')][_0xbaf9('0xf')]);}})[_0xbaf9('0x12')](function(_0x31b794){logger[_0xbaf9('0xd')](_0xbaf9('0xa'),_0x2a1fbc,_0x31b794);_0x3c9211(_0x31b794);});});} \ No newline at end of file +var _0x7283=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3e1606,_0x3ff969){var _0x231a90=function(_0x5474bb){while(--_0x5474bb){_0x3e1606['push'](_0x3e1606['shift']());}};_0x231a90(++_0x3ff969);}(_0x7283,0x11e));var _0x3728=function(_0x25e2a1,_0x5017a3){_0x25e2a1=_0x25e2a1-0x0;var _0x10a630=_0x7283[_0x25e2a1];return _0x10a630;};'use strict';var _=require('lodash');var util=require(_0x3728('0x0'));var moment=require(_0x3728('0x1'));var BPromise=require('bluebird');var rs=require(_0x3728('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3728('0x3'))['db'];var utils=require(_0x3728('0x4'));var logger=require(_0x3728('0x5'))('rpc');var config=require(_0x3728('0x6'));var jayson=require(_0x3728('0x7'));var client=jayson[_0x3728('0x8')][_0x3728('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd58441,_0x5167b8,_0x288a78){return new BPromise(function(_0x3675f1,_0x3981a6){return client[_0x3728('0xa')](_0xd58441,_0x288a78)['then'](function(_0x57c241){logger['info'](_0x3728('0xb'),_0x5167b8,_0x3728('0xc'));logger[_0x3728('0xd')](_0x3728('0xe'),_0x5167b8,_0x3728('0xc'),JSON[_0x3728('0xf')](_0x57c241));if(_0x57c241[_0x3728('0x10')]){if(_0x57c241[_0x3728('0x10')][_0x3728('0x11')]===0x1f4){logger[_0x3728('0x10')](_0x3728('0xb'),_0x5167b8,_0x57c241[_0x3728('0x10')][_0x3728('0x12')]);return _0x3981a6(_0x57c241[_0x3728('0x10')][_0x3728('0x12')]);}logger[_0x3728('0x10')](_0x3728('0xb'),_0x5167b8,_0x57c241[_0x3728('0x10')][_0x3728('0x12')]);return _0x3675f1(_0x57c241[_0x3728('0x10')][_0x3728('0x12')]);}else{logger[_0x3728('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x5167b8,_0x3728('0xc'));_0x3675f1(_0x57c241[_0x3728('0x14')][_0x3728('0x12')]);}})[_0x3728('0x15')](function(_0x5ee322){logger[_0x3728('0x10')](_0x3728('0xb'),_0x5167b8,_0x5ee322);_0x3981a6(_0x5ee322);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 63122e7..cfe3941 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 _0xafa8=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xafa8,0x135));var _0x8afa=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xafa8[_0x57fa7e];return _0x320671;};'use strict';var multer=require('multer');var util=require(_0x8afa('0x0'));var path=require(_0x8afa('0x1'));var timeout=require(_0x8afa('0x2'));var express=require(_0x8afa('0x3'));var router=express[_0x8afa('0x4')]();var fs_extra=require(_0x8afa('0x5'));var auth=require(_0x8afa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8afa('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x8afa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8afa('0x8')](_0x8afa('0x9'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xb')]);router['get'](_0x8afa('0xc'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xd')]);router[_0x8afa('0x8')](_0x8afa('0xe'),auth[_0x8afa('0xa')](),controller[_0x8afa('0xf')]);router[_0x8afa('0x10')]('/',auth[_0x8afa('0xa')](),controller['create']);router[_0x8afa('0x10')](_0x8afa('0xc'),auth[_0x8afa('0xa')](),controller[_0x8afa('0x11')]);router[_0x8afa('0x12')](_0x8afa('0x9'),auth[_0x8afa('0xa')](),controller[_0x8afa('0x13')]);router[_0x8afa('0x14')]('/:id',auth[_0x8afa('0xa')](),controller['destroy']);module[_0x8afa('0x15')]=router; \ No newline at end of file +var _0xb708=['show','get','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','/:id'];(function(_0x5be80a,_0x141211){var _0x4403a9=function(_0x23d7a8){while(--_0x23d7a8){_0x5be80a['push'](_0x5be80a['shift']());}};_0x4403a9(++_0x141211);}(_0xb708,0xe7));var _0x8b70=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xb708[_0x2181b1];return _0x530548;};'use strict';var multer=require(_0x8b70('0x0'));var util=require('util');var path=require(_0x8b70('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b70('0x2'));var router=express[_0x8b70('0x3')]();var fs_extra=require(_0x8b70('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b70('0x5'));var config=require(_0x8b70('0x6'));var controller=require(_0x8b70('0x7'));router['get']('/',auth[_0x8b70('0x8')](),controller[_0x8b70('0x9')]);router['get'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller[_0x8b70('0xb')]);router[_0x8b70('0xc')]('/:id/configurations',auth[_0x8b70('0x8')](),controller[_0x8b70('0xd')]);router['get'](_0x8b70('0xe'),auth[_0x8b70('0x8')](),controller['getFields']);router[_0x8b70('0xf')]('/',auth['isAuthenticated'](),controller[_0x8b70('0x10')]);router[_0x8b70('0xf')](_0x8b70('0x11'),auth['isAuthenticated'](),controller[_0x8b70('0x12')]);router[_0x8b70('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8b70('0x14')]);router['delete'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller['destroy']);module[_0x8b70('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 37f65d8..9748f73 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 _0xe6df=['HelpDesk','sequelize','STRING'];(function(_0x376bc6,_0x466cbe){var _0x4392d1=function(_0x3fb3d3){while(--_0x3fb3d3){_0x376bc6['push'](_0x376bc6['shift']());}};_0x4392d1(++_0x466cbe);}(_0xe6df,0x160));var _0xfe6d=function(_0x169abd,_0x6951e6){_0x169abd=_0x169abd-0x0;var _0x40365b=_0xe6df[_0x169abd];return _0x40365b;};'use strict';var Sequelize=require(_0xfe6d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfe6d('0x1')]},'username':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![],'defaultValue':_0xfe6d('0x2')},'remoteUri':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xfe6d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x84c4=['exports','STRING','HelpDesk','sequelize'];(function(_0x573d71,_0x2854d4){var _0x2fe711=function(_0x528f32){while(--_0x528f32){_0x573d71['push'](_0x573d71['shift']());}};_0x2fe711(++_0x2854d4);}(_0x84c4,0xf3));var _0x484c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x484c('0x0'));module[_0x484c('0x1')]={'name':{'type':Sequelize[_0x484c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x484c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x484c('0x2')],'allowNull':![],'defaultValue':_0x484c('0x3')},'remoteUri':{'type':Sequelize[_0x484c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x484c('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 91b29ee..e9d3e2e 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 _0xef64=['picklistValues','value','log','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VtigerAccount','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','findOne','VtigerConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','result','token','describe','sessionName','success','autogenerated','reference','owner','remove','false','label','picklist'];(function(_0x3c67d5,_0x5d9d44){var _0x120e96=function(_0x329da3){while(--_0x329da3){_0x3c67d5['push'](_0x3c67d5['shift']());}};_0x120e96(++_0x5d9d44);}(_0xef64,0x83));var _0x4ef6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xef64[_0x24f31b];return _0x488401;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ef6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ef6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ef6('0x2'));var Mustache=require('mustache');var util=require(_0x4ef6('0x3'));var path=require(_0x4ef6('0x4'));var sox=require(_0x4ef6('0x5'));var csv=require(_0x4ef6('0x6'));var ejs=require(_0x4ef6('0x7'));var fs=require('fs');var fs_extra=require(_0x4ef6('0x8'));var _=require(_0x4ef6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ef6('0xa'));var toCsv=require(_0x4ef6('0x6'));var querystring=require(_0x4ef6('0xb'));var Papa=require(_0x4ef6('0xc'));var Redis=require('ioredis');var authService=require(_0x4ef6('0xd'));var qs=require(_0x4ef6('0xe'));var as=require(_0x4ef6('0xf'));var hardwareService=require(_0x4ef6('0x10'));var logger=require(_0x4ef6('0x11'))(_0x4ef6('0x12'));var utils=require(_0x4ef6('0x13'));var config=require(_0x4ef6('0x14'));var licenseUtil=require(_0x4ef6('0x15'));var db=require(_0x4ef6('0x16'))['db'];var integrations=require(_0x4ef6('0x17'));function respondWithStatusCode(_0x2cbc98,_0x3eccd8){_0x3eccd8=_0x3eccd8||0xcc;return function(_0x276e4f){if(_0x276e4f){return _0x2cbc98[_0x4ef6('0x18')](_0x3eccd8);}return _0x2cbc98['status'](_0x3eccd8)[_0x4ef6('0x19')]();};}function respondWithResult(_0x3a2238,_0x473d8e){_0x473d8e=_0x473d8e||0xc8;return function(_0x5297ab){if(_0x5297ab){return _0x3a2238[_0x4ef6('0x1a')](_0x473d8e)[_0x4ef6('0x1b')](_0x5297ab);}};}function respondWithFilteredResult(_0x129173,_0x59e84e){return function(_0x31df8a){if(_0x31df8a){var _0x27adbe=typeof _0x59e84e[_0x4ef6('0x1c')]===_0x4ef6('0x1d')&&typeof _0x59e84e['limit']===_0x4ef6('0x1d');var _0xe4c304=_0x31df8a[_0x4ef6('0x1e')];var _0xbb1e8b=_0x27adbe?0x0:_0x59e84e[_0x4ef6('0x1c')];var _0x18ed40=_0x27adbe?_0x31df8a[_0x4ef6('0x1e')]:_0x59e84e[_0x4ef6('0x1c')]+_0x59e84e['limit'];var _0x25f075;if(_0x18ed40>=_0xe4c304){_0x18ed40=_0xe4c304;_0x25f075=0xc8;}else{_0x25f075=0xce;}_0x129173[_0x4ef6('0x1a')](_0x25f075);return _0x129173[_0x4ef6('0x1f')](_0x4ef6('0x20'),_0xbb1e8b+'-'+_0x18ed40+'/'+_0xe4c304)[_0x4ef6('0x1b')](_0x31df8a);}return null;};}function patchUpdates(_0x4a5dd6){return function(_0x50b8d0){try{jsonpatch[_0x4ef6('0x21')](_0x50b8d0,_0x4a5dd6,!![]);}catch(_0x949525){return BPromise[_0x4ef6('0x22')](_0x949525);}return _0x50b8d0[_0x4ef6('0x23')]();};}function saveUpdates(_0x4c1e46,_0x475105){return function(_0xfceb3f){if(_0xfceb3f){return _0xfceb3f[_0x4ef6('0x24')](_0x4c1e46)[_0x4ef6('0x25')](function(_0x1217d5){return _0x1217d5;});}return null;};}function removeEntity(_0x45fc37,_0x8b2724){return function(_0x220ef6){if(_0x220ef6){return _0x220ef6[_0x4ef6('0x26')]()[_0x4ef6('0x25')](function(){_0x45fc37[_0x4ef6('0x1a')](0xcc)[_0x4ef6('0x19')]();});}};}function handleEntityNotFound(_0x1a7514,_0x30a9f7){return function(_0x117af){if(!_0x117af){_0x1a7514[_0x4ef6('0x18')](0x194);}return _0x117af;};}function handleError(_0x36a8cf,_0x267e33){_0x267e33=_0x267e33||0x1f4;return function(_0x387ebe){logger[_0x4ef6('0x27')](_0x387ebe[_0x4ef6('0x28')]);if(_0x387ebe[_0x4ef6('0x29')]){delete _0x387ebe['name'];}_0x36a8cf[_0x4ef6('0x1a')](_0x267e33)[_0x4ef6('0x2a')](_0x387ebe);};}exports[_0x4ef6('0x2b')]=function(_0x21f572,_0x44dac0){var _0x2c3fc4={},_0x2e395b={},_0x4eaf78={'count':0x0,'rows':[]};var _0x3aabbb=_['map'](db['VtigerAccount'][_0x4ef6('0x2c')],function(_0x38c1d8){return{'name':_0x38c1d8[_0x4ef6('0x2d')],'type':_0x38c1d8['type'][_0x4ef6('0x2e')]};});_0x2e395b[_0x4ef6('0x2f')]=_[_0x4ef6('0x30')](_0x3aabbb,_0x4ef6('0x29'));_0x2e395b[_0x4ef6('0x31')]=_[_0x4ef6('0x32')](_0x21f572[_0x4ef6('0x31')]);_0x2e395b[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x2e395b['model'],_0x2e395b[_0x4ef6('0x31')]);_0x2c3fc4[_0x4ef6('0x35')]=_[_0x4ef6('0x34')](_0x2e395b[_0x4ef6('0x2f')],qs['fields'](_0x21f572[_0x4ef6('0x31')]['fields']));_0x2c3fc4['attributes']=_0x2c3fc4[_0x4ef6('0x35')][_0x4ef6('0x36')]?_0x2c3fc4[_0x4ef6('0x35')]:_0x2e395b[_0x4ef6('0x2f')];if(!_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x37')](_0x4ef6('0x38'))){_0x2c3fc4['limit']=qs['limit'](_0x21f572['query'][_0x4ef6('0x39')]);_0x2c3fc4['offset']=qs[_0x4ef6('0x1c')](_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x1c')]);}_0x2c3fc4[_0x4ef6('0x3a')]=qs[_0x4ef6('0x3b')](_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x3b')]);_0x2c3fc4[_0x4ef6('0x3c')]=qs[_0x4ef6('0x33')](_[_0x4ef6('0x3d')](_0x21f572[_0x4ef6('0x31')],_0x2e395b[_0x4ef6('0x33')]),_0x3aabbb);if(_0x21f572[_0x4ef6('0x31')][_0x4ef6('0x3e')]){_0x2c3fc4[_0x4ef6('0x3c')]=_['merge'](_0x2c3fc4['where'],{'$or':_[_0x4ef6('0x30')](_0x3aabbb,function(_0x9aad08){if(_0x9aad08['type']!=='VIRTUAL'){var _0xc0bca8={};_0xc0bca8[_0x9aad08[_0x4ef6('0x29')]]={'$like':'%'+_0x21f572['query']['filter']+'%'};return _0xc0bca8;}})});}_0x2c3fc4=_[_0x4ef6('0x3f')]({},_0x2c3fc4,_0x21f572['options']);var _0x313d76={'where':_0x2c3fc4[_0x4ef6('0x3c')]};return db[_0x4ef6('0x40')][_0x4ef6('0x1e')](_0x313d76)[_0x4ef6('0x25')](function(_0x317eaa){_0x4eaf78['count']=_0x317eaa;if(_0x21f572['query'][_0x4ef6('0x41')]){_0x2c3fc4[_0x4ef6('0x42')]=[{'all':!![]}];}return db[_0x4ef6('0x40')][_0x4ef6('0x43')](_0x2c3fc4);})['then'](function(_0x24e43d){_0x4eaf78['rows']=_0x24e43d;return _0x4eaf78;})[_0x4ef6('0x25')](respondWithFilteredResult(_0x44dac0,_0x2c3fc4))[_0x4ef6('0x44')](handleError(_0x44dac0,null));};exports[_0x4ef6('0x45')]=function(_0x3685d7,_0x2787ac){var _0x31789f={'raw':![],'where':{'id':_0x3685d7[_0x4ef6('0x46')]['id']}},_0x3a7137={};_0x3a7137[_0x4ef6('0x2f')]=_['keys'](db[_0x4ef6('0x40')][_0x4ef6('0x2c')]);_0x3a7137[_0x4ef6('0x31')]=_[_0x4ef6('0x32')](_0x3685d7[_0x4ef6('0x31')]);_0x3a7137[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x3a7137['model'],_0x3a7137[_0x4ef6('0x31')]);_0x31789f['attributes']=_[_0x4ef6('0x34')](_0x3a7137[_0x4ef6('0x2f')],qs[_0x4ef6('0x47')](_0x3685d7[_0x4ef6('0x31')][_0x4ef6('0x47')]));_0x31789f[_0x4ef6('0x35')]=_0x31789f['attributes'][_0x4ef6('0x36')]?_0x31789f[_0x4ef6('0x35')]:_0x3a7137[_0x4ef6('0x2f')];if(_0x3685d7['query'][_0x4ef6('0x41')]){_0x31789f[_0x4ef6('0x42')]=[{'all':!![]}];}_0x31789f=_[_0x4ef6('0x3f')]({},_0x31789f,_0x3685d7[_0x4ef6('0x48')]);return db[_0x4ef6('0x40')][_0x4ef6('0x49')](_0x31789f)['then'](handleEntityNotFound(_0x2787ac,null))['then'](respondWithResult(_0x2787ac,null))[_0x4ef6('0x44')](handleError(_0x2787ac,null));};exports[_0x4ef6('0x4a')]=function(_0x1cfe6e,_0x58bc63){return db[_0x4ef6('0x40')][_0x4ef6('0x4a')](_0x1cfe6e[_0x4ef6('0x4b')],{})['then'](respondWithResult(_0x58bc63,0xc9))[_0x4ef6('0x44')](handleError(_0x58bc63,null));};exports[_0x4ef6('0x24')]=function(_0xc2bb62,_0x25cffc){if(_0xc2bb62[_0x4ef6('0x4b')]['id']){delete _0xc2bb62['body']['id'];}return db[_0x4ef6('0x40')][_0x4ef6('0x49')]({'where':{'id':_0xc2bb62[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x25cffc,null))[_0x4ef6('0x25')](saveUpdates(_0xc2bb62[_0x4ef6('0x4b')],null))[_0x4ef6('0x25')](respondWithResult(_0x25cffc,null))[_0x4ef6('0x44')](handleError(_0x25cffc,null));};exports['destroy']=function(_0xd45409,_0x4beb93){return db['VtigerAccount']['find']({'where':{'id':_0xd45409[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x4beb93,null))['then'](removeEntity(_0x4beb93,null))[_0x4ef6('0x44')](handleError(_0x4beb93,null));};exports['getConfigurations']=function(_0x2729fd,_0x48bd1f,_0xb4d18c){var _0x6bfea3={};var _0x59e408={};var _0x204399;var _0x52e40e;return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x2729fd[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x48bd1f,null))[_0x4ef6('0x25')](function(_0x3199a8){if(_0x3199a8){_0x204399=_0x3199a8;_0x59e408[_0x4ef6('0x2f')]=_['keys'](db[_0x4ef6('0x4d')][_0x4ef6('0x2c')]);_0x59e408['query']=_[_0x4ef6('0x32')](_0x2729fd[_0x4ef6('0x31')]);_0x59e408[_0x4ef6('0x33')]=_[_0x4ef6('0x34')](_0x59e408[_0x4ef6('0x2f')],_0x59e408[_0x4ef6('0x31')]);_0x6bfea3['attributes']=_[_0x4ef6('0x34')](_0x59e408[_0x4ef6('0x2f')],qs[_0x4ef6('0x47')](_0x2729fd['query'][_0x4ef6('0x47')]));_0x6bfea3[_0x4ef6('0x35')]=_0x6bfea3[_0x4ef6('0x35')][_0x4ef6('0x36')]?_0x6bfea3[_0x4ef6('0x35')]:_0x59e408['model'];_0x6bfea3[_0x4ef6('0x3a')]=qs[_0x4ef6('0x3b')](_0x2729fd[_0x4ef6('0x31')]['sort']);_0x6bfea3['where']=qs[_0x4ef6('0x33')](_[_0x4ef6('0x3d')](_0x2729fd[_0x4ef6('0x31')],_0x59e408[_0x4ef6('0x33')]));if(_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x3e')]){_0x6bfea3['where']=_[_0x4ef6('0x3f')](_0x6bfea3[_0x4ef6('0x3c')],{'$or':_['map'](_0x6bfea3[_0x4ef6('0x35')],function(_0x549eb4){var _0x3f8f9a={};_0x3f8f9a[_0x549eb4]={'$like':'%'+_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x3e')]+'%'};return _0x3f8f9a;})});}_0x6bfea3=_[_0x4ef6('0x3f')]({},_0x6bfea3,_0x2729fd['options']);return _0x204399[_0x4ef6('0x4e')](_0x6bfea3);}})['then'](function(_0x760d1f){if(_0x760d1f){_0x52e40e=_0x760d1f[_0x4ef6('0x36')];if(!_0x2729fd[_0x4ef6('0x31')]['hasOwnProperty'](_0x4ef6('0x38'))){_0x6bfea3[_0x4ef6('0x39')]=qs['limit'](_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x39')]);_0x6bfea3['offset']=qs[_0x4ef6('0x1c')](_0x2729fd[_0x4ef6('0x31')][_0x4ef6('0x1c')]);}return _0x204399[_0x4ef6('0x4e')](_0x6bfea3);}})[_0x4ef6('0x25')](function(_0x549b38){if(_0x549b38){return _0x549b38?{'count':_0x52e40e,'rows':_0x549b38}:null;}})[_0x4ef6('0x25')](respondWithResult(_0x48bd1f,null))[_0x4ef6('0x44')](handleError(_0x48bd1f,null));};exports['addConfiguration']=function(_0x50416e,_0x51d4e7,_0x517e9e){if(_0x50416e[_0x4ef6('0x4b')]['id']){delete _0x50416e['body']['id'];}return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x50416e[_0x4ef6('0x46')]['id']}})[_0x4ef6('0x25')](handleEntityNotFound(_0x51d4e7,null))[_0x4ef6('0x25')](function(_0xae1b37){if(_0xae1b37){_0x50416e['body'][_0x4ef6('0x4f')]=_0xae1b37['id'];_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x50')]=integrations[_0x4ef6('0x51')](_0x50416e['body'][_0x4ef6('0x52')],_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x53')]);_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x54')]=integrations[_0x4ef6('0x55')](_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x52')],_0x50416e[_0x4ef6('0x4b')][_0x4ef6('0x53')]);return db[_0x4ef6('0x4d')][_0x4ef6('0x4a')](_0x50416e['body'],{'include':[{'model':db[_0x4ef6('0x56')],'as':'Subjects'},{'model':db[_0x4ef6('0x56')],'as':_0x4ef6('0x54')}]});}return null;})[_0x4ef6('0x25')](respondWithResult(_0x51d4e7,null))[_0x4ef6('0x44')](handleError(_0x51d4e7,null));};var md5=require(_0x4ef6('0x57'));exports[_0x4ef6('0x58')]=function(_0x28e9c6,_0x565e64,_0x26dcc3){var _0x84ab87=null;var _0x30aa1d=null;var _0x4021b3=null;var _0x2f0b5b=null;var _0x27f513='';return db[_0x4ef6('0x40')][_0x4ef6('0x4c')]({'where':{'id':_0x28e9c6['params']['id']},'attributes':['id',_0x4ef6('0x29'),_0x4ef6('0x59'),_0x4ef6('0x5a'),_0x4ef6('0x5b'),_0x4ef6('0x5c'),_0x4ef6('0x5d'),'accessKey']})[_0x4ef6('0x25')](handleEntityNotFound(_0x565e64,null))[_0x4ef6('0x25')](function(_0xb2385f){if(_0xb2385f){_0x84ab87=_0xb2385f[_0x4ef6('0x59')];_0x30aa1d=_0xb2385f[_0x4ef6('0x5e')];_0x4021b3=_0xb2385f[_0x4ef6('0x5b')];_0x27f513=_0xb2385f[_0x4ef6('0x5c')];var _0x2ec617=_0x27f513[_0x4ef6('0x5f')](-0x1);if(_0x2ec617==='/'){_0x27f513=_0x27f513[_0x4ef6('0x60')](0x0,_0x27f513[_0x4ef6('0x61')](_0x2ec617));}_0x2f0b5b=util[_0x4ef6('0x62')](_0x4ef6('0x63'),_0x27f513);var _0x5d28dd={'method':_0x4ef6('0x64'),'uri':_0x2f0b5b,'qs':{'operation':_0x4ef6('0x65'),'username':_0xb2385f[_0x4ef6('0x59')]},'json':!![]};return rp(_0x5d28dd);}})['then'](function(_0x57ff36){if(_0x57ff36['success']){var _0x348093={'method':'POST','uri':_0x2f0b5b,'form':{'operation':_0x4ef6('0x66'),'username':_0x84ab87,'accessKey':md5(_0x57ff36[_0x4ef6('0x67')][_0x4ef6('0x68')]+_0x30aa1d)},'json':!![]};return rp(_0x348093);}})['then'](function(_0x8651db){if(_0x8651db['success']){var _0x5c830f={'method':_0x4ef6('0x64'),'uri':_0x2f0b5b,'qs':{'operation':_0x4ef6('0x69'),'username':_0x84ab87,'sessionName':_0x8651db[_0x4ef6('0x67')][_0x4ef6('0x6a')],'elementType':_0x4021b3},'json':!![]};return rp(_0x5c830f);}})[_0x4ef6('0x25')](function(_0x21b3c4){if(_0x21b3c4[_0x4ef6('0x6b')]){var _0xb97418=[_0x4ef6('0x6c'),_0x4ef6('0x6d'),_0x4ef6('0x6e')];_['remove'](_0x21b3c4[_0x4ef6('0x67')][_0x4ef6('0x47')],function(_0x135444){return _0xb97418['includes'](_0x135444[_0x4ef6('0x53')]['name']);});_[_0x4ef6('0x6f')](_0x21b3c4[_0x4ef6('0x67')][_0x4ef6('0x47')],function(_0x46d177){return _0x46d177['editable']===_0x4ef6('0x70');});return{'count':_0x21b3c4['result'][_0x4ef6('0x47')][_0x4ef6('0x36')],'rows':_['map'](_0x21b3c4['result'][_0x4ef6('0x47')],function(_0x598e3d){return{'id':_0x598e3d[_0x4ef6('0x29')],'name':_0x598e3d[_0x4ef6('0x71')],'custom':_['startsWith'](_0x598e3d[_0x4ef6('0x29')],'cf_')?!![]:![],'options':_0x598e3d['type'][_0x4ef6('0x29')]===_0x4ef6('0x72')&&_0x598e3d[_0x4ef6('0x53')][_0x4ef6('0x73')][_0x4ef6('0x36')]>0x0?_['map'](_0x598e3d[_0x4ef6('0x53')][_0x4ef6('0x73')],function(_0x5ec733){return{'name':_0x5ec733['label'],'value':_0x5ec733[_0x4ef6('0x74')]};}):[]};})};}})[_0x4ef6('0x25')](respondWithResult(_0x565e64,null))[_0x4ef6('0x44')](function(_0x3448c5){console[_0x4ef6('0x75')](_0x4ef6('0x76')+_0x3448c5);var _0x30fb19=_0x28e9c6[_0x4ef6('0x31')]['test']?0x1f4:_0x3448c5[_0x4ef6('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4ef6('0x58'),_0x30fb19,JSON[_0x4ef6('0x78')](_0x3448c5));delete _0x3448c5[_0x4ef6('0x29')];if(_0x30fb19===0x191){_0x30fb19=0x190;}_0x565e64[_0x4ef6('0x1a')](_0x30fb19)[_0x4ef6('0x2a')](_0x28e9c6[_0x4ef6('0x31')][_0x4ef6('0x79')]?{'message':_0x4ef6('0x7a'),'statusCode':_0x3448c5[_0x4ef6('0x77')]}:_0x3448c5);});}; \ No newline at end of file +var _0x79f1=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VtigerAccount','includeAll','findAll','catch','show','params','keys','include','create','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','serverUrl','accessKey','remoteUri','substring','format','GET','getchallenge','success','login','token','sessionName','autogenerated','reference','owner','includes','result','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1922a5,_0x467602){var _0x9739e2=function(_0x572c21){while(--_0x572c21){_0x1922a5['push'](_0x1922a5['shift']());}};_0x9739e2(++_0x467602);}(_0x79f1,0x1d7));var _0x179f=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x79f1[_0x42bc91];return _0x3f5507;};'use strict';var emlformat=require(_0x179f('0x0'));var rimraf=require(_0x179f('0x1'));var zipdir=require(_0x179f('0x2'));var jsonpatch=require(_0x179f('0x3'));var rp=require(_0x179f('0x4'));var moment=require(_0x179f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x179f('0x6'));var util=require(_0x179f('0x7'));var path=require(_0x179f('0x8'));var sox=require(_0x179f('0x9'));var csv=require(_0x179f('0xa'));var ejs=require(_0x179f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x179f('0xc'));var crypto=require('crypto');var jsforce=require(_0x179f('0xd'));var deskjs=require(_0x179f('0xe'));var toCsv=require(_0x179f('0xa'));var querystring=require(_0x179f('0xf'));var Papa=require(_0x179f('0x10'));var Redis=require(_0x179f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x179f('0x12'));var as=require(_0x179f('0x13'));var hardwareService=require(_0x179f('0x14'));var logger=require(_0x179f('0x15'))(_0x179f('0x16'));var utils=require(_0x179f('0x17'));var config=require(_0x179f('0x18'));var licenseUtil=require(_0x179f('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x179f('0x1a'));function respondWithStatusCode(_0x4422a0,_0x128f4f){_0x128f4f=_0x128f4f||0xcc;return function(_0x1cfe45){if(_0x1cfe45){return _0x4422a0[_0x179f('0x1b')](_0x128f4f);}return _0x4422a0[_0x179f('0x1c')](_0x128f4f)[_0x179f('0x1d')]();};}function respondWithResult(_0x2656f5,_0x34445f){_0x34445f=_0x34445f||0xc8;return function(_0x457e60){if(_0x457e60){return _0x2656f5[_0x179f('0x1c')](_0x34445f)['json'](_0x457e60);}};}function respondWithFilteredResult(_0x56cadd,_0xd8cbd9){return function(_0x1c9ca1){if(_0x1c9ca1){var _0x17e2c4=typeof _0xd8cbd9[_0x179f('0x1e')]===_0x179f('0x1f')&&typeof _0xd8cbd9['limit']==='undefined';var _0x2cf66d=_0x1c9ca1['count'];var _0x58f073=_0x17e2c4?0x0:_0xd8cbd9[_0x179f('0x1e')];var _0x5a865d=_0x17e2c4?_0x1c9ca1[_0x179f('0x20')]:_0xd8cbd9[_0x179f('0x1e')]+_0xd8cbd9[_0x179f('0x21')];var _0x6da7c;if(_0x5a865d>=_0x2cf66d){_0x5a865d=_0x2cf66d;_0x6da7c=0xc8;}else{_0x6da7c=0xce;}_0x56cadd[_0x179f('0x1c')](_0x6da7c);return _0x56cadd[_0x179f('0x22')](_0x179f('0x23'),_0x58f073+'-'+_0x5a865d+'/'+_0x2cf66d)[_0x179f('0x24')](_0x1c9ca1);}return null;};}function patchUpdates(_0x47dec){return function(_0x7689f){try{jsonpatch['apply'](_0x7689f,_0x47dec,!![]);}catch(_0x265b2d){return BPromise[_0x179f('0x25')](_0x265b2d);}return _0x7689f[_0x179f('0x26')]();};}function saveUpdates(_0x3c70f3,_0x5721af){return function(_0x10b151){if(_0x10b151){return _0x10b151['update'](_0x3c70f3)[_0x179f('0x27')](function(_0x31d1ad){return _0x31d1ad;});}return null;};}function removeEntity(_0x460ff1,_0x221c74){return function(_0x15693f){if(_0x15693f){return _0x15693f[_0x179f('0x28')]()[_0x179f('0x27')](function(){_0x460ff1[_0x179f('0x1c')](0xcc)[_0x179f('0x1d')]();});}};}function handleEntityNotFound(_0x55725b,_0xd36290){return function(_0x17238f){if(!_0x17238f){_0x55725b['sendStatus'](0x194);}return _0x17238f;};}function handleError(_0xae3d6d,_0x53c404){_0x53c404=_0x53c404||0x1f4;return function(_0x42ff63){logger[_0x179f('0x29')](_0x42ff63[_0x179f('0x2a')]);if(_0x42ff63[_0x179f('0x2b')]){delete _0x42ff63[_0x179f('0x2b')];}_0xae3d6d[_0x179f('0x1c')](_0x53c404)[_0x179f('0x2c')](_0x42ff63);};}exports[_0x179f('0x2d')]=function(_0x2aea88,_0x2cd4b1){var _0x24fda2={},_0x2ff77f={},_0x1313d1={'count':0x0,'rows':[]};var _0x293f4f=_[_0x179f('0x2e')](db['VtigerAccount'][_0x179f('0x2f')],function(_0x3f180c){return{'name':_0x3f180c[_0x179f('0x30')],'type':_0x3f180c[_0x179f('0x31')][_0x179f('0x32')]};});_0x2ff77f[_0x179f('0x33')]=_['map'](_0x293f4f,'name');_0x2ff77f[_0x179f('0x34')]=_['keys'](_0x2aea88['query']);_0x2ff77f[_0x179f('0x35')]=_[_0x179f('0x36')](_0x2ff77f[_0x179f('0x33')],_0x2ff77f[_0x179f('0x34')]);_0x24fda2['attributes']=_[_0x179f('0x36')](_0x2ff77f['model'],qs[_0x179f('0x37')](_0x2aea88[_0x179f('0x34')][_0x179f('0x37')]));_0x24fda2[_0x179f('0x38')]=_0x24fda2[_0x179f('0x38')][_0x179f('0x39')]?_0x24fda2[_0x179f('0x38')]:_0x2ff77f[_0x179f('0x33')];if(!_0x2aea88[_0x179f('0x34')][_0x179f('0x3a')](_0x179f('0x3b'))){_0x24fda2[_0x179f('0x21')]=qs[_0x179f('0x21')](_0x2aea88[_0x179f('0x34')][_0x179f('0x21')]);_0x24fda2[_0x179f('0x1e')]=qs[_0x179f('0x1e')](_0x2aea88[_0x179f('0x34')][_0x179f('0x1e')]);}_0x24fda2[_0x179f('0x3c')]=qs[_0x179f('0x3d')](_0x2aea88[_0x179f('0x34')][_0x179f('0x3d')]);_0x24fda2['where']=qs[_0x179f('0x35')](_[_0x179f('0x3e')](_0x2aea88['query'],_0x2ff77f['filters']),_0x293f4f);if(_0x2aea88[_0x179f('0x34')][_0x179f('0x3f')]){_0x24fda2[_0x179f('0x40')]=_[_0x179f('0x41')](_0x24fda2[_0x179f('0x40')],{'$or':_[_0x179f('0x2e')](_0x293f4f,function(_0x43ba3c){if(_0x43ba3c[_0x179f('0x31')]!==_0x179f('0x42')){var _0x35cf46={};_0x35cf46[_0x43ba3c[_0x179f('0x2b')]]={'$like':'%'+_0x2aea88[_0x179f('0x34')]['filter']+'%'};return _0x35cf46;}})});}_0x24fda2=_['merge']({},_0x24fda2,_0x2aea88[_0x179f('0x43')]);var _0xc9d0ae={'where':_0x24fda2[_0x179f('0x40')]};return db[_0x179f('0x44')][_0x179f('0x20')](_0xc9d0ae)[_0x179f('0x27')](function(_0x5a8a96){_0x1313d1['count']=_0x5a8a96;if(_0x2aea88[_0x179f('0x34')][_0x179f('0x45')]){_0x24fda2['include']=[{'all':!![]}];}return db[_0x179f('0x44')][_0x179f('0x46')](_0x24fda2);})['then'](function(_0x21fd5d){_0x1313d1['rows']=_0x21fd5d;return _0x1313d1;})[_0x179f('0x27')](respondWithFilteredResult(_0x2cd4b1,_0x24fda2))[_0x179f('0x47')](handleError(_0x2cd4b1,null));};exports[_0x179f('0x48')]=function(_0x10a7e9,_0x713e10){var _0x23b0c4={'raw':![],'where':{'id':_0x10a7e9[_0x179f('0x49')]['id']}},_0x9401c={};_0x9401c[_0x179f('0x33')]=_[_0x179f('0x4a')](db[_0x179f('0x44')][_0x179f('0x2f')]);_0x9401c[_0x179f('0x34')]=_['keys'](_0x10a7e9['query']);_0x9401c['filters']=_['intersection'](_0x9401c[_0x179f('0x33')],_0x9401c[_0x179f('0x34')]);_0x23b0c4[_0x179f('0x38')]=_[_0x179f('0x36')](_0x9401c[_0x179f('0x33')],qs['fields'](_0x10a7e9[_0x179f('0x34')][_0x179f('0x37')]));_0x23b0c4[_0x179f('0x38')]=_0x23b0c4[_0x179f('0x38')][_0x179f('0x39')]?_0x23b0c4[_0x179f('0x38')]:_0x9401c[_0x179f('0x33')];if(_0x10a7e9[_0x179f('0x34')][_0x179f('0x45')]){_0x23b0c4[_0x179f('0x4b')]=[{'all':!![]}];}_0x23b0c4=_['merge']({},_0x23b0c4,_0x10a7e9[_0x179f('0x43')]);return db['VtigerAccount']['find'](_0x23b0c4)[_0x179f('0x27')](handleEntityNotFound(_0x713e10,null))[_0x179f('0x27')](respondWithResult(_0x713e10,null))[_0x179f('0x47')](handleError(_0x713e10,null));};exports[_0x179f('0x4c')]=function(_0x228355,_0x463daa){return db['VtigerAccount'][_0x179f('0x4c')](_0x228355['body'],{})['then'](respondWithResult(_0x463daa,0xc9))[_0x179f('0x47')](handleError(_0x463daa,null));};exports['update']=function(_0x4fc190,_0x3af2ef){if(_0x4fc190[_0x179f('0x4d')]['id']){delete _0x4fc190[_0x179f('0x4d')]['id'];}return db[_0x179f('0x44')][_0x179f('0x4e')]({'where':{'id':_0x4fc190[_0x179f('0x49')]['id']}})[_0x179f('0x27')](handleEntityNotFound(_0x3af2ef,null))['then'](saveUpdates(_0x4fc190[_0x179f('0x4d')],null))[_0x179f('0x27')](respondWithResult(_0x3af2ef,null))[_0x179f('0x47')](handleError(_0x3af2ef,null));};exports[_0x179f('0x28')]=function(_0xf1c311,_0x5b3501){return db['VtigerAccount']['find']({'where':{'id':_0xf1c311['params']['id']}})[_0x179f('0x27')](handleEntityNotFound(_0x5b3501,null))[_0x179f('0x27')](removeEntity(_0x5b3501,null))['catch'](handleError(_0x5b3501,null));};exports[_0x179f('0x4f')]=function(_0x313a35,_0x289e80,_0x28a0e5){var _0xd2e9a6={};var _0x6d95b7={};var _0x174cd6;var _0x3136a9;return db[_0x179f('0x44')][_0x179f('0x50')]({'where':{'id':_0x313a35[_0x179f('0x49')]['id']}})[_0x179f('0x27')](handleEntityNotFound(_0x289e80,null))[_0x179f('0x27')](function(_0x46c548){if(_0x46c548){_0x174cd6=_0x46c548;_0x6d95b7['model']=_[_0x179f('0x4a')](db[_0x179f('0x51')][_0x179f('0x2f')]);_0x6d95b7['query']=_[_0x179f('0x4a')](_0x313a35[_0x179f('0x34')]);_0x6d95b7[_0x179f('0x35')]=_[_0x179f('0x36')](_0x6d95b7[_0x179f('0x33')],_0x6d95b7[_0x179f('0x34')]);_0xd2e9a6[_0x179f('0x38')]=_[_0x179f('0x36')](_0x6d95b7['model'],qs[_0x179f('0x37')](_0x313a35[_0x179f('0x34')][_0x179f('0x37')]));_0xd2e9a6[_0x179f('0x38')]=_0xd2e9a6[_0x179f('0x38')][_0x179f('0x39')]?_0xd2e9a6[_0x179f('0x38')]:_0x6d95b7['model'];_0xd2e9a6['order']=qs['sort'](_0x313a35['query']['sort']);_0xd2e9a6[_0x179f('0x40')]=qs[_0x179f('0x35')](_[_0x179f('0x3e')](_0x313a35[_0x179f('0x34')],_0x6d95b7[_0x179f('0x35')]));if(_0x313a35['query']['filter']){_0xd2e9a6[_0x179f('0x40')]=_[_0x179f('0x41')](_0xd2e9a6[_0x179f('0x40')],{'$or':_[_0x179f('0x2e')](_0xd2e9a6[_0x179f('0x38')],function(_0x10da8d){var _0x2edcbe={};_0x2edcbe[_0x10da8d]={'$like':'%'+_0x313a35['query'][_0x179f('0x3f')]+'%'};return _0x2edcbe;})});}_0xd2e9a6=_['merge']({},_0xd2e9a6,_0x313a35[_0x179f('0x43')]);return _0x174cd6[_0x179f('0x4f')](_0xd2e9a6);}})[_0x179f('0x27')](function(_0x11e139){if(_0x11e139){_0x3136a9=_0x11e139[_0x179f('0x39')];if(!_0x313a35[_0x179f('0x34')][_0x179f('0x3a')](_0x179f('0x3b'))){_0xd2e9a6[_0x179f('0x21')]=qs[_0x179f('0x21')](_0x313a35[_0x179f('0x34')][_0x179f('0x21')]);_0xd2e9a6['offset']=qs[_0x179f('0x1e')](_0x313a35['query'][_0x179f('0x1e')]);}return _0x174cd6[_0x179f('0x4f')](_0xd2e9a6);}})[_0x179f('0x27')](function(_0x4504b1){if(_0x4504b1){return _0x4504b1?{'count':_0x3136a9,'rows':_0x4504b1}:null;}})[_0x179f('0x27')](respondWithResult(_0x289e80,null))[_0x179f('0x47')](handleError(_0x289e80,null));};exports[_0x179f('0x52')]=function(_0x132159,_0x34f85e,_0x539a25){if(_0x132159[_0x179f('0x4d')]['id']){delete _0x132159['body']['id'];}return db[_0x179f('0x44')]['findOne']({'where':{'id':_0x132159[_0x179f('0x49')]['id']}})[_0x179f('0x27')](handleEntityNotFound(_0x34f85e,null))[_0x179f('0x27')](function(_0x220589){if(_0x220589){_0x132159[_0x179f('0x4d')][_0x179f('0x53')]=_0x220589['id'];_0x132159[_0x179f('0x4d')][_0x179f('0x54')]=integrations['getSubjects'](_0x132159['body'][_0x179f('0x55')],_0x132159[_0x179f('0x4d')][_0x179f('0x31')]);_0x132159['body'][_0x179f('0x56')]=integrations[_0x179f('0x57')](_0x132159[_0x179f('0x4d')][_0x179f('0x55')],_0x132159[_0x179f('0x4d')][_0x179f('0x31')]);return db['VtigerConfiguration'][_0x179f('0x4c')](_0x132159['body'],{'include':[{'model':db[_0x179f('0x58')],'as':_0x179f('0x54')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0x179f('0x27')](respondWithResult(_0x34f85e,null))['catch'](handleError(_0x34f85e,null));};var md5=require(_0x179f('0x59'));exports[_0x179f('0x5a')]=function(_0x7c4843,_0x3783fa,_0x942234){var _0x3b6f23=null;var _0x5c82c6=null;var _0xd344c0=null;var _0x415add=null;var _0x5dd530='';return db[_0x179f('0x44')][_0x179f('0x50')]({'where':{'id':_0x7c4843['params']['id']},'attributes':['id','name',_0x179f('0x5b'),'description',_0x179f('0x5c'),'remoteUri',_0x179f('0x5d'),'accessKey']})[_0x179f('0x27')](handleEntityNotFound(_0x3783fa,null))['then'](function(_0xa1ec53){if(_0xa1ec53){_0x3b6f23=_0xa1ec53[_0x179f('0x5b')];_0x5c82c6=_0xa1ec53[_0x179f('0x5e')];_0xd344c0=_0xa1ec53['moduleName'];_0x5dd530=_0xa1ec53[_0x179f('0x5f')];var _0x3ed1cd=_0x5dd530['slice'](-0x1);if(_0x3ed1cd==='/'){_0x5dd530=_0x5dd530[_0x179f('0x60')](0x0,_0x5dd530['lastIndexOf'](_0x3ed1cd));}_0x415add=util[_0x179f('0x61')]('%s/webservice.php',_0x5dd530);var _0x1f7422={'method':_0x179f('0x62'),'uri':_0x415add,'qs':{'operation':_0x179f('0x63'),'username':_0xa1ec53['username']},'json':!![]};return rp(_0x1f7422);}})[_0x179f('0x27')](function(_0x38b488){if(_0x38b488[_0x179f('0x64')]){var _0x1c5d59={'method':'POST','uri':_0x415add,'form':{'operation':_0x179f('0x65'),'username':_0x3b6f23,'accessKey':md5(_0x38b488['result'][_0x179f('0x66')]+_0x5c82c6)},'json':!![]};return rp(_0x1c5d59);}})['then'](function(_0x51c21f){if(_0x51c21f[_0x179f('0x64')]){var _0x259365={'method':_0x179f('0x62'),'uri':_0x415add,'qs':{'operation':'describe','username':_0x3b6f23,'sessionName':_0x51c21f['result'][_0x179f('0x67')],'elementType':_0xd344c0},'json':!![]};return rp(_0x259365);}})[_0x179f('0x27')](function(_0x16756d){if(_0x16756d['success']){var _0x117ad9=[_0x179f('0x68'),_0x179f('0x69'),_0x179f('0x6a')];_['remove'](_0x16756d['result'][_0x179f('0x37')],function(_0x58c63a){return _0x117ad9[_0x179f('0x6b')](_0x58c63a[_0x179f('0x31')][_0x179f('0x2b')]);});_['remove'](_0x16756d[_0x179f('0x6c')][_0x179f('0x37')],function(_0x1ee9f0){return _0x1ee9f0[_0x179f('0x6d')]===_0x179f('0x6e');});return{'count':_0x16756d['result'][_0x179f('0x37')][_0x179f('0x39')],'rows':_['map'](_0x16756d[_0x179f('0x6c')][_0x179f('0x37')],function(_0x5593af){return{'id':_0x5593af['name'],'name':_0x5593af[_0x179f('0x6f')],'custom':_[_0x179f('0x70')](_0x5593af['name'],_0x179f('0x71'))?!![]:![],'options':_0x5593af[_0x179f('0x31')][_0x179f('0x2b')]===_0x179f('0x72')&&_0x5593af[_0x179f('0x31')][_0x179f('0x73')][_0x179f('0x39')]>0x0?_[_0x179f('0x2e')](_0x5593af[_0x179f('0x31')][_0x179f('0x73')],function(_0x5f997e){return{'name':_0x5f997e['label'],'value':_0x5f997e[_0x179f('0x74')]};}):[]};})};}})[_0x179f('0x27')](respondWithResult(_0x3783fa,null))['catch'](function(_0xbaeaee){console[_0x179f('0x75')](_0x179f('0x76')+_0xbaeaee);var _0x4b2e51=_0x7c4843[_0x179f('0x34')][_0x179f('0x77')]?0x1f4:_0xbaeaee[_0x179f('0x78')]||0x1f4;logger[_0x179f('0x29')](_0x179f('0x79'),'getFields',_0x4b2e51,JSON[_0x179f('0x7a')](_0xbaeaee));delete _0xbaeaee[_0x179f('0x2b')];if(_0x4b2e51===0x191){_0x4b2e51=0x190;}_0x3783fa[_0x179f('0x1c')](_0x4b2e51)['send'](_0x7c4843['query'][_0x179f('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0xbaeaee[_0x179f('0x78')]}:_0xbaeaee);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3db40dc..9be24d2 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 _0x2171=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0xf7b24f,_0x1bd51f){var _0x2b8d84=function(_0x2c06d0){while(--_0x2c06d0){_0xf7b24f['push'](_0xf7b24f['shift']());}};_0x2b8d84(++_0x1bd51f);}(_0x2171,0x1f1));var _0x1217=function(_0x217975,_0x327e19){_0x217975=_0x217975-0x0;var _0xd48819=_0x2171[_0x217975];return _0xd48819;};'use strict';var _=require(_0x1217('0x0'));var util=require(_0x1217('0x1'));var logger=require('../../config/logger')(_0x1217('0x2'));var moment=require(_0x1217('0x3'));var BPromise=require(_0x1217('0x4'));var rp=require(_0x1217('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1217('0x6'));var config=require(_0x1217('0x7'));var attributes=require(_0x1217('0x8'));var integrations=require(_0x1217('0x9'));module['exports']=function(_0x4cd8d4,_0xa5e9d){return _0x4cd8d4[_0x1217('0xa')]('VtigerAccount',attributes,{'tableName':_0x1217('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1782=['exports','define','VtigerAccount','util','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x3e3395,_0x5324aa){var _0x18134f=function(_0x103d3d){while(--_0x103d3d){_0x3e3395['push'](_0x3e3395['shift']());}};_0x18134f(++_0x5324aa);}(_0x1782,0xb7));var _0x2178=function(_0x1a4c70,_0x4c280f){_0x1a4c70=_0x1a4c70-0x0;var _0x1d4a78=_0x1782[_0x1a4c70];return _0x1d4a78;};'use strict';var _=require('lodash');var util=require(_0x2178('0x0'));var logger=require('../../config/logger')(_0x2178('0x1'));var moment=require(_0x2178('0x2'));var BPromise=require('bluebird');var rp=require(_0x2178('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2178('0x4'));var config=require(_0x2178('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2178('0x6'));module[_0x2178('0x7')]=function(_0x234bd1,_0x55af18){return _0x234bd1[_0x2178('0x8')](_0x2178('0x9'),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 083f600..9f8c96c 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 _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x10f10f,_0x38c840){var _0x1089aa=function(_0x3fb6f6){while(--_0x3fb6f6){_0x10f10f['push'](_0x10f10f['shift']());}};_0x1089aa(++_0x38c840);}(_0xe706,0xa3));var _0x6e70=function(_0x2375e1,_0x3d125a){_0x2375e1=_0x2375e1-0x0;var _0x2ccc7d=_0xe706[_0x2375e1];return _0x2ccc7d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5b85d9,_0x283675){var _0x46551c=function(_0x7d982a){while(--_0x7d982a){_0x5b85d9['push'](_0x5b85d9['shift']());}};_0x46551c(++_0x283675);}(_0xd87e,0x1bf));var _0xed87=function(_0x27d66e,_0x114031){_0x27d66e=_0x27d66e-0x0;var _0x4211f0=_0xd87e[_0x27d66e];return _0x4211f0;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 2e8906c..c94fc24 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 _0x6901=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x6901,0x98));var _0x1690=function(_0xe5964,_0x1a6057){_0xe5964=_0xe5964-0x0;var _0x5d0680=_0x6901[_0xe5964];return _0x5d0680;};'use strict';var multer=require(_0x1690('0x0'));var util=require(_0x1690('0x1'));var path=require(_0x1690('0x2'));var timeout=require(_0x1690('0x3'));var express=require('express');var router=express[_0x1690('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1690('0x5'));var interaction=require(_0x1690('0x6'));var config=require('../../config/environment');var controller=require(_0x1690('0x7'));router[_0x1690('0x8')]('/',auth['isAuthenticated'](),controller[_0x1690('0x9')]);router['get'](_0x1690('0xa'),auth[_0x1690('0xb')](),controller[_0x1690('0xc')]);router[_0x1690('0x8')](_0x1690('0xd'),auth['isAuthenticated'](),controller[_0x1690('0xe')]);router[_0x1690('0x8')](_0x1690('0xf'),auth['isAuthenticated'](),controller[_0x1690('0x10')]);router[_0x1690('0x8')](_0x1690('0x11'),auth[_0x1690('0xb')](),controller['getDescriptions']);router[_0x1690('0x12')]('/',auth[_0x1690('0xb')](),controller[_0x1690('0x13')]);router[_0x1690('0x14')](_0x1690('0xa'),auth[_0x1690('0xb')](),controller[_0x1690('0x15')]);router[_0x1690('0x16')](_0x1690('0xa'),auth['isAuthenticated'](),controller[_0x1690('0x17')]);module[_0x1690('0x18')]=router; \ No newline at end of file +var _0x534f=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put'];(function(_0x521884,_0x430df3){var _0x5ceb0e=function(_0x30d57){while(--_0x30d57){_0x521884['push'](_0x521884['shift']());}};_0x5ceb0e(++_0x430df3);}(_0x534f,0x1b3));var _0xf534=function(_0x71c27b,_0x1a214c){_0x71c27b=_0x71c27b-0x0;var _0x5b33dd=_0x534f[_0x71c27b];return _0x5b33dd;};'use strict';var multer=require(_0xf534('0x0'));var util=require(_0xf534('0x1'));var path=require(_0xf534('0x2'));var timeout=require(_0xf534('0x3'));var express=require('express');var router=express[_0xf534('0x4')]();var fs_extra=require(_0xf534('0x5'));var auth=require(_0xf534('0x6'));var interaction=require(_0xf534('0x7'));var config=require(_0xf534('0x8'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf534('0x9')]);router[_0xf534('0xa')](_0xf534('0xb'),auth['isAuthenticated'](),controller[_0xf534('0xc')]);router[_0xf534('0xa')]('/:id/fields',auth[_0xf534('0xd')](),controller[_0xf534('0xe')]);router[_0xf534('0xa')](_0xf534('0xf'),auth[_0xf534('0xd')](),controller[_0xf534('0x10')]);router[_0xf534('0xa')](_0xf534('0x11'),auth[_0xf534('0xd')](),controller[_0xf534('0x12')]);router['post']('/',auth[_0xf534('0xd')](),controller[_0xf534('0x13')]);router[_0xf534('0x14')](_0xf534('0xb'),auth[_0xf534('0xd')](),controller['update']);router[_0xf534('0x15')](_0xf534('0xb'),auth[_0xf534('0xd')](),controller[_0xf534('0x16')]);module[_0xf534('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 5afa751..73d0ec6 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 _0x9730=['sequelize','exports','STRING'];(function(_0x3c10e3,_0x1d5e67){var _0x36098d=function(_0x550877){while(--_0x550877){_0x3c10e3['push'](_0x3c10e3['shift']());}};_0x36098d(++_0x1d5e67);}(_0x9730,0xc9));var _0x0973=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9730[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0973('0x0'));module[_0x0973('0x1')]={'name':{'type':Sequelize[_0x0973('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c5d=['sequelize','STRING'];(function(_0x4fcaa3,_0xa38ec7){var _0x2873a0=function(_0x35ead1){while(--_0x35ead1){_0x4fcaa3['push'](_0x4fcaa3['shift']());}};_0x2873a0(++_0xa38ec7);}(_0x5c5d,0x1de));var _0xd5c5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5c5d[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd5c5('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5c5('0x1')]},'description':{'type':Sequelize[_0xd5c5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a3ec39e..a81ad06 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 _0x951a=['where','pick','filter','VIRTUAL','options','count','include','findAll','catch','show','params','merge','find','body','getFields','findOne','VtigerField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0x951a,0x101));var _0xa951=function(_0x294650,_0x4d9729){_0x294650=_0x294650-0x0;var _0x3fe59d=_0x951a[_0x294650];return _0x3fe59d;};'use strict';var emlformat=require(_0xa951('0x0'));var rimraf=require(_0xa951('0x1'));var zipdir=require(_0xa951('0x2'));var jsonpatch=require(_0xa951('0x3'));var rp=require(_0xa951('0x4'));var moment=require('moment');var BPromise=require(_0xa951('0x5'));var Mustache=require(_0xa951('0x6'));var util=require(_0xa951('0x7'));var path=require(_0xa951('0x8'));var sox=require(_0xa951('0x9'));var csv=require(_0xa951('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa951('0xb'));var _=require('lodash');var squel=require(_0xa951('0xc'));var crypto=require(_0xa951('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa951('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa951('0xf'));var Papa=require(_0xa951('0x10'));var Redis=require(_0xa951('0x11'));var authService=require(_0xa951('0x12'));var qs=require(_0xa951('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa951('0x14'));var logger=require(_0xa951('0x15'))(_0xa951('0x16'));var utils=require(_0xa951('0x17'));var config=require(_0xa951('0x18'));var licenseUtil=require(_0xa951('0x19'));var db=require(_0xa951('0x1a'))['db'];function respondWithStatusCode(_0x187bf6,_0x239ac5){_0x239ac5=_0x239ac5||0xcc;return function(_0x11129f){if(_0x11129f){return _0x187bf6[_0xa951('0x1b')](_0x239ac5);}return _0x187bf6[_0xa951('0x1c')](_0x239ac5)[_0xa951('0x1d')]();};}function respondWithResult(_0x211725,_0x1700d8){_0x1700d8=_0x1700d8||0xc8;return function(_0x10e696){if(_0x10e696){return _0x211725['status'](_0x1700d8)[_0xa951('0x1e')](_0x10e696);}};}function respondWithFilteredResult(_0x4e8ad4,_0x5a1b17){return function(_0x5d5a22){if(_0x5d5a22){var _0x928274=typeof _0x5a1b17[_0xa951('0x1f')]===_0xa951('0x20')&&typeof _0x5a1b17[_0xa951('0x21')]===_0xa951('0x20');var _0x51e508=_0x5d5a22['count'];var _0x45aba7=_0x928274?0x0:_0x5a1b17[_0xa951('0x1f')];var _0x11771c=_0x928274?_0x5d5a22['count']:_0x5a1b17[_0xa951('0x1f')]+_0x5a1b17[_0xa951('0x21')];var _0x365513;if(_0x11771c>=_0x51e508){_0x11771c=_0x51e508;_0x365513=0xc8;}else{_0x365513=0xce;}_0x4e8ad4['status'](_0x365513);return _0x4e8ad4['set'](_0xa951('0x22'),_0x45aba7+'-'+_0x11771c+'/'+_0x51e508)['json'](_0x5d5a22);}return null;};}function patchUpdates(_0x516d08){return function(_0x59ad07){try{jsonpatch[_0xa951('0x23')](_0x59ad07,_0x516d08,!![]);}catch(_0x376111){return BPromise[_0xa951('0x24')](_0x376111);}return _0x59ad07['save']();};}function saveUpdates(_0x20182b,_0x54a226){return function(_0x375c9d){if(_0x375c9d){return _0x375c9d[_0xa951('0x25')](_0x20182b)[_0xa951('0x26')](function(_0x1ed7ab){return _0x1ed7ab;});}return null;};}function removeEntity(_0x1863bc,_0x254a8c){return function(_0x5ab357){if(_0x5ab357){return _0x5ab357[_0xa951('0x27')]()[_0xa951('0x26')](function(){_0x1863bc['status'](0xcc)[_0xa951('0x1d')]();});}};}function handleEntityNotFound(_0x3607aa,_0x294153){return function(_0x553cd4){if(!_0x553cd4){_0x3607aa['sendStatus'](0x194);}return _0x553cd4;};}function handleError(_0x2542bc,_0x2fe31f){_0x2fe31f=_0x2fe31f||0x1f4;return function(_0x5d9c2d){logger['error'](_0x5d9c2d[_0xa951('0x28')]);if(_0x5d9c2d[_0xa951('0x29')]){delete _0x5d9c2d['name'];}_0x2542bc[_0xa951('0x1c')](_0x2fe31f)['send'](_0x5d9c2d);};}exports[_0xa951('0x2a')]=function(_0x35d851,_0x430666){var _0x3d9c07={},_0x1728b5={},_0x348e21={'count':0x0,'rows':[]};var _0xbb998a=_[_0xa951('0x2b')](db[_0xa951('0x2c')][_0xa951('0x2d')],function(_0x37d58b){return{'name':_0x37d58b['fieldName'],'type':_0x37d58b[_0xa951('0x2e')][_0xa951('0x2f')]};});_0x1728b5[_0xa951('0x30')]=_[_0xa951('0x2b')](_0xbb998a,'name');_0x1728b5[_0xa951('0x31')]=_[_0xa951('0x32')](_0x35d851[_0xa951('0x31')]);_0x1728b5[_0xa951('0x33')]=_[_0xa951('0x34')](_0x1728b5['model'],_0x1728b5[_0xa951('0x31')]);_0x3d9c07['attributes']=_['intersection'](_0x1728b5['model'],qs[_0xa951('0x35')](_0x35d851[_0xa951('0x31')][_0xa951('0x35')]));_0x3d9c07[_0xa951('0x36')]=_0x3d9c07[_0xa951('0x36')][_0xa951('0x37')]?_0x3d9c07[_0xa951('0x36')]:_0x1728b5['model'];if(!_0x35d851['query']['hasOwnProperty'](_0xa951('0x38'))){_0x3d9c07[_0xa951('0x21')]=qs[_0xa951('0x21')](_0x35d851[_0xa951('0x31')]['limit']);_0x3d9c07[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x35d851[_0xa951('0x31')][_0xa951('0x1f')]);}_0x3d9c07[_0xa951('0x39')]=qs[_0xa951('0x3a')](_0x35d851[_0xa951('0x31')][_0xa951('0x3a')]);_0x3d9c07[_0xa951('0x3b')]=qs['filters'](_[_0xa951('0x3c')](_0x35d851[_0xa951('0x31')],_0x1728b5['filters']),_0xbb998a);if(_0x35d851[_0xa951('0x31')][_0xa951('0x3d')]){_0x3d9c07[_0xa951('0x3b')]=_['merge'](_0x3d9c07[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0xbb998a,function(_0x1d0e89){if(_0x1d0e89[_0xa951('0x2e')]!==_0xa951('0x3e')){var _0x539f32={};_0x539f32[_0x1d0e89[_0xa951('0x29')]]={'$like':'%'+_0x35d851[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x539f32;}})});}_0x3d9c07=_['merge']({},_0x3d9c07,_0x35d851[_0xa951('0x3f')]);var _0x283de8={'where':_0x3d9c07[_0xa951('0x3b')]};return db[_0xa951('0x2c')]['count'](_0x283de8)[_0xa951('0x26')](function(_0x29b76c){_0x348e21[_0xa951('0x40')]=_0x29b76c;if(_0x35d851[_0xa951('0x31')]['includeAll']){_0x3d9c07[_0xa951('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa951('0x42')](_0x3d9c07);})['then'](function(_0x1e5795){_0x348e21['rows']=_0x1e5795;return _0x348e21;})['then'](respondWithFilteredResult(_0x430666,_0x3d9c07))[_0xa951('0x43')](handleError(_0x430666,null));};exports[_0xa951('0x44')]=function(_0x189e07,_0x694692){var _0x253fee={'raw':![],'where':{'id':_0x189e07[_0xa951('0x45')]['id']}},_0x546d17={};_0x546d17['model']=_[_0xa951('0x32')](db[_0xa951('0x2c')]['rawAttributes']);_0x546d17[_0xa951('0x31')]=_['keys'](_0x189e07['query']);_0x546d17['filters']=_['intersection'](_0x546d17[_0xa951('0x30')],_0x546d17[_0xa951('0x31')]);_0x253fee[_0xa951('0x36')]=_[_0xa951('0x34')](_0x546d17[_0xa951('0x30')],qs['fields'](_0x189e07[_0xa951('0x31')][_0xa951('0x35')]));_0x253fee[_0xa951('0x36')]=_0x253fee[_0xa951('0x36')][_0xa951('0x37')]?_0x253fee[_0xa951('0x36')]:_0x546d17[_0xa951('0x30')];if(_0x189e07[_0xa951('0x31')]['includeAll']){_0x253fee[_0xa951('0x41')]=[{'all':!![]}];}_0x253fee=_[_0xa951('0x46')]({},_0x253fee,_0x189e07[_0xa951('0x3f')]);return db['VtigerConfiguration'][_0xa951('0x47')](_0x253fee)[_0xa951('0x26')](handleEntityNotFound(_0x694692,null))[_0xa951('0x26')](respondWithResult(_0x694692,null))[_0xa951('0x43')](handleError(_0x694692,null));};exports['create']=function(_0x3c3ae5,_0x332428){return db[_0xa951('0x2c')]['create'](_0x3c3ae5[_0xa951('0x48')],{})['then'](respondWithResult(_0x332428,0xc9))[_0xa951('0x43')](handleError(_0x332428,null));};exports[_0xa951('0x25')]=function(_0x384141,_0x171c27){if(_0x384141['body']['id']){delete _0x384141['body']['id'];}return db[_0xa951('0x2c')][_0xa951('0x47')]({'where':{'id':_0x384141[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x171c27,null))['then'](saveUpdates(_0x384141[_0xa951('0x48')],null))[_0xa951('0x26')](respondWithResult(_0x171c27,null))[_0xa951('0x43')](handleError(_0x171c27,null));};exports[_0xa951('0x27')]=function(_0x968be7,_0x586932){return db[_0xa951('0x2c')][_0xa951('0x47')]({'where':{'id':_0x968be7['params']['id']}})['then'](handleEntityNotFound(_0x586932,null))[_0xa951('0x26')](removeEntity(_0x586932,null))['catch'](handleError(_0x586932,null));};exports[_0xa951('0x49')]=function(_0x40aa02,_0x1ca2e9,_0x500688){var _0xa12c61={};var _0x463045={};var _0x687586;var _0xb11b1c;return db[_0xa951('0x2c')][_0xa951('0x4a')]({'where':{'id':_0x40aa02[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x1ca2e9,null))[_0xa951('0x26')](function(_0x868ca1){if(_0x868ca1){_0x687586=_0x868ca1;_0x463045['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')][_0xa951('0x2d')]);_0x463045['query']=_['keys'](_0x40aa02['query']);_0x463045[_0xa951('0x33')]=_['intersection'](_0x463045['model'],_0x463045['query']);_0xa12c61[_0xa951('0x36')]=_[_0xa951('0x34')](_0x463045[_0xa951('0x30')],qs[_0xa951('0x35')](_0x40aa02[_0xa951('0x31')][_0xa951('0x35')]));_0xa12c61['attributes']=_0xa12c61[_0xa951('0x36')][_0xa951('0x37')]?_0xa12c61[_0xa951('0x36')]:_0x463045[_0xa951('0x30')];_0xa12c61['order']=qs[_0xa951('0x3a')](_0x40aa02[_0xa951('0x31')][_0xa951('0x3a')]);_0xa12c61['where']=qs[_0xa951('0x33')](_[_0xa951('0x3c')](_0x40aa02[_0xa951('0x31')],_0x463045[_0xa951('0x33')]));if(_0x40aa02[_0xa951('0x31')][_0xa951('0x3d')]){_0xa12c61['where']=_[_0xa951('0x46')](_0xa12c61[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0xa12c61['attributes'],function(_0xca28b1){var _0x283734={};_0x283734[_0xca28b1]={'$like':'%'+_0x40aa02[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x283734;})});}_0xa12c61=_[_0xa951('0x46')]({},_0xa12c61,_0x40aa02[_0xa951('0x3f')]);return _0x687586[_0xa951('0x49')](_0xa12c61);}})[_0xa951('0x26')](function(_0x5cdcc8){if(_0x5cdcc8){_0xb11b1c=_0x5cdcc8[_0xa951('0x37')];if(!_0x40aa02[_0xa951('0x31')]['hasOwnProperty'](_0xa951('0x38'))){_0xa12c61[_0xa951('0x21')]=qs['limit'](_0x40aa02[_0xa951('0x31')][_0xa951('0x21')]);_0xa12c61[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x40aa02[_0xa951('0x31')][_0xa951('0x1f')]);}return _0x687586[_0xa951('0x49')](_0xa12c61);}})[_0xa951('0x26')](function(_0x179138){if(_0x179138){return _0x179138?{'count':_0xb11b1c,'rows':_0x179138}:null;}})['then'](respondWithResult(_0x1ca2e9,null))['catch'](handleError(_0x1ca2e9,null));};exports[_0xa951('0x4c')]=function(_0x36e341,_0x4571c5,_0x2924b2){var _0x30278c={};var _0x3ad1b4={};var _0xabcd5e;var _0x5e58ea;return db[_0xa951('0x2c')][_0xa951('0x4a')]({'where':{'id':_0x36e341[_0xa951('0x45')]['id']}})[_0xa951('0x26')](handleEntityNotFound(_0x4571c5,null))[_0xa951('0x26')](function(_0xe92de7){if(_0xe92de7){_0xabcd5e=_0xe92de7;_0x3ad1b4['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')][_0xa951('0x2d')]);_0x3ad1b4[_0xa951('0x31')]=_[_0xa951('0x32')](_0x36e341[_0xa951('0x31')]);_0x3ad1b4['filters']=_['intersection'](_0x3ad1b4[_0xa951('0x30')],_0x3ad1b4[_0xa951('0x31')]);_0x30278c['attributes']=_[_0xa951('0x34')](_0x3ad1b4[_0xa951('0x30')],qs[_0xa951('0x35')](_0x36e341[_0xa951('0x31')][_0xa951('0x35')]));_0x30278c['attributes']=_0x30278c[_0xa951('0x36')][_0xa951('0x37')]?_0x30278c[_0xa951('0x36')]:_0x3ad1b4['model'];_0x30278c['order']=qs['sort'](_0x36e341['query'][_0xa951('0x3a')]);_0x30278c['where']=qs[_0xa951('0x33')](_[_0xa951('0x3c')](_0x36e341[_0xa951('0x31')],_0x3ad1b4[_0xa951('0x33')]));if(_0x36e341[_0xa951('0x31')][_0xa951('0x3d')]){_0x30278c[_0xa951('0x3b')]=_['merge'](_0x30278c[_0xa951('0x3b')],{'$or':_[_0xa951('0x2b')](_0x30278c[_0xa951('0x36')],function(_0xcfe8ec){var _0x3df4d0={};_0x3df4d0[_0xcfe8ec]={'$like':'%'+_0x36e341[_0xa951('0x31')][_0xa951('0x3d')]+'%'};return _0x3df4d0;})});}_0x30278c=_['merge']({},_0x30278c,_0x36e341[_0xa951('0x3f')]);return _0xabcd5e[_0xa951('0x4c')](_0x30278c);}})['then'](function(_0x25726f){if(_0x25726f){_0x5e58ea=_0x25726f['length'];if(!_0x36e341[_0xa951('0x31')][_0xa951('0x4d')](_0xa951('0x38'))){_0x30278c[_0xa951('0x21')]=qs[_0xa951('0x21')](_0x36e341[_0xa951('0x31')][_0xa951('0x21')]);_0x30278c[_0xa951('0x1f')]=qs[_0xa951('0x1f')](_0x36e341['query'][_0xa951('0x1f')]);}return _0xabcd5e['getSubjects'](_0x30278c);}})[_0xa951('0x26')](function(_0x58dab8){if(_0x58dab8){return _0x58dab8?{'count':_0x5e58ea,'rows':_0x58dab8}:null;}})[_0xa951('0x26')](respondWithResult(_0x4571c5,null))[_0xa951('0x43')](handleError(_0x4571c5,null));};exports['getDescriptions']=function(_0x2d1c14,_0x4953fc,_0x4eb9c6){var _0x30c4c9={};var _0x52ed60={};var _0x52d6a9;var _0x309581;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2d1c14[_0xa951('0x45')]['id']}})['then'](handleEntityNotFound(_0x4953fc,null))[_0xa951('0x26')](function(_0x27e479){if(_0x27e479){_0x52d6a9=_0x27e479;_0x52ed60['model']=_[_0xa951('0x32')](db[_0xa951('0x4b')]['rawAttributes']);_0x52ed60[_0xa951('0x31')]=_[_0xa951('0x32')](_0x2d1c14[_0xa951('0x31')]);_0x52ed60[_0xa951('0x33')]=_[_0xa951('0x34')](_0x52ed60[_0xa951('0x30')],_0x52ed60[_0xa951('0x31')]);_0x30c4c9[_0xa951('0x36')]=_[_0xa951('0x34')](_0x52ed60['model'],qs['fields'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x35')]));_0x30c4c9[_0xa951('0x36')]=_0x30c4c9[_0xa951('0x36')]['length']?_0x30c4c9[_0xa951('0x36')]:_0x52ed60[_0xa951('0x30')];_0x30c4c9[_0xa951('0x39')]=qs['sort'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x3a')]);_0x30c4c9[_0xa951('0x3b')]=qs[_0xa951('0x33')](_['pick'](_0x2d1c14[_0xa951('0x31')],_0x52ed60[_0xa951('0x33')]));if(_0x2d1c14[_0xa951('0x31')][_0xa951('0x3d')]){_0x30c4c9[_0xa951('0x3b')]=_[_0xa951('0x46')](_0x30c4c9['where'],{'$or':_[_0xa951('0x2b')](_0x30c4c9[_0xa951('0x36')],function(_0x501691){var _0x20a760={};_0x20a760[_0x501691]={'$like':'%'+_0x2d1c14['query'][_0xa951('0x3d')]+'%'};return _0x20a760;})});}_0x30c4c9=_[_0xa951('0x46')]({},_0x30c4c9,_0x2d1c14[_0xa951('0x3f')]);return _0x52d6a9['getDescriptions'](_0x30c4c9);}})[_0xa951('0x26')](function(_0x3be975){if(_0x3be975){_0x309581=_0x3be975[_0xa951('0x37')];if(!_0x2d1c14['query']['hasOwnProperty']('nolimit')){_0x30c4c9[_0xa951('0x21')]=qs['limit'](_0x2d1c14['query']['limit']);_0x30c4c9[_0xa951('0x1f')]=qs['offset'](_0x2d1c14[_0xa951('0x31')][_0xa951('0x1f')]);}return _0x52d6a9[_0xa951('0x4e')](_0x30c4c9);}})[_0xa951('0x26')](function(_0x2296f4){if(_0x2296f4){return _0x2296f4?{'count':_0x309581,'rows':_0x2296f4}:null;}})[_0xa951('0x26')](respondWithResult(_0x4953fc,null))['catch'](handleError(_0x4953fc,null));}; \ No newline at end of file +var _0x1e46=['papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','destroy','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x447f6d,_0x36fc29){var _0x56a9b8=function(_0x16444e){while(--_0x16444e){_0x447f6d['push'](_0x447f6d['shift']());}};_0x56a9b8(++_0x36fc29);}(_0x1e46,0x1bb));var _0x61e4=function(_0x4041b7,_0x2da459){_0x4041b7=_0x4041b7-0x0;var _0x63e5a2=_0x1e46[_0x4041b7];return _0x63e5a2;};'use strict';var emlformat=require(_0x61e4('0x0'));var rimraf=require(_0x61e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61e4('0x2'));var rp=require('request-promise');var moment=require(_0x61e4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x61e4('0x4'));var util=require('util');var path=require(_0x61e4('0x5'));var sox=require('sox');var csv=require(_0x61e4('0x6'));var ejs=require(_0x61e4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61e4('0x8'));var squel=require(_0x61e4('0x9'));var crypto=require(_0x61e4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x61e4('0xb'));var toCsv=require(_0x61e4('0x6'));var querystring=require(_0x61e4('0xc'));var Papa=require(_0x61e4('0xd'));var Redis=require(_0x61e4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x61e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x61e4('0x10'))(_0x61e4('0x11'));var utils=require(_0x61e4('0x12'));var config=require(_0x61e4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x61e4('0x14'))['db'];function respondWithStatusCode(_0x2e1aa3,_0x24a35f){_0x24a35f=_0x24a35f||0xcc;return function(_0x27f21a){if(_0x27f21a){return _0x2e1aa3[_0x61e4('0x15')](_0x24a35f);}return _0x2e1aa3['status'](_0x24a35f)[_0x61e4('0x16')]();};}function respondWithResult(_0x23827d,_0x401307){_0x401307=_0x401307||0xc8;return function(_0x3b8926){if(_0x3b8926){return _0x23827d[_0x61e4('0x17')](_0x401307)['json'](_0x3b8926);}};}function respondWithFilteredResult(_0x2216a5,_0x24b180){return function(_0x17dbd0){if(_0x17dbd0){var _0x485641=typeof _0x24b180[_0x61e4('0x18')]==='undefined'&&typeof _0x24b180[_0x61e4('0x19')]===_0x61e4('0x1a');var _0x260103=_0x17dbd0['count'];var _0x303ec4=_0x485641?0x0:_0x24b180['offset'];var _0x2e7bbe=_0x485641?_0x17dbd0[_0x61e4('0x1b')]:_0x24b180[_0x61e4('0x18')]+_0x24b180[_0x61e4('0x19')];var _0x486657;if(_0x2e7bbe>=_0x260103){_0x2e7bbe=_0x260103;_0x486657=0xc8;}else{_0x486657=0xce;}_0x2216a5[_0x61e4('0x17')](_0x486657);return _0x2216a5['set'](_0x61e4('0x1c'),_0x303ec4+'-'+_0x2e7bbe+'/'+_0x260103)[_0x61e4('0x1d')](_0x17dbd0);}return null;};}function patchUpdates(_0x3887c3){return function(_0x4c8cc0){try{jsonpatch[_0x61e4('0x1e')](_0x4c8cc0,_0x3887c3,!![]);}catch(_0x5497c1){return BPromise[_0x61e4('0x1f')](_0x5497c1);}return _0x4c8cc0[_0x61e4('0x20')]();};}function saveUpdates(_0x35bf3f,_0x4220ed){return function(_0x3e20c4){if(_0x3e20c4){return _0x3e20c4['update'](_0x35bf3f)[_0x61e4('0x21')](function(_0x1b8963){return _0x1b8963;});}return null;};}function removeEntity(_0xc2f536,_0x104dab){return function(_0x53b8c4){if(_0x53b8c4){return _0x53b8c4['destroy']()[_0x61e4('0x21')](function(){_0xc2f536[_0x61e4('0x17')](0xcc)[_0x61e4('0x16')]();});}};}function handleEntityNotFound(_0x207d7e,_0x3ee6bc){return function(_0x59511d){if(!_0x59511d){_0x207d7e['sendStatus'](0x194);}return _0x59511d;};}function handleError(_0x4f9e0c,_0x751c02){_0x751c02=_0x751c02||0x1f4;return function(_0x2b93d6){logger[_0x61e4('0x22')](_0x2b93d6[_0x61e4('0x23')]);if(_0x2b93d6[_0x61e4('0x24')]){delete _0x2b93d6[_0x61e4('0x24')];}_0x4f9e0c[_0x61e4('0x17')](_0x751c02)[_0x61e4('0x25')](_0x2b93d6);};}exports['index']=function(_0x4be43f,_0x5d0ddd){var _0x5663fd={},_0x3e12d2={},_0x5095f2={'count':0x0,'rows':[]};var _0x22ca9a=_[_0x61e4('0x26')](db[_0x61e4('0x27')][_0x61e4('0x28')],function(_0x9945db){return{'name':_0x9945db['fieldName'],'type':_0x9945db[_0x61e4('0x29')][_0x61e4('0x2a')]};});_0x3e12d2[_0x61e4('0x2b')]=_[_0x61e4('0x26')](_0x22ca9a,_0x61e4('0x24'));_0x3e12d2[_0x61e4('0x2c')]=_[_0x61e4('0x2d')](_0x4be43f[_0x61e4('0x2c')]);_0x3e12d2[_0x61e4('0x2e')]=_[_0x61e4('0x2f')](_0x3e12d2[_0x61e4('0x2b')],_0x3e12d2[_0x61e4('0x2c')]);_0x5663fd[_0x61e4('0x30')]=_[_0x61e4('0x2f')](_0x3e12d2['model'],qs[_0x61e4('0x31')](_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x31')]));_0x5663fd['attributes']=_0x5663fd['attributes'][_0x61e4('0x32')]?_0x5663fd[_0x61e4('0x30')]:_0x3e12d2['model'];if(!_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x33')]('nolimit')){_0x5663fd[_0x61e4('0x19')]=qs['limit'](_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x19')]);_0x5663fd['offset']=qs[_0x61e4('0x18')](_0x4be43f['query'][_0x61e4('0x18')]);}_0x5663fd[_0x61e4('0x34')]=qs['sort'](_0x4be43f['query'][_0x61e4('0x35')]);_0x5663fd[_0x61e4('0x36')]=qs[_0x61e4('0x2e')](_[_0x61e4('0x37')](_0x4be43f['query'],_0x3e12d2[_0x61e4('0x2e')]),_0x22ca9a);if(_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x38')]){_0x5663fd[_0x61e4('0x36')]=_['merge'](_0x5663fd['where'],{'$or':_[_0x61e4('0x26')](_0x22ca9a,function(_0x6e2acd){if(_0x6e2acd[_0x61e4('0x29')]!==_0x61e4('0x39')){var _0x19b127={};_0x19b127[_0x6e2acd[_0x61e4('0x24')]]={'$like':'%'+_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x38')]+'%'};return _0x19b127;}})});}_0x5663fd=_[_0x61e4('0x3a')]({},_0x5663fd,_0x4be43f[_0x61e4('0x3b')]);var _0x20437d={'where':_0x5663fd[_0x61e4('0x36')]};return db[_0x61e4('0x27')][_0x61e4('0x1b')](_0x20437d)['then'](function(_0x230cd6){_0x5095f2[_0x61e4('0x1b')]=_0x230cd6;if(_0x4be43f[_0x61e4('0x2c')][_0x61e4('0x3c')]){_0x5663fd[_0x61e4('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x61e4('0x3e')](_0x5663fd);})['then'](function(_0x2e1d12){_0x5095f2['rows']=_0x2e1d12;return _0x5095f2;})[_0x61e4('0x21')](respondWithFilteredResult(_0x5d0ddd,_0x5663fd))[_0x61e4('0x3f')](handleError(_0x5d0ddd,null));};exports[_0x61e4('0x40')]=function(_0x39af6c,_0x3549c0){var _0x2e5e43={'raw':![],'where':{'id':_0x39af6c['params']['id']}},_0x2da0c5={};_0x2da0c5[_0x61e4('0x2b')]=_[_0x61e4('0x2d')](db['VtigerConfiguration'][_0x61e4('0x28')]);_0x2da0c5[_0x61e4('0x2c')]=_[_0x61e4('0x2d')](_0x39af6c[_0x61e4('0x2c')]);_0x2da0c5[_0x61e4('0x2e')]=_[_0x61e4('0x2f')](_0x2da0c5[_0x61e4('0x2b')],_0x2da0c5['query']);_0x2e5e43['attributes']=_[_0x61e4('0x2f')](_0x2da0c5[_0x61e4('0x2b')],qs[_0x61e4('0x31')](_0x39af6c['query']['fields']));_0x2e5e43['attributes']=_0x2e5e43['attributes'][_0x61e4('0x32')]?_0x2e5e43['attributes']:_0x2da0c5[_0x61e4('0x2b')];if(_0x39af6c[_0x61e4('0x2c')]['includeAll']){_0x2e5e43[_0x61e4('0x3d')]=[{'all':!![]}];}_0x2e5e43=_[_0x61e4('0x3a')]({},_0x2e5e43,_0x39af6c[_0x61e4('0x3b')]);return db[_0x61e4('0x27')][_0x61e4('0x41')](_0x2e5e43)[_0x61e4('0x21')](handleEntityNotFound(_0x3549c0,null))['then'](respondWithResult(_0x3549c0,null))[_0x61e4('0x3f')](handleError(_0x3549c0,null));};exports[_0x61e4('0x42')]=function(_0x1d4530,_0x1ed1d1){return db['VtigerConfiguration']['create'](_0x1d4530[_0x61e4('0x43')],{})[_0x61e4('0x21')](respondWithResult(_0x1ed1d1,0xc9))[_0x61e4('0x3f')](handleError(_0x1ed1d1,null));};exports['update']=function(_0x580bd7,_0x2546ee){if(_0x580bd7[_0x61e4('0x43')]['id']){delete _0x580bd7[_0x61e4('0x43')]['id'];}return db[_0x61e4('0x27')]['find']({'where':{'id':_0x580bd7[_0x61e4('0x44')]['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x2546ee,null))[_0x61e4('0x21')](saveUpdates(_0x580bd7[_0x61e4('0x43')],null))[_0x61e4('0x21')](respondWithResult(_0x2546ee,null))[_0x61e4('0x3f')](handleError(_0x2546ee,null));};exports[_0x61e4('0x45')]=function(_0x5cd866,_0x3fccc3){return db[_0x61e4('0x27')][_0x61e4('0x41')]({'where':{'id':_0x5cd866[_0x61e4('0x44')]['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x3fccc3,null))[_0x61e4('0x21')](removeEntity(_0x3fccc3,null))[_0x61e4('0x3f')](handleError(_0x3fccc3,null));};exports[_0x61e4('0x46')]=function(_0x3f5369,_0x435252,_0x3956ba){var _0x4d8635={};var _0x535c52={};var _0x5bcd8c;var _0x4a6209;return db[_0x61e4('0x27')][_0x61e4('0x47')]({'where':{'id':_0x3f5369[_0x61e4('0x44')]['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x435252,null))[_0x61e4('0x21')](function(_0x1577a1){if(_0x1577a1){_0x5bcd8c=_0x1577a1;_0x535c52[_0x61e4('0x2b')]=_[_0x61e4('0x2d')](db[_0x61e4('0x48')]['rawAttributes']);_0x535c52['query']=_['keys'](_0x3f5369[_0x61e4('0x2c')]);_0x535c52['filters']=_[_0x61e4('0x2f')](_0x535c52['model'],_0x535c52[_0x61e4('0x2c')]);_0x4d8635[_0x61e4('0x30')]=_[_0x61e4('0x2f')](_0x535c52[_0x61e4('0x2b')],qs[_0x61e4('0x31')](_0x3f5369[_0x61e4('0x2c')][_0x61e4('0x31')]));_0x4d8635[_0x61e4('0x30')]=_0x4d8635[_0x61e4('0x30')][_0x61e4('0x32')]?_0x4d8635[_0x61e4('0x30')]:_0x535c52[_0x61e4('0x2b')];_0x4d8635['order']=qs[_0x61e4('0x35')](_0x3f5369['query'][_0x61e4('0x35')]);_0x4d8635[_0x61e4('0x36')]=qs[_0x61e4('0x2e')](_[_0x61e4('0x37')](_0x3f5369['query'],_0x535c52[_0x61e4('0x2e')]));if(_0x3f5369[_0x61e4('0x2c')]['filter']){_0x4d8635['where']=_[_0x61e4('0x3a')](_0x4d8635[_0x61e4('0x36')],{'$or':_[_0x61e4('0x26')](_0x4d8635[_0x61e4('0x30')],function(_0x1e5b68){var _0x4ccc96={};_0x4ccc96[_0x1e5b68]={'$like':'%'+_0x3f5369[_0x61e4('0x2c')][_0x61e4('0x38')]+'%'};return _0x4ccc96;})});}_0x4d8635=_[_0x61e4('0x3a')]({},_0x4d8635,_0x3f5369[_0x61e4('0x3b')]);return _0x5bcd8c[_0x61e4('0x46')](_0x4d8635);}})['then'](function(_0x3cc406){if(_0x3cc406){_0x4a6209=_0x3cc406['length'];if(!_0x3f5369[_0x61e4('0x2c')][_0x61e4('0x33')](_0x61e4('0x49'))){_0x4d8635['limit']=qs[_0x61e4('0x19')](_0x3f5369[_0x61e4('0x2c')][_0x61e4('0x19')]);_0x4d8635['offset']=qs[_0x61e4('0x18')](_0x3f5369[_0x61e4('0x2c')][_0x61e4('0x18')]);}return _0x5bcd8c[_0x61e4('0x46')](_0x4d8635);}})[_0x61e4('0x21')](function(_0x50a402){if(_0x50a402){return _0x50a402?{'count':_0x4a6209,'rows':_0x50a402}:null;}})[_0x61e4('0x21')](respondWithResult(_0x435252,null))['catch'](handleError(_0x435252,null));};exports[_0x61e4('0x4a')]=function(_0x54023e,_0x543b23,_0x342ea5){var _0x15c9b2={};var _0x34a41d={};var _0x14e142;var _0x44a3ef;return db[_0x61e4('0x27')]['findOne']({'where':{'id':_0x54023e['params']['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x543b23,null))[_0x61e4('0x21')](function(_0x1ea2c0){if(_0x1ea2c0){_0x14e142=_0x1ea2c0;_0x34a41d[_0x61e4('0x2b')]=_[_0x61e4('0x2d')](db[_0x61e4('0x48')][_0x61e4('0x28')]);_0x34a41d[_0x61e4('0x2c')]=_[_0x61e4('0x2d')](_0x54023e[_0x61e4('0x2c')]);_0x34a41d['filters']=_[_0x61e4('0x2f')](_0x34a41d[_0x61e4('0x2b')],_0x34a41d['query']);_0x15c9b2[_0x61e4('0x30')]=_[_0x61e4('0x2f')](_0x34a41d[_0x61e4('0x2b')],qs[_0x61e4('0x31')](_0x54023e[_0x61e4('0x2c')]['fields']));_0x15c9b2[_0x61e4('0x30')]=_0x15c9b2['attributes'][_0x61e4('0x32')]?_0x15c9b2[_0x61e4('0x30')]:_0x34a41d[_0x61e4('0x2b')];_0x15c9b2[_0x61e4('0x34')]=qs[_0x61e4('0x35')](_0x54023e[_0x61e4('0x2c')][_0x61e4('0x35')]);_0x15c9b2['where']=qs['filters'](_[_0x61e4('0x37')](_0x54023e[_0x61e4('0x2c')],_0x34a41d[_0x61e4('0x2e')]));if(_0x54023e[_0x61e4('0x2c')]['filter']){_0x15c9b2[_0x61e4('0x36')]=_[_0x61e4('0x3a')](_0x15c9b2[_0x61e4('0x36')],{'$or':_['map'](_0x15c9b2[_0x61e4('0x30')],function(_0xdb5c0){var _0x38a1ad={};_0x38a1ad[_0xdb5c0]={'$like':'%'+_0x54023e[_0x61e4('0x2c')][_0x61e4('0x38')]+'%'};return _0x38a1ad;})});}_0x15c9b2=_[_0x61e4('0x3a')]({},_0x15c9b2,_0x54023e[_0x61e4('0x3b')]);return _0x14e142[_0x61e4('0x4a')](_0x15c9b2);}})['then'](function(_0x548d3c){if(_0x548d3c){_0x44a3ef=_0x548d3c['length'];if(!_0x54023e[_0x61e4('0x2c')][_0x61e4('0x33')]('nolimit')){_0x15c9b2[_0x61e4('0x19')]=qs[_0x61e4('0x19')](_0x54023e['query'][_0x61e4('0x19')]);_0x15c9b2[_0x61e4('0x18')]=qs[_0x61e4('0x18')](_0x54023e[_0x61e4('0x2c')][_0x61e4('0x18')]);}return _0x14e142['getSubjects'](_0x15c9b2);}})[_0x61e4('0x21')](function(_0x303d1b){if(_0x303d1b){return _0x303d1b?{'count':_0x44a3ef,'rows':_0x303d1b}:null;}})['then'](respondWithResult(_0x543b23,null))[_0x61e4('0x3f')](handleError(_0x543b23,null));};exports[_0x61e4('0x4b')]=function(_0x5e8cfe,_0x204be9,_0x2cdb25){var _0x46120f={};var _0x45fe51={};var _0x953f3f;var _0x1c672f;return db['VtigerConfiguration'][_0x61e4('0x47')]({'where':{'id':_0x5e8cfe[_0x61e4('0x44')]['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x204be9,null))[_0x61e4('0x21')](function(_0x5144a6){if(_0x5144a6){_0x953f3f=_0x5144a6;_0x45fe51['model']=_[_0x61e4('0x2d')](db[_0x61e4('0x48')][_0x61e4('0x28')]);_0x45fe51[_0x61e4('0x2c')]=_['keys'](_0x5e8cfe[_0x61e4('0x2c')]);_0x45fe51['filters']=_[_0x61e4('0x2f')](_0x45fe51['model'],_0x45fe51[_0x61e4('0x2c')]);_0x46120f['attributes']=_[_0x61e4('0x2f')](_0x45fe51[_0x61e4('0x2b')],qs[_0x61e4('0x31')](_0x5e8cfe[_0x61e4('0x2c')]['fields']));_0x46120f[_0x61e4('0x30')]=_0x46120f[_0x61e4('0x30')][_0x61e4('0x32')]?_0x46120f[_0x61e4('0x30')]:_0x45fe51[_0x61e4('0x2b')];_0x46120f[_0x61e4('0x34')]=qs[_0x61e4('0x35')](_0x5e8cfe[_0x61e4('0x2c')][_0x61e4('0x35')]);_0x46120f['where']=qs[_0x61e4('0x2e')](_['pick'](_0x5e8cfe[_0x61e4('0x2c')],_0x45fe51[_0x61e4('0x2e')]));if(_0x5e8cfe[_0x61e4('0x2c')][_0x61e4('0x38')]){_0x46120f[_0x61e4('0x36')]=_['merge'](_0x46120f[_0x61e4('0x36')],{'$or':_[_0x61e4('0x26')](_0x46120f[_0x61e4('0x30')],function(_0x280579){var _0x3f3ad6={};_0x3f3ad6[_0x280579]={'$like':'%'+_0x5e8cfe[_0x61e4('0x2c')][_0x61e4('0x38')]+'%'};return _0x3f3ad6;})});}_0x46120f=_['merge']({},_0x46120f,_0x5e8cfe[_0x61e4('0x3b')]);return _0x953f3f[_0x61e4('0x4b')](_0x46120f);}})[_0x61e4('0x21')](function(_0x2b23ce){if(_0x2b23ce){_0x1c672f=_0x2b23ce[_0x61e4('0x32')];if(!_0x5e8cfe[_0x61e4('0x2c')]['hasOwnProperty']('nolimit')){_0x46120f[_0x61e4('0x19')]=qs['limit'](_0x5e8cfe[_0x61e4('0x2c')][_0x61e4('0x19')]);_0x46120f[_0x61e4('0x18')]=qs[_0x61e4('0x18')](_0x5e8cfe[_0x61e4('0x2c')]['offset']);}return _0x953f3f[_0x61e4('0x4b')](_0x46120f);}})['then'](function(_0x5f4a43){if(_0x5f4a43){return _0x5f4a43?{'count':_0x1c672f,'rows':_0x5f4a43}:null;}})[_0x61e4('0x21')](respondWithResult(_0x204be9,null))[_0x61e4('0x3f')](handleError(_0x204be9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e667a65..bd3f83f 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 _0xcc1d=['VtigerConfiguration','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x5db99b,_0x500bff){var _0x2a8e17=function(_0x2a0c0b){while(--_0x2a0c0b){_0x5db99b['push'](_0x5db99b['shift']());}};_0x2a8e17(++_0x500bff);}(_0xcc1d,0x12a));var _0xdcc1=function(_0x16dced,_0x2f8d60){_0x16dced=_0x16dced-0x0;var _0x40e9d7=_0xcc1d[_0x16dced];return _0x40e9d7;};'use strict';var _=require(_0xdcc1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdcc1('0x1'));var moment=require('moment');var BPromise=require(_0xdcc1('0x2'));var rp=require(_0xdcc1('0x3'));var fs=require('fs');var path=require(_0xdcc1('0x4'));var rimraf=require(_0xdcc1('0x5'));var config=require(_0xdcc1('0x6'));var attributes=require(_0xdcc1('0x7'));module[_0xdcc1('0x8')]=function(_0x447798,_0x10b2eb){return _0x447798[_0xdcc1('0x9')](_0xdcc1('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e62=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','../../config/logger','api','moment'];(function(_0x3870d7,_0x312a0c){var _0x1e324b=function(_0x4e2c05){while(--_0x4e2c05){_0x3870d7['push'](_0x3870d7['shift']());}};_0x1e324b(++_0x312a0c);}(_0x1e62,0x134));var _0x21e6=function(_0x3492fe,_0x4b6a91){_0x3492fe=_0x3492fe-0x0;var _0x2c1a83=_0x1e62[_0x3492fe];return _0x2c1a83;};'use strict';var _=require(_0x21e6('0x0'));var util=require('util');var logger=require(_0x21e6('0x1'))(_0x21e6('0x2'));var moment=require(_0x21e6('0x3'));var BPromise=require(_0x21e6('0x4'));var rp=require(_0x21e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21e6('0x6'));var config=require(_0x21e6('0x7'));var attributes=require(_0x21e6('0x8'));module[_0x21e6('0x9')]=function(_0x199b15,_0x417f8e){return _0x199b15[_0x21e6('0xa')](_0x21e6('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index dfed594..ad493f1 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 _0x7ff4=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x232e3e,_0x20e1e6){var _0x4f241a=function(_0x3b04bf){while(--_0x3b04bf){_0x232e3e['push'](_0x232e3e['shift']());}};_0x4f241a(++_0x20e1e6);}(_0x7ff4,0xd0));var _0x47ff=function(_0x4c745b,_0x5a43da){_0x4c745b=_0x4c745b-0x0;var _0x5584ab=_0x7ff4[_0x4c745b];return _0x5584ab;};'use strict';var _=require(_0x47ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x47ff('0x1'));var rs=require(_0x47ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47ff('0x3'));var logger=require(_0x47ff('0x4'))('rpc');var config=require(_0x47ff('0x5'));var jayson=require(_0x47ff('0x6'));var client=jayson[_0x47ff('0x7')][_0x47ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37eb25,_0x14db24,_0x51e435){return new BPromise(function(_0x3bb116,_0x180e29){return client[_0x47ff('0x9')](_0x37eb25,_0x51e435)[_0x47ff('0xa')](function(_0x12eb2b){logger[_0x47ff('0xb')](_0x47ff('0xc'),_0x14db24,_0x47ff('0xd'));logger[_0x47ff('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x14db24,'request\x20sent',JSON[_0x47ff('0xf')](_0x12eb2b));if(_0x12eb2b['error']){if(_0x12eb2b[_0x47ff('0x10')]['code']===0x1f4){logger[_0x47ff('0x10')](_0x47ff('0xc'),_0x14db24,_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);return _0x180e29(_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);}logger[_0x47ff('0x10')](_0x47ff('0xc'),_0x14db24,_0x12eb2b[_0x47ff('0x10')][_0x47ff('0x11')]);return _0x3bb116(_0x12eb2b[_0x47ff('0x10')]['message']);}else{logger[_0x47ff('0xb')](_0x47ff('0xc'),_0x14db24,'request\x20sent');_0x3bb116(_0x12eb2b[_0x47ff('0x12')][_0x47ff('0x11')]);}})[_0x47ff('0x13')](function(_0xfd5984){logger['error'](_0x47ff('0xc'),_0x14db24,_0xfd5984);_0x180e29(_0xfd5984);});});} \ No newline at end of file +var _0x620b=['client','http','request','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x620b,0x157));var _0xb620=function(_0x478847,_0x876743){_0x478847=_0x478847-0x0;var _0x3f8eee=_0x620b[_0x478847];return _0x3f8eee;};'use strict';var _=require(_0xb620('0x0'));var util=require('util');var moment=require(_0xb620('0x1'));var BPromise=require(_0xb620('0x2'));var rs=require(_0xb620('0x3'));var fs=require('fs');var Redis=require(_0xb620('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb620('0x5'))(_0xb620('0x6'));var config=require(_0xb620('0x7'));var jayson=require(_0xb620('0x8'));var client=jayson[_0xb620('0x9')][_0xb620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x329309,_0x32ce43,_0x169239){return new BPromise(function(_0x2173dc,_0x293aba){return client[_0xb620('0xb')](_0x329309,_0x169239)['then'](function(_0x5eaf64){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x32ce43,'request\x20sent');logger[_0xb620('0xc')](_0xb620('0xd'),_0x32ce43,_0xb620('0xe'),JSON[_0xb620('0xf')](_0x5eaf64));if(_0x5eaf64[_0xb620('0x10')]){if(_0x5eaf64[_0xb620('0x10')]['code']===0x1f4){logger['error'](_0xb620('0x11'),_0x32ce43,_0x5eaf64[_0xb620('0x10')][_0xb620('0x12')]);return _0x293aba(_0x5eaf64[_0xb620('0x10')]['message']);}logger['error'](_0xb620('0x11'),_0x32ce43,_0x5eaf64['error'][_0xb620('0x12')]);return _0x2173dc(_0x5eaf64['error'][_0xb620('0x12')]);}else{logger[_0xb620('0x13')](_0xb620('0x11'),_0x32ce43,_0xb620('0xe'));_0x2173dc(_0x5eaf64[_0xb620('0x14')]['message']);}})[_0xb620('0x15')](function(_0x58a87b){logger[_0xb620('0x10')](_0xb620('0x11'),_0x32ce43,_0x58a87b);_0x293aba(_0x58a87b);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 429375e..177c0bf 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 _0x34cb=['delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x24aecf,_0x394d21){var _0xf28db=function(_0x69577c){while(--_0x69577c){_0x24aecf['push'](_0x24aecf['shift']());}};_0xf28db(++_0x394d21);}(_0x34cb,0x1ef));var _0xb34c=function(_0x192b15,_0x43f5d1){_0x192b15=_0x192b15-0x0;var _0x10ca4e=_0x34cb[_0x192b15];return _0x10ca4e;};'use strict';var multer=require(_0xb34c('0x0'));var util=require(_0xb34c('0x1'));var path=require('path');var timeout=require(_0xb34c('0x2'));var express=require('express');var router=express[_0xb34c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb34c('0x4'));var interaction=require(_0xb34c('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xb34c('0x6')](),controller[_0xb34c('0x7')]);router[_0xb34c('0x8')](_0xb34c('0x9'),auth[_0xb34c('0x6')](),controller[_0xb34c('0xa')]);router[_0xb34c('0xb')]('/',auth[_0xb34c('0x6')](),controller[_0xb34c('0xc')]);router[_0xb34c('0xd')](_0xb34c('0x9'),auth['isAuthenticated'](),controller[_0xb34c('0xe')]);router[_0xb34c('0xf')](_0xb34c('0x9'),auth[_0xb34c('0x6')](),controller[_0xb34c('0x10')]);module['exports']=router; \ No newline at end of file +var _0x29f4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xd8532,_0x579d21){var _0x12684=function(_0x5012c5){while(--_0x5012c5){_0xd8532['push'](_0xd8532['shift']());}};_0x12684(++_0x579d21);}(_0x29f4,0x9b));var _0x429f=function(_0x4c686a,_0x4c0d29){_0x4c686a=_0x4c686a-0x0;var _0x52214c=_0x29f4[_0x4c686a];return _0x52214c;};'use strict';var multer=require(_0x429f('0x0'));var util=require(_0x429f('0x1'));var path=require(_0x429f('0x2'));var timeout=require(_0x429f('0x3'));var express=require(_0x429f('0x4'));var router=express[_0x429f('0x5')]();var fs_extra=require(_0x429f('0x6'));var auth=require(_0x429f('0x7'));var interaction=require(_0x429f('0x8'));var config=require('../../config/environment');var controller=require(_0x429f('0x9'));router[_0x429f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x429f('0xb')](),controller[_0x429f('0xc')]);router[_0x429f('0xd')]('/',auth['isAuthenticated'](),controller[_0x429f('0xe')]);router[_0x429f('0xf')](_0x429f('0x10'),auth[_0x429f('0xb')](),controller[_0x429f('0x11')]);router[_0x429f('0x12')](_0x429f('0x10'),auth[_0x429f('0xb')](),controller['destroy']);module[_0x429f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 16da0b6..b46722b 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 _0xd026=['string','STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x1fae4c,_0x415a2c){var _0xe7137f=function(_0x4b8b01){while(--_0x4b8b01){_0x1fae4c['push'](_0x1fae4c['shift']());}};_0xe7137f(++_0x415a2c);}(_0xd026,0x152));var _0x6d02=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xd026[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x6d02('0x0'));module['exports']={'type':{'type':Sequelize[_0x6d02('0x1')]('string',_0x6d02('0x2'),_0x6d02('0x3'),_0x6d02('0x4'),_0x6d02('0x5')),'defaultValue':_0x6d02('0x6')},'content':{'type':Sequelize[_0x6d02('0x7')]},'key':{'type':Sequelize[_0x6d02('0x7')]},'keyType':{'type':Sequelize[_0x6d02('0x1')](_0x6d02('0x6'),'variable',_0x6d02('0x3'))},'keyContent':{'type':Sequelize[_0x6d02('0x7')]},'idField':{'type':Sequelize[_0x6d02('0x7')]},'nameField':{'type':Sequelize[_0x6d02('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc65=['variable','customVariable','STRING','BOOLEAN','ENUM','string'];(function(_0x4904af,_0x4418bc){var _0x2a2f45=function(_0x282c43){while(--_0x282c43){_0x4904af['push'](_0x4904af['shift']());}};_0x2a2f45(++_0x4418bc);}(_0xdc65,0xca));var _0x5dc6=function(_0x56c351,_0x20a787){_0x56c351=_0x56c351-0x0;var _0x5c69d9=_0xdc65[_0x56c351];return _0x5c69d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5dc6('0x0')](_0x5dc6('0x1'),_0x5dc6('0x2'),_0x5dc6('0x3'),'keyValue','picklist'),'defaultValue':_0x5dc6('0x1')},'content':{'type':Sequelize[_0x5dc6('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5dc6('0x0')]('string',_0x5dc6('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x5dc6('0x4')]},'idField':{'type':Sequelize[_0x5dc6('0x4')]},'nameField':{'type':Sequelize[_0x5dc6('0x4')]},'customField':{'type':Sequelize[_0x5dc6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5dc6('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d319f56..ef24492 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 _0xa4bf=['rows','show','params','fields','include','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','destroy','then','error','stack','name','rawAttributes','model','map','query','keys','attributes','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','VtigerField','includeAll','findAll'];(function(_0x1488af,_0x4a8f42){var _0x4efbec=function(_0x2c28d0){while(--_0x2c28d0){_0x1488af['push'](_0x1488af['shift']());}};_0x4efbec(++_0x4a8f42);}(_0xa4bf,0x98));var _0xfa4b=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0xa4bf[_0x4ca288];return _0x2362c1;};'use strict';var emlformat=require(_0xfa4b('0x0'));var rimraf=require(_0xfa4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa4b('0x2'));var rp=require(_0xfa4b('0x3'));var moment=require(_0xfa4b('0x4'));var BPromise=require(_0xfa4b('0x5'));var Mustache=require(_0xfa4b('0x6'));var util=require('util');var path=require(_0xfa4b('0x7'));var sox=require(_0xfa4b('0x8'));var csv=require(_0xfa4b('0x9'));var ejs=require(_0xfa4b('0xa'));var fs=require('fs');var fs_extra=require(_0xfa4b('0xb'));var _=require(_0xfa4b('0xc'));var squel=require(_0xfa4b('0xd'));var crypto=require(_0xfa4b('0xe'));var jsforce=require(_0xfa4b('0xf'));var deskjs=require(_0xfa4b('0x10'));var toCsv=require(_0xfa4b('0x9'));var querystring=require(_0xfa4b('0x11'));var Papa=require(_0xfa4b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa4b('0x13'));var as=require(_0xfa4b('0x14'));var hardwareService=require(_0xfa4b('0x15'));var logger=require(_0xfa4b('0x16'))('api');var utils=require(_0xfa4b('0x17'));var config=require(_0xfa4b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11baaa,_0x1e695e){_0x1e695e=_0x1e695e||0xcc;return function(_0x378bd5){if(_0x378bd5){return _0x11baaa[_0xfa4b('0x19')](_0x1e695e);}return _0x11baaa[_0xfa4b('0x1a')](_0x1e695e)[_0xfa4b('0x1b')]();};}function respondWithResult(_0x37d0cd,_0x566858){_0x566858=_0x566858||0xc8;return function(_0x51b0de){if(_0x51b0de){return _0x37d0cd[_0xfa4b('0x1a')](_0x566858)['json'](_0x51b0de);}};}function respondWithFilteredResult(_0x2dc3ce,_0x33319e){return function(_0x45bbcd){if(_0x45bbcd){var _0xa9e377=typeof _0x33319e[_0xfa4b('0x1c')]==='undefined'&&typeof _0x33319e[_0xfa4b('0x1d')]===_0xfa4b('0x1e');var _0x1d38a7=_0x45bbcd['count'];var _0x1a6212=_0xa9e377?0x0:_0x33319e[_0xfa4b('0x1c')];var _0x41f887=_0xa9e377?_0x45bbcd[_0xfa4b('0x1f')]:_0x33319e[_0xfa4b('0x1c')]+_0x33319e['limit'];var _0x522e6b;if(_0x41f887>=_0x1d38a7){_0x41f887=_0x1d38a7;_0x522e6b=0xc8;}else{_0x522e6b=0xce;}_0x2dc3ce[_0xfa4b('0x1a')](_0x522e6b);return _0x2dc3ce['set']('Content-Range',_0x1a6212+'-'+_0x41f887+'/'+_0x1d38a7)[_0xfa4b('0x20')](_0x45bbcd);}return null;};}function patchUpdates(_0x1d7d45){return function(_0x55eec7){try{jsonpatch[_0xfa4b('0x21')](_0x55eec7,_0x1d7d45,!![]);}catch(_0x31b449){return BPromise[_0xfa4b('0x22')](_0x31b449);}return _0x55eec7[_0xfa4b('0x23')]();};}function saveUpdates(_0x5e4be0,_0x2485af){return function(_0x5290ea){if(_0x5290ea){return _0x5290ea[_0xfa4b('0x24')](_0x5e4be0)['then'](function(_0x5210ef){return _0x5210ef;});}return null;};}function removeEntity(_0x59c56a,_0x50c199){return function(_0x10e0c5){if(_0x10e0c5){return _0x10e0c5[_0xfa4b('0x25')]()[_0xfa4b('0x26')](function(){_0x59c56a['status'](0xcc)[_0xfa4b('0x1b')]();});}};}function handleEntityNotFound(_0x222b75,_0x30e053){return function(_0x38b00b){if(!_0x38b00b){_0x222b75[_0xfa4b('0x19')](0x194);}return _0x38b00b;};}function handleError(_0x1f8dab,_0x25fb86){_0x25fb86=_0x25fb86||0x1f4;return function(_0x28d632){logger[_0xfa4b('0x27')](_0x28d632[_0xfa4b('0x28')]);if(_0x28d632[_0xfa4b('0x29')]){delete _0x28d632['name'];}_0x1f8dab[_0xfa4b('0x1a')](_0x25fb86)['send'](_0x28d632);};}exports['index']=function(_0x57d60c,_0xa91e8c){var _0x31af61={},_0x25ffd0={},_0x5a8712={'count':0x0,'rows':[]};var _0x5e44f3=_['map'](db['VtigerField'][_0xfa4b('0x2a')],function(_0x2d9d78){return{'name':_0x2d9d78['fieldName'],'type':_0x2d9d78['type']['key']};});_0x25ffd0[_0xfa4b('0x2b')]=_[_0xfa4b('0x2c')](_0x5e44f3,'name');_0x25ffd0[_0xfa4b('0x2d')]=_[_0xfa4b('0x2e')](_0x57d60c[_0xfa4b('0x2d')]);_0x25ffd0['filters']=_['intersection'](_0x25ffd0['model'],_0x25ffd0[_0xfa4b('0x2d')]);_0x31af61[_0xfa4b('0x2f')]=_['intersection'](_0x25ffd0[_0xfa4b('0x2b')],qs['fields'](_0x57d60c[_0xfa4b('0x2d')]['fields']));_0x31af61['attributes']=_0x31af61[_0xfa4b('0x2f')][_0xfa4b('0x30')]?_0x31af61[_0xfa4b('0x2f')]:_0x25ffd0[_0xfa4b('0x2b')];if(!_0x57d60c[_0xfa4b('0x2d')]['hasOwnProperty'](_0xfa4b('0x31'))){_0x31af61[_0xfa4b('0x1d')]=qs[_0xfa4b('0x1d')](_0x57d60c[_0xfa4b('0x2d')]['limit']);_0x31af61[_0xfa4b('0x1c')]=qs[_0xfa4b('0x1c')](_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x1c')]);}_0x31af61['order']=qs[_0xfa4b('0x32')](_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x32')]);_0x31af61[_0xfa4b('0x33')]=qs['filters'](_[_0xfa4b('0x34')](_0x57d60c[_0xfa4b('0x2d')],_0x25ffd0[_0xfa4b('0x35')]),_0x5e44f3);if(_0x57d60c['query'][_0xfa4b('0x36')]){_0x31af61['where']=_[_0xfa4b('0x37')](_0x31af61[_0xfa4b('0x33')],{'$or':_[_0xfa4b('0x2c')](_0x5e44f3,function(_0x22ceb3){if(_0x22ceb3[_0xfa4b('0x38')]!==_0xfa4b('0x39')){var _0x371636={};_0x371636[_0x22ceb3[_0xfa4b('0x29')]]={'$like':'%'+_0x57d60c['query'][_0xfa4b('0x36')]+'%'};return _0x371636;}})});}_0x31af61=_[_0xfa4b('0x37')]({},_0x31af61,_0x57d60c['options']);var _0x3dbbe4={'where':_0x31af61['where']};return db[_0xfa4b('0x3a')][_0xfa4b('0x1f')](_0x3dbbe4)[_0xfa4b('0x26')](function(_0x3a2409){_0x5a8712[_0xfa4b('0x1f')]=_0x3a2409;if(_0x57d60c[_0xfa4b('0x2d')][_0xfa4b('0x3b')]){_0x31af61['include']=[{'all':!![]}];}return db['VtigerField'][_0xfa4b('0x3c')](_0x31af61);})[_0xfa4b('0x26')](function(_0x1db1f8){_0x5a8712[_0xfa4b('0x3d')]=_0x1db1f8;return _0x5a8712;})['then'](respondWithFilteredResult(_0xa91e8c,_0x31af61))['catch'](handleError(_0xa91e8c,null));};exports[_0xfa4b('0x3e')]=function(_0x50101e,_0x155553){var _0x281f18={'raw':!![],'where':{'id':_0x50101e[_0xfa4b('0x3f')]['id']}},_0x36ae91={};_0x36ae91[_0xfa4b('0x2b')]=_[_0xfa4b('0x2e')](db['VtigerField'][_0xfa4b('0x2a')]);_0x36ae91[_0xfa4b('0x2d')]=_[_0xfa4b('0x2e')](_0x50101e[_0xfa4b('0x2d')]);_0x36ae91[_0xfa4b('0x35')]=_['intersection'](_0x36ae91[_0xfa4b('0x2b')],_0x36ae91[_0xfa4b('0x2d')]);_0x281f18[_0xfa4b('0x2f')]=_['intersection'](_0x36ae91[_0xfa4b('0x2b')],qs[_0xfa4b('0x40')](_0x50101e[_0xfa4b('0x2d')][_0xfa4b('0x40')]));_0x281f18[_0xfa4b('0x2f')]=_0x281f18[_0xfa4b('0x2f')][_0xfa4b('0x30')]?_0x281f18[_0xfa4b('0x2f')]:_0x36ae91[_0xfa4b('0x2b')];if(_0x50101e['query'][_0xfa4b('0x3b')]){_0x281f18[_0xfa4b('0x41')]=[{'all':!![]}];}_0x281f18=_[_0xfa4b('0x37')]({},_0x281f18,_0x50101e[_0xfa4b('0x42')]);return db['VtigerField'][_0xfa4b('0x43')](_0x281f18)[_0xfa4b('0x26')](handleEntityNotFound(_0x155553,null))[_0xfa4b('0x26')](respondWithResult(_0x155553,null))['catch'](handleError(_0x155553,null));};exports[_0xfa4b('0x44')]=function(_0x165eed,_0xdeb02e){return db[_0xfa4b('0x3a')][_0xfa4b('0x44')](_0x165eed[_0xfa4b('0x45')],{})[_0xfa4b('0x26')](respondWithResult(_0xdeb02e,0xc9))['catch'](handleError(_0xdeb02e,null));};exports['update']=function(_0x4a3f8f,_0x15ca99){if(_0x4a3f8f[_0xfa4b('0x45')]['id']){delete _0x4a3f8f[_0xfa4b('0x45')]['id'];}return db['VtigerField'][_0xfa4b('0x43')]({'where':{'id':_0x4a3f8f['params']['id']}})['then'](handleEntityNotFound(_0x15ca99,null))[_0xfa4b('0x26')](saveUpdates(_0x4a3f8f[_0xfa4b('0x45')],null))[_0xfa4b('0x26')](respondWithResult(_0x15ca99,null))[_0xfa4b('0x46')](handleError(_0x15ca99,null));};exports[_0xfa4b('0x25')]=function(_0x2ed6a5,_0x3add44){return db[_0xfa4b('0x3a')]['find']({'where':{'id':_0x2ed6a5[_0xfa4b('0x3f')]['id']}})[_0xfa4b('0x26')](handleEntityNotFound(_0x3add44,null))['then'](removeEntity(_0x3add44,null))[_0xfa4b('0x46')](handleError(_0x3add44,null));}; \ No newline at end of file +var _0xafdc=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','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','end','json','offset','undefined','limit','count','set','save','then','destroy','error','stack','name','send','index','map','type','key'];(function(_0xe0f4a9,_0x398b46){var _0x5acdea=function(_0x1fad64){while(--_0x1fad64){_0xe0f4a9['push'](_0xe0f4a9['shift']());}};_0x5acdea(++_0x398b46);}(_0xafdc,0xb4));var _0xcafd=function(_0x2a04c5,_0x119123){_0x2a04c5=_0x2a04c5-0x0;var _0x29ac29=_0xafdc[_0x2a04c5];return _0x29ac29;};'use strict';var emlformat=require(_0xcafd('0x0'));var rimraf=require(_0xcafd('0x1'));var zipdir=require(_0xcafd('0x2'));var jsonpatch=require(_0xcafd('0x3'));var rp=require('request-promise');var moment=require(_0xcafd('0x4'));var BPromise=require(_0xcafd('0x5'));var Mustache=require(_0xcafd('0x6'));var util=require(_0xcafd('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcafd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcafd('0x9'));var squel=require(_0xcafd('0xa'));var crypto=require('crypto');var jsforce=require(_0xcafd('0xb'));var deskjs=require(_0xcafd('0xc'));var toCsv=require(_0xcafd('0xd'));var querystring=require(_0xcafd('0xe'));var Papa=require(_0xcafd('0xf'));var Redis=require(_0xcafd('0x10'));var authService=require(_0xcafd('0x11'));var qs=require(_0xcafd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcafd('0x13'));var logger=require(_0xcafd('0x14'))(_0xcafd('0x15'));var utils=require(_0xcafd('0x16'));var config=require(_0xcafd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcafd('0x18'))['db'];function respondWithStatusCode(_0x4480c6,_0x307020){_0x307020=_0x307020||0xcc;return function(_0x348d81){if(_0x348d81){return _0x4480c6[_0xcafd('0x19')](_0x307020);}return _0x4480c6[_0xcafd('0x1a')](_0x307020)[_0xcafd('0x1b')]();};}function respondWithResult(_0x36ee27,_0x48f7e4){_0x48f7e4=_0x48f7e4||0xc8;return function(_0x117caf){if(_0x117caf){return _0x36ee27[_0xcafd('0x1a')](_0x48f7e4)[_0xcafd('0x1c')](_0x117caf);}};}function respondWithFilteredResult(_0x395332,_0x2e3c10){return function(_0x300bfb){if(_0x300bfb){var _0x2b324a=typeof _0x2e3c10[_0xcafd('0x1d')]===_0xcafd('0x1e')&&typeof _0x2e3c10[_0xcafd('0x1f')]==='undefined';var _0x2e6c73=_0x300bfb[_0xcafd('0x20')];var _0xfbf4=_0x2b324a?0x0:_0x2e3c10[_0xcafd('0x1d')];var _0x38889b=_0x2b324a?_0x300bfb[_0xcafd('0x20')]:_0x2e3c10[_0xcafd('0x1d')]+_0x2e3c10[_0xcafd('0x1f')];var _0x246343;if(_0x38889b>=_0x2e6c73){_0x38889b=_0x2e6c73;_0x246343=0xc8;}else{_0x246343=0xce;}_0x395332[_0xcafd('0x1a')](_0x246343);return _0x395332[_0xcafd('0x21')]('Content-Range',_0xfbf4+'-'+_0x38889b+'/'+_0x2e6c73)[_0xcafd('0x1c')](_0x300bfb);}return null;};}function patchUpdates(_0x40fac0){return function(_0x1a70e2){try{jsonpatch['apply'](_0x1a70e2,_0x40fac0,!![]);}catch(_0x138427){return BPromise['reject'](_0x138427);}return _0x1a70e2[_0xcafd('0x22')]();};}function saveUpdates(_0x31b911,_0x1f117f){return function(_0x360b50){if(_0x360b50){return _0x360b50['update'](_0x31b911)[_0xcafd('0x23')](function(_0xd2c452){return _0xd2c452;});}return null;};}function removeEntity(_0x51d995,_0x3d72f9){return function(_0x213477){if(_0x213477){return _0x213477[_0xcafd('0x24')]()[_0xcafd('0x23')](function(){_0x51d995['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf85e2,_0xebe0b0){return function(_0x3d3f57){if(!_0x3d3f57){_0xcf85e2[_0xcafd('0x19')](0x194);}return _0x3d3f57;};}function handleError(_0x168287,_0xea5dd9){_0xea5dd9=_0xea5dd9||0x1f4;return function(_0xd1e8e1){logger[_0xcafd('0x25')](_0xd1e8e1[_0xcafd('0x26')]);if(_0xd1e8e1[_0xcafd('0x27')]){delete _0xd1e8e1[_0xcafd('0x27')];}_0x168287[_0xcafd('0x1a')](_0xea5dd9)[_0xcafd('0x28')](_0xd1e8e1);};}exports[_0xcafd('0x29')]=function(_0x5268b0,_0x4a5872){var _0xcde692={},_0x5a07ce={},_0x8d84fb={'count':0x0,'rows':[]};var _0x3c2e52=_[_0xcafd('0x2a')](db['VtigerField']['rawAttributes'],function(_0x45269c){return{'name':_0x45269c['fieldName'],'type':_0x45269c[_0xcafd('0x2b')][_0xcafd('0x2c')]};});_0x5a07ce[_0xcafd('0x2d')]=_[_0xcafd('0x2a')](_0x3c2e52,_0xcafd('0x27'));_0x5a07ce['query']=_[_0xcafd('0x2e')](_0x5268b0[_0xcafd('0x2f')]);_0x5a07ce[_0xcafd('0x30')]=_[_0xcafd('0x31')](_0x5a07ce[_0xcafd('0x2d')],_0x5a07ce[_0xcafd('0x2f')]);_0xcde692['attributes']=_['intersection'](_0x5a07ce[_0xcafd('0x2d')],qs[_0xcafd('0x32')](_0x5268b0[_0xcafd('0x2f')][_0xcafd('0x32')]));_0xcde692[_0xcafd('0x33')]=_0xcde692[_0xcafd('0x33')][_0xcafd('0x34')]?_0xcde692[_0xcafd('0x33')]:_0x5a07ce[_0xcafd('0x2d')];if(!_0x5268b0[_0xcafd('0x2f')][_0xcafd('0x35')](_0xcafd('0x36'))){_0xcde692['limit']=qs[_0xcafd('0x1f')](_0x5268b0[_0xcafd('0x2f')]['limit']);_0xcde692[_0xcafd('0x1d')]=qs[_0xcafd('0x1d')](_0x5268b0[_0xcafd('0x2f')][_0xcafd('0x1d')]);}_0xcde692[_0xcafd('0x37')]=qs[_0xcafd('0x38')](_0x5268b0[_0xcafd('0x2f')][_0xcafd('0x38')]);_0xcde692[_0xcafd('0x39')]=qs[_0xcafd('0x30')](_[_0xcafd('0x3a')](_0x5268b0[_0xcafd('0x2f')],_0x5a07ce['filters']),_0x3c2e52);if(_0x5268b0['query'][_0xcafd('0x3b')]){_0xcde692[_0xcafd('0x39')]=_[_0xcafd('0x3c')](_0xcde692['where'],{'$or':_['map'](_0x3c2e52,function(_0x198944){if(_0x198944[_0xcafd('0x2b')]!==_0xcafd('0x3d')){var _0x35b3ad={};_0x35b3ad[_0x198944[_0xcafd('0x27')]]={'$like':'%'+_0x5268b0[_0xcafd('0x2f')][_0xcafd('0x3b')]+'%'};return _0x35b3ad;}})});}_0xcde692=_[_0xcafd('0x3c')]({},_0xcde692,_0x5268b0[_0xcafd('0x3e')]);var _0x4ebc5e={'where':_0xcde692['where']};return db[_0xcafd('0x3f')]['count'](_0x4ebc5e)[_0xcafd('0x23')](function(_0x5c6f5d){_0x8d84fb['count']=_0x5c6f5d;if(_0x5268b0[_0xcafd('0x2f')]['includeAll']){_0xcde692[_0xcafd('0x40')]=[{'all':!![]}];}return db[_0xcafd('0x3f')][_0xcafd('0x41')](_0xcde692);})[_0xcafd('0x23')](function(_0x50429e){_0x8d84fb[_0xcafd('0x42')]=_0x50429e;return _0x8d84fb;})[_0xcafd('0x23')](respondWithFilteredResult(_0x4a5872,_0xcde692))[_0xcafd('0x43')](handleError(_0x4a5872,null));};exports[_0xcafd('0x44')]=function(_0x5f271c,_0x28b79d){var _0x2fc817={'raw':!![],'where':{'id':_0x5f271c['params']['id']}},_0x2be4d5={};_0x2be4d5[_0xcafd('0x2d')]=_[_0xcafd('0x2e')](db[_0xcafd('0x3f')][_0xcafd('0x45')]);_0x2be4d5[_0xcafd('0x2f')]=_[_0xcafd('0x2e')](_0x5f271c[_0xcafd('0x2f')]);_0x2be4d5[_0xcafd('0x30')]=_[_0xcafd('0x31')](_0x2be4d5[_0xcafd('0x2d')],_0x2be4d5[_0xcafd('0x2f')]);_0x2fc817[_0xcafd('0x33')]=_[_0xcafd('0x31')](_0x2be4d5[_0xcafd('0x2d')],qs[_0xcafd('0x32')](_0x5f271c[_0xcafd('0x2f')][_0xcafd('0x32')]));_0x2fc817[_0xcafd('0x33')]=_0x2fc817[_0xcafd('0x33')]['length']?_0x2fc817[_0xcafd('0x33')]:_0x2be4d5[_0xcafd('0x2d')];if(_0x5f271c[_0xcafd('0x2f')][_0xcafd('0x46')]){_0x2fc817[_0xcafd('0x40')]=[{'all':!![]}];}_0x2fc817=_['merge']({},_0x2fc817,_0x5f271c[_0xcafd('0x3e')]);return db['VtigerField'][_0xcafd('0x47')](_0x2fc817)[_0xcafd('0x23')](handleEntityNotFound(_0x28b79d,null))[_0xcafd('0x23')](respondWithResult(_0x28b79d,null))[_0xcafd('0x43')](handleError(_0x28b79d,null));};exports[_0xcafd('0x48')]=function(_0x1c5d08,_0x54aa35){return db[_0xcafd('0x3f')][_0xcafd('0x48')](_0x1c5d08[_0xcafd('0x49')],{})['then'](respondWithResult(_0x54aa35,0xc9))[_0xcafd('0x43')](handleError(_0x54aa35,null));};exports[_0xcafd('0x4a')]=function(_0x24a19b,_0x57af4a){if(_0x24a19b[_0xcafd('0x49')]['id']){delete _0x24a19b[_0xcafd('0x49')]['id'];}return db['VtigerField'][_0xcafd('0x47')]({'where':{'id':_0x24a19b['params']['id']}})[_0xcafd('0x23')](handleEntityNotFound(_0x57af4a,null))[_0xcafd('0x23')](saveUpdates(_0x24a19b[_0xcafd('0x49')],null))[_0xcafd('0x23')](respondWithResult(_0x57af4a,null))['catch'](handleError(_0x57af4a,null));};exports['destroy']=function(_0x1f4ce5,_0x48a536){return db[_0xcafd('0x3f')][_0xcafd('0x47')]({'where':{'id':_0x1f4ce5['params']['id']}})[_0xcafd('0x23')](handleEntityNotFound(_0x48a536,null))[_0xcafd('0x23')](removeEntity(_0x48a536,null))[_0xcafd('0x43')](handleError(_0x48a536,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2bcfb83..40b307f 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 _0x3be2=['moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x13f6dc,_0x50d971){var _0x5cca3f=function(_0x38b7b8){while(--_0x38b7b8){_0x13f6dc['push'](_0x13f6dc['shift']());}};_0x5cca3f(++_0x50d971);}(_0x3be2,0x83));var _0x23be=function(_0x485f71,_0x1f0f8c){_0x485f71=_0x485f71-0x0;var _0x1061f8=_0x3be2[_0x485f71];return _0x1061f8;};'use strict';var _=require(_0x23be('0x0'));var util=require(_0x23be('0x1'));var logger=require(_0x23be('0x2'))(_0x23be('0x3'));var moment=require(_0x23be('0x4'));var BPromise=require('bluebird');var rp=require(_0x23be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23be('0x6'));var config=require(_0x23be('0x7'));var attributes=require(_0x23be('0x8'));module[_0x23be('0x9')]=function(_0x2c8756,_0x201db1){return _0x2c8756['define'](_0x23be('0xa'),attributes,{'tableName':_0x23be('0xb'),'paranoid':![],'indexes':[{'name':_0x23be('0xc'),'fields':[_0x23be('0xd'),_0x23be('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a84=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields'];(function(_0x4cf094,_0x450b62){var _0x42cc67=function(_0x4e05d0){while(--_0x4e05d0){_0x4cf094['push'](_0x4cf094['shift']());}};_0x42cc67(++_0x450b62);}(_0x4a84,0x1ce));var _0x44a8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4a84[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x44a8('0x0'));var util=require(_0x44a8('0x1'));var logger=require(_0x44a8('0x2'))(_0x44a8('0x3'));var moment=require(_0x44a8('0x4'));var BPromise=require(_0x44a8('0x5'));var rp=require(_0x44a8('0x6'));var fs=require('fs');var path=require(_0x44a8('0x7'));var rimraf=require(_0x44a8('0x8'));var config=require(_0x44a8('0x9'));var attributes=require('./intVtigerField.attributes');module[_0x44a8('0xa')]=function(_0x2ec5a1,_0x175832){return _0x2ec5a1[_0x44a8('0xb')](_0x44a8('0xc'),attributes,{'tableName':_0x44a8('0xd'),'paranoid':![],'indexes':[{'name':_0x44a8('0xe'),'fields':[_0x44a8('0xf'),_0x44a8('0x10')],'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 0b67cff..c49a61b 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 _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x42a628,_0x5059c2){var _0x2420e2=function(_0x38468e){while(--_0x38468e){_0x42a628['push'](_0x42a628['shift']());}};_0x2420e2(++_0x5059c2);}(_0x153f,0x15b));var _0xf153=function(_0x490742,_0x280cee){_0x490742=_0x490742-0x0;var _0x20c144=_0x153f[_0x490742];return _0x20c144;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});} \ No newline at end of file +var _0x5a1a=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f1937,_0x37d49c){var _0x46733e=function(_0x32e9df){while(--_0x32e9df){_0x3f1937['push'](_0x3f1937['shift']());}};_0x46733e(++_0x37d49c);}(_0x5a1a,0xe1));var _0xa5a1=function(_0x38e0de,_0x132d49){_0x38e0de=_0x38e0de-0x0;var _0x1a906a=_0x5a1a[_0x38e0de];return _0x1a906a;};'use strict';var _=require(_0xa5a1('0x0'));var util=require(_0xa5a1('0x1'));var moment=require(_0xa5a1('0x2'));var BPromise=require(_0xa5a1('0x3'));var rs=require(_0xa5a1('0x4'));var fs=require('fs');var Redis=require(_0xa5a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5a1('0x6'));var logger=require(_0xa5a1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa5a1('0x8'));var client=jayson[_0xa5a1('0x9')][_0xa5a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28faeb,_0x561bcc,_0x22000b){return new BPromise(function(_0x256362,_0x2b44e7){return client[_0xa5a1('0xb')](_0x28faeb,_0x22000b)[_0xa5a1('0xc')](function(_0xc0a0e6){logger['info'](_0xa5a1('0xd'),_0x561bcc,_0xa5a1('0xe'));logger['debug'](_0xa5a1('0xf'),_0x561bcc,'request\x20sent',JSON[_0xa5a1('0x10')](_0xc0a0e6));if(_0xc0a0e6[_0xa5a1('0x11')]){if(_0xc0a0e6[_0xa5a1('0x11')]['code']===0x1f4){logger['error'](_0xa5a1('0xd'),_0x561bcc,_0xc0a0e6[_0xa5a1('0x11')][_0xa5a1('0x12')]);return _0x2b44e7(_0xc0a0e6[_0xa5a1('0x11')]['message']);}logger[_0xa5a1('0x11')]('VtigerField,\x20%s,\x20%s',_0x561bcc,_0xc0a0e6[_0xa5a1('0x11')][_0xa5a1('0x12')]);return _0x256362(_0xc0a0e6[_0xa5a1('0x11')][_0xa5a1('0x12')]);}else{logger[_0xa5a1('0x13')](_0xa5a1('0xd'),_0x561bcc,_0xa5a1('0xe'));_0x256362(_0xc0a0e6[_0xa5a1('0x14')][_0xa5a1('0x12')]);}})[_0xa5a1('0x15')](function(_0x2c66ca){logger['error']('VtigerField,\x20%s,\x20%s',_0x561bcc,_0x2c66ca);_0x2b44e7(_0x2c66ca);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ec6bf05..9059799 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 _0x36a5=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x5dbadb,_0x322912){var _0xb1c5ff=function(_0x536f03){while(--_0x536f03){_0x5dbadb['push'](_0x5dbadb['shift']());}};_0xb1c5ff(++_0x322912);}(_0x36a5,0xb4));var _0x536a=function(_0x2ce6a4,_0x51e9a9){_0x2ce6a4=_0x2ce6a4-0x0;var _0x2c90de=_0x36a5[_0x2ce6a4];return _0x2c90de;};'use strict';var multer=require(_0x536a('0x0'));var util=require(_0x536a('0x1'));var path=require(_0x536a('0x2'));var timeout=require('connect-timeout');var express=require(_0x536a('0x3'));var router=express[_0x536a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x536a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x536a('0x6'));var controller=require(_0x536a('0x7'));router[_0x536a('0x8')]('/',auth[_0x536a('0x9')](),controller[_0x536a('0xa')]);router['get'](_0x536a('0xb'),auth[_0x536a('0x9')](),controller[_0x536a('0xc')]);router[_0x536a('0x8')]('/:id/configurations',auth[_0x536a('0x9')](),controller[_0x536a('0xd')]);router[_0x536a('0x8')](_0x536a('0xe'),auth[_0x536a('0x9')](),controller['getFields']);router[_0x536a('0xf')]('/',auth[_0x536a('0x9')](),controller[_0x536a('0x10')]);router[_0x536a('0xf')](_0x536a('0x11'),auth[_0x536a('0x9')](),controller['addConfiguration']);router['put'](_0x536a('0xb'),auth[_0x536a('0x9')](),controller[_0x536a('0x12')]);router[_0x536a('0x13')](_0x536a('0xb'),auth['isAuthenticated'](),controller[_0x536a('0x14')]);module['exports']=router; \ No newline at end of file +var _0x3271=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3271,0x15f));var _0x1327=function(_0x17046c,_0x30567c){_0x17046c=_0x17046c-0x0;var _0x5b1593=_0x3271[_0x17046c];return _0x5b1593;};'use strict';var multer=require(_0x1327('0x0'));var util=require(_0x1327('0x1'));var path=require(_0x1327('0x2'));var timeout=require('connect-timeout');var express=require(_0x1327('0x3'));var router=express[_0x1327('0x4')]();var fs_extra=require(_0x1327('0x5'));var auth=require(_0x1327('0x6'));var interaction=require(_0x1327('0x7'));var config=require(_0x1327('0x8'));var controller=require(_0x1327('0x9'));router[_0x1327('0xa')]('/',auth[_0x1327('0xb')](),controller[_0x1327('0xc')]);router['get'](_0x1327('0xd'),auth[_0x1327('0xb')](),controller[_0x1327('0xe')]);router[_0x1327('0xa')](_0x1327('0xf'),auth[_0x1327('0xb')](),controller['getConfigurations']);router[_0x1327('0xa')](_0x1327('0x10'),auth[_0x1327('0xb')](),controller[_0x1327('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1327('0x12')]);router['post'](_0x1327('0xf'),auth['isAuthenticated'](),controller[_0x1327('0x13')]);router[_0x1327('0x14')](_0x1327('0xd'),auth[_0x1327('0xb')](),controller[_0x1327('0x15')]);router[_0x1327('0x16')]('/:id',auth[_0x1327('0xb')](),controller[_0x1327('0x17')]);module[_0x1327('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c8248de..287a3a7 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 _0x687b=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x3243d4,_0x2cfa97){var _0x45f124=function(_0xf8e1ce){while(--_0xf8e1ce){_0x3243d4['push'](_0x3243d4['shift']());}};_0x45f124(++_0x2cfa97);}(_0x687b,0x14a));var _0xb687=function(_0x3e0191,_0x1d4b20){_0x3e0191=_0x3e0191-0x0;var _0xf2ae83=_0x687b[_0x3e0191];return _0xf2ae83;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')]},'description':{'type':Sequelize[_0xb687('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb687('0x2')]},'token':{'type':Sequelize[_0xb687('0x2')]},'remoteUri':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('0x3')},'authType':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5'),_0xb687('0x6')),'defaultValue':_0xb687('0x5')},'serverUrl':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb687('0x4')]('integrationTab',_0xb687('0x7')),'defaultValue':_0xb687('0x8')}}; \ No newline at end of file +var _0xfb0b=['password','token','newTab','integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x8be27e,_0x59798e){var _0x3e408d=function(_0x1e39cd){while(--_0x1e39cd){_0x8be27e['push'](_0x8be27e['shift']());}};_0x3e408d(++_0x59798e);}(_0xfb0b,0x94));var _0xbfb0=function(_0x313327,_0x82f4f6){_0x313327=_0x313327-0x0;var _0x93f4bd=_0xfb0b[_0x313327];return _0x93f4bd;};'use strict';var Sequelize=require(_0xbfb0('0x0'));module[_0xbfb0('0x1')]={'name':{'type':Sequelize[_0xbfb0('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xbfb0('0x2')],'unique':_0xbfb0('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbfb0('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xbfb0('0x4')](_0xbfb0('0x5'),_0xbfb0('0x6')),'defaultValue':_0xbfb0('0x5')},'serverUrl':{'type':Sequelize[_0xbfb0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbfb0('0x4')]('integrationTab',_0xbfb0('0x7')),'defaultValue':_0xbfb0('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d8fc1df..2cd262f 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 _0xb9be=['count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','AccountId','getSubjects','type','Descriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined'];(function(_0x43ba6b,_0x4590f9){var _0x232a2d=function(_0x5a4628){while(--_0x5a4628){_0x43ba6b['push'](_0x43ba6b['shift']());}};_0x232a2d(++_0x4590f9);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xb9be[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];var integrations=require(_0xeb9b('0x19'));function respondWithStatusCode(_0x2a01df,_0x51598f){_0x51598f=_0x51598f||0xcc;return function(_0x5e94e3){if(_0x5e94e3){return _0x2a01df['sendStatus'](_0x51598f);}return _0x2a01df[_0xeb9b('0x1a')](_0x51598f)[_0xeb9b('0x1b')]();};}function respondWithResult(_0x2674e6,_0x4ec46d){_0x4ec46d=_0x4ec46d||0xc8;return function(_0x5926e1){if(_0x5926e1){return _0x2674e6['status'](_0x4ec46d)[_0xeb9b('0x1c')](_0x5926e1);}};}function respondWithFilteredResult(_0x1a5f27,_0x406afd){return function(_0x3fa308){if(_0x3fa308){var _0x2c9aa6=typeof _0x406afd[_0xeb9b('0x1d')]===_0xeb9b('0x1e')&&typeof _0x406afd['limit']===_0xeb9b('0x1e');var _0x36e871=_0x3fa308[_0xeb9b('0x1f')];var _0x3a11e3=_0x2c9aa6?0x0:_0x406afd[_0xeb9b('0x1d')];var _0x1a140c=_0x2c9aa6?_0x3fa308[_0xeb9b('0x1f')]:_0x406afd[_0xeb9b('0x1d')]+_0x406afd[_0xeb9b('0x20')];var _0x26e312;if(_0x1a140c>=_0x36e871){_0x1a140c=_0x36e871;_0x26e312=0xc8;}else{_0x26e312=0xce;}_0x1a5f27['status'](_0x26e312);return _0x1a5f27[_0xeb9b('0x21')]('Content-Range',_0x3a11e3+'-'+_0x1a140c+'/'+_0x36e871)['json'](_0x3fa308);}return null;};}function patchUpdates(_0x580498){return function(_0x703f0b){try{jsonpatch['apply'](_0x703f0b,_0x580498,!![]);}catch(_0xbed5ce){return BPromise[_0xeb9b('0x22')](_0xbed5ce);}return _0x703f0b[_0xeb9b('0x23')]();};}function saveUpdates(_0x37d7e0,_0x3c8be7){return function(_0x43dab8){if(_0x43dab8){return _0x43dab8[_0xeb9b('0x24')](_0x37d7e0)[_0xeb9b('0x25')](function(_0x142d1c){return _0x142d1c;});}return null;};}function removeEntity(_0x46df93,_0x61c86d){return function(_0x296f95){if(_0x296f95){return _0x296f95[_0xeb9b('0x26')]()[_0xeb9b('0x25')](function(){_0x46df93[_0xeb9b('0x1a')](0xcc)[_0xeb9b('0x1b')]();});}};}function handleEntityNotFound(_0x4c997e,_0xd57390){return function(_0x4ed960){if(!_0x4ed960){_0x4c997e[_0xeb9b('0x27')](0x194);}return _0x4ed960;};}function handleError(_0x5d6846,_0x347ec1){_0x347ec1=_0x347ec1||0x1f4;return function(_0x4361b9){logger[_0xeb9b('0x28')](_0x4361b9[_0xeb9b('0x29')]);if(_0x4361b9['name']){delete _0x4361b9[_0xeb9b('0x2a')];}_0x5d6846[_0xeb9b('0x1a')](_0x347ec1)['send'](_0x4361b9);};}exports[_0xeb9b('0x2b')]=function(_0x33bb1d,_0x5ce745){var _0x2a4b51={},_0x2ea20f={},_0x4188d5={'count':0x0,'rows':[]};var _0x48c5f4=_[_0xeb9b('0x2c')](db['ZendeskAccount'][_0xeb9b('0x2d')],function(_0x4c1331){return{'name':_0x4c1331[_0xeb9b('0x2e')],'type':_0x4c1331['type'][_0xeb9b('0x2f')]};});_0x2ea20f['model']=_[_0xeb9b('0x2c')](_0x48c5f4,'name');_0x2ea20f[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x33bb1d[_0xeb9b('0x30')]);_0x2ea20f[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],_0x2ea20f[_0xeb9b('0x30')]);_0x2a4b51[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x2ea20f[_0xeb9b('0x34')],qs['fields'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x2a4b51[_0xeb9b('0x35')]=_0x2a4b51[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x2a4b51[_0xeb9b('0x35')]:_0x2ea20f[_0xeb9b('0x34')];if(!_0x33bb1d['query'][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x2a4b51[_0xeb9b('0x20')]=qs['limit'](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x20')]);_0x2a4b51[_0xeb9b('0x1d')]=qs[_0xeb9b('0x1d')](_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}_0x2a4b51['order']=qs[_0xeb9b('0x3a')](_0x33bb1d[_0xeb9b('0x30')]['sort']);_0x2a4b51[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x33bb1d[_0xeb9b('0x30')],_0x2ea20f[_0xeb9b('0x32')]),_0x48c5f4);if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x3d')]){_0x2a4b51['where']=_[_0xeb9b('0x3e')](_0x2a4b51[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x48c5f4,function(_0x53d2f7){if(_0x53d2f7['type']!=='VIRTUAL'){var _0x26dc71={};_0x26dc71[_0x53d2f7[_0xeb9b('0x2a')]]={'$like':'%'+_0x33bb1d[_0xeb9b('0x30')]['filter']+'%'};return _0x26dc71;}})});}_0x2a4b51=_[_0xeb9b('0x3e')]({},_0x2a4b51,_0x33bb1d[_0xeb9b('0x3f')]);var _0x240d8d={'where':_0x2a4b51[_0xeb9b('0x3b')]};return db[_0xeb9b('0x40')][_0xeb9b('0x1f')](_0x240d8d)[_0xeb9b('0x25')](function(_0x492122){_0x4188d5[_0xeb9b('0x1f')]=_0x492122;if(_0x33bb1d[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0x2a4b51['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xeb9b('0x42')](_0x2a4b51);})[_0xeb9b('0x25')](function(_0x495998){_0x4188d5[_0xeb9b('0x43')]=_0x495998;return _0x4188d5;})['then'](respondWithFilteredResult(_0x5ce745,_0x2a4b51))[_0xeb9b('0x44')](handleError(_0x5ce745,null));};exports[_0xeb9b('0x45')]=function(_0x28b075,_0x300565){var _0xbee63e={'raw':![],'where':{'id':_0x28b075[_0xeb9b('0x46')]['id']}},_0x10f483={};_0x10f483[_0xeb9b('0x34')]=_[_0xeb9b('0x31')](db[_0xeb9b('0x40')][_0xeb9b('0x2d')]);_0x10f483[_0xeb9b('0x30')]=_['keys'](_0x28b075['query']);_0x10f483[_0xeb9b('0x32')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],_0x10f483[_0xeb9b('0x30')]);_0xbee63e[_0xeb9b('0x35')]=_['intersection'](_0x10f483[_0xeb9b('0x34')],qs[_0xeb9b('0x36')](_0x28b075['query'][_0xeb9b('0x36')]));_0xbee63e[_0xeb9b('0x35')]=_0xbee63e[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0xbee63e[_0xeb9b('0x35')]:_0x10f483[_0xeb9b('0x34')];if(_0x28b075[_0xeb9b('0x30')][_0xeb9b('0x41')]){_0xbee63e['include']=[{'all':!![]}];}_0xbee63e=_['merge']({},_0xbee63e,_0x28b075[_0xeb9b('0x3f')]);return db['ZendeskAccount']['find'](_0xbee63e)[_0xeb9b('0x25')](handleEntityNotFound(_0x300565,null))[_0xeb9b('0x25')](respondWithResult(_0x300565,null))[_0xeb9b('0x44')](handleError(_0x300565,null));};exports[_0xeb9b('0x47')]=function(_0x45bc74,_0x2fd6ee){return db['ZendeskAccount']['create'](_0x45bc74['body'],{})[_0xeb9b('0x25')](respondWithResult(_0x2fd6ee,0xc9))['catch'](handleError(_0x2fd6ee,null));};exports[_0xeb9b('0x24')]=function(_0x2ee59c,_0x2ae9bf){if(_0x2ee59c[_0xeb9b('0x48')]['id']){delete _0x2ee59c[_0xeb9b('0x48')]['id'];}return db[_0xeb9b('0x40')][_0xeb9b('0x49')]({'where':{'id':_0x2ee59c[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x2ae9bf,null))[_0xeb9b('0x25')](saveUpdates(_0x2ee59c['body'],null))['then'](respondWithResult(_0x2ae9bf,null))[_0xeb9b('0x44')](handleError(_0x2ae9bf,null));};exports[_0xeb9b('0x26')]=function(_0x542ef4,_0x19bfe9){return db['ZendeskAccount'][_0xeb9b('0x49')]({'where':{'id':_0x542ef4[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bfe9,null))['then'](removeEntity(_0x19bfe9,null))['catch'](handleError(_0x19bfe9,null));};exports[_0xeb9b('0x4a')]=function(_0x32d8cd,_0x263453,_0x4fe9d0){var _0x4ded40={};var _0x471161={};var _0x1833c2;var _0x3e6e73;return db[_0xeb9b('0x40')][_0xeb9b('0x4b')]({'where':{'id':_0x32d8cd[_0xeb9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x263453,null))[_0xeb9b('0x25')](function(_0x1fab7a){if(_0x1fab7a){_0x1833c2=_0x1fab7a;_0x471161['model']=_[_0xeb9b('0x31')](db['ZendeskConfiguration'][_0xeb9b('0x2d')]);_0x471161[_0xeb9b('0x30')]=_['keys'](_0x32d8cd[_0xeb9b('0x30')]);_0x471161['filters']=_[_0xeb9b('0x33')](_0x471161[_0xeb9b('0x34')],_0x471161[_0xeb9b('0x30')]);_0x4ded40[_0xeb9b('0x35')]=_[_0xeb9b('0x33')](_0x471161['model'],qs[_0xeb9b('0x36')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x36')]));_0x4ded40['attributes']=_0x4ded40[_0xeb9b('0x35')][_0xeb9b('0x37')]?_0x4ded40[_0xeb9b('0x35')]:_0x471161[_0xeb9b('0x34')];_0x4ded40[_0xeb9b('0x4c')]=qs[_0xeb9b('0x3a')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3a')]);_0x4ded40[_0xeb9b('0x3b')]=qs[_0xeb9b('0x32')](_[_0xeb9b('0x3c')](_0x32d8cd['query'],_0x471161['filters']));if(_0x32d8cd['query'][_0xeb9b('0x3d')]){_0x4ded40['where']=_[_0xeb9b('0x3e')](_0x4ded40[_0xeb9b('0x3b')],{'$or':_[_0xeb9b('0x2c')](_0x4ded40['attributes'],function(_0x27deea){var _0xb29d24={};_0xb29d24[_0x27deea]={'$like':'%'+_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x3d')]+'%'};return _0xb29d24;})});}_0x4ded40=_[_0xeb9b('0x3e')]({},_0x4ded40,_0x32d8cd[_0xeb9b('0x3f')]);return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x58a3e2){if(_0x58a3e2){_0x3e6e73=_0x58a3e2['length'];if(!_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x38')](_0xeb9b('0x39'))){_0x4ded40['limit']=qs[_0xeb9b('0x20')](_0x32d8cd['query'][_0xeb9b('0x20')]);_0x4ded40['offset']=qs[_0xeb9b('0x1d')](_0x32d8cd[_0xeb9b('0x30')][_0xeb9b('0x1d')]);}return _0x1833c2[_0xeb9b('0x4a')](_0x4ded40);}})[_0xeb9b('0x25')](function(_0x4be938){if(_0x4be938){return _0x4be938?{'count':_0x3e6e73,'rows':_0x4be938}:null;}})[_0xeb9b('0x25')](respondWithResult(_0x263453,null))[_0xeb9b('0x44')](handleError(_0x263453,null));};exports['addConfiguration']=function(_0x5a690a,_0x436470,_0x39c248){if(_0x5a690a['body']['id']){delete _0x5a690a[_0xeb9b('0x48')]['id'];}return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x5a690a['params']['id']}})[_0xeb9b('0x25')](handleEntityNotFound(_0x436470,null))[_0xeb9b('0x25')](function(_0x417221){if(_0x417221){_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4d')]=_0x417221['id'];_0x5a690a[_0xeb9b('0x48')]['Subjects']=integrations[_0xeb9b('0x4e')](_0x5a690a[_0xeb9b('0x48')]['channel'],_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x4f')]);_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x50')]=integrations['getDescriptions'](_0x5a690a[_0xeb9b('0x48')][_0xeb9b('0x51')],_0x5a690a['body'][_0xeb9b('0x4f')]);return db[_0xeb9b('0x52')][_0xeb9b('0x47')](_0x5a690a[_0xeb9b('0x48')],{'include':[{'model':db[_0xeb9b('0x53')],'as':_0xeb9b('0x54')},{'model':db[_0xeb9b('0x53')],'as':'Descriptions'}]});}return null;})[_0xeb9b('0x25')](respondWithResult(_0x436470,null))[_0xeb9b('0x44')](handleError(_0x436470,null));};exports['getFields']=function(_0x289654,_0x6a85fd,_0x2fb07e){var _0x25398e='';return db['ZendeskAccount'][_0xeb9b('0x4b')]({'where':{'id':_0x289654[_0xeb9b('0x46')]['id']},'attributes':['id',_0xeb9b('0x55'),_0xeb9b('0x56'),_0xeb9b('0x57'),_0xeb9b('0x58'),_0xeb9b('0x59')]})[_0xeb9b('0x25')](handleEntityNotFound(_0x6a85fd,null))[_0xeb9b('0x25')](function(_0x128d43){if(_0x128d43){_0x25398e=_0x128d43[_0xeb9b('0x59')];var _0xbbde9c=_0x25398e[_0xeb9b('0x5a')](-0x1);if(_0xbbde9c==='/'){_0x25398e=_0x25398e[_0xeb9b('0x5b')](0x0,_0x25398e[_0xeb9b('0x5c')](_0xbbde9c));}var _0xd619ca={'method':'GET','uri':util[_0xeb9b('0x5d')](_0xeb9b('0x5e'),_0x25398e,_0xeb9b('0x5f')),'json':!![]};switch(_0x128d43['authType']){case'password':_0xd619ca[_0xeb9b('0x60')]={'Authorization':util['format'](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')](_0xeb9b('0x62'),_0x128d43[_0xeb9b('0x55')],_0x128d43[_0xeb9b('0x56')]))[_0xeb9b('0x63')](_0xeb9b('0x64')))};break;case _0xeb9b('0x57'):_0xd619ca[_0xeb9b('0x60')]={'Authorization':util[_0xeb9b('0x5d')](_0xeb9b('0x61'),new Buffer(util[_0xeb9b('0x5d')]('%s/token:%s',_0x128d43['username'],_0x128d43[_0xeb9b('0x57')]))['toString']('base64'))};break;default:throw new db[(_0xeb9b('0x65'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd619ca);}})['then'](function(_0x346ba9){if(_0x346ba9){var _0x3147bc=[_0xeb9b('0x66'),_0xeb9b('0x67'),'group',_0xeb9b('0x68')];_[_0xeb9b('0x69')](_0x346ba9[_0xeb9b('0x5f')],function(_0x4e5cfb){return _0x3147bc['includes'](_0x4e5cfb[_0xeb9b('0x4f')]);});return{'count':_0x346ba9['ticket_fields'][_0xeb9b('0x37')],'rows':_['map'](_0x346ba9['ticket_fields'],function(_0xa7e9c3){return{'id':_0xa7e9c3['id'],'name':_0xa7e9c3['position']>0x7?_0xa7e9c3[_0xeb9b('0x6a')]:_0xa7e9c3['type'],'custom':_0xa7e9c3['position']>0x7?!![]:![],'options':_0xa7e9c3[_0xeb9b('0x6b')]?_0xa7e9c3[_0xeb9b('0x6b')]:_0xa7e9c3[_0xeb9b('0x6c')]?_0xa7e9c3[_0xeb9b('0x6c')]:[]};})};}})['then'](respondWithResult(_0x6a85fd,null))[_0xeb9b('0x44')](function(_0x31de58){var _0x3f395a=_0x289654[_0xeb9b('0x30')][_0xeb9b('0x6d')]?0x1f4:_0x31de58[_0xeb9b('0x6e')]||0x1f4;logger['error'](_0xeb9b('0x6f'),'getFields',_0x3f395a,JSON[_0xeb9b('0x70')](_0x31de58));delete _0x31de58[_0xeb9b('0x2a')];if(_0x3f395a===0x191){_0x3f395a=0x190;}_0x6a85fd['status'](_0x3f395a)[_0xeb9b('0x71')](_0x289654['query'][_0xeb9b('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x31de58[_0xeb9b('0x6e')]}:_0x31de58);});}; \ No newline at end of file +var _0x04b8=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x5353ec,_0x4cdccc){var _0x5174b1=function(_0x51a348){while(--_0x51a348){_0x5353ec['push'](_0x5353ec['shift']());}};_0x5174b1(++_0x4cdccc);}(_0x04b8,0x159));var _0x804b=function(_0x73f519,_0x15fa15){_0x73f519=_0x73f519-0x0;var _0x410358=_0x04b8[_0x73f519];return _0x410358;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['ZendeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['ZendeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['ZendeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['ZendeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['ZendeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['ZendeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['ZendeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58'),_0x804b('0x59'),'authType',_0x804b('0x5a')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x2541cd){if(_0x2541cd){_0x39ed3c=_0x2541cd[_0x804b('0x5a')];var _0x549504=_0x39ed3c[_0x804b('0x5b')](-0x1);if(_0x549504==='/'){_0x39ed3c=_0x39ed3c['substring'](0x0,_0x39ed3c[_0x804b('0x5c')](_0x549504));}var _0x3e2813={'method':_0x804b('0x5d'),'uri':util[_0x804b('0x5e')](_0x804b('0x5f'),_0x39ed3c,_0x804b('0x60')),'json':!![]};switch(_0x2541cd[_0x804b('0x61')]){case'password':_0x3e2813[_0x804b('0x62')]={'Authorization':util['format'](_0x804b('0x63'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x64'),_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x58')]))[_0x804b('0x65')](_0x804b('0x66')))};break;case _0x804b('0x59'):_0x3e2813[_0x804b('0x62')]={'Authorization':util[_0x804b('0x5e')](_0x804b('0x63'),new Buffer(util['format']('%s/token:%s',_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x59')]))[_0x804b('0x65')](_0x804b('0x66')))};break;default:throw new db['Sequelize'][(_0x804b('0x67'))](_0x804b('0x68'));}return rp(_0x3e2813);}})[_0x804b('0x26')](function(_0x3dda89){if(_0x3dda89){var _0x260419=[_0x804b('0x69'),_0x804b('0x6a'),_0x804b('0x6b'),_0x804b('0x6c')];_[_0x804b('0x6d')](_0x3dda89['ticket_fields'],function(_0x5a6661){return _0x260419[_0x804b('0x6e')](_0x5a6661[_0x804b('0x2e')]);});return{'count':_0x3dda89['ticket_fields'][_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x3dda89['ticket_fields'],function(_0x345bf7){return{'id':_0x345bf7['id'],'name':_0x345bf7['position']>0x7?_0x345bf7['title']:_0x345bf7[_0x804b('0x2e')],'custom':_0x345bf7[_0x804b('0x6f')]>0x7?!![]:![],'options':_0x345bf7['system_field_options']?_0x345bf7['system_field_options']:_0x345bf7[_0x804b('0x70')]?_0x345bf7[_0x804b('0x70')]:[]};})};}})['then'](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x5e2756){var _0x42dfc3=_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?0x1f4:_0x5e2756['statusCode']||0x1f4;logger[_0x804b('0x72')](_0x804b('0x73'),_0x804b('0x56'),_0x42dfc3,JSON[_0x804b('0x74')](_0x5e2756));delete _0x5e2756[_0x804b('0x2a')];if(_0x42dfc3===0x191){_0x42dfc3=0x190;}_0x1bb4ec[_0x804b('0x1a')](_0x42dfc3)[_0x804b('0x2b')](_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?{'message':_0x804b('0x75'),'statusCode':_0x5e2756['statusCode']}:_0x5e2756);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f194cdc..b19dae9 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 _0xd9fc=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','api','moment','bluebird'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xd9fc,0xdf));var _0xcd9f=function(_0xc47acb,_0x1a810b){_0xc47acb=_0xc47acb-0x0;var _0x2a7547=_0xd9fc[_0xc47acb];return _0x2a7547;};'use strict';var _=require(_0xcd9f('0x0'));var util=require(_0xcd9f('0x1'));var logger=require('../../config/logger')(_0xcd9f('0x2'));var moment=require(_0xcd9f('0x3'));var BPromise=require(_0xcd9f('0x4'));var rp=require(_0xcd9f('0x5'));var fs=require('fs');var path=require(_0xcd9f('0x6'));var rimraf=require('rimraf');var config=require(_0xcd9f('0x7'));var attributes=require(_0xcd9f('0x8'));var integrations=require(_0xcd9f('0x9'));module[_0xcd9f('0xa')]=function(_0x484793,_0x327991){return _0x484793['define'](_0xcd9f('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b82=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x5db07a,_0x87d434){var _0x10a58a=function(_0x447636){while(--_0x447636){_0x5db07a['push'](_0x5db07a['shift']());}};_0x10a58a(++_0x87d434);}(_0x4b82,0xfe));var _0x24b8=function(_0x31147e,_0x2ff5b9){_0x31147e=_0x31147e-0x0;var _0x395bf8=_0x4b82[_0x31147e];return _0x395bf8;};'use strict';var _=require(_0x24b8('0x0'));var util=require('util');var logger=require(_0x24b8('0x1'))(_0x24b8('0x2'));var moment=require(_0x24b8('0x3'));var BPromise=require(_0x24b8('0x4'));var rp=require(_0x24b8('0x5'));var fs=require('fs');var path=require(_0x24b8('0x6'));var rimraf=require(_0x24b8('0x7'));var config=require(_0x24b8('0x8'));var attributes=require(_0x24b8('0x9'));var integrations=require(_0x24b8('0xa'));module[_0x24b8('0xb')]=function(_0x4441f7,_0x5df377){return _0x4441f7['define'](_0x24b8('0xc'),attributes,{'tableName':_0x24b8('0xd'),'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 6dd1bc4..06bff03 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 _0xbc5d=['../../config/utils','../../config/logger','rpc','../../config/environment','client','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowZendeskAccount','find','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x11f37f,_0x1c6e35){_0x11f37f=_0x11f37f-0x0;var _0x25c933=_0xbc5d[_0x11f37f];return _0x25c933;};'use strict';var _=require('lodash');var util=require(_0xdbc5('0x0'));var moment=require(_0xdbc5('0x1'));var BPromise=require(_0xdbc5('0x2'));var rs=require(_0xdbc5('0x3'));var fs=require('fs');var Redis=require(_0xdbc5('0x4'));var db=require(_0xdbc5('0x5'))['db'];var utils=require(_0xdbc5('0x6'));var logger=require(_0xdbc5('0x7'))(_0xdbc5('0x8'));var config=require(_0xdbc5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbc5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6222,_0x3fac6f,_0x2d7747){return new BPromise(function(_0x2932b4,_0x53c60e){return client['request'](_0x1c6222,_0x2d7747)['then'](function(_0x4ac877){logger[_0xdbc5('0xb')](_0xdbc5('0xc'),_0x3fac6f,_0xdbc5('0xd'));logger['debug'](_0xdbc5('0xe'),_0x3fac6f,_0xdbc5('0xd'),JSON[_0xdbc5('0xf')](_0x4ac877));if(_0x4ac877['error']){if(_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x11')]===0x1f4){logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x4ac877[_0xdbc5('0x10')]['message']);return _0x53c60e(_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x12')]);}logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x4ac877[_0xdbc5('0x10')][_0xdbc5('0x12')]);return _0x2932b4(_0x4ac877[_0xdbc5('0x10')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x3fac6f,_0xdbc5('0xd'));_0x2932b4(_0x4ac877['result']['message']);}})[_0xdbc5('0x13')](function(_0x58871b){logger[_0xdbc5('0x10')](_0xdbc5('0xc'),_0x3fac6f,_0x58871b);_0x53c60e(_0x58871b);});});}exports[_0xdbc5('0x14')]=function(_0x41a8c4){var _0x51e06b=this;return new Promise(function(_0x4d793d,_0x5325eb){return db[_0xdbc5('0x15')][_0xdbc5('0x16')]({'raw':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4['options']['raw']===undefined?!![]:![]:!![],'where':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x18')]||null:null,'attributes':_0x41a8c4['options']?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x19')]||null:null,'limit':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1a')]||null:null,'include':_0x41a8c4[_0xdbc5('0x17')]?_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x41a8c4[_0xdbc5('0x17')][_0xdbc5('0x1b')],function(_0x20f611){return{'model':db[_0x20f611[_0xdbc5('0x1d')]],'as':_0x20f611['as'],'attributes':_0x20f611[_0xdbc5('0x19')],'include':_0x20f611[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x20f611[_0xdbc5('0x1b')],function(_0x864959){return{'model':db[_0x864959['model']],'as':_0x864959['as'],'attributes':_0x864959[_0xdbc5('0x19')],'include':_0x864959[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x864959[_0xdbc5('0x1b')],function(_0x5fd7f6){return{'model':db[_0x5fd7f6[_0xdbc5('0x1d')]],'as':_0x5fd7f6['as'],'attributes':_0x5fd7f6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2601aa){logger[_0xdbc5('0xb')](_0xdbc5('0x14'),_0x41a8c4);logger[_0xdbc5('0x1e')](_0xdbc5('0x14'),_0x41a8c4,JSON['stringify'](_0x2601aa));_0x4d793d(_0x2601aa);})['catch'](function(_0x123fa3){logger['error'](_0xdbc5('0x14'),_0x123fa3[_0xdbc5('0x12')],_0x41a8c4);_0x5325eb(_0x51e06b[_0xdbc5('0x10')](0x1f4,_0x123fa3[_0xdbc5('0x12')]));});});};exports[_0xdbc5('0x1f')]=function(_0x4262b9){var _0x5c3b5a=this;return new Promise(function(_0x215303,_0x44d1a8){return db['ZendeskAccount'][_0xdbc5('0x20')]({'raw':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x21')]===undefined?!![]:![]:!![],'where':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9['options'][_0xdbc5('0x18')]||null:null,'attributes':_0x4262b9['options']?_0x4262b9['options']['attributes']||null:null,'include':_0x4262b9[_0xdbc5('0x17')]?_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x4262b9[_0xdbc5('0x17')][_0xdbc5('0x1b')],function(_0x132ff8){return{'model':db[_0x132ff8['model']],'as':_0x132ff8['as'],'attributes':_0x132ff8['attributes'],'include':_0x132ff8[_0xdbc5('0x1b')]?_[_0xdbc5('0x1c')](_0x132ff8[_0xdbc5('0x1b')],function(_0x6bf36d){return{'model':db[_0x6bf36d[_0xdbc5('0x1d')]],'as':_0x6bf36d['as'],'attributes':_0x6bf36d['attributes'],'include':_0x6bf36d[_0xdbc5('0x1b')]?_['map'](_0x6bf36d[_0xdbc5('0x1b')],function(_0x50ddb8){return{'model':db[_0x50ddb8[_0xdbc5('0x1d')]],'as':_0x50ddb8['as'],'attributes':_0x50ddb8['attributes']};}):[]};}):[]};}):[]:[]})[_0xdbc5('0x22')](function(_0x3137fc){logger['info'](_0xdbc5('0x1f'),_0x4262b9);logger['debug']('ShowZendeskAccount',_0x4262b9,JSON[_0xdbc5('0xf')](_0x3137fc));_0x215303(_0x3137fc);})[_0xdbc5('0x13')](function(_0xfe9aae){logger[_0xdbc5('0x10')](_0xdbc5('0x1f'),_0xfe9aae[_0xdbc5('0x12')],_0x4262b9);_0x44d1a8(_0x5c3b5a[_0xdbc5('0x10')](0x1f4,_0xfe9aae[_0xdbc5('0x12')]));});});}; \ No newline at end of file +var _0x567b=['moment','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ZendeskAccount','findAll','options','raw','where','limit','map','include','model','attributes','GetZendeskAccount','debug','ShowZendeskAccount','find','lodash','util'];(function(_0x4abf30,_0x496c3e){var _0x3cc877=function(_0x500b4){while(--_0x500b4){_0x4abf30['push'](_0x4abf30['shift']());}};_0x3cc877(++_0x496c3e);}(_0x567b,0x1ed));var _0xb567=function(_0x112f5a,_0x32e384){_0x112f5a=_0x112f5a-0x0;var _0x42e851=_0x567b[_0x112f5a];return _0x42e851;};'use strict';var _=require(_0xb567('0x0'));var util=require(_0xb567('0x1'));var moment=require(_0xb567('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb567('0x3'));var logger=require(_0xb567('0x4'))(_0xb567('0x5'));var config=require('../../config/environment');var jayson=require(_0xb567('0x6'));var client=jayson[_0xb567('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b751,_0x4f810d,_0x42a6f3){return new BPromise(function(_0x49121d,_0x35349f){return client[_0xb567('0x8')](_0x47b751,_0x42a6f3)[_0xb567('0x9')](function(_0x250054){logger[_0xb567('0xa')](_0xb567('0xb'),_0x4f810d,_0xb567('0xc'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4f810d,'request\x20sent',JSON[_0xb567('0xd')](_0x250054));if(_0x250054[_0xb567('0xe')]){if(_0x250054[_0xb567('0xe')][_0xb567('0xf')]===0x1f4){logger[_0xb567('0xe')](_0xb567('0xb'),_0x4f810d,_0x250054[_0xb567('0xe')][_0xb567('0x10')]);return _0x35349f(_0x250054['error'][_0xb567('0x10')]);}logger[_0xb567('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x4f810d,_0x250054[_0xb567('0xe')]['message']);return _0x49121d(_0x250054[_0xb567('0xe')]['message']);}else{logger[_0xb567('0xa')](_0xb567('0xb'),_0x4f810d,_0xb567('0xc'));_0x49121d(_0x250054[_0xb567('0x11')][_0xb567('0x10')]);}})[_0xb567('0x12')](function(_0x4e120b){logger['error'](_0xb567('0xb'),_0x4f810d,_0x4e120b);_0x35349f(_0x4e120b);});});}exports['GetZendeskAccount']=function(_0x4f9f9b){var _0x1d51b3=this;return new Promise(function(_0x3962b8,_0x169402){return db[_0xb567('0x13')][_0xb567('0x14')]({'raw':_0x4f9f9b[_0xb567('0x15')]?_0x4f9f9b[_0xb567('0x15')][_0xb567('0x16')]===undefined?!![]:![]:!![],'where':_0x4f9f9b[_0xb567('0x15')]?_0x4f9f9b[_0xb567('0x15')][_0xb567('0x17')]||null:null,'attributes':_0x4f9f9b[_0xb567('0x15')]?_0x4f9f9b[_0xb567('0x15')]['attributes']||null:null,'limit':_0x4f9f9b[_0xb567('0x15')]?_0x4f9f9b[_0xb567('0x15')][_0xb567('0x18')]||null:null,'include':_0x4f9f9b[_0xb567('0x15')]?_0x4f9f9b[_0xb567('0x15')]['include']?_[_0xb567('0x19')](_0x4f9f9b[_0xb567('0x15')][_0xb567('0x1a')],function(_0xf38690){return{'model':db[_0xf38690[_0xb567('0x1b')]],'as':_0xf38690['as'],'attributes':_0xf38690['attributes'],'include':_0xf38690['include']?_['map'](_0xf38690[_0xb567('0x1a')],function(_0x1cc843){return{'model':db[_0x1cc843[_0xb567('0x1b')]],'as':_0x1cc843['as'],'attributes':_0x1cc843[_0xb567('0x1c')],'include':_0x1cc843['include']?_['map'](_0x1cc843['include'],function(_0x1f5799){return{'model':db[_0x1f5799[_0xb567('0x1b')]],'as':_0x1f5799['as'],'attributes':_0x1f5799[_0xb567('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb567('0x9')](function(_0x5a72a0){logger[_0xb567('0xa')](_0xb567('0x1d'),_0x4f9f9b);logger[_0xb567('0x1e')](_0xb567('0x1d'),_0x4f9f9b,JSON['stringify'](_0x5a72a0));_0x3962b8(_0x5a72a0);})['catch'](function(_0x16f72f){logger[_0xb567('0xe')](_0xb567('0x1d'),_0x16f72f[_0xb567('0x10')],_0x4f9f9b);_0x169402(_0x1d51b3[_0xb567('0xe')](0x1f4,_0x16f72f[_0xb567('0x10')]));});});};exports[_0xb567('0x1f')]=function(_0x3565f3){var _0x1a9354=this;return new Promise(function(_0x42c810,_0x13b108){return db[_0xb567('0x13')][_0xb567('0x20')]({'raw':_0x3565f3[_0xb567('0x15')]?_0x3565f3['options'][_0xb567('0x16')]===undefined?!![]:![]:!![],'where':_0x3565f3['options']?_0x3565f3[_0xb567('0x15')]['where']||null:null,'attributes':_0x3565f3[_0xb567('0x15')]?_0x3565f3['options'][_0xb567('0x1c')]||null:null,'include':_0x3565f3[_0xb567('0x15')]?_0x3565f3[_0xb567('0x15')][_0xb567('0x1a')]?_[_0xb567('0x19')](_0x3565f3['options'][_0xb567('0x1a')],function(_0x3acd98){return{'model':db[_0x3acd98[_0xb567('0x1b')]],'as':_0x3acd98['as'],'attributes':_0x3acd98['attributes'],'include':_0x3acd98[_0xb567('0x1a')]?_[_0xb567('0x19')](_0x3acd98['include'],function(_0x4e9312){return{'model':db[_0x4e9312[_0xb567('0x1b')]],'as':_0x4e9312['as'],'attributes':_0x4e9312[_0xb567('0x1c')],'include':_0x4e9312[_0xb567('0x1a')]?_['map'](_0x4e9312[_0xb567('0x1a')],function(_0x1b14d4){return{'model':db[_0x1b14d4['model']],'as':_0x1b14d4['as'],'attributes':_0x1b14d4[_0xb567('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb567('0x9')](function(_0xfe0687){logger['info'](_0xb567('0x1f'),_0x3565f3);logger[_0xb567('0x1e')](_0xb567('0x1f'),_0x3565f3,JSON[_0xb567('0xd')](_0xfe0687));_0x42c810(_0xfe0687);})[_0xb567('0x12')](function(_0x7fc66e){logger['error'](_0xb567('0x1f'),_0x7fc66e[_0xb567('0x10')],_0x3565f3);_0x13b108(_0x1a9354[_0xb567('0xe')](0x1f4,_0x7fc66e[_0xb567('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d242c70..7baf177 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 _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file +var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x378f12,_0xb54e38){var _0x19379f=function(_0x482c33){while(--_0x482c33){_0x378f12['push'](_0x378f12['shift']());}};_0x19379f(++_0xb54e38);}(_0x91a7,0xe7));var _0x791a=function(_0x4e6ce2,_0x45c3fa){_0x4e6ce2=_0x4e6ce2-0x0;var _0x20fc22=_0x91a7[_0x4e6ce2];return _0x20fc22;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 387c191..9d235bd 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 _0xed94=['sequelize','exports','STRING'];(function(_0x198911,_0x4e52f7){var _0x54f18f=function(_0x5e2c17){while(--_0x5e2c17){_0x198911['push'](_0x198911['shift']());}};_0x54f18f(++_0x4e52f7);}(_0xed94,0x19e));var _0x4ed9=function(_0x52ac27,_0x8776c8){_0x52ac27=_0x52ac27-0x0;var _0x40732e=_0xed94[_0x52ac27];return _0x40732e;};'use strict';var Sequelize=require(_0x4ed9('0x0'));module[_0x4ed9('0x1')]={'name':{'type':Sequelize[_0x4ed9('0x2')]},'description':{'type':Sequelize[_0x4ed9('0x2')]}}; \ No newline at end of file +var _0xd0b3=['sequelize','exports','STRING'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xd0b3,0x14d));var _0x3d0b=function(_0x56f5a6,_0x3ffb29){_0x56f5a6=_0x56f5a6-0x0;var _0x3fc9f9=_0xd0b3[_0x56f5a6];return _0x3fc9f9;};'use strict';var Sequelize=require(_0x3d0b('0x0'));module[_0x3d0b('0x1')]={'name':{'type':Sequelize[_0x3d0b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b1c54da..98a0b79 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 _0x1658=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','merge','find','create','body','findOne','options','getFields','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x23fd4e,_0x4201e9){var _0x192c8b=function(_0x2a09e4){while(--_0x2a09e4){_0x23fd4e['push'](_0x23fd4e['shift']());}};_0x192c8b(++_0x4201e9);}(_0x1658,0x146));var _0x8165=function(_0x3d5331,_0x37d7ef){_0x3d5331=_0x3d5331-0x0;var _0xc4e3c0=_0x1658[_0x3d5331];return _0xc4e3c0;};'use strict';var emlformat=require(_0x8165('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8165('0x1'));var jsonpatch=require(_0x8165('0x2'));var rp=require(_0x8165('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8165('0x4'));var util=require(_0x8165('0x5'));var path=require('path');var sox=require(_0x8165('0x6'));var csv=require(_0x8165('0x7'));var ejs=require(_0x8165('0x8'));var fs=require('fs');var fs_extra=require(_0x8165('0x9'));var _=require(_0x8165('0xa'));var squel=require(_0x8165('0xb'));var crypto=require('crypto');var jsforce=require(_0x8165('0xc'));var deskjs=require(_0x8165('0xd'));var toCsv=require(_0x8165('0x7'));var querystring=require(_0x8165('0xe'));var Papa=require(_0x8165('0xf'));var Redis=require(_0x8165('0x10'));var authService=require(_0x8165('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8165('0x12'));var hardwareService=require(_0x8165('0x13'));var logger=require(_0x8165('0x14'))(_0x8165('0x15'));var utils=require(_0x8165('0x16'));var config=require(_0x8165('0x17'));var licenseUtil=require(_0x8165('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7a71,_0x1b4d7b){_0x1b4d7b=_0x1b4d7b||0xcc;return function(_0x18ae3b){if(_0x18ae3b){return _0x2a7a71['sendStatus'](_0x1b4d7b);}return _0x2a7a71[_0x8165('0x19')](_0x1b4d7b)[_0x8165('0x1a')]();};}function respondWithResult(_0x3378ba,_0x24da76){_0x24da76=_0x24da76||0xc8;return function(_0x24a0d9){if(_0x24a0d9){return _0x3378ba['status'](_0x24da76)['json'](_0x24a0d9);}};}function respondWithFilteredResult(_0x41b74c,_0x5815ed){return function(_0x105484){if(_0x105484){var _0x9de95a=typeof _0x5815ed[_0x8165('0x1b')]===_0x8165('0x1c')&&typeof _0x5815ed[_0x8165('0x1d')]==='undefined';var _0x3bfe71=_0x105484[_0x8165('0x1e')];var _0x633a52=_0x9de95a?0x0:_0x5815ed[_0x8165('0x1b')];var _0xc70305=_0x9de95a?_0x105484[_0x8165('0x1e')]:_0x5815ed[_0x8165('0x1b')]+_0x5815ed[_0x8165('0x1d')];var _0x4aecd5;if(_0xc70305>=_0x3bfe71){_0xc70305=_0x3bfe71;_0x4aecd5=0xc8;}else{_0x4aecd5=0xce;}_0x41b74c[_0x8165('0x19')](_0x4aecd5);return _0x41b74c[_0x8165('0x1f')]('Content-Range',_0x633a52+'-'+_0xc70305+'/'+_0x3bfe71)[_0x8165('0x20')](_0x105484);}return null;};}function patchUpdates(_0x51bc2c){return function(_0x41a0cd){try{jsonpatch[_0x8165('0x21')](_0x41a0cd,_0x51bc2c,!![]);}catch(_0x3a1a66){return BPromise[_0x8165('0x22')](_0x3a1a66);}return _0x41a0cd['save']();};}function saveUpdates(_0x52c1f0,_0x2ab71f){return function(_0x2199df){if(_0x2199df){return _0x2199df[_0x8165('0x23')](_0x52c1f0)[_0x8165('0x24')](function(_0x3d95fd){return _0x3d95fd;});}return null;};}function removeEntity(_0x46f9fb,_0x3f2542){return function(_0x2272d9){if(_0x2272d9){return _0x2272d9[_0x8165('0x25')]()[_0x8165('0x24')](function(){_0x46f9fb['status'](0xcc)[_0x8165('0x1a')]();});}};}function handleEntityNotFound(_0x460fda,_0x506f5d){return function(_0x395131){if(!_0x395131){_0x460fda[_0x8165('0x26')](0x194);}return _0x395131;};}function handleError(_0x1d3b9e,_0x3116c9){_0x3116c9=_0x3116c9||0x1f4;return function(_0x19a114){logger[_0x8165('0x27')](_0x19a114[_0x8165('0x28')]);if(_0x19a114['name']){delete _0x19a114[_0x8165('0x29')];}_0x1d3b9e[_0x8165('0x19')](_0x3116c9)['send'](_0x19a114);};}exports[_0x8165('0x2a')]=function(_0x34c713,_0xcad789){var _0x93b6f6={},_0x41633a={},_0x5e31b1={'count':0x0,'rows':[]};var _0x212331=_['map'](db[_0x8165('0x2b')][_0x8165('0x2c')],function(_0x253fc4){return{'name':_0x253fc4[_0x8165('0x2d')],'type':_0x253fc4[_0x8165('0x2e')]['key']};});_0x41633a[_0x8165('0x2f')]=_[_0x8165('0x30')](_0x212331,'name');_0x41633a[_0x8165('0x31')]=_[_0x8165('0x32')](_0x34c713[_0x8165('0x31')]);_0x41633a[_0x8165('0x33')]=_[_0x8165('0x34')](_0x41633a[_0x8165('0x2f')],_0x41633a[_0x8165('0x31')]);_0x93b6f6[_0x8165('0x35')]=_[_0x8165('0x34')](_0x41633a[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x34c713['query'][_0x8165('0x36')]));_0x93b6f6[_0x8165('0x35')]=_0x93b6f6[_0x8165('0x35')][_0x8165('0x37')]?_0x93b6f6['attributes']:_0x41633a[_0x8165('0x2f')];if(!_0x34c713[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x93b6f6[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x34c713['query'][_0x8165('0x1d')]);_0x93b6f6[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x34c713[_0x8165('0x31')][_0x8165('0x1b')]);}_0x93b6f6[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x34c713[_0x8165('0x31')][_0x8165('0x3b')]);_0x93b6f6[_0x8165('0x3c')]=qs['filters'](_[_0x8165('0x3d')](_0x34c713[_0x8165('0x31')],_0x41633a['filters']),_0x212331);if(_0x34c713[_0x8165('0x31')][_0x8165('0x3e')]){_0x93b6f6[_0x8165('0x3c')]=_['merge'](_0x93b6f6[_0x8165('0x3c')],{'$or':_['map'](_0x212331,function(_0x4776f5){if(_0x4776f5['type']!==_0x8165('0x3f')){var _0x5666c9={};_0x5666c9[_0x4776f5[_0x8165('0x29')]]={'$like':'%'+_0x34c713[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x5666c9;}})});}_0x93b6f6=_['merge']({},_0x93b6f6,_0x34c713['options']);var _0x3a8728={'where':_0x93b6f6['where']};return db['ZendeskConfiguration'][_0x8165('0x1e')](_0x3a8728)[_0x8165('0x24')](function(_0x1d342e){_0x5e31b1['count']=_0x1d342e;if(_0x34c713[_0x8165('0x31')]['includeAll']){_0x93b6f6['include']=[{'all':!![]}];}return db[_0x8165('0x2b')][_0x8165('0x40')](_0x93b6f6);})[_0x8165('0x24')](function(_0x3628ec){_0x5e31b1[_0x8165('0x41')]=_0x3628ec;return _0x5e31b1;})[_0x8165('0x24')](respondWithFilteredResult(_0xcad789,_0x93b6f6))[_0x8165('0x42')](handleError(_0xcad789,null));};exports[_0x8165('0x43')]=function(_0x2773b4,_0x23fcb1){var _0x1c4220={'raw':![],'where':{'id':_0x2773b4[_0x8165('0x44')]['id']}},_0x45c7c6={};_0x45c7c6[_0x8165('0x2f')]=_[_0x8165('0x32')](db['ZendeskConfiguration'][_0x8165('0x2c')]);_0x45c7c6[_0x8165('0x31')]=_[_0x8165('0x32')](_0x2773b4[_0x8165('0x31')]);_0x45c7c6['filters']=_[_0x8165('0x34')](_0x45c7c6[_0x8165('0x2f')],_0x45c7c6[_0x8165('0x31')]);_0x1c4220[_0x8165('0x35')]=_[_0x8165('0x34')](_0x45c7c6[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x2773b4['query'][_0x8165('0x36')]));_0x1c4220['attributes']=_0x1c4220[_0x8165('0x35')][_0x8165('0x37')]?_0x1c4220[_0x8165('0x35')]:_0x45c7c6[_0x8165('0x2f')];if(_0x2773b4[_0x8165('0x31')][_0x8165('0x45')]){_0x1c4220[_0x8165('0x46')]=[{'all':!![]}];}_0x1c4220=_[_0x8165('0x47')]({},_0x1c4220,_0x2773b4['options']);return db[_0x8165('0x2b')][_0x8165('0x48')](_0x1c4220)[_0x8165('0x24')](handleEntityNotFound(_0x23fcb1,null))['then'](respondWithResult(_0x23fcb1,null))['catch'](handleError(_0x23fcb1,null));};exports[_0x8165('0x49')]=function(_0x25b1ad,_0x14dc54){return db[_0x8165('0x2b')][_0x8165('0x49')](_0x25b1ad[_0x8165('0x4a')],{})[_0x8165('0x24')](respondWithResult(_0x14dc54,0xc9))[_0x8165('0x42')](handleError(_0x14dc54,null));};exports[_0x8165('0x23')]=function(_0x7a9799,_0x45dceb){if(_0x7a9799[_0x8165('0x4a')]['id']){delete _0x7a9799[_0x8165('0x4a')]['id'];}return db[_0x8165('0x2b')][_0x8165('0x48')]({'where':{'id':_0x7a9799[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x45dceb,null))[_0x8165('0x24')](saveUpdates(_0x7a9799[_0x8165('0x4a')],null))[_0x8165('0x24')](respondWithResult(_0x45dceb,null))[_0x8165('0x42')](handleError(_0x45dceb,null));};exports[_0x8165('0x25')]=function(_0x55e4f8,_0x25b84a){return db[_0x8165('0x2b')][_0x8165('0x48')]({'where':{'id':_0x55e4f8['params']['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x25b84a,null))[_0x8165('0x24')](removeEntity(_0x25b84a,null))[_0x8165('0x42')](handleError(_0x25b84a,null));};exports['getFields']=function(_0x16e104,_0x3612c9,_0xad768){var _0x459ddd={};var _0x519e16={};var _0x425c21;var _0x4d88f6;return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x16e104['params']['id']}})['then'](handleEntityNotFound(_0x3612c9,null))[_0x8165('0x24')](function(_0x21456e){if(_0x21456e){_0x425c21=_0x21456e;_0x519e16[_0x8165('0x2f')]=_[_0x8165('0x32')](db['ZendeskField'][_0x8165('0x2c')]);_0x519e16[_0x8165('0x31')]=_['keys'](_0x16e104[_0x8165('0x31')]);_0x519e16[_0x8165('0x33')]=_['intersection'](_0x519e16[_0x8165('0x2f')],_0x519e16[_0x8165('0x31')]);_0x459ddd[_0x8165('0x35')]=_[_0x8165('0x34')](_0x519e16['model'],qs[_0x8165('0x36')](_0x16e104['query']['fields']));_0x459ddd[_0x8165('0x35')]=_0x459ddd[_0x8165('0x35')][_0x8165('0x37')]?_0x459ddd[_0x8165('0x35')]:_0x519e16['model'];_0x459ddd[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x16e104[_0x8165('0x31')][_0x8165('0x3b')]);_0x459ddd[_0x8165('0x3c')]=qs['filters'](_[_0x8165('0x3d')](_0x16e104['query'],_0x519e16['filters']));if(_0x16e104[_0x8165('0x31')][_0x8165('0x3e')]){_0x459ddd[_0x8165('0x3c')]=_[_0x8165('0x47')](_0x459ddd[_0x8165('0x3c')],{'$or':_['map'](_0x459ddd[_0x8165('0x35')],function(_0x55f734){var _0x4dc4ca={};_0x4dc4ca[_0x55f734]={'$like':'%'+_0x16e104[_0x8165('0x31')]['filter']+'%'};return _0x4dc4ca;})});}_0x459ddd=_[_0x8165('0x47')]({},_0x459ddd,_0x16e104[_0x8165('0x4c')]);return _0x425c21[_0x8165('0x4d')](_0x459ddd);}})['then'](function(_0x5ea246){if(_0x5ea246){_0x4d88f6=_0x5ea246['length'];if(!_0x16e104[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x459ddd[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x16e104['query'][_0x8165('0x1d')]);_0x459ddd[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x16e104['query'][_0x8165('0x1b')]);}return _0x425c21[_0x8165('0x4d')](_0x459ddd);}})[_0x8165('0x24')](function(_0x15b486){if(_0x15b486){return _0x15b486?{'count':_0x4d88f6,'rows':_0x15b486}:null;}})[_0x8165('0x24')](respondWithResult(_0x3612c9,null))['catch'](handleError(_0x3612c9,null));};exports['getSubjects']=function(_0x565784,_0x200937,_0x430491){var _0x162c1a={};var _0x120698={};var _0x3e7ac1;var _0x363bb2;return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x565784[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x200937,null))[_0x8165('0x24')](function(_0x13cdfc){if(_0x13cdfc){_0x3e7ac1=_0x13cdfc;_0x120698[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x4e')][_0x8165('0x2c')]);_0x120698[_0x8165('0x31')]=_['keys'](_0x565784['query']);_0x120698[_0x8165('0x33')]=_['intersection'](_0x120698['model'],_0x120698['query']);_0x162c1a[_0x8165('0x35')]=_[_0x8165('0x34')](_0x120698[_0x8165('0x2f')],qs[_0x8165('0x36')](_0x565784[_0x8165('0x31')][_0x8165('0x36')]));_0x162c1a[_0x8165('0x35')]=_0x162c1a['attributes']['length']?_0x162c1a[_0x8165('0x35')]:_0x120698['model'];_0x162c1a[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x565784[_0x8165('0x31')]['sort']);_0x162c1a[_0x8165('0x3c')]=qs[_0x8165('0x33')](_[_0x8165('0x3d')](_0x565784[_0x8165('0x31')],_0x120698[_0x8165('0x33')]));if(_0x565784[_0x8165('0x31')][_0x8165('0x3e')]){_0x162c1a['where']=_['merge'](_0x162c1a[_0x8165('0x3c')],{'$or':_['map'](_0x162c1a['attributes'],function(_0x224294){var _0x3ed96b={};_0x3ed96b[_0x224294]={'$like':'%'+_0x565784[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x3ed96b;})});}_0x162c1a=_[_0x8165('0x47')]({},_0x162c1a,_0x565784[_0x8165('0x4c')]);return _0x3e7ac1[_0x8165('0x4f')](_0x162c1a);}})[_0x8165('0x24')](function(_0x57c048){if(_0x57c048){_0x363bb2=_0x57c048[_0x8165('0x37')];if(!_0x565784[_0x8165('0x31')]['hasOwnProperty'](_0x8165('0x39'))){_0x162c1a[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x565784['query'][_0x8165('0x1d')]);_0x162c1a[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x565784[_0x8165('0x31')]['offset']);}return _0x3e7ac1[_0x8165('0x4f')](_0x162c1a);}})[_0x8165('0x24')](function(_0x5bc97b){if(_0x5bc97b){return _0x5bc97b?{'count':_0x363bb2,'rows':_0x5bc97b}:null;}})[_0x8165('0x24')](respondWithResult(_0x200937,null))[_0x8165('0x42')](handleError(_0x200937,null));};exports[_0x8165('0x50')]=function(_0x4dee92,_0x16a35b,_0x1cec84){var _0x2e6f9c={};var _0x4abd43={};var _0x1a8726;var _0x136da1;return db['ZendeskConfiguration'][_0x8165('0x4b')]({'where':{'id':_0x4dee92[_0x8165('0x44')]['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x16a35b,null))[_0x8165('0x24')](function(_0x5129e8){if(_0x5129e8){_0x1a8726=_0x5129e8;_0x4abd43[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x4e')][_0x8165('0x2c')]);_0x4abd43['query']=_[_0x8165('0x32')](_0x4dee92[_0x8165('0x31')]);_0x4abd43['filters']=_[_0x8165('0x34')](_0x4abd43[_0x8165('0x2f')],_0x4abd43[_0x8165('0x31')]);_0x2e6f9c[_0x8165('0x35')]=_[_0x8165('0x34')](_0x4abd43['model'],qs[_0x8165('0x36')](_0x4dee92['query'][_0x8165('0x36')]));_0x2e6f9c[_0x8165('0x35')]=_0x2e6f9c[_0x8165('0x35')][_0x8165('0x37')]?_0x2e6f9c[_0x8165('0x35')]:_0x4abd43['model'];_0x2e6f9c[_0x8165('0x3a')]=qs[_0x8165('0x3b')](_0x4dee92[_0x8165('0x31')][_0x8165('0x3b')]);_0x2e6f9c[_0x8165('0x3c')]=qs[_0x8165('0x33')](_[_0x8165('0x3d')](_0x4dee92['query'],_0x4abd43[_0x8165('0x33')]));if(_0x4dee92[_0x8165('0x31')][_0x8165('0x3e')]){_0x2e6f9c[_0x8165('0x3c')]=_[_0x8165('0x47')](_0x2e6f9c[_0x8165('0x3c')],{'$or':_[_0x8165('0x30')](_0x2e6f9c[_0x8165('0x35')],function(_0x2b7801){var _0x432659={};_0x432659[_0x2b7801]={'$like':'%'+_0x4dee92[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x432659;})});}_0x2e6f9c=_['merge']({},_0x2e6f9c,_0x4dee92[_0x8165('0x4c')]);return _0x1a8726['getDescriptions'](_0x2e6f9c);}})[_0x8165('0x24')](function(_0x2f69b2){if(_0x2f69b2){_0x136da1=_0x2f69b2[_0x8165('0x37')];if(!_0x4dee92['query'][_0x8165('0x38')](_0x8165('0x39'))){_0x2e6f9c[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x4dee92[_0x8165('0x31')][_0x8165('0x1d')]);_0x2e6f9c[_0x8165('0x1b')]=qs['offset'](_0x4dee92['query'][_0x8165('0x1b')]);}return _0x1a8726[_0x8165('0x50')](_0x2e6f9c);}})[_0x8165('0x24')](function(_0x57fc5f){if(_0x57fc5f){return _0x57fc5f?{'count':_0x136da1,'rows':_0x57fc5f}:null;}})[_0x8165('0x24')](respondWithResult(_0x16a35b,null))[_0x8165('0x42')](handleError(_0x16a35b,null));};exports[_0x8165('0x51')]=function(_0x5d83b1,_0x5728cd,_0x27470c){var _0x14a22b={};var _0x2107e6={};var _0xeac440;var _0x238538;return db[_0x8165('0x2b')]['findOne']({'where':{'id':_0x5d83b1['params']['id']}})[_0x8165('0x24')](handleEntityNotFound(_0x5728cd,null))[_0x8165('0x24')](function(_0x5e3a3a){if(_0x5e3a3a){_0xeac440=_0x5e3a3a;_0x2107e6[_0x8165('0x2f')]=_[_0x8165('0x32')](db[_0x8165('0x52')][_0x8165('0x2c')]);_0x2107e6[_0x8165('0x31')]=_[_0x8165('0x32')](_0x5d83b1[_0x8165('0x31')]);_0x2107e6[_0x8165('0x33')]=_[_0x8165('0x34')](_0x2107e6['model'],_0x2107e6[_0x8165('0x31')]);_0x14a22b[_0x8165('0x35')]=_[_0x8165('0x34')](_0x2107e6['model'],qs[_0x8165('0x36')](_0x5d83b1[_0x8165('0x31')][_0x8165('0x36')]));_0x14a22b[_0x8165('0x35')]=_0x14a22b[_0x8165('0x35')]['length']?_0x14a22b[_0x8165('0x35')]:_0x2107e6[_0x8165('0x2f')];_0x14a22b[_0x8165('0x3a')]=qs['sort'](_0x5d83b1[_0x8165('0x31')][_0x8165('0x3b')]);_0x14a22b[_0x8165('0x3c')]=qs[_0x8165('0x33')](_['pick'](_0x5d83b1[_0x8165('0x31')],_0x2107e6[_0x8165('0x33')]));if(_0x5d83b1[_0x8165('0x31')][_0x8165('0x3e')]){_0x14a22b[_0x8165('0x3c')]=_['merge'](_0x14a22b[_0x8165('0x3c')],{'$or':_['map'](_0x14a22b[_0x8165('0x35')],function(_0x42ec46){var _0x19c184={};_0x19c184[_0x42ec46]={'$like':'%'+_0x5d83b1[_0x8165('0x31')][_0x8165('0x3e')]+'%'};return _0x19c184;})});}_0x14a22b=_[_0x8165('0x47')]({},_0x14a22b,_0x5d83b1['options']);return _0xeac440['getTags'](_0x14a22b);}})[_0x8165('0x24')](function(_0x48e38b){if(_0x48e38b){_0x238538=_0x48e38b[_0x8165('0x37')];if(!_0x5d83b1[_0x8165('0x31')][_0x8165('0x38')](_0x8165('0x39'))){_0x14a22b[_0x8165('0x1d')]=qs[_0x8165('0x1d')](_0x5d83b1['query'][_0x8165('0x1d')]);_0x14a22b[_0x8165('0x1b')]=qs[_0x8165('0x1b')](_0x5d83b1['query'][_0x8165('0x1b')]);}return _0xeac440[_0x8165('0x51')](_0x14a22b);}})[_0x8165('0x24')](function(_0x16ed3d){if(_0x16ed3d){return _0x16ed3d?{'count':_0x238538,'rows':_0x16ed3d}:null;}})['then'](respondWithResult(_0x5728cd,null))[_0x8165('0x42')](handleError(_0x5728cd,null));};exports['setTags']=function(_0x59a76b,_0xcb9f44,_0x5728e3){if(_0x59a76b[_0x8165('0x4a')]['id']){delete _0x59a76b['body']['id'];}return db[_0x8165('0x2b')][_0x8165('0x4b')]({'where':{'id':_0x59a76b[_0x8165('0x44')]['id']}})['then'](handleEntityNotFound(_0xcb9f44,null))[_0x8165('0x24')](function(_0x36e624){if(_0x36e624){return _0x36e624[_0x8165('0x53')](_0x59a76b[_0x8165('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0xcb9f44,null))[_0x8165('0x42')](handleError(_0xcb9f44,null));}; \ No newline at end of file +var _0x9960=['merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','findOne','ZendeskField','order','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','filter'];(function(_0x332d10,_0x6e27d0){var _0x530603=function(_0x1f313a){while(--_0x1f313a){_0x332d10['push'](_0x332d10['shift']());}};_0x530603(++_0x6e27d0);}(_0x9960,0x10d));var _0x0996=function(_0x484599,_0x56224f){_0x484599=_0x484599-0x0;var _0x2c91f1=_0x9960[_0x484599];return _0x2c91f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0996('0x0'));var zipdir=require(_0x0996('0x1'));var jsonpatch=require(_0x0996('0x2'));var rp=require(_0x0996('0x3'));var moment=require(_0x0996('0x4'));var BPromise=require(_0x0996('0x5'));var Mustache=require(_0x0996('0x6'));var util=require(_0x0996('0x7'));var path=require(_0x0996('0x8'));var sox=require(_0x0996('0x9'));var csv=require(_0x0996('0xa'));var ejs=require(_0x0996('0xb'));var fs=require('fs');var fs_extra=require(_0x0996('0xc'));var _=require('lodash');var squel=require(_0x0996('0xd'));var crypto=require(_0x0996('0xe'));var jsforce=require(_0x0996('0xf'));var deskjs=require(_0x0996('0x10'));var toCsv=require(_0x0996('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0996('0x11'));var authService=require(_0x0996('0x12'));var qs=require(_0x0996('0x13'));var as=require(_0x0996('0x14'));var hardwareService=require(_0x0996('0x15'));var logger=require('../../config/logger')(_0x0996('0x16'));var utils=require('../../config/utils');var config=require(_0x0996('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0996('0x18'))['db'];function respondWithStatusCode(_0x5aa550,_0x45cd9e){_0x45cd9e=_0x45cd9e||0xcc;return function(_0x569327){if(_0x569327){return _0x5aa550['sendStatus'](_0x45cd9e);}return _0x5aa550[_0x0996('0x19')](_0x45cd9e)[_0x0996('0x1a')]();};}function respondWithResult(_0x1267d3,_0x314fb8){_0x314fb8=_0x314fb8||0xc8;return function(_0x1ea116){if(_0x1ea116){return _0x1267d3['status'](_0x314fb8)[_0x0996('0x1b')](_0x1ea116);}};}function respondWithFilteredResult(_0x461da9,_0x2e3da4){return function(_0x58b952){if(_0x58b952){var _0x1bf55f=typeof _0x2e3da4['offset']===_0x0996('0x1c')&&typeof _0x2e3da4[_0x0996('0x1d')]==='undefined';var _0x3cb441=_0x58b952[_0x0996('0x1e')];var _0x939fcc=_0x1bf55f?0x0:_0x2e3da4['offset'];var _0xb25a82=_0x1bf55f?_0x58b952[_0x0996('0x1e')]:_0x2e3da4['offset']+_0x2e3da4['limit'];var _0x241dc5;if(_0xb25a82>=_0x3cb441){_0xb25a82=_0x3cb441;_0x241dc5=0xc8;}else{_0x241dc5=0xce;}_0x461da9[_0x0996('0x19')](_0x241dc5);return _0x461da9[_0x0996('0x1f')]('Content-Range',_0x939fcc+'-'+_0xb25a82+'/'+_0x3cb441)[_0x0996('0x1b')](_0x58b952);}return null;};}function patchUpdates(_0x402952){return function(_0xc1071){try{jsonpatch[_0x0996('0x20')](_0xc1071,_0x402952,!![]);}catch(_0x463c74){return BPromise[_0x0996('0x21')](_0x463c74);}return _0xc1071[_0x0996('0x22')]();};}function saveUpdates(_0x25c42d,_0x2b8223){return function(_0x1f2c85){if(_0x1f2c85){return _0x1f2c85['update'](_0x25c42d)[_0x0996('0x23')](function(_0x1e4125){return _0x1e4125;});}return null;};}function removeEntity(_0x90e0c1,_0x553d7a){return function(_0x19493a){if(_0x19493a){return _0x19493a[_0x0996('0x24')]()[_0x0996('0x23')](function(){_0x90e0c1[_0x0996('0x19')](0xcc)[_0x0996('0x1a')]();});}};}function handleEntityNotFound(_0x1a35e4,_0x388a58){return function(_0x215478){if(!_0x215478){_0x1a35e4[_0x0996('0x25')](0x194);}return _0x215478;};}function handleError(_0x325614,_0x3b20ba){_0x3b20ba=_0x3b20ba||0x1f4;return function(_0x1e22fd){logger['error'](_0x1e22fd[_0x0996('0x26')]);if(_0x1e22fd['name']){delete _0x1e22fd[_0x0996('0x27')];}_0x325614[_0x0996('0x19')](_0x3b20ba)[_0x0996('0x28')](_0x1e22fd);};}exports['index']=function(_0x3830c8,_0x50323a){var _0x133216={},_0x2401e5={},_0x3e7108={'count':0x0,'rows':[]};var _0x3936d3=_[_0x0996('0x29')](db[_0x0996('0x2a')][_0x0996('0x2b')],function(_0x55a401){return{'name':_0x55a401[_0x0996('0x2c')],'type':_0x55a401[_0x0996('0x2d')][_0x0996('0x2e')]};});_0x2401e5[_0x0996('0x2f')]=_[_0x0996('0x29')](_0x3936d3,_0x0996('0x27'));_0x2401e5['query']=_['keys'](_0x3830c8[_0x0996('0x30')]);_0x2401e5[_0x0996('0x31')]=_[_0x0996('0x32')](_0x2401e5[_0x0996('0x2f')],_0x2401e5[_0x0996('0x30')]);_0x133216['attributes']=_[_0x0996('0x32')](_0x2401e5[_0x0996('0x2f')],qs['fields'](_0x3830c8[_0x0996('0x30')][_0x0996('0x33')]));_0x133216[_0x0996('0x34')]=_0x133216[_0x0996('0x34')][_0x0996('0x35')]?_0x133216['attributes']:_0x2401e5[_0x0996('0x2f')];if(!_0x3830c8[_0x0996('0x30')]['hasOwnProperty'](_0x0996('0x36'))){_0x133216[_0x0996('0x1d')]=qs[_0x0996('0x1d')](_0x3830c8['query'][_0x0996('0x1d')]);_0x133216['offset']=qs[_0x0996('0x37')](_0x3830c8[_0x0996('0x30')][_0x0996('0x37')]);}_0x133216['order']=qs[_0x0996('0x38')](_0x3830c8[_0x0996('0x30')]['sort']);_0x133216[_0x0996('0x39')]=qs[_0x0996('0x31')](_['pick'](_0x3830c8[_0x0996('0x30')],_0x2401e5[_0x0996('0x31')]),_0x3936d3);if(_0x3830c8[_0x0996('0x30')][_0x0996('0x3a')]){_0x133216['where']=_[_0x0996('0x3b')](_0x133216[_0x0996('0x39')],{'$or':_[_0x0996('0x29')](_0x3936d3,function(_0x441a4f){if(_0x441a4f[_0x0996('0x2d')]!=='VIRTUAL'){var _0x4f164e={};_0x4f164e[_0x441a4f['name']]={'$like':'%'+_0x3830c8[_0x0996('0x30')]['filter']+'%'};return _0x4f164e;}})});}_0x133216=_[_0x0996('0x3b')]({},_0x133216,_0x3830c8[_0x0996('0x3c')]);var _0x31fe25={'where':_0x133216[_0x0996('0x39')]};return db[_0x0996('0x2a')][_0x0996('0x1e')](_0x31fe25)[_0x0996('0x23')](function(_0x439142){_0x3e7108[_0x0996('0x1e')]=_0x439142;if(_0x3830c8[_0x0996('0x30')][_0x0996('0x3d')]){_0x133216[_0x0996('0x3e')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x133216);})['then'](function(_0x41d906){_0x3e7108[_0x0996('0x3f')]=_0x41d906;return _0x3e7108;})[_0x0996('0x23')](respondWithFilteredResult(_0x50323a,_0x133216))[_0x0996('0x40')](handleError(_0x50323a,null));};exports[_0x0996('0x41')]=function(_0x36a579,_0x556896){var _0x3d54f4={'raw':![],'where':{'id':_0x36a579[_0x0996('0x42')]['id']}},_0x5c8871={};_0x5c8871[_0x0996('0x2f')]=_[_0x0996('0x43')](db['ZendeskConfiguration'][_0x0996('0x2b')]);_0x5c8871[_0x0996('0x30')]=_[_0x0996('0x43')](_0x36a579[_0x0996('0x30')]);_0x5c8871[_0x0996('0x31')]=_['intersection'](_0x5c8871[_0x0996('0x2f')],_0x5c8871[_0x0996('0x30')]);_0x3d54f4[_0x0996('0x34')]=_[_0x0996('0x32')](_0x5c8871[_0x0996('0x2f')],qs[_0x0996('0x33')](_0x36a579[_0x0996('0x30')][_0x0996('0x33')]));_0x3d54f4[_0x0996('0x34')]=_0x3d54f4[_0x0996('0x34')][_0x0996('0x35')]?_0x3d54f4[_0x0996('0x34')]:_0x5c8871[_0x0996('0x2f')];if(_0x36a579[_0x0996('0x30')]['includeAll']){_0x3d54f4[_0x0996('0x3e')]=[{'all':!![]}];}_0x3d54f4=_[_0x0996('0x3b')]({},_0x3d54f4,_0x36a579[_0x0996('0x3c')]);return db['ZendeskConfiguration'][_0x0996('0x44')](_0x3d54f4)[_0x0996('0x23')](handleEntityNotFound(_0x556896,null))[_0x0996('0x23')](respondWithResult(_0x556896,null))[_0x0996('0x40')](handleError(_0x556896,null));};exports['create']=function(_0x1a3fc6,_0x339c0c){return db[_0x0996('0x2a')][_0x0996('0x45')](_0x1a3fc6[_0x0996('0x46')],{})['then'](respondWithResult(_0x339c0c,0xc9))['catch'](handleError(_0x339c0c,null));};exports['update']=function(_0x21af12,_0x200801){if(_0x21af12['body']['id']){delete _0x21af12['body']['id'];}return db[_0x0996('0x2a')]['find']({'where':{'id':_0x21af12[_0x0996('0x42')]['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x200801,null))['then'](saveUpdates(_0x21af12[_0x0996('0x46')],null))[_0x0996('0x23')](respondWithResult(_0x200801,null))[_0x0996('0x40')](handleError(_0x200801,null));};exports['destroy']=function(_0x154dca,_0x325635){return db[_0x0996('0x2a')][_0x0996('0x44')]({'where':{'id':_0x154dca[_0x0996('0x42')]['id']}})['then'](handleEntityNotFound(_0x325635,null))[_0x0996('0x23')](removeEntity(_0x325635,null))[_0x0996('0x40')](handleError(_0x325635,null));};exports[_0x0996('0x47')]=function(_0x4ede00,_0x3cf264,_0x297c3c){var _0x1ddeff={};var _0x5bd0bc={};var _0x50e331;var _0x24c346;return db[_0x0996('0x2a')][_0x0996('0x48')]({'where':{'id':_0x4ede00[_0x0996('0x42')]['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x3cf264,null))[_0x0996('0x23')](function(_0x388370){if(_0x388370){_0x50e331=_0x388370;_0x5bd0bc[_0x0996('0x2f')]=_[_0x0996('0x43')](db[_0x0996('0x49')][_0x0996('0x2b')]);_0x5bd0bc[_0x0996('0x30')]=_[_0x0996('0x43')](_0x4ede00[_0x0996('0x30')]);_0x5bd0bc[_0x0996('0x31')]=_[_0x0996('0x32')](_0x5bd0bc['model'],_0x5bd0bc['query']);_0x1ddeff[_0x0996('0x34')]=_[_0x0996('0x32')](_0x5bd0bc['model'],qs['fields'](_0x4ede00[_0x0996('0x30')][_0x0996('0x33')]));_0x1ddeff[_0x0996('0x34')]=_0x1ddeff[_0x0996('0x34')][_0x0996('0x35')]?_0x1ddeff[_0x0996('0x34')]:_0x5bd0bc[_0x0996('0x2f')];_0x1ddeff[_0x0996('0x4a')]=qs[_0x0996('0x38')](_0x4ede00[_0x0996('0x30')]['sort']);_0x1ddeff['where']=qs['filters'](_[_0x0996('0x4b')](_0x4ede00[_0x0996('0x30')],_0x5bd0bc['filters']));if(_0x4ede00[_0x0996('0x30')][_0x0996('0x3a')]){_0x1ddeff[_0x0996('0x39')]=_[_0x0996('0x3b')](_0x1ddeff[_0x0996('0x39')],{'$or':_[_0x0996('0x29')](_0x1ddeff['attributes'],function(_0x2a8176){var _0x7b5fe3={};_0x7b5fe3[_0x2a8176]={'$like':'%'+_0x4ede00[_0x0996('0x30')]['filter']+'%'};return _0x7b5fe3;})});}_0x1ddeff=_[_0x0996('0x3b')]({},_0x1ddeff,_0x4ede00[_0x0996('0x3c')]);return _0x50e331[_0x0996('0x47')](_0x1ddeff);}})['then'](function(_0x9863ca){if(_0x9863ca){_0x24c346=_0x9863ca['length'];if(!_0x4ede00[_0x0996('0x30')][_0x0996('0x4c')]('nolimit')){_0x1ddeff[_0x0996('0x1d')]=qs['limit'](_0x4ede00[_0x0996('0x30')][_0x0996('0x1d')]);_0x1ddeff[_0x0996('0x37')]=qs[_0x0996('0x37')](_0x4ede00[_0x0996('0x30')]['offset']);}return _0x50e331[_0x0996('0x47')](_0x1ddeff);}})['then'](function(_0x4f835f){if(_0x4f835f){return _0x4f835f?{'count':_0x24c346,'rows':_0x4f835f}:null;}})[_0x0996('0x23')](respondWithResult(_0x3cf264,null))['catch'](handleError(_0x3cf264,null));};exports[_0x0996('0x4d')]=function(_0x360da5,_0x360e35,_0x3a643f){var _0x35fa7e={};var _0x47c4f2={};var _0x334464;var _0x4f8a55;return db[_0x0996('0x2a')]['findOne']({'where':{'id':_0x360da5[_0x0996('0x42')]['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x360e35,null))[_0x0996('0x23')](function(_0x4bf56e){if(_0x4bf56e){_0x334464=_0x4bf56e;_0x47c4f2['model']=_[_0x0996('0x43')](db['ZendeskField'][_0x0996('0x2b')]);_0x47c4f2[_0x0996('0x30')]=_[_0x0996('0x43')](_0x360da5[_0x0996('0x30')]);_0x47c4f2[_0x0996('0x31')]=_[_0x0996('0x32')](_0x47c4f2[_0x0996('0x2f')],_0x47c4f2[_0x0996('0x30')]);_0x35fa7e['attributes']=_[_0x0996('0x32')](_0x47c4f2[_0x0996('0x2f')],qs[_0x0996('0x33')](_0x360da5[_0x0996('0x30')][_0x0996('0x33')]));_0x35fa7e[_0x0996('0x34')]=_0x35fa7e['attributes']['length']?_0x35fa7e[_0x0996('0x34')]:_0x47c4f2[_0x0996('0x2f')];_0x35fa7e['order']=qs['sort'](_0x360da5[_0x0996('0x30')][_0x0996('0x38')]);_0x35fa7e[_0x0996('0x39')]=qs[_0x0996('0x31')](_[_0x0996('0x4b')](_0x360da5[_0x0996('0x30')],_0x47c4f2[_0x0996('0x31')]));if(_0x360da5[_0x0996('0x30')][_0x0996('0x3a')]){_0x35fa7e[_0x0996('0x39')]=_[_0x0996('0x3b')](_0x35fa7e[_0x0996('0x39')],{'$or':_[_0x0996('0x29')](_0x35fa7e[_0x0996('0x34')],function(_0x4daf1e){var _0x38f624={};_0x38f624[_0x4daf1e]={'$like':'%'+_0x360da5[_0x0996('0x30')][_0x0996('0x3a')]+'%'};return _0x38f624;})});}_0x35fa7e=_[_0x0996('0x3b')]({},_0x35fa7e,_0x360da5[_0x0996('0x3c')]);return _0x334464[_0x0996('0x4d')](_0x35fa7e);}})[_0x0996('0x23')](function(_0x55fec5){if(_0x55fec5){_0x4f8a55=_0x55fec5[_0x0996('0x35')];if(!_0x360da5[_0x0996('0x30')][_0x0996('0x4c')](_0x0996('0x36'))){_0x35fa7e['limit']=qs[_0x0996('0x1d')](_0x360da5[_0x0996('0x30')][_0x0996('0x1d')]);_0x35fa7e['offset']=qs[_0x0996('0x37')](_0x360da5[_0x0996('0x30')][_0x0996('0x37')]);}return _0x334464[_0x0996('0x4d')](_0x35fa7e);}})[_0x0996('0x23')](function(_0x3ae499){if(_0x3ae499){return _0x3ae499?{'count':_0x4f8a55,'rows':_0x3ae499}:null;}})['then'](respondWithResult(_0x360e35,null))[_0x0996('0x40')](handleError(_0x360e35,null));};exports[_0x0996('0x4e')]=function(_0x12a32a,_0x7bca8,_0x333169){var _0x1fb4f2={};var _0x23c25a={};var _0x56074e;var _0x3e41f0;return db[_0x0996('0x2a')][_0x0996('0x48')]({'where':{'id':_0x12a32a['params']['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x7bca8,null))[_0x0996('0x23')](function(_0x325089){if(_0x325089){_0x56074e=_0x325089;_0x23c25a['model']=_[_0x0996('0x43')](db[_0x0996('0x49')]['rawAttributes']);_0x23c25a[_0x0996('0x30')]=_[_0x0996('0x43')](_0x12a32a[_0x0996('0x30')]);_0x23c25a[_0x0996('0x31')]=_[_0x0996('0x32')](_0x23c25a[_0x0996('0x2f')],_0x23c25a['query']);_0x1fb4f2[_0x0996('0x34')]=_[_0x0996('0x32')](_0x23c25a[_0x0996('0x2f')],qs[_0x0996('0x33')](_0x12a32a['query']['fields']));_0x1fb4f2[_0x0996('0x34')]=_0x1fb4f2[_0x0996('0x34')][_0x0996('0x35')]?_0x1fb4f2[_0x0996('0x34')]:_0x23c25a[_0x0996('0x2f')];_0x1fb4f2[_0x0996('0x4a')]=qs[_0x0996('0x38')](_0x12a32a[_0x0996('0x30')][_0x0996('0x38')]);_0x1fb4f2[_0x0996('0x39')]=qs[_0x0996('0x31')](_[_0x0996('0x4b')](_0x12a32a[_0x0996('0x30')],_0x23c25a[_0x0996('0x31')]));if(_0x12a32a['query']['filter']){_0x1fb4f2['where']=_[_0x0996('0x3b')](_0x1fb4f2[_0x0996('0x39')],{'$or':_[_0x0996('0x29')](_0x1fb4f2['attributes'],function(_0x593303){var _0xe4706d={};_0xe4706d[_0x593303]={'$like':'%'+_0x12a32a[_0x0996('0x30')][_0x0996('0x3a')]+'%'};return _0xe4706d;})});}_0x1fb4f2=_['merge']({},_0x1fb4f2,_0x12a32a[_0x0996('0x3c')]);return _0x56074e['getDescriptions'](_0x1fb4f2);}})['then'](function(_0x24beea){if(_0x24beea){_0x3e41f0=_0x24beea[_0x0996('0x35')];if(!_0x12a32a[_0x0996('0x30')][_0x0996('0x4c')](_0x0996('0x36'))){_0x1fb4f2[_0x0996('0x1d')]=qs[_0x0996('0x1d')](_0x12a32a[_0x0996('0x30')][_0x0996('0x1d')]);_0x1fb4f2[_0x0996('0x37')]=qs[_0x0996('0x37')](_0x12a32a[_0x0996('0x30')][_0x0996('0x37')]);}return _0x56074e['getDescriptions'](_0x1fb4f2);}})[_0x0996('0x23')](function(_0x25ee6e){if(_0x25ee6e){return _0x25ee6e?{'count':_0x3e41f0,'rows':_0x25ee6e}:null;}})[_0x0996('0x23')](respondWithResult(_0x7bca8,null))['catch'](handleError(_0x7bca8,null));};exports[_0x0996('0x4f')]=function(_0x3d034b,_0x3f891c,_0xd3b1ae){var _0x367d42={};var _0x595ad6={};var _0x50851c;var _0xfb79b8;return db[_0x0996('0x2a')][_0x0996('0x48')]({'where':{'id':_0x3d034b[_0x0996('0x42')]['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x3f891c,null))[_0x0996('0x23')](function(_0xb57e8){if(_0xb57e8){_0x50851c=_0xb57e8;_0x595ad6[_0x0996('0x2f')]=_[_0x0996('0x43')](db[_0x0996('0x50')]['rawAttributes']);_0x595ad6[_0x0996('0x30')]=_[_0x0996('0x43')](_0x3d034b['query']);_0x595ad6[_0x0996('0x31')]=_['intersection'](_0x595ad6[_0x0996('0x2f')],_0x595ad6[_0x0996('0x30')]);_0x367d42[_0x0996('0x34')]=_[_0x0996('0x32')](_0x595ad6['model'],qs[_0x0996('0x33')](_0x3d034b[_0x0996('0x30')][_0x0996('0x33')]));_0x367d42['attributes']=_0x367d42[_0x0996('0x34')]['length']?_0x367d42['attributes']:_0x595ad6[_0x0996('0x2f')];_0x367d42[_0x0996('0x4a')]=qs['sort'](_0x3d034b['query'][_0x0996('0x38')]);_0x367d42[_0x0996('0x39')]=qs[_0x0996('0x31')](_[_0x0996('0x4b')](_0x3d034b[_0x0996('0x30')],_0x595ad6['filters']));if(_0x3d034b['query']['filter']){_0x367d42[_0x0996('0x39')]=_[_0x0996('0x3b')](_0x367d42[_0x0996('0x39')],{'$or':_['map'](_0x367d42[_0x0996('0x34')],function(_0x4bf388){var _0x5d08f6={};_0x5d08f6[_0x4bf388]={'$like':'%'+_0x3d034b[_0x0996('0x30')][_0x0996('0x3a')]+'%'};return _0x5d08f6;})});}_0x367d42=_[_0x0996('0x3b')]({},_0x367d42,_0x3d034b['options']);return _0x50851c[_0x0996('0x4f')](_0x367d42);}})[_0x0996('0x23')](function(_0x435919){if(_0x435919){_0xfb79b8=_0x435919[_0x0996('0x35')];if(!_0x3d034b[_0x0996('0x30')]['hasOwnProperty'](_0x0996('0x36'))){_0x367d42[_0x0996('0x1d')]=qs[_0x0996('0x1d')](_0x3d034b[_0x0996('0x30')][_0x0996('0x1d')]);_0x367d42['offset']=qs['offset'](_0x3d034b[_0x0996('0x30')]['offset']);}return _0x50851c[_0x0996('0x4f')](_0x367d42);}})[_0x0996('0x23')](function(_0x3d1341){if(_0x3d1341){return _0x3d1341?{'count':_0xfb79b8,'rows':_0x3d1341}:null;}})[_0x0996('0x23')](respondWithResult(_0x3f891c,null))[_0x0996('0x40')](handleError(_0x3f891c,null));};exports['setTags']=function(_0xd914c1,_0x4c8b7c,_0x29d2b3){if(_0xd914c1[_0x0996('0x46')]['id']){delete _0xd914c1['body']['id'];}return db[_0x0996('0x2a')][_0x0996('0x48')]({'where':{'id':_0xd914c1['params']['id']}})[_0x0996('0x23')](handleEntityNotFound(_0x4c8b7c,null))[_0x0996('0x23')](function(_0x5ebb71){if(_0x5ebb71){return _0x5ebb71[_0x0996('0x51')](_0xd914c1[_0x0996('0x46')]['ids']||[]);}return null;})[_0x0996('0x23')](respondWithResult(_0x4c8b7c,null))[_0x0996('0x40')](handleError(_0x4c8b7c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 14acdbb..3462394 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 _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x29d813,_0x105d56){var _0x18a7c3=function(_0x2abd87){while(--_0x2abd87){_0x29d813['push'](_0x29d813['shift']());}};_0x18a7c3(++_0x105d56);}(_0x056b,0xb6));var _0xb056=function(_0x207696,_0x1cf674){_0x207696=_0x207696-0x0;var _0x4060f3=_0x056b[_0x207696];return _0x4060f3;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1eba=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x39fdb4,_0x387590){var _0x3b68f0=function(_0x22bbaf){while(--_0x22bbaf){_0x39fdb4['push'](_0x39fdb4['shift']());}};_0x3b68f0(++_0x387590);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x1eba[_0x2f227c];return _0x5032bc;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'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 8f6b77e..cb5d298 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 _0xeea4=['client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0xeea4,0x194));var _0x4eea=function(_0x2ade31,_0x2aeb74){_0x2ade31=_0x2ade31-0x0;var _0x558685=_0xeea4[_0x2ade31];return _0x558685;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var moment=require(_0x4eea('0x2'));var BPromise=require(_0x4eea('0x3'));var rs=require(_0x4eea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4eea('0x5'))['db'];var utils=require(_0x4eea('0x6'));var logger=require(_0x4eea('0x7'))(_0x4eea('0x8'));var config=require(_0x4eea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x927213,_0xe77ba6,_0x7521c4){return new BPromise(function(_0x43aa0c,_0x3b26e6){return client[_0x4eea('0xb')](_0x927213,_0x7521c4)[_0x4eea('0xc')](function(_0x41ead9){logger[_0x4eea('0xd')](_0x4eea('0xe'),_0xe77ba6,_0x4eea('0xf'));logger[_0x4eea('0x10')](_0x4eea('0x11'),_0xe77ba6,'request\x20sent',JSON[_0x4eea('0x12')](_0x41ead9));if(_0x41ead9[_0x4eea('0x13')]){if(_0x41ead9[_0x4eea('0x13')][_0x4eea('0x14')]===0x1f4){logger[_0x4eea('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x41ead9[_0x4eea('0x13')]['message']);return _0x3b26e6(_0x41ead9[_0x4eea('0x13')][_0x4eea('0x15')]);}logger[_0x4eea('0x13')](_0x4eea('0xe'),_0xe77ba6,_0x41ead9['error'][_0x4eea('0x15')]);return _0x43aa0c(_0x41ead9['error'][_0x4eea('0x15')]);}else{logger[_0x4eea('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x4eea('0xf'));_0x43aa0c(_0x41ead9['result']['message']);}})[_0x4eea('0x16')](function(_0x333d0b){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xe77ba6,_0x333d0b);_0x3b26e6(_0x333d0b);});});} \ No newline at end of file +var _0x1c7e=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x527bff,_0x366791){var _0x20d7d1=function(_0x1fa2da){while(--_0x1fa2da){_0x527bff['push'](_0x527bff['shift']());}};_0x20d7d1(++_0x366791);}(_0x1c7e,0x154));var _0xe1c7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1c7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xe1c7('0x0'));var moment=require(_0xe1c7('0x1'));var BPromise=require(_0xe1c7('0x2'));var rs=require(_0xe1c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1c7('0x5'))(_0xe1c7('0x6'));var config=require(_0xe1c7('0x7'));var jayson=require(_0xe1c7('0x8'));var client=jayson[_0xe1c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fadf6,_0x52b066,_0x3ce470){return new BPromise(function(_0x2d9c98,_0x16b6f4){return client[_0xe1c7('0xa')](_0x4fadf6,_0x3ce470)[_0xe1c7('0xb')](function(_0x32a376){logger['info'](_0xe1c7('0xc'),_0x52b066,_0xe1c7('0xd'));logger[_0xe1c7('0xe')](_0xe1c7('0xf'),_0x52b066,_0xe1c7('0xd'),JSON[_0xe1c7('0x10')](_0x32a376));if(_0x32a376[_0xe1c7('0x11')]){if(_0x32a376[_0xe1c7('0x11')]['code']===0x1f4){logger['error'](_0xe1c7('0xc'),_0x52b066,_0x32a376[_0xe1c7('0x11')][_0xe1c7('0x12')]);return _0x16b6f4(_0x32a376['error'][_0xe1c7('0x12')]);}logger[_0xe1c7('0x11')](_0xe1c7('0xc'),_0x52b066,_0x32a376[_0xe1c7('0x11')][_0xe1c7('0x12')]);return _0x2d9c98(_0x32a376['error'][_0xe1c7('0x12')]);}else{logger[_0xe1c7('0x13')](_0xe1c7('0xc'),_0x52b066,_0xe1c7('0xd'));_0x2d9c98(_0x32a376[_0xe1c7('0x14')][_0xe1c7('0x12')]);}})[_0xe1c7('0x15')](function(_0x14e281){logger[_0xe1c7('0x11')](_0xe1c7('0xc'),_0x52b066,_0x14e281);_0x16b6f4(_0x14e281);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 06dfee4..c778cb8 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 _0x9e09=['isAuthenticated','show','post','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id'];(function(_0x1bd646,_0x21803d){var _0xf9d22e=function(_0x30929c){while(--_0x30929c){_0x1bd646['push'](_0x1bd646['shift']());}};_0xf9d22e(++_0x21803d);}(_0x9e09,0x66));var _0x99e0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9e09[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x99e0('0x0'));var util=require(_0x99e0('0x1'));var path=require(_0x99e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x99e0('0x3'));var router=express['Router']();var fs_extra=require(_0x99e0('0x4'));var auth=require(_0x99e0('0x5'));var interaction=require(_0x99e0('0x6'));var config=require(_0x99e0('0x7'));var controller=require(_0x99e0('0x8'));router[_0x99e0('0x9')]('/',auth['isAuthenticated'](),controller[_0x99e0('0xa')]);router[_0x99e0('0x9')](_0x99e0('0xb'),auth[_0x99e0('0xc')](),controller[_0x99e0('0xd')]);router[_0x99e0('0xe')]('/',auth[_0x99e0('0xc')](),controller['create']);router[_0x99e0('0xf')]('/:id',auth[_0x99e0('0xc')](),controller[_0x99e0('0x10')]);router[_0x99e0('0x11')](_0x99e0('0xb'),auth[_0x99e0('0xc')](),controller['destroy']);module[_0x99e0('0x12')]=router; \ No newline at end of file +var _0xa3a0=['/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get'];(function(_0x1d3039,_0x5714c8){var _0x22e5f9=function(_0x178286){while(--_0x178286){_0x1d3039['push'](_0x1d3039['shift']());}};_0x22e5f9(++_0x5714c8);}(_0xa3a0,0xd9));var _0x0a3a=function(_0x449198,_0x4c97a5){_0x449198=_0x449198-0x0;var _0x1070c6=_0xa3a0[_0x449198];return _0x1070c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a3a('0x0'));var timeout=require(_0x0a3a('0x1'));var express=require(_0x0a3a('0x2'));var router=express['Router']();var fs_extra=require(_0x0a3a('0x3'));var auth=require(_0x0a3a('0x4'));var interaction=require(_0x0a3a('0x5'));var config=require(_0x0a3a('0x6'));var controller=require(_0x0a3a('0x7'));router['get']('/',auth[_0x0a3a('0x8')](),controller[_0x0a3a('0x9')]);router[_0x0a3a('0xa')](_0x0a3a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0a3a('0xc')]('/',auth[_0x0a3a('0x8')](),controller[_0x0a3a('0xd')]);router[_0x0a3a('0xe')]('/:id',auth[_0x0a3a('0x8')](),controller[_0x0a3a('0xf')]);router[_0x0a3a('0x10')](_0x0a3a('0xb'),auth['isAuthenticated'](),controller[_0x0a3a('0x11')]);module[_0x0a3a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 58bf624..66c1001 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 _0xec92=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xec92,0x121));var _0x2ec9=function(_0x1bb9be,_0x2fe99f){_0x1bb9be=_0x1bb9be-0x0;var _0x4f6b36=_0xec92[_0x1bb9be];return _0x4f6b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2ec9('0x0')](_0x2ec9('0x1'),_0x2ec9('0x2'),_0x2ec9('0x3'),'keyValue',_0x2ec9('0x4')),'defaultValue':_0x2ec9('0x1')},'content':{'type':Sequelize[_0x2ec9('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2ec9('0x0')]('string',_0x2ec9('0x2'),_0x2ec9('0x3'))},'keyContent':{'type':Sequelize[_0x2ec9('0x5')]},'idField':{'type':Sequelize[_0x2ec9('0x5')]},'nameField':{'type':Sequelize[_0x2ec9('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ec9('0x5')]}}; \ No newline at end of file +var _0xc5cf=['customVariable','picklist','ENUM','STRING','BOOLEAN','sequelize','string','variable'];(function(_0x51c73e,_0x38ad1f){var _0x5b4dd6=function(_0x192f54){while(--_0x192f54){_0x51c73e['push'](_0x51c73e['shift']());}};_0x5b4dd6(++_0x38ad1f);}(_0xc5cf,0x19d));var _0xfc5c=function(_0x443ea3,_0x564e22){_0x443ea3=_0x443ea3-0x0;var _0x18a360=_0xc5cf[_0x443ea3];return _0x18a360;};'use strict';var Sequelize=require(_0xfc5c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xfc5c('0x1'),_0xfc5c('0x2'),_0xfc5c('0x3'),'keyValue',_0xfc5c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfc5c('0x5')](_0xfc5c('0x1'),_0xfc5c('0x2'),_0xfc5c('0x3'))},'keyContent':{'type':Sequelize[_0xfc5c('0x6')]},'idField':{'type':Sequelize[_0xfc5c('0x6')]},'nameField':{'type':Sequelize[_0xfc5c('0x6')]},'customField':{'type':Sequelize[_0xfc5c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index e5cddd5..fee1a5d 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 _0xe9ff=['length','create','body','catch','find','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x526dc2,_0x37ebb8){var _0x54e521=function(_0x186bfb){while(--_0x186bfb){_0x526dc2['push'](_0x526dc2['shift']());}};_0x54e521(++_0x37ebb8);}(_0xe9ff,0x17c));var _0xfe9f=function(_0x166698,_0x3c779c){_0x166698=_0x166698-0x0;var _0x5905f3=_0xe9ff[_0x166698];return _0x5905f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe9f('0x0'));var rp=require('request-promise');var moment=require(_0xfe9f('0x1'));var BPromise=require(_0xfe9f('0x2'));var Mustache=require(_0xfe9f('0x3'));var util=require(_0xfe9f('0x4'));var path=require(_0xfe9f('0x5'));var sox=require(_0xfe9f('0x6'));var csv=require(_0xfe9f('0x7'));var ejs=require(_0xfe9f('0x8'));var fs=require('fs');var fs_extra=require(_0xfe9f('0x9'));var _=require(_0xfe9f('0xa'));var squel=require(_0xfe9f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe9f('0xc'));var toCsv=require(_0xfe9f('0x7'));var querystring=require(_0xfe9f('0xd'));var Papa=require(_0xfe9f('0xe'));var Redis=require('ioredis');var authService=require(_0xfe9f('0xf'));var qs=require(_0xfe9f('0x10'));var as=require(_0xfe9f('0x11'));var hardwareService=require(_0xfe9f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfe9f('0x13'));var config=require(_0xfe9f('0x14'));var licenseUtil=require(_0xfe9f('0x15'));var db=require(_0xfe9f('0x16'))['db'];function respondWithStatusCode(_0x118d31,_0x3a5b66){_0x3a5b66=_0x3a5b66||0xcc;return function(_0x49c897){if(_0x49c897){return _0x118d31[_0xfe9f('0x17')](_0x3a5b66);}return _0x118d31[_0xfe9f('0x18')](_0x3a5b66)[_0xfe9f('0x19')]();};}function respondWithResult(_0x2fda1a,_0x46777e){_0x46777e=_0x46777e||0xc8;return function(_0x556443){if(_0x556443){return _0x2fda1a[_0xfe9f('0x18')](_0x46777e)[_0xfe9f('0x1a')](_0x556443);}};}function respondWithFilteredResult(_0x515769,_0x501943){return function(_0x1d61a7){if(_0x1d61a7){var _0x14b9d0=typeof _0x501943[_0xfe9f('0x1b')]===_0xfe9f('0x1c')&&typeof _0x501943[_0xfe9f('0x1d')]==='undefined';var _0x349837=_0x1d61a7[_0xfe9f('0x1e')];var _0x92b2dd=_0x14b9d0?0x0:_0x501943[_0xfe9f('0x1b')];var _0x482355=_0x14b9d0?_0x1d61a7[_0xfe9f('0x1e')]:_0x501943[_0xfe9f('0x1b')]+_0x501943[_0xfe9f('0x1d')];var _0x236696;if(_0x482355>=_0x349837){_0x482355=_0x349837;_0x236696=0xc8;}else{_0x236696=0xce;}_0x515769[_0xfe9f('0x18')](_0x236696);return _0x515769[_0xfe9f('0x1f')](_0xfe9f('0x20'),_0x92b2dd+'-'+_0x482355+'/'+_0x349837)[_0xfe9f('0x1a')](_0x1d61a7);}return null;};}function patchUpdates(_0xf26af8){return function(_0x2992b1){try{jsonpatch[_0xfe9f('0x21')](_0x2992b1,_0xf26af8,!![]);}catch(_0x3401b1){return BPromise[_0xfe9f('0x22')](_0x3401b1);}return _0x2992b1[_0xfe9f('0x23')]();};}function saveUpdates(_0x7e84cc,_0x1d4bab){return function(_0x1a9e8b){if(_0x1a9e8b){return _0x1a9e8b[_0xfe9f('0x24')](_0x7e84cc)[_0xfe9f('0x25')](function(_0x44172c){return _0x44172c;});}return null;};}function removeEntity(_0x3d87dc,_0x56db1f){return function(_0x59bb68){if(_0x59bb68){return _0x59bb68[_0xfe9f('0x26')]()[_0xfe9f('0x25')](function(){_0x3d87dc[_0xfe9f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9298,_0x63372f){return function(_0x5dc218){if(!_0x5dc218){_0x3f9298[_0xfe9f('0x17')](0x194);}return _0x5dc218;};}function handleError(_0x3567e4,_0x436210){_0x436210=_0x436210||0x1f4;return function(_0x90772d){logger[_0xfe9f('0x27')](_0x90772d[_0xfe9f('0x28')]);if(_0x90772d[_0xfe9f('0x29')]){delete _0x90772d['name'];}_0x3567e4[_0xfe9f('0x18')](_0x436210)[_0xfe9f('0x2a')](_0x90772d);};}exports[_0xfe9f('0x2b')]=function(_0x3decc9,_0x4dc1ca){var _0x224fe2={},_0x4ed4da={},_0x6e0ca6={'count':0x0,'rows':[]};var _0x4118cf=_['map'](db[_0xfe9f('0x2c')][_0xfe9f('0x2d')],function(_0x19b224){return{'name':_0x19b224['fieldName'],'type':_0x19b224[_0xfe9f('0x2e')]['key']};});_0x4ed4da[_0xfe9f('0x2f')]=_[_0xfe9f('0x30')](_0x4118cf,_0xfe9f('0x29'));_0x4ed4da[_0xfe9f('0x31')]=_['keys'](_0x3decc9[_0xfe9f('0x31')]);_0x4ed4da['filters']=_[_0xfe9f('0x32')](_0x4ed4da[_0xfe9f('0x2f')],_0x4ed4da[_0xfe9f('0x31')]);_0x224fe2[_0xfe9f('0x33')]=_[_0xfe9f('0x32')](_0x4ed4da[_0xfe9f('0x2f')],qs[_0xfe9f('0x34')](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x34')]));_0x224fe2[_0xfe9f('0x33')]=_0x224fe2[_0xfe9f('0x33')]['length']?_0x224fe2[_0xfe9f('0x33')]:_0x4ed4da[_0xfe9f('0x2f')];if(!_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x35')](_0xfe9f('0x36'))){_0x224fe2['limit']=qs[_0xfe9f('0x1d')](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x1d')]);_0x224fe2[_0xfe9f('0x1b')]=qs['offset'](_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x1b')]);}_0x224fe2[_0xfe9f('0x37')]=qs[_0xfe9f('0x38')](_0x3decc9['query'][_0xfe9f('0x38')]);_0x224fe2[_0xfe9f('0x39')]=qs['filters'](_['pick'](_0x3decc9[_0xfe9f('0x31')],_0x4ed4da[_0xfe9f('0x3a')]),_0x4118cf);if(_0x3decc9['query'][_0xfe9f('0x3b')]){_0x224fe2['where']=_[_0xfe9f('0x3c')](_0x224fe2['where'],{'$or':_[_0xfe9f('0x30')](_0x4118cf,function(_0x59be94){if(_0x59be94['type']!==_0xfe9f('0x3d')){var _0x41c47f={};_0x41c47f[_0x59be94[_0xfe9f('0x29')]]={'$like':'%'+_0x3decc9['query'][_0xfe9f('0x3b')]+'%'};return _0x41c47f;}})});}_0x224fe2=_['merge']({},_0x224fe2,_0x3decc9[_0xfe9f('0x3e')]);var _0x4a396f={'where':_0x224fe2[_0xfe9f('0x39')]};return db[_0xfe9f('0x2c')][_0xfe9f('0x1e')](_0x4a396f)[_0xfe9f('0x25')](function(_0x3addb5){_0x6e0ca6[_0xfe9f('0x1e')]=_0x3addb5;if(_0x3decc9[_0xfe9f('0x31')][_0xfe9f('0x3f')]){_0x224fe2[_0xfe9f('0x40')]=[{'all':!![]}];}return db['ZendeskField'][_0xfe9f('0x41')](_0x224fe2);})[_0xfe9f('0x25')](function(_0x504665){_0x6e0ca6[_0xfe9f('0x42')]=_0x504665;return _0x6e0ca6;})[_0xfe9f('0x25')](respondWithFilteredResult(_0x4dc1ca,_0x224fe2))['catch'](handleError(_0x4dc1ca,null));};exports[_0xfe9f('0x43')]=function(_0x2606d7,_0x500526){var _0x3f5055={'raw':!![],'where':{'id':_0x2606d7[_0xfe9f('0x44')]['id']}},_0x172a71={};_0x172a71['model']=_[_0xfe9f('0x45')](db[_0xfe9f('0x2c')]['rawAttributes']);_0x172a71['query']=_[_0xfe9f('0x45')](_0x2606d7[_0xfe9f('0x31')]);_0x172a71[_0xfe9f('0x3a')]=_[_0xfe9f('0x32')](_0x172a71[_0xfe9f('0x2f')],_0x172a71[_0xfe9f('0x31')]);_0x3f5055[_0xfe9f('0x33')]=_['intersection'](_0x172a71[_0xfe9f('0x2f')],qs[_0xfe9f('0x34')](_0x2606d7[_0xfe9f('0x31')][_0xfe9f('0x34')]));_0x3f5055[_0xfe9f('0x33')]=_0x3f5055[_0xfe9f('0x33')][_0xfe9f('0x46')]?_0x3f5055[_0xfe9f('0x33')]:_0x172a71[_0xfe9f('0x2f')];if(_0x2606d7[_0xfe9f('0x31')]['includeAll']){_0x3f5055['include']=[{'all':!![]}];}_0x3f5055=_[_0xfe9f('0x3c')]({},_0x3f5055,_0x2606d7[_0xfe9f('0x3e')]);return db[_0xfe9f('0x2c')]['find'](_0x3f5055)['then'](handleEntityNotFound(_0x500526,null))[_0xfe9f('0x25')](respondWithResult(_0x500526,null))['catch'](handleError(_0x500526,null));};exports[_0xfe9f('0x47')]=function(_0xa36d3b,_0x117260){return db[_0xfe9f('0x2c')]['create'](_0xa36d3b[_0xfe9f('0x48')],{})[_0xfe9f('0x25')](respondWithResult(_0x117260,0xc9))[_0xfe9f('0x49')](handleError(_0x117260,null));};exports[_0xfe9f('0x24')]=function(_0x53d23a,_0x527271){if(_0x53d23a[_0xfe9f('0x48')]['id']){delete _0x53d23a[_0xfe9f('0x48')]['id'];}return db[_0xfe9f('0x2c')][_0xfe9f('0x4a')]({'where':{'id':_0x53d23a[_0xfe9f('0x44')]['id']}})['then'](handleEntityNotFound(_0x527271,null))[_0xfe9f('0x25')](saveUpdates(_0x53d23a[_0xfe9f('0x48')],null))[_0xfe9f('0x25')](respondWithResult(_0x527271,null))[_0xfe9f('0x49')](handleError(_0x527271,null));};exports[_0xfe9f('0x26')]=function(_0x2b1ef3,_0x1d9385){return db[_0xfe9f('0x2c')][_0xfe9f('0x4a')]({'where':{'id':_0x2b1ef3[_0xfe9f('0x44')]['id']}})[_0xfe9f('0x25')](handleEntityNotFound(_0x1d9385,null))['then'](removeEntity(_0x1d9385,null))[_0xfe9f('0x49')](handleError(_0x1d9385,null));}; \ No newline at end of file +var _0xbee3=['reject','save','destroy','then','end','error','stack','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','findAll','show','params','find','catch','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbee3,0x1dd));var _0x3bee=function(_0x473d2d,_0x11c56b){_0x473d2d=_0x473d2d-0x0;var _0x3cd9f9=_0xbee3[_0x473d2d];return _0x3cd9f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3bee('0x1'));var rp=require(_0x3bee('0x2'));var moment=require(_0x3bee('0x3'));var BPromise=require(_0x3bee('0x4'));var Mustache=require('mustache');var util=require(_0x3bee('0x5'));var path=require(_0x3bee('0x6'));var sox=require(_0x3bee('0x7'));var csv=require(_0x3bee('0x8'));var ejs=require(_0x3bee('0x9'));var fs=require('fs');var fs_extra=require(_0x3bee('0xa'));var _=require(_0x3bee('0xb'));var squel=require(_0x3bee('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3bee('0xd'));var toCsv=require(_0x3bee('0x8'));var querystring=require(_0x3bee('0xe'));var Papa=require(_0x3bee('0xf'));var Redis=require(_0x3bee('0x10'));var authService=require(_0x3bee('0x11'));var qs=require(_0x3bee('0x12'));var as=require(_0x3bee('0x13'));var hardwareService=require(_0x3bee('0x14'));var logger=require(_0x3bee('0x15'))(_0x3bee('0x16'));var utils=require(_0x3bee('0x17'));var config=require(_0x3bee('0x18'));var licenseUtil=require(_0x3bee('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2000eb,_0x360615){_0x360615=_0x360615||0xcc;return function(_0x38c4b4){if(_0x38c4b4){return _0x2000eb[_0x3bee('0x1a')](_0x360615);}return _0x2000eb[_0x3bee('0x1b')](_0x360615)['end']();};}function respondWithResult(_0x35659b,_0x2532ab){_0x2532ab=_0x2532ab||0xc8;return function(_0x7d4fd6){if(_0x7d4fd6){return _0x35659b[_0x3bee('0x1b')](_0x2532ab)[_0x3bee('0x1c')](_0x7d4fd6);}};}function respondWithFilteredResult(_0x30107d,_0xbc2a52){return function(_0x4ebf53){if(_0x4ebf53){var _0x1624d3=typeof _0xbc2a52[_0x3bee('0x1d')]===_0x3bee('0x1e')&&typeof _0xbc2a52['limit']==='undefined';var _0x48d83b=_0x4ebf53['count'];var _0x4656fb=_0x1624d3?0x0:_0xbc2a52[_0x3bee('0x1d')];var _0x524d18=_0x1624d3?_0x4ebf53[_0x3bee('0x1f')]:_0xbc2a52[_0x3bee('0x1d')]+_0xbc2a52[_0x3bee('0x20')];var _0x279334;if(_0x524d18>=_0x48d83b){_0x524d18=_0x48d83b;_0x279334=0xc8;}else{_0x279334=0xce;}_0x30107d[_0x3bee('0x1b')](_0x279334);return _0x30107d[_0x3bee('0x21')]('Content-Range',_0x4656fb+'-'+_0x524d18+'/'+_0x48d83b)[_0x3bee('0x1c')](_0x4ebf53);}return null;};}function patchUpdates(_0x2159c7){return function(_0x14930d){try{jsonpatch['apply'](_0x14930d,_0x2159c7,!![]);}catch(_0x313a29){return BPromise[_0x3bee('0x22')](_0x313a29);}return _0x14930d[_0x3bee('0x23')]();};}function saveUpdates(_0x108f33,_0x55b83c){return function(_0x4c93f3){if(_0x4c93f3){return _0x4c93f3['update'](_0x108f33)['then'](function(_0x820cf6){return _0x820cf6;});}return null;};}function removeEntity(_0x495134,_0x2f3bec){return function(_0x46c669){if(_0x46c669){return _0x46c669[_0x3bee('0x24')]()[_0x3bee('0x25')](function(){_0x495134['status'](0xcc)[_0x3bee('0x26')]();});}};}function handleEntityNotFound(_0x28e7a7,_0x2d7798){return function(_0x5907f9){if(!_0x5907f9){_0x28e7a7[_0x3bee('0x1a')](0x194);}return _0x5907f9;};}function handleError(_0x2c759e,_0x407b48){_0x407b48=_0x407b48||0x1f4;return function(_0x41d125){logger[_0x3bee('0x27')](_0x41d125[_0x3bee('0x28')]);if(_0x41d125['name']){delete _0x41d125[_0x3bee('0x29')];}_0x2c759e[_0x3bee('0x1b')](_0x407b48)['send'](_0x41d125);};}exports['index']=function(_0x2e5b8a,_0x657bd3){var _0x288d91={},_0x2b774a={},_0x4b7a50={'count':0x0,'rows':[]};var _0x300529=_[_0x3bee('0x2a')](db['ZendeskField'][_0x3bee('0x2b')],function(_0x2fd373){return{'name':_0x2fd373['fieldName'],'type':_0x2fd373[_0x3bee('0x2c')][_0x3bee('0x2d')]};});_0x2b774a[_0x3bee('0x2e')]=_[_0x3bee('0x2a')](_0x300529,_0x3bee('0x29'));_0x2b774a[_0x3bee('0x2f')]=_[_0x3bee('0x30')](_0x2e5b8a['query']);_0x2b774a[_0x3bee('0x31')]=_[_0x3bee('0x32')](_0x2b774a['model'],_0x2b774a['query']);_0x288d91['attributes']=_[_0x3bee('0x32')](_0x2b774a[_0x3bee('0x2e')],qs['fields'](_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x33')]));_0x288d91[_0x3bee('0x34')]=_0x288d91['attributes'][_0x3bee('0x35')]?_0x288d91[_0x3bee('0x34')]:_0x2b774a['model'];if(!_0x2e5b8a[_0x3bee('0x2f')]['hasOwnProperty'](_0x3bee('0x36'))){_0x288d91['limit']=qs[_0x3bee('0x20')](_0x2e5b8a['query']['limit']);_0x288d91[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x1d')]);}_0x288d91[_0x3bee('0x37')]=qs[_0x3bee('0x38')](_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x38')]);_0x288d91[_0x3bee('0x39')]=qs['filters'](_[_0x3bee('0x3a')](_0x2e5b8a[_0x3bee('0x2f')],_0x2b774a[_0x3bee('0x31')]),_0x300529);if(_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x3b')]){_0x288d91[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x288d91[_0x3bee('0x39')],{'$or':_[_0x3bee('0x2a')](_0x300529,function(_0x4bbc16){if(_0x4bbc16[_0x3bee('0x2c')]!==_0x3bee('0x3d')){var _0x3d3423={};_0x3d3423[_0x4bbc16[_0x3bee('0x29')]]={'$like':'%'+_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x3b')]+'%'};return _0x3d3423;}})});}_0x288d91=_[_0x3bee('0x3c')]({},_0x288d91,_0x2e5b8a[_0x3bee('0x3e')]);var _0x1de21e={'where':_0x288d91[_0x3bee('0x39')]};return db[_0x3bee('0x3f')][_0x3bee('0x1f')](_0x1de21e)[_0x3bee('0x25')](function(_0x1427f7){_0x4b7a50[_0x3bee('0x1f')]=_0x1427f7;if(_0x2e5b8a[_0x3bee('0x2f')][_0x3bee('0x40')]){_0x288d91[_0x3bee('0x41')]=[{'all':!![]}];}return db[_0x3bee('0x3f')][_0x3bee('0x42')](_0x288d91);})[_0x3bee('0x25')](function(_0x49b218){_0x4b7a50['rows']=_0x49b218;return _0x4b7a50;})[_0x3bee('0x25')](respondWithFilteredResult(_0x657bd3,_0x288d91))['catch'](handleError(_0x657bd3,null));};exports[_0x3bee('0x43')]=function(_0x2a24c8,_0x2a570a){var _0xcc160e={'raw':!![],'where':{'id':_0x2a24c8[_0x3bee('0x44')]['id']}},_0x440400={};_0x440400[_0x3bee('0x2e')]=_[_0x3bee('0x30')](db[_0x3bee('0x3f')]['rawAttributes']);_0x440400[_0x3bee('0x2f')]=_[_0x3bee('0x30')](_0x2a24c8[_0x3bee('0x2f')]);_0x440400['filters']=_[_0x3bee('0x32')](_0x440400['model'],_0x440400['query']);_0xcc160e[_0x3bee('0x34')]=_[_0x3bee('0x32')](_0x440400['model'],qs[_0x3bee('0x33')](_0x2a24c8['query'][_0x3bee('0x33')]));_0xcc160e[_0x3bee('0x34')]=_0xcc160e['attributes']['length']?_0xcc160e[_0x3bee('0x34')]:_0x440400[_0x3bee('0x2e')];if(_0x2a24c8[_0x3bee('0x2f')]['includeAll']){_0xcc160e[_0x3bee('0x41')]=[{'all':!![]}];}_0xcc160e=_['merge']({},_0xcc160e,_0x2a24c8['options']);return db[_0x3bee('0x3f')][_0x3bee('0x45')](_0xcc160e)['then'](handleEntityNotFound(_0x2a570a,null))['then'](respondWithResult(_0x2a570a,null))[_0x3bee('0x46')](handleError(_0x2a570a,null));};exports['create']=function(_0xbe1dc4,_0x280e95){return db['ZendeskField']['create'](_0xbe1dc4['body'],{})['then'](respondWithResult(_0x280e95,0xc9))[_0x3bee('0x46')](handleError(_0x280e95,null));};exports[_0x3bee('0x47')]=function(_0x275664,_0x3c57f0){if(_0x275664[_0x3bee('0x48')]['id']){delete _0x275664['body']['id'];}return db[_0x3bee('0x3f')]['find']({'where':{'id':_0x275664[_0x3bee('0x44')]['id']}})[_0x3bee('0x25')](handleEntityNotFound(_0x3c57f0,null))['then'](saveUpdates(_0x275664[_0x3bee('0x48')],null))[_0x3bee('0x25')](respondWithResult(_0x3c57f0,null))[_0x3bee('0x46')](handleError(_0x3c57f0,null));};exports[_0x3bee('0x24')]=function(_0xaef4f0,_0xee3f0f){return db[_0x3bee('0x3f')][_0x3bee('0x45')]({'where':{'id':_0xaef4f0['params']['id']}})[_0x3bee('0x25')](handleEntityNotFound(_0xee3f0f,null))[_0x3bee('0x25')](removeEntity(_0xee3f0f,null))['catch'](handleError(_0xee3f0f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index df328c2..9ace6ce 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 _0x7ae7=['define','ZendeskField','zendesk_unique_index','idField','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x5c6c46,_0x9770b2){var _0x2684cf=function(_0x4fa41c){while(--_0x4fa41c){_0x5c6c46['push'](_0x5c6c46['shift']());}};_0x2684cf(++_0x9770b2);}(_0x7ae7,0x93));var _0x77ae=function(_0x381df6,_0x190833){_0x381df6=_0x381df6-0x0;var _0x26be31=_0x7ae7[_0x381df6];return _0x26be31;};'use strict';var _=require(_0x77ae('0x0'));var util=require('util');var logger=require(_0x77ae('0x1'))(_0x77ae('0x2'));var moment=require(_0x77ae('0x3'));var BPromise=require('bluebird');var rp=require(_0x77ae('0x4'));var fs=require('fs');var path=require(_0x77ae('0x5'));var rimraf=require(_0x77ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x77ae('0x7'));module[_0x77ae('0x8')]=function(_0x3a9099,_0x373a63){return _0x3a9099[_0x77ae('0x9')](_0x77ae('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x77ae('0xb'),'fields':[_0x77ae('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55c3=['path','rimraf','../../config/environment','./intZendeskField.attributes','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x35a384,_0x28b298){var _0x8345a=function(_0x365398){while(--_0x365398){_0x35a384['push'](_0x35a384['shift']());}};_0x8345a(++_0x28b298);}(_0x55c3,0x158));var _0x355c=function(_0x5330e3,_0x3c8d7b){_0x5330e3=_0x5330e3-0x0;var _0x387b4d=_0x55c3[_0x5330e3];return _0x387b4d;};'use strict';var _=require(_0x355c('0x0'));var util=require(_0x355c('0x1'));var logger=require(_0x355c('0x2'))(_0x355c('0x3'));var moment=require(_0x355c('0x4'));var BPromise=require('bluebird');var rp=require(_0x355c('0x5'));var fs=require('fs');var path=require(_0x355c('0x6'));var rimraf=require(_0x355c('0x7'));var config=require(_0x355c('0x8'));var attributes=require(_0x355c('0x9'));module['exports']=function(_0x54276c,_0x2cfc2b){return _0x54276c['define'](_0x355c('0xa'),attributes,{'tableName':_0x355c('0xb'),'paranoid':![],'indexes':[{'name':_0x355c('0xc'),'fields':[_0x355c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 42e4b59..5eb5be0 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 _0x40a3=['info','ZendeskField,\x20%s,\x20%s','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x4383f6,_0x28ac9a){var _0x21747b=function(_0x3d365a){while(--_0x3d365a){_0x4383f6['push'](_0x4383f6['shift']());}};_0x21747b(++_0x28ac9a);}(_0x40a3,0x16f));var _0x340a=function(_0x31a9a6,_0x5db0ca){_0x31a9a6=_0x31a9a6-0x0;var _0x57ab92=_0x40a3[_0x31a9a6];return _0x57ab92;};'use strict';var _=require(_0x340a('0x0'));var util=require(_0x340a('0x1'));var moment=require(_0x340a('0x2'));var BPromise=require(_0x340a('0x3'));var rs=require(_0x340a('0x4'));var fs=require('fs');var Redis=require(_0x340a('0x5'));var db=require(_0x340a('0x6'))['db'];var utils=require(_0x340a('0x7'));var logger=require('../../config/logger')(_0x340a('0x8'));var config=require('../../config/environment');var jayson=require(_0x340a('0x9'));var client=jayson[_0x340a('0xa')][_0x340a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36769d,_0x4358c8,_0x43afb9){return new BPromise(function(_0x49bc59,_0x2b097f){return client[_0x340a('0xc')](_0x36769d,_0x43afb9)['then'](function(_0x4e7867){logger[_0x340a('0xd')](_0x340a('0xe'),_0x4358c8,'request\x20sent');logger[_0x340a('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4358c8,'request\x20sent',JSON['stringify'](_0x4e7867));if(_0x4e7867['error']){if(_0x4e7867[_0x340a('0x10')][_0x340a('0x11')]===0x1f4){logger[_0x340a('0x10')](_0x340a('0xe'),_0x4358c8,_0x4e7867[_0x340a('0x10')]['message']);return _0x2b097f(_0x4e7867[_0x340a('0x10')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x4358c8,_0x4e7867[_0x340a('0x10')][_0x340a('0x12')]);return _0x49bc59(_0x4e7867[_0x340a('0x10')][_0x340a('0x12')]);}else{logger['info'](_0x340a('0xe'),_0x4358c8,'request\x20sent');_0x49bc59(_0x4e7867[_0x340a('0x13')][_0x340a('0x12')]);}})['catch'](function(_0x14a873){logger['error'](_0x340a('0xe'),_0x4358c8,_0x14a873);_0x2b097f(_0x14a873);});});} \ No newline at end of file +var _0x5958=['error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x5958,0x1d2));var _0x8595=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x5958[_0x2405bc];return _0x5272d4;};'use strict';var _=require('lodash');var util=require(_0x8595('0x0'));var moment=require(_0x8595('0x1'));var BPromise=require(_0x8595('0x2'));var rs=require(_0x8595('0x3'));var fs=require('fs');var Redis=require(_0x8595('0x4'));var db=require(_0x8595('0x5'))['db'];var utils=require(_0x8595('0x6'));var logger=require(_0x8595('0x7'))(_0x8595('0x8'));var config=require('../../config/environment');var jayson=require(_0x8595('0x9'));var client=jayson[_0x8595('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f40c3,_0x7295fd,_0x36e514){return new BPromise(function(_0xa1c4b,_0x44df65){return client['request'](_0x3f40c3,_0x36e514)[_0x8595('0xb')](function(_0x3cbf67){logger[_0x8595('0xc')](_0x8595('0xd'),_0x7295fd,_0x8595('0xe'));logger[_0x8595('0xf')](_0x8595('0x10'),_0x7295fd,_0x8595('0xe'),JSON['stringify'](_0x3cbf67));if(_0x3cbf67[_0x8595('0x11')]){if(_0x3cbf67['error'][_0x8595('0x12')]===0x1f4){logger[_0x8595('0x11')](_0x8595('0xd'),_0x7295fd,_0x3cbf67[_0x8595('0x11')]['message']);return _0x44df65(_0x3cbf67[_0x8595('0x11')][_0x8595('0x13')]);}logger[_0x8595('0x11')](_0x8595('0xd'),_0x7295fd,_0x3cbf67['error'][_0x8595('0x13')]);return _0xa1c4b(_0x3cbf67[_0x8595('0x11')][_0x8595('0x13')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x7295fd,_0x8595('0xe'));_0xa1c4b(_0x3cbf67[_0x8595('0x14')][_0x8595('0x13')]);}})['catch'](function(_0x274d21){logger[_0x8595('0x11')](_0x8595('0xd'),_0x7295fd,_0x274d21);_0x44df65(_0x274d21);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ab81dc0..4536b86 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 _0x18f3=['/:id/configurations','getConfigurations','getFields','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x387ab7,_0x35cedb){var _0x37bc6f=function(_0x39f529){while(--_0x39f529){_0x387ab7['push'](_0x387ab7['shift']());}};_0x37bc6f(++_0x35cedb);}(_0x18f3,0x161));var _0x318f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x18f3[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x318f('0x0'));var util=require(_0x318f('0x1'));var path=require(_0x318f('0x2'));var timeout=require(_0x318f('0x3'));var express=require(_0x318f('0x4'));var router=express['Router']();var fs_extra=require(_0x318f('0x5'));var auth=require(_0x318f('0x6'));var interaction=require(_0x318f('0x7'));var config=require(_0x318f('0x8'));var controller=require(_0x318f('0x9'));router[_0x318f('0xa')]('/',auth[_0x318f('0xb')](),controller[_0x318f('0xc')]);router[_0x318f('0xa')](_0x318f('0xd'),auth['isAuthenticated'](),controller[_0x318f('0xe')]);router['get'](_0x318f('0xf'),auth[_0x318f('0xb')](),controller[_0x318f('0x10')]);router[_0x318f('0xa')]('/:id/fields',auth[_0x318f('0xb')](),controller[_0x318f('0x11')]);router[_0x318f('0x12')]('/',auth[_0x318f('0xb')](),controller[_0x318f('0x13')]);router[_0x318f('0x12')]('/:id/configurations',auth[_0x318f('0xb')](),controller['addConfiguration']);router[_0x318f('0x14')]('/:id',auth[_0x318f('0xb')](),controller[_0x318f('0x15')]);router['delete']('/:id',auth[_0x318f('0xb')](),controller[_0x318f('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1e3b=['get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','put','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x263cbe,_0x3e7627){var _0x3b6bb3=function(_0x450a4a){while(--_0x450a4a){_0x263cbe['push'](_0x263cbe['shift']());}};_0x3b6bb3(++_0x3e7627);}(_0x1e3b,0x1e7));var _0xb1e3=function(_0x39dbab,_0xfab5f1){_0x39dbab=_0x39dbab-0x0;var _0x3b4a53=_0x1e3b[_0x39dbab];return _0x3b4a53;};'use strict';var multer=require(_0xb1e3('0x0'));var util=require(_0xb1e3('0x1'));var path=require(_0xb1e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1e3('0x3'));var router=express[_0xb1e3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb1e3('0x5'));var config=require(_0xb1e3('0x6'));var controller=require('./intZohoAccount.controller');router[_0xb1e3('0x7')]('/',auth[_0xb1e3('0x8')](),controller['index']);router[_0xb1e3('0x7')](_0xb1e3('0x9'),auth[_0xb1e3('0x8')](),controller[_0xb1e3('0xa')]);router['get'](_0xb1e3('0xb'),auth[_0xb1e3('0x8')](),controller['getConfigurations']);router[_0xb1e3('0x7')](_0xb1e3('0xc'),auth[_0xb1e3('0x8')](),controller[_0xb1e3('0xd')]);router['post']('/',auth[_0xb1e3('0x8')](),controller[_0xb1e3('0xe')]);router[_0xb1e3('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb1e3('0x10')](_0xb1e3('0x9'),auth[_0xb1e3('0x8')](),controller['update']);router[_0xb1e3('0x11')](_0xb1e3('0x9'),auth[_0xb1e3('0x8')](),controller['destroy']);module[_0xb1e3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ed4bbba..15c4b00 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(_0x128e76,_0x8a9c92){var _0x42ef27=function(_0x39d4ee){while(--_0x39d4ee){_0x128e76['push'](_0x128e76['shift']());}};_0x42ef27(++_0x8a9c92);}(_0x6c76,0x184));var _0x66c7=function(_0x2a4e3c,_0x3fc3fe){_0x2a4e3c=_0x2a4e3c-0x0;var _0x37c234=_0x6c76[_0x2a4e3c];return _0x37c234;};'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 _0x153f=['exports','STRING','sequelize'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x153f,0x15b));var _0xf153=function(_0x55983e,_0x1cd6d9){_0x55983e=_0x55983e-0x0;var _0x43fca0=_0x153f[_0x55983e];return _0x43fca0;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f55e197..d5ac3de 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 _0x6dc4=['order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','body','catch','update','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','getSubjects','channel','getDescriptions','create','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','save','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x77850a,_0x2fc4a6){var _0x24bdef=function(_0x17d6a5){while(--_0x17d6a5){_0x77850a['push'](_0x77850a['shift']());}};_0x24bdef(++_0x2fc4a6);}(_0x6dc4,0xc5));var _0x46dc=function(_0x33127f,_0x1eafed){_0x33127f=_0x33127f-0x0;var _0x3c469f=_0x6dc4[_0x33127f];return _0x3c469f;};'use strict';var emlformat=require(_0x46dc('0x0'));var rimraf=require(_0x46dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46dc('0x2'));var rp=require(_0x46dc('0x3'));var moment=require(_0x46dc('0x4'));var BPromise=require(_0x46dc('0x5'));var Mustache=require(_0x46dc('0x6'));var util=require('util');var path=require(_0x46dc('0x7'));var sox=require(_0x46dc('0x8'));var csv=require(_0x46dc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46dc('0xa'));var _=require('lodash');var squel=require(_0x46dc('0xb'));var crypto=require(_0x46dc('0xc'));var jsforce=require(_0x46dc('0xd'));var deskjs=require(_0x46dc('0xe'));var toCsv=require(_0x46dc('0x9'));var querystring=require(_0x46dc('0xf'));var Papa=require(_0x46dc('0x10'));var Redis=require('ioredis');var authService=require(_0x46dc('0x11'));var qs=require(_0x46dc('0x12'));var as=require(_0x46dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x46dc('0x14'));var utils=require(_0x46dc('0x15'));var config=require(_0x46dc('0x16'));var licenseUtil=require(_0x46dc('0x17'));var db=require(_0x46dc('0x18'))['db'];var integrations=require(_0x46dc('0x19'));function respondWithStatusCode(_0x4837d4,_0x29b1c9){_0x29b1c9=_0x29b1c9||0xcc;return function(_0x1379fb){if(_0x1379fb){return _0x4837d4[_0x46dc('0x1a')](_0x29b1c9);}return _0x4837d4[_0x46dc('0x1b')](_0x29b1c9)['end']();};}function respondWithResult(_0x23c8db,_0x365f40){_0x365f40=_0x365f40||0xc8;return function(_0x2b41fa){if(_0x2b41fa){return _0x23c8db['status'](_0x365f40)[_0x46dc('0x1c')](_0x2b41fa);}};}function respondWithFilteredResult(_0x5bbb2c,_0x4cb4f8){return function(_0x231411){if(_0x231411){var _0x2dba35=typeof _0x4cb4f8[_0x46dc('0x1d')]===_0x46dc('0x1e')&&typeof _0x4cb4f8[_0x46dc('0x1f')]===_0x46dc('0x1e');var _0xac7d28=_0x231411[_0x46dc('0x20')];var _0x5e0219=_0x2dba35?0x0:_0x4cb4f8[_0x46dc('0x1d')];var _0x267364=_0x2dba35?_0x231411['count']:_0x4cb4f8[_0x46dc('0x1d')]+_0x4cb4f8['limit'];var _0x4c0457;if(_0x267364>=_0xac7d28){_0x267364=_0xac7d28;_0x4c0457=0xc8;}else{_0x4c0457=0xce;}_0x5bbb2c[_0x46dc('0x1b')](_0x4c0457);return _0x5bbb2c['set']('Content-Range',_0x5e0219+'-'+_0x267364+'/'+_0xac7d28)['json'](_0x231411);}return null;};}function patchUpdates(_0x2b0f0b){return function(_0x353134){try{jsonpatch[_0x46dc('0x21')](_0x353134,_0x2b0f0b,!![]);}catch(_0x289d22){return BPromise['reject'](_0x289d22);}return _0x353134[_0x46dc('0x22')]();};}function saveUpdates(_0xf0683a,_0x4f9c34){return function(_0x1e9423){if(_0x1e9423){return _0x1e9423['update'](_0xf0683a)[_0x46dc('0x23')](function(_0x314cdf){return _0x314cdf;});}return null;};}function removeEntity(_0x5b28ef,_0x2964a4){return function(_0x59868c){if(_0x59868c){return _0x59868c[_0x46dc('0x24')]()[_0x46dc('0x23')](function(){_0x5b28ef[_0x46dc('0x1b')](0xcc)[_0x46dc('0x25')]();});}};}function handleEntityNotFound(_0x244597,_0x43e6ab){return function(_0x447653){if(!_0x447653){_0x244597[_0x46dc('0x1a')](0x194);}return _0x447653;};}function handleError(_0x1f0e85,_0x2acb2b){_0x2acb2b=_0x2acb2b||0x1f4;return function(_0x305a1b){logger[_0x46dc('0x26')](_0x305a1b[_0x46dc('0x27')]);if(_0x305a1b['name']){delete _0x305a1b[_0x46dc('0x28')];}_0x1f0e85[_0x46dc('0x1b')](_0x2acb2b)[_0x46dc('0x29')](_0x305a1b);};}exports[_0x46dc('0x2a')]=function(_0x584b6a,_0x2f01b2){var _0xffc665={},_0x342f82={},_0x36cb40={'count':0x0,'rows':[]};var _0x2b8091=_[_0x46dc('0x2b')](db[_0x46dc('0x2c')][_0x46dc('0x2d')],function(_0x7f967d){return{'name':_0x7f967d[_0x46dc('0x2e')],'type':_0x7f967d['type']['key']};});_0x342f82[_0x46dc('0x2f')]=_['map'](_0x2b8091,_0x46dc('0x28'));_0x342f82['query']=_[_0x46dc('0x30')](_0x584b6a[_0x46dc('0x31')]);_0x342f82[_0x46dc('0x32')]=_[_0x46dc('0x33')](_0x342f82[_0x46dc('0x2f')],_0x342f82[_0x46dc('0x31')]);_0xffc665['attributes']=_[_0x46dc('0x33')](_0x342f82[_0x46dc('0x2f')],qs[_0x46dc('0x34')](_0x584b6a['query'][_0x46dc('0x34')]));_0xffc665[_0x46dc('0x35')]=_0xffc665[_0x46dc('0x35')][_0x46dc('0x36')]?_0xffc665[_0x46dc('0x35')]:_0x342f82[_0x46dc('0x2f')];if(!_0x584b6a[_0x46dc('0x31')][_0x46dc('0x37')](_0x46dc('0x38'))){_0xffc665[_0x46dc('0x1f')]=qs[_0x46dc('0x1f')](_0x584b6a['query'][_0x46dc('0x1f')]);_0xffc665['offset']=qs[_0x46dc('0x1d')](_0x584b6a[_0x46dc('0x31')][_0x46dc('0x1d')]);}_0xffc665[_0x46dc('0x39')]=qs['sort'](_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3a')]);_0xffc665[_0x46dc('0x3b')]=qs[_0x46dc('0x32')](_[_0x46dc('0x3c')](_0x584b6a['query'],_0x342f82[_0x46dc('0x32')]),_0x2b8091);if(_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3d')]){_0xffc665[_0x46dc('0x3b')]=_[_0x46dc('0x3e')](_0xffc665[_0x46dc('0x3b')],{'$or':_[_0x46dc('0x2b')](_0x2b8091,function(_0x3107b7){if(_0x3107b7[_0x46dc('0x3f')]!=='VIRTUAL'){var _0x583855={};_0x583855[_0x3107b7[_0x46dc('0x28')]]={'$like':'%'+_0x584b6a[_0x46dc('0x31')][_0x46dc('0x3d')]+'%'};return _0x583855;}})});}_0xffc665=_[_0x46dc('0x3e')]({},_0xffc665,_0x584b6a[_0x46dc('0x40')]);var _0x4af48c={'where':_0xffc665[_0x46dc('0x3b')]};return db[_0x46dc('0x2c')][_0x46dc('0x20')](_0x4af48c)[_0x46dc('0x23')](function(_0x245f66){_0x36cb40['count']=_0x245f66;if(_0x584b6a[_0x46dc('0x31')][_0x46dc('0x41')]){_0xffc665[_0x46dc('0x42')]=[{'all':!![]}];}return db[_0x46dc('0x2c')]['findAll'](_0xffc665);})[_0x46dc('0x23')](function(_0xcb145d){_0x36cb40[_0x46dc('0x43')]=_0xcb145d;return _0x36cb40;})[_0x46dc('0x23')](respondWithFilteredResult(_0x2f01b2,_0xffc665))['catch'](handleError(_0x2f01b2,null));};exports[_0x46dc('0x44')]=function(_0x12ce9d,_0x19e71c){var _0x4c4b7e={'raw':![],'where':{'id':_0x12ce9d[_0x46dc('0x45')]['id']}},_0x3a2c29={};_0x3a2c29['model']=_[_0x46dc('0x30')](db['ZohoAccount'][_0x46dc('0x2d')]);_0x3a2c29[_0x46dc('0x31')]=_[_0x46dc('0x30')](_0x12ce9d[_0x46dc('0x31')]);_0x3a2c29[_0x46dc('0x32')]=_['intersection'](_0x3a2c29[_0x46dc('0x2f')],_0x3a2c29[_0x46dc('0x31')]);_0x4c4b7e[_0x46dc('0x35')]=_[_0x46dc('0x33')](_0x3a2c29['model'],qs[_0x46dc('0x34')](_0x12ce9d[_0x46dc('0x31')]['fields']));_0x4c4b7e[_0x46dc('0x35')]=_0x4c4b7e[_0x46dc('0x35')]['length']?_0x4c4b7e[_0x46dc('0x35')]:_0x3a2c29[_0x46dc('0x2f')];if(_0x12ce9d[_0x46dc('0x31')][_0x46dc('0x41')]){_0x4c4b7e['include']=[{'all':!![]}];}_0x4c4b7e=_[_0x46dc('0x3e')]({},_0x4c4b7e,_0x12ce9d[_0x46dc('0x40')]);return db['ZohoAccount']['find'](_0x4c4b7e)[_0x46dc('0x23')](handleEntityNotFound(_0x19e71c,null))[_0x46dc('0x23')](respondWithResult(_0x19e71c,null))['catch'](handleError(_0x19e71c,null));};exports['create']=function(_0x1eeba6,_0xc53fba){return db[_0x46dc('0x2c')]['create'](_0x1eeba6[_0x46dc('0x46')],{})['then'](respondWithResult(_0xc53fba,0xc9))[_0x46dc('0x47')](handleError(_0xc53fba,null));};exports[_0x46dc('0x48')]=function(_0x3fe770,_0x369e0d){if(_0x3fe770[_0x46dc('0x46')]['id']){delete _0x3fe770[_0x46dc('0x46')]['id'];}return db[_0x46dc('0x2c')][_0x46dc('0x49')]({'where':{'id':_0x3fe770[_0x46dc('0x45')]['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x369e0d,null))[_0x46dc('0x23')](saveUpdates(_0x3fe770[_0x46dc('0x46')],null))[_0x46dc('0x23')](respondWithResult(_0x369e0d,null))['catch'](handleError(_0x369e0d,null));};exports['destroy']=function(_0x1198b0,_0x3907aa){return db[_0x46dc('0x2c')][_0x46dc('0x49')]({'where':{'id':_0x1198b0['params']['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x3907aa,null))[_0x46dc('0x23')](removeEntity(_0x3907aa,null))['catch'](handleError(_0x3907aa,null));};exports[_0x46dc('0x4a')]=function(_0x10b696,_0x358a3f,_0x5b8522){var _0xff6024={};var _0x2e703b={};var _0x302e5f;var _0x5edfee;return db['ZohoAccount'][_0x46dc('0x4b')]({'where':{'id':_0x10b696[_0x46dc('0x45')]['id']}})[_0x46dc('0x23')](handleEntityNotFound(_0x358a3f,null))[_0x46dc('0x23')](function(_0xd5eace){if(_0xd5eace){_0x302e5f=_0xd5eace;_0x2e703b['model']=_[_0x46dc('0x30')](db[_0x46dc('0x4c')]['rawAttributes']);_0x2e703b['query']=_['keys'](_0x10b696[_0x46dc('0x31')]);_0x2e703b[_0x46dc('0x32')]=_[_0x46dc('0x33')](_0x2e703b['model'],_0x2e703b[_0x46dc('0x31')]);_0xff6024['attributes']=_[_0x46dc('0x33')](_0x2e703b[_0x46dc('0x2f')],qs['fields'](_0x10b696[_0x46dc('0x31')][_0x46dc('0x34')]));_0xff6024['attributes']=_0xff6024[_0x46dc('0x35')][_0x46dc('0x36')]?_0xff6024[_0x46dc('0x35')]:_0x2e703b[_0x46dc('0x2f')];_0xff6024['order']=qs[_0x46dc('0x3a')](_0x10b696['query'][_0x46dc('0x3a')]);_0xff6024[_0x46dc('0x3b')]=qs[_0x46dc('0x32')](_[_0x46dc('0x3c')](_0x10b696[_0x46dc('0x31')],_0x2e703b[_0x46dc('0x32')]));if(_0x10b696['query'][_0x46dc('0x3d')]){_0xff6024[_0x46dc('0x3b')]=_[_0x46dc('0x3e')](_0xff6024[_0x46dc('0x3b')],{'$or':_[_0x46dc('0x2b')](_0xff6024[_0x46dc('0x35')],function(_0x5a21ac){var _0x83ab9a={};_0x83ab9a[_0x5a21ac]={'$like':'%'+_0x10b696[_0x46dc('0x31')][_0x46dc('0x3d')]+'%'};return _0x83ab9a;})});}_0xff6024=_['merge']({},_0xff6024,_0x10b696[_0x46dc('0x40')]);return _0x302e5f[_0x46dc('0x4a')](_0xff6024);}})['then'](function(_0x26a199){if(_0x26a199){_0x5edfee=_0x26a199[_0x46dc('0x36')];if(!_0x10b696[_0x46dc('0x31')][_0x46dc('0x37')](_0x46dc('0x38'))){_0xff6024[_0x46dc('0x1f')]=qs['limit'](_0x10b696['query'][_0x46dc('0x1f')]);_0xff6024[_0x46dc('0x1d')]=qs[_0x46dc('0x1d')](_0x10b696[_0x46dc('0x31')][_0x46dc('0x1d')]);}return _0x302e5f[_0x46dc('0x4a')](_0xff6024);}})[_0x46dc('0x23')](function(_0x53510f){if(_0x53510f){return _0x53510f?{'count':_0x5edfee,'rows':_0x53510f}:null;}})['then'](respondWithResult(_0x358a3f,null))[_0x46dc('0x47')](handleError(_0x358a3f,null));};exports[_0x46dc('0x4d')]=function(_0x5ee654,_0x311c16,_0x2c25ee){if(_0x5ee654['body']['id']){delete _0x5ee654[_0x46dc('0x46')]['id'];}return db[_0x46dc('0x2c')][_0x46dc('0x4b')]({'where':{'id':_0x5ee654[_0x46dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x311c16,null))[_0x46dc('0x23')](function(_0x562286){if(_0x562286){_0x5ee654[_0x46dc('0x46')][_0x46dc('0x4e')]=_0x562286['id'];_0x5ee654['body']['Subjects']=integrations[_0x46dc('0x4f')](_0x5ee654[_0x46dc('0x46')][_0x46dc('0x50')],_0x5ee654[_0x46dc('0x46')][_0x46dc('0x3f')]);_0x5ee654[_0x46dc('0x46')]['Descriptions']=integrations[_0x46dc('0x51')](_0x5ee654['body'][_0x46dc('0x50')],_0x5ee654[_0x46dc('0x46')]['type']);return db[_0x46dc('0x4c')][_0x46dc('0x52')](_0x5ee654[_0x46dc('0x46')],{'include':[{'model':db[_0x46dc('0x53')],'as':_0x46dc('0x54')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x311c16,null))[_0x46dc('0x47')](handleError(_0x311c16,null));};function getAccessToken(_0x559092){return new Promise(function(_0x3fdc4b,_0x2ff746){var _0xf140c6;switch(_0x559092[_0x46dc('0x55')]){case'US':_0xf140c6=_0x46dc('0x56');break;case'AU':_0xf140c6='https://accounts.zoho.com.au';break;case'EU':_0xf140c6='https://accounts.zoho.eu';break;case'IN':_0xf140c6=_0x46dc('0x57');break;case'CN':_0xf140c6='https://accounts.zoho.com.cn';break;default:_0xf140c6=_0x46dc('0x58');break;}var _0x5dac6d={'method':_0x46dc('0x59'),'uri':_0xf140c6+_0x46dc('0x5a'),'qs':{'refresh_token':_0x559092[_0x46dc('0x5b')],'client_id':_0x559092['clientId'],'client_secret':_0x559092[_0x46dc('0x5c')],'grant_type':_0x46dc('0x5d')},'json':!![]};return rp(_0x5dac6d)[_0x46dc('0x23')](function(_0xd2637b){if(_0xd2637b['access_token']){_0x3fdc4b(_0xd2637b[_0x46dc('0x5e')]);}else{_0x2ff746(_0x46dc('0x5f'));}})['catch'](function(_0x36daaa){_0x2ff746(_0x36daaa);});});}exports['getFields']=function(_0x39b1ad,_0xbe0c01,_0x15b508){var _0x38ee36,_0x1b8a51,_0x4a3900,_0x2c83ca,_0x1206bd;return db['ZohoAccount'][_0x46dc('0x4b')]({'where':{'id':_0x39b1ad[_0x46dc('0x45')]['id']},'attributes':['id',_0x46dc('0x60'),_0x46dc('0x55'),'clientId',_0x46dc('0x5c'),_0x46dc('0x61'),_0x46dc('0x62'),_0x46dc('0x5b')]})['then'](handleEntityNotFound(_0xbe0c01,null))[_0x46dc('0x23')](function(_0xd0c09e){_0x1206bd=_0xd0c09e;_0x38ee36=_0x1206bd[_0x46dc('0x60')];_0x1b8a51=_0x38ee36===_0x46dc('0x63')?'eu':'com';_0x4a3900=_0x1206bd[_0x46dc('0x61')];var _0x19867b=_0x4a3900[_0x46dc('0x64')](-0x1);if(_0x19867b==='/'||_0x19867b==='\x5c'||_0x19867b===':'){_0x4a3900=_0x4a3900[_0x46dc('0x65')](0x0,_0x4a3900[_0x46dc('0x66')](_0x19867b));}if(!_0x1206bd[_0x46dc('0x5b')]){throw new Error(_0x46dc('0x67'));}return getAccessToken(_0x1206bd);})[_0x46dc('0x23')](function(_0x459cdb){if(_0x459cdb){return rp({'method':_0x46dc('0x68'),'uri':util[_0x46dc('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1b8a51),'qs':{'module':_0x46dc('0x6a')},'headers':{'Authorization':_0x46dc('0x6b')+_0x459cdb},'json':!![]});}})[_0x46dc('0x23')](function(_0xf69528){if(_0xf69528){if(_0xf69528[_0x46dc('0x6c')]&&_0xf69528[_0x46dc('0x6c')][_0x46dc('0x26')]){throw new Error(_0xf69528[_0x46dc('0x6c')][_0x46dc('0x26')]['message']);}var _0x4daa98=[];var _0x4bbd1e=[];var _0x398c52=[_0x46dc('0x6d'),_0x46dc('0x6e'),_0x46dc('0x6f'),'WhoId',_0x46dc('0x70'),_0x46dc('0x71'),_0x46dc('0x72'),_0x46dc('0x73')];_0x4bbd1e=_['remove'](_0xf69528[_0x46dc('0x34')],function(_0x2f04f1){return _0x398c52['includes'](_0x2f04f1[_0x46dc('0x74')]);});for(var _0x11e9df=0x0;_0x11e9df<_0x4bbd1e[_0x46dc('0x36')];_0x11e9df++){if(_0x4bbd1e[_0x11e9df][_0x46dc('0x75')]===![]){_0x4daa98[_0x46dc('0x76')]({'id':_0x4bbd1e[_0x11e9df]['id'],'name':_0x4bbd1e[_0x11e9df][_0x46dc('0x77')],'custom':_0x4bbd1e[_0x11e9df][_0x46dc('0x78')],'options':_0x4bbd1e[_0x11e9df][_0x46dc('0x79')]==='picklist'&&_0x4bbd1e[_0x11e9df][_0x46dc('0x7a')]['length']>-0x1?_['map'](_0x4bbd1e[_0x11e9df][_0x46dc('0x7a')],function(_0x47db72){return{'name':_0x47db72,'value':_0x47db72};}):[]});}}return{'count':_0x4daa98[_0x46dc('0x36')],'rows':_0x4daa98};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xbe0c01,null))[_0x46dc('0x47')](function(_0x14d8c6){var _0xe0fd1f=_0x39b1ad[_0x46dc('0x31')][_0x46dc('0x7b')]?0x1f4:_0x14d8c6['statusCode']||0x1f4;logger[_0x46dc('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x46dc('0x7c'),_0xe0fd1f,JSON[_0x46dc('0x7d')](_0x14d8c6));delete _0x14d8c6[_0x46dc('0x28')];if(_0xe0fd1f===0x191){_0xe0fd1f=0x190;}_0xbe0c01[_0x46dc('0x1b')](_0xe0fd1f)[_0x46dc('0x29')](_0x39b1ad[_0x46dc('0x31')][_0x46dc('0x7b')]?{'message':_0x46dc('0x7e'),'statusCode':_0x14d8c6['statusCode']}:_0x14d8c6);});}; \ No newline at end of file +var _0x9e6a=['status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','getConfigurations','ZohoConfiguration','rawAttributes','hasOwnProperty','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x9e6a,0x68));var _0xa9e6=function(_0x45b1b3,_0x224dce){_0x45b1b3=_0x45b1b3-0x0;var _0x8f20cc=_0x9e6a[_0x45b1b3];return _0x8f20cc;};'use strict';var emlformat=require(_0xa9e6('0x0'));var rimraf=require(_0xa9e6('0x1'));var zipdir=require(_0xa9e6('0x2'));var jsonpatch=require(_0xa9e6('0x3'));var rp=require('request-promise');var moment=require(_0xa9e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa9e6('0x5'));var util=require(_0xa9e6('0x6'));var path=require('path');var sox=require(_0xa9e6('0x7'));var csv=require(_0xa9e6('0x8'));var ejs=require(_0xa9e6('0x9'));var fs=require('fs');var fs_extra=require(_0xa9e6('0xa'));var _=require(_0xa9e6('0xb'));var squel=require(_0xa9e6('0xc'));var crypto=require('crypto');var jsforce=require(_0xa9e6('0xd'));var deskjs=require(_0xa9e6('0xe'));var toCsv=require(_0xa9e6('0x8'));var querystring=require(_0xa9e6('0xf'));var Papa=require(_0xa9e6('0x10'));var Redis=require(_0xa9e6('0x11'));var authService=require(_0xa9e6('0x12'));var qs=require(_0xa9e6('0x13'));var as=require(_0xa9e6('0x14'));var hardwareService=require(_0xa9e6('0x15'));var logger=require(_0xa9e6('0x16'))(_0xa9e6('0x17'));var utils=require(_0xa9e6('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa9e6('0x19'))['db'];var integrations=require(_0xa9e6('0x1a'));function respondWithStatusCode(_0x90d409,_0x1a6018){_0x1a6018=_0x1a6018||0xcc;return function(_0x310f50){if(_0x310f50){return _0x90d409[_0xa9e6('0x1b')](_0x1a6018);}return _0x90d409[_0xa9e6('0x1c')](_0x1a6018)['end']();};}function respondWithResult(_0x1f2478,_0x328657){_0x328657=_0x328657||0xc8;return function(_0x4e8551){if(_0x4e8551){return _0x1f2478['status'](_0x328657)[_0xa9e6('0x1d')](_0x4e8551);}};}function respondWithFilteredResult(_0x93bb67,_0x1d8fc4){return function(_0x3b8173){if(_0x3b8173){var _0x11a6ea=typeof _0x1d8fc4[_0xa9e6('0x1e')]===_0xa9e6('0x1f')&&typeof _0x1d8fc4['limit']===_0xa9e6('0x1f');var _0x5df38e=_0x3b8173[_0xa9e6('0x20')];var _0x305071=_0x11a6ea?0x0:_0x1d8fc4[_0xa9e6('0x1e')];var _0x21f963=_0x11a6ea?_0x3b8173[_0xa9e6('0x20')]:_0x1d8fc4[_0xa9e6('0x1e')]+_0x1d8fc4[_0xa9e6('0x21')];var _0x4895aa;if(_0x21f963>=_0x5df38e){_0x21f963=_0x5df38e;_0x4895aa=0xc8;}else{_0x4895aa=0xce;}_0x93bb67[_0xa9e6('0x1c')](_0x4895aa);return _0x93bb67['set'](_0xa9e6('0x22'),_0x305071+'-'+_0x21f963+'/'+_0x5df38e)[_0xa9e6('0x1d')](_0x3b8173);}return null;};}function patchUpdates(_0x5017bd){return function(_0x166a44){try{jsonpatch['apply'](_0x166a44,_0x5017bd,!![]);}catch(_0x1debb1){return BPromise[_0xa9e6('0x23')](_0x1debb1);}return _0x166a44[_0xa9e6('0x24')]();};}function saveUpdates(_0x2f8f20,_0xc89121){return function(_0x3b4e60){if(_0x3b4e60){return _0x3b4e60[_0xa9e6('0x25')](_0x2f8f20)[_0xa9e6('0x26')](function(_0x4a76f9){return _0x4a76f9;});}return null;};}function removeEntity(_0x24b605,_0x1d8fec){return function(_0xa5ad4d){if(_0xa5ad4d){return _0xa5ad4d[_0xa9e6('0x27')]()[_0xa9e6('0x26')](function(){_0x24b605[_0xa9e6('0x1c')](0xcc)[_0xa9e6('0x28')]();});}};}function handleEntityNotFound(_0x31e357,_0x198189){return function(_0x1ada8b){if(!_0x1ada8b){_0x31e357[_0xa9e6('0x1b')](0x194);}return _0x1ada8b;};}function handleError(_0x13b715,_0x44b596){_0x44b596=_0x44b596||0x1f4;return function(_0x19a60f){logger[_0xa9e6('0x29')](_0x19a60f[_0xa9e6('0x2a')]);if(_0x19a60f['name']){delete _0x19a60f[_0xa9e6('0x2b')];}_0x13b715['status'](_0x44b596)[_0xa9e6('0x2c')](_0x19a60f);};}exports[_0xa9e6('0x2d')]=function(_0x222410,_0xce2ae6){var _0x1bd053={},_0x4a024e={},_0x42c45d={'count':0x0,'rows':[]};var _0x5a46c9=_[_0xa9e6('0x2e')](db[_0xa9e6('0x2f')]['rawAttributes'],function(_0x51e89f){return{'name':_0x51e89f[_0xa9e6('0x30')],'type':_0x51e89f[_0xa9e6('0x31')][_0xa9e6('0x32')]};});_0x4a024e[_0xa9e6('0x33')]=_[_0xa9e6('0x2e')](_0x5a46c9,_0xa9e6('0x2b'));_0x4a024e[_0xa9e6('0x34')]=_['keys'](_0x222410[_0xa9e6('0x34')]);_0x4a024e['filters']=_[_0xa9e6('0x35')](_0x4a024e[_0xa9e6('0x33')],_0x4a024e[_0xa9e6('0x34')]);_0x1bd053[_0xa9e6('0x36')]=_[_0xa9e6('0x35')](_0x4a024e['model'],qs[_0xa9e6('0x37')](_0x222410['query']['fields']));_0x1bd053[_0xa9e6('0x36')]=_0x1bd053['attributes'][_0xa9e6('0x38')]?_0x1bd053['attributes']:_0x4a024e[_0xa9e6('0x33')];if(!_0x222410[_0xa9e6('0x34')]['hasOwnProperty']('nolimit')){_0x1bd053[_0xa9e6('0x21')]=qs[_0xa9e6('0x21')](_0x222410[_0xa9e6('0x34')][_0xa9e6('0x21')]);_0x1bd053[_0xa9e6('0x1e')]=qs[_0xa9e6('0x1e')](_0x222410['query'][_0xa9e6('0x1e')]);}_0x1bd053[_0xa9e6('0x39')]=qs[_0xa9e6('0x3a')](_0x222410[_0xa9e6('0x34')][_0xa9e6('0x3a')]);_0x1bd053[_0xa9e6('0x3b')]=qs[_0xa9e6('0x3c')](_[_0xa9e6('0x3d')](_0x222410[_0xa9e6('0x34')],_0x4a024e['filters']),_0x5a46c9);if(_0x222410[_0xa9e6('0x34')]['filter']){_0x1bd053[_0xa9e6('0x3b')]=_[_0xa9e6('0x3e')](_0x1bd053[_0xa9e6('0x3b')],{'$or':_['map'](_0x5a46c9,function(_0x5a0106){if(_0x5a0106[_0xa9e6('0x31')]!==_0xa9e6('0x3f')){var _0x416e0c={};_0x416e0c[_0x5a0106[_0xa9e6('0x2b')]]={'$like':'%'+_0x222410[_0xa9e6('0x34')][_0xa9e6('0x40')]+'%'};return _0x416e0c;}})});}_0x1bd053=_['merge']({},_0x1bd053,_0x222410[_0xa9e6('0x41')]);var _0x1c6fd8={'where':_0x1bd053[_0xa9e6('0x3b')]};return db[_0xa9e6('0x2f')][_0xa9e6('0x20')](_0x1c6fd8)[_0xa9e6('0x26')](function(_0xfc4ac8){_0x42c45d['count']=_0xfc4ac8;if(_0x222410[_0xa9e6('0x34')][_0xa9e6('0x42')]){_0x1bd053[_0xa9e6('0x43')]=[{'all':!![]}];}return db[_0xa9e6('0x2f')][_0xa9e6('0x44')](_0x1bd053);})[_0xa9e6('0x26')](function(_0x292197){_0x42c45d[_0xa9e6('0x45')]=_0x292197;return _0x42c45d;})[_0xa9e6('0x26')](respondWithFilteredResult(_0xce2ae6,_0x1bd053))[_0xa9e6('0x46')](handleError(_0xce2ae6,null));};exports['show']=function(_0x1bd1aa,_0x729261){var _0xcc4966={'raw':![],'where':{'id':_0x1bd1aa['params']['id']}},_0x3e03f8={};_0x3e03f8[_0xa9e6('0x33')]=_[_0xa9e6('0x47')](db[_0xa9e6('0x2f')]['rawAttributes']);_0x3e03f8[_0xa9e6('0x34')]=_['keys'](_0x1bd1aa[_0xa9e6('0x34')]);_0x3e03f8[_0xa9e6('0x3c')]=_[_0xa9e6('0x35')](_0x3e03f8['model'],_0x3e03f8[_0xa9e6('0x34')]);_0xcc4966['attributes']=_[_0xa9e6('0x35')](_0x3e03f8[_0xa9e6('0x33')],qs[_0xa9e6('0x37')](_0x1bd1aa[_0xa9e6('0x34')][_0xa9e6('0x37')]));_0xcc4966[_0xa9e6('0x36')]=_0xcc4966[_0xa9e6('0x36')][_0xa9e6('0x38')]?_0xcc4966[_0xa9e6('0x36')]:_0x3e03f8[_0xa9e6('0x33')];if(_0x1bd1aa['query']['includeAll']){_0xcc4966[_0xa9e6('0x43')]=[{'all':!![]}];}_0xcc4966=_[_0xa9e6('0x3e')]({},_0xcc4966,_0x1bd1aa[_0xa9e6('0x41')]);return db[_0xa9e6('0x2f')][_0xa9e6('0x48')](_0xcc4966)['then'](handleEntityNotFound(_0x729261,null))[_0xa9e6('0x26')](respondWithResult(_0x729261,null))['catch'](handleError(_0x729261,null));};exports[_0xa9e6('0x49')]=function(_0x4dba44,_0x4b653){return db['ZohoAccount'][_0xa9e6('0x49')](_0x4dba44[_0xa9e6('0x4a')],{})['then'](respondWithResult(_0x4b653,0xc9))[_0xa9e6('0x46')](handleError(_0x4b653,null));};exports['update']=function(_0x3433e5,_0xb7a1f8){if(_0x3433e5[_0xa9e6('0x4a')]['id']){delete _0x3433e5[_0xa9e6('0x4a')]['id'];}return db[_0xa9e6('0x2f')][_0xa9e6('0x48')]({'where':{'id':_0x3433e5[_0xa9e6('0x4b')]['id']}})[_0xa9e6('0x26')](handleEntityNotFound(_0xb7a1f8,null))[_0xa9e6('0x26')](saveUpdates(_0x3433e5[_0xa9e6('0x4a')],null))[_0xa9e6('0x26')](respondWithResult(_0xb7a1f8,null))['catch'](handleError(_0xb7a1f8,null));};exports['destroy']=function(_0xed8196,_0x290c35){return db[_0xa9e6('0x2f')][_0xa9e6('0x48')]({'where':{'id':_0xed8196['params']['id']}})[_0xa9e6('0x26')](handleEntityNotFound(_0x290c35,null))[_0xa9e6('0x26')](removeEntity(_0x290c35,null))[_0xa9e6('0x46')](handleError(_0x290c35,null));};exports[_0xa9e6('0x4c')]=function(_0x1abcc2,_0x847e0b,_0x51eb0a){var _0x42c8a6={};var _0x51f64e={};var _0x468e08;var _0x2b00ff;return db['ZohoAccount']['findOne']({'where':{'id':_0x1abcc2[_0xa9e6('0x4b')]['id']}})[_0xa9e6('0x26')](handleEntityNotFound(_0x847e0b,null))[_0xa9e6('0x26')](function(_0x260abd){if(_0x260abd){_0x468e08=_0x260abd;_0x51f64e[_0xa9e6('0x33')]=_[_0xa9e6('0x47')](db[_0xa9e6('0x4d')][_0xa9e6('0x4e')]);_0x51f64e[_0xa9e6('0x34')]=_[_0xa9e6('0x47')](_0x1abcc2[_0xa9e6('0x34')]);_0x51f64e['filters']=_[_0xa9e6('0x35')](_0x51f64e['model'],_0x51f64e[_0xa9e6('0x34')]);_0x42c8a6['attributes']=_[_0xa9e6('0x35')](_0x51f64e['model'],qs[_0xa9e6('0x37')](_0x1abcc2['query'][_0xa9e6('0x37')]));_0x42c8a6[_0xa9e6('0x36')]=_0x42c8a6[_0xa9e6('0x36')][_0xa9e6('0x38')]?_0x42c8a6[_0xa9e6('0x36')]:_0x51f64e[_0xa9e6('0x33')];_0x42c8a6[_0xa9e6('0x39')]=qs[_0xa9e6('0x3a')](_0x1abcc2[_0xa9e6('0x34')][_0xa9e6('0x3a')]);_0x42c8a6[_0xa9e6('0x3b')]=qs['filters'](_['pick'](_0x1abcc2['query'],_0x51f64e[_0xa9e6('0x3c')]));if(_0x1abcc2['query'][_0xa9e6('0x40')]){_0x42c8a6[_0xa9e6('0x3b')]=_[_0xa9e6('0x3e')](_0x42c8a6[_0xa9e6('0x3b')],{'$or':_['map'](_0x42c8a6[_0xa9e6('0x36')],function(_0x22f5c9){var _0x583abf={};_0x583abf[_0x22f5c9]={'$like':'%'+_0x1abcc2[_0xa9e6('0x34')][_0xa9e6('0x40')]+'%'};return _0x583abf;})});}_0x42c8a6=_[_0xa9e6('0x3e')]({},_0x42c8a6,_0x1abcc2[_0xa9e6('0x41')]);return _0x468e08[_0xa9e6('0x4c')](_0x42c8a6);}})['then'](function(_0x327826){if(_0x327826){_0x2b00ff=_0x327826['length'];if(!_0x1abcc2[_0xa9e6('0x34')][_0xa9e6('0x4f')]('nolimit')){_0x42c8a6[_0xa9e6('0x21')]=qs[_0xa9e6('0x21')](_0x1abcc2['query'][_0xa9e6('0x21')]);_0x42c8a6[_0xa9e6('0x1e')]=qs[_0xa9e6('0x1e')](_0x1abcc2[_0xa9e6('0x34')][_0xa9e6('0x1e')]);}return _0x468e08['getConfigurations'](_0x42c8a6);}})['then'](function(_0x35fa7c){if(_0x35fa7c){return _0x35fa7c?{'count':_0x2b00ff,'rows':_0x35fa7c}:null;}})[_0xa9e6('0x26')](respondWithResult(_0x847e0b,null))['catch'](handleError(_0x847e0b,null));};exports[_0xa9e6('0x50')]=function(_0x33bec8,_0x13ba70,_0x51ac4c){if(_0x33bec8[_0xa9e6('0x4a')]['id']){delete _0x33bec8[_0xa9e6('0x4a')]['id'];}return db[_0xa9e6('0x2f')][_0xa9e6('0x51')]({'where':{'id':_0x33bec8['params']['id']}})[_0xa9e6('0x26')](handleEntityNotFound(_0x13ba70,null))['then'](function(_0x5d3009){if(_0x5d3009){_0x33bec8[_0xa9e6('0x4a')][_0xa9e6('0x52')]=_0x5d3009['id'];_0x33bec8[_0xa9e6('0x4a')]['Subjects']=integrations['getSubjects'](_0x33bec8[_0xa9e6('0x4a')][_0xa9e6('0x53')],_0x33bec8['body'][_0xa9e6('0x31')]);_0x33bec8[_0xa9e6('0x4a')][_0xa9e6('0x54')]=integrations[_0xa9e6('0x55')](_0x33bec8[_0xa9e6('0x4a')]['channel'],_0x33bec8[_0xa9e6('0x4a')][_0xa9e6('0x31')]);return db[_0xa9e6('0x4d')]['create'](_0x33bec8[_0xa9e6('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0xa9e6('0x56')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x13ba70,null))[_0xa9e6('0x46')](handleError(_0x13ba70,null));};function getAccessToken(_0x200d13){return new Promise(function(_0x225f8a,_0x185c51){var _0x464f9d;switch(_0x200d13[_0xa9e6('0x57')]){case'US':_0x464f9d=_0xa9e6('0x58');break;case'AU':_0x464f9d=_0xa9e6('0x59');break;case'EU':_0x464f9d=_0xa9e6('0x5a');break;case'IN':_0x464f9d=_0xa9e6('0x5b');break;case'CN':_0x464f9d='https://accounts.zoho.com.cn';break;default:_0x464f9d=_0xa9e6('0x5a');break;}var _0x2a1212={'method':_0xa9e6('0x5c'),'uri':_0x464f9d+'/oauth/v2/token','qs':{'refresh_token':_0x200d13[_0xa9e6('0x5d')],'client_id':_0x200d13[_0xa9e6('0x5e')],'client_secret':_0x200d13[_0xa9e6('0x5f')],'grant_type':_0xa9e6('0x60')},'json':!![]};return rp(_0x2a1212)['then'](function(_0x3b1162){if(_0x3b1162[_0xa9e6('0x61')]){_0x225f8a(_0x3b1162[_0xa9e6('0x61')]);}else{_0x185c51(_0xa9e6('0x62'));}})[_0xa9e6('0x46')](function(_0xe0820c){_0x185c51(_0xe0820c);});});}exports['getFields']=function(_0x16b249,_0x48390e,_0xd7653b){var _0x29e09c,_0xecac60,_0xf05ee0,_0x4abbe6,_0x1c7053;return db[_0xa9e6('0x2f')][_0xa9e6('0x51')]({'where':{'id':_0x16b249[_0xa9e6('0x4b')]['id']},'attributes':['id',_0xa9e6('0x63'),'zone',_0xa9e6('0x5e'),_0xa9e6('0x5f'),_0xa9e6('0x64'),_0xa9e6('0x65'),_0xa9e6('0x5d')]})[_0xa9e6('0x26')](handleEntityNotFound(_0x48390e,null))[_0xa9e6('0x26')](function(_0x34c1b3){_0x1c7053=_0x34c1b3;_0x29e09c=_0x1c7053[_0xa9e6('0x63')];_0xecac60=_0x29e09c==='zoho.eu'?'eu':_0xa9e6('0x66');_0xf05ee0=_0x1c7053['serverUrl'];var _0x2edf37=_0xf05ee0[_0xa9e6('0x67')](-0x1);if(_0x2edf37==='/'||_0x2edf37==='\x5c'||_0x2edf37===':'){_0xf05ee0=_0xf05ee0[_0xa9e6('0x68')](0x0,_0xf05ee0[_0xa9e6('0x69')](_0x2edf37));}if(!_0x1c7053[_0xa9e6('0x5d')]){throw new Error(_0xa9e6('0x6a'));}return getAccessToken(_0x1c7053);})[_0xa9e6('0x26')](function(_0x20216f){if(_0x20216f){return rp({'method':'GET','uri':util[_0xa9e6('0x6b')](_0xa9e6('0x6c'),_0xecac60),'qs':{'module':_0xa9e6('0x6d')},'headers':{'Authorization':_0xa9e6('0x6e')+_0x20216f},'json':!![]});}})[_0xa9e6('0x26')](function(_0x25fdd8){if(_0x25fdd8){if(_0x25fdd8[_0xa9e6('0x6f')]&&_0x25fdd8[_0xa9e6('0x6f')][_0xa9e6('0x29')]){throw new Error(_0x25fdd8[_0xa9e6('0x6f')][_0xa9e6('0x29')][_0xa9e6('0x70')]);}var _0x2bdabc=[];var _0x4858cc=[];var _0xd44ef8=[_0xa9e6('0x71'),_0xa9e6('0x72'),_0xa9e6('0x73'),_0xa9e6('0x74'),_0xa9e6('0x75'),_0xa9e6('0x76'),_0xa9e6('0x77'),_0xa9e6('0x78')];_0x4858cc=_['remove'](_0x25fdd8['fields'],function(_0x28c67f){return _0xd44ef8[_0xa9e6('0x79')](_0x28c67f[_0xa9e6('0x7a')]);});for(var _0x1e0ca9=0x0;_0x1e0ca9<_0x4858cc[_0xa9e6('0x38')];_0x1e0ca9++){if(_0x4858cc[_0x1e0ca9][_0xa9e6('0x7b')]===![]){_0x2bdabc[_0xa9e6('0x7c')]({'id':_0x4858cc[_0x1e0ca9]['id'],'name':_0x4858cc[_0x1e0ca9][_0xa9e6('0x7d')],'custom':_0x4858cc[_0x1e0ca9][_0xa9e6('0x7e')],'options':_0x4858cc[_0x1e0ca9][_0xa9e6('0x7f')]==='picklist'&&_0x4858cc[_0x1e0ca9][_0xa9e6('0x80')][_0xa9e6('0x38')]>-0x1?_[_0xa9e6('0x2e')](_0x4858cc[_0x1e0ca9][_0xa9e6('0x80')],function(_0x249584){return{'name':_0x249584,'value':_0x249584};}):[]});}}return{'count':_0x2bdabc[_0xa9e6('0x38')],'rows':_0x2bdabc};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x48390e,null))[_0xa9e6('0x46')](function(_0x390954){var _0x50817b=_0x16b249[_0xa9e6('0x34')][_0xa9e6('0x81')]?0x1f4:_0x390954[_0xa9e6('0x82')]||0x1f4;logger[_0xa9e6('0x29')](_0xa9e6('0x83'),'getFields',_0x50817b,JSON['stringify'](_0x390954));delete _0x390954[_0xa9e6('0x2b')];if(_0x50817b===0x191){_0x50817b=0x190;}_0x48390e[_0xa9e6('0x1c')](_0x50817b)[_0xa9e6('0x2c')](_0x16b249[_0xa9e6('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x390954['statusCode']}:_0x390954);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6a454e5..5767eb0 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 _0xf540=['info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','authorization_code','parse','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','refresh_token'];(function(_0x5db8c3,_0x5303c6){var _0x40b396=function(_0x2e9395){while(--_0x2e9395){_0x5db8c3['push'](_0x5db8c3['shift']());}};_0x40b396(++_0x5303c6);}(_0xf540,0xba));var _0x0f54=function(_0x4c4e69,_0x4dae3d){_0x4c4e69=_0x4c4e69-0x0;var _0x481c41=_0xf540[_0x4c4e69];return _0x481c41;};'use strict';var _=require('lodash');var util=require(_0x0f54('0x0'));var logger=require(_0x0f54('0x1'))(_0x0f54('0x2'));var moment=require('moment');var BPromise=require(_0x0f54('0x3'));var rp=require(_0x0f54('0x4'));var fs=require('fs');var path=require(_0x0f54('0x5'));var rimraf=require(_0x0f54('0x6'));var config=require(_0x0f54('0x7'));var attributes=require(_0x0f54('0x8'));var integrations=require(_0x0f54('0x9'));module[_0x0f54('0xa')]=function(_0x48c449,_0xc8a8c7){return _0x48c449[_0x0f54('0xb')](_0x0f54('0xc'),attributes,{'tableName':_0x0f54('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e70a9,_0x302fea,_0x144390){if(_0x5e70a9[_0x0f54('0xe')](_0x0f54('0xf'))||_0x5e70a9['changed']('serverUrl')||_0x5e70a9[_0x0f54('0xe')](_0x0f54('0x10'))||_0x5e70a9[_0x0f54('0xe')](_0x0f54('0x11'))||_0x5e70a9['changed'](_0x0f54('0x12'))||_0x5e70a9['changed'](_0x0f54('0x13'))){var _0x5d6676,_0x1c7baa;_0x5d6676=_0x5e70a9[_0x0f54('0x14')];var _0x2fd917=_0x5d6676[_0x0f54('0x15')](-0x1);if(_0x2fd917==='/'||_0x2fd917==='\x5c'||_0x2fd917===':'){_0x5d6676=_0x5d6676[_0x0f54('0x16')](0x0,_0x5d6676[_0x0f54('0x17')](_0x2fd917));}switch(_0x5e70a9[_0x0f54('0xf')]){case'US':_0x1c7baa=_0x0f54('0x18');break;case'AU':_0x1c7baa=_0x0f54('0x19');break;case'IN':_0x1c7baa=_0x0f54('0x1a');break;case'CN':_0x1c7baa=_0x0f54('0x1b');break;default:_0x1c7baa=_0x0f54('0x1c');break;}var _0x3ad829={'method':_0x0f54('0x1d'),'uri':_0x1c7baa+_0x0f54('0x1e'),'form':{'grant_type':'authorization_code','client_id':_0x5e70a9[_0x0f54('0x10')],'client_secret':_0x5e70a9[_0x0f54('0x11')],'redirect_uri':_0x5e70a9[_0x0f54('0x14')],'code':_0x5e70a9[_0x0f54('0x12')]},'headers':{'Content-Type':_0x0f54('0x1f')}};return rp(_0x3ad829)[_0x0f54('0x20')](function(_0x58b743){var _0x500c38=JSON['parse'](_0x58b743);if(_0x500c38[_0x0f54('0x21')]){_0x5e70a9['refreshToken']=_0x500c38[_0x0f54('0x21')];logger[_0x0f54('0x22')](util[_0x0f54('0x23')](_0x0f54('0x24'),_0x5e70a9['name'],_0x5e70a9['id']));}else{logger[_0x0f54('0x25')](util['format'](_0x0f54('0x26'),_0x5e70a9[_0x0f54('0x27')],_0x5e70a9['id']),util[_0x0f54('0x28')](_0x500c38,{'showHidden':![],'depth':null}));}return _0x144390(null,_0x302fea);})[_0x0f54('0x29')](function(_0x1a3903){logger[_0x0f54('0x25')](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x5e70a9[_0x0f54('0x27')],_0x5e70a9['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x144390(_0x1a3903);});}else{return _0x144390(null,_0x302fea);}},'beforeUpdate':function(_0x569c97,_0x4af5de,_0x5ce237){if(_0x569c97[_0x0f54('0xe')](_0x0f54('0xf'))||_0x569c97['changed'](_0x0f54('0x14'))||_0x569c97[_0x0f54('0xe')](_0x0f54('0x10'))||_0x569c97['changed'](_0x0f54('0x11'))||_0x569c97[_0x0f54('0xe')]('code')||_0x569c97['changed'](_0x0f54('0x13'))){var _0x25fbb9,_0x5538b7;_0x25fbb9=_0x569c97[_0x0f54('0x14')];var _0x141684=_0x25fbb9[_0x0f54('0x15')](-0x1);if(_0x141684==='/'||_0x141684==='\x5c'||_0x141684===':'){_0x25fbb9=_0x25fbb9[_0x0f54('0x16')](0x0,_0x25fbb9[_0x0f54('0x17')](_0x141684));}switch(_0x569c97[_0x0f54('0xf')]){case'US':_0x5538b7='https://accounts.zoho.com';break;case'AU':_0x5538b7=_0x0f54('0x19');break;case'IN':_0x5538b7=_0x0f54('0x1a');break;case'CN':_0x5538b7=_0x0f54('0x1b');break;default:_0x5538b7=_0x0f54('0x1c');break;}var _0x213f4a={'method':_0x0f54('0x1d'),'uri':_0x5538b7+'/oauth/v2/token','form':{'grant_type':_0x0f54('0x2a'),'client_id':_0x569c97[_0x0f54('0x10')],'client_secret':_0x569c97[_0x0f54('0x11')],'redirect_uri':_0x569c97[_0x0f54('0x14')],'code':_0x569c97['code']},'headers':{'Content-Type':_0x0f54('0x1f')}};return rp(_0x213f4a)[_0x0f54('0x20')](function(_0x2db3e3){var _0x4cf90f=JSON[_0x0f54('0x2b')](_0x2db3e3);if(_0x4cf90f[_0x0f54('0x21')]){_0x569c97['refreshToken']=_0x4cf90f[_0x0f54('0x21')];logger[_0x0f54('0x22')](util['format'](_0x0f54('0x24'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']));}else{logger[_0x0f54('0x25')](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']),util[_0x0f54('0x28')](_0x4cf90f,{'showHidden':![],'depth':null}));}return _0x5ce237(null,_0x4af5de);})[_0x0f54('0x29')](function(_0x37f94a){logger['error'](util[_0x0f54('0x23')](_0x0f54('0x26'),_0x569c97[_0x0f54('0x27')],_0x569c97['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5ce237(_0x37f94a);});}else{return _0x5ce237(null,_0x4af5de);}}}});}; \ No newline at end of file +var _0xe97a=['catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','zone','substring','lastIndexOf','https://accounts.zoho.eu','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','serverUrl','changed','clientId','clientSecret','code','host','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','name','error'];(function(_0x498846,_0x44ed7c){var _0x228944=function(_0x5934ac){while(--_0x5934ac){_0x498846['push'](_0x498846['shift']());}};_0x228944(++_0x44ed7c);}(_0xe97a,0x195));var _0xae97=function(_0x5717e2,_0x3f2cc5){_0x5717e2=_0x5717e2-0x0;var _0x1a5466=_0xe97a[_0x5717e2];return _0x1a5466;};'use strict';var _=require(_0xae97('0x0'));var util=require(_0xae97('0x1'));var logger=require(_0xae97('0x2'))(_0xae97('0x3'));var moment=require(_0xae97('0x4'));var BPromise=require(_0xae97('0x5'));var rp=require(_0xae97('0x6'));var fs=require('fs');var path=require(_0xae97('0x7'));var rimraf=require(_0xae97('0x8'));var config=require(_0xae97('0x9'));var attributes=require(_0xae97('0xa'));var integrations=require(_0xae97('0xb'));module[_0xae97('0xc')]=function(_0x49b566,_0x21d8e4){return _0x49b566[_0xae97('0xd')]('ZohoAccount',attributes,{'tableName':_0xae97('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2725ca,_0x5be98a,_0x29befb){if(_0x2725ca['changed']('zone')||_0x2725ca['changed'](_0xae97('0xf'))||_0x2725ca[_0xae97('0x10')](_0xae97('0x11'))||_0x2725ca[_0xae97('0x10')](_0xae97('0x12'))||_0x2725ca['changed'](_0xae97('0x13'))||_0x2725ca[_0xae97('0x10')](_0xae97('0x14'))){var _0x4d33c,_0x3819f0;_0x4d33c=_0x2725ca[_0xae97('0xf')];var _0x2087de=_0x4d33c['slice'](-0x1);if(_0x2087de==='/'||_0x2087de==='\x5c'||_0x2087de===':'){_0x4d33c=_0x4d33c['substring'](0x0,_0x4d33c['lastIndexOf'](_0x2087de));}switch(_0x2725ca['zone']){case'US':_0x3819f0='https://accounts.zoho.com';break;case'AU':_0x3819f0=_0xae97('0x15');break;case'IN':_0x3819f0=_0xae97('0x16');break;case'CN':_0x3819f0=_0xae97('0x17');break;default:_0x3819f0='https://accounts.zoho.eu';break;}var _0x8714e1={'method':_0xae97('0x18'),'uri':_0x3819f0+_0xae97('0x19'),'form':{'grant_type':_0xae97('0x1a'),'client_id':_0x2725ca[_0xae97('0x11')],'client_secret':_0x2725ca['clientSecret'],'redirect_uri':_0x2725ca[_0xae97('0xf')],'code':_0x2725ca[_0xae97('0x13')]},'headers':{'Content-Type':_0xae97('0x1b')}};return rp(_0x8714e1)[_0xae97('0x1c')](function(_0x28e745){var _0x33e41d=JSON[_0xae97('0x1d')](_0x28e745);if(_0x33e41d[_0xae97('0x1e')]){_0x2725ca[_0xae97('0x1f')]=_0x33e41d[_0xae97('0x1e')];logger['info'](util[_0xae97('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2725ca[_0xae97('0x21')],_0x2725ca['id']));}else{logger[_0xae97('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2725ca[_0xae97('0x21')],_0x2725ca['id']),util['inspect'](_0x33e41d,{'showHidden':![],'depth':null}));}return _0x29befb(null,_0x5be98a);})[_0xae97('0x23')](function(_0x1130d3){logger[_0xae97('0x22')](util[_0xae97('0x20')](_0xae97('0x24'),_0x2725ca[_0xae97('0x21')],_0x2725ca['id']),util[_0xae97('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x29befb(_0x1130d3);});}else{return _0x29befb(null,_0x5be98a);}},'beforeUpdate':function(_0x5f80ae,_0x4bb948,_0x1ed39c){if(_0x5f80ae[_0xae97('0x10')](_0xae97('0x26'))||_0x5f80ae[_0xae97('0x10')](_0xae97('0xf'))||_0x5f80ae[_0xae97('0x10')](_0xae97('0x11'))||_0x5f80ae[_0xae97('0x10')](_0xae97('0x12'))||_0x5f80ae[_0xae97('0x10')](_0xae97('0x13'))||_0x5f80ae[_0xae97('0x10')](_0xae97('0x14'))){var _0x4e74c9,_0x12e15;_0x4e74c9=_0x5f80ae[_0xae97('0xf')];var _0x12a593=_0x4e74c9['slice'](-0x1);if(_0x12a593==='/'||_0x12a593==='\x5c'||_0x12a593===':'){_0x4e74c9=_0x4e74c9[_0xae97('0x27')](0x0,_0x4e74c9[_0xae97('0x28')](_0x12a593));}switch(_0x5f80ae[_0xae97('0x26')]){case'US':_0x12e15='https://accounts.zoho.com';break;case'AU':_0x12e15=_0xae97('0x15');break;case'IN':_0x12e15='https://accounts.zoho.in';break;case'CN':_0x12e15=_0xae97('0x17');break;default:_0x12e15=_0xae97('0x29');break;}var _0x258c26={'method':_0xae97('0x18'),'uri':_0x12e15+_0xae97('0x19'),'form':{'grant_type':_0xae97('0x1a'),'client_id':_0x5f80ae['clientId'],'client_secret':_0x5f80ae['clientSecret'],'redirect_uri':_0x5f80ae[_0xae97('0xf')],'code':_0x5f80ae[_0xae97('0x13')]},'headers':{'Content-Type':_0xae97('0x1b')}};return rp(_0x258c26)[_0xae97('0x1c')](function(_0x22488d){var _0x407554=JSON[_0xae97('0x1d')](_0x22488d);if(_0x407554[_0xae97('0x1e')]){_0x5f80ae[_0xae97('0x1f')]=_0x407554[_0xae97('0x1e')];logger[_0xae97('0x2a')](util[_0xae97('0x20')](_0xae97('0x2b'),_0x5f80ae[_0xae97('0x21')],_0x5f80ae['id']));}else{logger['error'](util[_0xae97('0x20')](_0xae97('0x24'),_0x5f80ae[_0xae97('0x21')],_0x5f80ae['id']),util[_0xae97('0x25')](_0x407554,{'showHidden':![],'depth':null}));}return _0x1ed39c(null,_0x4bb948);})[_0xae97('0x23')](function(_0x29e3d8){logger[_0xae97('0x22')](util['format'](_0xae97('0x24'),_0x5f80ae[_0xae97('0x21')],_0x5f80ae['id']),util[_0xae97('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1ed39c(_0x29e3d8);});}else{return _0x1ed39c(null,_0x4bb948);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f197790..aa58067 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 _0x8952=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','ShowZohoAccount','find','raw','debug','util','moment','bluebird'];(function(_0x270e46,_0x122174){var _0x18ca4e=function(_0x5c1a81){while(--_0x5c1a81){_0x270e46['push'](_0x270e46['shift']());}};_0x18ca4e(++_0x122174);}(_0x8952,0x17e));var _0x2895=function(_0x47aec4,_0x43cf82){_0x47aec4=_0x47aec4-0x0;var _0x12906c=_0x8952[_0x47aec4];return _0x12906c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});}exports[_0x2895('0x15')]=function(_0xbf8b63){var _0x2cb505=this;return new Promise(function(_0x155124,_0x184d11){return db[_0x2895('0x16')][_0x2895('0x17')]({'raw':_0xbf8b63['options']?_0xbf8b63['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'limit':_0xbf8b63[_0x2895('0x18')]?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1b')]||null:null,'include':_0xbf8b63['options']?_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0xbf8b63[_0x2895('0x18')][_0x2895('0x1c')],function(_0x6f8ad4){return{'model':db[_0x6f8ad4['model']],'as':_0x6f8ad4['as'],'attributes':_0x6f8ad4['attributes'],'include':_0x6f8ad4[_0x2895('0x1c')]?_[_0x2895('0x1d')](_0x6f8ad4[_0x2895('0x1c')],function(_0x4a21cf){return{'model':db[_0x4a21cf[_0x2895('0x1e')]],'as':_0x4a21cf['as'],'attributes':_0x4a21cf[_0x2895('0x1a')],'include':_0x4a21cf['include']?_[_0x2895('0x1d')](_0x4a21cf[_0x2895('0x1c')],function(_0x2cd4df){return{'model':db[_0x2cd4df['model']],'as':_0x2cd4df['as'],'attributes':_0x2cd4df[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2895('0xc')](function(_0x5eedfc){logger[_0x2895('0xd')]('GetZohoAccount',_0xbf8b63);logger['debug'](_0x2895('0x15'),_0xbf8b63,JSON['stringify'](_0x5eedfc));_0x155124(_0x5eedfc);})[_0x2895('0x14')](function(_0x381538){logger['error']('GetZohoAccount',_0x381538[_0x2895('0x12')],_0xbf8b63);_0x184d11(_0x2cb505[_0x2895('0x10')](0x1f4,_0x381538[_0x2895('0x12')]));});});};exports[_0x2895('0x1f')]=function(_0x14d150){var _0xa61689=this;return new Promise(function(_0x34e110,_0x546514){return db[_0x2895('0x16')][_0x2895('0x20')]({'raw':_0x14d150[_0x2895('0x18')]?_0x14d150['options'][_0x2895('0x21')]===undefined?!![]:![]:!![],'where':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x19')]||null:null,'attributes':_0x14d150['options']?_0x14d150[_0x2895('0x18')][_0x2895('0x1a')]||null:null,'include':_0x14d150[_0x2895('0x18')]?_0x14d150[_0x2895('0x18')][_0x2895('0x1c')]?_['map'](_0x14d150['options'][_0x2895('0x1c')],function(_0xf3c8f7){return{'model':db[_0xf3c8f7['model']],'as':_0xf3c8f7['as'],'attributes':_0xf3c8f7[_0x2895('0x1a')],'include':_0xf3c8f7['include']?_[_0x2895('0x1d')](_0xf3c8f7[_0x2895('0x1c')],function(_0x586c4a){return{'model':db[_0x586c4a[_0x2895('0x1e')]],'as':_0x586c4a['as'],'attributes':_0x586c4a['attributes'],'include':_0x586c4a[_0x2895('0x1c')]?_['map'](_0x586c4a['include'],function(_0xa6fe9e){return{'model':db[_0xa6fe9e[_0x2895('0x1e')]],'as':_0xa6fe9e['as'],'attributes':_0xa6fe9e[_0x2895('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4348){logger[_0x2895('0xd')](_0x2895('0x1f'),_0x14d150);logger[_0x2895('0x22')](_0x2895('0x1f'),_0x14d150,JSON[_0x2895('0xf')](_0x1e4348));_0x34e110(_0x1e4348);})[_0x2895('0x14')](function(_0x240230){logger[_0x2895('0x10')](_0x2895('0x1f'),_0x240230['message'],_0x14d150);_0x546514(_0xa61689[_0x2895('0x10')](0x1f4,_0x240230[_0x2895('0x12')]));});});}; \ No newline at end of file +var _0x18b2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetZohoAccount','ZohoAccount','raw','options','where','attributes','map','include','model','then','ShowZohoAccount','stringify','util','moment','bluebird'];(function(_0x51c487,_0x4ace3e){var _0x26f3dc=function(_0x15c98e){while(--_0x15c98e){_0x51c487['push'](_0x51c487['shift']());}};_0x26f3dc(++_0x4ace3e);}(_0x18b2,0x85));var _0x218b=function(_0x197e3d,_0x7fb675){_0x197e3d=_0x197e3d-0x0;var _0x8a8080=_0x18b2[_0x197e3d];return _0x8a8080;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require(_0x218b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x3'));var db=require(_0x218b('0x4'))['db'];var utils=require(_0x218b('0x5'));var logger=require(_0x218b('0x6'))(_0x218b('0x7'));var config=require(_0x218b('0x8'));var jayson=require(_0x218b('0x9'));var client=jayson[_0x218b('0xa')][_0x218b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6bf41c,_0x24ce61,_0x14449e){return new BPromise(function(_0x71e08d,_0xb67e06){return client[_0x218b('0xc')](_0x6bf41c,_0x14449e)['then'](function(_0x216f3d){logger[_0x218b('0xd')](_0x218b('0xe'),_0x24ce61,_0x218b('0xf'));logger[_0x218b('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x24ce61,_0x218b('0xf'),JSON['stringify'](_0x216f3d));if(_0x216f3d[_0x218b('0x11')]){if(_0x216f3d[_0x218b('0x11')][_0x218b('0x12')]===0x1f4){logger['error'](_0x218b('0xe'),_0x24ce61,_0x216f3d[_0x218b('0x11')]['message']);return _0xb67e06(_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);}logger['error'](_0x218b('0xe'),_0x24ce61,_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);return _0x71e08d(_0x216f3d[_0x218b('0x11')][_0x218b('0x13')]);}else{logger[_0x218b('0xd')](_0x218b('0xe'),_0x24ce61,_0x218b('0xf'));_0x71e08d(_0x216f3d[_0x218b('0x14')][_0x218b('0x13')]);}})[_0x218b('0x15')](function(_0x430ecf){logger[_0x218b('0x11')](_0x218b('0xe'),_0x24ce61,_0x430ecf);_0xb67e06(_0x430ecf);});});}exports[_0x218b('0x16')]=function(_0x477f32){var _0x512176=this;return new Promise(function(_0x2a1c5c,_0x2a285d){return db[_0x218b('0x17')]['findAll']({'raw':_0x477f32['options']?_0x477f32['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')][_0x218b('0x1a')]||null:null,'attributes':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')][_0x218b('0x1b')]||null:null,'limit':_0x477f32[_0x218b('0x19')]?_0x477f32['options']['limit']||null:null,'include':_0x477f32[_0x218b('0x19')]?_0x477f32[_0x218b('0x19')]['include']?_[_0x218b('0x1c')](_0x477f32[_0x218b('0x19')][_0x218b('0x1d')],function(_0x571909){return{'model':db[_0x571909['model']],'as':_0x571909['as'],'attributes':_0x571909[_0x218b('0x1b')],'include':_0x571909[_0x218b('0x1d')]?_['map'](_0x571909[_0x218b('0x1d')],function(_0x1d70a8){return{'model':db[_0x1d70a8[_0x218b('0x1e')]],'as':_0x1d70a8['as'],'attributes':_0x1d70a8[_0x218b('0x1b')],'include':_0x1d70a8[_0x218b('0x1d')]?_['map'](_0x1d70a8[_0x218b('0x1d')],function(_0x239f75){return{'model':db[_0x239f75[_0x218b('0x1e')]],'as':_0x239f75['as'],'attributes':_0x239f75['attributes']};}):[]};}):[]};}):[]:[]})[_0x218b('0x1f')](function(_0x5acc87){logger['info'](_0x218b('0x16'),_0x477f32);logger[_0x218b('0x10')]('GetZohoAccount',_0x477f32,JSON['stringify'](_0x5acc87));_0x2a1c5c(_0x5acc87);})['catch'](function(_0x4aca90){logger['error']('GetZohoAccount',_0x4aca90['message'],_0x477f32);_0x2a285d(_0x512176['error'](0x1f4,_0x4aca90[_0x218b('0x13')]));});});};exports[_0x218b('0x20')]=function(_0x2b971e){var _0x614bec=this;return new Promise(function(_0x3f5cfa,_0x5878d2){return db[_0x218b('0x17')]['find']({'raw':_0x2b971e[_0x218b('0x19')]?_0x2b971e['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x2b971e['options']?_0x2b971e['options']['where']||null:null,'attributes':_0x2b971e['options']?_0x2b971e[_0x218b('0x19')][_0x218b('0x1b')]||null:null,'include':_0x2b971e['options']?_0x2b971e[_0x218b('0x19')][_0x218b('0x1d')]?_[_0x218b('0x1c')](_0x2b971e[_0x218b('0x19')]['include'],function(_0x4013c2){return{'model':db[_0x4013c2[_0x218b('0x1e')]],'as':_0x4013c2['as'],'attributes':_0x4013c2[_0x218b('0x1b')],'include':_0x4013c2[_0x218b('0x1d')]?_[_0x218b('0x1c')](_0x4013c2[_0x218b('0x1d')],function(_0x2d7710){return{'model':db[_0x2d7710[_0x218b('0x1e')]],'as':_0x2d7710['as'],'attributes':_0x2d7710['attributes'],'include':_0x2d7710['include']?_[_0x218b('0x1c')](_0x2d7710[_0x218b('0x1d')],function(_0x29f1b0){return{'model':db[_0x29f1b0[_0x218b('0x1e')]],'as':_0x29f1b0['as'],'attributes':_0x29f1b0[_0x218b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x218b('0x1f')](function(_0x5c1f00){logger[_0x218b('0xd')]('ShowZohoAccount',_0x2b971e);logger['debug'](_0x218b('0x20'),_0x2b971e,JSON[_0x218b('0x21')](_0x5c1f00));_0x3f5cfa(_0x5c1f00);})['catch'](function(_0x16cf43){logger[_0x218b('0x11')]('ShowZohoAccount',_0x16cf43['message'],_0x2b971e);_0x5878d2(_0x614bec[_0x218b('0x11')](0x1f4,_0x16cf43[_0x218b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index fef173f..b0bbc28 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 _0xf5ad=['/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xf5ad,0xb1));var _0xdf5a=function(_0x1fee72,_0x1117c3){_0x1fee72=_0x1fee72-0x0;var _0x42435c=_0xf5ad[_0x1fee72];return _0x42435c;};'use strict';var multer=require(_0xdf5a('0x0'));var util=require(_0xdf5a('0x1'));var path=require('path');var timeout=require(_0xdf5a('0x2'));var express=require(_0xdf5a('0x3'));var router=express[_0xdf5a('0x4')]();var fs_extra=require(_0xdf5a('0x5'));var auth=require(_0xdf5a('0x6'));var interaction=require(_0xdf5a('0x7'));var config=require(_0xdf5a('0x8'));var controller=require(_0xdf5a('0x9'));router[_0xdf5a('0xa')]('/',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0xc')]);router[_0xdf5a('0xa')](_0xdf5a('0xd'),auth[_0xdf5a('0xb')](),controller[_0xdf5a('0xe')]);router[_0xdf5a('0xa')](_0xdf5a('0xf'),auth['isAuthenticated'](),controller[_0xdf5a('0x10')]);router[_0xdf5a('0xa')]('/:id/subjects',auth[_0xdf5a('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xdf5a('0x11')]);router[_0xdf5a('0x12')]('/',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x13')]);router[_0xdf5a('0x14')]('/:id',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x15')]);router[_0xdf5a('0x16')]('/:id',auth[_0xdf5a('0xb')](),controller[_0xdf5a('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe821=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x5aecf9,_0x3ed9f7){var _0x46ce9f=function(_0x127d76){while(--_0x127d76){_0x5aecf9['push'](_0x5aecf9['shift']());}};_0x46ce9f(++_0x3ed9f7);}(_0xe821,0x1ad));var _0x1e82=function(_0x22b966,_0x2edab8){_0x22b966=_0x22b966-0x0;var _0xcd9f48=_0xe821[_0x22b966];return _0xcd9f48;};'use strict';var multer=require(_0x1e82('0x0'));var util=require(_0x1e82('0x1'));var path=require(_0x1e82('0x2'));var timeout=require(_0x1e82('0x3'));var express=require(_0x1e82('0x4'));var router=express[_0x1e82('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1e82('0x6'));var interaction=require(_0x1e82('0x7'));var config=require(_0x1e82('0x8'));var controller=require('./intZohoConfiguration.controller');router[_0x1e82('0x9')]('/',auth[_0x1e82('0xa')](),controller[_0x1e82('0xb')]);router[_0x1e82('0x9')](_0x1e82('0xc'),auth['isAuthenticated'](),controller[_0x1e82('0xd')]);router['get'](_0x1e82('0xe'),auth[_0x1e82('0xa')](),controller[_0x1e82('0xf')]);router[_0x1e82('0x9')]('/:id/subjects',auth[_0x1e82('0xa')](),controller[_0x1e82('0x10')]);router[_0x1e82('0x9')](_0x1e82('0x11'),auth[_0x1e82('0xa')](),controller[_0x1e82('0x12')]);router[_0x1e82('0x13')]('/',auth[_0x1e82('0xa')](),controller[_0x1e82('0x14')]);router[_0x1e82('0x15')]('/:id',auth[_0x1e82('0xa')](),controller[_0x1e82('0x16')]);router[_0x1e82('0x17')](_0x1e82('0xc'),auth[_0x1e82('0xa')](),controller['destroy']);module[_0x1e82('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index c54f9e8..81b7ddc 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 _0xadb5=['contact_lead','contact','exports','STRING','lead','nothing','ENUM'];(function(_0x1a89a5,_0x1f895f){var _0x1f351f=function(_0x5c4218){while(--_0x5c4218){_0x1a89a5['push'](_0x1a89a5['shift']());}};_0x1f351f(++_0x1f895f);}(_0xadb5,0x1c2));var _0x5adb=function(_0x5a7660,_0x24c108){_0x5a7660=_0x5a7660-0x0;var _0x55c7c3=_0xadb5[_0x5a7660];return _0x55c7c3;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize[_0x5adb('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x5adb('0x2'),'contact',_0x5adb('0x3')),'defaultValue':_0x5adb('0x2')},'moduleSearch':{'type':Sequelize[_0x5adb('0x4')](_0x5adb('0x5'),_0x5adb('0x6'),_0x5adb('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x5adb('0x1')]}}; \ No newline at end of file +var _0xcc00=['sequelize','STRING','ENUM','lead','nothing','contact','contact_lead'];(function(_0x445fc6,_0x162f29){var _0x42708e=function(_0x3052a1){while(--_0x3052a1){_0x445fc6['push'](_0x445fc6['shift']());}};_0x42708e(++_0x162f29);}(_0xcc00,0x12d));var _0x0cc0=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0xcc00[_0x107f10];return _0x811cab;};'use strict';var Sequelize=require(_0x0cc0('0x0'));module['exports']={'name':{'type':Sequelize[_0x0cc0('0x1')]},'moduleCreate':{'type':Sequelize[_0x0cc0('0x2')](_0x0cc0('0x3'),'contact',_0x0cc0('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x0cc0('0x5'),_0x0cc0('0x3')),'defaultValue':_0x0cc0('0x6')},'description':{'type':Sequelize[_0x0cc0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 6f35fb8..5d3b459 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 _0x89bd=['create','body','getFields','findOne','ZohoField','length','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','ZohoConfiguration','findAll','rows','catch','show','params','keys','options','find'];(function(_0xdec007,_0x300f77){var _0x28d549=function(_0x28accc){while(--_0x28accc){_0xdec007['push'](_0xdec007['shift']());}};_0x28d549(++_0x300f77);}(_0x89bd,0x151));var _0xd89b=function(_0x216e07,_0x59581a){_0x216e07=_0x216e07-0x0;var _0x73b29f=_0x89bd[_0x216e07];return _0x73b29f;};'use strict';var emlformat=require(_0xd89b('0x0'));var rimraf=require(_0xd89b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd89b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd89b('0x3'));var Mustache=require(_0xd89b('0x4'));var util=require('util');var path=require(_0xd89b('0x5'));var sox=require('sox');var csv=require(_0xd89b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd89b('0x7'));var _=require(_0xd89b('0x8'));var squel=require(_0xd89b('0x9'));var crypto=require(_0xd89b('0xa'));var jsforce=require(_0xd89b('0xb'));var deskjs=require(_0xd89b('0xc'));var toCsv=require(_0xd89b('0x6'));var querystring=require(_0xd89b('0xd'));var Papa=require(_0xd89b('0xe'));var Redis=require(_0xd89b('0xf'));var authService=require(_0xd89b('0x10'));var qs=require(_0xd89b('0x11'));var as=require(_0xd89b('0x12'));var hardwareService=require(_0xd89b('0x13'));var logger=require(_0xd89b('0x14'))(_0xd89b('0x15'));var utils=require(_0xd89b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd89b('0x17'));var db=require(_0xd89b('0x18'))['db'];function respondWithStatusCode(_0x1dd8f8,_0x386949){_0x386949=_0x386949||0xcc;return function(_0x1e5e9a){if(_0x1e5e9a){return _0x1dd8f8[_0xd89b('0x19')](_0x386949);}return _0x1dd8f8['status'](_0x386949)['end']();};}function respondWithResult(_0x4a03aa,_0x202e32){_0x202e32=_0x202e32||0xc8;return function(_0x12c7b1){if(_0x12c7b1){return _0x4a03aa[_0xd89b('0x1a')](_0x202e32)[_0xd89b('0x1b')](_0x12c7b1);}};}function respondWithFilteredResult(_0x26847e,_0x206e62){return function(_0x2f7b7c){if(_0x2f7b7c){var _0x5bea73=typeof _0x206e62[_0xd89b('0x1c')]===_0xd89b('0x1d')&&typeof _0x206e62['limit']===_0xd89b('0x1d');var _0x1e1a28=_0x2f7b7c[_0xd89b('0x1e')];var _0x4c675d=_0x5bea73?0x0:_0x206e62[_0xd89b('0x1c')];var _0x48ec65=_0x5bea73?_0x2f7b7c['count']:_0x206e62[_0xd89b('0x1c')]+_0x206e62[_0xd89b('0x1f')];var _0x4652e0;if(_0x48ec65>=_0x1e1a28){_0x48ec65=_0x1e1a28;_0x4652e0=0xc8;}else{_0x4652e0=0xce;}_0x26847e[_0xd89b('0x1a')](_0x4652e0);return _0x26847e[_0xd89b('0x20')](_0xd89b('0x21'),_0x4c675d+'-'+_0x48ec65+'/'+_0x1e1a28)['json'](_0x2f7b7c);}return null;};}function patchUpdates(_0x2cbb72){return function(_0x182b48){try{jsonpatch[_0xd89b('0x22')](_0x182b48,_0x2cbb72,!![]);}catch(_0x241d70){return BPromise[_0xd89b('0x23')](_0x241d70);}return _0x182b48[_0xd89b('0x24')]();};}function saveUpdates(_0x1dc577,_0x4e7237){return function(_0x22b149){if(_0x22b149){return _0x22b149[_0xd89b('0x25')](_0x1dc577)[_0xd89b('0x26')](function(_0x33d8d9){return _0x33d8d9;});}return null;};}function removeEntity(_0xa82aa5,_0x3bdf0f){return function(_0x349464){if(_0x349464){return _0x349464[_0xd89b('0x27')]()['then'](function(){_0xa82aa5[_0xd89b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x535c07,_0x1dd94c){return function(_0x31e886){if(!_0x31e886){_0x535c07[_0xd89b('0x19')](0x194);}return _0x31e886;};}function handleError(_0x565642,_0x57fbc7){_0x57fbc7=_0x57fbc7||0x1f4;return function(_0x3abde2){logger['error'](_0x3abde2[_0xd89b('0x28')]);if(_0x3abde2[_0xd89b('0x29')]){delete _0x3abde2[_0xd89b('0x29')];}_0x565642['status'](_0x57fbc7)[_0xd89b('0x2a')](_0x3abde2);};}exports['index']=function(_0x3ebedf,_0x18b02c){var _0x42d71f={},_0x160366={},_0x23fe6f={'count':0x0,'rows':[]};var _0x143f38=_['map'](db['ZohoConfiguration'][_0xd89b('0x2b')],function(_0x207cfe){return{'name':_0x207cfe[_0xd89b('0x2c')],'type':_0x207cfe['type'][_0xd89b('0x2d')]};});_0x160366[_0xd89b('0x2e')]=_[_0xd89b('0x2f')](_0x143f38,'name');_0x160366[_0xd89b('0x30')]=_['keys'](_0x3ebedf[_0xd89b('0x30')]);_0x160366[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x160366[_0xd89b('0x2e')],_0x160366[_0xd89b('0x30')]);_0x42d71f[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x160366[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x34')]));_0x42d71f[_0xd89b('0x33')]=_0x42d71f[_0xd89b('0x33')]['length']?_0x42d71f[_0xd89b('0x33')]:_0x160366['model'];if(!_0x3ebedf[_0xd89b('0x30')]['hasOwnProperty'](_0xd89b('0x35'))){_0x42d71f['limit']=qs[_0xd89b('0x1f')](_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x42d71f[_0xd89b('0x1c')]=qs[_0xd89b('0x1c')](_0x3ebedf[_0xd89b('0x30')]['offset']);}_0x42d71f[_0xd89b('0x36')]=qs[_0xd89b('0x37')](_0x3ebedf[_0xd89b('0x30')]['sort']);_0x42d71f['where']=qs[_0xd89b('0x31')](_[_0xd89b('0x38')](_0x3ebedf[_0xd89b('0x30')],_0x160366[_0xd89b('0x31')]),_0x143f38);if(_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x39')]){_0x42d71f[_0xd89b('0x3a')]=_[_0xd89b('0x3b')](_0x42d71f[_0xd89b('0x3a')],{'$or':_[_0xd89b('0x2f')](_0x143f38,function(_0x38afc1){if(_0x38afc1[_0xd89b('0x3c')]!==_0xd89b('0x3d')){var _0x3e4215={};_0x3e4215[_0x38afc1[_0xd89b('0x29')]]={'$like':'%'+_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x39')]+'%'};return _0x3e4215;}})});}_0x42d71f=_['merge']({},_0x42d71f,_0x3ebedf['options']);var _0xe5c739={'where':_0x42d71f[_0xd89b('0x3a')]};return db['ZohoConfiguration']['count'](_0xe5c739)['then'](function(_0x1f1e85){_0x23fe6f[_0xd89b('0x1e')]=_0x1f1e85;if(_0x3ebedf[_0xd89b('0x30')][_0xd89b('0x3e')]){_0x42d71f[_0xd89b('0x3f')]=[{'all':!![]}];}return db[_0xd89b('0x40')][_0xd89b('0x41')](_0x42d71f);})['then'](function(_0x51e051){_0x23fe6f[_0xd89b('0x42')]=_0x51e051;return _0x23fe6f;})['then'](respondWithFilteredResult(_0x18b02c,_0x42d71f))[_0xd89b('0x43')](handleError(_0x18b02c,null));};exports[_0xd89b('0x44')]=function(_0x538738,_0x57f2a4){var _0x43b701={'raw':![],'where':{'id':_0x538738[_0xd89b('0x45')]['id']}},_0x1eee29={};_0x1eee29[_0xd89b('0x2e')]=_[_0xd89b('0x46')](db[_0xd89b('0x40')]['rawAttributes']);_0x1eee29[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x538738[_0xd89b('0x30')]);_0x1eee29[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x1eee29[_0xd89b('0x2e')],_0x1eee29[_0xd89b('0x30')]);_0x43b701[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x1eee29['model'],qs[_0xd89b('0x34')](_0x538738[_0xd89b('0x30')][_0xd89b('0x34')]));_0x43b701[_0xd89b('0x33')]=_0x43b701[_0xd89b('0x33')]['length']?_0x43b701[_0xd89b('0x33')]:_0x1eee29[_0xd89b('0x2e')];if(_0x538738[_0xd89b('0x30')]['includeAll']){_0x43b701[_0xd89b('0x3f')]=[{'all':!![]}];}_0x43b701=_[_0xd89b('0x3b')]({},_0x43b701,_0x538738[_0xd89b('0x47')]);return db[_0xd89b('0x40')][_0xd89b('0x48')](_0x43b701)[_0xd89b('0x26')](handleEntityNotFound(_0x57f2a4,null))[_0xd89b('0x26')](respondWithResult(_0x57f2a4,null))[_0xd89b('0x43')](handleError(_0x57f2a4,null));};exports[_0xd89b('0x49')]=function(_0x26e309,_0x14aa0a){return db[_0xd89b('0x40')]['create'](_0x26e309[_0xd89b('0x4a')],{})[_0xd89b('0x26')](respondWithResult(_0x14aa0a,0xc9))[_0xd89b('0x43')](handleError(_0x14aa0a,null));};exports['update']=function(_0x5cd1f6,_0x300e25){if(_0x5cd1f6[_0xd89b('0x4a')]['id']){delete _0x5cd1f6[_0xd89b('0x4a')]['id'];}return db[_0xd89b('0x40')][_0xd89b('0x48')]({'where':{'id':_0x5cd1f6[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x300e25,null))['then'](saveUpdates(_0x5cd1f6[_0xd89b('0x4a')],null))[_0xd89b('0x26')](respondWithResult(_0x300e25,null))[_0xd89b('0x43')](handleError(_0x300e25,null));};exports[_0xd89b('0x27')]=function(_0x2edccf,_0x870ac3){return db[_0xd89b('0x40')][_0xd89b('0x48')]({'where':{'id':_0x2edccf[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x870ac3,null))['then'](removeEntity(_0x870ac3,null))['catch'](handleError(_0x870ac3,null));};exports[_0xd89b('0x4b')]=function(_0x81d382,_0x194297,_0x2f9928){var _0x4acec4={};var _0x4b168c={};var _0x306dec;var _0x34cc56;return db['ZohoConfiguration'][_0xd89b('0x4c')]({'where':{'id':_0x81d382['params']['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x194297,null))['then'](function(_0x4395e6){if(_0x4395e6){_0x306dec=_0x4395e6;_0x4b168c[_0xd89b('0x2e')]=_['keys'](db[_0xd89b('0x4d')][_0xd89b('0x2b')]);_0x4b168c[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x81d382[_0xd89b('0x30')]);_0x4b168c[_0xd89b('0x31')]=_['intersection'](_0x4b168c[_0xd89b('0x2e')],_0x4b168c['query']);_0x4acec4[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x4b168c[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x34')]));_0x4acec4[_0xd89b('0x33')]=_0x4acec4['attributes'][_0xd89b('0x4e')]?_0x4acec4[_0xd89b('0x33')]:_0x4b168c[_0xd89b('0x2e')];_0x4acec4['order']=qs[_0xd89b('0x37')](_0x81d382['query']['sort']);_0x4acec4[_0xd89b('0x3a')]=qs[_0xd89b('0x31')](_['pick'](_0x81d382['query'],_0x4b168c[_0xd89b('0x31')]));if(_0x81d382[_0xd89b('0x30')][_0xd89b('0x39')]){_0x4acec4[_0xd89b('0x3a')]=_['merge'](_0x4acec4[_0xd89b('0x3a')],{'$or':_['map'](_0x4acec4['attributes'],function(_0x335e25){var _0x4d45bb={};_0x4d45bb[_0x335e25]={'$like':'%'+_0x81d382[_0xd89b('0x30')]['filter']+'%'};return _0x4d45bb;})});}_0x4acec4=_['merge']({},_0x4acec4,_0x81d382[_0xd89b('0x47')]);return _0x306dec[_0xd89b('0x4b')](_0x4acec4);}})[_0xd89b('0x26')](function(_0x1e599e){if(_0x1e599e){_0x34cc56=_0x1e599e[_0xd89b('0x4e')];if(!_0x81d382['query']['hasOwnProperty'](_0xd89b('0x35'))){_0x4acec4[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x4acec4['offset']=qs[_0xd89b('0x1c')](_0x81d382[_0xd89b('0x30')][_0xd89b('0x1c')]);}return _0x306dec[_0xd89b('0x4b')](_0x4acec4);}})[_0xd89b('0x26')](function(_0x170dfc){if(_0x170dfc){return _0x170dfc?{'count':_0x34cc56,'rows':_0x170dfc}:null;}})[_0xd89b('0x26')](respondWithResult(_0x194297,null))[_0xd89b('0x43')](handleError(_0x194297,null));};exports[_0xd89b('0x4f')]=function(_0x50065d,_0x4df7e9,_0x3bc755){var _0x42112f={};var _0x398d7f={};var _0x499072;var _0x7b36b4;return db[_0xd89b('0x40')]['findOne']({'where':{'id':_0x50065d[_0xd89b('0x45')]['id']}})[_0xd89b('0x26')](handleEntityNotFound(_0x4df7e9,null))['then'](function(_0x372320){if(_0x372320){_0x499072=_0x372320;_0x398d7f[_0xd89b('0x2e')]=_['keys'](db['ZohoField'][_0xd89b('0x2b')]);_0x398d7f[_0xd89b('0x30')]=_['keys'](_0x50065d[_0xd89b('0x30')]);_0x398d7f['filters']=_['intersection'](_0x398d7f[_0xd89b('0x2e')],_0x398d7f[_0xd89b('0x30')]);_0x42112f['attributes']=_['intersection'](_0x398d7f[_0xd89b('0x2e')],qs['fields'](_0x50065d[_0xd89b('0x30')][_0xd89b('0x34')]));_0x42112f[_0xd89b('0x33')]=_0x42112f[_0xd89b('0x33')]['length']?_0x42112f[_0xd89b('0x33')]:_0x398d7f['model'];_0x42112f['order']=qs[_0xd89b('0x37')](_0x50065d['query'][_0xd89b('0x37')]);_0x42112f[_0xd89b('0x3a')]=qs['filters'](_[_0xd89b('0x38')](_0x50065d[_0xd89b('0x30')],_0x398d7f['filters']));if(_0x50065d[_0xd89b('0x30')][_0xd89b('0x39')]){_0x42112f['where']=_[_0xd89b('0x3b')](_0x42112f[_0xd89b('0x3a')],{'$or':_[_0xd89b('0x2f')](_0x42112f['attributes'],function(_0x5c7668){var _0x39c387={};_0x39c387[_0x5c7668]={'$like':'%'+_0x50065d[_0xd89b('0x30')][_0xd89b('0x39')]+'%'};return _0x39c387;})});}_0x42112f=_['merge']({},_0x42112f,_0x50065d[_0xd89b('0x47')]);return _0x499072['getSubjects'](_0x42112f);}})[_0xd89b('0x26')](function(_0x5b454e){if(_0x5b454e){_0x7b36b4=_0x5b454e['length'];if(!_0x50065d[_0xd89b('0x30')][_0xd89b('0x50')]('nolimit')){_0x42112f[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x50065d[_0xd89b('0x30')][_0xd89b('0x1f')]);_0x42112f[_0xd89b('0x1c')]=qs['offset'](_0x50065d['query'][_0xd89b('0x1c')]);}return _0x499072['getSubjects'](_0x42112f);}})[_0xd89b('0x26')](function(_0x4e1679){if(_0x4e1679){return _0x4e1679?{'count':_0x7b36b4,'rows':_0x4e1679}:null;}})[_0xd89b('0x26')](respondWithResult(_0x4df7e9,null))['catch'](handleError(_0x4df7e9,null));};exports['getDescriptions']=function(_0x319b74,_0x5b3014,_0x15679d){var _0x259f8a={};var _0x2e4243={};var _0x30bdf3;var _0x503388;return db[_0xd89b('0x40')]['findOne']({'where':{'id':_0x319b74['params']['id']}})['then'](handleEntityNotFound(_0x5b3014,null))[_0xd89b('0x26')](function(_0x2929c9){if(_0x2929c9){_0x30bdf3=_0x2929c9;_0x2e4243[_0xd89b('0x2e')]=_[_0xd89b('0x46')](db[_0xd89b('0x4d')][_0xd89b('0x2b')]);_0x2e4243[_0xd89b('0x30')]=_[_0xd89b('0x46')](_0x319b74[_0xd89b('0x30')]);_0x2e4243[_0xd89b('0x31')]=_[_0xd89b('0x32')](_0x2e4243[_0xd89b('0x2e')],_0x2e4243[_0xd89b('0x30')]);_0x259f8a[_0xd89b('0x33')]=_[_0xd89b('0x32')](_0x2e4243[_0xd89b('0x2e')],qs[_0xd89b('0x34')](_0x319b74[_0xd89b('0x30')][_0xd89b('0x34')]));_0x259f8a[_0xd89b('0x33')]=_0x259f8a[_0xd89b('0x33')][_0xd89b('0x4e')]?_0x259f8a[_0xd89b('0x33')]:_0x2e4243[_0xd89b('0x2e')];_0x259f8a[_0xd89b('0x36')]=qs['sort'](_0x319b74['query']['sort']);_0x259f8a['where']=qs[_0xd89b('0x31')](_[_0xd89b('0x38')](_0x319b74['query'],_0x2e4243[_0xd89b('0x31')]));if(_0x319b74['query'][_0xd89b('0x39')]){_0x259f8a['where']=_[_0xd89b('0x3b')](_0x259f8a['where'],{'$or':_[_0xd89b('0x2f')](_0x259f8a[_0xd89b('0x33')],function(_0x40f8a8){var _0x1324a7={};_0x1324a7[_0x40f8a8]={'$like':'%'+_0x319b74['query']['filter']+'%'};return _0x1324a7;})});}_0x259f8a=_[_0xd89b('0x3b')]({},_0x259f8a,_0x319b74[_0xd89b('0x47')]);return _0x30bdf3['getDescriptions'](_0x259f8a);}})[_0xd89b('0x26')](function(_0x46de91){if(_0x46de91){_0x503388=_0x46de91[_0xd89b('0x4e')];if(!_0x319b74[_0xd89b('0x30')]['hasOwnProperty'](_0xd89b('0x35'))){_0x259f8a[_0xd89b('0x1f')]=qs[_0xd89b('0x1f')](_0x319b74[_0xd89b('0x30')]['limit']);_0x259f8a[_0xd89b('0x1c')]=qs[_0xd89b('0x1c')](_0x319b74[_0xd89b('0x30')][_0xd89b('0x1c')]);}return _0x30bdf3[_0xd89b('0x51')](_0x259f8a);}})[_0xd89b('0x26')](function(_0x314824){if(_0x314824){return _0x314824?{'count':_0x503388,'rows':_0x314824}:null;}})[_0xd89b('0x26')](respondWithResult(_0x5b3014,null))[_0xd89b('0x43')](handleError(_0x5b3014,null));}; \ No newline at end of file +var _0x94fe=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','ZohoConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','show','keys','include','find','catch','create','body','params','getFields','findOne','options','limit','getSubjects','getDescriptions','ZohoField','eml-format','zip-dir'];(function(_0x5d6e80,_0xc7bfff){var _0x59facb=function(_0x2bda51){while(--_0x2bda51){_0x5d6e80['push'](_0x5d6e80['shift']());}};_0x59facb(++_0xc7bfff);}(_0x94fe,0xee));var _0xe94f=function(_0x11f606,_0x5dfcdb){_0x11f606=_0x11f606-0x0;var _0x46703f=_0x94fe[_0x11f606];return _0x46703f;};'use strict';var emlformat=require(_0xe94f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe94f('0x1'));var jsonpatch=require(_0xe94f('0x2'));var rp=require(_0xe94f('0x3'));var moment=require(_0xe94f('0x4'));var BPromise=require(_0xe94f('0x5'));var Mustache=require(_0xe94f('0x6'));var util=require('util');var path=require(_0xe94f('0x7'));var sox=require('sox');var csv=require(_0xe94f('0x8'));var ejs=require(_0xe94f('0x9'));var fs=require('fs');var fs_extra=require(_0xe94f('0xa'));var _=require(_0xe94f('0xb'));var squel=require(_0xe94f('0xc'));var crypto=require(_0xe94f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe94f('0x8'));var querystring=require(_0xe94f('0xe'));var Papa=require(_0xe94f('0xf'));var Redis=require('ioredis');var authService=require(_0xe94f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe94f('0x11'));var hardwareService=require(_0xe94f('0x12'));var logger=require(_0xe94f('0x13'))(_0xe94f('0x14'));var utils=require(_0xe94f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe94f('0x16'));var db=require(_0xe94f('0x17'))['db'];function respondWithStatusCode(_0x559df6,_0x252ed1){_0x252ed1=_0x252ed1||0xcc;return function(_0x207f09){if(_0x207f09){return _0x559df6[_0xe94f('0x18')](_0x252ed1);}return _0x559df6['status'](_0x252ed1)[_0xe94f('0x19')]();};}function respondWithResult(_0x21609c,_0xb5a4e3){_0xb5a4e3=_0xb5a4e3||0xc8;return function(_0x4cf56b){if(_0x4cf56b){return _0x21609c[_0xe94f('0x1a')](_0xb5a4e3)[_0xe94f('0x1b')](_0x4cf56b);}};}function respondWithFilteredResult(_0x2a9c6a,_0x1e8972){return function(_0x2d555b){if(_0x2d555b){var _0x54fdb9=typeof _0x1e8972[_0xe94f('0x1c')]===_0xe94f('0x1d')&&typeof _0x1e8972['limit']===_0xe94f('0x1d');var _0x2810a6=_0x2d555b['count'];var _0xb85530=_0x54fdb9?0x0:_0x1e8972[_0xe94f('0x1c')];var _0xa9a660=_0x54fdb9?_0x2d555b[_0xe94f('0x1e')]:_0x1e8972[_0xe94f('0x1c')]+_0x1e8972['limit'];var _0x278bf4;if(_0xa9a660>=_0x2810a6){_0xa9a660=_0x2810a6;_0x278bf4=0xc8;}else{_0x278bf4=0xce;}_0x2a9c6a[_0xe94f('0x1a')](_0x278bf4);return _0x2a9c6a[_0xe94f('0x1f')](_0xe94f('0x20'),_0xb85530+'-'+_0xa9a660+'/'+_0x2810a6)[_0xe94f('0x1b')](_0x2d555b);}return null;};}function patchUpdates(_0x2b5a87){return function(_0x2494bf){try{jsonpatch[_0xe94f('0x21')](_0x2494bf,_0x2b5a87,!![]);}catch(_0x35a8df){return BPromise[_0xe94f('0x22')](_0x35a8df);}return _0x2494bf[_0xe94f('0x23')]();};}function saveUpdates(_0x4ac15a,_0x2376dc){return function(_0x2f984f){if(_0x2f984f){return _0x2f984f[_0xe94f('0x24')](_0x4ac15a)[_0xe94f('0x25')](function(_0x3d8132){return _0x3d8132;});}return null;};}function removeEntity(_0x3cdddc,_0x2d47b0){return function(_0x3acd47){if(_0x3acd47){return _0x3acd47[_0xe94f('0x26')]()[_0xe94f('0x25')](function(){_0x3cdddc[_0xe94f('0x1a')](0xcc)[_0xe94f('0x19')]();});}};}function handleEntityNotFound(_0xb096d3,_0x1eb55b){return function(_0x3cb890){if(!_0x3cb890){_0xb096d3[_0xe94f('0x18')](0x194);}return _0x3cb890;};}function handleError(_0x3dbd4e,_0x4fb21e){_0x4fb21e=_0x4fb21e||0x1f4;return function(_0x12c8b8){logger[_0xe94f('0x27')](_0x12c8b8['stack']);if(_0x12c8b8[_0xe94f('0x28')]){delete _0x12c8b8[_0xe94f('0x28')];}_0x3dbd4e[_0xe94f('0x1a')](_0x4fb21e)[_0xe94f('0x29')](_0x12c8b8);};}exports['index']=function(_0x1259d4,_0x17ec67){var _0x11c388={},_0x16fbd8={},_0x44eaaa={'count':0x0,'rows':[]};var _0x5aac2b=_['map'](db[_0xe94f('0x2a')][_0xe94f('0x2b')],function(_0x33c139){return{'name':_0x33c139['fieldName'],'type':_0x33c139[_0xe94f('0x2c')][_0xe94f('0x2d')]};});_0x16fbd8[_0xe94f('0x2e')]=_['map'](_0x5aac2b,_0xe94f('0x28'));_0x16fbd8[_0xe94f('0x2f')]=_['keys'](_0x1259d4[_0xe94f('0x2f')]);_0x16fbd8[_0xe94f('0x30')]=_[_0xe94f('0x31')](_0x16fbd8[_0xe94f('0x2e')],_0x16fbd8[_0xe94f('0x2f')]);_0x11c388[_0xe94f('0x32')]=_[_0xe94f('0x31')](_0x16fbd8[_0xe94f('0x2e')],qs[_0xe94f('0x33')](_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x33')]));_0x11c388['attributes']=_0x11c388[_0xe94f('0x32')][_0xe94f('0x34')]?_0x11c388['attributes']:_0x16fbd8[_0xe94f('0x2e')];if(!_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x35')](_0xe94f('0x36'))){_0x11c388['limit']=qs['limit'](_0x1259d4[_0xe94f('0x2f')]['limit']);_0x11c388[_0xe94f('0x1c')]=qs[_0xe94f('0x1c')](_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x1c')]);}_0x11c388[_0xe94f('0x37')]=qs['sort'](_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x38')]);_0x11c388[_0xe94f('0x39')]=qs['filters'](_[_0xe94f('0x3a')](_0x1259d4[_0xe94f('0x2f')],_0x16fbd8[_0xe94f('0x30')]),_0x5aac2b);if(_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x3b')]){_0x11c388['where']=_[_0xe94f('0x3c')](_0x11c388[_0xe94f('0x39')],{'$or':_[_0xe94f('0x3d')](_0x5aac2b,function(_0x6fc50f){if(_0x6fc50f[_0xe94f('0x2c')]!==_0xe94f('0x3e')){var _0x348c77={};_0x348c77[_0x6fc50f[_0xe94f('0x28')]]={'$like':'%'+_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x3b')]+'%'};return _0x348c77;}})});}_0x11c388=_['merge']({},_0x11c388,_0x1259d4['options']);var _0x2879d4={'where':_0x11c388['where']};return db[_0xe94f('0x2a')][_0xe94f('0x1e')](_0x2879d4)[_0xe94f('0x25')](function(_0x38ea93){_0x44eaaa['count']=_0x38ea93;if(_0x1259d4[_0xe94f('0x2f')][_0xe94f('0x3f')]){_0x11c388['include']=[{'all':!![]}];}return db[_0xe94f('0x2a')][_0xe94f('0x40')](_0x11c388);})[_0xe94f('0x25')](function(_0x85fb29){_0x44eaaa['rows']=_0x85fb29;return _0x44eaaa;})[_0xe94f('0x25')](respondWithFilteredResult(_0x17ec67,_0x11c388))['catch'](handleError(_0x17ec67,null));};exports[_0xe94f('0x41')]=function(_0x2aacf7,_0x4fb01c){var _0x4d6236={'raw':![],'where':{'id':_0x2aacf7['params']['id']}},_0x5858a9={};_0x5858a9[_0xe94f('0x2e')]=_[_0xe94f('0x42')](db[_0xe94f('0x2a')][_0xe94f('0x2b')]);_0x5858a9[_0xe94f('0x2f')]=_[_0xe94f('0x42')](_0x2aacf7[_0xe94f('0x2f')]);_0x5858a9[_0xe94f('0x30')]=_['intersection'](_0x5858a9['model'],_0x5858a9[_0xe94f('0x2f')]);_0x4d6236[_0xe94f('0x32')]=_[_0xe94f('0x31')](_0x5858a9['model'],qs[_0xe94f('0x33')](_0x2aacf7[_0xe94f('0x2f')][_0xe94f('0x33')]));_0x4d6236[_0xe94f('0x32')]=_0x4d6236[_0xe94f('0x32')][_0xe94f('0x34')]?_0x4d6236['attributes']:_0x5858a9[_0xe94f('0x2e')];if(_0x2aacf7[_0xe94f('0x2f')][_0xe94f('0x3f')]){_0x4d6236[_0xe94f('0x43')]=[{'all':!![]}];}_0x4d6236=_[_0xe94f('0x3c')]({},_0x4d6236,_0x2aacf7['options']);return db[_0xe94f('0x2a')][_0xe94f('0x44')](_0x4d6236)[_0xe94f('0x25')](handleEntityNotFound(_0x4fb01c,null))[_0xe94f('0x25')](respondWithResult(_0x4fb01c,null))[_0xe94f('0x45')](handleError(_0x4fb01c,null));};exports[_0xe94f('0x46')]=function(_0x14f4e3,_0x46e209){return db[_0xe94f('0x2a')][_0xe94f('0x46')](_0x14f4e3[_0xe94f('0x47')],{})[_0xe94f('0x25')](respondWithResult(_0x46e209,0xc9))[_0xe94f('0x45')](handleError(_0x46e209,null));};exports[_0xe94f('0x24')]=function(_0x35a2f3,_0x298eba){if(_0x35a2f3[_0xe94f('0x47')]['id']){delete _0x35a2f3[_0xe94f('0x47')]['id'];}return db[_0xe94f('0x2a')]['find']({'where':{'id':_0x35a2f3[_0xe94f('0x48')]['id']}})[_0xe94f('0x25')](handleEntityNotFound(_0x298eba,null))['then'](saveUpdates(_0x35a2f3[_0xe94f('0x47')],null))[_0xe94f('0x25')](respondWithResult(_0x298eba,null))[_0xe94f('0x45')](handleError(_0x298eba,null));};exports['destroy']=function(_0x3dfa62,_0x290736){return db['ZohoConfiguration'][_0xe94f('0x44')]({'where':{'id':_0x3dfa62[_0xe94f('0x48')]['id']}})['then'](handleEntityNotFound(_0x290736,null))[_0xe94f('0x25')](removeEntity(_0x290736,null))[_0xe94f('0x45')](handleError(_0x290736,null));};exports[_0xe94f('0x49')]=function(_0x4dcc5c,_0x23a1bc,_0x312be1){var _0x5c59de={};var _0x51bd33={};var _0x107e16;var _0x526e34;return db[_0xe94f('0x2a')][_0xe94f('0x4a')]({'where':{'id':_0x4dcc5c[_0xe94f('0x48')]['id']}})[_0xe94f('0x25')](handleEntityNotFound(_0x23a1bc,null))[_0xe94f('0x25')](function(_0x17cdea){if(_0x17cdea){_0x107e16=_0x17cdea;_0x51bd33[_0xe94f('0x2e')]=_[_0xe94f('0x42')](db['ZohoField'][_0xe94f('0x2b')]);_0x51bd33['query']=_['keys'](_0x4dcc5c[_0xe94f('0x2f')]);_0x51bd33[_0xe94f('0x30')]=_[_0xe94f('0x31')](_0x51bd33[_0xe94f('0x2e')],_0x51bd33[_0xe94f('0x2f')]);_0x5c59de['attributes']=_[_0xe94f('0x31')](_0x51bd33[_0xe94f('0x2e')],qs['fields'](_0x4dcc5c[_0xe94f('0x2f')]['fields']));_0x5c59de[_0xe94f('0x32')]=_0x5c59de[_0xe94f('0x32')][_0xe94f('0x34')]?_0x5c59de[_0xe94f('0x32')]:_0x51bd33[_0xe94f('0x2e')];_0x5c59de['order']=qs['sort'](_0x4dcc5c[_0xe94f('0x2f')][_0xe94f('0x38')]);_0x5c59de[_0xe94f('0x39')]=qs[_0xe94f('0x30')](_[_0xe94f('0x3a')](_0x4dcc5c[_0xe94f('0x2f')],_0x51bd33[_0xe94f('0x30')]));if(_0x4dcc5c[_0xe94f('0x2f')][_0xe94f('0x3b')]){_0x5c59de[_0xe94f('0x39')]=_['merge'](_0x5c59de['where'],{'$or':_[_0xe94f('0x3d')](_0x5c59de[_0xe94f('0x32')],function(_0x41e78c){var _0x28cc9f={};_0x28cc9f[_0x41e78c]={'$like':'%'+_0x4dcc5c[_0xe94f('0x2f')][_0xe94f('0x3b')]+'%'};return _0x28cc9f;})});}_0x5c59de=_[_0xe94f('0x3c')]({},_0x5c59de,_0x4dcc5c[_0xe94f('0x4b')]);return _0x107e16[_0xe94f('0x49')](_0x5c59de);}})[_0xe94f('0x25')](function(_0x30c60a){if(_0x30c60a){_0x526e34=_0x30c60a[_0xe94f('0x34')];if(!_0x4dcc5c[_0xe94f('0x2f')][_0xe94f('0x35')](_0xe94f('0x36'))){_0x5c59de[_0xe94f('0x4c')]=qs['limit'](_0x4dcc5c[_0xe94f('0x2f')][_0xe94f('0x4c')]);_0x5c59de[_0xe94f('0x1c')]=qs['offset'](_0x4dcc5c[_0xe94f('0x2f')]['offset']);}return _0x107e16[_0xe94f('0x49')](_0x5c59de);}})['then'](function(_0x54f128){if(_0x54f128){return _0x54f128?{'count':_0x526e34,'rows':_0x54f128}:null;}})[_0xe94f('0x25')](respondWithResult(_0x23a1bc,null))['catch'](handleError(_0x23a1bc,null));};exports[_0xe94f('0x4d')]=function(_0x4ad8a,_0x34b2c6,_0x305f3e){var _0x58e896={};var _0x10b737={};var _0x518d31;var _0x9105db;return db['ZohoConfiguration'][_0xe94f('0x4a')]({'where':{'id':_0x4ad8a['params']['id']}})[_0xe94f('0x25')](handleEntityNotFound(_0x34b2c6,null))[_0xe94f('0x25')](function(_0xab791c){if(_0xab791c){_0x518d31=_0xab791c;_0x10b737[_0xe94f('0x2e')]=_[_0xe94f('0x42')](db['ZohoField'][_0xe94f('0x2b')]);_0x10b737[_0xe94f('0x2f')]=_[_0xe94f('0x42')](_0x4ad8a[_0xe94f('0x2f')]);_0x10b737[_0xe94f('0x30')]=_['intersection'](_0x10b737[_0xe94f('0x2e')],_0x10b737[_0xe94f('0x2f')]);_0x58e896['attributes']=_['intersection'](_0x10b737[_0xe94f('0x2e')],qs[_0xe94f('0x33')](_0x4ad8a[_0xe94f('0x2f')][_0xe94f('0x33')]));_0x58e896[_0xe94f('0x32')]=_0x58e896[_0xe94f('0x32')][_0xe94f('0x34')]?_0x58e896['attributes']:_0x10b737['model'];_0x58e896['order']=qs[_0xe94f('0x38')](_0x4ad8a[_0xe94f('0x2f')][_0xe94f('0x38')]);_0x58e896['where']=qs[_0xe94f('0x30')](_['pick'](_0x4ad8a['query'],_0x10b737[_0xe94f('0x30')]));if(_0x4ad8a['query'][_0xe94f('0x3b')]){_0x58e896[_0xe94f('0x39')]=_['merge'](_0x58e896[_0xe94f('0x39')],{'$or':_[_0xe94f('0x3d')](_0x58e896[_0xe94f('0x32')],function(_0x428628){var _0x44c07d={};_0x44c07d[_0x428628]={'$like':'%'+_0x4ad8a[_0xe94f('0x2f')]['filter']+'%'};return _0x44c07d;})});}_0x58e896=_[_0xe94f('0x3c')]({},_0x58e896,_0x4ad8a[_0xe94f('0x4b')]);return _0x518d31['getSubjects'](_0x58e896);}})[_0xe94f('0x25')](function(_0x5e3832){if(_0x5e3832){_0x9105db=_0x5e3832['length'];if(!_0x4ad8a[_0xe94f('0x2f')]['hasOwnProperty']('nolimit')){_0x58e896[_0xe94f('0x4c')]=qs[_0xe94f('0x4c')](_0x4ad8a[_0xe94f('0x2f')][_0xe94f('0x4c')]);_0x58e896[_0xe94f('0x1c')]=qs[_0xe94f('0x1c')](_0x4ad8a['query'][_0xe94f('0x1c')]);}return _0x518d31[_0xe94f('0x4d')](_0x58e896);}})[_0xe94f('0x25')](function(_0x352c90){if(_0x352c90){return _0x352c90?{'count':_0x9105db,'rows':_0x352c90}:null;}})[_0xe94f('0x25')](respondWithResult(_0x34b2c6,null))[_0xe94f('0x45')](handleError(_0x34b2c6,null));};exports[_0xe94f('0x4e')]=function(_0x260d7f,_0x2b8619,_0x5e956d){var _0x546641={};var _0x53f28b={};var _0xd82e2c;var _0x4bcd6f;return db['ZohoConfiguration'][_0xe94f('0x4a')]({'where':{'id':_0x260d7f[_0xe94f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b8619,null))[_0xe94f('0x25')](function(_0x526676){if(_0x526676){_0xd82e2c=_0x526676;_0x53f28b[_0xe94f('0x2e')]=_[_0xe94f('0x42')](db[_0xe94f('0x4f')]['rawAttributes']);_0x53f28b[_0xe94f('0x2f')]=_[_0xe94f('0x42')](_0x260d7f[_0xe94f('0x2f')]);_0x53f28b[_0xe94f('0x30')]=_[_0xe94f('0x31')](_0x53f28b[_0xe94f('0x2e')],_0x53f28b[_0xe94f('0x2f')]);_0x546641['attributes']=_[_0xe94f('0x31')](_0x53f28b[_0xe94f('0x2e')],qs[_0xe94f('0x33')](_0x260d7f['query'][_0xe94f('0x33')]));_0x546641[_0xe94f('0x32')]=_0x546641[_0xe94f('0x32')][_0xe94f('0x34')]?_0x546641[_0xe94f('0x32')]:_0x53f28b[_0xe94f('0x2e')];_0x546641[_0xe94f('0x37')]=qs[_0xe94f('0x38')](_0x260d7f['query']['sort']);_0x546641[_0xe94f('0x39')]=qs[_0xe94f('0x30')](_[_0xe94f('0x3a')](_0x260d7f[_0xe94f('0x2f')],_0x53f28b[_0xe94f('0x30')]));if(_0x260d7f[_0xe94f('0x2f')][_0xe94f('0x3b')]){_0x546641['where']=_[_0xe94f('0x3c')](_0x546641[_0xe94f('0x39')],{'$or':_[_0xe94f('0x3d')](_0x546641[_0xe94f('0x32')],function(_0x3b887c){var _0x4d6308={};_0x4d6308[_0x3b887c]={'$like':'%'+_0x260d7f['query'][_0xe94f('0x3b')]+'%'};return _0x4d6308;})});}_0x546641=_['merge']({},_0x546641,_0x260d7f['options']);return _0xd82e2c[_0xe94f('0x4e')](_0x546641);}})[_0xe94f('0x25')](function(_0x1e84ff){if(_0x1e84ff){_0x4bcd6f=_0x1e84ff[_0xe94f('0x34')];if(!_0x260d7f[_0xe94f('0x2f')][_0xe94f('0x35')](_0xe94f('0x36'))){_0x546641['limit']=qs['limit'](_0x260d7f['query']['limit']);_0x546641['offset']=qs['offset'](_0x260d7f[_0xe94f('0x2f')]['offset']);}return _0xd82e2c[_0xe94f('0x4e')](_0x546641);}})[_0xe94f('0x25')](function(_0x51d8a4){if(_0x51d8a4){return _0x51d8a4?{'count':_0x4bcd6f,'rows':_0x51d8a4}:null;}})[_0xe94f('0x25')](respondWithResult(_0x2b8619,null))['catch'](handleError(_0x2b8619,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7426fdd..d123e29 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 _0x518a=['moment','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x518a,0xec));var _0xa518=function(_0x1a94db,_0x51850b){_0x1a94db=_0x1a94db-0x0;var _0x4890da=_0x518a[_0x1a94db];return _0x4890da;};'use strict';var _=require(_0xa518('0x0'));var util=require(_0xa518('0x1'));var logger=require(_0xa518('0x2'))(_0xa518('0x3'));var moment=require(_0xa518('0x4'));var BPromise=require('bluebird');var rp=require(_0xa518('0x5'));var fs=require('fs');var path=require(_0xa518('0x6'));var rimraf=require('rimraf');var config=require(_0xa518('0x7'));var attributes=require(_0xa518('0x8'));module[_0xa518('0x9')]=function(_0x493abf,_0x57d199){return _0x493abf[_0xa518('0xa')]('ZohoConfiguration',attributes,{'tableName':_0xa518('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f06=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x522695,_0x462356){var _0x183f5f=function(_0x22fab1){while(--_0x22fab1){_0x522695['push'](_0x522695['shift']());}};_0x183f5f(++_0x462356);}(_0x7f06,0xea));var _0x67f0=function(_0x3bca81,_0x42c9b7){_0x3bca81=_0x3bca81-0x0;var _0xf503a2=_0x7f06[_0x3bca81];return _0xf503a2;};'use strict';var _=require(_0x67f0('0x0'));var util=require(_0x67f0('0x1'));var logger=require(_0x67f0('0x2'))('api');var moment=require(_0x67f0('0x3'));var BPromise=require(_0x67f0('0x4'));var rp=require(_0x67f0('0x5'));var fs=require('fs');var path=require(_0x67f0('0x6'));var rimraf=require(_0x67f0('0x7'));var config=require(_0x67f0('0x8'));var attributes=require(_0x67f0('0x9'));module['exports']=function(_0x3ccb16,_0x9eb470){return _0x3ccb16['define'](_0x67f0('0xa'),attributes,{'tableName':_0x67f0('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 69b6b23..6ec8abb 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 _0xcf47=['info','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x20a92c,_0x1b88aa){var _0x3e756f=function(_0x1df598){while(--_0x1df598){_0x20a92c['push'](_0x20a92c['shift']());}};_0x3e756f(++_0x1b88aa);}(_0xcf47,0xef));var _0x7cf4=function(_0xb227fc,_0x39dede){_0xb227fc=_0xb227fc-0x0;var _0x51096f=_0xcf47[_0xb227fc];return _0x51096f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7cf4('0x0'));var rs=require(_0x7cf4('0x1'));var fs=require('fs');var Redis=require(_0x7cf4('0x2'));var db=require(_0x7cf4('0x3'))['db'];var utils=require(_0x7cf4('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7cf4('0x5'));var jayson=require(_0x7cf4('0x6'));var client=jayson[_0x7cf4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541c28,_0x218c96,_0x53c9a0){return new BPromise(function(_0x3b73f9,_0x806f13){return client[_0x7cf4('0x8')](_0x541c28,_0x53c9a0)['then'](function(_0x48aebe){logger['info'](_0x7cf4('0x9'),_0x218c96,_0x7cf4('0xa'));logger[_0x7cf4('0xb')](_0x7cf4('0xc'),_0x218c96,_0x7cf4('0xa'),JSON[_0x7cf4('0xd')](_0x48aebe));if(_0x48aebe[_0x7cf4('0xe')]){if(_0x48aebe[_0x7cf4('0xe')]['code']===0x1f4){logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x48aebe['error'][_0x7cf4('0xf')]);return _0x806f13(_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);}logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);return _0x3b73f9(_0x48aebe[_0x7cf4('0xe')][_0x7cf4('0xf')]);}else{logger[_0x7cf4('0x10')](_0x7cf4('0x9'),_0x218c96,_0x7cf4('0xa'));_0x3b73f9(_0x48aebe['result'][_0x7cf4('0xf')]);}})['catch'](function(_0x164435){logger[_0x7cf4('0xe')](_0x7cf4('0x9'),_0x218c96,_0x164435);_0x806f13(_0x164435);});});} \ No newline at end of file +var _0x187f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x187f,0x19d));var _0xf187=function(_0xf7e355,_0x1f65a6){_0xf7e355=_0xf7e355-0x0;var _0xe615ed=_0x187f[_0xf7e355];return _0xe615ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf187('0x0'));var BPromise=require(_0xf187('0x1'));var rs=require(_0xf187('0x2'));var fs=require('fs');var Redis=require(_0xf187('0x3'));var db=require(_0xf187('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf187('0x5'))(_0xf187('0x6'));var config=require(_0xf187('0x7'));var jayson=require(_0xf187('0x8'));var client=jayson[_0xf187('0x9')][_0xf187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52cfa6,_0x428a15,_0x4e500b){return new BPromise(function(_0x280d9a,_0x21c25c){return client['request'](_0x52cfa6,_0x4e500b)[_0xf187('0xb')](function(_0x37fe0e){logger[_0xf187('0xc')](_0xf187('0xd'),_0x428a15,'request\x20sent');logger['debug'](_0xf187('0xe'),_0x428a15,_0xf187('0xf'),JSON[_0xf187('0x10')](_0x37fe0e));if(_0x37fe0e[_0xf187('0x11')]){if(_0x37fe0e['error']['code']===0x1f4){logger[_0xf187('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x428a15,_0x37fe0e[_0xf187('0x11')][_0xf187('0x12')]);return _0x21c25c(_0x37fe0e[_0xf187('0x11')]['message']);}logger[_0xf187('0x11')](_0xf187('0xd'),_0x428a15,_0x37fe0e[_0xf187('0x11')][_0xf187('0x12')]);return _0x280d9a(_0x37fe0e[_0xf187('0x11')][_0xf187('0x12')]);}else{logger[_0xf187('0xc')](_0xf187('0xd'),_0x428a15,_0xf187('0xf'));_0x280d9a(_0x37fe0e['result'][_0xf187('0x12')]);}})['catch'](function(_0x59dc4a){logger[_0xf187('0x11')](_0xf187('0xd'),_0x428a15,_0x59dc4a);_0x21c25c(_0x59dc4a);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2d75a0d..37d8de3 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 _0x74f1=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x1e6346,_0x57ccbd){var _0x770c06=function(_0x4a9aa9){while(--_0x4a9aa9){_0x1e6346['push'](_0x1e6346['shift']());}};_0x770c06(++_0x57ccbd);}(_0x74f1,0x66));var _0x174f=function(_0x306646,_0xdc2e1b){_0x306646=_0x306646-0x0;var _0x40bd8d=_0x74f1[_0x306646];return _0x40bd8d;};'use strict';var multer=require(_0x174f('0x0'));var util=require('util');var path=require(_0x174f('0x1'));var timeout=require(_0x174f('0x2'));var express=require('express');var router=express[_0x174f('0x3')]();var fs_extra=require(_0x174f('0x4'));var auth=require(_0x174f('0x5'));var interaction=require(_0x174f('0x6'));var config=require('../../config/environment');var controller=require(_0x174f('0x7'));router[_0x174f('0x8')]('/',auth[_0x174f('0x9')](),controller[_0x174f('0xa')]);router[_0x174f('0x8')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller[_0x174f('0xc')]);router[_0x174f('0xd')]('/',auth[_0x174f('0x9')](),controller[_0x174f('0xe')]);router[_0x174f('0xf')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller['update']);router[_0x174f('0x10')](_0x174f('0xb'),auth[_0x174f('0x9')](),controller[_0x174f('0x11')]);module[_0x174f('0x12')]=router; \ No newline at end of file +var _0x18e4=['update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x838986,_0x2c0e80){var _0x5cdd95=function(_0x3cba26){while(--_0x3cba26){_0x838986['push'](_0x838986['shift']());}};_0x5cdd95(++_0x2c0e80);}(_0x18e4,0xff));var _0x418e=function(_0x11162d,_0x3c7e4f){_0x11162d=_0x11162d-0x0;var _0x5f4aeb=_0x18e4[_0x11162d];return _0x5f4aeb;};'use strict';var multer=require('multer');var util=require(_0x418e('0x0'));var path=require('path');var timeout=require(_0x418e('0x1'));var express=require(_0x418e('0x2'));var router=express[_0x418e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x418e('0x4'));var interaction=require(_0x418e('0x5'));var config=require('../../config/environment');var controller=require(_0x418e('0x6'));router[_0x418e('0x7')]('/',auth[_0x418e('0x8')](),controller[_0x418e('0x9')]);router[_0x418e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x418e('0xa')]);router[_0x418e('0xb')]('/',auth[_0x418e('0x8')](),controller[_0x418e('0xc')]);router[_0x418e('0xd')](_0x418e('0xe'),auth['isAuthenticated'](),controller[_0x418e('0xf')]);router[_0x418e('0x10')](_0x418e('0xe'),auth[_0x418e('0x8')](),controller[_0x418e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f946756..0b994b1 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 _0x9eec=['string','variable','keyValue','picklist','STRING','exports','ENUM'];(function(_0x12a586,_0x119c7b){var _0x50cbec=function(_0x552662){while(--_0x552662){_0x12a586['push'](_0x12a586['shift']());}};_0x50cbec(++_0x119c7b);}(_0x9eec,0xec));var _0xc9ee=function(_0x35d453,_0x4e7b98){_0x35d453=_0x35d453-0x0;var _0x370083=_0x9eec[_0x35d453];return _0x370083;};'use strict';var Sequelize=require('sequelize');module[_0xc9ee('0x0')]={'type':{'type':Sequelize[_0xc9ee('0x1')](_0xc9ee('0x2'),_0xc9ee('0x3'),'customVariable',_0xc9ee('0x4'),_0xc9ee('0x5')),'defaultValue':_0xc9ee('0x2')},'content':{'type':Sequelize[_0xc9ee('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc9ee('0x1')](_0xc9ee('0x2'),_0xc9ee('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc9ee('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc9ee('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9ee('0x6')]}}; \ No newline at end of file +var _0x4826=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x186c15,_0x41f97c){var _0x4493f8=function(_0x4efe37){while(--_0x4efe37){_0x186c15['push'](_0x186c15['shift']());}};_0x4493f8(++_0x41f97c);}(_0x4826,0x1e8));var _0x6482=function(_0x713667,_0xa4c84d){_0x713667=_0x713667-0x0;var _0x402996=_0x4826[_0x713667];return _0x402996;};'use strict';var Sequelize=require(_0x6482('0x0'));module[_0x6482('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6482('0x2'),_0x6482('0x3'),_0x6482('0x4'),_0x6482('0x5'),_0x6482('0x6')),'defaultValue':_0x6482('0x2')},'content':{'type':Sequelize[_0x6482('0x7')]},'key':{'type':Sequelize[_0x6482('0x7')]},'keyType':{'type':Sequelize[_0x6482('0x8')]('string','variable',_0x6482('0x4'))},'keyContent':{'type':Sequelize[_0x6482('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6482('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6482('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9ef46c0..87dda20 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 _0x88be=['then','end','sendStatus','error','stack','name','send','index','map','ZohoField','fieldName','type','key','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','keys','rawAttributes','include','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x88be,0xcb));var _0xe88b=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x88be[_0x4e1d03];return _0x362d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe88b('0x0'));var zipdir=require(_0xe88b('0x1'));var jsonpatch=require(_0xe88b('0x2'));var rp=require(_0xe88b('0x3'));var moment=require(_0xe88b('0x4'));var BPromise=require(_0xe88b('0x5'));var Mustache=require(_0xe88b('0x6'));var util=require('util');var path=require(_0xe88b('0x7'));var sox=require(_0xe88b('0x8'));var csv=require('to-csv');var ejs=require(_0xe88b('0x9'));var fs=require('fs');var fs_extra=require(_0xe88b('0xa'));var _=require(_0xe88b('0xb'));var squel=require(_0xe88b('0xc'));var crypto=require(_0xe88b('0xd'));var jsforce=require(_0xe88b('0xe'));var deskjs=require(_0xe88b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe88b('0x10'));var Papa=require('papaparse');var Redis=require(_0xe88b('0x11'));var authService=require(_0xe88b('0x12'));var qs=require(_0xe88b('0x13'));var as=require(_0xe88b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe88b('0x15'))(_0xe88b('0x16'));var utils=require(_0xe88b('0x17'));var config=require(_0xe88b('0x18'));var licenseUtil=require(_0xe88b('0x19'));var db=require(_0xe88b('0x1a'))['db'];function respondWithStatusCode(_0x439012,_0x386004){_0x386004=_0x386004||0xcc;return function(_0x1fd07d){if(_0x1fd07d){return _0x439012['sendStatus'](_0x386004);}return _0x439012[_0xe88b('0x1b')](_0x386004)['end']();};}function respondWithResult(_0x3dbdc1,_0xb1f62b){_0xb1f62b=_0xb1f62b||0xc8;return function(_0x43543d){if(_0x43543d){return _0x3dbdc1[_0xe88b('0x1b')](_0xb1f62b)['json'](_0x43543d);}};}function respondWithFilteredResult(_0x285767,_0x5315dd){return function(_0x158f84){if(_0x158f84){var _0x146adc=typeof _0x5315dd['offset']==='undefined'&&typeof _0x5315dd['limit']===_0xe88b('0x1c');var _0x3922d7=_0x158f84['count'];var _0xf2bf08=_0x146adc?0x0:_0x5315dd['offset'];var _0xa575f7=_0x146adc?_0x158f84[_0xe88b('0x1d')]:_0x5315dd[_0xe88b('0x1e')]+_0x5315dd[_0xe88b('0x1f')];var _0x17b193;if(_0xa575f7>=_0x3922d7){_0xa575f7=_0x3922d7;_0x17b193=0xc8;}else{_0x17b193=0xce;}_0x285767[_0xe88b('0x1b')](_0x17b193);return _0x285767[_0xe88b('0x20')](_0xe88b('0x21'),_0xf2bf08+'-'+_0xa575f7+'/'+_0x3922d7)[_0xe88b('0x22')](_0x158f84);}return null;};}function patchUpdates(_0x1142a0){return function(_0x8581b5){try{jsonpatch[_0xe88b('0x23')](_0x8581b5,_0x1142a0,!![]);}catch(_0x3f4e63){return BPromise[_0xe88b('0x24')](_0x3f4e63);}return _0x8581b5[_0xe88b('0x25')]();};}function saveUpdates(_0xe522bd,_0x17d6ac){return function(_0x358d16){if(_0x358d16){return _0x358d16[_0xe88b('0x26')](_0xe522bd)['then'](function(_0x376240){return _0x376240;});}return null;};}function removeEntity(_0x2f71c5,_0x11fc60){return function(_0x30ceee){if(_0x30ceee){return _0x30ceee[_0xe88b('0x27')]()[_0xe88b('0x28')](function(){_0x2f71c5[_0xe88b('0x1b')](0xcc)[_0xe88b('0x29')]();});}};}function handleEntityNotFound(_0x241dae,_0x40dca){return function(_0x535b3e){if(!_0x535b3e){_0x241dae[_0xe88b('0x2a')](0x194);}return _0x535b3e;};}function handleError(_0xa6166a,_0x41bf4b){_0x41bf4b=_0x41bf4b||0x1f4;return function(_0x27bf94){logger[_0xe88b('0x2b')](_0x27bf94[_0xe88b('0x2c')]);if(_0x27bf94[_0xe88b('0x2d')]){delete _0x27bf94[_0xe88b('0x2d')];}_0xa6166a['status'](_0x41bf4b)[_0xe88b('0x2e')](_0x27bf94);};}exports[_0xe88b('0x2f')]=function(_0x2a965a,_0x2039ae){var _0x2f9c59={},_0x40c599={},_0x40d690={'count':0x0,'rows':[]};var _0xb9deed=_[_0xe88b('0x30')](db[_0xe88b('0x31')]['rawAttributes'],function(_0x48b971){return{'name':_0x48b971[_0xe88b('0x32')],'type':_0x48b971[_0xe88b('0x33')][_0xe88b('0x34')]};});_0x40c599['model']=_[_0xe88b('0x30')](_0xb9deed,'name');_0x40c599['query']=_['keys'](_0x2a965a['query']);_0x40c599['filters']=_[_0xe88b('0x35')](_0x40c599['model'],_0x40c599[_0xe88b('0x36')]);_0x2f9c59[_0xe88b('0x37')]=_[_0xe88b('0x35')](_0x40c599[_0xe88b('0x38')],qs[_0xe88b('0x39')](_0x2a965a['query'][_0xe88b('0x39')]));_0x2f9c59[_0xe88b('0x37')]=_0x2f9c59[_0xe88b('0x37')][_0xe88b('0x3a')]?_0x2f9c59['attributes']:_0x40c599[_0xe88b('0x38')];if(!_0x2a965a[_0xe88b('0x36')][_0xe88b('0x3b')](_0xe88b('0x3c'))){_0x2f9c59[_0xe88b('0x1f')]=qs['limit'](_0x2a965a['query'][_0xe88b('0x1f')]);_0x2f9c59[_0xe88b('0x1e')]=qs[_0xe88b('0x1e')](_0x2a965a[_0xe88b('0x36')][_0xe88b('0x1e')]);}_0x2f9c59[_0xe88b('0x3d')]=qs['sort'](_0x2a965a[_0xe88b('0x36')][_0xe88b('0x3e')]);_0x2f9c59[_0xe88b('0x3f')]=qs[_0xe88b('0x40')](_[_0xe88b('0x41')](_0x2a965a['query'],_0x40c599['filters']),_0xb9deed);if(_0x2a965a[_0xe88b('0x36')][_0xe88b('0x42')]){_0x2f9c59[_0xe88b('0x3f')]=_[_0xe88b('0x43')](_0x2f9c59['where'],{'$or':_['map'](_0xb9deed,function(_0x2fb8be){if(_0x2fb8be[_0xe88b('0x33')]!==_0xe88b('0x44')){var _0x33e335={};_0x33e335[_0x2fb8be['name']]={'$like':'%'+_0x2a965a[_0xe88b('0x36')][_0xe88b('0x42')]+'%'};return _0x33e335;}})});}_0x2f9c59=_[_0xe88b('0x43')]({},_0x2f9c59,_0x2a965a['options']);var _0x376273={'where':_0x2f9c59['where']};return db[_0xe88b('0x31')][_0xe88b('0x1d')](_0x376273)['then'](function(_0x76020){_0x40d690[_0xe88b('0x1d')]=_0x76020;if(_0x2a965a[_0xe88b('0x36')][_0xe88b('0x45')]){_0x2f9c59['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x2f9c59);})[_0xe88b('0x28')](function(_0x55fbaa){_0x40d690[_0xe88b('0x46')]=_0x55fbaa;return _0x40d690;})['then'](respondWithFilteredResult(_0x2039ae,_0x2f9c59))['catch'](handleError(_0x2039ae,null));};exports[_0xe88b('0x47')]=function(_0x14587c,_0x1b8b40){var _0x1dcadb={'raw':!![],'where':{'id':_0x14587c[_0xe88b('0x48')]['id']}},_0x1c98ef={};_0x1c98ef[_0xe88b('0x38')]=_[_0xe88b('0x49')](db['ZohoField'][_0xe88b('0x4a')]);_0x1c98ef[_0xe88b('0x36')]=_[_0xe88b('0x49')](_0x14587c[_0xe88b('0x36')]);_0x1c98ef[_0xe88b('0x40')]=_['intersection'](_0x1c98ef[_0xe88b('0x38')],_0x1c98ef['query']);_0x1dcadb[_0xe88b('0x37')]=_[_0xe88b('0x35')](_0x1c98ef[_0xe88b('0x38')],qs[_0xe88b('0x39')](_0x14587c[_0xe88b('0x36')][_0xe88b('0x39')]));_0x1dcadb['attributes']=_0x1dcadb[_0xe88b('0x37')][_0xe88b('0x3a')]?_0x1dcadb[_0xe88b('0x37')]:_0x1c98ef[_0xe88b('0x38')];if(_0x14587c['query'][_0xe88b('0x45')]){_0x1dcadb[_0xe88b('0x4b')]=[{'all':!![]}];}_0x1dcadb=_[_0xe88b('0x43')]({},_0x1dcadb,_0x14587c[_0xe88b('0x4c')]);return db[_0xe88b('0x31')]['find'](_0x1dcadb)[_0xe88b('0x28')](handleEntityNotFound(_0x1b8b40,null))['then'](respondWithResult(_0x1b8b40,null))[_0xe88b('0x4d')](handleError(_0x1b8b40,null));};exports['create']=function(_0x265a2e,_0x466f0b){return db['ZohoField'][_0xe88b('0x4e')](_0x265a2e['body'],{})['then'](respondWithResult(_0x466f0b,0xc9))[_0xe88b('0x4d')](handleError(_0x466f0b,null));};exports['update']=function(_0x1b4445,_0x34d6bf){if(_0x1b4445[_0xe88b('0x4f')]['id']){delete _0x1b4445[_0xe88b('0x4f')]['id'];}return db[_0xe88b('0x31')][_0xe88b('0x50')]({'where':{'id':_0x1b4445['params']['id']}})[_0xe88b('0x28')](handleEntityNotFound(_0x34d6bf,null))[_0xe88b('0x28')](saveUpdates(_0x1b4445['body'],null))[_0xe88b('0x28')](respondWithResult(_0x34d6bf,null))[_0xe88b('0x4d')](handleError(_0x34d6bf,null));};exports[_0xe88b('0x27')]=function(_0x38f174,_0x304e95){return db[_0xe88b('0x31')]['find']({'where':{'id':_0x38f174[_0xe88b('0x48')]['id']}})['then'](handleEntityNotFound(_0x304e95,null))[_0xe88b('0x28')](removeEntity(_0x304e95,null))[_0xe88b('0x4d')](handleError(_0x304e95,null));}; \ No newline at end of file +var _0xf37a=['../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x196d42,_0x59072d){var _0x530db1=function(_0x45c949){while(--_0x45c949){_0x196d42['push'](_0x196d42['shift']());}};_0x530db1(++_0x59072d);}(_0xf37a,0x1ef));var _0xaf37=function(_0x89cbc,_0x2c1df3){_0x89cbc=_0x89cbc-0x0;var _0x2131d2=_0xf37a[_0x89cbc];return _0x2131d2;};'use strict';var emlformat=require(_0xaf37('0x0'));var rimraf=require(_0xaf37('0x1'));var zipdir=require(_0xaf37('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf37('0x3'));var moment=require(_0xaf37('0x4'));var BPromise=require(_0xaf37('0x5'));var Mustache=require('mustache');var util=require(_0xaf37('0x6'));var path=require('path');var sox=require(_0xaf37('0x7'));var csv=require(_0xaf37('0x8'));var ejs=require(_0xaf37('0x9'));var fs=require('fs');var fs_extra=require(_0xaf37('0xa'));var _=require(_0xaf37('0xb'));var squel=require(_0xaf37('0xc'));var crypto=require(_0xaf37('0xd'));var jsforce=require(_0xaf37('0xe'));var deskjs=require(_0xaf37('0xf'));var toCsv=require(_0xaf37('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf37('0x10'));var authService=require(_0xaf37('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf37('0x12'));var hardwareService=require(_0xaf37('0x13'));var logger=require(_0xaf37('0x14'))('api');var utils=require(_0xaf37('0x15'));var config=require(_0xaf37('0x16'));var licenseUtil=require(_0xaf37('0x17'));var db=require(_0xaf37('0x18'))['db'];function respondWithStatusCode(_0x1cf803,_0x3b265b){_0x3b265b=_0x3b265b||0xcc;return function(_0x14cee2){if(_0x14cee2){return _0x1cf803['sendStatus'](_0x3b265b);}return _0x1cf803[_0xaf37('0x19')](_0x3b265b)[_0xaf37('0x1a')]();};}function respondWithResult(_0x626cb0,_0x56a7d7){_0x56a7d7=_0x56a7d7||0xc8;return function(_0x54150e){if(_0x54150e){return _0x626cb0[_0xaf37('0x19')](_0x56a7d7)['json'](_0x54150e);}};}function respondWithFilteredResult(_0x5a763e,_0x33e902){return function(_0x8211c5){if(_0x8211c5){var _0x1a74ea=typeof _0x33e902[_0xaf37('0x1b')]===_0xaf37('0x1c')&&typeof _0x33e902[_0xaf37('0x1d')]==='undefined';var _0x4a3e8a=_0x8211c5['count'];var _0x37d16f=_0x1a74ea?0x0:_0x33e902[_0xaf37('0x1b')];var _0x113120=_0x1a74ea?_0x8211c5[_0xaf37('0x1e')]:_0x33e902['offset']+_0x33e902['limit'];var _0x35dcad;if(_0x113120>=_0x4a3e8a){_0x113120=_0x4a3e8a;_0x35dcad=0xc8;}else{_0x35dcad=0xce;}_0x5a763e[_0xaf37('0x19')](_0x35dcad);return _0x5a763e['set'](_0xaf37('0x1f'),_0x37d16f+'-'+_0x113120+'/'+_0x4a3e8a)['json'](_0x8211c5);}return null;};}function patchUpdates(_0x4b06de){return function(_0x10cfc9){try{jsonpatch[_0xaf37('0x20')](_0x10cfc9,_0x4b06de,!![]);}catch(_0x4742f8){return BPromise['reject'](_0x4742f8);}return _0x10cfc9[_0xaf37('0x21')]();};}function saveUpdates(_0x541a05,_0x4c6143){return function(_0x1ecee9){if(_0x1ecee9){return _0x1ecee9[_0xaf37('0x22')](_0x541a05)['then'](function(_0x587885){return _0x587885;});}return null;};}function removeEntity(_0x460282,_0x32b163){return function(_0x3adbf9){if(_0x3adbf9){return _0x3adbf9[_0xaf37('0x23')]()[_0xaf37('0x24')](function(){_0x460282[_0xaf37('0x19')](0xcc)[_0xaf37('0x1a')]();});}};}function handleEntityNotFound(_0x150b1e,_0x254dc1){return function(_0x1e89e0){if(!_0x1e89e0){_0x150b1e[_0xaf37('0x25')](0x194);}return _0x1e89e0;};}function handleError(_0x5b9f9b,_0x17f6f4){_0x17f6f4=_0x17f6f4||0x1f4;return function(_0x349442){logger['error'](_0x349442[_0xaf37('0x26')]);if(_0x349442[_0xaf37('0x27')]){delete _0x349442['name'];}_0x5b9f9b[_0xaf37('0x19')](_0x17f6f4)[_0xaf37('0x28')](_0x349442);};}exports[_0xaf37('0x29')]=function(_0x36073f,_0x1383f0){var _0xcef07={},_0xca9701={},_0x1d87d9={'count':0x0,'rows':[]};var _0x334d0c=_[_0xaf37('0x2a')](db[_0xaf37('0x2b')][_0xaf37('0x2c')],function(_0x3eb2e0){return{'name':_0x3eb2e0[_0xaf37('0x2d')],'type':_0x3eb2e0[_0xaf37('0x2e')][_0xaf37('0x2f')]};});_0xca9701['model']=_['map'](_0x334d0c,_0xaf37('0x27'));_0xca9701[_0xaf37('0x30')]=_[_0xaf37('0x31')](_0x36073f[_0xaf37('0x30')]);_0xca9701[_0xaf37('0x32')]=_[_0xaf37('0x33')](_0xca9701['model'],_0xca9701[_0xaf37('0x30')]);_0xcef07['attributes']=_[_0xaf37('0x33')](_0xca9701[_0xaf37('0x34')],qs[_0xaf37('0x35')](_0x36073f[_0xaf37('0x30')]['fields']));_0xcef07[_0xaf37('0x36')]=_0xcef07[_0xaf37('0x36')][_0xaf37('0x37')]?_0xcef07['attributes']:_0xca9701[_0xaf37('0x34')];if(!_0x36073f[_0xaf37('0x30')][_0xaf37('0x38')](_0xaf37('0x39'))){_0xcef07['limit']=qs[_0xaf37('0x1d')](_0x36073f[_0xaf37('0x30')][_0xaf37('0x1d')]);_0xcef07[_0xaf37('0x1b')]=qs[_0xaf37('0x1b')](_0x36073f['query'][_0xaf37('0x1b')]);}_0xcef07[_0xaf37('0x3a')]=qs[_0xaf37('0x3b')](_0x36073f[_0xaf37('0x30')][_0xaf37('0x3b')]);_0xcef07[_0xaf37('0x3c')]=qs[_0xaf37('0x32')](_[_0xaf37('0x3d')](_0x36073f[_0xaf37('0x30')],_0xca9701[_0xaf37('0x32')]),_0x334d0c);if(_0x36073f['query'][_0xaf37('0x3e')]){_0xcef07[_0xaf37('0x3c')]=_[_0xaf37('0x3f')](_0xcef07[_0xaf37('0x3c')],{'$or':_[_0xaf37('0x2a')](_0x334d0c,function(_0x4fa447){if(_0x4fa447[_0xaf37('0x2e')]!=='VIRTUAL'){var _0x283af5={};_0x283af5[_0x4fa447[_0xaf37('0x27')]]={'$like':'%'+_0x36073f[_0xaf37('0x30')][_0xaf37('0x3e')]+'%'};return _0x283af5;}})});}_0xcef07=_[_0xaf37('0x3f')]({},_0xcef07,_0x36073f[_0xaf37('0x40')]);var _0x5e5730={'where':_0xcef07['where']};return db[_0xaf37('0x2b')][_0xaf37('0x1e')](_0x5e5730)[_0xaf37('0x24')](function(_0x2ed47b){_0x1d87d9[_0xaf37('0x1e')]=_0x2ed47b;if(_0x36073f[_0xaf37('0x30')][_0xaf37('0x41')]){_0xcef07['include']=[{'all':!![]}];}return db[_0xaf37('0x2b')][_0xaf37('0x42')](_0xcef07);})[_0xaf37('0x24')](function(_0x186b67){_0x1d87d9['rows']=_0x186b67;return _0x1d87d9;})[_0xaf37('0x24')](respondWithFilteredResult(_0x1383f0,_0xcef07))['catch'](handleError(_0x1383f0,null));};exports[_0xaf37('0x43')]=function(_0x2c242b,_0x10f1fd){var _0x2243be={'raw':!![],'where':{'id':_0x2c242b[_0xaf37('0x44')]['id']}},_0x3fad75={};_0x3fad75['model']=_[_0xaf37('0x31')](db[_0xaf37('0x2b')][_0xaf37('0x2c')]);_0x3fad75['query']=_[_0xaf37('0x31')](_0x2c242b[_0xaf37('0x30')]);_0x3fad75['filters']=_[_0xaf37('0x33')](_0x3fad75['model'],_0x3fad75[_0xaf37('0x30')]);_0x2243be[_0xaf37('0x36')]=_[_0xaf37('0x33')](_0x3fad75[_0xaf37('0x34')],qs[_0xaf37('0x35')](_0x2c242b[_0xaf37('0x30')][_0xaf37('0x35')]));_0x2243be[_0xaf37('0x36')]=_0x2243be[_0xaf37('0x36')][_0xaf37('0x37')]?_0x2243be[_0xaf37('0x36')]:_0x3fad75[_0xaf37('0x34')];if(_0x2c242b[_0xaf37('0x30')]['includeAll']){_0x2243be[_0xaf37('0x45')]=[{'all':!![]}];}_0x2243be=_[_0xaf37('0x3f')]({},_0x2243be,_0x2c242b[_0xaf37('0x40')]);return db['ZohoField'][_0xaf37('0x46')](_0x2243be)['then'](handleEntityNotFound(_0x10f1fd,null))[_0xaf37('0x24')](respondWithResult(_0x10f1fd,null))[_0xaf37('0x47')](handleError(_0x10f1fd,null));};exports[_0xaf37('0x48')]=function(_0x2e6357,_0x417279){return db[_0xaf37('0x2b')][_0xaf37('0x48')](_0x2e6357[_0xaf37('0x49')],{})[_0xaf37('0x24')](respondWithResult(_0x417279,0xc9))['catch'](handleError(_0x417279,null));};exports[_0xaf37('0x22')]=function(_0x416618,_0x2194a3){if(_0x416618[_0xaf37('0x49')]['id']){delete _0x416618[_0xaf37('0x49')]['id'];}return db['ZohoField'][_0xaf37('0x46')]({'where':{'id':_0x416618[_0xaf37('0x44')]['id']}})[_0xaf37('0x24')](handleEntityNotFound(_0x2194a3,null))[_0xaf37('0x24')](saveUpdates(_0x416618[_0xaf37('0x49')],null))[_0xaf37('0x24')](respondWithResult(_0x2194a3,null))[_0xaf37('0x47')](handleError(_0x2194a3,null));};exports[_0xaf37('0x23')]=function(_0x5f1a9f,_0x95dce7){return db[_0xaf37('0x2b')][_0xaf37('0x46')]({'where':{'id':_0x5f1a9f[_0xaf37('0x44')]['id']}})[_0xaf37('0x24')](handleEntityNotFound(_0x95dce7,null))[_0xaf37('0x24')](removeEntity(_0x95dce7,null))[_0xaf37('0x47')](handleError(_0x95dce7,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 4a102ad..0101683 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 _0xb44a=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','../../config/logger','moment','path','../../config/environment','./intZohoField.attributes','exports'];(function(_0x2672e1,_0x34b076){var _0x2b804a=function(_0x142e1d){while(--_0x142e1d){_0x2672e1['push'](_0x2672e1['shift']());}};_0x2b804a(++_0x34b076);}(_0xb44a,0x1c2));var _0xab44=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0xb44a[_0xb03f9];return _0x3ec30a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[{'name':_0xab44('0x9'),'fields':[_0xab44('0xa'),_0xab44('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['exports','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x32b297,_0x3cf096){var _0x15c39f=function(_0x2b56ea){while(--_0x2b56ea){_0x32b297['push'](_0x32b297['shift']());}};_0x15c39f(++_0x3cf096);}(_0x8952,0x17e));var _0x2895=function(_0x51171e,_0xab9b71){_0x51171e=_0x51171e-0x0;var _0x20a045=_0x8952[_0x51171e];return _0x20a045;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZohoField.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZohoField',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb'),_0x2895('0xc')],'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 f1fb468..8ed9f77 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 _0xf7d8=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x58b148,_0x179268){var _0x22cdd5=function(_0x53e73e){while(--_0x53e73e){_0x58b148['push'](_0x58b148['shift']());}};_0x22cdd5(++_0x179268);}(_0xf7d8,0x79));var _0x8f7d=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xf7d8[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x8f7d('0x0'));var util=require('util');var moment=require(_0x8f7d('0x1'));var BPromise=require(_0x8f7d('0x2'));var rs=require(_0x8f7d('0x3'));var fs=require('fs');var Redis=require(_0x8f7d('0x4'));var db=require(_0x8f7d('0x5'))['db'];var utils=require(_0x8f7d('0x6'));var logger=require(_0x8f7d('0x7'))(_0x8f7d('0x8'));var config=require(_0x8f7d('0x9'));var jayson=require(_0x8f7d('0xa'));var client=jayson[_0x8f7d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30da58,_0x2c3a8c,_0x31d78e){return new BPromise(function(_0x18c549,_0x3bea3a){return client[_0x8f7d('0xc')](_0x30da58,_0x31d78e)[_0x8f7d('0xd')](function(_0x1ed988){logger[_0x8f7d('0xe')](_0x8f7d('0xf'),_0x2c3a8c,_0x8f7d('0x10'));logger[_0x8f7d('0x11')](_0x8f7d('0x12'),_0x2c3a8c,_0x8f7d('0x10'),JSON['stringify'](_0x1ed988));if(_0x1ed988[_0x8f7d('0x13')]){if(_0x1ed988[_0x8f7d('0x13')]['code']===0x1f4){logger[_0x8f7d('0x13')]('ZohoField,\x20%s,\x20%s',_0x2c3a8c,_0x1ed988['error'][_0x8f7d('0x14')]);return _0x3bea3a(_0x1ed988[_0x8f7d('0x13')][_0x8f7d('0x14')]);}logger['error'](_0x8f7d('0xf'),_0x2c3a8c,_0x1ed988[_0x8f7d('0x13')][_0x8f7d('0x14')]);return _0x18c549(_0x1ed988['error']['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x2c3a8c,_0x8f7d('0x10'));_0x18c549(_0x1ed988[_0x8f7d('0x15')][_0x8f7d('0x14')]);}})[_0x8f7d('0x16')](function(_0x44cc51){logger[_0x8f7d('0x13')](_0x8f7d('0xf'),_0x2c3a8c,_0x44cc51);_0x3bea3a(_0x44cc51);});});} \ No newline at end of file +var _0x66ca=['ZohoField,\x20%s,\x20%s,\x20%s','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x148366,_0x1530dc){var _0x380aee=function(_0x126ed6){while(--_0x126ed6){_0x148366['push'](_0x148366['shift']());}};_0x380aee(++_0x1530dc);}(_0x66ca,0x79));var _0xa66c=function(_0x40162a,_0x265b0c){_0x40162a=_0x40162a-0x0;var _0x488161=_0x66ca[_0x40162a];return _0x488161;};'use strict';var _=require(_0xa66c('0x0'));var util=require(_0xa66c('0x1'));var moment=require(_0xa66c('0x2'));var BPromise=require(_0xa66c('0x3'));var rs=require(_0xa66c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa66c('0x5'))['db'];var utils=require(_0xa66c('0x6'));var logger=require(_0xa66c('0x7'))(_0xa66c('0x8'));var config=require(_0xa66c('0x9'));var jayson=require(_0xa66c('0xa'));var client=jayson[_0xa66c('0xb')][_0xa66c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e242b,_0x4678ce,_0x4efd7c){return new BPromise(function(_0x5f262a,_0x5559e8){return client['request'](_0x4e242b,_0x4efd7c)[_0xa66c('0xd')](function(_0x1679a4){logger[_0xa66c('0xe')]('ZohoField,\x20%s,\x20%s',_0x4678ce,_0xa66c('0xf'));logger[_0xa66c('0x10')](_0xa66c('0x11'),_0x4678ce,_0xa66c('0xf'),JSON['stringify'](_0x1679a4));if(_0x1679a4['error']){if(_0x1679a4[_0xa66c('0x12')]['code']===0x1f4){logger['error'](_0xa66c('0x13'),_0x4678ce,_0x1679a4[_0xa66c('0x12')][_0xa66c('0x14')]);return _0x5559e8(_0x1679a4[_0xa66c('0x12')]['message']);}logger[_0xa66c('0x12')]('ZohoField,\x20%s,\x20%s',_0x4678ce,_0x1679a4[_0xa66c('0x12')][_0xa66c('0x14')]);return _0x5f262a(_0x1679a4[_0xa66c('0x12')][_0xa66c('0x14')]);}else{logger['info'](_0xa66c('0x13'),_0x4678ce,_0xa66c('0xf'));_0x5f262a(_0x1679a4[_0xa66c('0x15')]['message']);}})[_0xa66c('0x16')](function(_0x1d9f54){logger[_0xa66c('0x12')](_0xa66c('0x13'),_0x4678ce,_0x1d9f54);_0x5559e8(_0x1d9f54);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index be9b272..f7a95c4 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4887aa,_0x2e6612){var _0x1b1242=function(_0x4d87cd){while(--_0x4d87cd){_0x4887aa['push'](_0x4887aa['shift']());}};_0x1b1242(++_0x2e6612);}(_0xe706,0xa3));var _0x6e70=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xe706[_0x202c61];return _0x540691;};'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(_0x4ad626,_0x30f6ce){var _0x496333=function(_0x481022){while(--_0x481022){_0x4ad626['push'](_0x4ad626['shift']());}};_0x496333(++_0x30f6ce);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xcb91[_0x101e7b];return _0x4995c0;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8f7c805..52b9894 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 _0x6268=['BOOLEAN','sequelize','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x2feea2,_0x2acc4f){var _0x3f911d=function(_0x2c844a){while(--_0x2c844a){_0x2feea2['push'](_0x2feea2['shift']());}};_0x3f911d(++_0x2acc4f);}(_0x6268,0x193));var _0x8626=function(_0x5ad5e7,_0x44dad1){_0x5ad5e7=_0x5ad5e7-0x0;var _0x160d53=_0x6268[_0x5ad5e7];return _0x160d53;};'use strict';var Sequelize=require(_0x8626('0x0'));module['exports']={'name':{'type':Sequelize[_0x8626('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x8626('0x1')],'allowNull':![],'unique':_0x8626('0x2')},'main':{'type':Sequelize[_0x8626('0x1')],'defaultValue':_0x8626('0x3')},'filename':{'type':Sequelize[_0x8626('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8626('0x1')]},'size':{'type':Sequelize[_0x8626('0x4')]},'active':{'type':Sequelize[_0x8626('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8626('0x1')]},'logo':{'type':Sequelize[_0x8626('0x1')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x8626('0x1')]},'title':{'type':Sequelize[_0x8626('0x1')]},'remoteUri':{'type':Sequelize[_0x8626('0x1')]},'link':{'type':Sequelize[_0x8626('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7306=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x4c54cf,_0xab3671){var _0xde3751=function(_0x27d046){while(--_0x27d046){_0x4c54cf['push'](_0x4c54cf['shift']());}};_0xde3751(++_0xab3671);}(_0x7306,0xb7));var _0x6730=function(_0x29dd08,_0x371a74){_0x29dd08=_0x29dd08-0x0;var _0x1170bc=_0x7306[_0x29dd08];return _0x1170bc;};'use strict';var Sequelize=require(_0x6730('0x0'));module[_0x6730('0x1')]={'name':{'type':Sequelize[_0x6730('0x2')],'allowNull':![],'unique':_0x6730('0x3')},'version':{'type':Sequelize[_0x6730('0x2')],'allowNull':![],'unique':_0x6730('0x3')},'main':{'type':Sequelize[_0x6730('0x2')],'defaultValue':_0x6730('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x6730('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x6730('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6730('0x2')],'unique':_0x6730('0x6')},'description':{'type':Sequelize[_0x6730('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6730('0x2')]},'link':{'type':Sequelize[_0x6730('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 38c14fa..f446ab3 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x20b5cf,_0x49ec67){var _0x4b86b7=function(_0x734ec1){while(--_0x734ec1){_0x20b5cf['push'](_0x20b5cf['shift']());}};_0x4b86b7(++_0x49ec67);}(_0x7a54,0x106));var _0x47a5=function(_0x372d94,_0x1b66af){_0x372d94=_0x372d94-0x0;var _0x27e897=_0x7a54[_0x372d94];return _0x27e897;};'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['Integration'][_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['Integration']['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['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x4f15d2,_0x4d719a){var _0x55be7a=function(_0x31176f){while(--_0x31176f){_0x4f15d2['push'](_0x4f15d2['shift']());}};_0x55be7a(++_0x4d719a);}(_0x5fab,0x177));var _0xb5fa=function(_0x587ac3,_0x2cf4be){_0x587ac3=_0x587ac3-0x0;var _0x4364f3=_0x5fab[_0x587ac3];return _0x4364f3;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index ee82b3c..d240961 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 _0x7f28=['../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4fde72,_0x545e17){var _0x167bc0=function(_0x28b921){while(--_0x28b921){_0x4fde72['push'](_0x4fde72['shift']());}};_0x167bc0(++_0x545e17);}(_0x7f28,0x1c1));var _0x87f2=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7f28[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x87f2('0x0'));var util=require(_0x87f2('0x1'));var logger=require(_0x87f2('0x2'))(_0x87f2('0x3'));var moment=require(_0x87f2('0x4'));var BPromise=require(_0x87f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x87f2('0x6'));var config=require(_0x87f2('0x7'));var attributes=require(_0x87f2('0x8'));module[_0x87f2('0x9')]=function(_0x2fa3f0,_0x58ec82){return _0x2fa3f0[_0x87f2('0xa')](_0x87f2('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x626a=['rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5a2ef9,_0xafa92e){var _0x6ecb88=function(_0x3ac9f4){while(--_0x3ac9f4){_0x5a2ef9['push'](_0x5a2ef9['shift']());}};_0x6ecb88(++_0xafa92e);}(_0x626a,0x1b3));var _0xa626=function(_0x56d381,_0x337c93){_0x56d381=_0x56d381-0x0;var _0x3553d0=_0x626a[_0x56d381];return _0x3553d0;};'use strict';var _=require(_0xa626('0x0'));var util=require(_0xa626('0x1'));var logger=require(_0xa626('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa626('0x3'));var rp=require(_0xa626('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa626('0x5'));var config=require('../../config/environment');var attributes=require(_0xa626('0x6'));module[_0xa626('0x7')]=function(_0x1b71eb,_0x4e1e05){return _0x1b71eb[_0xa626('0x8')](_0xa626('0x9'),attributes,{'tableName':_0xa626('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index deb2fb1..27ec953 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +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(_0x132d8f,_0xdbc949){var _0x113af7=function(_0x358ab0){while(--_0x358ab0){_0x132d8f['push'](_0x132d8f['shift']());}};_0x113af7(++_0xdbc949);}(_0xdb28,0x106));var _0x8db2=function(_0x250d8f,_0x87f965){_0x250d8f=_0x250d8f-0x0;var _0x226fd3=_0xdb28[_0x250d8f];return _0x226fd3;};'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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index eca7ce5..720e386 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 _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x66fa,0x117));var _0xa66f=function(_0x2490e3,_0x1e7faa){_0x2490e3=_0x2490e3-0x0;var _0x5bcf6d=_0x66fa[_0x2490e3];return _0x5bcf6d;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xdb28,0x106));var _0x8db2=function(_0x386b7b,_0x16ef52){_0x386b7b=_0x386b7b-0x0;var _0x4e0dac=_0xdb28[_0x386b7b];return _0x4e0dac;};'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('./integrationReport.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']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a70fb74..8c0796a 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 _0xea0e=['ENUM','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x31cdff,_0x545438){var _0x14091f=function(_0x363721){while(--_0x363721){_0x31cdff['push'](_0x31cdff['shift']());}};_0x14091f(++_0x545438);}(_0xea0e,0x16f));var _0xeea0=function(_0x2b4ed3,_0x38f189){_0x2b4ed3=_0x2b4ed3-0x0;var _0x465806=_0xea0e[_0x2b4ed3];return _0x465806;};'use strict';var Sequelize=require(_0xeea0('0x0'));module[_0xeea0('0x1')]={'integration':{'type':Sequelize[_0xeea0('0x2')]},'eventChannel':{'type':Sequelize[_0xeea0('0x2')]},'exitStatus':{'type':Sequelize[_0xeea0('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xeea0('0x3')]},'contacts':{'type':Sequelize[_0xeea0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeea0('0x2')]},'calleridname':{'type':Sequelize[_0xeea0('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xeea0('0x2')]},'membername':{'type':Sequelize[_0xeea0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeea0('0x4')]},'agentconnectAt':{'type':Sequelize[_0xeea0('0x4')]},'holdtime':{'type':Sequelize[_0xeea0('0x3')]},'agentcomplete':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xeea0('0x4')]},'talktime':{'type':Sequelize[_0xeea0('0x3')]},'agentacw':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeea0('0x3')]},'reason':{'type':Sequelize[_0xeea0('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xeea0('0x4')]},'agentdump':{'type':Sequelize[_0xeea0('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xeea0('0x2')]},'channel':{'type':Sequelize[_0xeea0('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xeea0('0x2')]},'connectedlinename':{'type':Sequelize[_0xeea0('0x2')]},'language':{'type':Sequelize[_0xeea0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xeea0('0x2')]},'exten':{'type':Sequelize[_0xeea0('0x2')]},'priority':{'type':Sequelize[_0xeea0('0x2')]},'destchannel':{'type':Sequelize[_0xeea0('0x2')]},'destchannelstate':{'type':Sequelize[_0xeea0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xeea0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xeea0('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xeea0('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xeea0('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xeea0('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xeea0('0x2')]},'cc':{'type':Sequelize[_0xeea0('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xeea0('0x6')]},'status':{'type':Sequelize[_0xeea0('0x7')]('SENT',_0xeea0('0x8'),_0xeea0('0x9'),_0xeea0('0xa'))},'url':{'type':Sequelize[_0xeea0('0x2')]},'app':{'type':Sequelize[_0xeea0('0x2')]},'appdata':{'type':Sequelize[_0xeea0('0x2')]},'projectId':{'type':Sequelize[_0xeea0('0x3')]}}; \ No newline at end of file +var _0xbe4d=['sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','RECEIVED','FAILED'];(function(_0x4ec161,_0x2c035e){var _0x43ca6c=function(_0x228e40){while(--_0x228e40){_0x4ec161['push'](_0x4ec161['shift']());}};_0x43ca6c(++_0x2c035e);}(_0xbe4d,0x176));var _0xdbe4=function(_0x27d499,_0x1b0d8e){_0x27d499=_0x27d499-0x0;var _0x51a8f4=_0xbe4d[_0x27d499];return _0x51a8f4;};'use strict';var Sequelize=require(_0xdbe4('0x0'));module[_0xdbe4('0x1')]={'integration':{'type':Sequelize[_0xdbe4('0x2')]},'eventChannel':{'type':Sequelize[_0xdbe4('0x2')]},'exitStatus':{'type':Sequelize[_0xdbe4('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xdbe4('0x3')]},'contacts':{'type':Sequelize[_0xdbe4('0x2')]},'uniqueid':{'type':Sequelize[_0xdbe4('0x2')]},'calleridnum':{'type':Sequelize[_0xdbe4('0x2')]},'calleridname':{'type':Sequelize[_0xdbe4('0x2')]},'queue':{'type':Sequelize[_0xdbe4('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdbe4('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdbe4('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xdbe4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdbe4('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xdbe4('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdbe4('0x5')]},'agentdump':{'type':Sequelize[_0xdbe4('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdbe4('0x5')]},'lastevent':{'type':Sequelize[_0xdbe4('0x2')]},'channel':{'type':Sequelize[_0xdbe4('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdbe4('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdbe4('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xdbe4('0x2')]},'destcalleridnum':{'type':Sequelize[_0xdbe4('0x2')]},'destcalleridname':{'type':Sequelize[_0xdbe4('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdbe4('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xdbe4('0x2')]},'destlanguage':{'type':Sequelize[_0xdbe4('0x2')]},'destaccountcode':{'type':Sequelize[_0xdbe4('0x2')]},'destcontext':{'type':Sequelize[_0xdbe4('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xdbe4('0x2')]},'destuniqueid':{'type':Sequelize[_0xdbe4('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xdbe4('0x2')]},'from':{'type':Sequelize[_0xdbe4('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xdbe4('0x2')]},'attachment':{'type':Sequelize[_0xdbe4('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xdbe4('0x6')]},'status':{'type':Sequelize[_0xdbe4('0x7')](_0xdbe4('0x8'),'SENDING',_0xdbe4('0x9'),_0xdbe4('0xa'))},'url':{'type':Sequelize[_0xdbe4('0x2')]},'app':{'type':Sequelize[_0xdbe4('0x2')]},'appdata':{'type':Sequelize[_0xdbe4('0x2')]},'projectId':{'type':Sequelize[_0xdbe4('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 45a0c7c..4a80202 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 _0xa54e=['desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xa54e,0x1b1));var _0xea54=function(_0x59ee41,_0xaf7db8){_0x59ee41=_0x59ee41-0x0;var _0x3ecd3e=_0xa54e[_0x59ee41];return _0x3ecd3e;};'use strict';var emlformat=require(_0xea54('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea54('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea54('0x2'));var util=require(_0xea54('0x3'));var path=require(_0xea54('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea54('0x5'));var fs=require('fs');var fs_extra=require(_0xea54('0x6'));var _=require(_0xea54('0x7'));var squel=require(_0xea54('0x8'));var crypto=require(_0xea54('0x9'));var jsforce=require(_0xea54('0xa'));var deskjs=require(_0xea54('0xb'));var toCsv=require(_0xea54('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xea54('0xd'));var qs=require(_0xea54('0xe'));var as=require(_0xea54('0xf'));var hardwareService=require(_0xea54('0x10'));var logger=require('../../config/logger')(_0xea54('0x11'));var utils=require(_0xea54('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xea54('0x13'));var db=require(_0xea54('0x14'))['db'];function respondWithStatusCode(_0x4c8e89,_0x4c8a6b){_0x4c8a6b=_0x4c8a6b||0xcc;return function(_0x3027a8){if(_0x3027a8){return _0x4c8e89['sendStatus'](_0x4c8a6b);}return _0x4c8e89[_0xea54('0x15')](_0x4c8a6b)['end']();};}function respondWithResult(_0x4bc36f,_0x482c9a){_0x482c9a=_0x482c9a||0xc8;return function(_0x3934d0){if(_0x3934d0){return _0x4bc36f[_0xea54('0x15')](_0x482c9a)[_0xea54('0x16')](_0x3934d0);}};}function respondWithFilteredResult(_0x2e801b,_0x11f5b3){return function(_0x81ac33){if(_0x81ac33){var _0xda23ff=typeof _0x11f5b3[_0xea54('0x17')]===_0xea54('0x18')&&typeof _0x11f5b3[_0xea54('0x19')]===_0xea54('0x18');var _0xdcb3cc=_0x81ac33[_0xea54('0x1a')];var _0x1888a7=_0xda23ff?0x0:_0x11f5b3[_0xea54('0x17')];var _0x17d6a2=_0xda23ff?_0x81ac33[_0xea54('0x1a')]:_0x11f5b3[_0xea54('0x17')]+_0x11f5b3[_0xea54('0x19')];var _0x52e22e;if(_0x17d6a2>=_0xdcb3cc){_0x17d6a2=_0xdcb3cc;_0x52e22e=0xc8;}else{_0x52e22e=0xce;}_0x2e801b['status'](_0x52e22e);return _0x2e801b[_0xea54('0x1b')](_0xea54('0x1c'),_0x1888a7+'-'+_0x17d6a2+'/'+_0xdcb3cc)[_0xea54('0x16')](_0x81ac33);}return null;};}function patchUpdates(_0x485048){return function(_0x487023){try{jsonpatch[_0xea54('0x1d')](_0x487023,_0x485048,!![]);}catch(_0x17a363){return BPromise[_0xea54('0x1e')](_0x17a363);}return _0x487023[_0xea54('0x1f')]();};}function saveUpdates(_0x23a014,_0x278e0a){return function(_0x1988ef){if(_0x1988ef){return _0x1988ef[_0xea54('0x20')](_0x23a014)[_0xea54('0x21')](function(_0x43e95f){return _0x43e95f;});}return null;};}function removeEntity(_0x2090a2,_0x4c9b1c){return function(_0x2afa83){if(_0x2afa83){return _0x2afa83[_0xea54('0x22')]()[_0xea54('0x21')](function(){_0x2090a2[_0xea54('0x15')](0xcc)[_0xea54('0x23')]();});}};}function handleEntityNotFound(_0x1ea056,_0x597d17){return function(_0x211d5e){if(!_0x211d5e){_0x1ea056[_0xea54('0x24')](0x194);}return _0x211d5e;};}function handleError(_0x1bc527,_0x35887d){_0x35887d=_0x35887d||0x1f4;return function(_0x335065){logger[_0xea54('0x25')](_0x335065[_0xea54('0x26')]);if(_0x335065[_0xea54('0x27')]){delete _0x335065['name'];}_0x1bc527[_0xea54('0x15')](_0x35887d)[_0xea54('0x28')](_0x335065);};}exports[_0xea54('0x29')]=function(_0x362fb7,_0x13b032){var _0x100a4f={},_0x394c5a={},_0x30c097={'count':0x0,'rows':[]};var _0x3062c1=_['map'](db[_0xea54('0x2a')]['rawAttributes'],function(_0x15f385){return{'name':_0x15f385[_0xea54('0x2b')],'type':_0x15f385[_0xea54('0x2c')][_0xea54('0x2d')]};});_0x394c5a[_0xea54('0x2e')]=_[_0xea54('0x2f')](_0x3062c1,_0xea54('0x27'));_0x394c5a['query']=_[_0xea54('0x30')](_0x362fb7[_0xea54('0x31')]);_0x394c5a[_0xea54('0x32')]=_[_0xea54('0x33')](_0x394c5a[_0xea54('0x2e')],_0x394c5a[_0xea54('0x31')]);_0x100a4f[_0xea54('0x34')]=_[_0xea54('0x33')](_0x394c5a[_0xea54('0x2e')],qs[_0xea54('0x35')](_0x362fb7['query'][_0xea54('0x35')]));_0x100a4f[_0xea54('0x34')]=_0x100a4f['attributes'][_0xea54('0x36')]?_0x100a4f[_0xea54('0x34')]:_0x394c5a[_0xea54('0x2e')];if(!_0x362fb7[_0xea54('0x31')]['hasOwnProperty'](_0xea54('0x37'))){_0x100a4f[_0xea54('0x19')]=qs['limit'](_0x362fb7[_0xea54('0x31')]['limit']);_0x100a4f[_0xea54('0x17')]=qs[_0xea54('0x17')](_0x362fb7[_0xea54('0x31')][_0xea54('0x17')]);}_0x100a4f['order']=qs['sort'](_0x362fb7[_0xea54('0x31')]['sort']);_0x100a4f[_0xea54('0x38')]=qs[_0xea54('0x32')](_[_0xea54('0x39')](_0x362fb7[_0xea54('0x31')],_0x394c5a[_0xea54('0x32')]),_0x3062c1);if(_0x362fb7[_0xea54('0x31')]['filter']){_0x100a4f[_0xea54('0x38')]=_[_0xea54('0x3a')](_0x100a4f[_0xea54('0x38')],{'$or':_[_0xea54('0x2f')](_0x3062c1,function(_0x5680ca){if(_0x5680ca[_0xea54('0x2c')]!==_0xea54('0x3b')){var _0x2724b4={};_0x2724b4[_0x5680ca[_0xea54('0x27')]]={'$like':'%'+_0x362fb7[_0xea54('0x31')][_0xea54('0x3c')]+'%'};return _0x2724b4;}})});}_0x100a4f=_[_0xea54('0x3a')]({},_0x100a4f,_0x362fb7[_0xea54('0x3d')]);var _0x352914={'where':_0x100a4f['where']};return db['IntegrationReport']['count'](_0x352914)['then'](function(_0x3192d2){_0x30c097[_0xea54('0x1a')]=_0x3192d2;if(_0x362fb7['query'][_0xea54('0x3e')]){_0x100a4f[_0xea54('0x3f')]=[{'all':!![]}];}return db[_0xea54('0x2a')][_0xea54('0x40')](_0x100a4f);})[_0xea54('0x21')](function(_0x1b4f39){_0x30c097[_0xea54('0x41')]=_0x1b4f39;return _0x30c097;})['then'](respondWithFilteredResult(_0x13b032,_0x100a4f))[_0xea54('0x42')](handleError(_0x13b032,null));};exports[_0xea54('0x43')]=function(_0x210f53,_0x26aee4){var _0x4a5c8b={'raw':![],'where':{'id':_0x210f53[_0xea54('0x44')]['id']}},_0x4b7527={};_0x4b7527[_0xea54('0x2e')]=_[_0xea54('0x30')](db['IntegrationReport'][_0xea54('0x45')]);_0x4b7527['query']=_[_0xea54('0x30')](_0x210f53[_0xea54('0x31')]);_0x4b7527['filters']=_[_0xea54('0x33')](_0x4b7527[_0xea54('0x2e')],_0x4b7527[_0xea54('0x31')]);_0x4a5c8b[_0xea54('0x34')]=_[_0xea54('0x33')](_0x4b7527[_0xea54('0x2e')],qs[_0xea54('0x35')](_0x210f53[_0xea54('0x31')]['fields']));_0x4a5c8b[_0xea54('0x34')]=_0x4a5c8b[_0xea54('0x34')][_0xea54('0x36')]?_0x4a5c8b['attributes']:_0x4b7527['model'];if(_0x210f53[_0xea54('0x31')][_0xea54('0x3e')]){_0x4a5c8b[_0xea54('0x3f')]=[{'all':!![]}];}_0x4a5c8b=_[_0xea54('0x3a')]({},_0x4a5c8b,_0x210f53[_0xea54('0x3d')]);return db[_0xea54('0x2a')][_0xea54('0x46')](_0x4a5c8b)[_0xea54('0x21')](handleEntityNotFound(_0x26aee4,null))[_0xea54('0x21')](respondWithResult(_0x26aee4,null))['catch'](handleError(_0x26aee4,null));};exports['create']=function(_0x57494c,_0x1acb52){return db[_0xea54('0x2a')][_0xea54('0x47')](_0x57494c['body'],{})[_0xea54('0x21')](respondWithResult(_0x1acb52,0xc9))['catch'](handleError(_0x1acb52,null));};exports[_0xea54('0x20')]=function(_0x43ea26,_0x372139){if(_0x43ea26[_0xea54('0x48')]['id']){delete _0x43ea26[_0xea54('0x48')]['id'];}return db[_0xea54('0x2a')][_0xea54('0x46')]({'where':{'id':_0x43ea26[_0xea54('0x44')]['id']}})['then'](handleEntityNotFound(_0x372139,null))['then'](saveUpdates(_0x43ea26[_0xea54('0x48')],null))[_0xea54('0x21')](respondWithResult(_0x372139,null))[_0xea54('0x42')](handleError(_0x372139,null));};exports[_0xea54('0x22')]=function(_0x225d1d,_0x40d4f8){return db['IntegrationReport'][_0xea54('0x46')]({'where':{'id':_0x225d1d[_0xea54('0x44')]['id']}})[_0xea54('0x21')](handleEntityNotFound(_0x40d4f8,null))[_0xea54('0x21')](removeEntity(_0x40d4f8,null))[_0xea54('0x42')](handleError(_0x40d4f8,null));};exports['describe']=function(_0x915bfe,_0x1abb0d){return db['IntegrationReport'][_0xea54('0x49')]()['then'](respondWithResult(_0x1abb0d,null))[_0xea54('0x42')](handleError(_0x1abb0d,null));}; \ No newline at end of file +var _0x88d7=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create'];(function(_0x2e420d,_0x3628b8){var _0x22eb46=function(_0x28cd15){while(--_0x28cd15){_0x2e420d['push'](_0x2e420d['shift']());}};_0x22eb46(++_0x3628b8);}(_0x88d7,0x183));var _0x788d=function(_0x1a49c6,_0x26ddc4){_0x1a49c6=_0x1a49c6-0x0;var _0x2a542=_0x88d7[_0x1a49c6];return _0x2a542;};'use strict';var emlformat=require(_0x788d('0x0'));var rimraf=require(_0x788d('0x1'));var zipdir=require(_0x788d('0x2'));var jsonpatch=require(_0x788d('0x3'));var rp=require(_0x788d('0x4'));var moment=require(_0x788d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x788d('0x6'));var util=require(_0x788d('0x7'));var path=require('path');var sox=require(_0x788d('0x8'));var csv=require('to-csv');var ejs=require(_0x788d('0x9'));var fs=require('fs');var fs_extra=require(_0x788d('0xa'));var _=require(_0x788d('0xb'));var squel=require(_0x788d('0xc'));var crypto=require(_0x788d('0xd'));var jsforce=require(_0x788d('0xe'));var deskjs=require(_0x788d('0xf'));var toCsv=require(_0x788d('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x788d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x788d('0x12'));var hardwareService=require(_0x788d('0x13'));var logger=require(_0x788d('0x14'))(_0x788d('0x15'));var utils=require(_0x788d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x788d('0x17'));var db=require(_0x788d('0x18'))['db'];function respondWithStatusCode(_0xa7cca5,_0x36b6a9){_0x36b6a9=_0x36b6a9||0xcc;return function(_0x4d87d4){if(_0x4d87d4){return _0xa7cca5['sendStatus'](_0x36b6a9);}return _0xa7cca5[_0x788d('0x19')](_0x36b6a9)[_0x788d('0x1a')]();};}function respondWithResult(_0x1762fd,_0x1c286c){_0x1c286c=_0x1c286c||0xc8;return function(_0x6dd6e8){if(_0x6dd6e8){return _0x1762fd[_0x788d('0x19')](_0x1c286c)[_0x788d('0x1b')](_0x6dd6e8);}};}function respondWithFilteredResult(_0x4d9ba4,_0x557577){return function(_0x13a788){if(_0x13a788){var _0x56fe94=typeof _0x557577[_0x788d('0x1c')]==='undefined'&&typeof _0x557577[_0x788d('0x1d')]===_0x788d('0x1e');var _0x48cc67=_0x13a788[_0x788d('0x1f')];var _0x5cf40d=_0x56fe94?0x0:_0x557577[_0x788d('0x1c')];var _0x108887=_0x56fe94?_0x13a788[_0x788d('0x1f')]:_0x557577[_0x788d('0x1c')]+_0x557577['limit'];var _0x34c9d3;if(_0x108887>=_0x48cc67){_0x108887=_0x48cc67;_0x34c9d3=0xc8;}else{_0x34c9d3=0xce;}_0x4d9ba4[_0x788d('0x19')](_0x34c9d3);return _0x4d9ba4[_0x788d('0x20')](_0x788d('0x21'),_0x5cf40d+'-'+_0x108887+'/'+_0x48cc67)['json'](_0x13a788);}return null;};}function patchUpdates(_0x43d03f){return function(_0x13cffb){try{jsonpatch[_0x788d('0x22')](_0x13cffb,_0x43d03f,!![]);}catch(_0xc5adb7){return BPromise[_0x788d('0x23')](_0xc5adb7);}return _0x13cffb[_0x788d('0x24')]();};}function saveUpdates(_0x3d919c,_0x5a9a2f){return function(_0x3c9899){if(_0x3c9899){return _0x3c9899[_0x788d('0x25')](_0x3d919c)[_0x788d('0x26')](function(_0x799c00){return _0x799c00;});}return null;};}function removeEntity(_0x199de4,_0xa8930e){return function(_0x22567b){if(_0x22567b){return _0x22567b[_0x788d('0x27')]()[_0x788d('0x26')](function(){_0x199de4[_0x788d('0x19')](0xcc)[_0x788d('0x1a')]();});}};}function handleEntityNotFound(_0x1874f2,_0x44725c){return function(_0x182a63){if(!_0x182a63){_0x1874f2[_0x788d('0x28')](0x194);}return _0x182a63;};}function handleError(_0x1de9b5,_0x3e83d1){_0x3e83d1=_0x3e83d1||0x1f4;return function(_0x31172d){logger['error'](_0x31172d[_0x788d('0x29')]);if(_0x31172d['name']){delete _0x31172d[_0x788d('0x2a')];}_0x1de9b5['status'](_0x3e83d1)[_0x788d('0x2b')](_0x31172d);};}exports[_0x788d('0x2c')]=function(_0x50904d,_0x5355af){var _0x58206b={},_0x3a73af={},_0x214346={'count':0x0,'rows':[]};var _0x4b5079=_[_0x788d('0x2d')](db[_0x788d('0x2e')][_0x788d('0x2f')],function(_0xba2835){return{'name':_0xba2835[_0x788d('0x30')],'type':_0xba2835['type'][_0x788d('0x31')]};});_0x3a73af[_0x788d('0x32')]=_[_0x788d('0x2d')](_0x4b5079,_0x788d('0x2a'));_0x3a73af[_0x788d('0x33')]=_['keys'](_0x50904d[_0x788d('0x33')]);_0x3a73af[_0x788d('0x34')]=_['intersection'](_0x3a73af['model'],_0x3a73af['query']);_0x58206b[_0x788d('0x35')]=_[_0x788d('0x36')](_0x3a73af[_0x788d('0x32')],qs[_0x788d('0x37')](_0x50904d[_0x788d('0x33')][_0x788d('0x37')]));_0x58206b[_0x788d('0x35')]=_0x58206b[_0x788d('0x35')]['length']?_0x58206b['attributes']:_0x3a73af[_0x788d('0x32')];if(!_0x50904d[_0x788d('0x33')][_0x788d('0x38')]('nolimit')){_0x58206b[_0x788d('0x1d')]=qs['limit'](_0x50904d[_0x788d('0x33')][_0x788d('0x1d')]);_0x58206b[_0x788d('0x1c')]=qs[_0x788d('0x1c')](_0x50904d[_0x788d('0x33')][_0x788d('0x1c')]);}_0x58206b[_0x788d('0x39')]=qs[_0x788d('0x3a')](_0x50904d[_0x788d('0x33')][_0x788d('0x3a')]);_0x58206b[_0x788d('0x3b')]=qs[_0x788d('0x34')](_[_0x788d('0x3c')](_0x50904d[_0x788d('0x33')],_0x3a73af[_0x788d('0x34')]),_0x4b5079);if(_0x50904d['query'][_0x788d('0x3d')]){_0x58206b[_0x788d('0x3b')]=_['merge'](_0x58206b[_0x788d('0x3b')],{'$or':_['map'](_0x4b5079,function(_0x334196){if(_0x334196[_0x788d('0x3e')]!=='VIRTUAL'){var _0x1f956e={};_0x1f956e[_0x334196[_0x788d('0x2a')]]={'$like':'%'+_0x50904d[_0x788d('0x33')][_0x788d('0x3d')]+'%'};return _0x1f956e;}})});}_0x58206b=_[_0x788d('0x3f')]({},_0x58206b,_0x50904d[_0x788d('0x40')]);var _0x2e5557={'where':_0x58206b[_0x788d('0x3b')]};return db['IntegrationReport'][_0x788d('0x1f')](_0x2e5557)[_0x788d('0x26')](function(_0x1350cc){_0x214346[_0x788d('0x1f')]=_0x1350cc;if(_0x50904d['query'][_0x788d('0x41')]){_0x58206b[_0x788d('0x42')]=[{'all':!![]}];}return db[_0x788d('0x2e')][_0x788d('0x43')](_0x58206b);})[_0x788d('0x26')](function(_0x23784e){_0x214346[_0x788d('0x44')]=_0x23784e;return _0x214346;})[_0x788d('0x26')](respondWithFilteredResult(_0x5355af,_0x58206b))[_0x788d('0x45')](handleError(_0x5355af,null));};exports['show']=function(_0x2b98b7,_0x21c53a){var _0x572094={'raw':![],'where':{'id':_0x2b98b7[_0x788d('0x46')]['id']}},_0x58bb03={};_0x58bb03['model']=_[_0x788d('0x47')](db[_0x788d('0x2e')][_0x788d('0x2f')]);_0x58bb03[_0x788d('0x33')]=_[_0x788d('0x47')](_0x2b98b7[_0x788d('0x33')]);_0x58bb03[_0x788d('0x34')]=_['intersection'](_0x58bb03['model'],_0x58bb03[_0x788d('0x33')]);_0x572094[_0x788d('0x35')]=_['intersection'](_0x58bb03[_0x788d('0x32')],qs[_0x788d('0x37')](_0x2b98b7['query'][_0x788d('0x37')]));_0x572094[_0x788d('0x35')]=_0x572094[_0x788d('0x35')][_0x788d('0x48')]?_0x572094[_0x788d('0x35')]:_0x58bb03[_0x788d('0x32')];if(_0x2b98b7[_0x788d('0x33')][_0x788d('0x41')]){_0x572094[_0x788d('0x42')]=[{'all':!![]}];}_0x572094=_[_0x788d('0x3f')]({},_0x572094,_0x2b98b7['options']);return db[_0x788d('0x2e')][_0x788d('0x49')](_0x572094)[_0x788d('0x26')](handleEntityNotFound(_0x21c53a,null))[_0x788d('0x26')](respondWithResult(_0x21c53a,null))['catch'](handleError(_0x21c53a,null));};exports[_0x788d('0x4a')]=function(_0x25d28b,_0x48a963){return db[_0x788d('0x2e')][_0x788d('0x4a')](_0x25d28b[_0x788d('0x4b')],{})[_0x788d('0x26')](respondWithResult(_0x48a963,0xc9))[_0x788d('0x45')](handleError(_0x48a963,null));};exports[_0x788d('0x25')]=function(_0x5886f3,_0x1975e0){if(_0x5886f3[_0x788d('0x4b')]['id']){delete _0x5886f3['body']['id'];}return db[_0x788d('0x2e')][_0x788d('0x49')]({'where':{'id':_0x5886f3[_0x788d('0x46')]['id']}})[_0x788d('0x26')](handleEntityNotFound(_0x1975e0,null))['then'](saveUpdates(_0x5886f3[_0x788d('0x4b')],null))[_0x788d('0x26')](respondWithResult(_0x1975e0,null))['catch'](handleError(_0x1975e0,null));};exports[_0x788d('0x27')]=function(_0x2338b3,_0x2b4394){return db[_0x788d('0x2e')][_0x788d('0x49')]({'where':{'id':_0x2338b3['params']['id']}})[_0x788d('0x26')](handleEntityNotFound(_0x2b4394,null))[_0x788d('0x26')](removeEntity(_0x2b4394,null))[_0x788d('0x45')](handleError(_0x2b4394,null));};exports['describe']=function(_0x5ea103,_0x2340f8){return db[_0x788d('0x2e')][_0x788d('0x4c')]()[_0x788d('0x26')](respondWithResult(_0x2340f8,null))['catch'](handleError(_0x2340f8,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d93aa96..a7517e0 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 _0xe82f=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x4fe92e,_0x5d426d){var _0x92d5=function(_0x13eebe){while(--_0x13eebe){_0x4fe92e['push'](_0x4fe92e['shift']());}};_0x92d5(++_0x5d426d);}(_0xe82f,0x15b));var _0xfe82=function(_0x1b940f,_0x13bc26){_0x1b940f=_0x1b940f-0x0;var _0x306f25=_0xe82f[_0x1b940f];return _0x306f25;};'use strict';var _=require(_0xfe82('0x0'));var util=require(_0xfe82('0x1'));var logger=require(_0xfe82('0x2'))(_0xfe82('0x3'));var moment=require(_0xfe82('0x4'));var BPromise=require(_0xfe82('0x5'));var rp=require(_0xfe82('0x6'));var fs=require('fs');var path=require(_0xfe82('0x7'));var rimraf=require(_0xfe82('0x8'));var config=require(_0xfe82('0x9'));var attributes=require(_0xfe82('0xa'));module[_0xfe82('0xb')]=function(_0x27d3ec,_0x3d00c8){return _0x27d3ec[_0xfe82('0xc')](_0xfe82('0xd'),attributes,{'tableName':_0xfe82('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e96=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','IntegrationReport','report_integration','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1e96,0xe9));var _0x61e9=function(_0x4188cd,_0x243071){_0x4188cd=_0x4188cd-0x0;var _0x173e08=_0x1e96[_0x4188cd];return _0x173e08;};'use strict';var _=require('lodash');var util=require(_0x61e9('0x0'));var logger=require(_0x61e9('0x1'))(_0x61e9('0x2'));var moment=require('moment');var BPromise=require(_0x61e9('0x3'));var rp=require(_0x61e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x61e9('0x5'));var attributes=require('./integrationReport.attributes');module[_0x61e9('0x6')]=function(_0x4b5784,_0x1ad91d){return _0x4b5784['define'](_0x61e9('0x7'),attributes,{'tableName':_0x61e9('0x8'),'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 f90fc89..b94049b 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x10f995,_0x133b8e){var _0x22892e=function(_0x4896e0){while(--_0x4896e0){_0x10f995['push'](_0x10f995['shift']());}};_0x22892e(++_0x133b8e);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2057c3,_0x5d88d8){var _0x12b2de=function(_0x29fcca){while(--_0x29fcca){_0x2057c3['push'](_0x2057c3['shift']());}};_0x12b2de(++_0x5d88d8);}(_0x57ca,0x108));var _0xa57c=function(_0x16813e,_0xdfc9c){_0x16813e=_0x16813e-0x0;var _0x5f1f0f=_0x57ca[_0x16813e];return _0x5f1f0f;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index f2c24ec..7defd84 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 _0xc1db=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','index','isAuthenticated','get','/:id/sub_intervals','getIntervals','create','addInterval','post','put','/:id','update'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xc1db,0x120));var _0xbc1d=function(_0x17f24e,_0x5e722e){_0x17f24e=_0x17f24e-0x0;var _0x54311f=_0xc1db[_0x17f24e];return _0x54311f;};'use strict';var multer=require(_0xbc1d('0x0'));var util=require('util');var path=require(_0xbc1d('0x1'));var timeout=require(_0xbc1d('0x2'));var express=require(_0xbc1d('0x3'));var router=express[_0xbc1d('0x4')]();var fs_extra=require(_0xbc1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbc1d('0x6'));var config=require(_0xbc1d('0x7'));var controller=require(_0xbc1d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc1d('0x9')]);router['get']('/:id',auth[_0xbc1d('0xa')](),controller['show']);router[_0xbc1d('0xb')](_0xbc1d('0xc'),auth['isAuthenticated'](),controller[_0xbc1d('0xd')]);router['post']('/',auth[_0xbc1d('0xa')](),controller[_0xbc1d('0xe')]);router['post'](_0xbc1d('0xc'),auth[_0xbc1d('0xa')](),controller[_0xbc1d('0xf')]);router[_0xbc1d('0x10')]('/:id/sub_intervals/create_many',auth[_0xbc1d('0xa')](),controller['addIntervals']);router[_0xbc1d('0x11')](_0xbc1d('0x12'),auth['isAuthenticated'](),controller[_0xbc1d('0x13')]);router[_0xbc1d('0x14')]('/:id',auth[_0xbc1d('0xa')](),controller[_0xbc1d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x869e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','/:id','delete','destroy','exports','multer','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x869e,0x15c));var _0xe869=function(_0xad842d,_0x108c5f){_0xad842d=_0xad842d-0x0;var _0x362b70=_0x869e[_0xad842d];return _0x362b70;};'use strict';var multer=require(_0xe869('0x0'));var util=require(_0xe869('0x1'));var path=require(_0xe869('0x2'));var timeout=require('connect-timeout');var express=require(_0xe869('0x3'));var router=express[_0xe869('0x4')]();var fs_extra=require(_0xe869('0x5'));var auth=require(_0xe869('0x6'));var interaction=require(_0xe869('0x7'));var config=require('../../config/environment');var controller=require(_0xe869('0x8'));router[_0xe869('0x9')]('/',auth[_0xe869('0xa')](),controller[_0xe869('0xb')]);router['get']('/:id',auth[_0xe869('0xa')](),controller[_0xe869('0xc')]);router[_0xe869('0x9')](_0xe869('0xd'),auth[_0xe869('0xa')](),controller[_0xe869('0xe')]);router[_0xe869('0xf')]('/',auth[_0xe869('0xa')](),controller['create']);router['post'](_0xe869('0xd'),auth[_0xe869('0xa')](),controller[_0xe869('0x10')]);router[_0xe869('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xe869('0x11')]);router['put'](_0xe869('0x12'),auth[_0xe869('0xa')](),controller['update']);router[_0xe869('0x13')](_0xe869('0x12'),auth[_0xe869('0xa')](),controller[_0xe869('0x14')]);module[_0xe869('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 755ca71..b273859 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 _0x5d7a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5d7a,0x133));var _0xa5d7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5d7a[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xa5d7('0x0'));module[_0xa5d7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5d7('0x2')]},'interval':{'type':Sequelize[_0xa5d7('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x52f0=['STRING','sequelize','exports'];(function(_0x3526de,_0xe35540){var _0x455ff0=function(_0x4f93e0){while(--_0x4f93e0){_0x3526de['push'](_0x3526de['shift']());}};_0x455ff0(++_0xe35540);}(_0x52f0,0xbb));var _0x052f=function(_0x283f1a,_0x271f9a){_0x283f1a=_0x283f1a-0x0;var _0x3eeb4c=_0x52f0[_0x283f1a];return _0x3eeb4c;};'use strict';var Sequelize=require(_0x052f('0x0'));module[_0x052f('0x1')]={'name':{'type':Sequelize[_0x052f('0x2')]},'description':{'type':Sequelize[_0x052f('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 0a4fd65..058d0ec 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 _0x5f77=['getIntervals','findOne','where','addIntervals','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Intervals','UserProfileResource','error','send','map','Interval','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','name','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval'];(function(_0x4c8abf,_0x4c8018){var _0x911676=function(_0x4b11b3){while(--_0x4b11b3){_0x4c8abf['push'](_0x4c8abf['shift']());}};_0x911676(++_0x4c8018);}(_0x5f77,0x1cd));var _0x75f7=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x5f77[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x75f7('0x0'));var rimraf=require(_0x75f7('0x1'));var zipdir=require(_0x75f7('0x2'));var jsonpatch=require(_0x75f7('0x3'));var rp=require(_0x75f7('0x4'));var moment=require(_0x75f7('0x5'));var BPromise=require(_0x75f7('0x6'));var Mustache=require(_0x75f7('0x7'));var util=require(_0x75f7('0x8'));var path=require(_0x75f7('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x75f7('0xa'));var fs=require('fs');var fs_extra=require(_0x75f7('0xb'));var _=require('lodash');var squel=require(_0x75f7('0xc'));var crypto=require(_0x75f7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x75f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x75f7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x75f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x75f7('0x11'));var hardwareService=require(_0x75f7('0x12'));var logger=require(_0x75f7('0x13'))(_0x75f7('0x14'));var utils=require(_0x75f7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x75f7('0x16'));var db=require(_0x75f7('0x17'))['db'];var extensions=require(_0x75f7('0x18'));function respondWithStatusCode(_0x45ce4d,_0x2b12af){_0x2b12af=_0x2b12af||0xcc;return function(_0x4b24ef){if(_0x4b24ef){return _0x45ce4d[_0x75f7('0x19')](_0x2b12af);}return _0x45ce4d[_0x75f7('0x1a')](_0x2b12af)[_0x75f7('0x1b')]();};}function respondWithResult(_0x43b345,_0x317bdc){_0x317bdc=_0x317bdc||0xc8;return function(_0x251d17){if(_0x251d17){return _0x43b345[_0x75f7('0x1a')](_0x317bdc)[_0x75f7('0x1c')](_0x251d17);}};}function respondWithFilteredResult(_0x146847,_0x15d648){return function(_0x3a6583){if(_0x3a6583){var _0x647cbe=typeof _0x15d648[_0x75f7('0x1d')]===_0x75f7('0x1e')&&typeof _0x15d648[_0x75f7('0x1f')]===_0x75f7('0x1e');var _0x237b8c=_0x3a6583[_0x75f7('0x20')];var _0x102b16=_0x647cbe?0x0:_0x15d648[_0x75f7('0x1d')];var _0xcbe3e8=_0x647cbe?_0x3a6583[_0x75f7('0x20')]:_0x15d648[_0x75f7('0x1d')]+_0x15d648['limit'];var _0x255ac2;if(_0xcbe3e8>=_0x237b8c){_0xcbe3e8=_0x237b8c;_0x255ac2=0xc8;}else{_0x255ac2=0xce;}_0x146847[_0x75f7('0x1a')](_0x255ac2);return _0x146847[_0x75f7('0x21')](_0x75f7('0x22'),_0x102b16+'-'+_0xcbe3e8+'/'+_0x237b8c)['json'](_0x3a6583);}return null;};}function patchUpdates(_0x186597){return function(_0x1a6cee){try{jsonpatch['apply'](_0x1a6cee,_0x186597,!![]);}catch(_0x4e781c){return BPromise[_0x75f7('0x23')](_0x4e781c);}return _0x1a6cee[_0x75f7('0x24')]();};}function saveUpdates(_0x241900,_0x464368){return function(_0x21852c){if(_0x21852c){return _0x21852c['update'](_0x241900)[_0x75f7('0x25')](function(_0x2d4d31){return _0x2d4d31;});}return null;};}function removeEntity(_0xe9c41d,_0x59efc5){return function(_0x642eb2){if(_0x642eb2){return _0x642eb2[_0x75f7('0x26')]()[_0x75f7('0x25')](function(){var _0x29d5d6=_0x642eb2[_0x75f7('0x27')]({'plain':!![]});var _0x46f694=_0x75f7('0x28');return db[_0x75f7('0x29')]['destroy']({'where':{'type':_0x46f694,'resourceId':_0x29d5d6['id']}})['then'](function(){return _0x642eb2;});})['then'](function(){_0xe9c41d[_0x75f7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279ca5,_0x55b9a9){return function(_0x4e2fc1){if(!_0x4e2fc1){_0x279ca5['sendStatus'](0x194);}return _0x4e2fc1;};}function handleError(_0x188379,_0x1435b2){_0x1435b2=_0x1435b2||0x1f4;return function(_0xfbd489){logger[_0x75f7('0x2a')](_0xfbd489['stack']);if(_0xfbd489['name']){delete _0xfbd489['name'];}_0x188379[_0x75f7('0x1a')](_0x1435b2)[_0x75f7('0x2b')](_0xfbd489);};}exports['index']=function(_0x406cc3,_0x1954c8){var _0x438115={},_0x13429c={},_0x4a27a1={'count':0x0,'rows':[]};var _0x25a1e1=_[_0x75f7('0x2c')](db[_0x75f7('0x2d')]['rawAttributes'],function(_0x29225b){return{'name':_0x29225b[_0x75f7('0x2e')],'type':_0x29225b['type'][_0x75f7('0x2f')]};});_0x13429c[_0x75f7('0x30')]=_[_0x75f7('0x2c')](_0x25a1e1,'name');_0x13429c[_0x75f7('0x31')]=_['keys'](_0x406cc3[_0x75f7('0x31')]);_0x13429c[_0x75f7('0x32')]=_['intersection'](_0x13429c[_0x75f7('0x30')],_0x13429c[_0x75f7('0x31')]);_0x438115['attributes']=_[_0x75f7('0x33')](_0x13429c[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x406cc3[_0x75f7('0x31')][_0x75f7('0x34')]));_0x438115[_0x75f7('0x35')]=_0x438115[_0x75f7('0x35')][_0x75f7('0x36')]?_0x438115[_0x75f7('0x35')]:_0x13429c[_0x75f7('0x30')];if(!_0x406cc3[_0x75f7('0x31')][_0x75f7('0x37')](_0x75f7('0x38'))){_0x438115[_0x75f7('0x1f')]=qs[_0x75f7('0x1f')](_0x406cc3[_0x75f7('0x31')][_0x75f7('0x1f')]);_0x438115['offset']=qs[_0x75f7('0x1d')](_0x406cc3[_0x75f7('0x31')]['offset']);}_0x438115[_0x75f7('0x39')]=qs[_0x75f7('0x3a')](_0x406cc3[_0x75f7('0x31')]['sort']);_0x438115['where']=qs[_0x75f7('0x32')](_[_0x75f7('0x3b')](_0x406cc3['query'],_0x13429c[_0x75f7('0x32')]),_0x25a1e1);if(_0x406cc3[_0x75f7('0x31')][_0x75f7('0x3c')]){_0x438115['where']=_[_0x75f7('0x3d')](_0x438115['where'],{'$or':_['map'](_0x25a1e1,function(_0x380496){if(_0x380496[_0x75f7('0x3e')]!==_0x75f7('0x3f')){var _0x5411cb={};_0x5411cb[_0x380496[_0x75f7('0x40')]]={'$like':'%'+_0x406cc3[_0x75f7('0x31')][_0x75f7('0x3c')]+'%'};return _0x5411cb;}})});}_0x438115=_[_0x75f7('0x3d')]({},_0x438115,_0x406cc3[_0x75f7('0x41')]);var _0x3ec1a8={'where':_0x438115['where']};return db['Interval']['count'](_0x3ec1a8)[_0x75f7('0x25')](function(_0x35d97d){_0x4a27a1[_0x75f7('0x20')]=_0x35d97d;if(_0x406cc3['query'][_0x75f7('0x42')]){_0x438115['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x438115);})[_0x75f7('0x25')](function(_0x2d0b39){_0x4a27a1[_0x75f7('0x43')]=_0x2d0b39;return _0x4a27a1;})[_0x75f7('0x25')](respondWithFilteredResult(_0x1954c8,_0x438115))[_0x75f7('0x44')](handleError(_0x1954c8,null));};exports[_0x75f7('0x45')]=function(_0x372c12,_0x39a76b){var _0x15cdbc={'raw':!![],'where':{'id':_0x372c12[_0x75f7('0x46')]['id']}},_0x533094={};_0x533094[_0x75f7('0x30')]=_[_0x75f7('0x47')](db['Interval'][_0x75f7('0x48')]);_0x533094[_0x75f7('0x31')]=_[_0x75f7('0x47')](_0x372c12[_0x75f7('0x31')]);_0x533094['filters']=_[_0x75f7('0x33')](_0x533094['model'],_0x533094[_0x75f7('0x31')]);_0x15cdbc['attributes']=_['intersection'](_0x533094[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x372c12[_0x75f7('0x31')]['fields']));_0x15cdbc['attributes']=_0x15cdbc['attributes'][_0x75f7('0x36')]?_0x15cdbc[_0x75f7('0x35')]:_0x533094[_0x75f7('0x30')];if(_0x372c12[_0x75f7('0x31')]['includeAll']){_0x15cdbc[_0x75f7('0x49')]=[{'all':!![]}];}_0x15cdbc=_[_0x75f7('0x3d')]({},_0x15cdbc,_0x372c12[_0x75f7('0x41')]);return db[_0x75f7('0x2d')][_0x75f7('0x4a')](_0x15cdbc)[_0x75f7('0x25')](handleEntityNotFound(_0x39a76b,null))[_0x75f7('0x25')](respondWithResult(_0x39a76b,null))[_0x75f7('0x44')](handleError(_0x39a76b,null));};exports[_0x75f7('0x4b')]=function(_0x8a4455,_0x12daef){return db[_0x75f7('0x2d')][_0x75f7('0x4b')](_0x8a4455[_0x75f7('0x4c')],{})[_0x75f7('0x25')](function(_0x164e1a){var _0x2fdcc2=_0x8a4455[_0x75f7('0x4d')][_0x75f7('0x27')]({'plain':!![]});if(!_0x2fdcc2)throw new Error(_0x75f7('0x4e'));if(_0x2fdcc2[_0x75f7('0x4f')]===_0x75f7('0x4d')){var _0x249565=_0x164e1a[_0x75f7('0x27')]({'plain':!![]});var _0x435d7a='Intervals';return db[_0x75f7('0x50')][_0x75f7('0x4a')]({'where':{'name':_0x435d7a,'userProfileId':_0x2fdcc2[_0x75f7('0x51')]},'raw':!![]})[_0x75f7('0x25')](function(_0xa899bc){if(_0xa899bc&&_0xa899bc['autoAssociation']===0x0){return db[_0x75f7('0x29')][_0x75f7('0x4b')]({'name':_0x249565[_0x75f7('0x40')],'resourceId':_0x249565['id'],'type':_0xa899bc[_0x75f7('0x40')],'sectionId':_0xa899bc['id']},{})[_0x75f7('0x25')](function(){return _0x164e1a;});}else{return _0x164e1a;}})[_0x75f7('0x44')](function(_0x4b141d){logger['error'](_0x75f7('0x52'),_0x4b141d);throw _0x4b141d;});}return _0x164e1a;})[_0x75f7('0x25')](respondWithResult(_0x12daef,0xc9))['catch'](handleError(_0x12daef,null));};exports[_0x75f7('0x53')]=function(_0x98f02b,_0x5044d4){if(_0x98f02b[_0x75f7('0x4c')]['id']){delete _0x98f02b[_0x75f7('0x4c')]['id'];}return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x98f02b[_0x75f7('0x46')]['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0x5044d4,null))['then'](saveUpdates(_0x98f02b['body'],null))[_0x75f7('0x25')](respondWithResult(_0x5044d4,null))[_0x75f7('0x44')](handleError(_0x5044d4,null));};exports[_0x75f7('0x26')]=function(_0x507573,_0xc83998){return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x507573['params']['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0xc83998,null))['then'](removeEntity(_0xc83998,null))['catch'](handleError(_0xc83998,null));};exports[_0x75f7('0x54')]=function(_0x2852ef,_0x4e3e2f,_0x4e448a){if(_0x2852ef[_0x75f7('0x4c')]['id']){delete _0x2852ef[_0x75f7('0x4c')]['id'];}return db[_0x75f7('0x2d')][_0x75f7('0x4a')]({'where':{'id':_0x2852ef[_0x75f7('0x46')]['id']}})[_0x75f7('0x25')](handleEntityNotFound(_0x4e3e2f,null))[_0x75f7('0x25')](function(_0x41eb97){if(_0x41eb97){_0x2852ef['body']['IntervalId']=_0x41eb97['id'];return db[_0x75f7('0x2d')][_0x75f7('0x4b')](_0x2852ef['body']);}})[_0x75f7('0x25')](respondWithResult(_0x4e3e2f,null))['catch'](handleError(_0x4e3e2f,null));};exports[_0x75f7('0x55')]=function(_0x39a7d3,_0x206592,_0x56714e){var _0x223d6f={};var _0x225302={};var _0x4f68af;var _0x2ee362;return db[_0x75f7('0x2d')][_0x75f7('0x56')]({'where':{'id':_0x39a7d3[_0x75f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x206592,null))['then'](function(_0x4179b){if(_0x4179b){_0x4f68af=_0x4179b;_0x225302[_0x75f7('0x30')]=_[_0x75f7('0x47')](db[_0x75f7('0x2d')][_0x75f7('0x48')]);_0x225302[_0x75f7('0x31')]=_[_0x75f7('0x47')](_0x39a7d3[_0x75f7('0x31')]);_0x225302[_0x75f7('0x32')]=_[_0x75f7('0x33')](_0x225302['model'],_0x225302[_0x75f7('0x31')]);_0x223d6f[_0x75f7('0x35')]=_[_0x75f7('0x33')](_0x225302[_0x75f7('0x30')],qs[_0x75f7('0x34')](_0x39a7d3['query'][_0x75f7('0x34')]));_0x223d6f[_0x75f7('0x35')]=_0x223d6f[_0x75f7('0x35')][_0x75f7('0x36')]?_0x223d6f[_0x75f7('0x35')]:_0x225302[_0x75f7('0x30')];_0x223d6f[_0x75f7('0x39')]=qs['sort'](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3a')]);_0x223d6f[_0x75f7('0x57')]=qs[_0x75f7('0x32')](_[_0x75f7('0x3b')](_0x39a7d3[_0x75f7('0x31')],_0x225302['filters']));if(_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3c')]){_0x223d6f[_0x75f7('0x57')]=_[_0x75f7('0x3d')](_0x223d6f[_0x75f7('0x57')],{'$or':_[_0x75f7('0x2c')](_0x223d6f[_0x75f7('0x35')],function(_0x4946b8){var _0x102bf8={};_0x102bf8[_0x4946b8]={'$like':'%'+_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x3c')]+'%'};return _0x102bf8;})});}_0x223d6f=_[_0x75f7('0x3d')]({},_0x223d6f,_0x39a7d3[_0x75f7('0x41')]);return _0x4f68af['getIntervals'](_0x223d6f);}})[_0x75f7('0x25')](function(_0x3d8e12){if(_0x3d8e12){_0x2ee362=_0x3d8e12['length'];if(!_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x37')]('nolimit')){_0x223d6f['limit']=qs['limit'](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x1f')]);_0x223d6f['offset']=qs[_0x75f7('0x1d')](_0x39a7d3[_0x75f7('0x31')][_0x75f7('0x1d')]);}return _0x4f68af['getIntervals'](_0x223d6f);}})[_0x75f7('0x25')](function(_0x1e7838){if(_0x1e7838){return _0x1e7838?{'count':_0x2ee362,'rows':_0x1e7838}:null;}})[_0x75f7('0x25')](respondWithResult(_0x206592,null))[_0x75f7('0x44')](handleError(_0x206592,null));};exports[_0x75f7('0x58')]=function(_0x16cf07,_0x8edfd7,_0x18b129){return db['Interval'][_0x75f7('0x56')]({'where':{'id':_0x16cf07[_0x75f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x8edfd7,null))[_0x75f7('0x25')](function(_0x2ea105){if(_0x2ea105){return db['sequelize'][_0x75f7('0x59')](function(_0x3182ab){return db[_0x75f7('0x2d')]['destroy']({'where':{'IntervalId':_0x16cf07[_0x75f7('0x46')]['id']},'transaction':_0x3182ab})[_0x75f7('0x25')](function(_0x98f32){var _0x5ab803=_[_0x75f7('0x2c')](_0x16cf07[_0x75f7('0x4c')],function(_0x4812ce){delete _0x4812ce['id'];_0x4812ce['IntervalId']=_0x16cf07[_0x75f7('0x46')]['id'];return _0x4812ce;});return db['Interval']['bulkCreate'](_0x5ab803,{'transaction':_0x3182ab});});})[_0x75f7('0x25')](function(){return db['Interval'][_0x75f7('0x5a')]({'where':{'IntervalId':_0x16cf07['params']['id']}});});}})[_0x75f7('0x25')](respondWithResult(_0x8edfd7,null))[_0x75f7('0x44')](handleError(_0x8edfd7,null));}; \ No newline at end of file +var _0xacc5=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','limit','undefined','count','reject','save','update','then','get','Intervals','UserProfileResource','stack','name','send','index','Interval','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addInterval','IntervalId','getIntervals','nolimit','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x11dde4,_0x1d4852){var _0x6eea94=function(_0x182859){while(--_0x182859){_0x11dde4['push'](_0x11dde4['shift']());}};_0x6eea94(++_0x1d4852);}(_0xacc5,0x103));var _0x5acc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xacc5[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x5acc('0x0'));var rimraf=require(_0x5acc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5acc('0x2'));var rp=require(_0x5acc('0x3'));var moment=require(_0x5acc('0x4'));var BPromise=require(_0x5acc('0x5'));var Mustache=require(_0x5acc('0x6'));var util=require(_0x5acc('0x7'));var path=require('path');var sox=require(_0x5acc('0x8'));var csv=require(_0x5acc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5acc('0xa'));var squel=require(_0x5acc('0xb'));var crypto=require(_0x5acc('0xc'));var jsforce=require(_0x5acc('0xd'));var deskjs=require(_0x5acc('0xe'));var toCsv=require(_0x5acc('0x9'));var querystring=require(_0x5acc('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5acc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5acc('0x11'))(_0x5acc('0x12'));var utils=require(_0x5acc('0x13'));var config=require(_0x5acc('0x14'));var licenseUtil=require(_0x5acc('0x15'));var db=require(_0x5acc('0x16'))['db'];var extensions=require(_0x5acc('0x17'));function respondWithStatusCode(_0x217c11,_0x19425b){_0x19425b=_0x19425b||0xcc;return function(_0x503f85){if(_0x503f85){return _0x217c11['sendStatus'](_0x19425b);}return _0x217c11[_0x5acc('0x18')](_0x19425b)[_0x5acc('0x19')]();};}function respondWithResult(_0x54f629,_0x13a786){_0x13a786=_0x13a786||0xc8;return function(_0x36e559){if(_0x36e559){return _0x54f629[_0x5acc('0x18')](_0x13a786)[_0x5acc('0x1a')](_0x36e559);}};}function respondWithFilteredResult(_0x5853c6,_0x32632e){return function(_0x277bc0){if(_0x277bc0){var _0x417a1f=typeof _0x32632e[_0x5acc('0x1b')]==='undefined'&&typeof _0x32632e[_0x5acc('0x1c')]===_0x5acc('0x1d');var _0x59e3da=_0x277bc0[_0x5acc('0x1e')];var _0x1d6683=_0x417a1f?0x0:_0x32632e[_0x5acc('0x1b')];var _0xd2f453=_0x417a1f?_0x277bc0['count']:_0x32632e[_0x5acc('0x1b')]+_0x32632e['limit'];var _0x7466c4;if(_0xd2f453>=_0x59e3da){_0xd2f453=_0x59e3da;_0x7466c4=0xc8;}else{_0x7466c4=0xce;}_0x5853c6[_0x5acc('0x18')](_0x7466c4);return _0x5853c6['set']('Content-Range',_0x1d6683+'-'+_0xd2f453+'/'+_0x59e3da)[_0x5acc('0x1a')](_0x277bc0);}return null;};}function patchUpdates(_0x4e0c89){return function(_0x7e4571){try{jsonpatch['apply'](_0x7e4571,_0x4e0c89,!![]);}catch(_0x372c06){return BPromise[_0x5acc('0x1f')](_0x372c06);}return _0x7e4571[_0x5acc('0x20')]();};}function saveUpdates(_0x1127ee,_0x38cab5){return function(_0x6b357e){if(_0x6b357e){return _0x6b357e[_0x5acc('0x21')](_0x1127ee)['then'](function(_0x343af7){return _0x343af7;});}return null;};}function removeEntity(_0x2ce7ba,_0x28c4c0){return function(_0x1b7430){if(_0x1b7430){return _0x1b7430['destroy']()[_0x5acc('0x22')](function(){var _0x3fe0ad=_0x1b7430[_0x5acc('0x23')]({'plain':!![]});var _0x3ece55=_0x5acc('0x24');return db[_0x5acc('0x25')]['destroy']({'where':{'type':_0x3ece55,'resourceId':_0x3fe0ad['id']}})['then'](function(){return _0x1b7430;});})[_0x5acc('0x22')](function(){_0x2ce7ba[_0x5acc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x378021,_0x218d8c){return function(_0x34546a){if(!_0x34546a){_0x378021['sendStatus'](0x194);}return _0x34546a;};}function handleError(_0x387fc3,_0x2c1cb9){_0x2c1cb9=_0x2c1cb9||0x1f4;return function(_0x39711d){logger['error'](_0x39711d[_0x5acc('0x26')]);if(_0x39711d[_0x5acc('0x27')]){delete _0x39711d[_0x5acc('0x27')];}_0x387fc3[_0x5acc('0x18')](_0x2c1cb9)[_0x5acc('0x28')](_0x39711d);};}exports[_0x5acc('0x29')]=function(_0x199785,_0x200e05){var _0x590847={},_0x9198b6={},_0x1b316a={'count':0x0,'rows':[]};var _0x38f2c9=_['map'](db[_0x5acc('0x2a')]['rawAttributes'],function(_0xc37f75){return{'name':_0xc37f75[_0x5acc('0x2b')],'type':_0xc37f75[_0x5acc('0x2c')][_0x5acc('0x2d')]};});_0x9198b6[_0x5acc('0x2e')]=_[_0x5acc('0x2f')](_0x38f2c9,_0x5acc('0x27'));_0x9198b6[_0x5acc('0x30')]=_['keys'](_0x199785[_0x5acc('0x30')]);_0x9198b6[_0x5acc('0x31')]=_[_0x5acc('0x32')](_0x9198b6[_0x5acc('0x2e')],_0x9198b6[_0x5acc('0x30')]);_0x590847[_0x5acc('0x33')]=_[_0x5acc('0x32')](_0x9198b6[_0x5acc('0x2e')],qs['fields'](_0x199785[_0x5acc('0x30')][_0x5acc('0x34')]));_0x590847['attributes']=_0x590847[_0x5acc('0x33')][_0x5acc('0x35')]?_0x590847['attributes']:_0x9198b6[_0x5acc('0x2e')];if(!_0x199785[_0x5acc('0x30')][_0x5acc('0x36')]('nolimit')){_0x590847[_0x5acc('0x1c')]=qs[_0x5acc('0x1c')](_0x199785[_0x5acc('0x30')][_0x5acc('0x1c')]);_0x590847[_0x5acc('0x1b')]=qs[_0x5acc('0x1b')](_0x199785[_0x5acc('0x30')]['offset']);}_0x590847[_0x5acc('0x37')]=qs['sort'](_0x199785[_0x5acc('0x30')][_0x5acc('0x38')]);_0x590847[_0x5acc('0x39')]=qs[_0x5acc('0x31')](_[_0x5acc('0x3a')](_0x199785[_0x5acc('0x30')],_0x9198b6[_0x5acc('0x31')]),_0x38f2c9);if(_0x199785[_0x5acc('0x30')][_0x5acc('0x3b')]){_0x590847[_0x5acc('0x39')]=_[_0x5acc('0x3c')](_0x590847[_0x5acc('0x39')],{'$or':_[_0x5acc('0x2f')](_0x38f2c9,function(_0x44d51c){if(_0x44d51c[_0x5acc('0x2c')]!==_0x5acc('0x3d')){var _0x1f699b={};_0x1f699b[_0x44d51c['name']]={'$like':'%'+_0x199785['query'][_0x5acc('0x3b')]+'%'};return _0x1f699b;}})});}_0x590847=_[_0x5acc('0x3c')]({},_0x590847,_0x199785['options']);var _0xe8d426={'where':_0x590847[_0x5acc('0x39')]};return db[_0x5acc('0x2a')][_0x5acc('0x1e')](_0xe8d426)[_0x5acc('0x22')](function(_0x59a57c){_0x1b316a[_0x5acc('0x1e')]=_0x59a57c;if(_0x199785[_0x5acc('0x30')]['includeAll']){_0x590847[_0x5acc('0x3e')]=[{'all':!![]}];}return db[_0x5acc('0x2a')]['findAll'](_0x590847);})[_0x5acc('0x22')](function(_0x2bcca4){_0x1b316a[_0x5acc('0x3f')]=_0x2bcca4;return _0x1b316a;})[_0x5acc('0x22')](respondWithFilteredResult(_0x200e05,_0x590847))[_0x5acc('0x40')](handleError(_0x200e05,null));};exports[_0x5acc('0x41')]=function(_0x4cd838,_0x138265){var _0x57976d={'raw':!![],'where':{'id':_0x4cd838[_0x5acc('0x42')]['id']}},_0x1295a3={};_0x1295a3[_0x5acc('0x2e')]=_[_0x5acc('0x43')](db[_0x5acc('0x2a')]['rawAttributes']);_0x1295a3['query']=_[_0x5acc('0x43')](_0x4cd838[_0x5acc('0x30')]);_0x1295a3['filters']=_[_0x5acc('0x32')](_0x1295a3['model'],_0x1295a3['query']);_0x57976d[_0x5acc('0x33')]=_[_0x5acc('0x32')](_0x1295a3[_0x5acc('0x2e')],qs['fields'](_0x4cd838[_0x5acc('0x30')][_0x5acc('0x34')]));_0x57976d['attributes']=_0x57976d['attributes'][_0x5acc('0x35')]?_0x57976d['attributes']:_0x1295a3[_0x5acc('0x2e')];if(_0x4cd838[_0x5acc('0x30')][_0x5acc('0x44')]){_0x57976d[_0x5acc('0x3e')]=[{'all':!![]}];}_0x57976d=_[_0x5acc('0x3c')]({},_0x57976d,_0x4cd838[_0x5acc('0x45')]);return db['Interval'][_0x5acc('0x46')](_0x57976d)[_0x5acc('0x22')](handleEntityNotFound(_0x138265,null))[_0x5acc('0x22')](respondWithResult(_0x138265,null))['catch'](handleError(_0x138265,null));};exports[_0x5acc('0x47')]=function(_0x95a438,_0x2da47f){return db[_0x5acc('0x2a')][_0x5acc('0x47')](_0x95a438[_0x5acc('0x48')],{})['then'](function(_0x24ec2d){var _0x49a70a=_0x95a438[_0x5acc('0x49')][_0x5acc('0x23')]({'plain':!![]});if(!_0x49a70a)throw new Error(_0x5acc('0x4a'));if(_0x49a70a[_0x5acc('0x4b')]==='user'){var _0x5e9140=_0x24ec2d['get']({'plain':!![]});var _0x53683d=_0x5acc('0x24');return db[_0x5acc('0x4c')][_0x5acc('0x46')]({'where':{'name':_0x53683d,'userProfileId':_0x49a70a['userProfileId']},'raw':!![]})[_0x5acc('0x22')](function(_0x518772){if(_0x518772&&_0x518772[_0x5acc('0x4d')]===0x0){return db[_0x5acc('0x25')]['create']({'name':_0x5e9140['name'],'resourceId':_0x5e9140['id'],'type':_0x518772[_0x5acc('0x27')],'sectionId':_0x518772['id']},{})[_0x5acc('0x22')](function(){return _0x24ec2d;});}else{return _0x24ec2d;}})[_0x5acc('0x40')](function(_0x571d47){logger['error'](_0x5acc('0x4e'),_0x571d47);throw _0x571d47;});}return _0x24ec2d;})[_0x5acc('0x22')](respondWithResult(_0x2da47f,0xc9))['catch'](handleError(_0x2da47f,null));};exports[_0x5acc('0x21')]=function(_0x44c802,_0x4250a9){if(_0x44c802['body']['id']){delete _0x44c802[_0x5acc('0x48')]['id'];}return db['Interval'][_0x5acc('0x46')]({'where':{'id':_0x44c802[_0x5acc('0x42')]['id']}})[_0x5acc('0x22')](handleEntityNotFound(_0x4250a9,null))[_0x5acc('0x22')](saveUpdates(_0x44c802['body'],null))['then'](respondWithResult(_0x4250a9,null))[_0x5acc('0x40')](handleError(_0x4250a9,null));};exports[_0x5acc('0x4f')]=function(_0x419158,_0xe90bbb){return db[_0x5acc('0x2a')][_0x5acc('0x46')]({'where':{'id':_0x419158[_0x5acc('0x42')]['id']}})[_0x5acc('0x22')](handleEntityNotFound(_0xe90bbb,null))[_0x5acc('0x22')](removeEntity(_0xe90bbb,null))[_0x5acc('0x40')](handleError(_0xe90bbb,null));};exports[_0x5acc('0x50')]=function(_0x287c92,_0x41ae9b,_0x2bc2a5){if(_0x287c92[_0x5acc('0x48')]['id']){delete _0x287c92[_0x5acc('0x48')]['id'];}return db[_0x5acc('0x2a')][_0x5acc('0x46')]({'where':{'id':_0x287c92[_0x5acc('0x42')]['id']}})['then'](handleEntityNotFound(_0x41ae9b,null))['then'](function(_0x51db49){if(_0x51db49){_0x287c92['body'][_0x5acc('0x51')]=_0x51db49['id'];return db[_0x5acc('0x2a')]['create'](_0x287c92['body']);}})[_0x5acc('0x22')](respondWithResult(_0x41ae9b,null))[_0x5acc('0x40')](handleError(_0x41ae9b,null));};exports['getIntervals']=function(_0x3753b0,_0x2604b3,_0x25c4b6){var _0x3b33dc={};var _0x212b33={};var _0x4c8512;var _0x176c20;return db['Interval']['findOne']({'where':{'id':_0x3753b0[_0x5acc('0x42')]['id']}})['then'](handleEntityNotFound(_0x2604b3,null))[_0x5acc('0x22')](function(_0x234f56){if(_0x234f56){_0x4c8512=_0x234f56;_0x212b33[_0x5acc('0x2e')]=_['keys'](db[_0x5acc('0x2a')]['rawAttributes']);_0x212b33[_0x5acc('0x30')]=_['keys'](_0x3753b0[_0x5acc('0x30')]);_0x212b33[_0x5acc('0x31')]=_[_0x5acc('0x32')](_0x212b33[_0x5acc('0x2e')],_0x212b33['query']);_0x3b33dc['attributes']=_[_0x5acc('0x32')](_0x212b33['model'],qs[_0x5acc('0x34')](_0x3753b0[_0x5acc('0x30')]['fields']));_0x3b33dc[_0x5acc('0x33')]=_0x3b33dc[_0x5acc('0x33')]['length']?_0x3b33dc[_0x5acc('0x33')]:_0x212b33[_0x5acc('0x2e')];_0x3b33dc[_0x5acc('0x37')]=qs[_0x5acc('0x38')](_0x3753b0[_0x5acc('0x30')]['sort']);_0x3b33dc[_0x5acc('0x39')]=qs['filters'](_[_0x5acc('0x3a')](_0x3753b0[_0x5acc('0x30')],_0x212b33[_0x5acc('0x31')]));if(_0x3753b0['query'][_0x5acc('0x3b')]){_0x3b33dc[_0x5acc('0x39')]=_[_0x5acc('0x3c')](_0x3b33dc[_0x5acc('0x39')],{'$or':_[_0x5acc('0x2f')](_0x3b33dc[_0x5acc('0x33')],function(_0x394c21){var _0x19a3ee={};_0x19a3ee[_0x394c21]={'$like':'%'+_0x3753b0['query']['filter']+'%'};return _0x19a3ee;})});}_0x3b33dc=_['merge']({},_0x3b33dc,_0x3753b0[_0x5acc('0x45')]);return _0x4c8512[_0x5acc('0x52')](_0x3b33dc);}})[_0x5acc('0x22')](function(_0x2c4865){if(_0x2c4865){_0x176c20=_0x2c4865['length'];if(!_0x3753b0['query'][_0x5acc('0x36')](_0x5acc('0x53'))){_0x3b33dc[_0x5acc('0x1c')]=qs[_0x5acc('0x1c')](_0x3753b0['query']['limit']);_0x3b33dc[_0x5acc('0x1b')]=qs[_0x5acc('0x1b')](_0x3753b0['query'][_0x5acc('0x1b')]);}return _0x4c8512[_0x5acc('0x52')](_0x3b33dc);}})[_0x5acc('0x22')](function(_0x29893d){if(_0x29893d){return _0x29893d?{'count':_0x176c20,'rows':_0x29893d}:null;}})['then'](respondWithResult(_0x2604b3,null))[_0x5acc('0x40')](handleError(_0x2604b3,null));};exports[_0x5acc('0x54')]=function(_0x13200c,_0x4e090c,_0x2685e4){return db[_0x5acc('0x2a')][_0x5acc('0x55')]({'where':{'id':_0x13200c[_0x5acc('0x42')]['id']}})[_0x5acc('0x22')](handleEntityNotFound(_0x4e090c,null))[_0x5acc('0x22')](function(_0x13d6b0){if(_0x13d6b0){return db[_0x5acc('0x56')][_0x5acc('0x57')](function(_0x452f95){return db[_0x5acc('0x2a')][_0x5acc('0x4f')]({'where':{'IntervalId':_0x13200c[_0x5acc('0x42')]['id']},'transaction':_0x452f95})[_0x5acc('0x22')](function(_0x19b9ae){var _0x4d604d=_[_0x5acc('0x2f')](_0x13200c[_0x5acc('0x48')],function(_0x47a65b){delete _0x47a65b['id'];_0x47a65b[_0x5acc('0x51')]=_0x13200c['params']['id'];return _0x47a65b;});return db['Interval'][_0x5acc('0x58')](_0x4d604d,{'transaction':_0x452f95});});})[_0x5acc('0x22')](function(){return db[_0x5acc('0x2a')]['findAll']({'where':{'IntervalId':_0x13200c[_0x5acc('0x42')]['id']}});});}})[_0x5acc('0x22')](respondWithResult(_0x4e090c,null))['catch'](handleError(_0x4e090c,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7001439..327c417 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 _0x7217=['then','all','map','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals'];(function(_0x29f31c,_0x46bbdf){var _0x3b6b8a=function(_0x557471){while(--_0x557471){_0x29f31c['push'](_0x29f31c['shift']());}};_0x3b6b8a(++_0x46bbdf);}(_0x7217,0x1d6));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x7721('0x0'));var iftime=require(_0x7721('0x1'))['iftime'];module[_0x7721('0x2')]=function(_0x56526c){return _0x56526c[_0x7721('0x3')](_0x7721('0x4'),attributes,{'tableName':_0x7721('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ca816){extensions[_0x7721('0x6')](_0x56526c,_0x4ca816);},'afterBulkCreate':function(_0x312af1,_0x4903cd,_0x58a746){_0x58a746();extensions[_0x7721('0x6')](_0x56526c,_0x312af1[0x0]);},'afterUpdate':function(_0x11a957){extensions['rewrite'](_0x56526c,_0x11a957);},'afterDestroy':function(_0x1db35d){extensions[_0x7721('0x6')](_0x56526c,_0x1db35d);}},'instanceMethods':{'ifTime':function(_0x1f65cd=undefined,_0x4d725f=new Date()){if(typeof this[_0x7721('0x7')]===_0x7721('0x8')){return iftime(this[_0x7721('0x7')],_0x1f65cd,_0x4d725f);}else{return this[_0x7721('0x9')]()[_0x7721('0xa')](function(_0x43aff3){return Promise[_0x7721('0xb')](_0x43aff3[_0x7721('0xc')](function(_0x551e25){return _0x551e25[_0x7721('0xd')](_0x1f65cd,_0x4d725f);}));})[_0x7721('0xa')](function(_0x3ed9f9){return _0x3ed9f9[_0x7721('0xe')](function(_0x4f4f20,_0x3f933d){return _0x4f4f20||_0x3f933d;},![]);});}}}});}; \ No newline at end of file +var _0x2858=['Interval','tools_intervals','rewrite','interval','string','then','all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','define'];(function(_0x155bbf,_0x1bca34){var _0x1cb0ac=function(_0x101c7c){while(--_0x101c7c){_0x155bbf['push'](_0x155bbf['shift']());}};_0x1cb0ac(++_0x1bca34);}(_0x2858,0x113));var _0x8285=function(_0x1325b2,_0x489ce1){_0x1325b2=_0x1325b2-0x0;var _0x1470ef=_0x2858[_0x1325b2];return _0x1470ef;};'use strict';var attributes=require(_0x8285('0x0'));var extensions=require(_0x8285('0x1'));var iftime=require(_0x8285('0x2'))[_0x8285('0x3')];module['exports']=function(_0x444fb4){return _0x444fb4[_0x8285('0x4')](_0x8285('0x5'),attributes,{'tableName':_0x8285('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4df52f){extensions[_0x8285('0x7')](_0x444fb4,_0x4df52f);},'afterBulkCreate':function(_0x2298e6,_0x4017a4,_0x67a474){_0x67a474();extensions[_0x8285('0x7')](_0x444fb4,_0x2298e6[0x0]);},'afterUpdate':function(_0x160242){extensions['rewrite'](_0x444fb4,_0x160242);},'afterDestroy':function(_0x3c1c6a){extensions[_0x8285('0x7')](_0x444fb4,_0x3c1c6a);}},'instanceMethods':{'ifTime':function(_0x904661=undefined,_0x4d8f82=new Date()){if(typeof this[_0x8285('0x8')]===_0x8285('0x9')){return iftime(this[_0x8285('0x8')],_0x904661,_0x4d8f82);}else{return this['getIntervals']()[_0x8285('0xa')](function(_0x56e7d0){return Promise[_0x8285('0xb')](_0x56e7d0['map'](function(_0x544021){return _0x544021[_0x8285('0xc')](_0x904661,_0x4d8f82);}));})[_0x8285('0xa')](function(_0x3e3e28){return _0x3e3e28[_0x8285('0xd')](function(_0x4a54a5,_0x14d52f){return _0x4a54a5||_0x14d52f;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f9b3238..b733c48 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 _0xba6f=['intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','options','raw','limit','include','map','attributes','model','then','info','debug','stringify','catch','message','find','ShowInterval','error','findAll','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime','intervalIds','isArray'];(function(_0x3a188f,_0x4ac11f){var _0x76ee08=function(_0x1c7e2d){while(--_0x1c7e2d){_0x3a188f['push'](_0x3a188f['shift']());}};_0x76ee08(++_0x4ac11f);}(_0xba6f,0xb4));var _0xfba6=function(_0x31a16a,_0x1d60e3){_0x31a16a=_0x31a16a-0x0;var _0x21c892=_0xba6f[_0x31a16a];return _0x21c892;};'use strict';var _=require(_0xfba6('0x0'));var util=require(_0xfba6('0x1'));var db=require(_0xfba6('0x2'))['db'];var iftime=require(_0xfba6('0x3'))[_0xfba6('0x4')];var logger=require(_0xfba6('0x5'))(_0xfba6('0x6'));exports[_0xfba6('0x7')]=function(_0x351f68){var _0x47d73f=this;return new Promise(function(_0x1759b8,_0x5f1e56){return db[_0xfba6('0x8')]['findAll']({'raw':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xa')]===undefined?!![]:![]:!![],'where':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')]['where']||null:null,'attributes':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')]['attributes']||null:null,'limit':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xb')]||null:null,'include':_0x351f68[_0xfba6('0x9')]?_0x351f68[_0xfba6('0x9')][_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x351f68[_0xfba6('0x9')][_0xfba6('0xc')],function(_0x5e3aa3){return{'model':db[_0x5e3aa3['model']],'as':_0x5e3aa3['as'],'attributes':_0x5e3aa3[_0xfba6('0xe')],'include':_0x5e3aa3[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x5e3aa3[_0xfba6('0xc')],function(_0x464997){return{'model':db[_0x464997[_0xfba6('0xf')]],'as':_0x464997['as'],'attributes':_0x464997[_0xfba6('0xe')],'include':_0x464997[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x464997['include'],function(_0x24fb3b){return{'model':db[_0x24fb3b['model']],'as':_0x24fb3b['as'],'attributes':_0x24fb3b['attributes']};}):[]};}):[]};}):[]:[]})[_0xfba6('0x10')](function(_0x35cc27){logger[_0xfba6('0x11')]('GetInterval',_0x351f68);logger[_0xfba6('0x12')](_0xfba6('0x7'),_0x351f68,JSON[_0xfba6('0x13')](_0x35cc27));_0x1759b8(_0x35cc27);})[_0xfba6('0x14')](function(_0x5d8928){logger['error'](_0xfba6('0x7'),_0x5d8928['message'],_0x351f68);_0x5f1e56(_0x47d73f['error'](0x1f4,_0x5d8928[_0xfba6('0x15')]));});});};exports['ShowInterval']=function(_0x3fddbc){var _0x21890c=this;return new Promise(function(_0x20ba1c,_0x20c7c6){return db['Interval'][_0xfba6('0x16')]({'raw':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc['options'][_0xfba6('0xa')]===undefined?!![]:![]:!![],'where':_0x3fddbc['options']?_0x3fddbc['options']['where']||null:null,'attributes':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc[_0xfba6('0x9')]['attributes']||null:null,'include':_0x3fddbc[_0xfba6('0x9')]?_0x3fddbc[_0xfba6('0x9')]['include']?_[_0xfba6('0xd')](_0x3fddbc[_0xfba6('0x9')][_0xfba6('0xc')],function(_0x5264fa){return{'model':db[_0x5264fa[_0xfba6('0xf')]],'as':_0x5264fa['as'],'attributes':_0x5264fa[_0xfba6('0xe')],'include':_0x5264fa[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x5264fa[_0xfba6('0xc')],function(_0x24fa47){return{'model':db[_0x24fa47[_0xfba6('0xf')]],'as':_0x24fa47['as'],'attributes':_0x24fa47[_0xfba6('0xe')],'include':_0x24fa47[_0xfba6('0xc')]?_[_0xfba6('0xd')](_0x24fa47['include'],function(_0x45e51f){return{'model':db[_0x45e51f[_0xfba6('0xf')]],'as':_0x45e51f['as'],'attributes':_0x45e51f[_0xfba6('0xe')]};}):[]};}):[]};}):[]:[]})[_0xfba6('0x10')](function(_0x3805be){logger['info'](_0xfba6('0x17'),_0x3fddbc);logger[_0xfba6('0x12')](_0xfba6('0x17'),_0x3fddbc,JSON[_0xfba6('0x13')](_0x3805be));_0x20ba1c(_0x3805be);})[_0xfba6('0x14')](function(_0x4d9395){logger[_0xfba6('0x18')](_0xfba6('0x17'),_0x4d9395[_0xfba6('0x15')],_0x3fddbc);_0x20c7c6(_0x21890c[_0xfba6('0x18')](0x1f4,_0x4d9395[_0xfba6('0x15')]));});});};function checkArrayOfIntervals(_0x14d54b,_0x350ca5){var _0x249b5c=[];return db[_0xfba6('0x8')][_0xfba6('0x19')]({'where':{'id':_0x14d54b}})[_0xfba6('0x10')](function(_0x4ea259){_0x249b5c=_0x4ea259;return Promise['all'](_0x249b5c['map'](function(_0x47c33b){return _0x47c33b[_0xfba6('0x1a')](_0x350ca5);}));})[_0xfba6('0x10')](function(_0x21d53a){var _0x121c3f=_0x21d53a[_0xfba6('0x1b')](function(_0x11656a,_0x48f8e9){return _0x11656a||_0x48f8e9;},![]);logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x1d'),_0x249b5c[_0xfba6('0xd')](function(_0xc2b367){return _0xc2b367[_0xfba6('0x1e')];})[_0xfba6('0x1f')](',\x20'),_0x249b5c[_0xfba6('0xd')](function(_0x44ef82){return _0x44ef82['id'];})[_0xfba6('0x1f')](',\x20')));return _0x121c3f;});}function checkSingleInterval(_0x2ba22f,_0x5a9891){return db['Interval']['findById'](_0x2ba22f)[_0xfba6('0x10')](function(_0x2e3313){if(_0x2e3313){logger['info'](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x2e3313[_0xfba6('0x1e')],_0x2e3313['id']));return _0x2e3313['ifTime'](_0x5a9891);}});}exports[_0xfba6('0x20')]=function(_0x1cc335){var _0x3bc2c1=_0x1cc335[_0xfba6('0x21')];var _0x17365b=Array[_0xfba6('0x22')](_0x1cc335[_0xfba6('0x23')])?_0x1cc335[_0xfba6('0x23')]:typeof _0x1cc335[_0xfba6('0x23')]===_0xfba6('0x24')?[_0x1cc335['intervals']]:[];var _0x55b424=_0x1cc335[_0xfba6('0x25')]||undefined;var _0x49f43a=![];if(_0x17365b[_0xfba6('0x26')]){logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x27'),_0x17365b[_0xfba6('0x1f')](';\x20')));}if(_0x55b424){logger[_0xfba6('0x11')](util[_0xfba6('0x1c')](_0xfba6('0x28'),_0x55b424));}logger['debug'](_0xfba6('0x29'),_0x49f43a);logger['silly'](_0xfba6('0x20'),_0x1cc335);return Promise[_0xfba6('0x2a')]()[_0xfba6('0x10')](function(){if(Array[_0xfba6('0x22')](_0x3bc2c1)){return checkArrayOfIntervals(_0x3bc2c1,_0x55b424);}else if(_0x3bc2c1){return checkSingleInterval(_0x3bc2c1,_0x55b424);}})['then'](function(_0x4382d0){var _0xdf3000=_0x17365b[_0xfba6('0x1b')](function(_0x1a13b2,_0x291aac){return _0x1a13b2||iftime(_0x291aac,_0x55b424);},![]);_0x49f43a=_0x4382d0||_0xdf3000;return _0x49f43a;})[_0xfba6('0x14')](function(_0x4f4fb4){logger[_0xfba6('0x18')](_0xfba6('0x20'),_0x1cc335,_0x4f4fb4);throw this['error'](0x1f4,_0x4f4fb4['message']);});}; \ No newline at end of file +var _0x7b61=['map','attributes','model','then','info','GetInterval','debug','stringify','error','message','find','ShowInterval','all','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','reduce','util','../../mysqldb','../../utils/iftime','iftime','rpc','Interval','findAll','options','raw','where','limit','include'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x7b61,0x11a));var _0x17b6=function(_0x335dfe,_0x4fb4d2){_0x335dfe=_0x335dfe-0x0;var _0x355e84=_0x7b61[_0x335dfe];return _0x355e84;};'use strict';var _=require('lodash');var util=require(_0x17b6('0x0'));var db=require(_0x17b6('0x1'))['db'];var iftime=require(_0x17b6('0x2'))[_0x17b6('0x3')];var logger=require('../../config/logger')(_0x17b6('0x4'));exports['GetInterval']=function(_0x347493){var _0x57645e=this;return new Promise(function(_0x452e80,_0x4e23a3){return db[_0x17b6('0x5')][_0x17b6('0x6')]({'raw':_0x347493[_0x17b6('0x7')]?_0x347493[_0x17b6('0x7')][_0x17b6('0x8')]===undefined?!![]:![]:!![],'where':_0x347493['options']?_0x347493[_0x17b6('0x7')][_0x17b6('0x9')]||null:null,'attributes':_0x347493[_0x17b6('0x7')]?_0x347493[_0x17b6('0x7')]['attributes']||null:null,'limit':_0x347493[_0x17b6('0x7')]?_0x347493[_0x17b6('0x7')][_0x17b6('0xa')]||null:null,'include':_0x347493[_0x17b6('0x7')]?_0x347493[_0x17b6('0x7')][_0x17b6('0xb')]?_[_0x17b6('0xc')](_0x347493[_0x17b6('0x7')]['include'],function(_0x41607b){return{'model':db[_0x41607b['model']],'as':_0x41607b['as'],'attributes':_0x41607b[_0x17b6('0xd')],'include':_0x41607b[_0x17b6('0xb')]?_[_0x17b6('0xc')](_0x41607b[_0x17b6('0xb')],function(_0x294df1){return{'model':db[_0x294df1[_0x17b6('0xe')]],'as':_0x294df1['as'],'attributes':_0x294df1['attributes'],'include':_0x294df1[_0x17b6('0xb')]?_[_0x17b6('0xc')](_0x294df1[_0x17b6('0xb')],function(_0x5a5810){return{'model':db[_0x5a5810[_0x17b6('0xe')]],'as':_0x5a5810['as'],'attributes':_0x5a5810['attributes']};}):[]};}):[]};}):[]:[]})[_0x17b6('0xf')](function(_0x3d4b35){logger[_0x17b6('0x10')](_0x17b6('0x11'),_0x347493);logger[_0x17b6('0x12')]('GetInterval',_0x347493,JSON[_0x17b6('0x13')](_0x3d4b35));_0x452e80(_0x3d4b35);})['catch'](function(_0x1582a5){logger[_0x17b6('0x14')]('GetInterval',_0x1582a5['message'],_0x347493);_0x4e23a3(_0x57645e[_0x17b6('0x14')](0x1f4,_0x1582a5[_0x17b6('0x15')]));});});};exports['ShowInterval']=function(_0x1279a1){var _0x4eaa5f=this;return new Promise(function(_0x521fb6,_0x51243e){return db[_0x17b6('0x5')][_0x17b6('0x16')]({'raw':_0x1279a1['options']?_0x1279a1[_0x17b6('0x7')][_0x17b6('0x8')]===undefined?!![]:![]:!![],'where':_0x1279a1['options']?_0x1279a1['options'][_0x17b6('0x9')]||null:null,'attributes':_0x1279a1['options']?_0x1279a1[_0x17b6('0x7')][_0x17b6('0xd')]||null:null,'include':_0x1279a1['options']?_0x1279a1[_0x17b6('0x7')][_0x17b6('0xb')]?_[_0x17b6('0xc')](_0x1279a1[_0x17b6('0x7')][_0x17b6('0xb')],function(_0xdff7ee){return{'model':db[_0xdff7ee[_0x17b6('0xe')]],'as':_0xdff7ee['as'],'attributes':_0xdff7ee['attributes'],'include':_0xdff7ee[_0x17b6('0xb')]?_[_0x17b6('0xc')](_0xdff7ee['include'],function(_0x2a0d17){return{'model':db[_0x2a0d17[_0x17b6('0xe')]],'as':_0x2a0d17['as'],'attributes':_0x2a0d17[_0x17b6('0xd')],'include':_0x2a0d17[_0x17b6('0xb')]?_[_0x17b6('0xc')](_0x2a0d17[_0x17b6('0xb')],function(_0x427f29){return{'model':db[_0x427f29['model']],'as':_0x427f29['as'],'attributes':_0x427f29[_0x17b6('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a6708){logger[_0x17b6('0x10')](_0x17b6('0x17'),_0x1279a1);logger[_0x17b6('0x12')](_0x17b6('0x17'),_0x1279a1,JSON[_0x17b6('0x13')](_0x2a6708));_0x521fb6(_0x2a6708);})['catch'](function(_0x1854ec){logger[_0x17b6('0x14')](_0x17b6('0x17'),_0x1854ec[_0x17b6('0x15')],_0x1279a1);_0x51243e(_0x4eaa5f[_0x17b6('0x14')](0x1f4,_0x1854ec[_0x17b6('0x15')]));});});};function checkArrayOfIntervals(_0x5216f9,_0x1d5473){var _0x40ded5=[];return db[_0x17b6('0x5')][_0x17b6('0x6')]({'where':{'id':_0x5216f9}})[_0x17b6('0xf')](function(_0xe08064){_0x40ded5=_0xe08064;return Promise[_0x17b6('0x18')](_0x40ded5['map'](function(_0x4b21b5){return _0x4b21b5['ifTime'](_0x1d5473);}));})['then'](function(_0x2f805b){var _0x34a5ab=_0x2f805b['reduce'](function(_0x5b8a5f,_0x4290b4){return _0x5b8a5f||_0x4290b4;},![]);logger['info'](util[_0x17b6('0x19')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x40ded5[_0x17b6('0xc')](function(_0x30dc59){return _0x30dc59[_0x17b6('0x1a')];})[_0x17b6('0x1b')](',\x20'),_0x40ded5[_0x17b6('0xc')](function(_0x24f102){return _0x24f102['id'];})[_0x17b6('0x1b')](',\x20')));return _0x34a5ab;});}function checkSingleInterval(_0x18d79e,_0x281545){return db[_0x17b6('0x5')][_0x17b6('0x1c')](_0x18d79e)['then'](function(_0x3f3675){if(_0x3f3675){logger[_0x17b6('0x10')](util[_0x17b6('0x19')](_0x17b6('0x1d'),_0x3f3675[_0x17b6('0x1a')],_0x3f3675['id']));return _0x3f3675['ifTime'](_0x281545);}});}exports[_0x17b6('0x1e')]=function(_0x8d111a){var _0x4210ff=_0x8d111a[_0x17b6('0x1f')];var _0x327379=Array[_0x17b6('0x20')](_0x8d111a[_0x17b6('0x21')])?_0x8d111a['intervals']:typeof _0x8d111a[_0x17b6('0x21')]===_0x17b6('0x22')?[_0x8d111a[_0x17b6('0x21')]]:[];var _0x2506e2=_0x8d111a['timezone']||undefined;var _0x102595=![];if(_0x327379[_0x17b6('0x23')]){logger[_0x17b6('0x10')](util['format'](_0x17b6('0x24'),_0x327379['join'](';\x20')));}if(_0x2506e2){logger[_0x17b6('0x10')](util['format'](_0x17b6('0x25'),_0x2506e2));}logger[_0x17b6('0x12')](_0x17b6('0x26'),_0x102595);logger[_0x17b6('0x27')]('IntervalIftime',_0x8d111a);return Promise[_0x17b6('0x28')]()[_0x17b6('0xf')](function(){if(Array['isArray'](_0x4210ff)){return checkArrayOfIntervals(_0x4210ff,_0x2506e2);}else if(_0x4210ff){return checkSingleInterval(_0x4210ff,_0x2506e2);}})['then'](function(_0x28e478){var _0x3c68d7=_0x327379[_0x17b6('0x29')](function(_0x29a674,_0x5f1711){return _0x29a674||iftime(_0x5f1711,_0x2506e2);},![]);_0x102595=_0x28e478||_0x3c68d7;return _0x102595;})['catch'](function(_0x7644f3){logger[_0x17b6('0x14')](_0x17b6('0x1e'),_0x8d111a,_0x7644f3);throw this[_0x17b6('0x14')](0x1f4,_0x7644f3[_0x17b6('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d8fb8da..386e32f 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(_0x5e1b94,_0x561a11){var _0x19fb41=function(_0x2eb040){while(--_0x2eb040){_0x5e1b94['push'](_0x5e1b94['shift']());}};_0x19fb41(++_0x561a11);}(_0x2032,0xd9));var _0x2203=function(_0x4f5f03,_0x387b15){_0x4f5f03=_0x4f5f03-0x0;var _0x28795b=_0x2032[_0x4f5f03];return _0x28795b;};'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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0b0e,0x187));var _0xe0b0=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x0b0e[_0xcf4569];return _0x7fef;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2ec59b6..a3b6cd1 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 _0x3b7a=['write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','key','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira'];(function(_0x54b907,_0x29ff96){var _0x363d89=function(_0x184d8f){while(--_0x184d8f){_0x54b907['push'](_0x54b907['shift']());}};_0x363d89(++_0x29ff96);}(_0x3b7a,0x129));var _0xa3b7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3b7a[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0xa3b7('0x0'));var https=require(_0xa3b7('0x1'));var logger=require(_0xa3b7('0x2'))(_0xa3b7('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x14b269,_0x1fe360){var _0x25d400={'fields':{'project':{'key':_0x14b269[_0xa3b7('0x4')]||_0xa3b7('0x5')},'summary':(_0x14b269[_0xa3b7('0x6')]||'Report')+'\x20from\x20'+_0x14b269['ip'],'description':_0x14b269[_0xa3b7('0x7')]||JSON[_0xa3b7('0x8')](_0x14b269),'issuetype':{'name':_0x14b269[_0xa3b7('0x9')]||_0xa3b7('0xa')}}};_0x25d400[_0xa3b7('0xb')][_0xa3b7('0xc')]=_0x14b269[_0xa3b7('0xd')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0xe')]=_0x14b269[_0xa3b7('0xf')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x10')]=_0x14b269[_0xa3b7('0x11')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x12')]=_0x14b269[_0xa3b7('0x13')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x14')]=_0x14b269[_0xa3b7('0x15')];_0x25d400[_0xa3b7('0xb')][_0xa3b7('0x16')]=_0x14b269['ip'];var _0x1a0f3a={'host':_0xa3b7('0x17'),'port':0x1bb,'path':_0xa3b7('0x18'),'method':_0xa3b7('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xa3b7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xa3b7('0x1b'))}};var _0x2c74d8=JSON[_0xa3b7('0x8')](_0x25d400);var _0x397d25=https[_0xa3b7('0x1c')](_0x1a0f3a,function(_0xf1f291){_0xf1f291[_0xa3b7('0x1d')](_0xa3b7('0x1e'));var _0x3cca9f='';_0xf1f291['on'](_0xa3b7('0x1f'),function(_0x357d0d){_0x3cca9f+=_0x357d0d;});_0xf1f291['on'](_0xa3b7('0x20'),function(){if(_0x1fe360){return _0x1fe360['status'](_0xf1f291[_0xa3b7('0x21')])[_0xa3b7('0x22')](JSON[_0xa3b7('0x23')](_0x3cca9f));}});});_0x397d25['on'](_0xa3b7('0x24'),function(_0x46717b){if(_0x1fe360){return _0x1fe360[_0xa3b7('0x25')](0x1f4)[_0xa3b7('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xa3b7('0x26')}]});}});_0x397d25[_0xa3b7('0x27')](_0x2c74d8);_0x397d25[_0xa3b7('0x20')]();}exports[_0xa3b7('0x28')]=openIssue;exports[_0xa3b7('0x29')]=function(_0x30f68b,_0x535982){_0x30f68b[_0xa3b7('0x2a')]['ip']=_0x30f68b[_0xa3b7('0x2b')][_0xa3b7('0x2c')]||_0x30f68b[_0xa3b7('0x2d')][_0xa3b7('0x2e')]||_0x30f68b[_0xa3b7('0x2f')][_0xa3b7('0x2e')]||_0x30f68b['connection'][_0xa3b7('0x2f')][_0xa3b7('0x2e')];return openIssue(_0x30f68b[_0xa3b7('0x2a')],_0x535982);}; \ No newline at end of file +var _0xc46b=['socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason','customfield_10102','POST','application/json','Basic\x20','base64','request','setEncoding','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','connection','remoteAddress'];(function(_0x316115,_0x547727){var _0xacc247=function(_0x5837ce){while(--_0x5837ce){_0x316115['push'](_0x316115['shift']());}};_0xacc247(++_0x547727);}(_0xc46b,0x196));var _0xbc46=function(_0x2438d2,_0x57f46d){_0x2438d2=_0x2438d2-0x0;var _0x5f8e14=_0xc46b[_0x2438d2];return _0x5f8e14;};'use strict';var BPromise=require(_0xbc46('0x0'));var https=require('https');var logger=require(_0xbc46('0x1'))(_0xbc46('0x2'));var USERNAME=_0xbc46('0x3');var PASSWORD=_0xbc46('0x4');function openIssue(_0x2c3fca,_0xafc121){var _0x4d0572={'fields':{'project':{'key':_0x2c3fca[_0xbc46('0x5')]||_0xbc46('0x6')},'summary':(_0x2c3fca[_0xbc46('0x7')]||'Report')+_0xbc46('0x8')+_0x2c3fca['ip'],'description':_0x2c3fca[_0xbc46('0x9')]||JSON[_0xbc46('0xa')](_0x2c3fca),'issuetype':{'name':_0x2c3fca[_0xbc46('0xb')]||_0xbc46('0xc')}}};_0x4d0572[_0xbc46('0xd')][_0xbc46('0xe')]=_0x2c3fca[_0xbc46('0xf')];_0x4d0572['fields'][_0xbc46('0x10')]=_0x2c3fca[_0xbc46('0x11')];_0x4d0572[_0xbc46('0xd')]['customfield_11502']=_0x2c3fca['newToken'];_0x4d0572[_0xbc46('0xd')][_0xbc46('0x12')]=_0x2c3fca[_0xbc46('0x13')];_0x4d0572[_0xbc46('0xd')][_0xbc46('0x14')]=_0x2c3fca[_0xbc46('0x15')];_0x4d0572[_0xbc46('0xd')][_0xbc46('0x16')]=_0x2c3fca['ip'];var _0x29473f={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xbc46('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xbc46('0x18'),'Authorization':_0xbc46('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xbc46('0x1a'))}};var _0xcd96a4=JSON[_0xbc46('0xa')](_0x4d0572);var _0x44bec1=https[_0xbc46('0x1b')](_0x29473f,function(_0x37efdf){_0x37efdf[_0xbc46('0x1c')](_0xbc46('0x1d'));var _0x383625='';_0x37efdf['on'](_0xbc46('0x1e'),function(_0x5a1b25){_0x383625+=_0x5a1b25;});_0x37efdf['on'](_0xbc46('0x1f'),function(){if(_0xafc121){return _0xafc121[_0xbc46('0x20')](_0x37efdf['statusCode'])[_0xbc46('0x21')](JSON['parse'](_0x383625));}});});_0x44bec1['on'](_0xbc46('0x22'),function(_0x90383d){if(_0xafc121){return _0xafc121['status'](0x1f4)['json']({'errors':[{'message':_0xbc46('0x23'),'type':_0xbc46('0x24')}]});}});_0x44bec1[_0xbc46('0x25')](_0xcd96a4);_0x44bec1['end']();}exports['openIssue']=openIssue;exports[_0xbc46('0x26')]=function(_0x1f0131,_0xecdba2){_0x1f0131[_0xbc46('0x27')]['ip']=_0x1f0131[_0xbc46('0x28')][_0xbc46('0x29')]||_0x1f0131[_0xbc46('0x2a')][_0xbc46('0x2b')]||_0x1f0131[_0xbc46('0x2c')][_0xbc46('0x2b')]||_0x1f0131[_0xbc46('0x2a')][_0xbc46('0x2c')][_0xbc46('0x2b')];return openIssue(_0x1f0131['body'],_0xecdba2);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8c4ff67..47486bc 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 _0x6f0d=['post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x497e97,_0x4fb74c){var _0x1891f9=function(_0x370b3a){while(--_0x370b3a){_0x497e97['push'](_0x497e97['shift']());}};_0x1891f9(++_0x4fb74c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28bad1,_0x64bba2){_0x28bad1=_0x28bad1-0x0;var _0x37e5df=_0x6f0d[_0x28bad1];return _0x37e5df;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var fs_extra=require(_0xd6f0('0x4'));var auth=require(_0xd6f0('0x5'));var interaction=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var controller=require(_0xd6f0('0x8'));router['get']('/',auth[_0xd6f0('0x9')](),controller['index']);router[_0xd6f0('0xa')](_0xd6f0('0xb'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xc')]);router['get']('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')]('/',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0xf')]);router['put'](_0xd6f0('0x10'),auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x11')]);router[_0xd6f0('0x12')]('/:id',auth[_0xd6f0('0x9')](),controller[_0xd6f0('0x13')]);module[_0xd6f0('0x14')]=router; \ No newline at end of file +var _0x0a9a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','util','connect-timeout','express'];(function(_0x19a874,_0x442a65){var _0x54edf5=function(_0x368189){while(--_0x368189){_0x19a874['push'](_0x19a874['shift']());}};_0x54edf5(++_0x442a65);}(_0x0a9a,0x183));var _0xa0a9=function(_0x182401,_0x475871){_0x182401=_0x182401-0x0;var _0x4c0e1c=_0x0a9a[_0x182401];return _0x4c0e1c;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/describe',auth[_0xa0a9('0x8')](),controller['describe']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xc')]);router['put']('/:id',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['delete'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index df0a3d5..91dbd3e 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x1830be,_0x32d010){_0x1830be=_0x1830be-0x0;var _0x15ff7b=_0x7a54[_0x1830be];return _0x15ff7b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x494d40,_0x412772){_0x494d40=_0x494d40-0x0;var _0xf4f386=_0x7a54[_0x494d40];return _0xf4f386;};'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 72948c7..1eec4d3 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x5292,0xf7));var _0x2529=function(_0x455ac0,_0x1d5f16){_0x455ac0=_0x455ac0-0x0;var _0xfb9257=_0x5292[_0x455ac0];return _0xfb9257;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['JscriptyAnswerReport'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file +var _0x448b=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x49f2fe,_0x331211){var _0x718c28=function(_0x31bd7a){while(--_0x31bd7a){_0x49f2fe['push'](_0x49f2fe['shift']());}};_0x718c28(++_0x331211);}(_0x448b,0x125));var _0xb448=function(_0x54f9d5,_0x2cc670){_0x54f9d5=_0x54f9d5-0x0;var _0x14722c=_0x448b[_0x54f9d5];return _0x14722c;};'use strict';var emlformat=require(_0xb448('0x0'));var rimraf=require(_0xb448('0x1'));var zipdir=require(_0xb448('0x2'));var jsonpatch=require(_0xb448('0x3'));var rp=require(_0xb448('0x4'));var moment=require(_0xb448('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb448('0x6'));var util=require(_0xb448('0x7'));var path=require(_0xb448('0x8'));var sox=require(_0xb448('0x9'));var csv=require(_0xb448('0xa'));var ejs=require(_0xb448('0xb'));var fs=require('fs');var fs_extra=require(_0xb448('0xc'));var _=require('lodash');var squel=require(_0xb448('0xd'));var crypto=require(_0xb448('0xe'));var jsforce=require(_0xb448('0xf'));var deskjs=require(_0xb448('0x10'));var toCsv=require(_0xb448('0xa'));var querystring=require(_0xb448('0x11'));var Papa=require(_0xb448('0x12'));var Redis=require(_0xb448('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb448('0x14'));var as=require(_0xb448('0x15'));var hardwareService=require(_0xb448('0x16'));var logger=require(_0xb448('0x17'))(_0xb448('0x18'));var utils=require(_0xb448('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb448('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5506eb,_0x13c0a9){_0x13c0a9=_0x13c0a9||0xcc;return function(_0x35a883){if(_0x35a883){return _0x5506eb[_0xb448('0x1b')](_0x13c0a9);}return _0x5506eb[_0xb448('0x1c')](_0x13c0a9)[_0xb448('0x1d')]();};}function respondWithResult(_0x4ff345,_0x46978b){_0x46978b=_0x46978b||0xc8;return function(_0x116376){if(_0x116376){return _0x4ff345[_0xb448('0x1c')](_0x46978b)[_0xb448('0x1e')](_0x116376);}};}function respondWithFilteredResult(_0x2eab92,_0x38e884){return function(_0x219908){if(_0x219908){var _0x4744f7=typeof _0x38e884[_0xb448('0x1f')]==='undefined'&&typeof _0x38e884['limit']===_0xb448('0x20');var _0x5ac2b5=_0x219908[_0xb448('0x21')];var _0x1986de=_0x4744f7?0x0:_0x38e884['offset'];var _0x27906d=_0x4744f7?_0x219908[_0xb448('0x21')]:_0x38e884['offset']+_0x38e884[_0xb448('0x22')];var _0x1616bb;if(_0x27906d>=_0x5ac2b5){_0x27906d=_0x5ac2b5;_0x1616bb=0xc8;}else{_0x1616bb=0xce;}_0x2eab92[_0xb448('0x1c')](_0x1616bb);return _0x2eab92[_0xb448('0x23')](_0xb448('0x24'),_0x1986de+'-'+_0x27906d+'/'+_0x5ac2b5)[_0xb448('0x1e')](_0x219908);}return null;};}function patchUpdates(_0x1c25af){return function(_0x265951){try{jsonpatch['apply'](_0x265951,_0x1c25af,!![]);}catch(_0xec04af){return BPromise[_0xb448('0x25')](_0xec04af);}return _0x265951['save']();};}function saveUpdates(_0x245135,_0x3ef9c7){return function(_0x22e2ec){if(_0x22e2ec){return _0x22e2ec[_0xb448('0x26')](_0x245135)[_0xb448('0x27')](function(_0x4e123b){return _0x4e123b;});}return null;};}function removeEntity(_0x5126a8,_0x756e92){return function(_0xd27219){if(_0xd27219){return _0xd27219[_0xb448('0x28')]()[_0xb448('0x27')](function(){_0x5126a8[_0xb448('0x1c')](0xcc)[_0xb448('0x1d')]();});}};}function handleEntityNotFound(_0x5d1c6e,_0x35e3e2){return function(_0x2cdb88){if(!_0x2cdb88){_0x5d1c6e['sendStatus'](0x194);}return _0x2cdb88;};}function handleError(_0x14d636,_0x1c2183){_0x1c2183=_0x1c2183||0x1f4;return function(_0x2e3b84){logger[_0xb448('0x29')](_0x2e3b84['stack']);if(_0x2e3b84[_0xb448('0x2a')]){delete _0x2e3b84[_0xb448('0x2a')];}_0x14d636[_0xb448('0x1c')](_0x1c2183)[_0xb448('0x2b')](_0x2e3b84);};}exports[_0xb448('0x2c')]=function(_0x1e9266,_0x17654e){var _0xb9204d={},_0x4b698a={},_0x5f522b={'count':0x0,'rows':[]};var _0x2efb5b=_['map'](db[_0xb448('0x2d')][_0xb448('0x2e')],function(_0x5a4337){return{'name':_0x5a4337[_0xb448('0x2f')],'type':_0x5a4337['type'][_0xb448('0x30')]};});_0x4b698a[_0xb448('0x31')]=_[_0xb448('0x32')](_0x2efb5b,_0xb448('0x2a'));_0x4b698a[_0xb448('0x33')]=_[_0xb448('0x34')](_0x1e9266[_0xb448('0x33')]);_0x4b698a['filters']=_[_0xb448('0x35')](_0x4b698a[_0xb448('0x31')],_0x4b698a[_0xb448('0x33')]);_0xb9204d[_0xb448('0x36')]=_[_0xb448('0x35')](_0x4b698a[_0xb448('0x31')],qs[_0xb448('0x37')](_0x1e9266['query']['fields']));_0xb9204d[_0xb448('0x36')]=_0xb9204d['attributes'][_0xb448('0x38')]?_0xb9204d[_0xb448('0x36')]:_0x4b698a['model'];if(!_0x1e9266[_0xb448('0x33')][_0xb448('0x39')](_0xb448('0x3a'))){_0xb9204d[_0xb448('0x22')]=qs[_0xb448('0x22')](_0x1e9266[_0xb448('0x33')][_0xb448('0x22')]);_0xb9204d['offset']=qs[_0xb448('0x1f')](_0x1e9266['query']['offset']);}_0xb9204d[_0xb448('0x3b')]=qs['sort'](_0x1e9266[_0xb448('0x33')][_0xb448('0x3c')]);_0xb9204d[_0xb448('0x3d')]=qs['filters'](_['pick'](_0x1e9266[_0xb448('0x33')],_0x4b698a['filters']),_0x2efb5b);if(_0x1e9266[_0xb448('0x33')][_0xb448('0x3e')]){_0xb9204d['where']=_[_0xb448('0x3f')](_0xb9204d['where'],{'$or':_[_0xb448('0x32')](_0x2efb5b,function(_0x1f96c4){if(_0x1f96c4['type']!==_0xb448('0x40')){var _0x45f5c3={};_0x45f5c3[_0x1f96c4[_0xb448('0x2a')]]={'$like':'%'+_0x1e9266['query'][_0xb448('0x3e')]+'%'};return _0x45f5c3;}})});}_0xb9204d=_[_0xb448('0x3f')]({},_0xb9204d,_0x1e9266[_0xb448('0x41')]);var _0x4e0346={'where':_0xb9204d[_0xb448('0x3d')]};return db[_0xb448('0x2d')][_0xb448('0x21')](_0x4e0346)[_0xb448('0x27')](function(_0x55db27){_0x5f522b['count']=_0x55db27;if(_0x1e9266[_0xb448('0x33')][_0xb448('0x42')]){_0xb9204d[_0xb448('0x43')]=[{'all':!![]}];}return db[_0xb448('0x2d')][_0xb448('0x44')](_0xb9204d);})[_0xb448('0x27')](function(_0x11f5bb){_0x5f522b[_0xb448('0x45')]=_0x11f5bb;return _0x5f522b;})['then'](respondWithFilteredResult(_0x17654e,_0xb9204d))[_0xb448('0x46')](handleError(_0x17654e,null));};exports['show']=function(_0x31390c,_0x418aae){var _0x5a3b83={'raw':!![],'where':{'id':_0x31390c[_0xb448('0x47')]['id']}},_0x4e811c={};_0x4e811c['model']=_['keys'](db['JscriptyAnswerReport'][_0xb448('0x2e')]);_0x4e811c['query']=_[_0xb448('0x34')](_0x31390c[_0xb448('0x33')]);_0x4e811c[_0xb448('0x48')]=_['intersection'](_0x4e811c[_0xb448('0x31')],_0x4e811c[_0xb448('0x33')]);_0x5a3b83['attributes']=_[_0xb448('0x35')](_0x4e811c[_0xb448('0x31')],qs[_0xb448('0x37')](_0x31390c[_0xb448('0x33')]['fields']));_0x5a3b83[_0xb448('0x36')]=_0x5a3b83[_0xb448('0x36')][_0xb448('0x38')]?_0x5a3b83[_0xb448('0x36')]:_0x4e811c[_0xb448('0x31')];if(_0x31390c[_0xb448('0x33')]['includeAll']){_0x5a3b83[_0xb448('0x43')]=[{'all':!![]}];}_0x5a3b83=_[_0xb448('0x3f')]({},_0x5a3b83,_0x31390c[_0xb448('0x41')]);return db[_0xb448('0x2d')][_0xb448('0x49')](_0x5a3b83)[_0xb448('0x27')](handleEntityNotFound(_0x418aae,null))['then'](respondWithResult(_0x418aae,null))['catch'](handleError(_0x418aae,null));};exports['create']=function(_0x307518,_0x4aa18b){return db[_0xb448('0x2d')]['create'](_0x307518[_0xb448('0x4a')],{})[_0xb448('0x27')](respondWithResult(_0x4aa18b,0xc9))['catch'](handleError(_0x4aa18b,null));};exports[_0xb448('0x26')]=function(_0x44d084,_0x459e24){if(_0x44d084[_0xb448('0x4a')]['id']){delete _0x44d084[_0xb448('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0xb448('0x49')]({'where':{'id':_0x44d084['params']['id']}})[_0xb448('0x27')](handleEntityNotFound(_0x459e24,null))[_0xb448('0x27')](saveUpdates(_0x44d084[_0xb448('0x4a')],null))[_0xb448('0x27')](respondWithResult(_0x459e24,null))[_0xb448('0x46')](handleError(_0x459e24,null));};exports[_0xb448('0x28')]=function(_0x5170d2,_0x1fed48){return db[_0xb448('0x2d')][_0xb448('0x49')]({'where':{'id':_0x5170d2[_0xb448('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fed48,null))[_0xb448('0x27')](removeEntity(_0x1fed48,null))[_0xb448('0x46')](handleError(_0x1fed48,null));};exports[_0xb448('0x4b')]=function(_0x52d7db,_0x33bad1){return db[_0xb448('0x2d')][_0xb448('0x4b')]()[_0xb448('0x27')](respondWithResult(_0x33bad1,null))[_0xb448('0x46')](handleError(_0x33bad1,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c5542e6..7172633 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 _0x363f=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x363f,0x9e));var _0xf363=function(_0x25ff51,_0x2a1c1b){_0x25ff51=_0x25ff51-0x0;var _0x34a777=_0x363f[_0x25ff51];return _0x34a777;};'use strict';var _=require('lodash');var util=require(_0xf363('0x0'));var logger=require(_0xf363('0x1'))(_0xf363('0x2'));var moment=require(_0xf363('0x3'));var BPromise=require(_0xf363('0x4'));var rp=require(_0xf363('0x5'));var fs=require('fs');var path=require(_0xf363('0x6'));var rimraf=require(_0xf363('0x7'));var config=require(_0xf363('0x8'));var attributes=require(_0xf363('0x9'));module[_0xf363('0xa')]=function(_0xfba494,_0x359a4a){return _0xfba494[_0xf363('0xb')](_0xf363('0xc'),attributes,{'tableName':_0xf363('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f63=['JscriptyAnswerReport','api','moment','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define'];(function(_0x41948d,_0x382e11){var _0x54af0d=function(_0x57b82a){while(--_0x57b82a){_0x41948d['push'](_0x41948d['shift']());}};_0x54af0d(++_0x382e11);}(_0x4f63,0x1c1));var _0x34f6=function(_0x501099,_0x223250){_0x501099=_0x501099-0x0;var _0x555ebf=_0x4f63[_0x501099];return _0x555ebf;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x34f6('0x0'));var moment=require(_0x34f6('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34f6('0x2'));var rimraf=require(_0x34f6('0x3'));var config=require(_0x34f6('0x4'));var attributes=require(_0x34f6('0x5'));module['exports']=function(_0x1e5a18,_0x2540dd){return _0x1e5a18[_0x34f6('0x6')](_0x34f6('0x7'),attributes,{'tableName':'report_jscripty_answers','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 23a6cff..f74c4a8 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 _0xf2eb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird'];(function(_0x35574a,_0x1e8f95){var _0x5f0ce2=function(_0x51b5a2){while(--_0x51b5a2){_0x35574a['push'](_0x35574a['shift']());}};_0x5f0ce2(++_0x1e8f95);}(_0xf2eb,0x19f));var _0xbf2e=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xf2eb[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0xbf2e('0x0'));var util=require(_0xbf2e('0x1'));var moment=require('moment');var BPromise=require(_0xbf2e('0x2'));var rs=require(_0xbf2e('0x3'));var fs=require('fs');var Redis=require(_0xbf2e('0x4'));var db=require(_0xbf2e('0x5'))['db'];var utils=require(_0xbf2e('0x6'));var logger=require(_0xbf2e('0x7'))(_0xbf2e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbf2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x347a6e,_0x58ce85,_0x4fd4a3){return new BPromise(function(_0x5bd315,_0x506502){return client['request'](_0x347a6e,_0x4fd4a3)[_0xbf2e('0xa')](function(_0x319e67){logger[_0xbf2e('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,'request\x20sent');logger['debug'](_0xbf2e('0xc'),_0x58ce85,'request\x20sent',JSON['stringify'](_0x319e67));if(_0x319e67['error']){if(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0xe')]===0x1f4){logger[_0xbf2e('0xd')](_0xbf2e('0xf'),_0x58ce85,_0x319e67[_0xbf2e('0xd')]['message']);return _0x506502(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);}logger[_0xbf2e('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);return _0x5bd315(_0x319e67[_0xbf2e('0xd')][_0xbf2e('0x10')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x58ce85,_0xbf2e('0x11'));_0x5bd315(_0x319e67[_0xbf2e('0x12')][_0xbf2e('0x10')]);}})['catch'](function(_0x455766){logger[_0xbf2e('0xd')](_0xbf2e('0xf'),_0x58ce85,_0x455766);_0x506502(_0x455766);});});} \ No newline at end of file +var _0xdd03=['error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xdd4995,_0x5b2f98){var _0x55cf67=function(_0x57aedd){while(--_0x57aedd){_0xdd4995['push'](_0xdd4995['shift']());}};_0x55cf67(++_0x5b2f98);}(_0xdd03,0xcc));var _0x3dd0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdd03[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x3dd0('0x0'));var moment=require('moment');var BPromise=require(_0x3dd0('0x1'));var rs=require(_0x3dd0('0x2'));var fs=require('fs');var Redis=require(_0x3dd0('0x3'));var db=require(_0x3dd0('0x4'))['db'];var utils=require(_0x3dd0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3dd0('0x6'));var jayson=require(_0x3dd0('0x7'));var client=jayson[_0x3dd0('0x8')][_0x3dd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e459,_0x5d8a86,_0x27c4e6){return new BPromise(function(_0x2df639,_0x29ab22){return client['request'](_0x11e459,_0x27c4e6)['then'](function(_0x30e27e){logger[_0x3dd0('0xa')](_0x3dd0('0xb'),_0x5d8a86,_0x3dd0('0xc'));logger[_0x3dd0('0xd')](_0x3dd0('0xe'),_0x5d8a86,_0x3dd0('0xc'),JSON[_0x3dd0('0xf')](_0x30e27e));if(_0x30e27e[_0x3dd0('0x10')]){if(_0x30e27e[_0x3dd0('0x10')][_0x3dd0('0x11')]===0x1f4){logger[_0x3dd0('0x10')](_0x3dd0('0xb'),_0x5d8a86,_0x30e27e[_0x3dd0('0x10')][_0x3dd0('0x12')]);return _0x29ab22(_0x30e27e[_0x3dd0('0x10')][_0x3dd0('0x12')]);}logger[_0x3dd0('0x10')](_0x3dd0('0xb'),_0x5d8a86,_0x30e27e[_0x3dd0('0x10')][_0x3dd0('0x12')]);return _0x2df639(_0x30e27e[_0x3dd0('0x10')][_0x3dd0('0x12')]);}else{logger[_0x3dd0('0xa')](_0x3dd0('0xb'),_0x5d8a86,_0x3dd0('0xc'));_0x2df639(_0x30e27e['result']['message']);}})[_0x3dd0('0x13')](function(_0x49d5da){logger[_0x3dd0('0x10')](_0x3dd0('0xb'),_0x5d8a86,_0x49d5da);_0x29ab22(_0x49d5da);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 7f806d5..2ff4c5b 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 _0xa2cc=['show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x3b6d6e,_0x3beafa){var _0x32784d=function(_0x28cd38){while(--_0x28cd38){_0x3b6d6e['push'](_0x3b6d6e['shift']());}};_0x32784d(++_0x3beafa);}(_0xa2cc,0xf9));var _0xca2c=function(_0x2f60a6,_0x433a6e){_0x2f60a6=_0x2f60a6-0x0;var _0x98285a=_0xa2cc[_0x2f60a6];return _0x98285a;};'use strict';var multer=require(_0xca2c('0x0'));var util=require('util');var path=require(_0xca2c('0x1'));var timeout=require(_0xca2c('0x2'));var express=require('express');var router=express[_0xca2c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xca2c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xca2c('0x5'));var controller=require(_0xca2c('0x6'));router[_0xca2c('0x7')]('/',auth[_0xca2c('0x8')](),controller[_0xca2c('0x9')]);router[_0xca2c('0x7')](_0xca2c('0xa'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xb')]);router[_0xca2c('0x7')](_0xca2c('0xc'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xd')]);router[_0xca2c('0x7')](_0xca2c('0xe'),auth[_0xca2c('0x8')](),controller[_0xca2c('0xf')]);router[_0xca2c('0x7')](_0xca2c('0x10'),auth[_0xca2c('0x8')](),timeout(_0xca2c('0x11')),controller[_0xca2c('0x12')]);router[_0xca2c('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca2c('0x13')](_0xca2c('0x14'),auth[_0xca2c('0x8')](),controller[_0xca2c('0x15')]);router[_0xca2c('0x16')](_0xca2c('0xa'),auth[_0xca2c('0x8')](),controller[_0xca2c('0x17')]);router[_0xca2c('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xca2c('0x19')]=router; \ No newline at end of file +var _0x89b9=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','index','isAuthenticated','show','/:id/sessions','getSessions','get','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','/:id','destroy','util','connect-timeout'];(function(_0x37c91b,_0x5fcbb6){var _0x1ef5e6=function(_0x52ed42){while(--_0x52ed42){_0x37c91b['push'](_0x37c91b['shift']());}};_0x1ef5e6(++_0x5fcbb6);}(_0x89b9,0xd6));var _0x989b=function(_0x3a226e,_0x425ec2){_0x3a226e=_0x3a226e-0x0;var _0x1ebc12=_0x89b9[_0x3a226e];return _0x1ebc12;};'use strict';var multer=require('multer');var util=require(_0x989b('0x0'));var path=require('path');var timeout=require(_0x989b('0x1'));var express=require(_0x989b('0x2'));var router=express[_0x989b('0x3')]();var fs_extra=require(_0x989b('0x4'));var auth=require(_0x989b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x989b('0x6'));var controller=require(_0x989b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x989b('0x8')]);router['get']('/:id',auth[_0x989b('0x9')](),controller[_0x989b('0xa')]);router['get'](_0x989b('0xb'),auth[_0x989b('0x9')](),controller[_0x989b('0xc')]);router[_0x989b('0xd')]('/:id/answers',auth[_0x989b('0x9')](),controller[_0x989b('0xe')]);router[_0x989b('0xd')](_0x989b('0xf'),auth[_0x989b('0x9')](),timeout(_0x989b('0x10')),controller['getSummary']);router[_0x989b('0x11')]('/',auth[_0x989b('0x9')](),controller['create']);router[_0x989b('0x11')](_0x989b('0x12'),auth[_0x989b('0x9')](),controller[_0x989b('0x13')]);router[_0x989b('0x14')]('/:id',auth[_0x989b('0x9')](),controller[_0x989b('0x15')]);router['delete'](_0x989b('0x16'),auth['isAuthenticated'](),controller[_0x989b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index bbf98c9..6d99c09 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 _0x6ced=['name','description','BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x56d3a2,_0x5f191b){var _0x2c14d0=function(_0xb776e2){while(--_0xb776e2){_0x56d3a2['push'](_0x56d3a2['shift']());}};_0x2c14d0(++_0x5f191b);}(_0x6ced,0xcf));var _0xd6ce=function(_0x544a3d,_0x4bc199){_0x544a3d=_0x544a3d-0x0;var _0x1d1437=_0x6ced[_0x544a3d];return _0x1d1437;};'use strict';var Sequelize=require(_0xd6ce('0x0'));var _=require(_0xd6ce('0x1'));var util=require('util');module[_0xd6ce('0x2')]={'name':{'type':Sequelize[_0xd6ce('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd6ce('0x4')](_0xd6ce('0x5')),'set':function(_0x339bf0){if(_[_0xd6ce('0x6')](_0x339bf0)){this[_0xd6ce('0x7')](_0xd6ce('0x8'),JSON[_0xd6ce('0x9')](_0x339bf0));}else if(_[_0xd6ce('0xa')](_0x339bf0)){this['setDataValue'](_0xd6ce('0x8'),_0x339bf0);}else{this['setDataValue'](_0xd6ce('0x8'),util[_0xd6ce('0xb')](_0xd6ce('0xc'),this[_0xd6ce('0xd')](_0xd6ce('0xe'))||'',this['getDataValue'](_0xd6ce('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd6ce('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf0b=['isObjectLike','stringify','isString','setDataValue','formData','format','getDataValue','name','BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xcf0b,0x108));var _0xbcf0=function(_0x4c0abe,_0x4647a2){_0x4c0abe=_0x4c0abe-0x0;var _0x5dbe93=_0xcf0b[_0x4c0abe];return _0x5dbe93;};'use strict';var Sequelize=require(_0xbcf0('0x0'));var _=require(_0xbcf0('0x1'));var util=require('util');module[_0xbcf0('0x2')]={'name':{'type':Sequelize[_0xbcf0('0x3')],'unique':'name'},'description':{'type':Sequelize[_0xbcf0('0x3')]},'formData':{'type':Sequelize[_0xbcf0('0x4')](_0xbcf0('0x5')),'set':function(_0x5cabe9){if(_[_0xbcf0('0x6')](_0x5cabe9)){this['setDataValue']('formData',JSON[_0xbcf0('0x7')](_0x5cabe9));}else if(_[_0xbcf0('0x8')](_0x5cabe9)){this[_0xbcf0('0x9')](_0xbcf0('0xa'),_0x5cabe9);}else{this[_0xbcf0('0x9')](_0xbcf0('0xa'),util[_0xbcf0('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xbcf0('0xc')](_0xbcf0('0xd'))||'',this[_0xbcf0('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbcf0('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 045e0d3..a70fdf6 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 _0x1956=['end','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','role','user','UserProfileSection','getSessions','findOne','nolimit','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','UserProfileResource'];(function(_0x5a9f73,_0x19a26a){var _0x4e50b3=function(_0xa11396){while(--_0xa11396){_0x5a9f73['push'](_0x5a9f73['shift']());}};_0x4e50b3(++_0x19a26a);}(_0x1956,0x15c));var _0x6195=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x1956[_0xac151d];return _0x111dba;};'use strict';var emlformat=require(_0x6195('0x0'));var rimraf=require(_0x6195('0x1'));var zipdir=require(_0x6195('0x2'));var jsonpatch=require(_0x6195('0x3'));var rp=require(_0x6195('0x4'));var moment=require(_0x6195('0x5'));var BPromise=require(_0x6195('0x6'));var Mustache=require('mustache');var util=require(_0x6195('0x7'));var path=require(_0x6195('0x8'));var sox=require(_0x6195('0x9'));var csv=require(_0x6195('0xa'));var ejs=require(_0x6195('0xb'));var fs=require('fs');var fs_extra=require(_0x6195('0xc'));var _=require(_0x6195('0xd'));var squel=require(_0x6195('0xe'));var crypto=require(_0x6195('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6195('0x10'));var toCsv=require(_0x6195('0xa'));var querystring=require(_0x6195('0x11'));var Papa=require(_0x6195('0x12'));var Redis=require(_0x6195('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6195('0x14'));var as=require(_0x6195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6195('0x16'))(_0x6195('0x17'));var utils=require(_0x6195('0x18'));var config=require(_0x6195('0x19'));var licenseUtil=require(_0x6195('0x1a'));var db=require(_0x6195('0x1b'))['db'];function respondWithStatusCode(_0x1282f5,_0x96b635){_0x96b635=_0x96b635||0xcc;return function(_0x51b975){if(_0x51b975){return _0x1282f5[_0x6195('0x1c')](_0x96b635);}return _0x1282f5[_0x6195('0x1d')](_0x96b635)['end']();};}function respondWithResult(_0x29c5e0,_0x431b3d){_0x431b3d=_0x431b3d||0xc8;return function(_0x5320f7){if(_0x5320f7){return _0x29c5e0[_0x6195('0x1d')](_0x431b3d)[_0x6195('0x1e')](_0x5320f7);}};}function respondWithFilteredResult(_0x1af54a,_0x397370){return function(_0x6653b7){if(_0x6653b7){var _0x1a555f=typeof _0x397370[_0x6195('0x1f')]===_0x6195('0x20')&&typeof _0x397370['limit']==='undefined';var _0x21bf76=_0x6653b7[_0x6195('0x21')];var _0x6174a3=_0x1a555f?0x0:_0x397370[_0x6195('0x1f')];var _0x3b42a0=_0x1a555f?_0x6653b7['count']:_0x397370[_0x6195('0x1f')]+_0x397370['limit'];var _0x40134d;if(_0x3b42a0>=_0x21bf76){_0x3b42a0=_0x21bf76;_0x40134d=0xc8;}else{_0x40134d=0xce;}_0x1af54a[_0x6195('0x1d')](_0x40134d);return _0x1af54a[_0x6195('0x22')](_0x6195('0x23'),_0x6174a3+'-'+_0x3b42a0+'/'+_0x21bf76)[_0x6195('0x1e')](_0x6653b7);}return null;};}function patchUpdates(_0x4e9673){return function(_0x4cadf3){try{jsonpatch['apply'](_0x4cadf3,_0x4e9673,!![]);}catch(_0x5595e0){return BPromise[_0x6195('0x24')](_0x5595e0);}return _0x4cadf3[_0x6195('0x25')]();};}function saveUpdates(_0xc1e5d9,_0x4f2d43){return function(_0x5bed95){if(_0x5bed95){return _0x5bed95[_0x6195('0x26')](_0xc1e5d9)['then'](function(_0x4181f3){return _0x4181f3;});}return null;};}function removeEntity(_0x11cc46,_0x184080){return function(_0x5dbe2c){if(_0x5dbe2c){return _0x5dbe2c[_0x6195('0x27')]()[_0x6195('0x28')](function(){var _0xd03b87=_0x5dbe2c['get']({'plain':!![]});var _0x5b83dc='Projects';return db[_0x6195('0x29')][_0x6195('0x27')]({'where':{'type':_0x5b83dc,'resourceId':_0xd03b87['id']}})[_0x6195('0x28')](function(){return _0x5dbe2c;});})[_0x6195('0x28')](function(){_0x11cc46[_0x6195('0x1d')](0xcc)[_0x6195('0x2a')]();});}};}function handleEntityNotFound(_0x251e21,_0x25a227){return function(_0x44c5ef){if(!_0x44c5ef){_0x251e21[_0x6195('0x1c')](0x194);}return _0x44c5ef;};}function handleError(_0x566e1e,_0x20c3e2){_0x20c3e2=_0x20c3e2||0x1f4;return function(_0x5af2af){logger[_0x6195('0x2b')](_0x5af2af[_0x6195('0x2c')]);if(_0x5af2af[_0x6195('0x2d')]){delete _0x5af2af[_0x6195('0x2d')];}_0x566e1e[_0x6195('0x1d')](_0x20c3e2)[_0x6195('0x2e')](_0x5af2af);};}exports[_0x6195('0x2f')]=function(_0x208c93,_0x217ac1){var _0x3839fd={},_0x21d93c={},_0x52d3ff={'count':0x0,'rows':[]};var _0x611d5=_[_0x6195('0x30')](db[_0x6195('0x31')][_0x6195('0x32')],function(_0x559e31){return{'name':_0x559e31[_0x6195('0x33')],'type':_0x559e31['type'][_0x6195('0x34')]};});_0x21d93c[_0x6195('0x35')]=_['map'](_0x611d5,_0x6195('0x2d'));_0x21d93c[_0x6195('0x36')]=_['keys'](_0x208c93[_0x6195('0x36')]);_0x21d93c[_0x6195('0x37')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],_0x21d93c[_0x6195('0x36')]);_0x3839fd[_0x6195('0x39')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x208c93['query'][_0x6195('0x3a')]));_0x3839fd[_0x6195('0x39')]=_0x3839fd[_0x6195('0x39')]['length']?_0x3839fd[_0x6195('0x39')]:_0x21d93c[_0x6195('0x35')];if(!_0x208c93[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x3839fd[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x208c93[_0x6195('0x36')][_0x6195('0x3c')]);_0x3839fd['offset']=qs['offset'](_0x208c93[_0x6195('0x36')][_0x6195('0x1f')]);}_0x3839fd['order']=qs[_0x6195('0x3d')](_0x208c93[_0x6195('0x36')]['sort']);_0x3839fd[_0x6195('0x3e')]=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x208c93[_0x6195('0x36')],_0x21d93c[_0x6195('0x37')]),_0x611d5);if(_0x208c93[_0x6195('0x36')][_0x6195('0x40')]){_0x3839fd[_0x6195('0x3e')]=_['merge'](_0x3839fd[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x611d5,function(_0x3f9e43){if(_0x3f9e43['type']!==_0x6195('0x41')){var _0x2a871f={};_0x2a871f[_0x3f9e43[_0x6195('0x2d')]]={'$like':'%'+_0x208c93[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x2a871f;}})});}_0x3839fd=_['merge']({},_0x3839fd,_0x208c93[_0x6195('0x42')]);var _0xbcbc4b={'where':_0x3839fd[_0x6195('0x3e')]};return db[_0x6195('0x31')][_0x6195('0x21')](_0xbcbc4b)[_0x6195('0x28')](function(_0x353a65){_0x52d3ff[_0x6195('0x21')]=_0x353a65;if(_0x208c93[_0x6195('0x36')][_0x6195('0x43')]){_0x3839fd[_0x6195('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x6195('0x45')](_0x3839fd);})[_0x6195('0x28')](function(_0x45a188){_0x52d3ff[_0x6195('0x46')]=_0x45a188;return _0x52d3ff;})[_0x6195('0x28')](respondWithFilteredResult(_0x217ac1,_0x3839fd))['catch'](handleError(_0x217ac1,null));};exports[_0x6195('0x47')]=function(_0x1bc105,_0x45e392){var _0x11b900={'raw':![],'where':{'id':_0x1bc105[_0x6195('0x48')]['id']}},_0x35bd25={};_0x35bd25[_0x6195('0x35')]=_[_0x6195('0x49')](db['JscriptyProject'][_0x6195('0x32')]);_0x35bd25[_0x6195('0x36')]=_[_0x6195('0x49')](_0x1bc105[_0x6195('0x36')]);_0x35bd25[_0x6195('0x37')]=_[_0x6195('0x38')](_0x35bd25['model'],_0x35bd25[_0x6195('0x36')]);_0x11b900[_0x6195('0x39')]=_[_0x6195('0x38')](_0x35bd25[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x1bc105[_0x6195('0x36')][_0x6195('0x3a')]));_0x11b900['attributes']=_0x11b900[_0x6195('0x39')][_0x6195('0x4a')]?_0x11b900[_0x6195('0x39')]:_0x35bd25[_0x6195('0x35')];if(_0x1bc105['query']['includeAll']){_0x11b900[_0x6195('0x44')]=[{'all':!![]}];}_0x11b900=_['merge']({},_0x11b900,_0x1bc105[_0x6195('0x42')]);return db[_0x6195('0x31')][_0x6195('0x4b')](_0x11b900)[_0x6195('0x28')](handleEntityNotFound(_0x45e392,null))['then'](respondWithResult(_0x45e392,null))[_0x6195('0x4c')](handleError(_0x45e392,null));};exports[_0x6195('0x4d')]=function(_0x3feac1,_0x1ea3e7){return db['JscriptyProject'][_0x6195('0x4d')](_0x3feac1[_0x6195('0x4e')],{})['then'](function(_0x4aec1e){var _0x3da422=_0x3feac1['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x3da422)throw new Error(_0x6195('0x50'));if(_0x3da422['role']==='user'){var _0x589bad=_0x4aec1e[_0x6195('0x4f')]({'plain':!![]});var _0x2a686a=_0x6195('0x51');return db['UserProfileSection'][_0x6195('0x4b')]({'where':{'name':_0x2a686a,'userProfileId':_0x3da422[_0x6195('0x52')]},'raw':!![]})['then'](function(_0x8cf212){if(_0x8cf212&&_0x8cf212[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')][_0x6195('0x4d')]({'name':_0x589bad[_0x6195('0x2d')],'resourceId':_0x589bad['id'],'type':_0x8cf212[_0x6195('0x2d')],'sectionId':_0x8cf212['id']},{})[_0x6195('0x28')](function(){return _0x4aec1e;});}else{return _0x4aec1e;}})[_0x6195('0x4c')](function(_0x5842c0){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x5842c0);throw _0x5842c0;});}return _0x4aec1e;})['then'](respondWithResult(_0x1ea3e7,0xc9))[_0x6195('0x4c')](handleError(_0x1ea3e7,null));};exports[_0x6195('0x55')]=function(_0x5c23ab,_0x20defd){var _0x460983={'where':{'id':_0x5c23ab[_0x6195('0x48')]['id']}},_0x4f536b={};_0x4f536b[_0x6195('0x35')]=_['keys'](db[_0x6195('0x31')][_0x6195('0x32')]);_0x460983[_0x6195('0x39')]=_[_0x6195('0x38')](_0x4f536b[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x5c23ab[_0x6195('0x36')][_0x6195('0x3a')]));_0x460983[_0x6195('0x39')]=_0x460983[_0x6195('0x39')]['length']?_0x460983['attributes']:_0x4f536b[_0x6195('0x35')];if(_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]){_0x460983[_0x6195('0x44')]=[{'all':!![]}];}_0x460983=_[_0x6195('0x56')]({},_0x460983,_0x5c23ab[_0x6195('0x42')]);return db['JscriptyProject'][_0x6195('0x4b')](_0x460983)[_0x6195('0x28')](handleEntityNotFound(_0x20defd,null))[_0x6195('0x28')](function(_0x21b444){if(_0x21b444){var _0x532aaa=_0x21b444[_0x6195('0x4f')]({'plain':!![]});_0x532aaa=qs[_0x6195('0x57')](_0x532aaa,['id',_0x6195('0x58'),_0x6195('0x59')]);_0x5c23ab[_0x6195('0x4e')]=_['omit'](_0x5c23ab['body'],['id',_0x6195('0x58'),_0x6195('0x59')]);return db[_0x6195('0x31')][_0x6195('0x4d')](_[_0x6195('0x56')](_0x532aaa,_0x5c23ab[_0x6195('0x4e')]),{'include':_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]?[{'all':!![]}]:undefined})[_0x6195('0x28')](function(_0x1f7988){var _0x440696=_0x5c23ab['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x440696)throw new Error(_0x6195('0x50'));if(_0x440696[_0x6195('0x5a')]===_0x6195('0x5b')){var _0x1ef3e4=_0x1f7988[_0x6195('0x4f')]({'plain':!![]});var _0x17aece=_0x6195('0x51');return db[_0x6195('0x5c')][_0x6195('0x4b')]({'where':{'name':_0x17aece,'userProfileId':_0x440696[_0x6195('0x52')]},'raw':!![]})[_0x6195('0x28')](function(_0x187c98){if(_0x187c98&&_0x187c98[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')]['create']({'name':_0x1ef3e4[_0x6195('0x2d')],'resourceId':_0x1ef3e4['id'],'type':_0x187c98[_0x6195('0x2d')],'sectionId':_0x187c98['id']},{})[_0x6195('0x28')](function(){return _0x1f7988;});}else{return _0x1f7988;}})[_0x6195('0x4c')](function(_0x10f978){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x10f978);throw _0x10f978;});}return _0x1f7988;});}})['then'](respondWithResult(_0x20defd,0xc9))[_0x6195('0x4c')](handleError(_0x20defd,null));};exports[_0x6195('0x26')]=function(_0x3e6c67,_0x3494ee){if(_0x3e6c67[_0x6195('0x4e')]['id']){delete _0x3e6c67[_0x6195('0x4e')]['id'];}return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x3e6c67['params']['id']}})['then'](handleEntityNotFound(_0x3494ee,null))[_0x6195('0x28')](saveUpdates(_0x3e6c67[_0x6195('0x4e')],null))[_0x6195('0x28')](respondWithResult(_0x3494ee,null))[_0x6195('0x4c')](handleError(_0x3494ee,null));};exports[_0x6195('0x27')]=function(_0x36f5a4,_0x50d603){return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x36f5a4[_0x6195('0x48')]['id']}})['then'](handleEntityNotFound(_0x50d603,null))['then'](removeEntity(_0x50d603,null))[_0x6195('0x4c')](handleError(_0x50d603,null));};exports[_0x6195('0x5d')]=function(_0x691505,_0x3ecfba,_0x1bc14a){var _0x2d7dfa={'raw':!![],'where':{}};var _0x2e2f06={};var _0x393964={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x691505['params']['id']}})[_0x6195('0x28')](handleEntityNotFound(_0x3ecfba,null))[_0x6195('0x28')](function(_0x31cb77){if(_0x31cb77){_0x2e2f06['model']=_[_0x6195('0x49')](db['JscriptySessionReport']['rawAttributes']);_0x2e2f06[_0x6195('0x36')]=_[_0x6195('0x49')](_0x691505[_0x6195('0x36')]);_0x2e2f06[_0x6195('0x37')]=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],_0x2e2f06[_0x6195('0x36')]);_0x2d7dfa['attributes']=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],qs['fields'](_0x691505[_0x6195('0x36')][_0x6195('0x3a')]));_0x2d7dfa[_0x6195('0x39')]=_0x2d7dfa[_0x6195('0x39')]['length']?_0x2d7dfa[_0x6195('0x39')]:_0x2e2f06[_0x6195('0x35')];if(!_0x691505[_0x6195('0x36')]['hasOwnProperty'](_0x6195('0x5f'))){_0x2d7dfa[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x691505[_0x6195('0x36')][_0x6195('0x3c')]);_0x2d7dfa[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x691505['query'][_0x6195('0x1f')]);}_0x2d7dfa[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x691505['query'][_0x6195('0x3d')]);_0x2d7dfa[_0x6195('0x3e')]=qs['filters'](_['pick'](_0x691505[_0x6195('0x36')],_0x2e2f06[_0x6195('0x37')]));_0x2d7dfa[_0x6195('0x3e')][_0x6195('0x61')]=_0x31cb77['id'];if(_0x691505[_0x6195('0x36')][_0x6195('0x40')]){_0x2d7dfa['where']=_['merge'](_0x2d7dfa[_0x6195('0x3e')],{'$or':_['map'](_0x2d7dfa[_0x6195('0x39')],function(_0x3533de){var _0x23e8ee={};_0x23e8ee[_0x3533de]={'$like':'%'+_0x691505[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x23e8ee;})});}_0x2d7dfa=_[_0x6195('0x56')]({},_0x2d7dfa,_0x691505[_0x6195('0x42')]);return db[_0x6195('0x62')][_0x6195('0x21')]({'where':_0x2d7dfa[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x16576c){_0x393964[_0x6195('0x21')]=_0x16576c;if(_0x691505[_0x6195('0x36')][_0x6195('0x43')]){_0x2d7dfa['include']=[{'all':!![]}];}return db[_0x6195('0x62')][_0x6195('0x45')](_0x2d7dfa);})[_0x6195('0x28')](function(_0x195ba1){_0x393964[_0x6195('0x46')]=_0x195ba1;return _0x393964;});}})[_0x6195('0x28')](respondWithFilteredResult(_0x3ecfba,_0x2d7dfa))[_0x6195('0x4c')](handleError(_0x3ecfba,null));};exports[_0x6195('0x63')]=function(_0x58a03a,_0xe517be,_0xbc1944){var _0x5a809a={'raw':!![],'where':{}};var _0xeb2f6a={};var _0x46316a={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x58a03a[_0x6195('0x48')]['id']}})[_0x6195('0x28')](handleEntityNotFound(_0xe517be,null))['then'](function(_0x40c727){if(_0x40c727){_0xeb2f6a[_0x6195('0x35')]=_[_0x6195('0x49')](db[_0x6195('0x64')][_0x6195('0x32')]);_0xeb2f6a[_0x6195('0x36')]=_[_0x6195('0x49')](_0x58a03a[_0x6195('0x36')]);_0xeb2f6a['filters']=_['intersection'](_0xeb2f6a[_0x6195('0x35')],_0xeb2f6a[_0x6195('0x36')]);_0x5a809a['attributes']=_[_0x6195('0x38')](_0xeb2f6a['model'],qs[_0x6195('0x3a')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3a')]));_0x5a809a[_0x6195('0x39')]=_0x5a809a[_0x6195('0x39')]['length']?_0x5a809a[_0x6195('0x39')]:_0xeb2f6a[_0x6195('0x35')];if(!_0x58a03a[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x5a809a[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3c')]);_0x5a809a[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x58a03a[_0x6195('0x36')]['offset']);}_0x5a809a[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3d')]);_0x5a809a['where']=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x58a03a[_0x6195('0x36')],_0xeb2f6a['filters']));_0x5a809a[_0x6195('0x3e')][_0x6195('0x61')]=_0x40c727['id'];if(_0x58a03a[_0x6195('0x36')][_0x6195('0x40')]){_0x5a809a[_0x6195('0x3e')]=_['merge'](_0x5a809a[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x5a809a[_0x6195('0x39')],function(_0x1e978a){var _0x4074c3={};_0x4074c3[_0x1e978a]={'$like':'%'+_0x58a03a['query'][_0x6195('0x40')]+'%'};return _0x4074c3;})});}_0x5a809a=_[_0x6195('0x56')]({},_0x5a809a,_0x58a03a[_0x6195('0x42')]);return db[_0x6195('0x64')]['count']({'where':_0x5a809a[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x38b8bd){_0x46316a[_0x6195('0x21')]=_0x38b8bd;if(_0x58a03a[_0x6195('0x36')][_0x6195('0x43')]){_0x5a809a[_0x6195('0x44')]=[{'all':!![]}];}return db[_0x6195('0x64')]['findAll'](_0x5a809a);})[_0x6195('0x28')](function(_0x436dd3){_0x46316a[_0x6195('0x46')]=_0x436dd3;return _0x46316a;});}})[_0x6195('0x28')](respondWithFilteredResult(_0xe517be,_0x5a809a))['catch'](handleError(_0xe517be,null));};function char(_0x4edab3){return _0x6195('0x65')===typeof _0x4edab3?String[_0x6195('0x66')][_0x6195('0x67')](null,arguments):_0x4edab3;}function needsEncapsulation(_0x4c5cda){return!!_0x4c5cda&&(_0x4c5cda[_0x6195('0x68')]()['indexOf'](char(0xd))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0xa))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x2c))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x22))>=0x0);}function encapsulate(_0x4dd628){var _0x3f0c69=char(0x22),_0x582fe4='\x5c'+char(0x22),_0x91e220=_0x4dd628[_0x6195('0x68')]()[_0x6195('0x6a')](new RegExp(_0x3f0c69,'g'),_0x582fe4);return _0x3f0c69+_0x91e220+_0x3f0c69;}exports[_0x6195('0x6b')]=function(_0x20af35,_0x343275,_0x41a3d4){var _0x45363b,_0x19d6f5;var _0x600032={'where':{'ProjectId':_0x20af35[_0x6195('0x48')]['id']}};if(_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]){_0x600032[_0x6195('0x3e')]['starttime']=JSON[_0x6195('0x6d')](_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]);}return db[_0x6195('0x62')][_0x6195('0x45')](_0x600032)[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))['then'](function(_0x282f48){if(_0x282f48){_0x45363b=_0x282f48;return db[_0x6195('0x6e')][_0x6195('0x45')]({'where':{'SessionId':{'$in':_[_0x6195('0x30')](_0x45363b,'id')},'ProjectId':_0x20af35['params']['id']},'order':_0x6195('0x6f')});}})[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))[_0x6195('0x28')](function(_0x34b4e8){if(_0x34b4e8){_0x19d6f5=_0x34b4e8;var _0x4f27da={};for(var _0x38ba43=0x0,_0x12c3ee=_0x19d6f5['length'];_0x38ba43<_0x12c3ee;_0x38ba43++){if(!_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x38ba43][_0x6195('0x70')])){_0x4f27da[_0x19d6f5[_0x38ba43][_0x6195('0x70')]]=needsEncapsulation(_0x19d6f5[_0x38ba43][_0x6195('0x71')])?encapsulate(_0x19d6f5[_0x38ba43][_0x6195('0x71')]):_0x19d6f5[_0x38ba43]['question'];}}var _0x825885=[],_0x56d2b7={};for(var _0x39f1c1=0x0,_0x5540f3=_0x45363b[_0x6195('0x4a')];_0x39f1c1<_0x5540f3;_0x39f1c1++){_0x56d2b7={'ProjectId':_0x20af35['params']['id'],'SessionId':_0x45363b[_0x39f1c1]['id'],'StartTime':moment(_0x45363b[_0x39f1c1][_0x6195('0x72')])[_0x6195('0x73')](_0x6195('0x74'))};for(var _0x3200f7=0x0,_0x401bdb=_0x19d6f5[_0x6195('0x4a')];_0x3200f7<_0x401bdb;_0x3200f7++){if(_0x19d6f5[_0x3200f7][_0x6195('0x75')]==_0x45363b[_0x39f1c1]['id']&&_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x3200f7][_0x6195('0x70')])){_0x56d2b7[_0x4f27da[_0x19d6f5[_0x3200f7][_0x6195('0x70')]]]=_0x19d6f5[_0x3200f7][_0x6195('0x76')];}}for(var _0x50f16b in _0x4f27da){if(!_0x56d2b7[_0x6195('0x3b')](_0x4f27da[_0x50f16b])){_0x56d2b7[_0x4f27da[_0x50f16b]]=null;}}_0x825885[_0x6195('0x77')](_0x56d2b7);}return _0x825885;}})[_0x6195('0x28')](function(_0x457125){if(!_[_0x6195('0x78')](_0x457125)){var _0x332219=toCsv(_0x457125);var _0x2cbacd=Date['now']();fs[_0x6195('0x79')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd),_0x332219);_0x343275[_0x6195('0x7b')](_0x6195('0x7c'),_0x6195('0x7d')+util['format'](_0x6195('0x7e'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));_0x343275[_0x6195('0x7b')](_0x6195('0x7f'),_0x6195('0x80'));return _0x343275[_0x6195('0x81')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));}else{return _0x343275[_0x6195('0x1c')](0xcc);}})[_0x6195('0x4c')](handleError(_0x343275,null));}; \ No newline at end of file +var _0x9153=['status','json','offset','undefined','count','set','Content-Range','reject','update','then','get','Projects','end','error','stack','name','send','map','JscriptyProject','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getSessions','findOne','ProjectId','JscriptySessionReport','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','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'];(function(_0x4b4051,_0x4a46b3){var _0x4b6563=function(_0x47d3d3){while(--_0x47d3d3){_0x4b4051['push'](_0x4b4051['shift']());}};_0x4b6563(++_0x4a46b3);}(_0x9153,0xd8));var _0x3915=function(_0x48dc09,_0x1aee55){_0x48dc09=_0x48dc09-0x0;var _0x267bf8=_0x9153[_0x48dc09];return _0x267bf8;};'use strict';var emlformat=require(_0x3915('0x0'));var rimraf=require(_0x3915('0x1'));var zipdir=require(_0x3915('0x2'));var jsonpatch=require(_0x3915('0x3'));var rp=require(_0x3915('0x4'));var moment=require(_0x3915('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3915('0x6'));var util=require(_0x3915('0x7'));var path=require(_0x3915('0x8'));var sox=require(_0x3915('0x9'));var csv=require('to-csv');var ejs=require(_0x3915('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3915('0xb'));var crypto=require(_0x3915('0xc'));var jsforce=require(_0x3915('0xd'));var deskjs=require(_0x3915('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3915('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3915('0x10'));var qs=require(_0x3915('0x11'));var as=require(_0x3915('0x12'));var hardwareService=require(_0x3915('0x13'));var logger=require(_0x3915('0x14'))(_0x3915('0x15'));var utils=require(_0x3915('0x16'));var config=require(_0x3915('0x17'));var licenseUtil=require(_0x3915('0x18'));var db=require(_0x3915('0x19'))['db'];function respondWithStatusCode(_0x4d3877,_0x3ad7ab){_0x3ad7ab=_0x3ad7ab||0xcc;return function(_0x22d231){if(_0x22d231){return _0x4d3877['sendStatus'](_0x3ad7ab);}return _0x4d3877[_0x3915('0x1a')](_0x3ad7ab)['end']();};}function respondWithResult(_0x5d8ab4,_0x24f5e9){_0x24f5e9=_0x24f5e9||0xc8;return function(_0x30d85a){if(_0x30d85a){return _0x5d8ab4[_0x3915('0x1a')](_0x24f5e9)[_0x3915('0x1b')](_0x30d85a);}};}function respondWithFilteredResult(_0x4af9a2,_0xca4a4a){return function(_0x3b6224){if(_0x3b6224){var _0x39981a=typeof _0xca4a4a[_0x3915('0x1c')]===_0x3915('0x1d')&&typeof _0xca4a4a['limit']===_0x3915('0x1d');var _0x44266c=_0x3b6224[_0x3915('0x1e')];var _0x1ac327=_0x39981a?0x0:_0xca4a4a[_0x3915('0x1c')];var _0x473eb4=_0x39981a?_0x3b6224['count']:_0xca4a4a[_0x3915('0x1c')]+_0xca4a4a['limit'];var _0x596773;if(_0x473eb4>=_0x44266c){_0x473eb4=_0x44266c;_0x596773=0xc8;}else{_0x596773=0xce;}_0x4af9a2['status'](_0x596773);return _0x4af9a2[_0x3915('0x1f')](_0x3915('0x20'),_0x1ac327+'-'+_0x473eb4+'/'+_0x44266c)[_0x3915('0x1b')](_0x3b6224);}return null;};}function patchUpdates(_0x55e896){return function(_0x2160d3){try{jsonpatch['apply'](_0x2160d3,_0x55e896,!![]);}catch(_0x38428b){return BPromise[_0x3915('0x21')](_0x38428b);}return _0x2160d3['save']();};}function saveUpdates(_0x42ae2d,_0x400601){return function(_0x3d2df2){if(_0x3d2df2){return _0x3d2df2[_0x3915('0x22')](_0x42ae2d)[_0x3915('0x23')](function(_0x54fe09){return _0x54fe09;});}return null;};}function removeEntity(_0x26b001,_0x4b2fe8){return function(_0x8a2184){if(_0x8a2184){return _0x8a2184['destroy']()[_0x3915('0x23')](function(){var _0xd00006=_0x8a2184[_0x3915('0x24')]({'plain':!![]});var _0x404532=_0x3915('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x404532,'resourceId':_0xd00006['id']}})[_0x3915('0x23')](function(){return _0x8a2184;});})[_0x3915('0x23')](function(){_0x26b001[_0x3915('0x1a')](0xcc)[_0x3915('0x26')]();});}};}function handleEntityNotFound(_0x3c68c5,_0x196a1c){return function(_0x58ad39){if(!_0x58ad39){_0x3c68c5['sendStatus'](0x194);}return _0x58ad39;};}function handleError(_0x3f7947,_0x5c2ec6){_0x5c2ec6=_0x5c2ec6||0x1f4;return function(_0x3652b2){logger[_0x3915('0x27')](_0x3652b2[_0x3915('0x28')]);if(_0x3652b2[_0x3915('0x29')]){delete _0x3652b2['name'];}_0x3f7947[_0x3915('0x1a')](_0x5c2ec6)[_0x3915('0x2a')](_0x3652b2);};}exports['index']=function(_0x293a95,_0x30818b){var _0x38acef={},_0x168069={},_0x5b6b9c={'count':0x0,'rows':[]};var _0x47c587=_[_0x3915('0x2b')](db[_0x3915('0x2c')]['rawAttributes'],function(_0x3007e2){return{'name':_0x3007e2['fieldName'],'type':_0x3007e2['type'][_0x3915('0x2d')]};});_0x168069['model']=_[_0x3915('0x2b')](_0x47c587,_0x3915('0x29'));_0x168069[_0x3915('0x2e')]=_[_0x3915('0x2f')](_0x293a95[_0x3915('0x2e')]);_0x168069[_0x3915('0x30')]=_[_0x3915('0x31')](_0x168069['model'],_0x168069[_0x3915('0x2e')]);_0x38acef['attributes']=_[_0x3915('0x31')](_0x168069[_0x3915('0x32')],qs[_0x3915('0x33')](_0x293a95[_0x3915('0x2e')][_0x3915('0x33')]));_0x38acef['attributes']=_0x38acef[_0x3915('0x34')]['length']?_0x38acef[_0x3915('0x34')]:_0x168069[_0x3915('0x32')];if(!_0x293a95[_0x3915('0x2e')][_0x3915('0x35')](_0x3915('0x36'))){_0x38acef['limit']=qs[_0x3915('0x37')](_0x293a95['query'][_0x3915('0x37')]);_0x38acef[_0x3915('0x1c')]=qs[_0x3915('0x1c')](_0x293a95[_0x3915('0x2e')][_0x3915('0x1c')]);}_0x38acef[_0x3915('0x38')]=qs[_0x3915('0x39')](_0x293a95[_0x3915('0x2e')][_0x3915('0x39')]);_0x38acef[_0x3915('0x3a')]=qs[_0x3915('0x30')](_[_0x3915('0x3b')](_0x293a95[_0x3915('0x2e')],_0x168069[_0x3915('0x30')]),_0x47c587);if(_0x293a95[_0x3915('0x2e')][_0x3915('0x3c')]){_0x38acef[_0x3915('0x3a')]=_[_0x3915('0x3d')](_0x38acef['where'],{'$or':_[_0x3915('0x2b')](_0x47c587,function(_0x228860){if(_0x228860[_0x3915('0x3e')]!==_0x3915('0x3f')){var _0x17dd17={};_0x17dd17[_0x228860['name']]={'$like':'%'+_0x293a95[_0x3915('0x2e')][_0x3915('0x3c')]+'%'};return _0x17dd17;}})});}_0x38acef=_[_0x3915('0x3d')]({},_0x38acef,_0x293a95[_0x3915('0x40')]);var _0x5114df={'where':_0x38acef[_0x3915('0x3a')]};return db['JscriptyProject'][_0x3915('0x1e')](_0x5114df)[_0x3915('0x23')](function(_0x5b885f){_0x5b6b9c['count']=_0x5b885f;if(_0x293a95[_0x3915('0x2e')][_0x3915('0x41')]){_0x38acef[_0x3915('0x42')]=[{'all':!![]}];}return db[_0x3915('0x2c')][_0x3915('0x43')](_0x38acef);})[_0x3915('0x23')](function(_0x5cc10c){_0x5b6b9c[_0x3915('0x44')]=_0x5cc10c;return _0x5b6b9c;})[_0x3915('0x23')](respondWithFilteredResult(_0x30818b,_0x38acef))[_0x3915('0x45')](handleError(_0x30818b,null));};exports['show']=function(_0x319de7,_0x1e587d){var _0x294dcd={'raw':![],'where':{'id':_0x319de7[_0x3915('0x46')]['id']}},_0x160ef7={};_0x160ef7[_0x3915('0x32')]=_[_0x3915('0x2f')](db[_0x3915('0x2c')][_0x3915('0x47')]);_0x160ef7[_0x3915('0x2e')]=_[_0x3915('0x2f')](_0x319de7[_0x3915('0x2e')]);_0x160ef7['filters']=_[_0x3915('0x31')](_0x160ef7[_0x3915('0x32')],_0x160ef7[_0x3915('0x2e')]);_0x294dcd['attributes']=_[_0x3915('0x31')](_0x160ef7['model'],qs[_0x3915('0x33')](_0x319de7[_0x3915('0x2e')][_0x3915('0x33')]));_0x294dcd[_0x3915('0x34')]=_0x294dcd['attributes'][_0x3915('0x48')]?_0x294dcd[_0x3915('0x34')]:_0x160ef7[_0x3915('0x32')];if(_0x319de7['query'][_0x3915('0x41')]){_0x294dcd[_0x3915('0x42')]=[{'all':!![]}];}_0x294dcd=_['merge']({},_0x294dcd,_0x319de7['options']);return db[_0x3915('0x2c')][_0x3915('0x49')](_0x294dcd)[_0x3915('0x23')](handleEntityNotFound(_0x1e587d,null))[_0x3915('0x23')](respondWithResult(_0x1e587d,null))[_0x3915('0x45')](handleError(_0x1e587d,null));};exports[_0x3915('0x4a')]=function(_0x399ece,_0x342cec){return db[_0x3915('0x2c')][_0x3915('0x4a')](_0x399ece[_0x3915('0x4b')],{})['then'](function(_0x2c1f87){var _0x3a3525=_0x399ece[_0x3915('0x4c')][_0x3915('0x24')]({'plain':!![]});if(!_0x3a3525)throw new Error(_0x3915('0x4d'));if(_0x3a3525[_0x3915('0x4e')]===_0x3915('0x4c')){var _0x1e3242=_0x2c1f87[_0x3915('0x24')]({'plain':!![]});var _0x1faa6d=_0x3915('0x25');return db[_0x3915('0x4f')][_0x3915('0x49')]({'where':{'name':_0x1faa6d,'userProfileId':_0x3a3525['userProfileId']},'raw':!![]})[_0x3915('0x23')](function(_0xc7005){if(_0xc7005&&_0xc7005[_0x3915('0x50')]===0x0){return db[_0x3915('0x51')]['create']({'name':_0x1e3242[_0x3915('0x29')],'resourceId':_0x1e3242['id'],'type':_0xc7005[_0x3915('0x29')],'sectionId':_0xc7005['id']},{})['then'](function(){return _0x2c1f87;});}else{return _0x2c1f87;}})['catch'](function(_0x4bc282){logger[_0x3915('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bc282);throw _0x4bc282;});}return _0x2c1f87;})[_0x3915('0x23')](respondWithResult(_0x342cec,0xc9))['catch'](handleError(_0x342cec,null));};exports[_0x3915('0x52')]=function(_0x5dcc86,_0x1e6f04){var _0x2e4ecd={'where':{'id':_0x5dcc86[_0x3915('0x46')]['id']}},_0x3785f4={};_0x3785f4[_0x3915('0x32')]=_[_0x3915('0x2f')](db[_0x3915('0x2c')]['rawAttributes']);_0x2e4ecd[_0x3915('0x34')]=_[_0x3915('0x31')](_0x3785f4['model'],qs[_0x3915('0x33')](_0x5dcc86[_0x3915('0x2e')][_0x3915('0x33')]));_0x2e4ecd['attributes']=_0x2e4ecd[_0x3915('0x34')]['length']?_0x2e4ecd[_0x3915('0x34')]:_0x3785f4[_0x3915('0x32')];if(_0x5dcc86[_0x3915('0x2e')][_0x3915('0x41')]){_0x2e4ecd[_0x3915('0x42')]=[{'all':!![]}];}_0x2e4ecd=_['merge']({},_0x2e4ecd,_0x5dcc86[_0x3915('0x40')]);return db[_0x3915('0x2c')][_0x3915('0x49')](_0x2e4ecd)[_0x3915('0x23')](handleEntityNotFound(_0x1e6f04,null))[_0x3915('0x23')](function(_0x5da0bb){if(_0x5da0bb){var _0x1e8c9c=_0x5da0bb[_0x3915('0x24')]({'plain':!![]});_0x1e8c9c=qs[_0x3915('0x53')](_0x1e8c9c,['id',_0x3915('0x54'),_0x3915('0x55')]);_0x5dcc86[_0x3915('0x4b')]=_[_0x3915('0x53')](_0x5dcc86['body'],['id','createdAt',_0x3915('0x55')]);return db['JscriptyProject']['create'](_['merge'](_0x1e8c9c,_0x5dcc86[_0x3915('0x4b')]),{'include':_0x5dcc86[_0x3915('0x2e')][_0x3915('0x41')]?[{'all':!![]}]:undefined})[_0x3915('0x23')](function(_0x3c704d){var _0x2b55cc=_0x5dcc86[_0x3915('0x4c')][_0x3915('0x24')]({'plain':!![]});if(!_0x2b55cc)throw new Error(_0x3915('0x4d'));if(_0x2b55cc[_0x3915('0x4e')]===_0x3915('0x4c')){var _0x45b115=_0x3c704d[_0x3915('0x24')]({'plain':!![]});var _0x178af5=_0x3915('0x25');return db[_0x3915('0x4f')]['find']({'where':{'name':_0x178af5,'userProfileId':_0x2b55cc['userProfileId']},'raw':!![]})[_0x3915('0x23')](function(_0x122b79){if(_0x122b79&&_0x122b79[_0x3915('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x45b115[_0x3915('0x29')],'resourceId':_0x45b115['id'],'type':_0x122b79[_0x3915('0x29')],'sectionId':_0x122b79['id']},{})[_0x3915('0x23')](function(){return _0x3c704d;});}else{return _0x3c704d;}})[_0x3915('0x45')](function(_0x309570){logger[_0x3915('0x27')](_0x3915('0x56'),_0x309570);throw _0x309570;});}return _0x3c704d;});}})[_0x3915('0x23')](respondWithResult(_0x1e6f04,0xc9))[_0x3915('0x45')](handleError(_0x1e6f04,null));};exports[_0x3915('0x22')]=function(_0x25dea4,_0x53c30a){if(_0x25dea4['body']['id']){delete _0x25dea4[_0x3915('0x4b')]['id'];}return db['JscriptyProject'][_0x3915('0x49')]({'where':{'id':_0x25dea4[_0x3915('0x46')]['id']}})[_0x3915('0x23')](handleEntityNotFound(_0x53c30a,null))[_0x3915('0x23')](saveUpdates(_0x25dea4[_0x3915('0x4b')],null))[_0x3915('0x23')](respondWithResult(_0x53c30a,null))[_0x3915('0x45')](handleError(_0x53c30a,null));};exports[_0x3915('0x57')]=function(_0x141539,_0x3847bf){return db[_0x3915('0x2c')][_0x3915('0x49')]({'where':{'id':_0x141539[_0x3915('0x46')]['id']}})[_0x3915('0x23')](handleEntityNotFound(_0x3847bf,null))[_0x3915('0x23')](removeEntity(_0x3847bf,null))[_0x3915('0x45')](handleError(_0x3847bf,null));};exports[_0x3915('0x58')]=function(_0x2a6cc3,_0x381992,_0x653875){var _0x1e213a={'raw':!![],'where':{}};var _0x1341ca={};var _0x2010f3={'count':0x0,'rows':[]};return db[_0x3915('0x2c')][_0x3915('0x59')]({'where':{'id':_0x2a6cc3['params']['id']}})[_0x3915('0x23')](handleEntityNotFound(_0x381992,null))[_0x3915('0x23')](function(_0x5d0b7e){if(_0x5d0b7e){_0x1341ca['model']=_['keys'](db['JscriptySessionReport'][_0x3915('0x47')]);_0x1341ca['query']=_[_0x3915('0x2f')](_0x2a6cc3[_0x3915('0x2e')]);_0x1341ca[_0x3915('0x30')]=_['intersection'](_0x1341ca[_0x3915('0x32')],_0x1341ca[_0x3915('0x2e')]);_0x1e213a[_0x3915('0x34')]=_[_0x3915('0x31')](_0x1341ca[_0x3915('0x32')],qs['fields'](_0x2a6cc3[_0x3915('0x2e')][_0x3915('0x33')]));_0x1e213a[_0x3915('0x34')]=_0x1e213a[_0x3915('0x34')]['length']?_0x1e213a[_0x3915('0x34')]:_0x1341ca['model'];if(!_0x2a6cc3[_0x3915('0x2e')]['hasOwnProperty'](_0x3915('0x36'))){_0x1e213a[_0x3915('0x37')]=qs[_0x3915('0x37')](_0x2a6cc3[_0x3915('0x2e')][_0x3915('0x37')]);_0x1e213a[_0x3915('0x1c')]=qs[_0x3915('0x1c')](_0x2a6cc3['query'][_0x3915('0x1c')]);}_0x1e213a['order']=qs[_0x3915('0x39')](_0x2a6cc3[_0x3915('0x2e')][_0x3915('0x39')]);_0x1e213a[_0x3915('0x3a')]=qs[_0x3915('0x30')](_['pick'](_0x2a6cc3[_0x3915('0x2e')],_0x1341ca[_0x3915('0x30')]));_0x1e213a[_0x3915('0x3a')][_0x3915('0x5a')]=_0x5d0b7e['id'];if(_0x2a6cc3[_0x3915('0x2e')]['filter']){_0x1e213a[_0x3915('0x3a')]=_[_0x3915('0x3d')](_0x1e213a[_0x3915('0x3a')],{'$or':_[_0x3915('0x2b')](_0x1e213a['attributes'],function(_0x46ce96){var _0x59575a={};_0x59575a[_0x46ce96]={'$like':'%'+_0x2a6cc3[_0x3915('0x2e')][_0x3915('0x3c')]+'%'};return _0x59575a;})});}_0x1e213a=_[_0x3915('0x3d')]({},_0x1e213a,_0x2a6cc3[_0x3915('0x40')]);return db[_0x3915('0x5b')][_0x3915('0x1e')]({'where':_0x1e213a[_0x3915('0x3a')]})[_0x3915('0x23')](function(_0x241fe7){_0x2010f3['count']=_0x241fe7;if(_0x2a6cc3[_0x3915('0x2e')][_0x3915('0x41')]){_0x1e213a[_0x3915('0x42')]=[{'all':!![]}];}return db[_0x3915('0x5b')][_0x3915('0x43')](_0x1e213a);})[_0x3915('0x23')](function(_0x48530b){_0x2010f3[_0x3915('0x44')]=_0x48530b;return _0x2010f3;});}})['then'](respondWithFilteredResult(_0x381992,_0x1e213a))[_0x3915('0x45')](handleError(_0x381992,null));};exports['getAnswers']=function(_0x28e311,_0x442127,_0x4dd127){var _0x1b84b4={'raw':!![],'where':{}};var _0x413041={};var _0xdc61a6={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x28e311['params']['id']}})['then'](handleEntityNotFound(_0x442127,null))[_0x3915('0x23')](function(_0x2c9367){if(_0x2c9367){_0x413041[_0x3915('0x32')]=_['keys'](db[_0x3915('0x5c')][_0x3915('0x47')]);_0x413041[_0x3915('0x2e')]=_[_0x3915('0x2f')](_0x28e311['query']);_0x413041['filters']=_['intersection'](_0x413041['model'],_0x413041[_0x3915('0x2e')]);_0x1b84b4[_0x3915('0x34')]=_['intersection'](_0x413041[_0x3915('0x32')],qs[_0x3915('0x33')](_0x28e311[_0x3915('0x2e')][_0x3915('0x33')]));_0x1b84b4[_0x3915('0x34')]=_0x1b84b4['attributes'][_0x3915('0x48')]?_0x1b84b4[_0x3915('0x34')]:_0x413041[_0x3915('0x32')];if(!_0x28e311[_0x3915('0x2e')]['hasOwnProperty'](_0x3915('0x36'))){_0x1b84b4[_0x3915('0x37')]=qs[_0x3915('0x37')](_0x28e311['query'][_0x3915('0x37')]);_0x1b84b4[_0x3915('0x1c')]=qs[_0x3915('0x1c')](_0x28e311['query'][_0x3915('0x1c')]);}_0x1b84b4[_0x3915('0x38')]=qs['sort'](_0x28e311[_0x3915('0x2e')][_0x3915('0x39')]);_0x1b84b4[_0x3915('0x3a')]=qs['filters'](_[_0x3915('0x3b')](_0x28e311[_0x3915('0x2e')],_0x413041[_0x3915('0x30')]));_0x1b84b4[_0x3915('0x3a')]['ProjectId']=_0x2c9367['id'];if(_0x28e311[_0x3915('0x2e')][_0x3915('0x3c')]){_0x1b84b4[_0x3915('0x3a')]=_[_0x3915('0x3d')](_0x1b84b4['where'],{'$or':_[_0x3915('0x2b')](_0x1b84b4['attributes'],function(_0x3bf53d){var _0x45180d={};_0x45180d[_0x3bf53d]={'$like':'%'+_0x28e311[_0x3915('0x2e')]['filter']+'%'};return _0x45180d;})});}_0x1b84b4=_[_0x3915('0x3d')]({},_0x1b84b4,_0x28e311[_0x3915('0x40')]);return db[_0x3915('0x5c')][_0x3915('0x1e')]({'where':_0x1b84b4['where']})[_0x3915('0x23')](function(_0xedff3c){_0xdc61a6[_0x3915('0x1e')]=_0xedff3c;if(_0x28e311['query']['includeAll']){_0x1b84b4[_0x3915('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3915('0x43')](_0x1b84b4);})[_0x3915('0x23')](function(_0x37eeed){_0xdc61a6[_0x3915('0x44')]=_0x37eeed;return _0xdc61a6;});}})[_0x3915('0x23')](respondWithFilteredResult(_0x442127,_0x1b84b4))[_0x3915('0x45')](handleError(_0x442127,null));};function char(_0x4e69ba){return _0x3915('0x5d')===typeof _0x4e69ba?String[_0x3915('0x5e')][_0x3915('0x5f')](null,arguments):_0x4e69ba;}function needsEncapsulation(_0x37a900){return!!_0x37a900&&(_0x37a900[_0x3915('0x60')]()[_0x3915('0x61')](char(0xd))>=0x0||_0x37a900[_0x3915('0x60')]()[_0x3915('0x61')](char(0xa))>=0x0||_0x37a900[_0x3915('0x60')]()[_0x3915('0x61')](char(0x2c))>=0x0||_0x37a900[_0x3915('0x60')]()[_0x3915('0x61')](char(0x22))>=0x0);}function encapsulate(_0x11b350){var _0x52d40a=char(0x22),_0x531a40='\x5c'+char(0x22),_0x5656d7=_0x11b350[_0x3915('0x60')]()['replace'](new RegExp(_0x52d40a,'g'),_0x531a40);return _0x52d40a+_0x5656d7+_0x52d40a;}exports[_0x3915('0x62')]=function(_0x5dc7d7,_0x57e5e8,_0x547c68){var _0x42b08d,_0x3a9833;var _0x3e788e={'where':{'ProjectId':_0x5dc7d7[_0x3915('0x46')]['id']}};if(_0x5dc7d7[_0x3915('0x2e')][_0x3915('0x63')]){_0x3e788e[_0x3915('0x3a')][_0x3915('0x64')]=JSON[_0x3915('0x65')](_0x5dc7d7[_0x3915('0x2e')][_0x3915('0x63')]);}return db[_0x3915('0x5b')][_0x3915('0x43')](_0x3e788e)[_0x3915('0x23')](handleEntityNotFound(_0x57e5e8,null))['then'](function(_0x47397e){if(_0x47397e){_0x42b08d=_0x47397e;return db[_0x3915('0x66')][_0x3915('0x43')]({'where':{'SessionId':{'$in':_[_0x3915('0x2b')](_0x42b08d,'id')},'ProjectId':_0x5dc7d7['params']['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x57e5e8,null))[_0x3915('0x23')](function(_0x2eb954){if(_0x2eb954){_0x3a9833=_0x2eb954;var _0x287e96={};for(var _0x2e992f=0x0,_0x52b73b=_0x3a9833[_0x3915('0x48')];_0x2e992f<_0x52b73b;_0x2e992f++){if(!_0x287e96[_0x3915('0x35')](_0x3a9833[_0x2e992f][_0x3915('0x67')])){_0x287e96[_0x3a9833[_0x2e992f][_0x3915('0x67')]]=needsEncapsulation(_0x3a9833[_0x2e992f]['question'])?encapsulate(_0x3a9833[_0x2e992f]['question']):_0x3a9833[_0x2e992f][_0x3915('0x68')];}}var _0x112214=[],_0x3c2204={};for(var _0x219b8b=0x0,_0x1742ab=_0x42b08d[_0x3915('0x48')];_0x219b8b<_0x1742ab;_0x219b8b++){_0x3c2204={'ProjectId':_0x5dc7d7[_0x3915('0x46')]['id'],'SessionId':_0x42b08d[_0x219b8b]['id'],'StartTime':moment(_0x42b08d[_0x219b8b][_0x3915('0x64')])[_0x3915('0x69')](_0x3915('0x6a'))};for(var _0x2ab7b5=0x0,_0x45b78e=_0x3a9833[_0x3915('0x48')];_0x2ab7b5<_0x45b78e;_0x2ab7b5++){if(_0x3a9833[_0x2ab7b5][_0x3915('0x6b')]==_0x42b08d[_0x219b8b]['id']&&_0x287e96[_0x3915('0x35')](_0x3a9833[_0x2ab7b5][_0x3915('0x67')])){_0x3c2204[_0x287e96[_0x3a9833[_0x2ab7b5][_0x3915('0x67')]]]=_0x3a9833[_0x2ab7b5][_0x3915('0x6c')];}}for(var _0x26c3d7 in _0x287e96){if(!_0x3c2204[_0x3915('0x35')](_0x287e96[_0x26c3d7])){_0x3c2204[_0x287e96[_0x26c3d7]]=null;}}_0x112214[_0x3915('0x6d')](_0x3c2204);}return _0x112214;}})[_0x3915('0x23')](function(_0x58f8fd){if(!_[_0x3915('0x6e')](_0x58f8fd)){var _0x1a4528=toCsv(_0x58f8fd);var _0x498774=Date[_0x3915('0x6f')]();fs[_0x3915('0x70')](util[_0x3915('0x69')](_0x3915('0x71'),_0x5dc7d7[_0x3915('0x46')]['id'],_0x498774),_0x1a4528);_0x57e5e8['setHeader'](_0x3915('0x72'),_0x3915('0x73')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x5dc7d7[_0x3915('0x46')]['id'],_0x498774));_0x57e5e8[_0x3915('0x74')](_0x3915('0x75'),_0x3915('0x76'));return _0x57e5e8[_0x3915('0x77')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5dc7d7[_0x3915('0x46')]['id'],_0x498774));}else{return _0x57e5e8[_0x3915('0x78')](0xcc);}})[_0x3915('0x45')](handleError(_0x57e5e8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2930647..1442d4f 100644 --- a/server/api/jscriptyProject/jscriptyProject.model.js +++ b/server/api/jscriptyProject/jscriptyProject.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb717=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x82a412,_0x2edc31){var _0x222222=function(_0x2b2497){while(--_0x2b2497){_0x82a412['push'](_0x82a412['shift']());}};_0x222222(++_0x2edc31);}(_0xb717,0x1b4));var _0x7b71=function(_0x111099,_0x4b8433){_0x111099=_0x111099-0x0;var _0x9b0d02=_0xb717[_0x111099];return _0x9b0d02;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x689c=['moment','bluebird','request-promise','path','../../config/environment','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x32d2f0,_0x135118){var _0x3cf59e=function(_0x4bb57b){while(--_0x4bb57b){_0x32d2f0['push'](_0x32d2f0['shift']());}};_0x3cf59e(++_0x135118);}(_0x689c,0x9e));var _0xc689=function(_0x54b7c9,_0x66c940){_0x54b7c9=_0x54b7c9-0x0;var _0x4ba742=_0x689c[_0x54b7c9];return _0x4ba742;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc689('0x0'))(_0xc689('0x1'));var moment=require(_0xc689('0x2'));var BPromise=require(_0xc689('0x3'));var rp=require(_0xc689('0x4'));var fs=require('fs');var path=require(_0xc689('0x5'));var rimraf=require('rimraf');var config=require(_0xc689('0x6'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x3a4916,_0x28ce4c){return _0x3a4916[_0xc689('0x7')](_0xc689('0x8'),attributes,{'tableName':_0xc689('0x9'),'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 63adf6f..5c6d356 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0xda3f,0xec));var _0xfda3=function(_0x580430,_0x4fb275){_0x580430=_0x580430-0x0;var _0x5254b8=_0xda3f[_0x580430];return _0x5254b8;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _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(_0x197c29,_0x51df0d){var _0x4cda74=function(_0x17178f){while(--_0x17178f){_0x197c29['push'](_0x197c29['shift']());}};_0x4cda74(++_0x51df0d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x577bd6,_0x4b65a7){_0x577bd6=_0x577bd6-0x0;var _0x516072=_0xf4eb[_0x577bd6];return _0x516072;};'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 a7bfbba..bb7ac0c 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 _0xe3fe=['isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x51b28f,_0x20f46c){var _0x2c3885=function(_0x4a6585){while(--_0x4a6585){_0x51b28f['push'](_0x51b28f['shift']());}};_0x2c3885(++_0x20f46c);}(_0xe3fe,0x1ad));var _0xee3f=function(_0x3c04ab,_0xe6ddaa){_0x3c04ab=_0x3c04ab-0x0;var _0x5f2eb1=_0xe3fe[_0x3c04ab];return _0x5f2eb1;};'use strict';var multer=require(_0xee3f('0x0'));var util=require(_0xee3f('0x1'));var path=require(_0xee3f('0x2'));var timeout=require(_0xee3f('0x3'));var express=require(_0xee3f('0x4'));var router=express[_0xee3f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xee3f('0x7'));var controller=require(_0xee3f('0x8'));router[_0xee3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xee3f('0xa')]);router[_0xee3f('0x9')](_0xee3f('0xb'),auth[_0xee3f('0xc')](),controller[_0xee3f('0xd')]);router['get']('/:id',auth[_0xee3f('0xc')](),controller[_0xee3f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee3f('0xf')]);router[_0xee3f('0x10')](_0xee3f('0x11'),auth[_0xee3f('0xc')](),controller[_0xee3f('0x12')]);router[_0xee3f('0x13')](_0xee3f('0x11'),auth[_0xee3f('0xc')](),controller[_0xee3f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x970d=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','describe','get','/:id','show','post','create'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x970d,0x1d1));var _0xd970=function(_0x3ad9b3,_0x5c76e9){_0x3ad9b3=_0x3ad9b3-0x0;var _0x4ef8d1=_0x970d[_0x3ad9b3];return _0x4ef8d1;};'use strict';var multer=require(_0xd970('0x0'));var util=require(_0xd970('0x1'));var path=require(_0xd970('0x2'));var timeout=require(_0xd970('0x3'));var express=require(_0xd970('0x4'));var router=express[_0xd970('0x5')]();var fs_extra=require(_0xd970('0x6'));var auth=require(_0xd970('0x7'));var interaction=require(_0xd970('0x8'));var config=require(_0xd970('0x9'));var controller=require(_0xd970('0xa'));router['get']('/',auth[_0xd970('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd970('0xc')]);router[_0xd970('0xd')](_0xd970('0xe'),auth['isAuthenticated'](),controller[_0xd970('0xf')]);router[_0xd970('0x10')]('/',auth['isAuthenticated'](),controller[_0xd970('0x11')]);router[_0xd970('0x12')]('/:id',auth[_0xd970('0xb')](),controller[_0xd970('0x13')]);router[_0xd970('0x14')](_0xd970('0xe'),auth[_0xd970('0xb')](),controller[_0xd970('0x15')]);module[_0xd970('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9706d59..9722cbc 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x4c4d61,_0x2d9311){_0x4c4d61=_0x4c4d61-0x0;var _0x1e6522=_0x7a54[_0x4c4d61];return _0x1e6522;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x210cdb,_0x5d805f){_0x210cdb=_0x210cdb-0x0;var _0x51863d=_0x7a54[_0x210cdb];return _0x51863d;};'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 dc570b3..8ae320f 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 _0xaac0=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','update','body'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xaac0,0x1b8));var _0x0aac=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0xaac0[_0x1123bb];return _0xdeb602;};'use strict';var emlformat=require(_0x0aac('0x0'));var rimraf=require(_0x0aac('0x1'));var zipdir=require(_0x0aac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0aac('0x3'));var moment=require(_0x0aac('0x4'));var BPromise=require(_0x0aac('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0aac('0x6'));var csv=require(_0x0aac('0x7'));var ejs=require(_0x0aac('0x8'));var fs=require('fs');var fs_extra=require(_0x0aac('0x9'));var _=require(_0x0aac('0xa'));var squel=require(_0x0aac('0xb'));var crypto=require('crypto');var jsforce=require(_0x0aac('0xc'));var deskjs=require(_0x0aac('0xd'));var toCsv=require(_0x0aac('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0aac('0xe'));var authService=require(_0x0aac('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0aac('0x10'));var logger=require(_0x0aac('0x11'))('api');var utils=require(_0x0aac('0x12'));var config=require(_0x0aac('0x13'));var licenseUtil=require(_0x0aac('0x14'));var db=require(_0x0aac('0x15'))['db'];function respondWithStatusCode(_0x14316c,_0x2c702e){_0x2c702e=_0x2c702e||0xcc;return function(_0x4db6c4){if(_0x4db6c4){return _0x14316c[_0x0aac('0x16')](_0x2c702e);}return _0x14316c[_0x0aac('0x17')](_0x2c702e)[_0x0aac('0x18')]();};}function respondWithResult(_0x4c0f9f,_0x2c98e1){_0x2c98e1=_0x2c98e1||0xc8;return function(_0x1eb20b){if(_0x1eb20b){return _0x4c0f9f[_0x0aac('0x17')](_0x2c98e1)[_0x0aac('0x19')](_0x1eb20b);}};}function respondWithFilteredResult(_0x439b00,_0x173d1e){return function(_0x47c71f){if(_0x47c71f){var _0x36e03e=typeof _0x173d1e[_0x0aac('0x1a')]===_0x0aac('0x1b')&&typeof _0x173d1e[_0x0aac('0x1c')]===_0x0aac('0x1b');var _0x5b85b0=_0x47c71f[_0x0aac('0x1d')];var _0x4d0d9c=_0x36e03e?0x0:_0x173d1e[_0x0aac('0x1a')];var _0x57307f=_0x36e03e?_0x47c71f['count']:_0x173d1e[_0x0aac('0x1a')]+_0x173d1e[_0x0aac('0x1c')];var _0x6f743;if(_0x57307f>=_0x5b85b0){_0x57307f=_0x5b85b0;_0x6f743=0xc8;}else{_0x6f743=0xce;}_0x439b00[_0x0aac('0x17')](_0x6f743);return _0x439b00[_0x0aac('0x1e')]('Content-Range',_0x4d0d9c+'-'+_0x57307f+'/'+_0x5b85b0)[_0x0aac('0x19')](_0x47c71f);}return null;};}function patchUpdates(_0x275b31){return function(_0x48ab7c){try{jsonpatch[_0x0aac('0x1f')](_0x48ab7c,_0x275b31,!![]);}catch(_0x52da3c){return BPromise[_0x0aac('0x20')](_0x52da3c);}return _0x48ab7c['save']();};}function saveUpdates(_0x34c1c9,_0x2b7eeb){return function(_0xf48ae4){if(_0xf48ae4){return _0xf48ae4['update'](_0x34c1c9)[_0x0aac('0x21')](function(_0x248b8f){return _0x248b8f;});}return null;};}function removeEntity(_0x53123f,_0x329fed){return function(_0x238466){if(_0x238466){return _0x238466['destroy']()[_0x0aac('0x21')](function(){_0x53123f[_0x0aac('0x17')](0xcc)[_0x0aac('0x18')]();});}};}function handleEntityNotFound(_0x379e19,_0x3dc18d){return function(_0x487639){if(!_0x487639){_0x379e19[_0x0aac('0x16')](0x194);}return _0x487639;};}function handleError(_0x2b749f,_0x15b6c1){_0x15b6c1=_0x15b6c1||0x1f4;return function(_0x56b95c){logger[_0x0aac('0x22')](_0x56b95c[_0x0aac('0x23')]);if(_0x56b95c[_0x0aac('0x24')]){delete _0x56b95c['name'];}_0x2b749f[_0x0aac('0x17')](_0x15b6c1)[_0x0aac('0x25')](_0x56b95c);};}exports[_0x0aac('0x26')]=function(_0x16b292,_0x46892a){var _0x573919={},_0x11626a={},_0x48dc28={'count':0x0,'rows':[]};var _0x20358c=_[_0x0aac('0x27')](db[_0x0aac('0x28')]['rawAttributes'],function(_0x5793a9){return{'name':_0x5793a9[_0x0aac('0x29')],'type':_0x5793a9[_0x0aac('0x2a')][_0x0aac('0x2b')]};});_0x11626a[_0x0aac('0x2c')]=_[_0x0aac('0x27')](_0x20358c,_0x0aac('0x24'));_0x11626a[_0x0aac('0x2d')]=_[_0x0aac('0x2e')](_0x16b292['query']);_0x11626a[_0x0aac('0x2f')]=_[_0x0aac('0x30')](_0x11626a[_0x0aac('0x2c')],_0x11626a['query']);_0x573919[_0x0aac('0x31')]=_['intersection'](_0x11626a['model'],qs[_0x0aac('0x32')](_0x16b292[_0x0aac('0x2d')][_0x0aac('0x32')]));_0x573919[_0x0aac('0x31')]=_0x573919['attributes'][_0x0aac('0x33')]?_0x573919[_0x0aac('0x31')]:_0x11626a[_0x0aac('0x2c')];if(!_0x16b292['query'][_0x0aac('0x34')](_0x0aac('0x35'))){_0x573919[_0x0aac('0x1c')]=qs[_0x0aac('0x1c')](_0x16b292[_0x0aac('0x2d')][_0x0aac('0x1c')]);_0x573919['offset']=qs[_0x0aac('0x1a')](_0x16b292['query'][_0x0aac('0x1a')]);}_0x573919[_0x0aac('0x36')]=qs['sort'](_0x16b292[_0x0aac('0x2d')]['sort']);_0x573919['where']=qs['filters'](_[_0x0aac('0x37')](_0x16b292[_0x0aac('0x2d')],_0x11626a[_0x0aac('0x2f')]),_0x20358c);if(_0x16b292['query'][_0x0aac('0x38')]){_0x573919[_0x0aac('0x39')]=_[_0x0aac('0x3a')](_0x573919[_0x0aac('0x39')],{'$or':_['map'](_0x20358c,function(_0x4f71f4){if(_0x4f71f4[_0x0aac('0x2a')]!==_0x0aac('0x3b')){var _0x266c60={};_0x266c60[_0x4f71f4['name']]={'$like':'%'+_0x16b292[_0x0aac('0x2d')][_0x0aac('0x38')]+'%'};return _0x266c60;}})});}_0x573919=_[_0x0aac('0x3a')]({},_0x573919,_0x16b292['options']);var _0x98a2e7={'where':_0x573919[_0x0aac('0x39')]};return db[_0x0aac('0x28')]['count'](_0x98a2e7)[_0x0aac('0x21')](function(_0x58a30a){_0x48dc28[_0x0aac('0x1d')]=_0x58a30a;if(_0x16b292[_0x0aac('0x2d')][_0x0aac('0x3c')]){_0x573919[_0x0aac('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x573919);})['then'](function(_0x2283a8){_0x48dc28[_0x0aac('0x3e')]=_0x2283a8;return _0x48dc28;})['then'](respondWithFilteredResult(_0x46892a,_0x573919))[_0x0aac('0x3f')](handleError(_0x46892a,null));};exports[_0x0aac('0x40')]=function(_0xd5faec,_0x283ab2){var _0x1db1e0={'raw':!![],'where':{'id':_0xd5faec[_0x0aac('0x41')]['id']}},_0x25d8a9={};_0x25d8a9[_0x0aac('0x2c')]=_[_0x0aac('0x2e')](db[_0x0aac('0x28')]['rawAttributes']);_0x25d8a9['query']=_[_0x0aac('0x2e')](_0xd5faec[_0x0aac('0x2d')]);_0x25d8a9[_0x0aac('0x2f')]=_[_0x0aac('0x30')](_0x25d8a9['model'],_0x25d8a9[_0x0aac('0x2d')]);_0x1db1e0['attributes']=_[_0x0aac('0x30')](_0x25d8a9[_0x0aac('0x2c')],qs[_0x0aac('0x32')](_0xd5faec[_0x0aac('0x2d')][_0x0aac('0x32')]));_0x1db1e0[_0x0aac('0x31')]=_0x1db1e0[_0x0aac('0x31')][_0x0aac('0x33')]?_0x1db1e0[_0x0aac('0x31')]:_0x25d8a9[_0x0aac('0x2c')];if(_0xd5faec[_0x0aac('0x2d')]['includeAll']){_0x1db1e0[_0x0aac('0x3d')]=[{'all':!![]}];}_0x1db1e0=_[_0x0aac('0x3a')]({},_0x1db1e0,_0xd5faec[_0x0aac('0x42')]);return db[_0x0aac('0x28')][_0x0aac('0x43')](_0x1db1e0)['then'](handleEntityNotFound(_0x283ab2,null))[_0x0aac('0x21')](respondWithResult(_0x283ab2,null))[_0x0aac('0x3f')](handleError(_0x283ab2,null));};exports['create']=function(_0x25e6fe,_0x1ce469){return db[_0x0aac('0x28')][_0x0aac('0x44')](_0x25e6fe['body'],{})[_0x0aac('0x21')](respondWithResult(_0x1ce469,0xc9))[_0x0aac('0x3f')](handleError(_0x1ce469,null));};exports[_0x0aac('0x45')]=function(_0x1aacb5,_0x3df2e5){if(_0x1aacb5['body']['id']){delete _0x1aacb5[_0x0aac('0x46')]['id'];}return db[_0x0aac('0x28')][_0x0aac('0x43')]({'where':{'id':_0x1aacb5[_0x0aac('0x41')]['id']}})[_0x0aac('0x21')](handleEntityNotFound(_0x3df2e5,null))[_0x0aac('0x21')](saveUpdates(_0x1aacb5[_0x0aac('0x46')],null))[_0x0aac('0x21')](respondWithResult(_0x3df2e5,null))['catch'](handleError(_0x3df2e5,null));};exports[_0x0aac('0x47')]=function(_0x2ff213,_0x311e7a){return db[_0x0aac('0x28')]['find']({'where':{'id':_0x2ff213[_0x0aac('0x41')]['id']}})[_0x0aac('0x21')](handleEntityNotFound(_0x311e7a,null))['then'](removeEntity(_0x311e7a,null))[_0x0aac('0x3f')](handleError(_0x311e7a,null));};exports[_0x0aac('0x48')]=function(_0x5721e6,_0x465cfb){return db[_0x0aac('0x28')][_0x0aac('0x48')]()['then'](respondWithResult(_0x465cfb,null))[_0x0aac('0x3f')](handleError(_0x465cfb,null));}; \ No newline at end of file +var _0x7325=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','describe','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/parsers/qs'];(function(_0x344650,_0x2ea191){var _0x12d0d2=function(_0x43497a){while(--_0x43497a){_0x344650['push'](_0x344650['shift']());}};_0x12d0d2(++_0x2ea191);}(_0x7325,0x10e));var _0x5732=function(_0xdce24,_0x4787d2){_0xdce24=_0xdce24-0x0;var _0x43e8a7=_0x7325[_0xdce24];return _0x43e8a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5732('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5732('0x1'));var BPromise=require(_0x5732('0x2'));var Mustache=require(_0x5732('0x3'));var util=require(_0x5732('0x4'));var path=require(_0x5732('0x5'));var sox=require(_0x5732('0x6'));var csv=require(_0x5732('0x7'));var ejs=require(_0x5732('0x8'));var fs=require('fs');var fs_extra=require(_0x5732('0x9'));var _=require('lodash');var squel=require(_0x5732('0xa'));var crypto=require('crypto');var jsforce=require(_0x5732('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5732('0x7'));var querystring=require(_0x5732('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5732('0xd'));var as=require(_0x5732('0xe'));var hardwareService=require(_0x5732('0xf'));var logger=require(_0x5732('0x10'))('api');var utils=require(_0x5732('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5732('0x12'))['db'];function respondWithStatusCode(_0x2de9c2,_0x14d95c){_0x14d95c=_0x14d95c||0xcc;return function(_0x1f8a29){if(_0x1f8a29){return _0x2de9c2['sendStatus'](_0x14d95c);}return _0x2de9c2['status'](_0x14d95c)[_0x5732('0x13')]();};}function respondWithResult(_0x2d4c0d,_0x452f4b){_0x452f4b=_0x452f4b||0xc8;return function(_0x5b0085){if(_0x5b0085){return _0x2d4c0d[_0x5732('0x14')](_0x452f4b)[_0x5732('0x15')](_0x5b0085);}};}function respondWithFilteredResult(_0x229a34,_0x332d95){return function(_0x470ad7){if(_0x470ad7){var _0x4e58a8=typeof _0x332d95[_0x5732('0x16')]===_0x5732('0x17')&&typeof _0x332d95[_0x5732('0x18')]===_0x5732('0x17');var _0x3baa74=_0x470ad7[_0x5732('0x19')];var _0x4fb391=_0x4e58a8?0x0:_0x332d95['offset'];var _0x5146fd=_0x4e58a8?_0x470ad7[_0x5732('0x19')]:_0x332d95[_0x5732('0x16')]+_0x332d95[_0x5732('0x18')];var _0x24e899;if(_0x5146fd>=_0x3baa74){_0x5146fd=_0x3baa74;_0x24e899=0xc8;}else{_0x24e899=0xce;}_0x229a34[_0x5732('0x14')](_0x24e899);return _0x229a34[_0x5732('0x1a')](_0x5732('0x1b'),_0x4fb391+'-'+_0x5146fd+'/'+_0x3baa74)[_0x5732('0x15')](_0x470ad7);}return null;};}function patchUpdates(_0x1d2b8a){return function(_0x2ebbd4){try{jsonpatch['apply'](_0x2ebbd4,_0x1d2b8a,!![]);}catch(_0x1628f8){return BPromise[_0x5732('0x1c')](_0x1628f8);}return _0x2ebbd4['save']();};}function saveUpdates(_0x20ae94,_0x555871){return function(_0x31b2c2){if(_0x31b2c2){return _0x31b2c2['update'](_0x20ae94)[_0x5732('0x1d')](function(_0x40849b){return _0x40849b;});}return null;};}function removeEntity(_0x58e951,_0x41e357){return function(_0x881624){if(_0x881624){return _0x881624[_0x5732('0x1e')]()[_0x5732('0x1d')](function(){_0x58e951[_0x5732('0x14')](0xcc)[_0x5732('0x13')]();});}};}function handleEntityNotFound(_0x25bca9,_0x7bcc5d){return function(_0x5308a7){if(!_0x5308a7){_0x25bca9[_0x5732('0x1f')](0x194);}return _0x5308a7;};}function handleError(_0x4aff1a,_0x52d656){_0x52d656=_0x52d656||0x1f4;return function(_0x223eea){logger['error'](_0x223eea[_0x5732('0x20')]);if(_0x223eea[_0x5732('0x21')]){delete _0x223eea['name'];}_0x4aff1a['status'](_0x52d656)[_0x5732('0x22')](_0x223eea);};}exports[_0x5732('0x23')]=function(_0x517d6c,_0x4e12a1){var _0x3b3df0={},_0xface38={},_0x510ff0={'count':0x0,'rows':[]};var _0x166cbf=_['map'](db[_0x5732('0x24')][_0x5732('0x25')],function(_0x4c203d){return{'name':_0x4c203d[_0x5732('0x26')],'type':_0x4c203d['type'][_0x5732('0x27')]};});_0xface38[_0x5732('0x28')]=_['map'](_0x166cbf,_0x5732('0x21'));_0xface38[_0x5732('0x29')]=_[_0x5732('0x2a')](_0x517d6c['query']);_0xface38[_0x5732('0x2b')]=_[_0x5732('0x2c')](_0xface38['model'],_0xface38[_0x5732('0x29')]);_0x3b3df0[_0x5732('0x2d')]=_[_0x5732('0x2c')](_0xface38[_0x5732('0x28')],qs[_0x5732('0x2e')](_0x517d6c[_0x5732('0x29')][_0x5732('0x2e')]));_0x3b3df0[_0x5732('0x2d')]=_0x3b3df0[_0x5732('0x2d')][_0x5732('0x2f')]?_0x3b3df0[_0x5732('0x2d')]:_0xface38['model'];if(!_0x517d6c[_0x5732('0x29')][_0x5732('0x30')](_0x5732('0x31'))){_0x3b3df0['limit']=qs[_0x5732('0x18')](_0x517d6c[_0x5732('0x29')][_0x5732('0x18')]);_0x3b3df0[_0x5732('0x16')]=qs[_0x5732('0x16')](_0x517d6c[_0x5732('0x29')][_0x5732('0x16')]);}_0x3b3df0[_0x5732('0x32')]=qs[_0x5732('0x33')](_0x517d6c[_0x5732('0x29')]['sort']);_0x3b3df0[_0x5732('0x34')]=qs['filters'](_[_0x5732('0x35')](_0x517d6c[_0x5732('0x29')],_0xface38[_0x5732('0x2b')]),_0x166cbf);if(_0x517d6c[_0x5732('0x29')][_0x5732('0x36')]){_0x3b3df0[_0x5732('0x34')]=_[_0x5732('0x37')](_0x3b3df0[_0x5732('0x34')],{'$or':_['map'](_0x166cbf,function(_0x592eb0){if(_0x592eb0[_0x5732('0x38')]!==_0x5732('0x39')){var _0x37702c={};_0x37702c[_0x592eb0['name']]={'$like':'%'+_0x517d6c[_0x5732('0x29')]['filter']+'%'};return _0x37702c;}})});}_0x3b3df0=_['merge']({},_0x3b3df0,_0x517d6c[_0x5732('0x3a')]);var _0x55a102={'where':_0x3b3df0[_0x5732('0x34')]};return db[_0x5732('0x24')][_0x5732('0x19')](_0x55a102)[_0x5732('0x1d')](function(_0xa9c0cd){_0x510ff0[_0x5732('0x19')]=_0xa9c0cd;if(_0x517d6c[_0x5732('0x29')][_0x5732('0x3b')]){_0x3b3df0['include']=[{'all':!![]}];}return db[_0x5732('0x24')][_0x5732('0x3c')](_0x3b3df0);})[_0x5732('0x1d')](function(_0x7bc86d){_0x510ff0[_0x5732('0x3d')]=_0x7bc86d;return _0x510ff0;})[_0x5732('0x1d')](respondWithFilteredResult(_0x4e12a1,_0x3b3df0))[_0x5732('0x3e')](handleError(_0x4e12a1,null));};exports[_0x5732('0x3f')]=function(_0x15efa9,_0x4336e1){var _0x238a95={'raw':!![],'where':{'id':_0x15efa9['params']['id']}},_0x5c6a89={};_0x5c6a89[_0x5732('0x28')]=_[_0x5732('0x2a')](db[_0x5732('0x24')][_0x5732('0x25')]);_0x5c6a89['query']=_[_0x5732('0x2a')](_0x15efa9[_0x5732('0x29')]);_0x5c6a89[_0x5732('0x2b')]=_['intersection'](_0x5c6a89[_0x5732('0x28')],_0x5c6a89[_0x5732('0x29')]);_0x238a95[_0x5732('0x2d')]=_[_0x5732('0x2c')](_0x5c6a89[_0x5732('0x28')],qs[_0x5732('0x2e')](_0x15efa9[_0x5732('0x29')][_0x5732('0x2e')]));_0x238a95[_0x5732('0x2d')]=_0x238a95['attributes']['length']?_0x238a95['attributes']:_0x5c6a89[_0x5732('0x28')];if(_0x15efa9[_0x5732('0x29')][_0x5732('0x3b')]){_0x238a95[_0x5732('0x40')]=[{'all':!![]}];}_0x238a95=_[_0x5732('0x37')]({},_0x238a95,_0x15efa9[_0x5732('0x3a')]);return db[_0x5732('0x24')][_0x5732('0x41')](_0x238a95)['then'](handleEntityNotFound(_0x4336e1,null))[_0x5732('0x1d')](respondWithResult(_0x4336e1,null))[_0x5732('0x3e')](handleError(_0x4336e1,null));};exports['create']=function(_0x405080,_0x4b77f2){return db[_0x5732('0x24')][_0x5732('0x42')](_0x405080[_0x5732('0x43')],{})[_0x5732('0x1d')](respondWithResult(_0x4b77f2,0xc9))['catch'](handleError(_0x4b77f2,null));};exports[_0x5732('0x44')]=function(_0x500784,_0x344424){if(_0x500784['body']['id']){delete _0x500784[_0x5732('0x43')]['id'];}return db[_0x5732('0x24')][_0x5732('0x41')]({'where':{'id':_0x500784[_0x5732('0x45')]['id']}})[_0x5732('0x1d')](handleEntityNotFound(_0x344424,null))[_0x5732('0x1d')](saveUpdates(_0x500784[_0x5732('0x43')],null))[_0x5732('0x1d')](respondWithResult(_0x344424,null))[_0x5732('0x3e')](handleError(_0x344424,null));};exports['destroy']=function(_0x225547,_0x259e0d){return db['JscriptyQuestionReport'][_0x5732('0x41')]({'where':{'id':_0x225547[_0x5732('0x45')]['id']}})[_0x5732('0x1d')](handleEntityNotFound(_0x259e0d,null))[_0x5732('0x1d')](removeEntity(_0x259e0d,null))[_0x5732('0x3e')](handleError(_0x259e0d,null));};exports[_0x5732('0x46')]=function(_0x11c315,_0x5aede3){return db[_0x5732('0x24')][_0x5732('0x46')]()[_0x5732('0x1d')](respondWithResult(_0x5aede3,null))[_0x5732('0x3e')](handleError(_0x5aede3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 5a671b4..7a80a9c 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 _0x4d22=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x231ede,_0x4856bb){var _0x3fdd8a=function(_0x4e622c){while(--_0x4e622c){_0x231ede['push'](_0x231ede['shift']());}};_0x3fdd8a(++_0x4856bb);}(_0x4d22,0xb8));var _0x24d2=function(_0x2409cb,_0x26b709){_0x2409cb=_0x2409cb-0x0;var _0xe25c7=_0x4d22[_0x2409cb];return _0xe25c7;};'use strict';var _=require(_0x24d2('0x0'));var util=require(_0x24d2('0x1'));var logger=require(_0x24d2('0x2'))(_0x24d2('0x3'));var moment=require(_0x24d2('0x4'));var BPromise=require(_0x24d2('0x5'));var rp=require(_0x24d2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d2('0x7'));var config=require(_0x24d2('0x8'));var attributes=require(_0x24d2('0x9'));module[_0x24d2('0xa')]=function(_0x84f6d7,_0x5158c6){return _0x84f6d7['define'](_0x24d2('0xb'),attributes,{'tableName':_0x24d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b8f=['exports','define','report_jscripty_questions','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x1b664d,_0x1d8695){var _0x43af6b=function(_0x7fe8b2){while(--_0x7fe8b2){_0x1b664d['push'](_0x1b664d['shift']());}};_0x43af6b(++_0x1d8695);}(_0x1b8f,0x9c));var _0xf1b8=function(_0x3cdf24,_0x8ce5e4){_0x3cdf24=_0x3cdf24-0x0;var _0x14a5f4=_0x1b8f[_0x3cdf24];return _0x14a5f4;};'use strict';var _=require('lodash');var util=require(_0xf1b8('0x0'));var logger=require('../../config/logger')(_0xf1b8('0x1'));var moment=require(_0xf1b8('0x2'));var BPromise=require(_0xf1b8('0x3'));var rp=require(_0xf1b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1b8('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xf1b8('0x6')]=function(_0x11c953,_0xb2306d){return _0x11c953[_0xf1b8('0x7')]('JscriptyQuestionReport',attributes,{'tableName':_0xf1b8('0x8'),'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 ce772f0..fca7483 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 _0x4c93=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c93,0xcf));var _0x34c9=function(_0x4b45b2,_0x56ac7f){_0x4b45b2=_0x4b45b2-0x0;var _0x53a1f2=_0x4c93[_0x4b45b2];return _0x53a1f2;};'use strict';var _=require(_0x34c9('0x0'));var util=require(_0x34c9('0x1'));var moment=require(_0x34c9('0x2'));var BPromise=require(_0x34c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34c9('0x4'));var db=require(_0x34c9('0x5'))['db'];var utils=require(_0x34c9('0x6'));var logger=require('../../config/logger')(_0x34c9('0x7'));var config=require(_0x34c9('0x8'));var jayson=require(_0x34c9('0x9'));var client=jayson[_0x34c9('0xa')][_0x34c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34cbfb,_0x26948a,_0x3e4420){return new BPromise(function(_0x5ae715,_0x46dfb6){return client[_0x34c9('0xc')](_0x34cbfb,_0x3e4420)[_0x34c9('0xd')](function(_0x13c54c){logger['info'](_0x34c9('0xe'),_0x26948a,_0x34c9('0xf'));logger[_0x34c9('0x10')](_0x34c9('0x11'),_0x26948a,_0x34c9('0xf'),JSON[_0x34c9('0x12')](_0x13c54c));if(_0x13c54c[_0x34c9('0x13')]){if(_0x13c54c[_0x34c9('0x13')][_0x34c9('0x14')]===0x1f4){logger[_0x34c9('0x13')](_0x34c9('0xe'),_0x26948a,_0x13c54c['error'][_0x34c9('0x15')]);return _0x46dfb6(_0x13c54c['error'][_0x34c9('0x15')]);}logger[_0x34c9('0x13')](_0x34c9('0xe'),_0x26948a,_0x13c54c['error'][_0x34c9('0x15')]);return _0x5ae715(_0x13c54c[_0x34c9('0x13')][_0x34c9('0x15')]);}else{logger['info'](_0x34c9('0xe'),_0x26948a,'request\x20sent');_0x5ae715(_0x13c54c['result'][_0x34c9('0x15')]);}})[_0x34c9('0x16')](function(_0x39708a){logger[_0x34c9('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x26948a,_0x39708a);_0x46dfb6(_0x39708a);});});} \ No newline at end of file +var _0xa1ce=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xa1ce,0x65));var _0xea1c=function(_0x3e1852,_0x5c7bf7){_0x3e1852=_0x3e1852-0x0;var _0x37a840=_0xa1ce[_0x3e1852];return _0x37a840;};'use strict';var _=require('lodash');var util=require(_0xea1c('0x0'));var moment=require('moment');var BPromise=require(_0xea1c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea1c('0x2'))['db'];var utils=require(_0xea1c('0x3'));var logger=require(_0xea1c('0x4'))(_0xea1c('0x5'));var config=require(_0xea1c('0x6'));var jayson=require(_0xea1c('0x7'));var client=jayson[_0xea1c('0x8')][_0xea1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9c9e66,_0x50d54f,_0x99ff38){return new BPromise(function(_0x1aa66a,_0x2740bd){return client[_0xea1c('0xa')](_0x9c9e66,_0x99ff38)[_0xea1c('0xb')](function(_0x33be03){logger[_0xea1c('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x50d54f,_0xea1c('0xd'));logger[_0xea1c('0xe')](_0xea1c('0xf'),_0x50d54f,_0xea1c('0xd'),JSON[_0xea1c('0x10')](_0x33be03));if(_0x33be03['error']){if(_0x33be03[_0xea1c('0x11')][_0xea1c('0x12')]===0x1f4){logger[_0xea1c('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x50d54f,_0x33be03['error']['message']);return _0x2740bd(_0x33be03[_0xea1c('0x11')][_0xea1c('0x13')]);}logger[_0xea1c('0x11')](_0xea1c('0x14'),_0x50d54f,_0x33be03[_0xea1c('0x11')][_0xea1c('0x13')]);return _0x1aa66a(_0x33be03[_0xea1c('0x11')][_0xea1c('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x50d54f,_0xea1c('0xd'));_0x1aa66a(_0x33be03['result'][_0xea1c('0x13')]);}})['catch'](function(_0x25ce5f){logger[_0xea1c('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x50d54f,_0x25ce5f);_0x2740bd(_0x25ce5f);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8fb33e8..0620296 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 _0xb7f8=['/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xe972a7,_0x484223){var _0x3f8517=function(_0x4ed046){while(--_0x4ed046){_0xe972a7['push'](_0xe972a7['shift']());}};_0x3f8517(++_0x484223);}(_0xb7f8,0xf1));var _0x8b7f=function(_0x2e119f,_0x13dd59){_0x2e119f=_0x2e119f-0x0;var _0x4d5ee2=_0xb7f8[_0x2e119f];return _0x4d5ee2;};'use strict';var multer=require(_0x8b7f('0x0'));var util=require(_0x8b7f('0x1'));var path=require(_0x8b7f('0x2'));var timeout=require(_0x8b7f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b7f('0x4'));var interaction=require(_0x8b7f('0x5'));var config=require('../../config/environment');var controller=require(_0x8b7f('0x6'));router[_0x8b7f('0x7')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x9')]);router[_0x8b7f('0x7')](_0x8b7f('0xa'),auth['isAuthenticated'](),controller[_0x8b7f('0xb')]);router['get'](_0x8b7f('0xc'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0xd')]);router[_0x8b7f('0x7')](_0x8b7f('0xe'),auth[_0x8b7f('0x8')](),controller[_0x8b7f('0xf')]);router[_0x8b7f('0x10')]('/',auth[_0x8b7f('0x8')](),controller[_0x8b7f('0x11')]);router[_0x8b7f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8b7f('0x13')]);router[_0x8b7f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8b7f('0x15')]);module[_0x8b7f('0x16')]=router; \ No newline at end of file +var _0x2fc7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','getQuestions','post','create','update','destroy','exports','multer','util'];(function(_0x97d0d9,_0x215b91){var _0x50ecdf=function(_0x5f04f3){while(--_0x5f04f3){_0x97d0d9['push'](_0x97d0d9['shift']());}};_0x50ecdf(++_0x215b91);}(_0x2fc7,0x67));var _0x72fc=function(_0x21ab69,_0x135b24){_0x21ab69=_0x21ab69-0x0;var _0x174323=_0x2fc7[_0x21ab69];return _0x174323;};'use strict';var multer=require(_0x72fc('0x0'));var util=require(_0x72fc('0x1'));var path=require('path');var timeout=require(_0x72fc('0x2'));var express=require(_0x72fc('0x3'));var router=express[_0x72fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x72fc('0x5'));var interaction=require(_0x72fc('0x6'));var config=require(_0x72fc('0x7'));var controller=require(_0x72fc('0x8'));router[_0x72fc('0x9')]('/',auth[_0x72fc('0xa')](),controller['index']);router[_0x72fc('0x9')](_0x72fc('0xb'),auth[_0x72fc('0xa')](),controller[_0x72fc('0xc')]);router[_0x72fc('0x9')](_0x72fc('0xd'),auth[_0x72fc('0xa')](),controller[_0x72fc('0xe')]);router[_0x72fc('0x9')]('/:id/questions',auth[_0x72fc('0xa')](),controller[_0x72fc('0xf')]);router[_0x72fc('0x10')]('/',auth['isAuthenticated'](),controller[_0x72fc('0x11')]);router['put'](_0x72fc('0xd'),auth[_0x72fc('0xa')](),controller[_0x72fc('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x72fc('0x13')]);module[_0x72fc('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 8838812..3f363a4 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 _0x904a=['starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE'];(function(_0x1018cc,_0xcea0b){var _0x43356d=function(_0x29269e){while(--_0x29269e){_0x1018cc['push'](_0x1018cc['shift']());}};_0x43356d(++_0xcea0b);}(_0x904a,0x1dd));var _0xa904=function(_0x357a05,_0x4b9e30){_0x357a05=_0x357a05-0x0;var _0xc35a9a=_0x904a[_0x357a05];return _0xc35a9a;};'use strict';var moment=require(_0xa904('0x0'));var Sequelize=require(_0xa904('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xa904('0x2')],'set':function(_0x271b87){this['setDataValue'](_0xa904('0x3'),_0x271b87);this[_0xa904('0x4')](_0xa904('0x5'),moment()[_0xa904('0x6')](_0xa904('0x7')));}},'endtime':{'type':Sequelize[_0xa904('0x2')]},'membername':{'type':Sequelize[_0xa904('0x8')]},'projectname':{'type':Sequelize[_0xa904('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa904('0x8')]},'calleridname':{'type':Sequelize[_0xa904('0x8')]},'calleridnum':{'type':Sequelize[_0xa904('0x8')]},'completed':{'type':Sequelize[_0xa904('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x34a7=['DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x15fa80,_0x2ad3b8){var _0x485703=function(_0x2390b1){while(--_0x2390b1){_0x15fa80['push'](_0x15fa80['shift']());}};_0x485703(++_0x2ad3b8);}(_0x34a7,0x7b));var _0x734a=function(_0x3fd60c,_0x285039){_0x3fd60c=_0x3fd60c-0x0;var _0x5eae7f=_0x34a7[_0x3fd60c];return _0x5eae7f;};'use strict';var moment=require(_0x734a('0x0'));var Sequelize=require(_0x734a('0x1'));module[_0x734a('0x2')]={'starttime':{'type':Sequelize[_0x734a('0x3')],'set':function(_0x31307e){this[_0x734a('0x4')]('starttime',_0x31307e);this[_0x734a('0x4')](_0x734a('0x5'),moment()[_0x734a('0x6')](_0x734a('0x7')));}},'endtime':{'type':Sequelize[_0x734a('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x734a('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x734a('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'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 1b5a216..3af6dc3 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 _0xdf57=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','keys','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','status','end','json','offset'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xdf57,0x1e3));var _0x7df5=function(_0x3bb63a,_0x15af8f){_0x3bb63a=_0x3bb63a-0x0;var _0x3b822a=_0xdf57[_0x3bb63a];return _0x3b822a;};'use strict';var emlformat=require(_0x7df5('0x0'));var rimraf=require(_0x7df5('0x1'));var zipdir=require(_0x7df5('0x2'));var jsonpatch=require(_0x7df5('0x3'));var rp=require(_0x7df5('0x4'));var moment=require(_0x7df5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7df5('0x6'));var util=require(_0x7df5('0x7'));var path=require(_0x7df5('0x8'));var sox=require(_0x7df5('0x9'));var csv=require(_0x7df5('0xa'));var ejs=require(_0x7df5('0xb'));var fs=require('fs');var fs_extra=require(_0x7df5('0xc'));var _=require(_0x7df5('0xd'));var squel=require(_0x7df5('0xe'));var crypto=require('crypto');var jsforce=require(_0x7df5('0xf'));var deskjs=require(_0x7df5('0x10'));var toCsv=require(_0x7df5('0xa'));var querystring=require(_0x7df5('0x11'));var Papa=require('papaparse');var Redis=require(_0x7df5('0x12'));var authService=require(_0x7df5('0x13'));var qs=require(_0x7df5('0x14'));var as=require(_0x7df5('0x15'));var hardwareService=require(_0x7df5('0x16'));var logger=require(_0x7df5('0x17'))(_0x7df5('0x18'));var utils=require(_0x7df5('0x19'));var config=require(_0x7df5('0x1a'));var licenseUtil=require(_0x7df5('0x1b'));var db=require(_0x7df5('0x1c'))['db'];function respondWithStatusCode(_0x1955dc,_0x3e1929){_0x3e1929=_0x3e1929||0xcc;return function(_0x482dd7){if(_0x482dd7){return _0x1955dc['sendStatus'](_0x3e1929);}return _0x1955dc[_0x7df5('0x1d')](_0x3e1929)[_0x7df5('0x1e')]();};}function respondWithResult(_0xb76050,_0x19e286){_0x19e286=_0x19e286||0xc8;return function(_0x5d72ab){if(_0x5d72ab){return _0xb76050['status'](_0x19e286)[_0x7df5('0x1f')](_0x5d72ab);}};}function respondWithFilteredResult(_0x4cb321,_0x4fec24){return function(_0x315860){if(_0x315860){var _0x375fea=typeof _0x4fec24[_0x7df5('0x20')]===_0x7df5('0x21')&&typeof _0x4fec24[_0x7df5('0x22')]===_0x7df5('0x21');var _0x4c432e=_0x315860[_0x7df5('0x23')];var _0x252895=_0x375fea?0x0:_0x4fec24[_0x7df5('0x20')];var _0x32f082=_0x375fea?_0x315860['count']:_0x4fec24[_0x7df5('0x20')]+_0x4fec24[_0x7df5('0x22')];var _0x4aef6e;if(_0x32f082>=_0x4c432e){_0x32f082=_0x4c432e;_0x4aef6e=0xc8;}else{_0x4aef6e=0xce;}_0x4cb321[_0x7df5('0x1d')](_0x4aef6e);return _0x4cb321[_0x7df5('0x24')](_0x7df5('0x25'),_0x252895+'-'+_0x32f082+'/'+_0x4c432e)['json'](_0x315860);}return null;};}function patchUpdates(_0x2621c4){return function(_0x558739){try{jsonpatch[_0x7df5('0x26')](_0x558739,_0x2621c4,!![]);}catch(_0x574aa0){return BPromise[_0x7df5('0x27')](_0x574aa0);}return _0x558739[_0x7df5('0x28')]();};}function saveUpdates(_0x136415,_0x595ba6){return function(_0x4dd511){if(_0x4dd511){return _0x4dd511[_0x7df5('0x29')](_0x136415)['then'](function(_0x16ef37){return _0x16ef37;});}return null;};}function removeEntity(_0x440cbd,_0x47ccfa){return function(_0x40d371){if(_0x40d371){return _0x40d371['destroy']()[_0x7df5('0x2a')](function(){_0x440cbd[_0x7df5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2721b1,_0x1297ca){return function(_0xd4af7f){if(!_0xd4af7f){_0x2721b1[_0x7df5('0x2b')](0x194);}return _0xd4af7f;};}function handleError(_0x5c1795,_0xb21710){_0xb21710=_0xb21710||0x1f4;return function(_0x513c7a){logger[_0x7df5('0x2c')](_0x513c7a['stack']);if(_0x513c7a[_0x7df5('0x2d')]){delete _0x513c7a[_0x7df5('0x2d')];}_0x5c1795[_0x7df5('0x1d')](_0xb21710)[_0x7df5('0x2e')](_0x513c7a);};}exports[_0x7df5('0x2f')]=function(_0x17f20f,_0x14de81){var _0x3b5f38={},_0x40b34c={},_0x20547b={'count':0x0,'rows':[]};var _0x15ccfd=_[_0x7df5('0x30')](db[_0x7df5('0x31')][_0x7df5('0x32')],function(_0x4f0b79){return{'name':_0x4f0b79[_0x7df5('0x33')],'type':_0x4f0b79['type'][_0x7df5('0x34')]};});_0x40b34c['model']=_['map'](_0x15ccfd,_0x7df5('0x2d'));_0x40b34c[_0x7df5('0x35')]=_['keys'](_0x17f20f['query']);_0x40b34c[_0x7df5('0x36')]=_[_0x7df5('0x37')](_0x40b34c[_0x7df5('0x38')],_0x40b34c[_0x7df5('0x35')]);_0x3b5f38['attributes']=_['intersection'](_0x40b34c[_0x7df5('0x38')],qs[_0x7df5('0x39')](_0x17f20f[_0x7df5('0x35')]['fields']));_0x3b5f38['attributes']=_0x3b5f38[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x3b5f38[_0x7df5('0x3a')]:_0x40b34c[_0x7df5('0x38')];if(!_0x17f20f[_0x7df5('0x35')][_0x7df5('0x3c')](_0x7df5('0x3d'))){_0x3b5f38[_0x7df5('0x22')]=qs[_0x7df5('0x22')](_0x17f20f[_0x7df5('0x35')]['limit']);_0x3b5f38[_0x7df5('0x20')]=qs['offset'](_0x17f20f[_0x7df5('0x35')]['offset']);}_0x3b5f38[_0x7df5('0x3e')]=qs[_0x7df5('0x3f')](_0x17f20f[_0x7df5('0x35')][_0x7df5('0x3f')]);_0x3b5f38[_0x7df5('0x40')]=qs[_0x7df5('0x36')](_[_0x7df5('0x41')](_0x17f20f[_0x7df5('0x35')],_0x40b34c[_0x7df5('0x36')]),_0x15ccfd);if(_0x17f20f[_0x7df5('0x35')][_0x7df5('0x42')]){_0x3b5f38[_0x7df5('0x40')]=_['merge'](_0x3b5f38[_0x7df5('0x40')],{'$or':_[_0x7df5('0x30')](_0x15ccfd,function(_0x54dbea){if(_0x54dbea['type']!==_0x7df5('0x43')){var _0x3680bc={};_0x3680bc[_0x54dbea['name']]={'$like':'%'+_0x17f20f[_0x7df5('0x35')]['filter']+'%'};return _0x3680bc;}})});}_0x3b5f38=_[_0x7df5('0x44')]({},_0x3b5f38,_0x17f20f[_0x7df5('0x45')]);var _0x113d2d={'where':_0x3b5f38['where']};return db[_0x7df5('0x31')][_0x7df5('0x23')](_0x113d2d)['then'](function(_0x251dc3){_0x20547b[_0x7df5('0x23')]=_0x251dc3;if(_0x17f20f[_0x7df5('0x35')][_0x7df5('0x46')]){_0x3b5f38[_0x7df5('0x47')]=[{'all':!![]}];}return db[_0x7df5('0x31')][_0x7df5('0x48')](_0x3b5f38);})[_0x7df5('0x2a')](function(_0x38feff){_0x20547b[_0x7df5('0x49')]=_0x38feff;return _0x20547b;})[_0x7df5('0x2a')](respondWithFilteredResult(_0x14de81,_0x3b5f38))[_0x7df5('0x4a')](handleError(_0x14de81,null));};exports[_0x7df5('0x4b')]=function(_0x593b3e,_0xfc9af9){var _0x1caba4={'raw':!![],'where':{'id':_0x593b3e[_0x7df5('0x4c')]['id']}},_0x14a339={};_0x14a339[_0x7df5('0x38')]=_['keys'](db[_0x7df5('0x31')][_0x7df5('0x32')]);_0x14a339[_0x7df5('0x35')]=_['keys'](_0x593b3e[_0x7df5('0x35')]);_0x14a339[_0x7df5('0x36')]=_['intersection'](_0x14a339[_0x7df5('0x38')],_0x14a339[_0x7df5('0x35')]);_0x1caba4[_0x7df5('0x3a')]=_[_0x7df5('0x37')](_0x14a339[_0x7df5('0x38')],qs[_0x7df5('0x39')](_0x593b3e[_0x7df5('0x35')][_0x7df5('0x39')]));_0x1caba4[_0x7df5('0x3a')]=_0x1caba4[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x1caba4[_0x7df5('0x3a')]:_0x14a339[_0x7df5('0x38')];if(_0x593b3e[_0x7df5('0x35')][_0x7df5('0x46')]){_0x1caba4['include']=[{'all':!![]}];}_0x1caba4=_[_0x7df5('0x44')]({},_0x1caba4,_0x593b3e[_0x7df5('0x45')]);return db[_0x7df5('0x31')][_0x7df5('0x4d')](_0x1caba4)[_0x7df5('0x2a')](handleEntityNotFound(_0xfc9af9,null))[_0x7df5('0x2a')](respondWithResult(_0xfc9af9,null))[_0x7df5('0x4a')](handleError(_0xfc9af9,null));};exports[_0x7df5('0x4e')]=function(_0x1e0c84,_0xc3d37a){return db[_0x7df5('0x31')][_0x7df5('0x4e')](_0x1e0c84['body'],{})[_0x7df5('0x2a')](respondWithResult(_0xc3d37a,0xc9))['catch'](handleError(_0xc3d37a,null));};exports[_0x7df5('0x29')]=function(_0x401360,_0x4ab37c){if(_0x401360[_0x7df5('0x4f')]['id']){delete _0x401360['body']['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x401360[_0x7df5('0x4c')]['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x4ab37c,null))['then'](saveUpdates(_0x401360[_0x7df5('0x4f')],null))['then'](respondWithResult(_0x4ab37c,null))[_0x7df5('0x4a')](handleError(_0x4ab37c,null));};exports[_0x7df5('0x50')]=function(_0x281a0d,_0x11c812){return db[_0x7df5('0x31')][_0x7df5('0x4d')]({'where':{'id':_0x281a0d[_0x7df5('0x4c')]['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x11c812,null))[_0x7df5('0x2a')](removeEntity(_0x11c812,null))[_0x7df5('0x4a')](handleError(_0x11c812,null));};exports[_0x7df5('0x51')]=function(_0x2e39a0,_0x30108b){return db['JscriptySessionReport'][_0x7df5('0x51')]()[_0x7df5('0x2a')](respondWithResult(_0x30108b,null))[_0x7df5('0x4a')](handleError(_0x30108b,null));};exports[_0x7df5('0x52')]=function(_0x2fb122,_0x2774fa,_0x156114){var _0x32e2c0={'raw':!![],'where':{}};var _0x2491ad={};var _0x4e118e={'count':0x0,'rows':[]};return db[_0x7df5('0x31')][_0x7df5('0x53')]({'where':{'id':_0x2fb122['params']['id']}})[_0x7df5('0x2a')](handleEntityNotFound(_0x2774fa,null))[_0x7df5('0x2a')](function(_0x145b18){if(_0x145b18){_0x2491ad['model']=_['keys'](db['JscriptyQuestionReport'][_0x7df5('0x32')]);_0x2491ad['query']=_[_0x7df5('0x54')](_0x2fb122['query']);_0x2491ad['filters']=_[_0x7df5('0x37')](_0x2491ad['model'],_0x2491ad[_0x7df5('0x35')]);_0x32e2c0['attributes']=_[_0x7df5('0x37')](_0x2491ad['model'],qs[_0x7df5('0x39')](_0x2fb122['query'][_0x7df5('0x39')]));_0x32e2c0[_0x7df5('0x3a')]=_0x32e2c0[_0x7df5('0x3a')][_0x7df5('0x3b')]?_0x32e2c0[_0x7df5('0x3a')]:_0x2491ad[_0x7df5('0x38')];if(!_0x2fb122[_0x7df5('0x35')][_0x7df5('0x3c')]('nolimit')){_0x32e2c0[_0x7df5('0x22')]=qs[_0x7df5('0x22')](_0x2fb122[_0x7df5('0x35')][_0x7df5('0x22')]);_0x32e2c0[_0x7df5('0x20')]=qs[_0x7df5('0x20')](_0x2fb122[_0x7df5('0x35')][_0x7df5('0x20')]);}_0x32e2c0[_0x7df5('0x3e')]=qs['sort'](_0x2fb122['query'][_0x7df5('0x3f')]);_0x32e2c0[_0x7df5('0x40')]=qs[_0x7df5('0x36')](_[_0x7df5('0x41')](_0x2fb122['query'],_0x2491ad[_0x7df5('0x36')]));_0x32e2c0[_0x7df5('0x40')]['SessionId']=_0x145b18['id'];if(_0x2fb122[_0x7df5('0x35')][_0x7df5('0x42')]){_0x32e2c0[_0x7df5('0x40')]=_[_0x7df5('0x44')](_0x32e2c0[_0x7df5('0x40')],{'$or':_[_0x7df5('0x30')](_0x32e2c0[_0x7df5('0x3a')],function(_0x24674e){var _0x5206d2={};_0x5206d2[_0x24674e]={'$like':'%'+_0x2fb122[_0x7df5('0x35')][_0x7df5('0x42')]+'%'};return _0x5206d2;})});}_0x32e2c0=_[_0x7df5('0x44')]({},_0x32e2c0,_0x2fb122['options']);return db['JscriptyQuestionReport']['count']({'where':_0x32e2c0[_0x7df5('0x40')]})[_0x7df5('0x2a')](function(_0x47c377){_0x4e118e[_0x7df5('0x23')]=_0x47c377;if(_0x2fb122[_0x7df5('0x35')][_0x7df5('0x46')]){_0x32e2c0[_0x7df5('0x47')]=[{'all':!![]}];}return db[_0x7df5('0x55')]['findAll'](_0x32e2c0);})['then'](function(_0x353089){_0x4e118e[_0x7df5('0x49')]=_0x353089;return _0x4e118e;});}})['then'](respondWithFilteredResult(_0x2774fa,_0x32e2c0))[_0x7df5('0x4a')](handleError(_0x2774fa,null));}; \ No newline at end of file +var _0x83f5=['model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','update','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key'];(function(_0x586a4c,_0x2dc27e){var _0x48879c=function(_0x4dc593){while(--_0x4dc593){_0x586a4c['push'](_0x586a4c['shift']());}};_0x48879c(++_0x2dc27e);}(_0x83f5,0x77));var _0x583f=function(_0x3b07df,_0x5b3766){_0x3b07df=_0x3b07df-0x0;var _0x3ce3c8=_0x83f5[_0x3b07df];return _0x3ce3c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x583f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x583f('0x1'));var rp=require(_0x583f('0x2'));var moment=require(_0x583f('0x3'));var BPromise=require(_0x583f('0x4'));var Mustache=require(_0x583f('0x5'));var util=require(_0x583f('0x6'));var path=require(_0x583f('0x7'));var sox=require(_0x583f('0x8'));var csv=require(_0x583f('0x9'));var ejs=require(_0x583f('0xa'));var fs=require('fs');var fs_extra=require(_0x583f('0xb'));var _=require(_0x583f('0xc'));var squel=require(_0x583f('0xd'));var crypto=require(_0x583f('0xe'));var jsforce=require(_0x583f('0xf'));var deskjs=require(_0x583f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x583f('0x11'));var Papa=require(_0x583f('0x12'));var Redis=require(_0x583f('0x13'));var authService=require(_0x583f('0x14'));var qs=require(_0x583f('0x15'));var as=require(_0x583f('0x16'));var hardwareService=require(_0x583f('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x583f('0x18'))['db'];function respondWithStatusCode(_0x2961a8,_0x18ffca){_0x18ffca=_0x18ffca||0xcc;return function(_0x523fe0){if(_0x523fe0){return _0x2961a8[_0x583f('0x19')](_0x18ffca);}return _0x2961a8[_0x583f('0x1a')](_0x18ffca)['end']();};}function respondWithResult(_0x3dc85d,_0x547959){_0x547959=_0x547959||0xc8;return function(_0x2b3f41){if(_0x2b3f41){return _0x3dc85d[_0x583f('0x1a')](_0x547959)['json'](_0x2b3f41);}};}function respondWithFilteredResult(_0x506ed3,_0x868e34){return function(_0x298e67){if(_0x298e67){var _0x108fcb=typeof _0x868e34['offset']===_0x583f('0x1b')&&typeof _0x868e34[_0x583f('0x1c')]===_0x583f('0x1b');var _0x40adf8=_0x298e67[_0x583f('0x1d')];var _0x159e69=_0x108fcb?0x0:_0x868e34[_0x583f('0x1e')];var _0x3b6fd8=_0x108fcb?_0x298e67[_0x583f('0x1d')]:_0x868e34['offset']+_0x868e34[_0x583f('0x1c')];var _0x3bbd9a;if(_0x3b6fd8>=_0x40adf8){_0x3b6fd8=_0x40adf8;_0x3bbd9a=0xc8;}else{_0x3bbd9a=0xce;}_0x506ed3[_0x583f('0x1a')](_0x3bbd9a);return _0x506ed3[_0x583f('0x1f')]('Content-Range',_0x159e69+'-'+_0x3b6fd8+'/'+_0x40adf8)[_0x583f('0x20')](_0x298e67);}return null;};}function patchUpdates(_0x18e7d3){return function(_0x4a1ba5){try{jsonpatch[_0x583f('0x21')](_0x4a1ba5,_0x18e7d3,!![]);}catch(_0x3a4822){return BPromise[_0x583f('0x22')](_0x3a4822);}return _0x4a1ba5[_0x583f('0x23')]();};}function saveUpdates(_0x1b76d7,_0x16afda){return function(_0xacd80f){if(_0xacd80f){return _0xacd80f['update'](_0x1b76d7)['then'](function(_0x4a19a9){return _0x4a19a9;});}return null;};}function removeEntity(_0x1c008e,_0x539f20){return function(_0xdd78ca){if(_0xdd78ca){return _0xdd78ca[_0x583f('0x24')]()[_0x583f('0x25')](function(){_0x1c008e['status'](0xcc)[_0x583f('0x26')]();});}};}function handleEntityNotFound(_0x47f4b5,_0x474388){return function(_0x5400ba){if(!_0x5400ba){_0x47f4b5['sendStatus'](0x194);}return _0x5400ba;};}function handleError(_0x305f04,_0x465e9d){_0x465e9d=_0x465e9d||0x1f4;return function(_0x456d17){logger[_0x583f('0x27')](_0x456d17[_0x583f('0x28')]);if(_0x456d17[_0x583f('0x29')]){delete _0x456d17[_0x583f('0x29')];}_0x305f04[_0x583f('0x1a')](_0x465e9d)[_0x583f('0x2a')](_0x456d17);};}exports[_0x583f('0x2b')]=function(_0x1ba669,_0x4f4fc2){var _0x374bec={},_0x300df5={},_0x288c8e={'count':0x0,'rows':[]};var _0x34c5e6=_[_0x583f('0x2c')](db[_0x583f('0x2d')]['rawAttributes'],function(_0x3da8e6){return{'name':_0x3da8e6[_0x583f('0x2e')],'type':_0x3da8e6[_0x583f('0x2f')][_0x583f('0x30')]};});_0x300df5[_0x583f('0x31')]=_[_0x583f('0x2c')](_0x34c5e6,_0x583f('0x29'));_0x300df5[_0x583f('0x32')]=_[_0x583f('0x33')](_0x1ba669[_0x583f('0x32')]);_0x300df5['filters']=_[_0x583f('0x34')](_0x300df5[_0x583f('0x31')],_0x300df5['query']);_0x374bec['attributes']=_[_0x583f('0x34')](_0x300df5['model'],qs[_0x583f('0x35')](_0x1ba669['query']['fields']));_0x374bec[_0x583f('0x36')]=_0x374bec[_0x583f('0x36')]['length']?_0x374bec['attributes']:_0x300df5['model'];if(!_0x1ba669['query'][_0x583f('0x37')](_0x583f('0x38'))){_0x374bec[_0x583f('0x1c')]=qs['limit'](_0x1ba669[_0x583f('0x32')]['limit']);_0x374bec['offset']=qs[_0x583f('0x1e')](_0x1ba669[_0x583f('0x32')][_0x583f('0x1e')]);}_0x374bec['order']=qs[_0x583f('0x39')](_0x1ba669[_0x583f('0x32')][_0x583f('0x39')]);_0x374bec[_0x583f('0x3a')]=qs[_0x583f('0x3b')](_[_0x583f('0x3c')](_0x1ba669[_0x583f('0x32')],_0x300df5['filters']),_0x34c5e6);if(_0x1ba669[_0x583f('0x32')][_0x583f('0x3d')]){_0x374bec[_0x583f('0x3a')]=_[_0x583f('0x3e')](_0x374bec[_0x583f('0x3a')],{'$or':_[_0x583f('0x2c')](_0x34c5e6,function(_0x59b56b){if(_0x59b56b['type']!==_0x583f('0x3f')){var _0x3751f6={};_0x3751f6[_0x59b56b[_0x583f('0x29')]]={'$like':'%'+_0x1ba669['query'][_0x583f('0x3d')]+'%'};return _0x3751f6;}})});}_0x374bec=_[_0x583f('0x3e')]({},_0x374bec,_0x1ba669[_0x583f('0x40')]);var _0x58938f={'where':_0x374bec[_0x583f('0x3a')]};return db['JscriptySessionReport'][_0x583f('0x1d')](_0x58938f)[_0x583f('0x25')](function(_0x349aef){_0x288c8e[_0x583f('0x1d')]=_0x349aef;if(_0x1ba669[_0x583f('0x32')][_0x583f('0x41')]){_0x374bec[_0x583f('0x42')]=[{'all':!![]}];}return db[_0x583f('0x2d')][_0x583f('0x43')](_0x374bec);})['then'](function(_0x22ed39){_0x288c8e[_0x583f('0x44')]=_0x22ed39;return _0x288c8e;})[_0x583f('0x25')](respondWithFilteredResult(_0x4f4fc2,_0x374bec))[_0x583f('0x45')](handleError(_0x4f4fc2,null));};exports[_0x583f('0x46')]=function(_0x5e3411,_0x1967fb){var _0x423191={'raw':!![],'where':{'id':_0x5e3411['params']['id']}},_0xeef59a={};_0xeef59a[_0x583f('0x31')]=_[_0x583f('0x33')](db[_0x583f('0x2d')][_0x583f('0x47')]);_0xeef59a[_0x583f('0x32')]=_['keys'](_0x5e3411[_0x583f('0x32')]);_0xeef59a['filters']=_[_0x583f('0x34')](_0xeef59a['model'],_0xeef59a[_0x583f('0x32')]);_0x423191['attributes']=_[_0x583f('0x34')](_0xeef59a[_0x583f('0x31')],qs['fields'](_0x5e3411['query'][_0x583f('0x35')]));_0x423191['attributes']=_0x423191[_0x583f('0x36')][_0x583f('0x48')]?_0x423191['attributes']:_0xeef59a[_0x583f('0x31')];if(_0x5e3411['query']['includeAll']){_0x423191[_0x583f('0x42')]=[{'all':!![]}];}_0x423191=_[_0x583f('0x3e')]({},_0x423191,_0x5e3411['options']);return db[_0x583f('0x2d')][_0x583f('0x49')](_0x423191)[_0x583f('0x25')](handleEntityNotFound(_0x1967fb,null))[_0x583f('0x25')](respondWithResult(_0x1967fb,null))['catch'](handleError(_0x1967fb,null));};exports[_0x583f('0x4a')]=function(_0x53fa15,_0x4880f4){return db[_0x583f('0x2d')][_0x583f('0x4a')](_0x53fa15['body'],{})[_0x583f('0x25')](respondWithResult(_0x4880f4,0xc9))[_0x583f('0x45')](handleError(_0x4880f4,null));};exports[_0x583f('0x4b')]=function(_0x3aa623,_0x2ef1ab){if(_0x3aa623[_0x583f('0x4c')]['id']){delete _0x3aa623[_0x583f('0x4c')]['id'];}return db[_0x583f('0x2d')]['find']({'where':{'id':_0x3aa623[_0x583f('0x4d')]['id']}})[_0x583f('0x25')](handleEntityNotFound(_0x2ef1ab,null))[_0x583f('0x25')](saveUpdates(_0x3aa623[_0x583f('0x4c')],null))['then'](respondWithResult(_0x2ef1ab,null))[_0x583f('0x45')](handleError(_0x2ef1ab,null));};exports['destroy']=function(_0x599972,_0x217f1a){return db[_0x583f('0x2d')]['find']({'where':{'id':_0x599972[_0x583f('0x4d')]['id']}})[_0x583f('0x25')](handleEntityNotFound(_0x217f1a,null))[_0x583f('0x25')](removeEntity(_0x217f1a,null))['catch'](handleError(_0x217f1a,null));};exports['describe']=function(_0x565054,_0x4d8997){return db[_0x583f('0x2d')][_0x583f('0x4e')]()['then'](respondWithResult(_0x4d8997,null))[_0x583f('0x45')](handleError(_0x4d8997,null));};exports[_0x583f('0x4f')]=function(_0x4c9615,_0x2388b7,_0x644c62){var _0x24a496={'raw':!![],'where':{}};var _0x2fc041={};var _0x386dcd={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x583f('0x50')]({'where':{'id':_0x4c9615[_0x583f('0x4d')]['id']}})[_0x583f('0x25')](handleEntityNotFound(_0x2388b7,null))[_0x583f('0x25')](function(_0x10e746){if(_0x10e746){_0x2fc041[_0x583f('0x31')]=_[_0x583f('0x33')](db[_0x583f('0x51')]['rawAttributes']);_0x2fc041[_0x583f('0x32')]=_['keys'](_0x4c9615[_0x583f('0x32')]);_0x2fc041[_0x583f('0x3b')]=_[_0x583f('0x34')](_0x2fc041[_0x583f('0x31')],_0x2fc041[_0x583f('0x32')]);_0x24a496[_0x583f('0x36')]=_[_0x583f('0x34')](_0x2fc041[_0x583f('0x31')],qs['fields'](_0x4c9615[_0x583f('0x32')]['fields']));_0x24a496[_0x583f('0x36')]=_0x24a496[_0x583f('0x36')][_0x583f('0x48')]?_0x24a496['attributes']:_0x2fc041[_0x583f('0x31')];if(!_0x4c9615[_0x583f('0x32')][_0x583f('0x37')](_0x583f('0x38'))){_0x24a496[_0x583f('0x1c')]=qs['limit'](_0x4c9615['query'][_0x583f('0x1c')]);_0x24a496[_0x583f('0x1e')]=qs['offset'](_0x4c9615[_0x583f('0x32')][_0x583f('0x1e')]);}_0x24a496[_0x583f('0x52')]=qs[_0x583f('0x39')](_0x4c9615[_0x583f('0x32')][_0x583f('0x39')]);_0x24a496[_0x583f('0x3a')]=qs[_0x583f('0x3b')](_[_0x583f('0x3c')](_0x4c9615[_0x583f('0x32')],_0x2fc041['filters']));_0x24a496[_0x583f('0x3a')][_0x583f('0x53')]=_0x10e746['id'];if(_0x4c9615['query']['filter']){_0x24a496[_0x583f('0x3a')]=_[_0x583f('0x3e')](_0x24a496[_0x583f('0x3a')],{'$or':_[_0x583f('0x2c')](_0x24a496[_0x583f('0x36')],function(_0x24ea59){var _0x3ac503={};_0x3ac503[_0x24ea59]={'$like':'%'+_0x4c9615[_0x583f('0x32')][_0x583f('0x3d')]+'%'};return _0x3ac503;})});}_0x24a496=_['merge']({},_0x24a496,_0x4c9615[_0x583f('0x40')]);return db[_0x583f('0x51')][_0x583f('0x1d')]({'where':_0x24a496[_0x583f('0x3a')]})[_0x583f('0x25')](function(_0x43bf7c){_0x386dcd[_0x583f('0x1d')]=_0x43bf7c;if(_0x4c9615[_0x583f('0x32')][_0x583f('0x41')]){_0x24a496[_0x583f('0x42')]=[{'all':!![]}];}return db[_0x583f('0x51')][_0x583f('0x43')](_0x24a496);})['then'](function(_0x4a796a){_0x386dcd['rows']=_0x4a796a;return _0x386dcd;});}})['then'](respondWithFilteredResult(_0x2388b7,_0x24a496))[_0x583f('0x45')](handleError(_0x2388b7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1c118b1..e939dab 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0x28b848,_0x1089e9){var _0x349489=function(_0x117858){while(--_0x117858){_0x28b848['push'](_0x28b848['shift']());}};_0x349489(++_0x1089e9);}(_0x1261,0x144));var _0x1126=function(_0x5bf609,_0x5c1e35){_0x5bf609=_0x5bf609-0x0;var _0x3c3a74=_0x1261[_0x5bf609];return _0x3c3a74;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash'];(function(_0x2ec06a,_0x2acc90){var _0x36a750=function(_0x340d31){while(--_0x340d31){_0x2ec06a['push'](_0x2ec06a['shift']());}};_0x36a750(++_0x2acc90);}(_0x5496,0x175));var _0x6549=function(_0x82e3c2,_0x310827){_0x82e3c2=_0x82e3c2-0x0;var _0x4b1907=_0x5496[_0x82e3c2];return _0x4b1907;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f508db0..4bb98d7 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 _0xe2fe=['then','info','JscriptySessionReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4d6ff0,_0x1913bd){var _0x51bdb9=function(_0xd6983e){while(--_0xd6983e){_0x4d6ff0['push'](_0x4d6ff0['shift']());}};_0x51bdb9(++_0x1913bd);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x6343=['message','result','catch','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x22d77e,_0x28fe69){var _0x713b4=function(_0x295cba){while(--_0x295cba){_0x22d77e['push'](_0x22d77e['shift']());}};_0x713b4(++_0x28fe69);}(_0x6343,0x168));var _0x3634=function(_0x2429ae,_0x173dcf){_0x2429ae=_0x2429ae-0x0;var _0x24260f=_0x6343[_0x2429ae];return _0x24260f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));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(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('JscriptySessionReport,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index c41c768..cf03708 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 _0x6615=['./license.controller','index','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x5550c6,_0x278e80){var _0x2b21f8=function(_0x3f57e2){while(--_0x3f57e2){_0x5550c6['push'](_0x5550c6['shift']());}};_0x2b21f8(++_0x278e80);}(_0x6615,0x8f));var _0x5661=function(_0x5d2637,_0x4de66a){_0x5d2637=_0x5d2637-0x0;var _0x197d8d=_0x6615[_0x5d2637];return _0x197d8d;};'use strict';var multer=require(_0x5661('0x0'));var util=require(_0x5661('0x1'));var path=require('path');var timeout=require(_0x5661('0x2'));var express=require(_0x5661('0x3'));var router=express[_0x5661('0x4')]();var fs_extra=require(_0x5661('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5661('0x6'));var controller=require(_0x5661('0x7'));router['get']('/',controller[_0x5661('0x8')]);router[_0x5661('0x9')](_0x5661('0xa'),auth['isAuthenticated'](),controller[_0x5661('0xb')]);router['get'](_0x5661('0xc'),auth[_0x5661('0xd')](),controller[_0x5661('0xe')]);module['exports']=router; \ No newline at end of file +var _0x07ce=['express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07ce,0x152));var _0xe07c=function(_0x197ef2,_0x2e405d){_0x197ef2=_0x197ef2-0x0;var _0x3446cf=_0x07ce[_0x197ef2];return _0x3446cf;};'use strict';var multer=require(_0xe07c('0x0'));var util=require(_0xe07c('0x1'));var path=require(_0xe07c('0x2'));var timeout=require(_0xe07c('0x3'));var express=require(_0xe07c('0x4'));var router=express[_0xe07c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe07c('0x6'));var interaction=require(_0xe07c('0x7'));var config=require('../../config/environment');var controller=require(_0xe07c('0x8'));router[_0xe07c('0x9')]('/',controller[_0xe07c('0xa')]);router[_0xe07c('0xb')](_0xe07c('0xc'),auth[_0xe07c('0xd')](),controller[_0xe07c('0xe')]);router[_0xe07c('0x9')](_0xe07c('0xf'),auth[_0xe07c('0xd')](),controller[_0xe07c('0x10')]);module[_0xe07c('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3f65fb2..3f52df1 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 _0x566c=['sequelize','exports','TEXT','STRING'];(function(_0x3c66c0,_0x1d8a47){var _0x18c29f=function(_0x5c47a1){while(--_0x5c47a1){_0x3c66c0['push'](_0x3c66c0['shift']());}};_0x18c29f(++_0x1d8a47);}(_0x566c,0x164));var _0xc566=function(_0x5b2078,_0x2e6cd0){_0x5b2078=_0x5b2078-0x0;var _0x4180cf=_0x566c[_0x5b2078];return _0x4180cf;};'use strict';var Sequelize=require(_0xc566('0x0'));module[_0xc566('0x1')]={'license':{'type':Sequelize[_0xc566('0x2')]},'data1':{'type':Sequelize[_0xc566('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xab32=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x2fc257,_0x11cc98){var _0x2ddfd4=function(_0x448193){while(--_0x448193){_0x2fc257['push'](_0x2fc257['shift']());}};_0x2ddfd4(++_0x11cc98);}(_0xab32,0x194));var _0x2ab3=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xab32[_0x1bc0ae];return _0x501104;};'use strict';var Sequelize=require(_0x2ab3('0x0'));module[_0x2ab3('0x1')]={'license':{'type':Sequelize[_0x2ab3('0x2')]},'data1':{'type':Sequelize[_0x2ab3('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x2ab3('0x4')],'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 095e380..4f1ecef 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 _0x188d=['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/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','getLicense','catch','body','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x4a9de7,_0x24c8e8){var _0x4a7054=function(_0x823812){while(--_0x823812){_0x4a9de7['push'](_0x4a9de7['shift']());}};_0x4a7054(++_0x24c8e8);}(_0x188d,0x173));var _0xd188=function(_0xc7ed29,_0x515330){_0xc7ed29=_0xc7ed29-0x0;var _0xf8da19=_0x188d[_0xc7ed29];return _0xf8da19;};'use strict';var emlformat=require(_0xd188('0x0'));var rimraf=require(_0xd188('0x1'));var zipdir=require(_0xd188('0x2'));var jsonpatch=require(_0xd188('0x3'));var rp=require(_0xd188('0x4'));var moment=require(_0xd188('0x5'));var BPromise=require(_0xd188('0x6'));var Mustache=require(_0xd188('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd188('0x8'));var csv=require(_0xd188('0x9'));var ejs=require(_0xd188('0xa'));var fs=require('fs');var fs_extra=require(_0xd188('0xb'));var _=require(_0xd188('0xc'));var squel=require(_0xd188('0xd'));var crypto=require(_0xd188('0xe'));var jsforce=require(_0xd188('0xf'));var deskjs=require(_0xd188('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd188('0x11'));var Redis=require(_0xd188('0x12'));var authService=require(_0xd188('0x13'));var qs=require(_0xd188('0x14'));var as=require(_0xd188('0x15'));var hardwareService=require(_0xd188('0x16'));var logger=require(_0xd188('0x17'))(_0xd188('0x18'));var utils=require(_0xd188('0x19'));var config=require(_0xd188('0x1a'));var licenseUtil=require(_0xd188('0x1b'));var db=require(_0xd188('0x1c'))['db'];function respondWithStatusCode(_0x2bdf5b,_0x4b929e){_0x4b929e=_0x4b929e||0xcc;return function(_0x44240a){if(_0x44240a){return _0x2bdf5b['sendStatus'](_0x4b929e);}return _0x2bdf5b[_0xd188('0x1d')](_0x4b929e)[_0xd188('0x1e')]();};}function respondWithResult(_0x4b43aa,_0x1aae4e){_0x1aae4e=_0x1aae4e||0xc8;return function(_0x5ee234){if(_0x5ee234){return _0x4b43aa[_0xd188('0x1d')](_0x1aae4e)[_0xd188('0x1f')](_0x5ee234);}};}function respondWithFilteredResult(_0x4c54a1,_0x1e591e){return function(_0x146b89){if(_0x146b89){var _0x17c2c6=typeof _0x1e591e['offset']===_0xd188('0x20')&&typeof _0x1e591e[_0xd188('0x21')]===_0xd188('0x20');var _0x4340eb=_0x146b89['count'];var _0x3c1f60=_0x17c2c6?0x0:_0x1e591e[_0xd188('0x22')];var _0x9d6e82=_0x17c2c6?_0x146b89[_0xd188('0x23')]:_0x1e591e[_0xd188('0x22')]+_0x1e591e[_0xd188('0x21')];var _0x2d2f3b;if(_0x9d6e82>=_0x4340eb){_0x9d6e82=_0x4340eb;_0x2d2f3b=0xc8;}else{_0x2d2f3b=0xce;}_0x4c54a1['status'](_0x2d2f3b);return _0x4c54a1[_0xd188('0x24')](_0xd188('0x25'),_0x3c1f60+'-'+_0x9d6e82+'/'+_0x4340eb)[_0xd188('0x1f')](_0x146b89);}return null;};}function patchUpdates(_0x5a051c){return function(_0x20c55d){try{jsonpatch[_0xd188('0x26')](_0x20c55d,_0x5a051c,!![]);}catch(_0xa35928){return BPromise[_0xd188('0x27')](_0xa35928);}return _0x20c55d[_0xd188('0x28')]();};}function saveUpdates(_0x196184,_0x1607e3){return function(_0x1a9d9f){if(_0x1a9d9f){return _0x1a9d9f[_0xd188('0x29')](_0x196184)[_0xd188('0x2a')](function(_0x57b1e8){return _0x57b1e8;});}return null;};}function removeEntity(_0x315314,_0x3ef04a){return function(_0xf93fc4){if(_0xf93fc4){return _0xf93fc4[_0xd188('0x2b')]()['then'](function(){_0x315314[_0xd188('0x1d')](0xcc)[_0xd188('0x1e')]();});}};}function handleEntityNotFound(_0x5d872d,_0x99e340){return function(_0x1bbfe5){if(!_0x1bbfe5){_0x5d872d[_0xd188('0x2c')](0x194);}return _0x1bbfe5;};}function handleError(_0x3eb366,_0xba36f5){_0xba36f5=_0xba36f5||0x1f4;return function(_0x4f7de9){logger[_0xd188('0x2d')](_0x4f7de9['stack']);if(_0x4f7de9[_0xd188('0x2e')]){delete _0x4f7de9['name'];}_0x3eb366[_0xd188('0x1d')](_0xba36f5)['send'](_0x4f7de9);};}var utilLicense=require(_0xd188('0x1b'));exports[_0xd188('0x2f')]=function(_0x3e683b,_0x329580){var _0x2628c6={'raw':!![],'where':{'id':0x1}},_0x58fe1a={};_0x58fe1a[_0xd188('0x30')]=_[_0xd188('0x31')](db[_0xd188('0x32')][_0xd188('0x33')]);_0x58fe1a[_0xd188('0x34')]=_[_0xd188('0x31')](_0x3e683b[_0xd188('0x34')]);_0x58fe1a['filters']=_[_0xd188('0x35')](_0x58fe1a[_0xd188('0x30')],_0x58fe1a[_0xd188('0x34')]);_0x2628c6[_0xd188('0x36')]=_[_0xd188('0x35')](_0x58fe1a[_0xd188('0x30')],qs['fields'](_0x3e683b[_0xd188('0x34')][_0xd188('0x37')]));_0x2628c6['attributes']=_0x2628c6[_0xd188('0x36')][_0xd188('0x38')]?_0x2628c6[_0xd188('0x36')]:_0x58fe1a[_0xd188('0x30')];_0x2628c6=_[_0xd188('0x39')]({},_0x2628c6,_0x3e683b[_0xd188('0x3a')]);return utilLicense[_0xd188('0x3b')](_0x2628c6)[_0xd188('0x2a')](respondWithResult(_0x329580,null))[_0xd188('0x3c')](handleError(_0x329580,null));};exports['update']=function(_0x586ff0,_0x7df5f6){if(_0x586ff0[_0xd188('0x3d')]['id']){delete _0x586ff0[_0xd188('0x3d')]['id'];}return db[_0xd188('0x32')]['find']({'where':{'id':_0x586ff0['params']['id']}})[_0xd188('0x2a')](handleEntityNotFound(_0x7df5f6,null))[_0xd188('0x2a')](function(_0x5036c0){var _0xc03e29=_0x5036c0[_0xd188('0x3e')]({'plain':!![]});return utilLicense[_0xd188('0x3f')](_0xc03e29,_0x586ff0[_0xd188('0x3d')][_0xd188('0x40')]);})[_0xd188('0x2a')](function(_0x495841){if(!_0x495841['demo']){return saveUpdates(_0x586ff0['body'],null);}return _0x495841;})['then'](respondWithResult(_0x7df5f6,null))['catch'](handleError(_0x7df5f6,null));};exports[_0xd188('0x41')]=function(_0x3a24e4,_0x234e4d){var _0x157c71=_0xd188('0x42');var _0x1c390f=path[_0xd188('0x43')](_0xd188('0x44'),_0xd188('0x45'),_0xd188('0x46'),_0x157c71);_0x234e4d[_0xd188('0x47')](_0xd188('0x48'),_0xd188('0x49')+_0x157c71);_0x234e4d[_0xd188('0x24')](_0xd188('0x4a'),'text/plain');_0x234e4d[_0xd188('0x4b')](_0x1c390f);}; \ No newline at end of file +var _0xd121=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','save','destroy','then','end','error','stack','name','send','../../config/license/util','index','model','rawAttributes','query','filters','intersection','attributes','fields','getLicense','update','body','License','find','get','checkLicense','key','downloadLogFile','license-info.log','/var','log','xcally','attachment;\x20filename=','set','download','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x263a8a,_0x5c088d){var _0x226a79=function(_0x53a7d1){while(--_0x53a7d1){_0x263a8a['push'](_0x263a8a['shift']());}};_0x226a79(++_0x5c088d);}(_0xd121,0x1b2));var _0x1d12=function(_0x49beef,_0x42b896){_0x49beef=_0x49beef-0x0;var _0x58d669=_0xd121[_0x49beef];return _0x58d669;};'use strict';var emlformat=require(_0x1d12('0x0'));var rimraf=require(_0x1d12('0x1'));var zipdir=require(_0x1d12('0x2'));var jsonpatch=require(_0x1d12('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d12('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1d12('0x5'));var csv=require(_0x1d12('0x6'));var ejs=require(_0x1d12('0x7'));var fs=require('fs');var fs_extra=require(_0x1d12('0x8'));var _=require(_0x1d12('0x9'));var squel=require(_0x1d12('0xa'));var crypto=require(_0x1d12('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1d12('0xc'));var toCsv=require(_0x1d12('0x6'));var querystring=require(_0x1d12('0xd'));var Papa=require(_0x1d12('0xe'));var Redis=require(_0x1d12('0xf'));var authService=require(_0x1d12('0x10'));var qs=require(_0x1d12('0x11'));var as=require(_0x1d12('0x12'));var hardwareService=require(_0x1d12('0x13'));var logger=require(_0x1d12('0x14'))(_0x1d12('0x15'));var utils=require('../../config/utils');var config=require(_0x1d12('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d12('0x17'))['db'];function respondWithStatusCode(_0x53371a,_0x5dda44){_0x5dda44=_0x5dda44||0xcc;return function(_0x26cc62){if(_0x26cc62){return _0x53371a[_0x1d12('0x18')](_0x5dda44);}return _0x53371a[_0x1d12('0x19')](_0x5dda44)['end']();};}function respondWithResult(_0x58714d,_0x2a1c67){_0x2a1c67=_0x2a1c67||0xc8;return function(_0x2ab902){if(_0x2ab902){return _0x58714d[_0x1d12('0x19')](_0x2a1c67)[_0x1d12('0x1a')](_0x2ab902);}};}function respondWithFilteredResult(_0x2254c3,_0x567174){return function(_0x55e850){if(_0x55e850){var _0x1a6bee=typeof _0x567174[_0x1d12('0x1b')]===_0x1d12('0x1c')&&typeof _0x567174[_0x1d12('0x1d')]===_0x1d12('0x1c');var _0xceb3af=_0x55e850['count'];var _0x448739=_0x1a6bee?0x0:_0x567174[_0x1d12('0x1b')];var _0x9512e0=_0x1a6bee?_0x55e850[_0x1d12('0x1e')]:_0x567174[_0x1d12('0x1b')]+_0x567174[_0x1d12('0x1d')];var _0x5c4590;if(_0x9512e0>=_0xceb3af){_0x9512e0=_0xceb3af;_0x5c4590=0xc8;}else{_0x5c4590=0xce;}_0x2254c3[_0x1d12('0x19')](_0x5c4590);return _0x2254c3['set']('Content-Range',_0x448739+'-'+_0x9512e0+'/'+_0xceb3af)[_0x1d12('0x1a')](_0x55e850);}return null;};}function patchUpdates(_0x4bdc48){return function(_0x315c1e){try{jsonpatch['apply'](_0x315c1e,_0x4bdc48,!![]);}catch(_0x3e3c9c){return BPromise['reject'](_0x3e3c9c);}return _0x315c1e[_0x1d12('0x1f')]();};}function saveUpdates(_0x945a37,_0x6de8c8){return function(_0x35fb58){if(_0x35fb58){return _0x35fb58['update'](_0x945a37)['then'](function(_0x13d01e){return _0x13d01e;});}return null;};}function removeEntity(_0x724bab,_0x10ec9b){return function(_0x2165e2){if(_0x2165e2){return _0x2165e2[_0x1d12('0x20')]()[_0x1d12('0x21')](function(){_0x724bab[_0x1d12('0x19')](0xcc)[_0x1d12('0x22')]();});}};}function handleEntityNotFound(_0x1c2dc8,_0xfc7a28){return function(_0x3d72cc){if(!_0x3d72cc){_0x1c2dc8[_0x1d12('0x18')](0x194);}return _0x3d72cc;};}function handleError(_0x2bc522,_0x56f2e9){_0x56f2e9=_0x56f2e9||0x1f4;return function(_0x57cba1){logger[_0x1d12('0x23')](_0x57cba1[_0x1d12('0x24')]);if(_0x57cba1[_0x1d12('0x25')]){delete _0x57cba1[_0x1d12('0x25')];}_0x2bc522[_0x1d12('0x19')](_0x56f2e9)[_0x1d12('0x26')](_0x57cba1);};}var utilLicense=require(_0x1d12('0x27'));exports[_0x1d12('0x28')]=function(_0x2fa6d9,_0x516f26){var _0x2f0567={'raw':!![],'where':{'id':0x1}},_0x358ee6={};_0x358ee6[_0x1d12('0x29')]=_['keys'](db['License'][_0x1d12('0x2a')]);_0x358ee6[_0x1d12('0x2b')]=_['keys'](_0x2fa6d9[_0x1d12('0x2b')]);_0x358ee6[_0x1d12('0x2c')]=_[_0x1d12('0x2d')](_0x358ee6[_0x1d12('0x29')],_0x358ee6[_0x1d12('0x2b')]);_0x2f0567[_0x1d12('0x2e')]=_[_0x1d12('0x2d')](_0x358ee6['model'],qs[_0x1d12('0x2f')](_0x2fa6d9[_0x1d12('0x2b')][_0x1d12('0x2f')]));_0x2f0567[_0x1d12('0x2e')]=_0x2f0567[_0x1d12('0x2e')]['length']?_0x2f0567[_0x1d12('0x2e')]:_0x358ee6[_0x1d12('0x29')];_0x2f0567=_['merge']({},_0x2f0567,_0x2fa6d9['options']);return utilLicense[_0x1d12('0x30')](_0x2f0567)[_0x1d12('0x21')](respondWithResult(_0x516f26,null))['catch'](handleError(_0x516f26,null));};exports[_0x1d12('0x31')]=function(_0x392588,_0x229aa0){if(_0x392588['body']['id']){delete _0x392588[_0x1d12('0x32')]['id'];}return db[_0x1d12('0x33')][_0x1d12('0x34')]({'where':{'id':_0x392588['params']['id']}})[_0x1d12('0x21')](handleEntityNotFound(_0x229aa0,null))['then'](function(_0x216b22){var _0x4ae752=_0x216b22[_0x1d12('0x35')]({'plain':!![]});return utilLicense[_0x1d12('0x36')](_0x4ae752,_0x392588[_0x1d12('0x32')][_0x1d12('0x37')]);})[_0x1d12('0x21')](function(_0x3d5438){if(!_0x3d5438['demo']){return saveUpdates(_0x392588[_0x1d12('0x32')],null);}return _0x3d5438;})['then'](respondWithResult(_0x229aa0,null))['catch'](handleError(_0x229aa0,null));};exports[_0x1d12('0x38')]=function(_0x3e0eb8,_0x4b83a9){var _0x3c6c08=_0x1d12('0x39');var _0x540fc8=path['join'](_0x1d12('0x3a'),_0x1d12('0x3b'),_0x1d12('0x3c'),_0x3c6c08);_0x4b83a9['setHeader']('Content-disposition',_0x1d12('0x3d')+_0x3c6c08);_0x4b83a9[_0x1d12('0x3e')]('Content-Type','text/plain');_0x4b83a9[_0x1d12('0x3f')](_0x540fc8);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fac6e4c..6346ae4 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 _0xbc2d=['request-promise','path','../../config/environment','./license.attributes','exports','define','License','lodash','api','bluebird'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xbc2d,0x10b));var _0xdbc2=function(_0xbf6fcd,_0x28f814){_0xbf6fcd=_0xbf6fcd-0x0;var _0x2da644=_0xbc2d[_0xbf6fcd];return _0x2da644;};'use strict';var _=require(_0xdbc2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbc2('0x1'));var moment=require('moment');var BPromise=require(_0xdbc2('0x2'));var rp=require(_0xdbc2('0x3'));var fs=require('fs');var path=require(_0xdbc2('0x4'));var rimraf=require('rimraf');var config=require(_0xdbc2('0x5'));var attributes=require(_0xdbc2('0x6'));module[_0xdbc2('0x7')]=function(_0x58aabe,_0x3ac65f){return _0x58aabe[_0xdbc2('0x8')](_0xdbc2('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x128d=['license','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./license.attributes','exports','define','License'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x128d,0x79));var _0xd128=function(_0x3e008c,_0x383370){_0x3e008c=_0x3e008c-0x0;var _0x20eac2=_0x128d[_0x3e008c];return _0x20eac2;};'use strict';var _=require(_0xd128('0x0'));var util=require('util');var logger=require(_0xd128('0x1'))(_0xd128('0x2'));var moment=require(_0xd128('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd128('0x4'));var rimraf=require(_0xd128('0x5'));var config=require(_0xd128('0x6'));var attributes=require(_0xd128('0x7'));module[_0xd128('0x8')]=function(_0x9c6f8e,_0x59b6ca){return _0x9c6f8e[_0xd128('0x9')](_0xd128('0xa'),attributes,{'tableName':_0xd128('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 672916c..04e7022 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 _0x9dea=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ce4b1,_0x151bd3){var _0xefb3c0=function(_0x44eb3e){while(--_0x44eb3e){_0x5ce4b1['push'](_0x5ce4b1['shift']());}};_0xefb3c0(++_0x151bd3);}(_0x9dea,0x1f3));var _0xa9de=function(_0x4189b5,_0x1c5416){_0x4189b5=_0x4189b5-0x0;var _0x4dc46b=_0x9dea[_0x4189b5];return _0x4dc46b;};'use strict';var _=require(_0xa9de('0x0'));var util=require(_0xa9de('0x1'));var moment=require('moment');var BPromise=require(_0xa9de('0x2'));var rs=require(_0xa9de('0x3'));var fs=require('fs');var Redis=require(_0xa9de('0x4'));var db=require(_0xa9de('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa9de('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa9de('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464cca,_0x4ff3b7,_0x17cc76){return new BPromise(function(_0x4601cb,_0x4579a7){return client[_0xa9de('0x8')](_0x464cca,_0x17cc76)[_0xa9de('0x9')](function(_0xc065af){logger[_0xa9de('0xa')](_0xa9de('0xb'),_0x4ff3b7,_0xa9de('0xc'));logger[_0xa9de('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x4ff3b7,_0xa9de('0xc'),JSON[_0xa9de('0xe')](_0xc065af));if(_0xc065af[_0xa9de('0xf')]){if(_0xc065af['error']['code']===0x1f4){logger[_0xa9de('0xf')](_0xa9de('0xb'),_0x4ff3b7,_0xc065af['error']['message']);return _0x4579a7(_0xc065af[_0xa9de('0xf')][_0xa9de('0x10')]);}logger[_0xa9de('0xf')]('License,\x20%s,\x20%s',_0x4ff3b7,_0xc065af[_0xa9de('0xf')][_0xa9de('0x10')]);return _0x4601cb(_0xc065af['error'][_0xa9de('0x10')]);}else{logger['info'](_0xa9de('0xb'),_0x4ff3b7,_0xa9de('0xc'));_0x4601cb(_0xc065af[_0xa9de('0x11')][_0xa9de('0x10')]);}})[_0xa9de('0x12')](function(_0x1e3a95){logger['error'](_0xa9de('0xb'),_0x4ff3b7,_0x1e3a95);_0x4579a7(_0x1e3a95);});});} \ No newline at end of file +var _0xb6d7=['rpc','../../config/environment','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xb6d7,0xc1));var _0x7b6d=function(_0x167d20,_0x1c6e44){_0x167d20=_0x167d20-0x0;var _0x5428bb=_0xb6d7[_0x167d20];return _0x5428bb;};'use strict';var _=require(_0x7b6d('0x0'));var util=require(_0x7b6d('0x1'));var moment=require('moment');var BPromise=require(_0x7b6d('0x2'));var rs=require(_0x7b6d('0x3'));var fs=require('fs');var Redis=require(_0x7b6d('0x4'));var db=require(_0x7b6d('0x5'))['db'];var utils=require(_0x7b6d('0x6'));var logger=require('../../config/logger')(_0x7b6d('0x7'));var config=require(_0x7b6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7b6d('0x9')][_0x7b6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5734bc,_0x2f12c6,_0x2ff271){return new BPromise(function(_0x4d79c4,_0x3eb628){return client['request'](_0x5734bc,_0x2ff271)[_0x7b6d('0xb')](function(_0x34b579){logger[_0x7b6d('0xc')](_0x7b6d('0xd'),_0x2f12c6,_0x7b6d('0xe'));logger[_0x7b6d('0xf')](_0x7b6d('0x10'),_0x2f12c6,_0x7b6d('0xe'),JSON['stringify'](_0x34b579));if(_0x34b579[_0x7b6d('0x11')]){if(_0x34b579[_0x7b6d('0x11')]['code']===0x1f4){logger['error'](_0x7b6d('0xd'),_0x2f12c6,_0x34b579['error'][_0x7b6d('0x12')]);return _0x3eb628(_0x34b579[_0x7b6d('0x11')][_0x7b6d('0x12')]);}logger[_0x7b6d('0x11')](_0x7b6d('0xd'),_0x2f12c6,_0x34b579[_0x7b6d('0x11')][_0x7b6d('0x12')]);return _0x4d79c4(_0x34b579['error'][_0x7b6d('0x12')]);}else{logger['info'](_0x7b6d('0xd'),_0x2f12c6,'request\x20sent');_0x4d79c4(_0x34b579[_0x7b6d('0x13')][_0x7b6d('0x12')]);}})['catch'](function(_0x9591da){logger['error']('License,\x20%s,\x20%s',_0x2f12c6,_0x9591da);_0x3eb628(_0x9591da);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 38e6208..0ebc0f3 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 _0xd46f=['/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/describe','isAuthenticated','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp'];(function(_0x2029f7,_0x53b3f1){var _0x5c6c6f=function(_0x22836a){while(--_0x22836a){_0x2029f7['push'](_0x2029f7['shift']());}};_0x5c6c6f(++_0x53b3f1);}(_0xd46f,0x115));var _0xfd46=function(_0x5267ec,_0x51f33b){_0x5267ec=_0x5267ec-0x0;var _0x1c68b0=_0xd46f[_0x5267ec];return _0x1c68b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd46('0x0'));var timeout=require(_0xfd46('0x1'));var express=require(_0xfd46('0x2'));var router=express[_0xfd46('0x3')]();var fs_extra=require(_0xfd46('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd46('0x5'));var controller=require('./mailAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfd46('0x6')]);router['get'](_0xfd46('0x7'),auth[_0xfd46('0x8')](),controller['describe']);router[_0xfd46('0x9')](_0xfd46('0xa'),auth[_0xfd46('0x8')](),controller[_0xfd46('0xb')]);router[_0xfd46('0x9')](_0xfd46('0xc'),auth[_0xfd46('0x8')](),controller['getDispositions']);router[_0xfd46('0x9')](_0xfd46('0xd'),auth[_0xfd46('0x8')](),controller[_0xfd46('0xe')]);router[_0xfd46('0x9')](_0xfd46('0xf'),auth['isAuthenticated'](),controller[_0xfd46('0x10')]);router[_0xfd46('0x9')]('/:id/out_servers',auth[_0xfd46('0x8')](),controller[_0xfd46('0x11')]);router[_0xfd46('0x9')](_0xfd46('0x12'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x13')]);router[_0xfd46('0x9')](_0xfd46('0x14'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x15')]);router['get']('/:id/messages',auth[_0xfd46('0x8')](),controller['getMessages']);router[_0xfd46('0x9')](_0xfd46('0x16'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x17')]);router[_0xfd46('0x9')](_0xfd46('0x18'),auth['isAuthenticated'](),controller[_0xfd46('0x19')]);router[_0xfd46('0x1a')](_0xfd46('0xc'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x1b')]);router[_0xfd46('0x1a')](_0xfd46('0xd'),auth['isAuthenticated'](),controller[_0xfd46('0x1c')]);router[_0xfd46('0x1a')]('/',auth[_0xfd46('0x8')](),controller[_0xfd46('0x1d')]);router[_0xfd46('0x1a')](_0xfd46('0xf'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x1e')]);router[_0xfd46('0x1a')]('/:id/out_servers',auth[_0xfd46('0x8')](),controller[_0xfd46('0x1f')]);router[_0xfd46('0x1a')](_0xfd46('0x12'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x20')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xfd46('0x21')]);router[_0xfd46('0x1a')](_0xfd46('0x22'),auth[_0xfd46('0x8')](),controller['send']);router[_0xfd46('0x1a')](_0xfd46('0x18'),auth['isAuthenticated'](),controller[_0xfd46('0x23')]);router['put'](_0xfd46('0xa'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x24')]);router[_0xfd46('0x25')](_0xfd46('0xc'),auth['isAuthenticated'](),controller[_0xfd46('0x26')]);router[_0xfd46('0x25')](_0xfd46('0xd'),auth[_0xfd46('0x8')](),controller[_0xfd46('0x27')]);router[_0xfd46('0x25')](_0xfd46('0xf'),auth['isAuthenticated'](),controller[_0xfd46('0x28')]);router[_0xfd46('0x25')](_0xfd46('0x29'),auth[_0xfd46('0x8')](),controller['removeSmtp']);router[_0xfd46('0x25')]('/:id',auth[_0xfd46('0x8')](),controller['destroy']);router['delete'](_0xfd46('0x18'),auth[_0xfd46('0x8')](),controller['removeAgents']);module[_0xfd46('0x2a')]=router; \ No newline at end of file +var _0x8996=['addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','util','path','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/dispositions','/:id/canned_answers','addAnswer','create','addImap','addSmtp'];(function(_0x545a2c,_0x509fa8){var _0x5f559f=function(_0x24eac6){while(--_0x24eac6){_0x545a2c['push'](_0x545a2c['shift']());}};_0x5f559f(++_0x509fa8);}(_0x8996,0x90));var _0x6899=function(_0x22be30,_0x108934){_0x22be30=_0x22be30-0x0;var _0x5bc95c=_0x8996[_0x22be30];return _0x5bc95c;};'use strict';var multer=require('multer');var util=require(_0x6899('0x0'));var path=require(_0x6899('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6899('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x6899('0x3'));var controller=require(_0x6899('0x4'));router['get']('/',auth[_0x6899('0x5')](),controller[_0x6899('0x6')]);router[_0x6899('0x7')](_0x6899('0x8'),auth[_0x6899('0x5')](),controller[_0x6899('0x9')]);router[_0x6899('0x7')](_0x6899('0xa'),auth[_0x6899('0x5')](),controller[_0x6899('0xb')]);router['get']('/:id/dispositions',auth[_0x6899('0x5')](),controller[_0x6899('0xc')]);router[_0x6899('0x7')]('/:id/canned_answers',auth[_0x6899('0x5')](),controller[_0x6899('0xd')]);router[_0x6899('0x7')](_0x6899('0xe'),auth['isAuthenticated'](),controller[_0x6899('0xf')]);router[_0x6899('0x7')](_0x6899('0x10'),auth[_0x6899('0x5')](),controller['getSmtp']);router[_0x6899('0x7')](_0x6899('0x11'),auth[_0x6899('0x5')](),controller['getInteractions']);router[_0x6899('0x7')]('/:id/applications',auth[_0x6899('0x5')](),controller[_0x6899('0x12')]);router[_0x6899('0x7')](_0x6899('0x13'),auth[_0x6899('0x5')](),controller[_0x6899('0x14')]);router[_0x6899('0x7')](_0x6899('0x15'),auth[_0x6899('0x5')](),controller[_0x6899('0x16')]);router[_0x6899('0x7')](_0x6899('0x17'),auth[_0x6899('0x5')](),controller[_0x6899('0x18')]);router[_0x6899('0x19')](_0x6899('0x1a'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x6899('0x19')](_0x6899('0x1b'),auth[_0x6899('0x5')](),controller[_0x6899('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6899('0x1d')]);router[_0x6899('0x19')](_0x6899('0xe'),auth['isAuthenticated'](),controller[_0x6899('0x1e')]);router[_0x6899('0x19')](_0x6899('0x10'),auth[_0x6899('0x5')](),controller[_0x6899('0x1f')]);router[_0x6899('0x19')](_0x6899('0x11'),auth[_0x6899('0x5')](),controller['addInteraction']);router[_0x6899('0x19')]('/:id/applications',auth[_0x6899('0x5')](),controller[_0x6899('0x20')]);router[_0x6899('0x19')](_0x6899('0x21'),auth[_0x6899('0x5')](),controller['send']);router[_0x6899('0x19')](_0x6899('0x17'),auth[_0x6899('0x5')](),controller[_0x6899('0x22')]);router[_0x6899('0x23')]('/:id',auth[_0x6899('0x5')](),controller[_0x6899('0x24')]);router[_0x6899('0x25')](_0x6899('0x1a'),auth[_0x6899('0x5')](),controller[_0x6899('0x26')]);router[_0x6899('0x25')](_0x6899('0x1b'),auth['isAuthenticated'](),controller[_0x6899('0x27')]);router[_0x6899('0x25')](_0x6899('0xe'),auth[_0x6899('0x5')](),controller['removeImap']);router[_0x6899('0x25')](_0x6899('0x10'),auth['isAuthenticated'](),controller[_0x6899('0x28')]);router[_0x6899('0x25')](_0x6899('0xa'),auth[_0x6899('0x5')](),controller[_0x6899('0x29')]);router['delete'](_0x6899('0x17'),auth[_0x6899('0x5')](),controller[_0x6899('0x2a')]);module[_0x6899('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 543b10a..6ae4ab4 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 _0x70d6=['setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x509083,_0xa6676b){var _0x4b2495=function(_0x2a14f5){while(--_0x2a14f5){_0x509083['push'](_0x509083['shift']());}};_0x4b2495(++_0xa6676b);}(_0x70d6,0xa9));var _0x670d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x70d6[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x670d('0x0'));module[_0x670d('0x1')]={'description':{'type':Sequelize[_0x670d('0x2')]},'name':{'type':Sequelize[_0x670d('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x670d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x670d('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x670d('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x670d('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x670d('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x670d('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x670d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x670d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x670d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x670d('0x3')],'defaultValue':![],'comment':_0x670d('0x6'),'set':function(_0x585890){if(!_0x585890)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x670d('0x7')](_0x670d('0x8'),_0x585890);}},'provider':{'type':Sequelize[_0x670d('0x9')](_0x670d('0xa'),_0x670d('0xb'),_0x670d('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x670d('0xd')](_0x670d('0xe')))return _0x670d('0xf');return this[_0x670d('0xd')](_0x670d('0xe'));},'set':function(_0xf94023){if(_0xf94023===_0x670d('0xf'))_0xf94023=null;return this[_0x670d('0x7')]('provider',_0xf94023);}}}; \ No newline at end of file +var _0x7d61=['yahoo','outlook365','getDataValue','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','hotmail'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d61,0x89));var _0x17d6=function(_0x5e0c48,_0x423e5a){_0x5e0c48=_0x5e0c48-0x0;var _0x4bab5f=_0x7d61[_0x5e0c48];return _0x4bab5f;};'use strict';var Sequelize=require(_0x17d6('0x0'));module[_0x17d6('0x1')]={'description':{'type':Sequelize[_0x17d6('0x2')]},'name':{'type':Sequelize[_0x17d6('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x17d6('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x17d6('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x17d6('0x4')]},'markAsUnread':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x17d6('0x5')},'fontSize':{'type':Sequelize[_0x17d6('0x6')](0x2)[_0x17d6('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x17d6('0x4')],'defaultValue':function(){return _0x17d6('0x8');}},'notificationSound':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x17d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x17d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x17d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x17d6('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x17d6('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x17d6('0x3')],'defaultValue':![],'comment':_0x17d6('0xa'),'set':function(_0x5b701e){if(!_0x5b701e)this[_0x17d6('0xb')](_0x17d6('0xc'),null);this[_0x17d6('0xb')](_0x17d6('0xd'),_0x5b701e);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x17d6('0xe'),_0x17d6('0xf'),_0x17d6('0x10')),'defaultValue':null,'get':function(){if(!this[_0x17d6('0x11')]('provider'))return _0x17d6('0x12');return this['getDataValue']('provider');},'set':function(_0x1fd023){if(_0x1fd023==='custom')_0x1fd023=null;return this[_0x17d6('0xb')]('provider',_0x1fd023);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 66afe58..4d6e318 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 _0x417a=['host','port','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','mandatoryDispositionPause','includeAll','find','catch','body','custom','provider','secure','params','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','Disposition','order','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','findAll','removeAnswers','ids','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addInteraction','MailInteraction','getInteractions','Owner','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','priority','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','CmList','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','sendMail','List','List\x20not\x20found','Contacts','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','path','lodash','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','end','stack','name','send','yahoo','imap.mail.yahoo.com','hotmail','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','user','password','pass','modernAuthentication','CloudProviderId'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x417a,0x1e7));var _0xa417=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x417a[_0xd73d53];return _0x560148;};'use strict';var moment=require(_0xa417('0x0'));var BPromise=require(_0xa417('0x1'));var util=require('util');var path=require(_0xa417('0x2'));var _=require(_0xa417('0x3'));var juice=require(_0xa417('0x4'));var Redis=require('ioredis');var qs=require(_0xa417('0x5'));var logger=require('../../config/logger')(_0xa417('0x6'));var config=require(_0xa417('0x7'));var db=require(_0xa417('0x8'))['db'];config['redis']=_[_0xa417('0x9')](config[_0xa417('0xa')],{'host':_0xa417('0xb'),'port':0x18eb});var socket=require(_0xa417('0xc'))(new Redis(config[_0xa417('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xa417('0xd'));var client=jayson['client'][_0xa417('0xe')]({'port':0x232b});function respondWithRpcPromise(_0xd53401,_0x430c43,_0x4aabd0,_0x2f6642){return new BPromise(function(_0x915b9a,_0x36b6df){var _0x855956=_0x2f6642||client;return _0x855956[_0xa417('0xf')](_0xd53401,_0x4aabd0)[_0xa417('0x10')](function(_0x520d8a){logger[_0xa417('0x11')](_0xa417('0x12'),_0x430c43,_0xa417('0x13'));logger[_0xa417('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x430c43,_0xa417('0x13'),JSON[_0xa417('0x15')](_0x520d8a));if(_0x520d8a['error']){if(_0x520d8a[_0xa417('0x16')][_0xa417('0x17')]===0x1f4){logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);return _0x36b6df(_0x520d8a['error'][_0xa417('0x18')]);}logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);return _0x915b9a(_0x520d8a[_0xa417('0x16')][_0xa417('0x18')]);}else{logger[_0xa417('0x11')](_0xa417('0x12'),_0x430c43,_0xa417('0x13'));_0x915b9a(_0x520d8a['result'][_0xa417('0x18')]);}})['catch'](function(_0x379f90){logger[_0xa417('0x16')](_0xa417('0x12'),_0x430c43,_0x379f90);_0x36b6df(_0x379f90);});});}function respondWithStatusCode(_0x14382b,_0x3256f9){_0x3256f9=_0x3256f9||0xcc;return function(_0x42f864){if(_0x42f864){return _0x14382b[_0xa417('0x19')](_0x3256f9);}return _0x14382b[_0xa417('0x1a')](_0x3256f9)['end']();};}function respondWithResult(_0x19af9d,_0x2479c1){_0x2479c1=_0x2479c1||0xc8;return function(_0x2fa60b){if(_0x2fa60b){return _0x19af9d[_0xa417('0x1a')](_0x2479c1)[_0xa417('0x1b')](_0x2fa60b);}};}function respondWithFilteredResult(_0x18dae3,_0x26d7fc){return function(_0x392e44){if(_0x392e44){var _0x164e65=typeof _0x26d7fc[_0xa417('0x1c')]==='undefined'&&typeof _0x26d7fc[_0xa417('0x1d')]===_0xa417('0x1e');var _0x1e7431=_0x392e44[_0xa417('0x1f')];var _0x4f374c=_0x164e65?0x0:_0x26d7fc[_0xa417('0x1c')];var _0x419450=_0x164e65?_0x392e44[_0xa417('0x1f')]:_0x26d7fc[_0xa417('0x1c')]+_0x26d7fc[_0xa417('0x1d')];var _0x4ace7b;if(_0x419450>=_0x1e7431){_0x419450=_0x1e7431;_0x4ace7b=0xc8;}else{_0x4ace7b=0xce;}_0x18dae3[_0xa417('0x1a')](_0x4ace7b);return _0x18dae3[_0xa417('0x20')](_0xa417('0x21'),_0x4f374c+'-'+_0x419450+'/'+_0x1e7431)[_0xa417('0x1b')](_0x392e44);}return null;};}function saveUpdates(_0x211f5c){return function(_0x28bff6){if(_0x28bff6){return _0x28bff6[_0xa417('0x22')](_0x211f5c)[_0xa417('0x10')](function(_0x7ad520){return _0x7ad520;});}return null;};}function removeEntity(_0x1025d8){return function(_0xbc38cd){if(_0xbc38cd){return _0xbc38cd[_0xa417('0x23')]()[_0xa417('0x10')](function(){var _0x284bea=_0xbc38cd[_0xa417('0x24')]({'plain':!![]});var _0x4e14e9=_0xa417('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e14e9,'resourceId':_0x284bea['id']}})[_0xa417('0x10')](function(){return _0xbc38cd;});})[_0xa417('0x10')](function(){_0x1025d8['status'](0xcc)[_0xa417('0x26')]();});}};}function handleEntityNotFound(_0x5c2b41){return function(_0x4adede){if(!_0x4adede){_0x5c2b41[_0xa417('0x19')](0x194);}return _0x4adede;};}function handleError(_0x3b174b,_0x1cc5c8){_0x1cc5c8=_0x1cc5c8||0x1f4;return function(_0x1ef631){logger[_0xa417('0x16')](_0x1ef631[_0xa417('0x27')]);if(_0x1ef631[_0xa417('0x28')]){delete _0x1ef631[_0xa417('0x28')];}_0x3b174b[_0xa417('0x1a')](_0x1cc5c8)[_0xa417('0x29')](_0x1ef631);};}function getImapHost(_0x51433b){switch(_0x51433b){case'gmail':return'imap.gmail.com';case _0xa417('0x2a'):return _0xa417('0x2b');case _0xa417('0x2c'):return'imap-mail.outlook.com';case'outlook365':return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x51433b);}function getSmtpHost(_0x351682){switch(_0x351682){case _0xa417('0x2d'):return _0xa417('0x2e');case _0xa417('0x2a'):return _0xa417('0x2f');case _0xa417('0x2c'):return _0xa417('0x30');case _0xa417('0x31'):return'smtp.office365.com';}throw new Error(_0xa417('0x32'),_0x351682);}function getAuthenticationOptions(_0x21a519,_0x153be5){var _0x4aa793={};var _0x72ec10={};if(_0x21a519){_0x4aa793[_0xa417('0x33')]=_0x72ec10[_0xa417('0x33')]=_0x153be5['username'];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=_0x153be5[_0xa417('0x34')];if(_0x153be5['modernAuthentication']){_0x4aa793['modernAuthentication']=_0x72ec10[_0xa417('0x36')]=!![];_0x4aa793[_0xa417('0x37')]=_0x72ec10[_0xa417('0x37')]=_0x153be5['CloudProviderId'];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=null;}else{_0x4aa793[_0xa417('0x37')]=_0x72ec10[_0xa417('0x37')]=null;}_0x4aa793[_0xa417('0x38')]=getImapHost(_0x21a519);_0x4aa793[_0xa417('0x39')]=0x3e1;_0x72ec10[_0xa417('0x38')]=getSmtpHost(_0x21a519);_0x72ec10[_0xa417('0x39')]=0x24b;_0x72ec10['secure']=![];_0x4aa793[_0xa417('0x3a')]=_0x72ec10['service']=null;}else{if(_0x153be5[_0xa417('0x3b')]){_0x4aa793['user']=_0x72ec10[_0xa417('0x33')]=_0x153be5[_0xa417('0x3c')];_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=_0x153be5['password'];}else{_0x4aa793[_0xa417('0x3b')]=_0x72ec10[_0xa417('0x3b')]=![];_0x4aa793[_0xa417('0x33')]=_0x72ec10[_0xa417('0x33')]=null;_0x4aa793[_0xa417('0x34')]=_0x72ec10[_0xa417('0x35')]=null;}_0x4aa793[_0xa417('0x38')]=_0x153be5['Imap']['host'];_0x4aa793[_0xa417('0x39')]=_0x153be5[_0xa417('0x3d')][_0xa417('0x39')];_0x72ec10['host']=_0x153be5[_0xa417('0x3e')][_0xa417('0x38')];_0x72ec10[_0xa417('0x39')]=_0x153be5[_0xa417('0x3e')][_0xa417('0x39')];}return{'Imap':_0x4aa793,'Smtp':_0x72ec10};}exports['index']=function(_0x1e3389,_0x46af15){var _0x4de442={'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':'mandatoryDispositionPause'}]},_0x1a969e={},_0x36071b={'count':0x0,'rows':[]};var _0x19647f=_[_0xa417('0x42')](db[_0xa417('0x43')][_0xa417('0x44')],function(_0x3e814d){return{'name':_0x3e814d[_0xa417('0x45')],'type':_0x3e814d[_0xa417('0x46')][_0xa417('0x47')]};});_0x1a969e[_0xa417('0x48')]=_[_0xa417('0x42')](_0x19647f,'name');_0x1a969e['query']=_[_0xa417('0x49')](_0x1e3389[_0xa417('0x4a')]);_0x1a969e[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x1a969e[_0xa417('0x48')],_0x1a969e[_0xa417('0x4a')]);_0x4de442[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x1a969e[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x1e3389['query'][_0xa417('0x4e')]));_0x4de442[_0xa417('0x4d')]=_0x4de442[_0xa417('0x4d')][_0xa417('0x4f')]?_0x4de442[_0xa417('0x4d')]:_0x1a969e[_0xa417('0x48')];if(!_0x1e3389[_0xa417('0x4a')]['hasOwnProperty'](_0xa417('0x50'))){_0x4de442[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x1e3389[_0xa417('0x4a')]['limit']);_0x4de442[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x1e3389[_0xa417('0x4a')][_0xa417('0x1c')]);}_0x4de442['order']=qs[_0xa417('0x51')](_0x1e3389[_0xa417('0x4a')][_0xa417('0x51')]);_0x4de442[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x1e3389[_0xa417('0x4a')],_0x1a969e['filters']),_0x19647f);if(_0x1e3389[_0xa417('0x4a')]['filter']){_0x4de442[_0xa417('0x52')]=_[_0xa417('0x54')](_0x4de442['where'],{'$or':_[_0xa417('0x42')](_0x19647f,function(_0x192ab6){if(_0x192ab6[_0xa417('0x46')]!==_0xa417('0x55')){var _0x362182={};_0x362182[_0x192ab6[_0xa417('0x28')]]={'$like':'%'+_0x1e3389['query'][_0xa417('0x56')]+'%'};return _0x362182;}})});}_0x4de442=_['merge']({},_0x4de442,_0x1e3389[_0xa417('0x57')]);var _0x19b37d={'where':_0x4de442['where']};return db[_0xa417('0x43')][_0xa417('0x1f')](_0x19b37d)[_0xa417('0x10')](function(_0x2f87ca){_0x36071b[_0xa417('0x1f')]=_0x2f87ca;if(_0x1e3389[_0xa417('0x4a')]['includeAll']){_0x4de442[_0xa417('0x58')]=[{'all':!![]}];}return db[_0xa417('0x43')]['findAll'](_0x4de442);})['then'](function(_0x1440a5){_0x36071b[_0xa417('0x59')]=_0x1440a5;return _0x36071b;})[_0xa417('0x10')](respondWithFilteredResult(_0x46af15,_0x4de442))['catch'](handleError(_0x46af15,null));};exports['show']=function(_0x573fa1,_0x1f9f39){var _0x114499={'raw':![],'where':{'id':_0x573fa1['params']['id']},'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':_0xa417('0x5a')}]},_0x4063cf={};_0x4063cf[_0xa417('0x48')]=_[_0xa417('0x49')](db['MailAccount'][_0xa417('0x44')]);_0x4063cf[_0xa417('0x4a')]=_['keys'](_0x573fa1[_0xa417('0x4a')]);_0x4063cf[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x4063cf[_0xa417('0x48')],_0x4063cf['query']);_0x114499['attributes']=_[_0xa417('0x4c')](_0x4063cf[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x573fa1[_0xa417('0x4a')]['fields']));_0x114499['attributes']=_0x114499[_0xa417('0x4d')][_0xa417('0x4f')]?_0x114499[_0xa417('0x4d')]:_0x4063cf[_0xa417('0x48')];if(_0x573fa1['query'][_0xa417('0x5b')]){_0x114499[_0xa417('0x58')]=[{'all':!![]}];}_0x114499=_[_0xa417('0x54')]({},_0x114499,_0x573fa1[_0xa417('0x57')]);return db[_0xa417('0x43')][_0xa417('0x5c')](_0x114499)[_0xa417('0x10')](handleEntityNotFound(_0x1f9f39,null))['then'](respondWithResult(_0x1f9f39,null))[_0xa417('0x5d')](handleError(_0x1f9f39,null));};exports[_0xa417('0x22')]=function(_0x481cd0,_0x424126){if(_0x481cd0[_0xa417('0x5e')]['id']){delete _0x481cd0['body']['id'];}var _0x526545=_0x481cd0['body']['provider']===_0xa417('0x5f')?null:_0x481cd0[_0xa417('0x5e')][_0xa417('0x60')];var _0x3e9aae=_0x481cd0['body'][_0xa417('0x3d')]||{};var _0x884122=_0x481cd0['body'][_0xa417('0x3e')]||{};if(_0x526545){_0x3e9aae[_0xa417('0x38')]=getImapHost(_0x526545);_0x3e9aae[_0xa417('0x39')]=0x3e1;_0x884122[_0xa417('0x38')]=getSmtpHost(_0x526545);_0x884122['port']=0x24b;_0x884122[_0xa417('0x61')]=![];}if(_0x884122[_0xa417('0x36')]){_0x884122[_0xa417('0x61')]=![];}else{_0x884122[_0xa417('0x37')]=null;}if(!_0x3e9aae[_0xa417('0x36')])_0x3e9aae[_0xa417('0x37')]=null;_0x481cd0[_0xa417('0x5e')]['Imap']=_0x3e9aae;_0x481cd0[_0xa417('0x5e')]['Smtp']=_0x884122;return db['MailAccount'][_0xa417('0x5c')]({'where':{'id':_0x481cd0[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')},{'model':db['MailServerOut'],'as':_0xa417('0x3e')},{'model':db[_0xa417('0x41')],'as':_0xa417('0x5a')}]})['then'](handleEntityNotFound(_0x424126,null))['then'](function(_0x5687f0){if(!_0x5687f0)throw new Error(_0xa417('0x63'));if(_0x5687f0[_0xa417('0x3a')])delete _0x481cd0['body']['Imap'];return _0x5687f0;})[_0xa417('0x10')](saveUpdates(_0x481cd0[_0xa417('0x5e')],null))[_0xa417('0x10')](function(_0x3c099d){if(!_0x481cd0[_0xa417('0x5e')][_0xa417('0x3d')])return _0x3c099d;return db[_0xa417('0x3f')][_0xa417('0x22')](_0x481cd0[_0xa417('0x5e')][_0xa417('0x3d')],{'where':{'MailAccountId':_0x3c099d['id']}})['then'](function(){return _0x3c099d;});})['then'](function(_0x5883fc){if(!_0x481cd0[_0xa417('0x5e')][_0xa417('0x3e')])return _0x5883fc;return db[_0xa417('0x40')]['update'](_0x481cd0['body']['Smtp'],{'where':{'MailAccountId':_0x5883fc['id']}})['then'](function(){return _0x5883fc;});})['then'](respondWithResult(_0x424126,null))[_0xa417('0x5d')](handleError(_0x424126,null));};exports[_0xa417('0x64')]=function(_0x54d339,_0xa5321b){return db[_0xa417('0x43')]['describe']()[_0xa417('0x10')](respondWithResult(_0xa5321b,null))[_0xa417('0x5d')](handleError(_0xa5321b,null));};exports[_0xa417('0x65')]=function(_0x267227,_0x4d25d5){if(_0x267227[_0xa417('0x5e')]['id']){delete _0x267227['body']['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x267227['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x4d25d5,null))[_0xa417('0x10')](function(_0x1e7b71){if(_0x1e7b71){_0x267227[_0xa417('0x5e')]['MailAccountId']=_0x1e7b71['id'];return db['Disposition'][_0xa417('0x66')](_0x267227[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x4d25d5,null))['catch'](handleError(_0x4d25d5,null));};exports[_0xa417('0x67')]=function(_0x50fbc9,_0x3ff5cc){var _0x328096={'raw':![],'where':{}};var _0x118ae2={};var _0x471932={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x50fbc9[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3ff5cc,null))['then'](function(_0x154ab6){if(_0x154ab6){_0x118ae2[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x68')]['rawAttributes']);_0x118ae2[_0xa417('0x4a')]=_['keys'](_0x50fbc9['query']);_0x118ae2[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x118ae2[_0xa417('0x48')],_0x118ae2[_0xa417('0x4a')]);_0x328096['attributes']=_['intersection'](_0x118ae2[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x50fbc9['query'][_0xa417('0x4e')]));_0x328096['attributes']=_0x328096[_0xa417('0x4d')][_0xa417('0x4f')]?_0x328096[_0xa417('0x4d')]:_0x118ae2['model'];if(!_0x50fbc9['query']['hasOwnProperty']('nolimit')){_0x328096[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x50fbc9[_0xa417('0x4a')][_0xa417('0x1d')]);_0x328096[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x50fbc9['query'][_0xa417('0x1c')]);}_0x328096[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x50fbc9[_0xa417('0x4a')][_0xa417('0x51')]);_0x328096[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x50fbc9[_0xa417('0x4a')],_0x118ae2[_0xa417('0x4b')]));_0x328096[_0xa417('0x52')][_0xa417('0x6a')]=_0x154ab6['id'];if(_0x50fbc9[_0xa417('0x4a')][_0xa417('0x56')]){_0x328096[_0xa417('0x52')]=_[_0xa417('0x54')](_0x328096[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x328096[_0xa417('0x4d')],function(_0x5d16e1){var _0x4a2237={};_0x4a2237[_0x5d16e1]={'$like':'%'+_0x50fbc9[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x4a2237;})});}_0x328096=_['merge']({},_0x328096,_0x50fbc9['options']);return db[_0xa417('0x68')][_0xa417('0x1f')]({'where':_0x328096[_0xa417('0x52')]})[_0xa417('0x10')](function(_0x4f306e){_0x471932[_0xa417('0x1f')]=_0x4f306e;if(_0x50fbc9[_0xa417('0x4a')]['includeAll']){_0x328096[_0xa417('0x58')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x328096);})[_0xa417('0x10')](function(_0x35bff5){_0x471932[_0xa417('0x59')]=_0x35bff5;return _0x471932;});}})['then'](respondWithFilteredResult(_0x3ff5cc,_0x328096))[_0xa417('0x5d')](handleError(_0x3ff5cc,null));};exports[_0xa417('0x6b')]=function(_0x544c7b,_0x3fd9b6){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x544c7b[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3fd9b6,null))[_0xa417('0x10')](function(_0x208234){if(_0x208234){return _0x208234['removeDispositions'](_0x544c7b[_0xa417('0x4a')]['ids']);}})[_0xa417('0x10')](respondWithStatusCode(_0x3fd9b6,null))[_0xa417('0x5d')](handleError(_0x3fd9b6,null));};exports[_0xa417('0x6c')]=function(_0x1186c7,_0x40fc43){if(_0x1186c7[_0xa417('0x5e')]['id']){delete _0x1186c7[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x1186c7[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x40fc43,null))[_0xa417('0x10')](function(_0x37e4c6){if(_0x37e4c6){_0x1186c7[_0xa417('0x5e')][_0xa417('0x6a')]=_0x37e4c6['id'];return db[_0xa417('0x6d')][_0xa417('0x66')](_0x1186c7[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x40fc43,null))[_0xa417('0x5d')](handleError(_0x40fc43,null));};exports[_0xa417('0x6e')]=function(_0x5b77be,_0x1ada45){var _0x45be6a={'raw':![],'where':{}};var _0x382835={};var _0x261ab7={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x5b77be['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1ada45,null))[_0xa417('0x10')](function(_0x5b7c79){if(_0x5b7c79){_0x382835[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x6d')][_0xa417('0x44')]);_0x382835['query']=_[_0xa417('0x49')](_0x5b77be[_0xa417('0x4a')]);_0x382835[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x382835[_0xa417('0x48')],_0x382835[_0xa417('0x4a')]);_0x45be6a[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x382835[_0xa417('0x48')],qs[_0xa417('0x4e')](_0x5b77be[_0xa417('0x4a')][_0xa417('0x4e')]));_0x45be6a[_0xa417('0x4d')]=_0x45be6a['attributes'][_0xa417('0x4f')]?_0x45be6a[_0xa417('0x4d')]:_0x382835['model'];if(!_0x5b77be[_0xa417('0x4a')][_0xa417('0x70')]('nolimit')){_0x45be6a[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x5b77be[_0xa417('0x4a')][_0xa417('0x1d')]);_0x45be6a['offset']=qs[_0xa417('0x1c')](_0x5b77be[_0xa417('0x4a')]['offset']);}_0x45be6a[_0xa417('0x69')]=qs['sort'](_0x5b77be[_0xa417('0x4a')][_0xa417('0x51')]);_0x45be6a['where']=qs['filters'](_[_0xa417('0x53')](_0x5b77be[_0xa417('0x4a')],_0x382835[_0xa417('0x4b')]));_0x45be6a['where'][_0xa417('0x6a')]=_0x5b7c79['id'];if(_0x5b77be['query']['filter']){_0x45be6a[_0xa417('0x52')]=_[_0xa417('0x54')](_0x45be6a[_0xa417('0x52')],{'$or':_['map'](_0x45be6a[_0xa417('0x4d')],function(_0x208c4d){var _0x28e28d={};_0x28e28d[_0x208c4d]={'$like':'%'+_0x5b77be[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x28e28d;})});}_0x45be6a=_[_0xa417('0x54')]({},_0x45be6a,_0x5b77be[_0xa417('0x57')]);return db[_0xa417('0x6d')][_0xa417('0x1f')]({'where':_0x45be6a['where']})[_0xa417('0x10')](function(_0x2b1bae){_0x261ab7[_0xa417('0x1f')]=_0x2b1bae;if(_0x5b77be['query'][_0xa417('0x5b')]){_0x45be6a['include']=[{'all':!![]}];}return db[_0xa417('0x6d')][_0xa417('0x71')](_0x45be6a);})[_0xa417('0x10')](function(_0x1764c4){_0x261ab7[_0xa417('0x59')]=_0x1764c4;return _0x261ab7;});}})['then'](respondWithFilteredResult(_0x1ada45,_0x45be6a))[_0xa417('0x5d')](handleError(_0x1ada45,null));};exports[_0xa417('0x72')]=function(_0x5d5b85,_0x102093){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x5d5b85[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x102093,null))[_0xa417('0x10')](function(_0x45a804){if(_0x45a804){return _0x45a804['removeAnswers'](_0x5d5b85[_0xa417('0x4a')][_0xa417('0x73')]);}})[_0xa417('0x10')](respondWithStatusCode(_0x102093,null))[_0xa417('0x5d')](handleError(_0x102093,null));};exports[_0xa417('0x66')]=function(_0x590057,_0x3f9acf){var _0x3b94ec={'name':_0x590057['body'][_0xa417('0x28')],'key':_0x590057[_0xa417('0x5e')][_0xa417('0x47')],'provider':_0x590057[_0xa417('0x5e')]['provider']==='custom'?null:_0x590057[_0xa417('0x5e')][_0xa417('0x60')],'email':_0x590057[_0xa417('0x5e')][_0xa417('0x74')],'ListId':_0x590057[_0xa417('0x5e')][_0xa417('0x75')],'active':!_[_0xa417('0x76')](_0x590057['body']['active'])?_0x590057[_0xa417('0x5e')][_0xa417('0x77')]:!![],'description':_0x590057[_0xa417('0x5e')][_0xa417('0x78')]||null};var _0x5f50ff=getAuthenticationOptions(_0x3b94ec['provider'],_0x590057[_0xa417('0x5e')]);_0x3b94ec[_0xa417('0x3d')]=_0x5f50ff[_0xa417('0x3d')];_0x3b94ec['Smtp']=_0x5f50ff[_0xa417('0x3e')];return db[_0xa417('0x43')]['create'](_0x3b94ec,{'include':[{'model':db[_0xa417('0x40')],'as':'Smtp'},{'model':db[_0xa417('0x3f')],'as':_0xa417('0x3d')}]})[_0xa417('0x10')](function(_0x59a12e){var _0x51bd21=_0x590057[_0xa417('0x33')][_0xa417('0x24')]({'plain':!![]});if(!_0x51bd21)throw new Error(_0xa417('0x79'));if(_0x51bd21[_0xa417('0x7a')]==='user'){var _0x493ed6=_0x59a12e[_0xa417('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xa417('0x5c')]({'where':{'name':_0xa417('0x25'),'userProfileId':_0x51bd21[_0xa417('0x7b')]},'raw':!![]})['then'](function(_0x1828c2){if(_0x1828c2&&_0x1828c2[_0xa417('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x493ed6[_0xa417('0x28')],'resourceId':_0x493ed6['id'],'type':_0x1828c2['name'],'sectionId':_0x1828c2['id']},{})[_0xa417('0x10')](function(){return _0x59a12e;});}else{return _0x59a12e;}})[_0xa417('0x5d')](function(_0x1977bf){logger[_0xa417('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1977bf);throw _0x1977bf;});}return _0x59a12e;})[_0xa417('0x10')](respondWithResult(_0x3f9acf,0xc9))['catch'](handleError(_0x3f9acf,null));};exports[_0xa417('0x7d')]=function(_0x5e5a33,_0x1e0b6d){return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x5e5a33[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x1e0b6d,null))[_0xa417('0x10')](function(_0x1f2d27){if(_0x1f2d27){return _0x1f2d27[_0xa417('0x7d')]();}return null;})[_0xa417('0x10')](respondWithResult(_0x1e0b6d,null))[_0xa417('0x5d')](handleError(_0x1e0b6d,null));};exports['addImap']=function(_0x352320,_0x14ee59){if(_0x352320[_0xa417('0x5e')]['id']){delete _0x352320[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x352320[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x14ee59,null))['then'](function(_0x4e7d2){if(_0x4e7d2){_0x352320['body']['MailAccountId']=_0x4e7d2['id'];return db[_0xa417('0x3f')][_0xa417('0x66')](_0x352320[_0xa417('0x5e')]);}})[_0xa417('0x10')](respondWithResult(_0x14ee59,null))['catch'](handleError(_0x14ee59,null));};exports[_0xa417('0x7e')]=function(_0x372a53,_0x590a7c){return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x372a53[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x590a7c,null))[_0xa417('0x10')](function(_0xaa4be3){if(_0xaa4be3){return _0xaa4be3[_0xa417('0x7f')](null);}return null;})[_0xa417('0x10')](respondWithStatusCode(_0x590a7c,null))[_0xa417('0x5d')](handleError(_0x590a7c,null));};exports[_0xa417('0x80')]=function(_0x27833c,_0x4493b8){return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0x27833c[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x4493b8,null))[_0xa417('0x10')](function(_0x1fae4c){if(_0x1fae4c){return _0x1fae4c[_0xa417('0x80')]();}return null;})['then'](respondWithResult(_0x4493b8,null))[_0xa417('0x5d')](handleError(_0x4493b8,null));};exports['addSmtp']=function(_0xfe92fd,_0x421b92){if(_0xfe92fd[_0xa417('0x5e')]['id']){delete _0xfe92fd[_0xa417('0x5e')]['id'];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0xfe92fd[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x421b92,null))[_0xa417('0x10')](function(_0x27958c){if(_0x27958c){_0xfe92fd['body'][_0xa417('0x6a')]=_0x27958c['id'];return db[_0xa417('0x40')][_0xa417('0x66')](_0xfe92fd['body']);}})[_0xa417('0x10')](respondWithResult(_0x421b92,null))[_0xa417('0x5d')](handleError(_0x421b92,null));};exports['removeSmtp']=function(_0x5e5b81,_0x5c02f8){return db[_0xa417('0x43')]['findOne']({'where':{'id':_0x5e5b81[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x5c02f8,null))[_0xa417('0x10')](function(_0x63741c){if(_0x63741c){return _0x63741c['setSmtp'](null);}return null;})[_0xa417('0x10')](respondWithStatusCode(_0x5c02f8,null))[_0xa417('0x5d')](handleError(_0x5c02f8,null));};exports[_0xa417('0x81')]=function(_0x571cab,_0x249f17){return db[_0xa417('0x82')][_0xa417('0x5c')]({'where':{'id':_0x571cab[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x249f17,null))[_0xa417('0x10')](function(_0x50a654){if(_0x50a654){return _0x50a654['addInteraction'](_0x571cab[_0xa417('0x5e')]['ids'],_['omit'](_0x571cab[_0xa417('0x5e')],[_0xa417('0x73'),'id'])||{});}})[_0xa417('0x10')](respondWithResult(_0x249f17,null))[_0xa417('0x5d')](handleError(_0x249f17,null));};exports[_0xa417('0x83')]=function(_0x172074,_0x33b791){var _0x758ede={'raw':![],'where':{}};var _0x5cc276={};var _0x1ac1cd={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x172074[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x33b791,null))[_0xa417('0x10')](function(_0xadb37f){if(_0xadb37f){_0x5cc276[_0xa417('0x48')]=_[_0xa417('0x49')](db[_0xa417('0x82')][_0xa417('0x44')]);_0x5cc276[_0xa417('0x4a')]=_[_0xa417('0x49')](_0x172074[_0xa417('0x4a')]);_0x5cc276[_0xa417('0x4b')]=_['intersection'](_0x5cc276[_0xa417('0x48')],_0x5cc276[_0xa417('0x4a')]);_0x758ede['attributes']=_[_0xa417('0x4c')](_0x5cc276['model'],qs[_0xa417('0x4e')](_0x172074[_0xa417('0x4a')][_0xa417('0x4e')]));_0x758ede[_0xa417('0x4d')]=_0x758ede[_0xa417('0x4d')][_0xa417('0x4f')]?_0x758ede[_0xa417('0x4d')]:_0x5cc276[_0xa417('0x48')];if(!_0x172074['query']['hasOwnProperty']('nolimit')){_0x758ede['limit']=qs[_0xa417('0x1d')](_0x172074[_0xa417('0x4a')][_0xa417('0x1d')]);_0x758ede[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x172074[_0xa417('0x4a')][_0xa417('0x1c')]);}_0x758ede[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x172074[_0xa417('0x4a')]['sort']);_0x758ede['where']=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x172074[_0xa417('0x4a')],_0x5cc276[_0xa417('0x4b')]));_0x758ede['where'][_0xa417('0x6a')]=_0xadb37f['id'];if(_0x172074['query']['filter']){_0x758ede[_0xa417('0x52')]=_[_0xa417('0x54')](_0x758ede[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x758ede[_0xa417('0x4d')],function(_0x51bec2){var _0x7b57cd={};_0x7b57cd[_0x51bec2]={'$like':'%'+_0x172074[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x7b57cd;})});}_0x758ede=_[_0xa417('0x54')]({},_0x758ede,_0x172074['options']);return db[_0xa417('0x82')][_0xa417('0x1f')]({'where':_0x758ede['where']})[_0xa417('0x10')](function(_0x31fed5){_0x1ac1cd[_0xa417('0x1f')]=_0x31fed5;if(_0x172074[_0xa417('0x4a')][_0xa417('0x5b')]){_0x758ede['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa417('0x84'),'attributes':[_0xa417('0x28'),'fullname',_0xa417('0x85')],'required':![]},{'model':db[_0xa417('0x86')],'as':'Tags','attributes':['id',_0xa417('0x28'),'color'],'where':_0x172074[_0xa417('0x4a')][_0xa417('0x87')]?{'id':_0x172074['query'][_0xa417('0x87')]}:undefined,'required':_0x172074[_0xa417('0x4a')][_0xa417('0x87')]?!![]:![]}];}return db['MailInteraction'][_0xa417('0x71')](_0x758ede);})[_0xa417('0x10')](function(_0xe6da22){_0x1ac1cd[_0xa417('0x59')]=_0xe6da22;return _0x1ac1cd;});}})['then'](respondWithFilteredResult(_0x33b791,_0x758ede))[_0xa417('0x5d')](handleError(_0x33b791,null));};exports[_0xa417('0x88')]=function addApplications(_0x4c9c24,_0x17d0e2){var _0x59532f=_0x4c9c24[_0xa417('0x62')]['id'];var _0x33a3cf=_0x4c9c24[_0xa417('0x5e')];var _0x243369=0xc8;var _0xfbe1a2=null;return db[_0xa417('0x89')][_0xa417('0x8a')]({'isolationLevel':db[_0xa417('0x89')][_0xa417('0x8b')][_0xa417('0x8c')][_0xa417('0x8d')]},function(_0x56b1be){return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0x59532f},'transaction':_0x56b1be})[_0xa417('0x10')](function(_0x584950){if(_0x584950){return db[_0xa417('0x8e')][_0xa417('0x23')]({'where':{'MailAccountId':_0x59532f},'transaction':_0x56b1be})[_0xa417('0x10')](function(){var _0x82b8bb=_[_0xa417('0x42')](_0x33a3cf,function(_0xac88ee){_0xac88ee['MailAccountId']=_0x59532f;return _0xac88ee;});return db['MailApplication']['bulkCreate'](_0x82b8bb,{'transaction':_0x56b1be});});}else{_0x243369=0x194;_0xfbe1a2=[];}});})[_0xa417('0x10')](function(){if(_0x243369!==0x194){return db[_0xa417('0x8e')]['findAndCountAll']({'where':{'MailAccountId':_0x59532f},'order':_0xa417('0x8f')})[_0xa417('0x10')](function(_0x3ca2e8){_0xfbe1a2=_0x3ca2e8;});}})[_0xa417('0x5d')](function(_0x33bac6){_0x243369=0x1f4;logger[_0xa417('0x16')](_0x33bac6['stack']);if(_0x33bac6[_0xa417('0x28')]){delete _0x33bac6[_0xa417('0x28')];}_0xfbe1a2=_0x33bac6;})['finally'](function(){if(_0xfbe1a2===null){_0x17d0e2['sendStatus'](_0x243369);}else{if(_0x243369===0x1f4){_0x17d0e2[_0xa417('0x1a')](_0x243369)[_0xa417('0x29')](_0xfbe1a2);}else{_0x17d0e2[_0xa417('0x1a')](_0x243369)['json'](_0xfbe1a2);}}});};exports[_0xa417('0x90')]=function(_0x1514a9,_0x582d07){var _0x5c1ab1={};var _0x56b649={};var _0x2b6c84;var _0x492ac5;return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x1514a9[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x582d07,null))[_0xa417('0x10')](function(_0x201cce){if(_0x201cce){_0x2b6c84=_0x201cce;_0x56b649[_0xa417('0x48')]=_[_0xa417('0x49')](db['MailApplication'][_0xa417('0x44')]);_0x56b649[_0xa417('0x4a')]=_['keys'](_0x1514a9['query']);_0x56b649[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x56b649[_0xa417('0x48')],_0x56b649[_0xa417('0x4a')]);_0x5c1ab1['attributes']=_[_0xa417('0x4c')](_0x56b649[_0xa417('0x48')],qs['fields'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x4e')]));_0x5c1ab1['attributes']=_0x5c1ab1[_0xa417('0x4d')][_0xa417('0x4f')]?_0x5c1ab1[_0xa417('0x4d')]:_0x56b649['model'];_0x5c1ab1[_0xa417('0x69')]=qs['sort'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x51')]);_0x5c1ab1[_0xa417('0x52')]=qs['filters'](_[_0xa417('0x53')](_0x1514a9[_0xa417('0x4a')],_0x56b649['filters']));if(_0x1514a9['query'][_0xa417('0x56')]){_0x5c1ab1['where']=_[_0xa417('0x54')](_0x5c1ab1[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x5c1ab1[_0xa417('0x4d')],function(_0x24912c){var _0x4fd754={};_0x4fd754[_0x24912c]={'$like':'%'+_0x1514a9[_0xa417('0x4a')][_0xa417('0x56')]+'%'};return _0x4fd754;})});}_0x5c1ab1=_['merge']({},_0x5c1ab1,_0x1514a9[_0xa417('0x57')]);return _0x2b6c84['getApplications'](_0x5c1ab1);}})[_0xa417('0x10')](function(_0x394a36){if(_0x394a36){_0x492ac5=_0x394a36['length'];if(!_0x1514a9[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x5c1ab1[_0xa417('0x1d')]=qs[_0xa417('0x1d')](_0x1514a9[_0xa417('0x4a')][_0xa417('0x1d')]);_0x5c1ab1[_0xa417('0x1c')]=qs['offset'](_0x1514a9[_0xa417('0x4a')][_0xa417('0x1c')]);}return _0x2b6c84['getApplications'](_0x5c1ab1);}})['then'](function(_0x379a36){if(_0x379a36){return _0x379a36?{'count':_0x492ac5,'rows':_0x379a36}:null;}})[_0xa417('0x10')](respondWithResult(_0x582d07,null))[_0xa417('0x5d')](handleError(_0x582d07,null));};exports[_0xa417('0x91')]=function(_0x483189,_0x1fdba7){var _0x338687={'raw':!![],'where':{}};var _0x1c895c={};var _0xecb230={'count':0x0,'rows':[]};return db[_0xa417('0x43')][_0xa417('0x6f')]({'where':{'id':_0x483189['params']['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1fdba7,null))[_0xa417('0x10')](function(_0x280e3f){if(_0x280e3f){_0x1c895c[_0xa417('0x48')]=_['keys'](db[_0xa417('0x92')][_0xa417('0x44')]);_0x1c895c[_0xa417('0x4a')]=_[_0xa417('0x49')](_0x483189['query']);_0x1c895c['filters']=_[_0xa417('0x4c')](_0x1c895c['model'],_0x1c895c[_0xa417('0x4a')]);_0x338687[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x1c895c['model'],qs[_0xa417('0x4e')](_0x483189[_0xa417('0x4a')][_0xa417('0x4e')]));_0x338687[_0xa417('0x4d')]=_0x338687[_0xa417('0x4d')][_0xa417('0x4f')]?_0x338687[_0xa417('0x4d')]:_0x1c895c[_0xa417('0x48')];if(!_0x483189[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x338687['limit']=qs[_0xa417('0x1d')](_0x483189[_0xa417('0x4a')]['limit']);_0x338687[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0x483189['query'][_0xa417('0x1c')]);}_0x338687[_0xa417('0x69')]=qs[_0xa417('0x51')](_0x483189['query'][_0xa417('0x51')]);_0x338687[_0xa417('0x52')]=qs[_0xa417('0x4b')](_[_0xa417('0x53')](_0x483189['query'],_0x1c895c[_0xa417('0x4b')]));_0x338687[_0xa417('0x52')][_0xa417('0x6a')]=_0x280e3f['id'];if(_0x483189[_0xa417('0x4a')][_0xa417('0x56')]){_0x338687[_0xa417('0x52')]=_[_0xa417('0x54')](_0x338687['where'],{'$or':_['map'](_0x338687['attributes'],function(_0x4c75f8){var _0x400893={};_0x400893[_0x4c75f8]={'$like':'%'+_0x483189[_0xa417('0x4a')]['filter']+'%'};return _0x400893;})});}if(_0x483189[_0xa417('0x4a')][_0xa417('0x93')]){var _0x26b6b9=_0x483189[_0xa417('0x4a')]['$gte'][_0xa417('0x94')](',');var _0x16b448={};_0x16b448[_0x26b6b9[0x0]]={'$gte':moment(_0x26b6b9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x338687['where']=_['merge'](_0x338687['where'],_0x16b448);}_0x338687=_[_0xa417('0x54')]({},_0x338687,_0x483189['options']);return db[_0xa417('0x92')][_0xa417('0x1f')]({'where':_0x338687[_0xa417('0x52')]})[_0xa417('0x10')](function(_0x3b8565){_0xecb230[_0xa417('0x1f')]=_0x3b8565;if(_0x483189[_0xa417('0x4a')]['includeAll']){_0x338687[_0xa417('0x58')]=[{'all':!![]}];}return db[_0xa417('0x92')][_0xa417('0x71')](_0x338687);})[_0xa417('0x10')](function(_0x5d51e6){if(_0x483189['query'][_0xa417('0x95')]===_0xa417('0x96')){for(var _0x5afcd6=0x0;_0x5afcd6<_0x5d51e6['length'];_0x5afcd6++){_0x5d51e6[_0x5afcd6]['body']=juice(_0x5d51e6[_0x5afcd6][_0xa417('0x5e')]);}}_0xecb230['rows']=_0x5d51e6;return _0xecb230;});}})['then'](respondWithFilteredResult(_0x1fdba7,_0x338687))[_0xa417('0x5d')](handleError(_0x1fdba7,null));};exports['send']=function(_0x23afdf,_0x55d3be){var _0x4ec66a,_0x18fc9d={},_0x2603fe;if(_0x23afdf[_0xa417('0x5e')]['to']){_0x2603fe=_0x23afdf['body']['to'][_0xa417('0x94')](',')[0x0];}return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x23afdf[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x97')],'as':'List','include':[{'model':db[_0xa417('0x98')],'as':'Contacts','where':{'email':_0x2603fe},'limit':0x1,'order':[[_0xa417('0x99'),_0xa417('0x9a')]]}]},{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e'),'raw':!![],'include':[{'model':db[_0xa417('0x9b')],'as':_0xa417('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x55d3be,null))[_0xa417('0x10')](function(_0x1234b9){if(!_0x1234b9)return;_0x4ec66a=_0x1234b9;if(!_0x1234b9[_0xa417('0x3e')])throw new Error(_0xa417('0x9c'));if(_[_0xa417('0x76')](_0x23afdf[_0xa417('0x5e')]['from'])){_0x23afdf[_0xa417('0x5e')][_0xa417('0x9d')]=util[_0xa417('0x9e')]('%s\x20<%s>',_0x1234b9[_0xa417('0x28')],_0x1234b9[_0xa417('0x74')]||_0x1234b9['Smtp'][_0xa417('0x33')]);}if(_0x23afdf['body'][_0xa417('0x9f')]&&_0x23afdf[_0xa417('0x5e')][_0xa417('0x9f')][_0xa417('0x4f')]){for(var _0x59ce31=0x0;_0x59ce31<_0x23afdf[_0xa417('0x5e')][_0xa417('0x9f')]['length'];_0x59ce31+=0x1){_0x23afdf['body'][_0xa417('0x9f')][_0x59ce31]={'filename':_0x23afdf['body']['attachments'][_0x59ce31][_0xa417('0x28')],'path':path['join'](config['root'],'server/files/attachments',_0x23afdf['body'][_0xa417('0x9f')][_0x59ce31]['basename'])};}}var _0x5b61d9=_0x1234b9['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xa417('0xa0'),{'account':_0x5b61d9,'message':_0x23afdf[_0xa417('0x5e')]});})[_0xa417('0x10')](function(_0x36b0db){if(!_0x36b0db)return;_0x18fc9d=_0x36b0db;if(!_0x4ec66a[_0xa417('0xa1')])throw new Error(_0xa417('0xa2'));if(_0x4ec66a[_0xa417('0xa1')][_0xa417('0xa3')][_0xa417('0x4f')])return _0x4ec66a['List'][_0xa417('0xa3')][0x0];return db[_0xa417('0x98')][_0xa417('0x66')](_['defaults'](_0x23afdf['body'],{'firstName':_0x23afdf['body']['to'],'email':_0x23afdf['body']['to'],'phone':_0x23afdf[_0xa417('0x5e')]['to'],'ListId':_0x4ec66a[_0xa417('0x75')]}));})['then'](function(_0x3bdc97){if(!_0x3bdc97)return;var _0x344001={'UserId':_0x23afdf[_0xa417('0x33')]['id'],'ContactId':_0x3bdc97['id'],'MailAccountId':_0x4ec66a['id'],'inReplyTo':_0x18fc9d[_0xa417('0xa4')],'to':_0x23afdf['body'][_0xa417('0x9d')],'cc':_0x23afdf['body']['cc'],'subject':_0x23afdf['body'][_0xa417('0xa5')],'attach':_0x23afdf['body']['attach'],'firstMsgDirection':_0xa417('0xa6'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xa417('0xa6'),'Messages':[_[_0xa417('0x54')](_0x23afdf[_0xa417('0x5e')],{'messageId':_0x18fc9d[_0xa417('0xa4')],'sentAt':moment()[_0xa417('0x9e')](_0xa417('0xa7')),'read':!![],'MailAccountId':_0x4ec66a['id'],'UserId':_0x23afdf[_0xa417('0x33')]['id'],'ContactId':_0x3bdc97['id']})]};if(_0x23afdf[_0xa417('0x5e')][_0xa417('0xa8')]){_0x344001=_[_0xa417('0x54')](_0x344001,_0x23afdf[_0xa417('0x5e')][_0xa417('0xa8')]);}return db[_0xa417('0x82')][_0xa417('0x66')](_0x344001,{'include':[{'model':db[_0xa417('0x92')],'as':_0xa417('0xa9')}]});})[_0xa417('0x10')](respondWithResult(_0x55d3be,null))[_0xa417('0x5d')](handleError(_0x55d3be,null));};exports['verifySmtp']=function(_0x280837,_0x20939b){return db['MailAccount'][_0xa417('0x5c')]({'where':{'id':_0x280837[_0xa417('0x62')]['id']},'include':[{'model':db[_0xa417('0x40')],'as':_0xa417('0x3e'),'raw':!![],'include':[{'model':db[_0xa417('0x9b')],'as':_0xa417('0x9b'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20939b,null))['then'](function(_0x24a6f3){if(!_0x24a6f3['Smtp'])return;var _0x5412a4=_0x24a6f3['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x5412a4});})[_0xa417('0x10')](respondWithResult(_0x20939b,null))['catch'](handleError(_0x20939b,null));};exports['destroy']=function(_0x4e004d,_0x36ad9f){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x4e004d[_0xa417('0x62')]['id']}})['then'](handleEntityNotFound(_0x36ad9f,null))['then'](function(_0x1fad42){if(_0x1fad42&&_0x1fad42[_0xa417('0x3a')]){throw new db[(_0xa417('0xaa'))]['ValidationError'](_0xa417('0xab'));}return _0x1fad42;})[_0xa417('0x10')](removeEntity(_0x36ad9f,null))['catch'](handleError(_0x36ad9f,null));};exports['addAgents']=function(_0x295846,_0x3bd8a7){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x295846[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x3bd8a7,null))[_0xa417('0x10')](function(_0x266eb3){if(_0x266eb3){return _0x266eb3['addAgents'](_0x295846[_0xa417('0x5e')]['ids'],_[_0xa417('0xac')](_0x295846[_0xa417('0x5e')],[_0xa417('0x73'),'id'])||{})[_0xa417('0xad')](function(_0x446872){for(var _0x324156=0x0;_0x324156<_0x295846[_0xa417('0x5e')][_0xa417('0x73')]['length'];_0x324156+=0x1){socket[_0xa417('0xae')](_0xa417('0xaf'),{'UserId':Number(_0x295846['body']['ids'][_0x324156]),'MailAccountId':Number(_0x295846[_0xa417('0x62')]['id'])});}return _0x446872;});}})[_0xa417('0x10')](respondWithResult(_0x3bd8a7,null))[_0xa417('0x5d')](handleError(_0x3bd8a7,null));};exports['removeAgents']=function(_0x1556a4,_0x45c3ad){return db[_0xa417('0x43')][_0xa417('0x5c')]({'where':{'id':_0x1556a4[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x45c3ad,null))[_0xa417('0x10')](function(_0x2c2d3d){if(_0x2c2d3d){return _0x2c2d3d[_0xa417('0xb0')](_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')])[_0xa417('0x10')](function(){if(_[_0xa417('0xb1')](_0x1556a4['query']['ids'])){for(var _0x549ade=0x0;_0x549ade<_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')]['length'];_0x549ade+=0x1){socket[_0xa417('0xae')](_0xa417('0xb2'),{'UserId':Number(_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')][_0x549ade]),'MailAccountId':Number(_0x1556a4['params']['id'])});}}else{socket[_0xa417('0xae')]('userMailAccount:remove',{'UserId':Number(_0x1556a4[_0xa417('0x4a')][_0xa417('0x73')]),'MailAccountId':Number(_0x1556a4[_0xa417('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x45c3ad,null))[_0xa417('0x5d')](handleError(_0x45c3ad,null));};exports['getAgents']=function(_0xf3b244,_0x1934ab){var _0x47c738={};var _0x2821d3={};var _0x4f7e27;var _0x3c7ad5;return db['MailAccount'][_0xa417('0x6f')]({'where':{'id':_0xf3b244[_0xa417('0x62')]['id']}})[_0xa417('0x10')](handleEntityNotFound(_0x1934ab,null))[_0xa417('0x10')](function(_0x3820cc){if(_0x3820cc){_0x4f7e27=_0x3820cc;_0x2821d3[_0xa417('0x48')]=_['keys'](db[_0xa417('0xb3')][_0xa417('0x44')]);_0x2821d3[_0xa417('0x4a')]=_['keys'](_0xf3b244[_0xa417('0x4a')]);_0x2821d3[_0xa417('0x4b')]=_[_0xa417('0x4c')](_0x2821d3[_0xa417('0x48')],_0x2821d3[_0xa417('0x4a')]);_0x47c738[_0xa417('0x4d')]=_[_0xa417('0x4c')](_0x2821d3[_0xa417('0x48')],qs[_0xa417('0x4e')](_0xf3b244[_0xa417('0x4a')]['fields']));_0x47c738['attributes']=_0x47c738[_0xa417('0x4d')][_0xa417('0x4f')]?_0x47c738[_0xa417('0x4d')]:_0x2821d3[_0xa417('0x48')];_0x47c738['order']=qs['sort'](_0xf3b244[_0xa417('0x4a')][_0xa417('0x51')]);_0x47c738['where']=qs[_0xa417('0x4b')](_['pick'](_0xf3b244[_0xa417('0x4a')],_0x2821d3[_0xa417('0x4b')]));if(_0xf3b244[_0xa417('0x4a')]['filter']){_0x47c738[_0xa417('0x52')]=_['merge'](_0x47c738[_0xa417('0x52')],{'$or':_[_0xa417('0x42')](_0x47c738[_0xa417('0x4d')],function(_0x138a25){var _0xeaad06={};_0xeaad06[_0x138a25]={'$like':'%'+_0xf3b244['query'][_0xa417('0x56')]+'%'};return _0xeaad06;})});}_0x47c738=_[_0xa417('0x54')]({},_0x47c738,_0xf3b244[_0xa417('0x57')]);return _0x4f7e27['getAgents'](_0x47c738);}})[_0xa417('0x10')](function(_0x30e5aa){if(_0x30e5aa){_0x3c7ad5=_0x30e5aa[_0xa417('0x4f')];if(!_0xf3b244[_0xa417('0x4a')][_0xa417('0x70')](_0xa417('0x50'))){_0x47c738[_0xa417('0x1d')]=qs['limit'](_0xf3b244[_0xa417('0x4a')][_0xa417('0x1d')]);_0x47c738[_0xa417('0x1c')]=qs[_0xa417('0x1c')](_0xf3b244['query']['offset']);}return _0x4f7e27[_0xa417('0xb4')](_0x47c738);}})[_0xa417('0x10')](function(_0x21feb5){if(_0x21feb5){return _0x21feb5?{'count':_0x3c7ad5,'rows':_0x21feb5}:null;}})[_0xa417('0x10')](respondWithResult(_0x1934ab,null))[_0xa417('0x5d')](handleError(_0x1934ab,null));}; \ No newline at end of file +var _0x4bca=['true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','end','status','json','undefined','limit','offset','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','user','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','map','MailAccount','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','name','options','include','findAll','catch','show','params','Pause','mandatoryDispositionPause','keys','includeAll','body','provider','find','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','custom','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','getApplications','getMessages','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x4bca,0x1ae));var _0xa4bc=function(_0x219e9b,_0x2bf4fb){_0x219e9b=_0x219e9b-0x0;var _0x241544=_0x4bca[_0x219e9b];return _0x241544;};'use strict';var moment=require(_0xa4bc('0x0'));var BPromise=require(_0xa4bc('0x1'));var util=require(_0xa4bc('0x2'));var path=require(_0xa4bc('0x3'));var _=require(_0xa4bc('0x4'));var juice=require(_0xa4bc('0x5'));var Redis=require(_0xa4bc('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xa4bc('0x7'))(_0xa4bc('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa4bc('0x9')]=_[_0xa4bc('0xa')](config[_0xa4bc('0x9')],{'host':_0xa4bc('0xb'),'port':0x18eb});var socket=require(_0xa4bc('0xc'))(new Redis(config[_0xa4bc('0x9')]));require(_0xa4bc('0xd'))[_0xa4bc('0xe')](socket);var jayson=require(_0xa4bc('0xf'));var client=jayson[_0xa4bc('0x10')][_0xa4bc('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x2b80df,_0x3092c9,_0x401d8e,_0x537820){return new BPromise(function(_0x536526,_0x9874bb){var _0x79be42=_0x537820||client;return _0x79be42[_0xa4bc('0x12')](_0x2b80df,_0x401d8e)[_0xa4bc('0x13')](function(_0x14da67){logger['info'](_0xa4bc('0x14'),_0x3092c9,'request\x20sent');logger[_0xa4bc('0x15')](_0xa4bc('0x16'),_0x3092c9,_0xa4bc('0x17'),JSON[_0xa4bc('0x18')](_0x14da67));if(_0x14da67[_0xa4bc('0x19')]){if(_0x14da67['error'][_0xa4bc('0x1a')]===0x1f4){logger['error'](_0xa4bc('0x14'),_0x3092c9,_0x14da67[_0xa4bc('0x19')]['message']);return _0x9874bb(_0x14da67[_0xa4bc('0x19')][_0xa4bc('0x1b')]);}logger[_0xa4bc('0x19')]('MailAccount,\x20%s,\x20%s',_0x3092c9,_0x14da67[_0xa4bc('0x19')][_0xa4bc('0x1b')]);return _0x536526(_0x14da67[_0xa4bc('0x19')]['message']);}else{logger[_0xa4bc('0x1c')](_0xa4bc('0x14'),_0x3092c9,_0xa4bc('0x17'));_0x536526(_0x14da67['result']['message']);}})['catch'](function(_0x51a6fe){logger[_0xa4bc('0x19')](_0xa4bc('0x14'),_0x3092c9,_0x51a6fe);_0x9874bb(_0x51a6fe);});});}function respondWithStatusCode(_0x5cb040,_0x5555fe){_0x5555fe=_0x5555fe||0xcc;return function(_0x23ffa6){if(_0x23ffa6){return _0x5cb040['sendStatus'](_0x5555fe);}return _0x5cb040['status'](_0x5555fe)[_0xa4bc('0x1d')]();};}function respondWithResult(_0x4c424a,_0xdb54df){_0xdb54df=_0xdb54df||0xc8;return function(_0xd7eb66){if(_0xd7eb66){return _0x4c424a[_0xa4bc('0x1e')](_0xdb54df)[_0xa4bc('0x1f')](_0xd7eb66);}};}function respondWithFilteredResult(_0x1654dd,_0x23dd39){return function(_0x52fb73){if(_0x52fb73){var _0x501f68=typeof _0x23dd39['offset']===_0xa4bc('0x20')&&typeof _0x23dd39[_0xa4bc('0x21')]===_0xa4bc('0x20');var _0x16531c=_0x52fb73['count'];var _0x3abd3a=_0x501f68?0x0:_0x23dd39[_0xa4bc('0x22')];var _0x328440=_0x501f68?_0x52fb73[_0xa4bc('0x23')]:_0x23dd39[_0xa4bc('0x22')]+_0x23dd39[_0xa4bc('0x21')];var _0x20f237;if(_0x328440>=_0x16531c){_0x328440=_0x16531c;_0x20f237=0xc8;}else{_0x20f237=0xce;}_0x1654dd[_0xa4bc('0x1e')](_0x20f237);return _0x1654dd[_0xa4bc('0x24')](_0xa4bc('0x25'),_0x3abd3a+'-'+_0x328440+'/'+_0x16531c)[_0xa4bc('0x1f')](_0x52fb73);}return null;};}function saveUpdates(_0x38f486){return function(_0xa1c708){if(_0xa1c708){return _0xa1c708[_0xa4bc('0x26')](_0x38f486)[_0xa4bc('0x13')](function(_0x4633ff){return _0x4633ff;});}return null;};}function removeEntity(_0x1c52f5){return function(_0x218316){if(_0x218316){return _0x218316[_0xa4bc('0x27')]()[_0xa4bc('0x13')](function(){var _0x3d1b50=_0x218316[_0xa4bc('0x28')]({'plain':!![]});var _0x5c936a=_0xa4bc('0x29');return db[_0xa4bc('0x2a')][_0xa4bc('0x27')]({'where':{'type':_0x5c936a,'resourceId':_0x3d1b50['id']}})['then'](function(){return _0x218316;});})[_0xa4bc('0x13')](function(){_0x1c52f5[_0xa4bc('0x1e')](0xcc)[_0xa4bc('0x1d')]();});}};}function handleEntityNotFound(_0x46ed55){return function(_0x199dbc){if(!_0x199dbc){_0x46ed55['sendStatus'](0x194);}return _0x199dbc;};}function handleError(_0x4d68e1,_0x4421dc){_0x4421dc=_0x4421dc||0x1f4;return function(_0x1f0690){logger[_0xa4bc('0x19')](_0x1f0690['stack']);if(_0x1f0690['name']){delete _0x1f0690['name'];}_0x4d68e1['status'](_0x4421dc)[_0xa4bc('0x2b')](_0x1f0690);};}function getImapHost(_0x2a6a9e){switch(_0x2a6a9e){case _0xa4bc('0x2c'):return _0xa4bc('0x2d');case _0xa4bc('0x2e'):return _0xa4bc('0x2f');case'hotmail':return _0xa4bc('0x30');case _0xa4bc('0x31'):return'outlook.office365.com';}throw new Error(_0xa4bc('0x32'),_0x2a6a9e);}function getSmtpHost(_0x59dc28){switch(_0x59dc28){case'gmail':return'smtp.gmail.com';case'yahoo':return _0xa4bc('0x33');case _0xa4bc('0x34'):return _0xa4bc('0x35');case _0xa4bc('0x31'):return _0xa4bc('0x36');}throw new Error(_0xa4bc('0x32'),_0x59dc28);}function getAuthenticationOptions(_0x20f186,_0x283f51){var _0x2bdfbe={};var _0x3ccc50={};if(_0x20f186){_0x2bdfbe['user']=_0x3ccc50['user']=_0x283f51[_0xa4bc('0x37')];_0x2bdfbe[_0xa4bc('0x38')]=_0x3ccc50[_0xa4bc('0x39')]=_0x283f51[_0xa4bc('0x38')];if(_0x283f51['modernAuthentication']){_0x2bdfbe[_0xa4bc('0x3a')]=_0x3ccc50['modernAuthentication']=!![];_0x2bdfbe[_0xa4bc('0x3b')]=_0x3ccc50[_0xa4bc('0x3b')]=_0x283f51[_0xa4bc('0x3b')];_0x2bdfbe[_0xa4bc('0x38')]=_0x3ccc50[_0xa4bc('0x39')]=null;}else{_0x2bdfbe['CloudProviderId']=_0x3ccc50[_0xa4bc('0x3b')]=null;}_0x2bdfbe[_0xa4bc('0x3c')]=getImapHost(_0x20f186);_0x2bdfbe[_0xa4bc('0x3d')]=0x3e1;_0x3ccc50[_0xa4bc('0x3c')]=getSmtpHost(_0x20f186);_0x3ccc50[_0xa4bc('0x3d')]=0x24b;_0x3ccc50[_0xa4bc('0x3e')]=![];_0x2bdfbe[_0xa4bc('0x3f')]=_0x3ccc50[_0xa4bc('0x3f')]=null;}else{if(_0x283f51['authentication']){_0x2bdfbe[_0xa4bc('0x40')]=_0x3ccc50['user']=_0x283f51[_0xa4bc('0x37')];_0x2bdfbe[_0xa4bc('0x38')]=_0x3ccc50[_0xa4bc('0x39')]=_0x283f51[_0xa4bc('0x38')];}else{_0x2bdfbe[_0xa4bc('0x41')]=_0x3ccc50[_0xa4bc('0x41')]=![];_0x2bdfbe[_0xa4bc('0x40')]=_0x3ccc50[_0xa4bc('0x40')]=null;_0x2bdfbe['password']=_0x3ccc50[_0xa4bc('0x39')]=null;}_0x2bdfbe['host']=_0x283f51[_0xa4bc('0x42')]['host'];_0x2bdfbe['port']=_0x283f51[_0xa4bc('0x42')][_0xa4bc('0x3d')];_0x3ccc50['host']=_0x283f51[_0xa4bc('0x43')][_0xa4bc('0x3c')];_0x3ccc50[_0xa4bc('0x3d')]=_0x283f51[_0xa4bc('0x43')]['port'];}return{'Imap':_0x2bdfbe,'Smtp':_0x3ccc50};}exports[_0xa4bc('0x44')]=function(_0x30e542,_0x48cd41){var _0x2a73e1={'include':[{'model':db[_0xa4bc('0x45')],'as':'Imap'},{'model':db[_0xa4bc('0x46')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x38a86a={},_0x3bde21={'count':0x0,'rows':[]};var _0x1daff1=_[_0xa4bc('0x47')](db[_0xa4bc('0x48')][_0xa4bc('0x49')],function(_0x525de7){return{'name':_0x525de7[_0xa4bc('0x4a')],'type':_0x525de7[_0xa4bc('0x4b')][_0xa4bc('0x4c')]};});_0x38a86a[_0xa4bc('0x4d')]=_[_0xa4bc('0x47')](_0x1daff1,'name');_0x38a86a['query']=_['keys'](_0x30e542['query']);_0x38a86a[_0xa4bc('0x4e')]=_['intersection'](_0x38a86a[_0xa4bc('0x4d')],_0x38a86a[_0xa4bc('0x4f')]);_0x2a73e1[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x38a86a[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x30e542[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x2a73e1[_0xa4bc('0x50')]=_0x2a73e1[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x2a73e1['attributes']:_0x38a86a[_0xa4bc('0x4d')];if(!_0x30e542[_0xa4bc('0x4f')][_0xa4bc('0x54')](_0xa4bc('0x55'))){_0x2a73e1['limit']=qs[_0xa4bc('0x21')](_0x30e542['query'][_0xa4bc('0x21')]);_0x2a73e1[_0xa4bc('0x22')]=qs[_0xa4bc('0x22')](_0x30e542['query'][_0xa4bc('0x22')]);}_0x2a73e1['order']=qs[_0xa4bc('0x56')](_0x30e542[_0xa4bc('0x4f')]['sort']);_0x2a73e1['where']=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x30e542[_0xa4bc('0x4f')],_0x38a86a[_0xa4bc('0x4e')]),_0x1daff1);if(_0x30e542[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x2a73e1[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x2a73e1['where'],{'$or':_[_0xa4bc('0x47')](_0x1daff1,function(_0x39742a){if(_0x39742a[_0xa4bc('0x4b')]!==_0xa4bc('0x5b')){var _0x4baca1={};_0x4baca1[_0x39742a[_0xa4bc('0x5c')]]={'$like':'%'+_0x30e542[_0xa4bc('0x4f')][_0xa4bc('0x58')]+'%'};return _0x4baca1;}})});}_0x2a73e1=_['merge']({},_0x2a73e1,_0x30e542[_0xa4bc('0x5d')]);var _0x1f91bf={'where':_0x2a73e1[_0xa4bc('0x59')]};return db['MailAccount'][_0xa4bc('0x23')](_0x1f91bf)['then'](function(_0x28b5a){_0x3bde21[_0xa4bc('0x23')]=_0x28b5a;if(_0x30e542['query']['includeAll']){_0x2a73e1[_0xa4bc('0x5e')]=[{'all':!![]}];}return db[_0xa4bc('0x48')][_0xa4bc('0x5f')](_0x2a73e1);})[_0xa4bc('0x13')](function(_0x1f9f93){_0x3bde21['rows']=_0x1f9f93;return _0x3bde21;})[_0xa4bc('0x13')](respondWithFilteredResult(_0x48cd41,_0x2a73e1))[_0xa4bc('0x60')](handleError(_0x48cd41,null));};exports[_0xa4bc('0x61')]=function(_0x5d78db,_0xbceca6){var _0x27050b={'raw':![],'where':{'id':_0x5d78db[_0xa4bc('0x62')]['id']},'include':[{'model':db[_0xa4bc('0x45')],'as':_0xa4bc('0x42')},{'model':db[_0xa4bc('0x46')],'as':_0xa4bc('0x43')},{'model':db[_0xa4bc('0x63')],'as':_0xa4bc('0x64')}]},_0x572030={};_0x572030['model']=_[_0xa4bc('0x65')](db['MailAccount']['rawAttributes']);_0x572030[_0xa4bc('0x4f')]=_['keys'](_0x5d78db['query']);_0x572030[_0xa4bc('0x4e')]=_['intersection'](_0x572030[_0xa4bc('0x4d')],_0x572030[_0xa4bc('0x4f')]);_0x27050b[_0xa4bc('0x50')]=_['intersection'](_0x572030[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x5d78db[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x27050b[_0xa4bc('0x50')]=_0x27050b[_0xa4bc('0x50')]['length']?_0x27050b[_0xa4bc('0x50')]:_0x572030[_0xa4bc('0x4d')];if(_0x5d78db['query'][_0xa4bc('0x66')]){_0x27050b[_0xa4bc('0x5e')]=[{'all':!![]}];}_0x27050b=_[_0xa4bc('0x5a')]({},_0x27050b,_0x5d78db[_0xa4bc('0x5d')]);return db['MailAccount']['find'](_0x27050b)[_0xa4bc('0x13')](handleEntityNotFound(_0xbceca6,null))[_0xa4bc('0x13')](respondWithResult(_0xbceca6,null))[_0xa4bc('0x60')](handleError(_0xbceca6,null));};exports[_0xa4bc('0x26')]=function(_0x4e071f,_0x4ffd68){if(_0x4e071f['body']['id']){delete _0x4e071f[_0xa4bc('0x67')]['id'];}var _0x3ceb72=_0x4e071f[_0xa4bc('0x67')]['provider']==='custom'?null:_0x4e071f['body'][_0xa4bc('0x68')];var _0x2a9a7e=_0x4e071f[_0xa4bc('0x67')]['Imap']||{};var _0x3484e9=_0x4e071f['body'][_0xa4bc('0x43')]||{};if(_0x3ceb72){_0x2a9a7e[_0xa4bc('0x3c')]=getImapHost(_0x3ceb72);_0x2a9a7e[_0xa4bc('0x3d')]=0x3e1;_0x3484e9[_0xa4bc('0x3c')]=getSmtpHost(_0x3ceb72);_0x3484e9[_0xa4bc('0x3d')]=0x24b;_0x3484e9[_0xa4bc('0x3e')]=![];}if(_0x3484e9['modernAuthentication']){_0x3484e9[_0xa4bc('0x3e')]=![];}else{_0x3484e9[_0xa4bc('0x3b')]=null;}if(!_0x2a9a7e[_0xa4bc('0x3a')])_0x2a9a7e['CloudProviderId']=null;_0x4e071f['body'][_0xa4bc('0x42')]=_0x2a9a7e;_0x4e071f[_0xa4bc('0x67')]['Smtp']=_0x3484e9;return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x4e071f[_0xa4bc('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xa4bc('0x42')},{'model':db['MailServerOut'],'as':_0xa4bc('0x43')},{'model':db[_0xa4bc('0x63')],'as':_0xa4bc('0x64')}]})[_0xa4bc('0x13')](handleEntityNotFound(_0x4ffd68,null))[_0xa4bc('0x13')](function(_0x5bf195){if(!_0x5bf195)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5bf195[_0xa4bc('0x3f')])delete _0x4e071f[_0xa4bc('0x67')][_0xa4bc('0x42')];return _0x5bf195;})[_0xa4bc('0x13')](saveUpdates(_0x4e071f[_0xa4bc('0x67')],null))[_0xa4bc('0x13')](function(_0x365ac9){if(!_0x4e071f['body']['Imap'])return _0x365ac9;return db['MailServerIn'][_0xa4bc('0x26')](_0x4e071f['body'][_0xa4bc('0x42')],{'where':{'MailAccountId':_0x365ac9['id']}})[_0xa4bc('0x13')](function(){return _0x365ac9;});})['then'](function(_0x5163ec){if(!_0x4e071f[_0xa4bc('0x67')][_0xa4bc('0x43')])return _0x5163ec;return db[_0xa4bc('0x46')]['update'](_0x4e071f[_0xa4bc('0x67')][_0xa4bc('0x43')],{'where':{'MailAccountId':_0x5163ec['id']}})[_0xa4bc('0x13')](function(){return _0x5163ec;});})[_0xa4bc('0x13')](respondWithResult(_0x4ffd68,null))[_0xa4bc('0x60')](handleError(_0x4ffd68,null));};exports[_0xa4bc('0x6a')]=function(_0x59c4d4,_0x5b5bc1){return db[_0xa4bc('0x48')][_0xa4bc('0x6a')]()['then'](respondWithResult(_0x5b5bc1,null))[_0xa4bc('0x60')](handleError(_0x5b5bc1,null));};exports[_0xa4bc('0x6b')]=function(_0x4026cf,_0x303036){if(_0x4026cf[_0xa4bc('0x67')]['id']){delete _0x4026cf[_0xa4bc('0x67')]['id'];}return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x4026cf[_0xa4bc('0x62')]['id']}})['then'](handleEntityNotFound(_0x303036,null))[_0xa4bc('0x13')](function(_0x1afc23){if(_0x1afc23){_0x4026cf['body'][_0xa4bc('0x6c')]=_0x1afc23['id'];return db[_0xa4bc('0x6d')][_0xa4bc('0x6e')](_0x4026cf[_0xa4bc('0x67')]);}})['then'](respondWithResult(_0x303036,null))[_0xa4bc('0x60')](handleError(_0x303036,null));};exports[_0xa4bc('0x6f')]=function(_0x5f3a99,_0x35e8bf){var _0x54d457={'raw':![],'where':{}};var _0x2eeba0={};var _0x42978e={'count':0x0,'rows':[]};return db[_0xa4bc('0x48')]['findOne']({'where':{'id':_0x5f3a99[_0xa4bc('0x62')]['id']}})['then'](handleEntityNotFound(_0x35e8bf,null))[_0xa4bc('0x13')](function(_0x3bc6f7){if(_0x3bc6f7){_0x2eeba0[_0xa4bc('0x4d')]=_[_0xa4bc('0x65')](db[_0xa4bc('0x6d')][_0xa4bc('0x49')]);_0x2eeba0[_0xa4bc('0x4f')]=_[_0xa4bc('0x65')](_0x5f3a99[_0xa4bc('0x4f')]);_0x2eeba0[_0xa4bc('0x4e')]=_[_0xa4bc('0x51')](_0x2eeba0['model'],_0x2eeba0[_0xa4bc('0x4f')]);_0x54d457[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x2eeba0[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x5f3a99[_0xa4bc('0x4f')]['fields']));_0x54d457['attributes']=_0x54d457[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x54d457[_0xa4bc('0x50')]:_0x2eeba0[_0xa4bc('0x4d')];if(!_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x54')]('nolimit')){_0x54d457[_0xa4bc('0x21')]=qs[_0xa4bc('0x21')](_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x21')]);_0x54d457[_0xa4bc('0x22')]=qs[_0xa4bc('0x22')](_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x22')]);}_0x54d457[_0xa4bc('0x70')]=qs[_0xa4bc('0x56')](_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x56')]);_0x54d457[_0xa4bc('0x59')]=qs[_0xa4bc('0x4e')](_['pick'](_0x5f3a99[_0xa4bc('0x4f')],_0x2eeba0[_0xa4bc('0x4e')]));_0x54d457[_0xa4bc('0x59')][_0xa4bc('0x6c')]=_0x3bc6f7['id'];if(_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x54d457[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x54d457['where'],{'$or':_[_0xa4bc('0x47')](_0x54d457['attributes'],function(_0x182064){var _0x546f88={};_0x546f88[_0x182064]={'$like':'%'+_0x5f3a99[_0xa4bc('0x4f')][_0xa4bc('0x58')]+'%'};return _0x546f88;})});}_0x54d457=_[_0xa4bc('0x5a')]({},_0x54d457,_0x5f3a99[_0xa4bc('0x5d')]);return db['Disposition']['count']({'where':_0x54d457['where']})['then'](function(_0x5371e6){_0x42978e[_0xa4bc('0x23')]=_0x5371e6;if(_0x5f3a99[_0xa4bc('0x4f')]['includeAll']){_0x54d457[_0xa4bc('0x5e')]=[{'all':!![]}];}return db[_0xa4bc('0x6d')][_0xa4bc('0x5f')](_0x54d457);})['then'](function(_0x9a945b){_0x42978e[_0xa4bc('0x71')]=_0x9a945b;return _0x42978e;});}})['then'](respondWithFilteredResult(_0x35e8bf,_0x54d457))[_0xa4bc('0x60')](handleError(_0x35e8bf,null));};exports['removeDispositions']=function(_0x36f3f4,_0x3a32ea){return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x36f3f4['params']['id']}})['then'](handleEntityNotFound(_0x3a32ea,null))[_0xa4bc('0x13')](function(_0x3e1cc9){if(_0x3e1cc9){return _0x3e1cc9[_0xa4bc('0x72')](_0x36f3f4[_0xa4bc('0x4f')][_0xa4bc('0x73')]);}})[_0xa4bc('0x13')](respondWithStatusCode(_0x3a32ea,null))[_0xa4bc('0x60')](handleError(_0x3a32ea,null));};exports[_0xa4bc('0x74')]=function(_0x7958cd,_0x12120e){if(_0x7958cd[_0xa4bc('0x67')]['id']){delete _0x7958cd[_0xa4bc('0x67')]['id'];}return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x7958cd[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x12120e,null))[_0xa4bc('0x13')](function(_0x5afab9){if(_0x5afab9){_0x7958cd[_0xa4bc('0x67')][_0xa4bc('0x6c')]=_0x5afab9['id'];return db[_0xa4bc('0x75')][_0xa4bc('0x6e')](_0x7958cd[_0xa4bc('0x67')]);}})[_0xa4bc('0x13')](respondWithResult(_0x12120e,null))[_0xa4bc('0x60')](handleError(_0x12120e,null));};exports[_0xa4bc('0x76')]=function(_0x7962a3,_0x565c86){var _0x49cc8a={'raw':![],'where':{}};var _0x12eb55={};var _0x367319={'count':0x0,'rows':[]};return db['MailAccount'][_0xa4bc('0x77')]({'where':{'id':_0x7962a3[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x565c86,null))[_0xa4bc('0x13')](function(_0xbd132c){if(_0xbd132c){_0x12eb55[_0xa4bc('0x4d')]=_[_0xa4bc('0x65')](db[_0xa4bc('0x75')]['rawAttributes']);_0x12eb55[_0xa4bc('0x4f')]=_[_0xa4bc('0x65')](_0x7962a3['query']);_0x12eb55[_0xa4bc('0x4e')]=_['intersection'](_0x12eb55[_0xa4bc('0x4d')],_0x12eb55[_0xa4bc('0x4f')]);_0x49cc8a[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x12eb55[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x7962a3[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x49cc8a['attributes']=_0x49cc8a[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x49cc8a[_0xa4bc('0x50')]:_0x12eb55[_0xa4bc('0x4d')];if(!_0x7962a3['query'][_0xa4bc('0x54')](_0xa4bc('0x55'))){_0x49cc8a[_0xa4bc('0x21')]=qs['limit'](_0x7962a3[_0xa4bc('0x4f')]['limit']);_0x49cc8a['offset']=qs[_0xa4bc('0x22')](_0x7962a3[_0xa4bc('0x4f')][_0xa4bc('0x22')]);}_0x49cc8a[_0xa4bc('0x70')]=qs[_0xa4bc('0x56')](_0x7962a3['query'][_0xa4bc('0x56')]);_0x49cc8a[_0xa4bc('0x59')]=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x7962a3[_0xa4bc('0x4f')],_0x12eb55[_0xa4bc('0x4e')]));_0x49cc8a[_0xa4bc('0x59')][_0xa4bc('0x6c')]=_0xbd132c['id'];if(_0x7962a3[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x49cc8a[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x49cc8a['where'],{'$or':_[_0xa4bc('0x47')](_0x49cc8a[_0xa4bc('0x50')],function(_0x408219){var _0x2986f7={};_0x2986f7[_0x408219]={'$like':'%'+_0x7962a3[_0xa4bc('0x4f')][_0xa4bc('0x58')]+'%'};return _0x2986f7;})});}_0x49cc8a=_[_0xa4bc('0x5a')]({},_0x49cc8a,_0x7962a3[_0xa4bc('0x5d')]);return db[_0xa4bc('0x75')][_0xa4bc('0x23')]({'where':_0x49cc8a['where']})['then'](function(_0x4e19ae){_0x367319['count']=_0x4e19ae;if(_0x7962a3[_0xa4bc('0x4f')][_0xa4bc('0x66')]){_0x49cc8a[_0xa4bc('0x5e')]=[{'all':!![]}];}return db[_0xa4bc('0x75')]['findAll'](_0x49cc8a);})[_0xa4bc('0x13')](function(_0x289a34){_0x367319[_0xa4bc('0x71')]=_0x289a34;return _0x367319;});}})[_0xa4bc('0x13')](respondWithFilteredResult(_0x565c86,_0x49cc8a))[_0xa4bc('0x60')](handleError(_0x565c86,null));};exports[_0xa4bc('0x78')]=function(_0x2d6514,_0x18bcfb){return db['MailAccount'][_0xa4bc('0x69')]({'where':{'id':_0x2d6514[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x18bcfb,null))[_0xa4bc('0x13')](function(_0x145745){if(_0x145745){return _0x145745[_0xa4bc('0x78')](_0x2d6514[_0xa4bc('0x4f')][_0xa4bc('0x73')]);}})[_0xa4bc('0x13')](respondWithStatusCode(_0x18bcfb,null))[_0xa4bc('0x60')](handleError(_0x18bcfb,null));};exports[_0xa4bc('0x6e')]=function(_0x406b52,_0x5ac223){var _0x78e07b={'name':_0x406b52['body'][_0xa4bc('0x5c')],'key':_0x406b52[_0xa4bc('0x67')]['key'],'provider':_0x406b52['body'][_0xa4bc('0x68')]===_0xa4bc('0x79')?null:_0x406b52[_0xa4bc('0x67')][_0xa4bc('0x68')],'email':_0x406b52[_0xa4bc('0x67')][_0xa4bc('0x7a')],'ListId':_0x406b52['body'][_0xa4bc('0x7b')],'active':!_['isNil'](_0x406b52[_0xa4bc('0x67')]['active'])?_0x406b52[_0xa4bc('0x67')][_0xa4bc('0x7c')]:!![],'description':_0x406b52[_0xa4bc('0x67')][_0xa4bc('0x7d')]||null};var _0x1b70d3=getAuthenticationOptions(_0x78e07b[_0xa4bc('0x68')],_0x406b52[_0xa4bc('0x67')]);_0x78e07b['Imap']=_0x1b70d3['Imap'];_0x78e07b[_0xa4bc('0x43')]=_0x1b70d3[_0xa4bc('0x43')];return db[_0xa4bc('0x48')]['create'](_0x78e07b,{'include':[{'model':db[_0xa4bc('0x46')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xa4bc('0x42')}]})[_0xa4bc('0x13')](function(_0xe12201){var _0x5b0921=_0x406b52[_0xa4bc('0x40')][_0xa4bc('0x28')]({'plain':!![]});if(!_0x5b0921)throw new Error(_0xa4bc('0x7e'));if(_0x5b0921[_0xa4bc('0x7f')]==='user'){var _0x485220=_0xe12201[_0xa4bc('0x28')]({'plain':!![]});return db['UserProfileSection'][_0xa4bc('0x69')]({'where':{'name':_0xa4bc('0x29'),'userProfileId':_0x5b0921[_0xa4bc('0x80')]},'raw':!![]})[_0xa4bc('0x13')](function(_0x399612){if(_0x399612&&_0x399612['autoAssociation']===0x0){return db[_0xa4bc('0x2a')][_0xa4bc('0x6e')]({'name':_0x485220[_0xa4bc('0x5c')],'resourceId':_0x485220['id'],'type':_0x399612['name'],'sectionId':_0x399612['id']},{})[_0xa4bc('0x13')](function(){return _0xe12201;});}else{return _0xe12201;}})[_0xa4bc('0x60')](function(_0x5ed997){logger[_0xa4bc('0x19')](_0xa4bc('0x81'),_0x5ed997);throw _0x5ed997;});}return _0xe12201;})['then'](respondWithResult(_0x5ac223,0xc9))['catch'](handleError(_0x5ac223,null));};exports['getImap']=function(_0xbeed31,_0x3de128){return db[_0xa4bc('0x48')][_0xa4bc('0x77')]({'where':{'id':_0xbeed31[_0xa4bc('0x62')]['id']}})['then'](handleEntityNotFound(_0x3de128,null))[_0xa4bc('0x13')](function(_0x4a1ccd){if(_0x4a1ccd){return _0x4a1ccd['getImap']();}return null;})[_0xa4bc('0x13')](respondWithResult(_0x3de128,null))[_0xa4bc('0x60')](handleError(_0x3de128,null));};exports['addImap']=function(_0x74a11e,_0x3264c1){if(_0x74a11e[_0xa4bc('0x67')]['id']){delete _0x74a11e['body']['id'];}return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x74a11e['params']['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x3264c1,null))[_0xa4bc('0x13')](function(_0x5fdb0a){if(_0x5fdb0a){_0x74a11e[_0xa4bc('0x67')][_0xa4bc('0x6c')]=_0x5fdb0a['id'];return db[_0xa4bc('0x45')][_0xa4bc('0x6e')](_0x74a11e[_0xa4bc('0x67')]);}})['then'](respondWithResult(_0x3264c1,null))['catch'](handleError(_0x3264c1,null));};exports[_0xa4bc('0x82')]=function(_0x398dd4,_0x4793c1){return db[_0xa4bc('0x48')][_0xa4bc('0x77')]({'where':{'id':_0x398dd4[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x4793c1,null))[_0xa4bc('0x13')](function(_0x107306){if(_0x107306){return _0x107306['setImap'](null);}return null;})[_0xa4bc('0x13')](respondWithStatusCode(_0x4793c1,null))[_0xa4bc('0x60')](handleError(_0x4793c1,null));};exports[_0xa4bc('0x83')]=function(_0x5f3fc1,_0x510623){return db[_0xa4bc('0x48')][_0xa4bc('0x77')]({'where':{'id':_0x5f3fc1[_0xa4bc('0x62')]['id']}})['then'](handleEntityNotFound(_0x510623,null))[_0xa4bc('0x13')](function(_0x2568bc){if(_0x2568bc){return _0x2568bc[_0xa4bc('0x83')]();}return null;})['then'](respondWithResult(_0x510623,null))[_0xa4bc('0x60')](handleError(_0x510623,null));};exports['addSmtp']=function(_0x2f6c7e,_0x47a9fb){if(_0x2f6c7e[_0xa4bc('0x67')]['id']){delete _0x2f6c7e['body']['id'];}return db['MailAccount'][_0xa4bc('0x69')]({'where':{'id':_0x2f6c7e[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x47a9fb,null))[_0xa4bc('0x13')](function(_0x53b561){if(_0x53b561){_0x2f6c7e[_0xa4bc('0x67')]['MailAccountId']=_0x53b561['id'];return db[_0xa4bc('0x46')][_0xa4bc('0x6e')](_0x2f6c7e[_0xa4bc('0x67')]);}})[_0xa4bc('0x13')](respondWithResult(_0x47a9fb,null))[_0xa4bc('0x60')](handleError(_0x47a9fb,null));};exports[_0xa4bc('0x84')]=function(_0x32139d,_0x14d3c4){return db['MailAccount']['findOne']({'where':{'id':_0x32139d['params']['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x14d3c4,null))[_0xa4bc('0x13')](function(_0x5e3f5a){if(_0x5e3f5a){return _0x5e3f5a[_0xa4bc('0x85')](null);}return null;})[_0xa4bc('0x13')](respondWithStatusCode(_0x14d3c4,null))[_0xa4bc('0x60')](handleError(_0x14d3c4,null));};exports[_0xa4bc('0x86')]=function(_0x3b03c4,_0xdcf526){return db['MailInteraction'][_0xa4bc('0x69')]({'where':{'id':_0x3b03c4['params']['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0xdcf526,null))[_0xa4bc('0x13')](function(_0x2a8288){if(_0x2a8288){return _0x2a8288[_0xa4bc('0x86')](_0x3b03c4[_0xa4bc('0x67')]['ids'],_[_0xa4bc('0x87')](_0x3b03c4['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xdcf526,null))['catch'](handleError(_0xdcf526,null));};exports[_0xa4bc('0x88')]=function(_0x3b876a,_0x185cc0){var _0x201c6b={'raw':![],'where':{}};var _0x39bca3={};var _0x10bcd4={'count':0x0,'rows':[]};return db[_0xa4bc('0x48')][_0xa4bc('0x77')]({'where':{'id':_0x3b876a[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x185cc0,null))[_0xa4bc('0x13')](function(_0x58f515){if(_0x58f515){_0x39bca3[_0xa4bc('0x4d')]=_['keys'](db[_0xa4bc('0x89')]['rawAttributes']);_0x39bca3[_0xa4bc('0x4f')]=_['keys'](_0x3b876a['query']);_0x39bca3[_0xa4bc('0x4e')]=_[_0xa4bc('0x51')](_0x39bca3[_0xa4bc('0x4d')],_0x39bca3[_0xa4bc('0x4f')]);_0x201c6b[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x39bca3[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x201c6b['attributes']=_0x201c6b['attributes'][_0xa4bc('0x53')]?_0x201c6b['attributes']:_0x39bca3[_0xa4bc('0x4d')];if(!_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x54')](_0xa4bc('0x55'))){_0x201c6b['limit']=qs['limit'](_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x21')]);_0x201c6b[_0xa4bc('0x22')]=qs[_0xa4bc('0x22')](_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x22')]);}_0x201c6b[_0xa4bc('0x70')]=qs['sort'](_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x56')]);_0x201c6b['where']=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x3b876a[_0xa4bc('0x4f')],_0x39bca3[_0xa4bc('0x4e')]));_0x201c6b[_0xa4bc('0x59')][_0xa4bc('0x6c')]=_0x58f515['id'];if(_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x201c6b[_0xa4bc('0x59')]=_['merge'](_0x201c6b[_0xa4bc('0x59')],{'$or':_['map'](_0x201c6b['attributes'],function(_0x3843b6){var _0x3032fe={};_0x3032fe[_0x3843b6]={'$like':'%'+_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x58')]+'%'};return _0x3032fe;})});}_0x201c6b=_[_0xa4bc('0x5a')]({},_0x201c6b,_0x3b876a[_0xa4bc('0x5d')]);return db[_0xa4bc('0x89')][_0xa4bc('0x23')]({'where':_0x201c6b[_0xa4bc('0x59')]})[_0xa4bc('0x13')](function(_0x18577a){_0x10bcd4[_0xa4bc('0x23')]=_0x18577a;if(_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x66')]){_0x201c6b['include']=[{'model':db[_0xa4bc('0x8a')],'as':_0xa4bc('0x8b'),'required':![]},{'model':db[_0xa4bc('0x8c')],'as':_0xa4bc('0x8d'),'attributes':[_0xa4bc('0x5c'),_0xa4bc('0x8e'),_0xa4bc('0x8f')],'required':![]},{'model':db[_0xa4bc('0x90')],'as':'Tags','attributes':['id',_0xa4bc('0x5c'),_0xa4bc('0x91')],'where':_0x3b876a['query']['tag']?{'id':_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x92')]}:undefined,'required':_0x3b876a[_0xa4bc('0x4f')][_0xa4bc('0x92')]?!![]:![]}];}return db[_0xa4bc('0x89')]['findAll'](_0x201c6b);})[_0xa4bc('0x13')](function(_0x37c678){_0x10bcd4[_0xa4bc('0x71')]=_0x37c678;return _0x10bcd4;});}})[_0xa4bc('0x13')](respondWithFilteredResult(_0x185cc0,_0x201c6b))['catch'](handleError(_0x185cc0,null));};exports['addApplications']=function addApplications(_0xaf5969,_0x2fbe5e){var _0x3dd204=_0xaf5969[_0xa4bc('0x62')]['id'];var _0x17a1ff=_0xaf5969['body'];var _0x411541=0xc8;var _0x24e35d=null;return db[_0xa4bc('0x93')][_0xa4bc('0x94')]({'isolationLevel':db[_0xa4bc('0x93')][_0xa4bc('0x95')]['ISOLATION_LEVELS'][_0xa4bc('0x96')]},function(_0x82c359){return db['MailAccount'][_0xa4bc('0x77')]({'where':{'id':_0x3dd204},'transaction':_0x82c359})['then'](function(_0x5a2f5c){if(_0x5a2f5c){return db[_0xa4bc('0x97')][_0xa4bc('0x27')]({'where':{'MailAccountId':_0x3dd204},'transaction':_0x82c359})[_0xa4bc('0x13')](function(){var _0x5d1f42=_[_0xa4bc('0x47')](_0x17a1ff,function(_0x2dec19){_0x2dec19[_0xa4bc('0x6c')]=_0x3dd204;return _0x2dec19;});return db[_0xa4bc('0x97')][_0xa4bc('0x98')](_0x5d1f42,{'transaction':_0x82c359});});}else{_0x411541=0x194;_0x24e35d=[];}});})[_0xa4bc('0x13')](function(){if(_0x411541!==0x194){return db['MailApplication'][_0xa4bc('0x99')]({'where':{'MailAccountId':_0x3dd204},'order':_0xa4bc('0x9a')})[_0xa4bc('0x13')](function(_0x274c46){_0x24e35d=_0x274c46;});}})[_0xa4bc('0x60')](function(_0x1b7cd9){_0x411541=0x1f4;logger[_0xa4bc('0x19')](_0x1b7cd9[_0xa4bc('0x9b')]);if(_0x1b7cd9[_0xa4bc('0x5c')]){delete _0x1b7cd9[_0xa4bc('0x5c')];}_0x24e35d=_0x1b7cd9;})[_0xa4bc('0x9c')](function(){if(_0x24e35d===null){_0x2fbe5e[_0xa4bc('0x9d')](_0x411541);}else{if(_0x411541===0x1f4){_0x2fbe5e[_0xa4bc('0x1e')](_0x411541)[_0xa4bc('0x2b')](_0x24e35d);}else{_0x2fbe5e['status'](_0x411541)['json'](_0x24e35d);}}});};exports['getApplications']=function(_0x1edce0,_0x51d9e1){var _0x2e4d16={};var _0x1bf1ee={};var _0x390395;var _0x3da746;return db[_0xa4bc('0x48')][_0xa4bc('0x77')]({'where':{'id':_0x1edce0[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x51d9e1,null))[_0xa4bc('0x13')](function(_0x12615b){if(_0x12615b){_0x390395=_0x12615b;_0x1bf1ee[_0xa4bc('0x4d')]=_[_0xa4bc('0x65')](db[_0xa4bc('0x97')][_0xa4bc('0x49')]);_0x1bf1ee[_0xa4bc('0x4f')]=_[_0xa4bc('0x65')](_0x1edce0[_0xa4bc('0x4f')]);_0x1bf1ee[_0xa4bc('0x4e')]=_[_0xa4bc('0x51')](_0x1bf1ee[_0xa4bc('0x4d')],_0x1bf1ee[_0xa4bc('0x4f')]);_0x2e4d16[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x1bf1ee[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x1edce0[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x2e4d16[_0xa4bc('0x50')]=_0x2e4d16[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x2e4d16[_0xa4bc('0x50')]:_0x1bf1ee[_0xa4bc('0x4d')];_0x2e4d16[_0xa4bc('0x70')]=qs['sort'](_0x1edce0[_0xa4bc('0x4f')]['sort']);_0x2e4d16[_0xa4bc('0x59')]=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x1edce0[_0xa4bc('0x4f')],_0x1bf1ee['filters']));if(_0x1edce0[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x2e4d16[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x2e4d16[_0xa4bc('0x59')],{'$or':_[_0xa4bc('0x47')](_0x2e4d16[_0xa4bc('0x50')],function(_0x110587){var _0x8bb7ab={};_0x8bb7ab[_0x110587]={'$like':'%'+_0x1edce0['query']['filter']+'%'};return _0x8bb7ab;})});}_0x2e4d16=_[_0xa4bc('0x5a')]({},_0x2e4d16,_0x1edce0[_0xa4bc('0x5d')]);return _0x390395[_0xa4bc('0x9e')](_0x2e4d16);}})[_0xa4bc('0x13')](function(_0x2ab31e){if(_0x2ab31e){_0x3da746=_0x2ab31e[_0xa4bc('0x53')];if(!_0x1edce0[_0xa4bc('0x4f')][_0xa4bc('0x54')](_0xa4bc('0x55'))){_0x2e4d16[_0xa4bc('0x21')]=qs[_0xa4bc('0x21')](_0x1edce0[_0xa4bc('0x4f')][_0xa4bc('0x21')]);_0x2e4d16[_0xa4bc('0x22')]=qs[_0xa4bc('0x22')](_0x1edce0[_0xa4bc('0x4f')][_0xa4bc('0x22')]);}return _0x390395['getApplications'](_0x2e4d16);}})[_0xa4bc('0x13')](function(_0x28d30e){if(_0x28d30e){return _0x28d30e?{'count':_0x3da746,'rows':_0x28d30e}:null;}})[_0xa4bc('0x13')](respondWithResult(_0x51d9e1,null))[_0xa4bc('0x60')](handleError(_0x51d9e1,null));};exports[_0xa4bc('0x9f')]=function(_0x4b6d04,_0x13f30f){var _0x22a3ef={'raw':!![],'where':{}};var _0x54d0de={};var _0x36b0d0={'count':0x0,'rows':[]};return db[_0xa4bc('0x48')]['findOne']({'where':{'id':_0x4b6d04[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x13f30f,null))[_0xa4bc('0x13')](function(_0x79b050){if(_0x79b050){_0x54d0de[_0xa4bc('0x4d')]=_['keys'](db[_0xa4bc('0xa0')][_0xa4bc('0x49')]);_0x54d0de[_0xa4bc('0x4f')]=_[_0xa4bc('0x65')](_0x4b6d04[_0xa4bc('0x4f')]);_0x54d0de[_0xa4bc('0x4e')]=_[_0xa4bc('0x51')](_0x54d0de[_0xa4bc('0x4d')],_0x54d0de['query']);_0x22a3ef[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x54d0de[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x4b6d04['query'][_0xa4bc('0x52')]));_0x22a3ef[_0xa4bc('0x50')]=_0x22a3ef[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x22a3ef[_0xa4bc('0x50')]:_0x54d0de[_0xa4bc('0x4d')];if(!_0x4b6d04['query'][_0xa4bc('0x54')]('nolimit')){_0x22a3ef[_0xa4bc('0x21')]=qs[_0xa4bc('0x21')](_0x4b6d04[_0xa4bc('0x4f')][_0xa4bc('0x21')]);_0x22a3ef['offset']=qs[_0xa4bc('0x22')](_0x4b6d04[_0xa4bc('0x4f')]['offset']);}_0x22a3ef[_0xa4bc('0x70')]=qs[_0xa4bc('0x56')](_0x4b6d04[_0xa4bc('0x4f')]['sort']);_0x22a3ef[_0xa4bc('0x59')]=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x4b6d04['query'],_0x54d0de[_0xa4bc('0x4e')]));_0x22a3ef[_0xa4bc('0x59')][_0xa4bc('0x6c')]=_0x79b050['id'];if(_0x4b6d04[_0xa4bc('0x4f')][_0xa4bc('0x58')]){_0x22a3ef[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x22a3ef[_0xa4bc('0x59')],{'$or':_[_0xa4bc('0x47')](_0x22a3ef[_0xa4bc('0x50')],function(_0x425839){var _0x1a74a7={};_0x1a74a7[_0x425839]={'$like':'%'+_0x4b6d04[_0xa4bc('0x4f')]['filter']+'%'};return _0x1a74a7;})});}if(_0x4b6d04['query']['$gte']){var _0x294133=_0x4b6d04[_0xa4bc('0x4f')]['$gte'][_0xa4bc('0xa1')](',');var _0x4078f0={};_0x4078f0[_0x294133[0x0]]={'$gte':moment(_0x294133[0x1])[_0xa4bc('0xa2')](_0xa4bc('0xa3'))};_0x22a3ef[_0xa4bc('0x59')]=_[_0xa4bc('0x5a')](_0x22a3ef[_0xa4bc('0x59')],_0x4078f0);}_0x22a3ef=_['merge']({},_0x22a3ef,_0x4b6d04[_0xa4bc('0x5d')]);return db[_0xa4bc('0xa0')][_0xa4bc('0x23')]({'where':_0x22a3ef[_0xa4bc('0x59')]})['then'](function(_0x31d6cd){_0x36b0d0[_0xa4bc('0x23')]=_0x31d6cd;if(_0x4b6d04[_0xa4bc('0x4f')]['includeAll']){_0x22a3ef[_0xa4bc('0x5e')]=[{'all':!![]}];}return db['MailMessage'][_0xa4bc('0x5f')](_0x22a3ef);})[_0xa4bc('0x13')](function(_0x501444){if(_0x4b6d04[_0xa4bc('0x4f')]['inlineCss']===_0xa4bc('0xa4')){for(var _0x3e089d=0x0;_0x3e089d<_0x501444[_0xa4bc('0x53')];_0x3e089d++){_0x501444[_0x3e089d][_0xa4bc('0x67')]=juice(_0x501444[_0x3e089d][_0xa4bc('0x67')]);}}_0x36b0d0[_0xa4bc('0x71')]=_0x501444;return _0x36b0d0;});}})[_0xa4bc('0x13')](respondWithFilteredResult(_0x13f30f,_0x22a3ef))[_0xa4bc('0x60')](handleError(_0x13f30f,null));};exports[_0xa4bc('0x2b')]=function(_0x51e72b,_0x3adbe7){var _0x10d602,_0x37c467={},_0x2f0291;if(_0x51e72b['body']['to']){_0x2f0291=_0x51e72b[_0xa4bc('0x67')]['to'][_0xa4bc('0xa1')](',')[0x0];}return db['MailAccount'][_0xa4bc('0x69')]({'where':{'id':_0x51e72b[_0xa4bc('0x62')]['id']},'include':[{'model':db[_0xa4bc('0xa5')],'as':_0xa4bc('0xa6'),'include':[{'model':db['CmContact'],'as':_0xa4bc('0xa7'),'where':{'email':_0x2f0291},'limit':0x1,'order':[[_0xa4bc('0xa8'),'DESC']]}]},{'model':db[_0xa4bc('0x46')],'as':_0xa4bc('0x43'),'raw':!![],'include':[{'model':db[_0xa4bc('0xa9')],'as':_0xa4bc('0xa9'),'raw':!![]}]}]})[_0xa4bc('0x13')](handleEntityNotFound(_0x3adbe7,null))[_0xa4bc('0x13')](function(_0x598b1c){if(!_0x598b1c)return;_0x10d602=_0x598b1c;if(!_0x598b1c['Smtp'])throw new Error(_0xa4bc('0xaa'));if(_['isNil'](_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xab')])){_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xab')]=util[_0xa4bc('0xa2')](_0xa4bc('0xac'),_0x598b1c['name'],_0x598b1c['email']||_0x598b1c[_0xa4bc('0x43')][_0xa4bc('0x40')]);}if(_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xad')]&&_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xad')][_0xa4bc('0x53')]){for(var _0x2ec7d1=0x0;_0x2ec7d1<_0x51e72b[_0xa4bc('0x67')]['attachments'][_0xa4bc('0x53')];_0x2ec7d1+=0x1){_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xad')][_0x2ec7d1]={'filename':_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xad')][_0x2ec7d1][_0xa4bc('0x5c')],'path':path[_0xa4bc('0xae')](config[_0xa4bc('0xaf')],_0xa4bc('0xb0'),_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xad')][_0x2ec7d1][_0xa4bc('0xb1')])};}}var _0x42f6a5=_0x598b1c[_0xa4bc('0xb2')]();return respondWithRpcPromise(_0xa4bc('0xb3'),'sendMail',{'account':_0x42f6a5,'message':_0x51e72b[_0xa4bc('0x67')]});})[_0xa4bc('0x13')](function(_0x43c927){if(!_0x43c927)return;_0x37c467=_0x43c927;if(!_0x10d602[_0xa4bc('0xa6')])throw new Error(_0xa4bc('0xb4'));if(_0x10d602[_0xa4bc('0xa6')]['Contacts']['length'])return _0x10d602[_0xa4bc('0xa6')][_0xa4bc('0xa7')][0x0];return db[_0xa4bc('0x8a')][_0xa4bc('0x6e')](_[_0xa4bc('0xa')](_0x51e72b[_0xa4bc('0x67')],{'firstName':_0x51e72b[_0xa4bc('0x67')]['to'],'email':_0x51e72b[_0xa4bc('0x67')]['to'],'phone':_0x51e72b[_0xa4bc('0x67')]['to'],'ListId':_0x10d602[_0xa4bc('0x7b')]}));})[_0xa4bc('0x13')](function(_0x847b3a){if(!_0x847b3a)return;var _0x8394b4={'UserId':_0x51e72b[_0xa4bc('0x40')]['id'],'ContactId':_0x847b3a['id'],'MailAccountId':_0x10d602['id'],'inReplyTo':_0x37c467['messageId'],'to':_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xab')],'cc':_0x51e72b[_0xa4bc('0x67')]['cc'],'subject':_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xb5')],'attach':_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xb6')],'firstMsgDirection':_0xa4bc('0xb7'),'lastMsgAt':moment()[_0xa4bc('0xa2')](_0xa4bc('0xa3')),'lastMsgDirection':'out','Messages':[_[_0xa4bc('0x5a')](_0x51e72b[_0xa4bc('0x67')],{'messageId':_0x37c467[_0xa4bc('0xb8')],'sentAt':moment()[_0xa4bc('0xa2')](_0xa4bc('0xa3')),'read':!![],'MailAccountId':_0x10d602['id'],'UserId':_0x51e72b[_0xa4bc('0x40')]['id'],'ContactId':_0x847b3a['id']})]};if(_0x51e72b[_0xa4bc('0x67')][_0xa4bc('0xb9')]){_0x8394b4=_[_0xa4bc('0x5a')](_0x8394b4,_0x51e72b['body'][_0xa4bc('0xb9')]);}return db[_0xa4bc('0x89')][_0xa4bc('0x6e')](_0x8394b4,{'include':[{'model':db[_0xa4bc('0xa0')],'as':_0xa4bc('0xba')}]});})[_0xa4bc('0x13')](respondWithResult(_0x3adbe7,null))[_0xa4bc('0x60')](handleError(_0x3adbe7,null));};exports[_0xa4bc('0xbb')]=function(_0x52b40a,_0x3a1dd7){return db[_0xa4bc('0x48')]['find']({'where':{'id':_0x52b40a[_0xa4bc('0x62')]['id']},'include':[{'model':db[_0xa4bc('0x46')],'as':_0xa4bc('0x43'),'raw':!![],'include':[{'model':db[_0xa4bc('0xa9')],'as':_0xa4bc('0xa9'),'raw':!![]}]}]})[_0xa4bc('0x13')](handleEntityNotFound(_0x3a1dd7,null))[_0xa4bc('0x13')](function(_0xbcbe39){if(!_0xbcbe39['Smtp'])return;var _0x191589=_0xbcbe39['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0xa4bc('0xbb'),{'account':_0x191589});})[_0xa4bc('0x13')](respondWithResult(_0x3a1dd7,null))[_0xa4bc('0x60')](handleError(_0x3a1dd7,null));};exports['destroy']=function(_0x22c014,_0xa23339){return db[_0xa4bc('0x48')]['find']({'where':{'id':_0x22c014['params']['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0xa23339,null))['then'](function(_0x230b35){if(_0x230b35&&_0x230b35[_0xa4bc('0x3f')]){throw new db[(_0xa4bc('0xbc'))][(_0xa4bc('0xbd'))](_0xa4bc('0xbe'));}return _0x230b35;})[_0xa4bc('0x13')](removeEntity(_0xa23339,null))[_0xa4bc('0x60')](handleError(_0xa23339,null));};exports[_0xa4bc('0xbf')]=function(_0x212d65,_0x5e1af){return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x212d65[_0xa4bc('0x62')]['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x5e1af,null))[_0xa4bc('0x13')](function(_0x94aba9){if(_0x94aba9){return _0x94aba9['addAgents'](_0x212d65[_0xa4bc('0x67')]['ids'],_[_0xa4bc('0x87')](_0x212d65[_0xa4bc('0x67')],[_0xa4bc('0x73'),'id'])||{})[_0xa4bc('0xc0')](function(_0x428180){for(var _0x5bde54=0x0;_0x5bde54<_0x212d65['body'][_0xa4bc('0x73')][_0xa4bc('0x53')];_0x5bde54+=0x1){socket[_0xa4bc('0xc1')](_0xa4bc('0xc2'),{'UserId':Number(_0x212d65['body'][_0xa4bc('0x73')][_0x5bde54]),'MailAccountId':Number(_0x212d65[_0xa4bc('0x62')]['id'])});}return _0x428180;});}})[_0xa4bc('0x13')](respondWithResult(_0x5e1af,null))[_0xa4bc('0x60')](handleError(_0x5e1af,null));};exports[_0xa4bc('0xc3')]=function(_0x3fc04f,_0x4b24a4){return db[_0xa4bc('0x48')][_0xa4bc('0x69')]({'where':{'id':_0x3fc04f[_0xa4bc('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b24a4,null))[_0xa4bc('0x13')](function(_0x39e332){if(_0x39e332){return _0x39e332[_0xa4bc('0xc3')](_0x3fc04f[_0xa4bc('0x4f')][_0xa4bc('0x73')])[_0xa4bc('0x13')](function(){if(_['isArray'](_0x3fc04f[_0xa4bc('0x4f')][_0xa4bc('0x73')])){for(var _0x77b5e1=0x0;_0x77b5e1<_0x3fc04f[_0xa4bc('0x4f')]['ids']['length'];_0x77b5e1+=0x1){socket[_0xa4bc('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x3fc04f[_0xa4bc('0x4f')][_0xa4bc('0x73')][_0x77b5e1]),'MailAccountId':Number(_0x3fc04f['params']['id'])});}}else{socket['emit'](_0xa4bc('0xc4'),{'UserId':Number(_0x3fc04f[_0xa4bc('0x4f')][_0xa4bc('0x73')]),'MailAccountId':Number(_0x3fc04f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b24a4,null))[_0xa4bc('0x60')](handleError(_0x4b24a4,null));};exports['getAgents']=function(_0x1d5c65,_0x1977c2){var _0x33e08f={};var _0x5d200e={};var _0x518de1;var _0x460d6a;return db[_0xa4bc('0x48')]['findOne']({'where':{'id':_0x1d5c65['params']['id']}})[_0xa4bc('0x13')](handleEntityNotFound(_0x1977c2,null))['then'](function(_0x1faef7){if(_0x1faef7){_0x518de1=_0x1faef7;_0x5d200e[_0xa4bc('0x4d')]=_[_0xa4bc('0x65')](db[_0xa4bc('0x8c')][_0xa4bc('0x49')]);_0x5d200e['query']=_[_0xa4bc('0x65')](_0x1d5c65[_0xa4bc('0x4f')]);_0x5d200e[_0xa4bc('0x4e')]=_[_0xa4bc('0x51')](_0x5d200e[_0xa4bc('0x4d')],_0x5d200e[_0xa4bc('0x4f')]);_0x33e08f[_0xa4bc('0x50')]=_[_0xa4bc('0x51')](_0x5d200e[_0xa4bc('0x4d')],qs[_0xa4bc('0x52')](_0x1d5c65[_0xa4bc('0x4f')][_0xa4bc('0x52')]));_0x33e08f['attributes']=_0x33e08f[_0xa4bc('0x50')][_0xa4bc('0x53')]?_0x33e08f[_0xa4bc('0x50')]:_0x5d200e[_0xa4bc('0x4d')];_0x33e08f['order']=qs[_0xa4bc('0x56')](_0x1d5c65[_0xa4bc('0x4f')][_0xa4bc('0x56')]);_0x33e08f[_0xa4bc('0x59')]=qs[_0xa4bc('0x4e')](_[_0xa4bc('0x57')](_0x1d5c65['query'],_0x5d200e[_0xa4bc('0x4e')]));if(_0x1d5c65['query']['filter']){_0x33e08f[_0xa4bc('0x59')]=_['merge'](_0x33e08f[_0xa4bc('0x59')],{'$or':_[_0xa4bc('0x47')](_0x33e08f[_0xa4bc('0x50')],function(_0x385809){var _0x38ef42={};_0x38ef42[_0x385809]={'$like':'%'+_0x1d5c65[_0xa4bc('0x4f')]['filter']+'%'};return _0x38ef42;})});}_0x33e08f=_[_0xa4bc('0x5a')]({},_0x33e08f,_0x1d5c65[_0xa4bc('0x5d')]);return _0x518de1[_0xa4bc('0xc5')](_0x33e08f);}})[_0xa4bc('0x13')](function(_0x481bf3){if(_0x481bf3){_0x460d6a=_0x481bf3[_0xa4bc('0x53')];if(!_0x1d5c65['query'][_0xa4bc('0x54')](_0xa4bc('0x55'))){_0x33e08f[_0xa4bc('0x21')]=qs['limit'](_0x1d5c65[_0xa4bc('0x4f')]['limit']);_0x33e08f[_0xa4bc('0x22')]=qs['offset'](_0x1d5c65[_0xa4bc('0x4f')][_0xa4bc('0x22')]);}return _0x518de1[_0xa4bc('0xc5')](_0x33e08f);}})['then'](function(_0xbd0d25){if(_0xbd0d25){return _0xbd0d25?{'count':_0x460d6a,'rows':_0xbd0d25}:null;}})[_0xa4bc('0x13')](respondWithResult(_0x1977c2,null))[_0xa4bc('0x60')](handleError(_0x1977c2,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b77372a..0502d04 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 _0xed20=['../../mysqldb','MailAccount','save','update','remove','emit','hook','exports','events'];(function(_0x3ed0bf,_0x5bb8a9){var _0x1e618e=function(_0x4230b6){while(--_0x4230b6){_0x3ed0bf['push'](_0x3ed0bf['shift']());}};_0x1e618e(++_0x5bb8a9);}(_0xed20,0xce));var _0x0ed2=function(_0x39c3ed,_0x2e1561){_0x39c3ed=_0x39c3ed-0x0;var _0x4f058c=_0xed20[_0x39c3ed];return _0x4f058c;};'use strict';var EventEmitter=require(_0x0ed2('0x0'));var MailAccount=require(_0x0ed2('0x1'))['db'][_0x0ed2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ed2('0x3'),'afterUpdate':_0x0ed2('0x4'),'afterDestroy':_0x0ed2('0x5')};function emitEvent(_0x2a6405){return function(_0x395e2d,_0x20cac9,_0x5693ea){MailAccountEvents[_0x0ed2('0x6')](_0x2a6405+':'+_0x395e2d['id'],_0x395e2d);MailAccountEvents[_0x0ed2('0x6')](_0x2a6405,_0x395e2d);_0x5693ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x0ed2('0x7')](e,emitEvent(event));}}module[_0x0ed2('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x27a0=['hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4c66e0,_0x517545){var _0x539687=function(_0x30d47a){while(--_0x30d47a){_0x4c66e0['push'](_0x4c66e0['shift']());}};_0x539687(++_0x517545);}(_0x27a0,0xbf));var _0x027a=function(_0x262d6e,_0x3eb6f5){_0x262d6e=_0x262d6e-0x0;var _0x5e8ade=_0x27a0[_0x262d6e];return _0x5e8ade;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x027a('0x0'))['db'][_0x027a('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x027a('0x2')](0x0);var events={'afterCreate':_0x027a('0x3'),'afterUpdate':_0x027a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58a58b){return function(_0x4e8d6b,_0x47cd65,_0x30a54d){MailAccountEvents[_0x027a('0x5')](_0x58a58b+':'+_0x4e8d6b['id'],_0x4e8d6b);MailAccountEvents[_0x027a('0x5')](_0x58a58b,_0x4e8d6b);_0x30a54d(null);};}for(var e in events){if(events[_0x027a('0x6')](e)){var event=events[e];MailAccount[_0x027a('0x7')](e,emitEvent(event));}}module[_0x027a('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2f25404..9cb104e 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 _0x44aa=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','MailAccount','provider','custom','service','Smtp'];(function(_0xcc470b,_0x668b1){var _0x1707aa=function(_0x3e0255){while(--_0x3e0255){_0xcc470b['push'](_0xcc470b['shift']());}};_0x1707aa(++_0x668b1);}(_0x44aa,0x173));var _0xa44a=function(_0xe66186,_0x1d97b8){_0xe66186=_0xe66186-0x0;var _0x3cc27d=_0x44aa[_0xe66186];return _0x3cc27d;};'use strict';var attributes=require(_0xa44a('0x0'));module[_0xa44a('0x1')]=function(_0x4af259){return _0x4af259['define'](_0xa44a('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3373d9=this;var _0x5858eb={'id':_0x3373d9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3373d9[_0xa44a('0x3')]!==_0xa44a('0x4')){_0x5858eb[_0xa44a('0x5')]=_0x3373d9['provider'];}else{_0x5858eb['host']=_0x3373d9[_0xa44a('0x6')][_0xa44a('0x7')];_0x5858eb[_0xa44a('0x8')]=_0x3373d9[_0xa44a('0x6')][_0xa44a('0x8')];_0x5858eb[_0xa44a('0x9')]=_0x3373d9[_0xa44a('0x6')]['secure'];}if(_0x3373d9[_0xa44a('0x6')][_0xa44a('0xa')]){if(_0x3373d9[_0xa44a('0x6')][_0xa44a('0xb')]){if(!_0x3373d9[_0xa44a('0x6')][_0xa44a('0xc')])throw new Error(_0xa44a('0xd'));_0x5858eb['auth']={'type':_0xa44a('0xe'),'user':_0x3373d9['Smtp'][_0xa44a('0xf')],'accessToken':_0x3373d9[_0xa44a('0x6')][_0xa44a('0xc')][_0xa44a('0x10')]};}else{_0x5858eb[_0xa44a('0x11')]={'user':_0x3373d9[_0xa44a('0x6')][_0xa44a('0xf')],'pass':_0x3373d9[_0xa44a('0x6')]['pass']};}}return _0x5858eb;}}});}; \ No newline at end of file +var _0x1f13=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','service','Smtp'];(function(_0x433de4,_0x1c7b6c){var _0x5acf11=function(_0x41c627){while(--_0x41c627){_0x433de4['push'](_0x433de4['shift']());}};_0x5acf11(++_0x1c7b6c);}(_0x1f13,0x89));var _0x31f1=function(_0x5f39de,_0x51cdbf){_0x5f39de=_0x5f39de-0x0;var _0x132a51=_0x1f13[_0x5f39de];return _0x132a51;};'use strict';var attributes=require(_0x31f1('0x0'));module['exports']=function(_0x50d611){return _0x50d611[_0x31f1('0x1')](_0x31f1('0x2'),attributes,{'tableName':_0x31f1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x44a100=this;var _0x49082f={'id':_0x44a100['id'],'tls':{'rejectUnauthorized':![]}};if(_0x44a100[_0x31f1('0x4')]!=='custom'){_0x49082f[_0x31f1('0x5')]=_0x44a100[_0x31f1('0x4')];}else{_0x49082f['host']=_0x44a100[_0x31f1('0x6')][_0x31f1('0x7')];_0x49082f['port']=_0x44a100['Smtp'][_0x31f1('0x8')];_0x49082f['secure']=_0x44a100['Smtp'][_0x31f1('0x9')];}if(_0x44a100[_0x31f1('0x6')][_0x31f1('0xa')]){if(_0x44a100[_0x31f1('0x6')][_0x31f1('0xb')]){if(!_0x44a100['Smtp'][_0x31f1('0xc')])throw new Error(_0x31f1('0xd'));_0x49082f['auth']={'type':_0x31f1('0xe'),'user':_0x44a100[_0x31f1('0x6')][_0x31f1('0xf')],'accessToken':_0x44a100[_0x31f1('0x6')][_0x31f1('0xc')][_0x31f1('0x10')]};}else{_0x49082f['auth']={'user':_0x44a100[_0x31f1('0x6')][_0x31f1('0xf')],'pass':_0x44a100[_0x31f1('0x6')][_0x31f1('0x11')]};}}return _0x49082f;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index fec713d..dd7ef6e 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 _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x25139d,_0x1e040d){var _0x4427f5=function(_0x33eeb5){while(--_0x33eeb5){_0x25139d['push'](_0x25139d['shift']());}};_0x4427f5(++_0x1e040d);}(_0x687b,0x14a));var _0xb687=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x687b[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file +var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0x1b5209,_0xc5d787){var _0x3bb732=function(_0x2e07f3){while(--_0x2e07f3){_0x1b5209['push'](_0x1b5209['shift']());}};_0x3bb732(++_0xc5d787);}(_0x66fa,0x117));var _0xa66f=function(_0x7670a7,_0x5d628a){_0x7670a7=_0x7670a7-0x0;var _0xb6bb41=_0x66fa[_0x7670a7];return _0xb6bb41;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 38def62..928009c 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 _0x4d45=['./mailAccount.events','save','remove','update','register','length','mailAccount:'];(function(_0x57f1b9,_0x5e00e3){var _0x98c3a3=function(_0x566288){while(--_0x566288){_0x57f1b9['push'](_0x57f1b9['shift']());}};_0x98c3a3(++_0x5e00e3);}(_0x4d45,0x7e));var _0x54d4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4d45[_0x1035c1];return _0x308d67;};'use strict';var MailAccountEvents=require(_0x54d4('0x0'));var events=[_0x54d4('0x1'),_0x54d4('0x2'),_0x54d4('0x3')];function createListener(_0x3a74bd,_0x48f236){return function(_0x47cda0){_0x48f236['emit'](_0x3a74bd,_0x47cda0);};}function removeListener(_0x5d531a,_0x373b11){return function(){MailAccountEvents['removeListener'](_0x5d531a,_0x373b11);};}exports[_0x54d4('0x4')]=function(_0xaa2734){for(var _0x240a78=0x0,_0x38b399=events[_0x54d4('0x5')];_0x240a78<_0x38b399;_0x240a78++){var _0x6338f=events[_0x240a78];var _0x5ae585=createListener(_0x54d4('0x6')+_0x6338f,_0xaa2734);MailAccountEvents['on'](_0x6338f,_0x5ae585);}}; \ No newline at end of file +var _0xa339=['register','mailAccount:','save','emit','removeListener'];(function(_0x2fa342,_0x4b6c9c){var _0x21e4a8=function(_0x285a62){while(--_0x285a62){_0x2fa342['push'](_0x2fa342['shift']());}};_0x21e4a8(++_0x4b6c9c);}(_0xa339,0xac));var _0x9a33=function(_0x119857,_0x4714c7){_0x119857=_0x119857-0x0;var _0x412c97=_0xa339[_0x119857];return _0x412c97;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x9a33('0x0'),'remove','update'];function createListener(_0x3fc77f,_0x43edb4){return function(_0x4e02d2){_0x43edb4[_0x9a33('0x1')](_0x3fc77f,_0x4e02d2);};}function removeListener(_0x910986,_0x5c9939){return function(){MailAccountEvents[_0x9a33('0x2')](_0x910986,_0x5c9939);};}exports[_0x9a33('0x3')]=function(_0x5d046a){for(var _0x142323=0x0,_0x2944f5=events['length'];_0x142323<_0x2944f5;_0x142323++){var _0x466d39=events[_0x142323];var _0x5b0ac4=createListener(_0x9a33('0x4')+_0x466d39,_0x5d046a);MailAccountEvents['on'](_0x466d39,_0x5b0ac4);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8b6f769..02b7dbe 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 _0x4f6c=['put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show'];(function(_0x43cb5f,_0x4e62cc){var _0x286c59=function(_0xc7d9af){while(--_0xc7d9af){_0x43cb5f['push'](_0x43cb5f['shift']());}};_0x286c59(++_0x4e62cc);}(_0x4f6c,0xff));var _0xc4f6=function(_0x5ea390,_0x262b04){_0x5ea390=_0x5ea390-0x0;var _0x354a3f=_0x4f6c[_0x5ea390];return _0x354a3f;};'use strict';var multer=require(_0xc4f6('0x0'));var util=require(_0xc4f6('0x1'));var path=require(_0xc4f6('0x2'));var timeout=require(_0xc4f6('0x3'));var express=require(_0xc4f6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc4f6('0x5'));var interaction=require(_0xc4f6('0x6'));var config=require('../../config/environment');var controller=require(_0xc4f6('0x7'));router['get'](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller[_0xc4f6('0xa')]);router[_0xc4f6('0xb')](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller['update']);router['delete'](_0xc4f6('0x8'),auth[_0xc4f6('0x9')](),controller[_0xc4f6('0xc')]);module[_0xc4f6('0xd')]=router; \ No newline at end of file +var _0x830c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','update','/:id','exports','multer'];(function(_0x59dd83,_0x573f1b){var _0x5dd0de=function(_0x1c805d){while(--_0x1c805d){_0x59dd83['push'](_0x59dd83['shift']());}};_0x5dd0de(++_0x573f1b);}(_0x830c,0x1db));var _0xc830=function(_0x420544,_0x281720){_0x420544=_0x420544-0x0;var _0x4030cd=_0x830c[_0x420544];return _0x4030cd;};'use strict';var multer=require(_0xc830('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc830('0x1'));var express=require(_0xc830('0x2'));var router=express[_0xc830('0x3')]();var fs_extra=require(_0xc830('0x4'));var auth=require(_0xc830('0x5'));var interaction=require(_0xc830('0x6'));var config=require(_0xc830('0x7'));var controller=require(_0xc830('0x8'));router['get']('/:id',auth[_0xc830('0x9')](),controller[_0xc830('0xa')]);router['put']('/:id',auth[_0xc830('0x9')](),controller[_0xc830('0xb')]);router['delete'](_0xc830('0xc'),auth[_0xc830('0x9')](),controller['destroy']);module[_0xc830('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0913b50..3bca490 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 _0xd7c0=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x1a2d37,_0x19cd85){var _0x4d5e76=function(_0x4c254d){while(--_0x4c254d){_0x1a2d37['push'](_0x1a2d37['shift']());}};_0x4d5e76(++_0x19cd85);}(_0xd7c0,0x1b4));var _0x0d7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd7c0[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x0d7c('0x0'));module[_0x0d7c('0x1')]={'priority':{'type':Sequelize[_0x0d7c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0d7c('0x3')],'allowNull':![],'defaultValue':_0x0d7c('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0d7c('0x3')]},'interval':{'type':Sequelize[_0x0d7c('0x3')],'defaultValue':_0x0d7c('0x5')}}; \ No newline at end of file +var _0xb755=['sequelize','exports','STRING','noop','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb755,0x122));var _0x5b75=function(_0x196b87,_0x1af2c8){_0x196b87=_0x196b87-0x0;var _0x4ce6e3=_0xb755[_0x196b87];return _0x4ce6e3;};'use strict';var Sequelize=require(_0x5b75('0x0'));module[_0x5b75('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5b75('0x2')],'allowNull':![],'defaultValue':_0x5b75('0x3')},'appdata':{'type':Sequelize[_0x5b75('0x4')]()},'description':{'type':Sequelize[_0x5b75('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index c8c44e9..e5845ca 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 _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(_0x17c601,_0x47d691){var _0x116e26=function(_0xce5b73){while(--_0xce5b73){_0x17c601['push'](_0x17c601['shift']());}};_0x116e26(++_0x47d691);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xcb91[_0x3da612];return _0x1a9d1d;};'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 +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(_0x170ac0,_0x52e567){var _0x4eab0e=function(_0x2a1254){while(--_0x2a1254){_0x170ac0['push'](_0x170ac0['shift']());}};_0x4eab0e(++_0x52e567);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcb91[_0x3ab51d];return _0x29a04e;};'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 8577d7e..1b879b9 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 _0xfeea=['moment','request-promise','rimraf','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x35289d,_0x230ce7){var _0x2dec71=function(_0x391feb){while(--_0x391feb){_0x35289d['push'](_0x35289d['shift']());}};_0x2dec71(++_0x230ce7);}(_0xfeea,0x131));var _0xafee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfeea[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var logger=require('../../config/logger')(_0xafee('0x2'));var moment=require(_0xafee('0x3'));var BPromise=require('bluebird');var rp=require(_0xafee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafee('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xafee('0x6')]=function(_0x33c208,_0x4f48a5){return _0x33c208[_0xafee('0x7')](_0xafee('0x8'),attributes,{'tableName':_0xafee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xafee('0xa')});}; \ No newline at end of file +var _0xb82b=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','define','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5d3d72,_0x1df620){var _0x5d2e5a=function(_0x133988){while(--_0x133988){_0x5d3d72['push'](_0x5d3d72['shift']());}};_0x5d2e5a(++_0x1df620);}(_0xb82b,0x1ef));var _0xbb82=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb82b[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xbb82('0x0'));var util=require(_0xbb82('0x1'));var logger=require('../../config/logger')(_0xbb82('0x2'));var moment=require('moment');var BPromise=require(_0xbb82('0x3'));var rp=require(_0xbb82('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb82('0x5'));var config=require(_0xbb82('0x6'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x5a6ee2,_0xca393d){return _0x5a6ee2[_0xbb82('0x7')]('MailApplication',attributes,{'tableName':_0xbb82('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb82('0x9'),'collate':_0xbb82('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index ac539d9..6f7f287 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 _0xe310=['client','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe310,0x105));var _0x0e31=function(_0x14b2e1,_0x3636f0){_0x14b2e1=_0x14b2e1-0x0;var _0x55c89b=_0xe310[_0x14b2e1];return _0x55c89b;};'use strict';var _=require(_0x0e31('0x0'));var util=require('util');var moment=require(_0x0e31('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e31('0x2'));var fs=require('fs');var Redis=require(_0x0e31('0x3'));var db=require(_0x0e31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e31('0x5'))(_0x0e31('0x6'));var config=require(_0x0e31('0x7'));var jayson=require(_0x0e31('0x8'));var client=jayson[_0x0e31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23283b,_0x158630,_0x225385){return new BPromise(function(_0x1ea4bd,_0x55ac58){return client['request'](_0x23283b,_0x225385)[_0x0e31('0xa')](function(_0x50826a){logger[_0x0e31('0xb')](_0x0e31('0xc'),_0x158630,_0x0e31('0xd'));logger[_0x0e31('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x158630,_0x0e31('0xd'),JSON[_0x0e31('0xf')](_0x50826a));if(_0x50826a[_0x0e31('0x10')]){if(_0x50826a[_0x0e31('0x10')][_0x0e31('0x11')]===0x1f4){logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x50826a[_0x0e31('0x10')]['message']);return _0x55ac58(_0x50826a['error'][_0x0e31('0x12')]);}logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x50826a[_0x0e31('0x10')][_0x0e31('0x12')]);return _0x1ea4bd(_0x50826a[_0x0e31('0x10')][_0x0e31('0x12')]);}else{logger['info'](_0x0e31('0xc'),_0x158630,'request\x20sent');_0x1ea4bd(_0x50826a[_0x0e31('0x13')]['message']);}})[_0x0e31('0x14')](function(_0x1db6d3){logger[_0x0e31('0x10')](_0x0e31('0xc'),_0x158630,_0x1db6d3);_0x55ac58(_0x1db6d3);});});}exports[_0x0e31('0x15')]=function(_0x293032){var _0x25ae51=this;return new Promise(function(_0x1da285,_0x7c28d8){return db[_0x0e31('0x16')][_0x0e31('0x17')](_0x293032[_0x0e31('0x18')],{'raw':_0x293032[_0x0e31('0x19')]?_0x293032[_0x0e31('0x19')][_0x0e31('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293032['options']?_0x293032[_0x0e31('0x19')][_0x0e31('0x1b')]||null:null,'attributes':_0x293032[_0x0e31('0x19')]?_0x293032[_0x0e31('0x19')][_0x0e31('0x1c')]||null:null,'limit':_0x293032['options']?_0x293032[_0x0e31('0x19')][_0x0e31('0x1d')]||null:null})[_0x0e31('0xa')](function(_0x37d2c5){logger['info'](_0x0e31('0x15'),_0x293032);logger[_0x0e31('0xe')]('UpdateMailApplication',_0x293032,JSON[_0x0e31('0xf')](_0x37d2c5));_0x1da285(_0x37d2c5);})[_0x0e31('0x14')](function(_0x3973e4){logger[_0x0e31('0x10')](_0x0e31('0x15'),_0x3973e4['message'],_0x293032);_0x7c28d8(_0x25ae51[_0x0e31('0x10')](0x1f4,_0x3973e4[_0x0e31('0x12')]));});});}; \ No newline at end of file +var _0x6cb7=['code','message','info','result','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d8686,_0x498ccb){var _0x56bda9=function(_0x3cc7cc){while(--_0x3cc7cc){_0x4d8686['push'](_0x4d8686['shift']());}};_0x56bda9(++_0x498ccb);}(_0x6cb7,0x1bf));var _0x76cb=function(_0x191124,_0x58ca30){_0x191124=_0x191124-0x0;var _0x4cc4dd=_0x6cb7[_0x191124];return _0x4cc4dd;};'use strict';var _=require(_0x76cb('0x0'));var util=require(_0x76cb('0x1'));var moment=require('moment');var BPromise=require(_0x76cb('0x2'));var rs=require(_0x76cb('0x3'));var fs=require('fs');var Redis=require(_0x76cb('0x4'));var db=require(_0x76cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76cb('0x6'))(_0x76cb('0x7'));var config=require(_0x76cb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a3ce0,_0x345531,_0x292ba3){return new BPromise(function(_0x4a1d01,_0x13cb23){return client[_0x76cb('0xa')](_0x4a3ce0,_0x292ba3)[_0x76cb('0xb')](function(_0x4dbcff){logger['info'](_0x76cb('0xc'),_0x345531,_0x76cb('0xd'));logger[_0x76cb('0xe')](_0x76cb('0xf'),_0x345531,_0x76cb('0xd'),JSON[_0x76cb('0x10')](_0x4dbcff));if(_0x4dbcff[_0x76cb('0x11')]){if(_0x4dbcff['error'][_0x76cb('0x12')]===0x1f4){logger[_0x76cb('0x11')](_0x76cb('0xc'),_0x345531,_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);return _0x13cb23(_0x4dbcff['error'][_0x76cb('0x13')]);}logger['error'](_0x76cb('0xc'),_0x345531,_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);return _0x4a1d01(_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);}else{logger[_0x76cb('0x14')]('MailApplication,\x20%s,\x20%s',_0x345531,_0x76cb('0xd'));_0x4a1d01(_0x4dbcff[_0x76cb('0x15')][_0x76cb('0x13')]);}})[_0x76cb('0x16')](function(_0x49ed88){logger['error'](_0x76cb('0xc'),_0x345531,_0x49ed88);_0x13cb23(_0x49ed88);});});}exports[_0x76cb('0x17')]=function(_0x49b068){var _0x43051e=this;return new Promise(function(_0x3ffea5,_0x393a77){return db[_0x76cb('0x18')]['update'](_0x49b068[_0x76cb('0x19')],{'raw':_0x49b068[_0x76cb('0x1a')]?_0x49b068[_0x76cb('0x1a')][_0x76cb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49b068[_0x76cb('0x1a')]?_0x49b068[_0x76cb('0x1a')][_0x76cb('0x1c')]||null:null,'attributes':_0x49b068[_0x76cb('0x1a')]?_0x49b068[_0x76cb('0x1a')][_0x76cb('0x1d')]||null:null,'limit':_0x49b068[_0x76cb('0x1a')]?_0x49b068['options'][_0x76cb('0x1e')]||null:null})[_0x76cb('0xb')](function(_0x34349f){logger[_0x76cb('0x14')](_0x76cb('0x17'),_0x49b068);logger[_0x76cb('0xe')](_0x76cb('0x17'),_0x49b068,JSON[_0x76cb('0x10')](_0x34349f));_0x3ffea5(_0x34349f);})[_0x76cb('0x16')](function(_0xae7f1d){logger['error'](_0x76cb('0x17'),_0xae7f1d[_0x76cb('0x13')],_0x49b068);_0x393a77(_0x43051e[_0x76cb('0x11')](0x1f4,_0xae7f1d[_0x76cb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c289421..274d0ee 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 _0xc2bc=['getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages'];(function(_0x118749,_0x50e848){var _0x20d489=function(_0x3c80a2){while(--_0x3c80a2){_0x118749['push'](_0x118749['shift']());}};_0x20d489(++_0x50e848);}(_0xc2bc,0x189));var _0xcc2b=function(_0xf9e26f,_0x22a5d3){_0xf9e26f=_0xf9e26f-0x0;var _0xc94e83=_0xc2bc[_0xf9e26f];return _0xc94e83;};'use strict';var express=require(_0xcc2b('0x0'));var router=express[_0xcc2b('0x1')]();var auth=require(_0xcc2b('0x2'));var interaction=require(_0xcc2b('0x3'));var controller=require(_0xcc2b('0x4'));router[_0xcc2b('0x5')]('/',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x7')]);router['get'](_0xcc2b('0x8'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x9')]);router[_0xcc2b('0x5')](_0xcc2b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcc2b('0x5')](_0xcc2b('0xb'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xc')]);router['get']('/:id/download',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xd')]);router[_0xcc2b('0xe')]('/',auth[_0xcc2b('0x6')](),controller[_0xcc2b('0xf')]);router[_0xcc2b('0xe')](_0xcc2b('0xb'),auth[_0xcc2b('0x6')](),controller[_0xcc2b('0x10')]);router[_0xcc2b('0xe')](_0xcc2b('0x11'),auth[_0xcc2b('0x6')](),interaction[_0xcc2b('0x12')](_0xcc2b('0x13'),_0xcc2b('0x14')),controller['addTags']);router[_0xcc2b('0x15')](_0xcc2b('0xa'),auth[_0xcc2b('0x6')](),interaction['tracked'](_0xcc2b('0x13'),_0xcc2b('0x16')),controller['update']);router[_0xcc2b('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xcc2b('0x12')](_0xcc2b('0x13'),'mailinteraction:destroy'),controller[_0xcc2b('0x18')]);router[_0xcc2b('0x17')](_0xcc2b('0x11'),auth['isAuthenticated'](),controller[_0xcc2b('0x19')]);module[_0xcc2b('0x1a')]=router; \ No newline at end of file +var _0x649a=['create','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','post'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x649a,0x1c3));var _0xa649=function(_0x12833e,_0x302abb){_0x12833e=_0x12833e-0x0;var _0xe6208a=_0x649a[_0x12833e];return _0xe6208a;};'use strict';var express=require(_0xa649('0x0'));var router=express[_0xa649('0x1')]();var auth=require(_0xa649('0x2'));var interaction=require(_0xa649('0x3'));var controller=require(_0xa649('0x4'));router[_0xa649('0x5')]('/',auth['isAuthenticated'](),controller[_0xa649('0x6')]);router[_0xa649('0x5')](_0xa649('0x7'),auth[_0xa649('0x8')](),controller[_0xa649('0x9')]);router[_0xa649('0x5')]('/:id',auth[_0xa649('0x8')](),controller[_0xa649('0xa')]);router['get']('/:id/messages',auth[_0xa649('0x8')](),controller['getMessages']);router[_0xa649('0x5')](_0xa649('0xb'),auth[_0xa649('0x8')](),controller['download']);router[_0xa649('0xc')]('/',auth['isAuthenticated'](),controller[_0xa649('0xd')]);router[_0xa649('0xc')](_0xa649('0xe'),auth[_0xa649('0x8')](),controller['addMessage']);router['post'](_0xa649('0xf'),auth[_0xa649('0x8')](),interaction[_0xa649('0x10')](_0xa649('0x11'),_0xa649('0x12')),controller[_0xa649('0x13')]);router[_0xa649('0x14')](_0xa649('0x15'),auth['isAuthenticated'](),interaction[_0xa649('0x10')](_0xa649('0x11'),_0xa649('0x16')),controller[_0xa649('0x17')]);router[_0xa649('0x18')](_0xa649('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0xa649('0x11'),_0xa649('0x19')),controller[_0xa649('0x1a')]);router[_0xa649('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa649('0x1b')]);module[_0xa649('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 8ef146f..7c1ed2c 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 _0xdb06=['BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','iconv','exports'];(function(_0x25b40d,_0x3d8e6c){var _0x25adab=function(_0x44de2b){while(--_0x44de2b){_0x25b40d['push'](_0x25b40d['shift']());}};_0x25adab(++_0x3d8e6c);}(_0xdb06,0x1e4));var _0x6db0=function(_0x2510db,_0x22d7b7){_0x2510db=_0x2510db-0x0;var _0x4617c6=_0xdb06[_0x2510db];return _0x4617c6;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x6db0('0x0'));module[_0x6db0('0x1')]={'closed':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6db0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6db0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6db0('0x4')]},'note':{'type':Sequelize[_0x6db0('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x6db0('0x4')]},'cc':{'type':Sequelize[_0x6db0('0x5')](_0x6db0('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6db0('0x3')]},'substatus':{'type':Sequelize[_0x6db0('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x6db0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6db0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6db0('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6db0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4291=['DATE','ENUM','out','sequelize','iconv','BOOLEAN','STRING','TEXT','long'];(function(_0x240ea6,_0xd9a792){var _0x294e24=function(_0xe0b92e){while(--_0xe0b92e){_0x240ea6['push'](_0x240ea6['shift']());}};_0x294e24(++_0xd9a792);}(_0x4291,0x1b3));var _0x1429=function(_0x10ead8,_0x2cdd51){_0x10ead8=_0x10ead8-0x0;var _0x3e1efe=_0x4291[_0x10ead8];return _0x3e1efe;};'use strict';var Sequelize=require(_0x1429('0x0'));var iconv=require(_0x1429('0x1'));module['exports']={'closed':{'type':Sequelize[_0x1429('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1429('0x3')]},'secondDisposition':{'type':Sequelize[_0x1429('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1429('0x3')]},'note':{'type':Sequelize[_0x1429('0x3')]},'inReplyTo':{'type':Sequelize[_0x1429('0x3')](0x1fe)},'to':{'type':Sequelize[_0x1429('0x3')]},'cc':{'type':Sequelize[_0x1429('0x4')](_0x1429('0x5'))},'subject':{'type':Sequelize[_0x1429('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1429('0x6')]},'substatus':{'type':Sequelize[_0x1429('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1429('0x7')]('in',_0x1429('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1429('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x1429('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1429('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index c9083ad..b8683c8 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 _0x4eb5=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','then','destroy','stack','name','send','index','map','fieldName','type','key','findAll','query','params','model','keys','MailInteraction','filters','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','update','describe','MailMessage','find','addMessage','ids','getMessages','findOne','rawAttributes','order','pick','MailInteractionId','where','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','root','tmp','files','format','transcript-%d-%s.zip','attachments','push','Attachment','Attachments','Messages','from','subject','createdAt','sort','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','moment','util','path','lodash','juice'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4eb5,0x1a6));var _0x54eb=function(_0x28c60a,_0x2dc2c7){_0x28c60a=_0x28c60a-0x0;var _0x1e8393=_0x4eb5[_0x28c60a];return _0x1e8393;};'use strict';var emlformat=require(_0x54eb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x54eb('0x1'));var BPromise=require('bluebird');var util=require(_0x54eb('0x2'));var path=require(_0x54eb('0x3'));var fs=require('fs');var _=require(_0x54eb('0x4'));var juice=require(_0x54eb('0x5'));var Redis=require(_0x54eb('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x54eb('0x7'));var logger=require(_0x54eb('0x8'))(_0x54eb('0x9'));var config=require(_0x54eb('0xa'));var db=require(_0x54eb('0xb'))['db'];var htmlEntities=require(_0x54eb('0xc'));config[_0x54eb('0xd')]=_[_0x54eb('0xe')](config[_0x54eb('0xd')],{'host':_0x54eb('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x54eb('0x10'))['register'](socket);function respondWithStatusCode(_0x2a3b28,_0x1bea9c){_0x1bea9c=_0x1bea9c||0xcc;return function(_0xd61e54){if(_0xd61e54){return _0x2a3b28[_0x54eb('0x11')](_0x1bea9c);}return _0x2a3b28[_0x54eb('0x12')](_0x1bea9c)['end']();};}function respondWithResult(_0x6385a5,_0xb38bbf){_0xb38bbf=_0xb38bbf||0xc8;return function(_0x3c33cd){if(_0x3c33cd){return _0x6385a5[_0x54eb('0x12')](_0xb38bbf)[_0x54eb('0x13')](_0x3c33cd);}};}function respondWithFilteredResult(_0x57e0f1,_0x24dbb5){return function(_0x5a91c9){if(_0x5a91c9){var _0x44e8fa=typeof _0x24dbb5['offset']==='undefined'&&typeof _0x24dbb5[_0x54eb('0x14')]===_0x54eb('0x15');var _0x159f9a=_0x5a91c9['count'];var _0x93160a=_0x44e8fa?0x0:_0x24dbb5[_0x54eb('0x16')];var _0x153498=_0x44e8fa?_0x5a91c9[_0x54eb('0x17')]:_0x24dbb5[_0x54eb('0x16')]+_0x24dbb5['limit'];var _0x99a540;if(_0x153498>=_0x159f9a){_0x153498=_0x159f9a;_0x99a540=0xc8;}else{_0x99a540=0xce;}_0x57e0f1['status'](_0x99a540);return _0x57e0f1[_0x54eb('0x18')](_0x54eb('0x19'),_0x93160a+'-'+_0x153498+'/'+_0x159f9a)[_0x54eb('0x13')](_0x5a91c9);}return null;};}function saveUpdates(_0x4efa58){return function(_0x467e3b){if(_0x467e3b){return _0x467e3b['update'](_0x4efa58)[_0x54eb('0x1a')](function(_0x4ab039){return _0x4ab039;});}return null;};}function removeEntity(_0x2d7d93){return function(_0x35409b){if(_0x35409b){return _0x35409b[_0x54eb('0x1b')]()[_0x54eb('0x1a')](function(){_0x2d7d93['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e11){return function(_0x42eb19){if(!_0x42eb19){_0x4a9e11[_0x54eb('0x11')](0x194);}return _0x42eb19;};}function handleError(_0x40f2c4,_0xe69c9e){_0xe69c9e=_0xe69c9e||0x1f4;return function(_0x3179ea){logger['error'](_0x3179ea[_0x54eb('0x1c')]);if(_0x3179ea[_0x54eb('0x1d')]){delete _0x3179ea[_0x54eb('0x1d')];}_0x40f2c4[_0x54eb('0x12')](_0xe69c9e)[_0x54eb('0x1e')](_0x3179ea);};}exports[_0x54eb('0x1f')]=function(_0x241f1a,_0x5ba0ef){var _0x456366={};var _0x471619=_[_0x54eb('0x20')](db['MailInteraction']['rawAttributes'],function(_0x5d5ba4){return{'name':_0x5d5ba4[_0x54eb('0x21')],'type':_0x5d5ba4[_0x54eb('0x22')][_0x54eb('0x23')]};});_0x456366=qs['getOptions'](_0x471619,_0x241f1a);return interaction[_0x54eb('0x24')]('mail',_0x241f1a[_0x54eb('0x25')],_0x241f1a['user'],_0x456366,_0x471619)['then'](respondWithFilteredResult(_0x5ba0ef,_0x456366))['catch'](handleError(_0x5ba0ef,null));};exports['show']=function(_0x5c2f9b,_0x5f5875){var _0x2253de={'raw':![],'where':{'id':_0x5c2f9b[_0x54eb('0x26')]['id']}},_0x3da3d1={};_0x3da3d1[_0x54eb('0x27')]=_[_0x54eb('0x28')](db[_0x54eb('0x29')]['rawAttributes']);_0x3da3d1[_0x54eb('0x25')]=_[_0x54eb('0x28')](_0x5c2f9b[_0x54eb('0x25')]);_0x3da3d1[_0x54eb('0x2a')]=_['intersection'](_0x3da3d1[_0x54eb('0x27')],_0x3da3d1['query']);_0x2253de[_0x54eb('0x2b')]=_[_0x54eb('0x2c')](_0x3da3d1['model'],qs[_0x54eb('0x2d')](_0x5c2f9b[_0x54eb('0x25')]['fields']));_0x2253de[_0x54eb('0x2b')]=_0x2253de['attributes'][_0x54eb('0x2e')]?_0x2253de[_0x54eb('0x2b')]:_0x3da3d1['model'];if(_0x5c2f9b[_0x54eb('0x25')][_0x54eb('0x2f')]){_0x2253de[_0x54eb('0x30')]=[{'all':!![]}];}_0x2253de=_[_0x54eb('0x31')]({},_0x2253de,_0x5c2f9b[_0x54eb('0x32')]);return db[_0x54eb('0x29')]['find'](_0x2253de)[_0x54eb('0x1a')](handleEntityNotFound(_0x5f5875,null))['then'](respondWithResult(_0x5f5875,null))[_0x54eb('0x33')](handleError(_0x5f5875,null));};exports['create']=function(_0x59acbe,_0x4efcb5){return db[_0x54eb('0x29')][_0x54eb('0x34')](_0x59acbe[_0x54eb('0x35')],{})[_0x54eb('0x1a')](respondWithResult(_0x4efcb5,0xc9))[_0x54eb('0x33')](handleError(_0x4efcb5,null));};exports[_0x54eb('0x36')]=function(_0x24110e,_0x53ea68){if(_0x24110e[_0x54eb('0x35')]['id']){delete _0x24110e['body']['id'];}return db[_0x54eb('0x29')]['find']({'where':{'id':_0x24110e[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x53ea68,null))[_0x54eb('0x1a')](saveUpdates(_0x24110e['body'],null))[_0x54eb('0x1a')](respondWithResult(_0x53ea68,null))[_0x54eb('0x33')](handleError(_0x53ea68,null));};exports[_0x54eb('0x1b')]=function(_0x3a9821,_0x29307f){return db['MailInteraction']['find']({'where':{'id':_0x3a9821[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x29307f,null))['then'](removeEntity(_0x29307f,null))['catch'](handleError(_0x29307f,null));};exports[_0x54eb('0x37')]=function(_0x1be2b0,_0x1fe4c3){return db['MailInteraction']['describe']()[_0x54eb('0x1a')](respondWithResult(_0x1fe4c3,null))[_0x54eb('0x33')](handleError(_0x1fe4c3,null));};exports['addMessage']=function(_0x375eea,_0x20a936){return db[_0x54eb('0x38')][_0x54eb('0x39')]({'where':{'id':_0x375eea[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x20a936,null))[_0x54eb('0x1a')](function(_0x46f676){if(_0x46f676){return _0x46f676[_0x54eb('0x3a')](_0x375eea['body'][_0x54eb('0x3b')],_['omit'](_0x375eea['body'],['ids','id'])||{});}})[_0x54eb('0x1a')](respondWithResult(_0x20a936,null))[_0x54eb('0x33')](handleError(_0x20a936,null));};exports[_0x54eb('0x3c')]=function(_0x49f7ae,_0x15bfb3){var _0x335ec5={'raw':![],'where':{}};var _0x449f81={};var _0x1b9899={'count':0x0,'rows':[]};return db['MailInteraction'][_0x54eb('0x3d')]({'where':{'id':_0x49f7ae['params']['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x15bfb3,null))['then'](function(_0x510ada){if(_0x510ada){_0x449f81['model']=_[_0x54eb('0x28')](db['MailMessage'][_0x54eb('0x3e')]);_0x449f81[_0x54eb('0x25')]=_['keys'](_0x49f7ae[_0x54eb('0x25')]);_0x449f81[_0x54eb('0x2a')]=_[_0x54eb('0x2c')](_0x449f81[_0x54eb('0x27')],_0x449f81[_0x54eb('0x25')]);_0x335ec5[_0x54eb('0x2b')]=_['intersection'](_0x449f81[_0x54eb('0x27')],qs[_0x54eb('0x2d')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x2d')]));_0x335ec5['attributes']=_0x335ec5['attributes'][_0x54eb('0x2e')]?_0x335ec5['attributes']:_0x449f81[_0x54eb('0x27')];if(!_0x49f7ae[_0x54eb('0x25')]['hasOwnProperty']('nolimit')){_0x335ec5[_0x54eb('0x14')]=qs[_0x54eb('0x14')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x14')]);_0x335ec5[_0x54eb('0x16')]=qs[_0x54eb('0x16')](_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x16')]);}_0x335ec5[_0x54eb('0x3f')]=qs['sort'](_0x49f7ae[_0x54eb('0x25')]['sort']);_0x335ec5['where']=qs[_0x54eb('0x2a')](_[_0x54eb('0x40')](_0x49f7ae[_0x54eb('0x25')],_0x449f81[_0x54eb('0x2a')]));_0x335ec5['where'][_0x54eb('0x41')]=_0x510ada['id'];if(_0x49f7ae[_0x54eb('0x25')]['filter']){_0x335ec5[_0x54eb('0x42')]=_[_0x54eb('0x31')](_0x335ec5[_0x54eb('0x42')],{'$or':_[_0x54eb('0x20')](_0x335ec5[_0x54eb('0x2b')],function(_0x5528fe){var _0x3c7d19={};_0x3c7d19[_0x5528fe]={'$like':'%'+_0x49f7ae[_0x54eb('0x25')]['filter']+'%'};return _0x3c7d19;})});}if(_0x49f7ae[_0x54eb('0x25')]['$gte']){var _0x499662=_0x49f7ae['query'][_0x54eb('0x43')]['split'](',');var _0x368aaf={};_0x368aaf[_0x499662[0x0]]={'$gte':moment(_0x499662[0x1])['format'](_0x54eb('0x44'))};_0x335ec5[_0x54eb('0x42')]=_['merge'](_0x335ec5[_0x54eb('0x42')],_0x368aaf);}_0x335ec5=_[_0x54eb('0x31')]({},_0x335ec5,_0x49f7ae[_0x54eb('0x32')]);return db[_0x54eb('0x38')][_0x54eb('0x17')]({'where':_0x335ec5['where']})[_0x54eb('0x1a')](function(_0x403f76){_0x1b9899[_0x54eb('0x17')]=_0x403f76;if(_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x2f')]){_0x335ec5['include']=[{'all':!![]}];}return db[_0x54eb('0x38')][_0x54eb('0x24')](_0x335ec5);})[_0x54eb('0x1a')](function(_0x3116d2){if(_0x49f7ae[_0x54eb('0x25')][_0x54eb('0x45')]===_0x54eb('0x46')){for(var _0x2840ae=0x0;_0x2840ae<_0x3116d2[_0x54eb('0x2e')];_0x2840ae++){_0x3116d2[_0x2840ae][_0x54eb('0x35')]=juice(_0x3116d2[_0x2840ae]['body']);}}_0x1b9899[_0x54eb('0x47')]=_0x3116d2;return _0x1b9899;});}})[_0x54eb('0x1a')](respondWithFilteredResult(_0x15bfb3,_0x335ec5))[_0x54eb('0x33')](handleError(_0x15bfb3,null));};exports['addTags']=function(_0x35c03f,_0x39a23e){return db['MailInteraction'][_0x54eb('0x39')]({'where':{'id':_0x35c03f[_0x54eb('0x26')]['id']}})[_0x54eb('0x1a')](handleEntityNotFound(_0x39a23e,null))[_0x54eb('0x1a')](function(_0x3dbb6e){if(_0x3dbb6e){return _0x3dbb6e[_0x54eb('0x48')](_0x35c03f['body'][_0x54eb('0x3b')],_[_0x54eb('0x49')](_0x35c03f['body'],[_0x54eb('0x3b'),'id'])||{})[_0x54eb('0x4a')](function(){return db['Tag'][_0x54eb('0x24')]({'attributes':['id',_0x54eb('0x1d'),'color'],'where':{'id':_0x35c03f[_0x54eb('0x35')][_0x54eb('0x3b')]}});})[_0x54eb('0x1a')](function(_0x4c5b70){socket[_0x54eb('0x4b')](_0x54eb('0x4c'),{'id':Number(_0x35c03f[_0x54eb('0x26')]['id']),'tags':_0x4c5b70||[]});return{'id':Number(_0x35c03f[_0x54eb('0x26')]['id']),'tags':_0x4c5b70||[]};});}})[_0x54eb('0x1a')](respondWithResult(_0x39a23e,null))['catch'](handleError(_0x39a23e,null));};exports[_0x54eb('0x4d')]=function(_0xd13908,_0x31d0fe){return db[_0x54eb('0x29')]['find']({'where':{'id':_0xd13908[_0x54eb('0x26')]['id']}})['then'](handleEntityNotFound(_0x31d0fe,null))['then'](function(_0x5f5919){if(_0x5f5919){return _0x5f5919['removeTags'](_0xd13908[_0x54eb('0x25')][_0x54eb('0x3b')]);}})[_0x54eb('0x1a')](respondWithStatusCode(_0x31d0fe,null))['catch'](handleError(_0x31d0fe,null));};exports[_0x54eb('0x4e')]=function(_0x41e937,_0x113777){var _0xfdfc00=moment()['unix']()['toString']();var _0x16554c=path[_0x54eb('0x4f')](config[_0x54eb('0x50')],'server','files',_0x54eb('0x51'));var _0x519d38=path[_0x54eb('0x4f')](config[_0x54eb('0x50')],'server',_0x54eb('0x52'),'attachments');var _0x486848=path[_0x54eb('0x4f')](_0x16554c,_0xfdfc00);var _0x459251=util[_0x54eb('0x53')](_0x54eb('0x54'),_0x41e937['params']['id'],_0xfdfc00);var _0x580ce5=path[_0x54eb('0x4f')](_0x16554c,_0x459251);var _0x2286fe=[];if(_0x41e937[_0x54eb('0x25')][_0x54eb('0x55')]){_0x2286fe[_0x54eb('0x56')]({'model':db[_0x54eb('0x57')],'as':_0x54eb('0x58'),'raw':!![]});}var _0x2750f3=[{'model':db['MailMessage'],'as':_0x54eb('0x59'),'attributes':['id',_0x54eb('0x35'),_0x54eb('0x5a'),'to','cc','bcc',_0x54eb('0x5b'),_0x54eb('0x5c')],'where':{'secret':![]},'order':qs[_0x54eb('0x5d')]('id'),'include':_0x2286fe}];return db[_0x54eb('0x29')][_0x54eb('0x39')]({'where':{'id':_0x41e937[_0x54eb('0x26')]['id']},'include':_0x2750f3})[_0x54eb('0x1a')](handleEntityNotFound(_0x113777,null))[_0x54eb('0x1a')](function(_0x3de061){if(_0x3de061&&_0x3de061[_0x54eb('0x59')]){var _0x3413ae=_0x3de061[_0x54eb('0x5e')]({'plain':!![]});fs[_0x54eb('0x5f')](_0x486848);return BPromise['each'](_0x3413ae[_0x54eb('0x59')],function(_0x299721,_0x497103){var _0x232717={'from':_0x299721[_0x54eb('0x5a')],'to':_0x299721['to']||'missing.recipient@your.company.com','subject':_0x299721[_0x54eb('0x5b')],'html':htmlEntities[_0x54eb('0x60')](_0x299721[_0x54eb('0x35')]),'headers':{'Date':moment(_0x299721[_0x54eb('0x5c')])[_0x54eb('0x53')](_0x54eb('0x61'))},'attachments':[]};if(_0x299721['cc']){_0x232717[_0x54eb('0x62')]['Cc']=_0x299721['cc'];}if(_0x299721[_0x54eb('0x63')]){_0x232717[_0x54eb('0x62')]['Bcc']=_0x299721[_0x54eb('0x63')];}return new BPromise(function(_0x1c91df,_0x1df1c8){if(_0x299721[_0x54eb('0x58')]){for(var _0x1bf9b6=0x0;_0x1bf9b6<_0x299721[_0x54eb('0x58')][_0x54eb('0x2e')];_0x1bf9b6++){var _0x4a6750=_0x299721['Attachments'][_0x1bf9b6];var _0x4b553d=path[_0x54eb('0x4f')](_0x519d38,_0x4a6750[_0x54eb('0x64')]);if(fs[_0x54eb('0x65')](_0x4b553d)){_0x232717[_0x54eb('0x55')][_0x54eb('0x56')]({'name':_0x4a6750[_0x54eb('0x1d')],'contentType':_0x4a6750[_0x54eb('0x22')],'data':fs[_0x54eb('0x66')](_0x4b553d)});}}}emlformat[_0x54eb('0x67')](_0x232717,function(_0x3d85b6,_0x3bf535){if(_0x3d85b6)return _0x1df1c8(_0x3d85b6);fs[_0x54eb('0x68')](path[_0x54eb('0x4f')](_0x486848,util[_0x54eb('0x53')](_0x54eb('0x69'),_0x497103)),_0x3bf535);return _0x1c91df(_0x3bf535);});});})[_0x54eb('0x1a')](function(){return new BPromise(function(_0x2002e8,_0x15f214){zipdir(_0x486848,{'saveTo':_0x580ce5},function(_0x4637c9,_0x442984){if(_0x4637c9)return _0x15f214(_0x4637c9);return _0x2002e8(_0x442984);});})[_0x54eb('0x1a')](function(){return new BPromise(function(_0x291763,_0x5b0f24){rimraf(_0x486848,function(_0x115df3){if(_0x115df3)_0x5b0f24(_0x115df3);return _0x291763();});});})[_0x54eb('0x1a')](function(){return _0x113777[_0x54eb('0x4e')](_0x580ce5,_0x459251,function(_0x1b82dd){if(!_0x1b82dd)fs[_0x54eb('0x6a')](_0x580ce5);});});});}else{return _0x113777[_0x54eb('0x11')](0xc8);}})[_0x54eb('0x33')](handleError(_0x113777,null));}; \ No newline at end of file +var _0x62c9=['color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','stack','send','map','MailInteraction','fieldName','type','getOptions','findAll','mail','query','user','show','params','model','keys','filters','intersection','fields','attributes','include','options','find','catch','create','body','describe','addMessage','MailMessage','ids','getMessages','findOne','rawAttributes','length','hasOwnProperty','nolimit','order','sort','MailInteractionId','filter','where','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','addTags','omit','Tag','name'];(function(_0x5d67e1,_0x308ffc){var _0x156bda=function(_0x45f853){while(--_0x45f853){_0x5d67e1['push'](_0x5d67e1['shift']());}};_0x156bda(++_0x308ffc);}(_0x62c9,0x17f));var _0x962c=function(_0x49bd7e,_0x6568e7){_0x49bd7e=_0x49bd7e-0x0;var _0xe2de25=_0x62c9[_0x49bd7e];return _0xe2de25;};'use strict';var emlformat=require(_0x962c('0x0'));var rimraf=require(_0x962c('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x962c('0x2'));var util=require(_0x962c('0x3'));var path=require(_0x962c('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0x962c('0x5'));var Redis=require(_0x962c('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x962c('0x7'));var logger=require(_0x962c('0x8'))(_0x962c('0x9'));var config=require('../../config/environment');var db=require(_0x962c('0xa'))['db'];var htmlEntities=require('html-entities');config[_0x962c('0xb')]=_[_0x962c('0xc')](config['redis'],{'host':_0x962c('0xd'),'port':0x18eb});var socket=require(_0x962c('0xe'))(new Redis(config[_0x962c('0xb')]));require(_0x962c('0xf'))[_0x962c('0x10')](socket);function respondWithStatusCode(_0x31456a,_0x194d48){_0x194d48=_0x194d48||0xcc;return function(_0x198715){if(_0x198715){return _0x31456a['sendStatus'](_0x194d48);}return _0x31456a[_0x962c('0x11')](_0x194d48)[_0x962c('0x12')]();};}function respondWithResult(_0x2e5c96,_0x54abdd){_0x54abdd=_0x54abdd||0xc8;return function(_0xe358fc){if(_0xe358fc){return _0x2e5c96['status'](_0x54abdd)[_0x962c('0x13')](_0xe358fc);}};}function respondWithFilteredResult(_0x13fede,_0x3e3366){return function(_0x2a593b){if(_0x2a593b){var _0x1bb455=typeof _0x3e3366[_0x962c('0x14')]===_0x962c('0x15')&&typeof _0x3e3366[_0x962c('0x16')]==='undefined';var _0x220c3c=_0x2a593b[_0x962c('0x17')];var _0x43219d=_0x1bb455?0x0:_0x3e3366['offset'];var _0x38563e=_0x1bb455?_0x2a593b[_0x962c('0x17')]:_0x3e3366[_0x962c('0x14')]+_0x3e3366['limit'];var _0x52b405;if(_0x38563e>=_0x220c3c){_0x38563e=_0x220c3c;_0x52b405=0xc8;}else{_0x52b405=0xce;}_0x13fede[_0x962c('0x11')](_0x52b405);return _0x13fede['set'](_0x962c('0x18'),_0x43219d+'-'+_0x38563e+'/'+_0x220c3c)[_0x962c('0x13')](_0x2a593b);}return null;};}function saveUpdates(_0x12f2c1){return function(_0x344d02){if(_0x344d02){return _0x344d02[_0x962c('0x19')](_0x12f2c1)[_0x962c('0x1a')](function(_0x715d3){return _0x715d3;});}return null;};}function removeEntity(_0x58cea3){return function(_0x191812){if(_0x191812){return _0x191812[_0x962c('0x1b')]()[_0x962c('0x1a')](function(){_0x58cea3[_0x962c('0x11')](0xcc)[_0x962c('0x12')]();});}};}function handleEntityNotFound(_0x5727d0){return function(_0x46037f){if(!_0x46037f){_0x5727d0[_0x962c('0x1c')](0x194);}return _0x46037f;};}function handleError(_0x807bc9,_0x13d4e0){_0x13d4e0=_0x13d4e0||0x1f4;return function(_0x2e9a5b){logger['error'](_0x2e9a5b[_0x962c('0x1d')]);if(_0x2e9a5b['name']){delete _0x2e9a5b['name'];}_0x807bc9[_0x962c('0x11')](_0x13d4e0)[_0x962c('0x1e')](_0x2e9a5b);};}exports['index']=function(_0xd89c58,_0x47faa7){var _0x43bf59={};var _0x56879a=_[_0x962c('0x1f')](db[_0x962c('0x20')]['rawAttributes'],function(_0x1429bd){return{'name':_0x1429bd[_0x962c('0x21')],'type':_0x1429bd[_0x962c('0x22')]['key']};});_0x43bf59=qs[_0x962c('0x23')](_0x56879a,_0xd89c58);return interaction[_0x962c('0x24')](_0x962c('0x25'),_0xd89c58[_0x962c('0x26')],_0xd89c58[_0x962c('0x27')],_0x43bf59,_0x56879a)[_0x962c('0x1a')](respondWithFilteredResult(_0x47faa7,_0x43bf59))['catch'](handleError(_0x47faa7,null));};exports[_0x962c('0x28')]=function(_0x592f9c,_0x25aa91){var _0x534276={'raw':![],'where':{'id':_0x592f9c[_0x962c('0x29')]['id']}},_0x2377fc={};_0x2377fc[_0x962c('0x2a')]=_[_0x962c('0x2b')](db[_0x962c('0x20')]['rawAttributes']);_0x2377fc[_0x962c('0x26')]=_['keys'](_0x592f9c[_0x962c('0x26')]);_0x2377fc[_0x962c('0x2c')]=_[_0x962c('0x2d')](_0x2377fc[_0x962c('0x2a')],_0x2377fc['query']);_0x534276['attributes']=_[_0x962c('0x2d')](_0x2377fc[_0x962c('0x2a')],qs[_0x962c('0x2e')](_0x592f9c[_0x962c('0x26')][_0x962c('0x2e')]));_0x534276[_0x962c('0x2f')]=_0x534276[_0x962c('0x2f')]['length']?_0x534276[_0x962c('0x2f')]:_0x2377fc[_0x962c('0x2a')];if(_0x592f9c['query']['includeAll']){_0x534276[_0x962c('0x30')]=[{'all':!![]}];}_0x534276=_['merge']({},_0x534276,_0x592f9c[_0x962c('0x31')]);return db[_0x962c('0x20')][_0x962c('0x32')](_0x534276)[_0x962c('0x1a')](handleEntityNotFound(_0x25aa91,null))[_0x962c('0x1a')](respondWithResult(_0x25aa91,null))[_0x962c('0x33')](handleError(_0x25aa91,null));};exports[_0x962c('0x34')]=function(_0xd1350c,_0x2eaaea){return db[_0x962c('0x20')][_0x962c('0x34')](_0xd1350c[_0x962c('0x35')],{})[_0x962c('0x1a')](respondWithResult(_0x2eaaea,0xc9))[_0x962c('0x33')](handleError(_0x2eaaea,null));};exports[_0x962c('0x19')]=function(_0x2fcfcf,_0x4d2604){if(_0x2fcfcf[_0x962c('0x35')]['id']){delete _0x2fcfcf[_0x962c('0x35')]['id'];}return db[_0x962c('0x20')][_0x962c('0x32')]({'where':{'id':_0x2fcfcf[_0x962c('0x29')]['id']}})['then'](handleEntityNotFound(_0x4d2604,null))['then'](saveUpdates(_0x2fcfcf[_0x962c('0x35')],null))[_0x962c('0x1a')](respondWithResult(_0x4d2604,null))[_0x962c('0x33')](handleError(_0x4d2604,null));};exports['destroy']=function(_0x4540fc,_0x374d4a){return db[_0x962c('0x20')]['find']({'where':{'id':_0x4540fc['params']['id']}})[_0x962c('0x1a')](handleEntityNotFound(_0x374d4a,null))[_0x962c('0x1a')](removeEntity(_0x374d4a,null))[_0x962c('0x33')](handleError(_0x374d4a,null));};exports[_0x962c('0x36')]=function(_0x1d269b,_0x40418f){return db[_0x962c('0x20')][_0x962c('0x36')]()[_0x962c('0x1a')](respondWithResult(_0x40418f,null))['catch'](handleError(_0x40418f,null));};exports[_0x962c('0x37')]=function(_0x4fbdcf,_0x39cacb){return db[_0x962c('0x38')][_0x962c('0x32')]({'where':{'id':_0x4fbdcf['params']['id']}})[_0x962c('0x1a')](handleEntityNotFound(_0x39cacb,null))['then'](function(_0x47c421){if(_0x47c421){return _0x47c421['addMessage'](_0x4fbdcf[_0x962c('0x35')][_0x962c('0x39')],_['omit'](_0x4fbdcf[_0x962c('0x35')],[_0x962c('0x39'),'id'])||{});}})[_0x962c('0x1a')](respondWithResult(_0x39cacb,null))[_0x962c('0x33')](handleError(_0x39cacb,null));};exports[_0x962c('0x3a')]=function(_0x49d2bd,_0x360100){var _0x335879={'raw':![],'where':{}};var _0x288705={};var _0x26bde9={'count':0x0,'rows':[]};return db[_0x962c('0x20')][_0x962c('0x3b')]({'where':{'id':_0x49d2bd[_0x962c('0x29')]['id']}})[_0x962c('0x1a')](handleEntityNotFound(_0x360100,null))['then'](function(_0x152f1b){if(_0x152f1b){_0x288705[_0x962c('0x2a')]=_[_0x962c('0x2b')](db[_0x962c('0x38')][_0x962c('0x3c')]);_0x288705[_0x962c('0x26')]=_['keys'](_0x49d2bd[_0x962c('0x26')]);_0x288705[_0x962c('0x2c')]=_[_0x962c('0x2d')](_0x288705[_0x962c('0x2a')],_0x288705[_0x962c('0x26')]);_0x335879[_0x962c('0x2f')]=_['intersection'](_0x288705[_0x962c('0x2a')],qs[_0x962c('0x2e')](_0x49d2bd[_0x962c('0x26')]['fields']));_0x335879[_0x962c('0x2f')]=_0x335879['attributes'][_0x962c('0x3d')]?_0x335879[_0x962c('0x2f')]:_0x288705['model'];if(!_0x49d2bd[_0x962c('0x26')][_0x962c('0x3e')](_0x962c('0x3f'))){_0x335879[_0x962c('0x16')]=qs[_0x962c('0x16')](_0x49d2bd[_0x962c('0x26')]['limit']);_0x335879[_0x962c('0x14')]=qs[_0x962c('0x14')](_0x49d2bd['query'][_0x962c('0x14')]);}_0x335879[_0x962c('0x40')]=qs['sort'](_0x49d2bd[_0x962c('0x26')][_0x962c('0x41')]);_0x335879['where']=qs[_0x962c('0x2c')](_['pick'](_0x49d2bd[_0x962c('0x26')],_0x288705['filters']));_0x335879['where'][_0x962c('0x42')]=_0x152f1b['id'];if(_0x49d2bd[_0x962c('0x26')][_0x962c('0x43')]){_0x335879[_0x962c('0x44')]=_[_0x962c('0x45')](_0x335879[_0x962c('0x44')],{'$or':_[_0x962c('0x1f')](_0x335879[_0x962c('0x2f')],function(_0x33c809){var _0x14b23e={};_0x14b23e[_0x33c809]={'$like':'%'+_0x49d2bd[_0x962c('0x26')][_0x962c('0x43')]+'%'};return _0x14b23e;})});}if(_0x49d2bd['query'][_0x962c('0x46')]){var _0x558f2e=_0x49d2bd[_0x962c('0x26')][_0x962c('0x46')][_0x962c('0x47')](',');var _0x3d6b24={};_0x3d6b24[_0x558f2e[0x0]]={'$gte':moment(_0x558f2e[0x1])[_0x962c('0x48')](_0x962c('0x49'))};_0x335879[_0x962c('0x44')]=_['merge'](_0x335879[_0x962c('0x44')],_0x3d6b24);}_0x335879=_[_0x962c('0x45')]({},_0x335879,_0x49d2bd[_0x962c('0x31')]);return db[_0x962c('0x38')]['count']({'where':_0x335879[_0x962c('0x44')]})[_0x962c('0x1a')](function(_0x189ad7){_0x26bde9[_0x962c('0x17')]=_0x189ad7;if(_0x49d2bd[_0x962c('0x26')][_0x962c('0x4a')]){_0x335879[_0x962c('0x30')]=[{'all':!![]}];}return db[_0x962c('0x38')][_0x962c('0x24')](_0x335879);})[_0x962c('0x1a')](function(_0x5a86d5){if(_0x49d2bd[_0x962c('0x26')][_0x962c('0x4b')]===_0x962c('0x4c')){for(var _0xa1eba3=0x0;_0xa1eba3<_0x5a86d5[_0x962c('0x3d')];_0xa1eba3++){_0x5a86d5[_0xa1eba3][_0x962c('0x35')]=juice(_0x5a86d5[_0xa1eba3]['body']);}}_0x26bde9['rows']=_0x5a86d5;return _0x26bde9;});}})[_0x962c('0x1a')](respondWithFilteredResult(_0x360100,_0x335879))['catch'](handleError(_0x360100,null));};exports[_0x962c('0x4d')]=function(_0x969930,_0x446174){return db['MailInteraction'][_0x962c('0x32')]({'where':{'id':_0x969930['params']['id']}})[_0x962c('0x1a')](handleEntityNotFound(_0x446174,null))[_0x962c('0x1a')](function(_0x32eaf4){if(_0x32eaf4){return _0x32eaf4['setTags'](_0x969930[_0x962c('0x35')][_0x962c('0x39')],_[_0x962c('0x4e')](_0x969930[_0x962c('0x35')],['ids','id'])||{})['spread'](function(){return db[_0x962c('0x4f')]['findAll']({'attributes':['id',_0x962c('0x50'),_0x962c('0x51')],'where':{'id':_0x969930['body'][_0x962c('0x39')]}});})['then'](function(_0x20d6b4){socket[_0x962c('0x52')](_0x962c('0x53'),{'id':Number(_0x969930[_0x962c('0x29')]['id']),'tags':_0x20d6b4||[]});return{'id':Number(_0x969930[_0x962c('0x29')]['id']),'tags':_0x20d6b4||[]};});}})[_0x962c('0x1a')](respondWithResult(_0x446174,null))['catch'](handleError(_0x446174,null));};exports[_0x962c('0x54')]=function(_0x46709f,_0x45c856){return db[_0x962c('0x20')][_0x962c('0x32')]({'where':{'id':_0x46709f[_0x962c('0x29')]['id']}})['then'](handleEntityNotFound(_0x45c856,null))['then'](function(_0x407d4c){if(_0x407d4c){return _0x407d4c['removeTags'](_0x46709f[_0x962c('0x26')][_0x962c('0x39')]);}})['then'](respondWithStatusCode(_0x45c856,null))[_0x962c('0x33')](handleError(_0x45c856,null));};exports[_0x962c('0x55')]=function(_0x1dde62,_0x1c8bc6){var _0x528d18=moment()[_0x962c('0x56')]()['toString']();var _0x21aefa=path[_0x962c('0x57')](config[_0x962c('0x58')],_0x962c('0x59'),_0x962c('0x5a'),_0x962c('0x5b'));var _0x2e5817=path['join'](config[_0x962c('0x58')],'server',_0x962c('0x5a'),_0x962c('0x5c'));var _0x519343=path[_0x962c('0x57')](_0x21aefa,_0x528d18);var _0x231d19=util[_0x962c('0x48')](_0x962c('0x5d'),_0x1dde62[_0x962c('0x29')]['id'],_0x528d18);var _0xfd76ac=path[_0x962c('0x57')](_0x21aefa,_0x231d19);var _0x3fc91a=[];if(_0x1dde62['query'][_0x962c('0x5c')]){_0x3fc91a[_0x962c('0x5e')]({'model':db[_0x962c('0x5f')],'as':_0x962c('0x60'),'raw':!![]});}var _0x502c5d=[{'model':db[_0x962c('0x38')],'as':_0x962c('0x61'),'attributes':['id',_0x962c('0x35'),'from','to','cc',_0x962c('0x62'),_0x962c('0x63'),_0x962c('0x64')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x3fc91a}];return db['MailInteraction'][_0x962c('0x32')]({'where':{'id':_0x1dde62[_0x962c('0x29')]['id']},'include':_0x502c5d})[_0x962c('0x1a')](handleEntityNotFound(_0x1c8bc6,null))[_0x962c('0x1a')](function(_0x59560e){if(_0x59560e&&_0x59560e[_0x962c('0x61')]){var _0x5cf5a7=_0x59560e[_0x962c('0x65')]({'plain':!![]});fs[_0x962c('0x66')](_0x519343);return BPromise[_0x962c('0x67')](_0x5cf5a7[_0x962c('0x61')],function(_0x21eeca,_0xefde5d){var _0x381cc2={'from':_0x21eeca[_0x962c('0x68')],'to':_0x21eeca['to']||_0x962c('0x69'),'subject':_0x21eeca[_0x962c('0x63')],'html':htmlEntities[_0x962c('0x6a')](_0x21eeca['body']),'headers':{'Date':moment(_0x21eeca['createdAt'])[_0x962c('0x48')](_0x962c('0x6b'))},'attachments':[]};if(_0x21eeca['cc']){_0x381cc2[_0x962c('0x6c')]['Cc']=_0x21eeca['cc'];}if(_0x21eeca[_0x962c('0x62')]){_0x381cc2[_0x962c('0x6c')][_0x962c('0x6d')]=_0x21eeca['bcc'];}return new BPromise(function(_0x1c1572,_0x116003){if(_0x21eeca[_0x962c('0x60')]){for(var _0x470c3e=0x0;_0x470c3e<_0x21eeca['Attachments'][_0x962c('0x3d')];_0x470c3e++){var _0x35b86d=_0x21eeca[_0x962c('0x60')][_0x470c3e];var _0x510d2b=path['join'](_0x2e5817,_0x35b86d[_0x962c('0x6e')]);if(fs[_0x962c('0x6f')](_0x510d2b)){_0x381cc2[_0x962c('0x5c')][_0x962c('0x5e')]({'name':_0x35b86d[_0x962c('0x50')],'contentType':_0x35b86d['type'],'data':fs['readFileSync'](_0x510d2b)});}}}emlformat[_0x962c('0x70')](_0x381cc2,function(_0x2fd6b8,_0x6fb0ea){if(_0x2fd6b8)return _0x116003(_0x2fd6b8);fs[_0x962c('0x71')](path['join'](_0x519343,util[_0x962c('0x48')](_0x962c('0x72'),_0xefde5d)),_0x6fb0ea);return _0x1c1572(_0x6fb0ea);});});})[_0x962c('0x1a')](function(){return new BPromise(function(_0x366fd6,_0x22d84c){zipdir(_0x519343,{'saveTo':_0xfd76ac},function(_0x5847e4,_0x17bf69){if(_0x5847e4)return _0x22d84c(_0x5847e4);return _0x366fd6(_0x17bf69);});})['then'](function(){return new BPromise(function(_0x1fd6a0,_0xa4f109){rimraf(_0x519343,function(_0x3bde43){if(_0x3bde43)_0xa4f109(_0x3bde43);return _0x1fd6a0();});});})[_0x962c('0x1a')](function(){return _0x1c8bc6[_0x962c('0x55')](_0xfd76ac,_0x231d19,function(_0x5c355c){if(!_0x5c355c)fs[_0x962c('0x73')](_0xfd76ac);});});});}else{return _0x1c8bc6[_0x962c('0x1c')](0xc8);}})['catch'](handleError(_0x1c8bc6,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 735c2a4..094ce8e 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 _0x6574=['hasOwnProperty','events','MailInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x6574,0x1a1));var _0x4657=function(_0x79462d,_0xea171f){_0x79462d=_0x79462d-0x0;var _0x4bfdc4=_0x6574[_0x79462d];return _0x4bfdc4;};'use strict';var EventEmitter=require(_0x4657('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4657('0x1')];var MailMessage=require(_0x4657('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4657('0x3')](0x0);var events={'afterCreate':_0x4657('0x4'),'afterUpdate':_0x4657('0x5'),'afterDestroy':_0x4657('0x6')};function emitEvent(_0x5ab034){return function(_0x1c0f02,_0x3fb75d,_0x21f5e1){_0x1c0f02[_0x4657('0x7')]({'attributes':['id'],'raw':!![]})[_0x4657('0x8')](function(_0x1c1ba1){_0x1c0f02[_0x4657('0x9')](_0x4657('0xa'),_0x1c1ba1['map'](function(_0x15c6c8){return{'id':_0x15c6c8['id']};}));return MailMessage[_0x4657('0xb')]({'where':{'MailInteractionId':_0x1c0f02['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x6782c6){_0x1c0f02[_0x4657('0x9')](_0x4657('0xc'),_0x6782c6[_0x4657('0xd')]);MailInteractionEvents[_0x4657('0xe')](_0x5ab034+':'+_0x1c0f02['id'],_0x1c0f02);MailInteractionEvents[_0x4657('0xe')](_0x5ab034,_0x1c0f02);_0x21f5e1(null);})['catch'](_0x21f5e1(null));};}for(var e in events){if(events[_0x4657('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xfc8f=['then','map','findAll','unreadMessages','emit','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x20596d,_0x976c21){var _0x11917b=function(_0x27320a){while(--_0x27320a){_0x20596d['push'](_0x20596d['shift']());}};_0x11917b(++_0x976c21);}(_0xfc8f,0x19d));var _0xffc8=function(_0x47b12b,_0xfe2d0a){_0x47b12b=_0x47b12b-0x0;var _0x111cca=_0xfc8f[_0x47b12b];return _0x111cca;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xffc8('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xffc8('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xffc8('0x1')](0x0);var events={'afterCreate':_0xffc8('0x2'),'afterUpdate':_0xffc8('0x3'),'afterDestroy':_0xffc8('0x4')};function emitEvent(_0x639847){return function(_0xf49561,_0x51158e,_0x525718){_0xf49561['getUsers']({'attributes':['id'],'raw':!![]})[_0xffc8('0x5')](function(_0x57cd15){_0xf49561['setDataValue']('Users',_0x57cd15[_0xffc8('0x6')](function(_0x43a10b){return{'id':_0x43a10b['id']};}));return MailMessage[_0xffc8('0x7')]({'where':{'MailInteractionId':_0xf49561['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x176cf1){_0xf49561['setDataValue'](_0xffc8('0x8'),_0x176cf1['length']);MailInteractionEvents[_0xffc8('0x9')](_0x639847+':'+_0xf49561['id'],_0xf49561);MailInteractionEvents['emit'](_0x639847,_0xf49561);_0x525718(null);})['catch'](_0x525718(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xffc8('0xa')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 7d44c38..590ff86 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 _0x6dad=['define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','format','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6dad,0xcf));var _0xd6da=function(_0x1a0c32,_0x38de8b){_0x1a0c32=_0x1a0c32-0x0;var _0x129e71=_0x6dad[_0x1a0c32];return _0x129e71;};'use strict';var _=require(_0xd6da('0x0'));var util=require(_0xd6da('0x1'));var logger=require(_0xd6da('0x2'))(_0xd6da('0x3'));var moment=require(_0xd6da('0x4'));var BPromise=require(_0xd6da('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6da('0x6'));var config=require(_0xd6da('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xd6da('0x8')]=function(_0x1660c2,_0x1ca8f0){return _0x1660c2[_0xd6da('0x9')](_0xd6da('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xd6da('0xb'),'fields':[_0xd6da('0xc'),'to'],'type':_0xd6da('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e1c8b,_0x200fef,_0x37225c){if(_0x4e1c8b[_0xd6da('0xe')]){_0x4e1c8b[_0xd6da('0xf')]=moment()['format'](_0xd6da('0x10'));}if(_0x4e1c8b[_0xd6da('0x11')]){_0x4e1c8b[_0xd6da('0x12')]=moment()['format'](_0xd6da('0x10'));}_0x37225c(null,_0x200fef);},'beforeUpdate':function(_0x4b1453,_0x2e2b85,_0x352113){if(_0x4b1453[_0xd6da('0x13')](_0xd6da('0xe'))){_0x4b1453[_0xd6da('0xf')]=_0x4b1453[_0xd6da('0xe')]?moment()['format'](_0xd6da('0x10')):null;}if(_0x4b1453[_0xd6da('0x13')]('closed')){_0x4b1453[_0xd6da('0x12')]=moment()[_0xd6da('0x14')](_0xd6da('0x10'));_0x4b1453[_0xd6da('0xe')]=null;_0x4b1453[_0xd6da('0xf')]=null;}_0x352113(null,_0x4b1453);},'afterUpdate':function(_0x3e6d2a,_0x5c550e,_0x3b52f4){var _0x4385e6=_0x1660c2[_0xd6da('0x15')];var _0x9fac58=_0x3e6d2a['get']({'plain':!![]});if(_0x9fac58[_0xd6da('0x11')]){return _0x4385e6[_0xd6da('0x16')][_0xd6da('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x9fac58['id']}})['then'](function(){_0x3b52f4();})[_0xd6da('0x18')](function(_0x556fdf){_0x3b52f4(_0x556fdf);});}else{_0x3b52f4();}}},'charset':_0xd6da('0x19'),'collate':_0xd6da('0x1a')});}; \ No newline at end of file +var _0xbeb6=['rimraf','../../config/environment','define','mail_interactions','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','substatusAt','get','MailMessage','update','then','catch','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x565af7,_0x189e23){var _0x224fd7=function(_0x3ab75c){while(--_0x3ab75c){_0x565af7['push'](_0x565af7['shift']());}};_0x224fd7(++_0x189e23);}(_0xbeb6,0x68));var _0x6beb=function(_0x8d737e,_0x3cf1a0){_0x8d737e=_0x8d737e-0x0;var _0x240ebf=_0xbeb6[_0x8d737e];return _0x240ebf;};'use strict';var _=require(_0x6beb('0x0'));var util=require(_0x6beb('0x1'));var logger=require(_0x6beb('0x2'))(_0x6beb('0x3'));var moment=require(_0x6beb('0x4'));var BPromise=require('bluebird');var rp=require(_0x6beb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6beb('0x6'));var config=require(_0x6beb('0x7'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x3489d5,_0x3e4bad){return _0x3489d5[_0x6beb('0x8')]('MailInteraction',attributes,{'tableName':_0x6beb('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x6beb('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x472292,_0x5b4a34,_0x5a13bc){if(_0x472292['substatus']){_0x472292['substatusAt']=moment()[_0x6beb('0xb')](_0x6beb('0xc'));}if(_0x472292[_0x6beb('0xd')]){_0x472292['closedAt']=moment()['format'](_0x6beb('0xc'));}_0x5a13bc(null,_0x5b4a34);},'beforeUpdate':function(_0x2f9dba,_0x3ebb5b,_0x4955c8){if(_0x2f9dba[_0x6beb('0xe')](_0x6beb('0xf'))){_0x2f9dba[_0x6beb('0x10')]=_0x2f9dba['substatus']?moment()[_0x6beb('0xb')](_0x6beb('0xc')):null;}if(_0x2f9dba['changed']('closed')){_0x2f9dba['closedAt']=moment()[_0x6beb('0xb')](_0x6beb('0xc'));_0x2f9dba['substatus']=null;_0x2f9dba[_0x6beb('0x10')]=null;}_0x4955c8(null,_0x2f9dba);},'afterUpdate':function(_0x10e4fe,_0x2ab9b8,_0x2ad094){var _0x3f21c2=_0x3489d5['models'];var _0x6aded1=_0x10e4fe[_0x6beb('0x11')]({'plain':!![]});if(_0x6aded1[_0x6beb('0xd')]){return _0x3f21c2[_0x6beb('0x12')][_0x6beb('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x6aded1['id']}})[_0x6beb('0x14')](function(){_0x2ad094();})[_0x6beb('0x15')](function(_0x4b654e){_0x2ad094(_0x4b654e);});}else{_0x2ad094();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index befe915..7d79f2c 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 _0xcafa=['options','raw','where','attributes','limit','stringify','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x36c39e,_0x383ba0){var _0x5307b7=function(_0x594d83){while(--_0x594d83){_0x36c39e['push'](_0x36c39e['shift']());}};_0x5307b7(++_0x383ba0);}(_0xcafa,0x8f));var _0xacaf=function(_0x5f55d1,_0x432d){_0x5f55d1=_0x5f55d1-0x0;var _0x358b0d=_0xcafa[_0x5f55d1];return _0x358b0d;};'use strict';var _=require(_0xacaf('0x0'));var util=require(_0xacaf('0x1'));var moment=require(_0xacaf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacaf('0x3'));var db=require(_0xacaf('0x4'))['db'];var utils=require(_0xacaf('0x5'));var logger=require(_0xacaf('0x6'))('rpc');var config=require(_0xacaf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacaf('0x8')][_0xacaf('0x9')]({'port':0x232a});config[_0xacaf('0xa')]=_[_0xacaf('0xb')](config[_0xacaf('0xa')],{'host':_0xacaf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacaf('0xa')]));require(_0xacaf('0xd'))[_0xacaf('0xe')](socket);function respondWithRpcPromise(_0x414444,_0x549dc8,_0x2f7abc){return new BPromise(function(_0x472b2e,_0x198be1){return client[_0xacaf('0xf')](_0x414444,_0x2f7abc)[_0xacaf('0x10')](function(_0x48ed4f){logger['info']('MailInteraction,\x20%s,\x20%s',_0x549dc8,_0xacaf('0x11'));logger[_0xacaf('0x12')](_0xacaf('0x13'),_0x549dc8,_0xacaf('0x11'),JSON['stringify'](_0x48ed4f));if(_0x48ed4f[_0xacaf('0x14')]){if(_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x15')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x549dc8,_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x16')]);return _0x198be1(_0x48ed4f['error'][_0xacaf('0x16')]);}logger[_0xacaf('0x14')](_0xacaf('0x17'),_0x549dc8,_0x48ed4f[_0xacaf('0x14')][_0xacaf('0x16')]);return _0x472b2e(_0x48ed4f[_0xacaf('0x14')]['message']);}else{logger[_0xacaf('0x18')](_0xacaf('0x17'),_0x549dc8,'request\x20sent');_0x472b2e(_0x48ed4f[_0xacaf('0x19')]['message']);}})[_0xacaf('0x1a')](function(_0x45b41b){logger[_0xacaf('0x14')](_0xacaf('0x17'),_0x549dc8,_0x45b41b);_0x198be1(_0x45b41b);});});}exports[_0xacaf('0x1b')]=function(_0x42c3ee){var _0xf8050f=this;return new Promise(function(_0x42e3b7,_0x3ed37f){return db[_0xacaf('0x1c')]['update'](_0x42c3ee['body'],{'raw':_0x42c3ee['options']?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x1f')]||null:null,'attributes':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x20')]||null:null,'limit':_0x42c3ee[_0xacaf('0x1d')]?_0x42c3ee[_0xacaf('0x1d')][_0xacaf('0x21')]||null:null})[_0xacaf('0x10')](function(_0x5e0d90){logger[_0xacaf('0x18')](_0xacaf('0x1b'),_0x42c3ee);logger['debug'](_0xacaf('0x1b'),_0x42c3ee,JSON[_0xacaf('0x22')](_0x5e0d90));_0x42e3b7(_0x5e0d90);})['catch'](function(_0x32a68a){logger[_0xacaf('0x14')](_0xacaf('0x1b'),_0x32a68a[_0xacaf('0x16')],_0x42c3ee);_0x3ed37f(_0xf8050f[_0xacaf('0x14')](0x1f4,_0x32a68a[_0xacaf('0x16')]));});});};exports[_0xacaf('0x23')]=function(_0x53c182){return new Promise(function(_0x2507f4,_0x493025){return db[_0xacaf('0x1c')][_0xacaf('0x24')]({'where':_0x53c182[_0xacaf('0x1d')]?_0x53c182['options'][_0xacaf('0x1f')]||null:null})[_0xacaf('0x10')](function(_0x371fed){if(_0x371fed){return _0x371fed[_0xacaf('0x25')](_0x53c182[_0xacaf('0x26')][_0xacaf('0x27')],_[_0xacaf('0x28')](_0x53c182[_0xacaf('0x26')],[_0xacaf('0x27'),'id'])||{});}})[_0xacaf('0x29')](function(_0x11d665){logger[_0xacaf('0x18')](_0xacaf('0x2a'),_0x53c182);logger[_0xacaf('0x12')](_0xacaf('0x2a'),_0x53c182,JSON[_0xacaf('0x22')](_0x11d665));_0x2507f4(_0x11d665);})[_0xacaf('0x1a')](function(_0x37da4c){logger['error'](_0xacaf('0x2a'),_0x37da4c[_0xacaf('0x16')],_0x53c182);_0x493025(_this[_0xacaf('0x14')](0x1f4,_0x37da4c[_0xacaf('0x16')]));});});}; \ No newline at end of file +var _0x3dec=['code','message','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','then','AddTagsToMailInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3fa531,_0x4c65cb){var _0x2510bb=function(_0x5a871f){while(--_0x5a871f){_0x3fa531['push'](_0x3fa531['shift']());}};_0x2510bb(++_0x4c65cb);}(_0x3dec,0x8e));var _0xc3de=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x3dec[_0x51e79c];return _0x2467be;};'use strict';var _=require(_0xc3de('0x0'));var util=require(_0xc3de('0x1'));var moment=require(_0xc3de('0x2'));var BPromise=require(_0xc3de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3de('0x4'))['db'];var utils=require(_0xc3de('0x5'));var logger=require('../../config/logger')(_0xc3de('0x6'));var config=require(_0xc3de('0x7'));var jayson=require(_0xc3de('0x8'));var client=jayson[_0xc3de('0x9')]['http']({'port':0x232a});config[_0xc3de('0xa')]=_[_0xc3de('0xb')](config[_0xc3de('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc3de('0xc'))(new Redis(config[_0xc3de('0xa')]));require(_0xc3de('0xd'))[_0xc3de('0xe')](socket);function respondWithRpcPromise(_0x2588b8,_0x107c90,_0xa0af11){return new BPromise(function(_0x34a8e9,_0x3adec8){return client['request'](_0x2588b8,_0xa0af11)['then'](function(_0x251326){logger[_0xc3de('0xf')](_0xc3de('0x10'),_0x107c90,_0xc3de('0x11'));logger[_0xc3de('0x12')](_0xc3de('0x13'),_0x107c90,_0xc3de('0x11'),JSON[_0xc3de('0x14')](_0x251326));if(_0x251326[_0xc3de('0x15')]){if(_0x251326[_0xc3de('0x15')][_0xc3de('0x16')]===0x1f4){logger['error'](_0xc3de('0x10'),_0x107c90,_0x251326['error'][_0xc3de('0x17')]);return _0x3adec8(_0x251326[_0xc3de('0x15')]['message']);}logger[_0xc3de('0x15')](_0xc3de('0x10'),_0x107c90,_0x251326[_0xc3de('0x15')][_0xc3de('0x17')]);return _0x34a8e9(_0x251326[_0xc3de('0x15')][_0xc3de('0x17')]);}else{logger[_0xc3de('0xf')](_0xc3de('0x10'),_0x107c90,'request\x20sent');_0x34a8e9(_0x251326['result'][_0xc3de('0x17')]);}})[_0xc3de('0x18')](function(_0x45699c){logger[_0xc3de('0x15')](_0xc3de('0x10'),_0x107c90,_0x45699c);_0x3adec8(_0x45699c);});});}exports[_0xc3de('0x19')]=function(_0x2ebfd9){var _0x2a2d05=this;return new Promise(function(_0x18f5d4,_0xc0fae8){return db[_0xc3de('0x1a')][_0xc3de('0x1b')](_0x2ebfd9['body'],{'raw':_0x2ebfd9[_0xc3de('0x1c')]?_0x2ebfd9[_0xc3de('0x1c')][_0xc3de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ebfd9[_0xc3de('0x1c')]?_0x2ebfd9[_0xc3de('0x1c')][_0xc3de('0x1e')]||null:null,'attributes':_0x2ebfd9[_0xc3de('0x1c')]?_0x2ebfd9[_0xc3de('0x1c')][_0xc3de('0x1f')]||null:null,'limit':_0x2ebfd9[_0xc3de('0x1c')]?_0x2ebfd9[_0xc3de('0x1c')][_0xc3de('0x20')]||null:null})[_0xc3de('0x21')](function(_0x7abed0){logger[_0xc3de('0xf')](_0xc3de('0x19'),_0x2ebfd9);logger[_0xc3de('0x12')](_0xc3de('0x19'),_0x2ebfd9,JSON[_0xc3de('0x14')](_0x7abed0));_0x18f5d4(_0x7abed0);})[_0xc3de('0x18')](function(_0x3b11ce){logger[_0xc3de('0x15')]('UpdateMailInteraction',_0x3b11ce[_0xc3de('0x17')],_0x2ebfd9);_0xc0fae8(_0x2a2d05[_0xc3de('0x15')](0x1f4,_0x3b11ce['message']));});});};exports[_0xc3de('0x22')]=function(_0x579b56){return new Promise(function(_0x2f89b8,_0x5ece11){return db[_0xc3de('0x1a')]['find']({'where':_0x579b56[_0xc3de('0x1c')]?_0x579b56[_0xc3de('0x1c')][_0xc3de('0x1e')]||null:null})[_0xc3de('0x21')](function(_0x12ba58){if(_0x12ba58){return _0x12ba58[_0xc3de('0x23')](_0x579b56[_0xc3de('0x24')][_0xc3de('0x25')],_[_0xc3de('0x26')](_0x579b56['body'],['ids','id'])||{});}})[_0xc3de('0x27')](function(_0x262bf8){logger[_0xc3de('0xf')](_0xc3de('0x28'),_0x579b56);logger[_0xc3de('0x12')](_0xc3de('0x28'),_0x579b56,JSON[_0xc3de('0x14')](_0x262bf8));_0x2f89b8(_0x262bf8);})[_0xc3de('0x18')](function(_0x539eb9){logger[_0xc3de('0x15')](_0xc3de('0x28'),_0x539eb9[_0xc3de('0x17')],_0x579b56);_0x5ece11(_this[_0xc3de('0x15')](0x1f4,_0x539eb9[_0xc3de('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d462ae3..442bd34 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 _0xffa1=['register','length','mailInteraction:','./mailInteraction.events','remove','update','removeListener'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0xffa1,0x18b));var _0x1ffa=function(_0x34c241,_0x5df182){_0x34c241=_0x34c241-0x0;var _0x54907c=_0xffa1[_0x34c241];return _0x54907c;};'use strict';var MailInteractionEvents=require(_0x1ffa('0x0'));var events=['save',_0x1ffa('0x1'),_0x1ffa('0x2')];function createListener(_0x5ac242,_0xc9d2cf){return function(_0x1fe0d1){_0xc9d2cf['emit'](_0x5ac242,_0x1fe0d1);};}function removeListener(_0x428762,_0x547fc4){return function(){MailInteractionEvents[_0x1ffa('0x3')](_0x428762,_0x547fc4);};}exports[_0x1ffa('0x4')]=function(_0x57f171){for(var _0x33050c=0x0,_0x474e4c=events[_0x1ffa('0x5')];_0x33050c<_0x474e4c;_0x33050c++){var _0x69fcaa=events[_0x33050c];var _0x497cbd=createListener(_0x1ffa('0x6')+_0x69fcaa,_0x57f171);MailInteractionEvents['on'](_0x69fcaa,_0x497cbd);}}; \ No newline at end of file +var _0x8f26=['length','mailInteraction:','./mailInteraction.events','remove','emit','register'];(function(_0x11de69,_0x46c7c6){var _0x211379=function(_0x58c8dd){while(--_0x58c8dd){_0x11de69['push'](_0x11de69['shift']());}};_0x211379(++_0x46c7c6);}(_0x8f26,0x92));var _0x68f2=function(_0x4f6009,_0x292385){_0x4f6009=_0x4f6009-0x0;var _0x391fdd=_0x8f26[_0x4f6009];return _0x391fdd;};'use strict';var MailInteractionEvents=require(_0x68f2('0x0'));var events=['save',_0x68f2('0x1'),'update'];function createListener(_0x55bbb7,_0x5d6240){return function(_0x2c3e7d){_0x5d6240[_0x68f2('0x2')](_0x55bbb7,_0x2c3e7d);};}function removeListener(_0x31a94d,_0x57a875){return function(){MailInteractionEvents['removeListener'](_0x31a94d,_0x57a875);};}exports[_0x68f2('0x3')]=function(_0x3975b1){for(var _0x642cc6=0x0,_0x3cf873=events[_0x68f2('0x4')];_0x642cc6<_0x3cf873;_0x642cc6++){var _0xf83ded=events[_0x642cc6];var _0x1f3d05=createListener(_0x68f2('0x5')+_0xf83ded,_0x3975b1);MailInteractionEvents['on'](_0xf83ded,_0x1f3d05);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 9dc6105..5961e67 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 _0xb248=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','isAuthenticated','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','multer','path'];(function(_0x58fd81,_0x59a714){var _0x19d75c=function(_0x3bbdea){while(--_0x3bbdea){_0x58fd81['push'](_0x58fd81['shift']());}};_0x19d75c(++_0x59a714);}(_0xb248,0xc6));var _0x8b24=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xb248[_0x543084];return _0x306a57;};'use strict';var multer=require(_0x8b24('0x0'));var util=require('util');var path=require(_0x8b24('0x1'));var timeout=require(_0x8b24('0x2'));var express=require(_0x8b24('0x3'));var router=express[_0x8b24('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b24('0x5'));var interaction=require(_0x8b24('0x6'));var config=require('../../config/environment');var controller=require(_0x8b24('0x7'));router[_0x8b24('0x8')]('/',auth['isAuthenticated'](),controller[_0x8b24('0x9')]);router[_0x8b24('0x8')]('/describe',auth[_0x8b24('0xa')](),controller['describe']);router[_0x8b24('0x8')](_0x8b24('0xb'),auth[_0x8b24('0xa')](),controller['show']);router[_0x8b24('0x8')](_0x8b24('0xc'),auth[_0x8b24('0xa')](),controller[_0x8b24('0xd')]);router[_0x8b24('0xe')]('/',auth[_0x8b24('0xa')](),interaction[_0x8b24('0xf')](_0x8b24('0x10'),_0x8b24('0x11')),controller[_0x8b24('0x12')]);router[_0x8b24('0x13')](_0x8b24('0xb'),auth[_0x8b24('0xa')](),controller[_0x8b24('0x14')]);router['put']('/:id/accept',auth[_0x8b24('0xa')](),controller[_0x8b24('0x15')]);router[_0x8b24('0x13')](_0x8b24('0x16'),auth[_0x8b24('0xa')](),controller[_0x8b24('0x17')]);router[_0x8b24('0x18')](_0x8b24('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb9a7=['mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0x3ab5da,_0x3c1540){var _0x5b5032=function(_0x2ec232){while(--_0x2ec232){_0x3ab5da['push'](_0x3ab5da['shift']());}};_0x5b5032(++_0x3c1540);}(_0xb9a7,0x112));var _0x7b9a=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb9a7[_0x35885a];return _0xe86249;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('mail',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 9317b4f..b1e4353 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 _0xaf30=['sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email'];(function(_0x1aa074,_0x1315f6){var _0x5727ce=function(_0xf6bf8a){while(--_0xf6bf8a){_0x1aa074['push'](_0x1aa074['shift']());}};_0x5727ce(++_0x1315f6);}(_0xaf30,0x16c));var _0x0af3=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0xaf30[_0x999b85];return _0x1d7124;};'use strict';var Sequelize=require(_0x0af3('0x0'));var _=require(_0x0af3('0x1'));module[_0x0af3('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x4'))},'read':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0af3('0x6')]('in',_0x0af3('0x7')),'defaultValue':_0x0af3('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0af3('0x8')](0x1fe)},'from':{'type':Sequelize[_0x0af3('0x8')]},'to':{'type':Sequelize[_0x0af3('0x3')]('long')},'cc':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'bcc':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x0af3('0xa')]},'attach':{'type':Sequelize[_0x0af3('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0af3('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0af3('0xa')]},'originTo':{'type':Sequelize[_0x0af3('0x3')](_0x0af3('0x9'))},'originCc':{'type':Sequelize['TEXT'](_0x0af3('0x9'))},'originChannel':{'type':Sequelize[_0x0af3('0x6')]('Email','Chat'),'defaultValue':_0x0af3('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0x69d4=['out','STRING','DATE','Email','sequelize','long','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x69d4,0x86));var _0x469d=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x69d4[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require(_0x469d('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0x469d('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x469d('0x2')](_0x469d('0x3'))},'read':{'type':Sequelize[_0x469d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x469d('0x5')]('in',_0x469d('0x6')),'defaultValue':_0x469d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x469d('0x7')](0x1fe)},'from':{'type':Sequelize[_0x469d('0x7')]},'to':{'type':Sequelize[_0x469d('0x2')](_0x469d('0x1'))},'cc':{'type':Sequelize[_0x469d('0x2')](_0x469d('0x1'))},'bcc':{'type':Sequelize[_0x469d('0x2')]('long')},'subject':{'type':Sequelize[_0x469d('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x469d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x469d('0x8')]},'originTo':{'type':Sequelize['TEXT'](_0x469d('0x1'))},'originCc':{'type':Sequelize[_0x469d('0x2')](_0x469d('0x1'))},'originChannel':{'type':Sequelize['ENUM'](_0x469d('0x9'),'Chat'),'defaultValue':_0x469d('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index ef53310..4e6c0e9 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 _0xf3a6=['existsSync','push','readFileSync','unlinkSync','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','client','http','then','MailMessage,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','json','undefined','limit','count','offset','status','destroy','end','sendStatus','name','send','map','MailMessage','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','show','params','keys','length','find','update','body','describe','create','secret','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteraction','role','rejectMessage','contact','email','internal','reject','rejectmessage','download','unix','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments'];(function(_0xda40ff,_0x2e30cb){var _0x35b3e0=function(_0x26b379){while(--_0x26b379){_0xda40ff['push'](_0xda40ff['shift']());}};_0x35b3e0(++_0x2e30cb);}(_0xf3a6,0x132));var _0x6f3a=function(_0x1a697e,_0x130466){_0x1a697e=_0x1a697e-0x0;var _0x40e871=_0xf3a6[_0x1a697e];return _0x40e871;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x6f3a('0x0'));var util=require(_0x6f3a('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x6f3a('0x2'));var Redis=require(_0x6f3a('0x3'));var htmlToText=require(_0x6f3a('0x4'));var qs=require(_0x6f3a('0x5'));var logger=require(_0x6f3a('0x6'))(_0x6f3a('0x7'));var interaction_log=require(_0x6f3a('0x6'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x6f3a('0x8'))['db'];config[_0x6f3a('0x9')]=_[_0x6f3a('0xa')](config[_0x6f3a('0x9')],{'host':_0x6f3a('0xb'),'port':0x18eb});var socket=require(_0x6f3a('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0x6f3a('0xd'));require('./mailMessage.socket')[_0x6f3a('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232c});var client9003=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232b});var client9002=jayson[_0x6f3a('0xf')][_0x6f3a('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x1338f1,_0x476d2f,_0x9f19cb,_0x992e85){return new BPromise(function(_0x213e3c,_0x499b06){var _0x4e1fd4=_0x992e85||client;return _0x4e1fd4['request'](_0x1338f1,_0x9f19cb)[_0x6f3a('0x11')](function(_0x36b918){logger['info'](_0x6f3a('0x12'),_0x476d2f,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x476d2f,'request\x20sent',JSON['stringify'](_0x36b918));if(_0x36b918[_0x6f3a('0x13')]){if(_0x36b918[_0x6f3a('0x13')][_0x6f3a('0x14')]===0x1f4){logger[_0x6f3a('0x13')](_0x6f3a('0x12'),_0x476d2f,_0x36b918['error'][_0x6f3a('0x15')]);return _0x499b06(_0x36b918['error'][_0x6f3a('0x15')]);}logger[_0x6f3a('0x13')](_0x6f3a('0x12'),_0x476d2f,_0x36b918['error'][_0x6f3a('0x15')]);return _0x213e3c(_0x36b918['error'][_0x6f3a('0x15')]);}else{logger[_0x6f3a('0x16')]('MailMessage,\x20%s,\x20%s',_0x476d2f,_0x6f3a('0x17'));_0x213e3c(_0x36b918[_0x6f3a('0x18')][_0x6f3a('0x15')]);}})[_0x6f3a('0x19')](function(_0x2ab985){logger['error']('MailMessage,\x20%s,\x20%s',_0x476d2f,_0x2ab985);_0x499b06(_0x2ab985);});});}function respondWithResult(_0x37df28,_0x1012f7){_0x1012f7=_0x1012f7||0xc8;return function(_0x2b21cc){if(_0x2b21cc){return _0x37df28['status'](_0x1012f7)[_0x6f3a('0x1a')](_0x2b21cc);}};}function respondWithFilteredResult(_0x52d397,_0x3f0b2e){return function(_0x298612){if(_0x298612){var _0x194770=typeof _0x3f0b2e['offset']===_0x6f3a('0x1b')&&typeof _0x3f0b2e[_0x6f3a('0x1c')]===_0x6f3a('0x1b');var _0x4fe8c8=_0x298612[_0x6f3a('0x1d')];var _0x1ec4c5=_0x194770?0x0:_0x3f0b2e['offset'];var _0x572724=_0x194770?_0x298612[_0x6f3a('0x1d')]:_0x3f0b2e[_0x6f3a('0x1e')]+_0x3f0b2e[_0x6f3a('0x1c')];var _0x2cb58a;if(_0x572724>=_0x4fe8c8){_0x572724=_0x4fe8c8;_0x2cb58a=0xc8;}else{_0x2cb58a=0xce;}_0x52d397[_0x6f3a('0x1f')](_0x2cb58a);return _0x52d397['set']('Content-Range',_0x1ec4c5+'-'+_0x572724+'/'+_0x4fe8c8)[_0x6f3a('0x1a')](_0x298612);}return null;};}function saveUpdates(_0x8986bb){return function(_0x19cb36){if(_0x19cb36){return _0x19cb36['update'](_0x8986bb)[_0x6f3a('0x11')](function(_0x1ae544){return _0x1ae544;});}return null;};}function removeEntity(_0x5ce90e){return function(_0x514d2f){if(_0x514d2f){return _0x514d2f[_0x6f3a('0x20')]()[_0x6f3a('0x11')](function(){_0x5ce90e['status'](0xcc)[_0x6f3a('0x21')]();});}};}function handleEntityNotFound(_0x55917d){return function(_0x198842){if(!_0x198842){_0x55917d[_0x6f3a('0x22')](0x194);}return _0x198842;};}function handleError(_0x1e8739,_0x1cd540){_0x1cd540=_0x1cd540||0x1f4;return function(_0x98ad41){logger[_0x6f3a('0x13')](_0x98ad41['stack']);if(_0x98ad41[_0x6f3a('0x23')]){delete _0x98ad41[_0x6f3a('0x23')];}_0x1e8739[_0x6f3a('0x1f')](_0x1cd540)[_0x6f3a('0x24')](_0x98ad41);};}exports['index']=function(_0x43b28b,_0x38be61){var _0x95569e={},_0x113be8={},_0x217bc6={'count':0x0,'rows':[]};var _0x187b7e=_[_0x6f3a('0x25')](db[_0x6f3a('0x26')][_0x6f3a('0x27')],function(_0x1d958b){return{'name':_0x1d958b[_0x6f3a('0x28')],'type':_0x1d958b['type'][_0x6f3a('0x29')]};});_0x113be8['model']=_[_0x6f3a('0x25')](_0x187b7e,_0x6f3a('0x23'));_0x113be8[_0x6f3a('0x2a')]=_['keys'](_0x43b28b[_0x6f3a('0x2a')]);_0x113be8[_0x6f3a('0x2b')]=_[_0x6f3a('0x2c')](_0x113be8[_0x6f3a('0x2d')],_0x113be8[_0x6f3a('0x2a')]);_0x95569e[_0x6f3a('0x2e')]=_[_0x6f3a('0x2c')](_0x113be8['model'],qs['fields'](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x2f')]));_0x95569e['attributes']=_0x95569e[_0x6f3a('0x2e')]['length']?_0x95569e[_0x6f3a('0x2e')]:_0x113be8[_0x6f3a('0x2d')];if(!_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x30')](_0x6f3a('0x31'))){_0x95569e[_0x6f3a('0x1c')]=qs[_0x6f3a('0x1c')](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x1c')]);_0x95569e[_0x6f3a('0x1e')]=qs[_0x6f3a('0x1e')](_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x1e')]);}_0x95569e['order']=qs[_0x6f3a('0x32')](_0x43b28b[_0x6f3a('0x2a')]['sort']);_0x95569e[_0x6f3a('0x33')]=qs[_0x6f3a('0x2b')](_[_0x6f3a('0x34')](_0x43b28b[_0x6f3a('0x2a')],_0x113be8['filters']),_0x187b7e);if(_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x35')]){_0x95569e[_0x6f3a('0x33')]=_['merge'](_0x95569e['where'],{'$or':_[_0x6f3a('0x25')](_0x187b7e,function(_0x28c82d){if(_0x28c82d[_0x6f3a('0x36')]!=='VIRTUAL'){var _0x52f345={};_0x52f345[_0x28c82d['name']]={'$like':'%'+_0x43b28b[_0x6f3a('0x2a')][_0x6f3a('0x35')]+'%'};return _0x52f345;}})});}_0x95569e=_[_0x6f3a('0x37')]({},_0x95569e,_0x43b28b[_0x6f3a('0x38')]);var _0x541ab4={'where':_0x95569e[_0x6f3a('0x33')]};return db[_0x6f3a('0x26')][_0x6f3a('0x1d')](_0x541ab4)[_0x6f3a('0x11')](function(_0x47298a){_0x217bc6[_0x6f3a('0x1d')]=_0x47298a;if(_0x43b28b['query'][_0x6f3a('0x39')]){_0x95569e[_0x6f3a('0x3a')]=[{'all':!![]}];}return db[_0x6f3a('0x26')][_0x6f3a('0x3b')](_0x95569e);})[_0x6f3a('0x11')](function(_0x3e6071){_0x217bc6['rows']=_0x3e6071;return _0x217bc6;})['then'](respondWithFilteredResult(_0x38be61,_0x95569e))[_0x6f3a('0x19')](handleError(_0x38be61,null));};exports[_0x6f3a('0x3c')]=function(_0x42129a,_0x1b4592){var _0x57774f={'raw':!![],'where':{'id':_0x42129a[_0x6f3a('0x3d')]['id']}},_0x5db3cd={};_0x5db3cd['model']=_[_0x6f3a('0x3e')](db[_0x6f3a('0x26')][_0x6f3a('0x27')]);_0x5db3cd[_0x6f3a('0x2a')]=_['keys'](_0x42129a['query']);_0x5db3cd[_0x6f3a('0x2b')]=_[_0x6f3a('0x2c')](_0x5db3cd['model'],_0x5db3cd[_0x6f3a('0x2a')]);_0x57774f[_0x6f3a('0x2e')]=_[_0x6f3a('0x2c')](_0x5db3cd['model'],qs[_0x6f3a('0x2f')](_0x42129a[_0x6f3a('0x2a')]['fields']));_0x57774f[_0x6f3a('0x2e')]=_0x57774f['attributes'][_0x6f3a('0x3f')]?_0x57774f[_0x6f3a('0x2e')]:_0x5db3cd['model'];if(_0x42129a['query'][_0x6f3a('0x39')]){_0x57774f['include']=[{'all':!![]}];}_0x57774f=_[_0x6f3a('0x37')]({},_0x57774f,_0x42129a['options']);return db[_0x6f3a('0x26')][_0x6f3a('0x40')](_0x57774f)[_0x6f3a('0x11')](handleEntityNotFound(_0x1b4592,null))[_0x6f3a('0x11')](respondWithResult(_0x1b4592,null))[_0x6f3a('0x19')](handleError(_0x1b4592,null));};exports[_0x6f3a('0x41')]=function(_0x2ac379,_0x2580bb){if(_0x2ac379[_0x6f3a('0x42')]['id']){delete _0x2ac379[_0x6f3a('0x42')]['id'];}return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x2ac379[_0x6f3a('0x3d')]['id']}})[_0x6f3a('0x11')](handleEntityNotFound(_0x2580bb,null))[_0x6f3a('0x11')](saveUpdates(_0x2ac379[_0x6f3a('0x42')],null))['then'](respondWithResult(_0x2580bb,null))[_0x6f3a('0x19')](handleError(_0x2580bb,null));};exports[_0x6f3a('0x20')]=function(_0x5216ca,_0x35774c){return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x5216ca[_0x6f3a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35774c,null))[_0x6f3a('0x11')](removeEntity(_0x35774c,null))[_0x6f3a('0x19')](handleError(_0x35774c,null));};exports[_0x6f3a('0x43')]=function(_0x18aeec,_0x4ad6b2){return db[_0x6f3a('0x26')][_0x6f3a('0x43')]()[_0x6f3a('0x11')](respondWithResult(_0x4ad6b2,null))[_0x6f3a('0x19')](handleError(_0x4ad6b2,null));};exports[_0x6f3a('0x44')]=function(_0x47027a,_0x199f5b){return db['MailMessage'][_0x6f3a('0x44')](_0x47027a[_0x6f3a('0x42')])[_0x6f3a('0x11')](function(_0x4e769f){if(_0x4e769f){if(_0x4e769f['direction']==='out'&&!_0x4e769f[_0x6f3a('0x45')]){var _0x1d726e,_0x4e5371,_0x2293f1;if(_0x47027a[_0x6f3a('0x42')]['to']){_0x4e5371=_0x47027a['body']['to']['split'](',')[0x0];}return db[_0x6f3a('0x46')]['findOne']({'where':{'id':_0x4e769f[_0x6f3a('0x47')]},'include':[{'model':db[_0x6f3a('0x48')],'as':'List','include':[{'model':db[_0x6f3a('0x49')],'as':_0x6f3a('0x4a'),'where':{'email':_0x4e5371},'limit':0x1,'order':[[_0x6f3a('0x4b'),_0x6f3a('0x4c')]]}]},{'model':db['MailServerOut'],'as':_0x6f3a('0x4d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6f3a('0x4e'),'raw':!![]}]}]})[_0x6f3a('0x11')](function(_0x3a49a8){_0x1d726e=_0x3a49a8;if(!_0x1d726e||!_0x1d726e[_0x6f3a('0x4d')])return;var _0x176341=_0x1d726e['getSmtpOptions']();if(_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')]&&_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')]['length']){for(var _0x135a0f=0x0;_0x135a0f<_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x6f3a('0x3f')];_0x135a0f+=0x1){_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x135a0f]={'filename':_0x47027a['body'][_0x6f3a('0x4f')][_0x135a0f]['name'],'path':path[_0x6f3a('0x50')](config[_0x6f3a('0x51')],_0x6f3a('0x52'),_0x47027a[_0x6f3a('0x42')][_0x6f3a('0x4f')][_0x135a0f][_0x6f3a('0x53')])};}}_0x2293f1={'account':_0x176341,'message':_0x47027a[_0x6f3a('0x42')]};return;})['then'](function(){if(_0x1d726e[_0x6f3a('0x54')]){if(_0x1d726e['List']['Contacts']['length']){return _0x1d726e[_0x6f3a('0x54')][_0x6f3a('0x4a')][0x0];}else{return db[_0x6f3a('0x49')]['create'](_[_0x6f3a('0xa')](_0x47027a[_0x6f3a('0x42')],{'firstName':_0x47027a[_0x6f3a('0x42')]['to'],'email':_0x47027a['body']['to'],'phone':_0x47027a[_0x6f3a('0x42')]['to'],'ListId':_0x1d726e[_0x6f3a('0x55')]}));}}else{throw new Error(_0x6f3a('0x56'));}})[_0x6f3a('0x11')](function(){if(_0x2293f1){return respondWithRpcPromise(_0x6f3a('0x57'),_0x6f3a('0x58'),_0x2293f1,client9003)[_0x6f3a('0x11')](function(_0x1bbb14){return _0x4e769f[_0x6f3a('0x41')]({'read':!![],'messageId':_0x1bbb14[_0x6f3a('0x59')],'sentAt':moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b'))});})[_0x6f3a('0x19')](function(_0x3b99d6){logger[_0x6f3a('0x13')]('%s',JSON['stringify'](_0x3b99d6));return _0x4e769f;});}return _0x4e769f;});}return _0x4e769f;}})[_0x6f3a('0x11')](respondWithResult(_0x199f5b,0xc9))['catch'](handleError(_0x199f5b,null));};exports['accept']=function(_0x546770,_0x71f444){var _0x5bdffb={'agent':{},'channel':_0x6f3a('0x5c')};if(_0x546770[_0x6f3a('0x42')]['id']){delete _0x546770[_0x6f3a('0x42')]['id'];}_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5d')]=!![];_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5e')]=moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b'));_0x546770[_0x6f3a('0x42')][_0x6f3a('0x5f')]=_0x546770['body'][_0x6f3a('0x5f')]||_0x546770[_0x6f3a('0x60')]['id'];_0x5bdffb[_0x6f3a('0x61')]['id']=_0x546770['body'][_0x6f3a('0x5f')];return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x546770[_0x6f3a('0x3d')]['id'],'UserId':null}})[_0x6f3a('0x11')](handleEntityNotFound(_0x71f444,null))['then'](saveUpdates(_0x546770[_0x6f3a('0x42')],null))[_0x6f3a('0x11')](function(_0x144bb0){if(_0x144bb0){_0x5bdffb[_0x6f3a('0x15')]=_0x144bb0[_0x6f3a('0x62')]({'plain':!![]});return db['MailInteraction'][_0x6f3a('0x40')]({'where':{'id':_0x144bb0[_0x6f3a('0x63')]}});}return null;})[_0x6f3a('0x11')](handleEntityNotFound(_0x71f444,null))[_0x6f3a('0x11')](function(_0x487dae){if(_0x487dae){return _0x487dae['update']({'UserId':_0x546770['body'][_0x6f3a('0x5f')],'read1stAt':_[_0x6f3a('0x64')](_0x487dae[_0x6f3a('0x65')])?moment()[_0x6f3a('0x5a')](_0x6f3a('0x5b')):undefined});}return null;})['then'](function(_0x17ec6e){if(_0x17ec6e){_0x5bdffb[_0x6f3a('0x66')]=_0x17ec6e[_0x6f3a('0x62')]({'plain':!![]});interaction_log[_0x6f3a('0x16')](_0x6f3a('0x67'),_0x546770[_0x6f3a('0x60')]['id'],_0x546770['user'][_0x6f3a('0x23')],_0x546770['user']['role'],_0x5bdffb['interaction']['id'],_0x546770[_0x6f3a('0x42')]?JSON[_0x6f3a('0x68')](_0x546770[_0x6f3a('0x42')]):_0x6f3a('0x69'));return respondWithRpcPromise(_0x6f3a('0x6a'),'acceptMessage',_0x5bdffb);}return null;})[_0x6f3a('0x11')](function(_0x5c93e9){var _0x237c78='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c93e9[_0x6f3a('0x15')][_0x6f3a('0x6b')];return db[_0x6f3a('0x6c')][_0x6f3a('0x2a')](_0x237c78,{'type':db[_0x6f3a('0x6d')][_0x6f3a('0x6e')][_0x6f3a('0x6f')],'raw':!![]})['then'](function(_0x32c48b){return _0x32c48b;});})[_0x6f3a('0x11')](function(_0x369be1){if(_0x369be1){_0x5bdffb[_0x6f3a('0x15')]['contact']=_0x369be1[0x0];if(!_0x546770[_0x6f3a('0x42')]['UserId'])return;return db[_0x6f3a('0x70')][_0x6f3a('0x40')]({'where':{'id':_0x546770['body'][_0x6f3a('0x5f')],'role':_0x6f3a('0x61')},'attributes':['id','name',_0x6f3a('0x71'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x2670ee){if(!_0x2670ee)return null;_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x61')]=_0x2670ee;return _0x5bdffb;})[_0x6f3a('0x11')](function(_0x8cee96){if(_0x8cee96){if(_0x546770[_0x6f3a('0x42')][_0x6f3a('0x72')]){_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x73')]=util['format'](_0x6f3a('0x74'),_0x546770['user'][_0x6f3a('0x23')]);_0x5bdffb['message']['channel']=_0x5bdffb[_0x6f3a('0x75')];_0x5bdffb['message'][_0x6f3a('0x76')]=_0x5bdffb[_0x6f3a('0x75')];_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x77')]='accept';_0x5bdffb[_0x6f3a('0x15')][_0x6f3a('0x42')]=htmlToText[_0x6f3a('0x78')](_0x5bdffb[_0x6f3a('0x15')]['body']);return respondWithRpcPromise(_0x6f3a('0x79'),'EventManager',{'event':_0x6f3a('0x7a'),'message':_0x5bdffb['message']},client9002)[_0x6f3a('0x11')](function(){return _0x5bdffb;});}return _0x5bdffb;}return null;})[_0x6f3a('0x11')](respondWithResult(_0x71f444,null))[_0x6f3a('0x19')](handleError(_0x71f444,null));};exports['reject']=function(_0x29687c,_0x553846){var _0x2f67d7={'agent':{},'channel':_0x6f3a('0x5c')};if(_0x29687c[_0x6f3a('0x42')]['id']){delete _0x29687c['body']['id'];}_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')]=_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')]||_0x29687c[_0x6f3a('0x60')]['id'];_0x2f67d7['agent']['id']=_0x29687c[_0x6f3a('0x42')]['UserId'];return db[_0x6f3a('0x26')][_0x6f3a('0x40')]({'where':{'id':_0x29687c[_0x6f3a('0x3d')]['id'],'UserId':null}})[_0x6f3a('0x11')](handleEntityNotFound(_0x553846,null))['then'](function(_0x50d9d6){if(_0x50d9d6){_0x2f67d7[_0x6f3a('0x15')]=_0x50d9d6[_0x6f3a('0x62')]({'plain':!![]});return db[_0x6f3a('0x7b')][_0x6f3a('0x40')]({'where':{'id':_0x50d9d6[_0x6f3a('0x63')]}});}return null;})[_0x6f3a('0x11')](handleEntityNotFound(_0x553846,null))[_0x6f3a('0x11')](function(_0x4f51c0){if(_0x4f51c0){_0x2f67d7[_0x6f3a('0x66')]=_0x4f51c0[_0x6f3a('0x62')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29687c['user']['id'],_0x29687c[_0x6f3a('0x60')][_0x6f3a('0x23')],_0x29687c[_0x6f3a('0x60')][_0x6f3a('0x7c')],_0x2f67d7[_0x6f3a('0x66')]['id'],_0x29687c['body']?JSON[_0x6f3a('0x68')](_0x29687c[_0x6f3a('0x42')]):'null');return respondWithRpcPromise('RejectMessage',_0x6f3a('0x7d'),_0x2f67d7);}return null;})[_0x6f3a('0x11')](function(_0x21fc55){var _0x31ea4a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x21fc55[_0x6f3a('0x15')]['ContactId'];return db[_0x6f3a('0x6c')][_0x6f3a('0x2a')](_0x31ea4a,{'type':db[_0x6f3a('0x6d')]['QueryTypes'][_0x6f3a('0x6f')],'raw':!![]})[_0x6f3a('0x11')](function(_0x2249dc){return _0x2249dc;});})[_0x6f3a('0x11')](function(_0x195437){if(_0x195437){_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x7e')]=_0x195437[0x0];if(!_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')])return;return db[_0x6f3a('0x70')]['find']({'where':{'id':_0x29687c[_0x6f3a('0x42')][_0x6f3a('0x5f')],'role':_0x6f3a('0x61')},'attributes':['id',_0x6f3a('0x23'),'fullname',_0x6f3a('0x7f'),_0x6f3a('0x80')],'raw':!![]});}return null;})[_0x6f3a('0x11')](function(_0x36a406){if(!_0x36a406)return null;_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x61')]=_0x36a406;return _0x2f67d7;})[_0x6f3a('0x11')](function(_0x521bf3){if(_0x521bf3){_0x521bf3['message']['interface']=util[_0x6f3a('0x5a')]('SIP/%s',_0x29687c['user'][_0x6f3a('0x23')]);_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x75')]=_0x2f67d7[_0x6f3a('0x75')];_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x76')]=_0x2f67d7['channel'];_0x521bf3[_0x6f3a('0x15')][_0x6f3a('0x77')]=_0x6f3a('0x81');_0x521bf3[_0x6f3a('0x15')]['body']=htmlToText[_0x6f3a('0x78')](_0x2f67d7[_0x6f3a('0x15')][_0x6f3a('0x42')]);respondWithRpcPromise('EventManager',_0x6f3a('0x79'),{'event':_0x6f3a('0x82'),'message':_0x521bf3[_0x6f3a('0x15')]},client9002);return _0x2f67d7;}return null;})['then'](respondWithResult(_0x553846,null))['catch'](handleError(_0x553846,null));};exports[_0x6f3a('0x83')]=function(_0x3d32fe,_0x111565){var _0x508976=moment()[_0x6f3a('0x84')]()['toString']();var _0x200d7b=path[_0x6f3a('0x50')](config['root'],_0x6f3a('0x85'),_0x6f3a('0x86'),_0x6f3a('0x87'));var _0x34c219=path[_0x6f3a('0x50')](config[_0x6f3a('0x51')],_0x6f3a('0x85'),_0x6f3a('0x86'),_0x6f3a('0x4f'));var _0x590c7b=util[_0x6f3a('0x5a')](_0x6f3a('0x88'),_0x508976);return db['MailMessage']['find']({'where':{'id':_0x3d32fe[_0x6f3a('0x3d')]['id']},'attributes':['id',_0x6f3a('0x42'),'from','to','cc',_0x6f3a('0x89'),_0x6f3a('0x8a'),_0x6f3a('0x8b')],'include':_0x3d32fe[_0x6f3a('0x2a')][_0x6f3a('0x4f')]?[{'model':db[_0x6f3a('0x8c')],'as':'Attachments'}]:undefined})[_0x6f3a('0x11')](handleEntityNotFound(_0x111565,null))[_0x6f3a('0x11')](function(_0x402ac3){if(_0x402ac3){var _0x34d1db=_0x402ac3;var _0x177b8f={'from':_0x34d1db[_0x6f3a('0x8d')],'to':_0x34d1db['to'],'subject':_0x34d1db['subject'],'html':htmlEntities[_0x6f3a('0x8e')](_0x34d1db[_0x6f3a('0x42')]),'headers':{'Date':moment(_0x34d1db[_0x6f3a('0x8b')])['format'](_0x6f3a('0x8f'))},'attachments':[]};if(_0x402ac3['cc']){_0x177b8f[_0x6f3a('0x90')]['Cc']=_0x402ac3['cc'];}if(_0x402ac3[_0x6f3a('0x89')]){_0x177b8f['headers'][_0x6f3a('0x91')]=_0x402ac3[_0x6f3a('0x89')];}return new BPromise(function(_0x22225b,_0xb10eec){if(_0x402ac3['Attachments']){for(var _0x24deaa=0x0;_0x24deaa<_0x402ac3[_0x6f3a('0x92')][_0x6f3a('0x3f')];_0x24deaa++){var _0x5de523=_0x402ac3[_0x6f3a('0x92')][_0x24deaa];var _0x274611=path[_0x6f3a('0x50')](_0x34c219,_0x5de523[_0x6f3a('0x53')]);if(fs[_0x6f3a('0x93')](_0x274611)){_0x177b8f[_0x6f3a('0x4f')][_0x6f3a('0x94')]({'name':_0x5de523[_0x6f3a('0x23')],'contentType':_0x5de523[_0x6f3a('0x36')],'data':fs[_0x6f3a('0x95')](_0x274611)});}}}emlformat['build'](_0x177b8f,function(_0x1ab31e,_0x11fbff){if(_0x1ab31e)return _0xb10eec(_0x1ab31e);fs['writeFileSync'](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b),_0x11fbff);return _0x22225b(_0x11fbff);});});}})[_0x6f3a('0x11')](function(_0x11df82){if(_0x11df82){return _0x111565['download'](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b),_0x590c7b,function(_0x4430d2){if(!_0x4430d2)fs[_0x6f3a('0x96')](path[_0x6f3a('0x50')](_0x200d7b,_0x590c7b));});}})[_0x6f3a('0x19')](handleError(_0x111565,null));}; \ No newline at end of file +var _0xa722=['info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','limit','count','offset','set','Content-Range','update','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll','include','MailMessage','findAll','catch','params','keys','options','body','find','destroy','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','root','server/files/attachments','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','isNil','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','User','agent','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','internal','fromString','rejectmessage','download','unix','toString','join','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','then'];(function(_0x44837b,_0x442643){var _0x263d40=function(_0x1f32c6){while(--_0x1f32c6){_0x44837b['push'](_0x44837b['shift']());}};_0x263d40(++_0x442643);}(_0xa722,0x1d4));var _0x2a72=function(_0x1b4459,_0x1a4409){_0x1b4459=_0x1b4459-0x0;var _0x588834=_0xa722[_0x1b4459];return _0x588834;};'use strict';var emlformat=require(_0x2a72('0x0'));var moment=require('moment');var BPromise=require(_0x2a72('0x1'));var util=require(_0x2a72('0x2'));var path=require(_0x2a72('0x3'));var fs=require('fs');var _=require(_0x2a72('0x4'));var Redis=require(_0x2a72('0x5'));var htmlToText=require(_0x2a72('0x6'));var qs=require(_0x2a72('0x7'));var logger=require(_0x2a72('0x8'))(_0x2a72('0x9'));var interaction_log=require(_0x2a72('0x8'))(_0x2a72('0xa'));var config=require('../../config/environment');var db=require(_0x2a72('0xb'))['db'];config[_0x2a72('0xc')]=_['defaults'](config[_0x2a72('0xc')],{'host':_0x2a72('0xd'),'port':0x18eb});var socket=require(_0x2a72('0xe'))(new Redis(config[_0x2a72('0xc')]));var htmlEntities=require(_0x2a72('0xf'));require(_0x2a72('0x10'))[_0x2a72('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a72('0x12')][_0x2a72('0x13')]({'port':0x232c});var client9003=jayson[_0x2a72('0x12')][_0x2a72('0x13')]({'port':0x232b});var client9002=jayson[_0x2a72('0x12')][_0x2a72('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x295318,_0x17efab,_0x214633,_0x260b3e){return new BPromise(function(_0x152415,_0x327ac5){var _0x2e1142=_0x260b3e||client;return _0x2e1142['request'](_0x295318,_0x214633)[_0x2a72('0x14')](function(_0x6a74ee){logger[_0x2a72('0x15')](_0x2a72('0x16'),_0x17efab,'request\x20sent');logger[_0x2a72('0x17')](_0x2a72('0x18'),_0x17efab,_0x2a72('0x19'),JSON[_0x2a72('0x1a')](_0x6a74ee));if(_0x6a74ee[_0x2a72('0x1b')]){if(_0x6a74ee[_0x2a72('0x1b')][_0x2a72('0x1c')]===0x1f4){logger[_0x2a72('0x1b')](_0x2a72('0x16'),_0x17efab,_0x6a74ee[_0x2a72('0x1b')][_0x2a72('0x1d')]);return _0x327ac5(_0x6a74ee[_0x2a72('0x1b')][_0x2a72('0x1d')]);}logger[_0x2a72('0x1b')]('MailMessage,\x20%s,\x20%s',_0x17efab,_0x6a74ee['error'][_0x2a72('0x1d')]);return _0x152415(_0x6a74ee[_0x2a72('0x1b')]['message']);}else{logger[_0x2a72('0x15')]('MailMessage,\x20%s,\x20%s',_0x17efab,_0x2a72('0x19'));_0x152415(_0x6a74ee[_0x2a72('0x1e')][_0x2a72('0x1d')]);}})['catch'](function(_0x320396){logger['error']('MailMessage,\x20%s,\x20%s',_0x17efab,_0x320396);_0x327ac5(_0x320396);});});}function respondWithResult(_0x27149a,_0x324df6){_0x324df6=_0x324df6||0xc8;return function(_0x17d0f3){if(_0x17d0f3){return _0x27149a[_0x2a72('0x1f')](_0x324df6)[_0x2a72('0x20')](_0x17d0f3);}};}function respondWithFilteredResult(_0x155ea8,_0x1e75b3){return function(_0x3b7c1b){if(_0x3b7c1b){var _0x2c491f=typeof _0x1e75b3['offset']==='undefined'&&typeof _0x1e75b3[_0x2a72('0x21')]==='undefined';var _0x1512bc=_0x3b7c1b['count'];var _0x196c96=_0x2c491f?0x0:_0x1e75b3['offset'];var _0x5553f2=_0x2c491f?_0x3b7c1b[_0x2a72('0x22')]:_0x1e75b3[_0x2a72('0x23')]+_0x1e75b3[_0x2a72('0x21')];var _0x2e61d7;if(_0x5553f2>=_0x1512bc){_0x5553f2=_0x1512bc;_0x2e61d7=0xc8;}else{_0x2e61d7=0xce;}_0x155ea8[_0x2a72('0x1f')](_0x2e61d7);return _0x155ea8[_0x2a72('0x24')](_0x2a72('0x25'),_0x196c96+'-'+_0x5553f2+'/'+_0x1512bc)[_0x2a72('0x20')](_0x3b7c1b);}return null;};}function saveUpdates(_0x1131cc){return function(_0x1444be){if(_0x1444be){return _0x1444be[_0x2a72('0x26')](_0x1131cc)[_0x2a72('0x14')](function(_0x427486){return _0x427486;});}return null;};}function removeEntity(_0x519d78){return function(_0x152d24){if(_0x152d24){return _0x152d24['destroy']()[_0x2a72('0x14')](function(){_0x519d78[_0x2a72('0x1f')](0xcc)[_0x2a72('0x27')]();});}};}function handleEntityNotFound(_0x291ced){return function(_0x321eed){if(!_0x321eed){_0x291ced[_0x2a72('0x28')](0x194);}return _0x321eed;};}function handleError(_0x2dcfdf,_0x3cc9d5){_0x3cc9d5=_0x3cc9d5||0x1f4;return function(_0x5e295a){logger['error'](_0x5e295a[_0x2a72('0x29')]);if(_0x5e295a['name']){delete _0x5e295a[_0x2a72('0x2a')];}_0x2dcfdf[_0x2a72('0x1f')](_0x3cc9d5)[_0x2a72('0x2b')](_0x5e295a);};}exports[_0x2a72('0x2c')]=function(_0x45616d,_0x234b20){var _0x34b253={},_0x41621a={},_0x29ebf7={'count':0x0,'rows':[]};var _0x163e51=_['map'](db['MailMessage'][_0x2a72('0x2d')],function(_0x3b82af){return{'name':_0x3b82af[_0x2a72('0x2e')],'type':_0x3b82af[_0x2a72('0x2f')][_0x2a72('0x30')]};});_0x41621a[_0x2a72('0x31')]=_['map'](_0x163e51,_0x2a72('0x2a'));_0x41621a['query']=_['keys'](_0x45616d[_0x2a72('0x32')]);_0x41621a['filters']=_['intersection'](_0x41621a[_0x2a72('0x31')],_0x41621a[_0x2a72('0x32')]);_0x34b253['attributes']=_[_0x2a72('0x33')](_0x41621a[_0x2a72('0x31')],qs['fields'](_0x45616d[_0x2a72('0x32')][_0x2a72('0x34')]));_0x34b253[_0x2a72('0x35')]=_0x34b253['attributes'][_0x2a72('0x36')]?_0x34b253[_0x2a72('0x35')]:_0x41621a[_0x2a72('0x31')];if(!_0x45616d[_0x2a72('0x32')][_0x2a72('0x37')]('nolimit')){_0x34b253['limit']=qs[_0x2a72('0x21')](_0x45616d[_0x2a72('0x32')][_0x2a72('0x21')]);_0x34b253[_0x2a72('0x23')]=qs[_0x2a72('0x23')](_0x45616d[_0x2a72('0x32')][_0x2a72('0x23')]);}_0x34b253['order']=qs[_0x2a72('0x38')](_0x45616d['query'][_0x2a72('0x38')]);_0x34b253[_0x2a72('0x39')]=qs[_0x2a72('0x3a')](_[_0x2a72('0x3b')](_0x45616d[_0x2a72('0x32')],_0x41621a['filters']),_0x163e51);if(_0x45616d['query'][_0x2a72('0x3c')]){_0x34b253[_0x2a72('0x39')]=_[_0x2a72('0x3d')](_0x34b253['where'],{'$or':_[_0x2a72('0x3e')](_0x163e51,function(_0x22f575){if(_0x22f575[_0x2a72('0x2f')]!==_0x2a72('0x3f')){var _0x362b22={};_0x362b22[_0x22f575['name']]={'$like':'%'+_0x45616d[_0x2a72('0x32')][_0x2a72('0x3c')]+'%'};return _0x362b22;}})});}_0x34b253=_[_0x2a72('0x3d')]({},_0x34b253,_0x45616d['options']);var _0x1c9dab={'where':_0x34b253[_0x2a72('0x39')]};return db['MailMessage'][_0x2a72('0x22')](_0x1c9dab)[_0x2a72('0x14')](function(_0x3f39dd){_0x29ebf7['count']=_0x3f39dd;if(_0x45616d[_0x2a72('0x32')][_0x2a72('0x40')]){_0x34b253[_0x2a72('0x41')]=[{'all':!![]}];}return db[_0x2a72('0x42')][_0x2a72('0x43')](_0x34b253);})[_0x2a72('0x14')](function(_0x4adab7){_0x29ebf7['rows']=_0x4adab7;return _0x29ebf7;})[_0x2a72('0x14')](respondWithFilteredResult(_0x234b20,_0x34b253))[_0x2a72('0x44')](handleError(_0x234b20,null));};exports['show']=function(_0x334347,_0x21a7bb){var _0x322750={'raw':!![],'where':{'id':_0x334347[_0x2a72('0x45')]['id']}},_0x50546b={};_0x50546b[_0x2a72('0x31')]=_[_0x2a72('0x46')](db[_0x2a72('0x42')][_0x2a72('0x2d')]);_0x50546b[_0x2a72('0x32')]=_['keys'](_0x334347['query']);_0x50546b['filters']=_[_0x2a72('0x33')](_0x50546b[_0x2a72('0x31')],_0x50546b[_0x2a72('0x32')]);_0x322750[_0x2a72('0x35')]=_['intersection'](_0x50546b[_0x2a72('0x31')],qs['fields'](_0x334347[_0x2a72('0x32')][_0x2a72('0x34')]));_0x322750[_0x2a72('0x35')]=_0x322750[_0x2a72('0x35')][_0x2a72('0x36')]?_0x322750['attributes']:_0x50546b[_0x2a72('0x31')];if(_0x334347['query'][_0x2a72('0x40')]){_0x322750[_0x2a72('0x41')]=[{'all':!![]}];}_0x322750=_[_0x2a72('0x3d')]({},_0x322750,_0x334347[_0x2a72('0x47')]);return db[_0x2a72('0x42')]['find'](_0x322750)[_0x2a72('0x14')](handleEntityNotFound(_0x21a7bb,null))['then'](respondWithResult(_0x21a7bb,null))[_0x2a72('0x44')](handleError(_0x21a7bb,null));};exports[_0x2a72('0x26')]=function(_0x16fc12,_0x4dfc2b){if(_0x16fc12[_0x2a72('0x48')]['id']){delete _0x16fc12[_0x2a72('0x48')]['id'];}return db[_0x2a72('0x42')][_0x2a72('0x49')]({'where':{'id':_0x16fc12['params']['id']}})[_0x2a72('0x14')](handleEntityNotFound(_0x4dfc2b,null))[_0x2a72('0x14')](saveUpdates(_0x16fc12[_0x2a72('0x48')],null))[_0x2a72('0x14')](respondWithResult(_0x4dfc2b,null))['catch'](handleError(_0x4dfc2b,null));};exports[_0x2a72('0x4a')]=function(_0x5eac53,_0x5a759b){return db['MailMessage']['find']({'where':{'id':_0x5eac53[_0x2a72('0x45')]['id']}})[_0x2a72('0x14')](handleEntityNotFound(_0x5a759b,null))['then'](removeEntity(_0x5a759b,null))['catch'](handleError(_0x5a759b,null));};exports[_0x2a72('0x4b')]=function(_0x2fba97,_0x4c4ce5){return db[_0x2a72('0x42')][_0x2a72('0x4b')]()['then'](respondWithResult(_0x4c4ce5,null))[_0x2a72('0x44')](handleError(_0x4c4ce5,null));};exports[_0x2a72('0x4c')]=function(_0x257e05,_0x5cf33d){return db[_0x2a72('0x42')][_0x2a72('0x4c')](_0x257e05[_0x2a72('0x48')])['then'](function(_0x1031f8){if(_0x1031f8){if(_0x1031f8[_0x2a72('0x4d')]===_0x2a72('0x4e')&&!_0x1031f8[_0x2a72('0x4f')]){var _0x26ea0b,_0x52cf91,_0x36ce28;if(_0x257e05[_0x2a72('0x48')]['to']){_0x52cf91=_0x257e05[_0x2a72('0x48')]['to'][_0x2a72('0x50')](',')[0x0];}return db[_0x2a72('0x51')]['findOne']({'where':{'id':_0x1031f8[_0x2a72('0x52')]},'include':[{'model':db[_0x2a72('0x53')],'as':_0x2a72('0x54'),'include':[{'model':db[_0x2a72('0x55')],'as':_0x2a72('0x56'),'where':{'email':_0x52cf91},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x2a72('0x57')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2a72('0x58'),'raw':!![]}]}]})[_0x2a72('0x14')](function(_0x6afaae){_0x26ea0b=_0x6afaae;if(!_0x26ea0b||!_0x26ea0b[_0x2a72('0x59')])return;var _0xf7a002=_0x26ea0b[_0x2a72('0x5a')]();if(_0x257e05['body'][_0x2a72('0x5b')]&&_0x257e05[_0x2a72('0x48')][_0x2a72('0x5b')][_0x2a72('0x36')]){for(var _0x1e5be5=0x0;_0x1e5be5<_0x257e05[_0x2a72('0x48')][_0x2a72('0x5b')]['length'];_0x1e5be5+=0x1){_0x257e05[_0x2a72('0x48')][_0x2a72('0x5b')][_0x1e5be5]={'filename':_0x257e05[_0x2a72('0x48')]['attachments'][_0x1e5be5][_0x2a72('0x2a')],'path':path['join'](config[_0x2a72('0x5c')],_0x2a72('0x5d'),_0x257e05[_0x2a72('0x48')][_0x2a72('0x5b')][_0x1e5be5]['basename'])};}}_0x36ce28={'account':_0xf7a002,'message':_0x257e05[_0x2a72('0x48')]};return;})[_0x2a72('0x14')](function(){if(_0x26ea0b[_0x2a72('0x54')]){if(_0x26ea0b[_0x2a72('0x54')][_0x2a72('0x56')][_0x2a72('0x36')]){return _0x26ea0b[_0x2a72('0x54')][_0x2a72('0x56')][0x0];}else{return db[_0x2a72('0x55')][_0x2a72('0x4c')](_[_0x2a72('0x5e')](_0x257e05['body'],{'firstName':_0x257e05[_0x2a72('0x48')]['to'],'email':_0x257e05[_0x2a72('0x48')]['to'],'phone':_0x257e05['body']['to'],'ListId':_0x26ea0b[_0x2a72('0x5f')]}));}}else{throw new Error(_0x2a72('0x60'));}})[_0x2a72('0x14')](function(){if(_0x36ce28){return respondWithRpcPromise(_0x2a72('0x61'),_0x2a72('0x62'),_0x36ce28,client9003)[_0x2a72('0x14')](function(_0x2946e6){return _0x1031f8[_0x2a72('0x26')]({'read':!![],'messageId':_0x2946e6[_0x2a72('0x63')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x2a72('0x44')](function(_0x42445d){logger['error']('%s',JSON[_0x2a72('0x1a')](_0x42445d));return _0x1031f8;});}return _0x1031f8;});}return _0x1031f8;}})['then'](respondWithResult(_0x5cf33d,0xc9))[_0x2a72('0x44')](handleError(_0x5cf33d,null));};exports[_0x2a72('0x64')]=function(_0x4333ee,_0x5b16d2){var _0x4bf0ad={'agent':{},'channel':_0x2a72('0x65')};if(_0x4333ee['body']['id']){delete _0x4333ee[_0x2a72('0x48')]['id'];}_0x4333ee[_0x2a72('0x48')][_0x2a72('0x66')]=!![];_0x4333ee[_0x2a72('0x48')][_0x2a72('0x67')]=moment()[_0x2a72('0x68')](_0x2a72('0x69'));_0x4333ee[_0x2a72('0x48')][_0x2a72('0x6a')]=_0x4333ee[_0x2a72('0x48')]['UserId']||_0x4333ee[_0x2a72('0x6b')]['id'];_0x4bf0ad['agent']['id']=_0x4333ee[_0x2a72('0x48')][_0x2a72('0x6a')];return db[_0x2a72('0x42')][_0x2a72('0x49')]({'where':{'id':_0x4333ee['params']['id'],'UserId':null}})[_0x2a72('0x14')](handleEntityNotFound(_0x5b16d2,null))[_0x2a72('0x14')](saveUpdates(_0x4333ee['body'],null))[_0x2a72('0x14')](function(_0x2a7ad6){if(_0x2a7ad6){_0x4bf0ad[_0x2a72('0x1d')]=_0x2a7ad6['get']({'plain':!![]});return db['MailInteraction'][_0x2a72('0x49')]({'where':{'id':_0x2a7ad6['MailInteractionId']}});}return null;})[_0x2a72('0x14')](handleEntityNotFound(_0x5b16d2,null))['then'](function(_0xb3aeb2){if(_0xb3aeb2){return _0xb3aeb2[_0x2a72('0x26')]({'UserId':_0x4333ee[_0x2a72('0x48')][_0x2a72('0x6a')],'read1stAt':_[_0x2a72('0x6c')](_0xb3aeb2[_0x2a72('0x6d')])?moment()[_0x2a72('0x68')](_0x2a72('0x69')):undefined});}return null;})[_0x2a72('0x14')](function(_0x5e1d23){if(_0x5e1d23){_0x4bf0ad['interaction']=_0x5e1d23[_0x2a72('0x6e')]({'plain':!![]});interaction_log[_0x2a72('0x15')](_0x2a72('0x6f'),_0x4333ee['user']['id'],_0x4333ee[_0x2a72('0x6b')][_0x2a72('0x2a')],_0x4333ee[_0x2a72('0x6b')][_0x2a72('0x70')],_0x4bf0ad[_0x2a72('0x71')]['id'],_0x4333ee[_0x2a72('0x48')]?JSON[_0x2a72('0x1a')](_0x4333ee[_0x2a72('0x48')]):'null');return respondWithRpcPromise(_0x2a72('0x72'),_0x2a72('0x73'),_0x4bf0ad);}return null;})[_0x2a72('0x14')](function(_0x522c1d){var _0x216f64='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x522c1d['message'][_0x2a72('0x74')];return db[_0x2a72('0x75')][_0x2a72('0x32')](_0x216f64,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x83447c){return _0x83447c;});})[_0x2a72('0x14')](function(_0x244749){if(_0x244749){_0x4bf0ad[_0x2a72('0x1d')]['contact']=_0x244749[0x0];if(!_0x4333ee['body']['UserId'])return;return db[_0x2a72('0x76')][_0x2a72('0x49')]({'where':{'id':_0x4333ee[_0x2a72('0x48')][_0x2a72('0x6a')],'role':_0x2a72('0x77')},'attributes':['id',_0x2a72('0x2a'),_0x2a72('0x78'),_0x2a72('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4acbc7){if(!_0x4acbc7)return null;_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x77')]=_0x4acbc7;return _0x4bf0ad;})[_0x2a72('0x14')](function(_0x4daf93){if(_0x4daf93){if(_0x4333ee[_0x2a72('0x48')]['manual']){_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x7a')]=util[_0x2a72('0x68')](_0x2a72('0x7b'),_0x4333ee[_0x2a72('0x6b')][_0x2a72('0x2a')]);_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x7c')]=_0x4bf0ad['channel'];_0x4bf0ad['message'][_0x2a72('0x7d')]=_0x4bf0ad[_0x2a72('0x7c')];_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x7e')]=_0x2a72('0x64');_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x48')]=htmlToText['fromString'](_0x4bf0ad[_0x2a72('0x1d')][_0x2a72('0x48')]);return respondWithRpcPromise(_0x2a72('0x7f'),_0x2a72('0x7f'),{'event':_0x2a72('0x80'),'message':_0x4bf0ad['message']},client9002)['then'](function(){return _0x4bf0ad;});}return _0x4bf0ad;}return null;})[_0x2a72('0x14')](respondWithResult(_0x5b16d2,null))[_0x2a72('0x44')](handleError(_0x5b16d2,null));};exports[_0x2a72('0x81')]=function(_0x53257a,_0x5dca02){var _0x30e717={'agent':{},'channel':_0x2a72('0x65')};if(_0x53257a[_0x2a72('0x48')]['id']){delete _0x53257a[_0x2a72('0x48')]['id'];}_0x53257a[_0x2a72('0x48')]['UserId']=_0x53257a[_0x2a72('0x48')][_0x2a72('0x6a')]||_0x53257a[_0x2a72('0x6b')]['id'];_0x30e717[_0x2a72('0x77')]['id']=_0x53257a[_0x2a72('0x48')][_0x2a72('0x6a')];return db[_0x2a72('0x42')][_0x2a72('0x49')]({'where':{'id':_0x53257a[_0x2a72('0x45')]['id'],'UserId':null}})[_0x2a72('0x14')](handleEntityNotFound(_0x5dca02,null))['then'](function(_0x4676f0){if(_0x4676f0){_0x30e717[_0x2a72('0x1d')]=_0x4676f0[_0x2a72('0x6e')]({'plain':!![]});return db[_0x2a72('0x82')][_0x2a72('0x49')]({'where':{'id':_0x4676f0[_0x2a72('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x5dca02,null))[_0x2a72('0x14')](function(_0x146aa0){if(_0x146aa0){_0x30e717[_0x2a72('0x71')]=_0x146aa0['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53257a[_0x2a72('0x6b')]['id'],_0x53257a[_0x2a72('0x6b')][_0x2a72('0x2a')],_0x53257a[_0x2a72('0x6b')][_0x2a72('0x70')],_0x30e717[_0x2a72('0x71')]['id'],_0x53257a[_0x2a72('0x48')]?JSON['stringify'](_0x53257a[_0x2a72('0x48')]):_0x2a72('0x84'));return respondWithRpcPromise(_0x2a72('0x85'),_0x2a72('0x86'),_0x30e717);}return null;})['then'](function(_0x3041f2){var _0x67416d=_0x2a72('0x87')+_0x3041f2[_0x2a72('0x1d')]['ContactId'];return db[_0x2a72('0x75')]['query'](_0x67416d,{'type':db['Sequelize'][_0x2a72('0x88')][_0x2a72('0x89')],'raw':!![]})['then'](function(_0xfd1f34){return _0xfd1f34;});})[_0x2a72('0x14')](function(_0xf55712){if(_0xf55712){_0x30e717['message']['contact']=_0xf55712[0x0];if(!_0x53257a[_0x2a72('0x48')][_0x2a72('0x6a')])return;return db[_0x2a72('0x76')][_0x2a72('0x49')]({'where':{'id':_0x53257a[_0x2a72('0x48')][_0x2a72('0x6a')],'role':_0x2a72('0x77')},'attributes':['id',_0x2a72('0x2a'),'fullname',_0x2a72('0x79'),_0x2a72('0x8a')],'raw':!![]});}return null;})[_0x2a72('0x14')](function(_0x4f4615){if(!_0x4f4615)return null;_0x30e717['message']['agent']=_0x4f4615;return _0x30e717;})[_0x2a72('0x14')](function(_0x56f5e1){if(_0x56f5e1){_0x56f5e1[_0x2a72('0x1d')]['interface']=util[_0x2a72('0x68')](_0x2a72('0x7b'),_0x53257a[_0x2a72('0x6b')][_0x2a72('0x2a')]);_0x56f5e1[_0x2a72('0x1d')][_0x2a72('0x7c')]=_0x30e717['channel'];_0x56f5e1['message']['motionChannel']=_0x30e717[_0x2a72('0x7c')];_0x56f5e1['message']['event']='reject';_0x56f5e1['message']['body']=htmlToText[_0x2a72('0x8b')](_0x30e717['message'][_0x2a72('0x48')]);respondWithRpcPromise(_0x2a72('0x7f'),_0x2a72('0x7f'),{'event':_0x2a72('0x8c'),'message':_0x56f5e1[_0x2a72('0x1d')]},client9002);return _0x30e717;}return null;})[_0x2a72('0x14')](respondWithResult(_0x5dca02,null))[_0x2a72('0x44')](handleError(_0x5dca02,null));};exports[_0x2a72('0x8d')]=function(_0x309afa,_0x2460fb){var _0x5a3b22=moment()[_0x2a72('0x8e')]()[_0x2a72('0x8f')]();var _0x49a686=path[_0x2a72('0x90')](config[_0x2a72('0x5c')],_0x2a72('0x91'),'files','tmp');var _0x692289=path[_0x2a72('0x90')](config[_0x2a72('0x5c')],_0x2a72('0x91'),_0x2a72('0x92'),_0x2a72('0x5b'));var _0x36e598=util[_0x2a72('0x68')](_0x2a72('0x93'),_0x5a3b22);return db[_0x2a72('0x42')]['find']({'where':{'id':_0x309afa[_0x2a72('0x45')]['id']},'attributes':['id',_0x2a72('0x48'),'from','to','cc',_0x2a72('0x94'),_0x2a72('0x95'),_0x2a72('0x96')],'include':_0x309afa[_0x2a72('0x32')]['attachments']?[{'model':db[_0x2a72('0x97')],'as':_0x2a72('0x98')}]:undefined})[_0x2a72('0x14')](handleEntityNotFound(_0x2460fb,null))['then'](function(_0x561cab){if(_0x561cab){var _0x32d3e1=_0x561cab;var _0x4e4ca3={'from':_0x32d3e1[_0x2a72('0x99')],'to':_0x32d3e1['to'],'subject':_0x32d3e1[_0x2a72('0x95')],'html':htmlEntities['decode'](_0x32d3e1['body']),'headers':{'Date':moment(_0x32d3e1[_0x2a72('0x96')])[_0x2a72('0x68')](_0x2a72('0x9a'))},'attachments':[]};if(_0x561cab['cc']){_0x4e4ca3['headers']['Cc']=_0x561cab['cc'];}if(_0x561cab[_0x2a72('0x94')]){_0x4e4ca3[_0x2a72('0x9b')][_0x2a72('0x9c')]=_0x561cab[_0x2a72('0x94')];}return new BPromise(function(_0x32ac3c,_0x4bd825){if(_0x561cab[_0x2a72('0x98')]){for(var _0x49d0b7=0x0;_0x49d0b7<_0x561cab['Attachments'][_0x2a72('0x36')];_0x49d0b7++){var _0x46a0dd=_0x561cab[_0x2a72('0x98')][_0x49d0b7];var _0x2463a2=path[_0x2a72('0x90')](_0x692289,_0x46a0dd[_0x2a72('0x9d')]);if(fs[_0x2a72('0x9e')](_0x2463a2)){_0x4e4ca3['attachments'][_0x2a72('0x9f')]({'name':_0x46a0dd[_0x2a72('0x2a')],'contentType':_0x46a0dd[_0x2a72('0x2f')],'data':fs[_0x2a72('0xa0')](_0x2463a2)});}}}emlformat[_0x2a72('0xa1')](_0x4e4ca3,function(_0x3fb802,_0x56fdea){if(_0x3fb802)return _0x4bd825(_0x3fb802);fs[_0x2a72('0xa2')](path[_0x2a72('0x90')](_0x49a686,_0x36e598),_0x56fdea);return _0x32ac3c(_0x56fdea);});});}})[_0x2a72('0x14')](function(_0x530581){if(_0x530581){return _0x2460fb[_0x2a72('0x8d')](path[_0x2a72('0x90')](_0x49a686,_0x36e598),_0x36e598,function(_0x2edf9f){if(!_0x2edf9f)fs['unlinkSync'](path[_0x2a72('0x90')](_0x49a686,_0x36e598));});}})[_0x2a72('0x44')](handleError(_0x2460fb,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 9c52afe..437a4a4 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 _0x8897=['MailMessage','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0x8897,0xa7));var _0x7889=function(_0x5321a4,_0x3029bd){_0x5321a4=_0x5321a4-0x0;var _0x59c36c=_0x8897[_0x5321a4];return _0x59c36c;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x7889('0x0'))['db'][_0x7889('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7889('0x2'),'afterDestroy':_0x7889('0x3')};function emitEvent(_0xf981e8){return function(_0x365d7b,_0xc8681,_0x102dd5){MailMessageEvents[_0x7889('0x4')](_0xf981e8+':'+_0x365d7b['id'],_0x365d7b);MailMessageEvents[_0x7889('0x4')](_0xf981e8,_0x365d7b);_0x102dd5(null);};}for(var e in events){if(events[_0x7889('0x5')](e)){var event=events[e];MailMessage[_0x7889('0x6')](e,emitEvent(event));}}module[_0x7889('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xaab7=['MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x391ebb,_0x3c74ea){var _0x1072b1=function(_0x41aa78){while(--_0x41aa78){_0x391ebb['push'](_0x391ebb['shift']());}};_0x1072b1(++_0x3c74ea);}(_0xaab7,0xee));var _0x7aab=function(_0x5542d8,_0x5099cf){_0x5542d8=_0x5542d8-0x0;var _0x123d5f=_0xaab7[_0x5542d8];return _0x123d5f;};'use strict';var EventEmitter=require(_0x7aab('0x0'));var MailMessage=require(_0x7aab('0x1'))['db'][_0x7aab('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7aab('0x3')](0x0);var events={'afterCreate':_0x7aab('0x4'),'afterUpdate':'update','afterDestroy':_0x7aab('0x5')};function emitEvent(_0x13e22b){return function(_0x2758ad,_0x158576,_0x5a555a){MailMessageEvents[_0x7aab('0x6')](_0x13e22b+':'+_0x2758ad['id'],_0x2758ad);MailMessageEvents[_0x7aab('0x6')](_0x13e22b,_0x2758ad);_0x5a555a(null);};}for(var e in events){if(events[_0x7aab('0x7')](e)){var event=events[e];MailMessage[_0x7aab('0x8')](e,emitEvent(event));}}module[_0x7aab('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ebc0d87..ef93c15 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 _0xce25=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','toLowerCase'];(function(_0x116246,_0x2dfa41){var _0x439ddd=function(_0x546da8){while(--_0x546da8){_0x116246['push'](_0x116246['shift']());}};_0x439ddd(++_0x2dfa41);}(_0xce25,0x115));var _0x5ce2=function(_0x11618f,_0x526928){_0x11618f=_0x11618f-0x0;var _0x1db5d0=_0xce25[_0x11618f];return _0x1db5d0;};'use strict';var _=require(_0x5ce2('0x0'));var util=require(_0x5ce2('0x1'));var logger=require('../../config/logger')(_0x5ce2('0x2'));var moment=require(_0x5ce2('0x3'));var BPromise=require(_0x5ce2('0x4'));var rp=require(_0x5ce2('0x5'));var htmlToText=require(_0x5ce2('0x6'));var fs=require('fs');var path=require(_0x5ce2('0x7'));var rimraf=require(_0x5ce2('0x8'));var config=require(_0x5ce2('0x9'));var attributes=require('./mailMessage.attributes');module[_0x5ce2('0xa')]=function(_0x5a2710,_0x46371f){return _0x5a2710[_0x5ce2('0xb')](_0x5ce2('0xc'),attributes,{'tableName':_0x5ce2('0xd'),'paranoid':![],'indexes':[{'name':_0x5ce2('0xe'),'fields':[_0x5ce2('0xe')]},{'name':_0x5ce2('0xf'),'fields':[_0x5ce2('0x10'),_0x5ce2('0x11')],'type':_0x5ce2('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17b4c5,_0x17117f,_0x222586){if(_0x17b4c5[_0x5ce2('0x13')]){_0x17b4c5[_0x5ce2('0x10')]=htmlToText[_0x5ce2('0x14')](_0x17b4c5[_0x5ce2('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x222586(null,_0x17117f);},'afterCreate':function(_0x361d51,_0x3cc1bd,_0x460768){var _0x4e0c61=_0x5a2710[_0x5ce2('0x15')];var _0x3f298c=_0x361d51[_0x5ce2('0x16')]({'plain':!![]});if(_0x3f298c[_0x5ce2('0x17')]['toLowerCase']()==='in'||_0x3f298c[_0x5ce2('0x17')]['toLowerCase']()===_0x5ce2('0x18')&&!_0x3f298c[_0x5ce2('0x19')]&&!_[_0x5ce2('0x1a')](_0x3f298c[_0x5ce2('0x1b')])){_0x4e0c61[_0x5ce2('0x1c')][_0x5ce2('0x1d')]({'where':{'id':_0x3f298c[_0x5ce2('0x1e')]}})[_0x5ce2('0x1f')](function(_0x5b7bd8){if(_0x5b7bd8){_0x5b7bd8[_0x5ce2('0x20')]({'lastMsgAt':_0x3f298c[_0x5ce2('0x21')],'lastMsgDirection':_0x3f298c[_0x5ce2('0x17')][_0x5ce2('0x22')]()});}})[_0x5ce2('0x23')](function(_0x5da435){console[_0x5ce2('0x24')](_0x5da435);});}_0x460768();}},'charset':_0x5ce2('0x25'),'collate':_0x5ce2('0x26')});}; \ No newline at end of file +var _0x74d1=['update','createdAt','toLowerCase','error','utf8mb4','lodash','api','moment','bluebird','html-to-text','path','rimraf','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then'];(function(_0x49cec3,_0x18c81c){var _0x20eed0=function(_0x209ed3){while(--_0x209ed3){_0x49cec3['push'](_0x49cec3['shift']());}};_0x20eed0(++_0x18c81c);}(_0x74d1,0x1c7));var _0x174d=function(_0x5b7396,_0x176c9d){_0x5b7396=_0x5b7396-0x0;var _0x50b4ae=_0x74d1[_0x5b7396];return _0x50b4ae;};'use strict';var _=require(_0x174d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x174d('0x1'));var moment=require(_0x174d('0x2'));var BPromise=require(_0x174d('0x3'));var rp=require('request-promise');var htmlToText=require(_0x174d('0x4'));var fs=require('fs');var path=require(_0x174d('0x5'));var rimraf=require(_0x174d('0x6'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module['exports']=function(_0x2e1253,_0x4205db){return _0x2e1253[_0x174d('0x7')](_0x174d('0x8'),attributes,{'tableName':_0x174d('0x9'),'paranoid':![],'indexes':[{'name':_0x174d('0xa'),'fields':[_0x174d('0xa')]},{'name':_0x174d('0xb'),'fields':[_0x174d('0xc'),_0x174d('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ea068,_0x59d154,_0x7d3270){if(_0x5ea068[_0x174d('0xe')]){_0x5ea068[_0x174d('0xc')]=htmlToText['fromString'](_0x5ea068[_0x174d('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x7d3270(null,_0x59d154);},'afterCreate':function(_0x491fa2,_0x108730,_0x4e7e4c){var _0x4dff9a=_0x2e1253[_0x174d('0xf')];var _0x13b538=_0x491fa2[_0x174d('0x10')]({'plain':!![]});if(_0x13b538[_0x174d('0x11')]['toLowerCase']()==='in'||_0x13b538['direction']['toLowerCase']()===_0x174d('0x12')&&!_0x13b538[_0x174d('0x13')]&&!_[_0x174d('0x14')](_0x13b538['UserId'])){_0x4dff9a[_0x174d('0x15')][_0x174d('0x16')]({'where':{'id':_0x13b538[_0x174d('0x17')]}})[_0x174d('0x18')](function(_0x25e0dd){if(_0x25e0dd){_0x25e0dd[_0x174d('0x19')]({'lastMsgAt':_0x13b538[_0x174d('0x1a')],'lastMsgDirection':_0x13b538[_0x174d('0x11')][_0x174d('0x1b')]()});}})['catch'](function(_0x54a51f){console[_0x174d('0x1c')](_0x54a51f);});}_0x4e7e4c();}},'charset':_0x174d('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1f1a9ec..dccdcf3 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 _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x210126,_0x491b15){var _0x4dabfa=function(_0x3653fb){while(--_0x3653fb){_0x210126['push'](_0x210126['shift']());}};_0x4dabfa(++_0x491b15);}(_0x63a5,0x18e));var _0x563a=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x63a5[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file +var _0x5b12=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','create','options','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x5b12,0xa3));var _0x25b1=function(_0x4f2aec,_0x291f17){_0x4f2aec=_0x4f2aec-0x0;var _0x4b9c7c=_0x5b12[_0x4f2aec];return _0x4b9c7c;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});config['redis']=_[_0x25b1('0x8')](config[_0x25b1('0x9')],{'host':_0x25b1('0xa'),'port':0x18eb});var socket=require(_0x25b1('0xb'))(new Redis(config[_0x25b1('0x9')]));require(_0x25b1('0xc'))[_0x25b1('0xd')](socket);function respondWithRpcPromise(_0x6235e2,_0x5b7224,_0x2b739e){return new BPromise(function(_0x1c28cf,_0x2cee35){return client[_0x25b1('0xe')](_0x6235e2,_0x2b739e)[_0x25b1('0xf')](function(_0x8a71af){logger[_0x25b1('0x10')](_0x25b1('0x11'),_0x5b7224,_0x25b1('0x12'));logger[_0x25b1('0x13')](_0x25b1('0x14'),_0x5b7224,_0x25b1('0x12'),JSON[_0x25b1('0x15')](_0x8a71af));if(_0x8a71af[_0x25b1('0x16')]){if(_0x8a71af[_0x25b1('0x16')][_0x25b1('0x17')]===0x1f4){logger['error'](_0x25b1('0x11'),_0x5b7224,_0x8a71af[_0x25b1('0x16')]['message']);return _0x2cee35(_0x8a71af[_0x25b1('0x16')][_0x25b1('0x18')]);}logger[_0x25b1('0x16')]('MailMessage,\x20%s,\x20%s',_0x5b7224,_0x8a71af['error'][_0x25b1('0x18')]);return _0x1c28cf(_0x8a71af['error'][_0x25b1('0x18')]);}else{logger[_0x25b1('0x10')](_0x25b1('0x11'),_0x5b7224,_0x25b1('0x12'));_0x1c28cf(_0x8a71af[_0x25b1('0x19')][_0x25b1('0x18')]);}})[_0x25b1('0x1a')](function(_0x292463){logger['error']('MailMessage,\x20%s,\x20%s',_0x5b7224,_0x292463);_0x2cee35(_0x292463);});});}exports[_0x25b1('0x1b')]=function(_0x501dc8){var _0x174f4a=this;return new Promise(function(_0x50ae0f,_0x3bfd7d){return db['MailMessage'][_0x25b1('0x1c')](_0x501dc8['body'],{'raw':_0x501dc8[_0x25b1('0x1d')]?_0x501dc8['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3bca9f){logger[_0x25b1('0x10')]('CreateMailMessage',_0x501dc8);logger[_0x25b1('0x13')](_0x25b1('0x1b'),_0x501dc8,JSON[_0x25b1('0x15')](_0x3bca9f));_0x50ae0f(_0x3bca9f);})[_0x25b1('0x1a')](function(_0x1aabbb){logger['error'](_0x25b1('0x1b'),_0x1aabbb[_0x25b1('0x18')],_0x501dc8);_0x3bfd7d(_0x174f4a[_0x25b1('0x16')](0x1f4,_0x1aabbb[_0x25b1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e606adc..b4d2db2 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 _0xd44e=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','register'];(function(_0x554911,_0x4d1f4c){var _0x3743e1=function(_0x50788b){while(--_0x50788b){_0x554911['push'](_0x554911['shift']());}};_0x3743e1(++_0x4d1f4c);}(_0xd44e,0x1c2));var _0xed44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd44e[_0x14add3];return _0x4a174f;};'use strict';var MailMessageEvents=require(_0xed44('0x0'));var events=[_0xed44('0x1'),_0xed44('0x2'),_0xed44('0x3')];function createListener(_0x9f67df,_0x5744da){return function(_0x2d8575){_0x5744da[_0xed44('0x4')](_0x9f67df,_0x2d8575);};}function removeListener(_0xb471c,_0x17223d){return function(){MailMessageEvents['removeListener'](_0xb471c,_0x17223d);};}exports[_0xed44('0x5')]=function(_0x138b6d){for(var _0x3d75fa=0x0,_0x5b172a=events[_0xed44('0x6')];_0x3d75fa<_0x5b172a;_0x3d75fa++){var _0x4247c9=events[_0x3d75fa];var _0x25f348=createListener(_0xed44('0x7')+_0x4247c9,_0x138b6d);MailMessageEvents['on'](_0x4247c9,_0x25f348);}}; \ No newline at end of file +var _0x8c04=['save','remove','update','emit','removeListener','register','length','mailMessage:','./mailMessage.events'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8c04,0x155));var _0x48c0=function(_0xb57634,_0x3e5698){_0xb57634=_0xb57634-0x0;var _0x1988ef=_0x8c04[_0xb57634];return _0x1988ef;};'use strict';var MailMessageEvents=require(_0x48c0('0x0'));var events=[_0x48c0('0x1'),_0x48c0('0x2'),_0x48c0('0x3')];function createListener(_0x3faf1b,_0x4df881){return function(_0x8b6d0c){_0x4df881[_0x48c0('0x4')](_0x3faf1b,_0x8b6d0c);};}function removeListener(_0xeb3037,_0x327969){return function(){MailMessageEvents[_0x48c0('0x5')](_0xeb3037,_0x327969);};}exports[_0x48c0('0x6')]=function(_0x276104){for(var _0x4ebf37=0x0,_0x481126=events[_0x48c0('0x7')];_0x4ebf37<_0x481126;_0x4ebf37++){var _0x38e7b5=events[_0x4ebf37];var _0x17ce64=createListener(_0x48c0('0x8')+_0x38e7b5,_0x276104);MailMessageEvents['on'](_0x38e7b5,_0x17ce64);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 66dd589..ffc84f3 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 _0xb76c=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x13851e,_0x249f30){var _0x50524d=function(_0x50fbf5){while(--_0x50fbf5){_0x13851e['push'](_0x13851e['shift']());}};_0x50524d(++_0x249f30);}(_0xb76c,0x75));var _0xcb76=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xb76c[_0x15b399];return _0x199f2d;};'use strict';var multer=require(_0xcb76('0x0'));var util=require(_0xcb76('0x1'));var path=require(_0xcb76('0x2'));var timeout=require(_0xcb76('0x3'));var express=require(_0xcb76('0x4'));var router=express[_0xcb76('0x5')]();var fs_extra=require(_0xcb76('0x6'));var auth=require(_0xcb76('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcb76('0x8'));var controller=require('./mailQueue.controller');router[_0xcb76('0x9')]('/',auth[_0xcb76('0xa')](),controller[_0xcb76('0xb')]);router[_0xcb76('0x9')](_0xcb76('0xc'),auth['isAuthenticated'](),controller[_0xcb76('0xd')]);router[_0xcb76('0x9')]('/:id',auth[_0xcb76('0xa')](),controller[_0xcb76('0xe')]);router[_0xcb76('0x9')](_0xcb76('0xf'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x10')]);router['get'](_0xcb76('0x11'),auth['isAuthenticated'](),controller[_0xcb76('0x12')]);router[_0xcb76('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xcb76('0x13')]);router['post']('/',auth[_0xcb76('0xa')](),controller[_0xcb76('0x14')]);router[_0xcb76('0x15')](_0xcb76('0x11'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x16')]);router[_0xcb76('0x15')](_0xcb76('0x17'),auth[_0xcb76('0xa')](),controller['addAgents']);router[_0xcb76('0x18')](_0xcb76('0x19'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1a')]);router[_0xcb76('0x1b')](_0xcb76('0x19'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1c')]);router[_0xcb76('0x1b')](_0xcb76('0x11'),auth[_0xcb76('0xa')](),controller[_0xcb76('0x1d')]);router[_0xcb76('0x1b')](_0xcb76('0x17'),auth['isAuthenticated'](),controller[_0xcb76('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xeb67=['connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path'];(function(_0x2e1d24,_0x858418){var _0x1bd361=function(_0x1971ca){while(--_0x1971ca){_0x2e1d24['push'](_0x2e1d24['shift']());}};_0x1bd361(++_0x858418);}(_0xeb67,0xa5));var _0x7eb6=function(_0x11de9d,_0x5d5243){_0x11de9d=_0x11de9d-0x0;var _0x2e1c2b=_0xeb67[_0x11de9d];return _0x2e1c2b;};'use strict';var multer=require(_0x7eb6('0x0'));var util=require(_0x7eb6('0x1'));var path=require(_0x7eb6('0x2'));var timeout=require(_0x7eb6('0x3'));var express=require(_0x7eb6('0x4'));var router=express[_0x7eb6('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7eb6('0x6'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x7eb6('0x7')]('/',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0x9')]);router[_0x7eb6('0x7')](_0x7eb6('0xa'),auth[_0x7eb6('0x8')](),controller[_0x7eb6('0xb')]);router[_0x7eb6('0x7')](_0x7eb6('0xc'),auth[_0x7eb6('0x8')](),controller[_0x7eb6('0xd')]);router[_0x7eb6('0x7')]('/:id/members',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0xe')]);router['get']('/:id/teams',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0xf')]);router['get'](_0x7eb6('0x10'),auth['isAuthenticated'](),controller[_0x7eb6('0x11')]);router[_0x7eb6('0x12')]('/',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0x13')]);router[_0x7eb6('0x12')]('/:id/teams',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0x14')]);router[_0x7eb6('0x12')](_0x7eb6('0x10'),auth['isAuthenticated'](),controller[_0x7eb6('0x15')]);router[_0x7eb6('0x16')](_0x7eb6('0xc'),auth[_0x7eb6('0x8')](),controller[_0x7eb6('0x17')]);router[_0x7eb6('0x18')](_0x7eb6('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x7eb6('0x18')]('/:id/teams',auth[_0x7eb6('0x8')](),controller[_0x7eb6('0x19')]);router[_0x7eb6('0x18')](_0x7eb6('0x10'),auth['isAuthenticated'](),controller[_0x7eb6('0x1a')]);module[_0x7eb6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 1eaca77..d17ccbe 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 _0xbf5f=['INTEGER','rrmemory','beepall','sequelize','STRING'];(function(_0x8295d6,_0x263216){var _0x4fa9aa=function(_0x4779de){while(--_0x4779de){_0x8295d6['push'](_0x8295d6['shift']());}};_0x4fa9aa(++_0x263216);}(_0xbf5f,0x1bb));var _0xfbf5=function(_0x1b61d0,_0x374c5d){_0x1b61d0=_0x1b61d0-0x0;var _0x1e48f6=_0xbf5f[_0x1b61d0];return _0x1e48f6;};'use strict';var Sequelize=require(_0xfbf5('0x0'));module['exports']={'name':{'type':Sequelize[_0xfbf5('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfbf5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfbf5('0x3'),_0xfbf5('0x4'),'roundrobin')}}; \ No newline at end of file +var _0xb18e=['INTEGER','ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x58a4a9,_0x5edcf9){var _0x409a30=function(_0x243d39){while(--_0x243d39){_0x58a4a9['push'](_0x58a4a9['shift']());}};_0x409a30(++_0x5edcf9);}(_0xb18e,0x10d));var _0xeb18=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb18e[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0xeb18('0x0'));module[_0xeb18('0x1')]={'name':{'type':Sequelize[_0xeb18('0x2')],'unique':_0xeb18('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb18('0x2')]},'timeout':{'type':Sequelize[_0xeb18('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeb18('0x5')]('rrmemory',_0xeb18('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f8e8d86..ffcd01a 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 _0x1d57=['toString','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','userMailQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','get','MailQueues','destroy','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','UserId','mailPause','createdAt','SIP','updatedAt','Team','getTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push'];(function(_0x21b9a2,_0x3289dd){var _0x27ef05=function(_0x1a28ff){while(--_0x1a28ff){_0x21b9a2['push'](_0x21b9a2['shift']());}};_0x27ef05(++_0x3289dd);}(_0x1d57,0x123));var _0x71d5=function(_0x389a61,_0x20216c){_0x389a61=_0x389a61-0x0;var _0x1acde9=_0x1d57[_0x389a61];return _0x1acde9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71d5('0x0'));var zipdir=require(_0x71d5('0x1'));var jsonpatch=require(_0x71d5('0x2'));var rp=require('request-promise');var moment=require(_0x71d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x71d5('0x4'));var util=require(_0x71d5('0x5'));var path=require(_0x71d5('0x6'));var sox=require(_0x71d5('0x7'));var csv=require(_0x71d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71d5('0x9'));var _=require(_0x71d5('0xa'));var squel=require('squel');var crypto=require(_0x71d5('0xb'));var jsforce=require(_0x71d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x71d5('0x8'));var querystring=require(_0x71d5('0xd'));var Papa=require(_0x71d5('0xe'));var Redis=require(_0x71d5('0xf'));var authService=require(_0x71d5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x71d5('0x11'));var hardwareService=require(_0x71d5('0x12'));var logger=require(_0x71d5('0x13'))(_0x71d5('0x14'));var utils=require(_0x71d5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x71d5('0x16'));var db=require(_0x71d5('0x17'))['db'];config[_0x71d5('0x18')]=_[_0x71d5('0x19')](config[_0x71d5('0x18')],{'host':_0x71d5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x71d5('0x1b'))[_0x71d5('0x1c')](socket);function respondWithStatusCode(_0x178b3b,_0x3a5b83){_0x3a5b83=_0x3a5b83||0xcc;return function(_0x39d16a){if(_0x39d16a){return _0x178b3b[_0x71d5('0x1d')](_0x3a5b83);}return _0x178b3b[_0x71d5('0x1e')](_0x3a5b83)[_0x71d5('0x1f')]();};}function respondWithResult(_0x384ff3,_0x18dcd0){_0x18dcd0=_0x18dcd0||0xc8;return function(_0x22e4f1){if(_0x22e4f1){return _0x384ff3[_0x71d5('0x1e')](_0x18dcd0)['json'](_0x22e4f1);}};}function respondWithFilteredResult(_0xc9a36b,_0x2f9896){return function(_0x4333c1){if(_0x4333c1){var _0x4ca64f=typeof _0x2f9896['offset']===_0x71d5('0x20')&&typeof _0x2f9896[_0x71d5('0x21')]==='undefined';var _0x37bc54=_0x4333c1['count'];var _0x5e4bc5=_0x4ca64f?0x0:_0x2f9896[_0x71d5('0x22')];var _0x37e5c7=_0x4ca64f?_0x4333c1[_0x71d5('0x23')]:_0x2f9896[_0x71d5('0x22')]+_0x2f9896[_0x71d5('0x21')];var _0x423277;if(_0x37e5c7>=_0x37bc54){_0x37e5c7=_0x37bc54;_0x423277=0xc8;}else{_0x423277=0xce;}_0xc9a36b[_0x71d5('0x1e')](_0x423277);return _0xc9a36b[_0x71d5('0x24')](_0x71d5('0x25'),_0x5e4bc5+'-'+_0x37e5c7+'/'+_0x37bc54)[_0x71d5('0x26')](_0x4333c1);}return null;};}function patchUpdates(_0x41f1c3){return function(_0x448482){try{jsonpatch[_0x71d5('0x27')](_0x448482,_0x41f1c3,!![]);}catch(_0x31d2be){return BPromise[_0x71d5('0x28')](_0x31d2be);}return _0x448482[_0x71d5('0x29')]();};}function saveUpdates(_0x26aacf,_0x311a30){return function(_0x475b1a){if(_0x475b1a){return _0x475b1a[_0x71d5('0x2a')](_0x26aacf)['then'](function(_0x199997){return _0x199997;});}return null;};}function removeEntity(_0x49d636,_0x399502){return function(_0x46c363){if(_0x46c363){return _0x46c363['destroy']()[_0x71d5('0x2b')](function(){var _0x3200e8=_0x46c363[_0x71d5('0x2c')]({'plain':!![]});var _0x5ed7fb=_0x71d5('0x2d');return db['UserProfileResource'][_0x71d5('0x2e')]({'where':{'type':_0x5ed7fb,'resourceId':_0x3200e8['id']}})[_0x71d5('0x2b')](function(){return _0x46c363;});})['then'](function(){_0x49d636[_0x71d5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x388fd7,_0x49399f){return function(_0x31e51f){if(!_0x31e51f){_0x388fd7[_0x71d5('0x1d')](0x194);}return _0x31e51f;};}function handleError(_0x468ed6,_0x457339){_0x457339=_0x457339||0x1f4;return function(_0x4cc40d){logger[_0x71d5('0x2f')](_0x4cc40d[_0x71d5('0x30')]);if(_0x4cc40d[_0x71d5('0x31')]){delete _0x4cc40d[_0x71d5('0x31')];}_0x468ed6[_0x71d5('0x1e')](_0x457339)['send'](_0x4cc40d);};}exports[_0x71d5('0x32')]=function(_0x68ada3,_0x66e8fe){var _0x3097bf={},_0x1933ce={},_0x5f13dc={'count':0x0,'rows':[]};var _0x588c3f=_[_0x71d5('0x33')](db[_0x71d5('0x34')][_0x71d5('0x35')],function(_0x59081e){return{'name':_0x59081e[_0x71d5('0x36')],'type':_0x59081e[_0x71d5('0x37')][_0x71d5('0x38')]};});_0x1933ce[_0x71d5('0x39')]=_[_0x71d5('0x33')](_0x588c3f,'name');_0x1933ce[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x68ada3[_0x71d5('0x3a')]);_0x1933ce[_0x71d5('0x3c')]=_[_0x71d5('0x3d')](_0x1933ce['model'],_0x1933ce[_0x71d5('0x3a')]);_0x3097bf[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x1933ce[_0x71d5('0x39')],qs['fields'](_0x68ada3[_0x71d5('0x3a')]['fields']));_0x3097bf[_0x71d5('0x3e')]=_0x3097bf[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x3097bf[_0x71d5('0x3e')]:_0x1933ce['model'];if(!_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x3097bf[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x68ada3[_0x71d5('0x3a')]['limit']);_0x3097bf[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x22')]);}_0x3097bf[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x68ada3['query'][_0x71d5('0x43')]);_0x3097bf['where']=qs[_0x71d5('0x3c')](_[_0x71d5('0x44')](_0x68ada3[_0x71d5('0x3a')],_0x1933ce['filters']),_0x588c3f);if(_0x68ada3[_0x71d5('0x3a')][_0x71d5('0x45')]){_0x3097bf[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x3097bf[_0x71d5('0x46')],{'$or':_[_0x71d5('0x33')](_0x588c3f,function(_0x21571d){if(_0x21571d[_0x71d5('0x37')]!=='VIRTUAL'){var _0x208cc8={};_0x208cc8[_0x21571d[_0x71d5('0x31')]]={'$like':'%'+_0x68ada3['query'][_0x71d5('0x45')]+'%'};return _0x208cc8;}})});}_0x3097bf=_[_0x71d5('0x47')]({},_0x3097bf,_0x68ada3[_0x71d5('0x48')]);var _0x49b34c={'where':_0x3097bf[_0x71d5('0x46')]};return db[_0x71d5('0x34')]['count'](_0x49b34c)[_0x71d5('0x2b')](function(_0x12facc){_0x5f13dc[_0x71d5('0x23')]=_0x12facc;if(_0x68ada3['query'][_0x71d5('0x49')]){_0x3097bf[_0x71d5('0x4a')]=[{'all':!![]}];}return db[_0x71d5('0x34')][_0x71d5('0x4b')](_0x3097bf);})[_0x71d5('0x2b')](function(_0x54900d){_0x5f13dc[_0x71d5('0x4c')]=_0x54900d;return _0x5f13dc;})[_0x71d5('0x2b')](respondWithFilteredResult(_0x66e8fe,_0x3097bf))[_0x71d5('0x4d')](handleError(_0x66e8fe,null));};exports[_0x71d5('0x4e')]=function(_0x51dede,_0x1ed14a){var _0x3289f6={'raw':!![],'where':{'id':_0x51dede['params']['id']}},_0x3225f8={};_0x3225f8[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x34')][_0x71d5('0x35')]);_0x3225f8[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x51dede[_0x71d5('0x3a')]);_0x3225f8[_0x71d5('0x3c')]=_['intersection'](_0x3225f8[_0x71d5('0x39')],_0x3225f8['query']);_0x3289f6[_0x71d5('0x3e')]=_['intersection'](_0x3225f8[_0x71d5('0x39')],qs['fields'](_0x51dede['query'][_0x71d5('0x4f')]));_0x3289f6[_0x71d5('0x3e')]=_0x3289f6[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x3289f6[_0x71d5('0x3e')]:_0x3225f8[_0x71d5('0x39')];if(_0x51dede[_0x71d5('0x3a')][_0x71d5('0x49')]){_0x3289f6[_0x71d5('0x4a')]=[{'all':!![]}];}_0x3289f6=_['merge']({},_0x3289f6,_0x51dede[_0x71d5('0x48')]);return db[_0x71d5('0x34')][_0x71d5('0x50')](_0x3289f6)[_0x71d5('0x2b')](handleEntityNotFound(_0x1ed14a,null))[_0x71d5('0x2b')](respondWithResult(_0x1ed14a,null))['catch'](handleError(_0x1ed14a,null));};exports[_0x71d5('0x51')]=function(_0x1cfa0a,_0x573624){return db[_0x71d5('0x34')][_0x71d5('0x51')](_0x1cfa0a['body'],{})[_0x71d5('0x2b')](function(_0x59fd22){var _0x34ce15=_0x1cfa0a[_0x71d5('0x52')][_0x71d5('0x2c')]({'plain':!![]});if(!_0x34ce15)throw new Error(_0x71d5('0x53'));if(_0x34ce15['role']===_0x71d5('0x52')){var _0x510b32=_0x59fd22[_0x71d5('0x2c')]({'plain':!![]});var _0x484a57='MailQueues';return db['UserProfileSection'][_0x71d5('0x50')]({'where':{'name':_0x484a57,'userProfileId':_0x34ce15[_0x71d5('0x54')]},'raw':!![]})[_0x71d5('0x2b')](function(_0x1e03d5){if(_0x1e03d5&&_0x1e03d5[_0x71d5('0x55')]===0x0){return db[_0x71d5('0x56')][_0x71d5('0x51')]({'name':_0x510b32['name'],'resourceId':_0x510b32['id'],'type':_0x1e03d5[_0x71d5('0x31')],'sectionId':_0x1e03d5['id']},{})['then'](function(){return _0x59fd22;});}else{return _0x59fd22;}})[_0x71d5('0x4d')](function(_0x45a5ac){logger[_0x71d5('0x2f')](_0x71d5('0x57'),_0x45a5ac);throw _0x45a5ac;});}return _0x59fd22;})[_0x71d5('0x2b')](respondWithResult(_0x573624,0xc9))['catch'](handleError(_0x573624,null));};exports[_0x71d5('0x2a')]=function(_0x16bac2,_0x3a8460){if(_0x16bac2[_0x71d5('0x58')]['id']){delete _0x16bac2[_0x71d5('0x58')]['id'];}return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x16bac2[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x3a8460,null))[_0x71d5('0x2b')](saveUpdates(_0x16bac2[_0x71d5('0x58')],null))['then'](respondWithResult(_0x3a8460,null))[_0x71d5('0x4d')](handleError(_0x3a8460,null));};exports[_0x71d5('0x2e')]=function(_0x285aa1,_0x59cd4a){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x285aa1[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x59cd4a,null))[_0x71d5('0x2b')](removeEntity(_0x59cd4a,null))['catch'](handleError(_0x59cd4a,null));};exports[_0x71d5('0x5a')]=function(_0x4350ea,_0x61885d){return db[_0x71d5('0x34')][_0x71d5('0x5a')]()['then'](respondWithResult(_0x61885d,null))['catch'](handleError(_0x61885d,null));};exports['getMembers']=function(_0x5c9b77,_0x597aaf,_0x5af848){var _0x26011f={'raw':!![],'where':{}},_0x5cbe0f={},_0x1e63fe;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x5c9b77['params']['id']}})['then'](handleEntityNotFound(_0x597aaf,null))[_0x71d5('0x2b')](function(_0x4108b0){if(_0x4108b0){_0x1e63fe=_0x4108b0[_0x71d5('0x2c')]({'plain':!![]});_0x5cbe0f[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x5c')]['rawAttributes']);_0x5cbe0f[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x5c9b77['query']);_0x5cbe0f[_0x71d5('0x3c')]=_['intersection'](_0x5cbe0f[_0x71d5('0x39')],_0x5cbe0f[_0x71d5('0x3a')]);_0x26011f[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x5cbe0f[_0x71d5('0x39')],qs[_0x71d5('0x4f')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x4f')]));_0x26011f[_0x71d5('0x3e')]=_0x26011f[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x26011f[_0x71d5('0x3e')]:_0x5cbe0f[_0x71d5('0x39')];if(!_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x26011f[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x21')]);_0x26011f[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x5c9b77[_0x71d5('0x3a')][_0x71d5('0x22')]);}_0x26011f[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x5c9b77[_0x71d5('0x3a')]['sort']);_0x26011f[_0x71d5('0x46')]=qs['filters'](_[_0x71d5('0x44')](_0x5c9b77[_0x71d5('0x3a')],_0x5cbe0f[_0x71d5('0x3c')]));_0x26011f['where'][_0x71d5('0x5d')]=_0x4108b0['id'];if(_0x5c9b77['query'][_0x71d5('0x45')]){_0x26011f[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x26011f['where'],{'$or':_['map'](_0x26011f[_0x71d5('0x3e')],function(_0x1d0bad){var _0x4d1a5e={};_0x4d1a5e[_0x1d0bad]={'$like':'%'+_0x5c9b77[_0x71d5('0x3a')]['filter']+'%'};return _0x4d1a5e;})});}_0x26011f=_[_0x71d5('0x47')]({},_0x26011f,_0x5c9b77[_0x71d5('0x48')]);return db[_0x71d5('0x5c')]['findAll'](_0x26011f);}})[_0x71d5('0x2b')](function(_0x13c59d){if(_0x13c59d){return db[_0x71d5('0x5e')][_0x71d5('0x5f')]({'where':{'id':_[_0x71d5('0x33')](_0x13c59d,_0x71d5('0x60')),'role':'agent'},'attributes':['id',_0x71d5('0x31'),_0x71d5('0x61'),'updatedAt',_0x71d5('0x62')]});}})[_0x71d5('0x2b')](function(_0x69df6a){if(_0x69df6a){return{'count':_0x69df6a['count'],'rows':_[_0x71d5('0x33')](_0x69df6a[_0x71d5('0x4c')],function(_0x16ceb3){return{'membername':_0x16ceb3[_0x71d5('0x31')],'UserId':_0x16ceb3['id'],'queue_name':_0x1e63fe[_0x71d5('0x31')],'MailQueueId':_0x1e63fe['id'],'interface':util['format']('%s/%s',_0x71d5('0x63'),_0x16ceb3[_0x71d5('0x31')]),'penalty':0x0,'paused':_0x16ceb3[_0x71d5('0x61')],'createdAt':_0x16ceb3[_0x71d5('0x62')],'updatedAt':_0x16ceb3[_0x71d5('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x71d5('0x2b')](respondWithFilteredResult(_0x597aaf,_0x26011f))[_0x71d5('0x4d')](handleError(_0x597aaf,null));};exports['getTeams']=function(_0x2b19db,_0x5c9205,_0x374bdd){var _0xc1d692={};var _0x473b4e={};var _0x1329c2;var _0x59dcb8;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x2b19db[_0x71d5('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c9205,null))[_0x71d5('0x2b')](function(_0x36cb07){if(_0x36cb07){_0x1329c2=_0x36cb07;_0x473b4e[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x65')][_0x71d5('0x35')]);_0x473b4e[_0x71d5('0x3a')]=_[_0x71d5('0x3b')](_0x2b19db[_0x71d5('0x3a')]);_0x473b4e['filters']=_[_0x71d5('0x3d')](_0x473b4e[_0x71d5('0x39')],_0x473b4e[_0x71d5('0x3a')]);_0xc1d692[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x473b4e['model'],qs[_0x71d5('0x4f')](_0x2b19db['query']['fields']));_0xc1d692[_0x71d5('0x3e')]=_0xc1d692[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0xc1d692[_0x71d5('0x3e')]:_0x473b4e[_0x71d5('0x39')];_0xc1d692[_0x71d5('0x42')]=qs[_0x71d5('0x43')](_0x2b19db['query'][_0x71d5('0x43')]);_0xc1d692[_0x71d5('0x46')]=qs[_0x71d5('0x3c')](_[_0x71d5('0x44')](_0x2b19db[_0x71d5('0x3a')],_0x473b4e['filters']));if(_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x45')]){_0xc1d692[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0xc1d692[_0x71d5('0x46')],{'$or':_['map'](_0xc1d692[_0x71d5('0x3e')],function(_0x24fad6){var _0x271295={};_0x271295[_0x24fad6]={'$like':'%'+_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x45')]+'%'};return _0x271295;})});}_0xc1d692=_['merge']({},_0xc1d692,_0x2b19db[_0x71d5('0x48')]);return _0x1329c2[_0x71d5('0x66')](_0xc1d692);}})[_0x71d5('0x2b')](function(_0x218e3f){if(_0x218e3f){_0x59dcb8=_0x218e3f[_0x71d5('0x3f')];if(!_0x2b19db['query'][_0x71d5('0x40')](_0x71d5('0x41'))){_0xc1d692['limit']=qs[_0x71d5('0x21')](_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x21')]);_0xc1d692[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x2b19db[_0x71d5('0x3a')][_0x71d5('0x22')]);}return _0x1329c2['getTeams'](_0xc1d692);}})['then'](function(_0xce14df){if(_0xce14df){return _0xce14df?{'count':_0x59dcb8,'rows':_0xce14df}:null;}})[_0x71d5('0x2b')](respondWithResult(_0x5c9205,null))[_0x71d5('0x4d')](handleError(_0x5c9205,null));};exports['addTeams']=function(_0x464556,_0x288518,_0xb8f547){var _0x354597=_0x464556[_0x71d5('0x58')][_0x71d5('0x67')];return db[_0x71d5('0x65')][_0x71d5('0x4b')]({'where':{'id':_0x354597},'attributes':['id'],'include':[{'model':db[_0x71d5('0x5e')],'as':'Agents','attributes':['id','name',_0x71d5('0x68'),'voicePause',_0x71d5('0x69')],'raw':!![]}]})['then'](function(_0x1554e3){if(_0x1554e3){var _0x16362d=_[_0x71d5('0x6a')](_0x1554e3,function(_0x5d3446){var _0x36d024=_0x5d3446['get']({'plain':!![]});return _0x36d024[_0x71d5('0x6b')];});return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x464556[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](function(_0x2b7473){return db[_0x71d5('0x6c')][_0x71d5('0x6d')](function(_0x4a877d){return _0x2b7473['addTeams'](_0x354597,{'transaction':_0x4a877d})['then'](function(){return BPromise[_0x71d5('0x6e')](_0x16362d,function(_0x5857a2){return db['UserMailQueue'][_0x71d5('0x6f')]({'where':{'UserId':_0x5857a2['id'],'MailQueueId':_0x464556['params']['id']},'transaction':_0x4a877d});});})[_0x71d5('0x2b')](function(){_0x16362d[_0x71d5('0x70')](function(_0x49b671){socket[_0x71d5('0x71')](_0x71d5('0x72'),{'UserId':_0x49b671['id'],'MailQueueId':_0x2b7473['id']});});});});});}})['then'](respondWithStatusCode(_0x288518,null))['catch'](handleError(_0x288518,null));};exports[_0x71d5('0x73')]=function(_0x39bfa0,_0x1c3f85,_0x15b6af){return db[_0x71d5('0x65')][_0x71d5('0x4b')]({'where':{'id':_0x39bfa0[_0x71d5('0x3a')][_0x71d5('0x67')]},'attributes':['id'],'include':[{'model':db[_0x71d5('0x5e')],'as':_0x71d5('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x71d5('0x2b')](handleEntityNotFound(_0x1c3f85,null))[_0x71d5('0x2b')](function(_0x1d1fe4){var _0x37afe8=_[_0x71d5('0x33')](_0x1d1fe4,'id');var _0x361dc8=[];var _0x3482ab=[];var _0x10fcb7=squel[_0x71d5('0x74')]();_0x10fcb7['field'](_0x71d5('0x75'))[_0x71d5('0x76')]('team_has_mail_queues','tq')[_0x71d5('0x77')]('user_has_teams','ut',_0x71d5('0x78'))['where']('MailQueueId\x20=\x20?',_0x39bfa0[_0x71d5('0x59')]['id']);for(var _0x4e538b=0x0;_0x4e538b<_0x1d1fe4[_0x71d5('0x3f')];_0x4e538b+=0x1){let _0x3eddac=_0x1d1fe4[_0x4e538b];for(var _0x132b30=0x0;_0x132b30<_0x3eddac['Agents']['length'];_0x132b30+=0x1){let _0x1fe936=_0x3eddac[_0x71d5('0x6b')][_0x132b30];var _0x1642cd=_0x10fcb7['clone']();_0x1642cd['where'](_0x71d5('0x79'),_0x1fe936['id']);_0x3482ab[_0x71d5('0x7a')](db[_0x71d5('0x6c')][_0x71d5('0x3a')](_0x1642cd[_0x71d5('0x7b')](),{'type':db['sequelize'][_0x71d5('0x7c')][_0x71d5('0x7d')]})[_0x71d5('0x2b')](function(_0x279dc8){if(_0x279dc8['length']===0x1){return _0x1fe936['id'];}else{var _0x2f56bb=_[_0x71d5('0x7e')](_[_0x71d5('0x33')](_0x279dc8,'TeamId'),function(_0x4ba5dd){return _[_0x71d5('0x7f')](_0x37afe8,_0x4ba5dd);});if(_0x2f56bb){return _0x1fe936['id'];}}}));}}return BPromise[_0x71d5('0x80')](_0x3482ab)[_0x71d5('0x2b')](function(_0x4b7369){_0x361dc8=_(_0x361dc8)[_0x71d5('0x81')](_0x4b7369)[_0x71d5('0x82')]()['value']();return db['MailQueue']['find']({'where':{'id':_0x39bfa0[_0x71d5('0x59')]['id']}})['then'](function(_0x409b8a){return db['sequelize']['transaction'](function(_0xe43445){return _0x409b8a['removeTeams'](_0x39bfa0['query']['ids'],{'transaction':_0xe43445})['then'](function(){if(!_[_0x71d5('0x83')](_0x361dc8)){return _0x409b8a[_0x71d5('0x84')](_0x361dc8,{'transaction':_0xe43445});}})[_0x71d5('0x2b')](function(){_0x361dc8[_0x71d5('0x70')](function(_0x2612f2){socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':_0x2612f2,'MailQueueId':_0x409b8a['id']});});});});});});})['then'](respondWithStatusCode(_0x1c3f85,null))[_0x71d5('0x4d')](handleError(_0x1c3f85,null));};exports['addAgents']=function(_0x5418b0,_0x44933b,_0xe871fd){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0x5418b0[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x44933b,null))[_0x71d5('0x2b')](function(_0x34ce29){if(_0x34ce29){return _0x34ce29['addAgents'](_0x5418b0[_0x71d5('0x58')]['ids'],_[_0x71d5('0x86')](_0x5418b0['body'],[_0x71d5('0x67'),'id'])||{})[_0x71d5('0x87')](function(_0x1518c3){for(var _0x5b16f6=0x0;_0x5b16f6<_0x5418b0[_0x71d5('0x58')][_0x71d5('0x67')]['length'];_0x5b16f6+=0x1){socket[_0x71d5('0x71')](_0x71d5('0x72'),{'UserId':Number(_0x5418b0['body'][_0x71d5('0x67')][_0x5b16f6]),'MailQueueId':Number(_0x5418b0[_0x71d5('0x59')]['id'])});}return _0x1518c3;});}})[_0x71d5('0x2b')](respondWithResult(_0x44933b,null))['catch'](handleError(_0x44933b,null));};exports[_0x71d5('0x84')]=function(_0xc4f059,_0x4632e3,_0x1c453f){return db[_0x71d5('0x34')][_0x71d5('0x50')]({'where':{'id':_0xc4f059['params']['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x4632e3,null))[_0x71d5('0x2b')](function(_0x59512f){if(_0x59512f){return _0x59512f['removeAgents'](_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')])[_0x71d5('0x2b')](function(){if(_[_0x71d5('0x88')](_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')])){for(var _0x886c05=0x0;_0x886c05<_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')]['length'];_0x886c05+=0x1){socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':Number(_0xc4f059['query'][_0x71d5('0x67')][_0x886c05]),'MailQueueId':Number(_0xc4f059[_0x71d5('0x59')]['id'])});}}else{socket[_0x71d5('0x71')](_0x71d5('0x85'),{'UserId':Number(_0xc4f059[_0x71d5('0x3a')][_0x71d5('0x67')]),'MailQueueId':Number(_0xc4f059[_0x71d5('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4632e3,null))['catch'](handleError(_0x4632e3,null));};exports[_0x71d5('0x89')]=function(_0x1c6de2,_0x5e438d,_0x25d959){var _0x4468eb={};var _0x4d2a75={};var _0x36ba09;var _0x15b908;return db[_0x71d5('0x34')][_0x71d5('0x5b')]({'where':{'id':_0x1c6de2[_0x71d5('0x59')]['id']}})[_0x71d5('0x2b')](handleEntityNotFound(_0x5e438d,null))[_0x71d5('0x2b')](function(_0x3963eb){if(_0x3963eb){_0x36ba09=_0x3963eb;_0x4d2a75[_0x71d5('0x39')]=_[_0x71d5('0x3b')](db[_0x71d5('0x5e')][_0x71d5('0x35')]);_0x4d2a75[_0x71d5('0x3a')]=_['keys'](_0x1c6de2[_0x71d5('0x3a')]);_0x4d2a75[_0x71d5('0x3c')]=_['intersection'](_0x4d2a75['model'],_0x4d2a75[_0x71d5('0x3a')]);_0x4468eb[_0x71d5('0x3e')]=_[_0x71d5('0x3d')](_0x4d2a75[_0x71d5('0x39')],qs[_0x71d5('0x4f')](_0x1c6de2['query']['fields']));_0x4468eb[_0x71d5('0x3e')]=_0x4468eb[_0x71d5('0x3e')][_0x71d5('0x3f')]?_0x4468eb[_0x71d5('0x3e')]:_0x4d2a75[_0x71d5('0x39')];_0x4468eb['order']=qs['sort'](_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x43')]);_0x4468eb['where']=qs['filters'](_[_0x71d5('0x44')](_0x1c6de2['query'],_0x4d2a75[_0x71d5('0x3c')]));if(_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x45')]){_0x4468eb[_0x71d5('0x46')]=_[_0x71d5('0x47')](_0x4468eb[_0x71d5('0x46')],{'$or':_['map'](_0x4468eb[_0x71d5('0x3e')],function(_0x142da1){var _0x23afad={};_0x23afad[_0x142da1]={'$like':'%'+_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x45')]+'%'};return _0x23afad;})});}_0x4468eb=_['merge']({},_0x4468eb,_0x1c6de2[_0x71d5('0x48')]);return _0x36ba09[_0x71d5('0x89')](_0x4468eb);}})[_0x71d5('0x2b')](function(_0x284626){if(_0x284626){_0x15b908=_0x284626[_0x71d5('0x3f')];if(!_0x1c6de2[_0x71d5('0x3a')][_0x71d5('0x40')](_0x71d5('0x41'))){_0x4468eb[_0x71d5('0x21')]=qs[_0x71d5('0x21')](_0x1c6de2['query'][_0x71d5('0x21')]);_0x4468eb[_0x71d5('0x22')]=qs[_0x71d5('0x22')](_0x1c6de2[_0x71d5('0x3a')]['offset']);}return _0x36ba09[_0x71d5('0x89')](_0x4468eb);}})['then'](function(_0x220f38){if(_0x220f38){return _0x220f38?{'count':_0x15b908,'rows':_0x220f38}:null;}})[_0x71d5('0x2b')](respondWithResult(_0x5e438d,null))[_0x71d5('0x4d')](handleError(_0x5e438d,null));}; \ No newline at end of file +var _0x2f68=['team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','spread','removeAgents','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','get','MailQueues','UserProfileResource','then','end','sendStatus','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','sort','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','hasOwnProperty','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from'];(function(_0x4fa916,_0x3ec36a){var _0x576439=function(_0x5692e0){while(--_0x5692e0){_0x4fa916['push'](_0x4fa916['shift']());}};_0x576439(++_0x3ec36a);}(_0x2f68,0x9a));var _0x82f6=function(_0x17c303,_0x1722ee){_0x17c303=_0x17c303-0x0;var _0x52477b=_0x2f68[_0x17c303];return _0x52477b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];config[_0x82f6('0x15')]=_['defaults'](config[_0x82f6('0x15')],{'host':_0x82f6('0x16'),'port':0x18eb});var socket=require(_0x82f6('0x17'))(new Redis(config[_0x82f6('0x15')]));require(_0x82f6('0x18'))[_0x82f6('0x19')](socket);function respondWithStatusCode(_0x115c7b,_0x171815){_0x171815=_0x171815||0xcc;return function(_0x1e7cbc){if(_0x1e7cbc){return _0x115c7b['sendStatus'](_0x171815);}return _0x115c7b[_0x82f6('0x1a')](_0x171815)['end']();};}function respondWithResult(_0x249222,_0x1d0263){_0x1d0263=_0x1d0263||0xc8;return function(_0x31b4fb){if(_0x31b4fb){return _0x249222[_0x82f6('0x1a')](_0x1d0263)[_0x82f6('0x1b')](_0x31b4fb);}};}function respondWithFilteredResult(_0x2326ae,_0x326378){return function(_0xcbc95f){if(_0xcbc95f){var _0x4072f0=typeof _0x326378[_0x82f6('0x1c')]===_0x82f6('0x1d')&&typeof _0x326378[_0x82f6('0x1e')]===_0x82f6('0x1d');var _0x4fe226=_0xcbc95f[_0x82f6('0x1f')];var _0x4c6640=_0x4072f0?0x0:_0x326378[_0x82f6('0x1c')];var _0x45b149=_0x4072f0?_0xcbc95f['count']:_0x326378[_0x82f6('0x1c')]+_0x326378[_0x82f6('0x1e')];var _0x46713a;if(_0x45b149>=_0x4fe226){_0x45b149=_0x4fe226;_0x46713a=0xc8;}else{_0x46713a=0xce;}_0x2326ae[_0x82f6('0x1a')](_0x46713a);return _0x2326ae['set'](_0x82f6('0x20'),_0x4c6640+'-'+_0x45b149+'/'+_0x4fe226)['json'](_0xcbc95f);}return null;};}function patchUpdates(_0x8668bb){return function(_0x2a0ce6){try{jsonpatch['apply'](_0x2a0ce6,_0x8668bb,!![]);}catch(_0x516deb){return BPromise[_0x82f6('0x21')](_0x516deb);}return _0x2a0ce6[_0x82f6('0x22')]();};}function saveUpdates(_0x4c57c5,_0x5a5059){return function(_0x9f2272){if(_0x9f2272){return _0x9f2272[_0x82f6('0x23')](_0x4c57c5)['then'](function(_0xfd8b68){return _0xfd8b68;});}return null;};}function removeEntity(_0x304e83,_0x5037f8){return function(_0x57ac0d){if(_0x57ac0d){return _0x57ac0d[_0x82f6('0x24')]()['then'](function(){var _0x469b6b=_0x57ac0d[_0x82f6('0x25')]({'plain':!![]});var _0x54ce11=_0x82f6('0x26');return db[_0x82f6('0x27')][_0x82f6('0x24')]({'where':{'type':_0x54ce11,'resourceId':_0x469b6b['id']}})[_0x82f6('0x28')](function(){return _0x57ac0d;});})['then'](function(){_0x304e83[_0x82f6('0x1a')](0xcc)[_0x82f6('0x29')]();});}};}function handleEntityNotFound(_0x14a309,_0x400137){return function(_0x271c28){if(!_0x271c28){_0x14a309[_0x82f6('0x2a')](0x194);}return _0x271c28;};}function handleError(_0x27e473,_0x475d91){_0x475d91=_0x475d91||0x1f4;return function(_0x1e1aa4){logger[_0x82f6('0x2b')](_0x1e1aa4[_0x82f6('0x2c')]);if(_0x1e1aa4[_0x82f6('0x2d')]){delete _0x1e1aa4[_0x82f6('0x2d')];}_0x27e473[_0x82f6('0x1a')](_0x475d91)['send'](_0x1e1aa4);};}exports[_0x82f6('0x2e')]=function(_0x2c764f,_0x418f34){var _0x5a51b4={},_0x36f37a={},_0x3807c0={'count':0x0,'rows':[]};var _0x831131=_[_0x82f6('0x2f')](db[_0x82f6('0x30')][_0x82f6('0x31')],function(_0x37025c){return{'name':_0x37025c[_0x82f6('0x32')],'type':_0x37025c[_0x82f6('0x33')][_0x82f6('0x34')]};});_0x36f37a[_0x82f6('0x35')]=_[_0x82f6('0x2f')](_0x831131,_0x82f6('0x2d'));_0x36f37a[_0x82f6('0x36')]=_['keys'](_0x2c764f[_0x82f6('0x36')]);_0x36f37a[_0x82f6('0x37')]=_[_0x82f6('0x38')](_0x36f37a[_0x82f6('0x35')],_0x36f37a[_0x82f6('0x36')]);_0x5a51b4[_0x82f6('0x39')]=_[_0x82f6('0x38')](_0x36f37a[_0x82f6('0x35')],qs[_0x82f6('0x3a')](_0x2c764f[_0x82f6('0x36')][_0x82f6('0x3a')]));_0x5a51b4[_0x82f6('0x39')]=_0x5a51b4[_0x82f6('0x39')][_0x82f6('0x3b')]?_0x5a51b4['attributes']:_0x36f37a[_0x82f6('0x35')];if(!_0x2c764f['query']['hasOwnProperty'](_0x82f6('0x3c'))){_0x5a51b4[_0x82f6('0x1e')]=qs['limit'](_0x2c764f[_0x82f6('0x36')][_0x82f6('0x1e')]);_0x5a51b4[_0x82f6('0x1c')]=qs['offset'](_0x2c764f[_0x82f6('0x36')]['offset']);}_0x5a51b4[_0x82f6('0x3d')]=qs['sort'](_0x2c764f[_0x82f6('0x36')]['sort']);_0x5a51b4[_0x82f6('0x3e')]=qs[_0x82f6('0x37')](_['pick'](_0x2c764f[_0x82f6('0x36')],_0x36f37a[_0x82f6('0x37')]),_0x831131);if(_0x2c764f[_0x82f6('0x36')][_0x82f6('0x3f')]){_0x5a51b4['where']=_[_0x82f6('0x40')](_0x5a51b4[_0x82f6('0x3e')],{'$or':_[_0x82f6('0x2f')](_0x831131,function(_0x725b33){if(_0x725b33['type']!==_0x82f6('0x41')){var _0x42b900={};_0x42b900[_0x725b33['name']]={'$like':'%'+_0x2c764f[_0x82f6('0x36')][_0x82f6('0x3f')]+'%'};return _0x42b900;}})});}_0x5a51b4=_[_0x82f6('0x40')]({},_0x5a51b4,_0x2c764f[_0x82f6('0x42')]);var _0xc3e250={'where':_0x5a51b4['where']};return db[_0x82f6('0x30')]['count'](_0xc3e250)[_0x82f6('0x28')](function(_0x38e82d){_0x3807c0[_0x82f6('0x1f')]=_0x38e82d;if(_0x2c764f[_0x82f6('0x36')][_0x82f6('0x43')]){_0x5a51b4[_0x82f6('0x44')]=[{'all':!![]}];}return db[_0x82f6('0x30')]['findAll'](_0x5a51b4);})[_0x82f6('0x28')](function(_0x297cda){_0x3807c0[_0x82f6('0x45')]=_0x297cda;return _0x3807c0;})[_0x82f6('0x28')](respondWithFilteredResult(_0x418f34,_0x5a51b4))['catch'](handleError(_0x418f34,null));};exports[_0x82f6('0x46')]=function(_0x4797af,_0x390bfc){var _0x186f5d={'raw':!![],'where':{'id':_0x4797af[_0x82f6('0x47')]['id']}},_0x159750={};_0x159750[_0x82f6('0x35')]=_[_0x82f6('0x48')](db['MailQueue'][_0x82f6('0x31')]);_0x159750[_0x82f6('0x36')]=_[_0x82f6('0x48')](_0x4797af[_0x82f6('0x36')]);_0x159750[_0x82f6('0x37')]=_[_0x82f6('0x38')](_0x159750[_0x82f6('0x35')],_0x159750[_0x82f6('0x36')]);_0x186f5d['attributes']=_[_0x82f6('0x38')](_0x159750[_0x82f6('0x35')],qs['fields'](_0x4797af[_0x82f6('0x36')]['fields']));_0x186f5d[_0x82f6('0x39')]=_0x186f5d['attributes'][_0x82f6('0x3b')]?_0x186f5d[_0x82f6('0x39')]:_0x159750[_0x82f6('0x35')];if(_0x4797af[_0x82f6('0x36')][_0x82f6('0x43')]){_0x186f5d[_0x82f6('0x44')]=[{'all':!![]}];}_0x186f5d=_['merge']({},_0x186f5d,_0x4797af[_0x82f6('0x42')]);return db[_0x82f6('0x30')]['find'](_0x186f5d)['then'](handleEntityNotFound(_0x390bfc,null))[_0x82f6('0x28')](respondWithResult(_0x390bfc,null))[_0x82f6('0x49')](handleError(_0x390bfc,null));};exports[_0x82f6('0x4a')]=function(_0x596360,_0x1f7abc){return db[_0x82f6('0x30')][_0x82f6('0x4a')](_0x596360[_0x82f6('0x4b')],{})['then'](function(_0x495400){var _0x1695ea=_0x596360[_0x82f6('0x4c')][_0x82f6('0x25')]({'plain':!![]});if(!_0x1695ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1695ea[_0x82f6('0x4d')]===_0x82f6('0x4c')){var _0x4bc646=_0x495400['get']({'plain':!![]});var _0x4fa2ca=_0x82f6('0x26');return db['UserProfileSection'][_0x82f6('0x4e')]({'where':{'name':_0x4fa2ca,'userProfileId':_0x1695ea['userProfileId']},'raw':!![]})[_0x82f6('0x28')](function(_0x4f69de){if(_0x4f69de&&_0x4f69de[_0x82f6('0x4f')]===0x0){return db['UserProfileResource'][_0x82f6('0x4a')]({'name':_0x4bc646[_0x82f6('0x2d')],'resourceId':_0x4bc646['id'],'type':_0x4f69de[_0x82f6('0x2d')],'sectionId':_0x4f69de['id']},{})[_0x82f6('0x28')](function(){return _0x495400;});}else{return _0x495400;}})[_0x82f6('0x49')](function(_0x45f2f9){logger['error'](_0x82f6('0x50'),_0x45f2f9);throw _0x45f2f9;});}return _0x495400;})[_0x82f6('0x28')](respondWithResult(_0x1f7abc,0xc9))[_0x82f6('0x49')](handleError(_0x1f7abc,null));};exports['update']=function(_0x56a28a,_0x13406f){if(_0x56a28a[_0x82f6('0x4b')]['id']){delete _0x56a28a[_0x82f6('0x4b')]['id'];}return db[_0x82f6('0x30')]['find']({'where':{'id':_0x56a28a[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](handleEntityNotFound(_0x13406f,null))[_0x82f6('0x28')](saveUpdates(_0x56a28a['body'],null))['then'](respondWithResult(_0x13406f,null))['catch'](handleError(_0x13406f,null));};exports[_0x82f6('0x24')]=function(_0x310c9b,_0x221cfc){return db[_0x82f6('0x30')][_0x82f6('0x4e')]({'where':{'id':_0x310c9b[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](handleEntityNotFound(_0x221cfc,null))[_0x82f6('0x28')](removeEntity(_0x221cfc,null))['catch'](handleError(_0x221cfc,null));};exports[_0x82f6('0x51')]=function(_0x94aed4,_0x12a5b9){return db[_0x82f6('0x30')]['describe']()['then'](respondWithResult(_0x12a5b9,null))[_0x82f6('0x49')](handleError(_0x12a5b9,null));};exports[_0x82f6('0x52')]=function(_0x539e44,_0x22522f,_0xa12f6e){var _0x404d09={'raw':!![],'where':{}},_0x5b3aaa={},_0x32fa83;return db[_0x82f6('0x30')][_0x82f6('0x53')]({'where':{'id':_0x539e44[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](handleEntityNotFound(_0x22522f,null))[_0x82f6('0x28')](function(_0x5461c4){if(_0x5461c4){_0x32fa83=_0x5461c4[_0x82f6('0x25')]({'plain':!![]});_0x5b3aaa[_0x82f6('0x35')]=_[_0x82f6('0x48')](db[_0x82f6('0x54')][_0x82f6('0x31')]);_0x5b3aaa['query']=_[_0x82f6('0x48')](_0x539e44[_0x82f6('0x36')]);_0x5b3aaa[_0x82f6('0x37')]=_[_0x82f6('0x38')](_0x5b3aaa[_0x82f6('0x35')],_0x5b3aaa[_0x82f6('0x36')]);_0x404d09[_0x82f6('0x39')]=_[_0x82f6('0x38')](_0x5b3aaa['model'],qs[_0x82f6('0x3a')](_0x539e44['query'][_0x82f6('0x3a')]));_0x404d09[_0x82f6('0x39')]=_0x404d09['attributes'][_0x82f6('0x3b')]?_0x404d09[_0x82f6('0x39')]:_0x5b3aaa[_0x82f6('0x35')];if(!_0x539e44['query']['hasOwnProperty'](_0x82f6('0x3c'))){_0x404d09[_0x82f6('0x1e')]=qs['limit'](_0x539e44['query'][_0x82f6('0x1e')]);_0x404d09[_0x82f6('0x1c')]=qs[_0x82f6('0x1c')](_0x539e44[_0x82f6('0x36')][_0x82f6('0x1c')]);}_0x404d09[_0x82f6('0x3d')]=qs[_0x82f6('0x55')](_0x539e44[_0x82f6('0x36')][_0x82f6('0x55')]);_0x404d09[_0x82f6('0x3e')]=qs[_0x82f6('0x37')](_[_0x82f6('0x56')](_0x539e44['query'],_0x5b3aaa[_0x82f6('0x37')]));_0x404d09[_0x82f6('0x3e')][_0x82f6('0x57')]=_0x5461c4['id'];if(_0x539e44[_0x82f6('0x36')][_0x82f6('0x3f')]){_0x404d09['where']=_[_0x82f6('0x40')](_0x404d09[_0x82f6('0x3e')],{'$or':_[_0x82f6('0x2f')](_0x404d09['attributes'],function(_0x9b60c8){var _0x192dc7={};_0x192dc7[_0x9b60c8]={'$like':'%'+_0x539e44[_0x82f6('0x36')][_0x82f6('0x3f')]+'%'};return _0x192dc7;})});}_0x404d09=_[_0x82f6('0x40')]({},_0x404d09,_0x539e44[_0x82f6('0x42')]);return db[_0x82f6('0x54')]['findAll'](_0x404d09);}})[_0x82f6('0x28')](function(_0x5d3d27){if(_0x5d3d27){return db[_0x82f6('0x58')][_0x82f6('0x59')]({'where':{'id':_[_0x82f6('0x2f')](_0x5d3d27,_0x82f6('0x5a')),'role':_0x82f6('0x5b')},'attributes':['id',_0x82f6('0x2d'),_0x82f6('0x5c'),_0x82f6('0x5d'),_0x82f6('0x5e')]});}})['then'](function(_0x1a1a46){if(_0x1a1a46){return{'count':_0x1a1a46[_0x82f6('0x1f')],'rows':_[_0x82f6('0x2f')](_0x1a1a46[_0x82f6('0x45')],function(_0x36599f){return{'membername':_0x36599f[_0x82f6('0x2d')],'UserId':_0x36599f['id'],'queue_name':_0x32fa83['name'],'MailQueueId':_0x32fa83['id'],'interface':util[_0x82f6('0x5f')](_0x82f6('0x60'),'SIP',_0x36599f['name']),'penalty':0x0,'paused':_0x36599f[_0x82f6('0x5c')],'createdAt':_0x36599f[_0x82f6('0x5e')],'updatedAt':_0x36599f[_0x82f6('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x82f6('0x28')](respondWithFilteredResult(_0x22522f,_0x404d09))[_0x82f6('0x49')](handleError(_0x22522f,null));};exports[_0x82f6('0x61')]=function(_0x5bf933,_0x2e6b6e,_0x5a325f){var _0x44d422={};var _0x483442={};var _0x348c24;var _0x54fbda;return db[_0x82f6('0x30')][_0x82f6('0x53')]({'where':{'id':_0x5bf933[_0x82f6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e6b6e,null))[_0x82f6('0x28')](function(_0x5e8d8e){if(_0x5e8d8e){_0x348c24=_0x5e8d8e;_0x483442[_0x82f6('0x35')]=_[_0x82f6('0x48')](db[_0x82f6('0x62')]['rawAttributes']);_0x483442[_0x82f6('0x36')]=_[_0x82f6('0x48')](_0x5bf933[_0x82f6('0x36')]);_0x483442['filters']=_['intersection'](_0x483442[_0x82f6('0x35')],_0x483442[_0x82f6('0x36')]);_0x44d422[_0x82f6('0x39')]=_[_0x82f6('0x38')](_0x483442[_0x82f6('0x35')],qs[_0x82f6('0x3a')](_0x5bf933[_0x82f6('0x36')][_0x82f6('0x3a')]));_0x44d422['attributes']=_0x44d422[_0x82f6('0x39')][_0x82f6('0x3b')]?_0x44d422['attributes']:_0x483442[_0x82f6('0x35')];_0x44d422[_0x82f6('0x3d')]=qs[_0x82f6('0x55')](_0x5bf933['query'][_0x82f6('0x55')]);_0x44d422[_0x82f6('0x3e')]=qs[_0x82f6('0x37')](_[_0x82f6('0x56')](_0x5bf933['query'],_0x483442[_0x82f6('0x37')]));if(_0x5bf933[_0x82f6('0x36')][_0x82f6('0x3f')]){_0x44d422[_0x82f6('0x3e')]=_[_0x82f6('0x40')](_0x44d422[_0x82f6('0x3e')],{'$or':_['map'](_0x44d422[_0x82f6('0x39')],function(_0xaeebf0){var _0x1ce9bb={};_0x1ce9bb[_0xaeebf0]={'$like':'%'+_0x5bf933[_0x82f6('0x36')][_0x82f6('0x3f')]+'%'};return _0x1ce9bb;})});}_0x44d422=_['merge']({},_0x44d422,_0x5bf933[_0x82f6('0x42')]);return _0x348c24['getTeams'](_0x44d422);}})[_0x82f6('0x28')](function(_0x1d545a){if(_0x1d545a){_0x54fbda=_0x1d545a[_0x82f6('0x3b')];if(!_0x5bf933[_0x82f6('0x36')][_0x82f6('0x63')](_0x82f6('0x3c'))){_0x44d422[_0x82f6('0x1e')]=qs['limit'](_0x5bf933[_0x82f6('0x36')][_0x82f6('0x1e')]);_0x44d422['offset']=qs[_0x82f6('0x1c')](_0x5bf933[_0x82f6('0x36')][_0x82f6('0x1c')]);}return _0x348c24['getTeams'](_0x44d422);}})[_0x82f6('0x28')](function(_0x4a25f1){if(_0x4a25f1){return _0x4a25f1?{'count':_0x54fbda,'rows':_0x4a25f1}:null;}})[_0x82f6('0x28')](respondWithResult(_0x2e6b6e,null))[_0x82f6('0x49')](handleError(_0x2e6b6e,null));};exports['addTeams']=function(_0x450f3e,_0x195141,_0x43d544){var _0x7998e1=_0x450f3e['body'][_0x82f6('0x64')];return db['Team']['findAll']({'where':{'id':_0x7998e1},'attributes':['id'],'include':[{'model':db[_0x82f6('0x58')],'as':_0x82f6('0x65'),'attributes':['id',_0x82f6('0x2d'),_0x82f6('0x66'),_0x82f6('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x470b2c){if(_0x470b2c){var _0x577165=_[_0x82f6('0x68')](_0x470b2c,function(_0x114b4b){var _0x8d8ee1=_0x114b4b['get']({'plain':!![]});return _0x8d8ee1[_0x82f6('0x65')];});return db[_0x82f6('0x30')][_0x82f6('0x4e')]({'where':{'id':_0x450f3e[_0x82f6('0x47')]['id']}})['then'](function(_0x120eae){return db[_0x82f6('0x69')][_0x82f6('0x6a')](function(_0x3a10bf){return _0x120eae['addTeams'](_0x7998e1,{'transaction':_0x3a10bf})['then'](function(){return BPromise[_0x82f6('0x6b')](_0x577165,function(_0x259008){return db[_0x82f6('0x54')][_0x82f6('0x6c')]({'where':{'UserId':_0x259008['id'],'MailQueueId':_0x450f3e[_0x82f6('0x47')]['id']},'transaction':_0x3a10bf});});})[_0x82f6('0x28')](function(){_0x577165[_0x82f6('0x6d')](function(_0x1bfc05){socket[_0x82f6('0x6e')](_0x82f6('0x6f'),{'UserId':_0x1bfc05['id'],'MailQueueId':_0x120eae['id']});});});});});}})['then'](respondWithStatusCode(_0x195141,null))['catch'](handleError(_0x195141,null));};exports[_0x82f6('0x70')]=function(_0x33a8ab,_0x6e9e55,_0x3b4fcf){return db[_0x82f6('0x62')]['findAll']({'where':{'id':_0x33a8ab[_0x82f6('0x36')][_0x82f6('0x64')]},'attributes':['id'],'include':[{'model':db[_0x82f6('0x58')],'as':_0x82f6('0x65'),'attributes':['id'],'raw':!![]}]})[_0x82f6('0x28')](handleEntityNotFound(_0x6e9e55,null))['then'](function(_0x5dd019){var _0x3df195=_['map'](_0x5dd019,'id');var _0x344db8=[];var _0x2825c5=[];var _0x1a6d16=squel[_0x82f6('0x71')]();_0x1a6d16[_0x82f6('0x72')]('tq.TeamId')[_0x82f6('0x73')](_0x82f6('0x74'),'tq')[_0x82f6('0x75')]('user_has_teams','ut',_0x82f6('0x76'))[_0x82f6('0x3e')]('MailQueueId\x20=\x20?',_0x33a8ab[_0x82f6('0x47')]['id']);for(var _0x89d07f=0x0;_0x89d07f<_0x5dd019[_0x82f6('0x3b')];_0x89d07f+=0x1){let _0x2c77ba=_0x5dd019[_0x89d07f];for(var _0x58f558=0x0;_0x58f558<_0x2c77ba[_0x82f6('0x65')][_0x82f6('0x3b')];_0x58f558+=0x1){let _0x5ac57a=_0x2c77ba[_0x82f6('0x65')][_0x58f558];var _0x4fa077=_0x1a6d16[_0x82f6('0x77')]();_0x4fa077[_0x82f6('0x3e')](_0x82f6('0x78'),_0x5ac57a['id']);_0x2825c5[_0x82f6('0x79')](db[_0x82f6('0x69')][_0x82f6('0x36')](_0x4fa077['toString'](),{'type':db[_0x82f6('0x69')]['QueryTypes'][_0x82f6('0x7a')]})['then'](function(_0x5c9ef4){if(_0x5c9ef4[_0x82f6('0x3b')]===0x1){return _0x5ac57a['id'];}else{var _0x5da5c7=_[_0x82f6('0x7b')](_[_0x82f6('0x2f')](_0x5c9ef4,_0x82f6('0x7c')),function(_0xc5d539){return _['includes'](_0x3df195,_0xc5d539);});if(_0x5da5c7){return _0x5ac57a['id'];}}}));}}return BPromise[_0x82f6('0x7d')](_0x2825c5)[_0x82f6('0x28')](function(_0x31a308){_0x344db8=_(_0x344db8)[_0x82f6('0x7e')](_0x31a308)[_0x82f6('0x7f')]()[_0x82f6('0x80')]();return db['MailQueue']['find']({'where':{'id':_0x33a8ab[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](function(_0x3978c2){return db['sequelize'][_0x82f6('0x6a')](function(_0x2169b4){return _0x3978c2[_0x82f6('0x70')](_0x33a8ab[_0x82f6('0x36')][_0x82f6('0x64')],{'transaction':_0x2169b4})[_0x82f6('0x28')](function(){if(!_[_0x82f6('0x81')](_0x344db8)){return _0x3978c2['removeAgents'](_0x344db8,{'transaction':_0x2169b4});}})[_0x82f6('0x28')](function(){_0x344db8[_0x82f6('0x6d')](function(_0x1aefc1){socket[_0x82f6('0x6e')](_0x82f6('0x82'),{'UserId':_0x1aefc1,'MailQueueId':_0x3978c2['id']});});});});});});})['then'](respondWithStatusCode(_0x6e9e55,null))[_0x82f6('0x49')](handleError(_0x6e9e55,null));};exports[_0x82f6('0x83')]=function(_0x31fd2d,_0x230874,_0x9c7e81){return db['MailQueue'][_0x82f6('0x4e')]({'where':{'id':_0x31fd2d[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](handleEntityNotFound(_0x230874,null))[_0x82f6('0x28')](function(_0x549520){if(_0x549520){return _0x549520['addAgents'](_0x31fd2d[_0x82f6('0x4b')][_0x82f6('0x64')],_['omit'](_0x31fd2d[_0x82f6('0x4b')],[_0x82f6('0x64'),'id'])||{})[_0x82f6('0x84')](function(_0x5c68d0){for(var _0x1a570d=0x0;_0x1a570d<_0x31fd2d[_0x82f6('0x4b')][_0x82f6('0x64')][_0x82f6('0x3b')];_0x1a570d+=0x1){socket[_0x82f6('0x6e')](_0x82f6('0x6f'),{'UserId':Number(_0x31fd2d[_0x82f6('0x4b')][_0x82f6('0x64')][_0x1a570d]),'MailQueueId':Number(_0x31fd2d[_0x82f6('0x47')]['id'])});}return _0x5c68d0;});}})[_0x82f6('0x28')](respondWithResult(_0x230874,null))[_0x82f6('0x49')](handleError(_0x230874,null));};exports['removeAgents']=function(_0x130e44,_0x51d906,_0x53ec0a){return db[_0x82f6('0x30')][_0x82f6('0x4e')]({'where':{'id':_0x130e44[_0x82f6('0x47')]['id']}})[_0x82f6('0x28')](handleEntityNotFound(_0x51d906,null))[_0x82f6('0x28')](function(_0x35db8e){if(_0x35db8e){return _0x35db8e[_0x82f6('0x85')](_0x130e44[_0x82f6('0x36')][_0x82f6('0x64')])['then'](function(){if(_['isArray'](_0x130e44[_0x82f6('0x36')][_0x82f6('0x64')])){for(var _0x3afba4=0x0;_0x3afba4<_0x130e44[_0x82f6('0x36')]['ids'][_0x82f6('0x3b')];_0x3afba4+=0x1){socket[_0x82f6('0x6e')](_0x82f6('0x82'),{'UserId':Number(_0x130e44[_0x82f6('0x36')][_0x82f6('0x64')][_0x3afba4]),'MailQueueId':Number(_0x130e44[_0x82f6('0x47')]['id'])});}}else{socket[_0x82f6('0x6e')](_0x82f6('0x82'),{'UserId':Number(_0x130e44['query'][_0x82f6('0x64')]),'MailQueueId':Number(_0x130e44[_0x82f6('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x51d906,null))['catch'](handleError(_0x51d906,null));};exports[_0x82f6('0x86')]=function(_0x266a3a,_0x158ac7,_0x3853a8){var _0x527e53={};var _0x58e5f5={};var _0xd8c095;var _0xa705da;return db['MailQueue'][_0x82f6('0x53')]({'where':{'id':_0x266a3a['params']['id']}})['then'](handleEntityNotFound(_0x158ac7,null))[_0x82f6('0x28')](function(_0x208c52){if(_0x208c52){_0xd8c095=_0x208c52;_0x58e5f5['model']=_[_0x82f6('0x48')](db[_0x82f6('0x58')][_0x82f6('0x31')]);_0x58e5f5[_0x82f6('0x36')]=_[_0x82f6('0x48')](_0x266a3a[_0x82f6('0x36')]);_0x58e5f5[_0x82f6('0x37')]=_['intersection'](_0x58e5f5[_0x82f6('0x35')],_0x58e5f5['query']);_0x527e53[_0x82f6('0x39')]=_[_0x82f6('0x38')](_0x58e5f5[_0x82f6('0x35')],qs[_0x82f6('0x3a')](_0x266a3a[_0x82f6('0x36')][_0x82f6('0x3a')]));_0x527e53['attributes']=_0x527e53[_0x82f6('0x39')]['length']?_0x527e53[_0x82f6('0x39')]:_0x58e5f5[_0x82f6('0x35')];_0x527e53[_0x82f6('0x3d')]=qs[_0x82f6('0x55')](_0x266a3a[_0x82f6('0x36')]['sort']);_0x527e53[_0x82f6('0x3e')]=qs[_0x82f6('0x37')](_['pick'](_0x266a3a['query'],_0x58e5f5['filters']));if(_0x266a3a['query'][_0x82f6('0x3f')]){_0x527e53['where']=_['merge'](_0x527e53[_0x82f6('0x3e')],{'$or':_[_0x82f6('0x2f')](_0x527e53[_0x82f6('0x39')],function(_0x21fb3d){var _0x514641={};_0x514641[_0x21fb3d]={'$like':'%'+_0x266a3a[_0x82f6('0x36')][_0x82f6('0x3f')]+'%'};return _0x514641;})});}_0x527e53=_[_0x82f6('0x40')]({},_0x527e53,_0x266a3a[_0x82f6('0x42')]);return _0xd8c095[_0x82f6('0x86')](_0x527e53);}})['then'](function(_0x911b22){if(_0x911b22){_0xa705da=_0x911b22['length'];if(!_0x266a3a[_0x82f6('0x36')][_0x82f6('0x63')](_0x82f6('0x3c'))){_0x527e53['limit']=qs[_0x82f6('0x1e')](_0x266a3a[_0x82f6('0x36')][_0x82f6('0x1e')]);_0x527e53['offset']=qs[_0x82f6('0x1c')](_0x266a3a[_0x82f6('0x36')][_0x82f6('0x1c')]);}return _0xd8c095[_0x82f6('0x86')](_0x527e53);}})[_0x82f6('0x28')](function(_0xf2da5e){if(_0xf2da5e){return _0xf2da5e?{'count':_0xa705da,'rows':_0xf2da5e}:null;}})['then'](respondWithResult(_0x158ac7,null))[_0x82f6('0x49')](handleError(_0x158ac7,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index aaaa712..d473f7b 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 _0x6ed8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6ed8,0x1e8));var _0x86ed=function(_0x5029a5,_0xd43924){_0x5029a5=_0x5029a5-0x0;var _0x473bff=_0x6ed8[_0x5029a5];return _0x473bff;};'use strict';var EventEmitter=require(_0x86ed('0x0'));var MailQueue=require(_0x86ed('0x1'))['db'][_0x86ed('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x86ed('0x3')](0x0);var events={'afterCreate':_0x86ed('0x4'),'afterUpdate':_0x86ed('0x5'),'afterDestroy':_0x86ed('0x6')};function emitEvent(_0x4a4f28){return function(_0x1f6714,_0x298c0b,_0x4ee347){MailQueueEvents[_0x86ed('0x7')](_0x4a4f28+':'+_0x1f6714['id'],_0x1f6714);MailQueueEvents[_0x86ed('0x7')](_0x4a4f28,_0x1f6714);_0x4ee347(null);};}for(var e in events){if(events[_0x86ed('0x8')](e)){var event=events[e];MailQueue[_0x86ed('0x9')](e,emitEvent(event));}}module[_0x86ed('0xa')]=MailQueueEvents; \ No newline at end of file +var _0xa6c8=['emit','hasOwnProperty','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x2695db,_0x17a61c){var _0x4cb296=function(_0x4dee51){while(--_0x4dee51){_0x2695db['push'](_0x2695db['shift']());}};_0x4cb296(++_0x17a61c);}(_0xa6c8,0x19a));var _0x8a6c=function(_0x3f9f96,_0x3ab9c8){_0x3f9f96=_0x3f9f96-0x0;var _0x444c64=_0xa6c8[_0x3f9f96];return _0x444c64;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x8a6c('0x0'))['db'][_0x8a6c('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8a6c('0x2')](0x0);var events={'afterCreate':_0x8a6c('0x3'),'afterUpdate':_0x8a6c('0x4'),'afterDestroy':_0x8a6c('0x5')};function emitEvent(_0x52ecdc){return function(_0x22ac33,_0x47ad8f,_0xd509e5){MailQueueEvents['emit'](_0x52ecdc+':'+_0x22ac33['id'],_0x22ac33);MailQueueEvents[_0x8a6c('0x6')](_0x52ecdc,_0x22ac33);_0xd509e5(null);};}for(var e in events){if(events[_0x8a6c('0x7')](e)){var event=events[e];MailQueue['hook'](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 b74b745..be68914 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 _0x81a7=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54fc08,_0x9710f3){var _0x132ead=function(_0xcf901f){while(--_0xcf901f){_0x54fc08['push'](_0x54fc08['shift']());}};_0x132ead(++_0x9710f3);}(_0x81a7,0x163));var _0x781a=function(_0x4b07e0,_0x3fdfdd){_0x4b07e0=_0x4b07e0-0x0;var _0x5e6381=_0x81a7[_0x4b07e0];return _0x5e6381;};'use strict';var _=require(_0x781a('0x0'));var util=require(_0x781a('0x1'));var logger=require(_0x781a('0x2'))(_0x781a('0x3'));var moment=require(_0x781a('0x4'));var BPromise=require(_0x781a('0x5'));var rp=require(_0x781a('0x6'));var fs=require('fs');var path=require(_0x781a('0x7'));var rimraf=require(_0x781a('0x8'));var config=require('../../config/environment');var attributes=require(_0x781a('0x9'));module[_0x781a('0xa')]=function(_0x41ee3b,_0xf178b3){return _0x41ee3b[_0x781a('0xb')](_0x781a('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf513=['./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x437777,_0x23435b){var _0x58e2da=function(_0x4ed29a){while(--_0x4ed29a){_0x437777['push'](_0x437777['shift']());}};_0x58e2da(++_0x23435b);}(_0xf513,0x122));var _0x3f51=function(_0x191c9b,_0x568a33){_0x191c9b=_0x191c9b-0x0;var _0x213a3e=_0xf513[_0x191c9b];return _0x213a3e;};'use strict';var _=require(_0x3f51('0x0'));var util=require(_0x3f51('0x1'));var logger=require(_0x3f51('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f51('0x3'));var fs=require('fs');var path=require(_0x3f51('0x4'));var rimraf=require(_0x3f51('0x5'));var config=require(_0x3f51('0x6'));var attributes=require(_0x3f51('0x7'));module['exports']=function(_0x3b9d80,_0x53a809){return _0x3b9d80[_0x3f51('0x8')](_0x3f51('0x9'),attributes,{'tableName':_0x3f51('0xa'),'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 c7c3895..95242ee 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 _0x210d=['catch','ShowMailQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailQueue','MailQueue','findAll','options','where','limit','include','model','map','attributes'];(function(_0x55bed7,_0x1b34c5){var _0x130a75=function(_0x24ae24){while(--_0x24ae24){_0x55bed7['push'](_0x55bed7['shift']());}};_0x130a75(++_0x1b34c5);}(_0x210d,0x7c));var _0xd210=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x210d[_0x2605dc];return _0x4568c9;};'use strict';var _=require(_0xd210('0x0'));var util=require(_0xd210('0x1'));var moment=require('moment');var BPromise=require(_0xd210('0x2'));var rs=require(_0xd210('0x3'));var fs=require('fs');var Redis=require(_0xd210('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd210('0x5'))(_0xd210('0x6'));var config=require(_0xd210('0x7'));var jayson=require(_0xd210('0x8'));var client=jayson[_0xd210('0x9')][_0xd210('0xa')]({'port':0x232a});config[_0xd210('0xb')]=_[_0xd210('0xc')](config[_0xd210('0xb')],{'host':_0xd210('0xd'),'port':0x18eb});var socket=require(_0xd210('0xe'))(new Redis(config[_0xd210('0xb')]));require('./mailQueue.socket')[_0xd210('0xf')](socket);function respondWithRpcPromise(_0x37295f,_0x6e7c5d,_0x465cc1){return new BPromise(function(_0x331d8b,_0x382a45){return client['request'](_0x37295f,_0x465cc1)[_0xd210('0x10')](function(_0x3fb61e){logger[_0xd210('0x11')](_0xd210('0x12'),_0x6e7c5d,_0xd210('0x13'));logger[_0xd210('0x14')](_0xd210('0x15'),_0x6e7c5d,'request\x20sent',JSON[_0xd210('0x16')](_0x3fb61e));if(_0x3fb61e[_0xd210('0x17')]){if(_0x3fb61e['error']['code']===0x1f4){logger[_0xd210('0x17')](_0xd210('0x12'),_0x6e7c5d,_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);return _0x382a45(_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);}logger['error'](_0xd210('0x12'),_0x6e7c5d,_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);return _0x331d8b(_0x3fb61e[_0xd210('0x17')][_0xd210('0x18')]);}else{logger[_0xd210('0x11')](_0xd210('0x12'),_0x6e7c5d,_0xd210('0x13'));_0x331d8b(_0x3fb61e[_0xd210('0x19')][_0xd210('0x18')]);}})['catch'](function(_0x99711){logger[_0xd210('0x17')](_0xd210('0x12'),_0x6e7c5d,_0x99711);_0x382a45(_0x99711);});});}exports[_0xd210('0x1a')]=function(_0x136a2f){var _0x31adaa=this;return new Promise(function(_0x1502ba,_0x3d687f){return db[_0xd210('0x1b')][_0xd210('0x1c')]({'raw':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')][_0xd210('0x1e')]||null:null,'attributes':_0x136a2f[_0xd210('0x1d')]?_0x136a2f[_0xd210('0x1d')]['attributes']||null:null,'limit':_0x136a2f['options']?_0x136a2f['options'][_0xd210('0x1f')]||null:null,'include':_0x136a2f['options']?_0x136a2f[_0xd210('0x1d')][_0xd210('0x20')]?_['map'](_0x136a2f[_0xd210('0x1d')][_0xd210('0x20')],function(_0x2b4379){return{'model':db[_0x2b4379[_0xd210('0x21')]],'as':_0x2b4379['as'],'attributes':_0x2b4379['attributes'],'include':_0x2b4379['include']?_[_0xd210('0x22')](_0x2b4379['include'],function(_0x17f604){return{'model':db[_0x17f604['model']],'as':_0x17f604['as'],'attributes':_0x17f604[_0xd210('0x23')],'include':_0x17f604[_0xd210('0x20')]?_[_0xd210('0x22')](_0x17f604[_0xd210('0x20')],function(_0x1065e6){return{'model':db[_0x1065e6[_0xd210('0x21')]],'as':_0x1065e6['as'],'attributes':_0x1065e6[_0xd210('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd210('0x10')](function(_0x33faf5){logger['info'](_0xd210('0x1a'),_0x136a2f);logger['debug'](_0xd210('0x1a'),_0x136a2f,JSON[_0xd210('0x16')](_0x33faf5));_0x1502ba(_0x33faf5);})[_0xd210('0x24')](function(_0x12e2f8){logger[_0xd210('0x17')](_0xd210('0x1a'),_0x12e2f8[_0xd210('0x18')],_0x136a2f);_0x3d687f(_0x31adaa['error'](0x1f4,_0x12e2f8[_0xd210('0x18')]));});});};exports[_0xd210('0x25')]=function(_0x17f63f){var _0x38ce7e=this;return new Promise(function(_0x491288,_0x45b100){return db[_0xd210('0x1b')][_0xd210('0x26')]({'raw':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x27')]===undefined?!![]:![]:!![],'where':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x1e')]||null:null,'attributes':_0x17f63f[_0xd210('0x1d')]?_0x17f63f[_0xd210('0x1d')][_0xd210('0x23')]||null:null,'include':_0x17f63f[_0xd210('0x1d')]?_0x17f63f['options'][_0xd210('0x20')]?_[_0xd210('0x22')](_0x17f63f[_0xd210('0x1d')][_0xd210('0x20')],function(_0x15a5d4){return{'model':db[_0x15a5d4['model']],'as':_0x15a5d4['as'],'attributes':_0x15a5d4[_0xd210('0x23')],'include':_0x15a5d4[_0xd210('0x20')]?_[_0xd210('0x22')](_0x15a5d4[_0xd210('0x20')],function(_0x1abc13){return{'model':db[_0x1abc13[_0xd210('0x21')]],'as':_0x1abc13['as'],'attributes':_0x1abc13[_0xd210('0x23')],'include':_0x1abc13[_0xd210('0x20')]?_[_0xd210('0x22')](_0x1abc13[_0xd210('0x20')],function(_0x4b02de){return{'model':db[_0x4b02de[_0xd210('0x21')]],'as':_0x4b02de['as'],'attributes':_0x4b02de[_0xd210('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd210('0x10')](function(_0x232f58){logger[_0xd210('0x11')](_0xd210('0x25'),_0x17f63f);logger['debug'](_0xd210('0x25'),_0x17f63f,JSON[_0xd210('0x16')](_0x232f58));_0x491288(_0x232f58);})[_0xd210('0x24')](function(_0x498ac5){logger['error'](_0xd210('0x25'),_0x498ac5[_0xd210('0x18')],_0x17f63f);_0x45b100(_0x38ce7e[_0xd210('0x17')](0x1f4,_0x498ac5['message']));});});}; \ No newline at end of file +var _0x51ba=['redis','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','map','include','model','debug','stringify','catch','ShowMailQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51ba,0x169));var _0xa51b=function(_0x402deb,_0x527b26){_0x402deb=_0x402deb-0x0;var _0x1ce8c7=_0x51ba[_0x402deb];return _0x1ce8c7;};'use strict';var _=require('lodash');var util=require(_0xa51b('0x0'));var moment=require(_0xa51b('0x1'));var BPromise=require(_0xa51b('0x2'));var rs=require(_0xa51b('0x3'));var fs=require('fs');var Redis=require(_0xa51b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa51b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa51b('0x6'));var client=jayson[_0xa51b('0x7')][_0xa51b('0x8')]({'port':0x232a});config[_0xa51b('0x9')]=_['defaults'](config[_0xa51b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa51b('0x9')]));require(_0xa51b('0xa'))[_0xa51b('0xb')](socket);function respondWithRpcPromise(_0xfa6a0e,_0xae8fcf,_0x552a6f){return new BPromise(function(_0xbf3c46,_0x37abd7){return client['request'](_0xfa6a0e,_0x552a6f)[_0xa51b('0xc')](function(_0x3b7c3b){logger[_0xa51b('0xd')](_0xa51b('0xe'),_0xae8fcf,'request\x20sent');logger['debug'](_0xa51b('0xf'),_0xae8fcf,_0xa51b('0x10'),JSON['stringify'](_0x3b7c3b));if(_0x3b7c3b[_0xa51b('0x11')]){if(_0x3b7c3b[_0xa51b('0x11')][_0xa51b('0x12')]===0x1f4){logger['error'](_0xa51b('0xe'),_0xae8fcf,_0x3b7c3b['error'][_0xa51b('0x13')]);return _0x37abd7(_0x3b7c3b[_0xa51b('0x11')][_0xa51b('0x13')]);}logger['error'](_0xa51b('0xe'),_0xae8fcf,_0x3b7c3b[_0xa51b('0x11')][_0xa51b('0x13')]);return _0xbf3c46(_0x3b7c3b[_0xa51b('0x11')][_0xa51b('0x13')]);}else{logger[_0xa51b('0xd')](_0xa51b('0xe'),_0xae8fcf,_0xa51b('0x10'));_0xbf3c46(_0x3b7c3b[_0xa51b('0x14')][_0xa51b('0x13')]);}})['catch'](function(_0x187b43){logger[_0xa51b('0x11')]('MailQueue,\x20%s,\x20%s',_0xae8fcf,_0x187b43);_0x37abd7(_0x187b43);});});}exports[_0xa51b('0x15')]=function(_0x1d3708){var _0x5ac489=this;return new Promise(function(_0x3e754c,_0x53873a){return db[_0xa51b('0x16')][_0xa51b('0x17')]({'raw':_0x1d3708[_0xa51b('0x18')]?_0x1d3708[_0xa51b('0x18')][_0xa51b('0x19')]===undefined?!![]:![]:!![],'where':_0x1d3708[_0xa51b('0x18')]?_0x1d3708[_0xa51b('0x18')]['where']||null:null,'attributes':_0x1d3708['options']?_0x1d3708[_0xa51b('0x18')][_0xa51b('0x1a')]||null:null,'limit':_0x1d3708[_0xa51b('0x18')]?_0x1d3708[_0xa51b('0x18')][_0xa51b('0x1b')]||null:null,'include':_0x1d3708[_0xa51b('0x18')]?_0x1d3708[_0xa51b('0x18')]['include']?_[_0xa51b('0x1c')](_0x1d3708['options'][_0xa51b('0x1d')],function(_0x5105b0){return{'model':db[_0x5105b0['model']],'as':_0x5105b0['as'],'attributes':_0x5105b0[_0xa51b('0x1a')],'include':_0x5105b0[_0xa51b('0x1d')]?_[_0xa51b('0x1c')](_0x5105b0['include'],function(_0x1609dc){return{'model':db[_0x1609dc[_0xa51b('0x1e')]],'as':_0x1609dc['as'],'attributes':_0x1609dc[_0xa51b('0x1a')],'include':_0x1609dc[_0xa51b('0x1d')]?_[_0xa51b('0x1c')](_0x1609dc[_0xa51b('0x1d')],function(_0x4d8c71){return{'model':db[_0x4d8c71[_0xa51b('0x1e')]],'as':_0x4d8c71['as'],'attributes':_0x4d8c71[_0xa51b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa51b('0xc')](function(_0x4f58d3){logger[_0xa51b('0xd')](_0xa51b('0x15'),_0x1d3708);logger[_0xa51b('0x1f')](_0xa51b('0x15'),_0x1d3708,JSON[_0xa51b('0x20')](_0x4f58d3));_0x3e754c(_0x4f58d3);})[_0xa51b('0x21')](function(_0x3fd60b){logger[_0xa51b('0x11')](_0xa51b('0x15'),_0x3fd60b[_0xa51b('0x13')],_0x1d3708);_0x53873a(_0x5ac489[_0xa51b('0x11')](0x1f4,_0x3fd60b[_0xa51b('0x13')]));});});};exports[_0xa51b('0x22')]=function(_0x581420){var _0x5b4adf=this;return new Promise(function(_0x50444c,_0x3b55c9){return db[_0xa51b('0x16')][_0xa51b('0x23')]({'raw':_0x581420[_0xa51b('0x18')]?_0x581420[_0xa51b('0x18')][_0xa51b('0x19')]===undefined?!![]:![]:!![],'where':_0x581420['options']?_0x581420[_0xa51b('0x18')][_0xa51b('0x24')]||null:null,'attributes':_0x581420['options']?_0x581420[_0xa51b('0x18')][_0xa51b('0x1a')]||null:null,'include':_0x581420[_0xa51b('0x18')]?_0x581420[_0xa51b('0x18')]['include']?_['map'](_0x581420[_0xa51b('0x18')][_0xa51b('0x1d')],function(_0x3b0b61){return{'model':db[_0x3b0b61[_0xa51b('0x1e')]],'as':_0x3b0b61['as'],'attributes':_0x3b0b61[_0xa51b('0x1a')],'include':_0x3b0b61[_0xa51b('0x1d')]?_[_0xa51b('0x1c')](_0x3b0b61[_0xa51b('0x1d')],function(_0x5b3d5b){return{'model':db[_0x5b3d5b['model']],'as':_0x5b3d5b['as'],'attributes':_0x5b3d5b[_0xa51b('0x1a')],'include':_0x5b3d5b[_0xa51b('0x1d')]?_[_0xa51b('0x1c')](_0x5b3d5b[_0xa51b('0x1d')],function(_0xce1a18){return{'model':db[_0xce1a18[_0xa51b('0x1e')]],'as':_0xce1a18['as'],'attributes':_0xce1a18['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a05fd){logger['info'](_0xa51b('0x22'),_0x581420);logger[_0xa51b('0x1f')](_0xa51b('0x22'),_0x581420,JSON[_0xa51b('0x20')](_0x2a05fd));_0x50444c(_0x2a05fd);})[_0xa51b('0x21')](function(_0x382404){logger[_0xa51b('0x11')](_0xa51b('0x22'),_0x382404['message'],_0x581420);_0x3b55c9(_0x5b4adf[_0xa51b('0x11')](0x1f4,_0x382404[_0xa51b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 141ae5d..a27192d 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 _0x819f=['update','emit','register','length','./mailQueue.events','save','remove'];(function(_0x303273,_0x352ebb){var _0x56d9f6=function(_0xdf2780){while(--_0xdf2780){_0x303273['push'](_0x303273['shift']());}};_0x56d9f6(++_0x352ebb);}(_0x819f,0x1bd));var _0xf819=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x819f[_0x35b2a1];return _0x6023da;};'use strict';var MailQueueEvents=require(_0xf819('0x0'));var events=[_0xf819('0x1'),_0xf819('0x2'),_0xf819('0x3')];function createListener(_0x52fd18,_0x5c364e){return function(_0x1ce763){_0x5c364e[_0xf819('0x4')](_0x52fd18,_0x1ce763);};}function removeListener(_0x13aae9,_0x2a5726){return function(){MailQueueEvents['removeListener'](_0x13aae9,_0x2a5726);};}exports[_0xf819('0x5')]=function(_0x3cdad7){for(var _0x5b6143=0x0,_0x590f19=events[_0xf819('0x6')];_0x5b6143<_0x590f19;_0x5b6143++){var _0x4c5042=events[_0x5b6143];var _0x447fc3=createListener('mailQueue:'+_0x4c5042,_0x3cdad7);MailQueueEvents['on'](_0x4c5042,_0x447fc3);}}; \ No newline at end of file +var _0xfb09=['length','./mailQueue.events','update','emit','removeListener','register'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0xfb09,0x97));var _0x9fb0=function(_0x3419a5,_0x121fd3){_0x3419a5=_0x3419a5-0x0;var _0x144523=_0xfb09[_0x3419a5];return _0x144523;};'use strict';var MailQueueEvents=require(_0x9fb0('0x0'));var events=['save','remove',_0x9fb0('0x1')];function createListener(_0x3b22ba,_0x467626){return function(_0x2c5cfa){_0x467626[_0x9fb0('0x2')](_0x3b22ba,_0x2c5cfa);};}function removeListener(_0x8bbc8d,_0x22de6d){return function(){MailQueueEvents[_0x9fb0('0x3')](_0x8bbc8d,_0x22de6d);};}exports[_0x9fb0('0x4')]=function(_0x17ae11){for(var _0x57d79a=0x0,_0x53b96f=events[_0x9fb0('0x5')];_0x57d79a<_0x53b96f;_0x57d79a++){var _0x5099c5=events[_0x57d79a];var _0x548f1f=createListener('mailQueue:'+_0x5099c5,_0x17ae11);MailQueueEvents['on'](_0x5099c5,_0x548f1f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3e91d6f..5e76538 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 _0xbe73=['show','post','create','put','delete','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xbe73,0x1c8));var _0x3be7=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0xbe73[_0x319e2e];return _0x302524;};'use strict';var multer=require('multer');var util=require(_0x3be7('0x0'));var path=require('path');var timeout=require(_0x3be7('0x1'));var express=require(_0x3be7('0x2'));var router=express[_0x3be7('0x3')]();var fs_extra=require(_0x3be7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3be7('0x5'));var controller=require(_0x3be7('0x6'));router[_0x3be7('0x7')]('/',auth[_0x3be7('0x8')](),controller['index']);router[_0x3be7('0x7')](_0x3be7('0x9'),auth[_0x3be7('0x8')](),controller[_0x3be7('0xa')]);router['get'](_0x3be7('0xb'),auth[_0x3be7('0x8')](),controller[_0x3be7('0xc')]);router[_0x3be7('0xd')]('/',auth[_0x3be7('0x8')](),controller[_0x3be7('0xe')]);router[_0x3be7('0xf')](_0x3be7('0xb'),auth[_0x3be7('0x8')](),controller['update']);router[_0x3be7('0x10')](_0x3be7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3be7('0x11')]=router; \ No newline at end of file +var _0xcf65=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','/:id','show','create','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf65,0xc6));var _0x5cf6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcf65[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x5cf6('0x0'));var util=require(_0x5cf6('0x1'));var path=require(_0x5cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5cf6('0x3'));var router=express[_0x5cf6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5cf6('0x5'));var interaction=require(_0x5cf6('0x6'));var config=require(_0x5cf6('0x7'));var controller=require(_0x5cf6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5cf6('0x9')]('/describe',auth[_0x5cf6('0xa')](),controller[_0x5cf6('0xb')]);router['get'](_0x5cf6('0xc'),auth[_0x5cf6('0xa')](),controller[_0x5cf6('0xd')]);router['post']('/',auth[_0x5cf6('0xa')](),controller[_0x5cf6('0xe')]);router['put'](_0x5cf6('0xc'),auth[_0x5cf6('0xa')](),controller['update']);router[_0x5cf6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5cf6('0x10')]);module[_0x5cf6('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 4d89b01..2e491c6 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 _0x274e=['sequelize','exports','STRING','DATE'];(function(_0x52219b,_0x435d51){var _0x139fcf=function(_0x398a85){while(--_0x398a85){_0x52219b['push'](_0x52219b['shift']());}};_0x139fcf(++_0x435d51);}(_0x274e,0x1c0));var _0xe274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x274e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xe274('0x0'));module[_0xe274('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe274('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe274('0x3')]},'acceptAt':{'type':Sequelize[_0xe274('0x3')]},'exitAt':{'type':Sequelize[_0xe274('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9f84=['STRING','DATE','sequelize','exports'];(function(_0x3d60c2,_0x5c5437){var _0x415877=function(_0x2e85fb){while(--_0x2e85fb){_0x3d60c2['push'](_0x3d60c2['shift']());}};_0x415877(++_0x5c5437);}(_0x9f84,0x10a));var _0x49f8=function(_0xbf7f20,_0x3f856e){_0xbf7f20=_0xbf7f20-0x0;var _0x5dc25d=_0x9f84[_0xbf7f20];return _0x5dc25d;};'use strict';var moment=require('moment');var Sequelize=require(_0x49f8('0x0'));module[_0x49f8('0x1')]={'uniqueid':{'type':Sequelize[_0x49f8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x49f8('0x2')]},'joinAt':{'type':Sequelize[_0x49f8('0x3')]},'leaveAt':{'type':Sequelize[_0x49f8('0x3')]},'acceptAt':{'type':Sequelize[_0x49f8('0x3')]},'exitAt':{'type':Sequelize[_0x49f8('0x3')]},'reason':{'type':Sequelize[_0x49f8('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f59e5b7..e1c4761 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 _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x15dacd,_0x8b58e4){var _0x30f78c=function(_0x400b4a){while(--_0x400b4a){_0x15dacd['push'](_0x15dacd['shift']());}};_0x30f78c(++_0x8b58e4);}(_0x2542,0x169));var _0x2254=function(_0x5bb9fc,_0x36eaa3){_0x5bb9fc=_0x5bb9fc-0x0;var _0x31d701=_0x2542[_0x5bb9fc];return _0x31d701;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['MailQueueReport'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file +var _0x7b84=['sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','filter','MailQueueReport','includeAll','findAll','rows','catch','show','params','include','options','create','body','update','find','describe','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2e97d8,_0x1ab87c){var _0x57184f=function(_0x439f21){while(--_0x439f21){_0x2e97d8['push'](_0x2e97d8['shift']());}};_0x57184f(++_0x1ab87c);}(_0x7b84,0x17c));var _0x47b8=function(_0x98e330,_0x77da3f){_0x98e330=_0x98e330-0x0;var _0x4ec0e6=_0x7b84[_0x98e330];return _0x4ec0e6;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require(_0x47b8('0x3'));var rp=require(_0x47b8('0x4'));var moment=require(_0x47b8('0x5'));var BPromise=require(_0x47b8('0x6'));var Mustache=require('mustache');var util=require(_0x47b8('0x7'));var path=require(_0x47b8('0x8'));var sox=require(_0x47b8('0x9'));var csv=require(_0x47b8('0xa'));var ejs=require(_0x47b8('0xb'));var fs=require('fs');var fs_extra=require(_0x47b8('0xc'));var _=require('lodash');var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0xa'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require(_0x47b8('0x15'));var as=require(_0x47b8('0x16'));var hardwareService=require(_0x47b8('0x17'));var logger=require(_0x47b8('0x18'))(_0x47b8('0x19'));var utils=require(_0x47b8('0x1a'));var config=require(_0x47b8('0x1b'));var licenseUtil=require(_0x47b8('0x1c'));var db=require(_0x47b8('0x1d'))['db'];function respondWithStatusCode(_0x25a224,_0x289ac7){_0x289ac7=_0x289ac7||0xcc;return function(_0x1edb4b){if(_0x1edb4b){return _0x25a224[_0x47b8('0x1e')](_0x289ac7);}return _0x25a224[_0x47b8('0x1f')](_0x289ac7)[_0x47b8('0x20')]();};}function respondWithResult(_0x173015,_0x223121){_0x223121=_0x223121||0xc8;return function(_0xf66dd6){if(_0xf66dd6){return _0x173015['status'](_0x223121)[_0x47b8('0x21')](_0xf66dd6);}};}function respondWithFilteredResult(_0x340da0,_0x3e760a){return function(_0x1217a4){if(_0x1217a4){var _0x34d5a5=typeof _0x3e760a[_0x47b8('0x22')]===_0x47b8('0x23')&&typeof _0x3e760a['limit']===_0x47b8('0x23');var _0x5c2b2c=_0x1217a4['count'];var _0x4f7317=_0x34d5a5?0x0:_0x3e760a[_0x47b8('0x22')];var _0x36faf1=_0x34d5a5?_0x1217a4[_0x47b8('0x24')]:_0x3e760a['offset']+_0x3e760a['limit'];var _0x4f6716;if(_0x36faf1>=_0x5c2b2c){_0x36faf1=_0x5c2b2c;_0x4f6716=0xc8;}else{_0x4f6716=0xce;}_0x340da0[_0x47b8('0x1f')](_0x4f6716);return _0x340da0['set'](_0x47b8('0x25'),_0x4f7317+'-'+_0x36faf1+'/'+_0x5c2b2c)[_0x47b8('0x21')](_0x1217a4);}return null;};}function patchUpdates(_0x303f19){return function(_0xfccf56){try{jsonpatch['apply'](_0xfccf56,_0x303f19,!![]);}catch(_0xc20df1){return BPromise[_0x47b8('0x26')](_0xc20df1);}return _0xfccf56[_0x47b8('0x27')]();};}function saveUpdates(_0x2f75d2,_0x168cde){return function(_0x232708){if(_0x232708){return _0x232708['update'](_0x2f75d2)[_0x47b8('0x28')](function(_0x2a22e3){return _0x2a22e3;});}return null;};}function removeEntity(_0x5301f8,_0x22e7dd){return function(_0x247429){if(_0x247429){return _0x247429[_0x47b8('0x29')]()[_0x47b8('0x28')](function(){_0x5301f8['status'](0xcc)[_0x47b8('0x20')]();});}};}function handleEntityNotFound(_0x332c23,_0x319d17){return function(_0x3e3de0){if(!_0x3e3de0){_0x332c23[_0x47b8('0x1e')](0x194);}return _0x3e3de0;};}function handleError(_0xbf5ce9,_0x40918f){_0x40918f=_0x40918f||0x1f4;return function(_0x568c1e){logger[_0x47b8('0x2a')](_0x568c1e[_0x47b8('0x2b')]);if(_0x568c1e['name']){delete _0x568c1e[_0x47b8('0x2c')];}_0xbf5ce9[_0x47b8('0x1f')](_0x40918f)[_0x47b8('0x2d')](_0x568c1e);};}exports[_0x47b8('0x2e')]=function(_0x4da0e0,_0x162d96){var _0x5c347f={},_0x2c89fc={},_0x2255ab={'count':0x0,'rows':[]};var _0x33e653=_[_0x47b8('0x2f')](db['MailQueueReport'][_0x47b8('0x30')],function(_0x264dd9){return{'name':_0x264dd9[_0x47b8('0x31')],'type':_0x264dd9[_0x47b8('0x32')][_0x47b8('0x33')]};});_0x2c89fc[_0x47b8('0x34')]=_['map'](_0x33e653,'name');_0x2c89fc['query']=_[_0x47b8('0x35')](_0x4da0e0[_0x47b8('0x36')]);_0x2c89fc[_0x47b8('0x37')]=_['intersection'](_0x2c89fc['model'],_0x2c89fc['query']);_0x5c347f['attributes']=_[_0x47b8('0x38')](_0x2c89fc[_0x47b8('0x34')],qs[_0x47b8('0x39')](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x39')]));_0x5c347f[_0x47b8('0x3a')]=_0x5c347f[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x5c347f[_0x47b8('0x3a')]:_0x2c89fc['model'];if(!_0x4da0e0['query'][_0x47b8('0x3c')](_0x47b8('0x3d'))){_0x5c347f['limit']=qs['limit'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x3e')]);_0x5c347f[_0x47b8('0x22')]=qs['offset'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x22')]);}_0x5c347f['order']=qs['sort'](_0x4da0e0['query']['sort']);_0x5c347f[_0x47b8('0x3f')]=qs[_0x47b8('0x37')](_[_0x47b8('0x40')](_0x4da0e0[_0x47b8('0x36')],_0x2c89fc[_0x47b8('0x37')]),_0x33e653);if(_0x4da0e0[_0x47b8('0x36')]['filter']){_0x5c347f['where']=_[_0x47b8('0x41')](_0x5c347f[_0x47b8('0x3f')],{'$or':_[_0x47b8('0x2f')](_0x33e653,function(_0x4a9ed6){if(_0x4a9ed6['type']!==_0x47b8('0x42')){var _0x2c89bc={};_0x2c89bc[_0x4a9ed6['name']]={'$like':'%'+_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x43')]+'%'};return _0x2c89bc;}})});}_0x5c347f=_['merge']({},_0x5c347f,_0x4da0e0['options']);var _0x493b69={'where':_0x5c347f['where']};return db[_0x47b8('0x44')][_0x47b8('0x24')](_0x493b69)[_0x47b8('0x28')](function(_0x28cf2c){_0x2255ab[_0x47b8('0x24')]=_0x28cf2c;if(_0x4da0e0['query'][_0x47b8('0x45')]){_0x5c347f['include']=[{'all':!![]}];}return db[_0x47b8('0x44')][_0x47b8('0x46')](_0x5c347f);})[_0x47b8('0x28')](function(_0x5bede8){_0x2255ab[_0x47b8('0x47')]=_0x5bede8;return _0x2255ab;})[_0x47b8('0x28')](respondWithFilteredResult(_0x162d96,_0x5c347f))[_0x47b8('0x48')](handleError(_0x162d96,null));};exports[_0x47b8('0x49')]=function(_0x3eaf01,_0x15b9a1){var _0x2d2971={'raw':!![],'where':{'id':_0x3eaf01[_0x47b8('0x4a')]['id']}},_0x569d29={};_0x569d29['model']=_[_0x47b8('0x35')](db[_0x47b8('0x44')][_0x47b8('0x30')]);_0x569d29[_0x47b8('0x36')]=_[_0x47b8('0x35')](_0x3eaf01[_0x47b8('0x36')]);_0x569d29['filters']=_['intersection'](_0x569d29[_0x47b8('0x34')],_0x569d29[_0x47b8('0x36')]);_0x2d2971[_0x47b8('0x3a')]=_['intersection'](_0x569d29[_0x47b8('0x34')],qs['fields'](_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x39')]));_0x2d2971[_0x47b8('0x3a')]=_0x2d2971[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x2d2971['attributes']:_0x569d29[_0x47b8('0x34')];if(_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x45')]){_0x2d2971[_0x47b8('0x4b')]=[{'all':!![]}];}_0x2d2971=_[_0x47b8('0x41')]({},_0x2d2971,_0x3eaf01[_0x47b8('0x4c')]);return db[_0x47b8('0x44')]['find'](_0x2d2971)[_0x47b8('0x28')](handleEntityNotFound(_0x15b9a1,null))['then'](respondWithResult(_0x15b9a1,null))[_0x47b8('0x48')](handleError(_0x15b9a1,null));};exports[_0x47b8('0x4d')]=function(_0x4a46eb,_0x132e9a){return db[_0x47b8('0x44')][_0x47b8('0x4d')](_0x4a46eb[_0x47b8('0x4e')],{})[_0x47b8('0x28')](respondWithResult(_0x132e9a,0xc9))[_0x47b8('0x48')](handleError(_0x132e9a,null));};exports[_0x47b8('0x4f')]=function(_0x381d3a,_0x4ad8a8){if(_0x381d3a[_0x47b8('0x4e')]['id']){delete _0x381d3a[_0x47b8('0x4e')]['id'];}return db[_0x47b8('0x44')]['find']({'where':{'id':_0x381d3a[_0x47b8('0x4a')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x4ad8a8,null))[_0x47b8('0x28')](saveUpdates(_0x381d3a[_0x47b8('0x4e')],null))['then'](respondWithResult(_0x4ad8a8,null))[_0x47b8('0x48')](handleError(_0x4ad8a8,null));};exports[_0x47b8('0x29')]=function(_0x51ac62,_0x270054){return db[_0x47b8('0x44')][_0x47b8('0x50')]({'where':{'id':_0x51ac62['params']['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x270054,null))['then'](removeEntity(_0x270054,null))[_0x47b8('0x48')](handleError(_0x270054,null));};exports['describe']=function(_0x2a03c2,_0x498512){return db[_0x47b8('0x44')][_0x47b8('0x51')]()[_0x47b8('0x28')](respondWithResult(_0x498512,null))[_0x47b8('0x48')](handleError(_0x498512,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ef64b0b..78ffc33 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 _0xc0b9=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue'];(function(_0x20b5fc,_0x41e26d){var _0x2508b1=function(_0x3e28ea){while(--_0x3e28ea){_0x20b5fc['push'](_0x20b5fc['shift']());}};_0x2508b1(++_0x41e26d);}(_0xc0b9,0x12d));var _0x9c0b=function(_0x496e26,_0x2ace9c){_0x496e26=_0x496e26-0x0;var _0x575705=_0xc0b9[_0x496e26];return _0x575705;};'use strict';var _=require(_0x9c0b('0x0'));var util=require(_0x9c0b('0x1'));var logger=require(_0x9c0b('0x2'))(_0x9c0b('0x3'));var moment=require(_0x9c0b('0x4'));var BPromise=require(_0x9c0b('0x5'));var rp=require(_0x9c0b('0x6'));var fs=require('fs');var path=require(_0x9c0b('0x7'));var rimraf=require(_0x9c0b('0x8'));var config=require(_0x9c0b('0x9'));var attributes=require(_0x9c0b('0xa'));module[_0x9c0b('0xb')]=function(_0x453013,_0x46d2b8){return _0x453013[_0x9c0b('0xc')]('MailQueueReport',attributes,{'tableName':_0x9c0b('0xd'),'paranoid':![],'indexes':[{'name':_0x9c0b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd98=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4144ca,_0x3f22e3){var _0x2de8ee=function(_0x160005){while(--_0x160005){_0x4144ca['push'](_0x4144ca['shift']());}};_0x2de8ee(++_0x3f22e3);}(_0xcd98,0x1e3));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8cd9('0x0'));var util=require(_0x8cd9('0x1'));var logger=require('../../config/logger')(_0x8cd9('0x2'));var moment=require('moment');var BPromise=require(_0x8cd9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cd9('0x4'));var rimraf=require(_0x8cd9('0x5'));var config=require(_0x8cd9('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x8cd9('0x7')]=function(_0x24cb66,_0xeeec64){return _0x24cb66[_0x8cd9('0x8')](_0x8cd9('0x9'),attributes,{'tableName':_0x8cd9('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8cd9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 032deda..10f1285 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x18211c,_0x5da85f){var _0x519e10=function(_0x832252){while(--_0x832252){_0x18211c['push'](_0x18211c['shift']());}};_0x519e10(++_0x5da85f);}(_0xdb28,0x106));var _0x8db2=function(_0x4ac028,_0x46c6de){_0x4ac028=_0x4ac028-0x0;var _0x34ad7f=_0xdb28[_0x4ac028];return _0x34ad7f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x522130,_0xd4e6e6){var _0xbf771c=function(_0x3b1074){while(--_0x3b1074){_0x522130['push'](_0x522130['shift']());}};_0xbf771c(++_0xd4e6e6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cfa0161..a5c2bc2 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5aabcb,_0x219fbd){var _0x4b6e71=function(_0x1546ee){while(--_0x1546ee){_0x5aabcb['push'](_0x5aabcb['shift']());}};_0x4b6e71(++_0x219fbd);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'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(_0x169999,_0x403387){var _0x5d82e6=function(_0x576703){while(--_0x576703){_0x169999['push'](_0x169999['shift']());}};_0x5d82e6(++_0x403387);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 2bb4d4f..45e01db 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 _0xe814=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x5dfa0c,_0x5359f8){var _0x463457=function(_0x34b36e){while(--_0x34b36e){_0x5dfa0c['push'](_0x5dfa0c['shift']());}};_0x463457(++_0x5359f8);}(_0xe814,0x1c3));var _0x4e81=function(_0xee1510,_0x42b1de){_0xee1510=_0xee1510-0x0;var _0x36481a=_0xe814[_0xee1510];return _0x36481a;};'use strict';var Sequelize=require('sequelize');module[_0x4e81('0x0')]={'description':{'type':Sequelize[_0x4e81('0x1')]},'host':{'type':Sequelize[_0x4e81('0x1')]},'authentication':{'type':Sequelize[_0x4e81('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4e81('0x1')]},'password':{'type':Sequelize[_0x4e81('0x1')]},'port':{'type':Sequelize[_0x4e81('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4e81('0x1')],'defaultValue':_0x4e81('0x4')},'connTimeout':{'type':Sequelize[_0x4e81('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4e81('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4e81('0x1')]},'modernAuthentication':{'type':Sequelize[_0x4e81('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x56ad=['exports','STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x56ad,0xb4));var _0xd56a=function(_0x6537b4,_0x32bad9){_0x6537b4=_0x6537b4-0x0;var _0x1cf423=_0x56ad[_0x6537b4];return _0x1cf423;};'use strict';var Sequelize=require('sequelize');module[_0xd56a('0x0')]={'description':{'type':Sequelize[_0xd56a('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xd56a('0x1')]},'password':{'type':Sequelize[_0xd56a('0x1')]},'port':{'type':Sequelize[_0xd56a('0x2')]},'tls':{'type':Sequelize[_0xd56a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd56a('0x1')],'defaultValue':_0xd56a('0x4')},'connTimeout':{'type':Sequelize[_0xd56a('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd56a('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd56a('0x1')]},'modernAuthentication':{'type':Sequelize[_0xd56a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 91507aa..5cd3856 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 _0xee78=['lodash','api','moment','bluebird','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x3e161f,_0x34c245){var _0x4d71cf=function(_0x2a6644){while(--_0x2a6644){_0x3e161f['push'](_0x3e161f['shift']());}};_0x4d71cf(++_0x34c245);}(_0xee78,0x1ae));var _0x8ee7=function(_0x3e5690,_0x495f56){_0x3e5690=_0x3e5690-0x0;var _0x1eb3ba=_0xee78[_0x3e5690];return _0x1eb3ba;};'use strict';var _=require(_0x8ee7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ee7('0x1'));var moment=require(_0x8ee7('0x2'));var BPromise=require(_0x8ee7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ee7('0x4'));var rimraf=require('rimraf');var config=require(_0x8ee7('0x5'));var attributes=require(_0x8ee7('0x6'));module[_0x8ee7('0x7')]=function(_0x46a1ab,_0x191232){return _0x46a1ab['define'](_0x8ee7('0x8'),attributes,{'tableName':_0x8ee7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d44=['moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x42733f,_0x15befa){var _0x52132f=function(_0x3aee1f){while(--_0x3aee1f){_0x42733f['push'](_0x42733f['shift']());}};_0x52132f(++_0x15befa);}(_0x1d44,0xc0));var _0x41d4=function(_0x4864f0,_0x5da8c5){_0x4864f0=_0x4864f0-0x0;var _0x55445a=_0x1d44[_0x4864f0];return _0x55445a;};'use strict';var _=require(_0x41d4('0x0'));var util=require(_0x41d4('0x1'));var logger=require(_0x41d4('0x2'))(_0x41d4('0x3'));var moment=require(_0x41d4('0x4'));var BPromise=require('bluebird');var rp=require(_0x41d4('0x5'));var fs=require('fs');var path=require(_0x41d4('0x6'));var rimraf=require(_0x41d4('0x7'));var config=require(_0x41d4('0x8'));var attributes=require(_0x41d4('0x9'));module[_0x41d4('0xa')]=function(_0x5180ea,_0x213202){return _0x5180ea[_0x41d4('0xb')](_0x41d4('0xc'),attributes,{'tableName':_0x41d4('0xd'),'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 65b6222..b06f89a 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 _0xd1d7=['stringify','error','code','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd1d7,0x144));var _0x7d1d=function(_0x3765e2,_0x4e1fba){_0x3765e2=_0x3765e2-0x0;var _0x144efb=_0xd1d7[_0x3765e2];return _0x144efb;};'use strict';var _=require(_0x7d1d('0x0'));var util=require(_0x7d1d('0x1'));var moment=require(_0x7d1d('0x2'));var BPromise=require(_0x7d1d('0x3'));var rs=require(_0x7d1d('0x4'));var fs=require('fs');var Redis=require(_0x7d1d('0x5'));var db=require(_0x7d1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d1d('0x7'))(_0x7d1d('0x8'));var config=require(_0x7d1d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d1d('0xa')][_0x7d1d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b7d44,_0x458b26,_0x31c346){return new BPromise(function(_0x3ee0be,_0x3351e5){return client['request'](_0x3b7d44,_0x31c346)['then'](function(_0x31b835){logger[_0x7d1d('0xc')](_0x7d1d('0xd'),_0x458b26,_0x7d1d('0xe'));logger['debug'](_0x7d1d('0xf'),_0x458b26,_0x7d1d('0xe'),JSON[_0x7d1d('0x10')](_0x31b835));if(_0x31b835[_0x7d1d('0x11')]){if(_0x31b835[_0x7d1d('0x11')][_0x7d1d('0x12')]===0x1f4){logger[_0x7d1d('0x11')](_0x7d1d('0xd'),_0x458b26,_0x31b835[_0x7d1d('0x11')]['message']);return _0x3351e5(_0x31b835['error']['message']);}logger['error'](_0x7d1d('0xd'),_0x458b26,_0x31b835[_0x7d1d('0x11')][_0x7d1d('0x13')]);return _0x3ee0be(_0x31b835['error']['message']);}else{logger[_0x7d1d('0xc')](_0x7d1d('0xd'),_0x458b26,_0x7d1d('0xe'));_0x3ee0be(_0x31b835[_0x7d1d('0x14')][_0x7d1d('0x13')]);}})[_0x7d1d('0x15')](function(_0xbf0a9b){logger[_0x7d1d('0x11')](_0x7d1d('0xd'),_0x458b26,_0xbf0a9b);_0x3351e5(_0xbf0a9b);});});}exports[_0x7d1d('0x16')]=function(_0x103e4a){var _0x4ad117=this;return new Promise(function(_0x1e14eb,_0x5a50ca){return db['MailServerIn'][_0x7d1d('0x17')]({'raw':_0x103e4a['options']?_0x103e4a['options'][_0x7d1d('0x18')]===undefined?!![]:![]:!![],'where':_0x103e4a[_0x7d1d('0x19')]?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1a')]||null:null,'attributes':_0x103e4a[_0x7d1d('0x19')]?_0x103e4a['options'][_0x7d1d('0x1b')]||null:null,'limit':_0x103e4a['options']?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1c')]||null:null,'include':_0x103e4a['options']?_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1d')]?_[_0x7d1d('0x1e')](_0x103e4a[_0x7d1d('0x19')][_0x7d1d('0x1d')],function(_0x158f10){return{'model':db[_0x158f10[_0x7d1d('0x1f')]],'as':_0x158f10['as'],'attributes':_0x158f10[_0x7d1d('0x1b')],'include':_0x158f10[_0x7d1d('0x1d')]?_[_0x7d1d('0x1e')](_0x158f10[_0x7d1d('0x1d')],function(_0x390e22){return{'model':db[_0x390e22[_0x7d1d('0x1f')]],'as':_0x390e22['as'],'attributes':_0x390e22[_0x7d1d('0x1b')],'include':_0x390e22['include']?_[_0x7d1d('0x1e')](_0x390e22['include'],function(_0x3088db){return{'model':db[_0x3088db[_0x7d1d('0x1f')]],'as':_0x3088db['as'],'attributes':_0x3088db[_0x7d1d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7d1d('0x20')](function(_0x2a1bef){logger[_0x7d1d('0xc')](_0x7d1d('0x16'),_0x103e4a);logger[_0x7d1d('0x21')](_0x7d1d('0x16'),_0x103e4a,JSON['stringify'](_0x2a1bef));_0x1e14eb(_0x2a1bef);})[_0x7d1d('0x15')](function(_0x4ce74a){logger['error'](_0x7d1d('0x16'),_0x4ce74a[_0x7d1d('0x13')],_0x103e4a);_0x5a50ca(_0x4ad117['error'](0x1f4,_0x4ce74a[_0x7d1d('0x13')]));});});}; \ No newline at end of file +var _0x22fb=['request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','MailServerIn','findAll','options','where','limit','include','map','attributes','model','GetMailServerIn','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x255265,_0xb097dd){var _0x24dd0c=function(_0x2ebb7b){while(--_0x2ebb7b){_0x255265['push'](_0x255265['shift']());}};_0x24dd0c(++_0xb097dd);}(_0x22fb,0x192));var _0xb22f=function(_0x5f3efb,_0x2ab797){_0x5f3efb=_0x5f3efb-0x0;var _0x4a04e5=_0x22fb[_0x5f3efb];return _0x4a04e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('MailServerIn,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});}exports['GetMailServerIn']=function(_0x252742){var _0x35caec=this;return new Promise(function(_0x2aaec4,_0x1f515d){return db[_0xb22f('0x16')][_0xb22f('0x17')]({'raw':_0x252742['options']?_0x252742[_0xb22f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x252742[_0xb22f('0x18')]?_0x252742[_0xb22f('0x18')][_0xb22f('0x19')]||null:null,'attributes':_0x252742[_0xb22f('0x18')]?_0x252742[_0xb22f('0x18')]['attributes']||null:null,'limit':_0x252742['options']?_0x252742[_0xb22f('0x18')][_0xb22f('0x1a')]||null:null,'include':_0x252742[_0xb22f('0x18')]?_0x252742[_0xb22f('0x18')][_0xb22f('0x1b')]?_[_0xb22f('0x1c')](_0x252742[_0xb22f('0x18')][_0xb22f('0x1b')],function(_0x583fbe){return{'model':db[_0x583fbe['model']],'as':_0x583fbe['as'],'attributes':_0x583fbe[_0xb22f('0x1d')],'include':_0x583fbe[_0xb22f('0x1b')]?_['map'](_0x583fbe[_0xb22f('0x1b')],function(_0x4364f5){return{'model':db[_0x4364f5['model']],'as':_0x4364f5['as'],'attributes':_0x4364f5[_0xb22f('0x1d')],'include':_0x4364f5[_0xb22f('0x1b')]?_['map'](_0x4364f5[_0xb22f('0x1b')],function(_0x2c4a9e){return{'model':db[_0x2c4a9e[_0xb22f('0x1e')]],'as':_0x2c4a9e['as'],'attributes':_0x2c4a9e[_0xb22f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb22f('0xb')](function(_0x246a0c){logger[_0xb22f('0xc')](_0xb22f('0x1f'),_0x252742);logger['debug']('GetMailServerIn',_0x252742,JSON['stringify'](_0x246a0c));_0x2aaec4(_0x246a0c);})[_0xb22f('0x15')](function(_0x557d96){logger[_0xb22f('0x13')](_0xb22f('0x1f'),_0x557d96[_0xb22f('0x12')],_0x252742);_0x1f515d(_0x35caec[_0xb22f('0x13')](0x1f4,_0x557d96[_0xb22f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 6892884..4365eb4 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(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 288bc36..a3a9212 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 _0xea28=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0xea28,0x13a));var _0x8ea2=function(_0x4495f5,_0x2a87a1){_0x4495f5=_0x4495f5-0x0;var _0x2a3b77=_0xea28[_0x4495f5];return _0x2a3b77;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'description':{'type':Sequelize[_0x8ea2('0x2')]},'host':{'type':Sequelize[_0x8ea2('0x2')]},'user':{'type':Sequelize[_0x8ea2('0x2')]},'pass':{'type':Sequelize[_0x8ea2('0x2')]},'port':{'type':Sequelize[_0x8ea2('0x3')]},'secure':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xac4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xac4a,0x13f));var _0xaac4=function(_0x492a6b,_0x163cbc){_0x492a6b=_0x492a6b-0x0;var _0x286d55=_0xac4a[_0x492a6b];return _0x286d55;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'description':{'type':Sequelize[_0xaac4('0x2')]},'host':{'type':Sequelize[_0xaac4('0x2')]},'user':{'type':Sequelize[_0xaac4('0x2')]},'pass':{'type':Sequelize[_0xaac4('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xaac4('0x2')]},'authentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 0718d67..bcf90c0 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 _0x2a50=['apply','reject','save','update','then','error','stack','name','send','MailServerOut','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','zip-dir','fast-json-patch','util','ejs','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range'];(function(_0x1cc972,_0x3c6c34){var _0x3705a2=function(_0x25bcd5){while(--_0x25bcd5){_0x1cc972['push'](_0x1cc972['shift']());}};_0x3705a2(++_0x3c6c34);}(_0x2a50,0x1db));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02a5('0x0'));var jsonpatch=require(_0x02a5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02a5('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x02a5('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02a5('0x4'));var squel=require(_0x02a5('0x5'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x02a5('0x6'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02a5('0x7'));var qs=require(_0x02a5('0x8'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x02a5('0x9'))('api');var utils=require('../../config/utils');var config=require(_0x02a5('0xa'));var licenseUtil=require(_0x02a5('0xb'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bdc82,_0x2fb0a3){_0x2fb0a3=_0x2fb0a3||0xcc;return function(_0x537043){if(_0x537043){return _0x5bdc82[_0x02a5('0xc')](_0x2fb0a3);}return _0x5bdc82[_0x02a5('0xd')](_0x2fb0a3)[_0x02a5('0xe')]();};}function respondWithResult(_0x440d68,_0x3cb4d5){_0x3cb4d5=_0x3cb4d5||0xc8;return function(_0x14bacf){if(_0x14bacf){return _0x440d68['status'](_0x3cb4d5)[_0x02a5('0xf')](_0x14bacf);}};}function respondWithFilteredResult(_0x3c8cf5,_0xa87ab0){return function(_0x206acb){if(_0x206acb){var _0xfbb5a7=typeof _0xa87ab0[_0x02a5('0x10')]==='undefined'&&typeof _0xa87ab0[_0x02a5('0x11')]==='undefined';var _0x1ef65a=_0x206acb['count'];var _0x150f0c=_0xfbb5a7?0x0:_0xa87ab0[_0x02a5('0x10')];var _0x3b6598=_0xfbb5a7?_0x206acb[_0x02a5('0x12')]:_0xa87ab0[_0x02a5('0x10')]+_0xa87ab0[_0x02a5('0x11')];var _0x39c8da;if(_0x3b6598>=_0x1ef65a){_0x3b6598=_0x1ef65a;_0x39c8da=0xc8;}else{_0x39c8da=0xce;}_0x3c8cf5[_0x02a5('0xd')](_0x39c8da);return _0x3c8cf5[_0x02a5('0x13')](_0x02a5('0x14'),_0x150f0c+'-'+_0x3b6598+'/'+_0x1ef65a)[_0x02a5('0xf')](_0x206acb);}return null;};}function patchUpdates(_0x12abc9){return function(_0x382764){try{jsonpatch[_0x02a5('0x15')](_0x382764,_0x12abc9,!![]);}catch(_0xf2dc84){return BPromise[_0x02a5('0x16')](_0xf2dc84);}return _0x382764[_0x02a5('0x17')]();};}function saveUpdates(_0x416596,_0x15dc03){return function(_0x4bfe97){if(_0x4bfe97){return _0x4bfe97[_0x02a5('0x18')](_0x416596)[_0x02a5('0x19')](function(_0x472f38){return _0x472f38;});}return null;};}function removeEntity(_0x4ca801,_0x310dbc){return function(_0x4b69a7){if(_0x4b69a7){return _0x4b69a7['destroy']()[_0x02a5('0x19')](function(){_0x4ca801[_0x02a5('0xd')](0xcc)[_0x02a5('0xe')]();});}};}function handleEntityNotFound(_0x4e8be0,_0x324db3){return function(_0x4026a3){if(!_0x4026a3){_0x4e8be0['sendStatus'](0x194);}return _0x4026a3;};}function handleError(_0x5d86fc,_0x1e5e81){_0x1e5e81=_0x1e5e81||0x1f4;return function(_0x2a8659){logger[_0x02a5('0x1a')](_0x2a8659[_0x02a5('0x1b')]);if(_0x2a8659[_0x02a5('0x1c')]){delete _0x2a8659[_0x02a5('0x1c')];}_0x5d86fc[_0x02a5('0xd')](_0x1e5e81)[_0x02a5('0x1d')](_0x2a8659);};}exports['index']=function(_0x4388f3,_0x56c223){var _0x31642c={},_0x563a83={},_0x543903={'count':0x0,'rows':[]};var _0x5c8ed2=_['map'](db[_0x02a5('0x1e')][_0x02a5('0x1f')],function(_0x1f0329){return{'name':_0x1f0329[_0x02a5('0x20')],'type':_0x1f0329[_0x02a5('0x21')]['key']};});_0x563a83[_0x02a5('0x22')]=_[_0x02a5('0x23')](_0x5c8ed2,_0x02a5('0x1c'));_0x563a83[_0x02a5('0x24')]=_[_0x02a5('0x25')](_0x4388f3[_0x02a5('0x24')]);_0x563a83['filters']=_[_0x02a5('0x26')](_0x563a83['model'],_0x563a83['query']);_0x31642c['attributes']=_[_0x02a5('0x26')](_0x563a83[_0x02a5('0x22')],qs[_0x02a5('0x27')](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x27')]));_0x31642c[_0x02a5('0x28')]=_0x31642c[_0x02a5('0x28')][_0x02a5('0x29')]?_0x31642c['attributes']:_0x563a83['model'];if(!_0x4388f3[_0x02a5('0x24')][_0x02a5('0x2a')](_0x02a5('0x2b'))){_0x31642c[_0x02a5('0x11')]=qs[_0x02a5('0x11')](_0x4388f3[_0x02a5('0x24')]['limit']);_0x31642c[_0x02a5('0x10')]=qs['offset'](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x10')]);}_0x31642c[_0x02a5('0x2c')]=qs['sort'](_0x4388f3[_0x02a5('0x24')][_0x02a5('0x2d')]);_0x31642c['where']=qs[_0x02a5('0x2e')](_[_0x02a5('0x2f')](_0x4388f3[_0x02a5('0x24')],_0x563a83['filters']),_0x5c8ed2);if(_0x4388f3[_0x02a5('0x24')][_0x02a5('0x30')]){_0x31642c[_0x02a5('0x31')]=_[_0x02a5('0x32')](_0x31642c[_0x02a5('0x31')],{'$or':_[_0x02a5('0x23')](_0x5c8ed2,function(_0x35b72d){if(_0x35b72d['type']!==_0x02a5('0x33')){var _0x52917a={};_0x52917a[_0x35b72d[_0x02a5('0x1c')]]={'$like':'%'+_0x4388f3[_0x02a5('0x24')][_0x02a5('0x30')]+'%'};return _0x52917a;}})});}_0x31642c=_[_0x02a5('0x32')]({},_0x31642c,_0x4388f3['options']);var _0x5aa8ae={'where':_0x31642c[_0x02a5('0x31')]};return db[_0x02a5('0x1e')][_0x02a5('0x12')](_0x5aa8ae)[_0x02a5('0x19')](function(_0x5067d3){_0x543903[_0x02a5('0x12')]=_0x5067d3;if(_0x4388f3[_0x02a5('0x24')][_0x02a5('0x34')]){_0x31642c[_0x02a5('0x35')]=[{'all':!![]}];}return db[_0x02a5('0x1e')][_0x02a5('0x36')](_0x31642c);})['then'](function(_0x1f6784){_0x543903[_0x02a5('0x37')]=_0x1f6784;return _0x543903;})[_0x02a5('0x19')](respondWithFilteredResult(_0x56c223,_0x31642c))[_0x02a5('0x38')](handleError(_0x56c223,null));};exports['show']=function(_0x145757,_0x2bbe10){var _0x3c3656={'raw':!![],'where':{'id':_0x145757[_0x02a5('0x39')]['id']}},_0x185357={};_0x185357[_0x02a5('0x22')]=_[_0x02a5('0x25')](db[_0x02a5('0x1e')][_0x02a5('0x1f')]);_0x185357['query']=_[_0x02a5('0x25')](_0x145757['query']);_0x185357[_0x02a5('0x2e')]=_[_0x02a5('0x26')](_0x185357[_0x02a5('0x22')],_0x185357[_0x02a5('0x24')]);_0x3c3656[_0x02a5('0x28')]=_[_0x02a5('0x26')](_0x185357['model'],qs['fields'](_0x145757[_0x02a5('0x24')][_0x02a5('0x27')]));_0x3c3656[_0x02a5('0x28')]=_0x3c3656[_0x02a5('0x28')][_0x02a5('0x29')]?_0x3c3656['attributes']:_0x185357['model'];if(_0x145757['query'][_0x02a5('0x34')]){_0x3c3656[_0x02a5('0x35')]=[{'all':!![]}];}_0x3c3656=_['merge']({},_0x3c3656,_0x145757['options']);return db[_0x02a5('0x1e')][_0x02a5('0x3a')](_0x3c3656)['then'](handleEntityNotFound(_0x2bbe10,null))[_0x02a5('0x19')](respondWithResult(_0x2bbe10,null))[_0x02a5('0x38')](handleError(_0x2bbe10,null));};exports[_0x02a5('0x3b')]=function(_0x51c8d4,_0x1cbe22){return db[_0x02a5('0x1e')]['create'](_0x51c8d4[_0x02a5('0x3c')],{})[_0x02a5('0x19')](respondWithResult(_0x1cbe22,0xc9))[_0x02a5('0x38')](handleError(_0x1cbe22,null));};exports['update']=function(_0x422e7b,_0x535038){if(_0x422e7b['body']['id']){delete _0x422e7b[_0x02a5('0x3c')]['id'];}return db['MailServerOut'][_0x02a5('0x3a')]({'where':{'id':_0x422e7b[_0x02a5('0x39')]['id']}})[_0x02a5('0x19')](handleEntityNotFound(_0x535038,null))[_0x02a5('0x19')](saveUpdates(_0x422e7b[_0x02a5('0x3c')],null))[_0x02a5('0x19')](respondWithResult(_0x535038,null))[_0x02a5('0x38')](handleError(_0x535038,null));};exports[_0x02a5('0x3d')]=function(_0x187cb2,_0x517dcc){return db['MailServerOut'][_0x02a5('0x3a')]({'where':{'id':_0x187cb2[_0x02a5('0x39')]['id']}})[_0x02a5('0x19')](handleEntityNotFound(_0x517dcc,null))[_0x02a5('0x19')](removeEntity(_0x517dcc,null))[_0x02a5('0x38')](handleError(_0x517dcc,null));}; \ No newline at end of file +var _0xb51e=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','merge','create','body','find','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','map','MailServerOut','rawAttributes','fieldName'];(function(_0x86f62f,_0x161b35){var _0xd764fc=function(_0x323461){while(--_0x323461){_0x86f62f['push'](_0x86f62f['shift']());}};_0xd764fc(++_0x161b35);}(_0xb51e,0x16e));var _0xeb51=function(_0x452a26,_0x4ba240){_0x452a26=_0x452a26-0x0;var _0x4c0155=_0xb51e[_0x452a26];return _0x4c0155;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb51('0x0'));var rp=require(_0xeb51('0x1'));var moment=require('moment');var BPromise=require(_0xeb51('0x2'));var Mustache=require(_0xeb51('0x3'));var util=require(_0xeb51('0x4'));var path=require(_0xeb51('0x5'));var sox=require(_0xeb51('0x6'));var csv=require(_0xeb51('0x7'));var ejs=require(_0xeb51('0x8'));var fs=require('fs');var fs_extra=require(_0xeb51('0x9'));var _=require('lodash');var squel=require(_0xeb51('0xa'));var crypto=require('crypto');var jsforce=require(_0xeb51('0xb'));var deskjs=require(_0xeb51('0xc'));var toCsv=require(_0xeb51('0x7'));var querystring=require(_0xeb51('0xd'));var Papa=require(_0xeb51('0xe'));var Redis=require(_0xeb51('0xf'));var authService=require(_0xeb51('0x10'));var qs=require(_0xeb51('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb51('0x12'));var logger=require('../../config/logger')(_0xeb51('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb51('0x14'));var db=require(_0xeb51('0x15'))['db'];function respondWithStatusCode(_0x5d93ce,_0x5f582c){_0x5f582c=_0x5f582c||0xcc;return function(_0x219453){if(_0x219453){return _0x5d93ce[_0xeb51('0x16')](_0x5f582c);}return _0x5d93ce[_0xeb51('0x17')](_0x5f582c)[_0xeb51('0x18')]();};}function respondWithResult(_0x1ffb21,_0x5874f4){_0x5874f4=_0x5874f4||0xc8;return function(_0xbb657e){if(_0xbb657e){return _0x1ffb21['status'](_0x5874f4)[_0xeb51('0x19')](_0xbb657e);}};}function respondWithFilteredResult(_0x5e41fd,_0x2f0ea2){return function(_0x597f51){if(_0x597f51){var _0x3470f5=typeof _0x2f0ea2['offset']===_0xeb51('0x1a')&&typeof _0x2f0ea2['limit']==='undefined';var _0x51f6c1=_0x597f51[_0xeb51('0x1b')];var _0x43b866=_0x3470f5?0x0:_0x2f0ea2[_0xeb51('0x1c')];var _0x313166=_0x3470f5?_0x597f51[_0xeb51('0x1b')]:_0x2f0ea2['offset']+_0x2f0ea2[_0xeb51('0x1d')];var _0x90fbe3;if(_0x313166>=_0x51f6c1){_0x313166=_0x51f6c1;_0x90fbe3=0xc8;}else{_0x90fbe3=0xce;}_0x5e41fd[_0xeb51('0x17')](_0x90fbe3);return _0x5e41fd['set'](_0xeb51('0x1e'),_0x43b866+'-'+_0x313166+'/'+_0x51f6c1)['json'](_0x597f51);}return null;};}function patchUpdates(_0x4e11dd){return function(_0x2321ad){try{jsonpatch['apply'](_0x2321ad,_0x4e11dd,!![]);}catch(_0x221c1a){return BPromise[_0xeb51('0x1f')](_0x221c1a);}return _0x2321ad[_0xeb51('0x20')]();};}function saveUpdates(_0x20d773,_0x5d9246){return function(_0x38dd8b){if(_0x38dd8b){return _0x38dd8b['update'](_0x20d773)[_0xeb51('0x21')](function(_0x10c2c4){return _0x10c2c4;});}return null;};}function removeEntity(_0x5979c5,_0x5d67fd){return function(_0x358b72){if(_0x358b72){return _0x358b72[_0xeb51('0x22')]()[_0xeb51('0x21')](function(){_0x5979c5[_0xeb51('0x17')](0xcc)[_0xeb51('0x18')]();});}};}function handleEntityNotFound(_0x34a84e,_0x536724){return function(_0x158181){if(!_0x158181){_0x34a84e['sendStatus'](0x194);}return _0x158181;};}function handleError(_0x15d0d3,_0x187c26){_0x187c26=_0x187c26||0x1f4;return function(_0x48df29){logger[_0xeb51('0x23')](_0x48df29[_0xeb51('0x24')]);if(_0x48df29[_0xeb51('0x25')]){delete _0x48df29['name'];}_0x15d0d3[_0xeb51('0x17')](_0x187c26)['send'](_0x48df29);};}exports['index']=function(_0x48f043,_0xdba17e){var _0x501dc8={},_0x548e30={},_0x5c9af3={'count':0x0,'rows':[]};var _0x20b58f=_[_0xeb51('0x26')](db[_0xeb51('0x27')][_0xeb51('0x28')],function(_0xee8356){return{'name':_0xee8356[_0xeb51('0x29')],'type':_0xee8356['type'][_0xeb51('0x2a')]};});_0x548e30[_0xeb51('0x2b')]=_[_0xeb51('0x26')](_0x20b58f,_0xeb51('0x25'));_0x548e30[_0xeb51('0x2c')]=_[_0xeb51('0x2d')](_0x48f043[_0xeb51('0x2c')]);_0x548e30[_0xeb51('0x2e')]=_[_0xeb51('0x2f')](_0x548e30[_0xeb51('0x2b')],_0x548e30[_0xeb51('0x2c')]);_0x501dc8['attributes']=_[_0xeb51('0x2f')](_0x548e30[_0xeb51('0x2b')],qs[_0xeb51('0x30')](_0x48f043[_0xeb51('0x2c')][_0xeb51('0x30')]));_0x501dc8['attributes']=_0x501dc8[_0xeb51('0x31')]['length']?_0x501dc8['attributes']:_0x548e30[_0xeb51('0x2b')];if(!_0x48f043[_0xeb51('0x2c')][_0xeb51('0x32')](_0xeb51('0x33'))){_0x501dc8[_0xeb51('0x1d')]=qs[_0xeb51('0x1d')](_0x48f043[_0xeb51('0x2c')][_0xeb51('0x1d')]);_0x501dc8[_0xeb51('0x1c')]=qs[_0xeb51('0x1c')](_0x48f043['query'][_0xeb51('0x1c')]);}_0x501dc8['order']=qs[_0xeb51('0x34')](_0x48f043['query'][_0xeb51('0x34')]);_0x501dc8[_0xeb51('0x35')]=qs[_0xeb51('0x2e')](_[_0xeb51('0x36')](_0x48f043['query'],_0x548e30['filters']),_0x20b58f);if(_0x48f043[_0xeb51('0x2c')][_0xeb51('0x37')]){_0x501dc8[_0xeb51('0x35')]=_['merge'](_0x501dc8['where'],{'$or':_[_0xeb51('0x26')](_0x20b58f,function(_0x2037c0){if(_0x2037c0['type']!==_0xeb51('0x38')){var _0x39ee66={};_0x39ee66[_0x2037c0[_0xeb51('0x25')]]={'$like':'%'+_0x48f043[_0xeb51('0x2c')]['filter']+'%'};return _0x39ee66;}})});}_0x501dc8=_['merge']({},_0x501dc8,_0x48f043[_0xeb51('0x39')]);var _0x179d00={'where':_0x501dc8['where']};return db['MailServerOut'][_0xeb51('0x1b')](_0x179d00)[_0xeb51('0x21')](function(_0x4456ab){_0x5c9af3[_0xeb51('0x1b')]=_0x4456ab;if(_0x48f043[_0xeb51('0x2c')][_0xeb51('0x3a')]){_0x501dc8['include']=[{'all':!![]}];}return db['MailServerOut'][_0xeb51('0x3b')](_0x501dc8);})[_0xeb51('0x21')](function(_0x3d3953){_0x5c9af3[_0xeb51('0x3c')]=_0x3d3953;return _0x5c9af3;})[_0xeb51('0x21')](respondWithFilteredResult(_0xdba17e,_0x501dc8))[_0xeb51('0x3d')](handleError(_0xdba17e,null));};exports['show']=function(_0x472f6f,_0x21335b){var _0x214173={'raw':!![],'where':{'id':_0x472f6f[_0xeb51('0x3e')]['id']}},_0x9b8d95={};_0x9b8d95[_0xeb51('0x2b')]=_[_0xeb51('0x2d')](db[_0xeb51('0x27')][_0xeb51('0x28')]);_0x9b8d95[_0xeb51('0x2c')]=_[_0xeb51('0x2d')](_0x472f6f['query']);_0x9b8d95[_0xeb51('0x2e')]=_['intersection'](_0x9b8d95[_0xeb51('0x2b')],_0x9b8d95[_0xeb51('0x2c')]);_0x214173[_0xeb51('0x31')]=_[_0xeb51('0x2f')](_0x9b8d95[_0xeb51('0x2b')],qs[_0xeb51('0x30')](_0x472f6f[_0xeb51('0x2c')][_0xeb51('0x30')]));_0x214173['attributes']=_0x214173[_0xeb51('0x31')]['length']?_0x214173['attributes']:_0x9b8d95[_0xeb51('0x2b')];if(_0x472f6f[_0xeb51('0x2c')][_0xeb51('0x3a')]){_0x214173[_0xeb51('0x3f')]=[{'all':!![]}];}_0x214173=_[_0xeb51('0x40')]({},_0x214173,_0x472f6f[_0xeb51('0x39')]);return db[_0xeb51('0x27')]['find'](_0x214173)[_0xeb51('0x21')](handleEntityNotFound(_0x21335b,null))['then'](respondWithResult(_0x21335b,null))[_0xeb51('0x3d')](handleError(_0x21335b,null));};exports[_0xeb51('0x41')]=function(_0x5ea8cd,_0x3b7217){return db['MailServerOut'][_0xeb51('0x41')](_0x5ea8cd[_0xeb51('0x42')],{})[_0xeb51('0x21')](respondWithResult(_0x3b7217,0xc9))[_0xeb51('0x3d')](handleError(_0x3b7217,null));};exports['update']=function(_0x1847b2,_0x259f7b){if(_0x1847b2[_0xeb51('0x42')]['id']){delete _0x1847b2[_0xeb51('0x42')]['id'];}return db['MailServerOut'][_0xeb51('0x43')]({'where':{'id':_0x1847b2[_0xeb51('0x3e')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x259f7b,null))[_0xeb51('0x21')](saveUpdates(_0x1847b2['body'],null))[_0xeb51('0x21')](respondWithResult(_0x259f7b,null))[_0xeb51('0x3d')](handleError(_0x259f7b,null));};exports[_0xeb51('0x22')]=function(_0x351952,_0x437800){return db[_0xeb51('0x27')]['find']({'where':{'id':_0x351952[_0xeb51('0x3e')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x437800,null))[_0xeb51('0x21')](removeEntity(_0x437800,null))[_0xeb51('0x3d')](handleError(_0x437800,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 2de25d6..7374059 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 _0x2254=['bluebird','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','moment'];(function(_0x26df10,_0x8990e4){var _0x270348=function(_0x438918){while(--_0x438918){_0x26df10['push'](_0x26df10['shift']());}};_0x270348(++_0x8990e4);}(_0x2254,0x115));var _0x4225=function(_0xede3fe,_0x27c3c5){_0xede3fe=_0xede3fe-0x0;var _0x59657a=_0x2254[_0xede3fe];return _0x59657a;};'use strict';var _=require(_0x4225('0x0'));var util=require(_0x4225('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4225('0x2'));var BPromise=require(_0x4225('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4225('0x4'));var config=require(_0x4225('0x5'));var attributes=require(_0x4225('0x6'));module[_0x4225('0x7')]=function(_0x2db52d,_0x256526){return _0x2db52d[_0x4225('0x8')](_0x4225('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71a1=['./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d82ec,_0x475a60){var _0x2e4296=function(_0xac179f){while(--_0xac179f){_0x4d82ec['push'](_0x4d82ec['shift']());}};_0x2e4296(++_0x475a60);}(_0x71a1,0x10c));var _0x171a=function(_0x4a5da8,_0x525338){_0x4a5da8=_0x4a5da8-0x0;var _0x87545c=_0x71a1[_0x4a5da8];return _0x87545c;};'use strict';var _=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x171a('0x2'));var BPromise=require(_0x171a('0x3'));var rp=require(_0x171a('0x4'));var fs=require('fs');var path=require(_0x171a('0x5'));var rimraf=require(_0x171a('0x6'));var config=require(_0x171a('0x7'));var attributes=require(_0x171a('0x8'));module[_0x171a('0x9')]=function(_0xde6bf5,_0x58bac1){return _0xde6bf5['define'](_0x171a('0xa'),attributes,{'tableName':_0x171a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 6c21414..755cf27 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4cc0f8,_0xe8dcab){var _0xb1250c=function(_0x39a419){while(--_0x39a419){_0x4cc0f8['push'](_0x4cc0f8['shift']());}};_0xb1250c(++_0xe8dcab);}(_0x1261,0x144));var _0x1126=function(_0x3c6835,_0x952d5c){_0x3c6835=_0x3c6835-0x0;var _0x1adeb9=_0x1261[_0x3c6835];return _0x1adeb9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x50bd8f,_0x5031ab){var _0x1169a6=function(_0x5ac136){while(--_0x5ac136){_0x50bd8f['push'](_0x50bd8f['shift']());}};_0x1169a6(++_0x5031ab);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index d8e3309..bb44214 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 _0x0fe7=['/:id','update','multer','path','express','fs-extra','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x4cdf9d,_0xf0c32){var _0x5c34e1=function(_0x47a864){while(--_0x47a864){_0x4cdf9d['push'](_0x4cdf9d['shift']());}};_0x5c34e1(++_0xf0c32);}(_0x0fe7,0xf2));var _0x70fe=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x0fe7[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0x70fe('0x0'));var util=require('util');var path=require(_0x70fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x70fe('0x2'));var router=express['Router']();var fs_extra=require(_0x70fe('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x70fe('0x4'));var controller=require(_0x70fe('0x5'));router[_0x70fe('0x6')]('/',auth[_0x70fe('0x7')](),controller[_0x70fe('0x8')]);router[_0x70fe('0x6')](_0x70fe('0x9'),auth[_0x70fe('0x7')](),controller[_0x70fe('0xa')]);router[_0x70fe('0x6')]('/:id',auth[_0x70fe('0x7')](),controller[_0x70fe('0xb')]);router[_0x70fe('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x70fe('0xd'),auth[_0x70fe('0x7')](),controller[_0x70fe('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9624=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x196a09,_0xc05bbf){var _0x509124=function(_0x4526b6){while(--_0x4526b6){_0x196a09['push'](_0x196a09['shift']());}};_0x509124(++_0xc05bbf);}(_0x9624,0x1cf));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4962('0x0'));var util=require(_0x4962('0x1'));var path=require(_0x4962('0x2'));var timeout=require(_0x4962('0x3'));var express=require(_0x4962('0x4'));var router=express[_0x4962('0x5')]();var fs_extra=require(_0x4962('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4962('0x7'));var controller=require(_0x4962('0x8'));router[_0x4962('0x9')]('/',auth['isAuthenticated'](),controller[_0x4962('0xa')]);router[_0x4962('0x9')](_0x4962('0xb'),auth[_0x4962('0xc')](),controller[_0x4962('0xd')]);router[_0x4962('0x9')](_0x4962('0xe'),auth[_0x4962('0xc')](),controller[_0x4962('0xf')]);router[_0x4962('0x10')]('/',auth[_0x4962('0xc')](),controller[_0x4962('0x11')]);router[_0x4962('0x12')](_0x4962('0xe'),auth[_0x4962('0xc')](),controller[_0x4962('0x13')]);router[_0x4962('0x14')]('/:id',auth[_0x4962('0xc')](),controller[_0x4962('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 1dca821..85a12d9 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 _0x5e0e=['STRING','sequelize','exports','name'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x5e0e,0x89));var _0xe5e0=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0x5e0e[_0x1c470d];return _0x12141b;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe5e0('0x3')]}}; \ No newline at end of file +var _0xfcf0=['sequelize','exports','name','STRING'];(function(_0x31f2b7,_0xc6ab9a){var _0x57835d=function(_0x29b765){while(--_0x29b765){_0x31f2b7['push'](_0x31f2b7['shift']());}};_0x57835d(++_0xc6ab9a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0xfcf0[_0x12c280];return _0x3638d3;};'use strict';var Sequelize=require(_0x0fcf('0x0'));module[_0x0fcf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0fcf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0fcf('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 111d47f..69baffe 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 _0x0edd=['includeAll','find','catch','create','body','describe','rimraf','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','show','params'];(function(_0x5d2c82,_0xadbd70){var _0x9047d4=function(_0x2646a2){while(--_0x2646a2){_0x5d2c82['push'](_0x5d2c82['shift']());}};_0x9047d4(++_0xadbd70);}(_0x0edd,0xde));var _0xd0ed=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0edd[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0ed('0x1'));var BPromise=require(_0xd0ed('0x2'));var Mustache=require(_0xd0ed('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd0ed('0x4'));var ejs=require(_0xd0ed('0x5'));var fs=require('fs');var fs_extra=require(_0xd0ed('0x6'));var _=require(_0xd0ed('0x7'));var squel=require(_0xd0ed('0x8'));var crypto=require(_0xd0ed('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd0ed('0xa'));var toCsv=require(_0xd0ed('0x4'));var querystring=require('querystring');var Papa=require(_0xd0ed('0xb'));var Redis=require(_0xd0ed('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd0ed('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0ed('0xe'));var logger=require(_0xd0ed('0xf'))('api');var utils=require(_0xd0ed('0x10'));var config=require(_0xd0ed('0x11'));var licenseUtil=require(_0xd0ed('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43a7c7,_0x594379){_0x594379=_0x594379||0xcc;return function(_0x595fbb){if(_0x595fbb){return _0x43a7c7['sendStatus'](_0x594379);}return _0x43a7c7[_0xd0ed('0x13')](_0x594379)['end']();};}function respondWithResult(_0x4308ad,_0x39b4ea){_0x39b4ea=_0x39b4ea||0xc8;return function(_0x184195){if(_0x184195){return _0x4308ad[_0xd0ed('0x13')](_0x39b4ea)[_0xd0ed('0x14')](_0x184195);}};}function respondWithFilteredResult(_0x5962c2,_0x33e7c6){return function(_0x89a947){if(_0x89a947){var _0x4a13e6=typeof _0x33e7c6['offset']==='undefined'&&typeof _0x33e7c6[_0xd0ed('0x15')]===_0xd0ed('0x16');var _0x1f9e88=_0x89a947[_0xd0ed('0x17')];var _0x20c88e=_0x4a13e6?0x0:_0x33e7c6[_0xd0ed('0x18')];var _0x4e7c54=_0x4a13e6?_0x89a947[_0xd0ed('0x17')]:_0x33e7c6['offset']+_0x33e7c6[_0xd0ed('0x15')];var _0x473508;if(_0x4e7c54>=_0x1f9e88){_0x4e7c54=_0x1f9e88;_0x473508=0xc8;}else{_0x473508=0xce;}_0x5962c2[_0xd0ed('0x13')](_0x473508);return _0x5962c2[_0xd0ed('0x19')](_0xd0ed('0x1a'),_0x20c88e+'-'+_0x4e7c54+'/'+_0x1f9e88)['json'](_0x89a947);}return null;};}function patchUpdates(_0x2a9f38){return function(_0x5e2604){try{jsonpatch[_0xd0ed('0x1b')](_0x5e2604,_0x2a9f38,!![]);}catch(_0x8c7fef){return BPromise[_0xd0ed('0x1c')](_0x8c7fef);}return _0x5e2604[_0xd0ed('0x1d')]();};}function saveUpdates(_0x5570c5,_0x1b41ee){return function(_0x5bb179){if(_0x5bb179){return _0x5bb179[_0xd0ed('0x1e')](_0x5570c5)[_0xd0ed('0x1f')](function(_0x18721f){return _0x18721f;});}return null;};}function removeEntity(_0x252399,_0x5e138d){return function(_0x47411e){if(_0x47411e){return _0x47411e[_0xd0ed('0x20')]()[_0xd0ed('0x1f')](function(){_0x252399[_0xd0ed('0x13')](0xcc)[_0xd0ed('0x21')]();});}};}function handleEntityNotFound(_0x45affa,_0x1d9f43){return function(_0x13cad9){if(!_0x13cad9){_0x45affa['sendStatus'](0x194);}return _0x13cad9;};}function handleError(_0x2ed97a,_0xd9f2af){_0xd9f2af=_0xd9f2af||0x1f4;return function(_0x253a64){logger[_0xd0ed('0x22')](_0x253a64[_0xd0ed('0x23')]);if(_0x253a64[_0xd0ed('0x24')]){delete _0x253a64[_0xd0ed('0x24')];}_0x2ed97a[_0xd0ed('0x13')](_0xd9f2af)[_0xd0ed('0x25')](_0x253a64);};}exports[_0xd0ed('0x26')]=function(_0x166a2e,_0x3be0ae){var _0x26c275={},_0xe40bca={},_0x2626e6={'count':0x0,'rows':[]};var _0x1dc8f1=_['map'](db[_0xd0ed('0x27')][_0xd0ed('0x28')],function(_0x128b20){return{'name':_0x128b20[_0xd0ed('0x29')],'type':_0x128b20[_0xd0ed('0x2a')]['key']};});_0xe40bca[_0xd0ed('0x2b')]=_['map'](_0x1dc8f1,_0xd0ed('0x24'));_0xe40bca['query']=_[_0xd0ed('0x2c')](_0x166a2e[_0xd0ed('0x2d')]);_0xe40bca['filters']=_[_0xd0ed('0x2e')](_0xe40bca['model'],_0xe40bca['query']);_0x26c275[_0xd0ed('0x2f')]=_[_0xd0ed('0x2e')](_0xe40bca[_0xd0ed('0x2b')],qs[_0xd0ed('0x30')](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x30')]));_0x26c275[_0xd0ed('0x2f')]=_0x26c275['attributes'][_0xd0ed('0x31')]?_0x26c275[_0xd0ed('0x2f')]:_0xe40bca[_0xd0ed('0x2b')];if(!_0x166a2e[_0xd0ed('0x2d')]['hasOwnProperty'](_0xd0ed('0x32'))){_0x26c275['limit']=qs['limit'](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x15')]);_0x26c275[_0xd0ed('0x18')]=qs[_0xd0ed('0x18')](_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x18')]);}_0x26c275[_0xd0ed('0x33')]=qs[_0xd0ed('0x34')](_0x166a2e['query']['sort']);_0x26c275[_0xd0ed('0x35')]=qs[_0xd0ed('0x36')](_[_0xd0ed('0x37')](_0x166a2e['query'],_0xe40bca[_0xd0ed('0x36')]),_0x1dc8f1);if(_0x166a2e[_0xd0ed('0x2d')][_0xd0ed('0x38')]){_0x26c275[_0xd0ed('0x35')]=_['merge'](_0x26c275[_0xd0ed('0x35')],{'$or':_[_0xd0ed('0x39')](_0x1dc8f1,function(_0x1a508e){if(_0x1a508e[_0xd0ed('0x2a')]!==_0xd0ed('0x3a')){var _0x4494de={};_0x4494de[_0x1a508e[_0xd0ed('0x24')]]={'$like':'%'+_0x166a2e[_0xd0ed('0x2d')]['filter']+'%'};return _0x4494de;}})});}_0x26c275=_[_0xd0ed('0x3b')]({},_0x26c275,_0x166a2e[_0xd0ed('0x3c')]);var _0x18d17a={'where':_0x26c275[_0xd0ed('0x35')]};return db['MailSubstatus'][_0xd0ed('0x17')](_0x18d17a)[_0xd0ed('0x1f')](function(_0xc31a16){_0x2626e6[_0xd0ed('0x17')]=_0xc31a16;if(_0x166a2e[_0xd0ed('0x2d')]['includeAll']){_0x26c275[_0xd0ed('0x3d')]=[{'all':!![]}];}return db[_0xd0ed('0x27')][_0xd0ed('0x3e')](_0x26c275);})['then'](function(_0x17fec7){_0x2626e6[_0xd0ed('0x3f')]=_0x17fec7;return _0x2626e6;})['then'](respondWithFilteredResult(_0x3be0ae,_0x26c275))['catch'](handleError(_0x3be0ae,null));};exports[_0xd0ed('0x40')]=function(_0x3a90e5,_0x864fa2){var _0x2af13e={'raw':!![],'where':{'id':_0x3a90e5[_0xd0ed('0x41')]['id']}},_0x1dabc9={};_0x1dabc9['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x1dabc9['query']=_[_0xd0ed('0x2c')](_0x3a90e5[_0xd0ed('0x2d')]);_0x1dabc9[_0xd0ed('0x36')]=_['intersection'](_0x1dabc9[_0xd0ed('0x2b')],_0x1dabc9[_0xd0ed('0x2d')]);_0x2af13e['attributes']=_[_0xd0ed('0x2e')](_0x1dabc9[_0xd0ed('0x2b')],qs['fields'](_0x3a90e5[_0xd0ed('0x2d')][_0xd0ed('0x30')]));_0x2af13e[_0xd0ed('0x2f')]=_0x2af13e['attributes'][_0xd0ed('0x31')]?_0x2af13e[_0xd0ed('0x2f')]:_0x1dabc9['model'];if(_0x3a90e5[_0xd0ed('0x2d')][_0xd0ed('0x42')]){_0x2af13e[_0xd0ed('0x3d')]=[{'all':!![]}];}_0x2af13e=_[_0xd0ed('0x3b')]({},_0x2af13e,_0x3a90e5['options']);return db[_0xd0ed('0x27')][_0xd0ed('0x43')](_0x2af13e)['then'](handleEntityNotFound(_0x864fa2,null))['then'](respondWithResult(_0x864fa2,null))[_0xd0ed('0x44')](handleError(_0x864fa2,null));};exports[_0xd0ed('0x45')]=function(_0x511b9c,_0x3fc5bd){return db['MailSubstatus'][_0xd0ed('0x45')](_0x511b9c[_0xd0ed('0x46')],{})[_0xd0ed('0x1f')](respondWithResult(_0x3fc5bd,0xc9))[_0xd0ed('0x44')](handleError(_0x3fc5bd,null));};exports['update']=function(_0x365cf0,_0x1c74f4){if(_0x365cf0[_0xd0ed('0x46')]['id']){delete _0x365cf0[_0xd0ed('0x46')]['id'];}return db['MailSubstatus'][_0xd0ed('0x43')]({'where':{'id':_0x365cf0[_0xd0ed('0x41')]['id']}})[_0xd0ed('0x1f')](handleEntityNotFound(_0x1c74f4,null))[_0xd0ed('0x1f')](saveUpdates(_0x365cf0['body'],null))['then'](respondWithResult(_0x1c74f4,null))[_0xd0ed('0x44')](handleError(_0x1c74f4,null));};exports[_0xd0ed('0x20')]=function(_0x119f45,_0x589a37){return db[_0xd0ed('0x27')][_0xd0ed('0x43')]({'where':{'id':_0x119f45[_0xd0ed('0x41')]['id']}})[_0xd0ed('0x1f')](handleEntityNotFound(_0x589a37,null))[_0xd0ed('0x1f')](removeEntity(_0x589a37,null))['catch'](handleError(_0x589a37,null));};exports[_0xd0ed('0x47')]=function(_0x1f506d,_0x17c883){return db[_0xd0ed('0x27')][_0xd0ed('0x47')]()['then'](respondWithResult(_0x17c883,null))[_0xd0ed('0x44')](handleError(_0x17c883,null));}; \ No newline at end of file +var _0x7398=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','keys','filters','intersection','query','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','model','includeAll','find','create','body','catch','update','describe','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7398,0x82));var _0x8739=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x7398[_0x1e7b16];return _0x37fadc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8739('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8739('0x1'));var rp=require(_0x8739('0x2'));var moment=require('moment');var BPromise=require(_0x8739('0x3'));var Mustache=require('mustache');var util=require(_0x8739('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x8739('0x5'));var ejs=require(_0x8739('0x6'));var fs=require('fs');var fs_extra=require(_0x8739('0x7'));var _=require('lodash');var squel=require(_0x8739('0x8'));var crypto=require(_0x8739('0x9'));var jsforce=require(_0x8739('0xa'));var deskjs=require(_0x8739('0xb'));var toCsv=require(_0x8739('0x5'));var querystring=require(_0x8739('0xc'));var Papa=require(_0x8739('0xd'));var Redis=require('ioredis');var authService=require(_0x8739('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8739('0xf'));var hardwareService=require(_0x8739('0x10'));var logger=require(_0x8739('0x11'))(_0x8739('0x12'));var utils=require(_0x8739('0x13'));var config=require(_0x8739('0x14'));var licenseUtil=require(_0x8739('0x15'));var db=require(_0x8739('0x16'))['db'];function respondWithStatusCode(_0x1ce7b6,_0x348323){_0x348323=_0x348323||0xcc;return function(_0x2ed2ea){if(_0x2ed2ea){return _0x1ce7b6['sendStatus'](_0x348323);}return _0x1ce7b6[_0x8739('0x17')](_0x348323)['end']();};}function respondWithResult(_0x11d088,_0x4e7d34){_0x4e7d34=_0x4e7d34||0xc8;return function(_0x43b07c){if(_0x43b07c){return _0x11d088['status'](_0x4e7d34)['json'](_0x43b07c);}};}function respondWithFilteredResult(_0x433774,_0xc4a7e){return function(_0x34dd58){if(_0x34dd58){var _0x3e8203=typeof _0xc4a7e[_0x8739('0x18')]===_0x8739('0x19')&&typeof _0xc4a7e['limit']==='undefined';var _0x599e86=_0x34dd58[_0x8739('0x1a')];var _0x27ed6a=_0x3e8203?0x0:_0xc4a7e[_0x8739('0x18')];var _0x3a61f5=_0x3e8203?_0x34dd58['count']:_0xc4a7e[_0x8739('0x18')]+_0xc4a7e[_0x8739('0x1b')];var _0x1fc883;if(_0x3a61f5>=_0x599e86){_0x3a61f5=_0x599e86;_0x1fc883=0xc8;}else{_0x1fc883=0xce;}_0x433774[_0x8739('0x17')](_0x1fc883);return _0x433774[_0x8739('0x1c')](_0x8739('0x1d'),_0x27ed6a+'-'+_0x3a61f5+'/'+_0x599e86)['json'](_0x34dd58);}return null;};}function patchUpdates(_0x4b4bec){return function(_0x217a5b){try{jsonpatch['apply'](_0x217a5b,_0x4b4bec,!![]);}catch(_0x35a0c5){return BPromise['reject'](_0x35a0c5);}return _0x217a5b['save']();};}function saveUpdates(_0x5b7323,_0x1c7f15){return function(_0x1b874a){if(_0x1b874a){return _0x1b874a['update'](_0x5b7323)[_0x8739('0x1e')](function(_0x12814d){return _0x12814d;});}return null;};}function removeEntity(_0x2b2b4b,_0x6975b4){return function(_0x1c1f14){if(_0x1c1f14){return _0x1c1f14[_0x8739('0x1f')]()[_0x8739('0x1e')](function(){_0x2b2b4b[_0x8739('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6141c,_0x48e54c){return function(_0xe0efaf){if(!_0xe0efaf){_0xc6141c[_0x8739('0x20')](0x194);}return _0xe0efaf;};}function handleError(_0x34ae6c,_0x3a51e7){_0x3a51e7=_0x3a51e7||0x1f4;return function(_0x4044f7){logger[_0x8739('0x21')](_0x4044f7[_0x8739('0x22')]);if(_0x4044f7[_0x8739('0x23')]){delete _0x4044f7[_0x8739('0x23')];}_0x34ae6c[_0x8739('0x17')](_0x3a51e7)[_0x8739('0x24')](_0x4044f7);};}exports[_0x8739('0x25')]=function(_0x5e219f,_0x3c075d){var _0x3b03e8={},_0x238c5e={},_0x29205f={'count':0x0,'rows':[]};var _0x2f8f52=_[_0x8739('0x26')](db[_0x8739('0x27')][_0x8739('0x28')],function(_0x1491f6){return{'name':_0x1491f6['fieldName'],'type':_0x1491f6[_0x8739('0x29')][_0x8739('0x2a')]};});_0x238c5e['model']=_[_0x8739('0x26')](_0x2f8f52,'name');_0x238c5e['query']=_[_0x8739('0x2b')](_0x5e219f['query']);_0x238c5e[_0x8739('0x2c')]=_[_0x8739('0x2d')](_0x238c5e['model'],_0x238c5e[_0x8739('0x2e')]);_0x3b03e8[_0x8739('0x2f')]=_['intersection'](_0x238c5e['model'],qs[_0x8739('0x30')](_0x5e219f[_0x8739('0x2e')][_0x8739('0x30')]));_0x3b03e8[_0x8739('0x2f')]=_0x3b03e8[_0x8739('0x2f')][_0x8739('0x31')]?_0x3b03e8[_0x8739('0x2f')]:_0x238c5e['model'];if(!_0x5e219f['query']['hasOwnProperty'](_0x8739('0x32'))){_0x3b03e8[_0x8739('0x1b')]=qs[_0x8739('0x1b')](_0x5e219f[_0x8739('0x2e')]['limit']);_0x3b03e8[_0x8739('0x18')]=qs['offset'](_0x5e219f[_0x8739('0x2e')][_0x8739('0x18')]);}_0x3b03e8['order']=qs['sort'](_0x5e219f[_0x8739('0x2e')][_0x8739('0x33')]);_0x3b03e8[_0x8739('0x34')]=qs[_0x8739('0x2c')](_['pick'](_0x5e219f[_0x8739('0x2e')],_0x238c5e[_0x8739('0x2c')]),_0x2f8f52);if(_0x5e219f[_0x8739('0x2e')][_0x8739('0x35')]){_0x3b03e8[_0x8739('0x34')]=_['merge'](_0x3b03e8['where'],{'$or':_[_0x8739('0x26')](_0x2f8f52,function(_0x5a221b){if(_0x5a221b[_0x8739('0x29')]!==_0x8739('0x36')){var _0xfd1a8d={};_0xfd1a8d[_0x5a221b[_0x8739('0x23')]]={'$like':'%'+_0x5e219f[_0x8739('0x2e')][_0x8739('0x35')]+'%'};return _0xfd1a8d;}})});}_0x3b03e8=_[_0x8739('0x37')]({},_0x3b03e8,_0x5e219f[_0x8739('0x38')]);var _0x493327={'where':_0x3b03e8['where']};return db[_0x8739('0x27')][_0x8739('0x1a')](_0x493327)['then'](function(_0xd3036e){_0x29205f['count']=_0xd3036e;if(_0x5e219f[_0x8739('0x2e')]['includeAll']){_0x3b03e8[_0x8739('0x39')]=[{'all':!![]}];}return db[_0x8739('0x27')][_0x8739('0x3a')](_0x3b03e8);})[_0x8739('0x1e')](function(_0x44368c){_0x29205f[_0x8739('0x3b')]=_0x44368c;return _0x29205f;})[_0x8739('0x1e')](respondWithFilteredResult(_0x3c075d,_0x3b03e8))['catch'](handleError(_0x3c075d,null));};exports[_0x8739('0x3c')]=function(_0x5f3eb9,_0x3727cc){var _0x16eccd={'raw':!![],'where':{'id':_0x5f3eb9[_0x8739('0x3d')]['id']}},_0xf5a025={};_0xf5a025[_0x8739('0x3e')]=_['keys'](db[_0x8739('0x27')][_0x8739('0x28')]);_0xf5a025[_0x8739('0x2e')]=_[_0x8739('0x2b')](_0x5f3eb9[_0x8739('0x2e')]);_0xf5a025['filters']=_['intersection'](_0xf5a025[_0x8739('0x3e')],_0xf5a025[_0x8739('0x2e')]);_0x16eccd[_0x8739('0x2f')]=_['intersection'](_0xf5a025[_0x8739('0x3e')],qs[_0x8739('0x30')](_0x5f3eb9[_0x8739('0x2e')]['fields']));_0x16eccd['attributes']=_0x16eccd[_0x8739('0x2f')][_0x8739('0x31')]?_0x16eccd[_0x8739('0x2f')]:_0xf5a025[_0x8739('0x3e')];if(_0x5f3eb9[_0x8739('0x2e')][_0x8739('0x3f')]){_0x16eccd[_0x8739('0x39')]=[{'all':!![]}];}_0x16eccd=_[_0x8739('0x37')]({},_0x16eccd,_0x5f3eb9[_0x8739('0x38')]);return db[_0x8739('0x27')][_0x8739('0x40')](_0x16eccd)[_0x8739('0x1e')](handleEntityNotFound(_0x3727cc,null))[_0x8739('0x1e')](respondWithResult(_0x3727cc,null))['catch'](handleError(_0x3727cc,null));};exports['create']=function(_0x5c7694,_0x5efb77){return db[_0x8739('0x27')][_0x8739('0x41')](_0x5c7694[_0x8739('0x42')],{})['then'](respondWithResult(_0x5efb77,0xc9))[_0x8739('0x43')](handleError(_0x5efb77,null));};exports[_0x8739('0x44')]=function(_0x559ca7,_0x1638cd){if(_0x559ca7[_0x8739('0x42')]['id']){delete _0x559ca7[_0x8739('0x42')]['id'];}return db[_0x8739('0x27')][_0x8739('0x40')]({'where':{'id':_0x559ca7['params']['id']}})[_0x8739('0x1e')](handleEntityNotFound(_0x1638cd,null))[_0x8739('0x1e')](saveUpdates(_0x559ca7['body'],null))[_0x8739('0x1e')](respondWithResult(_0x1638cd,null))[_0x8739('0x43')](handleError(_0x1638cd,null));};exports[_0x8739('0x1f')]=function(_0xb483a7,_0x18321a){return db[_0x8739('0x27')][_0x8739('0x40')]({'where':{'id':_0xb483a7[_0x8739('0x3d')]['id']}})[_0x8739('0x1e')](handleEntityNotFound(_0x18321a,null))['then'](removeEntity(_0x18321a,null))['catch'](handleError(_0x18321a,null));};exports[_0x8739('0x45')]=function(_0x4a7b46,_0x2e0912){return db[_0x8739('0x27')][_0x8739('0x45')]()[_0x8739('0x1e')](respondWithResult(_0x2e0912,null))[_0x8739('0x43')](handleError(_0x2e0912,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 166f208..df261bb 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 _0x6479=['setMaxListeners','emit','hasOwnProperty','hook','exports','MailSubstatus'];(function(_0x24bd93,_0x38f451){var _0x55f35d=function(_0x320132){while(--_0x320132){_0x24bd93['push'](_0x24bd93['shift']());}};_0x55f35d(++_0x38f451);}(_0x6479,0x83));var _0x9647=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x6479[_0x274dd7];return _0x148829;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x9647('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9647('0x1')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x5bf152){return function(_0x72541f,_0x28ed82,_0x3a41b9){MailSubstatusEvents[_0x9647('0x2')](_0x5bf152+':'+_0x72541f['id'],_0x72541f);MailSubstatusEvents['emit'](_0x5bf152,_0x72541f);_0x3a41b9(null);};}for(var e in events){if(events[_0x9647('0x3')](e)){var event=events[e];MailSubstatus[_0x9647('0x4')](e,emitEvent(event));}}module[_0x9647('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0xdb81=['emit','hook','events','MailSubstatus','update'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdb81,0x89));var _0x1db8=function(_0x327ec0,_0x5f7e24){_0x327ec0=_0x327ec0-0x0;var _0x36892f=_0xdb81[_0x327ec0];return _0x36892f;};'use strict';var EventEmitter=require(_0x1db8('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x1db8('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x1db8('0x2')};function emitEvent(_0x11a6df){return function(_0x1a7080,_0x63276a,_0x305d99){MailSubstatusEvents[_0x1db8('0x3')](_0x11a6df+':'+_0x1a7080['id'],_0x1a7080);MailSubstatusEvents[_0x1db8('0x3')](_0x11a6df,_0x1a7080);_0x305d99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x1db8('0x4')](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 4e360e1..c1c2265 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 _0x09b3=['define','MailSubstatus','mail_substatuses','Condition','update','name','then','catch','./mailSubstatus.attributes','models'];(function(_0xe96887,_0x395a33){var _0x23cb6b=function(_0x5e5d30){while(--_0x5e5d30){_0xe96887['push'](_0xe96887['shift']());}};_0x23cb6b(++_0x395a33);}(_0x09b3,0x1f2));var _0x309b=function(_0x241c30,_0x19c789){_0x241c30=_0x241c30-0x0;var _0x117f1c=_0x09b3[_0x241c30];return _0x117f1c;};'use strict';var attributes=require(_0x309b('0x0'));module['exports']=function(_0x43a610){var _0x5699d5=_0x43a610[_0x309b('0x1')];return _0x43a610[_0x309b('0x2')](_0x309b('0x3'),attributes,{'tableName':_0x309b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5bfb4c,_0x1d7e1d,_0x2493f0){return _0x5699d5[_0x309b('0x5')][_0x309b('0x6')]({'value':_0x5bfb4c[_0x309b('0x7')]},{'where':{'field':'mailSubstatus','value':_0x5bfb4c['_previousDataValues'][_0x309b('0x7')]}})[_0x309b('0x8')](function(){_0x2493f0();})[_0x309b('0x9')](function(_0x572f20){_0x2493f0(_0x572f20);});}}});}; \ No newline at end of file +var _0x09d5=['_previousDataValues','catch','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','update','name','mailSubstatus'];(function(_0x475e49,_0x5d3880){var _0x3c84c9=function(_0x5dcc06){while(--_0x5dcc06){_0x475e49['push'](_0x475e49['shift']());}};_0x3c84c9(++_0x5d3880);}(_0x09d5,0x192));var _0x509d=function(_0x25a426,_0x181fa1){_0x25a426=_0x25a426-0x0;var _0xca78fe=_0x09d5[_0x25a426];return _0xca78fe;};'use strict';var attributes=require(_0x509d('0x0'));module[_0x509d('0x1')]=function(_0xfa875c){var _0x17a471=_0xfa875c['models'];return _0xfa875c[_0x509d('0x2')](_0x509d('0x3'),attributes,{'tableName':_0x509d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x7ffd12,_0x73acee,_0x55d0cf){return _0x17a471['Condition'][_0x509d('0x5')]({'value':_0x7ffd12[_0x509d('0x6')]},{'where':{'field':_0x509d('0x7'),'value':_0x7ffd12[_0x509d('0x8')][_0x509d('0x6')]}})['then'](function(){_0x55d0cf();})[_0x509d('0x9')](function(_0x2e163b){_0x55d0cf(_0x2e163b);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8f7ce21..424e211 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 _0x3542=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4b144a,_0x3dd885){var _0x2f7d2b=function(_0x2888f6){while(--_0x2888f6){_0x4b144a['push'](_0x4b144a['shift']());}};_0x2f7d2b(++_0x3dd885);}(_0x3542,0xf9));var _0x2354=function(_0x47643e,_0x337374){_0x47643e=_0x47643e-0x0;var _0x2aa5db=_0x3542[_0x47643e];return _0x2aa5db;};'use strict';var _=require(_0x2354('0x0'));var util=require(_0x2354('0x1'));var moment=require(_0x2354('0x2'));var BPromise=require(_0x2354('0x3'));var rs=require(_0x2354('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2354('0x5'))['db'];var utils=require(_0x2354('0x6'));var logger=require('../../config/logger')(_0x2354('0x7'));var config=require(_0x2354('0x8'));var jayson=require(_0x2354('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2606d4,_0x58af72,_0x5e4d2d){return new BPromise(function(_0xc712e3,_0x155de2){return client[_0x2354('0xa')](_0x2606d4,_0x5e4d2d)[_0x2354('0xb')](function(_0x5369e5){logger[_0x2354('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x58af72,_0x2354('0xd'));logger[_0x2354('0xe')](_0x2354('0xf'),_0x58af72,_0x2354('0xd'),JSON[_0x2354('0x10')](_0x5369e5));if(_0x5369e5[_0x2354('0x11')]){if(_0x5369e5[_0x2354('0x11')][_0x2354('0x12')]===0x1f4){logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0x5369e5['error'][_0x2354('0x14')]);return _0x155de2(_0x5369e5['error'][_0x2354('0x14')]);}logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0x5369e5[_0x2354('0x11')][_0x2354('0x14')]);return _0xc712e3(_0x5369e5['error']['message']);}else{logger['info'](_0x2354('0x13'),_0x58af72,_0x2354('0xd'));_0xc712e3(_0x5369e5[_0x2354('0x15')][_0x2354('0x14')]);}})[_0x2354('0x16')](function(_0xc085f3){logger[_0x2354('0x11')](_0x2354('0x13'),_0x58af72,_0xc085f3);_0x155de2(_0xc085f3);});});} \ No newline at end of file +var _0xf4ba=['../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20f848,_0x2bb454){var _0x3a5f92=function(_0x52e7b3){while(--_0x52e7b3){_0x20f848['push'](_0x20f848['shift']());}};_0x3a5f92(++_0x2bb454);}(_0xf4ba,0x13b));var _0xaf4b=function(_0x2186b4,_0x34b74d){_0x2186b4=_0x2186b4-0x0;var _0x2ca54b=_0xf4ba[_0x2186b4];return _0x2ca54b;};'use strict';var _=require(_0xaf4b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaf4b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf4b('0x2'));var db=require(_0xaf4b('0x3'))['db'];var utils=require(_0xaf4b('0x4'));var logger=require(_0xaf4b('0x5'))(_0xaf4b('0x6'));var config=require(_0xaf4b('0x7'));var jayson=require(_0xaf4b('0x8'));var client=jayson['client'][_0xaf4b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1148c1,_0x4ed39e,_0x2a2a0a){return new BPromise(function(_0x58f38c,_0x4299eb){return client[_0xaf4b('0xa')](_0x1148c1,_0x2a2a0a)[_0xaf4b('0xb')](function(_0x332029){logger[_0xaf4b('0xc')](_0xaf4b('0xd'),_0x4ed39e,_0xaf4b('0xe'));logger[_0xaf4b('0xf')](_0xaf4b('0x10'),_0x4ed39e,_0xaf4b('0xe'),JSON[_0xaf4b('0x11')](_0x332029));if(_0x332029['error']){if(_0x332029['error'][_0xaf4b('0x12')]===0x1f4){logger[_0xaf4b('0x13')](_0xaf4b('0xd'),_0x4ed39e,_0x332029[_0xaf4b('0x13')][_0xaf4b('0x14')]);return _0x4299eb(_0x332029[_0xaf4b('0x13')][_0xaf4b('0x14')]);}logger[_0xaf4b('0x13')](_0xaf4b('0xd'),_0x4ed39e,_0x332029[_0xaf4b('0x13')]['message']);return _0x58f38c(_0x332029[_0xaf4b('0x13')][_0xaf4b('0x14')]);}else{logger['info'](_0xaf4b('0xd'),_0x4ed39e,_0xaf4b('0xe'));_0x58f38c(_0x332029[_0xaf4b('0x15')]['message']);}})[_0xaf4b('0x16')](function(_0xc0e9dd){logger[_0xaf4b('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x4ed39e,_0xc0e9dd);_0x4299eb(_0xc0e9dd);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9fee11e..baef33d 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 _0x3c8a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x3c8a,0xa7));var _0xa3c8=function(_0x5d0c1e,_0x132dd6){_0x5d0c1e=_0x5d0c1e-0x0;var _0x3ad7b0=_0x3c8a[_0x5d0c1e];return _0x3ad7b0;};'use strict';var multer=require('multer');var util=require(_0xa3c8('0x0'));var path=require(_0xa3c8('0x1'));var timeout=require(_0xa3c8('0x2'));var express=require('express');var router=express[_0xa3c8('0x3')]();var fs_extra=require(_0xa3c8('0x4'));var auth=require(_0xa3c8('0x5'));var interaction=require(_0xa3c8('0x6'));var config=require(_0xa3c8('0x7'));var controller=require(_0xa3c8('0x8'));router[_0xa3c8('0x9')]('/',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xb')]);router[_0xa3c8('0x9')]('/describe',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xc')]);router[_0xa3c8('0x9')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller[_0xa3c8('0xe')]);router[_0xa3c8('0xf')]('/',auth[_0xa3c8('0xa')](),controller[_0xa3c8('0x10')]);router[_0xa3c8('0x11')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller[_0xa3c8('0x12')]);router[_0xa3c8('0x13')](_0xa3c8('0xd'),auth[_0xa3c8('0xa')](),controller['destroy']);module[_0xa3c8('0x14')]=router; \ No newline at end of file +var _0x2c96=['isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller'];(function(_0x550cb6,_0x12a9fa){var _0x23209e=function(_0x407b42){while(--_0x407b42){_0x550cb6['push'](_0x550cb6['shift']());}};_0x23209e(++_0x12a9fa);}(_0x2c96,0xad));var _0x62c9=function(_0x469318,_0x5d1212){_0x469318=_0x469318-0x0;var _0x25477a=_0x2c96[_0x469318];return _0x25477a;};'use strict';var multer=require(_0x62c9('0x0'));var util=require(_0x62c9('0x1'));var path=require(_0x62c9('0x2'));var timeout=require(_0x62c9('0x3'));var express=require(_0x62c9('0x4'));var router=express[_0x62c9('0x5')]();var fs_extra=require(_0x62c9('0x6'));var auth=require(_0x62c9('0x7'));var interaction=require(_0x62c9('0x8'));var config=require(_0x62c9('0x9'));var controller=require(_0x62c9('0xa'));router['get']('/',auth[_0x62c9('0xb')](),controller[_0x62c9('0xc')]);router[_0x62c9('0xd')]('/describe',auth[_0x62c9('0xb')](),controller[_0x62c9('0xe')]);router[_0x62c9('0xd')](_0x62c9('0xf'),auth[_0x62c9('0xb')](),controller[_0x62c9('0x10')]);router[_0x62c9('0x11')]('/',auth[_0x62c9('0xb')](),controller[_0x62c9('0x12')]);router[_0x62c9('0x13')](_0x62c9('0xf'),auth[_0x62c9('0xb')](),controller[_0x62c9('0x14')]);router[_0x62c9('0x15')](_0x62c9('0xf'),auth[_0x62c9('0xb')](),controller[_0x62c9('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 04a9213..1ae312f 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3c3ec7,_0x309339){var _0x23e52c=function(_0x34cd19){while(--_0x34cd19){_0x3c3ec7['push'](_0x3c3ec7['shift']());}};_0x23e52c(++_0x309339);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1ecd65,_0x4b7608){var _0x59b038=function(_0xf32b44){while(--_0xf32b44){_0x1ecd65['push'](_0x1ecd65['shift']());}};_0x59b038(++_0x4b7608);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x00bb[_0x6c993a];return _0x27f547;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b622724..7896cc8 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 _0x900c=['update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','MailTransferReport','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','options','includeAll','include','rows','catch','show','rawAttributes','fields','find','create','body'];(function(_0x1d9d73,_0x1f6d33){var _0x1769c6=function(_0x230159){while(--_0x230159){_0x1d9d73['push'](_0x1d9d73['shift']());}};_0x1769c6(++_0x1f6d33);}(_0x900c,0x12a));var _0xc900=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x900c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc900('0x0'));var rimraf=require(_0xc900('0x1'));var zipdir=require(_0xc900('0x2'));var jsonpatch=require(_0xc900('0x3'));var rp=require(_0xc900('0x4'));var moment=require(_0xc900('0x5'));var BPromise=require(_0xc900('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc900('0x7'));var sox=require(_0xc900('0x8'));var csv=require(_0xc900('0x9'));var ejs=require(_0xc900('0xa'));var fs=require('fs');var fs_extra=require(_0xc900('0xb'));var _=require(_0xc900('0xc'));var squel=require(_0xc900('0xd'));var crypto=require(_0xc900('0xe'));var jsforce=require(_0xc900('0xf'));var deskjs=require(_0xc900('0x10'));var toCsv=require(_0xc900('0x9'));var querystring=require(_0xc900('0x11'));var Papa=require(_0xc900('0x12'));var Redis=require(_0xc900('0x13'));var authService=require(_0xc900('0x14'));var qs=require(_0xc900('0x15'));var as=require(_0xc900('0x16'));var hardwareService=require(_0xc900('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xc900('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc900('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c9f15,_0x2ce423){_0x2ce423=_0x2ce423||0xcc;return function(_0x42bbe1){if(_0x42bbe1){return _0x4c9f15[_0xc900('0x1a')](_0x2ce423);}return _0x4c9f15['status'](_0x2ce423)[_0xc900('0x1b')]();};}function respondWithResult(_0x5264c6,_0xc2c09c){_0xc2c09c=_0xc2c09c||0xc8;return function(_0x8b5bd4){if(_0x8b5bd4){return _0x5264c6[_0xc900('0x1c')](_0xc2c09c)['json'](_0x8b5bd4);}};}function respondWithFilteredResult(_0x101210,_0x7e1f15){return function(_0x2f6311){if(_0x2f6311){var _0x3bfcd8=typeof _0x7e1f15[_0xc900('0x1d')]===_0xc900('0x1e')&&typeof _0x7e1f15[_0xc900('0x1f')]==='undefined';var _0x4c5080=_0x2f6311[_0xc900('0x20')];var _0x2b4ee3=_0x3bfcd8?0x0:_0x7e1f15['offset'];var _0x2f96ce=_0x3bfcd8?_0x2f6311[_0xc900('0x20')]:_0x7e1f15[_0xc900('0x1d')]+_0x7e1f15[_0xc900('0x1f')];var _0x286734;if(_0x2f96ce>=_0x4c5080){_0x2f96ce=_0x4c5080;_0x286734=0xc8;}else{_0x286734=0xce;}_0x101210[_0xc900('0x1c')](_0x286734);return _0x101210[_0xc900('0x21')](_0xc900('0x22'),_0x2b4ee3+'-'+_0x2f96ce+'/'+_0x4c5080)[_0xc900('0x23')](_0x2f6311);}return null;};}function patchUpdates(_0x27f46e){return function(_0x53dcbc){try{jsonpatch[_0xc900('0x24')](_0x53dcbc,_0x27f46e,!![]);}catch(_0x4cce42){return BPromise['reject'](_0x4cce42);}return _0x53dcbc[_0xc900('0x25')]();};}function saveUpdates(_0xc0775,_0x4e1d46){return function(_0x4e24bf){if(_0x4e24bf){return _0x4e24bf['update'](_0xc0775)[_0xc900('0x26')](function(_0x10b897){return _0x10b897;});}return null;};}function removeEntity(_0x3d8412,_0x520905){return function(_0x30c550){if(_0x30c550){return _0x30c550[_0xc900('0x27')]()[_0xc900('0x26')](function(){_0x3d8412[_0xc900('0x1c')](0xcc)[_0xc900('0x1b')]();});}};}function handleEntityNotFound(_0x2841c6,_0x5044b7){return function(_0x365aec){if(!_0x365aec){_0x2841c6[_0xc900('0x1a')](0x194);}return _0x365aec;};}function handleError(_0x125959,_0x5877e4){_0x5877e4=_0x5877e4||0x1f4;return function(_0x9edcd7){logger[_0xc900('0x28')](_0x9edcd7['stack']);if(_0x9edcd7[_0xc900('0x29')]){delete _0x9edcd7['name'];}_0x125959[_0xc900('0x1c')](_0x5877e4)[_0xc900('0x2a')](_0x9edcd7);};}exports[_0xc900('0x2b')]=function(_0x1faa20,_0x2c9c1b){var _0x5eba9c={},_0x5cef98={},_0xc123b={'count':0x0,'rows':[]};var _0xf8cce9=_['map'](db[_0xc900('0x2c')]['rawAttributes'],function(_0x160cc3){return{'name':_0x160cc3[_0xc900('0x2d')],'type':_0x160cc3[_0xc900('0x2e')]['key']};});_0x5cef98[_0xc900('0x2f')]=_['map'](_0xf8cce9,_0xc900('0x29'));_0x5cef98['query']=_[_0xc900('0x30')](_0x1faa20[_0xc900('0x31')]);_0x5cef98['filters']=_[_0xc900('0x32')](_0x5cef98[_0xc900('0x2f')],_0x5cef98[_0xc900('0x31')]);_0x5eba9c[_0xc900('0x33')]=_[_0xc900('0x32')](_0x5cef98[_0xc900('0x2f')],qs['fields'](_0x1faa20[_0xc900('0x31')]['fields']));_0x5eba9c[_0xc900('0x33')]=_0x5eba9c[_0xc900('0x33')][_0xc900('0x34')]?_0x5eba9c[_0xc900('0x33')]:_0x5cef98[_0xc900('0x2f')];if(!_0x1faa20[_0xc900('0x31')][_0xc900('0x35')](_0xc900('0x36'))){_0x5eba9c['limit']=qs['limit'](_0x1faa20['query'][_0xc900('0x1f')]);_0x5eba9c[_0xc900('0x1d')]=qs['offset'](_0x1faa20[_0xc900('0x31')]['offset']);}_0x5eba9c[_0xc900('0x37')]=qs['sort'](_0x1faa20[_0xc900('0x31')][_0xc900('0x38')]);_0x5eba9c[_0xc900('0x39')]=qs[_0xc900('0x3a')](_['pick'](_0x1faa20[_0xc900('0x31')],_0x5cef98['filters']),_0xf8cce9);if(_0x1faa20['query']['filter']){_0x5eba9c[_0xc900('0x39')]=_[_0xc900('0x3b')](_0x5eba9c[_0xc900('0x39')],{'$or':_[_0xc900('0x3c')](_0xf8cce9,function(_0x3bd12c){if(_0x3bd12c[_0xc900('0x2e')]!=='VIRTUAL'){var _0x211652={};_0x211652[_0x3bd12c[_0xc900('0x29')]]={'$like':'%'+_0x1faa20['query']['filter']+'%'};return _0x211652;}})});}_0x5eba9c=_['merge']({},_0x5eba9c,_0x1faa20[_0xc900('0x3d')]);var _0x3f803d={'where':_0x5eba9c[_0xc900('0x39')]};return db[_0xc900('0x2c')][_0xc900('0x20')](_0x3f803d)['then'](function(_0xe72f88){_0xc123b[_0xc900('0x20')]=_0xe72f88;if(_0x1faa20[_0xc900('0x31')][_0xc900('0x3e')]){_0x5eba9c[_0xc900('0x3f')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x5eba9c);})['then'](function(_0x4809d2){_0xc123b[_0xc900('0x40')]=_0x4809d2;return _0xc123b;})[_0xc900('0x26')](respondWithFilteredResult(_0x2c9c1b,_0x5eba9c))[_0xc900('0x41')](handleError(_0x2c9c1b,null));};exports[_0xc900('0x42')]=function(_0xd3b0e2,_0x25366c){var _0x21b3e1={'raw':!![],'where':{'id':_0xd3b0e2['params']['id']}},_0x130ca0={};_0x130ca0[_0xc900('0x2f')]=_[_0xc900('0x30')](db[_0xc900('0x2c')][_0xc900('0x43')]);_0x130ca0[_0xc900('0x31')]=_[_0xc900('0x30')](_0xd3b0e2[_0xc900('0x31')]);_0x130ca0[_0xc900('0x3a')]=_['intersection'](_0x130ca0['model'],_0x130ca0[_0xc900('0x31')]);_0x21b3e1[_0xc900('0x33')]=_[_0xc900('0x32')](_0x130ca0[_0xc900('0x2f')],qs[_0xc900('0x44')](_0xd3b0e2['query'][_0xc900('0x44')]));_0x21b3e1[_0xc900('0x33')]=_0x21b3e1[_0xc900('0x33')][_0xc900('0x34')]?_0x21b3e1[_0xc900('0x33')]:_0x130ca0[_0xc900('0x2f')];if(_0xd3b0e2['query'][_0xc900('0x3e')]){_0x21b3e1[_0xc900('0x3f')]=[{'all':!![]}];}_0x21b3e1=_[_0xc900('0x3b')]({},_0x21b3e1,_0xd3b0e2[_0xc900('0x3d')]);return db['MailTransferReport'][_0xc900('0x45')](_0x21b3e1)['then'](handleEntityNotFound(_0x25366c,null))[_0xc900('0x26')](respondWithResult(_0x25366c,null))[_0xc900('0x41')](handleError(_0x25366c,null));};exports[_0xc900('0x46')]=function(_0x9a8ff1,_0xa5d96e){return db[_0xc900('0x2c')][_0xc900('0x46')](_0x9a8ff1[_0xc900('0x47')],{})[_0xc900('0x26')](respondWithResult(_0xa5d96e,0xc9))[_0xc900('0x41')](handleError(_0xa5d96e,null));};exports[_0xc900('0x48')]=function(_0x1e5f84,_0x434d35){if(_0x1e5f84[_0xc900('0x47')]['id']){delete _0x1e5f84[_0xc900('0x47')]['id'];}return db[_0xc900('0x2c')][_0xc900('0x45')]({'where':{'id':_0x1e5f84['params']['id']}})[_0xc900('0x26')](handleEntityNotFound(_0x434d35,null))[_0xc900('0x26')](saveUpdates(_0x1e5f84[_0xc900('0x47')],null))[_0xc900('0x26')](respondWithResult(_0x434d35,null))['catch'](handleError(_0x434d35,null));};exports['destroy']=function(_0x3d1d16,_0x1b2f39){return db['MailTransferReport'][_0xc900('0x45')]({'where':{'id':_0x3d1d16[_0xc900('0x49')]['id']}})[_0xc900('0x26')](handleEntityNotFound(_0x1b2f39,null))[_0xc900('0x26')](removeEntity(_0x1b2f39,null))[_0xc900('0x41')](handleError(_0x1b2f39,null));};exports['describe']=function(_0x43b5aa,_0x485b28){return db[_0xc900('0x2c')]['describe']()[_0xc900('0x26')](respondWithResult(_0x485b28,null))[_0xc900('0x41')](handleError(_0x485b28,null));}; \ No newline at end of file +var _0x2418=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type'];(function(_0x15c745,_0xdff78f){var _0x18dd91=function(_0xdd19c9){while(--_0xdd19c9){_0x15c745['push'](_0x15c745['shift']());}};_0x18dd91(++_0xdff78f);}(_0x2418,0x149));var _0x8241=function(_0xcc1aa9,_0x3aad08){_0xcc1aa9=_0xcc1aa9-0x0;var _0x36fd0d=_0x2418[_0xcc1aa9];return _0x36fd0d;};'use strict';var emlformat=require(_0x8241('0x0'));var rimraf=require(_0x8241('0x1'));var zipdir=require(_0x8241('0x2'));var jsonpatch=require(_0x8241('0x3'));var rp=require(_0x8241('0x4'));var moment=require(_0x8241('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8241('0x6'));var util=require(_0x8241('0x7'));var path=require(_0x8241('0x8'));var sox=require(_0x8241('0x9'));var csv=require(_0x8241('0xa'));var ejs=require(_0x8241('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8241('0xc'));var squel=require('squel');var crypto=require(_0x8241('0xd'));var jsforce=require(_0x8241('0xe'));var deskjs=require(_0x8241('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8241('0x10'));var Papa=require(_0x8241('0x11'));var Redis=require(_0x8241('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8241('0x13'));var as=require(_0x8241('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8241('0x15'))('api');var utils=require(_0x8241('0x16'));var config=require(_0x8241('0x17'));var licenseUtil=require(_0x8241('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39e646,_0x48b0e7){_0x48b0e7=_0x48b0e7||0xcc;return function(_0x197b78){if(_0x197b78){return _0x39e646['sendStatus'](_0x48b0e7);}return _0x39e646[_0x8241('0x19')](_0x48b0e7)[_0x8241('0x1a')]();};}function respondWithResult(_0x50ddd7,_0x50705f){_0x50705f=_0x50705f||0xc8;return function(_0x1156b1){if(_0x1156b1){return _0x50ddd7[_0x8241('0x19')](_0x50705f)[_0x8241('0x1b')](_0x1156b1);}};}function respondWithFilteredResult(_0x23e2ae,_0x386d7b){return function(_0x1d8d0d){if(_0x1d8d0d){var _0x783e1a=typeof _0x386d7b[_0x8241('0x1c')]===_0x8241('0x1d')&&typeof _0x386d7b[_0x8241('0x1e')]===_0x8241('0x1d');var _0x258f2a=_0x1d8d0d[_0x8241('0x1f')];var _0x25ca1f=_0x783e1a?0x0:_0x386d7b[_0x8241('0x1c')];var _0x599246=_0x783e1a?_0x1d8d0d['count']:_0x386d7b[_0x8241('0x1c')]+_0x386d7b['limit'];var _0x546baa;if(_0x599246>=_0x258f2a){_0x599246=_0x258f2a;_0x546baa=0xc8;}else{_0x546baa=0xce;}_0x23e2ae['status'](_0x546baa);return _0x23e2ae[_0x8241('0x20')]('Content-Range',_0x25ca1f+'-'+_0x599246+'/'+_0x258f2a)[_0x8241('0x1b')](_0x1d8d0d);}return null;};}function patchUpdates(_0x377a4a){return function(_0x3ba830){try{jsonpatch[_0x8241('0x21')](_0x3ba830,_0x377a4a,!![]);}catch(_0x4eff1c){return BPromise[_0x8241('0x22')](_0x4eff1c);}return _0x3ba830[_0x8241('0x23')]();};}function saveUpdates(_0x11de40,_0x1878f2){return function(_0x4c2966){if(_0x4c2966){return _0x4c2966[_0x8241('0x24')](_0x11de40)[_0x8241('0x25')](function(_0x345d7d){return _0x345d7d;});}return null;};}function removeEntity(_0x20f8b7,_0x5d2bf4){return function(_0x160b0c){if(_0x160b0c){return _0x160b0c[_0x8241('0x26')]()[_0x8241('0x25')](function(){_0x20f8b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a063a,_0x1d425a){return function(_0x296f37){if(!_0x296f37){_0x3a063a[_0x8241('0x27')](0x194);}return _0x296f37;};}function handleError(_0x530212,_0x3cdffb){_0x3cdffb=_0x3cdffb||0x1f4;return function(_0x44334f){logger[_0x8241('0x28')](_0x44334f['stack']);if(_0x44334f[_0x8241('0x29')]){delete _0x44334f[_0x8241('0x29')];}_0x530212[_0x8241('0x19')](_0x3cdffb)[_0x8241('0x2a')](_0x44334f);};}exports[_0x8241('0x2b')]=function(_0x3f1104,_0x58ad5c){var _0x3cb160={},_0x3be9d3={},_0x48edb6={'count':0x0,'rows':[]};var _0x1fc77d=_[_0x8241('0x2c')](db[_0x8241('0x2d')][_0x8241('0x2e')],function(_0x44a5be){return{'name':_0x44a5be[_0x8241('0x2f')],'type':_0x44a5be['type'][_0x8241('0x30')]};});_0x3be9d3[_0x8241('0x31')]=_['map'](_0x1fc77d,_0x8241('0x29'));_0x3be9d3[_0x8241('0x32')]=_[_0x8241('0x33')](_0x3f1104[_0x8241('0x32')]);_0x3be9d3[_0x8241('0x34')]=_[_0x8241('0x35')](_0x3be9d3['model'],_0x3be9d3[_0x8241('0x32')]);_0x3cb160['attributes']=_['intersection'](_0x3be9d3[_0x8241('0x31')],qs[_0x8241('0x36')](_0x3f1104[_0x8241('0x32')]['fields']));_0x3cb160['attributes']=_0x3cb160[_0x8241('0x37')][_0x8241('0x38')]?_0x3cb160[_0x8241('0x37')]:_0x3be9d3['model'];if(!_0x3f1104[_0x8241('0x32')][_0x8241('0x39')](_0x8241('0x3a'))){_0x3cb160['limit']=qs['limit'](_0x3f1104['query'][_0x8241('0x1e')]);_0x3cb160[_0x8241('0x1c')]=qs['offset'](_0x3f1104[_0x8241('0x32')]['offset']);}_0x3cb160[_0x8241('0x3b')]=qs[_0x8241('0x3c')](_0x3f1104[_0x8241('0x32')][_0x8241('0x3c')]);_0x3cb160['where']=qs[_0x8241('0x34')](_[_0x8241('0x3d')](_0x3f1104[_0x8241('0x32')],_0x3be9d3[_0x8241('0x34')]),_0x1fc77d);if(_0x3f1104[_0x8241('0x32')][_0x8241('0x3e')]){_0x3cb160[_0x8241('0x3f')]=_[_0x8241('0x40')](_0x3cb160['where'],{'$or':_[_0x8241('0x2c')](_0x1fc77d,function(_0x51a85e){if(_0x51a85e[_0x8241('0x41')]!==_0x8241('0x42')){var _0x239888={};_0x239888[_0x51a85e[_0x8241('0x29')]]={'$like':'%'+_0x3f1104[_0x8241('0x32')][_0x8241('0x3e')]+'%'};return _0x239888;}})});}_0x3cb160=_['merge']({},_0x3cb160,_0x3f1104[_0x8241('0x43')]);var _0x49b780={'where':_0x3cb160[_0x8241('0x3f')]};return db[_0x8241('0x2d')][_0x8241('0x1f')](_0x49b780)[_0x8241('0x25')](function(_0x4bdda5){_0x48edb6['count']=_0x4bdda5;if(_0x3f1104[_0x8241('0x32')][_0x8241('0x44')]){_0x3cb160[_0x8241('0x45')]=[{'all':!![]}];}return db['MailTransferReport'][_0x8241('0x46')](_0x3cb160);})[_0x8241('0x25')](function(_0x16bb1c){_0x48edb6[_0x8241('0x47')]=_0x16bb1c;return _0x48edb6;})[_0x8241('0x25')](respondWithFilteredResult(_0x58ad5c,_0x3cb160))[_0x8241('0x48')](handleError(_0x58ad5c,null));};exports[_0x8241('0x49')]=function(_0x37f286,_0x407e07){var _0x24917a={'raw':!![],'where':{'id':_0x37f286[_0x8241('0x4a')]['id']}},_0x4adf99={};_0x4adf99['model']=_[_0x8241('0x33')](db[_0x8241('0x2d')][_0x8241('0x2e')]);_0x4adf99[_0x8241('0x32')]=_['keys'](_0x37f286[_0x8241('0x32')]);_0x4adf99[_0x8241('0x34')]=_[_0x8241('0x35')](_0x4adf99['model'],_0x4adf99[_0x8241('0x32')]);_0x24917a[_0x8241('0x37')]=_[_0x8241('0x35')](_0x4adf99[_0x8241('0x31')],qs['fields'](_0x37f286[_0x8241('0x32')][_0x8241('0x36')]));_0x24917a[_0x8241('0x37')]=_0x24917a[_0x8241('0x37')][_0x8241('0x38')]?_0x24917a[_0x8241('0x37')]:_0x4adf99[_0x8241('0x31')];if(_0x37f286[_0x8241('0x32')][_0x8241('0x44')]){_0x24917a[_0x8241('0x45')]=[{'all':!![]}];}_0x24917a=_[_0x8241('0x40')]({},_0x24917a,_0x37f286['options']);return db['MailTransferReport'][_0x8241('0x4b')](_0x24917a)[_0x8241('0x25')](handleEntityNotFound(_0x407e07,null))['then'](respondWithResult(_0x407e07,null))[_0x8241('0x48')](handleError(_0x407e07,null));};exports['create']=function(_0x2c4d3c,_0x1a1706){return db[_0x8241('0x2d')][_0x8241('0x4c')](_0x2c4d3c[_0x8241('0x4d')],{})[_0x8241('0x25')](respondWithResult(_0x1a1706,0xc9))[_0x8241('0x48')](handleError(_0x1a1706,null));};exports[_0x8241('0x24')]=function(_0x40a50c,_0x21cbfe){if(_0x40a50c['body']['id']){delete _0x40a50c['body']['id'];}return db['MailTransferReport'][_0x8241('0x4b')]({'where':{'id':_0x40a50c[_0x8241('0x4a')]['id']}})[_0x8241('0x25')](handleEntityNotFound(_0x21cbfe,null))['then'](saveUpdates(_0x40a50c[_0x8241('0x4d')],null))[_0x8241('0x25')](respondWithResult(_0x21cbfe,null))['catch'](handleError(_0x21cbfe,null));};exports[_0x8241('0x26')]=function(_0x1b8bee,_0x33975e){return db[_0x8241('0x2d')][_0x8241('0x4b')]({'where':{'id':_0x1b8bee[_0x8241('0x4a')]['id']}})[_0x8241('0x25')](handleEntityNotFound(_0x33975e,null))['then'](removeEntity(_0x33975e,null))[_0x8241('0x48')](handleError(_0x33975e,null));};exports[_0x8241('0x4e')]=function(_0x431aa6,_0x41f016){return db[_0x8241('0x2d')][_0x8241('0x4e')]()[_0x8241('0x25')](respondWithResult(_0x41f016,null))[_0x8241('0x48')](handleError(_0x41f016,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7e9a7fb..3af1b7e 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 _0xbb1a=['rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xbb1a,0x14c));var _0xabb1=function(_0x43ed1b,_0x29a2dc){_0x43ed1b=_0x43ed1b-0x0;var _0x15fe5e=_0xbb1a[_0x43ed1b];return _0x15fe5e;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var logger=require(_0xabb1('0x2'))(_0xabb1('0x3'));var moment=require('moment');var BPromise=require(_0xabb1('0x4'));var rp=require(_0xabb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabb1('0x6'));var config=require(_0xabb1('0x7'));var attributes=require(_0xabb1('0x8'));module['exports']=function(_0x2bfc3e,_0x426a6b){return _0x2bfc3e[_0xabb1('0x9')](_0xabb1('0xa'),attributes,{'tableName':_0xabb1('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xabb1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4677=['../../config/environment','./mailTransferReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0x4677,0x155));var _0x7467=function(_0x4e45fb,_0x5bc4cf){_0x4e45fb=_0x4e45fb-0x0;var _0x44691a=_0x4677[_0x4e45fb];return _0x44691a;};'use strict';var _=require(_0x7467('0x0'));var util=require('util');var logger=require(_0x7467('0x1'))(_0x7467('0x2'));var moment=require(_0x7467('0x3'));var BPromise=require('bluebird');var rp=require(_0x7467('0x4'));var fs=require('fs');var path=require(_0x7467('0x5'));var rimraf=require(_0x7467('0x6'));var config=require(_0x7467('0x7'));var attributes=require(_0x7467('0x8'));module[_0x7467('0x9')]=function(_0x36fc81,_0x40a9c6){return _0x36fc81[_0x7467('0xa')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x7467('0xb'),'fields':[_0x7467('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 33f058a..ce2f1f0 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 _0x142a=['error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x520945,_0x28b144){var _0x17067a=function(_0x191ae1){while(--_0x191ae1){_0x520945['push'](_0x520945['shift']());}};_0x17067a(++_0x28b144);}(_0x142a,0x72));var _0xa142=function(_0x5d1817,_0x4b303a){_0x5d1817=_0x5d1817-0x0;var _0x5700e7=_0x142a[_0x5d1817];return _0x5700e7;};'use strict';var _=require(_0xa142('0x0'));var util=require(_0xa142('0x1'));var moment=require('moment');var BPromise=require(_0xa142('0x2'));var rs=require(_0xa142('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa142('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa142('0x5'))(_0xa142('0x6'));var config=require(_0xa142('0x7'));var jayson=require(_0xa142('0x8'));var client=jayson[_0xa142('0x9')][_0xa142('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f38c,_0x65e75f,_0x546fff){return new BPromise(function(_0x1dde30,_0x26ad49){return client[_0xa142('0xb')](_0x30f38c,_0x546fff)[_0xa142('0xc')](function(_0x13a585){logger[_0xa142('0xd')](_0xa142('0xe'),_0x65e75f,'request\x20sent');logger['debug'](_0xa142('0xf'),_0x65e75f,_0xa142('0x10'),JSON[_0xa142('0x11')](_0x13a585));if(_0x13a585['error']){if(_0x13a585[_0xa142('0x12')][_0xa142('0x13')]===0x1f4){logger['error'](_0xa142('0xe'),_0x65e75f,_0x13a585['error'][_0xa142('0x14')]);return _0x26ad49(_0x13a585[_0xa142('0x12')][_0xa142('0x14')]);}logger[_0xa142('0x12')](_0xa142('0xe'),_0x65e75f,_0x13a585['error'][_0xa142('0x14')]);return _0x1dde30(_0x13a585[_0xa142('0x12')]['message']);}else{logger[_0xa142('0xd')](_0xa142('0xe'),_0x65e75f,'request\x20sent');_0x1dde30(_0x13a585['result']['message']);}})[_0xa142('0x15')](function(_0x19a815){logger[_0xa142('0x12')](_0xa142('0xe'),_0x65e75f,_0x19a815);_0x26ad49(_0x19a815);});});} \ No newline at end of file +var _0x3cfd=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util'];(function(_0x542ae7,_0x57332f){var _0x5a96a6=function(_0x3c06ad){while(--_0x3c06ad){_0x542ae7['push'](_0x542ae7['shift']());}};_0x5a96a6(++_0x57332f);}(_0x3cfd,0xe2));var _0xd3cf=function(_0x3a3a5c,_0x1ea4b8){_0x3a3a5c=_0x3a3a5c-0x0;var _0x28b594=_0x3cfd[_0x3a3a5c];return _0x28b594;};'use strict';var _=require(_0xd3cf('0x0'));var util=require(_0xd3cf('0x1'));var moment=require('moment');var BPromise=require(_0xd3cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3cf('0x4'));var logger=require(_0xd3cf('0x5'))('rpc');var config=require(_0xd3cf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3cf('0x7')][_0xd3cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53760d,_0x91a581,_0x861627){return new BPromise(function(_0x1027a9,_0x1ca532){return client[_0xd3cf('0x9')](_0x53760d,_0x861627)[_0xd3cf('0xa')](function(_0x189ff2){logger[_0xd3cf('0xb')](_0xd3cf('0xc'),_0x91a581,'request\x20sent');logger['debug'](_0xd3cf('0xd'),_0x91a581,'request\x20sent',JSON[_0xd3cf('0xe')](_0x189ff2));if(_0x189ff2[_0xd3cf('0xf')]){if(_0x189ff2[_0xd3cf('0xf')][_0xd3cf('0x10')]===0x1f4){logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x189ff2['error'][_0xd3cf('0x11')]);return _0x1ca532(_0x189ff2[_0xd3cf('0xf')]['message']);}logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x189ff2['error'][_0xd3cf('0x11')]);return _0x1027a9(_0x189ff2[_0xd3cf('0xf')]['message']);}else{logger[_0xd3cf('0xb')](_0xd3cf('0xc'),_0x91a581,_0xd3cf('0x12'));_0x1027a9(_0x189ff2['result']['message']);}})['catch'](function(_0x29fea7){logger[_0xd3cf('0xf')](_0xd3cf('0xc'),_0x91a581,_0x29fea7);_0x1ca532(_0x29fea7);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6d62f57..ceb79b2 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 _0xee64=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','describe','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a458a,_0x4b141d){var _0x39a3dd=function(_0x342476){while(--_0x342476){_0x1a458a['push'](_0x1a458a['shift']());}};_0x39a3dd(++_0x4b141d);}(_0xee64,0xf9));var _0x4ee6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xee64[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4ee6('0x0'));var util=require(_0x4ee6('0x1'));var path=require(_0x4ee6('0x2'));var timeout=require(_0x4ee6('0x3'));var express=require(_0x4ee6('0x4'));var router=express[_0x4ee6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4ee6('0x7'));var controller=require(_0x4ee6('0x8'));router[_0x4ee6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ee6('0x9')](_0x4ee6('0xa'),auth['isAuthenticated'](),controller[_0x4ee6('0xb')]);router[_0x4ee6('0x9')](_0x4ee6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4ee6('0xd')]('/',auth[_0x4ee6('0xe')](),controller[_0x4ee6('0xf')]);router[_0x4ee6('0x10')](_0x4ee6('0xc'),auth[_0x4ee6('0xe')](),controller[_0x4ee6('0x11')]);router[_0x4ee6('0x12')](_0x4ee6('0xc'),auth['isAuthenticated'](),controller[_0x4ee6('0x13')]);module[_0x4ee6('0x14')]=router; \ No newline at end of file +var _0x0c44=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x2715cf,_0x517bb2){var _0x1bdcb8=function(_0x5dec7b){while(--_0x5dec7b){_0x2715cf['push'](_0x2715cf['shift']());}};_0x1bdcb8(++_0x517bb2);}(_0x0c44,0x89));var _0x40c4=function(_0x4ccb74,_0x2660f2){_0x4ccb74=_0x4ccb74-0x0;var _0x501df8=_0x0c44[_0x4ccb74];return _0x501df8;};'use strict';var multer=require(_0x40c4('0x0'));var util=require(_0x40c4('0x1'));var path=require(_0x40c4('0x2'));var timeout=require(_0x40c4('0x3'));var express=require(_0x40c4('0x4'));var router=express[_0x40c4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x40c4('0x6'));var interaction=require(_0x40c4('0x7'));var config=require(_0x40c4('0x8'));var controller=require(_0x40c4('0x9'));router[_0x40c4('0xa')]('/',auth[_0x40c4('0xb')](),controller[_0x40c4('0xc')]);router[_0x40c4('0xa')]('/describe',auth[_0x40c4('0xb')](),controller[_0x40c4('0xd')]);router[_0x40c4('0xa')](_0x40c4('0xe'),auth[_0x40c4('0xb')](),controller['show']);router['post']('/',auth[_0x40c4('0xb')](),controller['create']);router[_0x40c4('0xf')](_0x40c4('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x40c4('0x10')](_0x40c4('0xe'),auth[_0x40c4('0xb')](),controller[_0x40c4('0x11')]);module[_0x40c4('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 6130f3c..2802b1b 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 _0x9c50=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize'];(function(_0x389b48,_0x2a1760){var _0x1cc751=function(_0x1f314d){while(--_0x1f314d){_0x389b48['push'](_0x389b48['shift']());}};_0x1cc751(++_0x2a1760);}(_0x9c50,0xed));var _0x09c5=function(_0x1747ce,_0x49f4a7){_0x1747ce=_0x1747ce-0x0;var _0x421001=_0x9c50[_0x1747ce];return _0x421001;};'use strict';var Sequelize=require(_0x09c5('0x0'));var moment=require(_0x09c5('0x1'));module[_0x09c5('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x09c5('0x3')]},'interface':{'type':Sequelize[_0x09c5('0x3')]},'type':{'type':Sequelize[_0x09c5('0x3')],'defaultValue':_0x09c5('0x4'),'comment':_0x09c5('0x5')},'duration':{'type':Sequelize[_0x09c5('0x6')]},'enterAt':{'type':Sequelize[_0x09c5('0x7')]},'exitAt':{'type':Sequelize[_0x09c5('0x7')],'set':function(_0x5d969d){var _0x3ce8b8=moment(_0x5d969d);var _0x818bc9=moment(this['getDataValue']('enterAt'));var _0x35b2c8=_0x3ce8b8[_0x09c5('0x8')](_0x818bc9,_0x09c5('0x9'));this['setDataValue'](_0x09c5('0xa'),_0x5d969d);this[_0x09c5('0xb')](_0x09c5('0xc'),_0x35b2c8>=0x0?_0x35b2c8:null);}},'data1':{'type':Sequelize[_0x09c5('0x3')],'comment':_0x09c5('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x09c5('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x09c5('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0x09c5('0x10')},'data5':{'type':Sequelize[_0x09c5('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x09c5('0x6')]},'uniqueid':{'type':Sequelize[_0x09c5('0x3')]}}; \ No newline at end of file +var _0x6ef9=['STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','exports'];(function(_0x4e4a09,_0xe4eac8){var _0x17a756=function(_0x23b5ef){while(--_0x23b5ef){_0x4e4a09['push'](_0x4e4a09['shift']());}};_0x17a756(++_0xe4eac8);}(_0x6ef9,0x9f));var _0x96ef=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x6ef9[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x96ef('0x0')]={'channel':{'type':Sequelize[_0x96ef('0x1')]},'membername':{'type':Sequelize[_0x96ef('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x96ef('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x96ef('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x96ef('0x3')],'set':function(_0x136b24){var _0xb39be6=moment(_0x136b24);var _0x3d7ce8=moment(this[_0x96ef('0x4')](_0x96ef('0x5')));var _0x2613f7=_0xb39be6[_0x96ef('0x6')](_0x3d7ce8,_0x96ef('0x7'));this[_0x96ef('0x8')](_0x96ef('0x9'),_0x136b24);this[_0x96ef('0x8')](_0x96ef('0xa'),_0x2613f7>=0x0?_0x2613f7:null);}},'data1':{'type':Sequelize[_0x96ef('0x1')],'comment':_0x96ef('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x96ef('0xc')},'data4':{'type':Sequelize[_0x96ef('0x1')],'comment':_0x96ef('0xd')},'data5':{'type':Sequelize[_0x96ef('0x1')],'comment':_0x96ef('0xe')},'role':{'type':Sequelize[_0x96ef('0x1')]},'internal':{'type':Sequelize[_0x96ef('0xf')]},'uniqueid':{'type':Sequelize[_0x96ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index a8b5226..a099ad8 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x191dff,_0xb60d16){_0x191dff=_0x191dff-0x0;var _0x410a43=_0x55ca[_0x191dff];return _0x410a43;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +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(_0x41ecb2,_0x306e02){var _0x1137d9=function(_0x4be3ef){while(--_0x4be3ef){_0x41ecb2['push'](_0x41ecb2['shift']());}};_0x1137d9(++_0x306e02);}(_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){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 8c0bc3e..047cb0b 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 _0x83fc=['path','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','membername','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x122107,_0x17cf75){var _0x5211d7=function(_0x485d20){while(--_0x485d20){_0x122107['push'](_0x122107['shift']());}};_0x5211d7(++_0x17cf75);}(_0x83fc,0x181));var _0xc83f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x83fc[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xc83f('0x0'));var util=require(_0xc83f('0x1'));var logger=require(_0xc83f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc83f('0x3'));var rp=require(_0xc83f('0x4'));var fs=require('fs');var path=require(_0xc83f('0x5'));var rimraf=require(_0xc83f('0x6'));var config=require(_0xc83f('0x7'));var attributes=require(_0xc83f('0x8'));module['exports']=function(_0x5717b8,_0x4c8230){return _0x5717b8['define'](_0xc83f('0x9'),attributes,{'tableName':_0xc83f('0xa'),'paranoid':![],'indexes':[{'name':_0xc83f('0xb'),'fields':[_0xc83f('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x37a2=['../../config/environment','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x37a2,0x178));var _0x237a=function(_0xea57f7,_0x2fd307){_0xea57f7=_0xea57f7-0x0;var _0x60f469=_0x37a2[_0xea57f7];return _0x60f469;};'use strict';var _=require(_0x237a('0x0'));var util=require(_0x237a('0x1'));var logger=require('../../config/logger')(_0x237a('0x2'));var moment=require(_0x237a('0x3'));var BPromise=require(_0x237a('0x4'));var rp=require(_0x237a('0x5'));var fs=require('fs');var path=require(_0x237a('0x6'));var rimraf=require(_0x237a('0x7'));var config=require(_0x237a('0x8'));var attributes=require('./memberReport.attributes');module[_0x237a('0x9')]=function(_0x827056,_0x204ccc){return _0x827056[_0x237a('0xa')](_0x237a('0xb'),attributes,{'tableName':_0x237a('0xc'),'paranoid':![],'indexes':[{'name':_0x237a('0xd'),'fields':[_0x237a('0xe'),_0x237a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 94effcc..810c452 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 _0xb1aa=['MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','raw','options','where','attributes','limit','include','model','map','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0xb1aa,0x159));var _0xab1a=function(_0x22112a,_0x78270){_0x22112a=_0x22112a-0x0;var _0x389d21=_0xb1aa[_0x22112a];return _0x389d21;};'use strict';var _=require(_0xab1a('0x0'));var util=require(_0xab1a('0x1'));var moment=require('moment');var BPromise=require(_0xab1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab1a('0x3'));var db=require(_0xab1a('0x4'))['db'];var utils=require(_0xab1a('0x5'));var logger=require(_0xab1a('0x6'))(_0xab1a('0x7'));var config=require(_0xab1a('0x8'));var jayson=require(_0xab1a('0x9'));var client=jayson[_0xab1a('0xa')][_0xab1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e7ff9,_0x5471ad,_0x400319){return new BPromise(function(_0x55a6d,_0x16eace){return client[_0xab1a('0xc')](_0x1e7ff9,_0x400319)[_0xab1a('0xd')](function(_0x1f0d04){logger[_0xab1a('0xe')](_0xab1a('0xf'),_0x5471ad,'request\x20sent');logger[_0xab1a('0x10')](_0xab1a('0x11'),_0x5471ad,_0xab1a('0x12'),JSON[_0xab1a('0x13')](_0x1f0d04));if(_0x1f0d04[_0xab1a('0x14')]){if(_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x15')]===0x1f4){logger[_0xab1a('0x14')](_0xab1a('0xf'),_0x5471ad,_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);return _0x16eace(_0x1f0d04['error'][_0xab1a('0x16')]);}logger['error'](_0xab1a('0xf'),_0x5471ad,_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);return _0x55a6d(_0x1f0d04[_0xab1a('0x14')][_0xab1a('0x16')]);}else{logger[_0xab1a('0xe')](_0xab1a('0xf'),_0x5471ad,_0xab1a('0x12'));_0x55a6d(_0x1f0d04[_0xab1a('0x17')][_0xab1a('0x16')]);}})[_0xab1a('0x18')](function(_0x4b5fe6){logger[_0xab1a('0x14')](_0xab1a('0xf'),_0x5471ad,_0x4b5fe6);_0x16eace(_0x4b5fe6);});});}exports[_0xab1a('0x19')]=function(_0x2bd832){var _0x24a612=this;return new Promise(function(_0x51cd51,_0x2afbe7){return db['MemberReport']['findAll']({'raw':_0x2bd832['options']?_0x2bd832['options'][_0xab1a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1c')]||null:null,'attributes':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1d')]||null:null,'limit':_0x2bd832['options']?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1e')]||null:null,'include':_0x2bd832[_0xab1a('0x1b')]?_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1f')]?_['map'](_0x2bd832[_0xab1a('0x1b')][_0xab1a('0x1f')],function(_0x279def){return{'model':db[_0x279def[_0xab1a('0x20')]],'as':_0x279def['as'],'attributes':_0x279def[_0xab1a('0x1d')],'include':_0x279def[_0xab1a('0x1f')]?_['map'](_0x279def[_0xab1a('0x1f')],function(_0x41d4e6){return{'model':db[_0x41d4e6[_0xab1a('0x20')]],'as':_0x41d4e6['as'],'attributes':_0x41d4e6['attributes'],'include':_0x41d4e6['include']?_[_0xab1a('0x21')](_0x41d4e6[_0xab1a('0x1f')],function(_0x197ffc){return{'model':db[_0x197ffc['model']],'as':_0x197ffc['as'],'attributes':_0x197ffc[_0xab1a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xab1a('0xd')](function(_0x140483){logger[_0xab1a('0xe')](_0xab1a('0x19'),_0x2bd832);logger[_0xab1a('0x10')](_0xab1a('0x19'),_0x2bd832,JSON[_0xab1a('0x13')](_0x140483));_0x51cd51(_0x140483);})[_0xab1a('0x18')](function(_0x2fba42){logger[_0xab1a('0x14')](_0xab1a('0x19'),_0x2fba42[_0xab1a('0x16')],_0x2bd832);_0x2afbe7(_0x24a612[_0xab1a('0x14')](0x1f4,_0x2fba42['message']));});});};exports[_0xab1a('0x22')]=function(_0x13d163){var _0x5a2768=this;return new Promise(function(_0x110650,_0xfe915f){return db[_0xab1a('0x23')][_0xab1a('0x24')](_0x13d163[_0xab1a('0x25')],{'raw':_0x13d163[_0xab1a('0x1b')]?_0x13d163[_0xab1a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xab1a('0xd')](function(_0x571141){logger[_0xab1a('0xe')]('CreateMemberReport',_0x13d163);logger[_0xab1a('0x10')](_0xab1a('0x22'),_0x13d163,JSON[_0xab1a('0x13')](_0x571141));_0x110650(_0x571141);})[_0xab1a('0x18')](function(_0x1b5523){logger[_0xab1a('0x14')]('CreateMemberReport',_0x1b5523[_0xab1a('0x16')],_0x13d163);_0xfe915f(_0x5a2768[_0xab1a('0x14')](0x1f4,_0x1b5523[_0xab1a('0x16')]));});});};exports[_0xab1a('0x26')]=function(_0x2c5064){var _0x5ceb7b=this;return new Promise(function(_0x597dd0,_0x1ce017){return db[_0xab1a('0x23')][_0xab1a('0x27')](_0x2c5064[_0xab1a('0x25')],{'raw':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')][_0xab1a('0x1c')]||null:null,'attributes':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')][_0xab1a('0x1d')]||null:null,'limit':_0x2c5064[_0xab1a('0x1b')]?_0x2c5064[_0xab1a('0x1b')]['limit']||null:null})[_0xab1a('0xd')](function(_0x8338a1){logger[_0xab1a('0xe')](_0xab1a('0x26'),_0x2c5064);logger[_0xab1a('0x10')](_0xab1a('0x26'),_0x2c5064,JSON[_0xab1a('0x13')](_0x8338a1));_0x597dd0(_0x8338a1);})[_0xab1a('0x18')](function(_0x31e9b6){logger[_0xab1a('0x14')](_0xab1a('0x26'),_0x31e9b6[_0xab1a('0x16')],_0x2c5064);_0x1ce017(_0x5ceb7b['error'](0x1f4,_0x31e9b6[_0xab1a('0x16')]));});});}; \ No newline at end of file +var _0xaa37=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','create','body','UpdateMemberReport','update','lodash'];(function(_0x4b04dd,_0xa7de05){var _0x12327e=function(_0x330980){while(--_0x330980){_0x4b04dd['push'](_0x4b04dd['shift']());}};_0x12327e(++_0xa7de05);}(_0xaa37,0x1d3));var _0x7aa3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xaa37[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var moment=require(_0x7aa3('0x2'));var BPromise=require(_0x7aa3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7aa3('0x4'));var db=require(_0x7aa3('0x5'))['db'];var utils=require(_0x7aa3('0x6'));var logger=require(_0x7aa3('0x7'))(_0x7aa3('0x8'));var config=require(_0x7aa3('0x9'));var jayson=require(_0x7aa3('0xa'));var client=jayson['client'][_0x7aa3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbbcc8a,_0x5d1627,_0x100894){return new BPromise(function(_0x390c82,_0x394097){return client['request'](_0xbbcc8a,_0x100894)[_0x7aa3('0xc')](function(_0xd0fe4){logger[_0x7aa3('0xd')](_0x7aa3('0xe'),_0x5d1627,_0x7aa3('0xf'));logger[_0x7aa3('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x5d1627,'request\x20sent',JSON[_0x7aa3('0x11')](_0xd0fe4));if(_0xd0fe4['error']){if(_0xd0fe4[_0x7aa3('0x12')][_0x7aa3('0x13')]===0x1f4){logger['error'](_0x7aa3('0xe'),_0x5d1627,_0xd0fe4[_0x7aa3('0x12')]['message']);return _0x394097(_0xd0fe4['error']['message']);}logger[_0x7aa3('0x12')](_0x7aa3('0xe'),_0x5d1627,_0xd0fe4[_0x7aa3('0x12')][_0x7aa3('0x14')]);return _0x390c82(_0xd0fe4[_0x7aa3('0x12')]['message']);}else{logger[_0x7aa3('0xd')](_0x7aa3('0xe'),_0x5d1627,_0x7aa3('0xf'));_0x390c82(_0xd0fe4[_0x7aa3('0x15')]['message']);}})['catch'](function(_0x3fab08){logger['error'](_0x7aa3('0xe'),_0x5d1627,_0x3fab08);_0x394097(_0x3fab08);});});}exports[_0x7aa3('0x16')]=function(_0x4dcefa){var _0x11ded1=this;return new Promise(function(_0xe5e683,_0x1a4f95){return db[_0x7aa3('0x17')][_0x7aa3('0x18')]({'raw':_0x4dcefa['options']?_0x4dcefa[_0x7aa3('0x19')][_0x7aa3('0x1a')]===undefined?!![]:![]:!![],'where':_0x4dcefa[_0x7aa3('0x19')]?_0x4dcefa[_0x7aa3('0x19')][_0x7aa3('0x1b')]||null:null,'attributes':_0x4dcefa[_0x7aa3('0x19')]?_0x4dcefa['options'][_0x7aa3('0x1c')]||null:null,'limit':_0x4dcefa[_0x7aa3('0x19')]?_0x4dcefa[_0x7aa3('0x19')][_0x7aa3('0x1d')]||null:null,'include':_0x4dcefa[_0x7aa3('0x19')]?_0x4dcefa['options'][_0x7aa3('0x1e')]?_[_0x7aa3('0x1f')](_0x4dcefa[_0x7aa3('0x19')][_0x7aa3('0x1e')],function(_0x3b382d){return{'model':db[_0x3b382d[_0x7aa3('0x20')]],'as':_0x3b382d['as'],'attributes':_0x3b382d[_0x7aa3('0x1c')],'include':_0x3b382d[_0x7aa3('0x1e')]?_[_0x7aa3('0x1f')](_0x3b382d[_0x7aa3('0x1e')],function(_0x44377a){return{'model':db[_0x44377a[_0x7aa3('0x20')]],'as':_0x44377a['as'],'attributes':_0x44377a[_0x7aa3('0x1c')],'include':_0x44377a['include']?_[_0x7aa3('0x1f')](_0x44377a[_0x7aa3('0x1e')],function(_0x3c1422){return{'model':db[_0x3c1422[_0x7aa3('0x20')]],'as':_0x3c1422['as'],'attributes':_0x3c1422[_0x7aa3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7aa3('0xc')](function(_0x47cf18){logger[_0x7aa3('0xd')](_0x7aa3('0x16'),_0x4dcefa);logger[_0x7aa3('0x10')]('GetMemberReport',_0x4dcefa,JSON[_0x7aa3('0x11')](_0x47cf18));_0xe5e683(_0x47cf18);})[_0x7aa3('0x21')](function(_0x539ec0){logger[_0x7aa3('0x12')](_0x7aa3('0x16'),_0x539ec0[_0x7aa3('0x14')],_0x4dcefa);_0x1a4f95(_0x11ded1[_0x7aa3('0x12')](0x1f4,_0x539ec0[_0x7aa3('0x14')]));});});};exports[_0x7aa3('0x22')]=function(_0x3adc17){var _0x3f2be1=this;return new Promise(function(_0x92de40,_0x41f981){return db[_0x7aa3('0x17')][_0x7aa3('0x23')](_0x3adc17[_0x7aa3('0x24')],{'raw':_0x3adc17[_0x7aa3('0x19')]?_0x3adc17[_0x7aa3('0x19')][_0x7aa3('0x1a')]===undefined?!![]:![]:!![]})[_0x7aa3('0xc')](function(_0x25935c){logger[_0x7aa3('0xd')](_0x7aa3('0x22'),_0x3adc17);logger[_0x7aa3('0x10')]('CreateMemberReport',_0x3adc17,JSON[_0x7aa3('0x11')](_0x25935c));_0x92de40(_0x25935c);})[_0x7aa3('0x21')](function(_0x46c4d9){logger[_0x7aa3('0x12')](_0x7aa3('0x22'),_0x46c4d9[_0x7aa3('0x14')],_0x3adc17);_0x41f981(_0x3f2be1[_0x7aa3('0x12')](0x1f4,_0x46c4d9[_0x7aa3('0x14')]));});});};exports[_0x7aa3('0x25')]=function(_0x287ca4){var _0x29e90a=this;return new Promise(function(_0x589abc,_0x3d6125){return db[_0x7aa3('0x17')][_0x7aa3('0x26')](_0x287ca4[_0x7aa3('0x24')],{'raw':_0x287ca4[_0x7aa3('0x19')]?_0x287ca4[_0x7aa3('0x19')][_0x7aa3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ca4[_0x7aa3('0x19')]?_0x287ca4[_0x7aa3('0x19')][_0x7aa3('0x1b')]||null:null,'attributes':_0x287ca4[_0x7aa3('0x19')]?_0x287ca4[_0x7aa3('0x19')][_0x7aa3('0x1c')]||null:null,'limit':_0x287ca4[_0x7aa3('0x19')]?_0x287ca4['options'][_0x7aa3('0x1d')]||null:null})[_0x7aa3('0xc')](function(_0xbdc351){logger[_0x7aa3('0xd')]('UpdateMemberReport',_0x287ca4);logger[_0x7aa3('0x10')]('UpdateMemberReport',_0x287ca4,JSON[_0x7aa3('0x11')](_0xbdc351));_0x589abc(_0xbdc351);})[_0x7aa3('0x21')](function(_0x63b4a9){logger[_0x7aa3('0x12')](_0x7aa3('0x25'),_0x63b4a9[_0x7aa3('0x14')],_0x287ca4);_0x3d6125(_0x29e90a[_0x7aa3('0x12')](0x1f4,_0x63b4a9[_0x7aa3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 02608e1..4cdebb1 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 _0x4bfb=['fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout','Router'];(function(_0x2efe2c,_0x45047d){var _0x54e2e1=function(_0x15c360){while(--_0x15c360){_0x2efe2c['push'](_0x2efe2c['shift']());}};_0x54e2e1(++_0x45047d);}(_0x4bfb,0x150));var _0xb4bf=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x4bfb[_0x13342f];return _0x2fc1fc;};'use strict';var multer=require(_0xb4bf('0x0'));var util=require(_0xb4bf('0x1'));var path=require(_0xb4bf('0x2'));var timeout=require(_0xb4bf('0x3'));var express=require('express');var router=express[_0xb4bf('0x4')]();var fs_extra=require(_0xb4bf('0x5'));var auth=require(_0xb4bf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb4bf('0x7'));router[_0xb4bf('0x8')]('/',controller[_0xb4bf('0x9')]);module[_0xb4bf('0xa')]=router; \ No newline at end of file +var _0x8595=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8595,0x1b8));var _0x5859=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8595[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5859('0x0'));var util=require(_0x5859('0x1'));var path=require(_0x5859('0x2'));var timeout=require('connect-timeout');var express=require(_0x5859('0x3'));var router=express[_0x5859('0x4')]();var fs_extra=require(_0x5859('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5859('0x6'));var config=require(_0x5859('0x7'));var controller=require(_0x5859('0x8'));router['get']('/',controller[_0x5859('0x9')]);module[_0x5859('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5dac07a..7bf3882 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 _0x1def=['sequelize','STRING','version'];(function(_0x3c1a53,_0x583c4a){var _0x2bbfd5=function(_0x32e2d3){while(--_0x32e2d3){_0x3c1a53['push'](_0x3c1a53['shift']());}};_0x2bbfd5(++_0x583c4a);}(_0x1def,0x1a1));var _0xf1de=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x1def[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xf1de('0x0'));module['exports']={'version':{'type':Sequelize[_0xf1de('0x1')],'unique':_0xf1de('0x2')}}; \ No newline at end of file +var _0xc595=['sequelize','exports','STRING'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xc595,0xe1));var _0x5c59=function(_0x4f9c55,_0x185dfb){_0x4f9c55=_0x4f9c55-0x0;var _0x301858=_0xc595[_0x4f9c55];return _0x301858;};'use strict';var Sequelize=require(_0x5c59('0x0'));module[_0x5c59('0x1')]={'version':{'type':Sequelize[_0x5c59('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index f0cb17b..a3dd589 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 _0x8a7e=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','then','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x51b75b,_0x2b7fae){var _0x403cf9=function(_0x5345ab){while(--_0x5345ab){_0x51b75b['push'](_0x51b75b['shift']());}};_0x403cf9(++_0x2b7fae);}(_0x8a7e,0x1de));var _0xe8a7=function(_0x3dc13b,_0x16c7f9){_0x3dc13b=_0x3dc13b-0x0;var _0x7d6feb=_0x8a7e[_0x3dc13b];return _0x7d6feb;};'use strict';var emlformat=require(_0xe8a7('0x0'));var rimraf=require(_0xe8a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8a7('0x2'));var rp=require(_0xe8a7('0x3'));var moment=require(_0xe8a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8a7('0x5'));var util=require(_0xe8a7('0x6'));var path=require(_0xe8a7('0x7'));var sox=require('sox');var csv=require(_0xe8a7('0x8'));var ejs=require(_0xe8a7('0x9'));var fs=require('fs');var fs_extra=require(_0xe8a7('0xa'));var _=require(_0xe8a7('0xb'));var squel=require(_0xe8a7('0xc'));var crypto=require('crypto');var jsforce=require(_0xe8a7('0xd'));var deskjs=require(_0xe8a7('0xe'));var toCsv=require(_0xe8a7('0x8'));var querystring=require(_0xe8a7('0xf'));var Papa=require(_0xe8a7('0x10'));var Redis=require(_0xe8a7('0x11'));var authService=require(_0xe8a7('0x12'));var qs=require(_0xe8a7('0x13'));var as=require(_0xe8a7('0x14'));var hardwareService=require(_0xe8a7('0x15'));var logger=require(_0xe8a7('0x16'))('api');var utils=require(_0xe8a7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8a7('0x18'))['db'];function respondWithStatusCode(_0x83fbf1,_0x5c33ae){_0x5c33ae=_0x5c33ae||0xcc;return function(_0x4f13d8){if(_0x4f13d8){return _0x83fbf1[_0xe8a7('0x19')](_0x5c33ae);}return _0x83fbf1[_0xe8a7('0x1a')](_0x5c33ae)['end']();};}function respondWithResult(_0x471d3a,_0x571d36){_0x571d36=_0x571d36||0xc8;return function(_0x32bb6c){if(_0x32bb6c){return _0x471d3a[_0xe8a7('0x1a')](_0x571d36)[_0xe8a7('0x1b')](_0x32bb6c);}};}function respondWithFilteredResult(_0x1aab72,_0x2faef8){return function(_0xd98201){if(_0xd98201){var _0x3bac3f=typeof _0x2faef8[_0xe8a7('0x1c')]==='undefined'&&typeof _0x2faef8[_0xe8a7('0x1d')]===_0xe8a7('0x1e');var _0x50f1cf=_0xd98201[_0xe8a7('0x1f')];var _0x2c58a3=_0x3bac3f?0x0:_0x2faef8[_0xe8a7('0x1c')];var _0x280689=_0x3bac3f?_0xd98201[_0xe8a7('0x1f')]:_0x2faef8['offset']+_0x2faef8['limit'];var _0x1e95b5;if(_0x280689>=_0x50f1cf){_0x280689=_0x50f1cf;_0x1e95b5=0xc8;}else{_0x1e95b5=0xce;}_0x1aab72[_0xe8a7('0x1a')](_0x1e95b5);return _0x1aab72[_0xe8a7('0x20')](_0xe8a7('0x21'),_0x2c58a3+'-'+_0x280689+'/'+_0x50f1cf)[_0xe8a7('0x1b')](_0xd98201);}return null;};}function patchUpdates(_0x7694b7){return function(_0x7d90f8){try{jsonpatch[_0xe8a7('0x22')](_0x7d90f8,_0x7694b7,!![]);}catch(_0x493c86){return BPromise[_0xe8a7('0x23')](_0x493c86);}return _0x7d90f8[_0xe8a7('0x24')]();};}function saveUpdates(_0x2a763c,_0x3398b4){return function(_0x12a52d){if(_0x12a52d){return _0x12a52d[_0xe8a7('0x25')](_0x2a763c)['then'](function(_0x3bcbf5){return _0x3bcbf5;});}return null;};}function removeEntity(_0x11e68e,_0x547383){return function(_0x5ef3c1){if(_0x5ef3c1){return _0x5ef3c1[_0xe8a7('0x26')]()['then'](function(){_0x11e68e[_0xe8a7('0x1a')](0xcc)[_0xe8a7('0x27')]();});}};}function handleEntityNotFound(_0x221048,_0x23163d){return function(_0x5a4258){if(!_0x5a4258){_0x221048[_0xe8a7('0x19')](0x194);}return _0x5a4258;};}function handleError(_0x23cabc,_0x4019f5){_0x4019f5=_0x4019f5||0x1f4;return function(_0xa97794){logger[_0xe8a7('0x28')](_0xa97794['stack']);if(_0xa97794[_0xe8a7('0x29')]){delete _0xa97794[_0xe8a7('0x29')];}_0x23cabc[_0xe8a7('0x1a')](_0x4019f5)[_0xe8a7('0x2a')](_0xa97794);};}exports[_0xe8a7('0x2b')]=function(_0x531ddc,_0x4fd59){var _0x18f85b={},_0x4ed4cc={},_0xb3914b={'count':0x0,'rows':[]};var _0x30e28e=_[_0xe8a7('0x2c')](db['Migration'][_0xe8a7('0x2d')],function(_0x5c57cb){return{'name':_0x5c57cb[_0xe8a7('0x2e')],'type':_0x5c57cb[_0xe8a7('0x2f')][_0xe8a7('0x30')]};});_0x4ed4cc[_0xe8a7('0x31')]=_['map'](_0x30e28e,'name');_0x4ed4cc[_0xe8a7('0x32')]=_['keys'](_0x531ddc[_0xe8a7('0x32')]);_0x4ed4cc[_0xe8a7('0x33')]=_[_0xe8a7('0x34')](_0x4ed4cc['model'],_0x4ed4cc[_0xe8a7('0x32')]);_0x18f85b[_0xe8a7('0x35')]=_[_0xe8a7('0x34')](_0x4ed4cc[_0xe8a7('0x31')],qs['fields'](_0x531ddc['query'][_0xe8a7('0x36')]));_0x18f85b[_0xe8a7('0x35')]=_0x18f85b[_0xe8a7('0x35')]['length']?_0x18f85b[_0xe8a7('0x35')]:_0x4ed4cc[_0xe8a7('0x31')];if(!_0x531ddc['query'][_0xe8a7('0x37')](_0xe8a7('0x38'))){_0x18f85b[_0xe8a7('0x1d')]=qs[_0xe8a7('0x1d')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x1d')]);_0x18f85b['offset']=qs[_0xe8a7('0x1c')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x1c')]);}_0x18f85b[_0xe8a7('0x39')]=qs[_0xe8a7('0x3a')](_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3a')]);_0x18f85b[_0xe8a7('0x3b')]=qs[_0xe8a7('0x33')](_['pick'](_0x531ddc[_0xe8a7('0x32')],_0x4ed4cc['filters']),_0x30e28e);if(_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3c')]){_0x18f85b[_0xe8a7('0x3b')]=_[_0xe8a7('0x3d')](_0x18f85b[_0xe8a7('0x3b')],{'$or':_['map'](_0x30e28e,function(_0x12a499){if(_0x12a499[_0xe8a7('0x2f')]!==_0xe8a7('0x3e')){var _0x456a3e={};_0x456a3e[_0x12a499[_0xe8a7('0x29')]]={'$like':'%'+_0x531ddc[_0xe8a7('0x32')][_0xe8a7('0x3c')]+'%'};return _0x456a3e;}})});}_0x18f85b=_[_0xe8a7('0x3d')]({},_0x18f85b,_0x531ddc[_0xe8a7('0x3f')]);var _0x54dc76={'where':_0x18f85b[_0xe8a7('0x3b')]};return db[_0xe8a7('0x40')]['count'](_0x54dc76)['then'](function(_0x144534){_0xb3914b[_0xe8a7('0x1f')]=_0x144534;if(_0x531ddc['query'][_0xe8a7('0x41')]){_0x18f85b[_0xe8a7('0x42')]=[{'all':!![]}];}return db['Migration'][_0xe8a7('0x43')](_0x18f85b);})[_0xe8a7('0x44')](function(_0x5741de){_0xb3914b[_0xe8a7('0x45')]=_0x5741de;return _0xb3914b;})['then'](respondWithFilteredResult(_0x4fd59,_0x18f85b))['catch'](handleError(_0x4fd59,null));}; \ No newline at end of file +var _0xabdb=['where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xabdb,0x111));var _0xbabd=function(_0x2474c6,_0x186336){_0x2474c6=_0x2474c6-0x0;var _0x22f191=_0xabdb[_0x2474c6];return _0x22f191;};'use strict';var emlformat=require(_0xbabd('0x0'));var rimraf=require(_0xbabd('0x1'));var zipdir=require(_0xbabd('0x2'));var jsonpatch=require(_0xbabd('0x3'));var rp=require(_0xbabd('0x4'));var moment=require(_0xbabd('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbabd('0x6'));var sox=require(_0xbabd('0x7'));var csv=require(_0xbabd('0x8'));var ejs=require(_0xbabd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbabd('0xa'));var crypto=require('crypto');var jsforce=require(_0xbabd('0xb'));var deskjs=require(_0xbabd('0xc'));var toCsv=require(_0xbabd('0x8'));var querystring=require(_0xbabd('0xd'));var Papa=require(_0xbabd('0xe'));var Redis=require(_0xbabd('0xf'));var authService=require(_0xbabd('0x10'));var qs=require(_0xbabd('0x11'));var as=require(_0xbabd('0x12'));var hardwareService=require(_0xbabd('0x13'));var logger=require('../../config/logger')(_0xbabd('0x14'));var utils=require(_0xbabd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbabd('0x16'))['db'];function respondWithStatusCode(_0x11a35e,_0x56df0a){_0x56df0a=_0x56df0a||0xcc;return function(_0x1bbe47){if(_0x1bbe47){return _0x11a35e[_0xbabd('0x17')](_0x56df0a);}return _0x11a35e[_0xbabd('0x18')](_0x56df0a)['end']();};}function respondWithResult(_0x12c3ef,_0x1930f7){_0x1930f7=_0x1930f7||0xc8;return function(_0x160f8f){if(_0x160f8f){return _0x12c3ef[_0xbabd('0x18')](_0x1930f7)[_0xbabd('0x19')](_0x160f8f);}};}function respondWithFilteredResult(_0x14ce0e,_0x2efc16){return function(_0x1cf59d){if(_0x1cf59d){var _0x252e45=typeof _0x2efc16['offset']===_0xbabd('0x1a')&&typeof _0x2efc16[_0xbabd('0x1b')]===_0xbabd('0x1a');var _0x4e2b8c=_0x1cf59d[_0xbabd('0x1c')];var _0x52a2c8=_0x252e45?0x0:_0x2efc16['offset'];var _0x134dd9=_0x252e45?_0x1cf59d[_0xbabd('0x1c')]:_0x2efc16[_0xbabd('0x1d')]+_0x2efc16[_0xbabd('0x1b')];var _0x36098c;if(_0x134dd9>=_0x4e2b8c){_0x134dd9=_0x4e2b8c;_0x36098c=0xc8;}else{_0x36098c=0xce;}_0x14ce0e[_0xbabd('0x18')](_0x36098c);return _0x14ce0e[_0xbabd('0x1e')]('Content-Range',_0x52a2c8+'-'+_0x134dd9+'/'+_0x4e2b8c)[_0xbabd('0x19')](_0x1cf59d);}return null;};}function patchUpdates(_0x3bb12b){return function(_0x92176c){try{jsonpatch[_0xbabd('0x1f')](_0x92176c,_0x3bb12b,!![]);}catch(_0x449376){return BPromise[_0xbabd('0x20')](_0x449376);}return _0x92176c[_0xbabd('0x21')]();};}function saveUpdates(_0x27471c,_0x491099){return function(_0xa045c6){if(_0xa045c6){return _0xa045c6[_0xbabd('0x22')](_0x27471c)['then'](function(_0x4ba56f){return _0x4ba56f;});}return null;};}function removeEntity(_0x4dca6f,_0x582287){return function(_0x5f1430){if(_0x5f1430){return _0x5f1430[_0xbabd('0x23')]()[_0xbabd('0x24')](function(){_0x4dca6f[_0xbabd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57525f,_0x34a97b){return function(_0x39d3ae){if(!_0x39d3ae){_0x57525f[_0xbabd('0x17')](0x194);}return _0x39d3ae;};}function handleError(_0x44728b,_0x3f4ed9){_0x3f4ed9=_0x3f4ed9||0x1f4;return function(_0xd52219){logger['error'](_0xd52219[_0xbabd('0x25')]);if(_0xd52219['name']){delete _0xd52219[_0xbabd('0x26')];}_0x44728b['status'](_0x3f4ed9)['send'](_0xd52219);};}exports[_0xbabd('0x27')]=function(_0x83dce7,_0x4f992b){var _0x248726={},_0x3b00f6={},_0x97dddc={'count':0x0,'rows':[]};var _0x4645b6=_[_0xbabd('0x28')](db[_0xbabd('0x29')][_0xbabd('0x2a')],function(_0x511a78){return{'name':_0x511a78[_0xbabd('0x2b')],'type':_0x511a78[_0xbabd('0x2c')][_0xbabd('0x2d')]};});_0x3b00f6[_0xbabd('0x2e')]=_[_0xbabd('0x28')](_0x4645b6,_0xbabd('0x26'));_0x3b00f6[_0xbabd('0x2f')]=_['keys'](_0x83dce7[_0xbabd('0x2f')]);_0x3b00f6[_0xbabd('0x30')]=_[_0xbabd('0x31')](_0x3b00f6[_0xbabd('0x2e')],_0x3b00f6['query']);_0x248726[_0xbabd('0x32')]=_[_0xbabd('0x31')](_0x3b00f6[_0xbabd('0x2e')],qs[_0xbabd('0x33')](_0x83dce7[_0xbabd('0x2f')][_0xbabd('0x33')]));_0x248726['attributes']=_0x248726[_0xbabd('0x32')][_0xbabd('0x34')]?_0x248726['attributes']:_0x3b00f6[_0xbabd('0x2e')];if(!_0x83dce7[_0xbabd('0x2f')][_0xbabd('0x35')](_0xbabd('0x36'))){_0x248726[_0xbabd('0x1b')]=qs[_0xbabd('0x1b')](_0x83dce7[_0xbabd('0x2f')]['limit']);_0x248726[_0xbabd('0x1d')]=qs['offset'](_0x83dce7['query'][_0xbabd('0x1d')]);}_0x248726[_0xbabd('0x37')]=qs['sort'](_0x83dce7[_0xbabd('0x2f')][_0xbabd('0x38')]);_0x248726[_0xbabd('0x39')]=qs['filters'](_['pick'](_0x83dce7[_0xbabd('0x2f')],_0x3b00f6[_0xbabd('0x30')]),_0x4645b6);if(_0x83dce7[_0xbabd('0x2f')][_0xbabd('0x3a')]){_0x248726[_0xbabd('0x39')]=_[_0xbabd('0x3b')](_0x248726[_0xbabd('0x39')],{'$or':_[_0xbabd('0x28')](_0x4645b6,function(_0x5e8d8e){if(_0x5e8d8e['type']!==_0xbabd('0x3c')){var _0x436d70={};_0x436d70[_0x5e8d8e['name']]={'$like':'%'+_0x83dce7[_0xbabd('0x2f')]['filter']+'%'};return _0x436d70;}})});}_0x248726=_[_0xbabd('0x3b')]({},_0x248726,_0x83dce7[_0xbabd('0x3d')]);var _0x1a4ad9={'where':_0x248726[_0xbabd('0x39')]};return db[_0xbabd('0x29')]['count'](_0x1a4ad9)[_0xbabd('0x24')](function(_0x4cf0ed){_0x97dddc[_0xbabd('0x1c')]=_0x4cf0ed;if(_0x83dce7[_0xbabd('0x2f')][_0xbabd('0x3e')]){_0x248726[_0xbabd('0x3f')]=[{'all':!![]}];}return db[_0xbabd('0x29')]['findAll'](_0x248726);})[_0xbabd('0x24')](function(_0x2ad974){_0x97dddc[_0xbabd('0x40')]=_0x2ad974;return _0x97dddc;})['then'](respondWithFilteredResult(_0x4f992b,_0x248726))[_0xbabd('0x41')](handleError(_0x4f992b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 44a2c5d..a2a8ecc 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 _0xb04c=['rimraf','../../config/environment','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b4f11,_0x2e6543){var _0x31d846=function(_0x1a2812){while(--_0x1a2812){_0x3b4f11['push'](_0x3b4f11['shift']());}};_0x31d846(++_0x2e6543);}(_0xb04c,0x156));var _0xcb04=function(_0x4a4288,_0x497d63){_0x4a4288=_0x4a4288-0x0;var _0x380f66=_0xb04c[_0x4a4288];return _0x380f66;};'use strict';var _=require(_0xcb04('0x0'));var util=require(_0xcb04('0x1'));var logger=require(_0xcb04('0x2'))(_0xcb04('0x3'));var moment=require(_0xcb04('0x4'));var BPromise=require(_0xcb04('0x5'));var rp=require(_0xcb04('0x6'));var fs=require('fs');var path=require(_0xcb04('0x7'));var rimraf=require(_0xcb04('0x8'));var config=require(_0xcb04('0x9'));var attributes=require('./migration.attributes');module[_0xcb04('0xa')]=function(_0x22b7ae,_0x3b9683){return _0x22b7ae[_0xcb04('0xb')](_0xcb04('0xc'),attributes,{'tableName':_0xcb04('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde97=['exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x3a6847,_0x142ec1){var _0x9fd9a3=function(_0x4659c4){while(--_0x4659c4){_0x3a6847['push'](_0x3a6847['shift']());}};_0x9fd9a3(++_0x142ec1);}(_0xde97,0x19a));var _0x7de9=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xde97[_0x5e8c32];return _0x595f7b;};'use strict';var _=require(_0x7de9('0x0'));var util=require(_0x7de9('0x1'));var logger=require(_0x7de9('0x2'))(_0x7de9('0x3'));var moment=require(_0x7de9('0x4'));var BPromise=require('bluebird');var rp=require(_0x7de9('0x5'));var fs=require('fs');var path=require(_0x7de9('0x6'));var rimraf=require(_0x7de9('0x7'));var config=require(_0x7de9('0x8'));var attributes=require(_0x7de9('0x9'));module[_0x7de9('0xa')]=function(_0x1a6b49,_0x4fe4a2){return _0x1a6b49[_0x7de9('0xb')](_0x7de9('0xc'),attributes,{'tableName':_0x7de9('0xd'),'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 558c8e5..82f7f46 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 _0xb077=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x11cc54,_0x1b3e76){var _0x2b04c0=function(_0x400e76){while(--_0x400e76){_0x11cc54['push'](_0x11cc54['shift']());}};_0x2b04c0(++_0x1b3e76);}(_0xb077,0x7a));var _0x7b07=function(_0x5e34e8,_0x1f8d13){_0x5e34e8=_0x5e34e8-0x0;var _0x1541d8=_0xb077[_0x5e34e8];return _0x1541d8;};'use strict';var _=require(_0x7b07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b07('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b07('0x2'));var db=require(_0x7b07('0x3'))['db'];var utils=require(_0x7b07('0x4'));var logger=require(_0x7b07('0x5'))(_0x7b07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b07('0x7')][_0x7b07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x110ee5,_0x4d9976,_0x561c99){return new BPromise(function(_0x3a82e8,_0x4b6f20){return client[_0x7b07('0x9')](_0x110ee5,_0x561c99)[_0x7b07('0xa')](function(_0x2d3741){logger[_0x7b07('0xb')](_0x7b07('0xc'),_0x4d9976,_0x7b07('0xd'));logger[_0x7b07('0xe')](_0x7b07('0xf'),_0x4d9976,_0x7b07('0xd'),JSON['stringify'](_0x2d3741));if(_0x2d3741[_0x7b07('0x10')]){if(_0x2d3741[_0x7b07('0x10')][_0x7b07('0x11')]===0x1f4){logger['error'](_0x7b07('0xc'),_0x4d9976,_0x2d3741[_0x7b07('0x10')][_0x7b07('0x12')]);return _0x4b6f20(_0x2d3741[_0x7b07('0x10')]['message']);}logger[_0x7b07('0x10')](_0x7b07('0xc'),_0x4d9976,_0x2d3741[_0x7b07('0x10')][_0x7b07('0x12')]);return _0x3a82e8(_0x2d3741['error'][_0x7b07('0x12')]);}else{logger[_0x7b07('0xb')](_0x7b07('0xc'),_0x4d9976,_0x7b07('0xd'));_0x3a82e8(_0x2d3741['result']['message']);}})['catch'](function(_0x521d8d){logger[_0x7b07('0x10')](_0x7b07('0xc'),_0x4d9976,_0x521d8d);_0x4b6f20(_0x521d8d);});});} \ No newline at end of file +var _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x304102,_0x43e4f6){_0x304102=_0x304102-0x0;var _0x15e403=_0xbc9d[_0x304102];return _0x15e403;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('Migration,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index abc0f92..fefc6eb 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 _0xe2fe=['/:id','show','create','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x39ab81,_0x458741){var _0x36fdbb=function(_0x480442){while(--_0x480442){_0x39ab81['push'](_0x39ab81['shift']());}};_0x36fdbb(++_0x458741);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./network.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['post']('/',auth[_0xee2f('0x8')](),controller[_0xee2f('0xb')]);router['put'](_0xee2f('0x9'),auth[_0xee2f('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xc')]);module['exports']=router; \ No newline at end of file +var _0x1c76=['path','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','get','show','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1e0b14,_0x2df55b){var _0x5473b2=function(_0x317c64){while(--_0x317c64){_0x1e0b14['push'](_0x1e0b14['shift']());}};_0x5473b2(++_0x2df55b);}(_0x1c76,0x12b));var _0x61c7=function(_0x227bf8,_0x4be87b){_0x227bf8=_0x227bf8-0x0;var _0xc53ef8=_0x1c76[_0x227bf8];return _0xc53ef8;};'use strict';var multer=require(_0x61c7('0x0'));var util=require('util');var path=require(_0x61c7('0x1'));var timeout=require(_0x61c7('0x2'));var express=require('express');var router=express[_0x61c7('0x3')]();var fs_extra=require(_0x61c7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x61c7('0x5'));var controller=require('./network.controller');router['get']('/',auth[_0x61c7('0x6')](),controller['index']);router[_0x61c7('0x7')]('/:id',auth[_0x61c7('0x6')](),controller[_0x61c7('0x8')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x61c7('0x9')](_0x61c7('0xa'),auth[_0x61c7('0x6')](),controller[_0x61c7('0xb')]);router[_0x61c7('0xc')](_0x61c7('0xa'),auth['isAuthenticated'](),controller[_0x61c7('0xd')]);module[_0x61c7('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 18ce1c3..e8cc383 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 _0x2b20=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0xa8b596,_0x2396ef){var _0x1dfc5f=function(_0x25243b){while(--_0x25243b){_0xa8b596['push'](_0xa8b596['shift']());}};_0x1dfc5f(++_0x2396ef);}(_0x2b20,0x73));var _0x02b2=function(_0x252663,_0x5da67b){_0x252663=_0x252663-0x0;var _0x5cb3c9=_0x2b20[_0x252663];return _0x5cb3c9;};'use strict';var Sequelize=require(_0x02b2('0x0'));module[_0x02b2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x02b2('0x2'),'externip',_0x02b2('0x3'),_0x02b2('0x4'))},'value':{'type':Sequelize[_0x02b2('0x5')]},'username':{'type':Sequelize[_0x02b2('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb086=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0xb086,0xca));var _0x6b08=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb086[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x6b08('0x0'));module[_0x6b08('0x1')]={'type':{'type':Sequelize[_0x6b08('0x2')](_0x6b08('0x3'),_0x6b08('0x4'),_0x6b08('0x5'),'turn')},'value':{'type':Sequelize[_0x6b08('0x6')]},'username':{'type':Sequelize[_0x6b08('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 1531a0c..bd8a85c 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 _0x6516=['request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','offset','limit','undefined','count','status','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','Network','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','fields','find','create','body','toUpperCase','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','readFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','path','ejs','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s'];(function(_0x42f45f,_0x1b7fdd){var _0x2db896=function(_0x1dc1ad){while(--_0x1dc1ad){_0x42f45f['push'](_0x42f45f['shift']());}};_0x2db896(++_0x1b7fdd);}(_0x6516,0xed));var _0x6651=function(_0x2ab358,_0x15c4ca){_0x2ab358=_0x2ab358-0x0;var _0x2ef2eb=_0x6516[_0x2ab358];return _0x2ef2eb;};'use strict';var util=require('util');var path=require(_0x6651('0x0'));var ejs=require(_0x6651('0x1'));var fs=require('fs');var _=require(_0x6651('0x2'));var qs=require(_0x6651('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x6651('0x4'));var db=require(_0x6651('0x5'))['db'];var jayson=require(_0x6651('0x6'));var client=jayson[_0x6651('0x7')][_0x6651('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3440ec,_0x3b3b5b,_0x11d2f9,_0x52fe37){return new Promise(function(_0x2f2bc8,_0x55a84e){var _0x582297=_0x52fe37||client;return _0x582297[_0x6651('0x9')](_0x3440ec,_0x11d2f9)[_0x6651('0xa')](function(_0x14c15f){logger['info'](_0x6651('0xb'),_0x3b3b5b,_0x6651('0xc'));logger[_0x6651('0xd')](_0x6651('0xe'),_0x3b3b5b,_0x6651('0xc'),JSON['stringify'](_0x14c15f));if(_0x14c15f[_0x6651('0xf')]){if(_0x14c15f[_0x6651('0xf')][_0x6651('0x10')]===0x1f4){logger[_0x6651('0xf')](_0x6651('0xb'),_0x3b3b5b,_0x14c15f[_0x6651('0xf')]['message']);return _0x55a84e(_0x14c15f[_0x6651('0xf')][_0x6651('0x11')]);}logger[_0x6651('0xf')](_0x6651('0xb'),_0x3b3b5b,_0x14c15f['error'][_0x6651('0x11')]);return _0x2f2bc8(_0x14c15f[_0x6651('0xf')][_0x6651('0x11')]);}else{logger[_0x6651('0x12')]('Network,\x20%s,\x20%s',_0x3b3b5b,_0x6651('0xc'));_0x2f2bc8(_0x14c15f[_0x6651('0x13')][_0x6651('0x11')]);}})[_0x6651('0x14')](function(_0xfac511){logger['error']('Network,\x20%s,\x20%s',_0x3b3b5b,_0xfac511);_0x55a84e(_0xfac511);});});}function respondWithResult(_0x477568,_0x52fe8e){_0x52fe8e=_0x52fe8e||0xc8;return function(_0x27a104){if(_0x27a104){return _0x477568['status'](_0x52fe8e)['json'](_0x27a104);}};}function respondWithFilteredResult(_0x10d782,_0x50b1fc){return function(_0x61110c){if(_0x61110c){var _0x2ceb20=typeof _0x50b1fc[_0x6651('0x15')]==='undefined'&&typeof _0x50b1fc[_0x6651('0x16')]===_0x6651('0x17');var _0x24f1c4=_0x61110c[_0x6651('0x18')];var _0x4c8998=_0x2ceb20?0x0:_0x50b1fc[_0x6651('0x15')];var _0x89b799=_0x2ceb20?_0x61110c[_0x6651('0x18')]:_0x50b1fc['offset']+_0x50b1fc['limit'];var _0x1e27e7;if(_0x89b799>=_0x24f1c4){_0x89b799=_0x24f1c4;_0x1e27e7=0xc8;}else{_0x1e27e7=0xce;}_0x10d782[_0x6651('0x19')](_0x1e27e7);return _0x10d782['set'](_0x6651('0x1a'),_0x4c8998+'-'+_0x89b799+'/'+_0x24f1c4)[_0x6651('0x1b')](_0x61110c);}return null;};}function saveUpdates(_0x3c255a){return function(_0x26921b){if(_0x26921b){return _0x26921b[_0x6651('0x1c')](_0x3c255a)['then'](function(_0x4d0792){return _0x4d0792;});}return null;};}function removeEntity(_0x22b52c){return function(_0x70e507){if(_0x70e507){return _0x70e507[_0x6651('0x1d')]()[_0x6651('0xa')](function(){_0x22b52c[_0x6651('0x19')](0xcc)[_0x6651('0x1e')]();});}};}function handleEntityNotFound(_0x4107c9){return function(_0x4ad629){if(!_0x4ad629){_0x4107c9[_0x6651('0x1f')](0x194);}return _0x4ad629;};}function handleError(_0x46b103,_0x5156ed){_0x5156ed=_0x5156ed||0x1f4;return function(_0x782515){logger[_0x6651('0xf')](_0x782515[_0x6651('0x20')]);if(_0x782515[_0x6651('0x21')]){delete _0x782515[_0x6651('0x21')];}_0x46b103[_0x6651('0x19')](_0x5156ed)[_0x6651('0x22')](_0x782515);};}exports['index']=function(_0x405042,_0x1b4c3b){var _0x175371={},_0x52e309={},_0x41450b={'count':0x0,'rows':[]};var _0x22e11d=_['map'](db[_0x6651('0x23')]['rawAttributes'],function(_0x4c97d5){return{'name':_0x4c97d5[_0x6651('0x24')],'type':_0x4c97d5[_0x6651('0x25')]['key']};});_0x52e309['model']=_[_0x6651('0x26')](_0x22e11d,_0x6651('0x21'));_0x52e309[_0x6651('0x27')]=_[_0x6651('0x28')](_0x405042[_0x6651('0x27')]);_0x52e309[_0x6651('0x29')]=_[_0x6651('0x2a')](_0x52e309[_0x6651('0x2b')],_0x52e309[_0x6651('0x27')]);_0x175371[_0x6651('0x2c')]=_[_0x6651('0x2a')](_0x52e309[_0x6651('0x2b')],qs['fields'](_0x405042[_0x6651('0x27')]['fields']));_0x175371[_0x6651('0x2c')]=_0x175371[_0x6651('0x2c')][_0x6651('0x2d')]?_0x175371[_0x6651('0x2c')]:_0x52e309[_0x6651('0x2b')];if(!_0x405042[_0x6651('0x27')][_0x6651('0x2e')](_0x6651('0x2f'))){_0x175371[_0x6651('0x16')]=qs[_0x6651('0x16')](_0x405042['query']['limit']);_0x175371[_0x6651('0x15')]=qs[_0x6651('0x15')](_0x405042[_0x6651('0x27')][_0x6651('0x15')]);}_0x175371['order']=qs[_0x6651('0x30')](_0x405042[_0x6651('0x27')][_0x6651('0x30')]);_0x175371['where']=qs[_0x6651('0x29')](_['pick'](_0x405042[_0x6651('0x27')],_0x52e309[_0x6651('0x29')]),_0x22e11d);if(_0x405042[_0x6651('0x27')]['filter']){_0x175371[_0x6651('0x31')]=_[_0x6651('0x32')](_0x175371['where'],{'$or':_[_0x6651('0x26')](_0x22e11d,function(_0x4057d5){if(_0x4057d5[_0x6651('0x25')]!==_0x6651('0x33')){var _0x55a05d={};_0x55a05d[_0x4057d5[_0x6651('0x21')]]={'$like':'%'+_0x405042[_0x6651('0x27')][_0x6651('0x34')]+'%'};return _0x55a05d;}})});}_0x175371=_[_0x6651('0x32')]({},_0x175371,_0x405042[_0x6651('0x35')]);var _0x3a00e5={'where':_0x175371[_0x6651('0x31')]};return db[_0x6651('0x23')][_0x6651('0x18')](_0x3a00e5)[_0x6651('0xa')](function(_0x11d1b0){_0x41450b[_0x6651('0x18')]=_0x11d1b0;if(_0x405042['query'][_0x6651('0x36')]){_0x175371[_0x6651('0x37')]=[{'all':!![]}];}return db[_0x6651('0x23')][_0x6651('0x38')](_0x175371);})[_0x6651('0xa')](function(_0x23a29c){_0x41450b[_0x6651('0x39')]=_0x23a29c;return _0x41450b;})[_0x6651('0xa')](respondWithFilteredResult(_0x1b4c3b,_0x175371))[_0x6651('0x14')](handleError(_0x1b4c3b,null));};exports['show']=function(_0x4ba27c,_0x5864b0){var _0xd0d9dd={'raw':!![],'where':{'id':_0x4ba27c['params']['id']}},_0x47f558={};_0x47f558[_0x6651('0x2b')]=_['keys'](db['Network']['rawAttributes']);_0x47f558[_0x6651('0x27')]=_[_0x6651('0x28')](_0x4ba27c[_0x6651('0x27')]);_0x47f558[_0x6651('0x29')]=_['intersection'](_0x47f558[_0x6651('0x2b')],_0x47f558[_0x6651('0x27')]);_0xd0d9dd[_0x6651('0x2c')]=_[_0x6651('0x2a')](_0x47f558[_0x6651('0x2b')],qs[_0x6651('0x3a')](_0x4ba27c[_0x6651('0x27')]['fields']));_0xd0d9dd[_0x6651('0x2c')]=_0xd0d9dd[_0x6651('0x2c')][_0x6651('0x2d')]?_0xd0d9dd['attributes']:_0x47f558[_0x6651('0x2b')];if(_0x4ba27c[_0x6651('0x27')][_0x6651('0x36')]){_0xd0d9dd[_0x6651('0x37')]=[{'all':!![]}];}_0xd0d9dd=_[_0x6651('0x32')]({},_0xd0d9dd,_0x4ba27c['options']);return db[_0x6651('0x23')][_0x6651('0x3b')](_0xd0d9dd)[_0x6651('0xa')](handleEntityNotFound(_0x5864b0,null))[_0x6651('0xa')](respondWithResult(_0x5864b0,null))[_0x6651('0x14')](handleError(_0x5864b0,null));};exports[_0x6651('0x3c')]=function(_0x5ed8d4,_0x4decb5){var _0x12fc91;return db[_0x6651('0x23')]['create'](_0x5ed8d4[_0x6651('0x3d')],{'raw':!![]})[_0x6651('0xa')](function(_0xdec57c){_0x12fc91=_0xdec57c;return db['Network'][_0x6651('0x38')]({'where':{'type':_0x5ed8d4[_0x6651('0x3d')][_0x6651('0x25')]},'raw':!![]});})[_0x6651('0xa')](function(_0x5cf491){if(_0x12fc91[_0x6651('0x25')][_0x6651('0x3e')]()==_0x6651('0x3f')){var _0x3fe92e=fs['readFileSync'](path['join'](config['root'],_0x6651('0x40')),_0x6651('0x41'));var _0x20f73f=ejs[_0x6651('0x42')](_0x3fe92e,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')](_0x6651('0x44'),_0x20f73f);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x3c'),{'module':_0x6651('0x46')});}else if(_0x12fc91['type']['toUpperCase']()==_0x6651('0x47')){var _0x552f08=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x4a')),_0x6651('0x41'));var _0x3136cc=ejs[_0x6651('0x42')](_0x552f08,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')]('/etc/asterisk/turn_xcally.conf',_0x3136cc);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x3c'),{'module':_0x6651('0x46')});}else{var _0x100492=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/network.ejs'),_0x6651('0x41'));var _0x3b86bb=ejs['render'](_0x100492,{'networks':_0x5cf491||[]});fs[_0x6651('0x43')](util[_0x6651('0x4c')](_0x6651('0x4d'),_0x5ed8d4['body'][_0x6651('0x25')][_0x6651('0x4e')]()),_0x3b86bb);return respondWithRpcPromise(_0x6651('0x45'),'create',{'module':_0x6651('0x4f')});}})['then'](function(){return _0x12fc91;})[_0x6651('0xa')](respondWithResult(_0x4decb5,0xc9))[_0x6651('0x14')](handleError(_0x4decb5,null));};exports[_0x6651('0x1c')]=function(_0x25fc51,_0x577825){var _0x2c8e5f;return db[_0x6651('0x23')]['find']({'where':{'id':_0x25fc51[_0x6651('0x50')]['id']}})[_0x6651('0xa')](handleEntityNotFound(_0x577825,null))[_0x6651('0xa')](saveUpdates(_0x25fc51[_0x6651('0x3d')],null))[_0x6651('0xa')](function(_0x4c3fbd){if(_0x4c3fbd){_0x2c8e5f=_0x4c3fbd;return db[_0x6651('0x23')][_0x6651('0x38')]({'where':{'type':_0x2c8e5f[_0x6651('0x25')]},'raw':!![]});}return null;})[_0x6651('0xa')](function(_0xaf8d7a){if(_0x2c8e5f[_0x6651('0x25')][_0x6651('0x3e')]()=='STUN'){var _0x42e0ae=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x488be3=ejs[_0x6651('0x42')](_0x42e0ae,{'networks':_0xaf8d7a||[]});fs['writeFileSync'](_0x6651('0x44'),_0x488be3);return respondWithRpcPromise('Reload',_0x6651('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x2c8e5f[_0x6651('0x25')][_0x6651('0x3e')]()==_0x6651('0x47')){var _0x3a42c8=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x4a')),_0x6651('0x41'));var _0x4c10f4=ejs[_0x6651('0x42')](_0x3a42c8,{'networks':_0xaf8d7a||[]});fs['writeFileSync'](_0x6651('0x51'),_0x4c10f4);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x1c'),{'module':_0x6651('0x46')});}else{var _0x4cb542=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config[_0x6651('0x49')],'server/files/templates/network.ejs'),_0x6651('0x41'));var _0x54414e=ejs['render'](_0x4cb542,{'networks':_0xaf8d7a||[]});fs[_0x6651('0x43')](util['format'](_0x6651('0x4d'),_0x25fc51[_0x6651('0x3d')][_0x6651('0x25')]['toLowerCase']()),_0x54414e);return respondWithRpcPromise(_0x6651('0x45'),'update',{'module':_0x6651('0x4f')});}})[_0x6651('0xa')](function(_0x230419){if(_0x230419){return _0x2c8e5f;}return null;})['then'](respondWithResult(_0x577825,null))[_0x6651('0x14')](handleError(_0x577825,null));};exports[_0x6651('0x1d')]=function(_0x1ce3bb,_0x19c2b7){var _0x344d60;return db[_0x6651('0x23')]['find']({'where':{'id':_0x1ce3bb[_0x6651('0x50')]['id']}})[_0x6651('0xa')](function(_0xc8d5e4){_0x344d60=_0xc8d5e4;return _0xc8d5e4;})[_0x6651('0xa')](handleEntityNotFound(_0x19c2b7,null))[_0x6651('0xa')](removeEntity(_0x19c2b7,null))[_0x6651('0xa')](function(){if(_0x344d60){return db[_0x6651('0x23')][_0x6651('0x38')]({'where':{'type':_0x344d60[_0x6651('0x25')]},'raw':!![]});}})[_0x6651('0xa')](function(_0x429231){if(_0x344d60[_0x6651('0x25')]['toUpperCase']()==_0x6651('0x3f')){var _0x29f8a5=fs['readFileSync'](path['join'](config[_0x6651('0x49')],_0x6651('0x40')),_0x6651('0x41'));var _0x445f86=ejs[_0x6651('0x42')](_0x29f8a5,{'networks':_0x429231||[]});fs[_0x6651('0x43')](_0x6651('0x44'),_0x445f86);return respondWithRpcPromise(_0x6651('0x45'),_0x6651('0x1d'),{'module':_0x6651('0x46')});}else if(_0x344d60['type'][_0x6651('0x3e')]()==_0x6651('0x47')){var _0x16f619=fs[_0x6651('0x4b')](path[_0x6651('0x48')](config['root'],_0x6651('0x4a')),_0x6651('0x41'));var _0x5d4d9c=ejs[_0x6651('0x42')](_0x16f619,{'networks':_0x429231||[]});fs[_0x6651('0x43')]('/etc/asterisk/turn_xcally.conf',_0x5d4d9c);return respondWithRpcPromise('Reload',_0x6651('0x1d'),{'module':_0x6651('0x46')});}else{var _0x2329c9=fs['readFileSync'](path[_0x6651('0x48')](config[_0x6651('0x49')],_0x6651('0x52')),_0x6651('0x41'));var _0x1aee1b=ejs[_0x6651('0x42')](_0x2329c9,{'networks':_0x429231||[]});fs[_0x6651('0x43')](util[_0x6651('0x4c')](_0x6651('0x4d'),_0x344d60[_0x6651('0x25')][_0x6651('0x4e')]()),_0x1aee1b);return respondWithRpcPromise(_0x6651('0x45'),'destroy',{'module':_0x6651('0x4f')});}})[_0x6651('0x14')](handleError(_0x19c2b7,null));}; \ No newline at end of file +var _0xf5a5=['lodash','../../components/parsers/qs','api','../../config/environment','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','status','end','name','index','map','Network','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','findAll','chan_sip.so','util','path','ejs'];(function(_0x450424,_0x59905d){var _0x2405b9=function(_0x277788){while(--_0x277788){_0x450424['push'](_0x450424['shift']());}};_0x2405b9(++_0x59905d);}(_0xf5a5,0xf9));var _0x5f5a=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xf5a5[_0x2dea24];return _0x309d58;};'use strict';var util=require(_0x5f5a('0x0'));var path=require(_0x5f5a('0x1'));var ejs=require(_0x5f5a('0x2'));var fs=require('fs');var _=require(_0x5f5a('0x3'));var qs=require(_0x5f5a('0x4'));var logger=require('../../config/logger')(_0x5f5a('0x5'));var config=require(_0x5f5a('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5f5a('0x7'));var client=jayson[_0x5f5a('0x8')][_0x5f5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33794e,_0x15d2e0,_0x52a9aa,_0x1753f1){return new Promise(function(_0x5810e3,_0x58c2ba){var _0x476a3b=_0x1753f1||client;return _0x476a3b[_0x5f5a('0xa')](_0x33794e,_0x52a9aa)['then'](function(_0x34145b){logger[_0x5f5a('0xb')](_0x5f5a('0xc'),_0x15d2e0,'request\x20sent');logger[_0x5f5a('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x15d2e0,_0x5f5a('0xe'),JSON[_0x5f5a('0xf')](_0x34145b));if(_0x34145b[_0x5f5a('0x10')]){if(_0x34145b[_0x5f5a('0x10')]['code']===0x1f4){logger[_0x5f5a('0x10')]('Network,\x20%s,\x20%s',_0x15d2e0,_0x34145b[_0x5f5a('0x10')][_0x5f5a('0x11')]);return _0x58c2ba(_0x34145b['error'][_0x5f5a('0x11')]);}logger[_0x5f5a('0x10')]('Network,\x20%s,\x20%s',_0x15d2e0,_0x34145b['error'][_0x5f5a('0x11')]);return _0x5810e3(_0x34145b[_0x5f5a('0x10')][_0x5f5a('0x11')]);}else{logger[_0x5f5a('0xb')](_0x5f5a('0xc'),_0x15d2e0,_0x5f5a('0xe'));_0x5810e3(_0x34145b[_0x5f5a('0x12')]['message']);}})[_0x5f5a('0x13')](function(_0x55c786){logger[_0x5f5a('0x10')]('Network,\x20%s,\x20%s',_0x15d2e0,_0x55c786);_0x58c2ba(_0x55c786);});});}function respondWithResult(_0xdb9530,_0x1f627a){_0x1f627a=_0x1f627a||0xc8;return function(_0x28159b){if(_0x28159b){return _0xdb9530['status'](_0x1f627a)[_0x5f5a('0x14')](_0x28159b);}};}function respondWithFilteredResult(_0x2baa79,_0x2edff1){return function(_0x361ddf){if(_0x361ddf){var _0x4a56fa=typeof _0x2edff1[_0x5f5a('0x15')]===_0x5f5a('0x16')&&typeof _0x2edff1[_0x5f5a('0x17')]===_0x5f5a('0x16');var _0x237484=_0x361ddf[_0x5f5a('0x18')];var _0x32ca68=_0x4a56fa?0x0:_0x2edff1[_0x5f5a('0x15')];var _0x2921f0=_0x4a56fa?_0x361ddf[_0x5f5a('0x18')]:_0x2edff1[_0x5f5a('0x15')]+_0x2edff1[_0x5f5a('0x17')];var _0x5e6044;if(_0x2921f0>=_0x237484){_0x2921f0=_0x237484;_0x5e6044=0xc8;}else{_0x5e6044=0xce;}_0x2baa79['status'](_0x5e6044);return _0x2baa79[_0x5f5a('0x19')](_0x5f5a('0x1a'),_0x32ca68+'-'+_0x2921f0+'/'+_0x237484)[_0x5f5a('0x14')](_0x361ddf);}return null;};}function saveUpdates(_0x2439da){return function(_0x351b52){if(_0x351b52){return _0x351b52[_0x5f5a('0x1b')](_0x2439da)[_0x5f5a('0x1c')](function(_0x3a283c){return _0x3a283c;});}return null;};}function removeEntity(_0x47f889){return function(_0x591a1e){if(_0x591a1e){return _0x591a1e[_0x5f5a('0x1d')]()['then'](function(){_0x47f889[_0x5f5a('0x1e')](0xcc)[_0x5f5a('0x1f')]();});}};}function handleEntityNotFound(_0x54ed63){return function(_0x56d3d3){if(!_0x56d3d3){_0x54ed63['sendStatus'](0x194);}return _0x56d3d3;};}function handleError(_0x1bc19f,_0x291243){_0x291243=_0x291243||0x1f4;return function(_0x4610d0){logger[_0x5f5a('0x10')](_0x4610d0['stack']);if(_0x4610d0['name']){delete _0x4610d0[_0x5f5a('0x20')];}_0x1bc19f['status'](_0x291243)['send'](_0x4610d0);};}exports[_0x5f5a('0x21')]=function(_0x2d089,_0x587bb2){var _0x3115cf={},_0x1a8258={},_0x43adf7={'count':0x0,'rows':[]};var _0x400026=_[_0x5f5a('0x22')](db[_0x5f5a('0x23')]['rawAttributes'],function(_0x270ee8){return{'name':_0x270ee8['fieldName'],'type':_0x270ee8[_0x5f5a('0x24')][_0x5f5a('0x25')]};});_0x1a8258[_0x5f5a('0x26')]=_[_0x5f5a('0x22')](_0x400026,_0x5f5a('0x20'));_0x1a8258[_0x5f5a('0x27')]=_[_0x5f5a('0x28')](_0x2d089[_0x5f5a('0x27')]);_0x1a8258[_0x5f5a('0x29')]=_[_0x5f5a('0x2a')](_0x1a8258[_0x5f5a('0x26')],_0x1a8258[_0x5f5a('0x27')]);_0x3115cf[_0x5f5a('0x2b')]=_['intersection'](_0x1a8258['model'],qs[_0x5f5a('0x2c')](_0x2d089[_0x5f5a('0x27')][_0x5f5a('0x2c')]));_0x3115cf['attributes']=_0x3115cf[_0x5f5a('0x2b')][_0x5f5a('0x2d')]?_0x3115cf[_0x5f5a('0x2b')]:_0x1a8258[_0x5f5a('0x26')];if(!_0x2d089[_0x5f5a('0x27')][_0x5f5a('0x2e')](_0x5f5a('0x2f'))){_0x3115cf[_0x5f5a('0x17')]=qs[_0x5f5a('0x17')](_0x2d089[_0x5f5a('0x27')]['limit']);_0x3115cf[_0x5f5a('0x15')]=qs['offset'](_0x2d089['query'][_0x5f5a('0x15')]);}_0x3115cf['order']=qs['sort'](_0x2d089[_0x5f5a('0x27')]['sort']);_0x3115cf['where']=qs['filters'](_[_0x5f5a('0x30')](_0x2d089[_0x5f5a('0x27')],_0x1a8258[_0x5f5a('0x29')]),_0x400026);if(_0x2d089[_0x5f5a('0x27')][_0x5f5a('0x31')]){_0x3115cf[_0x5f5a('0x32')]=_[_0x5f5a('0x33')](_0x3115cf[_0x5f5a('0x32')],{'$or':_[_0x5f5a('0x22')](_0x400026,function(_0x530cfc){if(_0x530cfc['type']!==_0x5f5a('0x34')){var _0x5b449a={};_0x5b449a[_0x530cfc[_0x5f5a('0x20')]]={'$like':'%'+_0x2d089[_0x5f5a('0x27')][_0x5f5a('0x31')]+'%'};return _0x5b449a;}})});}_0x3115cf=_[_0x5f5a('0x33')]({},_0x3115cf,_0x2d089[_0x5f5a('0x35')]);var _0x47b1b2={'where':_0x3115cf[_0x5f5a('0x32')]};return db['Network'][_0x5f5a('0x18')](_0x47b1b2)[_0x5f5a('0x1c')](function(_0x4c45df){_0x43adf7[_0x5f5a('0x18')]=_0x4c45df;if(_0x2d089['query'][_0x5f5a('0x36')]){_0x3115cf[_0x5f5a('0x37')]=[{'all':!![]}];}return db[_0x5f5a('0x23')]['findAll'](_0x3115cf);})['then'](function(_0x4f943b){_0x43adf7[_0x5f5a('0x38')]=_0x4f943b;return _0x43adf7;})[_0x5f5a('0x1c')](respondWithFilteredResult(_0x587bb2,_0x3115cf))[_0x5f5a('0x13')](handleError(_0x587bb2,null));};exports[_0x5f5a('0x39')]=function(_0x18e4c1,_0x3ff7b9){var _0x369041={'raw':!![],'where':{'id':_0x18e4c1[_0x5f5a('0x3a')]['id']}},_0x164771={};_0x164771[_0x5f5a('0x26')]=_[_0x5f5a('0x28')](db[_0x5f5a('0x23')][_0x5f5a('0x3b')]);_0x164771['query']=_[_0x5f5a('0x28')](_0x18e4c1[_0x5f5a('0x27')]);_0x164771[_0x5f5a('0x29')]=_[_0x5f5a('0x2a')](_0x164771[_0x5f5a('0x26')],_0x164771[_0x5f5a('0x27')]);_0x369041[_0x5f5a('0x2b')]=_[_0x5f5a('0x2a')](_0x164771[_0x5f5a('0x26')],qs[_0x5f5a('0x2c')](_0x18e4c1['query'][_0x5f5a('0x2c')]));_0x369041[_0x5f5a('0x2b')]=_0x369041[_0x5f5a('0x2b')][_0x5f5a('0x2d')]?_0x369041['attributes']:_0x164771[_0x5f5a('0x26')];if(_0x18e4c1[_0x5f5a('0x27')][_0x5f5a('0x36')]){_0x369041['include']=[{'all':!![]}];}_0x369041=_[_0x5f5a('0x33')]({},_0x369041,_0x18e4c1['options']);return db[_0x5f5a('0x23')][_0x5f5a('0x3c')](_0x369041)[_0x5f5a('0x1c')](handleEntityNotFound(_0x3ff7b9,null))[_0x5f5a('0x1c')](respondWithResult(_0x3ff7b9,null))[_0x5f5a('0x13')](handleError(_0x3ff7b9,null));};exports[_0x5f5a('0x3d')]=function(_0x3c90b8,_0x1448f9){var _0x116b1a;return db['Network'][_0x5f5a('0x3d')](_0x3c90b8[_0x5f5a('0x3e')],{'raw':!![]})[_0x5f5a('0x1c')](function(_0xdc8e63){_0x116b1a=_0xdc8e63;return db[_0x5f5a('0x23')]['findAll']({'where':{'type':_0x3c90b8[_0x5f5a('0x3e')][_0x5f5a('0x24')]},'raw':!![]});})[_0x5f5a('0x1c')](function(_0x15a465){if(_0x116b1a[_0x5f5a('0x24')][_0x5f5a('0x3f')]()==_0x5f5a('0x40')){var _0x182b86=fs[_0x5f5a('0x41')](path['join'](config[_0x5f5a('0x42')],_0x5f5a('0x43')),_0x5f5a('0x44'));var _0x4e84e0=ejs[_0x5f5a('0x45')](_0x182b86,{'networks':_0x15a465||[]});fs[_0x5f5a('0x46')](_0x5f5a('0x47'),_0x4e84e0);return respondWithRpcPromise(_0x5f5a('0x48'),_0x5f5a('0x3d'),{'module':_0x5f5a('0x49')});}else if(_0x116b1a[_0x5f5a('0x24')][_0x5f5a('0x3f')]()==_0x5f5a('0x4a')){var _0x16c9d5=fs[_0x5f5a('0x41')](path[_0x5f5a('0x4b')](config[_0x5f5a('0x42')],_0x5f5a('0x4c')),_0x5f5a('0x44'));var _0x209279=ejs[_0x5f5a('0x45')](_0x16c9d5,{'networks':_0x15a465||[]});fs[_0x5f5a('0x46')](_0x5f5a('0x4d'),_0x209279);return respondWithRpcPromise('Reload',_0x5f5a('0x3d'),{'module':'res_stun_monitor.so'});}else{var _0x266505=fs['readFileSync'](path[_0x5f5a('0x4b')](config[_0x5f5a('0x42')],_0x5f5a('0x4e')),'utf8');var _0x4eb6ec=ejs['render'](_0x266505,{'networks':_0x15a465||[]});fs[_0x5f5a('0x46')](util[_0x5f5a('0x4f')](_0x5f5a('0x50'),_0x3c90b8[_0x5f5a('0x3e')][_0x5f5a('0x24')][_0x5f5a('0x51')]()),_0x4eb6ec);return respondWithRpcPromise(_0x5f5a('0x48'),_0x5f5a('0x3d'),{'module':'chan_sip.so'});}})['then'](function(){return _0x116b1a;})[_0x5f5a('0x1c')](respondWithResult(_0x1448f9,0xc9))['catch'](handleError(_0x1448f9,null));};exports[_0x5f5a('0x1b')]=function(_0x523e5,_0x5b0cfc){var _0xdf5e5d;return db[_0x5f5a('0x23')][_0x5f5a('0x3c')]({'where':{'id':_0x523e5[_0x5f5a('0x3a')]['id']}})[_0x5f5a('0x1c')](handleEntityNotFound(_0x5b0cfc,null))[_0x5f5a('0x1c')](saveUpdates(_0x523e5[_0x5f5a('0x3e')],null))['then'](function(_0x3bd80d){if(_0x3bd80d){_0xdf5e5d=_0x3bd80d;return db[_0x5f5a('0x23')][_0x5f5a('0x52')]({'where':{'type':_0xdf5e5d[_0x5f5a('0x24')]},'raw':!![]});}return null;})['then'](function(_0x4f979d){if(_0xdf5e5d[_0x5f5a('0x24')][_0x5f5a('0x3f')]()=='STUN'){var _0x2b0b92=fs['readFileSync'](path['join'](config[_0x5f5a('0x42')],_0x5f5a('0x43')),_0x5f5a('0x44'));var _0x174501=ejs[_0x5f5a('0x45')](_0x2b0b92,{'networks':_0x4f979d||[]});fs[_0x5f5a('0x46')](_0x5f5a('0x47'),_0x174501);return respondWithRpcPromise('Reload','update',{'module':_0x5f5a('0x49')});}else if(_0xdf5e5d[_0x5f5a('0x24')]['toUpperCase']()==_0x5f5a('0x4a')){var _0x3240b9=fs[_0x5f5a('0x41')](path[_0x5f5a('0x4b')](config['root'],_0x5f5a('0x4c')),_0x5f5a('0x44'));var _0x5693af=ejs[_0x5f5a('0x45')](_0x3240b9,{'networks':_0x4f979d||[]});fs['writeFileSync'](_0x5f5a('0x4d'),_0x5693af);return respondWithRpcPromise('Reload',_0x5f5a('0x1b'),{'module':_0x5f5a('0x49')});}else{var _0x399f54=fs['readFileSync'](path['join'](config[_0x5f5a('0x42')],'server/files/templates/network.ejs'),_0x5f5a('0x44'));var _0xd4bbdc=ejs['render'](_0x399f54,{'networks':_0x4f979d||[]});fs[_0x5f5a('0x46')](util[_0x5f5a('0x4f')](_0x5f5a('0x50'),_0x523e5[_0x5f5a('0x3e')][_0x5f5a('0x24')]['toLowerCase']()),_0xd4bbdc);return respondWithRpcPromise('Reload',_0x5f5a('0x1b'),{'module':_0x5f5a('0x53')});}})[_0x5f5a('0x1c')](function(_0x3bbc7d){if(_0x3bbc7d){return _0xdf5e5d;}return null;})['then'](respondWithResult(_0x5b0cfc,null))['catch'](handleError(_0x5b0cfc,null));};exports[_0x5f5a('0x1d')]=function(_0x193301,_0x5560f){var _0x5deb08;return db[_0x5f5a('0x23')][_0x5f5a('0x3c')]({'where':{'id':_0x193301[_0x5f5a('0x3a')]['id']}})[_0x5f5a('0x1c')](function(_0x1ad85c){_0x5deb08=_0x1ad85c;return _0x1ad85c;})[_0x5f5a('0x1c')](handleEntityNotFound(_0x5560f,null))[_0x5f5a('0x1c')](removeEntity(_0x5560f,null))[_0x5f5a('0x1c')](function(){if(_0x5deb08){return db[_0x5f5a('0x23')][_0x5f5a('0x52')]({'where':{'type':_0x5deb08[_0x5f5a('0x24')]},'raw':!![]});}})['then'](function(_0x28e72){if(_0x5deb08[_0x5f5a('0x24')]['toUpperCase']()==_0x5f5a('0x40')){var _0x1f075d=fs[_0x5f5a('0x41')](path[_0x5f5a('0x4b')](config[_0x5f5a('0x42')],_0x5f5a('0x43')),_0x5f5a('0x44'));var _0x135825=ejs[_0x5f5a('0x45')](_0x1f075d,{'networks':_0x28e72||[]});fs[_0x5f5a('0x46')](_0x5f5a('0x47'),_0x135825);return respondWithRpcPromise(_0x5f5a('0x48'),_0x5f5a('0x1d'),{'module':_0x5f5a('0x49')});}else if(_0x5deb08['type'][_0x5f5a('0x3f')]()==_0x5f5a('0x4a')){var _0x51b4c2=fs[_0x5f5a('0x41')](path[_0x5f5a('0x4b')](config[_0x5f5a('0x42')],_0x5f5a('0x4c')),_0x5f5a('0x44'));var _0x4d9c3a=ejs['render'](_0x51b4c2,{'networks':_0x28e72||[]});fs[_0x5f5a('0x46')]('/etc/asterisk/turn_xcally.conf',_0x4d9c3a);return respondWithRpcPromise(_0x5f5a('0x48'),_0x5f5a('0x1d'),{'module':_0x5f5a('0x49')});}else{var _0x5241c8=fs[_0x5f5a('0x41')](path[_0x5f5a('0x4b')](config['root'],_0x5f5a('0x4e')),_0x5f5a('0x44'));var _0x37628b=ejs[_0x5f5a('0x45')](_0x5241c8,{'networks':_0x28e72||[]});fs[_0x5f5a('0x46')](util[_0x5f5a('0x4f')](_0x5f5a('0x50'),_0x5deb08[_0x5f5a('0x24')][_0x5f5a('0x51')]()),_0x37628b);return respondWithRpcPromise(_0x5f5a('0x48'),'destroy',{'module':_0x5f5a('0x53')});}})['catch'](handleError(_0x5560f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9333723..ea89058 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 _0xbc9d=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x220ae9,_0x1d9cfa){var _0x164801=function(_0x285bec){while(--_0x285bec){_0x220ae9['push'](_0x220ae9['shift']());}};_0x164801(++_0x1d9cfa);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x1fe67a,_0x3794b1){_0x1fe67a=_0x1fe67a-0x0;var _0x3c5f44=_0xbc9d[_0x1fe67a];return _0x3c5f44;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var logger=require(_0xdbc9('0x2'))(_0xdbc9('0x3'));var moment=require(_0xdbc9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var attributes=require(_0xdbc9('0x7'));module[_0xdbc9('0x8')]=function(_0x6ab397,_0x7c4c55){return _0x6ab397[_0xdbc9('0x9')]('Network',attributes,{'tableName':_0xdbc9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf6e=['./network.attributes','exports','define','Network','network','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3175ce,_0x2f2b0a){var _0x1dc515=function(_0x2c6da5){while(--_0x2c6da5){_0x3175ce['push'](_0x3175ce['shift']());}};_0x1dc515(++_0x2f2b0a);}(_0xbf6e,0x149));var _0xebf6=function(_0x208d7a,_0x18a2b2){_0x208d7a=_0x208d7a-0x0;var _0x46b3a6=_0xbf6e[_0x208d7a];return _0x46b3a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xebf6('0x0'))(_0xebf6('0x1'));var moment=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var rp=require(_0xebf6('0x4'));var fs=require('fs');var path=require(_0xebf6('0x5'));var rimraf=require(_0xebf6('0x6'));var config=require('../../config/environment');var attributes=require(_0xebf6('0x7'));module[_0xebf6('0x8')]=function(_0x3b2bb6,_0x1e15cf){return _0x3b2bb6[_0xebf6('0x9')](_0xebf6('0xa'),attributes,{'tableName':_0xebf6('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 71be142..8c9a4f0 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(_0x236a55,_0x145ba8){var _0x435fef=function(_0x3699e1){while(--_0x3699e1){_0x236a55['push'](_0x236a55['shift']());}};_0x435fef(++_0x145ba8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x255c33,_0x1a0eba){_0x255c33=_0x255c33-0x0;var _0x548d87=_0x7a54[_0x255c33];return _0x548d87;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index b9cfada..a88a421 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 _0x4f95=['/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','notify','/:id/applications','addApplications','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/:id','show','/:id/dispositions'];(function(_0x3e948f,_0x19484d){var _0x4cc3de=function(_0x335e95){while(--_0x335e95){_0x3e948f['push'](_0x3e948f['shift']());}};_0x4cc3de(++_0x19484d);}(_0x4f95,0x76));var _0x54f9=function(_0x38093b,_0x55be97){_0x38093b=_0x38093b-0x0;var _0x16e592=_0x4f95[_0x38093b];return _0x16e592;};'use strict';var multer=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var path=require(_0x54f9('0x2'));var timeout=require(_0x54f9('0x3'));var express=require(_0x54f9('0x4'));var router=express[_0x54f9('0x5')]();var fs_extra=require(_0x54f9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x54f9('0x7'));var config=require('../../config/environment');var controller=require(_0x54f9('0x8'));router[_0x54f9('0x9')]('/',auth[_0x54f9('0xa')](),controller['index']);router[_0x54f9('0x9')]('/describe',auth[_0x54f9('0xa')](),controller['describe']);router['get'](_0x54f9('0xb'),auth[_0x54f9('0xa')](),controller[_0x54f9('0xc')]);router['get'](_0x54f9('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x54f9('0x9')](_0x54f9('0xe'),auth[_0x54f9('0xa')](),controller[_0x54f9('0xf')]);router[_0x54f9('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x54f9('0x10'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x11')]);router[_0x54f9('0x9')](_0x54f9('0x12'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x13')]);router['post']('/',auth[_0x54f9('0xa')](),controller[_0x54f9('0x14')]);router[_0x54f9('0x15')](_0x54f9('0xd'),auth[_0x54f9('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x54f9('0xa')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x54f9('0x16')]);router[_0x54f9('0x15')](_0x54f9('0x17'),auth[_0x54f9('0xa')](),controller[_0x54f9('0x18')]);router[_0x54f9('0x15')](_0x54f9('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x54f9('0x19'),auth['isAuthenticated'](),controller[_0x54f9('0x1a')]);router[_0x54f9('0x1b')]('/:id',auth[_0x54f9('0xa')](),controller[_0x54f9('0x1c')]);router['delete'](_0x54f9('0xb'),auth['isAuthenticated'](),controller[_0x54f9('0x1d')]);router[_0x54f9('0x1e')](_0x54f9('0xd'),auth['isAuthenticated'](),controller[_0x54f9('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x54f9('0xa')](),controller[_0x54f9('0x20')]);router[_0x54f9('0x1e')]('/:id/users',auth[_0x54f9('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2e6a=['addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x2e6a,0x82));var _0xa2e6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x2e6a[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xa2e6('0x0'));var util=require(_0xa2e6('0x1'));var path=require(_0xa2e6('0x2'));var timeout=require(_0xa2e6('0x3'));var express=require(_0xa2e6('0x4'));var router=express[_0xa2e6('0x5')]();var fs_extra=require(_0xa2e6('0x6'));var auth=require(_0xa2e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2e6('0x8'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0xa2e6('0x9')](),controller[_0xa2e6('0xa')]);router[_0xa2e6('0xb')](_0xa2e6('0xc'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0xd')]);router['get'](_0xa2e6('0xe'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0xf')]);router[_0xa2e6('0xb')](_0xa2e6('0x10'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x11')]);router[_0xa2e6('0xb')]('/:id/canned_answers',auth[_0xa2e6('0x9')](),controller['getAnswers']);router[_0xa2e6('0xb')](_0xa2e6('0x12'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x13')]);router['get'](_0xa2e6('0x14'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x15')]);router[_0xa2e6('0xb')](_0xa2e6('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa2e6('0x17')]('/',auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x18')]);router[_0xa2e6('0x17')]('/:id/dispositions',auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x19')]);router[_0xa2e6('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa2e6('0x1a')]);router[_0xa2e6('0x17')](_0xa2e6('0x1b'),controller[_0xa2e6('0x1c')]);router['post'](_0xa2e6('0x12'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x1d')]);router['post'](_0xa2e6('0x16'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x1e')]);router[_0xa2e6('0x17')](_0xa2e6('0x1f'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x20')]);router['put'](_0xa2e6('0xe'),auth['isAuthenticated'](),controller[_0xa2e6('0x21')]);router[_0xa2e6('0x22')](_0xa2e6('0xe'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x23')]);router[_0xa2e6('0x22')](_0xa2e6('0x10'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x24')]);router[_0xa2e6('0x22')](_0xa2e6('0x25'),auth[_0xa2e6('0x9')](),controller['removeAnswers']);router[_0xa2e6('0x22')](_0xa2e6('0x16'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d3b0a34..94a081c 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 _0x9ae5=['name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x55f029,_0x1024e9){var _0x6c02bd=function(_0x2ffde6){while(--_0x2ffde6){_0x55f029['push'](_0x55f029['shift']());}};_0x6c02bd(++_0x1024e9);}(_0x9ae5,0x1a0));var _0x59ae=function(_0x4908c2,_0x5572d2){_0x4908c2=_0x4908c2-0x0;var _0x2820c2=_0x9ae5[_0x4908c2];return _0x2820c2;};'use strict';var Sequelize=require(_0x59ae('0x0'));var rs=require(_0x59ae('0x1'));module[_0x59ae('0x2')]={'name':{'type':Sequelize[_0x59ae('0x3')],'unique':_0x59ae('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x59ae('0x3')]},'token':{'type':Sequelize[_0x59ae('0x3')],'defaultValue':function(){return rs[_0x59ae('0x5')]();}},'replyUri':{'type':Sequelize[_0x59ae('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x59ae('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x59ae('0x6')],'defaultValue':function(){return _0x59ae('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x59ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x59ae('0x3')]},'queueTransfer':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x59ae('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x59ae('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x59ae('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x59ae('0xb'),'set':function(_0x223303){if(!_0x223303)this[_0x59ae('0xc')](_0x59ae('0xd'),null);this[_0x59ae('0xc')](_0x59ae('0xe'),_0x223303);}}}; \ No newline at end of file +var _0x860b=['setDataValue','mandatoryDisposition','sequelize','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x860b,0x1a6));var _0xb860=function(_0xae2f6c,_0x4cf458){_0xae2f6c=_0xae2f6c-0x0;var _0x393b2f=_0x860b[_0xae2f6c];return _0x393b2f;};'use strict';var Sequelize=require(_0xb860('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xb860('0x1')],'unique':_0xb860('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb860('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb860('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb860('0x1')]},'queueTransfer':{'type':Sequelize[_0xb860('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb860('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb860('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb860('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xb860('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb860('0x7'),'set':function(_0x55a864){if(!_0x55a864)this[_0xb860('0x8')]('mandatoryDispositionPauseId',null);this[_0xb860('0x8')](_0xb860('0x9'),_0x55a864);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0a7fc79..f3baec5 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 _0x6ae0=['addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','getApplications','hasOwnProperty','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','OpenchannelMessage','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','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','localhost','redis','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','show','params','Pause','length','include','find','create','body','user','get','UserProfileSection','userProfileId','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','keys','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','Sequelize','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','from','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager'];(function(_0x14ad1a,_0x1d3f95){var _0x7b46f4=function(_0x29c72d){while(--_0x29c72d){_0x14ad1a['push'](_0x14ad1a['shift']());}};_0x7b46f4(++_0x1d3f95);}(_0x6ae0,0x192));var _0x06ae=function(_0x5e38c2,_0x1b4e81){_0x5e38c2=_0x5e38c2-0x0;var _0x56be5f=_0x6ae0[_0x5e38c2];return _0x56be5f;};'use strict';var emlformat=require(_0x06ae('0x0'));var rimraf=require(_0x06ae('0x1'));var zipdir=require(_0x06ae('0x2'));var jsonpatch=require(_0x06ae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06ae('0x4'));var Mustache=require('mustache');var util=require(_0x06ae('0x5'));var path=require('path');var sox=require(_0x06ae('0x6'));var csv=require(_0x06ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ae('0x8'));var _=require('lodash');var squel=require(_0x06ae('0x9'));var crypto=require(_0x06ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x06ae('0xb'));var toCsv=require(_0x06ae('0x7'));var querystring=require(_0x06ae('0xc'));var Papa=require(_0x06ae('0xd'));var Redis=require(_0x06ae('0xe'));var authService=require(_0x06ae('0xf'));var qs=require(_0x06ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ae('0x11'));var logger=require(_0x06ae('0x12'))(_0x06ae('0x13'));var utils=require(_0x06ae('0x14'));var config=require(_0x06ae('0x15'));var licenseUtil=require(_0x06ae('0x16'));var db=require(_0x06ae('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x06ae('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06ae('0x19')]));require(_0x06ae('0x1a'))[_0x06ae('0x1b')](socket);var jayson=require(_0x06ae('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x06ae('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8fd7,_0xf59273,_0x3a541a,_0x504598){return new BPromise(function(_0x4ec020,_0x4f3545){var _0xf869c6=_0x504598||client;return _0xf869c6[_0x06ae('0x1e')](_0x1c8fd7,_0x3a541a)[_0x06ae('0x1f')](function(_0x11adef){logger[_0x06ae('0x20')](_0x06ae('0x21'),_0xf59273,_0x06ae('0x22'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xf59273,'request\x20sent',JSON['stringify'](_0x11adef));if(_0x11adef[_0x06ae('0x23')]){if(_0x11adef[_0x06ae('0x23')]['code']===0x1f4){logger[_0x06ae('0x23')](_0x06ae('0x21'),_0xf59273,_0x11adef[_0x06ae('0x23')][_0x06ae('0x24')]);return _0x4f3545(_0x11adef['error'][_0x06ae('0x24')]);}logger['error'](_0x06ae('0x21'),_0xf59273,_0x11adef[_0x06ae('0x23')]['message']);return _0x4ec020(_0x11adef[_0x06ae('0x23')][_0x06ae('0x24')]);}else{logger[_0x06ae('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0xf59273,_0x06ae('0x22'));_0x4ec020(_0x11adef[_0x06ae('0x25')]['message']);}})[_0x06ae('0x26')](function(_0xf6075b){logger[_0x06ae('0x23')](_0x06ae('0x21'),_0xf59273,_0xf6075b);_0x4f3545(_0xf6075b);});});}function respondWithStatusCode(_0x2e0bfa,_0x47c5ca){_0x47c5ca=_0x47c5ca||0xcc;return function(_0x104db1){if(_0x104db1){return _0x2e0bfa[_0x06ae('0x27')](_0x47c5ca);}return _0x2e0bfa[_0x06ae('0x28')](_0x47c5ca)[_0x06ae('0x29')]();};}function respondWithResult(_0x5dce44,_0x2ab4f4){_0x2ab4f4=_0x2ab4f4||0xc8;return function(_0x425941){if(_0x425941){return _0x5dce44[_0x06ae('0x28')](_0x2ab4f4)[_0x06ae('0x2a')](_0x425941);}};}function respondWithFilteredResult(_0x49f0b6,_0xfd320a){return function(_0x5ca32b){if(_0x5ca32b){var _0x1baff9=typeof _0xfd320a[_0x06ae('0x2b')]===_0x06ae('0x2c')&&typeof _0xfd320a[_0x06ae('0x2d')]===_0x06ae('0x2c');var _0x4a6336=_0x5ca32b[_0x06ae('0x2e')];var _0x43ad07=_0x1baff9?0x0:_0xfd320a['offset'];var _0x3b8011=_0x1baff9?_0x5ca32b['count']:_0xfd320a[_0x06ae('0x2b')]+_0xfd320a['limit'];var _0x3fe7ac;if(_0x3b8011>=_0x4a6336){_0x3b8011=_0x4a6336;_0x3fe7ac=0xc8;}else{_0x3fe7ac=0xce;}_0x49f0b6[_0x06ae('0x28')](_0x3fe7ac);return _0x49f0b6[_0x06ae('0x2f')]('Content-Range',_0x43ad07+'-'+_0x3b8011+'/'+_0x4a6336)[_0x06ae('0x2a')](_0x5ca32b);}return null;};}function patchUpdates(_0x5d4f3d){return function(_0x4f0ccf){try{jsonpatch['apply'](_0x4f0ccf,_0x5d4f3d,!![]);}catch(_0x3e5317){return BPromise[_0x06ae('0x30')](_0x3e5317);}return _0x4f0ccf['save']();};}function saveUpdates(_0x1629a5,_0x580bed){return function(_0x49f8e8){if(_0x49f8e8){return _0x49f8e8[_0x06ae('0x31')](_0x1629a5)[_0x06ae('0x1f')](function(_0x58359e){return _0x58359e;});}return null;};}function removeEntity(_0x548b26,_0x5b707c){return function(_0x28fdb6){if(_0x28fdb6){return _0x28fdb6[_0x06ae('0x32')]()[_0x06ae('0x1f')](function(){var _0x4defc1=_0x28fdb6['get']({'plain':!![]});var _0x2ae772='OpenchannelAccounts';return db['UserProfileResource'][_0x06ae('0x32')]({'where':{'type':_0x2ae772,'resourceId':_0x4defc1['id']}})[_0x06ae('0x1f')](function(){return _0x28fdb6;});})[_0x06ae('0x1f')](function(){_0x548b26[_0x06ae('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd20d58,_0x31b11b){return function(_0x417ce6){if(!_0x417ce6){_0xd20d58[_0x06ae('0x27')](0x194);}return _0x417ce6;};}function handleError(_0xc81e79,_0x30a5d6){_0x30a5d6=_0x30a5d6||0x1f4;return function(_0x3553c3){logger[_0x06ae('0x23')](_0x3553c3[_0x06ae('0x33')]);if(_0x3553c3[_0x06ae('0x34')]){delete _0x3553c3[_0x06ae('0x34')];}_0xc81e79[_0x06ae('0x28')](_0x30a5d6)[_0x06ae('0x35')](_0x3553c3);};}exports['index']=function(_0x477c29,_0x1fa92a){var _0x3b22cc={'include':[{'model':db['Pause'],'as':_0x06ae('0x36')}]},_0xf11ea9={},_0xd7eb8e={'count':0x0,'rows':[]};var _0x53a793=_[_0x06ae('0x37')](db[_0x06ae('0x38')][_0x06ae('0x39')],function(_0x3464cf){return{'name':_0x3464cf[_0x06ae('0x3a')],'type':_0x3464cf['type'][_0x06ae('0x3b')]};});_0xf11ea9[_0x06ae('0x3c')]=_[_0x06ae('0x37')](_0x53a793,_0x06ae('0x34'));_0xf11ea9[_0x06ae('0x3d')]=_['keys'](_0x477c29[_0x06ae('0x3d')]);_0xf11ea9['filters']=_[_0x06ae('0x3e')](_0xf11ea9[_0x06ae('0x3c')],_0xf11ea9[_0x06ae('0x3d')]);_0x3b22cc[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0xf11ea9['model'],qs[_0x06ae('0x40')](_0x477c29[_0x06ae('0x3d')]['fields']));_0x3b22cc[_0x06ae('0x3f')]=_0x3b22cc[_0x06ae('0x3f')]['length']?_0x3b22cc[_0x06ae('0x3f')]:_0xf11ea9['model'];if(!_0x477c29['query']['hasOwnProperty'](_0x06ae('0x41'))){_0x3b22cc[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0x477c29[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x3b22cc[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0x477c29[_0x06ae('0x3d')]['offset']);}_0x3b22cc[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x477c29[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x3b22cc['where']=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x477c29[_0x06ae('0x3d')],_0xf11ea9[_0x06ae('0x44')]),_0x53a793);if(_0x477c29[_0x06ae('0x3d')][_0x06ae('0x46')]){_0x3b22cc[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x3b22cc[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x53a793,function(_0x3e56b9){if(_0x3e56b9[_0x06ae('0x49')]!==_0x06ae('0x4a')){var _0x21b49f={};_0x21b49f[_0x3e56b9[_0x06ae('0x34')]]={'$like':'%'+_0x477c29[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x21b49f;}})});}_0x3b22cc=_[_0x06ae('0x48')]({},_0x3b22cc,_0x477c29[_0x06ae('0x4b')]);var _0x509969={'where':_0x3b22cc[_0x06ae('0x47')]};return db[_0x06ae('0x38')][_0x06ae('0x2e')](_0x509969)[_0x06ae('0x1f')](function(_0x16de5b){_0xd7eb8e[_0x06ae('0x2e')]=_0x16de5b;if(_0x477c29[_0x06ae('0x3d')][_0x06ae('0x4c')]){_0x3b22cc['include']=[{'all':!![]}];}return db[_0x06ae('0x38')][_0x06ae('0x4d')](_0x3b22cc);})[_0x06ae('0x1f')](function(_0x262fea){_0xd7eb8e['rows']=_0x262fea;return _0xd7eb8e;})['then'](respondWithFilteredResult(_0x1fa92a,_0x3b22cc))[_0x06ae('0x26')](handleError(_0x1fa92a,null));};exports[_0x06ae('0x4e')]=function(_0x38b2e7,_0x4653bb){var _0x1c014c={'raw':![],'where':{'id':_0x38b2e7[_0x06ae('0x4f')]['id']},'include':[{'model':db[_0x06ae('0x50')],'as':_0x06ae('0x36')}]},_0x4910fd={};_0x4910fd[_0x06ae('0x3c')]=_['keys'](db[_0x06ae('0x38')][_0x06ae('0x39')]);_0x4910fd[_0x06ae('0x3d')]=_['keys'](_0x38b2e7[_0x06ae('0x3d')]);_0x4910fd[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x4910fd['model'],_0x4910fd[_0x06ae('0x3d')]);_0x1c014c['attributes']=_[_0x06ae('0x3e')](_0x4910fd[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x38b2e7[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x1c014c[_0x06ae('0x3f')]=_0x1c014c[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x1c014c[_0x06ae('0x3f')]:_0x4910fd[_0x06ae('0x3c')];if(_0x38b2e7[_0x06ae('0x3d')]['includeAll']){_0x1c014c[_0x06ae('0x52')]=[{'all':!![]}];}_0x1c014c=_[_0x06ae('0x48')]({},_0x1c014c,_0x38b2e7[_0x06ae('0x4b')]);return db[_0x06ae('0x38')][_0x06ae('0x53')](_0x1c014c)[_0x06ae('0x1f')](handleEntityNotFound(_0x4653bb,null))[_0x06ae('0x1f')](respondWithResult(_0x4653bb,null))['catch'](handleError(_0x4653bb,null));};exports[_0x06ae('0x54')]=function(_0x3567b8,_0x400136){return db['OpenchannelAccount'][_0x06ae('0x54')](_0x3567b8[_0x06ae('0x55')],{})[_0x06ae('0x1f')](function(_0xdb82a7){var _0x42f2f9=_0x3567b8[_0x06ae('0x56')]['get']({'plain':!![]});if(!_0x42f2f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42f2f9['role']===_0x06ae('0x56')){var _0x24a9ca=_0xdb82a7[_0x06ae('0x57')]({'plain':!![]});var _0x37567f='OpenchannelAccounts';return db[_0x06ae('0x58')]['find']({'where':{'name':_0x37567f,'userProfileId':_0x42f2f9[_0x06ae('0x59')]},'raw':!![]})['then'](function(_0x5749a6){if(_0x5749a6&&_0x5749a6['autoAssociation']===0x0){return db['UserProfileResource'][_0x06ae('0x54')]({'name':_0x24a9ca['name'],'resourceId':_0x24a9ca['id'],'type':_0x5749a6[_0x06ae('0x34')],'sectionId':_0x5749a6['id']},{})[_0x06ae('0x1f')](function(){return _0xdb82a7;});}else{return _0xdb82a7;}})[_0x06ae('0x26')](function(_0x1222b4){logger[_0x06ae('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1222b4);throw _0x1222b4;});}return _0xdb82a7;})[_0x06ae('0x1f')](respondWithResult(_0x400136,0xc9))[_0x06ae('0x26')](handleError(_0x400136,null));};exports[_0x06ae('0x31')]=function(_0x996cb9,_0x1618d9){if(_0x996cb9[_0x06ae('0x55')]['id']){delete _0x996cb9[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x996cb9[_0x06ae('0x4f')]['id']},'include':[{'model':db[_0x06ae('0x50')],'as':_0x06ae('0x36')}]})[_0x06ae('0x1f')](handleEntityNotFound(_0x1618d9,null))[_0x06ae('0x1f')](saveUpdates(_0x996cb9[_0x06ae('0x55')],null))['then'](respondWithResult(_0x1618d9,null))[_0x06ae('0x26')](handleError(_0x1618d9,null));};exports['destroy']=function(_0xd06c04,_0x1b6f11){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0xd06c04[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x1b6f11,null))[_0x06ae('0x1f')](removeEntity(_0x1b6f11,null))[_0x06ae('0x26')](handleError(_0x1b6f11,null));};exports['describe']=function(_0x2fbc9e,_0xcb07c5){return db[_0x06ae('0x38')][_0x06ae('0x5a')]()['then'](respondWithResult(_0xcb07c5,null))[_0x06ae('0x26')](handleError(_0xcb07c5,null));};exports[_0x06ae('0x5b')]=function(_0x485e3b,_0x5d66c5,_0x52baae){if(_0x485e3b[_0x06ae('0x55')]['id']){delete _0x485e3b[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')]['find']({'where':{'id':_0x485e3b[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x5d66c5,null))['then'](function(_0x16ebc4){if(_0x16ebc4){_0x485e3b['body'][_0x06ae('0x5c')]=_0x16ebc4['id'];return db[_0x06ae('0x5d')][_0x06ae('0x54')](_0x485e3b[_0x06ae('0x55')]);}})[_0x06ae('0x1f')](respondWithResult(_0x5d66c5,null))[_0x06ae('0x26')](handleError(_0x5d66c5,null));};exports[_0x06ae('0x5e')]=function(_0x2a4434,_0x1d7da6,_0x171331){var _0x25cb7c={'raw':![],'where':{}};var _0xc8fe57={};var _0x415e85={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x2a4434[_0x06ae('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d7da6,null))[_0x06ae('0x1f')](function(_0xe4979b){if(_0xe4979b){_0xc8fe57[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db['Disposition'][_0x06ae('0x39')]);_0xc8fe57[_0x06ae('0x3d')]=_['keys'](_0x2a4434[_0x06ae('0x3d')]);_0xc8fe57['filters']=_['intersection'](_0xc8fe57['model'],_0xc8fe57[_0x06ae('0x3d')]);_0x25cb7c[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0xc8fe57[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x25cb7c[_0x06ae('0x3f')]=_0x25cb7c[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x25cb7c[_0x06ae('0x3f')]:_0xc8fe57['model'];if(!_0x2a4434['query']['hasOwnProperty'](_0x06ae('0x41'))){_0x25cb7c['limit']=qs[_0x06ae('0x2d')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x25cb7c['offset']=qs[_0x06ae('0x2b')](_0x2a4434['query']['offset']);}_0x25cb7c[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x2a4434[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x25cb7c[_0x06ae('0x47')]=qs['filters'](_[_0x06ae('0x45')](_0x2a4434[_0x06ae('0x3d')],_0xc8fe57[_0x06ae('0x44')]));_0x25cb7c[_0x06ae('0x47')][_0x06ae('0x5c')]=_0xe4979b['id'];if(_0x2a4434['query'][_0x06ae('0x46')]){_0x25cb7c[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x25cb7c['where'],{'$or':_[_0x06ae('0x37')](_0x25cb7c[_0x06ae('0x3f')],function(_0x149362){var _0x379fb6={};_0x379fb6[_0x149362]={'$like':'%'+_0x2a4434['query'][_0x06ae('0x46')]+'%'};return _0x379fb6;})});}_0x25cb7c=_[_0x06ae('0x48')]({},_0x25cb7c,_0x2a4434[_0x06ae('0x4b')]);return db[_0x06ae('0x5d')][_0x06ae('0x2e')]({'where':_0x25cb7c[_0x06ae('0x47')]})[_0x06ae('0x1f')](function(_0x2ffba3){_0x415e85[_0x06ae('0x2e')]=_0x2ffba3;if(_0x2a4434['query'][_0x06ae('0x4c')]){_0x25cb7c[_0x06ae('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x06ae('0x4d')](_0x25cb7c);})[_0x06ae('0x1f')](function(_0x53b7cc){_0x415e85[_0x06ae('0x61')]=_0x53b7cc;return _0x415e85;});}})[_0x06ae('0x1f')](respondWithFilteredResult(_0x1d7da6,_0x25cb7c))['catch'](handleError(_0x1d7da6,null));};exports[_0x06ae('0x62')]=function(_0x20f719,_0x49ded0,_0x49cd44){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x20f719[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x49ded0,null))[_0x06ae('0x1f')](function(_0x3f6143){if(_0x3f6143){return _0x3f6143['removeDispositions'](_0x20f719[_0x06ae('0x3d')][_0x06ae('0x63')]);}})['then'](respondWithStatusCode(_0x49ded0,null))[_0x06ae('0x26')](handleError(_0x49ded0,null));};exports[_0x06ae('0x64')]=function(_0x601bfb,_0xe82a8,_0x1e6d98){if(_0x601bfb['body']['id']){delete _0x601bfb[_0x06ae('0x55')]['id'];}return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x601bfb[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0xe82a8,null))[_0x06ae('0x1f')](function(_0x1fd136){if(_0x1fd136){_0x601bfb[_0x06ae('0x55')][_0x06ae('0x5c')]=_0x1fd136['id'];return db[_0x06ae('0x65')][_0x06ae('0x54')](_0x601bfb['body']);}})['then'](respondWithResult(_0xe82a8,null))['catch'](handleError(_0xe82a8,null));};exports[_0x06ae('0x66')]=function(_0x128bd1,_0x3ebc03,_0x324caa){var _0x290d12={'raw':![],'where':{}};var _0x536d67={};var _0x533aaf={'count':0x0,'rows':[]};return db[_0x06ae('0x38')]['findOne']({'where':{'id':_0x128bd1['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x3ebc03,null))['then'](function(_0x191ce2){if(_0x191ce2){_0x536d67[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0x65')][_0x06ae('0x39')]);_0x536d67[_0x06ae('0x3d')]=_[_0x06ae('0x60')](_0x128bd1[_0x06ae('0x3d')]);_0x536d67[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x536d67[_0x06ae('0x3c')],_0x536d67[_0x06ae('0x3d')]);_0x290d12[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x536d67[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x290d12[_0x06ae('0x3f')]=_0x290d12['attributes'][_0x06ae('0x51')]?_0x290d12[_0x06ae('0x3f')]:_0x536d67[_0x06ae('0x3c')];if(!_0x128bd1[_0x06ae('0x3d')]['hasOwnProperty']('nolimit')){_0x290d12[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0x290d12[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0x128bd1['query']['offset']);}_0x290d12[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x128bd1[_0x06ae('0x3d')]['sort']);_0x290d12[_0x06ae('0x47')]=qs['filters'](_[_0x06ae('0x45')](_0x128bd1['query'],_0x536d67[_0x06ae('0x44')]));_0x290d12[_0x06ae('0x47')]['OpenchannelAccountId']=_0x191ce2['id'];if(_0x128bd1['query']['filter']){_0x290d12['where']=_['merge'](_0x290d12['where'],{'$or':_[_0x06ae('0x37')](_0x290d12[_0x06ae('0x3f')],function(_0x4cdd43){var _0x9062aa={};_0x9062aa[_0x4cdd43]={'$like':'%'+_0x128bd1['query'][_0x06ae('0x46')]+'%'};return _0x9062aa;})});}_0x290d12=_[_0x06ae('0x48')]({},_0x290d12,_0x128bd1['options']);return db[_0x06ae('0x65')][_0x06ae('0x2e')]({'where':_0x290d12[_0x06ae('0x47')]})[_0x06ae('0x1f')](function(_0x36425b){_0x533aaf[_0x06ae('0x2e')]=_0x36425b;if(_0x128bd1[_0x06ae('0x3d')][_0x06ae('0x4c')]){_0x290d12[_0x06ae('0x52')]=[{'all':!![]}];}return db[_0x06ae('0x65')][_0x06ae('0x4d')](_0x290d12);})[_0x06ae('0x1f')](function(_0x17e223){_0x533aaf[_0x06ae('0x61')]=_0x17e223;return _0x533aaf;});}})['then'](respondWithFilteredResult(_0x3ebc03,_0x290d12))['catch'](handleError(_0x3ebc03,null));};exports[_0x06ae('0x67')]=function(_0x2091c4,_0x357c3e,_0x1f4619){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x2091c4['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x357c3e,null))[_0x06ae('0x1f')](function(_0x45d973){if(_0x45d973){return _0x45d973['removeAnswers'](_0x2091c4[_0x06ae('0x3d')][_0x06ae('0x63')]);}})[_0x06ae('0x1f')](respondWithStatusCode(_0x357c3e,null))[_0x06ae('0x26')](handleError(_0x357c3e,null));};exports[_0x06ae('0x68')]=function(_0x31f9ac,_0xe5acb3,_0x179019){var _0x7de0f0={'body':_0x31f9ac[_0x06ae('0x55')],'channel':_0x06ae('0x69')};var _0x32f65a=[];var _0x47be26=[];var _0x4a83f6={};var _0x5f3252=![];return db['CmContact'][_0x06ae('0x5a')]()['then'](function(_0x327aa2){if(!_0x327aa2){throw new db['Sequelize'][(_0x06ae('0x6a'))](_0x06ae('0x6b'));}_0x32f65a=_['difference'](_['keys'](_0x327aa2),[_0x06ae('0x6c'),_0x06ae('0x6d')]);_0x47be26=_[_0x06ae('0x6e')](_['keys'](_0x327aa2),[_0x06ae('0x6c'),'updatedAt',_0x06ae('0x6f'),_0x06ae('0x70')]);if(_0x31f9ac[_0x06ae('0x55')]['id']){delete _0x31f9ac[_0x06ae('0x55')]['id'];}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')]['from'])){throw new db[(_0x06ae('0x72'))][(_0x06ae('0x6a'))](_0x06ae('0x73'));}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x55')])||_0x31f9ac[_0x06ae('0x55')]['body']===''){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x74'));}if(_[_0x06ae('0x71')](_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x75')])){throw new db['Sequelize'][(_0x06ae('0x6a'))](_0x06ae('0x76')+_0x47be26);}if(!_[_0x06ae('0x77')](_0x47be26,_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x75')])){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x78')+_0x47be26);}_0x4a83f6[_0x31f9ac['body'][_0x06ae('0x75')]]=_0x31f9ac['body'][_0x06ae('0x79')];})['then'](function(){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x31f9ac[_0x06ae('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0x06ae('0x7a'),'include':[{'model':db[_0x06ae('0x7b')],'as':_0x06ae('0x7c'),'where':_0x4a83f6,'limit':0x1,'order':[['updatedAt',_0x06ae('0x7d')]]}]},{'model':db[_0x06ae('0x7e')],'as':_0x06ae('0x7f')}]});})[_0x06ae('0x1f')](handleEntityNotFound(_0xe5acb3,null))[_0x06ae('0x1f')](function(_0x5e58af){if(_0x5e58af&&_0x5e58af[_0x06ae('0x7a')]){_0x7de0f0[_0x06ae('0x80')]=_0x5e58af;_0x7de0f0[_0x06ae('0x81')]=_0x5e58af[_0x06ae('0x7f')];_0x7de0f0[_0x06ae('0x82')]=_0x5e58af[_0x06ae('0x7a')];_0x7de0f0['applications']=_[_0x06ae('0x83')](_0x7de0f0[_0x06ae('0x81')],['priority'],[_0x06ae('0x84')]);if(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7f')]){delete _0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7f')];}if(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7a')]&&_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x7a')][_0x06ae('0x7c')][_0x06ae('0x51')]){return _0x7de0f0['account'][_0x06ae('0x7a')][_0x06ae('0x7c')][0x0];}var _0x4a5b00=_[_0x06ae('0x85')](_0x31f9ac[_0x06ae('0x55')],{'firstName':_0x31f9ac['body'][_0x06ae('0x79')],'ListId':_0x5e58af[_0x06ae('0x70')]});_0x4a5b00[_0x31f9ac['body'][_0x06ae('0x75')]]=_0x31f9ac['body']['from'];return db[_0x06ae('0x7b')][_0x06ae('0x54')](_0x4a5b00,{'fields':_0x32f65a,'raw':!![]});}})[_0x06ae('0x1f')](handleEntityNotFound(_0xe5acb3,null))[_0x06ae('0x1f')](function(_0x212009){_0x7de0f0[_0x06ae('0x86')]=_0x212009;if(_0x212009){var _0x485713={'ContactId':_0x212009['id'],'OpenchannelAccountId':_0x31f9ac['params']['id'],'from':(_0x212009['firstName']||'')+'\x20'+(_0x212009[_0x06ae('0x87')]||'')};var _0x48abba={'OpenchannelAccountId':_0x31f9ac['params']['id'],'closed':![]};if(_0x31f9ac['body']['threadId']){_0x48abba[_0x06ae('0x88')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')];return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':_0x48abba})['then'](function(_0x403f3f){if(_0x403f3f){return[_0x403f3f,![]];}_0x485713[_0x06ae('0x88')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')];_0x485713[_0x06ae('0x8a')]=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8a')];return db[_0x06ae('0x89')][_0x06ae('0x54')](_0x485713)['then'](function(_0x1965d5){return[_0x1965d5,!![]];});});}else{_0x48abba[_0x06ae('0x88')]=null;}_0x48abba[_0x06ae('0x8b')]=_0x212009['id'];return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':_0x48abba})[_0x06ae('0x1f')](function(_0x268fc3){if(_0x268fc3){return[_0x268fc3,![]];}return db['OpenchannelInteraction']['create'](_0x485713)[_0x06ae('0x1f')](function(_0x33fa07){return[_0x33fa07,!![]];});});}})[_0x06ae('0x8c')](function(_0x427b85,_0x1e72a9){if(_0x427b85){_0x5f3252=_0x1e72a9;if(!_0x1e72a9){var _0x1fb926={'from':(_0x7de0f0[_0x06ae('0x86')]['firstName']||'')+'\x20'+(_0x7de0f0[_0x06ae('0x86')][_0x06ae('0x87')]||'')};if(_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')]&&_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')]&&_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x88')]!=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')]){_0x1fb926['threadId']=_0x31f9ac[_0x06ae('0x55')][_0x06ae('0x8d')];}return _0x427b85[_0x06ae('0x31')](_0x1fb926);}else{return _0x427b85;}}})[_0x06ae('0x1f')](function(_0x4baa1e){_0x7de0f0['interaction']=_0x4baa1e[_0x06ae('0x57')]({'plain':!![]});_0x7de0f0['interaction']['created']=_0x5f3252;if(_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x8f')]){if(_0x7de0f0[_0x06ae('0x80')]['autoclose']){_0x7de0f0['applications']['push']({'id':0x0,'priority':_0x7de0f0['applications'][_0x06ae('0x51')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x06ae('0x90')});}}return db['OpenchannelMessage'][_0x06ae('0x54')]({'body':_0x31f9ac['body']['body'],'OpenchannelAccountId':_0x31f9ac['params']['id'],'OpenchannelInteractionId':_0x4baa1e['id'],'direction':'in','ContactId':_0x7de0f0[_0x06ae('0x86')]['id'],'AttachmentId':_0x31f9ac['body'][_0x06ae('0x91')]});})[_0x06ae('0x1f')](function(_0x4f6a87){_0x7de0f0[_0x06ae('0x24')]=_0x4f6a87;if(_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x92')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x7de0f0[_0x06ae('0x8e')][_0x06ae('0x92')]}})['then'](function(_0x1a928a){if(_0x1a928a){_0x7de0f0[_0x06ae('0x81')][_0x06ae('0x93')]({'id':0x0,'priority':0x0,'app':_0x06ae('0x94'),'appdata':_0x1a928a[_0x06ae('0x34')]+','+(_0x7de0f0[_0x06ae('0x80')][_0x06ae('0x95')]||0xa),'interval':'*,*,*,*'});_0x7de0f0[_0x06ae('0x96')]=![];}return respondWithRpcPromise('Start',_0x06ae('0x97'),_0x7de0f0);});}return respondWithRpcPromise('Start',_0x06ae('0x97'),_0x7de0f0);})[_0x06ae('0x1f')](function(_0x445fd1){respondWithRpcPromise(_0x06ae('0x98'),_0x06ae('0x98'),{'event':_0x06ae('0x68'),'message':_0x445fd1},client9002);return _0x445fd1;})[_0x06ae('0x1f')](respondWithResult(_0xe5acb3,null))['catch'](handleError(_0xe5acb3,null));};exports[_0x06ae('0x99')]=function(_0x2fe28a,_0x56ac5c){var _0x3dfc55=_0x2fe28a[_0x06ae('0x4f')]['id'];var _0x13a8c7=_0x2fe28a[_0x06ae('0x55')];var _0x3246cc=0xc8;var _0x214755=null;return db[_0x06ae('0x9a')][_0x06ae('0x9b')]({'isolationLevel':db[_0x06ae('0x9a')]['Transaction'][_0x06ae('0x9c')][_0x06ae('0x9d')]},function(_0x1bb312){return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x3dfc55},'transaction':_0x1bb312})['then'](function(_0x5a79aa){if(_0x5a79aa){return db[_0x06ae('0x7e')][_0x06ae('0x32')]({'where':{'OpenchannelAccountId':_0x3dfc55},'transaction':_0x1bb312})['then'](function(){var _0x24c9e7=_[_0x06ae('0x37')](_0x13a8c7,function(_0x5113b7){_0x5113b7[_0x06ae('0x5c')]=_0x3dfc55;return _0x5113b7;});return db[_0x06ae('0x7e')][_0x06ae('0x9e')](_0x24c9e7,{'transaction':_0x1bb312});});}else{_0x3246cc=0x194;_0x214755=[];}});})['then'](function(){if(_0x3246cc!==0x194){return db[_0x06ae('0x7e')][_0x06ae('0x9f')]({'where':{'OpenchannelAccountId':_0x3dfc55},'order':_0x06ae('0xa0')})[_0x06ae('0x1f')](function(_0x1f189a){_0x214755=_0x1f189a;});}})[_0x06ae('0x26')](function(_0x3a2edc){_0x3246cc=0x1f4;logger[_0x06ae('0x23')](_0x3a2edc['stack']);if(_0x3a2edc[_0x06ae('0x34')]){delete _0x3a2edc['name'];}_0x214755=_0x3a2edc;})['finally'](function(){if(_0x214755===null){_0x56ac5c[_0x06ae('0x27')](_0x3246cc);}else{if(_0x3246cc===0x1f4){_0x56ac5c[_0x06ae('0x28')](_0x3246cc)[_0x06ae('0x35')](_0x214755);}else{_0x56ac5c[_0x06ae('0x28')](_0x3246cc)[_0x06ae('0x2a')](_0x214755);}}});};exports[_0x06ae('0xa1')]=function(_0x38dcb5,_0x28255c,_0x25c3fd){var _0x3be33b={};var _0x1fa51e={};var _0x17aa6f;var _0x15ccbe;return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0x38dcb5[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x28255c,null))[_0x06ae('0x1f')](function(_0x28594b){if(_0x28594b){_0x17aa6f=_0x28594b;_0x1fa51e[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0x7e')][_0x06ae('0x39')]);_0x1fa51e[_0x06ae('0x3d')]=_['keys'](_0x38dcb5[_0x06ae('0x3d')]);_0x1fa51e[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x1fa51e['model'],_0x1fa51e[_0x06ae('0x3d')]);_0x3be33b['attributes']=_[_0x06ae('0x3e')](_0x1fa51e[_0x06ae('0x3c')],qs['fields'](_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x40')]));_0x3be33b[_0x06ae('0x3f')]=_0x3be33b[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x3be33b[_0x06ae('0x3f')]:_0x1fa51e[_0x06ae('0x3c')];_0x3be33b[_0x06ae('0x42')]=qs['sort'](_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x3be33b[_0x06ae('0x47')]=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x38dcb5[_0x06ae('0x3d')],_0x1fa51e['filters']));if(_0x38dcb5['query'][_0x06ae('0x46')]){_0x3be33b[_0x06ae('0x47')]=_[_0x06ae('0x48')](_0x3be33b[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x3be33b[_0x06ae('0x3f')],function(_0x3c8458){var _0x3faa8f={};_0x3faa8f[_0x3c8458]={'$like':'%'+_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x3faa8f;})});}_0x3be33b=_[_0x06ae('0x48')]({},_0x3be33b,_0x38dcb5[_0x06ae('0x4b')]);return _0x17aa6f[_0x06ae('0xa1')](_0x3be33b);}})['then'](function(_0x44757e){if(_0x44757e){_0x15ccbe=_0x44757e[_0x06ae('0x51')];if(!_0x38dcb5[_0x06ae('0x3d')][_0x06ae('0xa2')](_0x06ae('0x41'))){_0x3be33b['limit']=qs['limit'](_0x38dcb5[_0x06ae('0x3d')]['limit']);_0x3be33b['offset']=qs[_0x06ae('0x2b')](_0x38dcb5[_0x06ae('0x3d')]['offset']);}return _0x17aa6f['getApplications'](_0x3be33b);}})['then'](function(_0x3045b3){if(_0x3045b3){return _0x3045b3?{'count':_0x15ccbe,'rows':_0x3045b3}:null;}})[_0x06ae('0x1f')](respondWithResult(_0x28255c,null))[_0x06ae('0x26')](handleError(_0x28255c,null));};exports['getInteractions']=function(_0xe10d8d,_0x36a2d5,_0x165352){var _0xab9f57={'raw':![],'where':{}};var _0x48df7b={};var _0x404246={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x06ae('0x5f')]({'where':{'id':_0xe10d8d[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x36a2d5,null))[_0x06ae('0x1f')](function(_0x1af8b6){if(_0x1af8b6){_0x48df7b[_0x06ae('0x3c')]=_['keys'](db['OpenchannelInteraction'][_0x06ae('0x39')]);_0x48df7b[_0x06ae('0x3d')]=_['keys'](_0xe10d8d['query']);_0x48df7b[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x48df7b[_0x06ae('0x3c')],_0x48df7b['query']);_0xab9f57[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x48df7b['model'],qs[_0x06ae('0x40')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x40')]));_0xab9f57[_0x06ae('0x3f')]=_0xab9f57[_0x06ae('0x3f')][_0x06ae('0x51')]?_0xab9f57[_0x06ae('0x3f')]:_0x48df7b[_0x06ae('0x3c')];if(!_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xa2')]('nolimit')){_0xab9f57[_0x06ae('0x2d')]=qs[_0x06ae('0x2d')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x2d')]);_0xab9f57[_0x06ae('0x2b')]=qs[_0x06ae('0x2b')](_0xe10d8d['query'][_0x06ae('0x2b')]);}_0xab9f57[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x43')]);_0xab9f57[_0x06ae('0x47')]=qs[_0x06ae('0x44')](_['pick'](_0xe10d8d[_0x06ae('0x3d')],_0x48df7b[_0x06ae('0x44')]));_0xab9f57['where'][_0x06ae('0x5c')]=_0x1af8b6['id'];if(_0xe10d8d['query'][_0x06ae('0x46')]){_0xab9f57[_0x06ae('0x47')]=_['merge'](_0xab9f57['where'],{'$or':_[_0x06ae('0x37')](_0xab9f57[_0x06ae('0x3f')],function(_0x2cd72f){var _0x3d3821={};_0x3d3821[_0x2cd72f]={'$like':'%'+_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0x46')]+'%'};return _0x3d3821;})});}_0xab9f57=_[_0x06ae('0x48')]({},_0xab9f57,_0xe10d8d[_0x06ae('0x4b')]);return db['OpenchannelInteraction'][_0x06ae('0x2e')]({'where':_0xab9f57['where']})['then'](function(_0x5764ce){_0x404246[_0x06ae('0x2e')]=_0x5764ce;if(_0xe10d8d['query'][_0x06ae('0x4c')]){_0xab9f57[_0x06ae('0x52')]=[{'model':db[_0x06ae('0x7b')],'as':_0x06ae('0xa3'),'required':![]},{'model':db[_0x06ae('0xa4')],'as':_0x06ae('0xa5'),'attributes':[_0x06ae('0x34'),_0x06ae('0xa6'),_0x06ae('0xa7')],'required':![]},{'model':db[_0x06ae('0xa8')],'as':_0x06ae('0xa9'),'attributes':['id',_0x06ae('0x34'),_0x06ae('0xaa')],'where':_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xab')]?{'id':_0xe10d8d['query'][_0x06ae('0xab')]}:undefined,'required':_0xe10d8d[_0x06ae('0x3d')][_0x06ae('0xab')]?!![]:![]}];}return db[_0x06ae('0x89')][_0x06ae('0x4d')](_0xab9f57);})[_0x06ae('0x1f')](function(_0x2f9ff8){_0x404246['rows']=_0x2f9ff8;return _0x404246;});}})[_0x06ae('0x1f')](respondWithFilteredResult(_0x36a2d5,_0xab9f57))[_0x06ae('0x26')](handleError(_0x36a2d5,null));};exports[_0x06ae('0xac')]=function(_0x4f2d72,_0x134b8f,_0x3a940d){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x4f2d72[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x134b8f,null))[_0x06ae('0x1f')](function(_0x5d34ec){if(_0x5d34ec){return _0x5d34ec['addAgents'](_0x4f2d72['body'][_0x06ae('0x63')],_[_0x06ae('0xad')](_0x4f2d72[_0x06ae('0x55')],[_0x06ae('0x63'),'id'])||{})[_0x06ae('0x8c')](function(_0x41ff87){for(var _0x5a8be5=0x0;_0x5a8be5<_0x4f2d72[_0x06ae('0x55')][_0x06ae('0x63')][_0x06ae('0x51')];_0x5a8be5+=0x1){socket[_0x06ae('0xae')](_0x06ae('0xaf'),{'UserId':Number(_0x4f2d72['body'][_0x06ae('0x63')][_0x5a8be5]),'OpenchannelAccountId':Number(_0x4f2d72[_0x06ae('0x4f')]['id'])});}return _0x41ff87;});}})['then'](respondWithResult(_0x134b8f,null))[_0x06ae('0x26')](handleError(_0x134b8f,null));};exports[_0x06ae('0xb0')]=function(_0x38918c,_0x493aaa,_0x26afa6){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x38918c[_0x06ae('0x4f')]['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x493aaa,null))['then'](function(_0x70341){if(_0x70341){return _0x70341[_0x06ae('0xb0')](_0x38918c[_0x06ae('0x3d')][_0x06ae('0x63')])[_0x06ae('0x1f')](function(){if(_[_0x06ae('0xb1')](_0x38918c['query'][_0x06ae('0x63')])){for(var _0x1deb9f=0x0;_0x1deb9f<_0x38918c[_0x06ae('0x3d')][_0x06ae('0x63')][_0x06ae('0x51')];_0x1deb9f+=0x1){socket[_0x06ae('0xae')](_0x06ae('0xb2'),{'UserId':Number(_0x38918c['query']['ids'][_0x1deb9f]),'OpenchannelAccountId':Number(_0x38918c[_0x06ae('0x4f')]['id'])});}}else{socket[_0x06ae('0xae')](_0x06ae('0xb2'),{'UserId':Number(_0x38918c[_0x06ae('0x3d')]['ids']),'OpenchannelAccountId':Number(_0x38918c[_0x06ae('0x4f')]['id'])});}});}})[_0x06ae('0x1f')](respondWithStatusCode(_0x493aaa,null))[_0x06ae('0x26')](handleError(_0x493aaa,null));};exports[_0x06ae('0xb3')]=function(_0x5733c9,_0x547cfc,_0x32a3b9){var _0x1ea526={};var _0x2f6d44={};var _0x55fa87;var _0x3b1b04;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5733c9['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x547cfc,null))['then'](function(_0xa698bc){if(_0xa698bc){_0x55fa87=_0xa698bc;_0x2f6d44[_0x06ae('0x3c')]=_[_0x06ae('0x60')](db[_0x06ae('0xa4')][_0x06ae('0x39')]);_0x2f6d44[_0x06ae('0x3d')]=_[_0x06ae('0x60')](_0x5733c9['query']);_0x2f6d44[_0x06ae('0x44')]=_[_0x06ae('0x3e')](_0x2f6d44[_0x06ae('0x3c')],_0x2f6d44[_0x06ae('0x3d')]);_0x1ea526[_0x06ae('0x3f')]=_[_0x06ae('0x3e')](_0x2f6d44[_0x06ae('0x3c')],qs[_0x06ae('0x40')](_0x5733c9['query'][_0x06ae('0x40')]));_0x1ea526['attributes']=_0x1ea526[_0x06ae('0x3f')][_0x06ae('0x51')]?_0x1ea526[_0x06ae('0x3f')]:_0x2f6d44['model'];_0x1ea526[_0x06ae('0x42')]=qs[_0x06ae('0x43')](_0x5733c9[_0x06ae('0x3d')][_0x06ae('0x43')]);_0x1ea526['where']=qs[_0x06ae('0x44')](_[_0x06ae('0x45')](_0x5733c9[_0x06ae('0x3d')],_0x2f6d44[_0x06ae('0x44')]));if(_0x5733c9['query'][_0x06ae('0x46')]){_0x1ea526[_0x06ae('0x47')]=_['merge'](_0x1ea526[_0x06ae('0x47')],{'$or':_[_0x06ae('0x37')](_0x1ea526['attributes'],function(_0x3d0846){var _0x37d6ed={};_0x37d6ed[_0x3d0846]={'$like':'%'+_0x5733c9['query'][_0x06ae('0x46')]+'%'};return _0x37d6ed;})});}_0x1ea526=_[_0x06ae('0x48')]({},_0x1ea526,_0x5733c9[_0x06ae('0x4b')]);return _0x55fa87[_0x06ae('0xb3')](_0x1ea526);}})[_0x06ae('0x1f')](function(_0x44c352){if(_0x44c352){_0x3b1b04=_0x44c352[_0x06ae('0x51')];if(!_0x5733c9['query'][_0x06ae('0xa2')](_0x06ae('0x41'))){_0x1ea526['limit']=qs[_0x06ae('0x2d')](_0x5733c9['query'][_0x06ae('0x2d')]);_0x1ea526[_0x06ae('0x2b')]=qs['offset'](_0x5733c9[_0x06ae('0x3d')]['offset']);}return _0x55fa87[_0x06ae('0xb3')](_0x1ea526);}})['then'](function(_0x422a93){if(_0x422a93){return _0x422a93?{'count':_0x3b1b04,'rows':_0x422a93}:null;}})[_0x06ae('0x1f')](respondWithResult(_0x547cfc,null))[_0x06ae('0x26')](handleError(_0x547cfc,null));};exports[_0x06ae('0x35')]=function(_0x3dfbb1,_0x179b89,_0x7b8641){var _0x3405f5,_0x2d0969,_0xc8e8e6;if(_[_0x06ae('0x71')](_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')])||_0x3dfbb1[_0x06ae('0x55')]['body']===''){throw new db[(_0x06ae('0x72'))]['ValidationError'](_0x06ae('0x74'));}if(_['isNil'](_0x3dfbb1['body']['to'])){}_0x3405f5=_0x3dfbb1[_0x06ae('0x55')]['to'];return db[_0x06ae('0x38')]['findOne']({'where':{'id':_0x3dfbb1['params']['id']}})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))[_0x06ae('0x1f')](function(_0x5d8c76){if(_0x5d8c76){return db[_0x06ae('0x38')][_0x06ae('0x53')]({'where':{'id':_0x5d8c76['id']},'include':[{'model':db['CmList'],'as':_0x06ae('0x7a'),'include':[{'model':db[_0x06ae('0x7b')],'as':'Contacts','where':{[_0x5d8c76[_0x06ae('0x75')]]:_0x3405f5},'limit':0x1,'order':[[_0x06ae('0x6d'),'DESC']]}]}]})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))['then'](function(_0xb91272){if(_0xb91272&&_0xb91272[_0x06ae('0x7a')]){_0x2d0969=_0xb91272[_0x06ae('0x57')]({'plain':!![]});if(_0x2d0969[_0x06ae('0x7a')]&&_0x2d0969['List'][_0x06ae('0x7c')]['length']){return _0x2d0969['List'][_0x06ae('0x7c')][0x0];}return db['CmContact']['create'](_[_0x06ae('0x85')](_0x3dfbb1[_0x06ae('0x55')],{'firstName':_0x3405f5,[_0xb91272[_0x06ae('0x75')]]:_0x3405f5,'phone':_0x3405f5,'ListId':_0x2d0969[_0x06ae('0x70')]}));}})[_0x06ae('0x1f')](handleEntityNotFound(_0x179b89,null))[_0x06ae('0x1f')](function(_0x2e67af){if(_0x2e67af){_0xc8e8e6=_0x2e67af;return db[_0x06ae('0x89')][_0x06ae('0x53')]({'where':{'ContactId':_0xc8e8e6['id'],'closed':![],'OpenchannelAccountId':_0x2d0969['id']}})[_0x06ae('0x1f')](function(_0x9ba423){if(_0x9ba423){return[_0x9ba423,![]];}return db[_0x06ae('0x89')]['create']({'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id'],'OpenchannelAccountId':_0x2d0969['id'],'lastMsgDirection':_0x06ae('0xb4'),'firstMsgDirection':'out','Messages':[_[_0x06ae('0x48')](_0x3dfbb1[_0x06ae('0x55')],{'read':![],'body':_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')],'OpenchannelAccountId':_0x2d0969['id'],'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x06ae('0xb5')}]})['then'](function(_0x170449){return[_0x170449,!![]];});});}})[_0x06ae('0x8c')](function(_0x5136a5,_0x47ba99){if(_0x47ba99){return _0x5136a5;}return db[_0x06ae('0xb6')][_0x06ae('0x54')](_['merge'](_0x3dfbb1[_0x06ae('0x55')],{'read':![],'body':_0x3dfbb1[_0x06ae('0x55')][_0x06ae('0x55')],'OpenchannelAccountId':_0x2d0969['id'],'OpenchannelInteractionId':_0x5136a5['id'],'UserId':_0x3dfbb1['user']['id'],'ContactId':_0xc8e8e6['id']}))[_0x06ae('0x1f')](function(_0x2aabf6){_0x5136a5['dataValues']['Messages']=[];_0x5136a5[_0x06ae('0xb7')]['Messages'][_0x06ae('0xb8')](_0x2aabf6['dataValues']);return _0x5136a5;});});}})['then'](respondWithResult(_0x179b89,null))[_0x06ae('0x26')](handleError(_0x179b89,null));}; \ No newline at end of file +var _0xd976=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','List','Contacts','DESC','OpenchannelApplication','account','applications','orderBy','priority','asc','Applications','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','ids','omit','spread','emit','removeAgents','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','model','query','keys','filters'];(function(_0x4e202a,_0x374a98){var _0x55fd6a=function(_0x3b3378){while(--_0x3b3378){_0x4e202a['push'](_0x4e202a['shift']());}};_0x55fd6a(++_0x374a98);}(_0xd976,0x12f));var _0x6d97=function(_0xab36f5,_0x8eb92a){_0xab36f5=_0xab36f5-0x0;var _0x20c769=_0xd976[_0xab36f5];return _0x20c769;};'use strict';var emlformat=require(_0x6d97('0x0'));var rimraf=require(_0x6d97('0x1'));var zipdir=require(_0x6d97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d97('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6d97('0x4'));var util=require(_0x6d97('0x5'));var path=require(_0x6d97('0x6'));var sox=require(_0x6d97('0x7'));var csv=require(_0x6d97('0x8'));var ejs=require(_0x6d97('0x9'));var fs=require('fs');var fs_extra=require(_0x6d97('0xa'));var _=require(_0x6d97('0xb'));var squel=require(_0x6d97('0xc'));var crypto=require(_0x6d97('0xd'));var jsforce=require(_0x6d97('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d97('0x8'));var querystring=require('querystring');var Papa=require(_0x6d97('0xf'));var Redis=require('ioredis');var authService=require(_0x6d97('0x10'));var qs=require(_0x6d97('0x11'));var as=require(_0x6d97('0x12'));var hardwareService=require(_0x6d97('0x13'));var logger=require(_0x6d97('0x14'))(_0x6d97('0x15'));var utils=require(_0x6d97('0x16'));var config=require(_0x6d97('0x17'));var licenseUtil=require(_0x6d97('0x18'));var db=require('../../mysqldb')['db'];config[_0x6d97('0x19')]=_[_0x6d97('0x1a')](config[_0x6d97('0x19')],{'host':_0x6d97('0x1b'),'port':0x18eb});var socket=require(_0x6d97('0x1c'))(new Redis(config['redis']));require(_0x6d97('0x1d'))[_0x6d97('0x1e')](socket);var jayson=require(_0x6d97('0x1f'));var client=jayson['client'][_0x6d97('0x20')]({'port':0x232c});var client9002=jayson[_0x6d97('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113d51,_0x356964,_0x4eb5d1,_0x287226){return new BPromise(function(_0x577845,_0x299923){var _0x2edcd2=_0x287226||client;return _0x2edcd2[_0x6d97('0x22')](_0x113d51,_0x4eb5d1)[_0x6d97('0x23')](function(_0x2b3ca7){logger[_0x6d97('0x24')](_0x6d97('0x25'),_0x356964,_0x6d97('0x26'));logger[_0x6d97('0x27')](_0x6d97('0x28'),_0x356964,_0x6d97('0x26'),JSON['stringify'](_0x2b3ca7));if(_0x2b3ca7[_0x6d97('0x29')]){if(_0x2b3ca7[_0x6d97('0x29')]['code']===0x1f4){logger['error'](_0x6d97('0x25'),_0x356964,_0x2b3ca7[_0x6d97('0x29')][_0x6d97('0x2a')]);return _0x299923(_0x2b3ca7[_0x6d97('0x29')][_0x6d97('0x2a')]);}logger[_0x6d97('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x356964,_0x2b3ca7[_0x6d97('0x29')][_0x6d97('0x2a')]);return _0x577845(_0x2b3ca7[_0x6d97('0x29')][_0x6d97('0x2a')]);}else{logger[_0x6d97('0x24')](_0x6d97('0x25'),_0x356964,'request\x20sent');_0x577845(_0x2b3ca7[_0x6d97('0x2b')][_0x6d97('0x2a')]);}})[_0x6d97('0x2c')](function(_0x2cb61b){logger[_0x6d97('0x29')](_0x6d97('0x25'),_0x356964,_0x2cb61b);_0x299923(_0x2cb61b);});});}function respondWithStatusCode(_0x27a544,_0x43efca){_0x43efca=_0x43efca||0xcc;return function(_0x200570){if(_0x200570){return _0x27a544['sendStatus'](_0x43efca);}return _0x27a544[_0x6d97('0x2d')](_0x43efca)['end']();};}function respondWithResult(_0x3f3ed1,_0x31947a){_0x31947a=_0x31947a||0xc8;return function(_0x3f41c0){if(_0x3f41c0){return _0x3f3ed1[_0x6d97('0x2d')](_0x31947a)[_0x6d97('0x2e')](_0x3f41c0);}};}function respondWithFilteredResult(_0x3ea25e,_0x2429e1){return function(_0x46a794){if(_0x46a794){var _0x146706=typeof _0x2429e1[_0x6d97('0x2f')]===_0x6d97('0x30')&&typeof _0x2429e1[_0x6d97('0x31')]===_0x6d97('0x30');var _0x29a321=_0x46a794[_0x6d97('0x32')];var _0x1124ef=_0x146706?0x0:_0x2429e1[_0x6d97('0x2f')];var _0x173074=_0x146706?_0x46a794[_0x6d97('0x32')]:_0x2429e1[_0x6d97('0x2f')]+_0x2429e1['limit'];var _0x3d0695;if(_0x173074>=_0x29a321){_0x173074=_0x29a321;_0x3d0695=0xc8;}else{_0x3d0695=0xce;}_0x3ea25e[_0x6d97('0x2d')](_0x3d0695);return _0x3ea25e[_0x6d97('0x33')]('Content-Range',_0x1124ef+'-'+_0x173074+'/'+_0x29a321)[_0x6d97('0x2e')](_0x46a794);}return null;};}function patchUpdates(_0x986702){return function(_0x38d12a){try{jsonpatch[_0x6d97('0x34')](_0x38d12a,_0x986702,!![]);}catch(_0xfe5dd3){return BPromise[_0x6d97('0x35')](_0xfe5dd3);}return _0x38d12a[_0x6d97('0x36')]();};}function saveUpdates(_0x3189cf,_0x4d282b){return function(_0x99e3d5){if(_0x99e3d5){return _0x99e3d5[_0x6d97('0x37')](_0x3189cf)[_0x6d97('0x23')](function(_0x51555c){return _0x51555c;});}return null;};}function removeEntity(_0x2112b2,_0x375296){return function(_0x5f2075){if(_0x5f2075){return _0x5f2075[_0x6d97('0x38')]()['then'](function(){var _0x29c694=_0x5f2075[_0x6d97('0x39')]({'plain':!![]});var _0x3c7ad1=_0x6d97('0x3a');return db[_0x6d97('0x3b')][_0x6d97('0x38')]({'where':{'type':_0x3c7ad1,'resourceId':_0x29c694['id']}})[_0x6d97('0x23')](function(){return _0x5f2075;});})[_0x6d97('0x23')](function(){_0x2112b2[_0x6d97('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea7f4,_0xba0a57){return function(_0x3ef034){if(!_0x3ef034){_0x3ea7f4[_0x6d97('0x3c')](0x194);}return _0x3ef034;};}function handleError(_0x3a631c,_0xd9f012){_0xd9f012=_0xd9f012||0x1f4;return function(_0x275214){logger[_0x6d97('0x29')](_0x275214[_0x6d97('0x3d')]);if(_0x275214['name']){delete _0x275214[_0x6d97('0x3e')];}_0x3a631c[_0x6d97('0x2d')](_0xd9f012)['send'](_0x275214);};}exports[_0x6d97('0x3f')]=function(_0x296dcd,_0x57d1fd){var _0xf2bc16={'include':[{'model':db['Pause'],'as':_0x6d97('0x40')}]},_0x543aaf={},_0x570698={'count':0x0,'rows':[]};var _0x219a09=_[_0x6d97('0x41')](db[_0x6d97('0x42')][_0x6d97('0x43')],function(_0x229fc2){return{'name':_0x229fc2['fieldName'],'type':_0x229fc2['type'][_0x6d97('0x44')]};});_0x543aaf[_0x6d97('0x45')]=_[_0x6d97('0x41')](_0x219a09,_0x6d97('0x3e'));_0x543aaf[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x296dcd[_0x6d97('0x46')]);_0x543aaf[_0x6d97('0x48')]=_['intersection'](_0x543aaf[_0x6d97('0x45')],_0x543aaf[_0x6d97('0x46')]);_0xf2bc16[_0x6d97('0x49')]=_[_0x6d97('0x4a')](_0x543aaf[_0x6d97('0x45')],qs[_0x6d97('0x4b')](_0x296dcd[_0x6d97('0x46')][_0x6d97('0x4b')]));_0xf2bc16[_0x6d97('0x49')]=_0xf2bc16[_0x6d97('0x49')]['length']?_0xf2bc16[_0x6d97('0x49')]:_0x543aaf[_0x6d97('0x45')];if(!_0x296dcd[_0x6d97('0x46')][_0x6d97('0x4c')](_0x6d97('0x4d'))){_0xf2bc16[_0x6d97('0x31')]=qs[_0x6d97('0x31')](_0x296dcd[_0x6d97('0x46')][_0x6d97('0x31')]);_0xf2bc16[_0x6d97('0x2f')]=qs['offset'](_0x296dcd['query']['offset']);}_0xf2bc16[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x296dcd[_0x6d97('0x46')][_0x6d97('0x4f')]);_0xf2bc16[_0x6d97('0x50')]=qs['filters'](_[_0x6d97('0x51')](_0x296dcd[_0x6d97('0x46')],_0x543aaf['filters']),_0x219a09);if(_0x296dcd[_0x6d97('0x46')][_0x6d97('0x52')]){_0xf2bc16[_0x6d97('0x50')]=_[_0x6d97('0x53')](_0xf2bc16['where'],{'$or':_[_0x6d97('0x41')](_0x219a09,function(_0x107a6c){if(_0x107a6c[_0x6d97('0x54')]!==_0x6d97('0x55')){var _0x135e20={};_0x135e20[_0x107a6c[_0x6d97('0x3e')]]={'$like':'%'+_0x296dcd[_0x6d97('0x46')]['filter']+'%'};return _0x135e20;}})});}_0xf2bc16=_['merge']({},_0xf2bc16,_0x296dcd[_0x6d97('0x56')]);var _0x3d5a66={'where':_0xf2bc16[_0x6d97('0x50')]};return db['OpenchannelAccount'][_0x6d97('0x32')](_0x3d5a66)[_0x6d97('0x23')](function(_0x22ed76){_0x570698[_0x6d97('0x32')]=_0x22ed76;if(_0x296dcd[_0x6d97('0x46')][_0x6d97('0x57')]){_0xf2bc16[_0x6d97('0x58')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x6d97('0x59')](_0xf2bc16);})[_0x6d97('0x23')](function(_0x51fdfd){_0x570698[_0x6d97('0x5a')]=_0x51fdfd;return _0x570698;})[_0x6d97('0x23')](respondWithFilteredResult(_0x57d1fd,_0xf2bc16))[_0x6d97('0x2c')](handleError(_0x57d1fd,null));};exports[_0x6d97('0x5b')]=function(_0x4b592a,_0x30c93c){var _0x48c58a={'raw':![],'where':{'id':_0x4b592a[_0x6d97('0x5c')]['id']},'include':[{'model':db[_0x6d97('0x5d')],'as':'mandatoryDispositionPause'}]},_0x247c21={};_0x247c21[_0x6d97('0x45')]=_['keys'](db[_0x6d97('0x42')][_0x6d97('0x43')]);_0x247c21[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x4b592a[_0x6d97('0x46')]);_0x247c21[_0x6d97('0x48')]=_['intersection'](_0x247c21[_0x6d97('0x45')],_0x247c21[_0x6d97('0x46')]);_0x48c58a['attributes']=_[_0x6d97('0x4a')](_0x247c21[_0x6d97('0x45')],qs[_0x6d97('0x4b')](_0x4b592a[_0x6d97('0x46')]['fields']));_0x48c58a['attributes']=_0x48c58a[_0x6d97('0x49')][_0x6d97('0x5e')]?_0x48c58a['attributes']:_0x247c21['model'];if(_0x4b592a['query'][_0x6d97('0x57')]){_0x48c58a[_0x6d97('0x58')]=[{'all':!![]}];}_0x48c58a=_[_0x6d97('0x53')]({},_0x48c58a,_0x4b592a[_0x6d97('0x56')]);return db[_0x6d97('0x42')][_0x6d97('0x5f')](_0x48c58a)[_0x6d97('0x23')](handleEntityNotFound(_0x30c93c,null))[_0x6d97('0x23')](respondWithResult(_0x30c93c,null))['catch'](handleError(_0x30c93c,null));};exports[_0x6d97('0x60')]=function(_0x4b5955,_0x149ab4){return db[_0x6d97('0x42')]['create'](_0x4b5955[_0x6d97('0x61')],{})[_0x6d97('0x23')](function(_0x1a27a6){var _0x277c9b=_0x4b5955[_0x6d97('0x62')][_0x6d97('0x39')]({'plain':!![]});if(!_0x277c9b)throw new Error(_0x6d97('0x63'));if(_0x277c9b[_0x6d97('0x64')]==='user'){var _0x29302c=_0x1a27a6[_0x6d97('0x39')]({'plain':!![]});var _0x2b60ac='OpenchannelAccounts';return db[_0x6d97('0x65')][_0x6d97('0x5f')]({'where':{'name':_0x2b60ac,'userProfileId':_0x277c9b['userProfileId']},'raw':!![]})['then'](function(_0x47830a){if(_0x47830a&&_0x47830a[_0x6d97('0x66')]===0x0){return db[_0x6d97('0x3b')][_0x6d97('0x60')]({'name':_0x29302c['name'],'resourceId':_0x29302c['id'],'type':_0x47830a[_0x6d97('0x3e')],'sectionId':_0x47830a['id']},{})[_0x6d97('0x23')](function(){return _0x1a27a6;});}else{return _0x1a27a6;}})['catch'](function(_0x46c8c3){logger[_0x6d97('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46c8c3);throw _0x46c8c3;});}return _0x1a27a6;})[_0x6d97('0x23')](respondWithResult(_0x149ab4,0xc9))['catch'](handleError(_0x149ab4,null));};exports[_0x6d97('0x37')]=function(_0x1ce572,_0x218e9e){if(_0x1ce572[_0x6d97('0x61')]['id']){delete _0x1ce572[_0x6d97('0x61')]['id'];}return db[_0x6d97('0x42')][_0x6d97('0x5f')]({'where':{'id':_0x1ce572[_0x6d97('0x5c')]['id']},'include':[{'model':db[_0x6d97('0x5d')],'as':_0x6d97('0x40')}]})[_0x6d97('0x23')](handleEntityNotFound(_0x218e9e,null))[_0x6d97('0x23')](saveUpdates(_0x1ce572[_0x6d97('0x61')],null))[_0x6d97('0x23')](respondWithResult(_0x218e9e,null))[_0x6d97('0x2c')](handleError(_0x218e9e,null));};exports['destroy']=function(_0x1f4996,_0x3415d4){return db[_0x6d97('0x42')]['find']({'where':{'id':_0x1f4996[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x3415d4,null))[_0x6d97('0x23')](removeEntity(_0x3415d4,null))[_0x6d97('0x2c')](handleError(_0x3415d4,null));};exports[_0x6d97('0x67')]=function(_0x526e6c,_0x34b35d){return db[_0x6d97('0x42')][_0x6d97('0x67')]()[_0x6d97('0x23')](respondWithResult(_0x34b35d,null))[_0x6d97('0x2c')](handleError(_0x34b35d,null));};exports['addDisposition']=function(_0x291d39,_0x202444,_0xb267f2){if(_0x291d39[_0x6d97('0x61')]['id']){delete _0x291d39[_0x6d97('0x61')]['id'];}return db['OpenchannelAccount'][_0x6d97('0x5f')]({'where':{'id':_0x291d39[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x202444,null))[_0x6d97('0x23')](function(_0x4ddc2b){if(_0x4ddc2b){_0x291d39[_0x6d97('0x61')][_0x6d97('0x68')]=_0x4ddc2b['id'];return db[_0x6d97('0x69')][_0x6d97('0x60')](_0x291d39[_0x6d97('0x61')]);}})[_0x6d97('0x23')](respondWithResult(_0x202444,null))[_0x6d97('0x2c')](handleError(_0x202444,null));};exports[_0x6d97('0x6a')]=function(_0x14cf80,_0x3374ee,_0x54c931){var _0x55106d={'raw':![],'where':{}};var _0x1f211a={};var _0x1ebade={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6d97('0x6b')]({'where':{'id':_0x14cf80[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x3374ee,null))[_0x6d97('0x23')](function(_0x4285b4){if(_0x4285b4){_0x1f211a[_0x6d97('0x45')]=_['keys'](db[_0x6d97('0x69')][_0x6d97('0x43')]);_0x1f211a[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x14cf80[_0x6d97('0x46')]);_0x1f211a[_0x6d97('0x48')]=_[_0x6d97('0x4a')](_0x1f211a[_0x6d97('0x45')],_0x1f211a[_0x6d97('0x46')]);_0x55106d['attributes']=_[_0x6d97('0x4a')](_0x1f211a[_0x6d97('0x45')],qs[_0x6d97('0x4b')](_0x14cf80[_0x6d97('0x46')][_0x6d97('0x4b')]));_0x55106d[_0x6d97('0x49')]=_0x55106d[_0x6d97('0x49')]['length']?_0x55106d[_0x6d97('0x49')]:_0x1f211a[_0x6d97('0x45')];if(!_0x14cf80[_0x6d97('0x46')]['hasOwnProperty'](_0x6d97('0x4d'))){_0x55106d[_0x6d97('0x31')]=qs[_0x6d97('0x31')](_0x14cf80[_0x6d97('0x46')]['limit']);_0x55106d['offset']=qs[_0x6d97('0x2f')](_0x14cf80['query']['offset']);}_0x55106d[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x14cf80['query']['sort']);_0x55106d[_0x6d97('0x50')]=qs[_0x6d97('0x48')](_[_0x6d97('0x51')](_0x14cf80['query'],_0x1f211a[_0x6d97('0x48')]));_0x55106d[_0x6d97('0x50')][_0x6d97('0x68')]=_0x4285b4['id'];if(_0x14cf80[_0x6d97('0x46')][_0x6d97('0x52')]){_0x55106d['where']=_['merge'](_0x55106d[_0x6d97('0x50')],{'$or':_[_0x6d97('0x41')](_0x55106d['attributes'],function(_0x52d07b){var _0xcba753={};_0xcba753[_0x52d07b]={'$like':'%'+_0x14cf80[_0x6d97('0x46')][_0x6d97('0x52')]+'%'};return _0xcba753;})});}_0x55106d=_['merge']({},_0x55106d,_0x14cf80['options']);return db[_0x6d97('0x69')][_0x6d97('0x32')]({'where':_0x55106d[_0x6d97('0x50')]})[_0x6d97('0x23')](function(_0x13a703){_0x1ebade[_0x6d97('0x32')]=_0x13a703;if(_0x14cf80[_0x6d97('0x46')][_0x6d97('0x57')]){_0x55106d['include']=[{'all':!![]}];}return db['Disposition'][_0x6d97('0x59')](_0x55106d);})[_0x6d97('0x23')](function(_0x49c495){_0x1ebade[_0x6d97('0x5a')]=_0x49c495;return _0x1ebade;});}})['then'](respondWithFilteredResult(_0x3374ee,_0x55106d))['catch'](handleError(_0x3374ee,null));};exports['removeDispositions']=function(_0x4bf088,_0x357444,_0x1582d4){return db[_0x6d97('0x42')]['find']({'where':{'id':_0x4bf088[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x357444,null))[_0x6d97('0x23')](function(_0x4be576){if(_0x4be576){return _0x4be576['removeDispositions'](_0x4bf088[_0x6d97('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x357444,null))['catch'](handleError(_0x357444,null));};exports['addAnswer']=function(_0x1e2409,_0x10e2d8,_0x32e667){if(_0x1e2409['body']['id']){delete _0x1e2409['body']['id'];}return db[_0x6d97('0x42')][_0x6d97('0x5f')]({'where':{'id':_0x1e2409[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x10e2d8,null))[_0x6d97('0x23')](function(_0x244a61){if(_0x244a61){_0x1e2409[_0x6d97('0x61')][_0x6d97('0x68')]=_0x244a61['id'];return db['CannedAnswer'][_0x6d97('0x60')](_0x1e2409[_0x6d97('0x61')]);}})[_0x6d97('0x23')](respondWithResult(_0x10e2d8,null))['catch'](handleError(_0x10e2d8,null));};exports['getAnswers']=function(_0x5be5be,_0x3e2c48,_0x210938){var _0xbe290a={'raw':![],'where':{}};var _0x4959c3={};var _0x423722={'count':0x0,'rows':[]};return db[_0x6d97('0x42')]['findOne']({'where':{'id':_0x5be5be[_0x6d97('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3e2c48,null))[_0x6d97('0x23')](function(_0x4c451d){if(_0x4c451d){_0x4959c3['model']=_[_0x6d97('0x47')](db['CannedAnswer'][_0x6d97('0x43')]);_0x4959c3[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x5be5be[_0x6d97('0x46')]);_0x4959c3['filters']=_['intersection'](_0x4959c3[_0x6d97('0x45')],_0x4959c3[_0x6d97('0x46')]);_0xbe290a[_0x6d97('0x49')]=_['intersection'](_0x4959c3['model'],qs[_0x6d97('0x4b')](_0x5be5be[_0x6d97('0x46')][_0x6d97('0x4b')]));_0xbe290a[_0x6d97('0x49')]=_0xbe290a[_0x6d97('0x49')][_0x6d97('0x5e')]?_0xbe290a[_0x6d97('0x49')]:_0x4959c3[_0x6d97('0x45')];if(!_0x5be5be[_0x6d97('0x46')][_0x6d97('0x4c')](_0x6d97('0x4d'))){_0xbe290a[_0x6d97('0x31')]=qs[_0x6d97('0x31')](_0x5be5be[_0x6d97('0x46')][_0x6d97('0x31')]);_0xbe290a[_0x6d97('0x2f')]=qs[_0x6d97('0x2f')](_0x5be5be[_0x6d97('0x46')][_0x6d97('0x2f')]);}_0xbe290a[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x5be5be['query'][_0x6d97('0x4f')]);_0xbe290a[_0x6d97('0x50')]=qs[_0x6d97('0x48')](_['pick'](_0x5be5be[_0x6d97('0x46')],_0x4959c3['filters']));_0xbe290a[_0x6d97('0x50')]['OpenchannelAccountId']=_0x4c451d['id'];if(_0x5be5be[_0x6d97('0x46')][_0x6d97('0x52')]){_0xbe290a[_0x6d97('0x50')]=_['merge'](_0xbe290a['where'],{'$or':_[_0x6d97('0x41')](_0xbe290a[_0x6d97('0x49')],function(_0x45c965){var _0x4c8d66={};_0x4c8d66[_0x45c965]={'$like':'%'+_0x5be5be[_0x6d97('0x46')][_0x6d97('0x52')]+'%'};return _0x4c8d66;})});}_0xbe290a=_[_0x6d97('0x53')]({},_0xbe290a,_0x5be5be['options']);return db[_0x6d97('0x6c')][_0x6d97('0x32')]({'where':_0xbe290a[_0x6d97('0x50')]})[_0x6d97('0x23')](function(_0x5704a4){_0x423722['count']=_0x5704a4;if(_0x5be5be[_0x6d97('0x46')][_0x6d97('0x57')]){_0xbe290a['include']=[{'all':!![]}];}return db[_0x6d97('0x6c')][_0x6d97('0x59')](_0xbe290a);})[_0x6d97('0x23')](function(_0xc62ed2){_0x423722[_0x6d97('0x5a')]=_0xc62ed2;return _0x423722;});}})[_0x6d97('0x23')](respondWithFilteredResult(_0x3e2c48,_0xbe290a))[_0x6d97('0x2c')](handleError(_0x3e2c48,null));};exports[_0x6d97('0x6d')]=function(_0x5e36e3,_0x415be5,_0x4d17d4){return db[_0x6d97('0x42')][_0x6d97('0x5f')]({'where':{'id':_0x5e36e3[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x415be5,null))[_0x6d97('0x23')](function(_0x598a90){if(_0x598a90){return _0x598a90[_0x6d97('0x6d')](_0x5e36e3[_0x6d97('0x46')]['ids']);}})[_0x6d97('0x23')](respondWithStatusCode(_0x415be5,null))[_0x6d97('0x2c')](handleError(_0x415be5,null));};exports[_0x6d97('0x6e')]=function(_0x151888,_0x1cfa6d,_0x4fd66f){var _0x1f7e31={'body':_0x151888[_0x6d97('0x61')],'channel':_0x6d97('0x6f')};var _0x26d5a8=[];var _0x28b383=[];var _0x3ce880={};var _0x171af3=![];return db[_0x6d97('0x70')][_0x6d97('0x67')]()[_0x6d97('0x23')](function(_0x5adc24){if(!_0x5adc24){throw new db[(_0x6d97('0x71'))][(_0x6d97('0x72'))]('no\x20available\x20attributes');}_0x26d5a8=_[_0x6d97('0x73')](_[_0x6d97('0x47')](_0x5adc24),[_0x6d97('0x74'),'updatedAt']);_0x28b383=_[_0x6d97('0x73')](_['keys'](_0x5adc24),['createdAt',_0x6d97('0x75'),_0x6d97('0x76'),'ListId']);if(_0x151888[_0x6d97('0x61')]['id']){delete _0x151888[_0x6d97('0x61')]['id'];}if(_[_0x6d97('0x77')](_0x151888['body'][_0x6d97('0x78')])){throw new db[(_0x6d97('0x71'))][(_0x6d97('0x72'))]('from\x20is\x20mandatory');}if(_[_0x6d97('0x77')](_0x151888[_0x6d97('0x61')][_0x6d97('0x61')])||_0x151888[_0x6d97('0x61')][_0x6d97('0x61')]===''){throw new db[(_0x6d97('0x71'))][(_0x6d97('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6d97('0x77')](_0x151888[_0x6d97('0x61')]['mapKey'])){throw new db[(_0x6d97('0x71'))]['ValidationError'](_0x6d97('0x79')+_0x28b383);}if(!_[_0x6d97('0x7a')](_0x28b383,_0x151888['body']['mapKey'])){throw new db[(_0x6d97('0x71'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28b383);}_0x3ce880[_0x151888[_0x6d97('0x61')][_0x6d97('0x7b')]]=_0x151888[_0x6d97('0x61')]['from'];})[_0x6d97('0x23')](function(){return db['OpenchannelAccount'][_0x6d97('0x5f')]({'where':{'id':_0x151888[_0x6d97('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x6d97('0x7c'),'include':[{'model':db[_0x6d97('0x70')],'as':_0x6d97('0x7d'),'where':_0x3ce880,'limit':0x1,'order':[[_0x6d97('0x75'),_0x6d97('0x7e')]]}]},{'model':db[_0x6d97('0x7f')],'as':'Applications'}]});})[_0x6d97('0x23')](handleEntityNotFound(_0x1cfa6d,null))['then'](function(_0x1d43a3){if(_0x1d43a3&&_0x1d43a3[_0x6d97('0x7c')]){_0x1f7e31[_0x6d97('0x80')]=_0x1d43a3;_0x1f7e31[_0x6d97('0x81')]=_0x1d43a3['Applications'];_0x1f7e31['list']=_0x1d43a3[_0x6d97('0x7c')];_0x1f7e31[_0x6d97('0x81')]=_[_0x6d97('0x82')](_0x1f7e31['applications'],[_0x6d97('0x83')],[_0x6d97('0x84')]);if(_0x1f7e31[_0x6d97('0x80')][_0x6d97('0x85')]){delete _0x1f7e31[_0x6d97('0x80')][_0x6d97('0x85')];}if(_0x1f7e31[_0x6d97('0x80')]['List']&&_0x1f7e31[_0x6d97('0x80')][_0x6d97('0x7c')][_0x6d97('0x7d')][_0x6d97('0x5e')]){return _0x1f7e31[_0x6d97('0x80')]['List'][_0x6d97('0x7d')][0x0];}var _0x567b5a=_[_0x6d97('0x1a')](_0x151888[_0x6d97('0x61')],{'firstName':_0x151888[_0x6d97('0x61')][_0x6d97('0x78')],'ListId':_0x1d43a3['ListId']});_0x567b5a[_0x151888[_0x6d97('0x61')][_0x6d97('0x7b')]]=_0x151888['body']['from'];return db[_0x6d97('0x70')][_0x6d97('0x60')](_0x567b5a,{'fields':_0x26d5a8,'raw':!![]});}})[_0x6d97('0x23')](handleEntityNotFound(_0x1cfa6d,null))['then'](function(_0x345beb){_0x1f7e31['contact']=_0x345beb;if(_0x345beb){var _0x391822={'ContactId':_0x345beb['id'],'OpenchannelAccountId':_0x151888[_0x6d97('0x5c')]['id'],'from':(_0x345beb[_0x6d97('0x86')]||'')+'\x20'+(_0x345beb['lastName']||'')};var _0x4c3549={'OpenchannelAccountId':_0x151888[_0x6d97('0x5c')]['id'],'closed':![]};if(_0x151888[_0x6d97('0x61')][_0x6d97('0x87')]){_0x4c3549['threadId']=_0x151888[_0x6d97('0x61')][_0x6d97('0x87')];return db[_0x6d97('0x88')][_0x6d97('0x5f')]({'where':_0x4c3549})['then'](function(_0x4be4a9){if(_0x4be4a9){return[_0x4be4a9,![]];}_0x391822[_0x6d97('0x87')]=_0x151888[_0x6d97('0x61')][_0x6d97('0x87')];_0x391822[_0x6d97('0x89')]=_0x151888[_0x6d97('0x61')][_0x6d97('0x89')];return db[_0x6d97('0x88')][_0x6d97('0x60')](_0x391822)[_0x6d97('0x23')](function(_0x19ebd4){return[_0x19ebd4,!![]];});});}else{_0x4c3549[_0x6d97('0x87')]=null;}_0x4c3549[_0x6d97('0x8a')]=_0x345beb['id'];return db['OpenchannelInteraction'][_0x6d97('0x5f')]({'where':_0x4c3549})[_0x6d97('0x23')](function(_0x440616){if(_0x440616){return[_0x440616,![]];}return db[_0x6d97('0x88')][_0x6d97('0x60')](_0x391822)['then'](function(_0x378c79){return[_0x378c79,!![]];});});}})['spread'](function(_0x53a8c6,_0x425258){if(_0x53a8c6){_0x171af3=_0x425258;if(!_0x425258){var _0xc26972={'from':(_0x1f7e31[_0x6d97('0x8b')][_0x6d97('0x86')]||'')+'\x20'+(_0x1f7e31[_0x6d97('0x8b')][_0x6d97('0x8c')]||'')};if(_0x151888[_0x6d97('0x61')][_0x6d97('0x87')]&&_0x151888['body']['messageId']&&_0x151888[_0x6d97('0x61')][_0x6d97('0x87')]!=_0x151888[_0x6d97('0x61')]['messageId']){_0xc26972['threadId']=_0x151888[_0x6d97('0x61')][_0x6d97('0x8d')];}return _0x53a8c6[_0x6d97('0x37')](_0xc26972);}else{return _0x53a8c6;}}})[_0x6d97('0x23')](function(_0x11f9f7){_0x1f7e31['interaction']=_0x11f9f7[_0x6d97('0x39')]({'plain':!![]});_0x1f7e31[_0x6d97('0x8e')][_0x6d97('0x8f')]=_0x171af3;if(_0x1f7e31['interaction']['created']){if(_0x1f7e31[_0x6d97('0x80')][_0x6d97('0x90')]){_0x1f7e31['applications']['push']({'id':0x0,'priority':_0x1f7e31[_0x6d97('0x81')][_0x6d97('0x5e')]+0x1,'app':_0x6d97('0x91'),'appdata':_0x6d97('0x92'),'interval':_0x6d97('0x93')});}}return db[_0x6d97('0x94')][_0x6d97('0x60')]({'body':_0x151888[_0x6d97('0x61')][_0x6d97('0x61')],'OpenchannelAccountId':_0x151888[_0x6d97('0x5c')]['id'],'OpenchannelInteractionId':_0x11f9f7['id'],'direction':'in','ContactId':_0x1f7e31[_0x6d97('0x8b')]['id'],'AttachmentId':_0x151888[_0x6d97('0x61')][_0x6d97('0x95')]});})[_0x6d97('0x23')](function(_0x149d86){_0x1f7e31['message']=_0x149d86;if(_0x1f7e31[_0x6d97('0x8e')]['UserId']){return db[_0x6d97('0x96')][_0x6d97('0x5f')]({'attributes':['id','name'],'where':{'id':_0x1f7e31[_0x6d97('0x8e')][_0x6d97('0x97')]}})[_0x6d97('0x23')](function(_0x150660){if(_0x150660){_0x1f7e31[_0x6d97('0x81')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6d97('0x98'),'appdata':_0x150660[_0x6d97('0x3e')]+','+(_0x1f7e31[_0x6d97('0x80')][_0x6d97('0x99')]||0xa),'interval':'*,*,*,*'});_0x1f7e31['forcedOwnership']=![];}return respondWithRpcPromise(_0x6d97('0x9a'),_0x6d97('0x9b'),_0x1f7e31);});}return respondWithRpcPromise('Start',_0x6d97('0x9b'),_0x1f7e31);})[_0x6d97('0x23')](function(_0x39c442){respondWithRpcPromise('EventManager',_0x6d97('0x9c'),{'event':_0x6d97('0x6e'),'message':_0x39c442},client9002);return _0x39c442;})[_0x6d97('0x23')](respondWithResult(_0x1cfa6d,null))[_0x6d97('0x2c')](handleError(_0x1cfa6d,null));};exports[_0x6d97('0x9d')]=function(_0x2b636e,_0x1e60fc){var _0x2039b2=_0x2b636e[_0x6d97('0x5c')]['id'];var _0x2049b2=_0x2b636e[_0x6d97('0x61')];var _0x2779bf=0xc8;var _0x268abc=null;return db['sequelize'][_0x6d97('0x9e')]({'isolationLevel':db[_0x6d97('0x9f')][_0x6d97('0xa0')][_0x6d97('0xa1')]['READ_COMMITTED']},function(_0x203387){return db[_0x6d97('0x42')][_0x6d97('0x6b')]({'where':{'id':_0x2039b2},'transaction':_0x203387})[_0x6d97('0x23')](function(_0x519d8f){if(_0x519d8f){return db[_0x6d97('0x7f')][_0x6d97('0x38')]({'where':{'OpenchannelAccountId':_0x2039b2},'transaction':_0x203387})[_0x6d97('0x23')](function(){var _0x184abd=_[_0x6d97('0x41')](_0x2049b2,function(_0x31fdf5){_0x31fdf5['OpenchannelAccountId']=_0x2039b2;return _0x31fdf5;});return db['OpenchannelApplication'][_0x6d97('0xa2')](_0x184abd,{'transaction':_0x203387});});}else{_0x2779bf=0x194;_0x268abc=[];}});})[_0x6d97('0x23')](function(){if(_0x2779bf!==0x194){return db[_0x6d97('0x7f')][_0x6d97('0xa3')]({'where':{'OpenchannelAccountId':_0x2039b2},'order':_0x6d97('0x83')})[_0x6d97('0x23')](function(_0x46b6a7){_0x268abc=_0x46b6a7;});}})['catch'](function(_0x324888){_0x2779bf=0x1f4;logger[_0x6d97('0x29')](_0x324888[_0x6d97('0x3d')]);if(_0x324888[_0x6d97('0x3e')]){delete _0x324888[_0x6d97('0x3e')];}_0x268abc=_0x324888;})['finally'](function(){if(_0x268abc===null){_0x1e60fc[_0x6d97('0x3c')](_0x2779bf);}else{if(_0x2779bf===0x1f4){_0x1e60fc[_0x6d97('0x2d')](_0x2779bf)['send'](_0x268abc);}else{_0x1e60fc[_0x6d97('0x2d')](_0x2779bf)[_0x6d97('0x2e')](_0x268abc);}}});};exports[_0x6d97('0xa4')]=function(_0x3520e6,_0x5d6b5,_0x69771a){var _0x26b6be={};var _0x3499d4={};var _0x22e94d;var _0x2adae5;return db['OpenchannelAccount'][_0x6d97('0x6b')]({'where':{'id':_0x3520e6['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x5d6b5,null))['then'](function(_0x180de9){if(_0x180de9){_0x22e94d=_0x180de9;_0x3499d4[_0x6d97('0x45')]=_['keys'](db[_0x6d97('0x7f')][_0x6d97('0x43')]);_0x3499d4[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x3520e6[_0x6d97('0x46')]);_0x3499d4[_0x6d97('0x48')]=_[_0x6d97('0x4a')](_0x3499d4['model'],_0x3499d4[_0x6d97('0x46')]);_0x26b6be['attributes']=_[_0x6d97('0x4a')](_0x3499d4[_0x6d97('0x45')],qs['fields'](_0x3520e6[_0x6d97('0x46')][_0x6d97('0x4b')]));_0x26b6be[_0x6d97('0x49')]=_0x26b6be['attributes'][_0x6d97('0x5e')]?_0x26b6be[_0x6d97('0x49')]:_0x3499d4[_0x6d97('0x45')];_0x26b6be[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x3520e6[_0x6d97('0x46')]['sort']);_0x26b6be[_0x6d97('0x50')]=qs[_0x6d97('0x48')](_[_0x6d97('0x51')](_0x3520e6[_0x6d97('0x46')],_0x3499d4[_0x6d97('0x48')]));if(_0x3520e6[_0x6d97('0x46')]['filter']){_0x26b6be[_0x6d97('0x50')]=_[_0x6d97('0x53')](_0x26b6be['where'],{'$or':_[_0x6d97('0x41')](_0x26b6be[_0x6d97('0x49')],function(_0xddf946){var _0x569513={};_0x569513[_0xddf946]={'$like':'%'+_0x3520e6[_0x6d97('0x46')][_0x6d97('0x52')]+'%'};return _0x569513;})});}_0x26b6be=_[_0x6d97('0x53')]({},_0x26b6be,_0x3520e6[_0x6d97('0x56')]);return _0x22e94d[_0x6d97('0xa4')](_0x26b6be);}})[_0x6d97('0x23')](function(_0x2ea561){if(_0x2ea561){_0x2adae5=_0x2ea561[_0x6d97('0x5e')];if(!_0x3520e6[_0x6d97('0x46')][_0x6d97('0x4c')](_0x6d97('0x4d'))){_0x26b6be[_0x6d97('0x31')]=qs[_0x6d97('0x31')](_0x3520e6[_0x6d97('0x46')][_0x6d97('0x31')]);_0x26b6be[_0x6d97('0x2f')]=qs['offset'](_0x3520e6[_0x6d97('0x46')]['offset']);}return _0x22e94d[_0x6d97('0xa4')](_0x26b6be);}})[_0x6d97('0x23')](function(_0x5c553e){if(_0x5c553e){return _0x5c553e?{'count':_0x2adae5,'rows':_0x5c553e}:null;}})[_0x6d97('0x23')](respondWithResult(_0x5d6b5,null))[_0x6d97('0x2c')](handleError(_0x5d6b5,null));};exports[_0x6d97('0xa5')]=function(_0x557076,_0x2de68d,_0x21995c){var _0x2555f0={'raw':![],'where':{}};var _0x267b99={};var _0x523823={'count':0x0,'rows':[]};return db[_0x6d97('0x42')][_0x6d97('0x6b')]({'where':{'id':_0x557076['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x2de68d,null))[_0x6d97('0x23')](function(_0x4782c0){if(_0x4782c0){_0x267b99['model']=_['keys'](db[_0x6d97('0x88')][_0x6d97('0x43')]);_0x267b99[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x557076[_0x6d97('0x46')]);_0x267b99[_0x6d97('0x48')]=_[_0x6d97('0x4a')](_0x267b99[_0x6d97('0x45')],_0x267b99[_0x6d97('0x46')]);_0x2555f0[_0x6d97('0x49')]=_[_0x6d97('0x4a')](_0x267b99[_0x6d97('0x45')],qs[_0x6d97('0x4b')](_0x557076[_0x6d97('0x46')]['fields']));_0x2555f0[_0x6d97('0x49')]=_0x2555f0['attributes'][_0x6d97('0x5e')]?_0x2555f0[_0x6d97('0x49')]:_0x267b99[_0x6d97('0x45')];if(!_0x557076['query'][_0x6d97('0x4c')](_0x6d97('0x4d'))){_0x2555f0[_0x6d97('0x31')]=qs[_0x6d97('0x31')](_0x557076['query'][_0x6d97('0x31')]);_0x2555f0['offset']=qs[_0x6d97('0x2f')](_0x557076[_0x6d97('0x46')][_0x6d97('0x2f')]);}_0x2555f0[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x557076[_0x6d97('0x46')][_0x6d97('0x4f')]);_0x2555f0[_0x6d97('0x50')]=qs[_0x6d97('0x48')](_[_0x6d97('0x51')](_0x557076['query'],_0x267b99[_0x6d97('0x48')]));_0x2555f0[_0x6d97('0x50')]['OpenchannelAccountId']=_0x4782c0['id'];if(_0x557076[_0x6d97('0x46')][_0x6d97('0x52')]){_0x2555f0[_0x6d97('0x50')]=_[_0x6d97('0x53')](_0x2555f0[_0x6d97('0x50')],{'$or':_[_0x6d97('0x41')](_0x2555f0['attributes'],function(_0x4a719f){var _0x48bfd2={};_0x48bfd2[_0x4a719f]={'$like':'%'+_0x557076[_0x6d97('0x46')]['filter']+'%'};return _0x48bfd2;})});}_0x2555f0=_[_0x6d97('0x53')]({},_0x2555f0,_0x557076['options']);return db[_0x6d97('0x88')][_0x6d97('0x32')]({'where':_0x2555f0[_0x6d97('0x50')]})['then'](function(_0x5329fa){_0x523823[_0x6d97('0x32')]=_0x5329fa;if(_0x557076[_0x6d97('0x46')][_0x6d97('0x57')]){_0x2555f0['include']=[{'model':db[_0x6d97('0x70')],'as':_0x6d97('0xa6'),'required':![]},{'model':db[_0x6d97('0x96')],'as':_0x6d97('0xa7'),'attributes':[_0x6d97('0x3e'),_0x6d97('0xa8'),_0x6d97('0xa9')],'required':![]},{'model':db[_0x6d97('0xaa')],'as':'Tags','attributes':['id','name',_0x6d97('0xab')],'where':_0x557076[_0x6d97('0x46')]['tag']?{'id':_0x557076[_0x6d97('0x46')]['tag']}:undefined,'required':_0x557076[_0x6d97('0x46')][_0x6d97('0xac')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x2555f0);})['then'](function(_0x4ef551){_0x523823[_0x6d97('0x5a')]=_0x4ef551;return _0x523823;});}})[_0x6d97('0x23')](respondWithFilteredResult(_0x2de68d,_0x2555f0))[_0x6d97('0x2c')](handleError(_0x2de68d,null));};exports[_0x6d97('0xad')]=function(_0x29082e,_0x731104,_0x497e56){return db[_0x6d97('0x42')][_0x6d97('0x5f')]({'where':{'id':_0x29082e['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x731104,null))['then'](function(_0xb106dd){if(_0xb106dd){return _0xb106dd['addAgents'](_0x29082e[_0x6d97('0x61')][_0x6d97('0xae')],_[_0x6d97('0xaf')](_0x29082e['body'],[_0x6d97('0xae'),'id'])||{})[_0x6d97('0xb0')](function(_0x21e265){for(var _0x3a4850=0x0;_0x3a4850<_0x29082e['body'][_0x6d97('0xae')][_0x6d97('0x5e')];_0x3a4850+=0x1){socket[_0x6d97('0xb1')]('userOpenchannelAccount:save',{'UserId':Number(_0x29082e[_0x6d97('0x61')][_0x6d97('0xae')][_0x3a4850]),'OpenchannelAccountId':Number(_0x29082e['params']['id'])});}return _0x21e265;});}})['then'](respondWithResult(_0x731104,null))[_0x6d97('0x2c')](handleError(_0x731104,null));};exports[_0x6d97('0xb2')]=function(_0x291996,_0xd94cab,_0x301894){return db[_0x6d97('0x42')]['find']({'where':{'id':_0x291996['params']['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0xd94cab,null))[_0x6d97('0x23')](function(_0x150f62){if(_0x150f62){return _0x150f62[_0x6d97('0xb2')](_0x291996[_0x6d97('0x46')][_0x6d97('0xae')])['then'](function(){if(_['isArray'](_0x291996[_0x6d97('0x46')][_0x6d97('0xae')])){for(var _0x2a9b3c=0x0;_0x2a9b3c<_0x291996[_0x6d97('0x46')][_0x6d97('0xae')][_0x6d97('0x5e')];_0x2a9b3c+=0x1){socket[_0x6d97('0xb1')](_0x6d97('0xb3'),{'UserId':Number(_0x291996[_0x6d97('0x46')][_0x6d97('0xae')][_0x2a9b3c]),'OpenchannelAccountId':Number(_0x291996[_0x6d97('0x5c')]['id'])});}}else{socket[_0x6d97('0xb1')](_0x6d97('0xb3'),{'UserId':Number(_0x291996[_0x6d97('0x46')][_0x6d97('0xae')]),'OpenchannelAccountId':Number(_0x291996[_0x6d97('0x5c')]['id'])});}});}})[_0x6d97('0x23')](respondWithStatusCode(_0xd94cab,null))[_0x6d97('0x2c')](handleError(_0xd94cab,null));};exports['getAgents']=function(_0x361233,_0x1f9a94,_0x45e460){var _0x5cc799={};var _0xc9b723={};var _0x1be32c;var _0x2ab39e;return db['OpenchannelAccount'][_0x6d97('0x6b')]({'where':{'id':_0x361233[_0x6d97('0x5c')]['id']}})[_0x6d97('0x23')](handleEntityNotFound(_0x1f9a94,null))[_0x6d97('0x23')](function(_0x10b45a){if(_0x10b45a){_0x1be32c=_0x10b45a;_0xc9b723[_0x6d97('0x45')]=_[_0x6d97('0x47')](db[_0x6d97('0x96')][_0x6d97('0x43')]);_0xc9b723[_0x6d97('0x46')]=_[_0x6d97('0x47')](_0x361233['query']);_0xc9b723['filters']=_['intersection'](_0xc9b723['model'],_0xc9b723['query']);_0x5cc799[_0x6d97('0x49')]=_[_0x6d97('0x4a')](_0xc9b723[_0x6d97('0x45')],qs[_0x6d97('0x4b')](_0x361233[_0x6d97('0x46')][_0x6d97('0x4b')]));_0x5cc799['attributes']=_0x5cc799[_0x6d97('0x49')][_0x6d97('0x5e')]?_0x5cc799[_0x6d97('0x49')]:_0xc9b723[_0x6d97('0x45')];_0x5cc799[_0x6d97('0x4e')]=qs[_0x6d97('0x4f')](_0x361233[_0x6d97('0x46')][_0x6d97('0x4f')]);_0x5cc799[_0x6d97('0x50')]=qs[_0x6d97('0x48')](_[_0x6d97('0x51')](_0x361233[_0x6d97('0x46')],_0xc9b723[_0x6d97('0x48')]));if(_0x361233[_0x6d97('0x46')][_0x6d97('0x52')]){_0x5cc799[_0x6d97('0x50')]=_['merge'](_0x5cc799[_0x6d97('0x50')],{'$or':_['map'](_0x5cc799[_0x6d97('0x49')],function(_0x54bb32){var _0x19fbc7={};_0x19fbc7[_0x54bb32]={'$like':'%'+_0x361233['query'][_0x6d97('0x52')]+'%'};return _0x19fbc7;})});}_0x5cc799=_[_0x6d97('0x53')]({},_0x5cc799,_0x361233[_0x6d97('0x56')]);return _0x1be32c[_0x6d97('0xb4')](_0x5cc799);}})[_0x6d97('0x23')](function(_0x1e665f){if(_0x1e665f){_0x2ab39e=_0x1e665f[_0x6d97('0x5e')];if(!_0x361233[_0x6d97('0x46')][_0x6d97('0x4c')](_0x6d97('0x4d'))){_0x5cc799['limit']=qs[_0x6d97('0x31')](_0x361233[_0x6d97('0x46')][_0x6d97('0x31')]);_0x5cc799['offset']=qs[_0x6d97('0x2f')](_0x361233[_0x6d97('0x46')][_0x6d97('0x2f')]);}return _0x1be32c[_0x6d97('0xb4')](_0x5cc799);}})['then'](function(_0x39592a){if(_0x39592a){return _0x39592a?{'count':_0x2ab39e,'rows':_0x39592a}:null;}})[_0x6d97('0x23')](respondWithResult(_0x1f9a94,null))[_0x6d97('0x2c')](handleError(_0x1f9a94,null));};exports[_0x6d97('0xb5')]=function(_0x29ad3c,_0x58f9ec,_0x4e869a){var _0x49e6ab,_0x4bd021,_0x2ddb2a;if(_[_0x6d97('0x77')](_0x29ad3c['body'][_0x6d97('0x61')])||_0x29ad3c[_0x6d97('0x61')][_0x6d97('0x61')]===''){throw new db[(_0x6d97('0x71'))][(_0x6d97('0x72'))](_0x6d97('0xb6'));}if(_[_0x6d97('0x77')](_0x29ad3c['body']['to'])){}_0x49e6ab=_0x29ad3c[_0x6d97('0x61')]['to'];return db[_0x6d97('0x42')][_0x6d97('0x6b')]({'where':{'id':_0x29ad3c[_0x6d97('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58f9ec,null))[_0x6d97('0x23')](function(_0x453363){if(_0x453363){return db[_0x6d97('0x42')][_0x6d97('0x5f')]({'where':{'id':_0x453363['id']},'include':[{'model':db[_0x6d97('0xb7')],'as':'List','include':[{'model':db[_0x6d97('0x70')],'as':_0x6d97('0x7d'),'where':{[_0x453363[_0x6d97('0x7b')]]:_0x49e6ab},'limit':0x1,'order':[[_0x6d97('0x75'),_0x6d97('0x7e')]]}]}]})[_0x6d97('0x23')](handleEntityNotFound(_0x58f9ec,null))[_0x6d97('0x23')](function(_0x56a77e){if(_0x56a77e&&_0x56a77e[_0x6d97('0x7c')]){_0x4bd021=_0x56a77e[_0x6d97('0x39')]({'plain':!![]});if(_0x4bd021[_0x6d97('0x7c')]&&_0x4bd021[_0x6d97('0x7c')][_0x6d97('0x7d')]['length']){return _0x4bd021[_0x6d97('0x7c')]['Contacts'][0x0];}return db[_0x6d97('0x70')]['create'](_[_0x6d97('0x1a')](_0x29ad3c['body'],{'firstName':_0x49e6ab,[_0x56a77e[_0x6d97('0x7b')]]:_0x49e6ab,'phone':_0x49e6ab,'ListId':_0x4bd021['ListId']}));}})[_0x6d97('0x23')](handleEntityNotFound(_0x58f9ec,null))[_0x6d97('0x23')](function(_0x325b73){if(_0x325b73){_0x2ddb2a=_0x325b73;return db[_0x6d97('0x88')][_0x6d97('0x5f')]({'where':{'ContactId':_0x2ddb2a['id'],'closed':![],'OpenchannelAccountId':_0x4bd021['id']}})['then'](function(_0x5b45e3){if(_0x5b45e3){return[_0x5b45e3,![]];}return db[_0x6d97('0x88')][_0x6d97('0x60')]({'UserId':_0x29ad3c['user']['id'],'ContactId':_0x2ddb2a['id'],'OpenchannelAccountId':_0x4bd021['id'],'lastMsgDirection':_0x6d97('0xb8'),'firstMsgDirection':_0x6d97('0xb8'),'Messages':[_[_0x6d97('0x53')](_0x29ad3c[_0x6d97('0x61')],{'read':![],'body':_0x29ad3c[_0x6d97('0x61')][_0x6d97('0x61')],'OpenchannelAccountId':_0x4bd021['id'],'UserId':_0x29ad3c[_0x6d97('0x62')]['id'],'ContactId':_0x2ddb2a['id']})]},{'include':[{'model':db[_0x6d97('0x94')],'as':_0x6d97('0xb9')}]})['then'](function(_0x51ffe3){return[_0x51ffe3,!![]];});});}})[_0x6d97('0xb0')](function(_0x3f9e40,_0xa4e4bb){if(_0xa4e4bb){return _0x3f9e40;}return db['OpenchannelMessage']['create'](_[_0x6d97('0x53')](_0x29ad3c[_0x6d97('0x61')],{'read':![],'body':_0x29ad3c[_0x6d97('0x61')][_0x6d97('0x61')],'OpenchannelAccountId':_0x4bd021['id'],'OpenchannelInteractionId':_0x3f9e40['id'],'UserId':_0x29ad3c['user']['id'],'ContactId':_0x2ddb2a['id']}))[_0x6d97('0x23')](function(_0x43d4e5){_0x3f9e40['dataValues'][_0x6d97('0xb9')]=[];_0x3f9e40[_0x6d97('0xba')][_0x6d97('0xb9')][_0x6d97('0xbb')](_0x43d4e5[_0x6d97('0xba')]);return _0x3f9e40;});});}})[_0x6d97('0x23')](respondWithResult(_0x58f9ec,null))[_0x6d97('0x2c')](handleError(_0x58f9ec,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index bf64870..47f7294 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4483,0x1a3));var _0x3448=function(_0x5d20d5,_0x10f89b){_0x5d20d5=_0x5d20d5-0x0;var _0x171248=_0x4483[_0x5d20d5];return _0x171248;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x47d966,_0x40ea38){var _0x40a22a=function(_0x255985){while(--_0x255985){_0x47d966['push'](_0x47d966['shift']());}};_0x40a22a(++_0x40ea38);}(_0x2dae,0xc3));var _0xe2da=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x2dae[_0x868b7c];return _0x21683c;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 72d5f44..6b3c7a2 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(_0xc7be04,_0x4f7e2b){var _0x46ea1a=function(_0x4ba2e1){while(--_0x4ba2e1){_0xc7be04['push'](_0xc7be04['shift']());}};_0x46ea1a(++_0x4f7e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x5634ac,_0x1c5489){var _0x4722b0=function(_0x5f19eb){while(--_0x5f19eb){_0x5634ac['push'](_0x5634ac['shift']());}};_0x4722b0(++_0x1c5489);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 46bf430..e0758cd 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 _0x073e=['../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils'];(function(_0x1a64b2,_0x348f77){var _0x4f9d61=function(_0x22b740){while(--_0x22b740){_0x1a64b2['push'](_0x1a64b2['shift']());}};_0x4f9d61(++_0x348f77);}(_0x073e,0x181));var _0xe073=function(_0x4a3e91,_0x8e03db){_0x4a3e91=_0x4a3e91-0x0;var _0x36da84=_0x073e[_0x4a3e91];return _0x36da84;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var moment=require(_0xe073('0x2'));var BPromise=require(_0xe073('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe073('0x7')]({'port':0x232a});config[_0xe073('0x8')]=_[_0xe073('0x9')](config[_0xe073('0x8')],{'host':_0xe073('0xa'),'port':0x18eb});var socket=require(_0xe073('0xb'))(new Redis(config['redis']));require(_0xe073('0xc'))[_0xe073('0xd')](socket);function respondWithRpcPromise(_0x46757c,_0x118048,_0x4fccb1){return new BPromise(function(_0x47ac27,_0x32878f){return client[_0xe073('0xe')](_0x46757c,_0x4fccb1)[_0xe073('0xf')](function(_0x3a9df1){logger[_0xe073('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x118048,_0xe073('0x11'));logger['debug'](_0xe073('0x12'),_0x118048,'request\x20sent',JSON[_0xe073('0x13')](_0x3a9df1));if(_0x3a9df1['error']){if(_0x3a9df1[_0xe073('0x14')][_0xe073('0x15')]===0x1f4){logger[_0xe073('0x14')](_0xe073('0x16'),_0x118048,_0x3a9df1[_0xe073('0x14')][_0xe073('0x17')]);return _0x32878f(_0x3a9df1[_0xe073('0x14')][_0xe073('0x17')]);}logger[_0xe073('0x14')](_0xe073('0x16'),_0x118048,_0x3a9df1[_0xe073('0x14')]['message']);return _0x47ac27(_0x3a9df1['error']['message']);}else{logger[_0xe073('0x10')](_0xe073('0x16'),_0x118048,_0xe073('0x11'));_0x47ac27(_0x3a9df1[_0xe073('0x18')]['message']);}})[_0xe073('0x19')](function(_0x103a51){logger[_0xe073('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x118048,_0x103a51);_0x32878f(_0x103a51);});});} \ No newline at end of file +var _0x174b=['localhost','socket.io-emitter','./openchannelAccount.socket','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults'];(function(_0x31b151,_0x42fc2a){var _0x325470=function(_0x2127b2){while(--_0x2127b2){_0x31b151['push'](_0x31b151['shift']());}};_0x325470(++_0x42fc2a);}(_0x174b,0x19d));var _0xb174=function(_0xb489de,_0x2d38a0){_0xb489de=_0xb489de-0x0;var _0x57fbfb=_0x174b[_0xb489de];return _0x57fbfb;};'use strict';var _=require(_0xb174('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb174('0x1'));var rs=require(_0xb174('0x2'));var fs=require('fs');var Redis=require(_0xb174('0x3'));var db=require(_0xb174('0x4'))['db'];var utils=require(_0xb174('0x5'));var logger=require(_0xb174('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb174('0x7'));var client=jayson[_0xb174('0x8')][_0xb174('0x9')]({'port':0x232a});config[_0xb174('0xa')]=_[_0xb174('0xb')](config[_0xb174('0xa')],{'host':_0xb174('0xc'),'port':0x18eb});var socket=require(_0xb174('0xd'))(new Redis(config[_0xb174('0xa')]));require(_0xb174('0xe'))['register'](socket);function respondWithRpcPromise(_0x84e738,_0x4b6dd6,_0x3a05e9){return new BPromise(function(_0x1a4775,_0x4dffab){return client[_0xb174('0xf')](_0x84e738,_0x3a05e9)['then'](function(_0x3fbd28){logger[_0xb174('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));logger[_0xb174('0x12')](_0xb174('0x13'),_0x4b6dd6,_0xb174('0x11'),JSON['stringify'](_0x3fbd28));if(_0x3fbd28[_0xb174('0x14')]){if(_0x3fbd28['error'][_0xb174('0x15')]===0x1f4){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')]['message']);return _0x4dffab(_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);}logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);return _0x1a4775(_0x3fbd28['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));_0x1a4775(_0x3fbd28['result'][_0xb174('0x17')]);}})[_0xb174('0x18')](function(_0x5ac337){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x5ac337);_0x4dffab(_0x5ac337);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 53d6ecc..b378645 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 _0x136c=['emit','removeListener','register','length','./openchannelAccount.events','save','update'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x136c,0x1d2));var _0xc136=function(_0x438ab,_0x45db52){_0x438ab=_0x438ab-0x0;var _0x3dbe29=_0x136c[_0x438ab];return _0x3dbe29;};'use strict';var OpenchannelAccountEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x3b4cbd,_0x34c789){return function(_0x15181c){_0x34c789[_0xc136('0x3')](_0x3b4cbd,_0x15181c);};}function removeListener(_0x9e2e9d,_0x19565a){return function(){OpenchannelAccountEvents[_0xc136('0x4')](_0x9e2e9d,_0x19565a);};}exports[_0xc136('0x5')]=function(_0x586570){for(var _0x1ac41b=0x0,_0x594112=events[_0xc136('0x6')];_0x1ac41b<_0x594112;_0x1ac41b++){var _0x3993f2=events[_0x1ac41b];var _0x1804c1=createListener('openchannelAccount:'+_0x3993f2,_0x586570);OpenchannelAccountEvents['on'](_0x3993f2,_0x1804c1);}}; \ No newline at end of file +var _0x98e5=['length','openchannelAccount:','update','emit'];(function(_0x360cf2,_0xd59c3a){var _0x39ecaa=function(_0x24725a){while(--_0x24725a){_0x360cf2['push'](_0x360cf2['shift']());}};_0x39ecaa(++_0xd59c3a);}(_0x98e5,0x8a));var _0x598e=function(_0x1d5cbb,_0x425e7f){_0x1d5cbb=_0x1d5cbb-0x0;var _0x1da5d5=_0x98e5[_0x1d5cbb];return _0x1da5d5;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save','remove',_0x598e('0x0')];function createListener(_0x3e343b,_0x5207d0){return function(_0x196f8a){_0x5207d0[_0x598e('0x1')](_0x3e343b,_0x196f8a);};}function removeListener(_0x5cc274,_0x3af01f){return function(){OpenchannelAccountEvents['removeListener'](_0x5cc274,_0x3af01f);};}exports['register']=function(_0x154755){for(var _0x568749=0x0,_0x4292c3=events[_0x598e('0x2')];_0x568749<_0x4292c3;_0x568749++){var _0x10bf8e=events[_0x568749];var _0x3e0212=createListener(_0x598e('0x3')+_0x10bf8e,_0x154755);OpenchannelAccountEvents['on'](_0x10bf8e,_0x3e0212);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 1abcc46..b1b2b15 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 _0x9048=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9048,0x105));var _0x8904=function(_0x6084c8,_0x450d6a){_0x6084c8=_0x6084c8-0x0;var _0x51522f=_0x9048[_0x6084c8];return _0x51522f;};'use strict';var multer=require(_0x8904('0x0'));var util=require(_0x8904('0x1'));var path=require(_0x8904('0x2'));var timeout=require(_0x8904('0x3'));var express=require(_0x8904('0x4'));var router=express[_0x8904('0x5')]();var fs_extra=require(_0x8904('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8904('0x7'));var config=require(_0x8904('0x8'));var controller=require(_0x8904('0x9'));router[_0x8904('0xa')]('/',auth[_0x8904('0xb')](),controller['index']);router[_0x8904('0xa')](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0xd')]);router[_0x8904('0xe')]('/',auth[_0x8904('0xb')](),controller[_0x8904('0xf')]);router['put'](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0x10')]);router[_0x8904('0x11')](_0x8904('0xc'),auth[_0x8904('0xb')](),controller[_0x8904('0x12')]);module[_0x8904('0x13')]=router; \ No newline at end of file +var _0x4d2d=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','post','create','put','update'];(function(_0x2e2eab,_0x2e609a){var _0x2357bc=function(_0x2235ad){while(--_0x2235ad){_0x2e2eab['push'](_0x2e2eab['shift']());}};_0x2357bc(++_0x2e609a);}(_0x4d2d,0x7b));var _0xd4d2=function(_0x496cdc,_0x9d6db3){_0x496cdc=_0x496cdc-0x0;var _0x103a8e=_0x4d2d[_0x496cdc];return _0x103a8e;};'use strict';var multer=require(_0xd4d2('0x0'));var util=require(_0xd4d2('0x1'));var path=require(_0xd4d2('0x2'));var timeout=require(_0xd4d2('0x3'));var express=require('express');var router=express[_0xd4d2('0x4')]();var fs_extra=require(_0xd4d2('0x5'));var auth=require(_0xd4d2('0x6'));var interaction=require(_0xd4d2('0x7'));var config=require(_0xd4d2('0x8'));var controller=require(_0xd4d2('0x9'));router[_0xd4d2('0xa')]('/',auth[_0xd4d2('0xb')](),controller['index']);router[_0xd4d2('0xa')](_0xd4d2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd4d2('0xd')]('/',auth['isAuthenticated'](),controller[_0xd4d2('0xe')]);router[_0xd4d2('0xf')](_0xd4d2('0xc'),auth[_0xd4d2('0xb')](),controller[_0xd4d2('0x10')]);router[_0xd4d2('0x11')](_0xd4d2('0xc'),auth[_0xd4d2('0xb')](),controller[_0xd4d2('0x12')]);module[_0xd4d2('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 58ab07d..4456afd 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 _0x8a78=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8a78,0x158));var _0x88a7=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x8a78[_0xcd0918];return _0x250704;};'use strict';var Sequelize=require(_0x88a7('0x0'));module[_0x88a7('0x1')]={'priority':{'type':Sequelize[_0x88a7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88a7('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x88a7('0x4')]()},'description':{'type':Sequelize[_0x88a7('0x3')]},'interval':{'type':Sequelize[_0x88a7('0x3')],'defaultValue':_0x88a7('0x5')}}; \ No newline at end of file +var _0x6a9e=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xcb6b8b,_0x56ac96){var _0xbe093f=function(_0x454620){while(--_0x454620){_0xcb6b8b['push'](_0xcb6b8b['shift']());}};_0xbe093f(++_0x56ac96);}(_0x6a9e,0x1c2));var _0xe6a9=function(_0x30d953,_0x348ea6){_0x30d953=_0x30d953-0x0;var _0x1d1fad=_0x6a9e[_0x30d953];return _0x1d1fad;};'use strict';var Sequelize=require('sequelize');module[_0xe6a9('0x0')]={'priority':{'type':Sequelize[_0xe6a9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe6a9('0x2')],'allowNull':![],'defaultValue':_0xe6a9('0x3')},'appdata':{'type':Sequelize[_0xe6a9('0x4')]()},'description':{'type':Sequelize[_0xe6a9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe6a9('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 495956f..4aed1d8 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 _0x3e16=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','catch','create','update','body','eml-format','rimraf','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x44178b,_0x16e647){var _0x32dc2a=function(_0x3cbf2d){while(--_0x3cbf2d){_0x44178b['push'](_0x44178b['shift']());}};_0x32dc2a(++_0x16e647);}(_0x3e16,0xab));var _0x63e1=function(_0x53281d,_0x28a2c3){_0x53281d=_0x53281d-0x0;var _0x1ee558=_0x3e16[_0x53281d];return _0x1ee558;};'use strict';var emlformat=require(_0x63e1('0x0'));var rimraf=require(_0x63e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x63e1('0x2'));var moment=require(_0x63e1('0x3'));var BPromise=require(_0x63e1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x63e1('0x5'));var ejs=require(_0x63e1('0x6'));var fs=require('fs');var fs_extra=require(_0x63e1('0x7'));var _=require(_0x63e1('0x8'));var squel=require(_0x63e1('0x9'));var crypto=require(_0x63e1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x63e1('0xb'));var toCsv=require(_0x63e1('0x5'));var querystring=require(_0x63e1('0xc'));var Papa=require(_0x63e1('0xd'));var Redis=require(_0x63e1('0xe'));var authService=require(_0x63e1('0xf'));var qs=require(_0x63e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63e1('0x11'));var logger=require('../../config/logger')(_0x63e1('0x12'));var utils=require(_0x63e1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x63e1('0x14'));var db=require(_0x63e1('0x15'))['db'];function respondWithStatusCode(_0x1694c8,_0x1bfb14){_0x1bfb14=_0x1bfb14||0xcc;return function(_0x3dcc76){if(_0x3dcc76){return _0x1694c8[_0x63e1('0x16')](_0x1bfb14);}return _0x1694c8[_0x63e1('0x17')](_0x1bfb14)[_0x63e1('0x18')]();};}function respondWithResult(_0x27a9cd,_0x46e21e){_0x46e21e=_0x46e21e||0xc8;return function(_0x37053c){if(_0x37053c){return _0x27a9cd[_0x63e1('0x17')](_0x46e21e)[_0x63e1('0x19')](_0x37053c);}};}function respondWithFilteredResult(_0x5ce1a9,_0x38fb5e){return function(_0x2da8bf){if(_0x2da8bf){var _0x3ca119=typeof _0x38fb5e[_0x63e1('0x1a')]==='undefined'&&typeof _0x38fb5e[_0x63e1('0x1b')]===_0x63e1('0x1c');var _0x423a74=_0x2da8bf[_0x63e1('0x1d')];var _0x6f7774=_0x3ca119?0x0:_0x38fb5e['offset'];var _0x399923=_0x3ca119?_0x2da8bf['count']:_0x38fb5e[_0x63e1('0x1a')]+_0x38fb5e[_0x63e1('0x1b')];var _0x3c6bd7;if(_0x399923>=_0x423a74){_0x399923=_0x423a74;_0x3c6bd7=0xc8;}else{_0x3c6bd7=0xce;}_0x5ce1a9['status'](_0x3c6bd7);return _0x5ce1a9['set'](_0x63e1('0x1e'),_0x6f7774+'-'+_0x399923+'/'+_0x423a74)['json'](_0x2da8bf);}return null;};}function patchUpdates(_0x5b5719){return function(_0x5b523c){try{jsonpatch[_0x63e1('0x1f')](_0x5b523c,_0x5b5719,!![]);}catch(_0x12a482){return BPromise[_0x63e1('0x20')](_0x12a482);}return _0x5b523c['save']();};}function saveUpdates(_0x6238a6,_0x5d59c3){return function(_0x5a9bc5){if(_0x5a9bc5){return _0x5a9bc5['update'](_0x6238a6)[_0x63e1('0x21')](function(_0x4db04c){return _0x4db04c;});}return null;};}function removeEntity(_0x52cf60,_0x4e1550){return function(_0x2f6d6d){if(_0x2f6d6d){return _0x2f6d6d[_0x63e1('0x22')]()[_0x63e1('0x21')](function(){_0x52cf60[_0x63e1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33a75a,_0x524871){return function(_0x420e6b){if(!_0x420e6b){_0x33a75a[_0x63e1('0x16')](0x194);}return _0x420e6b;};}function handleError(_0x231c3b,_0x59257c){_0x59257c=_0x59257c||0x1f4;return function(_0x34f02f){logger[_0x63e1('0x23')](_0x34f02f[_0x63e1('0x24')]);if(_0x34f02f[_0x63e1('0x25')]){delete _0x34f02f[_0x63e1('0x25')];}_0x231c3b['status'](_0x59257c)[_0x63e1('0x26')](_0x34f02f);};}exports['index']=function(_0x55b3e4,_0x4a5340){var _0x1bf1fb={},_0x1e1fdd={},_0x5c8d0b={'count':0x0,'rows':[]};var _0x32e3b2=_[_0x63e1('0x27')](db[_0x63e1('0x28')][_0x63e1('0x29')],function(_0x1f6315){return{'name':_0x1f6315[_0x63e1('0x2a')],'type':_0x1f6315[_0x63e1('0x2b')][_0x63e1('0x2c')]};});_0x1e1fdd[_0x63e1('0x2d')]=_[_0x63e1('0x27')](_0x32e3b2,_0x63e1('0x25'));_0x1e1fdd[_0x63e1('0x2e')]=_[_0x63e1('0x2f')](_0x55b3e4[_0x63e1('0x2e')]);_0x1e1fdd[_0x63e1('0x30')]=_[_0x63e1('0x31')](_0x1e1fdd['model'],_0x1e1fdd[_0x63e1('0x2e')]);_0x1bf1fb[_0x63e1('0x32')]=_[_0x63e1('0x31')](_0x1e1fdd[_0x63e1('0x2d')],qs['fields'](_0x55b3e4[_0x63e1('0x2e')]['fields']));_0x1bf1fb['attributes']=_0x1bf1fb[_0x63e1('0x32')][_0x63e1('0x33')]?_0x1bf1fb[_0x63e1('0x32')]:_0x1e1fdd[_0x63e1('0x2d')];if(!_0x55b3e4['query'][_0x63e1('0x34')](_0x63e1('0x35'))){_0x1bf1fb[_0x63e1('0x1b')]=qs[_0x63e1('0x1b')](_0x55b3e4[_0x63e1('0x2e')][_0x63e1('0x1b')]);_0x1bf1fb[_0x63e1('0x1a')]=qs[_0x63e1('0x1a')](_0x55b3e4[_0x63e1('0x2e')]['offset']);}_0x1bf1fb[_0x63e1('0x36')]=qs['sort'](_0x55b3e4['query'][_0x63e1('0x37')]);_0x1bf1fb[_0x63e1('0x38')]=qs['filters'](_[_0x63e1('0x39')](_0x55b3e4[_0x63e1('0x2e')],_0x1e1fdd[_0x63e1('0x30')]),_0x32e3b2);if(_0x55b3e4['query'][_0x63e1('0x3a')]){_0x1bf1fb[_0x63e1('0x38')]=_[_0x63e1('0x3b')](_0x1bf1fb[_0x63e1('0x38')],{'$or':_[_0x63e1('0x27')](_0x32e3b2,function(_0x187098){if(_0x187098[_0x63e1('0x2b')]!==_0x63e1('0x3c')){var _0x3f8eea={};_0x3f8eea[_0x187098[_0x63e1('0x25')]]={'$like':'%'+_0x55b3e4[_0x63e1('0x2e')]['filter']+'%'};return _0x3f8eea;}})});}_0x1bf1fb=_[_0x63e1('0x3b')]({},_0x1bf1fb,_0x55b3e4[_0x63e1('0x3d')]);var _0x5292c5={'where':_0x1bf1fb[_0x63e1('0x38')]};return db['OpenchannelApplication']['count'](_0x5292c5)['then'](function(_0x37a1e0){_0x5c8d0b[_0x63e1('0x1d')]=_0x37a1e0;if(_0x55b3e4[_0x63e1('0x2e')][_0x63e1('0x3e')]){_0x1bf1fb['include']=[{'all':!![]}];}return db[_0x63e1('0x28')][_0x63e1('0x3f')](_0x1bf1fb);})['then'](function(_0x2bc9b3){_0x5c8d0b[_0x63e1('0x40')]=_0x2bc9b3;return _0x5c8d0b;})[_0x63e1('0x21')](respondWithFilteredResult(_0x4a5340,_0x1bf1fb))['catch'](handleError(_0x4a5340,null));};exports[_0x63e1('0x41')]=function(_0x4644a7,_0x1e5f84){var _0x18d534={'raw':!![],'where':{'id':_0x4644a7[_0x63e1('0x42')]['id']}},_0x542efe={};_0x542efe[_0x63e1('0x2d')]=_[_0x63e1('0x2f')](db['OpenchannelApplication'][_0x63e1('0x29')]);_0x542efe[_0x63e1('0x2e')]=_[_0x63e1('0x2f')](_0x4644a7[_0x63e1('0x2e')]);_0x542efe['filters']=_[_0x63e1('0x31')](_0x542efe[_0x63e1('0x2d')],_0x542efe[_0x63e1('0x2e')]);_0x18d534['attributes']=_[_0x63e1('0x31')](_0x542efe[_0x63e1('0x2d')],qs[_0x63e1('0x43')](_0x4644a7['query'][_0x63e1('0x43')]));_0x18d534[_0x63e1('0x32')]=_0x18d534[_0x63e1('0x32')][_0x63e1('0x33')]?_0x18d534[_0x63e1('0x32')]:_0x542efe['model'];if(_0x4644a7[_0x63e1('0x2e')][_0x63e1('0x3e')]){_0x18d534[_0x63e1('0x44')]=[{'all':!![]}];}_0x18d534=_['merge']({},_0x18d534,_0x4644a7[_0x63e1('0x3d')]);return db['OpenchannelApplication'][_0x63e1('0x45')](_0x18d534)[_0x63e1('0x21')](handleEntityNotFound(_0x1e5f84,null))[_0x63e1('0x21')](respondWithResult(_0x1e5f84,null))[_0x63e1('0x46')](handleError(_0x1e5f84,null));};exports[_0x63e1('0x47')]=function(_0xf3f943,_0x198ed0){return db[_0x63e1('0x28')][_0x63e1('0x47')](_0xf3f943['body'],{})['then'](respondWithResult(_0x198ed0,0xc9))['catch'](handleError(_0x198ed0,null));};exports[_0x63e1('0x48')]=function(_0x51763a,_0x180238){if(_0x51763a[_0x63e1('0x49')]['id']){delete _0x51763a['body']['id'];}return db[_0x63e1('0x28')][_0x63e1('0x45')]({'where':{'id':_0x51763a[_0x63e1('0x42')]['id']}})[_0x63e1('0x21')](handleEntityNotFound(_0x180238,null))[_0x63e1('0x21')](saveUpdates(_0x51763a['body'],null))['then'](respondWithResult(_0x180238,null))[_0x63e1('0x46')](handleError(_0x180238,null));};exports[_0x63e1('0x22')]=function(_0x3273f9,_0x258fe5){return db['OpenchannelApplication'][_0x63e1('0x45')]({'where':{'id':_0x3273f9[_0x63e1('0x42')]['id']}})['then'](handleEntityNotFound(_0x258fe5,null))['then'](removeEntity(_0x258fe5,null))[_0x63e1('0x46')](handleError(_0x258fe5,null));}; \ No newline at end of file +var _0x7508=['catch','show','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','error','name','index','map','OpenchannelApplication','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x433be1,_0x3d5097){var _0x492e3f=function(_0x5740cc){while(--_0x5740cc){_0x433be1['push'](_0x433be1['shift']());}};_0x492e3f(++_0x3d5097);}(_0x7508,0x9a));var _0x8750=function(_0x4a4cde,_0x58a526){_0x4a4cde=_0x4a4cde-0x0;var _0x329477=_0x7508[_0x4a4cde];return _0x329477;};'use strict';var emlformat=require(_0x8750('0x0'));var rimraf=require(_0x8750('0x1'));var zipdir=require(_0x8750('0x2'));var jsonpatch=require(_0x8750('0x3'));var rp=require(_0x8750('0x4'));var moment=require(_0x8750('0x5'));var BPromise=require(_0x8750('0x6'));var Mustache=require(_0x8750('0x7'));var util=require(_0x8750('0x8'));var path=require(_0x8750('0x9'));var sox=require('sox');var csv=require(_0x8750('0xa'));var ejs=require(_0x8750('0xb'));var fs=require('fs');var fs_extra=require(_0x8750('0xc'));var _=require(_0x8750('0xd'));var squel=require(_0x8750('0xe'));var crypto=require(_0x8750('0xf'));var jsforce=require(_0x8750('0x10'));var deskjs=require(_0x8750('0x11'));var toCsv=require(_0x8750('0xa'));var querystring=require('querystring');var Papa=require(_0x8750('0x12'));var Redis=require(_0x8750('0x13'));var authService=require(_0x8750('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8750('0x15'));var logger=require(_0x8750('0x16'))('api');var utils=require(_0x8750('0x17'));var config=require(_0x8750('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8750('0x19'))['db'];function respondWithStatusCode(_0x549b4b,_0x177fc1){_0x177fc1=_0x177fc1||0xcc;return function(_0x5ee79d){if(_0x5ee79d){return _0x549b4b[_0x8750('0x1a')](_0x177fc1);}return _0x549b4b[_0x8750('0x1b')](_0x177fc1)[_0x8750('0x1c')]();};}function respondWithResult(_0x3d48a2,_0x1fe31f){_0x1fe31f=_0x1fe31f||0xc8;return function(_0x112617){if(_0x112617){return _0x3d48a2[_0x8750('0x1b')](_0x1fe31f)[_0x8750('0x1d')](_0x112617);}};}function respondWithFilteredResult(_0x2d7a09,_0x4dc583){return function(_0x510823){if(_0x510823){var _0xb3c92a=typeof _0x4dc583['offset']===_0x8750('0x1e')&&typeof _0x4dc583[_0x8750('0x1f')]===_0x8750('0x1e');var _0x174810=_0x510823[_0x8750('0x20')];var _0x436861=_0xb3c92a?0x0:_0x4dc583[_0x8750('0x21')];var _0xd1bd70=_0xb3c92a?_0x510823[_0x8750('0x20')]:_0x4dc583[_0x8750('0x21')]+_0x4dc583['limit'];var _0x40c642;if(_0xd1bd70>=_0x174810){_0xd1bd70=_0x174810;_0x40c642=0xc8;}else{_0x40c642=0xce;}_0x2d7a09[_0x8750('0x1b')](_0x40c642);return _0x2d7a09['set'](_0x8750('0x22'),_0x436861+'-'+_0xd1bd70+'/'+_0x174810)[_0x8750('0x1d')](_0x510823);}return null;};}function patchUpdates(_0x758cd2){return function(_0xa66740){try{jsonpatch[_0x8750('0x23')](_0xa66740,_0x758cd2,!![]);}catch(_0x5048b0){return BPromise['reject'](_0x5048b0);}return _0xa66740['save']();};}function saveUpdates(_0x398526,_0x2b653a){return function(_0x270db7){if(_0x270db7){return _0x270db7[_0x8750('0x24')](_0x398526)[_0x8750('0x25')](function(_0x3ca994){return _0x3ca994;});}return null;};}function removeEntity(_0x68eee7,_0x3e4dfa){return function(_0xacdf1f){if(_0xacdf1f){return _0xacdf1f[_0x8750('0x26')]()[_0x8750('0x25')](function(){_0x68eee7['status'](0xcc)[_0x8750('0x1c')]();});}};}function handleEntityNotFound(_0x59b9a3,_0x408713){return function(_0x2169aa){if(!_0x2169aa){_0x59b9a3[_0x8750('0x1a')](0x194);}return _0x2169aa;};}function handleError(_0x756cbc,_0x5aae52){_0x5aae52=_0x5aae52||0x1f4;return function(_0x17d944){logger[_0x8750('0x27')](_0x17d944['stack']);if(_0x17d944[_0x8750('0x28')]){delete _0x17d944[_0x8750('0x28')];}_0x756cbc['status'](_0x5aae52)['send'](_0x17d944);};}exports[_0x8750('0x29')]=function(_0x308e6a,_0x4ffe6e){var _0x105fac={},_0x4c0ea2={},_0x551163={'count':0x0,'rows':[]};var _0x518ac1=_[_0x8750('0x2a')](db[_0x8750('0x2b')][_0x8750('0x2c')],function(_0x52bc07){return{'name':_0x52bc07['fieldName'],'type':_0x52bc07[_0x8750('0x2d')]['key']};});_0x4c0ea2['model']=_[_0x8750('0x2a')](_0x518ac1,_0x8750('0x28'));_0x4c0ea2[_0x8750('0x2e')]=_[_0x8750('0x2f')](_0x308e6a[_0x8750('0x2e')]);_0x4c0ea2[_0x8750('0x30')]=_[_0x8750('0x31')](_0x4c0ea2[_0x8750('0x32')],_0x4c0ea2[_0x8750('0x2e')]);_0x105fac[_0x8750('0x33')]=_[_0x8750('0x31')](_0x4c0ea2[_0x8750('0x32')],qs[_0x8750('0x34')](_0x308e6a[_0x8750('0x2e')][_0x8750('0x34')]));_0x105fac[_0x8750('0x33')]=_0x105fac[_0x8750('0x33')]['length']?_0x105fac['attributes']:_0x4c0ea2[_0x8750('0x32')];if(!_0x308e6a['query'][_0x8750('0x35')]('nolimit')){_0x105fac[_0x8750('0x1f')]=qs['limit'](_0x308e6a[_0x8750('0x2e')][_0x8750('0x1f')]);_0x105fac['offset']=qs[_0x8750('0x21')](_0x308e6a[_0x8750('0x2e')]['offset']);}_0x105fac[_0x8750('0x36')]=qs[_0x8750('0x37')](_0x308e6a['query']['sort']);_0x105fac[_0x8750('0x38')]=qs['filters'](_[_0x8750('0x39')](_0x308e6a[_0x8750('0x2e')],_0x4c0ea2[_0x8750('0x30')]),_0x518ac1);if(_0x308e6a[_0x8750('0x2e')]['filter']){_0x105fac['where']=_[_0x8750('0x3a')](_0x105fac[_0x8750('0x38')],{'$or':_[_0x8750('0x2a')](_0x518ac1,function(_0x3891ef){if(_0x3891ef[_0x8750('0x2d')]!==_0x8750('0x3b')){var _0xbc72dc={};_0xbc72dc[_0x3891ef['name']]={'$like':'%'+_0x308e6a[_0x8750('0x2e')][_0x8750('0x3c')]+'%'};return _0xbc72dc;}})});}_0x105fac=_[_0x8750('0x3a')]({},_0x105fac,_0x308e6a['options']);var _0x307eef={'where':_0x105fac['where']};return db[_0x8750('0x2b')][_0x8750('0x20')](_0x307eef)[_0x8750('0x25')](function(_0x445ccc){_0x551163[_0x8750('0x20')]=_0x445ccc;if(_0x308e6a[_0x8750('0x2e')][_0x8750('0x3d')]){_0x105fac[_0x8750('0x3e')]=[{'all':!![]}];}return db[_0x8750('0x2b')][_0x8750('0x3f')](_0x105fac);})['then'](function(_0x36265c){_0x551163[_0x8750('0x40')]=_0x36265c;return _0x551163;})['then'](respondWithFilteredResult(_0x4ffe6e,_0x105fac))[_0x8750('0x41')](handleError(_0x4ffe6e,null));};exports[_0x8750('0x42')]=function(_0x5e6db2,_0x17ad48){var _0x3d38df={'raw':!![],'where':{'id':_0x5e6db2['params']['id']}},_0x383ea0={};_0x383ea0[_0x8750('0x32')]=_[_0x8750('0x2f')](db[_0x8750('0x2b')][_0x8750('0x2c')]);_0x383ea0[_0x8750('0x2e')]=_['keys'](_0x5e6db2[_0x8750('0x2e')]);_0x383ea0[_0x8750('0x30')]=_[_0x8750('0x31')](_0x383ea0[_0x8750('0x32')],_0x383ea0[_0x8750('0x2e')]);_0x3d38df[_0x8750('0x33')]=_['intersection'](_0x383ea0['model'],qs['fields'](_0x5e6db2[_0x8750('0x2e')][_0x8750('0x34')]));_0x3d38df[_0x8750('0x33')]=_0x3d38df[_0x8750('0x33')][_0x8750('0x43')]?_0x3d38df['attributes']:_0x383ea0[_0x8750('0x32')];if(_0x5e6db2[_0x8750('0x2e')][_0x8750('0x3d')]){_0x3d38df[_0x8750('0x3e')]=[{'all':!![]}];}_0x3d38df=_[_0x8750('0x3a')]({},_0x3d38df,_0x5e6db2[_0x8750('0x44')]);return db['OpenchannelApplication'][_0x8750('0x45')](_0x3d38df)[_0x8750('0x25')](handleEntityNotFound(_0x17ad48,null))[_0x8750('0x25')](respondWithResult(_0x17ad48,null))[_0x8750('0x41')](handleError(_0x17ad48,null));};exports[_0x8750('0x46')]=function(_0x2441b5,_0x2ad887){return db[_0x8750('0x2b')][_0x8750('0x46')](_0x2441b5[_0x8750('0x47')],{})[_0x8750('0x25')](respondWithResult(_0x2ad887,0xc9))['catch'](handleError(_0x2ad887,null));};exports['update']=function(_0x1fd372,_0x1161d3){if(_0x1fd372['body']['id']){delete _0x1fd372[_0x8750('0x47')]['id'];}return db[_0x8750('0x2b')][_0x8750('0x45')]({'where':{'id':_0x1fd372[_0x8750('0x48')]['id']}})[_0x8750('0x25')](handleEntityNotFound(_0x1161d3,null))[_0x8750('0x25')](saveUpdates(_0x1fd372[_0x8750('0x47')],null))[_0x8750('0x25')](respondWithResult(_0x1161d3,null))[_0x8750('0x41')](handleError(_0x1161d3,null));};exports['destroy']=function(_0x2251b5,_0x1e4738){return db[_0x8750('0x2b')][_0x8750('0x45')]({'where':{'id':_0x2251b5[_0x8750('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e4738,null))['then'](removeEntity(_0x1e4738,null))['catch'](handleError(_0x1e4738,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 553b0d6..b4b6350 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 _0x0216=['rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1aa51d,_0x25e458){var _0x55ba13=function(_0x5939a8){while(--_0x5939a8){_0x1aa51d['push'](_0x1aa51d['shift']());}};_0x55ba13(++_0x25e458);}(_0x0216,0x165));var _0x6021=function(_0x282de7,_0x3b688d){_0x282de7=_0x282de7-0x0;var _0x46ad7a=_0x0216[_0x282de7];return _0x46ad7a;};'use strict';var _=require(_0x6021('0x0'));var util=require(_0x6021('0x1'));var logger=require(_0x6021('0x2'))(_0x6021('0x3'));var moment=require(_0x6021('0x4'));var BPromise=require(_0x6021('0x5'));var rp=require(_0x6021('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6021('0x7'));var config=require('../../config/environment');var attributes=require(_0x6021('0x8'));module['exports']=function(_0x5b4bdd,_0x5d429b){return _0x5b4bdd[_0x6021('0x9')](_0x6021('0xa'),attributes,{'tableName':_0x6021('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6021('0xc'),'collate':_0x6021('0xd')});}; \ No newline at end of file +var _0x2317=['exports','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x1411f0,_0x41341b){var _0x5171af=function(_0x983316){while(--_0x983316){_0x1411f0['push'](_0x1411f0['shift']());}};_0x5171af(++_0x41341b);}(_0x2317,0xad));var _0x7231=function(_0x224e21,_0x5b0bb5){_0x224e21=_0x224e21-0x0;var _0x422e1f=_0x2317[_0x224e21];return _0x422e1f;};'use strict';var _=require(_0x7231('0x0'));var util=require(_0x7231('0x1'));var logger=require('../../config/logger')(_0x7231('0x2'));var moment=require(_0x7231('0x3'));var BPromise=require(_0x7231('0x4'));var rp=require(_0x7231('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7231('0x6'));var config=require(_0x7231('0x7'));var attributes=require(_0x7231('0x8'));module[_0x7231('0x9')]=function(_0x26abb1,_0x4e9277){return _0x26abb1['define'](_0x7231('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7231('0xb'),'collate':_0x7231('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 9dcaa34..7efa141 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 _0x0c7e=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelApplication','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x0c7e,0x1c2));var _0xe0c7=function(_0x58893a,_0x51f966){_0x58893a=_0x58893a-0x0;var _0x936f20=_0x0c7e[_0x58893a];return _0x936f20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe0c7('0x0'));var BPromise=require('bluebird');var rs=require(_0xe0c7('0x1'));var fs=require('fs');var Redis=require(_0xe0c7('0x2'));var db=require(_0xe0c7('0x3'))['db'];var utils=require(_0xe0c7('0x4'));var logger=require(_0xe0c7('0x5'))(_0xe0c7('0x6'));var config=require(_0xe0c7('0x7'));var jayson=require(_0xe0c7('0x8'));var client=jayson[_0xe0c7('0x9')][_0xe0c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd55206,_0x324492,_0x3e578b){return new BPromise(function(_0x5a5b31,_0x5bd630){return client[_0xe0c7('0xb')](_0xd55206,_0x3e578b)[_0xe0c7('0xc')](function(_0x5dc754){logger[_0xe0c7('0xd')](_0xe0c7('0xe'),_0x324492,_0xe0c7('0xf'));logger[_0xe0c7('0x10')](_0xe0c7('0x11'),_0x324492,_0xe0c7('0xf'),JSON[_0xe0c7('0x12')](_0x5dc754));if(_0x5dc754[_0xe0c7('0x13')]){if(_0x5dc754['error']['code']===0x1f4){logger[_0xe0c7('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x324492,_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);return _0x5bd630(_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);}logger[_0xe0c7('0x13')](_0xe0c7('0xe'),_0x324492,_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);return _0x5a5b31(_0x5dc754[_0xe0c7('0x13')][_0xe0c7('0x14')]);}else{logger[_0xe0c7('0xd')](_0xe0c7('0xe'),_0x324492,'request\x20sent');_0x5a5b31(_0x5dc754[_0xe0c7('0x15')][_0xe0c7('0x14')]);}})[_0xe0c7('0x16')](function(_0x688ed1){logger['error'](_0xe0c7('0xe'),_0x324492,_0x688ed1);_0x5bd630(_0x688ed1);});});}exports['UpdateOpenchannelApplication']=function(_0x3d08ea){var _0x4bddea=this;return new Promise(function(_0xdd89ac,_0x482cd9){return db[_0xe0c7('0x17')][_0xe0c7('0x18')](_0x3d08ea['body'],{'raw':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1b')]||null:null,'attributes':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea[_0xe0c7('0x19')][_0xe0c7('0x1c')]||null:null,'limit':_0x3d08ea[_0xe0c7('0x19')]?_0x3d08ea['options'][_0xe0c7('0x1d')]||null:null})[_0xe0c7('0xc')](function(_0x1870ea){logger[_0xe0c7('0xd')]('UpdateOpenchannelApplication',_0x3d08ea);logger[_0xe0c7('0x10')](_0xe0c7('0x1e'),_0x3d08ea,JSON['stringify'](_0x1870ea));_0xdd89ac(_0x1870ea);})[_0xe0c7('0x16')](function(_0x43b7c2){logger[_0xe0c7('0x13')](_0xe0c7('0x1e'),_0x43b7c2['message'],_0x3d08ea);_0x482cd9(_0x4bddea['error'](0x1f4,_0x43b7c2['message']));});});}; \ No newline at end of file +var _0x5197=['options','raw','where','limit','then','UpdateOpenchannelApplication','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0x5197,0x1f3));var _0x7519=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x5197[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0x7519('0x0'));var moment=require('moment');var BPromise=require(_0x7519('0x1'));var rs=require(_0x7519('0x2'));var fs=require('fs');var Redis=require(_0x7519('0x3'));var db=require(_0x7519('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7519('0x5'))(_0x7519('0x6'));var config=require('../../config/environment');var jayson=require(_0x7519('0x7'));var client=jayson[_0x7519('0x8')][_0x7519('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c90f2,_0x4226b9,_0x20fe9a){return new BPromise(function(_0x39379d,_0xdecc17){return client[_0x7519('0xa')](_0x2c90f2,_0x20fe9a)['then'](function(_0x5811fc){logger[_0x7519('0xb')](_0x7519('0xc'),_0x4226b9,_0x7519('0xd'));logger[_0x7519('0xe')](_0x7519('0xf'),_0x4226b9,_0x7519('0xd'),JSON[_0x7519('0x10')](_0x5811fc));if(_0x5811fc[_0x7519('0x11')]){if(_0x5811fc[_0x7519('0x11')][_0x7519('0x12')]===0x1f4){logger[_0x7519('0x11')](_0x7519('0xc'),_0x4226b9,_0x5811fc['error'][_0x7519('0x13')]);return _0xdecc17(_0x5811fc[_0x7519('0x11')][_0x7519('0x13')]);}logger[_0x7519('0x11')](_0x7519('0xc'),_0x4226b9,_0x5811fc[_0x7519('0x11')][_0x7519('0x13')]);return _0x39379d(_0x5811fc[_0x7519('0x11')][_0x7519('0x13')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x4226b9,'request\x20sent');_0x39379d(_0x5811fc[_0x7519('0x14')][_0x7519('0x13')]);}})[_0x7519('0x15')](function(_0x435a46){logger[_0x7519('0x11')](_0x7519('0xc'),_0x4226b9,_0x435a46);_0xdecc17(_0x435a46);});});}exports['UpdateOpenchannelApplication']=function(_0x36a02e){var _0x18af6f=this;return new Promise(function(_0x40da66,_0x24849c){return db['OpenchannelApplication']['update'](_0x36a02e[_0x7519('0x16')],{'raw':_0x36a02e[_0x7519('0x17')]?_0x36a02e[_0x7519('0x17')][_0x7519('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36a02e[_0x7519('0x17')]?_0x36a02e[_0x7519('0x17')][_0x7519('0x19')]||null:null,'attributes':_0x36a02e[_0x7519('0x17')]?_0x36a02e[_0x7519('0x17')]['attributes']||null:null,'limit':_0x36a02e[_0x7519('0x17')]?_0x36a02e['options'][_0x7519('0x1a')]||null:null})[_0x7519('0x1b')](function(_0x3e1549){logger['info']('UpdateOpenchannelApplication',_0x36a02e);logger['debug'](_0x7519('0x1c'),_0x36a02e,JSON[_0x7519('0x10')](_0x3e1549));_0x40da66(_0x3e1549);})['catch'](function(_0xc3217d){logger[_0x7519('0x11')]('UpdateOpenchannelApplication',_0xc3217d[_0x7519('0x13')],_0x36a02e);_0x24849c(_0x18af6f[_0x7519('0x11')](0x1f4,_0xc3217d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 09b696f..9ee3555 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 _0x01f4=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','getMessages','/:id/download','download','create','/:id/messages','addMessage','post','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','tracked','openchannelinteraction:destroy','delete','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e00fa,_0x178628){var _0x252563=function(_0x5e9267){while(--_0x5e9267){_0x5e00fa['push'](_0x5e00fa['shift']());}};_0x252563(++_0x178628);}(_0x01f4,0x165));var _0x401f=function(_0x278636,_0x5d305f){_0x278636=_0x278636-0x0;var _0x20e87e=_0x01f4[_0x278636];return _0x20e87e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x401f('0x0'));var timeout=require(_0x401f('0x1'));var express=require(_0x401f('0x2'));var router=express[_0x401f('0x3')]();var fs_extra=require(_0x401f('0x4'));var auth=require(_0x401f('0x5'));var interaction=require(_0x401f('0x6'));var config=require(_0x401f('0x7'));var controller=require(_0x401f('0x8'));router[_0x401f('0x9')]('/',auth['isAuthenticated'](),controller[_0x401f('0xa')]);router[_0x401f('0x9')](_0x401f('0xb'),auth[_0x401f('0xc')](),controller[_0x401f('0xd')]);router['get']('/:id',auth[_0x401f('0xc')](),controller[_0x401f('0xe')]);router[_0x401f('0x9')]('/:id/messages',auth[_0x401f('0xc')](),controller[_0x401f('0xf')]);router[_0x401f('0x9')](_0x401f('0x10'),auth['isAuthenticated'](),controller[_0x401f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x401f('0x12')]);router['post'](_0x401f('0x13'),auth[_0x401f('0xc')](),controller[_0x401f('0x14')]);router[_0x401f('0x15')](_0x401f('0x16'),auth[_0x401f('0xc')](),interaction['tracked'](_0x401f('0x17'),_0x401f('0x18')),controller[_0x401f('0x19')]);router['put'](_0x401f('0x1a'),auth[_0x401f('0xc')](),interaction['tracked'](_0x401f('0x17'),_0x401f('0x1b')),controller[_0x401f('0x1c')]);router['delete'](_0x401f('0x1a'),auth[_0x401f('0xc')](),interaction[_0x401f('0x1d')](_0x401f('0x17'),_0x401f('0x1e')),controller['destroy']);router[_0x401f('0x1f')]('/:id/tags',auth[_0x401f('0xc')](),controller[_0x401f('0x20')]);module['exports']=router; \ No newline at end of file +var _0xadea=['/:id/tags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','tracked','openchannel','addTags','put','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xadea,0x109));var _0xaade=function(_0x3050b5,_0x182c6a){_0x3050b5=_0x3050b5-0x0;var _0x37cceb=_0xadea[_0x3050b5];return _0x37cceb;};'use strict';var multer=require(_0xaade('0x0'));var util=require(_0xaade('0x1'));var path=require(_0xaade('0x2'));var timeout=require(_0xaade('0x3'));var express=require(_0xaade('0x4'));var router=express[_0xaade('0x5')]();var fs_extra=require(_0xaade('0x6'));var auth=require(_0xaade('0x7'));var interaction=require(_0xaade('0x8'));var config=require(_0xaade('0x9'));var controller=require(_0xaade('0xa'));router[_0xaade('0xb')]('/',auth['isAuthenticated'](),controller[_0xaade('0xc')]);router[_0xaade('0xb')](_0xaade('0xd'),auth[_0xaade('0xe')](),controller[_0xaade('0xf')]);router[_0xaade('0xb')]('/:id',auth[_0xaade('0xe')](),controller[_0xaade('0x10')]);router[_0xaade('0xb')](_0xaade('0x11'),auth[_0xaade('0xe')](),controller[_0xaade('0x12')]);router[_0xaade('0xb')](_0xaade('0x13'),auth['isAuthenticated'](),controller[_0xaade('0x14')]);router[_0xaade('0x15')]('/',auth[_0xaade('0xe')](),controller['create']);router[_0xaade('0x15')](_0xaade('0x11'),auth[_0xaade('0xe')](),controller['addMessage']);router[_0xaade('0x15')]('/:id/tags',auth[_0xaade('0xe')](),interaction[_0xaade('0x16')](_0xaade('0x17'),'openchannelinteraction:addtags'),controller[_0xaade('0x18')]);router[_0xaade('0x19')](_0xaade('0x1a'),auth[_0xaade('0xe')](),interaction[_0xaade('0x16')](_0xaade('0x17'),_0xaade('0x1b')),controller[_0xaade('0x1c')]);router[_0xaade('0x1d')](_0xaade('0x1a'),auth['isAuthenticated'](),interaction[_0xaade('0x16')]('openchannel',_0xaade('0x1e')),controller[_0xaade('0x1f')]);router[_0xaade('0x1d')](_0xaade('0x20'),auth[_0xaade('0xe')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 752e7cc..53c2ff7 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 _0xf675=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0xf675,0x199));var _0x5f67=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xf675[_0x564e9f];return _0x3a9f3e;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'closed':{'type':Sequelize[_0x5f67('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5f67('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5f67('0x3')]},'note':{'type':Sequelize[_0x5f67('0x3')]},'read1stAt':{'type':Sequelize[_0x5f67('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x5f67('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5f67('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5f67('0x5')]('in',_0x5f67('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5f67('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5f67('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd4b6=['STRING','ENUM','out','BOOLEAN','sequelize','exports','DATE'];(function(_0x52dc13,_0x5813c2){var _0x1143e7=function(_0x4c0a4c){while(--_0x4c0a4c){_0x52dc13['push'](_0x52dc13['shift']());}};_0x1143e7(++_0x5813c2);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x5c605b,_0x2e9514){_0x5c605b=_0x5c605b-0x0;var _0x4d2730=_0xd4b6[_0x5c605b];return _0x4d2730;};'use strict';var Sequelize=require(_0x6d4b('0x0'));module[_0x6d4b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6d4b('0x2')]},'disposition':{'type':Sequelize[_0x6d4b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6d4b('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x6d4b('0x3')]},'lastMsgAt':{'type':Sequelize[_0x6d4b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6d4b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6d4b('0x4')]('in',_0x6d4b('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6d4b('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x6d4b('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index bef971a..58546b0 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 _0xed2b=['length','include','options','find','catch','create','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','color','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','Openchannel','format','closed','closedAt','disposition','Private','createWriteStream','basename','out','System','Contact','value','renderFile','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','update','then','destroy','sendStatus','error','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','query','user','show','from','params','keys','filters','intersection','model','attributes','fields'];(function(_0x509049,_0x3615d0){var _0x1cdfda=function(_0x4994d4){while(--_0x4994d4){_0x509049['push'](_0x509049['shift']());}};_0x1cdfda(++_0x3615d0);}(_0xed2b,0x1b3));var _0xbed2=function(_0x5659c0,_0x5f2532){_0x5659c0=_0x5659c0-0x0;var _0x36e3c0=_0xed2b[_0x5659c0];return _0x36e3c0;};'use strict';var rimraf=require(_0xbed2('0x0'));var zipdir=require(_0xbed2('0x1'));var moment=require('moment');var util=require(_0xbed2('0x2'));var path=require(_0xbed2('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbed2('0x4'));var Redis=require(_0xbed2('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xbed2('0x6'));var pdf=require(_0xbed2('0x7'));var logger=require(_0xbed2('0x8'))(_0xbed2('0x9'));var config=require(_0xbed2('0xa'));var db=require(_0xbed2('0xb'))['db'];config[_0xbed2('0xc')]=_[_0xbed2('0xd')](config[_0xbed2('0xc')],{'host':_0xbed2('0xe'),'port':0x18eb});var socket=require(_0xbed2('0xf'))(new Redis(config[_0xbed2('0xc')]));require('./openchannelInteraction.socket')[_0xbed2('0x10')](socket);function respondWithStatusCode(_0x5df24c,_0x6cffd4){_0x6cffd4=_0x6cffd4||0xcc;return function(_0x6ad293){if(_0x6ad293){return _0x5df24c['sendStatus'](_0x6cffd4);}return _0x5df24c[_0xbed2('0x11')](_0x6cffd4)[_0xbed2('0x12')]();};}function respondWithResult(_0x4c2c91,_0x3634a8){_0x3634a8=_0x3634a8||0xc8;return function(_0xee997a){if(_0xee997a){return _0x4c2c91[_0xbed2('0x11')](_0x3634a8)[_0xbed2('0x13')](_0xee997a);}};}function respondWithFilteredResult(_0x58d487,_0x460558){return function(_0x2f2c70){if(_0x2f2c70){var _0x34a4a8=typeof _0x460558[_0xbed2('0x14')]===_0xbed2('0x15')&&typeof _0x460558['limit']===_0xbed2('0x15');var _0x408da3=_0x2f2c70[_0xbed2('0x16')];var _0x4693d4=_0x34a4a8?0x0:_0x460558[_0xbed2('0x14')];var _0x362362=_0x34a4a8?_0x2f2c70[_0xbed2('0x16')]:_0x460558[_0xbed2('0x14')]+_0x460558[_0xbed2('0x17')];var _0x5ccc69;if(_0x362362>=_0x408da3){_0x362362=_0x408da3;_0x5ccc69=0xc8;}else{_0x5ccc69=0xce;}_0x58d487[_0xbed2('0x11')](_0x5ccc69);return _0x58d487['set']('Content-Range',_0x4693d4+'-'+_0x362362+'/'+_0x408da3)[_0xbed2('0x13')](_0x2f2c70);}return null;};}function saveUpdates(_0x103145){return function(_0x58a2b6){if(_0x58a2b6){return _0x58a2b6[_0xbed2('0x18')](_0x103145)[_0xbed2('0x19')](function(_0x3a3b13){return _0x3a3b13;});}return null;};}function removeEntity(_0x2b47b8){return function(_0x2755ac){if(_0x2755ac){return _0x2755ac[_0xbed2('0x1a')]()['then'](function(){_0x2b47b8['status'](0xcc)[_0xbed2('0x12')]();});}};}function handleEntityNotFound(_0x4a8cee){return function(_0x7703f0){if(!_0x7703f0){_0x4a8cee[_0xbed2('0x1b')](0x194);}return _0x7703f0;};}function handleError(_0x58b826,_0x2f1211){_0x2f1211=_0x2f1211||0x1f4;return function(_0x37ca49){logger[_0xbed2('0x1c')](_0x37ca49[_0xbed2('0x1d')]);if(_0x37ca49[_0xbed2('0x1e')]){delete _0x37ca49[_0xbed2('0x1e')];}_0x58b826[_0xbed2('0x11')](_0x2f1211)['send'](_0x37ca49);};}exports[_0xbed2('0x1f')]=function(_0x7480eb,_0x334707){var _0x343b1b={};var _0x1d0d8a=_['map'](db[_0xbed2('0x20')][_0xbed2('0x21')],function(_0x3133a8){return{'name':_0x3133a8[_0xbed2('0x22')],'type':_0x3133a8[_0xbed2('0x23')][_0xbed2('0x24')]};});_0x343b1b=qs['getOptions'](_0x1d0d8a,_0x7480eb);return interaction[_0xbed2('0x25')]('openchannel',_0x7480eb[_0xbed2('0x26')],_0x7480eb[_0xbed2('0x27')],_0x343b1b,_0x1d0d8a)[_0xbed2('0x19')](respondWithFilteredResult(_0x334707,_0x343b1b))['catch'](handleError(_0x334707,null));};exports[_0xbed2('0x28')]=function(_0x58551e,_0x4897e9){var _0x32872b={};if(_0x58551e[_0xbed2('0x26')][_0xbed2('0x23')]&&_0x58551e[_0xbed2('0x26')][_0xbed2('0x23')]===_0xbed2('0x29')){_0x32872b[_0xbed2('0x29')]=_0x58551e[_0xbed2('0x2a')]['id'];}else{_0x32872b['id']=_0x58551e[_0xbed2('0x2a')]['id'];}var _0xc847c2={'raw':![],'where':_0x32872b},_0x41d9c5={};_0x41d9c5['model']=_[_0xbed2('0x2b')](db['OpenchannelInteraction'][_0xbed2('0x21')]);_0x41d9c5[_0xbed2('0x26')]=_[_0xbed2('0x2b')](_0x58551e[_0xbed2('0x26')]);_0x41d9c5[_0xbed2('0x2c')]=_[_0xbed2('0x2d')](_0x41d9c5[_0xbed2('0x2e')],_0x41d9c5[_0xbed2('0x26')]);_0xc847c2[_0xbed2('0x2f')]=_['intersection'](_0x41d9c5[_0xbed2('0x2e')],qs[_0xbed2('0x30')](_0x58551e[_0xbed2('0x26')][_0xbed2('0x30')]));_0xc847c2[_0xbed2('0x2f')]=_0xc847c2[_0xbed2('0x2f')][_0xbed2('0x31')]?_0xc847c2[_0xbed2('0x2f')]:_0x41d9c5[_0xbed2('0x2e')];if(_0x58551e[_0xbed2('0x26')]['includeAll']){_0xc847c2[_0xbed2('0x32')]=[{'all':!![]}];}_0xc847c2=_['merge']({},_0xc847c2,_0x58551e[_0xbed2('0x33')]);return db[_0xbed2('0x20')][_0xbed2('0x34')](_0xc847c2)[_0xbed2('0x19')](handleEntityNotFound(_0x4897e9,null))['then'](respondWithResult(_0x4897e9,null))[_0xbed2('0x35')](handleError(_0x4897e9,null));};exports['create']=function(_0x4d3920,_0xe099ad){return db[_0xbed2('0x20')][_0xbed2('0x36')](_0x4d3920[_0xbed2('0x37')],{})[_0xbed2('0x19')](respondWithResult(_0xe099ad,0xc9))['catch'](handleError(_0xe099ad,null));};exports[_0xbed2('0x18')]=function(_0x268183,_0x1ba2dc){if(_0x268183[_0xbed2('0x37')]['id']){delete _0x268183[_0xbed2('0x37')]['id'];}return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x268183[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x1ba2dc,null))[_0xbed2('0x19')](saveUpdates(_0x268183['body'],null))[_0xbed2('0x19')](respondWithResult(_0x1ba2dc,null))[_0xbed2('0x35')](handleError(_0x1ba2dc,null));};exports[_0xbed2('0x1a')]=function(_0x434511,_0x48c2bc){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x434511[_0xbed2('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48c2bc,null))[_0xbed2('0x19')](removeEntity(_0x48c2bc,null))['catch'](handleError(_0x48c2bc,null));};exports[_0xbed2('0x38')]=function(_0xa556e8,_0x482328){return db['OpenchannelInteraction']['describe']()[_0xbed2('0x19')](respondWithResult(_0x482328,null))[_0xbed2('0x35')](handleError(_0x482328,null));};exports['addMessage']=function(_0x13fa7e,_0x2c9fa2){return db[_0xbed2('0x39')][_0xbed2('0x34')]({'where':{'id':_0x13fa7e[_0xbed2('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2c9fa2,null))[_0xbed2('0x19')](function(_0xfa2fd0){if(_0xfa2fd0){return _0xfa2fd0[_0xbed2('0x3a')](_0x13fa7e[_0xbed2('0x37')][_0xbed2('0x3b')],_[_0xbed2('0x3c')](_0x13fa7e[_0xbed2('0x37')],[_0xbed2('0x3b'),'id'])||{});}})[_0xbed2('0x19')](respondWithResult(_0x2c9fa2,null))[_0xbed2('0x35')](handleError(_0x2c9fa2,null));};exports[_0xbed2('0x3d')]=function(_0x157be6,_0x56dca0){var _0x4afa02={'raw':![],'where':{}};var _0x3a43a4={};var _0x1e007c={'count':0x0,'rows':[]};return db[_0xbed2('0x20')][_0xbed2('0x3e')]({'where':{'id':_0x157be6[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x56dca0,null))[_0xbed2('0x19')](function(_0x7e764d){if(_0x7e764d){_0x3a43a4[_0xbed2('0x2e')]=_['keys'](db[_0xbed2('0x39')][_0xbed2('0x21')]);_0x3a43a4[_0xbed2('0x26')]=_[_0xbed2('0x2b')](_0x157be6['query']);_0x3a43a4[_0xbed2('0x2c')]=_[_0xbed2('0x2d')](_0x3a43a4[_0xbed2('0x2e')],_0x3a43a4[_0xbed2('0x26')]);_0x4afa02[_0xbed2('0x2f')]=_[_0xbed2('0x2d')](_0x3a43a4['model'],qs[_0xbed2('0x30')](_0x157be6[_0xbed2('0x26')][_0xbed2('0x30')]));_0x4afa02[_0xbed2('0x2f')]=_0x4afa02[_0xbed2('0x2f')]['length']?_0x4afa02[_0xbed2('0x2f')]:_0x3a43a4[_0xbed2('0x2e')];if(!_0x157be6[_0xbed2('0x26')][_0xbed2('0x3f')](_0xbed2('0x40'))){_0x4afa02[_0xbed2('0x17')]=qs['limit'](_0x157be6[_0xbed2('0x26')][_0xbed2('0x17')]);_0x4afa02[_0xbed2('0x14')]=qs['offset'](_0x157be6['query'][_0xbed2('0x14')]);}_0x4afa02[_0xbed2('0x41')]=qs[_0xbed2('0x42')](_0x157be6['query'][_0xbed2('0x42')]);_0x4afa02[_0xbed2('0x43')]=qs[_0xbed2('0x2c')](_[_0xbed2('0x44')](_0x157be6[_0xbed2('0x26')],_0x3a43a4['filters']));_0x4afa02[_0xbed2('0x43')][_0xbed2('0x45')]=_0x7e764d['id'];if(_0x157be6['query'][_0xbed2('0x46')]){_0x4afa02[_0xbed2('0x43')]=_[_0xbed2('0x47')](_0x4afa02['where'],{'$or':_[_0xbed2('0x48')](_0x4afa02['attributes'],function(_0x246bae){var _0xe098bf={};_0xe098bf[_0x246bae]={'$like':'%'+_0x157be6[_0xbed2('0x26')][_0xbed2('0x46')]+'%'};return _0xe098bf;})});}if(_0x157be6[_0xbed2('0x26')][_0xbed2('0x49')]){var _0x58255c=_0x157be6[_0xbed2('0x26')][_0xbed2('0x49')][_0xbed2('0x4a')](',');var _0x261a4e={};_0x261a4e[_0x58255c[0x0]]={'$gte':moment(_0x58255c[0x1])['format'](_0xbed2('0x4b'))};_0x4afa02['where']=_[_0xbed2('0x47')](_0x4afa02[_0xbed2('0x43')],_0x261a4e);}_0x4afa02=_[_0xbed2('0x47')]({},_0x4afa02,_0x157be6[_0xbed2('0x33')]);return db['OpenchannelMessage'][_0xbed2('0x16')]({'where':_0x4afa02['where']})[_0xbed2('0x19')](function(_0x32b1be){_0x1e007c[_0xbed2('0x16')]=_0x32b1be;if(_0x157be6[_0xbed2('0x26')]['includeAll']){_0x4afa02[_0xbed2('0x32')]=[{'all':!![]}];}return db[_0xbed2('0x39')][_0xbed2('0x25')](_0x4afa02);})[_0xbed2('0x19')](function(_0x14c3e5){_0x1e007c['rows']=_0x14c3e5;return _0x1e007c;});}})[_0xbed2('0x19')](respondWithFilteredResult(_0x56dca0,_0x4afa02))[_0xbed2('0x35')](handleError(_0x56dca0,null));};exports[_0xbed2('0x4c')]=function(_0x4e3902,_0x361ece){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x4e3902[_0xbed2('0x2a')]['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x361ece,null))['then'](function(_0x243a2c){if(_0x243a2c){return _0x243a2c[_0xbed2('0x4d')](_0x4e3902[_0xbed2('0x37')][_0xbed2('0x3b')],_[_0xbed2('0x3c')](_0x4e3902[_0xbed2('0x37')],[_0xbed2('0x3b'),'id'])||{})['spread'](function(){return db[_0xbed2('0x4e')]['findAll']({'attributes':['id',_0xbed2('0x1e'),_0xbed2('0x4f')],'where':{'id':_0x4e3902[_0xbed2('0x37')][_0xbed2('0x3b')]}});})[_0xbed2('0x19')](function(_0x29d98b){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4e3902[_0xbed2('0x2a')]['id']),'tags':_0x29d98b||[]});return{'id':Number(_0x4e3902['params']['id']),'tags':_0x29d98b||[]};});}})[_0xbed2('0x19')](respondWithResult(_0x361ece,null))[_0xbed2('0x35')](handleError(_0x361ece,null));};exports['removeTags']=function(_0x117732,_0x41c72d){return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x117732['params']['id']}})[_0xbed2('0x19')](handleEntityNotFound(_0x41c72d,null))[_0xbed2('0x19')](function(_0x5abf5f){if(_0x5abf5f){return _0x5abf5f['removeTags'](_0x117732[_0xbed2('0x26')][_0xbed2('0x3b')]);}})[_0xbed2('0x19')](respondWithStatusCode(_0x41c72d,null))[_0xbed2('0x35')](handleError(_0x41c72d,null));};exports[_0xbed2('0x50')]=function(_0x280d0a,_0x59e2ad){var _0x89d23a=moment()[_0xbed2('0x51')]()[_0xbed2('0x52')]();var _0x5b435e=path['join'](config[_0xbed2('0x53')],_0xbed2('0x54'),_0xbed2('0x55'),_0xbed2('0x56'));var _0x5707e2=path[_0xbed2('0x57')](config['root'],_0xbed2('0x54'),_0xbed2('0x55'),_0xbed2('0x58'));var _0xf01fe3=path[_0xbed2('0x57')](_0x5b435e,_0x89d23a);var _0x1d01a5=util['format'](_0xbed2('0x59'),_0x280d0a[_0xbed2('0x2a')]['id'],_0x89d23a);var _0xe5675f=path[_0xbed2('0x57')](_0x5b435e,_0x1d01a5);var _0x5ae1dc=[];_0x5ae1dc['push']({'model':db['User'],'as':_0xbed2('0x5a'),'attributes':['id',_0xbed2('0x5b')],'raw':!![]});_0x5ae1dc[_0xbed2('0x5c')]({'model':db[_0xbed2('0x5d')],'as':'Contact','attributes':['id',_0xbed2('0x5e'),_0xbed2('0x5f')],'raw':!![]});if(_0x280d0a[_0xbed2('0x26')][_0xbed2('0x58')]){_0x5ae1dc[_0xbed2('0x5c')]({'model':db['Attachment'],'as':_0xbed2('0x60'),'raw':!![]});}var _0x5a2132=[{'model':db[_0xbed2('0x39')],'as':_0xbed2('0x61'),'attributes':['id',_0xbed2('0x37'),_0xbed2('0x62'),_0xbed2('0x63'),_0xbed2('0x64'),_0xbed2('0x65')],'include':_0x5ae1dc}];_0x5a2132[_0xbed2('0x5c')]({'model':db['OpenchannelAccount'],'as':_0xbed2('0x66'),'attributes':['id',_0xbed2('0x1e')]});_0x5a2132[_0xbed2('0x5c')]({'model':db[_0xbed2('0x5a')],'as':_0xbed2('0x67'),'attributes':['id','fullname']});return db[_0xbed2('0x20')][_0xbed2('0x34')]({'where':{'id':_0x280d0a['params']['id']},'include':_0x5a2132})[_0xbed2('0x19')](handleEntityNotFound(_0x59e2ad,null))['then'](function(_0x367220){if(_0x367220){var _0x38199f=_0x367220[_0xbed2('0x68')]({'plain':!![]});fs['mkdirSync'](_0xf01fe3);var _0x22643c={'channel':_0xbed2('0x69'),'account':_0x38199f[_0xbed2('0x66')][_0xbed2('0x1e')],'agent':_0x38199f['Owner']?_0x38199f[_0xbed2('0x67')][_0xbed2('0x5b')]:'N.A.','createdAt':moment(_0x38199f['createdAt'])[_0xbed2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x38199f[_0xbed2('0x6b')]?moment(_0x38199f[_0xbed2('0x6c')])['format'](_0xbed2('0x4b'))[_0xbed2('0x52')]():'','disposition':_0x38199f[_0xbed2('0x6d')],'visibility':_0x38199f['threadId']?'Public':_0xbed2('0x6e'),'messages':_(_0x38199f[_0xbed2('0x61')])['filter']({'secret':![]})['map'](function(_0x2600fb){if(_0x2600fb[_0xbed2('0x60')]){var _0x463423=path[_0xbed2('0x57')](_0x5707e2,_0x2600fb['Attachment']['basename']);if(fs['existsSync'](_0x463423)){fs['createReadStream'](_0x463423)['pipe'](fs[_0xbed2('0x6f')](path['join'](_0xf01fe3,_0x2600fb[_0xbed2('0x60')][_0xbed2('0x70')])));}}return{'date':moment(_0x2600fb[_0xbed2('0x62')])[_0xbed2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbed2('0x52')](),'sender':_0x2600fb[_0xbed2('0x63')]===_0xbed2('0x71')?_0x2600fb[_0xbed2('0x5a')]?_0x2600fb[_0xbed2('0x5a')][_0xbed2('0x5b')]:_0xbed2('0x72'):_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5e')]+(_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5f')]?'\x20'+_0x2600fb[_0xbed2('0x73')][_0xbed2('0x5f')]:''),'body':_0x2600fb['Attachment']?_0x2600fb['Attachment'][_0xbed2('0x70')]:_0x2600fb[_0xbed2('0x37')],'direction':_0x2600fb[_0xbed2('0x63')]===_0xbed2('0x71')?'A':'C','secret':_0x2600fb[_0xbed2('0x64')],'read':_0x2600fb[_0xbed2('0x65')],'attachment':_0x2600fb[_0xbed2('0x60')]};})[_0xbed2('0x74')]()};return ejs[_0xbed2('0x75')](path[_0xbed2('0x57')](config[_0xbed2('0x53')],'server','views','downloadInteraction.ejs'),{'interaction':_0x22643c})['then'](function(_0x185711){var _0x137207=path[_0xbed2('0x57')](_0xf01fe3,_0xbed2('0x76')+_0x38199f['id']+'-'+_0x89d23a+'.pdf');var _0x437330={'path':_0x137207,'channel':_0xbed2('0x69'),'interactionId':_0x38199f['id']};return pdf[_0xbed2('0x77')](_0x185711,_0x437330);})[_0xbed2('0x19')](function(){return new Promise(function(_0x31f888,_0x5c5626){zipdir(_0xf01fe3,{'saveTo':_0xe5675f},function(_0x14b2c4,_0x297512){if(_0x14b2c4)return _0x5c5626(_0x14b2c4);return _0x31f888(_0x297512);});})[_0xbed2('0x19')](function(){return new Promise(function(_0x6f985f,_0x21bea7){rimraf(_0xf01fe3,function(_0x44a1e9){if(_0x44a1e9)_0x21bea7(_0x44a1e9);return _0x6f985f();});});})[_0xbed2('0x19')](function(){return _0x59e2ad[_0xbed2('0x50')](_0xe5675f,_0x1d01a5,function(_0x1c67f6){if(_0x1c67f6){logger[_0xbed2('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x1c67f6);}else{fs[_0xbed2('0x78')](_0xe5675f);}});});});}else{return _0x59e2ad['sendStatus'](0xc8);}})['catch'](handleError(_0x59e2ad,null));}; \ No newline at end of file +var _0x6b8d=['Private','createReadStream','pipe','createWriteStream','basename','format','out','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','error','rimraf','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','update','then','name','index','map','OpenchannelInteraction','type','key','getOptions','findAll','openchannel','query','user','show','from','params','model','rawAttributes','keys','intersection','attributes','fields','length','includeAll','find','catch','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','filters','pick','OpenchannelInteractionId','filter','where','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','options','include','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','server','files','tmp','join','root','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','get','Openchannel','N.A.','toString','closed','closedAt','disposition','threadId','Public'];(function(_0xe01693,_0x474e53){var _0x568eaf=function(_0x5542f9){while(--_0x5542f9){_0xe01693['push'](_0xe01693['shift']());}};_0x568eaf(++_0x474e53);}(_0x6b8d,0x103));var _0xd6b8=function(_0x53522f,_0x30bb77){_0x53522f=_0x53522f-0x0;var _0x251ad9=_0x6b8d[_0x53522f];return _0x251ad9;};'use strict';var rimraf=require(_0xd6b8('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var util=require(_0xd6b8('0x1'));var path=require('path');var ejs=require(_0xd6b8('0x2'));var fs=require('fs');var _=require(_0xd6b8('0x3'));var Redis=require(_0xd6b8('0x4'));var interaction=require(_0xd6b8('0x5'));var qs=require(_0xd6b8('0x6'));var pdf=require(_0xd6b8('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xd6b8('0x8'));var db=require(_0xd6b8('0x9'))['db'];config['redis']=_['defaults'](config[_0xd6b8('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6b8('0xa')]));require('./openchannelInteraction.socket')[_0xd6b8('0xb')](socket);function respondWithStatusCode(_0x25fdf1,_0x39bbf0){_0x39bbf0=_0x39bbf0||0xcc;return function(_0x33b9af){if(_0x33b9af){return _0x25fdf1[_0xd6b8('0xc')](_0x39bbf0);}return _0x25fdf1[_0xd6b8('0xd')](_0x39bbf0)[_0xd6b8('0xe')]();};}function respondWithResult(_0x584cf7,_0x1e37c3){_0x1e37c3=_0x1e37c3||0xc8;return function(_0x82dab9){if(_0x82dab9){return _0x584cf7[_0xd6b8('0xd')](_0x1e37c3)[_0xd6b8('0xf')](_0x82dab9);}};}function respondWithFilteredResult(_0x346b06,_0x16c4b1){return function(_0x20dca2){if(_0x20dca2){var _0xd9d205=typeof _0x16c4b1['offset']==='undefined'&&typeof _0x16c4b1[_0xd6b8('0x10')]==='undefined';var _0x935218=_0x20dca2[_0xd6b8('0x11')];var _0x55132b=_0xd9d205?0x0:_0x16c4b1[_0xd6b8('0x12')];var _0x4f3930=_0xd9d205?_0x20dca2[_0xd6b8('0x11')]:_0x16c4b1[_0xd6b8('0x12')]+_0x16c4b1['limit'];var _0x370777;if(_0x4f3930>=_0x935218){_0x4f3930=_0x935218;_0x370777=0xc8;}else{_0x370777=0xce;}_0x346b06[_0xd6b8('0xd')](_0x370777);return _0x346b06[_0xd6b8('0x13')](_0xd6b8('0x14'),_0x55132b+'-'+_0x4f3930+'/'+_0x935218)[_0xd6b8('0xf')](_0x20dca2);}return null;};}function saveUpdates(_0x24f21b){return function(_0x44b849){if(_0x44b849){return _0x44b849[_0xd6b8('0x15')](_0x24f21b)['then'](function(_0x3a9b42){return _0x3a9b42;});}return null;};}function removeEntity(_0x8b2761){return function(_0x3be5f0){if(_0x3be5f0){return _0x3be5f0['destroy']()[_0xd6b8('0x16')](function(){_0x8b2761[_0xd6b8('0xd')](0xcc)[_0xd6b8('0xe')]();});}};}function handleEntityNotFound(_0x56142a){return function(_0x18e2f5){if(!_0x18e2f5){_0x56142a[_0xd6b8('0xc')](0x194);}return _0x18e2f5;};}function handleError(_0x34a03f,_0x20b427){_0x20b427=_0x20b427||0x1f4;return function(_0x245adb){logger['error'](_0x245adb['stack']);if(_0x245adb[_0xd6b8('0x17')]){delete _0x245adb[_0xd6b8('0x17')];}_0x34a03f[_0xd6b8('0xd')](_0x20b427)['send'](_0x245adb);};}exports[_0xd6b8('0x18')]=function(_0xe9bbd4,_0x59626e){var _0xbde550={};var _0x9054c9=_[_0xd6b8('0x19')](db[_0xd6b8('0x1a')]['rawAttributes'],function(_0x4fc9a7){return{'name':_0x4fc9a7['fieldName'],'type':_0x4fc9a7[_0xd6b8('0x1b')][_0xd6b8('0x1c')]};});_0xbde550=qs[_0xd6b8('0x1d')](_0x9054c9,_0xe9bbd4);return interaction[_0xd6b8('0x1e')](_0xd6b8('0x1f'),_0xe9bbd4[_0xd6b8('0x20')],_0xe9bbd4[_0xd6b8('0x21')],_0xbde550,_0x9054c9)['then'](respondWithFilteredResult(_0x59626e,_0xbde550))['catch'](handleError(_0x59626e,null));};exports[_0xd6b8('0x22')]=function(_0x146d60,_0x2acc82){var _0x54b766={};if(_0x146d60[_0xd6b8('0x20')][_0xd6b8('0x1b')]&&_0x146d60[_0xd6b8('0x20')]['type']===_0xd6b8('0x23')){_0x54b766['from']=_0x146d60['params']['id'];}else{_0x54b766['id']=_0x146d60[_0xd6b8('0x24')]['id'];}var _0x29f4f5={'raw':![],'where':_0x54b766},_0x3c0ae0={};_0x3c0ae0[_0xd6b8('0x25')]=_['keys'](db[_0xd6b8('0x1a')][_0xd6b8('0x26')]);_0x3c0ae0[_0xd6b8('0x20')]=_[_0xd6b8('0x27')](_0x146d60['query']);_0x3c0ae0['filters']=_[_0xd6b8('0x28')](_0x3c0ae0[_0xd6b8('0x25')],_0x3c0ae0['query']);_0x29f4f5[_0xd6b8('0x29')]=_['intersection'](_0x3c0ae0['model'],qs[_0xd6b8('0x2a')](_0x146d60[_0xd6b8('0x20')][_0xd6b8('0x2a')]));_0x29f4f5[_0xd6b8('0x29')]=_0x29f4f5['attributes'][_0xd6b8('0x2b')]?_0x29f4f5[_0xd6b8('0x29')]:_0x3c0ae0[_0xd6b8('0x25')];if(_0x146d60[_0xd6b8('0x20')][_0xd6b8('0x2c')]){_0x29f4f5['include']=[{'all':!![]}];}_0x29f4f5=_['merge']({},_0x29f4f5,_0x146d60['options']);return db[_0xd6b8('0x1a')][_0xd6b8('0x2d')](_0x29f4f5)[_0xd6b8('0x16')](handleEntityNotFound(_0x2acc82,null))['then'](respondWithResult(_0x2acc82,null))[_0xd6b8('0x2e')](handleError(_0x2acc82,null));};exports['create']=function(_0xa23196,_0x343af0){return db[_0xd6b8('0x1a')][_0xd6b8('0x2f')](_0xa23196[_0xd6b8('0x30')],{})[_0xd6b8('0x16')](respondWithResult(_0x343af0,0xc9))[_0xd6b8('0x2e')](handleError(_0x343af0,null));};exports[_0xd6b8('0x15')]=function(_0x21039d,_0x4e85e0){if(_0x21039d[_0xd6b8('0x30')]['id']){delete _0x21039d['body']['id'];}return db[_0xd6b8('0x1a')]['find']({'where':{'id':_0x21039d[_0xd6b8('0x24')]['id']}})[_0xd6b8('0x16')](handleEntityNotFound(_0x4e85e0,null))['then'](saveUpdates(_0x21039d[_0xd6b8('0x30')],null))[_0xd6b8('0x16')](respondWithResult(_0x4e85e0,null))['catch'](handleError(_0x4e85e0,null));};exports[_0xd6b8('0x31')]=function(_0x9151cb,_0x513cfd){return db['OpenchannelInteraction']['find']({'where':{'id':_0x9151cb[_0xd6b8('0x24')]['id']}})['then'](handleEntityNotFound(_0x513cfd,null))[_0xd6b8('0x16')](removeEntity(_0x513cfd,null))['catch'](handleError(_0x513cfd,null));};exports[_0xd6b8('0x32')]=function(_0x2fc317,_0x22c08b){return db[_0xd6b8('0x1a')][_0xd6b8('0x32')]()['then'](respondWithResult(_0x22c08b,null))[_0xd6b8('0x2e')](handleError(_0x22c08b,null));};exports['addMessage']=function(_0x1a4181,_0x2b1fc3){return db['OpenchannelMessage']['find']({'where':{'id':_0x1a4181['params']['id']}})['then'](handleEntityNotFound(_0x2b1fc3,null))[_0xd6b8('0x16')](function(_0x5aeda1){if(_0x5aeda1){return _0x5aeda1[_0xd6b8('0x33')](_0x1a4181[_0xd6b8('0x30')][_0xd6b8('0x34')],_[_0xd6b8('0x35')](_0x1a4181[_0xd6b8('0x30')],[_0xd6b8('0x34'),'id'])||{});}})[_0xd6b8('0x16')](respondWithResult(_0x2b1fc3,null))['catch'](handleError(_0x2b1fc3,null));};exports[_0xd6b8('0x36')]=function(_0x519495,_0x58d33b){var _0x47d0e2={'raw':![],'where':{}};var _0x374a4d={};var _0x58f8e1={'count':0x0,'rows':[]};return db[_0xd6b8('0x1a')][_0xd6b8('0x37')]({'where':{'id':_0x519495[_0xd6b8('0x24')]['id']}})['then'](handleEntityNotFound(_0x58d33b,null))[_0xd6b8('0x16')](function(_0x1ab80f){if(_0x1ab80f){_0x374a4d['model']=_['keys'](db[_0xd6b8('0x38')][_0xd6b8('0x26')]);_0x374a4d[_0xd6b8('0x20')]=_[_0xd6b8('0x27')](_0x519495[_0xd6b8('0x20')]);_0x374a4d['filters']=_[_0xd6b8('0x28')](_0x374a4d[_0xd6b8('0x25')],_0x374a4d[_0xd6b8('0x20')]);_0x47d0e2[_0xd6b8('0x29')]=_[_0xd6b8('0x28')](_0x374a4d[_0xd6b8('0x25')],qs[_0xd6b8('0x2a')](_0x519495[_0xd6b8('0x20')][_0xd6b8('0x2a')]));_0x47d0e2[_0xd6b8('0x29')]=_0x47d0e2[_0xd6b8('0x29')][_0xd6b8('0x2b')]?_0x47d0e2['attributes']:_0x374a4d[_0xd6b8('0x25')];if(!_0x519495[_0xd6b8('0x20')][_0xd6b8('0x39')](_0xd6b8('0x3a'))){_0x47d0e2[_0xd6b8('0x10')]=qs[_0xd6b8('0x10')](_0x519495[_0xd6b8('0x20')][_0xd6b8('0x10')]);_0x47d0e2['offset']=qs[_0xd6b8('0x12')](_0x519495[_0xd6b8('0x20')][_0xd6b8('0x12')]);}_0x47d0e2[_0xd6b8('0x3b')]=qs[_0xd6b8('0x3c')](_0x519495[_0xd6b8('0x20')]['sort']);_0x47d0e2['where']=qs[_0xd6b8('0x3d')](_[_0xd6b8('0x3e')](_0x519495[_0xd6b8('0x20')],_0x374a4d[_0xd6b8('0x3d')]));_0x47d0e2['where'][_0xd6b8('0x3f')]=_0x1ab80f['id'];if(_0x519495[_0xd6b8('0x20')][_0xd6b8('0x40')]){_0x47d0e2[_0xd6b8('0x41')]=_[_0xd6b8('0x42')](_0x47d0e2['where'],{'$or':_[_0xd6b8('0x19')](_0x47d0e2[_0xd6b8('0x29')],function(_0x38e0cb){var _0x3bfa0a={};_0x3bfa0a[_0x38e0cb]={'$like':'%'+_0x519495['query'][_0xd6b8('0x40')]+'%'};return _0x3bfa0a;})});}if(_0x519495['query']['$gte']){var _0x25859c=_0x519495[_0xd6b8('0x20')][_0xd6b8('0x43')]['split'](',');var _0x154037={};_0x154037[_0x25859c[0x0]]={'$gte':moment(_0x25859c[0x1])['format'](_0xd6b8('0x44'))};_0x47d0e2[_0xd6b8('0x41')]=_[_0xd6b8('0x42')](_0x47d0e2['where'],_0x154037);}_0x47d0e2=_[_0xd6b8('0x42')]({},_0x47d0e2,_0x519495[_0xd6b8('0x45')]);return db[_0xd6b8('0x38')]['count']({'where':_0x47d0e2[_0xd6b8('0x41')]})[_0xd6b8('0x16')](function(_0x27775f){_0x58f8e1['count']=_0x27775f;if(_0x519495[_0xd6b8('0x20')][_0xd6b8('0x2c')]){_0x47d0e2[_0xd6b8('0x46')]=[{'all':!![]}];}return db[_0xd6b8('0x38')][_0xd6b8('0x1e')](_0x47d0e2);})[_0xd6b8('0x16')](function(_0x4b5890){_0x58f8e1['rows']=_0x4b5890;return _0x58f8e1;});}})[_0xd6b8('0x16')](respondWithFilteredResult(_0x58d33b,_0x47d0e2))[_0xd6b8('0x2e')](handleError(_0x58d33b,null));};exports['addTags']=function(_0x540790,_0x38ef3b){return db[_0xd6b8('0x1a')][_0xd6b8('0x2d')]({'where':{'id':_0x540790[_0xd6b8('0x24')]['id']}})[_0xd6b8('0x16')](handleEntityNotFound(_0x38ef3b,null))[_0xd6b8('0x16')](function(_0x55b503){if(_0x55b503){return _0x55b503['setTags'](_0x540790[_0xd6b8('0x30')]['ids'],_[_0xd6b8('0x35')](_0x540790[_0xd6b8('0x30')],[_0xd6b8('0x34'),'id'])||{})['spread'](function(){return db[_0xd6b8('0x47')][_0xd6b8('0x1e')]({'attributes':['id',_0xd6b8('0x17'),'color'],'where':{'id':_0x540790[_0xd6b8('0x30')]['ids']}});})[_0xd6b8('0x16')](function(_0x1055d2){socket[_0xd6b8('0x48')](_0xd6b8('0x49'),{'id':Number(_0x540790[_0xd6b8('0x24')]['id']),'tags':_0x1055d2||[]});return{'id':Number(_0x540790[_0xd6b8('0x24')]['id']),'tags':_0x1055d2||[]};});}})[_0xd6b8('0x16')](respondWithResult(_0x38ef3b,null))[_0xd6b8('0x2e')](handleError(_0x38ef3b,null));};exports[_0xd6b8('0x4a')]=function(_0x13c3ef,_0x2798ae){return db[_0xd6b8('0x1a')][_0xd6b8('0x2d')]({'where':{'id':_0x13c3ef[_0xd6b8('0x24')]['id']}})[_0xd6b8('0x16')](handleEntityNotFound(_0x2798ae,null))[_0xd6b8('0x16')](function(_0x20bea1){if(_0x20bea1){return _0x20bea1[_0xd6b8('0x4a')](_0x13c3ef[_0xd6b8('0x20')][_0xd6b8('0x34')]);}})[_0xd6b8('0x16')](respondWithStatusCode(_0x2798ae,null))[_0xd6b8('0x2e')](handleError(_0x2798ae,null));};exports[_0xd6b8('0x4b')]=function(_0x343c18,_0x6a189){var _0x86bdfe=moment()[_0xd6b8('0x4c')]()['toString']();var _0x59455a=path['join'](config['root'],_0xd6b8('0x4d'),_0xd6b8('0x4e'),_0xd6b8('0x4f'));var _0x9b2b2d=path[_0xd6b8('0x50')](config[_0xd6b8('0x51')],_0xd6b8('0x4d'),_0xd6b8('0x4e'),'attachments');var _0x39be1c=path['join'](_0x59455a,_0x86bdfe);var _0x1ca9c8=util['format'](_0xd6b8('0x52'),_0x343c18[_0xd6b8('0x24')]['id'],_0x86bdfe);var _0x1b7491=path[_0xd6b8('0x50')](_0x59455a,_0x1ca9c8);var _0x18660f=[];_0x18660f[_0xd6b8('0x53')]({'model':db[_0xd6b8('0x54')],'as':_0xd6b8('0x54'),'attributes':['id',_0xd6b8('0x55')],'raw':!![]});_0x18660f[_0xd6b8('0x53')]({'model':db[_0xd6b8('0x56')],'as':_0xd6b8('0x57'),'attributes':['id',_0xd6b8('0x58'),'lastName'],'raw':!![]});if(_0x343c18[_0xd6b8('0x20')][_0xd6b8('0x59')]){_0x18660f['push']({'model':db[_0xd6b8('0x5a')],'as':'Attachment','raw':!![]});}var _0x304e1c=[{'model':db[_0xd6b8('0x38')],'as':_0xd6b8('0x5b'),'attributes':['id',_0xd6b8('0x30'),_0xd6b8('0x5c'),_0xd6b8('0x5d'),_0xd6b8('0x5e'),_0xd6b8('0x5f')],'include':_0x18660f}];_0x304e1c[_0xd6b8('0x53')]({'model':db[_0xd6b8('0x60')],'as':_0xd6b8('0x61'),'attributes':['id',_0xd6b8('0x17')]});_0x304e1c['push']({'model':db[_0xd6b8('0x54')],'as':'Owner','attributes':['id',_0xd6b8('0x55')]});return db[_0xd6b8('0x1a')]['find']({'where':{'id':_0x343c18[_0xd6b8('0x24')]['id']},'include':_0x304e1c})['then'](handleEntityNotFound(_0x6a189,null))[_0xd6b8('0x16')](function(_0x4ead80){if(_0x4ead80){var _0x832f79=_0x4ead80[_0xd6b8('0x62')]({'plain':!![]});fs['mkdirSync'](_0x39be1c);var _0x31aaa1={'channel':_0xd6b8('0x63'),'account':_0x832f79['Account'][_0xd6b8('0x17')],'agent':_0x832f79['Owner']?_0x832f79['Owner'][_0xd6b8('0x55')]:_0xd6b8('0x64'),'createdAt':moment(_0x832f79[_0xd6b8('0x5c')])['format'](_0xd6b8('0x44'))[_0xd6b8('0x65')](),'closedAt':_0x832f79[_0xd6b8('0x66')]?moment(_0x832f79[_0xd6b8('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd6b8('0x65')]():'','disposition':_0x832f79[_0xd6b8('0x68')],'visibility':_0x832f79[_0xd6b8('0x69')]?_0xd6b8('0x6a'):_0xd6b8('0x6b'),'messages':_(_0x832f79[_0xd6b8('0x5b')])[_0xd6b8('0x40')]({'secret':![]})[_0xd6b8('0x19')](function(_0x56fd01){if(_0x56fd01[_0xd6b8('0x5a')]){var _0xee2725=path[_0xd6b8('0x50')](_0x9b2b2d,_0x56fd01[_0xd6b8('0x5a')]['basename']);if(fs['existsSync'](_0xee2725)){fs[_0xd6b8('0x6c')](_0xee2725)[_0xd6b8('0x6d')](fs[_0xd6b8('0x6e')](path[_0xd6b8('0x50')](_0x39be1c,_0x56fd01[_0xd6b8('0x5a')][_0xd6b8('0x6f')])));}}return{'date':moment(_0x56fd01[_0xd6b8('0x5c')])[_0xd6b8('0x70')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd6b8('0x65')](),'sender':_0x56fd01[_0xd6b8('0x5d')]===_0xd6b8('0x71')?_0x56fd01[_0xd6b8('0x54')]?_0x56fd01[_0xd6b8('0x54')][_0xd6b8('0x55')]:'System':_0x56fd01[_0xd6b8('0x57')]['firstName']+(_0x56fd01['Contact'][_0xd6b8('0x72')]?'\x20'+_0x56fd01[_0xd6b8('0x57')]['lastName']:''),'body':_0x56fd01[_0xd6b8('0x5a')]?_0x56fd01[_0xd6b8('0x5a')][_0xd6b8('0x6f')]:_0x56fd01['body'],'direction':_0x56fd01[_0xd6b8('0x5d')]===_0xd6b8('0x71')?'A':'C','secret':_0x56fd01[_0xd6b8('0x5e')],'read':_0x56fd01[_0xd6b8('0x5f')],'attachment':_0x56fd01['Attachment']};})[_0xd6b8('0x73')]()};return ejs[_0xd6b8('0x74')](path['join'](config[_0xd6b8('0x51')],'server',_0xd6b8('0x75'),_0xd6b8('0x76')),{'interaction':_0x31aaa1})[_0xd6b8('0x16')](function(_0x57cd14){var _0x53eacd=path[_0xd6b8('0x50')](_0x39be1c,'transcript-'+_0x832f79['id']+'-'+_0x86bdfe+_0xd6b8('0x77'));var _0x100259={'path':_0x53eacd,'channel':'Openchannel','interactionId':_0x832f79['id']};return pdf[_0xd6b8('0x78')](_0x57cd14,_0x100259);})[_0xd6b8('0x16')](function(){return new Promise(function(_0x585378,_0x3d422c){zipdir(_0x39be1c,{'saveTo':_0x1b7491},function(_0x56f19b,_0x347dbf){if(_0x56f19b)return _0x3d422c(_0x56f19b);return _0x585378(_0x347dbf);});})[_0xd6b8('0x16')](function(){return new Promise(function(_0x3cf2a9,_0x5dd2a6){rimraf(_0x39be1c,function(_0x124582){if(_0x124582)_0x5dd2a6(_0x124582);return _0x3cf2a9();});});})[_0xd6b8('0x16')](function(){return _0x6a189[_0xd6b8('0x4b')](_0x1b7491,_0x1ca9c8,function(_0x393df9){if(_0x393df9){logger[_0xd6b8('0x79')]('Unable\x20to\x20delete\x20zip\x20file',_0x393df9);}else{fs['unlinkSync'](_0x1b7491);}});});});}else{return _0x6a189[_0xd6b8('0xc')](0xc8);}})[_0xd6b8('0x2e')](handleError(_0x6a189,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d2c51da..359e665 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 _0x092e=['length','emit','catch','hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x18cbe1,_0x38624f){var _0x243fbd=function(_0x40594f){while(--_0x40594f){_0x18cbe1['push'](_0x18cbe1['shift']());}};_0x243fbd(++_0x38624f);}(_0x092e,0x1ad));var _0xe092=function(_0x94a543,_0x160f2a){_0x94a543=_0x94a543-0x0;var _0x1e1c43=_0x092e[_0x94a543];return _0x1e1c43;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xe092('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xe092('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe092('0x2')](0x0);var events={'afterCreate':_0xe092('0x3'),'afterUpdate':_0xe092('0x4'),'afterDestroy':_0xe092('0x5')};function emitEvent(_0x45ef8d){return function(_0x1a816a,_0x51a607,_0x14d288){_0x1a816a[_0xe092('0x6')]({'attributes':['id'],'raw':!![]})[_0xe092('0x7')](function(_0x55c83a){_0x1a816a[_0xe092('0x8')](_0xe092('0x9'),_0x55c83a[_0xe092('0xa')](function(_0x37b948){return{'id':_0x37b948['id']};}));return OpenchannelMessage[_0xe092('0xb')]({'where':{'OpenchannelInteractionId':_0x1a816a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x12478e){_0x1a816a[_0xe092('0x8')](_0xe092('0xc'),_0x12478e[_0xe092('0xd')]);OpenchannelInteractionEvents[_0xe092('0xe')](_0x45ef8d+':'+_0x1a816a['id'],_0x1a816a);OpenchannelInteractionEvents[_0xe092('0xe')](_0x45ef8d,_0x1a816a);_0x14d288(null);})[_0xe092('0xf')](_0x14d288(null));};}for(var e in events){if(events[_0xe092('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xd3a7=['update','remove','then','Users','map','unreadMessages','emit','catch','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','save'];(function(_0x2bb327,_0x3f7b90){var _0x1017c8=function(_0x50f138){while(--_0x50f138){_0x2bb327['push'](_0x2bb327['shift']());}};_0x1017c8(++_0x3f7b90);}(_0xd3a7,0xcb));var _0x7d3a=function(_0x26d2a8,_0x4d13dd){_0x26d2a8=_0x26d2a8-0x0;var _0x346557=_0xd3a7[_0x26d2a8];return _0x346557;};'use strict';var EventEmitter=require(_0x7d3a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x7d3a('0x1')];var OpenchannelMessage=require(_0x7d3a('0x2'))['db'][_0x7d3a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d3a('0x4'),'afterUpdate':_0x7d3a('0x5'),'afterDestroy':_0x7d3a('0x6')};function emitEvent(_0x5badaf){return function(_0x2ec275,_0x2128e6,_0xcfc81b){_0x2ec275['getUsers']({'attributes':['id'],'raw':!![]})[_0x7d3a('0x7')](function(_0x4c0b5e){_0x2ec275['setDataValue'](_0x7d3a('0x8'),_0x4c0b5e[_0x7d3a('0x9')](function(_0x3792dd){return{'id':_0x3792dd['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2ec275['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7d3a('0x7')](function(_0x1a5c4d){_0x2ec275['setDataValue'](_0x7d3a('0xa'),_0x1a5c4d['length']);OpenchannelInteractionEvents['emit'](_0x5badaf+':'+_0x2ec275['id'],_0x2ec275);OpenchannelInteractionEvents[_0x7d3a('0xb')](_0x5badaf,_0x2ec275);_0xcfc81b(null);})[_0x7d3a('0xc')](_0xcfc81b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](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 37434be..b3f7313 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 _0xdc12=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x5f2327,_0x3d7d14){var _0x3d55d5=function(_0x18a085){while(--_0x18a085){_0x5f2327['push'](_0x5f2327['shift']());}};_0x3d55d5(++_0x3d7d14);}(_0xdc12,0x1c2));var _0x2dc1=function(_0x553197,_0x913961){_0x553197=_0x553197-0x0;var _0x70f1b=_0xdc12[_0x553197];return _0x70f1b;};'use strict';var _=require(_0x2dc1('0x0'));var util=require('util');var logger=require(_0x2dc1('0x1'))('api');var moment=require(_0x2dc1('0x2'));var BPromise=require(_0x2dc1('0x3'));var rp=require(_0x2dc1('0x4'));var fs=require('fs');var path=require(_0x2dc1('0x5'));var rimraf=require(_0x2dc1('0x6'));var config=require(_0x2dc1('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x2dc1('0x8')]=function(_0x2a2c3b,_0x1f2453){return _0x2a2c3b['define'](_0x2dc1('0x9'),attributes,{'tableName':_0x2dc1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dc1('0xb'),'collate':_0x2dc1('0xc'),'hooks':{'beforeUpdate':function(_0x56ec0a,_0x183ebf,_0x1d699b){if(_0x56ec0a[_0x2dc1('0xd')]('closed')){_0x56ec0a['closedAt']=moment()[_0x2dc1('0xe')](_0x2dc1('0xf'));}_0x1d699b(null,_0x56ec0a);}}});}; \ No newline at end of file +var _0x22c4=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a436d,_0x512231){var _0xd5ceda=function(_0x3410fc){while(--_0x3410fc){_0x2a436d['push'](_0x2a436d['shift']());}};_0xd5ceda(++_0x512231);}(_0x22c4,0xc4));var _0x422c=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x22c4[_0x565c4e];return _0x4a167f;};'use strict';var _=require(_0x422c('0x0'));var util=require('util');var logger=require(_0x422c('0x1'))('api');var moment=require(_0x422c('0x2'));var BPromise=require(_0x422c('0x3'));var rp=require(_0x422c('0x4'));var fs=require('fs');var path=require(_0x422c('0x5'));var rimraf=require('rimraf');var config=require(_0x422c('0x6'));var attributes=require(_0x422c('0x7'));module[_0x422c('0x8')]=function(_0x208e76,_0x577f46){return _0x208e76['define'](_0x422c('0x9'),attributes,{'tableName':_0x422c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x422c('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x48e6f5,_0x2a1b14,_0x453a1e){if(_0x48e6f5['changed'](_0x422c('0xc'))){_0x48e6f5['closedAt']=moment()['format'](_0x422c('0xd'));}_0x453a1e(null,_0x48e6f5);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index dacd504..4037268 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 _0x4bd4=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2d9ece,_0x282f1c){var _0x4e2c19=function(_0x14ff16){while(--_0x14ff16){_0x2d9ece['push'](_0x2d9ece['shift']());}};_0x4e2c19(++_0x282f1c);}(_0x4bd4,0xd1));var _0x44bd=function(_0x2952e0,_0x304b91){_0x2952e0=_0x2952e0-0x0;var _0x2730fb=_0x4bd4[_0x2952e0];return _0x2730fb;};'use strict';var _=require(_0x44bd('0x0'));var util=require(_0x44bd('0x1'));var moment=require(_0x44bd('0x2'));var BPromise=require(_0x44bd('0x3'));var rs=require(_0x44bd('0x4'));var fs=require('fs');var Redis=require(_0x44bd('0x5'));var db=require(_0x44bd('0x6'))['db'];var utils=require(_0x44bd('0x7'));var logger=require('../../config/logger')(_0x44bd('0x8'));var config=require(_0x44bd('0x9'));var jayson=require(_0x44bd('0xa'));var client=jayson[_0x44bd('0xb')][_0x44bd('0xc')]({'port':0x232a});config[_0x44bd('0xd')]=_[_0x44bd('0xe')](config[_0x44bd('0xd')],{'host':_0x44bd('0xf'),'port':0x18eb});var socket=require(_0x44bd('0x10'))(new Redis(config['redis']));require(_0x44bd('0x11'))[_0x44bd('0x12')](socket);function respondWithRpcPromise(_0x1de32c,_0x5079e1,_0x1a776e){return new BPromise(function(_0x23aa9d,_0x36791c){return client[_0x44bd('0x13')](_0x1de32c,_0x1a776e)[_0x44bd('0x14')](function(_0x76c91e){logger[_0x44bd('0x15')](_0x44bd('0x16'),_0x5079e1,'request\x20sent');logger[_0x44bd('0x17')](_0x44bd('0x18'),_0x5079e1,_0x44bd('0x19'),JSON[_0x44bd('0x1a')](_0x76c91e));if(_0x76c91e[_0x44bd('0x1b')]){if(_0x76c91e[_0x44bd('0x1b')]['code']===0x1f4){logger['error'](_0x44bd('0x16'),_0x5079e1,_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);return _0x36791c(_0x76c91e[_0x44bd('0x1b')]['message']);}logger[_0x44bd('0x1b')](_0x44bd('0x16'),_0x5079e1,_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);return _0x23aa9d(_0x76c91e[_0x44bd('0x1b')][_0x44bd('0x1c')]);}else{logger[_0x44bd('0x15')](_0x44bd('0x16'),_0x5079e1,'request\x20sent');_0x23aa9d(_0x76c91e['result'][_0x44bd('0x1c')]);}})[_0x44bd('0x1d')](function(_0x28381b){logger[_0x44bd('0x1b')](_0x44bd('0x16'),_0x5079e1,_0x28381b);_0x36791c(_0x28381b);});});}exports[_0x44bd('0x1e')]=function(_0x1a1bbf){var _0x45e3a9=this;return new Promise(function(_0x4efa9b,_0x2b845a){return db['OpenchannelInteraction'][_0x44bd('0x1f')](_0x1a1bbf[_0x44bd('0x20')],{'raw':_0x1a1bbf[_0x44bd('0x21')]?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1bbf[_0x44bd('0x21')]?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x23')]||null:null,'attributes':_0x1a1bbf['options']?_0x1a1bbf['options'][_0x44bd('0x24')]||null:null,'limit':_0x1a1bbf['options']?_0x1a1bbf[_0x44bd('0x21')][_0x44bd('0x25')]||null:null})[_0x44bd('0x14')](function(_0x30035b){logger['info'](_0x44bd('0x1e'),_0x1a1bbf);logger['debug'](_0x44bd('0x1e'),_0x1a1bbf,JSON[_0x44bd('0x1a')](_0x30035b));_0x4efa9b(_0x30035b);})[_0x44bd('0x1d')](function(_0xd4a4ff){logger[_0x44bd('0x1b')](_0x44bd('0x1e'),_0xd4a4ff['message'],_0x1a1bbf);_0x2b845a(_0x45e3a9[_0x44bd('0x1b')](0x1f4,_0xd4a4ff[_0x44bd('0x1c')]));});});};exports[_0x44bd('0x26')]=function(_0x3f61ab){return new Promise(function(_0x4696d2,_0x4a8c22){return db[_0x44bd('0x27')][_0x44bd('0x28')]({'where':_0x3f61ab[_0x44bd('0x21')]?_0x3f61ab['options']['where']||null:null})['then'](function(_0x4655fa){if(_0x4655fa){return _0x4655fa[_0x44bd('0x29')](_0x3f61ab['body'][_0x44bd('0x2a')],_[_0x44bd('0x2b')](_0x3f61ab[_0x44bd('0x20')],[_0x44bd('0x2a'),'id'])||{});}})['spread'](function(_0x26146a){logger[_0x44bd('0x15')](_0x44bd('0x2c'),_0x3f61ab);logger[_0x44bd('0x17')](_0x44bd('0x2c'),_0x3f61ab,JSON[_0x44bd('0x1a')](_0x26146a));_0x4696d2(_0x26146a);})['catch'](function(_0x3b30c4){logger[_0x44bd('0x1b')]('AddTags',_0x3b30c4['message'],_0x3f61ab);_0x4a8c22(_this[_0x44bd('0x1b')](0x1f4,_0x3b30c4[_0x44bd('0x1c')]));});});}; \ No newline at end of file +var _0xd29d=['message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1bf3fe,_0x1f9ed6){var _0xe915d1=function(_0x2bc2cc){while(--_0x2bc2cc){_0x1bf3fe['push'](_0x1bf3fe['shift']());}};_0xe915d1(++_0x1f9ed6);}(_0xd29d,0x17b));var _0xdd29=function(_0x24755d,_0x49bbfe){_0x24755d=_0x24755d-0x0;var _0xa44fe6=_0xd29d[_0x24755d];return _0xa44fe6;};'use strict';var _=require('lodash');var util=require(_0xdd29('0x0'));var moment=require(_0xdd29('0x1'));var BPromise=require(_0xdd29('0x2'));var rs=require(_0xdd29('0x3'));var fs=require('fs');var Redis=require(_0xdd29('0x4'));var db=require(_0xdd29('0x5'))['db'];var utils=require(_0xdd29('0x6'));var logger=require(_0xdd29('0x7'))('rpc');var config=require(_0xdd29('0x8'));var jayson=require(_0xdd29('0x9'));var client=jayson['client'][_0xdd29('0xa')]({'port':0x232a});config['redis']=_[_0xdd29('0xb')](config[_0xdd29('0xc')],{'host':_0xdd29('0xd'),'port':0x18eb});var socket=require(_0xdd29('0xe'))(new Redis(config[_0xdd29('0xc')]));require('./openchannelInteraction.socket')[_0xdd29('0xf')](socket);function respondWithRpcPromise(_0xda4a27,_0x3f02f6,_0x12d470){return new BPromise(function(_0x17a04b,_0x24ae5f){return client[_0xdd29('0x10')](_0xda4a27,_0x12d470)[_0xdd29('0x11')](function(_0x3f07ef){logger[_0xdd29('0x12')](_0xdd29('0x13'),_0x3f02f6,_0xdd29('0x14'));logger[_0xdd29('0x15')](_0xdd29('0x16'),_0x3f02f6,_0xdd29('0x14'),JSON[_0xdd29('0x17')](_0x3f07ef));if(_0x3f07ef[_0xdd29('0x18')]){if(_0x3f07ef[_0xdd29('0x18')][_0xdd29('0x19')]===0x1f4){logger[_0xdd29('0x18')](_0xdd29('0x13'),_0x3f02f6,_0x3f07ef[_0xdd29('0x18')][_0xdd29('0x1a')]);return _0x24ae5f(_0x3f07ef[_0xdd29('0x18')][_0xdd29('0x1a')]);}logger[_0xdd29('0x18')](_0xdd29('0x13'),_0x3f02f6,_0x3f07ef[_0xdd29('0x18')]['message']);return _0x17a04b(_0x3f07ef[_0xdd29('0x18')]['message']);}else{logger['info'](_0xdd29('0x13'),_0x3f02f6,_0xdd29('0x14'));_0x17a04b(_0x3f07ef[_0xdd29('0x1b')]['message']);}})[_0xdd29('0x1c')](function(_0x49f6a9){logger[_0xdd29('0x18')](_0xdd29('0x13'),_0x3f02f6,_0x49f6a9);_0x24ae5f(_0x49f6a9);});});}exports[_0xdd29('0x1d')]=function(_0x2673bb){var _0x5493d6=this;return new Promise(function(_0x247dd3,_0x5d08cb){return db[_0xdd29('0x1e')][_0xdd29('0x1f')](_0x2673bb[_0xdd29('0x20')],{'raw':_0x2673bb[_0xdd29('0x21')]?_0x2673bb['options'][_0xdd29('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2673bb[_0xdd29('0x21')]?_0x2673bb[_0xdd29('0x21')]['where']||null:null,'attributes':_0x2673bb[_0xdd29('0x21')]?_0x2673bb[_0xdd29('0x21')][_0xdd29('0x23')]||null:null,'limit':_0x2673bb[_0xdd29('0x21')]?_0x2673bb[_0xdd29('0x21')][_0xdd29('0x24')]||null:null})['then'](function(_0x2ea953){logger[_0xdd29('0x12')](_0xdd29('0x1d'),_0x2673bb);logger['debug']('UpdateOpenchannelInteraction',_0x2673bb,JSON['stringify'](_0x2ea953));_0x247dd3(_0x2ea953);})[_0xdd29('0x1c')](function(_0x2b56ea){logger[_0xdd29('0x18')](_0xdd29('0x1d'),_0x2b56ea[_0xdd29('0x1a')],_0x2673bb);_0x5d08cb(_0x5493d6['error'](0x1f4,_0x2b56ea[_0xdd29('0x1a')]));});});};exports[_0xdd29('0x25')]=function(_0x3e3289){return new Promise(function(_0x57e487,_0x1d5499){return db[_0xdd29('0x1e')][_0xdd29('0x26')]({'where':_0x3e3289['options']?_0x3e3289[_0xdd29('0x21')][_0xdd29('0x27')]||null:null})[_0xdd29('0x11')](function(_0x3422d9){if(_0x3422d9){return _0x3422d9[_0xdd29('0x28')](_0x3e3289[_0xdd29('0x20')][_0xdd29('0x29')],_[_0xdd29('0x2a')](_0x3e3289[_0xdd29('0x20')],['ids','id'])||{});}})[_0xdd29('0x2b')](function(_0x369467){logger[_0xdd29('0x12')](_0xdd29('0x2c'),_0x3e3289);logger[_0xdd29('0x15')](_0xdd29('0x2c'),_0x3e3289,JSON[_0xdd29('0x17')](_0x369467));_0x57e487(_0x369467);})[_0xdd29('0x1c')](function(_0x49c7e3){logger[_0xdd29('0x18')](_0xdd29('0x2c'),_0x49c7e3[_0xdd29('0x1a')],_0x3e3289);_0x1d5499(_this[_0xdd29('0x18')](0x1f4,_0x49c7e3[_0xdd29('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index d02e571..ed8bf10 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 _0xcf54=['save','update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x155937,_0x4630ed){var _0x556878=function(_0x184056){while(--_0x184056){_0x155937['push'](_0x155937['shift']());}};_0x556878(++_0x4630ed);}(_0xcf54,0x1bf));var _0x4cf5=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xcf54[_0xf6e75d];return _0x27514d;};'use strict';var OpenchannelInteractionEvents=require(_0x4cf5('0x0'));var events=[_0x4cf5('0x1'),'remove',_0x4cf5('0x2')];function createListener(_0x4a8811,_0x2cb10f){return function(_0x333caf){_0x2cb10f[_0x4cf5('0x3')](_0x4a8811,_0x333caf);};}function removeListener(_0x5150f0,_0x11f25a){return function(){OpenchannelInteractionEvents[_0x4cf5('0x4')](_0x5150f0,_0x11f25a);};}exports[_0x4cf5('0x5')]=function(_0x196b9c){for(var _0x2c8ab7=0x0,_0xcd83b1=events[_0x4cf5('0x6')];_0x2c8ab7<_0xcd83b1;_0x2c8ab7++){var _0x5ca98a=events[_0x2c8ab7];var _0x2d1f2e=createListener(_0x4cf5('0x7')+_0x5ca98a,_0x196b9c);OpenchannelInteractionEvents['on'](_0x5ca98a,_0x2d1f2e);}}; \ No newline at end of file +var _0xe731=['remove','update','emit','length','openchannelInteraction:','save'];(function(_0x3c0bcf,_0x573780){var _0x2246c4=function(_0x4d7e46){while(--_0x4d7e46){_0x3c0bcf['push'](_0x3c0bcf['shift']());}};_0x2246c4(++_0x573780);}(_0xe731,0x137));var _0x1e73=function(_0x4f2b11,_0x4b7e73){_0x4f2b11=_0x4f2b11-0x0;var _0x532ecc=_0xe731[_0x4f2b11];return _0x532ecc;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x1e73('0x0'),_0x1e73('0x1'),_0x1e73('0x2')];function createListener(_0x107099,_0xadc60){return function(_0x345655){_0xadc60[_0x1e73('0x3')](_0x107099,_0x345655);};}function removeListener(_0x42986e,_0x31bcb6){return function(){OpenchannelInteractionEvents['removeListener'](_0x42986e,_0x31bcb6);};}exports['register']=function(_0x50f8ef){for(var _0x47663f=0x0,_0xf76cad=events[_0x1e73('0x4')];_0x47663f<_0xf76cad;_0x47663f++){var _0x5acd00=events[_0x47663f];var _0x270785=createListener(_0x1e73('0x5')+_0x5acd00,_0x50f8ef);OpenchannelInteractionEvents['on'](_0x5acd00,_0x270785);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ad754f8..59ec71b 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x2cf187,_0x2d6246){_0x2cf187=_0x2cf187-0x0;var _0xd5ca99=_0x70e0[_0x2cf187];return _0xd5ca99;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x4a5237,_0x25a487){_0x4a5237=_0x4a5237-0x0;var _0x5b7d57=_0x70e0[_0x4a5237];return _0x5b7d57;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 65356db..d580c9d 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 _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0x2bf346,_0x2186fe){var _0x50c73b=function(_0x494427){while(--_0x494427){_0x2bf346['push'](_0x2bf346['shift']());}};_0x50c73b(++_0x2186fe);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x561cad,_0x3ea409){_0x561cad=_0x561cad-0x0;var _0x578791=_0x9d5b[_0x561cad];return _0x578791;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file +var _0x6e6c=['exports','medium','BOOLEAN','out','DATE','TEXT','sequelize'];(function(_0x3a1951,_0x59b83c){var _0x334b7a=function(_0x2cbfed){while(--_0x2cbfed){_0x3a1951['push'](_0x3a1951['shift']());}};_0x334b7a(++_0x59b83c);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc6e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc6e6('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc6e6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc6e6('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 2d81a66..4064130 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 _0xccde=['manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','Sequelize','QueryTypes','User','rejectmessage','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','status','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','keys','length','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal'];(function(_0x5cabfe,_0x52dd2f){var _0x373553=function(_0x59a103){while(--_0x59a103){_0x5cabfe['push'](_0x5cabfe['shift']());}};_0x373553(++_0x52dd2f);}(_0xccde,0x11e));var _0xeccd=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xccde[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeccd('0x0'));var zipdir=require(_0xeccd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeccd('0x2'));var moment=require(_0xeccd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeccd('0x4'));var util=require(_0xeccd('0x5'));var path=require(_0xeccd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeccd('0x7'));var fs=require('fs');var fs_extra=require(_0xeccd('0x8'));var _=require(_0xeccd('0x9'));var squel=require(_0xeccd('0xa'));var crypto=require('crypto');var jsforce=require(_0xeccd('0xb'));var deskjs=require(_0xeccd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeccd('0xd'));var Papa=require(_0xeccd('0xe'));var Redis=require(_0xeccd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xeccd('0x10'));var as=require(_0xeccd('0x11'));var hardwareService=require(_0xeccd('0x12'));var logger=require(_0xeccd('0x13'))(_0xeccd('0x14'));var utils=require(_0xeccd('0x15'));var config=require(_0xeccd('0x16'));var licenseUtil=require(_0xeccd('0x17'));var db=require(_0xeccd('0x18'))['db'];config[_0xeccd('0x19')]=_[_0xeccd('0x1a')](config[_0xeccd('0x19')],{'host':_0xeccd('0x1b'),'port':0x18eb});var socket=require(_0xeccd('0x1c'))(new Redis(config[_0xeccd('0x19')]));require(_0xeccd('0x1d'))[_0xeccd('0x1e')](socket);var jayson=require(_0xeccd('0x1f'));var client=jayson['client'][_0xeccd('0x20')]({'port':0x232c});var client9002=jayson[_0xeccd('0x21')][_0xeccd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x475055,_0x38ff3c,_0x34e2e9,_0x23f18a){return new BPromise(function(_0x1631ac,_0xc21d0){var _0x1dcabe=_0x23f18a||client;return _0x1dcabe[_0xeccd('0x22')](_0x475055,_0x34e2e9)[_0xeccd('0x23')](function(_0x459f14){logger['info'](_0xeccd('0x24'),_0x38ff3c,_0xeccd('0x25'));logger[_0xeccd('0x26')](_0xeccd('0x27'),_0x38ff3c,_0xeccd('0x25'),JSON[_0xeccd('0x28')](_0x459f14));if(_0x459f14[_0xeccd('0x29')]){if(_0x459f14[_0xeccd('0x29')]['code']===0x1f4){logger['error'](_0xeccd('0x24'),_0x38ff3c,_0x459f14[_0xeccd('0x29')][_0xeccd('0x2a')]);return _0xc21d0(_0x459f14[_0xeccd('0x29')][_0xeccd('0x2a')]);}logger[_0xeccd('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x38ff3c,_0x459f14['error'][_0xeccd('0x2a')]);return _0x1631ac(_0x459f14['error'][_0xeccd('0x2a')]);}else{logger[_0xeccd('0x2b')](_0xeccd('0x24'),_0x38ff3c,_0xeccd('0x25'));_0x1631ac(_0x459f14[_0xeccd('0x2c')][_0xeccd('0x2a')]);}})[_0xeccd('0x2d')](function(_0x2fb1ef){logger[_0xeccd('0x29')](_0xeccd('0x24'),_0x38ff3c,_0x2fb1ef);_0xc21d0(_0x2fb1ef);});});}function respondWithStatusCode(_0x212ac6,_0x5a6d75){_0x5a6d75=_0x5a6d75||0xcc;return function(_0x548dea){if(_0x548dea){return _0x212ac6[_0xeccd('0x2e')](_0x5a6d75);}return _0x212ac6['status'](_0x5a6d75)[_0xeccd('0x2f')]();};}function respondWithResult(_0x37f0a2,_0x1db9c6){_0x1db9c6=_0x1db9c6||0xc8;return function(_0x385c20){if(_0x385c20){return _0x37f0a2[_0xeccd('0x30')](_0x1db9c6)[_0xeccd('0x31')](_0x385c20);}};}function respondWithFilteredResult(_0x329c88,_0x2ae70c){return function(_0xd1a5cd){if(_0xd1a5cd){var _0x395ab4=typeof _0x2ae70c['offset']==='undefined'&&typeof _0x2ae70c[_0xeccd('0x32')]===_0xeccd('0x33');var _0x3b7b05=_0xd1a5cd['count'];var _0x1732f3=_0x395ab4?0x0:_0x2ae70c[_0xeccd('0x34')];var _0x1fdc9b=_0x395ab4?_0xd1a5cd[_0xeccd('0x35')]:_0x2ae70c['offset']+_0x2ae70c[_0xeccd('0x32')];var _0x248aa5;if(_0x1fdc9b>=_0x3b7b05){_0x1fdc9b=_0x3b7b05;_0x248aa5=0xc8;}else{_0x248aa5=0xce;}_0x329c88[_0xeccd('0x30')](_0x248aa5);return _0x329c88['set'](_0xeccd('0x36'),_0x1732f3+'-'+_0x1fdc9b+'/'+_0x3b7b05)[_0xeccd('0x31')](_0xd1a5cd);}return null;};}function patchUpdates(_0x250ee5){return function(_0x1959fd){try{jsonpatch[_0xeccd('0x37')](_0x1959fd,_0x250ee5,!![]);}catch(_0x301031){return BPromise[_0xeccd('0x38')](_0x301031);}return _0x1959fd[_0xeccd('0x39')]();};}function saveUpdates(_0x50031a,_0x120020){return function(_0x3fa34d){if(_0x3fa34d){return _0x3fa34d[_0xeccd('0x3a')](_0x50031a)['then'](function(_0x210518){return _0x210518;});}return null;};}function removeEntity(_0x35a727,_0x3a1d6c){return function(_0x2e61f3){if(_0x2e61f3){return _0x2e61f3[_0xeccd('0x3b')]()[_0xeccd('0x23')](function(){_0x35a727['status'](0xcc)[_0xeccd('0x2f')]();});}};}function handleEntityNotFound(_0x9f94ba,_0x1b9c52){return function(_0x16832e){if(!_0x16832e){_0x9f94ba[_0xeccd('0x2e')](0x194);}return _0x16832e;};}function handleError(_0x5ebe84,_0x4f16b2){_0x4f16b2=_0x4f16b2||0x1f4;return function(_0x1b2ceb){logger[_0xeccd('0x29')](_0x1b2ceb['stack']);if(_0x1b2ceb[_0xeccd('0x3c')]){delete _0x1b2ceb[_0xeccd('0x3c')];}_0x5ebe84[_0xeccd('0x30')](_0x4f16b2)[_0xeccd('0x3d')](_0x1b2ceb);};}exports[_0xeccd('0x3e')]=function(_0x35d975,_0xe9e62b){var _0x3de5c4={},_0x44b4d0={},_0x56d1f6={'count':0x0,'rows':[]};var _0x494647=_[_0xeccd('0x3f')](db[_0xeccd('0x40')]['rawAttributes'],function(_0x29f122){return{'name':_0x29f122['fieldName'],'type':_0x29f122[_0xeccd('0x41')][_0xeccd('0x42')]};});_0x44b4d0[_0xeccd('0x43')]=_[_0xeccd('0x3f')](_0x494647,_0xeccd('0x3c'));_0x44b4d0[_0xeccd('0x44')]=_['keys'](_0x35d975[_0xeccd('0x44')]);_0x44b4d0[_0xeccd('0x45')]=_[_0xeccd('0x46')](_0x44b4d0['model'],_0x44b4d0[_0xeccd('0x44')]);_0x3de5c4['attributes']=_[_0xeccd('0x46')](_0x44b4d0[_0xeccd('0x43')],qs[_0xeccd('0x47')](_0x35d975[_0xeccd('0x44')][_0xeccd('0x47')]));_0x3de5c4['attributes']=_0x3de5c4[_0xeccd('0x48')]['length']?_0x3de5c4['attributes']:_0x44b4d0[_0xeccd('0x43')];if(!_0x35d975[_0xeccd('0x44')][_0xeccd('0x49')](_0xeccd('0x4a'))){_0x3de5c4['limit']=qs['limit'](_0x35d975[_0xeccd('0x44')]['limit']);_0x3de5c4['offset']=qs[_0xeccd('0x34')](_0x35d975[_0xeccd('0x44')][_0xeccd('0x34')]);}_0x3de5c4['order']=qs[_0xeccd('0x4b')](_0x35d975[_0xeccd('0x44')]['sort']);_0x3de5c4[_0xeccd('0x4c')]=qs[_0xeccd('0x45')](_[_0xeccd('0x4d')](_0x35d975[_0xeccd('0x44')],_0x44b4d0[_0xeccd('0x45')]),_0x494647);if(_0x35d975[_0xeccd('0x44')]['filter']){_0x3de5c4[_0xeccd('0x4c')]=_['merge'](_0x3de5c4['where'],{'$or':_[_0xeccd('0x3f')](_0x494647,function(_0x4cbd11){if(_0x4cbd11[_0xeccd('0x41')]!==_0xeccd('0x4e')){var _0x5eb364={};_0x5eb364[_0x4cbd11[_0xeccd('0x3c')]]={'$like':'%'+_0x35d975[_0xeccd('0x44')][_0xeccd('0x4f')]+'%'};return _0x5eb364;}})});}_0x3de5c4=_[_0xeccd('0x50')]({},_0x3de5c4,_0x35d975[_0xeccd('0x51')]);var _0x3634c8={'where':_0x3de5c4[_0xeccd('0x4c')]};return db[_0xeccd('0x40')][_0xeccd('0x35')](_0x3634c8)[_0xeccd('0x23')](function(_0x1df2c2){_0x56d1f6['count']=_0x1df2c2;if(_0x35d975[_0xeccd('0x44')][_0xeccd('0x52')]){_0x3de5c4[_0xeccd('0x53')]=[{'all':!![]}];}return db[_0xeccd('0x40')]['findAll'](_0x3de5c4);})[_0xeccd('0x23')](function(_0x3fecf3){_0x56d1f6[_0xeccd('0x54')]=_0x3fecf3;return _0x56d1f6;})['then'](respondWithFilteredResult(_0xe9e62b,_0x3de5c4))[_0xeccd('0x2d')](handleError(_0xe9e62b,null));};exports[_0xeccd('0x55')]=function(_0x222df1,_0xf8389f){var _0x3e73ae={'raw':!![],'where':{'id':_0x222df1[_0xeccd('0x56')]['id']}},_0x3e0d20={};_0x3e0d20[_0xeccd('0x43')]=_['keys'](db[_0xeccd('0x40')][_0xeccd('0x57')]);_0x3e0d20[_0xeccd('0x44')]=_[_0xeccd('0x58')](_0x222df1[_0xeccd('0x44')]);_0x3e0d20[_0xeccd('0x45')]=_[_0xeccd('0x46')](_0x3e0d20[_0xeccd('0x43')],_0x3e0d20[_0xeccd('0x44')]);_0x3e73ae[_0xeccd('0x48')]=_[_0xeccd('0x46')](_0x3e0d20['model'],qs[_0xeccd('0x47')](_0x222df1[_0xeccd('0x44')]['fields']));_0x3e73ae[_0xeccd('0x48')]=_0x3e73ae['attributes'][_0xeccd('0x59')]?_0x3e73ae['attributes']:_0x3e0d20[_0xeccd('0x43')];if(_0x222df1[_0xeccd('0x44')][_0xeccd('0x52')]){_0x3e73ae[_0xeccd('0x53')]=[{'all':!![]}];}_0x3e73ae=_[_0xeccd('0x50')]({},_0x3e73ae,_0x222df1[_0xeccd('0x51')]);return db['OpenchannelMessage'][_0xeccd('0x5a')](_0x3e73ae)['then'](handleEntityNotFound(_0xf8389f,null))[_0xeccd('0x23')](respondWithResult(_0xf8389f,null))[_0xeccd('0x2d')](handleError(_0xf8389f,null));};exports[_0xeccd('0x5b')]=function(_0x4f0aea,_0x326a53){return db[_0xeccd('0x40')]['create'](_0x4f0aea[_0xeccd('0x5c')],{})[_0xeccd('0x23')](respondWithResult(_0x326a53,0xc9))[_0xeccd('0x2d')](handleError(_0x326a53,null));};exports[_0xeccd('0x3a')]=function(_0x4d9616,_0x11ecc9){if(_0x4d9616['body']['id']){delete _0x4d9616[_0xeccd('0x5c')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x4d9616[_0xeccd('0x56')]['id']}})[_0xeccd('0x23')](handleEntityNotFound(_0x11ecc9,null))['then'](saveUpdates(_0x4d9616[_0xeccd('0x5c')],null))[_0xeccd('0x23')](respondWithResult(_0x11ecc9,null))[_0xeccd('0x2d')](handleError(_0x11ecc9,null));};exports[_0xeccd('0x3b')]=function(_0x258239,_0x53d370){return db[_0xeccd('0x40')][_0xeccd('0x5a')]({'where':{'id':_0x258239[_0xeccd('0x56')]['id']}})['then'](handleEntityNotFound(_0x53d370,null))[_0xeccd('0x23')](removeEntity(_0x53d370,null))['catch'](handleError(_0x53d370,null));};exports[_0xeccd('0x5d')]=function(_0xf85115,_0x19d207){return db[_0xeccd('0x40')][_0xeccd('0x5d')]()[_0xeccd('0x23')](respondWithResult(_0x19d207,null))[_0xeccd('0x2d')](handleError(_0x19d207,null));};var interaction_log=require(_0xeccd('0x13'))(_0xeccd('0x5e'));exports[_0xeccd('0x5f')]=function(_0x3650cd,_0x530f59,_0x2d80d7){var _0x2c83ee={'agent':{},'channel':_0xeccd('0x60')};if(_0x3650cd['body']['id']){delete _0x3650cd['body']['id'];}_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x61')]=!![];_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')]=_0x3650cd['body']['UserId']||_0x3650cd[_0xeccd('0x64')]['id'];_0x2c83ee[_0xeccd('0x65')]['id']=_0x3650cd[_0xeccd('0x5c')]['UserId'];return db['OpenchannelMessage'][_0xeccd('0x5a')]({'where':{'id':_0x3650cd[_0xeccd('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x530f59,null))[_0xeccd('0x23')](saveUpdates(_0x3650cd[_0xeccd('0x5c')],null))['then'](function(_0x291f08){if(_0x291f08){_0x2c83ee[_0xeccd('0x2a')]=_0x291f08[_0xeccd('0x66')]({'plain':!![]});return db['OpenchannelInteraction'][_0xeccd('0x5a')]({'where':{'id':_0x291f08[_0xeccd('0x67')]}});}return null;})[_0xeccd('0x23')](handleEntityNotFound(_0x530f59,null))[_0xeccd('0x23')](function(_0x12abd8){if(_0x12abd8){return _0x12abd8['update']({'UserId':_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')],'read1stAt':_[_0xeccd('0x68')](_0x12abd8[_0xeccd('0x69')])?moment()['format'](_0xeccd('0x6a')):undefined});}return null;})[_0xeccd('0x23')](function(_0x53e931){if(_0x53e931){_0x2c83ee[_0xeccd('0x6b')]=_0x53e931[_0xeccd('0x66')]({'plain':!![]});interaction_log[_0xeccd('0x2b')](_0xeccd('0x6c'),_0x3650cd[_0xeccd('0x64')]['id'],_0x3650cd[_0xeccd('0x64')]['name'],_0x3650cd[_0xeccd('0x64')][_0xeccd('0x6d')],_0x2c83ee[_0xeccd('0x6b')]['id'],_0x3650cd[_0xeccd('0x5c')]?JSON['stringify'](_0x3650cd[_0xeccd('0x5c')]):_0xeccd('0x6e'));return respondWithRpcPromise('AcceptMessage',_0xeccd('0x6f'),_0x2c83ee);}return null;})['then'](function(_0x4a8c43){var _0x562d8b=_0xeccd('0x70')+_0x4a8c43['message']['ContactId'];return db[_0xeccd('0x71')][_0xeccd('0x44')](_0x562d8b,{'type':db['Sequelize']['QueryTypes'][_0xeccd('0x72')],'raw':!![]})[_0xeccd('0x23')](function(_0x12f84f){return _0x12f84f;});})[_0xeccd('0x23')](function(_0x3c64fe){if(_0x3c64fe){_0x2c83ee['message'][_0xeccd('0x73')]=_0x3c64fe[0x0];if(!_0x3650cd[_0xeccd('0x5c')]['UserId'])return;return db['User'][_0xeccd('0x5a')]({'where':{'id':_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x63')],'role':_0xeccd('0x65')},'attributes':['id',_0xeccd('0x3c'),_0xeccd('0x74'),_0xeccd('0x75'),_0xeccd('0x76')],'raw':!![]});}return null;})[_0xeccd('0x23')](function(_0x51ecef){if(!_0x51ecef)return null;_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x65')]=_0x51ecef;return _0x2c83ee;})[_0xeccd('0x23')](function(_0x32698a){if(_0x32698a){if(_0x3650cd[_0xeccd('0x5c')][_0xeccd('0x77')]){_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x78')]=util[_0xeccd('0x79')](_0xeccd('0x7a'),_0x3650cd[_0xeccd('0x64')][_0xeccd('0x3c')]);_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x7b')]=_0x2c83ee[_0xeccd('0x7b')];_0x2c83ee[_0xeccd('0x2a')][_0xeccd('0x7c')]=_0x2c83ee['channel'];_0x2c83ee['message'][_0xeccd('0x7d')]=_0xeccd('0x5f');return respondWithRpcPromise(_0xeccd('0x7e'),_0xeccd('0x7e'),{'event':_0xeccd('0x7f'),'message':_0x2c83ee[_0xeccd('0x2a')]},client9002)['then'](function(){return _0x2c83ee;});}return _0x2c83ee;}return null;})[_0xeccd('0x23')](respondWithResult(_0x530f59,null))[_0xeccd('0x2d')](handleError(_0x530f59,null));};var interaction_log=require(_0xeccd('0x13'))(_0xeccd('0x5e'));exports[_0xeccd('0x38')]=function(_0x36e0a1,_0x1caf74,_0x3fefc0){var _0x18f379={'agent':{},'channel':_0xeccd('0x60')};if(_0x36e0a1[_0xeccd('0x5c')]['id']){delete _0x36e0a1[_0xeccd('0x5c')]['id'];}_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')]=_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')]||_0x36e0a1[_0xeccd('0x64')]['id'];_0x18f379['agent']['id']=_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')];return db[_0xeccd('0x40')][_0xeccd('0x5a')]({'where':{'id':_0x36e0a1[_0xeccd('0x56')]['id'],'UserId':null}})[_0xeccd('0x23')](handleEntityNotFound(_0x1caf74,null))[_0xeccd('0x23')](function(_0x2e7c6c){if(_0x2e7c6c){_0x18f379[_0xeccd('0x2a')]=_0x2e7c6c['get']({'plain':!![]});return db[_0xeccd('0x80')][_0xeccd('0x5a')]({'where':{'id':_0x2e7c6c['OpenchannelInteractionId']}});}return null;})[_0xeccd('0x23')](handleEntityNotFound(_0x1caf74,null))['then'](function(_0x39c464){if(_0x39c464){_0x18f379[_0xeccd('0x6b')]=_0x39c464['get']({'plain':!![]});interaction_log[_0xeccd('0x2b')](_0xeccd('0x81'),_0x36e0a1['user']['id'],_0x36e0a1[_0xeccd('0x64')][_0xeccd('0x3c')],_0x36e0a1[_0xeccd('0x64')][_0xeccd('0x6d')],_0x18f379[_0xeccd('0x6b')]['id'],_0x36e0a1['body']?JSON[_0xeccd('0x28')](_0x36e0a1[_0xeccd('0x5c')]):_0xeccd('0x6e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x18f379);}return null;})[_0xeccd('0x23')](function(_0x1b0ba4){var _0x58871e=_0xeccd('0x70')+_0x1b0ba4['message'][_0xeccd('0x82')];return db[_0xeccd('0x71')][_0xeccd('0x44')](_0x58871e,{'type':db[_0xeccd('0x83')][_0xeccd('0x84')][_0xeccd('0x72')],'raw':!![]})['then'](function(_0x296d9e){return _0x296d9e;});})['then'](function(_0x2cbcd7){if(_0x2cbcd7){_0x18f379[_0xeccd('0x2a')][_0xeccd('0x73')]=_0x2cbcd7[0x0];if(!_0x36e0a1[_0xeccd('0x5c')][_0xeccd('0x63')])return;return db[_0xeccd('0x85')][_0xeccd('0x5a')]({'where':{'id':_0x36e0a1['body'][_0xeccd('0x63')],'role':_0xeccd('0x65')},'attributes':['id','name',_0xeccd('0x74'),_0xeccd('0x75'),_0xeccd('0x76')],'raw':!![]});}return null;})['then'](function(_0x30777d){if(!_0x30777d)return null;_0x18f379['message'][_0xeccd('0x65')]=_0x30777d;return _0x18f379;})['then'](function(_0x4297e5){if(_0x4297e5){_0x4297e5[_0xeccd('0x2a')][_0xeccd('0x78')]=util[_0xeccd('0x79')](_0xeccd('0x7a'),_0x36e0a1[_0xeccd('0x64')]['name']);_0x4297e5[_0xeccd('0x2a')][_0xeccd('0x7b')]=_0x18f379['channel'];_0x4297e5[_0xeccd('0x2a')]['motionChannel']=_0x18f379['channel'];_0x4297e5['message'][_0xeccd('0x7d')]='reject';respondWithRpcPromise(_0xeccd('0x7e'),_0xeccd('0x7e'),{'event':_0xeccd('0x86'),'message':_0x4297e5[_0xeccd('0x2a')]},client9002);return _0x18f379;}return null;})['then'](respondWithResult(_0x1caf74,null))[_0xeccd('0x2d')](handleError(_0x1caf74,null));}; \ No newline at end of file +var _0xb6ef=['redis','localhost','socket.io-emitter','register','jayson/promise','http','client','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','end','name','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','includeAll','findAll','show','include','create','body','find','params','destroy','describe','openchannel-interactions','accept','openchannel','readAt','UserId','user','get','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','info','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x48212e,_0x495f1d){var _0x200dee=function(_0x40930a){while(--_0x40930a){_0x48212e['push'](_0x48212e['shift']());}};_0x200dee(++_0x495f1d);}(_0xb6ef,0x65));var _0xfb6e=function(_0x5c7d2f,_0x37ead3){_0x5c7d2f=_0x5c7d2f-0x0;var _0xe729f8=_0xb6ef[_0x5c7d2f];return _0xe729f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb6e('0x0'));var rp=require(_0xfb6e('0x1'));var moment=require(_0xfb6e('0x2'));var BPromise=require(_0xfb6e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb6e('0x4'));var sox=require(_0xfb6e('0x5'));var csv=require('to-csv');var ejs=require(_0xfb6e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb6e('0x7'));var squel=require(_0xfb6e('0x8'));var crypto=require(_0xfb6e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb6e('0xa'));var toCsv=require(_0xfb6e('0xb'));var querystring=require('querystring');var Papa=require(_0xfb6e('0xc'));var Redis=require('ioredis');var authService=require(_0xfb6e('0xd'));var qs=require(_0xfb6e('0xe'));var as=require(_0xfb6e('0xf'));var hardwareService=require(_0xfb6e('0x10'));var logger=require(_0xfb6e('0x11'))(_0xfb6e('0x12'));var utils=require(_0xfb6e('0x13'));var config=require(_0xfb6e('0x14'));var licenseUtil=require(_0xfb6e('0x15'));var db=require(_0xfb6e('0x16'))['db'];config['redis']=_['defaults'](config[_0xfb6e('0x17')],{'host':_0xfb6e('0x18'),'port':0x18eb});var socket=require(_0xfb6e('0x19'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xfb6e('0x1a')](socket);var jayson=require(_0xfb6e('0x1b'));var client=jayson['client'][_0xfb6e('0x1c')]({'port':0x232c});var client9002=jayson[_0xfb6e('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1011b4,_0x345789,_0x5b59d3,_0x46d240){return new BPromise(function(_0xacedde,_0x1079a8){var _0x339541=_0x46d240||client;return _0x339541['request'](_0x1011b4,_0x5b59d3)[_0xfb6e('0x1e')](function(_0x3f178c){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x345789,'request\x20sent');logger[_0xfb6e('0x1f')](_0xfb6e('0x20'),_0x345789,_0xfb6e('0x21'),JSON[_0xfb6e('0x22')](_0x3f178c));if(_0x3f178c[_0xfb6e('0x23')]){if(_0x3f178c['error'][_0xfb6e('0x24')]===0x1f4){logger[_0xfb6e('0x23')](_0xfb6e('0x25'),_0x345789,_0x3f178c[_0xfb6e('0x23')][_0xfb6e('0x26')]);return _0x1079a8(_0x3f178c[_0xfb6e('0x23')][_0xfb6e('0x26')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x345789,_0x3f178c[_0xfb6e('0x23')][_0xfb6e('0x26')]);return _0xacedde(_0x3f178c[_0xfb6e('0x23')]['message']);}else{logger['info'](_0xfb6e('0x25'),_0x345789,_0xfb6e('0x21'));_0xacedde(_0x3f178c['result'][_0xfb6e('0x26')]);}})[_0xfb6e('0x27')](function(_0x3327d9){logger[_0xfb6e('0x23')](_0xfb6e('0x25'),_0x345789,_0x3327d9);_0x1079a8(_0x3327d9);});});}function respondWithStatusCode(_0x35fa13,_0x432d3f){_0x432d3f=_0x432d3f||0xcc;return function(_0xf1b0cd){if(_0xf1b0cd){return _0x35fa13[_0xfb6e('0x28')](_0x432d3f);}return _0x35fa13['status'](_0x432d3f)['end']();};}function respondWithResult(_0x56d8f7,_0x5a62d5){_0x5a62d5=_0x5a62d5||0xc8;return function(_0x24b139){if(_0x24b139){return _0x56d8f7[_0xfb6e('0x29')](_0x5a62d5)[_0xfb6e('0x2a')](_0x24b139);}};}function respondWithFilteredResult(_0x4c9021,_0x5df757){return function(_0x2191f8){if(_0x2191f8){var _0xd16d05=typeof _0x5df757[_0xfb6e('0x2b')]===_0xfb6e('0x2c')&&typeof _0x5df757[_0xfb6e('0x2d')]===_0xfb6e('0x2c');var _0x2c5548=_0x2191f8['count'];var _0x47a958=_0xd16d05?0x0:_0x5df757[_0xfb6e('0x2b')];var _0x4584e4=_0xd16d05?_0x2191f8[_0xfb6e('0x2e')]:_0x5df757[_0xfb6e('0x2b')]+_0x5df757[_0xfb6e('0x2d')];var _0x23d568;if(_0x4584e4>=_0x2c5548){_0x4584e4=_0x2c5548;_0x23d568=0xc8;}else{_0x23d568=0xce;}_0x4c9021[_0xfb6e('0x29')](_0x23d568);return _0x4c9021['set']('Content-Range',_0x47a958+'-'+_0x4584e4+'/'+_0x2c5548)[_0xfb6e('0x2a')](_0x2191f8);}return null;};}function patchUpdates(_0x5bb39f){return function(_0x1d6966){try{jsonpatch[_0xfb6e('0x2f')](_0x1d6966,_0x5bb39f,!![]);}catch(_0x25cb8f){return BPromise['reject'](_0x25cb8f);}return _0x1d6966[_0xfb6e('0x30')]();};}function saveUpdates(_0x5f92d1,_0x53daf0){return function(_0x109022){if(_0x109022){return _0x109022[_0xfb6e('0x31')](_0x5f92d1)[_0xfb6e('0x1e')](function(_0x18c7df){return _0x18c7df;});}return null;};}function removeEntity(_0xf4a839,_0x4f78ce){return function(_0x5be115){if(_0x5be115){return _0x5be115['destroy']()[_0xfb6e('0x1e')](function(){_0xf4a839['status'](0xcc)[_0xfb6e('0x32')]();});}};}function handleEntityNotFound(_0x3ff72b,_0x34424e){return function(_0xec1955){if(!_0xec1955){_0x3ff72b[_0xfb6e('0x28')](0x194);}return _0xec1955;};}function handleError(_0x54872e,_0x491dec){_0x491dec=_0x491dec||0x1f4;return function(_0x50aacf){logger['error'](_0x50aacf['stack']);if(_0x50aacf[_0xfb6e('0x33')]){delete _0x50aacf[_0xfb6e('0x33')];}_0x54872e['status'](_0x491dec)['send'](_0x50aacf);};}exports['index']=function(_0x7ffa,_0x1dce83){var _0x266556={},_0xab4f8f={},_0x3e5129={'count':0x0,'rows':[]};var _0x21db97=_['map'](db['OpenchannelMessage'][_0xfb6e('0x34')],function(_0x3f56da){return{'name':_0x3f56da[_0xfb6e('0x35')],'type':_0x3f56da[_0xfb6e('0x36')][_0xfb6e('0x37')]};});_0xab4f8f[_0xfb6e('0x38')]=_[_0xfb6e('0x39')](_0x21db97,_0xfb6e('0x33'));_0xab4f8f[_0xfb6e('0x3a')]=_[_0xfb6e('0x3b')](_0x7ffa['query']);_0xab4f8f['filters']=_[_0xfb6e('0x3c')](_0xab4f8f[_0xfb6e('0x38')],_0xab4f8f[_0xfb6e('0x3a')]);_0x266556[_0xfb6e('0x3d')]=_[_0xfb6e('0x3c')](_0xab4f8f[_0xfb6e('0x38')],qs[_0xfb6e('0x3e')](_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x3e')]));_0x266556[_0xfb6e('0x3d')]=_0x266556['attributes'][_0xfb6e('0x3f')]?_0x266556[_0xfb6e('0x3d')]:_0xab4f8f[_0xfb6e('0x38')];if(!_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x40')]('nolimit')){_0x266556[_0xfb6e('0x2d')]=qs[_0xfb6e('0x2d')](_0x7ffa[_0xfb6e('0x3a')]['limit']);_0x266556[_0xfb6e('0x2b')]=qs['offset'](_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x2b')]);}_0x266556[_0xfb6e('0x41')]=qs['sort'](_0x7ffa['query'][_0xfb6e('0x42')]);_0x266556[_0xfb6e('0x43')]=qs[_0xfb6e('0x44')](_[_0xfb6e('0x45')](_0x7ffa[_0xfb6e('0x3a')],_0xab4f8f[_0xfb6e('0x44')]),_0x21db97);if(_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x46')]){_0x266556[_0xfb6e('0x43')]=_[_0xfb6e('0x47')](_0x266556[_0xfb6e('0x43')],{'$or':_['map'](_0x21db97,function(_0x2b11ab){if(_0x2b11ab[_0xfb6e('0x36')]!==_0xfb6e('0x48')){var _0x1e871d={};_0x1e871d[_0x2b11ab[_0xfb6e('0x33')]]={'$like':'%'+_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x46')]+'%'};return _0x1e871d;}})});}_0x266556=_[_0xfb6e('0x47')]({},_0x266556,_0x7ffa[_0xfb6e('0x49')]);var _0x34de71={'where':_0x266556['where']};return db[_0xfb6e('0x4a')]['count'](_0x34de71)[_0xfb6e('0x1e')](function(_0x4dee65){_0x3e5129['count']=_0x4dee65;if(_0x7ffa[_0xfb6e('0x3a')][_0xfb6e('0x4b')]){_0x266556['include']=[{'all':!![]}];}return db[_0xfb6e('0x4a')][_0xfb6e('0x4c')](_0x266556);})['then'](function(_0x8e07f){_0x3e5129['rows']=_0x8e07f;return _0x3e5129;})[_0xfb6e('0x1e')](respondWithFilteredResult(_0x1dce83,_0x266556))['catch'](handleError(_0x1dce83,null));};exports[_0xfb6e('0x4d')]=function(_0x4e500,_0x24fb09){var _0x1826b8={'raw':!![],'where':{'id':_0x4e500['params']['id']}},_0x43370f={};_0x43370f[_0xfb6e('0x38')]=_[_0xfb6e('0x3b')](db[_0xfb6e('0x4a')]['rawAttributes']);_0x43370f[_0xfb6e('0x3a')]=_[_0xfb6e('0x3b')](_0x4e500['query']);_0x43370f[_0xfb6e('0x44')]=_[_0xfb6e('0x3c')](_0x43370f[_0xfb6e('0x38')],_0x43370f['query']);_0x1826b8[_0xfb6e('0x3d')]=_[_0xfb6e('0x3c')](_0x43370f[_0xfb6e('0x38')],qs['fields'](_0x4e500[_0xfb6e('0x3a')][_0xfb6e('0x3e')]));_0x1826b8[_0xfb6e('0x3d')]=_0x1826b8[_0xfb6e('0x3d')][_0xfb6e('0x3f')]?_0x1826b8[_0xfb6e('0x3d')]:_0x43370f[_0xfb6e('0x38')];if(_0x4e500[_0xfb6e('0x3a')][_0xfb6e('0x4b')]){_0x1826b8[_0xfb6e('0x4e')]=[{'all':!![]}];}_0x1826b8=_[_0xfb6e('0x47')]({},_0x1826b8,_0x4e500[_0xfb6e('0x49')]);return db[_0xfb6e('0x4a')]['find'](_0x1826b8)[_0xfb6e('0x1e')](handleEntityNotFound(_0x24fb09,null))[_0xfb6e('0x1e')](respondWithResult(_0x24fb09,null))[_0xfb6e('0x27')](handleError(_0x24fb09,null));};exports[_0xfb6e('0x4f')]=function(_0x1327d8,_0x433bb1){return db[_0xfb6e('0x4a')][_0xfb6e('0x4f')](_0x1327d8[_0xfb6e('0x50')],{})[_0xfb6e('0x1e')](respondWithResult(_0x433bb1,0xc9))['catch'](handleError(_0x433bb1,null));};exports[_0xfb6e('0x31')]=function(_0xc48f0c,_0x5c3043){if(_0xc48f0c[_0xfb6e('0x50')]['id']){delete _0xc48f0c['body']['id'];}return db[_0xfb6e('0x4a')][_0xfb6e('0x51')]({'where':{'id':_0xc48f0c[_0xfb6e('0x52')]['id']}})[_0xfb6e('0x1e')](handleEntityNotFound(_0x5c3043,null))['then'](saveUpdates(_0xc48f0c['body'],null))['then'](respondWithResult(_0x5c3043,null))[_0xfb6e('0x27')](handleError(_0x5c3043,null));};exports[_0xfb6e('0x53')]=function(_0x267776,_0x3808a6){return db[_0xfb6e('0x4a')][_0xfb6e('0x51')]({'where':{'id':_0x267776['params']['id']}})['then'](handleEntityNotFound(_0x3808a6,null))[_0xfb6e('0x1e')](removeEntity(_0x3808a6,null))[_0xfb6e('0x27')](handleError(_0x3808a6,null));};exports[_0xfb6e('0x54')]=function(_0x138511,_0x3c2795){return db[_0xfb6e('0x4a')][_0xfb6e('0x54')]()[_0xfb6e('0x1e')](respondWithResult(_0x3c2795,null))['catch'](handleError(_0x3c2795,null));};var interaction_log=require('../../config/logger')(_0xfb6e('0x55'));exports[_0xfb6e('0x56')]=function(_0x2bb2a6,_0x5ba476,_0x4322be){var _0xdfcd0b={'agent':{},'channel':_0xfb6e('0x57')};if(_0x2bb2a6[_0xfb6e('0x50')]['id']){delete _0x2bb2a6[_0xfb6e('0x50')]['id'];}_0x2bb2a6['body']['read']=!![];_0x2bb2a6['body'][_0xfb6e('0x58')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2bb2a6['body']['UserId']=_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x59')]||_0x2bb2a6[_0xfb6e('0x5a')]['id'];_0xdfcd0b['agent']['id']=_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x59')];return db[_0xfb6e('0x4a')][_0xfb6e('0x51')]({'where':{'id':_0x2bb2a6[_0xfb6e('0x52')]['id'],'UserId':null}})[_0xfb6e('0x1e')](handleEntityNotFound(_0x5ba476,null))[_0xfb6e('0x1e')](saveUpdates(_0x2bb2a6['body'],null))[_0xfb6e('0x1e')](function(_0x1a80c7){if(_0x1a80c7){_0xdfcd0b[_0xfb6e('0x26')]=_0x1a80c7[_0xfb6e('0x5b')]({'plain':!![]});return db['OpenchannelInteraction'][_0xfb6e('0x51')]({'where':{'id':_0x1a80c7['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5ba476,null))[_0xfb6e('0x1e')](function(_0x14c5f8){if(_0x14c5f8){return _0x14c5f8[_0xfb6e('0x31')]({'UserId':_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x59')],'read1stAt':_['isNil'](_0x14c5f8[_0xfb6e('0x5c')])?moment()[_0xfb6e('0x5d')](_0xfb6e('0x5e')):undefined});}return null;})[_0xfb6e('0x1e')](function(_0x660f73){if(_0x660f73){_0xdfcd0b['interaction']=_0x660f73[_0xfb6e('0x5b')]({'plain':!![]});interaction_log[_0xfb6e('0x5f')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bb2a6[_0xfb6e('0x5a')]['id'],_0x2bb2a6['user']['name'],_0x2bb2a6[_0xfb6e('0x5a')]['role'],_0xdfcd0b[_0xfb6e('0x60')]['id'],_0x2bb2a6[_0xfb6e('0x50')]?JSON[_0xfb6e('0x22')](_0x2bb2a6[_0xfb6e('0x50')]):_0xfb6e('0x61'));return respondWithRpcPromise(_0xfb6e('0x62'),_0xfb6e('0x63'),_0xdfcd0b);}return null;})['then'](function(_0x123a5a){var _0x230bb7=_0xfb6e('0x64')+_0x123a5a['message']['ContactId'];return db[_0xfb6e('0x65')]['query'](_0x230bb7,{'type':db[_0xfb6e('0x66')]['QueryTypes'][_0xfb6e('0x67')],'raw':!![]})['then'](function(_0x1b35df){return _0x1b35df;});})['then'](function(_0x27599b){if(_0x27599b){_0xdfcd0b['message'][_0xfb6e('0x68')]=_0x27599b[0x0];if(!_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x59')])return;return db[_0xfb6e('0x69')][_0xfb6e('0x51')]({'where':{'id':_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x59')],'role':_0xfb6e('0x6a')},'attributes':['id',_0xfb6e('0x33'),_0xfb6e('0x6b'),_0xfb6e('0x6c'),_0xfb6e('0x6d')],'raw':!![]});}return null;})['then'](function(_0x20276b){if(!_0x20276b)return null;_0xdfcd0b[_0xfb6e('0x26')][_0xfb6e('0x6a')]=_0x20276b;return _0xdfcd0b;})['then'](function(_0x21a7a6){if(_0x21a7a6){if(_0x2bb2a6[_0xfb6e('0x50')][_0xfb6e('0x6e')]){_0xdfcd0b[_0xfb6e('0x26')][_0xfb6e('0x6f')]=util[_0xfb6e('0x5d')](_0xfb6e('0x70'),_0x2bb2a6['user'][_0xfb6e('0x33')]);_0xdfcd0b[_0xfb6e('0x26')]['channel']=_0xdfcd0b[_0xfb6e('0x71')];_0xdfcd0b[_0xfb6e('0x26')][_0xfb6e('0x72')]=_0xdfcd0b[_0xfb6e('0x71')];_0xdfcd0b[_0xfb6e('0x26')][_0xfb6e('0x73')]=_0xfb6e('0x56');return respondWithRpcPromise(_0xfb6e('0x74'),_0xfb6e('0x74'),{'event':_0xfb6e('0x75'),'message':_0xdfcd0b[_0xfb6e('0x26')]},client9002)[_0xfb6e('0x1e')](function(){return _0xdfcd0b;});}return _0xdfcd0b;}return null;})[_0xfb6e('0x1e')](respondWithResult(_0x5ba476,null))[_0xfb6e('0x27')](handleError(_0x5ba476,null));};var interaction_log=require(_0xfb6e('0x11'))(_0xfb6e('0x55'));exports[_0xfb6e('0x76')]=function(_0x422c4b,_0x5c65d4,_0x512a73){var _0x5c8739={'agent':{},'channel':_0xfb6e('0x57')};if(_0x422c4b[_0xfb6e('0x50')]['id']){delete _0x422c4b[_0xfb6e('0x50')]['id'];}_0x422c4b[_0xfb6e('0x50')][_0xfb6e('0x59')]=_0x422c4b[_0xfb6e('0x50')][_0xfb6e('0x59')]||_0x422c4b[_0xfb6e('0x5a')]['id'];_0x5c8739[_0xfb6e('0x6a')]['id']=_0x422c4b['body'][_0xfb6e('0x59')];return db[_0xfb6e('0x4a')][_0xfb6e('0x51')]({'where':{'id':_0x422c4b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c65d4,null))[_0xfb6e('0x1e')](function(_0x11df0c){if(_0x11df0c){_0x5c8739['message']=_0x11df0c[_0xfb6e('0x5b')]({'plain':!![]});return db['OpenchannelInteraction'][_0xfb6e('0x51')]({'where':{'id':_0x11df0c['OpenchannelInteractionId']}});}return null;})[_0xfb6e('0x1e')](handleEntityNotFound(_0x5c65d4,null))[_0xfb6e('0x1e')](function(_0x4317b3){if(_0x4317b3){_0x5c8739[_0xfb6e('0x60')]=_0x4317b3[_0xfb6e('0x5b')]({'plain':!![]});interaction_log[_0xfb6e('0x5f')](_0xfb6e('0x77'),_0x422c4b[_0xfb6e('0x5a')]['id'],_0x422c4b['user'][_0xfb6e('0x33')],_0x422c4b[_0xfb6e('0x5a')]['role'],_0x5c8739[_0xfb6e('0x60')]['id'],_0x422c4b['body']?JSON[_0xfb6e('0x22')](_0x422c4b[_0xfb6e('0x50')]):_0xfb6e('0x61'));return respondWithRpcPromise(_0xfb6e('0x78'),_0xfb6e('0x79'),_0x5c8739);}return null;})['then'](function(_0x439661){var _0x3743b3=_0xfb6e('0x64')+_0x439661[_0xfb6e('0x26')][_0xfb6e('0x7a')];return db['sequelize']['query'](_0x3743b3,{'type':db[_0xfb6e('0x66')][_0xfb6e('0x7b')]['SELECT'],'raw':!![]})[_0xfb6e('0x1e')](function(_0x14712e){return _0x14712e;});})[_0xfb6e('0x1e')](function(_0x33fb2b){if(_0x33fb2b){_0x5c8739[_0xfb6e('0x26')][_0xfb6e('0x68')]=_0x33fb2b[0x0];if(!_0x422c4b[_0xfb6e('0x50')][_0xfb6e('0x59')])return;return db['User'][_0xfb6e('0x51')]({'where':{'id':_0x422c4b[_0xfb6e('0x50')][_0xfb6e('0x59')],'role':_0xfb6e('0x6a')},'attributes':['id',_0xfb6e('0x33'),_0xfb6e('0x6b'),_0xfb6e('0x6c'),'internal'],'raw':!![]});}return null;})[_0xfb6e('0x1e')](function(_0x1d50ff){if(!_0x1d50ff)return null;_0x5c8739[_0xfb6e('0x26')][_0xfb6e('0x6a')]=_0x1d50ff;return _0x5c8739;})[_0xfb6e('0x1e')](function(_0x1b4347){if(_0x1b4347){_0x1b4347[_0xfb6e('0x26')][_0xfb6e('0x6f')]=util['format'](_0xfb6e('0x70'),_0x422c4b[_0xfb6e('0x5a')][_0xfb6e('0x33')]);_0x1b4347[_0xfb6e('0x26')][_0xfb6e('0x71')]=_0x5c8739[_0xfb6e('0x71')];_0x1b4347[_0xfb6e('0x26')][_0xfb6e('0x72')]=_0x5c8739[_0xfb6e('0x71')];_0x1b4347[_0xfb6e('0x26')][_0xfb6e('0x73')]=_0xfb6e('0x76');respondWithRpcPromise(_0xfb6e('0x74'),'EventManager',{'event':'rejectmessage','message':_0x1b4347['message']},client9002);return _0x5c8739;}return null;})['then'](respondWithResult(_0x5c65d4,null))[_0xfb6e('0x27')](handleError(_0x5c65d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 385b000..401b08f 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 _0xfd03=['update','remove','emit','hook','events','../../mysqldb','OpenchannelMessage','save'];(function(_0x44f698,_0x3a2b2b){var _0x4a1308=function(_0x4af522){while(--_0x4af522){_0x44f698['push'](_0x44f698['shift']());}};_0x4a1308(++_0x3a2b2b);}(_0xfd03,0x1b4));var _0x3fd0=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xfd03[_0x4fa0ea];return _0x51d027;};'use strict';var EventEmitter=require(_0x3fd0('0x0'));var OpenchannelMessage=require(_0x3fd0('0x1'))['db'][_0x3fd0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3fd0('0x3'),'afterUpdate':_0x3fd0('0x4'),'afterDestroy':_0x3fd0('0x5')};function emitEvent(_0x50a4a2){return function(_0xc5f816,_0x31c2fd,_0x15387e){OpenchannelMessageEvents[_0x3fd0('0x6')](_0x50a4a2+':'+_0xc5f816['id'],_0xc5f816);OpenchannelMessageEvents[_0x3fd0('0x6')](_0x50a4a2,_0xc5f816);_0x15387e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x3fd0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x6d72=['hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0x6d72,0x1d8));var _0x26d7=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6d72[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x26d7('0x0'))['db'][_0x26d7('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x26d7('0x2')](0x0);var events={'afterCreate':_0x26d7('0x3'),'afterUpdate':_0x26d7('0x4'),'afterDestroy':_0x26d7('0x5')};function emitEvent(_0x1d8e11){return function(_0x26912f,_0x558d15,_0x583487){OpenchannelMessageEvents[_0x26d7('0x6')](_0x1d8e11+':'+_0x26912f['id'],_0x26912f);OpenchannelMessageEvents[_0x26d7('0x6')](_0x1d8e11,_0x26912f);_0x583487(null);};}for(var e in events){if(events[_0x26d7('0x7')](e)){var event=events[e];OpenchannelMessage[_0x26d7('0x8')](e,emitEvent(event));}}module[_0x26d7('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 82d8fc2..67f7ffe 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 _0x3461=['OpenchannelInteractionId','then','update','createdAt','catch','out','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne'];(function(_0x5e40a3,_0x3d7c6){var _0x38c47f=function(_0x3a4041){while(--_0x3a4041){_0x5e40a3['push'](_0x5e40a3['shift']());}};_0x38c47f(++_0x3d7c6);}(_0x3461,0x1b6));var _0x1346=function(_0x24b168,_0x286dae){_0x24b168=_0x24b168-0x0;var _0xe99b4d=_0x3461[_0x24b168];return _0xe99b4d;};'use strict';var _=require(_0x1346('0x0'));var util=require(_0x1346('0x1'));var logger=require('../../config/logger')(_0x1346('0x2'));var moment=require('moment');var BPromise=require(_0x1346('0x3'));var rp=require(_0x1346('0x4'));var fs=require('fs');var path=require(_0x1346('0x5'));var rimraf=require(_0x1346('0x6'));var config=require(_0x1346('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x1346('0x8')]=function(_0x320edb,_0x5b69b9){return _0x320edb['define']('OpenchannelMessage',attributes,{'tableName':_0x1346('0x9'),'paranoid':![],'indexes':[{'name':_0x1346('0xa'),'fields':[_0x1346('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe92919,_0x2f3e13,_0x5462ed){var _0x1254b7=_0x320edb[_0x1346('0xc')];var _0x3c97ac=_0xe92919[_0x1346('0xd')]({'plain':!![]});if(_0x3c97ac[_0x1346('0xe')][_0x1346('0xf')]()==='in'||_0x3c97ac['direction']['toLowerCase']()==='out'&&!_0x3c97ac[_0x1346('0x10')]&&!_[_0x1346('0x11')](_0x3c97ac[_0x1346('0x12')])){_0x1254b7[_0x1346('0x13')][_0x1346('0x14')]({'where':{'id':_0x3c97ac[_0x1346('0x15')]}})[_0x1346('0x16')](function(_0x378b26){if(_0x378b26){_0x378b26[_0x1346('0x17')]({'lastMsgAt':_0x3c97ac[_0x1346('0x18')],'lastMsgDirection':_0x3c97ac[_0x1346('0xe')][_0x1346('0xf')]()});}})[_0x1346('0x19')](function(_0x2c1e4d){console['error'](_0x2c1e4d);});}if(_0x3c97ac[_0x1346('0xe')]===_0x1346('0x1a')&&!_0x3c97ac[_0x1346('0x10')]){var _0x488c88;_0x1254b7[_0x1346('0x1b')][_0x1346('0x1c')]()[_0x1346('0x16')](function(_0xf40c8c){return _0x1254b7[_0x1346('0x1d')][_0x1346('0x1e')]({'where':{'id':_0x3c97ac['OpenchannelAccountId']},'include':[{'model':_0x1254b7[_0x1346('0x13')],'as':_0x1346('0x1f'),'where':{'id':_0x3c97ac[_0x1346('0x15')]},'limit':0x1,'include':[{'model':_0x1254b7[_0x1346('0x1b')],'as':_0x1346('0x20'),'attributes':_[_0x1346('0x21')](_0xf40c8c)}]}]});})['then'](function(_0x41fa99){_0x488c88=_0x41fa99['get']({'plain':!![]});if(_0x488c88&&_0x488c88[_0x1346('0x22')]){logger['info'](_0x1346('0x23'),'afterCreate',util[_0x1346('0x24')](_0x1346('0x25'),_0x3c97ac['id'],_0x488c88[_0x1346('0x22')]));if(_0x488c88[_0x1346('0x1f')]&&_0x488c88[_0x1346('0x1f')][_0x1346('0x26')]){_0x3c97ac[_0x1346('0x27')]=_[_0x1346('0x28')](_0x488c88[_0x1346('0x1f')][0x0],_0x1346('0x20'));_0x3c97ac[_0x1346('0x20')]=_0x488c88[_0x1346('0x1f')][0x0]['Contact'];}var _0x2f3e13={'method':_0x1346('0x29'),'uri':encodeURI(_0x488c88[_0x1346('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2f3e13['method']){case _0x1346('0x2a'):_0x2f3e13['qs']=_0x3c97ac;break;case _0x1346('0x29'):_0x2f3e13['body']=_0x3c97ac;break;}return rp(_0x2f3e13)[_0x1346('0x16')](function(_0x207bc6){logger[_0x1346('0x2b')](_0x1346('0x23'),_0x1346('0x2c'),util[_0x1346('0x24')](_0x1346('0x2d'),_0x3c97ac['id'],_0x488c88[_0x1346('0x22')]));if(_0x207bc6[_0x1346('0xb')][_0x1346('0x2e')]&&_0x207bc6[_0x1346('0xb')]['threadId']!=_0x3c97ac[_0x1346('0x27')][_0x1346('0x2e')]){return _0x1254b7['OpenchannelInteraction']['update']({'threadId':_0x207bc6[_0x1346('0xb')][_0x1346('0x2e')]},{'where':{'id':_0x3c97ac[_0x1346('0x27')]['id']}});}else{return;}})[_0x1346('0x16')](function(){return _0xe92919['update']({'read':!![]});})[_0x1346('0x19')](function(_0x5e389c){logger[_0x1346('0x2f')](_0x1346('0x23'),_0x1346('0x2c'),util[_0x1346('0x30')](_0x5e389c,{'showHidden':![],'depth':null}));_0x5462ed();});}else{_0x5462ed();}})[_0x1346('0x31')](function(){_0x5462ed();});}else{_0x5462ed();}}},'charset':'utf8mb4','collate':_0x1346('0x32')});}; \ No newline at end of file +var _0x8a3e=['UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','secret','CmContact','then','OpenchannelAccount','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','body','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','define','openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil'];(function(_0x5e78e7,_0x3c7c89){var _0x56c2c3=function(_0x5624c1){while(--_0x5624c1){_0x5e78e7['push'](_0x5e78e7['shift']());}};_0x56c2c3(++_0x3c7c89);}(_0x8a3e,0xbe));var _0xe8a3=function(_0x52e3fc,_0x4ecefc){_0x52e3fc=_0x52e3fc-0x0;var _0x45e49b=_0x8a3e[_0x52e3fc];return _0x45e49b;};'use strict';var _=require(_0xe8a3('0x0'));var util=require(_0xe8a3('0x1'));var logger=require(_0xe8a3('0x2'))('api');var moment=require(_0xe8a3('0x3'));var BPromise=require(_0xe8a3('0x4'));var rp=require(_0xe8a3('0x5'));var fs=require('fs');var path=require(_0xe8a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe8a3('0x7'));module[_0xe8a3('0x8')]=function(_0x23b5e2,_0x55c5eb){return _0x23b5e2[_0xe8a3('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xe8a3('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0xe8a3('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a8719,_0xa85b46,_0x23e9c6){var _0x5ae7d8=_0x23b5e2[_0xe8a3('0xc')];var _0x3dcd36=_0x1a8719[_0xe8a3('0xd')]({'plain':!![]});if(_0x3dcd36[_0xe8a3('0xe')][_0xe8a3('0xf')]()==='in'||_0x3dcd36[_0xe8a3('0xe')]['toLowerCase']()===_0xe8a3('0x10')&&!_0x3dcd36['secret']&&!_[_0xe8a3('0x11')](_0x3dcd36[_0xe8a3('0x12')])){_0x5ae7d8[_0xe8a3('0x13')][_0xe8a3('0x14')]({'where':{'id':_0x3dcd36[_0xe8a3('0x15')]}})['then'](function(_0xdce711){if(_0xdce711){_0xdce711[_0xe8a3('0x16')]({'lastMsgAt':_0x3dcd36[_0xe8a3('0x17')],'lastMsgDirection':_0x3dcd36[_0xe8a3('0xe')]['toLowerCase']()});}})[_0xe8a3('0x18')](function(_0x47124b){console['error'](_0x47124b);});}if(_0x3dcd36[_0xe8a3('0xe')]===_0xe8a3('0x10')&&!_0x3dcd36[_0xe8a3('0x19')]){var _0x3bde25;_0x5ae7d8[_0xe8a3('0x1a')]['describe']()[_0xe8a3('0x1b')](function(_0x462011){return _0x5ae7d8[_0xe8a3('0x1c')]['find']({'where':{'id':_0x3dcd36['OpenchannelAccountId']},'include':[{'model':_0x5ae7d8[_0xe8a3('0x13')],'as':_0xe8a3('0x1d'),'where':{'id':_0x3dcd36['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5ae7d8[_0xe8a3('0x1a')],'as':_0xe8a3('0x1e'),'attributes':_[_0xe8a3('0x1f')](_0x462011)}]}]});})[_0xe8a3('0x1b')](function(_0x51a674){_0x3bde25=_0x51a674[_0xe8a3('0xd')]({'plain':!![]});if(_0x3bde25&&_0x3bde25[_0xe8a3('0x20')]){logger['info'](_0xe8a3('0x21'),_0xe8a3('0x22'),util[_0xe8a3('0x23')](_0xe8a3('0x24'),_0x3dcd36['id'],_0x3bde25[_0xe8a3('0x20')]));if(_0x3bde25[_0xe8a3('0x1d')]&&_0x3bde25[_0xe8a3('0x1d')][_0xe8a3('0x25')]){_0x3dcd36['Interaction']=_[_0xe8a3('0x26')](_0x3bde25['Interactions'][0x0],_0xe8a3('0x1e'));_0x3dcd36['Contact']=_0x3bde25['Interactions'][0x0][_0xe8a3('0x1e')];}var _0xa85b46={'method':_0xe8a3('0x27'),'uri':encodeURI(_0x3bde25[_0xe8a3('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa85b46[_0xe8a3('0x28')]){case _0xe8a3('0x29'):_0xa85b46['qs']=_0x3dcd36;break;case _0xe8a3('0x27'):_0xa85b46[_0xe8a3('0x2a')]=_0x3dcd36;break;}return rp(_0xa85b46)[_0xe8a3('0x1b')](function(_0x526e53){logger[_0xe8a3('0x2b')](_0xe8a3('0x21'),_0xe8a3('0x22'),util[_0xe8a3('0x23')](_0xe8a3('0x2c'),_0x3dcd36['id'],_0x3bde25[_0xe8a3('0x20')]));if(_0x526e53[_0xe8a3('0x2a')][_0xe8a3('0x2d')]&&_0x526e53[_0xe8a3('0x2a')]['threadId']!=_0x3dcd36[_0xe8a3('0x2e')][_0xe8a3('0x2d')]){return _0x5ae7d8[_0xe8a3('0x13')][_0xe8a3('0x16')]({'threadId':_0x526e53[_0xe8a3('0x2a')][_0xe8a3('0x2d')]},{'where':{'id':_0x3dcd36['Interaction']['id']}});}else{return;}})['then'](function(){return _0x1a8719[_0xe8a3('0x16')]({'read':!![]});})[_0xe8a3('0x18')](function(_0x5dceac){logger[_0xe8a3('0x2f')](_0xe8a3('0x21'),_0xe8a3('0x22'),util[_0xe8a3('0x30')](_0x5dceac,{'showHidden':![],'depth':null}));_0x23e9c6();});}else{_0x23e9c6();}})[_0xe8a3('0x31')](function(){_0x23e9c6();});}else{_0x23e9c6();}}},'charset':_0xe8a3('0x32'),'collate':_0xe8a3('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 8e17019..36314b4 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 _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(_0x2d167b,_0x44ef83){var _0x2e6a5c=function(_0x5a0746){while(--_0x5a0746){_0x2d167b['push'](_0x2d167b['shift']());}};_0x2e6a5c(++_0x44ef83);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'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 +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(_0x132d7e,_0x567253){var _0x4558b0=function(_0x25b35b){while(--_0x25b35b){_0x132d7e['push'](_0x132d7e['shift']());}};_0x4558b0(++_0x567253);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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 733b923..23857f2 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 _0x37a7=['openchannelMessage:','./openchannelMessage.events','save','removeListener','register'];(function(_0x124269,_0x161b31){var _0x231ac3=function(_0x297925){while(--_0x297925){_0x124269['push'](_0x124269['shift']());}};_0x231ac3(++_0x161b31);}(_0x37a7,0x6f));var _0x737a=function(_0x15f602,_0x28d602){_0x15f602=_0x15f602-0x0;var _0x4a7377=_0x37a7[_0x15f602];return _0x4a7377;};'use strict';var OpenchannelMessageEvents=require(_0x737a('0x0'));var events=[_0x737a('0x1'),'remove','update'];function createListener(_0x5a259b,_0x2d4b54){return function(_0xc5eaef){_0x2d4b54['emit'](_0x5a259b,_0xc5eaef);};}function removeListener(_0x524516,_0x4af128){return function(){OpenchannelMessageEvents[_0x737a('0x2')](_0x524516,_0x4af128);};}exports[_0x737a('0x3')]=function(_0x7f4eed){for(var _0x11109c=0x0,_0x2f6800=events['length'];_0x11109c<_0x2f6800;_0x11109c++){var _0x244850=events[_0x11109c];var _0x249898=createListener(_0x737a('0x4')+_0x244850,_0x7f4eed);OpenchannelMessageEvents['on'](_0x244850,_0x249898);}}; \ No newline at end of file +var _0x548f=['openchannelMessage:','./openchannelMessage.events','save','remove','removeListener','register','length'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x548f,0x104));var _0xf548=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x548f[_0x42cae2];return _0x5f256f;};'use strict';var OpenchannelMessageEvents=require(_0xf548('0x0'));var events=[_0xf548('0x1'),_0xf548('0x2'),'update'];function createListener(_0x3c25b1,_0x3edaed){return function(_0x165140){_0x3edaed['emit'](_0x3c25b1,_0x165140);};}function removeListener(_0x5a6d7a,_0xefe728){return function(){OpenchannelMessageEvents[_0xf548('0x3')](_0x5a6d7a,_0xefe728);};}exports[_0xf548('0x4')]=function(_0x1b5b52){for(var _0x46459d=0x0,_0xd792cd=events[_0xf548('0x5')];_0x46459d<_0xd792cd;_0x46459d++){var _0x5bfe40=events[_0x46459d];var _0x25aa35=createListener(_0xf548('0x6')+_0x5bfe40,_0x1b5b52);OpenchannelMessageEvents['on'](_0x5bfe40,_0x25aa35);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9d29235..8b66c8c 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 _0x3365=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2952e8,_0xdebf50){var _0x3e4676=function(_0x34dc36){while(--_0x34dc36){_0x2952e8['push'](_0x2952e8['shift']());}};_0x3e4676(++_0xdebf50);}(_0x3365,0x1eb));var _0x5336=function(_0x19ff34,_0x19f930){_0x19ff34=_0x19ff34-0x0;var _0x5cd174=_0x3365[_0x19ff34];return _0x5cd174;};'use strict';var multer=require(_0x5336('0x0'));var util=require(_0x5336('0x1'));var path=require(_0x5336('0x2'));var timeout=require(_0x5336('0x3'));var express=require(_0x5336('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5336('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5336('0x6'));var controller=require(_0x5336('0x7'));router[_0x5336('0x8')]('/',auth[_0x5336('0x9')](),controller[_0x5336('0xa')]);router[_0x5336('0x8')](_0x5336('0xb'),auth[_0x5336('0x9')](),controller[_0x5336('0xc')]);router[_0x5336('0x8')](_0x5336('0xd'),auth['isAuthenticated'](),controller[_0x5336('0xe')]);router[_0x5336('0x8')](_0x5336('0xf'),auth[_0x5336('0x9')](),controller[_0x5336('0x10')]);router[_0x5336('0x8')](_0x5336('0x11'),auth['isAuthenticated'](),controller[_0x5336('0x12')]);router[_0x5336('0x8')]('/:id/users',auth[_0x5336('0x9')](),controller['getAgents']);router['post']('/',auth[_0x5336('0x9')](),controller[_0x5336('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x5336('0x14')]);router['post'](_0x5336('0x15'),auth[_0x5336('0x9')](),controller['addAgents']);router[_0x5336('0x16')]('/:id',auth[_0x5336('0x9')](),controller[_0x5336('0x17')]);router[_0x5336('0x18')](_0x5336('0xd'),auth['isAuthenticated'](),controller[_0x5336('0x19')]);router[_0x5336('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5336('0x1a')]);router['delete'](_0x5336('0x15'),auth[_0x5336('0x9')](),controller[_0x5336('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xbb21=['removeAgents','exports','path','express','Router','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','destroy','delete'];(function(_0x505f13,_0x34b4bc){var _0x968147=function(_0x37c597){while(--_0x37c597){_0x505f13['push'](_0x505f13['shift']());}};_0x968147(++_0x34b4bc);}(_0xbb21,0xfc));var _0x1bb2=function(_0x215bde,_0x285d0d){_0x215bde=_0x215bde-0x0;var _0x24a735=_0xbb21[_0x215bde];return _0x24a735;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1bb2('0x0'));var timeout=require('connect-timeout');var express=require(_0x1bb2('0x1'));var router=express[_0x1bb2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1bb2('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bb2('0x4'));router[_0x1bb2('0x5')]('/',auth[_0x1bb2('0x6')](),controller['index']);router[_0x1bb2('0x5')](_0x1bb2('0x7'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x8')]);router['get'](_0x1bb2('0x9'),auth[_0x1bb2('0x6')](),controller['show']);router[_0x1bb2('0x5')](_0x1bb2('0xa'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0xb')]);router[_0x1bb2('0x5')](_0x1bb2('0xc'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0xd')]);router[_0x1bb2('0x5')](_0x1bb2('0xe'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0xf')]);router[_0x1bb2('0x10')]('/',auth[_0x1bb2('0x6')](),controller['create']);router[_0x1bb2('0x10')]('/:id/teams',auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x11')]);router['post'](_0x1bb2('0xe'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x12')]);router[_0x1bb2('0x13')]('/:id',auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x14')]);router['delete'](_0x1bb2('0x9'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x15')]);router[_0x1bb2('0x16')](_0x1bb2('0xc'),auth[_0x1bb2('0x6')](),controller['removeTeams']);router[_0x1bb2('0x16')](_0x1bb2('0xe'),auth[_0x1bb2('0x6')](),controller[_0x1bb2('0x17')]);module[_0x1bb2('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index db318c5..c0d6096 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 _0x0b03=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x0b03,0x1a0));var _0x30b0=function(_0x174d5a,_0x11331d){_0x174d5a=_0x174d5a-0x0;var _0x28c59a=_0x0b03[_0x174d5a];return _0x28c59a;};'use strict';var Sequelize=require(_0x30b0('0x0'));module[_0x30b0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x30b0('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x30b0('0x3')](_0x30b0('0x4'),_0x30b0('0x5'),_0x30b0('0x6'))}}; \ No newline at end of file +var _0xc0b4=['beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x20775f,_0x423805){var _0x53d738=function(_0x137734){while(--_0x137734){_0x20775f['push'](_0x20775f['shift']());}};_0x53d738(++_0x423805);}(_0xc0b4,0x164));var _0x4c0b=function(_0x550951,_0x483241){_0x550951=_0x550951-0x0;var _0x576f5b=_0xc0b4[_0x550951];return _0x576f5b;};'use strict';var Sequelize=require(_0x4c0b('0x0'));module[_0x4c0b('0x1')]={'name':{'type':Sequelize[_0x4c0b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4c0b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4c0b('0x4'),_0x4c0b('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 156a9be..02fd599 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 _0xd175=['userOpenchannelQueue:save','removeTeams','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','order','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','forEach'];(function(_0x11f041,_0x5d5b82){var _0x3b7ba4=function(_0x2c6963){while(--_0x2c6963){_0x11f041['push'](_0x11f041['shift']());}};_0x3b7ba4(++_0x5d5b82);}(_0xd175,0xaa));var _0x5d17=function(_0x38b6a5,_0x531fc0){_0x38b6a5=_0x38b6a5-0x0;var _0x4e5d0a=_0xd175[_0x38b6a5];return _0x4e5d0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d17('0x0'));var zipdir=require(_0x5d17('0x1'));var jsonpatch=require(_0x5d17('0x2'));var rp=require(_0x5d17('0x3'));var moment=require(_0x5d17('0x4'));var BPromise=require(_0x5d17('0x5'));var Mustache=require(_0x5d17('0x6'));var util=require(_0x5d17('0x7'));var path=require(_0x5d17('0x8'));var sox=require(_0x5d17('0x9'));var csv=require('to-csv');var ejs=require(_0x5d17('0xa'));var fs=require('fs');var fs_extra=require(_0x5d17('0xb'));var _=require(_0x5d17('0xc'));var squel=require('squel');var crypto=require(_0x5d17('0xd'));var jsforce=require(_0x5d17('0xe'));var deskjs=require(_0x5d17('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d17('0x10'));var Papa=require('papaparse');var Redis=require(_0x5d17('0x11'));var authService=require(_0x5d17('0x12'));var qs=require(_0x5d17('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d17('0x14'));var logger=require(_0x5d17('0x15'))('api');var utils=require(_0x5d17('0x16'));var config=require(_0x5d17('0x17'));var licenseUtil=require(_0x5d17('0x18'));var db=require('../../mysqldb')['db'];config[_0x5d17('0x19')]=_[_0x5d17('0x1a')](config[_0x5d17('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d17('0x1b'))(new Redis(config['redis']));require(_0x5d17('0x1c'))['register'](socket);function respondWithStatusCode(_0x46ccab,_0x55a610){_0x55a610=_0x55a610||0xcc;return function(_0x330f0b){if(_0x330f0b){return _0x46ccab[_0x5d17('0x1d')](_0x55a610);}return _0x46ccab[_0x5d17('0x1e')](_0x55a610)[_0x5d17('0x1f')]();};}function respondWithResult(_0x2ca8de,_0x260d9){_0x260d9=_0x260d9||0xc8;return function(_0x54ce27){if(_0x54ce27){return _0x2ca8de[_0x5d17('0x1e')](_0x260d9)[_0x5d17('0x20')](_0x54ce27);}};}function respondWithFilteredResult(_0x2f7821,_0xfd79d7){return function(_0x41039e){if(_0x41039e){var _0x25fe49=typeof _0xfd79d7[_0x5d17('0x21')]===_0x5d17('0x22')&&typeof _0xfd79d7['limit']===_0x5d17('0x22');var _0x731f9a=_0x41039e[_0x5d17('0x23')];var _0x31405a=_0x25fe49?0x0:_0xfd79d7[_0x5d17('0x21')];var _0x3be4a4=_0x25fe49?_0x41039e[_0x5d17('0x23')]:_0xfd79d7[_0x5d17('0x21')]+_0xfd79d7[_0x5d17('0x24')];var _0x15ddbf;if(_0x3be4a4>=_0x731f9a){_0x3be4a4=_0x731f9a;_0x15ddbf=0xc8;}else{_0x15ddbf=0xce;}_0x2f7821[_0x5d17('0x1e')](_0x15ddbf);return _0x2f7821[_0x5d17('0x25')](_0x5d17('0x26'),_0x31405a+'-'+_0x3be4a4+'/'+_0x731f9a)[_0x5d17('0x20')](_0x41039e);}return null;};}function patchUpdates(_0x39dbf6){return function(_0x33f850){try{jsonpatch[_0x5d17('0x27')](_0x33f850,_0x39dbf6,!![]);}catch(_0x25ac2a){return BPromise[_0x5d17('0x28')](_0x25ac2a);}return _0x33f850[_0x5d17('0x29')]();};}function saveUpdates(_0x58c2b7,_0x1e853c){return function(_0x2ba57d){if(_0x2ba57d){return _0x2ba57d[_0x5d17('0x2a')](_0x58c2b7)['then'](function(_0x25fc3f){return _0x25fc3f;});}return null;};}function removeEntity(_0x20ce63,_0x1d62f1){return function(_0x1528bb){if(_0x1528bb){return _0x1528bb[_0x5d17('0x2b')]()[_0x5d17('0x2c')](function(){var _0x26fe90=_0x1528bb[_0x5d17('0x2d')]({'plain':!![]});var _0x71bd6c=_0x5d17('0x2e');return db[_0x5d17('0x2f')][_0x5d17('0x2b')]({'where':{'type':_0x71bd6c,'resourceId':_0x26fe90['id']}})[_0x5d17('0x2c')](function(){return _0x1528bb;});})[_0x5d17('0x2c')](function(){_0x20ce63[_0x5d17('0x1e')](0xcc)[_0x5d17('0x1f')]();});}};}function handleEntityNotFound(_0x56c1fe,_0x206028){return function(_0x5e8a75){if(!_0x5e8a75){_0x56c1fe[_0x5d17('0x1d')](0x194);}return _0x5e8a75;};}function handleError(_0x5612b9,_0x127646){_0x127646=_0x127646||0x1f4;return function(_0x43c21c){logger[_0x5d17('0x30')](_0x43c21c[_0x5d17('0x31')]);if(_0x43c21c['name']){delete _0x43c21c[_0x5d17('0x32')];}_0x5612b9['status'](_0x127646)[_0x5d17('0x33')](_0x43c21c);};}exports[_0x5d17('0x34')]=function(_0x4b7ef0,_0x297f27){var _0x3e8aa4={},_0x13ef2d={},_0x1de624={'count':0x0,'rows':[]};var _0x3deafd=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x46e143){return{'name':_0x46e143[_0x5d17('0x35')],'type':_0x46e143[_0x5d17('0x36')][_0x5d17('0x37')]};});_0x13ef2d[_0x5d17('0x38')]=_[_0x5d17('0x39')](_0x3deafd,_0x5d17('0x32'));_0x13ef2d[_0x5d17('0x3a')]=_[_0x5d17('0x3b')](_0x4b7ef0[_0x5d17('0x3a')]);_0x13ef2d['filters']=_['intersection'](_0x13ef2d[_0x5d17('0x38')],_0x13ef2d[_0x5d17('0x3a')]);_0x3e8aa4[_0x5d17('0x3c')]=_[_0x5d17('0x3d')](_0x13ef2d['model'],qs[_0x5d17('0x3e')](_0x4b7ef0[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x3e8aa4[_0x5d17('0x3c')]=_0x3e8aa4[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x3e8aa4[_0x5d17('0x3c')]:_0x13ef2d[_0x5d17('0x38')];if(!_0x4b7ef0[_0x5d17('0x3a')][_0x5d17('0x40')]('nolimit')){_0x3e8aa4[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x4b7ef0[_0x5d17('0x3a')]['limit']);_0x3e8aa4[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x4b7ef0[_0x5d17('0x3a')]['offset']);}_0x3e8aa4['order']=qs[_0x5d17('0x41')](_0x4b7ef0['query']['sort']);_0x3e8aa4[_0x5d17('0x42')]=qs['filters'](_[_0x5d17('0x43')](_0x4b7ef0['query'],_0x13ef2d['filters']),_0x3deafd);if(_0x4b7ef0['query']['filter']){_0x3e8aa4[_0x5d17('0x42')]=_['merge'](_0x3e8aa4[_0x5d17('0x42')],{'$or':_['map'](_0x3deafd,function(_0x272233){if(_0x272233['type']!==_0x5d17('0x44')){var _0x58a4cf={};_0x58a4cf[_0x272233['name']]={'$like':'%'+_0x4b7ef0[_0x5d17('0x3a')]['filter']+'%'};return _0x58a4cf;}})});}_0x3e8aa4=_['merge']({},_0x3e8aa4,_0x4b7ef0['options']);var _0xef7e12={'where':_0x3e8aa4['where']};return db[_0x5d17('0x45')][_0x5d17('0x23')](_0xef7e12)[_0x5d17('0x2c')](function(_0x5b3035){_0x1de624['count']=_0x5b3035;if(_0x4b7ef0['query'][_0x5d17('0x46')]){_0x3e8aa4[_0x5d17('0x47')]=[{'all':!![]}];}return db[_0x5d17('0x45')][_0x5d17('0x48')](_0x3e8aa4);})['then'](function(_0x20267f){_0x1de624[_0x5d17('0x49')]=_0x20267f;return _0x1de624;})[_0x5d17('0x2c')](respondWithFilteredResult(_0x297f27,_0x3e8aa4))[_0x5d17('0x4a')](handleError(_0x297f27,null));};exports[_0x5d17('0x4b')]=function(_0x5c0409,_0x14b9bd){var _0x5c13a8={'raw':!![],'where':{'id':_0x5c0409[_0x5d17('0x4c')]['id']}},_0x2d7a40={};_0x2d7a40['model']=_['keys'](db[_0x5d17('0x45')][_0x5d17('0x4d')]);_0x2d7a40[_0x5d17('0x3a')]=_['keys'](_0x5c0409['query']);_0x2d7a40[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x2d7a40['model'],_0x2d7a40[_0x5d17('0x3a')]);_0x5c13a8['attributes']=_['intersection'](_0x2d7a40[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x5c0409['query'][_0x5d17('0x3e')]));_0x5c13a8[_0x5d17('0x3c')]=_0x5c13a8[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x5c13a8[_0x5d17('0x3c')]:_0x2d7a40[_0x5d17('0x38')];if(_0x5c0409[_0x5d17('0x3a')][_0x5d17('0x46')]){_0x5c13a8[_0x5d17('0x47')]=[{'all':!![]}];}_0x5c13a8=_[_0x5d17('0x4f')]({},_0x5c13a8,_0x5c0409[_0x5d17('0x50')]);return db[_0x5d17('0x45')][_0x5d17('0x51')](_0x5c13a8)[_0x5d17('0x2c')](handleEntityNotFound(_0x14b9bd,null))['then'](respondWithResult(_0x14b9bd,null))[_0x5d17('0x4a')](handleError(_0x14b9bd,null));};exports['create']=function(_0x245796,_0x2b9bd5){return db['OpenchannelQueue']['create'](_0x245796[_0x5d17('0x52')],{})[_0x5d17('0x2c')](function(_0x4a84ba){var _0x2b109e=_0x245796[_0x5d17('0x53')][_0x5d17('0x2d')]({'plain':!![]});if(!_0x2b109e)throw new Error(_0x5d17('0x54'));if(_0x2b109e[_0x5d17('0x55')]===_0x5d17('0x53')){var _0x381cae=_0x4a84ba[_0x5d17('0x2d')]({'plain':!![]});var _0x13fcb5=_0x5d17('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x13fcb5,'userProfileId':_0x2b109e[_0x5d17('0x56')]},'raw':!![]})[_0x5d17('0x2c')](function(_0x310674){if(_0x310674&&_0x310674['autoAssociation']===0x0){return db[_0x5d17('0x2f')]['create']({'name':_0x381cae[_0x5d17('0x32')],'resourceId':_0x381cae['id'],'type':_0x310674[_0x5d17('0x32')],'sectionId':_0x310674['id']},{})[_0x5d17('0x2c')](function(){return _0x4a84ba;});}else{return _0x4a84ba;}})['catch'](function(_0x23c4af){logger[_0x5d17('0x30')](_0x5d17('0x57'),_0x23c4af);throw _0x23c4af;});}return _0x4a84ba;})[_0x5d17('0x2c')](respondWithResult(_0x2b9bd5,0xc9))[_0x5d17('0x4a')](handleError(_0x2b9bd5,null));};exports['update']=function(_0x17179d,_0x20b0b4){if(_0x17179d[_0x5d17('0x52')]['id']){delete _0x17179d['body']['id'];}return db[_0x5d17('0x45')]['find']({'where':{'id':_0x17179d[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x20b0b4,null))['then'](saveUpdates(_0x17179d[_0x5d17('0x52')],null))['then'](respondWithResult(_0x20b0b4,null))[_0x5d17('0x4a')](handleError(_0x20b0b4,null));};exports[_0x5d17('0x2b')]=function(_0x171191,_0x110488){return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x171191[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x110488,null))[_0x5d17('0x2c')](removeEntity(_0x110488,null))[_0x5d17('0x4a')](handleError(_0x110488,null));};exports['describe']=function(_0xa9c1f,_0x22162b){return db[_0x5d17('0x45')][_0x5d17('0x58')]()[_0x5d17('0x2c')](respondWithResult(_0x22162b,null))[_0x5d17('0x4a')](handleError(_0x22162b,null));};exports[_0x5d17('0x59')]=function(_0x2b051a,_0x3421e3,_0x269a55){var _0x5bfd58={'raw':!![],'where':{}},_0x4ac89f={},_0x573f2d;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x2b051a[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x3421e3,null))[_0x5d17('0x2c')](function(_0x598ee5){if(_0x598ee5){_0x573f2d=_0x598ee5[_0x5d17('0x2d')]({'plain':!![]});_0x4ac89f[_0x5d17('0x38')]=_[_0x5d17('0x3b')](db['UserOpenchannelQueue'][_0x5d17('0x4d')]);_0x4ac89f['query']=_['keys'](_0x2b051a[_0x5d17('0x3a')]);_0x4ac89f['filters']=_[_0x5d17('0x3d')](_0x4ac89f[_0x5d17('0x38')],_0x4ac89f[_0x5d17('0x3a')]);_0x5bfd58[_0x5d17('0x3c')]=_['intersection'](_0x4ac89f[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x5bfd58[_0x5d17('0x3c')]=_0x5bfd58[_0x5d17('0x3c')]['length']?_0x5bfd58[_0x5d17('0x3c')]:_0x4ac89f[_0x5d17('0x38')];if(!_0x2b051a['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x5bfd58['limit']=qs[_0x5d17('0x24')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x5bfd58[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x21')]);}_0x5bfd58[_0x5d17('0x5c')]=qs[_0x5d17('0x41')](_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x41')]);_0x5bfd58['where']=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x2b051a[_0x5d17('0x3a')],_0x4ac89f[_0x5d17('0x4e')]));_0x5bfd58[_0x5d17('0x42')][_0x5d17('0x5d')]=_0x598ee5['id'];if(_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x5e')]){_0x5bfd58[_0x5d17('0x42')]=_['merge'](_0x5bfd58[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x5bfd58[_0x5d17('0x3c')],function(_0x20ea71){var _0x18d00d={};_0x18d00d[_0x20ea71]={'$like':'%'+_0x2b051a[_0x5d17('0x3a')][_0x5d17('0x5e')]+'%'};return _0x18d00d;})});}_0x5bfd58=_['merge']({},_0x5bfd58,_0x2b051a[_0x5d17('0x50')]);return db['UserOpenchannelQueue'][_0x5d17('0x48')](_0x5bfd58);}})[_0x5d17('0x2c')](function(_0x13e58b){if(_0x13e58b){return db[_0x5d17('0x5f')][_0x5d17('0x60')]({'where':{'id':_[_0x5d17('0x39')](_0x13e58b,_0x5d17('0x61')),'role':_0x5d17('0x62')},'attributes':['id',_0x5d17('0x32'),_0x5d17('0x63'),_0x5d17('0x64'),'createdAt']});}})[_0x5d17('0x2c')](function(_0x280f40){if(_0x280f40){return{'count':_0x280f40[_0x5d17('0x23')],'rows':_[_0x5d17('0x39')](_0x280f40[_0x5d17('0x49')],function(_0x1b9e27){return{'membername':_0x1b9e27['name'],'UserId':_0x1b9e27['id'],'queue_name':_0x573f2d[_0x5d17('0x32')],'OpenchannelQueueId':_0x573f2d['id'],'interface':util['format']('%s/%s',_0x5d17('0x65'),_0x1b9e27['name']),'penalty':0x0,'paused':_0x1b9e27['openchannelPause'],'createdAt':_0x1b9e27[_0x5d17('0x66')],'updatedAt':_0x1b9e27[_0x5d17('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d17('0x2c')](respondWithFilteredResult(_0x3421e3,_0x5bfd58))['catch'](handleError(_0x3421e3,null));};exports[_0x5d17('0x67')]=function(_0x303867,_0x438bb5,_0x5a59c9){var _0x3e0881={};var _0x38b883={};var _0x747594;var _0x33283b;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x303867[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x438bb5,null))['then'](function(_0x36fc43){if(_0x36fc43){_0x747594=_0x36fc43;_0x38b883[_0x5d17('0x38')]=_['keys'](db[_0x5d17('0x68')][_0x5d17('0x4d')]);_0x38b883[_0x5d17('0x3a')]=_['keys'](_0x303867[_0x5d17('0x3a')]);_0x38b883[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x38b883['model'],_0x38b883[_0x5d17('0x3a')]);_0x3e0881[_0x5d17('0x3c')]=_[_0x5d17('0x3d')](_0x38b883['model'],qs[_0x5d17('0x3e')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x3e0881[_0x5d17('0x3c')]=_0x3e0881['attributes'][_0x5d17('0x3f')]?_0x3e0881[_0x5d17('0x3c')]:_0x38b883['model'];_0x3e0881[_0x5d17('0x5c')]=qs[_0x5d17('0x41')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x41')]);_0x3e0881[_0x5d17('0x42')]=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x303867[_0x5d17('0x3a')],_0x38b883[_0x5d17('0x4e')]));if(_0x303867['query'][_0x5d17('0x5e')]){_0x3e0881[_0x5d17('0x42')]=_[_0x5d17('0x4f')](_0x3e0881[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x3e0881[_0x5d17('0x3c')],function(_0x168b18){var _0x140cdb={};_0x140cdb[_0x168b18]={'$like':'%'+_0x303867[_0x5d17('0x3a')]['filter']+'%'};return _0x140cdb;})});}_0x3e0881=_[_0x5d17('0x4f')]({},_0x3e0881,_0x303867[_0x5d17('0x50')]);return _0x747594[_0x5d17('0x67')](_0x3e0881);}})['then'](function(_0x2a70af){if(_0x2a70af){_0x33283b=_0x2a70af[_0x5d17('0x3f')];if(!_0x303867['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x3e0881[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x3e0881[_0x5d17('0x21')]=qs[_0x5d17('0x21')](_0x303867[_0x5d17('0x3a')][_0x5d17('0x21')]);}return _0x747594[_0x5d17('0x67')](_0x3e0881);}})[_0x5d17('0x2c')](function(_0xc41114){if(_0xc41114){return _0xc41114?{'count':_0x33283b,'rows':_0xc41114}:null;}})['then'](respondWithResult(_0x438bb5,null))['catch'](handleError(_0x438bb5,null));};exports[_0x5d17('0x69')]=function(_0x11ee2a,_0x3705a7,_0x564df1){var _0x3e0339=_0x11ee2a[_0x5d17('0x52')][_0x5d17('0x6a')];return db[_0x5d17('0x68')][_0x5d17('0x48')]({'where':{'id':_0x3e0339},'attributes':['id'],'include':[{'model':db[_0x5d17('0x5f')],'as':_0x5d17('0x6b'),'attributes':['id',_0x5d17('0x32'),_0x5d17('0x6c'),_0x5d17('0x6d'),_0x5d17('0x6e')],'raw':!![]}]})[_0x5d17('0x2c')](function(_0x134b49){if(_0x134b49){var _0x19f7e7=_[_0x5d17('0x6f')](_0x134b49,function(_0xf25c9e){var _0x4ebd35=_0xf25c9e[_0x5d17('0x2d')]({'plain':!![]});return _0x4ebd35[_0x5d17('0x6b')];});return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x11ee2a[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](function(_0x520587){return db[_0x5d17('0x70')][_0x5d17('0x71')](function(_0x55e619){return _0x520587[_0x5d17('0x69')](_0x3e0339,{'transaction':_0x55e619})['then'](function(){return BPromise[_0x5d17('0x72')](_0x19f7e7,function(_0x10455c){return db[_0x5d17('0x73')][_0x5d17('0x74')]({'where':{'UserId':_0x10455c['id'],'OpenchannelQueueId':_0x11ee2a[_0x5d17('0x4c')]['id']},'transaction':_0x55e619});});})[_0x5d17('0x2c')](function(){_0x19f7e7[_0x5d17('0x75')](function(_0x343715){socket['emit'](_0x5d17('0x76'),{'UserId':_0x343715['id'],'OpenchannelQueueId':_0x520587['id']});});});});});}})['then'](respondWithStatusCode(_0x3705a7,null))[_0x5d17('0x4a')](handleError(_0x3705a7,null));};exports[_0x5d17('0x77')]=function(_0x4bc093,_0x19bd02,_0x31eb71){return db[_0x5d17('0x68')][_0x5d17('0x48')]({'where':{'id':_0x4bc093[_0x5d17('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5d17('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x5d17('0x2c')](handleEntityNotFound(_0x19bd02,null))[_0x5d17('0x2c')](function(_0x1ab7bb){var _0x3b25cd=_[_0x5d17('0x39')](_0x1ab7bb,'id');var _0xd9f25d=[];var _0x557d6b=[];var _0x48d564=squel['select']();_0x48d564[_0x5d17('0x78')](_0x5d17('0x79'))['from'](_0x5d17('0x7a'),'tq')['join'](_0x5d17('0x7b'),'ut',_0x5d17('0x7c'))[_0x5d17('0x42')](_0x5d17('0x7d'),_0x4bc093[_0x5d17('0x4c')]['id']);for(var _0x17467d=0x0;_0x17467d<_0x1ab7bb[_0x5d17('0x3f')];_0x17467d+=0x1){let _0x442e04=_0x1ab7bb[_0x17467d];for(var _0x4f73d7=0x0;_0x4f73d7<_0x442e04[_0x5d17('0x6b')][_0x5d17('0x3f')];_0x4f73d7+=0x1){let _0x21531f=_0x442e04['Agents'][_0x4f73d7];var _0x261699=_0x48d564[_0x5d17('0x7e')]();_0x261699[_0x5d17('0x42')](_0x5d17('0x7f'),_0x21531f['id']);_0x557d6b[_0x5d17('0x80')](db[_0x5d17('0x70')][_0x5d17('0x3a')](_0x261699[_0x5d17('0x81')](),{'type':db['sequelize'][_0x5d17('0x82')][_0x5d17('0x83')]})[_0x5d17('0x2c')](function(_0x4fe4bf){if(_0x4fe4bf[_0x5d17('0x3f')]===0x1){return _0x21531f['id'];}else{var _0x23ccdd=_[_0x5d17('0x84')](_[_0x5d17('0x39')](_0x4fe4bf,_0x5d17('0x85')),function(_0x1d6745){return _['includes'](_0x3b25cd,_0x1d6745);});if(_0x23ccdd){return _0x21531f['id'];}}}));}}return BPromise[_0x5d17('0x86')](_0x557d6b)['then'](function(_0x54911e){_0xd9f25d=_(_0xd9f25d)['union'](_0x54911e)['compact']()[_0x5d17('0x87')]();return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x4bc093['params']['id']}})[_0x5d17('0x2c')](function(_0x2d9ba0){return db[_0x5d17('0x70')][_0x5d17('0x71')](function(_0x395d91){return _0x2d9ba0['removeTeams'](_0x4bc093[_0x5d17('0x3a')][_0x5d17('0x6a')],{'transaction':_0x395d91})[_0x5d17('0x2c')](function(){if(!_[_0x5d17('0x88')](_0xd9f25d)){return _0x2d9ba0[_0x5d17('0x89')](_0xd9f25d,{'transaction':_0x395d91});}})[_0x5d17('0x2c')](function(){_0xd9f25d[_0x5d17('0x75')](function(_0x3facc1){socket[_0x5d17('0x8a')](_0x5d17('0x8b'),{'UserId':_0x3facc1,'OpenchannelQueueId':_0x2d9ba0['id']});});});});});});})['then'](respondWithStatusCode(_0x19bd02,null))['catch'](handleError(_0x19bd02,null));};exports[_0x5d17('0x8c')]=function(_0x372198,_0x2bcd9c,_0x16ef21){return db['OpenchannelQueue'][_0x5d17('0x51')]({'where':{'id':_0x372198[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x2bcd9c,null))[_0x5d17('0x2c')](function(_0x2407c4){if(_0x2407c4){return _0x2407c4[_0x5d17('0x8c')](_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')],_[_0x5d17('0x8d')](_0x372198['body'],[_0x5d17('0x6a'),'id'])||{})['spread'](function(_0x447222){for(var _0x456a00=0x0;_0x456a00<_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')][_0x5d17('0x3f')];_0x456a00+=0x1){socket[_0x5d17('0x8a')]('userOpenchannelQueue:save',{'UserId':Number(_0x372198[_0x5d17('0x52')][_0x5d17('0x6a')][_0x456a00]),'OpenchannelQueueId':Number(_0x372198[_0x5d17('0x4c')]['id'])});}return _0x447222;});}})[_0x5d17('0x2c')](respondWithResult(_0x2bcd9c,null))['catch'](handleError(_0x2bcd9c,null));};exports[_0x5d17('0x89')]=function(_0x59ba0c,_0x38b1e7,_0x3e6058){return db[_0x5d17('0x45')][_0x5d17('0x51')]({'where':{'id':_0x59ba0c[_0x5d17('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38b1e7,null))[_0x5d17('0x2c')](function(_0x47c99d){if(_0x47c99d){return _0x47c99d[_0x5d17('0x89')](_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')])['then'](function(){if(_[_0x5d17('0x8e')](_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')])){for(var _0x4e27b2=0x0;_0x4e27b2<_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')][_0x5d17('0x3f')];_0x4e27b2+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x59ba0c[_0x5d17('0x3a')]['ids'][_0x4e27b2]),'OpenchannelQueueId':Number(_0x59ba0c[_0x5d17('0x4c')]['id'])});}}else{socket['emit'](_0x5d17('0x8b'),{'UserId':Number(_0x59ba0c[_0x5d17('0x3a')][_0x5d17('0x6a')]),'OpenchannelQueueId':Number(_0x59ba0c[_0x5d17('0x4c')]['id'])});}});}})[_0x5d17('0x2c')](respondWithStatusCode(_0x38b1e7,null))[_0x5d17('0x4a')](handleError(_0x38b1e7,null));};exports[_0x5d17('0x8f')]=function(_0x4a2d8d,_0x271c22,_0x34dcf3){var _0x445acb={};var _0x3f3e42={};var _0x11d3d0;var _0x3598e0;return db[_0x5d17('0x45')][_0x5d17('0x5a')]({'where':{'id':_0x4a2d8d[_0x5d17('0x4c')]['id']}})[_0x5d17('0x2c')](handleEntityNotFound(_0x271c22,null))['then'](function(_0x4d38e3){if(_0x4d38e3){_0x11d3d0=_0x4d38e3;_0x3f3e42[_0x5d17('0x38')]=_[_0x5d17('0x3b')](db['User'][_0x5d17('0x4d')]);_0x3f3e42[_0x5d17('0x3a')]=_[_0x5d17('0x3b')](_0x4a2d8d[_0x5d17('0x3a')]);_0x3f3e42[_0x5d17('0x4e')]=_[_0x5d17('0x3d')](_0x3f3e42['model'],_0x3f3e42['query']);_0x445acb['attributes']=_[_0x5d17('0x3d')](_0x3f3e42[_0x5d17('0x38')],qs[_0x5d17('0x3e')](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x3e')]));_0x445acb[_0x5d17('0x3c')]=_0x445acb[_0x5d17('0x3c')][_0x5d17('0x3f')]?_0x445acb[_0x5d17('0x3c')]:_0x3f3e42[_0x5d17('0x38')];_0x445acb[_0x5d17('0x5c')]=qs['sort'](_0x4a2d8d['query'][_0x5d17('0x41')]);_0x445acb[_0x5d17('0x42')]=qs[_0x5d17('0x4e')](_[_0x5d17('0x43')](_0x4a2d8d['query'],_0x3f3e42['filters']));if(_0x4a2d8d[_0x5d17('0x3a')]['filter']){_0x445acb[_0x5d17('0x42')]=_[_0x5d17('0x4f')](_0x445acb[_0x5d17('0x42')],{'$or':_[_0x5d17('0x39')](_0x445acb[_0x5d17('0x3c')],function(_0x33c196){var _0x57643b={};_0x57643b[_0x33c196]={'$like':'%'+_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x5e')]+'%'};return _0x57643b;})});}_0x445acb=_[_0x5d17('0x4f')]({},_0x445acb,_0x4a2d8d[_0x5d17('0x50')]);return _0x11d3d0['getAgents'](_0x445acb);}})['then'](function(_0x44b3d9){if(_0x44b3d9){_0x3598e0=_0x44b3d9[_0x5d17('0x3f')];if(!_0x4a2d8d['query'][_0x5d17('0x40')](_0x5d17('0x5b'))){_0x445acb[_0x5d17('0x24')]=qs[_0x5d17('0x24')](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x24')]);_0x445acb[_0x5d17('0x21')]=qs['offset'](_0x4a2d8d[_0x5d17('0x3a')][_0x5d17('0x21')]);}return _0x11d3d0[_0x5d17('0x8f')](_0x445acb);}})['then'](function(_0x15dbd9){if(_0x15dbd9){return _0x15dbd9?{'count':_0x3598e0,'rows':_0x15dbd9}:null;}})[_0x5d17('0x2c')](respondWithResult(_0x271c22,null))[_0x5d17('0x4a')](handleError(_0x271c22,null));}; \ No newline at end of file +var _0xfc21=['json','offset','count','limit','set','apply','reject','save','update','destroy','OpenchannelQueues','UserProfileResource','then','stack','name','send','OpenchannelQueue','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','online','interface','flatMap','sequelize','transaction','emit','userOpenchannelQueue:save','removeTeams','Agents','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status'];(function(_0x482ed9,_0x3034f7){var _0x4ec9ea=function(_0x2b4da6){while(--_0x2b4da6){_0x482ed9['push'](_0x482ed9['shift']());}};_0x4ec9ea(++_0x3034f7);}(_0xfc21,0x179));var _0x1fc2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfc21[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fc2('0x0'));var zipdir=require(_0x1fc2('0x1'));var jsonpatch=require(_0x1fc2('0x2'));var rp=require(_0x1fc2('0x3'));var moment=require(_0x1fc2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1fc2('0x5'));var path=require(_0x1fc2('0x6'));var sox=require(_0x1fc2('0x7'));var csv=require(_0x1fc2('0x8'));var ejs=require(_0x1fc2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1fc2('0xa'));var jsforce=require(_0x1fc2('0xb'));var deskjs=require(_0x1fc2('0xc'));var toCsv=require(_0x1fc2('0x8'));var querystring=require(_0x1fc2('0xd'));var Papa=require(_0x1fc2('0xe'));var Redis=require(_0x1fc2('0xf'));var authService=require(_0x1fc2('0x10'));var qs=require(_0x1fc2('0x11'));var as=require(_0x1fc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1fc2('0x13'));var config=require(_0x1fc2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fc2('0x15'))['db'];config[_0x1fc2('0x16')]=_[_0x1fc2('0x17')](config['redis'],{'host':_0x1fc2('0x18'),'port':0x18eb});var socket=require(_0x1fc2('0x19'))(new Redis(config['redis']));require(_0x1fc2('0x1a'))[_0x1fc2('0x1b')](socket);function respondWithStatusCode(_0x29029f,_0x2b028a){_0x2b028a=_0x2b028a||0xcc;return function(_0x598040){if(_0x598040){return _0x29029f[_0x1fc2('0x1c')](_0x2b028a);}return _0x29029f['status'](_0x2b028a)[_0x1fc2('0x1d')]();};}function respondWithResult(_0x3ca683,_0x1c24d7){_0x1c24d7=_0x1c24d7||0xc8;return function(_0x2f26d7){if(_0x2f26d7){return _0x3ca683[_0x1fc2('0x1e')](_0x1c24d7)[_0x1fc2('0x1f')](_0x2f26d7);}};}function respondWithFilteredResult(_0x393ca9,_0x5d7df3){return function(_0x5a5537){if(_0x5a5537){var _0x213fbd=typeof _0x5d7df3[_0x1fc2('0x20')]==='undefined'&&typeof _0x5d7df3['limit']==='undefined';var _0x5261b0=_0x5a5537[_0x1fc2('0x21')];var _0x166e5f=_0x213fbd?0x0:_0x5d7df3[_0x1fc2('0x20')];var _0x29ca1b=_0x213fbd?_0x5a5537[_0x1fc2('0x21')]:_0x5d7df3['offset']+_0x5d7df3[_0x1fc2('0x22')];var _0x1bd84a;if(_0x29ca1b>=_0x5261b0){_0x29ca1b=_0x5261b0;_0x1bd84a=0xc8;}else{_0x1bd84a=0xce;}_0x393ca9['status'](_0x1bd84a);return _0x393ca9[_0x1fc2('0x23')]('Content-Range',_0x166e5f+'-'+_0x29ca1b+'/'+_0x5261b0)[_0x1fc2('0x1f')](_0x5a5537);}return null;};}function patchUpdates(_0x38d3d8){return function(_0x43d905){try{jsonpatch[_0x1fc2('0x24')](_0x43d905,_0x38d3d8,!![]);}catch(_0x178aa9){return BPromise[_0x1fc2('0x25')](_0x178aa9);}return _0x43d905[_0x1fc2('0x26')]();};}function saveUpdates(_0x2e882c,_0x2d17ac){return function(_0x3b8dbb){if(_0x3b8dbb){return _0x3b8dbb[_0x1fc2('0x27')](_0x2e882c)['then'](function(_0x3e9a0c){return _0x3e9a0c;});}return null;};}function removeEntity(_0x552f63,_0x49a8fa){return function(_0x19284e){if(_0x19284e){return _0x19284e[_0x1fc2('0x28')]()['then'](function(){var _0x3ba36c=_0x19284e['get']({'plain':!![]});var _0xa8b787=_0x1fc2('0x29');return db[_0x1fc2('0x2a')][_0x1fc2('0x28')]({'where':{'type':_0xa8b787,'resourceId':_0x3ba36c['id']}})[_0x1fc2('0x2b')](function(){return _0x19284e;});})[_0x1fc2('0x2b')](function(){_0x552f63[_0x1fc2('0x1e')](0xcc)[_0x1fc2('0x1d')]();});}};}function handleEntityNotFound(_0x152fc1,_0x2b75ce){return function(_0x56330d){if(!_0x56330d){_0x152fc1['sendStatus'](0x194);}return _0x56330d;};}function handleError(_0x15eace,_0x1af6f5){_0x1af6f5=_0x1af6f5||0x1f4;return function(_0x51e816){logger['error'](_0x51e816[_0x1fc2('0x2c')]);if(_0x51e816['name']){delete _0x51e816[_0x1fc2('0x2d')];}_0x15eace[_0x1fc2('0x1e')](_0x1af6f5)[_0x1fc2('0x2e')](_0x51e816);};}exports['index']=function(_0x49d956,_0x76f7ca){var _0x2ce86b={},_0xa06992={},_0x2bf843={'count':0x0,'rows':[]};var _0x51fdb2=_['map'](db[_0x1fc2('0x2f')]['rawAttributes'],function(_0x3caaed){return{'name':_0x3caaed[_0x1fc2('0x30')],'type':_0x3caaed[_0x1fc2('0x31')][_0x1fc2('0x32')]};});_0xa06992['model']=_[_0x1fc2('0x33')](_0x51fdb2,_0x1fc2('0x2d'));_0xa06992[_0x1fc2('0x34')]=_[_0x1fc2('0x35')](_0x49d956[_0x1fc2('0x34')]);_0xa06992[_0x1fc2('0x36')]=_[_0x1fc2('0x37')](_0xa06992[_0x1fc2('0x38')],_0xa06992['query']);_0x2ce86b[_0x1fc2('0x39')]=_['intersection'](_0xa06992[_0x1fc2('0x38')],qs[_0x1fc2('0x3a')](_0x49d956[_0x1fc2('0x34')]['fields']));_0x2ce86b[_0x1fc2('0x39')]=_0x2ce86b['attributes'][_0x1fc2('0x3b')]?_0x2ce86b[_0x1fc2('0x39')]:_0xa06992[_0x1fc2('0x38')];if(!_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x3c')](_0x1fc2('0x3d'))){_0x2ce86b[_0x1fc2('0x22')]=qs[_0x1fc2('0x22')](_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x22')]);_0x2ce86b['offset']=qs[_0x1fc2('0x20')](_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x20')]);}_0x2ce86b[_0x1fc2('0x3e')]=qs[_0x1fc2('0x3f')](_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x3f')]);_0x2ce86b['where']=qs[_0x1fc2('0x36')](_[_0x1fc2('0x40')](_0x49d956[_0x1fc2('0x34')],_0xa06992['filters']),_0x51fdb2);if(_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x41')]){_0x2ce86b[_0x1fc2('0x42')]=_[_0x1fc2('0x43')](_0x2ce86b[_0x1fc2('0x42')],{'$or':_[_0x1fc2('0x33')](_0x51fdb2,function(_0x4115dd){if(_0x4115dd['type']!==_0x1fc2('0x44')){var _0xdc656c={};_0xdc656c[_0x4115dd[_0x1fc2('0x2d')]]={'$like':'%'+_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x41')]+'%'};return _0xdc656c;}})});}_0x2ce86b=_['merge']({},_0x2ce86b,_0x49d956[_0x1fc2('0x45')]);var _0x58ebe6={'where':_0x2ce86b[_0x1fc2('0x42')]};return db[_0x1fc2('0x2f')][_0x1fc2('0x21')](_0x58ebe6)[_0x1fc2('0x2b')](function(_0x4e198e){_0x2bf843[_0x1fc2('0x21')]=_0x4e198e;if(_0x49d956[_0x1fc2('0x34')][_0x1fc2('0x46')]){_0x2ce86b[_0x1fc2('0x47')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x1fc2('0x48')](_0x2ce86b);})[_0x1fc2('0x2b')](function(_0xb70efe){_0x2bf843[_0x1fc2('0x49')]=_0xb70efe;return _0x2bf843;})[_0x1fc2('0x2b')](respondWithFilteredResult(_0x76f7ca,_0x2ce86b))[_0x1fc2('0x4a')](handleError(_0x76f7ca,null));};exports['show']=function(_0x51e445,_0x4de585){var _0x1f97e1={'raw':!![],'where':{'id':_0x51e445['params']['id']}},_0x532191={};_0x532191['model']=_['keys'](db['OpenchannelQueue'][_0x1fc2('0x4b')]);_0x532191[_0x1fc2('0x34')]=_[_0x1fc2('0x35')](_0x51e445[_0x1fc2('0x34')]);_0x532191['filters']=_[_0x1fc2('0x37')](_0x532191[_0x1fc2('0x38')],_0x532191['query']);_0x1f97e1[_0x1fc2('0x39')]=_[_0x1fc2('0x37')](_0x532191[_0x1fc2('0x38')],qs['fields'](_0x51e445[_0x1fc2('0x34')]['fields']));_0x1f97e1['attributes']=_0x1f97e1[_0x1fc2('0x39')][_0x1fc2('0x3b')]?_0x1f97e1[_0x1fc2('0x39')]:_0x532191[_0x1fc2('0x38')];if(_0x51e445['query'][_0x1fc2('0x46')]){_0x1f97e1['include']=[{'all':!![]}];}_0x1f97e1=_[_0x1fc2('0x43')]({},_0x1f97e1,_0x51e445['options']);return db[_0x1fc2('0x2f')]['find'](_0x1f97e1)[_0x1fc2('0x2b')](handleEntityNotFound(_0x4de585,null))[_0x1fc2('0x2b')](respondWithResult(_0x4de585,null))[_0x1fc2('0x4a')](handleError(_0x4de585,null));};exports['create']=function(_0x2713e8,_0x37bc13){return db[_0x1fc2('0x2f')]['create'](_0x2713e8['body'],{})[_0x1fc2('0x2b')](function(_0x423083){var _0x33a642=_0x2713e8[_0x1fc2('0x4c')][_0x1fc2('0x4d')]({'plain':!![]});if(!_0x33a642)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33a642[_0x1fc2('0x4e')]===_0x1fc2('0x4c')){var _0x526640=_0x423083['get']({'plain':!![]});var _0x5ab7a5=_0x1fc2('0x29');return db[_0x1fc2('0x4f')][_0x1fc2('0x50')]({'where':{'name':_0x5ab7a5,'userProfileId':_0x33a642[_0x1fc2('0x51')]},'raw':!![]})[_0x1fc2('0x2b')](function(_0x383cd9){if(_0x383cd9&&_0x383cd9[_0x1fc2('0x52')]===0x0){return db[_0x1fc2('0x2a')][_0x1fc2('0x53')]({'name':_0x526640[_0x1fc2('0x2d')],'resourceId':_0x526640['id'],'type':_0x383cd9[_0x1fc2('0x2d')],'sectionId':_0x383cd9['id']},{})[_0x1fc2('0x2b')](function(){return _0x423083;});}else{return _0x423083;}})[_0x1fc2('0x4a')](function(_0x3971c8){logger[_0x1fc2('0x54')](_0x1fc2('0x55'),_0x3971c8);throw _0x3971c8;});}return _0x423083;})['then'](respondWithResult(_0x37bc13,0xc9))[_0x1fc2('0x4a')](handleError(_0x37bc13,null));};exports['update']=function(_0x512459,_0x4cbee8){if(_0x512459[_0x1fc2('0x56')]['id']){delete _0x512459[_0x1fc2('0x56')]['id'];}return db[_0x1fc2('0x2f')][_0x1fc2('0x50')]({'where':{'id':_0x512459[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0x4cbee8,null))['then'](saveUpdates(_0x512459[_0x1fc2('0x56')],null))[_0x1fc2('0x2b')](respondWithResult(_0x4cbee8,null))[_0x1fc2('0x4a')](handleError(_0x4cbee8,null));};exports[_0x1fc2('0x28')]=function(_0x4f2e39,_0xb8ebce){return db[_0x1fc2('0x2f')][_0x1fc2('0x50')]({'where':{'id':_0x4f2e39[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0xb8ebce,null))[_0x1fc2('0x2b')](removeEntity(_0xb8ebce,null))[_0x1fc2('0x4a')](handleError(_0xb8ebce,null));};exports['describe']=function(_0x4ad8bd,_0x54d33e){return db[_0x1fc2('0x2f')]['describe']()[_0x1fc2('0x2b')](respondWithResult(_0x54d33e,null))[_0x1fc2('0x4a')](handleError(_0x54d33e,null));};exports['getMembers']=function(_0x1eb517,_0x120513,_0x1083ac){var _0x253ed3={'raw':!![],'where':{}},_0x82bf5={},_0xbc3d4b;return db['OpenchannelQueue'][_0x1fc2('0x58')]({'where':{'id':_0x1eb517['params']['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0x120513,null))['then'](function(_0x3787a0){if(_0x3787a0){_0xbc3d4b=_0x3787a0['get']({'plain':!![]});_0x82bf5[_0x1fc2('0x38')]=_[_0x1fc2('0x35')](db[_0x1fc2('0x59')][_0x1fc2('0x4b')]);_0x82bf5[_0x1fc2('0x34')]=_[_0x1fc2('0x35')](_0x1eb517[_0x1fc2('0x34')]);_0x82bf5[_0x1fc2('0x36')]=_['intersection'](_0x82bf5[_0x1fc2('0x38')],_0x82bf5['query']);_0x253ed3[_0x1fc2('0x39')]=_['intersection'](_0x82bf5[_0x1fc2('0x38')],qs[_0x1fc2('0x3a')](_0x1eb517[_0x1fc2('0x34')][_0x1fc2('0x3a')]));_0x253ed3[_0x1fc2('0x39')]=_0x253ed3[_0x1fc2('0x39')][_0x1fc2('0x3b')]?_0x253ed3[_0x1fc2('0x39')]:_0x82bf5[_0x1fc2('0x38')];if(!_0x1eb517[_0x1fc2('0x34')]['hasOwnProperty'](_0x1fc2('0x3d'))){_0x253ed3[_0x1fc2('0x22')]=qs[_0x1fc2('0x22')](_0x1eb517['query'][_0x1fc2('0x22')]);_0x253ed3[_0x1fc2('0x20')]=qs[_0x1fc2('0x20')](_0x1eb517[_0x1fc2('0x34')][_0x1fc2('0x20')]);}_0x253ed3['order']=qs[_0x1fc2('0x3f')](_0x1eb517[_0x1fc2('0x34')][_0x1fc2('0x3f')]);_0x253ed3['where']=qs[_0x1fc2('0x36')](_[_0x1fc2('0x40')](_0x1eb517[_0x1fc2('0x34')],_0x82bf5[_0x1fc2('0x36')]));_0x253ed3[_0x1fc2('0x42')][_0x1fc2('0x5a')]=_0x3787a0['id'];if(_0x1eb517[_0x1fc2('0x34')][_0x1fc2('0x41')]){_0x253ed3[_0x1fc2('0x42')]=_['merge'](_0x253ed3[_0x1fc2('0x42')],{'$or':_[_0x1fc2('0x33')](_0x253ed3['attributes'],function(_0x3fe198){var _0x1d33b3={};_0x1d33b3[_0x3fe198]={'$like':'%'+_0x1eb517[_0x1fc2('0x34')]['filter']+'%'};return _0x1d33b3;})});}_0x253ed3=_[_0x1fc2('0x43')]({},_0x253ed3,_0x1eb517[_0x1fc2('0x45')]);return db[_0x1fc2('0x59')]['findAll'](_0x253ed3);}})[_0x1fc2('0x2b')](function(_0x3fd398){if(_0x3fd398){return db[_0x1fc2('0x5b')][_0x1fc2('0x5c')]({'where':{'id':_[_0x1fc2('0x33')](_0x3fd398,_0x1fc2('0x5d')),'role':'agent'},'attributes':['id',_0x1fc2('0x2d'),_0x1fc2('0x5e'),'updatedAt',_0x1fc2('0x5f')]});}})[_0x1fc2('0x2b')](function(_0x5329){if(_0x5329){return{'count':_0x5329[_0x1fc2('0x21')],'rows':_[_0x1fc2('0x33')](_0x5329[_0x1fc2('0x49')],function(_0x35e81f){return{'membername':_0x35e81f['name'],'UserId':_0x35e81f['id'],'queue_name':_0xbc3d4b[_0x1fc2('0x2d')],'OpenchannelQueueId':_0xbc3d4b['id'],'interface':util[_0x1fc2('0x60')](_0x1fc2('0x61'),_0x1fc2('0x62'),_0x35e81f[_0x1fc2('0x2d')]),'penalty':0x0,'paused':_0x35e81f['openchannelPause'],'createdAt':_0x35e81f[_0x1fc2('0x5f')],'updatedAt':_0x35e81f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1fc2('0x2b')](respondWithFilteredResult(_0x120513,_0x253ed3))[_0x1fc2('0x4a')](handleError(_0x120513,null));};exports[_0x1fc2('0x63')]=function(_0x5e1e91,_0x48d1eb,_0x36112b){var _0x5a4539={};var _0x379e0e={};var _0x598ae9;var _0x5c4bd0;return db[_0x1fc2('0x2f')][_0x1fc2('0x58')]({'where':{'id':_0x5e1e91[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0x48d1eb,null))[_0x1fc2('0x2b')](function(_0x23a71b){if(_0x23a71b){_0x598ae9=_0x23a71b;_0x379e0e[_0x1fc2('0x38')]=_['keys'](db['Team']['rawAttributes']);_0x379e0e[_0x1fc2('0x34')]=_[_0x1fc2('0x35')](_0x5e1e91[_0x1fc2('0x34')]);_0x379e0e['filters']=_[_0x1fc2('0x37')](_0x379e0e['model'],_0x379e0e[_0x1fc2('0x34')]);_0x5a4539['attributes']=_['intersection'](_0x379e0e[_0x1fc2('0x38')],qs[_0x1fc2('0x3a')](_0x5e1e91[_0x1fc2('0x34')][_0x1fc2('0x3a')]));_0x5a4539[_0x1fc2('0x39')]=_0x5a4539[_0x1fc2('0x39')][_0x1fc2('0x3b')]?_0x5a4539[_0x1fc2('0x39')]:_0x379e0e[_0x1fc2('0x38')];_0x5a4539[_0x1fc2('0x3e')]=qs[_0x1fc2('0x3f')](_0x5e1e91[_0x1fc2('0x34')]['sort']);_0x5a4539[_0x1fc2('0x42')]=qs[_0x1fc2('0x36')](_[_0x1fc2('0x40')](_0x5e1e91[_0x1fc2('0x34')],_0x379e0e[_0x1fc2('0x36')]));if(_0x5e1e91['query']['filter']){_0x5a4539[_0x1fc2('0x42')]=_[_0x1fc2('0x43')](_0x5a4539['where'],{'$or':_[_0x1fc2('0x33')](_0x5a4539[_0x1fc2('0x39')],function(_0x1e96a){var _0x3f79b2={};_0x3f79b2[_0x1e96a]={'$like':'%'+_0x5e1e91[_0x1fc2('0x34')]['filter']+'%'};return _0x3f79b2;})});}_0x5a4539=_[_0x1fc2('0x43')]({},_0x5a4539,_0x5e1e91[_0x1fc2('0x45')]);return _0x598ae9['getTeams'](_0x5a4539);}})['then'](function(_0x3e1ea4){if(_0x3e1ea4){_0x5c4bd0=_0x3e1ea4['length'];if(!_0x5e1e91[_0x1fc2('0x34')][_0x1fc2('0x3c')](_0x1fc2('0x3d'))){_0x5a4539[_0x1fc2('0x22')]=qs[_0x1fc2('0x22')](_0x5e1e91[_0x1fc2('0x34')][_0x1fc2('0x22')]);_0x5a4539[_0x1fc2('0x20')]=qs['offset'](_0x5e1e91['query'][_0x1fc2('0x20')]);}return _0x598ae9[_0x1fc2('0x63')](_0x5a4539);}})['then'](function(_0x5dc3a6){if(_0x5dc3a6){return _0x5dc3a6?{'count':_0x5c4bd0,'rows':_0x5dc3a6}:null;}})[_0x1fc2('0x2b')](respondWithResult(_0x48d1eb,null))['catch'](handleError(_0x48d1eb,null));};exports[_0x1fc2('0x64')]=function(_0x560703,_0xeff0aa,_0x18faac){var _0x446f41=_0x560703[_0x1fc2('0x56')][_0x1fc2('0x65')];return db[_0x1fc2('0x66')][_0x1fc2('0x48')]({'where':{'id':_0x446f41},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x1fc2('0x67'),'voicePause',_0x1fc2('0x68')],'raw':!![]}]})[_0x1fc2('0x2b')](function(_0x363fba){if(_0x363fba){var _0x318ea7=_[_0x1fc2('0x69')](_0x363fba,function(_0x489fe5){var _0xcb5f8f=_0x489fe5[_0x1fc2('0x4d')]({'plain':!![]});return _0xcb5f8f['Agents'];});return db[_0x1fc2('0x2f')][_0x1fc2('0x50')]({'where':{'id':_0x560703['params']['id']}})['then'](function(_0xc0a108){return db[_0x1fc2('0x6a')][_0x1fc2('0x6b')](function(_0x152da9){return _0xc0a108[_0x1fc2('0x64')](_0x446f41,{'transaction':_0x152da9})[_0x1fc2('0x2b')](function(){return BPromise['each'](_0x318ea7,function(_0x11bc3c){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x11bc3c['id'],'OpenchannelQueueId':_0x560703[_0x1fc2('0x57')]['id']},'transaction':_0x152da9});});})[_0x1fc2('0x2b')](function(){_0x318ea7['forEach'](function(_0x188495){socket[_0x1fc2('0x6c')](_0x1fc2('0x6d'),{'UserId':_0x188495['id'],'OpenchannelQueueId':_0xc0a108['id']});});});});});}})[_0x1fc2('0x2b')](respondWithStatusCode(_0xeff0aa,null))[_0x1fc2('0x4a')](handleError(_0xeff0aa,null));};exports[_0x1fc2('0x6e')]=function(_0x53baa8,_0x4dddd8,_0x47be80){return db['Team']['findAll']({'where':{'id':_0x53baa8[_0x1fc2('0x34')][_0x1fc2('0x65')]},'attributes':['id'],'include':[{'model':db[_0x1fc2('0x5b')],'as':_0x1fc2('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1fc2('0x2b')](handleEntityNotFound(_0x4dddd8,null))[_0x1fc2('0x2b')](function(_0x592f09){var _0x4dd153=_[_0x1fc2('0x33')](_0x592f09,'id');var _0x4086ec=[];var _0x5107f8=[];var _0x18c3f6=squel[_0x1fc2('0x70')]();_0x18c3f6[_0x1fc2('0x71')]('tq.TeamId')[_0x1fc2('0x72')]('team_has_openchannel_queues','tq')[_0x1fc2('0x73')](_0x1fc2('0x74'),'ut',_0x1fc2('0x75'))[_0x1fc2('0x42')](_0x1fc2('0x76'),_0x53baa8['params']['id']);for(var _0x59fbe8=0x0;_0x59fbe8<_0x592f09['length'];_0x59fbe8+=0x1){let _0x4841a3=_0x592f09[_0x59fbe8];for(var _0x635f56=0x0;_0x635f56<_0x4841a3[_0x1fc2('0x6f')][_0x1fc2('0x3b')];_0x635f56+=0x1){let _0x38e78b=_0x4841a3[_0x1fc2('0x6f')][_0x635f56];var _0x103058=_0x18c3f6[_0x1fc2('0x77')]();_0x103058[_0x1fc2('0x42')]('ut.UserId\x20=\x20?',_0x38e78b['id']);_0x5107f8[_0x1fc2('0x78')](db[_0x1fc2('0x6a')][_0x1fc2('0x34')](_0x103058['toString'](),{'type':db['sequelize'][_0x1fc2('0x79')][_0x1fc2('0x7a')]})[_0x1fc2('0x2b')](function(_0x4602a4){if(_0x4602a4['length']===0x1){return _0x38e78b['id'];}else{var _0x521c0b=_['every'](_[_0x1fc2('0x33')](_0x4602a4,_0x1fc2('0x7b')),function(_0x2bf1b1){return _[_0x1fc2('0x7c')](_0x4dd153,_0x2bf1b1);});if(_0x521c0b){return _0x38e78b['id'];}}}));}}return BPromise[_0x1fc2('0x7d')](_0x5107f8)[_0x1fc2('0x2b')](function(_0x4fc9d0){_0x4086ec=_(_0x4086ec)[_0x1fc2('0x7e')](_0x4fc9d0)[_0x1fc2('0x7f')]()[_0x1fc2('0x80')]();return db[_0x1fc2('0x2f')][_0x1fc2('0x50')]({'where':{'id':_0x53baa8[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](function(_0x442cb4){return db[_0x1fc2('0x6a')][_0x1fc2('0x6b')](function(_0x226c90){return _0x442cb4[_0x1fc2('0x6e')](_0x53baa8[_0x1fc2('0x34')][_0x1fc2('0x65')],{'transaction':_0x226c90})['then'](function(){if(!_[_0x1fc2('0x81')](_0x4086ec)){return _0x442cb4['removeAgents'](_0x4086ec,{'transaction':_0x226c90});}})['then'](function(){_0x4086ec['forEach'](function(_0x3756e1){socket['emit'](_0x1fc2('0x82'),{'UserId':_0x3756e1,'OpenchannelQueueId':_0x442cb4['id']});});});});});});})[_0x1fc2('0x2b')](respondWithStatusCode(_0x4dddd8,null))[_0x1fc2('0x4a')](handleError(_0x4dddd8,null));};exports['addAgents']=function(_0xd12cd0,_0x39db4c,_0x5ea8b2){return db[_0x1fc2('0x2f')][_0x1fc2('0x50')]({'where':{'id':_0xd12cd0[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0x39db4c,null))['then'](function(_0x41ec0d){if(_0x41ec0d){return _0x41ec0d[_0x1fc2('0x83')](_0xd12cd0[_0x1fc2('0x56')][_0x1fc2('0x65')],_['omit'](_0xd12cd0[_0x1fc2('0x56')],[_0x1fc2('0x65'),'id'])||{})[_0x1fc2('0x84')](function(_0x5daed5){for(var _0x1f3516=0x0;_0x1f3516<_0xd12cd0[_0x1fc2('0x56')][_0x1fc2('0x65')][_0x1fc2('0x3b')];_0x1f3516+=0x1){socket[_0x1fc2('0x6c')](_0x1fc2('0x6d'),{'UserId':Number(_0xd12cd0[_0x1fc2('0x56')][_0x1fc2('0x65')][_0x1f3516]),'OpenchannelQueueId':Number(_0xd12cd0['params']['id'])});}return _0x5daed5;});}})[_0x1fc2('0x2b')](respondWithResult(_0x39db4c,null))[_0x1fc2('0x4a')](handleError(_0x39db4c,null));};exports[_0x1fc2('0x85')]=function(_0x50634d,_0x352560,_0x12b8bc){return db[_0x1fc2('0x2f')]['find']({'where':{'id':_0x50634d[_0x1fc2('0x57')]['id']}})['then'](handleEntityNotFound(_0x352560,null))[_0x1fc2('0x2b')](function(_0x3f4b49){if(_0x3f4b49){return _0x3f4b49['removeAgents'](_0x50634d[_0x1fc2('0x34')][_0x1fc2('0x65')])[_0x1fc2('0x2b')](function(){if(_[_0x1fc2('0x86')](_0x50634d['query']['ids'])){for(var _0x11e897=0x0;_0x11e897<_0x50634d[_0x1fc2('0x34')][_0x1fc2('0x65')][_0x1fc2('0x3b')];_0x11e897+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x50634d['query'][_0x1fc2('0x65')][_0x11e897]),'OpenchannelQueueId':Number(_0x50634d[_0x1fc2('0x57')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x50634d[_0x1fc2('0x34')][_0x1fc2('0x65')]),'OpenchannelQueueId':Number(_0x50634d[_0x1fc2('0x57')]['id'])});}});}})[_0x1fc2('0x2b')](respondWithStatusCode(_0x352560,null))[_0x1fc2('0x4a')](handleError(_0x352560,null));};exports['getAgents']=function(_0x21ecbf,_0x4a8c86,_0x2c383b){var _0x57370d={};var _0x4c30bf={};var _0x551e04;var _0xf50c61;return db['OpenchannelQueue'][_0x1fc2('0x58')]({'where':{'id':_0x21ecbf[_0x1fc2('0x57')]['id']}})[_0x1fc2('0x2b')](handleEntityNotFound(_0x4a8c86,null))['then'](function(_0x21b0d4){if(_0x21b0d4){_0x551e04=_0x21b0d4;_0x4c30bf[_0x1fc2('0x38')]=_[_0x1fc2('0x35')](db[_0x1fc2('0x5b')][_0x1fc2('0x4b')]);_0x4c30bf[_0x1fc2('0x34')]=_[_0x1fc2('0x35')](_0x21ecbf['query']);_0x4c30bf[_0x1fc2('0x36')]=_['intersection'](_0x4c30bf[_0x1fc2('0x38')],_0x4c30bf[_0x1fc2('0x34')]);_0x57370d[_0x1fc2('0x39')]=_[_0x1fc2('0x37')](_0x4c30bf[_0x1fc2('0x38')],qs[_0x1fc2('0x3a')](_0x21ecbf['query'][_0x1fc2('0x3a')]));_0x57370d['attributes']=_0x57370d[_0x1fc2('0x39')][_0x1fc2('0x3b')]?_0x57370d[_0x1fc2('0x39')]:_0x4c30bf[_0x1fc2('0x38')];_0x57370d[_0x1fc2('0x3e')]=qs[_0x1fc2('0x3f')](_0x21ecbf[_0x1fc2('0x34')][_0x1fc2('0x3f')]);_0x57370d[_0x1fc2('0x42')]=qs['filters'](_[_0x1fc2('0x40')](_0x21ecbf[_0x1fc2('0x34')],_0x4c30bf[_0x1fc2('0x36')]));if(_0x21ecbf[_0x1fc2('0x34')][_0x1fc2('0x41')]){_0x57370d['where']=_['merge'](_0x57370d[_0x1fc2('0x42')],{'$or':_['map'](_0x57370d[_0x1fc2('0x39')],function(_0x4d7467){var _0x53185a={};_0x53185a[_0x4d7467]={'$like':'%'+_0x21ecbf[_0x1fc2('0x34')][_0x1fc2('0x41')]+'%'};return _0x53185a;})});}_0x57370d=_[_0x1fc2('0x43')]({},_0x57370d,_0x21ecbf[_0x1fc2('0x45')]);return _0x551e04[_0x1fc2('0x87')](_0x57370d);}})[_0x1fc2('0x2b')](function(_0x29c933){if(_0x29c933){_0xf50c61=_0x29c933['length'];if(!_0x21ecbf[_0x1fc2('0x34')][_0x1fc2('0x3c')]('nolimit')){_0x57370d[_0x1fc2('0x22')]=qs[_0x1fc2('0x22')](_0x21ecbf[_0x1fc2('0x34')]['limit']);_0x57370d['offset']=qs[_0x1fc2('0x20')](_0x21ecbf[_0x1fc2('0x34')][_0x1fc2('0x20')]);}return _0x551e04['getAgents'](_0x57370d);}})[_0x1fc2('0x2b')](function(_0x379bb2){if(_0x379bb2){return _0x379bb2?{'count':_0xf50c61,'rows':_0x379bb2}:null;}})[_0x1fc2('0x2b')](respondWithResult(_0x4a8c86,null))['catch'](handleError(_0x4a8c86,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index dfd7b98..d7a3536 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 _0xdf44=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x46b295,_0x554b00){var _0x1c4c10=function(_0x58c71b){while(--_0x58c71b){_0x46b295['push'](_0x46b295['shift']());}};_0x1c4c10(++_0x554b00);}(_0xdf44,0x7e));var _0x4df4=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xdf44[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0x4df4('0x0'));var OpenchannelQueue=require(_0x4df4('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4df4('0x2')](0x0);var events={'afterCreate':_0x4df4('0x3'),'afterUpdate':_0x4df4('0x4'),'afterDestroy':_0x4df4('0x5')};function emitEvent(_0x326eeb){return function(_0xa2efa2,_0x24eb70,_0x55a60f){OpenchannelQueueEvents[_0x4df4('0x6')](_0x326eeb+':'+_0xa2efa2['id'],_0xa2efa2);OpenchannelQueueEvents['emit'](_0x326eeb,_0xa2efa2);_0x55a60f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x4df4('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2864=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2b6593,_0x2c5e04){var _0x59ccf4=function(_0x371d5e){while(--_0x371d5e){_0x2b6593['push'](_0x2b6593['shift']());}};_0x59ccf4(++_0x2c5e04);}(_0x2864,0x121));var _0x4286=function(_0x1b0165,_0x33a8c0){_0x1b0165=_0x1b0165-0x0;var _0x80ea5c=_0x2864[_0x1b0165];return _0x80ea5c;};'use strict';var EventEmitter=require(_0x4286('0x0'));var OpenchannelQueue=require(_0x4286('0x1'))['db'][_0x4286('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4286('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4286('0x4'),'afterDestroy':_0x4286('0x5')};function emitEvent(_0x454f49){return function(_0x3c70ec,_0x195f82,_0x5c4332){OpenchannelQueueEvents[_0x4286('0x6')](_0x454f49+':'+_0x3c70ec['id'],_0x3c70ec);OpenchannelQueueEvents[_0x4286('0x6')](_0x454f49,_0x3c70ec);_0x5c4332(null);};}for(var e in events){if(events[_0x4286('0x7')](e)){var event=events[e];OpenchannelQueue[_0x4286('0x8')](e,emitEvent(event));}}module[_0x4286('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d29bca7..36abc94 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 _0x8fd6=['request-promise','path','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird'];(function(_0x2edf9e,_0x4f1203){var _0x33a6b1=function(_0xc4aa3c){while(--_0xc4aa3c){_0x2edf9e['push'](_0x2edf9e['shift']());}};_0x33a6b1(++_0x4f1203);}(_0x8fd6,0x104));var _0x68fd=function(_0x3944b3,_0xf05375){_0x3944b3=_0x3944b3-0x0;var _0xbf7a53=_0x8fd6[_0x3944b3];return _0xbf7a53;};'use strict';var _=require(_0x68fd('0x0'));var util=require(_0x68fd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x68fd('0x2'));var BPromise=require(_0x68fd('0x3'));var rp=require(_0x68fd('0x4'));var fs=require('fs');var path=require(_0x68fd('0x5'));var rimraf=require('rimraf');var config=require(_0x68fd('0x6'));var attributes=require(_0x68fd('0x7'));module['exports']=function(_0x4a2357,_0x477ec7){return _0x4a2357[_0x68fd('0x8')](_0x68fd('0x9'),attributes,{'tableName':_0x68fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14c2=['exports','OpenchannelQueue','openchannel_queues','lodash','util','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14c2,0x1bb));var _0x214c=function(_0x90917c,_0x536dc8){_0x90917c=_0x90917c-0x0;var _0x218f9b=_0x14c2[_0x90917c];return _0x218f9b;};'use strict';var _=require(_0x214c('0x0'));var util=require(_0x214c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x214c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x214c('0x3'));var rimraf=require(_0x214c('0x4'));var config=require(_0x214c('0x5'));var attributes=require(_0x214c('0x6'));module[_0x214c('0x7')]=function(_0x355dd2,_0x4bf776){return _0x355dd2['define'](_0x214c('0x8'),attributes,{'tableName':_0x214c('0x9'),'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 90ca572..a0eca8c 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 _0xfad5=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','catch','OpenchannelQueue','find','where','info','ShowOpenchannelQueue','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfad5,0xba));var _0x5fad=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xfad5[_0x51fe5f];return _0x4abce9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5fad('0x0'));var rs=require(_0x5fad('0x1'));var fs=require('fs');var Redis=require(_0x5fad('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fad('0x3'));var logger=require(_0x5fad('0x4'))(_0x5fad('0x5'));var config=require(_0x5fad('0x6'));var jayson=require(_0x5fad('0x7'));var client=jayson[_0x5fad('0x8')][_0x5fad('0x9')]({'port':0x232a});config[_0x5fad('0xa')]=_[_0x5fad('0xb')](config[_0x5fad('0xa')],{'host':_0x5fad('0xc'),'port':0x18eb});var socket=require(_0x5fad('0xd'))(new Redis(config[_0x5fad('0xa')]));require(_0x5fad('0xe'))[_0x5fad('0xf')](socket);function respondWithRpcPromise(_0x135d8d,_0x1167a0,_0xcdad29){return new BPromise(function(_0x22e923,_0x81a9e9){return client[_0x5fad('0x10')](_0x135d8d,_0xcdad29)[_0x5fad('0x11')](function(_0x4fa4af){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x1167a0,_0x5fad('0x12'));logger[_0x5fad('0x13')](_0x5fad('0x14'),_0x1167a0,_0x5fad('0x12'),JSON[_0x5fad('0x15')](_0x4fa4af));if(_0x4fa4af[_0x5fad('0x16')]){if(_0x4fa4af['error']['code']===0x1f4){logger[_0x5fad('0x16')](_0x5fad('0x17'),_0x1167a0,_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);return _0x81a9e9(_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);}logger['error'](_0x5fad('0x17'),_0x1167a0,_0x4fa4af['error'][_0x5fad('0x18')]);return _0x22e923(_0x4fa4af[_0x5fad('0x16')][_0x5fad('0x18')]);}else{logger['info'](_0x5fad('0x17'),_0x1167a0,_0x5fad('0x12'));_0x22e923(_0x4fa4af[_0x5fad('0x19')][_0x5fad('0x18')]);}})['catch'](function(_0x388da4){logger[_0x5fad('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1167a0,_0x388da4);_0x81a9e9(_0x388da4);});});}exports[_0x5fad('0x1a')]=function(_0x306f8c){var _0x28ffea=this;return new Promise(function(_0x3faa43,_0x29db96){return db['OpenchannelQueue'][_0x5fad('0x1b')]({'raw':_0x306f8c['options']?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x1d')]===undefined?!![]:![]:!![],'where':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c['options']['where']||null:null,'attributes':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c['options'][_0x5fad('0x1e')]||null:null,'limit':_0x306f8c[_0x5fad('0x1c')]?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x1f')]||null:null,'include':_0x306f8c['options']?_0x306f8c[_0x5fad('0x1c')][_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x306f8c['options']['include'],function(_0x44a13b){return{'model':db[_0x44a13b[_0x5fad('0x22')]],'as':_0x44a13b['as'],'attributes':_0x44a13b[_0x5fad('0x1e')],'include':_0x44a13b[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x44a13b[_0x5fad('0x20')],function(_0x3a81c0){return{'model':db[_0x3a81c0[_0x5fad('0x22')]],'as':_0x3a81c0['as'],'attributes':_0x3a81c0[_0x5fad('0x1e')],'include':_0x3a81c0[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x3a81c0['include'],function(_0x2a5c83){return{'model':db[_0x2a5c83[_0x5fad('0x22')]],'as':_0x2a5c83['as'],'attributes':_0x2a5c83[_0x5fad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5fad('0x11')](function(_0x3018af){logger['info'](_0x5fad('0x1a'),_0x306f8c);logger[_0x5fad('0x13')](_0x5fad('0x1a'),_0x306f8c,JSON['stringify'](_0x3018af));_0x3faa43(_0x3018af);})[_0x5fad('0x23')](function(_0x7194e1){logger['error'](_0x5fad('0x1a'),_0x7194e1[_0x5fad('0x18')],_0x306f8c);_0x29db96(_0x28ffea[_0x5fad('0x16')](0x1f4,_0x7194e1[_0x5fad('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x59d8e5){var _0x95cddd=this;return new Promise(function(_0x1c8bb9,_0x48cffa){return db[_0x5fad('0x24')][_0x5fad('0x25')]({'raw':_0x59d8e5['options']?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x1d')]===undefined?!![]:![]:!![],'where':_0x59d8e5['options']?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x26')]||null:null,'attributes':_0x59d8e5[_0x5fad('0x1c')]?_0x59d8e5[_0x5fad('0x1c')][_0x5fad('0x1e')]||null:null,'include':_0x59d8e5[_0x5fad('0x1c')]?_0x59d8e5[_0x5fad('0x1c')]['include']?_[_0x5fad('0x21')](_0x59d8e5['options'][_0x5fad('0x20')],function(_0x375ba4){return{'model':db[_0x375ba4['model']],'as':_0x375ba4['as'],'attributes':_0x375ba4[_0x5fad('0x1e')],'include':_0x375ba4[_0x5fad('0x20')]?_[_0x5fad('0x21')](_0x375ba4[_0x5fad('0x20')],function(_0xf907b){return{'model':db[_0xf907b[_0x5fad('0x22')]],'as':_0xf907b['as'],'attributes':_0xf907b[_0x5fad('0x1e')],'include':_0xf907b['include']?_[_0x5fad('0x21')](_0xf907b['include'],function(_0x513b16){return{'model':db[_0x513b16['model']],'as':_0x513b16['as'],'attributes':_0x513b16[_0x5fad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5fad('0x11')](function(_0xaa1100){logger[_0x5fad('0x27')](_0x5fad('0x28'),_0x59d8e5);logger[_0x5fad('0x13')](_0x5fad('0x28'),_0x59d8e5,JSON['stringify'](_0xaa1100));_0x1c8bb9(_0xaa1100);})[_0x5fad('0x23')](function(_0x2f8a20){logger[_0x5fad('0x16')](_0x5fad('0x28'),_0x2f8a20[_0x5fad('0x18')],_0x59d8e5);_0x48cffa(_0x95cddd[_0x5fad('0x16')](0x1f4,_0x2f8a20['message']));});});}; \ No newline at end of file +var _0xffe9=['message','result','catch','findAll','options','raw','attributes','map','include','model','info','GetOpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x1d32cd,_0x102ab7){var _0x27646f=function(_0x3c00f1){while(--_0x3c00f1){_0x1d32cd['push'](_0x1d32cd['shift']());}};_0x27646f(++_0x102ab7);}(_0xffe9,0x111));var _0x9ffe=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xffe9[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x9ffe('0x0'));var util=require(_0x9ffe('0x1'));var moment=require('moment');var BPromise=require(_0x9ffe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ffe('0x3'));var db=require(_0x9ffe('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ffe('0x5'));var config=require(_0x9ffe('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9ffe('0x7')][_0x9ffe('0x8')]({'port':0x232a});config[_0x9ffe('0x9')]=_[_0x9ffe('0xa')](config[_0x9ffe('0x9')],{'host':_0x9ffe('0xb'),'port':0x18eb});var socket=require(_0x9ffe('0xc'))(new Redis(config[_0x9ffe('0x9')]));require('./openchannelQueue.socket')[_0x9ffe('0xd')](socket);function respondWithRpcPromise(_0x4afb7a,_0x3a60a5,_0x446703){return new BPromise(function(_0x194e72,_0x51a6f3){return client[_0x9ffe('0xe')](_0x4afb7a,_0x446703)[_0x9ffe('0xf')](function(_0x37e2be){logger['info'](_0x9ffe('0x10'),_0x3a60a5,_0x9ffe('0x11'));logger[_0x9ffe('0x12')](_0x9ffe('0x13'),_0x3a60a5,_0x9ffe('0x11'),JSON[_0x9ffe('0x14')](_0x37e2be));if(_0x37e2be['error']){if(_0x37e2be['error'][_0x9ffe('0x15')]===0x1f4){logger[_0x9ffe('0x16')](_0x9ffe('0x10'),_0x3a60a5,_0x37e2be[_0x9ffe('0x16')][_0x9ffe('0x17')]);return _0x51a6f3(_0x37e2be[_0x9ffe('0x16')][_0x9ffe('0x17')]);}logger[_0x9ffe('0x16')](_0x9ffe('0x10'),_0x3a60a5,_0x37e2be[_0x9ffe('0x16')][_0x9ffe('0x17')]);return _0x194e72(_0x37e2be[_0x9ffe('0x16')][_0x9ffe('0x17')]);}else{logger['info'](_0x9ffe('0x10'),_0x3a60a5,_0x9ffe('0x11'));_0x194e72(_0x37e2be[_0x9ffe('0x18')][_0x9ffe('0x17')]);}})[_0x9ffe('0x19')](function(_0x18a862){logger[_0x9ffe('0x16')](_0x9ffe('0x10'),_0x3a60a5,_0x18a862);_0x51a6f3(_0x18a862);});});}exports['GetOpenchannelQueue']=function(_0x55e7e3){var _0x27c3b8=this;return new Promise(function(_0x38efd2,_0x4e8f7c){return db['OpenchannelQueue'][_0x9ffe('0x1a')]({'raw':_0x55e7e3[_0x9ffe('0x1b')]?_0x55e7e3[_0x9ffe('0x1b')][_0x9ffe('0x1c')]===undefined?!![]:![]:!![],'where':_0x55e7e3[_0x9ffe('0x1b')]?_0x55e7e3[_0x9ffe('0x1b')]['where']||null:null,'attributes':_0x55e7e3[_0x9ffe('0x1b')]?_0x55e7e3[_0x9ffe('0x1b')][_0x9ffe('0x1d')]||null:null,'limit':_0x55e7e3[_0x9ffe('0x1b')]?_0x55e7e3[_0x9ffe('0x1b')]['limit']||null:null,'include':_0x55e7e3['options']?_0x55e7e3[_0x9ffe('0x1b')]['include']?_[_0x9ffe('0x1e')](_0x55e7e3[_0x9ffe('0x1b')][_0x9ffe('0x1f')],function(_0x4fcce1){return{'model':db[_0x4fcce1['model']],'as':_0x4fcce1['as'],'attributes':_0x4fcce1[_0x9ffe('0x1d')],'include':_0x4fcce1[_0x9ffe('0x1f')]?_['map'](_0x4fcce1[_0x9ffe('0x1f')],function(_0x256da3){return{'model':db[_0x256da3['model']],'as':_0x256da3['as'],'attributes':_0x256da3[_0x9ffe('0x1d')],'include':_0x256da3[_0x9ffe('0x1f')]?_[_0x9ffe('0x1e')](_0x256da3[_0x9ffe('0x1f')],function(_0x3a1406){return{'model':db[_0x3a1406[_0x9ffe('0x20')]],'as':_0x3a1406['as'],'attributes':_0x3a1406[_0x9ffe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9ffe('0xf')](function(_0x1eda09){logger[_0x9ffe('0x21')]('GetOpenchannelQueue',_0x55e7e3);logger[_0x9ffe('0x12')](_0x9ffe('0x22'),_0x55e7e3,JSON['stringify'](_0x1eda09));_0x38efd2(_0x1eda09);})['catch'](function(_0x1ce791){logger[_0x9ffe('0x16')](_0x9ffe('0x22'),_0x1ce791['message'],_0x55e7e3);_0x4e8f7c(_0x27c3b8[_0x9ffe('0x16')](0x1f4,_0x1ce791[_0x9ffe('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x9b46fa){var _0x223eb4=this;return new Promise(function(_0x9e9672,_0x32e3db){return db['OpenchannelQueue'][_0x9ffe('0x23')]({'raw':_0x9b46fa[_0x9ffe('0x1b')]?_0x9b46fa[_0x9ffe('0x1b')][_0x9ffe('0x1c')]===undefined?!![]:![]:!![],'where':_0x9b46fa[_0x9ffe('0x1b')]?_0x9b46fa['options']['where']||null:null,'attributes':_0x9b46fa['options']?_0x9b46fa[_0x9ffe('0x1b')][_0x9ffe('0x1d')]||null:null,'include':_0x9b46fa[_0x9ffe('0x1b')]?_0x9b46fa[_0x9ffe('0x1b')][_0x9ffe('0x1f')]?_[_0x9ffe('0x1e')](_0x9b46fa[_0x9ffe('0x1b')]['include'],function(_0x48246f){return{'model':db[_0x48246f[_0x9ffe('0x20')]],'as':_0x48246f['as'],'attributes':_0x48246f[_0x9ffe('0x1d')],'include':_0x48246f[_0x9ffe('0x1f')]?_[_0x9ffe('0x1e')](_0x48246f[_0x9ffe('0x1f')],function(_0xa921e9){return{'model':db[_0xa921e9[_0x9ffe('0x20')]],'as':_0xa921e9['as'],'attributes':_0xa921e9[_0x9ffe('0x1d')],'include':_0xa921e9[_0x9ffe('0x1f')]?_[_0x9ffe('0x1e')](_0xa921e9[_0x9ffe('0x1f')],function(_0x4d83cb){return{'model':db[_0x4d83cb['model']],'as':_0x4d83cb['as'],'attributes':_0x4d83cb[_0x9ffe('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9ffe('0xf')](function(_0x14a966){logger[_0x9ffe('0x21')](_0x9ffe('0x24'),_0x9b46fa);logger[_0x9ffe('0x12')](_0x9ffe('0x24'),_0x9b46fa,JSON[_0x9ffe('0x14')](_0x14a966));_0x9e9672(_0x14a966);})[_0x9ffe('0x19')](function(_0x28fb54){logger[_0x9ffe('0x16')](_0x9ffe('0x24'),_0x28fb54[_0x9ffe('0x17')],_0x9b46fa);_0x32e3db(_0x223eb4[_0x9ffe('0x16')](0x1f4,_0x28fb54['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 5f7b29d..49de90a 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 _0x7385=['update','emit','removeListener','save','remove'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x7385,0x1ac));var _0x5738=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7385[_0x397e5f];return _0x5302b8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x5738('0x0'),_0x5738('0x1'),_0x5738('0x2')];function createListener(_0x45b766,_0x16ca0f){return function(_0x1c123e){_0x16ca0f[_0x5738('0x3')](_0x45b766,_0x1c123e);};}function removeListener(_0x33c550,_0xebd9a4){return function(){OpenchannelQueueEvents[_0x5738('0x4')](_0x33c550,_0xebd9a4);};}exports['register']=function(_0x4fd36c){for(var _0x20df37=0x0,_0x2a0d2b=events['length'];_0x20df37<_0x2a0d2b;_0x20df37++){var _0x5723ba=events[_0x20df37];var _0x42793f=createListener('openchannelQueue:'+_0x5723ba,_0x4fd36c);OpenchannelQueueEvents['on'](_0x5723ba,_0x42793f);}}; \ No newline at end of file +var _0x213c=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x213c,0xc4));var _0xc213=function(_0x54f06d,_0x181813){_0x54f06d=_0x54f06d-0x0;var _0x3f38b6=_0x213c[_0x54f06d];return _0x3f38b6;};'use strict';var OpenchannelQueueEvents=require(_0xc213('0x0'));var events=['save',_0xc213('0x1'),_0xc213('0x2')];function createListener(_0x496ac1,_0x2714bb){return function(_0x3e68ee){_0x2714bb[_0xc213('0x3')](_0x496ac1,_0x3e68ee);};}function removeListener(_0x2a25ff,_0x3503de){return function(){OpenchannelQueueEvents[_0xc213('0x4')](_0x2a25ff,_0x3503de);};}exports[_0xc213('0x5')]=function(_0x48b853){for(var _0x3a8d56=0x0,_0x296daf=events[_0xc213('0x6')];_0x3a8d56<_0x296daf;_0x3a8d56++){var _0x1718f9=events[_0x3a8d56];var _0x137ff3=createListener(_0xc213('0x7')+_0x1718f9,_0x48b853);OpenchannelQueueEvents['on'](_0x1718f9,_0x137ff3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2489d97..debe1c5 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 _0x7b75=['show','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x282823,_0x422f23){var _0x162a49=function(_0x30f9c4){while(--_0x30f9c4){_0x282823['push'](_0x282823['shift']());}};_0x162a49(++_0x422f23);}(_0x7b75,0x16d));var _0x57b7=function(_0x1900be,_0x59745d){_0x1900be=_0x1900be-0x0;var _0x1b44d5=_0x7b75[_0x1900be];return _0x1b44d5;};'use strict';var multer=require(_0x57b7('0x0'));var util=require(_0x57b7('0x1'));var path=require(_0x57b7('0x2'));var timeout=require(_0x57b7('0x3'));var express=require(_0x57b7('0x4'));var router=express['Router']();var fs_extra=require(_0x57b7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x57b7('0x6'));var config=require(_0x57b7('0x7'));var controller=require(_0x57b7('0x8'));router[_0x57b7('0x9')]('/',auth[_0x57b7('0xa')](),controller[_0x57b7('0xb')]);router[_0x57b7('0x9')](_0x57b7('0xc'),auth[_0x57b7('0xa')](),controller[_0x57b7('0xd')]);router[_0x57b7('0x9')](_0x57b7('0xe'),auth[_0x57b7('0xa')](),controller[_0x57b7('0xf')]);router['post']('/',auth[_0x57b7('0xa')](),controller[_0x57b7('0x10')]);router[_0x57b7('0x11')]('/:id',auth[_0x57b7('0xa')](),controller[_0x57b7('0x12')]);router['delete']('/:id',auth[_0x57b7('0xa')](),controller[_0x57b7('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf820=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x2d0bf5,_0xf10367){var _0x5067ac=function(_0x56695d){while(--_0x56695d){_0x2d0bf5['push'](_0x2d0bf5['shift']());}};_0x5067ac(++_0xf10367);}(_0xf820,0x86));var _0x0f82=function(_0x5eea5e,_0x4869c6){_0x5eea5e=_0x5eea5e-0x0;var _0x30aa47=_0xf820[_0x5eea5e];return _0x30aa47;};'use strict';var multer=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var path=require(_0x0f82('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f82('0x3'));var router=express[_0x0f82('0x4')]();var fs_extra=require(_0x0f82('0x5'));var auth=require(_0x0f82('0x6'));var interaction=require(_0x0f82('0x7'));var config=require(_0x0f82('0x8'));var controller=require(_0x0f82('0x9'));router['get']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0xb')]);router[_0x0f82('0xc')](_0x0f82('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x0f82('0xc')]('/:id',auth[_0x0f82('0xa')](),controller[_0x0f82('0xe')]);router['post']('/',auth[_0x0f82('0xa')](),controller[_0x0f82('0xf')]);router[_0x0f82('0x10')]('/:id',auth[_0x0f82('0xa')](),controller[_0x0f82('0x11')]);router[_0x0f82('0x12')]('/:id',auth[_0x0f82('0xa')](),controller[_0x0f82('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1a95fdf..3fd12f9 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 _0x23f6=['DATE','moment','sequelize','exports','STRING'];(function(_0x5222cb,_0x5b965e){var _0x88f3eb=function(_0x353421){while(--_0x353421){_0x5222cb['push'](_0x5222cb['shift']());}};_0x88f3eb(++_0x5b965e);}(_0x23f6,0xb0));var _0x623f=function(_0x11ee3d,_0x2d36bc){_0x11ee3d=_0x11ee3d-0x0;var _0x45e37e=_0x23f6[_0x11ee3d];return _0x45e37e;};'use strict';var moment=require(_0x623f('0x0'));var Sequelize=require(_0x623f('0x1'));module[_0x623f('0x2')]={'uniqueid':{'type':Sequelize[_0x623f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x623f('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x623f('0x4')]},'acceptAt':{'type':Sequelize[_0x623f('0x4')]},'exitAt':{'type':Sequelize[_0x623f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c50=['exports','STRING','DATE','sequelize'];(function(_0x4389e5,_0x249a52){var _0x2431e5=function(_0x1100d4){while(--_0x1100d4){_0x4389e5['push'](_0x4389e5['shift']());}};_0x2431e5(++_0x249a52);}(_0x4c50,0xf7));var _0x04c5=function(_0x534513,_0x19cb44){_0x534513=_0x534513-0x0;var _0x4eaccf=_0x4c50[_0x534513];return _0x4eaccf;};'use strict';var moment=require('moment');var Sequelize=require(_0x04c5('0x0'));module[_0x04c5('0x1')]={'uniqueid':{'type':Sequelize[_0x04c5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x04c5('0x3')]},'acceptAt':{'type':Sequelize[_0x04c5('0x3')]},'exitAt':{'type':Sequelize[_0x04c5('0x3')]},'reason':{'type':Sequelize[_0x04c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 485ed31..e7d8825 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 _0x7757=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4b8afa,_0x55852a){var _0x3ccbe2=function(_0x3c6c0e){while(--_0x3c6c0e){_0x4b8afa['push'](_0x4b8afa['shift']());}};_0x3ccbe2(++_0x55852a);}(_0x7757,0x188));var _0x7775=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7757[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7775('0x0'));var jsonpatch=require(_0x7775('0x1'));var rp=require(_0x7775('0x2'));var moment=require(_0x7775('0x3'));var BPromise=require(_0x7775('0x4'));var Mustache=require(_0x7775('0x5'));var util=require('util');var path=require(_0x7775('0x6'));var sox=require(_0x7775('0x7'));var csv=require(_0x7775('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7775('0x9'));var _=require(_0x7775('0xa'));var squel=require('squel');var crypto=require(_0x7775('0xb'));var jsforce=require(_0x7775('0xc'));var deskjs=require(_0x7775('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7775('0xe'));var Papa=require(_0x7775('0xf'));var Redis=require(_0x7775('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7775('0x11'));var as=require(_0x7775('0x12'));var hardwareService=require(_0x7775('0x13'));var logger=require(_0x7775('0x14'))(_0x7775('0x15'));var utils=require(_0x7775('0x16'));var config=require(_0x7775('0x17'));var licenseUtil=require(_0x7775('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x361332,_0x3972b5){_0x3972b5=_0x3972b5||0xcc;return function(_0x401ecd){if(_0x401ecd){return _0x361332[_0x7775('0x19')](_0x3972b5);}return _0x361332[_0x7775('0x1a')](_0x3972b5)['end']();};}function respondWithResult(_0x10151f,_0x41df2c){_0x41df2c=_0x41df2c||0xc8;return function(_0x2c8689){if(_0x2c8689){return _0x10151f['status'](_0x41df2c)[_0x7775('0x1b')](_0x2c8689);}};}function respondWithFilteredResult(_0xe96d6d,_0x452740){return function(_0x421ff8){if(_0x421ff8){var _0x37f1b7=typeof _0x452740[_0x7775('0x1c')]===_0x7775('0x1d')&&typeof _0x452740[_0x7775('0x1e')]===_0x7775('0x1d');var _0x52447e=_0x421ff8['count'];var _0x4f402b=_0x37f1b7?0x0:_0x452740['offset'];var _0xed5582=_0x37f1b7?_0x421ff8['count']:_0x452740['offset']+_0x452740[_0x7775('0x1e')];var _0x538fbc;if(_0xed5582>=_0x52447e){_0xed5582=_0x52447e;_0x538fbc=0xc8;}else{_0x538fbc=0xce;}_0xe96d6d[_0x7775('0x1a')](_0x538fbc);return _0xe96d6d[_0x7775('0x1f')](_0x7775('0x20'),_0x4f402b+'-'+_0xed5582+'/'+_0x52447e)[_0x7775('0x1b')](_0x421ff8);}return null;};}function patchUpdates(_0x4c75be){return function(_0x3cb2df){try{jsonpatch[_0x7775('0x21')](_0x3cb2df,_0x4c75be,!![]);}catch(_0x5781b1){return BPromise['reject'](_0x5781b1);}return _0x3cb2df[_0x7775('0x22')]();};}function saveUpdates(_0x122ea3,_0x1c50fd){return function(_0x54243e){if(_0x54243e){return _0x54243e[_0x7775('0x23')](_0x122ea3)['then'](function(_0x402046){return _0x402046;});}return null;};}function removeEntity(_0x408871,_0x367e2b){return function(_0x1f87e5){if(_0x1f87e5){return _0x1f87e5['destroy']()[_0x7775('0x24')](function(){_0x408871[_0x7775('0x1a')](0xcc)[_0x7775('0x25')]();});}};}function handleEntityNotFound(_0x4ee870,_0xeda466){return function(_0x566af6){if(!_0x566af6){_0x4ee870[_0x7775('0x19')](0x194);}return _0x566af6;};}function handleError(_0x8503f4,_0x360d55){_0x360d55=_0x360d55||0x1f4;return function(_0x31ee00){logger[_0x7775('0x26')](_0x31ee00[_0x7775('0x27')]);if(_0x31ee00[_0x7775('0x28')]){delete _0x31ee00[_0x7775('0x28')];}_0x8503f4[_0x7775('0x1a')](_0x360d55)['send'](_0x31ee00);};}exports[_0x7775('0x29')]=function(_0x9b5953,_0x5a1738){var _0x3129c6={},_0x4ac0da={},_0x2f1c17={'count':0x0,'rows':[]};var _0x1e4f0f=_[_0x7775('0x2a')](db[_0x7775('0x2b')][_0x7775('0x2c')],function(_0x34e9fe){return{'name':_0x34e9fe[_0x7775('0x2d')],'type':_0x34e9fe[_0x7775('0x2e')][_0x7775('0x2f')]};});_0x4ac0da[_0x7775('0x30')]=_[_0x7775('0x2a')](_0x1e4f0f,_0x7775('0x28'));_0x4ac0da[_0x7775('0x31')]=_[_0x7775('0x32')](_0x9b5953['query']);_0x4ac0da[_0x7775('0x33')]=_[_0x7775('0x34')](_0x4ac0da[_0x7775('0x30')],_0x4ac0da[_0x7775('0x31')]);_0x3129c6[_0x7775('0x35')]=_[_0x7775('0x34')](_0x4ac0da[_0x7775('0x30')],qs['fields'](_0x9b5953[_0x7775('0x31')][_0x7775('0x36')]));_0x3129c6[_0x7775('0x35')]=_0x3129c6[_0x7775('0x35')][_0x7775('0x37')]?_0x3129c6[_0x7775('0x35')]:_0x4ac0da['model'];if(!_0x9b5953[_0x7775('0x31')][_0x7775('0x38')](_0x7775('0x39'))){_0x3129c6[_0x7775('0x1e')]=qs[_0x7775('0x1e')](_0x9b5953[_0x7775('0x31')][_0x7775('0x1e')]);_0x3129c6[_0x7775('0x1c')]=qs['offset'](_0x9b5953[_0x7775('0x31')][_0x7775('0x1c')]);}_0x3129c6[_0x7775('0x3a')]=qs['sort'](_0x9b5953[_0x7775('0x31')]['sort']);_0x3129c6[_0x7775('0x3b')]=qs['filters'](_['pick'](_0x9b5953[_0x7775('0x31')],_0x4ac0da[_0x7775('0x33')]),_0x1e4f0f);if(_0x9b5953[_0x7775('0x31')][_0x7775('0x3c')]){_0x3129c6[_0x7775('0x3b')]=_[_0x7775('0x3d')](_0x3129c6[_0x7775('0x3b')],{'$or':_['map'](_0x1e4f0f,function(_0x180b22){if(_0x180b22['type']!==_0x7775('0x3e')){var _0x2a3cde={};_0x2a3cde[_0x180b22[_0x7775('0x28')]]={'$like':'%'+_0x9b5953[_0x7775('0x31')][_0x7775('0x3c')]+'%'};return _0x2a3cde;}})});}_0x3129c6=_[_0x7775('0x3d')]({},_0x3129c6,_0x9b5953['options']);var _0x362119={'where':_0x3129c6[_0x7775('0x3b')]};return db[_0x7775('0x2b')]['count'](_0x362119)[_0x7775('0x24')](function(_0x3e3c94){_0x2f1c17['count']=_0x3e3c94;if(_0x9b5953[_0x7775('0x31')]['includeAll']){_0x3129c6[_0x7775('0x3f')]=[{'all':!![]}];}return db[_0x7775('0x2b')][_0x7775('0x40')](_0x3129c6);})[_0x7775('0x24')](function(_0x4ca997){_0x2f1c17[_0x7775('0x41')]=_0x4ca997;return _0x2f1c17;})['then'](respondWithFilteredResult(_0x5a1738,_0x3129c6))['catch'](handleError(_0x5a1738,null));};exports[_0x7775('0x42')]=function(_0x38519b,_0xe6799b){var _0x12734b={'raw':!![],'where':{'id':_0x38519b[_0x7775('0x43')]['id']}},_0x4fefed={};_0x4fefed[_0x7775('0x30')]=_[_0x7775('0x32')](db[_0x7775('0x2b')][_0x7775('0x2c')]);_0x4fefed[_0x7775('0x31')]=_[_0x7775('0x32')](_0x38519b[_0x7775('0x31')]);_0x4fefed['filters']=_[_0x7775('0x34')](_0x4fefed[_0x7775('0x30')],_0x4fefed['query']);_0x12734b[_0x7775('0x35')]=_[_0x7775('0x34')](_0x4fefed['model'],qs[_0x7775('0x36')](_0x38519b[_0x7775('0x31')]['fields']));_0x12734b[_0x7775('0x35')]=_0x12734b[_0x7775('0x35')]['length']?_0x12734b[_0x7775('0x35')]:_0x4fefed[_0x7775('0x30')];if(_0x38519b[_0x7775('0x31')]['includeAll']){_0x12734b['include']=[{'all':!![]}];}_0x12734b=_['merge']({},_0x12734b,_0x38519b['options']);return db[_0x7775('0x2b')][_0x7775('0x44')](_0x12734b)[_0x7775('0x24')](handleEntityNotFound(_0xe6799b,null))[_0x7775('0x24')](respondWithResult(_0xe6799b,null))[_0x7775('0x45')](handleError(_0xe6799b,null));};exports[_0x7775('0x46')]=function(_0x3c387c,_0x29e595){return db[_0x7775('0x2b')][_0x7775('0x46')](_0x3c387c[_0x7775('0x47')],{})[_0x7775('0x24')](respondWithResult(_0x29e595,0xc9))[_0x7775('0x45')](handleError(_0x29e595,null));};exports[_0x7775('0x23')]=function(_0x247f99,_0xc76534){if(_0x247f99[_0x7775('0x47')]['id']){delete _0x247f99[_0x7775('0x47')]['id'];}return db['OpenchannelQueueReport'][_0x7775('0x44')]({'where':{'id':_0x247f99[_0x7775('0x43')]['id']}})['then'](handleEntityNotFound(_0xc76534,null))[_0x7775('0x24')](saveUpdates(_0x247f99[_0x7775('0x47')],null))[_0x7775('0x24')](respondWithResult(_0xc76534,null))[_0x7775('0x45')](handleError(_0xc76534,null));};exports[_0x7775('0x48')]=function(_0x4cc612,_0x398cb6){return db['OpenchannelQueueReport'][_0x7775('0x44')]({'where':{'id':_0x4cc612[_0x7775('0x43')]['id']}})['then'](handleEntityNotFound(_0x398cb6,null))[_0x7775('0x24')](removeEntity(_0x398cb6,null))[_0x7775('0x45')](handleError(_0x398cb6,null));};exports['describe']=function(_0x13e599,_0x1ab56a){return db[_0x7775('0x2b')][_0x7775('0x49')]()['then'](respondWithResult(_0x1ab56a,null))[_0x7775('0x45')](handleError(_0x1ab56a,null));}; \ No newline at end of file +var _0x303e=['type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelQueueReport','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge'];(function(_0x31ce76,_0xddc212){var _0x9001bf=function(_0x4405bf){while(--_0x4405bf){_0x31ce76['push'](_0x31ce76['shift']());}};_0x9001bf(++_0xddc212);}(_0x303e,0x186));var _0xe303=function(_0x32cfaf,_0x565e6a){_0x32cfaf=_0x32cfaf-0x0;var _0x1d902b=_0x303e[_0x32cfaf];return _0x1d902b;};'use strict';var emlformat=require(_0xe303('0x0'));var rimraf=require(_0xe303('0x1'));var zipdir=require(_0xe303('0x2'));var jsonpatch=require(_0xe303('0x3'));var rp=require('request-promise');var moment=require(_0xe303('0x4'));var BPromise=require(_0xe303('0x5'));var Mustache=require('mustache');var util=require(_0xe303('0x6'));var path=require(_0xe303('0x7'));var sox=require(_0xe303('0x8'));var csv=require(_0xe303('0x9'));var ejs=require(_0xe303('0xa'));var fs=require('fs');var fs_extra=require(_0xe303('0xb'));var _=require(_0xe303('0xc'));var squel=require('squel');var crypto=require(_0xe303('0xd'));var jsforce=require(_0xe303('0xe'));var deskjs=require(_0xe303('0xf'));var toCsv=require(_0xe303('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe303('0x10'));var authService=require(_0xe303('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe303('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe303('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe303('0x14'));var db=require(_0xe303('0x15'))['db'];function respondWithStatusCode(_0x433dcf,_0x570633){_0x570633=_0x570633||0xcc;return function(_0x39ef66){if(_0x39ef66){return _0x433dcf['sendStatus'](_0x570633);}return _0x433dcf[_0xe303('0x16')](_0x570633)[_0xe303('0x17')]();};}function respondWithResult(_0x1215cd,_0x91d664){_0x91d664=_0x91d664||0xc8;return function(_0x282ec9){if(_0x282ec9){return _0x1215cd[_0xe303('0x16')](_0x91d664)[_0xe303('0x18')](_0x282ec9);}};}function respondWithFilteredResult(_0x53edd5,_0x1b84d2){return function(_0x3d5931){if(_0x3d5931){var _0x1615ae=typeof _0x1b84d2[_0xe303('0x19')]===_0xe303('0x1a')&&typeof _0x1b84d2[_0xe303('0x1b')]==='undefined';var _0x199edc=_0x3d5931[_0xe303('0x1c')];var _0x235cb9=_0x1615ae?0x0:_0x1b84d2[_0xe303('0x19')];var _0x1d3cd2=_0x1615ae?_0x3d5931[_0xe303('0x1c')]:_0x1b84d2[_0xe303('0x19')]+_0x1b84d2['limit'];var _0x14767d;if(_0x1d3cd2>=_0x199edc){_0x1d3cd2=_0x199edc;_0x14767d=0xc8;}else{_0x14767d=0xce;}_0x53edd5[_0xe303('0x16')](_0x14767d);return _0x53edd5[_0xe303('0x1d')](_0xe303('0x1e'),_0x235cb9+'-'+_0x1d3cd2+'/'+_0x199edc)[_0xe303('0x18')](_0x3d5931);}return null;};}function patchUpdates(_0xb23756){return function(_0x1546bd){try{jsonpatch['apply'](_0x1546bd,_0xb23756,!![]);}catch(_0xb9d7a){return BPromise['reject'](_0xb9d7a);}return _0x1546bd[_0xe303('0x1f')]();};}function saveUpdates(_0x178bfb,_0x122ce8){return function(_0x4ad1d8){if(_0x4ad1d8){return _0x4ad1d8[_0xe303('0x20')](_0x178bfb)[_0xe303('0x21')](function(_0x630a3d){return _0x630a3d;});}return null;};}function removeEntity(_0x4492b1,_0x28f1b8){return function(_0x1c1fb5){if(_0x1c1fb5){return _0x1c1fb5[_0xe303('0x22')]()['then'](function(){_0x4492b1[_0xe303('0x16')](0xcc)[_0xe303('0x17')]();});}};}function handleEntityNotFound(_0x70f7d1,_0x46e8bf){return function(_0x5e55d4){if(!_0x5e55d4){_0x70f7d1[_0xe303('0x23')](0x194);}return _0x5e55d4;};}function handleError(_0x569874,_0x32da5a){_0x32da5a=_0x32da5a||0x1f4;return function(_0x262aca){logger[_0xe303('0x24')](_0x262aca[_0xe303('0x25')]);if(_0x262aca[_0xe303('0x26')]){delete _0x262aca[_0xe303('0x26')];}_0x569874[_0xe303('0x16')](_0x32da5a)[_0xe303('0x27')](_0x262aca);};}exports[_0xe303('0x28')]=function(_0x3dc0d7,_0x4652f3){var _0xf744db={},_0x32d2b3={},_0x5db6a2={'count':0x0,'rows':[]};var _0x1ee9bb=_['map'](db[_0xe303('0x29')]['rawAttributes'],function(_0x1b5006){return{'name':_0x1b5006[_0xe303('0x2a')],'type':_0x1b5006['type'][_0xe303('0x2b')]};});_0x32d2b3[_0xe303('0x2c')]=_[_0xe303('0x2d')](_0x1ee9bb,_0xe303('0x26'));_0x32d2b3['query']=_[_0xe303('0x2e')](_0x3dc0d7[_0xe303('0x2f')]);_0x32d2b3['filters']=_[_0xe303('0x30')](_0x32d2b3[_0xe303('0x2c')],_0x32d2b3[_0xe303('0x2f')]);_0xf744db[_0xe303('0x31')]=_[_0xe303('0x30')](_0x32d2b3[_0xe303('0x2c')],qs[_0xe303('0x32')](_0x3dc0d7[_0xe303('0x2f')]['fields']));_0xf744db[_0xe303('0x31')]=_0xf744db['attributes'][_0xe303('0x33')]?_0xf744db[_0xe303('0x31')]:_0x32d2b3['model'];if(!_0x3dc0d7[_0xe303('0x2f')][_0xe303('0x34')]('nolimit')){_0xf744db[_0xe303('0x1b')]=qs[_0xe303('0x1b')](_0x3dc0d7['query'][_0xe303('0x1b')]);_0xf744db['offset']=qs['offset'](_0x3dc0d7[_0xe303('0x2f')]['offset']);}_0xf744db[_0xe303('0x35')]=qs[_0xe303('0x36')](_0x3dc0d7[_0xe303('0x2f')]['sort']);_0xf744db[_0xe303('0x37')]=qs['filters'](_[_0xe303('0x38')](_0x3dc0d7['query'],_0x32d2b3[_0xe303('0x39')]),_0x1ee9bb);if(_0x3dc0d7[_0xe303('0x2f')][_0xe303('0x3a')]){_0xf744db[_0xe303('0x37')]=_[_0xe303('0x3b')](_0xf744db['where'],{'$or':_[_0xe303('0x2d')](_0x1ee9bb,function(_0x3f15ec){if(_0x3f15ec[_0xe303('0x3c')]!==_0xe303('0x3d')){var _0x5c3ffd={};_0x5c3ffd[_0x3f15ec[_0xe303('0x26')]]={'$like':'%'+_0x3dc0d7[_0xe303('0x2f')]['filter']+'%'};return _0x5c3ffd;}})});}_0xf744db=_['merge']({},_0xf744db,_0x3dc0d7['options']);var _0x3e8004={'where':_0xf744db[_0xe303('0x37')]};return db[_0xe303('0x29')][_0xe303('0x1c')](_0x3e8004)['then'](function(_0xa2cae2){_0x5db6a2['count']=_0xa2cae2;if(_0x3dc0d7[_0xe303('0x2f')][_0xe303('0x3e')]){_0xf744db[_0xe303('0x3f')]=[{'all':!![]}];}return db[_0xe303('0x29')][_0xe303('0x40')](_0xf744db);})[_0xe303('0x21')](function(_0x3383a1){_0x5db6a2[_0xe303('0x41')]=_0x3383a1;return _0x5db6a2;})['then'](respondWithFilteredResult(_0x4652f3,_0xf744db))[_0xe303('0x42')](handleError(_0x4652f3,null));};exports[_0xe303('0x43')]=function(_0x57a81b,_0x8b93f3){var _0xa3ff9c={'raw':!![],'where':{'id':_0x57a81b[_0xe303('0x44')]['id']}},_0x5929c3={};_0x5929c3[_0xe303('0x2c')]=_[_0xe303('0x2e')](db[_0xe303('0x29')][_0xe303('0x45')]);_0x5929c3[_0xe303('0x2f')]=_[_0xe303('0x2e')](_0x57a81b['query']);_0x5929c3[_0xe303('0x39')]=_[_0xe303('0x30')](_0x5929c3[_0xe303('0x2c')],_0x5929c3['query']);_0xa3ff9c[_0xe303('0x31')]=_['intersection'](_0x5929c3['model'],qs['fields'](_0x57a81b[_0xe303('0x2f')][_0xe303('0x32')]));_0xa3ff9c[_0xe303('0x31')]=_0xa3ff9c['attributes'][_0xe303('0x33')]?_0xa3ff9c[_0xe303('0x31')]:_0x5929c3[_0xe303('0x2c')];if(_0x57a81b[_0xe303('0x2f')]['includeAll']){_0xa3ff9c[_0xe303('0x3f')]=[{'all':!![]}];}_0xa3ff9c=_[_0xe303('0x3b')]({},_0xa3ff9c,_0x57a81b[_0xe303('0x46')]);return db[_0xe303('0x29')][_0xe303('0x47')](_0xa3ff9c)[_0xe303('0x21')](handleEntityNotFound(_0x8b93f3,null))[_0xe303('0x21')](respondWithResult(_0x8b93f3,null))['catch'](handleError(_0x8b93f3,null));};exports[_0xe303('0x48')]=function(_0x32e9ff,_0x46eaff){return db[_0xe303('0x29')][_0xe303('0x48')](_0x32e9ff[_0xe303('0x49')],{})[_0xe303('0x21')](respondWithResult(_0x46eaff,0xc9))['catch'](handleError(_0x46eaff,null));};exports['update']=function(_0x248708,_0x94cf05){if(_0x248708[_0xe303('0x49')]['id']){delete _0x248708['body']['id'];}return db['OpenchannelQueueReport'][_0xe303('0x47')]({'where':{'id':_0x248708['params']['id']}})['then'](handleEntityNotFound(_0x94cf05,null))['then'](saveUpdates(_0x248708['body'],null))[_0xe303('0x21')](respondWithResult(_0x94cf05,null))[_0xe303('0x42')](handleError(_0x94cf05,null));};exports[_0xe303('0x22')]=function(_0x2a8c3b,_0x59a963){return db[_0xe303('0x29')]['find']({'where':{'id':_0x2a8c3b[_0xe303('0x44')]['id']}})[_0xe303('0x21')](handleEntityNotFound(_0x59a963,null))[_0xe303('0x21')](removeEntity(_0x59a963,null))[_0xe303('0x42')](handleError(_0x59a963,null));};exports['describe']=function(_0x2ef9c8,_0x5d6691){return db['OpenchannelQueueReport'][_0xe303('0x4a')]()['then'](respondWithResult(_0x5d6691,null))[_0xe303('0x42')](handleError(_0x5d6691,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 25ffa63..b478354 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x123436,_0x1f2426){var _0x2d2f37=function(_0x3dec50){while(--_0x3dec50){_0x123436['push'](_0x123436['shift']());}};_0x2d2f37(++_0x1f2426);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x219c5d,_0x3fd780){var _0x89fece=function(_0x535277){while(--_0x535277){_0x219c5d['push'](_0x219c5d['shift']());}};_0x89fece(++_0x3fd780);}(_0x7a54,0x106));var _0x47a5=function(_0xb1029f,_0x50cdd0){_0xb1029f=_0xb1029f-0x0;var _0x2a2473=_0x7a54[_0xb1029f];return _0x2a2473;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0bf3914..5fe0ee9 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 _0x42f4=['jayson/promise','http','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','result','catch','OpenchannelQueueReport','create','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x42f4,0x19d));var _0x442f=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x42f4[_0x7a112];return _0x136dc5;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});}exports['CreateOpenchannelQueueReport']=function(_0x54c48a){var _0x5668e0=this;return new Promise(function(_0x5e3dda,_0x1b18fd){return db[_0x442f('0x15')][_0x442f('0x16')](_0x54c48a[_0x442f('0x17')],{'raw':_0x54c48a[_0x442f('0x18')]?_0x54c48a[_0x442f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x442f('0x9')](function(_0x552f81){logger[_0x442f('0x12')](_0x442f('0x19'),_0x54c48a);logger[_0x442f('0xb')]('CreateOpenchannelQueueReport',_0x54c48a,JSON[_0x442f('0xd')](_0x552f81));_0x5e3dda(_0x552f81);})[_0x442f('0x14')](function(_0x5dd019){logger['error'](_0x442f('0x19'),_0x5dd019[_0x442f('0x11')],_0x54c48a);_0x1b18fd(_0x5668e0[_0x442f('0xe')](0x1f4,_0x5dd019[_0x442f('0x11')]));});});};exports[_0x442f('0x1a')]=function(_0x127b9c){var _0x31d445=this;return new Promise(function(_0x372db9,_0x1eae0a){return db['OpenchannelQueueReport'][_0x442f('0x1b')](_0x127b9c[_0x442f('0x17')],{'raw':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')][_0x442f('0x1c')]||null:null,'attributes':_0x127b9c[_0x442f('0x18')]?_0x127b9c['options'][_0x442f('0x1d')]||null:null,'limit':_0x127b9c[_0x442f('0x18')]?_0x127b9c[_0x442f('0x18')]['limit']||null:null})[_0x442f('0x9')](function(_0x5a272e){logger[_0x442f('0x12')](_0x442f('0x1a'),_0x127b9c);logger[_0x442f('0xb')]('UpdateOpenchannelQueueReport',_0x127b9c,JSON[_0x442f('0xd')](_0x5a272e));_0x372db9(_0x5a272e);})[_0x442f('0x14')](function(_0x16a369){logger[_0x442f('0xe')](_0x442f('0x1a'),_0x16a369['message'],_0x127b9c);_0x1eae0a(_0x31d445['error'](0x1f4,_0x16a369[_0x442f('0x11')]));});});}; \ No newline at end of file +var _0x80ed=['catch','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x80ed,0x11c));var _0xd80e=function(_0x2b4851,_0x4d96a9){_0x2b4851=_0x2b4851-0x0;var _0x2eca01=_0x80ed[_0x2b4851];return _0x2eca01;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c361,_0x411b3a,_0x438f7d){return new BPromise(function(_0x3b4f35,_0x1bacd3){return client[_0xd80e('0xb')](_0x51c361,_0x438f7d)[_0xd80e('0xc')](function(_0x3063ff){logger[_0xd80e('0xd')](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));logger['debug'](_0xd80e('0x10'),_0x411b3a,_0xd80e('0xf'),JSON[_0xd80e('0x11')](_0x3063ff));if(_0x3063ff[_0xd80e('0x12')]){if(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x13')]===0x1f4){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')]['message']);return _0x1bacd3(_0x3063ff['error']['message']);}logger['error'](_0xd80e('0xe'),_0x411b3a,_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);return _0x3b4f35(_0x3063ff[_0xd80e('0x12')][_0xd80e('0x14')]);}else{logger['info'](_0xd80e('0xe'),_0x411b3a,_0xd80e('0xf'));_0x3b4f35(_0x3063ff[_0xd80e('0x15')][_0xd80e('0x14')]);}})[_0xd80e('0x16')](function(_0xc25d82){logger[_0xd80e('0x12')](_0xd80e('0xe'),_0x411b3a,_0xc25d82);_0x1bacd3(_0xc25d82);});});}exports['CreateOpenchannelQueueReport']=function(_0x21ceec){var _0x1cc576=this;return new Promise(function(_0x3b543d,_0x34e239){return db['OpenchannelQueueReport'][_0xd80e('0x17')](_0x21ceec[_0xd80e('0x18')],{'raw':_0x21ceec[_0xd80e('0x19')]?_0x21ceec['options'][_0xd80e('0x1a')]===undefined?!![]:![]:!![]})[_0xd80e('0xc')](function(_0x2765ea){logger[_0xd80e('0xd')](_0xd80e('0x1b'),_0x21ceec);logger['debug']('CreateOpenchannelQueueReport',_0x21ceec,JSON[_0xd80e('0x11')](_0x2765ea));_0x3b543d(_0x2765ea);})[_0xd80e('0x16')](function(_0x3b39bf){logger[_0xd80e('0x12')](_0xd80e('0x1b'),_0x3b39bf[_0xd80e('0x14')],_0x21ceec);_0x34e239(_0x1cc576[_0xd80e('0x12')](0x1f4,_0x3b39bf['message']));});});};exports[_0xd80e('0x1c')]=function(_0x57d70){var _0x170109=this;return new Promise(function(_0x5b0d6d,_0x635ce0){return db[_0xd80e('0x1d')][_0xd80e('0x1e')](_0x57d70['body'],{'raw':_0x57d70['options']?_0x57d70['options'][_0xd80e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d70['options']?_0x57d70[_0xd80e('0x19')][_0xd80e('0x1f')]||null:null,'attributes':_0x57d70['options']?_0x57d70[_0xd80e('0x19')][_0xd80e('0x20')]||null:null,'limit':_0x57d70[_0xd80e('0x19')]?_0x57d70[_0xd80e('0x19')]['limit']||null:null})[_0xd80e('0xc')](function(_0x1ad3bc){logger[_0xd80e('0xd')](_0xd80e('0x1c'),_0x57d70);logger[_0xd80e('0x21')](_0xd80e('0x1c'),_0x57d70,JSON[_0xd80e('0x11')](_0x1ad3bc));_0x5b0d6d(_0x1ad3bc);})[_0xd80e('0x16')](function(_0x5522dd){logger['error'](_0xd80e('0x1c'),_0x5522dd[_0xd80e('0x14')],_0x57d70);_0x635ce0(_0x170109[_0xd80e('0x12')](0x1f4,_0x5522dd[_0xd80e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 04b20d8..513c257 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 _0x5929=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path'];(function(_0x3de09b,_0x335158){var _0xfd3d1b=function(_0x3cfdbd){while(--_0x3cfdbd){_0x3de09b['push'](_0x3de09b['shift']());}};_0xfd3d1b(++_0x335158);}(_0x5929,0x6b));var _0x9592=function(_0x3b9f0e,_0x4808a0){_0x3b9f0e=_0x3b9f0e-0x0;var _0x334fba=_0x5929[_0x3b9f0e];return _0x334fba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9592('0x0'));var timeout=require(_0x9592('0x1'));var express=require(_0x9592('0x2'));var router=express[_0x9592('0x3')]();var fs_extra=require(_0x9592('0x4'));var auth=require(_0x9592('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9592('0x6'));var controller=require(_0x9592('0x7'));router[_0x9592('0x8')]('/',auth[_0x9592('0x9')](),controller['index']);router[_0x9592('0x8')](_0x9592('0xa'),auth[_0x9592('0x9')](),controller[_0x9592('0xb')]);router['get'](_0x9592('0xc'),auth[_0x9592('0x9')](),controller[_0x9592('0xd')]);router[_0x9592('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9592('0xf')](_0x9592('0xc'),auth[_0x9592('0x9')](),controller[_0x9592('0x10')]);router[_0x9592('0x11')](_0x9592('0xc'),auth[_0x9592('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4612=['isAuthenticated','describe','/:id','show','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0x4e844d,_0x4c13da){var _0x35c54b=function(_0x2d20be){while(--_0x2d20be){_0x4e844d['push'](_0x4e844d['shift']());}};_0x35c54b(++_0x4c13da);}(_0x4612,0x197));var _0x2461=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4612[_0x164eca];return _0x2ce562;};'use strict';var multer=require(_0x2461('0x0'));var util=require(_0x2461('0x1'));var path=require(_0x2461('0x2'));var timeout=require(_0x2461('0x3'));var express=require('express');var router=express[_0x2461('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2461('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2461('0x6'));var controller=require(_0x2461('0x7'));router[_0x2461('0x8')]('/',auth[_0x2461('0x9')](),controller['index']);router[_0x2461('0x8')]('/describe',auth[_0x2461('0x9')](),controller[_0x2461('0xa')]);router['get'](_0x2461('0xb'),auth[_0x2461('0x9')](),controller[_0x2461('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2461('0xd')]);router[_0x2461('0xe')](_0x2461('0xb'),auth[_0x2461('0x9')](),controller['destroy']);module[_0x2461('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 105ba62..f50228c 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(_0x57f989,_0xc1902a){var _0x1e10ef=function(_0x4a1d57){while(--_0x4a1d57){_0x57f989['push'](_0x57f989['shift']());}};_0x1e10ef(++_0xc1902a);}(_0xaa88,0x137));var _0x8aa8=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0xaa88[_0x31a37b];return _0x49ae16;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x208749,_0x2b7b66){var _0x3e0042=function(_0x32abb0){while(--_0x32abb0){_0x208749['push'](_0x208749['shift']());}};_0x3e0042(++_0x2b7b66);}(_0x54ef,0x112));var _0xf54e=function(_0x120581,_0x1d39c4){_0x120581=_0x120581-0x0;var _0xc145db=_0x54ef[_0x120581];return _0xc145db;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index c44d825..ae808cb 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 _0x82b8=['crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','rawAttributes','keys','length','includeAll','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x82b8,0xe1));var _0x882b=function(_0x42eb4a,_0x3abe1b){_0x42eb4a=_0x42eb4a-0x0;var _0x415377=_0x82b8[_0x42eb4a];return _0x415377;};'use strict';var emlformat=require(_0x882b('0x0'));var rimraf=require(_0x882b('0x1'));var zipdir=require(_0x882b('0x2'));var jsonpatch=require(_0x882b('0x3'));var rp=require('request-promise');var moment=require(_0x882b('0x4'));var BPromise=require(_0x882b('0x5'));var Mustache=require(_0x882b('0x6'));var util=require(_0x882b('0x7'));var path=require('path');var sox=require(_0x882b('0x8'));var csv=require('to-csv');var ejs=require(_0x882b('0x9'));var fs=require('fs');var fs_extra=require(_0x882b('0xa'));var _=require('lodash');var squel=require(_0x882b('0xb'));var crypto=require(_0x882b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x882b('0xd'));var querystring=require(_0x882b('0xe'));var Papa=require(_0x882b('0xf'));var Redis=require(_0x882b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x882b('0x11'));var as=require(_0x882b('0x12'));var hardwareService=require(_0x882b('0x13'));var logger=require(_0x882b('0x14'))(_0x882b('0x15'));var utils=require(_0x882b('0x16'));var config=require(_0x882b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x882b('0x18'))['db'];function respondWithStatusCode(_0x22cfa9,_0x2f40d8){_0x2f40d8=_0x2f40d8||0xcc;return function(_0x284616){if(_0x284616){return _0x22cfa9[_0x882b('0x19')](_0x2f40d8);}return _0x22cfa9[_0x882b('0x1a')](_0x2f40d8)[_0x882b('0x1b')]();};}function respondWithResult(_0x701c00,_0x260b90){_0x260b90=_0x260b90||0xc8;return function(_0x3c4d3a){if(_0x3c4d3a){return _0x701c00['status'](_0x260b90)[_0x882b('0x1c')](_0x3c4d3a);}};}function respondWithFilteredResult(_0x251bb9,_0x12f6ff){return function(_0x45e17f){if(_0x45e17f){var _0x17754d=typeof _0x12f6ff['offset']===_0x882b('0x1d')&&typeof _0x12f6ff['limit']===_0x882b('0x1d');var _0x34d242=_0x45e17f['count'];var _0x1b5ac0=_0x17754d?0x0:_0x12f6ff['offset'];var _0x25fabb=_0x17754d?_0x45e17f[_0x882b('0x1e')]:_0x12f6ff[_0x882b('0x1f')]+_0x12f6ff[_0x882b('0x20')];var _0x12249d;if(_0x25fabb>=_0x34d242){_0x25fabb=_0x34d242;_0x12249d=0xc8;}else{_0x12249d=0xce;}_0x251bb9['status'](_0x12249d);return _0x251bb9[_0x882b('0x21')](_0x882b('0x22'),_0x1b5ac0+'-'+_0x25fabb+'/'+_0x34d242)[_0x882b('0x1c')](_0x45e17f);}return null;};}function patchUpdates(_0x299e74){return function(_0x182b02){try{jsonpatch[_0x882b('0x23')](_0x182b02,_0x299e74,!![]);}catch(_0x5942b0){return BPromise[_0x882b('0x24')](_0x5942b0);}return _0x182b02[_0x882b('0x25')]();};}function saveUpdates(_0x5b797d,_0x41930c){return function(_0x34948f){if(_0x34948f){return _0x34948f[_0x882b('0x26')](_0x5b797d)['then'](function(_0x114ff6){return _0x114ff6;});}return null;};}function removeEntity(_0x40a7fb,_0x57fe65){return function(_0x4f778a){if(_0x4f778a){return _0x4f778a['destroy']()[_0x882b('0x27')](function(){_0x40a7fb[_0x882b('0x1a')](0xcc)[_0x882b('0x1b')]();});}};}function handleEntityNotFound(_0x2d51dc,_0x542981){return function(_0x299c12){if(!_0x299c12){_0x2d51dc[_0x882b('0x19')](0x194);}return _0x299c12;};}function handleError(_0x36dafc,_0x19fee8){_0x19fee8=_0x19fee8||0x1f4;return function(_0x2b4a98){logger[_0x882b('0x28')](_0x2b4a98[_0x882b('0x29')]);if(_0x2b4a98[_0x882b('0x2a')]){delete _0x2b4a98[_0x882b('0x2a')];}_0x36dafc[_0x882b('0x1a')](_0x19fee8)[_0x882b('0x2b')](_0x2b4a98);};}exports[_0x882b('0x2c')]=function(_0x5daad2,_0x1d0b85){var _0x2ce103={},_0x271f47={},_0x2b3939={'count':0x0,'rows':[]};var _0x9e3ed2=_[_0x882b('0x2d')](db[_0x882b('0x2e')]['rawAttributes'],function(_0x2a84cd){return{'name':_0x2a84cd[_0x882b('0x2f')],'type':_0x2a84cd[_0x882b('0x30')][_0x882b('0x31')]};});_0x271f47[_0x882b('0x32')]=_['map'](_0x9e3ed2,_0x882b('0x2a'));_0x271f47[_0x882b('0x33')]=_['keys'](_0x5daad2[_0x882b('0x33')]);_0x271f47[_0x882b('0x34')]=_[_0x882b('0x35')](_0x271f47[_0x882b('0x32')],_0x271f47[_0x882b('0x33')]);_0x2ce103['attributes']=_['intersection'](_0x271f47['model'],qs['fields'](_0x5daad2[_0x882b('0x33')][_0x882b('0x36')]));_0x2ce103['attributes']=_0x2ce103[_0x882b('0x37')]['length']?_0x2ce103[_0x882b('0x37')]:_0x271f47[_0x882b('0x32')];if(!_0x5daad2['query'][_0x882b('0x38')](_0x882b('0x39'))){_0x2ce103[_0x882b('0x20')]=qs['limit'](_0x5daad2['query'][_0x882b('0x20')]);_0x2ce103[_0x882b('0x1f')]=qs['offset'](_0x5daad2[_0x882b('0x33')][_0x882b('0x1f')]);}_0x2ce103[_0x882b('0x3a')]=qs[_0x882b('0x3b')](_0x5daad2[_0x882b('0x33')][_0x882b('0x3b')]);_0x2ce103[_0x882b('0x3c')]=qs[_0x882b('0x34')](_[_0x882b('0x3d')](_0x5daad2[_0x882b('0x33')],_0x271f47[_0x882b('0x34')]),_0x9e3ed2);if(_0x5daad2['query'][_0x882b('0x3e')]){_0x2ce103[_0x882b('0x3c')]=_[_0x882b('0x3f')](_0x2ce103['where'],{'$or':_['map'](_0x9e3ed2,function(_0x53aa18){if(_0x53aa18['type']!=='VIRTUAL'){var _0x22425a={};_0x22425a[_0x53aa18[_0x882b('0x2a')]]={'$like':'%'+_0x5daad2['query'][_0x882b('0x3e')]+'%'};return _0x22425a;}})});}_0x2ce103=_[_0x882b('0x3f')]({},_0x2ce103,_0x5daad2['options']);var _0x13bd31={'where':_0x2ce103[_0x882b('0x3c')]};return db[_0x882b('0x2e')][_0x882b('0x1e')](_0x13bd31)[_0x882b('0x27')](function(_0x3f0fcb){_0x2b3939['count']=_0x3f0fcb;if(_0x5daad2[_0x882b('0x33')]['includeAll']){_0x2ce103[_0x882b('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x882b('0x41')](_0x2ce103);})[_0x882b('0x27')](function(_0x1de616){_0x2b3939[_0x882b('0x42')]=_0x1de616;return _0x2b3939;})[_0x882b('0x27')](respondWithFilteredResult(_0x1d0b85,_0x2ce103))[_0x882b('0x43')](handleError(_0x1d0b85,null));};exports[_0x882b('0x44')]=function(_0x360ac0,_0x5c4d2c){var _0x43c38e={'raw':!![],'where':{'id':_0x360ac0[_0x882b('0x45')]['id']}},_0x52b69a={};_0x52b69a['model']=_['keys'](db['OpenchannelTransferReport'][_0x882b('0x46')]);_0x52b69a[_0x882b('0x33')]=_[_0x882b('0x47')](_0x360ac0['query']);_0x52b69a[_0x882b('0x34')]=_[_0x882b('0x35')](_0x52b69a[_0x882b('0x32')],_0x52b69a[_0x882b('0x33')]);_0x43c38e[_0x882b('0x37')]=_[_0x882b('0x35')](_0x52b69a[_0x882b('0x32')],qs['fields'](_0x360ac0[_0x882b('0x33')]['fields']));_0x43c38e[_0x882b('0x37')]=_0x43c38e[_0x882b('0x37')][_0x882b('0x48')]?_0x43c38e[_0x882b('0x37')]:_0x52b69a[_0x882b('0x32')];if(_0x360ac0[_0x882b('0x33')][_0x882b('0x49')]){_0x43c38e['include']=[{'all':!![]}];}_0x43c38e=_[_0x882b('0x3f')]({},_0x43c38e,_0x360ac0[_0x882b('0x4a')]);return db[_0x882b('0x2e')]['find'](_0x43c38e)[_0x882b('0x27')](handleEntityNotFound(_0x5c4d2c,null))['then'](respondWithResult(_0x5c4d2c,null))['catch'](handleError(_0x5c4d2c,null));};exports['create']=function(_0x4f4d06,_0x2c8d00){return db[_0x882b('0x2e')][_0x882b('0x4b')](_0x4f4d06[_0x882b('0x4c')],{})[_0x882b('0x27')](respondWithResult(_0x2c8d00,0xc9))[_0x882b('0x43')](handleError(_0x2c8d00,null));};exports[_0x882b('0x26')]=function(_0x40296b,_0x440c09){if(_0x40296b[_0x882b('0x4c')]['id']){delete _0x40296b[_0x882b('0x4c')]['id'];}return db['OpenchannelTransferReport'][_0x882b('0x4d')]({'where':{'id':_0x40296b[_0x882b('0x45')]['id']}})[_0x882b('0x27')](handleEntityNotFound(_0x440c09,null))['then'](saveUpdates(_0x40296b[_0x882b('0x4c')],null))[_0x882b('0x27')](respondWithResult(_0x440c09,null))[_0x882b('0x43')](handleError(_0x440c09,null));};exports[_0x882b('0x4e')]=function(_0x14aaca,_0x4c4399){return db[_0x882b('0x2e')][_0x882b('0x4d')]({'where':{'id':_0x14aaca[_0x882b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c4399,null))[_0x882b('0x27')](removeEntity(_0x4c4399,null))['catch'](handleError(_0x4c4399,null));};exports['describe']=function(_0x3eff95,_0x4ab04e){return db[_0x882b('0x2e')]['describe']()['then'](respondWithResult(_0x4ab04e,null))[_0x882b('0x43')](handleError(_0x4ab04e,null));}; \ No newline at end of file +var _0xf6e4=['map','OpenchannelTransferReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x13a528,_0x347d24){var _0x8b57a2=function(_0x17bca6){while(--_0x17bca6){_0x13a528['push'](_0x13a528['shift']());}};_0x8b57a2(++_0x347d24);}(_0xf6e4,0x1a1));var _0x4f6e=function(_0x425f9e,_0x475e53){_0x425f9e=_0x425f9e-0x0;var _0x17dc29=_0xf6e4[_0x425f9e];return _0x17dc29;};'use strict';var emlformat=require(_0x4f6e('0x0'));var rimraf=require(_0x4f6e('0x1'));var zipdir=require(_0x4f6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4f6e('0x3'));var Mustache=require(_0x4f6e('0x4'));var util=require(_0x4f6e('0x5'));var path=require(_0x4f6e('0x6'));var sox=require(_0x4f6e('0x7'));var csv=require(_0x4f6e('0x8'));var ejs=require(_0x4f6e('0x9'));var fs=require('fs');var fs_extra=require(_0x4f6e('0xa'));var _=require(_0x4f6e('0xb'));var squel=require('squel');var crypto=require(_0x4f6e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4f6e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4f6e('0xe'));var Papa=require(_0x4f6e('0xf'));var Redis=require(_0x4f6e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f6e('0x11'));var as=require(_0x4f6e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f6e('0x13'))(_0x4f6e('0x14'));var utils=require(_0x4f6e('0x15'));var config=require(_0x4f6e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f6e('0x17'))['db'];function respondWithStatusCode(_0x561fcd,_0x343727){_0x343727=_0x343727||0xcc;return function(_0x3d18ce){if(_0x3d18ce){return _0x561fcd[_0x4f6e('0x18')](_0x343727);}return _0x561fcd[_0x4f6e('0x19')](_0x343727)[_0x4f6e('0x1a')]();};}function respondWithResult(_0x37e759,_0x567dc0){_0x567dc0=_0x567dc0||0xc8;return function(_0x2bda77){if(_0x2bda77){return _0x37e759[_0x4f6e('0x19')](_0x567dc0)['json'](_0x2bda77);}};}function respondWithFilteredResult(_0x2ccbf9,_0x587dce){return function(_0x40bbf8){if(_0x40bbf8){var _0x549a8f=typeof _0x587dce[_0x4f6e('0x1b')]===_0x4f6e('0x1c')&&typeof _0x587dce[_0x4f6e('0x1d')]===_0x4f6e('0x1c');var _0x25dbfd=_0x40bbf8[_0x4f6e('0x1e')];var _0x5c8f2a=_0x549a8f?0x0:_0x587dce[_0x4f6e('0x1b')];var _0x590b8a=_0x549a8f?_0x40bbf8[_0x4f6e('0x1e')]:_0x587dce[_0x4f6e('0x1b')]+_0x587dce[_0x4f6e('0x1d')];var _0x5b14bb;if(_0x590b8a>=_0x25dbfd){_0x590b8a=_0x25dbfd;_0x5b14bb=0xc8;}else{_0x5b14bb=0xce;}_0x2ccbf9[_0x4f6e('0x19')](_0x5b14bb);return _0x2ccbf9[_0x4f6e('0x1f')](_0x4f6e('0x20'),_0x5c8f2a+'-'+_0x590b8a+'/'+_0x25dbfd)[_0x4f6e('0x21')](_0x40bbf8);}return null;};}function patchUpdates(_0xbf6ad1){return function(_0x4ff58a){try{jsonpatch[_0x4f6e('0x22')](_0x4ff58a,_0xbf6ad1,!![]);}catch(_0x424bc1){return BPromise[_0x4f6e('0x23')](_0x424bc1);}return _0x4ff58a[_0x4f6e('0x24')]();};}function saveUpdates(_0x3caae9,_0x367bf2){return function(_0x7f65d1){if(_0x7f65d1){return _0x7f65d1[_0x4f6e('0x25')](_0x3caae9)['then'](function(_0x424f22){return _0x424f22;});}return null;};}function removeEntity(_0x3b9db7,_0x59bf36){return function(_0x3cefa2){if(_0x3cefa2){return _0x3cefa2[_0x4f6e('0x26')]()[_0x4f6e('0x27')](function(){_0x3b9db7[_0x4f6e('0x19')](0xcc)[_0x4f6e('0x1a')]();});}};}function handleEntityNotFound(_0x1826cf,_0x3323f9){return function(_0x51b426){if(!_0x51b426){_0x1826cf[_0x4f6e('0x18')](0x194);}return _0x51b426;};}function handleError(_0x3766b4,_0x4b6d65){_0x4b6d65=_0x4b6d65||0x1f4;return function(_0x56dd08){logger[_0x4f6e('0x28')](_0x56dd08[_0x4f6e('0x29')]);if(_0x56dd08[_0x4f6e('0x2a')]){delete _0x56dd08[_0x4f6e('0x2a')];}_0x3766b4['status'](_0x4b6d65)[_0x4f6e('0x2b')](_0x56dd08);};}exports[_0x4f6e('0x2c')]=function(_0x3e0ec2,_0x1eeecd){var _0x2696e2={},_0x2e7086={},_0x2dfe16={'count':0x0,'rows':[]};var _0x596e71=_[_0x4f6e('0x2d')](db[_0x4f6e('0x2e')][_0x4f6e('0x2f')],function(_0x266c3c){return{'name':_0x266c3c['fieldName'],'type':_0x266c3c[_0x4f6e('0x30')][_0x4f6e('0x31')]};});_0x2e7086[_0x4f6e('0x32')]=_[_0x4f6e('0x2d')](_0x596e71,_0x4f6e('0x2a'));_0x2e7086[_0x4f6e('0x33')]=_['keys'](_0x3e0ec2[_0x4f6e('0x33')]);_0x2e7086['filters']=_[_0x4f6e('0x34')](_0x2e7086[_0x4f6e('0x32')],_0x2e7086[_0x4f6e('0x33')]);_0x2696e2['attributes']=_[_0x4f6e('0x34')](_0x2e7086[_0x4f6e('0x32')],qs[_0x4f6e('0x35')](_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x35')]));_0x2696e2[_0x4f6e('0x36')]=_0x2696e2[_0x4f6e('0x36')][_0x4f6e('0x37')]?_0x2696e2[_0x4f6e('0x36')]:_0x2e7086[_0x4f6e('0x32')];if(!_0x3e0ec2['query']['hasOwnProperty'](_0x4f6e('0x38'))){_0x2696e2['limit']=qs[_0x4f6e('0x1d')](_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x1d')]);_0x2696e2[_0x4f6e('0x1b')]=qs[_0x4f6e('0x1b')](_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x1b')]);}_0x2696e2[_0x4f6e('0x39')]=qs[_0x4f6e('0x3a')](_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x3a')]);_0x2696e2['where']=qs[_0x4f6e('0x3b')](_['pick'](_0x3e0ec2['query'],_0x2e7086[_0x4f6e('0x3b')]),_0x596e71);if(_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x3c')]){_0x2696e2[_0x4f6e('0x3d')]=_[_0x4f6e('0x3e')](_0x2696e2[_0x4f6e('0x3d')],{'$or':_['map'](_0x596e71,function(_0xbbe960){if(_0xbbe960[_0x4f6e('0x30')]!==_0x4f6e('0x3f')){var _0x19efba={};_0x19efba[_0xbbe960[_0x4f6e('0x2a')]]={'$like':'%'+_0x3e0ec2[_0x4f6e('0x33')][_0x4f6e('0x3c')]+'%'};return _0x19efba;}})});}_0x2696e2=_[_0x4f6e('0x3e')]({},_0x2696e2,_0x3e0ec2['options']);var _0x42d2c5={'where':_0x2696e2[_0x4f6e('0x3d')]};return db[_0x4f6e('0x2e')][_0x4f6e('0x1e')](_0x42d2c5)['then'](function(_0x15976b){_0x2dfe16[_0x4f6e('0x1e')]=_0x15976b;if(_0x3e0ec2['query'][_0x4f6e('0x40')]){_0x2696e2[_0x4f6e('0x41')]=[{'all':!![]}];}return db[_0x4f6e('0x2e')][_0x4f6e('0x42')](_0x2696e2);})[_0x4f6e('0x27')](function(_0x1981d6){_0x2dfe16[_0x4f6e('0x43')]=_0x1981d6;return _0x2dfe16;})[_0x4f6e('0x27')](respondWithFilteredResult(_0x1eeecd,_0x2696e2))[_0x4f6e('0x44')](handleError(_0x1eeecd,null));};exports[_0x4f6e('0x45')]=function(_0x22be57,_0x957f78){var _0x4ba022={'raw':!![],'where':{'id':_0x22be57['params']['id']}},_0x2b5bea={};_0x2b5bea[_0x4f6e('0x32')]=_[_0x4f6e('0x46')](db[_0x4f6e('0x2e')]['rawAttributes']);_0x2b5bea['query']=_[_0x4f6e('0x46')](_0x22be57['query']);_0x2b5bea['filters']=_[_0x4f6e('0x34')](_0x2b5bea['model'],_0x2b5bea[_0x4f6e('0x33')]);_0x4ba022[_0x4f6e('0x36')]=_[_0x4f6e('0x34')](_0x2b5bea[_0x4f6e('0x32')],qs[_0x4f6e('0x35')](_0x22be57[_0x4f6e('0x33')][_0x4f6e('0x35')]));_0x4ba022[_0x4f6e('0x36')]=_0x4ba022[_0x4f6e('0x36')][_0x4f6e('0x37')]?_0x4ba022['attributes']:_0x2b5bea[_0x4f6e('0x32')];if(_0x22be57[_0x4f6e('0x33')][_0x4f6e('0x40')]){_0x4ba022[_0x4f6e('0x41')]=[{'all':!![]}];}_0x4ba022=_[_0x4f6e('0x3e')]({},_0x4ba022,_0x22be57[_0x4f6e('0x47')]);return db['OpenchannelTransferReport'][_0x4f6e('0x48')](_0x4ba022)[_0x4f6e('0x27')](handleEntityNotFound(_0x957f78,null))[_0x4f6e('0x27')](respondWithResult(_0x957f78,null))[_0x4f6e('0x44')](handleError(_0x957f78,null));};exports[_0x4f6e('0x49')]=function(_0x341855,_0x103fcd){return db[_0x4f6e('0x2e')][_0x4f6e('0x49')](_0x341855[_0x4f6e('0x4a')],{})['then'](respondWithResult(_0x103fcd,0xc9))[_0x4f6e('0x44')](handleError(_0x103fcd,null));};exports['update']=function(_0x2b549d,_0x1090ab){if(_0x2b549d[_0x4f6e('0x4a')]['id']){delete _0x2b549d['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x2b549d[_0x4f6e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1090ab,null))[_0x4f6e('0x27')](saveUpdates(_0x2b549d['body'],null))[_0x4f6e('0x27')](respondWithResult(_0x1090ab,null))[_0x4f6e('0x44')](handleError(_0x1090ab,null));};exports[_0x4f6e('0x26')]=function(_0x282603,_0x123301){return db[_0x4f6e('0x2e')][_0x4f6e('0x48')]({'where':{'id':_0x282603[_0x4f6e('0x4b')]['id']}})[_0x4f6e('0x27')](handleEntityNotFound(_0x123301,null))[_0x4f6e('0x27')](removeEntity(_0x123301,null))[_0x4f6e('0x44')](handleError(_0x123301,null));};exports[_0x4f6e('0x4c')]=function(_0x44af8c,_0x5ce514){return db[_0x4f6e('0x2e')][_0x4f6e('0x4c')]()['then'](respondWithResult(_0x5ce514,null))[_0x4f6e('0x44')](handleError(_0x5ce514,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 9a1cdfa..3b82f71 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 _0x71f8=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x71f8,0x96));var _0x871f=function(_0x7917d5,_0x17feed){_0x7917d5=_0x7917d5-0x0;var _0xebfe51=_0x71f8[_0x7917d5];return _0xebfe51;};'use strict';var _=require(_0x871f('0x0'));var util=require(_0x871f('0x1'));var logger=require(_0x871f('0x2'))(_0x871f('0x3'));var moment=require(_0x871f('0x4'));var BPromise=require('bluebird');var rp=require(_0x871f('0x5'));var fs=require('fs');var path=require(_0x871f('0x6'));var rimraf=require(_0x871f('0x7'));var config=require(_0x871f('0x8'));var attributes=require(_0x871f('0x9'));module[_0x871f('0xa')]=function(_0x4968b9,_0x3be0d3){return _0x4968b9[_0x871f('0xb')](_0x871f('0xc'),attributes,{'tableName':_0x871f('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x871f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc33d=['api','moment','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xc33d,0x14e));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc33('0x0'));var util=require(_0xdc33('0x1'));var logger=require('../../config/logger')(_0xdc33('0x2'));var moment=require(_0xdc33('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc33('0x4'));var fs=require('fs');var path=require(_0xdc33('0x5'));var rimraf=require('rimraf');var config=require(_0xdc33('0x6'));var attributes=require(_0xdc33('0x7'));module['exports']=function(_0x1288d0,_0x5023af){return _0x1288d0[_0xdc33('0x8')](_0xdc33('0x9'),attributes,{'tableName':_0xdc33('0xa'),'paranoid':![],'indexes':[{'name':_0xdc33('0xb'),'fields':[_0xdc33('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 3e9ad2c..65278ab 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 _0x3248=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x22de40,_0x445eb0){var _0x42b57c=function(_0x4a4d1d){while(--_0x4a4d1d){_0x22de40['push'](_0x22de40['shift']());}};_0x42b57c(++_0x445eb0);}(_0x3248,0x1b0));var _0x8324=function(_0x437e73,_0xdd071){_0x437e73=_0x437e73-0x0;var _0x5be93b=_0x3248[_0x437e73];return _0x5be93b;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));var BPromise=require(_0x8324('0x3'));var rs=require(_0x8324('0x4'));var fs=require('fs');var Redis=require(_0x8324('0x5'));var db=require(_0x8324('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8324('0x7'));var config=require(_0x8324('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8324('0x9')][_0x8324('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446423,_0x2ad12f,_0x215c15){return new BPromise(function(_0x5d5f01,_0x300886){return client[_0x8324('0xb')](_0x446423,_0x215c15)[_0x8324('0xc')](function(_0x52b5f2){logger['info'](_0x8324('0xd'),_0x2ad12f,_0x8324('0xe'));logger[_0x8324('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2ad12f,_0x8324('0xe'),JSON[_0x8324('0x10')](_0x52b5f2));if(_0x52b5f2[_0x8324('0x11')]){if(_0x52b5f2[_0x8324('0x11')][_0x8324('0x12')]===0x1f4){logger[_0x8324('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ad12f,_0x52b5f2['error']['message']);return _0x300886(_0x52b5f2[_0x8324('0x11')]['message']);}logger['error'](_0x8324('0xd'),_0x2ad12f,_0x52b5f2[_0x8324('0x11')][_0x8324('0x13')]);return _0x5d5f01(_0x52b5f2['error'][_0x8324('0x13')]);}else{logger[_0x8324('0x14')](_0x8324('0xd'),_0x2ad12f,'request\x20sent');_0x5d5f01(_0x52b5f2[_0x8324('0x15')][_0x8324('0x13')]);}})[_0x8324('0x16')](function(_0x9cfe5){logger[_0x8324('0x11')](_0x8324('0xd'),_0x2ad12f,_0x9cfe5);_0x300886(_0x9cfe5);});});} \ No newline at end of file +var _0xbacd=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0xefc003,_0x578123){var _0x41ca1b=function(_0x2cb712){while(--_0x2cb712){_0xefc003['push'](_0xefc003['shift']());}};_0x41ca1b(++_0x578123);}(_0xbacd,0x1c5));var _0xdbac=function(_0x5a48f1,_0x1a7f3d){_0x5a48f1=_0x5a48f1-0x0;var _0x234a7f=_0xbacd[_0x5a48f1];return _0x234a7f;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var moment=require('moment');var BPromise=require(_0xdbac('0x2'));var rs=require(_0xdbac('0x3'));var fs=require('fs');var Redis=require(_0xdbac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbac('0x5'));var logger=require(_0xdbac('0x6'))(_0xdbac('0x7'));var config=require(_0xdbac('0x8'));var jayson=require(_0xdbac('0x9'));var client=jayson[_0xdbac('0xa')][_0xdbac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa5f9cf,_0xe7dcd6,_0x2f5331){return new BPromise(function(_0x30be11,_0x227cb1){return client[_0xdbac('0xc')](_0xa5f9cf,_0x2f5331)[_0xdbac('0xd')](function(_0x2f90c4){logger['info'](_0xdbac('0xe'),_0xe7dcd6,_0xdbac('0xf'));logger['debug'](_0xdbac('0x10'),_0xe7dcd6,'request\x20sent',JSON[_0xdbac('0x11')](_0x2f90c4));if(_0x2f90c4[_0xdbac('0x12')]){if(_0x2f90c4[_0xdbac('0x12')][_0xdbac('0x13')]===0x1f4){logger[_0xdbac('0x12')](_0xdbac('0xe'),_0xe7dcd6,_0x2f90c4[_0xdbac('0x12')][_0xdbac('0x14')]);return _0x227cb1(_0x2f90c4[_0xdbac('0x12')]['message']);}logger[_0xdbac('0x12')](_0xdbac('0xe'),_0xe7dcd6,_0x2f90c4[_0xdbac('0x12')][_0xdbac('0x14')]);return _0x30be11(_0x2f90c4[_0xdbac('0x12')][_0xdbac('0x14')]);}else{logger[_0xdbac('0x15')](_0xdbac('0xe'),_0xe7dcd6,'request\x20sent');_0x30be11(_0x2f90c4[_0xdbac('0x16')][_0xdbac('0x14')]);}})[_0xdbac('0x17')](function(_0x4a0d28){logger[_0xdbac('0x12')](_0xdbac('0xe'),_0xe7dcd6,_0x4a0d28);_0x227cb1(_0x4a0d28);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 624b035..58efa57 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 _0xb344=['isAuthenticated','post','create','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./pause.controller','get','index','/:id'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xb344,0x156));var _0x4b34=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0xb344[_0x2390bd];return _0x3a969d;};'use strict';var multer=require(_0x4b34('0x0'));var util=require(_0x4b34('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4b34('0x2'));var router=express[_0x4b34('0x3')]();var fs_extra=require(_0x4b34('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b34('0x5'));var config=require('../../config/environment');var controller=require(_0x4b34('0x6'));router[_0x4b34('0x7')]('/',auth['isAuthenticated'](),controller[_0x4b34('0x8')]);router[_0x4b34('0x7')](_0x4b34('0x9'),auth[_0x4b34('0xa')](),controller['show']);router[_0x4b34('0xb')]('/',auth['isAuthenticated'](),controller[_0x4b34('0xc')]);router['put'](_0x4b34('0x9'),auth[_0x4b34('0xa')](),controller['update']);router[_0x4b34('0xd')]('/:id',auth[_0x4b34('0xa')](),controller[_0x4b34('0xe')]);module[_0x4b34('0xf')]=router; \ No newline at end of file +var _0x4163=['create','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id'];(function(_0x25d6a1,_0x445520){var _0x100e75=function(_0x25ba64){while(--_0x25ba64){_0x25d6a1['push'](_0x25d6a1['shift']());}};_0x100e75(++_0x445520);}(_0x4163,0xee));var _0x3416=function(_0x566438,_0x3abb6a){_0x566438=_0x566438-0x0;var _0x2d8c26=_0x4163[_0x566438];return _0x2d8c26;};'use strict';var multer=require(_0x3416('0x0'));var util=require(_0x3416('0x1'));var path=require(_0x3416('0x2'));var timeout=require(_0x3416('0x3'));var express=require('express');var router=express[_0x3416('0x4')]();var fs_extra=require(_0x3416('0x5'));var auth=require(_0x3416('0x6'));var interaction=require(_0x3416('0x7'));var config=require(_0x3416('0x8'));var controller=require(_0x3416('0x9'));router['get']('/',auth[_0x3416('0xa')](),controller[_0x3416('0xb')]);router[_0x3416('0xc')](_0x3416('0xd'),auth[_0x3416('0xa')](),controller['show']);router['post']('/',auth[_0x3416('0xa')](),controller[_0x3416('0xe')]);router['put'](_0x3416('0xd'),auth[_0x3416('0xa')](),controller[_0x3416('0xf')]);router['delete'](_0x3416('0xd'),auth[_0x3416('0xa')](),controller[_0x3416('0x10')]);module[_0x3416('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 311383a..e7fe1bc 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 _0x8069=['exports','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8069,0x95));var _0x9806=function(_0x5db3a3,_0x22ea41){_0x5db3a3=_0x5db3a3-0x0;var _0x573e53=_0x8069[_0x5db3a3];return _0x573e53;};'use strict';var Sequelize=require(_0x9806('0x0'));module[_0x9806('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda2b=['exports','STRING','name','sequelize'];(function(_0x5d2117,_0x429aa6){var _0x2a9a3b=function(_0x1679ad){while(--_0x1679ad){_0x5d2117['push'](_0x5d2117['shift']());}};_0x2a9a3b(++_0x429aa6);}(_0xda2b,0x18f));var _0xbda2=function(_0x14bf66,_0x3e1066){_0x14bf66=_0x14bf66-0x0;var _0xaf4bf7=_0xda2b[_0x14bf66];return _0xaf4bf7;};'use strict';var Sequelize=require(_0xbda2('0x0'));module[_0xbda2('0x1')]={'name':{'type':Sequelize[_0xbda2('0x2')],'unique':_0xbda2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbda2('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9dc12f1..2dd1a55 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 _0xf59f=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2470eb,_0x193881){var _0x13bf0f=function(_0x1a2fc7){while(--_0x1a2fc7){_0x2470eb['push'](_0x2470eb['shift']());}};_0x13bf0f(++_0x193881);}(_0xf59f,0xf4));var _0xff59=function(_0x5754c7,_0x28591e){_0x5754c7=_0x5754c7-0x0;var _0xfbf156=_0xf59f[_0x5754c7];return _0xfbf156;};'use strict';var emlformat=require(_0xff59('0x0'));var rimraf=require(_0xff59('0x1'));var zipdir=require(_0xff59('0x2'));var jsonpatch=require(_0xff59('0x3'));var rp=require(_0xff59('0x4'));var moment=require(_0xff59('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xff59('0x6'));var util=require(_0xff59('0x7'));var path=require(_0xff59('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff59('0x9'));var _=require(_0xff59('0xa'));var squel=require(_0xff59('0xb'));var crypto=require(_0xff59('0xc'));var jsforce=require(_0xff59('0xd'));var deskjs=require(_0xff59('0xe'));var toCsv=require(_0xff59('0xf'));var querystring=require(_0xff59('0x10'));var Papa=require(_0xff59('0x11'));var Redis=require(_0xff59('0x12'));var authService=require(_0xff59('0x13'));var qs=require(_0xff59('0x14'));var as=require(_0xff59('0x15'));var hardwareService=require(_0xff59('0x16'));var logger=require('../../config/logger')(_0xff59('0x17'));var utils=require(_0xff59('0x18'));var config=require(_0xff59('0x19'));var licenseUtil=require(_0xff59('0x1a'));var db=require(_0xff59('0x1b'))['db'];function respondWithStatusCode(_0x4883b6,_0x1f88a7){_0x1f88a7=_0x1f88a7||0xcc;return function(_0x4f1cd6){if(_0x4f1cd6){return _0x4883b6[_0xff59('0x1c')](_0x1f88a7);}return _0x4883b6[_0xff59('0x1d')](_0x1f88a7)[_0xff59('0x1e')]();};}function respondWithResult(_0x59b033,_0x432a99){_0x432a99=_0x432a99||0xc8;return function(_0x2500fc){if(_0x2500fc){return _0x59b033[_0xff59('0x1d')](_0x432a99)['json'](_0x2500fc);}};}function respondWithFilteredResult(_0x2ec6d8,_0x4afd15){return function(_0x5d085b){if(_0x5d085b){var _0x48fc3a=typeof _0x4afd15[_0xff59('0x1f')]===_0xff59('0x20')&&typeof _0x4afd15[_0xff59('0x21')]===_0xff59('0x20');var _0x3216d3=_0x5d085b[_0xff59('0x22')];var _0x63cb17=_0x48fc3a?0x0:_0x4afd15['offset'];var _0x88c7a9=_0x48fc3a?_0x5d085b[_0xff59('0x22')]:_0x4afd15[_0xff59('0x1f')]+_0x4afd15[_0xff59('0x21')];var _0x10839b;if(_0x88c7a9>=_0x3216d3){_0x88c7a9=_0x3216d3;_0x10839b=0xc8;}else{_0x10839b=0xce;}_0x2ec6d8['status'](_0x10839b);return _0x2ec6d8[_0xff59('0x23')](_0xff59('0x24'),_0x63cb17+'-'+_0x88c7a9+'/'+_0x3216d3)['json'](_0x5d085b);}return null;};}function patchUpdates(_0x5567de){return function(_0x50d72c){try{jsonpatch[_0xff59('0x25')](_0x50d72c,_0x5567de,!![]);}catch(_0x21807c){return BPromise[_0xff59('0x26')](_0x21807c);}return _0x50d72c[_0xff59('0x27')]();};}function saveUpdates(_0x5a3911,_0x1de19f){return function(_0x1de1c7){if(_0x1de1c7){return _0x1de1c7[_0xff59('0x28')](_0x5a3911)['then'](function(_0x24914a){return _0x24914a;});}return null;};}function removeEntity(_0x49c49b,_0x1f10c9){return function(_0x5d17a4){if(_0x5d17a4){return _0x5d17a4[_0xff59('0x29')]()[_0xff59('0x2a')](function(){var _0x363b6e=_0x5d17a4[_0xff59('0x2b')]({'plain':!![]});var _0x2a67b9=_0xff59('0x2c');return db[_0xff59('0x2d')][_0xff59('0x29')]({'where':{'type':_0x2a67b9,'resourceId':_0x363b6e['id']}})[_0xff59('0x2a')](function(){return _0x5d17a4;});})[_0xff59('0x2a')](function(){_0x49c49b[_0xff59('0x1d')](0xcc)[_0xff59('0x1e')]();});}};}function handleEntityNotFound(_0x37d14a,_0x4f2e1a){return function(_0x3c66dc){if(!_0x3c66dc){_0x37d14a[_0xff59('0x1c')](0x194);}return _0x3c66dc;};}function handleError(_0x2a3fe3,_0x543404){_0x543404=_0x543404||0x1f4;return function(_0x4e9d1b){logger[_0xff59('0x2e')](_0x4e9d1b[_0xff59('0x2f')]);if(_0x4e9d1b[_0xff59('0x30')]){delete _0x4e9d1b[_0xff59('0x30')];}_0x2a3fe3[_0xff59('0x1d')](_0x543404)[_0xff59('0x31')](_0x4e9d1b);};}exports[_0xff59('0x32')]=function(_0x4c4011,_0x50b598){var _0x29575d={},_0xc8bd8a={},_0x36f5c7={'count':0x0,'rows':[]};var _0x361b77=_[_0xff59('0x33')](db[_0xff59('0x34')][_0xff59('0x35')],function(_0x26ab91){return{'name':_0x26ab91[_0xff59('0x36')],'type':_0x26ab91['type'][_0xff59('0x37')]};});_0xc8bd8a[_0xff59('0x38')]=_[_0xff59('0x33')](_0x361b77,'name');_0xc8bd8a[_0xff59('0x39')]=_['keys'](_0x4c4011[_0xff59('0x39')]);_0xc8bd8a['filters']=_[_0xff59('0x3a')](_0xc8bd8a[_0xff59('0x38')],_0xc8bd8a[_0xff59('0x39')]);_0x29575d[_0xff59('0x3b')]=_['intersection'](_0xc8bd8a[_0xff59('0x38')],qs['fields'](_0x4c4011[_0xff59('0x39')][_0xff59('0x3c')]));_0x29575d[_0xff59('0x3b')]=_0x29575d[_0xff59('0x3b')][_0xff59('0x3d')]?_0x29575d['attributes']:_0xc8bd8a['model'];if(!_0x4c4011['query']['hasOwnProperty'](_0xff59('0x3e'))){_0x29575d[_0xff59('0x21')]=qs[_0xff59('0x21')](_0x4c4011['query'][_0xff59('0x21')]);_0x29575d[_0xff59('0x1f')]=qs[_0xff59('0x1f')](_0x4c4011[_0xff59('0x39')]['offset']);}_0x29575d[_0xff59('0x3f')]=qs[_0xff59('0x40')](_0x4c4011['query'][_0xff59('0x40')]);_0x29575d[_0xff59('0x41')]=qs[_0xff59('0x42')](_['pick'](_0x4c4011[_0xff59('0x39')],_0xc8bd8a[_0xff59('0x42')]),_0x361b77);if(_0x4c4011[_0xff59('0x39')][_0xff59('0x43')]){_0x29575d[_0xff59('0x41')]=_[_0xff59('0x44')](_0x29575d[_0xff59('0x41')],{'$or':_[_0xff59('0x33')](_0x361b77,function(_0xe3496e){if(_0xe3496e[_0xff59('0x45')]!=='VIRTUAL'){var _0x3611eb={};_0x3611eb[_0xe3496e[_0xff59('0x30')]]={'$like':'%'+_0x4c4011[_0xff59('0x39')][_0xff59('0x43')]+'%'};return _0x3611eb;}})});}_0x29575d=_[_0xff59('0x44')]({},_0x29575d,_0x4c4011[_0xff59('0x46')]);var _0x48875d={'where':_0x29575d['where']};return db[_0xff59('0x34')][_0xff59('0x22')](_0x48875d)[_0xff59('0x2a')](function(_0x539c29){_0x36f5c7['count']=_0x539c29;if(_0x4c4011[_0xff59('0x39')][_0xff59('0x47')]){_0x29575d[_0xff59('0x48')]=[{'all':!![]}];}return db[_0xff59('0x34')][_0xff59('0x49')](_0x29575d);})[_0xff59('0x2a')](function(_0x4f4555){_0x36f5c7['rows']=_0x4f4555;return _0x36f5c7;})[_0xff59('0x2a')](respondWithFilteredResult(_0x50b598,_0x29575d))[_0xff59('0x4a')](handleError(_0x50b598,null));};exports[_0xff59('0x4b')]=function(_0x18e6c6,_0x3a334b){var _0x1406ce={'raw':!![],'where':{'id':_0x18e6c6[_0xff59('0x4c')]['id']}},_0x48bf16={};_0x48bf16[_0xff59('0x38')]=_[_0xff59('0x4d')](db[_0xff59('0x34')]['rawAttributes']);_0x48bf16[_0xff59('0x39')]=_[_0xff59('0x4d')](_0x18e6c6['query']);_0x48bf16[_0xff59('0x42')]=_[_0xff59('0x3a')](_0x48bf16[_0xff59('0x38')],_0x48bf16[_0xff59('0x39')]);_0x1406ce[_0xff59('0x3b')]=_[_0xff59('0x3a')](_0x48bf16['model'],qs['fields'](_0x18e6c6['query'][_0xff59('0x3c')]));_0x1406ce[_0xff59('0x3b')]=_0x1406ce[_0xff59('0x3b')][_0xff59('0x3d')]?_0x1406ce[_0xff59('0x3b')]:_0x48bf16[_0xff59('0x38')];if(_0x18e6c6[_0xff59('0x39')][_0xff59('0x47')]){_0x1406ce[_0xff59('0x48')]=[{'all':!![]}];}_0x1406ce=_[_0xff59('0x44')]({},_0x1406ce,_0x18e6c6[_0xff59('0x46')]);return db['Pause'][_0xff59('0x4e')](_0x1406ce)[_0xff59('0x2a')](handleEntityNotFound(_0x3a334b,null))[_0xff59('0x2a')](respondWithResult(_0x3a334b,null))['catch'](handleError(_0x3a334b,null));};exports[_0xff59('0x4f')]=function(_0x1c4df3,_0x43577e){return db[_0xff59('0x34')]['create'](_0x1c4df3[_0xff59('0x50')],{})[_0xff59('0x2a')](function(_0x59dda3){var _0x40d480=_0x1c4df3['user']['get']({'plain':!![]});if(!_0x40d480)throw new Error(_0xff59('0x51'));if(_0x40d480[_0xff59('0x52')]==='user'){var _0x417cf1=_0x59dda3[_0xff59('0x2b')]({'plain':!![]});var _0x530501=_0xff59('0x2c');return db[_0xff59('0x53')][_0xff59('0x4e')]({'where':{'name':_0x530501,'userProfileId':_0x40d480[_0xff59('0x54')]},'raw':!![]})['then'](function(_0x37bc17){if(_0x37bc17&&_0x37bc17[_0xff59('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x417cf1['name'],'resourceId':_0x417cf1['id'],'type':_0x37bc17[_0xff59('0x30')],'sectionId':_0x37bc17['id']},{})[_0xff59('0x2a')](function(){return _0x59dda3;});}else{return _0x59dda3;}})[_0xff59('0x4a')](function(_0x371480){logger[_0xff59('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371480);throw _0x371480;});}return _0x59dda3;})['then'](respondWithResult(_0x43577e,0xc9))[_0xff59('0x4a')](handleError(_0x43577e,null));};exports[_0xff59('0x28')]=function(_0x4e0e51,_0x25b80e){if(_0x4e0e51[_0xff59('0x50')]['id']){delete _0x4e0e51[_0xff59('0x50')]['id'];}return db[_0xff59('0x34')][_0xff59('0x4e')]({'where':{'id':_0x4e0e51['params']['id']}})[_0xff59('0x2a')](handleEntityNotFound(_0x25b80e,null))[_0xff59('0x2a')](saveUpdates(_0x4e0e51[_0xff59('0x50')],null))[_0xff59('0x2a')](respondWithResult(_0x25b80e,null))[_0xff59('0x4a')](handleError(_0x25b80e,null));};exports['destroy']=function(_0x50ea75,_0x36caf9){return db[_0xff59('0x34')][_0xff59('0x4e')]({'where':{'id':_0x50ea75[_0xff59('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36caf9,null))[_0xff59('0x2a')](removeEntity(_0x36caf9,null))[_0xff59('0x4a')](handleError(_0x36caf9,null));}; \ No newline at end of file +var _0xee24=['set','Content-Range','apply','reject','update','then','destroy','Pauses','UserProfileResource','name','send','index','map','Pause','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','count','limit'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xee24,0x197));var _0x4ee2=function(_0x34018f,_0x27a4ea){_0x34018f=_0x34018f-0x0;var _0x37c030=_0xee24[_0x34018f];return _0x37c030;};'use strict';var emlformat=require(_0x4ee2('0x0'));var rimraf=require(_0x4ee2('0x1'));var zipdir=require(_0x4ee2('0x2'));var jsonpatch=require(_0x4ee2('0x3'));var rp=require(_0x4ee2('0x4'));var moment=require(_0x4ee2('0x5'));var BPromise=require(_0x4ee2('0x6'));var Mustache=require(_0x4ee2('0x7'));var util=require(_0x4ee2('0x8'));var path=require(_0x4ee2('0x9'));var sox=require(_0x4ee2('0xa'));var csv=require(_0x4ee2('0xb'));var ejs=require(_0x4ee2('0xc'));var fs=require('fs');var fs_extra=require(_0x4ee2('0xd'));var _=require(_0x4ee2('0xe'));var squel=require('squel');var crypto=require(_0x4ee2('0xf'));var jsforce=require(_0x4ee2('0x10'));var deskjs=require(_0x4ee2('0x11'));var toCsv=require('to-csv');var querystring=require(_0x4ee2('0x12'));var Papa=require(_0x4ee2('0x13'));var Redis=require(_0x4ee2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4ee2('0x15'));var as=require(_0x4ee2('0x16'));var hardwareService=require(_0x4ee2('0x17'));var logger=require(_0x4ee2('0x18'))(_0x4ee2('0x19'));var utils=require(_0x4ee2('0x1a'));var config=require(_0x4ee2('0x1b'));var licenseUtil=require(_0x4ee2('0x1c'));var db=require(_0x4ee2('0x1d'))['db'];function respondWithStatusCode(_0x20dbf5,_0x376903){_0x376903=_0x376903||0xcc;return function(_0x2d659c){if(_0x2d659c){return _0x20dbf5[_0x4ee2('0x1e')](_0x376903);}return _0x20dbf5[_0x4ee2('0x1f')](_0x376903)[_0x4ee2('0x20')]();};}function respondWithResult(_0x828c47,_0x402d9f){_0x402d9f=_0x402d9f||0xc8;return function(_0xf2d7d9){if(_0xf2d7d9){return _0x828c47[_0x4ee2('0x1f')](_0x402d9f)[_0x4ee2('0x21')](_0xf2d7d9);}};}function respondWithFilteredResult(_0x5ed666,_0xe47e28){return function(_0x2b1f15){if(_0x2b1f15){var _0x398693=typeof _0xe47e28[_0x4ee2('0x22')]==='undefined'&&typeof _0xe47e28['limit']===_0x4ee2('0x23');var _0x2a0408=_0x2b1f15[_0x4ee2('0x24')];var _0x102cf6=_0x398693?0x0:_0xe47e28[_0x4ee2('0x22')];var _0x8481b0=_0x398693?_0x2b1f15[_0x4ee2('0x24')]:_0xe47e28[_0x4ee2('0x22')]+_0xe47e28[_0x4ee2('0x25')];var _0x1c3c32;if(_0x8481b0>=_0x2a0408){_0x8481b0=_0x2a0408;_0x1c3c32=0xc8;}else{_0x1c3c32=0xce;}_0x5ed666['status'](_0x1c3c32);return _0x5ed666[_0x4ee2('0x26')](_0x4ee2('0x27'),_0x102cf6+'-'+_0x8481b0+'/'+_0x2a0408)[_0x4ee2('0x21')](_0x2b1f15);}return null;};}function patchUpdates(_0x4b3e78){return function(_0x42d913){try{jsonpatch[_0x4ee2('0x28')](_0x42d913,_0x4b3e78,!![]);}catch(_0x3ffaed){return BPromise[_0x4ee2('0x29')](_0x3ffaed);}return _0x42d913['save']();};}function saveUpdates(_0x21def2,_0x2caf5b){return function(_0x10f74f){if(_0x10f74f){return _0x10f74f[_0x4ee2('0x2a')](_0x21def2)[_0x4ee2('0x2b')](function(_0x16aaae){return _0x16aaae;});}return null;};}function removeEntity(_0x274c83,_0x45487a){return function(_0x5802c2){if(_0x5802c2){return _0x5802c2[_0x4ee2('0x2c')]()[_0x4ee2('0x2b')](function(){var _0x4d6fe3=_0x5802c2['get']({'plain':!![]});var _0x2770d2=_0x4ee2('0x2d');return db[_0x4ee2('0x2e')][_0x4ee2('0x2c')]({'where':{'type':_0x2770d2,'resourceId':_0x4d6fe3['id']}})['then'](function(){return _0x5802c2;});})[_0x4ee2('0x2b')](function(){_0x274c83[_0x4ee2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b95c5,_0x1c23f3){return function(_0x16ac6c){if(!_0x16ac6c){_0x1b95c5['sendStatus'](0x194);}return _0x16ac6c;};}function handleError(_0x43052f,_0x3771e3){_0x3771e3=_0x3771e3||0x1f4;return function(_0x2274c1){logger['error'](_0x2274c1['stack']);if(_0x2274c1[_0x4ee2('0x2f')]){delete _0x2274c1[_0x4ee2('0x2f')];}_0x43052f[_0x4ee2('0x1f')](_0x3771e3)[_0x4ee2('0x30')](_0x2274c1);};}exports[_0x4ee2('0x31')]=function(_0x43aed6,_0x15ef61){var _0x28b327={},_0x55849a={},_0x16449a={'count':0x0,'rows':[]};var _0x348836=_[_0x4ee2('0x32')](db[_0x4ee2('0x33')][_0x4ee2('0x34')],function(_0x2d7fb1){return{'name':_0x2d7fb1['fieldName'],'type':_0x2d7fb1[_0x4ee2('0x35')][_0x4ee2('0x36')]};});_0x55849a[_0x4ee2('0x37')]=_[_0x4ee2('0x32')](_0x348836,_0x4ee2('0x2f'));_0x55849a[_0x4ee2('0x38')]=_['keys'](_0x43aed6['query']);_0x55849a[_0x4ee2('0x39')]=_[_0x4ee2('0x3a')](_0x55849a['model'],_0x55849a[_0x4ee2('0x38')]);_0x28b327[_0x4ee2('0x3b')]=_['intersection'](_0x55849a['model'],qs[_0x4ee2('0x3c')](_0x43aed6[_0x4ee2('0x38')]['fields']));_0x28b327[_0x4ee2('0x3b')]=_0x28b327[_0x4ee2('0x3b')][_0x4ee2('0x3d')]?_0x28b327[_0x4ee2('0x3b')]:_0x55849a[_0x4ee2('0x37')];if(!_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x3e')](_0x4ee2('0x3f'))){_0x28b327['limit']=qs[_0x4ee2('0x25')](_0x43aed6[_0x4ee2('0x38')]['limit']);_0x28b327['offset']=qs[_0x4ee2('0x22')](_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x22')]);}_0x28b327[_0x4ee2('0x40')]=qs[_0x4ee2('0x41')](_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x41')]);_0x28b327['where']=qs[_0x4ee2('0x39')](_[_0x4ee2('0x42')](_0x43aed6[_0x4ee2('0x38')],_0x55849a[_0x4ee2('0x39')]),_0x348836);if(_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x43')]){_0x28b327['where']=_[_0x4ee2('0x44')](_0x28b327[_0x4ee2('0x45')],{'$or':_[_0x4ee2('0x32')](_0x348836,function(_0x36f246){if(_0x36f246[_0x4ee2('0x35')]!==_0x4ee2('0x46')){var _0x57f1b1={};_0x57f1b1[_0x36f246[_0x4ee2('0x2f')]]={'$like':'%'+_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x43')]+'%'};return _0x57f1b1;}})});}_0x28b327=_['merge']({},_0x28b327,_0x43aed6['options']);var _0x103a00={'where':_0x28b327[_0x4ee2('0x45')]};return db[_0x4ee2('0x33')][_0x4ee2('0x24')](_0x103a00)[_0x4ee2('0x2b')](function(_0x1ce271){_0x16449a['count']=_0x1ce271;if(_0x43aed6[_0x4ee2('0x38')][_0x4ee2('0x47')]){_0x28b327[_0x4ee2('0x48')]=[{'all':!![]}];}return db[_0x4ee2('0x33')][_0x4ee2('0x49')](_0x28b327);})[_0x4ee2('0x2b')](function(_0x47bb48){_0x16449a[_0x4ee2('0x4a')]=_0x47bb48;return _0x16449a;})[_0x4ee2('0x2b')](respondWithFilteredResult(_0x15ef61,_0x28b327))['catch'](handleError(_0x15ef61,null));};exports['show']=function(_0x3178d2,_0x3025c1){var _0x3d4d1d={'raw':!![],'where':{'id':_0x3178d2[_0x4ee2('0x4b')]['id']}},_0x30edbd={};_0x30edbd['model']=_[_0x4ee2('0x4c')](db[_0x4ee2('0x33')]['rawAttributes']);_0x30edbd[_0x4ee2('0x38')]=_[_0x4ee2('0x4c')](_0x3178d2[_0x4ee2('0x38')]);_0x30edbd[_0x4ee2('0x39')]=_[_0x4ee2('0x3a')](_0x30edbd[_0x4ee2('0x37')],_0x30edbd['query']);_0x3d4d1d['attributes']=_[_0x4ee2('0x3a')](_0x30edbd['model'],qs['fields'](_0x3178d2['query'][_0x4ee2('0x3c')]));_0x3d4d1d[_0x4ee2('0x3b')]=_0x3d4d1d[_0x4ee2('0x3b')][_0x4ee2('0x3d')]?_0x3d4d1d[_0x4ee2('0x3b')]:_0x30edbd[_0x4ee2('0x37')];if(_0x3178d2['query'][_0x4ee2('0x47')]){_0x3d4d1d[_0x4ee2('0x48')]=[{'all':!![]}];}_0x3d4d1d=_[_0x4ee2('0x44')]({},_0x3d4d1d,_0x3178d2['options']);return db[_0x4ee2('0x33')][_0x4ee2('0x4d')](_0x3d4d1d)[_0x4ee2('0x2b')](handleEntityNotFound(_0x3025c1,null))[_0x4ee2('0x2b')](respondWithResult(_0x3025c1,null))[_0x4ee2('0x4e')](handleError(_0x3025c1,null));};exports['create']=function(_0x599335,_0x282d49){return db['Pause'][_0x4ee2('0x4f')](_0x599335[_0x4ee2('0x50')],{})[_0x4ee2('0x2b')](function(_0x220680){var _0x5d5faf=_0x599335[_0x4ee2('0x51')]['get']({'plain':!![]});if(!_0x5d5faf)throw new Error(_0x4ee2('0x52'));if(_0x5d5faf[_0x4ee2('0x53')]===_0x4ee2('0x51')){var _0x274c95=_0x220680[_0x4ee2('0x54')]({'plain':!![]});var _0x80cd57=_0x4ee2('0x2d');return db['UserProfileSection'][_0x4ee2('0x4d')]({'where':{'name':_0x80cd57,'userProfileId':_0x5d5faf[_0x4ee2('0x55')]},'raw':!![]})[_0x4ee2('0x2b')](function(_0x223da5){if(_0x223da5&&_0x223da5[_0x4ee2('0x56')]===0x0){return db[_0x4ee2('0x2e')][_0x4ee2('0x4f')]({'name':_0x274c95[_0x4ee2('0x2f')],'resourceId':_0x274c95['id'],'type':_0x223da5[_0x4ee2('0x2f')],'sectionId':_0x223da5['id']},{})['then'](function(){return _0x220680;});}else{return _0x220680;}})[_0x4ee2('0x4e')](function(_0x29e79a){logger[_0x4ee2('0x57')](_0x4ee2('0x58'),_0x29e79a);throw _0x29e79a;});}return _0x220680;})[_0x4ee2('0x2b')](respondWithResult(_0x282d49,0xc9))[_0x4ee2('0x4e')](handleError(_0x282d49,null));};exports['update']=function(_0x4980cc,_0x1a9d43){if(_0x4980cc['body']['id']){delete _0x4980cc[_0x4ee2('0x50')]['id'];}return db['Pause'][_0x4ee2('0x4d')]({'where':{'id':_0x4980cc['params']['id']}})[_0x4ee2('0x2b')](handleEntityNotFound(_0x1a9d43,null))[_0x4ee2('0x2b')](saveUpdates(_0x4980cc[_0x4ee2('0x50')],null))[_0x4ee2('0x2b')](respondWithResult(_0x1a9d43,null))[_0x4ee2('0x4e')](handleError(_0x1a9d43,null));};exports['destroy']=function(_0x2c7256,_0x22bdad){return db[_0x4ee2('0x33')][_0x4ee2('0x4d')]({'where':{'id':_0x2c7256[_0x4ee2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22bdad,null))[_0x4ee2('0x2b')](removeEntity(_0x22bdad,null))['catch'](handleError(_0x22bdad,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 57748d9..6a9c346 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x40f3e6,_0x177028){var _0x49f0f0=function(_0x46df72){while(--_0x46df72){_0x40f3e6['push'](_0x40f3e6['shift']());}};_0x49f0f0(++_0x177028);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58b382,_0x5e4e20){_0x58b382=_0x58b382-0x0;var _0x2ed024=_0x8ef6[_0x58b382];return _0x2ed024;};'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 +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x34644a,_0x3e97c6){var _0x3a153f=function(_0x484d7d){while(--_0x484d7d){_0x34644a['push'](_0x34644a['shift']());}};_0x3a153f(++_0x3e97c6);}(_0x8ef6,0xf2));var _0x68ef=function(_0x311dd6,_0x479ff9){_0x311dd6=_0x311dd6-0x0;var _0x4fa1f5=_0x8ef6[_0x311dd6];return _0x4fa1f5;};'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 2b0cc74..d9747ae 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x177969,_0x3fe6f8){var _0x3dadd3=function(_0x3096f6){while(--_0x3096f6){_0x177969['push'](_0x177969['shift']());}};_0x3dadd3(++_0x3fe6f8);}(_0x7a54,0x106));var _0x47a5=function(_0x435b0b,_0x6b6430){_0x435b0b=_0x435b0b-0x0;var _0x1e4475=_0x7a54[_0x435b0b];return _0x1e4475;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x10634e,_0x138d81){var _0x4ae329=function(_0x5a9cb5){while(--_0x5a9cb5){_0x10634e['push'](_0x10634e['shift']());}};_0x4ae329(++_0x138d81);}(_0x7a54,0x106));var _0x47a5=function(_0x4daaee,_0x655b92){_0x4daaee=_0x4daaee-0x0;var _0xa0f147=_0x7a54[_0x4daaee];return _0xa0f147;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6eab58e..62b1d52 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 _0x4b84=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/webhook','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','upload','webhookPost','/:id','isAuthenticated','delete'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x4b84[_0x4605dc];return _0x5d3e81;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),controller['webhookGet']);router[_0x44b8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0x8')](_0x44b8('0xa'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);var upload=multer({'storage':multer[_0x44b8('0xc')]({'destination':function(_0x4315f6,_0x9b6048,_0x24dd10){_0x24dd10(null,path[_0x44b8('0xd')](config[_0x44b8('0xe')],'server/files/plugins'));},'filename':function(_0x147529,_0x4301a6,_0x4bcc43){_0x4301a6[_0x44b8('0xf')]=_0x4301a6['originalname'][_0x44b8('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcc43(null,util[_0x44b8('0x11')]('%s-%s%s',path[_0x44b8('0x12')](_0x4301a6['originalname'],path['extname'](_0x4301a6[_0x44b8('0xf')])),Date[_0x44b8('0x13')](),path[_0x44b8('0x14')](_0x4301a6[_0x44b8('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x44b8('0x15')]);router['post'](_0x44b8('0x7'),controller[_0x44b8('0x16')]);router['put'](_0x44b8('0x17'),auth[_0x44b8('0x18')](),controller['update']);router[_0x44b8('0x19')](_0x44b8('0x17'),auth['isAuthenticated'](),controller[_0x44b8('0x19')]);module[_0x44b8('0x1a')]=router; \ No newline at end of file +var _0x008c=['/:id','/:id/download','join','root','server/files/plugins','originalname','format','basename','extname','now','single','file','upload','post','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet'];(function(_0x23af01,_0xd7ef42){var _0x485dfc=function(_0x345dd4){while(--_0x345dd4){_0x23af01['push'](_0x23af01['shift']());}};_0x485dfc(++_0xd7ef42);}(_0x008c,0x188));var _0xc008=function(_0x30791a,_0x4db565){_0x30791a=_0x30791a-0x0;var _0x5393e6=_0x008c[_0x30791a];return _0x5393e6;};'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')]('/webhook',controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xa')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eacfa,_0xc881aa,_0x5b2004){_0x5b2004(null,path[_0xc008('0x10')](config[_0xc008('0x11')],_0xc008('0x12')));},'filename':function(_0x2a5b4e,_0x9ffa93,_0x1819c6){_0x9ffa93[_0xc008('0x13')]=_0x9ffa93['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1819c6(null,util[_0xc008('0x14')]('%s-%s%s',path[_0xc008('0x15')](_0x9ffa93[_0xc008('0x13')],path[_0xc008('0x16')](_0x9ffa93[_0xc008('0x13')])),Date[_0xc008('0x17')](),path['extname'](_0x9ffa93['originalname'])));}})});router['post']('/',upload[_0xc008('0x18')](_0xc008('0x19')),controller[_0xc008('0x1a')]);router[_0xc008('0x1b')]('/webhook',controller['webhookPost']);router['put']('/:id',auth[_0xc008('0xb')](),controller[_0xc008('0x1c')]);router['delete'](_0xc008('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3bbc27b..e80f213 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 _0x48c7=['STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x4c11d1,_0x30aef1){var _0xa4b5bc=function(_0x20a137){while(--_0x20a137){_0x4c11d1['push'](_0x4c11d1['shift']());}};_0xa4b5bc(++_0x30aef1);}(_0x48c7,0x66));var _0x748c=function(_0x245505,_0x2cfe7b){_0x245505=_0x245505-0x0;var _0x424bcb=_0x48c7[_0x245505];return _0x424bcb;};'use strict';var Sequelize=require(_0x748c('0x0'));module[_0x748c('0x1')]={'name':{'type':Sequelize[_0x748c('0x2')]},'type':{'type':Sequelize[_0x748c('0x3')](_0x748c('0x4'),'script')},'description':{'type':Sequelize[_0x748c('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x748c('0x2')],'comment':_0x748c('0x6')},'active':{'type':Sequelize[_0x748c('0x7')],'defaultValue':0x0,'comment':_0x748c('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x748c('0x9'),_0x748c('0xa'),_0x748c('0xb'),'never'),'defaultValue':_0x748c('0xb'),'comment':_0x748c('0xc')},'icon':{'type':Sequelize[_0x748c('0x2')]},'adminUrl':{'type':Sequelize[_0x748c('0x2')]},'agentUrl':{'type':Sequelize[_0x748c('0x2')]},'scriptName':{'type':Sequelize[_0x748c('0x2')]},'scriptPath':{'type':Sequelize[_0x748c('0x2')]}}; \ No newline at end of file +var _0xd3eb=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x3b2b0b,_0x37a05c){var _0x493fad=function(_0x5d4d05){while(--_0x5d4d05){_0x3b2b0b['push'](_0x3b2b0b['shift']());}};_0x493fad(++_0x37a05c);}(_0xd3eb,0x1f1));var _0xbd3e=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xd3eb[_0x3e6b2f];return _0x323215;};'use strict';var Sequelize=require('sequelize');module[_0xbd3e('0x0')]={'name':{'type':Sequelize[_0xbd3e('0x1')]},'type':{'type':Sequelize[_0xbd3e('0x2')](_0xbd3e('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xbd3e('0x4')]},'path':{'type':Sequelize[_0xbd3e('0x1')],'comment':_0xbd3e('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbd3e('0x6')},'sidebar':{'type':Sequelize[_0xbd3e('0x2')](_0xbd3e('0x7'),_0xbd3e('0x8'),_0xbd3e('0x9'),_0xbd3e('0xa')),'defaultValue':_0xbd3e('0x9'),'comment':_0xbd3e('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xbd3e('0x1')]},'scriptName':{'type':Sequelize[_0xbd3e('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 314c092..cd38f82 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 _0x7885=['where','filter','merge','map','VIRTUAL','includeAll','include','Plugin','findAll','rows','catch','show','params','keys','rawAttributes','options','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','attachments/**/*','finalize','close','existsSync','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','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','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-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','webhookGet','hostname','port','http://localhost:','encoding','headers','content-length','content-type','set','endsWith','statusCode','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','extract-zip','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','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','get','Plugins','UserProfileResource','then','error','stack','name','send','index','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x31d833,_0x9590c2){var _0x2927a2=function(_0x29b17a){while(--_0x29b17a){_0x31d833['push'](_0x31d833['shift']());}};_0x2927a2(++_0x9590c2);}(_0x7885,0x113));var _0x5788=function(_0x474f1b,_0x4a5d60){_0x474f1b=_0x474f1b-0x0;var _0x4a7461=_0x7885[_0x474f1b];return _0x4a7461;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5788('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5788('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5788('0x2'));var Mustache=require(_0x5788('0x3'));var util=require(_0x5788('0x4'));var path=require(_0x5788('0x5'));var sox=require(_0x5788('0x6'));var csv=require('to-csv');var ejs=require(_0x5788('0x7'));var fs=require('fs');var fs_extra=require(_0x5788('0x8'));var _=require(_0x5788('0x9'));var squel=require(_0x5788('0xa'));var crypto=require(_0x5788('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5788('0xc'));var querystring=require(_0x5788('0xd'));var Papa=require(_0x5788('0xe'));var extract=require(_0x5788('0xf'));var rimraf=require(_0x5788('0x0'));var archiver=require('archiver');var Redis=require(_0x5788('0x10'));var authService=require(_0x5788('0x11'));var qs=require(_0x5788('0x12'));var as=require(_0x5788('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5788('0x14'))(_0x5788('0x15'));var utils=require(_0x5788('0x16'));var config=require(_0x5788('0x17'));var licenseUtil=require(_0x5788('0x18'));var db=require('../../mysqldb')['db'];config[_0x5788('0x19')]=_[_0x5788('0x1a')](config['redis'],{'host':_0x5788('0x1b'),'port':0x18eb});var socket=require(_0x5788('0x1c'))(new Redis(config[_0x5788('0x19')]));require(_0x5788('0x1d'))[_0x5788('0x1e')](socket);function respondWithStatusCode(_0x5747ef,_0x56a34){_0x56a34=_0x56a34||0xcc;return function(_0xe2b2d0){if(_0xe2b2d0){return _0x5747ef[_0x5788('0x1f')](_0x56a34);}return _0x5747ef['status'](_0x56a34)[_0x5788('0x20')]();};}function respondWithResult(_0x287947,_0x2379a5){_0x2379a5=_0x2379a5||0xc8;return function(_0x311325){if(_0x311325){return _0x287947[_0x5788('0x21')](_0x2379a5)[_0x5788('0x22')](_0x311325);}};}function respondWithFilteredResult(_0x138201,_0x4de9c9){return function(_0x583197){if(_0x583197){var _0x13e84b=typeof _0x4de9c9[_0x5788('0x23')]===_0x5788('0x24')&&typeof _0x4de9c9[_0x5788('0x25')]===_0x5788('0x24');var _0x4a7e01=_0x583197[_0x5788('0x26')];var _0x3b08f8=_0x13e84b?0x0:_0x4de9c9[_0x5788('0x23')];var _0x51a3d0=_0x13e84b?_0x583197['count']:_0x4de9c9[_0x5788('0x23')]+_0x4de9c9[_0x5788('0x25')];var _0x3893b2;if(_0x51a3d0>=_0x4a7e01){_0x51a3d0=_0x4a7e01;_0x3893b2=0xc8;}else{_0x3893b2=0xce;}_0x138201[_0x5788('0x21')](_0x3893b2);return _0x138201['set'](_0x5788('0x27'),_0x3b08f8+'-'+_0x51a3d0+'/'+_0x4a7e01)[_0x5788('0x22')](_0x583197);}return null;};}function patchUpdates(_0x1e6350){return function(_0x5dced3){try{jsonpatch['apply'](_0x5dced3,_0x1e6350,!![]);}catch(_0x13f6ad){return BPromise[_0x5788('0x28')](_0x13f6ad);}return _0x5dced3['save']();};}function saveUpdates(_0x1a55bc,_0x48392e){return function(_0x57acf1){if(_0x57acf1){return _0x57acf1[_0x5788('0x29')](_0x1a55bc)['then'](function(_0x2aca65){return _0x2aca65;});}return null;};}function removeEntity(_0x13e2be,_0x30e88f){return function(_0x3b33f0){if(_0x3b33f0){return _0x3b33f0[_0x5788('0x2a')]()['then'](function(){var _0x50c14b=_0x3b33f0[_0x5788('0x2b')]({'plain':!![]});var _0xad0eec=_0x5788('0x2c');return db[_0x5788('0x2d')][_0x5788('0x2a')]({'where':{'type':_0xad0eec,'resourceId':_0x50c14b['id']}})[_0x5788('0x2e')](function(){return _0x3b33f0;});})['then'](function(){_0x13e2be[_0x5788('0x21')](0xcc)[_0x5788('0x20')]();});}};}function handleEntityNotFound(_0x308f6d,_0xc1b07a){return function(_0xb74a8b){if(!_0xb74a8b){_0x308f6d[_0x5788('0x1f')](0x194);}return _0xb74a8b;};}function handleError(_0x409601,_0x48c091){_0x48c091=_0x48c091||0x1f4;return function(_0xe1425b){logger[_0x5788('0x2f')](_0xe1425b[_0x5788('0x30')]);if(_0xe1425b[_0x5788('0x31')]){delete _0xe1425b[_0x5788('0x31')];}_0x409601[_0x5788('0x21')](_0x48c091)[_0x5788('0x32')](_0xe1425b);};}exports[_0x5788('0x33')]=function(_0x703ec1,_0x411d69){var _0x53d465={},_0x199b26={},_0x15584b={'count':0x0,'rows':[]};var _0x2b0f4e=_['map'](db['Plugin']['rawAttributes'],function(_0x109d7c){return{'name':_0x109d7c[_0x5788('0x34')],'type':_0x109d7c[_0x5788('0x35')]['key']};});_0x199b26['model']=_['map'](_0x2b0f4e,_0x5788('0x31'));_0x199b26[_0x5788('0x36')]=_['keys'](_0x703ec1[_0x5788('0x36')]);_0x199b26[_0x5788('0x37')]=_[_0x5788('0x38')](_0x199b26[_0x5788('0x39')],_0x199b26['query']);_0x53d465[_0x5788('0x3a')]=_[_0x5788('0x38')](_0x199b26[_0x5788('0x39')],qs[_0x5788('0x3b')](_0x703ec1[_0x5788('0x36')][_0x5788('0x3b')]));_0x53d465['attributes']=_0x53d465[_0x5788('0x3a')][_0x5788('0x3c')]?_0x53d465[_0x5788('0x3a')]:_0x199b26[_0x5788('0x39')];if(!_0x703ec1[_0x5788('0x36')][_0x5788('0x3d')](_0x5788('0x3e'))){_0x53d465['limit']=qs[_0x5788('0x25')](_0x703ec1[_0x5788('0x36')]['limit']);_0x53d465[_0x5788('0x23')]=qs[_0x5788('0x23')](_0x703ec1['query'][_0x5788('0x23')]);}_0x53d465[_0x5788('0x3f')]=qs[_0x5788('0x40')](_0x703ec1[_0x5788('0x36')][_0x5788('0x40')]);_0x53d465[_0x5788('0x41')]=qs[_0x5788('0x37')](_['pick'](_0x703ec1[_0x5788('0x36')],_0x199b26[_0x5788('0x37')]),_0x2b0f4e);if(_0x703ec1[_0x5788('0x36')][_0x5788('0x42')]){_0x53d465['where']=_[_0x5788('0x43')](_0x53d465['where'],{'$or':_[_0x5788('0x44')](_0x2b0f4e,function(_0x4f018c){if(_0x4f018c[_0x5788('0x35')]!==_0x5788('0x45')){var _0x5d3f9f={};_0x5d3f9f[_0x4f018c[_0x5788('0x31')]]={'$like':'%'+_0x703ec1[_0x5788('0x36')]['filter']+'%'};return _0x5d3f9f;}})});}_0x53d465=_[_0x5788('0x43')]({},_0x53d465,_0x703ec1['options']);var _0x2b2224={'where':_0x53d465[_0x5788('0x41')]};return db['Plugin'][_0x5788('0x26')](_0x2b2224)[_0x5788('0x2e')](function(_0x1883c5){_0x15584b[_0x5788('0x26')]=_0x1883c5;if(_0x703ec1[_0x5788('0x36')][_0x5788('0x46')]){_0x53d465[_0x5788('0x47')]=[{'all':!![]}];}return db[_0x5788('0x48')][_0x5788('0x49')](_0x53d465);})[_0x5788('0x2e')](function(_0xa5f4fb){_0x15584b[_0x5788('0x4a')]=_0xa5f4fb;return _0x15584b;})[_0x5788('0x2e')](respondWithFilteredResult(_0x411d69,_0x53d465))[_0x5788('0x4b')](handleError(_0x411d69,null));};exports[_0x5788('0x4c')]=function(_0x129163,_0x4db0a1){var _0x47d7d7={'raw':!![],'where':{'id':_0x129163[_0x5788('0x4d')]['id']}},_0x3df56e={};_0x3df56e[_0x5788('0x39')]=_[_0x5788('0x4e')](db[_0x5788('0x48')][_0x5788('0x4f')]);_0x3df56e[_0x5788('0x36')]=_[_0x5788('0x4e')](_0x129163[_0x5788('0x36')]);_0x3df56e[_0x5788('0x37')]=_[_0x5788('0x38')](_0x3df56e['model'],_0x3df56e['query']);_0x47d7d7[_0x5788('0x3a')]=_['intersection'](_0x3df56e[_0x5788('0x39')],qs['fields'](_0x129163[_0x5788('0x36')]['fields']));_0x47d7d7[_0x5788('0x3a')]=_0x47d7d7[_0x5788('0x3a')][_0x5788('0x3c')]?_0x47d7d7['attributes']:_0x3df56e[_0x5788('0x39')];if(_0x129163['query']['includeAll']){_0x47d7d7[_0x5788('0x47')]=[{'all':!![]}];}_0x47d7d7=_['merge']({},_0x47d7d7,_0x129163[_0x5788('0x50')]);return db[_0x5788('0x48')][_0x5788('0x51')](_0x47d7d7)[_0x5788('0x2e')](handleEntityNotFound(_0x4db0a1,null))[_0x5788('0x2e')](respondWithResult(_0x4db0a1,null))[_0x5788('0x4b')](handleError(_0x4db0a1,null));};exports[_0x5788('0x52')]=function(_0x14551e,_0xc9d453,_0x3ab621){return db[_0x5788('0x48')][_0x5788('0x51')]({'where':{'id':_0x14551e[_0x5788('0x4d')]['id']},'attributes':[_0x5788('0x31'),_0x5788('0x5')],'raw':!![]})[_0x5788('0x2e')](handleEntityNotFound(_0xc9d453,null))['then'](function(_0x1604cc){if(_0x1604cc){var _0x1e35fc=path[_0x5788('0x53')](config[_0x5788('0x54')],_0x5788('0x55'),util[_0x5788('0x56')](_0x5788('0x57'),path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')])));var _0x2e5c2e=fs[_0x5788('0x59')](_0x1e35fc);var _0x5d3342=archiver(_0x5788('0x5a'),{'zlib':{'level':0x9}});_0x5d3342['on'](_0x5788('0x5b'),function(_0x19761f){if(_0x19761f[_0x5788('0x5c')]==='ENOENT'){logger[_0x5788('0x2f')](_0x19761f);}else{throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))](_0x5788('0x5f'));}});_0x5d3342['on']('error',function(_0xccf139){throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5d3342[_0x5788('0x60')](_0x2e5c2e);_0x5d3342['glob'](_0x5788('0x61'),{'cwd':path['join'](config[_0x5788('0x54')],'server/files/plugins',path[_0x5788('0x62')](_0x1604cc['path'])),'ignore':[path['join'](path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')]),'node_modules/**/*'),path[_0x5788('0x53')](path['basename'](_0x1604cc[_0x5788('0x5')]),_0x5788('0x63'))],'nodir':!![]})[_0x5788('0x64')]();_0x2e5c2e['on'](_0x5788('0x65'),function(){if(!fs[_0x5788('0x66')](_0x1e35fc)){throw new db[(_0x5788('0x5d'))][(_0x5788('0x5e'))]('Plugin\x20not\x20found');}return _0xc9d453[_0x5788('0x52')](_0x1e35fc,util[_0x5788('0x56')]('%s.zip',path[_0x5788('0x58')](_0x1604cc[_0x5788('0x5')])),function(_0x232070){if(_0x232070){throw new db['Sequelize']['Error'](_0x5788('0x67'));}fs[_0x5788('0x68')](_0x1e35fc);logger[_0x5788('0x69')](_0x5788('0x6a'));logger[_0x5788('0x69')](_0x5788('0x6b'));});});}return null;})[_0x5788('0x4b')](handleError(_0xc9d453,null));};exports[_0x5788('0x6c')]=function(_0x4da716,_0x19d679,_0x70342){var _0x20ea87=path[_0x5788('0x58')](_0x4da716[_0x5788('0x6d')][_0x5788('0x6e')],path[_0x5788('0x6f')](_0x4da716[_0x5788('0x6d')][_0x5788('0x6e')]));var _0x4e39ad=path['join'](config[_0x5788('0x54')],_0x5788('0x55'),_0x4da716[_0x5788('0x6d')]['filename']);var _0x4bcb05=path[_0x5788('0x53')](config['root'],_0x5788('0x55'),_0x20ea87);logger[_0x5788('0x69')](_0x5788('0x70'),_0x4e39ad);logger[_0x5788('0x69')](_0x5788('0x71'),_0x4bcb05);try{fs['chmodSync'](_0x4e39ad,parseInt(_0x5788('0x72'),0x8));extract(_0x4e39ad,{'dir':_0x4bcb05},function(_0x1b6d5c){if(_0x1b6d5c){logger[_0x5788('0x2f')](_0x1b6d5c);handleError(_0x1b6d5c,!![]);};var _0x439a63=fs['readdirSync'](_0x4bcb05);if(_0x439a63[_0x5788('0x3c')]>0x1){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')]('Invalid\x20plugin\x20structure');return _0x70342(new Error(_0x5788('0x73')));}var _0x3ca266=fs[_0x5788('0x74')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0]));if(_0x3ca266[_0x5788('0x75')]()){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')]('Invalid\x20plugin\x20structure');return _0x70342(new Error(_0x5788('0x73')));}if(_0x3ca266[_0x5788('0x76')]()){var _0x25a1d0=fs[_0x5788('0x77')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0]));if(_0x25a1d0['length']===0x0){removeReferences(_0x4e39ad,_0x4bcb05);logger[_0x5788('0x2f')](_0x5788('0x73'));return _0x70342(new Error('Invalid\x20plugin\x20structure'));}var _0x118167=_0x25a1d0[_0x5788('0x78')](function(_0x5e780e){return _0x5e780e===_0x5788('0x79');});if(!_0x118167){return _0x70342(new Error(_0x5788('0x7a')));}var _0x32a1aa=fs[_0x5788('0x7b')](path[_0x5788('0x53')](_0x4bcb05,_0x439a63[0x0],'manifest.json'));var _0x4196b7=JSON[_0x5788('0x7c')](_0x32a1aa);if('undefined'==typeof _0x4196b7[_0x5788('0x31')]){return _0x70342(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x4196b7['type']){return _0x70342(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x4196b7['version']){return _0x70342(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x4196b7[_0x5788('0x7d')]){return _0x70342(new Error(_0x5788('0x7e')));}if(_0x4196b7[_0x5788('0x35')]===_0x5788('0x7f')){if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]){return _0x70342(new Error(_0x5788('0x81')));}if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')]&&_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]['agent']){return _0x70342(new Error(_0x5788('0x83')));}}else if(_0x4196b7[_0x5788('0x35')]===_0x5788('0x84')){if(_0x5788('0x24')==typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x85')]){return _0x70342(new Error(_0x5788('0x86')));}if(_0x5788('0x24')==typeof _0x4196b7['parameters'][_0x5788('0x87')]){return _0x70342(new Error(_0x5788('0x88')));}}else{return _0x70342(new Error(_0x5788('0x89')));}var _0x2ecd32=_0x4196b7[_0x5788('0x31')];var _0x5c8f88=_0x4196b7[_0x5788('0x8a')];var _0xbe7431=_0x4196b7[_0x5788('0x35')];var _0x1f038d=_0x4196b7[_0x5788('0x8b')]?_0x4196b7['sidebar']:_0x5788('0x8c');var _0xc791b1=_0x4196b7['icon']?_0x4196b7['icon']:_0x5788('0x8d');var _0x2df0e1='';var _0x140209='';var _0x33b43d='';var _0x129901='';var _0x540594=_0x4196b7[_0x5788('0x8e')];if(_0xbe7431===_0x5788('0x7f')){if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')]['views'][_0x5788('0x82')]){var _0xd42680=_0x4196b7['parameters'][_0x5788('0x80')][_0x5788('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0xd42680)){_0x2df0e1=path['join'](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0xd42680);}else{_0x2df0e1=_0xd42680;}}else{logger[_0x5788('0x69')](_0x5788('0x90'));}if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')]['views'][_0x5788('0x91')]){var _0x467317=_0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0x467317)){_0x140209=path['join'](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0x467317);}else{_0x140209=_0x467317;}}else{logger[_0x5788('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xbe7431===_0x5788('0x84')){_0x33b43d=_0x4196b7['parameters']['scriptName'];_0x129901=_0x4196b7[_0x5788('0x7d')][_0x5788('0x87')];if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')]){if(_0x5788('0x24')!=typeof _0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')]){var _0xd42680=_0x4196b7[_0x5788('0x7d')][_0x5788('0x80')][_0x5788('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0xd42680)){_0x2df0e1=path[_0x5788('0x53')]('plugins',_0x20ea87,_0x439a63[0x0],_0xd42680);}else{_0x2df0e1=_0xd42680;}}if(_0x5788('0x24')!=typeof _0x4196b7['parameters']['views'][_0x5788('0x91')]){var _0x467317=_0x4196b7['parameters']['views'][_0x5788('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x5788('0x92')](_0x467317)){_0x140209=path[_0x5788('0x53')](_0x5788('0x8f'),_0x20ea87,_0x439a63[0x0],_0x467317);}else{_0x140209=_0x467317;}}}}var _0x1cf6b4={'name':_0x2ecd32,'description':_0x5c8f88,'path':path[_0x5788('0x53')](_0x20ea87,_0x439a63[0x0]),'type':_0xbe7431,'sidebar':_0x1f038d,'icon':_0xc791b1,'adminUrl':_0x2df0e1,'agentUrl':_0x140209,'scriptName':_0x33b43d,'scriptPath':_0x129901,'version':_0x540594};removeReferences(_0x4e39ad,null);return db[_0x5788('0x48')][_0x5788('0x93')](_0x1cf6b4)['then'](function(_0x103907){var _0x54d233={'role':_0x4da716[_0x5788('0x94')]['role'],'userProfileId':_0x4da716['body'][_0x5788('0x95')]};if(!_0x54d233)throw new Error(_0x5788('0x96'));if(_0x54d233['role']===_0x5788('0x97')){var _0x54d897=_0x103907[_0x5788('0x2b')]({'plain':!![]});return db[_0x5788('0x98')][_0x5788('0x51')]({'where':{'name':_0x5788('0x2c'),'userProfileId':_0x54d233['userProfileId']},'raw':!![]})[_0x5788('0x2e')](function(_0x2074c6){if(_0x2074c6&&_0x2074c6[_0x5788('0x99')]===0x0){return db[_0x5788('0x2d')]['create']({'name':_0x54d897[_0x5788('0x31')],'resourceId':_0x54d897['id'],'type':_0x2074c6['name'],'sectionId':_0x2074c6['id']},{})[_0x5788('0x2e')](function(){return _0x103907;});}else{return _0x103907;}})[_0x5788('0x4b')](function(_0x5748fc){logger[_0x5788('0x2f')](_0x5788('0x9a'),_0x5748fc);throw _0x5748fc;});}return _0x103907;})[_0x5788('0x2e')](respondWithResult(_0x19d679,null))[_0x5788('0x4b')](handleError(_0x19d679,null));}});}catch(_0x543a40){_0x19d679[_0x5788('0x21')](0x1f4)[_0x5788('0x32')](_0x543a40);}};function removeReferences(_0x1d49ce,_0x19e942){try{if(_0x1d49ce){fs[_0x5788('0x68')](_0x1d49ce);logger[_0x5788('0x69')]('Zip\x20archive\x20removed');}if(_0x19e942){rimraf(_0x19e942,function(){});logger[_0x5788('0x69')](_0x5788('0x9b'));}}catch(_0x36be2d){logger[_0x5788('0x2f')](_0x36be2d);}}exports[_0x5788('0x29')]=function(_0x5249aa,_0x209832,_0x3ea70b){return db[_0x5788('0x48')]['find']({'where':{'id':_0x5249aa[_0x5788('0x4d')]['id']}})[_0x5788('0x2e')](handleEntityNotFound(_0x209832,null))[_0x5788('0x2e')](saveUpdates(_0x5249aa['body'],null))[_0x5788('0x2e')](respondWithResult(_0x209832,null))[_0x5788('0x4b')](handleError(_0x209832,null));};exports['delete']=function(_0x3a633e,_0x83adf4,_0x4ce43a){return db[_0x5788('0x48')][_0x5788('0x51')]({'where':{'id':_0x3a633e[_0x5788('0x4d')]['id']}})[_0x5788('0x2e')](function(_0x39116d){if(_0x39116d){return _0x39116d['destroy']();}})['then'](function(_0x586420){rimraf(path[_0x5788('0x53')](config[_0x5788('0x54')],_0x5788('0x55'),path['dirname'](_0x586420[_0x5788('0x5')])),function(){});return _0x586420;})[_0x5788('0x2e')](handleEntityNotFound(_0x83adf4,null))[_0x5788('0x2e')](respondWithStatusCode(_0x83adf4,null))[_0x5788('0x4b')](handleError(_0x83adf4,null));};exports[_0x5788('0x9c')]=function(_0x211c1f,_0x429a9f,_0x3677c1){return BPromise['resolve']()[_0x5788('0x2e')](function(){if(!_0x211c1f[_0x5788('0x36')][_0x5788('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x211c1f[_0x5788('0x36')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2816d6=_0x211c1f[_0x5788('0x36')][_0x5788('0x9d')]?_0x211c1f[_0x5788('0x36')]['hostname']+':'+_0x211c1f[_0x5788('0x36')][_0x5788('0x9e')]:_0x5788('0x9f')+_0x211c1f['query'][_0x5788('0x9e')];var _0x1a18a5=_0x211c1f[_0x5788('0x36')][_0x5788('0x22')]?_0x211c1f['query']['json']:!![];var _0x4dc6f9=_0x211c1f[_0x5788('0x36')][_0x5788('0xa0')]?_0x211c1f[_0x5788('0x36')][_0x5788('0xa0')]:null;var _0x49a93e={'method':_0x211c1f['method'],'uri':util[_0x5788('0x56')]('%s%s',_0x2816d6,_0x211c1f[_0x5788('0x36')][_0x5788('0x5')]),'json':_0x1a18a5,'resolveWithFullResponse':!![],'encoding':_0x4dc6f9,'qs':_0x211c1f['query']};if(_0x211c1f['headers']){_0x49a93e['headers']=_0x211c1f[_0x5788('0xa1')];if(_0x49a93e[_0x5788('0xa1')][_0x5788('0xa2')]){delete _0x49a93e[_0x5788('0xa1')][_0x5788('0xa2')];}}if(_0x49a93e[_0x5788('0xa1')][_0x5788('0xa3')]){delete _0x49a93e[_0x5788('0xa1')][_0x5788('0xa3')];}return rp(_0x49a93e);})[_0x5788('0x2e')](function(_0x251b9e){if(_0x251b9e){_0x429a9f[_0x5788('0xa4')](_0x251b9e[_0x5788('0xa1')]);logger[_0x5788('0x69')](_0x251b9e['body']);if(_[_0x5788('0xa5')](_0x211c1f[_0x5788('0x36')]['path'],_0x5788('0x52'))&&_0x251b9e['statusCode']==0x1f4){return _0x429a9f[_0x5788('0x1f')](_0x251b9e[_0x5788('0xa6')]);}else{return _0x429a9f[_0x5788('0x21')](_0x251b9e[_0x5788('0xa6')])['send'](_0x251b9e[_0x5788('0x94')]);}}else{return _0x429a9f[_0x5788('0x1f')](0xc8);}})[_0x5788('0x4b')](handleError(_0x429a9f,null));};exports['webhookPost']=function(_0x40a5b0,_0x5117c2,_0x4bc918){return BPromise[_0x5788('0xa7')]()[_0x5788('0x2e')](function(){if(!_0x40a5b0['query'][_0x5788('0x5')]){throw new Error(_0x5788('0xa8'));}if(!_0x40a5b0[_0x5788('0x36')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1ea8f9=_0x40a5b0[_0x5788('0x36')][_0x5788('0x9d')]?_0x40a5b0['query']['hostname']+':'+_0x40a5b0['query'][_0x5788('0x9e')]:_0x5788('0x9f')+_0x40a5b0[_0x5788('0x36')][_0x5788('0x9e')];var _0x120c0e=_0x40a5b0[_0x5788('0x36')][_0x5788('0x22')]?_0x40a5b0[_0x5788('0x36')][_0x5788('0x22')]:!![];var _0x56726a=_0x40a5b0['query'][_0x5788('0xa0')]?_0x40a5b0[_0x5788('0x36')][_0x5788('0xa0')]:null;var _0x107027={'method':_0x40a5b0['method'],'uri':util['format'](_0x5788('0xa9'),_0x1ea8f9,_0x40a5b0[_0x5788('0x36')][_0x5788('0x5')]),'json':_0x120c0e,'resolveWithFullResponse':!![],'encoding':_0x56726a,'body':_0x40a5b0[_0x5788('0x94')]};if(_0x40a5b0[_0x5788('0xa1')]){_0x107027[_0x5788('0xa1')]=_0x40a5b0[_0x5788('0xa1')];if(_0x107027['headers']['content-length']){delete _0x107027['headers'][_0x5788('0xa2')];}}if(_0x107027[_0x5788('0xa1')][_0x5788('0xa3')]){delete _0x107027[_0x5788('0xa1')][_0x5788('0xa3')];}return rp(_0x107027);})['then'](function(_0x19b243){if(_0x19b243){_0x5117c2[_0x5788('0xa4')](_0x19b243[_0x5788('0xa1')]);logger[_0x5788('0x69')](_0x19b243[_0x5788('0x94')]);return _0x5117c2[_0x5788('0x21')](_0x19b243[_0x5788('0xa6')])[_0x5788('0x32')](_0x19b243[_0x5788('0x94')]);}else{return _0x5117c2['sendStatus'](0xc8);}})['catch'](handleError(_0x5117c2,null));}; \ No newline at end of file +var _0x77d0=['order','sort','where','filters','pick','merge','VIRTUAL','rows','catch','show','params','rawAttributes','keys','includeAll','include','find','path','join','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','filename','extname','root','file','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Plugins','autoAssociation','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','sendStatus','webhookPost','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./plugin.socket','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Plugin','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x30561e,_0x5b9b77){var _0x3a5d91=function(_0x11f589){while(--_0x11f589){_0x30561e['push'](_0x30561e['shift']());}};_0x3a5d91(++_0x5b9b77);}(_0x77d0,0x118));var _0x077d=function(_0x2c8640,_0x471140){_0x2c8640=_0x2c8640-0x0;var _0x5d2b1a=_0x77d0[_0x2c8640];return _0x5d2b1a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x077d('0x0'));var jsonpatch=require(_0x077d('0x1'));var rp=require(_0x077d('0x2'));var moment=require(_0x077d('0x3'));var BPromise=require(_0x077d('0x4'));var Mustache=require(_0x077d('0x5'));var util=require(_0x077d('0x6'));var path=require('path');var sox=require(_0x077d('0x7'));var csv=require(_0x077d('0x8'));var ejs=require(_0x077d('0x9'));var fs=require('fs');var fs_extra=require(_0x077d('0xa'));var _=require(_0x077d('0xb'));var squel=require(_0x077d('0xc'));var crypto=require(_0x077d('0xd'));var jsforce=require(_0x077d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x077d('0x8'));var querystring=require('querystring');var Papa=require(_0x077d('0xf'));var extract=require(_0x077d('0x10'));var rimraf=require('rimraf');var archiver=require(_0x077d('0x11'));var Redis=require(_0x077d('0x12'));var authService=require(_0x077d('0x13'));var qs=require(_0x077d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x077d('0x15'));var logger=require(_0x077d('0x16'))(_0x077d('0x17'));var utils=require(_0x077d('0x18'));var config=require(_0x077d('0x19'));var licenseUtil=require(_0x077d('0x1a'));var db=require(_0x077d('0x1b'))['db'];config[_0x077d('0x1c')]=_['defaults'](config[_0x077d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x077d('0x1c')]));require(_0x077d('0x1d'))[_0x077d('0x1e')](socket);function respondWithStatusCode(_0x122fe1,_0x5d524a){_0x5d524a=_0x5d524a||0xcc;return function(_0x1d786f){if(_0x1d786f){return _0x122fe1['sendStatus'](_0x5d524a);}return _0x122fe1[_0x077d('0x1f')](_0x5d524a)[_0x077d('0x20')]();};}function respondWithResult(_0x3d8ec2,_0x4bba42){_0x4bba42=_0x4bba42||0xc8;return function(_0x53b9dc){if(_0x53b9dc){return _0x3d8ec2[_0x077d('0x1f')](_0x4bba42)[_0x077d('0x21')](_0x53b9dc);}};}function respondWithFilteredResult(_0x3229e4,_0x51a150){return function(_0x269b47){if(_0x269b47){var _0xfd114b=typeof _0x51a150[_0x077d('0x22')]===_0x077d('0x23')&&typeof _0x51a150['limit']===_0x077d('0x23');var _0x35ba54=_0x269b47[_0x077d('0x24')];var _0x2d8366=_0xfd114b?0x0:_0x51a150[_0x077d('0x22')];var _0x5ac550=_0xfd114b?_0x269b47[_0x077d('0x24')]:_0x51a150[_0x077d('0x22')]+_0x51a150['limit'];var _0x42c2c4;if(_0x5ac550>=_0x35ba54){_0x5ac550=_0x35ba54;_0x42c2c4=0xc8;}else{_0x42c2c4=0xce;}_0x3229e4['status'](_0x42c2c4);return _0x3229e4[_0x077d('0x25')](_0x077d('0x26'),_0x2d8366+'-'+_0x5ac550+'/'+_0x35ba54)[_0x077d('0x21')](_0x269b47);}return null;};}function patchUpdates(_0x417ff6){return function(_0x45ea33){try{jsonpatch[_0x077d('0x27')](_0x45ea33,_0x417ff6,!![]);}catch(_0x2b4fd0){return BPromise[_0x077d('0x28')](_0x2b4fd0);}return _0x45ea33['save']();};}function saveUpdates(_0x1b0591,_0x217441){return function(_0xb3f9be){if(_0xb3f9be){return _0xb3f9be[_0x077d('0x29')](_0x1b0591)[_0x077d('0x2a')](function(_0x1a381d){return _0x1a381d;});}return null;};}function removeEntity(_0x2d4fd1,_0x421241){return function(_0x1a608f){if(_0x1a608f){return _0x1a608f[_0x077d('0x2b')]()[_0x077d('0x2a')](function(){var _0x17765a=_0x1a608f['get']({'plain':!![]});var _0x5dd05c='Plugins';return db[_0x077d('0x2c')][_0x077d('0x2b')]({'where':{'type':_0x5dd05c,'resourceId':_0x17765a['id']}})[_0x077d('0x2a')](function(){return _0x1a608f;});})[_0x077d('0x2a')](function(){_0x2d4fd1[_0x077d('0x1f')](0xcc)[_0x077d('0x20')]();});}};}function handleEntityNotFound(_0x4cce48,_0x5e8b03){return function(_0xb9ffd8){if(!_0xb9ffd8){_0x4cce48['sendStatus'](0x194);}return _0xb9ffd8;};}function handleError(_0x3c18b4,_0x9fbb99){_0x9fbb99=_0x9fbb99||0x1f4;return function(_0x21c8ab){logger[_0x077d('0x2d')](_0x21c8ab[_0x077d('0x2e')]);if(_0x21c8ab[_0x077d('0x2f')]){delete _0x21c8ab[_0x077d('0x2f')];}_0x3c18b4[_0x077d('0x1f')](_0x9fbb99)[_0x077d('0x30')](_0x21c8ab);};}exports[_0x077d('0x31')]=function(_0x114e01,_0x3acf9f){var _0x48af29={},_0x7ad4e1={},_0x1213ad={'count':0x0,'rows':[]};var _0x1f2347=_[_0x077d('0x32')](db[_0x077d('0x33')]['rawAttributes'],function(_0x5a1790){return{'name':_0x5a1790[_0x077d('0x34')],'type':_0x5a1790[_0x077d('0x35')][_0x077d('0x36')]};});_0x7ad4e1[_0x077d('0x37')]=_[_0x077d('0x32')](_0x1f2347,_0x077d('0x2f'));_0x7ad4e1[_0x077d('0x38')]=_['keys'](_0x114e01[_0x077d('0x38')]);_0x7ad4e1['filters']=_[_0x077d('0x39')](_0x7ad4e1[_0x077d('0x37')],_0x7ad4e1[_0x077d('0x38')]);_0x48af29[_0x077d('0x3a')]=_[_0x077d('0x39')](_0x7ad4e1['model'],qs[_0x077d('0x3b')](_0x114e01['query'][_0x077d('0x3b')]));_0x48af29[_0x077d('0x3a')]=_0x48af29[_0x077d('0x3a')][_0x077d('0x3c')]?_0x48af29['attributes']:_0x7ad4e1[_0x077d('0x37')];if(!_0x114e01[_0x077d('0x38')][_0x077d('0x3d')](_0x077d('0x3e'))){_0x48af29['limit']=qs['limit'](_0x114e01[_0x077d('0x38')][_0x077d('0x3f')]);_0x48af29['offset']=qs[_0x077d('0x22')](_0x114e01[_0x077d('0x38')][_0x077d('0x22')]);}_0x48af29[_0x077d('0x40')]=qs[_0x077d('0x41')](_0x114e01[_0x077d('0x38')][_0x077d('0x41')]);_0x48af29[_0x077d('0x42')]=qs[_0x077d('0x43')](_[_0x077d('0x44')](_0x114e01[_0x077d('0x38')],_0x7ad4e1['filters']),_0x1f2347);if(_0x114e01[_0x077d('0x38')]['filter']){_0x48af29['where']=_[_0x077d('0x45')](_0x48af29[_0x077d('0x42')],{'$or':_[_0x077d('0x32')](_0x1f2347,function(_0xa15095){if(_0xa15095['type']!==_0x077d('0x46')){var _0xb3fcbf={};_0xb3fcbf[_0xa15095[_0x077d('0x2f')]]={'$like':'%'+_0x114e01[_0x077d('0x38')]['filter']+'%'};return _0xb3fcbf;}})});}_0x48af29=_[_0x077d('0x45')]({},_0x48af29,_0x114e01['options']);var _0x3ad6b3={'where':_0x48af29[_0x077d('0x42')]};return db[_0x077d('0x33')][_0x077d('0x24')](_0x3ad6b3)[_0x077d('0x2a')](function(_0x403ca5){_0x1213ad[_0x077d('0x24')]=_0x403ca5;if(_0x114e01['query']['includeAll']){_0x48af29['include']=[{'all':!![]}];}return db[_0x077d('0x33')]['findAll'](_0x48af29);})['then'](function(_0x59f97f){_0x1213ad[_0x077d('0x47')]=_0x59f97f;return _0x1213ad;})[_0x077d('0x2a')](respondWithFilteredResult(_0x3acf9f,_0x48af29))[_0x077d('0x48')](handleError(_0x3acf9f,null));};exports[_0x077d('0x49')]=function(_0x1e792e,_0x2aa604){var _0x22b7a1={'raw':!![],'where':{'id':_0x1e792e[_0x077d('0x4a')]['id']}},_0x4ad01d={};_0x4ad01d[_0x077d('0x37')]=_['keys'](db[_0x077d('0x33')][_0x077d('0x4b')]);_0x4ad01d[_0x077d('0x38')]=_[_0x077d('0x4c')](_0x1e792e[_0x077d('0x38')]);_0x4ad01d[_0x077d('0x43')]=_[_0x077d('0x39')](_0x4ad01d[_0x077d('0x37')],_0x4ad01d[_0x077d('0x38')]);_0x22b7a1[_0x077d('0x3a')]=_[_0x077d('0x39')](_0x4ad01d[_0x077d('0x37')],qs['fields'](_0x1e792e['query'][_0x077d('0x3b')]));_0x22b7a1[_0x077d('0x3a')]=_0x22b7a1[_0x077d('0x3a')][_0x077d('0x3c')]?_0x22b7a1['attributes']:_0x4ad01d[_0x077d('0x37')];if(_0x1e792e[_0x077d('0x38')][_0x077d('0x4d')]){_0x22b7a1[_0x077d('0x4e')]=[{'all':!![]}];}_0x22b7a1=_['merge']({},_0x22b7a1,_0x1e792e['options']);return db[_0x077d('0x33')][_0x077d('0x4f')](_0x22b7a1)[_0x077d('0x2a')](handleEntityNotFound(_0x2aa604,null))['then'](respondWithResult(_0x2aa604,null))[_0x077d('0x48')](handleError(_0x2aa604,null));};exports['download']=function(_0x3f9a22,_0x5d9c80,_0x30ecf2){return db[_0x077d('0x33')][_0x077d('0x4f')]({'where':{'id':_0x3f9a22['params']['id']},'attributes':[_0x077d('0x2f'),_0x077d('0x50')],'raw':!![]})[_0x077d('0x2a')](handleEntityNotFound(_0x5d9c80,null))['then'](function(_0x46c23b){if(_0x46c23b){var _0x2f86f2=path[_0x077d('0x51')](config['root'],'server/files/plugins',util['format']('%s.zip',path[_0x077d('0x52')](_0x46c23b[_0x077d('0x50')])));var _0xd8aed8=fs[_0x077d('0x53')](_0x2f86f2);var _0x57ac22=archiver(_0x077d('0x54'),{'zlib':{'level':0x9}});_0x57ac22['on'](_0x077d('0x55'),function(_0x4811d8){if(_0x4811d8[_0x077d('0x56')]===_0x077d('0x57')){logger[_0x077d('0x2d')](_0x4811d8);}else{throw new db['Sequelize'][(_0x077d('0x58'))](_0x077d('0x59'));}});_0x57ac22['on'](_0x077d('0x2d'),function(_0xa83321){throw new db[(_0x077d('0x5a'))]['Error'](_0x077d('0x59'));});_0x57ac22[_0x077d('0x5b')](_0xd8aed8);_0x57ac22['glob'](_0x077d('0x5c'),{'cwd':path['join'](config['root'],'server/files/plugins',path['dirname'](_0x46c23b[_0x077d('0x50')])),'ignore':[path['join'](path[_0x077d('0x52')](_0x46c23b[_0x077d('0x50')]),'node_modules/**/*'),path[_0x077d('0x51')](path[_0x077d('0x52')](_0x46c23b['path']),_0x077d('0x5d'))],'nodir':!![]})[_0x077d('0x5e')]();_0xd8aed8['on'](_0x077d('0x5f'),function(){if(!fs[_0x077d('0x60')](_0x2f86f2)){throw new db[(_0x077d('0x5a'))][(_0x077d('0x58'))](_0x077d('0x61'));}return _0x5d9c80[_0x077d('0x62')](_0x2f86f2,util[_0x077d('0x63')]('%s.zip',path[_0x077d('0x52')](_0x46c23b[_0x077d('0x50')])),function(_0x28abe8){if(_0x28abe8){throw new db['Sequelize'][(_0x077d('0x58'))](_0x077d('0x64'));}fs[_0x077d('0x65')](_0x2f86f2);logger[_0x077d('0x66')]('Download\x20completed');logger['info'](_0x077d('0x67'));});});}return null;})[_0x077d('0x48')](handleError(_0x5d9c80,null));};exports[_0x077d('0x68')]=function(_0x180317,_0x54ace5,_0x3ae610){var _0x27e0c3=path['basename'](_0x180317['file'][_0x077d('0x69')],path[_0x077d('0x6a')](_0x180317['file'][_0x077d('0x69')]));var _0x4321fc=path[_0x077d('0x51')](config[_0x077d('0x6b')],'server/files/plugins',_0x180317[_0x077d('0x6c')]['filename']);var _0x348d97=path[_0x077d('0x51')](config[_0x077d('0x6b')],_0x077d('0x6d'),_0x27e0c3);logger['info'](_0x077d('0x6e'),_0x4321fc);logger[_0x077d('0x66')](_0x077d('0x6f'),_0x348d97);try{fs['chmodSync'](_0x4321fc,parseInt(_0x077d('0x70'),0x8));extract(_0x4321fc,{'dir':_0x348d97},function(_0x56b173){if(_0x56b173){logger[_0x077d('0x2d')](_0x56b173);handleError(_0x56b173,!![]);};var _0x194f5f=fs[_0x077d('0x71')](_0x348d97);if(_0x194f5f[_0x077d('0x3c')]>0x1){removeReferences(_0x4321fc,_0x348d97);logger[_0x077d('0x2d')]('Invalid\x20plugin\x20structure');return _0x3ae610(new Error(_0x077d('0x72')));}var _0xb01dff=fs[_0x077d('0x73')](path[_0x077d('0x51')](_0x348d97,_0x194f5f[0x0]));if(_0xb01dff[_0x077d('0x74')]()){removeReferences(_0x4321fc,_0x348d97);logger[_0x077d('0x2d')]('Invalid\x20plugin\x20structure');return _0x3ae610(new Error(_0x077d('0x72')));}if(_0xb01dff[_0x077d('0x75')]()){var _0x2896ff=fs[_0x077d('0x71')](path[_0x077d('0x51')](_0x348d97,_0x194f5f[0x0]));if(_0x2896ff[_0x077d('0x3c')]===0x0){removeReferences(_0x4321fc,_0x348d97);logger[_0x077d('0x2d')]('Invalid\x20plugin\x20structure');return _0x3ae610(new Error(_0x077d('0x72')));}var _0x112e68=_0x2896ff['some'](function(_0x27fc63){return _0x27fc63===_0x077d('0x76');});if(!_0x112e68){return _0x3ae610(new Error(_0x077d('0x77')));}var _0xd5cb22=fs[_0x077d('0x78')](path[_0x077d('0x51')](_0x348d97,_0x194f5f[0x0],_0x077d('0x76')));var _0x2aa841=JSON[_0x077d('0x79')](_0xd5cb22);if(_0x077d('0x23')==typeof _0x2aa841['name']){return _0x3ae610(new Error(_0x077d('0x7a')));}if('undefined'==typeof _0x2aa841[_0x077d('0x35')]){return _0x3ae610(new Error(_0x077d('0x7b')));}if(_0x077d('0x23')==typeof _0x2aa841[_0x077d('0x7c')]){return _0x3ae610(new Error(_0x077d('0x7d')));}if(_0x077d('0x23')==typeof _0x2aa841[_0x077d('0x7e')]){return _0x3ae610(new Error(_0x077d('0x7f')));}if(_0x2aa841[_0x077d('0x35')]===_0x077d('0x80')){if(_0x077d('0x23')==typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')]){return _0x3ae610(new Error(_0x077d('0x82')));}if(_0x077d('0x23')==typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')][_0x077d('0x83')]&&_0x077d('0x23')==typeof _0x2aa841['parameters'][_0x077d('0x81')]['agent']){return _0x3ae610(new Error(_0x077d('0x84')));}}else if(_0x2aa841['type']===_0x077d('0x85')){if('undefined'==typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x86')]){return _0x3ae610(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x077d('0x23')==typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x87')]){return _0x3ae610(new Error(_0x077d('0x88')));}}else{return _0x3ae610(new Error(_0x077d('0x89')));}var _0x41057c=_0x2aa841[_0x077d('0x2f')];var _0x20b0fb=_0x2aa841['description'];var _0x3b2050=_0x2aa841['type'];var _0x245ba2=_0x2aa841[_0x077d('0x8a')]?_0x2aa841[_0x077d('0x8a')]:'always';var _0x535949=_0x2aa841[_0x077d('0x8b')]?_0x2aa841[_0x077d('0x8b')]:_0x077d('0x8c');var _0x2520a2='';var _0x141cd6='';var _0x5e7e92='';var _0x2cfe3c='';var _0x16bdbf=_0x2aa841[_0x077d('0x7c')];if(_0x3b2050===_0x077d('0x80')){if('undefined'!=typeof _0x2aa841['parameters'][_0x077d('0x81')][_0x077d('0x83')]){var _0x447061=_0x2aa841['parameters'][_0x077d('0x81')][_0x077d('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x8d')](_0x447061)){_0x2520a2=path[_0x077d('0x51')]('plugins',_0x27e0c3,_0x194f5f[0x0],_0x447061);}else{_0x2520a2=_0x447061;}}else{logger[_0x077d('0x66')](_0x077d('0x8e'));}if(_0x077d('0x23')!=typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')][_0x077d('0x8f')]){var _0x216175=_0x2aa841['parameters']['views'][_0x077d('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x8d')](_0x216175)){_0x141cd6=path[_0x077d('0x51')](_0x077d('0x90'),_0x27e0c3,_0x194f5f[0x0],_0x216175);}else{_0x141cd6=_0x216175;}}else{logger['info'](_0x077d('0x91'));}}else if(_0x3b2050===_0x077d('0x85')){_0x5e7e92=_0x2aa841['parameters'][_0x077d('0x86')];_0x2cfe3c=_0x2aa841[_0x077d('0x7e')]['scriptPath'];if(_0x077d('0x23')!=typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')]){if(_0x077d('0x23')!=typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')][_0x077d('0x83')]){var _0x447061=_0x2aa841[_0x077d('0x7e')]['views'][_0x077d('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x8d')](_0x447061)){_0x2520a2=path['join'](_0x077d('0x90'),_0x27e0c3,_0x194f5f[0x0],_0x447061);}else{_0x2520a2=_0x447061;}}if(_0x077d('0x23')!=typeof _0x2aa841[_0x077d('0x7e')][_0x077d('0x81')][_0x077d('0x8f')]){var _0x216175=_0x2aa841[_0x077d('0x7e')][_0x077d('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x077d('0x8d')](_0x216175)){_0x141cd6=path['join'](_0x077d('0x90'),_0x27e0c3,_0x194f5f[0x0],_0x216175);}else{_0x141cd6=_0x216175;}}}}var _0xc24daa={'name':_0x41057c,'description':_0x20b0fb,'path':path['join'](_0x27e0c3,_0x194f5f[0x0]),'type':_0x3b2050,'sidebar':_0x245ba2,'icon':_0x535949,'adminUrl':_0x2520a2,'agentUrl':_0x141cd6,'scriptName':_0x5e7e92,'scriptPath':_0x2cfe3c,'version':_0x16bdbf};removeReferences(_0x4321fc,null);return db['Plugin'][_0x077d('0x92')](_0xc24daa)[_0x077d('0x2a')](function(_0x36f00c){var _0x4967c9={'role':_0x180317[_0x077d('0x93')][_0x077d('0x94')],'userProfileId':_0x180317[_0x077d('0x93')][_0x077d('0x95')]};if(!_0x4967c9)throw new Error(_0x077d('0x96'));if(_0x4967c9[_0x077d('0x94')]===_0x077d('0x97')){var _0x5f5d2d=_0x36f00c[_0x077d('0x98')]({'plain':!![]});return db['UserProfileSection'][_0x077d('0x4f')]({'where':{'name':_0x077d('0x99'),'userProfileId':_0x4967c9[_0x077d('0x95')]},'raw':!![]})['then'](function(_0x55c5aa){if(_0x55c5aa&&_0x55c5aa[_0x077d('0x9a')]===0x0){return db[_0x077d('0x2c')]['create']({'name':_0x5f5d2d[_0x077d('0x2f')],'resourceId':_0x5f5d2d['id'],'type':_0x55c5aa['name'],'sectionId':_0x55c5aa['id']},{})[_0x077d('0x2a')](function(){return _0x36f00c;});}else{return _0x36f00c;}})[_0x077d('0x48')](function(_0x1db83b){logger[_0x077d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1db83b);throw _0x1db83b;});}return _0x36f00c;})[_0x077d('0x2a')](respondWithResult(_0x54ace5,null))[_0x077d('0x48')](handleError(_0x54ace5,null));}});}catch(_0x24b3ad){_0x54ace5[_0x077d('0x1f')](0x1f4)[_0x077d('0x30')](_0x24b3ad);}};function removeReferences(_0x11fea9,_0x2a22d9){try{if(_0x11fea9){fs[_0x077d('0x65')](_0x11fea9);logger[_0x077d('0x66')]('Zip\x20archive\x20removed');}if(_0x2a22d9){rimraf(_0x2a22d9,function(){});logger['info'](_0x077d('0x9b'));}}catch(_0x38b16d){logger['error'](_0x38b16d);}}exports[_0x077d('0x29')]=function(_0x15c1f4,_0x4e7e73,_0x5ec182){return db['Plugin']['find']({'where':{'id':_0x15c1f4[_0x077d('0x4a')]['id']}})[_0x077d('0x2a')](handleEntityNotFound(_0x4e7e73,null))[_0x077d('0x2a')](saveUpdates(_0x15c1f4[_0x077d('0x93')],null))[_0x077d('0x2a')](respondWithResult(_0x4e7e73,null))[_0x077d('0x48')](handleError(_0x4e7e73,null));};exports['delete']=function(_0x2d5383,_0x380fac,_0x153cd0){return db[_0x077d('0x33')][_0x077d('0x4f')]({'where':{'id':_0x2d5383[_0x077d('0x4a')]['id']}})[_0x077d('0x2a')](function(_0xa004ec){if(_0xa004ec){return _0xa004ec[_0x077d('0x2b')]();}})[_0x077d('0x2a')](function(_0x46b6da){rimraf(path['join'](config['root'],_0x077d('0x6d'),path[_0x077d('0x9c')](_0x46b6da[_0x077d('0x50')])),function(){});return _0x46b6da;})[_0x077d('0x2a')](handleEntityNotFound(_0x380fac,null))['then'](respondWithStatusCode(_0x380fac,null))['catch'](handleError(_0x380fac,null));};exports[_0x077d('0x9d')]=function(_0x3371f9,_0xfebee9,_0x3867b6){return BPromise[_0x077d('0x9e')]()[_0x077d('0x2a')](function(){if(!_0x3371f9[_0x077d('0x38')][_0x077d('0x50')]){throw new Error(_0x077d('0x9f'));}if(!_0x3371f9[_0x077d('0x38')][_0x077d('0xa0')]){throw new Error(_0x077d('0xa1'));}var _0x1bbc93=_0x3371f9[_0x077d('0x38')][_0x077d('0xa2')]?_0x3371f9[_0x077d('0x38')][_0x077d('0xa2')]+':'+_0x3371f9[_0x077d('0x38')][_0x077d('0xa0')]:_0x077d('0xa3')+_0x3371f9['query']['port'];var _0x2d85cd=_0x3371f9['query'][_0x077d('0x21')]?_0x3371f9['query'][_0x077d('0x21')]:!![];var _0x52fbc9=_0x3371f9['query'][_0x077d('0xa4')]?_0x3371f9[_0x077d('0x38')]['encoding']:null;var _0x33f4ca={'method':_0x3371f9[_0x077d('0xa5')],'uri':util[_0x077d('0x63')]('%s%s',_0x1bbc93,_0x3371f9[_0x077d('0x38')][_0x077d('0x50')]),'json':_0x2d85cd,'resolveWithFullResponse':!![],'encoding':_0x52fbc9,'qs':_0x3371f9[_0x077d('0x38')]};if(_0x3371f9[_0x077d('0xa6')]){_0x33f4ca[_0x077d('0xa6')]=_0x3371f9['headers'];if(_0x33f4ca[_0x077d('0xa6')][_0x077d('0xa7')]){delete _0x33f4ca[_0x077d('0xa6')][_0x077d('0xa7')];}}if(_0x33f4ca[_0x077d('0xa6')][_0x077d('0xa8')]){delete _0x33f4ca[_0x077d('0xa6')][_0x077d('0xa8')];}return rp(_0x33f4ca);})[_0x077d('0x2a')](function(_0x4d9d8a){if(_0x4d9d8a){_0xfebee9['set'](_0x4d9d8a['headers']);logger[_0x077d('0x66')](_0x4d9d8a[_0x077d('0x93')]);if(_['endsWith'](_0x3371f9[_0x077d('0x38')][_0x077d('0x50')],_0x077d('0x62'))&&_0x4d9d8a[_0x077d('0xa9')]==0x1f4){return _0xfebee9['sendStatus'](_0x4d9d8a[_0x077d('0xa9')]);}else{return _0xfebee9['status'](_0x4d9d8a[_0x077d('0xa9')])[_0x077d('0x30')](_0x4d9d8a[_0x077d('0x93')]);}}else{return _0xfebee9[_0x077d('0xaa')](0xc8);}})['catch'](handleError(_0xfebee9,null));};exports[_0x077d('0xab')]=function(_0x38558e,_0x36bfc7,_0xfaad35){return BPromise[_0x077d('0x9e')]()[_0x077d('0x2a')](function(){if(!_0x38558e[_0x077d('0x38')]['path']){throw new Error(_0x077d('0x9f'));}if(!_0x38558e['query'][_0x077d('0xa0')]){throw new Error(_0x077d('0xa1'));}var _0x482d29=_0x38558e[_0x077d('0x38')][_0x077d('0xa2')]?_0x38558e[_0x077d('0x38')][_0x077d('0xa2')]+':'+_0x38558e[_0x077d('0x38')]['port']:_0x077d('0xa3')+_0x38558e[_0x077d('0x38')][_0x077d('0xa0')];var _0x36abc6=_0x38558e[_0x077d('0x38')][_0x077d('0x21')]?_0x38558e['query'][_0x077d('0x21')]:!![];var _0x363fcf=_0x38558e[_0x077d('0x38')][_0x077d('0xa4')]?_0x38558e[_0x077d('0x38')][_0x077d('0xa4')]:null;var _0x4532a8={'method':_0x38558e['method'],'uri':util[_0x077d('0x63')]('%s%s',_0x482d29,_0x38558e[_0x077d('0x38')][_0x077d('0x50')]),'json':_0x36abc6,'resolveWithFullResponse':!![],'encoding':_0x363fcf,'body':_0x38558e[_0x077d('0x93')]};if(_0x38558e['headers']){_0x4532a8[_0x077d('0xa6')]=_0x38558e['headers'];if(_0x4532a8[_0x077d('0xa6')][_0x077d('0xa7')]){delete _0x4532a8[_0x077d('0xa6')][_0x077d('0xa7')];}}if(_0x4532a8['headers'][_0x077d('0xa8')]){delete _0x4532a8[_0x077d('0xa6')][_0x077d('0xa8')];}return rp(_0x4532a8);})['then'](function(_0x2812fc){if(_0x2812fc){_0x36bfc7[_0x077d('0x25')](_0x2812fc[_0x077d('0xa6')]);logger[_0x077d('0x66')](_0x2812fc[_0x077d('0x93')]);return _0x36bfc7['status'](_0x2812fc[_0x077d('0xa9')])[_0x077d('0x30')](_0x2812fc['body']);}else{return _0x36bfc7[_0x077d('0xaa')](0xc8);}})['catch'](handleError(_0x36bfc7,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index cd4d746..b1da46f 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 _0xa6bb=['update','emit','hook','exports','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x43d3db,_0x192606){var _0x346f2e=function(_0x2b9381){while(--_0x2b9381){_0x43d3db['push'](_0x43d3db['shift']());}};_0x346f2e(++_0x192606);}(_0xa6bb,0x12c));var _0xba6b=function(_0x9a0883,_0x87325b){_0x9a0883=_0x9a0883-0x0;var _0x41c406=_0xa6bb[_0x9a0883];return _0x41c406;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xba6b('0x0'))['db'][_0xba6b('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xba6b('0x2')](0x0);var events={'afterCreate':_0xba6b('0x3'),'afterUpdate':_0xba6b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52e835){return function(_0x5d1f87,_0x17e34b,_0x25733d){PluginEvents[_0xba6b('0x5')](_0x52e835+':'+_0x5d1f87['id'],_0x5d1f87);PluginEvents['emit'](_0x52e835,_0x5d1f87);_0x25733d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xba6b('0x6')](e,emitEvent(event));}}module[_0xba6b('0x7')]=PluginEvents; \ No newline at end of file +var _0x9aac=['hook','events','Plugin','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x9aac,0x135));var _0xc9aa=function(_0x4ca861,_0x5e0ea3){_0x4ca861=_0x4ca861-0x0;var _0x4c23fa=_0x9aac[_0x4ca861];return _0x4c23fa;};'use strict';var EventEmitter=require(_0xc9aa('0x0'));var Plugin=require('../../mysqldb')['db'][_0xc9aa('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc9aa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9aa('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8ca086){return function(_0x5c8ce2,_0x28c49c,_0x267772){PluginEvents['emit'](_0x8ca086+':'+_0x5c8ce2['id'],_0x5c8ce2);PluginEvents[_0xc9aa('0x4')](_0x8ca086,_0x5c8ce2);_0x267772(null);};}for(var e in events){if(events[_0xc9aa('0x5')](e)){var event=events[e];Plugin[_0xc9aa('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index cc94cd1..159863a 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 _0xfb82=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x17f050,_0x2cb1db){var _0xd28b90=function(_0x2fa453){while(--_0x2fa453){_0x17f050['push'](_0x17f050['shift']());}};_0xd28b90(++_0x2cb1db);}(_0xfb82,0x17f));var _0x2fb8=function(_0x170502,_0x4e3a90){_0x170502=_0x170502-0x0;var _0x343be3=_0xfb82[_0x170502];return _0x343be3;};'use strict';var _=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var logger=require(_0x2fb8('0x2'))('api');var moment=require(_0x2fb8('0x3'));var BPromise=require(_0x2fb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fb8('0x5'));var rimraf=require(_0x2fb8('0x6'));var config=require(_0x2fb8('0x7'));var attributes=require(_0x2fb8('0x8'));module[_0x2fb8('0x9')]=function(_0xe9a5b5,_0x3e6900){return _0xe9a5b5[_0x2fb8('0xa')](_0x2fb8('0xb'),attributes,{'tableName':_0x2fb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2083=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x5f0f85,_0x495212){var _0x3fa1ac=function(_0x4db9a2){while(--_0x4db9a2){_0x5f0f85['push'](_0x5f0f85['shift']());}};_0x3fa1ac(++_0x495212);}(_0x2083,0x137));var _0x3208=function(_0x41779,_0x545d56){_0x41779=_0x41779-0x0;var _0x48d1c4=_0x2083[_0x41779];return _0x48d1c4;};'use strict';var _=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));var logger=require(_0x3208('0x2'))(_0x3208('0x3'));var moment=require(_0x3208('0x4'));var BPromise=require(_0x3208('0x5'));var rp=require(_0x3208('0x6'));var fs=require('fs');var path=require(_0x3208('0x7'));var rimraf=require(_0x3208('0x8'));var config=require(_0x3208('0x9'));var attributes=require(_0x3208('0xa'));module['exports']=function(_0x4cefcc,_0x4938ea){return _0x4cefcc[_0x3208('0xb')](_0x3208('0xc'),attributes,{'tableName':_0x3208('0xd'),'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 3041d0e..67273c6 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 _0x0536=['stringify','error','message','Plugin,\x20%s,\x20%s','info','catch','CreatePlugin','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./plugin.socket','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x1be3e0,_0x41e201){var _0x5855b1=function(_0x1b12ce){while(--_0x1b12ce){_0x1be3e0['push'](_0x1be3e0['shift']());}};_0x5855b1(++_0x41e201);}(_0x0536,0xc6));var _0x6053=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0536[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6053('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6053('0x1'));var rs=require(_0x6053('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6053('0x3'))['db'];var utils=require(_0x6053('0x4'));var logger=require('../../config/logger')(_0x6053('0x5'));var config=require(_0x6053('0x6'));var jayson=require(_0x6053('0x7'));var client=jayson[_0x6053('0x8')][_0x6053('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6053('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6053('0xb'))(new Redis(config[_0x6053('0xa')]));require(_0x6053('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c30e9,_0xb51f0,_0x22d74c){return new BPromise(function(_0x10a6e5,_0x22f512){return client[_0x6053('0xd')](_0x3c30e9,_0x22d74c)[_0x6053('0xe')](function(_0x44a1ec){logger['info']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x6053('0xf'));logger[_0x6053('0x10')](_0x6053('0x11'),_0xb51f0,_0x6053('0xf'),JSON[_0x6053('0x12')](_0x44a1ec));if(_0x44a1ec[_0x6053('0x13')]){if(_0x44a1ec[_0x6053('0x13')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x44a1ec['error']['message']);return _0x22f512(_0x44a1ec[_0x6053('0x13')][_0x6053('0x14')]);}logger[_0x6053('0x13')](_0x6053('0x15'),_0xb51f0,_0x44a1ec['error'][_0x6053('0x14')]);return _0x10a6e5(_0x44a1ec[_0x6053('0x13')][_0x6053('0x14')]);}else{logger[_0x6053('0x16')]('Plugin,\x20%s,\x20%s',_0xb51f0,_0x6053('0xf'));_0x10a6e5(_0x44a1ec['result'][_0x6053('0x14')]);}})[_0x6053('0x17')](function(_0x3a3716){logger['error']('Plugin,\x20%s,\x20%s',_0xb51f0,_0x3a3716);_0x22f512(_0x3a3716);});});}exports[_0x6053('0x18')]=function(_0x1bd093){var _0x5afa01=this;return new Promise(function(_0x2d9099,_0x3e720c){return db['Plugin']['create'](_0x1bd093['body'],{'raw':_0x1bd093[_0x6053('0x19')]?_0x1bd093[_0x6053('0x19')][_0x6053('0x1a')]===undefined?!![]:![]:!![]})[_0x6053('0xe')](function(_0x357c79){logger[_0x6053('0x16')](_0x6053('0x18'),_0x1bd093);logger[_0x6053('0x10')](_0x6053('0x18'),_0x1bd093,JSON[_0x6053('0x12')](_0x357c79));_0x2d9099(_0x357c79);})['catch'](function(_0xc7fd39){logger[_0x6053('0x13')](_0x6053('0x18'),_0xc7fd39['message'],_0x1bd093);_0x3e720c(_0x5afa01[_0x6053('0x13')](0x1f4,_0xc7fd39[_0x6053('0x14')]));});});}; \ No newline at end of file +var _0xaee2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird'];(function(_0x476ca1,_0x3f9574){var _0x2abe72=function(_0x223383){while(--_0x223383){_0x476ca1['push'](_0x476ca1['shift']());}};_0x2abe72(++_0x3f9574);}(_0xaee2,0x150));var _0x2aee=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xaee2[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x2aee('0x0'));var util=require(_0x2aee('0x1'));var moment=require(_0x2aee('0x2'));var BPromise=require(_0x2aee('0x3'));var rs=require(_0x2aee('0x4'));var fs=require('fs');var Redis=require(_0x2aee('0x5'));var db=require(_0x2aee('0x6'))['db'];var utils=require(_0x2aee('0x7'));var logger=require(_0x2aee('0x8'))(_0x2aee('0x9'));var config=require(_0x2aee('0xa'));var jayson=require(_0x2aee('0xb'));var client=jayson[_0x2aee('0xc')][_0x2aee('0xd')]({'port':0x232a});config[_0x2aee('0xe')]=_[_0x2aee('0xf')](config['redis'],{'host':_0x2aee('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aee('0xe')]));require('./plugin.socket')[_0x2aee('0x11')](socket);function respondWithRpcPromise(_0x3b05d4,_0x2d67b0,_0x266b61){return new BPromise(function(_0xf6b62,_0x3688b9){return client['request'](_0x3b05d4,_0x266b61)[_0x2aee('0x12')](function(_0x3a877c){logger[_0x2aee('0x13')]('Plugin,\x20%s,\x20%s',_0x2d67b0,_0x2aee('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x2d67b0,_0x2aee('0x14'),JSON[_0x2aee('0x15')](_0x3a877c));if(_0x3a877c['error']){if(_0x3a877c[_0x2aee('0x16')][_0x2aee('0x17')]===0x1f4){logger[_0x2aee('0x16')](_0x2aee('0x18'),_0x2d67b0,_0x3a877c['error'][_0x2aee('0x19')]);return _0x3688b9(_0x3a877c[_0x2aee('0x16')][_0x2aee('0x19')]);}logger[_0x2aee('0x16')]('Plugin,\x20%s,\x20%s',_0x2d67b0,_0x3a877c['error']['message']);return _0xf6b62(_0x3a877c[_0x2aee('0x16')][_0x2aee('0x19')]);}else{logger[_0x2aee('0x13')](_0x2aee('0x18'),_0x2d67b0,_0x2aee('0x14'));_0xf6b62(_0x3a877c[_0x2aee('0x1a')][_0x2aee('0x19')]);}})[_0x2aee('0x1b')](function(_0x1745af){logger[_0x2aee('0x16')]('Plugin,\x20%s,\x20%s',_0x2d67b0,_0x1745af);_0x3688b9(_0x1745af);});});}exports['CreatePlugin']=function(_0x31213b){var _0x3c1e25=this;return new Promise(function(_0x19adb1,_0x53ec1b){return db[_0x2aee('0x1c')][_0x2aee('0x1d')](_0x31213b[_0x2aee('0x1e')],{'raw':_0x31213b[_0x2aee('0x1f')]?_0x31213b[_0x2aee('0x1f')][_0x2aee('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4dd670){logger[_0x2aee('0x13')](_0x2aee('0x21'),_0x31213b);logger['debug'](_0x2aee('0x21'),_0x31213b,JSON[_0x2aee('0x15')](_0x4dd670));_0x19adb1(_0x4dd670);})['catch'](function(_0x366200){logger[_0x2aee('0x16')](_0x2aee('0x21'),_0x366200[_0x2aee('0x19')],_0x31213b);_0x53ec1b(_0x3c1e25[_0x2aee('0x16')](0x1f4,_0x366200[_0x2aee('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e88c872..dc1599e 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 _0xd982=['removeListener','register','length','plugin:','save','remove','update','emit'];(function(_0x25b125,_0x3c33a0){var _0x141b47=function(_0x2eeea0){while(--_0x2eeea0){_0x25b125['push'](_0x25b125['shift']());}};_0x141b47(++_0x3c33a0);}(_0xd982,0x18c));var _0x2d98=function(_0x2eb0ba,_0x174584){_0x2eb0ba=_0x2eb0ba-0x0;var _0x109c0d=_0xd982[_0x2eb0ba];return _0x109c0d;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2d98('0x0'),_0x2d98('0x1'),_0x2d98('0x2')];function createListener(_0x5c3975,_0x3aefe4){return function(_0x1d79aa){_0x3aefe4[_0x2d98('0x3')](_0x5c3975,_0x1d79aa);};}function removeListener(_0x2b6808,_0x563d41){return function(){PluginEvents[_0x2d98('0x4')](_0x2b6808,_0x563d41);};}exports[_0x2d98('0x5')]=function(_0x2bf04b){for(var _0x427a41=0x0,_0x3b4a2f=events[_0x2d98('0x6')];_0x427a41<_0x3b4a2f;_0x427a41++){var _0x20d256=events[_0x427a41];var _0x2562e0=createListener(_0x2d98('0x7')+_0x20d256,_0x2bf04b);PluginEvents['on'](_0x20d256,_0x2562e0);}}; \ No newline at end of file +var _0x076b=['remove','update','emit','register','plugin:','save'];(function(_0x570eb9,_0x5d7a2e){var _0x1fa0fe=function(_0xba6a3){while(--_0xba6a3){_0x570eb9['push'](_0x570eb9['shift']());}};_0x1fa0fe(++_0x5d7a2e);}(_0x076b,0x1af));var _0xb076=function(_0x448d0a,_0x8cdde3){_0x448d0a=_0x448d0a-0x0;var _0x29899e=_0x076b[_0x448d0a];return _0x29899e;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xb076('0x0'),_0xb076('0x1'),_0xb076('0x2')];function createListener(_0x44d508,_0x331f51){return function(_0x4df113){_0x331f51[_0xb076('0x3')](_0x44d508,_0x4df113);};}function removeListener(_0x41e750,_0x35b8a2){return function(){PluginEvents['removeListener'](_0x41e750,_0x35b8a2);};}exports[_0xb076('0x4')]=function(_0x598345){for(var _0x1211ae=0x0,_0x5cb06b=events['length'];_0x1211ae<_0x5cb06b;_0x1211ae++){var _0x2ab0c0=events[_0x1211ae];var _0x55be10=createListener(_0xb076('0x5')+_0x2ab0c0,_0x598345);PluginEvents['on'](_0x2ab0c0,_0x55be10);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index a6f6c2b..f88fb79 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(_0x39aba5,_0x55de65){var _0x4a08df=function(_0x5df3e6){while(--_0x5df3e6){_0x39aba5['push'](_0x39aba5['shift']());}};_0x4a08df(++_0x55de65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x158b7e,_0x308a51){var _0x328415=function(_0x506be8){while(--_0x506be8){_0x158b7e['push'](_0x158b7e['shift']());}};_0x328415(++_0x308a51);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 4f93f8d..f57040f 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 _0xf72b=['hasOwnProperty','Unknown\x20status','destroy','params','delete','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','json','stack','name','npm\x20install','info','index','then','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xf72b,0x1d9));var _0xbf72=function(_0x12e1bb,_0xae6d9f){_0x12e1bb=_0x12e1bb-0x0;var _0x336b5f=_0xf72b[_0x12e1bb];return _0x336b5f;};'use strict';var _=require(_0xbf72('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbf72('0x1'))('api');var path=require(_0xbf72('0x2'));var exec=require(_0xbf72('0x3'))['exec'];var BPromise=require(_0xbf72('0x4'));function handleEntityNotFound(_0x550a9e,_0x37afc8){return function(_0x3d3a6f){if(!_0x3d3a6f){_0x550a9e[_0xbf72('0x5')](0x194);;}return _0x3d3a6f;};}function respondWithResult(_0x2b8440,_0x5ee060){_0x5ee060=_0x5ee060||0xc8;return function(_0x41c11d){if(_0x41c11d){return _0x2b8440[_0xbf72('0x6')](_0x5ee060)[_0xbf72('0x7')](_0x41c11d);}return null;};}function handleError(_0xd0402c,_0xdd6177){_0xdd6177=_0xdd6177||0x1f4;return function(_0x1b6d38){logger['error'](_0x1b6d38[_0xbf72('0x8')]);if(_0x1b6d38['name']){delete _0x1b6d38[_0xbf72('0x9')];}_0xd0402c[_0xbf72('0x6')](_0xdd6177)['send'](_0x1b6d38);};}function execChildProcess(){return new BPromise(function(_0xaec095,_0x1c3453){exec(_0xbf72('0xa'),function(_0x145acb,_0x2957c5,_0x44ce73){logger[_0xbf72('0xb')](_0x2957c5);logger[_0xbf72('0xb')](_0x44ce73);if(_0x145acb){logger['error'](_0x145acb);return _0x1c3453(_0x145acb);}return _0xaec095(_0x2957c5);});});}exports[_0xbf72('0xc')]=function(_0x227a35,_0x57cccf){return pm2['list']()[_0xbf72('0xd')](function(_0x4f4fa5){if(_0x4f4fa5){var _0x5625b3=_['reject'](_0x4f4fa5,function(_0x32a0a5){return _0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xe')||_0x32a0a5[_0xbf72('0x9')]===_0xbf72('0xf');});return{'rows':_0x5625b3,'count':_0x5625b3[_0xbf72('0x10')]};}return null;})['then'](respondWithResult(_0x57cccf,null))[_0xbf72('0x11')](handleError(_0x57cccf,null));};exports[_0xbf72('0x12')]=function(_0x2a8609,_0x3d4dea){return pm2[_0xbf72('0x13')](_0x2a8609['params']['id'])['then'](respondWithResult(_0x3d4dea,null))[_0xbf72('0xd')](handleEntityNotFound(_0x3d4dea,null))[_0xbf72('0x11')](handleError(_0x3d4dea,null));};exports[_0xbf72('0x14')]=function(_0x2584d9,_0x27e58e){if(_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')]&&_0x2584d9['body'][_0xbf72('0x16')]){var _0x42a193=path[_0xbf72('0x17')](__dirname,_0xbf72('0x18'),_0x2584d9[_0xbf72('0x15')]['script']);var _0x3cd181=process[_0xbf72('0x19')]();process['chdir'](path[_0xbf72('0x1a')](_0x42a193));return execChildProcess()[_0xbf72('0xd')](function(_0x267c41){process['chdir'](_0x3cd181);return pm2[_0xbf72('0x1b')]({'name':_0x2584d9[_0xbf72('0x15')][_0xbf72('0x9')],'script':_0x42a193});})[_0xbf72('0xd')](function(_0x4f4dc0){pm2[_0xbf72('0x1c')]();return _0x4f4dc0[0x0];})[_0xbf72('0xd')](respondWithResult(_0x27e58e,0xc9))[_0xbf72('0x11')](handleError(_0x27e58e,null));}else{return _0x27e58e['status'](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x1e')});}};exports[_0xbf72('0x1f')]=function(_0x1a2f55,_0x15d60d){if(_0x1a2f55[_0xbf72('0x15')]['id']){delete _0x1a2f55[_0xbf72('0x15')]['id'];}var _0x25ecdf={'online':_0xbf72('0x20'),'stopped':_0xbf72('0x21')};if(_0x25ecdf[_0xbf72('0x22')](_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')])){return pm2[_0x25ecdf[_0x1a2f55[_0xbf72('0x15')][_0xbf72('0x6')]]](_0x1a2f55['params']['id'])[_0xbf72('0xd')](respondWithResult(_0x15d60d,0xc8))[_0xbf72('0x11')](handleError(_0x15d60d,null));}else{return _0x15d60d[_0xbf72('0x6')](0x1f4)[_0xbf72('0x1d')]({'message':_0xbf72('0x23')});}};exports[_0xbf72('0x24')]=function(_0x35ecdc,_0x209b2b){if(_0x35ecdc[_0xbf72('0x15')]['id']){delete _0x35ecdc[_0xbf72('0x15')]['id'];}if(_0x35ecdc[_0xbf72('0x25')]['id']){return pm2[_0xbf72('0x26')](_0x35ecdc[_0xbf72('0x25')]['id'])[_0xbf72('0xd')](function(_0x4e2472){pm2[_0xbf72('0x1c')]();return _0x4e2472[0x0];})[_0xbf72('0xd')](respondWithResult(_0x209b2b,null))[_0xbf72('0x11')](handleError(_0x209b2b,null));}else{return _0x209b2b['status'](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x2f68=['dump','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','sendStatus','status','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','restart','stop','Unknown\x20status','destroy','delete'];(function(_0x3a5091,_0x3dcdbd){var _0x74d0d1=function(_0x12bcec){while(--_0x12bcec){_0x3a5091['push'](_0x3a5091['shift']());}};_0x74d0d1(++_0x3dcdbd);}(_0x2f68,0x9a));var _0x82f6=function(_0x56daf0,_0x56cd09){_0x56daf0=_0x56daf0-0x0;var _0x4fd648=_0x2f68[_0x56daf0];return _0x4fd648;};'use strict';var _=require('lodash');var pm2=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var path=require(_0x82f6('0x3'));var exec=require('child_process')[_0x82f6('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x2a06dc,_0x2ab73d){return function(_0x5dad09){if(!_0x5dad09){_0x2a06dc[_0x82f6('0x5')](0x194);;}return _0x5dad09;};}function respondWithResult(_0x2c4302,_0x542737){_0x542737=_0x542737||0xc8;return function(_0x5a8089){if(_0x5a8089){return _0x2c4302[_0x82f6('0x6')](_0x542737)['json'](_0x5a8089);}return null;};}function handleError(_0x5daa3c,_0x864400){_0x864400=_0x864400||0x1f4;return function(_0xbd30d5){logger[_0x82f6('0x7')](_0xbd30d5['stack']);if(_0xbd30d5[_0x82f6('0x8')]){delete _0xbd30d5[_0x82f6('0x8')];}_0x5daa3c['status'](_0x864400)[_0x82f6('0x9')](_0xbd30d5);};}function execChildProcess(){return new BPromise(function(_0x1eec2f,_0x3f8320){exec(_0x82f6('0xa'),function(_0x1a68c4,_0x34bd7c,_0x4c870e){logger[_0x82f6('0xb')](_0x34bd7c);logger[_0x82f6('0xb')](_0x4c870e);if(_0x1a68c4){logger['error'](_0x1a68c4);return _0x3f8320(_0x1a68c4);}return _0x1eec2f(_0x34bd7c);});});}exports[_0x82f6('0xc')]=function(_0x1f8bf5,_0x397527){return pm2[_0x82f6('0xd')]()[_0x82f6('0xe')](function(_0xa00275){if(_0xa00275){var _0x115c7b=_[_0x82f6('0xf')](_0xa00275,function(_0x1e7cbc){return _0x1e7cbc['name']===_0x82f6('0x10')||_0x1e7cbc['name']===_0x82f6('0x11');});return{'rows':_0x115c7b,'count':_0x115c7b[_0x82f6('0x12')]};}return null;})[_0x82f6('0xe')](respondWithResult(_0x397527,null))[_0x82f6('0x13')](handleError(_0x397527,null));};exports[_0x82f6('0x14')]=function(_0x2326ae,_0x326378){return pm2[_0x82f6('0x15')](_0x2326ae[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x326378,null))[_0x82f6('0xe')](handleEntityNotFound(_0x326378,null))[_0x82f6('0x13')](handleError(_0x326378,null));};exports[_0x82f6('0x17')]=function(_0x4fe226,_0x3a8269){if(_0x4fe226['body'][_0x82f6('0x8')]&&_0x4fe226[_0x82f6('0x18')]['script']){var _0x2b03ad=path[_0x82f6('0x19')](__dirname,_0x82f6('0x1a'),_0x4fe226[_0x82f6('0x18')]['script']);var _0xdc4dea=process['cwd']();process[_0x82f6('0x1b')](path[_0x82f6('0x1c')](_0x2b03ad));return execChildProcess()['then'](function(_0x516deb){process[_0x82f6('0x1b')](_0xdc4dea);return pm2[_0x82f6('0x1d')]({'name':_0x4fe226['body']['name'],'script':_0x2b03ad});})[_0x82f6('0xe')](function(_0x31face){pm2['dump']();return _0x31face[0x0];})[_0x82f6('0xe')](respondWithResult(_0x3a8269,0xc9))[_0x82f6('0x13')](handleError(_0x3a8269,null));}else{return _0x3a8269['status'](0x1f4)['send']({'message':_0x82f6('0x1e')});}};exports['update']=function(_0x469b6b,_0x5a6d69){if(_0x469b6b['body']['id']){delete _0x469b6b[_0x82f6('0x18')]['id'];}var _0x15c9b7={'online':_0x82f6('0x1f'),'stopped':_0x82f6('0x20')};if(_0x15c9b7['hasOwnProperty'](_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')])){return pm2[_0x15c9b7[_0x469b6b[_0x82f6('0x18')][_0x82f6('0x6')]]](_0x469b6b[_0x82f6('0x16')]['id'])[_0x82f6('0xe')](respondWithResult(_0x5a6d69,0xc8))[_0x82f6('0x13')](handleError(_0x5a6d69,null));}else{return _0x5a6d69[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x21')});}};exports[_0x82f6('0x22')]=function(_0x20d1c5,_0x6ce179){if(_0x20d1c5[_0x82f6('0x18')]['id']){delete _0x20d1c5['body']['id'];}if(_0x20d1c5[_0x82f6('0x16')]['id']){return pm2[_0x82f6('0x23')](_0x20d1c5[_0x82f6('0x16')]['id'])['then'](function(_0x36f37a){pm2[_0x82f6('0x24')]();return _0x36f37a[0x0];})[_0x82f6('0xe')](respondWithResult(_0x6ce179,null))[_0x82f6('0x13')](handleError(_0x6ce179,null));}else{return _0x6ce179[_0x82f6('0x6')](0x1f4)[_0x82f6('0x9')]({'message':_0x82f6('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d675de3..784af6d 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 _0x9075=['/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','get'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x9075,0x13c));var _0x5907=function(_0x53263b,_0x299c08){_0x53263b=_0x53263b-0x0;var _0x3fd94b=_0x9075[_0x53263b];return _0x3fd94b;};'use strict';var express=require(_0x5907('0x0'));var router=express[_0x5907('0x1')]();var auth=require(_0x5907('0x2'));var controller=require('./realtime.controller');router[_0x5907('0x3')](_0x5907('0x4'),auth[_0x5907('0x5')](),controller[_0x5907('0x6')]);router[_0x5907('0x3')](_0x5907('0x7'),auth[_0x5907('0x5')](),controller[_0x5907('0x8')]);module[_0x5907('0x9')]=router; \ No newline at end of file +var _0xabb0=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues'];(function(_0x67b075,_0x43557d){var _0x39d030=function(_0x4f25e1){while(--_0x4f25e1){_0x67b075['push'](_0x67b075['shift']());}};_0x39d030(++_0x43557d);}(_0xabb0,0x86));var _0x0abb=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xabb0[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x0abb('0x0'));var router=express[_0x0abb('0x1')]();var auth=require(_0x0abb('0x2'));var controller=require(_0x0abb('0x3'));router[_0x0abb('0x4')](_0x0abb('0x5'),auth[_0x0abb('0x6')](),controller[_0x0abb('0x7')]);router[_0x0abb('0x4')](_0x0abb('0x8'),auth[_0x0abb('0x6')](),controller[_0x0abb('0x9')]);module[_0x0abb('0xa')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8be4ced..b2ed8d2 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 _0x950d=['role','agent','online','raw','literal','FIELD(id,','forEach','push','Pause','where','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','getAgentStatus','sortAgentsByStatus','fields','catch','getQueues','startCase','Queue','key','outbound','dialActive','dialMethod','voice','QueueCampaigns','Queues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','Content-Range','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','rows','length','map','User','rawAttributes','fieldName','type'];(function(_0x296f1c,_0x31f7c7){var _0x12056f=function(_0x38c7b0){while(--_0x38c7b0){_0x296f1c['push'](_0x296f1c['shift']());}};_0x12056f(++_0x31f7c7);}(_0x950d,0x151));var _0xd950=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x950d[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xd950('0x0'));var util=require(_0xd950('0x1'));var rta=require(_0xd950('0x2'));var rtq=require(_0xd950('0x3'));var qs=require(_0xd950('0x4'));var utils=require(_0xd950('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xd950('0x6'))[_0xd950('0x7')];var APIHandleError=require(_0xd950('0x6'))[_0xd950('0x8')];function respondWithFilteredResult(_0x1acf91,_0x1bd99f){return function(_0x37c70c){if(_0x37c70c){var _0x47ee5b=typeof _0x1bd99f[_0xd950('0x9')]===_0xd950('0xa')&&typeof _0x1bd99f[_0xd950('0xb')]==='undefined';var _0x46a7b1=_0x37c70c[_0xd950('0xc')];var _0x5789a7=_0x47ee5b?0x0:_0x1bd99f[_0xd950('0x9')];var _0x17a1f9=_0x47ee5b?_0x37c70c['count']:_0x1bd99f['offset']+_0x1bd99f[_0xd950('0xb')];var _0x221b34;if(_0x17a1f9>=_0x46a7b1){_0x17a1f9=_0x46a7b1;_0x221b34=0xc8;}else{_0x221b34=0xce;}_0x1acf91[_0xd950('0xd')](_0x221b34);return _0x1acf91['set'](_0xd950('0xe'),_0x5789a7+'-'+_0x17a1f9+'/'+_0x46a7b1)[_0xd950('0xf')](_0x37c70c);}return null;};}exports['getAgents']=function(_0x4c4634,_0x2f5309){var _0x18d367={'count':0x0,'rows':[]};var _0x464bdf={};var _0x26c6a3;var _0x3a4ba5=utils[_0xd950('0x10')]();var _0x308873;var _0x40cc12;var _0x4a8efa=_0x4c4634[_0xd950('0x11')][_0xd950('0x12')];var _0x20af5b=_0x4c4634[_0xd950('0x11')][_0xd950('0x13')];var _0x42e4a1=_0x4c4634['query'][_0xd950('0x14')];var _0xcafa25=_0x20af5b===_0xd950('0x15')||_0x20af5b==='*pause'?!![]:![];var _0x26fa68=[];var _0x1f5906;var _0x83abb7;Promise[_0xd950('0x16')]()[_0xd950('0x17')](function(){if(_0x4c4634[_0xd950('0x11')][_0xd950('0x18')]){if(!utils[_0xd950('0x19')](_0x4c4634[_0xd950('0x11')][_0xd950('0x18')])){throw new APIBadRequestError(util[_0xd950('0x1a')](_0xd950('0x1b'),_0x4c4634[_0xd950('0x11')]['channel']));}_0x26c6a3=_0x4c4634[_0xd950('0x11')][_0xd950('0x18')][_0xd950('0x1c')]();}if(!_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]||!_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]['includes'](_0xd950('0x1e'))){_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]=rta[_0xd950('0x1f')](_0x4c4634['query'][_0xd950('0x1d')]);return;}var _0x4ad17c=rta[_0xd950('0x20')](_0x4c4634[_0xd950('0x11')][_0xd950('0x1d')]);_0x4c4634[_0xd950('0x11')]['sort']=_0x4ad17c['fields'][_0xd950('0x21')](',');_0x1f5906=_0x4ad17c[_0xd950('0x22')];})[_0xd950('0x17')](function(){if(!_0x4a8efa){return[];}return rta[_0xd950('0x23')](_0x4a8efa,_0x26c6a3);})[_0xd950('0x17')](function(_0x105856){_0x26fa68=_0x105856;return rta['getRealtimeAgents']();})[_0xd950('0x17')](function(_0x125045){_0x40cc12=_0x125045[_0xd950('0x24')];if((!_0x20af5b||_0xcafa25)&&!_0x1f5906){return _0x26fa68;}if(_0x1f5906&&!_0x20af5b){return rta['getSortedAgentsIdsByStatus'](_0x40cc12,_0x26fa68,_0x1f5906);}else{return rta['getAgentIdsByStatus'](_0x40cc12,_0x26fa68,_0x20af5b);}})['then'](function(_0x3093d9){_0x26fa68=_0x3093d9;var _0x1551d2=![];if(_0x26fa68[_0xd950('0x25')]===0x0){if(_0x4a8efa||_0x20af5b){_0x1551d2=!![];}if(_0xcafa25){_0x1551d2=![];}}if(_0x1551d2){return _0x18d367;}var _0x2e4899=_[_0xd950('0x26')](db[_0xd950('0x27')][_0xd950('0x28')],function(_0x1e8bf3){return{'name':_0x1e8bf3[_0xd950('0x29')],'type':_0x1e8bf3[_0xd950('0x2a')]['key']};});_0x4c4634['query'][_0xd950('0x2b')]=_0xd950('0x2c');_0x4c4634[_0xd950('0x11')][_0xd950('0x2d')]=!![];_0x464bdf=qs['getOptions'](_0x2e4899,_0x4c4634);_0x464bdf[_0xd950('0x2e')]=!![];var _0x5e860f=[];if(_0x26fa68[_0xd950('0x25')]>0x0){_0x5e860f['push']({'id':{'$in':_0x26fa68}});if(_0x1f5906&&!_0x20af5b){_0x83abb7=[db['sequelize'][_0xd950('0x2f')](_0xd950('0x30')+_0x26fa68+')')];_0x464bdf['order']=_0x83abb7;}}if(_0xcafa25){_0x3a4ba5[_0xd950('0x31')](function(_0xea3f3a){var _0x24a69f=!![];if(_0x20af5b==='*pause'&&_0x26c6a3!==_0xea3f3a){_0x24a69f=![];}_0x5e860f[_0xd950('0x32')]({[_0xea3f3a+_0xd950('0x33')]:_0x24a69f});});if(_0x42e4a1){_0x5e860f[_0xd950('0x32')]({'pauseType':_0x42e4a1});}}else if(_0x20af5b){_0x3a4ba5['forEach'](function(_0xa21154){_0x5e860f[_0xd950('0x32')]({[_0xa21154+_0xd950('0x33')]:![]});});}_0x464bdf['where']=_['merge'](_0x464bdf[_0xd950('0x34')],{'$and':_0x5e860f});if(_0x4c4634[_0xd950('0x35')][_0xd950('0x2b')]===_0xd950('0x35')){var _0x286044={'params':{'id':_0x4c4634[_0xd950('0x35')][_0xd950('0x36')]},'query':{'section':'Agents','role':_0xd950('0x2c'),'online':!![],'raw':!![],'ids':_0x26fa68,'customSorting':_0x83abb7}};if(_0xcafa25){_0x286044[_0xd950('0x11')][_0xd950('0x37')]=_0x5e860f;}_0x286044['query']=Object[_0xd950('0x38')](_0x286044[_0xd950('0x11')],_0x4c4634[_0xd950('0x11')]);delete _0x286044[_0xd950('0x11')]['id'];return db[_0xd950('0x39')][_0xd950('0x3a')](_0x286044);}return db[_0xd950('0x27')][_0xd950('0x3b')](_0x464bdf);})[_0xd950('0x17')](function(_0x4406e7){_0x18d367[_0xd950('0xc')]=_0x4406e7[_0xd950('0xc')];_0x308873=_0x4406e7['rows'];return _0x308873[_0xd950('0x26')](function(_0x2c836d){var _0x4fba45=_[_0xd950('0x3c')](_0x40cc12,['id',_0x2c836d['id']]);if(_0x4fba45){var _0x245be3=rta[_0xd950('0x3d')](_0x4fba45);_['merge'](_0x2c836d,_0x245be3);}_0x2c836d[_0xd950('0x1e')]=rta[_0xd950('0x3e')](_0x2c836d);if(_0x2c836d[_0xd950('0x1e')]['includes'](_0xd950('0x15'))){_0x3a4ba5[_0xd950('0x31')](function(_0x333fb9){if(_0x2c836d[_0x333fb9+_0xd950('0x33')]){_0x2c836d[_0x333fb9+'Status']=_0xd950('0x15');}});}return _0x2c836d;});})[_0xd950('0x17')](function(_0xde763){if(!_0x1f5906||_0x83abb7){return _0xde763;}return rta[_0xd950('0x3f')](_0xde763,_0x1f5906);})[_0xd950('0x17')](function(_0x2e5518){var _0x1219f3=null;if(_0x4c4634[_0xd950('0x11')][_0xd950('0x40')]){var _0x26f357=_0x4c4634[_0xd950('0x11')]['fields']['split'](',');_0x1219f3=_0x2e5518[_0xd950('0x26')](function(_0x54e69a){return _['pick'](_0x54e69a,_0x26f357);});}_0x18d367[_0xd950('0x24')]=_0x1219f3||_0x2e5518;return _0x18d367;})[_0xd950('0x17')](respondWithFilteredResult(_0x2f5309,_0x464bdf))[_0xd950('0x41')](APIHandleError(_0x2f5309));};exports[_0xd950('0x42')]=function(_0x2c6ee0,_0x108380){var _0xbf97c0={'count':0x0,'rows':[]};var _0x525ad4={};var _0x1fa849;var _0x157a3a;var _0x1d401e;Promise[_0xd950('0x16')]()[_0xd950('0x17')](function(){if(_0x2c6ee0[_0xd950('0x11')]['channel']){if(!utils[_0xd950('0x19')](_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')])){throw new APIBadRequestError(util[_0xd950('0x1a')](_0xd950('0x1b'),_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')]));}_0x1fa849=_0x2c6ee0[_0xd950('0x11')][_0xd950('0x18')][_0xd950('0x1c')]();}var _0x585055=_[_0xd950('0x43')](_0x1fa849)+_0xd950('0x44');var _0x67a901=_['map'](db[_0x585055][_0xd950('0x28')],function(_0x38dcaf){return{'name':_0x38dcaf[_0xd950('0x29')],'type':_0x38dcaf[_0xd950('0x2a')][_0xd950('0x45')]};});if(!_0x2c6ee0[_0xd950('0x11')][_0xd950('0x40')]){var _0x332299=['id','name'];if(_0x1fa849==='voice'){_0x332299[_0xd950('0x32')](_0xd950('0x2a'));if(_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]===_0xd950('0x46')){_0x332299[_0xd950('0x32')]([_0xd950('0x47'),_0xd950('0x48')]);}}_0x2c6ee0[_0xd950('0x11')][_0xd950('0x40')]=_0x332299['join'](',');}_0x525ad4=qs['getOptions'](_0x67a901,_0x2c6ee0);if(_0x2c6ee0[_0xd950('0x35')][_0xd950('0x2b')]==='user'){var _0x588acf={'params':{'id':_0x2c6ee0[_0xd950('0x35')]['userProfileId']},'query':{'section':_0x1fa849===_0xd950('0x49')&&_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]===_0xd950('0x46')?_0xd950('0x4a'):_[_0xd950('0x43')](_0x1fa849)+_0xd950('0x4b'),'type':_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')],'nolimit':!![],'sort':'name','filter':_0x2c6ee0[_0xd950('0x11')]['filter']}};return db[_0xd950('0x39')][_0xd950('0x3a')](_0x588acf);}return db[_0x585055][_0xd950('0x3b')](_0x525ad4);})[_0xd950('0x17')](function(_0x590d19){_0xbf97c0[_0xd950('0xc')]=_0x590d19['count'];_0x157a3a=_0x590d19['rows'];return rtq['getRealtimeQueues'](_0x2c6ee0,_0x1fa849);})[_0xd950('0x17')](function(_0x38db4e){_0x1d401e=_0x38db4e[_0xd950('0x24')];return rtq['initializeQueues'](_0x157a3a,_0x1d401e,_0x1fa849,_0x2c6ee0[_0xd950('0x11')][_0xd950('0x2a')]);})['then'](function(_0xcf448d){_0xbf97c0[_0xd950('0x24')]=_0xcf448d;return _0xbf97c0;})[_0xd950('0x17')](respondWithFilteredResult(_0x108380,_0x525ad4))[_0xd950('0x41')](APIHandleError(_0x108380));}; \ No newline at end of file +var _0xe1ec=['Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','count','map','find','globalStatus','getAgentStatus','includes','Status','sortAgentsByStatus','split','pick','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','startCase','Queue','rawAttributes','fieldName','dialMethod','voice','outbound','QueueCampaigns','Queues','name','getRealtimeQueues','initializeQueues','catch','lodash','util','../../config/utils','../../errors/api','offset','undefined','limit','status','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','channel','format','sort','validateSortParameter','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','type','agent','online','raw','push','sequelize','literal','FIELD(id,','*pause','Pause','forEach','where','merge','user','role','userProfileId'];(function(_0x1e685e,_0x2f602e){var _0x505656=function(_0x36a822){while(--_0x36a822){_0x1e685e['push'](_0x1e685e['shift']());}};_0x505656(++_0x2f602e);}(_0xe1ec,0x72));var _0xce1e=function(_0x43ee59,_0x45febc){_0x43ee59=_0x43ee59-0x0;var _0x2699fe=_0xe1ec[_0x43ee59];return _0x2699fe;};'use strict';var _=require(_0xce1e('0x0'));var util=require(_0xce1e('0x1'));var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0xce1e('0x2'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APIHandleError=require(_0xce1e('0x3'))['handleError'];function respondWithFilteredResult(_0x2ef6c6,_0x79cc7a){return function(_0x4c995f){if(_0x4c995f){var _0x3a5787=typeof _0x79cc7a[_0xce1e('0x4')]===_0xce1e('0x5')&&typeof _0x79cc7a[_0xce1e('0x6')]===_0xce1e('0x5');var _0x246a89=_0x4c995f['count'];var _0x5c0ac8=_0x3a5787?0x0:_0x79cc7a[_0xce1e('0x4')];var _0x2c08aa=_0x3a5787?_0x4c995f['count']:_0x79cc7a[_0xce1e('0x4')]+_0x79cc7a['limit'];var _0xde833a;if(_0x2c08aa>=_0x246a89){_0x2c08aa=_0x246a89;_0xde833a=0xc8;}else{_0xde833a=0xce;}_0x2ef6c6[_0xce1e('0x7')](_0xde833a);return _0x2ef6c6['set'](_0xce1e('0x8'),_0x5c0ac8+'-'+_0x2c08aa+'/'+_0x246a89)[_0xce1e('0x9')](_0x4c995f);}return null;};}exports[_0xce1e('0xa')]=function(_0x30c352,_0xe6c01){var _0x545e31={'count':0x0,'rows':[]};var _0x3f034b={};var _0x15a63c;var _0x349ba6=utils[_0xce1e('0xb')]();var _0x5a7185;var _0xe1a912;var _0x31a646=_0x30c352[_0xce1e('0xc')][_0xce1e('0xd')];var _0x173805=_0x30c352[_0xce1e('0xc')][_0xce1e('0xe')];var _0x20c743=_0x30c352['query'][_0xce1e('0xf')];var _0xbd1f41=_0x173805===_0xce1e('0x10')||_0x173805==='*pause'?!![]:![];var _0x2d933a=[];var _0x18d820;var _0x5dae93;Promise[_0xce1e('0x11')]()['then'](function(){if(_0x30c352['query'][_0xce1e('0x12')]){if(!utils['isValidChannel'](_0x30c352['query'][_0xce1e('0x12')])){throw new APIBadRequestError(util[_0xce1e('0x13')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x30c352[_0xce1e('0xc')][_0xce1e('0x12')]));}_0x15a63c=_0x30c352['query'][_0xce1e('0x12')]['toLowerCase']();}if(!_0x30c352[_0xce1e('0xc')][_0xce1e('0x14')]||!_0x30c352[_0xce1e('0xc')][_0xce1e('0x14')]['includes']('globalStatus')){_0x30c352[_0xce1e('0xc')][_0xce1e('0x14')]=rta[_0xce1e('0x15')](_0x30c352[_0xce1e('0xc')][_0xce1e('0x14')]);return;}var _0x1abb9e=rta[_0xce1e('0x16')](_0x30c352[_0xce1e('0xc')][_0xce1e('0x14')]);_0x30c352['query']['sort']=_0x1abb9e[_0xce1e('0x17')][_0xce1e('0x18')](',');_0x18d820=_0x1abb9e[_0xce1e('0x19')];})[_0xce1e('0x1a')](function(){if(!_0x31a646){return[];}return rta[_0xce1e('0x1b')](_0x31a646,_0x15a63c);})[_0xce1e('0x1a')](function(_0x53b9c2){_0x2d933a=_0x53b9c2;return rta[_0xce1e('0x1c')]();})['then'](function(_0x900a0){_0xe1a912=_0x900a0[_0xce1e('0x1d')];if((!_0x173805||_0xbd1f41)&&!_0x18d820){return _0x2d933a;}if(_0x18d820&&!_0x173805){return rta[_0xce1e('0x1e')](_0xe1a912,_0x2d933a,_0x18d820);}else{return rta[_0xce1e('0x1f')](_0xe1a912,_0x2d933a,_0x173805);}})[_0xce1e('0x1a')](function(_0x9b75b3){_0x2d933a=_0x9b75b3;var _0x1867bd=![];if(_0x2d933a[_0xce1e('0x20')]===0x0){if(_0x31a646||_0x173805){_0x1867bd=!![];}if(_0xbd1f41){_0x1867bd=![];}}if(_0x1867bd){return _0x545e31;}var _0x5cd462=_['map'](db[_0xce1e('0x21')]['rawAttributes'],function(_0x3acc56){return{'name':_0x3acc56['fieldName'],'type':_0x3acc56[_0xce1e('0x22')]['key']};});_0x30c352['query']['role']=_0xce1e('0x23');_0x30c352[_0xce1e('0xc')][_0xce1e('0x24')]=!![];_0x3f034b=qs['getOptions'](_0x5cd462,_0x30c352);_0x3f034b[_0xce1e('0x25')]=!![];var _0x549e81=[];if(_0x2d933a[_0xce1e('0x20')]>0x0){_0x549e81[_0xce1e('0x26')]({'id':{'$in':_0x2d933a}});if(_0x18d820&&!_0x173805){_0x5dae93=[db[_0xce1e('0x27')][_0xce1e('0x28')](_0xce1e('0x29')+_0x2d933a+')')];_0x3f034b[_0xce1e('0x19')]=_0x5dae93;}}if(_0xbd1f41){_0x349ba6['forEach'](function(_0x2f716f){var _0x4adcc0=!![];if(_0x173805===_0xce1e('0x2a')&&_0x15a63c!==_0x2f716f){_0x4adcc0=![];}_0x549e81[_0xce1e('0x26')]({[_0x2f716f+_0xce1e('0x2b')]:_0x4adcc0});});if(_0x20c743){_0x549e81[_0xce1e('0x26')]({'pauseType':_0x20c743});}}else if(_0x173805){_0x349ba6[_0xce1e('0x2c')](function(_0x23ce28){_0x549e81['push']({[_0x23ce28+_0xce1e('0x2b')]:![]});});}_0x3f034b[_0xce1e('0x2d')]=_[_0xce1e('0x2e')](_0x3f034b['where'],{'$and':_0x549e81});if(_0x30c352[_0xce1e('0x2f')][_0xce1e('0x30')]===_0xce1e('0x2f')){var _0x2553a9={'params':{'id':_0x30c352[_0xce1e('0x2f')][_0xce1e('0x31')]},'query':{'section':_0xce1e('0x32'),'role':_0xce1e('0x23'),'online':!![],'raw':!![],'ids':_0x2d933a,'customSorting':_0x5dae93}};if(_0xbd1f41){_0x2553a9[_0xce1e('0xc')][_0xce1e('0x33')]=_0x549e81;}_0x2553a9[_0xce1e('0xc')]=Object[_0xce1e('0x34')](_0x2553a9[_0xce1e('0xc')],_0x30c352[_0xce1e('0xc')]);delete _0x2553a9[_0xce1e('0xc')]['id'];return db[_0xce1e('0x35')][_0xce1e('0x36')](_0x2553a9);}return db[_0xce1e('0x21')][_0xce1e('0x37')](_0x3f034b);})[_0xce1e('0x1a')](function(_0x42ed9c){_0x545e31[_0xce1e('0x38')]=_0x42ed9c['count'];_0x5a7185=_0x42ed9c[_0xce1e('0x1d')];return _0x5a7185[_0xce1e('0x39')](function(_0x505814){var _0x545681=_[_0xce1e('0x3a')](_0xe1a912,['id',_0x505814['id']]);if(_0x545681){var _0x51d6f7=rta['filterAgentAttributes'](_0x545681);_[_0xce1e('0x2e')](_0x505814,_0x51d6f7);}_0x505814[_0xce1e('0x3b')]=rta[_0xce1e('0x3c')](_0x505814);if(_0x505814[_0xce1e('0x3b')][_0xce1e('0x3d')](_0xce1e('0x10'))){_0x349ba6[_0xce1e('0x2c')](function(_0x455bc5){if(_0x505814[_0x455bc5+_0xce1e('0x2b')]){_0x505814[_0x455bc5+_0xce1e('0x3e')]='pause';}});}return _0x505814;});})['then'](function(_0x599f3b){if(!_0x18d820||_0x5dae93){return _0x599f3b;}return rta[_0xce1e('0x3f')](_0x599f3b,_0x18d820);})[_0xce1e('0x1a')](function(_0x4cc993){var _0x1e2f09=null;if(_0x30c352[_0xce1e('0xc')][_0xce1e('0x17')]){var _0x271cb9=_0x30c352['query']['fields'][_0xce1e('0x40')](',');_0x1e2f09=_0x4cc993['map'](function(_0x5e69b2){return _[_0xce1e('0x41')](_0x5e69b2,_0x271cb9);});}_0x545e31[_0xce1e('0x1d')]=_0x1e2f09||_0x4cc993;return _0x545e31;})[_0xce1e('0x1a')](respondWithFilteredResult(_0xe6c01,_0x3f034b))['catch'](APIHandleError(_0xe6c01));};exports[_0xce1e('0x42')]=function(_0x3ddcf9,_0x4fb57d){var _0x3b63b2={'count':0x0,'rows':[]};var _0x2c1966={};var _0x89f64b;var _0x5b5b3a;var _0x3dc03a;Promise[_0xce1e('0x11')]()[_0xce1e('0x1a')](function(){if(_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x12')]){if(!utils['isValidChannel'](_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x12')])){throw new APIBadRequestError(util[_0xce1e('0x13')](_0xce1e('0x43'),_0x3ddcf9['query'][_0xce1e('0x12')]));}_0x89f64b=_0x3ddcf9[_0xce1e('0xc')]['channel'][_0xce1e('0x44')]();}var _0x37fc3a=_[_0xce1e('0x45')](_0x89f64b)+_0xce1e('0x46');var _0x4c7c80=_[_0xce1e('0x39')](db[_0x37fc3a][_0xce1e('0x47')],function(_0x29c830){return{'name':_0x29c830[_0xce1e('0x48')],'type':_0x29c830[_0xce1e('0x22')]['key']};});if(!_0x3ddcf9['query'][_0xce1e('0x17')]){var _0x4a75ae=['id','name'];if(_0x89f64b==='voice'){_0x4a75ae['push'](_0xce1e('0x22'));if(_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x22')]==='outbound'){_0x4a75ae[_0xce1e('0x26')](['dialActive',_0xce1e('0x49')]);}}_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x17')]=_0x4a75ae[_0xce1e('0x18')](',');}_0x2c1966=qs['getOptions'](_0x4c7c80,_0x3ddcf9);if(_0x3ddcf9[_0xce1e('0x2f')][_0xce1e('0x30')]==='user'){var _0x1b4e86={'params':{'id':_0x3ddcf9[_0xce1e('0x2f')]['userProfileId']},'query':{'section':_0x89f64b===_0xce1e('0x4a')&&_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x22')]===_0xce1e('0x4b')?_0xce1e('0x4c'):_['startCase'](_0x89f64b)+_0xce1e('0x4d'),'type':_0x3ddcf9[_0xce1e('0xc')]['type'],'nolimit':!![],'sort':_0xce1e('0x4e'),'filter':_0x3ddcf9['query']['filter']}};return db[_0xce1e('0x35')][_0xce1e('0x36')](_0x1b4e86);}return db[_0x37fc3a]['findAndCountAll'](_0x2c1966);})[_0xce1e('0x1a')](function(_0x849d1d){_0x3b63b2[_0xce1e('0x38')]=_0x849d1d[_0xce1e('0x38')];_0x5b5b3a=_0x849d1d['rows'];return rtq[_0xce1e('0x4f')](_0x3ddcf9,_0x89f64b);})['then'](function(_0x1ba23c){_0x3dc03a=_0x1ba23c[_0xce1e('0x1d')];return rtq[_0xce1e('0x50')](_0x5b5b3a,_0x3dc03a,_0x89f64b,_0x3ddcf9[_0xce1e('0xc')][_0xce1e('0x22')]);})[_0xce1e('0x1a')](function(_0x1a221e){_0x3b63b2[_0xce1e('0x1d')]=_0x1a221e;return _0x3b63b2;})[_0xce1e('0x1a')](respondWithFilteredResult(_0x4fb57d,_0x2c1966))[_0xce1e('0x51')](APIHandleError(_0x4fb57d));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 7797f92..14ec0fc 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ecd9f,_0x5451fa){var _0x2e6980=function(_0x1d51b8){while(--_0x1d51b8){_0x5ecd9f['push'](_0x5ecd9f['shift']());}};_0x2e6980(++_0x5451fa);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6d5e10,_0x253dfa){var _0x23b864=function(_0xb00b1a){while(--_0xb00b1a){_0x6d5e10['push'](_0x6d5e10['shift']());}};_0x23b864(++_0x253dfa);}(_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 1ac7f80..125bffe 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 _0x9d5c=['sequelize','INTEGER','STRING','DATE'];(function(_0x3acfd2,_0x33d99c){var _0x4d0a18=function(_0x240a8a){while(--_0x240a8a){_0x3acfd2['push'](_0x3acfd2['shift']());}};_0x4d0a18(++_0x33d99c);}(_0x9d5c,0x98));var _0xc9d5=function(_0x1e34ca,_0x1d543f){_0x1e34ca=_0x1e34ca-0x0;var _0xcb4f8f=_0x9d5c[_0x1e34ca];return _0xcb4f8f;};'use strict';var Sequelize=require(_0xc9d5('0x0'));module['exports']={'state':{'type':Sequelize[_0xc9d5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc9d5('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc9d5('0x2')]},'starttime':{'type':Sequelize[_0xc9d5('0x3')]},'responsetime':{'type':Sequelize[_0xc9d5('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc9d5('0x2')]},'campaigntype':{'type':Sequelize[_0xc9d5('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed08=['INTEGER','STRING','DATE','exports'];(function(_0x312e88,_0x460ef0){var _0x265b76=function(_0x289e25){while(--_0x289e25){_0x312e88['push'](_0x312e88['shift']());}};_0x265b76(++_0x460ef0);}(_0xed08,0x67));var _0x8ed0=function(_0x3fbeab,_0x2d0acd){_0x3fbeab=_0x3fbeab-0x0;var _0x20cd44=_0xed08[_0x3fbeab];return _0x20cd44;};'use strict';var Sequelize=require('sequelize');module[_0x8ed0('0x0')]={'state':{'type':Sequelize[_0x8ed0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8ed0('0x2')]},'scheduledat':{'type':Sequelize[_0x8ed0('0x3')]},'uniqueid':{'type':Sequelize[_0x8ed0('0x2')]},'starttime':{'type':Sequelize[_0x8ed0('0x3')]},'responsetime':{'type':Sequelize[_0x8ed0('0x3')]},'ringtime':{'type':Sequelize[_0x8ed0('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8ed0('0x2')]},'campaigntype':{'type':Sequelize[_0x8ed0('0x2')]},'membername':{'type':Sequelize[_0x8ed0('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 337384d..1d56995 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 _0xc3b2=['bluebird','request-promise','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','moment'];(function(_0x39876b,_0x146f93){var _0x40476d=function(_0x2f212d){while(--_0x2f212d){_0x39876b['push'](_0x39876b['shift']());}};_0x40476d(++_0x146f93);}(_0xc3b2,0x115));var _0x2c3b=function(_0x187856,_0xd8bb22){_0x187856=_0x187856-0x0;var _0x46fe6a=_0xc3b2[_0x187856];return _0x46fe6a;};'use strict';var _=require(_0x2c3b('0x0'));var util=require('util');var logger=require(_0x2c3b('0x1'))('api');var moment=require(_0x2c3b('0x2'));var BPromise=require(_0x2c3b('0x3'));var rp=require(_0x2c3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c3b('0x5'));module[_0x2c3b('0x6')]=function(_0x348119,_0x463a70){return _0x348119[_0x2c3b('0x7')](_0x2c3b('0x8'),attributes,{'tableName':_0x2c3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf42c=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x37ba33,_0x4e5749){var _0x3a6765=function(_0x171426){while(--_0x171426){_0x37ba33['push'](_0x37ba33['shift']());}};_0x3a6765(++_0x4e5749);}(_0xf42c,0x1c8));var _0xcf42=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xf42c[_0x483ab9];return _0x35043b;};'use strict';var _=require('lodash');var util=require(_0xcf42('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcf42('0x1'));var BPromise=require(_0xcf42('0x2'));var rp=require(_0xcf42('0x3'));var fs=require('fs');var path=require(_0xcf42('0x4'));var rimraf=require(_0xcf42('0x5'));var config=require(_0xcf42('0x6'));var attributes=require(_0xcf42('0x7'));module[_0xcf42('0x8')]=function(_0x338a3a,_0x2f49ca){return _0x338a3a[_0xcf42('0x9')](_0xcf42('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 89b96a2..c82227a 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 _0xd960=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xd960,0x86));var _0x0d96=function(_0x51df2b,_0xe67866){_0x51df2b=_0x51df2b-0x0;var _0xbf533a=_0xd960[_0x51df2b];return _0xbf533a;};'use strict';var _=require('lodash');var util=require(_0x0d96('0x0'));var moment=require(_0x0d96('0x1'));var BPromise=require(_0x0d96('0x2'));var rs=require(_0x0d96('0x3'));var fs=require('fs');var Redis=require(_0x0d96('0x4'));var db=require(_0x0d96('0x5'))['db'];var utils=require(_0x0d96('0x6'));var logger=require('../../config/logger')(_0x0d96('0x7'));var config=require(_0x0d96('0x8'));var jayson=require(_0x0d96('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec473,_0x3d2aa7,_0x19d67d){return new BPromise(function(_0x5da00d,_0x3b02bc){return client[_0x0d96('0xa')](_0x4ec473,_0x19d67d)[_0x0d96('0xb')](function(_0x36861d){logger[_0x0d96('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x3d2aa7,_0x0d96('0xd'));logger[_0x0d96('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3d2aa7,_0x0d96('0xd'),JSON[_0x0d96('0xf')](_0x36861d));if(_0x36861d[_0x0d96('0x10')]){if(_0x36861d[_0x0d96('0x10')][_0x0d96('0x11')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3d2aa7,_0x36861d[_0x0d96('0x10')]['message']);return _0x3b02bc(_0x36861d[_0x0d96('0x10')][_0x0d96('0x12')]);}logger[_0x0d96('0x10')](_0x0d96('0x13'),_0x3d2aa7,_0x36861d['error']['message']);return _0x5da00d(_0x36861d['error'][_0x0d96('0x12')]);}else{logger[_0x0d96('0xc')](_0x0d96('0x13'),_0x3d2aa7,'request\x20sent');_0x5da00d(_0x36861d[_0x0d96('0x14')][_0x0d96('0x12')]);}})[_0x0d96('0x15')](function(_0x56519a){logger[_0x0d96('0x10')](_0x0d96('0x13'),_0x3d2aa7,_0x56519a);_0x3b02bc(_0x56519a);});});}exports[_0x0d96('0x16')]=function(_0x551923){var _0x50ec8a=this;return new Promise(function(_0x46f1b0,_0x4b11fa){return db[_0x0d96('0x17')][_0x0d96('0x18')](_0x551923[_0x0d96('0x19')],{'raw':_0x551923[_0x0d96('0x1a')]?_0x551923[_0x0d96('0x1a')][_0x0d96('0x1b')]===undefined?!![]:![]:!![]})[_0x0d96('0xb')](function(_0x577709){logger[_0x0d96('0xc')](_0x0d96('0x16'),_0x551923);logger[_0x0d96('0xe')](_0x0d96('0x16'),_0x551923,JSON[_0x0d96('0xf')](_0x577709));_0x46f1b0(_0x577709);})['catch'](function(_0x459d59){logger[_0x0d96('0x10')](_0x0d96('0x16'),_0x459d59[_0x0d96('0x12')],_0x551923);_0x4b11fa(_0x50ec8a[_0x0d96('0x10')](0x1f4,_0x459d59[_0x0d96('0x12')]));});});}; \ No newline at end of file +var _0x7a56=['http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x25b2ac,_0x4bac27){var _0x2dd942=function(_0x4b9015){while(--_0x4b9015){_0x25b2ac['push'](_0x25b2ac['shift']());}};_0x2dd942(++_0x4bac27);}(_0x7a56,0xce));var _0x67a5=function(_0x1abeec,_0x491ca6){_0x1abeec=_0x1abeec-0x0;var _0x5e25e5=_0x7a56[_0x1abeec];return _0x5e25e5;};'use strict';var _=require(_0x67a5('0x0'));var util=require(_0x67a5('0x1'));var moment=require(_0x67a5('0x2'));var BPromise=require(_0x67a5('0x3'));var rs=require(_0x67a5('0x4'));var fs=require('fs');var Redis=require(_0x67a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67a5('0x6'))(_0x67a5('0x7'));var config=require(_0x67a5('0x8'));var jayson=require(_0x67a5('0x9'));var client=jayson['client'][_0x67a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdd322a,_0x26e610,_0x30dfa6){return new BPromise(function(_0x191695,_0x4d59c3){return client[_0x67a5('0xb')](_0xdd322a,_0x30dfa6)[_0x67a5('0xc')](function(_0x19fd04){logger['info'](_0x67a5('0xd'),_0x26e610,_0x67a5('0xe'));logger[_0x67a5('0xf')](_0x67a5('0x10'),_0x26e610,_0x67a5('0xe'),JSON[_0x67a5('0x11')](_0x19fd04));if(_0x19fd04[_0x67a5('0x12')]){if(_0x19fd04[_0x67a5('0x12')][_0x67a5('0x13')]===0x1f4){logger[_0x67a5('0x12')](_0x67a5('0xd'),_0x26e610,_0x19fd04['error'][_0x67a5('0x14')]);return _0x4d59c3(_0x19fd04[_0x67a5('0x12')][_0x67a5('0x14')]);}logger[_0x67a5('0x12')](_0x67a5('0xd'),_0x26e610,_0x19fd04[_0x67a5('0x12')]['message']);return _0x191695(_0x19fd04['error'][_0x67a5('0x14')]);}else{logger[_0x67a5('0x15')](_0x67a5('0xd'),_0x26e610,_0x67a5('0xe'));_0x191695(_0x19fd04[_0x67a5('0x16')][_0x67a5('0x14')]);}})[_0x67a5('0x17')](function(_0x26f8f3){logger[_0x67a5('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x26e610,_0x26f8f3);_0x4d59c3(_0x26f8f3);});});}exports[_0x67a5('0x18')]=function(_0x3c0b24){var _0x480e5d=this;return new Promise(function(_0x18ad80,_0x4b517d){return db['ReportAgentPreview']['create'](_0x3c0b24[_0x67a5('0x19')],{'raw':_0x3c0b24['options']?_0x3c0b24['options'][_0x67a5('0x1a')]===undefined?!![]:![]:!![]})[_0x67a5('0xc')](function(_0x4fed27){logger[_0x67a5('0x15')](_0x67a5('0x18'),_0x3c0b24);logger['debug'](_0x67a5('0x18'),_0x3c0b24,JSON['stringify'](_0x4fed27));_0x18ad80(_0x4fed27);})[_0x67a5('0x17')](function(_0x4da02c){logger[_0x67a5('0x12')](_0x67a5('0x18'),_0x4da02c[_0x67a5('0x14')],_0x3c0b24);_0x4b517d(_0x480e5d[_0x67a5('0x12')](0x1f4,_0x4da02c[_0x67a5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index df2bdf0..bc7c80d 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 _0x3a15=['get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/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','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','multer','path','Router','../../components/auth/service','./rpc.controller','isAuthenticated'];(function(_0x26d431,_0x365362){var _0x5c6375=function(_0x58028d){while(--_0x58028d){_0x26d431['push'](_0x26d431['shift']());}};_0x5c6375(++_0x365362);}(_0x3a15,0xde));var _0x53a1=function(_0x12a695,_0x56cd60){_0x12a695=_0x12a695-0x0;var _0x536966=_0x3a15[_0x12a695];return _0x536966;};'use strict';var multer=require(_0x53a1('0x0'));var util=require('util');var path=require(_0x53a1('0x1'));var express=require('express');var router=express[_0x53a1('0x2')]();var auth=require(_0x53a1('0x3'));var controller=require(_0x53a1('0x4'));router['get']('/voice/channels',auth[_0x53a1('0x5')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x53a1('0x5')](),controller['voiceChannelMixMonitor']);router[_0x53a1('0x6')](_0x53a1('0x7'),auth[_0x53a1('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0x53a1('0x6')](_0x53a1('0x8'),auth['isAuthenticated'](),controller['voiceQueues']);router['get'](_0x53a1('0x9'),auth[_0x53a1('0x5')](),controller[_0x53a1('0xa')]);router[_0x53a1('0x6')]('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x53a1('0x6')](_0x53a1('0xb'),auth['isAuthenticated'](),controller[_0x53a1('0xc')]);router[_0x53a1('0x6')](_0x53a1('0xd'),auth['isAuthenticated'](),controller[_0x53a1('0xe')]);router[_0x53a1('0x6')](_0x53a1('0xf'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x10')]);router[_0x53a1('0x6')](_0x53a1('0x11'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x12')]);router['get'](_0x53a1('0x13'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x14')]);router[_0x53a1('0x6')](_0x53a1('0x15'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x16')]);router['get'](_0x53a1('0x17'),auth['isAuthenticated'](),controller[_0x53a1('0x18')]);router[_0x53a1('0x6')](_0x53a1('0x19'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x1a')]);router[_0x53a1('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x53a1('0x5')](),controller[_0x53a1('0x1b')]);router['get'](_0x53a1('0x1c'),auth[_0x53a1('0x5')](),controller['voiceQueuesChannelRedirect']);router[_0x53a1('0x6')](_0x53a1('0x1d'),auth['isAuthenticated'](),controller[_0x53a1('0x1e')]);router[_0x53a1('0x1f')]('/voice/queues/:id',auth[_0x53a1('0x5')](),controller[_0x53a1('0x20')]);router[_0x53a1('0x6')](_0x53a1('0x21'),auth['isAuthenticated'](),controller[_0x53a1('0x22')]);router[_0x53a1('0x6')](_0x53a1('0x23'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x24')]);router[_0x53a1('0x6')]('/agents',auth[_0x53a1('0x5')](),controller[_0x53a1('0x25')]);router[_0x53a1('0x1f')](_0x53a1('0x26'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x27')]);router[_0x53a1('0x6')](_0x53a1('0x28'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x29')]);router[_0x53a1('0x6')](_0x53a1('0x2a'),auth['isAuthenticated'](),controller[_0x53a1('0x2b')]);router[_0x53a1('0x6')](_0x53a1('0x2c'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x2d')]);router[_0x53a1('0x6')](_0x53a1('0x2e'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x53a1('0x6')](_0x53a1('0x2f'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x30')]);router[_0x53a1('0x6')](_0x53a1('0x31'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x53a1('0x6')](_0x53a1('0x32'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x33')]);router[_0x53a1('0x6')](_0x53a1('0x34'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x35')]);router[_0x53a1('0x6')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x53a1('0x36')]);router[_0x53a1('0x6')](_0x53a1('0x37'),auth['isAuthenticated'](),controller[_0x53a1('0x38')]);router[_0x53a1('0x6')](_0x53a1('0x39'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3a')]);router[_0x53a1('0x3b')]('/mail/queues/:id/notify',auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x3d')));router[_0x53a1('0x6')]('/mail/queues/:id',auth[_0x53a1('0x5')](),controller['showMailQueues']);router[_0x53a1('0x3b')](_0x53a1('0x3e'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x3f')));router[_0x53a1('0x6')](_0x53a1('0x40'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x41')]);router['post'](_0x53a1('0x42'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x3c')](_0x53a1('0x43')));router[_0x53a1('0x6')]('/fax/queues/:id',auth[_0x53a1('0x5')](),controller[_0x53a1('0x44')]);router[_0x53a1('0x3b')](_0x53a1('0x45'),auth[_0x53a1('0x5')](),controller['queueNotify']('openchannel'));router[_0x53a1('0x6')](_0x53a1('0x46'),auth[_0x53a1('0x5')](),controller[_0x53a1('0x47')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x53a1('0x3c')](_0x53a1('0x48')));router[_0x53a1('0x3b')](_0x53a1('0x49'),auth['isAuthenticated'](),controller[_0x53a1('0x3c')]('whatsapp'));router['get'](_0x53a1('0x4a'),auth['isAuthenticated'](),controller[_0x53a1('0x4b')]);router[_0x53a1('0x6')]('/whatsapp/queues/:id',auth[_0x53a1('0x5')](),controller['showWhatsappQueues']);router[_0x53a1('0x3b')]('/agents/:id/notify',auth[_0x53a1('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0x79ea=['/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','/telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','express','../../components/auth/service','./rpc.controller','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','chatQueues','/mail/queues','mailQueues'];(function(_0x2bedce,_0x4f20a4){var _0x2d9af5=function(_0x4fe5cc){while(--_0x4fe5cc){_0x2bedce['push'](_0x2bedce['shift']());}};_0x2d9af5(++_0x4f20a4);}(_0x79ea,0x8b));var _0xa79e=function(_0x5cbb32,_0x233ace){_0x5cbb32=_0x5cbb32-0x0;var _0x49363c=_0x79ea[_0x5cbb32];return _0x49363c;};'use strict';var multer=require(_0xa79e('0x0'));var util=require('util');var path=require('path');var express=require(_0xa79e('0x1'));var router=express['Router']();var auth=require(_0xa79e('0x2'));var controller=require(_0xa79e('0x3'));router['get']('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0xa79e('0x4')](_0xa79e('0x5'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x7')]);router[_0xa79e('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xa79e('0x6')](),controller[_0xa79e('0x8')]);router['get']('/voice/queues',auth[_0xa79e('0x6')](),controller[_0xa79e('0x9')]);router[_0xa79e('0x4')]('/chat/queues',auth['isAuthenticated'](),controller[_0xa79e('0xa')]);router[_0xa79e('0x4')](_0xa79e('0xb'),auth['isAuthenticated'](),controller[_0xa79e('0xc')]);router[_0xa79e('0x4')](_0xa79e('0xd'),auth[_0xa79e('0x6')](),controller['mailAccounts']);router[_0xa79e('0x4')](_0xa79e('0xe'),auth[_0xa79e('0x6')](),controller[_0xa79e('0xf')]);router[_0xa79e('0x4')](_0xa79e('0x10'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x11')]);router[_0xa79e('0x4')](_0xa79e('0x12'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x13')]);router[_0xa79e('0x4')](_0xa79e('0x14'),auth[_0xa79e('0x6')](),controller['faxQueues']);router[_0xa79e('0x4')](_0xa79e('0x15'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x16')]);router[_0xa79e('0x4')]('/voice/queues/channels',auth[_0xa79e('0x6')](),controller[_0xa79e('0x17')]);router[_0xa79e('0x4')](_0xa79e('0x18'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x19')]);router[_0xa79e('0x4')](_0xa79e('0x1a'),auth['isAuthenticated'](),controller[_0xa79e('0x1b')]);router['get'](_0xa79e('0x1c'),auth['isAuthenticated'](),controller[_0xa79e('0x1d')]);router[_0xa79e('0x4')](_0xa79e('0x1e'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x1f')]);router[_0xa79e('0x20')]('/voice/queues/:id',auth[_0xa79e('0x6')](),controller[_0xa79e('0x21')]);router['get'](_0xa79e('0x22'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x23')]);router[_0xa79e('0x4')](_0xa79e('0x24'),auth[_0xa79e('0x6')](),controller['outboundChannels']);router['get'](_0xa79e('0x25'),auth['isAuthenticated'](),controller['agents']);router[_0xa79e('0x20')]('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0xa79e('0x4')](_0xa79e('0x26'),auth[_0xa79e('0x6')](),controller['telephones']);router['get'](_0xa79e('0x27'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x28')]);router[_0xa79e('0x4')](_0xa79e('0x29'),auth[_0xa79e('0x6')](),controller['campaigns']);router[_0xa79e('0x4')](_0xa79e('0x2a'),auth['isAuthenticated'](),controller['faxAccounts']);router['get'](_0xa79e('0x2b'),auth[_0xa79e('0x6')](),controller['chatQueuesWaitingInteractions']);router['get'](_0xa79e('0x2c'),auth[_0xa79e('0x6')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xa79e('0x2d'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x2e')]);router[_0xa79e('0x4')](_0xa79e('0x2f'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x30')]);router[_0xa79e('0x4')](_0xa79e('0x31'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x32')]);router[_0xa79e('0x4')](_0xa79e('0x33'),auth[_0xa79e('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0xa79e('0x4')](_0xa79e('0x34'),auth[_0xa79e('0x6')](),controller['faxQueuesWaitingInteractions']);router[_0xa79e('0x35')](_0xa79e('0x36'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x37')](_0xa79e('0x38')));router[_0xa79e('0x4')](_0xa79e('0x39'),auth['isAuthenticated'](),controller[_0xa79e('0x3a')]);router[_0xa79e('0x35')](_0xa79e('0x3b'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x37')](_0xa79e('0x3c')));router['get']('/chat/queues/:id',auth[_0xa79e('0x6')](),controller['showChatQueues']);router['post'](_0xa79e('0x3d'),auth['isAuthenticated'](),controller[_0xa79e('0x37')](_0xa79e('0x3e')));router[_0xa79e('0x4')](_0xa79e('0x3f'),auth[_0xa79e('0x6')](),controller['showFaxQueues']);router['post'](_0xa79e('0x40'),auth[_0xa79e('0x6')](),controller['queueNotify'](_0xa79e('0x41')));router[_0xa79e('0x4')](_0xa79e('0x42'),auth[_0xa79e('0x6')](),controller['showOpenchannelQueues']);router[_0xa79e('0x35')](_0xa79e('0x43'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x37')](_0xa79e('0x44')));router['post'](_0xa79e('0x45'),auth[_0xa79e('0x6')](),controller[_0xa79e('0x37')](_0xa79e('0x46')));router[_0xa79e('0x4')](_0xa79e('0x47'),auth['isAuthenticated'](),controller[_0xa79e('0x48')]);router[_0xa79e('0x4')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0xa79e('0x49')]);router['post'](_0xa79e('0x4a'),auth['isAuthenticated'](),controller['agentNotify']);module[_0xa79e('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index afcf611..c77d870 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 _0x2eb2=['map','value','indexOf','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','update','queue','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','channel','InteractionId','Start','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','message','result','status','json','stack','name','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type'];(function(_0x512b48,_0xa3924f){var _0x278a76=function(_0x2360ec){while(--_0x2360ec){_0x512b48['push'](_0x512b48['shift']());}};_0x278a76(++_0xa3924f);}(_0x2eb2,0x19f));var _0x22eb=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x2eb2[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x22eb('0x0'));var _=require(_0x22eb('0x1'));var util=require(_0x22eb('0x2'));var db=require(_0x22eb('0x3'))['db'];var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x22eb('0x6')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x22eb('0x7')]({'port':0x232b});var routingClient=jayson[_0x22eb('0x6')][_0x22eb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){var _0x419601=_0x396806?_0x396806:amiClient;return _0x419601[_0x22eb('0x8')](_0x2a9850,_0x4539d0)[_0x22eb('0x9')](function(_0x3008e0){if(_0x3008e0['error']){if(_0x3008e0[_0x22eb('0xa')]['code']===0x1f4){return _0x3375d6(_0x3008e0['error'][_0x22eb('0xb')]);}return _0x33ddef(_0x3008e0['error'][_0x22eb('0xb')]);}else{_0x33ddef(_0x3008e0[_0x22eb('0xc')]);}})['catch'](function(_0x5068ea){_0x3375d6(_0x5068ea);});});}function respondWithResult(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xc8;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0xd')](_0x189f05)[_0x22eb('0xe')](_0x128d43);}return _0x1f286c['sendStatus'](0x194);};}function handleError(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0x1f4;return function(_0x1f5089){logger['error'](_0x1f5089[_0x22eb('0xf')]);if(_0x1f5089[_0x22eb('0x10')]){delete _0x1f5089['name'];}_0x350ade['status'](_0x53f14e)['send'](_0x1f5089);};}function findById(_0x2ed8a7){return function(_0x5245fe){if(!_['isNil'](_0x2ed8a7)&&!_[_0x22eb('0x11')](_0x5245fe)&&!_['isNil'](_0x5245fe['rows'])){return _[_0x22eb('0x12')](_0x5245fe[_0x22eb('0x13')],function(_0x385bcb){return _0x385bcb['id']==_0x2ed8a7;});}return null;};}exports[_0x22eb('0x14')]=function(_0x3b0940,_0x4bc0a2){return respondWithRpcPromise(_0x22eb('0x15'),_0x3b0940[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4bc0a2,null))[_0x22eb('0x17')](handleError(_0x4bc0a2,null));};exports[_0x22eb('0x18')]=function(_0x517313,_0x2eb115){return respondWithRpcPromise(_0x22eb('0x19'),_[_0x22eb('0x1a')](_0x517313['query'],_0x517313['params']))[_0x22eb('0x9')](respondWithResult(_0x2eb115,null))[_0x22eb('0x17')](handleError(_0x2eb115,null));};exports[_0x22eb('0x1b')]=function(_0x44639a,_0x2d95f0){return respondWithRpcPromise(_0x22eb('0x1c'),_[_0x22eb('0x1a')](_0x44639a['query'],_0x44639a[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x2d95f0,null))[_0x22eb('0x17')](handleError(_0x2d95f0,null));};exports[_0x22eb('0x1e')]=function(_0x420d4f,_0x4da252){return respondWithRpcPromise(_0x22eb('0x1f'),_0x420d4f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4da252,null))['catch'](handleError(_0x4da252,null));};exports[_0x22eb('0x20')]=function(_0x259847,_0x4b409a){return respondWithRpcPromise(_0x22eb('0x1f'),_0x259847[_0x22eb('0x16')])[_0x22eb('0x9')](findById(_0x259847[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x4b409a,null))['catch'](handleError(_0x4b409a,null));};exports['updateVoiceQueue']=function(_0x2a950e,_0x25e5bc){return respondWithRpcPromise(_0x22eb('0x21'),_[_0x22eb('0x1a')](_0x2a950e[_0x22eb('0x22')],_0x2a950e[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x25e5bc,null))[_0x22eb('0x17')](handleError(_0x25e5bc,null));};exports[_0x22eb('0x23')]=function(_0x39cec1,_0x24e9dc){return respondWithRpcPromise(_0x22eb('0x24'),_['merge'](_0x39cec1[_0x22eb('0x16')],_0x39cec1['params']))[_0x22eb('0x9')](respondWithResult(_0x24e9dc,null))[_0x22eb('0x17')](handleError(_0x24e9dc,null));};exports[_0x22eb('0x25')]=function(_0x11199f,_0x351ed8){return respondWithRpcPromise(_0x22eb('0x26'),_0x11199f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x351ed8,null))[_0x22eb('0x17')](handleError(_0x351ed8,null));};exports[_0x22eb('0x27')]=function(_0x509bb7,_0x49259f){return respondWithRpcPromise(_0x22eb('0x28'),_['merge'](_0x509bb7['query'],_0x509bb7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x49259f,null))[_0x22eb('0x17')](handleError(_0x49259f,null));};exports[_0x22eb('0x29')]=function(_0x45c53e,_0x332e9a){return respondWithRpcPromise(_0x22eb('0x2a'),_[_0x22eb('0x1a')](_0x45c53e[_0x22eb('0x16')],_0x45c53e[_0x22eb('0x1d')]))['then'](respondWithResult(_0x332e9a,null))[_0x22eb('0x17')](handleError(_0x332e9a,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c43e7,_0x35a264){return respondWithRpcPromise(_0x22eb('0x2b'),_['merge'](_0x5c43e7[_0x22eb('0x16')],_0x5c43e7[_0x22eb('0x1d')]))[_0x22eb('0x9')](respondWithResult(_0x35a264,null))[_0x22eb('0x17')](handleError(_0x35a264,null));};exports[_0x22eb('0x2c')]=function(_0x574555,_0x25f140){return respondWithRpcPromise(_0x22eb('0x2d'),_0x574555['query'])[_0x22eb('0x9')](respondWithResult(_0x25f140,null))[_0x22eb('0x17')](handleError(_0x25f140,null));};exports[_0x22eb('0x2e')]=function(_0x2cc77c,_0x9353f1){return respondWithRpcPromise('OutboundChannels',_0x2cc77c['query'])[_0x22eb('0x9')](respondWithResult(_0x9353f1,null))[_0x22eb('0x17')](handleError(_0x9353f1,null));};exports['agents']=function(_0x595d76,_0x2e2a0c){var _0x46c6a1;return respondWithRpcPromise('Agents',_0x595d76[_0x22eb('0x16')])[_0x22eb('0x9')](function(_0x382163){_0x46c6a1=_0x382163;return respondWithRpcPromise(_0x22eb('0x2f'),_0x595d76[_0x22eb('0x16')],routingClient);})[_0x22eb('0x9')](function(_0x513b65){return _[_0x22eb('0x1a')]({},_0x513b65,_0x46c6a1);})[_0x22eb('0x9')](respondWithResult(_0x2e2a0c,null))['catch'](handleError(_0x2e2a0c,null));};exports[_0x22eb('0x30')]=function(_0x44d39f,_0x204092){if(_0x44d39f[_0x22eb('0x22')]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]&&_0x44d39f[_0x22eb('0x32')]&&_0x44d39f[_0x22eb('0x32')][_0x22eb('0x10')]){for(var _0x82ace8 in _0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')]){if(_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x22eb('0x33')](_0x82ace8)){db[_0x22eb('0x34')][_0x22eb('0x35')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f[_0x22eb('0x32')]['name'],'type':_0x22eb('0x36'),'exitAt':null,'uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8]&&_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length']?{'$notIn':_0x44d39f['body']['interaction'][_0x82ace8]}:{'$ne':null}}})[_0x22eb('0x9')](function(_0x1efc65){var _0x4e4c6d=moment()['format'](_0x22eb('0x37'));for(var _0x43f771=0x0,_0x326b24=_0x1efc65[_0x22eb('0x38')];_0x43f771<_0x326b24;_0x43f771+=0x1){_0x1efc65[_0x43f771][_0x22eb('0x39')]({'exitAt':_0x4e4c6d});}});for(var _0x3b30a3=0x0;_0x3b30a3<_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8]['length'];_0x3b30a3+=0x1){db['MemberReport'][_0x22eb('0x3a')]({'where':{'channel':_0x82ace8,'membername':_0x44d39f['user'][_0x22eb('0x10')],'type':'INTERACTION','uniqueid':_0x44d39f[_0x22eb('0x22')]['interaction'][_0x82ace8][_0x3b30a3],'exitAt':null},'defaults':{'channel':_0x82ace8,'membername':_0x44d39f['user']['name'],'interface':_['isNil'](_0x44d39f[_0x22eb('0x32')]['interface'])?util[_0x22eb('0x3b')](_0x22eb('0x3c'),_0x44d39f['user'][_0x22eb('0x10')]):_0x44d39f['user'][_0x22eb('0x3d')],'type':_0x22eb('0x36'),'enterAt':moment()[_0x22eb('0x3b')](_0x22eb('0x37')),'role':_0x22eb('0x3e'),'internal':_0x44d39f[_0x22eb('0x32')][_0x22eb('0x3f')],'uniqueid':_0x44d39f[_0x22eb('0x22')][_0x22eb('0x31')][_0x82ace8][_0x3b30a3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x44d39f[_0x22eb('0x1d')]['id'],'capacity':_0x44d39f[_0x22eb('0x22')]['capacity']},routingClient)[_0x22eb('0x9')](respondWithResult(_0x204092,null))[_0x22eb('0x17')](handleError(_0x204092,null));};exports[_0x22eb('0x40')]=function(_0x31216f,_0x4fee5c){return respondWithRpcPromise(_0x22eb('0x41'),_0x31216f[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fee5c,null))[_0x22eb('0x17')](handleError(_0x4fee5c,null));};exports[_0x22eb('0x42')]=function(_0x10393b,_0x5effca){return respondWithRpcPromise(_0x22eb('0x43'),_0x10393b['query'])[_0x22eb('0x9')](respondWithResult(_0x5effca,null))['catch'](handleError(_0x5effca,null));};exports[_0x22eb('0x44')]=function(_0x254b53,_0x4028ef){return respondWithRpcPromise(_0x22eb('0x45'),_0x254b53[_0x22eb('0x16')])['then'](respondWithResult(_0x4028ef,null))['catch'](handleError(_0x4028ef,null));};exports[_0x22eb('0x46')]=function(_0x8e3864,_0x490110){return respondWithRpcPromise(_0x22eb('0x47'),_0x8e3864[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x490110,null))[_0x22eb('0x17')](handleError(_0x490110,null));};exports[_0x22eb('0x48')]=function(_0x27756b,_0x3a8588){return respondWithRpcPromise(_0x22eb('0x47'),_0x27756b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x27756b[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x3a8588,null))[_0x22eb('0x17')](handleError(_0x3a8588,null));};exports[_0x22eb('0x49')]=function(_0x3764d4,_0x2562a1){return respondWithRpcPromise(_0x22eb('0x4a'),_0x3764d4[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x2562a1,null))[_0x22eb('0x17')](handleError(_0x2562a1,null));};exports[_0x22eb('0x4b')]=function(_0x9f8465,_0x3e9ab5){return respondWithRpcPromise(_0x22eb('0x4a'),_0x9f8465[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x9f8465['params']['id']))['then'](respondWithResult(_0x3e9ab5,null))[_0x22eb('0x17')](handleError(_0x3e9ab5,null));};exports[_0x22eb('0x4c')]=function(_0x165e79,_0x38c02f){return respondWithRpcPromise(_0x22eb('0x4d'),_0x165e79['query'],mailClient)[_0x22eb('0x9')](respondWithResult(_0x38c02f,null))[_0x22eb('0x17')](handleError(_0x38c02f,null));};exports['openchannelQueues']=function(_0x485408,_0x341a1c){return respondWithRpcPromise(_0x22eb('0x4e'),_0x485408[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x341a1c,null))[_0x22eb('0x17')](handleError(_0x341a1c,null));};exports[_0x22eb('0x4f')]=function(_0x16099e,_0x22104f){return respondWithRpcPromise(_0x22eb('0x4e'),_0x16099e[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x16099e[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x22104f,null))[_0x22eb('0x17')](handleError(_0x22104f,null));};exports['smsQueues']=function(_0x29dd8b,_0x46ba3b){return respondWithRpcPromise(_0x22eb('0x50'),_0x29dd8b['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x46ba3b,null))['catch'](handleError(_0x46ba3b,null));};exports[_0x22eb('0x51')]=function(_0x5347b4,_0x1919d0){return respondWithRpcPromise(_0x22eb('0x50'),_0x5347b4['query'],routingClient)[_0x22eb('0x9')](findById(_0x5347b4[_0x22eb('0x1d')]['id']))['then'](respondWithResult(_0x1919d0,null))['catch'](handleError(_0x1919d0,null));};exports[_0x22eb('0x52')]=function(_0x3073b1,_0x1984f0){return respondWithRpcPromise(_0x22eb('0x53'),_0x3073b1[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1984f0,null))['catch'](handleError(_0x1984f0,null));};exports[_0x22eb('0x54')]=function(_0x5d035b,_0x5f4ea3){return respondWithRpcPromise(_0x22eb('0x53'),_0x5d035b[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x5d035b[_0x22eb('0x1d')]['id']))[_0x22eb('0x9')](respondWithResult(_0x5f4ea3,null))[_0x22eb('0x17')](handleError(_0x5f4ea3,null));};exports[_0x22eb('0x55')]=function(_0x109f7f,_0x50d914){return respondWithRpcPromise('FaxQueues',_0x109f7f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x50d914,null))['catch'](handleError(_0x50d914,null));};exports[_0x22eb('0x56')]=function(_0x3f7405,_0x25f1b2){return respondWithRpcPromise(_0x22eb('0x57'),_0x3f7405[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](findById(_0x3f7405['params']['id']))[_0x22eb('0x9')](respondWithResult(_0x25f1b2,null))[_0x22eb('0x17')](handleError(_0x25f1b2,null));};exports[_0x22eb('0x58')]=function(_0x5e46b0,_0x4fcc2c){return respondWithRpcPromise(_0x22eb('0x59'),_0x5e46b0[_0x22eb('0x16')])[_0x22eb('0x9')](respondWithResult(_0x4fcc2c,null))['catch'](handleError(_0x4fcc2c,null));};exports[_0x22eb('0x5a')]=function(_0x4b6cf3,_0x1a305d){return respondWithRpcPromise(_0x22eb('0x5b'),_0x4b6cf3[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1a305d,null))['catch'](handleError(_0x1a305d,null));};exports[_0x22eb('0x5c')]=function(_0x2e35b0,_0x304492){return respondWithRpcPromise(_0x22eb('0x5d'),_0x2e35b0[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x304492,null))[_0x22eb('0x17')](handleError(_0x304492,null));};exports[_0x22eb('0x5e')]=function(_0x47865e,_0x1c5b0b){return respondWithRpcPromise(_0x22eb('0x5f'),_0x47865e['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x1c5b0b,null))[_0x22eb('0x17')](handleError(_0x1c5b0b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x5cc383,_0x51d9f4){return respondWithRpcPromise(_0x22eb('0x5f'),_0x5cc383[_0x22eb('0x16')],routingClient)['then'](function(_0x10726f){if(_0x5cc383[_0x22eb('0x16')][_0x22eb('0x60')]!==undefined){var _0x41c50e=_(_0x10726f[_0x22eb('0x13')])['filter']([_0x5cc383['query'][_0x22eb('0x60')],_0x5cc383[_0x22eb('0x1d')]['id']])[_0x22eb('0x61')]('queue_id')['uniq']()[_0x22eb('0x62')]();return _0x10726f['rows']['filter'](function(_0x3568bc){return _0x41c50e[_0x22eb('0x63')](_0x3568bc['queue_id'])>-0x1;});}else{return _0x10726f['rows'][_0x22eb('0x64')](function(_0x2dd41a){return _0x2dd41a['queue_id']===parseInt(_0x5cc383[_0x22eb('0x1d')]['id']);});}})[_0x22eb('0x9')](respondWithResult(_0x51d9f4,null))[_0x22eb('0x17')](handleError(_0x51d9f4,null));};exports['smsQueuesWaitingInteractions']=function(_0x464f4f,_0x26fb52){return respondWithRpcPromise(_0x22eb('0x65'),_0x464f4f[_0x22eb('0x16')],routingClient)[_0x22eb('0x9')](respondWithResult(_0x26fb52,null))['catch'](handleError(_0x26fb52,null));};exports[_0x22eb('0x66')]=function(_0x2ecc24,_0x3f429b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2ecc24['query'],routingClient)[_0x22eb('0x9')](respondWithResult(_0x3f429b,null))[_0x22eb('0x17')](handleError(_0x3f429b,null));};exports[_0x22eb('0x67')]=function(_0x557c03,_0x215472){return respondWithRpcPromise(_0x22eb('0x68'),_0x557c03[_0x22eb('0x16')],routingClient)['then'](respondWithResult(_0x215472,null))[_0x22eb('0x17')](handleError(_0x215472,null));};exports['queueNotify']=function(_0x532a59){return function(_0x222616,_0x1e541f){var _0x1057f2,_0x49f362;var _0x3fc402=_[_0x22eb('0x69')](_0x532a59);var _0x2d422b=_0x532a59===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db[_0x3fc402+_0x22eb('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x222616[_0x22eb('0x1d')]['id']}})[_0x22eb('0x9')](function(_0x37d7c6){if(_['isNil'](_0x37d7c6)){throw new Error(_0x3fc402+_0x22eb('0x6d'));}_0x1057f2=_0x37d7c6;return db[_0x3fc402+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x222616[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x3fc402+_0x22eb('0x71')],'as':_0x22eb('0x71')},{'model':db[_0x3fc402+_0x2d422b],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x42d6fa){if(_[_0x22eb('0x11')](_0x42d6fa)){throw new Error(_0x3fc402+'\x20Message\x20not\x20found');}_0x49f362=_0x42d6fa;return _0x42d6fa[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x40999d={'uniqueid':_0x532a59+'.'+_0x49f362['id']+'.'+_0x49f362[_0x22eb('0x71')]['id'],'FromUserId':_0x222616['user']['id'],'type':_0x22eb('0x74')};_0x40999d[_0x3fc402+_0x22eb('0x75')]=_0x49f362['id'];_0x40999d[_0x3fc402+'InteractionId']=_0x49f362[_0x22eb('0x71')]['id'];_0x40999d[_0x22eb('0x76')+_0x3fc402+_0x2d422b+'Id']=_0x49f362[_0x22eb('0x72')]['id'];_0x40999d['To'+_0x3fc402+_0x22eb('0x77')]=_0x1057f2['id'];return db[_0x3fc402+_0x22eb('0x78')][_0x22eb('0x79')](_0x40999d);})[_0x22eb('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x532a59,'interaction':_0x49f362[_0x22eb('0x71')],'message':_0x49f362,'account':_0x49f362[_0x22eb('0x72')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1057f2['name']+','+(_0x49f362[_0x22eb('0x72')][_0x22eb('0x7a')]||0x12c),'interval':_0x22eb('0x7b')}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x1e541f,null))[_0x22eb('0x17')](handleError(_0x1e541f,null));};};exports['agentNotify']=function(_0x4e6fa6,_0x41fa99){var _0x18abf4,_0x5cf5e5;if(_[_0x22eb('0x11')](_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x448fea=_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x7c')];var _0x402c2c=_[_0x22eb('0x69')](_0x448fea);var _0x195f58=_0x448fea===_0x22eb('0x6a')?_0x22eb('0x6b'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x4e6fa6[_0x22eb('0x1d')]['id'],'role':'agent'}})['then'](function(_0x4170a5){if(_[_0x22eb('0x11')](_0x4170a5)){throw new Error('Agent\x20not\x20found');}_0x18abf4=_0x4170a5;return db[_0x402c2c+_0x22eb('0x6e')][_0x22eb('0x6f')]({'where':{'id':_0x4e6fa6[_0x22eb('0x22')][_0x22eb('0x70')]},'include':[{'model':db[_0x402c2c+'Interaction'],'as':_0x22eb('0x71')},{'model':db[_0x402c2c+_0x195f58],'as':_0x22eb('0x72')}]});})[_0x22eb('0x9')](function(_0x536f29){if(_['isNil'](_0x536f29)){throw new Error(_0x402c2c+'\x20Message\x20not\x20found');}_0x5cf5e5=_0x536f29;return _0x536f29[_0x22eb('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x22eb('0x9')](function(){var _0x48fa11={'uniqueid':_0x448fea+'.'+_0x5cf5e5['id']+'.'+_0x5cf5e5['Interaction']['id'],'FromUserId':_0x4e6fa6[_0x22eb('0x32')]['id'],'type':'queue','ToUserId':_0x18abf4['id']};_0x48fa11[_0x402c2c+'MessageId']=_0x5cf5e5['id'];_0x48fa11[_0x402c2c+_0x22eb('0x7d')]=_0x5cf5e5[_0x22eb('0x71')]['id'];_0x48fa11['From'+_0x402c2c+_0x195f58+'Id']=_0x5cf5e5['Account']['id'];return db[_0x402c2c+_0x22eb('0x78')][_0x22eb('0x79')](_0x48fa11);})[_0x22eb('0x9')](function(){return respondWithRpcPromise(_0x22eb('0x7e'),{'channel':_0x448fea,'interaction':_0x5cf5e5[_0x22eb('0x71')],'message':_0x5cf5e5,'account':_0x5cf5e5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x18abf4[_0x22eb('0x10')]+','+(_0x5cf5e5[_0x22eb('0x72')][_0x22eb('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x22eb('0x9')](respondWithResult(_0x41fa99,null))['catch'](handleError(_0x41fa99,null));}; \ No newline at end of file +var _0xdc97=['agents','Agents','agentCapacity','user','interaction','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','TransferReport','create','Start','queue','*,*,*,*','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','InteractionId','bluebird','moment','lodash','../../mysqldb','api','jayson/promise','http','client','request','then','error','code','message','json','sendStatus','name','status','send','isNil','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesChannels','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels'];(function(_0x3a0a00,_0x74087c){var _0x34a197=function(_0x562377){while(--_0x562377){_0x3a0a00['push'](_0x3a0a00['shift']());}};_0x34a197(++_0x74087c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x140a6a,_0x39cd8b){_0x140a6a=_0x140a6a-0x0;var _0x56c513=_0xdc97[_0x140a6a];return _0x56c513;};'use strict';var BPromise=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var _=require(_0x7dc9('0x2'));var util=require('util');var db=require(_0x7dc9('0x3'))['db'];var logger=require('../../config/logger')(_0x7dc9('0x4'));var jayson=require(_0x7dc9('0x5'));var amiClient=jayson['client'][_0x7dc9('0x6')]({'port':0x232a});var mailClient=jayson[_0x7dc9('0x7')][_0x7dc9('0x6')]({'port':0x232b});var routingClient=jayson[_0x7dc9('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){var _0x3318ea=_0x4b3229?_0x4b3229:amiClient;return _0x3318ea[_0x7dc9('0x8')](_0x2636ef,_0x4f91c7)[_0x7dc9('0x9')](function(_0x5ca05b){if(_0x5ca05b[_0x7dc9('0xa')]){if(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xb')]===0x1f4){return _0x23737d(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}return _0x2ff923(_0x5ca05b[_0x7dc9('0xa')][_0x7dc9('0xc')]);}else{_0x2ff923(_0x5ca05b['result']);}})['catch'](function(_0x4be1c8){_0x23737d(_0x4be1c8);});});}function respondWithResult(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xc8;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['status'](_0x94c75a)[_0x7dc9('0xd')](_0x14e5db);}return _0x599ef1[_0x7dc9('0xe')](0x194);};}function handleError(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0x1f4;return function(_0x31d43d){logger[_0x7dc9('0xa')](_0x31d43d['stack']);if(_0x31d43d[_0x7dc9('0xf')]){delete _0x31d43d[_0x7dc9('0xf')];}_0xaadf2[_0x7dc9('0x10')](_0xf37bc7)[_0x7dc9('0x11')](_0x31d43d);};}function findById(_0x11606f){return function(_0xbe0437){if(!_[_0x7dc9('0x12')](_0x11606f)&&!_[_0x7dc9('0x12')](_0xbe0437)&&!_[_0x7dc9('0x12')](_0xbe0437['rows'])){return _[_0x7dc9('0x13')](_0xbe0437['rows'],function(_0x1f5906){return _0x1f5906['id']==_0x11606f;});}return null;};}exports[_0x7dc9('0x14')]=function(_0x5d61d7,_0x41f66e){return respondWithRpcPromise(_0x7dc9('0x15'),_0x5d61d7[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x41f66e,null))[_0x7dc9('0x17')](handleError(_0x41f66e,null));};exports[_0x7dc9('0x18')]=function(_0x2dad65,_0x2895f5){return respondWithRpcPromise(_0x7dc9('0x19'),_[_0x7dc9('0x1a')](_0x2dad65['query'],_0x2dad65['params']))[_0x7dc9('0x9')](respondWithResult(_0x2895f5,null))[_0x7dc9('0x17')](handleError(_0x2895f5,null));};exports['voiceChannelStopMixMonitor']=function(_0x349001,_0x27f7fa){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7dc9('0x1a')](_0x349001[_0x7dc9('0x16')],_0x349001[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x27f7fa,null))[_0x7dc9('0x17')](handleError(_0x27f7fa,null));};exports[_0x7dc9('0x1c')]=function(_0xf95336,_0x55a482){return respondWithRpcPromise('VoiceQueues',_0xf95336['query'])[_0x7dc9('0x9')](respondWithResult(_0x55a482,null))[_0x7dc9('0x17')](handleError(_0x55a482,null));};exports['showVoiceQueues']=function(_0x585eef,_0x47771b){return respondWithRpcPromise('VoiceQueues',_0x585eef[_0x7dc9('0x16')])[_0x7dc9('0x9')](findById(_0x585eef[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x47771b,null))[_0x7dc9('0x17')](handleError(_0x47771b,null));};exports[_0x7dc9('0x1d')]=function(_0x236d42,_0x229f8e){return respondWithRpcPromise(_0x7dc9('0x1e'),_[_0x7dc9('0x1a')](_0x236d42[_0x7dc9('0x1f')],_0x236d42[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x229f8e,null))['catch'](handleError(_0x229f8e,null));};exports['voiceQueuesPreview']=function(_0x49a4a5,_0x4a68f0){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x49a4a5['query'],_0x49a4a5[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4a68f0,null))[_0x7dc9('0x17')](handleError(_0x4a68f0,null));};exports[_0x7dc9('0x20')]=function(_0x3300ff,_0x154e22){return respondWithRpcPromise('VoiceQueuesChannels',_0x3300ff['query'])['then'](respondWithResult(_0x154e22,null))[_0x7dc9('0x17')](handleError(_0x154e22,null));};exports['voiceQueuesChannel']=function(_0x2b9ca0,_0x448e46){return respondWithRpcPromise(_0x7dc9('0x21'),_[_0x7dc9('0x1a')](_0x2b9ca0[_0x7dc9('0x16')],_0x2b9ca0[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x448e46,null))[_0x7dc9('0x17')](handleError(_0x448e46,null));};exports['voiceQueuesChannelHangup']=function(_0x2b56d7,_0x4cdec4){return respondWithRpcPromise(_0x7dc9('0x22'),_[_0x7dc9('0x1a')](_0x2b56d7[_0x7dc9('0x16')],_0x2b56d7[_0x7dc9('0x1b')]))['then'](respondWithResult(_0x4cdec4,null))[_0x7dc9('0x17')](handleError(_0x4cdec4,null));};exports['voiceQueuesChannelRedirect']=function(_0x289560,_0x4f47af){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x7dc9('0x1a')](_0x289560[_0x7dc9('0x16')],_0x289560[_0x7dc9('0x1b')]))[_0x7dc9('0x9')](respondWithResult(_0x4f47af,null))['catch'](handleError(_0x4f47af,null));};exports[_0x7dc9('0x23')]=function(_0x183d87,_0x138f33){return respondWithRpcPromise(_0x7dc9('0x24'),_0x183d87[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x138f33,null))[_0x7dc9('0x17')](handleError(_0x138f33,null));};exports[_0x7dc9('0x25')]=function(_0x166906,_0x21bcfc){return respondWithRpcPromise(_0x7dc9('0x26'),_0x166906[_0x7dc9('0x16')])['then'](respondWithResult(_0x21bcfc,null))[_0x7dc9('0x17')](handleError(_0x21bcfc,null));};exports[_0x7dc9('0x27')]=function(_0x466b02,_0xfd2612){var _0x4bcdce;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')])[_0x7dc9('0x9')](function(_0x3876b6){_0x4bcdce=_0x3876b6;return respondWithRpcPromise(_0x7dc9('0x28'),_0x466b02[_0x7dc9('0x16')],routingClient);})['then'](function(_0x553230){return _[_0x7dc9('0x1a')]({},_0x553230,_0x4bcdce);})[_0x7dc9('0x9')](respondWithResult(_0xfd2612,null))['catch'](handleError(_0xfd2612,null));};exports[_0x7dc9('0x29')]=function(_0x4a37ec,_0x315d65){if(_0x4a37ec[_0x7dc9('0x1f')]&&_0x4a37ec[_0x7dc9('0x1f')]['interaction']&&_0x4a37ec[_0x7dc9('0x2a')]&&_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]){for(var _0x95513c in _0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')]){if(_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x7dc9('0x2c')](_0x95513c)){db['MemberReport']['findAll']({'where':{'channel':_0x95513c,'membername':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')],'type':_0x7dc9('0x2d'),'exitAt':null,'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c]&&_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')]?{'$notIn':_0x4a37ec[_0x7dc9('0x1f')]['interaction'][_0x95513c]}:{'$ne':null}}})[_0x7dc9('0x9')](function(_0x1971c7){var _0x3c4d4c=moment()[_0x7dc9('0x2f')](_0x7dc9('0x30'));for(var _0x19957f=0x0,_0x575393=_0x1971c7[_0x7dc9('0x2e')];_0x19957f<_0x575393;_0x19957f+=0x1){_0x1971c7[_0x19957f][_0x7dc9('0x31')]({'exitAt':_0x3c4d4c});}});for(var _0x49bffe=0x0;_0x49bffe<_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x7dc9('0x2e')];_0x49bffe+=0x1){db['MemberReport'][_0x7dc9('0x32')]({'where':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'type':_0x7dc9('0x2d'),'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe],'exitAt':null},'defaults':{'channel':_0x95513c,'membername':_0x4a37ec['user']['name'],'interface':_[_0x7dc9('0x12')](_0x4a37ec['user'][_0x7dc9('0x33')])?util[_0x7dc9('0x2f')]('SIP/%s',_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0xf')]):_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x33')],'type':_0x7dc9('0x2d'),'enterAt':moment()[_0x7dc9('0x2f')](_0x7dc9('0x30')),'role':_0x7dc9('0x34'),'internal':_0x4a37ec[_0x7dc9('0x2a')][_0x7dc9('0x35')],'uniqueid':_0x4a37ec[_0x7dc9('0x1f')][_0x7dc9('0x2b')][_0x95513c][_0x49bffe]}});}}}}return respondWithRpcPromise(_0x7dc9('0x36'),{'id':_0x4a37ec['params']['id'],'capacity':_0x4a37ec[_0x7dc9('0x1f')]['capacity']},routingClient)['then'](respondWithResult(_0x315d65,null))[_0x7dc9('0x17')](handleError(_0x315d65,null));};exports[_0x7dc9('0x37')]=function(_0x40e382,_0x3902aa){return respondWithRpcPromise(_0x7dc9('0x38'),_0x40e382['query'])[_0x7dc9('0x9')](respondWithResult(_0x3902aa,null))[_0x7dc9('0x17')](handleError(_0x3902aa,null));};exports[_0x7dc9('0x39')]=function(_0x4a9b75,_0x341909){return respondWithRpcPromise(_0x7dc9('0x3a'),_0x4a9b75[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x341909,null))[_0x7dc9('0x17')](handleError(_0x341909,null));};exports[_0x7dc9('0x3b')]=function(_0x593132,_0x366b8b){return respondWithRpcPromise(_0x7dc9('0x3c'),_0x593132[_0x7dc9('0x16')])[_0x7dc9('0x9')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x3d')]=function(_0x31baf1,_0x24abb6){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x31baf1[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x24abb6,null))[_0x7dc9('0x17')](handleError(_0x24abb6,null));};exports['showChatQueues']=function(_0x1767b6,_0x39be46){return respondWithRpcPromise(_0x7dc9('0x3e'),_0x1767b6[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x1767b6['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x39be46,null))[_0x7dc9('0x17')](handleError(_0x39be46,null));};exports[_0x7dc9('0x3f')]=function(_0x17ed6c,_0x2a1db8){return respondWithRpcPromise(_0x7dc9('0x40'),_0x17ed6c['query'],routingClient)['then'](respondWithResult(_0x2a1db8,null))['catch'](handleError(_0x2a1db8,null));};exports[_0x7dc9('0x41')]=function(_0x3daf33,_0x32a64f){return respondWithRpcPromise(_0x7dc9('0x40'),_0x3daf33['query'],routingClient)['then'](findById(_0x3daf33[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x32a64f,null))[_0x7dc9('0x17')](handleError(_0x32a64f,null));};exports[_0x7dc9('0x42')]=function(_0x2caf7f,_0x2272ef){return respondWithRpcPromise(_0x7dc9('0x43'),_0x2caf7f['query'],mailClient)[_0x7dc9('0x9')](respondWithResult(_0x2272ef,null))[_0x7dc9('0x17')](handleError(_0x2272ef,null));};exports[_0x7dc9('0x44')]=function(_0x1dad95,_0x4683b3){return respondWithRpcPromise('OpenchannelQueues',_0x1dad95[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x4683b3,null))[_0x7dc9('0x17')](handleError(_0x4683b3,null));};exports[_0x7dc9('0x45')]=function(_0x2454d7,_0x3a93c4){return respondWithRpcPromise(_0x7dc9('0x46'),_0x2454d7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x2454d7[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0x3a93c4,null))[_0x7dc9('0x17')](handleError(_0x3a93c4,null));};exports[_0x7dc9('0x47')]=function(_0x5eee27,_0x3485b6){return respondWithRpcPromise('SmsQueues',_0x5eee27[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3485b6,null))['catch'](handleError(_0x3485b6,null));};exports[_0x7dc9('0x48')]=function(_0x24d2c7,_0x50e9a9){return respondWithRpcPromise(_0x7dc9('0x49'),_0x24d2c7[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x24d2c7['params']['id']))['then'](respondWithResult(_0x50e9a9,null))[_0x7dc9('0x17')](handleError(_0x50e9a9,null));};exports[_0x7dc9('0x4a')]=function(_0x4ed60e,_0x3aba59){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x4ed60e[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3aba59,null))[_0x7dc9('0x17')](handleError(_0x3aba59,null));};exports[_0x7dc9('0x4c')]=function(_0x51b834,_0x35f31e){return respondWithRpcPromise(_0x7dc9('0x4b'),_0x51b834[_0x7dc9('0x16')],routingClient)['then'](findById(_0x51b834['params']['id']))[_0x7dc9('0x9')](respondWithResult(_0x35f31e,null))[_0x7dc9('0x17')](handleError(_0x35f31e,null));};exports[_0x7dc9('0x4d')]=function(_0x2cf485,_0x59f3bd){return respondWithRpcPromise('FaxQueues',_0x2cf485[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x59f3bd,null))[_0x7dc9('0x17')](handleError(_0x59f3bd,null));};exports[_0x7dc9('0x4e')]=function(_0x5d211b,_0xea1728){return respondWithRpcPromise(_0x7dc9('0x4f'),_0x5d211b[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](findById(_0x5d211b[_0x7dc9('0x1b')]['id']))[_0x7dc9('0x9')](respondWithResult(_0xea1728,null))[_0x7dc9('0x17')](handleError(_0xea1728,null));};exports['faxAccounts']=function(_0x2d7c33,_0x2cde0c){return respondWithRpcPromise('FaxAccounts',_0x2d7c33['query'])[_0x7dc9('0x9')](respondWithResult(_0x2cde0c,null))['catch'](handleError(_0x2cde0c,null));};exports[_0x7dc9('0x50')]=function(_0x466602,_0xd99a2){return respondWithRpcPromise(_0x7dc9('0x51'),_0x466602[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0xd99a2,null))[_0x7dc9('0x17')](handleError(_0xd99a2,null));};exports[_0x7dc9('0x52')]=function(_0x25f970,_0x30ce2f){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x25f970[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x30ce2f,null))[_0x7dc9('0x17')](handleError(_0x30ce2f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x45c1b3,_0x585e42){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x45c1b3[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x585e42,null))['catch'](handleError(_0x585e42,null));};exports[_0x7dc9('0x53')]=function(_0x533738,_0x5a585a){return respondWithRpcPromise(_0x7dc9('0x54'),_0x533738[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](function(_0xb8be9){if(_0x533738['query'][_0x7dc9('0x55')]!==undefined){var _0xe944a4=_(_0xb8be9[_0x7dc9('0x56')])[_0x7dc9('0x57')]([_0x533738[_0x7dc9('0x16')][_0x7dc9('0x55')],_0x533738[_0x7dc9('0x1b')]['id']])[_0x7dc9('0x58')]('queue_id')['uniq']()[_0x7dc9('0x59')]();return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x1da142){return _0xe944a4[_0x7dc9('0x5a')](_0x1da142[_0x7dc9('0x5b')])>-0x1;});}else{return _0xb8be9['rows'][_0x7dc9('0x57')](function(_0x51a7e5){return _0x51a7e5['queue_id']===parseInt(_0x533738[_0x7dc9('0x1b')]['id']);});}})[_0x7dc9('0x9')](respondWithResult(_0x5a585a,null))[_0x7dc9('0x17')](handleError(_0x5a585a,null));};exports[_0x7dc9('0x5c')]=function(_0x5bc1c3,_0x2c3434){return respondWithRpcPromise(_0x7dc9('0x5d'),_0x5bc1c3['query'],routingClient)['then'](respondWithResult(_0x2c3434,null))[_0x7dc9('0x17')](handleError(_0x2c3434,null));};exports[_0x7dc9('0x5e')]=function(_0x49d7ef,_0x114078){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x49d7ef[_0x7dc9('0x16')],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x114078,null))[_0x7dc9('0x17')](handleError(_0x114078,null));};exports['faxQueuesWaitingInteractions']=function(_0x33d68c,_0x3c7daf){return respondWithRpcPromise(_0x7dc9('0x5f'),_0x33d68c['query'],routingClient)[_0x7dc9('0x9')](respondWithResult(_0x3c7daf,null))['catch'](handleError(_0x3c7daf,null));};exports['queueNotify']=function(_0xa899){return function(_0x26244a,_0x31faa4){var _0x3657b6,_0x26d94e;var _0x56a00d=_[_0x7dc9('0x60')](_0xa899);var _0x1daf80=_0xa899===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x56a00d+'Queue'][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x26244a[_0x7dc9('0x1b')]['id']}})[_0x7dc9('0x9')](function(_0x200df7){if(_['isNil'](_0x200df7)){throw new Error(_0x56a00d+_0x7dc9('0x65'));}_0x3657b6=_0x200df7;return db[_0x56a00d+'Message']['findOne']({'where':{'id':_0x26244a[_0x7dc9('0x1f')]['messageId']},'include':[{'model':db[_0x56a00d+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x56a00d+_0x1daf80],'as':_0x7dc9('0x63')}]});})[_0x7dc9('0x9')](function(_0x38dccc){if(_[_0x7dc9('0x12')](_0x38dccc)){throw new Error(_0x56a00d+'\x20Message\x20not\x20found');}_0x26d94e=_0x38dccc;return _0x38dccc[_0x7dc9('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x1a4bfb={'uniqueid':_0xa899+'.'+_0x26d94e['id']+'.'+_0x26d94e[_0x7dc9('0x66')]['id'],'FromUserId':_0x26244a[_0x7dc9('0x2a')]['id'],'type':'queue'};_0x1a4bfb[_0x56a00d+_0x7dc9('0x68')]=_0x26d94e['id'];_0x1a4bfb[_0x56a00d+'InteractionId']=_0x26d94e[_0x7dc9('0x66')]['id'];_0x1a4bfb[_0x7dc9('0x69')+_0x56a00d+_0x1daf80+'Id']=_0x26d94e[_0x7dc9('0x63')]['id'];_0x1a4bfb['To'+_0x56a00d+'QueueId']=_0x3657b6['id'];return db[_0x56a00d+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x1a4bfb);})['then'](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0xa899,'interaction':_0x26d94e[_0x7dc9('0x66')],'message':_0x26d94e,'account':_0x26d94e[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x6d'),'appdata':_0x3657b6['name']+','+(_0x26d94e[_0x7dc9('0x63')]['queueTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})[_0x7dc9('0x9')](respondWithResult(_0x31faa4,null))[_0x7dc9('0x17')](handleError(_0x31faa4,null));};};exports['agentNotify']=function(_0x160bf0,_0x4588a7){var _0x23da2e,_0x568705;if(_['isNil'](_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x573fa9=_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x6f')];var _0x5f3487=_[_0x7dc9('0x60')](_0x573fa9);var _0x5a44a1=_0x573fa9===_0x7dc9('0x61')?_0x7dc9('0x62'):_0x7dc9('0x63');return db[_0x7dc9('0x70')][_0x7dc9('0x64')]({'raw':!![],'where':{'id':_0x160bf0[_0x7dc9('0x1b')]['id'],'role':'agent'}})[_0x7dc9('0x9')](function(_0x3fb268){if(_[_0x7dc9('0x12')](_0x3fb268)){throw new Error(_0x7dc9('0x71'));}_0x23da2e=_0x3fb268;return db[_0x5f3487+_0x7dc9('0x72')]['findOne']({'where':{'id':_0x160bf0[_0x7dc9('0x1f')][_0x7dc9('0x73')]},'include':[{'model':db[_0x5f3487+_0x7dc9('0x66')],'as':_0x7dc9('0x66')},{'model':db[_0x5f3487+_0x5a44a1],'as':'Account'}]});})[_0x7dc9('0x9')](function(_0x54bd64){if(_['isNil'](_0x54bd64)){throw new Error(_0x5f3487+_0x7dc9('0x74'));}_0x568705=_0x54bd64;return _0x54bd64['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7dc9('0x9')](function(){var _0x19c880={'uniqueid':_0x573fa9+'.'+_0x568705['id']+'.'+_0x568705[_0x7dc9('0x66')]['id'],'FromUserId':_0x160bf0[_0x7dc9('0x2a')]['id'],'type':_0x7dc9('0x6d'),'ToUserId':_0x23da2e['id']};_0x19c880[_0x5f3487+_0x7dc9('0x68')]=_0x568705['id'];_0x19c880[_0x5f3487+_0x7dc9('0x75')]=_0x568705[_0x7dc9('0x66')]['id'];_0x19c880['From'+_0x5f3487+_0x5a44a1+'Id']=_0x568705[_0x7dc9('0x63')]['id'];return db[_0x5f3487+_0x7dc9('0x6a')][_0x7dc9('0x6b')](_0x19c880);})[_0x7dc9('0x9')](function(){return respondWithRpcPromise(_0x7dc9('0x6c'),{'channel':_0x573fa9,'interaction':_0x568705['Interaction'],'message':_0x568705,'account':_0x568705[_0x7dc9('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7dc9('0x34'),'appdata':_0x23da2e[_0x7dc9('0xf')]+','+(_0x568705[_0x7dc9('0x63')]['agentTransferTimeout']||0x12c),'interval':_0x7dc9('0x6e')}]},routingClient);})['then'](respondWithResult(_0x4588a7,null))[_0x7dc9('0x17')](handleError(_0x4588a7,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4a76077..d95a236 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 _0xb830=['../../config/environment','isAuthenticated','get','show','/:id/run','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x189cbc,_0x18aa5a){var _0x31d0db=function(_0x2d4280){while(--_0x2d4280){_0x189cbc['push'](_0x189cbc['shift']());}};_0x31d0db(++_0x18aa5a);}(_0xb830,0xd4));var _0x0b83=function(_0x5c07ce,_0x2a2da9){_0x5c07ce=_0x5c07ce-0x0;var _0x14499d=_0xb830[_0x5c07ce];return _0x14499d;};'use strict';var multer=require(_0x0b83('0x0'));var util=require(_0x0b83('0x1'));var path=require(_0x0b83('0x2'));var timeout=require(_0x0b83('0x3'));var express=require(_0x0b83('0x4'));var router=express[_0x0b83('0x5')]();var fs_extra=require(_0x0b83('0x6'));var auth=require(_0x0b83('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0b83('0x8'));var controller=require('./schedule.controller');router['get']('/',auth[_0x0b83('0x9')](),controller['index']);router[_0x0b83('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0b83('0xb')]);router[_0x0b83('0xa')](_0x0b83('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x0b83('0xd')]('/',auth[_0x0b83('0x9')](),controller[_0x0b83('0xe')]);router[_0x0b83('0xf')](_0x0b83('0x10'),auth[_0x0b83('0x9')](),controller[_0x0b83('0x11')]);router[_0x0b83('0x12')](_0x0b83('0x10'),auth[_0x0b83('0x9')](),controller[_0x0b83('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6aed=['Router','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/run','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aed,0xcd));var _0xd6ae=function(_0x55b566,_0x5916d9){_0x55b566=_0x55b566-0x0;var _0x212ff9=_0x6aed[_0x55b566];return _0x212ff9;};'use strict';var multer=require(_0xd6ae('0x0'));var util=require(_0xd6ae('0x1'));var path=require(_0xd6ae('0x2'));var timeout=require(_0xd6ae('0x3'));var express=require(_0xd6ae('0x4'));var router=express[_0xd6ae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd6ae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd6ae('0x7'));var controller=require('./schedule.controller');router[_0xd6ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6ae('0x9')]);router[_0xd6ae('0x8')](_0xd6ae('0xa'),auth['isAuthenticated'](),controller[_0xd6ae('0xb')]);router[_0xd6ae('0x8')](_0xd6ae('0xc'),auth['isAuthenticated'](),controller['run']);router[_0xd6ae('0xd')]('/',auth[_0xd6ae('0xe')](),controller[_0xd6ae('0xf')]);router[_0xd6ae('0x10')](_0xd6ae('0xa'),auth[_0xd6ae('0xe')](),controller[_0xd6ae('0x11')]);router[_0xd6ae('0x12')](_0xd6ae('0xa'),auth[_0xd6ae('0xe')](),controller[_0xd6ae('0x13')]);module[_0xd6ae('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 fa921bc..84c210c 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 _0xddc4=['BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','days','hours','minutes','csv','pdf','xlsx','default','custom'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xddc4,0xd3));var _0x4ddc=function(_0x215fd8,_0x8a1309){_0x215fd8=_0x215fd8-0x0;var _0x5e453a=_0xddc4[_0x215fd8];return _0x5e453a;};'use strict';var Sequelize=require(_0x4ddc('0x0'));module[_0x4ddc('0x1')]={'name':{'type':Sequelize[_0x4ddc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4ddc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4ddc('0x2')],'allowNull':![],'defaultValue':_0x4ddc('0x3')},'startAt':{'type':Sequelize[_0x4ddc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4ddc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4ddc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4ddc('0x6')](_0x4ddc('0x7'),'quarters',_0x4ddc('0x8'),'weeks',_0x4ddc('0x9'),_0x4ddc('0xa'),_0x4ddc('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x4ddc('0xc'),_0x4ddc('0xd'),_0x4ddc('0xe')),'allowNull':![],'defaultValue':_0x4ddc('0xc')},'type':{'type':Sequelize[_0x4ddc('0x6')]('custom',_0x4ddc('0xf')),'allowNull':![],'defaultValue':_0x4ddc('0x10')},'sendMail':{'type':Sequelize[_0x4ddc('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4ddc('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x60b1=['hours','minutes','csv','pdf','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days'];(function(_0x255ee5,_0x34e2b8){var _0x29fd17=function(_0x13bddb){while(--_0x13bddb){_0x255ee5['push'](_0x255ee5['shift']());}};_0x29fd17(++_0x34e2b8);}(_0x60b1,0x72));var _0x160b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60b1[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x160b('0x0'));module[_0x160b('0x1')]={'name':{'type':Sequelize[_0x160b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x160b('0x2')]},'active':{'type':Sequelize[_0x160b('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x160b('0x2')],'allowNull':![],'defaultValue':_0x160b('0x4')},'startAt':{'type':Sequelize[_0x160b('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x160b('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x160b('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x160b('0x7')]('years',_0x160b('0x8'),_0x160b('0x9'),_0x160b('0xa'),_0x160b('0xb'),_0x160b('0xc'),_0x160b('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x160b('0x7')](_0x160b('0xe'),_0x160b('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x160b('0xe')},'type':{'type':Sequelize['ENUM'](_0x160b('0x10'),'default'),'allowNull':![],'defaultValue':_0x160b('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x160b('0x2')]},'cc':{'type':Sequelize[_0x160b('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x160b('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 9678a01..fe286cb 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 _0x6a6a=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','json','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','crypto'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6a6a,0x1a4));var _0xa6a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6a6a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa6a6('0x0'));var jsonpatch=require(_0xa6a6('0x1'));var rp=require(_0xa6a6('0x2'));var moment=require(_0xa6a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa6a6('0x4'));var util=require(_0xa6a6('0x5'));var path=require(_0xa6a6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6a6('0x7'));var fs=require('fs');var fs_extra=require(_0xa6a6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6a6('0x9'));var jsforce=require(_0xa6a6('0xa'));var deskjs=require(_0xa6a6('0xb'));var toCsv=require(_0xa6a6('0xc'));var querystring=require(_0xa6a6('0xd'));var Papa=require('papaparse');var Redis=require(_0xa6a6('0xe'));var authService=require(_0xa6a6('0xf'));var qs=require(_0xa6a6('0x10'));var as=require(_0xa6a6('0x11'));var hardwareService=require(_0xa6a6('0x12'));var logger=require(_0xa6a6('0x13'))(_0xa6a6('0x14'));var utils=require(_0xa6a6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa6a6('0x16'));var db=require(_0xa6a6('0x17'))['db'];function respondWithStatusCode(_0x2b5053,_0x4666d1){_0x4666d1=_0x4666d1||0xcc;return function(_0x3a822c){if(_0x3a822c){return _0x2b5053[_0xa6a6('0x18')](_0x4666d1);}return _0x2b5053[_0xa6a6('0x19')](_0x4666d1)[_0xa6a6('0x1a')]();};}function respondWithResult(_0x257c29,_0x576dc7){_0x576dc7=_0x576dc7||0xc8;return function(_0x1c00ad){if(_0x1c00ad){return _0x257c29['status'](_0x576dc7)['json'](_0x1c00ad);}};}function respondWithFilteredResult(_0x3acc1f,_0x81c7b8){return function(_0x2f2b19){if(_0x2f2b19){var _0x41e6f=typeof _0x81c7b8['offset']===_0xa6a6('0x1b')&&typeof _0x81c7b8['limit']==='undefined';var _0x555f9a=_0x2f2b19[_0xa6a6('0x1c')];var _0x32240a=_0x41e6f?0x0:_0x81c7b8[_0xa6a6('0x1d')];var _0x1c19d5=_0x41e6f?_0x2f2b19[_0xa6a6('0x1c')]:_0x81c7b8[_0xa6a6('0x1d')]+_0x81c7b8['limit'];var _0x548f79;if(_0x1c19d5>=_0x555f9a){_0x1c19d5=_0x555f9a;_0x548f79=0xc8;}else{_0x548f79=0xce;}_0x3acc1f[_0xa6a6('0x19')](_0x548f79);return _0x3acc1f['set'](_0xa6a6('0x1e'),_0x32240a+'-'+_0x1c19d5+'/'+_0x555f9a)[_0xa6a6('0x1f')](_0x2f2b19);}return null;};}function patchUpdates(_0x3b01d7){return function(_0x21d015){try{jsonpatch[_0xa6a6('0x20')](_0x21d015,_0x3b01d7,!![]);}catch(_0x3e31f5){return BPromise[_0xa6a6('0x21')](_0x3e31f5);}return _0x21d015[_0xa6a6('0x22')]();};}function saveUpdates(_0x278970,_0x3ed457){return function(_0x91a235){if(_0x91a235){return _0x91a235['update'](_0x278970)[_0xa6a6('0x23')](function(_0xb2ff6f){return _0xb2ff6f;});}return null;};}function removeEntity(_0x5ab4ef,_0x552b40){return function(_0x30eaed){if(_0x30eaed){return _0x30eaed[_0xa6a6('0x24')]()['then'](function(){var _0x445449=_0x30eaed[_0xa6a6('0x25')]({'plain':!![]});var _0x1c6bf9=_0xa6a6('0x26');return db[_0xa6a6('0x27')][_0xa6a6('0x24')]({'where':{'type':_0x1c6bf9,'resourceId':_0x445449['id']}})[_0xa6a6('0x23')](function(){return _0x30eaed;});})['then'](function(){_0x5ab4ef[_0xa6a6('0x19')](0xcc)[_0xa6a6('0x1a')]();});}};}function handleEntityNotFound(_0x3f48b8,_0x1cb2f0){return function(_0x19b22d){if(!_0x19b22d){_0x3f48b8[_0xa6a6('0x18')](0x194);}return _0x19b22d;};}function handleError(_0x13ffe9,_0x49535c){_0x49535c=_0x49535c||0x1f4;return function(_0x5b337f){logger[_0xa6a6('0x28')](_0x5b337f['stack']);if(_0x5b337f[_0xa6a6('0x29')]){delete _0x5b337f[_0xa6a6('0x29')];}_0x13ffe9[_0xa6a6('0x19')](_0x49535c)[_0xa6a6('0x2a')](_0x5b337f);};}exports[_0xa6a6('0x2b')]=function(_0x5b2b09,_0x5f508f){var _0x25dea1={},_0x2aca50={},_0x379b4a={'count':0x0,'rows':[]};var _0x4f8eb4=_[_0xa6a6('0x2c')](db[_0xa6a6('0x2d')]['rawAttributes'],function(_0x19ee62){return{'name':_0x19ee62[_0xa6a6('0x2e')],'type':_0x19ee62[_0xa6a6('0x2f')][_0xa6a6('0x30')]};});_0x2aca50[_0xa6a6('0x31')]=_[_0xa6a6('0x2c')](_0x4f8eb4,_0xa6a6('0x29'));_0x2aca50[_0xa6a6('0x32')]=_[_0xa6a6('0x33')](_0x5b2b09[_0xa6a6('0x32')]);_0x2aca50[_0xa6a6('0x34')]=_[_0xa6a6('0x35')](_0x2aca50[_0xa6a6('0x31')],_0x2aca50[_0xa6a6('0x32')]);_0x25dea1[_0xa6a6('0x36')]=_['intersection'](_0x2aca50['model'],qs[_0xa6a6('0x37')](_0x5b2b09['query']['fields']));_0x25dea1[_0xa6a6('0x36')]=_0x25dea1[_0xa6a6('0x36')][_0xa6a6('0x38')]?_0x25dea1[_0xa6a6('0x36')]:_0x2aca50[_0xa6a6('0x31')];if(!_0x5b2b09[_0xa6a6('0x32')]['hasOwnProperty'](_0xa6a6('0x39'))){_0x25dea1['limit']=qs[_0xa6a6('0x3a')](_0x5b2b09['query'][_0xa6a6('0x3a')]);_0x25dea1['offset']=qs['offset'](_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x1d')]);}_0x25dea1[_0xa6a6('0x3b')]=qs[_0xa6a6('0x3c')](_0x5b2b09['query'][_0xa6a6('0x3c')]);_0x25dea1['where']=qs[_0xa6a6('0x34')](_[_0xa6a6('0x3d')](_0x5b2b09[_0xa6a6('0x32')],_0x2aca50['filters']),_0x4f8eb4);if(_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x3e')]){_0x25dea1[_0xa6a6('0x3f')]=_[_0xa6a6('0x40')](_0x25dea1['where'],{'$or':_[_0xa6a6('0x2c')](_0x4f8eb4,function(_0x345076){if(_0x345076['type']!==_0xa6a6('0x41')){var _0xe65868={};_0xe65868[_0x345076[_0xa6a6('0x29')]]={'$like':'%'+_0x5b2b09[_0xa6a6('0x32')][_0xa6a6('0x3e')]+'%'};return _0xe65868;}})});}_0x25dea1=_[_0xa6a6('0x40')]({},_0x25dea1,_0x5b2b09[_0xa6a6('0x42')]);var _0x42f88d={'where':_0x25dea1[_0xa6a6('0x3f')]};return db[_0xa6a6('0x2d')][_0xa6a6('0x1c')](_0x42f88d)['then'](function(_0x3c0600){_0x379b4a[_0xa6a6('0x1c')]=_0x3c0600;if(_0x5b2b09[_0xa6a6('0x32')]['includeAll']){_0x25dea1[_0xa6a6('0x43')]=[{'all':!![]}];}return db[_0xa6a6('0x2d')][_0xa6a6('0x44')](_0x25dea1);})[_0xa6a6('0x23')](function(_0xe85b13){_0x379b4a[_0xa6a6('0x45')]=_0xe85b13;return _0x379b4a;})[_0xa6a6('0x23')](respondWithFilteredResult(_0x5f508f,_0x25dea1))[_0xa6a6('0x46')](handleError(_0x5f508f,null));};exports[_0xa6a6('0x47')]=function(_0xe8b5fd,_0x149cd1){var _0x26379b={'raw':![],'where':{'id':_0xe8b5fd[_0xa6a6('0x48')]['id']}},_0x1337e1={};_0x1337e1[_0xa6a6('0x31')]=_[_0xa6a6('0x33')](db[_0xa6a6('0x2d')][_0xa6a6('0x49')]);_0x1337e1[_0xa6a6('0x32')]=_[_0xa6a6('0x33')](_0xe8b5fd[_0xa6a6('0x32')]);_0x1337e1[_0xa6a6('0x34')]=_['intersection'](_0x1337e1[_0xa6a6('0x31')],_0x1337e1[_0xa6a6('0x32')]);_0x26379b[_0xa6a6('0x36')]=_['intersection'](_0x1337e1[_0xa6a6('0x31')],qs[_0xa6a6('0x37')](_0xe8b5fd[_0xa6a6('0x32')][_0xa6a6('0x37')]));_0x26379b[_0xa6a6('0x36')]=_0x26379b[_0xa6a6('0x36')][_0xa6a6('0x38')]?_0x26379b['attributes']:_0x1337e1[_0xa6a6('0x31')];if(_0xe8b5fd[_0xa6a6('0x32')][_0xa6a6('0x4a')]){_0x26379b[_0xa6a6('0x43')]=[{'all':!![]}];}_0x26379b=_[_0xa6a6('0x40')]({},_0x26379b,_0xe8b5fd['options']);return db[_0xa6a6('0x2d')][_0xa6a6('0x4b')](_0x26379b)['then'](handleEntityNotFound(_0x149cd1,null))[_0xa6a6('0x23')](respondWithResult(_0x149cd1,null))[_0xa6a6('0x46')](handleError(_0x149cd1,null));};exports[_0xa6a6('0x4c')]=function(_0x3ddcd5,_0x5bf24b){return db[_0xa6a6('0x2d')][_0xa6a6('0x4c')](_0x3ddcd5['body'],{})[_0xa6a6('0x23')](function(_0x40905d){var _0x3d6daa=_0x3ddcd5['user']['get']({'plain':!![]});if(!_0x3d6daa)throw new Error(_0xa6a6('0x4d'));if(_0x3d6daa[_0xa6a6('0x4e')]===_0xa6a6('0x4f')){var _0x96cee8=_0x40905d[_0xa6a6('0x25')]({'plain':!![]});var _0x392c2e='Scheduler';return db['UserProfileSection']['find']({'where':{'name':_0x392c2e,'userProfileId':_0x3d6daa[_0xa6a6('0x50')]},'raw':!![]})['then'](function(_0x5ed19c){if(_0x5ed19c&&_0x5ed19c[_0xa6a6('0x51')]===0x0){return db[_0xa6a6('0x27')][_0xa6a6('0x4c')]({'name':_0x96cee8[_0xa6a6('0x29')],'resourceId':_0x96cee8['id'],'type':_0x5ed19c['name'],'sectionId':_0x5ed19c['id']},{})[_0xa6a6('0x23')](function(){return _0x40905d;});}else{return _0x40905d;}})['catch'](function(_0x3eb208){logger[_0xa6a6('0x28')](_0xa6a6('0x52'),_0x3eb208);throw _0x3eb208;});}return _0x40905d;})[_0xa6a6('0x23')](respondWithResult(_0x5bf24b,0xc9))[_0xa6a6('0x46')](handleError(_0x5bf24b,null));};exports['update']=function(_0x3ed78f,_0x476122){if(_0x3ed78f[_0xa6a6('0x53')]['id']){delete _0x3ed78f[_0xa6a6('0x53')]['id'];}return db['Schedule'][_0xa6a6('0x4b')]({'where':{'id':_0x3ed78f[_0xa6a6('0x48')]['id']}})[_0xa6a6('0x23')](handleEntityNotFound(_0x476122,null))[_0xa6a6('0x23')](saveUpdates(_0x3ed78f[_0xa6a6('0x53')],null))['then'](respondWithResult(_0x476122,null))['catch'](handleError(_0x476122,null));};exports[_0xa6a6('0x24')]=function(_0xd4eb02,_0x55fe89){return db[_0xa6a6('0x2d')]['find']({'where':{'id':_0xd4eb02[_0xa6a6('0x48')]['id']}})['then'](handleEntityNotFound(_0x55fe89,null))[_0xa6a6('0x23')](removeEntity(_0x55fe89,null))[_0xa6a6('0x46')](handleError(_0x55fe89,null));};exports[_0xa6a6('0x54')]=function(_0x5ea729,_0x29eb0f,_0x2b5c89){var _0x2b518d=require(_0xa6a6('0x55'));return db['Schedule'][_0xa6a6('0x4b')]({'where':{'id':_0x5ea729[_0xa6a6('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x29eb0f,null))[_0xa6a6('0x23')](function(){_0x2b518d[_0xa6a6('0x54')](_0x5ea729[_0xa6a6('0x48')]['id']);})[_0xa6a6('0x23')](respondWithStatusCode(_0x29eb0f,null))['catch'](handleError(_0x29eb0f,null));}; \ No newline at end of file +var _0xe5a6=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','type','key','model','keys'];(function(_0x4d2fed,_0x10cdd4){var _0x3b8b31=function(_0x17574c){while(--_0x17574c){_0x4d2fed['push'](_0x4d2fed['shift']());}};_0x3b8b31(++_0x10cdd4);}(_0xe5a6,0x11b));var _0x6e5a=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xe5a6[_0x500419];return _0x241c1a;};'use strict';var emlformat=require(_0x6e5a('0x0'));var rimraf=require(_0x6e5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e5a('0x2'));var rp=require(_0x6e5a('0x3'));var moment=require('moment');var BPromise=require(_0x6e5a('0x4'));var Mustache=require(_0x6e5a('0x5'));var util=require('util');var path=require(_0x6e5a('0x6'));var sox=require('sox');var csv=require(_0x6e5a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e5a('0x8'));var _=require(_0x6e5a('0x9'));var squel=require(_0x6e5a('0xa'));var crypto=require(_0x6e5a('0xb'));var jsforce=require(_0x6e5a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e5a('0x7'));var querystring=require(_0x6e5a('0xd'));var Papa=require('papaparse');var Redis=require(_0x6e5a('0xe'));var authService=require(_0x6e5a('0xf'));var qs=require(_0x6e5a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e5a('0x11'));var logger=require(_0x6e5a('0x12'))(_0x6e5a('0x13'));var utils=require(_0x6e5a('0x14'));var config=require(_0x6e5a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e5a('0x16'))['db'];function respondWithStatusCode(_0xfbe57c,_0x439496){_0x439496=_0x439496||0xcc;return function(_0x2a41c1){if(_0x2a41c1){return _0xfbe57c[_0x6e5a('0x17')](_0x439496);}return _0xfbe57c[_0x6e5a('0x18')](_0x439496)[_0x6e5a('0x19')]();};}function respondWithResult(_0x342f2b,_0x46064c){_0x46064c=_0x46064c||0xc8;return function(_0x1dede8){if(_0x1dede8){return _0x342f2b['status'](_0x46064c)[_0x6e5a('0x1a')](_0x1dede8);}};}function respondWithFilteredResult(_0x4d8fff,_0x2823a1){return function(_0x5c8c7a){if(_0x5c8c7a){var _0xee9da1=typeof _0x2823a1[_0x6e5a('0x1b')]===_0x6e5a('0x1c')&&typeof _0x2823a1['limit']===_0x6e5a('0x1c');var _0xbaf870=_0x5c8c7a[_0x6e5a('0x1d')];var _0x22b23b=_0xee9da1?0x0:_0x2823a1[_0x6e5a('0x1b')];var _0x2c543a=_0xee9da1?_0x5c8c7a['count']:_0x2823a1[_0x6e5a('0x1b')]+_0x2823a1[_0x6e5a('0x1e')];var _0x51ac6d;if(_0x2c543a>=_0xbaf870){_0x2c543a=_0xbaf870;_0x51ac6d=0xc8;}else{_0x51ac6d=0xce;}_0x4d8fff['status'](_0x51ac6d);return _0x4d8fff[_0x6e5a('0x1f')](_0x6e5a('0x20'),_0x22b23b+'-'+_0x2c543a+'/'+_0xbaf870)[_0x6e5a('0x1a')](_0x5c8c7a);}return null;};}function patchUpdates(_0x1038d0){return function(_0x31c5e4){try{jsonpatch['apply'](_0x31c5e4,_0x1038d0,!![]);}catch(_0x2a1f36){return BPromise['reject'](_0x2a1f36);}return _0x31c5e4[_0x6e5a('0x21')]();};}function saveUpdates(_0x426d6d,_0x3f16e6){return function(_0x4334f7){if(_0x4334f7){return _0x4334f7['update'](_0x426d6d)['then'](function(_0x2ed35e){return _0x2ed35e;});}return null;};}function removeEntity(_0x2716ca,_0x22924e){return function(_0x1e6a1c){if(_0x1e6a1c){return _0x1e6a1c[_0x6e5a('0x22')]()[_0x6e5a('0x23')](function(){var _0x284a13=_0x1e6a1c['get']({'plain':!![]});var _0x265bf0=_0x6e5a('0x24');return db[_0x6e5a('0x25')][_0x6e5a('0x22')]({'where':{'type':_0x265bf0,'resourceId':_0x284a13['id']}})[_0x6e5a('0x23')](function(){return _0x1e6a1c;});})[_0x6e5a('0x23')](function(){_0x2716ca[_0x6e5a('0x18')](0xcc)[_0x6e5a('0x19')]();});}};}function handleEntityNotFound(_0x5ae4ae,_0x5a1131){return function(_0x1871a8){if(!_0x1871a8){_0x5ae4ae[_0x6e5a('0x17')](0x194);}return _0x1871a8;};}function handleError(_0x3d7e66,_0x10333b){_0x10333b=_0x10333b||0x1f4;return function(_0x5bf840){logger[_0x6e5a('0x26')](_0x5bf840[_0x6e5a('0x27')]);if(_0x5bf840[_0x6e5a('0x28')]){delete _0x5bf840[_0x6e5a('0x28')];}_0x3d7e66[_0x6e5a('0x18')](_0x10333b)[_0x6e5a('0x29')](_0x5bf840);};}exports[_0x6e5a('0x2a')]=function(_0xe97ce8,_0x238606){var _0x1d2bae={},_0x31edc9={},_0x4eec7d={'count':0x0,'rows':[]};var _0x480ba0=_[_0x6e5a('0x2b')](db[_0x6e5a('0x2c')]['rawAttributes'],function(_0x373f23){return{'name':_0x373f23['fieldName'],'type':_0x373f23[_0x6e5a('0x2d')][_0x6e5a('0x2e')]};});_0x31edc9[_0x6e5a('0x2f')]=_[_0x6e5a('0x2b')](_0x480ba0,_0x6e5a('0x28'));_0x31edc9['query']=_[_0x6e5a('0x30')](_0xe97ce8[_0x6e5a('0x31')]);_0x31edc9[_0x6e5a('0x32')]=_[_0x6e5a('0x33')](_0x31edc9[_0x6e5a('0x2f')],_0x31edc9[_0x6e5a('0x31')]);_0x1d2bae['attributes']=_[_0x6e5a('0x33')](_0x31edc9[_0x6e5a('0x2f')],qs[_0x6e5a('0x34')](_0xe97ce8['query'][_0x6e5a('0x34')]));_0x1d2bae[_0x6e5a('0x35')]=_0x1d2bae[_0x6e5a('0x35')][_0x6e5a('0x36')]?_0x1d2bae[_0x6e5a('0x35')]:_0x31edc9[_0x6e5a('0x2f')];if(!_0xe97ce8[_0x6e5a('0x31')][_0x6e5a('0x37')](_0x6e5a('0x38'))){_0x1d2bae['limit']=qs[_0x6e5a('0x1e')](_0xe97ce8[_0x6e5a('0x31')][_0x6e5a('0x1e')]);_0x1d2bae[_0x6e5a('0x1b')]=qs['offset'](_0xe97ce8[_0x6e5a('0x31')][_0x6e5a('0x1b')]);}_0x1d2bae[_0x6e5a('0x39')]=qs[_0x6e5a('0x3a')](_0xe97ce8[_0x6e5a('0x31')]['sort']);_0x1d2bae[_0x6e5a('0x3b')]=qs['filters'](_[_0x6e5a('0x3c')](_0xe97ce8[_0x6e5a('0x31')],_0x31edc9[_0x6e5a('0x32')]),_0x480ba0);if(_0xe97ce8['query'][_0x6e5a('0x3d')]){_0x1d2bae[_0x6e5a('0x3b')]=_[_0x6e5a('0x3e')](_0x1d2bae[_0x6e5a('0x3b')],{'$or':_['map'](_0x480ba0,function(_0x10068d){if(_0x10068d['type']!==_0x6e5a('0x3f')){var _0x18e6fa={};_0x18e6fa[_0x10068d['name']]={'$like':'%'+_0xe97ce8[_0x6e5a('0x31')]['filter']+'%'};return _0x18e6fa;}})});}_0x1d2bae=_[_0x6e5a('0x3e')]({},_0x1d2bae,_0xe97ce8[_0x6e5a('0x40')]);var _0x33dd42={'where':_0x1d2bae[_0x6e5a('0x3b')]};return db[_0x6e5a('0x2c')]['count'](_0x33dd42)[_0x6e5a('0x23')](function(_0xe49d03){_0x4eec7d[_0x6e5a('0x1d')]=_0xe49d03;if(_0xe97ce8[_0x6e5a('0x31')]['includeAll']){_0x1d2bae[_0x6e5a('0x41')]=[{'all':!![]}];}return db['Schedule'][_0x6e5a('0x42')](_0x1d2bae);})['then'](function(_0x52960a){_0x4eec7d['rows']=_0x52960a;return _0x4eec7d;})['then'](respondWithFilteredResult(_0x238606,_0x1d2bae))[_0x6e5a('0x43')](handleError(_0x238606,null));};exports['show']=function(_0x5dcb7a,_0x535958){var _0x54e7c8={'raw':![],'where':{'id':_0x5dcb7a[_0x6e5a('0x44')]['id']}},_0x468e08={};_0x468e08[_0x6e5a('0x2f')]=_[_0x6e5a('0x30')](db[_0x6e5a('0x2c')][_0x6e5a('0x45')]);_0x468e08[_0x6e5a('0x31')]=_['keys'](_0x5dcb7a['query']);_0x468e08['filters']=_[_0x6e5a('0x33')](_0x468e08['model'],_0x468e08[_0x6e5a('0x31')]);_0x54e7c8['attributes']=_[_0x6e5a('0x33')](_0x468e08[_0x6e5a('0x2f')],qs[_0x6e5a('0x34')](_0x5dcb7a['query'][_0x6e5a('0x34')]));_0x54e7c8['attributes']=_0x54e7c8[_0x6e5a('0x35')]['length']?_0x54e7c8[_0x6e5a('0x35')]:_0x468e08[_0x6e5a('0x2f')];if(_0x5dcb7a['query'][_0x6e5a('0x46')]){_0x54e7c8[_0x6e5a('0x41')]=[{'all':!![]}];}_0x54e7c8=_[_0x6e5a('0x3e')]({},_0x54e7c8,_0x5dcb7a[_0x6e5a('0x40')]);return db[_0x6e5a('0x2c')][_0x6e5a('0x47')](_0x54e7c8)[_0x6e5a('0x23')](handleEntityNotFound(_0x535958,null))[_0x6e5a('0x23')](respondWithResult(_0x535958,null))[_0x6e5a('0x43')](handleError(_0x535958,null));};exports[_0x6e5a('0x48')]=function(_0x22669d,_0x52d005){return db[_0x6e5a('0x2c')][_0x6e5a('0x48')](_0x22669d[_0x6e5a('0x49')],{})[_0x6e5a('0x23')](function(_0x57712c){var _0x2c18a8=_0x22669d[_0x6e5a('0x4a')][_0x6e5a('0x4b')]({'plain':!![]});if(!_0x2c18a8)throw new Error(_0x6e5a('0x4c'));if(_0x2c18a8['role']===_0x6e5a('0x4a')){var _0x72b02e=_0x57712c['get']({'plain':!![]});var _0x210d3f=_0x6e5a('0x24');return db[_0x6e5a('0x4d')][_0x6e5a('0x47')]({'where':{'name':_0x210d3f,'userProfileId':_0x2c18a8[_0x6e5a('0x4e')]},'raw':!![]})['then'](function(_0x276649){if(_0x276649&&_0x276649[_0x6e5a('0x4f')]===0x0){return db[_0x6e5a('0x25')]['create']({'name':_0x72b02e[_0x6e5a('0x28')],'resourceId':_0x72b02e['id'],'type':_0x276649['name'],'sectionId':_0x276649['id']},{})['then'](function(){return _0x57712c;});}else{return _0x57712c;}})[_0x6e5a('0x43')](function(_0x270825){logger[_0x6e5a('0x26')](_0x6e5a('0x50'),_0x270825);throw _0x270825;});}return _0x57712c;})[_0x6e5a('0x23')](respondWithResult(_0x52d005,0xc9))[_0x6e5a('0x43')](handleError(_0x52d005,null));};exports[_0x6e5a('0x51')]=function(_0x391ceb,_0x24c03f){if(_0x391ceb[_0x6e5a('0x49')]['id']){delete _0x391ceb[_0x6e5a('0x49')]['id'];}return db[_0x6e5a('0x2c')][_0x6e5a('0x47')]({'where':{'id':_0x391ceb[_0x6e5a('0x44')]['id']}})[_0x6e5a('0x23')](handleEntityNotFound(_0x24c03f,null))['then'](saveUpdates(_0x391ceb[_0x6e5a('0x49')],null))[_0x6e5a('0x23')](respondWithResult(_0x24c03f,null))[_0x6e5a('0x43')](handleError(_0x24c03f,null));};exports[_0x6e5a('0x22')]=function(_0x266d5f,_0x2d1281){return db[_0x6e5a('0x2c')][_0x6e5a('0x47')]({'where':{'id':_0x266d5f['params']['id']}})[_0x6e5a('0x23')](handleEntityNotFound(_0x2d1281,null))[_0x6e5a('0x23')](removeEntity(_0x2d1281,null))[_0x6e5a('0x43')](handleError(_0x2d1281,null));};exports[_0x6e5a('0x52')]=function(_0x1f367f,_0x48ea19,_0x14e0da){var _0x377ebc=require('../../config/schedule');return db[_0x6e5a('0x2c')][_0x6e5a('0x47')]({'where':{'id':_0x1f367f[_0x6e5a('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x48ea19,null))['then'](function(){_0x377ebc['run'](_0x1f367f[_0x6e5a('0x44')]['id']);})[_0x6e5a('0x23')](respondWithStatusCode(_0x48ea19,null))[_0x6e5a('0x43')](handleError(_0x48ea19,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 575f451..4054e93 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 _0x9611=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules'];(function(_0x24f6c1,_0x4107b1){var _0x306978=function(_0x5433d0){while(--_0x5433d0){_0x24f6c1['push'](_0x24f6c1['shift']());}};_0x306978(++_0x4107b1);}(_0x9611,0xb6));var _0x1961=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x9611[_0x3b76f7];return _0x43984e;};'use strict';var _=require(_0x1961('0x0'));var util=require(_0x1961('0x1'));var logger=require(_0x1961('0x2'))('api');var moment=require(_0x1961('0x3'));var BPromise=require(_0x1961('0x4'));var rp=require(_0x1961('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1961('0x6'));var config=require(_0x1961('0x7'));var attributes=require(_0x1961('0x8'));module[_0x1961('0x9')]=function(_0x3c1ae8,_0x4efd5c){return _0x3c1ae8[_0x1961('0xa')](_0x1961('0xb'),attributes,{'tableName':_0x1961('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c8f=['../../config/logger','moment','path','../../config/environment','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x1f5fff,_0x3e99b4){var _0x167f6f=function(_0xba28fa){while(--_0xba28fa){_0x1f5fff['push'](_0x1f5fff['shift']());}};_0x167f6f(++_0x3e99b4);}(_0x4c8f,0xc6));var _0xf4c8=function(_0x31b20b,_0x396df5){_0x31b20b=_0x31b20b-0x0;var _0x5e7149=_0x4c8f[_0x31b20b];return _0x5e7149;};'use strict';var _=require(_0xf4c8('0x0'));var util=require(_0xf4c8('0x1'));var logger=require(_0xf4c8('0x2'))('api');var moment=require(_0xf4c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4c8('0x4'));var rimraf=require('rimraf');var config=require(_0xf4c8('0x5'));var attributes=require('./schedule.attributes');module[_0xf4c8('0x6')]=function(_0x202af1,_0x64f772){return _0x202af1[_0xf4c8('0x7')](_0xf4c8('0x8'),attributes,{'tableName':_0xf4c8('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 150143a..643056d 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 _0xeafa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x1e2f27,_0x1f40f3){var _0x538a96=function(_0x1ae561){while(--_0x1ae561){_0x1e2f27['push'](_0x1e2f27['shift']());}};_0x538a96(++_0x1f40f3);}(_0xeafa,0x133));var _0xaeaf=function(_0x4541c8,_0x19be87){_0x4541c8=_0x4541c8-0x0;var _0x1065d8=_0xeafa[_0x4541c8];return _0x1065d8;};'use strict';var _=require(_0xaeaf('0x0'));var util=require(_0xaeaf('0x1'));var moment=require('moment');var BPromise=require(_0xaeaf('0x2'));var rs=require(_0xaeaf('0x3'));var fs=require('fs');var Redis=require(_0xaeaf('0x4'));var db=require(_0xaeaf('0x5'))['db'];var utils=require(_0xaeaf('0x6'));var logger=require('../../config/logger')(_0xaeaf('0x7'));var config=require(_0xaeaf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaeaf('0x9')][_0xaeaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a119b,_0x10cda3,_0x40b7e5){return new BPromise(function(_0x322f21,_0x49ad5b){return client[_0xaeaf('0xb')](_0x5a119b,_0x40b7e5)[_0xaeaf('0xc')](function(_0x1125ff){logger[_0xaeaf('0xd')](_0xaeaf('0xe'),_0x10cda3,_0xaeaf('0xf'));logger[_0xaeaf('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x10cda3,_0xaeaf('0xf'),JSON[_0xaeaf('0x11')](_0x1125ff));if(_0x1125ff[_0xaeaf('0x12')]){if(_0x1125ff[_0xaeaf('0x12')]['code']===0x1f4){logger[_0xaeaf('0x12')](_0xaeaf('0xe'),_0x10cda3,_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);return _0x49ad5b(_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);}logger[_0xaeaf('0x12')]('Schedule,\x20%s,\x20%s',_0x10cda3,_0x1125ff[_0xaeaf('0x12')][_0xaeaf('0x13')]);return _0x322f21(_0x1125ff[_0xaeaf('0x12')]['message']);}else{logger[_0xaeaf('0xd')](_0xaeaf('0xe'),_0x10cda3,_0xaeaf('0xf'));_0x322f21(_0x1125ff[_0xaeaf('0x14')][_0xaeaf('0x13')]);}})[_0xaeaf('0x15')](function(_0x112ac4){logger[_0xaeaf('0x12')](_0xaeaf('0xe'),_0x10cda3,_0x112ac4);_0x49ad5b(_0x112ac4);});});} \ No newline at end of file +var _0x6e7d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0xf46f61,_0x69ded){var _0x158536=function(_0x303ce6){while(--_0x303ce6){_0xf46f61['push'](_0xf46f61['shift']());}};_0x158536(++_0x69ded);}(_0x6e7d,0xf0));var _0xd6e7=function(_0x33d187,_0x5cc7f9){_0x33d187=_0x33d187-0x0;var _0x5e1bc1=_0x6e7d[_0x33d187];return _0x5e1bc1;};'use strict';var _=require(_0xd6e7('0x0'));var util=require(_0xd6e7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6e7('0x2'));var db=require(_0xd6e7('0x3'))['db'];var utils=require(_0xd6e7('0x4'));var logger=require(_0xd6e7('0x5'))(_0xd6e7('0x6'));var config=require(_0xd6e7('0x7'));var jayson=require(_0xd6e7('0x8'));var client=jayson[_0xd6e7('0x9')][_0xd6e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446291,_0x3d9a90,_0x352756){return new BPromise(function(_0x5217ed,_0x46e26f){return client[_0xd6e7('0xb')](_0x446291,_0x352756)['then'](function(_0x545fde){logger[_0xd6e7('0xc')](_0xd6e7('0xd'),_0x3d9a90,_0xd6e7('0xe'));logger[_0xd6e7('0xf')](_0xd6e7('0x10'),_0x3d9a90,_0xd6e7('0xe'),JSON['stringify'](_0x545fde));if(_0x545fde[_0xd6e7('0x11')]){if(_0x545fde[_0xd6e7('0x11')][_0xd6e7('0x12')]===0x1f4){logger[_0xd6e7('0x11')](_0xd6e7('0xd'),_0x3d9a90,_0x545fde[_0xd6e7('0x11')][_0xd6e7('0x13')]);return _0x46e26f(_0x545fde[_0xd6e7('0x11')]['message']);}logger['error'](_0xd6e7('0xd'),_0x3d9a90,_0x545fde['error'][_0xd6e7('0x13')]);return _0x5217ed(_0x545fde[_0xd6e7('0x11')]['message']);}else{logger[_0xd6e7('0xc')](_0xd6e7('0xd'),_0x3d9a90,'request\x20sent');_0x5217ed(_0x545fde[_0xd6e7('0x14')]['message']);}})[_0xd6e7('0x15')](function(_0x17e228){logger[_0xd6e7('0x11')]('Schedule,\x20%s,\x20%s',_0x3d9a90,_0x17e228);_0x46e26f(_0x17e228);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 12f51e9..e8dd063 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 _0x3757=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','download','post','create','delete','destroy'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3757,0x1a4));var _0x7375=function(_0x4b64c5,_0x433190){_0x4b64c5=_0x4b64c5-0x0;var _0x26a98d=_0x3757[_0x4b64c5];return _0x26a98d;};'use strict';var multer=require(_0x7375('0x0'));var util=require(_0x7375('0x1'));var path=require(_0x7375('0x2'));var timeout=require(_0x7375('0x3'));var express=require(_0x7375('0x4'));var router=express['Router']();var fs_extra=require(_0x7375('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7375('0x6'));var config=require(_0x7375('0x7'));var controller=require(_0x7375('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7375('0x9')]);router[_0x7375('0xa')](_0x7375('0xb'),auth[_0x7375('0xc')](),controller[_0x7375('0xd')]);router[_0x7375('0xa')](_0x7375('0xe'),auth[_0x7375('0xc')](),controller['show']);router[_0x7375('0xa')](_0x7375('0xf'),auth[_0x7375('0xc')](),controller[_0x7375('0x10')]);router[_0x7375('0x11')]('/',auth[_0x7375('0xc')](),controller[_0x7375('0x12')]);router['put'](_0x7375('0xe'),auth[_0x7375('0xc')](),controller['update']);router[_0x7375('0x13')]('/:id',auth[_0x7375('0xc')](),controller[_0x7375('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa596=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','download','post','create','put'];(function(_0x1dcc7b,_0x590202){var _0x31e8fa=function(_0x3e2148){while(--_0x3e2148){_0x1dcc7b['push'](_0x1dcc7b['shift']());}};_0x31e8fa(++_0x590202);}(_0xa596,0x7b));var _0x6a59=function(_0x268ffd,_0xee0bad){_0x268ffd=_0x268ffd-0x0;var _0x543c9b=_0xa596[_0x268ffd];return _0x543c9b;};'use strict';var multer=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var path=require('path');var timeout=require(_0x6a59('0x2'));var express=require(_0x6a59('0x3'));var router=express[_0x6a59('0x4')]();var fs_extra=require(_0x6a59('0x5'));var auth=require(_0x6a59('0x6'));var interaction=require(_0x6a59('0x7'));var config=require(_0x6a59('0x8'));var controller=require(_0x6a59('0x9'));router['get']('/',auth[_0x6a59('0xa')](),controller[_0x6a59('0xb')]);router[_0x6a59('0xc')](_0x6a59('0xd'),auth[_0x6a59('0xa')](),controller[_0x6a59('0xe')]);router['get'](_0x6a59('0xf'),auth['isAuthenticated'](),controller[_0x6a59('0x10')]);router['get']('/:id/download',auth[_0x6a59('0xa')](),controller[_0x6a59('0x11')]);router[_0x6a59('0x12')]('/',auth['isAuthenticated'](),controller[_0x6a59('0x13')]);router[_0x6a59('0x14')]('/:id',auth[_0x6a59('0xa')](),controller['update']);router[_0x6a59('0x15')](_0x6a59('0xf'),auth[_0x6a59('0xa')](),controller[_0x6a59('0x16')]);module[_0x6a59('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 371161c..55e5019 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 _0x88c3=['subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x88c3,0x1ee));var _0x388c=function(_0x27d99b,_0xfe7beb){_0x27d99b=_0x27d99b-0x0;var _0x1e1315=_0x88c3[_0x27d99b];return _0x1e1315;};'use strict';var Sequelize=require(_0x388c('0x0'));var moment=require('moment');var path=require(_0x388c('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x388c('0x2')],'get':function(){return this['getDataValue']('value')?path[_0x388c('0x3')](this[_0x388c('0x4')](_0x388c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x388c('0x6')]},'channel':{'type':Sequelize[_0x388c('0x6')]},'value':{'type':Sequelize[_0x388c('0x6')],'set':function(_0x5a1c0d){var _0x3e79d8=_0x5a1c0d[_0x388c('0x7')](/\\/g,'/');this[_0x388c('0x8')](_0x388c('0x5'),_0x3e79d8);}},'rating':{'type':Sequelize[_0x388c('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x388c('0x9')],'set':function(_0x2debe9){this[_0x388c('0x8')]('startedAt',moment()[_0x388c('0xa')](_0x2debe9,'ms'));this['setDataValue']('closedAt',moment());this[_0x388c('0x8')](_0x388c('0xb'),_0x2debe9);}},'startedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0xd')))[_0x388c('0xe')](_0x388c('0xf'))[_0x388c('0x10')]();}},'closedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x388c('0xf'))[_0x388c('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x388c('0x4')](_0x388c('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x388c('0xc')],'get':function(){return moment(this[_0x388c('0x4')]('updatedAt'))[_0x388c('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x388c('0x10')]();}}}; \ No newline at end of file +var _0xb145=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x988e4e,_0x48795b){var _0x1fccf3=function(_0x433a2f){while(--_0x433a2f){_0x988e4e['push'](_0x988e4e['shift']());}};_0x1fccf3(++_0x48795b);}(_0xb145,0xa3));var _0x5b14=function(_0x4e0b82,_0x299486){_0x4e0b82=_0x4e0b82-0x0;var _0x39c085=_0xb145[_0x4e0b82];return _0x39c085;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var config=require(_0x5b14('0x2'));module[_0x5b14('0x3')]={'format':{'type':Sequelize[_0x5b14('0x4')],'get':function(){return this[_0x5b14('0x5')](_0x5b14('0x6'))?path[_0x5b14('0x7')](this['getDataValue'](_0x5b14('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x5b14('0x8')]},'channel':{'type':Sequelize[_0x5b14('0x8')]},'value':{'type':Sequelize[_0x5b14('0x8')],'set':function(_0x50fd91){var _0x1d12ed=_0x50fd91[_0x5b14('0x9')](/\\/g,'/');this[_0x5b14('0xa')](_0x5b14('0x6'),_0x1d12ed);}},'rating':{'type':Sequelize[_0x5b14('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x32d729){this[_0x5b14('0xa')]('startedAt',moment()[_0x5b14('0xc')](_0x32d729,'ms'));this[_0x5b14('0xa')](_0x5b14('0xd'),moment());this[_0x5b14('0xa')](_0x5b14('0xe'),_0x32d729);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x5b14('0x5')]('startedAt'))[_0x5b14('0xf')](_0x5b14('0x10'))[_0x5b14('0x11')]();}},'closedAt':{'type':Sequelize[_0x5b14('0x12')],'get':function(){return moment(this[_0x5b14('0x5')](_0x5b14('0xd')))['format'](_0x5b14('0x10'))[_0x5b14('0x11')]();}},'createdAt':{'type':Sequelize[_0x5b14('0x12')],'get':function(){return moment(this[_0x5b14('0x5')](_0x5b14('0x13')))[_0x5b14('0xf')](_0x5b14('0x10'))[_0x5b14('0x11')]();}},'updatedAt':{'type':Sequelize[_0x5b14('0x12')],'get':function(){return moment(this[_0x5b14('0x5')](_0x5b14('0x14')))[_0x5b14('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x5b14('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index efa5332..611e1a9 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 _0x7bae=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','options','find','create','body','duration','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','secrets','recording','server/files/screen_recordings','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x1b701a,_0x126512){var _0xb92894=function(_0x17f1be){while(--_0x17f1be){_0x1b701a['push'](_0x1b701a['shift']());}};_0xb92894(++_0x126512);}(_0x7bae,0x13b));var _0xe7ba=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7bae[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['differenceBy'](_[_0xe7ba('0x2b')](_0x587c7d,'name'),['format']);_0x369451[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x48c869[_0xe7ba('0x31')]);_0x369451['filters']=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7[_0xe7ba('0x34')]=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x48c869['query'][_0xe7ba('0x35')]));_0x92fe7[_0xe7ba('0x34')]=_0x92fe7['attributes'][_0xe7ba('0x36')]?_0x92fe7[_0xe7ba('0x34')]:_0x369451[_0xe7ba('0x30')];if(!_0x48c869['query'][_0xe7ba('0x37')](_0xe7ba('0x38'))){_0x92fe7['limit']=qs[_0xe7ba('0x1e')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x1e')]);_0x92fe7['offset']=qs[_0xe7ba('0x20')](_0x48c869[_0xe7ba('0x31')]['offset']);}_0x92fe7[_0xe7ba('0x39')]=qs[_0xe7ba('0x3a')](_0x48c869[_0xe7ba('0x31')]['sort']);_0x92fe7['where']=qs[_0xe7ba('0x3b')](_[_0xe7ba('0x3c')](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x3b')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')]['filter']){_0x92fe7[_0xe7ba('0x3d')]=_[_0xe7ba('0x3e')](_0x92fe7[_0xe7ba('0x3d')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x5e9619){if(_0x5e9619[_0xe7ba('0x3f')]!==_0xe7ba('0x40')){var _0x46e31a={};_0x46e31a[_0x5e9619[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x41')]+'%'};return _0x46e31a;}})});}_0x92fe7=_[_0xe7ba('0x3e')]({},_0x92fe7,_0x48c869['options']);var _0x3429fa={'where':_0x92fe7[_0xe7ba('0x3d')]};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x3429fa)[_0xe7ba('0x26')](function(_0x3b3abe){_0x4bf5f9[_0xe7ba('0x1f')]=_0x3b3abe;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x42')]){_0x92fe7['include']=[{'all':!![]}];}return db[_0xe7ba('0x2c')][_0xe7ba('0x43')](_0x92fe7);})['then'](function(_0x5dae52){_0x4bf5f9[_0xe7ba('0x44')]=_0x5dae52;return _0x4bf5f9;})[_0xe7ba('0x26')](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x45')](handleError(_0x102925,null));};exports['show']=function(_0x249e1d,_0x82246e){var _0x3569b6={'raw':![],'where':{'id':_0x249e1d[_0xe7ba('0x46')]['id']}},_0x12770d={};_0x12770d['model']=_[_0xe7ba('0x32')](db['ScreenRecording'][_0xe7ba('0x2d')]);_0x12770d[_0xe7ba('0x31')]=_[_0xe7ba('0x32')](_0x249e1d[_0xe7ba('0x31')]);_0x12770d[_0xe7ba('0x3b')]=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],_0x12770d[_0xe7ba('0x31')]);_0x3569b6['attributes']=_[_0xe7ba('0x33')](_0x12770d[_0xe7ba('0x30')],qs[_0xe7ba('0x35')](_0x249e1d[_0xe7ba('0x31')][_0xe7ba('0x35')]));_0x3569b6[_0xe7ba('0x34')]=_0x3569b6[_0xe7ba('0x34')][_0xe7ba('0x36')]?_0x3569b6[_0xe7ba('0x34')]:_0x12770d[_0xe7ba('0x30')];if(_0x249e1d['query'][_0xe7ba('0x42')]){_0x3569b6['include']=[{'all':!![]}];}_0x3569b6=_[_0xe7ba('0x3e')]({},_0x3569b6,_0x249e1d[_0xe7ba('0x47')]);return db[_0xe7ba('0x2c')][_0xe7ba('0x48')](_0x3569b6)[_0xe7ba('0x26')](handleEntityNotFound(_0x82246e,null))[_0xe7ba('0x26')](respondWithResult(_0x82246e,null))['catch'](handleError(_0x82246e,null));};exports[_0xe7ba('0x49')]=function(_0x1cc668,_0x3f17ed){return db[_0xe7ba('0x2c')][_0xe7ba('0x49')](_0x1cc668[_0xe7ba('0x4a')],{})[_0xe7ba('0x26')](respondWithResult(_0x3f17ed,0xc9))[_0xe7ba('0x45')](handleError(_0x3f17ed,null));};exports[_0xe7ba('0x25')]=function(_0x1189bd,_0xbe2a32){if(_0x1189bd['body']['id']){delete _0x1189bd[_0xe7ba('0x4a')]['id'];}delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4b')];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4c')];delete _0x1189bd[_0xe7ba('0x4a')]['closedAt'];delete _0x1189bd[_0xe7ba('0x4a')][_0xe7ba('0x4d')];return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x1189bd[_0xe7ba('0x46')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0xbe2a32,null))[_0xe7ba('0x26')](saveUpdates(_0x1189bd['body'],null))['then'](respondWithResult(_0xbe2a32,null))[_0xe7ba('0x45')](handleError(_0xbe2a32,null));};exports[_0xe7ba('0x4e')]=function(_0x285743,_0x5af106){return db[_0xe7ba('0x2c')][_0xe7ba('0x4e')]()[_0xe7ba('0x26')](respondWithResult(_0x5af106,null))[_0xe7ba('0x45')](handleError(_0x5af106,null));};exports[_0xe7ba('0x4f')]=function(_0x6b6f1,_0xf3a41f,_0x5e6612){var _0x2a6fdd=require(_0xe7ba('0x50'));var _0x316b51=![];var _0x5863c8={};if(_0x6b6f1[_0xe7ba('0x31')][_0xe7ba('0x3f')]&&_0x6b6f1['query'][_0xe7ba('0x3f')]===_0xe7ba('0x51')){_0x5863c8['uniqueid']=_0x6b6f1[_0xe7ba('0x46')]['id'];}else{_0x5863c8['id']=_0x6b6f1['params']['id'];}return db[_0xe7ba('0x2c')][_0xe7ba('0x48')]({'where':_0x5863c8,'attributes':['id',_0xe7ba('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0xf3a41f,null))[_0xe7ba('0x26')](function(_0x1128be){if(_0x1128be){var _0x314549=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],'server/files/screen_recordings',_0x1128be[_0xe7ba('0x4d')]);var _0x455e50=util[_0xe7ba('0x54')](_0xe7ba('0x55'),_0x314549);if(fs[_0xe7ba('0x56')](_0x455e50)){_0x316b51=!![];return _0x2a6fdd['decryptFile'](_0x455e50,_0x314549,config[_0xe7ba('0x57')][_0xe7ba('0x58')])[_0xe7ba('0x26')](function(){return _0x1128be;});}return _0x1128be;}})[_0xe7ba('0x26')](function(_0x57b23e){if(_0x57b23e){var _0x3e31c1=path[_0xe7ba('0x52')](config[_0xe7ba('0x53')],_0xe7ba('0x59'),_0x57b23e[_0xe7ba('0x4d')]);if(!fs[_0xe7ba('0x56')](_0x3e31c1)){throw new db['Sequelize'][(_0xe7ba('0x5a'))](_0xe7ba('0x5b'));}if(_0x57b23e[_0xe7ba('0x5c')]){return _0xf3a41f['download'](_0x3e31c1,_0x57b23e[_0xe7ba('0x5c')]+path[_0xe7ba('0x5d')](_0x3e31c1),function(){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}else{return _0xf3a41f[_0xe7ba('0x4f')](_0x3e31c1,function(_0x45fb0f){if(_0x316b51){fs[_0xe7ba('0x5e')](_0x3e31c1);}});}}})[_0xe7ba('0x45')](function(_0x3351d5){if(_0x3351d5[_0xe7ba('0x5f')]===_0xe7ba('0x5b')){_0xf3a41f[_0xe7ba('0x1b')](0x194)[_0xe7ba('0x60')]('Not\x20found');}else{return handleError(_0xf3a41f,null);}});};exports[_0xe7ba('0x61')]=function(_0x384cea,_0x357af4){return db['ScreenRecording'][_0xe7ba('0x48')]({'where':{'id':_0x384cea['params']['id']}})[_0xe7ba('0x26')](function(_0x194dff){if(_[_0xe7ba('0x62')](_0x194dff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x194dff;})['then'](function(_0x46d06e){var _0x2812af=path[_0xe7ba('0x52')](config['root'],_0xe7ba('0x59'),_0x46d06e[_0xe7ba('0x4d')]);logger[_0xe7ba('0x63')](_0xe7ba('0x64'),_0x2812af);if(!_[_0xe7ba('0x62')](_0x46d06e['value'])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7ba('0x66')](_0x2812af);}_0x2812af=_0x2812af+_0xe7ba('0x67');if(!_[_0xe7ba('0x62')](_0x46d06e[_0xe7ba('0x4d')])&&fs[_0xe7ba('0x56')](_0x2812af)){logger[_0xe7ba('0x63')](_0xe7ba('0x65')+_0x2812af+_0xe7ba('0x68'));fs[_0xe7ba('0x66')](_0x2812af);}return _0x46d06e;})[_0xe7ba('0x26')](function(_0x5a5394){if(!_0x5a5394)throw new InternalError();return _0x5a5394[_0xe7ba('0x61')]();})[_0xe7ba('0x26')](function(){_0x357af4[_0xe7ba('0x1b')](0xcc)[_0xe7ba('0x1c')]();})['catch'](handleError(_0x357af4,null));}; \ No newline at end of file +var _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xa10d96,_0x513f9a){var _0x1d0fe9=function(_0x14a826){while(--_0x14a826){_0xa10d96['push'](_0xa10d96['shift']());}};_0x1d0fe9(++_0x513f9a);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f4c58a9..5c644f7 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 _0x42f9=['interactionid','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings'];(function(_0x5ebfa6,_0x35ea00){var _0x2b4bad=function(_0x25ab3d){while(--_0x25ab3d){_0x5ebfa6['push'](_0x5ebfa6['shift']());}};_0x2b4bad(++_0x35ea00);}(_0x42f9,0x15d));var _0x942f=function(_0x1b684c,_0x4c9932){_0x1b684c=_0x1b684c-0x0;var _0x513f02=_0x42f9[_0x1b684c];return _0x513f02;};'use strict';var _=require('lodash');var util=require(_0x942f('0x0'));var logger=require('../../config/logger')(_0x942f('0x1'));var moment=require('moment');var BPromise=require(_0x942f('0x2'));var rp=require(_0x942f('0x3'));var fs=require('fs');var path=require(_0x942f('0x4'));var rimraf=require(_0x942f('0x5'));var config=require(_0x942f('0x6'));var attributes=require(_0x942f('0x7'));module[_0x942f('0x8')]=function(_0x449487,_0x398028){return _0x449487['define'](_0x942f('0x9'),attributes,{'tableName':_0x942f('0xa'),'paranoid':![],'indexes':[{'name':_0x942f('0xb'),'fields':[_0x942f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce9=['define','interactionid','lodash','path','rimraf','../../config/environment','exports'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x8ce9,0x95));var _0x98ce=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x8ce9[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x98ce('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x98ce('0x1'));var rimraf=require(_0x98ce('0x2'));var config=require(_0x98ce('0x3'));var attributes=require('./screenRecording.attributes');module[_0x98ce('0x4')]=function(_0x1bd303,_0x3384fe){return _0x1bd303[_0x98ce('0x5')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x98ce('0x6'),'fields':[_0x98ce('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 542e5e0..0ba8418 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 _0x2852=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment'];(function(_0x521b61,_0x47e2b4){var _0x476cdf=function(_0xbca2ca){while(--_0xbca2ca){_0x521b61['push'](_0x521b61['shift']());}};_0x476cdf(++_0x47e2b4);}(_0x2852,0xf4));var _0x2285=function(_0x1c85d4,_0x41da14){_0x1c85d4=_0x1c85d4-0x0;var _0x273da8=_0x2852[_0x1c85d4];return _0x273da8;};'use strict';var _=require(_0x2285('0x0'));var util=require(_0x2285('0x1'));var moment=require(_0x2285('0x2'));var BPromise=require(_0x2285('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2285('0x4'));var db=require(_0x2285('0x5'))['db'];var utils=require(_0x2285('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2285('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2285('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326873,_0x42324b,_0x59a77f){return new BPromise(function(_0x473cfd,_0x32e81e){return client[_0x2285('0x9')](_0x326873,_0x59a77f)[_0x2285('0xa')](function(_0x4313fd){logger[_0x2285('0xb')](_0x2285('0xc'),_0x42324b,_0x2285('0xd'));logger[_0x2285('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x42324b,_0x2285('0xd'),JSON['stringify'](_0x4313fd));if(_0x4313fd['error']){if(_0x4313fd[_0x2285('0xf')][_0x2285('0x10')]===0x1f4){logger[_0x2285('0xf')](_0x2285('0xc'),_0x42324b,_0x4313fd[_0x2285('0xf')][_0x2285('0x11')]);return _0x32e81e(_0x4313fd['error']['message']);}logger[_0x2285('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x42324b,_0x4313fd['error'][_0x2285('0x11')]);return _0x473cfd(_0x4313fd[_0x2285('0xf')][_0x2285('0x11')]);}else{logger[_0x2285('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x42324b,_0x2285('0xd'));_0x473cfd(_0x4313fd['result']['message']);}})[_0x2285('0x12')](function(_0x1926c2){logger[_0x2285('0xf')](_0x2285('0xc'),_0x42324b,_0x1926c2);_0x32e81e(_0x1926c2);});});} \ No newline at end of file +var _0xa844=['../../config/logger','rpc','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x11b0c3,_0x2d97a9){var _0x98f2ec=function(_0x1b0584){while(--_0x1b0584){_0x11b0c3['push'](_0x11b0c3['shift']());}};_0x98f2ec(++_0x2d97a9);}(_0xa844,0x17f));var _0x4a84=function(_0x776c3,_0xa0e325){_0x776c3=_0x776c3-0x0;var _0x5b4bb8=_0xa844[_0x776c3];return _0x5b4bb8;};'use strict';var _=require(_0x4a84('0x0'));var util=require(_0x4a84('0x1'));var moment=require(_0x4a84('0x2'));var BPromise=require(_0x4a84('0x3'));var rs=require(_0x4a84('0x4'));var fs=require('fs');var Redis=require(_0x4a84('0x5'));var db=require(_0x4a84('0x6'))['db'];var utils=require(_0x4a84('0x7'));var logger=require(_0x4a84('0x8'))(_0x4a84('0x9'));var config=require('../../config/environment');var jayson=require(_0x4a84('0xa'));var client=jayson[_0x4a84('0xb')][_0x4a84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x460b13,_0x16a4a7,_0x99dac5){return new BPromise(function(_0x24f69f,_0x57a339){return client['request'](_0x460b13,_0x99dac5)[_0x4a84('0xd')](function(_0x2ea56c){logger[_0x4a84('0xe')](_0x4a84('0xf'),_0x16a4a7,_0x4a84('0x10'));logger[_0x4a84('0x11')](_0x4a84('0x12'),_0x16a4a7,_0x4a84('0x10'),JSON['stringify'](_0x2ea56c));if(_0x2ea56c[_0x4a84('0x13')]){if(_0x2ea56c[_0x4a84('0x13')][_0x4a84('0x14')]===0x1f4){logger[_0x4a84('0x13')](_0x4a84('0xf'),_0x16a4a7,_0x2ea56c[_0x4a84('0x13')][_0x4a84('0x15')]);return _0x57a339(_0x2ea56c[_0x4a84('0x13')]['message']);}logger[_0x4a84('0x13')](_0x4a84('0xf'),_0x16a4a7,_0x2ea56c['error']['message']);return _0x24f69f(_0x2ea56c[_0x4a84('0x13')][_0x4a84('0x15')]);}else{logger[_0x4a84('0xe')](_0x4a84('0xf'),_0x16a4a7,_0x4a84('0x10'));_0x24f69f(_0x2ea56c[_0x4a84('0x16')][_0x4a84('0x15')]);}})['catch'](function(_0x71b1d5){logger['error'](_0x4a84('0xf'),_0x16a4a7,_0x71b1d5);_0x57a339(_0x71b1d5);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 09f54da..d3d32a1 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 _0x4cc1=['extname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','./setting.controller','get','isAuthenticated','/now','getDate','/:id','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','addLogo','logologin'];(function(_0x569025,_0x685ff3){var _0x555208=function(_0x402782){while(--_0x402782){_0x569025['push'](_0x569025['shift']());}};_0x555208(++_0x685ff3);}(_0x4cc1,0x151));var _0x14cc=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x4cc1[_0x3817a9];return _0x443f30;};'use strict';var multer=require(_0x14cc('0x0'));var util=require(_0x14cc('0x1'));var path=require(_0x14cc('0x2'));var timeout=require(_0x14cc('0x3'));var express=require('express');var router=express[_0x14cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x14cc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14cc('0x6'));router[_0x14cc('0x7')]('/',auth[_0x14cc('0x8')](),controller['index']);router[_0x14cc('0x7')](_0x14cc('0x9'),controller[_0x14cc('0xa')]);router['get'](_0x14cc('0xb'),controller['show']);router[_0x14cc('0x7')]('/:id/logo',controller[_0x14cc('0xc')]);router['get']('/:id/logo_login',controller[_0x14cc('0xd')]);router[_0x14cc('0x7')]('/:id/gdpr',controller[_0x14cc('0xe')]);router[_0x14cc('0x7')](_0x14cc('0xf'),controller[_0x14cc('0x10')]);router[_0x14cc('0x7')](_0x14cc('0x11'),controller[_0x14cc('0x12')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x15a0ba,_0xea64c3,_0x5647af){_0x5647af(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0xfc4d0d,_0x39a436,_0x123c38){_0x123c38(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x19'),path['extname'](_0x39a436[_0x14cc('0x1a')])));}})});router[_0x14cc('0x1b')]('/:id/logo',upload[_0x14cc('0x1c')](_0x14cc('0x1d')),controller[_0x14cc('0x1e')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x58628e,_0x195f59,_0x5430b4){_0x5430b4(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x28bc19,_0x461a9b,_0x45f9c7){_0x45f9c7(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x1f'),path[_0x14cc('0x20')](_0x461a9b['originalname'])));}})});router[_0x14cc('0x1b')](_0x14cc('0x21'),upload['single'](_0x14cc('0x1d')),controller[_0x14cc('0x22')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x400787,_0x2ae250,_0x416cdb){_0x416cdb(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x33d1e9,_0x29bcbb,_0x176664){_0x176664(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x23'),path[_0x14cc('0x20')](_0x29bcbb[_0x14cc('0x1a')])));}})});router[_0x14cc('0x1b')](_0x14cc('0xf'),upload[_0x14cc('0x1c')](_0x14cc('0x1d')),controller[_0x14cc('0x24')]);var upload=multer({'storage':multer[_0x14cc('0x13')]({'destination':function(_0x17361c,_0xafa697,_0x1576d1){_0x1576d1(null,path[_0x14cc('0x14')](config[_0x14cc('0x15')],_0x14cc('0x16')));},'filename':function(_0x3d499a,_0x4c59d7,_0x5749aa){_0x5749aa(null,util[_0x14cc('0x17')](_0x14cc('0x18'),_0x14cc('0x25'),path[_0x14cc('0x20')](_0x4c59d7[_0x14cc('0x1a')])));}})});router['post'](_0x14cc('0x11'),upload['single'](_0x14cc('0x1d')),controller[_0x14cc('0x26')]);router[_0x14cc('0x27')](_0x14cc('0xb'),auth[_0x14cc('0x8')](),controller[_0x14cc('0x28')]);module['exports']=router; \ No newline at end of file +var _0x96e7=['join','root','format','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','%s%s','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','index','get','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage'];(function(_0xa13806,_0x3b27c0){var _0x5dd8a9=function(_0x228365){while(--_0x228365){_0xa13806['push'](_0xa13806['shift']());}};_0x5dd8a9(++_0x3b27c0);}(_0x96e7,0x150));var _0x796e=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0x96e7[_0x5ce8b9];return _0xe34be0;};'use strict';var multer=require(_0x796e('0x0'));var util=require(_0x796e('0x1'));var path=require(_0x796e('0x2'));var timeout=require(_0x796e('0x3'));var express=require(_0x796e('0x4'));var router=express[_0x796e('0x5')]();var fs_extra=require(_0x796e('0x6'));var auth=require(_0x796e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x796e('0x8'));var controller=require(_0x796e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x796e('0xa')]);router[_0x796e('0xb')]('/now',controller[_0x796e('0xc')]);router[_0x796e('0xb')]('/:id',controller[_0x796e('0xd')]);router[_0x796e('0xb')](_0x796e('0xe'),controller[_0x796e('0xf')]);router[_0x796e('0xb')](_0x796e('0x10'),controller[_0x796e('0x11')]);router['get']('/:id/gdpr',controller[_0x796e('0x12')]);router[_0x796e('0xb')](_0x796e('0x13'),controller[_0x796e('0x14')]);router['get'](_0x796e('0x15'),controller[_0x796e('0x16')]);var upload=multer({'storage':multer[_0x796e('0x17')]({'destination':function(_0x508717,_0x3f90ea,_0x28b5ee){_0x28b5ee(null,path[_0x796e('0x18')](config[_0x796e('0x19')],'server/files/images/logos/'));},'filename':function(_0xddb441,_0x211c43,_0x4b3366){_0x4b3366(null,util[_0x796e('0x1a')]('%s%s',_0x796e('0x1b'),path[_0x796e('0x1c')](_0x211c43[_0x796e('0x1d')])));}})});router[_0x796e('0x1e')]('/:id/logo',upload[_0x796e('0x1f')](_0x796e('0x20')),controller[_0x796e('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17b641,_0x4a46f4,_0x3debb0){_0x3debb0(null,path[_0x796e('0x18')](config[_0x796e('0x19')],_0x796e('0x22')));},'filename':function(_0x547751,_0x3a1bfc,_0x16a39e){_0x16a39e(null,util[_0x796e('0x1a')](_0x796e('0x23'),'logologin',path[_0x796e('0x1c')](_0x3a1bfc[_0x796e('0x1d')])));}})});router[_0x796e('0x1e')](_0x796e('0x10'),upload['single'](_0x796e('0x20')),controller[_0x796e('0x24')]);var upload=multer({'storage':multer[_0x796e('0x17')]({'destination':function(_0x32b824,_0x582763,_0x48dfac){_0x48dfac(null,path[_0x796e('0x18')](config[_0x796e('0x19')],_0x796e('0x22')));},'filename':function(_0x508a9c,_0x286b8d,_0x3008a3){_0x3008a3(null,util['format'](_0x796e('0x23'),_0x796e('0x25'),path['extname'](_0x286b8d['originalname'])));}})});router[_0x796e('0x1e')](_0x796e('0x13'),upload[_0x796e('0x1f')](_0x796e('0x20')),controller[_0x796e('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4fc223,_0x319195,_0x5ca25c){_0x5ca25c(null,path['join'](config[_0x796e('0x19')],_0x796e('0x22')));},'filename':function(_0x32758e,_0x1324cf,_0x5f32a7){_0x5f32a7(null,util[_0x796e('0x1a')](_0x796e('0x23'),_0x796e('0x27'),path[_0x796e('0x1c')](_0x1324cf['originalname'])));}})});router[_0x796e('0x1e')](_0x796e('0x15'),upload[_0x796e('0x1f')](_0x796e('0x20')),controller[_0x796e('0x28')]);router[_0x796e('0x29')]('/:id',auth[_0x796e('0x2a')](),controller[_0x796e('0x2b')]);module[_0x796e('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index e51eb45..9be33d0 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(_0x526a25,_0x38323f){var _0x361e04=function(_0x194f43){while(--_0x194f43){_0x526a25['push'](_0x526a25['shift']());}};_0x361e04(++_0x38323f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1e8274,_0x2884e3){var _0xb04a8c=function(_0x1e9559){while(--_0x1e9559){_0x1e8274['push'](_0x1e8274['shift']());}};_0xb04a8c(++_0x2884e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 7dd3006..7c9c263 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 _0x8128=['code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','stack','name','index','Setting','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','includeAll','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','upperFirst','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','send','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd8b86f,_0x544db1){var _0x417622=function(_0x39efd8){while(--_0x39efd8){_0xd8b86f['push'](_0xd8b86f['shift']());}};_0x417622(++_0x544db1);}(_0x8128,0x1b1));var _0x8812=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x8128[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x8812('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8812('0x1'));var rp=require(_0x8812('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8812('0x3'));var util=require(_0x8812('0x4'));var path=require(_0x8812('0x5'));var sox=require('sox');var csv=require(_0x8812('0x6'));var ejs=require(_0x8812('0x7'));var fs=require('fs');var fs_extra=require(_0x8812('0x8'));var _=require(_0x8812('0x9'));var squel=require('squel');var crypto=require(_0x8812('0xa'));var jsforce=require(_0x8812('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8812('0xc'));var Redis=require(_0x8812('0xd'));var authService=require(_0x8812('0xe'));var qs=require(_0x8812('0xf'));var as=require(_0x8812('0x10'));var hardwareService=require(_0x8812('0x11'));var logger=require(_0x8812('0x12'))(_0x8812('0x13'));var utils=require(_0x8812('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8812('0x15'));var db=require(_0x8812('0x16'))['db'];var jayson=require(_0x8812('0x17'));var client=jayson[_0x8812('0x18')][_0x8812('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x8386f1,_0x53be83,_0x1b1ab2,_0x43bb44){return new BPromise(function(_0x589fd9,_0x557c5c){var _0x4b37fa=_0x43bb44||client;return _0x4b37fa[_0x8812('0x1a')](_0x8386f1,_0x1b1ab2)[_0x8812('0x1b')](function(_0x554ddb){logger['info']('Setting,\x20%s,\x20%s',_0x53be83,'request\x20sent');logger['debug'](_0x8812('0x1c'),_0x53be83,'request\x20sent',JSON[_0x8812('0x1d')](_0x554ddb));if(_0x554ddb['error']){if(_0x554ddb[_0x8812('0x1e')][_0x8812('0x1f')]===0x1f4){logger['error'](_0x8812('0x20'),_0x53be83,_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);return _0x557c5c(_0x554ddb['error']['message']);}logger[_0x8812('0x1e')](_0x8812('0x20'),_0x53be83,_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);return _0x589fd9(_0x554ddb[_0x8812('0x1e')][_0x8812('0x21')]);}else{logger['info'](_0x8812('0x20'),_0x53be83,_0x8812('0x22'));_0x589fd9(_0x554ddb[_0x8812('0x23')]['message']);}})[_0x8812('0x24')](function(_0x3fbf5a){logger['error'](_0x8812('0x20'),_0x53be83,_0x3fbf5a);_0x557c5c(_0x3fbf5a);});});}function respondWithStatusCode(_0x545ec7,_0x29572a){_0x29572a=_0x29572a||0xcc;return function(_0x16e486){if(_0x16e486){return _0x545ec7[_0x8812('0x25')](_0x29572a);}return _0x545ec7['status'](_0x29572a)[_0x8812('0x26')]();};}function respondWithResult(_0x1e1a93,_0x115215){_0x115215=_0x115215||0xc8;return function(_0x465f1f){if(_0x465f1f){return _0x1e1a93['status'](_0x115215)[_0x8812('0x27')](_0x465f1f);}};}function respondWithFilteredResult(_0x108a0f,_0x2c2420){return function(_0x2015de){if(_0x2015de){var _0x31b575=typeof _0x2c2420[_0x8812('0x28')]===_0x8812('0x29')&&typeof _0x2c2420[_0x8812('0x2a')]===_0x8812('0x29');var _0xdea554=_0x2015de['count'];var _0x501d4a=_0x31b575?0x0:_0x2c2420['offset'];var _0x53b2e1=_0x31b575?_0x2015de[_0x8812('0x2b')]:_0x2c2420[_0x8812('0x28')]+_0x2c2420[_0x8812('0x2a')];var _0x1cbc0e;if(_0x53b2e1>=_0xdea554){_0x53b2e1=_0xdea554;_0x1cbc0e=0xc8;}else{_0x1cbc0e=0xce;}_0x108a0f[_0x8812('0x2c')](_0x1cbc0e);return _0x108a0f['set'](_0x8812('0x2d'),_0x501d4a+'-'+_0x53b2e1+'/'+_0xdea554)[_0x8812('0x27')](_0x2015de);}return null;};}function patchUpdates(_0x2ca077){return function(_0x288092){try{jsonpatch['apply'](_0x288092,_0x2ca077,!![]);}catch(_0x1c557f){return BPromise[_0x8812('0x2e')](_0x1c557f);}return _0x288092[_0x8812('0x2f')]();};}function saveUpdates(_0x381fbf,_0x172afd){return function(_0xefc4cc){if(_0xefc4cc){return _0xefc4cc[_0x8812('0x30')](_0x381fbf)['then'](function(_0x1a815e){return _0x1a815e;});}return null;};}function removeEntity(_0x309ca1,_0x453ad6){return function(_0x3cc888){if(_0x3cc888){return _0x3cc888['destroy']()['then'](function(){_0x309ca1['status'](0xcc)[_0x8812('0x26')]();});}};}function handleEntityNotFound(_0x2c3672,_0x24ca05){return function(_0x4e23e5){if(!_0x4e23e5){_0x2c3672['sendStatus'](0x194);}return _0x4e23e5;};}function handleError(_0x5e7b1f,_0x36da1e){_0x36da1e=_0x36da1e||0x1f4;return function(_0x471bf2){logger['error'](_0x471bf2[_0x8812('0x31')]);if(_0x471bf2[_0x8812('0x32')]){delete _0x471bf2[_0x8812('0x32')];}_0x5e7b1f[_0x8812('0x2c')](_0x36da1e)['send'](_0x471bf2);};}exports[_0x8812('0x33')]=function(_0x20659e,_0x5287d9){var _0x5de672={},_0xe7dccd={},_0x2d8bc8={'count':0x0,'rows':[]};var _0x588460=_['map'](db[_0x8812('0x34')][_0x8812('0x35')],function(_0x4b29e8){return{'name':_0x4b29e8[_0x8812('0x36')],'type':_0x4b29e8['type']['key']};});_0xe7dccd[_0x8812('0x37')]=_[_0x8812('0x38')](_0x588460,_0x8812('0x32'));_0xe7dccd['query']=_[_0x8812('0x39')](_0x20659e[_0x8812('0x3a')]);_0xe7dccd[_0x8812('0x3b')]=_['intersection'](_0xe7dccd['model'],_0xe7dccd[_0x8812('0x3a')]);_0x5de672[_0x8812('0x3c')]=_[_0x8812('0x3d')](_0xe7dccd[_0x8812('0x37')],qs['fields'](_0x20659e[_0x8812('0x3a')][_0x8812('0x3e')]));_0x5de672[_0x8812('0x3c')]=_0x5de672[_0x8812('0x3c')][_0x8812('0x3f')]?_0x5de672[_0x8812('0x3c')]:_0xe7dccd[_0x8812('0x37')];if(!_0x20659e[_0x8812('0x3a')]['hasOwnProperty']('nolimit')){_0x5de672[_0x8812('0x2a')]=qs['limit'](_0x20659e[_0x8812('0x3a')][_0x8812('0x2a')]);_0x5de672[_0x8812('0x28')]=qs[_0x8812('0x28')](_0x20659e[_0x8812('0x3a')][_0x8812('0x28')]);}_0x5de672['order']=qs[_0x8812('0x40')](_0x20659e['query'][_0x8812('0x40')]);_0x5de672[_0x8812('0x41')]=qs[_0x8812('0x3b')](_[_0x8812('0x42')](_0x20659e[_0x8812('0x3a')],_0xe7dccd[_0x8812('0x3b')]),_0x588460);if(_0x20659e[_0x8812('0x3a')][_0x8812('0x43')]){_0x5de672[_0x8812('0x41')]=_[_0x8812('0x44')](_0x5de672[_0x8812('0x41')],{'$or':_[_0x8812('0x38')](_0x588460,function(_0x2911d5){if(_0x2911d5['type']!==_0x8812('0x45')){var _0x5bc47f={};_0x5bc47f[_0x2911d5['name']]={'$like':'%'+_0x20659e[_0x8812('0x3a')][_0x8812('0x43')]+'%'};return _0x5bc47f;}})});}_0x5de672=_[_0x8812('0x44')]({},_0x5de672,_0x20659e[_0x8812('0x46')]);var _0x5626a5={'where':_0x5de672['where']};return db[_0x8812('0x34')][_0x8812('0x2b')](_0x5626a5)['then'](function(_0x19addb){_0x2d8bc8['count']=_0x19addb;if(_0x20659e['query']['includeAll']){_0x5de672[_0x8812('0x47')]=[{'all':!![]}];}return db[_0x8812('0x34')][_0x8812('0x48')](_0x5de672);})['then'](function(_0x35b5b0){_0x2d8bc8['rows']=_0x35b5b0;return _0x2d8bc8;})[_0x8812('0x1b')](respondWithFilteredResult(_0x5287d9,_0x5de672))[_0x8812('0x24')](handleError(_0x5287d9,null));};exports['show']=function(_0x44fb4a,_0x15264b){var _0x2baeda={'raw':![],'where':{'id':_0x44fb4a[_0x8812('0x49')]['id']}},_0x572304={};_0x572304[_0x8812('0x37')]=_[_0x8812('0x39')](db['Setting'][_0x8812('0x35')]);_0x572304['query']=_[_0x8812('0x39')](_0x44fb4a[_0x8812('0x3a')]);_0x572304[_0x8812('0x3b')]=_[_0x8812('0x3d')](_0x572304[_0x8812('0x37')],_0x572304['query']);_0x2baeda[_0x8812('0x3c')]=_[_0x8812('0x3d')](_0x572304[_0x8812('0x37')],qs[_0x8812('0x3e')](_0x44fb4a['query'][_0x8812('0x3e')]));_0x2baeda[_0x8812('0x3c')]=_0x2baeda[_0x8812('0x3c')][_0x8812('0x3f')]?_0x2baeda[_0x8812('0x3c')]:_0x572304['model'];if(_0x44fb4a[_0x8812('0x3a')][_0x8812('0x4a')]){_0x2baeda[_0x8812('0x47')]=[{'all':!![]}];}_0x2baeda=_[_0x8812('0x44')]({},_0x2baeda,_0x44fb4a[_0x8812('0x46')]);return db['Setting'][_0x8812('0x4b')](_0x2baeda)[_0x8812('0x1b')](handleEntityNotFound(_0x15264b,null))[_0x8812('0x1b')](respondWithResult(_0x15264b,null))[_0x8812('0x24')](handleError(_0x15264b,null));};exports['update']=function(_0x4e0324,_0x3f68e3){if(_0x4e0324[_0x8812('0x4c')]['id']){delete _0x4e0324['body']['id'];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4e0324[_0x8812('0x49')]['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0x3f68e3,null))[_0x8812('0x1b')](saveUpdates(_0x4e0324[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x3f68e3,null))[_0x8812('0x24')](handleError(_0x3f68e3,null));};exports[_0x8812('0x4d')]=function(_0x4ca570,_0x219528,_0x211e99){if(_0x4ca570['file']&&_0x4ca570[_0x8812('0x4e')][_0x8812('0x4f')]){_0x4ca570['body']['logo']=_0x4ca570['file'][_0x8812('0x4f')];}return db[_0x8812('0x34')]['find']({'where':{'id':_0x4ca570['params']['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0x219528,null))[_0x8812('0x1b')](saveUpdates(_0x4ca570[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x219528,null))['catch'](handleError(_0x219528,null));};exports[_0x8812('0x50')]=function(_0x4b068d,_0x49218,_0x26b55b){if(_0x4b068d[_0x8812('0x4e')]&&_0x4b068d[_0x8812('0x4e')][_0x8812('0x4f')]){_0x4b068d[_0x8812('0x4c')][_0x8812('0x51')]=_0x4b068d[_0x8812('0x4e')]['filename'];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4b068d['params']['id']}})['then'](handleEntityNotFound(_0x49218,null))[_0x8812('0x1b')](saveUpdates(_0x4b068d[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x49218,null))[_0x8812('0x24')](handleError(_0x49218,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x52')]=function(_0x21155d,_0x3d16ab,_0x2f3c07){var _0x2549fb=_0x8812('0x53');var _0x5cc842={'custom':![]};return utilLicense[_0x8812('0x54')]()['then'](function(_0x20489d){if(_0x20489d){_0x5cc842=_0x20489d;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x21155d[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),_0x8812('0x51'),_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x3d16ab,null))[_0x8812('0x1b')](function(_0xd6c4d){if(_0xd6c4d){var _0x26b2d2=_0xd6c4d['logo']&&fs[_0x8812('0x5c')](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x2549fb,_[_0x8812('0x5f')](_0xd6c4d[_0x8812('0x55')])))?path['join'](config[_0x8812('0x5e')],_0x2549fb,_[_0x8812('0x5f')](_0xd6c4d['logo'])):path[_0x8812('0x5d')](config['root'],_0x2549fb,_[_0x8812('0x5f')](_0x8812('0x60')));var _0x44d8d8=_0x8812('0x61')+_['upperFirst']('logo');if(_0xd6c4d[_0x44d8d8]||!_0x5cc842[_0x8812('0x62')]){_0x26b2d2=path[_0x8812('0x5d')](config['root'],_0x2549fb,_['toLower']('default_logo.svg'));}if(!fs[_0x8812('0x5c')](_0x26b2d2)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_['upperFirst']('logo')+_0x8812('0x65'));}return _0x3d16ab[_0x8812('0x66')](_0x26b2d2);}})['catch'](handleError(_0x3d16ab,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x67')]=function(_0x4d63d0,_0x2ebea6,_0x2a4e16){var _0xeca8d5=_0x8812('0x53');var _0x1cf6ec={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x21d063){if(_0x21d063){_0x1cf6ec=_0x21d063;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x4d63d0[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),'loginLogo',_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x2ebea6,null))[_0x8812('0x1b')](function(_0x5260dd){if(_0x5260dd){var _0x530dca=_0x5260dd['loginLogo']&&fs[_0x8812('0x5c')](path['join'](config['root'],_0xeca8d5,_[_0x8812('0x5f')](_0x5260dd[_0x8812('0x51')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_[_0x8812('0x5f')](_0x5260dd[_0x8812('0x51')])):path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_[_0x8812('0x5f')]('default_loginLogo.svg'));var _0x460bec=_0x8812('0x61')+_[_0x8812('0x68')]('loginLogo');if(_0x5260dd[_0x460bec]||!_0x1cf6ec[_0x8812('0x62')]){_0x530dca=path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0xeca8d5,_['toLower'](_0x8812('0x69')));}if(!fs[_0x8812('0x5c')](_0x530dca)){throw new db['Sequelize'][(_0x8812('0x64'))](_[_0x8812('0x68')]('loginLogo')+_0x8812('0x65'));}return _0x2ebea6[_0x8812('0x66')](_0x530dca);}})[_0x8812('0x24')](handleError(_0x2ebea6,null));};exports[_0x8812('0x6a')]=function(_0x46f034,_0x145875){return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x46f034[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x6b')]})[_0x8812('0x1b')](respondWithResult(_0x145875,null))[_0x8812('0x24')](handleError(_0x145875,null));};exports[_0x8812('0x6c')]=function(_0x1aa1cf,_0xe89fb3,_0xbef92){if(_0x1aa1cf[_0x8812('0x4e')]&&_0x1aa1cf[_0x8812('0x4e')]['filename']){_0x1aa1cf[_0x8812('0x4c')][_0x8812('0x56')]=_0x1aa1cf[_0x8812('0x4e')][_0x8812('0x4f')];}return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x1aa1cf['params']['id']}})[_0x8812('0x1b')](handleEntityNotFound(_0xe89fb3,null))[_0x8812('0x1b')](saveUpdates(_0x1aa1cf[_0x8812('0x4c')],null))['then'](respondWithResult(_0xe89fb3,null))['catch'](handleError(_0xe89fb3,null));};var utilLicense=require(_0x8812('0x15'));exports[_0x8812('0x6d')]=function(_0x1aa8de,_0x21a927,_0x265184){var _0x3b06a1=_0x8812('0x53');var _0x177744={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x466bf6){if(_0x466bf6){_0x177744=_0x466bf6;}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x1aa8de[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),_0x8812('0x51'),_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),'defaultLoginLogo',_0x8812('0x5a'),_0x8812('0x5b')],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x21a927,null))[_0x8812('0x1b')](function(_0x36e2e2){if(_0x36e2e2){var _0x13be66=_0x36e2e2[_0x8812('0x56')]&&fs['existsSync'](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3b06a1,_[_0x8812('0x5f')](_0x36e2e2[_0x8812('0x56')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3b06a1,_['toLower'](_0x36e2e2[_0x8812('0x56')])):path[_0x8812('0x5d')](config['root'],_0x3b06a1,_[_0x8812('0x5f')](_0x8812('0x6e')));var _0x17ef2d='default'+_[_0x8812('0x68')](_0x8812('0x56'));if(_0x36e2e2[_0x17ef2d]||!_0x177744[_0x8812('0x62')]||!_0x177744[_0x8812('0x56')]){_0x13be66=path[_0x8812('0x5d')](config['root'],_0x3b06a1,_[_0x8812('0x5f')](_0x8812('0x6e')));}if(!fs['existsSync'](_0x13be66)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_[_0x8812('0x68')]('preferred')+_0x8812('0x65'));}return _0x21a927[_0x8812('0x66')](_0x13be66);}})['catch'](handleError(_0x21a927,null));};exports['addFavicon']=function(_0x39498a,_0x4dfaeb,_0x564f80){if(_0x39498a[_0x8812('0x4e')]&&_0x39498a[_0x8812('0x4e')]['filename']){_0x39498a['body'][_0x8812('0x57')]=_0x39498a[_0x8812('0x4e')][_0x8812('0x4f')];}return db[_0x8812('0x34')][_0x8812('0x4b')]({'where':{'id':_0x39498a[_0x8812('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dfaeb,null))['then'](saveUpdates(_0x39498a[_0x8812('0x4c')],null))[_0x8812('0x1b')](respondWithResult(_0x4dfaeb,null))['catch'](handleError(_0x4dfaeb,null));};var utilLicense=require('../../config/license/util');exports[_0x8812('0x6f')]=function(_0x5e5d72,_0x1150b0,_0x263a69){var _0x3445f8=_0x8812('0x53');var _0x154052={'custom':![]};return utilLicense[_0x8812('0x54')]()[_0x8812('0x1b')](function(_0x5eb2d9){if(_0x5eb2d9){_0x154052=_0x5eb2d9;}return db['Setting'][_0x8812('0x4b')]({'where':{'id':_0x5e5d72[_0x8812('0x49')]['id']},'attributes':[_0x8812('0x55'),'loginLogo',_0x8812('0x56'),_0x8812('0x57'),_0x8812('0x58'),_0x8812('0x59'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x8812('0x1b')](handleEntityNotFound(_0x1150b0,null))[_0x8812('0x1b')](function(_0x35fd6a){if(_0x35fd6a){var _0x32a2d7=_0x35fd6a['favicon']&&fs[_0x8812('0x5c')](path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x35fd6a[_0x8812('0x57')])))?path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x35fd6a[_0x8812('0x57')])):path[_0x8812('0x5d')](config['root'],_0x3445f8,_[_0x8812('0x5f')](_0x8812('0x70')));var _0xb1d51a='default'+_[_0x8812('0x68')](_0x8812('0x57'));if(_0x35fd6a[_0xb1d51a]||!_0x154052[_0x8812('0x62')]){_0x32a2d7=path[_0x8812('0x5d')](config[_0x8812('0x5e')],_0x3445f8,_[_0x8812('0x5f')](_0x8812('0x70')));}if(!fs[_0x8812('0x5c')](_0x32a2d7)){throw new db[(_0x8812('0x63'))][(_0x8812('0x64'))](_[_0x8812('0x68')](_0x8812('0x57'))+_0x8812('0x65'));}return _0x1150b0[_0x8812('0x66')](_0x32a2d7);}})[_0x8812('0x24')](handleError(_0x1150b0,null));};exports['getDate']=function(_0xff63e,_0x24cf16){var _0x41ef7d={'offset':moment()[_0x8812('0x71')]()};_0x41ef7d[_0x8812('0x72')]=moment()[_0x8812('0x71')](_0x41ef7d[_0x8812('0x28')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x24cf16[_0x8812('0x2c')](0xc8)[_0x8812('0x73')](_0x41ef7d);}; \ No newline at end of file +var _0x8b5c=['to-csv','ejs','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','end','stack','name','send','index','map','Setting','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','options','include','rows','show','params','length','includeAll','find','body','addLogo','file','filename','logo','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','defaultLoginLogo','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b5c,0x1da));var _0xc8b5=function(_0x194cbd,_0x584385){_0x194cbd=_0x194cbd-0x0;var _0x469dd7=_0x8b5c[_0x194cbd];return _0x469dd7;};'use strict';var emlformat=require(_0xc8b5('0x0'));var rimraf=require(_0xc8b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8b5('0x2'));var rp=require(_0xc8b5('0x3'));var moment=require(_0xc8b5('0x4'));var BPromise=require(_0xc8b5('0x5'));var Mustache=require(_0xc8b5('0x6'));var util=require(_0xc8b5('0x7'));var path=require(_0xc8b5('0x8'));var sox=require(_0xc8b5('0x9'));var csv=require(_0xc8b5('0xa'));var ejs=require(_0xc8b5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc8b5('0xc'));var jsforce=require(_0xc8b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc8b5('0xa'));var querystring=require(_0xc8b5('0xe'));var Papa=require('papaparse');var Redis=require(_0xc8b5('0xf'));var authService=require(_0xc8b5('0x10'));var qs=require(_0xc8b5('0x11'));var as=require(_0xc8b5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8b5('0x13'))(_0xc8b5('0x14'));var utils=require(_0xc8b5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc8b5('0x16'));var db=require(_0xc8b5('0x17'))['db'];var jayson=require(_0xc8b5('0x18'));var client=jayson[_0xc8b5('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41529a,_0x20de20,_0x13d232,_0x1d6ce5){return new BPromise(function(_0x36a7ce,_0x2899ab){var _0x5c635b=_0x1d6ce5||client;return _0x5c635b[_0xc8b5('0x1a')](_0x41529a,_0x13d232)[_0xc8b5('0x1b')](function(_0x295972){logger['info'](_0xc8b5('0x1c'),_0x20de20,'request\x20sent');logger[_0xc8b5('0x1d')](_0xc8b5('0x1e'),_0x20de20,_0xc8b5('0x1f'),JSON['stringify'](_0x295972));if(_0x295972[_0xc8b5('0x20')]){if(_0x295972['error'][_0xc8b5('0x21')]===0x1f4){logger['error'](_0xc8b5('0x1c'),_0x20de20,_0x295972['error'][_0xc8b5('0x22')]);return _0x2899ab(_0x295972[_0xc8b5('0x20')][_0xc8b5('0x22')]);}logger[_0xc8b5('0x20')](_0xc8b5('0x1c'),_0x20de20,_0x295972[_0xc8b5('0x20')]['message']);return _0x36a7ce(_0x295972[_0xc8b5('0x20')][_0xc8b5('0x22')]);}else{logger[_0xc8b5('0x23')](_0xc8b5('0x1c'),_0x20de20,_0xc8b5('0x1f'));_0x36a7ce(_0x295972[_0xc8b5('0x24')][_0xc8b5('0x22')]);}})[_0xc8b5('0x25')](function(_0x28d5f4){logger[_0xc8b5('0x20')](_0xc8b5('0x1c'),_0x20de20,_0x28d5f4);_0x2899ab(_0x28d5f4);});});}function respondWithStatusCode(_0x515e09,_0x15c56a){_0x15c56a=_0x15c56a||0xcc;return function(_0x2392a3){if(_0x2392a3){return _0x515e09[_0xc8b5('0x26')](_0x15c56a);}return _0x515e09[_0xc8b5('0x27')](_0x15c56a)['end']();};}function respondWithResult(_0x6b8636,_0x2be51b){_0x2be51b=_0x2be51b||0xc8;return function(_0x2657d5){if(_0x2657d5){return _0x6b8636[_0xc8b5('0x27')](_0x2be51b)['json'](_0x2657d5);}};}function respondWithFilteredResult(_0xcd93d4,_0x159761){return function(_0x10fd19){if(_0x10fd19){var _0x12c3e8=typeof _0x159761[_0xc8b5('0x28')]===_0xc8b5('0x29')&&typeof _0x159761[_0xc8b5('0x2a')]===_0xc8b5('0x29');var _0x5ca712=_0x10fd19['count'];var _0x57c8a5=_0x12c3e8?0x0:_0x159761[_0xc8b5('0x28')];var _0x234474=_0x12c3e8?_0x10fd19[_0xc8b5('0x2b')]:_0x159761[_0xc8b5('0x28')]+_0x159761['limit'];var _0x190390;if(_0x234474>=_0x5ca712){_0x234474=_0x5ca712;_0x190390=0xc8;}else{_0x190390=0xce;}_0xcd93d4[_0xc8b5('0x27')](_0x190390);return _0xcd93d4[_0xc8b5('0x2c')](_0xc8b5('0x2d'),_0x57c8a5+'-'+_0x234474+'/'+_0x5ca712)[_0xc8b5('0x2e')](_0x10fd19);}return null;};}function patchUpdates(_0x4ba950){return function(_0x299cf0){try{jsonpatch[_0xc8b5('0x2f')](_0x299cf0,_0x4ba950,!![]);}catch(_0x305fd2){return BPromise[_0xc8b5('0x30')](_0x305fd2);}return _0x299cf0['save']();};}function saveUpdates(_0xc8801e,_0x3be7ed){return function(_0x6f3055){if(_0x6f3055){return _0x6f3055[_0xc8b5('0x31')](_0xc8801e)[_0xc8b5('0x1b')](function(_0x535163){return _0x535163;});}return null;};}function removeEntity(_0x58f862,_0xa7b245){return function(_0x35b1c4){if(_0x35b1c4){return _0x35b1c4[_0xc8b5('0x32')]()[_0xc8b5('0x1b')](function(){_0x58f862[_0xc8b5('0x27')](0xcc)[_0xc8b5('0x33')]();});}};}function handleEntityNotFound(_0x59dab7,_0x578d15){return function(_0x78c7dc){if(!_0x78c7dc){_0x59dab7['sendStatus'](0x194);}return _0x78c7dc;};}function handleError(_0x19d6c3,_0x3924a5){_0x3924a5=_0x3924a5||0x1f4;return function(_0x381302){logger[_0xc8b5('0x20')](_0x381302[_0xc8b5('0x34')]);if(_0x381302['name']){delete _0x381302[_0xc8b5('0x35')];}_0x19d6c3[_0xc8b5('0x27')](_0x3924a5)[_0xc8b5('0x36')](_0x381302);};}exports[_0xc8b5('0x37')]=function(_0x52b685,_0x419bcf){var _0x59e4ad={},_0x408c03={},_0xcd6f2f={'count':0x0,'rows':[]};var _0x10be98=_[_0xc8b5('0x38')](db[_0xc8b5('0x39')][_0xc8b5('0x3a')],function(_0x1cb142){return{'name':_0x1cb142['fieldName'],'type':_0x1cb142['type'][_0xc8b5('0x3b')]};});_0x408c03[_0xc8b5('0x3c')]=_['map'](_0x10be98,_0xc8b5('0x35'));_0x408c03['query']=_[_0xc8b5('0x3d')](_0x52b685[_0xc8b5('0x3e')]);_0x408c03[_0xc8b5('0x3f')]=_[_0xc8b5('0x40')](_0x408c03['model'],_0x408c03[_0xc8b5('0x3e')]);_0x59e4ad['attributes']=_[_0xc8b5('0x40')](_0x408c03[_0xc8b5('0x3c')],qs[_0xc8b5('0x41')](_0x52b685['query'][_0xc8b5('0x41')]));_0x59e4ad[_0xc8b5('0x42')]=_0x59e4ad[_0xc8b5('0x42')]['length']?_0x59e4ad[_0xc8b5('0x42')]:_0x408c03[_0xc8b5('0x3c')];if(!_0x52b685[_0xc8b5('0x3e')][_0xc8b5('0x43')]('nolimit')){_0x59e4ad['limit']=qs[_0xc8b5('0x2a')](_0x52b685['query']['limit']);_0x59e4ad[_0xc8b5('0x28')]=qs['offset'](_0x52b685[_0xc8b5('0x3e')][_0xc8b5('0x28')]);}_0x59e4ad['order']=qs[_0xc8b5('0x44')](_0x52b685[_0xc8b5('0x3e')][_0xc8b5('0x44')]);_0x59e4ad[_0xc8b5('0x45')]=qs['filters'](_[_0xc8b5('0x46')](_0x52b685[_0xc8b5('0x3e')],_0x408c03[_0xc8b5('0x3f')]),_0x10be98);if(_0x52b685[_0xc8b5('0x3e')][_0xc8b5('0x47')]){_0x59e4ad['where']=_[_0xc8b5('0x48')](_0x59e4ad[_0xc8b5('0x45')],{'$or':_[_0xc8b5('0x38')](_0x10be98,function(_0x10b723){if(_0x10b723[_0xc8b5('0x49')]!=='VIRTUAL'){var _0x235843={};_0x235843[_0x10b723['name']]={'$like':'%'+_0x52b685['query'][_0xc8b5('0x47')]+'%'};return _0x235843;}})});}_0x59e4ad=_[_0xc8b5('0x48')]({},_0x59e4ad,_0x52b685[_0xc8b5('0x4a')]);var _0x4c3a4a={'where':_0x59e4ad[_0xc8b5('0x45')]};return db[_0xc8b5('0x39')][_0xc8b5('0x2b')](_0x4c3a4a)[_0xc8b5('0x1b')](function(_0xf00f8b){_0xcd6f2f[_0xc8b5('0x2b')]=_0xf00f8b;if(_0x52b685[_0xc8b5('0x3e')]['includeAll']){_0x59e4ad[_0xc8b5('0x4b')]=[{'all':!![]}];}return db[_0xc8b5('0x39')]['findAll'](_0x59e4ad);})['then'](function(_0x5f6a9c){_0xcd6f2f[_0xc8b5('0x4c')]=_0x5f6a9c;return _0xcd6f2f;})[_0xc8b5('0x1b')](respondWithFilteredResult(_0x419bcf,_0x59e4ad))[_0xc8b5('0x25')](handleError(_0x419bcf,null));};exports[_0xc8b5('0x4d')]=function(_0x2bfbd2,_0x3e74d2){var _0xf4f94e={'raw':![],'where':{'id':_0x2bfbd2[_0xc8b5('0x4e')]['id']}},_0x2479c7={};_0x2479c7[_0xc8b5('0x3c')]=_['keys'](db[_0xc8b5('0x39')][_0xc8b5('0x3a')]);_0x2479c7[_0xc8b5('0x3e')]=_[_0xc8b5('0x3d')](_0x2bfbd2['query']);_0x2479c7['filters']=_[_0xc8b5('0x40')](_0x2479c7[_0xc8b5('0x3c')],_0x2479c7[_0xc8b5('0x3e')]);_0xf4f94e[_0xc8b5('0x42')]=_[_0xc8b5('0x40')](_0x2479c7[_0xc8b5('0x3c')],qs['fields'](_0x2bfbd2[_0xc8b5('0x3e')][_0xc8b5('0x41')]));_0xf4f94e[_0xc8b5('0x42')]=_0xf4f94e[_0xc8b5('0x42')][_0xc8b5('0x4f')]?_0xf4f94e[_0xc8b5('0x42')]:_0x2479c7[_0xc8b5('0x3c')];if(_0x2bfbd2[_0xc8b5('0x3e')][_0xc8b5('0x50')]){_0xf4f94e[_0xc8b5('0x4b')]=[{'all':!![]}];}_0xf4f94e=_[_0xc8b5('0x48')]({},_0xf4f94e,_0x2bfbd2[_0xc8b5('0x4a')]);return db[_0xc8b5('0x39')][_0xc8b5('0x51')](_0xf4f94e)[_0xc8b5('0x1b')](handleEntityNotFound(_0x3e74d2,null))[_0xc8b5('0x1b')](respondWithResult(_0x3e74d2,null))['catch'](handleError(_0x3e74d2,null));};exports[_0xc8b5('0x31')]=function(_0x1ac4fd,_0x1a2c93){if(_0x1ac4fd[_0xc8b5('0x52')]['id']){delete _0x1ac4fd[_0xc8b5('0x52')]['id'];}return db['Setting'][_0xc8b5('0x51')]({'where':{'id':_0x1ac4fd[_0xc8b5('0x4e')]['id']}})[_0xc8b5('0x1b')](handleEntityNotFound(_0x1a2c93,null))[_0xc8b5('0x1b')](saveUpdates(_0x1ac4fd['body'],null))[_0xc8b5('0x1b')](respondWithResult(_0x1a2c93,null))[_0xc8b5('0x25')](handleError(_0x1a2c93,null));};exports[_0xc8b5('0x53')]=function(_0x1929c1,_0x3c486b,_0xcdb4f){if(_0x1929c1[_0xc8b5('0x54')]&&_0x1929c1['file'][_0xc8b5('0x55')]){_0x1929c1[_0xc8b5('0x52')][_0xc8b5('0x56')]=_0x1929c1[_0xc8b5('0x54')][_0xc8b5('0x55')];}return db[_0xc8b5('0x39')][_0xc8b5('0x51')]({'where':{'id':_0x1929c1[_0xc8b5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3c486b,null))[_0xc8b5('0x1b')](saveUpdates(_0x1929c1[_0xc8b5('0x52')],null))[_0xc8b5('0x1b')](respondWithResult(_0x3c486b,null))[_0xc8b5('0x25')](handleError(_0x3c486b,null));};exports['addLogoLogin']=function(_0x5c65b9,_0x352256,_0x51634b){if(_0x5c65b9[_0xc8b5('0x54')]&&_0x5c65b9[_0xc8b5('0x54')][_0xc8b5('0x55')]){_0x5c65b9[_0xc8b5('0x52')][_0xc8b5('0x57')]=_0x5c65b9[_0xc8b5('0x54')][_0xc8b5('0x55')];}return db[_0xc8b5('0x39')]['find']({'where':{'id':_0x5c65b9[_0xc8b5('0x4e')]['id']}})[_0xc8b5('0x1b')](handleEntityNotFound(_0x352256,null))[_0xc8b5('0x1b')](saveUpdates(_0x5c65b9[_0xc8b5('0x52')],null))[_0xc8b5('0x1b')](respondWithResult(_0x352256,null))[_0xc8b5('0x25')](handleError(_0x352256,null));};var utilLicense=require('../../config/license/util');exports[_0xc8b5('0x58')]=function(_0x1755c9,_0x18740e,_0x1d2968){var _0x2ef9f0=_0xc8b5('0x59');var _0x38d102={'custom':![]};return utilLicense[_0xc8b5('0x5a')]()[_0xc8b5('0x1b')](function(_0x559c87){if(_0x559c87){_0x38d102=_0x559c87;}return db[_0xc8b5('0x39')]['find']({'where':{'id':_0x1755c9['params']['id']},'attributes':[_0xc8b5('0x56'),_0xc8b5('0x57'),_0xc8b5('0x5b'),_0xc8b5('0x5c'),_0xc8b5('0x5d'),'defaultLoginLogo',_0xc8b5('0x5e'),_0xc8b5('0x5f')],'raw':!![]});})[_0xc8b5('0x1b')](handleEntityNotFound(_0x18740e,null))[_0xc8b5('0x1b')](function(_0x1c9f24){if(_0x1c9f24){var _0x409820=_0x1c9f24[_0xc8b5('0x56')]&&fs[_0xc8b5('0x60')](path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x2ef9f0,_[_0xc8b5('0x63')](_0x1c9f24['logo'])))?path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x2ef9f0,_[_0xc8b5('0x63')](_0x1c9f24[_0xc8b5('0x56')])):path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x2ef9f0,_['toLower']('default_logo.svg'));var _0x124c1b=_0xc8b5('0x64')+_[_0xc8b5('0x65')](_0xc8b5('0x56'));if(_0x1c9f24[_0x124c1b]||!_0x38d102[_0xc8b5('0x66')]){_0x409820=path['join'](config[_0xc8b5('0x62')],_0x2ef9f0,_[_0xc8b5('0x63')](_0xc8b5('0x67')));}if(!fs[_0xc8b5('0x60')](_0x409820)){throw new db[(_0xc8b5('0x68'))][(_0xc8b5('0x69'))](_['upperFirst'](_0xc8b5('0x56'))+_0xc8b5('0x6a'));}return _0x18740e[_0xc8b5('0x6b')](_0x409820);}})[_0xc8b5('0x25')](handleError(_0x18740e,null));};var utilLicense=require(_0xc8b5('0x16'));exports[_0xc8b5('0x6c')]=function(_0xfbb55a,_0x1c21dd,_0xa6c40c){var _0x395eda='server/files/images/logos';var _0x5280a5={'custom':![]};return utilLicense[_0xc8b5('0x5a')]()['then'](function(_0x1b3cdd){if(_0x1b3cdd){_0x5280a5=_0x1b3cdd;}return db[_0xc8b5('0x39')][_0xc8b5('0x51')]({'where':{'id':_0xfbb55a[_0xc8b5('0x4e')]['id']},'attributes':[_0xc8b5('0x56'),_0xc8b5('0x57'),_0xc8b5('0x5b'),_0xc8b5('0x5c'),'defaultLogo','defaultLoginLogo',_0xc8b5('0x5e'),_0xc8b5('0x5f')],'raw':!![]});})[_0xc8b5('0x1b')](handleEntityNotFound(_0x1c21dd,null))[_0xc8b5('0x1b')](function(_0x14e14c){if(_0x14e14c){var _0x51afc0=_0x14e14c[_0xc8b5('0x57')]&&fs['existsSync'](path['join'](config[_0xc8b5('0x62')],_0x395eda,_[_0xc8b5('0x63')](_0x14e14c['loginLogo'])))?path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x395eda,_[_0xc8b5('0x63')](_0x14e14c[_0xc8b5('0x57')])):path['join'](config[_0xc8b5('0x62')],_0x395eda,_[_0xc8b5('0x63')](_0xc8b5('0x6d')));var _0x2d8d9f=_0xc8b5('0x64')+_['upperFirst'](_0xc8b5('0x57'));if(_0x14e14c[_0x2d8d9f]||!_0x5280a5[_0xc8b5('0x66')]){_0x51afc0=path[_0xc8b5('0x61')](config['root'],_0x395eda,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xc8b5('0x60')](_0x51afc0)){throw new db[(_0xc8b5('0x68'))][(_0xc8b5('0x69'))](_['upperFirst'](_0xc8b5('0x57'))+_0xc8b5('0x6a'));}return _0x1c21dd['download'](_0x51afc0);}})[_0xc8b5('0x25')](handleError(_0x1c21dd,null));};exports[_0xc8b5('0x6e')]=function(_0x41f57d,_0x47e238){return db[_0xc8b5('0x39')]['find']({'where':{'id':_0x41f57d[_0xc8b5('0x4e')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x47e238,null))[_0xc8b5('0x25')](handleError(_0x47e238,null));};exports[_0xc8b5('0x6f')]=function(_0x12cee9,_0x5b6035,_0x167102){if(_0x12cee9[_0xc8b5('0x54')]&&_0x12cee9['file'][_0xc8b5('0x55')]){_0x12cee9[_0xc8b5('0x52')]['preferred']=_0x12cee9['file'][_0xc8b5('0x55')];}return db[_0xc8b5('0x39')][_0xc8b5('0x51')]({'where':{'id':_0x12cee9['params']['id']}})[_0xc8b5('0x1b')](handleEntityNotFound(_0x5b6035,null))[_0xc8b5('0x1b')](saveUpdates(_0x12cee9[_0xc8b5('0x52')],null))['then'](respondWithResult(_0x5b6035,null))['catch'](handleError(_0x5b6035,null));};var utilLicense=require('../../config/license/util');exports[_0xc8b5('0x70')]=function(_0x1d526e,_0x208a4b,_0x371879){var _0x59d6a6=_0xc8b5('0x59');var _0xcce79a={'custom':![]};return utilLicense[_0xc8b5('0x5a')]()['then'](function(_0x5d2ace){if(_0x5d2ace){_0xcce79a=_0x5d2ace;}return db[_0xc8b5('0x39')][_0xc8b5('0x51')]({'where':{'id':_0x1d526e[_0xc8b5('0x4e')]['id']},'attributes':[_0xc8b5('0x56'),_0xc8b5('0x57'),_0xc8b5('0x5b'),_0xc8b5('0x5c'),_0xc8b5('0x5d'),'defaultLoginLogo',_0xc8b5('0x5e'),_0xc8b5('0x5f')],'raw':!![]});})[_0xc8b5('0x1b')](handleEntityNotFound(_0x208a4b,null))[_0xc8b5('0x1b')](function(_0xe8573d){if(_0xe8573d){var _0x5b9777=_0xe8573d[_0xc8b5('0x5b')]&&fs[_0xc8b5('0x60')](path['join'](config['root'],_0x59d6a6,_[_0xc8b5('0x63')](_0xe8573d[_0xc8b5('0x5b')])))?path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x59d6a6,_[_0xc8b5('0x63')](_0xe8573d[_0xc8b5('0x5b')])):path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x59d6a6,_[_0xc8b5('0x63')](_0xc8b5('0x71')));var _0x5cb397='default'+_['upperFirst'](_0xc8b5('0x5b'));if(_0xe8573d[_0x5cb397]||!_0xcce79a[_0xc8b5('0x66')]||!_0xcce79a[_0xc8b5('0x5b')]){_0x5b9777=path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x59d6a6,_['toLower'](_0xc8b5('0x71')));}if(!fs[_0xc8b5('0x60')](_0x5b9777)){throw new db[(_0xc8b5('0x68'))]['ValidationError'](_[_0xc8b5('0x65')](_0xc8b5('0x5b'))+_0xc8b5('0x6a'));}return _0x208a4b[_0xc8b5('0x6b')](_0x5b9777);}})[_0xc8b5('0x25')](handleError(_0x208a4b,null));};exports[_0xc8b5('0x72')]=function(_0xec7bbc,_0x481d95,_0x5b4dce){if(_0xec7bbc['file']&&_0xec7bbc[_0xc8b5('0x54')][_0xc8b5('0x55')]){_0xec7bbc[_0xc8b5('0x52')][_0xc8b5('0x5c')]=_0xec7bbc['file']['filename'];}return db[_0xc8b5('0x39')]['find']({'where':{'id':_0xec7bbc[_0xc8b5('0x4e')]['id']}})[_0xc8b5('0x1b')](handleEntityNotFound(_0x481d95,null))[_0xc8b5('0x1b')](saveUpdates(_0xec7bbc['body'],null))[_0xc8b5('0x1b')](respondWithResult(_0x481d95,null))[_0xc8b5('0x25')](handleError(_0x481d95,null));};var utilLicense=require(_0xc8b5('0x16'));exports['getFavicon']=function(_0x3f89bc,_0x5dfeec,_0x4f172){var _0x41a1a1=_0xc8b5('0x59');var _0x173e2d={'custom':![]};return utilLicense[_0xc8b5('0x5a')]()[_0xc8b5('0x1b')](function(_0x27322f){if(_0x27322f){_0x173e2d=_0x27322f;}return db['Setting']['find']({'where':{'id':_0x3f89bc[_0xc8b5('0x4e')]['id']},'attributes':[_0xc8b5('0x56'),_0xc8b5('0x57'),_0xc8b5('0x5b'),_0xc8b5('0x5c'),_0xc8b5('0x5d'),_0xc8b5('0x73'),'defaultPreferred',_0xc8b5('0x5f')],'raw':!![]});})[_0xc8b5('0x1b')](handleEntityNotFound(_0x5dfeec,null))[_0xc8b5('0x1b')](function(_0x4941f8){if(_0x4941f8){var _0x1f4f91=_0x4941f8['favicon']&&fs[_0xc8b5('0x60')](path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x41a1a1,_[_0xc8b5('0x63')](_0x4941f8['favicon'])))?path[_0xc8b5('0x61')](config['root'],_0x41a1a1,_[_0xc8b5('0x63')](_0x4941f8[_0xc8b5('0x5c')])):path[_0xc8b5('0x61')](config['root'],_0x41a1a1,_[_0xc8b5('0x63')]('default_favicon.ico'));var _0x342202=_0xc8b5('0x64')+_[_0xc8b5('0x65')](_0xc8b5('0x5c'));if(_0x4941f8[_0x342202]||!_0x173e2d[_0xc8b5('0x66')]){_0x1f4f91=path[_0xc8b5('0x61')](config[_0xc8b5('0x62')],_0x41a1a1,_['toLower'](_0xc8b5('0x74')));}if(!fs[_0xc8b5('0x60')](_0x1f4f91)){throw new db[(_0xc8b5('0x68'))]['ValidationError'](_['upperFirst'](_0xc8b5('0x5c'))+_0xc8b5('0x6a'));}return _0x5dfeec[_0xc8b5('0x6b')](_0x1f4f91);}})[_0xc8b5('0x25')](handleError(_0x5dfeec,null));};exports['getDate']=function(_0x466476,_0x585bc0){var _0x28a271={'offset':moment()[_0xc8b5('0x75')]()};_0x28a271[_0xc8b5('0x76')]=moment()[_0xc8b5('0x75')](_0x28a271[_0xc8b5('0x28')])[_0xc8b5('0x77')](_0xc8b5('0x78'));return _0x585bc0[_0xc8b5('0x27')](0xc8)[_0xc8b5('0x36')](_0x28a271);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8d40a2f..72c8765 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4cf3b4,_0x4ab198){var _0x55c476=function(_0x258f6f){while(--_0x258f6f){_0x4cf3b4['push'](_0x4cf3b4['shift']());}};_0x55c476(++_0x4ab198);}(_0xedd9,0xfc));var _0x9edd=function(_0x51aab0,_0x537d99){_0x51aab0=_0x51aab0-0x0;var _0x3652cc=_0xedd9[_0x51aab0];return _0x3652cc;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x55ca,0x126));var _0xa55c=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x55ca[_0x58a4ac];return _0x545810;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 62236fa..465bcea 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 _0xe301=['Setting','find','options','raw','where','include','map','model','attributes','ShowSetting','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x5ceaf3,_0x1cec19){var _0xb12401=function(_0x1e851e){while(--_0x1e851e){_0x5ceaf3['push'](_0x5ceaf3['shift']());}};_0xb12401(++_0x1cec19);}(_0xe301,0xbe));var _0x1e30=function(_0x53bb74,_0x590c3e){_0x53bb74=_0x53bb74-0x0;var _0x286b70=_0xe301[_0x53bb74];return _0x286b70;};'use strict';var _=require('lodash');var util=require(_0x1e30('0x0'));var moment=require('moment');var BPromise=require(_0x1e30('0x1'));var rs=require(_0x1e30('0x2'));var fs=require('fs');var Redis=require(_0x1e30('0x3'));var db=require(_0x1e30('0x4'))['db'];var utils=require(_0x1e30('0x5'));var logger=require(_0x1e30('0x6'))('rpc');var config=require(_0x1e30('0x7'));var jayson=require(_0x1e30('0x8'));var client=jayson[_0x1e30('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a76ec,_0x5db6b5,_0x1a1f07){return new BPromise(function(_0x4d1383,_0x48d7e8){return client[_0x1e30('0xa')](_0x2a76ec,_0x1a1f07)['then'](function(_0x547b50){logger[_0x1e30('0xb')]('Setting,\x20%s,\x20%s',_0x5db6b5,_0x1e30('0xc'));logger[_0x1e30('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x5db6b5,_0x1e30('0xc'),JSON[_0x1e30('0xe')](_0x547b50));if(_0x547b50[_0x1e30('0xf')]){if(_0x547b50['error'][_0x1e30('0x10')]===0x1f4){logger[_0x1e30('0xf')](_0x1e30('0x11'),_0x5db6b5,_0x547b50[_0x1e30('0xf')][_0x1e30('0x12')]);return _0x48d7e8(_0x547b50['error'][_0x1e30('0x12')]);}logger[_0x1e30('0xf')](_0x1e30('0x11'),_0x5db6b5,_0x547b50['error'][_0x1e30('0x12')]);return _0x4d1383(_0x547b50[_0x1e30('0xf')][_0x1e30('0x12')]);}else{logger[_0x1e30('0xb')](_0x1e30('0x11'),_0x5db6b5,_0x1e30('0xc'));_0x4d1383(_0x547b50[_0x1e30('0x13')][_0x1e30('0x12')]);}})['catch'](function(_0x53053b){logger[_0x1e30('0xf')]('Setting,\x20%s,\x20%s',_0x5db6b5,_0x53053b);_0x48d7e8(_0x53053b);});});}exports['ShowSetting']=function(_0x542cb9){var _0x75182f=this;return new Promise(function(_0x2b215b,_0x218286){return db[_0x1e30('0x14')][_0x1e30('0x15')]({'raw':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x17')]===undefined?!![]:![]:!![],'where':_0x542cb9['options']?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x18')]||null:null,'attributes':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')]['attributes']||null:null,'include':_0x542cb9[_0x1e30('0x16')]?_0x542cb9[_0x1e30('0x16')][_0x1e30('0x19')]?_[_0x1e30('0x1a')](_0x542cb9[_0x1e30('0x16')][_0x1e30('0x19')],function(_0x2e2810){return{'model':db[_0x2e2810[_0x1e30('0x1b')]],'as':_0x2e2810['as'],'attributes':_0x2e2810[_0x1e30('0x1c')],'include':_0x2e2810[_0x1e30('0x19')]?_[_0x1e30('0x1a')](_0x2e2810[_0x1e30('0x19')],function(_0xb75d47){return{'model':db[_0xb75d47[_0x1e30('0x1b')]],'as':_0xb75d47['as'],'attributes':_0xb75d47[_0x1e30('0x1c')],'include':_0xb75d47[_0x1e30('0x19')]?_['map'](_0xb75d47[_0x1e30('0x19')],function(_0x4f2160){return{'model':db[_0x4f2160[_0x1e30('0x1b')]],'as':_0x4f2160['as'],'attributes':_0x4f2160[_0x1e30('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x961e0e){logger['info'](_0x1e30('0x1d'),_0x542cb9);logger[_0x1e30('0xd')](_0x1e30('0x1d'),_0x542cb9,JSON[_0x1e30('0xe')](_0x961e0e));_0x2b215b(_0x961e0e);})['catch'](function(_0x31f4f4){logger[_0x1e30('0xf')](_0x1e30('0x1d'),_0x31f4f4[_0x1e30('0x12')],_0x542cb9);_0x218286(_0x75182f['error'](0x1f4,_0x31f4f4[_0x1e30('0x12')]));});});}; \ No newline at end of file +var _0xfbba=['where','include','model','attributes','map','ShowSetting','stringify','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','Setting','find','options','raw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfbba,0x1d6));var _0xafbb=function(_0x2a61f9,_0xc5e2c7){_0x2a61f9=_0x2a61f9-0x0;var _0x5f5329=_0xfbba[_0x2a61f9];return _0x5f5329;};'use strict';var _=require(_0xafbb('0x0'));var util=require('util');var moment=require(_0xafbb('0x1'));var BPromise=require(_0xafbb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafbb('0x3'))['db'];var utils=require(_0xafbb('0x4'));var logger=require(_0xafbb('0x5'))(_0xafbb('0x6'));var config=require(_0xafbb('0x7'));var jayson=require(_0xafbb('0x8'));var client=jayson[_0xafbb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e7e80,_0x105172,_0x4d2f56){return new BPromise(function(_0x528479,_0x4ce311){return client[_0xafbb('0xa')](_0x5e7e80,_0x4d2f56)[_0xafbb('0xb')](function(_0x5739bc){logger[_0xafbb('0xc')](_0xafbb('0xd'),_0x105172,_0xafbb('0xe'));logger[_0xafbb('0xf')](_0xafbb('0x10'),_0x105172,_0xafbb('0xe'),JSON['stringify'](_0x5739bc));if(_0x5739bc['error']){if(_0x5739bc[_0xafbb('0x11')][_0xafbb('0x12')]===0x1f4){logger[_0xafbb('0x11')]('Setting,\x20%s,\x20%s',_0x105172,_0x5739bc[_0xafbb('0x11')][_0xafbb('0x13')]);return _0x4ce311(_0x5739bc[_0xafbb('0x11')][_0xafbb('0x13')]);}logger['error'](_0xafbb('0xd'),_0x105172,_0x5739bc['error'][_0xafbb('0x13')]);return _0x528479(_0x5739bc['error'][_0xafbb('0x13')]);}else{logger[_0xafbb('0xc')](_0xafbb('0xd'),_0x105172,_0xafbb('0xe'));_0x528479(_0x5739bc[_0xafbb('0x14')][_0xafbb('0x13')]);}})['catch'](function(_0x2b0b34){logger['error'](_0xafbb('0xd'),_0x105172,_0x2b0b34);_0x4ce311(_0x2b0b34);});});}exports['ShowSetting']=function(_0x24b7ab){var _0x3cd745=this;return new Promise(function(_0x76da6d,_0x50dcb4){return db[_0xafbb('0x15')][_0xafbb('0x16')]({'raw':_0x24b7ab[_0xafbb('0x17')]?_0x24b7ab[_0xafbb('0x17')][_0xafbb('0x18')]===undefined?!![]:![]:!![],'where':_0x24b7ab['options']?_0x24b7ab[_0xafbb('0x17')][_0xafbb('0x19')]||null:null,'attributes':_0x24b7ab['options']?_0x24b7ab[_0xafbb('0x17')]['attributes']||null:null,'include':_0x24b7ab[_0xafbb('0x17')]?_0x24b7ab['options']['include']?_['map'](_0x24b7ab[_0xafbb('0x17')][_0xafbb('0x1a')],function(_0x52462c){return{'model':db[_0x52462c[_0xafbb('0x1b')]],'as':_0x52462c['as'],'attributes':_0x52462c[_0xafbb('0x1c')],'include':_0x52462c[_0xafbb('0x1a')]?_[_0xafbb('0x1d')](_0x52462c['include'],function(_0x51aeb8){return{'model':db[_0x51aeb8[_0xafbb('0x1b')]],'as':_0x51aeb8['as'],'attributes':_0x51aeb8['attributes'],'include':_0x51aeb8[_0xafbb('0x1a')]?_['map'](_0x51aeb8[_0xafbb('0x1a')],function(_0x10d88d){return{'model':db[_0x10d88d[_0xafbb('0x1b')]],'as':_0x10d88d['as'],'attributes':_0x10d88d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30e162){logger[_0xafbb('0xc')](_0xafbb('0x1e'),_0x24b7ab);logger[_0xafbb('0xf')](_0xafbb('0x1e'),_0x24b7ab,JSON[_0xafbb('0x1f')](_0x30e162));_0x76da6d(_0x30e162);})[_0xafbb('0x20')](function(_0x5c47b2){logger[_0xafbb('0x11')](_0xafbb('0x1e'),_0x5c47b2[_0xafbb('0x13')],_0x24b7ab);_0x50dcb4(_0x3cd745['error'](0x1f4,_0x5c47b2[_0xafbb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 737793f..ff3807e 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'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['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x153b5a,_0x804ae0){_0x153b5a=_0x153b5a-0x0;var _0x30696f=_0x1cb9[_0x153b5a];return _0x30696f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index cc31c18..f2a7357 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 _0x84ca=['mandatoryDispositionPauseId','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x84ca,0x169));var _0xa84c=function(_0x3e3a79,_0x292e01){_0x3e3a79=_0x3e3a79-0x0;var _0x46df88=_0x84ca[_0x3e3a79];return _0x46df88;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa84c('0x0'));module[_0xa84c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa84c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa84c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa84c('0x2')],'defaultValue':function(){return rs[_0xa84c('0x3')]();}},'phone':{'type':Sequelize[_0xa84c('0x2')]},'type':{'type':Sequelize[_0xa84c('0x4')](_0xa84c('0x5'),_0xa84c('0x6'),_0xa84c('0x7'),_0xa84c('0x8'),_0xa84c('0x9'),'clickatell','bandwidth',_0xa84c('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xa84c('0x2')]},'authToken':{'type':Sequelize[_0xa84c('0x2')]},'smsMethod':{'type':Sequelize[_0xa84c('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa84c('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xa84c('0x2')]},'senderString':{'type':Sequelize[_0xa84c('0x2')]},'deliveryReport':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xa84c('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa84c('0xc')],'defaultValue':function(){return _0xa84c('0xd');}},'notificationSound':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa84c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa84c('0xe')],'comment':_0xa84c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xa84c('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27cfbd){if(!_0x27cfbd)this[_0xa84c('0x10')](_0xa84c('0x11'),null);this[_0xa84c('0x10')]('mandatoryDisposition',_0x27cfbd);}}}; \ No newline at end of file +var _0x6708=['skebby','clicksend','plivo','clickatell','bandwidth','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','randomstring','STRING','name','generate','ENUM','twilio'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x6708,0x19c));var _0x8670=function(_0x555fb2,_0x396ab0){_0x555fb2=_0x555fb2-0x0;var _0x22e9bf=_0x6708[_0x555fb2];return _0x22e9bf;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8670('0x0'));module['exports']={'name':{'type':Sequelize[_0x8670('0x1')],'unique':_0x8670('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x8670('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x8670('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x8670('0x1')],'defaultValue':function(){return rs[_0x8670('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8670('0x4')](_0x8670('0x5'),_0x8670('0x6'),'connectel',_0x8670('0x7'),_0x8670('0x8'),_0x8670('0x9'),_0x8670('0xa'),'csc',_0x8670('0xb'),'intelepeer')},'accountSid':{'type':Sequelize[_0x8670('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8670('0x1')]},'password':{'type':Sequelize[_0x8670('0x1')]},'apiKey':{'type':Sequelize[_0x8670('0x1')]},'applicationId':{'type':Sequelize[_0x8670('0x1')]},'accountId':{'type':Sequelize[_0x8670('0x1')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x8670('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x8670('0x1')]},'notificationTemplate':{'type':Sequelize[_0x8670('0xd')],'defaultValue':function(){return _0x8670('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8670('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8670('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8670('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8670('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8670('0xf')],'comment':_0x8670('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x8670('0xc')],'defaultValue':![],'comment':_0x8670('0x11'),'set':function(_0x457a38){if(!_0x457a38)this['setDataValue'](_0x8670('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x457a38);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 95bc9b0..8979026 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 _0x9e67=['Content-Range','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','Sequelize','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','status_code','message_id','groupName','clickatell','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x9e67,0x199));var _0x79e6=function(_0x14ffb8,_0x41cec7){_0x14ffb8=_0x14ffb8-0x0;var _0x12b1f8=_0x9e67[_0x14ffb8];return _0x12b1f8;};'use strict';var emlformat=require(_0x79e6('0x0'));var rimraf=require(_0x79e6('0x1'));var zipdir=require(_0x79e6('0x2'));var jsonpatch=require(_0x79e6('0x3'));var rp=require('request-promise');var moment=require(_0x79e6('0x4'));var BPromise=require(_0x79e6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79e6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x79e6('0x7'));var fs=require('fs');var fs_extra=require(_0x79e6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79e6('0x9'));var deskjs=require(_0x79e6('0xa'));var toCsv=require(_0x79e6('0xb'));var querystring=require(_0x79e6('0xc'));var Papa=require(_0x79e6('0xd'));var Redis=require(_0x79e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x79e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79e6('0x10'));var logger=require(_0x79e6('0x11'))('api');var utils=require(_0x79e6('0x12'));var config=require(_0x79e6('0x13'));var licenseUtil=require(_0x79e6('0x14'));var db=require(_0x79e6('0x15'))['db'];config[_0x79e6('0x16')]=_[_0x79e6('0x17')](config[_0x79e6('0x16')],{'host':_0x79e6('0x18'),'port':0x18eb});var socket=require(_0x79e6('0x19'))(new Redis(config[_0x79e6('0x16')]));require(_0x79e6('0x1a'))[_0x79e6('0x1b')](socket);var jayson=require(_0x79e6('0x1c'));var client=jayson[_0x79e6('0x1d')][_0x79e6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x52dd00,_0x2489a8,_0x199fc6,_0x2eb415){return new BPromise(function(_0x2d70ac,_0xfc0975){var _0x1e0724=_0x2eb415||client;return _0x1e0724['request'](_0x52dd00,_0x199fc6)[_0x79e6('0x1f')](function(_0x472b9c){logger[_0x79e6('0x20')](_0x79e6('0x21'),_0x2489a8,_0x79e6('0x22'));logger['debug'](_0x79e6('0x23'),_0x2489a8,'request\x20sent',JSON[_0x79e6('0x24')](_0x472b9c));if(_0x472b9c[_0x79e6('0x25')]){if(_0x472b9c['error'][_0x79e6('0x26')]===0x1f4){logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x472b9c[_0x79e6('0x25')]['message']);return _0xfc0975(_0x472b9c['error'][_0x79e6('0x27')]);}logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x472b9c['error'][_0x79e6('0x27')]);return _0x2d70ac(_0x472b9c[_0x79e6('0x25')]['message']);}else{logger[_0x79e6('0x20')](_0x79e6('0x21'),_0x2489a8,'request\x20sent');_0x2d70ac(_0x472b9c[_0x79e6('0x28')]['message']);}})[_0x79e6('0x29')](function(_0x504370){logger[_0x79e6('0x25')](_0x79e6('0x21'),_0x2489a8,_0x504370);_0xfc0975(_0x504370);});});}function respondWithStatusCode(_0x4d1631,_0x5efcf9){_0x5efcf9=_0x5efcf9||0xcc;return function(_0x26fa3f){if(_0x26fa3f){return _0x4d1631[_0x79e6('0x2a')](_0x5efcf9);}return _0x4d1631[_0x79e6('0x2b')](_0x5efcf9)[_0x79e6('0x2c')]();};}function respondWithResult(_0x2255ac,_0x509a69){_0x509a69=_0x509a69||0xc8;return function(_0x4f6004){if(_0x4f6004){return _0x2255ac[_0x79e6('0x2b')](_0x509a69)[_0x79e6('0x2d')](_0x4f6004);}};}function respondWithFilteredResult(_0x33ec89,_0x16b233){return function(_0x4352fb){if(_0x4352fb){var _0x4bfcf0=typeof _0x16b233['offset']===_0x79e6('0x2e')&&typeof _0x16b233[_0x79e6('0x2f')]===_0x79e6('0x2e');var _0x1cdffd=_0x4352fb['count'];var _0x16f429=_0x4bfcf0?0x0:_0x16b233['offset'];var _0x386990=_0x4bfcf0?_0x4352fb[_0x79e6('0x30')]:_0x16b233[_0x79e6('0x31')]+_0x16b233[_0x79e6('0x2f')];var _0x84395f;if(_0x386990>=_0x1cdffd){_0x386990=_0x1cdffd;_0x84395f=0xc8;}else{_0x84395f=0xce;}_0x33ec89[_0x79e6('0x2b')](_0x84395f);return _0x33ec89[_0x79e6('0x32')](_0x79e6('0x33'),_0x16f429+'-'+_0x386990+'/'+_0x1cdffd)['json'](_0x4352fb);}return null;};}function patchUpdates(_0x59cbf0){return function(_0x392b7e){try{jsonpatch['apply'](_0x392b7e,_0x59cbf0,!![]);}catch(_0x53efb1){return BPromise[_0x79e6('0x34')](_0x53efb1);}return _0x392b7e[_0x79e6('0x35')]();};}function saveUpdates(_0x179669,_0x5265a5){return function(_0x4571f6){if(_0x4571f6){return _0x4571f6['update'](_0x179669)[_0x79e6('0x1f')](function(_0x117758){return _0x117758;});}return null;};}function removeEntity(_0x3ef4b1,_0x1d6713){return function(_0x5d7eb0){if(_0x5d7eb0){return _0x5d7eb0[_0x79e6('0x36')]()['then'](function(){var _0x362230=_0x5d7eb0[_0x79e6('0x37')]({'plain':!![]});var _0x4f40e9='SmsAccounts';return db[_0x79e6('0x38')][_0x79e6('0x36')]({'where':{'type':_0x4f40e9,'resourceId':_0x362230['id']}})[_0x79e6('0x1f')](function(){return _0x5d7eb0;});})[_0x79e6('0x1f')](function(){_0x3ef4b1[_0x79e6('0x2b')](0xcc)[_0x79e6('0x2c')]();});}};}function handleEntityNotFound(_0xe1c48c,_0x338e68){return function(_0x43a7a1){if(!_0x43a7a1){_0xe1c48c[_0x79e6('0x2a')](0x194);}return _0x43a7a1;};}function handleError(_0x55b7be,_0x30053f){_0x30053f=_0x30053f||0x1f4;return function(_0x471e63){logger[_0x79e6('0x25')](_0x471e63[_0x79e6('0x39')]);if(_0x471e63[_0x79e6('0x3a')]){delete _0x471e63[_0x79e6('0x3a')];}_0x55b7be[_0x79e6('0x2b')](_0x30053f)[_0x79e6('0x3b')](_0x471e63);};}exports[_0x79e6('0x3c')]=function(_0x5c2c85,_0x3486b4){var _0x44e11b={'include':[{'model':db[_0x79e6('0x3d')],'as':_0x79e6('0x3e')}]},_0x1391f5={},_0x3b136a={'count':0x0,'rows':[]};var _0x5b79bc=_[_0x79e6('0x3f')](db[_0x79e6('0x40')][_0x79e6('0x41')],function(_0x3a72b8){return{'name':_0x3a72b8[_0x79e6('0x42')],'type':_0x3a72b8['type']['key']};});_0x1391f5[_0x79e6('0x43')]=_[_0x79e6('0x3f')](_0x5b79bc,_0x79e6('0x3a'));_0x1391f5['query']=_[_0x79e6('0x44')](_0x5c2c85[_0x79e6('0x45')]);_0x1391f5[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x1391f5['model'],_0x1391f5[_0x79e6('0x45')]);_0x44e11b[_0x79e6('0x48')]=_['intersection'](_0x1391f5[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x49')]));_0x44e11b[_0x79e6('0x48')]=_0x44e11b[_0x79e6('0x48')]['length']?_0x44e11b['attributes']:_0x1391f5[_0x79e6('0x43')];if(!_0x5c2c85['query'][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x44e11b['limit']=qs[_0x79e6('0x2f')](_0x5c2c85['query'][_0x79e6('0x2f')]);_0x44e11b[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x31')]);}_0x44e11b[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x5c2c85[_0x79e6('0x45')]['sort']);_0x44e11b[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x5c2c85[_0x79e6('0x45')],_0x1391f5[_0x79e6('0x46')]),_0x5b79bc);if(_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x50')]){_0x44e11b['where']=_[_0x79e6('0x51')](_0x44e11b['where'],{'$or':_[_0x79e6('0x3f')](_0x5b79bc,function(_0x44901b){if(_0x44901b[_0x79e6('0x52')]!==_0x79e6('0x53')){var _0x10011f={};_0x10011f[_0x44901b[_0x79e6('0x3a')]]={'$like':'%'+_0x5c2c85[_0x79e6('0x45')][_0x79e6('0x50')]+'%'};return _0x10011f;}})});}_0x44e11b=_[_0x79e6('0x51')]({},_0x44e11b,_0x5c2c85[_0x79e6('0x54')]);var _0x4fc4eb={'where':_0x44e11b[_0x79e6('0x4e')]};return db[_0x79e6('0x40')][_0x79e6('0x30')](_0x4fc4eb)[_0x79e6('0x1f')](function(_0x5f208e){_0x3b136a[_0x79e6('0x30')]=_0x5f208e;if(_0x5c2c85['query'][_0x79e6('0x55')]){_0x44e11b['include']=[{'all':!![]}];}return db['SmsAccount'][_0x79e6('0x56')](_0x44e11b);})[_0x79e6('0x1f')](function(_0x1f4c48){_0x3b136a[_0x79e6('0x57')]=_0x1f4c48;return _0x3b136a;})[_0x79e6('0x1f')](respondWithFilteredResult(_0x3486b4,_0x44e11b))[_0x79e6('0x29')](handleError(_0x3486b4,null));};exports[_0x79e6('0x58')]=function(_0x12b455,_0x3d6bd3){var _0xb9960={'raw':![],'where':{'id':_0x12b455['params']['id']},'include':[{'model':db[_0x79e6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5725bc={};_0x5725bc['model']=_[_0x79e6('0x44')](db['SmsAccount'][_0x79e6('0x41')]);_0x5725bc['query']=_[_0x79e6('0x44')](_0x12b455[_0x79e6('0x45')]);_0x5725bc[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x5725bc[_0x79e6('0x43')],_0x5725bc[_0x79e6('0x45')]);_0xb9960[_0x79e6('0x48')]=_[_0x79e6('0x47')](_0x5725bc[_0x79e6('0x43')],qs['fields'](_0x12b455[_0x79e6('0x45')]['fields']));_0xb9960[_0x79e6('0x48')]=_0xb9960[_0x79e6('0x48')]['length']?_0xb9960[_0x79e6('0x48')]:_0x5725bc[_0x79e6('0x43')];if(_0x12b455[_0x79e6('0x45')][_0x79e6('0x55')]){_0xb9960[_0x79e6('0x59')]=[{'all':!![]}];}_0xb9960=_['merge']({},_0xb9960,_0x12b455[_0x79e6('0x54')]);return db[_0x79e6('0x40')][_0x79e6('0x5a')](_0xb9960)['then'](handleEntityNotFound(_0x3d6bd3,null))[_0x79e6('0x1f')](respondWithResult(_0x3d6bd3,null))[_0x79e6('0x29')](handleError(_0x3d6bd3,null));};exports[_0x79e6('0x5b')]=function(_0xfcf1ec,_0x2ebbef){return db[_0x79e6('0x40')][_0x79e6('0x5b')](_0xfcf1ec['body'],{})[_0x79e6('0x1f')](function(_0x36d3e3){var _0x220ba9=_0xfcf1ec[_0x79e6('0x5c')][_0x79e6('0x37')]({'plain':!![]});if(!_0x220ba9)throw new Error(_0x79e6('0x5d'));if(_0x220ba9[_0x79e6('0x5e')]===_0x79e6('0x5c')){var _0x330201=_0x36d3e3['get']({'plain':!![]});var _0x407796=_0x79e6('0x5f');return db[_0x79e6('0x60')][_0x79e6('0x5a')]({'where':{'name':_0x407796,'userProfileId':_0x220ba9[_0x79e6('0x61')]},'raw':!![]})[_0x79e6('0x1f')](function(_0x3c54b5){if(_0x3c54b5&&_0x3c54b5['autoAssociation']===0x0){return db[_0x79e6('0x38')][_0x79e6('0x5b')]({'name':_0x330201[_0x79e6('0x3a')],'resourceId':_0x330201['id'],'type':_0x3c54b5[_0x79e6('0x3a')],'sectionId':_0x3c54b5['id']},{})[_0x79e6('0x1f')](function(){return _0x36d3e3;});}else{return _0x36d3e3;}})['catch'](function(_0x1af3a2){logger[_0x79e6('0x25')](_0x79e6('0x62'),_0x1af3a2);throw _0x1af3a2;});}return _0x36d3e3;})['then'](respondWithResult(_0x2ebbef,0xc9))[_0x79e6('0x29')](handleError(_0x2ebbef,null));};exports[_0x79e6('0x63')]=function(_0x32a3bd,_0x2083bb){if(_0x32a3bd[_0x79e6('0x64')]['id']){delete _0x32a3bd[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')]['find']({'where':{'id':_0x32a3bd[_0x79e6('0x65')]['id']},'include':[{'model':db[_0x79e6('0x3d')],'as':_0x79e6('0x3e')}]})['then'](handleEntityNotFound(_0x2083bb,null))[_0x79e6('0x1f')](saveUpdates(_0x32a3bd[_0x79e6('0x64')],null))[_0x79e6('0x1f')](respondWithResult(_0x2083bb,null))[_0x79e6('0x29')](handleError(_0x2083bb,null));};exports[_0x79e6('0x36')]=function(_0x415297,_0xd6cb3a){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x415297['params']['id']}})['then'](handleEntityNotFound(_0xd6cb3a,null))[_0x79e6('0x1f')](removeEntity(_0xd6cb3a,null))[_0x79e6('0x29')](handleError(_0xd6cb3a,null));};exports[_0x79e6('0x66')]=function(_0x3b78e6,_0x2d84b2){return db['SmsAccount'][_0x79e6('0x66')]()[_0x79e6('0x1f')](respondWithResult(_0x2d84b2,null))[_0x79e6('0x29')](handleError(_0x2d84b2,null));};exports['addDisposition']=function(_0x28973b,_0x65eabf,_0x21238d){if(_0x28973b[_0x79e6('0x64')]['id']){delete _0x28973b[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')]['find']({'where':{'id':_0x28973b[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x65eabf,null))['then'](function(_0x5aa7c9){if(_0x5aa7c9){_0x28973b[_0x79e6('0x64')][_0x79e6('0x67')]=_0x5aa7c9['id'];return db[_0x79e6('0x68')][_0x79e6('0x5b')](_0x28973b['body']);}})[_0x79e6('0x1f')](respondWithResult(_0x65eabf,null))[_0x79e6('0x29')](handleError(_0x65eabf,null));};exports[_0x79e6('0x69')]=function(_0x31e579,_0x384095,_0x4fc211){var _0x9e728a={'raw':![],'where':{}};var _0x2805d6={};var _0x249287={'count':0x0,'rows':[]};return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x31e579['params']['id']}})['then'](handleEntityNotFound(_0x384095,null))['then'](function(_0x5576a3){if(_0x5576a3){_0x2805d6[_0x79e6('0x43')]=_[_0x79e6('0x44')](db['Disposition'][_0x79e6('0x41')]);_0x2805d6[_0x79e6('0x45')]=_[_0x79e6('0x44')](_0x31e579['query']);_0x2805d6[_0x79e6('0x46')]=_['intersection'](_0x2805d6[_0x79e6('0x43')],_0x2805d6[_0x79e6('0x45')]);_0x9e728a[_0x79e6('0x48')]=_[_0x79e6('0x47')](_0x2805d6[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x31e579['query'][_0x79e6('0x49')]));_0x9e728a[_0x79e6('0x48')]=_0x9e728a['attributes']['length']?_0x9e728a[_0x79e6('0x48')]:_0x2805d6['model'];if(!_0x31e579['query'][_0x79e6('0x4a')]('nolimit')){_0x9e728a[_0x79e6('0x2f')]=qs['limit'](_0x31e579['query']['limit']);_0x9e728a[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x31e579['query'][_0x79e6('0x31')]);}_0x9e728a[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x31e579['query']['sort']);_0x9e728a['where']=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x31e579[_0x79e6('0x45')],_0x2805d6[_0x79e6('0x46')]));_0x9e728a[_0x79e6('0x4e')][_0x79e6('0x67')]=_0x5576a3['id'];if(_0x31e579[_0x79e6('0x45')][_0x79e6('0x50')]){_0x9e728a[_0x79e6('0x4e')]=_[_0x79e6('0x51')](_0x9e728a[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x9e728a[_0x79e6('0x48')],function(_0x192e82){var _0x1fbe07={};_0x1fbe07[_0x192e82]={'$like':'%'+_0x31e579['query'][_0x79e6('0x50')]+'%'};return _0x1fbe07;})});}_0x9e728a=_[_0x79e6('0x51')]({},_0x9e728a,_0x31e579[_0x79e6('0x54')]);return db[_0x79e6('0x68')][_0x79e6('0x30')]({'where':_0x9e728a[_0x79e6('0x4e')]})[_0x79e6('0x1f')](function(_0x5f396c){_0x249287['count']=_0x5f396c;if(_0x31e579[_0x79e6('0x45')][_0x79e6('0x55')]){_0x9e728a[_0x79e6('0x59')]=[{'all':!![]}];}return db[_0x79e6('0x68')][_0x79e6('0x56')](_0x9e728a);})[_0x79e6('0x1f')](function(_0x549bf7){_0x249287[_0x79e6('0x57')]=_0x549bf7;return _0x249287;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x384095,_0x9e728a))['catch'](handleError(_0x384095,null));};exports[_0x79e6('0x6b')]=function(_0x19fe0d,_0x364120,_0x2ac63f){return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x19fe0d[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x364120,null))['then'](function(_0x3af4b3){if(_0x3af4b3){return _0x3af4b3['removeDispositions'](_0x19fe0d[_0x79e6('0x45')][_0x79e6('0x6c')]);}})[_0x79e6('0x1f')](respondWithStatusCode(_0x364120,null))['catch'](handleError(_0x364120,null));};exports[_0x79e6('0x6d')]=function(_0x35f6de,_0x207abd,_0x477356){if(_0x35f6de[_0x79e6('0x64')]['id']){delete _0x35f6de[_0x79e6('0x64')]['id'];}return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x35f6de[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x207abd,null))[_0x79e6('0x1f')](function(_0xf13063){if(_0xf13063){_0x35f6de[_0x79e6('0x64')]['SmsAccountId']=_0xf13063['id'];return db[_0x79e6('0x6e')]['create'](_0x35f6de[_0x79e6('0x64')]);}})[_0x79e6('0x1f')](respondWithResult(_0x207abd,null))[_0x79e6('0x29')](handleError(_0x207abd,null));};exports[_0x79e6('0x6f')]=function(_0x54a2c3,_0x240294,_0x23fbc0){var _0x2f11d7={'raw':![],'where':{}};var _0x15ad74={};var _0x5e1eaa={'count':0x0,'rows':[]};return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x54a2c3[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x240294,null))[_0x79e6('0x1f')](function(_0xb71681){if(_0xb71681){_0x15ad74['model']=_[_0x79e6('0x44')](db['CannedAnswer']['rawAttributes']);_0x15ad74[_0x79e6('0x45')]=_['keys'](_0x54a2c3[_0x79e6('0x45')]);_0x15ad74[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x15ad74['model'],_0x15ad74[_0x79e6('0x45')]);_0x2f11d7[_0x79e6('0x48')]=_['intersection'](_0x15ad74[_0x79e6('0x43')],qs[_0x79e6('0x49')](_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x49')]));_0x2f11d7[_0x79e6('0x48')]=_0x2f11d7['attributes'][_0x79e6('0x70')]?_0x2f11d7[_0x79e6('0x48')]:_0x15ad74[_0x79e6('0x43')];if(!_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x2f11d7[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x54a2c3['query']['limit']);_0x2f11d7['offset']=qs[_0x79e6('0x31')](_0x54a2c3['query'][_0x79e6('0x31')]);}_0x2f11d7[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x54a2c3['query'][_0x79e6('0x4d')]);_0x2f11d7[_0x79e6('0x4e')]=qs['filters'](_['pick'](_0x54a2c3[_0x79e6('0x45')],_0x15ad74['filters']));_0x2f11d7[_0x79e6('0x4e')]['SmsAccountId']=_0xb71681['id'];if(_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x50')]){_0x2f11d7['where']=_['merge'](_0x2f11d7['where'],{'$or':_['map'](_0x2f11d7[_0x79e6('0x48')],function(_0x527cae){var _0x565fca={};_0x565fca[_0x527cae]={'$like':'%'+_0x54a2c3[_0x79e6('0x45')]['filter']+'%'};return _0x565fca;})});}_0x2f11d7=_[_0x79e6('0x51')]({},_0x2f11d7,_0x54a2c3[_0x79e6('0x54')]);return db['CannedAnswer'][_0x79e6('0x30')]({'where':_0x2f11d7[_0x79e6('0x4e')]})['then'](function(_0x21c34a){_0x5e1eaa[_0x79e6('0x30')]=_0x21c34a;if(_0x54a2c3[_0x79e6('0x45')][_0x79e6('0x55')]){_0x2f11d7[_0x79e6('0x59')]=[{'all':!![]}];}return db[_0x79e6('0x6e')]['findAll'](_0x2f11d7);})[_0x79e6('0x1f')](function(_0x4a73a3){_0x5e1eaa[_0x79e6('0x57')]=_0x4a73a3;return _0x5e1eaa;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x240294,_0x2f11d7))[_0x79e6('0x29')](handleError(_0x240294,null));};exports[_0x79e6('0x71')]=function(_0x360d27,_0x55fa7b,_0x1ea749){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x360d27[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x55fa7b,null))[_0x79e6('0x1f')](function(_0x24522f){if(_0x24522f){return _0x24522f[_0x79e6('0x71')](_0x360d27[_0x79e6('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x55fa7b,null))['catch'](handleError(_0x55fa7b,null));};exports[_0x79e6('0x72')]=function(_0x3de75b,_0x5501a8,_0x154bb5){var _0x20069f={'channel':'sms'};var _0x48edb4=[];var _0x8e3f36=[];var _0x179144={};return db['SmsAccount'][_0x79e6('0x5a')]({'where':{'id':_0x3de75b['params']['id']},'include':[{'model':db[_0x79e6('0x73')],'as':_0x79e6('0x74')}]})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x10c5e9){_0x20069f[_0x79e6('0x75')]=_0x10c5e9;_0x20069f[_0x79e6('0x76')]=_[_0x79e6('0x77')](_0x10c5e9['Applications'],[_0x79e6('0x78')],[_0x79e6('0x79')]);if(_0x20069f[_0x79e6('0x75')][_0x79e6('0x74')]){delete _0x20069f[_0x79e6('0x75')][_0x79e6('0x74')];}return db[_0x79e6('0x7a')]['describe']();})['then'](function(_0x463d93){if(!_0x463d93){throw new db['Sequelize']['ValidationError'](_0x79e6('0x7b'));}_0x48edb4=_[_0x79e6('0x7c')](_[_0x79e6('0x44')](_0x463d93),[_0x79e6('0x7d'),_0x79e6('0x7e')]);_0x8e3f36=_[_0x79e6('0x7c')](_[_0x79e6('0x44')](_0x463d93),['createdAt',_0x79e6('0x7e'),'CompanyId',_0x79e6('0x7f')]);_0x20069f['body']={'mapKey':_0x79e6('0x80')};if(_0x20069f['account'][_0x79e6('0x52')]){switch(_0x20069f['account'][_0x79e6('0x52')]){case'twilio':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x82')];_0x20069f['body']['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x83')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x85')];break;case _0x79e6('0x86'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]='+'+_0x3de75b['body']['sender'];_0x20069f['body'][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x87')];break;case _0x79e6('0x88'):_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b['body'][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x27')];break;case _0x79e6('0x89'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')]['from'];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x64')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b['body']['message_id'];break;case'plivo':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x82')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x8a')];_0x20069f['body'][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8b')];break;case _0x79e6('0x8c'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]='+'+_0x3de75b['body'][_0x79e6('0x8d')][0x0][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')]['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8d')][0x0][_0x79e6('0x87')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b['body']['results'][0x0][_0x79e6('0x84')];break;case _0x79e6('0x8e'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x8f')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][_0x79e6('0x90')][_0x79e6('0x27')];break;case'clickatell':_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x91')];_0x20069f[_0x79e6('0x64')]['body']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x87')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x92')];break;case _0x79e6('0x93'):_0x20069f[_0x79e6('0x64')][_0x79e6('0x84')]=_0x3de75b[_0x79e6('0x64')][0x0][_0x79e6('0x27')]['id'];_0x20069f[_0x79e6('0x64')]['from']=_0x3de75b[_0x79e6('0x64')][0x0][_0x79e6('0x27')][_0x79e6('0x81')];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b['body'][0x0]['message']['text'];break;case _0x79e6('0x94'):_0x20069f['body'][_0x79e6('0x81')]=_0x3de75b[_0x79e6('0x64')]['from'];_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')]=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x27')];_0x20069f[_0x79e6('0x64')]['messageId']=_0x3de75b[_0x79e6('0x64')][_0x79e6('0x95')];break;}}if(_0x20069f[_0x79e6('0x64')]['id']){delete _0x20069f['body']['id'];}if(_['isNil'](_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')])){throw new db[(_0x79e6('0x96'))]['ValidationError'](_0x79e6('0x97'));}if(_[_0x79e6('0x98')](_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')])||_0x20069f['body']['body']===''){throw new db['Sequelize'][(_0x79e6('0x99'))](_0x79e6('0x9a'));}if(_[_0x79e6('0x98')](_0x20069f[_0x79e6('0x64')]['mapKey'])){throw new db[(_0x79e6('0x96'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8e3f36);}if(!_[_0x79e6('0x9b')](_0x8e3f36,_0x20069f[_0x79e6('0x64')][_0x79e6('0x9c')])){throw new db['Sequelize'][(_0x79e6('0x99'))](_0x79e6('0x9d')+_0x8e3f36);}_0x179144[_0x20069f[_0x79e6('0x64')][_0x79e6('0x9c')]]=_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')];return db[_0x79e6('0x9e')][_0x79e6('0x5a')]({'where':{'id':_0x20069f[_0x79e6('0x75')][_0x79e6('0x7f')]},'include':[{'model':db[_0x79e6('0x7a')],'as':'Contacts','where':_0x179144,'limit':0x1,'order':[['updatedAt',_0x79e6('0x9f')]]}]});})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x4008ef){if(_0x4008ef){_0x20069f[_0x79e6('0xa0')]=_[_0x79e6('0xa1')](_0x4008ef,[_0x79e6('0xa2')]);if(_0x4008ef[_0x79e6('0xa2')][_0x79e6('0x70')]){return _0x4008ef['Contacts'][0x0];}var _0x33ab2c=_['defaults'](_0x20069f[_0x79e6('0x64')],{'firstName':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')],'ListId':_0x4008ef['id']});_0x33ab2c[_0x20069f['body'][_0x79e6('0x9c')]]=_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')];return db[_0x79e6('0x7a')][_0x79e6('0x5b')](_0x33ab2c,{'fields':_0x48edb4,'raw':!![]});}})[_0x79e6('0x1f')](handleEntityNotFound(_0x5501a8,null))[_0x79e6('0x1f')](function(_0x1d17ec){if(_0x1d17ec){_0x20069f[_0x79e6('0xa3')]=_0x1d17ec;var _0x42c1f4={'ContactId':_0x1d17ec['id'],'phone':_0x20069f[_0x79e6('0x64')]['from'],'SmsAccountId':_0x3de75b[_0x79e6('0x65')]['id']};var _0x20ac96={'ContactId':_0x1d17ec['id'],'SmsAccountId':_0x3de75b[_0x79e6('0x65')]['id'],'closed':![]};return db[_0x79e6('0xa4')][_0x79e6('0x5a')]({'where':_0x20ac96})[_0x79e6('0x1f')](function(_0x4faeb4){if(_0x4faeb4){return[_0x4faeb4,![]];}return db['SmsInteraction']['create'](_0x42c1f4)[_0x79e6('0x1f')](function(_0x4e0097){return[_0x4e0097,!![]];});});}})['spread'](function(_0x1ef837,_0x1d802c){_0x20069f[_0x79e6('0xa5')]=_0x1ef837[_0x79e6('0x37')]({'plain':!![]});_0x20069f[_0x79e6('0xa5')][_0x79e6('0xa6')]=![];if(_0x1d802c){if(_0x20069f[_0x79e6('0x75')][_0x79e6('0xa7')]){_0x20069f[_0x79e6('0x76')]['push']({'id':0x0,'priority':_0x20069f[_0x79e6('0x76')]['length']+0x1,'app':_0x79e6('0xa8'),'appdata':_0x79e6('0xa9'),'interval':'*,*,*,*'});}_0x20069f['interaction'][_0x79e6('0xa6')]=!![];}return db[_0x79e6('0xaa')][_0x79e6('0x5b')]({'phone':_0x20069f[_0x79e6('0x64')][_0x79e6('0x81')],'messageId':_0x20069f[_0x79e6('0x64')]['messageId'],'body':_0x20069f[_0x79e6('0x64')][_0x79e6('0x64')],'SmsAccountId':_0x3de75b['params']['id'],'SmsInteractionId':_0x1ef837['id'],'direction':'in','ContactId':_0x1ef837['ContactId'],'AttachmentId':_0x20069f[_0x79e6('0x64')][_0x79e6('0xab')]});})[_0x79e6('0x1f')](function(_0xe3d4f4){_0x20069f['message']=_0xe3d4f4;if(_0x20069f[_0x79e6('0xa5')][_0x79e6('0xac')]){return db[_0x79e6('0xad')][_0x79e6('0x5a')]({'attributes':['id',_0x79e6('0x3a')],'where':{'id':_0x20069f[_0x79e6('0xa5')][_0x79e6('0xac')]}})['then'](function(_0x1ed7f7){if(_0x1ed7f7){_0x20069f[_0x79e6('0x76')][_0x79e6('0xae')]({'id':0x0,'priority':0x0,'app':_0x79e6('0xaf'),'appdata':_0x1ed7f7[_0x79e6('0x3a')]+','+(_0x20069f[_0x79e6('0x75')][_0x79e6('0xb0')]||0xa),'interval':_0x79e6('0xb1')});}return respondWithRpcPromise(_0x79e6('0xb2'),_0x79e6('0xb3'),_0x20069f);});}return respondWithRpcPromise('Start',_0x79e6('0xb3'),_0x20069f);})[_0x79e6('0x1f')](function(_0x57babf){if(_0x57babf){var _0x422bf9=0xc8;var _0x3a4a31=_0x79e6('0xb4');logger[_0x79e6('0x20')](_0x79e6('0x23'),_0x3a4a31,_0x422bf9,_0x79e6('0xb5'));logger['debug'](_0x79e6('0xb6'),_0x3a4a31,_0x422bf9,'entity\x20found',JSON['stringify'](_0x57babf));if(_0x20069f['account'][_0x79e6('0x52')]===_0x79e6('0xb7')){return _0x5501a8[_0x79e6('0x2b')](_0x422bf9)['set'](_0x79e6('0xb8'),_0x79e6('0xb9'))[_0x79e6('0x3b')]('\x0a');}else{return _0x5501a8[_0x79e6('0x2b')](_0x422bf9)[_0x79e6('0x2d')](_0x57babf);}}})['catch'](handleError(_0x5501a8,null));};exports['addApplications']=function(_0xa6031,_0x54f6a4){var _0x304465=_0xa6031['params']['id'];var _0x565461=_0xa6031[_0x79e6('0x64')];var _0x3f0cba=0xc8;var _0x110695=null;return db[_0x79e6('0xba')][_0x79e6('0xbb')]({'isolationLevel':db[_0x79e6('0xba')][_0x79e6('0xbc')][_0x79e6('0xbd')]['READ_COMMITTED']},function(_0x5c727b){return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x304465},'transaction':_0x5c727b})[_0x79e6('0x1f')](function(_0x1ad6eb){if(_0x1ad6eb){return db['SmsApplication'][_0x79e6('0x36')]({'where':{'SmsAccountId':_0x304465},'transaction':_0x5c727b})[_0x79e6('0x1f')](function(){var _0x4519d1=_['map'](_0x565461,function(_0x3b0d44){_0x3b0d44['SmsAccountId']=_0x304465;return _0x3b0d44;});return db[_0x79e6('0x73')]['bulkCreate'](_0x4519d1,{'transaction':_0x5c727b});});}else{_0x3f0cba=0x194;_0x110695=[];}});})[_0x79e6('0x1f')](function(){if(_0x3f0cba!==0x194){return db['SmsApplication'][_0x79e6('0xbe')]({'where':{'SmsAccountId':_0x304465},'order':'priority'})[_0x79e6('0x1f')](function(_0x2d8040){_0x110695=_0x2d8040;});}})[_0x79e6('0x29')](function(_0x4ae904){_0x3f0cba=0x1f4;logger['error'](_0x4ae904[_0x79e6('0x39')]);if(_0x4ae904[_0x79e6('0x3a')]){delete _0x4ae904[_0x79e6('0x3a')];}_0x110695=_0x4ae904;})[_0x79e6('0xbf')](function(){if(_0x110695===null){_0x54f6a4[_0x79e6('0x2a')](_0x3f0cba);}else{if(_0x3f0cba===0x1f4){_0x54f6a4['status'](_0x3f0cba)['send'](_0x110695);}else{_0x54f6a4[_0x79e6('0x2b')](_0x3f0cba)[_0x79e6('0x2d')](_0x110695);}}});};exports[_0x79e6('0xc0')]=function(_0x5a063c,_0x22d9dd,_0x1fdf13){var _0x25cb94={};var _0x59d4e7={};var _0x3f33ef;var _0x21766a;return db['SmsAccount'][_0x79e6('0x6a')]({'where':{'id':_0x5a063c[_0x79e6('0x65')]['id']}})['then'](handleEntityNotFound(_0x22d9dd,null))[_0x79e6('0x1f')](function(_0x599a9f){if(_0x599a9f){_0x3f33ef=_0x599a9f;_0x59d4e7['model']=_['keys'](db[_0x79e6('0x73')]['rawAttributes']);_0x59d4e7[_0x79e6('0x45')]=_[_0x79e6('0x44')](_0x5a063c[_0x79e6('0x45')]);_0x59d4e7['filters']=_['intersection'](_0x59d4e7[_0x79e6('0x43')],_0x59d4e7[_0x79e6('0x45')]);_0x25cb94[_0x79e6('0x48')]=_['intersection'](_0x59d4e7['model'],qs['fields'](_0x5a063c[_0x79e6('0x45')][_0x79e6('0x49')]));_0x25cb94['attributes']=_0x25cb94[_0x79e6('0x48')][_0x79e6('0x70')]?_0x25cb94[_0x79e6('0x48')]:_0x59d4e7[_0x79e6('0x43')];_0x25cb94[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x5a063c[_0x79e6('0x45')][_0x79e6('0x4d')]);_0x25cb94[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x5a063c[_0x79e6('0x45')],_0x59d4e7[_0x79e6('0x46')]));if(_0x5a063c[_0x79e6('0x45')][_0x79e6('0x50')]){_0x25cb94['where']=_[_0x79e6('0x51')](_0x25cb94[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x25cb94[_0x79e6('0x48')],function(_0x5e482d){var _0x3e2f15={};_0x3e2f15[_0x5e482d]={'$like':'%'+_0x5a063c[_0x79e6('0x45')]['filter']+'%'};return _0x3e2f15;})});}_0x25cb94=_[_0x79e6('0x51')]({},_0x25cb94,_0x5a063c[_0x79e6('0x54')]);return _0x3f33ef[_0x79e6('0xc0')](_0x25cb94);}})[_0x79e6('0x1f')](function(_0x18a248){if(_0x18a248){_0x21766a=_0x18a248['length'];if(!_0x5a063c[_0x79e6('0x45')][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0x25cb94[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x5a063c['query']['limit']);_0x25cb94[_0x79e6('0x31')]=qs['offset'](_0x5a063c['query'][_0x79e6('0x31')]);}return _0x3f33ef['getApplications'](_0x25cb94);}})[_0x79e6('0x1f')](function(_0x5b7bfb){if(_0x5b7bfb){return _0x5b7bfb?{'count':_0x21766a,'rows':_0x5b7bfb}:null;}})[_0x79e6('0x1f')](respondWithResult(_0x22d9dd,null))[_0x79e6('0x29')](handleError(_0x22d9dd,null));};exports[_0x79e6('0xc1')]=function(_0x3d8cce,_0x19de46,_0xe096b2){var _0x4e82bd={'raw':![],'where':{}};var _0x207cba={};var _0x31f1e5={'count':0x0,'rows':[]};return db['SmsAccount'][_0x79e6('0x6a')]({'where':{'id':_0x3d8cce[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x19de46,null))[_0x79e6('0x1f')](function(_0x19854e){if(_0x19854e){_0x207cba[_0x79e6('0x43')]=_[_0x79e6('0x44')](db[_0x79e6('0xa4')][_0x79e6('0x41')]);_0x207cba['query']=_[_0x79e6('0x44')](_0x3d8cce[_0x79e6('0x45')]);_0x207cba[_0x79e6('0x46')]=_['intersection'](_0x207cba[_0x79e6('0x43')],_0x207cba[_0x79e6('0x45')]);_0x4e82bd['attributes']=_['intersection'](_0x207cba[_0x79e6('0x43')],qs['fields'](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x49')]));_0x4e82bd[_0x79e6('0x48')]=_0x4e82bd[_0x79e6('0x48')][_0x79e6('0x70')]?_0x4e82bd[_0x79e6('0x48')]:_0x207cba['model'];if(!_0x3d8cce[_0x79e6('0x45')]['hasOwnProperty'](_0x79e6('0x4b'))){_0x4e82bd[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x2f')]);_0x4e82bd[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x31')]);}_0x4e82bd['order']=qs[_0x79e6('0x4d')](_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x4d')]);_0x4e82bd[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x3d8cce[_0x79e6('0x45')],_0x207cba['filters']));_0x4e82bd[_0x79e6('0x4e')][_0x79e6('0x67')]=_0x19854e['id'];if(_0x3d8cce['query'][_0x79e6('0x50')]){_0x4e82bd[_0x79e6('0x4e')]=_['merge'](_0x4e82bd[_0x79e6('0x4e')],{'$or':_[_0x79e6('0x3f')](_0x4e82bd['attributes'],function(_0x46baee){var _0x21deb0={};_0x21deb0[_0x46baee]={'$like':'%'+_0x3d8cce[_0x79e6('0x45')][_0x79e6('0x50')]+'%'};return _0x21deb0;})});}_0x4e82bd=_[_0x79e6('0x51')]({},_0x4e82bd,_0x3d8cce[_0x79e6('0x54')]);return db[_0x79e6('0xa4')][_0x79e6('0x30')]({'where':_0x4e82bd[_0x79e6('0x4e')]})[_0x79e6('0x1f')](function(_0x30ac27){_0x31f1e5[_0x79e6('0x30')]=_0x30ac27;if(_0x3d8cce['query']['includeAll']){_0x4e82bd[_0x79e6('0x59')]=[{'model':db[_0x79e6('0x7a')],'as':_0x79e6('0xc2'),'required':![]},{'model':db[_0x79e6('0xad')],'as':'Owner','attributes':[_0x79e6('0x3a'),_0x79e6('0xc3'),_0x79e6('0xc4')],'required':![]},{'model':db[_0x79e6('0xc5')],'as':_0x79e6('0xc6'),'attributes':['id',_0x79e6('0x3a'),'color'],'where':_0x3d8cce[_0x79e6('0x45')][_0x79e6('0xc7')]?{'id':_0x3d8cce['query'][_0x79e6('0xc7')]}:undefined,'required':_0x3d8cce['query'][_0x79e6('0xc7')]?!![]:![]}];}return db['SmsInteraction'][_0x79e6('0x56')](_0x4e82bd);})[_0x79e6('0x1f')](function(_0x5a6690){_0x31f1e5[_0x79e6('0x57')]=_0x5a6690;return _0x31f1e5;});}})[_0x79e6('0x1f')](respondWithFilteredResult(_0x19de46,_0x4e82bd))[_0x79e6('0x29')](handleError(_0x19de46,null));};exports[_0x79e6('0x3b')]=function(_0x169e8f,_0x3511ad,_0x1e82e6){var _0x1811cd,_0x593742,_0x43d696;if(_['isNil'](_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')])||_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')]===''){throw new db[(_0x79e6('0x96'))][(_0x79e6('0x99'))](_0x79e6('0x9a'));}if(_[_0x79e6('0x98')](_0x169e8f[_0x79e6('0x64')]['to'])){throw new db[(_0x79e6('0x96'))][(_0x79e6('0x99'))](_0x79e6('0xc8'));}_0x1811cd=_0x169e8f['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x169e8f[_0x79e6('0x65')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x79e6('0x7a')],'as':'Contacts','where':{'mobile':_0x1811cd},'limit':0x1,'order':[['updatedAt',_0x79e6('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x3511ad,null))['then'](function(_0x116acb){if(_0x116acb&&_0x116acb[_0x79e6('0xc9')]){_0x593742=_0x116acb[_0x79e6('0x37')]({'plain':!![]});if(_0x593742[_0x79e6('0xc9')]&&_0x593742[_0x79e6('0xc9')][_0x79e6('0xa2')][_0x79e6('0x70')]){return _0x593742[_0x79e6('0xc9')][_0x79e6('0xa2')][0x0];}return db[_0x79e6('0x7a')][_0x79e6('0x5b')](_['defaults'](_0x169e8f['body'],{'firstName':_0x1811cd,'mobile':_0x1811cd,'phone':_0x1811cd,'ListId':_0x593742['ListId']}));}})[_0x79e6('0x1f')](handleEntityNotFound(_0x3511ad,null))['then'](function(_0x5a1847){if(_0x5a1847){_0x43d696=_0x5a1847;return db[_0x79e6('0xa4')][_0x79e6('0x5a')]({'where':{'ContactId':_0x43d696['id'],'closed':![],'SmsAccountId':_0x593742['id']}})[_0x79e6('0x1f')](function(_0x2fb50f){if(_0x2fb50f){return[_0x2fb50f,![]];}return db[_0x79e6('0xa4')]['create']({'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id'],'SmsAccountId':_0x593742['id'],'phone':_0x1811cd,'firstMsgDirection':_0x79e6('0xca'),'Messages':[_['merge'](_0x169e8f[_0x79e6('0x64')],{'read':![],'body':_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')],'phone':_0x1811cd,'SmsAccountId':_0x593742['id'],'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id']})]},{'include':[{'model':db[_0x79e6('0xaa')],'as':_0x79e6('0xcb')}]})[_0x79e6('0x1f')](function(_0x2718fb){return[_0x2718fb,!![]];});});}})[_0x79e6('0xcc')](function(_0x2ace09,_0x57b553){if(_0x57b553){return _0x2ace09;}return db['SmsMessage'][_0x79e6('0x5b')](_['merge'](_0x169e8f[_0x79e6('0x64')],{'read':![],'body':_0x169e8f[_0x79e6('0x64')][_0x79e6('0x64')],'phone':_0x1811cd,'SmsAccountId':_0x593742['id'],'SmsInteractionId':_0x2ace09['id'],'UserId':_0x169e8f['user']['id'],'ContactId':_0x43d696['id']}))[_0x79e6('0x1f')](function(_0x18009f){_0x2ace09[_0x79e6('0xcd')]['Messages']=[];_0x2ace09[_0x79e6('0xcd')][_0x79e6('0xcb')][_0x79e6('0xce')](_0x18009f[_0x79e6('0xcd')]);return _0x2ace09;});})['then'](respondWithResult(_0x3511ad,null))[_0x79e6('0x29')](handleError(_0x3511ad,null));};exports['status']=function(_0x34844a,_0x390031,_0x4c3509){if(_0x34844a['body']['id']){delete _0x34844a['body']['id'];}var _0x43a61e,_0x55bef1,_0x246ff4;return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x34844a['params']['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x390031,null))[_0x79e6('0x1f')](function(_0xe9a75){if(_0xe9a75){_0x246ff4=_0xe9a75;logger['debug'](_0x79e6('0x23'),'status',_0x79e6('0xcf'),_0xe9a75[_0x79e6('0x52')],util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));switch(_0xe9a75['type']){case'skebby':if(_0x34844a[_0x79e6('0x64')][_0x79e6('0xd1')]&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')]['skebby_dispatch_id']}});}break;case _0x79e6('0x88'):if(_0x34844a[_0x79e6('0x64')][_0x79e6('0xd2')]&&_0x34844a[_0x79e6('0x64')]['statusInt']){_0x55bef1=_0x34844a[_0x79e6('0x64')]['statusInt'];return db['SmsMessage'][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a['body'][_0x79e6('0xd2')]}});}break;case _0x79e6('0x89'):if(_0x34844a['body']['message_id']&&_0x34844a[_0x79e6('0x64')][_0x79e6('0xd3')]){_0x55bef1=_0x34844a['body']['status_code'];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')][_0x79e6('0xd4')]}});}break;case _0x79e6('0x8c'):var _0x5835e9=_0x34844a[_0x79e6('0x64')][_0x79e6('0x8d')][0x0];if(_0x5835e9[_0x79e6('0x84')]&&_0x5835e9[_0x79e6('0x2b')][_0x79e6('0xd5')]==='DELIVERED'){_0x55bef1=_0x5835e9[_0x79e6('0x2b')][_0x79e6('0xd5')];return db[_0x79e6('0xaa')]['find']({'where':{'messageId':_0x5835e9['messageId']}});}break;case _0x79e6('0xd6'):if(_0x34844a['body'][_0x79e6('0x84')]&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')]['messageId']}});}break;case _0x79e6('0x93'):if(_0x34844a['body'][0x0]['message']['id']){_0x55bef1=_0x34844a[_0x79e6('0x64')][0x0][_0x79e6('0x52')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a[_0x79e6('0x64')][0x0][_0x79e6('0x27')]['id']}});}break;case'intelepeer':if(_0x34844a[_0x79e6('0x64')]['redif']&&_0x34844a[_0x79e6('0x64')][_0x79e6('0x2b')]){_0x55bef1=_0x34844a['body'][_0x79e6('0x2b')];return db[_0x79e6('0xaa')][_0x79e6('0x5a')]({'where':{'messageId':_0x34844a['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x390031,null))[_0x79e6('0x1f')](function(_0x565c4d){if(_0x565c4d){_0x43a61e=_0x565c4d;switch(_0x246ff4[_0x79e6('0x52')]){case _0x79e6('0x86'):if(_0x55bef1==='DELIVERED'){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79e6('0x2b'),_0x79e6('0x86'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x88'):if(_0x55bef1==='1'){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0x86'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x34844a[_0x79e6('0x64')][_0x79e6('0xd7')]&&_0x55bef1>=0xc8&&_0x55bef1<=0xce){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),_0x79e6('0x2b'),'clicksend',util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2db146=_0x34844a[_0x79e6('0x64')][_0x79e6('0x8d')][0x0];if(_0x2db146['status'][_0x79e6('0xd5')]===_0x79e6('0xd8')){return _0x43a61e['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x79e6('0x8c'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x55bef1==_0x79e6('0xd9')||_0x55bef1==_0x79e6('0xda')){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79e6('0x2b'),_0x79e6('0xd6'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x93'):if(_0x55bef1=='message-delivered'){return _0x43a61e['update']({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),'status',_0x79e6('0x93'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;case _0x79e6('0x94'):if(_0x55bef1===_0x79e6('0xdb')||_0x55bef1==='ACCEPTD'){return _0x43a61e[_0x79e6('0x63')]({'read':!![]});}else{logger[_0x79e6('0x25')](_0x79e6('0x23'),'status',_0x79e6('0x94'),util[_0x79e6('0xd0')](_0x34844a[_0x79e6('0x64')],{'showHidden':![],'depth':null}));}break;}return _0x43a61e;}})[_0x79e6('0x1f')](respondWithResult(_0x390031,null))[_0x79e6('0x29')](handleError(_0x390031,null));};exports[_0x79e6('0xdc')]=function(_0x5ecd74,_0x2cbf4c,_0x441a01){var _0x1847c3,_0x45288d,_0x957c2e;return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x5ecd74[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x2cbf4c,null))['then'](function(_0x597e31){if(_0x597e31){_0x957c2e=_0x597e31;logger['debug'](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0xcf'),_0x597e31[_0x79e6('0x52')],util[_0x79e6('0xd0')](_0x5ecd74[_0x79e6('0x45')],{'showHidden':![],'depth':null}));switch(_0x597e31['type']){case _0x79e6('0x8e'):if(_0x5ecd74[_0x79e6('0x45')][_0x79e6('0xdd')]&&_0x5ecd74[_0x79e6('0x45')]['state']){_0x45288d=_0x5ecd74['query'][_0x79e6('0xde')];return db['SmsMessage']['find']({'where':{'messageId':_0x5ecd74[_0x79e6('0x45')][_0x79e6('0xdd')]}});}break;}}})[_0x79e6('0x1f')](handleEntityNotFound(_0x2cbf4c,null))['then'](function(_0x24aa4d){if(_0x24aa4d){_0x1847c3=_0x24aa4d;switch(_0x957c2e['type']){case _0x79e6('0x8e'):if(_0x45288d==='2'||_0x45288d==='6'){return _0x1847c3[_0x79e6('0x63')]({'read':!![]});}else{logger['error'](_0x79e6('0x23'),_0x79e6('0x2b'),_0x79e6('0x8e'),util[_0x79e6('0xd0')](_0x5ecd74[_0x79e6('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x1847c3;}})[_0x79e6('0x1f')](respondWithResult(_0x2cbf4c,null))[_0x79e6('0x29')](handleError(_0x2cbf4c,null));};exports['addAgents']=function(_0x4d138f,_0xf3b5df,_0x2231d8){return db[_0x79e6('0x40')][_0x79e6('0x5a')]({'where':{'id':_0x4d138f[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0xf3b5df,null))[_0x79e6('0x1f')](function(_0x215e5c){if(_0x215e5c){return _0x215e5c[_0x79e6('0xdf')](_0x4d138f[_0x79e6('0x64')][_0x79e6('0x6c')],_['omit'](_0x4d138f['body'],[_0x79e6('0x6c'),'id'])||{})['spread'](function(_0x2b6ae4){for(var _0x59cd34=0x0;_0x59cd34<_0x4d138f['body'][_0x79e6('0x6c')]['length'];_0x59cd34+=0x1){socket[_0x79e6('0xe0')](_0x79e6('0xe1'),{'UserId':Number(_0x4d138f[_0x79e6('0x64')][_0x79e6('0x6c')][_0x59cd34]),'SmsAccountId':Number(_0x4d138f['params']['id'])});}return _0x2b6ae4;});}})[_0x79e6('0x1f')](respondWithResult(_0xf3b5df,null))['catch'](handleError(_0xf3b5df,null));};exports[_0x79e6('0xe2')]=function(_0x46a5b6,_0x3b250a,_0x1ff661){return db[_0x79e6('0x40')]['find']({'where':{'id':_0x46a5b6[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0x3b250a,null))[_0x79e6('0x1f')](function(_0x1b0752){if(_0x1b0752){return _0x1b0752[_0x79e6('0xe2')](_0x46a5b6[_0x79e6('0x45')]['ids'])['then'](function(){if(_[_0x79e6('0xe3')](_0x46a5b6[_0x79e6('0x45')][_0x79e6('0x6c')])){for(var _0x5646b0=0x0;_0x5646b0<_0x46a5b6['query'][_0x79e6('0x6c')]['length'];_0x5646b0+=0x1){socket[_0x79e6('0xe0')](_0x79e6('0xe4'),{'UserId':Number(_0x46a5b6[_0x79e6('0x45')][_0x79e6('0x6c')][_0x5646b0]),'SmsAccountId':Number(_0x46a5b6[_0x79e6('0x65')]['id'])});}}else{socket[_0x79e6('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x46a5b6[_0x79e6('0x45')]['ids']),'SmsAccountId':Number(_0x46a5b6[_0x79e6('0x65')]['id'])});}});}})[_0x79e6('0x1f')](respondWithStatusCode(_0x3b250a,null))[_0x79e6('0x29')](handleError(_0x3b250a,null));};exports[_0x79e6('0xe5')]=function(_0x4e65af,_0xf015b7,_0x39d431){var _0xa0052e={};var _0x1b8db1={};var _0x2360b9;var _0x52ee17;return db[_0x79e6('0x40')][_0x79e6('0x6a')]({'where':{'id':_0x4e65af[_0x79e6('0x65')]['id']}})[_0x79e6('0x1f')](handleEntityNotFound(_0xf015b7,null))[_0x79e6('0x1f')](function(_0x1f0fa1){if(_0x1f0fa1){_0x2360b9=_0x1f0fa1;_0x1b8db1[_0x79e6('0x43')]=_[_0x79e6('0x44')](db['User'][_0x79e6('0x41')]);_0x1b8db1['query']=_['keys'](_0x4e65af['query']);_0x1b8db1[_0x79e6('0x46')]=_[_0x79e6('0x47')](_0x1b8db1[_0x79e6('0x43')],_0x1b8db1[_0x79e6('0x45')]);_0xa0052e['attributes']=_['intersection'](_0x1b8db1[_0x79e6('0x43')],qs['fields'](_0x4e65af['query'][_0x79e6('0x49')]));_0xa0052e['attributes']=_0xa0052e[_0x79e6('0x48')][_0x79e6('0x70')]?_0xa0052e[_0x79e6('0x48')]:_0x1b8db1['model'];_0xa0052e[_0x79e6('0x4c')]=qs[_0x79e6('0x4d')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x4d')]);_0xa0052e[_0x79e6('0x4e')]=qs[_0x79e6('0x46')](_[_0x79e6('0x4f')](_0x4e65af[_0x79e6('0x45')],_0x1b8db1[_0x79e6('0x46')]));if(_0x4e65af[_0x79e6('0x45')][_0x79e6('0x50')]){_0xa0052e['where']=_[_0x79e6('0x51')](_0xa0052e['where'],{'$or':_[_0x79e6('0x3f')](_0xa0052e['attributes'],function(_0x396672){var _0xf2bf19={};_0xf2bf19[_0x396672]={'$like':'%'+_0x4e65af[_0x79e6('0x45')]['filter']+'%'};return _0xf2bf19;})});}_0xa0052e=_[_0x79e6('0x51')]({},_0xa0052e,_0x4e65af[_0x79e6('0x54')]);return _0x2360b9['getAgents'](_0xa0052e);}})['then'](function(_0x18e38d){if(_0x18e38d){_0x52ee17=_0x18e38d['length'];if(!_0x4e65af['query'][_0x79e6('0x4a')](_0x79e6('0x4b'))){_0xa0052e[_0x79e6('0x2f')]=qs[_0x79e6('0x2f')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x2f')]);_0xa0052e[_0x79e6('0x31')]=qs[_0x79e6('0x31')](_0x4e65af[_0x79e6('0x45')][_0x79e6('0x31')]);}return _0x2360b9[_0x79e6('0xe5')](_0xa0052e);}})['then'](function(_0x5d1980){if(_0x5d1980){return _0x5d1980?{'count':_0x52ee17,'rows':_0x5d1980}:null;}})[_0x79e6('0x1f')](respondWithResult(_0xf015b7,null))[_0x79e6('0x29')](handleError(_0xf015b7,null));}; \ No newline at end of file +var _0x201d=['skebby','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','Contact','Owner','Tag','Tags','tag','to\x20is\x20mandatory','CmList','List','DESC','user','out','Messages','spread','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','jayson/promise','client','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','applications','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','type','twilio','from','From','Body','MessageSid'];(function(_0x533152,_0x255e9c){var _0x297bb8=function(_0x5734cb){while(--_0x5734cb){_0x533152['push'](_0x533152['shift']());}};_0x297bb8(++_0x255e9c);}(_0x201d,0x142));var _0xd201=function(_0x422c43,_0x376fbc){_0x422c43=_0x422c43-0x0;var _0x26322c=_0x201d[_0x422c43];return _0x26322c;};'use strict';var emlformat=require(_0xd201('0x0'));var rimraf=require(_0xd201('0x1'));var zipdir=require(_0xd201('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd201('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd201('0x4'));var util=require(_0xd201('0x5'));var path=require(_0xd201('0x6'));var sox=require('sox');var csv=require(_0xd201('0x7'));var ejs=require(_0xd201('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd201('0x9'));var squel=require('squel');var crypto=require(_0xd201('0xa'));var jsforce=require(_0xd201('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd201('0x7'));var querystring=require(_0xd201('0xc'));var Papa=require(_0xd201('0xd'));var Redis=require(_0xd201('0xe'));var authService=require(_0xd201('0xf'));var qs=require(_0xd201('0x10'));var as=require(_0xd201('0x11'));var hardwareService=require(_0xd201('0x12'));var logger=require(_0xd201('0x13'))(_0xd201('0x14'));var utils=require(_0xd201('0x15'));var config=require(_0xd201('0x16'));var licenseUtil=require(_0xd201('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd201('0x18')](config[_0xd201('0x19')],{'host':_0xd201('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd201('0x19')]));require('./smsAccount.socket')[_0xd201('0x1b')](socket);var jayson=require(_0xd201('0x1c'));var client=jayson[_0xd201('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5efdf9,_0x3640be,_0xc6e3b6,_0x3a2699){return new BPromise(function(_0x156993,_0xf170d3){var _0x3db82e=_0x3a2699||client;return _0x3db82e[_0xd201('0x1e')](_0x5efdf9,_0xc6e3b6)[_0xd201('0x1f')](function(_0x3412fd){logger['info'](_0xd201('0x20'),_0x3640be,_0xd201('0x21'));logger['debug'](_0xd201('0x22'),_0x3640be,_0xd201('0x21'),JSON[_0xd201('0x23')](_0x3412fd));if(_0x3412fd[_0xd201('0x24')]){if(_0x3412fd[_0xd201('0x24')][_0xd201('0x25')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3640be,_0x3412fd[_0xd201('0x24')][_0xd201('0x26')]);return _0xf170d3(_0x3412fd[_0xd201('0x24')]['message']);}logger[_0xd201('0x24')]('SmsAccount,\x20%s,\x20%s',_0x3640be,_0x3412fd[_0xd201('0x24')][_0xd201('0x26')]);return _0x156993(_0x3412fd['error'][_0xd201('0x26')]);}else{logger[_0xd201('0x27')](_0xd201('0x20'),_0x3640be,'request\x20sent');_0x156993(_0x3412fd[_0xd201('0x28')][_0xd201('0x26')]);}})[_0xd201('0x29')](function(_0x20c431){logger[_0xd201('0x24')](_0xd201('0x20'),_0x3640be,_0x20c431);_0xf170d3(_0x20c431);});});}function respondWithStatusCode(_0x41b225,_0x4f4d3f){_0x4f4d3f=_0x4f4d3f||0xcc;return function(_0x4372cf){if(_0x4372cf){return _0x41b225[_0xd201('0x2a')](_0x4f4d3f);}return _0x41b225[_0xd201('0x2b')](_0x4f4d3f)[_0xd201('0x2c')]();};}function respondWithResult(_0x213747,_0x48f46c){_0x48f46c=_0x48f46c||0xc8;return function(_0x3cadb9){if(_0x3cadb9){return _0x213747['status'](_0x48f46c)[_0xd201('0x2d')](_0x3cadb9);}};}function respondWithFilteredResult(_0x26ffff,_0x7cadf9){return function(_0x48bc07){if(_0x48bc07){var _0x3669b4=typeof _0x7cadf9['offset']===_0xd201('0x2e')&&typeof _0x7cadf9[_0xd201('0x2f')]===_0xd201('0x2e');var _0xa4372e=_0x48bc07['count'];var _0x3ccec6=_0x3669b4?0x0:_0x7cadf9['offset'];var _0xb672e3=_0x3669b4?_0x48bc07[_0xd201('0x30')]:_0x7cadf9[_0xd201('0x31')]+_0x7cadf9[_0xd201('0x2f')];var _0x2e4ea9;if(_0xb672e3>=_0xa4372e){_0xb672e3=_0xa4372e;_0x2e4ea9=0xc8;}else{_0x2e4ea9=0xce;}_0x26ffff[_0xd201('0x2b')](_0x2e4ea9);return _0x26ffff[_0xd201('0x32')]('Content-Range',_0x3ccec6+'-'+_0xb672e3+'/'+_0xa4372e)[_0xd201('0x2d')](_0x48bc07);}return null;};}function patchUpdates(_0x2b1238){return function(_0x4a22dd){try{jsonpatch['apply'](_0x4a22dd,_0x2b1238,!![]);}catch(_0x53ad7c){return BPromise[_0xd201('0x33')](_0x53ad7c);}return _0x4a22dd[_0xd201('0x34')]();};}function saveUpdates(_0x175604,_0x1d38df){return function(_0x2dee25){if(_0x2dee25){return _0x2dee25[_0xd201('0x35')](_0x175604)['then'](function(_0x54a9da){return _0x54a9da;});}return null;};}function removeEntity(_0x381bdf,_0x3f38d9){return function(_0x485bdc){if(_0x485bdc){return _0x485bdc[_0xd201('0x36')]()['then'](function(){var _0x36d26d=_0x485bdc[_0xd201('0x37')]({'plain':!![]});var _0x5c13a4=_0xd201('0x38');return db[_0xd201('0x39')][_0xd201('0x36')]({'where':{'type':_0x5c13a4,'resourceId':_0x36d26d['id']}})[_0xd201('0x1f')](function(){return _0x485bdc;});})[_0xd201('0x1f')](function(){_0x381bdf[_0xd201('0x2b')](0xcc)[_0xd201('0x2c')]();});}};}function handleEntityNotFound(_0x5580b5,_0x25e1ff){return function(_0xb839b3){if(!_0xb839b3){_0x5580b5[_0xd201('0x2a')](0x194);}return _0xb839b3;};}function handleError(_0x57d5cb,_0x1c073c){_0x1c073c=_0x1c073c||0x1f4;return function(_0x80e58d){logger['error'](_0x80e58d[_0xd201('0x3a')]);if(_0x80e58d[_0xd201('0x3b')]){delete _0x80e58d[_0xd201('0x3b')];}_0x57d5cb[_0xd201('0x2b')](_0x1c073c)[_0xd201('0x3c')](_0x80e58d);};}exports[_0xd201('0x3d')]=function(_0x4b71e4,_0x2732f9){var _0x5edbd2={'include':[{'model':db[_0xd201('0x3e')],'as':_0xd201('0x3f')}]},_0x429a07={},_0xacaca7={'count':0x0,'rows':[]};var _0x3f256f=_[_0xd201('0x40')](db[_0xd201('0x41')]['rawAttributes'],function(_0x84bc3e){return{'name':_0x84bc3e['fieldName'],'type':_0x84bc3e['type'][_0xd201('0x42')]};});_0x429a07[_0xd201('0x43')]=_[_0xd201('0x40')](_0x3f256f,_0xd201('0x3b'));_0x429a07[_0xd201('0x44')]=_[_0xd201('0x45')](_0x4b71e4[_0xd201('0x44')]);_0x429a07[_0xd201('0x46')]=_['intersection'](_0x429a07[_0xd201('0x43')],_0x429a07[_0xd201('0x44')]);_0x5edbd2[_0xd201('0x47')]=_[_0xd201('0x48')](_0x429a07[_0xd201('0x43')],qs[_0xd201('0x49')](_0x4b71e4[_0xd201('0x44')]['fields']));_0x5edbd2[_0xd201('0x47')]=_0x5edbd2[_0xd201('0x47')][_0xd201('0x4a')]?_0x5edbd2['attributes']:_0x429a07[_0xd201('0x43')];if(!_0x4b71e4['query'][_0xd201('0x4b')](_0xd201('0x4c'))){_0x5edbd2[_0xd201('0x2f')]=qs[_0xd201('0x2f')](_0x4b71e4[_0xd201('0x44')]['limit']);_0x5edbd2[_0xd201('0x31')]=qs[_0xd201('0x31')](_0x4b71e4[_0xd201('0x44')][_0xd201('0x31')]);}_0x5edbd2[_0xd201('0x4d')]=qs[_0xd201('0x4e')](_0x4b71e4[_0xd201('0x44')][_0xd201('0x4e')]);_0x5edbd2['where']=qs[_0xd201('0x46')](_[_0xd201('0x4f')](_0x4b71e4[_0xd201('0x44')],_0x429a07[_0xd201('0x46')]),_0x3f256f);if(_0x4b71e4[_0xd201('0x44')]['filter']){_0x5edbd2[_0xd201('0x50')]=_['merge'](_0x5edbd2[_0xd201('0x50')],{'$or':_['map'](_0x3f256f,function(_0x41837c){if(_0x41837c['type']!==_0xd201('0x51')){var _0x207f1e={};_0x207f1e[_0x41837c[_0xd201('0x3b')]]={'$like':'%'+_0x4b71e4[_0xd201('0x44')][_0xd201('0x52')]+'%'};return _0x207f1e;}})});}_0x5edbd2=_[_0xd201('0x53')]({},_0x5edbd2,_0x4b71e4[_0xd201('0x54')]);var _0xe28aa0={'where':_0x5edbd2[_0xd201('0x50')]};return db[_0xd201('0x41')][_0xd201('0x30')](_0xe28aa0)['then'](function(_0x265a8a){_0xacaca7['count']=_0x265a8a;if(_0x4b71e4['query'][_0xd201('0x55')]){_0x5edbd2['include']=[{'all':!![]}];}return db[_0xd201('0x41')][_0xd201('0x56')](_0x5edbd2);})[_0xd201('0x1f')](function(_0xfa7164){_0xacaca7[_0xd201('0x57')]=_0xfa7164;return _0xacaca7;})[_0xd201('0x1f')](respondWithFilteredResult(_0x2732f9,_0x5edbd2))['catch'](handleError(_0x2732f9,null));};exports[_0xd201('0x58')]=function(_0x85a40e,_0x5d27e2){var _0x440477={'raw':![],'where':{'id':_0x85a40e[_0xd201('0x59')]['id']},'include':[{'model':db[_0xd201('0x3e')],'as':'mandatoryDispositionPause'}]},_0x5f37c6={};_0x5f37c6['model']=_['keys'](db['SmsAccount'][_0xd201('0x5a')]);_0x5f37c6[_0xd201('0x44')]=_[_0xd201('0x45')](_0x85a40e[_0xd201('0x44')]);_0x5f37c6[_0xd201('0x46')]=_[_0xd201('0x48')](_0x5f37c6[_0xd201('0x43')],_0x5f37c6['query']);_0x440477[_0xd201('0x47')]=_[_0xd201('0x48')](_0x5f37c6['model'],qs[_0xd201('0x49')](_0x85a40e[_0xd201('0x44')][_0xd201('0x49')]));_0x440477['attributes']=_0x440477[_0xd201('0x47')][_0xd201('0x4a')]?_0x440477['attributes']:_0x5f37c6[_0xd201('0x43')];if(_0x85a40e[_0xd201('0x44')][_0xd201('0x55')]){_0x440477[_0xd201('0x5b')]=[{'all':!![]}];}_0x440477=_[_0xd201('0x53')]({},_0x440477,_0x85a40e[_0xd201('0x54')]);return db['SmsAccount'][_0xd201('0x5c')](_0x440477)['then'](handleEntityNotFound(_0x5d27e2,null))[_0xd201('0x1f')](respondWithResult(_0x5d27e2,null))[_0xd201('0x29')](handleError(_0x5d27e2,null));};exports[_0xd201('0x5d')]=function(_0x42f402,_0x124e8b){return db[_0xd201('0x41')][_0xd201('0x5d')](_0x42f402[_0xd201('0x5e')],{})[_0xd201('0x1f')](function(_0x21dba9){var _0x59354d=_0x42f402['user'][_0xd201('0x37')]({'plain':!![]});if(!_0x59354d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59354d[_0xd201('0x5f')]==='user'){var _0x3eaf25=_0x21dba9[_0xd201('0x37')]({'plain':!![]});var _0xc86f88='SmsAccounts';return db[_0xd201('0x60')][_0xd201('0x5c')]({'where':{'name':_0xc86f88,'userProfileId':_0x59354d[_0xd201('0x61')]},'raw':!![]})[_0xd201('0x1f')](function(_0x5c4324){if(_0x5c4324&&_0x5c4324[_0xd201('0x62')]===0x0){return db[_0xd201('0x39')][_0xd201('0x5d')]({'name':_0x3eaf25[_0xd201('0x3b')],'resourceId':_0x3eaf25['id'],'type':_0x5c4324[_0xd201('0x3b')],'sectionId':_0x5c4324['id']},{})[_0xd201('0x1f')](function(){return _0x21dba9;});}else{return _0x21dba9;}})['catch'](function(_0x7febbe){logger[_0xd201('0x24')](_0xd201('0x63'),_0x7febbe);throw _0x7febbe;});}return _0x21dba9;})['then'](respondWithResult(_0x124e8b,0xc9))[_0xd201('0x29')](handleError(_0x124e8b,null));};exports[_0xd201('0x35')]=function(_0x1ffd3f,_0x52fc32){if(_0x1ffd3f[_0xd201('0x5e')]['id']){delete _0x1ffd3f[_0xd201('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x1ffd3f['params']['id']},'include':[{'model':db[_0xd201('0x3e')],'as':_0xd201('0x3f')}]})[_0xd201('0x1f')](handleEntityNotFound(_0x52fc32,null))[_0xd201('0x1f')](saveUpdates(_0x1ffd3f[_0xd201('0x5e')],null))[_0xd201('0x1f')](respondWithResult(_0x52fc32,null))[_0xd201('0x29')](handleError(_0x52fc32,null));};exports[_0xd201('0x36')]=function(_0x44d984,_0x4952c1){return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x44d984[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x4952c1,null))['then'](removeEntity(_0x4952c1,null))[_0xd201('0x29')](handleError(_0x4952c1,null));};exports[_0xd201('0x64')]=function(_0x4d1e27,_0x53b22d){return db[_0xd201('0x41')][_0xd201('0x64')]()[_0xd201('0x1f')](respondWithResult(_0x53b22d,null))[_0xd201('0x29')](handleError(_0x53b22d,null));};exports['addDisposition']=function(_0x35c298,_0x93e28c,_0x27203f){if(_0x35c298[_0xd201('0x5e')]['id']){delete _0x35c298[_0xd201('0x5e')]['id'];}return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x35c298[_0xd201('0x59')]['id']}})['then'](handleEntityNotFound(_0x93e28c,null))[_0xd201('0x1f')](function(_0x491686){if(_0x491686){_0x35c298[_0xd201('0x5e')][_0xd201('0x65')]=_0x491686['id'];return db[_0xd201('0x66')][_0xd201('0x5d')](_0x35c298['body']);}})[_0xd201('0x1f')](respondWithResult(_0x93e28c,null))['catch'](handleError(_0x93e28c,null));};exports[_0xd201('0x67')]=function(_0xa82768,_0x2a0aa0,_0x5f6cf){var _0x5efa44={'raw':![],'where':{}};var _0xb20a8c={};var _0x181d3c={'count':0x0,'rows':[]};return db[_0xd201('0x41')][_0xd201('0x68')]({'where':{'id':_0xa82768['params']['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x2a0aa0,null))[_0xd201('0x1f')](function(_0x2782e1){if(_0x2782e1){_0xb20a8c[_0xd201('0x43')]=_[_0xd201('0x45')](db['Disposition'][_0xd201('0x5a')]);_0xb20a8c['query']=_[_0xd201('0x45')](_0xa82768[_0xd201('0x44')]);_0xb20a8c[_0xd201('0x46')]=_[_0xd201('0x48')](_0xb20a8c[_0xd201('0x43')],_0xb20a8c[_0xd201('0x44')]);_0x5efa44['attributes']=_[_0xd201('0x48')](_0xb20a8c['model'],qs[_0xd201('0x49')](_0xa82768[_0xd201('0x44')]['fields']));_0x5efa44[_0xd201('0x47')]=_0x5efa44[_0xd201('0x47')][_0xd201('0x4a')]?_0x5efa44[_0xd201('0x47')]:_0xb20a8c[_0xd201('0x43')];if(!_0xa82768['query'][_0xd201('0x4b')](_0xd201('0x4c'))){_0x5efa44['limit']=qs[_0xd201('0x2f')](_0xa82768[_0xd201('0x44')][_0xd201('0x2f')]);_0x5efa44['offset']=qs[_0xd201('0x31')](_0xa82768[_0xd201('0x44')][_0xd201('0x31')]);}_0x5efa44[_0xd201('0x4d')]=qs['sort'](_0xa82768[_0xd201('0x44')][_0xd201('0x4e')]);_0x5efa44[_0xd201('0x50')]=qs['filters'](_[_0xd201('0x4f')](_0xa82768[_0xd201('0x44')],_0xb20a8c[_0xd201('0x46')]));_0x5efa44[_0xd201('0x50')][_0xd201('0x65')]=_0x2782e1['id'];if(_0xa82768[_0xd201('0x44')][_0xd201('0x52')]){_0x5efa44['where']=_[_0xd201('0x53')](_0x5efa44[_0xd201('0x50')],{'$or':_['map'](_0x5efa44[_0xd201('0x47')],function(_0x4962be){var _0x336ab9={};_0x336ab9[_0x4962be]={'$like':'%'+_0xa82768['query'][_0xd201('0x52')]+'%'};return _0x336ab9;})});}_0x5efa44=_[_0xd201('0x53')]({},_0x5efa44,_0xa82768[_0xd201('0x54')]);return db['Disposition'][_0xd201('0x30')]({'where':_0x5efa44[_0xd201('0x50')]})[_0xd201('0x1f')](function(_0x15dbc9){_0x181d3c[_0xd201('0x30')]=_0x15dbc9;if(_0xa82768[_0xd201('0x44')]['includeAll']){_0x5efa44['include']=[{'all':!![]}];}return db[_0xd201('0x66')]['findAll'](_0x5efa44);})['then'](function(_0x5f1087){_0x181d3c[_0xd201('0x57')]=_0x5f1087;return _0x181d3c;});}})[_0xd201('0x1f')](respondWithFilteredResult(_0x2a0aa0,_0x5efa44))[_0xd201('0x29')](handleError(_0x2a0aa0,null));};exports[_0xd201('0x69')]=function(_0x245067,_0x3552a8,_0x4fa0df){return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x245067[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x3552a8,null))[_0xd201('0x1f')](function(_0x181f07){if(_0x181f07){return _0x181f07[_0xd201('0x69')](_0x245067[_0xd201('0x44')][_0xd201('0x6a')]);}})[_0xd201('0x1f')](respondWithStatusCode(_0x3552a8,null))[_0xd201('0x29')](handleError(_0x3552a8,null));};exports[_0xd201('0x6b')]=function(_0x22962d,_0x5af643,_0x463a8c){if(_0x22962d[_0xd201('0x5e')]['id']){delete _0x22962d[_0xd201('0x5e')]['id'];}return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x22962d[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x5af643,null))[_0xd201('0x1f')](function(_0x429e8b){if(_0x429e8b){_0x22962d[_0xd201('0x5e')][_0xd201('0x65')]=_0x429e8b['id'];return db['CannedAnswer']['create'](_0x22962d[_0xd201('0x5e')]);}})[_0xd201('0x1f')](respondWithResult(_0x5af643,null))[_0xd201('0x29')](handleError(_0x5af643,null));};exports[_0xd201('0x6c')]=function(_0x5295d7,_0x5db00d,_0x1291ba){var _0x14fbce={'raw':![],'where':{}};var _0x24fe64={};var _0x40a6ca={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x5295d7[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x5db00d,null))['then'](function(_0x340c0c){if(_0x340c0c){_0x24fe64[_0xd201('0x43')]=_[_0xd201('0x45')](db[_0xd201('0x6d')][_0xd201('0x5a')]);_0x24fe64['query']=_[_0xd201('0x45')](_0x5295d7[_0xd201('0x44')]);_0x24fe64[_0xd201('0x46')]=_['intersection'](_0x24fe64['model'],_0x24fe64['query']);_0x14fbce[_0xd201('0x47')]=_[_0xd201('0x48')](_0x24fe64[_0xd201('0x43')],qs[_0xd201('0x49')](_0x5295d7[_0xd201('0x44')][_0xd201('0x49')]));_0x14fbce[_0xd201('0x47')]=_0x14fbce[_0xd201('0x47')][_0xd201('0x4a')]?_0x14fbce[_0xd201('0x47')]:_0x24fe64[_0xd201('0x43')];if(!_0x5295d7[_0xd201('0x44')][_0xd201('0x4b')](_0xd201('0x4c'))){_0x14fbce[_0xd201('0x2f')]=qs[_0xd201('0x2f')](_0x5295d7[_0xd201('0x44')][_0xd201('0x2f')]);_0x14fbce[_0xd201('0x31')]=qs[_0xd201('0x31')](_0x5295d7[_0xd201('0x44')]['offset']);}_0x14fbce[_0xd201('0x4d')]=qs[_0xd201('0x4e')](_0x5295d7[_0xd201('0x44')][_0xd201('0x4e')]);_0x14fbce[_0xd201('0x50')]=qs[_0xd201('0x46')](_['pick'](_0x5295d7[_0xd201('0x44')],_0x24fe64[_0xd201('0x46')]));_0x14fbce['where'][_0xd201('0x65')]=_0x340c0c['id'];if(_0x5295d7['query'][_0xd201('0x52')]){_0x14fbce['where']=_['merge'](_0x14fbce[_0xd201('0x50')],{'$or':_[_0xd201('0x40')](_0x14fbce[_0xd201('0x47')],function(_0x2e4842){var _0x400370={};_0x400370[_0x2e4842]={'$like':'%'+_0x5295d7['query'][_0xd201('0x52')]+'%'};return _0x400370;})});}_0x14fbce=_[_0xd201('0x53')]({},_0x14fbce,_0x5295d7[_0xd201('0x54')]);return db[_0xd201('0x6d')]['count']({'where':_0x14fbce[_0xd201('0x50')]})[_0xd201('0x1f')](function(_0x53c2f3){_0x40a6ca['count']=_0x53c2f3;if(_0x5295d7[_0xd201('0x44')][_0xd201('0x55')]){_0x14fbce[_0xd201('0x5b')]=[{'all':!![]}];}return db[_0xd201('0x6d')][_0xd201('0x56')](_0x14fbce);})[_0xd201('0x1f')](function(_0x43e189){_0x40a6ca[_0xd201('0x57')]=_0x43e189;return _0x40a6ca;});}})['then'](respondWithFilteredResult(_0x5db00d,_0x14fbce))[_0xd201('0x29')](handleError(_0x5db00d,null));};exports[_0xd201('0x6e')]=function(_0x4473ed,_0x3b96f0,_0x4ad7f6){return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x4473ed[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x3b96f0,null))[_0xd201('0x1f')](function(_0x5e06e5){if(_0x5e06e5){return _0x5e06e5[_0xd201('0x6e')](_0x4473ed[_0xd201('0x44')][_0xd201('0x6a')]);}})['then'](respondWithStatusCode(_0x3b96f0,null))[_0xd201('0x29')](handleError(_0x3b96f0,null));};exports[_0xd201('0x6f')]=function(_0x4d6130,_0x40bf07,_0x327cd5){var _0x45125a={'channel':_0xd201('0x70')};var _0x6de676=[];var _0x579227=[];var _0x225ffd={};return db[_0xd201('0x41')]['find']({'where':{'id':_0x4d6130[_0xd201('0x59')]['id']},'include':[{'model':db[_0xd201('0x71')],'as':'Applications'}]})[_0xd201('0x1f')](handleEntityNotFound(_0x40bf07,null))[_0xd201('0x1f')](function(_0x1c9e95){_0x45125a['account']=_0x1c9e95;_0x45125a[_0xd201('0x72')]=_['orderBy'](_0x1c9e95[_0xd201('0x73')],[_0xd201('0x74')],[_0xd201('0x75')]);if(_0x45125a[_0xd201('0x76')][_0xd201('0x73')]){delete _0x45125a[_0xd201('0x76')][_0xd201('0x73')];}return db[_0xd201('0x77')][_0xd201('0x64')]();})[_0xd201('0x1f')](function(_0x453eaa){if(!_0x453eaa){throw new db[(_0xd201('0x78'))][(_0xd201('0x79'))](_0xd201('0x7a'));}_0x6de676=_[_0xd201('0x7b')](_[_0xd201('0x45')](_0x453eaa),['createdAt','updatedAt']);_0x579227=_[_0xd201('0x7b')](_[_0xd201('0x45')](_0x453eaa),['createdAt',_0xd201('0x7c'),_0xd201('0x7d'),'ListId']);_0x45125a[_0xd201('0x5e')]={'mapKey':'mobile'};if(_0x45125a[_0xd201('0x76')][_0xd201('0x7e')]){switch(_0x45125a[_0xd201('0x76')][_0xd201('0x7e')]){case _0xd201('0x7f'):_0x45125a[_0xd201('0x5e')][_0xd201('0x80')]=_0x4d6130['body'][_0xd201('0x81')];_0x45125a['body'][_0xd201('0x5e')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x82')];_0x45125a[_0xd201('0x5e')]['messageId']=_0x4d6130['body'][_0xd201('0x83')];break;case _0xd201('0x84'):_0x45125a[_0xd201('0x5e')][_0xd201('0x80')]='+'+_0x4d6130['body']['sender'];_0x45125a[_0xd201('0x5e')][_0xd201('0x5e')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x85')];break;case _0xd201('0x86'):_0x45125a['body']['from']=_0x4d6130[_0xd201('0x5e')][_0xd201('0x80')];_0x45125a['body'][_0xd201('0x5e')]=_0x4d6130['body'][_0xd201('0x26')];break;case _0xd201('0x87'):_0x45125a[_0xd201('0x5e')][_0xd201('0x80')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x80')];_0x45125a['body'][_0xd201('0x5e')]=_0x4d6130['body'][_0xd201('0x5e')];_0x45125a[_0xd201('0x5e')][_0xd201('0x88')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x89')];break;case _0xd201('0x8a'):_0x45125a[_0xd201('0x5e')][_0xd201('0x80')]=_0x4d6130['body'][_0xd201('0x81')];_0x45125a[_0xd201('0x5e')]['body']=_0x4d6130[_0xd201('0x5e')][_0xd201('0x8b')];_0x45125a[_0xd201('0x5e')][_0xd201('0x88')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x8c')];break;case _0xd201('0x8d'):_0x45125a['body'][_0xd201('0x80')]='+'+_0x4d6130[_0xd201('0x5e')][_0xd201('0x8e')][0x0][_0xd201('0x80')];_0x45125a[_0xd201('0x5e')][_0xd201('0x5e')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x8e')][0x0]['text'];_0x45125a[_0xd201('0x5e')][_0xd201('0x88')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x8e')][0x0][_0xd201('0x88')];break;case _0xd201('0x8f'):_0x45125a[_0xd201('0x5e')][_0xd201('0x80')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x90')];_0x45125a[_0xd201('0x5e')]['body']=_0x4d6130[_0xd201('0x5e')][_0xd201('0x91')][_0xd201('0x26')];break;case'clickatell':_0x45125a['body'][_0xd201('0x80')]=_0x4d6130[_0xd201('0x5e')][_0xd201('0x92')];_0x45125a[_0xd201('0x5e')]['body']=_0x4d6130['body']['text'];_0x45125a[_0xd201('0x5e')][_0xd201('0x88')]=_0x4d6130['body'][_0xd201('0x93')];break;case _0xd201('0x94'):_0x45125a[_0xd201('0x5e')][_0xd201('0x88')]=_0x4d6130['body'][0x0]['message']['id'];_0x45125a['body']['from']=_0x4d6130['body'][0x0][_0xd201('0x26')][_0xd201('0x80')];_0x45125a[_0xd201('0x5e')][_0xd201('0x5e')]=_0x4d6130['body'][0x0][_0xd201('0x26')][_0xd201('0x85')];break;case _0xd201('0x95'):_0x45125a[_0xd201('0x5e')]['from']=_0x4d6130['body'][_0xd201('0x80')];_0x45125a[_0xd201('0x5e')]['body']=_0x4d6130[_0xd201('0x5e')][_0xd201('0x26')];_0x45125a['body'][_0xd201('0x88')]=_0x4d6130['body'][_0xd201('0x96')];break;}}if(_0x45125a[_0xd201('0x5e')]['id']){delete _0x45125a[_0xd201('0x5e')]['id'];}if(_[_0xd201('0x97')](_0x45125a[_0xd201('0x5e')][_0xd201('0x80')])){throw new db['Sequelize'][(_0xd201('0x79'))]('from\x20is\x20mandatory');}if(_[_0xd201('0x97')](_0x45125a[_0xd201('0x5e')][_0xd201('0x5e')])||_0x45125a[_0xd201('0x5e')][_0xd201('0x5e')]===''){throw new db[(_0xd201('0x78'))][(_0xd201('0x79'))](_0xd201('0x98'));}if(_[_0xd201('0x97')](_0x45125a['body'][_0xd201('0x99')])){throw new db[(_0xd201('0x78'))][(_0xd201('0x79'))](_0xd201('0x9a')+_0x579227);}if(!_['includes'](_0x579227,_0x45125a[_0xd201('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0xd201('0x79'))](_0xd201('0x9b')+_0x579227);}_0x225ffd[_0x45125a['body'][_0xd201('0x99')]]=_0x45125a[_0xd201('0x5e')][_0xd201('0x80')];return db['CmList']['find']({'where':{'id':_0x45125a[_0xd201('0x76')][_0xd201('0x9c')]},'include':[{'model':db['CmContact'],'as':_0xd201('0x9d'),'where':_0x225ffd,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xd201('0x1f')](handleEntityNotFound(_0x40bf07,null))[_0xd201('0x1f')](function(_0xa957a0){if(_0xa957a0){_0x45125a[_0xd201('0x9e')]=_[_0xd201('0x9f')](_0xa957a0,['Contacts']);if(_0xa957a0[_0xd201('0x9d')][_0xd201('0x4a')]){return _0xa957a0[_0xd201('0x9d')][0x0];}var _0x5443c9=_['defaults'](_0x45125a[_0xd201('0x5e')],{'firstName':_0x45125a[_0xd201('0x5e')][_0xd201('0x80')],'ListId':_0xa957a0['id']});_0x5443c9[_0x45125a[_0xd201('0x5e')][_0xd201('0x99')]]=_0x45125a[_0xd201('0x5e')][_0xd201('0x80')];return db[_0xd201('0x77')][_0xd201('0x5d')](_0x5443c9,{'fields':_0x6de676,'raw':!![]});}})[_0xd201('0x1f')](handleEntityNotFound(_0x40bf07,null))[_0xd201('0x1f')](function(_0x268e96){if(_0x268e96){_0x45125a[_0xd201('0xa0')]=_0x268e96;var _0x27f0c9={'ContactId':_0x268e96['id'],'phone':_0x45125a[_0xd201('0x5e')]['from'],'SmsAccountId':_0x4d6130['params']['id']};var _0x32fb26={'ContactId':_0x268e96['id'],'SmsAccountId':_0x4d6130[_0xd201('0x59')]['id'],'closed':![]};return db['SmsInteraction'][_0xd201('0x5c')]({'where':_0x32fb26})[_0xd201('0x1f')](function(_0x43d95a){if(_0x43d95a){return[_0x43d95a,![]];}return db[_0xd201('0xa1')][_0xd201('0x5d')](_0x27f0c9)['then'](function(_0x54a3e6){return[_0x54a3e6,!![]];});});}})['spread'](function(_0x34debd,_0x5c5923){_0x45125a[_0xd201('0xa2')]=_0x34debd[_0xd201('0x37')]({'plain':!![]});_0x45125a[_0xd201('0xa2')][_0xd201('0xa3')]=![];if(_0x5c5923){if(_0x45125a[_0xd201('0x76')][_0xd201('0xa4')]){_0x45125a[_0xd201('0x72')][_0xd201('0xa5')]({'id':0x0,'priority':_0x45125a['applications'][_0xd201('0x4a')]+0x1,'app':'close','appdata':_0xd201('0xa6'),'interval':_0xd201('0xa7')});}_0x45125a[_0xd201('0xa2')][_0xd201('0xa3')]=!![];}return db[_0xd201('0xa8')][_0xd201('0x5d')]({'phone':_0x45125a[_0xd201('0x5e')][_0xd201('0x80')],'messageId':_0x45125a[_0xd201('0x5e')][_0xd201('0x88')],'body':_0x45125a['body']['body'],'SmsAccountId':_0x4d6130['params']['id'],'SmsInteractionId':_0x34debd['id'],'direction':'in','ContactId':_0x34debd[_0xd201('0xa9')],'AttachmentId':_0x45125a['body'][_0xd201('0xaa')]});})['then'](function(_0x3558d7){_0x45125a['message']=_0x3558d7;if(_0x45125a[_0xd201('0xa2')][_0xd201('0xab')]){return db[_0xd201('0xac')][_0xd201('0x5c')]({'attributes':['id',_0xd201('0x3b')],'where':{'id':_0x45125a[_0xd201('0xa2')][_0xd201('0xab')]}})[_0xd201('0x1f')](function(_0x389add){if(_0x389add){_0x45125a['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd201('0xad'),'appdata':_0x389add[_0xd201('0x3b')]+','+(_0x45125a['account']['waitForTheAssignedAgent']||0xa),'interval':_0xd201('0xa7')});}return respondWithRpcPromise('Start',_0xd201('0xae'),_0x45125a);});}return respondWithRpcPromise(_0xd201('0xaf'),_0xd201('0xae'),_0x45125a);})[_0xd201('0x1f')](function(_0x2b5ab6){if(_0x2b5ab6){var _0x19c994=0xc8;var _0x244463=_0xd201('0xb0');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x244463,_0x19c994,_0xd201('0xb1'));logger['debug'](_0xd201('0xb2'),_0x244463,_0x19c994,_0xd201('0xb1'),JSON[_0xd201('0x23')](_0x2b5ab6));if(_0x45125a[_0xd201('0x76')]['type']===_0xd201('0x7f')){return _0x40bf07[_0xd201('0x2b')](_0x19c994)[_0xd201('0x32')](_0xd201('0xb3'),_0xd201('0xb4'))['send'](_0xd201('0xb5'));}else{return _0x40bf07[_0xd201('0x2b')](_0x19c994)[_0xd201('0x2d')](_0x2b5ab6);}}})['catch'](handleError(_0x40bf07,null));};exports[_0xd201('0xb6')]=function(_0x3b8ee1,_0x59ffd5){var _0x21512c=_0x3b8ee1[_0xd201('0x59')]['id'];var _0x7f38e=_0x3b8ee1[_0xd201('0x5e')];var _0x13a517=0xc8;var _0x1a6b6b=null;return db['sequelize'][_0xd201('0xb7')]({'isolationLevel':db[_0xd201('0xb8')]['Transaction'][_0xd201('0xb9')][_0xd201('0xba')]},function(_0x2c8165){return db[_0xd201('0x41')]['findOne']({'where':{'id':_0x21512c},'transaction':_0x2c8165})[_0xd201('0x1f')](function(_0x6f579f){if(_0x6f579f){return db['SmsApplication'][_0xd201('0x36')]({'where':{'SmsAccountId':_0x21512c},'transaction':_0x2c8165})[_0xd201('0x1f')](function(){var _0x402947=_[_0xd201('0x40')](_0x7f38e,function(_0x5f0f41){_0x5f0f41[_0xd201('0x65')]=_0x21512c;return _0x5f0f41;});return db[_0xd201('0x71')][_0xd201('0xbb')](_0x402947,{'transaction':_0x2c8165});});}else{_0x13a517=0x194;_0x1a6b6b=[];}});})[_0xd201('0x1f')](function(){if(_0x13a517!==0x194){return db[_0xd201('0x71')][_0xd201('0xbc')]({'where':{'SmsAccountId':_0x21512c},'order':_0xd201('0x74')})[_0xd201('0x1f')](function(_0x20d6b3){_0x1a6b6b=_0x20d6b3;});}})[_0xd201('0x29')](function(_0x54d59c){_0x13a517=0x1f4;logger[_0xd201('0x24')](_0x54d59c[_0xd201('0x3a')]);if(_0x54d59c[_0xd201('0x3b')]){delete _0x54d59c['name'];}_0x1a6b6b=_0x54d59c;})['finally'](function(){if(_0x1a6b6b===null){_0x59ffd5[_0xd201('0x2a')](_0x13a517);}else{if(_0x13a517===0x1f4){_0x59ffd5[_0xd201('0x2b')](_0x13a517)[_0xd201('0x3c')](_0x1a6b6b);}else{_0x59ffd5[_0xd201('0x2b')](_0x13a517)[_0xd201('0x2d')](_0x1a6b6b);}}});};exports[_0xd201('0xbd')]=function(_0x34ad6c,_0x12c318,_0x4a7dbd){var _0x585e31={};var _0x152117={};var _0x3d8cb2;var _0x4d3692;return db[_0xd201('0x41')][_0xd201('0x68')]({'where':{'id':_0x34ad6c[_0xd201('0x59')]['id']}})['then'](handleEntityNotFound(_0x12c318,null))[_0xd201('0x1f')](function(_0x3c20bf){if(_0x3c20bf){_0x3d8cb2=_0x3c20bf;_0x152117[_0xd201('0x43')]=_[_0xd201('0x45')](db[_0xd201('0x71')][_0xd201('0x5a')]);_0x152117[_0xd201('0x44')]=_[_0xd201('0x45')](_0x34ad6c[_0xd201('0x44')]);_0x152117[_0xd201('0x46')]=_['intersection'](_0x152117['model'],_0x152117['query']);_0x585e31[_0xd201('0x47')]=_[_0xd201('0x48')](_0x152117[_0xd201('0x43')],qs['fields'](_0x34ad6c['query'][_0xd201('0x49')]));_0x585e31[_0xd201('0x47')]=_0x585e31['attributes'][_0xd201('0x4a')]?_0x585e31[_0xd201('0x47')]:_0x152117[_0xd201('0x43')];_0x585e31[_0xd201('0x4d')]=qs[_0xd201('0x4e')](_0x34ad6c[_0xd201('0x44')][_0xd201('0x4e')]);_0x585e31[_0xd201('0x50')]=qs[_0xd201('0x46')](_[_0xd201('0x4f')](_0x34ad6c['query'],_0x152117[_0xd201('0x46')]));if(_0x34ad6c['query'][_0xd201('0x52')]){_0x585e31[_0xd201('0x50')]=_[_0xd201('0x53')](_0x585e31[_0xd201('0x50')],{'$or':_[_0xd201('0x40')](_0x585e31[_0xd201('0x47')],function(_0x57c338){var _0xcd6495={};_0xcd6495[_0x57c338]={'$like':'%'+_0x34ad6c[_0xd201('0x44')][_0xd201('0x52')]+'%'};return _0xcd6495;})});}_0x585e31=_['merge']({},_0x585e31,_0x34ad6c['options']);return _0x3d8cb2['getApplications'](_0x585e31);}})[_0xd201('0x1f')](function(_0x4ca2dc){if(_0x4ca2dc){_0x4d3692=_0x4ca2dc[_0xd201('0x4a')];if(!_0x34ad6c[_0xd201('0x44')][_0xd201('0x4b')]('nolimit')){_0x585e31[_0xd201('0x2f')]=qs['limit'](_0x34ad6c[_0xd201('0x44')][_0xd201('0x2f')]);_0x585e31[_0xd201('0x31')]=qs[_0xd201('0x31')](_0x34ad6c[_0xd201('0x44')][_0xd201('0x31')]);}return _0x3d8cb2[_0xd201('0xbd')](_0x585e31);}})['then'](function(_0x1e993c){if(_0x1e993c){return _0x1e993c?{'count':_0x4d3692,'rows':_0x1e993c}:null;}})['then'](respondWithResult(_0x12c318,null))[_0xd201('0x29')](handleError(_0x12c318,null));};exports['getInteractions']=function(_0x43dae6,_0x48136c,_0x1f9e74){var _0x29bea1={'raw':![],'where':{}};var _0xd1155e={};var _0x435053={'count':0x0,'rows':[]};return db[_0xd201('0x41')][_0xd201('0x68')]({'where':{'id':_0x43dae6['params']['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x48136c,null))[_0xd201('0x1f')](function(_0x58cdf1){if(_0x58cdf1){_0xd1155e[_0xd201('0x43')]=_[_0xd201('0x45')](db[_0xd201('0xa1')][_0xd201('0x5a')]);_0xd1155e['query']=_[_0xd201('0x45')](_0x43dae6[_0xd201('0x44')]);_0xd1155e['filters']=_[_0xd201('0x48')](_0xd1155e[_0xd201('0x43')],_0xd1155e[_0xd201('0x44')]);_0x29bea1['attributes']=_[_0xd201('0x48')](_0xd1155e['model'],qs[_0xd201('0x49')](_0x43dae6['query'][_0xd201('0x49')]));_0x29bea1[_0xd201('0x47')]=_0x29bea1[_0xd201('0x47')][_0xd201('0x4a')]?_0x29bea1[_0xd201('0x47')]:_0xd1155e[_0xd201('0x43')];if(!_0x43dae6['query']['hasOwnProperty'](_0xd201('0x4c'))){_0x29bea1[_0xd201('0x2f')]=qs[_0xd201('0x2f')](_0x43dae6[_0xd201('0x44')][_0xd201('0x2f')]);_0x29bea1['offset']=qs[_0xd201('0x31')](_0x43dae6[_0xd201('0x44')]['offset']);}_0x29bea1[_0xd201('0x4d')]=qs[_0xd201('0x4e')](_0x43dae6['query'][_0xd201('0x4e')]);_0x29bea1[_0xd201('0x50')]=qs[_0xd201('0x46')](_[_0xd201('0x4f')](_0x43dae6[_0xd201('0x44')],_0xd1155e[_0xd201('0x46')]));_0x29bea1[_0xd201('0x50')][_0xd201('0x65')]=_0x58cdf1['id'];if(_0x43dae6[_0xd201('0x44')][_0xd201('0x52')]){_0x29bea1['where']=_[_0xd201('0x53')](_0x29bea1['where'],{'$or':_[_0xd201('0x40')](_0x29bea1[_0xd201('0x47')],function(_0x1901d6){var _0x1804f5={};_0x1804f5[_0x1901d6]={'$like':'%'+_0x43dae6['query'][_0xd201('0x52')]+'%'};return _0x1804f5;})});}_0x29bea1=_[_0xd201('0x53')]({},_0x29bea1,_0x43dae6['options']);return db[_0xd201('0xa1')][_0xd201('0x30')]({'where':_0x29bea1['where']})[_0xd201('0x1f')](function(_0x31b8dd){_0x435053[_0xd201('0x30')]=_0x31b8dd;if(_0x43dae6[_0xd201('0x44')][_0xd201('0x55')]){_0x29bea1[_0xd201('0x5b')]=[{'model':db['CmContact'],'as':_0xd201('0xbe'),'required':![]},{'model':db[_0xd201('0xac')],'as':_0xd201('0xbf'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xd201('0xc0')],'as':_0xd201('0xc1'),'attributes':['id','name','color'],'where':_0x43dae6[_0xd201('0x44')][_0xd201('0xc2')]?{'id':_0x43dae6[_0xd201('0x44')]['tag']}:undefined,'required':_0x43dae6[_0xd201('0x44')][_0xd201('0xc2')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x29bea1);})[_0xd201('0x1f')](function(_0x2985f1){_0x435053[_0xd201('0x57')]=_0x2985f1;return _0x435053;});}})['then'](respondWithFilteredResult(_0x48136c,_0x29bea1))[_0xd201('0x29')](handleError(_0x48136c,null));};exports['send']=function(_0x42d771,_0x5f0329,_0x189ac6){var _0x40beed,_0x58acaf,_0x1661e5;if(_[_0xd201('0x97')](_0x42d771[_0xd201('0x5e')][_0xd201('0x5e')])||_0x42d771[_0xd201('0x5e')][_0xd201('0x5e')]===''){throw new db[(_0xd201('0x78'))][(_0xd201('0x79'))](_0xd201('0x98'));}if(_[_0xd201('0x97')](_0x42d771[_0xd201('0x5e')]['to'])){throw new db[(_0xd201('0x78'))]['ValidationError'](_0xd201('0xc3'));}_0x40beed=_0x42d771[_0xd201('0x5e')]['to'];return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x42d771[_0xd201('0x59')]['id']},'include':[{'model':db[_0xd201('0xc4')],'as':_0xd201('0xc5'),'include':[{'model':db[_0xd201('0x77')],'as':'Contacts','where':{'mobile':_0x40beed},'limit':0x1,'order':[[_0xd201('0x7c'),_0xd201('0xc6')]]}]}]})[_0xd201('0x1f')](handleEntityNotFound(_0x5f0329,null))[_0xd201('0x1f')](function(_0x2d20a0){if(_0x2d20a0&&_0x2d20a0[_0xd201('0xc5')]){_0x58acaf=_0x2d20a0[_0xd201('0x37')]({'plain':!![]});if(_0x58acaf[_0xd201('0xc5')]&&_0x58acaf['List'][_0xd201('0x9d')]['length']){return _0x58acaf[_0xd201('0xc5')][_0xd201('0x9d')][0x0];}return db[_0xd201('0x77')][_0xd201('0x5d')](_[_0xd201('0x18')](_0x42d771[_0xd201('0x5e')],{'firstName':_0x40beed,'mobile':_0x40beed,'phone':_0x40beed,'ListId':_0x58acaf[_0xd201('0x9c')]}));}})[_0xd201('0x1f')](handleEntityNotFound(_0x5f0329,null))['then'](function(_0x1f4c70){if(_0x1f4c70){_0x1661e5=_0x1f4c70;return db['SmsInteraction'][_0xd201('0x5c')]({'where':{'ContactId':_0x1661e5['id'],'closed':![],'SmsAccountId':_0x58acaf['id']}})[_0xd201('0x1f')](function(_0x1faa98){if(_0x1faa98){return[_0x1faa98,![]];}return db['SmsInteraction'][_0xd201('0x5d')]({'UserId':_0x42d771[_0xd201('0xc7')]['id'],'ContactId':_0x1661e5['id'],'SmsAccountId':_0x58acaf['id'],'phone':_0x40beed,'firstMsgDirection':_0xd201('0xc8'),'Messages':[_['merge'](_0x42d771['body'],{'read':![],'body':_0x42d771['body']['body'],'phone':_0x40beed,'SmsAccountId':_0x58acaf['id'],'UserId':_0x42d771[_0xd201('0xc7')]['id'],'ContactId':_0x1661e5['id']})]},{'include':[{'model':db[_0xd201('0xa8')],'as':_0xd201('0xc9')}]})['then'](function(_0x1f5be3){return[_0x1f5be3,!![]];});});}})[_0xd201('0xca')](function(_0x2c4580,_0x240089){if(_0x240089){return _0x2c4580;}return db[_0xd201('0xa8')]['create'](_[_0xd201('0x53')](_0x42d771[_0xd201('0x5e')],{'read':![],'body':_0x42d771[_0xd201('0x5e')][_0xd201('0x5e')],'phone':_0x40beed,'SmsAccountId':_0x58acaf['id'],'SmsInteractionId':_0x2c4580['id'],'UserId':_0x42d771[_0xd201('0xc7')]['id'],'ContactId':_0x1661e5['id']}))['then'](function(_0x53a5d1){_0x2c4580['dataValues']['Messages']=[];_0x2c4580[_0xd201('0xcb')][_0xd201('0xc9')][_0xd201('0xa5')](_0x53a5d1[_0xd201('0xcb')]);return _0x2c4580;});})[_0xd201('0x1f')](respondWithResult(_0x5f0329,null))[_0xd201('0x29')](handleError(_0x5f0329,null));};exports[_0xd201('0x2b')]=function(_0x5841e7,_0x2fe4c5,_0x10d186){if(_0x5841e7['body']['id']){delete _0x5841e7[_0xd201('0x5e')]['id'];}var _0x226614,_0x1214b7,_0x55ea04;return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x5841e7[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x2fe4c5,null))[_0xd201('0x1f')](function(_0x501a8d){if(_0x501a8d){_0x55ea04=_0x501a8d;logger[_0xd201('0xcc')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd201('0xcd'),_0x501a8d[_0xd201('0x7e')],util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));switch(_0x501a8d[_0xd201('0x7e')]){case _0xd201('0x84'):if(_0x5841e7[_0xd201('0x5e')]['skebby_dispatch_id']&&_0x5841e7['body'][_0xd201('0x2b')]){_0x1214b7=_0x5841e7[_0xd201('0x5e')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x5841e7[_0xd201('0x5e')][_0xd201('0xcf')]}});}break;case _0xd201('0x86'):if(_0x5841e7[_0xd201('0x5e')][_0xd201('0xd0')]&&_0x5841e7[_0xd201('0x5e')][_0xd201('0xd1')]){_0x1214b7=_0x5841e7[_0xd201('0x5e')][_0xd201('0xd1')];return db[_0xd201('0xa8')][_0xd201('0x5c')]({'where':{'messageId':_0x5841e7[_0xd201('0x5e')][_0xd201('0xd0')]}});}break;case _0xd201('0x87'):if(_0x5841e7[_0xd201('0x5e')][_0xd201('0x89')]&&_0x5841e7[_0xd201('0x5e')][_0xd201('0xd2')]){_0x1214b7=_0x5841e7[_0xd201('0x5e')][_0xd201('0xd2')];return db['SmsMessage'][_0xd201('0x5c')]({'where':{'messageId':_0x5841e7['body'][_0xd201('0x89')]}});}break;case _0xd201('0x8d'):var _0x30083f=_0x5841e7[_0xd201('0x5e')][_0xd201('0x8e')][0x0];if(_0x30083f['messageId']&&_0x30083f['status'][_0xd201('0xd3')]===_0xd201('0xd4')){_0x1214b7=_0x30083f[_0xd201('0x2b')][_0xd201('0xd3')];return db[_0xd201('0xa8')][_0xd201('0x5c')]({'where':{'messageId':_0x30083f[_0xd201('0x88')]}});}break;case _0xd201('0xd5'):if(_0x5841e7[_0xd201('0x5e')][_0xd201('0x88')]&&_0x5841e7[_0xd201('0x5e')]['status']){_0x1214b7=_0x5841e7[_0xd201('0x5e')]['status'];return db[_0xd201('0xa8')][_0xd201('0x5c')]({'where':{'messageId':_0x5841e7['body'][_0xd201('0x88')]}});}break;case'bandwidth':if(_0x5841e7[_0xd201('0x5e')][0x0][_0xd201('0x26')]['id']){_0x1214b7=_0x5841e7[_0xd201('0x5e')][0x0][_0xd201('0x7e')];return db[_0xd201('0xa8')][_0xd201('0x5c')]({'where':{'messageId':_0x5841e7[_0xd201('0x5e')][0x0][_0xd201('0x26')]['id']}});}break;case _0xd201('0x95'):if(_0x5841e7[_0xd201('0x5e')][_0xd201('0xd6')]&&_0x5841e7[_0xd201('0x5e')][_0xd201('0x2b')]){_0x1214b7=_0x5841e7[_0xd201('0x5e')][_0xd201('0x2b')];return db[_0xd201('0xa8')][_0xd201('0x5c')]({'where':{'messageId':_0x5841e7[_0xd201('0x5e')][_0xd201('0xd6')]}});}break;}}})[_0xd201('0x1f')](handleEntityNotFound(_0x2fe4c5,null))[_0xd201('0x1f')](function(_0x15d06c){if(_0x15d06c){_0x226614=_0x15d06c;switch(_0x55ea04['type']){case'skebby':if(_0x1214b7===_0xd201('0xd4')){return _0x226614[_0xd201('0x35')]({'read':!![]});}else{logger[_0xd201('0x24')](_0xd201('0x22'),_0xd201('0x2b'),_0xd201('0x84'),util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd201('0x86'):if(_0x1214b7==='1'){return _0x226614[_0xd201('0x35')]({'read':!![]});}else{logger[_0xd201('0x24')](_0xd201('0x22'),_0xd201('0x2b'),_0xd201('0x84'),util['inspect'](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd201('0x87'):if(!_0x5841e7[_0xd201('0x5e')][_0xd201('0xd7')]&&_0x1214b7>=0xc8&&_0x1214b7<=0xce){return _0x226614[_0xd201('0x35')]({'read':!![]});}else{logger[_0xd201('0x24')](_0xd201('0x22'),'status','clicksend',util[_0xd201('0xce')](_0x5841e7['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xf53fd2=_0x5841e7[_0xd201('0x5e')][_0xd201('0x8e')][0x0];if(_0xf53fd2[_0xd201('0x2b')][_0xd201('0xd3')]===_0xd201('0xd4')){return _0x226614['update']({'read':!![]});}else{logger[_0xd201('0x24')](_0xd201('0x22'),_0xd201('0x2b'),_0xd201('0x8d'),util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd201('0xd5'):if(_0x1214b7=='DELIVERED_TO_GATEWAY'||_0x1214b7=='RECEIVED_BY_RECIPIENT'){return _0x226614['update']({'read':!![]});}else{logger[_0xd201('0x24')](_0xd201('0x22'),_0xd201('0x2b'),'clickatell',util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd201('0x94'):if(_0x1214b7==_0xd201('0xd8')){return _0x226614[_0xd201('0x35')]({'read':!![]});}else{logger['error'](_0xd201('0x22'),_0xd201('0x2b'),_0xd201('0x94'),util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd201('0x95'):if(_0x1214b7==='DELIVRD'||_0x1214b7===_0xd201('0xd9')){return _0x226614[_0xd201('0x35')]({'read':!![]});}else{logger[_0xd201('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd201('0x2b'),'intelepeer',util[_0xd201('0xce')](_0x5841e7[_0xd201('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x226614;}})[_0xd201('0x1f')](respondWithResult(_0x2fe4c5,null))['catch'](handleError(_0x2fe4c5,null));};exports[_0xd201('0xda')]=function(_0x508778,_0x5bb0c0,_0x2e4053){var _0x4e5ab9,_0xaaf3c0,_0x1c28fc;return db[_0xd201('0x41')][_0xd201('0x5c')]({'where':{'id':_0x508778[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x5bb0c0,null))['then'](function(_0x46c563){if(_0x46c563){_0x1c28fc=_0x46c563;logger[_0xd201('0xcc')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd201('0x2b'),_0xd201('0xcd'),_0x46c563[_0xd201('0x7e')],util['inspect'](_0x508778[_0xd201('0x44')],{'showHidden':![],'depth':null}));switch(_0x46c563[_0xd201('0x7e')]){case _0xd201('0x8f'):if(_0x508778[_0xd201('0x44')][_0xd201('0xdb')]&&_0x508778[_0xd201('0x44')][_0xd201('0xdc')]){_0xaaf3c0=_0x508778['query']['state'];return db['SmsMessage'][_0xd201('0x5c')]({'where':{'messageId':_0x508778[_0xd201('0x44')][_0xd201('0xdb')]}});}break;}}})[_0xd201('0x1f')](handleEntityNotFound(_0x5bb0c0,null))[_0xd201('0x1f')](function(_0x5c1374){if(_0x5c1374){_0x4e5ab9=_0x5c1374;switch(_0x1c28fc[_0xd201('0x7e')]){case _0xd201('0x8f'):if(_0xaaf3c0==='2'||_0xaaf3c0==='6'){return _0x4e5ab9[_0xd201('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd201('0x2b'),_0xd201('0x8f'),util[_0xd201('0xce')](_0x508778[_0xd201('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x4e5ab9;}})[_0xd201('0x1f')](respondWithResult(_0x5bb0c0,null))[_0xd201('0x29')](handleError(_0x5bb0c0,null));};exports[_0xd201('0xdd')]=function(_0x165129,_0x1b61e6,_0x48c74){return db['SmsAccount'][_0xd201('0x5c')]({'where':{'id':_0x165129['params']['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x1b61e6,null))[_0xd201('0x1f')](function(_0x9421d9){if(_0x9421d9){return _0x9421d9[_0xd201('0xdd')](_0x165129[_0xd201('0x5e')][_0xd201('0x6a')],_[_0xd201('0x9f')](_0x165129['body'],[_0xd201('0x6a'),'id'])||{})[_0xd201('0xca')](function(_0x484ae1){for(var _0x1676d0=0x0;_0x1676d0<_0x165129[_0xd201('0x5e')][_0xd201('0x6a')]['length'];_0x1676d0+=0x1){socket[_0xd201('0xde')](_0xd201('0xdf'),{'UserId':Number(_0x165129[_0xd201('0x5e')]['ids'][_0x1676d0]),'SmsAccountId':Number(_0x165129[_0xd201('0x59')]['id'])});}return _0x484ae1;});}})[_0xd201('0x1f')](respondWithResult(_0x1b61e6,null))[_0xd201('0x29')](handleError(_0x1b61e6,null));};exports[_0xd201('0xe0')]=function(_0x4d3eec,_0x5b6268,_0x545934){return db['SmsAccount'][_0xd201('0x5c')]({'where':{'id':_0x4d3eec[_0xd201('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b6268,null))[_0xd201('0x1f')](function(_0x2990c1){if(_0x2990c1){return _0x2990c1[_0xd201('0xe0')](_0x4d3eec[_0xd201('0x44')][_0xd201('0x6a')])[_0xd201('0x1f')](function(){if(_['isArray'](_0x4d3eec['query'][_0xd201('0x6a')])){for(var _0x479133=0x0;_0x479133<_0x4d3eec[_0xd201('0x44')][_0xd201('0x6a')][_0xd201('0x4a')];_0x479133+=0x1){socket['emit'](_0xd201('0xe1'),{'UserId':Number(_0x4d3eec['query'][_0xd201('0x6a')][_0x479133]),'SmsAccountId':Number(_0x4d3eec[_0xd201('0x59')]['id'])});}}else{socket[_0xd201('0xde')](_0xd201('0xe1'),{'UserId':Number(_0x4d3eec[_0xd201('0x44')][_0xd201('0x6a')]),'SmsAccountId':Number(_0x4d3eec[_0xd201('0x59')]['id'])});}});}})[_0xd201('0x1f')](respondWithStatusCode(_0x5b6268,null))[_0xd201('0x29')](handleError(_0x5b6268,null));};exports[_0xd201('0xe2')]=function(_0xae9b9e,_0x422861,_0x363d39){var _0x5e8ef5={};var _0x47b957={};var _0x39ffb6;var _0x4d07c8;return db[_0xd201('0x41')][_0xd201('0x68')]({'where':{'id':_0xae9b9e[_0xd201('0x59')]['id']}})[_0xd201('0x1f')](handleEntityNotFound(_0x422861,null))[_0xd201('0x1f')](function(_0xcc3c20){if(_0xcc3c20){_0x39ffb6=_0xcc3c20;_0x47b957['model']=_[_0xd201('0x45')](db[_0xd201('0xac')][_0xd201('0x5a')]);_0x47b957[_0xd201('0x44')]=_[_0xd201('0x45')](_0xae9b9e[_0xd201('0x44')]);_0x47b957['filters']=_['intersection'](_0x47b957[_0xd201('0x43')],_0x47b957[_0xd201('0x44')]);_0x5e8ef5['attributes']=_[_0xd201('0x48')](_0x47b957['model'],qs['fields'](_0xae9b9e['query'][_0xd201('0x49')]));_0x5e8ef5[_0xd201('0x47')]=_0x5e8ef5[_0xd201('0x47')]['length']?_0x5e8ef5[_0xd201('0x47')]:_0x47b957[_0xd201('0x43')];_0x5e8ef5[_0xd201('0x4d')]=qs[_0xd201('0x4e')](_0xae9b9e[_0xd201('0x44')][_0xd201('0x4e')]);_0x5e8ef5[_0xd201('0x50')]=qs[_0xd201('0x46')](_['pick'](_0xae9b9e['query'],_0x47b957[_0xd201('0x46')]));if(_0xae9b9e[_0xd201('0x44')]['filter']){_0x5e8ef5[_0xd201('0x50')]=_[_0xd201('0x53')](_0x5e8ef5[_0xd201('0x50')],{'$or':_[_0xd201('0x40')](_0x5e8ef5[_0xd201('0x47')],function(_0x4e5d0d){var _0xec7726={};_0xec7726[_0x4e5d0d]={'$like':'%'+_0xae9b9e[_0xd201('0x44')][_0xd201('0x52')]+'%'};return _0xec7726;})});}_0x5e8ef5=_['merge']({},_0x5e8ef5,_0xae9b9e['options']);return _0x39ffb6[_0xd201('0xe2')](_0x5e8ef5);}})['then'](function(_0x1603f3){if(_0x1603f3){_0x4d07c8=_0x1603f3[_0xd201('0x4a')];if(!_0xae9b9e[_0xd201('0x44')][_0xd201('0x4b')](_0xd201('0x4c'))){_0x5e8ef5[_0xd201('0x2f')]=qs[_0xd201('0x2f')](_0xae9b9e[_0xd201('0x44')][_0xd201('0x2f')]);_0x5e8ef5[_0xd201('0x31')]=qs[_0xd201('0x31')](_0xae9b9e[_0xd201('0x44')][_0xd201('0x31')]);}return _0x39ffb6['getAgents'](_0x5e8ef5);}})['then'](function(_0x32ed4c){if(_0x32ed4c){return _0x32ed4c?{'count':_0x4d07c8,'rows':_0x32ed4c}:null;}})['then'](respondWithResult(_0x422861,null))[_0xd201('0x29')](handleError(_0x422861,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f2880e2..ed890ee 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 _0x52ee=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x510fad,_0x283c39){var _0x249cc9=function(_0x5a9740){while(--_0x5a9740){_0x510fad['push'](_0x510fad['shift']());}};_0x249cc9(++_0x283c39);}(_0x52ee,0x1c9));var _0xe52e=function(_0x42c341,_0x31d467){_0x42c341=_0x42c341-0x0;var _0x43621b=_0x52ee[_0x42c341];return _0x43621b;};'use strict';var EventEmitter=require(_0xe52e('0x0'));var SmsAccount=require(_0xe52e('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe52e('0x2'),'afterDestroy':_0xe52e('0x3')};function emitEvent(_0x48f67d){return function(_0x510b56,_0x4e2a7f,_0x4bc284){SmsAccountEvents[_0xe52e('0x4')](_0x48f67d+':'+_0x510b56['id'],_0x510b56);SmsAccountEvents[_0xe52e('0x4')](_0x48f67d,_0x510b56);_0x4bc284(null);};}for(var e in events){if(events[_0xe52e('0x5')](e)){var event=events[e];SmsAccount[_0xe52e('0x6')](e,emitEvent(event));}}module[_0xe52e('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x28ab=['emit','hasOwnProperty','hook','exports','events','SmsAccount','save','update','remove'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x28ab,0x1f3));var _0xb28a=function(_0x2fc3b4,_0x1e868f){_0x2fc3b4=_0x2fc3b4-0x0;var _0x41b72e=_0x28ab[_0x2fc3b4];return _0x41b72e;};'use strict';var EventEmitter=require(_0xb28a('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xb28a('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb28a('0x2'),'afterUpdate':_0xb28a('0x3'),'afterDestroy':_0xb28a('0x4')};function emitEvent(_0x964c9d){return function(_0x5e1842,_0x29637c,_0x5326fc){SmsAccountEvents[_0xb28a('0x5')](_0x964c9d+':'+_0x5e1842['id'],_0x5e1842);SmsAccountEvents[_0xb28a('0x5')](_0x964c9d,_0x5e1842);_0x5326fc(null);};}for(var e in events){if(events[_0xb28a('0x6')](e)){var event=events[e];SmsAccount[_0xb28a('0x7')](e,emitEvent(event));}}module[_0xb28a('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 6a57131..d488fde 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 _0xcecb=['../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x1a17a3,_0x3bdb41){var _0x48a8aa=function(_0x369641){while(--_0x369641){_0x1a17a3['push'](_0x1a17a3['shift']());}};_0x48a8aa(++_0x3bdb41);}(_0xcecb,0xb5));var _0xbcec=function(_0x2fe916,_0x8382b1){_0x2fe916=_0x2fe916-0x0;var _0x3f7a8a=_0xcecb[_0x2fe916];return _0x3f7a8a;};'use strict';var _=require(_0xbcec('0x0'));var util=require(_0xbcec('0x1'));var logger=require('../../config/logger')(_0xbcec('0x2'));var moment=require('moment');var BPromise=require(_0xbcec('0x3'));var rp=require(_0xbcec('0x4'));var fs=require('fs');var path=require(_0xbcec('0x5'));var rimraf=require('rimraf');var config=require(_0xbcec('0x6'));var attributes=require(_0xbcec('0x7'));module[_0xbcec('0x8')]=function(_0x3b34b7,_0x7302f2){return _0x3b34b7['define'](_0xbcec('0x9'),attributes,{'tableName':_0xbcec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa61e=['lodash','util','../../config/logger','api','moment','rimraf','./smsAccount.attributes','exports','define'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xa61e,0xb4));var _0xea61=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa61e[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xea61('0x0'));var util=require(_0xea61('0x1'));var logger=require(_0xea61('0x2'))(_0xea61('0x3'));var moment=require(_0xea61('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xea61('0x5'));var config=require('../../config/environment');var attributes=require(_0xea61('0x6'));module[_0xea61('0x7')]=function(_0x5beddc,_0x367aa1){return _0x5beddc[_0xea61('0x8')]('SmsAccount',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 fd2a76d..c649578 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 _0x2eba=['request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','map','include','attributes','model','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x5d1dad,_0x2cbdd4){var _0x334f8d=function(_0x331bbb){while(--_0x331bbb){_0x5d1dad['push'](_0x5d1dad['shift']());}};_0x334f8d(++_0x2cbdd4);}(_0x2eba,0x17f));var _0xa2eb=function(_0x53767e,_0x1757a4){_0x53767e=_0x53767e-0x0;var _0xd644f0=_0x2eba[_0x53767e];return _0xd644f0;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require('bluebird');var rs=require(_0xa2eb('0x2'));var fs=require('fs');var Redis=require(_0xa2eb('0x3'));var db=require(_0xa2eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa2eb('0x5'))(_0xa2eb('0x6'));var config=require(_0xa2eb('0x7'));var jayson=require(_0xa2eb('0x8'));var client=jayson[_0xa2eb('0x9')][_0xa2eb('0xa')]({'port':0x232a});config[_0xa2eb('0xb')]=_[_0xa2eb('0xc')](config['redis'],{'host':_0xa2eb('0xd'),'port':0x18eb});var socket=require(_0xa2eb('0xe'))(new Redis(config[_0xa2eb('0xb')]));require(_0xa2eb('0xf'))[_0xa2eb('0x10')](socket);function respondWithRpcPromise(_0x115b95,_0x2c7030,_0x1595cc){return new BPromise(function(_0xc8ee89,_0x26573b){return client[_0xa2eb('0x11')](_0x115b95,_0x1595cc)[_0xa2eb('0x12')](function(_0x3054e9){logger[_0xa2eb('0x13')](_0xa2eb('0x14'),_0x2c7030,_0xa2eb('0x15'));logger[_0xa2eb('0x16')](_0xa2eb('0x17'),_0x2c7030,'request\x20sent',JSON['stringify'](_0x3054e9));if(_0x3054e9['error']){if(_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x19')]===0x1f4){logger[_0xa2eb('0x18')](_0xa2eb('0x14'),_0x2c7030,_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);return _0x26573b(_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);}logger[_0xa2eb('0x18')](_0xa2eb('0x14'),_0x2c7030,_0x3054e9[_0xa2eb('0x18')][_0xa2eb('0x1a')]);return _0xc8ee89(_0x3054e9[_0xa2eb('0x18')]['message']);}else{logger[_0xa2eb('0x13')](_0xa2eb('0x14'),_0x2c7030,_0xa2eb('0x15'));_0xc8ee89(_0x3054e9[_0xa2eb('0x1b')]['message']);}})[_0xa2eb('0x1c')](function(_0x3af35f){logger['error'](_0xa2eb('0x14'),_0x2c7030,_0x3af35f);_0x26573b(_0x3af35f);});});}exports[_0xa2eb('0x1d')]=function(_0x5f2e31){var _0x1e7d01=this;return new Promise(function(_0x180cc3,_0x79f933){return db[_0xa2eb('0x1e')][_0xa2eb('0x1f')]({'raw':_0x5f2e31['options']?_0x5f2e31[_0xa2eb('0x20')][_0xa2eb('0x21')]===undefined?!![]:![]:!![],'where':_0x5f2e31[_0xa2eb('0x20')]?_0x5f2e31[_0xa2eb('0x20')][_0xa2eb('0x22')]||null:null,'attributes':_0x5f2e31[_0xa2eb('0x20')]?_0x5f2e31[_0xa2eb('0x20')]['attributes']||null:null,'include':_0x5f2e31['options']?_0x5f2e31[_0xa2eb('0x20')]['include']?_[_0xa2eb('0x23')](_0x5f2e31['options'][_0xa2eb('0x24')],function(_0x45cf5e){return{'model':db[_0x45cf5e['model']],'as':_0x45cf5e['as'],'attributes':_0x45cf5e[_0xa2eb('0x25')],'include':_0x45cf5e[_0xa2eb('0x24')]?_[_0xa2eb('0x23')](_0x45cf5e['include'],function(_0x37c348){return{'model':db[_0x37c348[_0xa2eb('0x26')]],'as':_0x37c348['as'],'attributes':_0x37c348[_0xa2eb('0x25')],'include':_0x37c348['include']?_[_0xa2eb('0x23')](_0x37c348[_0xa2eb('0x24')],function(_0x8a335f){return{'model':db[_0x8a335f[_0xa2eb('0x26')]],'as':_0x8a335f['as'],'attributes':_0x8a335f[_0xa2eb('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa2eb('0x12')](function(_0x5b7478){logger[_0xa2eb('0x13')](_0xa2eb('0x1d'),_0x5f2e31);logger[_0xa2eb('0x16')](_0xa2eb('0x1d'),_0x5f2e31,JSON[_0xa2eb('0x27')](_0x5b7478));_0x180cc3(_0x5b7478);})[_0xa2eb('0x1c')](function(_0xfefca4){logger['error'](_0xa2eb('0x1d'),_0xfefca4[_0xa2eb('0x1a')],_0x5f2e31);_0x79f933(_0x1e7d01[_0xa2eb('0x18')](0x1f4,_0xfefca4[_0xa2eb('0x1a')]));});});}; \ No newline at end of file +var _0x2755=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','options','raw','where','attributes','include','map','model','then','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x2755,0x1cf));var _0x5275=function(_0x44d782,_0x581b64){_0x44d782=_0x44d782-0x0;var _0x54ef48=_0x2755[_0x44d782];return _0x54ef48;};'use strict';var _=require(_0x5275('0x0'));var util=require(_0x5275('0x1'));var moment=require(_0x5275('0x2'));var BPromise=require(_0x5275('0x3'));var rs=require(_0x5275('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5275('0x5'))['db'];var utils=require(_0x5275('0x6'));var logger=require(_0x5275('0x7'))(_0x5275('0x8'));var config=require(_0x5275('0x9'));var jayson=require(_0x5275('0xa'));var client=jayson[_0x5275('0xb')]['http']({'port':0x232a});config[_0x5275('0xc')]=_[_0x5275('0xd')](config[_0x5275('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5275('0xe'))(new Redis(config[_0x5275('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0xc21701,_0x58a846,_0x138f7b){return new BPromise(function(_0x2a207a,_0x2f27ce){return client['request'](_0xc21701,_0x138f7b)['then'](function(_0x45bbda){logger[_0x5275('0xf')](_0x5275('0x10'),_0x58a846,_0x5275('0x11'));logger['debug'](_0x5275('0x12'),_0x58a846,'request\x20sent',JSON[_0x5275('0x13')](_0x45bbda));if(_0x45bbda['error']){if(_0x45bbda[_0x5275('0x14')][_0x5275('0x15')]===0x1f4){logger[_0x5275('0x14')]('SmsAccount,\x20%s,\x20%s',_0x58a846,_0x45bbda[_0x5275('0x14')][_0x5275('0x16')]);return _0x2f27ce(_0x45bbda[_0x5275('0x14')]['message']);}logger[_0x5275('0x14')](_0x5275('0x10'),_0x58a846,_0x45bbda[_0x5275('0x14')][_0x5275('0x16')]);return _0x2a207a(_0x45bbda[_0x5275('0x14')][_0x5275('0x16')]);}else{logger['info'](_0x5275('0x10'),_0x58a846,'request\x20sent');_0x2a207a(_0x45bbda[_0x5275('0x17')][_0x5275('0x16')]);}})[_0x5275('0x18')](function(_0x53aab2){logger[_0x5275('0x14')]('SmsAccount,\x20%s,\x20%s',_0x58a846,_0x53aab2);_0x2f27ce(_0x53aab2);});});}exports['ShowSmsAccount']=function(_0x2cfdd3){var _0x26e8e2=this;return new Promise(function(_0x2ee319,_0x1e9078){return db[_0x5275('0x19')]['find']({'raw':_0x2cfdd3[_0x5275('0x1a')]?_0x2cfdd3['options'][_0x5275('0x1b')]===undefined?!![]:![]:!![],'where':_0x2cfdd3['options']?_0x2cfdd3['options'][_0x5275('0x1c')]||null:null,'attributes':_0x2cfdd3[_0x5275('0x1a')]?_0x2cfdd3[_0x5275('0x1a')][_0x5275('0x1d')]||null:null,'include':_0x2cfdd3[_0x5275('0x1a')]?_0x2cfdd3[_0x5275('0x1a')][_0x5275('0x1e')]?_['map'](_0x2cfdd3['options'][_0x5275('0x1e')],function(_0xa21463){return{'model':db[_0xa21463['model']],'as':_0xa21463['as'],'attributes':_0xa21463['attributes'],'include':_0xa21463[_0x5275('0x1e')]?_[_0x5275('0x1f')](_0xa21463[_0x5275('0x1e')],function(_0x138c00){return{'model':db[_0x138c00[_0x5275('0x20')]],'as':_0x138c00['as'],'attributes':_0x138c00[_0x5275('0x1d')],'include':_0x138c00[_0x5275('0x1e')]?_[_0x5275('0x1f')](_0x138c00[_0x5275('0x1e')],function(_0x191b62){return{'model':db[_0x191b62[_0x5275('0x20')]],'as':_0x191b62['as'],'attributes':_0x191b62[_0x5275('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5275('0x21')](function(_0x4e878a){logger[_0x5275('0xf')](_0x5275('0x22'),_0x2cfdd3);logger[_0x5275('0x23')](_0x5275('0x22'),_0x2cfdd3,JSON[_0x5275('0x13')](_0x4e878a));_0x2ee319(_0x4e878a);})[_0x5275('0x18')](function(_0x2368e2){logger['error'](_0x5275('0x22'),_0x2368e2[_0x5275('0x16')],_0x2cfdd3);_0x1e9078(_0x26e8e2['error'](0x1f4,_0x2368e2['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8225022..f49578e 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(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 e8e0184..4efda1f 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_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 _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(_0x339dd4,_0x4c1563){var _0x10992f=function(_0x44a770){while(--_0x44a770){_0x339dd4['push'](_0x339dd4['shift']());}};_0x10992f(++_0x4c1563);}(_0x34e8,0x12c));var _0x834e=function(_0x3caf92,_0x710cc4){_0x3caf92=_0x3caf92-0x0;var _0x4222bc=_0x34e8[_0x3caf92];return _0x4222bc;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 5cf8109..b2c3c85 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 _0xa8c8=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x3a72f9,_0x5e8c95){var _0x1e79ca=function(_0x3bc93a){while(--_0x3bc93a){_0x3a72f9['push'](_0x3a72f9['shift']());}};_0x1e79ca(++_0x5e8c95);}(_0xa8c8,0xa3));var _0x8a8c=function(_0x42f84d,_0x23f1e8){_0x42f84d=_0x42f84d-0x0;var _0x427ef0=_0xa8c8[_0x42f84d];return _0x427ef0;};'use strict';var Sequelize=require('sequelize');module[_0x8a8c('0x0')]={'priority':{'type':Sequelize[_0x8a8c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8a8c('0x2')],'allowNull':![],'defaultValue':_0x8a8c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8a8c('0x2')]},'interval':{'type':Sequelize[_0x8a8c('0x2')],'defaultValue':_0x8a8c('0x4')}}; \ No newline at end of file +var _0x80e6=['noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x51d990,_0x5aa006){var _0x168fb3=function(_0x5e184f){while(--_0x5e184f){_0x51d990['push'](_0x51d990['shift']());}};_0x168fb3(++_0x5aa006);}(_0x80e6,0xe5));var _0x680e=function(_0x4be398,_0x54e3f6){_0x4be398=_0x4be398-0x0;var _0x3d48f3=_0x80e6[_0x4be398];return _0x3d48f3;};'use strict';var Sequelize=require('sequelize');module[_0x680e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x680e('0x1')},'appdata':{'type':Sequelize[_0x680e('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x680e('0x3')],'defaultValue':_0x680e('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f26a7bb..3be52a2 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 _0xdcfe=['api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x36d9d1,_0x1dbe1d){var _0xa7e07a=function(_0x13d5a2){while(--_0x13d5a2){_0x36d9d1['push'](_0x36d9d1['shift']());}};_0xa7e07a(++_0x1dbe1d);}(_0xdcfe,0x11e));var _0xedcf=function(_0x27882c,_0x2bd1b8){_0x27882c=_0x27882c-0x0;var _0x3d4e38=_0xdcfe[_0x27882c];return _0x3d4e38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedcf('0x0'));var zipdir=require(_0xedcf('0x1'));var jsonpatch=require(_0xedcf('0x2'));var rp=require(_0xedcf('0x3'));var moment=require(_0xedcf('0x4'));var BPromise=require(_0xedcf('0x5'));var Mustache=require(_0xedcf('0x6'));var util=require(_0xedcf('0x7'));var path=require(_0xedcf('0x8'));var sox=require(_0xedcf('0x9'));var csv=require(_0xedcf('0xa'));var ejs=require(_0xedcf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedcf('0xc'));var squel=require(_0xedcf('0xd'));var crypto=require('crypto');var jsforce=require(_0xedcf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0xa'));var querystring=require(_0xedcf('0xf'));var Papa=require(_0xedcf('0x10'));var Redis=require(_0xedcf('0x11'));var authService=require(_0xedcf('0x12'));var qs=require(_0xedcf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedcf('0x14'));var logger=require(_0xedcf('0x15'))(_0xedcf('0x16'));var utils=require(_0xedcf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xedcf('0x18'));var db=require(_0xedcf('0x19'))['db'];function respondWithStatusCode(_0x4853b9,_0x48e353){_0x48e353=_0x48e353||0xcc;return function(_0x3d3330){if(_0x3d3330){return _0x4853b9['sendStatus'](_0x48e353);}return _0x4853b9['status'](_0x48e353)[_0xedcf('0x1a')]();};}function respondWithResult(_0x2d9ea7,_0x45f5f2){_0x45f5f2=_0x45f5f2||0xc8;return function(_0x4b50b2){if(_0x4b50b2){return _0x2d9ea7[_0xedcf('0x1b')](_0x45f5f2)[_0xedcf('0x1c')](_0x4b50b2);}};}function respondWithFilteredResult(_0x2b56e7,_0x3872e2){return function(_0x59ff85){if(_0x59ff85){var _0x31345a=typeof _0x3872e2[_0xedcf('0x1d')]===_0xedcf('0x1e')&&typeof _0x3872e2['limit']===_0xedcf('0x1e');var _0x537767=_0x59ff85[_0xedcf('0x1f')];var _0x2b9907=_0x31345a?0x0:_0x3872e2[_0xedcf('0x1d')];var _0x2b1b3b=_0x31345a?_0x59ff85[_0xedcf('0x1f')]:_0x3872e2[_0xedcf('0x1d')]+_0x3872e2[_0xedcf('0x20')];var _0x37274b;if(_0x2b1b3b>=_0x537767){_0x2b1b3b=_0x537767;_0x37274b=0xc8;}else{_0x37274b=0xce;}_0x2b56e7[_0xedcf('0x1b')](_0x37274b);return _0x2b56e7[_0xedcf('0x21')](_0xedcf('0x22'),_0x2b9907+'-'+_0x2b1b3b+'/'+_0x537767)[_0xedcf('0x1c')](_0x59ff85);}return null;};}function patchUpdates(_0x63947c){return function(_0x4b8b52){try{jsonpatch[_0xedcf('0x23')](_0x4b8b52,_0x63947c,!![]);}catch(_0x4929f7){return BPromise['reject'](_0x4929f7);}return _0x4b8b52[_0xedcf('0x24')]();};}function saveUpdates(_0x2c46dd,_0x6e2533){return function(_0x271adb){if(_0x271adb){return _0x271adb['update'](_0x2c46dd)[_0xedcf('0x25')](function(_0x2c13b0){return _0x2c13b0;});}return null;};}function removeEntity(_0x3a9cac,_0x2257ae){return function(_0x2e0502){if(_0x2e0502){return _0x2e0502[_0xedcf('0x26')]()[_0xedcf('0x25')](function(){_0x3a9cac[_0xedcf('0x1b')](0xcc)[_0xedcf('0x1a')]();});}};}function handleEntityNotFound(_0x1a66e0,_0x2f42d9){return function(_0x45025e){if(!_0x45025e){_0x1a66e0[_0xedcf('0x27')](0x194);}return _0x45025e;};}function handleError(_0x24c6c8,_0x50eb8f){_0x50eb8f=_0x50eb8f||0x1f4;return function(_0x345705){logger[_0xedcf('0x28')](_0x345705[_0xedcf('0x29')]);if(_0x345705[_0xedcf('0x2a')]){delete _0x345705['name'];}_0x24c6c8['status'](_0x50eb8f)[_0xedcf('0x2b')](_0x345705);};}exports[_0xedcf('0x2c')]=function(_0x4e9b28,_0x35d06d){var _0x412bed={},_0x58501c={},_0xdecee5={'count':0x0,'rows':[]};var _0x24e8ce=_[_0xedcf('0x2d')](db[_0xedcf('0x2e')][_0xedcf('0x2f')],function(_0x4f649b){return{'name':_0x4f649b[_0xedcf('0x30')],'type':_0x4f649b['type']['key']};});_0x58501c['model']=_[_0xedcf('0x2d')](_0x24e8ce,_0xedcf('0x2a'));_0x58501c['query']=_['keys'](_0x4e9b28['query']);_0x58501c[_0xedcf('0x31')]=_[_0xedcf('0x32')](_0x58501c[_0xedcf('0x33')],_0x58501c['query']);_0x412bed[_0xedcf('0x34')]=_['intersection'](_0x58501c['model'],qs['fields'](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x36')]));_0x412bed[_0xedcf('0x34')]=_0x412bed[_0xedcf('0x34')][_0xedcf('0x37')]?_0x412bed[_0xedcf('0x34')]:_0x58501c['model'];if(!_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x38')](_0xedcf('0x39'))){_0x412bed[_0xedcf('0x20')]=qs[_0xedcf('0x20')](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x20')]);_0x412bed[_0xedcf('0x1d')]=qs['offset'](_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x1d')]);}_0x412bed['order']=qs[_0xedcf('0x3a')](_0x4e9b28['query'][_0xedcf('0x3a')]);_0x412bed[_0xedcf('0x3b')]=qs[_0xedcf('0x31')](_[_0xedcf('0x3c')](_0x4e9b28[_0xedcf('0x35')],_0x58501c[_0xedcf('0x31')]),_0x24e8ce);if(_0x4e9b28[_0xedcf('0x35')]['filter']){_0x412bed[_0xedcf('0x3b')]=_['merge'](_0x412bed[_0xedcf('0x3b')],{'$or':_[_0xedcf('0x2d')](_0x24e8ce,function(_0x5c3a50){if(_0x5c3a50[_0xedcf('0x3d')]!==_0xedcf('0x3e')){var _0x1aaba9={};_0x1aaba9[_0x5c3a50[_0xedcf('0x2a')]]={'$like':'%'+_0x4e9b28[_0xedcf('0x35')][_0xedcf('0x3f')]+'%'};return _0x1aaba9;}})});}_0x412bed=_[_0xedcf('0x40')]({},_0x412bed,_0x4e9b28[_0xedcf('0x41')]);var _0x1e92d8={'where':_0x412bed[_0xedcf('0x3b')]};return db[_0xedcf('0x2e')]['count'](_0x1e92d8)['then'](function(_0x4ab90f){_0xdecee5[_0xedcf('0x1f')]=_0x4ab90f;if(_0x4e9b28['query'][_0xedcf('0x42')]){_0x412bed[_0xedcf('0x43')]=[{'all':!![]}];}return db[_0xedcf('0x2e')][_0xedcf('0x44')](_0x412bed);})[_0xedcf('0x25')](function(_0x233a33){_0xdecee5[_0xedcf('0x45')]=_0x233a33;return _0xdecee5;})[_0xedcf('0x25')](respondWithFilteredResult(_0x35d06d,_0x412bed))[_0xedcf('0x46')](handleError(_0x35d06d,null));};exports[_0xedcf('0x47')]=function(_0x429c03,_0x232005){var _0x9ab7a0={'raw':!![],'where':{'id':_0x429c03['params']['id']}},_0x30dcd9={};_0x30dcd9[_0xedcf('0x33')]=_[_0xedcf('0x48')](db[_0xedcf('0x2e')][_0xedcf('0x2f')]);_0x30dcd9['query']=_[_0xedcf('0x48')](_0x429c03['query']);_0x30dcd9[_0xedcf('0x31')]=_[_0xedcf('0x32')](_0x30dcd9['model'],_0x30dcd9['query']);_0x9ab7a0[_0xedcf('0x34')]=_[_0xedcf('0x32')](_0x30dcd9[_0xedcf('0x33')],qs[_0xedcf('0x36')](_0x429c03[_0xedcf('0x35')][_0xedcf('0x36')]));_0x9ab7a0[_0xedcf('0x34')]=_0x9ab7a0[_0xedcf('0x34')][_0xedcf('0x37')]?_0x9ab7a0[_0xedcf('0x34')]:_0x30dcd9[_0xedcf('0x33')];if(_0x429c03['query']['includeAll']){_0x9ab7a0[_0xedcf('0x43')]=[{'all':!![]}];}_0x9ab7a0=_[_0xedcf('0x40')]({},_0x9ab7a0,_0x429c03[_0xedcf('0x41')]);return db['SmsApplication'][_0xedcf('0x49')](_0x9ab7a0)[_0xedcf('0x25')](handleEntityNotFound(_0x232005,null))[_0xedcf('0x25')](respondWithResult(_0x232005,null))[_0xedcf('0x46')](handleError(_0x232005,null));};exports[_0xedcf('0x4a')]=function(_0x22d7b8,_0x545000){return db[_0xedcf('0x2e')][_0xedcf('0x4a')](_0x22d7b8['body'],{})['then'](respondWithResult(_0x545000,0xc9))[_0xedcf('0x46')](handleError(_0x545000,null));};exports['update']=function(_0x1f057c,_0x19285b){if(_0x1f057c[_0xedcf('0x4b')]['id']){delete _0x1f057c[_0xedcf('0x4b')]['id'];}return db[_0xedcf('0x2e')][_0xedcf('0x49')]({'where':{'id':_0x1f057c[_0xedcf('0x4c')]['id']}})[_0xedcf('0x25')](handleEntityNotFound(_0x19285b,null))[_0xedcf('0x25')](saveUpdates(_0x1f057c[_0xedcf('0x4b')],null))[_0xedcf('0x25')](respondWithResult(_0x19285b,null))[_0xedcf('0x46')](handleError(_0x19285b,null));};exports[_0xedcf('0x26')]=function(_0x21b21e,_0x4a3ffe){return db[_0xedcf('0x2e')][_0xedcf('0x49')]({'where':{'id':_0x21b21e[_0xedcf('0x4c')]['id']}})[_0xedcf('0x25')](handleEntityNotFound(_0x4a3ffe,null))[_0xedcf('0x25')](removeEntity(_0x4a3ffe,null))['catch'](handleError(_0x4a3ffe,null));}; \ No newline at end of file +var _0xa9b2=['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/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','end','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2c5ec9,_0x4d69fe){var _0x460637=function(_0x3fc7ed){while(--_0x3fc7ed){_0x2c5ec9['push'](_0x2c5ec9['shift']());}};_0x460637(++_0x4d69fe);}(_0xa9b2,0x92));var _0x2a9b=function(_0x54d5c8,_0x344ce5){_0x54d5c8=_0x54d5c8-0x0;var _0x525e2e=_0xa9b2[_0x54d5c8];return _0x525e2e;};'use strict';var emlformat=require(_0x2a9b('0x0'));var rimraf=require(_0x2a9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a9b('0x2'));var rp=require(_0x2a9b('0x3'));var moment=require(_0x2a9b('0x4'));var BPromise=require(_0x2a9b('0x5'));var Mustache=require('mustache');var util=require(_0x2a9b('0x6'));var path=require(_0x2a9b('0x7'));var sox=require(_0x2a9b('0x8'));var csv=require(_0x2a9b('0x9'));var ejs=require(_0x2a9b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a9b('0xb'));var squel=require(_0x2a9b('0xc'));var crypto=require(_0x2a9b('0xd'));var jsforce=require(_0x2a9b('0xe'));var deskjs=require(_0x2a9b('0xf'));var toCsv=require(_0x2a9b('0x9'));var querystring=require(_0x2a9b('0x10'));var Papa=require(_0x2a9b('0x11'));var Redis=require(_0x2a9b('0x12'));var authService=require(_0x2a9b('0x13'));var qs=require(_0x2a9b('0x14'));var as=require(_0x2a9b('0x15'));var hardwareService=require(_0x2a9b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2a9b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2a9b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545d3a,_0x1571c8){_0x1571c8=_0x1571c8||0xcc;return function(_0x18f0a8){if(_0x18f0a8){return _0x545d3a[_0x2a9b('0x19')](_0x1571c8);}return _0x545d3a['status'](_0x1571c8)['end']();};}function respondWithResult(_0x1cc505,_0xd79018){_0xd79018=_0xd79018||0xc8;return function(_0x14efca){if(_0x14efca){return _0x1cc505[_0x2a9b('0x1a')](_0xd79018)['json'](_0x14efca);}};}function respondWithFilteredResult(_0x4815e4,_0x2b387f){return function(_0x32a56f){if(_0x32a56f){var _0x537114=typeof _0x2b387f[_0x2a9b('0x1b')]==='undefined'&&typeof _0x2b387f[_0x2a9b('0x1c')]===_0x2a9b('0x1d');var _0x346173=_0x32a56f[_0x2a9b('0x1e')];var _0x4ed47b=_0x537114?0x0:_0x2b387f['offset'];var _0x209f9a=_0x537114?_0x32a56f[_0x2a9b('0x1e')]:_0x2b387f[_0x2a9b('0x1b')]+_0x2b387f[_0x2a9b('0x1c')];var _0x27f555;if(_0x209f9a>=_0x346173){_0x209f9a=_0x346173;_0x27f555=0xc8;}else{_0x27f555=0xce;}_0x4815e4[_0x2a9b('0x1a')](_0x27f555);return _0x4815e4[_0x2a9b('0x1f')](_0x2a9b('0x20'),_0x4ed47b+'-'+_0x209f9a+'/'+_0x346173)[_0x2a9b('0x21')](_0x32a56f);}return null;};}function patchUpdates(_0x61eec){return function(_0x466437){try{jsonpatch[_0x2a9b('0x22')](_0x466437,_0x61eec,!![]);}catch(_0x69f00){return BPromise['reject'](_0x69f00);}return _0x466437[_0x2a9b('0x23')]();};}function saveUpdates(_0xdc2c84,_0x41c4f3){return function(_0x5a0bf1){if(_0x5a0bf1){return _0x5a0bf1['update'](_0xdc2c84)[_0x2a9b('0x24')](function(_0x212f2d){return _0x212f2d;});}return null;};}function removeEntity(_0x15f51b,_0x56ea17){return function(_0x5194ca){if(_0x5194ca){return _0x5194ca[_0x2a9b('0x25')]()[_0x2a9b('0x24')](function(){_0x15f51b[_0x2a9b('0x1a')](0xcc)[_0x2a9b('0x26')]();});}};}function handleEntityNotFound(_0x3e9907,_0x1be66e){return function(_0x16bb40){if(!_0x16bb40){_0x3e9907[_0x2a9b('0x19')](0x194);}return _0x16bb40;};}function handleError(_0x31b8d1,_0x125711){_0x125711=_0x125711||0x1f4;return function(_0x4e425e){logger[_0x2a9b('0x27')](_0x4e425e[_0x2a9b('0x28')]);if(_0x4e425e[_0x2a9b('0x29')]){delete _0x4e425e['name'];}_0x31b8d1['status'](_0x125711)[_0x2a9b('0x2a')](_0x4e425e);};}exports[_0x2a9b('0x2b')]=function(_0x21f2cc,_0x4f0e72){var _0x35b2af={},_0x2227b8={},_0x4c2e9a={'count':0x0,'rows':[]};var _0x57c15e=_['map'](db[_0x2a9b('0x2c')][_0x2a9b('0x2d')],function(_0x40e22a){return{'name':_0x40e22a[_0x2a9b('0x2e')],'type':_0x40e22a['type'][_0x2a9b('0x2f')]};});_0x2227b8[_0x2a9b('0x30')]=_[_0x2a9b('0x31')](_0x57c15e,'name');_0x2227b8[_0x2a9b('0x32')]=_['keys'](_0x21f2cc[_0x2a9b('0x32')]);_0x2227b8[_0x2a9b('0x33')]=_[_0x2a9b('0x34')](_0x2227b8['model'],_0x2227b8['query']);_0x35b2af[_0x2a9b('0x35')]=_[_0x2a9b('0x34')](_0x2227b8[_0x2a9b('0x30')],qs[_0x2a9b('0x36')](_0x21f2cc['query'][_0x2a9b('0x36')]));_0x35b2af[_0x2a9b('0x35')]=_0x35b2af[_0x2a9b('0x35')][_0x2a9b('0x37')]?_0x35b2af['attributes']:_0x2227b8[_0x2a9b('0x30')];if(!_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x38')](_0x2a9b('0x39'))){_0x35b2af['limit']=qs[_0x2a9b('0x1c')](_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x1c')]);_0x35b2af['offset']=qs[_0x2a9b('0x1b')](_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x1b')]);}_0x35b2af[_0x2a9b('0x3a')]=qs[_0x2a9b('0x3b')](_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x3b')]);_0x35b2af[_0x2a9b('0x3c')]=qs[_0x2a9b('0x33')](_['pick'](_0x21f2cc[_0x2a9b('0x32')],_0x2227b8[_0x2a9b('0x33')]),_0x57c15e);if(_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x3d')]){_0x35b2af['where']=_[_0x2a9b('0x3e')](_0x35b2af[_0x2a9b('0x3c')],{'$or':_['map'](_0x57c15e,function(_0x1ab7a3){if(_0x1ab7a3['type']!==_0x2a9b('0x3f')){var _0x2fde4a={};_0x2fde4a[_0x1ab7a3[_0x2a9b('0x29')]]={'$like':'%'+_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x3d')]+'%'};return _0x2fde4a;}})});}_0x35b2af=_[_0x2a9b('0x3e')]({},_0x35b2af,_0x21f2cc[_0x2a9b('0x40')]);var _0x320789={'where':_0x35b2af[_0x2a9b('0x3c')]};return db[_0x2a9b('0x2c')][_0x2a9b('0x1e')](_0x320789)[_0x2a9b('0x24')](function(_0x2a19c4){_0x4c2e9a[_0x2a9b('0x1e')]=_0x2a19c4;if(_0x21f2cc[_0x2a9b('0x32')][_0x2a9b('0x41')]){_0x35b2af[_0x2a9b('0x42')]=[{'all':!![]}];}return db[_0x2a9b('0x2c')][_0x2a9b('0x43')](_0x35b2af);})[_0x2a9b('0x24')](function(_0x416140){_0x4c2e9a[_0x2a9b('0x44')]=_0x416140;return _0x4c2e9a;})[_0x2a9b('0x24')](respondWithFilteredResult(_0x4f0e72,_0x35b2af))[_0x2a9b('0x45')](handleError(_0x4f0e72,null));};exports[_0x2a9b('0x46')]=function(_0xc70f5b,_0xf6f3f8){var _0x314fb6={'raw':!![],'where':{'id':_0xc70f5b['params']['id']}},_0x24516b={};_0x24516b['model']=_[_0x2a9b('0x47')](db['SmsApplication'][_0x2a9b('0x2d')]);_0x24516b[_0x2a9b('0x32')]=_['keys'](_0xc70f5b[_0x2a9b('0x32')]);_0x24516b['filters']=_[_0x2a9b('0x34')](_0x24516b[_0x2a9b('0x30')],_0x24516b[_0x2a9b('0x32')]);_0x314fb6[_0x2a9b('0x35')]=_[_0x2a9b('0x34')](_0x24516b[_0x2a9b('0x30')],qs['fields'](_0xc70f5b[_0x2a9b('0x32')][_0x2a9b('0x36')]));_0x314fb6[_0x2a9b('0x35')]=_0x314fb6[_0x2a9b('0x35')][_0x2a9b('0x37')]?_0x314fb6[_0x2a9b('0x35')]:_0x24516b[_0x2a9b('0x30')];if(_0xc70f5b['query'][_0x2a9b('0x41')]){_0x314fb6[_0x2a9b('0x42')]=[{'all':!![]}];}_0x314fb6=_[_0x2a9b('0x3e')]({},_0x314fb6,_0xc70f5b['options']);return db[_0x2a9b('0x2c')][_0x2a9b('0x48')](_0x314fb6)['then'](handleEntityNotFound(_0xf6f3f8,null))[_0x2a9b('0x24')](respondWithResult(_0xf6f3f8,null))['catch'](handleError(_0xf6f3f8,null));};exports['create']=function(_0x2a5e76,_0x5c971d){return db[_0x2a9b('0x2c')][_0x2a9b('0x49')](_0x2a5e76['body'],{})['then'](respondWithResult(_0x5c971d,0xc9))[_0x2a9b('0x45')](handleError(_0x5c971d,null));};exports[_0x2a9b('0x4a')]=function(_0x1eb94f,_0x293772){if(_0x1eb94f[_0x2a9b('0x4b')]['id']){delete _0x1eb94f[_0x2a9b('0x4b')]['id'];}return db[_0x2a9b('0x2c')]['find']({'where':{'id':_0x1eb94f['params']['id']}})[_0x2a9b('0x24')](handleEntityNotFound(_0x293772,null))['then'](saveUpdates(_0x1eb94f[_0x2a9b('0x4b')],null))['then'](respondWithResult(_0x293772,null))['catch'](handleError(_0x293772,null));};exports[_0x2a9b('0x25')]=function(_0x3b84bb,_0x4659f7){return db[_0x2a9b('0x2c')][_0x2a9b('0x48')]({'where':{'id':_0x3b84bb['params']['id']}})[_0x2a9b('0x24')](handleEntityNotFound(_0x4659f7,null))[_0x2a9b('0x24')](removeEntity(_0x4659f7,null))[_0x2a9b('0x45')](handleError(_0x4659f7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index c928a78..bf72bb0 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 _0xa50d=['SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define'];(function(_0x4f58f0,_0x41e459){var _0x2819a1=function(_0x2be3de){while(--_0x2be3de){_0x4f58f0['push'](_0x4f58f0['shift']());}};_0x2819a1(++_0x41e459);}(_0xa50d,0x7b));var _0xda50=function(_0xc5cdef,_0x938a4d){_0xc5cdef=_0xc5cdef-0x0;var _0x288c80=_0xa50d[_0xc5cdef];return _0x288c80;};'use strict';var _=require(_0xda50('0x0'));var util=require(_0xda50('0x1'));var logger=require(_0xda50('0x2'))(_0xda50('0x3'));var moment=require(_0xda50('0x4'));var BPromise=require(_0xda50('0x5'));var rp=require(_0xda50('0x6'));var fs=require('fs');var path=require(_0xda50('0x7'));var rimraf=require(_0xda50('0x8'));var config=require('../../config/environment');var attributes=require(_0xda50('0x9'));module[_0xda50('0xa')]=function(_0x17c60d,_0x477de8){return _0x17c60d[_0xda50('0xb')](_0xda50('0xc'),attributes,{'tableName':_0xda50('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda50('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1354=['rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x465aa9,_0x1bf1c8){var _0x4104e4=function(_0x388bb8){while(--_0x388bb8){_0x465aa9['push'](_0x465aa9['shift']());}};_0x4104e4(++_0x1bf1c8);}(_0x1354,0x95));var _0x4135=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0x1354[_0x7a3247];return _0x1bfde5;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var logger=require(_0x4135('0x2'))(_0x4135('0x3'));var moment=require(_0x4135('0x4'));var BPromise=require(_0x4135('0x5'));var rp=require(_0x4135('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4135('0x7'));var config=require(_0x4135('0x8'));var attributes=require(_0x4135('0x9'));module['exports']=function(_0x14ff47,_0x2bcd68){return _0x14ff47['define'](_0x4135('0xa'),attributes,{'tableName':_0x4135('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4135('0xc'),'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 8369fd5..13e7d40 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 _0x1c63=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1c63,0xdc));var _0x31c6=function(_0x25e3d3,_0x1d2882){_0x25e3d3=_0x25e3d3-0x0;var _0x42ad83=_0x1c63[_0x25e3d3];return _0x42ad83;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ac1b7,_0x560053,_0x30185e){return new BPromise(function(_0x184d7d,_0x37cc89){return client[_0x31c6('0xc')](_0x4ac1b7,_0x30185e)[_0x31c6('0xd')](function(_0x487e6e){logger[_0x31c6('0xe')](_0x31c6('0xf'),_0x560053,_0x31c6('0x10'));logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x560053,'request\x20sent',JSON[_0x31c6('0x13')](_0x487e6e));if(_0x487e6e['error']){if(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x15')]===0x1f4){logger['error'](_0x31c6('0xf'),_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x37cc89(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}logger[_0x31c6('0x14')]('SmsApplication,\x20%s,\x20%s',_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x184d7d(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}else{logger[_0x31c6('0xe')]('SmsApplication,\x20%s,\x20%s',_0x560053,'request\x20sent');_0x184d7d(_0x487e6e['result']['message']);}})[_0x31c6('0x17')](function(_0x512d53){logger[_0x31c6('0x14')](_0x31c6('0xf'),_0x560053,_0x512d53);_0x37cc89(_0x512d53);});});} \ No newline at end of file +var _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ac0,0x130));var _0x00ac=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x0ac0[_0x531e48];return _0x202971;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('SmsApplication,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('SmsApplication,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index d6d95b5..c366090 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 _0xb688=['destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','sms'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb688,0xcf));var _0x8b68=function(_0x26b66a,_0x4a91ba){_0x26b66a=_0x26b66a-0x0;var _0x59cfb0=_0xb688[_0x26b66a];return _0x59cfb0;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x14')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x16')]);router[_0x8b68('0x14')]('/:id/tags',auth[_0x8b68('0xc')](),interaction['tracked']('sms',_0x8b68('0x17')),controller[_0x8b68('0x18')]);router[_0x8b68('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x8b68('0x1a')]('sms',_0x8b68('0x1b')),controller[_0x8b68('0x1c')]);router[_0x8b68('0x1d')](_0x8b68('0xe'),auth['isAuthenticated'](),interaction[_0x8b68('0x1a')](_0x8b68('0x1e'),'smsinteraction:destroy'),controller[_0x8b68('0x1f')]);router[_0x8b68('0x1d')](_0x8b68('0x20'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x21')]);module['exports']=router; \ No newline at end of file +var _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5c00,0x17e));var _0x05c0=function(_0xa720e9,_0xf162db){_0xa720e9=_0xa720e9-0x0;var _0x902310=_0x5c00[_0xa720e9];return _0x902310;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 2184cfd..e2c8852 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 _0x7722=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x7722,0x14e));var _0x2772=function(_0x55b79e,_0x3d76b1){_0x55b79e=_0x55b79e-0x0;var _0x3bddaa=_0x7722[_0x55b79e];return _0x3bddaa;};'use strict';var Sequelize=require(_0x2772('0x0'));var moment=require(_0x2772('0x1'));module[_0x2772('0x2')]={'closed':{'type':Sequelize[_0x2772('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2772('0x4')]},'disposition':{'type':Sequelize[_0x2772('0x5')]},'secondDisposition':{'type':Sequelize[_0x2772('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2772('0x5')]},'note':{'type':Sequelize[_0x2772('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2772('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2772('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2772('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2772('0x7')]('in',_0x2772('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2772('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6869=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x5f3d2a,_0x500dcf){var _0xf791ca=function(_0x357672){while(--_0x357672){_0x5f3d2a['push'](_0x5f3d2a['shift']());}};_0xf791ca(++_0x500dcf);}(_0x6869,0xe2));var _0x9686=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6869[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x9686('0x0'));var moment=require(_0x9686('0x1'));module[_0x9686('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9686('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9686('0x4')]},'note':{'type':Sequelize[_0x9686('0x4')]},'phone':{'type':Sequelize[_0x9686('0x4')]},'read1stAt':{'type':Sequelize[_0x9686('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9686('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9686('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9686('0x5')]('in',_0x9686('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 18210ad..5f02a3b 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 _0x8129=['query','user','catch','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','create','body','find','params','addMessage','SmsMessage','ids','findOne','hasOwnProperty','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','push','User','fullname','CmContact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closed','map','out','System','Contact','read','renderFile','views','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','log','err','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','index','SmsInteraction','rawAttributes','fieldName','getOptions','findAll','sms'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8129,0x13b));var _0x9812=function(_0x16b1bb,_0x45d61a){_0x16b1bb=_0x16b1bb-0x0;var _0x1516b2=_0x8129[_0x16b1bb];return _0x1516b2;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x9812('0x0'));var moment=require(_0x9812('0x1'));var BPromise=require(_0x9812('0x2'));var util=require(_0x9812('0x3'));var path=require(_0x9812('0x4'));var ejs=require(_0x9812('0x5'));var fs=require('fs');var _=require(_0x9812('0x6'));var Redis=require('ioredis');var interaction=require(_0x9812('0x7'));var qs=require(_0x9812('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x9812('0x9'))(_0x9812('0xa'));var config=require(_0x9812('0xb'));var db=require(_0x9812('0xc'))['db'];config['redis']=_['defaults'](config[_0x9812('0xd')],{'host':_0x9812('0xe'),'port':0x18eb});var socket=require(_0x9812('0xf'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x14e009,_0x5a6385){_0x5a6385=_0x5a6385||0xcc;return function(_0x48d9e9){if(_0x48d9e9){return _0x14e009['sendStatus'](_0x5a6385);}return _0x14e009[_0x9812('0x10')](_0x5a6385)[_0x9812('0x11')]();};}function respondWithResult(_0x4effb7,_0x42458c){_0x42458c=_0x42458c||0xc8;return function(_0x3d6478){if(_0x3d6478){return _0x4effb7['status'](_0x42458c)[_0x9812('0x12')](_0x3d6478);}};}function respondWithFilteredResult(_0x51eb59,_0x3e7a92){return function(_0xacf543){if(_0xacf543){var _0x5908cf=typeof _0x3e7a92[_0x9812('0x13')]===_0x9812('0x14')&&typeof _0x3e7a92[_0x9812('0x15')]===_0x9812('0x14');var _0x1e67d0=_0xacf543[_0x9812('0x16')];var _0xad175a=_0x5908cf?0x0:_0x3e7a92[_0x9812('0x13')];var _0x17f032=_0x5908cf?_0xacf543['count']:_0x3e7a92['offset']+_0x3e7a92['limit'];var _0x486792;if(_0x17f032>=_0x1e67d0){_0x17f032=_0x1e67d0;_0x486792=0xc8;}else{_0x486792=0xce;}_0x51eb59[_0x9812('0x10')](_0x486792);return _0x51eb59[_0x9812('0x17')](_0x9812('0x18'),_0xad175a+'-'+_0x17f032+'/'+_0x1e67d0)[_0x9812('0x12')](_0xacf543);}return null;};}function saveUpdates(_0x25d3c0){return function(_0x34f37e){if(_0x34f37e){return _0x34f37e[_0x9812('0x19')](_0x25d3c0)[_0x9812('0x1a')](function(_0x19fb15){return _0x19fb15;});}return null;};}function removeEntity(_0x13444e){return function(_0x7f7ef9){if(_0x7f7ef9){return _0x7f7ef9[_0x9812('0x1b')]()[_0x9812('0x1a')](function(){_0x13444e[_0x9812('0x10')](0xcc)[_0x9812('0x11')]();});}};}function handleEntityNotFound(_0x11bfec){return function(_0x445b73){if(!_0x445b73){_0x11bfec[_0x9812('0x1c')](0x194);}return _0x445b73;};}function handleError(_0x2bb316,_0x4e22be){_0x4e22be=_0x4e22be||0x1f4;return function(_0x54dcc0){logger[_0x9812('0x1d')](_0x54dcc0['stack']);if(_0x54dcc0['name']){delete _0x54dcc0[_0x9812('0x1e')];}_0x2bb316[_0x9812('0x10')](_0x4e22be)[_0x9812('0x1f')](_0x54dcc0);};}exports[_0x9812('0x20')]=function(_0x26b89a,_0x37c367){var _0x4510d4={};var _0x3312a3=_['map'](db[_0x9812('0x21')][_0x9812('0x22')],function(_0x453878){return{'name':_0x453878[_0x9812('0x23')],'type':_0x453878['type']['key']};});_0x4510d4=qs[_0x9812('0x24')](_0x3312a3,_0x26b89a);return interaction[_0x9812('0x25')](_0x9812('0x26'),_0x26b89a[_0x9812('0x27')],_0x26b89a[_0x9812('0x28')],_0x4510d4,_0x3312a3)['then'](respondWithFilteredResult(_0x37c367,_0x4510d4))[_0x9812('0x29')](handleError(_0x37c367,null));};exports['show']=function(_0x117ee0,_0x3f87c3){var _0x4c112b={'raw':![],'where':{'id':_0x117ee0['params']['id']}},_0x2777f1={};_0x2777f1[_0x9812('0x2a')]=_[_0x9812('0x2b')](db[_0x9812('0x21')]['rawAttributes']);_0x2777f1[_0x9812('0x27')]=_['keys'](_0x117ee0[_0x9812('0x27')]);_0x2777f1[_0x9812('0x2c')]=_['intersection'](_0x2777f1[_0x9812('0x2a')],_0x2777f1['query']);_0x4c112b[_0x9812('0x2d')]=_[_0x9812('0x2e')](_0x2777f1[_0x9812('0x2a')],qs[_0x9812('0x2f')](_0x117ee0[_0x9812('0x27')]['fields']));_0x4c112b[_0x9812('0x2d')]=_0x4c112b[_0x9812('0x2d')][_0x9812('0x30')]?_0x4c112b[_0x9812('0x2d')]:_0x2777f1[_0x9812('0x2a')];if(_0x117ee0[_0x9812('0x27')][_0x9812('0x31')]){_0x4c112b['include']=[{'all':!![]}];}_0x4c112b=_[_0x9812('0x32')]({},_0x4c112b,_0x117ee0[_0x9812('0x33')]);return db['SmsInteraction']['find'](_0x4c112b)[_0x9812('0x1a')](handleEntityNotFound(_0x3f87c3,null))[_0x9812('0x1a')](respondWithResult(_0x3f87c3,null))[_0x9812('0x29')](handleError(_0x3f87c3,null));};exports[_0x9812('0x34')]=function(_0x2ff29e,_0x16607f){return db[_0x9812('0x21')]['create'](_0x2ff29e[_0x9812('0x35')],{})[_0x9812('0x1a')](respondWithResult(_0x16607f,0xc9))[_0x9812('0x29')](handleError(_0x16607f,null));};exports['update']=function(_0x29357a,_0x43df78){if(_0x29357a[_0x9812('0x35')]['id']){delete _0x29357a[_0x9812('0x35')]['id'];}return db['SmsInteraction'][_0x9812('0x36')]({'where':{'id':_0x29357a[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x43df78,null))[_0x9812('0x1a')](saveUpdates(_0x29357a['body'],null))['then'](respondWithResult(_0x43df78,null))['catch'](handleError(_0x43df78,null));};exports['destroy']=function(_0x4a8774,_0x37d4b1){return db[_0x9812('0x21')][_0x9812('0x36')]({'where':{'id':_0x4a8774[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x37d4b1,null))['then'](removeEntity(_0x37d4b1,null))[_0x9812('0x29')](handleError(_0x37d4b1,null));};exports['describe']=function(_0x57bd48,_0x432aee){return db[_0x9812('0x21')]['describe']()[_0x9812('0x1a')](respondWithResult(_0x432aee,null))[_0x9812('0x29')](handleError(_0x432aee,null));};exports[_0x9812('0x38')]=function(_0x441050,_0x25ef89){return db[_0x9812('0x39')]['find']({'where':{'id':_0x441050['params']['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x25ef89,null))[_0x9812('0x1a')](function(_0x4e8119){if(_0x4e8119){return _0x4e8119[_0x9812('0x38')](_0x441050[_0x9812('0x35')][_0x9812('0x3a')],_['omit'](_0x441050[_0x9812('0x35')],[_0x9812('0x3a'),'id'])||{});}})[_0x9812('0x1a')](respondWithResult(_0x25ef89,null))[_0x9812('0x29')](handleError(_0x25ef89,null));};exports['getMessages']=function(_0xf8b7fc,_0x5989b4){var _0x59ff25={'raw':![],'where':{}};var _0x19720b={};var _0x5f0419={'count':0x0,'rows':[]};return db[_0x9812('0x21')][_0x9812('0x3b')]({'where':{'id':_0xf8b7fc[_0x9812('0x37')]['id']}})[_0x9812('0x1a')](handleEntityNotFound(_0x5989b4,null))['then'](function(_0x2d5663){if(_0x2d5663){_0x19720b[_0x9812('0x2a')]=_[_0x9812('0x2b')](db['SmsMessage'][_0x9812('0x22')]);_0x19720b[_0x9812('0x27')]=_['keys'](_0xf8b7fc[_0x9812('0x27')]);_0x19720b[_0x9812('0x2c')]=_[_0x9812('0x2e')](_0x19720b[_0x9812('0x2a')],_0x19720b[_0x9812('0x27')]);_0x59ff25[_0x9812('0x2d')]=_['intersection'](_0x19720b['model'],qs['fields'](_0xf8b7fc[_0x9812('0x27')]['fields']));_0x59ff25[_0x9812('0x2d')]=_0x59ff25[_0x9812('0x2d')][_0x9812('0x30')]?_0x59ff25['attributes']:_0x19720b['model'];if(!_0xf8b7fc[_0x9812('0x27')][_0x9812('0x3c')]('nolimit')){_0x59ff25['limit']=qs['limit'](_0xf8b7fc[_0x9812('0x27')][_0x9812('0x15')]);_0x59ff25[_0x9812('0x13')]=qs[_0x9812('0x13')](_0xf8b7fc[_0x9812('0x27')][_0x9812('0x13')]);}_0x59ff25[_0x9812('0x3d')]=qs['sort'](_0xf8b7fc['query'][_0x9812('0x3e')]);_0x59ff25[_0x9812('0x3f')]=qs['filters'](_['pick'](_0xf8b7fc['query'],_0x19720b[_0x9812('0x2c')]));_0x59ff25['where'][_0x9812('0x40')]=_0x2d5663['id'];if(_0xf8b7fc[_0x9812('0x27')][_0x9812('0x41')]){_0x59ff25[_0x9812('0x3f')]=_['merge'](_0x59ff25[_0x9812('0x3f')],{'$or':_['map'](_0x59ff25[_0x9812('0x2d')],function(_0x5a1a20){var _0xcf6fc6={};_0xcf6fc6[_0x5a1a20]={'$like':'%'+_0xf8b7fc['query'][_0x9812('0x41')]+'%'};return _0xcf6fc6;})});}if(_0xf8b7fc[_0x9812('0x27')]['$gte']){var _0x4aefc2=_0xf8b7fc['query'][_0x9812('0x42')][_0x9812('0x43')](',');var _0x5d11e0={};_0x5d11e0[_0x4aefc2[0x0]]={'$gte':moment(_0x4aefc2[0x1])[_0x9812('0x44')](_0x9812('0x45'))};_0x59ff25[_0x9812('0x3f')]=_['merge'](_0x59ff25[_0x9812('0x3f')],_0x5d11e0);}_0x59ff25=_[_0x9812('0x32')]({},_0x59ff25,_0xf8b7fc[_0x9812('0x33')]);return db[_0x9812('0x39')]['count']({'where':_0x59ff25[_0x9812('0x3f')]})['then'](function(_0xcf7dc6){_0x5f0419[_0x9812('0x16')]=_0xcf7dc6;if(_0xf8b7fc[_0x9812('0x27')][_0x9812('0x31')]){_0x59ff25[_0x9812('0x46')]=[{'all':!![]}];}return db['SmsMessage'][_0x9812('0x25')](_0x59ff25);})[_0x9812('0x1a')](function(_0x6ef7d1){_0x5f0419[_0x9812('0x47')]=_0x6ef7d1;return _0x5f0419;});}})[_0x9812('0x1a')](respondWithFilteredResult(_0x5989b4,_0x59ff25))[_0x9812('0x29')](handleError(_0x5989b4,null));};exports[_0x9812('0x48')]=function(_0x249227,_0x5490af){return db[_0x9812('0x21')][_0x9812('0x36')]({'where':{'id':_0x249227[_0x9812('0x37')]['id']}})['then'](handleEntityNotFound(_0x5490af,null))[_0x9812('0x1a')](function(_0x10d597){if(_0x10d597){return _0x10d597['setTags'](_0x249227['body'][_0x9812('0x3a')],_[_0x9812('0x49')](_0x249227[_0x9812('0x35')],['ids','id'])||{})[_0x9812('0x4a')](function(){return db[_0x9812('0x4b')][_0x9812('0x25')]({'attributes':['id','name',_0x9812('0x4c')],'where':{'id':_0x249227[_0x9812('0x35')][_0x9812('0x3a')]}});})[_0x9812('0x1a')](function(_0x2f7168){socket[_0x9812('0x4d')](_0x9812('0x4e'),{'id':Number(_0x249227[_0x9812('0x37')]['id']),'tags':_0x2f7168||[]});return{'id':Number(_0x249227['params']['id']),'tags':_0x2f7168||[]};});}})[_0x9812('0x1a')](respondWithResult(_0x5490af,null))['catch'](handleError(_0x5490af,null));};exports['removeTags']=function(_0x327fae,_0x2b865b){return db['SmsInteraction']['find']({'where':{'id':_0x327fae['params']['id']}})['then'](handleEntityNotFound(_0x2b865b,null))[_0x9812('0x1a')](function(_0x12f378){if(_0x12f378){return _0x12f378[_0x9812('0x4f')](_0x327fae['query'][_0x9812('0x3a')]);}})[_0x9812('0x1a')](respondWithStatusCode(_0x2b865b,null))[_0x9812('0x29')](handleError(_0x2b865b,null));};exports[_0x9812('0x50')]=function(_0x3755fc,_0x17e798){var _0x31cd14=moment()[_0x9812('0x51')]()[_0x9812('0x52')]();var _0x1c708f=path[_0x9812('0x53')](config[_0x9812('0x54')],_0x9812('0x55'),_0x9812('0x56'),_0x9812('0x57'));var _0x2324bc=path[_0x9812('0x53')](_0x1c708f,_0x31cd14);var _0x3af487=util[_0x9812('0x44')]('transcript-%d-%s.zip',_0x3755fc[_0x9812('0x37')]['id'],_0x31cd14);var _0x595f68=path[_0x9812('0x53')](_0x1c708f,_0x3af487);var _0x351ab9=[];_0x351ab9[_0x9812('0x58')]({'model':db[_0x9812('0x59')],'as':_0x9812('0x59'),'attributes':['id',_0x9812('0x5a')],'raw':!![]});_0x351ab9['push']({'model':db[_0x9812('0x5b')],'as':'Contact','attributes':['id',_0x9812('0x5c'),_0x9812('0x5d')],'raw':!![]});var _0x403a72=[{'model':db['SmsMessage'],'as':_0x9812('0x5e'),'attributes':['id',_0x9812('0x35'),_0x9812('0x5f'),_0x9812('0x60'),_0x9812('0x61'),'read'],'include':_0x351ab9}];_0x403a72['push']({'model':db[_0x9812('0x62')],'as':_0x9812('0x63'),'attributes':['id','name']});_0x403a72[_0x9812('0x58')]({'model':db[_0x9812('0x59')],'as':_0x9812('0x64'),'attributes':['id',_0x9812('0x5a')]});return db[_0x9812('0x21')]['find']({'where':{'id':_0x3755fc[_0x9812('0x37')]['id']},'include':_0x403a72})[_0x9812('0x1a')](handleEntityNotFound(_0x17e798,null))['then'](function(_0x4c788e){if(_0x4c788e){var _0x1f1105=_0x4c788e[_0x9812('0x65')]({'plain':!![]});fs[_0x9812('0x66')](_0x2324bc);var _0x11b40f={'channel':'Sms','account':_0x1f1105[_0x9812('0x63')]['name'],'agent':_0x1f1105[_0x9812('0x64')]?_0x1f1105[_0x9812('0x64')][_0x9812('0x5a')]:_0x9812('0x67'),'createdAt':moment(_0x1f1105[_0x9812('0x5f')])[_0x9812('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1f1105[_0x9812('0x68')]?moment(_0x1f1105['closedAt'])[_0x9812('0x44')](_0x9812('0x45'))[_0x9812('0x52')]():'','disposition':_0x1f1105['disposition'],'messages':_(_0x1f1105[_0x9812('0x5e')])[_0x9812('0x41')]({'secret':![]})[_0x9812('0x69')](function(_0x2e10eb){return{'date':moment(_0x2e10eb[_0x9812('0x5f')])[_0x9812('0x44')](_0x9812('0x45'))[_0x9812('0x52')](),'sender':_0x2e10eb['direction']===_0x9812('0x6a')?_0x2e10eb[_0x9812('0x59')]?_0x2e10eb[_0x9812('0x59')][_0x9812('0x5a')]:_0x9812('0x6b'):_0x2e10eb['Contact'][_0x9812('0x5c')]+(_0x2e10eb[_0x9812('0x6c')][_0x9812('0x5d')]?'\x20'+_0x2e10eb[_0x9812('0x6c')][_0x9812('0x5d')]:''),'body':_0x2e10eb[_0x9812('0x35')],'direction':_0x2e10eb['direction']==='out'?'A':'C','secret':_0x2e10eb['secret'],'read':_0x2e10eb[_0x9812('0x6d')]};})['value']()};return ejs[_0x9812('0x6e')](path[_0x9812('0x53')](config[_0x9812('0x54')],_0x9812('0x55'),_0x9812('0x6f'),_0x9812('0x70')),{'interaction':_0x11b40f})[_0x9812('0x1a')](function(_0x9fe0f2){var _0x342223=path['join'](_0x2324bc,_0x9812('0x71')+_0x1f1105['id']+'-'+_0x31cd14+'.pdf');var _0x2bae8f={'path':_0x342223,'channel':_0x9812('0x72'),'interactionId':_0x1f1105['id']};return pdf[_0x9812('0x73')](_0x9fe0f2,_0x2bae8f);})[_0x9812('0x1a')](function(){return new BPromise(function(_0x8faa7d,_0x432de1){zipdir(_0x2324bc,{'saveTo':_0x595f68},function(_0x26bd5b,_0x2d9fbc){if(_0x26bd5b)return _0x432de1(_0x26bd5b);return _0x8faa7d(_0x2d9fbc);});})[_0x9812('0x1a')](function(){return new BPromise(function(_0xdbcd9e,_0xeb952f){rimraf(_0x2324bc,function(_0x17a82a){if(_0x17a82a)_0xeb952f(_0x17a82a);return _0xdbcd9e();});});})[_0x9812('0x1a')](function(){return _0x17e798['download'](_0x595f68,_0x3af487,function(_0x404926){if(_0x404926){console[_0x9812('0x74')](_0x9812('0x75'),_0x404926);}else{fs['unlinkSync'](_0x595f68);}});});});}else{return _0x17e798[_0x9812('0x1c')](0xc8);}})[_0x9812('0x29')](handleError(_0x17e798,null));}; \ No newline at end of file +var _0xdbdc=['views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/export/pdf','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','getOptions','findAll','sms','query','user','show','params','keys','model','attributes','intersection','fields','includeAll','include','merge','SmsInteraction','find','catch','create','body','describe','addMessage','SmsMessage','ids','findOne','length','hasOwnProperty','nolimit','order','sort','where','filters','SmsInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','emit','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','CmContact','lastName','Messages','direction','secret','read','push','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','format','disposition','createdAt','System','Contact','firstName','out','value','renderFile'];(function(_0x40d69c,_0x17a711){var _0xb7f3c=function(_0x3fd9d4){while(--_0x3fd9d4){_0x40d69c['push'](_0x40d69c['shift']());}};_0xb7f3c(++_0x17a711);}(_0xdbdc,0xfb));var _0xcdbd=function(_0x2ac660,_0x3cdbd8){_0x2ac660=_0x2ac660-0x0;var _0x54e9a6=_0xdbdc[_0x2ac660];return _0x54e9a6;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcdbd('0x0'));var moment=require(_0xcdbd('0x1'));var BPromise=require(_0xcdbd('0x2'));var util=require(_0xcdbd('0x3'));var path=require(_0xcdbd('0x4'));var ejs=require(_0xcdbd('0x5'));var fs=require('fs');var _=require(_0xcdbd('0x6'));var Redis=require(_0xcdbd('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xcdbd('0x8'));var logger=require('../../config/logger')(_0xcdbd('0x9'));var config=require(_0xcdbd('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcdbd('0xb')](config[_0xcdbd('0xc')],{'host':_0xcdbd('0xd'),'port':0x18eb});var socket=require(_0xcdbd('0xe'))(new Redis(config[_0xcdbd('0xc')]));require('./smsInteraction.socket')[_0xcdbd('0xf')](socket);function respondWithStatusCode(_0x2eca4d,_0x2b03d7){_0x2b03d7=_0x2b03d7||0xcc;return function(_0x103fb7){if(_0x103fb7){return _0x2eca4d[_0xcdbd('0x10')](_0x2b03d7);}return _0x2eca4d['status'](_0x2b03d7)[_0xcdbd('0x11')]();};}function respondWithResult(_0x1513c5,_0x534f8b){_0x534f8b=_0x534f8b||0xc8;return function(_0x6dc162){if(_0x6dc162){return _0x1513c5['status'](_0x534f8b)[_0xcdbd('0x12')](_0x6dc162);}};}function respondWithFilteredResult(_0x3cba8e,_0x46831){return function(_0x35e019){if(_0x35e019){var _0x341068=typeof _0x46831[_0xcdbd('0x13')]===_0xcdbd('0x14')&&typeof _0x46831[_0xcdbd('0x15')]===_0xcdbd('0x14');var _0x448ad4=_0x35e019[_0xcdbd('0x16')];var _0x26bc0b=_0x341068?0x0:_0x46831[_0xcdbd('0x13')];var _0x4fe5c4=_0x341068?_0x35e019['count']:_0x46831[_0xcdbd('0x13')]+_0x46831[_0xcdbd('0x15')];var _0x209237;if(_0x4fe5c4>=_0x448ad4){_0x4fe5c4=_0x448ad4;_0x209237=0xc8;}else{_0x209237=0xce;}_0x3cba8e['status'](_0x209237);return _0x3cba8e[_0xcdbd('0x17')](_0xcdbd('0x18'),_0x26bc0b+'-'+_0x4fe5c4+'/'+_0x448ad4)[_0xcdbd('0x12')](_0x35e019);}return null;};}function saveUpdates(_0x1c9d6c){return function(_0x5972ed){if(_0x5972ed){return _0x5972ed[_0xcdbd('0x19')](_0x1c9d6c)[_0xcdbd('0x1a')](function(_0x3f7ae1){return _0x3f7ae1;});}return null;};}function removeEntity(_0x23682c){return function(_0x56f235){if(_0x56f235){return _0x56f235[_0xcdbd('0x1b')]()[_0xcdbd('0x1a')](function(){_0x23682c['status'](0xcc)[_0xcdbd('0x11')]();});}};}function handleEntityNotFound(_0x3bc75d){return function(_0x43e754){if(!_0x43e754){_0x3bc75d[_0xcdbd('0x10')](0x194);}return _0x43e754;};}function handleError(_0x2f6dcc,_0x3bea4b){_0x3bea4b=_0x3bea4b||0x1f4;return function(_0xfc86ca){logger[_0xcdbd('0x1c')](_0xfc86ca[_0xcdbd('0x1d')]);if(_0xfc86ca[_0xcdbd('0x1e')]){delete _0xfc86ca[_0xcdbd('0x1e')];}_0x2f6dcc['status'](_0x3bea4b)[_0xcdbd('0x1f')](_0xfc86ca);};}exports['index']=function(_0xf51a54,_0x2db014){var _0x3519a6={};var _0x1e82c4=_[_0xcdbd('0x20')](db['SmsInteraction'][_0xcdbd('0x21')],function(_0x92333){return{'name':_0x92333['fieldName'],'type':_0x92333[_0xcdbd('0x22')][_0xcdbd('0x23')]};});_0x3519a6=qs[_0xcdbd('0x24')](_0x1e82c4,_0xf51a54);return interaction[_0xcdbd('0x25')](_0xcdbd('0x26'),_0xf51a54[_0xcdbd('0x27')],_0xf51a54[_0xcdbd('0x28')],_0x3519a6,_0x1e82c4)[_0xcdbd('0x1a')](respondWithFilteredResult(_0x2db014,_0x3519a6))['catch'](handleError(_0x2db014,null));};exports[_0xcdbd('0x29')]=function(_0x32237a,_0x3242a5){var _0xc04e2={'raw':![],'where':{'id':_0x32237a[_0xcdbd('0x2a')]['id']}},_0x44b179={};_0x44b179['model']=_[_0xcdbd('0x2b')](db['SmsInteraction']['rawAttributes']);_0x44b179[_0xcdbd('0x27')]=_['keys'](_0x32237a[_0xcdbd('0x27')]);_0x44b179['filters']=_['intersection'](_0x44b179[_0xcdbd('0x2c')],_0x44b179[_0xcdbd('0x27')]);_0xc04e2[_0xcdbd('0x2d')]=_[_0xcdbd('0x2e')](_0x44b179[_0xcdbd('0x2c')],qs[_0xcdbd('0x2f')](_0x32237a['query']['fields']));_0xc04e2[_0xcdbd('0x2d')]=_0xc04e2['attributes']['length']?_0xc04e2['attributes']:_0x44b179['model'];if(_0x32237a['query'][_0xcdbd('0x30')]){_0xc04e2[_0xcdbd('0x31')]=[{'all':!![]}];}_0xc04e2=_[_0xcdbd('0x32')]({},_0xc04e2,_0x32237a['options']);return db[_0xcdbd('0x33')][_0xcdbd('0x34')](_0xc04e2)[_0xcdbd('0x1a')](handleEntityNotFound(_0x3242a5,null))['then'](respondWithResult(_0x3242a5,null))[_0xcdbd('0x35')](handleError(_0x3242a5,null));};exports[_0xcdbd('0x36')]=function(_0x28b0e8,_0x17742a){return db[_0xcdbd('0x33')]['create'](_0x28b0e8['body'],{})[_0xcdbd('0x1a')](respondWithResult(_0x17742a,0xc9))[_0xcdbd('0x35')](handleError(_0x17742a,null));};exports[_0xcdbd('0x19')]=function(_0x4b1002,_0x5641b8){if(_0x4b1002[_0xcdbd('0x37')]['id']){delete _0x4b1002['body']['id'];}return db[_0xcdbd('0x33')][_0xcdbd('0x34')]({'where':{'id':_0x4b1002[_0xcdbd('0x2a')]['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0x5641b8,null))[_0xcdbd('0x1a')](saveUpdates(_0x4b1002[_0xcdbd('0x37')],null))[_0xcdbd('0x1a')](respondWithResult(_0x5641b8,null))['catch'](handleError(_0x5641b8,null));};exports[_0xcdbd('0x1b')]=function(_0x2b8ed3,_0x5435f2){return db[_0xcdbd('0x33')][_0xcdbd('0x34')]({'where':{'id':_0x2b8ed3['params']['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0x5435f2,null))[_0xcdbd('0x1a')](removeEntity(_0x5435f2,null))[_0xcdbd('0x35')](handleError(_0x5435f2,null));};exports[_0xcdbd('0x38')]=function(_0x289091,_0x4a63fa){return db[_0xcdbd('0x33')]['describe']()[_0xcdbd('0x1a')](respondWithResult(_0x4a63fa,null))[_0xcdbd('0x35')](handleError(_0x4a63fa,null));};exports[_0xcdbd('0x39')]=function(_0x252cf7,_0x4d49b7){return db[_0xcdbd('0x3a')][_0xcdbd('0x34')]({'where':{'id':_0x252cf7['params']['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0x4d49b7,null))[_0xcdbd('0x1a')](function(_0xc8275c){if(_0xc8275c){return _0xc8275c[_0xcdbd('0x39')](_0x252cf7[_0xcdbd('0x37')][_0xcdbd('0x3b')],_['omit'](_0x252cf7['body'],[_0xcdbd('0x3b'),'id'])||{});}})[_0xcdbd('0x1a')](respondWithResult(_0x4d49b7,null))[_0xcdbd('0x35')](handleError(_0x4d49b7,null));};exports['getMessages']=function(_0x3e790c,_0xa4ae7b){var _0x22ac25={'raw':![],'where':{}};var _0x275274={};var _0x2b5929={'count':0x0,'rows':[]};return db[_0xcdbd('0x33')][_0xcdbd('0x3c')]({'where':{'id':_0x3e790c['params']['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0xa4ae7b,null))[_0xcdbd('0x1a')](function(_0xd50d46){if(_0xd50d46){_0x275274[_0xcdbd('0x2c')]=_['keys'](db[_0xcdbd('0x3a')][_0xcdbd('0x21')]);_0x275274[_0xcdbd('0x27')]=_[_0xcdbd('0x2b')](_0x3e790c['query']);_0x275274['filters']=_[_0xcdbd('0x2e')](_0x275274[_0xcdbd('0x2c')],_0x275274['query']);_0x22ac25[_0xcdbd('0x2d')]=_[_0xcdbd('0x2e')](_0x275274['model'],qs[_0xcdbd('0x2f')](_0x3e790c[_0xcdbd('0x27')]['fields']));_0x22ac25[_0xcdbd('0x2d')]=_0x22ac25[_0xcdbd('0x2d')][_0xcdbd('0x3d')]?_0x22ac25['attributes']:_0x275274[_0xcdbd('0x2c')];if(!_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x3e')](_0xcdbd('0x3f'))){_0x22ac25[_0xcdbd('0x15')]=qs[_0xcdbd('0x15')](_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x15')]);_0x22ac25[_0xcdbd('0x13')]=qs[_0xcdbd('0x13')](_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x13')]);}_0x22ac25[_0xcdbd('0x40')]=qs[_0xcdbd('0x41')](_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x41')]);_0x22ac25[_0xcdbd('0x42')]=qs['filters'](_['pick'](_0x3e790c[_0xcdbd('0x27')],_0x275274[_0xcdbd('0x43')]));_0x22ac25[_0xcdbd('0x42')][_0xcdbd('0x44')]=_0xd50d46['id'];if(_0x3e790c[_0xcdbd('0x27')]['filter']){_0x22ac25['where']=_['merge'](_0x22ac25[_0xcdbd('0x42')],{'$or':_[_0xcdbd('0x20')](_0x22ac25[_0xcdbd('0x2d')],function(_0x18e3d9){var _0x5d22b1={};_0x5d22b1[_0x18e3d9]={'$like':'%'+_0x3e790c['query']['filter']+'%'};return _0x5d22b1;})});}if(_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x45')]){var _0x32c499=_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x45')][_0xcdbd('0x46')](',');var _0x3b21fb={};_0x3b21fb[_0x32c499[0x0]]={'$gte':moment(_0x32c499[0x1])['format'](_0xcdbd('0x47'))};_0x22ac25[_0xcdbd('0x42')]=_[_0xcdbd('0x32')](_0x22ac25[_0xcdbd('0x42')],_0x3b21fb);}_0x22ac25=_[_0xcdbd('0x32')]({},_0x22ac25,_0x3e790c['options']);return db[_0xcdbd('0x3a')]['count']({'where':_0x22ac25['where']})[_0xcdbd('0x1a')](function(_0x8b8900){_0x2b5929[_0xcdbd('0x16')]=_0x8b8900;if(_0x3e790c[_0xcdbd('0x27')][_0xcdbd('0x30')]){_0x22ac25[_0xcdbd('0x31')]=[{'all':!![]}];}return db['SmsMessage'][_0xcdbd('0x25')](_0x22ac25);})['then'](function(_0x2bf9e5){_0x2b5929[_0xcdbd('0x48')]=_0x2bf9e5;return _0x2b5929;});}})[_0xcdbd('0x1a')](respondWithFilteredResult(_0xa4ae7b,_0x22ac25))['catch'](handleError(_0xa4ae7b,null));};exports['addTags']=function(_0x4c2966,_0x3876bf){return db[_0xcdbd('0x33')][_0xcdbd('0x34')]({'where':{'id':_0x4c2966['params']['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0x3876bf,null))['then'](function(_0x2653bb){if(_0x2653bb){return _0x2653bb[_0xcdbd('0x49')](_0x4c2966[_0xcdbd('0x37')]['ids'],_['omit'](_0x4c2966[_0xcdbd('0x37')],[_0xcdbd('0x3b'),'id'])||{})[_0xcdbd('0x4a')](function(){return db[_0xcdbd('0x4b')][_0xcdbd('0x25')]({'attributes':['id',_0xcdbd('0x1e'),'color'],'where':{'id':_0x4c2966['body'][_0xcdbd('0x3b')]}});})[_0xcdbd('0x1a')](function(_0x3267f5){socket[_0xcdbd('0x4c')]('smsInteractionTags:save',{'id':Number(_0x4c2966['params']['id']),'tags':_0x3267f5||[]});return{'id':Number(_0x4c2966[_0xcdbd('0x2a')]['id']),'tags':_0x3267f5||[]};});}})[_0xcdbd('0x1a')](respondWithResult(_0x3876bf,null))[_0xcdbd('0x35')](handleError(_0x3876bf,null));};exports['removeTags']=function(_0x56beca,_0x2d33fb){return db[_0xcdbd('0x33')][_0xcdbd('0x34')]({'where':{'id':_0x56beca[_0xcdbd('0x2a')]['id']}})[_0xcdbd('0x1a')](handleEntityNotFound(_0x2d33fb,null))[_0xcdbd('0x1a')](function(_0x351b64){if(_0x351b64){return _0x351b64[_0xcdbd('0x4d')](_0x56beca[_0xcdbd('0x27')]['ids']);}})[_0xcdbd('0x1a')](respondWithStatusCode(_0x2d33fb,null))[_0xcdbd('0x35')](handleError(_0x2d33fb,null));};exports['download']=function(_0x4738cc,_0xa48de){var _0x24277=moment()[_0xcdbd('0x4e')]()[_0xcdbd('0x4f')]();var _0x4d3dde=path[_0xcdbd('0x50')](config[_0xcdbd('0x51')],_0xcdbd('0x52'),_0xcdbd('0x53'),_0xcdbd('0x54'));var _0x3a3ef2=path[_0xcdbd('0x50')](_0x4d3dde,_0x24277);var _0x29a8dc=util['format'](_0xcdbd('0x55'),_0x4738cc[_0xcdbd('0x2a')]['id'],_0x24277);var _0x18ae81=path[_0xcdbd('0x50')](_0x4d3dde,_0x29a8dc);var _0x29fc99=[];_0x29fc99['push']({'model':db[_0xcdbd('0x56')],'as':'User','attributes':['id',_0xcdbd('0x57')],'raw':!![]});_0x29fc99['push']({'model':db[_0xcdbd('0x58')],'as':'Contact','attributes':['id','firstName',_0xcdbd('0x59')],'raw':!![]});var _0x37c273=[{'model':db['SmsMessage'],'as':_0xcdbd('0x5a'),'attributes':['id',_0xcdbd('0x37'),'createdAt',_0xcdbd('0x5b'),_0xcdbd('0x5c'),_0xcdbd('0x5d')],'include':_0x29fc99}];_0x37c273[_0xcdbd('0x5e')]({'model':db[_0xcdbd('0x5f')],'as':_0xcdbd('0x60'),'attributes':['id',_0xcdbd('0x1e')]});_0x37c273['push']({'model':db[_0xcdbd('0x56')],'as':_0xcdbd('0x61'),'attributes':['id',_0xcdbd('0x57')]});return db['SmsInteraction'][_0xcdbd('0x34')]({'where':{'id':_0x4738cc[_0xcdbd('0x2a')]['id']},'include':_0x37c273})[_0xcdbd('0x1a')](handleEntityNotFound(_0xa48de,null))[_0xcdbd('0x1a')](function(_0x18e864){if(_0x18e864){var _0x1b28ad=_0x18e864[_0xcdbd('0x62')]({'plain':!![]});fs['mkdirSync'](_0x3a3ef2);var _0x32bf38={'channel':_0xcdbd('0x63'),'account':_0x1b28ad[_0xcdbd('0x60')][_0xcdbd('0x1e')],'agent':_0x1b28ad[_0xcdbd('0x61')]?_0x1b28ad[_0xcdbd('0x61')][_0xcdbd('0x57')]:_0xcdbd('0x64'),'createdAt':moment(_0x1b28ad['createdAt'])['format'](_0xcdbd('0x47'))[_0xcdbd('0x4f')](),'closedAt':_0x1b28ad[_0xcdbd('0x65')]?moment(_0x1b28ad[_0xcdbd('0x66')])[_0xcdbd('0x67')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1b28ad[_0xcdbd('0x68')],'messages':_(_0x1b28ad[_0xcdbd('0x5a')])['filter']({'secret':![]})[_0xcdbd('0x20')](function(_0x1d0351){return{'date':moment(_0x1d0351[_0xcdbd('0x69')])[_0xcdbd('0x67')](_0xcdbd('0x47'))['toString'](),'sender':_0x1d0351[_0xcdbd('0x5b')]==='out'?_0x1d0351[_0xcdbd('0x56')]?_0x1d0351[_0xcdbd('0x56')]['fullname']:_0xcdbd('0x6a'):_0x1d0351[_0xcdbd('0x6b')][_0xcdbd('0x6c')]+(_0x1d0351[_0xcdbd('0x6b')][_0xcdbd('0x59')]?'\x20'+_0x1d0351[_0xcdbd('0x6b')]['lastName']:''),'body':_0x1d0351[_0xcdbd('0x37')],'direction':_0x1d0351[_0xcdbd('0x5b')]===_0xcdbd('0x6d')?'A':'C','secret':_0x1d0351[_0xcdbd('0x5c')],'read':_0x1d0351[_0xcdbd('0x5d')]};})[_0xcdbd('0x6e')]()};return ejs[_0xcdbd('0x6f')](path['join'](config[_0xcdbd('0x51')],'server',_0xcdbd('0x70'),_0xcdbd('0x71')),{'interaction':_0x32bf38})[_0xcdbd('0x1a')](function(_0xd51ed8){var _0x560ebc=path[_0xcdbd('0x50')](_0x3a3ef2,_0xcdbd('0x72')+_0x1b28ad['id']+'-'+_0x24277+_0xcdbd('0x73'));var _0x75bb7={'path':_0x560ebc,'channel':_0xcdbd('0x63'),'interactionId':_0x1b28ad['id']};return pdf[_0xcdbd('0x74')](_0xd51ed8,_0x75bb7);})[_0xcdbd('0x1a')](function(){return new BPromise(function(_0x2a4bb9,_0xbf04fd){zipdir(_0x3a3ef2,{'saveTo':_0x18ae81},function(_0x99d9ea,_0x389bb6){if(_0x99d9ea)return _0xbf04fd(_0x99d9ea);return _0x2a4bb9(_0x389bb6);});})['then'](function(){return new BPromise(function(_0x36fa64,_0x9a2848){rimraf(_0x3a3ef2,function(_0xc0249f){if(_0xc0249f)_0x9a2848(_0xc0249f);return _0x36fa64();});});})['then'](function(){return _0xa48de[_0xcdbd('0x75')](_0x18ae81,_0x29a8dc,function(_0x163bb1){if(_0x163bb1){console[_0xcdbd('0x76')](_0xcdbd('0x77'),_0x163bb1);}else{fs[_0xcdbd('0x78')](_0x18ae81);}});});});}else{return _0xa48de['sendStatus'](0xc8);}})[_0xcdbd('0x35')](handleError(_0xa48de,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 6526867..7dff1fa 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 _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x55c6a3,_0x28ec5a){var _0x16fb3e=function(_0x5ac2fc){while(--_0x5ac2fc){_0x55c6a3['push'](_0x55c6a3['shift']());}};_0x16fb3e(++_0x28ec5a);}(_0x32f4,0x154));var _0x432f=function(_0x171b51,_0x469487){_0x171b51=_0x171b51-0x0;var _0x383d9f=_0x32f4[_0x171b51];return _0x383d9f;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x9f0e=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','update','remove','then','setDataValue','map','findAll'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0x9f0e,0x116));var _0xe9f0=function(_0x151491,_0xae779d){_0x151491=_0x151491-0x0;var _0x472c8d=_0x9f0e[_0x151491];return _0x472c8d;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var SmsInteraction=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var SmsMessage=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9f0('0x4'),'afterDestroy':_0xe9f0('0x5')};function emitEvent(_0x3c589d){return function(_0x202d69,_0x1eed45,_0x50313d){_0x202d69['getUsers']({'attributes':['id'],'raw':!![]})[_0xe9f0('0x6')](function(_0x167198){_0x202d69[_0xe9f0('0x7')]('Users',_0x167198[_0xe9f0('0x8')](function(_0x335b82){return{'id':_0x335b82['id']};}));return SmsMessage[_0xe9f0('0x9')]({'where':{'SmsInteractionId':_0x202d69['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe9f0('0x6')](function(_0xa523c0){_0x202d69[_0xe9f0('0x7')](_0xe9f0('0xa'),_0xa523c0[_0xe9f0('0xb')]);SmsInteractionEvents[_0xe9f0('0xc')](_0x3c589d+':'+_0x202d69['id'],_0x202d69);SmsInteractionEvents['emit'](_0x3c589d,_0x202d69);_0x50313d(null);})[_0xe9f0('0xd')](_0x50313d(null));};}for(var e in events){if(events[_0xe9f0('0xe')](e)){var event=events[e];SmsInteraction[_0xe9f0('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c99a40b..26a8f3a 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 _0x4283=['../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4283,0xc4));var _0x3428=function(_0x5d4436,_0xd554b2){_0x5d4436=_0x5d4436-0x0;var _0x24121f=_0x4283[_0x5d4436];return _0x24121f;};'use strict';var _=require(_0x3428('0x0'));var util=require(_0x3428('0x1'));var logger=require(_0x3428('0x2'))(_0x3428('0x3'));var moment=require(_0x3428('0x4'));var BPromise=require(_0x3428('0x5'));var rp=require(_0x3428('0x6'));var fs=require('fs');var path=require(_0x3428('0x7'));var rimraf=require('rimraf');var config=require(_0x3428('0x8'));var attributes=require(_0x3428('0x9'));module[_0x3428('0xa')]=function(_0x4d6496,_0x3304b2){return _0x4d6496[_0x3428('0xb')]('SmsInteraction',attributes,{'tableName':_0x3428('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd5fe59,_0x61fe45,_0x539445){if(_0xd5fe59[_0x3428('0xd')](_0x3428('0xe'))){_0xd5fe59[_0x3428('0xf')]=moment()['format'](_0x3428('0x10'));}_0x539445(null,_0xd5fe59);}}});}; \ No newline at end of file +var _0x36cc=['closed','closedAt','format','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x323bf8,_0xca4315){var _0x16e1c2=function(_0x3b4023){while(--_0x3b4023){_0x323bf8['push'](_0x323bf8['shift']());}};_0x16e1c2(++_0xca4315);}(_0x36cc,0x163));var _0xc36c=function(_0x4107ac,_0x575f67){_0x4107ac=_0x4107ac-0x0;var _0xd32a96=_0x36cc[_0x4107ac];return _0xd32a96;};'use strict';var _=require(_0xc36c('0x0'));var util=require(_0xc36c('0x1'));var logger=require(_0xc36c('0x2'))('api');var moment=require(_0xc36c('0x3'));var BPromise=require('bluebird');var rp=require(_0xc36c('0x4'));var fs=require('fs');var path=require(_0xc36c('0x5'));var rimraf=require(_0xc36c('0x6'));var config=require(_0xc36c('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xc36c('0x8')]=function(_0x28e2ce,_0x2a7c69){return _0x28e2ce[_0xc36c('0x9')](_0xc36c('0xa'),attributes,{'tableName':_0xc36c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x265bee,_0x4a12fa,_0x3c0f61){if(_0x265bee[_0xc36c('0xc')](_0xc36c('0xd'))){_0x265bee[_0xc36c('0xe')]=moment()[_0xc36c('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c0f61(null,_0x265bee);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 5dbe5d4..354b0ea 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 _0xf12a=['../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateSmsInteraction','update','body','options','raw','where','limit','debug','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','AddTags','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x401080,_0x380c3f){var _0x1cf798=function(_0x130c91){while(--_0x130c91){_0x401080['push'](_0x401080['shift']());}};_0x1cf798(++_0x380c3f);}(_0xf12a,0x13c));var _0xaf12=function(_0x1ca66c,_0x3e3868){_0x1ca66c=_0x1ca66c-0x0;var _0x5a78ce=_0xf12a[_0x1ca66c];return _0x5a78ce;};'use strict';var _=require(_0xaf12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf12('0x1'));var fs=require('fs');var Redis=require(_0xaf12('0x2'));var db=require(_0xaf12('0x3'))['db'];var utils=require(_0xaf12('0x4'));var logger=require('../../config/logger')(_0xaf12('0x5'));var config=require(_0xaf12('0x6'));var jayson=require(_0xaf12('0x7'));var client=jayson['client'][_0xaf12('0x8')]({'port':0x232a});config['redis']=_[_0xaf12('0x9')](config[_0xaf12('0xa')],{'host':_0xaf12('0xb'),'port':0x18eb});var socket=require(_0xaf12('0xc'))(new Redis(config[_0xaf12('0xa')]));require(_0xaf12('0xd'))[_0xaf12('0xe')](socket);function respondWithRpcPromise(_0x4aa8c0,_0x5f0aa6,_0x2afb65){return new BPromise(function(_0x1b859f,_0x43ab11){return client[_0xaf12('0xf')](_0x4aa8c0,_0x2afb65)[_0xaf12('0x10')](function(_0x11f606){logger['info'](_0xaf12('0x11'),_0x5f0aa6,'request\x20sent');logger['debug'](_0xaf12('0x12'),_0x5f0aa6,_0xaf12('0x13'),JSON[_0xaf12('0x14')](_0x11f606));if(_0x11f606[_0xaf12('0x15')]){if(_0x11f606[_0xaf12('0x15')]['code']===0x1f4){logger[_0xaf12('0x15')](_0xaf12('0x11'),_0x5f0aa6,_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);return _0x43ab11(_0x11f606['error'][_0xaf12('0x16')]);}logger['error'](_0xaf12('0x11'),_0x5f0aa6,_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);return _0x1b859f(_0x11f606[_0xaf12('0x15')][_0xaf12('0x16')]);}else{logger[_0xaf12('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x5f0aa6,_0xaf12('0x13'));_0x1b859f(_0x11f606[_0xaf12('0x18')]['message']);}})[_0xaf12('0x19')](function(_0x19f954){logger[_0xaf12('0x15')](_0xaf12('0x11'),_0x5f0aa6,_0x19f954);_0x43ab11(_0x19f954);});});}exports[_0xaf12('0x1a')]=function(_0x781dc0){var _0x392eac=this;return new Promise(function(_0x55cb4f,_0x552e3b){return db['SmsInteraction'][_0xaf12('0x1b')](_0x781dc0[_0xaf12('0x1c')],{'raw':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')][_0xaf12('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')][_0xaf12('0x1f')]||null:null,'attributes':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0[_0xaf12('0x1d')]['attributes']||null:null,'limit':_0x781dc0[_0xaf12('0x1d')]?_0x781dc0['options'][_0xaf12('0x20')]||null:null})[_0xaf12('0x10')](function(_0x20c2e9){logger[_0xaf12('0x17')](_0xaf12('0x1a'),_0x781dc0);logger[_0xaf12('0x21')](_0xaf12('0x1a'),_0x781dc0,JSON[_0xaf12('0x14')](_0x20c2e9));_0x55cb4f(_0x20c2e9);})[_0xaf12('0x19')](function(_0x164c9c){logger[_0xaf12('0x15')](_0xaf12('0x1a'),_0x164c9c[_0xaf12('0x16')],_0x781dc0);_0x552e3b(_0x392eac[_0xaf12('0x15')](0x1f4,_0x164c9c['message']));});});};exports[_0xaf12('0x22')]=function(_0x3f03ed){return new Promise(function(_0x3c7496,_0x4fbc9d){return db[_0xaf12('0x23')]['find']({'where':_0x3f03ed['options']?_0x3f03ed['options'][_0xaf12('0x1f')]||null:null})[_0xaf12('0x10')](function(_0x13a80e){if(_0x13a80e){return _0x13a80e[_0xaf12('0x24')](_0x3f03ed[_0xaf12('0x1c')][_0xaf12('0x25')],_[_0xaf12('0x26')](_0x3f03ed['body'],['ids','id'])||{});}})['spread'](function(_0x1b2199){logger[_0xaf12('0x17')](_0xaf12('0x27'),_0x3f03ed);logger[_0xaf12('0x21')](_0xaf12('0x27'),_0x3f03ed,JSON[_0xaf12('0x14')](_0x1b2199));_0x3c7496(_0x1b2199);})[_0xaf12('0x19')](function(_0x388000){logger[_0xaf12('0x15')](_0xaf12('0x27'),_0x388000['message'],_0x3f03ed);_0x4fbc9d(_this[_0xaf12('0x15')](0x1f4,_0x388000[_0xaf12('0x16')]));});});}; \ No newline at end of file +var _0xd3d1=['where','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','then','info','request\x20sent','debug','stringify','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw'];(function(_0xdbb614,_0x48db76){var _0x468831=function(_0x4e7f71){while(--_0x4e7f71){_0xdbb614['push'](_0xdbb614['shift']());}};_0x468831(++_0x48db76);}(_0xd3d1,0xac));var _0x1d3d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd3d1[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x1d3d('0x0'));var moment=require(_0x1d3d('0x1'));var BPromise=require(_0x1d3d('0x2'));var rs=require(_0x1d3d('0x3'));var fs=require('fs');var Redis=require(_0x1d3d('0x4'));var db=require(_0x1d3d('0x5'))['db'];var utils=require(_0x1d3d('0x6'));var logger=require(_0x1d3d('0x7'))(_0x1d3d('0x8'));var config=require(_0x1d3d('0x9'));var jayson=require(_0x1d3d('0xa'));var client=jayson[_0x1d3d('0xb')]['http']({'port':0x232a});config[_0x1d3d('0xc')]=_[_0x1d3d('0xd')](config[_0x1d3d('0xc')],{'host':_0x1d3d('0xe'),'port':0x18eb});var socket=require(_0x1d3d('0xf'))(new Redis(config[_0x1d3d('0xc')]));require(_0x1d3d('0x10'))['register'](socket);function respondWithRpcPromise(_0x378716,_0xb50b11,_0x727745){return new BPromise(function(_0x542b4d,_0x59555b){return client['request'](_0x378716,_0x727745)[_0x1d3d('0x11')](function(_0xd960f0){logger[_0x1d3d('0x12')]('SmsInteraction,\x20%s,\x20%s',_0xb50b11,_0x1d3d('0x13'));logger[_0x1d3d('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xb50b11,_0x1d3d('0x13'),JSON[_0x1d3d('0x15')](_0xd960f0));if(_0xd960f0[_0x1d3d('0x16')]){if(_0xd960f0[_0x1d3d('0x16')]['code']===0x1f4){logger[_0x1d3d('0x16')](_0x1d3d('0x17'),_0xb50b11,_0xd960f0[_0x1d3d('0x16')]['message']);return _0x59555b(_0xd960f0[_0x1d3d('0x16')][_0x1d3d('0x18')]);}logger[_0x1d3d('0x16')](_0x1d3d('0x17'),_0xb50b11,_0xd960f0[_0x1d3d('0x16')]['message']);return _0x542b4d(_0xd960f0[_0x1d3d('0x16')][_0x1d3d('0x18')]);}else{logger[_0x1d3d('0x12')]('SmsInteraction,\x20%s,\x20%s',_0xb50b11,'request\x20sent');_0x542b4d(_0xd960f0[_0x1d3d('0x19')][_0x1d3d('0x18')]);}})[_0x1d3d('0x1a')](function(_0x137b88){logger[_0x1d3d('0x16')](_0x1d3d('0x17'),_0xb50b11,_0x137b88);_0x59555b(_0x137b88);});});}exports[_0x1d3d('0x1b')]=function(_0x47aade){var _0x45f7cc=this;return new Promise(function(_0x33d1ae,_0x37e11c){return db[_0x1d3d('0x1c')][_0x1d3d('0x1d')](_0x47aade[_0x1d3d('0x1e')],{'raw':_0x47aade[_0x1d3d('0x1f')]?_0x47aade[_0x1d3d('0x1f')][_0x1d3d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47aade[_0x1d3d('0x1f')]?_0x47aade[_0x1d3d('0x1f')][_0x1d3d('0x21')]||null:null,'attributes':_0x47aade['options']?_0x47aade[_0x1d3d('0x1f')]['attributes']||null:null,'limit':_0x47aade[_0x1d3d('0x1f')]?_0x47aade[_0x1d3d('0x1f')][_0x1d3d('0x22')]||null:null})[_0x1d3d('0x11')](function(_0x40abde){logger[_0x1d3d('0x12')](_0x1d3d('0x1b'),_0x47aade);logger[_0x1d3d('0x14')](_0x1d3d('0x1b'),_0x47aade,JSON['stringify'](_0x40abde));_0x33d1ae(_0x40abde);})['catch'](function(_0x4829a8){logger[_0x1d3d('0x16')](_0x1d3d('0x1b'),_0x4829a8['message'],_0x47aade);_0x37e11c(_0x45f7cc[_0x1d3d('0x16')](0x1f4,_0x4829a8[_0x1d3d('0x18')]));});});};exports[_0x1d3d('0x23')]=function(_0x36a435){return new Promise(function(_0x4a2e1c,_0x348926){return db['SmsInteraction'][_0x1d3d('0x24')]({'where':_0x36a435[_0x1d3d('0x1f')]?_0x36a435[_0x1d3d('0x1f')][_0x1d3d('0x21')]||null:null})[_0x1d3d('0x11')](function(_0x569611){if(_0x569611){return _0x569611[_0x1d3d('0x25')](_0x36a435['body'][_0x1d3d('0x26')],_[_0x1d3d('0x27')](_0x36a435[_0x1d3d('0x1e')],[_0x1d3d('0x26'),'id'])||{});}})['spread'](function(_0x5b736d){logger[_0x1d3d('0x12')]('AddTags',_0x36a435);logger[_0x1d3d('0x14')](_0x1d3d('0x28'),_0x36a435,JSON[_0x1d3d('0x15')](_0x5b736d));_0x4a2e1c(_0x5b736d);})[_0x1d3d('0x1a')](function(_0x1bc807){logger[_0x1d3d('0x16')](_0x1d3d('0x28'),_0x1bc807['message'],_0x36a435);_0x348926(_this[_0x1d3d('0x16')](0x1f4,_0x1bc807[_0x1d3d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1e0a54e..a8e02ee 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 _0x319d=['emit','removeListener','length','smsInteraction:','save','update'];(function(_0x243426,_0x71a7c5){var _0x4e8604=function(_0x4e8fd4){while(--_0x4e8fd4){_0x243426['push'](_0x243426['shift']());}};_0x4e8604(++_0x71a7c5);}(_0x319d,0x190));var _0xd319=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x319d[_0x540dcb];return _0x49353c;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xd319('0x0'),'remove',_0xd319('0x1')];function createListener(_0x13993d,_0x24d413){return function(_0x52eae7){_0x24d413[_0xd319('0x2')](_0x13993d,_0x52eae7);};}function removeListener(_0xfb667f,_0x1a0ebd){return function(){SmsInteractionEvents[_0xd319('0x3')](_0xfb667f,_0x1a0ebd);};}exports['register']=function(_0x46eafb){for(var _0x27e09a=0x0,_0x4da934=events[_0xd319('0x4')];_0x27e09a<_0x4da934;_0x27e09a++){var _0x411d1c=events[_0x27e09a];var _0x516800=createListener(_0xd319('0x5')+_0x411d1c,_0x46eafb);SmsInteractionEvents['on'](_0x411d1c,_0x516800);}}; \ No newline at end of file +var _0xfe8f=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0x479b20,_0x3b7bda){var _0xa67c6a=function(_0x2cbc9c){while(--_0x2cbc9c){_0x479b20['push'](_0x479b20['shift']());}};_0xa67c6a(++_0x3b7bda);}(_0xfe8f,0x1bd));var _0xffe8=function(_0x906dab,_0x5b6dc4){_0x906dab=_0x906dab-0x0;var _0x4562b6=_0xfe8f[_0x906dab];return _0x4562b6;};'use strict';var SmsInteractionEvents=require(_0xffe8('0x0'));var events=[_0xffe8('0x1'),_0xffe8('0x2'),_0xffe8('0x3')];function createListener(_0x428a0b,_0x13d15a){return function(_0x266a73){_0x13d15a[_0xffe8('0x4')](_0x428a0b,_0x266a73);};}function removeListener(_0x37249e,_0x21ff45){return function(){SmsInteractionEvents[_0xffe8('0x5')](_0x37249e,_0x21ff45);};}exports[_0xffe8('0x6')]=function(_0x5f3e14){for(var _0x1a9964=0x0,_0x4fad58=events[_0xffe8('0x7')];_0x1a9964<_0x4fad58;_0x1a9964++){var _0xe502b2=events[_0x1a9964];var _0x3cb52b=createListener(_0xffe8('0x8')+_0xe502b2,_0x5f3e14);SmsInteractionEvents['on'](_0xe502b2,_0x3cb52b);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index e02e38c..7bc5e1c 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 _0xd63a=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','post','status','put','update','/:id/accept','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x114fef,_0x1224a7){var _0x1629d2=function(_0x52da10){while(--_0x52da10){_0x114fef['push'](_0x114fef['shift']());}};_0x1629d2(++_0x1224a7);}(_0xd63a,0xed));var _0xad63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd63a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xad63('0x0'));var path=require(_0xad63('0x1'));var timeout=require(_0xad63('0x2'));var express=require(_0xad63('0x3'));var router=express[_0xad63('0x4')]();var fs_extra=require(_0xad63('0x5'));var auth=require(_0xad63('0x6'));var interaction=require(_0xad63('0x7'));var config=require('../../config/environment');var controller=require(_0xad63('0x8'));router[_0xad63('0x9')]('/',auth[_0xad63('0xa')](),controller[_0xad63('0xb')]);router[_0xad63('0x9')](_0xad63('0xc'),auth['isAuthenticated'](),controller[_0xad63('0xd')]);router[_0xad63('0x9')](_0xad63('0xe'),auth[_0xad63('0xa')](),controller[_0xad63('0xf')]);router['post']('/',auth[_0xad63('0xa')](),interaction[_0xad63('0x10')](_0xad63('0x11'),_0xad63('0x12')),controller['create']);router[_0xad63('0x13')]('/:id/status',controller[_0xad63('0x14')]);router[_0xad63('0x15')](_0xad63('0xe'),auth[_0xad63('0xa')](),controller[_0xad63('0x16')]);router[_0xad63('0x15')](_0xad63('0x17'),auth['isAuthenticated'](),controller['accept']);router[_0xad63('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xad63('0x18')]);router[_0xad63('0x19')]('/:id',auth[_0xad63('0xa')](),controller['destroy']);module[_0xad63('0x1a')]=router; \ No newline at end of file +var _0xfb2f=['post','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show','tracked'];(function(_0x4a9842,_0x47e145){var _0x1a4d86=function(_0xc4b670){while(--_0xc4b670){_0x4a9842['push'](_0x4a9842['shift']());}};_0x1a4d86(++_0x47e145);}(_0xfb2f,0x112));var _0xffb2=function(_0x5061ae,_0x28f40c){_0x5061ae=_0x5061ae-0x0;var _0x15b350=_0xfb2f[_0x5061ae];return _0x15b350;};'use strict';var multer=require(_0xffb2('0x0'));var util=require('util');var path=require(_0xffb2('0x1'));var timeout=require('connect-timeout');var express=require(_0xffb2('0x2'));var router=express[_0xffb2('0x3')]();var fs_extra=require(_0xffb2('0x4'));var auth=require(_0xffb2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffb2('0x6'));var controller=require('./smsMessage.controller');router[_0xffb2('0x7')]('/',auth['isAuthenticated'](),controller[_0xffb2('0x8')]);router['get'](_0xffb2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xffb2('0x7')](_0xffb2('0xa'),auth[_0xffb2('0xb')](),controller[_0xffb2('0xc')]);router['post']('/',auth[_0xffb2('0xb')](),interaction[_0xffb2('0xd')]('sms','smsmessage:create'),controller['create']);router[_0xffb2('0xe')]('/:id/status',controller[_0xffb2('0xf')]);router[_0xffb2('0x10')]('/:id',auth[_0xffb2('0xb')](),controller[_0xffb2('0x11')]);router[_0xffb2('0x10')](_0xffb2('0x12'),auth['isAuthenticated'](),controller[_0xffb2('0x13')]);router[_0xffb2('0x10')]('/:id/reject',auth[_0xffb2('0xb')](),controller[_0xffb2('0x14')]);router[_0xffb2('0x15')]('/:id',auth[_0xffb2('0xb')](),controller[_0xffb2('0x16')]);module[_0xffb2('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d4a8213..afb88f9 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 _0x15a5=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x2fcbf5,_0x1ee4fd){var _0xc7a5bd=function(_0x3ff704){while(--_0x3ff704){_0x2fcbf5['push'](_0x2fcbf5['shift']());}};_0xc7a5bd(++_0x1ee4fd);}(_0x15a5,0x1e5));var _0x515a=function(_0x36697b,_0x51b9fe){_0x36697b=_0x36697b-0x0;var _0x4e80f3=_0x15a5[_0x36697b];return _0x4e80f3;};'use strict';var Sequelize=require(_0x515a('0x0'));module['exports']={'body':{'type':Sequelize[_0x515a('0x1')](_0x515a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x515a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x515a('0x4')]('in',_0x515a('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x515a('0x6')](0xbe)},'phone':{'type':Sequelize[_0x515a('0x6')]},'readAt':{'type':Sequelize[_0x515a('0x7')]},'secret':{'type':Sequelize[_0x515a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x515a('0x6')]},'providerResponse':{'type':Sequelize[_0x515a('0x1')]}}; \ No newline at end of file +var _0x1ed0=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x3182f2,_0x242888){var _0x5ed78d=function(_0x1e7274){while(--_0x1e7274){_0x3182f2['push'](_0x3182f2['shift']());}};_0x5ed78d(++_0x242888);}(_0x1ed0,0x103));var _0x01ed=function(_0x437663,_0x4b1832){_0x437663=_0x437663-0x0;var _0x1f3d51=_0x1ed0[_0x437663];return _0x1f3d51;};'use strict';var Sequelize=require(_0x01ed('0x0'));module[_0x01ed('0x1')]={'body':{'type':Sequelize[_0x01ed('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x01ed('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x01ed('0x4')]('in',_0x01ed('0x5')),'defaultValue':_0x01ed('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x01ed('0x6')]},'readAt':{'type':Sequelize[_0x01ed('0x7')]},'secret':{'type':Sequelize[_0x01ed('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x01ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 0dbb951..a5a5025 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 _0x1e44=['SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','QueryTypes','fullname','email','SIP/%s','rejectmessage','SmsAccount','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','map','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','SmsMessage','findAll','rows','show','params','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','UserId','agent','get','SmsInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','internal','manual','interface','channel','motionChannel','event','EventManager','../../config/logger'];(function(_0x348bef,_0x3e1674){var _0x1a059f=function(_0xedce38){while(--_0xedce38){_0x348bef['push'](_0x348bef['shift']());}};_0x1a059f(++_0x3e1674);}(_0x1e44,0xb3));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x41e4('0x0'));var rimraf=require(_0x41e4('0x1'));var zipdir=require(_0x41e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41e4('0x3'));var moment=require(_0x41e4('0x4'));var BPromise=require(_0x41e4('0x5'));var Mustache=require(_0x41e4('0x6'));var util=require('util');var path=require(_0x41e4('0x7'));var sox=require(_0x41e4('0x8'));var csv=require(_0x41e4('0x9'));var ejs=require(_0x41e4('0xa'));var fs=require('fs');var fs_extra=require(_0x41e4('0xb'));var _=require(_0x41e4('0xc'));var squel=require(_0x41e4('0xd'));var crypto=require(_0x41e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x41e4('0xf'));var toCsv=require(_0x41e4('0x9'));var querystring=require(_0x41e4('0x10'));var Papa=require(_0x41e4('0x11'));var Redis=require(_0x41e4('0x12'));var authService=require(_0x41e4('0x13'));var qs=require(_0x41e4('0x14'));var as=require(_0x41e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x41e4('0x16'));var utils=require('../../config/utils');var config=require(_0x41e4('0x17'));var licenseUtil=require(_0x41e4('0x18'));var db=require(_0x41e4('0x19'))['db'];config[_0x41e4('0x1a')]=_[_0x41e4('0x1b')](config[_0x41e4('0x1a')],{'host':_0x41e4('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x41e4('0x1d'))['register'](socket);var jayson=require(_0x41e4('0x1e'));var client=jayson['client'][_0x41e4('0x1f')]({'port':0x232c});var client9002=jayson[_0x41e4('0x20')][_0x41e4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x508caa,_0x41238a,_0x2e9500,_0x5b207d){return new BPromise(function(_0x5bbe36,_0x56d8d1){var _0x4b5fb6=_0x5b207d||client;return _0x4b5fb6[_0x41e4('0x21')](_0x508caa,_0x2e9500)[_0x41e4('0x22')](function(_0xdd9766){logger[_0x41e4('0x23')](_0x41e4('0x24'),_0x41238a,'request\x20sent');logger['debug'](_0x41e4('0x25'),_0x41238a,_0x41e4('0x26'),JSON[_0x41e4('0x27')](_0xdd9766));if(_0xdd9766[_0x41e4('0x28')]){if(_0xdd9766[_0x41e4('0x28')][_0x41e4('0x29')]===0x1f4){logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0xdd9766['error'][_0x41e4('0x2a')]);return _0x56d8d1(_0xdd9766['error'][_0x41e4('0x2a')]);}logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0xdd9766[_0x41e4('0x28')][_0x41e4('0x2a')]);return _0x5bbe36(_0xdd9766[_0x41e4('0x28')]['message']);}else{logger[_0x41e4('0x23')]('SmsMessage,\x20%s,\x20%s',_0x41238a,_0x41e4('0x26'));_0x5bbe36(_0xdd9766[_0x41e4('0x2b')][_0x41e4('0x2a')]);}})[_0x41e4('0x2c')](function(_0x18fac9){logger[_0x41e4('0x28')](_0x41e4('0x24'),_0x41238a,_0x18fac9);_0x56d8d1(_0x18fac9);});});}function respondWithStatusCode(_0xe9bc87,_0x297fa1){_0x297fa1=_0x297fa1||0xcc;return function(_0x2dd222){if(_0x2dd222){return _0xe9bc87[_0x41e4('0x2d')](_0x297fa1);}return _0xe9bc87[_0x41e4('0x2e')](_0x297fa1)[_0x41e4('0x2f')]();};}function respondWithResult(_0x74ea28,_0x3f2749){_0x3f2749=_0x3f2749||0xc8;return function(_0x136fc5){if(_0x136fc5){return _0x74ea28[_0x41e4('0x2e')](_0x3f2749)[_0x41e4('0x30')](_0x136fc5);}};}function respondWithFilteredResult(_0xff795e,_0x3599c8){return function(_0x4fe8b2){if(_0x4fe8b2){var _0x16fa1b=typeof _0x3599c8[_0x41e4('0x31')]===_0x41e4('0x32')&&typeof _0x3599c8['limit']===_0x41e4('0x32');var _0x163fef=_0x4fe8b2[_0x41e4('0x33')];var _0x103e28=_0x16fa1b?0x0:_0x3599c8[_0x41e4('0x31')];var _0x1f3a8b=_0x16fa1b?_0x4fe8b2[_0x41e4('0x33')]:_0x3599c8['offset']+_0x3599c8[_0x41e4('0x34')];var _0x31b1b8;if(_0x1f3a8b>=_0x163fef){_0x1f3a8b=_0x163fef;_0x31b1b8=0xc8;}else{_0x31b1b8=0xce;}_0xff795e[_0x41e4('0x2e')](_0x31b1b8);return _0xff795e['set'](_0x41e4('0x35'),_0x103e28+'-'+_0x1f3a8b+'/'+_0x163fef)[_0x41e4('0x30')](_0x4fe8b2);}return null;};}function patchUpdates(_0x130ad0){return function(_0x530fcd){try{jsonpatch[_0x41e4('0x36')](_0x530fcd,_0x130ad0,!![]);}catch(_0x2c86fe){return BPromise[_0x41e4('0x37')](_0x2c86fe);}return _0x530fcd[_0x41e4('0x38')]();};}function saveUpdates(_0x4e1b3f,_0xec2833){return function(_0x1160da){if(_0x1160da){return _0x1160da[_0x41e4('0x39')](_0x4e1b3f)[_0x41e4('0x22')](function(_0x3b86ff){return _0x3b86ff;});}return null;};}function removeEntity(_0x5687d4,_0x22267a){return function(_0xbc5c7a){if(_0xbc5c7a){return _0xbc5c7a[_0x41e4('0x3a')]()[_0x41e4('0x22')](function(){_0x5687d4['status'](0xcc)[_0x41e4('0x2f')]();});}};}function handleEntityNotFound(_0x13164b,_0x311a05){return function(_0x31702c){if(!_0x31702c){_0x13164b['sendStatus'](0x194);}return _0x31702c;};}function handleError(_0x5c3dec,_0x5ef1c1){_0x5ef1c1=_0x5ef1c1||0x1f4;return function(_0x19362c){logger[_0x41e4('0x28')](_0x19362c['stack']);if(_0x19362c[_0x41e4('0x3b')]){delete _0x19362c['name'];}_0x5c3dec['status'](_0x5ef1c1)[_0x41e4('0x3c')](_0x19362c);};}exports[_0x41e4('0x3d')]=function(_0x210e83,_0x3de587){var _0x3696e6={},_0x2eb0aa={},_0x3a8114={'count':0x0,'rows':[]};var _0x298d05=_[_0x41e4('0x3e')](db['SmsMessage']['rawAttributes'],function(_0x54678d){return{'name':_0x54678d[_0x41e4('0x3f')],'type':_0x54678d['type'][_0x41e4('0x40')]};});_0x2eb0aa['model']=_[_0x41e4('0x3e')](_0x298d05,_0x41e4('0x3b'));_0x2eb0aa[_0x41e4('0x41')]=_[_0x41e4('0x42')](_0x210e83[_0x41e4('0x41')]);_0x2eb0aa[_0x41e4('0x43')]=_['intersection'](_0x2eb0aa['model'],_0x2eb0aa[_0x41e4('0x41')]);_0x3696e6[_0x41e4('0x44')]=_[_0x41e4('0x45')](_0x2eb0aa[_0x41e4('0x46')],qs[_0x41e4('0x47')](_0x210e83[_0x41e4('0x41')]['fields']));_0x3696e6['attributes']=_0x3696e6[_0x41e4('0x44')][_0x41e4('0x48')]?_0x3696e6[_0x41e4('0x44')]:_0x2eb0aa[_0x41e4('0x46')];if(!_0x210e83[_0x41e4('0x41')]['hasOwnProperty']('nolimit')){_0x3696e6[_0x41e4('0x34')]=qs['limit'](_0x210e83[_0x41e4('0x41')][_0x41e4('0x34')]);_0x3696e6[_0x41e4('0x31')]=qs['offset'](_0x210e83[_0x41e4('0x41')][_0x41e4('0x31')]);}_0x3696e6[_0x41e4('0x49')]=qs[_0x41e4('0x4a')](_0x210e83[_0x41e4('0x41')][_0x41e4('0x4a')]);_0x3696e6[_0x41e4('0x4b')]=qs[_0x41e4('0x43')](_[_0x41e4('0x4c')](_0x210e83[_0x41e4('0x41')],_0x2eb0aa[_0x41e4('0x43')]),_0x298d05);if(_0x210e83['query'][_0x41e4('0x4d')]){_0x3696e6['where']=_[_0x41e4('0x4e')](_0x3696e6[_0x41e4('0x4b')],{'$or':_[_0x41e4('0x3e')](_0x298d05,function(_0x448892){if(_0x448892[_0x41e4('0x4f')]!==_0x41e4('0x50')){var _0x21b983={};_0x21b983[_0x448892[_0x41e4('0x3b')]]={'$like':'%'+_0x210e83[_0x41e4('0x41')][_0x41e4('0x4d')]+'%'};return _0x21b983;}})});}_0x3696e6=_['merge']({},_0x3696e6,_0x210e83['options']);var _0x16cb47={'where':_0x3696e6[_0x41e4('0x4b')]};return db['SmsMessage']['count'](_0x16cb47)[_0x41e4('0x22')](function(_0x235ada){_0x3a8114['count']=_0x235ada;if(_0x210e83[_0x41e4('0x41')][_0x41e4('0x51')]){_0x3696e6[_0x41e4('0x52')]=[{'all':!![]}];}return db[_0x41e4('0x53')][_0x41e4('0x54')](_0x3696e6);})[_0x41e4('0x22')](function(_0x3330c1){_0x3a8114[_0x41e4('0x55')]=_0x3330c1;return _0x3a8114;})['then'](respondWithFilteredResult(_0x3de587,_0x3696e6))[_0x41e4('0x2c')](handleError(_0x3de587,null));};exports[_0x41e4('0x56')]=function(_0x5a1ac8,_0x5a594e){var _0x490948={'raw':!![],'where':{'id':_0x5a1ac8[_0x41e4('0x57')]['id']}},_0xdf65c6={};_0xdf65c6[_0x41e4('0x46')]=_[_0x41e4('0x42')](db[_0x41e4('0x53')][_0x41e4('0x58')]);_0xdf65c6[_0x41e4('0x41')]=_[_0x41e4('0x42')](_0x5a1ac8[_0x41e4('0x41')]);_0xdf65c6[_0x41e4('0x43')]=_[_0x41e4('0x45')](_0xdf65c6['model'],_0xdf65c6[_0x41e4('0x41')]);_0x490948[_0x41e4('0x44')]=_[_0x41e4('0x45')](_0xdf65c6[_0x41e4('0x46')],qs[_0x41e4('0x47')](_0x5a1ac8[_0x41e4('0x41')][_0x41e4('0x47')]));_0x490948[_0x41e4('0x44')]=_0x490948[_0x41e4('0x44')][_0x41e4('0x48')]?_0x490948[_0x41e4('0x44')]:_0xdf65c6[_0x41e4('0x46')];if(_0x5a1ac8[_0x41e4('0x41')]['includeAll']){_0x490948[_0x41e4('0x52')]=[{'all':!![]}];}_0x490948=_['merge']({},_0x490948,_0x5a1ac8['options']);return db['SmsMessage'][_0x41e4('0x59')](_0x490948)[_0x41e4('0x22')](handleEntityNotFound(_0x5a594e,null))[_0x41e4('0x22')](respondWithResult(_0x5a594e,null))[_0x41e4('0x2c')](handleError(_0x5a594e,null));};exports[_0x41e4('0x5a')]=function(_0x422f50,_0x4830da){return db['SmsMessage'][_0x41e4('0x5a')](_0x422f50[_0x41e4('0x5b')],{})[_0x41e4('0x22')](respondWithResult(_0x4830da,0xc9))[_0x41e4('0x2c')](handleError(_0x4830da,null));};exports['update']=function(_0x26fd45,_0x1cd8cc){if(_0x26fd45['body']['id']){delete _0x26fd45['body']['id'];}return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x26fd45[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x1cd8cc,null))[_0x41e4('0x22')](saveUpdates(_0x26fd45[_0x41e4('0x5b')],null))['then'](respondWithResult(_0x1cd8cc,null))[_0x41e4('0x2c')](handleError(_0x1cd8cc,null));};exports[_0x41e4('0x3a')]=function(_0x30a948,_0x242323){return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x30a948[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x242323,null))[_0x41e4('0x22')](removeEntity(_0x242323,null))[_0x41e4('0x2c')](handleError(_0x242323,null));};exports['describe']=function(_0x16bae9,_0x4911e9){return db['SmsMessage'][_0x41e4('0x5c')]()[_0x41e4('0x22')](respondWithResult(_0x4911e9,null))[_0x41e4('0x2c')](handleError(_0x4911e9,null));};var interaction_log=require('../../config/logger')(_0x41e4('0x5d'));exports[_0x41e4('0x5e')]=function(_0x37416d,_0x49185d,_0xf1c89e){var _0x2c29c1={'agent':{},'channel':_0x41e4('0x5f')};if(_0x37416d[_0x41e4('0x5b')]['id']){delete _0x37416d[_0x41e4('0x5b')]['id'];}_0x37416d[_0x41e4('0x5b')]['read']=!![];_0x37416d[_0x41e4('0x5b')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37416d[_0x41e4('0x5b')]['UserId']=_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')]||_0x37416d['user']['id'];_0x2c29c1[_0x41e4('0x61')]['id']=_0x37416d['body'][_0x41e4('0x60')];return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x37416d[_0x41e4('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49185d,null))[_0x41e4('0x22')](saveUpdates(_0x37416d[_0x41e4('0x5b')],null))['then'](function(_0x3cc255){if(_0x3cc255){_0x2c29c1[_0x41e4('0x2a')]=_0x3cc255[_0x41e4('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3cc255[_0x41e4('0x63')]}});}return null;})[_0x41e4('0x22')](handleEntityNotFound(_0x49185d,null))[_0x41e4('0x22')](function(_0xe7826){if(_0xe7826){return _0xe7826[_0x41e4('0x39')]({'UserId':_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')],'read1stAt':_[_0x41e4('0x64')](_0xe7826[_0x41e4('0x65')])?moment()[_0x41e4('0x66')](_0x41e4('0x67')):undefined});}return null;})[_0x41e4('0x22')](function(_0x21cb55){if(_0x21cb55){_0x2c29c1['interaction']=_0x21cb55[_0x41e4('0x62')]({'plain':!![]});interaction_log[_0x41e4('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37416d[_0x41e4('0x68')]['id'],_0x37416d[_0x41e4('0x68')][_0x41e4('0x3b')],_0x37416d[_0x41e4('0x68')]['role'],_0x2c29c1[_0x41e4('0x69')]['id'],_0x37416d[_0x41e4('0x5b')]?JSON[_0x41e4('0x27')](_0x37416d[_0x41e4('0x5b')]):_0x41e4('0x6a'));return respondWithRpcPromise(_0x41e4('0x6b'),_0x41e4('0x6c'),_0x2c29c1);}return null;})[_0x41e4('0x22')](function(_0x539257){var _0x1df624=_0x41e4('0x6d')+_0x539257['message']['ContactId'];return db[_0x41e4('0x6e')][_0x41e4('0x41')](_0x1df624,{'type':db[_0x41e4('0x6f')]['QueryTypes'][_0x41e4('0x70')],'raw':!![]})[_0x41e4('0x22')](function(_0x462f8f){return _0x462f8f;});})[_0x41e4('0x22')](function(_0x7665){if(_0x7665){_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x71')]=_0x7665[0x0];if(!_0x37416d['body'][_0x41e4('0x60')])return;return db[_0x41e4('0x72')][_0x41e4('0x59')]({'where':{'id':_0x37416d[_0x41e4('0x5b')][_0x41e4('0x60')],'role':_0x41e4('0x61')},'attributes':['id','name','fullname','email',_0x41e4('0x73')],'raw':!![]});}return null;})['then'](function(_0x59a579){if(!_0x59a579)return null;_0x2c29c1[_0x41e4('0x2a')]['agent']=_0x59a579;return _0x2c29c1;})[_0x41e4('0x22')](function(_0x2c83ca){if(_0x2c83ca){if(_0x37416d[_0x41e4('0x5b')][_0x41e4('0x74')]){_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x75')]=util[_0x41e4('0x66')]('SIP/%s',_0x37416d[_0x41e4('0x68')][_0x41e4('0x3b')]);_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x76')]=_0x2c29c1[_0x41e4('0x76')];_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x77')]=_0x2c29c1[_0x41e4('0x76')];_0x2c29c1[_0x41e4('0x2a')][_0x41e4('0x78')]=_0x41e4('0x5e');return respondWithRpcPromise(_0x41e4('0x79'),'EventManager',{'event':'acceptmessage','message':_0x2c29c1['message']},client9002)[_0x41e4('0x22')](function(){return _0x2c29c1;});}return _0x2c29c1;}return null;})[_0x41e4('0x22')](respondWithResult(_0x49185d,null))['catch'](handleError(_0x49185d,null));};var interaction_log=require(_0x41e4('0x7a'))(_0x41e4('0x5d'));exports['reject']=function(_0x4ca991,_0x504e8d,_0x5ca509){var _0x431c9a={'agent':{},'channel':_0x41e4('0x5f')};if(_0x4ca991[_0x41e4('0x5b')]['id']){delete _0x4ca991[_0x41e4('0x5b')]['id'];}_0x4ca991[_0x41e4('0x5b')][_0x41e4('0x60')]=_0x4ca991[_0x41e4('0x5b')][_0x41e4('0x60')]||_0x4ca991['user']['id'];_0x431c9a[_0x41e4('0x61')]['id']=_0x4ca991['body'][_0x41e4('0x60')];return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x4ca991[_0x41e4('0x57')]['id'],'UserId':null}})[_0x41e4('0x22')](handleEntityNotFound(_0x504e8d,null))[_0x41e4('0x22')](function(_0x50c4c6){if(_0x50c4c6){_0x431c9a[_0x41e4('0x2a')]=_0x50c4c6[_0x41e4('0x62')]({'plain':!![]});return db[_0x41e4('0x7b')][_0x41e4('0x59')]({'where':{'id':_0x50c4c6['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x504e8d,null))[_0x41e4('0x22')](function(_0x258177){if(_0x258177){_0x431c9a[_0x41e4('0x69')]=_0x258177['get']({'plain':!![]});interaction_log[_0x41e4('0x23')](_0x41e4('0x7c'),_0x4ca991[_0x41e4('0x68')]['id'],_0x4ca991['user'][_0x41e4('0x3b')],_0x4ca991[_0x41e4('0x68')][_0x41e4('0x7d')],_0x431c9a[_0x41e4('0x69')]['id'],_0x4ca991[_0x41e4('0x5b')]?JSON[_0x41e4('0x27')](_0x4ca991[_0x41e4('0x5b')]):_0x41e4('0x6a'));return respondWithRpcPromise(_0x41e4('0x7e'),'rejectMessage',_0x431c9a);}return null;})[_0x41e4('0x22')](function(_0x5aeb70){var _0x534796=_0x41e4('0x6d')+_0x5aeb70[_0x41e4('0x2a')][_0x41e4('0x7f')];return db[_0x41e4('0x6e')][_0x41e4('0x41')](_0x534796,{'type':db[_0x41e4('0x6f')][_0x41e4('0x80')]['SELECT'],'raw':!![]})[_0x41e4('0x22')](function(_0x52bdc0){return _0x52bdc0;});})[_0x41e4('0x22')](function(_0x2702e6){if(_0x2702e6){_0x431c9a[_0x41e4('0x2a')][_0x41e4('0x71')]=_0x2702e6[0x0];if(!_0x4ca991['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x4ca991['body'][_0x41e4('0x60')],'role':_0x41e4('0x61')},'attributes':['id','name',_0x41e4('0x81'),_0x41e4('0x82'),'internal'],'raw':!![]});}return null;})[_0x41e4('0x22')](function(_0x5c0702){if(!_0x5c0702)return null;_0x431c9a[_0x41e4('0x2a')]['agent']=_0x5c0702;return _0x431c9a;})[_0x41e4('0x22')](function(_0x3c4151){if(_0x3c4151){_0x3c4151['message']['interface']=util[_0x41e4('0x66')](_0x41e4('0x83'),_0x4ca991[_0x41e4('0x68')][_0x41e4('0x3b')]);_0x3c4151[_0x41e4('0x2a')][_0x41e4('0x76')]=_0x431c9a['channel'];_0x3c4151['message'][_0x41e4('0x77')]=_0x431c9a[_0x41e4('0x76')];_0x3c4151['message'][_0x41e4('0x78')]=_0x41e4('0x37');respondWithRpcPromise(_0x41e4('0x79'),_0x41e4('0x79'),{'event':_0x41e4('0x84'),'message':_0x3c4151['message']},client9002);return _0x431c9a;}return null;})[_0x41e4('0x22')](respondWithResult(_0x504e8d,null))[_0x41e4('0x2c')](handleError(_0x504e8d,null));};exports[_0x41e4('0x2e')]=function(_0x543551,_0x2c7de1,_0x2a211e){if(_0x543551['body']['id']){delete _0x543551[_0x41e4('0x5b')]['id'];}var _0x36b4ad;return db[_0x41e4('0x53')][_0x41e4('0x59')]({'where':{'id':_0x543551[_0x41e4('0x57')]['id']}})[_0x41e4('0x22')](handleEntityNotFound(_0x2c7de1,null))[_0x41e4('0x22')](function(_0x5dd2b8){if(_0x5dd2b8){_0x36b4ad=_0x5dd2b8;return db[_0x41e4('0x85')]['find']({'where':{'id':_0x5dd2b8['SmsAccountId']}});}})[_0x41e4('0x22')](handleEntityNotFound(_0x2c7de1,null))[_0x41e4('0x22')](function(_0x365fc1){if(_0x365fc1){logger[_0x41e4('0x86')](_0x41e4('0x25'),_0x41e4('0x2e'),_0x41e4('0x87'),_0x365fc1[_0x41e4('0x4f')],util[_0x41e4('0x88')](_0x543551[_0x41e4('0x5b')],{'showHidden':![],'depth':null}));switch(_0x365fc1['type']){case _0x41e4('0x89'):if(_0x543551['body'][_0x41e4('0x8a')]&&_0x543551['body']['MessageSid']===_0x36b4ad[_0x41e4('0x8b')]){return _0x36b4ad['update']({'read':!![]});}else{logger[_0x41e4('0x28')](_0x41e4('0x8c'),_0x41e4('0x2e'),_0x41e4('0x89'),util[_0x41e4('0x88')](_0x543551[_0x41e4('0x5b')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x543551['body'][_0x41e4('0x8d')]&&_0x543551[_0x41e4('0x5b')]['MessageUUID']===_0x36b4ad['messageId']&&_[_0x41e4('0x8e')]([_0x41e4('0x8f'),_0x41e4('0x90')],_0x543551[_0x41e4('0x5b')][_0x41e4('0x91')])>=0x0){return _0x36b4ad[_0x41e4('0x39')]({'read':!![]});}else{logger[_0x41e4('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x41e4('0x2e'),_0x41e4('0x92'),util[_0x41e4('0x88')](_0x543551['body'],{'showHidden':![],'depth':null}));}break;case _0x41e4('0x93'):var _0xb7c4d9=_0x543551[_0x41e4('0x5b')][_0x41e4('0x94')][0x0];if(_0xb7c4d9[_0x41e4('0x2e')][_0x41e4('0x95')]===_0x41e4('0x96')){return _0x36b4ad['update']({'read':!![]});}else{logger[_0x41e4('0x28')](_0x41e4('0x8c'),_0x41e4('0x2e'),_0x41e4('0x93'),util[_0x41e4('0x88')](_0x543551['body'],{'showHidden':![],'depth':null}));}break;}return _0x36b4ad;}})[_0x41e4('0x22')](respondWithResult(_0x2c7de1,null))[_0x41e4('0x2c')](handleError(_0x2c7de1,null));}; \ No newline at end of file +var _0x4367=['index','map','SmsMessage','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','destroy','params','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','SmsInteractionId','isNil','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','UserId','User','internal','interface','channel','accept','EventManager','acceptmessage','../../config/logger','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','email','SIP/%s','motionChannel','event','rejectmessage','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','DELIVERED','infobip','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','client','request','then','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','send'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4367,0x1f3));var _0x7436=function(_0x455549,_0x58cf94){_0x455549=_0x455549-0x0;var _0x290c62=_0x4367[_0x455549];return _0x290c62;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7436('0x0'));var zipdir=require(_0x7436('0x1'));var jsonpatch=require(_0x7436('0x2'));var rp=require(_0x7436('0x3'));var moment=require('moment');var BPromise=require(_0x7436('0x4'));var Mustache=require(_0x7436('0x5'));var util=require(_0x7436('0x6'));var path=require(_0x7436('0x7'));var sox=require(_0x7436('0x8'));var csv=require(_0x7436('0x9'));var ejs=require(_0x7436('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7436('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7436('0xc'));var toCsv=require(_0x7436('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7436('0xd'));var authService=require(_0x7436('0xe'));var qs=require(_0x7436('0xf'));var as=require(_0x7436('0x10'));var hardwareService=require(_0x7436('0x11'));var logger=require('../../config/logger')(_0x7436('0x12'));var utils=require(_0x7436('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7436('0x14'))['db'];config[_0x7436('0x15')]=_['defaults'](config[_0x7436('0x15')],{'host':_0x7436('0x16'),'port':0x18eb});var socket=require(_0x7436('0x17'))(new Redis(config[_0x7436('0x15')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x7436('0x18'));var client=jayson['client'][_0x7436('0x19')]({'port':0x232c});var client9002=jayson[_0x7436('0x1a')][_0x7436('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x38181f,_0x51672e,_0x4c0ea8,_0x2893e4){return new BPromise(function(_0x4de05f,_0x3ec95a){var _0xa08d6e=_0x2893e4||client;return _0xa08d6e[_0x7436('0x1b')](_0x38181f,_0x4c0ea8)[_0x7436('0x1c')](function(_0x54ae4c){logger['info']('SmsMessage,\x20%s,\x20%s',_0x51672e,_0x7436('0x1d'));logger[_0x7436('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x51672e,_0x7436('0x1d'),JSON[_0x7436('0x1f')](_0x54ae4c));if(_0x54ae4c['error']){if(_0x54ae4c[_0x7436('0x20')][_0x7436('0x21')]===0x1f4){logger[_0x7436('0x20')](_0x7436('0x22'),_0x51672e,_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);return _0x3ec95a(_0x54ae4c[_0x7436('0x20')]['message']);}logger[_0x7436('0x20')]('SmsMessage,\x20%s,\x20%s',_0x51672e,_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);return _0x4de05f(_0x54ae4c[_0x7436('0x20')][_0x7436('0x23')]);}else{logger[_0x7436('0x24')](_0x7436('0x22'),_0x51672e,_0x7436('0x1d'));_0x4de05f(_0x54ae4c['result']['message']);}})['catch'](function(_0x5272d8){logger[_0x7436('0x20')](_0x7436('0x22'),_0x51672e,_0x5272d8);_0x3ec95a(_0x5272d8);});});}function respondWithStatusCode(_0x4142d0,_0x176fb0){_0x176fb0=_0x176fb0||0xcc;return function(_0x5c0280){if(_0x5c0280){return _0x4142d0['sendStatus'](_0x176fb0);}return _0x4142d0[_0x7436('0x25')](_0x176fb0)['end']();};}function respondWithResult(_0x1c40d9,_0x10ffc3){_0x10ffc3=_0x10ffc3||0xc8;return function(_0x196e80){if(_0x196e80){return _0x1c40d9[_0x7436('0x25')](_0x10ffc3)[_0x7436('0x26')](_0x196e80);}};}function respondWithFilteredResult(_0x38a086,_0x15b3fe){return function(_0x2cda2a){if(_0x2cda2a){var _0x3fa050=typeof _0x15b3fe['offset']==='undefined'&&typeof _0x15b3fe[_0x7436('0x27')]===_0x7436('0x28');var _0x29a3ea=_0x2cda2a[_0x7436('0x29')];var _0x5b971f=_0x3fa050?0x0:_0x15b3fe[_0x7436('0x2a')];var _0x2e01b9=_0x3fa050?_0x2cda2a['count']:_0x15b3fe[_0x7436('0x2a')]+_0x15b3fe[_0x7436('0x27')];var _0x4afa72;if(_0x2e01b9>=_0x29a3ea){_0x2e01b9=_0x29a3ea;_0x4afa72=0xc8;}else{_0x4afa72=0xce;}_0x38a086['status'](_0x4afa72);return _0x38a086[_0x7436('0x2b')](_0x7436('0x2c'),_0x5b971f+'-'+_0x2e01b9+'/'+_0x29a3ea)[_0x7436('0x26')](_0x2cda2a);}return null;};}function patchUpdates(_0x3a212a){return function(_0x571972){try{jsonpatch[_0x7436('0x2d')](_0x571972,_0x3a212a,!![]);}catch(_0x12a6c4){return BPromise['reject'](_0x12a6c4);}return _0x571972[_0x7436('0x2e')]();};}function saveUpdates(_0x575404,_0x163df8){return function(_0x39d9cb){if(_0x39d9cb){return _0x39d9cb[_0x7436('0x2f')](_0x575404)[_0x7436('0x1c')](function(_0x41be94){return _0x41be94;});}return null;};}function removeEntity(_0x170602,_0x3e330a){return function(_0x611a0b){if(_0x611a0b){return _0x611a0b['destroy']()[_0x7436('0x1c')](function(){_0x170602[_0x7436('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2db4,_0x55ec6d){return function(_0x3c38ad){if(!_0x3c38ad){_0x4c2db4['sendStatus'](0x194);}return _0x3c38ad;};}function handleError(_0x2eee54,_0x45d295){_0x45d295=_0x45d295||0x1f4;return function(_0x287367){logger[_0x7436('0x20')](_0x287367['stack']);if(_0x287367['name']){delete _0x287367['name'];}_0x2eee54[_0x7436('0x25')](_0x45d295)[_0x7436('0x30')](_0x287367);};}exports[_0x7436('0x31')]=function(_0x5f36fa,_0x3f6c47){var _0x344f25={},_0x58210c={},_0x2f1f9a={'count':0x0,'rows':[]};var _0x577f86=_[_0x7436('0x32')](db[_0x7436('0x33')]['rawAttributes'],function(_0x324ed7){return{'name':_0x324ed7['fieldName'],'type':_0x324ed7[_0x7436('0x34')][_0x7436('0x35')]};});_0x58210c[_0x7436('0x36')]=_[_0x7436('0x32')](_0x577f86,_0x7436('0x37'));_0x58210c[_0x7436('0x38')]=_['keys'](_0x5f36fa[_0x7436('0x38')]);_0x58210c[_0x7436('0x39')]=_[_0x7436('0x3a')](_0x58210c[_0x7436('0x36')],_0x58210c[_0x7436('0x38')]);_0x344f25[_0x7436('0x3b')]=_[_0x7436('0x3a')](_0x58210c[_0x7436('0x36')],qs[_0x7436('0x3c')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x3c')]));_0x344f25[_0x7436('0x3b')]=_0x344f25[_0x7436('0x3b')]['length']?_0x344f25['attributes']:_0x58210c['model'];if(!_0x5f36fa[_0x7436('0x38')][_0x7436('0x3d')]('nolimit')){_0x344f25[_0x7436('0x27')]=qs[_0x7436('0x27')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x27')]);_0x344f25['offset']=qs[_0x7436('0x2a')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x2a')]);}_0x344f25[_0x7436('0x3e')]=qs[_0x7436('0x3f')](_0x5f36fa[_0x7436('0x38')][_0x7436('0x3f')]);_0x344f25[_0x7436('0x40')]=qs[_0x7436('0x39')](_[_0x7436('0x41')](_0x5f36fa[_0x7436('0x38')],_0x58210c[_0x7436('0x39')]),_0x577f86);if(_0x5f36fa[_0x7436('0x38')][_0x7436('0x42')]){_0x344f25[_0x7436('0x40')]=_[_0x7436('0x43')](_0x344f25['where'],{'$or':_['map'](_0x577f86,function(_0x2e067e){if(_0x2e067e[_0x7436('0x34')]!==_0x7436('0x44')){var _0x5f1853={};_0x5f1853[_0x2e067e['name']]={'$like':'%'+_0x5f36fa[_0x7436('0x38')][_0x7436('0x42')]+'%'};return _0x5f1853;}})});}_0x344f25=_[_0x7436('0x43')]({},_0x344f25,_0x5f36fa[_0x7436('0x45')]);var _0x3f1f42={'where':_0x344f25[_0x7436('0x40')]};return db[_0x7436('0x33')][_0x7436('0x29')](_0x3f1f42)[_0x7436('0x1c')](function(_0x68c817){_0x2f1f9a[_0x7436('0x29')]=_0x68c817;if(_0x5f36fa[_0x7436('0x38')][_0x7436('0x46')]){_0x344f25[_0x7436('0x47')]=[{'all':!![]}];}return db[_0x7436('0x33')][_0x7436('0x48')](_0x344f25);})['then'](function(_0x487076){_0x2f1f9a['rows']=_0x487076;return _0x2f1f9a;})[_0x7436('0x1c')](respondWithFilteredResult(_0x3f6c47,_0x344f25))[_0x7436('0x49')](handleError(_0x3f6c47,null));};exports[_0x7436('0x4a')]=function(_0x373272,_0x4b64c3){var _0x31b13e={'raw':!![],'where':{'id':_0x373272['params']['id']}},_0x3f66ee={};_0x3f66ee[_0x7436('0x36')]=_['keys'](db[_0x7436('0x33')][_0x7436('0x4b')]);_0x3f66ee[_0x7436('0x38')]=_[_0x7436('0x4c')](_0x373272[_0x7436('0x38')]);_0x3f66ee[_0x7436('0x39')]=_['intersection'](_0x3f66ee[_0x7436('0x36')],_0x3f66ee[_0x7436('0x38')]);_0x31b13e[_0x7436('0x3b')]=_[_0x7436('0x3a')](_0x3f66ee[_0x7436('0x36')],qs[_0x7436('0x3c')](_0x373272[_0x7436('0x38')]['fields']));_0x31b13e[_0x7436('0x3b')]=_0x31b13e[_0x7436('0x3b')]['length']?_0x31b13e['attributes']:_0x3f66ee[_0x7436('0x36')];if(_0x373272[_0x7436('0x38')][_0x7436('0x46')]){_0x31b13e[_0x7436('0x47')]=[{'all':!![]}];}_0x31b13e=_['merge']({},_0x31b13e,_0x373272['options']);return db[_0x7436('0x33')][_0x7436('0x4d')](_0x31b13e)[_0x7436('0x1c')](handleEntityNotFound(_0x4b64c3,null))[_0x7436('0x1c')](respondWithResult(_0x4b64c3,null))[_0x7436('0x49')](handleError(_0x4b64c3,null));};exports[_0x7436('0x4e')]=function(_0x354277,_0x5692f1){return db[_0x7436('0x33')][_0x7436('0x4e')](_0x354277[_0x7436('0x4f')],{})[_0x7436('0x1c')](respondWithResult(_0x5692f1,0xc9))['catch'](handleError(_0x5692f1,null));};exports[_0x7436('0x2f')]=function(_0x591260,_0x29e7ef){if(_0x591260['body']['id']){delete _0x591260['body']['id'];}return db[_0x7436('0x33')]['find']({'where':{'id':_0x591260['params']['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x29e7ef,null))['then'](saveUpdates(_0x591260[_0x7436('0x4f')],null))['then'](respondWithResult(_0x29e7ef,null))[_0x7436('0x49')](handleError(_0x29e7ef,null));};exports[_0x7436('0x50')]=function(_0x21565b,_0x4ec487){return db[_0x7436('0x33')][_0x7436('0x4d')]({'where':{'id':_0x21565b[_0x7436('0x51')]['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x4ec487,null))[_0x7436('0x1c')](removeEntity(_0x4ec487,null))[_0x7436('0x49')](handleError(_0x4ec487,null));};exports[_0x7436('0x52')]=function(_0x205ae5,_0xfd1b85){return db['SmsMessage'][_0x7436('0x52')]()[_0x7436('0x1c')](respondWithResult(_0xfd1b85,null))[_0x7436('0x49')](handleError(_0xfd1b85,null));};var interaction_log=require('../../config/logger')(_0x7436('0x53'));exports['accept']=function(_0x336149,_0xc95c76,_0x231609){var _0xd1da0d={'agent':{},'channel':_0x7436('0x54')};if(_0x336149[_0x7436('0x4f')]['id']){delete _0x336149[_0x7436('0x4f')]['id'];}_0x336149[_0x7436('0x4f')][_0x7436('0x55')]=!![];_0x336149[_0x7436('0x4f')][_0x7436('0x56')]=moment()[_0x7436('0x57')](_0x7436('0x58'));_0x336149['body']['UserId']=_0x336149[_0x7436('0x4f')]['UserId']||_0x336149[_0x7436('0x59')]['id'];_0xd1da0d[_0x7436('0x5a')]['id']=_0x336149[_0x7436('0x4f')]['UserId'];return db[_0x7436('0x33')][_0x7436('0x4d')]({'where':{'id':_0x336149['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xc95c76,null))[_0x7436('0x1c')](saveUpdates(_0x336149[_0x7436('0x4f')],null))['then'](function(_0x553ef3){if(_0x553ef3){_0xd1da0d[_0x7436('0x23')]=_0x553ef3[_0x7436('0x5b')]({'plain':!![]});return db['SmsInteraction'][_0x7436('0x4d')]({'where':{'id':_0x553ef3[_0x7436('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0xc95c76,null))[_0x7436('0x1c')](function(_0x58f083){if(_0x58f083){return _0x58f083[_0x7436('0x2f')]({'UserId':_0x336149[_0x7436('0x4f')]['UserId'],'read1stAt':_[_0x7436('0x5d')](_0x58f083['read1stAt'])?moment()[_0x7436('0x57')](_0x7436('0x58')):undefined});}return null;})[_0x7436('0x1c')](function(_0x5c1c64){if(_0x5c1c64){_0xd1da0d['interaction']=_0x5c1c64[_0x7436('0x5b')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x336149[_0x7436('0x59')]['id'],_0x336149[_0x7436('0x59')][_0x7436('0x37')],_0x336149['user'][_0x7436('0x5e')],_0xd1da0d[_0x7436('0x5f')]['id'],_0x336149['body']?JSON['stringify'](_0x336149[_0x7436('0x4f')]):_0x7436('0x60'));return respondWithRpcPromise(_0x7436('0x61'),_0x7436('0x62'),_0xd1da0d);}return null;})['then'](function(_0x5c7252){var _0x2a4dc7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c7252[_0x7436('0x23')][_0x7436('0x63')];return db[_0x7436('0x64')][_0x7436('0x38')](_0x2a4dc7,{'type':db[_0x7436('0x65')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7436('0x1c')](function(_0x5ef84e){return _0x5ef84e;});})[_0x7436('0x1c')](function(_0x11333a){if(_0x11333a){_0xd1da0d[_0x7436('0x23')]['contact']=_0x11333a[0x0];if(!_0x336149[_0x7436('0x4f')][_0x7436('0x66')])return;return db[_0x7436('0x67')][_0x7436('0x4d')]({'where':{'id':_0x336149[_0x7436('0x4f')]['UserId'],'role':_0x7436('0x5a')},'attributes':['id','name','fullname','email',_0x7436('0x68')],'raw':!![]});}return null;})[_0x7436('0x1c')](function(_0x224d4f){if(!_0x224d4f)return null;_0xd1da0d[_0x7436('0x23')][_0x7436('0x5a')]=_0x224d4f;return _0xd1da0d;})[_0x7436('0x1c')](function(_0x39f168){if(_0x39f168){if(_0x336149['body']['manual']){_0xd1da0d[_0x7436('0x23')][_0x7436('0x69')]=util[_0x7436('0x57')]('SIP/%s',_0x336149[_0x7436('0x59')][_0x7436('0x37')]);_0xd1da0d[_0x7436('0x23')]['channel']=_0xd1da0d[_0x7436('0x6a')];_0xd1da0d[_0x7436('0x23')]['motionChannel']=_0xd1da0d[_0x7436('0x6a')];_0xd1da0d[_0x7436('0x23')]['event']=_0x7436('0x6b');return respondWithRpcPromise('EventManager',_0x7436('0x6c'),{'event':_0x7436('0x6d'),'message':_0xd1da0d[_0x7436('0x23')]},client9002)[_0x7436('0x1c')](function(){return _0xd1da0d;});}return _0xd1da0d;}return null;})[_0x7436('0x1c')](respondWithResult(_0xc95c76,null))['catch'](handleError(_0xc95c76,null));};var interaction_log=require(_0x7436('0x6e'))(_0x7436('0x53'));exports[_0x7436('0x6f')]=function(_0x90b616,_0x1f547e,_0x1d4f86){var _0x19df20={'agent':{},'channel':_0x7436('0x54')};if(_0x90b616[_0x7436('0x4f')]['id']){delete _0x90b616['body']['id'];}_0x90b616[_0x7436('0x4f')][_0x7436('0x66')]=_0x90b616['body']['UserId']||_0x90b616[_0x7436('0x59')]['id'];_0x19df20[_0x7436('0x5a')]['id']=_0x90b616[_0x7436('0x4f')][_0x7436('0x66')];return db[_0x7436('0x33')]['find']({'where':{'id':_0x90b616[_0x7436('0x51')]['id'],'UserId':null}})[_0x7436('0x1c')](handleEntityNotFound(_0x1f547e,null))[_0x7436('0x1c')](function(_0x30b594){if(_0x30b594){_0x19df20[_0x7436('0x23')]=_0x30b594[_0x7436('0x5b')]({'plain':!![]});return db[_0x7436('0x70')][_0x7436('0x4d')]({'where':{'id':_0x30b594[_0x7436('0x5c')]}});}return null;})[_0x7436('0x1c')](handleEntityNotFound(_0x1f547e,null))[_0x7436('0x1c')](function(_0x1192ad){if(_0x1192ad){_0x19df20[_0x7436('0x5f')]=_0x1192ad[_0x7436('0x5b')]({'plain':!![]});interaction_log['info'](_0x7436('0x71'),_0x90b616[_0x7436('0x59')]['id'],_0x90b616[_0x7436('0x59')][_0x7436('0x37')],_0x90b616[_0x7436('0x59')][_0x7436('0x5e')],_0x19df20[_0x7436('0x5f')]['id'],_0x90b616['body']?JSON[_0x7436('0x1f')](_0x90b616[_0x7436('0x4f')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x19df20);}return null;})[_0x7436('0x1c')](function(_0x2c1a55){var _0x18b4cf=_0x7436('0x72')+_0x2c1a55[_0x7436('0x23')][_0x7436('0x63')];return db[_0x7436('0x64')][_0x7436('0x38')](_0x18b4cf,{'type':db[_0x7436('0x65')][_0x7436('0x73')][_0x7436('0x74')],'raw':!![]})[_0x7436('0x1c')](function(_0x4528ba){return _0x4528ba;});})['then'](function(_0x20752c){if(_0x20752c){_0x19df20[_0x7436('0x23')][_0x7436('0x75')]=_0x20752c[0x0];if(!_0x90b616[_0x7436('0x4f')][_0x7436('0x66')])return;return db[_0x7436('0x67')][_0x7436('0x4d')]({'where':{'id':_0x90b616[_0x7436('0x4f')][_0x7436('0x66')],'role':'agent'},'attributes':['id',_0x7436('0x37'),'fullname',_0x7436('0x76'),_0x7436('0x68')],'raw':!![]});}return null;})[_0x7436('0x1c')](function(_0x4e033e){if(!_0x4e033e)return null;_0x19df20[_0x7436('0x23')][_0x7436('0x5a')]=_0x4e033e;return _0x19df20;})[_0x7436('0x1c')](function(_0x559183){if(_0x559183){_0x559183['message'][_0x7436('0x69')]=util[_0x7436('0x57')](_0x7436('0x77'),_0x90b616[_0x7436('0x59')]['name']);_0x559183[_0x7436('0x23')]['channel']=_0x19df20[_0x7436('0x6a')];_0x559183['message'][_0x7436('0x78')]=_0x19df20[_0x7436('0x6a')];_0x559183['message'][_0x7436('0x79')]=_0x7436('0x6f');respondWithRpcPromise(_0x7436('0x6c'),_0x7436('0x6c'),{'event':_0x7436('0x7a'),'message':_0x559183[_0x7436('0x23')]},client9002);return _0x19df20;}return null;})[_0x7436('0x1c')](respondWithResult(_0x1f547e,null))[_0x7436('0x49')](handleError(_0x1f547e,null));};exports[_0x7436('0x25')]=function(_0x34239d,_0x59dffb,_0x36db11){if(_0x34239d[_0x7436('0x4f')]['id']){delete _0x34239d[_0x7436('0x4f')]['id'];}var _0x479fd0;return db['SmsMessage'][_0x7436('0x4d')]({'where':{'id':_0x34239d[_0x7436('0x51')]['id']}})[_0x7436('0x1c')](handleEntityNotFound(_0x59dffb,null))[_0x7436('0x1c')](function(_0x447c2d){if(_0x447c2d){_0x479fd0=_0x447c2d;return db['SmsAccount'][_0x7436('0x4d')]({'where':{'id':_0x447c2d['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x59dffb,null))[_0x7436('0x1c')](function(_0x57222a){if(_0x57222a){logger['debug'](_0x7436('0x7b'),_0x7436('0x25'),'received\x20delivery\x20report\x20from',_0x57222a[_0x7436('0x34')],util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));switch(_0x57222a[_0x7436('0x34')]){case'twilio':if(_0x34239d[_0x7436('0x4f')]['MessageSid']&&_0x34239d[_0x7436('0x4f')][_0x7436('0x7d')]===_0x479fd0[_0x7436('0x7e')]){return _0x479fd0[_0x7436('0x2f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7436('0x25'),_0x7436('0x7f'),util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));}break;case _0x7436('0x80'):if(_0x34239d[_0x7436('0x4f')][_0x7436('0x81')]&&_0x34239d[_0x7436('0x4f')][_0x7436('0x81')]===_0x479fd0['messageId']&&_['indexOf']([_0x7436('0x82'),_0x7436('0x83')],_0x34239d['body'][_0x7436('0x84')])>=0x0){return _0x479fd0[_0x7436('0x2f')]({'read':!![]});}else{logger['error'](_0x7436('0x85'),_0x7436('0x25'),_0x7436('0x86'),util[_0x7436('0x7c')](_0x34239d[_0x7436('0x4f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x45dc5e=_0x34239d[_0x7436('0x4f')]['results'][0x0];if(_0x45dc5e['status']['groupName']===_0x7436('0x87')){return _0x479fd0['update']({'read':!![]});}else{logger[_0x7436('0x20')](_0x7436('0x85'),_0x7436('0x25'),_0x7436('0x88'),util[_0x7436('0x7c')](_0x34239d['body'],{'showHidden':![],'depth':null}));}break;}return _0x479fd0;}})['then'](respondWithResult(_0x59dffb,null))['catch'](handleError(_0x59dffb,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 803d9d1..929ee13 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 _0x210e=['setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb','SmsMessage'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x210e,0xb1));var _0xe210=function(_0x2142ea,_0x5a8f39){_0x2142ea=_0x2142ea-0x0;var _0x53e2a9=_0x210e[_0x2142ea];return _0x53e2a9;};'use strict';var EventEmitter=require(_0xe210('0x0'));var SmsMessage=require(_0xe210('0x1'))['db'][_0xe210('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe210('0x3')](0x0);var events={'afterCreate':_0xe210('0x4'),'afterUpdate':_0xe210('0x5'),'afterDestroy':_0xe210('0x6')};function emitEvent(_0x180c16){return function(_0x267595,_0x1753b1,_0x4508de){SmsMessageEvents['emit'](_0x180c16+':'+_0x267595['id'],_0x267595);SmsMessageEvents['emit'](_0x180c16,_0x267595);_0x4508de(null);};}for(var e in events){if(events[_0xe210('0x7')](e)){var event=events[e];SmsMessage[_0xe210('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xf076=['hook','exports','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf076,0x1da));var _0x6f07=function(_0x5974c7,_0x401a1c){_0x5974c7=_0x5974c7-0x0;var _0x371c77=_0xf076[_0x5974c7];return _0x371c77;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x6f07('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6f07('0x1')](0x0);var events={'afterCreate':_0x6f07('0x2'),'afterUpdate':'update','afterDestroy':_0x6f07('0x3')};function emitEvent(_0x265bf3){return function(_0x3e92e3,_0x5264b3,_0x537b24){SmsMessageEvents[_0x6f07('0x4')](_0x265bf3+':'+_0x3e92e3['id'],_0x3e92e3);SmsMessageEvents[_0x6f07('0x4')](_0x265bf3,_0x3e92e3);_0x537b24(null);};}for(var e in events){if(events[_0x6f07('0x5')](e)){var event=events[e];SmsMessage[_0x6f07('0x6')](e,emitEvent(event));}}module[_0x6f07('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 51476d7..332968f 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 _0x0360=['sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','authToken','https://smsapi.connectel.se/api/v2/send/','clicksend','xCALLY\x20Motion','senderString','%s:%s','format','Basic\x20%s','base64','http_code','data','queued_count','messages','clickSend','plivo','authId','remote','/api/sms/messages/','POST','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','csc','apiKey','login','keys','length','createHash','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','message','refid','Token\x20not\x20received','finally','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','/status?token=','token','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','phone','smsMethod','sender','login?username=','GET','split'];(function(_0x25c4ba,_0x596159){var _0x2c3b40=function(_0x476e37){while(--_0x476e37){_0x25c4ba['push'](_0x25c4ba['shift']());}};_0x2c3b40(++_0x596159);}(_0x0360,0xb1));var _0x0036=function(_0x4cd60f,_0x41b5c6){_0x4cd60f=_0x4cd60f-0x0;var _0x29d357=_0x0360[_0x4cd60f];return _0x29d357;};'use strict';var _=require(_0x0036('0x0'));var util=require('util');var logger=require(_0x0036('0x1'))(_0x0036('0x2'));var moment=require(_0x0036('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0036('0x4'));var config=require(_0x0036('0x5'));var attributes=require(_0x0036('0x6'));module[_0x0036('0x7')]=function(_0x43cc51,_0x2713c5){return _0x43cc51[_0x0036('0x8')]('SmsMessage',attributes,{'tableName':_0x0036('0x9'),'paranoid':![],'indexes':[{'name':_0x0036('0xa'),'fields':[_0x0036('0xa')]},{'name':_0x0036('0xb'),'fields':[_0x0036('0xc')],'type':_0x0036('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36d092,_0x2f3447,_0x3ac2f9){var _0x3662ff=_0x43cc51['models'];var _0x276149=_0x36d092[_0x0036('0xe')]({'plain':!![]});if(_0x276149[_0x0036('0xf')][_0x0036('0x10')]()==='in'||_0x276149['direction'][_0x0036('0x10')]()===_0x0036('0x11')&&!_0x276149[_0x0036('0x12')]&&!_[_0x0036('0x13')](_0x276149[_0x0036('0x14')])&&!_[_0x0036('0x13')](_0x276149['SmsInteractionId'])){_0x3662ff['SmsInteraction'][_0x0036('0x15')]({'where':{'id':_0x276149[_0x0036('0x16')]}})[_0x0036('0x17')](function(_0x57fefe){if(_0x57fefe){_0x57fefe[_0x0036('0x18')]({'lastMsgAt':_0x276149[_0x0036('0x19')],'lastMsgDirection':_0x276149[_0x0036('0xf')][_0x0036('0x10')]()});}})[_0x0036('0x1a')](function(_0x169b3f){console[_0x0036('0x1b')](_0x169b3f);});}if(_0x276149['direction']===_0x0036('0x11')&&!_0x276149['secret']){var _0x4e7d91;_0x3662ff[_0x0036('0x1c')][_0x0036('0x1d')]({'where':{'id':_0x276149[_0x0036('0x1e')]},'raw':!![]})['then'](function(_0x513b5c){_0x4e7d91=_0x513b5c;if(_0x4e7d91&&_0x4e7d91[_0x0036('0x1f')]){switch(_0x4e7d91[_0x0036('0x1f')]){case _0x0036('0x20'):var _0x40c1b3=require('twilio');if(_0x4e7d91[_0x0036('0x21')]&&_0x4e7d91['authToken']&&_0x4e7d91['phone']){var _0x4d9f32=new _0x40c1b3(_0x4e7d91[_0x0036('0x21')],_0x4e7d91['authToken']);_0x4d9f32['messages']['create']({'body':_0x276149[_0x0036('0xc')],'to':_0x276149['phone'],'from':_0x4e7d91['phone'],'statusCallback':_0x4e7d91['remote']+'/api/sms/messages/'+_0x276149['id']+_0x0036('0x22')+_0x4e7d91[_0x0036('0x23')]})[_0x0036('0x17')](function(_0x20ba54){if(_0x20ba54[_0x0036('0x24')]){return _0x36d092[_0x0036('0x18')]({'messageId':_0x20ba54['sid']});}})['catch'](function(_0x5e534d){logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0036('0x20'),util[_0x0036('0x25')](_0x5e534d,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x20'),_0x0036('0x28'));}break;case'skebby':var _0x10a83a='https://api.skebby.it/API/v1.0/REST/';if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x925f9f={'recipient':[_0x276149[_0x0036('0x2b')]],'message':_0x276149[_0x0036('0xc')],'message_type':_0x4e7d91[_0x0036('0x2c')]};if(_0x4e7d91['smsMethod']&&_0x4e7d91['smsMethod']!=='SI'){_0x925f9f[_0x0036('0x2d')]=_0x4e7d91[_0x0036('0x2b')];}var _0x5d1243={'url':_0x10a83a+_0x0036('0x2e')+_0x4e7d91[_0x0036('0x29')]+'&password='+_0x4e7d91[_0x0036('0x2a')],'method':_0x0036('0x2f')};rp(_0x5d1243)[_0x0036('0x17')](function(_0x277d0e){var _0x324456=_0x277d0e[_0x0036('0x30')](';');var _0x51430b={'user_key':_0x324456[0x0],'session_key':_0x324456[0x1]};_0x5d1243={'url':_0x10a83a+_0x0036('0x31'),'method':'POST','headers':{'user_key':_0x51430b[_0x0036('0x32')],'Session_key':_0x51430b[_0x0036('0x33')]},'json':!![],'body':_0x925f9f};return rp(_0x5d1243);})[_0x0036('0x17')](function(_0xbf78f2){if(_0xbf78f2[_0x0036('0x34')]>=0x1){var _0x426208={'messageId':_0xbf78f2[_0x0036('0x35')]};if(_0x4e7d91[_0x0036('0x2c')]!=='GP'||!_0x4e7d91[_0x0036('0x36')]){_0x426208[_0x0036('0x37')]=!![];}return _0x36d092['update'](_0x426208);}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),util['inspect'](_0xbf78f2,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x30fd41){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),util[_0x0036('0x25')](_0x30fd41,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x38'),_0x0036('0x39'));}break;case _0x0036('0x3a'):if(_0x4e7d91[_0x0036('0x3b')]){var _0x32a9b9={'recipient':_0x276149[_0x0036('0x2b')],'message':_0x276149[_0x0036('0xc')],'sender':_0x4e7d91['senderString']||_0x4e7d91[_0x0036('0x2b')],'authorization':_0x4e7d91[_0x0036('0x3b')]};var _0x2f3447={'method':'POST','uri':_0x0036('0x3c'),'body':_0x32a9b9,'json':!![]};rp(_0x2f3447)['then'](function(_0x29717b){var _0x16c508={'messageId':_0x29717b['requestid']};if(!_0x4e7d91[_0x0036('0x36')]){_0x16c508[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x16c508);})[_0x0036('0x1a')](function(_0x541e21){logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate',_0x0036('0x3a'),util[_0x0036('0x25')](_0x541e21,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x3a'),'Missing\x20parameters:\x20authToken');}break;case _0x0036('0x3d'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x32a9b9={'messages':[{'source':_0x0036('0x3e'),'to':_0x276149[_0x0036('0x2b')],'body':_0x276149[_0x0036('0xc')],'from':_0x4e7d91[_0x0036('0x3f')]||_0x4e7d91[_0x0036('0x2b')]}]};var _0x36cf75=util['format'](_0x0036('0x40'),_0x4e7d91[_0x0036('0x29')],_0x4e7d91[_0x0036('0x2a')]);var _0x2f3447={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x32a9b9,'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)['toString'](_0x0036('0x43')))},'json':!![]};rp(_0x2f3447)[_0x0036('0x17')](function(_0x2db433){if(_0x2db433[_0x0036('0x44')]>=0xc8&&_0x2db433[_0x0036('0x44')]<=0xce){if(_0x2db433['data']&&_0x2db433[_0x0036('0x45')][_0x0036('0x46')]>0x0){var _0x403ef3=_['head'](_0x2db433['data'][_0x0036('0x47')]);var _0x21dddc={'messageId':_0x403ef3['message_id']};if(!_0x4e7d91[_0x0036('0x36')]){_0x21dddc[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x21dddc);}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x48'),util['inspect'](_0x2db433,{'showHidden':![],'depth':null}));}}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x48'),util[_0x0036('0x25')](_0x2db433,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x48145d){logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),'clickSend',util[_0x0036('0x25')](_0x48145d,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x48'),_0x0036('0x39'));}break;case _0x0036('0x49'):if(_0x4e7d91[_0x0036('0x4a')]&&_0x4e7d91['authToken']){var _0x32a9b9={'dst':_0x276149[_0x0036('0x2b')],'text':_0x276149[_0x0036('0xc')],'src':_0x4e7d91[_0x0036('0x3f')]||_0x4e7d91[_0x0036('0x2b')],'url':_0x4e7d91[_0x0036('0x4b')]+_0x0036('0x4c')+_0x276149['id']+_0x0036('0x22')+_0x4e7d91['token']};var _0x36cf75=util[_0x0036('0x41')](_0x0036('0x40'),_0x4e7d91[_0x0036('0x4a')],_0x4e7d91[_0x0036('0x3b')]);var _0x2f3447={'method':_0x0036('0x4d'),'uri':util[_0x0036('0x41')](_0x0036('0x4e'),_0x4e7d91[_0x0036('0x4a')]),'body':_0x32a9b9,'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)[_0x0036('0x4f')](_0x0036('0x43')))},'json':!![]};rp(_0x2f3447)['then'](function(_0x1a8f89){var _0x190373={'messageId':_0x1a8f89[_0x0036('0x50')][0x0]};return _0x36d092[_0x0036('0x18')](_0x190373);})['catch'](function(_0x5bd575){logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),'plivo',util[_0x0036('0x25')](_0x5bd575,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x49'),_0x0036('0x51'));}break;case _0x0036('0x52'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){if(_0x4e7d91[_0x0036('0x53')]){var _0xba121f={'method':_0x0036('0x4d'),'uri':_0x4e7d91[_0x0036('0x53')]+_0x0036('0x54'),'body':{'username':_0x4e7d91['username'],'password':_0x4e7d91[_0x0036('0x2a')]},'json':!![]};return rp(_0xba121f)[_0x0036('0x17')](function(_0x1cc369){var _0x5960c5={'method':'POST','uri':_0x4e7d91['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x4e7d91[_0x0036('0x2b')],'destinations':[{'to':_0x276149[_0x0036('0x2b')]}],'text':_0x276149[_0x0036('0xc')],'notifyUrl':_0x4e7d91['remote']+_0x0036('0x4c')+_0x276149['id']+'/status?token='+_0x4e7d91['token'],'notifyContentType':'application/json','callbackData':_0x4e7d91['phone']+';'+_0x276149[_0x0036('0xc')]}]},'headers':{'Authorization':_0x0036('0x55')+_0x1cc369[_0x0036('0x23')]},'json':!![]};return rp(_0x5960c5)[_0x0036('0x17')](function(_0x56a6c9){if(_0x56a6c9['messages']){var _0x49b570={'messageId':_0x56a6c9['messages'][0x0][_0x0036('0xa')]};if(!_0x4e7d91[_0x0036('0x36')]){_0x49b570[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x49b570);}else{return logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),util[_0x0036('0x25')](_0x56a6c9,{'showHidden':![],'depth':null}));}});})[_0x0036('0x1a')](function(_0x9b14d3){return logger['error'](_0x0036('0x26'),'afterCreate',_0x0036('0x52'),util[_0x0036('0x25')](_0x9b14d3,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x52'),_0x0036('0x39'));}break;case _0x0036('0x56'):var _0x3139c6=require('crypto');if(_0x4e7d91[_0x0036('0x57')]){var _0x3c62cd={};_0x3c62cd[_0x0036('0x58')]=_0x4e7d91[_0x0036('0x29')];_0x3c62cd[_0x0036('0x2b')]=_0x276149[_0x0036('0x2b')];_0x3c62cd[_0x0036('0x2d')]=_0x4e7d91[_0x0036('0x2b')];_0x3c62cd['text']=_0x276149['body'];_0x3c62cd['timestamp']=+new Date();var _0x56440='';var _0x5b2cf8='';var _0x2fa66b=Object[_0x0036('0x59')](_0x3c62cd);_0x2fa66b['sort']();for(var _0x44bdd0=0x0;_0x44bdd0<_0x2fa66b[_0x0036('0x5a')];_0x44bdd0++){if(_0x56440!=''){_0x56440+='&';}_0x56440+=_0x2fa66b[_0x44bdd0]+'='+encodeURIComponent(_0x3c62cd[_0x2fa66b[_0x44bdd0]]);_0x5b2cf8+=_0x3c62cd[_0x2fa66b[_0x44bdd0]];}_0x5b2cf8+=_0x4e7d91[_0x0036('0x57')];_0x5b2cf8=_0x3139c6[_0x0036('0x5b')](_0x0036('0x5c'))[_0x0036('0x18')](_0x5b2cf8)[_0x0036('0x5d')](_0x0036('0x5e'));if(_0x56440!==''){_0x56440+='&';}_0x56440+='signature='+_0x5b2cf8;var _0x5d1243={'method':_0x0036('0x2f'),'uri':_0x4e7d91[_0x0036('0x53')]+_0x0036('0x5f')+_0x56440,'json':!![]};return rp(_0x5d1243)[_0x0036('0x17')](function(_0xd3b487){var _0x11385c=Object[_0x0036('0x59')](_0xd3b487);if(_0xd3b487[_0x11385c[0x0]][_0x0036('0x1b')]&&parseInt(_0xd3b487[_0x11385c[0x0]][_0x0036('0x1b')])===0x0){var _0x12690e={'messageId':_0xd3b487[_0x11385c[0x0]][_0x0036('0x60')]};if(!_0x4e7d91['deliveryReport']){_0x12690e[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x12690e);}else{return logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x56'),util[_0x0036('0x25')](_0xd3b487[_0x0036('0x1b')],{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x1011bd){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x56'),util[_0x0036('0x25')](_0x1011bd,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate','csc',_0x0036('0x61'));}break;case'clickatell':if(_0x4e7d91[_0x0036('0x57')]){var _0x5ebf33={'method':_0x0036('0x4d'),'uri':_0x0036('0x62'),'headers':{'Authorization':_0x4e7d91[_0x0036('0x57')]},'body':{'content':_0x276149[_0x0036('0xc')],'to':[_0x276149['phone']],'from':_0x4e7d91[_0x0036('0x2b')],'binary':![],'clientMessageId':_0x0036('0x63'),'charset':'UTF-8'},'json':!![]};rp(_0x5ebf33)[_0x0036('0x17')](function(_0x3a8d73){if(!_0x3a8d73[_0x0036('0x1b')]){var _0x196643={'messageId':_0x3a8d73[_0x0036('0x47')][0x0][_0x0036('0x64')]};if(!_0x4e7d91[_0x0036('0x36')]){_0x196643[_0x0036('0x37')]=!![];}return _0x36d092[_0x0036('0x18')](_0x196643);}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x65'),util[_0x0036('0x25')](_0x3a8d73[_0x0036('0x1b')],{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x35c69a){return logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x65'),util[_0x0036('0x25')](_0x35c69a,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x65'),_0x0036('0x61'));}break;case _0x0036('0x66'):if(_0x4e7d91[_0x0036('0x29')]&&_0x4e7d91[_0x0036('0x2a')]){var _0x36cf75=util[_0x0036('0x41')](_0x0036('0x40'),_0x4e7d91[_0x0036('0x29')],_0x4e7d91[_0x0036('0x2a')]);var _0x2f3447={'method':'POST','uri':_0x0036('0x67')+_0x4e7d91['accountId']+_0x0036('0x68'),'body':{'to':[_0x276149[_0x0036('0x2b')]],'text':_0x276149[_0x0036('0xc')],'from':_0x4e7d91[_0x0036('0x2b')],'applicationId':_0x4e7d91['applicationId']},'headers':{'Authorization':util[_0x0036('0x41')](_0x0036('0x42'),new Buffer(_0x36cf75)[_0x0036('0x4f')]('base64'))},'json':!![]};rp(_0x2f3447)[_0x0036('0x17')](function(_0x1bad50){if(_0x1bad50['id']){var _0x53826e={'messageId':_0x1bad50['id']};return _0x36d092[_0x0036('0x18')](_0x53826e);}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),util['inspect'](_0x1bad50,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x329aaa){logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),util['inspect'](_0x329aaa,{'showHidden':![],'depth':null}));});}else{logger[_0x0036('0x1b')](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x66'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0036('0x69'):if(_0x4e7d91[_0x0036('0x57')]){var _0x2e4dce={};var _0x5d1243={'method':_0x0036('0x4d'),'uri':_0x0036('0x6a'),'headers':{'Authorization':_0x0036('0x6b')+_0x4e7d91[_0x0036('0x57')],'Content-Type':_0x0036('0x6c')},'body':{'from':_0x4e7d91[_0x0036('0x2b')],'to':_0x276149[_0x0036('0x2b')],'text':_0x276149[_0x0036('0xc')]},'json':!![]};return rp(_0x5d1243)[_0x0036('0x17')](function(_0x58d84f){if(_0x58d84f['code']==0xca){_0x2e4dce['message']=_0x58d84f;var _0x3d3297={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0036('0x6b')+_0x4e7d91[_0x0036('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x2e4dce[_0x0036('0x6d')][_0x0036('0x6e')]},'json':!![]};return rp(_0x3d3297)[_0x0036('0x17')](function(_0x33d49f){_0x2e4dce['status']=_0x33d49f;var _0x924b30={'messageId':_0x2e4dce['message'][_0x0036('0x6e')],'read':!![]};return _0x36d092[_0x0036('0x18')](_0x924b30);});}else{return logger[_0x0036('0x1b')](_0x0036('0x26'),'afterCreate','intelepeer',util[_0x0036('0x25')](_0x58d84f,{'showHidden':![],'depth':null}));}})[_0x0036('0x1a')](function(_0x5e9c38){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0036('0x27'),_0x0036('0x69'),util[_0x0036('0x25')](_0x5e9c38,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x0036('0x26'),_0x0036('0x27'),_0x0036('0x69'),_0x0036('0x6f'));}break;}}})[_0x0036('0x70')](function(){_0x3ac2f9();});}else{_0x3ac2f9();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeacf=['toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','body','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','skebby','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','/status?token=','authId','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','keys','sort','createHash','md5','digest','hex','GET','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','direction'];(function(_0x37c542,_0x22397b){var _0x2fd315=function(_0x39e787){while(--_0x39e787){_0x37c542['push'](_0x37c542['shift']());}};_0x2fd315(++_0x22397b);}(_0xeacf,0x69));var _0xfeac=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xeacf[_0x34021d];return _0x16597b;};'use strict';var _=require('lodash');var util=require(_0xfeac('0x0'));var logger=require('../../config/logger')(_0xfeac('0x1'));var moment=require(_0xfeac('0x2'));var BPromise=require(_0xfeac('0x3'));var rp=require(_0xfeac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfeac('0x5'));var config=require(_0xfeac('0x6'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x235e51,_0x4b0260){return _0x235e51['define'](_0xfeac('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xfeac('0x8'),'fields':[_0xfeac('0x8')]},{'name':_0xfeac('0x9'),'fields':['body'],'type':_0xfeac('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39905a,_0x3734ba,_0x3ae548){var _0x202c45=_0x235e51[_0xfeac('0xb')];var _0x2bb5e7=_0x39905a['get']({'plain':!![]});if(_0x2bb5e7[_0xfeac('0xc')][_0xfeac('0xd')]()==='in'||_0x2bb5e7[_0xfeac('0xc')][_0xfeac('0xd')]()==='out'&&!_0x2bb5e7[_0xfeac('0xe')]&&!_['isNil'](_0x2bb5e7[_0xfeac('0xf')])&&!_[_0xfeac('0x10')](_0x2bb5e7[_0xfeac('0x11')])){_0x202c45[_0xfeac('0x12')]['findOne']({'where':{'id':_0x2bb5e7[_0xfeac('0x11')]}})[_0xfeac('0x13')](function(_0xe32f6e){if(_0xe32f6e){_0xe32f6e[_0xfeac('0x14')]({'lastMsgAt':_0x2bb5e7[_0xfeac('0x15')],'lastMsgDirection':_0x2bb5e7[_0xfeac('0xc')]['toLowerCase']()});}})[_0xfeac('0x16')](function(_0x49d867){console['error'](_0x49d867);});}if(_0x2bb5e7[_0xfeac('0xc')]===_0xfeac('0x17')&&!_0x2bb5e7[_0xfeac('0xe')]){var _0x1e6651;_0x202c45[_0xfeac('0x18')][_0xfeac('0x19')]({'where':{'id':_0x2bb5e7[_0xfeac('0x1a')]},'raw':!![]})['then'](function(_0x4c5062){_0x1e6651=_0x4c5062;if(_0x1e6651&&_0x1e6651[_0xfeac('0x1b')]){switch(_0x1e6651[_0xfeac('0x1b')]){case _0xfeac('0x1c'):var _0x17c0a7=require(_0xfeac('0x1c'));if(_0x1e6651[_0xfeac('0x1d')]&&_0x1e6651[_0xfeac('0x1e')]&&_0x1e6651[_0xfeac('0x1f')]){var _0x2432f6=new _0x17c0a7(_0x1e6651[_0xfeac('0x1d')],_0x1e6651['authToken']);_0x2432f6[_0xfeac('0x20')]['create']({'body':_0x2bb5e7[_0xfeac('0x21')],'to':_0x2bb5e7[_0xfeac('0x1f')],'from':_0x1e6651['phone'],'statusCallback':_0x1e6651[_0xfeac('0x22')]+_0xfeac('0x23')+_0x2bb5e7['id']+'/status?token='+_0x1e6651[_0xfeac('0x24')]})['then'](function(_0x31c106){if(_0x31c106[_0xfeac('0x25')]){return _0x39905a[_0xfeac('0x14')]({'messageId':_0x31c106['sid']});}})[_0xfeac('0x16')](function(_0x4bbac6){logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x1c'),util[_0xfeac('0x28')](_0x4bbac6,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfeac('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xfeac('0x2a'):var _0x2ebff9='https://api.skebby.it/API/v1.0/REST/';if(_0x1e6651[_0xfeac('0x2b')]&&_0x1e6651[_0xfeac('0x2c')]){var _0x38e3a2={'recipient':[_0x2bb5e7['phone']],'message':_0x2bb5e7[_0xfeac('0x21')],'message_type':_0x1e6651[_0xfeac('0x2d')]};if(_0x1e6651['smsMethod']&&_0x1e6651[_0xfeac('0x2d')]!=='SI'){_0x38e3a2[_0xfeac('0x2e')]=_0x1e6651['phone'];}var _0x5eeb24={'url':_0x2ebff9+_0xfeac('0x2f')+_0x1e6651['username']+_0xfeac('0x30')+_0x1e6651[_0xfeac('0x2c')],'method':'GET'};rp(_0x5eeb24)[_0xfeac('0x13')](function(_0x5bc4d5){var _0x37e206=_0x5bc4d5[_0xfeac('0x31')](';');var _0x29dc80={'user_key':_0x37e206[0x0],'session_key':_0x37e206[0x1]};_0x5eeb24={'url':_0x2ebff9+_0xfeac('0x32'),'method':_0xfeac('0x33'),'headers':{'user_key':_0x29dc80[_0xfeac('0x34')],'Session_key':_0x29dc80['session_key']},'json':!![],'body':_0x38e3a2};return rp(_0x5eeb24);})[_0xfeac('0x13')](function(_0x1b85e3){if(_0x1b85e3['total_sent']>=0x1){var _0x3f6513={'messageId':_0x1b85e3['internal_order_id']};if(_0x1e6651[_0xfeac('0x2d')]!=='GP'||!_0x1e6651[_0xfeac('0x35')]){_0x3f6513[_0xfeac('0x36')]=!![];}return _0x39905a['update'](_0x3f6513);}else{return logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x2a'),util[_0xfeac('0x28')](_0x1b85e3,{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x2946b6){return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x2a'),util[_0xfeac('0x28')](_0x2946b6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfeac('0x37'):if(_0x1e6651[_0xfeac('0x1e')]){var _0x4e4db7={'recipient':_0x2bb5e7[_0xfeac('0x1f')],'message':_0x2bb5e7['body'],'sender':_0x1e6651[_0xfeac('0x38')]||_0x1e6651[_0xfeac('0x1f')],'authorization':_0x1e6651[_0xfeac('0x1e')]};var _0x3734ba={'method':_0xfeac('0x33'),'uri':_0xfeac('0x39'),'body':_0x4e4db7,'json':!![]};rp(_0x3734ba)[_0xfeac('0x13')](function(_0x41f9f0){var _0x53335a={'messageId':_0x41f9f0[_0xfeac('0x3a')]};if(!_0x1e6651[_0xfeac('0x35')]){_0x53335a[_0xfeac('0x36')]=!![];}return _0x39905a[_0xfeac('0x14')](_0x53335a);})[_0xfeac('0x16')](function(_0x3156e0){logger[_0xfeac('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfeac('0x37'),util[_0xfeac('0x28')](_0x3156e0,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x37'),_0xfeac('0x3b'));}break;case _0xfeac('0x3c'):if(_0x1e6651[_0xfeac('0x2b')]&&_0x1e6651[_0xfeac('0x2c')]){var _0x4e4db7={'messages':[{'source':_0xfeac('0x3d'),'to':_0x2bb5e7[_0xfeac('0x1f')],'body':_0x2bb5e7[_0xfeac('0x21')],'from':_0x1e6651['senderString']||_0x1e6651[_0xfeac('0x1f')]}]};var _0x578fa5=util[_0xfeac('0x3e')](_0xfeac('0x3f'),_0x1e6651[_0xfeac('0x2b')],_0x1e6651['password']);var _0x3734ba={'method':_0xfeac('0x33'),'uri':_0xfeac('0x40'),'body':_0x4e4db7,'headers':{'Authorization':util[_0xfeac('0x3e')](_0xfeac('0x41'),new Buffer(_0x578fa5)[_0xfeac('0x42')](_0xfeac('0x43')))},'json':!![]};rp(_0x3734ba)['then'](function(_0x281d02){if(_0x281d02[_0xfeac('0x44')]>=0xc8&&_0x281d02['http_code']<=0xce){if(_0x281d02[_0xfeac('0x45')]&&_0x281d02[_0xfeac('0x45')][_0xfeac('0x46')]>0x0){var _0x34fb8f=_[_0xfeac('0x47')](_0x281d02[_0xfeac('0x45')][_0xfeac('0x20')]);var _0x1dab2c={'messageId':_0x34fb8f[_0xfeac('0x48')]};if(!_0x1e6651[_0xfeac('0x35')]){_0x1dab2c[_0xfeac('0x36')]=!![];}return _0x39905a[_0xfeac('0x14')](_0x1dab2c);}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'clickSend',util[_0xfeac('0x28')](_0x281d02,{'showHidden':![],'depth':null}));}}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'clickSend',util[_0xfeac('0x28')](_0x281d02,{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x2c2f8c){logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x49'),util['inspect'](_0x2c2f8c,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x49'),_0xfeac('0x4a'));}break;case _0xfeac('0x4b'):if(_0x1e6651['authId']&&_0x1e6651['authToken']){var _0x4e4db7={'dst':_0x2bb5e7['phone'],'text':_0x2bb5e7[_0xfeac('0x21')],'src':_0x1e6651[_0xfeac('0x38')]||_0x1e6651['phone'],'url':_0x1e6651[_0xfeac('0x22')]+_0xfeac('0x23')+_0x2bb5e7['id']+_0xfeac('0x4c')+_0x1e6651['token']};var _0x578fa5=util[_0xfeac('0x3e')](_0xfeac('0x3f'),_0x1e6651['authId'],_0x1e6651[_0xfeac('0x1e')]);var _0x3734ba={'method':_0xfeac('0x33'),'uri':util[_0xfeac('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1e6651[_0xfeac('0x4d')]),'body':_0x4e4db7,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x578fa5)[_0xfeac('0x42')](_0xfeac('0x43')))},'json':!![]};rp(_0x3734ba)[_0xfeac('0x13')](function(_0x1923a9){var _0x529ff3={'messageId':_0x1923a9['message_uuid'][0x0]};return _0x39905a[_0xfeac('0x14')](_0x529ff3);})[_0xfeac('0x16')](function(_0x1a0768){logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x4b'),util['inspect'](_0x1a0768,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x4b'),_0xfeac('0x4e'));}break;case'infobip':if(_0x1e6651[_0xfeac('0x2b')]&&_0x1e6651[_0xfeac('0x2c')]){if(_0x1e6651[_0xfeac('0x4f')]){var _0x7edd72={'method':_0xfeac('0x33'),'uri':_0x1e6651[_0xfeac('0x4f')]+_0xfeac('0x50'),'body':{'username':_0x1e6651[_0xfeac('0x2b')],'password':_0x1e6651[_0xfeac('0x2c')]},'json':!![]};return rp(_0x7edd72)[_0xfeac('0x13')](function(_0x55b06b){var _0x38d621={'method':_0xfeac('0x33'),'uri':_0x1e6651[_0xfeac('0x4f')]+_0xfeac('0x51'),'body':{'messages':[{'from':_0x1e6651[_0xfeac('0x1f')],'destinations':[{'to':_0x2bb5e7['phone']}],'text':_0x2bb5e7[_0xfeac('0x21')],'notifyUrl':_0x1e6651[_0xfeac('0x22')]+_0xfeac('0x23')+_0x2bb5e7['id']+'/status?token='+_0x1e6651[_0xfeac('0x24')],'notifyContentType':_0xfeac('0x52'),'callbackData':_0x1e6651[_0xfeac('0x1f')]+';'+_0x2bb5e7['body']}]},'headers':{'Authorization':_0xfeac('0x53')+_0x55b06b[_0xfeac('0x24')]},'json':!![]};return rp(_0x38d621)[_0xfeac('0x13')](function(_0x34aa61){if(_0x34aa61[_0xfeac('0x20')]){var _0x348b0e={'messageId':_0x34aa61[_0xfeac('0x20')][0x0][_0xfeac('0x8')]};if(!_0x1e6651[_0xfeac('0x35')]){_0x348b0e['read']=!![];}return _0x39905a[_0xfeac('0x14')](_0x348b0e);}else{return logger[_0xfeac('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfeac('0x54'),util[_0xfeac('0x28')](_0x34aa61,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x52f9d1){return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'infobip',util['inspect'](_0x52f9d1,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x54'),_0xfeac('0x55'));}}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfeac('0x56'):var _0x14de49=require(_0xfeac('0x57'));if(_0x1e6651[_0xfeac('0x58')]){var _0x3732f5={};_0x3732f5['login']=_0x1e6651[_0xfeac('0x2b')];_0x3732f5['phone']=_0x2bb5e7['phone'];_0x3732f5[_0xfeac('0x2e')]=_0x1e6651[_0xfeac('0x1f')];_0x3732f5[_0xfeac('0x59')]=_0x2bb5e7[_0xfeac('0x21')];_0x3732f5['timestamp']=+new Date();var _0x26ab2e='';var _0x55c011='';var _0xac07a5=Object[_0xfeac('0x5a')](_0x3732f5);_0xac07a5[_0xfeac('0x5b')]();for(var _0x4d5e13=0x0;_0x4d5e13<_0xac07a5['length'];_0x4d5e13++){if(_0x26ab2e!=''){_0x26ab2e+='&';}_0x26ab2e+=_0xac07a5[_0x4d5e13]+'='+encodeURIComponent(_0x3732f5[_0xac07a5[_0x4d5e13]]);_0x55c011+=_0x3732f5[_0xac07a5[_0x4d5e13]];}_0x55c011+=_0x1e6651[_0xfeac('0x58')];_0x55c011=_0x14de49[_0xfeac('0x5c')](_0xfeac('0x5d'))['update'](_0x55c011)[_0xfeac('0x5e')](_0xfeac('0x5f'));if(_0x26ab2e!==''){_0x26ab2e+='&';}_0x26ab2e+='signature='+_0x55c011;var _0x5eeb24={'method':_0xfeac('0x60'),'uri':_0x1e6651[_0xfeac('0x4f')]+_0xfeac('0x61')+_0x26ab2e,'json':!![]};return rp(_0x5eeb24)['then'](function(_0x4bcdcf){var _0x4388cf=Object[_0xfeac('0x5a')](_0x4bcdcf);if(_0x4bcdcf[_0x4388cf[0x0]][_0xfeac('0x29')]&&parseInt(_0x4bcdcf[_0x4388cf[0x0]][_0xfeac('0x29')])===0x0){var _0x74c801={'messageId':_0x4bcdcf[_0x4388cf[0x0]][_0xfeac('0x62')]};if(!_0x1e6651[_0xfeac('0x35')]){_0x74c801['read']=!![];}return _0x39905a[_0xfeac('0x14')](_0x74c801);}else{return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x56'),util[_0xfeac('0x28')](_0x4bcdcf[_0xfeac('0x29')],{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x5295c6){return logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),'csc',util[_0xfeac('0x28')](_0x5295c6,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),'afterCreate',_0xfeac('0x56'),'Missing\x20parameters:\x20apiKey');}break;case _0xfeac('0x63'):if(_0x1e6651[_0xfeac('0x58')]){var _0x145c81={'method':'POST','uri':_0xfeac('0x64'),'headers':{'Authorization':_0x1e6651[_0xfeac('0x58')]},'body':{'content':_0x2bb5e7[_0xfeac('0x21')],'to':[_0x2bb5e7[_0xfeac('0x1f')]],'from':_0x1e6651['phone'],'binary':![],'clientMessageId':'uuid','charset':_0xfeac('0x65')},'json':!![]};rp(_0x145c81)[_0xfeac('0x13')](function(_0xa59ca6){if(!_0xa59ca6[_0xfeac('0x29')]){var _0x96178f={'messageId':_0xa59ca6[_0xfeac('0x20')][0x0][_0xfeac('0x66')]};if(!_0x1e6651[_0xfeac('0x35')]){_0x96178f[_0xfeac('0x36')]=!![];}return _0x39905a['update'](_0x96178f);}else{return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x63'),util[_0xfeac('0x28')](_0xa59ca6[_0xfeac('0x29')],{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x2d8c67){return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'clickatell',util[_0xfeac('0x28')](_0x2d8c67,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x63'),_0xfeac('0x67'));}break;case _0xfeac('0x68'):if(_0x1e6651[_0xfeac('0x2b')]&&_0x1e6651[_0xfeac('0x2c')]){var _0x578fa5=util[_0xfeac('0x3e')](_0xfeac('0x3f'),_0x1e6651[_0xfeac('0x2b')],_0x1e6651['password']);var _0x3734ba={'method':_0xfeac('0x33'),'uri':_0xfeac('0x69')+_0x1e6651[_0xfeac('0x6a')]+_0xfeac('0x6b'),'body':{'to':[_0x2bb5e7[_0xfeac('0x1f')]],'text':_0x2bb5e7[_0xfeac('0x21')],'from':_0x1e6651[_0xfeac('0x1f')],'applicationId':_0x1e6651[_0xfeac('0x6c')]},'headers':{'Authorization':util[_0xfeac('0x3e')]('Basic\x20%s',new Buffer(_0x578fa5)[_0xfeac('0x42')](_0xfeac('0x43')))},'json':!![]};rp(_0x3734ba)['then'](function(_0xd53abb){if(_0xd53abb['id']){var _0x5738b7={'messageId':_0xd53abb['id']};return _0x39905a[_0xfeac('0x14')](_0x5738b7);}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'bandwidth',util[_0xfeac('0x28')](_0xd53abb,{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x3e48f8){logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x68'),util['inspect'](_0x3e48f8,{'showHidden':![],'depth':null}));});}else{logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x68'),_0xfeac('0x4a'));}break;case'intelepeer':if(_0x1e6651['apiKey']){var _0x110c33={};var _0x5eeb24={'method':_0xfeac('0x33'),'uri':_0xfeac('0x6d'),'headers':{'Authorization':_0xfeac('0x6e')+_0x1e6651[_0xfeac('0x58')],'Content-Type':_0xfeac('0x52')},'body':{'from':_0x1e6651[_0xfeac('0x1f')],'to':_0x2bb5e7[_0xfeac('0x1f')],'text':_0x2bb5e7[_0xfeac('0x21')]},'json':!![]};return rp(_0x5eeb24)['then'](function(_0x532729){if(_0x532729['code']==0xca){_0x110c33[_0xfeac('0x6f')]=_0x532729;var _0x119f77={'method':_0xfeac('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xfeac('0x6e')+_0x1e6651[_0xfeac('0x58')],'Content-Type':_0xfeac('0x52')},'body':{'refid':_0x110c33[_0xfeac('0x6f')][_0xfeac('0x70')]},'json':!![]};return rp(_0x119f77)[_0xfeac('0x13')](function(_0x13e07a){_0x110c33[_0xfeac('0x71')]=_0x13e07a;var _0x37bed0={'messageId':_0x110c33[_0xfeac('0x6f')][_0xfeac('0x70')],'read':!![]};return _0x39905a[_0xfeac('0x14')](_0x37bed0);});}else{return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x72'),util[_0xfeac('0x28')](_0x532729,{'showHidden':![],'depth':null}));}})[_0xfeac('0x16')](function(_0x582f39){return logger['error'](_0xfeac('0x26'),_0xfeac('0x27'),_0xfeac('0x72'),util[_0xfeac('0x28')](_0x582f39,{'showHidden':![],'depth':null}));});}else{return logger[_0xfeac('0x29')](_0xfeac('0x26'),_0xfeac('0x27'),'intelepeer',_0xfeac('0x73'));}break;}}})[_0xfeac('0x74')](function(){_0x3ae548();});}else{_0x3ae548();}}},'charset':_0xfeac('0x75'),'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 70bd840..6fc316b 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 _0xd060=['create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x32c04b,_0x187085){var _0x2947b1=function(_0x3dc2b4){while(--_0x3dc2b4){_0x32c04b['push'](_0x32c04b['shift']());}};_0x2947b1(++_0x187085);}(_0xd060,0x140));var _0x0d06=function(_0xfc775e,_0x342a76){_0xfc775e=_0xfc775e-0x0;var _0x4c4a40=_0xd060[_0xfc775e];return _0x4c4a40;};'use strict';var _=require('lodash');var util=require(_0x0d06('0x0'));var moment=require(_0x0d06('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d06('0x2'));var fs=require('fs');var Redis=require(_0x0d06('0x3'));var db=require(_0x0d06('0x4'))['db'];var utils=require(_0x0d06('0x5'));var logger=require(_0x0d06('0x6'))(_0x0d06('0x7'));var config=require(_0x0d06('0x8'));var jayson=require(_0x0d06('0x9'));var client=jayson[_0x0d06('0xa')][_0x0d06('0xb')]({'port':0x232a});config[_0x0d06('0xc')]=_['defaults'](config[_0x0d06('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d06('0xd'))(new Redis(config['redis']));require(_0x0d06('0xe'))[_0x0d06('0xf')](socket);function respondWithRpcPromise(_0x500005,_0x3e709a,_0x588d6a){return new BPromise(function(_0x2df518,_0x887b0a){return client[_0x0d06('0x10')](_0x500005,_0x588d6a)[_0x0d06('0x11')](function(_0x323880){logger[_0x0d06('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x0d06('0x13'));logger[_0x0d06('0x14')](_0x0d06('0x15'),_0x3e709a,_0x0d06('0x13'),JSON['stringify'](_0x323880));if(_0x323880['error']){if(_0x323880['error'][_0x0d06('0x16')]===0x1f4){logger[_0x0d06('0x17')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x323880[_0x0d06('0x17')][_0x0d06('0x18')]);return _0x887b0a(_0x323880[_0x0d06('0x17')][_0x0d06('0x18')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x323880[_0x0d06('0x17')]['message']);return _0x2df518(_0x323880['error'][_0x0d06('0x18')]);}else{logger[_0x0d06('0x12')](_0x0d06('0x19'),_0x3e709a,_0x0d06('0x13'));_0x2df518(_0x323880[_0x0d06('0x1a')][_0x0d06('0x18')]);}})[_0x0d06('0x1b')](function(_0x5b9edd){logger[_0x0d06('0x17')]('SmsMessage,\x20%s,\x20%s',_0x3e709a,_0x5b9edd);_0x887b0a(_0x5b9edd);});});}exports[_0x0d06('0x1c')]=function(_0x312433){var _0x4abef7=this;return new Promise(function(_0x80e288,_0x5cc8f9){return db[_0x0d06('0x1d')][_0x0d06('0x1e')](_0x312433[_0x0d06('0x1f')],{'raw':_0x312433[_0x0d06('0x20')]?_0x312433[_0x0d06('0x20')][_0x0d06('0x21')]===undefined?!![]:![]:!![]})[_0x0d06('0x11')](function(_0x1779af){logger[_0x0d06('0x12')](_0x0d06('0x1c'),_0x312433);logger['debug'](_0x0d06('0x1c'),_0x312433,JSON[_0x0d06('0x22')](_0x1779af));_0x80e288(_0x1779af);})['catch'](function(_0x415d54){logger[_0x0d06('0x17')]('CreateSmsMessage',_0x415d54[_0x0d06('0x18')],_0x312433);_0x5cc8f9(_0x4abef7[_0x0d06('0x17')](0x1f4,_0x415d54[_0x0d06('0x18')]));});});}; \ No newline at end of file +var _0x292e=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x5f495e,_0x558cd2){var _0x2f9240=function(_0x3d82d5){while(--_0x3d82d5){_0x5f495e['push'](_0x5f495e['shift']());}};_0x2f9240(++_0x558cd2);}(_0x292e,0x171));var _0xe292=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x292e[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xe292('0x0'));var util=require('util');var moment=require(_0xe292('0x1'));var BPromise=require(_0xe292('0x2'));var rs=require(_0xe292('0x3'));var fs=require('fs');var Redis=require(_0xe292('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe292('0x5'))(_0xe292('0x6'));var config=require('../../config/environment');var jayson=require(_0xe292('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xe292('0x8')]=_[_0xe292('0x9')](config['redis'],{'host':_0xe292('0xa'),'port':0x18eb});var socket=require(_0xe292('0xb'))(new Redis(config[_0xe292('0x8')]));require(_0xe292('0xc'))[_0xe292('0xd')](socket);function respondWithRpcPromise(_0x53779f,_0x3b338a,_0x2cd91a){return new BPromise(function(_0x51de87,_0x3daff5){return client[_0xe292('0xe')](_0x53779f,_0x2cd91a)[_0xe292('0xf')](function(_0x57988c){logger[_0xe292('0x10')](_0xe292('0x11'),_0x3b338a,_0xe292('0x12'));logger[_0xe292('0x13')](_0xe292('0x14'),_0x3b338a,_0xe292('0x12'),JSON['stringify'](_0x57988c));if(_0x57988c[_0xe292('0x15')]){if(_0x57988c[_0xe292('0x15')][_0xe292('0x16')]===0x1f4){logger['error'](_0xe292('0x11'),_0x3b338a,_0x57988c[_0xe292('0x15')][_0xe292('0x17')]);return _0x3daff5(_0x57988c[_0xe292('0x15')][_0xe292('0x17')]);}logger[_0xe292('0x15')](_0xe292('0x11'),_0x3b338a,_0x57988c['error'][_0xe292('0x17')]);return _0x51de87(_0x57988c[_0xe292('0x15')][_0xe292('0x17')]);}else{logger['info'](_0xe292('0x11'),_0x3b338a,_0xe292('0x12'));_0x51de87(_0x57988c[_0xe292('0x18')][_0xe292('0x17')]);}})[_0xe292('0x19')](function(_0x5b2757){logger[_0xe292('0x15')](_0xe292('0x11'),_0x3b338a,_0x5b2757);_0x3daff5(_0x5b2757);});});}exports[_0xe292('0x1a')]=function(_0x1c4fd3){var _0x5661a2=this;return new Promise(function(_0x4036ad,_0x1c4bc6){return db[_0xe292('0x1b')]['create'](_0x1c4fd3[_0xe292('0x1c')],{'raw':_0x1c4fd3[_0xe292('0x1d')]?_0x1c4fd3[_0xe292('0x1d')][_0xe292('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5b3cf9){logger['info'](_0xe292('0x1a'),_0x1c4fd3);logger[_0xe292('0x13')]('CreateSmsMessage',_0x1c4fd3,JSON[_0xe292('0x1f')](_0x5b3cf9));_0x4036ad(_0x5b3cf9);})[_0xe292('0x19')](function(_0x14f22a){logger['error'](_0xe292('0x1a'),_0x14f22a[_0xe292('0x17')],_0x1c4fd3);_0x1c4bc6(_0x5661a2[_0xe292('0x15')](0x1f4,_0x14f22a[_0xe292('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 5a704cc..a56bb7a 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 _0x6ac1=['length','smsMessage:','./smsMessage.events','save','update','emit','register'];(function(_0x207785,_0x40e205){var _0x332792=function(_0x7cd13f){while(--_0x7cd13f){_0x207785['push'](_0x207785['shift']());}};_0x332792(++_0x40e205);}(_0x6ac1,0x113));var _0x16ac=function(_0x40cdc3,_0x76825d){_0x40cdc3=_0x40cdc3-0x0;var _0x5bda2b=_0x6ac1[_0x40cdc3];return _0x5bda2b;};'use strict';var SmsMessageEvents=require(_0x16ac('0x0'));var events=[_0x16ac('0x1'),'remove',_0x16ac('0x2')];function createListener(_0x5f1ca9,_0x578892){return function(_0x52fa43){_0x578892[_0x16ac('0x3')](_0x5f1ca9,_0x52fa43);};}function removeListener(_0x32f020,_0x4c0763){return function(){SmsMessageEvents['removeListener'](_0x32f020,_0x4c0763);};}exports[_0x16ac('0x4')]=function(_0x461617){for(var _0xb247a6=0x0,_0x23b200=events[_0x16ac('0x5')];_0xb247a6<_0x23b200;_0xb247a6++){var _0x23ad4b=events[_0xb247a6];var _0x33899a=createListener(_0x16ac('0x6')+_0x23ad4b,_0x461617);SmsMessageEvents['on'](_0x23ad4b,_0x33899a);}}; \ No newline at end of file +var _0xd44d=['smsMessage:','./smsMessage.events','remove','removeListener','register','length'];(function(_0x228f89,_0x3b2cd2){var _0x4ec800=function(_0x281368){while(--_0x281368){_0x228f89['push'](_0x228f89['shift']());}};_0x4ec800(++_0x3b2cd2);}(_0xd44d,0x193));var _0xdd44=function(_0x52ad66,_0x4bd700){_0x52ad66=_0x52ad66-0x0;var _0x5d11b5=_0xd44d[_0x52ad66];return _0x5d11b5;};'use strict';var SmsMessageEvents=require(_0xdd44('0x0'));var events=['save',_0xdd44('0x1'),'update'];function createListener(_0x48de9e,_0xa25725){return function(_0x1e62b3){_0xa25725['emit'](_0x48de9e,_0x1e62b3);};}function removeListener(_0x30de8a,_0x511c3c){return function(){SmsMessageEvents[_0xdd44('0x2')](_0x30de8a,_0x511c3c);};}exports[_0xdd44('0x3')]=function(_0x23fbbe){for(var _0xa9f41e=0x0,_0x156133=events[_0xdd44('0x4')];_0xa9f41e<_0x156133;_0xa9f41e++){var _0x5b3390=events[_0xa9f41e];var _0x27304c=createListener(_0xdd44('0x5')+_0x5b3390,_0x23fbbe);SmsMessageEvents['on'](_0x5b3390,_0x27304c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index f717c5c..6c1981d 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 _0xb914=['get','isAuthenticated','index','/describe','describe','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','delete','destroy','/:id/teams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xb914,0x83));var _0x4b91=function(_0x54aff6,_0xc4c096){_0x54aff6=_0x54aff6-0x0;var _0x487a36=_0xb914[_0x54aff6];return _0x487a36;};'use strict';var multer=require(_0x4b91('0x0'));var util=require(_0x4b91('0x1'));var path=require(_0x4b91('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b91('0x3'));var router=express[_0x4b91('0x4')]();var fs_extra=require(_0x4b91('0x5'));var auth=require(_0x4b91('0x6'));var interaction=require(_0x4b91('0x7'));var config=require('../../config/environment');var controller=require(_0x4b91('0x8'));router[_0x4b91('0x9')]('/',auth[_0x4b91('0xa')](),controller[_0x4b91('0xb')]);router[_0x4b91('0x9')](_0x4b91('0xc'),auth['isAuthenticated'](),controller[_0x4b91('0xd')]);router['get']('/:id',auth[_0x4b91('0xa')](),controller['show']);router[_0x4b91('0x9')]('/:id/members',auth[_0x4b91('0xa')](),controller[_0x4b91('0xe')]);router[_0x4b91('0x9')]('/:id/teams',auth[_0x4b91('0xa')](),controller['getTeams']);router[_0x4b91('0x9')]('/:id/users',auth[_0x4b91('0xa')](),controller[_0x4b91('0xf')]);router[_0x4b91('0x10')]('/',auth['isAuthenticated'](),controller[_0x4b91('0x11')]);router[_0x4b91('0x10')]('/:id/teams',auth[_0x4b91('0xa')](),controller[_0x4b91('0x12')]);router[_0x4b91('0x10')](_0x4b91('0x13'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x14')]);router[_0x4b91('0x15')](_0x4b91('0x16'),auth[_0x4b91('0xa')](),controller['update']);router[_0x4b91('0x17')](_0x4b91('0x16'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x18')]);router['delete'](_0x4b91('0x19'),auth[_0x4b91('0xa')](),controller['removeTeams']);router[_0x4b91('0x17')](_0x4b91('0x13'),auth[_0x4b91('0xa')](),controller[_0x4b91('0x1a')]);module[_0x4b91('0x1b')]=router; \ No newline at end of file +var _0x1c94=['Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','delete','removeTeams','exports','multer','path','connect-timeout'];(function(_0x4b03fe,_0x4f4658){var _0x4d9a9f=function(_0x5f52b7){while(--_0x5f52b7){_0x4b03fe['push'](_0x4b03fe['shift']());}};_0x4d9a9f(++_0x4f4658);}(_0x1c94,0x11d));var _0x41c9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1c94[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x41c9('0x0'));var util=require('util');var path=require(_0x41c9('0x1'));var timeout=require(_0x41c9('0x2'));var express=require('express');var router=express[_0x41c9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x41c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x41c9('0x5'));var controller=require(_0x41c9('0x6'));router[_0x41c9('0x7')]('/',auth[_0x41c9('0x8')](),controller['index']);router[_0x41c9('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x41c9('0x9')]);router[_0x41c9('0x7')](_0x41c9('0xa'),auth['isAuthenticated'](),controller[_0x41c9('0xb')]);router[_0x41c9('0x7')](_0x41c9('0xc'),auth[_0x41c9('0x8')](),controller[_0x41c9('0xd')]);router['get'](_0x41c9('0xe'),auth[_0x41c9('0x8')](),controller['getTeams']);router['get']('/:id/users',auth[_0x41c9('0x8')](),controller[_0x41c9('0xf')]);router['post']('/',auth[_0x41c9('0x8')](),controller[_0x41c9('0x10')]);router[_0x41c9('0x11')]('/:id/teams',auth[_0x41c9('0x8')](),controller[_0x41c9('0x12')]);router['post'](_0x41c9('0x13'),auth[_0x41c9('0x8')](),controller[_0x41c9('0x14')]);router['put'](_0x41c9('0xa'),auth[_0x41c9('0x8')](),controller['update']);router['delete']('/:id',auth[_0x41c9('0x8')](),controller['destroy']);router[_0x41c9('0x15')](_0x41c9('0xe'),auth['isAuthenticated'](),controller[_0x41c9('0x16')]);router[_0x41c9('0x15')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x41c9('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4437163..5bee8dd 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 _0x28fe=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2f4b9f,_0x47a25d){var _0x1439cd=function(_0x437913){while(--_0x437913){_0x2f4b9f['push'](_0x2f4b9f['shift']());}};_0x1439cd(++_0x47a25d);}(_0x28fe,0x142));var _0xe28f=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x28fe[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require(_0xe28f('0x0'));module[_0xe28f('0x1')]={'name':{'type':Sequelize[_0xe28f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe28f('0x2')]},'timeout':{'type':Sequelize[_0xe28f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe28f('0x4')](_0xe28f('0x5'),_0xe28f('0x6'),_0xe28f('0x7'))}}; \ No newline at end of file +var _0x5c23=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x18aad7,_0x35b12c){var _0x99611=function(_0x31cdef){while(--_0x31cdef){_0x18aad7['push'](_0x18aad7['shift']());}};_0x99611(++_0x35b12c);}(_0x5c23,0xa0));var _0x35c2=function(_0x60b536,_0x4d4fab){_0x60b536=_0x60b536-0x0;var _0x1833a7=_0x5c23[_0x60b536];return _0x1833a7;};'use strict';var Sequelize=require(_0x35c2('0x0'));module['exports']={'name':{'type':Sequelize[_0x35c2('0x1')],'unique':_0x35c2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x35c2('0x1')]},'timeout':{'type':Sequelize[_0x35c2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x35c2('0x4')](_0x35c2('0x5'),_0x35c2('0x6'),_0x35c2('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d4cdb21..83fc5e3 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 _0x86bc=['voicePause','interface','flatMap','transaction','each','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','union','compact','forEach','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','catch','create','body','user','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online'];(function(_0x2725ab,_0x469dcb){var _0xf77ae6=function(_0x3067ad){while(--_0x3067ad){_0x2725ab['push'](_0x2725ab['shift']());}};_0xf77ae6(++_0x469dcb);}(_0x86bc,0x1b1));var _0xc86b=function(_0x4a2bd2,_0x5bba90){_0x4a2bd2=_0x4a2bd2-0x0;var _0x25356a=_0x86bc[_0x4a2bd2];return _0x25356a;};'use strict';var emlformat=require(_0xc86b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc86b('0x1'));var jsonpatch=require(_0xc86b('0x2'));var rp=require(_0xc86b('0x3'));var moment=require(_0xc86b('0x4'));var BPromise=require(_0xc86b('0x5'));var Mustache=require(_0xc86b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc86b('0x7'));var csv=require('to-csv');var ejs=require(_0xc86b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc86b('0x9'));var crypto=require(_0xc86b('0xa'));var jsforce=require(_0xc86b('0xb'));var deskjs=require(_0xc86b('0xc'));var toCsv=require(_0xc86b('0xd'));var querystring=require('querystring');var Papa=require(_0xc86b('0xe'));var Redis=require(_0xc86b('0xf'));var authService=require(_0xc86b('0x10'));var qs=require(_0xc86b('0x11'));var as=require(_0xc86b('0x12'));var hardwareService=require(_0xc86b('0x13'));var logger=require(_0xc86b('0x14'))(_0xc86b('0x15'));var utils=require('../../config/utils');var config=require(_0xc86b('0x16'));var licenseUtil=require(_0xc86b('0x17'));var db=require(_0xc86b('0x18'))['db'];config['redis']=_[_0xc86b('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc86b('0x1a'))(new Redis(config[_0xc86b('0x1b')]));require('./smsQueue.socket')[_0xc86b('0x1c')](socket);function respondWithStatusCode(_0x59d5bf,_0x12dab3){_0x12dab3=_0x12dab3||0xcc;return function(_0x244fea){if(_0x244fea){return _0x59d5bf[_0xc86b('0x1d')](_0x12dab3);}return _0x59d5bf[_0xc86b('0x1e')](_0x12dab3)[_0xc86b('0x1f')]();};}function respondWithResult(_0x534b48,_0x360916){_0x360916=_0x360916||0xc8;return function(_0x22beec){if(_0x22beec){return _0x534b48[_0xc86b('0x1e')](_0x360916)[_0xc86b('0x20')](_0x22beec);}};}function respondWithFilteredResult(_0x53dcf3,_0x346ed7){return function(_0x42479a){if(_0x42479a){var _0x36d681=typeof _0x346ed7[_0xc86b('0x21')]==='undefined'&&typeof _0x346ed7[_0xc86b('0x22')]===_0xc86b('0x23');var _0x4c0a21=_0x42479a[_0xc86b('0x24')];var _0x2ade00=_0x36d681?0x0:_0x346ed7['offset'];var _0x58446d=_0x36d681?_0x42479a[_0xc86b('0x24')]:_0x346ed7['offset']+_0x346ed7[_0xc86b('0x22')];var _0x517b18;if(_0x58446d>=_0x4c0a21){_0x58446d=_0x4c0a21;_0x517b18=0xc8;}else{_0x517b18=0xce;}_0x53dcf3[_0xc86b('0x1e')](_0x517b18);return _0x53dcf3[_0xc86b('0x25')]('Content-Range',_0x2ade00+'-'+_0x58446d+'/'+_0x4c0a21)[_0xc86b('0x20')](_0x42479a);}return null;};}function patchUpdates(_0x4e0322){return function(_0xc71c29){try{jsonpatch[_0xc86b('0x26')](_0xc71c29,_0x4e0322,!![]);}catch(_0x276c72){return BPromise[_0xc86b('0x27')](_0x276c72);}return _0xc71c29['save']();};}function saveUpdates(_0x819baf,_0x1a2c27){return function(_0x212be7){if(_0x212be7){return _0x212be7[_0xc86b('0x28')](_0x819baf)[_0xc86b('0x29')](function(_0x4ef627){return _0x4ef627;});}return null;};}function removeEntity(_0x41b99c,_0x564f1){return function(_0xe7dc4b){if(_0xe7dc4b){return _0xe7dc4b[_0xc86b('0x2a')]()[_0xc86b('0x29')](function(){var _0x4d66bd=_0xe7dc4b[_0xc86b('0x2b')]({'plain':!![]});var _0x57c7fd=_0xc86b('0x2c');return db[_0xc86b('0x2d')][_0xc86b('0x2a')]({'where':{'type':_0x57c7fd,'resourceId':_0x4d66bd['id']}})[_0xc86b('0x29')](function(){return _0xe7dc4b;});})[_0xc86b('0x29')](function(){_0x41b99c[_0xc86b('0x1e')](0xcc)[_0xc86b('0x1f')]();});}};}function handleEntityNotFound(_0x259db7,_0x37fc26){return function(_0x35ca48){if(!_0x35ca48){_0x259db7[_0xc86b('0x1d')](0x194);}return _0x35ca48;};}function handleError(_0x5ca37b,_0x5101f0){_0x5101f0=_0x5101f0||0x1f4;return function(_0x58767a){logger[_0xc86b('0x2e')](_0x58767a['stack']);if(_0x58767a['name']){delete _0x58767a[_0xc86b('0x2f')];}_0x5ca37b[_0xc86b('0x1e')](_0x5101f0)[_0xc86b('0x30')](_0x58767a);};}exports[_0xc86b('0x31')]=function(_0x1597f7,_0x519770){var _0x56f3f5={},_0x115223={},_0x282301={'count':0x0,'rows':[]};var _0x9e4348=_[_0xc86b('0x32')](db[_0xc86b('0x33')][_0xc86b('0x34')],function(_0x42ca71){return{'name':_0x42ca71['fieldName'],'type':_0x42ca71[_0xc86b('0x35')]['key']};});_0x115223[_0xc86b('0x36')]=_[_0xc86b('0x32')](_0x9e4348,_0xc86b('0x2f'));_0x115223[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x1597f7['query']);_0x115223[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x115223[_0xc86b('0x36')],_0x115223['query']);_0x56f3f5[_0xc86b('0x3b')]=_['intersection'](_0x115223['model'],qs[_0xc86b('0x3c')](_0x1597f7['query']['fields']));_0x56f3f5[_0xc86b('0x3b')]=_0x56f3f5[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x56f3f5['attributes']:_0x115223['model'];if(!_0x1597f7[_0xc86b('0x37')][_0xc86b('0x3e')]('nolimit')){_0x56f3f5['limit']=qs[_0xc86b('0x22')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x22')]);_0x56f3f5[_0xc86b('0x21')]=qs['offset'](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x56f3f5[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x1597f7[_0xc86b('0x37')][_0xc86b('0x40')]);_0x56f3f5[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_['pick'](_0x1597f7[_0xc86b('0x37')],_0x115223[_0xc86b('0x39')]),_0x9e4348);if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x42')]){_0x56f3f5[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x56f3f5[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x9e4348,function(_0x4105cb){if(_0x4105cb[_0xc86b('0x35')]!=='VIRTUAL'){var _0x132860={};_0x132860[_0x4105cb[_0xc86b('0x2f')]]={'$like':'%'+_0x1597f7['query'][_0xc86b('0x42')]+'%'};return _0x132860;}})});}_0x56f3f5=_[_0xc86b('0x43')]({},_0x56f3f5,_0x1597f7[_0xc86b('0x44')]);var _0x3e3ce5={'where':_0x56f3f5[_0xc86b('0x41')]};return db[_0xc86b('0x33')]['count'](_0x3e3ce5)['then'](function(_0x5d7693){_0x282301[_0xc86b('0x24')]=_0x5d7693;if(_0x1597f7[_0xc86b('0x37')][_0xc86b('0x45')]){_0x56f3f5[_0xc86b('0x46')]=[{'all':!![]}];}return db[_0xc86b('0x33')]['findAll'](_0x56f3f5);})['then'](function(_0x134e76){_0x282301['rows']=_0x134e76;return _0x282301;})[_0xc86b('0x29')](respondWithFilteredResult(_0x519770,_0x56f3f5))[_0xc86b('0x47')](handleError(_0x519770,null));};exports['show']=function(_0x45f33f,_0x5b5815){var _0x485671={'raw':!![],'where':{'id':_0x45f33f['params']['id']}},_0x55228c={};_0x55228c[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x33')]['rawAttributes']);_0x55228c['query']=_[_0xc86b('0x38')](_0x45f33f[_0xc86b('0x37')]);_0x55228c[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x55228c['model'],_0x55228c[_0xc86b('0x37')]);_0x485671[_0xc86b('0x3b')]=_['intersection'](_0x55228c[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x45f33f['query'][_0xc86b('0x3c')]));_0x485671[_0xc86b('0x3b')]=_0x485671[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x485671[_0xc86b('0x3b')]:_0x55228c[_0xc86b('0x36')];if(_0x45f33f[_0xc86b('0x37')][_0xc86b('0x45')]){_0x485671[_0xc86b('0x46')]=[{'all':!![]}];}_0x485671=_[_0xc86b('0x43')]({},_0x485671,_0x45f33f[_0xc86b('0x44')]);return db[_0xc86b('0x33')]['find'](_0x485671)['then'](handleEntityNotFound(_0x5b5815,null))[_0xc86b('0x29')](respondWithResult(_0x5b5815,null))['catch'](handleError(_0x5b5815,null));};exports[_0xc86b('0x48')]=function(_0x28f9a6,_0x5e8bcc){return db['SmsQueue'][_0xc86b('0x48')](_0x28f9a6[_0xc86b('0x49')],{})[_0xc86b('0x29')](function(_0x405068){var _0x47c43a=_0x28f9a6[_0xc86b('0x4a')][_0xc86b('0x2b')]({'plain':!![]});if(!_0x47c43a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47c43a[_0xc86b('0x4b')]===_0xc86b('0x4a')){var _0x40e35e=_0x405068[_0xc86b('0x2b')]({'plain':!![]});var _0x6f806c='SmsQueues';return db['UserProfileSection'][_0xc86b('0x4c')]({'where':{'name':_0x6f806c,'userProfileId':_0x47c43a['userProfileId']},'raw':!![]})['then'](function(_0x389bf3){if(_0x389bf3&&_0x389bf3['autoAssociation']===0x0){return db[_0xc86b('0x2d')][_0xc86b('0x48')]({'name':_0x40e35e[_0xc86b('0x2f')],'resourceId':_0x40e35e['id'],'type':_0x389bf3[_0xc86b('0x2f')],'sectionId':_0x389bf3['id']},{})['then'](function(){return _0x405068;});}else{return _0x405068;}})[_0xc86b('0x47')](function(_0x29d1d0){logger[_0xc86b('0x2e')](_0xc86b('0x4d'),_0x29d1d0);throw _0x29d1d0;});}return _0x405068;})[_0xc86b('0x29')](respondWithResult(_0x5e8bcc,0xc9))[_0xc86b('0x47')](handleError(_0x5e8bcc,null));};exports[_0xc86b('0x28')]=function(_0x435858,_0x186019){if(_0x435858[_0xc86b('0x49')]['id']){delete _0x435858[_0xc86b('0x49')]['id'];}return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x435858[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x186019,null))[_0xc86b('0x29')](saveUpdates(_0x435858[_0xc86b('0x49')],null))['then'](respondWithResult(_0x186019,null))['catch'](handleError(_0x186019,null));};exports[_0xc86b('0x2a')]=function(_0x4f26c1,_0x3cc6d8){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x4f26c1[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3cc6d8,null))['then'](removeEntity(_0x3cc6d8,null))[_0xc86b('0x47')](handleError(_0x3cc6d8,null));};exports[_0xc86b('0x4f')]=function(_0x3a276b,_0x15516c){return db[_0xc86b('0x33')]['describe']()[_0xc86b('0x29')](respondWithResult(_0x15516c,null))[_0xc86b('0x47')](handleError(_0x15516c,null));};exports[_0xc86b('0x50')]=function(_0x468218,_0x15a461,_0x598df0){var _0x4e6219={'raw':!![],'where':{}},_0x403dfe={},_0x11077c;return db[_0xc86b('0x33')][_0xc86b('0x51')]({'where':{'id':_0x468218[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x15a461,null))[_0xc86b('0x29')](function(_0x1be7cf){if(_0x1be7cf){_0x11077c=_0x1be7cf['get']({'plain':!![]});_0x403dfe[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x52')][_0xc86b('0x34')]);_0x403dfe[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x468218['query']);_0x403dfe[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x403dfe[_0xc86b('0x36')],_0x403dfe['query']);_0x4e6219[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x403dfe['model'],qs[_0xc86b('0x3c')](_0x468218[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x4e6219['attributes']=_0x4e6219[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x4e6219[_0xc86b('0x3b')]:_0x403dfe[_0xc86b('0x36')];if(!_0x468218['query'][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x4e6219[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x468218[_0xc86b('0x37')][_0xc86b('0x22')]);_0x4e6219[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x468218[_0xc86b('0x37')][_0xc86b('0x21')]);}_0x4e6219['order']=qs[_0xc86b('0x40')](_0x468218[_0xc86b('0x37')][_0xc86b('0x40')]);_0x4e6219[_0xc86b('0x41')]=qs[_0xc86b('0x39')](_[_0xc86b('0x54')](_0x468218[_0xc86b('0x37')],_0x403dfe['filters']));_0x4e6219[_0xc86b('0x41')][_0xc86b('0x55')]=_0x1be7cf['id'];if(_0x468218[_0xc86b('0x37')][_0xc86b('0x42')]){_0x4e6219['where']=_[_0xc86b('0x43')](_0x4e6219[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x4e6219[_0xc86b('0x3b')],function(_0x432d39){var _0x3a9022={};_0x3a9022[_0x432d39]={'$like':'%'+_0x468218[_0xc86b('0x37')]['filter']+'%'};return _0x3a9022;})});}_0x4e6219=_[_0xc86b('0x43')]({},_0x4e6219,_0x468218[_0xc86b('0x44')]);return db[_0xc86b('0x52')][_0xc86b('0x56')](_0x4e6219);}})[_0xc86b('0x29')](function(_0x4b126c){if(_0x4b126c){return db[_0xc86b('0x57')][_0xc86b('0x58')]({'where':{'id':_[_0xc86b('0x32')](_0x4b126c,_0xc86b('0x59')),'role':_0xc86b('0x5a')},'attributes':['id','name',_0xc86b('0x5b'),_0xc86b('0x5c'),_0xc86b('0x5d')]});}})['then'](function(_0x31b971){if(_0x31b971){return{'count':_0x31b971[_0xc86b('0x24')],'rows':_[_0xc86b('0x32')](_0x31b971['rows'],function(_0x137721){return{'membername':_0x137721['name'],'UserId':_0x137721['id'],'queue_name':_0x11077c[_0xc86b('0x2f')],'SmsQueueId':_0x11077c['id'],'interface':util[_0xc86b('0x5e')](_0xc86b('0x5f'),_0xc86b('0x60'),_0x137721['name']),'penalty':0x0,'paused':_0x137721['smsPause'],'createdAt':_0x137721['createdAt'],'updatedAt':_0x137721[_0xc86b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc86b('0x29')](respondWithFilteredResult(_0x15a461,_0x4e6219))[_0xc86b('0x47')](handleError(_0x15a461,null));};exports[_0xc86b('0x61')]=function(_0x593f4f,_0x2a017e,_0x159cad){var _0x49acc7={};var _0x3be667={};var _0x2984ac;var _0x4534f2;return db['SmsQueue'][_0xc86b('0x51')]({'where':{'id':_0x593f4f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a017e,null))[_0xc86b('0x29')](function(_0x428fb7){if(_0x428fb7){_0x2984ac=_0x428fb7;_0x3be667[_0xc86b('0x36')]=_[_0xc86b('0x38')](db[_0xc86b('0x62')][_0xc86b('0x34')]);_0x3be667[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x593f4f[_0xc86b('0x37')]);_0x3be667['filters']=_[_0xc86b('0x3a')](_0x3be667['model'],_0x3be667[_0xc86b('0x37')]);_0x49acc7[_0xc86b('0x3b')]=_['intersection'](_0x3be667[_0xc86b('0x36')],qs['fields'](_0x593f4f[_0xc86b('0x37')]['fields']));_0x49acc7[_0xc86b('0x3b')]=_0x49acc7[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x49acc7[_0xc86b('0x3b')]:_0x3be667['model'];_0x49acc7['order']=qs[_0xc86b('0x40')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x40')]);_0x49acc7[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x593f4f[_0xc86b('0x37')],_0x3be667[_0xc86b('0x39')]));if(_0x593f4f['query']['filter']){_0x49acc7[_0xc86b('0x41')]=_[_0xc86b('0x43')](_0x49acc7[_0xc86b('0x41')],{'$or':_[_0xc86b('0x32')](_0x49acc7[_0xc86b('0x3b')],function(_0x5ac108){var _0x271ddc={};_0x271ddc[_0x5ac108]={'$like':'%'+_0x593f4f[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x271ddc;})});}_0x49acc7=_[_0xc86b('0x43')]({},_0x49acc7,_0x593f4f['options']);return _0x2984ac['getTeams'](_0x49acc7);}})[_0xc86b('0x29')](function(_0x20a6bf){if(_0x20a6bf){_0x4534f2=_0x20a6bf[_0xc86b('0x3d')];if(!_0x593f4f[_0xc86b('0x37')]['hasOwnProperty']('nolimit')){_0x49acc7['limit']=qs[_0xc86b('0x22')](_0x593f4f[_0xc86b('0x37')][_0xc86b('0x22')]);_0x49acc7[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x593f4f['query'][_0xc86b('0x21')]);}return _0x2984ac[_0xc86b('0x61')](_0x49acc7);}})[_0xc86b('0x29')](function(_0x494a77){if(_0x494a77){return _0x494a77?{'count':_0x4534f2,'rows':_0x494a77}:null;}})[_0xc86b('0x29')](respondWithResult(_0x2a017e,null))[_0xc86b('0x47')](handleError(_0x2a017e,null));};exports[_0xc86b('0x63')]=function(_0x2f628c,_0x16c138,_0x356664){var _0x303aa8=_0x2f628c[_0xc86b('0x49')][_0xc86b('0x64')];return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x303aa8},'attributes':['id'],'include':[{'model':db[_0xc86b('0x57')],'as':_0xc86b('0x65'),'attributes':['id',_0xc86b('0x2f'),_0xc86b('0x66'),_0xc86b('0x67'),_0xc86b('0x68')],'raw':!![]}]})[_0xc86b('0x29')](function(_0x1d589d){if(_0x1d589d){var _0x1c3316=_[_0xc86b('0x69')](_0x1d589d,function(_0x21572e){var _0x4fd0af=_0x21572e[_0xc86b('0x2b')]({'plain':!![]});return _0x4fd0af[_0xc86b('0x65')];});return db[_0xc86b('0x33')]['find']({'where':{'id':_0x2f628c['params']['id']}})['then'](function(_0xc965f){return db['sequelize'][_0xc86b('0x6a')](function(_0x314233){return _0xc965f[_0xc86b('0x63')](_0x303aa8,{'transaction':_0x314233})['then'](function(){return BPromise[_0xc86b('0x6b')](_0x1c3316,function(_0x29ad21){return db[_0xc86b('0x52')]['findOrCreate']({'where':{'UserId':_0x29ad21['id'],'SmsQueueId':_0x2f628c['params']['id']},'transaction':_0x314233});});})[_0xc86b('0x29')](function(){_0x1c3316['forEach'](function(_0x39440f){socket[_0xc86b('0x6c')](_0xc86b('0x6d'),{'UserId':_0x39440f['id'],'SmsQueueId':_0xc965f['id']});});});});});}})[_0xc86b('0x29')](respondWithStatusCode(_0x16c138,null))[_0xc86b('0x47')](handleError(_0x16c138,null));};exports[_0xc86b('0x6e')]=function(_0x1ac7f9,_0x4b4cbb,_0x5db4d2){return db[_0xc86b('0x62')][_0xc86b('0x56')]({'where':{'id':_0x1ac7f9[_0xc86b('0x37')][_0xc86b('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc86b('0x65'),'attributes':['id'],'raw':!![]}]})[_0xc86b('0x29')](handleEntityNotFound(_0x4b4cbb,null))[_0xc86b('0x29')](function(_0x5d779f){var _0x5b30f3=_[_0xc86b('0x32')](_0x5d779f,'id');var _0x11787c=[];var _0x5f23e0=[];var _0x256d80=squel[_0xc86b('0x6f')]();_0x256d80[_0xc86b('0x70')](_0xc86b('0x71'))['from'](_0xc86b('0x72'),'tq')[_0xc86b('0x73')](_0xc86b('0x74'),'ut',_0xc86b('0x75'))[_0xc86b('0x41')]('SmsQueueId\x20=\x20?',_0x1ac7f9[_0xc86b('0x4e')]['id']);for(var _0x15996b=0x0;_0x15996b<_0x5d779f[_0xc86b('0x3d')];_0x15996b+=0x1){let _0x3a0f1d=_0x5d779f[_0x15996b];for(var _0x407be0=0x0;_0x407be0<_0x3a0f1d[_0xc86b('0x65')][_0xc86b('0x3d')];_0x407be0+=0x1){let _0x17a4bb=_0x3a0f1d[_0xc86b('0x65')][_0x407be0];var _0x1981a9=_0x256d80[_0xc86b('0x76')]();_0x1981a9[_0xc86b('0x41')](_0xc86b('0x77'),_0x17a4bb['id']);_0x5f23e0['push'](db[_0xc86b('0x78')][_0xc86b('0x37')](_0x1981a9[_0xc86b('0x79')](),{'type':db[_0xc86b('0x78')][_0xc86b('0x7a')][_0xc86b('0x7b')]})[_0xc86b('0x29')](function(_0x291219){if(_0x291219[_0xc86b('0x3d')]===0x1){return _0x17a4bb['id'];}else{var _0x5a58d9=_['every'](_[_0xc86b('0x32')](_0x291219,'TeamId'),function(_0x4ba809){return _['includes'](_0x5b30f3,_0x4ba809);});if(_0x5a58d9){return _0x17a4bb['id'];}}}));}}return BPromise[_0xc86b('0x7c')](_0x5f23e0)[_0xc86b('0x29')](function(_0x1ae55d){_0x11787c=_(_0x11787c)[_0xc86b('0x7d')](_0x1ae55d)[_0xc86b('0x7e')]()['value']();return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x1ac7f9['params']['id']}})[_0xc86b('0x29')](function(_0x59ce29){return db['sequelize'][_0xc86b('0x6a')](function(_0x569dec){return _0x59ce29[_0xc86b('0x6e')](_0x1ac7f9[_0xc86b('0x37')]['ids'],{'transaction':_0x569dec})[_0xc86b('0x29')](function(){if(!_['isEmpty'](_0x11787c)){return _0x59ce29['removeAgents'](_0x11787c,{'transaction':_0x569dec});}})['then'](function(){_0x11787c[_0xc86b('0x7f')](function(_0x5f03d){socket['emit'](_0xc86b('0x80'),{'UserId':_0x5f03d,'SmsQueueId':_0x59ce29['id']});});});});});});})['then'](respondWithStatusCode(_0x4b4cbb,null))[_0xc86b('0x47')](handleError(_0x4b4cbb,null));};exports['addAgents']=function(_0x3cac00,_0x4c5c12,_0x44b661){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x3cac00[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c5c12,null))[_0xc86b('0x29')](function(_0x43f556){if(_0x43f556){return _0x43f556[_0xc86b('0x81')](_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')],_[_0xc86b('0x82')](_0x3cac00[_0xc86b('0x49')],[_0xc86b('0x64'),'id'])||{})['spread'](function(_0x539077){for(var _0x3f90fe=0x0;_0x3f90fe<_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0xc86b('0x3d')];_0x3f90fe+=0x1){socket['emit'](_0xc86b('0x6d'),{'UserId':Number(_0x3cac00[_0xc86b('0x49')][_0xc86b('0x64')][_0x3f90fe]),'SmsQueueId':Number(_0x3cac00[_0xc86b('0x4e')]['id'])});}return _0x539077;});}})[_0xc86b('0x29')](respondWithResult(_0x4c5c12,null))[_0xc86b('0x47')](handleError(_0x4c5c12,null));};exports['removeAgents']=function(_0x16a00f,_0x37444f,_0x177a8e){return db[_0xc86b('0x33')][_0xc86b('0x4c')]({'where':{'id':_0x16a00f[_0xc86b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37444f,null))[_0xc86b('0x29')](function(_0x155027){if(_0x155027){return _0x155027[_0xc86b('0x83')](_0x16a00f[_0xc86b('0x37')]['ids'])[_0xc86b('0x29')](function(){if(_[_0xc86b('0x84')](_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')])){for(var _0x4e27bb=0x0;_0x4e27bb<_0x16a00f[_0xc86b('0x37')]['ids'][_0xc86b('0x3d')];_0x4e27bb+=0x1){socket[_0xc86b('0x6c')](_0xc86b('0x80'),{'UserId':Number(_0x16a00f[_0xc86b('0x37')][_0xc86b('0x64')][_0x4e27bb]),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}}else{socket[_0xc86b('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x16a00f['query']['ids']),'SmsQueueId':Number(_0x16a00f[_0xc86b('0x4e')]['id'])});}});}})[_0xc86b('0x29')](respondWithStatusCode(_0x37444f,null))['catch'](handleError(_0x37444f,null));};exports[_0xc86b('0x85')]=function(_0x570705,_0x3de6af,_0x325407){var _0x1d4f56={};var _0x297113={};var _0x547759;var _0x2ae6d3;return db['SmsQueue']['findOne']({'where':{'id':_0x570705[_0xc86b('0x4e')]['id']}})[_0xc86b('0x29')](handleEntityNotFound(_0x3de6af,null))[_0xc86b('0x29')](function(_0x5c37f6){if(_0x5c37f6){_0x547759=_0x5c37f6;_0x297113['model']=_[_0xc86b('0x38')](db[_0xc86b('0x57')][_0xc86b('0x34')]);_0x297113[_0xc86b('0x37')]=_[_0xc86b('0x38')](_0x570705[_0xc86b('0x37')]);_0x297113[_0xc86b('0x39')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],_0x297113[_0xc86b('0x37')]);_0x1d4f56[_0xc86b('0x3b')]=_[_0xc86b('0x3a')](_0x297113[_0xc86b('0x36')],qs[_0xc86b('0x3c')](_0x570705[_0xc86b('0x37')][_0xc86b('0x3c')]));_0x1d4f56[_0xc86b('0x3b')]=_0x1d4f56[_0xc86b('0x3b')][_0xc86b('0x3d')]?_0x1d4f56[_0xc86b('0x3b')]:_0x297113[_0xc86b('0x36')];_0x1d4f56[_0xc86b('0x3f')]=qs[_0xc86b('0x40')](_0x570705[_0xc86b('0x37')][_0xc86b('0x40')]);_0x1d4f56[_0xc86b('0x41')]=qs['filters'](_[_0xc86b('0x54')](_0x570705['query'],_0x297113[_0xc86b('0x39')]));if(_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]){_0x1d4f56[_0xc86b('0x41')]=_['merge'](_0x1d4f56['where'],{'$or':_[_0xc86b('0x32')](_0x1d4f56[_0xc86b('0x3b')],function(_0x450f5c){var _0x49f911={};_0x49f911[_0x450f5c]={'$like':'%'+_0x570705[_0xc86b('0x37')][_0xc86b('0x42')]+'%'};return _0x49f911;})});}_0x1d4f56=_['merge']({},_0x1d4f56,_0x570705[_0xc86b('0x44')]);return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})['then'](function(_0x24c34e){if(_0x24c34e){_0x2ae6d3=_0x24c34e['length'];if(!_0x570705[_0xc86b('0x37')][_0xc86b('0x3e')](_0xc86b('0x53'))){_0x1d4f56[_0xc86b('0x22')]=qs[_0xc86b('0x22')](_0x570705[_0xc86b('0x37')]['limit']);_0x1d4f56[_0xc86b('0x21')]=qs[_0xc86b('0x21')](_0x570705[_0xc86b('0x37')][_0xc86b('0x21')]);}return _0x547759[_0xc86b('0x85')](_0x1d4f56);}})[_0xc86b('0x29')](function(_0x2f0a81){if(_0x2f0a81){return _0x2f0a81?{'count':_0x2ae6d3,'rows':_0x2f0a81}:null;}})['then'](respondWithResult(_0x3de6af,null))[_0xc86b('0x47')](handleError(_0x3de6af,null));}; \ No newline at end of file +var _0x27eb=['findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','ids','select','field','tq.TeamId','from','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','localhost','redis','register','sendStatus','end','status','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include'];(function(_0x22d4e1,_0x9632e8){var _0x4ee5d0=function(_0x261b7d){while(--_0x261b7d){_0x22d4e1['push'](_0x22d4e1['shift']());}};_0x4ee5d0(++_0x9632e8);}(_0x27eb,0xd0));var _0xb27e=function(_0x48e4bd,_0x1040c1){_0x48e4bd=_0x48e4bd-0x0;var _0x491aea=_0x27eb[_0x48e4bd];return _0x491aea;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require(_0xb27e('0x4'));var Mustache=require('mustache');var util=require(_0xb27e('0x5'));var path=require(_0xb27e('0x6'));var sox=require(_0xb27e('0x7'));var csv=require(_0xb27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require(_0xb27e('0xb'));var crypto=require(_0xb27e('0xc'));var jsforce=require(_0xb27e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb27e('0x8'));var querystring=require(_0xb27e('0xe'));var Papa=require(_0xb27e('0xf'));var Redis=require(_0xb27e('0x10'));var authService=require(_0xb27e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb27e('0x12'));var hardwareService=require(_0xb27e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb27e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb27e('0x15'));var db=require(_0xb27e('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb27e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb27e('0x18')]));require('./smsQueue.socket')[_0xb27e('0x19')](socket);function respondWithStatusCode(_0x5aa86f,_0x1453e5){_0x1453e5=_0x1453e5||0xcc;return function(_0x1cb58c){if(_0x1cb58c){return _0x5aa86f[_0xb27e('0x1a')](_0x1453e5);}return _0x5aa86f['status'](_0x1453e5)[_0xb27e('0x1b')]();};}function respondWithResult(_0x1d14bb,_0x24fc3e){_0x24fc3e=_0x24fc3e||0xc8;return function(_0x188073){if(_0x188073){return _0x1d14bb[_0xb27e('0x1c')](_0x24fc3e)[_0xb27e('0x1d')](_0x188073);}};}function respondWithFilteredResult(_0x25ce70,_0x336679){return function(_0x317f4e){if(_0x317f4e){var _0x48b70f=typeof _0x336679[_0xb27e('0x1e')]===_0xb27e('0x1f')&&typeof _0x336679[_0xb27e('0x20')]==='undefined';var _0x352856=_0x317f4e['count'];var _0x517932=_0x48b70f?0x0:_0x336679[_0xb27e('0x1e')];var _0x15dc7e=_0x48b70f?_0x317f4e['count']:_0x336679[_0xb27e('0x1e')]+_0x336679[_0xb27e('0x20')];var _0x16c950;if(_0x15dc7e>=_0x352856){_0x15dc7e=_0x352856;_0x16c950=0xc8;}else{_0x16c950=0xce;}_0x25ce70[_0xb27e('0x1c')](_0x16c950);return _0x25ce70['set'](_0xb27e('0x21'),_0x517932+'-'+_0x15dc7e+'/'+_0x352856)['json'](_0x317f4e);}return null;};}function patchUpdates(_0x19c0f2){return function(_0x2b8f05){try{jsonpatch['apply'](_0x2b8f05,_0x19c0f2,!![]);}catch(_0x58fc84){return BPromise[_0xb27e('0x22')](_0x58fc84);}return _0x2b8f05[_0xb27e('0x23')]();};}function saveUpdates(_0x3703ab,_0x3c4aa2){return function(_0x1e1bb9){if(_0x1e1bb9){return _0x1e1bb9['update'](_0x3703ab)[_0xb27e('0x24')](function(_0x4cba0b){return _0x4cba0b;});}return null;};}function removeEntity(_0x3972bc,_0x1ac460){return function(_0x289bb5){if(_0x289bb5){return _0x289bb5[_0xb27e('0x25')]()[_0xb27e('0x24')](function(){var _0x4dab95=_0x289bb5[_0xb27e('0x26')]({'plain':!![]});var _0x5bae7c=_0xb27e('0x27');return db[_0xb27e('0x28')][_0xb27e('0x25')]({'where':{'type':_0x5bae7c,'resourceId':_0x4dab95['id']}})[_0xb27e('0x24')](function(){return _0x289bb5;});})[_0xb27e('0x24')](function(){_0x3972bc[_0xb27e('0x1c')](0xcc)[_0xb27e('0x1b')]();});}};}function handleEntityNotFound(_0x125c0b,_0x42c5de){return function(_0x4ef0e6){if(!_0x4ef0e6){_0x125c0b[_0xb27e('0x1a')](0x194);}return _0x4ef0e6;};}function handleError(_0x3118e8,_0x21c90e){_0x21c90e=_0x21c90e||0x1f4;return function(_0x41fc88){logger['error'](_0x41fc88[_0xb27e('0x29')]);if(_0x41fc88[_0xb27e('0x2a')]){delete _0x41fc88[_0xb27e('0x2a')];}_0x3118e8[_0xb27e('0x1c')](_0x21c90e)[_0xb27e('0x2b')](_0x41fc88);};}exports[_0xb27e('0x2c')]=function(_0x26cd41,_0x543d4f){var _0x4e4677={},_0x1a5f87={},_0x59e02b={'count':0x0,'rows':[]};var _0x33d1a7=_['map'](db[_0xb27e('0x2d')][_0xb27e('0x2e')],function(_0x389ca9){return{'name':_0x389ca9[_0xb27e('0x2f')],'type':_0x389ca9[_0xb27e('0x30')][_0xb27e('0x31')]};});_0x1a5f87['model']=_[_0xb27e('0x32')](_0x33d1a7,'name');_0x1a5f87[_0xb27e('0x33')]=_['keys'](_0x26cd41[_0xb27e('0x33')]);_0x1a5f87['filters']=_[_0xb27e('0x34')](_0x1a5f87[_0xb27e('0x35')],_0x1a5f87['query']);_0x4e4677['attributes']=_[_0xb27e('0x34')](_0x1a5f87['model'],qs['fields'](_0x26cd41['query'][_0xb27e('0x36')]));_0x4e4677[_0xb27e('0x37')]=_0x4e4677['attributes'][_0xb27e('0x38')]?_0x4e4677[_0xb27e('0x37')]:_0x1a5f87['model'];if(!_0x26cd41['query'][_0xb27e('0x39')]('nolimit')){_0x4e4677[_0xb27e('0x20')]=qs['limit'](_0x26cd41[_0xb27e('0x33')][_0xb27e('0x20')]);_0x4e4677[_0xb27e('0x1e')]=qs[_0xb27e('0x1e')](_0x26cd41[_0xb27e('0x33')][_0xb27e('0x1e')]);}_0x4e4677[_0xb27e('0x3a')]=qs[_0xb27e('0x3b')](_0x26cd41['query'][_0xb27e('0x3b')]);_0x4e4677[_0xb27e('0x3c')]=qs[_0xb27e('0x3d')](_[_0xb27e('0x3e')](_0x26cd41[_0xb27e('0x33')],_0x1a5f87['filters']),_0x33d1a7);if(_0x26cd41['query'][_0xb27e('0x3f')]){_0x4e4677[_0xb27e('0x3c')]=_[_0xb27e('0x40')](_0x4e4677['where'],{'$or':_[_0xb27e('0x32')](_0x33d1a7,function(_0x2a2c78){if(_0x2a2c78[_0xb27e('0x30')]!==_0xb27e('0x41')){var _0x337398={};_0x337398[_0x2a2c78[_0xb27e('0x2a')]]={'$like':'%'+_0x26cd41[_0xb27e('0x33')]['filter']+'%'};return _0x337398;}})});}_0x4e4677=_['merge']({},_0x4e4677,_0x26cd41[_0xb27e('0x42')]);var _0x41b9d1={'where':_0x4e4677[_0xb27e('0x3c')]};return db[_0xb27e('0x2d')][_0xb27e('0x43')](_0x41b9d1)[_0xb27e('0x24')](function(_0x2959f5){_0x59e02b[_0xb27e('0x43')]=_0x2959f5;if(_0x26cd41['query'][_0xb27e('0x44')]){_0x4e4677[_0xb27e('0x45')]=[{'all':!![]}];}return db[_0xb27e('0x2d')][_0xb27e('0x46')](_0x4e4677);})['then'](function(_0x36a268){_0x59e02b['rows']=_0x36a268;return _0x59e02b;})['then'](respondWithFilteredResult(_0x543d4f,_0x4e4677))[_0xb27e('0x47')](handleError(_0x543d4f,null));};exports[_0xb27e('0x48')]=function(_0x5d19ca,_0x3fd782){var _0x3f2352={'raw':!![],'where':{'id':_0x5d19ca[_0xb27e('0x49')]['id']}},_0x7253ed={};_0x7253ed[_0xb27e('0x35')]=_[_0xb27e('0x4a')](db[_0xb27e('0x2d')]['rawAttributes']);_0x7253ed[_0xb27e('0x33')]=_['keys'](_0x5d19ca[_0xb27e('0x33')]);_0x7253ed[_0xb27e('0x3d')]=_[_0xb27e('0x34')](_0x7253ed[_0xb27e('0x35')],_0x7253ed[_0xb27e('0x33')]);_0x3f2352[_0xb27e('0x37')]=_['intersection'](_0x7253ed['model'],qs[_0xb27e('0x36')](_0x5d19ca[_0xb27e('0x33')][_0xb27e('0x36')]));_0x3f2352[_0xb27e('0x37')]=_0x3f2352[_0xb27e('0x37')]['length']?_0x3f2352[_0xb27e('0x37')]:_0x7253ed[_0xb27e('0x35')];if(_0x5d19ca[_0xb27e('0x33')][_0xb27e('0x44')]){_0x3f2352[_0xb27e('0x45')]=[{'all':!![]}];}_0x3f2352=_[_0xb27e('0x40')]({},_0x3f2352,_0x5d19ca[_0xb27e('0x42')]);return db[_0xb27e('0x2d')][_0xb27e('0x4b')](_0x3f2352)[_0xb27e('0x24')](handleEntityNotFound(_0x3fd782,null))[_0xb27e('0x24')](respondWithResult(_0x3fd782,null))['catch'](handleError(_0x3fd782,null));};exports[_0xb27e('0x4c')]=function(_0x4a3286,_0x18bb5c){return db[_0xb27e('0x2d')][_0xb27e('0x4c')](_0x4a3286[_0xb27e('0x4d')],{})[_0xb27e('0x24')](function(_0x1af27d){var _0xf901b1=_0x4a3286[_0xb27e('0x4e')]['get']({'plain':!![]});if(!_0xf901b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf901b1[_0xb27e('0x4f')]===_0xb27e('0x4e')){var _0x2bc159=_0x1af27d['get']({'plain':!![]});var _0x1c4846='SmsQueues';return db[_0xb27e('0x50')][_0xb27e('0x4b')]({'where':{'name':_0x1c4846,'userProfileId':_0xf901b1[_0xb27e('0x51')]},'raw':!![]})['then'](function(_0x30d7d7){if(_0x30d7d7&&_0x30d7d7['autoAssociation']===0x0){return db[_0xb27e('0x28')][_0xb27e('0x4c')]({'name':_0x2bc159[_0xb27e('0x2a')],'resourceId':_0x2bc159['id'],'type':_0x30d7d7[_0xb27e('0x2a')],'sectionId':_0x30d7d7['id']},{})['then'](function(){return _0x1af27d;});}else{return _0x1af27d;}})[_0xb27e('0x47')](function(_0xd56876){logger[_0xb27e('0x52')](_0xb27e('0x53'),_0xd56876);throw _0xd56876;});}return _0x1af27d;})[_0xb27e('0x24')](respondWithResult(_0x18bb5c,0xc9))[_0xb27e('0x47')](handleError(_0x18bb5c,null));};exports[_0xb27e('0x54')]=function(_0x287aad,_0x2ad808){if(_0x287aad['body']['id']){delete _0x287aad[_0xb27e('0x4d')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x287aad[_0xb27e('0x49')]['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x2ad808,null))[_0xb27e('0x24')](saveUpdates(_0x287aad[_0xb27e('0x4d')],null))[_0xb27e('0x24')](respondWithResult(_0x2ad808,null))['catch'](handleError(_0x2ad808,null));};exports['destroy']=function(_0x1e9707,_0x3fdf62){return db[_0xb27e('0x2d')][_0xb27e('0x4b')]({'where':{'id':_0x1e9707[_0xb27e('0x49')]['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x3fdf62,null))[_0xb27e('0x24')](removeEntity(_0x3fdf62,null))[_0xb27e('0x47')](handleError(_0x3fdf62,null));};exports['describe']=function(_0x256784,_0x244f02){return db['SmsQueue'][_0xb27e('0x55')]()[_0xb27e('0x24')](respondWithResult(_0x244f02,null))[_0xb27e('0x47')](handleError(_0x244f02,null));};exports[_0xb27e('0x56')]=function(_0x59134f,_0x7e991e,_0x215e6e){var _0x383631={'raw':!![],'where':{}},_0x4a1e44={},_0x390c7c;return db[_0xb27e('0x2d')][_0xb27e('0x57')]({'where':{'id':_0x59134f['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x7e991e,null))['then'](function(_0x542029){if(_0x542029){_0x390c7c=_0x542029[_0xb27e('0x26')]({'plain':!![]});_0x4a1e44[_0xb27e('0x35')]=_[_0xb27e('0x4a')](db[_0xb27e('0x58')][_0xb27e('0x2e')]);_0x4a1e44['query']=_[_0xb27e('0x4a')](_0x59134f[_0xb27e('0x33')]);_0x4a1e44[_0xb27e('0x3d')]=_[_0xb27e('0x34')](_0x4a1e44['model'],_0x4a1e44[_0xb27e('0x33')]);_0x383631[_0xb27e('0x37')]=_[_0xb27e('0x34')](_0x4a1e44[_0xb27e('0x35')],qs[_0xb27e('0x36')](_0x59134f['query'][_0xb27e('0x36')]));_0x383631[_0xb27e('0x37')]=_0x383631['attributes'][_0xb27e('0x38')]?_0x383631[_0xb27e('0x37')]:_0x4a1e44['model'];if(!_0x59134f[_0xb27e('0x33')][_0xb27e('0x39')](_0xb27e('0x59'))){_0x383631['limit']=qs[_0xb27e('0x20')](_0x59134f['query'][_0xb27e('0x20')]);_0x383631['offset']=qs[_0xb27e('0x1e')](_0x59134f[_0xb27e('0x33')][_0xb27e('0x1e')]);}_0x383631[_0xb27e('0x3a')]=qs[_0xb27e('0x3b')](_0x59134f[_0xb27e('0x33')][_0xb27e('0x3b')]);_0x383631[_0xb27e('0x3c')]=qs['filters'](_[_0xb27e('0x3e')](_0x59134f['query'],_0x4a1e44[_0xb27e('0x3d')]));_0x383631['where'][_0xb27e('0x5a')]=_0x542029['id'];if(_0x59134f[_0xb27e('0x33')][_0xb27e('0x3f')]){_0x383631[_0xb27e('0x3c')]=_[_0xb27e('0x40')](_0x383631[_0xb27e('0x3c')],{'$or':_[_0xb27e('0x32')](_0x383631[_0xb27e('0x37')],function(_0x4ca391){var _0x40d66f={};_0x40d66f[_0x4ca391]={'$like':'%'+_0x59134f[_0xb27e('0x33')][_0xb27e('0x3f')]+'%'};return _0x40d66f;})});}_0x383631=_[_0xb27e('0x40')]({},_0x383631,_0x59134f[_0xb27e('0x42')]);return db[_0xb27e('0x58')][_0xb27e('0x46')](_0x383631);}})[_0xb27e('0x24')](function(_0x3a11e3){if(_0x3a11e3){return db[_0xb27e('0x5b')][_0xb27e('0x5c')]({'where':{'id':_[_0xb27e('0x32')](_0x3a11e3,_0xb27e('0x5d')),'role':_0xb27e('0x5e')},'attributes':['id',_0xb27e('0x2a'),_0xb27e('0x5f'),_0xb27e('0x60'),_0xb27e('0x61')]});}})['then'](function(_0x416e55){if(_0x416e55){return{'count':_0x416e55[_0xb27e('0x43')],'rows':_[_0xb27e('0x32')](_0x416e55['rows'],function(_0x1f08ba){return{'membername':_0x1f08ba['name'],'UserId':_0x1f08ba['id'],'queue_name':_0x390c7c[_0xb27e('0x2a')],'SmsQueueId':_0x390c7c['id'],'interface':util['format'](_0xb27e('0x62'),_0xb27e('0x63'),_0x1f08ba[_0xb27e('0x2a')]),'penalty':0x0,'paused':_0x1f08ba[_0xb27e('0x5f')],'createdAt':_0x1f08ba[_0xb27e('0x61')],'updatedAt':_0x1f08ba[_0xb27e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x7e991e,_0x383631))[_0xb27e('0x47')](handleError(_0x7e991e,null));};exports['getTeams']=function(_0x16df39,_0x49c165,_0x2922f4){var _0xc71cca={};var _0x2ed029={};var _0x549d57;var _0x3bfbe7;return db[_0xb27e('0x2d')][_0xb27e('0x57')]({'where':{'id':_0x16df39['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x49c165,null))[_0xb27e('0x24')](function(_0x123cee){if(_0x123cee){_0x549d57=_0x123cee;_0x2ed029[_0xb27e('0x35')]=_['keys'](db['Team'][_0xb27e('0x2e')]);_0x2ed029[_0xb27e('0x33')]=_[_0xb27e('0x4a')](_0x16df39[_0xb27e('0x33')]);_0x2ed029[_0xb27e('0x3d')]=_['intersection'](_0x2ed029[_0xb27e('0x35')],_0x2ed029[_0xb27e('0x33')]);_0xc71cca[_0xb27e('0x37')]=_[_0xb27e('0x34')](_0x2ed029[_0xb27e('0x35')],qs[_0xb27e('0x36')](_0x16df39[_0xb27e('0x33')][_0xb27e('0x36')]));_0xc71cca[_0xb27e('0x37')]=_0xc71cca[_0xb27e('0x37')]['length']?_0xc71cca[_0xb27e('0x37')]:_0x2ed029['model'];_0xc71cca[_0xb27e('0x3a')]=qs[_0xb27e('0x3b')](_0x16df39[_0xb27e('0x33')]['sort']);_0xc71cca[_0xb27e('0x3c')]=qs[_0xb27e('0x3d')](_[_0xb27e('0x3e')](_0x16df39[_0xb27e('0x33')],_0x2ed029[_0xb27e('0x3d')]));if(_0x16df39[_0xb27e('0x33')][_0xb27e('0x3f')]){_0xc71cca[_0xb27e('0x3c')]=_[_0xb27e('0x40')](_0xc71cca[_0xb27e('0x3c')],{'$or':_[_0xb27e('0x32')](_0xc71cca[_0xb27e('0x37')],function(_0x11c664){var _0x1e6c0b={};_0x1e6c0b[_0x11c664]={'$like':'%'+_0x16df39[_0xb27e('0x33')]['filter']+'%'};return _0x1e6c0b;})});}_0xc71cca=_[_0xb27e('0x40')]({},_0xc71cca,_0x16df39[_0xb27e('0x42')]);return _0x549d57[_0xb27e('0x64')](_0xc71cca);}})[_0xb27e('0x24')](function(_0x1b4696){if(_0x1b4696){_0x3bfbe7=_0x1b4696[_0xb27e('0x38')];if(!_0x16df39[_0xb27e('0x33')][_0xb27e('0x39')]('nolimit')){_0xc71cca[_0xb27e('0x20')]=qs['limit'](_0x16df39[_0xb27e('0x33')]['limit']);_0xc71cca['offset']=qs[_0xb27e('0x1e')](_0x16df39[_0xb27e('0x33')][_0xb27e('0x1e')]);}return _0x549d57[_0xb27e('0x64')](_0xc71cca);}})[_0xb27e('0x24')](function(_0x21cc2c){if(_0x21cc2c){return _0x21cc2c?{'count':_0x3bfbe7,'rows':_0x21cc2c}:null;}})['then'](respondWithResult(_0x49c165,null))[_0xb27e('0x47')](handleError(_0x49c165,null));};exports[_0xb27e('0x65')]=function(_0x4d8678,_0x452e2b,_0x47aab6){var _0x2b8afb=_0x4d8678['body']['ids'];return db[_0xb27e('0x66')][_0xb27e('0x46')]({'where':{'id':_0x2b8afb},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb27e('0x67'),'attributes':['id',_0xb27e('0x2a'),_0xb27e('0x68'),_0xb27e('0x69'),'interface'],'raw':!![]}]})[_0xb27e('0x24')](function(_0x1bb39b){if(_0x1bb39b){var _0x27ed73=_[_0xb27e('0x6a')](_0x1bb39b,function(_0x450ba3){var _0x3f4695=_0x450ba3['get']({'plain':!![]});return _0x3f4695['Agents'];});return db['SmsQueue'][_0xb27e('0x4b')]({'where':{'id':_0x4d8678[_0xb27e('0x49')]['id']}})[_0xb27e('0x24')](function(_0x1f68a1){return db[_0xb27e('0x6b')][_0xb27e('0x6c')](function(_0x16b9ba){return _0x1f68a1[_0xb27e('0x65')](_0x2b8afb,{'transaction':_0x16b9ba})['then'](function(){return BPromise[_0xb27e('0x6d')](_0x27ed73,function(_0x10b342){return db['UserSmsQueue'][_0xb27e('0x6e')]({'where':{'UserId':_0x10b342['id'],'SmsQueueId':_0x4d8678[_0xb27e('0x49')]['id']},'transaction':_0x16b9ba});});})[_0xb27e('0x24')](function(){_0x27ed73[_0xb27e('0x6f')](function(_0x3a31ac){socket[_0xb27e('0x70')](_0xb27e('0x71'),{'UserId':_0x3a31ac['id'],'SmsQueueId':_0x1f68a1['id']});});});});});}})[_0xb27e('0x24')](respondWithStatusCode(_0x452e2b,null))[_0xb27e('0x47')](handleError(_0x452e2b,null));};exports['removeTeams']=function(_0xa4674b,_0x1a70da,_0x170146){return db['Team'][_0xb27e('0x46')]({'where':{'id':_0xa4674b[_0xb27e('0x33')][_0xb27e('0x72')]},'attributes':['id'],'include':[{'model':db[_0xb27e('0x5b')],'as':_0xb27e('0x67'),'attributes':['id'],'raw':!![]}]})[_0xb27e('0x24')](handleEntityNotFound(_0x1a70da,null))[_0xb27e('0x24')](function(_0x12ce33){var _0x541dde=_[_0xb27e('0x32')](_0x12ce33,'id');var _0x55df43=[];var _0x2d171b=[];var _0x2839b3=squel[_0xb27e('0x73')]();_0x2839b3[_0xb27e('0x74')](_0xb27e('0x75'))[_0xb27e('0x76')]('team_has_sms_queues','tq')['join']('user_has_teams','ut',_0xb27e('0x77'))[_0xb27e('0x3c')]('SmsQueueId\x20=\x20?',_0xa4674b[_0xb27e('0x49')]['id']);for(var _0xb8bdde=0x0;_0xb8bdde<_0x12ce33['length'];_0xb8bdde+=0x1){let _0x3ab76c=_0x12ce33[_0xb8bdde];for(var _0x160a0f=0x0;_0x160a0f<_0x3ab76c['Agents'][_0xb27e('0x38')];_0x160a0f+=0x1){let _0x43b097=_0x3ab76c[_0xb27e('0x67')][_0x160a0f];var _0x2b8980=_0x2839b3[_0xb27e('0x78')]();_0x2b8980['where']('ut.UserId\x20=\x20?',_0x43b097['id']);_0x2d171b[_0xb27e('0x79')](db[_0xb27e('0x6b')][_0xb27e('0x33')](_0x2b8980[_0xb27e('0x7a')](),{'type':db[_0xb27e('0x6b')][_0xb27e('0x7b')]['SELECT']})[_0xb27e('0x24')](function(_0x25ed50){if(_0x25ed50['length']===0x1){return _0x43b097['id'];}else{var _0x38d4de=_[_0xb27e('0x7c')](_[_0xb27e('0x32')](_0x25ed50,'TeamId'),function(_0x21082b){return _[_0xb27e('0x7d')](_0x541dde,_0x21082b);});if(_0x38d4de){return _0x43b097['id'];}}}));}}return BPromise[_0xb27e('0x7e')](_0x2d171b)[_0xb27e('0x24')](function(_0x318055){_0x55df43=_(_0x55df43)[_0xb27e('0x7f')](_0x318055)[_0xb27e('0x80')]()[_0xb27e('0x81')]();return db[_0xb27e('0x2d')][_0xb27e('0x4b')]({'where':{'id':_0xa4674b[_0xb27e('0x49')]['id']}})['then'](function(_0xf3350a){return db['sequelize'][_0xb27e('0x6c')](function(_0x3f2d85){return _0xf3350a[_0xb27e('0x82')](_0xa4674b[_0xb27e('0x33')][_0xb27e('0x72')],{'transaction':_0x3f2d85})['then'](function(){if(!_[_0xb27e('0x83')](_0x55df43)){return _0xf3350a[_0xb27e('0x84')](_0x55df43,{'transaction':_0x3f2d85});}})[_0xb27e('0x24')](function(){_0x55df43[_0xb27e('0x6f')](function(_0x214277){socket['emit'](_0xb27e('0x85'),{'UserId':_0x214277,'SmsQueueId':_0xf3350a['id']});});});});});});})[_0xb27e('0x24')](respondWithStatusCode(_0x1a70da,null))[_0xb27e('0x47')](handleError(_0x1a70da,null));};exports[_0xb27e('0x86')]=function(_0x3e1032,_0x32a78c,_0x819425){return db[_0xb27e('0x2d')][_0xb27e('0x4b')]({'where':{'id':_0x3e1032[_0xb27e('0x49')]['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x32a78c,null))[_0xb27e('0x24')](function(_0x322fe4){if(_0x322fe4){return _0x322fe4[_0xb27e('0x86')](_0x3e1032[_0xb27e('0x4d')][_0xb27e('0x72')],_[_0xb27e('0x87')](_0x3e1032[_0xb27e('0x4d')],[_0xb27e('0x72'),'id'])||{})[_0xb27e('0x88')](function(_0xe3145e){for(var _0x1e059c=0x0;_0x1e059c<_0x3e1032[_0xb27e('0x4d')][_0xb27e('0x72')][_0xb27e('0x38')];_0x1e059c+=0x1){socket[_0xb27e('0x70')](_0xb27e('0x71'),{'UserId':Number(_0x3e1032[_0xb27e('0x4d')]['ids'][_0x1e059c]),'SmsQueueId':Number(_0x3e1032[_0xb27e('0x49')]['id'])});}return _0xe3145e;});}})[_0xb27e('0x24')](respondWithResult(_0x32a78c,null))[_0xb27e('0x47')](handleError(_0x32a78c,null));};exports[_0xb27e('0x84')]=function(_0x104615,_0x11c249,_0x55b22a){return db['SmsQueue']['find']({'where':{'id':_0x104615[_0xb27e('0x49')]['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x11c249,null))[_0xb27e('0x24')](function(_0x5503b7){if(_0x5503b7){return _0x5503b7['removeAgents'](_0x104615[_0xb27e('0x33')][_0xb27e('0x72')])[_0xb27e('0x24')](function(){if(_[_0xb27e('0x89')](_0x104615[_0xb27e('0x33')]['ids'])){for(var _0x2e37c5=0x0;_0x2e37c5<_0x104615[_0xb27e('0x33')][_0xb27e('0x72')][_0xb27e('0x38')];_0x2e37c5+=0x1){socket[_0xb27e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x104615[_0xb27e('0x33')][_0xb27e('0x72')][_0x2e37c5]),'SmsQueueId':Number(_0x104615[_0xb27e('0x49')]['id'])});}}else{socket[_0xb27e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x104615[_0xb27e('0x33')][_0xb27e('0x72')]),'SmsQueueId':Number(_0x104615['params']['id'])});}});}})['then'](respondWithStatusCode(_0x11c249,null))['catch'](handleError(_0x11c249,null));};exports['getAgents']=function(_0xaf7200,_0x48da46,_0x1ca1c7){var _0x9fab79={};var _0x3dae8e={};var _0xb1d6f;var _0x32a1b7;return db[_0xb27e('0x2d')][_0xb27e('0x57')]({'where':{'id':_0xaf7200['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x48da46,null))[_0xb27e('0x24')](function(_0x142697){if(_0x142697){_0xb1d6f=_0x142697;_0x3dae8e[_0xb27e('0x35')]=_['keys'](db[_0xb27e('0x5b')]['rawAttributes']);_0x3dae8e[_0xb27e('0x33')]=_[_0xb27e('0x4a')](_0xaf7200[_0xb27e('0x33')]);_0x3dae8e[_0xb27e('0x3d')]=_[_0xb27e('0x34')](_0x3dae8e[_0xb27e('0x35')],_0x3dae8e[_0xb27e('0x33')]);_0x9fab79[_0xb27e('0x37')]=_[_0xb27e('0x34')](_0x3dae8e[_0xb27e('0x35')],qs[_0xb27e('0x36')](_0xaf7200['query'][_0xb27e('0x36')]));_0x9fab79[_0xb27e('0x37')]=_0x9fab79[_0xb27e('0x37')][_0xb27e('0x38')]?_0x9fab79['attributes']:_0x3dae8e[_0xb27e('0x35')];_0x9fab79[_0xb27e('0x3a')]=qs['sort'](_0xaf7200['query'][_0xb27e('0x3b')]);_0x9fab79[_0xb27e('0x3c')]=qs['filters'](_[_0xb27e('0x3e')](_0xaf7200[_0xb27e('0x33')],_0x3dae8e[_0xb27e('0x3d')]));if(_0xaf7200['query'][_0xb27e('0x3f')]){_0x9fab79[_0xb27e('0x3c')]=_[_0xb27e('0x40')](_0x9fab79['where'],{'$or':_[_0xb27e('0x32')](_0x9fab79['attributes'],function(_0x39e94b){var _0x2fa194={};_0x2fa194[_0x39e94b]={'$like':'%'+_0xaf7200[_0xb27e('0x33')]['filter']+'%'};return _0x2fa194;})});}_0x9fab79=_[_0xb27e('0x40')]({},_0x9fab79,_0xaf7200['options']);return _0xb1d6f[_0xb27e('0x8a')](_0x9fab79);}})[_0xb27e('0x24')](function(_0x47ca66){if(_0x47ca66){_0x32a1b7=_0x47ca66[_0xb27e('0x38')];if(!_0xaf7200[_0xb27e('0x33')]['hasOwnProperty'](_0xb27e('0x59'))){_0x9fab79[_0xb27e('0x20')]=qs[_0xb27e('0x20')](_0xaf7200['query'][_0xb27e('0x20')]);_0x9fab79[_0xb27e('0x1e')]=qs[_0xb27e('0x1e')](_0xaf7200[_0xb27e('0x33')][_0xb27e('0x1e')]);}return _0xb1d6f['getAgents'](_0x9fab79);}})[_0xb27e('0x24')](function(_0x18678c){if(_0x18678c){return _0x18678c?{'count':_0x32a1b7,'rows':_0x18678c}:null;}})[_0xb27e('0x24')](respondWithResult(_0x48da46,null))[_0xb27e('0x47')](handleError(_0x48da46,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b62b9c4..e970302 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 _0x489d=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x489d,0x178));var _0xd489=function(_0x4937b7,_0x30a7d7){_0x4937b7=_0x4937b7-0x0;var _0x4bf326=_0x489d[_0x4937b7];return _0x4bf326;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd489('0x0'))['db'][_0xd489('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd489('0x2')](0x0);var events={'afterCreate':_0xd489('0x3'),'afterUpdate':'update','afterDestroy':_0xd489('0x4')};function emitEvent(_0x5bcc84){return function(_0x158e6f,_0x1b698d,_0x2f68db){SmsQueueEvents[_0xd489('0x5')](_0x5bcc84+':'+_0x158e6f['id'],_0x158e6f);SmsQueueEvents[_0xd489('0x5')](_0x5bcc84,_0x158e6f);_0x2f68db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xd489('0x6')](e,emitEvent(event));}}module[_0xd489('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x5b01=['update','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x41fb98,_0x470189){var _0x4b0044=function(_0xf8b2ec){while(--_0xf8b2ec){_0x41fb98['push'](_0x41fb98['shift']());}};_0x4b0044(++_0x470189);}(_0x5b01,0x66));var _0x15b0=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x5b01[_0x9df060];return _0x338dfe;};'use strict';var EventEmitter=require(_0x15b0('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x15b0('0x1')](0x0);var events={'afterCreate':_0x15b0('0x2'),'afterUpdate':_0x15b0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x26d365){return function(_0xae4f11,_0x1a4665,_0x4f2276){SmsQueueEvents['emit'](_0x26d365+':'+_0xae4f11['id'],_0xae4f11);SmsQueueEvents[_0x15b0('0x4')](_0x26d365,_0xae4f11);_0x4f2276(null);};}for(var e in events){if(events[_0x15b0('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x15b0('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index eb661d2..683ca67 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 _0x93b6=['api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x93b6,0x173));var _0x693b=function(_0x2e5fe6,_0x1ea59a){_0x2e5fe6=_0x2e5fe6-0x0;var _0x40f361=_0x93b6[_0x2e5fe6];return _0x40f361;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var logger=require(_0x693b('0x2'))(_0x693b('0x3'));var moment=require('moment');var BPromise=require(_0x693b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x693b('0x5'));var rimraf=require(_0x693b('0x6'));var config=require(_0x693b('0x7'));var attributes=require(_0x693b('0x8'));module['exports']=function(_0x3cea6b,_0x38b1d4){return _0x3cea6b[_0x693b('0x9')](_0x693b('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf79f=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsQueue.attributes'];(function(_0x4ae767,_0x4140f0){var _0x571df1=function(_0x454c64){while(--_0x454c64){_0x4ae767['push'](_0x4ae767['shift']());}};_0x571df1(++_0x4140f0);}(_0xf79f,0x108));var _0xff79=function(_0x2ac3cf,_0x465bb6){_0x2ac3cf=_0x2ac3cf-0x0;var _0x27dcca=_0xf79f[_0x2ac3cf];return _0x27dcca;};'use strict';var _=require(_0xff79('0x0'));var util=require(_0xff79('0x1'));var logger=require(_0xff79('0x2'))(_0xff79('0x3'));var moment=require(_0xff79('0x4'));var BPromise=require(_0xff79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff79('0x6'));var rimraf=require(_0xff79('0x7'));var config=require('../../config/environment');var attributes=require(_0xff79('0x8'));module[_0xff79('0x9')]=function(_0x57ccdf,_0x508c8a){return _0x57ccdf[_0xff79('0xa')](_0xff79('0xb'),attributes,{'tableName':_0xff79('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 7f8a0a0..e937f0c 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 _0xd22b=['request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','SmsQueue,\x20%s,\x20%s'];(function(_0x53931e,_0x1f5c9b){var _0x3f2e8c=function(_0x39f324){while(--_0x39f324){_0x53931e['push'](_0x53931e['shift']());}};_0x3f2e8c(++_0x1f5c9b);}(_0xd22b,0x16b));var _0xbd22=function(_0x51deea,_0x247904){_0x51deea=_0x51deea-0x0;var _0xaee237=_0xd22b[_0x51deea];return _0xaee237;};'use strict';var _=require(_0xbd22('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbd22('0x1'));var rs=require(_0xbd22('0x2'));var fs=require('fs');var Redis=require(_0xbd22('0x3'));var db=require(_0xbd22('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd22('0x5'))(_0xbd22('0x6'));var config=require(_0xbd22('0x7'));var jayson=require(_0xbd22('0x8'));var client=jayson[_0xbd22('0x9')][_0xbd22('0xa')]({'port':0x232a});config[_0xbd22('0xb')]=_[_0xbd22('0xc')](config[_0xbd22('0xb')],{'host':_0xbd22('0xd'),'port':0x18eb});var socket=require(_0xbd22('0xe'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3f5f99,_0x1096ea,_0x19ea89){return new BPromise(function(_0xbd484c,_0x47f7b9){return client['request'](_0x3f5f99,_0x19ea89)[_0xbd22('0xf')](function(_0x240785){logger['info'](_0xbd22('0x10'),_0x1096ea,_0xbd22('0x11'));logger[_0xbd22('0x12')](_0xbd22('0x13'),_0x1096ea,_0xbd22('0x11'),JSON['stringify'](_0x240785));if(_0x240785[_0xbd22('0x14')]){if(_0x240785[_0xbd22('0x14')]['code']===0x1f4){logger[_0xbd22('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1096ea,_0x240785[_0xbd22('0x14')][_0xbd22('0x15')]);return _0x47f7b9(_0x240785['error'][_0xbd22('0x15')]);}logger[_0xbd22('0x14')](_0xbd22('0x10'),_0x1096ea,_0x240785['error'][_0xbd22('0x15')]);return _0xbd484c(_0x240785['error']['message']);}else{logger[_0xbd22('0x16')](_0xbd22('0x10'),_0x1096ea,_0xbd22('0x11'));_0xbd484c(_0x240785['result'][_0xbd22('0x15')]);}})[_0xbd22('0x17')](function(_0xd4c5ab){logger[_0xbd22('0x14')](_0xbd22('0x10'),_0x1096ea,_0xd4c5ab);_0x47f7b9(_0xd4c5ab);});});}exports['GetSmsQueue']=function(_0x1d6d90){var _0x300fb2=this;return new Promise(function(_0x2e265b,_0x5e03f9){return db[_0xbd22('0x18')][_0xbd22('0x19')]({'raw':_0x1d6d90['options']?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1c')]||null:null,'attributes':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1d')]||null:null,'limit':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1e')]||null:null,'include':_0x1d6d90[_0xbd22('0x1a')]?_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x1d6d90[_0xbd22('0x1a')][_0xbd22('0x1f')],function(_0x439adf){return{'model':db[_0x439adf['model']],'as':_0x439adf['as'],'attributes':_0x439adf[_0xbd22('0x1d')],'include':_0x439adf[_0xbd22('0x1f')]?_['map'](_0x439adf['include'],function(_0x40b192){return{'model':db[_0x40b192[_0xbd22('0x21')]],'as':_0x40b192['as'],'attributes':_0x40b192[_0xbd22('0x1d')],'include':_0x40b192[_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x40b192['include'],function(_0x2b5422){return{'model':db[_0x2b5422['model']],'as':_0x2b5422['as'],'attributes':_0x2b5422[_0xbd22('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbd22('0xf')](function(_0xe28415){logger['info'](_0xbd22('0x22'),_0x1d6d90);logger[_0xbd22('0x12')](_0xbd22('0x22'),_0x1d6d90,JSON['stringify'](_0xe28415));_0x2e265b(_0xe28415);})[_0xbd22('0x17')](function(_0x153121){logger[_0xbd22('0x14')](_0xbd22('0x22'),_0x153121[_0xbd22('0x15')],_0x1d6d90);_0x5e03f9(_0x300fb2[_0xbd22('0x14')](0x1f4,_0x153121['message']));});});};exports[_0xbd22('0x23')]=function(_0x61631){var _0xcc3fd=this;return new Promise(function(_0x23840d,_0x453134){return db[_0xbd22('0x18')][_0xbd22('0x24')]({'raw':_0x61631[_0xbd22('0x1a')]?_0x61631['options'][_0xbd22('0x1b')]===undefined?!![]:![]:!![],'where':_0x61631['options']?_0x61631[_0xbd22('0x1a')][_0xbd22('0x1c')]||null:null,'attributes':_0x61631[_0xbd22('0x1a')]?_0x61631[_0xbd22('0x1a')]['attributes']||null:null,'include':_0x61631['options']?_0x61631[_0xbd22('0x1a')][_0xbd22('0x1f')]?_['map'](_0x61631[_0xbd22('0x1a')][_0xbd22('0x1f')],function(_0x2826af){return{'model':db[_0x2826af[_0xbd22('0x21')]],'as':_0x2826af['as'],'attributes':_0x2826af[_0xbd22('0x1d')],'include':_0x2826af[_0xbd22('0x1f')]?_[_0xbd22('0x20')](_0x2826af[_0xbd22('0x1f')],function(_0x4f9c0e){return{'model':db[_0x4f9c0e[_0xbd22('0x21')]],'as':_0x4f9c0e['as'],'attributes':_0x4f9c0e['attributes'],'include':_0x4f9c0e[_0xbd22('0x1f')]?_['map'](_0x4f9c0e['include'],function(_0x111ede){return{'model':db[_0x111ede[_0xbd22('0x21')]],'as':_0x111ede['as'],'attributes':_0x111ede[_0xbd22('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbd22('0xf')](function(_0xbb3600){logger[_0xbd22('0x16')](_0xbd22('0x23'),_0x61631);logger[_0xbd22('0x12')](_0xbd22('0x23'),_0x61631,JSON[_0xbd22('0x25')](_0xbb3600));_0x23840d(_0xbb3600);})[_0xbd22('0x17')](function(_0x2779fc){logger[_0xbd22('0x14')]('ShowSmsQueue',_0x2779fc[_0xbd22('0x15')],_0x61631);_0x453134(_0xcc3fd[_0xbd22('0x14')](0x1f4,_0x2779fc[_0xbd22('0x15')]));});});}; \ No newline at end of file +var _0x7896=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowSmsQueue','find','lodash'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0x7896,0x127));var _0x6789=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x7896[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require(_0x6789('0x0'));var util=require('util');var moment=require(_0x6789('0x1'));var BPromise=require(_0x6789('0x2'));var rs=require(_0x6789('0x3'));var fs=require('fs');var Redis=require(_0x6789('0x4'));var db=require(_0x6789('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6789('0x6'));var config=require('../../config/environment');var jayson=require(_0x6789('0x7'));var client=jayson[_0x6789('0x8')][_0x6789('0x9')]({'port':0x232a});config[_0x6789('0xa')]=_['defaults'](config[_0x6789('0xa')],{'host':_0x6789('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6789('0xa')]));require(_0x6789('0xc'))['register'](socket);function respondWithRpcPromise(_0x1d3f3f,_0x4fd396,_0x15df52){return new BPromise(function(_0x569ccc,_0x198e39){return client['request'](_0x1d3f3f,_0x15df52)[_0x6789('0xd')](function(_0xd6591c){logger[_0x6789('0xe')](_0x6789('0xf'),_0x4fd396,_0x6789('0x10'));logger[_0x6789('0x11')](_0x6789('0x12'),_0x4fd396,_0x6789('0x10'),JSON[_0x6789('0x13')](_0xd6591c));if(_0xd6591c[_0x6789('0x14')]){if(_0xd6591c[_0x6789('0x14')]['code']===0x1f4){logger['error'](_0x6789('0xf'),_0x4fd396,_0xd6591c['error'][_0x6789('0x15')]);return _0x198e39(_0xd6591c[_0x6789('0x14')]['message']);}logger[_0x6789('0x14')](_0x6789('0xf'),_0x4fd396,_0xd6591c[_0x6789('0x14')][_0x6789('0x15')]);return _0x569ccc(_0xd6591c[_0x6789('0x14')][_0x6789('0x15')]);}else{logger[_0x6789('0xe')]('SmsQueue,\x20%s,\x20%s',_0x4fd396,_0x6789('0x10'));_0x569ccc(_0xd6591c[_0x6789('0x16')][_0x6789('0x15')]);}})[_0x6789('0x17')](function(_0x37b323){logger[_0x6789('0x14')](_0x6789('0xf'),_0x4fd396,_0x37b323);_0x198e39(_0x37b323);});});}exports[_0x6789('0x18')]=function(_0x4e1101){var _0x49dfdb=this;return new Promise(function(_0x48ac13,_0x2359c6){return db[_0x6789('0x19')][_0x6789('0x1a')]({'raw':_0x4e1101[_0x6789('0x1b')]?_0x4e1101[_0x6789('0x1b')][_0x6789('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e1101[_0x6789('0x1b')]?_0x4e1101[_0x6789('0x1b')][_0x6789('0x1d')]||null:null,'attributes':_0x4e1101['options']?_0x4e1101[_0x6789('0x1b')][_0x6789('0x1e')]||null:null,'limit':_0x4e1101[_0x6789('0x1b')]?_0x4e1101[_0x6789('0x1b')][_0x6789('0x1f')]||null:null,'include':_0x4e1101[_0x6789('0x1b')]?_0x4e1101[_0x6789('0x1b')][_0x6789('0x20')]?_['map'](_0x4e1101[_0x6789('0x1b')][_0x6789('0x20')],function(_0x33293b){return{'model':db[_0x33293b[_0x6789('0x21')]],'as':_0x33293b['as'],'attributes':_0x33293b[_0x6789('0x1e')],'include':_0x33293b['include']?_[_0x6789('0x22')](_0x33293b['include'],function(_0x1799e0){return{'model':db[_0x1799e0[_0x6789('0x21')]],'as':_0x1799e0['as'],'attributes':_0x1799e0['attributes'],'include':_0x1799e0['include']?_[_0x6789('0x22')](_0x1799e0[_0x6789('0x20')],function(_0x4beeeb){return{'model':db[_0x4beeeb[_0x6789('0x21')]],'as':_0x4beeeb['as'],'attributes':_0x4beeeb['attributes']};}):[]};}):[]};}):[]:[]})[_0x6789('0xd')](function(_0x489444){logger[_0x6789('0xe')](_0x6789('0x18'),_0x4e1101);logger[_0x6789('0x11')]('GetSmsQueue',_0x4e1101,JSON[_0x6789('0x13')](_0x489444));_0x48ac13(_0x489444);})[_0x6789('0x17')](function(_0x3fcf1){logger[_0x6789('0x14')](_0x6789('0x18'),_0x3fcf1['message'],_0x4e1101);_0x2359c6(_0x49dfdb['error'](0x1f4,_0x3fcf1[_0x6789('0x15')]));});});};exports[_0x6789('0x23')]=function(_0x4b05a6){var _0x2a1665=this;return new Promise(function(_0x190ad3,_0x3fcc2a){return db[_0x6789('0x19')][_0x6789('0x24')]({'raw':_0x4b05a6[_0x6789('0x1b')]?_0x4b05a6[_0x6789('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4b05a6[_0x6789('0x1b')]?_0x4b05a6[_0x6789('0x1b')][_0x6789('0x1d')]||null:null,'attributes':_0x4b05a6[_0x6789('0x1b')]?_0x4b05a6[_0x6789('0x1b')][_0x6789('0x1e')]||null:null,'include':_0x4b05a6['options']?_0x4b05a6[_0x6789('0x1b')][_0x6789('0x20')]?_[_0x6789('0x22')](_0x4b05a6[_0x6789('0x1b')][_0x6789('0x20')],function(_0x5f26dd){return{'model':db[_0x5f26dd[_0x6789('0x21')]],'as':_0x5f26dd['as'],'attributes':_0x5f26dd[_0x6789('0x1e')],'include':_0x5f26dd[_0x6789('0x20')]?_[_0x6789('0x22')](_0x5f26dd['include'],function(_0x2a95b5){return{'model':db[_0x2a95b5[_0x6789('0x21')]],'as':_0x2a95b5['as'],'attributes':_0x2a95b5[_0x6789('0x1e')],'include':_0x2a95b5[_0x6789('0x20')]?_['map'](_0x2a95b5[_0x6789('0x20')],function(_0x45d24e){return{'model':db[_0x45d24e[_0x6789('0x21')]],'as':_0x45d24e['as'],'attributes':_0x45d24e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6789('0xd')](function(_0x49e5e2){logger[_0x6789('0xe')](_0x6789('0x23'),_0x4b05a6);logger[_0x6789('0x11')](_0x6789('0x23'),_0x4b05a6,JSON[_0x6789('0x13')](_0x49e5e2));_0x190ad3(_0x49e5e2);})[_0x6789('0x17')](function(_0x4621dc){logger['error']('ShowSmsQueue',_0x4621dc[_0x6789('0x15')],_0x4b05a6);_0x3fcc2a(_0x2a1665[_0x6789('0x14')](0x1f4,_0x4621dc[_0x6789('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index daa71ff..3e50fb8 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 _0x8ec6=['length','smsQueue:','./smsQueue.events','remove','register'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x8ec6,0x1ce));var _0x68ec=function(_0x31f824,_0x79833d){_0x31f824=_0x31f824-0x0;var _0x14b241=_0x8ec6[_0x31f824];return _0x14b241;};'use strict';var SmsQueueEvents=require(_0x68ec('0x0'));var events=['save',_0x68ec('0x1'),'update'];function createListener(_0x2a54e2,_0x45fa51){return function(_0x3c46f7){_0x45fa51['emit'](_0x2a54e2,_0x3c46f7);};}function removeListener(_0x39b6d5,_0x4dccbd){return function(){SmsQueueEvents['removeListener'](_0x39b6d5,_0x4dccbd);};}exports[_0x68ec('0x2')]=function(_0xc80a14){for(var _0x12dba2=0x0,_0x1a5a0e=events[_0x68ec('0x3')];_0x12dba2<_0x1a5a0e;_0x12dba2++){var _0x5a71e2=events[_0x12dba2];var _0x50b988=createListener(_0x68ec('0x4')+_0x5a71e2,_0xc80a14);SmsQueueEvents['on'](_0x5a71e2,_0x50b988);}}; \ No newline at end of file +var _0x01fc=['./smsQueue.events','remove','update','emit','removeListener','register','smsQueue:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01fc,0x1dc));var _0xc01f=function(_0x471b79,_0x43ef95){_0x471b79=_0x471b79-0x0;var _0x1e00f4=_0x01fc[_0x471b79];return _0x1e00f4;};'use strict';var SmsQueueEvents=require(_0xc01f('0x0'));var events=['save',_0xc01f('0x1'),_0xc01f('0x2')];function createListener(_0xdb514f,_0x504106){return function(_0x41b241){_0x504106[_0xc01f('0x3')](_0xdb514f,_0x41b241);};}function removeListener(_0xdddd8b,_0x17410e){return function(){SmsQueueEvents[_0xc01f('0x4')](_0xdddd8b,_0x17410e);};}exports[_0xc01f('0x5')]=function(_0xdfc1cb){for(var _0x1ba991=0x0,_0x3270a3=events['length'];_0x1ba991<_0x3270a3;_0x1ba991++){var _0x15a583=events[_0x1ba991];var _0x15e879=createListener(_0xc01f('0x6')+_0x15a583,_0xdfc1cb);SmsQueueEvents['on'](_0x15a583,_0x15e879);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e68cff9..d14b9db 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 _0x2f41=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x2f41,0x94));var _0x12f4=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x2f41[_0x1bc0ae];return _0x501104;};'use strict';var multer=require(_0x12f4('0x0'));var util=require(_0x12f4('0x1'));var path=require('path');var timeout=require(_0x12f4('0x2'));var express=require(_0x12f4('0x3'));var router=express['Router']();var fs_extra=require(_0x12f4('0x4'));var auth=require(_0x12f4('0x5'));var interaction=require(_0x12f4('0x6'));var config=require(_0x12f4('0x7'));var controller=require('./smsQueueReport.controller');router[_0x12f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x12f4('0x9')]);router[_0x12f4('0x8')](_0x12f4('0xa'),auth[_0x12f4('0xb')](),controller[_0x12f4('0xc')]);router[_0x12f4('0x8')](_0x12f4('0xd'),auth['isAuthenticated'](),controller[_0x12f4('0xe')]);router[_0x12f4('0xf')]('/',auth[_0x12f4('0xb')](),controller[_0x12f4('0x10')]);router[_0x12f4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x12f4('0x12')]);router['delete'](_0x12f4('0xd'),auth[_0x12f4('0xb')](),controller[_0x12f4('0x13')]);module[_0x12f4('0x14')]=router; \ No newline at end of file +var _0x6bb4=['get','isAuthenticated','/describe','show','create','put','update','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x10dddd,_0x5dba19){var _0x5a1545=function(_0x409c3a){while(--_0x409c3a){_0x10dddd['push'](_0x10dddd['shift']());}};_0x5a1545(++_0x5dba19);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0x6bb4[_0x33e4a7];return _0x598620;};'use strict';var multer=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var path=require(_0x46bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x46bb('0x3'));var router=express[_0x46bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46bb('0x5'));var interaction=require(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var controller=require(_0x46bb('0x8'));router[_0x46bb('0x9')]('/',auth[_0x46bb('0xa')](),controller['index']);router['get'](_0x46bb('0xb'),auth[_0x46bb('0xa')](),controller['describe']);router['get']('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xc')]);router['post']('/',auth[_0x46bb('0xa')](),controller[_0x46bb('0xd')]);router[_0x46bb('0xe')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xf')]);router['delete'](_0x46bb('0x10'),auth[_0x46bb('0xa')](),controller[_0x46bb('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 70f1e46..3d19b8c 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 _0xb2cf=['exports','STRING','DATE','moment','sequelize'];(function(_0x2617cb,_0xebf82a){var _0x19468e=function(_0x33addb){while(--_0x33addb){_0x2617cb['push'](_0x2617cb['shift']());}};_0x19468e(++_0xebf82a);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x2fa739,_0x2fb4e6){_0x2fa739=_0x2fa739-0x0;var _0x82118e=_0xb2cf[_0x2fa739];return _0x82118e;};'use strict';var moment=require(_0xfb2c('0x0'));var Sequelize=require(_0xfb2c('0x1'));module[_0xfb2c('0x2')]={'uniqueid':{'type':Sequelize[_0xfb2c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfb2c('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfb2c('0x4')]},'acceptAt':{'type':Sequelize[_0xfb2c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfb2c('0x3')]}}; \ No newline at end of file +var _0x9be3=['STRING','DATE','moment','sequelize'];(function(_0x481e5b,_0x9627c9){var _0x24b4f1=function(_0x570840){while(--_0x570840){_0x481e5b['push'](_0x481e5b['shift']());}};_0x24b4f1(++_0x9627c9);}(_0x9be3,0xd2));var _0x39be=function(_0x127a6a,_0x193a95){_0x127a6a=_0x127a6a-0x0;var _0x440e6e=_0x9be3[_0x127a6a];return _0x440e6e;};'use strict';var moment=require(_0x39be('0x0'));var Sequelize=require(_0x39be('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x39be('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x39be('0x2')]},'joinAt':{'type':Sequelize[_0x39be('0x3')]},'leaveAt':{'type':Sequelize[_0x39be('0x3')]},'acceptAt':{'type':Sequelize[_0x39be('0x3')]},'exitAt':{'type':Sequelize[_0x39be('0x3')]},'reason':{'type':Sequelize[_0x39be('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 1712c6f..06d0472 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 _0x1bae=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x8e3df,_0x322a72){var _0x3c487d=function(_0x4bdf8c){while(--_0x4bdf8c){_0x8e3df['push'](_0x8e3df['shift']());}};_0x3c487d(++_0x322a72);}(_0x1bae,0x7e));var _0xe1ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1bae[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1ba('0x0'));var zipdir=require(_0xe1ba('0x1'));var jsonpatch=require(_0xe1ba('0x2'));var rp=require('request-promise');var moment=require(_0xe1ba('0x3'));var BPromise=require(_0xe1ba('0x4'));var Mustache=require(_0xe1ba('0x5'));var util=require(_0xe1ba('0x6'));var path=require(_0xe1ba('0x7'));var sox=require(_0xe1ba('0x8'));var csv=require('to-csv');var ejs=require(_0xe1ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe1ba('0xa'));var _=require(_0xe1ba('0xb'));var squel=require(_0xe1ba('0xc'));var crypto=require(_0xe1ba('0xd'));var jsforce=require(_0xe1ba('0xe'));var deskjs=require(_0xe1ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe1ba('0x10'));var Papa=require('papaparse');var Redis=require(_0xe1ba('0x11'));var authService=require(_0xe1ba('0x12'));var qs=require(_0xe1ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe1ba('0x14'));var utils=require(_0xe1ba('0x15'));var config=require(_0xe1ba('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1ba('0x17'))['db'];function respondWithStatusCode(_0x44568d,_0x429067){_0x429067=_0x429067||0xcc;return function(_0x122aeb){if(_0x122aeb){return _0x44568d[_0xe1ba('0x18')](_0x429067);}return _0x44568d[_0xe1ba('0x19')](_0x429067)[_0xe1ba('0x1a')]();};}function respondWithResult(_0x5610ba,_0x4b1456){_0x4b1456=_0x4b1456||0xc8;return function(_0x1af9b){if(_0x1af9b){return _0x5610ba['status'](_0x4b1456)[_0xe1ba('0x1b')](_0x1af9b);}};}function respondWithFilteredResult(_0x21f7d8,_0x3c028e){return function(_0x2f2a69){if(_0x2f2a69){var _0x43ffe8=typeof _0x3c028e[_0xe1ba('0x1c')]===_0xe1ba('0x1d')&&typeof _0x3c028e['limit']===_0xe1ba('0x1d');var _0x4d673e=_0x2f2a69['count'];var _0x128f62=_0x43ffe8?0x0:_0x3c028e['offset'];var _0x47c3f3=_0x43ffe8?_0x2f2a69[_0xe1ba('0x1e')]:_0x3c028e['offset']+_0x3c028e[_0xe1ba('0x1f')];var _0x29fa2a;if(_0x47c3f3>=_0x4d673e){_0x47c3f3=_0x4d673e;_0x29fa2a=0xc8;}else{_0x29fa2a=0xce;}_0x21f7d8['status'](_0x29fa2a);return _0x21f7d8[_0xe1ba('0x20')](_0xe1ba('0x21'),_0x128f62+'-'+_0x47c3f3+'/'+_0x4d673e)['json'](_0x2f2a69);}return null;};}function patchUpdates(_0x14dc6f){return function(_0x814f88){try{jsonpatch[_0xe1ba('0x22')](_0x814f88,_0x14dc6f,!![]);}catch(_0x562b60){return BPromise[_0xe1ba('0x23')](_0x562b60);}return _0x814f88[_0xe1ba('0x24')]();};}function saveUpdates(_0x464287,_0x332376){return function(_0x8af2ff){if(_0x8af2ff){return _0x8af2ff[_0xe1ba('0x25')](_0x464287)[_0xe1ba('0x26')](function(_0x4dfca1){return _0x4dfca1;});}return null;};}function removeEntity(_0x1f625c,_0x5efa0b){return function(_0x382ec0){if(_0x382ec0){return _0x382ec0[_0xe1ba('0x27')]()[_0xe1ba('0x26')](function(){_0x1f625c[_0xe1ba('0x19')](0xcc)[_0xe1ba('0x1a')]();});}};}function handleEntityNotFound(_0x2e9379,_0x334d20){return function(_0x5a9ad4){if(!_0x5a9ad4){_0x2e9379[_0xe1ba('0x18')](0x194);}return _0x5a9ad4;};}function handleError(_0x4a2951,_0x585f14){_0x585f14=_0x585f14||0x1f4;return function(_0xc66f3b){logger[_0xe1ba('0x28')](_0xc66f3b[_0xe1ba('0x29')]);if(_0xc66f3b[_0xe1ba('0x2a')]){delete _0xc66f3b['name'];}_0x4a2951[_0xe1ba('0x19')](_0x585f14)['send'](_0xc66f3b);};}exports[_0xe1ba('0x2b')]=function(_0x55364e,_0x2148bf){var _0x1c07fa={},_0x3099d2={},_0xc72561={'count':0x0,'rows':[]};var _0x5d1367=_[_0xe1ba('0x2c')](db[_0xe1ba('0x2d')][_0xe1ba('0x2e')],function(_0x16ed9b){return{'name':_0x16ed9b[_0xe1ba('0x2f')],'type':_0x16ed9b[_0xe1ba('0x30')][_0xe1ba('0x31')]};});_0x3099d2[_0xe1ba('0x32')]=_['map'](_0x5d1367,'name');_0x3099d2[_0xe1ba('0x33')]=_[_0xe1ba('0x34')](_0x55364e[_0xe1ba('0x33')]);_0x3099d2[_0xe1ba('0x35')]=_[_0xe1ba('0x36')](_0x3099d2[_0xe1ba('0x32')],_0x3099d2[_0xe1ba('0x33')]);_0x1c07fa[_0xe1ba('0x37')]=_[_0xe1ba('0x36')](_0x3099d2[_0xe1ba('0x32')],qs[_0xe1ba('0x38')](_0x55364e[_0xe1ba('0x33')]['fields']));_0x1c07fa['attributes']=_0x1c07fa[_0xe1ba('0x37')]['length']?_0x1c07fa[_0xe1ba('0x37')]:_0x3099d2[_0xe1ba('0x32')];if(!_0x55364e[_0xe1ba('0x33')]['hasOwnProperty'](_0xe1ba('0x39'))){_0x1c07fa[_0xe1ba('0x1f')]=qs[_0xe1ba('0x1f')](_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x1f')]);_0x1c07fa['offset']=qs[_0xe1ba('0x1c')](_0x55364e['query'][_0xe1ba('0x1c')]);}_0x1c07fa['order']=qs[_0xe1ba('0x3a')](_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x3a')]);_0x1c07fa[_0xe1ba('0x3b')]=qs['filters'](_[_0xe1ba('0x3c')](_0x55364e[_0xe1ba('0x33')],_0x3099d2[_0xe1ba('0x35')]),_0x5d1367);if(_0x55364e[_0xe1ba('0x33')][_0xe1ba('0x3d')]){_0x1c07fa[_0xe1ba('0x3b')]=_[_0xe1ba('0x3e')](_0x1c07fa[_0xe1ba('0x3b')],{'$or':_[_0xe1ba('0x2c')](_0x5d1367,function(_0x4f3e2f){if(_0x4f3e2f[_0xe1ba('0x30')]!==_0xe1ba('0x3f')){var _0x1c63d2={};_0x1c63d2[_0x4f3e2f[_0xe1ba('0x2a')]]={'$like':'%'+_0x55364e[_0xe1ba('0x33')]['filter']+'%'};return _0x1c63d2;}})});}_0x1c07fa=_[_0xe1ba('0x3e')]({},_0x1c07fa,_0x55364e[_0xe1ba('0x40')]);var _0x2be404={'where':_0x1c07fa[_0xe1ba('0x3b')]};return db[_0xe1ba('0x2d')][_0xe1ba('0x1e')](_0x2be404)[_0xe1ba('0x26')](function(_0x112e9b){_0xc72561['count']=_0x112e9b;if(_0x55364e[_0xe1ba('0x33')]['includeAll']){_0x1c07fa[_0xe1ba('0x41')]=[{'all':!![]}];}return db[_0xe1ba('0x2d')][_0xe1ba('0x42')](_0x1c07fa);})[_0xe1ba('0x26')](function(_0x26d344){_0xc72561['rows']=_0x26d344;return _0xc72561;})[_0xe1ba('0x26')](respondWithFilteredResult(_0x2148bf,_0x1c07fa))[_0xe1ba('0x43')](handleError(_0x2148bf,null));};exports[_0xe1ba('0x44')]=function(_0xe14a19,_0x579423){var _0x2742bf={'raw':!![],'where':{'id':_0xe14a19[_0xe1ba('0x45')]['id']}},_0x171ed6={};_0x171ed6[_0xe1ba('0x32')]=_['keys'](db[_0xe1ba('0x2d')][_0xe1ba('0x2e')]);_0x171ed6['query']=_[_0xe1ba('0x34')](_0xe14a19[_0xe1ba('0x33')]);_0x171ed6[_0xe1ba('0x35')]=_[_0xe1ba('0x36')](_0x171ed6[_0xe1ba('0x32')],_0x171ed6[_0xe1ba('0x33')]);_0x2742bf[_0xe1ba('0x37')]=_[_0xe1ba('0x36')](_0x171ed6[_0xe1ba('0x32')],qs[_0xe1ba('0x38')](_0xe14a19[_0xe1ba('0x33')][_0xe1ba('0x38')]));_0x2742bf[_0xe1ba('0x37')]=_0x2742bf[_0xe1ba('0x37')][_0xe1ba('0x46')]?_0x2742bf[_0xe1ba('0x37')]:_0x171ed6['model'];if(_0xe14a19['query'][_0xe1ba('0x47')]){_0x2742bf[_0xe1ba('0x41')]=[{'all':!![]}];}_0x2742bf=_[_0xe1ba('0x3e')]({},_0x2742bf,_0xe14a19[_0xe1ba('0x40')]);return db[_0xe1ba('0x2d')][_0xe1ba('0x48')](_0x2742bf)[_0xe1ba('0x26')](handleEntityNotFound(_0x579423,null))['then'](respondWithResult(_0x579423,null))[_0xe1ba('0x43')](handleError(_0x579423,null));};exports[_0xe1ba('0x49')]=function(_0x6b5d74,_0x1eabe4){return db[_0xe1ba('0x2d')][_0xe1ba('0x49')](_0x6b5d74[_0xe1ba('0x4a')],{})[_0xe1ba('0x26')](respondWithResult(_0x1eabe4,0xc9))[_0xe1ba('0x43')](handleError(_0x1eabe4,null));};exports['update']=function(_0x1969fe,_0x3d90ff){if(_0x1969fe['body']['id']){delete _0x1969fe[_0xe1ba('0x4a')]['id'];}return db[_0xe1ba('0x2d')]['find']({'where':{'id':_0x1969fe['params']['id']}})[_0xe1ba('0x26')](handleEntityNotFound(_0x3d90ff,null))['then'](saveUpdates(_0x1969fe[_0xe1ba('0x4a')],null))[_0xe1ba('0x26')](respondWithResult(_0x3d90ff,null))[_0xe1ba('0x43')](handleError(_0x3d90ff,null));};exports[_0xe1ba('0x27')]=function(_0x53ff7e,_0x37f8cb){return db[_0xe1ba('0x2d')]['find']({'where':{'id':_0x53ff7e['params']['id']}})[_0xe1ba('0x26')](handleEntityNotFound(_0x37f8cb,null))[_0xe1ba('0x26')](removeEntity(_0x37f8cb,null))[_0xe1ba('0x43')](handleError(_0x37f8cb,null));};exports[_0xe1ba('0x4b')]=function(_0x56506a,_0x52b525){return db[_0xe1ba('0x2d')][_0xe1ba('0x4b')]()[_0xe1ba('0x26')](respondWithResult(_0x52b525,null))[_0xe1ba('0x43')](handleError(_0x52b525,null));}; \ No newline at end of file +var _0x2d56=['fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2d56,0x8b));var _0x62d5=function(_0x46b6d5,_0x2d1e48){_0x46b6d5=_0x46b6d5-0x0;var _0x3d7fb5=_0x2d56[_0x46b6d5];return _0x3d7fb5;};'use strict';var emlformat=require(_0x62d5('0x0'));var rimraf=require(_0x62d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62d5('0x2'));var rp=require(_0x62d5('0x3'));var moment=require('moment');var BPromise=require(_0x62d5('0x4'));var Mustache=require(_0x62d5('0x5'));var util=require('util');var path=require(_0x62d5('0x6'));var sox=require(_0x62d5('0x7'));var csv=require(_0x62d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62d5('0x9'));var _=require(_0x62d5('0xa'));var squel=require('squel');var crypto=require(_0x62d5('0xb'));var jsforce=require(_0x62d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62d5('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x62d5('0xd'));var qs=require(_0x62d5('0xe'));var as=require(_0x62d5('0xf'));var hardwareService=require(_0x62d5('0x10'));var logger=require(_0x62d5('0x11'))('api');var utils=require(_0x62d5('0x12'));var config=require(_0x62d5('0x13'));var licenseUtil=require(_0x62d5('0x14'));var db=require(_0x62d5('0x15'))['db'];function respondWithStatusCode(_0x28f666,_0x6c8287){_0x6c8287=_0x6c8287||0xcc;return function(_0x2153b3){if(_0x2153b3){return _0x28f666['sendStatus'](_0x6c8287);}return _0x28f666[_0x62d5('0x16')](_0x6c8287)['end']();};}function respondWithResult(_0x5e4b02,_0x4eff5d){_0x4eff5d=_0x4eff5d||0xc8;return function(_0x250360){if(_0x250360){return _0x5e4b02[_0x62d5('0x16')](_0x4eff5d)[_0x62d5('0x17')](_0x250360);}};}function respondWithFilteredResult(_0x13f6f6,_0x3968fe){return function(_0x21466e){if(_0x21466e){var _0x36dcbe=typeof _0x3968fe[_0x62d5('0x18')]===_0x62d5('0x19')&&typeof _0x3968fe[_0x62d5('0x1a')]===_0x62d5('0x19');var _0x43d281=_0x21466e[_0x62d5('0x1b')];var _0xbce9e=_0x36dcbe?0x0:_0x3968fe[_0x62d5('0x18')];var _0x406297=_0x36dcbe?_0x21466e[_0x62d5('0x1b')]:_0x3968fe[_0x62d5('0x18')]+_0x3968fe[_0x62d5('0x1a')];var _0x5d0942;if(_0x406297>=_0x43d281){_0x406297=_0x43d281;_0x5d0942=0xc8;}else{_0x5d0942=0xce;}_0x13f6f6['status'](_0x5d0942);return _0x13f6f6['set'](_0x62d5('0x1c'),_0xbce9e+'-'+_0x406297+'/'+_0x43d281)['json'](_0x21466e);}return null;};}function patchUpdates(_0x1d5a52){return function(_0x5cd1f0){try{jsonpatch[_0x62d5('0x1d')](_0x5cd1f0,_0x1d5a52,!![]);}catch(_0x45de9a){return BPromise[_0x62d5('0x1e')](_0x45de9a);}return _0x5cd1f0[_0x62d5('0x1f')]();};}function saveUpdates(_0x4d776f,_0x32e95d){return function(_0x101458){if(_0x101458){return _0x101458[_0x62d5('0x20')](_0x4d776f)['then'](function(_0x2de3d6){return _0x2de3d6;});}return null;};}function removeEntity(_0x366bf7,_0x4c80a7){return function(_0x32c7f6){if(_0x32c7f6){return _0x32c7f6[_0x62d5('0x21')]()[_0x62d5('0x22')](function(){_0x366bf7[_0x62d5('0x16')](0xcc)[_0x62d5('0x23')]();});}};}function handleEntityNotFound(_0x3d1222,_0x5e3a69){return function(_0x4926b3){if(!_0x4926b3){_0x3d1222[_0x62d5('0x24')](0x194);}return _0x4926b3;};}function handleError(_0x29617b,_0x542936){_0x542936=_0x542936||0x1f4;return function(_0x240fc1){logger[_0x62d5('0x25')](_0x240fc1['stack']);if(_0x240fc1['name']){delete _0x240fc1[_0x62d5('0x26')];}_0x29617b['status'](_0x542936)['send'](_0x240fc1);};}exports[_0x62d5('0x27')]=function(_0x1be05c,_0x54e91e){var _0x182d0c={},_0x58f6d0={},_0x31d06e={'count':0x0,'rows':[]};var _0x18434e=_[_0x62d5('0x28')](db[_0x62d5('0x29')][_0x62d5('0x2a')],function(_0x543dd5){return{'name':_0x543dd5[_0x62d5('0x2b')],'type':_0x543dd5[_0x62d5('0x2c')][_0x62d5('0x2d')]};});_0x58f6d0[_0x62d5('0x2e')]=_[_0x62d5('0x28')](_0x18434e,_0x62d5('0x26'));_0x58f6d0[_0x62d5('0x2f')]=_[_0x62d5('0x30')](_0x1be05c[_0x62d5('0x2f')]);_0x58f6d0[_0x62d5('0x31')]=_['intersection'](_0x58f6d0['model'],_0x58f6d0['query']);_0x182d0c[_0x62d5('0x32')]=_['intersection'](_0x58f6d0[_0x62d5('0x2e')],qs[_0x62d5('0x33')](_0x1be05c[_0x62d5('0x2f')][_0x62d5('0x33')]));_0x182d0c['attributes']=_0x182d0c[_0x62d5('0x32')]['length']?_0x182d0c[_0x62d5('0x32')]:_0x58f6d0[_0x62d5('0x2e')];if(!_0x1be05c[_0x62d5('0x2f')]['hasOwnProperty'](_0x62d5('0x34'))){_0x182d0c[_0x62d5('0x1a')]=qs[_0x62d5('0x1a')](_0x1be05c[_0x62d5('0x2f')][_0x62d5('0x1a')]);_0x182d0c[_0x62d5('0x18')]=qs[_0x62d5('0x18')](_0x1be05c['query'][_0x62d5('0x18')]);}_0x182d0c[_0x62d5('0x35')]=qs[_0x62d5('0x36')](_0x1be05c[_0x62d5('0x2f')]['sort']);_0x182d0c['where']=qs[_0x62d5('0x31')](_[_0x62d5('0x37')](_0x1be05c['query'],_0x58f6d0[_0x62d5('0x31')]),_0x18434e);if(_0x1be05c['query'][_0x62d5('0x38')]){_0x182d0c[_0x62d5('0x39')]=_[_0x62d5('0x3a')](_0x182d0c[_0x62d5('0x39')],{'$or':_[_0x62d5('0x28')](_0x18434e,function(_0x5b4103){if(_0x5b4103[_0x62d5('0x2c')]!==_0x62d5('0x3b')){var _0x22c124={};_0x22c124[_0x5b4103[_0x62d5('0x26')]]={'$like':'%'+_0x1be05c[_0x62d5('0x2f')][_0x62d5('0x38')]+'%'};return _0x22c124;}})});}_0x182d0c=_[_0x62d5('0x3a')]({},_0x182d0c,_0x1be05c['options']);var _0x4d1e19={'where':_0x182d0c[_0x62d5('0x39')]};return db['SmsQueueReport'][_0x62d5('0x1b')](_0x4d1e19)[_0x62d5('0x22')](function(_0x46266f){_0x31d06e['count']=_0x46266f;if(_0x1be05c[_0x62d5('0x2f')][_0x62d5('0x3c')]){_0x182d0c[_0x62d5('0x3d')]=[{'all':!![]}];}return db[_0x62d5('0x29')][_0x62d5('0x3e')](_0x182d0c);})[_0x62d5('0x22')](function(_0x445a99){_0x31d06e[_0x62d5('0x3f')]=_0x445a99;return _0x31d06e;})[_0x62d5('0x22')](respondWithFilteredResult(_0x54e91e,_0x182d0c))[_0x62d5('0x40')](handleError(_0x54e91e,null));};exports[_0x62d5('0x41')]=function(_0x470f1e,_0x2f1a1e){var _0x38fac5={'raw':!![],'where':{'id':_0x470f1e[_0x62d5('0x42')]['id']}},_0x4dee9e={};_0x4dee9e[_0x62d5('0x2e')]=_[_0x62d5('0x30')](db[_0x62d5('0x29')][_0x62d5('0x2a')]);_0x4dee9e['query']=_['keys'](_0x470f1e[_0x62d5('0x2f')]);_0x4dee9e[_0x62d5('0x31')]=_[_0x62d5('0x43')](_0x4dee9e[_0x62d5('0x2e')],_0x4dee9e[_0x62d5('0x2f')]);_0x38fac5[_0x62d5('0x32')]=_[_0x62d5('0x43')](_0x4dee9e['model'],qs['fields'](_0x470f1e['query'][_0x62d5('0x33')]));_0x38fac5[_0x62d5('0x32')]=_0x38fac5[_0x62d5('0x32')][_0x62d5('0x44')]?_0x38fac5[_0x62d5('0x32')]:_0x4dee9e[_0x62d5('0x2e')];if(_0x470f1e['query'][_0x62d5('0x3c')]){_0x38fac5[_0x62d5('0x3d')]=[{'all':!![]}];}_0x38fac5=_[_0x62d5('0x3a')]({},_0x38fac5,_0x470f1e[_0x62d5('0x45')]);return db['SmsQueueReport'][_0x62d5('0x46')](_0x38fac5)['then'](handleEntityNotFound(_0x2f1a1e,null))['then'](respondWithResult(_0x2f1a1e,null))[_0x62d5('0x40')](handleError(_0x2f1a1e,null));};exports[_0x62d5('0x47')]=function(_0x272c8e,_0x211212){return db[_0x62d5('0x29')][_0x62d5('0x47')](_0x272c8e['body'],{})[_0x62d5('0x22')](respondWithResult(_0x211212,0xc9))[_0x62d5('0x40')](handleError(_0x211212,null));};exports[_0x62d5('0x20')]=function(_0x13642c,_0x2db660){if(_0x13642c[_0x62d5('0x48')]['id']){delete _0x13642c[_0x62d5('0x48')]['id'];}return db['SmsQueueReport'][_0x62d5('0x46')]({'where':{'id':_0x13642c['params']['id']}})[_0x62d5('0x22')](handleEntityNotFound(_0x2db660,null))['then'](saveUpdates(_0x13642c[_0x62d5('0x48')],null))[_0x62d5('0x22')](respondWithResult(_0x2db660,null))[_0x62d5('0x40')](handleError(_0x2db660,null));};exports['destroy']=function(_0x50b0e1,_0x3d0a89){return db['SmsQueueReport'][_0x62d5('0x46')]({'where':{'id':_0x50b0e1[_0x62d5('0x42')]['id']}})[_0x62d5('0x22')](handleEntityNotFound(_0x3d0a89,null))['then'](removeEntity(_0x3d0a89,null))[_0x62d5('0x40')](handleError(_0x3d0a89,null));};exports[_0x62d5('0x49')]=function(_0x4f5c9e,_0x2155de){return db['SmsQueueReport'][_0x62d5('0x49')]()[_0x62d5('0x22')](respondWithResult(_0x2155de,null))[_0x62d5('0x40')](handleError(_0x2155de,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3bacfc2..2dfecbd 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x112771,_0xd7d6de){var _0x3939d8=function(_0x5e6cf0){while(--_0x5e6cf0){_0x112771['push'](_0x112771['shift']());}};_0x3939d8(++_0xd7d6de);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xcb91[_0x26fc81];return _0x9feece;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 9f62e6e..8415f7f 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 _0x24f6=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsQueueReport','create','options','debug','UpdateSmsQueueReport','SmsQueueReport','update','body','raw','where','limit'];(function(_0x5e495b,_0x351a01){var _0x270ada=function(_0x4b4500){while(--_0x4b4500){_0x5e495b['push'](_0x5e495b['shift']());}};_0x270ada(++_0x351a01);}(_0x24f6,0x100));var _0x624f=function(_0x26ea23,_0x287faa){_0x26ea23=_0x26ea23-0x0;var _0x4c3556=_0x24f6[_0x26ea23];return _0x4c3556;};'use strict';var _=require(_0x624f('0x0'));var util=require('util');var moment=require(_0x624f('0x1'));var BPromise=require(_0x624f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x624f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x624f('0x4'));var logger=require(_0x624f('0x5'))(_0x624f('0x6'));var config=require(_0x624f('0x7'));var jayson=require(_0x624f('0x8'));var client=jayson[_0x624f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45aeca,_0x1d610c,_0x5f258a){return new BPromise(function(_0x336115,_0x38f42d){return client[_0x624f('0xa')](_0x45aeca,_0x5f258a)[_0x624f('0xb')](function(_0x2516e6){logger[_0x624f('0xc')](_0x624f('0xd'),_0x1d610c,_0x624f('0xe'));logger['debug'](_0x624f('0xf'),_0x1d610c,_0x624f('0xe'),JSON[_0x624f('0x10')](_0x2516e6));if(_0x2516e6[_0x624f('0x11')]){if(_0x2516e6[_0x624f('0x11')][_0x624f('0x12')]===0x1f4){logger[_0x624f('0x11')](_0x624f('0xd'),_0x1d610c,_0x2516e6[_0x624f('0x11')][_0x624f('0x13')]);return _0x38f42d(_0x2516e6['error'][_0x624f('0x13')]);}logger[_0x624f('0x11')](_0x624f('0xd'),_0x1d610c,_0x2516e6['error']['message']);return _0x336115(_0x2516e6[_0x624f('0x11')]['message']);}else{logger[_0x624f('0xc')](_0x624f('0xd'),_0x1d610c,_0x624f('0xe'));_0x336115(_0x2516e6['result'][_0x624f('0x13')]);}})[_0x624f('0x14')](function(_0x20be12){logger['error'](_0x624f('0xd'),_0x1d610c,_0x20be12);_0x38f42d(_0x20be12);});});}exports[_0x624f('0x15')]=function(_0x2133bc){var _0xd7fd79=this;return new Promise(function(_0x449ecf,_0x5ae0d4){return db['SmsQueueReport'][_0x624f('0x16')](_0x2133bc['body'],{'raw':_0x2133bc[_0x624f('0x17')]?_0x2133bc[_0x624f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x624f('0xb')](function(_0x584668){logger['info'](_0x624f('0x15'),_0x2133bc);logger[_0x624f('0x18')](_0x624f('0x15'),_0x2133bc,JSON['stringify'](_0x584668));_0x449ecf(_0x584668);})[_0x624f('0x14')](function(_0x367ca5){logger[_0x624f('0x11')]('CreateSmsQueueReport',_0x367ca5[_0x624f('0x13')],_0x2133bc);_0x5ae0d4(_0xd7fd79['error'](0x1f4,_0x367ca5[_0x624f('0x13')]));});});};exports[_0x624f('0x19')]=function(_0x592f90){var _0x242ae0=this;return new Promise(function(_0x40f9bc,_0x44a851){return db[_0x624f('0x1a')][_0x624f('0x1b')](_0x592f90[_0x624f('0x1c')],{'raw':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1e')]||null:null,'attributes':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')]['attributes']||null:null,'limit':_0x592f90[_0x624f('0x17')]?_0x592f90[_0x624f('0x17')][_0x624f('0x1f')]||null:null})[_0x624f('0xb')](function(_0x50bb03){logger['info']('UpdateSmsQueueReport',_0x592f90);logger[_0x624f('0x18')]('UpdateSmsQueueReport',_0x592f90,JSON[_0x624f('0x10')](_0x50bb03));_0x40f9bc(_0x50bb03);})[_0x624f('0x14')](function(_0x45dc19){logger[_0x624f('0x11')]('UpdateSmsQueueReport',_0x45dc19[_0x624f('0x13')],_0x592f90);_0x44a851(_0x242ae0[_0x624f('0x11')](0x1f4,_0x45dc19[_0x624f('0x13')]));});});}; \ No newline at end of file +var _0x3cc0=['limit','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where'];(function(_0x3a2295,_0x3064c9){var _0x569710=function(_0x2609e1){while(--_0x2609e1){_0x3a2295['push'](_0x3a2295['shift']());}};_0x569710(++_0x3064c9);}(_0x3cc0,0x1af));var _0x03cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3cc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x03cc('0x0'));var util=require(_0x03cc('0x1'));var moment=require('moment');var BPromise=require(_0x03cc('0x2'));var rs=require(_0x03cc('0x3'));var fs=require('fs');var Redis=require(_0x03cc('0x4'));var db=require(_0x03cc('0x5'))['db'];var utils=require(_0x03cc('0x6'));var logger=require(_0x03cc('0x7'))(_0x03cc('0x8'));var config=require(_0x03cc('0x9'));var jayson=require(_0x03cc('0xa'));var client=jayson['client'][_0x03cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a24a9,_0x13eb9f,_0x4dc506){return new BPromise(function(_0x3600c8,_0x43cd14){return client[_0x03cc('0xc')](_0x2a24a9,_0x4dc506)['then'](function(_0x543cb7){logger[_0x03cc('0xd')](_0x03cc('0xe'),_0x13eb9f,'request\x20sent');logger[_0x03cc('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x13eb9f,_0x03cc('0x10'),JSON[_0x03cc('0x11')](_0x543cb7));if(_0x543cb7['error']){if(_0x543cb7[_0x03cc('0x12')][_0x03cc('0x13')]===0x1f4){logger[_0x03cc('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x13eb9f,_0x543cb7[_0x03cc('0x12')][_0x03cc('0x14')]);return _0x43cd14(_0x543cb7[_0x03cc('0x12')]['message']);}logger[_0x03cc('0x12')](_0x03cc('0xe'),_0x13eb9f,_0x543cb7[_0x03cc('0x12')][_0x03cc('0x14')]);return _0x3600c8(_0x543cb7[_0x03cc('0x12')][_0x03cc('0x14')]);}else{logger[_0x03cc('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x13eb9f,_0x03cc('0x10'));_0x3600c8(_0x543cb7['result'][_0x03cc('0x14')]);}})[_0x03cc('0x15')](function(_0xadc44e){logger['error'](_0x03cc('0xe'),_0x13eb9f,_0xadc44e);_0x43cd14(_0xadc44e);});});}exports[_0x03cc('0x16')]=function(_0x3f0598){var _0x3fe4a0=this;return new Promise(function(_0x42f648,_0x32f70e){return db[_0x03cc('0x17')][_0x03cc('0x18')](_0x3f0598[_0x03cc('0x19')],{'raw':_0x3f0598[_0x03cc('0x1a')]?_0x3f0598[_0x03cc('0x1a')][_0x03cc('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x240137){logger[_0x03cc('0xd')]('CreateSmsQueueReport',_0x3f0598);logger[_0x03cc('0xf')]('CreateSmsQueueReport',_0x3f0598,JSON['stringify'](_0x240137));_0x42f648(_0x240137);})['catch'](function(_0x266cdd){logger[_0x03cc('0x12')](_0x03cc('0x16'),_0x266cdd[_0x03cc('0x14')],_0x3f0598);_0x32f70e(_0x3fe4a0[_0x03cc('0x12')](0x1f4,_0x266cdd[_0x03cc('0x14')]));});});};exports[_0x03cc('0x1c')]=function(_0x914351){var _0x412932=this;return new Promise(function(_0x42040e,_0x32fc7d){return db['SmsQueueReport'][_0x03cc('0x1d')](_0x914351[_0x03cc('0x19')],{'raw':_0x914351[_0x03cc('0x1a')]?_0x914351[_0x03cc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x914351[_0x03cc('0x1a')]?_0x914351[_0x03cc('0x1a')][_0x03cc('0x1e')]||null:null,'attributes':_0x914351[_0x03cc('0x1a')]?_0x914351[_0x03cc('0x1a')]['attributes']||null:null,'limit':_0x914351[_0x03cc('0x1a')]?_0x914351[_0x03cc('0x1a')][_0x03cc('0x1f')]||null:null})[_0x03cc('0x20')](function(_0x48409d){logger[_0x03cc('0xd')](_0x03cc('0x1c'),_0x914351);logger['debug'](_0x03cc('0x1c'),_0x914351,JSON[_0x03cc('0x11')](_0x48409d));_0x42040e(_0x48409d);})[_0x03cc('0x15')](function(_0x2eedb5){logger['error'](_0x03cc('0x1c'),_0x2eedb5[_0x03cc('0x14')],_0x914351);_0x32fc7d(_0x412932[_0x03cc('0x12')](0x1f4,_0x2eedb5[_0x03cc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b6c841c..4f3fec2 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(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x7217,0x19e));var _0x7721=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7217[_0x521929];return _0x632436;};'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 _0x81bd=['../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3e3819,_0x562054){var _0x148457=function(_0x530a46){while(--_0x530a46){_0x3e3819['push'](_0x3e3819['shift']());}};_0x148457(++_0x562054);}(_0x81bd,0x7c));var _0xd81b=function(_0x26068a,_0x11058c){_0x26068a=_0x26068a-0x0;var _0x4c2517=_0x81bd[_0x26068a];return _0x4c2517;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var fs_extra=require(_0xd81b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var controller=require(_0xd81b('0x9'));router['get']('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0xb')]);router[_0xd81b('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd81b('0xd')]);router['get'](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')]('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x12')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x13')]);router[_0xd81b('0x14')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller['destroy']);module[_0xd81b('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 15d5d7d..b16cab7 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x43fda2,_0x1c5662){var _0xa492a2=function(_0x3a92c4){while(--_0x3a92c4){_0x43fda2['push'](_0x43fda2['shift']());}};_0xa492a2(++_0x1c5662);}(_0x34e8,0x12c));var _0x834e=function(_0x42309b,_0x4a02a6){_0x42309b=_0x42309b-0x0;var _0x1509af=_0x34e8[_0x42309b];return _0x1509af;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x9bde,0xe1));var _0xe9bd=function(_0x246729,_0x193260){_0x246729=_0x246729-0x0;var _0xa892f=_0x9bde[_0x246729];return _0xa892f;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7c5939e..6e8cee8 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 _0x6f8a=['show','params','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch'];(function(_0x594774,_0x3fc4a7){var _0x2e032d=function(_0x4e9640){while(--_0x4e9640){_0x594774['push'](_0x594774['shift']());}};_0x2e032d(++_0x3fc4a7);}(_0x6f8a,0x1b0));var _0xa6f8=function(_0x3292c3,_0x2f1e3b){_0x3292c3=_0x3292c3-0x0;var _0x572074=_0x6f8a[_0x3292c3];return _0x572074;};'use strict';var emlformat=require(_0xa6f8('0x0'));var rimraf=require(_0xa6f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa6f8('0x2'));var moment=require('moment');var BPromise=require(_0xa6f8('0x3'));var Mustache=require(_0xa6f8('0x4'));var util=require(_0xa6f8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6f8('0x6'));var fs=require('fs');var fs_extra=require(_0xa6f8('0x7'));var _=require(_0xa6f8('0x8'));var squel=require(_0xa6f8('0x9'));var crypto=require(_0xa6f8('0xa'));var jsforce=require(_0xa6f8('0xb'));var deskjs=require(_0xa6f8('0xc'));var toCsv=require(_0xa6f8('0xd'));var querystring=require(_0xa6f8('0xe'));var Papa=require(_0xa6f8('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa6f8('0x10'));var as=require(_0xa6f8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa6f8('0x12'));var utils=require(_0xa6f8('0x13'));var config=require(_0xa6f8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5871,_0x35c138){_0x35c138=_0x35c138||0xcc;return function(_0x894dc1){if(_0x894dc1){return _0x2b5871[_0xa6f8('0x15')](_0x35c138);}return _0x2b5871[_0xa6f8('0x16')](_0x35c138)[_0xa6f8('0x17')]();};}function respondWithResult(_0x3dae3d,_0x4c4c39){_0x4c4c39=_0x4c4c39||0xc8;return function(_0x3ee060){if(_0x3ee060){return _0x3dae3d[_0xa6f8('0x16')](_0x4c4c39)[_0xa6f8('0x18')](_0x3ee060);}};}function respondWithFilteredResult(_0x2286e6,_0x42fb79){return function(_0x4a7f23){if(_0x4a7f23){var _0xbeda=typeof _0x42fb79[_0xa6f8('0x19')]===_0xa6f8('0x1a')&&typeof _0x42fb79[_0xa6f8('0x1b')]==='undefined';var _0x1273d0=_0x4a7f23['count'];var _0x31ccd5=_0xbeda?0x0:_0x42fb79['offset'];var _0x47bc07=_0xbeda?_0x4a7f23[_0xa6f8('0x1c')]:_0x42fb79['offset']+_0x42fb79[_0xa6f8('0x1b')];var _0x4093c6;if(_0x47bc07>=_0x1273d0){_0x47bc07=_0x1273d0;_0x4093c6=0xc8;}else{_0x4093c6=0xce;}_0x2286e6[_0xa6f8('0x16')](_0x4093c6);return _0x2286e6[_0xa6f8('0x1d')](_0xa6f8('0x1e'),_0x31ccd5+'-'+_0x47bc07+'/'+_0x1273d0)['json'](_0x4a7f23);}return null;};}function patchUpdates(_0x230f69){return function(_0x4bc992){try{jsonpatch['apply'](_0x4bc992,_0x230f69,!![]);}catch(_0x10568b){return BPromise['reject'](_0x10568b);}return _0x4bc992[_0xa6f8('0x1f')]();};}function saveUpdates(_0x2bb694,_0x39638c){return function(_0x79d03e){if(_0x79d03e){return _0x79d03e[_0xa6f8('0x20')](_0x2bb694)[_0xa6f8('0x21')](function(_0x3521ad){return _0x3521ad;});}return null;};}function removeEntity(_0x34d2b5,_0xd5defd){return function(_0x41337d){if(_0x41337d){return _0x41337d[_0xa6f8('0x22')]()[_0xa6f8('0x21')](function(){_0x34d2b5['status'](0xcc)[_0xa6f8('0x17')]();});}};}function handleEntityNotFound(_0x9cad0d,_0x5178f6){return function(_0x3d7277){if(!_0x3d7277){_0x9cad0d[_0xa6f8('0x15')](0x194);}return _0x3d7277;};}function handleError(_0x273570,_0x475f8c){_0x475f8c=_0x475f8c||0x1f4;return function(_0x3ce575){logger[_0xa6f8('0x23')](_0x3ce575[_0xa6f8('0x24')]);if(_0x3ce575[_0xa6f8('0x25')]){delete _0x3ce575[_0xa6f8('0x25')];}_0x273570[_0xa6f8('0x16')](_0x475f8c)[_0xa6f8('0x26')](_0x3ce575);};}exports[_0xa6f8('0x27')]=function(_0x4bfd24,_0x58deff){var _0x2556cd={},_0x26e715={},_0x262e98={'count':0x0,'rows':[]};var _0x4bb668=_[_0xa6f8('0x28')](db[_0xa6f8('0x29')][_0xa6f8('0x2a')],function(_0x23065e){return{'name':_0x23065e[_0xa6f8('0x2b')],'type':_0x23065e[_0xa6f8('0x2c')][_0xa6f8('0x2d')]};});_0x26e715[_0xa6f8('0x2e')]=_[_0xa6f8('0x28')](_0x4bb668,_0xa6f8('0x25'));_0x26e715[_0xa6f8('0x2f')]=_[_0xa6f8('0x30')](_0x4bfd24[_0xa6f8('0x2f')]);_0x26e715[_0xa6f8('0x31')]=_[_0xa6f8('0x32')](_0x26e715[_0xa6f8('0x2e')],_0x26e715[_0xa6f8('0x2f')]);_0x2556cd[_0xa6f8('0x33')]=_[_0xa6f8('0x32')](_0x26e715[_0xa6f8('0x2e')],qs[_0xa6f8('0x34')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x34')]));_0x2556cd[_0xa6f8('0x33')]=_0x2556cd[_0xa6f8('0x33')][_0xa6f8('0x35')]?_0x2556cd[_0xa6f8('0x33')]:_0x26e715[_0xa6f8('0x2e')];if(!_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x36')](_0xa6f8('0x37'))){_0x2556cd[_0xa6f8('0x1b')]=qs[_0xa6f8('0x1b')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x1b')]);_0x2556cd[_0xa6f8('0x19')]=qs[_0xa6f8('0x19')](_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x19')]);}_0x2556cd['order']=qs[_0xa6f8('0x38')](_0x4bfd24['query'][_0xa6f8('0x38')]);_0x2556cd[_0xa6f8('0x39')]=qs[_0xa6f8('0x31')](_['pick'](_0x4bfd24['query'],_0x26e715[_0xa6f8('0x31')]),_0x4bb668);if(_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3a')]){_0x2556cd[_0xa6f8('0x39')]=_[_0xa6f8('0x3b')](_0x2556cd[_0xa6f8('0x39')],{'$or':_['map'](_0x4bb668,function(_0x32225b){if(_0x32225b['type']!=='VIRTUAL'){var _0x437358={};_0x437358[_0x32225b[_0xa6f8('0x25')]]={'$like':'%'+_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3a')]+'%'};return _0x437358;}})});}_0x2556cd=_['merge']({},_0x2556cd,_0x4bfd24[_0xa6f8('0x3c')]);var _0x569e25={'where':_0x2556cd[_0xa6f8('0x39')]};return db['SmsTransferReport'][_0xa6f8('0x1c')](_0x569e25)['then'](function(_0x5cb0ba){_0x262e98['count']=_0x5cb0ba;if(_0x4bfd24[_0xa6f8('0x2f')][_0xa6f8('0x3d')]){_0x2556cd[_0xa6f8('0x3e')]=[{'all':!![]}];}return db[_0xa6f8('0x29')][_0xa6f8('0x3f')](_0x2556cd);})['then'](function(_0x160c4e){_0x262e98['rows']=_0x160c4e;return _0x262e98;})['then'](respondWithFilteredResult(_0x58deff,_0x2556cd))[_0xa6f8('0x40')](handleError(_0x58deff,null));};exports[_0xa6f8('0x41')]=function(_0x8ea0e8,_0x320e5e){var _0x2c2cc6={'raw':!![],'where':{'id':_0x8ea0e8[_0xa6f8('0x42')]['id']}},_0x5dc655={};_0x5dc655['model']=_['keys'](db[_0xa6f8('0x29')][_0xa6f8('0x2a')]);_0x5dc655[_0xa6f8('0x2f')]=_[_0xa6f8('0x30')](_0x8ea0e8[_0xa6f8('0x2f')]);_0x5dc655[_0xa6f8('0x31')]=_[_0xa6f8('0x32')](_0x5dc655[_0xa6f8('0x2e')],_0x5dc655[_0xa6f8('0x2f')]);_0x2c2cc6[_0xa6f8('0x33')]=_[_0xa6f8('0x32')](_0x5dc655[_0xa6f8('0x2e')],qs[_0xa6f8('0x34')](_0x8ea0e8['query']['fields']));_0x2c2cc6[_0xa6f8('0x33')]=_0x2c2cc6['attributes'][_0xa6f8('0x35')]?_0x2c2cc6[_0xa6f8('0x33')]:_0x5dc655[_0xa6f8('0x2e')];if(_0x8ea0e8[_0xa6f8('0x2f')]['includeAll']){_0x2c2cc6['include']=[{'all':!![]}];}_0x2c2cc6=_[_0xa6f8('0x3b')]({},_0x2c2cc6,_0x8ea0e8['options']);return db['SmsTransferReport'][_0xa6f8('0x43')](_0x2c2cc6)['then'](handleEntityNotFound(_0x320e5e,null))[_0xa6f8('0x21')](respondWithResult(_0x320e5e,null))['catch'](handleError(_0x320e5e,null));};exports[_0xa6f8('0x44')]=function(_0x96ed20,_0x2d0c62){return db[_0xa6f8('0x29')]['create'](_0x96ed20[_0xa6f8('0x45')],{})[_0xa6f8('0x21')](respondWithResult(_0x2d0c62,0xc9))['catch'](handleError(_0x2d0c62,null));};exports['update']=function(_0x3a8901,_0x11c1bd){if(_0x3a8901['body']['id']){delete _0x3a8901['body']['id'];}return db[_0xa6f8('0x29')][_0xa6f8('0x43')]({'where':{'id':_0x3a8901['params']['id']}})[_0xa6f8('0x21')](handleEntityNotFound(_0x11c1bd,null))[_0xa6f8('0x21')](saveUpdates(_0x3a8901[_0xa6f8('0x45')],null))['then'](respondWithResult(_0x11c1bd,null))['catch'](handleError(_0x11c1bd,null));};exports[_0xa6f8('0x22')]=function(_0x209a88,_0x22a202){return db['SmsTransferReport']['find']({'where':{'id':_0x209a88[_0xa6f8('0x42')]['id']}})['then'](handleEntityNotFound(_0x22a202,null))[_0xa6f8('0x21')](removeEntity(_0x22a202,null))[_0xa6f8('0x40')](handleError(_0x22a202,null));};exports[_0xa6f8('0x46')]=function(_0x191510,_0x27b186){return db['SmsTransferReport'][_0xa6f8('0x46')]()[_0xa6f8('0x21')](respondWithResult(_0x27b186,null))['catch'](handleError(_0x27b186,null));}; \ No newline at end of file +var _0x5df4=['error','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','update','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5df4,0x1a2));var _0x45df=function(_0x392063,_0x2704bd){_0x392063=_0x392063-0x0;var _0x571abe=_0x5df4[_0x392063];return _0x571abe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x45df('0x0'));var jsonpatch=require(_0x45df('0x1'));var rp=require('request-promise');var moment=require(_0x45df('0x2'));var BPromise=require(_0x45df('0x3'));var Mustache=require(_0x45df('0x4'));var util=require(_0x45df('0x5'));var path=require(_0x45df('0x6'));var sox=require(_0x45df('0x7'));var csv=require(_0x45df('0x8'));var ejs=require(_0x45df('0x9'));var fs=require('fs');var fs_extra=require(_0x45df('0xa'));var _=require(_0x45df('0xb'));var squel=require(_0x45df('0xc'));var crypto=require(_0x45df('0xd'));var jsforce=require(_0x45df('0xe'));var deskjs=require(_0x45df('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x45df('0x10'));var Redis=require('ioredis');var authService=require(_0x45df('0x11'));var qs=require(_0x45df('0x12'));var as=require(_0x45df('0x13'));var hardwareService=require(_0x45df('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x45df('0x15'));var config=require(_0x45df('0x16'));var licenseUtil=require(_0x45df('0x17'));var db=require(_0x45df('0x18'))['db'];function respondWithStatusCode(_0x29184e,_0x3bd326){_0x3bd326=_0x3bd326||0xcc;return function(_0xcfc4d1){if(_0xcfc4d1){return _0x29184e[_0x45df('0x19')](_0x3bd326);}return _0x29184e[_0x45df('0x1a')](_0x3bd326)[_0x45df('0x1b')]();};}function respondWithResult(_0x49434a,_0x17c640){_0x17c640=_0x17c640||0xc8;return function(_0x354055){if(_0x354055){return _0x49434a[_0x45df('0x1a')](_0x17c640)['json'](_0x354055);}};}function respondWithFilteredResult(_0x5eb3b4,_0x18b124){return function(_0x4a426f){if(_0x4a426f){var _0x58da37=typeof _0x18b124[_0x45df('0x1c')]===_0x45df('0x1d')&&typeof _0x18b124[_0x45df('0x1e')]===_0x45df('0x1d');var _0x4ccb2e=_0x4a426f[_0x45df('0x1f')];var _0x5f0d7=_0x58da37?0x0:_0x18b124['offset'];var _0x4e412b=_0x58da37?_0x4a426f[_0x45df('0x1f')]:_0x18b124[_0x45df('0x1c')]+_0x18b124[_0x45df('0x1e')];var _0x2cc554;if(_0x4e412b>=_0x4ccb2e){_0x4e412b=_0x4ccb2e;_0x2cc554=0xc8;}else{_0x2cc554=0xce;}_0x5eb3b4[_0x45df('0x1a')](_0x2cc554);return _0x5eb3b4[_0x45df('0x20')]('Content-Range',_0x5f0d7+'-'+_0x4e412b+'/'+_0x4ccb2e)[_0x45df('0x21')](_0x4a426f);}return null;};}function patchUpdates(_0xbd6267){return function(_0x229b2a){try{jsonpatch[_0x45df('0x22')](_0x229b2a,_0xbd6267,!![]);}catch(_0x59a6e5){return BPromise[_0x45df('0x23')](_0x59a6e5);}return _0x229b2a['save']();};}function saveUpdates(_0x2ebb0e,_0x15e84a){return function(_0x5bb852){if(_0x5bb852){return _0x5bb852['update'](_0x2ebb0e)[_0x45df('0x24')](function(_0x8ee2d7){return _0x8ee2d7;});}return null;};}function removeEntity(_0x1932d5,_0x330c3a){return function(_0x2c0f8f){if(_0x2c0f8f){return _0x2c0f8f[_0x45df('0x25')]()['then'](function(){_0x1932d5[_0x45df('0x1a')](0xcc)[_0x45df('0x1b')]();});}};}function handleEntityNotFound(_0x2076fc,_0x56ca40){return function(_0x3a3c46){if(!_0x3a3c46){_0x2076fc['sendStatus'](0x194);}return _0x3a3c46;};}function handleError(_0x2d8362,_0x361a42){_0x361a42=_0x361a42||0x1f4;return function(_0xf9bffd){logger[_0x45df('0x26')](_0xf9bffd['stack']);if(_0xf9bffd['name']){delete _0xf9bffd[_0x45df('0x27')];}_0x2d8362['status'](_0x361a42)[_0x45df('0x28')](_0xf9bffd);};}exports[_0x45df('0x29')]=function(_0x2ad77c,_0x4e551c){var _0x3be398={},_0x47faef={},_0xa7d0e0={'count':0x0,'rows':[]};var _0x5c8333=_['map'](db[_0x45df('0x2a')][_0x45df('0x2b')],function(_0x2afc56){return{'name':_0x2afc56[_0x45df('0x2c')],'type':_0x2afc56[_0x45df('0x2d')][_0x45df('0x2e')]};});_0x47faef[_0x45df('0x2f')]=_[_0x45df('0x30')](_0x5c8333,_0x45df('0x27'));_0x47faef[_0x45df('0x31')]=_[_0x45df('0x32')](_0x2ad77c[_0x45df('0x31')]);_0x47faef[_0x45df('0x33')]=_['intersection'](_0x47faef[_0x45df('0x2f')],_0x47faef[_0x45df('0x31')]);_0x3be398[_0x45df('0x34')]=_[_0x45df('0x35')](_0x47faef[_0x45df('0x2f')],qs[_0x45df('0x36')](_0x2ad77c[_0x45df('0x31')][_0x45df('0x36')]));_0x3be398[_0x45df('0x34')]=_0x3be398[_0x45df('0x34')][_0x45df('0x37')]?_0x3be398[_0x45df('0x34')]:_0x47faef[_0x45df('0x2f')];if(!_0x2ad77c[_0x45df('0x31')][_0x45df('0x38')](_0x45df('0x39'))){_0x3be398['limit']=qs[_0x45df('0x1e')](_0x2ad77c[_0x45df('0x31')]['limit']);_0x3be398['offset']=qs[_0x45df('0x1c')](_0x2ad77c['query']['offset']);}_0x3be398[_0x45df('0x3a')]=qs['sort'](_0x2ad77c[_0x45df('0x31')]['sort']);_0x3be398[_0x45df('0x3b')]=qs['filters'](_[_0x45df('0x3c')](_0x2ad77c['query'],_0x47faef[_0x45df('0x33')]),_0x5c8333);if(_0x2ad77c[_0x45df('0x31')][_0x45df('0x3d')]){_0x3be398[_0x45df('0x3b')]=_[_0x45df('0x3e')](_0x3be398[_0x45df('0x3b')],{'$or':_[_0x45df('0x30')](_0x5c8333,function(_0xfb46c0){if(_0xfb46c0[_0x45df('0x2d')]!==_0x45df('0x3f')){var _0x8681d3={};_0x8681d3[_0xfb46c0['name']]={'$like':'%'+_0x2ad77c[_0x45df('0x31')]['filter']+'%'};return _0x8681d3;}})});}_0x3be398=_[_0x45df('0x3e')]({},_0x3be398,_0x2ad77c[_0x45df('0x40')]);var _0x59d9ec={'where':_0x3be398[_0x45df('0x3b')]};return db[_0x45df('0x2a')][_0x45df('0x1f')](_0x59d9ec)[_0x45df('0x24')](function(_0x14430c){_0xa7d0e0[_0x45df('0x1f')]=_0x14430c;if(_0x2ad77c['query'][_0x45df('0x41')]){_0x3be398[_0x45df('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x3be398);})[_0x45df('0x24')](function(_0x532daa){_0xa7d0e0[_0x45df('0x43')]=_0x532daa;return _0xa7d0e0;})[_0x45df('0x24')](respondWithFilteredResult(_0x4e551c,_0x3be398))[_0x45df('0x44')](handleError(_0x4e551c,null));};exports[_0x45df('0x45')]=function(_0x1094b3,_0x26bc19){var _0x6e95fc={'raw':!![],'where':{'id':_0x1094b3[_0x45df('0x46')]['id']}},_0x2fac28={};_0x2fac28['model']=_[_0x45df('0x32')](db[_0x45df('0x2a')][_0x45df('0x2b')]);_0x2fac28[_0x45df('0x31')]=_[_0x45df('0x32')](_0x1094b3['query']);_0x2fac28['filters']=_[_0x45df('0x35')](_0x2fac28[_0x45df('0x2f')],_0x2fac28[_0x45df('0x31')]);_0x6e95fc[_0x45df('0x34')]=_[_0x45df('0x35')](_0x2fac28['model'],qs[_0x45df('0x36')](_0x1094b3['query'][_0x45df('0x36')]));_0x6e95fc[_0x45df('0x34')]=_0x6e95fc[_0x45df('0x34')][_0x45df('0x37')]?_0x6e95fc['attributes']:_0x2fac28[_0x45df('0x2f')];if(_0x1094b3[_0x45df('0x31')][_0x45df('0x41')]){_0x6e95fc[_0x45df('0x42')]=[{'all':!![]}];}_0x6e95fc=_[_0x45df('0x3e')]({},_0x6e95fc,_0x1094b3['options']);return db['SmsTransferReport'][_0x45df('0x47')](_0x6e95fc)[_0x45df('0x24')](handleEntityNotFound(_0x26bc19,null))[_0x45df('0x24')](respondWithResult(_0x26bc19,null))[_0x45df('0x44')](handleError(_0x26bc19,null));};exports[_0x45df('0x48')]=function(_0x13aa1c,_0x3e59d4){return db['SmsTransferReport']['create'](_0x13aa1c['body'],{})['then'](respondWithResult(_0x3e59d4,0xc9))[_0x45df('0x44')](handleError(_0x3e59d4,null));};exports[_0x45df('0x49')]=function(_0x337d34,_0x24d342){if(_0x337d34[_0x45df('0x4a')]['id']){delete _0x337d34[_0x45df('0x4a')]['id'];}return db[_0x45df('0x2a')]['find']({'where':{'id':_0x337d34[_0x45df('0x46')]['id']}})[_0x45df('0x24')](handleEntityNotFound(_0x24d342,null))[_0x45df('0x24')](saveUpdates(_0x337d34['body'],null))[_0x45df('0x24')](respondWithResult(_0x24d342,null))[_0x45df('0x44')](handleError(_0x24d342,null));};exports[_0x45df('0x25')]=function(_0x4c9579,_0x3dfe42){return db[_0x45df('0x2a')]['find']({'where':{'id':_0x4c9579[_0x45df('0x46')]['id']}})['then'](handleEntityNotFound(_0x3dfe42,null))[_0x45df('0x24')](removeEntity(_0x3dfe42,null))[_0x45df('0x44')](handleError(_0x3dfe42,null));};exports['describe']=function(_0x57cbe4,_0xa187ae){return db[_0x45df('0x2a')][_0x45df('0x4b')]()['then'](respondWithResult(_0xa187ae,null))[_0x45df('0x44')](handleError(_0xa187ae,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 64d5529..971b5c0 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 _0x1b12=['request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b12,0x1b6));var _0x21b1=function(_0x5db643,_0x3cd4ee){_0x5db643=_0x5db643-0x0;var _0x58850a=_0x1b12[_0x5db643];return _0x58850a;};'use strict';var _=require(_0x21b1('0x0'));var util=require('util');var logger=require(_0x21b1('0x1'))(_0x21b1('0x2'));var moment=require(_0x21b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x21b1('0x4'));var fs=require('fs');var path=require(_0x21b1('0x5'));var rimraf=require(_0x21b1('0x6'));var config=require(_0x21b1('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x21b1('0x8')]=function(_0x16ab91,_0x34ed01){return _0x16ab91[_0x21b1('0x9')](_0x21b1('0xa'),attributes,{'tableName':_0x21b1('0xb'),'paranoid':![],'indexes':[{'name':_0x21b1('0xc'),'fields':[_0x21b1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc459=['api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xaa0be9,_0x4506b4){var _0x4e0a8b=function(_0x150b48){while(--_0x150b48){_0xaa0be9['push'](_0xaa0be9['shift']());}};_0x4e0a8b(++_0x4506b4);}(_0xc459,0xfc));var _0x9c45=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc459[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9c45('0x0'));var util=require(_0x9c45('0x1'));var logger=require(_0x9c45('0x2'))(_0x9c45('0x3'));var moment=require(_0x9c45('0x4'));var BPromise=require(_0x9c45('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c45('0x6'));var rimraf=require(_0x9c45('0x7'));var config=require(_0x9c45('0x8'));var attributes=require(_0x9c45('0x9'));module[_0x9c45('0xa')]=function(_0x506cb4,_0x482b5d){return _0x506cb4[_0x9c45('0xb')](_0x9c45('0xc'),attributes,{'tableName':_0x9c45('0xd'),'paranoid':![],'indexes':[{'name':_0x9c45('0xe'),'fields':[_0x9c45('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d219ea8..0615d24 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 _0xae1c=['message','info','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xae1c,0xff));var _0xcae1=function(_0x2e1474,_0x1dd6bd){_0x2e1474=_0x2e1474-0x0;var _0x3d8136=_0xae1c[_0x2e1474];return _0x3d8136;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcae1('0x0'));var fs=require('fs');var Redis=require(_0xcae1('0x1'));var db=require(_0xcae1('0x2'))['db'];var utils=require(_0xcae1('0x3'));var logger=require(_0xcae1('0x4'))(_0xcae1('0x5'));var config=require(_0xcae1('0x6'));var jayson=require(_0xcae1('0x7'));var client=jayson[_0xcae1('0x8')][_0xcae1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c35c7,_0x38099e,_0x7a27b8){return new BPromise(function(_0x50d451,_0x4e419d){return client[_0xcae1('0xa')](_0x3c35c7,_0x7a27b8)[_0xcae1('0xb')](function(_0x3284aa){logger['info'](_0xcae1('0xc'),_0x38099e,_0xcae1('0xd'));logger[_0xcae1('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x38099e,_0xcae1('0xd'),JSON[_0xcae1('0xf')](_0x3284aa));if(_0x3284aa['error']){if(_0x3284aa['error'][_0xcae1('0x10')]===0x1f4){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x4e419d(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x50d451(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}else{logger[_0xcae1('0x13')](_0xcae1('0xc'),_0x38099e,'request\x20sent');_0x50d451(_0x3284aa[_0xcae1('0x14')][_0xcae1('0x12')]);}})['catch'](function(_0x4a7ef7){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x4a7ef7);_0x4e419d(_0x4a7ef7);});});} \ No newline at end of file +var _0x9c50=['message','catch','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0x9c50,0xec));var _0x09c5=function(_0x1c60f1,_0xd50136){_0x1c60f1=_0x1c60f1-0x0;var _0x4090c3=_0x9c50[_0x1c60f1];return _0x4090c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x09c5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09c5('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x09c5('0x2'))(_0x09c5('0x3'));var config=require('../../config/environment');var jayson=require(_0x09c5('0x4'));var client=jayson['client'][_0x09c5('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2830e5,_0x1f068b,_0x51ff47){return new BPromise(function(_0x27d297,_0x2ca015){return client[_0x09c5('0x6')](_0x2830e5,_0x51ff47)[_0x09c5('0x7')](function(_0x4a8703){logger[_0x09c5('0x8')]('SmsTransferReport,\x20%s,\x20%s',_0x1f068b,'request\x20sent');logger[_0x09c5('0x9')](_0x09c5('0xa'),_0x1f068b,_0x09c5('0xb'),JSON[_0x09c5('0xc')](_0x4a8703));if(_0x4a8703['error']){if(_0x4a8703[_0x09c5('0xd')][_0x09c5('0xe')]===0x1f4){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x2ca015(_0x4a8703['error']['message']);}logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x27d297(_0x4a8703['error']['message']);}else{logger[_0x09c5('0x8')]('SmsTransferReport,\x20%s,\x20%s',_0x1f068b,'request\x20sent');_0x27d297(_0x4a8703['result'][_0x09c5('0x10')]);}})[_0x09c5('0x11')](function(_0x3d160f){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x3d160f);_0x2ca015(_0x3d160f);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3bd48fe..0019268 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 _0xdfb9=['format','%s-%s%s','basename','now','extname','post','single','file','put','update','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','originalname','replace'];(function(_0x1c7f48,_0x255687){var _0x274c31=function(_0x58e252){while(--_0x58e252){_0x1c7f48['push'](_0x1c7f48['shift']());}};_0x274c31(++_0x255687);}(_0xdfb9,0x12d));var _0x9dfb=function(_0x373277,_0x3f916d){_0x373277=_0x373277-0x0;var _0xcd5b33=_0xdfb9[_0x373277];return _0xcd5b33;};'use strict';var multer=require(_0x9dfb('0x0'));var util=require(_0x9dfb('0x1'));var path=require(_0x9dfb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9dfb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9dfb('0x4'));var interaction=require(_0x9dfb('0x5'));var config=require(_0x9dfb('0x6'));var controller=require(_0x9dfb('0x7'));router[_0x9dfb('0x8')]('/',auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xa')]);router[_0x9dfb('0x8')](_0x9dfb('0xb'),auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xc')]);router['get'](_0x9dfb('0xd'),auth[_0x9dfb('0x9')](),controller[_0x9dfb('0xe')]);var upload=multer({'storage':multer[_0x9dfb('0xf')]({'destination':function(_0x6350bc,_0x47043d,_0x447c5e){_0x447c5e(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0x1edb7d,_0x446b6f,_0x5a4ccc){_0x446b6f[_0x9dfb('0x10')]=_0x446b6f[_0x9dfb('0x10')][_0x9dfb('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a4ccc(null,util[_0x9dfb('0x12')](_0x9dfb('0x13'),path[_0x9dfb('0x14')](_0x446b6f['originalname'],path['extname'](_0x446b6f[_0x9dfb('0x10')])),Date[_0x9dfb('0x15')](),path[_0x9dfb('0x16')](_0x446b6f[_0x9dfb('0x10')])));}})});router[_0x9dfb('0x17')]('/',upload[_0x9dfb('0x18')](_0x9dfb('0x19')),controller['create']);router[_0x9dfb('0x1a')](_0x9dfb('0xb'),auth['isAuthenticated'](),controller[_0x9dfb('0x1b')]);router[_0x9dfb('0x1c')](_0x9dfb('0xb'),auth[_0x9dfb('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xe8fa=['download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','post','single','file','create','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x4c60e6,_0x587d1e){var _0x25c447=function(_0x93e667){while(--_0x93e667){_0x4c60e6['push'](_0x4c60e6['shift']());}};_0x25c447(++_0x587d1e);}(_0xe8fa,0x1b3));var _0xae8f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xe8fa[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0xae8f('0x0'));var util=require(_0xae8f('0x1'));var path=require('path');var timeout=require(_0xae8f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xae8f('0x3'));var auth=require(_0xae8f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xae8f('0x5'));var controller=require(_0xae8f('0x6'));router[_0xae8f('0x7')]('/',auth[_0xae8f('0x8')](),controller[_0xae8f('0x9')]);router['get'](_0xae8f('0xa'),auth[_0xae8f('0x8')](),controller[_0xae8f('0xb')]);router[_0xae8f('0x7')](_0xae8f('0xc'),auth[_0xae8f('0x8')](),controller[_0xae8f('0xd')]);var upload=multer({'storage':multer[_0xae8f('0xe')]({'destination':function(_0x9c48cf,_0x426711,_0x394691){_0x394691(null,path[_0xae8f('0xf')](config['root'],_0xae8f('0x10')));},'filename':function(_0x5692fc,_0x4cec67,_0x2bd61a){_0x4cec67[_0xae8f('0x11')]=_0x4cec67[_0xae8f('0x11')][_0xae8f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2bd61a(null,util[_0xae8f('0x13')](_0xae8f('0x14'),path['basename'](_0x4cec67[_0xae8f('0x11')],path[_0xae8f('0x15')](_0x4cec67[_0xae8f('0x11')])),Date['now'](),path['extname'](_0x4cec67[_0xae8f('0x11')])));}})});router[_0xae8f('0x16')]('/',upload[_0xae8f('0x17')](_0xae8f('0x18')),controller[_0xae8f('0x19')]);router['put']('/:id',auth[_0xae8f('0x8')](),controller['update']);router[_0xae8f('0x1a')](_0xae8f('0xa'),auth['isAuthenticated'](),controller[_0xae8f('0x1a')]);module[_0xae8f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6ff652d..f5404d0 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 _0x26a4=['STRING','name','FLOAT','INTEGER','BIGINT','exports'];(function(_0x2c3fb3,_0x2ed960){var _0x336b5f=function(_0x2734cb){while(--_0x2734cb){_0x2c3fb3['push'](_0x2c3fb3['shift']());}};_0x336b5f(++_0x2ed960);}(_0x26a4,0x119));var _0x426a=function(_0x32df0c,_0x5e8e0c){_0x32df0c=_0x32df0c-0x0;var _0x495c7f=_0x26a4[_0x32df0c];return _0x495c7f;};'use strict';var Sequelize=require('sequelize');module[_0x426a('0x0')]={'name':{'type':Sequelize[_0x426a('0x1')],'unique':_0x426a('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x426a('0x1')]},'display_name':{'type':Sequelize[_0x426a('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x426a('0x1')]},'original_format':{'type':Sequelize[_0x426a('0x1')]},'original_duration':{'type':Sequelize[_0x426a('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x426a('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x426a('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x426a('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x426a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x426a('0x4')]},'converted_bitRate':{'type':Sequelize[_0x426a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x426a('0x4')]}}; \ No newline at end of file +var _0x1ce1=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x14e8d0,_0x417b2d){var _0x2cfd86=function(_0x161aec){while(--_0x161aec){_0x14e8d0['push'](_0x14e8d0['shift']());}};_0x2cfd86(++_0x417b2d);}(_0x1ce1,0x105));var _0x11ce=function(_0x11df63,_0xe08511){_0x11df63=_0x11df63-0x0;var _0x2933d3=_0x1ce1[_0x11df63];return _0x2933d3;};'use strict';var Sequelize=require(_0x11ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x11ce('0x1')],'unique':_0x11ce('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x11ce('0x1')]},'display_name':{'type':Sequelize[_0x11ce('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x11ce('0x1')]},'original_format':{'type':Sequelize[_0x11ce('0x1')]},'original_duration':{'type':Sequelize[_0x11ce('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x11ce('0x4')]},'original_bitRate':{'type':Sequelize[_0x11ce('0x5')]},'original_sampleRate':{'type':Sequelize[_0x11ce('0x4')]},'converted_format':{'type':Sequelize[_0x11ce('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x11ce('0x5')]},'converted_channelCount':{'type':Sequelize[_0x11ce('0x4')]},'converted_bitRate':{'type':Sequelize[_0x11ce('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x11ce('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 810e154..df1b2fe 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 _0x4cbd=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','then','get','Sounds','UserProfileResource','destroy','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','download','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','join','%s.%s','catch','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','format','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','start','update','description','delete','root','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5d5a70,_0x3ca3df){var _0x2959a6=function(_0x118b23){while(--_0x118b23){_0x5d5a70['push'](_0x5d5a70['shift']());}};_0x2959a6(++_0x3ca3df);}(_0x4cbd,0x1f1));var _0xd4cb=function(_0x3cda26,_0x31a42a){_0x3cda26=_0x3cda26-0x0;var _0x45469f=_0x4cbd[_0x3cda26];return _0x45469f;};'use strict';var emlformat=require(_0xd4cb('0x0'));var rimraf=require(_0xd4cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cb('0x2'));var rp=require(_0xd4cb('0x3'));var moment=require(_0xd4cb('0x4'));var BPromise=require(_0xd4cb('0x5'));var Mustache=require(_0xd4cb('0x6'));var util=require(_0xd4cb('0x7'));var path=require(_0xd4cb('0x8'));var sox=require(_0xd4cb('0x9'));var csv=require(_0xd4cb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4cb('0xb'));var _=require(_0xd4cb('0xc'));var squel=require(_0xd4cb('0xd'));var crypto=require(_0xd4cb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd4cb('0xf'));var toCsv=require(_0xd4cb('0xa'));var querystring=require('querystring');var Papa=require(_0xd4cb('0x10'));var Redis=require(_0xd4cb('0x11'));var authService=require(_0xd4cb('0x12'));var qs=require(_0xd4cb('0x13'));var as=require(_0xd4cb('0x14'));var hardwareService=require(_0xd4cb('0x15'));var logger=require(_0xd4cb('0x16'))(_0xd4cb('0x17'));var utils=require('../../config/utils');var config=require(_0xd4cb('0x18'));var licenseUtil=require(_0xd4cb('0x19'));var db=require(_0xd4cb('0x1a'))['db'];function respondWithStatusCode(_0x3bf312,_0x314fac){_0x314fac=_0x314fac||0xcc;return function(_0x39c61f){if(_0x39c61f){return _0x3bf312[_0xd4cb('0x1b')](_0x314fac);}return _0x3bf312[_0xd4cb('0x1c')](_0x314fac)[_0xd4cb('0x1d')]();};}function respondWithResult(_0x24989b,_0x4bb11f){_0x4bb11f=_0x4bb11f||0xc8;return function(_0x536a7f){if(_0x536a7f){return _0x24989b['status'](_0x4bb11f)[_0xd4cb('0x1e')](_0x536a7f);}};}function respondWithFilteredResult(_0x5a1f84,_0x5ce013){return function(_0x2a2115){if(_0x2a2115){var _0x41694d=typeof _0x5ce013[_0xd4cb('0x1f')]===_0xd4cb('0x20')&&typeof _0x5ce013[_0xd4cb('0x21')]===_0xd4cb('0x20');var _0x2c4850=_0x2a2115['count'];var _0x70977=_0x41694d?0x0:_0x5ce013['offset'];var _0x5a25ee=_0x41694d?_0x2a2115['count']:_0x5ce013[_0xd4cb('0x1f')]+_0x5ce013[_0xd4cb('0x21')];var _0x49e81a;if(_0x5a25ee>=_0x2c4850){_0x5a25ee=_0x2c4850;_0x49e81a=0xc8;}else{_0x49e81a=0xce;}_0x5a1f84['status'](_0x49e81a);return _0x5a1f84[_0xd4cb('0x22')]('Content-Range',_0x70977+'-'+_0x5a25ee+'/'+_0x2c4850)[_0xd4cb('0x1e')](_0x2a2115);}return null;};}function patchUpdates(_0x19d8d7){return function(_0x46ca80){try{jsonpatch[_0xd4cb('0x23')](_0x46ca80,_0x19d8d7,!![]);}catch(_0x31f182){return BPromise[_0xd4cb('0x24')](_0x31f182);}return _0x46ca80[_0xd4cb('0x25')]();};}function saveUpdates(_0x39667c,_0x239ac1){return function(_0x543538){if(_0x543538){return _0x543538['update'](_0x39667c)[_0xd4cb('0x26')](function(_0x54adf2){return _0x54adf2;});}return null;};}function removeEntity(_0x3e9a1e,_0x468be9){return function(_0xd1fe2d){if(_0xd1fe2d){return _0xd1fe2d['destroy']()['then'](function(){var _0x22068f=_0xd1fe2d[_0xd4cb('0x27')]({'plain':!![]});var _0xc1f9a8=_0xd4cb('0x28');return db[_0xd4cb('0x29')][_0xd4cb('0x2a')]({'where':{'type':_0xc1f9a8,'resourceId':_0x22068f['id']}})[_0xd4cb('0x26')](function(){return _0xd1fe2d;});})['then'](function(){_0x3e9a1e[_0xd4cb('0x1c')](0xcc)[_0xd4cb('0x1d')]();});}};}function handleEntityNotFound(_0x1b2417,_0x2e4789){return function(_0x59f0c6){if(!_0x59f0c6){_0x1b2417[_0xd4cb('0x1b')](0x194);}return _0x59f0c6;};}function handleError(_0x417c2d,_0x3613fb){_0x3613fb=_0x3613fb||0x1f4;return function(_0x4d05c5){logger[_0xd4cb('0x2b')](_0x4d05c5['stack']);if(_0x4d05c5[_0xd4cb('0x2c')]){delete _0x4d05c5[_0xd4cb('0x2c')];}_0x417c2d[_0xd4cb('0x1c')](_0x3613fb)[_0xd4cb('0x2d')](_0x4d05c5);};}exports[_0xd4cb('0x2e')]=function(_0x5eec6c,_0x2315f5){var _0x2c6269={},_0x3b980c={},_0x479db8={'count':0x0,'rows':[]};var _0x1b9e49=_[_0xd4cb('0x2f')](db[_0xd4cb('0x30')][_0xd4cb('0x31')],function(_0x10d06e){return{'name':_0x10d06e[_0xd4cb('0x32')],'type':_0x10d06e[_0xd4cb('0x33')][_0xd4cb('0x34')]};});_0x3b980c[_0xd4cb('0x35')]=_[_0xd4cb('0x2f')](_0x1b9e49,_0xd4cb('0x2c'));_0x3b980c[_0xd4cb('0x36')]=_[_0xd4cb('0x37')](_0x5eec6c[_0xd4cb('0x36')]);_0x3b980c[_0xd4cb('0x38')]=_[_0xd4cb('0x39')](_0x3b980c[_0xd4cb('0x35')],_0x3b980c[_0xd4cb('0x36')]);_0x2c6269['attributes']=_['intersection'](_0x3b980c[_0xd4cb('0x35')],qs[_0xd4cb('0x3a')](_0x5eec6c['query'][_0xd4cb('0x3a')]));_0x2c6269[_0xd4cb('0x3b')]=_0x2c6269['attributes'][_0xd4cb('0x3c')]?_0x2c6269['attributes']:_0x3b980c[_0xd4cb('0x35')];if(!_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x3d')]('nolimit')){_0x2c6269[_0xd4cb('0x21')]=qs[_0xd4cb('0x21')](_0x5eec6c['query']['limit']);_0x2c6269[_0xd4cb('0x1f')]=qs['offset'](_0x5eec6c['query'][_0xd4cb('0x1f')]);}_0x2c6269[_0xd4cb('0x3e')]=qs[_0xd4cb('0x3f')](_0x5eec6c[_0xd4cb('0x36')]['sort']);_0x2c6269[_0xd4cb('0x40')]=qs['filters'](_[_0xd4cb('0x41')](_0x5eec6c[_0xd4cb('0x36')],_0x3b980c[_0xd4cb('0x38')]),_0x1b9e49);if(_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x42')]){_0x2c6269[_0xd4cb('0x40')]=_[_0xd4cb('0x43')](_0x2c6269['where'],{'$or':_[_0xd4cb('0x2f')](_0x1b9e49,function(_0x1c01f7){if(_0x1c01f7[_0xd4cb('0x33')]!==_0xd4cb('0x44')){var _0x457170={};_0x457170[_0x1c01f7[_0xd4cb('0x2c')]]={'$like':'%'+_0x5eec6c['query'][_0xd4cb('0x42')]+'%'};return _0x457170;}})});}_0x2c6269=_[_0xd4cb('0x43')]({},_0x2c6269,_0x5eec6c[_0xd4cb('0x45')]);var _0xe6f6d8={'where':_0x2c6269[_0xd4cb('0x40')]};return db[_0xd4cb('0x30')][_0xd4cb('0x46')](_0xe6f6d8)[_0xd4cb('0x26')](function(_0x567e7e){_0x479db8[_0xd4cb('0x46')]=_0x567e7e;if(_0x5eec6c[_0xd4cb('0x36')][_0xd4cb('0x47')]){_0x2c6269[_0xd4cb('0x48')]=[{'all':!![]}];}return db['Sound'][_0xd4cb('0x49')](_0x2c6269);})[_0xd4cb('0x26')](function(_0x4d0841){_0x479db8[_0xd4cb('0x4a')]=_0x4d0841;return _0x479db8;})['then'](respondWithFilteredResult(_0x2315f5,_0x2c6269))['catch'](handleError(_0x2315f5,null));};exports[_0xd4cb('0x4b')]=function(_0x1bfb7b,_0x199120){var _0x413740={'raw':!![],'where':{'id':_0x1bfb7b[_0xd4cb('0x4c')]['id']}},_0x5adab4={};_0x5adab4['model']=_[_0xd4cb('0x37')](db['Sound']['rawAttributes']);_0x5adab4[_0xd4cb('0x36')]=_[_0xd4cb('0x37')](_0x1bfb7b[_0xd4cb('0x36')]);_0x5adab4[_0xd4cb('0x38')]=_[_0xd4cb('0x39')](_0x5adab4[_0xd4cb('0x35')],_0x5adab4[_0xd4cb('0x36')]);_0x413740[_0xd4cb('0x3b')]=_['intersection'](_0x5adab4['model'],qs[_0xd4cb('0x3a')](_0x1bfb7b[_0xd4cb('0x36')][_0xd4cb('0x3a')]));_0x413740['attributes']=_0x413740[_0xd4cb('0x3b')][_0xd4cb('0x3c')]?_0x413740[_0xd4cb('0x3b')]:_0x5adab4[_0xd4cb('0x35')];if(_0x1bfb7b[_0xd4cb('0x36')][_0xd4cb('0x47')]){_0x413740[_0xd4cb('0x48')]=[{'all':!![]}];}_0x413740=_[_0xd4cb('0x43')]({},_0x413740,_0x1bfb7b[_0xd4cb('0x45')]);return db[_0xd4cb('0x30')][_0xd4cb('0x4d')](_0x413740)[_0xd4cb('0x26')](handleEntityNotFound(_0x199120,null))[_0xd4cb('0x26')](respondWithResult(_0x199120,null))['catch'](handleError(_0x199120,null));};exports[_0xd4cb('0x4e')]=function(_0x1b6b8f,_0x23f838,_0x34edff){return db[_0xd4cb('0x30')]['find']({'where':{'id':_0x1b6b8f[_0xd4cb('0x4c')]['id']},'attributes':[_0xd4cb('0x2c'),_0xd4cb('0x4f'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x23f838,null))[_0xd4cb('0x26')](function(_0x5e762f){if(_0x5e762f){if(!fs[_0xd4cb('0x50')](path['join'](config['root'],_0xd4cb('0x51'),_0x5e762f[_0xd4cb('0x4f')]+'.'+_0x5e762f[_0xd4cb('0x52')]))){throw new db[(_0xd4cb('0x53'))][(_0xd4cb('0x54'))]('Sound\x20not\x20found');}return _0x23f838[_0xd4cb('0x4e')](path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x51'),util['format'](_0xd4cb('0x56'),_0x5e762f[_0xd4cb('0x4f')],_0x5e762f['converted_format'])),util['format'](_0xd4cb('0x56'),_0x5e762f[_0xd4cb('0x2c')],_0x5e762f['converted_format']));}return null;})[_0xd4cb('0x57')](handleError(_0x23f838,null));};exports[_0xd4cb('0x58')]=function(_0x2d0fe8,_0x29f240,_0x4d7db0){var _0x3298fe={'name':path[_0xd4cb('0x59')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')])),'save_name':path[_0xd4cb('0x59')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')])),'original_format':path['extname'](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5b')])[_0xd4cb('0x5e')](0x1),'converted_format':_0xd4cb('0x5f')};var _0x1c8df6=path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x60'),_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')]);var _0x8c0e86=path[_0xd4cb('0x55')](config['root'],_0xd4cb('0x51'),util[_0xd4cb('0x61')](_0xd4cb('0x56'),path[_0xd4cb('0x59')](_0x2d0fe8['file'][_0xd4cb('0x5d')],path[_0xd4cb('0x5c')](_0x2d0fe8[_0xd4cb('0x5a')][_0xd4cb('0x5d')])),_0x3298fe['converted_format']));logger[_0xd4cb('0x62')](_0xd4cb('0x63'),_0x1c8df6);logger[_0xd4cb('0x62')]('Sound\x20upload\x20destination:\x20%s',_0x8c0e86);try{fs['chmodSync'](_0x1c8df6,parseInt(_0xd4cb('0x64'),0x8));var _0x1d2dfc=sox[_0xd4cb('0x65')](_0x1c8df6,_0x8c0e86,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1d2dfc['on'](_0xd4cb('0x2b'),function(_0x29c8d4){fs[_0xd4cb('0x66')](_0x1c8df6);_0x29f240[_0xd4cb('0x1c')](0x1f4)[_0xd4cb('0x2d')](_0x29c8d4);});_0x1d2dfc['on'](_0xd4cb('0x67'),function(_0x583793){_0x3298fe[_0xd4cb('0x68')]=isNaN(_0x583793['duration'])?null:_0x583793[_0xd4cb('0x69')]*0x3e8;_0x3298fe[_0xd4cb('0x6a')]=isNaN(_0x583793[_0xd4cb('0x6b')])?null:_0x583793[_0xd4cb('0x6b')];_0x3298fe[_0xd4cb('0x6c')]=isNaN(_0x583793[_0xd4cb('0x6d')])?null:_0x583793[_0xd4cb('0x6d')];_0x3298fe[_0xd4cb('0x6e')]=isNaN(_0x583793[_0xd4cb('0x6f')])?null:_0x583793['bitRate'];_0x3298fe[_0xd4cb('0x70')]=isNaN(_0x583793[_0xd4cb('0x71')])?null:_0x583793[_0xd4cb('0x71')];});_0x1d2dfc['on']('dest',function(_0x5bfd60){_0x3298fe['converted_duration']=isNaN(_0x5bfd60[_0xd4cb('0x69')])?null:_0x5bfd60[_0xd4cb('0x69')]*0x3e8;_0x3298fe[_0xd4cb('0x72')]=isNaN(_0x5bfd60[_0xd4cb('0x6b')])?null:_0x5bfd60[_0xd4cb('0x6b')];_0x3298fe[_0xd4cb('0x73')]=isNaN(_0x5bfd60[_0xd4cb('0x6d')])?null:_0x5bfd60[_0xd4cb('0x6d')];_0x3298fe[_0xd4cb('0x74')]=isNaN(_0x5bfd60[_0xd4cb('0x6f')])?null:_0x5bfd60[_0xd4cb('0x6f')];_0x3298fe['converted_sampleRate']=isNaN(_0x5bfd60[_0xd4cb('0x71')])?null:_0x5bfd60['sampleRate'];});_0x1d2dfc['on'](_0xd4cb('0x1d'),function(){fs[_0xd4cb('0x75')](_0x8c0e86,parseInt('0777',0x8));return db[_0xd4cb('0x30')][_0xd4cb('0x58')](_0x3298fe)[_0xd4cb('0x26')](function(_0x53470a){var _0x3e6812={'role':_0x2d0fe8[_0xd4cb('0x76')][_0xd4cb('0x77')],'userProfileId':_0x2d0fe8[_0xd4cb('0x76')]['userProfileId']};if(!_0x3e6812)throw new Error(_0xd4cb('0x78'));if(_0x3e6812[_0xd4cb('0x77')]===_0xd4cb('0x79')){var _0x56c424=_0x53470a['get']({'plain':!![]});return db[_0xd4cb('0x7a')][_0xd4cb('0x4d')]({'where':{'name':'Sounds','userProfileId':_0x3e6812[_0xd4cb('0x7b')]},'raw':!![]})[_0xd4cb('0x26')](function(_0x1d5872){if(_0x1d5872&&_0x1d5872[_0xd4cb('0x7c')]===0x0){return db[_0xd4cb('0x29')][_0xd4cb('0x58')]({'name':_0x56c424[_0xd4cb('0x2c')],'resourceId':_0x56c424['id'],'type':_0x1d5872[_0xd4cb('0x2c')],'sectionId':_0x1d5872['id']},{})[_0xd4cb('0x26')](function(){return _0x53470a;});}else{return _0x53470a;}})['catch'](function(_0x18f167){logger[_0xd4cb('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18f167);throw _0x18f167;});}return _0x53470a;})[_0xd4cb('0x26')](respondWithResult(_0x29f240,null))[_0xd4cb('0x57')](handleError(_0x29f240,null));});_0x1d2dfc[_0xd4cb('0x7d')]();}catch(_0x4cb8c9){_0x29f240[_0xd4cb('0x1c')](0x1f4)[_0xd4cb('0x2d')](_0x4cb8c9);}};exports[_0xd4cb('0x7e')]=function(_0xed1cd1,_0x548a08,_0x31e887){return db[_0xd4cb('0x30')][_0xd4cb('0x4d')]({'where':{'id':_0xed1cd1['params']['id']}})['then'](handleEntityNotFound(_0x548a08,null))[_0xd4cb('0x26')](saveUpdates(_[_0xd4cb('0x41')](_0xed1cd1[_0xd4cb('0x76')],[_0xd4cb('0x2c'),_0xd4cb('0x7f')]),null))[_0xd4cb('0x26')](respondWithResult(_0x548a08,null))[_0xd4cb('0x57')](handleError(_0x548a08,null));};exports[_0xd4cb('0x80')]=function(_0x127ed0,_0x26c747,_0x9dab20){return db[_0xd4cb('0x30')][_0xd4cb('0x4d')]({'where':{'id':_0x127ed0[_0xd4cb('0x4c')]['id']}})[_0xd4cb('0x26')](function(_0xa3372d){if(_0xa3372d){return _0xa3372d[_0xd4cb('0x2a')]();}})['then'](function(_0x1b4b2a){var _0x568afc=path[_0xd4cb('0x55')](config[_0xd4cb('0x81')],_0xd4cb('0x60'),util[_0xd4cb('0x61')](_0xd4cb('0x56'),_0x1b4b2a[_0xd4cb('0x4f')],_0x1b4b2a['original_format']));var _0x53ddde=path[_0xd4cb('0x55')](config['root'],'server/files/sounds/converted',util[_0xd4cb('0x61')](_0xd4cb('0x56'),_0x1b4b2a[_0xd4cb('0x4f')],_0x1b4b2a[_0xd4cb('0x52')]));fs[_0xd4cb('0x66')](_0x568afc);fs[_0xd4cb('0x66')](_0x53ddde);return _0x1b4b2a;})[_0xd4cb('0x26')](function(_0x49b5cf){if(_0x49b5cf){return _0x26c747[_0xd4cb('0x1c')](0xcc)[_0xd4cb('0x1d')]();}})['then'](handleEntityNotFound(_0x26c747,null))[_0xd4cb('0x57')](handleError(_0x26c747,null));}; \ No newline at end of file +var _0x8a9f=['intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','length','find','catch','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','download','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','Sounds','error','send','map','Sound','fieldName','type','key','model','name','keys','query','filters'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x8a9f,0x13e));var _0xf8a9=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x8a9f[_0x3a6922];return _0x9c1b44;};'use strict';var emlformat=require(_0xf8a9('0x0'));var rimraf=require(_0xf8a9('0x1'));var zipdir=require(_0xf8a9('0x2'));var jsonpatch=require(_0xf8a9('0x3'));var rp=require('request-promise');var moment=require(_0xf8a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf8a9('0x5'));var util=require(_0xf8a9('0x6'));var path=require(_0xf8a9('0x7'));var sox=require(_0xf8a9('0x8'));var csv=require('to-csv');var ejs=require(_0xf8a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8a9('0xa'));var squel=require(_0xf8a9('0xb'));var crypto=require(_0xf8a9('0xc'));var jsforce=require(_0xf8a9('0xd'));var deskjs=require(_0xf8a9('0xe'));var toCsv=require(_0xf8a9('0xf'));var querystring=require(_0xf8a9('0x10'));var Papa=require(_0xf8a9('0x11'));var Redis=require(_0xf8a9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf8a9('0x13'));var as=require(_0xf8a9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a9('0x15'))(_0xf8a9('0x16'));var utils=require(_0xf8a9('0x17'));var config=require(_0xf8a9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8a9('0x19'))['db'];function respondWithStatusCode(_0x582866,_0x385b55){_0x385b55=_0x385b55||0xcc;return function(_0x37e1e3){if(_0x37e1e3){return _0x582866[_0xf8a9('0x1a')](_0x385b55);}return _0x582866[_0xf8a9('0x1b')](_0x385b55)[_0xf8a9('0x1c')]();};}function respondWithResult(_0x141651,_0x53f2a5){_0x53f2a5=_0x53f2a5||0xc8;return function(_0x311fd2){if(_0x311fd2){return _0x141651['status'](_0x53f2a5)[_0xf8a9('0x1d')](_0x311fd2);}};}function respondWithFilteredResult(_0x5bae1c,_0x23a793){return function(_0x365bac){if(_0x365bac){var _0x530cb0=typeof _0x23a793[_0xf8a9('0x1e')]==='undefined'&&typeof _0x23a793[_0xf8a9('0x1f')]===_0xf8a9('0x20');var _0x3c0aef=_0x365bac[_0xf8a9('0x21')];var _0xee65b=_0x530cb0?0x0:_0x23a793[_0xf8a9('0x1e')];var _0x489752=_0x530cb0?_0x365bac['count']:_0x23a793[_0xf8a9('0x1e')]+_0x23a793[_0xf8a9('0x1f')];var _0xedb224;if(_0x489752>=_0x3c0aef){_0x489752=_0x3c0aef;_0xedb224=0xc8;}else{_0xedb224=0xce;}_0x5bae1c['status'](_0xedb224);return _0x5bae1c[_0xf8a9('0x22')](_0xf8a9('0x23'),_0xee65b+'-'+_0x489752+'/'+_0x3c0aef)[_0xf8a9('0x1d')](_0x365bac);}return null;};}function patchUpdates(_0xa8008e){return function(_0x18449c){try{jsonpatch['apply'](_0x18449c,_0xa8008e,!![]);}catch(_0x268dd8){return BPromise[_0xf8a9('0x24')](_0x268dd8);}return _0x18449c[_0xf8a9('0x25')]();};}function saveUpdates(_0x2bf2fe,_0x3f6370){return function(_0x4b5019){if(_0x4b5019){return _0x4b5019[_0xf8a9('0x26')](_0x2bf2fe)[_0xf8a9('0x27')](function(_0x27281e){return _0x27281e;});}return null;};}function removeEntity(_0x285085,_0x530902){return function(_0x107301){if(_0x107301){return _0x107301[_0xf8a9('0x28')]()[_0xf8a9('0x27')](function(){var _0x4ae5db=_0x107301['get']({'plain':!![]});var _0x5207e7=_0xf8a9('0x29');return db['UserProfileResource'][_0xf8a9('0x28')]({'where':{'type':_0x5207e7,'resourceId':_0x4ae5db['id']}})[_0xf8a9('0x27')](function(){return _0x107301;});})[_0xf8a9('0x27')](function(){_0x285085[_0xf8a9('0x1b')](0xcc)[_0xf8a9('0x1c')]();});}};}function handleEntityNotFound(_0x1a0145,_0x49f3dd){return function(_0x1d928a){if(!_0x1d928a){_0x1a0145['sendStatus'](0x194);}return _0x1d928a;};}function handleError(_0x35341c,_0x9fe61e){_0x9fe61e=_0x9fe61e||0x1f4;return function(_0x369211){logger[_0xf8a9('0x2a')](_0x369211['stack']);if(_0x369211['name']){delete _0x369211['name'];}_0x35341c[_0xf8a9('0x1b')](_0x9fe61e)[_0xf8a9('0x2b')](_0x369211);};}exports['index']=function(_0xfe0858,_0xed2465){var _0x3d06ad={},_0x15ec14={},_0x4a02e9={'count':0x0,'rows':[]};var _0x3a4f2e=_[_0xf8a9('0x2c')](db[_0xf8a9('0x2d')]['rawAttributes'],function(_0x30aa15){return{'name':_0x30aa15[_0xf8a9('0x2e')],'type':_0x30aa15[_0xf8a9('0x2f')][_0xf8a9('0x30')]};});_0x15ec14[_0xf8a9('0x31')]=_[_0xf8a9('0x2c')](_0x3a4f2e,_0xf8a9('0x32'));_0x15ec14['query']=_[_0xf8a9('0x33')](_0xfe0858[_0xf8a9('0x34')]);_0x15ec14[_0xf8a9('0x35')]=_[_0xf8a9('0x36')](_0x15ec14[_0xf8a9('0x31')],_0x15ec14[_0xf8a9('0x34')]);_0x3d06ad['attributes']=_[_0xf8a9('0x36')](_0x15ec14[_0xf8a9('0x31')],qs[_0xf8a9('0x37')](_0xfe0858['query'][_0xf8a9('0x37')]));_0x3d06ad['attributes']=_0x3d06ad['attributes']['length']?_0x3d06ad[_0xf8a9('0x38')]:_0x15ec14[_0xf8a9('0x31')];if(!_0xfe0858[_0xf8a9('0x34')][_0xf8a9('0x39')]('nolimit')){_0x3d06ad[_0xf8a9('0x1f')]=qs[_0xf8a9('0x1f')](_0xfe0858[_0xf8a9('0x34')][_0xf8a9('0x1f')]);_0x3d06ad[_0xf8a9('0x1e')]=qs[_0xf8a9('0x1e')](_0xfe0858['query'][_0xf8a9('0x1e')]);}_0x3d06ad['order']=qs[_0xf8a9('0x3a')](_0xfe0858[_0xf8a9('0x34')]['sort']);_0x3d06ad['where']=qs[_0xf8a9('0x35')](_[_0xf8a9('0x3b')](_0xfe0858[_0xf8a9('0x34')],_0x15ec14[_0xf8a9('0x35')]),_0x3a4f2e);if(_0xfe0858[_0xf8a9('0x34')][_0xf8a9('0x3c')]){_0x3d06ad[_0xf8a9('0x3d')]=_[_0xf8a9('0x3e')](_0x3d06ad['where'],{'$or':_[_0xf8a9('0x2c')](_0x3a4f2e,function(_0x373dda){if(_0x373dda[_0xf8a9('0x2f')]!==_0xf8a9('0x3f')){var _0x31ab7b={};_0x31ab7b[_0x373dda['name']]={'$like':'%'+_0xfe0858[_0xf8a9('0x34')][_0xf8a9('0x3c')]+'%'};return _0x31ab7b;}})});}_0x3d06ad=_[_0xf8a9('0x3e')]({},_0x3d06ad,_0xfe0858[_0xf8a9('0x40')]);var _0x44a821={'where':_0x3d06ad[_0xf8a9('0x3d')]};return db[_0xf8a9('0x2d')][_0xf8a9('0x21')](_0x44a821)[_0xf8a9('0x27')](function(_0x39f1f0){_0x4a02e9[_0xf8a9('0x21')]=_0x39f1f0;if(_0xfe0858[_0xf8a9('0x34')][_0xf8a9('0x41')]){_0x3d06ad[_0xf8a9('0x42')]=[{'all':!![]}];}return db[_0xf8a9('0x2d')][_0xf8a9('0x43')](_0x3d06ad);})[_0xf8a9('0x27')](function(_0x459723){_0x4a02e9[_0xf8a9('0x44')]=_0x459723;return _0x4a02e9;})[_0xf8a9('0x27')](respondWithFilteredResult(_0xed2465,_0x3d06ad))['catch'](handleError(_0xed2465,null));};exports[_0xf8a9('0x45')]=function(_0x1017c0,_0x183fa8){var _0x100f25={'raw':!![],'where':{'id':_0x1017c0['params']['id']}},_0x164129={};_0x164129[_0xf8a9('0x31')]=_['keys'](db['Sound'][_0xf8a9('0x46')]);_0x164129[_0xf8a9('0x34')]=_[_0xf8a9('0x33')](_0x1017c0[_0xf8a9('0x34')]);_0x164129[_0xf8a9('0x35')]=_[_0xf8a9('0x36')](_0x164129['model'],_0x164129[_0xf8a9('0x34')]);_0x100f25[_0xf8a9('0x38')]=_['intersection'](_0x164129[_0xf8a9('0x31')],qs[_0xf8a9('0x37')](_0x1017c0[_0xf8a9('0x34')][_0xf8a9('0x37')]));_0x100f25['attributes']=_0x100f25['attributes'][_0xf8a9('0x47')]?_0x100f25[_0xf8a9('0x38')]:_0x164129[_0xf8a9('0x31')];if(_0x1017c0[_0xf8a9('0x34')]['includeAll']){_0x100f25[_0xf8a9('0x42')]=[{'all':!![]}];}_0x100f25=_[_0xf8a9('0x3e')]({},_0x100f25,_0x1017c0[_0xf8a9('0x40')]);return db[_0xf8a9('0x2d')][_0xf8a9('0x48')](_0x100f25)[_0xf8a9('0x27')](handleEntityNotFound(_0x183fa8,null))['then'](respondWithResult(_0x183fa8,null))[_0xf8a9('0x49')](handleError(_0x183fa8,null));};exports['download']=function(_0x4cd3b5,_0x275fa0,_0x3b6738){return db[_0xf8a9('0x2d')]['find']({'where':{'id':_0x4cd3b5[_0xf8a9('0x4a')]['id']},'attributes':[_0xf8a9('0x32'),_0xf8a9('0x4b'),_0xf8a9('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x275fa0,null))[_0xf8a9('0x27')](function(_0x5165cf){if(_0x5165cf){if(!fs[_0xf8a9('0x4d')](path[_0xf8a9('0x4e')](config[_0xf8a9('0x4f')],_0xf8a9('0x50'),_0x5165cf[_0xf8a9('0x4b')]+'.'+_0x5165cf[_0xf8a9('0x4c')]))){throw new db[(_0xf8a9('0x51'))]['ValidationError']('Sound\x20not\x20found');}return _0x275fa0[_0xf8a9('0x52')](path['join'](config[_0xf8a9('0x4f')],'server/files/sounds/converted',util[_0xf8a9('0x53')](_0xf8a9('0x54'),_0x5165cf[_0xf8a9('0x4b')],_0x5165cf['converted_format'])),util[_0xf8a9('0x53')](_0xf8a9('0x54'),_0x5165cf[_0xf8a9('0x32')],_0x5165cf['converted_format']));}return null;})[_0xf8a9('0x49')](handleError(_0x275fa0,null));};exports[_0xf8a9('0x55')]=function(_0x1b1ce9,_0xa01731,_0x380172){var _0x228333={'name':path[_0xf8a9('0x56')](_0x1b1ce9[_0xf8a9('0x57')]['originalname'],path[_0xf8a9('0x58')](_0x1b1ce9[_0xf8a9('0x57')][_0xf8a9('0x59')])),'save_name':path[_0xf8a9('0x56')](_0x1b1ce9['file'][_0xf8a9('0x5a')],path[_0xf8a9('0x58')](_0x1b1ce9[_0xf8a9('0x57')][_0xf8a9('0x5a')])),'original_format':path[_0xf8a9('0x58')](_0x1b1ce9['file'][_0xf8a9('0x59')])[_0xf8a9('0x5b')](0x1),'converted_format':_0xf8a9('0x5c')};var _0x6228c1=path['join'](config['root'],_0xf8a9('0x5d'),_0x1b1ce9['file'][_0xf8a9('0x5a')]);var _0x625ab4=path[_0xf8a9('0x4e')](config[_0xf8a9('0x4f')],_0xf8a9('0x50'),util[_0xf8a9('0x53')](_0xf8a9('0x54'),path[_0xf8a9('0x56')](_0x1b1ce9[_0xf8a9('0x57')][_0xf8a9('0x5a')],path[_0xf8a9('0x58')](_0x1b1ce9[_0xf8a9('0x57')][_0xf8a9('0x5a')])),_0x228333['converted_format']));logger[_0xf8a9('0x5e')](_0xf8a9('0x5f'),_0x6228c1);logger[_0xf8a9('0x5e')]('Sound\x20upload\x20destination:\x20%s',_0x625ab4);try{fs[_0xf8a9('0x60')](_0x6228c1,parseInt(_0xf8a9('0x61'),0x8));var _0x56e7a4=sox[_0xf8a9('0x62')](_0x6228c1,_0x625ab4,{'sampleRate':0x1f40,'format':_0xf8a9('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56e7a4['on']('error',function(_0x1f6d5e){fs[_0xf8a9('0x63')](_0x6228c1);_0xa01731[_0xf8a9('0x1b')](0x1f4)[_0xf8a9('0x2b')](_0x1f6d5e);});_0x56e7a4['on'](_0xf8a9('0x64'),function(_0x35c8f5){_0x228333[_0xf8a9('0x65')]=isNaN(_0x35c8f5[_0xf8a9('0x66')])?null:_0x35c8f5[_0xf8a9('0x66')]*0x3e8;_0x228333['original_sampleCount']=isNaN(_0x35c8f5[_0xf8a9('0x67')])?null:_0x35c8f5[_0xf8a9('0x67')];_0x228333['original_channelCount']=isNaN(_0x35c8f5[_0xf8a9('0x68')])?null:_0x35c8f5['channelCount'];_0x228333['original_bitRate']=isNaN(_0x35c8f5[_0xf8a9('0x69')])?null:_0x35c8f5[_0xf8a9('0x69')];_0x228333[_0xf8a9('0x6a')]=isNaN(_0x35c8f5[_0xf8a9('0x6b')])?null:_0x35c8f5['sampleRate'];});_0x56e7a4['on'](_0xf8a9('0x6c'),function(_0x37e7fc){_0x228333[_0xf8a9('0x6d')]=isNaN(_0x37e7fc[_0xf8a9('0x66')])?null:_0x37e7fc[_0xf8a9('0x66')]*0x3e8;_0x228333[_0xf8a9('0x6e')]=isNaN(_0x37e7fc[_0xf8a9('0x67')])?null:_0x37e7fc[_0xf8a9('0x67')];_0x228333[_0xf8a9('0x6f')]=isNaN(_0x37e7fc[_0xf8a9('0x68')])?null:_0x37e7fc[_0xf8a9('0x68')];_0x228333['converted_bitRate']=isNaN(_0x37e7fc['bitRate'])?null:_0x37e7fc[_0xf8a9('0x69')];_0x228333[_0xf8a9('0x70')]=isNaN(_0x37e7fc[_0xf8a9('0x6b')])?null:_0x37e7fc[_0xf8a9('0x6b')];});_0x56e7a4['on'](_0xf8a9('0x1c'),function(){fs[_0xf8a9('0x60')](_0x625ab4,parseInt('0777',0x8));return db['Sound'][_0xf8a9('0x55')](_0x228333)[_0xf8a9('0x27')](function(_0x471c8f){var _0x1f0e98={'role':_0x1b1ce9[_0xf8a9('0x71')]['role'],'userProfileId':_0x1b1ce9['body']['userProfileId']};if(!_0x1f0e98)throw new Error(_0xf8a9('0x72'));if(_0x1f0e98['role']===_0xf8a9('0x73')){var _0x3ca4d2=_0x471c8f[_0xf8a9('0x74')]({'plain':!![]});return db['UserProfileSection'][_0xf8a9('0x48')]({'where':{'name':'Sounds','userProfileId':_0x1f0e98[_0xf8a9('0x75')]},'raw':!![]})[_0xf8a9('0x27')](function(_0x19f283){if(_0x19f283&&_0x19f283[_0xf8a9('0x76')]===0x0){return db[_0xf8a9('0x77')][_0xf8a9('0x55')]({'name':_0x3ca4d2['name'],'resourceId':_0x3ca4d2['id'],'type':_0x19f283[_0xf8a9('0x32')],'sectionId':_0x19f283['id']},{})[_0xf8a9('0x27')](function(){return _0x471c8f;});}else{return _0x471c8f;}})[_0xf8a9('0x49')](function(_0x58d3b7){logger['error'](_0xf8a9('0x78'),_0x58d3b7);throw _0x58d3b7;});}return _0x471c8f;})['then'](respondWithResult(_0xa01731,null))[_0xf8a9('0x49')](handleError(_0xa01731,null));});_0x56e7a4['start']();}catch(_0xd72c83){_0xa01731[_0xf8a9('0x1b')](0x1f4)['send'](_0xd72c83);}};exports[_0xf8a9('0x26')]=function(_0x552646,_0x32a5b2,_0x3f40e5){return db[_0xf8a9('0x2d')][_0xf8a9('0x48')]({'where':{'id':_0x552646[_0xf8a9('0x4a')]['id']}})[_0xf8a9('0x27')](handleEntityNotFound(_0x32a5b2,null))[_0xf8a9('0x27')](saveUpdates(_[_0xf8a9('0x3b')](_0x552646['body'],['name',_0xf8a9('0x79')]),null))['then'](respondWithResult(_0x32a5b2,null))[_0xf8a9('0x49')](handleError(_0x32a5b2,null));};exports[_0xf8a9('0x7a')]=function(_0x27cdf1,_0x4cf83b,_0x1a6336){return db[_0xf8a9('0x2d')][_0xf8a9('0x48')]({'where':{'id':_0x27cdf1[_0xf8a9('0x4a')]['id']}})[_0xf8a9('0x27')](function(_0x15b9f4){if(_0x15b9f4){return _0x15b9f4[_0xf8a9('0x28')]();}})['then'](function(_0x1c537f){var _0x55570f=path[_0xf8a9('0x4e')](config[_0xf8a9('0x4f')],_0xf8a9('0x5d'),util['format'](_0xf8a9('0x54'),_0x1c537f[_0xf8a9('0x4b')],_0x1c537f[_0xf8a9('0x7b')]));var _0x12904e=path[_0xf8a9('0x4e')](config['root'],_0xf8a9('0x50'),util[_0xf8a9('0x53')](_0xf8a9('0x54'),_0x1c537f[_0xf8a9('0x4b')],_0x1c537f[_0xf8a9('0x4c')]));fs[_0xf8a9('0x63')](_0x55570f);fs['unlinkSync'](_0x12904e);return _0x1c537f;})['then'](function(_0x3e070f){if(_0x3e070f){return _0x4cf83b['status'](0xcc)[_0xf8a9('0x1c')]();}})[_0xf8a9('0x27')](handleEntityNotFound(_0x4cf83b,null))[_0xf8a9('0x49')](handleError(_0x4cf83b,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6cf0d57..bea9f2e 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 _0x9313=['path','../../config/environment','./sound.attributes','Sound','tools_sounds','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x9313,0x177));var _0x3931=function(_0x99ea32,_0x385c64){_0x99ea32=_0x99ea32-0x0;var _0x5d8fc6=_0x9313[_0x99ea32];return _0x5d8fc6;};'use strict';var _=require(_0x3931('0x0'));var util=require('util');var logger=require(_0x3931('0x1'))(_0x3931('0x2'));var moment=require('moment');var BPromise=require(_0x3931('0x3'));var rp=require(_0x3931('0x4'));var fs=require('fs');var path=require(_0x3931('0x5'));var rimraf=require('rimraf');var config=require(_0x3931('0x6'));var attributes=require(_0x3931('0x7'));module['exports']=function(_0x309875,_0x10bb45){return _0x309875['define'](_0x3931('0x8'),attributes,{'tableName':_0x3931('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6548=['rimraf','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1482da,_0xc09ec0){var _0x1cd119=function(_0x59d1a7){while(--_0x59d1a7){_0x1482da['push'](_0x1482da['shift']());}};_0x1cd119(++_0xc09ec0);}(_0x6548,0x161));var _0x8654=function(_0x7d0149,_0x1b6d23){_0x7d0149=_0x7d0149-0x0;var _0xaabd78=_0x6548[_0x7d0149];return _0xaabd78;};'use strict';var _=require(_0x8654('0x0'));var util=require(_0x8654('0x1'));var logger=require(_0x8654('0x2'))(_0x8654('0x3'));var moment=require(_0x8654('0x4'));var BPromise=require(_0x8654('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8654('0x6'));var rimraf=require(_0x8654('0x7'));var config=require('../../config/environment');var attributes=require(_0x8654('0x8'));module[_0x8654('0x9')]=function(_0x35618c,_0x31ecfa){return _0x35618c[_0x8654('0xa')](_0x8654('0xb'),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 30f78bc..13f6600 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 _0x70aa=['catch','find','options','raw','attributes','include','map','model','ShowSound','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x265e0e,_0x38b2bb){var _0x518157=function(_0x1e3eab){while(--_0x1e3eab){_0x265e0e['push'](_0x265e0e['shift']());}};_0x518157(++_0x38b2bb);}(_0x70aa,0x19d));var _0xa70a=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x70aa[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0xa70a('0x0'));var moment=require('moment');var BPromise=require(_0xa70a('0x1'));var rs=require(_0xa70a('0x2'));var fs=require('fs');var Redis=require(_0xa70a('0x3'));var db=require(_0xa70a('0x4'))['db'];var utils=require(_0xa70a('0x5'));var logger=require(_0xa70a('0x6'))(_0xa70a('0x7'));var config=require('../../config/environment');var jayson=require(_0xa70a('0x8'));var client=jayson[_0xa70a('0x9')][_0xa70a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fb000,_0x5c61d2,_0x5c3514){return new BPromise(function(_0x4453e,_0x3ee98e){return client[_0xa70a('0xb')](_0x7fb000,_0x5c3514)[_0xa70a('0xc')](function(_0x4692b3){logger[_0xa70a('0xd')](_0xa70a('0xe'),_0x5c61d2,_0xa70a('0xf'));logger[_0xa70a('0x10')](_0xa70a('0x11'),_0x5c61d2,_0xa70a('0xf'),JSON['stringify'](_0x4692b3));if(_0x4692b3['error']){if(_0x4692b3[_0xa70a('0x12')]['code']===0x1f4){logger[_0xa70a('0x12')](_0xa70a('0xe'),_0x5c61d2,_0x4692b3['error'][_0xa70a('0x13')]);return _0x3ee98e(_0x4692b3[_0xa70a('0x12')]['message']);}logger[_0xa70a('0x12')]('Sound,\x20%s,\x20%s',_0x5c61d2,_0x4692b3[_0xa70a('0x12')][_0xa70a('0x13')]);return _0x4453e(_0x4692b3['error'][_0xa70a('0x13')]);}else{logger[_0xa70a('0xd')]('Sound,\x20%s,\x20%s',_0x5c61d2,_0xa70a('0xf'));_0x4453e(_0x4692b3[_0xa70a('0x14')][_0xa70a('0x13')]);}})[_0xa70a('0x15')](function(_0x3d95e9){logger[_0xa70a('0x12')](_0xa70a('0xe'),_0x5c61d2,_0x3d95e9);_0x3ee98e(_0x3d95e9);});});}exports['ShowSound']=function(_0x6c2dc0){var _0x327b5=this;return new Promise(function(_0x2b54ca,_0x145f15){return db['Sound'][_0xa70a('0x16')]({'raw':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x18')]===undefined?!![]:![]:!![],'where':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')]['where']||null:null,'attributes':_0x6c2dc0['options']?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x19')]||null:null,'include':_0x6c2dc0[_0xa70a('0x17')]?_0x6c2dc0[_0xa70a('0x17')][_0xa70a('0x1a')]?_[_0xa70a('0x1b')](_0x6c2dc0[_0xa70a('0x17')]['include'],function(_0x2a1b32){return{'model':db[_0x2a1b32[_0xa70a('0x1c')]],'as':_0x2a1b32['as'],'attributes':_0x2a1b32[_0xa70a('0x19')],'include':_0x2a1b32['include']?_['map'](_0x2a1b32[_0xa70a('0x1a')],function(_0x38dc0c){return{'model':db[_0x38dc0c[_0xa70a('0x1c')]],'as':_0x38dc0c['as'],'attributes':_0x38dc0c['attributes'],'include':_0x38dc0c[_0xa70a('0x1a')]?_[_0xa70a('0x1b')](_0x38dc0c[_0xa70a('0x1a')],function(_0xde5839){return{'model':db[_0xde5839['model']],'as':_0xde5839['as'],'attributes':_0xde5839[_0xa70a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a3170){logger[_0xa70a('0xd')](_0xa70a('0x1d'),_0x6c2dc0);logger[_0xa70a('0x10')](_0xa70a('0x1d'),_0x6c2dc0,JSON[_0xa70a('0x1e')](_0x4a3170));_0x2b54ca(_0x4a3170);})[_0xa70a('0x15')](function(_0x2a8e8b){logger[_0xa70a('0x12')](_0xa70a('0x1d'),_0x2a8e8b[_0xa70a('0x13')],_0x6c2dc0);_0x145f15(_0x327b5[_0xa70a('0x12')](0x1f4,_0x2a8e8b[_0xa70a('0x13')]));});});}; \ No newline at end of file +var _0xb1f7=['jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','options','raw','where','attributes','include','map','model','ShowSound','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x16388c,_0x1df2d7){var _0x1c46e1=function(_0xa12ce3){while(--_0xa12ce3){_0x16388c['push'](_0x16388c['shift']());}};_0x1c46e1(++_0x1df2d7);}(_0xb1f7,0x7c));var _0x7b1f=function(_0x4b45e2,_0x46f997){_0x4b45e2=_0x4b45e2-0x0;var _0x3bd6ef=_0xb1f7[_0x4b45e2];return _0x3bd6ef;};'use strict';var _=require(_0x7b1f('0x0'));var util=require(_0x7b1f('0x1'));var moment=require(_0x7b1f('0x2'));var BPromise=require(_0x7b1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b1f('0x4'));var db=require(_0x7b1f('0x5'))['db'];var utils=require(_0x7b1f('0x6'));var logger=require('../../config/logger')(_0x7b1f('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b1f('0x8'));var client=jayson[_0x7b1f('0x9')][_0x7b1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f043,_0x4860aa,_0x77797c){return new BPromise(function(_0x4f5e12,_0x2eaa9a){return client[_0x7b1f('0xb')](_0x58f043,_0x77797c)[_0x7b1f('0xc')](function(_0x2808bb){logger[_0x7b1f('0xd')](_0x7b1f('0xe'),_0x4860aa,_0x7b1f('0xf'));logger['debug'](_0x7b1f('0x10'),_0x4860aa,'request\x20sent',JSON[_0x7b1f('0x11')](_0x2808bb));if(_0x2808bb[_0x7b1f('0x12')]){if(_0x2808bb[_0x7b1f('0x12')][_0x7b1f('0x13')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x4860aa,_0x2808bb[_0x7b1f('0x12')][_0x7b1f('0x14')]);return _0x2eaa9a(_0x2808bb[_0x7b1f('0x12')]['message']);}logger[_0x7b1f('0x12')](_0x7b1f('0xe'),_0x4860aa,_0x2808bb[_0x7b1f('0x12')]['message']);return _0x4f5e12(_0x2808bb[_0x7b1f('0x12')][_0x7b1f('0x14')]);}else{logger[_0x7b1f('0xd')](_0x7b1f('0xe'),_0x4860aa,_0x7b1f('0xf'));_0x4f5e12(_0x2808bb[_0x7b1f('0x15')][_0x7b1f('0x14')]);}})[_0x7b1f('0x16')](function(_0x1e16fe){logger[_0x7b1f('0x12')](_0x7b1f('0xe'),_0x4860aa,_0x1e16fe);_0x2eaa9a(_0x1e16fe);});});}exports['ShowSound']=function(_0x5ef91a){var _0x52dc7a=this;return new Promise(function(_0x17970b,_0x510976){return db[_0x7b1f('0x17')]['find']({'raw':_0x5ef91a[_0x7b1f('0x18')]?_0x5ef91a['options'][_0x7b1f('0x19')]===undefined?!![]:![]:!![],'where':_0x5ef91a['options']?_0x5ef91a[_0x7b1f('0x18')][_0x7b1f('0x1a')]||null:null,'attributes':_0x5ef91a[_0x7b1f('0x18')]?_0x5ef91a[_0x7b1f('0x18')][_0x7b1f('0x1b')]||null:null,'include':_0x5ef91a['options']?_0x5ef91a['options'][_0x7b1f('0x1c')]?_[_0x7b1f('0x1d')](_0x5ef91a[_0x7b1f('0x18')][_0x7b1f('0x1c')],function(_0x54a9ef){return{'model':db[_0x54a9ef[_0x7b1f('0x1e')]],'as':_0x54a9ef['as'],'attributes':_0x54a9ef[_0x7b1f('0x1b')],'include':_0x54a9ef[_0x7b1f('0x1c')]?_[_0x7b1f('0x1d')](_0x54a9ef[_0x7b1f('0x1c')],function(_0x4f2248){return{'model':db[_0x4f2248[_0x7b1f('0x1e')]],'as':_0x4f2248['as'],'attributes':_0x4f2248[_0x7b1f('0x1b')],'include':_0x4f2248[_0x7b1f('0x1c')]?_[_0x7b1f('0x1d')](_0x4f2248[_0x7b1f('0x1c')],function(_0x214c46){return{'model':db[_0x214c46['model']],'as':_0x214c46['as'],'attributes':_0x214c46[_0x7b1f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7b1f('0xc')](function(_0x2f8f07){logger['info'](_0x7b1f('0x1f'),_0x5ef91a);logger[_0x7b1f('0x20')]('ShowSound',_0x5ef91a,JSON[_0x7b1f('0x11')](_0x2f8f07));_0x17970b(_0x2f8f07);})['catch'](function(_0x5183a5){logger[_0x7b1f('0x12')](_0x7b1f('0x1f'),_0x5183a5[_0x7b1f('0x14')],_0x5ef91a);_0x510976(_0x52dc7a[_0x7b1f('0x12')](0x1f4,_0x5183a5[_0x7b1f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index da12fb2..ec8c237 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xde9638,_0x42f841){var _0x52d144=function(_0x565cde){while(--_0x565cde){_0xde9638['push'](_0xde9638['shift']());}};_0x52d144(++_0x42f841);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file +var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a39e8,_0x67a814){var _0x361ec1=function(_0x49fb6a){while(--_0x49fb6a){_0x4a39e8['push'](_0x4a39e8['shift']());}};_0x361ec1(++_0x67a814);}(_0xb10b,0x12a));var _0xbb10=function(_0xe51920,_0x4a1092){_0xe51920=_0xe51920-0x0;var _0x4e4c70=_0xb10b[_0xe51920];return _0x4e4c70;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 2bcfbd5..5ebf013 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 _0xe330=['ENUM','out','exports','STRING','TEXT','medium'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe330,0x1be));var _0x0e33=function(_0x26bb15,_0x39b070){_0x26bb15=_0x26bb15-0x0;var _0x7aa58a=_0xe330[_0x26bb15];return _0x7aa58a;};'use strict';var Sequelize=require('sequelize');module[_0x0e33('0x0')]={'uniqueid':{'type':Sequelize[_0x0e33('0x1')]},'body':{'type':Sequelize[_0x0e33('0x2')](_0x0e33('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x0e33('0x4')]('in',_0x0e33('0x5')),'defaultValue':_0x0e33('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0e33('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5620=['exports','STRING','TEXT','out','sequelize'];(function(_0x5b9321,_0x182e7b){var _0x376f1b=function(_0x1cbf30){while(--_0x1cbf30){_0x5b9321['push'](_0x5b9321['shift']());}};_0x376f1b(++_0x182e7b);}(_0x5620,0x1b2));var _0x0562=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0x5620[_0x1afabf];return _0x497ff1;};'use strict';var Sequelize=require(_0x0562('0x0'));module[_0x0562('0x1')]={'uniqueid':{'type':Sequelize[_0x0562('0x2')]},'body':{'type':Sequelize[_0x0562('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x0562('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x0562('0x2')]},'providerResponse':{'type':Sequelize[_0x0562('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 5aef2ec..54bc911 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 _0xd0cd=['create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','catch','show','params','rawAttributes'];(function(_0x5735d0,_0x423963){var _0x5e1c52=function(_0x55d80a){while(--_0x55d80a){_0x5735d0['push'](_0x5735d0['shift']());}};_0x5e1c52(++_0x423963);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0xd0cd[_0x19fa95];return _0x58a835;};'use strict';var emlformat=require(_0xdd0c('0x0'));var rimraf=require(_0xdd0c('0x1'));var zipdir=require(_0xdd0c('0x2'));var jsonpatch=require(_0xdd0c('0x3'));var rp=require('request-promise');var moment=require(_0xdd0c('0x4'));var BPromise=require(_0xdd0c('0x5'));var Mustache=require(_0xdd0c('0x6'));var util=require(_0xdd0c('0x7'));var path=require(_0xdd0c('0x8'));var sox=require(_0xdd0c('0x9'));var csv=require(_0xdd0c('0xa'));var ejs=require(_0xdd0c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd0c('0xc'));var crypto=require(_0xdd0c('0xd'));var jsforce=require(_0xdd0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd0c('0xf'));var Papa=require(_0xdd0c('0x10'));var Redis=require(_0xdd0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd0c('0x12'));var as=require(_0xdd0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd0c('0x14'))(_0xdd0c('0x15'));var utils=require(_0xdd0c('0x16'));var config=require(_0xdd0c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd0c('0x18'))['db'];function respondWithStatusCode(_0x80c14c,_0x2dbec6){_0x2dbec6=_0x2dbec6||0xcc;return function(_0x35cfca){if(_0x35cfca){return _0x80c14c[_0xdd0c('0x19')](_0x2dbec6);}return _0x80c14c[_0xdd0c('0x1a')](_0x2dbec6)[_0xdd0c('0x1b')]();};}function respondWithResult(_0x28eb5b,_0x37158b){_0x37158b=_0x37158b||0xc8;return function(_0x4da50c){if(_0x4da50c){return _0x28eb5b[_0xdd0c('0x1a')](_0x37158b)['json'](_0x4da50c);}};}function respondWithFilteredResult(_0x32cd62,_0x206f1c){return function(_0x2e26a0){if(_0x2e26a0){var _0x5c05e1=typeof _0x206f1c['offset']==='undefined'&&typeof _0x206f1c[_0xdd0c('0x1c')]===_0xdd0c('0x1d');var _0x331b92=_0x2e26a0['count'];var _0x233360=_0x5c05e1?0x0:_0x206f1c[_0xdd0c('0x1e')];var _0x1c959b=_0x5c05e1?_0x2e26a0[_0xdd0c('0x1f')]:_0x206f1c[_0xdd0c('0x1e')]+_0x206f1c[_0xdd0c('0x1c')];var _0x1362a0;if(_0x1c959b>=_0x331b92){_0x1c959b=_0x331b92;_0x1362a0=0xc8;}else{_0x1362a0=0xce;}_0x32cd62[_0xdd0c('0x1a')](_0x1362a0);return _0x32cd62[_0xdd0c('0x20')](_0xdd0c('0x21'),_0x233360+'-'+_0x1c959b+'/'+_0x331b92)[_0xdd0c('0x22')](_0x2e26a0);}return null;};}function patchUpdates(_0x36acba){return function(_0x25e6a3){try{jsonpatch['apply'](_0x25e6a3,_0x36acba,!![]);}catch(_0x3b5de9){return BPromise[_0xdd0c('0x23')](_0x3b5de9);}return _0x25e6a3['save']();};}function saveUpdates(_0x4d46a1,_0x3a8bb0){return function(_0x5a5471){if(_0x5a5471){return _0x5a5471[_0xdd0c('0x24')](_0x4d46a1)[_0xdd0c('0x25')](function(_0x3c1194){return _0x3c1194;});}return null;};}function removeEntity(_0x5b5bdf,_0x5a0f16){return function(_0x14ef79){if(_0x14ef79){return _0x14ef79[_0xdd0c('0x26')]()['then'](function(){_0x5b5bdf[_0xdd0c('0x1a')](0xcc)[_0xdd0c('0x1b')]();});}};}function handleEntityNotFound(_0x551745,_0x18a6c8){return function(_0x38a5c9){if(!_0x38a5c9){_0x551745['sendStatus'](0x194);}return _0x38a5c9;};}function handleError(_0x4608f4,_0x2daa37){_0x2daa37=_0x2daa37||0x1f4;return function(_0x2d4084){logger[_0xdd0c('0x27')](_0x2d4084[_0xdd0c('0x28')]);if(_0x2d4084[_0xdd0c('0x29')]){delete _0x2d4084[_0xdd0c('0x29')];}_0x4608f4[_0xdd0c('0x1a')](_0x2daa37)[_0xdd0c('0x2a')](_0x2d4084);};}exports['index']=function(_0x5d59da,_0xe91a4f){var _0x49e480={},_0x13b18f={},_0x13d80e={'count':0x0,'rows':[]};var _0x4e367f=_[_0xdd0c('0x2b')](db['SquareMessage']['rawAttributes'],function(_0x56f94f){return{'name':_0x56f94f[_0xdd0c('0x2c')],'type':_0x56f94f[_0xdd0c('0x2d')][_0xdd0c('0x2e')]};});_0x13b18f[_0xdd0c('0x2f')]=_[_0xdd0c('0x2b')](_0x4e367f,_0xdd0c('0x29'));_0x13b18f[_0xdd0c('0x30')]=_[_0xdd0c('0x31')](_0x5d59da[_0xdd0c('0x30')]);_0x13b18f[_0xdd0c('0x32')]=_[_0xdd0c('0x33')](_0x13b18f[_0xdd0c('0x2f')],_0x13b18f[_0xdd0c('0x30')]);_0x49e480[_0xdd0c('0x34')]=_[_0xdd0c('0x33')](_0x13b18f[_0xdd0c('0x2f')],qs['fields'](_0x5d59da['query'][_0xdd0c('0x35')]));_0x49e480[_0xdd0c('0x34')]=_0x49e480[_0xdd0c('0x34')][_0xdd0c('0x36')]?_0x49e480[_0xdd0c('0x34')]:_0x13b18f['model'];if(!_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x37')](_0xdd0c('0x38'))){_0x49e480['limit']=qs[_0xdd0c('0x1c')](_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x1c')]);_0x49e480['offset']=qs['offset'](_0x5d59da[_0xdd0c('0x30')]['offset']);}_0x49e480[_0xdd0c('0x39')]=qs[_0xdd0c('0x3a')](_0x5d59da['query'][_0xdd0c('0x3a')]);_0x49e480[_0xdd0c('0x3b')]=qs['filters'](_[_0xdd0c('0x3c')](_0x5d59da[_0xdd0c('0x30')],_0x13b18f['filters']),_0x4e367f);if(_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x3d')]){_0x49e480['where']=_[_0xdd0c('0x3e')](_0x49e480[_0xdd0c('0x3b')],{'$or':_[_0xdd0c('0x2b')](_0x4e367f,function(_0x266bab){if(_0x266bab[_0xdd0c('0x2d')]!==_0xdd0c('0x3f')){var _0x2b6f38={};_0x2b6f38[_0x266bab['name']]={'$like':'%'+_0x5d59da[_0xdd0c('0x30')]['filter']+'%'};return _0x2b6f38;}})});}_0x49e480=_[_0xdd0c('0x3e')]({},_0x49e480,_0x5d59da[_0xdd0c('0x40')]);var _0xe1e84b={'where':_0x49e480[_0xdd0c('0x3b')]};return db[_0xdd0c('0x41')][_0xdd0c('0x1f')](_0xe1e84b)[_0xdd0c('0x25')](function(_0x37b49d){_0x13d80e[_0xdd0c('0x1f')]=_0x37b49d;if(_0x5d59da[_0xdd0c('0x30')][_0xdd0c('0x42')]){_0x49e480[_0xdd0c('0x43')]=[{'all':!![]}];}return db['SquareMessage'][_0xdd0c('0x44')](_0x49e480);})[_0xdd0c('0x25')](function(_0x5db0d4){_0x13d80e['rows']=_0x5db0d4;return _0x13d80e;})[_0xdd0c('0x25')](respondWithFilteredResult(_0xe91a4f,_0x49e480))[_0xdd0c('0x45')](handleError(_0xe91a4f,null));};exports[_0xdd0c('0x46')]=function(_0xba8400,_0x11eb6d){var _0x29edad={'raw':!![],'where':{'id':_0xba8400[_0xdd0c('0x47')]['id']}},_0x11d05e={};_0x11d05e['model']=_[_0xdd0c('0x31')](db[_0xdd0c('0x41')][_0xdd0c('0x48')]);_0x11d05e[_0xdd0c('0x30')]=_[_0xdd0c('0x31')](_0xba8400[_0xdd0c('0x30')]);_0x11d05e['filters']=_[_0xdd0c('0x33')](_0x11d05e[_0xdd0c('0x2f')],_0x11d05e[_0xdd0c('0x30')]);_0x29edad['attributes']=_[_0xdd0c('0x33')](_0x11d05e[_0xdd0c('0x2f')],qs[_0xdd0c('0x35')](_0xba8400[_0xdd0c('0x30')][_0xdd0c('0x35')]));_0x29edad[_0xdd0c('0x34')]=_0x29edad['attributes'][_0xdd0c('0x36')]?_0x29edad['attributes']:_0x11d05e[_0xdd0c('0x2f')];if(_0xba8400['query'][_0xdd0c('0x42')]){_0x29edad[_0xdd0c('0x43')]=[{'all':!![]}];}_0x29edad=_[_0xdd0c('0x3e')]({},_0x29edad,_0xba8400[_0xdd0c('0x40')]);return db[_0xdd0c('0x41')]['find'](_0x29edad)[_0xdd0c('0x25')](handleEntityNotFound(_0x11eb6d,null))['then'](respondWithResult(_0x11eb6d,null))[_0xdd0c('0x45')](handleError(_0x11eb6d,null));};exports['create']=function(_0x31aac7,_0x411d94){return db[_0xdd0c('0x41')][_0xdd0c('0x49')](_0x31aac7['body'],{})['then'](respondWithResult(_0x411d94,0xc9))[_0xdd0c('0x45')](handleError(_0x411d94,null));};exports[_0xdd0c('0x24')]=function(_0x1bbf1f,_0x280349){if(_0x1bbf1f['body']['id']){delete _0x1bbf1f[_0xdd0c('0x4a')]['id'];}return db[_0xdd0c('0x41')]['find']({'where':{'id':_0x1bbf1f['params']['id']}})[_0xdd0c('0x25')](handleEntityNotFound(_0x280349,null))[_0xdd0c('0x25')](saveUpdates(_0x1bbf1f[_0xdd0c('0x4a')],null))['then'](respondWithResult(_0x280349,null))[_0xdd0c('0x45')](handleError(_0x280349,null));};exports[_0xdd0c('0x26')]=function(_0x4ef741,_0x195132){return db[_0xdd0c('0x41')][_0xdd0c('0x4b')]({'where':{'id':_0x4ef741[_0xdd0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x195132,null))[_0xdd0c('0x25')](removeEntity(_0x195132,null))['catch'](handleError(_0x195132,null));}; \ No newline at end of file +var _0x7df7=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','then','destroy','end','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','update','params','body','eml-format','rimraf','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x19b2d2,_0x2485b2){var _0x183e8e=function(_0x47b88b){while(--_0x47b88b){_0x19b2d2['push'](_0x19b2d2['shift']());}};_0x183e8e(++_0x2485b2);}(_0x7df7,0x1b9));var _0x77df=function(_0x2cdf87,_0x1266d4){_0x2cdf87=_0x2cdf87-0x0;var _0x9f44e3=_0x7df7[_0x2cdf87];return _0x9f44e3;};'use strict';var emlformat=require(_0x77df('0x0'));var rimraf=require(_0x77df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x77df('0x3'));var util=require('util');var path=require(_0x77df('0x4'));var sox=require(_0x77df('0x5'));var csv=require(_0x77df('0x6'));var ejs=require(_0x77df('0x7'));var fs=require('fs');var fs_extra=require(_0x77df('0x8'));var _=require(_0x77df('0x9'));var squel=require(_0x77df('0xa'));var crypto=require(_0x77df('0xb'));var jsforce=require(_0x77df('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x77df('0xd'));var Papa=require(_0x77df('0xe'));var Redis=require(_0x77df('0xf'));var authService=require(_0x77df('0x10'));var qs=require(_0x77df('0x11'));var as=require(_0x77df('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77df('0x13'))(_0x77df('0x14'));var utils=require(_0x77df('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x77df('0x16'));var db=require(_0x77df('0x17'))['db'];function respondWithStatusCode(_0x2ee735,_0x2e78f4){_0x2e78f4=_0x2e78f4||0xcc;return function(_0x2ffa28){if(_0x2ffa28){return _0x2ee735[_0x77df('0x18')](_0x2e78f4);}return _0x2ee735[_0x77df('0x19')](_0x2e78f4)['end']();};}function respondWithResult(_0x458a22,_0x13ad8a){_0x13ad8a=_0x13ad8a||0xc8;return function(_0x58071c){if(_0x58071c){return _0x458a22[_0x77df('0x19')](_0x13ad8a)[_0x77df('0x1a')](_0x58071c);}};}function respondWithFilteredResult(_0x577c17,_0x54b359){return function(_0x4d0033){if(_0x4d0033){var _0x5c500c=typeof _0x54b359[_0x77df('0x1b')]===_0x77df('0x1c')&&typeof _0x54b359['limit']==='undefined';var _0x5af31e=_0x4d0033[_0x77df('0x1d')];var _0x35cc35=_0x5c500c?0x0:_0x54b359[_0x77df('0x1b')];var _0x3da640=_0x5c500c?_0x4d0033['count']:_0x54b359[_0x77df('0x1b')]+_0x54b359[_0x77df('0x1e')];var _0xf61f5e;if(_0x3da640>=_0x5af31e){_0x3da640=_0x5af31e;_0xf61f5e=0xc8;}else{_0xf61f5e=0xce;}_0x577c17[_0x77df('0x19')](_0xf61f5e);return _0x577c17[_0x77df('0x1f')]('Content-Range',_0x35cc35+'-'+_0x3da640+'/'+_0x5af31e)[_0x77df('0x1a')](_0x4d0033);}return null;};}function patchUpdates(_0x5cc5f4){return function(_0x2b9158){try{jsonpatch[_0x77df('0x20')](_0x2b9158,_0x5cc5f4,!![]);}catch(_0xd0e5aa){return BPromise['reject'](_0xd0e5aa);}return _0x2b9158[_0x77df('0x21')]();};}function saveUpdates(_0x517825,_0x3178c8){return function(_0x5c55d6){if(_0x5c55d6){return _0x5c55d6['update'](_0x517825)[_0x77df('0x22')](function(_0x35ea42){return _0x35ea42;});}return null;};}function removeEntity(_0x5b345a,_0x41c21d){return function(_0x510856){if(_0x510856){return _0x510856[_0x77df('0x23')]()[_0x77df('0x22')](function(){_0x5b345a[_0x77df('0x19')](0xcc)[_0x77df('0x24')]();});}};}function handleEntityNotFound(_0x13d17a,_0x1408e6){return function(_0x18d077){if(!_0x18d077){_0x13d17a['sendStatus'](0x194);}return _0x18d077;};}function handleError(_0x20996b,_0x177c26){_0x177c26=_0x177c26||0x1f4;return function(_0x5daf8c){logger[_0x77df('0x25')](_0x5daf8c[_0x77df('0x26')]);if(_0x5daf8c[_0x77df('0x27')]){delete _0x5daf8c[_0x77df('0x27')];}_0x20996b['status'](_0x177c26)[_0x77df('0x28')](_0x5daf8c);};}exports[_0x77df('0x29')]=function(_0xd883f8,_0x5c7622){var _0x36a889={},_0x2bb591={},_0x33edda={'count':0x0,'rows':[]};var _0xa4bcd6=_[_0x77df('0x2a')](db[_0x77df('0x2b')][_0x77df('0x2c')],function(_0x41551b){return{'name':_0x41551b[_0x77df('0x2d')],'type':_0x41551b[_0x77df('0x2e')][_0x77df('0x2f')]};});_0x2bb591[_0x77df('0x30')]=_[_0x77df('0x2a')](_0xa4bcd6,_0x77df('0x27'));_0x2bb591[_0x77df('0x31')]=_[_0x77df('0x32')](_0xd883f8[_0x77df('0x31')]);_0x2bb591[_0x77df('0x33')]=_['intersection'](_0x2bb591[_0x77df('0x30')],_0x2bb591[_0x77df('0x31')]);_0x36a889[_0x77df('0x34')]=_[_0x77df('0x35')](_0x2bb591[_0x77df('0x30')],qs['fields'](_0xd883f8['query'][_0x77df('0x36')]));_0x36a889[_0x77df('0x34')]=_0x36a889[_0x77df('0x34')][_0x77df('0x37')]?_0x36a889['attributes']:_0x2bb591[_0x77df('0x30')];if(!_0xd883f8[_0x77df('0x31')][_0x77df('0x38')](_0x77df('0x39'))){_0x36a889[_0x77df('0x1e')]=qs[_0x77df('0x1e')](_0xd883f8[_0x77df('0x31')][_0x77df('0x1e')]);_0x36a889[_0x77df('0x1b')]=qs[_0x77df('0x1b')](_0xd883f8[_0x77df('0x31')]['offset']);}_0x36a889[_0x77df('0x3a')]=qs[_0x77df('0x3b')](_0xd883f8[_0x77df('0x31')][_0x77df('0x3b')]);_0x36a889['where']=qs[_0x77df('0x33')](_[_0x77df('0x3c')](_0xd883f8[_0x77df('0x31')],_0x2bb591[_0x77df('0x33')]),_0xa4bcd6);if(_0xd883f8[_0x77df('0x31')][_0x77df('0x3d')]){_0x36a889[_0x77df('0x3e')]=_[_0x77df('0x3f')](_0x36a889[_0x77df('0x3e')],{'$or':_[_0x77df('0x2a')](_0xa4bcd6,function(_0x3c0417){if(_0x3c0417[_0x77df('0x2e')]!==_0x77df('0x40')){var _0x284643={};_0x284643[_0x3c0417[_0x77df('0x27')]]={'$like':'%'+_0xd883f8[_0x77df('0x31')][_0x77df('0x3d')]+'%'};return _0x284643;}})});}_0x36a889=_[_0x77df('0x3f')]({},_0x36a889,_0xd883f8[_0x77df('0x41')]);var _0x396524={'where':_0x36a889[_0x77df('0x3e')]};return db[_0x77df('0x2b')]['count'](_0x396524)['then'](function(_0x44c234){_0x33edda[_0x77df('0x1d')]=_0x44c234;if(_0xd883f8[_0x77df('0x31')]['includeAll']){_0x36a889[_0x77df('0x42')]=[{'all':!![]}];}return db[_0x77df('0x2b')][_0x77df('0x43')](_0x36a889);})[_0x77df('0x22')](function(_0x42db84){_0x33edda[_0x77df('0x44')]=_0x42db84;return _0x33edda;})[_0x77df('0x22')](respondWithFilteredResult(_0x5c7622,_0x36a889))[_0x77df('0x45')](handleError(_0x5c7622,null));};exports[_0x77df('0x46')]=function(_0x2610b9,_0x15ca2d){var _0x47cdc9={'raw':!![],'where':{'id':_0x2610b9['params']['id']}},_0x1f2397={};_0x1f2397[_0x77df('0x30')]=_['keys'](db['SquareMessage'][_0x77df('0x2c')]);_0x1f2397[_0x77df('0x31')]=_['keys'](_0x2610b9['query']);_0x1f2397[_0x77df('0x33')]=_[_0x77df('0x35')](_0x1f2397[_0x77df('0x30')],_0x1f2397[_0x77df('0x31')]);_0x47cdc9['attributes']=_[_0x77df('0x35')](_0x1f2397[_0x77df('0x30')],qs[_0x77df('0x36')](_0x2610b9[_0x77df('0x31')][_0x77df('0x36')]));_0x47cdc9['attributes']=_0x47cdc9[_0x77df('0x34')][_0x77df('0x37')]?_0x47cdc9[_0x77df('0x34')]:_0x1f2397[_0x77df('0x30')];if(_0x2610b9[_0x77df('0x31')][_0x77df('0x47')]){_0x47cdc9[_0x77df('0x42')]=[{'all':!![]}];}_0x47cdc9=_[_0x77df('0x3f')]({},_0x47cdc9,_0x2610b9[_0x77df('0x41')]);return db['SquareMessage'][_0x77df('0x48')](_0x47cdc9)[_0x77df('0x22')](handleEntityNotFound(_0x15ca2d,null))['then'](respondWithResult(_0x15ca2d,null))['catch'](handleError(_0x15ca2d,null));};exports[_0x77df('0x49')]=function(_0x13399d,_0x3520d7){return db[_0x77df('0x2b')][_0x77df('0x49')](_0x13399d['body'],{})[_0x77df('0x22')](respondWithResult(_0x3520d7,0xc9))[_0x77df('0x45')](handleError(_0x3520d7,null));};exports[_0x77df('0x4a')]=function(_0x58e08a,_0x401386){if(_0x58e08a['body']['id']){delete _0x58e08a['body']['id'];}return db[_0x77df('0x2b')][_0x77df('0x48')]({'where':{'id':_0x58e08a[_0x77df('0x4b')]['id']}})[_0x77df('0x22')](handleEntityNotFound(_0x401386,null))[_0x77df('0x22')](saveUpdates(_0x58e08a[_0x77df('0x4c')],null))[_0x77df('0x22')](respondWithResult(_0x401386,null))[_0x77df('0x45')](handleError(_0x401386,null));};exports['destroy']=function(_0xddbc2f,_0x4fbc88){return db['SquareMessage']['find']({'where':{'id':_0xddbc2f['params']['id']}})['then'](handleEntityNotFound(_0x4fbc88,null))['then'](removeEntity(_0x4fbc88,null))[_0x77df('0x45')](handleError(_0x4fbc88,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 36e510e..4e8b162 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 _0x6716=['square_messages','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','SquareMessage'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6716,0x1e1));var _0x6671=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x6716[_0x1b3a09];return _0x357bb8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6671('0x0'))('api');var moment=require(_0x6671('0x1'));var BPromise=require(_0x6671('0x2'));var rp=require(_0x6671('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6671('0x4'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x4b2571,_0x43f289){return _0x4b2571[_0x6671('0x5')](_0x6671('0x6'),attributes,{'tableName':_0x6671('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x047b=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','../../config/logger','api','request-promise'];(function(_0x226e0f,_0x55cf05){var _0x1a3690=function(_0x418ae8){while(--_0x418ae8){_0x226e0f['push'](_0x226e0f['shift']());}};_0x1a3690(++_0x55cf05);}(_0x047b,0x177));var _0xb047=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x047b[_0x597484];return _0x218e64;};'use strict';var _=require(_0xb047('0x0'));var util=require(_0xb047('0x1'));var logger=require(_0xb047('0x2'))(_0xb047('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb047('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb047('0x5'));var attributes=require(_0xb047('0x6'));module[_0xb047('0x7')]=function(_0x5a06c9,_0x40fc7c){return _0x5a06c9[_0xb047('0x8')](_0xb047('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 88caca0..8270581 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 _0x059c=['CreateSquareMessage','create','body','options','raw','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','catch'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x059c,0xcd));var _0xc059=function(_0x4361c1,_0x175703){_0x4361c1=_0x4361c1-0x0;var _0x7d47bd=_0x059c[_0x4361c1];return _0x7d47bd;};'use strict';var _=require(_0xc059('0x0'));var util=require(_0xc059('0x1'));var moment=require(_0xc059('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc059('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc059('0x4'))(_0xc059('0x5'));var config=require(_0xc059('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc059('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d5284,_0x173a9,_0x12c5df){return new BPromise(function(_0x59eb58,_0x5884e1){return client[_0xc059('0x8')](_0x5d5284,_0x12c5df)[_0xc059('0x9')](function(_0xc75e7){logger[_0xc059('0xa')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc059('0xb'));logger[_0xc059('0xc')](_0xc059('0xd'),_0x173a9,_0xc059('0xb'),JSON[_0xc059('0xe')](_0xc75e7));if(_0xc75e7[_0xc059('0xf')]){if(_0xc75e7[_0xc059('0xf')][_0xc059('0x10')]===0x1f4){logger[_0xc059('0xf')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);return _0x5884e1(_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);}logger[_0xc059('0xf')]('SquareMessage,\x20%s,\x20%s',_0x173a9,_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);return _0x59eb58(_0xc75e7[_0xc059('0xf')][_0xc059('0x11')]);}else{logger[_0xc059('0xa')](_0xc059('0x12'),_0x173a9,'request\x20sent');_0x59eb58(_0xc75e7['result']['message']);}})[_0xc059('0x13')](function(_0x1423c8){logger[_0xc059('0xf')](_0xc059('0x12'),_0x173a9,_0x1423c8);_0x5884e1(_0x1423c8);});});}exports[_0xc059('0x14')]=function(_0xadce3b){var _0x26b480=this;return new Promise(function(_0x4faf8b,_0x12853f){return db['SquareMessage'][_0xc059('0x15')](_0xadce3b[_0xc059('0x16')],{'raw':_0xadce3b[_0xc059('0x17')]?_0xadce3b['options'][_0xc059('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x233cb3){logger[_0xc059('0xa')](_0xc059('0x14'),_0xadce3b);logger[_0xc059('0xc')](_0xc059('0x14'),_0xadce3b,JSON[_0xc059('0xe')](_0x233cb3));_0x4faf8b(_0x233cb3);})[_0xc059('0x13')](function(_0x3feedb){logger['error']('CreateSquareMessage',_0x3feedb[_0xc059('0x11')],_0xadce3b);_0x12853f(_0x26b480['error'](0x1f4,_0x3feedb['message']));});});}; \ No newline at end of file +var _0xe65f=['client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareMessage','create','body','raw','then','CreateSquareMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2c8dd6,_0x3d86ca){var _0x55ffca=function(_0x452930){while(--_0x452930){_0x2c8dd6['push'](_0x2c8dd6['shift']());}};_0x55ffca(++_0x3d86ca);}(_0xe65f,0x1b8));var _0xfe65=function(_0x7c0646,_0x45d16b){_0x7c0646=_0x7c0646-0x0;var _0x32416d=_0xe65f[_0x7c0646];return _0x32416d;};'use strict';var _=require(_0xfe65('0x0'));var util=require('util');var moment=require(_0xfe65('0x1'));var BPromise=require(_0xfe65('0x2'));var rs=require(_0xfe65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe65('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe65('0x5'))('rpc');var config=require(_0xfe65('0x6'));var jayson=require(_0xfe65('0x7'));var client=jayson[_0xfe65('0x8')][_0xfe65('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b7393,_0x467a0c,_0x1f5870){return new BPromise(function(_0x48b27d,_0x4838d1){return client[_0xfe65('0xa')](_0x3b7393,_0x1f5870)['then'](function(_0x1400a5){logger['info'](_0xfe65('0xb'),_0x467a0c,_0xfe65('0xc'));logger[_0xfe65('0xd')](_0xfe65('0xe'),_0x467a0c,'request\x20sent',JSON[_0xfe65('0xf')](_0x1400a5));if(_0x1400a5[_0xfe65('0x10')]){if(_0x1400a5[_0xfe65('0x10')][_0xfe65('0x11')]===0x1f4){logger[_0xfe65('0x10')](_0xfe65('0xb'),_0x467a0c,_0x1400a5['error'][_0xfe65('0x12')]);return _0x4838d1(_0x1400a5[_0xfe65('0x10')][_0xfe65('0x12')]);}logger[_0xfe65('0x10')](_0xfe65('0xb'),_0x467a0c,_0x1400a5[_0xfe65('0x10')][_0xfe65('0x12')]);return _0x48b27d(_0x1400a5[_0xfe65('0x10')][_0xfe65('0x12')]);}else{logger[_0xfe65('0x13')]('SquareMessage,\x20%s,\x20%s',_0x467a0c,'request\x20sent');_0x48b27d(_0x1400a5[_0xfe65('0x14')][_0xfe65('0x12')]);}})[_0xfe65('0x15')](function(_0x16ce3b){logger[_0xfe65('0x10')](_0xfe65('0xb'),_0x467a0c,_0x16ce3b);_0x4838d1(_0x16ce3b);});});}exports['CreateSquareMessage']=function(_0x3ba6eb){var _0x1e8631=this;return new Promise(function(_0x542189,_0x298a90){return db[_0xfe65('0x16')][_0xfe65('0x17')](_0x3ba6eb[_0xfe65('0x18')],{'raw':_0x3ba6eb['options']?_0x3ba6eb['options'][_0xfe65('0x19')]===undefined?!![]:![]:!![]})[_0xfe65('0x1a')](function(_0x3db871){logger['info'](_0xfe65('0x1b'),_0x3ba6eb);logger[_0xfe65('0xd')]('CreateSquareMessage',_0x3ba6eb,JSON[_0xfe65('0xf')](_0x3db871));_0x542189(_0x3db871);})[_0xfe65('0x15')](function(_0x102b55){logger[_0xfe65('0x10')]('CreateSquareMessage',_0x102b55[_0xfe65('0x12')],_0x3ba6eb);_0x298a90(_0x1e8631[_0xfe65('0x10')](0x1f4,_0x102b55['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e00f19e..39e52c6 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 _0x3fa4=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','index','show','/:id/test','isAuthenticated','test','post','create','put'];(function(_0x5d402b,_0x3874f4){var _0x14028f=function(_0x473b0d){while(--_0x473b0d){_0x5d402b['push'](_0x5d402b['shift']());}};_0x14028f(++_0x3874f4);}(_0x3fa4,0x65));var _0x43fa=function(_0x35c0ba,_0x45d774){_0x35c0ba=_0x35c0ba-0x0;var _0x5e6dba=_0x3fa4[_0x35c0ba];return _0x5e6dba;};'use strict';var multer=require(_0x43fa('0x0'));var util=require(_0x43fa('0x1'));var path=require(_0x43fa('0x2'));var timeout=require(_0x43fa('0x3'));var express=require(_0x43fa('0x4'));var router=express[_0x43fa('0x5')]();var fs_extra=require(_0x43fa('0x6'));var auth=require(_0x43fa('0x7'));var interaction=require(_0x43fa('0x8'));var config=require('../../config/environment');var controller=require(_0x43fa('0x9'));router[_0x43fa('0xa')]('/',auth['isAuthenticated'](),controller[_0x43fa('0xb')]);router[_0x43fa('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x43fa('0xc')]);router[_0x43fa('0xa')](_0x43fa('0xd'),auth[_0x43fa('0xe')](),timeout('15s'),controller[_0x43fa('0xf')]);router[_0x43fa('0x10')]('/',auth[_0x43fa('0xe')](),controller[_0x43fa('0x11')]);router[_0x43fa('0x12')](_0x43fa('0x13'),auth[_0x43fa('0xe')](),controller[_0x43fa('0x14')]);router[_0x43fa('0x15')]('/:id',auth[_0x43fa('0xe')](),controller[_0x43fa('0x16')]);module[_0x43fa('0x17')]=router; \ No newline at end of file +var _0x2cc3=['./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','test','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1381c3,_0xbd6c90){var _0x4723ca=function(_0x2d413d){while(--_0x2d413d){_0x1381c3['push'](_0x1381c3['shift']());}};_0x4723ca(++_0xbd6c90);}(_0x2cc3,0x1b1));var _0x32cc=function(_0xcda30a,_0x55f812){_0xcda30a=_0xcda30a-0x0;var _0x28f3cd=_0x2cc3[_0xcda30a];return _0x28f3cd;};'use strict';var multer=require(_0x32cc('0x0'));var util=require(_0x32cc('0x1'));var path=require(_0x32cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x32cc('0x3'));var router=express[_0x32cc('0x4')]();var fs_extra=require(_0x32cc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x32cc('0x6'));var config=require(_0x32cc('0x7'));var controller=require(_0x32cc('0x8'));router[_0x32cc('0x9')]('/',auth[_0x32cc('0xa')](),controller['index']);router[_0x32cc('0x9')](_0x32cc('0xb'),auth[_0x32cc('0xa')](),controller[_0x32cc('0xc')]);router['get'](_0x32cc('0xd'),auth[_0x32cc('0xa')](),timeout(_0x32cc('0xe')),controller[_0x32cc('0xf')]);router['post']('/',auth[_0x32cc('0xa')](),controller['create']);router[_0x32cc('0x10')](_0x32cc('0xb'),auth['isAuthenticated'](),controller[_0x32cc('0x11')]);router[_0x32cc('0x12')](_0x32cc('0xb'),auth[_0x32cc('0xa')](),controller[_0x32cc('0x13')]);module[_0x32cc('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0907257..b879fbd 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 _0xb1fd=['sequelize','exports','name','STRING'];(function(_0x54c655,_0x3682b7){var _0x2ac4d5=function(_0x42c4ba){while(--_0x42c4ba){_0x54c655['push'](_0x54c655['shift']());}};_0x2ac4d5(++_0x3682b7);}(_0xb1fd,0x164));var _0xdb1f=function(_0x16c730,_0x38b6ed){_0x16c730=_0x16c730-0x0;var _0x374e82=_0xb1fd[_0x16c730];return _0x374e82;};'use strict';var Sequelize=require(_0xdb1f('0x0'));module[_0xdb1f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdb1f('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xdb1f('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdd55=['name','sequelize','STRING'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdd55,0xfd));var _0x5dd5=function(_0x373059,_0x17b09c){_0x373059=_0x373059-0x0;var _0x368f67=_0xdd55[_0x373059];return _0x368f67;};'use strict';var Sequelize=require(_0x5dd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x5dd5('0x1')],'unique':_0x5dd5('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5dd5('0x1')]},'description':{'type':Sequelize[_0x5dd5('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 19a5f6e..fac8d22 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 _0xd5e6=['bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','SquareOdbc','findAll','catch','show','params','keys','rawAttributes','merge','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd5e6,0xf9));var _0x6d5e=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xd5e6[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0x6d5e('0x0'));var rimraf=require(_0x6d5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d5e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d5e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6d5e('0x4'));var csv=require(_0x6d5e('0x5'));var ejs=require(_0x6d5e('0x6'));var fs=require('fs');var fs_extra=require(_0x6d5e('0x7'));var _=require(_0x6d5e('0x8'));var squel=require(_0x6d5e('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d5e('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6d5e('0xb'));var Papa=require(_0x6d5e('0xc'));var Redis=require(_0x6d5e('0xd'));var authService=require(_0x6d5e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d5e('0xf'));var logger=require(_0x6d5e('0x10'))(_0x6d5e('0x11'));var utils=require(_0x6d5e('0x12'));var config=require(_0x6d5e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d5e('0x14'))['db'];function respondWithStatusCode(_0x21e905,_0x5ba8c0){_0x5ba8c0=_0x5ba8c0||0xcc;return function(_0x5d600d){if(_0x5d600d){return _0x21e905['sendStatus'](_0x5ba8c0);}return _0x21e905['status'](_0x5ba8c0)[_0x6d5e('0x15')]();};}function respondWithResult(_0x53df42,_0x5c0c1e){_0x5c0c1e=_0x5c0c1e||0xc8;return function(_0x1afaa4){if(_0x1afaa4){return _0x53df42['status'](_0x5c0c1e)[_0x6d5e('0x16')](_0x1afaa4);}};}function respondWithFilteredResult(_0x32f232,_0xde9c3c){return function(_0x2ebdc2){if(_0x2ebdc2){var _0x1a4106=typeof _0xde9c3c[_0x6d5e('0x17')]===_0x6d5e('0x18')&&typeof _0xde9c3c[_0x6d5e('0x19')]===_0x6d5e('0x18');var _0x5136d5=_0x2ebdc2[_0x6d5e('0x1a')];var _0x5984be=_0x1a4106?0x0:_0xde9c3c[_0x6d5e('0x17')];var _0x450108=_0x1a4106?_0x2ebdc2['count']:_0xde9c3c[_0x6d5e('0x17')]+_0xde9c3c[_0x6d5e('0x19')];var _0x586c73;if(_0x450108>=_0x5136d5){_0x450108=_0x5136d5;_0x586c73=0xc8;}else{_0x586c73=0xce;}_0x32f232[_0x6d5e('0x1b')](_0x586c73);return _0x32f232[_0x6d5e('0x1c')](_0x6d5e('0x1d'),_0x5984be+'-'+_0x450108+'/'+_0x5136d5)[_0x6d5e('0x16')](_0x2ebdc2);}return null;};}function patchUpdates(_0x1de1fc){return function(_0x5ddd42){try{jsonpatch[_0x6d5e('0x1e')](_0x5ddd42,_0x1de1fc,!![]);}catch(_0x2f2f6f){return BPromise[_0x6d5e('0x1f')](_0x2f2f6f);}return _0x5ddd42[_0x6d5e('0x20')]();};}function saveUpdates(_0x1b3f40,_0x98f7d9){return function(_0x46d603){if(_0x46d603){return _0x46d603[_0x6d5e('0x21')](_0x1b3f40)[_0x6d5e('0x22')](function(_0x50a874){return _0x50a874;});}return null;};}function removeEntity(_0x24056f,_0x3c22d4){return function(_0x2301db){if(_0x2301db){return _0x2301db[_0x6d5e('0x23')]()['then'](function(){var _0x25a635=_0x2301db[_0x6d5e('0x24')]({'plain':!![]});var _0x45ae42=_0x6d5e('0x25');return db[_0x6d5e('0x26')][_0x6d5e('0x23')]({'where':{'type':_0x45ae42,'resourceId':_0x25a635['id']}})[_0x6d5e('0x22')](function(){return _0x2301db;});})[_0x6d5e('0x22')](function(){_0x24056f['status'](0xcc)[_0x6d5e('0x15')]();});}};}function handleEntityNotFound(_0x1e4d7c,_0x43f145){return function(_0x3b5730){if(!_0x3b5730){_0x1e4d7c[_0x6d5e('0x27')](0x194);}return _0x3b5730;};}function handleError(_0x28b920,_0x2af1d5){_0x2af1d5=_0x2af1d5||0x1f4;return function(_0x1071d3){logger[_0x6d5e('0x28')](_0x1071d3['stack']);if(_0x1071d3[_0x6d5e('0x29')]){delete _0x1071d3[_0x6d5e('0x29')];}_0x28b920[_0x6d5e('0x1b')](_0x2af1d5)[_0x6d5e('0x2a')](_0x1071d3);};}exports[_0x6d5e('0x2b')]=function(_0x32f274,_0x42564f){var _0x24f994={},_0x4482a6={},_0x206234={'count':0x0,'rows':[]};var _0x2edb9f=_[_0x6d5e('0x2c')](db['SquareOdbc']['rawAttributes'],function(_0x40e5fb){return{'name':_0x40e5fb[_0x6d5e('0x2d')],'type':_0x40e5fb[_0x6d5e('0x2e')][_0x6d5e('0x2f')]};});_0x4482a6[_0x6d5e('0x30')]=_[_0x6d5e('0x2c')](_0x2edb9f,_0x6d5e('0x29'));_0x4482a6['query']=_['keys'](_0x32f274[_0x6d5e('0x31')]);_0x4482a6[_0x6d5e('0x32')]=_[_0x6d5e('0x33')](_0x4482a6[_0x6d5e('0x30')],_0x4482a6[_0x6d5e('0x31')]);_0x24f994[_0x6d5e('0x34')]=_[_0x6d5e('0x33')](_0x4482a6[_0x6d5e('0x30')],qs[_0x6d5e('0x35')](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x35')]));_0x24f994[_0x6d5e('0x34')]=_0x24f994[_0x6d5e('0x34')]['length']?_0x24f994[_0x6d5e('0x34')]:_0x4482a6[_0x6d5e('0x30')];if(!_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x36')](_0x6d5e('0x37'))){_0x24f994['limit']=qs['limit'](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x19')]);_0x24f994[_0x6d5e('0x17')]=qs['offset'](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x17')]);}_0x24f994['order']=qs[_0x6d5e('0x38')](_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x38')]);_0x24f994[_0x6d5e('0x39')]=qs[_0x6d5e('0x32')](_['pick'](_0x32f274[_0x6d5e('0x31')],_0x4482a6[_0x6d5e('0x32')]),_0x2edb9f);if(_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x3a')]){_0x24f994[_0x6d5e('0x39')]=_['merge'](_0x24f994[_0x6d5e('0x39')],{'$or':_['map'](_0x2edb9f,function(_0x6b52ae){if(_0x6b52ae[_0x6d5e('0x2e')]!==_0x6d5e('0x3b')){var _0x19b437={};_0x19b437[_0x6b52ae['name']]={'$like':'%'+_0x32f274[_0x6d5e('0x31')][_0x6d5e('0x3a')]+'%'};return _0x19b437;}})});}_0x24f994=_['merge']({},_0x24f994,_0x32f274[_0x6d5e('0x3c')]);var _0x4b948d={'where':_0x24f994[_0x6d5e('0x39')]};return db['SquareOdbc'][_0x6d5e('0x1a')](_0x4b948d)['then'](function(_0x5c0a1a){_0x206234['count']=_0x5c0a1a;if(_0x32f274['query'][_0x6d5e('0x3d')]){_0x24f994[_0x6d5e('0x3e')]=[{'all':!![]}];}return db[_0x6d5e('0x3f')][_0x6d5e('0x40')](_0x24f994);})['then'](function(_0x2b2292){_0x206234['rows']=_0x2b2292;return _0x206234;})['then'](respondWithFilteredResult(_0x42564f,_0x24f994))[_0x6d5e('0x41')](handleError(_0x42564f,null));};exports[_0x6d5e('0x42')]=function(_0x539127,_0x1f2c7f){var _0x118743={'raw':!![],'where':{'id':_0x539127[_0x6d5e('0x43')]['id']}},_0x33449f={};_0x33449f['model']=_[_0x6d5e('0x44')](db['SquareOdbc'][_0x6d5e('0x45')]);_0x33449f[_0x6d5e('0x31')]=_[_0x6d5e('0x44')](_0x539127[_0x6d5e('0x31')]);_0x33449f[_0x6d5e('0x32')]=_['intersection'](_0x33449f[_0x6d5e('0x30')],_0x33449f[_0x6d5e('0x31')]);_0x118743[_0x6d5e('0x34')]=_['intersection'](_0x33449f['model'],qs[_0x6d5e('0x35')](_0x539127[_0x6d5e('0x31')][_0x6d5e('0x35')]));_0x118743[_0x6d5e('0x34')]=_0x118743['attributes']['length']?_0x118743['attributes']:_0x33449f[_0x6d5e('0x30')];if(_0x539127[_0x6d5e('0x31')][_0x6d5e('0x3d')]){_0x118743[_0x6d5e('0x3e')]=[{'all':!![]}];}_0x118743=_[_0x6d5e('0x46')]({},_0x118743,_0x539127[_0x6d5e('0x3c')]);return db['SquareOdbc'][_0x6d5e('0x47')](_0x118743)[_0x6d5e('0x22')](handleEntityNotFound(_0x1f2c7f,null))[_0x6d5e('0x22')](respondWithResult(_0x1f2c7f,null))[_0x6d5e('0x41')](handleError(_0x1f2c7f,null));};exports[_0x6d5e('0x48')]=function(_0x5f499e,_0x6d39d9){return db['SquareOdbc'][_0x6d5e('0x48')](_0x5f499e['body'],{})[_0x6d5e('0x22')](function(_0x315d6a){var _0x29eb03=_0x5f499e['user']['get']({'plain':!![]});if(!_0x29eb03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29eb03[_0x6d5e('0x49')]===_0x6d5e('0x4a')){var _0x166e13=_0x315d6a['get']({'plain':!![]});var _0x1a4b48=_0x6d5e('0x25');return db[_0x6d5e('0x4b')]['find']({'where':{'name':_0x1a4b48,'userProfileId':_0x29eb03['userProfileId']},'raw':!![]})['then'](function(_0x390feb){if(_0x390feb&&_0x390feb[_0x6d5e('0x4c')]===0x0){return db['UserProfileResource'][_0x6d5e('0x48')]({'name':_0x166e13[_0x6d5e('0x29')],'resourceId':_0x166e13['id'],'type':_0x390feb[_0x6d5e('0x29')],'sectionId':_0x390feb['id']},{})['then'](function(){return _0x315d6a;});}else{return _0x315d6a;}})[_0x6d5e('0x41')](function(_0x55ae89){logger['error'](_0x6d5e('0x4d'),_0x55ae89);throw _0x55ae89;});}return _0x315d6a;})[_0x6d5e('0x22')](respondWithResult(_0x6d39d9,0xc9))[_0x6d5e('0x41')](handleError(_0x6d39d9,null));};exports[_0x6d5e('0x21')]=function(_0x77af01,_0x30baf2){if(_0x77af01['body']['id']){delete _0x77af01['body']['id'];}return db[_0x6d5e('0x3f')][_0x6d5e('0x47')]({'where':{'id':_0x77af01[_0x6d5e('0x43')]['id']}})[_0x6d5e('0x22')](handleEntityNotFound(_0x30baf2,null))[_0x6d5e('0x22')](saveUpdates(_0x77af01[_0x6d5e('0x4e')],null))[_0x6d5e('0x22')](respondWithResult(_0x30baf2,null))['catch'](handleError(_0x30baf2,null));};exports['destroy']=function(_0x2b8317,_0x23b8ff){return db[_0x6d5e('0x3f')]['find']({'where':{'id':_0x2b8317[_0x6d5e('0x43')]['id']}})[_0x6d5e('0x22')](handleEntityNotFound(_0x23b8ff,null))[_0x6d5e('0x22')](removeEntity(_0x23b8ff,null))[_0x6d5e('0x41')](handleError(_0x23b8ff,null));};exports[_0x6d5e('0x4f')]=function(_0x1a8248,_0x4a998f,_0x382fb2){var _0x3813bb;return db[_0x6d5e('0x3f')][_0x6d5e('0x47')]({'where':{'id':_0x1a8248[_0x6d5e('0x43')]['id']},'attributes':['id',_0x6d5e('0x50')]})[_0x6d5e('0x22')](handleEntityNotFound(_0x4a998f,null))[_0x6d5e('0x22')](function(_0x4d02f4){if(_0x4d02f4){var _0x2c4674=require(_0x6d5e('0x51'))();_0x2c4674[_0x6d5e('0x52')](_0x4d02f4['dsn']);_0x2c4674[_0x6d5e('0x53')]();return _0x4d02f4;}})[_0x6d5e('0x22')](respondWithResult(_0x4a998f,null))[_0x6d5e('0x41')](handleError(_0x4a998f,null));}; \ No newline at end of file +var _0x0a50=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','ODBC','stack','name','status','send','index','SquareOdbc','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','catch','show','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x54a5cb,_0x4e5f16){var _0x168e1c=function(_0x3c97a9){while(--_0x3c97a9){_0x54a5cb['push'](_0x54a5cb['shift']());}};_0x168e1c(++_0x4e5f16);}(_0x0a50,0x19b));var _0x00a5=function(_0x35415b,_0x55a18f){_0x35415b=_0x35415b-0x0;var _0x6a0d5e=_0x0a50[_0x35415b];return _0x6a0d5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00a5('0x0'));var zipdir=require(_0x00a5('0x1'));var jsonpatch=require(_0x00a5('0x2'));var rp=require(_0x00a5('0x3'));var moment=require(_0x00a5('0x4'));var BPromise=require(_0x00a5('0x5'));var Mustache=require('mustache');var util=require(_0x00a5('0x6'));var path=require(_0x00a5('0x7'));var sox=require(_0x00a5('0x8'));var csv=require(_0x00a5('0x9'));var ejs=require(_0x00a5('0xa'));var fs=require('fs');var fs_extra=require(_0x00a5('0xb'));var _=require(_0x00a5('0xc'));var squel=require(_0x00a5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x00a5('0x9'));var querystring=require(_0x00a5('0xe'));var Papa=require(_0x00a5('0xf'));var Redis=require(_0x00a5('0x10'));var authService=require(_0x00a5('0x11'));var qs=require(_0x00a5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00a5('0x13'));var logger=require(_0x00a5('0x14'))(_0x00a5('0x15'));var utils=require(_0x00a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x00a5('0x17'));var db=require(_0x00a5('0x18'))['db'];function respondWithStatusCode(_0x276d9d,_0x2c48f3){_0x2c48f3=_0x2c48f3||0xcc;return function(_0x37fe16){if(_0x37fe16){return _0x276d9d[_0x00a5('0x19')](_0x2c48f3);}return _0x276d9d['status'](_0x2c48f3)[_0x00a5('0x1a')]();};}function respondWithResult(_0x4263e9,_0x321106){_0x321106=_0x321106||0xc8;return function(_0x27acc9){if(_0x27acc9){return _0x4263e9['status'](_0x321106)[_0x00a5('0x1b')](_0x27acc9);}};}function respondWithFilteredResult(_0x19a8a2,_0x1df2fb){return function(_0x2eb8f3){if(_0x2eb8f3){var _0x18fc65=typeof _0x1df2fb[_0x00a5('0x1c')]===_0x00a5('0x1d')&&typeof _0x1df2fb['limit']==='undefined';var _0x1558e2=_0x2eb8f3[_0x00a5('0x1e')];var _0x5af3d4=_0x18fc65?0x0:_0x1df2fb[_0x00a5('0x1c')];var _0x42b1f0=_0x18fc65?_0x2eb8f3[_0x00a5('0x1e')]:_0x1df2fb[_0x00a5('0x1c')]+_0x1df2fb[_0x00a5('0x1f')];var _0x3f76be;if(_0x42b1f0>=_0x1558e2){_0x42b1f0=_0x1558e2;_0x3f76be=0xc8;}else{_0x3f76be=0xce;}_0x19a8a2['status'](_0x3f76be);return _0x19a8a2['set'](_0x00a5('0x20'),_0x5af3d4+'-'+_0x42b1f0+'/'+_0x1558e2)[_0x00a5('0x1b')](_0x2eb8f3);}return null;};}function patchUpdates(_0x216541){return function(_0x565e80){try{jsonpatch[_0x00a5('0x21')](_0x565e80,_0x216541,!![]);}catch(_0x27c17d){return BPromise['reject'](_0x27c17d);}return _0x565e80['save']();};}function saveUpdates(_0x2c6496,_0x2fb8ed){return function(_0x5924ce){if(_0x5924ce){return _0x5924ce['update'](_0x2c6496)[_0x00a5('0x22')](function(_0x497946){return _0x497946;});}return null;};}function removeEntity(_0x26d240,_0x240237){return function(_0x1d27bb){if(_0x1d27bb){return _0x1d27bb[_0x00a5('0x23')]()[_0x00a5('0x22')](function(){var _0x300d4c=_0x1d27bb['get']({'plain':!![]});var _0x5dc4c7=_0x00a5('0x24');return db['UserProfileResource'][_0x00a5('0x23')]({'where':{'type':_0x5dc4c7,'resourceId':_0x300d4c['id']}})[_0x00a5('0x22')](function(){return _0x1d27bb;});})['then'](function(){_0x26d240['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x168256,_0x16779d){return function(_0x4e26d4){if(!_0x4e26d4){_0x168256[_0x00a5('0x19')](0x194);}return _0x4e26d4;};}function handleError(_0x2132cf,_0x46a1a8){_0x46a1a8=_0x46a1a8||0x1f4;return function(_0x30b8fb){logger['error'](_0x30b8fb[_0x00a5('0x25')]);if(_0x30b8fb['name']){delete _0x30b8fb[_0x00a5('0x26')];}_0x2132cf[_0x00a5('0x27')](_0x46a1a8)[_0x00a5('0x28')](_0x30b8fb);};}exports[_0x00a5('0x29')]=function(_0xdd4979,_0x2af313){var _0x4ec5bb={},_0x10e077={},_0x2e0b9b={'count':0x0,'rows':[]};var _0x3bd944=_['map'](db[_0x00a5('0x2a')]['rawAttributes'],function(_0x20ecf7){return{'name':_0x20ecf7[_0x00a5('0x2b')],'type':_0x20ecf7[_0x00a5('0x2c')][_0x00a5('0x2d')]};});_0x10e077[_0x00a5('0x2e')]=_[_0x00a5('0x2f')](_0x3bd944,_0x00a5('0x26'));_0x10e077[_0x00a5('0x30')]=_['keys'](_0xdd4979[_0x00a5('0x30')]);_0x10e077[_0x00a5('0x31')]=_['intersection'](_0x10e077['model'],_0x10e077['query']);_0x4ec5bb[_0x00a5('0x32')]=_[_0x00a5('0x33')](_0x10e077[_0x00a5('0x2e')],qs[_0x00a5('0x34')](_0xdd4979[_0x00a5('0x30')][_0x00a5('0x34')]));_0x4ec5bb[_0x00a5('0x32')]=_0x4ec5bb[_0x00a5('0x32')][_0x00a5('0x35')]?_0x4ec5bb['attributes']:_0x10e077[_0x00a5('0x2e')];if(!_0xdd4979[_0x00a5('0x30')]['hasOwnProperty'](_0x00a5('0x36'))){_0x4ec5bb[_0x00a5('0x1f')]=qs[_0x00a5('0x1f')](_0xdd4979['query'][_0x00a5('0x1f')]);_0x4ec5bb[_0x00a5('0x1c')]=qs[_0x00a5('0x1c')](_0xdd4979[_0x00a5('0x30')][_0x00a5('0x1c')]);}_0x4ec5bb[_0x00a5('0x37')]=qs[_0x00a5('0x38')](_0xdd4979[_0x00a5('0x30')][_0x00a5('0x38')]);_0x4ec5bb[_0x00a5('0x39')]=qs[_0x00a5('0x31')](_[_0x00a5('0x3a')](_0xdd4979['query'],_0x10e077[_0x00a5('0x31')]),_0x3bd944);if(_0xdd4979[_0x00a5('0x30')][_0x00a5('0x3b')]){_0x4ec5bb[_0x00a5('0x39')]=_[_0x00a5('0x3c')](_0x4ec5bb[_0x00a5('0x39')],{'$or':_['map'](_0x3bd944,function(_0x54b88f){if(_0x54b88f['type']!=='VIRTUAL'){var _0x425592={};_0x425592[_0x54b88f['name']]={'$like':'%'+_0xdd4979[_0x00a5('0x30')][_0x00a5('0x3b')]+'%'};return _0x425592;}})});}_0x4ec5bb=_[_0x00a5('0x3c')]({},_0x4ec5bb,_0xdd4979[_0x00a5('0x3d')]);var _0x4d303b={'where':_0x4ec5bb[_0x00a5('0x39')]};return db[_0x00a5('0x2a')][_0x00a5('0x1e')](_0x4d303b)[_0x00a5('0x22')](function(_0x550805){_0x2e0b9b[_0x00a5('0x1e')]=_0x550805;if(_0xdd4979[_0x00a5('0x30')]['includeAll']){_0x4ec5bb[_0x00a5('0x3e')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x4ec5bb);})[_0x00a5('0x22')](function(_0x1d193d){_0x2e0b9b['rows']=_0x1d193d;return _0x2e0b9b;})['then'](respondWithFilteredResult(_0x2af313,_0x4ec5bb))[_0x00a5('0x3f')](handleError(_0x2af313,null));};exports[_0x00a5('0x40')]=function(_0x3e8a36,_0x695736){var _0x30cb64={'raw':!![],'where':{'id':_0x3e8a36['params']['id']}},_0x4b20a9={};_0x4b20a9[_0x00a5('0x2e')]=_[_0x00a5('0x41')](db[_0x00a5('0x2a')][_0x00a5('0x42')]);_0x4b20a9[_0x00a5('0x30')]=_[_0x00a5('0x41')](_0x3e8a36['query']);_0x4b20a9[_0x00a5('0x31')]=_[_0x00a5('0x33')](_0x4b20a9['model'],_0x4b20a9['query']);_0x30cb64['attributes']=_[_0x00a5('0x33')](_0x4b20a9[_0x00a5('0x2e')],qs[_0x00a5('0x34')](_0x3e8a36[_0x00a5('0x30')]['fields']));_0x30cb64[_0x00a5('0x32')]=_0x30cb64[_0x00a5('0x32')][_0x00a5('0x35')]?_0x30cb64[_0x00a5('0x32')]:_0x4b20a9[_0x00a5('0x2e')];if(_0x3e8a36[_0x00a5('0x30')][_0x00a5('0x43')]){_0x30cb64[_0x00a5('0x3e')]=[{'all':!![]}];}_0x30cb64=_[_0x00a5('0x3c')]({},_0x30cb64,_0x3e8a36[_0x00a5('0x3d')]);return db[_0x00a5('0x2a')][_0x00a5('0x44')](_0x30cb64)[_0x00a5('0x22')](handleEntityNotFound(_0x695736,null))[_0x00a5('0x22')](respondWithResult(_0x695736,null))[_0x00a5('0x3f')](handleError(_0x695736,null));};exports[_0x00a5('0x45')]=function(_0x502531,_0x4a0b36){return db['SquareOdbc'][_0x00a5('0x45')](_0x502531[_0x00a5('0x46')],{})['then'](function(_0x5682fd){var _0xbad006=_0x502531[_0x00a5('0x47')]['get']({'plain':!![]});if(!_0xbad006)throw new Error(_0x00a5('0x48'));if(_0xbad006[_0x00a5('0x49')]===_0x00a5('0x47')){var _0x90957d=_0x5682fd[_0x00a5('0x4a')]({'plain':!![]});var _0x13a52b=_0x00a5('0x24');return db[_0x00a5('0x4b')][_0x00a5('0x44')]({'where':{'name':_0x13a52b,'userProfileId':_0xbad006[_0x00a5('0x4c')]},'raw':!![]})['then'](function(_0x15dc5c){if(_0x15dc5c&&_0x15dc5c[_0x00a5('0x4d')]===0x0){return db['UserProfileResource'][_0x00a5('0x45')]({'name':_0x90957d['name'],'resourceId':_0x90957d['id'],'type':_0x15dc5c[_0x00a5('0x26')],'sectionId':_0x15dc5c['id']},{})[_0x00a5('0x22')](function(){return _0x5682fd;});}else{return _0x5682fd;}})[_0x00a5('0x3f')](function(_0x3adab7){logger['error'](_0x00a5('0x4e'),_0x3adab7);throw _0x3adab7;});}return _0x5682fd;})[_0x00a5('0x22')](respondWithResult(_0x4a0b36,0xc9))[_0x00a5('0x3f')](handleError(_0x4a0b36,null));};exports[_0x00a5('0x4f')]=function(_0x20b92,_0x2e47cb){if(_0x20b92[_0x00a5('0x46')]['id']){delete _0x20b92[_0x00a5('0x46')]['id'];}return db[_0x00a5('0x2a')][_0x00a5('0x44')]({'where':{'id':_0x20b92[_0x00a5('0x50')]['id']}})[_0x00a5('0x22')](handleEntityNotFound(_0x2e47cb,null))['then'](saveUpdates(_0x20b92[_0x00a5('0x46')],null))['then'](respondWithResult(_0x2e47cb,null))['catch'](handleError(_0x2e47cb,null));};exports[_0x00a5('0x23')]=function(_0x617036,_0x395c84){return db['SquareOdbc'][_0x00a5('0x44')]({'where':{'id':_0x617036[_0x00a5('0x50')]['id']}})['then'](handleEntityNotFound(_0x395c84,null))['then'](removeEntity(_0x395c84,null))['catch'](handleError(_0x395c84,null));};exports[_0x00a5('0x51')]=function(_0x2bac45,_0x494a74,_0x5f2d92){var _0x344e75;return db[_0x00a5('0x2a')][_0x00a5('0x44')]({'where':{'id':_0x2bac45[_0x00a5('0x50')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x494a74,null))[_0x00a5('0x22')](function(_0x3c4417){if(_0x3c4417){var _0x2cbcba=require(_0x00a5('0x52'))();_0x2cbcba[_0x00a5('0x53')](_0x3c4417['dsn']);_0x2cbcba[_0x00a5('0x54')]();return _0x3c4417;}})[_0x00a5('0x22')](respondWithResult(_0x494a74,null))[_0x00a5('0x3f')](handleError(_0x494a74,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0215486..bfca5af 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 _0x3a00=['../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4c52cc,_0x3f219f){var _0x174a12=function(_0x46942e){while(--_0x46942e){_0x4c52cc['push'](_0x4c52cc['shift']());}};_0x174a12(++_0x3f219f);}(_0x3a00,0xfc));var _0x03a0=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x3a00[_0x4169d8];return _0x32084a;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var logger=require(_0x03a0('0x2'))(_0x03a0('0x3'));var moment=require(_0x03a0('0x4'));var BPromise=require(_0x03a0('0x5'));var rp=require(_0x03a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03a0('0x7'));var config=require(_0x03a0('0x8'));var attributes=require(_0x03a0('0x9'));module['exports']=function(_0x1601f4,_0x446865){return _0x1601f4[_0x03a0('0xa')](_0x03a0('0xb'),attributes,{'tableName':_0x03a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbf8=['moment','bluebird','path','rimraf','./squareOdbc.attributes','exports','define','square_odbc','util','../../config/logger','api'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xfbf8,0x1c0));var _0x8fbf=function(_0x5b4623,_0x346444){_0x5b4623=_0x5b4623-0x0;var _0x323ed9=_0xfbf8[_0x5b4623];return _0x323ed9;};'use strict';var _=require('lodash');var util=require(_0x8fbf('0x0'));var logger=require(_0x8fbf('0x1'))(_0x8fbf('0x2'));var moment=require(_0x8fbf('0x3'));var BPromise=require(_0x8fbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fbf('0x5'));var rimraf=require(_0x8fbf('0x6'));var config=require('../../config/environment');var attributes=require(_0x8fbf('0x7'));module[_0x8fbf('0x8')]=function(_0xbfbbed,_0x255558){return _0xbfbbed[_0x8fbf('0x9')]('SquareOdbc',attributes,{'tableName':_0x8fbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index eced494..44fbaea 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 _0xb9ad=['catch','ShowSquareOdbc','find','options','raw','where','attributes','map','model','include','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0xb9ad,0x12a));var _0xdb9a=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb9ad[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xdb9a('0x0'));var moment=require(_0xdb9a('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb9a('0x3'))['db'];var utils=require(_0xdb9a('0x4'));var logger=require(_0xdb9a('0x5'))(_0xdb9a('0x6'));var config=require(_0xdb9a('0x7'));var jayson=require(_0xdb9a('0x8'));var client=jayson[_0xdb9a('0x9')][_0xdb9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2655f2,_0x216a4f,_0x43be6a){return new BPromise(function(_0x515278,_0x3f7a2a){return client[_0xdb9a('0xb')](_0x2655f2,_0x43be6a)[_0xdb9a('0xc')](function(_0x26e286){logger[_0xdb9a('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x216a4f,'request\x20sent');logger[_0xdb9a('0xe')](_0xdb9a('0xf'),_0x216a4f,_0xdb9a('0x10'),JSON[_0xdb9a('0x11')](_0x26e286));if(_0x26e286[_0xdb9a('0x12')]){if(_0x26e286['error'][_0xdb9a('0x13')]===0x1f4){logger[_0xdb9a('0x12')](_0xdb9a('0x14'),_0x216a4f,_0x26e286[_0xdb9a('0x12')]['message']);return _0x3f7a2a(_0x26e286['error'][_0xdb9a('0x15')]);}logger[_0xdb9a('0x12')](_0xdb9a('0x14'),_0x216a4f,_0x26e286['error']['message']);return _0x515278(_0x26e286[_0xdb9a('0x12')]['message']);}else{logger['info'](_0xdb9a('0x14'),_0x216a4f,_0xdb9a('0x10'));_0x515278(_0x26e286['result'][_0xdb9a('0x15')]);}})[_0xdb9a('0x16')](function(_0x5d03a6){logger['error'](_0xdb9a('0x14'),_0x216a4f,_0x5d03a6);_0x3f7a2a(_0x5d03a6);});});}exports[_0xdb9a('0x17')]=function(_0x4e5cde){var _0x495b8e=this;return new Promise(function(_0x3f3ba4,_0x3f6d50){return db['SquareOdbc'][_0xdb9a('0x18')]({'raw':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde[_0xdb9a('0x19')][_0xdb9a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e5cde['options']?_0x4e5cde['options'][_0xdb9a('0x1b')]||null:null,'attributes':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde['options'][_0xdb9a('0x1c')]||null:null,'include':_0x4e5cde[_0xdb9a('0x19')]?_0x4e5cde['options']['include']?_[_0xdb9a('0x1d')](_0x4e5cde['options']['include'],function(_0x1b5b13){return{'model':db[_0x1b5b13[_0xdb9a('0x1e')]],'as':_0x1b5b13['as'],'attributes':_0x1b5b13[_0xdb9a('0x1c')],'include':_0x1b5b13[_0xdb9a('0x1f')]?_['map'](_0x1b5b13['include'],function(_0x1d7c81){return{'model':db[_0x1d7c81[_0xdb9a('0x1e')]],'as':_0x1d7c81['as'],'attributes':_0x1d7c81[_0xdb9a('0x1c')],'include':_0x1d7c81[_0xdb9a('0x1f')]?_[_0xdb9a('0x1d')](_0x1d7c81['include'],function(_0x3bd812){return{'model':db[_0x3bd812[_0xdb9a('0x1e')]],'as':_0x3bd812['as'],'attributes':_0x3bd812[_0xdb9a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523337){logger['info'](_0xdb9a('0x17'),_0x4e5cde);logger[_0xdb9a('0xe')](_0xdb9a('0x17'),_0x4e5cde,JSON[_0xdb9a('0x11')](_0x523337));_0x3f3ba4(_0x523337);})[_0xdb9a('0x16')](function(_0x22b48e){logger['error'](_0xdb9a('0x17'),_0x22b48e['message'],_0x4e5cde);_0x3f6d50(_0x495b8e['error'](0x1f4,_0x22b48e[_0xdb9a('0x15')]));});});}; \ No newline at end of file +var _0x8ed5=['SquareOdbc,\x20%s,\x20%s','message','catch','SquareOdbc','find','options','where','attributes','map','include','model','ShowSquareOdbc','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52195c,_0x342b71){var _0x1bd33f=function(_0x3b0ec5){while(--_0x3b0ec5){_0x52195c['push'](_0x52195c['shift']());}};_0x1bd33f(++_0x342b71);}(_0x8ed5,0x114));var _0x58ed=function(_0x43b948,_0x1f40e8){_0x43b948=_0x43b948-0x0;var _0x26ad08=_0x8ed5[_0x43b948];return _0x26ad08;};'use strict';var _=require(_0x58ed('0x0'));var util=require(_0x58ed('0x1'));var moment=require('moment');var BPromise=require(_0x58ed('0x2'));var rs=require(_0x58ed('0x3'));var fs=require('fs');var Redis=require(_0x58ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58ed('0x5'));var logger=require(_0x58ed('0x6'))(_0x58ed('0x7'));var config=require(_0x58ed('0x8'));var jayson=require(_0x58ed('0x9'));var client=jayson[_0x58ed('0xa')][_0x58ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20c06f,_0x39b158,_0x2cc406){return new BPromise(function(_0x498121,_0x114eba){return client[_0x58ed('0xc')](_0x20c06f,_0x2cc406)[_0x58ed('0xd')](function(_0x41a06e){logger[_0x58ed('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x39b158,_0x58ed('0xf'));logger[_0x58ed('0x10')](_0x58ed('0x11'),_0x39b158,_0x58ed('0xf'),JSON[_0x58ed('0x12')](_0x41a06e));if(_0x41a06e['error']){if(_0x41a06e[_0x58ed('0x13')][_0x58ed('0x14')]===0x1f4){logger[_0x58ed('0x13')](_0x58ed('0x15'),_0x39b158,_0x41a06e[_0x58ed('0x13')][_0x58ed('0x16')]);return _0x114eba(_0x41a06e[_0x58ed('0x13')]['message']);}logger[_0x58ed('0x13')](_0x58ed('0x15'),_0x39b158,_0x41a06e[_0x58ed('0x13')][_0x58ed('0x16')]);return _0x498121(_0x41a06e[_0x58ed('0x13')][_0x58ed('0x16')]);}else{logger[_0x58ed('0xe')](_0x58ed('0x15'),_0x39b158,'request\x20sent');_0x498121(_0x41a06e['result'][_0x58ed('0x16')]);}})[_0x58ed('0x17')](function(_0x38754b){logger[_0x58ed('0x13')](_0x58ed('0x15'),_0x39b158,_0x38754b);_0x114eba(_0x38754b);});});}exports['ShowSquareOdbc']=function(_0x2aa911){var _0x44dabb=this;return new Promise(function(_0x3c0932,_0x19f5f9){return db[_0x58ed('0x18')][_0x58ed('0x19')]({'raw':_0x2aa911['options']?_0x2aa911['options']['raw']===undefined?!![]:![]:!![],'where':_0x2aa911[_0x58ed('0x1a')]?_0x2aa911[_0x58ed('0x1a')][_0x58ed('0x1b')]||null:null,'attributes':_0x2aa911[_0x58ed('0x1a')]?_0x2aa911[_0x58ed('0x1a')][_0x58ed('0x1c')]||null:null,'include':_0x2aa911[_0x58ed('0x1a')]?_0x2aa911['options']['include']?_[_0x58ed('0x1d')](_0x2aa911[_0x58ed('0x1a')][_0x58ed('0x1e')],function(_0x3b37fe){return{'model':db[_0x3b37fe[_0x58ed('0x1f')]],'as':_0x3b37fe['as'],'attributes':_0x3b37fe[_0x58ed('0x1c')],'include':_0x3b37fe[_0x58ed('0x1e')]?_['map'](_0x3b37fe[_0x58ed('0x1e')],function(_0x9a32aa){return{'model':db[_0x9a32aa[_0x58ed('0x1f')]],'as':_0x9a32aa['as'],'attributes':_0x9a32aa[_0x58ed('0x1c')],'include':_0x9a32aa[_0x58ed('0x1e')]?_['map'](_0x9a32aa['include'],function(_0x4ffbda){return{'model':db[_0x4ffbda[_0x58ed('0x1f')]],'as':_0x4ffbda['as'],'attributes':_0x4ffbda[_0x58ed('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x345c2c){logger[_0x58ed('0xe')]('ShowSquareOdbc',_0x2aa911);logger[_0x58ed('0x10')](_0x58ed('0x20'),_0x2aa911,JSON['stringify'](_0x345c2c));_0x3c0932(_0x345c2c);})['catch'](function(_0x2958f3){logger[_0x58ed('0x13')](_0x58ed('0x20'),_0x2958f3[_0x58ed('0x16')],_0x2aa911);_0x19f5f9(_0x44dabb[_0x58ed('0x13')](0x1f4,_0x2958f3[_0x58ed('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e62d4d6..f1f9305 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 _0x3895=['create','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated'];(function(_0x17c487,_0x2b72f1){var _0x3feeb8=function(_0x49aaa1){while(--_0x49aaa1){_0x17c487['push'](_0x17c487['shift']());}};_0x3feeb8(++_0x2b72f1);}(_0x3895,0x102));var _0x5389=function(_0x13706f,_0x503c3f){_0x13706f=_0x13706f-0x0;var _0x5959a0=_0x3895[_0x13706f];return _0x5959a0;};'use strict';var multer=require(_0x5389('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5389('0x1'));var express=require('express');var router=express[_0x5389('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5389('0x3'));var interaction=require(_0x5389('0x4'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x5389('0x5')]('/',auth['isAuthenticated'](),controller[_0x5389('0x6')]);router[_0x5389('0x5')]('/:id',auth[_0x5389('0x7')](),controller['show']);router['post']('/',auth[_0x5389('0x7')](),controller[_0x5389('0x8')]);router['put'](_0x5389('0x9'),auth['isAuthenticated'](),controller[_0x5389('0xa')]);router[_0x5389('0xb')](_0x5389('0x9'),auth['isAuthenticated'](),controller[_0x5389('0xc')]);module[_0x5389('0xd')]=router; \ No newline at end of file +var _0xc205=['get','isAuthenticated','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xc205,0xff));var _0x5c20=function(_0x1bf252,_0x2d0fac){_0x1bf252=_0x1bf252-0x0;var _0x4511f7=_0xc205[_0x1bf252];return _0x4511f7;};'use strict';var multer=require(_0x5c20('0x0'));var util=require(_0x5c20('0x1'));var path=require(_0x5c20('0x2'));var timeout=require(_0x5c20('0x3'));var express=require(_0x5c20('0x4'));var router=express[_0x5c20('0x5')]();var fs_extra=require(_0x5c20('0x6'));var auth=require(_0x5c20('0x7'));var interaction=require(_0x5c20('0x8'));var config=require(_0x5c20('0x9'));var controller=require(_0x5c20('0xa'));router[_0x5c20('0xb')]('/',auth[_0x5c20('0xc')](),controller['index']);router[_0x5c20('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5c20('0xd')]('/',auth[_0x5c20('0xc')](),controller['create']);router[_0x5c20('0xe')](_0x5c20('0xf'),auth['isAuthenticated'](),controller[_0x5c20('0x10')]);router[_0x5c20('0x11')]('/:id',auth[_0x5c20('0xc')](),controller['destroy']);module[_0x5c20('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7fef578..c321bd3 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 _0xfbfc=['toString','DATE','sequelize','STRING','name','TEXT','BLOB','preproduction','getDataValue','utf8','long','production'];(function(_0x3a86a7,_0x12ade0){var _0x19b1b6=function(_0x2af9d0){while(--_0x2af9d0){_0x3a86a7['push'](_0x3a86a7['shift']());}};_0x19b1b6(++_0x12ade0);}(_0xfbfc,0x1be));var _0xcfbf=function(_0x4e1750,_0x4f7f3c){_0x4e1750=_0x4e1750-0x0;var _0x5ab29f=_0xfbfc[_0x4e1750];return _0x5ab29f;};'use strict';var Sequelize=require(_0xcfbf('0x0'));module['exports']={'name':{'type':Sequelize[_0xcfbf('0x1')],'unique':_0xcfbf('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcfbf('0x1')]},'notes':{'type':Sequelize[_0xcfbf('0x3')]},'preproduction':{'type':Sequelize[_0xcfbf('0x4')]('long'),'get':function(){if(this['getDataValue'](_0xcfbf('0x5'))){return this[_0xcfbf('0x6')](_0xcfbf('0x5'))['toString'](_0xcfbf('0x7'));}}},'production':{'type':Sequelize[_0xcfbf('0x4')](_0xcfbf('0x8')),'get':function(){if(this[_0xcfbf('0x6')](_0xcfbf('0x9'))){return this['getDataValue'](_0xcfbf('0x9'))[_0xcfbf('0xa')](_0xcfbf('0x7'));}}},'savedAt':{'type':Sequelize[_0xcfbf('0xb')]},'publishedAt':{'type':Sequelize[_0xcfbf('0xb')]}}; \ No newline at end of file +var _0xc77b=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','TEXT','BLOB'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc77b,0x187));var _0xbc77=function(_0x468677,_0x315246){_0x468677=_0x468677-0x0;var _0x1a666a=_0xc77b[_0x468677];return _0x1a666a;};'use strict';var Sequelize=require(_0xbc77('0x0'));module[_0xbc77('0x1')]={'name':{'type':Sequelize[_0xbc77('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbc77('0x2')]},'notes':{'type':Sequelize[_0xbc77('0x3')]},'preproduction':{'type':Sequelize[_0xbc77('0x4')](_0xbc77('0x5')),'get':function(){if(this[_0xbc77('0x6')](_0xbc77('0x7'))){return this[_0xbc77('0x6')](_0xbc77('0x7'))[_0xbc77('0x8')](_0xbc77('0x9'));}}},'production':{'type':Sequelize[_0xbc77('0x4')](_0xbc77('0x5')),'get':function(){if(this[_0xbc77('0x6')](_0xbc77('0xa'))){return this[_0xbc77('0x6')]('production')[_0xbc77('0x8')](_0xbc77('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xbc77('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ad1b056..025acb5 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 _0xdeeb=['map','query','keys','filters','attributes','intersection','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','fields','find','create','role','user','autoAssociation','UserProfileResource','body','get','stringify','params','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','json','undefined','limit','offset','count','status','set','Content-Range','destroy','SquareProjects','then','publish','agi','error','stack','name','send','SquareProject','rawAttributes','fieldName','key'];(function(_0x5a6a82,_0x21de5a){var _0x24773d=function(_0x9c41da){while(--_0x9c41da){_0x5a6a82['push'](_0x5a6a82['shift']());}};_0x24773d(++_0x21de5a);}(_0xdeeb,0x64));var _0xbdee=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xdeeb[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0xbdee('0x0'));var Redis=require(_0xbdee('0x1'));var qs=require(_0xbdee('0x2'));var logger=require('../../config/logger')('api');var config=require(_0xbdee('0x3'));var db=require(_0xbdee('0x4'))['db'];config[_0xbdee('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbdee('0x6'))(new Redis(config['redis']));require(_0xbdee('0x7'))[_0xbdee('0x8')](socket);function respondWithResult(_0x44fe95,_0x72f1b4){_0x72f1b4=_0x72f1b4||0xc8;return function(_0x6e4263){if(_0x6e4263){return _0x44fe95['status'](_0x72f1b4)[_0xbdee('0x9')](_0x6e4263);}};}function respondWithFilteredResult(_0x269324,_0x2af846){return function(_0x33afad){if(_0x33afad){var _0x196f99=typeof _0x2af846['offset']===_0xbdee('0xa')&&typeof _0x2af846[_0xbdee('0xb')]==='undefined';var _0x3e1758=_0x33afad['count'];var _0x18b1b9=_0x196f99?0x0:_0x2af846[_0xbdee('0xc')];var _0xa39f89=_0x196f99?_0x33afad[_0xbdee('0xd')]:_0x2af846[_0xbdee('0xc')]+_0x2af846[_0xbdee('0xb')];var _0xc80523;if(_0xa39f89>=_0x3e1758){_0xa39f89=_0x3e1758;_0xc80523=0xc8;}else{_0xc80523=0xce;}_0x269324[_0xbdee('0xe')](_0xc80523);return _0x269324[_0xbdee('0xf')](_0xbdee('0x10'),_0x18b1b9+'-'+_0xa39f89+'/'+_0x3e1758)['json'](_0x33afad);}return null;};}function saveUpdates(_0x3b3be8){return function(_0x35ddec){if(_0x35ddec){return _0x35ddec['update'](_0x3b3be8)['then'](function(_0x3846c2){return _0x3846c2;});}return null;};}function removeEntity(_0x58d7d7){return function(_0x28e4c5){if(_0x28e4c5){return _0x28e4c5[_0xbdee('0x11')]()['then'](function(){var _0x102f8c=_0x28e4c5['get']({'plain':!![]});var _0x40f185=_0xbdee('0x12');return db['UserProfileResource'][_0xbdee('0x11')]({'where':{'type':_0x40f185,'resourceId':_0x102f8c['id']}})[_0xbdee('0x13')](function(){return _0x28e4c5;});})[_0xbdee('0x13')](function(){var _0x5f5d55=new Redis(config[_0xbdee('0x5')]);_0x5f5d55[_0xbdee('0x14')](_0xbdee('0x15'),JSON['stringify']({'id':_0x28e4c5['id'],'deleted':!![]}));})[_0xbdee('0x13')](function(){_0x58d7d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad649){return function(_0x1469c1){if(!_0x1469c1){_0x4ad649['sendStatus'](0x194);}return _0x1469c1;};}function handleError(_0x1b2bf3,_0x39362a){_0x39362a=_0x39362a||0x1f4;return function(_0x2208bc){logger[_0xbdee('0x16')](_0x2208bc[_0xbdee('0x17')]);if(_0x2208bc[_0xbdee('0x18')]){delete _0x2208bc[_0xbdee('0x18')];}_0x1b2bf3[_0xbdee('0xe')](_0x39362a)[_0xbdee('0x19')](_0x2208bc);};}exports['index']=function(_0x5e8ca9,_0x2fb413){var _0x5880f1={},_0x225c9b={},_0x471fef={'count':0x0,'rows':[]};var _0x3a72e5=_['map'](db[_0xbdee('0x1a')][_0xbdee('0x1b')],function(_0x2efb7b){return{'name':_0x2efb7b[_0xbdee('0x1c')],'type':_0x2efb7b['type'][_0xbdee('0x1d')]};});_0x225c9b['model']=_[_0xbdee('0x1e')](_0x3a72e5,_0xbdee('0x18'));_0x225c9b[_0xbdee('0x1f')]=_[_0xbdee('0x20')](_0x5e8ca9[_0xbdee('0x1f')]);_0x225c9b[_0xbdee('0x21')]=_['intersection'](_0x225c9b['model'],_0x225c9b[_0xbdee('0x1f')]);_0x5880f1[_0xbdee('0x22')]=_[_0xbdee('0x23')](_0x225c9b['model'],qs['fields'](_0x5e8ca9[_0xbdee('0x1f')]['fields']));_0x5880f1[_0xbdee('0x22')]=_0x5880f1[_0xbdee('0x22')][_0xbdee('0x24')]?_0x5880f1[_0xbdee('0x22')]:_0x225c9b[_0xbdee('0x25')];if(!_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x26')](_0xbdee('0x27'))){_0x5880f1[_0xbdee('0xb')]=qs['limit'](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0xb')]);_0x5880f1['offset']=qs['offset'](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0xc')]);}_0x5880f1[_0xbdee('0x28')]=qs[_0xbdee('0x29')](_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x29')]);_0x5880f1['where']=qs[_0xbdee('0x21')](_[_0xbdee('0x2a')](_0x5e8ca9['query'],_0x225c9b['filters']),_0x3a72e5);if(_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x2b')]){_0x5880f1[_0xbdee('0x2c')]=_[_0xbdee('0x2d')](_0x5880f1[_0xbdee('0x2c')],{'$or':_['map'](_0x3a72e5,function(_0x771e3b){if(_0x771e3b[_0xbdee('0x2e')]!==_0xbdee('0x2f')){var _0x1c30dd={};_0x1c30dd[_0x771e3b[_0xbdee('0x18')]]={'$like':'%'+_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x2b')]+'%'};return _0x1c30dd;}})});}_0x5880f1=_[_0xbdee('0x2d')]({},_0x5880f1,_0x5e8ca9[_0xbdee('0x30')]);var _0x2d88ee={'where':_0x5880f1[_0xbdee('0x2c')]};return db[_0xbdee('0x1a')][_0xbdee('0xd')](_0x2d88ee)[_0xbdee('0x13')](function(_0x476b36){_0x471fef[_0xbdee('0xd')]=_0x476b36;if(_0x5e8ca9[_0xbdee('0x1f')][_0xbdee('0x31')]){_0x5880f1[_0xbdee('0x32')]=[{'all':!![]}];}return db[_0xbdee('0x1a')][_0xbdee('0x33')](_0x5880f1);})[_0xbdee('0x13')](function(_0x297352){_0x471fef[_0xbdee('0x34')]=_0x297352;return _0x471fef;})[_0xbdee('0x13')](respondWithFilteredResult(_0x2fb413,_0x5880f1))[_0xbdee('0x35')](handleError(_0x2fb413,null));};exports['show']=function(_0x233eb3,_0x3270c5){var _0x75f279={'raw':![],'where':{'id':_0x233eb3['params']['id']}},_0x517470={};_0x517470[_0xbdee('0x25')]=_[_0xbdee('0x20')](db[_0xbdee('0x1a')][_0xbdee('0x1b')]);_0x517470['query']=_[_0xbdee('0x20')](_0x233eb3[_0xbdee('0x1f')]);_0x517470[_0xbdee('0x21')]=_[_0xbdee('0x23')](_0x517470[_0xbdee('0x25')],_0x517470[_0xbdee('0x1f')]);_0x75f279[_0xbdee('0x22')]=_[_0xbdee('0x23')](_0x517470[_0xbdee('0x25')],qs[_0xbdee('0x36')](_0x233eb3[_0xbdee('0x1f')][_0xbdee('0x36')]));_0x75f279[_0xbdee('0x22')]=_0x75f279[_0xbdee('0x22')][_0xbdee('0x24')]?_0x75f279[_0xbdee('0x22')]:_0x517470[_0xbdee('0x25')];if(_0x233eb3[_0xbdee('0x1f')][_0xbdee('0x31')]){_0x75f279['include']=[{'all':!![]}];}_0x75f279=_[_0xbdee('0x2d')]({},_0x75f279,_0x233eb3[_0xbdee('0x30')]);return db[_0xbdee('0x1a')][_0xbdee('0x37')](_0x75f279)['then'](handleEntityNotFound(_0x3270c5,null))['then'](respondWithResult(_0x3270c5,null))[_0xbdee('0x35')](handleError(_0x3270c5,null));};exports['create']=function(_0x5fe40c,_0x4ec058){return db[_0xbdee('0x1a')][_0xbdee('0x38')](_0x5fe40c['body'],{})['then'](function(_0x64ee65){var _0x1fc26c=_0x5fe40c['user']['get']({'plain':!![]});if(!_0x1fc26c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fc26c[_0xbdee('0x39')]===_0xbdee('0x3a')){var _0x4c05c4=_0x64ee65['get']({'plain':!![]});var _0x551ceb=_0xbdee('0x12');return db['UserProfileSection']['find']({'where':{'name':_0x551ceb,'userProfileId':_0x1fc26c['userProfileId']},'raw':!![]})['then'](function(_0x389ab2){if(_0x389ab2&&_0x389ab2[_0xbdee('0x3b')]===0x0){return db[_0xbdee('0x3c')]['create']({'name':_0x4c05c4[_0xbdee('0x18')],'resourceId':_0x4c05c4['id'],'type':_0x389ab2[_0xbdee('0x18')],'sectionId':_0x389ab2['id']},{})[_0xbdee('0x13')](function(){return _0x64ee65;});}else{return _0x64ee65;}})[_0xbdee('0x35')](function(_0x4c8670){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c8670);throw _0x4c8670;});}return _0x64ee65;})[_0xbdee('0x13')](respondWithResult(_0x4ec058,0xc9))['catch'](handleError(_0x4ec058,null));};exports['update']=function(_0x4213bf,_0x238a85){if(_0x4213bf[_0xbdee('0x3d')]['id']){delete _0x4213bf[_0xbdee('0x3d')]['id'];}return db[_0xbdee('0x1a')]['find']({'where':{'id':_0x4213bf['params']['id']}})[_0xbdee('0x13')](handleEntityNotFound(_0x238a85,null))[_0xbdee('0x13')](saveUpdates(_0x4213bf['body'],null))['then'](function(_0x2558fa){if(!_0x2558fa)return;var _0x5606be=_0x2558fa[_0xbdee('0x3e')]({'plain':!![]});return _0x5606be;})['then'](function(_0xf0cc4a){var _0x4f186b=new Redis(config[_0xbdee('0x5')]);_0x4f186b[_0xbdee('0x14')]('agi',JSON[_0xbdee('0x3f')](_[_0xbdee('0x2a')](_0xf0cc4a,['id',_0xbdee('0x18'),'production'])));return _0xf0cc4a;})[_0xbdee('0x13')](respondWithResult(_0x238a85,null))[_0xbdee('0x35')](handleError(_0x238a85,null));};exports[_0xbdee('0x11')]=function(_0x5d1cda,_0x1c63dc){return db[_0xbdee('0x1a')][_0xbdee('0x37')]({'where':{'id':_0x5d1cda[_0xbdee('0x40')]['id']}})[_0xbdee('0x13')](handleEntityNotFound(_0x1c63dc,null))[_0xbdee('0x13')](removeEntity(_0x1c63dc,null))[_0xbdee('0x35')](handleError(_0x1c63dc,null));}; \ No newline at end of file +var _0xc777=['stringify','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','findAll','show','fields','length','includeAll','find','catch','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','params','lodash','../../components/parsers/qs','../../config/logger','api','redis','localhost','./squareProject.socket','register','status','json','offset','undefined','limit','count','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xc777,0x125));var _0x7c77=function(_0x328dc7,_0x14f1e1){_0x328dc7=_0x328dc7-0x0;var _0x5bb0d9=_0xc777[_0x328dc7];return _0x5bb0d9;};'use strict';var _=require(_0x7c77('0x0'));var Redis=require('ioredis');var qs=require(_0x7c77('0x1'));var logger=require(_0x7c77('0x2'))(_0x7c77('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7c77('0x4')]=_['defaults'](config[_0x7c77('0x4')],{'host':_0x7c77('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c77('0x4')]));require(_0x7c77('0x6'))[_0x7c77('0x7')](socket);function respondWithResult(_0x77aeb1,_0x3b774f){_0x3b774f=_0x3b774f||0xc8;return function(_0x40f0dc){if(_0x40f0dc){return _0x77aeb1[_0x7c77('0x8')](_0x3b774f)[_0x7c77('0x9')](_0x40f0dc);}};}function respondWithFilteredResult(_0x58a09f,_0x2ccffa){return function(_0x3335f9){if(_0x3335f9){var _0x5b3b5d=typeof _0x2ccffa[_0x7c77('0xa')]===_0x7c77('0xb')&&typeof _0x2ccffa[_0x7c77('0xc')]===_0x7c77('0xb');var _0x3e1e40=_0x3335f9[_0x7c77('0xd')];var _0x934ade=_0x5b3b5d?0x0:_0x2ccffa[_0x7c77('0xa')];var _0x50b4e7=_0x5b3b5d?_0x3335f9[_0x7c77('0xd')]:_0x2ccffa[_0x7c77('0xa')]+_0x2ccffa[_0x7c77('0xc')];var _0x2a44ea;if(_0x50b4e7>=_0x3e1e40){_0x50b4e7=_0x3e1e40;_0x2a44ea=0xc8;}else{_0x2a44ea=0xce;}_0x58a09f[_0x7c77('0x8')](_0x2a44ea);return _0x58a09f['set']('Content-Range',_0x934ade+'-'+_0x50b4e7+'/'+_0x3e1e40)[_0x7c77('0x9')](_0x3335f9);}return null;};}function saveUpdates(_0x39ac9d){return function(_0x40a9a9){if(_0x40a9a9){return _0x40a9a9[_0x7c77('0xe')](_0x39ac9d)[_0x7c77('0xf')](function(_0x12429e){return _0x12429e;});}return null;};}function removeEntity(_0x245fd3){return function(_0x1852ea){if(_0x1852ea){return _0x1852ea[_0x7c77('0x10')]()[_0x7c77('0xf')](function(){var _0x423fc6=_0x1852ea[_0x7c77('0x11')]({'plain':!![]});var _0x577e02=_0x7c77('0x12');return db[_0x7c77('0x13')][_0x7c77('0x10')]({'where':{'type':_0x577e02,'resourceId':_0x423fc6['id']}})['then'](function(){return _0x1852ea;});})[_0x7c77('0xf')](function(){var _0x381170=new Redis(config[_0x7c77('0x4')]);_0x381170[_0x7c77('0x14')](_0x7c77('0x15'),JSON[_0x7c77('0x16')]({'id':_0x1852ea['id'],'deleted':!![]}));})[_0x7c77('0xf')](function(){_0x245fd3[_0x7c77('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299cf4){return function(_0x3584ea){if(!_0x3584ea){_0x299cf4[_0x7c77('0x17')](0x194);}return _0x3584ea;};}function handleError(_0x4bc6c3,_0x1b3705){_0x1b3705=_0x1b3705||0x1f4;return function(_0x3a4fb3){logger[_0x7c77('0x18')](_0x3a4fb3[_0x7c77('0x19')]);if(_0x3a4fb3[_0x7c77('0x1a')]){delete _0x3a4fb3[_0x7c77('0x1a')];}_0x4bc6c3[_0x7c77('0x8')](_0x1b3705)['send'](_0x3a4fb3);};}exports[_0x7c77('0x1b')]=function(_0x27281d,_0x4b73e4){var _0x4c1224={},_0x3cb194={},_0x390b92={'count':0x0,'rows':[]};var _0x237e6f=_[_0x7c77('0x1c')](db[_0x7c77('0x1d')][_0x7c77('0x1e')],function(_0x3e8816){return{'name':_0x3e8816['fieldName'],'type':_0x3e8816[_0x7c77('0x1f')][_0x7c77('0x20')]};});_0x3cb194[_0x7c77('0x21')]=_[_0x7c77('0x1c')](_0x237e6f,_0x7c77('0x1a'));_0x3cb194['query']=_[_0x7c77('0x22')](_0x27281d['query']);_0x3cb194[_0x7c77('0x23')]=_[_0x7c77('0x24')](_0x3cb194[_0x7c77('0x21')],_0x3cb194['query']);_0x4c1224['attributes']=_[_0x7c77('0x24')](_0x3cb194[_0x7c77('0x21')],qs['fields'](_0x27281d[_0x7c77('0x25')]['fields']));_0x4c1224[_0x7c77('0x26')]=_0x4c1224[_0x7c77('0x26')]['length']?_0x4c1224[_0x7c77('0x26')]:_0x3cb194['model'];if(!_0x27281d[_0x7c77('0x25')][_0x7c77('0x27')](_0x7c77('0x28'))){_0x4c1224['limit']=qs[_0x7c77('0xc')](_0x27281d['query'][_0x7c77('0xc')]);_0x4c1224['offset']=qs[_0x7c77('0xa')](_0x27281d[_0x7c77('0x25')][_0x7c77('0xa')]);}_0x4c1224[_0x7c77('0x29')]=qs['sort'](_0x27281d['query']['sort']);_0x4c1224[_0x7c77('0x2a')]=qs[_0x7c77('0x23')](_[_0x7c77('0x2b')](_0x27281d[_0x7c77('0x25')],_0x3cb194[_0x7c77('0x23')]),_0x237e6f);if(_0x27281d[_0x7c77('0x25')]['filter']){_0x4c1224[_0x7c77('0x2a')]=_[_0x7c77('0x2c')](_0x4c1224['where'],{'$or':_[_0x7c77('0x1c')](_0x237e6f,function(_0x109d57){if(_0x109d57[_0x7c77('0x1f')]!==_0x7c77('0x2d')){var _0x125ba2={};_0x125ba2[_0x109d57[_0x7c77('0x1a')]]={'$like':'%'+_0x27281d[_0x7c77('0x25')][_0x7c77('0x2e')]+'%'};return _0x125ba2;}})});}_0x4c1224=_[_0x7c77('0x2c')]({},_0x4c1224,_0x27281d[_0x7c77('0x2f')]);var _0x15b580={'where':_0x4c1224[_0x7c77('0x2a')]};return db[_0x7c77('0x1d')][_0x7c77('0xd')](_0x15b580)[_0x7c77('0xf')](function(_0x5b756b){_0x390b92['count']=_0x5b756b;if(_0x27281d[_0x7c77('0x25')]['includeAll']){_0x4c1224['include']=[{'all':!![]}];}return db['SquareProject'][_0x7c77('0x30')](_0x4c1224);})[_0x7c77('0xf')](function(_0x17f8ae){_0x390b92['rows']=_0x17f8ae;return _0x390b92;})['then'](respondWithFilteredResult(_0x4b73e4,_0x4c1224))['catch'](handleError(_0x4b73e4,null));};exports[_0x7c77('0x31')]=function(_0x34a38d,_0x3d6852){var _0x58328b={'raw':![],'where':{'id':_0x34a38d['params']['id']}},_0x28a1a4={};_0x28a1a4[_0x7c77('0x21')]=_[_0x7c77('0x22')](db[_0x7c77('0x1d')][_0x7c77('0x1e')]);_0x28a1a4[_0x7c77('0x25')]=_[_0x7c77('0x22')](_0x34a38d[_0x7c77('0x25')]);_0x28a1a4[_0x7c77('0x23')]=_[_0x7c77('0x24')](_0x28a1a4[_0x7c77('0x21')],_0x28a1a4[_0x7c77('0x25')]);_0x58328b[_0x7c77('0x26')]=_[_0x7c77('0x24')](_0x28a1a4[_0x7c77('0x21')],qs['fields'](_0x34a38d[_0x7c77('0x25')][_0x7c77('0x32')]));_0x58328b[_0x7c77('0x26')]=_0x58328b[_0x7c77('0x26')][_0x7c77('0x33')]?_0x58328b[_0x7c77('0x26')]:_0x28a1a4[_0x7c77('0x21')];if(_0x34a38d[_0x7c77('0x25')][_0x7c77('0x34')]){_0x58328b['include']=[{'all':!![]}];}_0x58328b=_['merge']({},_0x58328b,_0x34a38d[_0x7c77('0x2f')]);return db[_0x7c77('0x1d')][_0x7c77('0x35')](_0x58328b)['then'](handleEntityNotFound(_0x3d6852,null))[_0x7c77('0xf')](respondWithResult(_0x3d6852,null))[_0x7c77('0x36')](handleError(_0x3d6852,null));};exports[_0x7c77('0x37')]=function(_0xeb9928,_0x36239f){return db['SquareProject'][_0x7c77('0x37')](_0xeb9928[_0x7c77('0x38')],{})[_0x7c77('0xf')](function(_0xb1c277){var _0x1c0443=_0xeb9928[_0x7c77('0x39')][_0x7c77('0x11')]({'plain':!![]});if(!_0x1c0443)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c0443[_0x7c77('0x3a')]===_0x7c77('0x39')){var _0x2a2977=_0xb1c277[_0x7c77('0x11')]({'plain':!![]});var _0xbbe483=_0x7c77('0x12');return db[_0x7c77('0x3b')][_0x7c77('0x35')]({'where':{'name':_0xbbe483,'userProfileId':_0x1c0443['userProfileId']},'raw':!![]})[_0x7c77('0xf')](function(_0x5d1abd){if(_0x5d1abd&&_0x5d1abd['autoAssociation']===0x0){return db[_0x7c77('0x13')][_0x7c77('0x37')]({'name':_0x2a2977[_0x7c77('0x1a')],'resourceId':_0x2a2977['id'],'type':_0x5d1abd[_0x7c77('0x1a')],'sectionId':_0x5d1abd['id']},{})[_0x7c77('0xf')](function(){return _0xb1c277;});}else{return _0xb1c277;}})['catch'](function(_0x4ddaea){logger[_0x7c77('0x18')](_0x7c77('0x3c'),_0x4ddaea);throw _0x4ddaea;});}return _0xb1c277;})[_0x7c77('0xf')](respondWithResult(_0x36239f,0xc9))[_0x7c77('0x36')](handleError(_0x36239f,null));};exports['update']=function(_0x1b987b,_0x56a557){if(_0x1b987b[_0x7c77('0x38')]['id']){delete _0x1b987b['body']['id'];}return db[_0x7c77('0x1d')][_0x7c77('0x35')]({'where':{'id':_0x1b987b['params']['id']}})[_0x7c77('0xf')](handleEntityNotFound(_0x56a557,null))[_0x7c77('0xf')](saveUpdates(_0x1b987b[_0x7c77('0x38')],null))[_0x7c77('0xf')](function(_0x22e87c){if(!_0x22e87c)return;var _0xea8cee=_0x22e87c[_0x7c77('0x11')]({'plain':!![]});return _0xea8cee;})[_0x7c77('0xf')](function(_0x2c0643){var _0x1d92e3=new Redis(config[_0x7c77('0x4')]);_0x1d92e3[_0x7c77('0x14')](_0x7c77('0x15'),JSON[_0x7c77('0x16')](_[_0x7c77('0x2b')](_0x2c0643,['id','name',_0x7c77('0x3d')])));return _0x2c0643;})[_0x7c77('0xf')](respondWithResult(_0x56a557,null))[_0x7c77('0x36')](handleError(_0x56a557,null));};exports[_0x7c77('0x10')]=function(_0xb0278d,_0x508424){return db[_0x7c77('0x1d')][_0x7c77('0x35')]({'where':{'id':_0xb0278d[_0x7c77('0x3e')]['id']}})[_0x7c77('0xf')](handleEntityNotFound(_0x508424,null))[_0x7c77('0xf')](removeEntity(_0x508424,null))['catch'](handleError(_0x508424,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 362748f..8458a66 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 _0x8daa=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x92485e,_0xc66c99){var _0x5bdbe2=function(_0x2410d9){while(--_0x2410d9){_0x92485e['push'](_0x92485e['shift']());}};_0x5bdbe2(++_0xc66c99);}(_0x8daa,0xe2));var _0xa8da=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0x8daa[_0x132558];return _0x34f138;};'use strict';var EventEmitter=require(_0xa8da('0x0'));var SquareProject=require(_0xa8da('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa8da('0x2')](0x0);var events={'afterCreate':_0xa8da('0x3'),'afterUpdate':_0xa8da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d8389){return function(_0x2949af,_0x50ccba,_0x22475b){SquareProjectEvents[_0xa8da('0x5')](_0x2d8389+':'+_0x2949af['id'],_0x2949af);SquareProjectEvents[_0xa8da('0x5')](_0x2d8389,_0x2949af);_0x22475b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xa8da('0x6')](e,emitEvent(event));}}module[_0xa8da('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x0e4d=['../../mysqldb','SquareProject','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0e4d,0xf7));var _0xd0e4=function(_0x174b0a,_0x4bf490){_0x174b0a=_0x174b0a-0x0;var _0x1d288b=_0x0e4d[_0x174b0a];return _0x1d288b;};'use strict';var EventEmitter=require(_0xd0e4('0x0'));var SquareProject=require(_0xd0e4('0x1'))['db'][_0xd0e4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd0e4('0x3'),'afterDestroy':_0xd0e4('0x4')};function emitEvent(_0x29d459){return function(_0x2a9dbb,_0x56c53b,_0x517606){SquareProjectEvents[_0xd0e4('0x5')](_0x29d459+':'+_0x2a9dbb['id'],_0x2a9dbb);SquareProjectEvents[_0xd0e4('0x5')](_0x29d459,_0x2a9dbb);_0x517606(null);};}for(var e in events){if(events[_0xd0e4('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xd0e4('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 8fdd10c..0ac8fb4 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 _0xa62d=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','SquareProject','square_projects','changed'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0xa62d,0x1b6));var _0xda62=function(_0xa3b47a,_0x17c744){_0xa3b47a=_0xa3b47a-0x0;var _0xd57826=_0xa62d[_0xa3b47a];return _0xd57826;};'use strict';var _=require(_0xda62('0x0'));var util=require(_0xda62('0x1'));var logger=require(_0xda62('0x2'))(_0xda62('0x3'));var moment=require(_0xda62('0x4'));var BPromise=require(_0xda62('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda62('0x6'));var rimraf=require(_0xda62('0x7'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xda62('0x8')]=function(_0x44a3b4,_0x353f50){return _0x44a3b4['define'](_0xda62('0x9'),attributes,{'tableName':_0xda62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2834eb,_0x38fa9d,_0x8481a1){if(_0x2834eb[_0xda62('0xb')](_0xda62('0xc'))){_0x2834eb[_0xda62('0xd')]=moment()[_0xda62('0xe')](_0xda62('0xf'));}if(_0x2834eb[_0xda62('0xb')](_0xda62('0x10'))){_0x2834eb[_0xda62('0x11')]=moment()['format'](_0xda62('0xf'));}_0x8481a1(null,_0x2834eb);}}});}; \ No newline at end of file +var _0x3884=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3884,0x77));var _0x4388=function(_0x5eaa8a,_0x396d27){_0x5eaa8a=_0x5eaa8a-0x0;var _0x558bc8=_0x3884[_0x5eaa8a];return _0x558bc8;};'use strict';var _=require('lodash');var util=require(_0x4388('0x0'));var logger=require(_0x4388('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4388('0x2'));var rp=require(_0x4388('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4388('0x4'));var config=require(_0x4388('0x5'));var attributes=require(_0x4388('0x6'));module[_0x4388('0x7')]=function(_0x1523a6,_0x25b3c8){return _0x1523a6[_0x4388('0x8')](_0x4388('0x9'),attributes,{'tableName':_0x4388('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e1d27,_0xd9e9d9,_0x2254f1){if(_0x3e1d27[_0x4388('0xb')](_0x4388('0xc'))){_0x3e1d27[_0x4388('0xd')]=moment()[_0x4388('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e1d27[_0x4388('0xb')]('production')){_0x3e1d27[_0x4388('0xf')]=moment()[_0x4388('0xe')](_0x4388('0x10'));}_0x2254f1(null,_0x3e1d27);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b1347b8..fc83b4b 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 _0xdb9d=['SquareProject','findAll','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','catch','message','error','where','ShowSquareProject','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects'];(function(_0x1d02eb,_0x525276){var _0x38f5eb=function(_0x1e8fa4){while(--_0x1e8fa4){_0x1d02eb['push'](_0x1d02eb['shift']());}};_0x38f5eb(++_0x525276);}(_0xdb9d,0xc6));var _0xddb9=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0xdb9d[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0xddb9('0x0'));var Redis=require(_0xddb9('0x1'));var db=require(_0xddb9('0x2'))['db'];var logger=require(_0xddb9('0x3'))('rpc');var config=require(_0xddb9('0x4'));config[_0xddb9('0x5')]=_[_0xddb9('0x6')](config[_0xddb9('0x5')],{'host':_0xddb9('0x7'),'port':0x18eb});var socket=require(_0xddb9('0x8'))(new Redis(config[_0xddb9('0x5')]));require(_0xddb9('0x9'))[_0xddb9('0xa')](socket);exports[_0xddb9('0xb')]=function(_0x19a7ba){var _0x553b46=this;return new Promise(function(_0x136559,_0x3fcb5a){return db[_0xddb9('0xc')][_0xddb9('0xd')]({'raw':_0x19a7ba['options']?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0xf')]===undefined?!![]:![]:!![],'where':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')]['where']||null:null,'attributes':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x10')]||null:null,'limit':_0x19a7ba[_0xddb9('0xe')]?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x11')]||null:null,'include':_0x19a7ba['options']?_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x12')]?_['map'](_0x19a7ba[_0xddb9('0xe')][_0xddb9('0x12')],function(_0x4ae1b3){return{'model':db[_0x4ae1b3[_0xddb9('0x13')]],'as':_0x4ae1b3['as'],'attributes':_0x4ae1b3[_0xddb9('0x10')],'include':_0x4ae1b3[_0xddb9('0x12')]?_['map'](_0x4ae1b3['include'],function(_0x1d123){return{'model':db[_0x1d123['model']],'as':_0x1d123['as'],'attributes':_0x1d123[_0xddb9('0x10')],'include':_0x1d123['include']?_[_0xddb9('0x14')](_0x1d123[_0xddb9('0x12')],function(_0x487caa){return{'model':db[_0x487caa[_0xddb9('0x13')]],'as':_0x487caa['as'],'attributes':_0x487caa[_0xddb9('0x10')]};}):[]};}):[]};}):[]:[]})[_0xddb9('0x15')](function(_0x2cbeb4){logger[_0xddb9('0x16')]('GetSquareProjects',_0x19a7ba);logger[_0xddb9('0x17')](_0xddb9('0xb'),_0x19a7ba,JSON[_0xddb9('0x18')](_0x2cbeb4));_0x136559(_0x2cbeb4);})[_0xddb9('0x19')](function(_0x17d480){logger['error'](_0xddb9('0xb'),_0x17d480[_0xddb9('0x1a')],_0x19a7ba);_0x3fcb5a(_0x553b46[_0xddb9('0x1b')](0x1f4,_0x17d480['message']));});});};exports['ShowSquareProject']=function(_0x2c64b6){var _0x4e1799=this;return new Promise(function(_0x4dd3c3,_0x3d7ddf){return db[_0xddb9('0xc')]['find']({'raw':_0x2c64b6['options']?_0x2c64b6['options'][_0xddb9('0xf')]===undefined?!![]:![]:!![],'where':_0x2c64b6[_0xddb9('0xe')]?_0x2c64b6['options'][_0xddb9('0x1c')]||null:null,'attributes':_0x2c64b6['options']?_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x10')]||null:null,'include':_0x2c64b6[_0xddb9('0xe')]?_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x12')]?_[_0xddb9('0x14')](_0x2c64b6[_0xddb9('0xe')][_0xddb9('0x12')],function(_0x312184){return{'model':db[_0x312184['model']],'as':_0x312184['as'],'attributes':_0x312184[_0xddb9('0x10')],'include':_0x312184[_0xddb9('0x12')]?_['map'](_0x312184[_0xddb9('0x12')],function(_0x27cc1c){return{'model':db[_0x27cc1c['model']],'as':_0x27cc1c['as'],'attributes':_0x27cc1c[_0xddb9('0x10')],'include':_0x27cc1c[_0xddb9('0x12')]?_[_0xddb9('0x14')](_0x27cc1c['include'],function(_0x37ecaf){return{'model':db[_0x37ecaf['model']],'as':_0x37ecaf['as'],'attributes':_0x37ecaf[_0xddb9('0x10')]};}):[]};}):[]};}):[]:[]})[_0xddb9('0x15')](function(_0x34016c){logger['info'](_0xddb9('0x1d'),_0x2c64b6);logger[_0xddb9('0x17')](_0xddb9('0x1d'),_0x2c64b6,JSON[_0xddb9('0x18')](_0x34016c));_0x4dd3c3(_0x34016c);})[_0xddb9('0x19')](function(_0x2eb0de){logger[_0xddb9('0x1b')](_0xddb9('0x1d'),_0x2eb0de[_0xddb9('0x1a')],_0x2c64b6);_0x3d7ddf(_0x4e1799[_0xddb9('0x1b')](0x1f4,_0x2eb0de[_0xddb9('0x1a')]));});});}; \ No newline at end of file +var _0x4400=['socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','include','map','then','debug','stringify','catch','error','message','ShowSquareProject','find','model','info','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4400,0xe0));var _0x0440=function(_0x3dc1ff,_0x5d41a3){_0x3dc1ff=_0x3dc1ff-0x0;var _0x3e1472=_0x4400[_0x3dc1ff];return _0x3e1472;};'use strict';var _=require(_0x0440('0x0'));var Redis=require(_0x0440('0x1'));var db=require(_0x0440('0x2'))['db'];var logger=require(_0x0440('0x3'))(_0x0440('0x4'));var config=require(_0x0440('0x5'));config[_0x0440('0x6')]=_[_0x0440('0x7')](config[_0x0440('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x0440('0x8'))(new Redis(config['redis']));require(_0x0440('0x9'))['register'](socket);exports[_0x0440('0xa')]=function(_0x4a0f9f){var _0x193ac0=this;return new Promise(function(_0x4d28a2,_0x157ac1){return db[_0x0440('0xb')][_0x0440('0xc')]({'raw':_0x4a0f9f[_0x0440('0xd')]?_0x4a0f9f[_0x0440('0xd')][_0x0440('0xe')]===undefined?!![]:![]:!![],'where':_0x4a0f9f[_0x0440('0xd')]?_0x4a0f9f['options']['where']||null:null,'attributes':_0x4a0f9f[_0x0440('0xd')]?_0x4a0f9f[_0x0440('0xd')][_0x0440('0xf')]||null:null,'limit':_0x4a0f9f[_0x0440('0xd')]?_0x4a0f9f[_0x0440('0xd')][_0x0440('0x10')]||null:null,'include':_0x4a0f9f[_0x0440('0xd')]?_0x4a0f9f[_0x0440('0xd')][_0x0440('0x11')]?_['map'](_0x4a0f9f['options'][_0x0440('0x11')],function(_0x566fca){return{'model':db[_0x566fca['model']],'as':_0x566fca['as'],'attributes':_0x566fca['attributes'],'include':_0x566fca['include']?_[_0x0440('0x12')](_0x566fca[_0x0440('0x11')],function(_0x81304e){return{'model':db[_0x81304e['model']],'as':_0x81304e['as'],'attributes':_0x81304e[_0x0440('0xf')],'include':_0x81304e[_0x0440('0x11')]?_[_0x0440('0x12')](_0x81304e[_0x0440('0x11')],function(_0x15002b){return{'model':db[_0x15002b['model']],'as':_0x15002b['as'],'attributes':_0x15002b[_0x0440('0xf')]};}):[]};}):[]};}):[]:[]})[_0x0440('0x13')](function(_0x5bbfac){logger['info']('GetSquareProjects',_0x4a0f9f);logger[_0x0440('0x14')](_0x0440('0xa'),_0x4a0f9f,JSON[_0x0440('0x15')](_0x5bbfac));_0x4d28a2(_0x5bbfac);})[_0x0440('0x16')](function(_0x3c2446){logger[_0x0440('0x17')]('GetSquareProjects',_0x3c2446[_0x0440('0x18')],_0x4a0f9f);_0x157ac1(_0x193ac0[_0x0440('0x17')](0x1f4,_0x3c2446[_0x0440('0x18')]));});});};exports[_0x0440('0x19')]=function(_0x429ee1){var _0x5a870b=this;return new Promise(function(_0x17b3a1,_0x20e5d2){return db[_0x0440('0xb')][_0x0440('0x1a')]({'raw':_0x429ee1['options']?_0x429ee1['options'][_0x0440('0xe')]===undefined?!![]:![]:!![],'where':_0x429ee1['options']?_0x429ee1['options']['where']||null:null,'attributes':_0x429ee1[_0x0440('0xd')]?_0x429ee1[_0x0440('0xd')]['attributes']||null:null,'include':_0x429ee1['options']?_0x429ee1['options'][_0x0440('0x11')]?_[_0x0440('0x12')](_0x429ee1[_0x0440('0xd')][_0x0440('0x11')],function(_0x581e97){return{'model':db[_0x581e97['model']],'as':_0x581e97['as'],'attributes':_0x581e97[_0x0440('0xf')],'include':_0x581e97['include']?_[_0x0440('0x12')](_0x581e97[_0x0440('0x11')],function(_0x3c7c28){return{'model':db[_0x3c7c28[_0x0440('0x1b')]],'as':_0x3c7c28['as'],'attributes':_0x3c7c28['attributes'],'include':_0x3c7c28[_0x0440('0x11')]?_[_0x0440('0x12')](_0x3c7c28[_0x0440('0x11')],function(_0x3d7e9a){return{'model':db[_0x3d7e9a[_0x0440('0x1b')]],'as':_0x3d7e9a['as'],'attributes':_0x3d7e9a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfb4cfa){logger[_0x0440('0x1c')](_0x0440('0x19'),_0x429ee1);logger[_0x0440('0x14')](_0x0440('0x19'),_0x429ee1,JSON[_0x0440('0x15')](_0xfb4cfa));_0x17b3a1(_0xfb4cfa);})['catch'](function(_0x2b4399){logger[_0x0440('0x17')](_0x0440('0x19'),_0x2b4399[_0x0440('0x18')],_0x429ee1);_0x20e5d2(_0x5a870b['error'](0x1f4,_0x2b4399['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index eca72e3..c402818 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 _0xb688=['squareProject:','./squareProject.events','save','remove','update','emit','register','length'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xb688,0x189));var _0x8b68=function(_0x3aeac7,_0x47f064){_0x3aeac7=_0x3aeac7-0x0;var _0xb05f74=_0xb688[_0x3aeac7];return _0xb05f74;};'use strict';var SquareProjectEvents=require(_0x8b68('0x0'));var events=[_0x8b68('0x1'),_0x8b68('0x2'),_0x8b68('0x3')];function createListener(_0x4b3154,_0x30617c){return function(_0x44bb8a){_0x30617c[_0x8b68('0x4')](_0x4b3154,_0x44bb8a);};}function removeListener(_0x542c24,_0x358085){return function(){SquareProjectEvents['removeListener'](_0x542c24,_0x358085);};}exports[_0x8b68('0x5')]=function(_0x4af8e2){for(var _0x1734c1=0x0,_0x5aafe4=events[_0x8b68('0x6')];_0x1734c1<_0x5aafe4;_0x1734c1++){var _0x5e1740=events[_0x1734c1];var _0x20234b=createListener(_0x8b68('0x7')+_0x5e1740,_0x4af8e2);SquareProjectEvents['on'](_0x5e1740,_0x20234b);}}; \ No newline at end of file +var _0x9fcf=['register','length','squareProject:','./squareProject.events','save','update'];(function(_0x5bdd93,_0x208ccb){var _0x2caf5e=function(_0x3a8a9b){while(--_0x3a8a9b){_0x5bdd93['push'](_0x5bdd93['shift']());}};_0x2caf5e(++_0x208ccb);}(_0x9fcf,0x123));var _0xf9fc=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x9fcf[_0x1a7846];return _0x48049;};'use strict';var SquareProjectEvents=require(_0xf9fc('0x0'));var events=[_0xf9fc('0x1'),'remove',_0xf9fc('0x2')];function createListener(_0x3e4045,_0x5a9503){return function(_0x427216){_0x5a9503['emit'](_0x3e4045,_0x427216);};}function removeListener(_0x2292d8,_0x2c93d0){return function(){SquareProjectEvents['removeListener'](_0x2292d8,_0x2c93d0);};}exports[_0xf9fc('0x3')]=function(_0x3f13e5){for(var _0x170b11=0x0,_0x526ef4=events[_0xf9fc('0x4')];_0x170b11<_0x526ef4;_0x170b11++){var _0x86fe06=events[_0x170b11];var _0x5d7fa5=createListener(_0xf9fc('0x5')+_0x86fe06,_0x3f13e5);SquareProjectEvents['on'](_0x86fe06,_0x5d7fa5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c56c5e2..7742b13 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x44ffdc,_0x4c06d0){var _0x83816a=function(_0x243d48){while(--_0x243d48){_0x44ffdc['push'](_0x44ffdc['shift']());}};_0x83816a(++_0x4c06d0);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x117ce0,_0x47cf13){var _0x225700=function(_0x16077e){while(--_0x16077e){_0x117ce0['push'](_0x117ce0['shift']());}};_0x225700(++_0x47cf13);}(_0xe14b,0x93));var _0xbe14=function(_0x37c803,_0x2f614e){_0x37c803=_0x37c803-0x0;var _0x24cfa6=_0xe14b[_0x37c803];return _0x24cfa6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index cb7d5ad..6233f20 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 _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0x17430e,_0x2b33be){var _0x233b23=function(_0x22cad5){while(--_0x22cad5){_0x17430e['push'](_0x17430e['shift']());}};_0x233b23(++_0x2b33be);}(_0xae24,0x182));var _0x4ae2=function(_0x43d71c,_0x525e5d){_0x43d71c=_0x43d71c-0x0;var _0x5453f5=_0xae24[_0x43d71c];return _0x5453f5;};'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 +var _0xb138=['getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1e116f,_0x22d12d){var _0x4bde1b=function(_0x1a911e){while(--_0x1a911e){_0x1e116f['push'](_0x1e116f['shift']());}};_0x4bde1b(++_0x22d12d);}(_0xb138,0x1dd));var _0x8b13=function(_0x2b2a14,_0x315859){_0x2b2a14=_0x2b2a14-0x0;var _0x2f936c=_0xb138[_0x2b2a14];return _0x2f936c;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'callerid':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'extension':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'dnid':{'type':Sequelize[_0x8b13('0x2')]},'projectName':{'type':Sequelize[_0x8b13('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8b13('0x2')]},'savePath':{'type':Sequelize[_0x8b13('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x3fdf4d='';var _0x33d1a7=this[_0x8b13('0x3')]('savePath');if(_0x33d1a7){_0x3fdf4d=_0x33d1a7[_0x8b13('0x4')](_0x33d1a7[_0x8b13('0x5')]('.'));}return _0x3fdf4d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7aa98f9..f3d6b69 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 _0x9a5e=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','map','SquareRecording','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','eml-format','rimraf'];(function(_0x23e2a2,_0x7e7cab){var _0x576a76=function(_0xae4462){while(--_0xae4462){_0x23e2a2['push'](_0x23e2a2['shift']());}};_0x576a76(++_0x7e7cab);}(_0x9a5e,0x69));var _0xe9a5=function(_0x2a139d,_0x12784a){_0x2a139d=_0x2a139d-0x0;var _0x41699a=_0x9a5e[_0x2a139d];return _0x41699a;};'use strict';var emlformat=require(_0xe9a5('0x0'));var rimraf=require(_0xe9a5('0x1'));var zipdir=require(_0xe9a5('0x2'));var jsonpatch=require(_0xe9a5('0x3'));var rp=require('request-promise');var moment=require(_0xe9a5('0x4'));var BPromise=require(_0xe9a5('0x5'));var Mustache=require(_0xe9a5('0x6'));var util=require(_0xe9a5('0x7'));var path=require(_0xe9a5('0x8'));var sox=require(_0xe9a5('0x9'));var csv=require(_0xe9a5('0xa'));var ejs=require(_0xe9a5('0xb'));var fs=require('fs');var fs_extra=require(_0xe9a5('0xc'));var _=require(_0xe9a5('0xd'));var squel=require(_0xe9a5('0xe'));var crypto=require(_0xe9a5('0xf'));var jsforce=require(_0xe9a5('0x10'));var deskjs=require(_0xe9a5('0x11'));var toCsv=require(_0xe9a5('0xa'));var querystring=require(_0xe9a5('0x12'));var Papa=require(_0xe9a5('0x13'));var Redis=require(_0xe9a5('0x14'));var authService=require(_0xe9a5('0x15'));var qs=require(_0xe9a5('0x16'));var as=require(_0xe9a5('0x17'));var hardwareService=require(_0xe9a5('0x18'));var logger=require(_0xe9a5('0x19'))('api');var utils=require(_0xe9a5('0x1a'));var config=require(_0xe9a5('0x1b'));var licenseUtil=require(_0xe9a5('0x1c'));var db=require(_0xe9a5('0x1d'))['db'];function respondWithStatusCode(_0x3e8d4c,_0x5ef5f0){_0x5ef5f0=_0x5ef5f0||0xcc;return function(_0x862553){if(_0x862553){return _0x3e8d4c[_0xe9a5('0x1e')](_0x5ef5f0);}return _0x3e8d4c[_0xe9a5('0x1f')](_0x5ef5f0)[_0xe9a5('0x20')]();};}function respondWithResult(_0x24e0e2,_0x40b80d){_0x40b80d=_0x40b80d||0xc8;return function(_0x3a81da){if(_0x3a81da){return _0x24e0e2[_0xe9a5('0x1f')](_0x40b80d)[_0xe9a5('0x21')](_0x3a81da);}};}function respondWithFilteredResult(_0x21c409,_0x1866e2){return function(_0x1fb46a){if(_0x1fb46a){var _0x5df58e=typeof _0x1866e2[_0xe9a5('0x22')]===_0xe9a5('0x23')&&typeof _0x1866e2[_0xe9a5('0x24')]===_0xe9a5('0x23');var _0x7c05a2=_0x1fb46a['count'];var _0xe08029=_0x5df58e?0x0:_0x1866e2[_0xe9a5('0x22')];var _0x3c2cb4=_0x5df58e?_0x1fb46a[_0xe9a5('0x25')]:_0x1866e2[_0xe9a5('0x22')]+_0x1866e2[_0xe9a5('0x24')];var _0xa018be;if(_0x3c2cb4>=_0x7c05a2){_0x3c2cb4=_0x7c05a2;_0xa018be=0xc8;}else{_0xa018be=0xce;}_0x21c409[_0xe9a5('0x1f')](_0xa018be);return _0x21c409[_0xe9a5('0x26')]('Content-Range',_0xe08029+'-'+_0x3c2cb4+'/'+_0x7c05a2)[_0xe9a5('0x21')](_0x1fb46a);}return null;};}function patchUpdates(_0x41a7f9){return function(_0x3cd20f){try{jsonpatch[_0xe9a5('0x27')](_0x3cd20f,_0x41a7f9,!![]);}catch(_0x115469){return BPromise[_0xe9a5('0x28')](_0x115469);}return _0x3cd20f[_0xe9a5('0x29')]();};}function saveUpdates(_0x4c3f03,_0x3e89fd){return function(_0x4886d2){if(_0x4886d2){return _0x4886d2['update'](_0x4c3f03)[_0xe9a5('0x2a')](function(_0x34b02e){return _0x34b02e;});}return null;};}function removeEntity(_0x3904dc,_0x1db8f1){return function(_0x504bcf){if(_0x504bcf){return _0x504bcf['destroy']()[_0xe9a5('0x2a')](function(){_0x3904dc[_0xe9a5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8b32,_0x178dd2){return function(_0x1a5475){if(!_0x1a5475){_0x4e8b32[_0xe9a5('0x1e')](0x194);}return _0x1a5475;};}function handleError(_0x3c5ac6,_0x2fe4c6){_0x2fe4c6=_0x2fe4c6||0x1f4;return function(_0x3c21d9){logger[_0xe9a5('0x2b')](_0x3c21d9[_0xe9a5('0x2c')]);if(_0x3c21d9[_0xe9a5('0x2d')]){delete _0x3c21d9[_0xe9a5('0x2d')];}_0x3c5ac6['status'](_0x2fe4c6)[_0xe9a5('0x2e')](_0x3c21d9);};}exports[_0xe9a5('0x2f')]=function(_0x330c1f,_0x3cfa14){var _0x2a6ec4={},_0x3508c9={},_0x315c28={'count':0x0,'rows':[]};var _0x3aff42=_[_0xe9a5('0x30')](db[_0xe9a5('0x31')]['rawAttributes'],function(_0x4cb0bb){return{'name':_0x4cb0bb[_0xe9a5('0x32')],'type':_0x4cb0bb['type'][_0xe9a5('0x33')]};});_0x3508c9[_0xe9a5('0x34')]=_[_0xe9a5('0x30')](_0x3aff42,_0xe9a5('0x2d'));_0x3508c9[_0xe9a5('0x35')]=_[_0xe9a5('0x36')](_0x330c1f[_0xe9a5('0x35')]);_0x3508c9['filters']=_[_0xe9a5('0x37')](_0x3508c9[_0xe9a5('0x34')],_0x3508c9[_0xe9a5('0x35')]);_0x2a6ec4[_0xe9a5('0x38')]=_[_0xe9a5('0x37')](_0x3508c9['model'],qs[_0xe9a5('0x39')](_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x39')]));_0x2a6ec4['attributes']=_0x2a6ec4[_0xe9a5('0x38')][_0xe9a5('0x3a')]?_0x2a6ec4[_0xe9a5('0x38')]:_0x3508c9[_0xe9a5('0x34')];if(!_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x3b')]('nolimit')){_0x2a6ec4[_0xe9a5('0x24')]=qs[_0xe9a5('0x24')](_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x24')]);_0x2a6ec4[_0xe9a5('0x22')]=qs['offset'](_0x330c1f[_0xe9a5('0x35')]['offset']);}_0x2a6ec4[_0xe9a5('0x3c')]=qs[_0xe9a5('0x3d')](_0x330c1f['query'][_0xe9a5('0x3d')]);_0x2a6ec4['where']=qs[_0xe9a5('0x3e')](_[_0xe9a5('0x3f')](_0x330c1f['query'],_0x3508c9['filters']),_0x3aff42);if(_0x330c1f['query'][_0xe9a5('0x40')]){_0x2a6ec4[_0xe9a5('0x41')]=_[_0xe9a5('0x42')](_0x2a6ec4[_0xe9a5('0x41')],{'$or':_[_0xe9a5('0x30')](_0x3aff42,function(_0x116b2f){if(_0x116b2f[_0xe9a5('0x43')]!==_0xe9a5('0x44')){var _0x5d9289={};_0x5d9289[_0x116b2f['name']]={'$like':'%'+_0x330c1f[_0xe9a5('0x35')][_0xe9a5('0x40')]+'%'};return _0x5d9289;}})});}_0x2a6ec4=_[_0xe9a5('0x42')]({},_0x2a6ec4,_0x330c1f[_0xe9a5('0x45')]);var _0x1d2c0b={'where':_0x2a6ec4[_0xe9a5('0x41')]};return db['SquareRecording'][_0xe9a5('0x25')](_0x1d2c0b)['then'](function(_0x56648f){_0x315c28[_0xe9a5('0x25')]=_0x56648f;if(_0x330c1f['query']['includeAll']){_0x2a6ec4[_0xe9a5('0x46')]=[{'all':!![]}];}return db['SquareRecording'][_0xe9a5('0x47')](_0x2a6ec4);})[_0xe9a5('0x2a')](function(_0x2d20a5){_0x315c28[_0xe9a5('0x48')]=_0x2d20a5;return _0x315c28;})[_0xe9a5('0x2a')](respondWithFilteredResult(_0x3cfa14,_0x2a6ec4))[_0xe9a5('0x49')](handleError(_0x3cfa14,null));};exports[_0xe9a5('0x4a')]=function(_0x49e65c,_0x317739){var _0x3fa8a0={'raw':!![],'where':{'id':_0x49e65c[_0xe9a5('0x4b')]['id']}},_0x3ba99a={};_0x3ba99a[_0xe9a5('0x34')]=_['keys'](db['SquareRecording']['rawAttributes']);_0x3ba99a[_0xe9a5('0x35')]=_['keys'](_0x49e65c['query']);_0x3ba99a[_0xe9a5('0x3e')]=_[_0xe9a5('0x37')](_0x3ba99a[_0xe9a5('0x34')],_0x3ba99a[_0xe9a5('0x35')]);_0x3fa8a0[_0xe9a5('0x38')]=_[_0xe9a5('0x37')](_0x3ba99a[_0xe9a5('0x34')],qs[_0xe9a5('0x39')](_0x49e65c[_0xe9a5('0x35')]['fields']));_0x3fa8a0['attributes']=_0x3fa8a0[_0xe9a5('0x38')]['length']?_0x3fa8a0['attributes']:_0x3ba99a[_0xe9a5('0x34')];if(_0x49e65c['query'][_0xe9a5('0x4c')]){_0x3fa8a0[_0xe9a5('0x46')]=[{'all':!![]}];}_0x3fa8a0=_[_0xe9a5('0x42')]({},_0x3fa8a0,_0x49e65c[_0xe9a5('0x45')]);return db['SquareRecording'][_0xe9a5('0x4d')](_0x3fa8a0)[_0xe9a5('0x2a')](handleEntityNotFound(_0x317739,null))[_0xe9a5('0x2a')](respondWithResult(_0x317739,null))[_0xe9a5('0x49')](handleError(_0x317739,null));};exports['create']=function(_0x247591,_0xdef587){return db[_0xe9a5('0x31')][_0xe9a5('0x4e')](_0x247591['body'],{})[_0xe9a5('0x2a')](respondWithResult(_0xdef587,0xc9))[_0xe9a5('0x49')](handleError(_0xdef587,null));};exports[_0xe9a5('0x4f')]=function(_0x347cc4,_0x6d2bf2){if(_0x347cc4['body']['id']){delete _0x347cc4['body']['id'];}return db[_0xe9a5('0x31')][_0xe9a5('0x4d')]({'where':{'id':_0x347cc4[_0xe9a5('0x4b')]['id']}})[_0xe9a5('0x2a')](handleEntityNotFound(_0x6d2bf2,null))[_0xe9a5('0x2a')](saveUpdates(_0x347cc4[_0xe9a5('0x50')],null))[_0xe9a5('0x2a')](respondWithResult(_0x6d2bf2,null))[_0xe9a5('0x49')](handleError(_0x6d2bf2,null));};exports[_0xe9a5('0x51')]=function(_0xd1b6af,_0x1dfc04,_0x4f4d64){var _0x50a913=require(_0xe9a5('0x52'));var _0x4d22d2=![];var _0x4ac32c={};if(_0xd1b6af['query'][_0xe9a5('0x43')]&&_0xd1b6af[_0xe9a5('0x35')][_0xe9a5('0x43')]===_0xe9a5('0x53')){_0x4ac32c[_0xe9a5('0x53')]=_0xd1b6af[_0xe9a5('0x4b')]['id'];}else{_0x4ac32c['id']=_0xd1b6af[_0xe9a5('0x4b')]['id'];}return db['SquareRecording'][_0xe9a5('0x4d')]({'where':_0x4ac32c,'attributes':['id',_0xe9a5('0x54'),_0xe9a5('0x55')],'raw':!![]})[_0xe9a5('0x2a')](handleEntityNotFound(_0x1dfc04,null))['then'](function(_0x13402a){if(_0x13402a){var _0x242b3e=_0x13402a[_0xe9a5('0x54')];var _0x6ab895=util[_0xe9a5('0x56')](_0xe9a5('0x57'),_0x242b3e);if(fs['existsSync'](_0x6ab895)){_0x4d22d2=!![];return _0x50a913[_0xe9a5('0x58')](_0x6ab895,_0x242b3e,config[_0xe9a5('0x59')][_0xe9a5('0x5a')])[_0xe9a5('0x2a')](function(){return _0x13402a;});}return _0x13402a;}})[_0xe9a5('0x2a')](function(_0x585162){if(_0x585162){var _0x5635d3=_0x585162['savePath'];if(!fs[_0xe9a5('0x5b')](_0x5635d3)){throw new db[(_0xe9a5('0x5c'))][(_0xe9a5('0x5d'))](_0xe9a5('0x5e'));}if(_0x585162[_0xe9a5('0x55')]){return _0x1dfc04['download'](_0x5635d3,_0x585162[_0xe9a5('0x55')]+path[_0xe9a5('0x5f')](_0x5635d3),function(){if(_0x4d22d2){fs[_0xe9a5('0x60')](_0x5635d3);}});}else{return _0x1dfc04[_0xe9a5('0x51')](_0x5635d3,function(_0x27ad95){if(_0x4d22d2){fs[_0xe9a5('0x60')](_0x5635d3);}});}}})['catch'](function(_0xecd94f){if(_0xecd94f['message']===_0xe9a5('0x5e')){_0x1dfc04[_0xe9a5('0x1f')](0x194)[_0xe9a5('0x2e')](_0xe9a5('0x61'));}else{return handleError(_0x1dfc04,null);}});};exports['destroy']=function(_0x18f22a,_0x4cca96){return db[_0xe9a5('0x31')][_0xe9a5('0x4d')]({'where':{'id':_0x18f22a[_0xe9a5('0x4b')]['id']}})[_0xe9a5('0x2a')](function(_0x35d97a){if(_['isNil'](_0x35d97a)){throw new ReferenceError(_0xe9a5('0x62'));}return _0x35d97a;})['then'](function(_0x34c680){var _0x43e5b9=_0x34c680[_0xe9a5('0x54')];logger[_0xe9a5('0x63')](_0xe9a5('0x64'),_0x43e5b9);if(!_[_0xe9a5('0x65')](_0x34c680['savePath'])&&fs[_0xe9a5('0x5b')](_0x43e5b9)){logger['info'](_0xe9a5('0x66')+_0x43e5b9+_0xe9a5('0x67'));fs[_0xe9a5('0x68')](_0x43e5b9);}_0x43e5b9=_0x43e5b9+_0xe9a5('0x69');if(!_['isNil'](_0x34c680[_0xe9a5('0x54')])&&fs[_0xe9a5('0x5b')](_0x43e5b9)){logger[_0xe9a5('0x63')](_0xe9a5('0x66')+_0x43e5b9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe9a5('0x68')](_0x43e5b9);}return _0x34c680;})[_0xe9a5('0x2a')](function(_0x42d8ec){if(!_0x42d8ec)throw new InternalError();return _0x42d8ec[_0xe9a5('0x6a')]();})[_0xe9a5('0x2a')](function(){_0x4cca96[_0xe9a5('0x1f')](0xcc)['end']();})[_0xe9a5('0x49')](handleError(_0x4cca96,null));}; \ No newline at end of file +var _0x701d=['catch','create','body','../../components/encryptor','uniqueid','savePath','existsSync','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','request-promise','moment','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareRecording','findAll','then','rows','show','params','length','find'];(function(_0x13c7aa,_0x517f1b){var _0x3ca1f7=function(_0x21f6e4){while(--_0x21f6e4){_0x13c7aa['push'](_0x13c7aa['shift']());}};_0x3ca1f7(++_0x517f1b);}(_0x701d,0x1df));var _0xd701=function(_0x1fce7c,_0x28b4d1){_0x1fce7c=_0x1fce7c-0x0;var _0x507ea3=_0x701d[_0x1fce7c];return _0x507ea3;};'use strict';var emlformat=require(_0xd701('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd701('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd701('0x2'));var moment=require(_0xd701('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd701('0x4'));var path=require(_0xd701('0x5'));var sox=require('sox');var csv=require(_0xd701('0x6'));var ejs=require(_0xd701('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd701('0x8'));var crypto=require(_0xd701('0x9'));var jsforce=require(_0xd701('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd701('0xb'));var Papa=require('papaparse');var Redis=require(_0xd701('0xc'));var authService=require(_0xd701('0xd'));var qs=require(_0xd701('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd701('0xf'));var logger=require(_0xd701('0x10'))(_0xd701('0x11'));var utils=require('../../config/utils');var config=require(_0xd701('0x12'));var licenseUtil=require(_0xd701('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x579695,_0x2537ca){_0x2537ca=_0x2537ca||0xcc;return function(_0x333e03){if(_0x333e03){return _0x579695[_0xd701('0x14')](_0x2537ca);}return _0x579695[_0xd701('0x15')](_0x2537ca)[_0xd701('0x16')]();};}function respondWithResult(_0x1543bb,_0x56d8ff){_0x56d8ff=_0x56d8ff||0xc8;return function(_0x95d00e){if(_0x95d00e){return _0x1543bb[_0xd701('0x15')](_0x56d8ff)[_0xd701('0x17')](_0x95d00e);}};}function respondWithFilteredResult(_0x1b99e7,_0x255857){return function(_0x2d4a36){if(_0x2d4a36){var _0x5f2d9a=typeof _0x255857[_0xd701('0x18')]===_0xd701('0x19')&&typeof _0x255857['limit']===_0xd701('0x19');var _0x119492=_0x2d4a36[_0xd701('0x1a')];var _0x4a5bfa=_0x5f2d9a?0x0:_0x255857['offset'];var _0x4418b5=_0x5f2d9a?_0x2d4a36['count']:_0x255857['offset']+_0x255857[_0xd701('0x1b')];var _0x489a68;if(_0x4418b5>=_0x119492){_0x4418b5=_0x119492;_0x489a68=0xc8;}else{_0x489a68=0xce;}_0x1b99e7[_0xd701('0x15')](_0x489a68);return _0x1b99e7[_0xd701('0x1c')](_0xd701('0x1d'),_0x4a5bfa+'-'+_0x4418b5+'/'+_0x119492)[_0xd701('0x17')](_0x2d4a36);}return null;};}function patchUpdates(_0x2bf465){return function(_0x38823a){try{jsonpatch[_0xd701('0x1e')](_0x38823a,_0x2bf465,!![]);}catch(_0x1f2d13){return BPromise[_0xd701('0x1f')](_0x1f2d13);}return _0x38823a[_0xd701('0x20')]();};}function saveUpdates(_0x1ebdb2,_0x33319f){return function(_0x27b278){if(_0x27b278){return _0x27b278[_0xd701('0x21')](_0x1ebdb2)['then'](function(_0x4b90e9){return _0x4b90e9;});}return null;};}function removeEntity(_0x2d7567,_0x32f39d){return function(_0x5a475f){if(_0x5a475f){return _0x5a475f[_0xd701('0x22')]()['then'](function(){_0x2d7567[_0xd701('0x15')](0xcc)[_0xd701('0x16')]();});}};}function handleEntityNotFound(_0x5388d4,_0x16ba56){return function(_0x4a0a28){if(!_0x4a0a28){_0x5388d4[_0xd701('0x14')](0x194);}return _0x4a0a28;};}function handleError(_0x2d9b4c,_0x136b0d){_0x136b0d=_0x136b0d||0x1f4;return function(_0x52b20f){logger[_0xd701('0x23')](_0x52b20f[_0xd701('0x24')]);if(_0x52b20f[_0xd701('0x25')]){delete _0x52b20f[_0xd701('0x25')];}_0x2d9b4c[_0xd701('0x15')](_0x136b0d)[_0xd701('0x26')](_0x52b20f);};}exports['index']=function(_0x3a0e87,_0x36e5f4){var _0x270378={},_0x477a29={},_0x5d6c75={'count':0x0,'rows':[]};var _0x1d0584=_['map'](db['SquareRecording'][_0xd701('0x27')],function(_0x446fe0){return{'name':_0x446fe0['fieldName'],'type':_0x446fe0[_0xd701('0x28')][_0xd701('0x29')]};});_0x477a29[_0xd701('0x2a')]=_[_0xd701('0x2b')](_0x1d0584,_0xd701('0x25'));_0x477a29[_0xd701('0x2c')]=_[_0xd701('0x2d')](_0x3a0e87[_0xd701('0x2c')]);_0x477a29[_0xd701('0x2e')]=_[_0xd701('0x2f')](_0x477a29[_0xd701('0x2a')],_0x477a29[_0xd701('0x2c')]);_0x270378[_0xd701('0x30')]=_[_0xd701('0x2f')](_0x477a29['model'],qs['fields'](_0x3a0e87[_0xd701('0x2c')][_0xd701('0x31')]));_0x270378['attributes']=_0x270378[_0xd701('0x30')]['length']?_0x270378[_0xd701('0x30')]:_0x477a29[_0xd701('0x2a')];if(!_0x3a0e87[_0xd701('0x2c')][_0xd701('0x32')](_0xd701('0x33'))){_0x270378[_0xd701('0x1b')]=qs[_0xd701('0x1b')](_0x3a0e87['query']['limit']);_0x270378['offset']=qs[_0xd701('0x18')](_0x3a0e87[_0xd701('0x2c')][_0xd701('0x18')]);}_0x270378[_0xd701('0x34')]=qs[_0xd701('0x35')](_0x3a0e87['query'][_0xd701('0x35')]);_0x270378[_0xd701('0x36')]=qs[_0xd701('0x2e')](_['pick'](_0x3a0e87[_0xd701('0x2c')],_0x477a29['filters']),_0x1d0584);if(_0x3a0e87[_0xd701('0x2c')][_0xd701('0x37')]){_0x270378[_0xd701('0x36')]=_[_0xd701('0x38')](_0x270378[_0xd701('0x36')],{'$or':_['map'](_0x1d0584,function(_0x67fddb){if(_0x67fddb[_0xd701('0x28')]!==_0xd701('0x39')){var _0x5bb05c={};_0x5bb05c[_0x67fddb[_0xd701('0x25')]]={'$like':'%'+_0x3a0e87['query']['filter']+'%'};return _0x5bb05c;}})});}_0x270378=_['merge']({},_0x270378,_0x3a0e87[_0xd701('0x3a')]);var _0x4c4d83={'where':_0x270378['where']};return db[_0xd701('0x3b')][_0xd701('0x1a')](_0x4c4d83)['then'](function(_0x2f0ea1){_0x5d6c75[_0xd701('0x1a')]=_0x2f0ea1;if(_0x3a0e87['query']['includeAll']){_0x270378['include']=[{'all':!![]}];}return db[_0xd701('0x3b')][_0xd701('0x3c')](_0x270378);})[_0xd701('0x3d')](function(_0x55f561){_0x5d6c75[_0xd701('0x3e')]=_0x55f561;return _0x5d6c75;})['then'](respondWithFilteredResult(_0x36e5f4,_0x270378))['catch'](handleError(_0x36e5f4,null));};exports[_0xd701('0x3f')]=function(_0x5da097,_0x235909){var _0x152792={'raw':!![],'where':{'id':_0x5da097[_0xd701('0x40')]['id']}},_0x46c7d8={};_0x46c7d8['model']=_[_0xd701('0x2d')](db[_0xd701('0x3b')][_0xd701('0x27')]);_0x46c7d8[_0xd701('0x2c')]=_[_0xd701('0x2d')](_0x5da097['query']);_0x46c7d8[_0xd701('0x2e')]=_['intersection'](_0x46c7d8[_0xd701('0x2a')],_0x46c7d8[_0xd701('0x2c')]);_0x152792[_0xd701('0x30')]=_[_0xd701('0x2f')](_0x46c7d8[_0xd701('0x2a')],qs[_0xd701('0x31')](_0x5da097['query']['fields']));_0x152792['attributes']=_0x152792[_0xd701('0x30')][_0xd701('0x41')]?_0x152792[_0xd701('0x30')]:_0x46c7d8[_0xd701('0x2a')];if(_0x5da097[_0xd701('0x2c')]['includeAll']){_0x152792['include']=[{'all':!![]}];}_0x152792=_['merge']({},_0x152792,_0x5da097[_0xd701('0x3a')]);return db[_0xd701('0x3b')][_0xd701('0x42')](_0x152792)[_0xd701('0x3d')](handleEntityNotFound(_0x235909,null))[_0xd701('0x3d')](respondWithResult(_0x235909,null))[_0xd701('0x43')](handleError(_0x235909,null));};exports['create']=function(_0x53a444,_0x126eb7){return db[_0xd701('0x3b')][_0xd701('0x44')](_0x53a444['body'],{})[_0xd701('0x3d')](respondWithResult(_0x126eb7,0xc9))[_0xd701('0x43')](handleError(_0x126eb7,null));};exports[_0xd701('0x21')]=function(_0x37a9e6,_0x28f06a){if(_0x37a9e6[_0xd701('0x45')]['id']){delete _0x37a9e6['body']['id'];}return db[_0xd701('0x3b')]['find']({'where':{'id':_0x37a9e6[_0xd701('0x40')]['id']}})['then'](handleEntityNotFound(_0x28f06a,null))['then'](saveUpdates(_0x37a9e6[_0xd701('0x45')],null))[_0xd701('0x3d')](respondWithResult(_0x28f06a,null))['catch'](handleError(_0x28f06a,null));};exports['download']=function(_0x1da450,_0x268d46,_0x5c9ce5){var _0x53f635=require(_0xd701('0x46'));var _0x18bc0d=![];var _0x2441d5={};if(_0x1da450[_0xd701('0x2c')][_0xd701('0x28')]&&_0x1da450[_0xd701('0x2c')][_0xd701('0x28')]===_0xd701('0x47')){_0x2441d5['uniqueid']=_0x1da450[_0xd701('0x40')]['id'];}else{_0x2441d5['id']=_0x1da450[_0xd701('0x40')]['id'];}return db['SquareRecording'][_0xd701('0x42')]({'where':_0x2441d5,'attributes':['id',_0xd701('0x48'),'filename'],'raw':!![]})[_0xd701('0x3d')](handleEntityNotFound(_0x268d46,null))[_0xd701('0x3d')](function(_0x559d06){if(_0x559d06){var _0x151403=_0x559d06[_0xd701('0x48')];var _0x57c7fe=util['format']('%s.cypher',_0x151403);if(fs[_0xd701('0x49')](_0x57c7fe)){_0x18bc0d=!![];return _0x53f635['decryptFile'](_0x57c7fe,_0x151403,config['secrets'][_0xd701('0x4a')])['then'](function(){return _0x559d06;});}return _0x559d06;}})['then'](function(_0x4c0c00){if(_0x4c0c00){var _0x196fee=_0x4c0c00[_0xd701('0x48')];if(!fs[_0xd701('0x49')](_0x196fee)){throw new db[(_0xd701('0x4b'))][(_0xd701('0x4c'))](_0xd701('0x4d'));}if(_0x4c0c00[_0xd701('0x4e')]){return _0x268d46[_0xd701('0x4f')](_0x196fee,_0x4c0c00[_0xd701('0x4e')]+path[_0xd701('0x50')](_0x196fee),function(){if(_0x18bc0d){fs['unlink'](_0x196fee);}});}else{return _0x268d46[_0xd701('0x4f')](_0x196fee,function(_0x35b391){if(_0x18bc0d){fs[_0xd701('0x51')](_0x196fee);}});}}})['catch'](function(_0x1cda8b){if(_0x1cda8b['message']===_0xd701('0x4d')){_0x268d46[_0xd701('0x15')](0x194)[_0xd701('0x26')](_0xd701('0x52'));}else{return handleError(_0x268d46,null);}});};exports[_0xd701('0x22')]=function(_0x53d36d,_0xd389c9){return db[_0xd701('0x3b')][_0xd701('0x42')]({'where':{'id':_0x53d36d[_0xd701('0x40')]['id']}})[_0xd701('0x3d')](function(_0x27fc47){if(_[_0xd701('0x53')](_0x27fc47)){throw new ReferenceError(_0xd701('0x54'));}return _0x27fc47;})[_0xd701('0x3d')](function(_0x5ad908){var _0x32f5fa=_0x5ad908[_0xd701('0x48')];logger['info'](_0xd701('0x55'),_0x32f5fa);if(!_[_0xd701('0x53')](_0x5ad908[_0xd701('0x48')])&&fs['existsSync'](_0x32f5fa)){logger[_0xd701('0x56')](_0xd701('0x57')+_0x32f5fa+_0xd701('0x58'));fs['unlinkSync'](_0x32f5fa);}_0x32f5fa=_0x32f5fa+_0xd701('0x59');if(!_[_0xd701('0x53')](_0x5ad908[_0xd701('0x48')])&&fs[_0xd701('0x49')](_0x32f5fa)){logger[_0xd701('0x56')](_0xd701('0x57')+_0x32f5fa+_0xd701('0x58'));fs[_0xd701('0x5a')](_0x32f5fa);}return _0x5ad908;})['then'](function(_0x2a4efd){if(!_0x2a4efd)throw new InternalError();return _0x2a4efd[_0xd701('0x22')]();})['then'](function(){_0xd389c9['status'](0xcc)['end']();})[_0xd701('0x43')](handleError(_0xd389c9,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 9733094..0ddbbfd 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 _0xaee6=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SquareRecording'];(function(_0x5303fe,_0x4a1a8d){var _0xa3222=function(_0x1858ae){while(--_0x1858ae){_0x5303fe['push'](_0x5303fe['shift']());}};_0xa3222(++_0x4a1a8d);}(_0xaee6,0x187));var _0x6aee=function(_0x414d66,_0x27d2f1){_0x414d66=_0x414d66-0x0;var _0x34617f=_0xaee6[_0x414d66];return _0x34617f;};'use strict';var _=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var logger=require(_0x6aee('0x2'))(_0x6aee('0x3'));var moment=require(_0x6aee('0x4'));var BPromise=require(_0x6aee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aee('0x6'));var rimraf=require(_0x6aee('0x7'));var config=require(_0x6aee('0x8'));var attributes=require('./squareRecording.attributes');module[_0x6aee('0x9')]=function(_0x377d0b,_0x2eec1b){return _0x377d0b[_0x6aee('0xa')](_0x6aee('0xb'),attributes,{'tableName':_0x6aee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f9=['SquareRecording','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x48caf0,_0x280222){var _0x401b8a=function(_0x1da210){while(--_0x1da210){_0x48caf0['push'](_0x48caf0['shift']());}};_0x401b8a(++_0x280222);}(_0xb3f9,0x7a));var _0x9b3f=function(_0xec1d79,_0x139c38){_0xec1d79=_0xec1d79-0x0;var _0x1b8d38=_0xb3f9[_0xec1d79];return _0x1b8d38;};'use strict';var _=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b3f('0x2'));var BPromise=require('bluebird');var rp=require(_0x9b3f('0x3'));var fs=require('fs');var path=require(_0x9b3f('0x4'));var rimraf=require(_0x9b3f('0x5'));var config=require(_0x9b3f('0x6'));var attributes=require(_0x9b3f('0x7'));module[_0x9b3f('0x8')]=function(_0x47dc65,_0x52889d){return _0x47dc65[_0x9b3f('0x9')](_0x9b3f('0xa'),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 5bc1713..7e8e2c8 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 _0xbf92=['code','error','SquareRecording,\x20%s,\x20%s','message','info','result','catch','create','options','raw','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4dfd10,_0x3169d5){var _0x267950=function(_0x15b4ae){while(--_0x15b4ae){_0x4dfd10['push'](_0x4dfd10['shift']());}};_0x267950(++_0x3169d5);}(_0xbf92,0x107));var _0x2bf9=function(_0x3ec7a3,_0x22fe0f){_0x3ec7a3=_0x3ec7a3-0x0;var _0x25d465=_0xbf92[_0x3ec7a3];return _0x25d465;};'use strict';var _=require(_0x2bf9('0x0'));var util=require(_0x2bf9('0x1'));var moment=require(_0x2bf9('0x2'));var BPromise=require(_0x2bf9('0x3'));var rs=require(_0x2bf9('0x4'));var fs=require('fs');var Redis=require(_0x2bf9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bf9('0x6'));var logger=require('../../config/logger')(_0x2bf9('0x7'));var config=require(_0x2bf9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bf9('0x9')][_0x2bf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446d26,_0x48dbf7,_0xc8f565){return new BPromise(function(_0x5aca8b,_0x55159c){return client[_0x2bf9('0xb')](_0x446d26,_0xc8f565)[_0x2bf9('0xc')](function(_0xfa9782){logger['info']('SquareRecording,\x20%s,\x20%s',_0x48dbf7,_0x2bf9('0xd'));logger[_0x2bf9('0xe')](_0x2bf9('0xf'),_0x48dbf7,'request\x20sent',JSON[_0x2bf9('0x10')](_0xfa9782));if(_0xfa9782['error']){if(_0xfa9782['error'][_0x2bf9('0x11')]===0x1f4){logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0xfa9782[_0x2bf9('0x12')]['message']);return _0x55159c(_0xfa9782[_0x2bf9('0x12')][_0x2bf9('0x14')]);}logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0xfa9782[_0x2bf9('0x12')]['message']);return _0x5aca8b(_0xfa9782[_0x2bf9('0x12')][_0x2bf9('0x14')]);}else{logger[_0x2bf9('0x15')](_0x2bf9('0x13'),_0x48dbf7,_0x2bf9('0xd'));_0x5aca8b(_0xfa9782[_0x2bf9('0x16')][_0x2bf9('0x14')]);}})[_0x2bf9('0x17')](function(_0x957c54){logger[_0x2bf9('0x12')](_0x2bf9('0x13'),_0x48dbf7,_0x957c54);_0x55159c(_0x957c54);});});}exports['CreateSquareRecording']=function(_0xf1c01a){var _0x29eb55=this;return new Promise(function(_0x22f25a,_0xb696dc){return db['SquareRecording'][_0x2bf9('0x18')](_0xf1c01a['body'],{'raw':_0xf1c01a[_0x2bf9('0x19')]?_0xf1c01a[_0x2bf9('0x19')][_0x2bf9('0x1a')]===undefined?!![]:![]:!![]})[_0x2bf9('0xc')](function(_0x44a622){logger[_0x2bf9('0x15')](_0x2bf9('0x1b'),_0xf1c01a);logger['debug'](_0x2bf9('0x1b'),_0xf1c01a,JSON[_0x2bf9('0x10')](_0x44a622));_0x22f25a(_0x44a622);})['catch'](function(_0x5130d8){logger[_0x2bf9('0x12')](_0x2bf9('0x1b'),_0x5130d8[_0x2bf9('0x14')],_0xf1c01a);_0xb696dc(_0x29eb55[_0x2bf9('0x12')](0x1f4,_0x5130d8['message']));});});}; \ No newline at end of file +var _0xe231=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','then','info'];(function(_0x107bca,_0x29cebd){var _0x4d49ca=function(_0x952cd){while(--_0x952cd){_0x107bca['push'](_0x107bca['shift']());}};_0x4d49ca(++_0x29cebd);}(_0xe231,0x114));var _0x1e23=function(_0xd81b5b,_0x15f6a7){_0xd81b5b=_0xd81b5b-0x0;var _0x52ffd9=_0xe231[_0xd81b5b];return _0x52ffd9;};'use strict';var _=require(_0x1e23('0x0'));var util=require('util');var moment=require(_0x1e23('0x1'));var BPromise=require(_0x1e23('0x2'));var rs=require(_0x1e23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1e23('0x4'));var logger=require('../../config/logger')(_0x1e23('0x5'));var config=require(_0x1e23('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e23('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33361d,_0x4a4e4b,_0xf62020){return new BPromise(function(_0x453bc0,_0x1f2a78){return client['request'](_0x33361d,_0xf62020)[_0x1e23('0x8')](function(_0x3f77b3){logger[_0x1e23('0x9')](_0x1e23('0xa'),_0x4a4e4b,_0x1e23('0xb'));logger[_0x1e23('0xc')](_0x1e23('0xd'),_0x4a4e4b,_0x1e23('0xb'),JSON[_0x1e23('0xe')](_0x3f77b3));if(_0x3f77b3[_0x1e23('0xf')]){if(_0x3f77b3[_0x1e23('0xf')][_0x1e23('0x10')]===0x1f4){logger[_0x1e23('0xf')](_0x1e23('0xa'),_0x4a4e4b,_0x3f77b3[_0x1e23('0xf')][_0x1e23('0x11')]);return _0x1f2a78(_0x3f77b3[_0x1e23('0xf')][_0x1e23('0x11')]);}logger['error'](_0x1e23('0xa'),_0x4a4e4b,_0x3f77b3[_0x1e23('0xf')][_0x1e23('0x11')]);return _0x453bc0(_0x3f77b3[_0x1e23('0xf')]['message']);}else{logger[_0x1e23('0x9')](_0x1e23('0xa'),_0x4a4e4b,_0x1e23('0xb'));_0x453bc0(_0x3f77b3[_0x1e23('0x12')]['message']);}})[_0x1e23('0x13')](function(_0x4e75da){logger[_0x1e23('0xf')](_0x1e23('0xa'),_0x4a4e4b,_0x4e75da);_0x1f2a78(_0x4e75da);});});}exports[_0x1e23('0x14')]=function(_0x29b4e6){var _0x33d83f=this;return new Promise(function(_0x108a27,_0x36051c){return db[_0x1e23('0x15')][_0x1e23('0x16')](_0x29b4e6[_0x1e23('0x17')],{'raw':_0x29b4e6[_0x1e23('0x18')]?_0x29b4e6[_0x1e23('0x18')][_0x1e23('0x19')]===undefined?!![]:![]:!![]})[_0x1e23('0x8')](function(_0xd71766){logger[_0x1e23('0x9')](_0x1e23('0x14'),_0x29b4e6);logger[_0x1e23('0xc')]('CreateSquareRecording',_0x29b4e6,JSON[_0x1e23('0xe')](_0xd71766));_0x108a27(_0xd71766);})[_0x1e23('0x13')](function(_0xc26a8b){logger['error'](_0x1e23('0x14'),_0xc26a8b[_0x1e23('0x11')],_0x29b4e6);_0x36051c(_0x33d83f[_0x1e23('0xf')](0x1f4,_0xc26a8b[_0x1e23('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 7f923fb..6cc74f7 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x175c76,_0x24e7ff){var _0x57f973=function(_0x23dc80){while(--_0x23dc80){_0x175c76['push'](_0x175c76['shift']());}};_0x57f973(++_0x24e7ff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1db0f2,_0xaffa38){var _0x293687=function(_0x31f982){while(--_0x31f982){_0x1db0f2['push'](_0x1db0f2['shift']());}};_0x293687(++_0xaffa38);}(_0xe706,0xa3));var _0x6e70=function(_0x5da048,_0xca5c85){_0x5da048=_0x5da048-0x0;var _0x13dfc5=_0xe706[_0x5da048];return _0x13dfc5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 7877288..b59baf7 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 _0x6a47=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3decaa,_0x2d7131){var _0x1b5068=function(_0x119f0f){while(--_0x119f0f){_0x3decaa['push'](_0x3decaa['shift']());}};_0x1b5068(++_0x2d7131);}(_0x6a47,0x112));var _0x76a4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6a47[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x76a4('0x0'));module[_0x76a4('0x1')]={'network':{'type':Sequelize[_0x76a4('0x2')]},'network_script':{'type':Sequelize[_0x76a4('0x2')]},'request':{'type':Sequelize[_0x76a4('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x76a4('0x2')]},'type':{'type':Sequelize[_0x76a4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x76a4('0x2')]},'callerid':{'type':Sequelize[_0x76a4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x76a4('0x2')]},'callingani2':{'type':Sequelize[_0x76a4('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x76a4('0x2')]},'dnid':{'type':Sequelize[_0x76a4('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76a4('0x2')]},'extension':{'type':Sequelize[_0x76a4('0x2')]},'priority':{'type':Sequelize[_0x76a4('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76a4('0x2')]},'threadid':{'type':Sequelize[_0x76a4('0x2')]},'project_name':{'type':Sequelize[_0x76a4('0x2')]},'joinAt':{'type':Sequelize[_0x76a4('0x3')]},'leaveAt':{'type':Sequelize[_0x76a4('0x3')]},'bot':{'type':Sequelize[_0x76a4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf8d0=['DATE','sequelize','exports','STRING'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf8d0,0x199));var _0x0f8d=function(_0x2e187c,_0x30a25a){_0x2e187c=_0x2e187c-0x0;var _0x5817d2=_0xf8d0[_0x2e187c];return _0x5817d2;};'use strict';var Sequelize=require(_0x0f8d('0x0'));module[_0x0f8d('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x0f8d('0x2')]},'request':{'type':Sequelize[_0x0f8d('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0f8d('0x2')]},'type':{'type':Sequelize[_0x0f8d('0x2')]},'uniqueid':{'type':Sequelize[_0x0f8d('0x2')]},'version':{'type':Sequelize[_0x0f8d('0x2')]},'callerid':{'type':Sequelize[_0x0f8d('0x2')]},'calleridname':{'type':Sequelize[_0x0f8d('0x2')]},'callingpres':{'type':Sequelize[_0x0f8d('0x2')]},'callingani2':{'type':Sequelize[_0x0f8d('0x2')]},'callington':{'type':Sequelize[_0x0f8d('0x2')]},'callingtns':{'type':Sequelize[_0x0f8d('0x2')]},'dnid':{'type':Sequelize[_0x0f8d('0x2')]},'rdnis':{'type':Sequelize[_0x0f8d('0x2')]},'context':{'type':Sequelize[_0x0f8d('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0f8d('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0f8d('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0f8d('0x2')]},'joinAt':{'type':Sequelize[_0x0f8d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 94006bd..7c5b0b3 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 _0xc73a=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1f497c,_0x40e515){var _0x1067ce=function(_0x265b22){while(--_0x265b22){_0x1f497c['push'](_0x1f497c['shift']());}};_0x1067ce(++_0x40e515);}(_0xc73a,0x1db));var _0xac73=function(_0x2e0ab1,_0x24f246){_0x2e0ab1=_0x2e0ab1-0x0;var _0x32a1de=_0xc73a[_0x2e0ab1];return _0x32a1de;};'use strict';var emlformat=require(_0xac73('0x0'));var rimraf=require(_0xac73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac73('0x2'));var rp=require(_0xac73('0x3'));var moment=require(_0xac73('0x4'));var BPromise=require(_0xac73('0x5'));var Mustache=require(_0xac73('0x6'));var util=require(_0xac73('0x7'));var path=require(_0xac73('0x8'));var sox=require(_0xac73('0x9'));var csv=require('to-csv');var ejs=require(_0xac73('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac73('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac73('0xc'));var querystring=require(_0xac73('0xd'));var Papa=require('papaparse');var Redis=require(_0xac73('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xac73('0xf'));var as=require(_0xac73('0x10'));var hardwareService=require(_0xac73('0x11'));var logger=require(_0xac73('0x12'))(_0xac73('0x13'));var utils=require(_0xac73('0x14'));var config=require(_0xac73('0x15'));var licenseUtil=require(_0xac73('0x16'));var db=require(_0xac73('0x17'))['db'];function respondWithStatusCode(_0x25b987,_0x40df49){_0x40df49=_0x40df49||0xcc;return function(_0x360768){if(_0x360768){return _0x25b987['sendStatus'](_0x40df49);}return _0x25b987['status'](_0x40df49)[_0xac73('0x18')]();};}function respondWithResult(_0x50715b,_0x26bded){_0x26bded=_0x26bded||0xc8;return function(_0x3d08eb){if(_0x3d08eb){return _0x50715b['status'](_0x26bded)[_0xac73('0x19')](_0x3d08eb);}};}function respondWithFilteredResult(_0x4e1604,_0x42040d){return function(_0x49a2e7){if(_0x49a2e7){var _0x518837=typeof _0x42040d[_0xac73('0x1a')]===_0xac73('0x1b')&&typeof _0x42040d['limit']===_0xac73('0x1b');var _0x135757=_0x49a2e7[_0xac73('0x1c')];var _0x7620ca=_0x518837?0x0:_0x42040d[_0xac73('0x1a')];var _0xab01b=_0x518837?_0x49a2e7['count']:_0x42040d['offset']+_0x42040d[_0xac73('0x1d')];var _0x29c657;if(_0xab01b>=_0x135757){_0xab01b=_0x135757;_0x29c657=0xc8;}else{_0x29c657=0xce;}_0x4e1604[_0xac73('0x1e')](_0x29c657);return _0x4e1604[_0xac73('0x1f')](_0xac73('0x20'),_0x7620ca+'-'+_0xab01b+'/'+_0x135757)[_0xac73('0x19')](_0x49a2e7);}return null;};}function patchUpdates(_0x411ca4){return function(_0x1a69cb){try{jsonpatch[_0xac73('0x21')](_0x1a69cb,_0x411ca4,!![]);}catch(_0x1b7320){return BPromise[_0xac73('0x22')](_0x1b7320);}return _0x1a69cb['save']();};}function saveUpdates(_0x3e421d,_0x1bcf97){return function(_0x5a2507){if(_0x5a2507){return _0x5a2507[_0xac73('0x23')](_0x3e421d)[_0xac73('0x24')](function(_0x41b65b){return _0x41b65b;});}return null;};}function removeEntity(_0x43f121,_0x400365){return function(_0x3cd498){if(_0x3cd498){return _0x3cd498[_0xac73('0x25')]()[_0xac73('0x24')](function(){_0x43f121[_0xac73('0x1e')](0xcc)[_0xac73('0x18')]();});}};}function handleEntityNotFound(_0x1a5406,_0x3c71c5){return function(_0x57b080){if(!_0x57b080){_0x1a5406[_0xac73('0x26')](0x194);}return _0x57b080;};}function handleError(_0x42adbf,_0x470314){_0x470314=_0x470314||0x1f4;return function(_0x200d04){logger[_0xac73('0x27')](_0x200d04[_0xac73('0x28')]);if(_0x200d04[_0xac73('0x29')]){delete _0x200d04[_0xac73('0x29')];}_0x42adbf['status'](_0x470314)[_0xac73('0x2a')](_0x200d04);};}exports[_0xac73('0x2b')]=function(_0x3b4a73,_0x2bf227){var _0x55923a={},_0x38e101={},_0x3e76c4={'count':0x0,'rows':[]};var _0x34fd43=_['map'](db[_0xac73('0x2c')][_0xac73('0x2d')],function(_0xdf5eb2){return{'name':_0xdf5eb2[_0xac73('0x2e')],'type':_0xdf5eb2['type'][_0xac73('0x2f')]};});_0x38e101[_0xac73('0x30')]=_[_0xac73('0x31')](_0x34fd43,_0xac73('0x29'));_0x38e101['query']=_[_0xac73('0x32')](_0x3b4a73[_0xac73('0x33')]);_0x38e101[_0xac73('0x34')]=_[_0xac73('0x35')](_0x38e101[_0xac73('0x30')],_0x38e101[_0xac73('0x33')]);_0x55923a[_0xac73('0x36')]=_['intersection'](_0x38e101[_0xac73('0x30')],qs[_0xac73('0x37')](_0x3b4a73[_0xac73('0x33')]['fields']));_0x55923a[_0xac73('0x36')]=_0x55923a['attributes'][_0xac73('0x38')]?_0x55923a['attributes']:_0x38e101['model'];if(!_0x3b4a73[_0xac73('0x33')][_0xac73('0x39')](_0xac73('0x3a'))){_0x55923a['limit']=qs[_0xac73('0x1d')](_0x3b4a73[_0xac73('0x33')][_0xac73('0x1d')]);_0x55923a[_0xac73('0x1a')]=qs['offset'](_0x3b4a73['query']['offset']);}_0x55923a[_0xac73('0x3b')]=qs[_0xac73('0x3c')](_0x3b4a73[_0xac73('0x33')][_0xac73('0x3c')]);_0x55923a[_0xac73('0x3d')]=qs['filters'](_[_0xac73('0x3e')](_0x3b4a73[_0xac73('0x33')],_0x38e101[_0xac73('0x34')]),_0x34fd43);if(_0x3b4a73['query'][_0xac73('0x3f')]){_0x55923a[_0xac73('0x3d')]=_[_0xac73('0x40')](_0x55923a[_0xac73('0x3d')],{'$or':_[_0xac73('0x31')](_0x34fd43,function(_0x518019){if(_0x518019['type']!=='VIRTUAL'){var _0xbe1be4={};_0xbe1be4[_0x518019['name']]={'$like':'%'+_0x3b4a73[_0xac73('0x33')][_0xac73('0x3f')]+'%'};return _0xbe1be4;}})});}_0x55923a=_[_0xac73('0x40')]({},_0x55923a,_0x3b4a73[_0xac73('0x41')]);var _0x4a8ee1={'where':_0x55923a[_0xac73('0x3d')]};return db[_0xac73('0x2c')]['count'](_0x4a8ee1)['then'](function(_0x323164){_0x3e76c4[_0xac73('0x1c')]=_0x323164;if(_0x3b4a73['query'][_0xac73('0x42')]){_0x55923a[_0xac73('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0xac73('0x44')](_0x55923a);})[_0xac73('0x24')](function(_0x4035bd){_0x3e76c4[_0xac73('0x45')]=_0x4035bd;return _0x3e76c4;})[_0xac73('0x24')](respondWithFilteredResult(_0x2bf227,_0x55923a))[_0xac73('0x46')](handleError(_0x2bf227,null));};exports[_0xac73('0x47')]=function(_0xb0e122,_0x560251){var _0x2f8b96={'raw':!![],'where':{'id':_0xb0e122[_0xac73('0x48')]['id']}},_0x18ad29={};_0x18ad29[_0xac73('0x30')]=_[_0xac73('0x32')](db[_0xac73('0x2c')]['rawAttributes']);_0x18ad29['query']=_['keys'](_0xb0e122[_0xac73('0x33')]);_0x18ad29[_0xac73('0x34')]=_['intersection'](_0x18ad29[_0xac73('0x30')],_0x18ad29[_0xac73('0x33')]);_0x2f8b96[_0xac73('0x36')]=_['intersection'](_0x18ad29[_0xac73('0x30')],qs[_0xac73('0x37')](_0xb0e122[_0xac73('0x33')][_0xac73('0x37')]));_0x2f8b96[_0xac73('0x36')]=_0x2f8b96['attributes'][_0xac73('0x38')]?_0x2f8b96[_0xac73('0x36')]:_0x18ad29[_0xac73('0x30')];if(_0xb0e122['query']['includeAll']){_0x2f8b96[_0xac73('0x43')]=[{'all':!![]}];}_0x2f8b96=_[_0xac73('0x40')]({},_0x2f8b96,_0xb0e122[_0xac73('0x41')]);return db[_0xac73('0x2c')][_0xac73('0x49')](_0x2f8b96)[_0xac73('0x24')](handleEntityNotFound(_0x560251,null))[_0xac73('0x24')](respondWithResult(_0x560251,null))[_0xac73('0x46')](handleError(_0x560251,null));};exports['create']=function(_0x5db067,_0x17c976){return db['SquareReport']['create'](_0x5db067[_0xac73('0x4a')],{})[_0xac73('0x24')](respondWithResult(_0x17c976,0xc9))[_0xac73('0x46')](handleError(_0x17c976,null));};exports[_0xac73('0x23')]=function(_0x387d6a,_0x22bf92){if(_0x387d6a[_0xac73('0x4a')]['id']){delete _0x387d6a[_0xac73('0x4a')]['id'];}return db['SquareReport'][_0xac73('0x49')]({'where':{'id':_0x387d6a['params']['id']}})[_0xac73('0x24')](handleEntityNotFound(_0x22bf92,null))[_0xac73('0x24')](saveUpdates(_0x387d6a[_0xac73('0x4a')],null))[_0xac73('0x24')](respondWithResult(_0x22bf92,null))['catch'](handleError(_0x22bf92,null));};exports['destroy']=function(_0x1477d0,_0x196c28){return db['SquareReport'][_0xac73('0x49')]({'where':{'id':_0x1477d0[_0xac73('0x48')]['id']}})[_0xac73('0x24')](handleEntityNotFound(_0x196c28,null))['then'](removeEntity(_0x196c28,null))['catch'](handleError(_0x196c28,null));};exports['describe']=function(_0xcbb7c3,_0x4cde83){return db[_0xac73('0x2c')][_0xac73('0x4b')]()['then'](respondWithResult(_0x4cde83,null))[_0xac73('0x46')](handleError(_0x4cde83,null));}; \ No newline at end of file +var _0xf873=['apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','SquareReport','includeAll','include','rows','params','keys','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xf873,0x18a));var _0x3f87=function(_0xbb8f0d,_0x4bd863){_0xbb8f0d=_0xbb8f0d-0x0;var _0x53ae53=_0xf873[_0xbb8f0d];return _0x53ae53;};'use strict';var emlformat=require(_0x3f87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f87('0x1'));var jsonpatch=require(_0x3f87('0x2'));var rp=require(_0x3f87('0x3'));var moment=require(_0x3f87('0x4'));var BPromise=require(_0x3f87('0x5'));var Mustache=require(_0x3f87('0x6'));var util=require('util');var path=require(_0x3f87('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f87('0x9'));var crypto=require(_0x3f87('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f87('0xb'));var toCsv=require(_0x3f87('0xc'));var querystring=require(_0x3f87('0xd'));var Papa=require(_0x3f87('0xe'));var Redis=require(_0x3f87('0xf'));var authService=require(_0x3f87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3f87('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f87('0x12'));var utils=require(_0x3f87('0x13'));var config=require(_0x3f87('0x14'));var licenseUtil=require(_0x3f87('0x15'));var db=require(_0x3f87('0x16'))['db'];function respondWithStatusCode(_0x36cd35,_0x44fef5){_0x44fef5=_0x44fef5||0xcc;return function(_0x39b342){if(_0x39b342){return _0x36cd35['sendStatus'](_0x44fef5);}return _0x36cd35[_0x3f87('0x17')](_0x44fef5)[_0x3f87('0x18')]();};}function respondWithResult(_0x259a87,_0x21abf1){_0x21abf1=_0x21abf1||0xc8;return function(_0x152136){if(_0x152136){return _0x259a87[_0x3f87('0x17')](_0x21abf1)[_0x3f87('0x19')](_0x152136);}};}function respondWithFilteredResult(_0x1b2925,_0x47165b){return function(_0x51efe4){if(_0x51efe4){var _0x16c10b=typeof _0x47165b[_0x3f87('0x1a')]===_0x3f87('0x1b')&&typeof _0x47165b[_0x3f87('0x1c')]===_0x3f87('0x1b');var _0x1546bc=_0x51efe4['count'];var _0x2c4efe=_0x16c10b?0x0:_0x47165b[_0x3f87('0x1a')];var _0x4f4aeb=_0x16c10b?_0x51efe4[_0x3f87('0x1d')]:_0x47165b[_0x3f87('0x1a')]+_0x47165b[_0x3f87('0x1c')];var _0x47d05a;if(_0x4f4aeb>=_0x1546bc){_0x4f4aeb=_0x1546bc;_0x47d05a=0xc8;}else{_0x47d05a=0xce;}_0x1b2925[_0x3f87('0x17')](_0x47d05a);return _0x1b2925[_0x3f87('0x1e')](_0x3f87('0x1f'),_0x2c4efe+'-'+_0x4f4aeb+'/'+_0x1546bc)['json'](_0x51efe4);}return null;};}function patchUpdates(_0x314a9c){return function(_0x49c90d){try{jsonpatch[_0x3f87('0x20')](_0x49c90d,_0x314a9c,!![]);}catch(_0x199a91){return BPromise['reject'](_0x199a91);}return _0x49c90d[_0x3f87('0x21')]();};}function saveUpdates(_0x1c11e7,_0x4e9eb8){return function(_0x10e18b){if(_0x10e18b){return _0x10e18b[_0x3f87('0x22')](_0x1c11e7)[_0x3f87('0x23')](function(_0x2639a9){return _0x2639a9;});}return null;};}function removeEntity(_0x2dd93a,_0x584f8d){return function(_0x192d1c){if(_0x192d1c){return _0x192d1c[_0x3f87('0x24')]()['then'](function(){_0x2dd93a[_0x3f87('0x17')](0xcc)[_0x3f87('0x18')]();});}};}function handleEntityNotFound(_0x136acf,_0x99fa60){return function(_0x6fed37){if(!_0x6fed37){_0x136acf['sendStatus'](0x194);}return _0x6fed37;};}function handleError(_0x34936f,_0x2e93b9){_0x2e93b9=_0x2e93b9||0x1f4;return function(_0x384226){logger[_0x3f87('0x25')](_0x384226[_0x3f87('0x26')]);if(_0x384226[_0x3f87('0x27')]){delete _0x384226[_0x3f87('0x27')];}_0x34936f[_0x3f87('0x17')](_0x2e93b9)[_0x3f87('0x28')](_0x384226);};}exports['index']=function(_0x49e2be,_0x5499b7){var _0x294b2a={},_0x20239b={},_0x512491={'count':0x0,'rows':[]};var _0x27a978=_[_0x3f87('0x29')](db['SquareReport'][_0x3f87('0x2a')],function(_0x242377){return{'name':_0x242377[_0x3f87('0x2b')],'type':_0x242377[_0x3f87('0x2c')][_0x3f87('0x2d')]};});_0x20239b[_0x3f87('0x2e')]=_[_0x3f87('0x29')](_0x27a978,_0x3f87('0x27'));_0x20239b[_0x3f87('0x2f')]=_['keys'](_0x49e2be[_0x3f87('0x2f')]);_0x20239b[_0x3f87('0x30')]=_[_0x3f87('0x31')](_0x20239b[_0x3f87('0x2e')],_0x20239b[_0x3f87('0x2f')]);_0x294b2a[_0x3f87('0x32')]=_[_0x3f87('0x31')](_0x20239b[_0x3f87('0x2e')],qs[_0x3f87('0x33')](_0x49e2be[_0x3f87('0x2f')]['fields']));_0x294b2a[_0x3f87('0x32')]=_0x294b2a[_0x3f87('0x32')][_0x3f87('0x34')]?_0x294b2a[_0x3f87('0x32')]:_0x20239b[_0x3f87('0x2e')];if(!_0x49e2be['query'][_0x3f87('0x35')]('nolimit')){_0x294b2a[_0x3f87('0x1c')]=qs[_0x3f87('0x1c')](_0x49e2be['query']['limit']);_0x294b2a[_0x3f87('0x1a')]=qs[_0x3f87('0x1a')](_0x49e2be[_0x3f87('0x2f')][_0x3f87('0x1a')]);}_0x294b2a['order']=qs[_0x3f87('0x36')](_0x49e2be[_0x3f87('0x2f')][_0x3f87('0x36')]);_0x294b2a[_0x3f87('0x37')]=qs[_0x3f87('0x30')](_['pick'](_0x49e2be['query'],_0x20239b['filters']),_0x27a978);if(_0x49e2be[_0x3f87('0x2f')][_0x3f87('0x38')]){_0x294b2a[_0x3f87('0x37')]=_['merge'](_0x294b2a['where'],{'$or':_['map'](_0x27a978,function(_0x77cab1){if(_0x77cab1['type']!==_0x3f87('0x39')){var _0x266b87={};_0x266b87[_0x77cab1[_0x3f87('0x27')]]={'$like':'%'+_0x49e2be['query'][_0x3f87('0x38')]+'%'};return _0x266b87;}})});}_0x294b2a=_[_0x3f87('0x3a')]({},_0x294b2a,_0x49e2be[_0x3f87('0x3b')]);var _0x35d9e6={'where':_0x294b2a[_0x3f87('0x37')]};return db[_0x3f87('0x3c')][_0x3f87('0x1d')](_0x35d9e6)['then'](function(_0x117255){_0x512491[_0x3f87('0x1d')]=_0x117255;if(_0x49e2be['query'][_0x3f87('0x3d')]){_0x294b2a[_0x3f87('0x3e')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x294b2a);})[_0x3f87('0x23')](function(_0x26fb3e){_0x512491[_0x3f87('0x3f')]=_0x26fb3e;return _0x512491;})[_0x3f87('0x23')](respondWithFilteredResult(_0x5499b7,_0x294b2a))['catch'](handleError(_0x5499b7,null));};exports['show']=function(_0x51abac,_0x176455){var _0x210d52={'raw':!![],'where':{'id':_0x51abac[_0x3f87('0x40')]['id']}},_0x40982a={};_0x40982a[_0x3f87('0x2e')]=_[_0x3f87('0x41')](db[_0x3f87('0x3c')]['rawAttributes']);_0x40982a[_0x3f87('0x2f')]=_[_0x3f87('0x41')](_0x51abac[_0x3f87('0x2f')]);_0x40982a[_0x3f87('0x30')]=_[_0x3f87('0x31')](_0x40982a['model'],_0x40982a[_0x3f87('0x2f')]);_0x210d52[_0x3f87('0x32')]=_[_0x3f87('0x31')](_0x40982a[_0x3f87('0x2e')],qs[_0x3f87('0x33')](_0x51abac[_0x3f87('0x2f')][_0x3f87('0x33')]));_0x210d52[_0x3f87('0x32')]=_0x210d52['attributes'][_0x3f87('0x34')]?_0x210d52[_0x3f87('0x32')]:_0x40982a[_0x3f87('0x2e')];if(_0x51abac['query'][_0x3f87('0x3d')]){_0x210d52[_0x3f87('0x3e')]=[{'all':!![]}];}_0x210d52=_[_0x3f87('0x3a')]({},_0x210d52,_0x51abac['options']);return db[_0x3f87('0x3c')]['find'](_0x210d52)[_0x3f87('0x23')](handleEntityNotFound(_0x176455,null))[_0x3f87('0x23')](respondWithResult(_0x176455,null))[_0x3f87('0x42')](handleError(_0x176455,null));};exports[_0x3f87('0x43')]=function(_0x293403,_0x1ff6b4){return db[_0x3f87('0x3c')]['create'](_0x293403[_0x3f87('0x44')],{})[_0x3f87('0x23')](respondWithResult(_0x1ff6b4,0xc9))[_0x3f87('0x42')](handleError(_0x1ff6b4,null));};exports['update']=function(_0x10aef7,_0x224395){if(_0x10aef7['body']['id']){delete _0x10aef7[_0x3f87('0x44')]['id'];}return db['SquareReport'][_0x3f87('0x45')]({'where':{'id':_0x10aef7['params']['id']}})[_0x3f87('0x23')](handleEntityNotFound(_0x224395,null))[_0x3f87('0x23')](saveUpdates(_0x10aef7[_0x3f87('0x44')],null))[_0x3f87('0x23')](respondWithResult(_0x224395,null))['catch'](handleError(_0x224395,null));};exports['destroy']=function(_0x3a035c,_0x16e12d){return db[_0x3f87('0x3c')][_0x3f87('0x45')]({'where':{'id':_0x3a035c[_0x3f87('0x40')]['id']}})[_0x3f87('0x23')](handleEntityNotFound(_0x16e12d,null))['then'](removeEntity(_0x16e12d,null))[_0x3f87('0x42')](handleError(_0x16e12d,null));};exports[_0x3f87('0x46')]=function(_0xf6aa05,_0x56939a){return db[_0x3f87('0x3c')][_0x3f87('0x46')]()['then'](respondWithResult(_0x56939a,null))[_0x3f87('0x42')](handleError(_0x56939a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 24b4220..0172ff2 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 _0xb97e=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash'];(function(_0x30bbb9,_0x35275b){var _0x819ead=function(_0x5b678e){while(--_0x5b678e){_0x30bbb9['push'](_0x30bbb9['shift']());}};_0x819ead(++_0x35275b);}(_0xb97e,0x86));var _0xeb97=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xb97e[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0xeb97('0x0'));var util=require(_0xeb97('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb97('0x2'));var BPromise=require(_0xeb97('0x3'));var rp=require(_0xeb97('0x4'));var fs=require('fs');var path=require(_0xeb97('0x5'));var rimraf=require(_0xeb97('0x6'));var config=require(_0xeb97('0x7'));var attributes=require(_0xeb97('0x8'));module[_0xeb97('0x9')]=function(_0x12ad56,_0x346b04){return _0x12ad56['define'](_0xeb97('0xa'),attributes,{'tableName':_0xeb97('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xeb97('0xc'),_0xeb97('0xd')]},{'name':_0xeb97('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8a=['report_square','project_name','leaveAt','util','../../config/logger','bluebird','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x302db8,_0x51c417){var _0x5e0063=function(_0x235234){while(--_0x235234){_0x302db8['push'](_0x302db8['shift']());}};_0x5e0063(++_0x51c417);}(_0xcd8a,0x116));var _0xacd8=function(_0x2cfe3b,_0x41be06){_0x2cfe3b=_0x2cfe3b-0x0;var _0x3418cc=_0xcd8a[_0x2cfe3b];return _0x3418cc;};'use strict';var _=require('lodash');var util=require(_0xacd8('0x0'));var logger=require(_0xacd8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xacd8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xacd8('0x3'));var attributes=require(_0xacd8('0x4'));module[_0xacd8('0x5')]=function(_0x1e1f57,_0x1bada2){return _0x1e1f57[_0xacd8('0x6')](_0xacd8('0x7'),attributes,{'tableName':_0xacd8('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xacd8('0x9')]},{'name':_0xacd8('0xa'),'fields':[_0xacd8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index eccd7a0..dd8a686 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 _0x36e9=['error','message','result','catch','CreateSquareReport','body','options','raw','then','UpdateSquareReport','SquareReport','update','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x36e9,0x6a));var _0x936e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x36e9[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x936e('0x0'));var util=require('util');var moment=require(_0x936e('0x1'));var BPromise=require(_0x936e('0x2'));var rs=require(_0x936e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x936e('0x4'))(_0x936e('0x5'));var config=require(_0x936e('0x6'));var jayson=require(_0x936e('0x7'));var client=jayson['client'][_0x936e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d5904,_0x3342fd,_0x7410e4){return new BPromise(function(_0x313a51,_0x22ffe5){return client['request'](_0x4d5904,_0x7410e4)['then'](function(_0xdf9b2b){logger[_0x936e('0x9')](_0x936e('0xa'),_0x3342fd,_0x936e('0xb'));logger[_0x936e('0xc')](_0x936e('0xd'),_0x3342fd,_0x936e('0xb'),JSON['stringify'](_0xdf9b2b));if(_0xdf9b2b[_0x936e('0xe')]){if(_0xdf9b2b[_0x936e('0xe')]['code']===0x1f4){logger[_0x936e('0xe')](_0x936e('0xa'),_0x3342fd,_0xdf9b2b['error']['message']);return _0x22ffe5(_0xdf9b2b[_0x936e('0xe')][_0x936e('0xf')]);}logger[_0x936e('0xe')]('SquareReport,\x20%s,\x20%s',_0x3342fd,_0xdf9b2b[_0x936e('0xe')][_0x936e('0xf')]);return _0x313a51(_0xdf9b2b['error'][_0x936e('0xf')]);}else{logger[_0x936e('0x9')](_0x936e('0xa'),_0x3342fd,_0x936e('0xb'));_0x313a51(_0xdf9b2b[_0x936e('0x10')][_0x936e('0xf')]);}})[_0x936e('0x11')](function(_0x5394ce){logger[_0x936e('0xe')](_0x936e('0xa'),_0x3342fd,_0x5394ce);_0x22ffe5(_0x5394ce);});});}exports[_0x936e('0x12')]=function(_0x5c4130){var _0x132b99=this;return new Promise(function(_0x54b258,_0x2a0171){return db['SquareReport']['create'](_0x5c4130[_0x936e('0x13')],{'raw':_0x5c4130[_0x936e('0x14')]?_0x5c4130[_0x936e('0x14')][_0x936e('0x15')]===undefined?!![]:![]:!![]})[_0x936e('0x16')](function(_0x3cf148){logger[_0x936e('0x9')](_0x936e('0x12'),_0x5c4130);logger['debug']('CreateSquareReport',_0x5c4130,JSON['stringify'](_0x3cf148));_0x54b258(_0x3cf148);})['catch'](function(_0x199b0d){logger['error'](_0x936e('0x12'),_0x199b0d[_0x936e('0xf')],_0x5c4130);_0x2a0171(_0x132b99[_0x936e('0xe')](0x1f4,_0x199b0d['message']));});});};exports[_0x936e('0x17')]=function(_0x344b20){var _0x306cdd=this;return new Promise(function(_0x2e3efc,_0x5221fe){return db[_0x936e('0x18')][_0x936e('0x19')](_0x344b20[_0x936e('0x13')],{'raw':_0x344b20[_0x936e('0x14')]?_0x344b20[_0x936e('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x344b20[_0x936e('0x14')]?_0x344b20[_0x936e('0x14')][_0x936e('0x1a')]||null:null,'attributes':_0x344b20[_0x936e('0x14')]?_0x344b20['options'][_0x936e('0x1b')]||null:null,'limit':_0x344b20[_0x936e('0x14')]?_0x344b20['options'][_0x936e('0x1c')]||null:null})[_0x936e('0x16')](function(_0x2a66d6){logger[_0x936e('0x9')](_0x936e('0x17'),_0x344b20);logger['debug'](_0x936e('0x17'),_0x344b20,JSON[_0x936e('0x1d')](_0x2a66d6));_0x2e3efc(_0x2a66d6);})[_0x936e('0x11')](function(_0x776c49){logger['error'](_0x936e('0x17'),_0x776c49[_0x936e('0xf')],_0x344b20);_0x5221fe(_0x306cdd[_0x936e('0xe')](0x1f4,_0x776c49[_0x936e('0xf')]));});});}; \ No newline at end of file +var _0xb2d7=['then','debug','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','result','catch','SquareReport','create','body','options','CreateSquareReport','UpdateSquareReport','update','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request'];(function(_0x550e8b,_0x5ae96d){var _0x31c0b9=function(_0x292384){while(--_0x292384){_0x550e8b['push'](_0x550e8b['shift']());}};_0x31c0b9(++_0x5ae96d);}(_0xb2d7,0x155));var _0x7b2d=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xb2d7[_0x43b06b];return _0x2c555b;};'use strict';var _=require(_0x7b2d('0x0'));var util=require(_0x7b2d('0x1'));var moment=require(_0x7b2d('0x2'));var BPromise=require(_0x7b2d('0x3'));var rs=require(_0x7b2d('0x4'));var fs=require('fs');var Redis=require(_0x7b2d('0x5'));var db=require(_0x7b2d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b2d('0x7'));var config=require(_0x7b2d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25bffb,_0x414cde,_0x344865){return new BPromise(function(_0x4aa1e4,_0x4dc24c){return client[_0x7b2d('0xa')](_0x25bffb,_0x344865)[_0x7b2d('0xb')](function(_0x2bd22b){logger['info']('SquareReport,\x20%s,\x20%s',_0x414cde,'request\x20sent');logger[_0x7b2d('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x414cde,_0x7b2d('0xd'),JSON[_0x7b2d('0xe')](_0x2bd22b));if(_0x2bd22b['error']){if(_0x2bd22b[_0x7b2d('0xf')][_0x7b2d('0x10')]===0x1f4){logger['error'](_0x7b2d('0x11'),_0x414cde,_0x2bd22b[_0x7b2d('0xf')][_0x7b2d('0x12')]);return _0x4dc24c(_0x2bd22b[_0x7b2d('0xf')]['message']);}logger['error'](_0x7b2d('0x11'),_0x414cde,_0x2bd22b[_0x7b2d('0xf')]['message']);return _0x4aa1e4(_0x2bd22b['error'][_0x7b2d('0x12')]);}else{logger[_0x7b2d('0x13')](_0x7b2d('0x11'),_0x414cde,_0x7b2d('0xd'));_0x4aa1e4(_0x2bd22b[_0x7b2d('0x14')][_0x7b2d('0x12')]);}})[_0x7b2d('0x15')](function(_0x3364fb){logger[_0x7b2d('0xf')]('SquareReport,\x20%s,\x20%s',_0x414cde,_0x3364fb);_0x4dc24c(_0x3364fb);});});}exports['CreateSquareReport']=function(_0x1c08bc){var _0x197947=this;return new Promise(function(_0x2e132f,_0x200286){return db[_0x7b2d('0x16')][_0x7b2d('0x17')](_0x1c08bc[_0x7b2d('0x18')],{'raw':_0x1c08bc[_0x7b2d('0x19')]?_0x1c08bc[_0x7b2d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7b2d('0xb')](function(_0x401dca){logger[_0x7b2d('0x13')](_0x7b2d('0x1a'),_0x1c08bc);logger[_0x7b2d('0xc')](_0x7b2d('0x1a'),_0x1c08bc,JSON[_0x7b2d('0xe')](_0x401dca));_0x2e132f(_0x401dca);})[_0x7b2d('0x15')](function(_0x480aeb){logger['error']('CreateSquareReport',_0x480aeb['message'],_0x1c08bc);_0x200286(_0x197947[_0x7b2d('0xf')](0x1f4,_0x480aeb[_0x7b2d('0x12')]));});});};exports[_0x7b2d('0x1b')]=function(_0x514495){var _0x52d03c=this;return new Promise(function(_0x1f0247,_0x199215){return db[_0x7b2d('0x16')][_0x7b2d('0x1c')](_0x514495[_0x7b2d('0x18')],{'raw':_0x514495['options']?_0x514495['options'][_0x7b2d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514495[_0x7b2d('0x19')]?_0x514495[_0x7b2d('0x19')]['where']||null:null,'attributes':_0x514495[_0x7b2d('0x19')]?_0x514495[_0x7b2d('0x19')][_0x7b2d('0x1e')]||null:null,'limit':_0x514495[_0x7b2d('0x19')]?_0x514495[_0x7b2d('0x19')][_0x7b2d('0x1f')]||null:null})['then'](function(_0x2ae089){logger[_0x7b2d('0x13')](_0x7b2d('0x1b'),_0x514495);logger[_0x7b2d('0xc')](_0x7b2d('0x1b'),_0x514495,JSON[_0x7b2d('0xe')](_0x2ae089));_0x1f0247(_0x2ae089);})['catch'](function(_0x4bc234){logger['error']('UpdateSquareReport',_0x4bc234[_0x7b2d('0x12')],_0x514495);_0x199215(_0x52d03c['error'](0x1f4,_0x4bc234['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 99c82ec..c7c07c8 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 _0xa5fd=['express','fs-extra','../../config/environment','./squareReportDetail.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','update','util','path','connect-timeout'];(function(_0x13af22,_0x31ea4){var _0x13a5bf=function(_0x470952){while(--_0x470952){_0x13af22['push'](_0x13af22['shift']());}};_0x13a5bf(++_0x31ea4);}(_0xa5fd,0x15d));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xda5f('0x0'));var path=require(_0xda5f('0x1'));var timeout=require(_0xda5f('0x2'));var express=require(_0xda5f('0x3'));var router=express['Router']();var fs_extra=require(_0xda5f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda5f('0x5'));var controller=require(_0xda5f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xda5f('0x7')]);router[_0xda5f('0x8')](_0xda5f('0x9'),auth['isAuthenticated'](),controller[_0xda5f('0xa')]);router[_0xda5f('0x8')](_0xda5f('0xb'),auth[_0xda5f('0xc')](),controller[_0xda5f('0xd')]);router[_0xda5f('0xe')]('/',auth[_0xda5f('0xc')](),controller['create']);router['put'](_0xda5f('0xb'),auth[_0xda5f('0xc')](),controller[_0xda5f('0xf')]);router['delete'](_0xda5f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbb42=['get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xbb42,0x6f));var _0x2bb4=function(_0x3e16c4,_0x1f0022){_0x3e16c4=_0x3e16c4-0x0;var _0x3f657d=_0xbb42[_0x3e16c4];return _0x3f657d;};'use strict';var multer=require(_0x2bb4('0x0'));var util=require(_0x2bb4('0x1'));var path=require('path');var timeout=require(_0x2bb4('0x2'));var express=require('express');var router=express[_0x2bb4('0x3')]();var fs_extra=require(_0x2bb4('0x4'));var auth=require(_0x2bb4('0x5'));var interaction=require(_0x2bb4('0x6'));var config=require(_0x2bb4('0x7'));var controller=require(_0x2bb4('0x8'));router[_0x2bb4('0x9')]('/',auth[_0x2bb4('0xa')](),controller[_0x2bb4('0xb')]);router[_0x2bb4('0x9')](_0x2bb4('0xc'),auth[_0x2bb4('0xa')](),controller[_0x2bb4('0xd')]);router[_0x2bb4('0x9')](_0x2bb4('0xe'),auth[_0x2bb4('0xa')](),controller[_0x2bb4('0xf')]);router['post']('/',auth[_0x2bb4('0xa')](),controller[_0x2bb4('0x10')]);router['put'](_0x2bb4('0xe'),auth[_0x2bb4('0xa')](),controller['update']);router[_0x2bb4('0x11')](_0x2bb4('0xe'),auth[_0x2bb4('0xa')](),controller[_0x2bb4('0x12')]);module[_0x2bb4('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ae73334..3375144 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 _0xd21f=['STRING','sequelize','exports'];(function(_0x226f94,_0x111cb2){var _0xb4249f=function(_0x3754f9){while(--_0x3754f9){_0x226f94['push'](_0x226f94['shift']());}};_0xb4249f(++_0x111cb2);}(_0xd21f,0xb2));var _0xfd21=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xd21f[_0x2abc3d];return _0x252745;};'use strict';var Sequelize=require(_0xfd21('0x0'));module[_0xfd21('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xfd21('0x2')]},'application':{'type':Sequelize[_0xfd21('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xfd21('0x2')]},'callerid':{'type':Sequelize[_0xfd21('0x2')]}}; \ No newline at end of file +var _0xb33f=['STRING','TEXT','sequelize'];(function(_0x3387f1,_0x488777){var _0xa19b40=function(_0x5a4d08){while(--_0x5a4d08){_0x3387f1['push'](_0x3387f1['shift']());}};_0xa19b40(++_0x488777);}(_0xb33f,0x8f));var _0xfb33=function(_0x14d8c1,_0xf65d36){_0x14d8c1=_0x14d8c1-0x0;var _0x5def9f=_0xb33f[_0x14d8c1];return _0x5def9f;};'use strict';var Sequelize=require(_0xfb33('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfb33('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xfb33('0x1')]},'data':{'type':Sequelize[_0xfb33('0x2')]},'project_name':{'type':Sequelize[_0xfb33('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8454c79..253f4f4 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 _0x7b32=['destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','update','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','then'];(function(_0x5c4f12,_0x56fbf1){var _0x26da3d=function(_0x4b56de){while(--_0x4b56de){_0x5c4f12['push'](_0x5c4f12['shift']());}};_0x26da3d(++_0x56fbf1);}(_0x7b32,0xbe));var _0x27b3=function(_0x25f90e,_0x2573c4){_0x25f90e=_0x25f90e-0x0;var _0x512b79=_0x7b32[_0x25f90e];return _0x512b79;};'use strict';var emlformat=require(_0x27b3('0x0'));var rimraf=require(_0x27b3('0x1'));var zipdir=require(_0x27b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27b3('0x3'));var moment=require('moment');var BPromise=require(_0x27b3('0x4'));var Mustache=require(_0x27b3('0x5'));var util=require(_0x27b3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x27b3('0x7'));var ejs=require(_0x27b3('0x8'));var fs=require('fs');var fs_extra=require(_0x27b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x27b3('0xa'));var jsforce=require(_0x27b3('0xb'));var deskjs=require(_0x27b3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x27b3('0xd'));var Papa=require(_0x27b3('0xe'));var Redis=require(_0x27b3('0xf'));var authService=require(_0x27b3('0x10'));var qs=require(_0x27b3('0x11'));var as=require(_0x27b3('0x12'));var hardwareService=require(_0x27b3('0x13'));var logger=require(_0x27b3('0x14'))(_0x27b3('0x15'));var utils=require(_0x27b3('0x16'));var config=require(_0x27b3('0x17'));var licenseUtil=require(_0x27b3('0x18'));var db=require(_0x27b3('0x19'))['db'];function respondWithStatusCode(_0x4b13d6,_0x37d4e3){_0x37d4e3=_0x37d4e3||0xcc;return function(_0xbd9dcb){if(_0xbd9dcb){return _0x4b13d6[_0x27b3('0x1a')](_0x37d4e3);}return _0x4b13d6['status'](_0x37d4e3)[_0x27b3('0x1b')]();};}function respondWithResult(_0x24140e,_0x3986be){_0x3986be=_0x3986be||0xc8;return function(_0x5d499b){if(_0x5d499b){return _0x24140e[_0x27b3('0x1c')](_0x3986be)[_0x27b3('0x1d')](_0x5d499b);}};}function respondWithFilteredResult(_0x43eff6,_0x4c56e4){return function(_0xe0e8c8){if(_0xe0e8c8){var _0x525abd=typeof _0x4c56e4[_0x27b3('0x1e')]===_0x27b3('0x1f')&&typeof _0x4c56e4[_0x27b3('0x20')]===_0x27b3('0x1f');var _0x3e0ce6=_0xe0e8c8[_0x27b3('0x21')];var _0x33551c=_0x525abd?0x0:_0x4c56e4[_0x27b3('0x1e')];var _0x128be0=_0x525abd?_0xe0e8c8[_0x27b3('0x21')]:_0x4c56e4[_0x27b3('0x1e')]+_0x4c56e4[_0x27b3('0x20')];var _0x41dbbd;if(_0x128be0>=_0x3e0ce6){_0x128be0=_0x3e0ce6;_0x41dbbd=0xc8;}else{_0x41dbbd=0xce;}_0x43eff6[_0x27b3('0x1c')](_0x41dbbd);return _0x43eff6[_0x27b3('0x22')]('Content-Range',_0x33551c+'-'+_0x128be0+'/'+_0x3e0ce6)['json'](_0xe0e8c8);}return null;};}function patchUpdates(_0x180e54){return function(_0x351812){try{jsonpatch[_0x27b3('0x23')](_0x351812,_0x180e54,!![]);}catch(_0x2a5a9e){return BPromise['reject'](_0x2a5a9e);}return _0x351812[_0x27b3('0x24')]();};}function saveUpdates(_0x38fa08,_0x32535b){return function(_0x1e0a8b){if(_0x1e0a8b){return _0x1e0a8b['update'](_0x38fa08)[_0x27b3('0x25')](function(_0x2ad91f){return _0x2ad91f;});}return null;};}function removeEntity(_0x2d4190,_0x2ff738){return function(_0x50f063){if(_0x50f063){return _0x50f063[_0x27b3('0x26')]()['then'](function(){_0x2d4190['status'](0xcc)[_0x27b3('0x1b')]();});}};}function handleEntityNotFound(_0x52c7e8,_0x24f646){return function(_0x410c8b){if(!_0x410c8b){_0x52c7e8[_0x27b3('0x1a')](0x194);}return _0x410c8b;};}function handleError(_0x51081a,_0x26b6ca){_0x26b6ca=_0x26b6ca||0x1f4;return function(_0x2c4e5c){logger[_0x27b3('0x27')](_0x2c4e5c[_0x27b3('0x28')]);if(_0x2c4e5c[_0x27b3('0x29')]){delete _0x2c4e5c[_0x27b3('0x29')];}_0x51081a[_0x27b3('0x1c')](_0x26b6ca)['send'](_0x2c4e5c);};}exports[_0x27b3('0x2a')]=function(_0x22afd1,_0x607c6d){var _0x36156d={},_0x3ac9a7={},_0x234297={'count':0x0,'rows':[]};var _0x449c1e=_[_0x27b3('0x2b')](db[_0x27b3('0x2c')][_0x27b3('0x2d')],function(_0x43baa0){return{'name':_0x43baa0[_0x27b3('0x2e')],'type':_0x43baa0[_0x27b3('0x2f')][_0x27b3('0x30')]};});_0x3ac9a7[_0x27b3('0x31')]=_[_0x27b3('0x2b')](_0x449c1e,_0x27b3('0x29'));_0x3ac9a7['query']=_['keys'](_0x22afd1[_0x27b3('0x32')]);_0x3ac9a7[_0x27b3('0x33')]=_['intersection'](_0x3ac9a7[_0x27b3('0x31')],_0x3ac9a7[_0x27b3('0x32')]);_0x36156d[_0x27b3('0x34')]=_[_0x27b3('0x35')](_0x3ac9a7[_0x27b3('0x31')],qs[_0x27b3('0x36')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x36')]));_0x36156d[_0x27b3('0x34')]=_0x36156d['attributes'][_0x27b3('0x37')]?_0x36156d[_0x27b3('0x34')]:_0x3ac9a7[_0x27b3('0x31')];if(!_0x22afd1[_0x27b3('0x32')][_0x27b3('0x38')]('nolimit')){_0x36156d['limit']=qs['limit'](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x20')]);_0x36156d['offset']=qs[_0x27b3('0x1e')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x1e')]);}_0x36156d[_0x27b3('0x39')]=qs[_0x27b3('0x3a')](_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3a')]);_0x36156d[_0x27b3('0x3b')]=qs[_0x27b3('0x33')](_[_0x27b3('0x3c')](_0x22afd1['query'],_0x3ac9a7['filters']),_0x449c1e);if(_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3d')]){_0x36156d[_0x27b3('0x3b')]=_[_0x27b3('0x3e')](_0x36156d[_0x27b3('0x3b')],{'$or':_[_0x27b3('0x2b')](_0x449c1e,function(_0x40430d){if(_0x40430d['type']!=='VIRTUAL'){var _0x547877={};_0x547877[_0x40430d[_0x27b3('0x29')]]={'$like':'%'+_0x22afd1[_0x27b3('0x32')][_0x27b3('0x3d')]+'%'};return _0x547877;}})});}_0x36156d=_['merge']({},_0x36156d,_0x22afd1[_0x27b3('0x3f')]);var _0x3cbc9b={'where':_0x36156d[_0x27b3('0x3b')]};return db[_0x27b3('0x2c')][_0x27b3('0x21')](_0x3cbc9b)[_0x27b3('0x25')](function(_0x264c37){_0x234297[_0x27b3('0x21')]=_0x264c37;if(_0x22afd1[_0x27b3('0x32')][_0x27b3('0x40')]){_0x36156d[_0x27b3('0x41')]=[{'all':!![]}];}return db[_0x27b3('0x2c')][_0x27b3('0x42')](_0x36156d);})[_0x27b3('0x25')](function(_0x3e1d5e){_0x234297[_0x27b3('0x43')]=_0x3e1d5e;return _0x234297;})['then'](respondWithFilteredResult(_0x607c6d,_0x36156d))['catch'](handleError(_0x607c6d,null));};exports[_0x27b3('0x44')]=function(_0xecf229,_0xf7e237){var _0x47b5a3={'raw':!![],'where':{'id':_0xecf229[_0x27b3('0x45')]['id']}},_0xf7aeb7={};_0xf7aeb7[_0x27b3('0x31')]=_[_0x27b3('0x46')](db[_0x27b3('0x2c')][_0x27b3('0x2d')]);_0xf7aeb7[_0x27b3('0x32')]=_[_0x27b3('0x46')](_0xecf229[_0x27b3('0x32')]);_0xf7aeb7[_0x27b3('0x33')]=_[_0x27b3('0x35')](_0xf7aeb7[_0x27b3('0x31')],_0xf7aeb7[_0x27b3('0x32')]);_0x47b5a3['attributes']=_[_0x27b3('0x35')](_0xf7aeb7['model'],qs['fields'](_0xecf229[_0x27b3('0x32')][_0x27b3('0x36')]));_0x47b5a3[_0x27b3('0x34')]=_0x47b5a3[_0x27b3('0x34')]['length']?_0x47b5a3[_0x27b3('0x34')]:_0xf7aeb7['model'];if(_0xecf229[_0x27b3('0x32')][_0x27b3('0x40')]){_0x47b5a3[_0x27b3('0x41')]=[{'all':!![]}];}_0x47b5a3=_[_0x27b3('0x3e')]({},_0x47b5a3,_0xecf229['options']);return db[_0x27b3('0x2c')][_0x27b3('0x47')](_0x47b5a3)[_0x27b3('0x25')](handleEntityNotFound(_0xf7e237,null))[_0x27b3('0x25')](respondWithResult(_0xf7e237,null))[_0x27b3('0x48')](handleError(_0xf7e237,null));};exports[_0x27b3('0x49')]=function(_0xc8c49c,_0x2e450c){return db[_0x27b3('0x2c')][_0x27b3('0x49')](_0xc8c49c['body'],{})[_0x27b3('0x25')](respondWithResult(_0x2e450c,0xc9))[_0x27b3('0x48')](handleError(_0x2e450c,null));};exports[_0x27b3('0x4a')]=function(_0x4c389e,_0x37f5f6){if(_0x4c389e[_0x27b3('0x4b')]['id']){delete _0x4c389e[_0x27b3('0x4b')]['id'];}return db[_0x27b3('0x2c')][_0x27b3('0x47')]({'where':{'id':_0x4c389e[_0x27b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x37f5f6,null))['then'](saveUpdates(_0x4c389e[_0x27b3('0x4b')],null))[_0x27b3('0x25')](respondWithResult(_0x37f5f6,null))['catch'](handleError(_0x37f5f6,null));};exports[_0x27b3('0x26')]=function(_0x33428f,_0x43af38){return db[_0x27b3('0x2c')][_0x27b3('0x47')]({'where':{'id':_0x33428f[_0x27b3('0x45')]['id']}})['then'](handleEntityNotFound(_0x43af38,null))['then'](removeEntity(_0x43af38,null))['catch'](handleError(_0x43af38,null));};exports['describe']=function(_0x5a086b,_0x28cec0){return db[_0x27b3('0x2c')]['describe']()['then'](respondWithResult(_0x28cec0,null))[_0x27b3('0x48')](handleError(_0x28cec0,null));}; \ No newline at end of file +var _0x5cd9=['merge','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','order','where','pick','filter'];(function(_0x428f54,_0x1783db){var _0x201622=function(_0x4d67fa){while(--_0x4d67fa){_0x428f54['push'](_0x428f54['shift']());}};_0x201622(++_0x1783db);}(_0x5cd9,0x1cf));var _0x95cd=function(_0x92116d,_0xa6ee1b){_0x92116d=_0x92116d-0x0;var _0xfe4f60=_0x5cd9[_0x92116d];return _0xfe4f60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95cd('0x0'));var zipdir=require(_0x95cd('0x1'));var jsonpatch=require(_0x95cd('0x2'));var rp=require(_0x95cd('0x3'));var moment=require(_0x95cd('0x4'));var BPromise=require(_0x95cd('0x5'));var Mustache=require(_0x95cd('0x6'));var util=require(_0x95cd('0x7'));var path=require('path');var sox=require(_0x95cd('0x8'));var csv=require('to-csv');var ejs=require(_0x95cd('0x9'));var fs=require('fs');var fs_extra=require(_0x95cd('0xa'));var _=require(_0x95cd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x95cd('0xc'));var toCsv=require(_0x95cd('0xd'));var querystring=require(_0x95cd('0xe'));var Papa=require('papaparse');var Redis=require(_0x95cd('0xf'));var authService=require(_0x95cd('0x10'));var qs=require(_0x95cd('0x11'));var as=require(_0x95cd('0x12'));var hardwareService=require(_0x95cd('0x13'));var logger=require(_0x95cd('0x14'))(_0x95cd('0x15'));var utils=require(_0x95cd('0x16'));var config=require(_0x95cd('0x17'));var licenseUtil=require(_0x95cd('0x18'));var db=require(_0x95cd('0x19'))['db'];function respondWithStatusCode(_0x50e670,_0x252cd1){_0x252cd1=_0x252cd1||0xcc;return function(_0x42daab){if(_0x42daab){return _0x50e670[_0x95cd('0x1a')](_0x252cd1);}return _0x50e670['status'](_0x252cd1)[_0x95cd('0x1b')]();};}function respondWithResult(_0x543306,_0x121325){_0x121325=_0x121325||0xc8;return function(_0x1b4107){if(_0x1b4107){return _0x543306['status'](_0x121325)[_0x95cd('0x1c')](_0x1b4107);}};}function respondWithFilteredResult(_0x4df2a9,_0x12bc5a){return function(_0x34d375){if(_0x34d375){var _0x7c9741=typeof _0x12bc5a[_0x95cd('0x1d')]===_0x95cd('0x1e')&&typeof _0x12bc5a[_0x95cd('0x1f')]===_0x95cd('0x1e');var _0x23523a=_0x34d375[_0x95cd('0x20')];var _0x53ddc2=_0x7c9741?0x0:_0x12bc5a['offset'];var _0xaf144d=_0x7c9741?_0x34d375[_0x95cd('0x20')]:_0x12bc5a[_0x95cd('0x1d')]+_0x12bc5a[_0x95cd('0x1f')];var _0x384d75;if(_0xaf144d>=_0x23523a){_0xaf144d=_0x23523a;_0x384d75=0xc8;}else{_0x384d75=0xce;}_0x4df2a9[_0x95cd('0x21')](_0x384d75);return _0x4df2a9[_0x95cd('0x22')](_0x95cd('0x23'),_0x53ddc2+'-'+_0xaf144d+'/'+_0x23523a)['json'](_0x34d375);}return null;};}function patchUpdates(_0x18f312){return function(_0xf171f2){try{jsonpatch[_0x95cd('0x24')](_0xf171f2,_0x18f312,!![]);}catch(_0x339d64){return BPromise['reject'](_0x339d64);}return _0xf171f2[_0x95cd('0x25')]();};}function saveUpdates(_0x3f89a5,_0x3f7c00){return function(_0x2adeb4){if(_0x2adeb4){return _0x2adeb4[_0x95cd('0x26')](_0x3f89a5)[_0x95cd('0x27')](function(_0x1b057c){return _0x1b057c;});}return null;};}function removeEntity(_0x16375c,_0x124c93){return function(_0x4b6d90){if(_0x4b6d90){return _0x4b6d90[_0x95cd('0x28')]()['then'](function(){_0x16375c[_0x95cd('0x21')](0xcc)[_0x95cd('0x1b')]();});}};}function handleEntityNotFound(_0xf14465,_0x51d9e2){return function(_0xa01645){if(!_0xa01645){_0xf14465[_0x95cd('0x1a')](0x194);}return _0xa01645;};}function handleError(_0x1dde44,_0x59862f){_0x59862f=_0x59862f||0x1f4;return function(_0x2fb064){logger['error'](_0x2fb064[_0x95cd('0x29')]);if(_0x2fb064[_0x95cd('0x2a')]){delete _0x2fb064['name'];}_0x1dde44['status'](_0x59862f)[_0x95cd('0x2b')](_0x2fb064);};}exports[_0x95cd('0x2c')]=function(_0x3a1d17,_0x58f87e){var _0x2975b2={},_0xafa095={},_0x4930eb={'count':0x0,'rows':[]};var _0x1038da=_[_0x95cd('0x2d')](db[_0x95cd('0x2e')][_0x95cd('0x2f')],function(_0x200e4e){return{'name':_0x200e4e[_0x95cd('0x30')],'type':_0x200e4e[_0x95cd('0x31')]['key']};});_0xafa095[_0x95cd('0x32')]=_[_0x95cd('0x2d')](_0x1038da,_0x95cd('0x2a'));_0xafa095['query']=_[_0x95cd('0x33')](_0x3a1d17[_0x95cd('0x34')]);_0xafa095[_0x95cd('0x35')]=_[_0x95cd('0x36')](_0xafa095[_0x95cd('0x32')],_0xafa095[_0x95cd('0x34')]);_0x2975b2['attributes']=_[_0x95cd('0x36')](_0xafa095[_0x95cd('0x32')],qs[_0x95cd('0x37')](_0x3a1d17[_0x95cd('0x34')]['fields']));_0x2975b2['attributes']=_0x2975b2[_0x95cd('0x38')][_0x95cd('0x39')]?_0x2975b2[_0x95cd('0x38')]:_0xafa095[_0x95cd('0x32')];if(!_0x3a1d17['query']['hasOwnProperty']('nolimit')){_0x2975b2[_0x95cd('0x1f')]=qs['limit'](_0x3a1d17[_0x95cd('0x34')]['limit']);_0x2975b2[_0x95cd('0x1d')]=qs['offset'](_0x3a1d17['query'][_0x95cd('0x1d')]);}_0x2975b2[_0x95cd('0x3a')]=qs['sort'](_0x3a1d17[_0x95cd('0x34')]['sort']);_0x2975b2[_0x95cd('0x3b')]=qs[_0x95cd('0x35')](_[_0x95cd('0x3c')](_0x3a1d17['query'],_0xafa095['filters']),_0x1038da);if(_0x3a1d17[_0x95cd('0x34')][_0x95cd('0x3d')]){_0x2975b2['where']=_[_0x95cd('0x3e')](_0x2975b2['where'],{'$or':_['map'](_0x1038da,function(_0x2fb8a7){if(_0x2fb8a7[_0x95cd('0x31')]!==_0x95cd('0x3f')){var _0xaa9c69={};_0xaa9c69[_0x2fb8a7[_0x95cd('0x2a')]]={'$like':'%'+_0x3a1d17[_0x95cd('0x34')][_0x95cd('0x3d')]+'%'};return _0xaa9c69;}})});}_0x2975b2=_[_0x95cd('0x3e')]({},_0x2975b2,_0x3a1d17['options']);var _0x8330b0={'where':_0x2975b2['where']};return db[_0x95cd('0x2e')][_0x95cd('0x20')](_0x8330b0)[_0x95cd('0x27')](function(_0x4a37fc){_0x4930eb['count']=_0x4a37fc;if(_0x3a1d17[_0x95cd('0x34')]['includeAll']){_0x2975b2[_0x95cd('0x40')]=[{'all':!![]}];}return db[_0x95cd('0x2e')][_0x95cd('0x41')](_0x2975b2);})[_0x95cd('0x27')](function(_0x3a238b){_0x4930eb[_0x95cd('0x42')]=_0x3a238b;return _0x4930eb;})['then'](respondWithFilteredResult(_0x58f87e,_0x2975b2))[_0x95cd('0x43')](handleError(_0x58f87e,null));};exports['show']=function(_0x18798a,_0x5953d0){var _0x4c1974={'raw':!![],'where':{'id':_0x18798a[_0x95cd('0x44')]['id']}},_0x4af42f={};_0x4af42f[_0x95cd('0x32')]=_[_0x95cd('0x33')](db[_0x95cd('0x2e')][_0x95cd('0x2f')]);_0x4af42f[_0x95cd('0x34')]=_[_0x95cd('0x33')](_0x18798a[_0x95cd('0x34')]);_0x4af42f[_0x95cd('0x35')]=_['intersection'](_0x4af42f['model'],_0x4af42f['query']);_0x4c1974['attributes']=_['intersection'](_0x4af42f['model'],qs[_0x95cd('0x37')](_0x18798a['query']['fields']));_0x4c1974[_0x95cd('0x38')]=_0x4c1974[_0x95cd('0x38')]['length']?_0x4c1974[_0x95cd('0x38')]:_0x4af42f[_0x95cd('0x32')];if(_0x18798a['query'][_0x95cd('0x45')]){_0x4c1974[_0x95cd('0x40')]=[{'all':!![]}];}_0x4c1974=_[_0x95cd('0x3e')]({},_0x4c1974,_0x18798a[_0x95cd('0x46')]);return db['SquareDetailsReport'][_0x95cd('0x47')](_0x4c1974)[_0x95cd('0x27')](handleEntityNotFound(_0x5953d0,null))[_0x95cd('0x27')](respondWithResult(_0x5953d0,null))['catch'](handleError(_0x5953d0,null));};exports['create']=function(_0x3e2360,_0x206c79){return db[_0x95cd('0x2e')][_0x95cd('0x48')](_0x3e2360[_0x95cd('0x49')],{})[_0x95cd('0x27')](respondWithResult(_0x206c79,0xc9))[_0x95cd('0x43')](handleError(_0x206c79,null));};exports[_0x95cd('0x26')]=function(_0x1f9ae7,_0x204a5d){if(_0x1f9ae7['body']['id']){delete _0x1f9ae7['body']['id'];}return db[_0x95cd('0x2e')][_0x95cd('0x47')]({'where':{'id':_0x1f9ae7['params']['id']}})[_0x95cd('0x27')](handleEntityNotFound(_0x204a5d,null))[_0x95cd('0x27')](saveUpdates(_0x1f9ae7[_0x95cd('0x49')],null))['then'](respondWithResult(_0x204a5d,null))['catch'](handleError(_0x204a5d,null));};exports[_0x95cd('0x28')]=function(_0x326714,_0xf0d7f3){return db[_0x95cd('0x2e')]['find']({'where':{'id':_0x326714[_0x95cd('0x44')]['id']}})[_0x95cd('0x27')](handleEntityNotFound(_0xf0d7f3,null))[_0x95cd('0x27')](removeEntity(_0xf0d7f3,null))[_0x95cd('0x43')](handleError(_0xf0d7f3,null));};exports[_0x95cd('0x4a')]=function(_0x25f70f,_0x1f128a){return db['SquareDetailsReport'][_0x95cd('0x4a')]()[_0x95cd('0x27')](respondWithResult(_0x1f128a,null))[_0x95cd('0x43')](handleError(_0x1f128a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1baf931..cceed0e 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 _0x8a1c=['path','rimraf','../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8a1c,0x13f));var _0xc8a1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8a1c[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xc8a1('0x0'));var util=require(_0xc8a1('0x1'));var logger=require(_0xc8a1('0x2'))(_0xc8a1('0x3'));var moment=require('moment');var BPromise=require(_0xc8a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8a1('0x5'));var rimraf=require(_0xc8a1('0x6'));var config=require(_0xc8a1('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0xc8a1('0x8')]=function(_0x180639,_0x5e298c){return _0x180639[_0xc8a1('0x9')](_0xc8a1('0xa'),attributes,{'tableName':_0xc8a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2c3=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_square_details','lodash','util','../../config/logger'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xf2c3,0x11d));var _0x3f2c=function(_0x5cfae8,_0x2734e7){_0x5cfae8=_0x5cfae8-0x0;var _0xd8d3bf=_0xf2c3[_0x5cfae8];return _0xd8d3bf;};'use strict';var _=require(_0x3f2c('0x0'));var util=require(_0x3f2c('0x1'));var logger=require(_0x3f2c('0x2'))(_0x3f2c('0x3'));var moment=require('moment');var BPromise=require(_0x3f2c('0x4'));var rp=require(_0x3f2c('0x5'));var fs=require('fs');var path=require(_0x3f2c('0x6'));var rimraf=require(_0x3f2c('0x7'));var config=require(_0x3f2c('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x3f2c('0x9')]=function(_0x167c1d,_0xbd2f86){return _0x167c1d[_0x3f2c('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x3f2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index d6d6b5c..5afba07 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 _0xea28=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','debug','lodash','util','moment','bluebird','randomstring'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xea28,0x13a));var _0x8ea2=function(_0x37288f,_0x370d31){_0x37288f=_0x37288f-0x0;var _0xb8f198=_0xea28[_0x37288f];return _0xb8f198;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')](_0x1b64cf[_0x8ea2('0x1a')],{'raw':_0x1b64cf[_0x8ea2('0x1b')]?_0x1b64cf['options']['raw']===undefined?!![]:![]:!![]})[_0x8ea2('0xd')](function(_0x248c18){logger[_0x8ea2('0xe')]('CreateSquareDetailsReport',_0x1b64cf);logger[_0x8ea2('0x1c')](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x248c18));_0x467045(_0x248c18);})[_0x8ea2('0x16')](function(_0x283f00){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x283f00[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x283f00[_0x8ea2('0x14')]));});});}; \ No newline at end of file +var _0x896e=['message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x312764,_0x21f151){var _0x3b06e7=function(_0x2429a5){while(--_0x2429a5){_0x312764['push'](_0x312764['shift']());}};_0x3b06e7(++_0x21f151);}(_0x896e,0x1e9));var _0xe896=function(_0x1ea8da,_0x2d700e){_0x1ea8da=_0x1ea8da-0x0;var _0x311f9c=_0x896e[_0x1ea8da];return _0x311f9c;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')](_0x32f86d[_0xe896('0x1b')],{'raw':_0x32f86d[_0xe896('0x1c')]?_0x32f86d[_0xe896('0x1c')][_0xe896('0x1d')]===undefined?!![]:![]:!![]})[_0xe896('0xe')](function(_0x49547b){logger[_0xe896('0x16')]('CreateSquareDetailsReport',_0x32f86d);logger['debug'](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x49547b));_0x5dc89d(_0x49547b);})[_0xe896('0x17')](function(_0xeeec7c){logger['error'](_0xe896('0x18'),_0xeeec7c['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0xeeec7c[_0xe896('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c986d7e..41ac22f 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 _0x4135=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','killProcess'];(function(_0x50d9c1,_0x14f696){var _0x2e3e1c=function(_0xda6bf2){while(--_0xda6bf2){_0x50d9c1['push'](_0x50d9c1['shift']());}};_0x2e3e1c(++_0x14f696);}(_0x4135,0xd0));var _0x5413=function(_0x5ad966,_0x635bc3){_0x5ad966=_0x5ad966-0x0;var _0x2988b6=_0x4135[_0x5ad966];return _0x2988b6;};'use strict';var express=require(_0x5413('0x0'));var router=express[_0x5413('0x1')]();var auth=require(_0x5413('0x2'));var controller=require(_0x5413('0x3'));router[_0x5413('0x4')]('/',auth['isAuthenticated'](),controller[_0x5413('0x5')]);router['get'](_0x5413('0x6'),auth['isAuthenticated'](),controller[_0x5413('0x7')]);module['exports']=router; \ No newline at end of file +var _0xdfd5=['Router','./system.controller','get','index','/process/:pid/kill','exports','express'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0xdfd5,0x68));var _0x5dfd=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xdfd5[_0x279d37];return _0x530173;};'use strict';var express=require(_0x5dfd('0x0'));var router=express[_0x5dfd('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5dfd('0x2'));router[_0x5dfd('0x3')]('/',auth['isAuthenticated'](),controller[_0x5dfd('0x4')]);router[_0x5dfd('0x3')](_0x5dfd('0x5'),auth['isAuthenticated'](),controller['killProcess']);module[_0x5dfd('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index ae2d41e..c86957b 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 _0x7879=['pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','util','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x3edebb,_0x24270c){var _0x403888=function(_0x56b314){while(--_0x56b314){_0x3edebb['push'](_0x3edebb['shift']());}};_0x403888(++_0x24270c);}(_0x7879,0x73));var _0x9787=function(_0xe6f1ba,_0x5770ab){_0xe6f1ba=_0xe6f1ba-0x0;var _0x131e8b=_0x7879[_0xe6f1ba];return _0x131e8b;};'use strict';var info=require(_0x9787('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x9787('0x1'))('api');var util=require(_0x9787('0x2'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x4e2463,_0x15aef4,_0x3107ee){_0x15aef4=_0x15aef4||0x1f4;return function(_0x2d6992){logger['error'](_0x9787('0x3'),_0x3107ee,_0x15aef4,util[_0x9787('0x4')](_0x2d6992,{'showHidden':![],'depth':null}));delete _0x2d6992[_0x9787('0x5')];_0x4e2463[_0x9787('0x6')](_0x15aef4)[_0x9787('0x7')](_0x2d6992);};}exports[_0x9787('0x8')]=function(_0x5989dc,_0x2e3c6b){return info[_0x9787('0x9')]()[_0x9787('0xa')](function(_0x2bdab9){return _0x2e3c6b[_0x9787('0x6')](0xc8)['json'](_0x2bdab9);})[_0x9787('0xb')](function(_0x50f09d){return _0x2e3c6b[_0x9787('0x6')](0x1f4)['json'](_0x50f09d);});};exports[_0x9787('0xc')]=function(_0x59f9f0,_0x381ca3){var _0xaf251d=[_0x9787('0xd')];return new BPromise(function(_0x4394e6,_0x19c91b){return exec(util[_0x9787('0xe')](_0x9787('0xf'),_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')]),function(_0x261b9f,_0x24a793,_0x4ab31b){if(_0x261b9f){return _0x19c91b(_0x261b9f);}return _0x4394e6(_0x24a793);});})[_0x9787('0xa')](function(_0x1f66b0){var _0x82e909=![];var _0x1195d5=_0x1f66b0['split'](/\n/);for(var _0xfb9403=0x0,_0x5d5165=_0xaf251d[_0x9787('0x12')];_0xfb9403<_0x5d5165,_0x82e909===![];_0xfb9403+=0x1){if(_0x1f66b0['indexOf'](_0xaf251d[_0xfb9403])>=0x0){_0x82e909=!![];}}if(!_0x82e909){throw new Error(util[_0x9787('0xe')](_0x9787('0x13'),_0x59f9f0[_0x9787('0x10')]['pid']));}process['kill'](_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')],_0x9787('0x14'));return _0x381ca3[_0x9787('0x6')](0xc8)['json']({'message':util['format'](_0x9787('0x15'),_0x59f9f0[_0x9787('0x10')][_0x9787('0x11')])});})['catch'](handleError(_0x381ca3,null,_0x9787('0xc')));}; \ No newline at end of file +var _0x4cad=['send','index','getAllData','then','status','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash'];(function(_0x291397,_0x280d92){var _0x50ce46=function(_0x2dd5fc){while(--_0x2dd5fc){_0x291397['push'](_0x291397['shift']());}};_0x50ce46(++_0x280d92);}(_0x4cad,0x179));var _0xd4ca=function(_0x29630a,_0x3fc512){_0x29630a=_0x29630a-0x0;var _0x114221=_0x4cad[_0x29630a];return _0x114221;};'use strict';var info=require(_0xd4ca('0x0'));var exec=require(_0xd4ca('0x1'))[_0xd4ca('0x2')];var logger=require(_0xd4ca('0x3'))(_0xd4ca('0x4'));var util=require('util');var BPromise=require(_0xd4ca('0x5'));var _=require(_0xd4ca('0x6'));function handleError(_0x957f94,_0x39a7ae,_0x82abc3){_0x39a7ae=_0x39a7ae||0x1f4;return function(_0x1a70d5){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x82abc3,_0x39a7ae,util['inspect'](_0x1a70d5,{'showHidden':![],'depth':null}));delete _0x1a70d5['name'];_0x957f94['status'](_0x39a7ae)[_0xd4ca('0x7')](_0x1a70d5);};}exports[_0xd4ca('0x8')]=function(_0x46c3bf,_0x310286){return info[_0xd4ca('0x9')]()[_0xd4ca('0xa')](function(_0x4e1655){return _0x310286[_0xd4ca('0xb')](0xc8)[_0xd4ca('0xc')](_0x4e1655);})['catch'](function(_0x23270){return _0x310286[_0xd4ca('0xb')](0x1f4)['json'](_0x23270);});};exports[_0xd4ca('0xd')]=function(_0x5e83eb,_0x36c88f){var _0x47dfd5=[_0xd4ca('0xe')];return new BPromise(function(_0x29341d,_0x2fd999){return exec(util[_0xd4ca('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5e83eb[_0xd4ca('0x10')][_0xd4ca('0x11')]),function(_0x3231a9,_0x276318,_0x96e318){if(_0x3231a9){return _0x2fd999(_0x3231a9);}return _0x29341d(_0x276318);});})[_0xd4ca('0xa')](function(_0x43cd03){var _0x12a302=![];var _0x637a8f=_0x43cd03['split'](/\n/);for(var _0x2cd2be=0x0,_0x2bd161=_0x47dfd5[_0xd4ca('0x12')];_0x2cd2be<_0x2bd161,_0x12a302===![];_0x2cd2be+=0x1){if(_0x43cd03[_0xd4ca('0x13')](_0x47dfd5[_0x2cd2be])>=0x0){_0x12a302=!![];}}if(!_0x12a302){throw new Error(util[_0xd4ca('0xf')](_0xd4ca('0x14'),_0x5e83eb[_0xd4ca('0x10')][_0xd4ca('0x11')]));}process[_0xd4ca('0x15')](_0x5e83eb['params'][_0xd4ca('0x11')],_0xd4ca('0x16'));return _0x36c88f[_0xd4ca('0xb')](0xc8)[_0xd4ca('0xc')]({'message':util[_0xd4ca('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5e83eb[_0xd4ca('0x10')][_0xd4ca('0x11')])});})[_0xd4ca('0x17')](handleError(_0x36c88f,null,_0xd4ca('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 05bf84f..3e54d20 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 _0x3e5b=['put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x3e5b,0x1e9));var _0xb3e5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3e5b[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xb3e5('0x0'));var path=require(_0xb3e5('0x1'));var timeout=require(_0xb3e5('0x2'));var express=require(_0xb3e5('0x3'));var router=express['Router']();var fs_extra=require(_0xb3e5('0x4'));var auth=require(_0xb3e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3e5('0x6'));var controller=require(_0xb3e5('0x7'));router['get']('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x9')]);router[_0xb3e5('0xa')](_0xb3e5('0xb'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xc')]);router[_0xb3e5('0xd')]('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xe')]);router[_0xb3e5('0xf')]('/:id',auth[_0xb3e5('0x8')](),controller['update']);router['delete'](_0xb3e5('0xb'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x10')]);module[_0xb3e5('0x11')]=router; \ No newline at end of file +var _0x737b=['create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4f7a0d,_0x38da8f){var _0xeac787=function(_0x28380b){while(--_0x28380b){_0x4f7a0d['push'](_0x4f7a0d['shift']());}};_0xeac787(++_0x38da8f);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb737('0x0'));var util=require(_0xb737('0x1'));var path=require('path');var timeout=require(_0xb737('0x2'));var express=require(_0xb737('0x3'));var router=express[_0xb737('0x4')]();var fs_extra=require(_0xb737('0x5'));var auth=require(_0xb737('0x6'));var interaction=require(_0xb737('0x7'));var config=require(_0xb737('0x8'));var controller=require(_0xb737('0x9'));router[_0xb737('0xa')]('/',auth[_0xb737('0xb')](),controller[_0xb737('0xc')]);router[_0xb737('0xa')](_0xb737('0xd'),auth[_0xb737('0xb')](),controller[_0xb737('0xe')]);router[_0xb737('0xf')]('/',auth[_0xb737('0xb')](),controller[_0xb737('0x10')]);router[_0xb737('0x11')](_0xb737('0xd'),auth[_0xb737('0xb')](),controller['update']);router['delete'](_0xb737('0xd'),auth[_0xb737('0xb')](),controller['destroy']);module[_0xb737('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index ba8ea09..02020ce 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 _0xb9be=['name','#0091EA','sequelize','exports','STRING'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0xb9be,0xc5));var _0xeb9b=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0xb9be[_0x2f3ecd];return _0xffdc44;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'unique':_0xeb9b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':_0xeb9b('0x4')},'description':{'type':Sequelize[_0xeb9b('0x2')]}}; \ No newline at end of file +var _0x83e1=['#0091EA','sequelize','exports','name'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x83e1,0x1ad));var _0x183e=function(_0x4588bd,_0x57222b){_0x4588bd=_0x4588bd-0x0;var _0x1becaa=_0x83e1[_0x4588bd];return _0x1becaa;};'use strict';var Sequelize=require(_0x183e('0x0'));module[_0x183e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x183e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x183e('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index cae26ae..a85e0a0 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 _0xa588=['apply','reject','save','update','then','destroy','get','Tags','sendStatus','error','index','map','Tag','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','undefined','count','limit','set','Content-Range'];(function(_0x56de2e,_0x1e9fdd){var _0x51c2f5=function(_0x4d8d1c){while(--_0x4d8d1c){_0x56de2e['push'](_0x56de2e['shift']());}};_0x51c2f5(++_0x1e9fdd);}(_0xa588,0xe1));var _0x8a58=function(_0x1d2b08,_0x3a430f){_0x1d2b08=_0x1d2b08-0x0;var _0x41d019=_0xa588[_0x1d2b08];return _0x41d019;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a58('0x0'));var zipdir=require(_0x8a58('0x1'));var jsonpatch=require(_0x8a58('0x2'));var rp=require(_0x8a58('0x3'));var moment=require(_0x8a58('0x4'));var BPromise=require(_0x8a58('0x5'));var Mustache=require(_0x8a58('0x6'));var util=require(_0x8a58('0x7'));var path=require(_0x8a58('0x8'));var sox=require('sox');var csv=require(_0x8a58('0x9'));var ejs=require(_0x8a58('0xa'));var fs=require('fs');var fs_extra=require(_0x8a58('0xb'));var _=require(_0x8a58('0xc'));var squel=require(_0x8a58('0xd'));var crypto=require(_0x8a58('0xe'));var jsforce=require(_0x8a58('0xf'));var deskjs=require(_0x8a58('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a58('0x11'));var Papa=require(_0x8a58('0x12'));var Redis=require(_0x8a58('0x13'));var authService=require(_0x8a58('0x14'));var qs=require(_0x8a58('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a58('0x16'));var logger=require(_0x8a58('0x17'))(_0x8a58('0x18'));var utils=require(_0x8a58('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a58('0x1a'))['db'];function respondWithStatusCode(_0x5ec103,_0x21208d){_0x21208d=_0x21208d||0xcc;return function(_0xc5d2fa){if(_0xc5d2fa){return _0x5ec103['sendStatus'](_0x21208d);}return _0x5ec103[_0x8a58('0x1b')](_0x21208d)[_0x8a58('0x1c')]();};}function respondWithResult(_0x56a61d,_0x3d40a5){_0x3d40a5=_0x3d40a5||0xc8;return function(_0x268506){if(_0x268506){return _0x56a61d['status'](_0x3d40a5)[_0x8a58('0x1d')](_0x268506);}};}function respondWithFilteredResult(_0x18a33c,_0x3010ae){return function(_0x3ff39e){if(_0x3ff39e){var _0x26e3a8=typeof _0x3010ae[_0x8a58('0x1e')]===_0x8a58('0x1f')&&typeof _0x3010ae['limit']==='undefined';var _0x31de8d=_0x3ff39e[_0x8a58('0x20')];var _0x18a14d=_0x26e3a8?0x0:_0x3010ae['offset'];var _0x282f2d=_0x26e3a8?_0x3ff39e[_0x8a58('0x20')]:_0x3010ae['offset']+_0x3010ae[_0x8a58('0x21')];var _0x15b527;if(_0x282f2d>=_0x31de8d){_0x282f2d=_0x31de8d;_0x15b527=0xc8;}else{_0x15b527=0xce;}_0x18a33c[_0x8a58('0x1b')](_0x15b527);return _0x18a33c[_0x8a58('0x22')](_0x8a58('0x23'),_0x18a14d+'-'+_0x282f2d+'/'+_0x31de8d)[_0x8a58('0x1d')](_0x3ff39e);}return null;};}function patchUpdates(_0x284bb8){return function(_0x115e19){try{jsonpatch[_0x8a58('0x24')](_0x115e19,_0x284bb8,!![]);}catch(_0xbf556a){return BPromise[_0x8a58('0x25')](_0xbf556a);}return _0x115e19[_0x8a58('0x26')]();};}function saveUpdates(_0x3758fa,_0x34adb8){return function(_0x561a9a){if(_0x561a9a){return _0x561a9a[_0x8a58('0x27')](_0x3758fa)[_0x8a58('0x28')](function(_0x20a6c5){return _0x20a6c5;});}return null;};}function removeEntity(_0x3f07ab,_0x22c898){return function(_0x415946){if(_0x415946){return _0x415946[_0x8a58('0x29')]()['then'](function(){var _0x1ff181=_0x415946[_0x8a58('0x2a')]({'plain':!![]});var _0x30c96b=_0x8a58('0x2b');return db['UserProfileResource'][_0x8a58('0x29')]({'where':{'type':_0x30c96b,'resourceId':_0x1ff181['id']}})[_0x8a58('0x28')](function(){return _0x415946;});})[_0x8a58('0x28')](function(){_0x3f07ab['status'](0xcc)[_0x8a58('0x1c')]();});}};}function handleEntityNotFound(_0x31abcc,_0x4426ff){return function(_0x27d7c8){if(!_0x27d7c8){_0x31abcc[_0x8a58('0x2c')](0x194);}return _0x27d7c8;};}function handleError(_0x3e317f,_0x1a411a){_0x1a411a=_0x1a411a||0x1f4;return function(_0x4d5041){logger[_0x8a58('0x2d')](_0x4d5041['stack']);if(_0x4d5041['name']){delete _0x4d5041['name'];}_0x3e317f['status'](_0x1a411a)['send'](_0x4d5041);};}exports[_0x8a58('0x2e')]=function(_0x175235,_0x1b2d9e){var _0x205b41={},_0x5dc010={},_0x261096={'count':0x0,'rows':[]};var _0x2a20ad=_[_0x8a58('0x2f')](db[_0x8a58('0x30')][_0x8a58('0x31')],function(_0x8ab99c){return{'name':_0x8ab99c[_0x8a58('0x32')],'type':_0x8ab99c[_0x8a58('0x33')]['key']};});_0x5dc010[_0x8a58('0x34')]=_[_0x8a58('0x2f')](_0x2a20ad,_0x8a58('0x35'));_0x5dc010[_0x8a58('0x36')]=_[_0x8a58('0x37')](_0x175235[_0x8a58('0x36')]);_0x5dc010['filters']=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],_0x5dc010[_0x8a58('0x36')]);_0x205b41[_0x8a58('0x39')]=_[_0x8a58('0x38')](_0x5dc010[_0x8a58('0x34')],qs[_0x8a58('0x3a')](_0x175235['query'][_0x8a58('0x3a')]));_0x205b41[_0x8a58('0x39')]=_0x205b41[_0x8a58('0x39')]['length']?_0x205b41['attributes']:_0x5dc010['model'];if(!_0x175235[_0x8a58('0x36')][_0x8a58('0x3b')](_0x8a58('0x3c'))){_0x205b41[_0x8a58('0x21')]=qs['limit'](_0x175235[_0x8a58('0x36')][_0x8a58('0x21')]);_0x205b41[_0x8a58('0x1e')]=qs[_0x8a58('0x1e')](_0x175235['query'][_0x8a58('0x1e')]);}_0x205b41[_0x8a58('0x3d')]=qs['sort'](_0x175235[_0x8a58('0x36')][_0x8a58('0x3e')]);_0x205b41[_0x8a58('0x3f')]=qs[_0x8a58('0x40')](_[_0x8a58('0x41')](_0x175235[_0x8a58('0x36')],_0x5dc010['filters']),_0x2a20ad);if(_0x175235['query'][_0x8a58('0x42')]){_0x205b41[_0x8a58('0x3f')]=_['merge'](_0x205b41[_0x8a58('0x3f')],{'$or':_[_0x8a58('0x2f')](_0x2a20ad,function(_0x478454){if(_0x478454[_0x8a58('0x33')]!==_0x8a58('0x43')){var _0x4e9e04={};_0x4e9e04[_0x478454[_0x8a58('0x35')]]={'$like':'%'+_0x175235['query'][_0x8a58('0x42')]+'%'};return _0x4e9e04;}})});}_0x205b41=_[_0x8a58('0x44')]({},_0x205b41,_0x175235[_0x8a58('0x45')]);var _0x40ca09={'where':_0x205b41[_0x8a58('0x3f')]};return db[_0x8a58('0x30')][_0x8a58('0x20')](_0x40ca09)['then'](function(_0x5cd9d8){_0x261096[_0x8a58('0x20')]=_0x5cd9d8;if(_0x175235['query']['includeAll']){_0x205b41[_0x8a58('0x46')]=[{'all':!![]}];}return db[_0x8a58('0x30')][_0x8a58('0x47')](_0x205b41);})['then'](function(_0x56a410){_0x261096[_0x8a58('0x48')]=_0x56a410;return _0x261096;})['then'](respondWithFilteredResult(_0x1b2d9e,_0x205b41))[_0x8a58('0x49')](handleError(_0x1b2d9e,null));};exports[_0x8a58('0x4a')]=function(_0x3feec0,_0x3faae2){var _0x4c9c56={'raw':!![],'where':{'id':_0x3feec0[_0x8a58('0x4b')]['id']}},_0x417951={};_0x417951['model']=_[_0x8a58('0x37')](db[_0x8a58('0x30')][_0x8a58('0x31')]);_0x417951[_0x8a58('0x36')]=_['keys'](_0x3feec0[_0x8a58('0x36')]);_0x417951['filters']=_[_0x8a58('0x38')](_0x417951[_0x8a58('0x34')],_0x417951['query']);_0x4c9c56[_0x8a58('0x39')]=_['intersection'](_0x417951['model'],qs[_0x8a58('0x3a')](_0x3feec0[_0x8a58('0x36')][_0x8a58('0x3a')]));_0x4c9c56[_0x8a58('0x39')]=_0x4c9c56[_0x8a58('0x39')][_0x8a58('0x4c')]?_0x4c9c56['attributes']:_0x417951['model'];if(_0x3feec0[_0x8a58('0x36')][_0x8a58('0x4d')]){_0x4c9c56[_0x8a58('0x46')]=[{'all':!![]}];}_0x4c9c56=_[_0x8a58('0x44')]({},_0x4c9c56,_0x3feec0[_0x8a58('0x45')]);return db[_0x8a58('0x30')][_0x8a58('0x4e')](_0x4c9c56)[_0x8a58('0x28')](handleEntityNotFound(_0x3faae2,null))[_0x8a58('0x28')](respondWithResult(_0x3faae2,null))[_0x8a58('0x49')](handleError(_0x3faae2,null));};exports[_0x8a58('0x4f')]=function(_0x392c32,_0x1ea824){return db[_0x8a58('0x30')]['create'](_0x392c32[_0x8a58('0x50')],{})[_0x8a58('0x28')](function(_0xeb5231){var _0x409f9e=_0x392c32[_0x8a58('0x51')][_0x8a58('0x2a')]({'plain':!![]});if(!_0x409f9e)throw new Error(_0x8a58('0x52'));if(_0x409f9e['role']==='user'){var _0x5ab682=_0xeb5231[_0x8a58('0x2a')]({'plain':!![]});var _0xe0ed75=_0x8a58('0x2b');return db['UserProfileSection'][_0x8a58('0x4e')]({'where':{'name':_0xe0ed75,'userProfileId':_0x409f9e[_0x8a58('0x53')]},'raw':!![]})[_0x8a58('0x28')](function(_0x3ad78c){if(_0x3ad78c&&_0x3ad78c[_0x8a58('0x54')]===0x0){return db[_0x8a58('0x55')][_0x8a58('0x4f')]({'name':_0x5ab682[_0x8a58('0x35')],'resourceId':_0x5ab682['id'],'type':_0x3ad78c[_0x8a58('0x35')],'sectionId':_0x3ad78c['id']},{})[_0x8a58('0x28')](function(){return _0xeb5231;});}else{return _0xeb5231;}})[_0x8a58('0x49')](function(_0x130406){logger['error'](_0x8a58('0x56'),_0x130406);throw _0x130406;});}return _0xeb5231;})[_0x8a58('0x28')](respondWithResult(_0x1ea824,0xc9))['catch'](handleError(_0x1ea824,null));};exports[_0x8a58('0x27')]=function(_0xfab1e4,_0x1ce5e0){if(_0xfab1e4['body']['id']){delete _0xfab1e4[_0x8a58('0x50')]['id'];}return db['Tag'][_0x8a58('0x4e')]({'where':{'id':_0xfab1e4[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x1ce5e0,null))[_0x8a58('0x28')](saveUpdates(_0xfab1e4[_0x8a58('0x50')],null))[_0x8a58('0x28')](respondWithResult(_0x1ce5e0,null))[_0x8a58('0x49')](handleError(_0x1ce5e0,null));};exports[_0x8a58('0x29')]=function(_0x2c4a18,_0x53fbde){return db[_0x8a58('0x30')][_0x8a58('0x4e')]({'where':{'id':_0x2c4a18[_0x8a58('0x4b')]['id']}})[_0x8a58('0x28')](handleEntityNotFound(_0x53fbde,null))[_0x8a58('0x28')](removeEntity(_0x53fbde,null))['catch'](handleError(_0x53fbde,null));}; \ No newline at end of file +var _0xfa2b=['model','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','update','destroy','Tags','UserProfileResource','then','stack','name','index','map','Tag','type','key','query','keys','filters','intersection','attributes'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x3345ac,_0xb70b0e){_0x3345ac=_0x3345ac-0x0;var _0x1ec77d=_0xfa2b[_0x3345ac];return _0x1ec77d;};'use strict';var emlformat=require(_0xbfa2('0x0'));var rimraf=require(_0xbfa2('0x1'));var zipdir=require(_0xbfa2('0x2'));var jsonpatch=require(_0xbfa2('0x3'));var rp=require(_0xbfa2('0x4'));var moment=require(_0xbfa2('0x5'));var BPromise=require(_0xbfa2('0x6'));var Mustache=require(_0xbfa2('0x7'));var util=require(_0xbfa2('0x8'));var path=require(_0xbfa2('0x9'));var sox=require(_0xbfa2('0xa'));var csv=require(_0xbfa2('0xb'));var ejs=require(_0xbfa2('0xc'));var fs=require('fs');var fs_extra=require(_0xbfa2('0xd'));var _=require(_0xbfa2('0xe'));var squel=require(_0xbfa2('0xf'));var crypto=require('crypto');var jsforce=require(_0xbfa2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbfa2('0xb'));var querystring=require(_0xbfa2('0x11'));var Papa=require(_0xbfa2('0x12'));var Redis=require(_0xbfa2('0x13'));var authService=require(_0xbfa2('0x14'));var qs=require(_0xbfa2('0x15'));var as=require(_0xbfa2('0x16'));var hardwareService=require(_0xbfa2('0x17'));var logger=require(_0xbfa2('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbfa2('0x19'));var db=require(_0xbfa2('0x1a'))['db'];function respondWithStatusCode(_0x62b1e9,_0x829a72){_0x829a72=_0x829a72||0xcc;return function(_0x137e0d){if(_0x137e0d){return _0x62b1e9[_0xbfa2('0x1b')](_0x829a72);}return _0x62b1e9['status'](_0x829a72)[_0xbfa2('0x1c')]();};}function respondWithResult(_0xaf815f,_0x458653){_0x458653=_0x458653||0xc8;return function(_0x445598){if(_0x445598){return _0xaf815f[_0xbfa2('0x1d')](_0x458653)['json'](_0x445598);}};}function respondWithFilteredResult(_0xa988cc,_0x47db68){return function(_0x5d3aa2){if(_0x5d3aa2){var _0xee34b8=typeof _0x47db68['offset']==='undefined'&&typeof _0x47db68[_0xbfa2('0x1e')]===_0xbfa2('0x1f');var _0x54cdb2=_0x5d3aa2[_0xbfa2('0x20')];var _0x12627a=_0xee34b8?0x0:_0x47db68[_0xbfa2('0x21')];var _0x4088c5=_0xee34b8?_0x5d3aa2[_0xbfa2('0x20')]:_0x47db68[_0xbfa2('0x21')]+_0x47db68[_0xbfa2('0x1e')];var _0x5c3123;if(_0x4088c5>=_0x54cdb2){_0x4088c5=_0x54cdb2;_0x5c3123=0xc8;}else{_0x5c3123=0xce;}_0xa988cc[_0xbfa2('0x1d')](_0x5c3123);return _0xa988cc[_0xbfa2('0x22')](_0xbfa2('0x23'),_0x12627a+'-'+_0x4088c5+'/'+_0x54cdb2)['json'](_0x5d3aa2);}return null;};}function patchUpdates(_0x2ac6c3){return function(_0x3073ae){try{jsonpatch['apply'](_0x3073ae,_0x2ac6c3,!![]);}catch(_0xd5760d){return BPromise['reject'](_0xd5760d);}return _0x3073ae['save']();};}function saveUpdates(_0xc42b51,_0xdb059b){return function(_0x1ec19f){if(_0x1ec19f){return _0x1ec19f[_0xbfa2('0x24')](_0xc42b51)['then'](function(_0x5bb514){return _0x5bb514;});}return null;};}function removeEntity(_0x599df2,_0x13db3e){return function(_0x5e6e80){if(_0x5e6e80){return _0x5e6e80[_0xbfa2('0x25')]()['then'](function(){var _0xeb88ab=_0x5e6e80['get']({'plain':!![]});var _0x289c04=_0xbfa2('0x26');return db[_0xbfa2('0x27')][_0xbfa2('0x25')]({'where':{'type':_0x289c04,'resourceId':_0xeb88ab['id']}})[_0xbfa2('0x28')](function(){return _0x5e6e80;});})['then'](function(){_0x599df2[_0xbfa2('0x1d')](0xcc)[_0xbfa2('0x1c')]();});}};}function handleEntityNotFound(_0x4f782b,_0x37ec27){return function(_0x14f142){if(!_0x14f142){_0x4f782b['sendStatus'](0x194);}return _0x14f142;};}function handleError(_0x2cbc51,_0x5ecd55){_0x5ecd55=_0x5ecd55||0x1f4;return function(_0x16bc84){logger['error'](_0x16bc84[_0xbfa2('0x29')]);if(_0x16bc84[_0xbfa2('0x2a')]){delete _0x16bc84[_0xbfa2('0x2a')];}_0x2cbc51[_0xbfa2('0x1d')](_0x5ecd55)['send'](_0x16bc84);};}exports[_0xbfa2('0x2b')]=function(_0x4aac4e,_0xb95429){var _0x36a30d={},_0x3860b4={},_0x5e3831={'count':0x0,'rows':[]};var _0x1b8fe6=_[_0xbfa2('0x2c')](db[_0xbfa2('0x2d')]['rawAttributes'],function(_0x47fd5a){return{'name':_0x47fd5a['fieldName'],'type':_0x47fd5a[_0xbfa2('0x2e')][_0xbfa2('0x2f')]};});_0x3860b4['model']=_[_0xbfa2('0x2c')](_0x1b8fe6,_0xbfa2('0x2a'));_0x3860b4[_0xbfa2('0x30')]=_[_0xbfa2('0x31')](_0x4aac4e['query']);_0x3860b4[_0xbfa2('0x32')]=_[_0xbfa2('0x33')](_0x3860b4['model'],_0x3860b4[_0xbfa2('0x30')]);_0x36a30d[_0xbfa2('0x34')]=_[_0xbfa2('0x33')](_0x3860b4[_0xbfa2('0x35')],qs[_0xbfa2('0x36')](_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x36')]));_0x36a30d[_0xbfa2('0x34')]=_0x36a30d[_0xbfa2('0x34')]['length']?_0x36a30d[_0xbfa2('0x34')]:_0x3860b4['model'];if(!_0x4aac4e[_0xbfa2('0x30')]['hasOwnProperty'](_0xbfa2('0x37'))){_0x36a30d[_0xbfa2('0x1e')]=qs[_0xbfa2('0x1e')](_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x1e')]);_0x36a30d['offset']=qs[_0xbfa2('0x21')](_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x21')]);}_0x36a30d[_0xbfa2('0x38')]=qs[_0xbfa2('0x39')](_0x4aac4e['query']['sort']);_0x36a30d[_0xbfa2('0x3a')]=qs[_0xbfa2('0x32')](_[_0xbfa2('0x3b')](_0x4aac4e['query'],_0x3860b4['filters']),_0x1b8fe6);if(_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x3c')]){_0x36a30d['where']=_['merge'](_0x36a30d[_0xbfa2('0x3a')],{'$or':_[_0xbfa2('0x2c')](_0x1b8fe6,function(_0x5af87e){if(_0x5af87e[_0xbfa2('0x2e')]!==_0xbfa2('0x3d')){var _0x2a541a={};_0x2a541a[_0x5af87e[_0xbfa2('0x2a')]]={'$like':'%'+_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x3c')]+'%'};return _0x2a541a;}})});}_0x36a30d=_[_0xbfa2('0x3e')]({},_0x36a30d,_0x4aac4e[_0xbfa2('0x3f')]);var _0xd6752f={'where':_0x36a30d[_0xbfa2('0x3a')]};return db[_0xbfa2('0x2d')][_0xbfa2('0x20')](_0xd6752f)[_0xbfa2('0x28')](function(_0x44a884){_0x5e3831[_0xbfa2('0x20')]=_0x44a884;if(_0x4aac4e[_0xbfa2('0x30')][_0xbfa2('0x40')]){_0x36a30d['include']=[{'all':!![]}];}return db[_0xbfa2('0x2d')][_0xbfa2('0x41')](_0x36a30d);})[_0xbfa2('0x28')](function(_0x35c23a){_0x5e3831[_0xbfa2('0x42')]=_0x35c23a;return _0x5e3831;})[_0xbfa2('0x28')](respondWithFilteredResult(_0xb95429,_0x36a30d))['catch'](handleError(_0xb95429,null));};exports[_0xbfa2('0x43')]=function(_0x49c967,_0x2efbb9){var _0x1d293e={'raw':!![],'where':{'id':_0x49c967[_0xbfa2('0x44')]['id']}},_0x56a917={};_0x56a917[_0xbfa2('0x35')]=_[_0xbfa2('0x31')](db[_0xbfa2('0x2d')][_0xbfa2('0x45')]);_0x56a917['query']=_[_0xbfa2('0x31')](_0x49c967[_0xbfa2('0x30')]);_0x56a917[_0xbfa2('0x32')]=_[_0xbfa2('0x33')](_0x56a917[_0xbfa2('0x35')],_0x56a917[_0xbfa2('0x30')]);_0x1d293e[_0xbfa2('0x34')]=_[_0xbfa2('0x33')](_0x56a917['model'],qs[_0xbfa2('0x36')](_0x49c967[_0xbfa2('0x30')]['fields']));_0x1d293e[_0xbfa2('0x34')]=_0x1d293e[_0xbfa2('0x34')][_0xbfa2('0x46')]?_0x1d293e[_0xbfa2('0x34')]:_0x56a917[_0xbfa2('0x35')];if(_0x49c967[_0xbfa2('0x30')][_0xbfa2('0x40')]){_0x1d293e[_0xbfa2('0x47')]=[{'all':!![]}];}_0x1d293e=_[_0xbfa2('0x3e')]({},_0x1d293e,_0x49c967['options']);return db[_0xbfa2('0x2d')][_0xbfa2('0x48')](_0x1d293e)[_0xbfa2('0x28')](handleEntityNotFound(_0x2efbb9,null))['then'](respondWithResult(_0x2efbb9,null))['catch'](handleError(_0x2efbb9,null));};exports[_0xbfa2('0x49')]=function(_0x51fd07,_0x457a15){return db[_0xbfa2('0x2d')]['create'](_0x51fd07[_0xbfa2('0x4a')],{})[_0xbfa2('0x28')](function(_0x1462f3){var _0x5cd6b7=_0x51fd07[_0xbfa2('0x4b')]['get']({'plain':!![]});if(!_0x5cd6b7)throw new Error(_0xbfa2('0x4c'));if(_0x5cd6b7[_0xbfa2('0x4d')]==='user'){var _0x3f8e7c=_0x1462f3['get']({'plain':!![]});var _0x40eba9='Tags';return db[_0xbfa2('0x4e')][_0xbfa2('0x48')]({'where':{'name':_0x40eba9,'userProfileId':_0x5cd6b7[_0xbfa2('0x4f')]},'raw':!![]})[_0xbfa2('0x28')](function(_0x313da6){if(_0x313da6&&_0x313da6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3f8e7c[_0xbfa2('0x2a')],'resourceId':_0x3f8e7c['id'],'type':_0x313da6[_0xbfa2('0x2a')],'sectionId':_0x313da6['id']},{})[_0xbfa2('0x28')](function(){return _0x1462f3;});}else{return _0x1462f3;}})['catch'](function(_0x32f966){logger[_0xbfa2('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32f966);throw _0x32f966;});}return _0x1462f3;})[_0xbfa2('0x28')](respondWithResult(_0x457a15,0xc9))[_0xbfa2('0x51')](handleError(_0x457a15,null));};exports['update']=function(_0x2f0a8a,_0x326caf){if(_0x2f0a8a['body']['id']){delete _0x2f0a8a['body']['id'];}return db[_0xbfa2('0x2d')]['find']({'where':{'id':_0x2f0a8a[_0xbfa2('0x44')]['id']}})[_0xbfa2('0x28')](handleEntityNotFound(_0x326caf,null))['then'](saveUpdates(_0x2f0a8a[_0xbfa2('0x4a')],null))[_0xbfa2('0x28')](respondWithResult(_0x326caf,null))[_0xbfa2('0x51')](handleError(_0x326caf,null));};exports[_0xbfa2('0x25')]=function(_0x1183fa,_0x28d7c5){return db[_0xbfa2('0x2d')][_0xbfa2('0x48')]({'where':{'id':_0x1183fa[_0xbfa2('0x44')]['id']}})[_0xbfa2('0x28')](handleEntityNotFound(_0x28d7c5,null))[_0xbfa2('0x28')](removeEntity(_0x28d7c5,null))[_0xbfa2('0x51')](handleError(_0x28d7c5,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index afd30d2..64fdee5 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 _0xe6c1=['exports','define','Tag','tools_tags','lodash','util','moment','request-promise','rimraf','../../config/environment'];(function(_0x19c7a8,_0x10508d){var _0x1462ce=function(_0x33f2c8){while(--_0x33f2c8){_0x19c7a8['push'](_0x19c7a8['shift']());}};_0x1462ce(++_0x10508d);}(_0xe6c1,0x1da));var _0x1e6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6c1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1e6c('0x0'));var util=require(_0x1e6c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1e6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e6c('0x4'));var config=require(_0x1e6c('0x5'));var attributes=require('./tag.attributes');module[_0x1e6c('0x6')]=function(_0x24ec5c,_0x3a3e3a){return _0x24ec5c[_0x1e6c('0x7')](_0x1e6c('0x8'),attributes,{'tableName':_0x1e6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e7c=['exports','define','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x5e6bdd,_0xd843a6){var _0x13019e=function(_0x26b3a6){while(--_0x26b3a6){_0x5e6bdd['push'](_0x5e6bdd['shift']());}};_0x13019e(++_0xd843a6);}(_0x9e7c,0xc6));var _0xc9e7=function(_0x2c9abd,_0x341650){_0x2c9abd=_0x2c9abd-0x0;var _0x59e645=_0x9e7c[_0x2c9abd];return _0x59e645;};'use strict';var _=require(_0xc9e7('0x0'));var util=require(_0xc9e7('0x1'));var logger=require(_0xc9e7('0x2'))(_0xc9e7('0x3'));var moment=require(_0xc9e7('0x4'));var BPromise=require(_0xc9e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9e7('0x6'));var rimraf=require(_0xc9e7('0x7'));var config=require(_0xc9e7('0x8'));var attributes=require(_0xc9e7('0x9'));module[_0xc9e7('0xa')]=function(_0x1e0d6c,_0xf54995){return _0x1e0d6c[_0xc9e7('0xb')]('Tag',attributes,{'tableName':_0xc9e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7d5f52f..17228dd 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 _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x2e27dd,_0x550941){var _0x3f6b81=function(_0x260508){while(--_0x260508){_0x2e27dd['push'](_0x2e27dd['shift']());}};_0x3f6b81(++_0x550941);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xc27537,_0x43f170){_0xc27537=_0xc27537-0x0;var _0x13e6da=_0xc3b5[_0xc27537];return _0x13e6da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('Tag,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});} \ No newline at end of file +var _0xac31=['code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21b4ea,_0x5e9a0b){var _0x3067ec=function(_0x26fdf8){while(--_0x26fdf8){_0x21b4ea['push'](_0x21b4ea['shift']());}};_0x3067ec(++_0x5e9a0b);}(_0xac31,0xca));var _0x1ac3=function(_0x17ec8d,_0x5c6ad2){_0x17ec8d=_0x17ec8d-0x0;var _0x53c558=_0xac31[_0x17ec8d];return _0x53c558;};'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')]('Tag,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 35e4386..f1163f3 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 4b43082..f25f63f 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 _0x0713=['STRING','name'];(function(_0x5f1e6f,_0x12f575){var _0x53deee=function(_0x497669){while(--_0x497669){_0x5f1e6f['push'](_0x5f1e6f['shift']());}};_0x53deee(++_0x12f575);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 17b6791..dfb3ed2 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 _0xbcd5=['isValidChannel','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','removeQueues','remove','capitalize','isArray','Voice','Sms','Fax','Whatsapp','through','penalty','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','Chat','removeAgents','Queue:remove','QueueId','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Team','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','rawAttributes','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel'];(function(_0x4c6839,_0x4c8f6a){var _0x1e0daf=function(_0xe26636){while(--_0xe26636){_0x4c6839['push'](_0x4c6839['shift']());}};_0x1e0daf(++_0x4c8f6a);}(_0xbcd5,0x162));var _0x5bcd=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xbcd5[_0x737a1f];return _0x16eba1;};'use strict';var emlformat=require(_0x5bcd('0x0'));var rimraf=require(_0x5bcd('0x1'));var zipdir=require(_0x5bcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bcd('0x3'));var moment=require(_0x5bcd('0x4'));var BPromise=require(_0x5bcd('0x5'));var Mustache=require(_0x5bcd('0x6'));var util=require(_0x5bcd('0x7'));var path=require(_0x5bcd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x5bcd('0xa'));var _=require('lodash');var squel=require(_0x5bcd('0xb'));var crypto=require(_0x5bcd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5bcd('0xd'));var toCsv=require(_0x5bcd('0xe'));var querystring=require('querystring');var Papa=require(_0x5bcd('0xf'));var Redis=require(_0x5bcd('0x10'));var authService=require(_0x5bcd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5bcd('0x12'));var hardwareService=require(_0x5bcd('0x13'));var logger=require(_0x5bcd('0x14'))(_0x5bcd('0x15'));var utils=require(_0x5bcd('0x16'));var config=require(_0x5bcd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bcd('0x18'))['db'];config[_0x5bcd('0x19')]=_[_0x5bcd('0x1a')](config[_0x5bcd('0x19')],{'host':_0x5bcd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bcd('0x19')]));require(_0x5bcd('0x1c'))['register'](socket);function respondWithStatusCode(_0x4cd605,_0x22c549){_0x22c549=_0x22c549||0xcc;return function(_0x302d55){if(_0x302d55){return _0x4cd605[_0x5bcd('0x1d')](_0x22c549);}return _0x4cd605[_0x5bcd('0x1e')](_0x22c549)[_0x5bcd('0x1f')]();};}function respondWithResult(_0x59c56d,_0x6fd92b){_0x6fd92b=_0x6fd92b||0xc8;return function(_0x1b350d){if(_0x1b350d){return _0x59c56d[_0x5bcd('0x1e')](_0x6fd92b)['json'](_0x1b350d);}};}function respondWithFilteredResult(_0x540cb8,_0x57ee1c){return function(_0x321180){if(_0x321180){var _0x4de031=typeof _0x57ee1c[_0x5bcd('0x20')]===_0x5bcd('0x21')&&typeof _0x57ee1c[_0x5bcd('0x22')]===_0x5bcd('0x21');var _0x409389=_0x321180[_0x5bcd('0x23')];var _0x50bbca=_0x4de031?0x0:_0x57ee1c[_0x5bcd('0x20')];var _0x5109fa=_0x4de031?_0x321180['count']:_0x57ee1c[_0x5bcd('0x20')]+_0x57ee1c['limit'];var _0x275ef6;if(_0x5109fa>=_0x409389){_0x5109fa=_0x409389;_0x275ef6=0xc8;}else{_0x275ef6=0xce;}_0x540cb8[_0x5bcd('0x1e')](_0x275ef6);return _0x540cb8[_0x5bcd('0x24')](_0x5bcd('0x25'),_0x50bbca+'-'+_0x5109fa+'/'+_0x409389)['json'](_0x321180);}return null;};}function patchUpdates(_0x5a2a96){return function(_0x501d57){try{jsonpatch[_0x5bcd('0x26')](_0x501d57,_0x5a2a96,!![]);}catch(_0x393f60){return BPromise[_0x5bcd('0x27')](_0x393f60);}return _0x501d57['save']();};}function saveUpdates(_0x2c40e2,_0x470f63){return function(_0x28790f){if(_0x28790f){return _0x28790f[_0x5bcd('0x28')](_0x2c40e2)[_0x5bcd('0x29')](function(_0x4b5233){return _0x4b5233;});}return null;};}function handleEntityNotFound(_0x27e1fd,_0x21d038){return function(_0x2807de){if(!_0x2807de){_0x27e1fd[_0x5bcd('0x1d')](0x194);}return _0x2807de;};}function handleError(_0x3afac6,_0x3848ad){_0x3848ad=_0x3848ad||0x1f4;return function(_0x37c17c){logger[_0x5bcd('0x2a')](_0x37c17c[_0x5bcd('0x2b')]);if(_0x37c17c[_0x5bcd('0x2c')]){delete _0x37c17c[_0x5bcd('0x2c')];}_0x3afac6[_0x5bcd('0x1e')](_0x3848ad)[_0x5bcd('0x2d')](_0x37c17c);};}exports[_0x5bcd('0x2e')]=function(_0xacfc5f,_0x4e3617){var _0x3c6950={},_0x5d0305={},_0x5f23ed={'count':0x0,'rows':[]};var _0x21821a=_[_0x5bcd('0x2f')](db[_0x5bcd('0x30')]['rawAttributes'],function(_0x415281){return{'name':_0x415281[_0x5bcd('0x31')],'type':_0x415281[_0x5bcd('0x32')][_0x5bcd('0x33')]};});_0x5d0305[_0x5bcd('0x34')]=_['map'](_0x21821a,'name');_0x5d0305[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0xacfc5f['query']);_0x5d0305[_0x5bcd('0x37')]=_['intersection'](_0x5d0305[_0x5bcd('0x34')],_0x5d0305[_0x5bcd('0x35')]);_0x3c6950['attributes']=_[_0x5bcd('0x38')](_0x5d0305[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x3c6950[_0x5bcd('0x3a')]=_0x3c6950[_0x5bcd('0x3a')][_0x5bcd('0x3b')]?_0x3c6950[_0x5bcd('0x3a')]:_0x5d0305[_0x5bcd('0x34')];if(!_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x3c')](_0x5bcd('0x3d'))){_0x3c6950[_0x5bcd('0x22')]=qs[_0x5bcd('0x22')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x3c6950[_0x5bcd('0x20')]=qs[_0x5bcd('0x20')](_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x20')]);}_0x3c6950[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0xacfc5f['query'][_0x5bcd('0x3f')]);_0x3c6950[_0x5bcd('0x40')]=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0xacfc5f[_0x5bcd('0x35')],_0x5d0305[_0x5bcd('0x37')]),_0x21821a);if(_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x42')]){_0x3c6950[_0x5bcd('0x40')]=_[_0x5bcd('0x43')](_0x3c6950[_0x5bcd('0x40')],{'$or':_['map'](_0x21821a,function(_0xafeaa2){if(_0xafeaa2[_0x5bcd('0x32')]!==_0x5bcd('0x44')){var _0x19ab21={};_0x19ab21[_0xafeaa2[_0x5bcd('0x2c')]]={'$like':'%'+_0xacfc5f[_0x5bcd('0x35')]['filter']+'%'};return _0x19ab21;}})});}_0x3c6950=_[_0x5bcd('0x43')]({},_0x3c6950,_0xacfc5f[_0x5bcd('0x45')]);var _0x1b92d7={'where':_0x3c6950[_0x5bcd('0x40')]};return db['Team']['count'](_0x1b92d7)['then'](function(_0x507af8){_0x5f23ed['count']=_0x507af8;if(_0xacfc5f[_0x5bcd('0x35')][_0x5bcd('0x46')]){_0x3c6950['include']=[{'all':!![]}];}return db['Team'][_0x5bcd('0x47')](_0x3c6950);})[_0x5bcd('0x29')](function(_0x1f5beb){_0x5f23ed[_0x5bcd('0x48')]=_0x1f5beb;return _0x5f23ed;})['then'](respondWithFilteredResult(_0x4e3617,_0x3c6950))[_0x5bcd('0x49')](handleError(_0x4e3617,null));};exports[_0x5bcd('0x4a')]=function(_0x4446f,_0x4b9923){var _0x5c8925={'raw':![],'where':{'id':_0x4446f['params']['id']}},_0x232cbf={};_0x232cbf[_0x5bcd('0x34')]=_['keys'](db[_0x5bcd('0x30')][_0x5bcd('0x4b')]);_0x232cbf[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0x4446f[_0x5bcd('0x35')]);_0x232cbf['filters']=_[_0x5bcd('0x38')](_0x232cbf[_0x5bcd('0x34')],_0x232cbf['query']);_0x5c8925[_0x5bcd('0x3a')]=_[_0x5bcd('0x38')](_0x232cbf[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x4446f[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x5c8925[_0x5bcd('0x3a')]=_0x5c8925[_0x5bcd('0x3a')]['length']?_0x5c8925['attributes']:_0x232cbf[_0x5bcd('0x34')];if(_0x4446f[_0x5bcd('0x35')][_0x5bcd('0x46')]){_0x5c8925[_0x5bcd('0x4c')]=[{'all':!![]}];}_0x5c8925=_[_0x5bcd('0x43')]({},_0x5c8925,_0x4446f[_0x5bcd('0x45')]);return db[_0x5bcd('0x30')]['find'](_0x5c8925)[_0x5bcd('0x29')](handleEntityNotFound(_0x4b9923,null))[_0x5bcd('0x29')](respondWithResult(_0x4b9923,null))['catch'](handleError(_0x4b9923,null));};exports['create']=function(_0x2486f3,_0x34a63e){return db[_0x5bcd('0x30')][_0x5bcd('0x4d')](_0x2486f3[_0x5bcd('0x4e')],{})[_0x5bcd('0x29')](function(_0x404a33){var _0x20f748=_0x2486f3[_0x5bcd('0x4f')][_0x5bcd('0x50')]({'plain':!![]});if(!_0x20f748)throw new Error(_0x5bcd('0x51'));if(_0x20f748[_0x5bcd('0x52')]==='user'){var _0x111495=_0x404a33[_0x5bcd('0x50')]({'plain':!![]});var _0x5e218b=_0x5bcd('0x53');return db[_0x5bcd('0x54')]['find']({'where':{'name':_0x5e218b,'userProfileId':_0x20f748[_0x5bcd('0x55')]},'raw':!![]})[_0x5bcd('0x29')](function(_0x365fa8){if(_0x365fa8&&_0x365fa8[_0x5bcd('0x56')]===0x0){return db[_0x5bcd('0x57')][_0x5bcd('0x4d')]({'name':_0x111495[_0x5bcd('0x2c')],'resourceId':_0x111495['id'],'type':_0x365fa8[_0x5bcd('0x2c')],'sectionId':_0x365fa8['id']},{})['then'](function(){return _0x404a33;});}else{return _0x404a33;}})[_0x5bcd('0x49')](function(_0x57588e){logger['error'](_0x5bcd('0x58'),_0x57588e);throw _0x57588e;});}return _0x404a33;})['then'](respondWithResult(_0x34a63e,0xc9))[_0x5bcd('0x49')](handleError(_0x34a63e,null));};exports[_0x5bcd('0x28')]=function(_0xf3fb06,_0x8cead8){if(_0xf3fb06['body']['id']){delete _0xf3fb06[_0x5bcd('0x4e')]['id'];}return db['Team'][_0x5bcd('0x59')]({'where':{'id':_0xf3fb06[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x8cead8,null))[_0x5bcd('0x29')](saveUpdates(_0xf3fb06[_0x5bcd('0x4e')],null))[_0x5bcd('0x29')](respondWithResult(_0x8cead8,null))[_0x5bcd('0x49')](handleError(_0x8cead8,null));};exports[_0x5bcd('0x5b')]=function(_0x853c17,_0x3a5f1a){var _0x51a5c7=_0x853c17[_0x5bcd('0x5a')]['id'];var _0x329c11=[];return db[_0x5bcd('0x5c')][_0x5bcd('0x5d')](function(_0x57d96e){var _0x4251db=_0x5bcd('0x5e')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x4251db,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e})[_0x5bcd('0x29')](function(_0xc206de){_0x329c11=_[_0x5bcd('0x2f')](_0xc206de,function(_0x61cbc1){return Number(_0x61cbc1[_0x5bcd('0x62')]);});})['then'](function(){var _0x284b02=_0x5bcd('0x63')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x284b02,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x284a21){var _0x13b14d=_[_0x5bcd('0x2f')](_0x284a21,function(_0x89b0ad){return Number(_0x89b0ad[_0x5bcd('0x64')]);});return db[_0x5bcd('0x65')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'VoiceQueueId':{'$in':_0x13b14d}},'transaction':_0x57d96e});})['then'](function(){var _0x5d26c5=_0x5bcd('0x66')+_0x51a5c7;return db[_0x5bcd('0x5c')][_0x5bcd('0x35')](_0x5d26c5,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')]['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x14372f){var _0x1264ab=_[_0x5bcd('0x2f')](_0x14372f,function(_0xe468c6){return Number(_0xe468c6['MailQueueId']);});return db['UserMailQueue'][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'MailQueueId':{'$in':_0x1264ab}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x473831=_0x5bcd('0x67')+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x473831,{'type':db[_0x5bcd('0x5f')]['QueryTypes'][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x1a3229){var _0x4b26d5=_[_0x5bcd('0x2f')](_0x1a3229,function(_0x71b63c){return Number(_0x71b63c[_0x5bcd('0x68')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x329c11},'SmsQueueId':{'$in':_0x4b26d5}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x26ec94=_0x5bcd('0x69')+_0x51a5c7;return db['sequelize'][_0x5bcd('0x35')](_0x26ec94,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x2c49a9){var _0x4dd671=_[_0x5bcd('0x2f')](_0x2c49a9,function(_0x21205d){return Number(_0x21205d[_0x5bcd('0x6a')]);});return db[_0x5bcd('0x6b')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'ChatQueueId':{'$in':_0x4dd671}},'transaction':_0x57d96e});})['then'](function(){var _0x4c6877=_0x5bcd('0x6c')+_0x51a5c7;return db['sequelize']['query'](_0x4c6877,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')]['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x5212f7){var _0x4c929b=_[_0x5bcd('0x2f')](_0x5212f7,function(_0x48ebe7){return Number(_0x48ebe7[_0x5bcd('0x6d')]);});return db['UserFaxQueue'][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'FaxQueueId':{'$in':_0x4c929b}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x47cba0='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x51a5c7;return db['sequelize']['query'](_0x47cba0,{'type':db[_0x5bcd('0x5f')][_0x5bcd('0x60')][_0x5bcd('0x61')],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x75444){var _0x3db9d0=_['map'](_0x75444,function(_0x620b0f){return Number(_0x620b0f[_0x5bcd('0x6e')]);});return db[_0x5bcd('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x329c11},'OpenchannelQueueId':{'$in':_0x3db9d0}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){var _0x4421ed='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x51a5c7;return db[_0x5bcd('0x5c')]['query'](_0x4421ed,{'type':db[_0x5bcd('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(_0x47c7cf){var _0x3b477b=_[_0x5bcd('0x2f')](_0x47c7cf,function(_0xd84efa){return Number(_0xd84efa[_0x5bcd('0x70')]);});return db[_0x5bcd('0x71')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'WhatsappQueueId':{'$in':_0x3b477b}},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')]['find']({'where':{'TeamId':_0x51a5c7}});})[_0x5bcd('0x29')](function(_0x3f73ba){if(_0x3f73ba===null){return;}return db[_0x5bcd('0x73')][_0x5bcd('0x5b')]({'where':{'UserId':{'$in':_0x329c11},'VoicePrefixId':_0x3f73ba[_0x5bcd('0x74')]},'transaction':_0x57d96e});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x30')][_0x5bcd('0x5b')]({'where':{'id':_0x51a5c7},'cascade':!![],'transaction':_0x57d96e});})['then'](function(_0x3c6e5a){if(_0x3c6e5a===0x0){_0x3a5f1a[_0x5bcd('0x1d')](0x194);}else{return db['UserProfileResource'][_0x5bcd('0x5b')]({'where':{'type':_0x5bcd('0x53'),'resourceId':_0x51a5c7},'cascade':!![],'transaction':_0x57d96e})['then'](function(){_0x3a5f1a[_0x5bcd('0x1e')](0xcc)[_0x5bcd('0x1f')]();});}})[_0x5bcd('0x49')](function(_0x4c6068){_0x3a5f1a[_0x5bcd('0x1e')](0x1f4)[_0x5bcd('0x2d')](_0x4c6068);});});};exports[_0x5bcd('0x75')]=function(_0x269f10,_0x5031e0,_0xa6f7d){return db['Team'][_0x5bcd('0x76')]({'where':{'id':_0x269f10[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x5031e0,null))[_0x5bcd('0x29')](function(_0x13a686){if(!_0x269f10['query'][_0x5bcd('0x77')]||!utils[_0x5bcd('0x78')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x77')])){throw new db[(_0x5bcd('0x5f'))]['ValidationError'](_0x5bcd('0x79'));}var _0x1636d8={};var _0xeec9fd={};_0xeec9fd[_0x5bcd('0x34')]=_['keys'](db[_['capitalize'](_0x269f10['query'][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+_0x5bcd('0x7b')][_0x5bcd('0x4b')]);_0xeec9fd[_0x5bcd('0x35')]=_[_0x5bcd('0x36')](_0x269f10[_0x5bcd('0x35')]);_0xeec9fd['filters']=_['intersection'](_0xeec9fd[_0x5bcd('0x34')],_0xeec9fd[_0x5bcd('0x35')]);_0x1636d8['attributes']=_['intersection'](_0xeec9fd[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x39')]));_0x1636d8[_0x5bcd('0x3a')]=_0x1636d8['attributes']['length']?_0x1636d8[_0x5bcd('0x3a')]:_0xeec9fd['model'];_0x1636d8['limit']=qs['limit'](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x1636d8[_0x5bcd('0x20')]=qs['offset'](_0x269f10['query'][_0x5bcd('0x20')]);_0x1636d8[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x3f')]);_0x1636d8['where']=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0x269f10[_0x5bcd('0x35')],_0xeec9fd[_0x5bcd('0x37')]));_0x1636d8=_[_0x5bcd('0x43')]({},_0x1636d8,_0x269f10[_0x5bcd('0x45')]);return _0x13a686[_0x5bcd('0x50')+_['capitalize'](_0x269f10[_0x5bcd('0x35')][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+_0x5bcd('0x7c')](_0x1636d8);})[_0x5bcd('0x29')](respondWithResult(_0x5031e0,null))[_0x5bcd('0x49')](handleError(_0x5031e0,null));};exports[_0x5bcd('0x7d')]=function(_0x5085a0,_0x5f5ad5,_0x5b8d09){return db['Team']['findOne']({'where':{'id':_0x5085a0[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](function(_0x585604){if(_0x585604){if(!_0x5085a0['body']['channel']||!utils[_0x5bcd('0x78')](_0x5085a0[_0x5bcd('0x4e')][_0x5bcd('0x77')])){throw new db['Sequelize'][(_0x5bcd('0x7e'))]('Unknown\x20channel');}return _0x585604[_0x5bcd('0x7f')+_['capitalize'](_0x5085a0[_0x5bcd('0x4e')]['channel']['toLowerCase']())+_0x5bcd('0x7c')](_0x5085a0[_0x5bcd('0x4e')][_0x5bcd('0x80')]);}return null;})['then'](handleEntityNotFound(_0x5f5ad5,null))[_0x5bcd('0x29')](respondWithStatusCode(_0x5f5ad5,null))['catch'](handleError(_0x5f5ad5,null));};exports[_0x5bcd('0x81')]=function(_0x5d037e,_0x326fa1,_0x71ef0e){return db['Team'][_0x5bcd('0x76')]({'where':{'id':_0x5d037e[_0x5bcd('0x5a')]['id']}})['then'](function(_0x5a54d8){if(_0x5a54d8){if(!_0x5d037e[_0x5bcd('0x35')]['channel']||!utils['isValidChannel'](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x77')])){throw new db[(_0x5bcd('0x5f'))]['ValidationError'](_0x5bcd('0x79'));}return _0x5a54d8[_0x5bcd('0x82')+_[_0x5bcd('0x83')](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x77')][_0x5bcd('0x7a')]())+'Queues'](_0x5d037e[_0x5bcd('0x35')][_0x5bcd('0x80')]);}return null;})[_0x5bcd('0x29')](handleEntityNotFound(_0x326fa1,null))['then'](respondWithStatusCode(_0x326fa1,null))['catch'](handleError(_0x326fa1,null));};exports['addAgents']=function(_0x4dfa2f,_0x2a3c28){var _0x2d88c6=_[_0x5bcd('0x84')](_0x4dfa2f[_0x5bcd('0x4e')][_0x5bcd('0x80')])?_0x4dfa2f[_0x5bcd('0x4e')]['ids']:[_0x4dfa2f[_0x5bcd('0x4e')][_0x5bcd('0x80')]];var _0x5be1e2=_0x4dfa2f[_0x5bcd('0x5a')]['id'];return db[_0x5bcd('0x30')][_0x5bcd('0x59')]({'where':{'id':_0x5be1e2}})[_0x5bcd('0x29')](handleEntityNotFound(_0x2a3c28,null))[_0x5bcd('0x29')](function(_0x3bf853){if(_0x3bf853){var _0x3ea745=[_0x5bcd('0x85'),'Chat','Mail',_0x5bcd('0x86'),_0x5bcd('0x87'),'Openchannel',_0x5bcd('0x88')];return db[_0x5bcd('0x5c')]['transaction'](function(_0x600699){var _0x150b00=_[_0x5bcd('0x2f')](_0x3ea745,function(_0x57f6c5){var _0x33b2b8={'attributes':['id',_0x5bcd('0x2c')]};if(_0x57f6c5===_0x5bcd('0x85')){_0x33b2b8[_0x5bcd('0x89')]={'attributes':[_0x5bcd('0x8a')]};}return _0x3bf853[_0x5bcd('0x50')+_0x57f6c5+_0x5bcd('0x7c')](_0x33b2b8)[_0x5bcd('0x29')](function(_0x2f04b7){var _0x49b0c0=_[_0x5bcd('0x2f')](_0x2f04b7,function(_0x28be43){var _0x374ba5=_[_0x5bcd('0x2f')](_0x2d88c6,function(_0x36ade2){var _0x221514={'where':{'UserId':_0x36ade2,[_0x57f6c5+'QueueId']:_0x28be43['id']},'transaction':_0x600699};if(_0x57f6c5===_0x5bcd('0x85')){_0x221514['defaults']={'penalty':_0x28be43[_0x5bcd('0x8b')]['penalty']};}return db[_0x5bcd('0x8c')+_0x57f6c5+_0x5bcd('0x7b')][_0x5bcd('0x8d')](_0x221514)[_0x5bcd('0x29')](function(){socket['emit'](_0x5bcd('0x4f')+_0x57f6c5+_0x5bcd('0x8e'),{'UserId':_0x36ade2,[_0x57f6c5+'QueueId']:_0x28be43['id']});if(_0x57f6c5!==_0x5bcd('0x85')){return;}return db[_0x5bcd('0x8c')][_0x5bcd('0x47')]({'where':{'id':_0x2d88c6,'online':0x1},'attributes':['id',_0x5bcd('0x2c'),_0x5bcd('0x8f'),_0x5bcd('0x90'),_0x5bcd('0x91')],'raw':!![]})[_0x5bcd('0x29')](function(_0x33cfe9){var _0x5756d9=_['map'](_0x33cfe9,function(_0x4fcbdc){return db[_0x5bcd('0x92')][_0x5bcd('0x93')]({'membername':_0x4fcbdc[_0x5bcd('0x2c')],'UserId':_0x4fcbdc['id'],'queue_name':_0x28be43[_0x5bcd('0x2c')],'VoiceQueueId':_0x28be43['id'],'interface':_[_0x5bcd('0x94')](_0x4fcbdc[_0x5bcd('0x91')])?util[_0x5bcd('0x95')](_0x5bcd('0x96'),_0x4fcbdc[_0x5bcd('0x2c')]):_0x4fcbdc[_0x5bcd('0x91')],'paused':_0x4fcbdc[_0x5bcd('0x90')]||![],'penalty':_0x28be43[_0x5bcd('0x8b')][_0x5bcd('0x8a')]},{'transaction':_0x600699});});return Promise[_0x5bcd('0x97')](_0x5756d9);});});});return Promise['all'](_0x374ba5);});return Promise[_0x5bcd('0x97')](_0x49b0c0);})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')][_0x5bcd('0x76')]({'where':{'teamId':_0x5be1e2}})[_0x5bcd('0x29')](function(_0x4a9048){if(_0x4a9048){var _0x382fef=_[_0x5bcd('0x2f')](_0x2d88c6,function(_0x331255){db[_0x5bcd('0x73')][_0x5bcd('0x93')]({'UserId':_0x331255,'VoicePrefixId':_0x4a9048[_0x5bcd('0x74')]});});return Promise['all'](_0x382fef);}});});});return Promise[_0x5bcd('0x97')](_0x150b00)[_0x5bcd('0x29')](function(){return _0x3bf853[_0x5bcd('0x98')](_0x2d88c6,{'transaction':_0x600699})['spread'](function(_0x57385d){return _0x57385d;});});});}})[_0x5bcd('0x29')](respondWithResult(_0x2a3c28,null))[_0x5bcd('0x49')](handleError(_0x2a3c28,null));};exports['removeAgents']=function(_0x38e303,_0x413ade){var _0x2f37c8=_['isArray'](_0x38e303[_0x5bcd('0x35')][_0x5bcd('0x80')])?_0x38e303['query'][_0x5bcd('0x80')]:[_0x38e303[_0x5bcd('0x35')]['ids']];var _0x2fddd5=_0x38e303['params']['id'];return db[_0x5bcd('0x30')][_0x5bcd('0x59')]({'where':{'id':_0x2fddd5}})[_0x5bcd('0x29')](handleEntityNotFound(_0x413ade,null))['then'](function(_0x11a0ae){if(_0x11a0ae){var _0x552384=[_0x5bcd('0x85'),_0x5bcd('0x99'),'Mail',_0x5bcd('0x86'),_0x5bcd('0x87'),'Openchannel',_0x5bcd('0x88')];return db[_0x5bcd('0x5c')]['transaction'](function(_0x1416b3){var _0x535d67=_[_0x5bcd('0x2f')](_0x552384,function(_0xdf6449){var _0x91e1c3={'attributes':['id',_0x5bcd('0x2c')]};return _0x11a0ae[_0x5bcd('0x50')+_0xdf6449+_0x5bcd('0x7c')](_0x91e1c3)[_0x5bcd('0x29')](function(_0x2341c2){var _0x5e7446=_[_0x5bcd('0x2f')](_0x2341c2,function(_0x25d9b9){return _0x25d9b9[_0x5bcd('0x9a')](_0x2f37c8,{'transaction':_0x1416b3})[_0x5bcd('0x29')](function(){var _0x7df2d1=_[_0x5bcd('0x2f')](_0x2f37c8,function(_0x3c2985){socket['emit'](_0x5bcd('0x4f')+_0xdf6449+_0x5bcd('0x9b'),{'UserId':Number(_0x3c2985),[_0xdf6449+_0x5bcd('0x9c')]:_0x25d9b9['id']});if(_0xdf6449!==_0x5bcd('0x85')){return;}return db[_0x5bcd('0x92')]['destroy']({'where':{'VoiceQueueId':_0x25d9b9['id'],'UserId':_0x3c2985},'transaction':_0x1416b3});});return Promise['all'](_0x7df2d1);});});return Promise[_0x5bcd('0x97')](_0x5e7446);});});return Promise[_0x5bcd('0x97')](_0x535d67)['then'](function(){return _0x11a0ae[_0x5bcd('0x9a')](_0x2f37c8,{'transaction':_0x1416b3});})[_0x5bcd('0x29')](function(){return db[_0x5bcd('0x72')][_0x5bcd('0x76')]({'where':{'teamId':_0x2fddd5}})['then'](function(_0x3fe9a4){if(_0x3fe9a4){var _0xab9eaf=_['map'](_0x2f37c8,function(_0x433821){db['UserVoicePrefix'][_0x5bcd('0x5b')]({'where':{'UserId':_0x433821,'VoicePrefixId':_0x3fe9a4[_0x5bcd('0x74')]}});});return Promise[_0x5bcd('0x97')](_0xab9eaf);}});});});}})[_0x5bcd('0x29')](respondWithStatusCode(_0x413ade,null))[_0x5bcd('0x49')](handleError(_0x413ade,null));};exports[_0x5bcd('0x9d')]=function(_0x3b4701,_0x3e050f,_0x282bc3){var _0x49a789={};var _0x586cfe={};var _0x5d0d3a;var _0x50fd7b;return db['Team']['findOne']({'where':{'id':_0x3b4701[_0x5bcd('0x5a')]['id']}})[_0x5bcd('0x29')](handleEntityNotFound(_0x3e050f,null))[_0x5bcd('0x29')](function(_0x1d8874){if(_0x1d8874){_0x5d0d3a=_0x1d8874;_0x586cfe[_0x5bcd('0x34')]=_['keys'](db[_0x5bcd('0x8c')][_0x5bcd('0x4b')]);_0x586cfe['query']=_[_0x5bcd('0x36')](_0x3b4701['query']);_0x586cfe[_0x5bcd('0x37')]=_[_0x5bcd('0x38')](_0x586cfe[_0x5bcd('0x34')],_0x586cfe[_0x5bcd('0x35')]);_0x49a789[_0x5bcd('0x3a')]=_[_0x5bcd('0x38')](_0x586cfe[_0x5bcd('0x34')],qs[_0x5bcd('0x39')](_0x3b4701['query']['fields']));_0x49a789[_0x5bcd('0x3a')]=_0x49a789[_0x5bcd('0x3a')][_0x5bcd('0x3b')]?_0x49a789[_0x5bcd('0x3a')]:_0x586cfe[_0x5bcd('0x34')];_0x49a789[_0x5bcd('0x3e')]=qs[_0x5bcd('0x3f')](_0x3b4701['query'][_0x5bcd('0x3f')]);_0x49a789[_0x5bcd('0x40')]=qs[_0x5bcd('0x37')](_[_0x5bcd('0x41')](_0x3b4701[_0x5bcd('0x35')],_0x586cfe['filters']));if(_0x3b4701['query']['filter']){_0x49a789[_0x5bcd('0x40')]=_[_0x5bcd('0x43')](_0x49a789[_0x5bcd('0x40')],{'$or':_['map'](_0x49a789[_0x5bcd('0x3a')],function(_0x386dea){var _0x5be4a1={};_0x5be4a1[_0x386dea]={'$like':'%'+_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x42')]+'%'};return _0x5be4a1;})});}_0x49a789=_[_0x5bcd('0x43')]({},_0x49a789,_0x3b4701[_0x5bcd('0x45')]);return _0x5d0d3a[_0x5bcd('0x9d')](_0x49a789);}})[_0x5bcd('0x29')](function(_0xd3c485){if(_0xd3c485){_0x50fd7b=_0xd3c485[_0x5bcd('0x3b')];if(!_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x3c')](_0x5bcd('0x3d'))){_0x49a789[_0x5bcd('0x22')]=qs[_0x5bcd('0x22')](_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x22')]);_0x49a789[_0x5bcd('0x20')]=qs[_0x5bcd('0x20')](_0x3b4701[_0x5bcd('0x35')][_0x5bcd('0x20')]);}return _0x5d0d3a[_0x5bcd('0x9d')](_0x49a789);}})[_0x5bcd('0x29')](function(_0x475498){if(_0x475498){return _0x475498?{'count':_0x50fd7b,'rows':_0x475498}:null;}})[_0x5bcd('0x29')](respondWithResult(_0x3e050f,null))[_0x5bcd('0x49')](handleError(_0x3e050f,null));}; \ No newline at end of file +var _0xc978=['then','error','stack','index','Team','rawAttributes','fieldName','type','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','user','get','role','Teams','UserProfileSection','UserProfileResource','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','send','getQueues','findOne','channel','toLowerCase','Queue','order','capitalize','isValidChannel','ValidationError','Unknown\x20channel','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','User','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Chat','Fax','Queue:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./team.socket','register','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','update'];(function(_0x23f75c,_0x3b6a63){var _0x5b2352=function(_0x441b6c){while(--_0x441b6c){_0x23f75c['push'](_0x23f75c['shift']());}};_0x5b2352(++_0x3b6a63);}(_0xc978,0x10c));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x8c97('0x0'));var rimraf=require(_0x8c97('0x1'));var zipdir=require(_0x8c97('0x2'));var jsonpatch=require(_0x8c97('0x3'));var rp=require(_0x8c97('0x4'));var moment=require(_0x8c97('0x5'));var BPromise=require(_0x8c97('0x6'));var Mustache=require(_0x8c97('0x7'));var util=require(_0x8c97('0x8'));var path=require(_0x8c97('0x9'));var sox=require('sox');var csv=require(_0x8c97('0xa'));var ejs=require(_0x8c97('0xb'));var fs=require('fs');var fs_extra=require(_0x8c97('0xc'));var _=require(_0x8c97('0xd'));var squel=require(_0x8c97('0xe'));var crypto=require(_0x8c97('0xf'));var jsforce=require(_0x8c97('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8c97('0xa'));var querystring=require(_0x8c97('0x11'));var Papa=require(_0x8c97('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c97('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c97('0x14'));var logger=require(_0x8c97('0x15'))(_0x8c97('0x16'));var utils=require(_0x8c97('0x17'));var config=require(_0x8c97('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8c97('0x19')]=_[_0x8c97('0x1a')](config[_0x8c97('0x19')],{'host':_0x8c97('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c97('0x19')]));require(_0x8c97('0x1c'))[_0x8c97('0x1d')](socket);function respondWithStatusCode(_0x2bf970,_0x4fa185){_0x4fa185=_0x4fa185||0xcc;return function(_0x47ecc3){if(_0x47ecc3){return _0x2bf970[_0x8c97('0x1e')](_0x4fa185);}return _0x2bf970['status'](_0x4fa185)[_0x8c97('0x1f')]();};}function respondWithResult(_0x1c4cee,_0xf4729){_0xf4729=_0xf4729||0xc8;return function(_0x1a6d23){if(_0x1a6d23){return _0x1c4cee[_0x8c97('0x20')](_0xf4729)[_0x8c97('0x21')](_0x1a6d23);}};}function respondWithFilteredResult(_0x5e622e,_0x21ac1f){return function(_0x5b1b98){if(_0x5b1b98){var _0xb18e16=typeof _0x21ac1f['offset']==='undefined'&&typeof _0x21ac1f[_0x8c97('0x22')]==='undefined';var _0x588136=_0x5b1b98[_0x8c97('0x23')];var _0x595d60=_0xb18e16?0x0:_0x21ac1f[_0x8c97('0x24')];var _0x248bf2=_0xb18e16?_0x5b1b98[_0x8c97('0x23')]:_0x21ac1f['offset']+_0x21ac1f[_0x8c97('0x22')];var _0x3edc4f;if(_0x248bf2>=_0x588136){_0x248bf2=_0x588136;_0x3edc4f=0xc8;}else{_0x3edc4f=0xce;}_0x5e622e['status'](_0x3edc4f);return _0x5e622e[_0x8c97('0x25')](_0x8c97('0x26'),_0x595d60+'-'+_0x248bf2+'/'+_0x588136)[_0x8c97('0x21')](_0x5b1b98);}return null;};}function patchUpdates(_0x3dcafd){return function(_0xca6446){try{jsonpatch[_0x8c97('0x27')](_0xca6446,_0x3dcafd,!![]);}catch(_0x3aec6d){return BPromise[_0x8c97('0x28')](_0x3aec6d);}return _0xca6446['save']();};}function saveUpdates(_0x27887b,_0x550d95){return function(_0x596e6d){if(_0x596e6d){return _0x596e6d[_0x8c97('0x29')](_0x27887b)[_0x8c97('0x2a')](function(_0x35965d){return _0x35965d;});}return null;};}function handleEntityNotFound(_0x46dc6b,_0x24430a){return function(_0x5aed1c){if(!_0x5aed1c){_0x46dc6b[_0x8c97('0x1e')](0x194);}return _0x5aed1c;};}function handleError(_0x1461a1,_0x21b083){_0x21b083=_0x21b083||0x1f4;return function(_0x1dd2a6){logger[_0x8c97('0x2b')](_0x1dd2a6[_0x8c97('0x2c')]);if(_0x1dd2a6['name']){delete _0x1dd2a6['name'];}_0x1461a1[_0x8c97('0x20')](_0x21b083)['send'](_0x1dd2a6);};}exports[_0x8c97('0x2d')]=function(_0x48ea76,_0x4127d0){var _0x5a630c={},_0x1db976={},_0x46610f={'count':0x0,'rows':[]};var _0xe14d5b=_['map'](db[_0x8c97('0x2e')][_0x8c97('0x2f')],function(_0x5df427){return{'name':_0x5df427[_0x8c97('0x30')],'type':_0x5df427[_0x8c97('0x31')]['key']};});_0x1db976[_0x8c97('0x32')]=_[_0x8c97('0x33')](_0xe14d5b,_0x8c97('0x34'));_0x1db976[_0x8c97('0x35')]=_['keys'](_0x48ea76[_0x8c97('0x35')]);_0x1db976[_0x8c97('0x36')]=_['intersection'](_0x1db976['model'],_0x1db976['query']);_0x5a630c[_0x8c97('0x37')]=_[_0x8c97('0x38')](_0x1db976[_0x8c97('0x32')],qs[_0x8c97('0x39')](_0x48ea76[_0x8c97('0x35')][_0x8c97('0x39')]));_0x5a630c[_0x8c97('0x37')]=_0x5a630c[_0x8c97('0x37')][_0x8c97('0x3a')]?_0x5a630c['attributes']:_0x1db976[_0x8c97('0x32')];if(!_0x48ea76[_0x8c97('0x35')][_0x8c97('0x3b')]('nolimit')){_0x5a630c[_0x8c97('0x22')]=qs[_0x8c97('0x22')](_0x48ea76['query'][_0x8c97('0x22')]);_0x5a630c['offset']=qs[_0x8c97('0x24')](_0x48ea76[_0x8c97('0x35')][_0x8c97('0x24')]);}_0x5a630c['order']=qs[_0x8c97('0x3c')](_0x48ea76[_0x8c97('0x35')][_0x8c97('0x3c')]);_0x5a630c[_0x8c97('0x3d')]=qs['filters'](_[_0x8c97('0x3e')](_0x48ea76[_0x8c97('0x35')],_0x1db976[_0x8c97('0x36')]),_0xe14d5b);if(_0x48ea76[_0x8c97('0x35')]['filter']){_0x5a630c[_0x8c97('0x3d')]=_['merge'](_0x5a630c['where'],{'$or':_[_0x8c97('0x33')](_0xe14d5b,function(_0x533bb4){if(_0x533bb4[_0x8c97('0x31')]!=='VIRTUAL'){var _0x533be0={};_0x533be0[_0x533bb4[_0x8c97('0x34')]]={'$like':'%'+_0x48ea76[_0x8c97('0x35')][_0x8c97('0x3f')]+'%'};return _0x533be0;}})});}_0x5a630c=_[_0x8c97('0x40')]({},_0x5a630c,_0x48ea76[_0x8c97('0x41')]);var _0x141a12={'where':_0x5a630c[_0x8c97('0x3d')]};return db[_0x8c97('0x2e')][_0x8c97('0x23')](_0x141a12)['then'](function(_0x668d30){_0x46610f[_0x8c97('0x23')]=_0x668d30;if(_0x48ea76[_0x8c97('0x35')][_0x8c97('0x42')]){_0x5a630c[_0x8c97('0x43')]=[{'all':!![]}];}return db['Team'][_0x8c97('0x44')](_0x5a630c);})['then'](function(_0x26862e){_0x46610f[_0x8c97('0x45')]=_0x26862e;return _0x46610f;})['then'](respondWithFilteredResult(_0x4127d0,_0x5a630c))['catch'](handleError(_0x4127d0,null));};exports[_0x8c97('0x46')]=function(_0x16f906,_0x5e47d1){var _0x12a2c0={'raw':![],'where':{'id':_0x16f906[_0x8c97('0x47')]['id']}},_0xbe5b99={};_0xbe5b99[_0x8c97('0x32')]=_[_0x8c97('0x48')](db['Team'][_0x8c97('0x2f')]);_0xbe5b99[_0x8c97('0x35')]=_['keys'](_0x16f906[_0x8c97('0x35')]);_0xbe5b99[_0x8c97('0x36')]=_[_0x8c97('0x38')](_0xbe5b99[_0x8c97('0x32')],_0xbe5b99['query']);_0x12a2c0[_0x8c97('0x37')]=_[_0x8c97('0x38')](_0xbe5b99[_0x8c97('0x32')],qs[_0x8c97('0x39')](_0x16f906[_0x8c97('0x35')][_0x8c97('0x39')]));_0x12a2c0['attributes']=_0x12a2c0[_0x8c97('0x37')][_0x8c97('0x3a')]?_0x12a2c0['attributes']:_0xbe5b99[_0x8c97('0x32')];if(_0x16f906[_0x8c97('0x35')][_0x8c97('0x42')]){_0x12a2c0[_0x8c97('0x43')]=[{'all':!![]}];}_0x12a2c0=_['merge']({},_0x12a2c0,_0x16f906[_0x8c97('0x41')]);return db[_0x8c97('0x2e')][_0x8c97('0x49')](_0x12a2c0)[_0x8c97('0x2a')](handleEntityNotFound(_0x5e47d1,null))['then'](respondWithResult(_0x5e47d1,null))[_0x8c97('0x4a')](handleError(_0x5e47d1,null));};exports[_0x8c97('0x4b')]=function(_0x367812,_0x363bb9){return db['Team'][_0x8c97('0x4b')](_0x367812[_0x8c97('0x4c')],{})[_0x8c97('0x2a')](function(_0xa888f5){var _0x5980a5=_0x367812[_0x8c97('0x4d')][_0x8c97('0x4e')]({'plain':!![]});if(!_0x5980a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5980a5[_0x8c97('0x4f')]==='user'){var _0x33a4b5=_0xa888f5[_0x8c97('0x4e')]({'plain':!![]});var _0x4c9a2c=_0x8c97('0x50');return db[_0x8c97('0x51')][_0x8c97('0x49')]({'where':{'name':_0x4c9a2c,'userProfileId':_0x5980a5['userProfileId']},'raw':!![]})[_0x8c97('0x2a')](function(_0xd5f4e0){if(_0xd5f4e0&&_0xd5f4e0['autoAssociation']===0x0){return db[_0x8c97('0x52')][_0x8c97('0x4b')]({'name':_0x33a4b5[_0x8c97('0x34')],'resourceId':_0x33a4b5['id'],'type':_0xd5f4e0['name'],'sectionId':_0xd5f4e0['id']},{})[_0x8c97('0x2a')](function(){return _0xa888f5;});}else{return _0xa888f5;}})[_0x8c97('0x4a')](function(_0x4cb46d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cb46d);throw _0x4cb46d;});}return _0xa888f5;})[_0x8c97('0x2a')](respondWithResult(_0x363bb9,0xc9))[_0x8c97('0x4a')](handleError(_0x363bb9,null));};exports[_0x8c97('0x29')]=function(_0x33f4b5,_0x277344){if(_0x33f4b5[_0x8c97('0x4c')]['id']){delete _0x33f4b5[_0x8c97('0x4c')]['id'];}return db[_0x8c97('0x2e')]['find']({'where':{'id':_0x33f4b5[_0x8c97('0x47')]['id']}})[_0x8c97('0x2a')](handleEntityNotFound(_0x277344,null))[_0x8c97('0x2a')](saveUpdates(_0x33f4b5[_0x8c97('0x4c')],null))['then'](respondWithResult(_0x277344,null))[_0x8c97('0x4a')](handleError(_0x277344,null));};exports[_0x8c97('0x53')]=function(_0x1ba5e8,_0x59fd4e){var _0x2c79dc=_0x1ba5e8[_0x8c97('0x47')]['id'];var _0x3d638f=[];return db[_0x8c97('0x54')][_0x8c97('0x55')](function(_0x3956e6){var _0x15e814=_0x8c97('0x56')+_0x2c79dc;return db[_0x8c97('0x54')]['query'](_0x15e814,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')][_0x8c97('0x59')],'raw':!![],'transaction':_0x3956e6})['then'](function(_0x233e9c){_0x3d638f=_[_0x8c97('0x33')](_0x233e9c,function(_0x435e39){return Number(_0x435e39[_0x8c97('0x5a')]);});})[_0x8c97('0x2a')](function(){var _0x36f5f1='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2c79dc;return db['sequelize']['query'](_0x36f5f1,{'type':db[_0x8c97('0x57')]['QueryTypes'][_0x8c97('0x59')],'raw':!![],'transaction':_0x3956e6});})['then'](function(_0x1f0070){var _0xb7c9a9=_[_0x8c97('0x33')](_0x1f0070,function(_0x4b0ed2){return Number(_0x4b0ed2[_0x8c97('0x5b')]);});return db['UserVoiceQueue'][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'VoiceQueueId':{'$in':_0xb7c9a9}},'transaction':_0x3956e6});})['then'](function(){var _0x4b2540=_0x8c97('0x5c')+_0x2c79dc;return db['sequelize']['query'](_0x4b2540,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')][_0x8c97('0x59')],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x4b60ba){var _0x504527=_[_0x8c97('0x33')](_0x4b60ba,function(_0x352706){return Number(_0x352706[_0x8c97('0x5d')]);});return db[_0x8c97('0x5e')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'MailQueueId':{'$in':_0x504527}},'transaction':_0x3956e6});})['then'](function(){var _0x246f1d='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2c79dc;return db[_0x8c97('0x54')][_0x8c97('0x35')](_0x246f1d,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')]['SELECT'],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x47ddfb){var _0x2ab1ac=_[_0x8c97('0x33')](_0x47ddfb,function(_0x531667){return Number(_0x531667[_0x8c97('0x5f')]);});return db[_0x8c97('0x60')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'SmsQueueId':{'$in':_0x2ab1ac}},'transaction':_0x3956e6});})['then'](function(){var _0x3a8b99=_0x8c97('0x61')+_0x2c79dc;return db[_0x8c97('0x54')][_0x8c97('0x35')](_0x3a8b99,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')][_0x8c97('0x59')],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x1565ff){var _0x53c076=_[_0x8c97('0x33')](_0x1565ff,function(_0x1cb7c5){return Number(_0x1cb7c5[_0x8c97('0x62')]);});return db[_0x8c97('0x63')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'ChatQueueId':{'$in':_0x53c076}},'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(){var _0x3b092f=_0x8c97('0x64')+_0x2c79dc;return db[_0x8c97('0x54')]['query'](_0x3b092f,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')]['SELECT'],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x3a32f8){var _0x8f3cad=_[_0x8c97('0x33')](_0x3a32f8,function(_0x12875c){return Number(_0x12875c[_0x8c97('0x65')]);});return db[_0x8c97('0x66')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'FaxQueueId':{'$in':_0x8f3cad}},'transaction':_0x3956e6});})['then'](function(){var _0x4c8093=_0x8c97('0x67')+_0x2c79dc;return db[_0x8c97('0x54')][_0x8c97('0x35')](_0x4c8093,{'type':db[_0x8c97('0x57')][_0x8c97('0x58')]['SELECT'],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x2b2ad2){var _0x5ca40b=_['map'](_0x2b2ad2,function(_0x1a92bf){return Number(_0x1a92bf[_0x8c97('0x68')]);});return db['UserOpenchannelQueue'][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'OpenchannelQueueId':{'$in':_0x5ca40b}},'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(){var _0x618e8d='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2c79dc;return db['sequelize'][_0x8c97('0x35')](_0x618e8d,{'type':db['Sequelize'][_0x8c97('0x58')][_0x8c97('0x59')],'raw':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x93d921){var _0x2257e6=_[_0x8c97('0x33')](_0x93d921,function(_0x44cfdb){return Number(_0x44cfdb[_0x8c97('0x69')]);});return db[_0x8c97('0x6a')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'WhatsappQueueId':{'$in':_0x2257e6}},'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(){return db[_0x8c97('0x6b')][_0x8c97('0x49')]({'where':{'TeamId':_0x2c79dc}});})[_0x8c97('0x2a')](function(_0x2e3cf8){if(_0x2e3cf8===null){return;}return db[_0x8c97('0x6c')][_0x8c97('0x53')]({'where':{'UserId':{'$in':_0x3d638f},'VoicePrefixId':_0x2e3cf8['VoicePrefixId']},'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(){return db[_0x8c97('0x2e')][_0x8c97('0x53')]({'where':{'id':_0x2c79dc},'cascade':!![],'transaction':_0x3956e6});})[_0x8c97('0x2a')](function(_0x48f0a7){if(_0x48f0a7===0x0){_0x59fd4e[_0x8c97('0x1e')](0x194);}else{return db[_0x8c97('0x52')][_0x8c97('0x53')]({'where':{'type':_0x8c97('0x50'),'resourceId':_0x2c79dc},'cascade':!![],'transaction':_0x3956e6})[_0x8c97('0x2a')](function(){_0x59fd4e[_0x8c97('0x20')](0xcc)[_0x8c97('0x1f')]();});}})[_0x8c97('0x4a')](function(_0x1c21ab){_0x59fd4e[_0x8c97('0x20')](0x1f4)[_0x8c97('0x6d')](_0x1c21ab);});});};exports[_0x8c97('0x6e')]=function(_0x4a3925,_0x393f18,_0x4d974d){return db[_0x8c97('0x2e')][_0x8c97('0x6f')]({'where':{'id':_0x4a3925[_0x8c97('0x47')]['id']}})['then'](handleEntityNotFound(_0x393f18,null))[_0x8c97('0x2a')](function(_0x5dd361){if(!_0x4a3925[_0x8c97('0x35')][_0x8c97('0x70')]||!utils['isValidChannel'](_0x4a3925['query'][_0x8c97('0x70')])){throw new db[(_0x8c97('0x57'))]['ValidationError']('Unknown\x20channel');}var _0x1a41cb={};var _0x113c61={};_0x113c61[_0x8c97('0x32')]=_[_0x8c97('0x48')](db[_['capitalize'](_0x4a3925[_0x8c97('0x35')]['channel'][_0x8c97('0x71')]())+_0x8c97('0x72')][_0x8c97('0x2f')]);_0x113c61[_0x8c97('0x35')]=_[_0x8c97('0x48')](_0x4a3925['query']);_0x113c61[_0x8c97('0x36')]=_[_0x8c97('0x38')](_0x113c61[_0x8c97('0x32')],_0x113c61[_0x8c97('0x35')]);_0x1a41cb[_0x8c97('0x37')]=_[_0x8c97('0x38')](_0x113c61[_0x8c97('0x32')],qs['fields'](_0x4a3925[_0x8c97('0x35')][_0x8c97('0x39')]));_0x1a41cb[_0x8c97('0x37')]=_0x1a41cb[_0x8c97('0x37')][_0x8c97('0x3a')]?_0x1a41cb[_0x8c97('0x37')]:_0x113c61[_0x8c97('0x32')];_0x1a41cb[_0x8c97('0x22')]=qs[_0x8c97('0x22')](_0x4a3925['query'][_0x8c97('0x22')]);_0x1a41cb['offset']=qs[_0x8c97('0x24')](_0x4a3925['query'][_0x8c97('0x24')]);_0x1a41cb[_0x8c97('0x73')]=qs[_0x8c97('0x3c')](_0x4a3925[_0x8c97('0x35')][_0x8c97('0x3c')]);_0x1a41cb[_0x8c97('0x3d')]=qs[_0x8c97('0x36')](_[_0x8c97('0x3e')](_0x4a3925[_0x8c97('0x35')],_0x113c61['filters']));_0x1a41cb=_[_0x8c97('0x40')]({},_0x1a41cb,_0x4a3925[_0x8c97('0x41')]);return _0x5dd361[_0x8c97('0x4e')+_[_0x8c97('0x74')](_0x4a3925['query']['channel']['toLowerCase']())+'Queues'](_0x1a41cb);})[_0x8c97('0x2a')](respondWithResult(_0x393f18,null))['catch'](handleError(_0x393f18,null));};exports['addQueues']=function(_0xc26a26,_0x2d0104,_0x4476f7){return db[_0x8c97('0x2e')][_0x8c97('0x6f')]({'where':{'id':_0xc26a26[_0x8c97('0x47')]['id']}})[_0x8c97('0x2a')](function(_0x2e5d34){if(_0x2e5d34){if(!_0xc26a26[_0x8c97('0x4c')][_0x8c97('0x70')]||!utils[_0x8c97('0x75')](_0xc26a26[_0x8c97('0x4c')][_0x8c97('0x70')])){throw new db[(_0x8c97('0x57'))][(_0x8c97('0x76'))](_0x8c97('0x77'));}return _0x2e5d34['add'+_['capitalize'](_0xc26a26[_0x8c97('0x4c')][_0x8c97('0x70')][_0x8c97('0x71')]())+_0x8c97('0x78')](_0xc26a26[_0x8c97('0x4c')][_0x8c97('0x79')]);}return null;})[_0x8c97('0x2a')](handleEntityNotFound(_0x2d0104,null))['then'](respondWithStatusCode(_0x2d0104,null))[_0x8c97('0x4a')](handleError(_0x2d0104,null));};exports[_0x8c97('0x7a')]=function(_0x8d993,_0x39b595,_0x485450){return db[_0x8c97('0x2e')][_0x8c97('0x6f')]({'where':{'id':_0x8d993[_0x8c97('0x47')]['id']}})[_0x8c97('0x2a')](function(_0x328e4f){if(_0x328e4f){if(!_0x8d993['query']['channel']||!utils[_0x8c97('0x75')](_0x8d993[_0x8c97('0x35')][_0x8c97('0x70')])){throw new db[(_0x8c97('0x57'))][(_0x8c97('0x76'))](_0x8c97('0x77'));}return _0x328e4f[_0x8c97('0x7b')+_['capitalize'](_0x8d993['query'][_0x8c97('0x70')]['toLowerCase']())+_0x8c97('0x78')](_0x8d993[_0x8c97('0x35')][_0x8c97('0x79')]);}return null;})[_0x8c97('0x2a')](handleEntityNotFound(_0x39b595,null))[_0x8c97('0x2a')](respondWithStatusCode(_0x39b595,null))[_0x8c97('0x4a')](handleError(_0x39b595,null));};exports[_0x8c97('0x7c')]=function(_0x5bbe63,_0x5cbf93){var _0x580613=_[_0x8c97('0x7d')](_0x5bbe63['body']['ids'])?_0x5bbe63[_0x8c97('0x4c')][_0x8c97('0x79')]:[_0x5bbe63[_0x8c97('0x4c')][_0x8c97('0x79')]];var _0x1c57dc=_0x5bbe63[_0x8c97('0x47')]['id'];return db[_0x8c97('0x2e')][_0x8c97('0x49')]({'where':{'id':_0x1c57dc}})[_0x8c97('0x2a')](handleEntityNotFound(_0x5cbf93,null))[_0x8c97('0x2a')](function(_0xb592f3){if(_0xb592f3){var _0x14bb92=[_0x8c97('0x7e'),'Chat',_0x8c97('0x7f'),_0x8c97('0x80'),'Fax',_0x8c97('0x81'),_0x8c97('0x82')];return db[_0x8c97('0x54')][_0x8c97('0x55')](function(_0x1901c4){var _0x2e3798=_[_0x8c97('0x33')](_0x14bb92,function(_0x466869){var _0x48ffd4={'attributes':['id',_0x8c97('0x34')]};if(_0x466869===_0x8c97('0x7e')){_0x48ffd4[_0x8c97('0x83')]={'attributes':[_0x8c97('0x84')]};}return _0xb592f3[_0x8c97('0x4e')+_0x466869+_0x8c97('0x78')](_0x48ffd4)[_0x8c97('0x2a')](function(_0x27acb0){var _0x32ce66=_[_0x8c97('0x33')](_0x27acb0,function(_0x57b739){var _0x487d84=_[_0x8c97('0x33')](_0x580613,function(_0x4455a1){var _0x4d19b9={'where':{'UserId':_0x4455a1,[_0x466869+_0x8c97('0x85')]:_0x57b739['id']},'transaction':_0x1901c4};if(_0x466869==='Voice'){_0x4d19b9[_0x8c97('0x1a')]={'penalty':_0x57b739[_0x8c97('0x86')][_0x8c97('0x84')]};}return db['User'+_0x466869+_0x8c97('0x72')][_0x8c97('0x87')](_0x4d19b9)[_0x8c97('0x2a')](function(){socket[_0x8c97('0x88')]('user'+_0x466869+_0x8c97('0x89'),{'UserId':_0x4455a1,[_0x466869+_0x8c97('0x85')]:_0x57b739['id']});if(_0x466869!==_0x8c97('0x7e')){return;}return db[_0x8c97('0x8a')][_0x8c97('0x44')]({'where':{'id':_0x580613,'online':0x1},'attributes':['id',_0x8c97('0x34'),'online',_0x8c97('0x8b'),_0x8c97('0x8c')],'raw':!![]})[_0x8c97('0x2a')](function(_0x4a7bce){var _0x8f33a4=_[_0x8c97('0x33')](_0x4a7bce,function(_0x523db6){return db[_0x8c97('0x8d')][_0x8c97('0x8e')]({'membername':_0x523db6['name'],'UserId':_0x523db6['id'],'queue_name':_0x57b739[_0x8c97('0x34')],'VoiceQueueId':_0x57b739['id'],'interface':_[_0x8c97('0x8f')](_0x523db6[_0x8c97('0x8c')])?util[_0x8c97('0x90')](_0x8c97('0x91'),_0x523db6[_0x8c97('0x34')]):_0x523db6[_0x8c97('0x8c')],'paused':_0x523db6[_0x8c97('0x8b')]||![],'penalty':_0x57b739[_0x8c97('0x86')][_0x8c97('0x84')]},{'transaction':_0x1901c4});});return Promise[_0x8c97('0x92')](_0x8f33a4);});});});return Promise['all'](_0x487d84);});return Promise[_0x8c97('0x92')](_0x32ce66);})['then'](function(){return db[_0x8c97('0x6b')][_0x8c97('0x6f')]({'where':{'teamId':_0x1c57dc}})[_0x8c97('0x2a')](function(_0x2a641a){if(_0x2a641a){var _0x29e2cc=_[_0x8c97('0x33')](_0x580613,function(_0xc863be){db[_0x8c97('0x6c')]['upsert']({'UserId':_0xc863be,'VoicePrefixId':_0x2a641a[_0x8c97('0x93')]});});return Promise[_0x8c97('0x92')](_0x29e2cc);}});});});return Promise[_0x8c97('0x92')](_0x2e3798)[_0x8c97('0x2a')](function(){return _0xb592f3[_0x8c97('0x7c')](_0x580613,{'transaction':_0x1901c4})[_0x8c97('0x94')](function(_0xb4fa60){return _0xb4fa60;});});});}})[_0x8c97('0x2a')](respondWithResult(_0x5cbf93,null))[_0x8c97('0x4a')](handleError(_0x5cbf93,null));};exports[_0x8c97('0x95')]=function(_0x953c30,_0x1e27da){var _0x1ec3be=_[_0x8c97('0x7d')](_0x953c30[_0x8c97('0x35')][_0x8c97('0x79')])?_0x953c30[_0x8c97('0x35')][_0x8c97('0x79')]:[_0x953c30[_0x8c97('0x35')][_0x8c97('0x79')]];var _0x58a34d=_0x953c30[_0x8c97('0x47')]['id'];return db['Team']['find']({'where':{'id':_0x58a34d}})['then'](handleEntityNotFound(_0x1e27da,null))[_0x8c97('0x2a')](function(_0xcb165){if(_0xcb165){var _0x2c44f4=[_0x8c97('0x7e'),_0x8c97('0x96'),_0x8c97('0x7f'),_0x8c97('0x80'),_0x8c97('0x97'),_0x8c97('0x81'),'Whatsapp'];return db[_0x8c97('0x54')][_0x8c97('0x55')](function(_0x25d8f9){var _0x1a9d2e=_[_0x8c97('0x33')](_0x2c44f4,function(_0x185eef){var _0x18f0ea={'attributes':['id',_0x8c97('0x34')]};return _0xcb165[_0x8c97('0x4e')+_0x185eef+_0x8c97('0x78')](_0x18f0ea)[_0x8c97('0x2a')](function(_0x7ec177){var _0x230ad4=_[_0x8c97('0x33')](_0x7ec177,function(_0x57f89d){return _0x57f89d[_0x8c97('0x95')](_0x1ec3be,{'transaction':_0x25d8f9})[_0x8c97('0x2a')](function(){var _0x17cbae=_[_0x8c97('0x33')](_0x1ec3be,function(_0x1019a6){socket[_0x8c97('0x88')]('user'+_0x185eef+_0x8c97('0x98'),{'UserId':Number(_0x1019a6),[_0x185eef+'QueueId']:_0x57f89d['id']});if(_0x185eef!==_0x8c97('0x7e')){return;}return db[_0x8c97('0x8d')][_0x8c97('0x53')]({'where':{'VoiceQueueId':_0x57f89d['id'],'UserId':_0x1019a6},'transaction':_0x25d8f9});});return Promise[_0x8c97('0x92')](_0x17cbae);});});return Promise[_0x8c97('0x92')](_0x230ad4);});});return Promise[_0x8c97('0x92')](_0x1a9d2e)[_0x8c97('0x2a')](function(){return _0xcb165[_0x8c97('0x95')](_0x1ec3be,{'transaction':_0x25d8f9});})[_0x8c97('0x2a')](function(){return db['TeamVoicePrefix'][_0x8c97('0x6f')]({'where':{'teamId':_0x58a34d}})['then'](function(_0x1e06ef){if(_0x1e06ef){var _0x2792c0=_[_0x8c97('0x33')](_0x1ec3be,function(_0xabd209){db[_0x8c97('0x6c')]['destroy']({'where':{'UserId':_0xabd209,'VoicePrefixId':_0x1e06ef[_0x8c97('0x93')]}});});return Promise[_0x8c97('0x92')](_0x2792c0);}});});});}})[_0x8c97('0x2a')](respondWithStatusCode(_0x1e27da,null))[_0x8c97('0x4a')](handleError(_0x1e27da,null));};exports[_0x8c97('0x99')]=function(_0x9dc685,_0x530ff1,_0x5a0427){var _0x52ab79={};var _0x70a0cf={};var _0x3e65d3;var _0x7dd4bc;return db[_0x8c97('0x2e')]['findOne']({'where':{'id':_0x9dc685[_0x8c97('0x47')]['id']}})['then'](handleEntityNotFound(_0x530ff1,null))[_0x8c97('0x2a')](function(_0x95eabd){if(_0x95eabd){_0x3e65d3=_0x95eabd;_0x70a0cf[_0x8c97('0x32')]=_[_0x8c97('0x48')](db[_0x8c97('0x8a')][_0x8c97('0x2f')]);_0x70a0cf[_0x8c97('0x35')]=_[_0x8c97('0x48')](_0x9dc685[_0x8c97('0x35')]);_0x70a0cf[_0x8c97('0x36')]=_[_0x8c97('0x38')](_0x70a0cf['model'],_0x70a0cf[_0x8c97('0x35')]);_0x52ab79[_0x8c97('0x37')]=_[_0x8c97('0x38')](_0x70a0cf[_0x8c97('0x32')],qs[_0x8c97('0x39')](_0x9dc685[_0x8c97('0x35')]['fields']));_0x52ab79[_0x8c97('0x37')]=_0x52ab79['attributes'][_0x8c97('0x3a')]?_0x52ab79[_0x8c97('0x37')]:_0x70a0cf[_0x8c97('0x32')];_0x52ab79[_0x8c97('0x73')]=qs[_0x8c97('0x3c')](_0x9dc685['query']['sort']);_0x52ab79[_0x8c97('0x3d')]=qs[_0x8c97('0x36')](_['pick'](_0x9dc685[_0x8c97('0x35')],_0x70a0cf[_0x8c97('0x36')]));if(_0x9dc685[_0x8c97('0x35')][_0x8c97('0x3f')]){_0x52ab79[_0x8c97('0x3d')]=_['merge'](_0x52ab79[_0x8c97('0x3d')],{'$or':_[_0x8c97('0x33')](_0x52ab79['attributes'],function(_0x3e0838){var _0x1afe7a={};_0x1afe7a[_0x3e0838]={'$like':'%'+_0x9dc685[_0x8c97('0x35')]['filter']+'%'};return _0x1afe7a;})});}_0x52ab79=_['merge']({},_0x52ab79,_0x9dc685[_0x8c97('0x41')]);return _0x3e65d3[_0x8c97('0x99')](_0x52ab79);}})[_0x8c97('0x2a')](function(_0x469eac){if(_0x469eac){_0x7dd4bc=_0x469eac['length'];if(!_0x9dc685[_0x8c97('0x35')][_0x8c97('0x3b')](_0x8c97('0x9a'))){_0x52ab79[_0x8c97('0x22')]=qs[_0x8c97('0x22')](_0x9dc685[_0x8c97('0x35')]['limit']);_0x52ab79[_0x8c97('0x24')]=qs[_0x8c97('0x24')](_0x9dc685['query'][_0x8c97('0x24')]);}return _0x3e65d3[_0x8c97('0x99')](_0x52ab79);}})['then'](function(_0x37f803){if(_0x37f803){return _0x37f803?{'count':_0x7dd4bc,'rows':_0x37f803}:null;}})[_0x8c97('0x2a')](respondWithResult(_0x530ff1,null))[_0x8c97('0x4a')](handleError(_0x530ff1,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index b9a1463..a469047 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 _0x01c2=['update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x4789ba,_0x4740e8){var _0xf1ef85=function(_0x26ec0d){while(--_0x26ec0d){_0x4789ba['push'](_0x4789ba['shift']());}};_0xf1ef85(++_0x4740e8);}(_0x01c2,0x17c));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x201c('0x0'));var Team=require(_0x201c('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x201c('0x2')](0x0);var events={'afterCreate':_0x201c('0x3'),'afterUpdate':_0x201c('0x4'),'afterDestroy':_0x201c('0x5')};function emitEvent(_0x1fa209){return function(_0x123ffa,_0x3fe569,_0x8873dd){TeamEvents[_0x201c('0x6')](_0x1fa209+':'+_0x123ffa['id'],_0x123ffa);TeamEvents[_0x201c('0x6')](_0x1fa209,_0x123ffa);_0x8873dd(null);};}for(var e in events){if(events[_0x201c('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x7f9a=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5ac007,_0x30a2c8){var _0x238be9=function(_0x28ec62){while(--_0x28ec62){_0x5ac007['push'](_0x5ac007['shift']());}};_0x238be9(++_0x30a2c8);}(_0x7f9a,0x122));var _0xa7f9=function(_0x3edad9,_0x3f80f6){_0x3edad9=_0x3edad9-0x0;var _0x4d6271=_0x7f9a[_0x3edad9];return _0x4d6271;};'use strict';var EventEmitter=require(_0xa7f9('0x0'));var Team=require(_0xa7f9('0x1'))['db'][_0xa7f9('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xa7f9('0x3')](0x0);var events={'afterCreate':_0xa7f9('0x4'),'afterUpdate':_0xa7f9('0x5'),'afterDestroy':_0xa7f9('0x6')};function emitEvent(_0x2d5f11){return function(_0x2248b4,_0x154fc4,_0x348973){TeamEvents[_0xa7f9('0x7')](_0x2d5f11+':'+_0x2248b4['id'],_0x2248b4);TeamEvents[_0xa7f9('0x7')](_0x2d5f11,_0x2248b4);_0x348973(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xa7f9('0x8')](e,emitEvent(event));}}module[_0xa7f9('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 fda7080..39b0df9 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 _0xf76d=['then','map','lodash','./team.attributes','get','Queues','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Sms','Whatsapp','resolve'];(function(_0x8b6a57,_0x87143e){var _0x8ff90f=function(_0x4186a6){while(--_0x4186a6){_0x8b6a57['push'](_0x8b6a57['shift']());}};_0x8ff90f(++_0x87143e);}(_0xf76d,0xda));var _0xdf76=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0xf76d[_0x5b8685];return _0xa3ef57;};'use strict';var _=require(_0xdf76('0x0'));var attributes=require(_0xdf76('0x1'));function getQueuesByChannel(_0x14378a,_0x5b48ce){var _0x37f4c5=_0xdf76('0x2')+_0x5b48ce+_0xdf76('0x3');return _0x14378a[_0x37f4c5]()['then'](function(_0x106c35){return _['map'](_0x106c35,function(_0x530c75){_0x530c75['setDataValue'](_0xdf76('0x4'),_0x5b48ce);return _0x530c75;});})[_0xdf76('0x5')](function(_0x29bc0b){throw _0x29bc0b;});}module[_0xdf76('0x6')]=function(_0x3a2e23){return _0x3a2e23[_0xdf76('0x7')](_0xdf76('0x8'),attributes,{'tableName':_0xdf76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xaf5ba8=this;var _0x379912=[_0xdf76('0xa'),_0xdf76('0xb'),_0xdf76('0xc'),'Openchannel',_0xdf76('0xd'),'Voice',_0xdf76('0xe')];return Promise[_0xdf76('0xf')]()[_0xdf76('0x10')](function(){var _0x52dc95=_[_0xdf76('0x11')](_0x379912,function(_0x2e1610){return getQueuesByChannel(_0xaf5ba8,_0x2e1610);});return Promise['all'](_0x52dc95);})[_0xdf76('0x5')](function(_0x5b6aad){throw _0x5b6aad;});}}});}; \ No newline at end of file +var _0x5434=['Queues','then','map','setDataValue','channel','catch','exports','define','teams','Chat','Sms','Voice','Whatsapp','resolve','lodash','./team.attributes','get'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0x5434,0x1a6));var _0x4543=function(_0x511656,_0x2dc02d){_0x511656=_0x511656-0x0;var _0x2e5cfe=_0x5434[_0x511656];return _0x2e5cfe;};'use strict';var _=require(_0x4543('0x0'));var attributes=require(_0x4543('0x1'));function getQueuesByChannel(_0xb041f0,_0x477466){var _0x22c20b=_0x4543('0x2')+_0x477466+_0x4543('0x3');return _0xb041f0[_0x22c20b]()[_0x4543('0x4')](function(_0x30b85b){return _[_0x4543('0x5')](_0x30b85b,function(_0x105e4f){_0x105e4f[_0x4543('0x6')](_0x4543('0x7'),_0x477466);return _0x105e4f;});})[_0x4543('0x8')](function(_0x2b8f73){throw _0x2b8f73;});}module[_0x4543('0x9')]=function(_0x4a0739){return _0x4a0739[_0x4543('0xa')]('Team',attributes,{'tableName':_0x4543('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x16a880=this;var _0x2c81fc=[_0x4543('0xc'),'Fax','Mail','Openchannel',_0x4543('0xd'),_0x4543('0xe'),_0x4543('0xf')];return Promise[_0x4543('0x10')]()[_0x4543('0x4')](function(){var _0x5a25e8=_[_0x4543('0x5')](_0x2c81fc,function(_0x4c674f){return getQueuesByChannel(_0x16a880,_0x4c674f);});return Promise['all'](_0x5a25e8);})[_0x4543('0x8')](function(_0x20f08c){throw _0x20f08c;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 70409ca..3edf171 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 _0x5b07=['request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','localhost','redis','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x5b07,0x1b5));var _0x75b0=function(_0x2f429c,_0xbab4cc){_0x2f429c=_0x2f429c-0x0;var _0x3041c3=_0x5b07[_0x2f429c];return _0x3041c3;};'use strict';var _=require(_0x75b0('0x0'));var util=require(_0x75b0('0x1'));var moment=require(_0x75b0('0x2'));var BPromise=require(_0x75b0('0x3'));var rs=require(_0x75b0('0x4'));var fs=require('fs');var Redis=require(_0x75b0('0x5'));var db=require(_0x75b0('0x6'))['db'];var utils=require(_0x75b0('0x7'));var logger=require(_0x75b0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75b0('0x9'));var client=jayson[_0x75b0('0xa')]['http']({'port':0x232a});config['redis']=_[_0x75b0('0xb')](config['redis'],{'host':_0x75b0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75b0('0xd')]));require('./team.socket')[_0x75b0('0xe')](socket);function respondWithRpcPromise(_0x5417fc,_0x2bd5f1,_0x1c8641){return new BPromise(function(_0x193ebd,_0x3da89c){return client[_0x75b0('0xf')](_0x5417fc,_0x1c8641)[_0x75b0('0x10')](function(_0x31118a){logger[_0x75b0('0x11')](_0x75b0('0x12'),_0x2bd5f1,_0x75b0('0x13'));logger[_0x75b0('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x2bd5f1,_0x75b0('0x13'),JSON['stringify'](_0x31118a));if(_0x31118a[_0x75b0('0x15')]){if(_0x31118a[_0x75b0('0x15')][_0x75b0('0x16')]===0x1f4){logger[_0x75b0('0x15')](_0x75b0('0x12'),_0x2bd5f1,_0x31118a[_0x75b0('0x15')]['message']);return _0x3da89c(_0x31118a[_0x75b0('0x15')][_0x75b0('0x17')]);}logger['error'](_0x75b0('0x12'),_0x2bd5f1,_0x31118a['error']['message']);return _0x193ebd(_0x31118a[_0x75b0('0x15')][_0x75b0('0x17')]);}else{logger[_0x75b0('0x11')](_0x75b0('0x12'),_0x2bd5f1,'request\x20sent');_0x193ebd(_0x31118a['result'][_0x75b0('0x17')]);}})['catch'](function(_0xf620f9){logger[_0x75b0('0x15')](_0x75b0('0x12'),_0x2bd5f1,_0xf620f9);_0x3da89c(_0xf620f9);});});} \ No newline at end of file +var _0x5b3f=['register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket'];(function(_0x48c1fd,_0x55b602){var _0x3807b5=function(_0x207105){while(--_0x207105){_0x48c1fd['push'](_0x48c1fd['shift']());}};_0x3807b5(++_0x55b602);}(_0x5b3f,0x194));var _0xf5b3=function(_0x2751be,_0x132886){_0x2751be=_0x2751be-0x0;var _0xde4606=_0x5b3f[_0x2751be];return _0xde4606;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf5b3('0x0'));var rs=require(_0xf5b3('0x1'));var fs=require('fs');var Redis=require(_0xf5b3('0x2'));var db=require(_0xf5b3('0x3'))['db'];var utils=require(_0xf5b3('0x4'));var logger=require(_0xf5b3('0x5'))(_0xf5b3('0x6'));var config=require(_0xf5b3('0x7'));var jayson=require(_0xf5b3('0x8'));var client=jayson[_0xf5b3('0x9')][_0xf5b3('0xa')]({'port':0x232a});config['redis']=_[_0xf5b3('0xb')](config[_0xf5b3('0xc')],{'host':_0xf5b3('0xd'),'port':0x18eb});var socket=require(_0xf5b3('0xe'))(new Redis(config[_0xf5b3('0xc')]));require(_0xf5b3('0xf'))[_0xf5b3('0x10')](socket);function respondWithRpcPromise(_0x32024c,_0x582e0d,_0x4b52e3){return new BPromise(function(_0x1c4e2c,_0x3eebd2){return client[_0xf5b3('0x11')](_0x32024c,_0x4b52e3)[_0xf5b3('0x12')](function(_0x51f46f){logger[_0xf5b3('0x13')](_0xf5b3('0x14'),_0x582e0d,_0xf5b3('0x15'));logger[_0xf5b3('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x582e0d,'request\x20sent',JSON[_0xf5b3('0x17')](_0x51f46f));if(_0x51f46f[_0xf5b3('0x18')]){if(_0x51f46f['error'][_0xf5b3('0x19')]===0x1f4){logger[_0xf5b3('0x18')]('Team,\x20%s,\x20%s',_0x582e0d,_0x51f46f[_0xf5b3('0x18')]['message']);return _0x3eebd2(_0x51f46f[_0xf5b3('0x18')]['message']);}logger[_0xf5b3('0x18')](_0xf5b3('0x14'),_0x582e0d,_0x51f46f['error'][_0xf5b3('0x1a')]);return _0x1c4e2c(_0x51f46f['error']['message']);}else{logger[_0xf5b3('0x13')](_0xf5b3('0x14'),_0x582e0d,'request\x20sent');_0x1c4e2c(_0x51f46f['result'][_0xf5b3('0x1a')]);}})[_0xf5b3('0x1b')](function(_0x30d80e){logger[_0xf5b3('0x18')](_0xf5b3('0x14'),_0x582e0d,_0x30d80e);_0x3eebd2(_0x30d80e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 7a97347..c2af166 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 _0xb3e6=['length','./team.events','remove','update','emit','removeListener'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb3e6,0x13f));var _0x6b3e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb3e6[_0x53ccf2];return _0x5a2964;};'use strict';var TeamEvents=require(_0x6b3e('0x0'));var events=['save',_0x6b3e('0x1'),_0x6b3e('0x2')];function createListener(_0x405703,_0x119be2){return function(_0x2993f5){_0x119be2[_0x6b3e('0x3')](_0x405703,_0x2993f5);};}function removeListener(_0x30030c,_0x3c549a){return function(){TeamEvents[_0x6b3e('0x4')](_0x30030c,_0x3c549a);};}exports['register']=function(_0x184797){for(var _0x22c902=0x0,_0xe21cbe=events[_0x6b3e('0x5')];_0x22c902<_0xe21cbe;_0x22c902++){var _0x1e77b7=events[_0x22c902];var _0x5f3a2a=createListener('team:'+_0x1e77b7,_0x184797);TeamEvents['on'](_0x1e77b7,_0x5f3a2a);}}; \ No newline at end of file +var _0xa20a=['removeListener','register','length','team:','remove','update','emit'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0xa20a,0x74));var _0xaa20=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xa20a[_0x29d94e];return _0x106237;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0xaa20('0x0'),_0xaa20('0x1')];function createListener(_0x39481d,_0x1d1b40){return function(_0x5d88f1){_0x1d1b40[_0xaa20('0x2')](_0x39481d,_0x5d88f1);};}function removeListener(_0x20a8ad,_0x1497a0){return function(){TeamEvents[_0xaa20('0x3')](_0x20a8ad,_0x1497a0);};}exports[_0xaa20('0x4')]=function(_0x5ac74e){for(var _0x54ecbc=0x0,_0x413b88=events[_0xaa20('0x5')];_0x54ecbc<_0x413b88;_0x54ecbc++){var _0x23a712=events[_0x54ecbc];var _0x181df0=createListener(_0xaa20('0x6')+_0x23a712,_0x5ac74e);TeamEvents['on'](_0x23a712,_0x181df0);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 6394ce0..5d587dc 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 _0x7daf=['exports','INTEGER'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x7daf,0xaa));var _0xf7da=function(_0x28e78c,_0x1819c1){_0x28e78c=_0x28e78c-0x0;var _0x164e5c=_0x7daf[_0x28e78c];return _0x164e5c;};'use strict';var Sequelize=require('sequelize');module[_0xf7da('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf7da('0x1')]}}; \ No newline at end of file +var _0x565c=['INTEGER','sequelize','exports'];(function(_0xe89d97,_0x33e5ac){var _0x1b6e5d=function(_0x5618cb){while(--_0x5618cb){_0xe89d97['push'](_0xe89d97['shift']());}};_0x1b6e5d(++_0x33e5ac);}(_0x565c,0x73));var _0xc565=function(_0x1e4b9c,_0x12777b){_0x1e4b9c=_0x1e4b9c-0x0;var _0x413025=_0x565c[_0x1e4b9c];return _0x413025;};'use strict';var Sequelize=require(_0xc565('0x0'));module[_0xc565('0x1')]={'TeamId':{'type':Sequelize[_0xc565('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc565('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 381d454..6f68d01 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 _0xcabe=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xcabe,0x1ef));var _0xecab=function(_0x304a51,_0x3f7af1){_0x304a51=_0x304a51-0x0;var _0x516132=_0xcabe[_0x304a51];return _0x516132;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var logger=require(_0xecab('0x1'))(_0xecab('0x2'));var moment=require('moment');var BPromise=require(_0xecab('0x3'));var rp=require(_0xecab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecab('0x5'));var config=require(_0xecab('0x6'));var attributes=require(_0xecab('0x7'));module['exports']=function(_0x2ef298,_0x2ace9c){return _0x2ef298[_0xecab('0x8')](_0xecab('0x9'),attributes,{'tableName':_0xecab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd403=['team_has_voice_prefixes','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd403,0x1d5));var _0x3d40=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xd403[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x3d40('0x0'));var util=require(_0x3d40('0x1'));var logger=require(_0x3d40('0x2'))(_0x3d40('0x3'));var moment=require('moment');var BPromise=require(_0x3d40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d40('0x5'));var rimraf=require(_0x3d40('0x6'));var config=require(_0x3d40('0x7'));var attributes=require(_0x3d40('0x8'));module[_0x3d40('0x9')]=function(_0xcb5864,_0x113817){return _0xcb5864[_0x3d40('0xa')](_0x3d40('0xb'),attributes,{'tableName':_0x3d40('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 21ab69a..749f462 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x574f2c,_0x4dcff7){var _0x3d2e59=function(_0x30e993){while(--_0x30e993){_0x574f2c['push'](_0x574f2c['shift']());}};_0x3d2e59(++_0x4dcff7);}(_0x70e0,0x17b));var _0x070e=function(_0x4c1a3b,_0x200ce8){_0x4c1a3b=_0x4c1a3b-0x0;var _0xe53986=_0x70e0[_0x4c1a3b];return _0xe53986;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fb879,_0x25717c){var _0x529ab5=function(_0x2dd89a){while(--_0x2dd89a){_0x4fb879['push'](_0x4fb879['shift']());}};_0x529ab5(++_0x25717c);}(_0xe706,0xa3));var _0x6e70=function(_0x80b6a,_0x1b138c){_0x80b6a=_0x80b6a-0x0;var _0x58de9b=_0xe706[_0x80b6a];return _0x58de9b;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 7021778..40c3687 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 _0x47f4=['exports','INTEGER'];(function(_0x2cb742,_0x16184d){var _0x4e9847=function(_0x16ce9d){while(--_0x16ce9d){_0x2cb742['push'](_0x2cb742['shift']());}};_0x4e9847(++_0x16184d);}(_0x47f4,0x86));var _0x447f=function(_0x145480,_0x2a9538){_0x145480=_0x145480-0x0;var _0x39633d=_0x47f4[_0x145480];return _0x39633d;};'use strict';var Sequelize=require('sequelize');module[_0x447f('0x0')]={'penalty':{'type':Sequelize[_0x447f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f67=['INTEGER','sequelize'];(function(_0x4c0d60,_0x13e302){var _0x5b7a00=function(_0x4497e4){while(--_0x4497e4){_0x4c0d60['push'](_0x4c0d60['shift']());}};_0x5b7a00(++_0x13e302);}(_0x3f67,0x189));var _0x73f6=function(_0x343b56,_0x27ebbf){_0x343b56=_0x343b56-0x0;var _0x4bdc57=_0x3f67[_0x343b56];return _0x4bdc57;};'use strict';var Sequelize=require(_0x73f6('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x73f6('0x1')],'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 02bf90d..ab8253d 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 _0x04de=['./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x04de,0x107));var _0xe04d=function(_0x299a52,_0x305640){_0x299a52=_0x299a52-0x0;var _0x152cf8=_0x04de[_0x299a52];return _0x152cf8;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var logger=require(_0xe04d('0x2'))(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var BPromise=require(_0xe04d('0x5'));var rp=require(_0xe04d('0x6'));var fs=require('fs');var path=require(_0xe04d('0x7'));var rimraf=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var attributes=require(_0xe04d('0xa'));module['exports']=function(_0x4bb925,_0x4f7637){return _0x4bb925['define'](_0xe04d('0xb'),attributes,{'tableName':_0xe04d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9f5=['request-promise','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','moment','bluebird'];(function(_0x433268,_0x3d8f41){var _0x537028=function(_0x264a73){while(--_0x264a73){_0x433268['push'](_0x433268['shift']());}};_0x537028(++_0x3d8f41);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0xc9f5[_0x1b4002];return _0x1716f3;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var logger=require(_0x5c9f('0x1'))('api');var moment=require(_0x5c9f('0x2'));var BPromise=require(_0x5c9f('0x3'));var rp=require(_0x5c9f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c9f('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0x5c9f('0x6')]=function(_0x563d0c,_0x3100cf){return _0x563d0c[_0x5c9f('0x7')](_0x5c9f('0x8'),attributes,{'tableName':_0x5c9f('0x9'),'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 f748494..22b20ed 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 _0xea67=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2832fd,_0x1f8201){var _0x1fece1=function(_0x212e95){while(--_0x212e95){_0x2832fd['push'](_0x2832fd['shift']());}};_0x1fece1(++_0x1f8201);}(_0xea67,0x172));var _0x7ea6=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0xea67[_0x329905];return _0x3aa42;};'use strict';var _=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var moment=require(_0x7ea6('0x2'));var BPromise=require(_0x7ea6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ea6('0x4'));var db=require(_0x7ea6('0x5'))['db'];var utils=require(_0x7ea6('0x6'));var logger=require('../../config/logger')(_0x7ea6('0x7'));var config=require(_0x7ea6('0x8'));var jayson=require(_0x7ea6('0x9'));var client=jayson[_0x7ea6('0xa')][_0x7ea6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b5ce8,_0x2cc5cb,_0x14904f){return new BPromise(function(_0x3dabab,_0x59f2c9){return client[_0x7ea6('0xc')](_0x1b5ce8,_0x14904f)['then'](function(_0x383f6e){logger[_0x7ea6('0xd')](_0x7ea6('0xe'),_0x2cc5cb,_0x7ea6('0xf'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2cc5cb,_0x7ea6('0xf'),JSON[_0x7ea6('0x10')](_0x383f6e));if(_0x383f6e[_0x7ea6('0x11')]){if(_0x383f6e['error'][_0x7ea6('0x12')]===0x1f4){logger[_0x7ea6('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2cc5cb,_0x383f6e[_0x7ea6('0x11')][_0x7ea6('0x13')]);return _0x59f2c9(_0x383f6e[_0x7ea6('0x11')]['message']);}logger[_0x7ea6('0x11')](_0x7ea6('0xe'),_0x2cc5cb,_0x383f6e['error']['message']);return _0x3dabab(_0x383f6e[_0x7ea6('0x11')][_0x7ea6('0x13')]);}else{logger[_0x7ea6('0xd')](_0x7ea6('0xe'),_0x2cc5cb,_0x7ea6('0xf'));_0x3dabab(_0x383f6e[_0x7ea6('0x14')]['message']);}})[_0x7ea6('0x15')](function(_0x17f588){logger['error'](_0x7ea6('0xe'),_0x2cc5cb,_0x17f588);_0x59f2c9(_0x17f588);});});} \ No newline at end of file +var _0xc14d=['client','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19e166,_0x4cc641){var _0x5e6bed=function(_0xb7fce7){while(--_0xb7fce7){_0x19e166['push'](_0x19e166['shift']());}};_0x5e6bed(++_0x4cc641);}(_0xc14d,0x1ea));var _0xdc14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc14d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdc14('0x0'));var BPromise=require(_0xdc14('0x1'));var rs=require(_0xdc14('0x2'));var fs=require('fs');var Redis=require(_0xdc14('0x3'));var db=require(_0xdc14('0x4'))['db'];var utils=require(_0xdc14('0x5'));var logger=require(_0xdc14('0x6'))(_0xdc14('0x7'));var config=require(_0xdc14('0x8'));var jayson=require(_0xdc14('0x9'));var client=jayson[_0xdc14('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccbeb,_0x5ea03a,_0x640301){return new BPromise(function(_0x17f400,_0xeed4e1){return client['request'](_0x3ccbeb,_0x640301)[_0xdc14('0xb')](function(_0x116341){logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5ea03a,_0xdc14('0xe'),JSON[_0xdc14('0xf')](_0x116341));if(_0x116341[_0xdc14('0x10')]){if(_0x116341['error'][_0xdc14('0x11')]===0x1f4){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x116341['error'][_0xdc14('0x12')]);return _0xeed4e1(_0x116341[_0xdc14('0x10')]['message']);}logger['error'](_0xdc14('0xd'),_0x5ea03a,_0x116341['error']['message']);return _0x17f400(_0x116341[_0xdc14('0x10')]['message']);}else{logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');_0x17f400(_0x116341[_0xdc14('0x13')][_0xdc14('0x12')]);}})['catch'](function(_0x329506){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x329506);_0xeed4e1(_0x329506);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index bf83dd5..9dc36e8 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 _0x1b0e=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports'];(function(_0x4a79c2,_0x3e5e45){var _0x6385e9=function(_0x3afad2){while(--_0x3afad2){_0x4a79c2['push'](_0x4a79c2['shift']());}};_0x6385e9(++_0x3e5e45);}(_0x1b0e,0x132));var _0xe1b0=function(_0x4458c6,_0x17d62f){_0x4458c6=_0x4458c6-0x0;var _0x4e9557=_0x1b0e[_0x4458c6];return _0x4e9557;};'use strict';var multer=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var path=require(_0xe1b0('0x2'));var timeout=require(_0xe1b0('0x3'));var express=require(_0xe1b0('0x4'));var router=express[_0xe1b0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var controller=require('./template.controller');router[_0xe1b0('0x8')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xa')]);router['get'](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['show']);router[_0xe1b0('0xc')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xd')]);router[_0xe1b0('0xe')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xf')]);router[_0xe1b0('0x10')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['destroy']);module[_0xe1b0('0x11')]=router; \ No newline at end of file +var _0x553a=['../../components/interaction/service','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x84ea5a,_0x1bc71e){var _0xc54a4c=function(_0x41b9f7){while(--_0x41b9f7){_0x84ea5a['push'](_0x84ea5a['shift']());}};_0xc54a4c(++_0x1bc71e);}(_0x553a,0x192));var _0xa553=function(_0x4e2861,_0x199be0){_0x4e2861=_0x4e2861-0x0;var _0x2265e3=_0x553a[_0x4e2861];return _0x2265e3;};'use strict';var multer=require('multer');var util=require(_0xa553('0x0'));var path=require('path');var timeout=require(_0xa553('0x1'));var express=require(_0xa553('0x2'));var router=express[_0xa553('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa553('0x4'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xa553('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa553('0x5')](_0xa553('0x6'),auth[_0xa553('0x7')](),controller['show']);router[_0xa553('0x8')]('/',auth['isAuthenticated'](),controller[_0xa553('0x9')]);router[_0xa553('0xa')](_0xa553('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xa553('0xb')]('/:id',auth[_0xa553('0x7')](),controller[_0xa553('0xc')]);module[_0xa553('0xd')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index eb1bd9e..18653ba 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 _0x57dc=['STRING','TEXT'];(function(_0x1a0145,_0x4cbc1e){var _0xd3a095=function(_0xd94985){while(--_0xd94985){_0x1a0145['push'](_0x1a0145['shift']());}};_0xd3a095(++_0x4cbc1e);}(_0x57dc,0x178));var _0xc57d=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x57dc[_0x337748];return _0x3bb03f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc57d('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xc57d('0x1')]}}; \ No newline at end of file +var _0xb862=['TEXT','sequelize','exports','STRING'];(function(_0x2d4274,_0x48f20f){var _0x780eec=function(_0xd24e8f){while(--_0xd24e8f){_0x2d4274['push'](_0x2d4274['shift']());}};_0x780eec(++_0x48f20f);}(_0xb862,0xd5));var _0x2b86=function(_0x1b62b8,_0x3e78d9){_0x1b62b8=_0x1b62b8-0x0;var _0x47a5a0=_0xb862[_0x1b62b8];return _0x47a5a0;};'use strict';var Sequelize=require(_0x2b86('0x0'));module[_0x2b86('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b86('0x2')]},'html':{'type':Sequelize[_0x2b86('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 473a7a1..af8bae6 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 _0x63a5=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','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','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes'];(function(_0x54a6d3,_0x35688b){var _0x58c1d7=function(_0x129ac7){while(--_0x129ac7){_0x54a6d3['push'](_0x54a6d3['shift']());}};_0x58c1d7(++_0x35688b);}(_0x63a5,0xc4));var _0x563a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x63a5[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x563a('0x1'));var jsonpatch=require(_0x563a('0x2'));var rp=require(_0x563a('0x3'));var moment=require(_0x563a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require(_0x563a('0x8'));var csv=require(_0x563a('0x9'));var ejs=require(_0x563a('0xa'));var fs=require('fs');var fs_extra=require(_0x563a('0xb'));var _=require('lodash');var squel=require(_0x563a('0xc'));var crypto=require(_0x563a('0xd'));var jsforce=require(_0x563a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x563a('0x9'));var querystring=require('querystring');var Papa=require(_0x563a('0xf'));var Redis=require(_0x563a('0x10'));var authService=require(_0x563a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x563a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x563a('0x13'))(_0x563a('0x14'));var utils=require(_0x563a('0x15'));var config=require(_0x563a('0x16'));var licenseUtil=require(_0x563a('0x17'));var db=require(_0x563a('0x18'))['db'];function respondWithStatusCode(_0x263259,_0x43ecbc){_0x43ecbc=_0x43ecbc||0xcc;return function(_0x300f39){if(_0x300f39){return _0x263259[_0x563a('0x19')](_0x43ecbc);}return _0x263259[_0x563a('0x1a')](_0x43ecbc)['end']();};}function respondWithResult(_0x1f3e91,_0x506852){_0x506852=_0x506852||0xc8;return function(_0x54e34d){if(_0x54e34d){return _0x1f3e91['status'](_0x506852)[_0x563a('0x1b')](_0x54e34d);}};}function respondWithFilteredResult(_0x25f6ef,_0x59816f){return function(_0xeddad9){if(_0xeddad9){var _0x30f4dd=typeof _0x59816f[_0x563a('0x1c')]===_0x563a('0x1d')&&typeof _0x59816f[_0x563a('0x1e')]==='undefined';var _0x355f7f=_0xeddad9[_0x563a('0x1f')];var _0x5e93a7=_0x30f4dd?0x0:_0x59816f[_0x563a('0x1c')];var _0x276dee=_0x30f4dd?_0xeddad9['count']:_0x59816f[_0x563a('0x1c')]+_0x59816f[_0x563a('0x1e')];var _0x515066;if(_0x276dee>=_0x355f7f){_0x276dee=_0x355f7f;_0x515066=0xc8;}else{_0x515066=0xce;}_0x25f6ef[_0x563a('0x1a')](_0x515066);return _0x25f6ef['set'](_0x563a('0x20'),_0x5e93a7+'-'+_0x276dee+'/'+_0x355f7f)[_0x563a('0x1b')](_0xeddad9);}return null;};}function patchUpdates(_0x226c66){return function(_0x4d60af){try{jsonpatch[_0x563a('0x21')](_0x4d60af,_0x226c66,!![]);}catch(_0x4027cc){return BPromise[_0x563a('0x22')](_0x4027cc);}return _0x4d60af['save']();};}function saveUpdates(_0x40b5b8,_0xea8ef1){return function(_0x49bcba){if(_0x49bcba){return _0x49bcba[_0x563a('0x23')](_0x40b5b8)[_0x563a('0x24')](function(_0x552324){return _0x552324;});}return null;};}function removeEntity(_0x4f8d4b,_0x15efa5){return function(_0x3e76a8){if(_0x3e76a8){return _0x3e76a8[_0x563a('0x25')]()[_0x563a('0x24')](function(){var _0x3665e=_0x3e76a8[_0x563a('0x26')]({'plain':!![]});var _0x36970c=_0x563a('0x27');return db[_0x563a('0x28')][_0x563a('0x25')]({'where':{'type':_0x36970c,'resourceId':_0x3665e['id']}})[_0x563a('0x24')](function(){return _0x3e76a8;});})[_0x563a('0x24')](function(){_0x4f8d4b[_0x563a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ef6a,_0x3f1c58){return function(_0x962ebf){if(!_0x962ebf){_0x43ef6a[_0x563a('0x19')](0x194);}return _0x962ebf;};}function handleError(_0x9fc593,_0x49f04e){_0x49f04e=_0x49f04e||0x1f4;return function(_0x4b4a55){logger[_0x563a('0x29')](_0x4b4a55[_0x563a('0x2a')]);if(_0x4b4a55[_0x563a('0x2b')]){delete _0x4b4a55['name'];}_0x9fc593[_0x563a('0x1a')](_0x49f04e)['send'](_0x4b4a55);};}exports[_0x563a('0x2c')]=function(_0x121a71,_0x54a931){var _0x251b86={},_0x59180f={},_0x5a31a1={'count':0x0,'rows':[]};var _0x49fdb5=_[_0x563a('0x2d')](db[_0x563a('0x2e')][_0x563a('0x2f')],function(_0x20042c){return{'name':_0x20042c[_0x563a('0x30')],'type':_0x20042c[_0x563a('0x31')][_0x563a('0x32')]};});_0x59180f['model']=_[_0x563a('0x2d')](_0x49fdb5,_0x563a('0x2b'));_0x59180f[_0x563a('0x33')]=_[_0x563a('0x34')](_0x121a71[_0x563a('0x33')]);_0x59180f[_0x563a('0x35')]=_['intersection'](_0x59180f[_0x563a('0x36')],_0x59180f['query']);_0x251b86[_0x563a('0x37')]=_['intersection'](_0x59180f[_0x563a('0x36')],qs[_0x563a('0x38')](_0x121a71['query'][_0x563a('0x38')]));_0x251b86[_0x563a('0x37')]=_0x251b86[_0x563a('0x37')][_0x563a('0x39')]?_0x251b86[_0x563a('0x37')]:_0x59180f[_0x563a('0x36')];if(!_0x121a71[_0x563a('0x33')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x251b86[_0x563a('0x1e')]=qs['limit'](_0x121a71[_0x563a('0x33')][_0x563a('0x1e')]);_0x251b86[_0x563a('0x1c')]=qs[_0x563a('0x1c')](_0x121a71['query']['offset']);}_0x251b86[_0x563a('0x3c')]=qs['sort'](_0x121a71[_0x563a('0x33')][_0x563a('0x3d')]);_0x251b86[_0x563a('0x3e')]=qs[_0x563a('0x35')](_[_0x563a('0x3f')](_0x121a71[_0x563a('0x33')],_0x59180f[_0x563a('0x35')]),_0x49fdb5);if(_0x121a71[_0x563a('0x33')][_0x563a('0x40')]){_0x251b86[_0x563a('0x3e')]=_[_0x563a('0x41')](_0x251b86['where'],{'$or':_[_0x563a('0x2d')](_0x49fdb5,function(_0x10fa42){if(_0x10fa42['type']!==_0x563a('0x42')){var _0x1a18d6={};_0x1a18d6[_0x10fa42['name']]={'$like':'%'+_0x121a71['query'][_0x563a('0x40')]+'%'};return _0x1a18d6;}})});}_0x251b86=_[_0x563a('0x41')]({},_0x251b86,_0x121a71[_0x563a('0x43')]);var _0x575222={'where':_0x251b86[_0x563a('0x3e')]};return db[_0x563a('0x2e')][_0x563a('0x1f')](_0x575222)['then'](function(_0x587535){_0x5a31a1['count']=_0x587535;if(_0x121a71['query']['includeAll']){_0x251b86[_0x563a('0x44')]=[{'all':!![]}];}return db[_0x563a('0x2e')][_0x563a('0x45')](_0x251b86);})[_0x563a('0x24')](function(_0x2385d9){_0x5a31a1[_0x563a('0x46')]=_0x2385d9;return _0x5a31a1;})['then'](respondWithFilteredResult(_0x54a931,_0x251b86))[_0x563a('0x47')](handleError(_0x54a931,null));};exports[_0x563a('0x48')]=function(_0x94f189,_0x5790f8){var _0x1275e={'raw':!![],'where':{'id':_0x94f189[_0x563a('0x49')]['id']}},_0x4b1dc7={};_0x4b1dc7[_0x563a('0x36')]=_['keys'](db[_0x563a('0x2e')]['rawAttributes']);_0x4b1dc7[_0x563a('0x33')]=_[_0x563a('0x34')](_0x94f189['query']);_0x4b1dc7[_0x563a('0x35')]=_[_0x563a('0x4a')](_0x4b1dc7[_0x563a('0x36')],_0x4b1dc7[_0x563a('0x33')]);_0x1275e[_0x563a('0x37')]=_[_0x563a('0x4a')](_0x4b1dc7[_0x563a('0x36')],qs[_0x563a('0x38')](_0x94f189[_0x563a('0x33')][_0x563a('0x38')]));_0x1275e[_0x563a('0x37')]=_0x1275e['attributes'][_0x563a('0x39')]?_0x1275e[_0x563a('0x37')]:_0x4b1dc7['model'];if(_0x94f189[_0x563a('0x33')]['includeAll']){_0x1275e['include']=[{'all':!![]}];}_0x1275e=_[_0x563a('0x41')]({},_0x1275e,_0x94f189['options']);return db['Template'][_0x563a('0x4b')](_0x1275e)[_0x563a('0x24')](handleEntityNotFound(_0x5790f8,null))['then'](respondWithResult(_0x5790f8,null))[_0x563a('0x47')](handleError(_0x5790f8,null));};exports['create']=function(_0x386e52,_0x36d64c){return db[_0x563a('0x2e')][_0x563a('0x4c')](_0x386e52[_0x563a('0x4d')],{})['then'](function(_0x406b00){var _0xfc2dd3=_0x386e52[_0x563a('0x4e')][_0x563a('0x26')]({'plain':!![]});if(!_0xfc2dd3)throw new Error(_0x563a('0x4f'));if(_0xfc2dd3[_0x563a('0x50')]===_0x563a('0x4e')){var _0x4a70f0=_0x406b00[_0x563a('0x26')]({'plain':!![]});var _0xa498ee='Templates';return db[_0x563a('0x51')][_0x563a('0x4b')]({'where':{'name':_0xa498ee,'userProfileId':_0xfc2dd3[_0x563a('0x52')]},'raw':!![]})[_0x563a('0x24')](function(_0x40dde0){if(_0x40dde0&&_0x40dde0['autoAssociation']===0x0){return db[_0x563a('0x28')][_0x563a('0x4c')]({'name':_0x4a70f0[_0x563a('0x2b')],'resourceId':_0x4a70f0['id'],'type':_0x40dde0[_0x563a('0x2b')],'sectionId':_0x40dde0['id']},{})[_0x563a('0x24')](function(){return _0x406b00;});}else{return _0x406b00;}})[_0x563a('0x47')](function(_0x382d40){logger[_0x563a('0x29')](_0x563a('0x53'),_0x382d40);throw _0x382d40;});}return _0x406b00;})[_0x563a('0x24')](respondWithResult(_0x36d64c,0xc9))[_0x563a('0x47')](handleError(_0x36d64c,null));};exports['update']=function(_0xb08470,_0x2e4161){if(_0xb08470[_0x563a('0x4d')]['id']){delete _0xb08470[_0x563a('0x4d')]['id'];}return db[_0x563a('0x2e')]['find']({'where':{'id':_0xb08470[_0x563a('0x49')]['id']}})[_0x563a('0x24')](handleEntityNotFound(_0x2e4161,null))[_0x563a('0x24')](saveUpdates(_0xb08470[_0x563a('0x4d')],null))[_0x563a('0x24')](respondWithResult(_0x2e4161,null))[_0x563a('0x47')](handleError(_0x2e4161,null));};exports[_0x563a('0x25')]=function(_0x582b79,_0x2e65a5){return db[_0x563a('0x2e')][_0x563a('0x4b')]({'where':{'id':_0x582b79[_0x563a('0x49')]['id']}})[_0x563a('0x24')](handleEntityNotFound(_0x2e65a5,null))[_0x563a('0x24')](removeEntity(_0x2e65a5,null))[_0x563a('0x47')](handleError(_0x2e65a5,null));}; \ No newline at end of file +var _0x9c70=['fields','length','model','hasOwnProperty','sort','where','pick','filter','merge','type','options','Template','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','get','Templates','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','attributes'];(function(_0x216518,_0x423df0){var _0x1baeda=function(_0x248f35){while(--_0x248f35){_0x216518['push'](_0x216518['shift']());}};_0x1baeda(++_0x423df0);}(_0x9c70,0x6c));var _0x09c7=function(_0x4452cb,_0x61bc73){_0x4452cb=_0x4452cb-0x0;var _0x5b429b=_0x9c70[_0x4452cb];return _0x5b429b;};'use strict';var emlformat=require(_0x09c7('0x0'));var rimraf=require(_0x09c7('0x1'));var zipdir=require(_0x09c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09c7('0x3'));var moment=require(_0x09c7('0x4'));var BPromise=require(_0x09c7('0x5'));var Mustache=require(_0x09c7('0x6'));var util=require(_0x09c7('0x7'));var path=require(_0x09c7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x09c7('0x9'));var fs=require('fs');var fs_extra=require(_0x09c7('0xa'));var _=require(_0x09c7('0xb'));var squel=require(_0x09c7('0xc'));var crypto=require(_0x09c7('0xd'));var jsforce=require(_0x09c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x09c7('0xf'));var querystring=require(_0x09c7('0x10'));var Papa=require(_0x09c7('0x11'));var Redis=require(_0x09c7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x09c7('0x13'));var as=require(_0x09c7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x09c7('0x15'));var utils=require(_0x09c7('0x16'));var config=require(_0x09c7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x09c7('0x18'))['db'];function respondWithStatusCode(_0x132e01,_0x24d789){_0x24d789=_0x24d789||0xcc;return function(_0x5aa81a){if(_0x5aa81a){return _0x132e01['sendStatus'](_0x24d789);}return _0x132e01['status'](_0x24d789)[_0x09c7('0x19')]();};}function respondWithResult(_0x3a2b31,_0x308129){_0x308129=_0x308129||0xc8;return function(_0x5e203d){if(_0x5e203d){return _0x3a2b31[_0x09c7('0x1a')](_0x308129)['json'](_0x5e203d);}};}function respondWithFilteredResult(_0x264830,_0x4bb0ed){return function(_0x1a4495){if(_0x1a4495){var _0x1216c5=typeof _0x4bb0ed['offset']===_0x09c7('0x1b')&&typeof _0x4bb0ed[_0x09c7('0x1c')]===_0x09c7('0x1b');var _0x4068a9=_0x1a4495['count'];var _0x21d18f=_0x1216c5?0x0:_0x4bb0ed[_0x09c7('0x1d')];var _0x570c09=_0x1216c5?_0x1a4495[_0x09c7('0x1e')]:_0x4bb0ed[_0x09c7('0x1d')]+_0x4bb0ed[_0x09c7('0x1c')];var _0x187bd7;if(_0x570c09>=_0x4068a9){_0x570c09=_0x4068a9;_0x187bd7=0xc8;}else{_0x187bd7=0xce;}_0x264830['status'](_0x187bd7);return _0x264830[_0x09c7('0x1f')](_0x09c7('0x20'),_0x21d18f+'-'+_0x570c09+'/'+_0x4068a9)[_0x09c7('0x21')](_0x1a4495);}return null;};}function patchUpdates(_0x3114e0){return function(_0x31c31a){try{jsonpatch[_0x09c7('0x22')](_0x31c31a,_0x3114e0,!![]);}catch(_0x18c14a){return BPromise[_0x09c7('0x23')](_0x18c14a);}return _0x31c31a[_0x09c7('0x24')]();};}function saveUpdates(_0xb4bdcf,_0x1a1569){return function(_0x4bd8d0){if(_0x4bd8d0){return _0x4bd8d0[_0x09c7('0x25')](_0xb4bdcf)[_0x09c7('0x26')](function(_0x3be7db){return _0x3be7db;});}return null;};}function removeEntity(_0x12d0f9,_0x485a41){return function(_0x52db61){if(_0x52db61){return _0x52db61['destroy']()[_0x09c7('0x26')](function(){var _0x2949b7=_0x52db61[_0x09c7('0x27')]({'plain':!![]});var _0x1613c9=_0x09c7('0x28');return db[_0x09c7('0x29')][_0x09c7('0x2a')]({'where':{'type':_0x1613c9,'resourceId':_0x2949b7['id']}})[_0x09c7('0x26')](function(){return _0x52db61;});})[_0x09c7('0x26')](function(){_0x12d0f9['status'](0xcc)[_0x09c7('0x19')]();});}};}function handleEntityNotFound(_0x1eaf53,_0x18b489){return function(_0x724593){if(!_0x724593){_0x1eaf53[_0x09c7('0x2b')](0x194);}return _0x724593;};}function handleError(_0xf8d97e,_0x3fc383){_0x3fc383=_0x3fc383||0x1f4;return function(_0x304603){logger['error'](_0x304603[_0x09c7('0x2c')]);if(_0x304603[_0x09c7('0x2d')]){delete _0x304603[_0x09c7('0x2d')];}_0xf8d97e[_0x09c7('0x1a')](_0x3fc383)[_0x09c7('0x2e')](_0x304603);};}exports[_0x09c7('0x2f')]=function(_0x16a857,_0x22d38d){var _0x516279={},_0x248140={},_0x5b05af={'count':0x0,'rows':[]};var _0x534f5b=_[_0x09c7('0x30')](db['Template']['rawAttributes'],function(_0x3e3025){return{'name':_0x3e3025[_0x09c7('0x31')],'type':_0x3e3025['type'][_0x09c7('0x32')]};});_0x248140['model']=_[_0x09c7('0x30')](_0x534f5b,'name');_0x248140[_0x09c7('0x33')]=_[_0x09c7('0x34')](_0x16a857['query']);_0x248140[_0x09c7('0x35')]=_[_0x09c7('0x36')](_0x248140['model'],_0x248140['query']);_0x516279[_0x09c7('0x37')]=_['intersection'](_0x248140['model'],qs[_0x09c7('0x38')](_0x16a857['query'][_0x09c7('0x38')]));_0x516279[_0x09c7('0x37')]=_0x516279['attributes'][_0x09c7('0x39')]?_0x516279[_0x09c7('0x37')]:_0x248140[_0x09c7('0x3a')];if(!_0x16a857['query'][_0x09c7('0x3b')]('nolimit')){_0x516279[_0x09c7('0x1c')]=qs[_0x09c7('0x1c')](_0x16a857[_0x09c7('0x33')]['limit']);_0x516279['offset']=qs['offset'](_0x16a857['query'][_0x09c7('0x1d')]);}_0x516279['order']=qs[_0x09c7('0x3c')](_0x16a857['query'][_0x09c7('0x3c')]);_0x516279[_0x09c7('0x3d')]=qs['filters'](_[_0x09c7('0x3e')](_0x16a857[_0x09c7('0x33')],_0x248140[_0x09c7('0x35')]),_0x534f5b);if(_0x16a857[_0x09c7('0x33')][_0x09c7('0x3f')]){_0x516279[_0x09c7('0x3d')]=_[_0x09c7('0x40')](_0x516279[_0x09c7('0x3d')],{'$or':_[_0x09c7('0x30')](_0x534f5b,function(_0x4b578f){if(_0x4b578f[_0x09c7('0x41')]!=='VIRTUAL'){var _0x2d06c9={};_0x2d06c9[_0x4b578f[_0x09c7('0x2d')]]={'$like':'%'+_0x16a857[_0x09c7('0x33')][_0x09c7('0x3f')]+'%'};return _0x2d06c9;}})});}_0x516279=_['merge']({},_0x516279,_0x16a857[_0x09c7('0x42')]);var _0x4ec25e={'where':_0x516279[_0x09c7('0x3d')]};return db[_0x09c7('0x43')][_0x09c7('0x1e')](_0x4ec25e)[_0x09c7('0x26')](function(_0x1e813f){_0x5b05af[_0x09c7('0x1e')]=_0x1e813f;if(_0x16a857[_0x09c7('0x33')]['includeAll']){_0x516279[_0x09c7('0x44')]=[{'all':!![]}];}return db[_0x09c7('0x43')][_0x09c7('0x45')](_0x516279);})[_0x09c7('0x26')](function(_0x3b71a0){_0x5b05af['rows']=_0x3b71a0;return _0x5b05af;})[_0x09c7('0x26')](respondWithFilteredResult(_0x22d38d,_0x516279))[_0x09c7('0x46')](handleError(_0x22d38d,null));};exports[_0x09c7('0x47')]=function(_0x21fd54,_0x37cc9a){var _0x4eae77={'raw':!![],'where':{'id':_0x21fd54[_0x09c7('0x48')]['id']}},_0x26f3e4={};_0x26f3e4[_0x09c7('0x3a')]=_['keys'](db[_0x09c7('0x43')]['rawAttributes']);_0x26f3e4[_0x09c7('0x33')]=_[_0x09c7('0x34')](_0x21fd54['query']);_0x26f3e4[_0x09c7('0x35')]=_[_0x09c7('0x36')](_0x26f3e4[_0x09c7('0x3a')],_0x26f3e4[_0x09c7('0x33')]);_0x4eae77[_0x09c7('0x37')]=_[_0x09c7('0x36')](_0x26f3e4[_0x09c7('0x3a')],qs[_0x09c7('0x38')](_0x21fd54[_0x09c7('0x33')][_0x09c7('0x38')]));_0x4eae77[_0x09c7('0x37')]=_0x4eae77[_0x09c7('0x37')]['length']?_0x4eae77['attributes']:_0x26f3e4[_0x09c7('0x3a')];if(_0x21fd54[_0x09c7('0x33')]['includeAll']){_0x4eae77[_0x09c7('0x44')]=[{'all':!![]}];}_0x4eae77=_[_0x09c7('0x40')]({},_0x4eae77,_0x21fd54[_0x09c7('0x42')]);return db[_0x09c7('0x43')][_0x09c7('0x49')](_0x4eae77)['then'](handleEntityNotFound(_0x37cc9a,null))['then'](respondWithResult(_0x37cc9a,null))['catch'](handleError(_0x37cc9a,null));};exports[_0x09c7('0x4a')]=function(_0x4628e8,_0x5b5bf2){return db[_0x09c7('0x43')]['create'](_0x4628e8[_0x09c7('0x4b')],{})[_0x09c7('0x26')](function(_0x2ea8b7){var _0x48c8c2=_0x4628e8['user']['get']({'plain':!![]});if(!_0x48c8c2)throw new Error(_0x09c7('0x4c'));if(_0x48c8c2[_0x09c7('0x4d')]===_0x09c7('0x4e')){var _0x3644ea=_0x2ea8b7['get']({'plain':!![]});var _0x17fa91=_0x09c7('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x17fa91,'userProfileId':_0x48c8c2[_0x09c7('0x4f')]},'raw':!![]})[_0x09c7('0x26')](function(_0x3c3ddc){if(_0x3c3ddc&&_0x3c3ddc[_0x09c7('0x50')]===0x0){return db['UserProfileResource'][_0x09c7('0x4a')]({'name':_0x3644ea[_0x09c7('0x2d')],'resourceId':_0x3644ea['id'],'type':_0x3c3ddc['name'],'sectionId':_0x3c3ddc['id']},{})['then'](function(){return _0x2ea8b7;});}else{return _0x2ea8b7;}})[_0x09c7('0x46')](function(_0x3f37ce){logger['error'](_0x09c7('0x51'),_0x3f37ce);throw _0x3f37ce;});}return _0x2ea8b7;})['then'](respondWithResult(_0x5b5bf2,0xc9))[_0x09c7('0x46')](handleError(_0x5b5bf2,null));};exports['update']=function(_0x899c06,_0x5ef15f){if(_0x899c06[_0x09c7('0x4b')]['id']){delete _0x899c06[_0x09c7('0x4b')]['id'];}return db[_0x09c7('0x43')][_0x09c7('0x49')]({'where':{'id':_0x899c06['params']['id']}})[_0x09c7('0x26')](handleEntityNotFound(_0x5ef15f,null))['then'](saveUpdates(_0x899c06[_0x09c7('0x4b')],null))[_0x09c7('0x26')](respondWithResult(_0x5ef15f,null))[_0x09c7('0x46')](handleError(_0x5ef15f,null));};exports[_0x09c7('0x2a')]=function(_0x31d4fa,_0x8901bc){return db[_0x09c7('0x43')]['find']({'where':{'id':_0x31d4fa[_0x09c7('0x48')]['id']}})['then'](handleEntityNotFound(_0x8901bc,null))[_0x09c7('0x26')](removeEntity(_0x8901bc,null))[_0x09c7('0x46')](handleError(_0x8901bc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 9a4da9d..82b8d67 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 _0x1d2c=['./template.attributes','exports','define','Template','tools_templates','../../config/logger','bluebird','request-promise','rimraf'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1d2c,0x137));var _0xc1d2=function(_0x501021,_0x4837e5){_0x501021=_0x501021-0x0;var _0x14695f=_0x1d2c[_0x501021];return _0x14695f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1d2('0x0'))('api');var moment=require('moment');var BPromise=require(_0xc1d2('0x1'));var rp=require(_0xc1d2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d2('0x3'));var config=require('../../config/environment');var attributes=require(_0xc1d2('0x4'));module[_0xc1d2('0x5')]=function(_0x523a88,_0x1d74e5){return _0x523a88[_0xc1d2('0x6')](_0xc1d2('0x7'),attributes,{'tableName':_0xc1d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x583d=['path','rimraf','./template.attributes','exports','define','../../config/logger','api','moment','request-promise'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0x583d,0x164));var _0xd583=function(_0x1082b1,_0x25400d){_0x1082b1=_0x1082b1-0x0;var _0x1bd9ea=_0x583d[_0x1082b1];return _0x1bd9ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd583('0x0'))(_0xd583('0x1'));var moment=require(_0xd583('0x2'));var BPromise=require('bluebird');var rp=require(_0xd583('0x3'));var fs=require('fs');var path=require(_0xd583('0x4'));var rimraf=require(_0xd583('0x5'));var config=require('../../config/environment');var attributes=require(_0xd583('0x6'));module[_0xd583('0x7')]=function(_0x1f0539,_0x1cdef6){return _0x1f0539[_0xd583('0x8')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 6fe730e..7076bcc 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 _0xd982=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','map','attributes','GetTemplate','lodash','util','bluebird'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0xd982,0x19d));var _0x2d98=function(_0x5d5ad9,_0x9fe65c){_0x5d5ad9=_0x5d5ad9-0x0;var _0x461f64=_0xd982[_0x5d5ad9];return _0x461f64;};'use strict';var _=require(_0x2d98('0x0'));var util=require(_0x2d98('0x1'));var moment=require('moment');var BPromise=require(_0x2d98('0x2'));var rs=require(_0x2d98('0x3'));var fs=require('fs');var Redis=require(_0x2d98('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d98('0x5'));var config=require(_0x2d98('0x6'));var jayson=require(_0x2d98('0x7'));var client=jayson[_0x2d98('0x8')][_0x2d98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2927bf,_0x571dd3,_0x4b5701){return new BPromise(function(_0x288d5d,_0x126fdd){return client[_0x2d98('0xa')](_0x2927bf,_0x4b5701)[_0x2d98('0xb')](function(_0x222372){logger[_0x2d98('0xc')](_0x2d98('0xd'),_0x571dd3,_0x2d98('0xe'));logger[_0x2d98('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x571dd3,_0x2d98('0xe'),JSON[_0x2d98('0x10')](_0x222372));if(_0x222372[_0x2d98('0x11')]){if(_0x222372['error'][_0x2d98('0x12')]===0x1f4){logger['error'](_0x2d98('0xd'),_0x571dd3,_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);return _0x126fdd(_0x222372['error'][_0x2d98('0x13')]);}logger[_0x2d98('0x11')](_0x2d98('0xd'),_0x571dd3,_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);return _0x288d5d(_0x222372[_0x2d98('0x11')][_0x2d98('0x13')]);}else{logger[_0x2d98('0xc')](_0x2d98('0xd'),_0x571dd3,_0x2d98('0xe'));_0x288d5d(_0x222372[_0x2d98('0x14')][_0x2d98('0x13')]);}})[_0x2d98('0x15')](function(_0x566545){logger[_0x2d98('0x11')](_0x2d98('0xd'),_0x571dd3,_0x566545);_0x126fdd(_0x566545);});});}exports['GetTemplate']=function(_0x4a1069){var _0x2f77e4=this;return new Promise(function(_0x15e3ad,_0x2eb7ad){return db['Template'][_0x2d98('0x16')]({'raw':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x18')]===undefined?!![]:![]:!![],'where':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x19')]||null:null,'attributes':_0x4a1069[_0x2d98('0x17')]?_0x4a1069[_0x2d98('0x17')]['attributes']||null:null,'limit':_0x4a1069[_0x2d98('0x17')]?_0x4a1069['options'][_0x2d98('0x1a')]||null:null,'include':_0x4a1069['options']?_0x4a1069[_0x2d98('0x17')][_0x2d98('0x1b')]?_['map'](_0x4a1069[_0x2d98('0x17')][_0x2d98('0x1b')],function(_0x968da4){return{'model':db[_0x968da4[_0x2d98('0x1c')]],'as':_0x968da4['as'],'attributes':_0x968da4['attributes'],'include':_0x968da4[_0x2d98('0x1b')]?_[_0x2d98('0x1d')](_0x968da4['include'],function(_0x302815){return{'model':db[_0x302815[_0x2d98('0x1c')]],'as':_0x302815['as'],'attributes':_0x302815[_0x2d98('0x1e')],'include':_0x302815[_0x2d98('0x1b')]?_['map'](_0x302815[_0x2d98('0x1b')],function(_0x531d47){return{'model':db[_0x531d47[_0x2d98('0x1c')]],'as':_0x531d47['as'],'attributes':_0x531d47[_0x2d98('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2d98('0xb')](function(_0x36e5a5){logger['info'](_0x2d98('0x1f'),_0x4a1069);logger[_0x2d98('0xf')](_0x2d98('0x1f'),_0x4a1069,JSON['stringify'](_0x36e5a5));_0x15e3ad(_0x36e5a5);})['catch'](function(_0x17fcb1){logger[_0x2d98('0x11')](_0x2d98('0x1f'),_0x17fcb1[_0x2d98('0x13')],_0x4a1069);_0x2eb7ad(_0x2f77e4[_0x2d98('0x11')](0x1f4,_0x17fcb1[_0x2d98('0x13')]));});});}; \ No newline at end of file +var _0x390a=['where','attributes','limit','include','map','model','debug','GetTemplate','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','result','Template','findAll','options','raw'];(function(_0x33ed1e,_0x32aab1){var _0x36a9da=function(_0xacd1b0){while(--_0xacd1b0){_0x33ed1e['push'](_0x33ed1e['shift']());}};_0x36a9da(++_0x32aab1);}(_0x390a,0xbe));var _0xa390=function(_0x50ee3d,_0x336f4e){_0x50ee3d=_0x50ee3d-0x0;var _0x58c007=_0x390a[_0x50ee3d];return _0x58c007;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require(_0xa390('0x4'));var fs=require('fs');var Redis=require(_0xa390('0x5'));var db=require(_0xa390('0x6'))['db'];var utils=require(_0xa390('0x7'));var logger=require(_0xa390('0x8'))(_0xa390('0x9'));var config=require(_0xa390('0xa'));var jayson=require(_0xa390('0xb'));var client=jayson[_0xa390('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212916,_0x940df7,_0x55a074){return new BPromise(function(_0x3783bf,_0x4d6ed7){return client['request'](_0x212916,_0x55a074)[_0xa390('0xd')](function(_0x21e05b){logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));logger['debug'](_0xa390('0x11'),_0x940df7,_0xa390('0x10'),JSON['stringify'](_0x21e05b));if(_0x21e05b[_0xa390('0x12')]){if(_0x21e05b[_0xa390('0x12')][_0xa390('0x13')]===0x1f4){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x21e05b[_0xa390('0x12')]['message']);return _0x4d6ed7(_0x21e05b[_0xa390('0x12')][_0xa390('0x14')]);}logger[_0xa390('0x12')]('Template,\x20%s,\x20%s',_0x940df7,_0x21e05b['error'][_0xa390('0x14')]);return _0x3783bf(_0x21e05b['error'][_0xa390('0x14')]);}else{logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));_0x3783bf(_0x21e05b[_0xa390('0x15')]['message']);}})['catch'](function(_0x5b1998){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x5b1998);_0x4d6ed7(_0x5b1998);});});}exports['GetTemplate']=function(_0x30e6ef){var _0x15e501=this;return new Promise(function(_0x23ee60,_0x4cc207){return db[_0xa390('0x16')][_0xa390('0x17')]({'raw':_0x30e6ef[_0xa390('0x18')]?_0x30e6ef[_0xa390('0x18')][_0xa390('0x19')]===undefined?!![]:![]:!![],'where':_0x30e6ef[_0xa390('0x18')]?_0x30e6ef['options'][_0xa390('0x1a')]||null:null,'attributes':_0x30e6ef['options']?_0x30e6ef[_0xa390('0x18')][_0xa390('0x1b')]||null:null,'limit':_0x30e6ef['options']?_0x30e6ef[_0xa390('0x18')][_0xa390('0x1c')]||null:null,'include':_0x30e6ef['options']?_0x30e6ef[_0xa390('0x18')][_0xa390('0x1d')]?_[_0xa390('0x1e')](_0x30e6ef['options'][_0xa390('0x1d')],function(_0x1c2c8f){return{'model':db[_0x1c2c8f[_0xa390('0x1f')]],'as':_0x1c2c8f['as'],'attributes':_0x1c2c8f[_0xa390('0x1b')],'include':_0x1c2c8f[_0xa390('0x1d')]?_[_0xa390('0x1e')](_0x1c2c8f[_0xa390('0x1d')],function(_0x3b8ba0){return{'model':db[_0x3b8ba0['model']],'as':_0x3b8ba0['as'],'attributes':_0x3b8ba0['attributes'],'include':_0x3b8ba0[_0xa390('0x1d')]?_['map'](_0x3b8ba0['include'],function(_0x19f161){return{'model':db[_0x19f161[_0xa390('0x1f')]],'as':_0x19f161['as'],'attributes':_0x19f161[_0xa390('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa390('0xd')](function(_0x23e053){logger[_0xa390('0xe')]('GetTemplate',_0x30e6ef);logger[_0xa390('0x20')](_0xa390('0x21'),_0x30e6ef,JSON[_0xa390('0x22')](_0x23e053));_0x23ee60(_0x23e053);})[_0xa390('0x23')](function(_0x1bd869){logger[_0xa390('0x12')](_0xa390('0x21'),_0x1bd869['message'],_0x30e6ef);_0x4cc207(_0x15e501[_0xa390('0x12')](0x1f4,_0x1bd869[_0xa390('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0ce868a..6c6f644 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 _0x7348=['/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAction','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','get','/:id','getAllConditions'];(function(_0xe8789a,_0x2d8230){var _0x5b83a6=function(_0x28b93e){while(--_0x28b93e){_0xe8789a['push'](_0xe8789a['shift']());}};_0x5b83a6(++_0x2d8230);}(_0x7348,0x16b));var _0x8734=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7348[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x8734('0x0'));var path=require(_0x8734('0x1'));var timeout=require('connect-timeout');var express=require(_0x8734('0x2'));var router=express[_0x8734('0x3')]();var fs_extra=require(_0x8734('0x4'));var auth=require(_0x8734('0x5'));var interaction=require(_0x8734('0x6'));var config=require('../../config/environment');var controller=require(_0x8734('0x7'));router['get']('/',auth[_0x8734('0x8')](),controller['index']);router[_0x8734('0x9')](_0x8734('0xa'),auth[_0x8734('0x8')](),controller['show']);router[_0x8734('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x8734('0xb')]);router['get'](_0x8734('0xc'),auth['isAuthenticated'](),controller[_0x8734('0xd')]);router[_0x8734('0x9')](_0x8734('0xe'),auth[_0x8734('0x8')](),controller['getActions']);router[_0x8734('0xf')]('/',auth[_0x8734('0x8')](),controller[_0x8734('0x10')]);router[_0x8734('0xf')](_0x8734('0x11'),auth[_0x8734('0x8')](),controller[_0x8734('0x12')]);router['post'](_0x8734('0xc'),auth['isAuthenticated'](),controller['addAnyCondition']);router['post'](_0x8734('0xe'),auth[_0x8734('0x8')](),controller[_0x8734('0x13')]);router[_0x8734('0x14')](_0x8734('0xa'),auth['isAuthenticated'](),controller[_0x8734('0x15')]);router[_0x8734('0x16')]('/:id',auth[_0x8734('0x8')](),controller[_0x8734('0x17')]);module[_0x8734('0x18')]=router; \ No newline at end of file +var _0x020c=['addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','index','get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','post','addAllCondition'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x020c,0xf8));var _0xc020=function(_0x2d0d56,_0x63ace1){_0x2d0d56=_0x2d0d56-0x0;var _0x5d2f56=_0x020c[_0x2d0d56];return _0x5d2f56;};'use strict';var multer=require(_0xc020('0x0'));var util=require(_0xc020('0x1'));var path=require(_0xc020('0x2'));var timeout=require(_0xc020('0x3'));var express=require(_0xc020('0x4'));var router=express[_0xc020('0x5')]();var fs_extra=require(_0xc020('0x6'));var auth=require(_0xc020('0x7'));var interaction=require(_0xc020('0x8'));var config=require(_0xc020('0x9'));var controller=require(_0xc020('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc020('0xb')]);router[_0xc020('0xc')](_0xc020('0xd'),auth[_0xc020('0xe')](),controller[_0xc020('0xf')]);router[_0xc020('0xc')](_0xc020('0x10'),auth['isAuthenticated'](),controller[_0xc020('0x11')]);router[_0xc020('0xc')](_0xc020('0x12'),auth[_0xc020('0xe')](),controller['getAnyConditions']);router[_0xc020('0xc')](_0xc020('0x13'),auth[_0xc020('0xe')](),controller['getActions']);router[_0xc020('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc020('0x10'),auth[_0xc020('0xe')](),controller[_0xc020('0x15')]);router[_0xc020('0x14')](_0xc020('0x12'),auth[_0xc020('0xe')](),controller['addAnyCondition']);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xc020('0x16')]);router[_0xc020('0x17')](_0xc020('0xd'),auth[_0xc020('0xe')](),controller['update']);router[_0xc020('0x18')](_0xc020('0xd'),auth[_0xc020('0xe')](),controller[_0xc020('0x19')]);module[_0xc020('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 07d4f80..7f0db0f 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 _0x03d5=['sequelize','exports','STRING'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x03d5,0xde));var _0x503d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x503d('0x0'));module[_0x503d('0x1')]={'name':{'type':Sequelize[_0x503d('0x2')]},'channel':{'type':Sequelize[_0x503d('0x2')]},'description':{'type':Sequelize[_0x503d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8f43=['BOOLEAN','sequelize','STRING'];(function(_0x56a482,_0x13b215){var _0x4159b1=function(_0x5cde4e){while(--_0x5cde4e){_0x56a482['push'](_0x56a482['shift']());}};_0x4159b1(++_0x13b215);}(_0x8f43,0x7f));var _0x38f4=function(_0x131386,_0x23b8b9){_0x131386=_0x131386-0x0;var _0x4f5607=_0x8f43[_0x131386];return _0x4f5607;};'use strict';var Sequelize=require(_0x38f4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x38f4('0x1')]},'description':{'type':Sequelize[_0x38f4('0x1')]},'status':{'type':Sequelize[_0x38f4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4d1373c..e0481c7 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 _0xb141=['rawAttributes','order','pick','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','merge','filter','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne'];(function(_0x360cf4,_0x5913d6){var _0x5176c4=function(_0x3e4849){while(--_0x3e4849){_0x360cf4['push'](_0x360cf4['shift']());}};_0x5176c4(++_0x5913d6);}(_0xb141,0x18e));var _0x1b14=function(_0x580831,_0x5e8653){_0x580831=_0x580831-0x0;var _0x111222=_0xb141[_0x580831];return _0x111222;};'use strict';var emlformat=require(_0x1b14('0x0'));var rimraf=require(_0x1b14('0x1'));var zipdir=require(_0x1b14('0x2'));var jsonpatch=require(_0x1b14('0x3'));var rp=require(_0x1b14('0x4'));var moment=require(_0x1b14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b14('0x6'));var util=require(_0x1b14('0x7'));var path=require('path');var sox=require(_0x1b14('0x8'));var csv=require(_0x1b14('0x9'));var ejs=require(_0x1b14('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b14('0xb'));var squel=require(_0x1b14('0xc'));var crypto=require('crypto');var jsforce=require(_0x1b14('0xd'));var deskjs=require(_0x1b14('0xe'));var toCsv=require(_0x1b14('0x9'));var querystring=require(_0x1b14('0xf'));var Papa=require(_0x1b14('0x10'));var Redis=require(_0x1b14('0x11'));var authService=require(_0x1b14('0x12'));var qs=require(_0x1b14('0x13'));var as=require(_0x1b14('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b14('0x15'))('api');var utils=require(_0x1b14('0x16'));var config=require(_0x1b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b14('0x18'))['db'];function respondWithStatusCode(_0x9236a3,_0x59e946){_0x59e946=_0x59e946||0xcc;return function(_0x376cb1){if(_0x376cb1){return _0x9236a3[_0x1b14('0x19')](_0x59e946);}return _0x9236a3[_0x1b14('0x1a')](_0x59e946)[_0x1b14('0x1b')]();};}function respondWithResult(_0x1998ae,_0x424da){_0x424da=_0x424da||0xc8;return function(_0x427c77){if(_0x427c77){return _0x1998ae[_0x1b14('0x1a')](_0x424da)['json'](_0x427c77);}};}function respondWithFilteredResult(_0x4b7524,_0x14080e){return function(_0x209193){if(_0x209193){var _0x367154=typeof _0x14080e[_0x1b14('0x1c')]===_0x1b14('0x1d')&&typeof _0x14080e[_0x1b14('0x1e')]===_0x1b14('0x1d');var _0x3e7a00=_0x209193[_0x1b14('0x1f')];var _0x118979=_0x367154?0x0:_0x14080e[_0x1b14('0x1c')];var _0x5b2908=_0x367154?_0x209193[_0x1b14('0x1f')]:_0x14080e[_0x1b14('0x1c')]+_0x14080e[_0x1b14('0x1e')];var _0x4673eb;if(_0x5b2908>=_0x3e7a00){_0x5b2908=_0x3e7a00;_0x4673eb=0xc8;}else{_0x4673eb=0xce;}_0x4b7524[_0x1b14('0x1a')](_0x4673eb);return _0x4b7524[_0x1b14('0x20')](_0x1b14('0x21'),_0x118979+'-'+_0x5b2908+'/'+_0x3e7a00)[_0x1b14('0x22')](_0x209193);}return null;};}function patchUpdates(_0x4e9607){return function(_0x211b18){try{jsonpatch[_0x1b14('0x23')](_0x211b18,_0x4e9607,!![]);}catch(_0x55d242){return BPromise[_0x1b14('0x24')](_0x55d242);}return _0x211b18[_0x1b14('0x25')]();};}function saveUpdates(_0x398de0,_0x249d55){return function(_0xee66e7){if(_0xee66e7){return _0xee66e7[_0x1b14('0x26')](_0x398de0)[_0x1b14('0x27')](function(_0x57adf){return _0x57adf;});}return null;};}function removeEntity(_0x5e4865,_0x484b01){return function(_0x4b8728){if(_0x4b8728){return _0x4b8728['destroy']()[_0x1b14('0x27')](function(){var _0x3b1a6c=_0x4b8728[_0x1b14('0x28')]({'plain':!![]});var _0x19e112=_0x1b14('0x29');return db[_0x1b14('0x2a')][_0x1b14('0x2b')]({'where':{'type':_0x19e112,'resourceId':_0x3b1a6c['id']}})['then'](function(){return _0x4b8728;});})[_0x1b14('0x27')](function(){_0x5e4865[_0x1b14('0x1a')](0xcc)[_0x1b14('0x1b')]();});}};}function handleEntityNotFound(_0x533064,_0x564d3d){return function(_0x37c607){if(!_0x37c607){_0x533064[_0x1b14('0x19')](0x194);}return _0x37c607;};}function handleError(_0x4f5129,_0x4ca576){_0x4ca576=_0x4ca576||0x1f4;return function(_0x4cd0f3){logger[_0x1b14('0x2c')](_0x4cd0f3[_0x1b14('0x2d')]);if(_0x4cd0f3[_0x1b14('0x2e')]){delete _0x4cd0f3[_0x1b14('0x2e')];}_0x4f5129[_0x1b14('0x1a')](_0x4ca576)[_0x1b14('0x2f')](_0x4cd0f3);};}exports[_0x1b14('0x30')]=function(_0x5d5565,_0x18601c){var _0x287dab={},_0x2b5573={},_0x28710c={'count':0x0,'rows':[]};var _0xfba8b4=_[_0x1b14('0x31')](db[_0x1b14('0x32')]['rawAttributes'],function(_0x30754c){return{'name':_0x30754c[_0x1b14('0x33')],'type':_0x30754c[_0x1b14('0x34')][_0x1b14('0x35')]};});_0x2b5573[_0x1b14('0x36')]=_['map'](_0xfba8b4,_0x1b14('0x2e'));_0x2b5573['query']=_[_0x1b14('0x37')](_0x5d5565[_0x1b14('0x38')]);_0x2b5573[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x2b5573['model'],_0x2b5573[_0x1b14('0x38')]);_0x287dab[_0x1b14('0x3b')]=_['intersection'](_0x2b5573[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x287dab[_0x1b14('0x3b')]=_0x287dab[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x287dab[_0x1b14('0x3b')]:_0x2b5573['model'];if(!_0x5d5565['query']['hasOwnProperty']('nolimit')){_0x287dab[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x287dab[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x5d5565[_0x1b14('0x38')][_0x1b14('0x1c')]);}_0x287dab['order']=qs[_0x1b14('0x3e')](_0x5d5565['query'][_0x1b14('0x3e')]);_0x287dab[_0x1b14('0x3f')]=qs[_0x1b14('0x39')](_['pick'](_0x5d5565[_0x1b14('0x38')],_0x2b5573[_0x1b14('0x39')]),_0xfba8b4);if(_0x5d5565['query']['filter']){_0x287dab[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x287dab[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0xfba8b4,function(_0x517951){if(_0x517951[_0x1b14('0x34')]!=='VIRTUAL'){var _0x972fce={};_0x972fce[_0x517951[_0x1b14('0x2e')]]={'$like':'%'+_0x5d5565[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x972fce;}})});}_0x287dab=_['merge']({},_0x287dab,_0x5d5565[_0x1b14('0x42')]);var _0x1b777b={'where':_0x287dab[_0x1b14('0x3f')]};return db[_0x1b14('0x32')][_0x1b14('0x1f')](_0x1b777b)['then'](function(_0x34fe73){_0x28710c['count']=_0x34fe73;if(_0x5d5565['query'][_0x1b14('0x43')]){_0x287dab[_0x1b14('0x44')]=[{'all':!![]}];}return db[_0x1b14('0x32')]['findAll'](_0x287dab);})[_0x1b14('0x27')](function(_0x101fb7){_0x28710c[_0x1b14('0x45')]=_0x101fb7;return _0x28710c;})[_0x1b14('0x27')](respondWithFilteredResult(_0x18601c,_0x287dab))['catch'](handleError(_0x18601c,null));};exports[_0x1b14('0x46')]=function(_0x1a5425,_0xb046a1){var _0xdf058e={'raw':![],'where':{'id':_0x1a5425[_0x1b14('0x47')]['id']}},_0x584302={};_0x584302[_0x1b14('0x36')]=_[_0x1b14('0x37')](db[_0x1b14('0x32')]['rawAttributes']);_0x584302['query']=_[_0x1b14('0x37')](_0x1a5425['query']);_0x584302[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x584302['model'],_0x584302[_0x1b14('0x38')]);_0xdf058e[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x584302[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x1a5425[_0x1b14('0x38')][_0x1b14('0x3c')]));_0xdf058e[_0x1b14('0x3b')]=_0xdf058e[_0x1b14('0x3b')]['length']?_0xdf058e[_0x1b14('0x3b')]:_0x584302[_0x1b14('0x36')];if(_0x1a5425[_0x1b14('0x38')]['includeAll']){_0xdf058e[_0x1b14('0x44')]=[{'all':!![]}];}_0xdf058e=_[_0x1b14('0x40')]({},_0xdf058e,_0x1a5425[_0x1b14('0x42')]);return db['Trigger'][_0x1b14('0x48')](_0xdf058e)[_0x1b14('0x27')](handleEntityNotFound(_0xb046a1,null))['then'](respondWithResult(_0xb046a1,null))['catch'](handleError(_0xb046a1,null));};exports[_0x1b14('0x49')]=function(_0x488006,_0x244ac0){return db['Trigger'][_0x1b14('0x49')](_0x488006[_0x1b14('0x4a')],{})[_0x1b14('0x27')](function(_0x295f27){var _0x5c8823=_0x488006[_0x1b14('0x4b')][_0x1b14('0x28')]({'plain':!![]});if(!_0x5c8823)throw new Error(_0x1b14('0x4c'));if(_0x5c8823[_0x1b14('0x4d')]===_0x1b14('0x4b')){var _0xb1389b=_0x295f27[_0x1b14('0x28')]({'plain':!![]});var _0x1f494c=_0x1b14('0x29');return db[_0x1b14('0x4e')][_0x1b14('0x48')]({'where':{'name':_0x1f494c,'userProfileId':_0x5c8823[_0x1b14('0x4f')]},'raw':!![]})[_0x1b14('0x27')](function(_0x4e9178){if(_0x4e9178&&_0x4e9178['autoAssociation']===0x0){return db[_0x1b14('0x2a')][_0x1b14('0x49')]({'name':_0xb1389b[_0x1b14('0x2e')],'resourceId':_0xb1389b['id'],'type':_0x4e9178['name'],'sectionId':_0x4e9178['id']},{})['then'](function(){return _0x295f27;});}else{return _0x295f27;}})[_0x1b14('0x50')](function(_0x4f8223){logger[_0x1b14('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f8223);throw _0x4f8223;});}return _0x295f27;})[_0x1b14('0x27')](respondWithResult(_0x244ac0,0xc9))[_0x1b14('0x50')](handleError(_0x244ac0,null));};exports[_0x1b14('0x26')]=function(_0x1a02a9,_0x403da8){if(_0x1a02a9[_0x1b14('0x4a')]['id']){delete _0x1a02a9[_0x1b14('0x4a')]['id'];}return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x1a02a9[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x403da8,null))[_0x1b14('0x27')](saveUpdates(_0x1a02a9[_0x1b14('0x4a')],null))[_0x1b14('0x27')](respondWithResult(_0x403da8,null))[_0x1b14('0x50')](handleError(_0x403da8,null));};exports[_0x1b14('0x2b')]=function(_0x5b77c8,_0x2dfe01){return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x5b77c8['params']['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x2dfe01,null))[_0x1b14('0x27')](removeEntity(_0x2dfe01,null))[_0x1b14('0x50')](handleError(_0x2dfe01,null));};exports[_0x1b14('0x51')]=function(_0x5db469,_0x70336b,_0x2090df){if(_0x5db469[_0x1b14('0x4a')]['id']){delete _0x5db469[_0x1b14('0x4a')]['id'];}return db[_0x1b14('0x32')][_0x1b14('0x48')]({'where':{'id':_0x5db469[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x70336b,null))['then'](function(_0x5f48e8){if(_0x5f48e8){_0x5db469[_0x1b14('0x4a')]['TriggerAllId']=_0x5f48e8['id'];return db[_0x1b14('0x52')][_0x1b14('0x49')](_0x5db469[_0x1b14('0x4a')]);}})[_0x1b14('0x27')](respondWithResult(_0x70336b,null))[_0x1b14('0x50')](handleError(_0x70336b,null));};exports[_0x1b14('0x53')]=function(_0x35520f,_0x583cbe,_0x5c5e61){if(_0x35520f[_0x1b14('0x4a')]['id']){delete _0x35520f[_0x1b14('0x4a')]['id'];}return db[_0x1b14('0x32')][_0x1b14('0x48')]({'where':{'id':_0x35520f['params']['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x583cbe,null))[_0x1b14('0x27')](function(_0x13c360){if(_0x13c360){_0x35520f['body'][_0x1b14('0x54')]=_0x13c360['id'];return db[_0x1b14('0x52')][_0x1b14('0x49')](_0x35520f[_0x1b14('0x4a')]);}})['then'](respondWithResult(_0x583cbe,null))[_0x1b14('0x50')](handleError(_0x583cbe,null));};exports[_0x1b14('0x55')]=function(_0x199902,_0x88f18f,_0x389025){var _0x34c9c5={};var _0x59745c={};var _0x4e615d;var _0x594b4d;return db[_0x1b14('0x32')][_0x1b14('0x56')]({'where':{'id':_0x199902[_0x1b14('0x47')]['id']}})['then'](handleEntityNotFound(_0x88f18f,null))[_0x1b14('0x27')](function(_0x2e98fc){if(_0x2e98fc){_0x4e615d=_0x2e98fc;_0x59745c[_0x1b14('0x36')]=_[_0x1b14('0x37')](db[_0x1b14('0x52')][_0x1b14('0x57')]);_0x59745c[_0x1b14('0x38')]=_[_0x1b14('0x37')](_0x199902[_0x1b14('0x38')]);_0x59745c['filters']=_[_0x1b14('0x3a')](_0x59745c[_0x1b14('0x36')],_0x59745c[_0x1b14('0x38')]);_0x34c9c5[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x59745c[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x199902['query'][_0x1b14('0x3c')]));_0x34c9c5[_0x1b14('0x3b')]=_0x34c9c5[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x34c9c5[_0x1b14('0x3b')]:_0x59745c[_0x1b14('0x36')];_0x34c9c5[_0x1b14('0x58')]=qs['sort'](_0x199902['query'][_0x1b14('0x3e')]);_0x34c9c5['where']=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x199902[_0x1b14('0x38')],_0x59745c[_0x1b14('0x39')]));if(_0x199902['query'][_0x1b14('0x41')]){_0x34c9c5['where']=_[_0x1b14('0x40')](_0x34c9c5[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x34c9c5[_0x1b14('0x3b')],function(_0x32120b){var _0x5ae7fd={};_0x5ae7fd[_0x32120b]={'$like':'%'+_0x199902[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x5ae7fd;})});}_0x34c9c5=_['merge']({},_0x34c9c5,_0x199902[_0x1b14('0x42')]);return _0x4e615d[_0x1b14('0x55')](_0x34c9c5);}})['then'](function(_0x353d66){if(_0x353d66){_0x594b4d=_0x353d66[_0x1b14('0x3d')];if(!_0x199902[_0x1b14('0x38')][_0x1b14('0x5a')](_0x1b14('0x5b'))){_0x34c9c5[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x199902[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x34c9c5[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x199902['query'][_0x1b14('0x1c')]);}return _0x4e615d[_0x1b14('0x55')](_0x34c9c5);}})[_0x1b14('0x27')](function(_0x2504bf){if(_0x2504bf){return _0x2504bf?{'count':_0x594b4d,'rows':_0x2504bf}:null;}})[_0x1b14('0x27')](respondWithResult(_0x88f18f,null))[_0x1b14('0x50')](handleError(_0x88f18f,null));};exports[_0x1b14('0x5c')]=function(_0x383cc6,_0x141a6b,_0x57921d){var _0x45914a={};var _0x4a5178={};var _0x14ea6a;var _0x34e6e0;return db['Trigger'][_0x1b14('0x56')]({'where':{'id':_0x383cc6[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x141a6b,null))[_0x1b14('0x27')](function(_0x3f7a3a){if(_0x3f7a3a){_0x14ea6a=_0x3f7a3a;_0x4a5178[_0x1b14('0x36')]=_['keys'](db[_0x1b14('0x52')]['rawAttributes']);_0x4a5178[_0x1b14('0x38')]=_[_0x1b14('0x37')](_0x383cc6[_0x1b14('0x38')]);_0x4a5178[_0x1b14('0x39')]=_[_0x1b14('0x3a')](_0x4a5178[_0x1b14('0x36')],_0x4a5178[_0x1b14('0x38')]);_0x45914a[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x4a5178[_0x1b14('0x36')],qs[_0x1b14('0x3c')](_0x383cc6[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x45914a[_0x1b14('0x3b')]=_0x45914a[_0x1b14('0x3b')][_0x1b14('0x3d')]?_0x45914a['attributes']:_0x4a5178[_0x1b14('0x36')];_0x45914a['order']=qs[_0x1b14('0x3e')](_0x383cc6[_0x1b14('0x38')]['sort']);_0x45914a[_0x1b14('0x3f')]=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x383cc6[_0x1b14('0x38')],_0x4a5178[_0x1b14('0x39')]));if(_0x383cc6[_0x1b14('0x38')][_0x1b14('0x41')]){_0x45914a[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x45914a[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x45914a['attributes'],function(_0x4c02f1){var _0x1d6873={};_0x1d6873[_0x4c02f1]={'$like':'%'+_0x383cc6['query'][_0x1b14('0x41')]+'%'};return _0x1d6873;})});}_0x45914a=_[_0x1b14('0x40')]({},_0x45914a,_0x383cc6['options']);return _0x14ea6a[_0x1b14('0x5c')](_0x45914a);}})[_0x1b14('0x27')](function(_0x278a26){if(_0x278a26){_0x34e6e0=_0x278a26[_0x1b14('0x3d')];if(!_0x383cc6['query'][_0x1b14('0x5a')](_0x1b14('0x5b'))){_0x45914a['limit']=qs['limit'](_0x383cc6['query'][_0x1b14('0x1e')]);_0x45914a[_0x1b14('0x1c')]=qs[_0x1b14('0x1c')](_0x383cc6['query'][_0x1b14('0x1c')]);}return _0x14ea6a[_0x1b14('0x5c')](_0x45914a);}})[_0x1b14('0x27')](function(_0x1e6b15){if(_0x1e6b15){return _0x1e6b15?{'count':_0x34e6e0,'rows':_0x1e6b15}:null;}})['then'](respondWithResult(_0x141a6b,null))[_0x1b14('0x50')](handleError(_0x141a6b,null));};exports[_0x1b14('0x5d')]=function(_0x1a30ed,_0x3a9c41,_0x31ad2c){if(_0x1a30ed['body']['id']){delete _0x1a30ed[_0x1b14('0x4a')]['id'];}return db['Trigger'][_0x1b14('0x48')]({'where':{'id':_0x1a30ed[_0x1b14('0x47')]['id']}})[_0x1b14('0x27')](handleEntityNotFound(_0x3a9c41,null))['then'](function(_0x572f73){if(_0x572f73){_0x1a30ed[_0x1b14('0x4a')][_0x1b14('0x5e')]=_0x572f73['id'];return db[_0x1b14('0x5f')][_0x1b14('0x49')](_0x1a30ed[_0x1b14('0x4a')]);}})[_0x1b14('0x27')](respondWithResult(_0x3a9c41,null))[_0x1b14('0x50')](handleError(_0x3a9c41,null));};exports[_0x1b14('0x60')]=function(_0x53f1a3,_0x167a28,_0x1c4282){var _0x3c9489={};var _0x3e2a70={};var _0x2c6b3c;var _0x3adfff;return db[_0x1b14('0x32')][_0x1b14('0x56')]({'where':{'id':_0x53f1a3[_0x1b14('0x47')]['id']}})['then'](handleEntityNotFound(_0x167a28,null))[_0x1b14('0x27')](function(_0x27466b){if(_0x27466b){_0x2c6b3c=_0x27466b;_0x3e2a70[_0x1b14('0x36')]=_['keys'](db[_0x1b14('0x5f')]['rawAttributes']);_0x3e2a70['query']=_[_0x1b14('0x37')](_0x53f1a3[_0x1b14('0x38')]);_0x3e2a70[_0x1b14('0x39')]=_['intersection'](_0x3e2a70[_0x1b14('0x36')],_0x3e2a70['query']);_0x3c9489[_0x1b14('0x3b')]=_[_0x1b14('0x3a')](_0x3e2a70['model'],qs[_0x1b14('0x3c')](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x3c')]));_0x3c9489['attributes']=_0x3c9489['attributes'][_0x1b14('0x3d')]?_0x3c9489[_0x1b14('0x3b')]:_0x3e2a70[_0x1b14('0x36')];_0x3c9489[_0x1b14('0x58')]=qs['sort'](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x3e')]);_0x3c9489['where']=qs[_0x1b14('0x39')](_[_0x1b14('0x59')](_0x53f1a3['query'],_0x3e2a70[_0x1b14('0x39')]));if(_0x53f1a3['query'][_0x1b14('0x41')]){_0x3c9489[_0x1b14('0x3f')]=_[_0x1b14('0x40')](_0x3c9489[_0x1b14('0x3f')],{'$or':_[_0x1b14('0x31')](_0x3c9489[_0x1b14('0x3b')],function(_0x5b3c6e){var _0x882299={};_0x882299[_0x5b3c6e]={'$like':'%'+_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x41')]+'%'};return _0x882299;})});}_0x3c9489=_[_0x1b14('0x40')]({},_0x3c9489,_0x53f1a3[_0x1b14('0x42')]);return _0x2c6b3c[_0x1b14('0x60')](_0x3c9489);}})[_0x1b14('0x27')](function(_0xba505d){if(_0xba505d){_0x3adfff=_0xba505d[_0x1b14('0x3d')];if(!_0x53f1a3[_0x1b14('0x38')]['hasOwnProperty'](_0x1b14('0x5b'))){_0x3c9489[_0x1b14('0x1e')]=qs[_0x1b14('0x1e')](_0x53f1a3[_0x1b14('0x38')][_0x1b14('0x1e')]);_0x3c9489['offset']=qs[_0x1b14('0x1c')](_0x53f1a3['query'][_0x1b14('0x1c')]);}return _0x2c6b3c[_0x1b14('0x60')](_0x3c9489);}})['then'](function(_0x48fd05){if(_0x48fd05){return _0x48fd05?{'count':_0x3adfff,'rows':_0x48fd05}:null;}})[_0x1b14('0x27')](respondWithResult(_0x167a28,null))[_0x1b14('0x50')](handleError(_0x167a28,null));}; \ No newline at end of file +var _0xbdd4=['show','keys','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAnyCondition','TriggerAnyId','findOne','Condition','rawAttributes','getAllConditions','getAnyConditions','TriggerId','getActions','Action','order','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Triggers','error','stack','name','send','index','map','Trigger','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','includeAll','include','catch'];(function(_0x22429b,_0x4e072b){var _0x538c82=function(_0xd00007){while(--_0xd00007){_0x22429b['push'](_0x22429b['shift']());}};_0x538c82(++_0x4e072b);}(_0xbdd4,0xc9));var _0x4bdd=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xbdd4[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0x4bdd('0x0'));var rimraf=require(_0x4bdd('0x1'));var zipdir=require(_0x4bdd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4bdd('0x3'));var BPromise=require(_0x4bdd('0x4'));var Mustache=require('mustache');var util=require(_0x4bdd('0x5'));var path=require(_0x4bdd('0x6'));var sox=require('sox');var csv=require(_0x4bdd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bdd('0x8'));var _=require(_0x4bdd('0x9'));var squel=require(_0x4bdd('0xa'));var crypto=require(_0x4bdd('0xb'));var jsforce=require(_0x4bdd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4bdd('0x7'));var querystring=require('querystring');var Papa=require(_0x4bdd('0xd'));var Redis=require(_0x4bdd('0xe'));var authService=require(_0x4bdd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4bdd('0x10'));var utils=require(_0x4bdd('0x11'));var config=require(_0x4bdd('0x12'));var licenseUtil=require(_0x4bdd('0x13'));var db=require(_0x4bdd('0x14'))['db'];function respondWithStatusCode(_0xfdd49b,_0x50aa9d){_0x50aa9d=_0x50aa9d||0xcc;return function(_0x2ab9b6){if(_0x2ab9b6){return _0xfdd49b['sendStatus'](_0x50aa9d);}return _0xfdd49b[_0x4bdd('0x15')](_0x50aa9d)[_0x4bdd('0x16')]();};}function respondWithResult(_0x12f6bf,_0x5617e3){_0x5617e3=_0x5617e3||0xc8;return function(_0x5c7300){if(_0x5c7300){return _0x12f6bf[_0x4bdd('0x15')](_0x5617e3)[_0x4bdd('0x17')](_0x5c7300);}};}function respondWithFilteredResult(_0xa80ccf,_0x2506e8){return function(_0x1227bb){if(_0x1227bb){var _0x270cbd=typeof _0x2506e8[_0x4bdd('0x18')]===_0x4bdd('0x19')&&typeof _0x2506e8[_0x4bdd('0x1a')]===_0x4bdd('0x19');var _0x1fa719=_0x1227bb[_0x4bdd('0x1b')];var _0x2eb1b8=_0x270cbd?0x0:_0x2506e8['offset'];var _0x16bf1f=_0x270cbd?_0x1227bb[_0x4bdd('0x1b')]:_0x2506e8[_0x4bdd('0x18')]+_0x2506e8[_0x4bdd('0x1a')];var _0x4fb2ab;if(_0x16bf1f>=_0x1fa719){_0x16bf1f=_0x1fa719;_0x4fb2ab=0xc8;}else{_0x4fb2ab=0xce;}_0xa80ccf['status'](_0x4fb2ab);return _0xa80ccf[_0x4bdd('0x1c')]('Content-Range',_0x2eb1b8+'-'+_0x16bf1f+'/'+_0x1fa719)[_0x4bdd('0x17')](_0x1227bb);}return null;};}function patchUpdates(_0x43bf36){return function(_0x2ea5a7){try{jsonpatch[_0x4bdd('0x1d')](_0x2ea5a7,_0x43bf36,!![]);}catch(_0x27147c){return BPromise[_0x4bdd('0x1e')](_0x27147c);}return _0x2ea5a7['save']();};}function saveUpdates(_0x579e13,_0x2de874){return function(_0x1b4dc8){if(_0x1b4dc8){return _0x1b4dc8['update'](_0x579e13)[_0x4bdd('0x1f')](function(_0x5a7da1){return _0x5a7da1;});}return null;};}function removeEntity(_0x5f49d3,_0xc95a6f){return function(_0x5a6b6f){if(_0x5a6b6f){return _0x5a6b6f[_0x4bdd('0x20')]()['then'](function(){var _0x27a54c=_0x5a6b6f[_0x4bdd('0x21')]({'plain':!![]});var _0x285baf=_0x4bdd('0x22');return db['UserProfileResource'][_0x4bdd('0x20')]({'where':{'type':_0x285baf,'resourceId':_0x27a54c['id']}})[_0x4bdd('0x1f')](function(){return _0x5a6b6f;});})[_0x4bdd('0x1f')](function(){_0x5f49d3[_0x4bdd('0x15')](0xcc)[_0x4bdd('0x16')]();});}};}function handleEntityNotFound(_0x437b09,_0x46cf6d){return function(_0x19314b){if(!_0x19314b){_0x437b09['sendStatus'](0x194);}return _0x19314b;};}function handleError(_0x58b24e,_0xe28238){_0xe28238=_0xe28238||0x1f4;return function(_0x1a472f){logger[_0x4bdd('0x23')](_0x1a472f[_0x4bdd('0x24')]);if(_0x1a472f[_0x4bdd('0x25')]){delete _0x1a472f['name'];}_0x58b24e[_0x4bdd('0x15')](_0xe28238)[_0x4bdd('0x26')](_0x1a472f);};}exports[_0x4bdd('0x27')]=function(_0x19ff06,_0xc54401){var _0x1ed592={},_0x3edaf3={},_0x39bb27={'count':0x0,'rows':[]};var _0x28a82f=_[_0x4bdd('0x28')](db[_0x4bdd('0x29')]['rawAttributes'],function(_0x544a2c){return{'name':_0x544a2c['fieldName'],'type':_0x544a2c['type'][_0x4bdd('0x2a')]};});_0x3edaf3[_0x4bdd('0x2b')]=_[_0x4bdd('0x28')](_0x28a82f,_0x4bdd('0x25'));_0x3edaf3[_0x4bdd('0x2c')]=_['keys'](_0x19ff06[_0x4bdd('0x2c')]);_0x3edaf3[_0x4bdd('0x2d')]=_[_0x4bdd('0x2e')](_0x3edaf3['model'],_0x3edaf3[_0x4bdd('0x2c')]);_0x1ed592[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x3edaf3[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x1ed592['attributes']=_0x1ed592['attributes']['length']?_0x1ed592[_0x4bdd('0x2f')]:_0x3edaf3[_0x4bdd('0x2b')];if(!_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x31')](_0x4bdd('0x32'))){_0x1ed592[_0x4bdd('0x1a')]=qs[_0x4bdd('0x1a')](_0x19ff06[_0x4bdd('0x2c')]['limit']);_0x1ed592['offset']=qs[_0x4bdd('0x18')](_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x18')]);}_0x1ed592['order']=qs['sort'](_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x33')]);_0x1ed592[_0x4bdd('0x34')]=qs['filters'](_[_0x4bdd('0x35')](_0x19ff06[_0x4bdd('0x2c')],_0x3edaf3[_0x4bdd('0x2d')]),_0x28a82f);if(_0x19ff06[_0x4bdd('0x2c')]['filter']){_0x1ed592[_0x4bdd('0x34')]=_[_0x4bdd('0x36')](_0x1ed592[_0x4bdd('0x34')],{'$or':_[_0x4bdd('0x28')](_0x28a82f,function(_0x5ceffa){if(_0x5ceffa[_0x4bdd('0x37')]!=='VIRTUAL'){var _0x4e9135={};_0x4e9135[_0x5ceffa['name']]={'$like':'%'+_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x38')]+'%'};return _0x4e9135;}})});}_0x1ed592=_[_0x4bdd('0x36')]({},_0x1ed592,_0x19ff06['options']);var _0x3b2a67={'where':_0x1ed592['where']};return db[_0x4bdd('0x29')][_0x4bdd('0x1b')](_0x3b2a67)[_0x4bdd('0x1f')](function(_0x5f5a25){_0x39bb27[_0x4bdd('0x1b')]=_0x5f5a25;if(_0x19ff06[_0x4bdd('0x2c')][_0x4bdd('0x39')]){_0x1ed592[_0x4bdd('0x3a')]=[{'all':!![]}];}return db[_0x4bdd('0x29')]['findAll'](_0x1ed592);})[_0x4bdd('0x1f')](function(_0x21a16f){_0x39bb27['rows']=_0x21a16f;return _0x39bb27;})[_0x4bdd('0x1f')](respondWithFilteredResult(_0xc54401,_0x1ed592))[_0x4bdd('0x3b')](handleError(_0xc54401,null));};exports[_0x4bdd('0x3c')]=function(_0x11f302,_0x58a817){var _0x46a132={'raw':![],'where':{'id':_0x11f302['params']['id']}},_0x3744ad={};_0x3744ad[_0x4bdd('0x2b')]=_['keys'](db[_0x4bdd('0x29')]['rawAttributes']);_0x3744ad[_0x4bdd('0x2c')]=_[_0x4bdd('0x3d')](_0x11f302['query']);_0x3744ad[_0x4bdd('0x2d')]=_[_0x4bdd('0x2e')](_0x3744ad[_0x4bdd('0x2b')],_0x3744ad[_0x4bdd('0x2c')]);_0x46a132['attributes']=_[_0x4bdd('0x2e')](_0x3744ad[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x11f302[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x46a132[_0x4bdd('0x2f')]=_0x46a132['attributes'][_0x4bdd('0x3e')]?_0x46a132[_0x4bdd('0x2f')]:_0x3744ad[_0x4bdd('0x2b')];if(_0x11f302[_0x4bdd('0x2c')][_0x4bdd('0x39')]){_0x46a132[_0x4bdd('0x3a')]=[{'all':!![]}];}_0x46a132=_[_0x4bdd('0x36')]({},_0x46a132,_0x11f302[_0x4bdd('0x3f')]);return db[_0x4bdd('0x29')][_0x4bdd('0x40')](_0x46a132)[_0x4bdd('0x1f')](handleEntityNotFound(_0x58a817,null))[_0x4bdd('0x1f')](respondWithResult(_0x58a817,null))['catch'](handleError(_0x58a817,null));};exports['create']=function(_0x57a761,_0x406137){return db['Trigger'][_0x4bdd('0x41')](_0x57a761[_0x4bdd('0x42')],{})[_0x4bdd('0x1f')](function(_0x1e1077){var _0x31102f=_0x57a761[_0x4bdd('0x43')][_0x4bdd('0x21')]({'plain':!![]});if(!_0x31102f)throw new Error(_0x4bdd('0x44'));if(_0x31102f['role']==='user'){var _0x23ba29=_0x1e1077[_0x4bdd('0x21')]({'plain':!![]});var _0x2896c7='Triggers';return db[_0x4bdd('0x45')][_0x4bdd('0x40')]({'where':{'name':_0x2896c7,'userProfileId':_0x31102f[_0x4bdd('0x46')]},'raw':!![]})[_0x4bdd('0x1f')](function(_0x5715cc){if(_0x5715cc&&_0x5715cc[_0x4bdd('0x47')]===0x0){return db[_0x4bdd('0x48')][_0x4bdd('0x41')]({'name':_0x23ba29[_0x4bdd('0x25')],'resourceId':_0x23ba29['id'],'type':_0x5715cc[_0x4bdd('0x25')],'sectionId':_0x5715cc['id']},{})[_0x4bdd('0x1f')](function(){return _0x1e1077;});}else{return _0x1e1077;}})[_0x4bdd('0x3b')](function(_0x4768b4){logger['error'](_0x4bdd('0x49'),_0x4768b4);throw _0x4768b4;});}return _0x1e1077;})[_0x4bdd('0x1f')](respondWithResult(_0x406137,0xc9))['catch'](handleError(_0x406137,null));};exports[_0x4bdd('0x4a')]=function(_0x2de733,_0x28211a){if(_0x2de733[_0x4bdd('0x42')]['id']){delete _0x2de733[_0x4bdd('0x42')]['id'];}return db[_0x4bdd('0x29')][_0x4bdd('0x40')]({'where':{'id':_0x2de733[_0x4bdd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28211a,null))[_0x4bdd('0x1f')](saveUpdates(_0x2de733[_0x4bdd('0x42')],null))[_0x4bdd('0x1f')](respondWithResult(_0x28211a,null))[_0x4bdd('0x3b')](handleError(_0x28211a,null));};exports[_0x4bdd('0x20')]=function(_0x4ed621,_0x5c0125){return db[_0x4bdd('0x29')][_0x4bdd('0x40')]({'where':{'id':_0x4ed621[_0x4bdd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c0125,null))[_0x4bdd('0x1f')](removeEntity(_0x5c0125,null))['catch'](handleError(_0x5c0125,null));};exports['addAllCondition']=function(_0x99631b,_0x3da982,_0x62cd70){if(_0x99631b[_0x4bdd('0x42')]['id']){delete _0x99631b[_0x4bdd('0x42')]['id'];}return db[_0x4bdd('0x29')][_0x4bdd('0x40')]({'where':{'id':_0x99631b[_0x4bdd('0x4b')]['id']}})[_0x4bdd('0x1f')](handleEntityNotFound(_0x3da982,null))[_0x4bdd('0x1f')](function(_0x2eaa77){if(_0x2eaa77){_0x99631b['body']['TriggerAllId']=_0x2eaa77['id'];return db['Condition'][_0x4bdd('0x41')](_0x99631b[_0x4bdd('0x42')]);}})[_0x4bdd('0x1f')](respondWithResult(_0x3da982,null))['catch'](handleError(_0x3da982,null));};exports[_0x4bdd('0x4c')]=function(_0x2610c3,_0x617c31,_0x17d13f){if(_0x2610c3[_0x4bdd('0x42')]['id']){delete _0x2610c3[_0x4bdd('0x42')]['id'];}return db[_0x4bdd('0x29')][_0x4bdd('0x40')]({'where':{'id':_0x2610c3[_0x4bdd('0x4b')]['id']}})[_0x4bdd('0x1f')](handleEntityNotFound(_0x617c31,null))[_0x4bdd('0x1f')](function(_0x1de2ac){if(_0x1de2ac){_0x2610c3[_0x4bdd('0x42')][_0x4bdd('0x4d')]=_0x1de2ac['id'];return db['Condition'][_0x4bdd('0x41')](_0x2610c3[_0x4bdd('0x42')]);}})[_0x4bdd('0x1f')](respondWithResult(_0x617c31,null))[_0x4bdd('0x3b')](handleError(_0x617c31,null));};exports['getAllConditions']=function(_0x5c1743,_0x3c671f,_0x36a14f){var _0x585757={};var _0x20b4b2={};var _0x815e5c;var _0x1bd597;return db[_0x4bdd('0x29')][_0x4bdd('0x4e')]({'where':{'id':_0x5c1743[_0x4bdd('0x4b')]['id']}})[_0x4bdd('0x1f')](handleEntityNotFound(_0x3c671f,null))['then'](function(_0x2664e0){if(_0x2664e0){_0x815e5c=_0x2664e0;_0x20b4b2[_0x4bdd('0x2b')]=_[_0x4bdd('0x3d')](db[_0x4bdd('0x4f')][_0x4bdd('0x50')]);_0x20b4b2[_0x4bdd('0x2c')]=_[_0x4bdd('0x3d')](_0x5c1743[_0x4bdd('0x2c')]);_0x20b4b2[_0x4bdd('0x2d')]=_[_0x4bdd('0x2e')](_0x20b4b2['model'],_0x20b4b2['query']);_0x585757['attributes']=_['intersection'](_0x20b4b2[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x5c1743[_0x4bdd('0x2c')][_0x4bdd('0x30')]));_0x585757[_0x4bdd('0x2f')]=_0x585757[_0x4bdd('0x2f')][_0x4bdd('0x3e')]?_0x585757['attributes']:_0x20b4b2[_0x4bdd('0x2b')];_0x585757['order']=qs[_0x4bdd('0x33')](_0x5c1743[_0x4bdd('0x2c')]['sort']);_0x585757[_0x4bdd('0x34')]=qs['filters'](_['pick'](_0x5c1743['query'],_0x20b4b2[_0x4bdd('0x2d')]));if(_0x5c1743[_0x4bdd('0x2c')][_0x4bdd('0x38')]){_0x585757[_0x4bdd('0x34')]=_[_0x4bdd('0x36')](_0x585757[_0x4bdd('0x34')],{'$or':_[_0x4bdd('0x28')](_0x585757[_0x4bdd('0x2f')],function(_0x44d03f){var _0x47538c={};_0x47538c[_0x44d03f]={'$like':'%'+_0x5c1743[_0x4bdd('0x2c')][_0x4bdd('0x38')]+'%'};return _0x47538c;})});}_0x585757=_[_0x4bdd('0x36')]({},_0x585757,_0x5c1743[_0x4bdd('0x3f')]);return _0x815e5c[_0x4bdd('0x51')](_0x585757);}})[_0x4bdd('0x1f')](function(_0x5f02de){if(_0x5f02de){_0x1bd597=_0x5f02de[_0x4bdd('0x3e')];if(!_0x5c1743[_0x4bdd('0x2c')]['hasOwnProperty'](_0x4bdd('0x32'))){_0x585757[_0x4bdd('0x1a')]=qs[_0x4bdd('0x1a')](_0x5c1743['query']['limit']);_0x585757['offset']=qs[_0x4bdd('0x18')](_0x5c1743[_0x4bdd('0x2c')][_0x4bdd('0x18')]);}return _0x815e5c[_0x4bdd('0x51')](_0x585757);}})['then'](function(_0x4f5699){if(_0x4f5699){return _0x4f5699?{'count':_0x1bd597,'rows':_0x4f5699}:null;}})[_0x4bdd('0x1f')](respondWithResult(_0x3c671f,null))[_0x4bdd('0x3b')](handleError(_0x3c671f,null));};exports[_0x4bdd('0x52')]=function(_0x1f40dc,_0x47ce58,_0x5ef1cf){var _0x4585da={};var _0xf5ea7d={};var _0x3d7a45;var _0xd6cfef;return db[_0x4bdd('0x29')][_0x4bdd('0x4e')]({'where':{'id':_0x1f40dc[_0x4bdd('0x4b')]['id']}})[_0x4bdd('0x1f')](handleEntityNotFound(_0x47ce58,null))[_0x4bdd('0x1f')](function(_0x239691){if(_0x239691){_0x3d7a45=_0x239691;_0xf5ea7d[_0x4bdd('0x2b')]=_[_0x4bdd('0x3d')](db[_0x4bdd('0x4f')]['rawAttributes']);_0xf5ea7d[_0x4bdd('0x2c')]=_[_0x4bdd('0x3d')](_0x1f40dc[_0x4bdd('0x2c')]);_0xf5ea7d[_0x4bdd('0x2d')]=_[_0x4bdd('0x2e')](_0xf5ea7d['model'],_0xf5ea7d[_0x4bdd('0x2c')]);_0x4585da['attributes']=_[_0x4bdd('0x2e')](_0xf5ea7d['model'],qs[_0x4bdd('0x30')](_0x1f40dc['query'][_0x4bdd('0x30')]));_0x4585da['attributes']=_0x4585da[_0x4bdd('0x2f')][_0x4bdd('0x3e')]?_0x4585da['attributes']:_0xf5ea7d[_0x4bdd('0x2b')];_0x4585da['order']=qs['sort'](_0x1f40dc[_0x4bdd('0x2c')]['sort']);_0x4585da[_0x4bdd('0x34')]=qs[_0x4bdd('0x2d')](_['pick'](_0x1f40dc[_0x4bdd('0x2c')],_0xf5ea7d[_0x4bdd('0x2d')]));if(_0x1f40dc[_0x4bdd('0x2c')][_0x4bdd('0x38')]){_0x4585da['where']=_[_0x4bdd('0x36')](_0x4585da[_0x4bdd('0x34')],{'$or':_[_0x4bdd('0x28')](_0x4585da['attributes'],function(_0x5e3348){var _0x448a1d={};_0x448a1d[_0x5e3348]={'$like':'%'+_0x1f40dc['query'][_0x4bdd('0x38')]+'%'};return _0x448a1d;})});}_0x4585da=_[_0x4bdd('0x36')]({},_0x4585da,_0x1f40dc['options']);return _0x3d7a45[_0x4bdd('0x52')](_0x4585da);}})[_0x4bdd('0x1f')](function(_0x122064){if(_0x122064){_0xd6cfef=_0x122064['length'];if(!_0x1f40dc[_0x4bdd('0x2c')]['hasOwnProperty'](_0x4bdd('0x32'))){_0x4585da[_0x4bdd('0x1a')]=qs[_0x4bdd('0x1a')](_0x1f40dc['query']['limit']);_0x4585da[_0x4bdd('0x18')]=qs[_0x4bdd('0x18')](_0x1f40dc[_0x4bdd('0x2c')][_0x4bdd('0x18')]);}return _0x3d7a45[_0x4bdd('0x52')](_0x4585da);}})[_0x4bdd('0x1f')](function(_0x2a56a1){if(_0x2a56a1){return _0x2a56a1?{'count':_0xd6cfef,'rows':_0x2a56a1}:null;}})[_0x4bdd('0x1f')](respondWithResult(_0x47ce58,null))[_0x4bdd('0x3b')](handleError(_0x47ce58,null));};exports['addAction']=function(_0x12a515,_0x231b34,_0xe61995){if(_0x12a515['body']['id']){delete _0x12a515[_0x4bdd('0x42')]['id'];}return db[_0x4bdd('0x29')][_0x4bdd('0x40')]({'where':{'id':_0x12a515[_0x4bdd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x231b34,null))[_0x4bdd('0x1f')](function(_0x3a2cfb){if(_0x3a2cfb){_0x12a515[_0x4bdd('0x42')][_0x4bdd('0x53')]=_0x3a2cfb['id'];return db['Action']['create'](_0x12a515[_0x4bdd('0x42')]);}})['then'](respondWithResult(_0x231b34,null))[_0x4bdd('0x3b')](handleError(_0x231b34,null));};exports[_0x4bdd('0x54')]=function(_0x30cdf2,_0x1f444d,_0x1d8df3){var _0x30c43b={};var _0x26b8e6={};var _0xa5024b;var _0x2eddb0;return db[_0x4bdd('0x29')][_0x4bdd('0x4e')]({'where':{'id':_0x30cdf2[_0x4bdd('0x4b')]['id']}})[_0x4bdd('0x1f')](handleEntityNotFound(_0x1f444d,null))[_0x4bdd('0x1f')](function(_0x343fb3){if(_0x343fb3){_0xa5024b=_0x343fb3;_0x26b8e6[_0x4bdd('0x2b')]=_[_0x4bdd('0x3d')](db[_0x4bdd('0x55')][_0x4bdd('0x50')]);_0x26b8e6[_0x4bdd('0x2c')]=_[_0x4bdd('0x3d')](_0x30cdf2['query']);_0x26b8e6[_0x4bdd('0x2d')]=_[_0x4bdd('0x2e')](_0x26b8e6[_0x4bdd('0x2b')],_0x26b8e6[_0x4bdd('0x2c')]);_0x30c43b[_0x4bdd('0x2f')]=_[_0x4bdd('0x2e')](_0x26b8e6[_0x4bdd('0x2b')],qs[_0x4bdd('0x30')](_0x30cdf2[_0x4bdd('0x2c')]['fields']));_0x30c43b[_0x4bdd('0x2f')]=_0x30c43b[_0x4bdd('0x2f')][_0x4bdd('0x3e')]?_0x30c43b[_0x4bdd('0x2f')]:_0x26b8e6[_0x4bdd('0x2b')];_0x30c43b[_0x4bdd('0x56')]=qs[_0x4bdd('0x33')](_0x30cdf2[_0x4bdd('0x2c')][_0x4bdd('0x33')]);_0x30c43b[_0x4bdd('0x34')]=qs['filters'](_['pick'](_0x30cdf2['query'],_0x26b8e6[_0x4bdd('0x2d')]));if(_0x30cdf2[_0x4bdd('0x2c')]['filter']){_0x30c43b[_0x4bdd('0x34')]=_['merge'](_0x30c43b[_0x4bdd('0x34')],{'$or':_[_0x4bdd('0x28')](_0x30c43b['attributes'],function(_0x502e89){var _0x5ddcf6={};_0x5ddcf6[_0x502e89]={'$like':'%'+_0x30cdf2[_0x4bdd('0x2c')][_0x4bdd('0x38')]+'%'};return _0x5ddcf6;})});}_0x30c43b=_[_0x4bdd('0x36')]({},_0x30c43b,_0x30cdf2[_0x4bdd('0x3f')]);return _0xa5024b[_0x4bdd('0x54')](_0x30c43b);}})[_0x4bdd('0x1f')](function(_0x3aa475){if(_0x3aa475){_0x2eddb0=_0x3aa475[_0x4bdd('0x3e')];if(!_0x30cdf2[_0x4bdd('0x2c')][_0x4bdd('0x31')]('nolimit')){_0x30c43b['limit']=qs[_0x4bdd('0x1a')](_0x30cdf2[_0x4bdd('0x2c')][_0x4bdd('0x1a')]);_0x30c43b[_0x4bdd('0x18')]=qs['offset'](_0x30cdf2[_0x4bdd('0x2c')]['offset']);}return _0xa5024b['getActions'](_0x30c43b);}})[_0x4bdd('0x1f')](function(_0x484b5e){if(_0x484b5e){return _0x484b5e?{'count':_0x2eddb0,'rows':_0x484b5e}:null;}})[_0x4bdd('0x1f')](respondWithResult(_0x1f444d,null))[_0x4bdd('0x3b')](handleError(_0x1f444d,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 3d43afc..60ac990 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 _0x0bde=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','bluebird'];(function(_0x3c9a48,_0x94ee9f){var _0x4e5118=function(_0x389f99){while(--_0x389f99){_0x3c9a48['push'](_0x3c9a48['shift']());}};_0x4e5118(++_0x94ee9f);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var moment=require('moment');var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3a3cd2,_0x37289f){return _0x3a3cd2[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':_0xe0bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce1=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api','moment'];(function(_0x3253f3,_0x1c57d8){var _0x598c26=function(_0x4c1251){while(--_0x4c1251){_0x3253f3['push'](_0x3253f3['shift']());}};_0x598c26(++_0x1c57d8);}(_0x8ce1,0x183));var _0x18ce=function(_0x39d1c0,_0x2c9480){_0x39d1c0=_0x39d1c0-0x0;var _0x531a80=_0x8ce1[_0x39d1c0];return _0x531a80;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require(_0x18ce('0x4'));var BPromise=require(_0x18ce('0x5'));var rp=require(_0x18ce('0x6'));var fs=require('fs');var path=require(_0x18ce('0x7'));var rimraf=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var attributes=require(_0x18ce('0xa'));module[_0x18ce('0xb')]=function(_0x13ff9d,_0x36f8db){return _0x13ff9d[_0x18ce('0xc')](_0x18ce('0xd'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 3224307..d8d6c32 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 _0x7651=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','Trigger','findAll','options','raw','attributes','limit','include','model','map','GetTrigger','stringify','find','where','ShowTrigger'];(function(_0x489eb9,_0x5037ca){var _0x5598c5=function(_0x5efcb2){while(--_0x5efcb2){_0x489eb9['push'](_0x489eb9['shift']());}};_0x5598c5(++_0x5037ca);}(_0x7651,0x6c));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var moment=require(_0x1765('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1765('0x3'));var db=require(_0x1765('0x4'))['db'];var utils=require(_0x1765('0x5'));var logger=require(_0x1765('0x6'))(_0x1765('0x7'));var config=require(_0x1765('0x8'));var jayson=require(_0x1765('0x9'));var client=jayson[_0x1765('0xa')][_0x1765('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x315d15,_0x2ebd95,_0x1d267d){return new BPromise(function(_0x5c2b80,_0x2306eb){return client['request'](_0x315d15,_0x1d267d)[_0x1765('0xc')](function(_0x407bda){logger['info'](_0x1765('0xd'),_0x2ebd95,_0x1765('0xe'));logger[_0x1765('0xf')](_0x1765('0x10'),_0x2ebd95,'request\x20sent',JSON['stringify'](_0x407bda));if(_0x407bda[_0x1765('0x11')]){if(_0x407bda[_0x1765('0x11')]['code']===0x1f4){logger[_0x1765('0x11')](_0x1765('0xd'),_0x2ebd95,_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);return _0x2306eb(_0x407bda['error'][_0x1765('0x12')]);}logger['error'](_0x1765('0xd'),_0x2ebd95,_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);return _0x5c2b80(_0x407bda[_0x1765('0x11')][_0x1765('0x12')]);}else{logger[_0x1765('0x13')](_0x1765('0xd'),_0x2ebd95,_0x1765('0xe'));_0x5c2b80(_0x407bda[_0x1765('0x14')][_0x1765('0x12')]);}})[_0x1765('0x15')](function(_0xfce9a4){logger[_0x1765('0x11')](_0x1765('0xd'),_0x2ebd95,_0xfce9a4);_0x2306eb(_0xfce9a4);});});}exports['GetTrigger']=function(_0xdf0e44){var _0x2c15be=this;return new Promise(function(_0x1892b5,_0x3a074d){return db[_0x1765('0x16')][_0x1765('0x17')]({'raw':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x19')]===undefined?!![]:![]:!![],'where':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')]['where']||null:null,'attributes':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1a')]||null:null,'limit':_0xdf0e44[_0x1765('0x18')]?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1b')]||null:null,'include':_0xdf0e44['options']?_0xdf0e44[_0x1765('0x18')][_0x1765('0x1c')]?_['map'](_0xdf0e44['options']['include'],function(_0x4e4c2a){return{'model':db[_0x4e4c2a[_0x1765('0x1d')]],'as':_0x4e4c2a['as'],'attributes':_0x4e4c2a[_0x1765('0x1a')],'include':_0x4e4c2a[_0x1765('0x1c')]?_[_0x1765('0x1e')](_0x4e4c2a['include'],function(_0x293003){return{'model':db[_0x293003[_0x1765('0x1d')]],'as':_0x293003['as'],'attributes':_0x293003[_0x1765('0x1a')],'include':_0x293003[_0x1765('0x1c')]?_['map'](_0x293003[_0x1765('0x1c')],function(_0x2936f){return{'model':db[_0x2936f[_0x1765('0x1d')]],'as':_0x2936f['as'],'attributes':_0x2936f[_0x1765('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x51f760){logger[_0x1765('0x13')](_0x1765('0x1f'),_0xdf0e44);logger[_0x1765('0xf')](_0x1765('0x1f'),_0xdf0e44,JSON[_0x1765('0x20')](_0x51f760));_0x1892b5(_0x51f760);})[_0x1765('0x15')](function(_0x65137c){logger[_0x1765('0x11')](_0x1765('0x1f'),_0x65137c[_0x1765('0x12')],_0xdf0e44);_0x3a074d(_0x2c15be[_0x1765('0x11')](0x1f4,_0x65137c[_0x1765('0x12')]));});});};exports['ShowTrigger']=function(_0x51c2a7){var _0x24e1e4=this;return new Promise(function(_0x58f978,_0x5f1399){return db[_0x1765('0x16')][_0x1765('0x21')]({'raw':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')][_0x1765('0x22')]||null:null,'attributes':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')]['attributes']||null:null,'include':_0x51c2a7[_0x1765('0x18')]?_0x51c2a7[_0x1765('0x18')][_0x1765('0x1c')]?_['map'](_0x51c2a7[_0x1765('0x18')][_0x1765('0x1c')],function(_0x29fb78){return{'model':db[_0x29fb78[_0x1765('0x1d')]],'as':_0x29fb78['as'],'attributes':_0x29fb78[_0x1765('0x1a')],'include':_0x29fb78[_0x1765('0x1c')]?_[_0x1765('0x1e')](_0x29fb78['include'],function(_0x541ff7){return{'model':db[_0x541ff7[_0x1765('0x1d')]],'as':_0x541ff7['as'],'attributes':_0x541ff7['attributes'],'include':_0x541ff7['include']?_[_0x1765('0x1e')](_0x541ff7[_0x1765('0x1c')],function(_0x253cde){return{'model':db[_0x253cde[_0x1765('0x1d')]],'as':_0x253cde['as'],'attributes':_0x253cde[_0x1765('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x34789d){logger[_0x1765('0x13')]('ShowTrigger',_0x51c2a7);logger[_0x1765('0xf')](_0x1765('0x23'),_0x51c2a7,JSON[_0x1765('0x20')](_0x34789d));_0x58f978(_0x34789d);})[_0x1765('0x15')](function(_0x2b4e49){logger[_0x1765('0x11')](_0x1765('0x23'),_0x2b4e49['message'],_0x51c2a7);_0x5f1399(_0x24e1e4[_0x1765('0x11')](0x1f4,_0x2b4e49['message']));});});}; \ No newline at end of file +var _0x5a22=['Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowTrigger','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a22,0x107));var _0x25a2=function(_0x31490c,_0x3a51c6){_0x31490c=_0x31490c-0x0;var _0x4c7410=_0x5a22[_0x31490c];return _0x4c7410;};'use strict';var _=require(_0x25a2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x25a2('0x1'));var rs=require(_0x25a2('0x2'));var fs=require('fs');var Redis=require(_0x25a2('0x3'));var db=require(_0x25a2('0x4'))['db'];var utils=require(_0x25a2('0x5'));var logger=require('../../config/logger')(_0x25a2('0x6'));var config=require(_0x25a2('0x7'));var jayson=require(_0x25a2('0x8'));var client=jayson[_0x25a2('0x9')][_0x25a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2256da,_0x99fea7,_0x175ebd){return new BPromise(function(_0x1d407b,_0x5a6ff3){return client[_0x25a2('0xb')](_0x2256da,_0x175ebd)[_0x25a2('0xc')](function(_0x11b731){logger[_0x25a2('0xd')]('Trigger,\x20%s,\x20%s',_0x99fea7,_0x25a2('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x99fea7,_0x25a2('0xe'),JSON['stringify'](_0x11b731));if(_0x11b731[_0x25a2('0xf')]){if(_0x11b731[_0x25a2('0xf')][_0x25a2('0x10')]===0x1f4){logger[_0x25a2('0xf')](_0x25a2('0x11'),_0x99fea7,_0x11b731[_0x25a2('0xf')][_0x25a2('0x12')]);return _0x5a6ff3(_0x11b731[_0x25a2('0xf')][_0x25a2('0x12')]);}logger['error'](_0x25a2('0x11'),_0x99fea7,_0x11b731[_0x25a2('0xf')][_0x25a2('0x12')]);return _0x1d407b(_0x11b731['error'][_0x25a2('0x12')]);}else{logger[_0x25a2('0xd')](_0x25a2('0x11'),_0x99fea7,_0x25a2('0xe'));_0x1d407b(_0x11b731[_0x25a2('0x13')][_0x25a2('0x12')]);}})[_0x25a2('0x14')](function(_0x14e76c){logger[_0x25a2('0xf')]('Trigger,\x20%s,\x20%s',_0x99fea7,_0x14e76c);_0x5a6ff3(_0x14e76c);});});}exports[_0x25a2('0x15')]=function(_0x4fc95b){var _0x3b34f7=this;return new Promise(function(_0x566a3f,_0x33a903){return db[_0x25a2('0x16')][_0x25a2('0x17')]({'raw':_0x4fc95b['options']?_0x4fc95b[_0x25a2('0x18')][_0x25a2('0x19')]===undefined?!![]:![]:!![],'where':_0x4fc95b[_0x25a2('0x18')]?_0x4fc95b[_0x25a2('0x18')][_0x25a2('0x1a')]||null:null,'attributes':_0x4fc95b[_0x25a2('0x18')]?_0x4fc95b[_0x25a2('0x18')]['attributes']||null:null,'limit':_0x4fc95b[_0x25a2('0x18')]?_0x4fc95b['options'][_0x25a2('0x1b')]||null:null,'include':_0x4fc95b['options']?_0x4fc95b[_0x25a2('0x18')][_0x25a2('0x1c')]?_[_0x25a2('0x1d')](_0x4fc95b['options'][_0x25a2('0x1c')],function(_0x2f0669){return{'model':db[_0x2f0669[_0x25a2('0x1e')]],'as':_0x2f0669['as'],'attributes':_0x2f0669['attributes'],'include':_0x2f0669[_0x25a2('0x1c')]?_[_0x25a2('0x1d')](_0x2f0669[_0x25a2('0x1c')],function(_0x300fd0){return{'model':db[_0x300fd0[_0x25a2('0x1e')]],'as':_0x300fd0['as'],'attributes':_0x300fd0[_0x25a2('0x1f')],'include':_0x300fd0['include']?_[_0x25a2('0x1d')](_0x300fd0[_0x25a2('0x1c')],function(_0x1e1896){return{'model':db[_0x1e1896[_0x25a2('0x1e')]],'as':_0x1e1896['as'],'attributes':_0x1e1896['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54f86e){logger['info'](_0x25a2('0x15'),_0x4fc95b);logger[_0x25a2('0x20')]('GetTrigger',_0x4fc95b,JSON['stringify'](_0x54f86e));_0x566a3f(_0x54f86e);})[_0x25a2('0x14')](function(_0x261623){logger[_0x25a2('0xf')](_0x25a2('0x15'),_0x261623[_0x25a2('0x12')],_0x4fc95b);_0x33a903(_0x3b34f7[_0x25a2('0xf')](0x1f4,_0x261623[_0x25a2('0x12')]));});});};exports[_0x25a2('0x21')]=function(_0x130025){var _0x106883=this;return new Promise(function(_0x51c3b4,_0x523551){return db[_0x25a2('0x16')][_0x25a2('0x22')]({'raw':_0x130025[_0x25a2('0x18')]?_0x130025[_0x25a2('0x18')][_0x25a2('0x19')]===undefined?!![]:![]:!![],'where':_0x130025[_0x25a2('0x18')]?_0x130025['options'][_0x25a2('0x1a')]||null:null,'attributes':_0x130025[_0x25a2('0x18')]?_0x130025[_0x25a2('0x18')][_0x25a2('0x1f')]||null:null,'include':_0x130025['options']?_0x130025[_0x25a2('0x18')][_0x25a2('0x1c')]?_[_0x25a2('0x1d')](_0x130025[_0x25a2('0x18')][_0x25a2('0x1c')],function(_0x47a641){return{'model':db[_0x47a641[_0x25a2('0x1e')]],'as':_0x47a641['as'],'attributes':_0x47a641[_0x25a2('0x1f')],'include':_0x47a641[_0x25a2('0x1c')]?_[_0x25a2('0x1d')](_0x47a641['include'],function(_0x5714a7){return{'model':db[_0x5714a7[_0x25a2('0x1e')]],'as':_0x5714a7['as'],'attributes':_0x5714a7[_0x25a2('0x1f')],'include':_0x5714a7[_0x25a2('0x1c')]?_[_0x25a2('0x1d')](_0x5714a7[_0x25a2('0x1c')],function(_0x5753fa){return{'model':db[_0x5753fa[_0x25a2('0x1e')]],'as':_0x5753fa['as'],'attributes':_0x5753fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24374c){logger[_0x25a2('0xd')](_0x25a2('0x21'),_0x130025);logger['debug']('ShowTrigger',_0x130025,JSON['stringify'](_0x24374c));_0x51c3b4(_0x24374c);})['catch'](function(_0x94ed36){logger[_0x25a2('0xf')](_0x25a2('0x21'),_0x94ed36[_0x25a2('0x12')],_0x130025);_0x523551(_0x106883['error'](0x1f4,_0x94ed36[_0x25a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 9b9ac0d..5c1da0d 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 _0x0d70=['clone','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0d70,0xe1));var _0x00d7=function(_0x119ef1,_0x17c4e5){_0x119ef1=_0x119ef1-0x0;var _0x33fcc5=_0x0d70[_0x119ef1];return _0x33fcc5;};'use strict';var multer=require('multer');var util=require(_0x00d7('0x0'));var path=require(_0x00d7('0x1'));var timeout=require(_0x00d7('0x2'));var express=require(_0x00d7('0x3'));var router=express[_0x00d7('0x4')]();var fs_extra=require(_0x00d7('0x5'));var auth=require(_0x00d7('0x6'));var interaction=require(_0x00d7('0x7'));var config=require(_0x00d7('0x8'));var controller=require(_0x00d7('0x9'));router[_0x00d7('0xa')]('/',auth[_0x00d7('0xb')](),controller[_0x00d7('0xc')]);router[_0x00d7('0xa')](_0x00d7('0xd'),auth[_0x00d7('0xb')](),controller[_0x00d7('0xe')]);router[_0x00d7('0xf')](_0x00d7('0x10'),auth[_0x00d7('0xb')](),controller[_0x00d7('0x11')]);router[_0x00d7('0xf')]('/',auth[_0x00d7('0xb')](),controller[_0x00d7('0x12')]);router[_0x00d7('0x13')](_0x00d7('0xd'),auth[_0x00d7('0xb')](),controller[_0x00d7('0x14')]);router[_0x00d7('0x15')](_0x00d7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xab10=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','create','put','update','delete','destroy'];(function(_0x49e247,_0x16d49d){var _0x19e8df=function(_0x1303f8){while(--_0x1303f8){_0x49e247['push'](_0x49e247['shift']());}};_0x19e8df(++_0x16d49d);}(_0xab10,0x94));var _0x0ab1=function(_0x576cc9,_0x3a8550){_0x576cc9=_0x576cc9-0x0;var _0x3d2ad4=_0xab10[_0x576cc9];return _0x3d2ad4;};'use strict';var multer=require(_0x0ab1('0x0'));var util=require(_0x0ab1('0x1'));var path=require(_0x0ab1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab1('0x3'));var router=express[_0x0ab1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab1('0x5'));var interaction=require(_0x0ab1('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab1('0x7'));router[_0x0ab1('0x8')]('/',auth[_0x0ab1('0x9')](),controller[_0x0ab1('0xa')]);router['get'](_0x0ab1('0xb'),auth[_0x0ab1('0x9')](),controller[_0x0ab1('0xc')]);router[_0x0ab1('0xd')](_0x0ab1('0xe'),auth[_0x0ab1('0x9')](),controller['clone']);router['post']('/',auth[_0x0ab1('0x9')](),controller[_0x0ab1('0xf')]);router[_0x0ab1('0x10')](_0x0ab1('0xb'),auth[_0x0ab1('0x9')](),controller[_0x0ab1('0x11')]);router[_0x0ab1('0x12')](_0x0ab1('0xb'),auth['isAuthenticated'](),controller[_0x0ab1('0x13')]);module[_0x0ab1('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3f48022..6c65fd3 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 _0x7fb3=['yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','update,nonat','name','ENUM','friend','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband'];(function(_0xafcd29,_0x316aa5){var _0x4bb909=function(_0x3a9a55){while(--_0x3a9a55){_0xafcd29['push'](_0xafcd29['shift']());}};_0x4bb909(++_0x316aa5);}(_0x7fb3,0x16d));var _0x37fb=function(_0x2130f1,_0x4dbcba){_0x2130f1=_0x2130f1-0x0;var _0x3e4b16=_0x7fb3[_0x2130f1];return _0x3e4b16;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37fb('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x2'),'user',_0x37fb('0x3')),'allowNull':![],'defaultValue':_0x37fb('0x2')},'context':{'type':Sequelize[_0x37fb('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x37fb('0x1')]('ALLOWED_NOT_SCREENED',_0x37fb('0x5'),'ALLOWED_FAILED_SCREEN',_0x37fb('0x6'),'PROHIB_NOT_SCREENED',_0x37fb('0x7'),_0x37fb('0x8'),_0x37fb('0x9'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x37fb('0x4')]},'secret':{'type':Sequelize[_0x37fb('0x4')]},'md5secret':{'type':Sequelize[_0x37fb('0x4')]},'remotesecret':{'type':Sequelize[_0x37fb('0x4')]},'transport':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'udp','set':function(_0x1aeee8){this['setDataValue'](_0x37fb('0xa'),_0x1aeee8?_0x1aeee8[_0x37fb('0xb')](','):null);},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0xa'))?this[_0x37fb('0xc')](_0x37fb('0xa'))[_0x37fb('0xd')](','):null;},'comment':_0x37fb('0xe')},'dtmfmode':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0xf'),_0x37fb('0x10'),_0x37fb('0x11'),_0x37fb('0x12'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x14'),_0x37fb('0x15'),_0x37fb('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x37fb('0x4')]},'directmediadeny':{'type':Sequelize[_0x37fb('0x4')]},'nat':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x17'),'set':function(_0x5916a1){this[_0x37fb('0x18')](_0x37fb('0x19'),_0x5916a1?_0x5916a1[_0x37fb('0xb')](','):null);},'get':function(){return this['getDataValue'](_0x37fb('0x19'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x37fb('0x1a')},'callgroup':{'type':Sequelize[_0x37fb('0x4')]},'namedcallgroup':{'type':Sequelize[_0x37fb('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x37fb('0x4')]},'language':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x37fb('0x1b')},'allow':{'type':Sequelize[_0x37fb('0x4')],'allowNull':![],'defaultValue':_0x37fb('0x1c'),'set':function(_0x3328a4){this[_0x37fb('0x18')](_0x37fb('0x1d'),_0x3328a4?_0x3328a4[_0x37fb('0xb')](';'):_0x37fb('0x1c'));},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0x1d'))?this[_0x37fb('0xc')](_0x37fb('0x1d'))[_0x37fb('0xd')](';'):null;},'comment':_0x37fb('0x1e')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x1f'),'set':function(_0x132130){this['setDataValue'](_0x37fb('0x20'),_0x132130?_0x132130['join'](','):null);},'get':function(){return this[_0x37fb('0xc')](_0x37fb('0x20'))?this[_0x37fb('0xc')](_0x37fb('0x20'))[_0x37fb('0xd')](','):null;},'comment':_0x37fb('0x21')},'trustrpid':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x37fb('0x1')]('yes','no',_0x37fb('0x22'))},'promiscredir':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x37fb('0x4')]},'callerid':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':_0x37fb('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':_0x37fb('0x13')},'busylevel':{'type':Sequelize[_0x37fb('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x37fb('0x4')]},'template':{'type':Sequelize[_0x37fb('0x4')]},'videosupport':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'mailbox':{'type':Sequelize[_0x37fb('0x4')]},'session_timers':{'type':Sequelize['ENUM'](_0x37fb('0x26'),_0x37fb('0x27'),_0x37fb('0x28'))},'session_expires':{'type':Sequelize[_0x37fb('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x37fb('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x37fb('0x1')]('uac',_0x37fb('0x29')),'defaultValue':_0x37fb('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x37fb('0x4')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x37fb('0x4')]},'port':{'type':Sequelize[_0x37fb('0x24')](0x5)},'qualify':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':_0x37fb('0x13')},'keepalive':{'type':Sequelize[_0x37fb('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x37fb('0x4')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x37fb('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x37fb('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x37fb('0x4')]},'timert1':{'type':Sequelize[_0x37fb('0x24')](0xb)},'timerb':{'type':Sequelize[_0x37fb('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x37fb('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x37fb('0x4')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x37fb('0x4')]},'unsolicited_mailbox':{'type':Sequelize[_0x37fb('0x4')]},'use_q850_reason':{'type':Sequelize[_0x37fb('0x4')]},'maxforwards':{'type':Sequelize[_0x37fb('0x24')](0xb)},'encryption':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x37fb('0x13'),'no')},'force_avp':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'icesupport':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x2b'),_0x37fb('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x37fb('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x37fb('0x4')]},'dtlsprivatekey':{'type':Sequelize[_0x37fb('0x4')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x37fb('0x4')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x2d'),_0x37fb('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x37fb('0x4')]},'usereqphone':{'type':Sequelize[_0x37fb('0x1')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x37fb('0x4')]},'recordofffeature':{'type':Sequelize[_0x37fb('0x4')]},'call_limit':{'type':Sequelize[_0x37fb('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no')},'subscribemwi':{'type':Sequelize[_0x37fb('0x1')]('yes','no')},'vmexten':{'type':Sequelize[_0x37fb('0x4')]},'mohinterpret':{'type':Sequelize[_0x37fb('0x4')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x37fb('0x4')]},'description':{'type':Sequelize[_0x37fb('0x4')]},'host':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x37fb('0x1')](_0x37fb('0x13'),'no',_0x37fb('0x14'),_0x37fb('0x15'),_0x37fb('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x37fb('0x4')]},'otherFields':{'type':Sequelize[_0x37fb('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x37fb('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0x2bd4=['\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','certificate','active','passive','actpass','nonat','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','rfc2833','shortinfo','inband','auto','yes','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x91ec87,_0x309f89){var _0x230e0f=function(_0x24bb67){while(--_0x24bb67){_0x91ec87['push'](_0x91ec87['shift']());}};_0x230e0f(++_0x309f89);}(_0x2bd4,0xdf));var _0x42bd=function(_0x415dce,_0x2f9b36){_0x415dce=_0x415dce-0x0;var _0x133482=_0x2bd4[_0x415dce];return _0x133482;};'use strict';var Sequelize=require(_0x42bd('0x0'));module[_0x42bd('0x1')]={'name':{'type':Sequelize[_0x42bd('0x2')],'allowNull':![],'unique':_0x42bd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x5'),_0x42bd('0x6'),_0x42bd('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x8'),_0x42bd('0x9'),_0x42bd('0xa'),_0x42bd('0xb'),_0x42bd('0xc'),_0x42bd('0xd'),_0x42bd('0xe'),_0x42bd('0xf'))},'deny':{'type':Sequelize[_0x42bd('0x2')]},'permit':{'type':Sequelize[_0x42bd('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x42bd('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x42bd('0x2')],'defaultValue':_0x42bd('0x10'),'set':function(_0x46c99){this[_0x42bd('0x11')]('transport',_0x46c99?_0x46c99[_0x42bd('0x12')](','):null);},'get':function(){return this[_0x42bd('0x13')](_0x42bd('0x14'))?this[_0x42bd('0x13')]('transport')[_0x42bd('0x15')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x16'),'info',_0x42bd('0x17'),_0x42bd('0x18'),_0x42bd('0x19')),'defaultValue':_0x42bd('0x16')},'directmedia':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x42bd('0x2')]},'nat':{'type':Sequelize[_0x42bd('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x1a7a39){this[_0x42bd('0x11')](_0x42bd('0x1b'),_0x1a7a39?_0x1a7a39['join'](','):null);},'get':function(){return this['getDataValue'](_0x42bd('0x1b'))?this['getDataValue'](_0x42bd('0x1b'))[_0x42bd('0x15')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x42bd('0x2')]},'namedcallgroup':{'type':Sequelize[_0x42bd('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x42bd('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x42bd('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x42bd('0x2')],'defaultValue':_0x42bd('0x1c')},'allow':{'type':Sequelize[_0x42bd('0x2')],'allowNull':![],'defaultValue':_0x42bd('0x1d'),'set':function(_0x3e49e9){this[_0x42bd('0x11')]('allow',_0x3e49e9?_0x3e49e9['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x42bd('0x1e'))?this['getDataValue'](_0x42bd('0x1e'))['split'](';'):null;},'comment':_0x42bd('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x42bd('0x1a'),'no')},'insecure':{'type':Sequelize[_0x42bd('0x2')],'defaultValue':_0x42bd('0x20'),'set':function(_0x3202bd){this[_0x42bd('0x11')]('insecure',_0x3202bd?_0x3202bd[_0x42bd('0x12')](','):null);},'get':function(){return this[_0x42bd('0x13')](_0x42bd('0x21'))?this[_0x42bd('0x13')](_0x42bd('0x21'))[_0x42bd('0x15')](','):null;},'comment':_0x42bd('0x22')},'trustrpid':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x42bd('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no',_0x42bd('0x23'))},'promiscredir':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x42bd('0x24')](0xb)},'setvar':{'type':Sequelize[_0x42bd('0x2')]},'callerid':{'type':Sequelize[_0x42bd('0x2')],'defaultValue':_0x42bd('0x25')},'amaflags':{'type':Sequelize[_0x42bd('0x2')]},'callcounter':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no'),'defaultValue':_0x42bd('0x1a')},'busylevel':{'type':Sequelize[_0x42bd('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x42bd('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x42bd('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x42bd('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no',_0x42bd('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x42bd('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x42bd('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x42bd('0x27'),_0x42bd('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x42bd('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x42bd('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x42bd('0x29'),'uas'),'defaultValue':_0x42bd('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x42bd('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x42bd('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x42bd('0x24')](0x5)},'qualify':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x42bd('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x42bd('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x42bd('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x42bd('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x42bd('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x42bd('0x2')]},'timert1':{'type':Sequelize[_0x42bd('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x42bd('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x42bd('0x2')]},'contactdeny':{'type':Sequelize[_0x42bd('0x2')]},'contactacl':{'type':Sequelize[_0x42bd('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x42bd('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x42bd('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x42bd('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x42bd('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no','fingerprint',_0x42bd('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x42bd('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x42bd('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x42bd('0x2')]},'dtlscipher':{'type':Sequelize[_0x42bd('0x2')]},'dtlscafile':{'type':Sequelize[_0x42bd('0x2')]},'dtlscapath':{'type':Sequelize[_0x42bd('0x2')]},'dtlssetup':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x2d'),_0x42bd('0x2e'),_0x42bd('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x42bd('0x2')]},'usereqphone':{'type':Sequelize[_0x42bd('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x42bd('0x2')]},'recordofffeature':{'type':Sequelize[_0x42bd('0x2')]},'call_limit':{'type':Sequelize[_0x42bd('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x42bd('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x42bd('0x4')](_0x42bd('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x42bd('0x2')]},'mohinterpret':{'type':Sequelize[_0x42bd('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x42bd('0x2')]},'description':{'type':Sequelize[_0x42bd('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x42bd('0x1a'),'no',_0x42bd('0x30'),_0x42bd('0x31'),_0x42bd('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x42bd('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x42bd('0x2')],'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 92ab247..6201dd4 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x4d5b04,_0x256d30){var _0x2b12d7=function(_0x431c9c){while(--_0x431c9c){_0x4d5b04['push'](_0x4d5b04['shift']());}};_0x2b12d7(++_0x256d30);}(_0xdace,0xc5));var _0xedac=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xdace[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file +var _0x008c=['update','destroy','get','Trunks','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Trunk','findAll','show','params','includeAll','include','options','clone','find','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','server/files/templates/trunk.ejs','join','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x2ed51e,_0x20d606){var _0x44318c=function(_0x1df2bd){while(--_0x1df2bd){_0x2ed51e['push'](_0x2ed51e['shift']());}};_0x44318c(++_0x20d606);}(_0x008c,0x188));var _0xc008=function(_0x42d0ed,_0x91a115){_0x42d0ed=_0x42d0ed-0x0;var _0x3f63f6=_0x008c[_0x42d0ed];return _0x3f63f6;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];var jayson=require(_0xc008('0x18'));var client=jayson[_0xc008('0x19')][_0xc008('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x593f7a,_0x560e28,_0x33f44c,_0x50c1ab){return new BPromise(function(_0x25e13f,_0x4584e1){var _0x2073ef=_0x50c1ab||client;return _0x2073ef[_0xc008('0x1b')](_0x593f7a,_0x33f44c)[_0xc008('0x1c')](function(_0x5ee00b){logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));logger[_0xc008('0x1e')](_0xc008('0x1f'),_0x560e28,_0xc008('0x1d'),JSON['stringify'](_0x5ee00b));if(_0x5ee00b['error']){if(_0x5ee00b['error']['code']===0x1f4){logger[_0xc008('0x20')](_0xc008('0x21'),_0x560e28,_0x5ee00b['error'][_0xc008('0x22')]);return _0x4584e1(_0x5ee00b['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x560e28,_0x5ee00b[_0xc008('0x20')]['message']);return _0x25e13f(_0x5ee00b['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));_0x25e13f(_0x5ee00b[_0xc008('0x23')][_0xc008('0x22')]);}})[_0xc008('0x24')](function(_0x11cc75){logger[_0xc008('0x20')]('Trunk,\x20%s,\x20%s',_0x560e28,_0x11cc75);_0x4584e1(_0x11cc75);});});}function respondWithStatusCode(_0x459fd9,_0x5c85f2){_0x5c85f2=_0x5c85f2||0xcc;return function(_0x58a6ea){if(_0x58a6ea){return _0x459fd9[_0xc008('0x25')](_0x5c85f2);}return _0x459fd9[_0xc008('0x26')](_0x5c85f2)[_0xc008('0x27')]();};}function respondWithResult(_0x3cb28c,_0x5410f5){_0x5410f5=_0x5410f5||0xc8;return function(_0x48582b){if(_0x48582b){return _0x3cb28c['status'](_0x5410f5)[_0xc008('0x28')](_0x48582b);}};}function respondWithFilteredResult(_0x15dade,_0x92c582){return function(_0x2e31c2){if(_0x2e31c2){var _0x5bebd9=typeof _0x92c582['offset']==='undefined'&&typeof _0x92c582['limit']==='undefined';var _0x3865c0=_0x2e31c2[_0xc008('0x29')];var _0x25eae4=_0x5bebd9?0x0:_0x92c582['offset'];var _0x24c14c=_0x5bebd9?_0x2e31c2[_0xc008('0x29')]:_0x92c582[_0xc008('0x2a')]+_0x92c582[_0xc008('0x2b')];var _0x4c5dec;if(_0x24c14c>=_0x3865c0){_0x24c14c=_0x3865c0;_0x4c5dec=0xc8;}else{_0x4c5dec=0xce;}_0x15dade[_0xc008('0x26')](_0x4c5dec);return _0x15dade[_0xc008('0x2c')]('Content-Range',_0x25eae4+'-'+_0x24c14c+'/'+_0x3865c0)['json'](_0x2e31c2);}return null;};}function patchUpdates(_0x539766){return function(_0x1032b2){try{jsonpatch[_0xc008('0x2d')](_0x1032b2,_0x539766,!![]);}catch(_0xf831f2){return BPromise[_0xc008('0x2e')](_0xf831f2);}return _0x1032b2[_0xc008('0x2f')]();};}function saveUpdates(_0xceebc3,_0x294f97){return function(_0x22d8e8){if(_0x22d8e8){return _0x22d8e8[_0xc008('0x30')](_0xceebc3)[_0xc008('0x1c')](function(_0x2f4b6b){return _0x2f4b6b;});}return null;};}function removeEntity(_0x1ac7c8,_0x596ee8){return function(_0x334a09){if(_0x334a09){return _0x334a09[_0xc008('0x31')]()['then'](function(){var _0xaf4b84=_0x334a09[_0xc008('0x32')]({'plain':!![]});var _0x383be7=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x31')]({'where':{'type':_0x383be7,'resourceId':_0xaf4b84['id']}})[_0xc008('0x1c')](function(){return _0x334a09;});})[_0xc008('0x1c')](function(){_0x1ac7c8[_0xc008('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415b87,_0x389a40){return function(_0x459df4){if(!_0x459df4){_0x415b87[_0xc008('0x25')](0x194);}return _0x459df4;};}function handleError(_0x40002f,_0x315562){_0x315562=_0x315562||0x1f4;return function(_0x1667a0){logger['error'](_0x1667a0[_0xc008('0x35')]);if(_0x1667a0[_0xc008('0x36')]){delete _0x1667a0['name'];}_0x40002f[_0xc008('0x26')](_0x315562)[_0xc008('0x37')](_0x1667a0);};}exports['index']=function(_0x263473,_0x2e4ae1){var _0x280e9b={},_0x55ff48={},_0x53b353={'count':0x0,'rows':[]};var _0x478810=_[_0xc008('0x38')](db['Trunk'][_0xc008('0x39')],function(_0x3884dd){return{'name':_0x3884dd[_0xc008('0x3a')],'type':_0x3884dd[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x55ff48[_0xc008('0x3d')]=_[_0xc008('0x38')](_0x478810,_0xc008('0x36'));_0x55ff48[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x263473[_0xc008('0x3e')]);_0x55ff48[_0xc008('0x40')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],_0x55ff48['query']);_0x280e9b[_0xc008('0x42')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x263473['query'][_0xc008('0x43')]));_0x280e9b[_0xc008('0x42')]=_0x280e9b[_0xc008('0x42')][_0xc008('0x44')]?_0x280e9b[_0xc008('0x42')]:_0x55ff48['model'];if(!_0x263473[_0xc008('0x3e')][_0xc008('0x45')](_0xc008('0x46'))){_0x280e9b[_0xc008('0x2b')]=qs[_0xc008('0x2b')](_0x263473['query'][_0xc008('0x2b')]);_0x280e9b[_0xc008('0x2a')]=qs[_0xc008('0x2a')](_0x263473[_0xc008('0x3e')]['offset']);}_0x280e9b[_0xc008('0x47')]=qs[_0xc008('0x48')](_0x263473[_0xc008('0x3e')]['sort']);_0x280e9b[_0xc008('0x49')]=qs['filters'](_[_0xc008('0x4a')](_0x263473['query'],_0x55ff48[_0xc008('0x40')]),_0x478810);if(_0x263473[_0xc008('0x3e')]['filter']){_0x280e9b[_0xc008('0x49')]=_[_0xc008('0x4b')](_0x280e9b[_0xc008('0x49')],{'$or':_['map'](_0x478810,function(_0x1cec64){if(_0x1cec64[_0xc008('0x3b')]!==_0xc008('0x4c')){var _0x44fc5d={};_0x44fc5d[_0x1cec64[_0xc008('0x36')]]={'$like':'%'+_0x263473[_0xc008('0x3e')]['filter']+'%'};return _0x44fc5d;}})});}_0x280e9b=_['merge']({},_0x280e9b,_0x263473['options']);var _0x4552ed={'where':_0x280e9b[_0xc008('0x49')]};return db[_0xc008('0x4d')][_0xc008('0x29')](_0x4552ed)[_0xc008('0x1c')](function(_0x24f6a4){_0x53b353[_0xc008('0x29')]=_0x24f6a4;if(_0x263473[_0xc008('0x3e')]['includeAll']){_0x280e9b['include']=[{'all':!![]}];}return db['Trunk'][_0xc008('0x4e')](_0x280e9b);})[_0xc008('0x1c')](function(_0x158eae){_0x53b353['rows']=_0x158eae;return _0x53b353;})[_0xc008('0x1c')](respondWithFilteredResult(_0x2e4ae1,_0x280e9b))[_0xc008('0x24')](handleError(_0x2e4ae1,null));};exports[_0xc008('0x4f')]=function(_0x1c2c50,_0x4981b4){var _0x56e4ac={'raw':![],'where':{'id':_0x1c2c50[_0xc008('0x50')]['id']}},_0x17ec90={};_0x17ec90[_0xc008('0x3d')]=_[_0xc008('0x3f')](db['Trunk']['rawAttributes']);_0x17ec90[_0xc008('0x3e')]=_['keys'](_0x1c2c50[_0xc008('0x3e')]);_0x17ec90[_0xc008('0x40')]=_[_0xc008('0x41')](_0x17ec90['model'],_0x17ec90[_0xc008('0x3e')]);_0x56e4ac[_0xc008('0x42')]=_[_0xc008('0x41')](_0x17ec90[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x1c2c50['query'][_0xc008('0x43')]));_0x56e4ac[_0xc008('0x42')]=_0x56e4ac['attributes'][_0xc008('0x44')]?_0x56e4ac[_0xc008('0x42')]:_0x17ec90['model'];if(_0x1c2c50['query'][_0xc008('0x51')]){_0x56e4ac[_0xc008('0x52')]=[{'all':!![]}];}_0x56e4ac=_[_0xc008('0x4b')]({},_0x56e4ac,_0x1c2c50[_0xc008('0x53')]);return db[_0xc008('0x4d')]['find'](_0x56e4ac)['then'](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1c')](respondWithResult(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports[_0xc008('0x54')]=function(_0x25d351,_0xf94fcb){var _0x2f1105={'where':{'id':_0x25d351[_0xc008('0x50')]['id']}},_0x44f42d={};_0x44f42d['model']=_[_0xc008('0x3f')](db[_0xc008('0x4d')][_0xc008('0x39')]);_0x2f1105[_0xc008('0x42')]=_[_0xc008('0x41')](_0x44f42d['model'],qs[_0xc008('0x43')](_0x25d351['query']['fields']));_0x2f1105['attributes']=_0x2f1105[_0xc008('0x42')][_0xc008('0x44')]?_0x2f1105[_0xc008('0x42')]:_0x44f42d['model'];if(_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]){_0x2f1105[_0xc008('0x52')]=[{'all':!![]}];}_0x2f1105=_['merge']({},_0x2f1105,_0x25d351[_0xc008('0x53')]);return db[_0xc008('0x4d')][_0xc008('0x55')](_0x2f1105)[_0xc008('0x1c')](handleEntityNotFound(_0xf94fcb,null))['then'](function(_0x4022dd){if(_0x4022dd){var _0x4eaa6d=_0x4022dd[_0xc008('0x32')]({'plain':!![]});_0x4eaa6d=qs[_0xc008('0x56')](_0x4eaa6d,['id',_0xc008('0x57'),_0xc008('0x58')]);_0x25d351[_0xc008('0x59')]=_[_0xc008('0x56')](_0x25d351['body'],['id',_0xc008('0x57'),'updatedAt']);return db['Trunk'][_0xc008('0x5a')](_[_0xc008('0x4b')](_0x4eaa6d,_0x25d351['body']),{'include':_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]?[{'all':!![]}]:undefined})[_0xc008('0x1c')](function(_0x4517c0){var _0x21ee6d=_0x25d351[_0xc008('0x5b')][_0xc008('0x32')]({'plain':!![]});if(!_0x21ee6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ee6d[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x3bfb15=_0x4517c0[_0xc008('0x32')]({'plain':!![]});var _0xb3ca0f=_0xc008('0x33');return db[_0xc008('0x5d')][_0xc008('0x55')]({'where':{'name':_0xb3ca0f,'userProfileId':_0x21ee6d[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x1bef66){if(_0x1bef66&&_0x1bef66[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x3bfb15['name'],'resourceId':_0x3bfb15['id'],'type':_0x1bef66[_0xc008('0x36')],'sectionId':_0x1bef66['id']},{})[_0xc008('0x1c')](function(){return _0x4517c0;});}else{return _0x4517c0;}})[_0xc008('0x24')](function(_0x566dea){logger[_0xc008('0x20')](_0xc008('0x60'),_0x566dea);throw _0x566dea;});}return _0x4517c0;});}})['then'](respondWithResult(_0xf94fcb,0xc9))['catch'](handleError(_0xf94fcb,null));};exports[_0xc008('0x5a')]=function(_0x2a4c2b,_0x7bad14,_0x39083c){var _0x1a2ce7;return db[_0xc008('0x4d')][_0xc008('0x5a')](_0x2a4c2b[_0xc008('0x59')],{'raw':!![]})[_0xc008('0x1c')](function(_0x1b059b){_0x1a2ce7=_0x1b059b;return db[_0xc008('0x4d')]['findAll']({'raw':!![]});})[_0xc008('0x1c')](function(_0x25a52b){var _0xfdb5e3=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],'server/files/templates/trunk.ejs'),_0xc008('0x63'));var _0x46fa7b=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x64')),_0xc008('0x63'));var _0x553f5c=ejs[_0xc008('0x65')](_0xfdb5e3,{'trunks':_0x25a52b||[]});fs['writeFileSync'](_0xc008('0x66'),_0x553f5c);if(_0x1a2ce7[_0xc008('0x67')]){var _0x23012c=ejs[_0xc008('0x65')](_0x46fa7b,{'trunks':_0x25a52b||[]});fs[_0xc008('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x23012c);}})[_0xc008('0x1c')](function(){return respondWithRpcPromise(_0xc008('0x69'),'create',{'module':_0xc008('0x6a')});})['then'](function(){var _0x278cbe=_0x2a4c2b['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x278cbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278cbe[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x33d8e4=_0x1a2ce7[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x55')]({'where':{'name':_0xc008('0x33'),'userProfileId':_0x278cbe[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x321500){if(_0x321500&&_0x321500[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x33d8e4['name'],'resourceId':_0x33d8e4['id'],'type':_0x321500[_0xc008('0x36')],'sectionId':_0x321500['id']},{})['then'](function(){return _0x1a2ce7;});}else{return _0x1a2ce7;}})['catch'](function(_0x4c84da){logger[_0xc008('0x20')](_0xc008('0x60'),_0x4c84da);throw _0x4c84da;});}return _0x1a2ce7;})[_0xc008('0x1c')](respondWithResult(_0x7bad14,0xc9))[_0xc008('0x24')](handleError(_0x7bad14,null));};exports[_0xc008('0x30')]=function(_0x2e9646,_0x23ef42,_0x519328){var _0x127bdf;return db['Trunk'][_0xc008('0x55')]({'where':{'id':_0x2e9646[_0xc008('0x50')]['id']}})[_0xc008('0x1c')](handleEntityNotFound(_0x23ef42,null))[_0xc008('0x1c')](saveUpdates(_0x2e9646[_0xc008('0x59')],null))[_0xc008('0x1c')](function(_0x23d4ff){if(_0x23d4ff){_0x127bdf=_0x23d4ff;return db[_0xc008('0x4d')][_0xc008('0x4e')]({'raw':!![]});}})[_0xc008('0x1c')](function(_0x334ed8){if(_0x334ed8){var _0x1dd9fe=fs['readFileSync'](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x572d93=fs[_0xc008('0x61')](path[_0xc008('0x6c')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3fc44f=ejs[_0xc008('0x65')](_0x1dd9fe,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x66'),_0x3fc44f);var _0x1101b8=ejs[_0xc008('0x65')](_0x572d93,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x6d'),_0x1101b8);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x30'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc644fe){if(_0xc644fe){return _0x127bdf;}})[_0xc008('0x1c')](respondWithResult(_0x23ef42,null))[_0xc008('0x24')](handleError(_0x23ef42,null));};exports[_0xc008('0x31')]=function(_0x2b94b2,_0x37fc2c,_0x4b434f){var _0x5794fe;return db[_0xc008('0x4d')][_0xc008('0x55')]({'where':{'id':_0x2b94b2[_0xc008('0x50')]['id']}})['then'](handleEntityNotFound(_0x37fc2c,null))['then'](removeEntity(_0x37fc2c,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x276de2){var _0x52bf60=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x5bc8b0=fs['readFileSync'](path[_0xc008('0x6c')](config['root'],_0xc008('0x64')),_0xc008('0x63'));var _0x544519=ejs[_0xc008('0x65')](_0x52bf60,{'trunks':_0x276de2});var _0x4db90b=ejs['render'](_0x5bc8b0,{'trunks':_0x276de2});fs[_0xc008('0x68')](_0xc008('0x66'),_0x544519);fs['writeFileSync'](_0xc008('0x6d'),_0x4db90b);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x31'),{'module':'chan_sip.so'});})[_0xc008('0x24')](handleError(_0x37fc2c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a5c9295..b597f44 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 _0x1c47=['tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','Trunk'];(function(_0x472cd4,_0x92fd52){var _0x496b32=function(_0xbe3132){while(--_0xbe3132){_0x472cd4['push'](_0x472cd4['shift']());}};_0x496b32(++_0x92fd52);}(_0x1c47,0x7a));var _0x71c4=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x1c47[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0x71c4('0x0'));var logger=require(_0x71c4('0x1'))(_0x71c4('0x2'));var moment=require(_0x71c4('0x3'));var BPromise=require(_0x71c4('0x4'));var rp=require(_0x71c4('0x5'));var fs=require('fs');var path=require(_0x71c4('0x6'));var rimraf=require(_0x71c4('0x7'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module['exports']=function(_0x535299,_0x5ad203){return _0x535299[_0x71c4('0x8')](_0x71c4('0x9'),attributes,{'tableName':_0x71c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea61=['rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x221f71,_0x221c04){var _0x2df2e5=function(_0x242926){while(--_0x242926){_0x221f71['push'](_0x221f71['shift']());}};_0x2df2e5(++_0x221c04);}(_0xea61,0xd8));var _0x1ea6=function(_0x7adc6,_0x5406cb){_0x7adc6=_0x7adc6-0x0;var _0x472fbb=_0xea61[_0x7adc6];return _0x472fbb;};'use strict';var _=require(_0x1ea6('0x0'));var util=require(_0x1ea6('0x1'));var logger=require(_0x1ea6('0x2'))(_0x1ea6('0x3'));var moment=require(_0x1ea6('0x4'));var BPromise=require(_0x1ea6('0x5'));var rp=require(_0x1ea6('0x6'));var fs=require('fs');var path=require(_0x1ea6('0x7'));var rimraf=require(_0x1ea6('0x8'));var config=require(_0x1ea6('0x9'));var attributes=require(_0x1ea6('0xa'));module[_0x1ea6('0xb')]=function(_0x19bacb,_0x503340){return _0x19bacb['define'](_0x1ea6('0xc'),attributes,{'tableName':_0x1ea6('0xd'),'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 44cbefe..277f807 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 _0xa304=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Trunk','options','raw','attributes','limit','include','map','model','GetTrunk','stringify','catch','ShowTrunk','find','where','lodash','util'];(function(_0xff6599,_0x3d75a7){var _0x565d40=function(_0x5f470d){while(--_0x5f470d){_0xff6599['push'](_0xff6599['shift']());}};_0x565d40(++_0x3d75a7);}(_0xa304,0x1e8));var _0x4a30=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0xa304[_0x4ee9cd];return _0x328a5b;};'use strict';var _=require(_0x4a30('0x0'));var util=require(_0x4a30('0x1'));var moment=require('moment');var BPromise=require(_0x4a30('0x2'));var rs=require(_0x4a30('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a30('0x4'))['db'];var utils=require(_0x4a30('0x5'));var logger=require(_0x4a30('0x6'))('rpc');var config=require(_0x4a30('0x7'));var jayson=require(_0x4a30('0x8'));var client=jayson[_0x4a30('0x9')][_0x4a30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522263,_0x110ddb,_0x29535f){return new BPromise(function(_0x30d6f0,_0x2dcf62){return client[_0x4a30('0xb')](_0x522263,_0x29535f)[_0x4a30('0xc')](function(_0x1f0ac9){logger[_0x4a30('0xd')](_0x4a30('0xe'),_0x110ddb,_0x4a30('0xf'));logger[_0x4a30('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x110ddb,_0x4a30('0xf'),JSON['stringify'](_0x1f0ac9));if(_0x1f0ac9[_0x4a30('0x11')]){if(_0x1f0ac9['error'][_0x4a30('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x110ddb,_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);return _0x2dcf62(_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);}logger['error'](_0x4a30('0xe'),_0x110ddb,_0x1f0ac9['error'][_0x4a30('0x13')]);return _0x30d6f0(_0x1f0ac9[_0x4a30('0x11')][_0x4a30('0x13')]);}else{logger[_0x4a30('0xd')](_0x4a30('0xe'),_0x110ddb,_0x4a30('0xf'));_0x30d6f0(_0x1f0ac9[_0x4a30('0x14')][_0x4a30('0x13')]);}})['catch'](function(_0x1ad9de){logger['error']('Trunk,\x20%s,\x20%s',_0x110ddb,_0x1ad9de);_0x2dcf62(_0x1ad9de);});});}exports['GetTrunk']=function(_0x19bbcc){var _0xab9de3=this;return new Promise(function(_0x2e6a44,_0x36a59b){return db[_0x4a30('0x15')]['findAll']({'raw':_0x19bbcc['options']?_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x17')]===undefined?!![]:![]:!![],'where':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options']['where']||null:null,'attributes':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x18')]||null:null,'limit':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options'][_0x4a30('0x19')]||null:null,'include':_0x19bbcc[_0x4a30('0x16')]?_0x19bbcc['options'][_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x19bbcc[_0x4a30('0x16')][_0x4a30('0x1a')],function(_0x4bb5d9){return{'model':db[_0x4bb5d9[_0x4a30('0x1c')]],'as':_0x4bb5d9['as'],'attributes':_0x4bb5d9[_0x4a30('0x18')],'include':_0x4bb5d9[_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x4bb5d9[_0x4a30('0x1a')],function(_0x1d2cfd){return{'model':db[_0x1d2cfd['model']],'as':_0x1d2cfd['as'],'attributes':_0x1d2cfd[_0x4a30('0x18')],'include':_0x1d2cfd[_0x4a30('0x1a')]?_['map'](_0x1d2cfd[_0x4a30('0x1a')],function(_0x2a838b){return{'model':db[_0x2a838b['model']],'as':_0x2a838b['as'],'attributes':_0x2a838b[_0x4a30('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4a30('0xc')](function(_0x56eb2a){logger[_0x4a30('0xd')]('GetTrunk',_0x19bbcc);logger[_0x4a30('0x10')](_0x4a30('0x1d'),_0x19bbcc,JSON[_0x4a30('0x1e')](_0x56eb2a));_0x2e6a44(_0x56eb2a);})[_0x4a30('0x1f')](function(_0x6697d6){logger[_0x4a30('0x11')](_0x4a30('0x1d'),_0x6697d6[_0x4a30('0x13')],_0x19bbcc);_0x36a59b(_0xab9de3[_0x4a30('0x11')](0x1f4,_0x6697d6[_0x4a30('0x13')]));});});};exports[_0x4a30('0x20')]=function(_0x153d74){var _0x44cd49=this;return new Promise(function(_0x4a2e62,_0x1e4dc5){return db[_0x4a30('0x15')][_0x4a30('0x21')]({'raw':_0x153d74[_0x4a30('0x16')]?_0x153d74['options'][_0x4a30('0x17')]===undefined?!![]:![]:!![],'where':_0x153d74[_0x4a30('0x16')]?_0x153d74[_0x4a30('0x16')][_0x4a30('0x22')]||null:null,'attributes':_0x153d74['options']?_0x153d74[_0x4a30('0x16')][_0x4a30('0x18')]||null:null,'include':_0x153d74['options']?_0x153d74[_0x4a30('0x16')][_0x4a30('0x1a')]?_[_0x4a30('0x1b')](_0x153d74[_0x4a30('0x16')][_0x4a30('0x1a')],function(_0xba5c6f){return{'model':db[_0xba5c6f[_0x4a30('0x1c')]],'as':_0xba5c6f['as'],'attributes':_0xba5c6f[_0x4a30('0x18')],'include':_0xba5c6f['include']?_[_0x4a30('0x1b')](_0xba5c6f['include'],function(_0x3bc30b){return{'model':db[_0x3bc30b[_0x4a30('0x1c')]],'as':_0x3bc30b['as'],'attributes':_0x3bc30b[_0x4a30('0x18')],'include':_0x3bc30b[_0x4a30('0x1a')]?_['map'](_0x3bc30b['include'],function(_0x4fed32){return{'model':db[_0x4fed32[_0x4a30('0x1c')]],'as':_0x4fed32['as'],'attributes':_0x4fed32[_0x4a30('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a01f9){logger['info']('ShowTrunk',_0x153d74);logger[_0x4a30('0x10')](_0x4a30('0x20'),_0x153d74,JSON['stringify'](_0x3a01f9));_0x4a2e62(_0x3a01f9);})[_0x4a30('0x1f')](function(_0xc84d45){logger['error'](_0x4a30('0x20'),_0xc84d45[_0x4a30('0x13')],_0x153d74);_0x1e4dc5(_0x44cd49['error'](0x1f4,_0xc84d45[_0x4a30('0x13')]));});});}; \ No newline at end of file +var _0x595c=['request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','model','include','map','debug','ShowTrunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s'];(function(_0x4f2500,_0x26ced7){var _0x3b0865=function(_0x10d7e8){while(--_0x10d7e8){_0x4f2500['push'](_0x4f2500['shift']());}};_0x3b0865(++_0x26ced7);}(_0x595c,0xb2));var _0xc595=function(_0x2a56d7,_0x5af5bd){_0x2a56d7=_0x2a56d7-0x0;var _0x251710=_0x595c[_0x2a56d7];return _0x251710;};'use strict';var _=require(_0xc595('0x0'));var util=require(_0xc595('0x1'));var moment=require(_0xc595('0x2'));var BPromise=require(_0xc595('0x3'));var rs=require(_0xc595('0x4'));var fs=require('fs');var Redis=require(_0xc595('0x5'));var db=require(_0xc595('0x6'))['db'];var utils=require(_0xc595('0x7'));var logger=require(_0xc595('0x8'))(_0xc595('0x9'));var config=require(_0xc595('0xa'));var jayson=require(_0xc595('0xb'));var client=jayson[_0xc595('0xc')][_0xc595('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x7480cb,_0x145bd0,_0x10e601){return new BPromise(function(_0x111629,_0x3afd27){return client['request'](_0x7480cb,_0x10e601)[_0xc595('0xe')](function(_0x19649a){logger[_0xc595('0xf')](_0xc595('0x10'),_0x145bd0,_0xc595('0x11'));logger['debug'](_0xc595('0x12'),_0x145bd0,'request\x20sent',JSON[_0xc595('0x13')](_0x19649a));if(_0x19649a[_0xc595('0x14')]){if(_0x19649a[_0xc595('0x14')][_0xc595('0x15')]===0x1f4){logger['error'](_0xc595('0x10'),_0x145bd0,_0x19649a[_0xc595('0x14')][_0xc595('0x16')]);return _0x3afd27(_0x19649a[_0xc595('0x14')][_0xc595('0x16')]);}logger[_0xc595('0x14')](_0xc595('0x10'),_0x145bd0,_0x19649a[_0xc595('0x14')]['message']);return _0x111629(_0x19649a['error'][_0xc595('0x16')]);}else{logger[_0xc595('0xf')](_0xc595('0x10'),_0x145bd0,'request\x20sent');_0x111629(_0x19649a[_0xc595('0x17')][_0xc595('0x16')]);}})[_0xc595('0x18')](function(_0x45a04d){logger['error'](_0xc595('0x10'),_0x145bd0,_0x45a04d);_0x3afd27(_0x45a04d);});});}exports[_0xc595('0x19')]=function(_0x3c6c99){var _0x3c8de8=this;return new Promise(function(_0x4587ac,_0x31772b){return db[_0xc595('0x1a')][_0xc595('0x1b')]({'raw':_0x3c6c99[_0xc595('0x1c')]?_0x3c6c99[_0xc595('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3c6c99['options']?_0x3c6c99['options'][_0xc595('0x1d')]||null:null,'attributes':_0x3c6c99[_0xc595('0x1c')]?_0x3c6c99[_0xc595('0x1c')][_0xc595('0x1e')]||null:null,'limit':_0x3c6c99[_0xc595('0x1c')]?_0x3c6c99[_0xc595('0x1c')][_0xc595('0x1f')]||null:null,'include':_0x3c6c99[_0xc595('0x1c')]?_0x3c6c99[_0xc595('0x1c')]['include']?_['map'](_0x3c6c99[_0xc595('0x1c')]['include'],function(_0xcc5b2c){return{'model':db[_0xcc5b2c[_0xc595('0x20')]],'as':_0xcc5b2c['as'],'attributes':_0xcc5b2c[_0xc595('0x1e')],'include':_0xcc5b2c[_0xc595('0x21')]?_[_0xc595('0x22')](_0xcc5b2c[_0xc595('0x21')],function(_0x476d2c){return{'model':db[_0x476d2c[_0xc595('0x20')]],'as':_0x476d2c['as'],'attributes':_0x476d2c[_0xc595('0x1e')],'include':_0x476d2c[_0xc595('0x21')]?_[_0xc595('0x22')](_0x476d2c[_0xc595('0x21')],function(_0x25e390){return{'model':db[_0x25e390['model']],'as':_0x25e390['as'],'attributes':_0x25e390[_0xc595('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10eed6){logger[_0xc595('0xf')]('GetTrunk',_0x3c6c99);logger[_0xc595('0x23')](_0xc595('0x19'),_0x3c6c99,JSON[_0xc595('0x13')](_0x10eed6));_0x4587ac(_0x10eed6);})[_0xc595('0x18')](function(_0x2bff7e){logger[_0xc595('0x14')](_0xc595('0x19'),_0x2bff7e[_0xc595('0x16')],_0x3c6c99);_0x31772b(_0x3c8de8[_0xc595('0x14')](0x1f4,_0x2bff7e[_0xc595('0x16')]));});});};exports[_0xc595('0x24')]=function(_0x590d65){var _0x3637d9=this;return new Promise(function(_0x100718,_0x5cb689){return db[_0xc595('0x1a')][_0xc595('0x25')]({'raw':_0x590d65['options']?_0x590d65[_0xc595('0x1c')][_0xc595('0x26')]===undefined?!![]:![]:!![],'where':_0x590d65[_0xc595('0x1c')]?_0x590d65[_0xc595('0x1c')]['where']||null:null,'attributes':_0x590d65[_0xc595('0x1c')]?_0x590d65[_0xc595('0x1c')][_0xc595('0x1e')]||null:null,'include':_0x590d65[_0xc595('0x1c')]?_0x590d65['options'][_0xc595('0x21')]?_['map'](_0x590d65['options'][_0xc595('0x21')],function(_0x188523){return{'model':db[_0x188523[_0xc595('0x20')]],'as':_0x188523['as'],'attributes':_0x188523[_0xc595('0x1e')],'include':_0x188523[_0xc595('0x21')]?_[_0xc595('0x22')](_0x188523[_0xc595('0x21')],function(_0x4d6cbf){return{'model':db[_0x4d6cbf[_0xc595('0x20')]],'as':_0x4d6cbf['as'],'attributes':_0x4d6cbf[_0xc595('0x1e')],'include':_0x4d6cbf['include']?_['map'](_0x4d6cbf[_0xc595('0x21')],function(_0x345750){return{'model':db[_0x345750[_0xc595('0x20')]],'as':_0x345750['as'],'attributes':_0x345750[_0xc595('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24fbb2){logger[_0xc595('0xf')](_0xc595('0x24'),_0x590d65);logger[_0xc595('0x23')](_0xc595('0x24'),_0x590d65,JSON[_0xc595('0x13')](_0x24fbb2));_0x100718(_0x24fbb2);})['catch'](function(_0x1b6dff){logger[_0xc595('0x14')]('ShowTrunk',_0x1b6dff[_0xc595('0x16')],_0x590d65);_0x5cb689(_0x3637d9[_0xc595('0x14')](0x1f4,_0x1b6dff[_0xc595('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 40df49a..c4cedc4 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 _0x6cd4=['/:id','isAuthenticated','update','exports'];(function(_0x4cac21,_0x5ed66e){var _0x49e5f0=function(_0x407902){while(--_0x407902){_0x4cac21['push'](_0x4cac21['shift']());}};_0x49e5f0(++_0x5ed66e);}(_0x6cd4,0x1c4));var _0x46cd=function(_0x5461c5,_0x3e0848){_0x5461c5=_0x5461c5-0x0;var _0x13b12f=_0x6cd4[_0x5461c5];return _0x13b12f;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put'](_0x46cd('0x0'),auth[_0x46cd('0x1')](),controller[_0x46cd('0x2')]);module[_0x46cd('0x3')]=router; \ No newline at end of file +var _0xb02d=['Router','./user-setting.controller','exports','express'];(function(_0x539316,_0x3e86d3){var _0x2200a6=function(_0x131bfc){while(--_0x131bfc){_0x539316['push'](_0x539316['shift']());}};_0x2200a6(++_0x3e86d3);}(_0xb02d,0x127));var _0xdb02=function(_0x4cdebd,_0x2c835b){_0x4cdebd=_0x4cdebd-0x0;var _0xcb1ad8=_0xb02d[_0x4cdebd];return _0xcb1ad8;};'use strict';var express=require(_0xdb02('0x0'));var router=express[_0xdb02('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xdb02('0x2'));router['put']('/:id',auth['isAuthenticated'](),controller['update']);module[_0xdb02('0x3')]=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 99b46d7..68a26de 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 _0xfbc3=['TEXT','DATE','sequelize','warning','info','debug','exports','ENUM','error','BOOLEAN'];(function(_0x3bad58,_0x45d5db){var _0xd5d092=function(_0x382664){while(--_0x382664){_0x3bad58['push'](_0x3bad58['shift']());}};_0xd5d092(++_0x45d5db);}(_0xfbc3,0x1e2));var _0x3fbc=function(_0x53fa9c,_0x398322){_0x53fa9c=_0x53fa9c-0x0;var _0x440439=_0xfbc3[_0x53fa9c];return _0x440439;};'use strict';var Sequelize=require(_0x3fbc('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x3fbc('0x1'),_0x3fbc('0x2'),_0x3fbc('0x3')];module[_0x3fbc('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3fbc('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3fbc('0x6'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3fbc('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3fbc('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3fbc('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0xb085=['debug','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error','warning'];(function(_0x127839,_0xfd216d){var _0x2b3b4e=function(_0x168488){while(--_0x168488){_0x127839['push'](_0x127839['shift']());}};_0x2b3b4e(++_0xfd216d);}(_0xb085,0x1e7));var _0x5b08=function(_0x310927,_0x377f88){_0x310927=_0x310927-0x0;var _0x459cb2=_0xb085[_0x310927];return _0x459cb2;};'use strict';var Sequelize=require(_0x5b08('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x5b08('0x1'),_0x5b08('0x2'),'info',_0x5b08('0x3')];module[_0x5b08('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5b08('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5b08('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5b08('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x5b08('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5b08('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x5b08('0x9')}}; \ 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 7e71abc..00eca46 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 _0xbd50=['params','UserSetting','find','then','body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','localhost','update','sendStatus','error','stack','name','status','send','user','role','Unauthorized'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x334ba9,_0x35409f){_0x334ba9=_0x334ba9-0x0;var _0x28361a=_0xbd50[_0x334ba9];return _0x28361a;};'use strict';var _=require(_0x0bd5('0x0'));var Redis=require(_0x0bd5('0x1'));var logger=require(_0x0bd5('0x2'))('api');var config=require(_0x0bd5('0x3'));var db=require(_0x0bd5('0x4'))['db'];var socket=require(_0x0bd5('0x5'))(new Redis(config[_0x0bd5('0x6')]));require(_0x0bd5('0x7'))['register'](socket);config['redis']=_['defaults'](config[_0x0bd5('0x6')],{'host':_0x0bd5('0x8'),'port':0x18eb});function respondWithResult(_0xcc6cfa,_0x2c0db1){_0x2c0db1=_0x2c0db1||0xc8;return function(_0x1b99f3){if(_0x1b99f3){return _0xcc6cfa['status'](_0x2c0db1)['json'](_0x1b99f3);}};}function saveUpdates(_0x1a5cb9){return function(_0x25e31e){if(_0x25e31e){return _0x25e31e[_0x0bd5('0x9')](_0x1a5cb9)['then'](function(_0xa98f54){return _0xa98f54;});}return null;};}function handleEntityNotFound(_0x2fa7d1){return function(_0x519bc6){if(!_0x519bc6){_0x2fa7d1[_0x0bd5('0xa')](0x194);}return _0x519bc6;};}function handleError(_0x7db86e,_0x4d7d17){_0x4d7d17=_0x4d7d17||0x1f4;return function(_0x1ce7dd){logger[_0x0bd5('0xb')](_0x1ce7dd[_0x0bd5('0xc')]);if(_0x1ce7dd['name']){delete _0x1ce7dd[_0x0bd5('0xd')];}_0x7db86e[_0x0bd5('0xe')](_0x4d7d17)[_0x0bd5('0xf')](_0x1ce7dd);};}exports[_0x0bd5('0x9')]=function(_0xfa1eed,_0x557be0){if(_0xfa1eed[_0x0bd5('0x10')][_0x0bd5('0x11')]!=='admin')throw new Error(_0x0bd5('0x12'));if(isNaN(Number(_0xfa1eed[_0x0bd5('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x0bd5('0x14')][_0x0bd5('0x15')]({'where':{'id':_0xfa1eed[_0x0bd5('0x13')]['id']}})[_0x0bd5('0x16')](handleEntityNotFound(_0x557be0,null))['then'](saveUpdates(_0xfa1eed[_0x0bd5('0x17')],null))[_0x0bd5('0x16')](respondWithResult(_0x557be0,null))[_0x0bd5('0x18')](handleError(_0x557be0,null));}; \ No newline at end of file +var _0xecd5=['socket.io-emitter','redis','./user-setting.socket','localhost','status','json','update','then','sendStatus','stack','name','send','role','admin','params','Invalid\x20user\x20setting\x20id','find','body','catch','ioredis','../../config/logger','api','../../mysqldb'];(function(_0x35e2d7,_0x39e854){var _0x405bff=function(_0x164dcd){while(--_0x164dcd){_0x35e2d7['push'](_0x35e2d7['shift']());}};_0x405bff(++_0x39e854);}(_0xecd5,0x110));var _0x5ecd=function(_0x1fc6c0,_0x4f42b0){_0x1fc6c0=_0x1fc6c0-0x0;var _0x42f92b=_0xecd5[_0x1fc6c0];return _0x42f92b;};'use strict';var _=require('lodash');var Redis=require(_0x5ecd('0x0'));var logger=require(_0x5ecd('0x1'))(_0x5ecd('0x2'));var config=require('../../config/environment');var db=require(_0x5ecd('0x3'))['db'];var socket=require(_0x5ecd('0x4'))(new Redis(config[_0x5ecd('0x5')]));require(_0x5ecd('0x6'))['register'](socket);config[_0x5ecd('0x5')]=_['defaults'](config[_0x5ecd('0x5')],{'host':_0x5ecd('0x7'),'port':0x18eb});function respondWithResult(_0x4a1870,_0x42c752){_0x42c752=_0x42c752||0xc8;return function(_0x26d951){if(_0x26d951){return _0x4a1870[_0x5ecd('0x8')](_0x42c752)[_0x5ecd('0x9')](_0x26d951);}};}function saveUpdates(_0x39c98f){return function(_0x3e9833){if(_0x3e9833){return _0x3e9833[_0x5ecd('0xa')](_0x39c98f)[_0x5ecd('0xb')](function(_0x340c6b){return _0x340c6b;});}return null;};}function handleEntityNotFound(_0x22781a){return function(_0x317051){if(!_0x317051){_0x22781a[_0x5ecd('0xc')](0x194);}return _0x317051;};}function handleError(_0x5a8b1c,_0x31685a){_0x31685a=_0x31685a||0x1f4;return function(_0x55c216){logger['error'](_0x55c216[_0x5ecd('0xd')]);if(_0x55c216[_0x5ecd('0xe')]){delete _0x55c216['name'];}_0x5a8b1c['status'](_0x31685a)[_0x5ecd('0xf')](_0x55c216);};}exports[_0x5ecd('0xa')]=function(_0x47cf02,_0x37bfe1){if(_0x47cf02['user'][_0x5ecd('0x10')]!==_0x5ecd('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x47cf02[_0x5ecd('0x12')]['id'])))throw new Error(_0x5ecd('0x13'));return db['UserSetting'][_0x5ecd('0x14')]({'where':{'id':_0x47cf02['params']['id']}})[_0x5ecd('0xb')](handleEntityNotFound(_0x37bfe1,null))[_0x5ecd('0xb')](saveUpdates(_0x47cf02[_0x5ecd('0x15')],null))[_0x5ecd('0xb')](respondWithResult(_0x37bfe1,null))[_0x5ecd('0x16')](handleError(_0x37bfe1,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 dab6179..d6c7fd2 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 _0x2023=['../../mysqldb','UserSetting','setMaxListeners','emit','hook'];(function(_0x208b1e,_0x5f4a61){var _0x574ff7=function(_0x2aa302){while(--_0x2aa302){_0x208b1e['push'](_0x208b1e['shift']());}};_0x574ff7(++_0x5f4a61);}(_0x2023,0x186));var _0x3202=function(_0x2926f1,_0x49f145){_0x2926f1=_0x2926f1-0x0;var _0xad4f2f=_0x2023[_0x2926f1];return _0xad4f2f;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x3202('0x0'))['db'][_0x3202('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3859ad){return function(_0x2cc9a3,_0x30e5b6,_0x2f39d2){UserSettingEvents[_0x3202('0x3')](_0x3859ad+':'+_0x2cc9a3['id'],_0x2cc9a3);UserSettingEvents[_0x3202('0x3')](_0x3859ad,_0x2cc9a3);_0x2f39d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3202('0x4')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x6fcb=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','UserSetting'];(function(_0x53218e,_0x41de35){var _0x30b12c=function(_0x32e07e){while(--_0x32e07e){_0x53218e['push'](_0x53218e['shift']());}};_0x30b12c(++_0x41de35);}(_0x6fcb,0x1de));var _0xb6fc=function(_0xfca71b,_0xdc75bf){_0xfca71b=_0xfca71b-0x0;var _0x134af7=_0x6fcb[_0xfca71b];return _0x134af7;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xb6fc('0x0'))['db'][_0xb6fc('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xb6fc('0x2')](0x0);var events={'afterCreate':_0xb6fc('0x3'),'afterUpdate':_0xb6fc('0x4'),'afterDestroy':_0xb6fc('0x5')};function emitEvent(_0x258d8a){return function(_0x208f6a,_0x1099e4,_0x208310){UserSettingEvents[_0xb6fc('0x6')](_0x258d8a+':'+_0x208f6a['id'],_0x208f6a);UserSettingEvents['emit'](_0x258d8a,_0x208f6a);_0x208310(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xb6fc('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index f007729..1da5e08 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 _0x373d=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x10a2ea,_0x487cf2){var _0x347b66=function(_0x592edb){while(--_0x592edb){_0x10a2ea['push'](_0x10a2ea['shift']());}};_0x347b66(++_0x487cf2);}(_0x373d,0x1e2));var _0xd373=function(_0x30ed7d,_0x238acb){_0x30ed7d=_0x30ed7d-0x0;var _0x50e1fb=_0x373d[_0x30ed7d];return _0x50e1fb;};'use strict';var attributes=require(_0xd373('0x0'));module['exports']=function(_0x3d3d31){return _0x3d3d31[_0xd373('0x1')](_0xd373('0x2'),attributes,{'tableName':_0xd373('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50ed19){if(!_0x50ed19[_0xd373('0x4')])_0x50ed19[_0xd373('0x5')]=null;else if(_0x50ed19[_0xd373('0x5')]===null)_0x50ed19['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xac4a=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xac4a,0x13f));var _0xaac4=function(_0x2ebbb0,_0x4c3b6e){_0x2ebbb0=_0x2ebbb0-0x0;var _0x4d8f7e=_0xac4a[_0x2ebbb0];return _0x4d8f7e;};'use strict';var attributes=require(_0xaac4('0x0'));module[_0xaac4('0x1')]=function(_0x2e2ad0){return _0x2e2ad0[_0xaac4('0x2')](_0xaac4('0x3'),attributes,{'tableName':_0xaac4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5aeb7d){if(!_0x5aeb7d['clientSideLoggingEnabled'])_0x5aeb7d[_0xaac4('0x5')]=null;else if(_0x5aeb7d[_0xaac4('0x5')]===null)_0x5aeb7d[_0xaac4('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 0b31294..8c1473b 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 _0x4a6e=['register','length','user-setting:','./user-setting.events','save','remove','emit','user-setting:update:user-','UserId'];(function(_0x1e937c,_0x11f03e){var _0x3b5971=function(_0x3fdb21){while(--_0x3fdb21){_0x1e937c['push'](_0x1e937c['shift']());}};_0x3b5971(++_0x11f03e);}(_0x4a6e,0x11a));var _0xe4a6=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4a6e[_0x4e9628];return _0x27bc8c;};'use strict';var UserSettingEvents=require(_0xe4a6('0x0'));var events=[_0xe4a6('0x1'),_0xe4a6('0x2'),'update'];function createListener(_0x252037,_0x456731){return function(_0x20e40d){_0x456731[_0xe4a6('0x3')](_0x252037,_0x20e40d);if(_0x252037==='user-setting:update'){_0x456731[_0xe4a6('0x3')](_0xe4a6('0x4')+_0x20e40d[_0xe4a6('0x5')],_0x20e40d);}};}exports[_0xe4a6('0x6')]=function(_0x237cda){for(var _0x38a79a=0x0,_0x1025da=events[_0xe4a6('0x7')];_0x38a79a<_0x1025da;_0x38a79a++){var _0x46b5c0=events[_0x38a79a];var _0x5d96c1=createListener(_0xe4a6('0x8')+_0x46b5c0,_0x237cda);UserSettingEvents['on'](_0x46b5c0,_0x5d96c1);}}; \ No newline at end of file +var _0xe34a=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','remove','update','emit','user-setting:update'];(function(_0x3b9e28,_0x448bb6){var _0x45c194=function(_0x555c09){while(--_0x555c09){_0x3b9e28['push'](_0x3b9e28['shift']());}};_0x45c194(++_0x448bb6);}(_0xe34a,0x1c7));var _0xae34=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xe34a[_0x3b96cf];return _0x2e315a;};'use strict';var UserSettingEvents=require(_0xae34('0x0'));var events=['save',_0xae34('0x1'),_0xae34('0x2')];function createListener(_0x2c2fb2,_0x3481f3){return function(_0x13dacc){_0x3481f3[_0xae34('0x3')](_0x2c2fb2,_0x13dacc);if(_0x2c2fb2===_0xae34('0x4')){_0x3481f3[_0xae34('0x3')](_0xae34('0x5')+_0x13dacc[_0xae34('0x6')],_0x13dacc);}};}exports[_0xae34('0x7')]=function(_0x129ca3){for(var _0x36bba4=0x0,_0x3de8b5=events[_0xae34('0x8')];_0x36bba4<_0x3de8b5;_0x36bba4++){var _0x594a1f=events[_0x36bba4];var _0x30d15c=createListener(_0xae34('0x9')+_0x594a1f,_0x129ca3);UserSettingEvents['on'](_0x594a1f,_0x30d15c);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 5fd7f17..6f00ee1 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 _0x8192=['removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x8192,0x82));var _0x2819=function(_0x3f6099,_0x47acf5){_0x3f6099=_0x3f6099-0x0;var _0x2fb1a5=_0x8192[_0x3f6099];return _0x2fb1a5;};'use strict';var multer=require(_0x2819('0x0'));var util=require(_0x2819('0x1'));var path=require(_0x2819('0x2'));var timeout=require(_0x2819('0x3'));var express=require(_0x2819('0x4'));var router=express['Router']();var fs_extra=require(_0x2819('0x5'));var auth=require(_0x2819('0x6'));var interaction=require(_0x2819('0x7'));var config=require(_0x2819('0x8'));var controller=require(_0x2819('0x9'));router[_0x2819('0xa')]('/',auth[_0x2819('0xb')](),controller[_0x2819('0xc')]);router['get'](_0x2819('0xd'),auth[_0x2819('0xb')](),controller[_0x2819('0xe')]);router['get']('/whoami',auth[_0x2819('0xb')](),controller[_0x2819('0xf')]);router[_0x2819('0xa')](_0x2819('0x10'),auth[_0x2819('0xb')](),controller[_0x2819('0x11')]);router[_0x2819('0xa')](_0x2819('0x12'),auth[_0x2819('0xb')](),controller[_0x2819('0x13')]);router[_0x2819('0xa')](_0x2819('0x14'),controller[_0x2819('0x15')]);router[_0x2819('0xa')](_0x2819('0x16'),auth[_0x2819('0xb')](),controller['getOpenTabs']);router[_0x2819('0xa')](_0x2819('0x17'),auth[_0x2819('0xb')](),controller[_0x2819('0x18')]);router['get'](_0x2819('0x19'),auth[_0x2819('0xb')](),controller[_0x2819('0x1a')]);router['get'](_0x2819('0x1b'),auth['isAuthenticated'](),controller[_0x2819('0x1c')]);router[_0x2819('0xa')](_0x2819('0x1d'),auth[_0x2819('0xb')](),controller[_0x2819('0x1e')]);router[_0x2819('0xa')](_0x2819('0x1f'),auth[_0x2819('0xb')](),controller[_0x2819('0x20')]);router[_0x2819('0xa')](_0x2819('0x21'),auth[_0x2819('0xb')](),controller[_0x2819('0x22')]);router[_0x2819('0xa')](_0x2819('0x23'),auth[_0x2819('0xb')](),controller[_0x2819('0x24')]);router['get'](_0x2819('0x25'),auth[_0x2819('0xb')](),controller[_0x2819('0x26')]);router[_0x2819('0xa')]('/:id/mail/interactions',auth[_0x2819('0xb')](),controller['getMailInteractions']);router[_0x2819('0xa')](_0x2819('0x27'),auth[_0x2819('0xb')](),controller[_0x2819('0x28')]);router[_0x2819('0xa')](_0x2819('0x29'),auth[_0x2819('0xb')](),controller['getFaxInteractions']);router['get'](_0x2819('0x2a'),auth[_0x2819('0xb')](),controller[_0x2819('0x2b')]);router[_0x2819('0xa')](_0x2819('0x2c'),auth['isAuthenticated'](),controller[_0x2819('0x2d')]);router[_0x2819('0xa')](_0x2819('0x2e'),auth[_0x2819('0xb')](),controller[_0x2819('0x2f')]);router['get'](_0x2819('0x30'),auth['isAuthenticated'](),controller[_0x2819('0x31')]);router[_0x2819('0xa')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x2819('0x32')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x2819('0xa')]('/:id/mail_accounts',auth[_0x2819('0xb')](),controller[_0x2819('0x33')]);router[_0x2819('0xa')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0x2819('0xb')](),controller[_0x2819('0x35')]);router[_0x2819('0xa')](_0x2819('0x36'),auth[_0x2819('0xb')](),controller[_0x2819('0x37')]);router['get'](_0x2819('0x38'),auth[_0x2819('0xb')](),controller[_0x2819('0x39')]);router[_0x2819('0xa')]('/:id/scheduled_calls',auth[_0x2819('0xb')](),controller[_0x2819('0x3a')]);router[_0x2819('0xa')](_0x2819('0x3b'),auth[_0x2819('0xb')](),controller[_0x2819('0x3c')]);router[_0x2819('0x3d')](_0x2819('0x17'),auth['isAuthenticated'](),controller[_0x2819('0x3e')]);router[_0x2819('0x3d')]('/',auth[_0x2819('0xb')](),controller['create']);router[_0x2819('0x3d')](_0x2819('0x3f'),auth[_0x2819('0xb')](),controller[_0x2819('0x40')]);router[_0x2819('0x3d')](_0x2819('0x19'),auth[_0x2819('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2819('0x41')]({'destination':function(_0x30f19f,_0x4af7b4,_0x11fabd){_0x11fabd(null,path[_0x2819('0x42')](config[_0x2819('0x43')],_0x2819('0x44')));},'filename':function(_0xd1917c,_0x33feb7,_0x239fd4){_0x239fd4(null,util['format'](_0x2819('0x45'),Date[_0x2819('0x46')](),_0x33feb7['originalname']));}})});router[_0x2819('0x3d')]('/:id/avatar',upload[_0x2819('0x47')](_0x2819('0x48')),controller[_0x2819('0x49')]);router[_0x2819('0x3d')](_0x2819('0x4a'),auth['isAuthenticated'](),controller['login']);router[_0x2819('0x3d')](_0x2819('0x4b'),auth[_0x2819('0xb')](),controller['logout']);router[_0x2819('0x3d')](_0x2819('0x4c'),auth[_0x2819('0xb')](),controller[_0x2819('0x4d')]);router['post'](_0x2819('0x4e'),auth[_0x2819('0xb')](),controller[_0x2819('0x4f')]);router[_0x2819('0x3d')](_0x2819('0x2c'),auth[_0x2819('0xb')](),controller[_0x2819('0x50')]);router[_0x2819('0x3d')](_0x2819('0x51'),auth[_0x2819('0xb')](),controller[_0x2819('0x52')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x2819('0x53')]);router[_0x2819('0x3d')](_0x2819('0x54'),auth[_0x2819('0xb')](),controller[_0x2819('0x55')]);router['post']('/:id/sms_interactions',auth[_0x2819('0xb')](),controller[_0x2819('0x56')]);router['post'](_0x2819('0x57'),auth[_0x2819('0xb')](),controller[_0x2819('0x58')]);router[_0x2819('0x3d')](_0x2819('0x59'),auth[_0x2819('0xb')](),controller[_0x2819('0x5a')]);router[_0x2819('0x3d')](_0x2819('0x5b'),auth[_0x2819('0xb')](),controller[_0x2819('0x5c')]);router[_0x2819('0x3d')](_0x2819('0x5d'),auth['isAuthenticated'](),controller[_0x2819('0x5e')]);router[_0x2819('0x3d')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller[_0x2819('0x5f')]);router[_0x2819('0x3d')](_0x2819('0x60'),auth[_0x2819('0xb')](),controller[_0x2819('0x61')]);router['post'](_0x2819('0x36'),auth[_0x2819('0xb')](),controller['addChatWebsites']);router['post'](_0x2819('0x38'),auth[_0x2819('0xb')](),controller[_0x2819('0x62')]);router[_0x2819('0x3d')]('/:id/api_key',auth[_0x2819('0xb')](),controller[_0x2819('0x63')]);router['put']('/:id',auth[_0x2819('0xb')](),controller['update']);router[_0x2819('0x64')](_0x2819('0x65'),auth[_0x2819('0xb')](),controller[_0x2819('0x66')]);router[_0x2819('0x67')]('/:id/queues',auth[_0x2819('0xb')](),controller[_0x2819('0x68')]);router['delete'](_0x2819('0x2c'),auth[_0x2819('0xb')](),controller['removeTeams']);router[_0x2819('0x67')](_0x2819('0x12'),auth[_0x2819('0xb')](),controller['destroy']);router[_0x2819('0x67')]('/:id/chat_interactions',auth[_0x2819('0xb')](),controller[_0x2819('0x69')]);router[_0x2819('0x67')](_0x2819('0x6a'),auth[_0x2819('0xb')](),controller[_0x2819('0x6b')]);router[_0x2819('0x67')](_0x2819('0x54'),auth[_0x2819('0xb')](),controller[_0x2819('0x6c')]);router[_0x2819('0x67')](_0x2819('0x6d'),auth['isAuthenticated'](),controller[_0x2819('0x6e')]);router[_0x2819('0x67')](_0x2819('0x57'),auth[_0x2819('0xb')](),controller[_0x2819('0x6f')]);router[_0x2819('0x67')](_0x2819('0x59'),auth[_0x2819('0xb')](),controller[_0x2819('0x70')]);router[_0x2819('0x67')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2819('0x71')]);router[_0x2819('0x67')](_0x2819('0x5d'),auth[_0x2819('0xb')](),controller[_0x2819('0x72')]);router[_0x2819('0x67')](_0x2819('0x34'),auth[_0x2819('0xb')](),controller[_0x2819('0x73')]);router[_0x2819('0x67')](_0x2819('0x60'),auth[_0x2819('0xb')](),controller[_0x2819('0x74')]);router[_0x2819('0x67')](_0x2819('0x36'),auth[_0x2819('0xb')](),controller[_0x2819('0x75')]);router[_0x2819('0x67')](_0x2819('0x38'),auth['isAuthenticated'](),controller[_0x2819('0x76')]);router['delete'](_0x2819('0x3b'),auth[_0x2819('0xb')](),controller['removeApiKey']);module[_0x2819('0x77')]=router; \ No newline at end of file +var _0xfebb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','server/files/images/','format','now','originalname','/:id/avatar','single','file','/:id/login','logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addMailAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','/:id','update','changePassword','removeQueues','removeTeams','delete','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','connect-timeout','express'];(function(_0xb0ab23,_0x4e5289){var _0x41ba8a=function(_0x2ef1f5){while(--_0x2ef1f5){_0xb0ab23['push'](_0xb0ab23['shift']());}};_0x41ba8a(++_0x4e5289);}(_0xfebb,0xde));var _0xbfeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbfeb('0x0'));var util=require(_0xbfeb('0x1'));var path=require('path');var timeout=require(_0xbfeb('0x2'));var express=require(_0xbfeb('0x3'));var router=express[_0xbfeb('0x4')]();var fs_extra=require(_0xbfeb('0x5'));var auth=require(_0xbfeb('0x6'));var interaction=require(_0xbfeb('0x7'));var config=require(_0xbfeb('0x8'));var controller=require(_0xbfeb('0x9'));router[_0xbfeb('0xa')]('/',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0xc')]);router[_0xbfeb('0xa')](_0xbfeb('0xd'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0xe')]);router[_0xbfeb('0xa')](_0xbfeb('0xf'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x10')]);router[_0xbfeb('0xa')]('/presence',auth['isAuthenticated'](),controller[_0xbfeb('0x11')]);router[_0xbfeb('0xa')]('/:id',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x12')]);router[_0xbfeb('0xa')]('/:id/avatar',controller[_0xbfeb('0x13')]);router[_0xbfeb('0xa')](_0xbfeb('0x14'),auth['isAuthenticated'](),controller[_0xbfeb('0x15')]);router[_0xbfeb('0xa')](_0xbfeb('0x16'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x17')]);router['get']('/:id/queues',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x18')]);router['get']('/:id/queues_rt',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x19')]);router['get'](_0xbfeb('0x1a'),auth['isAuthenticated'](),controller[_0xbfeb('0x1b')]);router[_0xbfeb('0xa')]('/:id/recordings',auth['isAuthenticated'](),controller[_0xbfeb('0x1c')]);router[_0xbfeb('0xa')](_0xbfeb('0x1d'),auth['isAuthenticated'](),controller[_0xbfeb('0x1e')]);router[_0xbfeb('0xa')](_0xbfeb('0x1f'),auth[_0xbfeb('0xb')](),controller['getChatInteractions']);router[_0xbfeb('0xa')](_0xbfeb('0x20'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x21')]);router[_0xbfeb('0xa')]('/:id/mail/interactions',auth[_0xbfeb('0xb')](),controller['getMailInteractions']);router[_0xbfeb('0xa')](_0xbfeb('0x22'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x23')]);router[_0xbfeb('0xa')](_0xbfeb('0x24'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x25')]);router['get'](_0xbfeb('0x26'),auth['isAuthenticated'](),controller[_0xbfeb('0x27')]);router[_0xbfeb('0xa')](_0xbfeb('0x28'),auth['isAuthenticated'](),controller[_0xbfeb('0x29')]);router['get'](_0xbfeb('0x2a'),auth[_0xbfeb('0xb')](),controller['getLists']);router[_0xbfeb('0xa')](_0xbfeb('0x2b'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x2c')]);router[_0xbfeb('0xa')](_0xbfeb('0x2d'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x2e')]);router[_0xbfeb('0xa')](_0xbfeb('0x2f'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x30')]);router[_0xbfeb('0xa')](_0xbfeb('0x31'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x32')]);router[_0xbfeb('0xa')]('/:id/openchannel_accounts',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x33')]);router[_0xbfeb('0xa')](_0xbfeb('0x34'),auth['isAuthenticated'](),controller[_0xbfeb('0x35')]);router[_0xbfeb('0xa')](_0xbfeb('0x36'),auth[_0xbfeb('0xb')](),controller['getChatWebsites']);router[_0xbfeb('0xa')](_0xbfeb('0x37'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x38')]);router[_0xbfeb('0xa')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0xbfeb('0x39')]);router['get'](_0xbfeb('0x3a'),auth[_0xbfeb('0xb')](),controller['getApiKey']);router[_0xbfeb('0x3b')](_0xbfeb('0x16'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x3c')]);router[_0xbfeb('0x3b')]('/',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x3d')]);router[_0xbfeb('0x3b')](_0xbfeb('0x3e'),auth['isAuthenticated'](),controller[_0xbfeb('0x3f')]);router['post'](_0xbfeb('0x40'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x41')]);var upload=multer({'storage':multer[_0xbfeb('0x42')]({'destination':function(_0x43c1ac,_0x2b48e4,_0x587179){_0x587179(null,path['join'](config['root'],_0xbfeb('0x43')));},'filename':function(_0x2435ec,_0x2c960c,_0x304ad4){_0x304ad4(null,util[_0xbfeb('0x44')]('%s-%s',Date[_0xbfeb('0x45')](),_0x2c960c[_0xbfeb('0x46')]));}})});router[_0xbfeb('0x3b')](_0xbfeb('0x47'),upload[_0xbfeb('0x48')](_0xbfeb('0x49')),controller['addAvatar']);router[_0xbfeb('0x3b')](_0xbfeb('0x4a'),auth[_0xbfeb('0xb')](),controller['login']);router[_0xbfeb('0x3b')]('/:id/logout',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x4b')]);router[_0xbfeb('0x3b')](_0xbfeb('0x4c'),auth['isAuthenticated'](),controller[_0xbfeb('0x4d')]);router[_0xbfeb('0x3b')]('/:id/unpause',auth[_0xbfeb('0xb')](),controller['unpause']);router['post'](_0xbfeb('0x28'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x4e')]);router[_0xbfeb('0x3b')](_0xbfeb('0x4f'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x50')]);router['post'](_0xbfeb('0x51'),auth['isAuthenticated'](),controller[_0xbfeb('0x52')]);router[_0xbfeb('0x3b')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0xbfeb('0x3b')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xbfeb('0x53')]);router[_0xbfeb('0x3b')](_0xbfeb('0x54'),auth['isAuthenticated'](),controller[_0xbfeb('0x55')]);router[_0xbfeb('0x3b')]('/:id/whatsapp_interactions',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x56')]);router[_0xbfeb('0x3b')](_0xbfeb('0x2f'),auth[_0xbfeb('0xb')](),controller['addFaxAccounts']);router[_0xbfeb('0x3b')](_0xbfeb('0x31'),auth['isAuthenticated'](),controller[_0xbfeb('0x57')]);router[_0xbfeb('0x3b')]('/:id/openchannel_accounts',auth[_0xbfeb('0xb')](),controller['addOpenchannelAccounts']);router[_0xbfeb('0x3b')]('/:id/sms_accounts',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x58')]);router['post'](_0xbfeb('0x36'),auth['isAuthenticated'](),controller['addChatWebsites']);router['post'](_0xbfeb('0x37'),auth['isAuthenticated'](),controller[_0xbfeb('0x59')]);router[_0xbfeb('0x3b')]('/:id/api_key',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x5a')]);router[_0xbfeb('0x5b')](_0xbfeb('0x5c'),auth['isAuthenticated'](),controller[_0xbfeb('0x5d')]);router[_0xbfeb('0x5b')]('/:id/password',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x5e')]);router['delete'](_0xbfeb('0x40'),auth['isAuthenticated'](),controller[_0xbfeb('0x5f')]);router['delete'](_0xbfeb('0x28'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x60')]);router['delete']('/:id',auth[_0xbfeb('0xb')](),controller['destroy']);router[_0xbfeb('0x61')](_0xbfeb('0x4f'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x62')]);router[_0xbfeb('0x61')](_0xbfeb('0x51'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x63')]);router[_0xbfeb('0x61')](_0xbfeb('0x64'),auth['isAuthenticated'](),controller[_0xbfeb('0x65')]);router[_0xbfeb('0x61')]('/:id/sms_interactions',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x66')]);router[_0xbfeb('0x61')](_0xbfeb('0x54'),auth['isAuthenticated'](),controller[_0xbfeb('0x67')]);router[_0xbfeb('0x61')]('/:id/whatsapp_interactions',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x68')]);router[_0xbfeb('0x61')](_0xbfeb('0x2f'),auth[_0xbfeb('0xb')](),controller['removeFaxAccounts']);router[_0xbfeb('0x61')](_0xbfeb('0x31'),auth['isAuthenticated'](),controller[_0xbfeb('0x69')]);router['delete'](_0xbfeb('0x6a'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x6b')]);router[_0xbfeb('0x61')]('/:id/sms_accounts',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x6c')]);router['delete'](_0xbfeb('0x36'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x6d')]);router[_0xbfeb('0x61')]('/:id/whatsapp_accounts',auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x6e')]);router[_0xbfeb('0x61')](_0xbfeb('0x3a'),auth[_0xbfeb('0xb')](),controller[_0xbfeb('0x6f')]);module[_0xbfeb('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index b670796..51c898e 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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x162772,_0x3e9a40){var _0x90ff02=function(_0x3877a5){while(--_0x3877a5){_0x162772['push'](_0x162772['shift']());}};_0x90ff02(++_0x3e9a40);}(_0xe706,0xa3));var _0x6e70=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xe706[_0x7a3247];return _0x1bfde5;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file +var _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x4d5ac2,_0x328af6){var _0xe7f48b=function(_0x4143bd){while(--_0x4143bd){_0x4d5ac2['push'](_0x4d5ac2['shift']());}};_0xe7f48b(++_0x328af6);}(_0xedd9,0xfc));var _0x9edd=function(_0x54a7b1,_0x5be69f){_0x54a7b1=_0x54a7b1-0x0;var _0x12c423=_0xedd9[_0x54a7b1];return _0x12c423;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 74217d2..816984d 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 _0x8d33=['faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','addAgent','Voice','VoicePrefixId','transaction','flattenDeep','removeAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','CmList','getLists','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$like','$iLike','$contains','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','resolve','teams','queues','inbound','flatten','lower','col','toString','desc','asc','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','offline','voiceStatus','busy','slice','charAt','toUpperCase','select','field','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','defaults','localhost','client','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','set','role','emit','userNotification:recalc:','get','admin','user','Agents','Telephones','telephone','filter','map','value','name','UserProfileResource','destroy','stack','send','index','User','rawAttributes','fieldName','type','key','includes','salt','getOptions','where','includeAll','include','userSetting','UserSetting','attributes','rows','query','openTabs','true','length','push','chat','dataValues','fax','mail','openchannel','all','password','filters','intersection','model','fields','merge','options','find','sms','update','body','describe','addContacts','params','omit','ids','findById','securePassword','validatePasswordPattern','max','internal','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','agent','permissions','101','102','103','113','105','106','108','100','111','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','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','findAll','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','validatePasswordHistory','previousPasswords','updatePasswordsHistory','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','spread','capitalize','QueueId','Queue:save','voice','VoiceQueue','online','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','Queue:remove','addAvatar','getAvatar','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','MailOpenTabs','MAIL','SmsOpenTabs','SMS','concat','getContacts','findOne','keys','CmContact','order','sort','pick','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','offset','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0x8d33,0x85));var _0x38d3=function(_0x223541,_0x217321){_0x223541=_0x223541-0x0;var _0x5e5497=_0x8d33[_0x223541];return _0x5e5497;};'use strict';var moment=require('moment');var util=require(_0x38d3('0x0'));var path=require(_0x38d3('0x1'));var fs=require('fs');var _=require(_0x38d3('0x2'));var squel=require(_0x38d3('0x3'));var jayson=require(_0x38d3('0x4'));var Redis=require(_0x38d3('0x5'));var authService=require(_0x38d3('0x6'));var qs=require(_0x38d3('0x7'));var logger=require(_0x38d3('0x8'))(_0x38d3('0x9'));var utils=require(_0x38d3('0xa'));var config=require(_0x38d3('0xb'));var licenseUtil=require(_0x38d3('0xc'));var APIBadRequestError=require(_0x38d3('0xd'))[_0x38d3('0xe')];var APINotFoundError=require(_0x38d3('0xd'))[_0x38d3('0xf')];var APIHandleError=require('../../errors/api')[_0x38d3('0x10')];var db=require(_0x38d3('0x11'))['db'];var socket=require(_0x38d3('0x12'))(new Redis(config[_0x38d3('0x13')]));require('./user.socket')['register'](socket);config[_0x38d3('0x13')]=_[_0x38d3('0x14')](config[_0x38d3('0x13')],{'host':_0x38d3('0x15'),'port':0x18eb});var amiClient=jayson[_0x38d3('0x16')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x3f1834,_0x40e40a,_0x168690,_0x3a6e30){return new Promise(function(_0x26bb4,_0x15b5c7){var _0x33713e=_0x3a6e30||amiClient;return _0x33713e['request'](_0x3f1834,_0x168690)[_0x38d3('0x17')](function(_0x5db749){logger[_0x38d3('0x18')](_0x38d3('0x19'),_0x40e40a,_0x38d3('0x1a'));logger[_0x38d3('0x1b')](_0x38d3('0x1c'),_0x40e40a,_0x38d3('0x1a'),JSON[_0x38d3('0x1d')](_0x5db749));if(_0x5db749[_0x38d3('0x1e')]){if(_0x5db749[_0x38d3('0x1e')][_0x38d3('0x1f')]===0x1f4){logger[_0x38d3('0x1e')](_0x38d3('0x19'),_0x40e40a,_0x5db749[_0x38d3('0x1e')]['message']);return _0x15b5c7(_0x5db749['error'][_0x38d3('0x20')]);}logger[_0x38d3('0x1e')]('User,\x20%s,\x20%s',_0x40e40a,_0x5db749['error'][_0x38d3('0x20')]);return _0x26bb4(_0x5db749[_0x38d3('0x1e')][_0x38d3('0x20')]);}else{logger['info'](_0x38d3('0x19'),_0x40e40a,'request\x20sent');_0x26bb4(_0x5db749[_0x38d3('0x21')][_0x38d3('0x20')]);}})[_0x38d3('0x22')](function(_0x1052c7){logger[_0x38d3('0x1e')](_0x38d3('0x19'),_0x40e40a,_0x1052c7);_0x15b5c7(_0x1052c7);});});}function respondWithStatusCode(_0x580028,_0x399ae6){_0x399ae6=_0x399ae6||0xcc;return function(_0x787652){if(_0x787652){return _0x580028['sendStatus'](_0x399ae6);}return _0x580028[_0x38d3('0x23')](_0x399ae6)[_0x38d3('0x24')]();};}function respondWithResult(_0xc96bfb,_0x2ccff5){_0x2ccff5=_0x2ccff5||0xc8;return function(_0x5bc691){if(_0x5bc691){return _0xc96bfb[_0x38d3('0x23')](_0x2ccff5)[_0x38d3('0x25')](_0x5bc691);}};}function respondWithFilteredResult(_0x1200c3,_0x1dc5f4){return function(_0x74e2c4){if(_0x74e2c4){var _0x1ec0a9=typeof _0x1dc5f4['offset']===_0x38d3('0x26')&&typeof _0x1dc5f4[_0x38d3('0x27')]==='undefined';var _0x546729=_0x74e2c4[_0x38d3('0x28')];var _0x103e54=_0x1ec0a9?0x0:_0x1dc5f4['offset'];var _0xea118b=_0x1ec0a9?_0x74e2c4[_0x38d3('0x28')]:_0x1dc5f4['offset']+_0x1dc5f4['limit'];var _0x416e38;if(_0xea118b>=_0x546729){_0xea118b=_0x546729;_0x416e38=0xc8;}else{_0x416e38=0xce;}_0x1200c3[_0x38d3('0x23')](_0x416e38);return _0x1200c3[_0x38d3('0x29')]('Content-Range',_0x103e54+'-'+_0xea118b+'/'+_0x546729)[_0x38d3('0x25')](_0x74e2c4);}return null;};}function saveUpdates(_0x43b47f){return function(_0x5e37ed){if(_0x5e37ed){return _0x5e37ed['update'](_0x43b47f)[_0x38d3('0x17')](function(_0x3d6335){if(_0x3d6335[_0x38d3('0x2a')]==='agent'){socket[_0x38d3('0x2b')](_0x38d3('0x2c')+_0x3d6335['id'],_0x3d6335);}return _0x3d6335;});}return null;};}function removeEntity(_0x585d0a){return function(_0x41eab1){if(_0x41eab1){return _0x41eab1['destroy']()['then'](function(){var _0x28b29d=_0x41eab1[_0x38d3('0x2d')]({'plain':!![]});if(_0x28b29d[_0x38d3('0x2a')]===_0x38d3('0x2e'))return;var _0xcc4c38=[{'name':'Users','value':_0x38d3('0x2f'),'ignore':!![]},{'name':_0x38d3('0x30'),'value':'agent','ignore':![]},{'name':_0x38d3('0x31'),'value':_0x38d3('0x32'),'ignore':![]}];var _0x186837=_(_0xcc4c38)[_0x38d3('0x33')]('ignore')[_0x38d3('0x34')](_0x38d3('0x35'))[_0x38d3('0x35')]();if(_['includes'](_0x186837,_0x28b29d[_0x38d3('0x2a')])){return;}var _0x1e80e5=_['find'](_0xcc4c38,['value',_0x28b29d[_0x38d3('0x2a')]])[_0x38d3('0x36')];return db[_0x38d3('0x37')][_0x38d3('0x38')]({'where':{'type':_0x1e80e5,'resourceId':_0x28b29d['id']}})['then'](function(){return _0x41eab1;});})[_0x38d3('0x17')](function(){_0x585d0a[_0x38d3('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20eafa){return function(_0x3a3e64){if(!_0x3a3e64){_0x20eafa['sendStatus'](0x194);}return _0x3a3e64;};}function handleError(_0x362620,_0x271e44){_0x271e44=_0x271e44||0x1f4;return function(_0x369e9c){logger[_0x38d3('0x1e')](_0x369e9c[_0x38d3('0x39')]);if(_0x369e9c[_0x38d3('0x36')]){delete _0x369e9c[_0x38d3('0x36')];}_0x362620[_0x38d3('0x23')](_0x271e44)[_0x38d3('0x3a')](_0x369e9c);};}exports[_0x38d3('0x3b')]=function(_0x33fea9,_0x1dd2ed){var _0x31c187={},_0x86c584={'count':0x0,'rows':[]};var _0x5d8aaf=_(db[_0x38d3('0x3c')][_0x38d3('0x3d')])[_0x38d3('0x34')](function(_0x3bdc17){return{'name':_0x3bdc17[_0x38d3('0x3e')],'type':_0x3bdc17[_0x38d3('0x3f')][_0x38d3('0x40')]};})[_0x38d3('0x33')](function(_0x2e1e1e){return!_[_0x38d3('0x41')](['password',_0x38d3('0x42')],_0x2e1e1e['name']);})[_0x38d3('0x35')]();_0x31c187=qs[_0x38d3('0x43')](_0x5d8aaf,_0x33fea9);var _0x6cf94e={'where':_0x31c187[_0x38d3('0x44')]};return db[_0x38d3('0x3c')]['count'](_0x6cf94e)[_0x38d3('0x17')](function(_0x40e97f){_0x86c584[_0x38d3('0x28')]=_0x40e97f;if(_0x33fea9['query'][_0x38d3('0x45')]){_0x31c187[_0x38d3('0x46')]=[{'all':!![]}];}if(_0x33fea9['query'][_0x38d3('0x47')]==='true'){_0x31c187[_0x38d3('0x46')]=[{'model':db[_0x38d3('0x48')],'as':_0x38d3('0x47')}];}if(!_[_0x38d3('0x41')](_0x31c187[_0x38d3('0x49')],'id')){_0x31c187['attributes']['push']('id');}return db[_0x38d3('0x3c')]['findAll'](_0x31c187);})[_0x38d3('0x17')](function(_0xc35a37){_0x86c584[_0x38d3('0x4a')]=_0xc35a37;if(_0x33fea9[_0x38d3('0x4b')][_0x38d3('0x4c')]===_0x38d3('0x4d')){var _0x4dd247=[];for(var _0x3d36b8=0x0;_0x3d36b8<_0x86c584[_0x38d3('0x4a')][_0x38d3('0x4e')];_0x3d36b8++){_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x50'),_0x86c584['rows'][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs('sms',_0x86c584[_0x38d3('0x4a')][_0x3d36b8]['dataValues']));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8]['dataValues']));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x53'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));_0x4dd247[_0x38d3('0x4f')](get_open_tabs('whatsapp',_0x86c584[_0x38d3('0x4a')][_0x3d36b8][_0x38d3('0x51')]));}return Promise[_0x38d3('0x55')](_0x4dd247)['then'](function(){return _0x86c584;});}else{return _0x86c584;}})[_0x38d3('0x17')](respondWithFilteredResult(_0x1dd2ed,_0x31c187))[_0x38d3('0x22')](handleError(_0x1dd2ed,null));};exports['show']=function(_0x213c24,_0x12d464){var _0x59295a={'raw':![],'where':{'id':_0x213c24['params']['id']}},_0x12f5c4={};_0x12f5c4['model']=_['differenceBy'](_['keys'](db[_0x38d3('0x3c')][_0x38d3('0x3d')]),[_0x38d3('0x56'),_0x38d3('0x42')]);_0x12f5c4[_0x38d3('0x4b')]=_['keys'](_0x213c24['query']);_0x12f5c4[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x12f5c4[_0x38d3('0x59')],_0x12f5c4[_0x38d3('0x4b')]);_0x59295a[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x12f5c4[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x213c24[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x59295a[_0x38d3('0x49')]=_0x59295a[_0x38d3('0x49')]['length']?_0x59295a['attributes']:_0x12f5c4['model'];if(_0x213c24['query'][_0x38d3('0x45')]){_0x59295a['include']=[{'all':!![]}];}if(_0x213c24[_0x38d3('0x4b')][_0x38d3('0x47')]===_0x38d3('0x4d')){_0x59295a[_0x38d3('0x46')]=[{'model':db[_0x38d3('0x48')],'as':_0x38d3('0x47')}];}_0x59295a=_[_0x38d3('0x5b')]({},_0x59295a,_0x213c24[_0x38d3('0x5c')]);if(!_['includes'](_0x59295a[_0x38d3('0x49')],'id')){_0x59295a[_0x38d3('0x49')][_0x38d3('0x4f')]('id');}return db[_0x38d3('0x3c')][_0x38d3('0x5d')](_0x59295a)['then'](handleEntityNotFound(_0x12d464,null))[_0x38d3('0x17')](function(_0x1fa7e9){var _0x9ab8ac=[];values=_0x1fa7e9;if(_0x213c24[_0x38d3('0x4b')][_0x38d3('0x4c')]===_0x38d3('0x4d')){_0x9ab8ac['push'](get_open_tabs(_0x38d3('0x50'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x5e'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs('whatsapp',_0x1fa7e9[_0x38d3('0x51')]));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x1fa7e9['dataValues']));_0x9ab8ac[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x53'),_0x1fa7e9['dataValues']));return Promise[_0x38d3('0x55')](_0x9ab8ac);}else{return values;}})[_0x38d3('0x17')](function(){return values;})[_0x38d3('0x17')](respondWithResult(_0x12d464,null))[_0x38d3('0x22')](handleError(_0x12d464,null));};exports[_0x38d3('0x5f')]=function(_0x3c4147,_0x502399){if(_0x3c4147['body']['id']){delete _0x3c4147[_0x38d3('0x60')]['id'];}delete _0x3c4147[_0x38d3('0x60')]['role'];return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x3c4147['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x502399,null))[_0x38d3('0x17')](saveUpdates(_0x3c4147[_0x38d3('0x60')],null))['then'](respondWithResult(_0x502399,null))[_0x38d3('0x22')](handleError(_0x502399,null));};exports[_0x38d3('0x61')]=function(_0x153d2a,_0x1c9122){return db['User'][_0x38d3('0x61')]()[_0x38d3('0x17')](respondWithResult(_0x1c9122,null))[_0x38d3('0x22')](handleError(_0x1c9122,null));};exports[_0x38d3('0x62')]=function(_0x4f9645,_0x1f21fe){return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x4f9645[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x1f21fe,null))[_0x38d3('0x17')](function(_0x487000){if(_0x487000){return _0x487000['addContacts'](_0x4f9645['body']['ids'],_[_0x38d3('0x64')](_0x4f9645[_0x38d3('0x60')],[_0x38d3('0x65'),'id'])||{});}})['then'](respondWithResult(_0x1f21fe,null))[_0x38d3('0x22')](handleError(_0x1f21fe,null));};function validateUser(_0x568f7a){return new Promise(function(_0x36656f,_0x348234){if(_0x568f7a['internal'])return _0x36656f(_0x568f7a);return db['Setting'][_0x38d3('0x66')](0x1)[_0x38d3('0x17')](function(_0x24f15f){if(_0x24f15f[_0x38d3('0x67')])authService[_0x38d3('0x68')](_0x568f7a['password']);db[_0x38d3('0x3c')][_0x38d3('0x69')](_0x38d3('0x6a'))['then'](function(_0xc79222){if(_[_0x38d3('0x6b')](_0xc79222)){_0x568f7a[_0x38d3('0x6a')]=_0x24f15f['min_internal']||0x1;return;}if(_[_0x38d3('0x6b')](_0x24f15f[_0x38d3('0x6c')])||_0x24f15f['min_internal']===_0xc79222){_0x568f7a[_0x38d3('0x6a')]=_0xc79222+0x1;return;}if(_0x24f15f[_0x38d3('0x6c')]>_0xc79222){_0x568f7a['internal']=_0x24f15f[_0x38d3('0x6c')];return;}return db[_0x38d3('0x6d')][_0x38d3('0x4b')](_0x38d3('0x6e'),{'type':db[_0x38d3('0x6d')][_0x38d3('0x6f')][_0x38d3('0x70')]})[_0x38d3('0x17')](function(_0x5734a6){if(_0x5734a6&&_0x5734a6[_0x38d3('0x4e')]){for(var _0x4ba94c=0x0,_0x17bceb=_0x5734a6['length'];_0x4ba94c<_0x17bceb&&_[_0x38d3('0x6b')](_0x568f7a[_0x38d3('0x6a')]);_0x4ba94c++){if(_0x24f15f[_0x38d3('0x6c')]<=_0x5734a6[_0x4ba94c][_0x38d3('0x71')]){_0x568f7a['internal']=_0x5734a6[_0x4ba94c][_0x38d3('0x71')];}else if(_0x24f15f[_0x38d3('0x6c')]>_0x5734a6[_0x4ba94c]['from']&&_0x24f15f['min_internal']<=_0x5734a6[_0x4ba94c]['to']){_0x568f7a[_0x38d3('0x6a')]=_0x24f15f[_0x38d3('0x6c')];}}}if(_[_0x38d3('0x6b')](_0x568f7a['internal'])){_0x568f7a[_0x38d3('0x6a')]=_0xc79222+0x1;}return _0x36656f(_0x568f7a);});});})[_0x38d3('0x22')](function(_0x2018d2){_0x348234(_0x2018d2);});});}function updateUser(_0x27cd0c){return new Promise(function(_0x11ac4c,_0x2bf2da){try{if(_0x27cd0c[_0x38d3('0x72')]){_0x27cd0c[_0x38d3('0x73')]=_0x27cd0c[_0x38d3('0x6a')];_0x27cd0c[_0x38d3('0x74')]={'mailbox':_0x27cd0c[_0x38d3('0x6a')],'password':_0x27cd0c['password'],'fullname':_0x27cd0c[_0x38d3('0x75')],'email':_0x27cd0c['email']};}if(_0x27cd0c[_0x38d3('0x2a')]===_0x38d3('0x76')){if(!_0x27cd0c[_0x38d3('0x77')])_0x27cd0c['permissions']=[_0x38d3('0x78'),_0x38d3('0x79'),_0x38d3('0x7a'),_0x38d3('0x7b'),'110','104',_0x38d3('0x7c'),_0x38d3('0x7d'),'107',_0x38d3('0x7e'),'109',_0x38d3('0x7f'),_0x38d3('0x80'),_0x38d3('0x81'),_0x38d3('0x82')];}_0x11ac4c(_0x27cd0c);}catch(_0x2c46ad){_0x2bf2da(_0x2c46ad);}});}exports['create']=function(_0x3f9204,_0x1193dd){if(_0x3f9204['user'][_0x38d3('0x2a')]===_0x38d3('0x76'))throw new Error(_0x38d3('0x83'));if(_0x3f9204['body'][_0x38d3('0x2a')]===_0x38d3('0x2f')&&_0x3f9204[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x84'));}if(_0x3f9204[_0x38d3('0x60')][_0x38d3('0x2a')]===_0x38d3('0x2e')&&_0x3f9204[_0x38d3('0x2f')]['role']!==_0x38d3('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x38d3('0x85')]([_0x3f9204[_0x38d3('0x60')]])[_0x38d3('0x17')](function(){return validateUser(_0x3f9204[_0x38d3('0x60')]);})[_0x38d3('0x17')](function(_0xb0f06e){return updateUser(_0xb0f06e)[_0x38d3('0x17')](function(_0x114ce2){if(_0x114ce2[_0x38d3('0x2a')]===_0x38d3('0x2e')){_0x114ce2['settingsEnabled']=_0x3f9204['user'][_0x38d3('0x86')];delete _0x114ce2[_0x38d3('0x87')];}return _0x114ce2;});})[_0x38d3('0x17')](function(_0x13e1f2){return db['User'][_0x38d3('0x88')](_0x13e1f2,{'include':[{'model':db[_0x38d3('0x74')],'as':'VoiceMail'}]});})[_0x38d3('0x17')](function(_0x55c6fe){if(_0x3f9204['body'][_0x38d3('0x2a')]==='user')return _0x55c6fe;if(_0x3f9204[_0x38d3('0x2f')]['role']!==_0x38d3('0x2f'))return _0x55c6fe;return db[_0x38d3('0x89')][_0x38d3('0x5d')]({'where':{'name':_0x55c6fe['role']===_0x38d3('0x76')?_0x38d3('0x30'):_0x38d3('0x31'),'userProfileId':_0x3f9204[_0x38d3('0x2f')][_0x38d3('0x87')]},'raw':!![]})[_0x38d3('0x17')](function(_0x3d3bb9){if(!_0x3d3bb9||_0x3d3bb9[_0x38d3('0x8a')]!=0x0)return _0x55c6fe;return db['UserProfileResource']['create']({'name':_0x55c6fe[_0x38d3('0x36')],'resourceId':_0x55c6fe['id'],'type':_0x3d3bb9[_0x38d3('0x36')],'sectionId':_0x3d3bb9['id']},{})[_0x38d3('0x17')](function(){return _0x55c6fe;});})[_0x38d3('0x22')](function(_0x559d14){logger['error'](_0x38d3('0x8b'),_0x559d14);throw _0x559d14;});})[_0x38d3('0x17')](respondWithResult(_0x1193dd,0xc9))[_0x38d3('0x22')](handleError(_0x1193dd,null));};exports[_0x38d3('0x8c')]=function(_0x3ada6c,_0x10c469){var _0x5d37dd=_0x3ada6c[_0x38d3('0x60')];var _0x50e76a=[];if(_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]===_0x38d3('0x76'))throw new Error(_0x38d3('0x83'));if(_[_0x38d3('0x8d')](_0x5d37dd,[_0x38d3('0x2a'),'user'])&&_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x84'));}if(_[_0x38d3('0x8d')](_0x5d37dd,['role',_0x38d3('0x2e')])&&_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!==_0x38d3('0x2e')){throw new Error(_0x38d3('0x8e'));}return licenseUtil['checkUserLimits'](_0x5d37dd)[_0x38d3('0x17')](function(){return validateUser(_0x5d37dd[0x0]);})['then'](function(){for(var _0x1b1544=0x1;_0x1b1544<_0x5d37dd[_0x38d3('0x4e')];_0x1b1544++){var _0x4897e9=_0x5d37dd[_0x1b1544-0x1][_0x38d3('0x6a')];if(!_0x5d37dd[_0x1b1544][_0x38d3('0x6a')])_0x5d37dd[_0x1b1544][_0x38d3('0x6a')]=_0x4897e9+0x1;_0x50e76a[_0x38d3('0x4f')](validateUser(_0x5d37dd[_0x1b1544]));}return Promise[_0x38d3('0x55')](_0x50e76a);})[_0x38d3('0x17')](function(){_0x50e76a=[];for(var _0x2afab8=0x0;_0x2afab8<_0x5d37dd[_0x38d3('0x4e')];_0x2afab8++){_0x50e76a['push'](updateUser(_0x5d37dd[_0x2afab8]));}return Promise[_0x38d3('0x55')](_0x50e76a);})['then'](function(){_0x50e76a=_0x5d37dd[_0x38d3('0x34')](function(_0x31f1fa){return db[_0x38d3('0x3c')][_0x38d3('0x88')](_0x31f1fa,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x38d3('0x17')](function(_0x2f46f3){_0x31f1fa['id']=_0x2f46f3['id'];return _0x31f1fa;});});return Promise[_0x38d3('0x55')](_0x50e76a);})[_0x38d3('0x17')](function(_0x15bb77){if(_0x3ada6c['body'][_0x38d3('0x2a')]===_0x38d3('0x2f'))return _0x15bb77;if(_0x3ada6c[_0x38d3('0x2f')][_0x38d3('0x2a')]!=='user')return _0x15bb77;var _0x155127=_[_0x38d3('0x8d')](_0x15bb77,function(_0x2ded61){return _0x2ded61[_0x38d3('0x2a')]===_0x38d3('0x76')||_0x2ded61[_0x38d3('0x2a')]==='telephone';});if(!_0x155127)return _0x15bb77;return db[_0x38d3('0x89')][_0x38d3('0x8f')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x3ada6c['user'][_0x38d3('0x87')]},'raw':!![]})['then'](function(_0x58f732){if(_[_0x38d3('0x90')](_0x58f732)||!_[_0x38d3('0x8d')](_0x58f732,[_0x38d3('0x8a'),0x0]))return _0x15bb77;_0x50e76a=[];var _0x29ff13=_(_0x58f732)[_0x38d3('0x34')](function(_0x3e4e91){if(_0x3e4e91[_0x38d3('0x8a')]===0x1)return;return _0x3e4e91[_0x38d3('0x36')]===_0x38d3('0x30')?_0x38d3('0x76'):_0x38d3('0x32');})[_0x38d3('0x91')]()[_0x38d3('0x35')]();for(var _0x157425=0x0;_0x157425<_0x15bb77['length'];_0x157425++){if(!_[_0x38d3('0x41')](_0x29ff13,_0x15bb77[_0x157425]['role']))return;var _0x5a9846=_0x15bb77[_0x157425][_0x38d3('0x2a')]===_0x38d3('0x76')?_0x38d3('0x30'):'Telephones';_0x50e76a[_0x38d3('0x4f')](db[_0x38d3('0x37')][_0x38d3('0x88')]({'name':_0x15bb77[_0x157425][_0x38d3('0x36')],'resourceId':_0x15bb77[_0x157425]['id'],'type':_0x5a9846,'sectionId':_[_0x38d3('0x5d')](_0x58f732,[_0x38d3('0x36'),_0x5a9846])['id']},{}));}return Promise[_0x38d3('0x55')](_0x50e76a);});})['then'](respondWithResult(_0x10c469,0xc9))[_0x38d3('0x22')](handleError(_0x10c469,null));};exports['changePassword']=function(_0x5cba70,_0x1965fc){if(_0x5cba70[_0x38d3('0x60')]['id']){delete _0x5cba70['body']['id'];}return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x5cba70['params']['id']}})['then'](function(_0xb53d5){if(!_0xb53d5)return null;if(_0xb53d5['id']===_0x5cba70[_0x38d3('0x2f')]['id']){if(!_0x5cba70[_0x38d3('0x60')][_0x38d3('0x92')]||!_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')]){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x96'));}if(!_0xb53d5[_0x38d3('0x97')](_0x5cba70[_0x38d3('0x60')]['oldPassword'])){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x98'));}if(_0x5cba70['body'][_0x38d3('0x92')]===_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')]){throw new db['Sequelize'][(_0x38d3('0x95'))](_0x38d3('0x99'));}}else if(_0x5cba70['user']['role']==='admin'){if(!_0x5cba70[_0x38d3('0x60')]['newPassword']){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x9a'));}}else if(_0x5cba70[_0x38d3('0x2f')][_0x38d3('0x2a')]==='user'){if(!_0x5cba70[_0x38d3('0x60')]['newPassword']){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x9a'));}if(_0xb53d5[_0x38d3('0x2a')]!=='agent'){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))]('Unauthorized');}}else{throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0x83'));}return _0xb53d5;})['then'](handleEntityNotFound(_0x1965fc,null))[_0x38d3('0x17')](function(_0x394d88){return db[_0x38d3('0x9b')]['findOne']({'attributes':['id',_0x38d3('0x67'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x38d3('0x17')](function(_0x5aff04){if(_0x5aff04[_0x38d3('0x67')])authService['validatePasswordPattern'](_0x5cba70['body'][_0x38d3('0x93')]);if(!_0x5aff04[_0x38d3('0x9c')]||!_0x394d88['previousPasswords'])return _0x394d88;authService[_0x38d3('0x9d')](_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],_0x394d88[_0x38d3('0x9e')],_0x5aff04['passwordHistoryLimit']);return _0x394d88;})[_0x38d3('0x17')](saveUpdates({'password':_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],'passwordResetAt':_0x5cba70[_0x38d3('0x2f')]['id']==_0x5cba70[_0x38d3('0x63')]['id']?moment():null,'previousPasswords':authService[_0x38d3('0x9f')](_0x5cba70[_0x38d3('0x60')][_0x38d3('0x93')],_0x394d88[_0x38d3('0x9e')])},null));})[_0x38d3('0x17')](respondWithResult(_0x1965fc,null))['catch'](handleError(_0x1965fc,null));};exports['addQueues']=function(_0x3491ba,_0x276a9b){var _0x2972fa=_0x3491ba['body'][_0x38d3('0xa0')];return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x3491ba[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a'),'online',_0x38d3('0xa1'),_0x38d3('0xa2'),_0x38d3('0xa3')]})[_0x38d3('0x17')](handleEntityNotFound(_0x276a9b,null))[_0x38d3('0x17')](function(_0x4961a5){if(_0x4961a5){if(!utils[_0x38d3('0xa4')](_0x2972fa)){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xa5'));}return _0x4961a5[_0x38d3('0xa6')+_['capitalize'](_0x2972fa[_0x38d3('0xa7')]())+_0x38d3('0xa8')](_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')],{'penalty':_0x3491ba[_0x38d3('0x60')]['penalty']||0x0})[_0x38d3('0xa9')](function(_0x51a3bc){for(var _0x133395=0x0;_0x133395<_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')]['length'];_0x133395+=0x1){var _0xd3019b={'UserId':Number(_0x3491ba[_0x38d3('0x63')]['id'])};_0xd3019b[_[_0x38d3('0xaa')](_0x2972fa[_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x3491ba['body'][_0x38d3('0x65')][_0x133395]);socket[_0x38d3('0x2b')](_0x38d3('0x2f')+_[_0x38d3('0xaa')](_0x2972fa['toLowerCase']())+_0x38d3('0xac'),_0xd3019b);}return _0x51a3bc;})[_0x38d3('0x17')](function(){if(_0x2972fa===_0x38d3('0xad')){return db[_0x38d3('0xae')][_0x38d3('0x8f')]({'where':{'id':_0x3491ba[_0x38d3('0x60')][_0x38d3('0x65')]||[]},'raw':!![],'attributes':['id',_0x38d3('0x36')]});}})['then'](function(_0x20601d){var _0x3eec9e=_0x4961a5[_0x38d3('0x2d')]({'plain':!![]});var _0x4afeae=[];if(_0x2972fa===_0x38d3('0xad')&&_0x3eec9e[_0x38d3('0x2a')]==='agent'&&_0x3eec9e[_0x38d3('0xaf')]){for(let _0x18cce0=0x0;_0x18cce0<_0x20601d['length'];_0x18cce0+=0x1){_0x4afeae[_0x38d3('0x4f')]({'membername':_0x3eec9e[_0x38d3('0x36')],'UserId':_0x3eec9e['id'],'queue_name':_0x20601d[_0x18cce0][_0x38d3('0x36')],'VoiceQueueId':_0x20601d[_0x18cce0]['id'],'interface':_[_0x38d3('0x6b')](_0x3eec9e[_0x38d3('0xa3')])?util['format'](_0x38d3('0xb0'),_0x3eec9e[_0x38d3('0x36')]):_0x3eec9e[_0x38d3('0xa3')],'paused':_0x3eec9e['voicePause']||![],'penalty':_0x3491ba[_0x38d3('0x60')][_0x38d3('0xb1')]||0x0});}return Promise[_0x38d3('0x55')](_0x4afeae[_0x38d3('0x34')](function(_0x33e10a){return db[_0x38d3('0xb2')][_0x38d3('0xb3')](_0x33e10a);}));}return _0x4961a5;});}})[_0x38d3('0x17')](respondWithStatusCode(_0x276a9b,null))[_0x38d3('0x22')](handleError(_0x276a9b,null));};exports[_0x38d3('0xb4')]=function(_0x44aea8,_0x398eba){var _0x137c91,_0x536220;return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x44aea8[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),'role']})[_0x38d3('0x17')](handleEntityNotFound(_0x398eba,null))['then'](function(_0x597c00){if(_0x597c00){_0x137c91=_0x597c00;if(!_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')]||!utils[_0x38d3('0xa4')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')])){throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xa5'));}return _0x597c00[_0x38d3('0xb5')+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+'Queues'](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')]);}})[_0x38d3('0x17')](function(_0x57c805){if(_[_0x38d3('0xb6')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')])){for(var _0xe6775c=0x0;_0xe6775c<_0x44aea8['query'][_0x38d3('0x65')]['length'];_0xe6775c+=0x1){_0x536220={'UserId':Number(_0x44aea8['params']['id'])};_0x536220[_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')]['channel'][_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x44aea8['query'][_0x38d3('0x65')][_0xe6775c]);socket['emit'](_0x38d3('0x2f')+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xb7'),_0x536220);}}else{_0x536220={'UserId':Number(_0x44aea8[_0x38d3('0x63')]['id'])};_0x536220[_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xab')]=Number(_0x44aea8[_0x38d3('0x4b')]['ids']);socket[_0x38d3('0x2b')]('user'+_[_0x38d3('0xaa')](_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')][_0x38d3('0xa7')]())+_0x38d3('0xb7'),_0x536220);}return _0x57c805;})[_0x38d3('0x17')](function(){if(_0x44aea8[_0x38d3('0x4b')][_0x38d3('0xa0')]===_0x38d3('0xad')){return db[_0x38d3('0xb2')]['destroy']({'where':{'UserId':_0x44aea8['params']['id'],'VoiceQueueId':_0x44aea8[_0x38d3('0x4b')][_0x38d3('0x65')]},'individualHooks':!![]})['then'](function(){return _0x137c91;});}return _0x137c91;})[_0x38d3('0x17')](respondWithStatusCode(_0x398eba,null))[_0x38d3('0x22')](handleError(_0x398eba,null));};exports[_0x38d3('0xb8')]=function(_0x4a094f,_0x232ae1){_0x4a094f[_0x38d3('0x60')]['userpic']=_0x4a094f['file']['filename'];return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x4a094f[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x232ae1,null))[_0x38d3('0x17')](saveUpdates(_0x4a094f[_0x38d3('0x60')],null))['then'](respondWithResult(_0x232ae1,null))[_0x38d3('0x22')](handleError(_0x232ae1,null));};exports[_0x38d3('0xb9')]=function(_0x225ec8,_0x3ad6ef){var _0x44780c=path['join'](config['root'],_0x38d3('0xba'));return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x225ec8[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0xbb')],'raw':!![]})[_0x38d3('0x17')](handleEntityNotFound(_0x3ad6ef,null))['then'](function(_0x43a558){if(_0x43a558){if(_['isNil'](_0x43a558[_0x38d3('0xbb')])){return _0x3ad6ef[_0x38d3('0xbc')](_0x44780c);}else{if(!fs[_0x38d3('0xbd')](path['join'](config[_0x38d3('0xbe')],_0x38d3('0xbf'),_0x43a558[_0x38d3('0xbb')]))){return _0x3ad6ef[_0x38d3('0xbc')](_0x44780c);}return _0x3ad6ef[_0x38d3('0xbc')](path['join'](config['root'],_0x38d3('0xbf'),_0x43a558[_0x38d3('0xbb')]));}}})[_0x38d3('0x22')](handleError(_0x3ad6ef,null));};exports[_0x38d3('0xc0')]=function(_0x430282,_0x86c6a4){return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x430282[_0x38d3('0x63')]['id']},'attributes':['id']})[_0x38d3('0x17')](handleEntityNotFound(_0x86c6a4,null))[_0x38d3('0x17')](function(_0x1c71fa){var _0x3ff768=[];values=_0x1c71fa[_0x38d3('0x51')];_0x3ff768[_0x38d3('0x4f')](get_open_tabs('chat',_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x5e'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x54'),_0x1c71fa[_0x38d3('0x51')]));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0xc1'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs(_0x38d3('0x52'),_0x1c71fa['dataValues']));_0x3ff768[_0x38d3('0x4f')](get_open_tabs('mail',_0x1c71fa[_0x38d3('0x51')]));return Promise[_0x38d3('0x55')](_0x3ff768);})['then'](function(_0x1a2855){if(_0x1a2855){var _0xdceefc=_['map'](values[_0x38d3('0xc2')],function(_0x5e0c76){return{'channel':_0x38d3('0xc3'),'id':_0x5e0c76['id'],'createdAt':_0x5e0c76['createdAt']};});var _0x4dd1aa=_['map'](values[_0x38d3('0xc4')],function(_0x4bee8f){return{'channel':_0x38d3('0xc5'),'id':_0x4bee8f['id'],'createdAt':_0x4bee8f[_0x38d3('0xc6')]};});var _0xd7c4bd=_[_0x38d3('0x34')](values['OpenchannelOpenTabs'],function(_0x13f5bc){return{'channel':'OPENCHANNEL','id':_0x13f5bc['id'],'createdAt':_0x13f5bc[_0x38d3('0xc6')]};});var _0x57b7d2=_['map'](values[_0x38d3('0xc7')],function(_0x1b3984){return{'channel':_0x38d3('0xc8'),'id':_0x1b3984['id'],'createdAt':_0x1b3984[_0x38d3('0xc6')]};});var _0x528945=_[_0x38d3('0x34')](values[_0x38d3('0xc9')],function(_0x30d758){return{'channel':_0x38d3('0xca'),'id':_0x30d758['id'],'createdAt':_0x30d758['createdAt']};});var _0x193298=_[_0x38d3('0x34')](values['WhatsappOpenTabs'],function(_0x4c3791){return{'channel':'WHATSAPP','id':_0x4c3791['id'],'createdAt':_0x4c3791[_0x38d3('0xc6')]};});var _0x320ae4=_[_0x38d3('0xcb')](_0xdceefc,_0x4dd1aa,_0xd7c4bd,_0x57b7d2,_0x528945,_0x193298);var _0x5255ef={'count':_0x320ae4['length'],'rows':_0x320ae4};return _0x5255ef;}else return null;})[_0x38d3('0x17')](respondWithResult(_0x86c6a4,null))[_0x38d3('0x22')](handleError(_0x86c6a4,null));};exports[_0x38d3('0xcc')]=function(_0x2be6df,_0xfedf4f){var _0x51e81b={};var _0xbb35f8={};var _0x32bde7;var _0x35efef;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x2be6df['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0xfedf4f,null))[_0x38d3('0x17')](function(_0x4b21be){if(_0x4b21be){_0x32bde7=_0x4b21be;_0xbb35f8['model']=_[_0x38d3('0xce')](db[_0x38d3('0xcf')][_0x38d3('0x3d')]);_0xbb35f8['query']=_[_0x38d3('0xce')](_0x2be6df['query']);_0xbb35f8['filters']=_['intersection'](_0xbb35f8[_0x38d3('0x59')],_0xbb35f8[_0x38d3('0x4b')]);_0x51e81b[_0x38d3('0x49')]=_['intersection'](_0xbb35f8['model'],qs['fields'](_0x2be6df[_0x38d3('0x4b')]['fields']));_0x51e81b[_0x38d3('0x49')]=_0x51e81b[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x51e81b[_0x38d3('0x49')]:_0xbb35f8[_0x38d3('0x59')];_0x51e81b[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x51e81b['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2be6df[_0x38d3('0x4b')],_0xbb35f8[_0x38d3('0x57')]));if(_0x2be6df[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x51e81b[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x51e81b[_0x38d3('0x44')],{'$or':_['map'](_0x51e81b['attributes'],function(_0x3ebdc7){var _0x522924={};_0x522924[_0x3ebdc7]={'$like':'%'+_0x2be6df[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x522924;})});}_0x51e81b=_[_0x38d3('0x5b')]({},_0x51e81b,_0x2be6df[_0x38d3('0x5c')]);return _0x32bde7[_0x38d3('0xcc')](_0x51e81b);}})['then'](function(_0x4b72c9){if(_0x4b72c9){_0x35efef=_0x4b72c9['length'];if(_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0x45'))){_0x51e81b[_0x38d3('0x46')]=[{'model':db['CmList'],'as':_0x38d3('0xd4'),'required':![]},{'model':db[_0x38d3('0xd5')],'as':_0x38d3('0xd6'),'attributes':['id',_0x38d3('0x36'),_0x38d3('0xd7')],'where':_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd8')]?{'id':_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd8')]}:undefined,'required':_0x2be6df[_0x38d3('0x4b')]['tag']?!![]:![]}];}if(!_0x2be6df[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x51e81b[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2be6df['query']['limit']);_0x51e81b[_0x38d3('0xda')]=qs['offset'](_0x2be6df['query'][_0x38d3('0xda')]);}return _0x32bde7['getContacts'](_0x51e81b);}})[_0x38d3('0x17')](function(_0x2618c0){if(_0x2618c0){return _0x2618c0?{'count':_0x35efef,'rows':_0x2618c0}:null;}})['then'](respondWithResult(_0xfedf4f,null))[_0x38d3('0x22')](handleError(_0xfedf4f,null));};exports['getQueues']=function(_0x5d8ea9,_0xdc2145){var _0x3da47e;var _0x1b68ab={};var _0x14451b;return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x5d8ea9[_0x38d3('0x63')]['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a')]})[_0x38d3('0x17')](handleEntityNotFound(_0xdc2145,null))[_0x38d3('0x17')](function(_0x45db78){if(!utils[_0x38d3('0xa4')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])){throw new db['Sequelize'][(_0x38d3('0x95'))](_0x38d3('0xa5'));}_0x3da47e=_0x45db78;var _0x4a2184={};_0x4a2184[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+'Queue'][_0x38d3('0x3d')]);_0x4a2184[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x5d8ea9[_0x38d3('0x4b')]);_0x4a2184[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x4a2184[_0x38d3('0x59')],_0x4a2184[_0x38d3('0x4b')]);_0x1b68ab[_0x38d3('0x49')]=_['intersection'](_0x4a2184[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x1b68ab[_0x38d3('0x49')]=_0x1b68ab[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x1b68ab['attributes']:_0x4a2184[_0x38d3('0x59')];_0x1b68ab[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x1b68ab['where']=qs[_0x38d3('0x57')](_['pick'](_0x5d8ea9[_0x38d3('0x4b')],_0x4a2184['filters']));if(_0x5d8ea9[_0x38d3('0x4b')]['filter']){_0x1b68ab[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x1b68ab[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1b68ab[_0x38d3('0x49')],function(_0x3460fe){var _0x446b6e={};_0x446b6e[_0x3460fe]={'$like':'%'+_0x5d8ea9['query'][_0x38d3('0x33')]+'%'};return _0x446b6e;})});}_0x1b68ab=_[_0x38d3('0x5b')]({},_0x1b68ab,_0x5d8ea9[_0x38d3('0x5c')]);switch(_0x3da47e['role']){case _0x38d3('0x2e'):return db[_['capitalize'](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+_0x38d3('0xdb')][_0x38d3('0x8f')](_0x1b68ab);case _0x38d3('0x2f'):case _0x38d3('0x76'):return _0x3da47e[_0x38d3('0x2d')+_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xa0')])+_0x38d3('0xa8')](_0x1b68ab);default:throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xdc'));}})['then'](function(_0x548218){_0x14451b=_0x548218[_0x38d3('0x4e')];if(!_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1b68ab[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x1b68ab[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x5d8ea9[_0x38d3('0x4b')][_0x38d3('0xda')]);}switch(_0x3da47e[_0x38d3('0x2a')]){case _0x38d3('0x2e'):return db[_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')]['channel'])+_0x38d3('0xdb')][_0x38d3('0x8f')](_0x1b68ab);case _0x38d3('0x2f'):case _0x38d3('0x76'):return _0x3da47e['get'+_[_0x38d3('0xaa')](_0x5d8ea9[_0x38d3('0x4b')]['channel'])+_0x38d3('0xa8')](_0x1b68ab);}})[_0x38d3('0x17')](function(_0x453de5){return{'count':_0x14451b,'rows':_0x453de5};})[_0x38d3('0x17')](respondWithResult(_0xdc2145,null))[_0x38d3('0x22')](handleError(_0xdc2145,null));};exports[_0x38d3('0xdd')]=function(_0x1871a2,_0x705706){var _0x2bc0e7={};var _0x34071f={};var _0x2d06fd;var _0x324f5d;return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x1871a2[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x705706,null))[_0x38d3('0x17')](function(_0x564705){if(_0x564705){_0x2d06fd=_0x564705;_0x34071f[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xb2')][_0x38d3('0x3d')]);_0x34071f[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x1871a2[_0x38d3('0x4b')]);_0x34071f[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x34071f[_0x38d3('0x59')],_0x34071f[_0x38d3('0x4b')]);_0x2bc0e7[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x34071f[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x1871a2[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x2bc0e7[_0x38d3('0x49')]=_0x2bc0e7[_0x38d3('0x49')]['length']?_0x2bc0e7[_0x38d3('0x49')]:_0x34071f[_0x38d3('0x59')];_0x2bc0e7[_0x38d3('0xd0')]=qs['sort'](_0x1871a2[_0x38d3('0x4b')]['sort']);_0x2bc0e7[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x1871a2[_0x38d3('0x4b')],_0x34071f[_0x38d3('0x57')]));if(_0x1871a2[_0x38d3('0x4b')]['filter']){_0x2bc0e7['where']=_[_0x38d3('0x5b')](_0x2bc0e7[_0x38d3('0x44')],{'$or':_['map'](_0x2bc0e7['attributes'],function(_0xa9be12){var _0x1c0621={};_0x1c0621[_0xa9be12]={'$like':'%'+_0x1871a2['query'][_0x38d3('0x33')]+'%'};return _0x1c0621;})});}_0x2bc0e7=_[_0x38d3('0x5b')]({},_0x2bc0e7,_0x1871a2['options']);return _0x2d06fd['getVoiceQueuesRt'](_0x2bc0e7);}})[_0x38d3('0x17')](function(_0x27004f){if(_0x27004f){_0x324f5d=_0x27004f[_0x38d3('0x4e')];if(!_0x1871a2[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x2bc0e7[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x1871a2[_0x38d3('0x4b')]['limit']);_0x2bc0e7[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x1871a2['query']['offset']);}return _0x2d06fd['getVoiceQueuesRt'](_0x2bc0e7);}})[_0x38d3('0x17')](function(_0x3d9ab3){if(_0x3d9ab3){return _0x3d9ab3?{'count':_0x324f5d,'rows':_0x3d9ab3}:null;}})[_0x38d3('0x17')](respondWithResult(_0x705706,null))['catch'](handleError(_0x705706,null));};exports[_0x38d3('0xde')]=function(_0xa222b2,_0xabfae8){var _0x1f20d9={};var _0x381fd2={};var _0x22f688;var _0x19f1b3;return db['User']['findOne']({'where':{'id':_0xa222b2[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0xabfae8,null))[_0x38d3('0x17')](function(_0x57e929){if(_0x57e929){_0x22f688=_0x57e929;_0x381fd2[_0x38d3('0x59')]=_['keys'](db[_0x38d3('0xdf')][_0x38d3('0x3d')]);_0x381fd2[_0x38d3('0x4b')]=_['keys'](_0xa222b2['query']);_0x381fd2[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x381fd2[_0x38d3('0x59')],_0x381fd2[_0x38d3('0x4b')]);_0x1f20d9[_0x38d3('0x49')]=_['intersection'](_0x381fd2['model'],qs['fields'](_0xa222b2['query']['fields']));_0x1f20d9['attributes']=_0x1f20d9[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x1f20d9['attributes']:_0x381fd2[_0x38d3('0x59')];_0x1f20d9['order']=qs[_0x38d3('0xd1')](_0xa222b2[_0x38d3('0x4b')]['sort']);_0x1f20d9['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0xa222b2[_0x38d3('0x4b')],_0x381fd2['filters']));if(_0xa222b2[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x1f20d9['where']=_[_0x38d3('0x5b')](_0x1f20d9[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1f20d9[_0x38d3('0x49')],function(_0x87e14b){var _0x2d9949={};_0x2d9949[_0x87e14b]={'$like':'%'+_0xa222b2['query'][_0x38d3('0x33')]+'%'};return _0x2d9949;})});}_0x1f20d9=_['merge']({},_0x1f20d9,_0xa222b2[_0x38d3('0x5c')]);return _0x22f688[_0x38d3('0xde')](_0x1f20d9);}})[_0x38d3('0x17')](function(_0x39ccd3){if(_0x39ccd3){_0x19f1b3=_0x39ccd3['length'];if(!_0xa222b2[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1f20d9[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0xa222b2[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x1f20d9[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0xa222b2[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0x22f688[_0x38d3('0xde')](_0x1f20d9);}})[_0x38d3('0x17')](function(_0x5ee2f9){if(_0x5ee2f9){return _0x5ee2f9?{'count':_0x19f1b3,'rows':_0x5ee2f9}:null;}})[_0x38d3('0x17')](respondWithResult(_0xabfae8,null))[_0x38d3('0x22')](handleError(_0xabfae8,null));};exports[_0x38d3('0xe0')]=function(_0x5c83be,_0x3fd373){var _0x51cef5={'raw':!![],'where':{}};var _0x24ec21={};var _0x41d28c={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x5c83be[_0x38d3('0x63')]['id']}})['then'](handleEntityNotFound(_0x3fd373,null))['then'](function(_0x3c13df){if(_0x3c13df){_0x24ec21[_0x38d3('0x59')]=_[_0x38d3('0xce')](db['VoiceRecording'][_0x38d3('0x3d')]);_0x24ec21[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x5c83be['query']);_0x24ec21[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x24ec21['model'],_0x24ec21[_0x38d3('0x4b')]);_0x51cef5[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x24ec21['model'],qs[_0x38d3('0x5a')](_0x5c83be[_0x38d3('0x4b')]['fields']));_0x51cef5['attributes']=_0x51cef5['attributes']['length']?_0x51cef5[_0x38d3('0x49')]:_0x24ec21[_0x38d3('0x59')];if(!_0x5c83be[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x51cef5[_0x38d3('0x27')]=qs['limit'](_0x5c83be[_0x38d3('0x4b')]['limit']);_0x51cef5[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x5c83be['query'][_0x38d3('0xda')]);}_0x51cef5['order']=qs[_0x38d3('0xd1')](_0x5c83be[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x51cef5[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_['pick'](_0x5c83be[_0x38d3('0x4b')],_0x24ec21[_0x38d3('0x57')]));_0x51cef5[_0x38d3('0x44')][_0x38d3('0xe1')]=_0x3c13df['id'];if(_0x5c83be[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x51cef5[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x51cef5[_0x38d3('0x44')],{'$or':_['map'](_0x51cef5[_0x38d3('0x49')],function(_0x5ad76b){var _0xf5edcb={};_0xf5edcb[_0x5ad76b]={'$like':'%'+_0x5c83be['query'][_0x38d3('0x33')]+'%'};return _0xf5edcb;})});}_0x51cef5=_[_0x38d3('0x5b')]({},_0x51cef5,_0x5c83be['options']);return db['VoiceRecording'][_0x38d3('0x28')]({'where':_0x51cef5[_0x38d3('0x44')]})[_0x38d3('0x17')](function(_0x3adbe6){_0x41d28c[_0x38d3('0x28')]=_0x3adbe6;if(_0x5c83be[_0x38d3('0x4b')]['includeAll']){_0x51cef5[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe2')][_0x38d3('0x8f')](_0x51cef5);})[_0x38d3('0x17')](function(_0xb838eb){_0x41d28c[_0x38d3('0x4a')]=_0xb838eb;return _0x41d28c;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x3fd373,_0x51cef5))[_0x38d3('0x22')](handleError(_0x3fd373,null));};exports['getScreenRecordings']=function(_0x58ef12,_0x56dc1e){var _0x1ef84d={'raw':!![],'where':{}};var _0x4a22cc={};var _0x1d03b6={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')]['findOne']({'where':{'id':_0x58ef12[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x56dc1e,null))[_0x38d3('0x17')](function(_0x2ce084){if(_0x2ce084){_0x4a22cc['model']=_[_0x38d3('0xce')](db[_0x38d3('0xe3')][_0x38d3('0x3d')]);_0x4a22cc[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x58ef12[_0x38d3('0x4b')]);_0x4a22cc['filters']=_[_0x38d3('0x58')](_0x4a22cc['model'],_0x4a22cc[_0x38d3('0x4b')]);_0x1ef84d[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x4a22cc[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x58ef12[_0x38d3('0x4b')]['fields']));_0x1ef84d[_0x38d3('0x49')]=_0x1ef84d['attributes'][_0x38d3('0x4e')]?_0x1ef84d['attributes']:_0x4a22cc[_0x38d3('0x59')];if(!_0x58ef12[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x1ef84d[_0x38d3('0x27')]=qs['limit'](_0x58ef12[_0x38d3('0x4b')]['limit']);_0x1ef84d[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x58ef12[_0x38d3('0x4b')]['offset']);}_0x1ef84d['order']=qs[_0x38d3('0xd1')](_0x58ef12[_0x38d3('0x4b')]['sort']);_0x1ef84d[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x58ef12['query'],_0x4a22cc['filters']));_0x1ef84d[_0x38d3('0x44')]['UserId']=_0x2ce084['id'];if(_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x1ef84d[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x1ef84d[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x1ef84d['attributes'],function(_0x3309af){var _0x49028a={};_0x49028a[_0x3309af]={'$like':'%'+_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x49028a;})});}_0x1ef84d=_[_0x38d3('0x5b')]({},_0x1ef84d,_0x58ef12[_0x38d3('0x5c')]);return db[_0x38d3('0xe3')][_0x38d3('0x28')]({'where':_0x1ef84d[_0x38d3('0x44')]})['then'](function(_0x4cacaf){_0x1d03b6[_0x38d3('0x28')]=_0x4cacaf;if(_0x58ef12[_0x38d3('0x4b')][_0x38d3('0x45')]){_0x1ef84d[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe3')]['findAll'](_0x1ef84d);})[_0x38d3('0x17')](function(_0x33abef){_0x1d03b6['rows']=_0x33abef;return _0x1d03b6;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x56dc1e,_0x1ef84d))[_0x38d3('0x22')](handleError(_0x56dc1e,null));};exports[_0x38d3('0xe4')]=function(_0x2a1ffc,_0x2d7d62){var _0x27836a={};var _0x32c942={};var _0x5878e6;var _0x32ff62;return db['User']['findOne']({'where':{'id':_0x2a1ffc[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x2d7d62,null))[_0x38d3('0x17')](function(_0x983379){if(_0x983379){_0x5878e6=_0x983379;_0x32c942[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xe5')][_0x38d3('0x3d')]);_0x32c942[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x2a1ffc[_0x38d3('0x4b')]);_0x32c942[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x32c942[_0x38d3('0x59')],_0x32c942[_0x38d3('0x4b')]);_0x27836a['attributes']=_[_0x38d3('0x58')](_0x32c942[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x27836a[_0x38d3('0x49')]=_0x27836a[_0x38d3('0x49')]['length']?_0x27836a['attributes']:_0x32c942[_0x38d3('0x59')];_0x27836a[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x27836a[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2a1ffc[_0x38d3('0x4b')],_0x32c942['filters']));if(_0x2a1ffc['query']['filter']){_0x27836a[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x27836a['where'],{'$or':_[_0x38d3('0x34')](_0x27836a[_0x38d3('0x49')],function(_0x2d9a6c){var _0x5a8e0e={};_0x5a8e0e[_0x2d9a6c]={'$like':'%'+_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5a8e0e;})});}_0x27836a=_['merge']({},_0x27836a,_0x2a1ffc['options']);return _0x5878e6[_0x38d3('0xe4')](_0x27836a);}})[_0x38d3('0x17')](function(_0x1dc5a3){if(_0x1dc5a3){_0x32ff62=_0x1dc5a3[_0x38d3('0x4e')];if(!_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x27836a[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2a1ffc[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x27836a['offset']=qs[_0x38d3('0xda')](_0x2a1ffc['query'][_0x38d3('0xda')]);}return _0x5878e6[_0x38d3('0xe4')](_0x27836a);}})[_0x38d3('0x17')](function(_0x4e6a76){if(_0x4e6a76){return _0x4e6a76?{'count':_0x32ff62,'rows':_0x4e6a76}:null;}})[_0x38d3('0x17')](respondWithResult(_0x2d7d62,null))['catch'](handleError(_0x2d7d62,null));};exports[_0x38d3('0xe6')]=function(_0x2ec254,_0x9e2afb){var _0x41965f={};var _0x19bc60={};var _0x1d380d;var _0xf964d6;return db['User']['findOne']({'where':{'id':_0x2ec254[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x9e2afb,null))[_0x38d3('0x17')](function(_0x578a1d){if(_0x578a1d){_0x1d380d=_0x578a1d;_0x19bc60['model']=_[_0x38d3('0xce')](db['OpenchannelInteraction']['rawAttributes']);_0x19bc60['query']=_[_0x38d3('0xce')](_0x2ec254[_0x38d3('0x4b')]);_0x19bc60[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x19bc60[_0x38d3('0x59')],_0x19bc60[_0x38d3('0x4b')]);_0x41965f[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x19bc60[_0x38d3('0x59')],qs['fields'](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x41965f[_0x38d3('0x49')]=_0x41965f['attributes'][_0x38d3('0x4e')]?_0x41965f[_0x38d3('0x49')]:_0x19bc60['model'];_0x41965f[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x41965f[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2ec254[_0x38d3('0x4b')],_0x19bc60[_0x38d3('0x57')]));if(_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x41965f[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x41965f[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x41965f[_0x38d3('0x49')],function(_0x1e2f03){var _0x29614d={};_0x29614d[_0x1e2f03]={'$like':'%'+_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x29614d;})});}_0x41965f=_[_0x38d3('0x5b')]({},_0x41965f,_0x2ec254[_0x38d3('0x5c')]);return _0x1d380d[_0x38d3('0xe6')](_0x41965f);}})[_0x38d3('0x17')](function(_0xb1a845){if(_0xb1a845){_0xf964d6=_0xb1a845[_0x38d3('0x4e')];if(!_0x2ec254[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x41965f[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x2ec254[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x41965f[_0x38d3('0xda')]=qs['offset'](_0x2ec254['query'][_0x38d3('0xda')]);}return _0x1d380d[_0x38d3('0xe6')](_0x41965f);}})['then'](function(_0x55ba4d){if(_0x55ba4d){return _0x55ba4d?{'count':_0xf964d6,'rows':_0x55ba4d}:null;}})['then'](respondWithResult(_0x9e2afb,null))[_0x38d3('0x22')](handleError(_0x9e2afb,null));};exports[_0x38d3('0xe7')]=function(_0x34b08c,_0x3accdc){var _0x2801ca={'raw':!![],'where':{}};var _0x37f9f9={};var _0x39cd78={'count':0x0,'rows':[]};return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x34b08c[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x3accdc,null))[_0x38d3('0x17')](function(_0x57ba93){if(_0x57ba93){_0x37f9f9[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xe8')][_0x38d3('0x3d')]);_0x37f9f9[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x34b08c[_0x38d3('0x4b')]);_0x37f9f9['filters']=_[_0x38d3('0x58')](_0x37f9f9[_0x38d3('0x59')],_0x37f9f9[_0x38d3('0x4b')]);_0x2801ca[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x37f9f9[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x34b08c[_0x38d3('0x4b')]['fields']));_0x2801ca[_0x38d3('0x49')]=_0x2801ca[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x2801ca[_0x38d3('0x49')]:_0x37f9f9[_0x38d3('0x59')];if(!_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x2801ca[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x2801ca[_0x38d3('0xda')]=qs['offset'](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xda')]);}_0x2801ca['order']=qs[_0x38d3('0xd1')](_0x34b08c[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x2801ca['where']=qs[_0x38d3('0x57')](_['pick'](_0x34b08c[_0x38d3('0x4b')],_0x37f9f9['filters']));_0x2801ca[_0x38d3('0x44')][_0x38d3('0xe1')]=_0x57ba93['id'];if(_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x2801ca[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x2801ca[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x2801ca['attributes'],function(_0x2370a4){var _0x5464b9={};_0x5464b9[_0x2370a4]={'$like':'%'+_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5464b9;})});}_0x2801ca=_[_0x38d3('0x5b')]({},_0x2801ca,_0x34b08c['options']);return db[_0x38d3('0xe8')][_0x38d3('0x28')]({'where':_0x2801ca['where']})[_0x38d3('0x17')](function(_0x494bee){_0x39cd78['count']=_0x494bee;if(_0x34b08c[_0x38d3('0x4b')][_0x38d3('0x45')]){_0x2801ca[_0x38d3('0x46')]=[{'all':!![]}];}return db[_0x38d3('0xe8')][_0x38d3('0x8f')](_0x2801ca);})[_0x38d3('0x17')](function(_0x5150c7){_0x39cd78['rows']=_0x5150c7;return _0x39cd78;});}})[_0x38d3('0x17')](respondWithFilteredResult(_0x3accdc,_0x2801ca))['catch'](handleError(_0x3accdc,null));};exports[_0x38d3('0xe9')]=function(_0x40ed69,_0x141cf6){var _0x43466f={};var _0xfba3f1={};var _0x16478c;var _0x7d819b;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x40ed69[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x141cf6,null))[_0x38d3('0x17')](function(_0x2f9e13){if(_0x2f9e13){_0x16478c=_0x2f9e13;_0xfba3f1[_0x38d3('0x59')]=_[_0x38d3('0xce')](db['SmsInteraction'][_0x38d3('0x3d')]);_0xfba3f1['query']=_[_0x38d3('0xce')](_0x40ed69[_0x38d3('0x4b')]);_0xfba3f1[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0xfba3f1[_0x38d3('0x59')],_0xfba3f1[_0x38d3('0x4b')]);_0x43466f[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xfba3f1[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x40ed69[_0x38d3('0x4b')]['fields']));_0x43466f['attributes']=_0x43466f['attributes'][_0x38d3('0x4e')]?_0x43466f['attributes']:_0xfba3f1['model'];_0x43466f[_0x38d3('0xd0')]=qs['sort'](_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x43466f['where']=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x40ed69[_0x38d3('0x4b')],_0xfba3f1[_0x38d3('0x57')]));if(_0x40ed69['query'][_0x38d3('0x33')]){_0x43466f[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x43466f['where'],{'$or':_[_0x38d3('0x34')](_0x43466f['attributes'],function(_0x5a66bb){var _0x481485={};_0x481485[_0x5a66bb]={'$like':'%'+_0x40ed69[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x481485;})});}_0x43466f=_[_0x38d3('0x5b')]({},_0x43466f,_0x40ed69[_0x38d3('0x5c')]);return _0x16478c[_0x38d3('0xe9')](_0x43466f);}})[_0x38d3('0x17')](function(_0x1a6b43){if(_0x1a6b43){_0x7d819b=_0x1a6b43[_0x38d3('0x4e')];if(!_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x43466f[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x40ed69['query'][_0x38d3('0x27')]);_0x43466f[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x40ed69[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0x16478c[_0x38d3('0xe9')](_0x43466f);}})[_0x38d3('0x17')](function(_0xc783ea){if(_0xc783ea){return _0xc783ea?{'count':_0x7d819b,'rows':_0xc783ea}:null;}})[_0x38d3('0x17')](respondWithResult(_0x141cf6,null))[_0x38d3('0x22')](handleError(_0x141cf6,null));};exports[_0x38d3('0xea')]=function(_0x1dea62,_0x4fc3f5){var _0xb1995e={};var _0xe527bb={};var _0x54eeb6;var _0x59b66e;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x1dea62[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x4fc3f5,null))['then'](function(_0x244fe1){if(_0x244fe1){_0x54eeb6=_0x244fe1;_0xe527bb[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xeb')][_0x38d3('0x3d')]);_0xe527bb[_0x38d3('0x4b')]=_['keys'](_0x1dea62[_0x38d3('0x4b')]);_0xe527bb['filters']=_['intersection'](_0xe527bb[_0x38d3('0x59')],_0xe527bb[_0x38d3('0x4b')]);_0xb1995e[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xe527bb[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x1dea62['query']['fields']));_0xb1995e[_0x38d3('0x49')]=_0xb1995e['attributes'][_0x38d3('0x4e')]?_0xb1995e['attributes']:_0xe527bb[_0x38d3('0x59')];_0xb1995e[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x1dea62[_0x38d3('0x4b')]['sort']);_0xb1995e[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x1dea62[_0x38d3('0x4b')],_0xe527bb[_0x38d3('0x57')]));if(_0x1dea62[_0x38d3('0x4b')][_0x38d3('0x33')]){_0xb1995e[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0xb1995e[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0xb1995e[_0x38d3('0x49')],function(_0x3e478b){var _0x5bf3d4={};_0x5bf3d4[_0x3e478b]={'$like':'%'+_0x1dea62[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x5bf3d4;})});}_0xb1995e=_['merge']({},_0xb1995e,_0x1dea62[_0x38d3('0x5c')]);return _0x54eeb6['getFaxInteractions'](_0xb1995e);}})[_0x38d3('0x17')](function(_0x447932){if(_0x447932){_0x59b66e=_0x447932['length'];if(!_0x1dea62['query'][_0x38d3('0xd3')]('nolimit')){_0xb1995e[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x1dea62['query']['limit']);_0xb1995e[_0x38d3('0xda')]=qs['offset'](_0x1dea62['query'][_0x38d3('0xda')]);}return _0x54eeb6[_0x38d3('0xea')](_0xb1995e);}})[_0x38d3('0x17')](function(_0x1a7f40){if(_0x1a7f40){return _0x1a7f40?{'count':_0x59b66e,'rows':_0x1a7f40}:null;}})[_0x38d3('0x17')](respondWithResult(_0x4fc3f5,null))[_0x38d3('0x22')](handleError(_0x4fc3f5,null));};exports[_0x38d3('0xec')]=function(_0x52a07f,_0x3b04b4){var _0x2dfcfe={};var _0x46a633={};var _0x551b77;var _0x13f2ea;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x52a07f['params']['id']}})['then'](handleEntityNotFound(_0x3b04b4,null))[_0x38d3('0x17')](function(_0x3b24cb){if(_0x3b24cb){_0x551b77=_0x3b24cb;_0x46a633[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0xed')][_0x38d3('0x3d')]);_0x46a633[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x52a07f[_0x38d3('0x4b')]);_0x46a633[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x46a633[_0x38d3('0x59')],_0x46a633[_0x38d3('0x4b')]);_0x2dfcfe['attributes']=_[_0x38d3('0x58')](_0x46a633[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x2dfcfe[_0x38d3('0x49')]=_0x2dfcfe[_0x38d3('0x49')]['length']?_0x2dfcfe[_0x38d3('0x49')]:_0x46a633[_0x38d3('0x59')];_0x2dfcfe[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x52a07f[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x2dfcfe[_0x38d3('0x44')]=qs['filters'](_[_0x38d3('0xd2')](_0x52a07f[_0x38d3('0x4b')],_0x46a633['filters']));if(_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x2dfcfe[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x2dfcfe[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x2dfcfe['attributes'],function(_0x48b23b){var _0x3b5442={};_0x3b5442[_0x48b23b]={'$like':'%'+_0x52a07f[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x3b5442;})});}_0x2dfcfe=_[_0x38d3('0x5b')]({},_0x2dfcfe,_0x52a07f[_0x38d3('0x5c')]);return _0x551b77['getWhatsappInteractions'](_0x2dfcfe);}})[_0x38d3('0x17')](function(_0x346d85){if(_0x346d85){_0x13f2ea=_0x346d85['length'];if(!_0x52a07f[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x2dfcfe[_0x38d3('0x27')]=qs['limit'](_0x52a07f[_0x38d3('0x4b')]['limit']);_0x2dfcfe['offset']=qs['offset'](_0x52a07f['query']['offset']);}return _0x551b77[_0x38d3('0xec')](_0x2dfcfe);}})[_0x38d3('0x17')](function(_0x58add5){if(_0x58add5){return _0x58add5?{'count':_0x13f2ea,'rows':_0x58add5}:null;}})[_0x38d3('0x17')](respondWithResult(_0x3b04b4,null))['catch'](handleError(_0x3b04b4,null));};exports[_0x38d3('0xee')]=function(_0x7a2eea,_0x2cf0e8,_0x42ec1c){var _0x2c6c27;var _0x1bc67b;var _0x16dcce;var _0x13a6be=!_[_0x38d3('0x6b')](_0x7a2eea[_0x38d3('0x63')]['id'])?_0x7a2eea[_0x38d3('0x63')]['id']:!_[_0x38d3('0x6b')](_0x7a2eea[_0x38d3('0x2f')]['id'])?_0x7a2eea[_0x38d3('0x2f')]['id']:null;return db['User'][_0x38d3('0x5d')]({'where':{'id':_0x13a6be,'role':{'$or':[_0x38d3('0x2e'),_0x38d3('0x2f'),_0x38d3('0x76')]}},'attributes':['id',_0x38d3('0x36'),_0x38d3('0xef'),'mobile','role','internal','loginInPause']})[_0x38d3('0x17')](function(_0x589ce2){if(_0x589ce2){if(_0x589ce2[_0x38d3('0x2a')]==='agent'){_0x2c6c27=_0x589ce2;if(_0x7a2eea[_0x38d3('0x60')]['interface']){_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xf1'),_0x2c6c27[_0x7a2eea[_0x38d3('0x60')][_0x38d3('0xa3')]]);}else if(_0x7a2eea['body'][_0x38d3('0xf2')]){_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0x7a2eea['body'][_0x38d3('0xf2')]);}else{_0x16dcce=util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0x2c6c27['name']);}socket['to'](util['format'](_0x38d3('0xf3'),_0x2c6c27[_0x38d3('0x36')]))[_0x38d3('0x2b')](_0x38d3('0xf4'),{'user':{'id':_0x2c6c27['id'],'name':_0x2c6c27[_0x38d3('0x36')]},'ip':_0x7a2eea['headers'][_0x38d3('0xf5')]||_0x7a2eea[_0x38d3('0xf6')][_0x38d3('0xf7')]||_0x7a2eea[_0x38d3('0xf8')][_0x38d3('0xf7')]||_0x7a2eea[_0x38d3('0xf6')][_0x38d3('0xf8')][_0x38d3('0xf7')]});return db[_0x38d3('0xb2')][_0x38d3('0x38')]({'where':{'membername':_0x2c6c27[_0x38d3('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x38d3('0x94'))][(_0x38d3('0x95'))](_0x38d3('0xf9'));}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return _0x2c6c27['getVoiceQueues']({'raw':!![]});}})[_0x38d3('0x17')](function(_0x43fd82){if(_0x2c6c27){if(_0x43fd82){_0x1bc67b=_0x43fd82;if(_0x1bc67b[_0x38d3('0x4e')]){var _0x43633f=_0x1bc67b[_0x38d3('0x34')](function(_0x206125){var _0x42fef7={'membername':_0x2c6c27[_0x38d3('0x36')],'UserId':_0x2c6c27['id'],'queue_name':_0x206125[_0x38d3('0x36')],'VoiceQueueId':_0x206125['id'],'interface':_0x16dcce,'paused':_0x2c6c27[_0x38d3('0xa1')]||![],'penalty':_0x206125[_0x38d3('0xfa')]||0x0};return db[_0x38d3('0xb2')][_0x38d3('0xb3')](_0x42fef7);});return Promise['all'](_0x43633f);}}}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return db[_0x38d3('0xfb')][_0x38d3('0x8f')]({'where':{'membername':_0x2c6c27[_0x38d3('0x36')],'exitAt':null}});}})[_0x38d3('0x17')](function(_0x58e97d){if(_0x2c6c27){var _0x25cea4=[];_0x58e97d[_0x38d3('0xfc')](function(_0x4d42d5){_0x25cea4['push'](_0x4d42d5[_0x38d3('0x5f')]({'exitAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd'))}));});return Promise[_0x38d3('0x55')](_0x25cea4);}})[_0x38d3('0x17')](function(){if(_0x2c6c27){var _0x5150f8=[];var _0x1a2338=[];var _0x141a85=utils[_0x38d3('0xfe')]();var _0x3bf68c={'membername':_0x2c6c27[_0x38d3('0x36')],'interface':_0x16dcce,'enterAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'role':_0x2c6c27['role'],'internal':_0x2c6c27[_0x38d3('0x6a')]};_0x141a85[_0x38d3('0xfc')](function(_0x508fcf){_0x5150f8[_0x38d3('0x4f')](_['merge']({'channel':_0x508fcf,'type':_0x38d3('0xff'),'data1':_0x7a2eea['body'][_0x38d3('0x100')],'data2':_0x16dcce},_0x3bf68c));if(_0x2c6c27[_0x38d3('0xa1')]){_0x1a2338[_0x38d3('0x4f')](_['merge']({'channel':_0x508fcf,'type':_0x38d3('0x101'),'data1':'LOGININPAUSE'},_0x3bf68c));}});return db['MemberReport'][_0x38d3('0x8c')](_0x5150f8['concat'](_0x1a2338),{'individualHooks':!![]});}})[_0x38d3('0x17')](function(){if(_0x2c6c27){return _0x2c6c27[_0x38d3('0x5f')]({'online':!![],'lastLoginAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'voicePause':_0x2c6c27['loginInPause']||![],'mailPause':_0x2c6c27[_0x38d3('0xa1')]||![],'chatPause':_0x2c6c27[_0x38d3('0xa1')]||![],'faxPause':_0x2c6c27[_0x38d3('0xa1')]||![],'smsPause':_0x2c6c27[_0x38d3('0xa1')]||![],'openchannelPause':_0x2c6c27[_0x38d3('0xa1')]||![],'whatsappPause':_0x2c6c27[_0x38d3('0xa1')]||![],'pauseType':_0x2c6c27[_0x38d3('0xa1')]?_0x38d3('0x102'):null,'interface':_0x16dcce,'lastPauseAt':moment()[_0x38d3('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x47e637){if(_0x7a2eea[_0x38d3('0x103')]){return _0x42ec1c();}else{return Promise['resolve'](_0x47e637)[_0x38d3('0x17')](respondWithResult(_0x2cf0e8,null));}})[_0x38d3('0x22')](handleError(_0x2cf0e8,null));};exports[_0x38d3('0x104')]=function(_0x18ce23,_0x511e20){var _0x352404;return db[_0x38d3('0x3c')][_0x38d3('0x5d')]({'where':{'id':_0x18ce23[_0x38d3('0x63')]['id'],'role':_0x38d3('0x76')},'attributes':['id',_0x38d3('0x36'),'role']})[_0x38d3('0x17')](handleEntityNotFound(_0x511e20,null))['then'](function(_0xfc4b08){if(_0xfc4b08){_0x352404=_0xfc4b08;return db[_0x38d3('0xb2')][_0x38d3('0x38')]({'where':{'membername':_0x352404[_0x38d3('0x36')]},'individualHooks':!![]});}})[_0x38d3('0x17')](function(){return db['MemberReport'][_0x38d3('0x8f')]({'where':{'membername':_0x352404['name'],'exitAt':null}});})[_0x38d3('0x17')](function(_0x5d5a7c){var _0x4e4205=[];_0x5d5a7c[_0x38d3('0xfc')](function(_0x2f431c){_0x4e4205[_0x38d3('0x4f')](_0x2f431c[_0x38d3('0x5f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x4e4205);})[_0x38d3('0x17')](function(){return _0x352404['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x38d3('0x17')](respondWithResult(_0x511e20,null))[_0x38d3('0x22')](handleError(_0x511e20,null));};exports[_0x38d3('0x105')]=function(_0x4f7442,_0x3c699f){var _0xc94660;return db[_0x38d3('0xb2')][_0x38d3('0x5f')]({'paused':0x1},{'where':{'UserId':_0x4f7442['params']['id']},'individualHooks':!![]})[_0x38d3('0x17')](function(){return db['User']['find']({'where':{'id':_0x4f7442['params']['id'],'role':_0x38d3('0x76')},'attributes':['id','name',_0x38d3('0x2a'),_0x38d3('0x6a'),_0x38d3('0xa3'),_0x38d3('0xaf')]});})[_0x38d3('0x17')](handleEntityNotFound(_0x3c699f,null))[_0x38d3('0x17')](function(_0x1b693b){if(_0x1b693b){_0xc94660=_0x1b693b;return respondWithRpcPromise('QueuePause',_0x38d3('0x105'),{'id':_0xc94660['id'],'name':_0xc94660[_0x38d3('0x36')],'pause':!![]});}})['then'](function(){if(_0xc94660){return db[_0x38d3('0xfb')][_0x38d3('0x8f')]({'where':{'membername':_0xc94660['name'],'type':_0x38d3('0x101'),'exitAt':null}});}})['then'](function(_0x57cce4){if(_0x57cce4[_0x38d3('0x4e')]){var _0x393960=moment()[_0x38d3('0xf0')](_0x38d3('0xfd'));for(var _0x226c5b=0x0,_0x5caced=_0x57cce4[_0x38d3('0x4e')];_0x226c5b<_0x5caced;_0x226c5b++){_0x57cce4[_0x226c5b][_0x38d3('0x106')]({'exitAt':_0x393960});}}})[_0x38d3('0x17')](function(){var _0x2c9126=[];var _0x14001a=utils[_0x38d3('0xfe')]();_0x14001a[_0x38d3('0xfc')](function(_0x3c1835){_0x2c9126[_0x38d3('0x4f')]({'channel':_0x3c1835,'membername':_0xc94660[_0x38d3('0x36')],'interface':_[_0x38d3('0x6b')](_0xc94660[_0x38d3('0xa3')])?util[_0x38d3('0xf0')](_0x38d3('0xb0'),_0xc94660[_0x38d3('0x36')]):_0xc94660[_0x38d3('0xa3')],'type':_0x38d3('0x101'),'enterAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd')),'data1':_0x4f7442['body'][_0x38d3('0x3f')]||'DEFAULT\x20PAUSE','role':_0xc94660[_0x38d3('0x2a')],'internal':_0xc94660[_0x38d3('0x6a')]});});return db[_0x38d3('0xfb')][_0x38d3('0x8c')](_0x2c9126,{'individualHooks':!![]});})[_0x38d3('0x17')](function(){return _0xc94660[_0x38d3('0x5f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4f7442[_0x38d3('0x60')][_0x38d3('0x3f')]||_0x38d3('0x107'),'lastPauseAt':moment()[_0x38d3('0xf0')](_0x38d3('0xfd'))});})[_0x38d3('0x17')](respondWithResult(_0x3c699f,null))[_0x38d3('0x22')](handleError(_0x3c699f,null));};exports[_0x38d3('0x108')]=function(_0x626b8a,_0x526b58){if(_0x626b8a[_0x38d3('0x60')]['channel']&&!utils[_0x38d3('0xa4')](_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')])){throw new APIBadRequestError(util[_0x38d3('0xf0')](_0x38d3('0x109'),_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')]));}return db['User']['find']({'where':{'id':_0x626b8a['params']['id']},'attributes':['id',_0x38d3('0x36'),_0x38d3('0x2a'),'internal',_0x38d3('0xa3'),_0x38d3('0xaf'),_0x38d3('0xa2'),_0x38d3('0x10a'),_0x38d3('0x10b'),_0x38d3('0x10c'),_0x38d3('0x10d'),_0x38d3('0x10e'),_0x38d3('0x10f'),_0x38d3('0x110'),_0x38d3('0x111')]})[_0x38d3('0x17')](function(_0x353cf9){if(!_0x353cf9){throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x626b8a['params']['id']));}return _0x353cf9[_0x38d3('0x108')](_0x626b8a[_0x38d3('0x60')][_0x38d3('0xa0')]);})[_0x38d3('0x17')](respondWithResult(_0x526b58,null))[_0x38d3('0x22')](APIHandleError(_0x526b58));};exports[_0x38d3('0x113')]=function(_0x168c5a,_0x3303c7){var _0x3c9cc2={};var _0xb49f5f={};var _0x1258be;var _0x4650bb;return db[_0x38d3('0x3c')]['findOne']({'where':{'id':_0x168c5a[_0x38d3('0x63')]['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x3303c7,null))[_0x38d3('0x17')](function(_0x41acbf){if(_0x41acbf){_0x1258be=_0x41acbf;_0xb49f5f['model']=_[_0x38d3('0xce')](db[_0x38d3('0x114')][_0x38d3('0x3d')]);_0xb49f5f[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x168c5a[_0x38d3('0x4b')]);_0xb49f5f['filters']=_[_0x38d3('0x58')](_0xb49f5f[_0x38d3('0x59')],_0xb49f5f[_0x38d3('0x4b')]);_0x3c9cc2[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0xb49f5f['model'],qs['fields'](_0x168c5a['query'][_0x38d3('0x5a')]));_0x3c9cc2[_0x38d3('0x49')]=_0x3c9cc2[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x3c9cc2[_0x38d3('0x49')]:_0xb49f5f[_0x38d3('0x59')];_0x3c9cc2[_0x38d3('0xd0')]=qs['sort'](_0x168c5a[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x3c9cc2['where']=qs[_0x38d3('0x57')](_['pick'](_0x168c5a[_0x38d3('0x4b')],_0xb49f5f[_0x38d3('0x57')]));if(_0x168c5a[_0x38d3('0x4b')][_0x38d3('0x33')]){_0x3c9cc2[_0x38d3('0x44')]=_['merge'](_0x3c9cc2[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x3c9cc2[_0x38d3('0x49')],function(_0x14ac3f){var _0x440517={};_0x440517[_0x14ac3f]={'$like':'%'+_0x168c5a['query'][_0x38d3('0x33')]+'%'};return _0x440517;})});}_0x3c9cc2=_['merge']({},_0x3c9cc2,_0x168c5a[_0x38d3('0x5c')]);return _0x1258be['getTeams'](_0x3c9cc2);}})[_0x38d3('0x17')](function(_0x22e604){if(_0x22e604){_0x4650bb=_0x22e604[_0x38d3('0x4e')];if(!_0x168c5a[_0x38d3('0x4b')][_0x38d3('0xd3')](_0x38d3('0xd9'))){_0x3c9cc2[_0x38d3('0x27')]=qs[_0x38d3('0x27')](_0x168c5a[_0x38d3('0x4b')][_0x38d3('0x27')]);_0x3c9cc2[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x168c5a['query'][_0x38d3('0xda')]);}return _0x1258be['getTeams'](_0x3c9cc2);}})[_0x38d3('0x17')](function(_0x55fde4){if(_0x55fde4){return _0x55fde4?{'count':_0x4650bb,'rows':_0x55fde4}:null;}})[_0x38d3('0x17')](respondWithResult(_0x3303c7,null))[_0x38d3('0x22')](handleError(_0x3303c7,null));};exports[_0x38d3('0x115')]=function(_0x324970,_0x56fd8e){var _0x2ba168=_0x324970[_0x38d3('0x63')]['id'];var _0x430dda=_0x324970[_0x38d3('0x60')]?_0x324970['body'][_0x38d3('0x65')]:null;var _0x530d1c=[];return Promise['resolve']()[_0x38d3('0x17')](function(){if(!_0x430dda)throw new APIBadRequestError(_0x38d3('0x116'));})['then'](function(){return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x2ba168}});})[_0x38d3('0x17')](function(_0x30ac40){if(!_0x30ac40)throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x324970[_0x38d3('0x63')]['id']));return db[_0x38d3('0x6d')]['transaction'](function(_0x345d8d){return _0x30ac40[_0x38d3('0x115')](_0x430dda,{'transaction':_0x345d8d})[_0x38d3('0x17')](function(){return db[_0x38d3('0x114')][_0x38d3('0x8f')]({'where':{'id':{'$in':_0x430dda}}});})['then'](function(_0x3704b3){var _0x1eaa90=_[_0x38d3('0x34')](_0x3704b3,function(_0x4d483c){return _0x4d483c[_0x38d3('0x117')]();});return Promise[_0x38d3('0x55')](_0x1eaa90);})[_0x38d3('0x17')](function(_0x51ca43){_0x530d1c=_['flattenDeep'](_0x51ca43);var _0x4f9d0a=_['map'](_0x530d1c,function(_0x217326){return _0x217326[_0x38d3('0x118')](_0x30ac40['id'],{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x4f9d0a);})[_0x38d3('0x17')](function(){if(!_0x30ac40[_0x38d3('0xaf')])return;var _0x2774ed=_[_0x38d3('0x33')](_0x530d1c,function(_0x1e8ab4){return _0x1e8ab4['getDataValue'](_0x38d3('0xa0'))===_0x38d3('0x119');});var _0x40fa08=_[_0x38d3('0x34')](_0x2774ed,function(_0x1dabd7){return db[_0x38d3('0xb2')]['upsert']({'membername':_0x30ac40[_0x38d3('0x36')],'UserId':_0x30ac40['id'],'queue_name':_0x1dabd7[_0x38d3('0x36')],'VoiceQueueId':_0x1dabd7['id'],'interface':_[_0x38d3('0x6b')](_0x30ac40[_0x38d3('0xa3')])?util['format'](_0x38d3('0xb0'),_0x30ac40['name']):_0x30ac40[_0x38d3('0xa3')],'paused':_0x30ac40[_0x38d3('0xa2')]||![],'penalty':_0x30ac40['penalty']},{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x40fa08);})[_0x38d3('0x17')](function(){return db['TeamVoicePrefix'][_0x38d3('0x8f')]({'where':{'teamId':{'$in':_0x430dda}}});})[_0x38d3('0x17')](function(_0x1e05fe){var _0x387c8b=_[_0x38d3('0x34')](_0x1e05fe,function(_0x2b52ee){return db['UserVoicePrefix'][_0x38d3('0x88')]({'UserId':_0x30ac40['id'],'VoicePrefixId':_0x2b52ee[_0x38d3('0x11a')]},{'transaction':_0x345d8d});});return Promise[_0x38d3('0x55')](_0x387c8b);});});})['then'](function(){for(var _0x27cd11=0x0;_0x27cd11<_0x530d1c['length'];_0x27cd11++){var _0x55d252=_0x530d1c[_0x27cd11]['getDataValue'](_0x38d3('0xa0'));var _0x458208=_0x55d252+_0x38d3('0xab');socket['emit'](_0x38d3('0x2f')+_0x55d252+_0x38d3('0xac'),{'UserId':_0x2ba168,['queueField']:_0x530d1c[_0x27cd11]['id']});}})[_0x38d3('0x17')](respondWithStatusCode(_0x56fd8e,null))[_0x38d3('0x22')](APIHandleError(_0x56fd8e));};exports['removeTeams']=function(_0x7e5ab3,_0x1a719e){var _0x770cc2=_0x7e5ab3['params']['id'];var _0x2ddaac=null;if(_0x7e5ab3[_0x38d3('0x4b')][_0x38d3('0x65')]){_0x2ddaac=_[_0x38d3('0xb6')](_0x7e5ab3['query'][_0x38d3('0x65')])?_0x7e5ab3['query'][_0x38d3('0x65')]:[_0x7e5ab3['query'][_0x38d3('0x65')]];}var _0x2be947=[];return Promise['resolve']()[_0x38d3('0x17')](function(){if(!_0x2ddaac)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db['User'][_0x38d3('0xcd')]({'where':{'id':_0x770cc2}});})['then'](function(_0x4dc049){if(!_0x4dc049)throw new APINotFoundError(util[_0x38d3('0xf0')](_0x38d3('0x112'),_0x7e5ab3[_0x38d3('0x63')]['id']));return db[_0x38d3('0x6d')][_0x38d3('0x11b')](function(_0x3761cd){return _0x4dc049['removeTeams'](_0x2ddaac,{'transaction':_0x3761cd})['then'](function(){return db['Team'][_0x38d3('0x8f')]({'where':{'id':{'$in':_0x2ddaac}}});})['then'](function(_0x19a930){var _0x1ade24=_['map'](_0x19a930,function(_0x55ece2){return _0x55ece2[_0x38d3('0x117')]();});return Promise['all'](_0x1ade24);})[_0x38d3('0x17')](function(_0xf816b2){_0x2be947=_[_0x38d3('0x11c')](_0xf816b2);var _0x5b63ab=_[_0x38d3('0x34')](_0x2be947,function(_0x1e9df5){return _0x1e9df5[_0x38d3('0x11d')](_0x4dc049['id'],{'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x5b63ab);})[_0x38d3('0x17')](function(){if(!_0x4dc049[_0x38d3('0xaf')])return;var _0x2ec15a=_['filter'](_0x2be947,function(_0x58f0cb){return _0x58f0cb[_0x38d3('0x11e')](_0x38d3('0xa0'))==='Voice';});var _0x4a1d87=_[_0x38d3('0x34')](_0x2ec15a,function(_0x485e2e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x485e2e['id'],'UserId':_0x4dc049['id']},'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x4a1d87);})[_0x38d3('0x17')](function(){return db[_0x38d3('0x11f')]['findAll']({'where':{'teamId':{'$in':_0x2ddaac}}});})[_0x38d3('0x17')](function(_0x3e6b57){var _0x50aec2=_[_0x38d3('0x34')](_0x3e6b57,function(_0x2baee5){return db[_0x38d3('0x120')][_0x38d3('0x38')]({'where':{'UserId':_0x4dc049['id'],'VoicePrefixId':_0x2baee5[_0x38d3('0x11a')]}},{'transaction':_0x3761cd});});return Promise[_0x38d3('0x55')](_0x50aec2);});});})['then'](function(){for(var _0x4e990a=0x0;_0x4e990a<_0x2be947['length'];_0x4e990a++){var _0x301c23=_0x2be947[_0x4e990a][_0x38d3('0x11e')](_0x38d3('0xa0'));var _0x47faa9=_0x301c23+_0x38d3('0xab');socket['emit'](_0x38d3('0x2f')+_0x301c23+'Queue:remove',{'UserId':_0x770cc2,['queueField']:_0x2be947[_0x4e990a]['id']});}})[_0x38d3('0x17')](respondWithStatusCode(_0x1a719e,null))[_0x38d3('0x22')](APIHandleError(_0x1a719e));};exports['getLists']=function(_0x23643b,_0x553043){var _0x55bcc4={};var _0x70a1dd={};var _0xaa6484;var _0x2c07ba;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x23643b['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x553043,null))[_0x38d3('0x17')](function(_0x99df83){if(_0x99df83){_0xaa6484=_0x99df83;_0x70a1dd[_0x38d3('0x59')]=_['keys'](db[_0x38d3('0x121')][_0x38d3('0x3d')]);_0x70a1dd[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x23643b[_0x38d3('0x4b')]);_0x70a1dd[_0x38d3('0x57')]=_['intersection'](_0x70a1dd[_0x38d3('0x59')],_0x70a1dd['query']);_0x55bcc4[_0x38d3('0x49')]=_[_0x38d3('0x58')](_0x70a1dd[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x23643b[_0x38d3('0x4b')]['fields']));_0x55bcc4[_0x38d3('0x49')]=_0x55bcc4[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x55bcc4['attributes']:_0x70a1dd['model'];_0x55bcc4[_0x38d3('0xd0')]=qs['sort'](_0x23643b['query'][_0x38d3('0xd1')]);_0x55bcc4[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x23643b[_0x38d3('0x4b')],_0x70a1dd[_0x38d3('0x57')]));if(_0x23643b['query'][_0x38d3('0x33')]){_0x55bcc4['where']=_[_0x38d3('0x5b')](_0x55bcc4[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x55bcc4[_0x38d3('0x49')],function(_0x20bdf9){var _0x21bd7f={};_0x21bd7f[_0x20bdf9]={'$like':'%'+_0x23643b[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x21bd7f;})});}_0x55bcc4=_[_0x38d3('0x5b')]({},_0x55bcc4,_0x23643b[_0x38d3('0x5c')]);return _0xaa6484[_0x38d3('0x122')](_0x55bcc4);}})['then'](function(_0x2a5d6b){if(_0x2a5d6b){_0x2c07ba=_0x2a5d6b['length'];if(!_0x23643b[_0x38d3('0x4b')][_0x38d3('0xd3')]('nolimit')){_0x55bcc4[_0x38d3('0x27')]=qs['limit'](_0x23643b[_0x38d3('0x4b')]['limit']);_0x55bcc4[_0x38d3('0xda')]=qs[_0x38d3('0xda')](_0x23643b[_0x38d3('0x4b')][_0x38d3('0xda')]);}return _0xaa6484['getLists'](_0x55bcc4);}})[_0x38d3('0x17')](function(_0x57600b){if(_0x57600b){return _0x57600b?{'count':_0x2c07ba,'rows':_0x57600b}:null;}})['then'](respondWithResult(_0x553043,null))[_0x38d3('0x22')](handleError(_0x553043,null));};exports['getAgents']=function(_0x2d63b2,_0x253566){var _0x4b4fc2={};var _0x310c7c={};var _0x2d4750;return db[_0x38d3('0x3c')][_0x38d3('0xcd')]({'where':{'id':_0x2d63b2['params']['id']}})[_0x38d3('0x17')](handleEntityNotFound(_0x253566,null))[_0x38d3('0x17')](function(_0x581dab){if(_0x581dab){_0x2d4750=_0x581dab;_0x310c7c[_0x38d3('0x59')]=_[_0x38d3('0xce')](db[_0x38d3('0x3c')]['rawAttributes']);_0x310c7c[_0x38d3('0x4b')]=_[_0x38d3('0xce')](_0x2d63b2[_0x38d3('0x4b')]);_0x310c7c[_0x38d3('0x57')]=_[_0x38d3('0x58')](_0x310c7c['model'],_0x310c7c[_0x38d3('0x4b')]);_0x4b4fc2['attributes']=_[_0x38d3('0x58')](_0x310c7c[_0x38d3('0x59')],qs[_0x38d3('0x5a')](_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0x5a')]));_0x4b4fc2['attributes']=_0x4b4fc2[_0x38d3('0x49')][_0x38d3('0x4e')]?_0x4b4fc2['attributes']:_0x310c7c[_0x38d3('0x59')];_0x4b4fc2[_0x38d3('0xd0')]=qs[_0x38d3('0xd1')](_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0xd1')]);_0x4b4fc2[_0x38d3('0x44')]=qs[_0x38d3('0x57')](_[_0x38d3('0xd2')](_0x2d63b2[_0x38d3('0x4b')],_0x310c7c[_0x38d3('0x57')]));if(_0x2d63b2['query']['filter']){_0x4b4fc2[_0x38d3('0x44')]=_[_0x38d3('0x5b')](_0x4b4fc2[_0x38d3('0x44')],{'$or':_[_0x38d3('0x34')](_0x4b4fc2[_0x38d3('0x49')],function(_0x1ce0dd){var _0x64d503={};_0x64d503[_0x1ce0dd]={'$like':'%'+_0x2d63b2[_0x38d3('0x4b')][_0x38d3('0x33')]+'%'};return _0x64d503;})});}_0x4b4fc2['model']=db[_0x38d3('0x3c')];_0x4b4fc2['as']=_0x38d3('0x30');_0x4b4fc2=_[_0x38d3('0x5b')]({},_0x4b4fc2,_0x2d63b2[_0x38d3('0x5c')]);return _0x2d4750[_0x38d3('0x123')]({'include':[_0x4b4fc2]});}})[_0x38d3('0x17')](function(_0x481098){if(_0x481098){var _0x4823db={},_0xb0f3c2=[];for(var _0x2871bd=0x0;_0x2871bd<_0x481098[_0x38d3('0x4e')];_0x2871bd+=0x1){for(var _0x30594c=0x0,_0x1fc6a9;_0x30594c<_0x481098[_0x2871bd][_0x38d3('0x30')][_0x38d3('0x4e')];_0x30594c+=0x1){_0x1fc6a9=_0x481098[_0x2871bd][_0x38d3('0x30')][_0x30594c]['get']({'plain':!![]});_0x4823db[_0x1fc6a9['id']]=_0x1fc6a9;}}_0x4823db=_[_0x38d3('0x124')](_0x4823db);for(var _0x350c3c=qs[_0x38d3('0xda')](_0x2d63b2[_0x38d3('0x4b')]['offset']);_0x350c3c<_0x4823db[_0x38d3('0x4e')]&&_0xb0f3c2[_0x38d3('0x4e')]=_0x20655a){_0x32a3c1=_0x20655a;_0x38e41c=0xc8;}else{_0x38e41c=0xce;}_0x5cab3a[_0xdf45('0x20')](_0x38e41c);return _0x5cab3a['set'](_0xdf45('0x27'),_0x11c260+'-'+_0x32a3c1+'/'+_0x20655a)[_0xdf45('0x22')](_0x2bc06e);}return null;};}function saveUpdates(_0x5a2b61){return function(_0x1ca3c6){if(_0x1ca3c6){return _0x1ca3c6[_0xdf45('0x28')](_0x5a2b61)['then'](function(_0x3fc5fa){if(_0x3fc5fa[_0xdf45('0x29')]===_0xdf45('0x2a')){socket['emit'](_0xdf45('0x2b')+_0x3fc5fa['id'],_0x3fc5fa);}return _0x3fc5fa;});}return null;};}function removeEntity(_0x7165bd){return function(_0x129b4f){if(_0x129b4f){return _0x129b4f[_0xdf45('0x2c')]()[_0xdf45('0x16')](function(){var _0x1195b1=_0x129b4f['get']({'plain':!![]});if(_0x1195b1[_0xdf45('0x29')]==='admin')return;var _0x5981f=[{'name':_0xdf45('0x2d'),'value':_0xdf45('0x2e'),'ignore':!![]},{'name':'Agents','value':_0xdf45('0x2a'),'ignore':![]},{'name':_0xdf45('0x2f'),'value':_0xdf45('0x30'),'ignore':![]}];var _0x4bc7a9=_(_0x5981f)[_0xdf45('0x31')](_0xdf45('0x32'))[_0xdf45('0x33')](_0xdf45('0x34'))['value']();if(_[_0xdf45('0x35')](_0x4bc7a9,_0x1195b1[_0xdf45('0x29')])){return;}var _0x262bce=_[_0xdf45('0x36')](_0x5981f,['value',_0x1195b1['role']])['name'];return db[_0xdf45('0x37')]['destroy']({'where':{'type':_0x262bce,'resourceId':_0x1195b1['id']}})[_0xdf45('0x16')](function(){return _0x129b4f;});})[_0xdf45('0x16')](function(){_0x7165bd[_0xdf45('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d86b9){return function(_0x47b562){if(!_0x47b562){_0x1d86b9[_0xdf45('0x1f')](0x194);}return _0x47b562;};}function handleError(_0x3490d8,_0x1102a6){_0x1102a6=_0x1102a6||0x1f4;return function(_0x4da77b){logger['error'](_0x4da77b['stack']);if(_0x4da77b['name']){delete _0x4da77b[_0xdf45('0x38')];}_0x3490d8[_0xdf45('0x20')](_0x1102a6)[_0xdf45('0x39')](_0x4da77b);};}exports[_0xdf45('0x3a')]=function(_0x5b1cd2,_0x3bb20a){var _0x42fd7f={},_0x1d10de={'count':0x0,'rows':[]};var _0x3d5670=_(db[_0xdf45('0x3b')][_0xdf45('0x3c')])['map'](function(_0x1e4a65){return{'name':_0x1e4a65[_0xdf45('0x3d')],'type':_0x1e4a65[_0xdf45('0x3e')][_0xdf45('0x3f')]};})['filter'](function(_0x469af5){return!_[_0xdf45('0x35')]([_0xdf45('0x40'),_0xdf45('0x41')],_0x469af5[_0xdf45('0x38')]);})['value']();_0x42fd7f=qs[_0xdf45('0x42')](_0x3d5670,_0x5b1cd2);var _0x5405cc={'where':_0x42fd7f[_0xdf45('0x43')]};return db[_0xdf45('0x3b')][_0xdf45('0x24')](_0x5405cc)[_0xdf45('0x16')](function(_0x44c940){_0x1d10de[_0xdf45('0x24')]=_0x44c940;if(_0x5b1cd2['query']['includeAll']){_0x42fd7f[_0xdf45('0x44')]=[{'all':!![]}];}if(_0x5b1cd2[_0xdf45('0x45')][_0xdf45('0x46')]===_0xdf45('0x47')){_0x42fd7f[_0xdf45('0x44')]=[{'model':db['UserSetting'],'as':_0xdf45('0x46')}];}if(!_['includes'](_0x42fd7f[_0xdf45('0x48')],'id')){_0x42fd7f[_0xdf45('0x48')][_0xdf45('0x49')]('id');}return db['User']['findAll'](_0x42fd7f);})[_0xdf45('0x16')](function(_0x38eddc){_0x1d10de['rows']=_0x38eddc;if(_0x5b1cd2[_0xdf45('0x45')][_0xdf45('0x4a')]===_0xdf45('0x47')){var _0x38434a=[];for(var _0x7a44e=0x0;_0x7a44e<_0x1d10de[_0xdf45('0x4b')][_0xdf45('0x4c')];_0x7a44e++){_0x38434a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x4d'),_0x1d10de['rows'][_0x7a44e][_0xdf45('0x4e')]));_0x38434a[_0xdf45('0x49')](get_open_tabs('sms',_0x1d10de[_0xdf45('0x4b')][_0x7a44e][_0xdf45('0x4e')]));_0x38434a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x4f'),_0x1d10de['rows'][_0x7a44e][_0xdf45('0x4e')]));_0x38434a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x50'),_0x1d10de[_0xdf45('0x4b')][_0x7a44e]['dataValues']));_0x38434a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x51'),_0x1d10de[_0xdf45('0x4b')][_0x7a44e]['dataValues']));_0x38434a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x52'),_0x1d10de[_0xdf45('0x4b')][_0x7a44e][_0xdf45('0x4e')]));}return Promise[_0xdf45('0x53')](_0x38434a)[_0xdf45('0x16')](function(){return _0x1d10de;});}else{return _0x1d10de;}})['then'](respondWithFilteredResult(_0x3bb20a,_0x42fd7f))['catch'](handleError(_0x3bb20a,null));};exports['show']=function(_0x6346c9,_0x25feab){var _0x5dd036={'raw':![],'where':{'id':_0x6346c9['params']['id']}},_0x19e1c6={};_0x19e1c6[_0xdf45('0x54')]=_[_0xdf45('0x55')](_[_0xdf45('0x56')](db[_0xdf45('0x3b')]['rawAttributes']),[_0xdf45('0x40'),_0xdf45('0x41')]);_0x19e1c6['query']=_[_0xdf45('0x56')](_0x6346c9[_0xdf45('0x45')]);_0x19e1c6[_0xdf45('0x57')]=_['intersection'](_0x19e1c6[_0xdf45('0x54')],_0x19e1c6[_0xdf45('0x45')]);_0x5dd036[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x19e1c6['model'],qs['fields'](_0x6346c9[_0xdf45('0x45')][_0xdf45('0x59')]));_0x5dd036[_0xdf45('0x48')]=_0x5dd036[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x5dd036['attributes']:_0x19e1c6['model'];if(_0x6346c9['query']['includeAll']){_0x5dd036[_0xdf45('0x44')]=[{'all':!![]}];}if(_0x6346c9['query'][_0xdf45('0x46')]==='true'){_0x5dd036[_0xdf45('0x44')]=[{'model':db[_0xdf45('0x5a')],'as':'userSetting'}];}_0x5dd036=_[_0xdf45('0x5b')]({},_0x5dd036,_0x6346c9[_0xdf45('0x5c')]);if(!_[_0xdf45('0x35')](_0x5dd036['attributes'],'id')){_0x5dd036[_0xdf45('0x48')][_0xdf45('0x49')]('id');}return db['User'][_0xdf45('0x36')](_0x5dd036)[_0xdf45('0x16')](handleEntityNotFound(_0x25feab,null))[_0xdf45('0x16')](function(_0x534e8c){var _0x6e2b52=[];values=_0x534e8c;if(_0x6346c9[_0xdf45('0x45')][_0xdf45('0x4a')]==='true'){_0x6e2b52[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x4d'),_0x534e8c[_0xdf45('0x4e')]));_0x6e2b52[_0xdf45('0x49')](get_open_tabs('sms',_0x534e8c['dataValues']));_0x6e2b52[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x51'),_0x534e8c['dataValues']));_0x6e2b52['push'](get_open_tabs(_0xdf45('0x52'),_0x534e8c[_0xdf45('0x4e')]));_0x6e2b52[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x4f'),_0x534e8c[_0xdf45('0x4e')]));_0x6e2b52[_0xdf45('0x49')](get_open_tabs('mail',_0x534e8c[_0xdf45('0x4e')]));return Promise[_0xdf45('0x53')](_0x6e2b52);}else{return values;}})[_0xdf45('0x16')](function(){return values;})[_0xdf45('0x16')](respondWithResult(_0x25feab,null))[_0xdf45('0x5d')](handleError(_0x25feab,null));};exports[_0xdf45('0x28')]=function(_0x5525d2,_0x28c1c7){if(_0x5525d2[_0xdf45('0x5e')]['id']){delete _0x5525d2[_0xdf45('0x5e')]['id'];}delete _0x5525d2[_0xdf45('0x5e')]['role'];return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x5525d2[_0xdf45('0x5f')]['id']}})['then'](handleEntityNotFound(_0x28c1c7,null))[_0xdf45('0x16')](saveUpdates(_0x5525d2[_0xdf45('0x5e')],null))[_0xdf45('0x16')](respondWithResult(_0x28c1c7,null))[_0xdf45('0x5d')](handleError(_0x28c1c7,null));};exports[_0xdf45('0x60')]=function(_0x334f92,_0x3aa949){return db[_0xdf45('0x3b')]['describe']()['then'](respondWithResult(_0x3aa949,null))[_0xdf45('0x5d')](handleError(_0x3aa949,null));};exports[_0xdf45('0x61')]=function(_0x25d96b,_0x562d77){return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x25d96b[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x562d77,null))[_0xdf45('0x16')](function(_0x18b29b){if(_0x18b29b){return _0x18b29b[_0xdf45('0x61')](_0x25d96b[_0xdf45('0x5e')][_0xdf45('0x62')],_[_0xdf45('0x63')](_0x25d96b[_0xdf45('0x5e')],['ids','id'])||{});}})[_0xdf45('0x16')](respondWithResult(_0x562d77,null))[_0xdf45('0x5d')](handleError(_0x562d77,null));};function validateUser(_0x5b41f9){return new Promise(function(_0x57bc97,_0x460125){if(_0x5b41f9[_0xdf45('0x64')])return _0x57bc97(_0x5b41f9);return db[_0xdf45('0x65')][_0xdf45('0x66')](0x1)[_0xdf45('0x16')](function(_0x500acf){if(_0x500acf[_0xdf45('0x67')])authService[_0xdf45('0x68')](_0x5b41f9[_0xdf45('0x40')]);db['User']['max'](_0xdf45('0x64'))[_0xdf45('0x16')](function(_0x52573a){if(_['isNil'](_0x52573a)){_0x5b41f9['internal']=_0x500acf[_0xdf45('0x69')]||0x1;return;}if(_['isNil'](_0x500acf[_0xdf45('0x69')])||_0x500acf['min_internal']===_0x52573a){_0x5b41f9[_0xdf45('0x64')]=_0x52573a+0x1;return;}if(_0x500acf[_0xdf45('0x69')]>_0x52573a){_0x5b41f9['internal']=_0x500acf['min_internal'];return;}return db['sequelize'][_0xdf45('0x45')](_0xdf45('0x6a'),{'type':db[_0xdf45('0x6b')][_0xdf45('0x6c')][_0xdf45('0x6d')]})['then'](function(_0x2e4104){if(_0x2e4104&&_0x2e4104[_0xdf45('0x4c')]){for(var _0x5b7ff1=0x0,_0xca4974=_0x2e4104[_0xdf45('0x4c')];_0x5b7ff1<_0xca4974&&_['isNil'](_0x5b41f9['internal']);_0x5b7ff1++){if(_0x500acf[_0xdf45('0x69')]<=_0x2e4104[_0x5b7ff1][_0xdf45('0x6e')]){_0x5b41f9['internal']=_0x2e4104[_0x5b7ff1][_0xdf45('0x6e')];}else if(_0x500acf[_0xdf45('0x69')]>_0x2e4104[_0x5b7ff1]['from']&&_0x500acf[_0xdf45('0x69')]<=_0x2e4104[_0x5b7ff1]['to']){_0x5b41f9[_0xdf45('0x64')]=_0x500acf[_0xdf45('0x69')];}}}if(_[_0xdf45('0x6f')](_0x5b41f9[_0xdf45('0x64')])){_0x5b41f9[_0xdf45('0x64')]=_0x52573a+0x1;}return _0x57bc97(_0x5b41f9);});});})[_0xdf45('0x5d')](function(_0x41f790){_0x460125(_0x41f790);});});}function updateUser(_0x14c0d7){return new Promise(function(_0x32883b,_0x42982e){try{if(_0x14c0d7[_0xdf45('0x70')]){_0x14c0d7[_0xdf45('0x71')]=_0x14c0d7['internal'];_0x14c0d7[_0xdf45('0x72')]={'mailbox':_0x14c0d7[_0xdf45('0x64')],'password':_0x14c0d7[_0xdf45('0x40')],'fullname':_0x14c0d7[_0xdf45('0x73')],'email':_0x14c0d7[_0xdf45('0x74')]};}if(_0x14c0d7[_0xdf45('0x29')]===_0xdf45('0x2a')){if(!_0x14c0d7['permissions'])_0x14c0d7[_0xdf45('0x75')]=[_0xdf45('0x76'),_0xdf45('0x77'),'103',_0xdf45('0x78'),_0xdf45('0x79'),_0xdf45('0x7a'),'105',_0xdf45('0x7b'),'107','108',_0xdf45('0x7c'),_0xdf45('0x7d'),_0xdf45('0x7e'),'114',_0xdf45('0x7f')];}_0x32883b(_0x14c0d7);}catch(_0x58aeca){_0x42982e(_0x58aeca);}});}exports[_0xdf45('0x80')]=function(_0x4f5542,_0xba9993){if(_0x4f5542[_0xdf45('0x2e')]['role']===_0xdf45('0x2a'))throw new Error(_0xdf45('0x81'));if(_0x4f5542['body'][_0xdf45('0x29')]===_0xdf45('0x2e')&&_0x4f5542[_0xdf45('0x2e')][_0xdf45('0x29')]!==_0xdf45('0x82')){throw new Error(_0xdf45('0x83'));}if(_0x4f5542[_0xdf45('0x5e')][_0xdf45('0x29')]===_0xdf45('0x82')&&_0x4f5542[_0xdf45('0x2e')][_0xdf45('0x29')]!==_0xdf45('0x82')){throw new Error(_0xdf45('0x84'));}return licenseUtil[_0xdf45('0x85')]([_0x4f5542[_0xdf45('0x5e')]])['then'](function(){return validateUser(_0x4f5542['body']);})[_0xdf45('0x16')](function(_0x4e756b){return updateUser(_0x4e756b)['then'](function(_0x15820d){if(_0x15820d[_0xdf45('0x29')]===_0xdf45('0x82')){_0x15820d[_0xdf45('0x86')]=_0x4f5542[_0xdf45('0x2e')][_0xdf45('0x86')];delete _0x15820d[_0xdf45('0x87')];}return _0x15820d;});})[_0xdf45('0x16')](function(_0x22d77c){return db[_0xdf45('0x3b')]['create'](_0x22d77c,{'include':[{'model':db[_0xdf45('0x72')],'as':_0xdf45('0x72')}]});})[_0xdf45('0x16')](function(_0x80e50c){if(_0x4f5542[_0xdf45('0x5e')]['role']==='user')return _0x80e50c;if(_0x4f5542[_0xdf45('0x2e')][_0xdf45('0x29')]!=='user')return _0x80e50c;return db[_0xdf45('0x88')][_0xdf45('0x36')]({'where':{'name':_0x80e50c[_0xdf45('0x29')]===_0xdf45('0x2a')?_0xdf45('0x89'):_0xdf45('0x2f'),'userProfileId':_0x4f5542[_0xdf45('0x2e')]['userProfileId']},'raw':!![]})[_0xdf45('0x16')](function(_0x3cddf7){if(!_0x3cddf7||_0x3cddf7['autoAssociation']!=0x0)return _0x80e50c;return db[_0xdf45('0x37')]['create']({'name':_0x80e50c['name'],'resourceId':_0x80e50c['id'],'type':_0x3cddf7['name'],'sectionId':_0x3cddf7['id']},{})[_0xdf45('0x16')](function(){return _0x80e50c;});})[_0xdf45('0x5d')](function(_0x1b97e7){logger[_0xdf45('0x1a')](_0xdf45('0x8a'),_0x1b97e7);throw _0x1b97e7;});})[_0xdf45('0x16')](respondWithResult(_0xba9993,0xc9))[_0xdf45('0x5d')](handleError(_0xba9993,null));};exports[_0xdf45('0x8b')]=function(_0x567492,_0x27e25c){var _0x354d21=_0x567492['body'];var _0x38916b=[];if(_0x567492[_0xdf45('0x2e')][_0xdf45('0x29')]===_0xdf45('0x2a'))throw new Error('Unauthorized');if(_[_0xdf45('0x8c')](_0x354d21,['role',_0xdf45('0x2e')])&&_0x567492[_0xdf45('0x2e')][_0xdf45('0x29')]!==_0xdf45('0x82')){throw new Error(_0xdf45('0x83'));}if(_['some'](_0x354d21,[_0xdf45('0x29'),_0xdf45('0x82')])&&_0x567492['user'][_0xdf45('0x29')]!==_0xdf45('0x82')){throw new Error(_0xdf45('0x8d'));}return licenseUtil[_0xdf45('0x85')](_0x354d21)[_0xdf45('0x16')](function(){return validateUser(_0x354d21[0x0]);})[_0xdf45('0x16')](function(){for(var _0x2a2a89=0x1;_0x2a2a89<_0x354d21['length'];_0x2a2a89++){var _0x350345=_0x354d21[_0x2a2a89-0x1][_0xdf45('0x64')];if(!_0x354d21[_0x2a2a89][_0xdf45('0x64')])_0x354d21[_0x2a2a89][_0xdf45('0x64')]=_0x350345+0x1;_0x38916b[_0xdf45('0x49')](validateUser(_0x354d21[_0x2a2a89]));}return Promise['all'](_0x38916b);})[_0xdf45('0x16')](function(){_0x38916b=[];for(var _0xb43a4c=0x0;_0xb43a4c<_0x354d21[_0xdf45('0x4c')];_0xb43a4c++){_0x38916b[_0xdf45('0x49')](updateUser(_0x354d21[_0xb43a4c]));}return Promise[_0xdf45('0x53')](_0x38916b);})[_0xdf45('0x16')](function(){_0x38916b=_0x354d21[_0xdf45('0x33')](function(_0x4e166c){return db['User']['create'](_0x4e166c,{'include':[{'model':db[_0xdf45('0x72')],'as':'VoiceMail'}]})[_0xdf45('0x16')](function(_0x563253){_0x4e166c['id']=_0x563253['id'];return _0x4e166c;});});return Promise[_0xdf45('0x53')](_0x38916b);})['then'](function(_0x5a8eaf){if(_0x567492[_0xdf45('0x5e')][_0xdf45('0x29')]===_0xdf45('0x2e'))return _0x5a8eaf;if(_0x567492[_0xdf45('0x2e')]['role']!=='user')return _0x5a8eaf;var _0x13eaea=_[_0xdf45('0x8c')](_0x5a8eaf,function(_0x489f6b){return _0x489f6b['role']===_0xdf45('0x2a')||_0x489f6b[_0xdf45('0x29')]===_0xdf45('0x30');});if(!_0x13eaea)return _0x5a8eaf;return db[_0xdf45('0x88')][_0xdf45('0x8e')]({'where':{'name':{'$or':[_0xdf45('0x89'),'Telephones']},'userProfileId':_0x567492[_0xdf45('0x2e')][_0xdf45('0x87')]},'raw':!![]})[_0xdf45('0x16')](function(_0x41788d){if(_[_0xdf45('0x8f')](_0x41788d)||!_[_0xdf45('0x8c')](_0x41788d,['autoAssociation',0x0]))return _0x5a8eaf;_0x38916b=[];var _0x56dd29=_(_0x41788d)['map'](function(_0x40172a){if(_0x40172a[_0xdf45('0x90')]===0x1)return;return _0x40172a['name']==='Agents'?_0xdf45('0x2a'):'telephone';})[_0xdf45('0x91')]()[_0xdf45('0x34')]();for(var _0x36b674=0x0;_0x36b674<_0x5a8eaf[_0xdf45('0x4c')];_0x36b674++){if(!_[_0xdf45('0x35')](_0x56dd29,_0x5a8eaf[_0x36b674][_0xdf45('0x29')]))return;var _0x389611=_0x5a8eaf[_0x36b674][_0xdf45('0x29')]===_0xdf45('0x2a')?_0xdf45('0x89'):_0xdf45('0x2f');_0x38916b['push'](db[_0xdf45('0x37')][_0xdf45('0x80')]({'name':_0x5a8eaf[_0x36b674][_0xdf45('0x38')],'resourceId':_0x5a8eaf[_0x36b674]['id'],'type':_0x389611,'sectionId':_[_0xdf45('0x36')](_0x41788d,[_0xdf45('0x38'),_0x389611])['id']},{}));}return Promise[_0xdf45('0x53')](_0x38916b);});})[_0xdf45('0x16')](respondWithResult(_0x27e25c,0xc9))[_0xdf45('0x5d')](handleError(_0x27e25c,null));};exports[_0xdf45('0x92')]=function(_0x4e157c,_0x3d7c9f){if(_0x4e157c[_0xdf45('0x5e')]['id']){delete _0x4e157c[_0xdf45('0x5e')]['id'];}return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x4e157c[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](function(_0x4549e0){if(!_0x4549e0)return null;if(_0x4549e0['id']===_0x4e157c['user']['id']){if(!_0x4e157c[_0xdf45('0x5e')][_0xdf45('0x93')]||!_0x4e157c[_0xdf45('0x5e')][_0xdf45('0x94')]){throw new db[(_0xdf45('0x95'))]['ValidationError'](_0xdf45('0x96'));}if(!_0x4549e0['authenticate'](_0x4e157c['body']['oldPassword'])){throw new db[(_0xdf45('0x95'))][(_0xdf45('0x97'))]('Wrong\x20credentials');}if(_0x4e157c[_0xdf45('0x5e')]['oldPassword']===_0x4e157c['body'][_0xdf45('0x94')]){throw new db['Sequelize'][(_0xdf45('0x97'))](_0xdf45('0x98'));}}else if(_0x4e157c[_0xdf45('0x2e')]['role']===_0xdf45('0x82')){if(!_0x4e157c['body'][_0xdf45('0x94')]){throw new db[(_0xdf45('0x95'))]['ValidationError'](_0xdf45('0x99'));}}else if(_0x4e157c['user']['role']===_0xdf45('0x2e')){if(!_0x4e157c[_0xdf45('0x5e')][_0xdf45('0x94')]){throw new db[(_0xdf45('0x95'))][(_0xdf45('0x97'))](_0xdf45('0x99'));}if(_0x4549e0[_0xdf45('0x29')]!==_0xdf45('0x2a')){throw new db['Sequelize'][(_0xdf45('0x97'))](_0xdf45('0x81'));}}else{throw new db['Sequelize'][(_0xdf45('0x97'))](_0xdf45('0x81'));}return _0x4549e0;})[_0xdf45('0x16')](handleEntityNotFound(_0x3d7c9f,null))[_0xdf45('0x16')](function(_0x4a3d1e){return db['Setting'][_0xdf45('0x9a')]({'attributes':['id','securePassword',_0xdf45('0x9b'),_0xdf45('0x9c')]})['then'](function(_0x5b5a9c){if(_0x5b5a9c[_0xdf45('0x67')])authService[_0xdf45('0x68')](_0x4e157c[_0xdf45('0x5e')][_0xdf45('0x94')]);if(!_0x5b5a9c[_0xdf45('0x9b')]||!_0x4a3d1e[_0xdf45('0x9d')])return _0x4a3d1e;authService[_0xdf45('0x9e')](_0x4e157c['body'][_0xdf45('0x94')],_0x4a3d1e[_0xdf45('0x9d')],_0x5b5a9c[_0xdf45('0x9c')]);return _0x4a3d1e;})['then'](saveUpdates({'password':_0x4e157c[_0xdf45('0x5e')]['newPassword'],'passwordResetAt':_0x4e157c[_0xdf45('0x2e')]['id']==_0x4e157c[_0xdf45('0x5f')]['id']?moment():null,'previousPasswords':authService[_0xdf45('0x9f')](_0x4e157c[_0xdf45('0x5e')]['newPassword'],_0x4a3d1e[_0xdf45('0x9d')])},null));})[_0xdf45('0x16')](respondWithResult(_0x3d7c9f,null))[_0xdf45('0x5d')](handleError(_0x3d7c9f,null));};exports[_0xdf45('0xa0')]=function(_0x14f7dc,_0x313007){var _0x9a4ad3=_0x14f7dc[_0xdf45('0x5e')][_0xdf45('0xa1')];return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x14f7dc[_0xdf45('0x5f')]['id']},'attributes':['id',_0xdf45('0x38'),'role','online',_0xdf45('0xa2'),_0xdf45('0xa3'),_0xdf45('0xa4')]})['then'](handleEntityNotFound(_0x313007,null))[_0xdf45('0x16')](function(_0x38c8a5){if(_0x38c8a5){if(!utils['isValidChannel'](_0x9a4ad3)){throw new db[(_0xdf45('0x95'))][(_0xdf45('0x97'))]('Unknown\x20channel');}return _0x38c8a5['add'+_[_0xdf45('0xa5')](_0x9a4ad3['toLowerCase']())+'Queues'](_0x14f7dc[_0xdf45('0x5e')]['ids'],{'penalty':_0x14f7dc[_0xdf45('0x5e')][_0xdf45('0xa6')]||0x0})[_0xdf45('0xa7')](function(_0x3c0d8d){for(var _0x1363fe=0x0;_0x1363fe<_0x14f7dc[_0xdf45('0x5e')][_0xdf45('0x62')][_0xdf45('0x4c')];_0x1363fe+=0x1){var _0x5507d7={'UserId':Number(_0x14f7dc[_0xdf45('0x5f')]['id'])};_0x5507d7[_[_0xdf45('0xa5')](_0x9a4ad3[_0xdf45('0xa8')]())+_0xdf45('0xa9')]=Number(_0x14f7dc[_0xdf45('0x5e')][_0xdf45('0x62')][_0x1363fe]);socket['emit'](_0xdf45('0x2e')+_[_0xdf45('0xa5')](_0x9a4ad3['toLowerCase']())+_0xdf45('0xaa'),_0x5507d7);}return _0x3c0d8d;})[_0xdf45('0x16')](function(){if(_0x9a4ad3===_0xdf45('0xab')){return db[_0xdf45('0xac')][_0xdf45('0x8e')]({'where':{'id':_0x14f7dc[_0xdf45('0x5e')][_0xdf45('0x62')]||[]},'raw':!![],'attributes':['id',_0xdf45('0x38')]});}})['then'](function(_0x548dfa){var _0x556df3=_0x38c8a5['get']({'plain':!![]});var _0x4d2f28=[];if(_0x9a4ad3===_0xdf45('0xab')&&_0x556df3['role']==='agent'&&_0x556df3[_0xdf45('0xad')]){for(let _0x21996b=0x0;_0x21996b<_0x548dfa['length'];_0x21996b+=0x1){_0x4d2f28[_0xdf45('0x49')]({'membername':_0x556df3['name'],'UserId':_0x556df3['id'],'queue_name':_0x548dfa[_0x21996b][_0xdf45('0x38')],'VoiceQueueId':_0x548dfa[_0x21996b]['id'],'interface':_[_0xdf45('0x6f')](_0x556df3[_0xdf45('0xa4')])?util[_0xdf45('0xae')]('SIP/%s',_0x556df3[_0xdf45('0x38')]):_0x556df3[_0xdf45('0xa4')],'paused':_0x556df3[_0xdf45('0xa3')]||![],'penalty':_0x14f7dc['body'][_0xdf45('0xa6')]||0x0});}return Promise['all'](_0x4d2f28[_0xdf45('0x33')](function(_0x19144c){return db[_0xdf45('0xaf')]['upsert'](_0x19144c);}));}return _0x38c8a5;});}})['then'](respondWithStatusCode(_0x313007,null))['catch'](handleError(_0x313007,null));};exports[_0xdf45('0xb0')]=function(_0xe82da7,_0xd316cd){var _0x441afd,_0x48e28a;return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0xe82da7[_0xdf45('0x5f')]['id']},'attributes':['id',_0xdf45('0x38'),'role']})[_0xdf45('0x16')](handleEntityNotFound(_0xd316cd,null))[_0xdf45('0x16')](function(_0x474107){if(_0x474107){_0x441afd=_0x474107;if(!_0xe82da7['query'][_0xdf45('0xa1')]||!utils[_0xdf45('0xb1')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')])){throw new db['Sequelize'][(_0xdf45('0x97'))](_0xdf45('0xb2'));}return _0x474107[_0xdf45('0xb3')+_[_0xdf45('0xa5')](_0xe82da7[_0xdf45('0x45')]['channel'][_0xdf45('0xa8')]())+_0xdf45('0xb4')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0x62')]);}})[_0xdf45('0x16')](function(_0x350dc8){if(_[_0xdf45('0xb5')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0x62')])){for(var _0x55b900=0x0;_0x55b900<_0xe82da7[_0xdf45('0x45')]['ids'][_0xdf45('0x4c')];_0x55b900+=0x1){_0x48e28a={'UserId':Number(_0xe82da7[_0xdf45('0x5f')]['id'])};_0x48e28a[_[_0xdf45('0xa5')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')]['toLowerCase']())+_0xdf45('0xa9')]=Number(_0xe82da7[_0xdf45('0x45')]['ids'][_0x55b900]);socket[_0xdf45('0xb6')](_0xdf45('0x2e')+_[_0xdf45('0xa5')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')][_0xdf45('0xa8')]())+'Queue:remove',_0x48e28a);}}else{_0x48e28a={'UserId':Number(_0xe82da7[_0xdf45('0x5f')]['id'])};_0x48e28a[_[_0xdf45('0xa5')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')][_0xdf45('0xa8')]())+_0xdf45('0xa9')]=Number(_0xe82da7['query'][_0xdf45('0x62')]);socket[_0xdf45('0xb6')](_0xdf45('0x2e')+_[_0xdf45('0xa5')](_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')][_0xdf45('0xa8')]())+_0xdf45('0xb7'),_0x48e28a);}return _0x350dc8;})['then'](function(){if(_0xe82da7[_0xdf45('0x45')][_0xdf45('0xa1')]===_0xdf45('0xab')){return db[_0xdf45('0xaf')]['destroy']({'where':{'UserId':_0xe82da7['params']['id'],'VoiceQueueId':_0xe82da7[_0xdf45('0x45')][_0xdf45('0x62')]},'individualHooks':!![]})[_0xdf45('0x16')](function(){return _0x441afd;});}return _0x441afd;})[_0xdf45('0x16')](respondWithStatusCode(_0xd316cd,null))['catch'](handleError(_0xd316cd,null));};exports[_0xdf45('0xb8')]=function(_0x3933b7,_0x38bd44){_0x3933b7[_0xdf45('0x5e')][_0xdf45('0xb9')]=_0x3933b7['file'][_0xdf45('0xba')];return db[_0xdf45('0x3b')]['find']({'where':{'id':_0x3933b7[_0xdf45('0x5f')]['id']}})['then'](handleEntityNotFound(_0x38bd44,null))[_0xdf45('0x16')](saveUpdates(_0x3933b7['body'],null))['then'](respondWithResult(_0x38bd44,null))[_0xdf45('0x5d')](handleError(_0x38bd44,null));};exports['getAvatar']=function(_0x3d7fc3,_0x53bf70){var _0x1c5a88=path[_0xdf45('0xbb')](config[_0xdf45('0xbc')],'server/files/images/logos/default_profile.png');return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x3d7fc3[_0xdf45('0x5f')]['id']},'attributes':['id',_0xdf45('0xb9')],'raw':!![]})[_0xdf45('0x16')](handleEntityNotFound(_0x53bf70,null))[_0xdf45('0x16')](function(_0x39e4f3){if(_0x39e4f3){if(_[_0xdf45('0x6f')](_0x39e4f3[_0xdf45('0xb9')])){return _0x53bf70[_0xdf45('0xbd')](_0x1c5a88);}else{if(!fs[_0xdf45('0xbe')](path[_0xdf45('0xbb')](config[_0xdf45('0xbc')],_0xdf45('0xbf'),_0x39e4f3[_0xdf45('0xb9')]))){return _0x53bf70[_0xdf45('0xbd')](_0x1c5a88);}return _0x53bf70['download'](path[_0xdf45('0xbb')](config[_0xdf45('0xbc')],_0xdf45('0xbf'),_0x39e4f3[_0xdf45('0xb9')]));}}})[_0xdf45('0x5d')](handleError(_0x53bf70,null));};exports['getOpenTabs']=function(_0x34118a,_0x368676){return db['User'][_0xdf45('0x36')]({'where':{'id':_0x34118a[_0xdf45('0x5f')]['id']},'attributes':['id']})[_0xdf45('0x16')](handleEntityNotFound(_0x368676,null))[_0xdf45('0x16')](function(_0x1cea66){var _0x12ec3a=[];values=_0x1cea66[_0xdf45('0x4e')];_0x12ec3a[_0xdf45('0x49')](get_open_tabs('chat',_0x1cea66['dataValues']));_0x12ec3a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0xc0'),_0x1cea66[_0xdf45('0x4e')]));_0x12ec3a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x51'),_0x1cea66[_0xdf45('0x4e')]));_0x12ec3a['push'](get_open_tabs(_0xdf45('0x52'),_0x1cea66[_0xdf45('0x4e')]));_0x12ec3a['push'](get_open_tabs(_0xdf45('0x4f'),_0x1cea66['dataValues']));_0x12ec3a[_0xdf45('0x49')](get_open_tabs(_0xdf45('0x50'),_0x1cea66[_0xdf45('0x4e')]));return Promise[_0xdf45('0x53')](_0x12ec3a);})['then'](function(_0x398210){if(_0x398210){var _0x32842c=_['map'](values[_0xdf45('0xc1')],function(_0x48573b){return{'channel':_0xdf45('0xc2'),'id':_0x48573b['id'],'createdAt':_0x48573b[_0xdf45('0xc3')]};});var _0x1a8553=_[_0xdf45('0x33')](values['FaxOpenTabs'],function(_0x3b43b1){return{'channel':_0xdf45('0xc4'),'id':_0x3b43b1['id'],'createdAt':_0x3b43b1[_0xdf45('0xc3')]};});var _0x1773d4=_[_0xdf45('0x33')](values[_0xdf45('0xc5')],function(_0x3a76c6){return{'channel':_0xdf45('0xc6'),'id':_0x3a76c6['id'],'createdAt':_0x3a76c6['createdAt']};});var _0x33a504=_['map'](values[_0xdf45('0xc7')],function(_0x2b48ba){return{'channel':_0xdf45('0xc8'),'id':_0x2b48ba['id'],'createdAt':_0x2b48ba[_0xdf45('0xc3')]};});var _0x562c1b=_['map'](values['SmsOpenTabs'],function(_0x3abc3e){return{'channel':'SMS','id':_0x3abc3e['id'],'createdAt':_0x3abc3e[_0xdf45('0xc3')]};});var _0x1538bf=_[_0xdf45('0x33')](values[_0xdf45('0xc9')],function(_0x5dcfd2){return{'channel':'WHATSAPP','id':_0x5dcfd2['id'],'createdAt':_0x5dcfd2[_0xdf45('0xc3')]};});var _0xe47272=_[_0xdf45('0xca')](_0x32842c,_0x1a8553,_0x1773d4,_0x33a504,_0x562c1b,_0x1538bf);var _0x249aae={'count':_0xe47272['length'],'rows':_0xe47272};return _0x249aae;}else return null;})[_0xdf45('0x16')](respondWithResult(_0x368676,null))[_0xdf45('0x5d')](handleError(_0x368676,null));};exports[_0xdf45('0xcb')]=function(_0x48b36a,_0x22f714){var _0x144576={};var _0x2171cb={};var _0xc4a3a0;var _0x388dcf;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x48b36a[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x22f714,null))['then'](function(_0x3f0b1b){if(_0x3f0b1b){_0xc4a3a0=_0x3f0b1b;_0x2171cb[_0xdf45('0x54')]=_['keys'](db['CmContact']['rawAttributes']);_0x2171cb[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x48b36a[_0xdf45('0x45')]);_0x2171cb[_0xdf45('0x57')]=_['intersection'](_0x2171cb[_0xdf45('0x54')],_0x2171cb[_0xdf45('0x45')]);_0x144576[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x2171cb['model'],qs['fields'](_0x48b36a[_0xdf45('0x45')][_0xdf45('0x59')]));_0x144576['attributes']=_0x144576['attributes'][_0xdf45('0x4c')]?_0x144576[_0xdf45('0x48')]:_0x2171cb['model'];_0x144576[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x48b36a[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x144576[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x48b36a['query'],_0x2171cb[_0xdf45('0x57')]));if(_0x48b36a[_0xdf45('0x45')]['filter']){_0x144576[_0xdf45('0x43')]=_['merge'](_0x144576[_0xdf45('0x43')],{'$or':_['map'](_0x144576[_0xdf45('0x48')],function(_0x2dbac7){var _0x1588db={};_0x1588db[_0x2dbac7]={'$like':'%'+_0x48b36a[_0xdf45('0x45')]['filter']+'%'};return _0x1588db;})});}_0x144576=_['merge']({},_0x144576,_0x48b36a['options']);return _0xc4a3a0['getContacts'](_0x144576);}})['then'](function(_0x599dd1){if(_0x599dd1){_0x388dcf=_0x599dd1[_0xdf45('0x4c')];if(_0x48b36a[_0xdf45('0x45')][_0xdf45('0xcf')]('includeAll')){_0x144576[_0xdf45('0x44')]=[{'model':db[_0xdf45('0xd0')],'as':_0xdf45('0xd1'),'required':![]},{'model':db[_0xdf45('0xd2')],'as':_0xdf45('0xd3'),'attributes':['id','name',_0xdf45('0xd4')],'where':_0x48b36a[_0xdf45('0x45')][_0xdf45('0xd5')]?{'id':_0x48b36a[_0xdf45('0x45')]['tag']}:undefined,'required':_0x48b36a[_0xdf45('0x45')][_0xdf45('0xd5')]?!![]:![]}];}if(!_0x48b36a['query'][_0xdf45('0xcf')]('nolimit')){_0x144576[_0xdf45('0x26')]=qs['limit'](_0x48b36a['query'][_0xdf45('0x26')]);_0x144576[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x48b36a[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0xc4a3a0['getContacts'](_0x144576);}})[_0xdf45('0x16')](function(_0x283c46){if(_0x283c46){return _0x283c46?{'count':_0x388dcf,'rows':_0x283c46}:null;}})[_0xdf45('0x16')](respondWithResult(_0x22f714,null))[_0xdf45('0x5d')](handleError(_0x22f714,null));};exports['getQueues']=function(_0x28841b,_0x1342af){var _0x567ba8;var _0xc295f3={};var _0x130b7d;return db[_0xdf45('0x3b')]['findOne']({'where':{'id':_0x28841b[_0xdf45('0x5f')]['id']},'attributes':['id',_0xdf45('0x38'),_0xdf45('0x29')]})[_0xdf45('0x16')](handleEntityNotFound(_0x1342af,null))[_0xdf45('0x16')](function(_0x8c5895){if(!utils[_0xdf45('0xb1')](_0x28841b[_0xdf45('0x45')][_0xdf45('0xa1')])){throw new db[(_0xdf45('0x95'))][(_0xdf45('0x97'))](_0xdf45('0xb2'));}_0x567ba8=_0x8c5895;var _0x15258b={};_0x15258b[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_['capitalize'](_0x28841b[_0xdf45('0x45')][_0xdf45('0xa1')])+'Queue']['rawAttributes']);_0x15258b[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x28841b[_0xdf45('0x45')]);_0x15258b[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x15258b[_0xdf45('0x54')],_0x15258b[_0xdf45('0x45')]);_0xc295f3[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x15258b[_0xdf45('0x54')],qs['fields'](_0x28841b[_0xdf45('0x45')][_0xdf45('0x59')]));_0xc295f3[_0xdf45('0x48')]=_0xc295f3[_0xdf45('0x48')][_0xdf45('0x4c')]?_0xc295f3['attributes']:_0x15258b[_0xdf45('0x54')];_0xc295f3['order']=qs['sort'](_0x28841b[_0xdf45('0x45')][_0xdf45('0xcd')]);_0xc295f3['where']=qs['filters'](_[_0xdf45('0xce')](_0x28841b['query'],_0x15258b[_0xdf45('0x57')]));if(_0x28841b[_0xdf45('0x45')]['filter']){_0xc295f3[_0xdf45('0x43')]=_['merge'](_0xc295f3['where'],{'$or':_[_0xdf45('0x33')](_0xc295f3['attributes'],function(_0x325892){var _0x37c3cd={};_0x37c3cd[_0x325892]={'$like':'%'+_0x28841b[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x37c3cd;})});}_0xc295f3=_[_0xdf45('0x5b')]({},_0xc295f3,_0x28841b[_0xdf45('0x5c')]);switch(_0x567ba8[_0xdf45('0x29')]){case _0xdf45('0x82'):return db[_[_0xdf45('0xa5')](_0x28841b[_0xdf45('0x45')][_0xdf45('0xa1')])+_0xdf45('0xd6')][_0xdf45('0x8e')](_0xc295f3);case _0xdf45('0x2e'):case _0xdf45('0x2a'):return _0x567ba8[_0xdf45('0xd7')+_[_0xdf45('0xa5')](_0x28841b['query']['channel'])+_0xdf45('0xb4')](_0xc295f3);default:throw new db['Sequelize'][(_0xdf45('0x97'))](_0xdf45('0xd8'));}})[_0xdf45('0x16')](function(_0x5b4ee9){_0x130b7d=_0x5b4ee9[_0xdf45('0x4c')];if(!_0x28841b[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0xc295f3['limit']=qs[_0xdf45('0x26')](_0x28841b[_0xdf45('0x45')][_0xdf45('0x26')]);_0xc295f3[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x28841b[_0xdf45('0x45')]['offset']);}switch(_0x567ba8[_0xdf45('0x29')]){case _0xdf45('0x82'):return db[_[_0xdf45('0xa5')](_0x28841b[_0xdf45('0x45')][_0xdf45('0xa1')])+_0xdf45('0xd6')]['findAll'](_0xc295f3);case _0xdf45('0x2e'):case _0xdf45('0x2a'):return _0x567ba8[_0xdf45('0xd7')+_[_0xdf45('0xa5')](_0x28841b[_0xdf45('0x45')][_0xdf45('0xa1')])+_0xdf45('0xb4')](_0xc295f3);}})[_0xdf45('0x16')](function(_0x154acf){return{'count':_0x130b7d,'rows':_0x154acf};})[_0xdf45('0x16')](respondWithResult(_0x1342af,null))[_0xdf45('0x5d')](handleError(_0x1342af,null));};exports[_0xdf45('0xda')]=function(_0x150d4a,_0xdef75e){var _0x5ec8e9={};var _0x16f5c9={};var _0x16e886;var _0x134624;return db['User']['findOne']({'where':{'id':_0x150d4a[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0xdef75e,null))[_0xdf45('0x16')](function(_0x2e7a5f){if(_0x2e7a5f){_0x16e886=_0x2e7a5f;_0x16f5c9[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0xaf')][_0xdf45('0x3c')]);_0x16f5c9[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x150d4a[_0xdf45('0x45')]);_0x16f5c9[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x16f5c9[_0xdf45('0x54')],_0x16f5c9[_0xdf45('0x45')]);_0x5ec8e9[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x16f5c9[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x150d4a[_0xdf45('0x45')]['fields']));_0x5ec8e9['attributes']=_0x5ec8e9[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x5ec8e9['attributes']:_0x16f5c9[_0xdf45('0x54')];_0x5ec8e9['order']=qs['sort'](_0x150d4a[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x5ec8e9[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x150d4a[_0xdf45('0x45')],_0x16f5c9['filters']));if(_0x150d4a[_0xdf45('0x45')][_0xdf45('0x31')]){_0x5ec8e9['where']=_[_0xdf45('0x5b')](_0x5ec8e9[_0xdf45('0x43')],{'$or':_['map'](_0x5ec8e9[_0xdf45('0x48')],function(_0x590f30){var _0x55a62c={};_0x55a62c[_0x590f30]={'$like':'%'+_0x150d4a[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x55a62c;})});}_0x5ec8e9=_[_0xdf45('0x5b')]({},_0x5ec8e9,_0x150d4a[_0xdf45('0x5c')]);return _0x16e886['getVoiceQueuesRt'](_0x5ec8e9);}})[_0xdf45('0x16')](function(_0x36c8d9){if(_0x36c8d9){_0x134624=_0x36c8d9['length'];if(!_0x150d4a[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x5ec8e9[_0xdf45('0x26')]=qs['limit'](_0x150d4a['query'][_0xdf45('0x26')]);_0x5ec8e9[_0xdf45('0x25')]=qs['offset'](_0x150d4a[_0xdf45('0x45')]['offset']);}return _0x16e886[_0xdf45('0xda')](_0x5ec8e9);}})['then'](function(_0x4ae709){if(_0x4ae709){return _0x4ae709?{'count':_0x134624,'rows':_0x4ae709}:null;}})[_0xdf45('0x16')](respondWithResult(_0xdef75e,null))[_0xdf45('0x5d')](handleError(_0xdef75e,null));};exports[_0xdf45('0xdb')]=function(_0x1e2e8e,_0x3be78d){var _0xed1e31={};var _0x16ecb9={};var _0x558090;var _0x3f11f8;return db['User']['findOne']({'where':{'id':_0x1e2e8e[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x3be78d,null))[_0xdf45('0x16')](function(_0x34de53){if(_0x34de53){_0x558090=_0x34de53;_0x16ecb9[_0xdf45('0x54')]=_['keys'](db[_0xdf45('0xdc')][_0xdf45('0x3c')]);_0x16ecb9[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x1e2e8e['query']);_0x16ecb9[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x16ecb9[_0xdf45('0x54')],_0x16ecb9[_0xdf45('0x45')]);_0xed1e31[_0xdf45('0x48')]=_['intersection'](_0x16ecb9[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0x59')]));_0xed1e31['attributes']=_0xed1e31[_0xdf45('0x48')][_0xdf45('0x4c')]?_0xed1e31[_0xdf45('0x48')]:_0x16ecb9['model'];_0xed1e31[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x1e2e8e['query'][_0xdf45('0xcd')]);_0xed1e31[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x1e2e8e[_0xdf45('0x45')],_0x16ecb9[_0xdf45('0x57')]));if(_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0x31')]){_0xed1e31['where']=_['merge'](_0xed1e31[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0xed1e31['attributes'],function(_0x5a9578){var _0x15adfe={};_0x15adfe[_0x5a9578]={'$like':'%'+_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x15adfe;})});}_0xed1e31=_[_0xdf45('0x5b')]({},_0xed1e31,_0x1e2e8e['options']);return _0x558090[_0xdf45('0xdb')](_0xed1e31);}})[_0xdf45('0x16')](function(_0x122fa8){if(_0x122fa8){_0x3f11f8=_0x122fa8['length'];if(!_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0xed1e31[_0xdf45('0x26')]=qs['limit'](_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0x26')]);_0xed1e31[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x1e2e8e[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0x558090[_0xdf45('0xdb')](_0xed1e31);}})[_0xdf45('0x16')](function(_0x534ed4){if(_0x534ed4){return _0x534ed4?{'count':_0x3f11f8,'rows':_0x534ed4}:null;}})[_0xdf45('0x16')](respondWithResult(_0x3be78d,null))[_0xdf45('0x5d')](handleError(_0x3be78d,null));};exports['getRecordings']=function(_0x59073e,_0x53b924){var _0x1ec274={'raw':!![],'where':{}};var _0x4318df={};var _0x241e4e={'count':0x0,'rows':[]};return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x59073e[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x53b924,null))[_0xdf45('0x16')](function(_0x18c5a7){if(_0x18c5a7){_0x4318df[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0xdd')]['rawAttributes']);_0x4318df[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x59073e[_0xdf45('0x45')]);_0x4318df['filters']=_[_0xdf45('0x58')](_0x4318df[_0xdf45('0x54')],_0x4318df[_0xdf45('0x45')]);_0x1ec274['attributes']=_['intersection'](_0x4318df[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x59073e[_0xdf45('0x45')][_0xdf45('0x59')]));_0x1ec274[_0xdf45('0x48')]=_0x1ec274['attributes'][_0xdf45('0x4c')]?_0x1ec274[_0xdf45('0x48')]:_0x4318df['model'];if(!_0x59073e[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x1ec274['limit']=qs[_0xdf45('0x26')](_0x59073e[_0xdf45('0x45')]['limit']);_0x1ec274[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x59073e[_0xdf45('0x45')][_0xdf45('0x25')]);}_0x1ec274['order']=qs[_0xdf45('0xcd')](_0x59073e['query'][_0xdf45('0xcd')]);_0x1ec274[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x59073e['query'],_0x4318df[_0xdf45('0x57')]));_0x1ec274[_0xdf45('0x43')]['UserId']=_0x18c5a7['id'];if(_0x59073e['query'][_0xdf45('0x31')]){_0x1ec274[_0xdf45('0x43')]=_[_0xdf45('0x5b')](_0x1ec274[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0x1ec274[_0xdf45('0x48')],function(_0xb8bef8){var _0x14f4af={};_0x14f4af[_0xb8bef8]={'$like':'%'+_0x59073e[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x14f4af;})});}_0x1ec274=_[_0xdf45('0x5b')]({},_0x1ec274,_0x59073e[_0xdf45('0x5c')]);return db['VoiceRecording'][_0xdf45('0x24')]({'where':_0x1ec274[_0xdf45('0x43')]})[_0xdf45('0x16')](function(_0x294778){_0x241e4e[_0xdf45('0x24')]=_0x294778;if(_0x59073e['query'][_0xdf45('0xde')]){_0x1ec274[_0xdf45('0x44')]=[{'all':!![]}];}return db[_0xdf45('0xdd')]['findAll'](_0x1ec274);})[_0xdf45('0x16')](function(_0xf3f110){_0x241e4e[_0xdf45('0x4b')]=_0xf3f110;return _0x241e4e;});}})['then'](respondWithFilteredResult(_0x53b924,_0x1ec274))[_0xdf45('0x5d')](handleError(_0x53b924,null));};exports[_0xdf45('0xdf')]=function(_0x45da99,_0x4ff522){var _0x5b3a26={'raw':!![],'where':{}};var _0xbb01={};var _0x26d0ed={'count':0x0,'rows':[]};return db['User'][_0xdf45('0x9a')]({'where':{'id':_0x45da99[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x4ff522,null))['then'](function(_0x320a82){if(_0x320a82){_0xbb01[_0xdf45('0x54')]=_[_0xdf45('0x56')](db['ScreenRecording'][_0xdf45('0x3c')]);_0xbb01['query']=_[_0xdf45('0x56')](_0x45da99['query']);_0xbb01[_0xdf45('0x57')]=_['intersection'](_0xbb01[_0xdf45('0x54')],_0xbb01[_0xdf45('0x45')]);_0x5b3a26[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0xbb01[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x45da99[_0xdf45('0x45')][_0xdf45('0x59')]));_0x5b3a26[_0xdf45('0x48')]=_0x5b3a26[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x5b3a26['attributes']:_0xbb01[_0xdf45('0x54')];if(!_0x45da99[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x5b3a26[_0xdf45('0x26')]=qs['limit'](_0x45da99['query'][_0xdf45('0x26')]);_0x5b3a26[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x45da99[_0xdf45('0x45')][_0xdf45('0x25')]);}_0x5b3a26['order']=qs[_0xdf45('0xcd')](_0x45da99[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x5b3a26[_0xdf45('0x43')]=qs['filters'](_[_0xdf45('0xce')](_0x45da99['query'],_0xbb01[_0xdf45('0x57')]));_0x5b3a26[_0xdf45('0x43')]['UserId']=_0x320a82['id'];if(_0x45da99[_0xdf45('0x45')][_0xdf45('0x31')]){_0x5b3a26['where']=_[_0xdf45('0x5b')](_0x5b3a26[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0x5b3a26[_0xdf45('0x48')],function(_0x446e2f){var _0x2dd251={};_0x2dd251[_0x446e2f]={'$like':'%'+_0x45da99['query'][_0xdf45('0x31')]+'%'};return _0x2dd251;})});}_0x5b3a26=_[_0xdf45('0x5b')]({},_0x5b3a26,_0x45da99[_0xdf45('0x5c')]);return db['ScreenRecording'][_0xdf45('0x24')]({'where':_0x5b3a26[_0xdf45('0x43')]})[_0xdf45('0x16')](function(_0x6097e){_0x26d0ed[_0xdf45('0x24')]=_0x6097e;if(_0x45da99['query'][_0xdf45('0xde')]){_0x5b3a26[_0xdf45('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xdf45('0x8e')](_0x5b3a26);})[_0xdf45('0x16')](function(_0x55b4df){_0x26d0ed[_0xdf45('0x4b')]=_0x55b4df;return _0x26d0ed;});}})[_0xdf45('0x16')](respondWithFilteredResult(_0x4ff522,_0x5b3a26))[_0xdf45('0x5d')](handleError(_0x4ff522,null));};exports[_0xdf45('0xe0')]=function(_0x39ad2c,_0x1a0936){var _0x3efdb4={};var _0x5c3681={};var _0x19e0b8;var _0x28b2c7;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x39ad2c[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x1a0936,null))[_0xdf45('0x16')](function(_0x396c6f){if(_0x396c6f){_0x19e0b8=_0x396c6f;_0x5c3681[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0xe1')][_0xdf45('0x3c')]);_0x5c3681['query']=_[_0xdf45('0x56')](_0x39ad2c[_0xdf45('0x45')]);_0x5c3681[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x5c3681[_0xdf45('0x54')],_0x5c3681[_0xdf45('0x45')]);_0x3efdb4[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x5c3681[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x39ad2c[_0xdf45('0x45')][_0xdf45('0x59')]));_0x3efdb4[_0xdf45('0x48')]=_0x3efdb4['attributes'][_0xdf45('0x4c')]?_0x3efdb4[_0xdf45('0x48')]:_0x5c3681[_0xdf45('0x54')];_0x3efdb4[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x39ad2c[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x3efdb4['where']=qs['filters'](_['pick'](_0x39ad2c[_0xdf45('0x45')],_0x5c3681[_0xdf45('0x57')]));if(_0x39ad2c[_0xdf45('0x45')]['filter']){_0x3efdb4['where']=_[_0xdf45('0x5b')](_0x3efdb4['where'],{'$or':_[_0xdf45('0x33')](_0x3efdb4['attributes'],function(_0x541033){var _0x415cc5={};_0x415cc5[_0x541033]={'$like':'%'+_0x39ad2c[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x415cc5;})});}_0x3efdb4=_[_0xdf45('0x5b')]({},_0x3efdb4,_0x39ad2c['options']);return _0x19e0b8[_0xdf45('0xe0')](_0x3efdb4);}})[_0xdf45('0x16')](function(_0x87a0e0){if(_0x87a0e0){_0x28b2c7=_0x87a0e0[_0xdf45('0x4c')];if(!_0x39ad2c[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x3efdb4[_0xdf45('0x26')]=qs['limit'](_0x39ad2c[_0xdf45('0x45')][_0xdf45('0x26')]);_0x3efdb4[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x39ad2c[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0x19e0b8['getChatInteractions'](_0x3efdb4);}})[_0xdf45('0x16')](function(_0x1b658b){if(_0x1b658b){return _0x1b658b?{'count':_0x28b2c7,'rows':_0x1b658b}:null;}})[_0xdf45('0x16')](respondWithResult(_0x1a0936,null))[_0xdf45('0x5d')](handleError(_0x1a0936,null));};exports[_0xdf45('0xe2')]=function(_0xb7985,_0x29a632){var _0x2394b7={};var _0xa3b3d1={};var _0x2ac664;var _0x41a0cb;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0xb7985[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x29a632,null))[_0xdf45('0x16')](function(_0x2bd256){if(_0x2bd256){_0x2ac664=_0x2bd256;_0xa3b3d1['model']=_['keys'](db[_0xdf45('0xe3')]['rawAttributes']);_0xa3b3d1[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0xb7985[_0xdf45('0x45')]);_0xa3b3d1['filters']=_['intersection'](_0xa3b3d1[_0xdf45('0x54')],_0xa3b3d1[_0xdf45('0x45')]);_0x2394b7[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0xa3b3d1['model'],qs[_0xdf45('0x59')](_0xb7985[_0xdf45('0x45')][_0xdf45('0x59')]));_0x2394b7[_0xdf45('0x48')]=_0x2394b7[_0xdf45('0x48')]['length']?_0x2394b7[_0xdf45('0x48')]:_0xa3b3d1[_0xdf45('0x54')];_0x2394b7['order']=qs[_0xdf45('0xcd')](_0xb7985[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x2394b7['where']=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0xb7985[_0xdf45('0x45')],_0xa3b3d1[_0xdf45('0x57')]));if(_0xb7985[_0xdf45('0x45')][_0xdf45('0x31')]){_0x2394b7[_0xdf45('0x43')]=_['merge'](_0x2394b7['where'],{'$or':_[_0xdf45('0x33')](_0x2394b7[_0xdf45('0x48')],function(_0x4d9d7a){var _0x1fd83a={};_0x1fd83a[_0x4d9d7a]={'$like':'%'+_0xb7985[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x1fd83a;})});}_0x2394b7=_[_0xdf45('0x5b')]({},_0x2394b7,_0xb7985[_0xdf45('0x5c')]);return _0x2ac664[_0xdf45('0xe2')](_0x2394b7);}})[_0xdf45('0x16')](function(_0xba014){if(_0xba014){_0x41a0cb=_0xba014[_0xdf45('0x4c')];if(!_0xb7985[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x2394b7[_0xdf45('0x26')]=qs[_0xdf45('0x26')](_0xb7985[_0xdf45('0x45')][_0xdf45('0x26')]);_0x2394b7[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0xb7985[_0xdf45('0x45')]['offset']);}return _0x2ac664[_0xdf45('0xe2')](_0x2394b7);}})[_0xdf45('0x16')](function(_0x214deb){if(_0x214deb){return _0x214deb?{'count':_0x41a0cb,'rows':_0x214deb}:null;}})['then'](respondWithResult(_0x29a632,null))[_0xdf45('0x5d')](handleError(_0x29a632,null));};exports['getMailInteractions']=function(_0x3bcc5c,_0x90782){var _0x311e44={'raw':!![],'where':{}};var _0x203d43={};var _0x33d766={'count':0x0,'rows':[]};return db['User'][_0xdf45('0x9a')]({'where':{'id':_0x3bcc5c[_0xdf45('0x5f')]['id']}})['then'](handleEntityNotFound(_0x90782,null))[_0xdf45('0x16')](function(_0x373b9e){if(_0x373b9e){_0x203d43[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0xe4')][_0xdf45('0x3c')]);_0x203d43[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x3bcc5c[_0xdf45('0x45')]);_0x203d43[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x203d43[_0xdf45('0x54')],_0x203d43[_0xdf45('0x45')]);_0x311e44[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x203d43[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0x59')]));_0x311e44[_0xdf45('0x48')]=_0x311e44[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x311e44[_0xdf45('0x48')]:_0x203d43[_0xdf45('0x54')];if(!_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0xcf')]('nolimit')){_0x311e44[_0xdf45('0x26')]=qs['limit'](_0x3bcc5c['query']['limit']);_0x311e44[_0xdf45('0x25')]=qs['offset'](_0x3bcc5c['query'][_0xdf45('0x25')]);}_0x311e44[_0xdf45('0xcc')]=qs['sort'](_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x311e44['where']=qs[_0xdf45('0x57')](_['pick'](_0x3bcc5c['query'],_0x203d43[_0xdf45('0x57')]));_0x311e44['where']['UserId']=_0x373b9e['id'];if(_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0x31')]){_0x311e44[_0xdf45('0x43')]=_[_0xdf45('0x5b')](_0x311e44[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0x311e44[_0xdf45('0x48')],function(_0x38918e){var _0x5a65a9={};_0x5a65a9[_0x38918e]={'$like':'%'+_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x5a65a9;})});}_0x311e44=_['merge']({},_0x311e44,_0x3bcc5c[_0xdf45('0x5c')]);return db[_0xdf45('0xe4')][_0xdf45('0x24')]({'where':_0x311e44[_0xdf45('0x43')]})[_0xdf45('0x16')](function(_0x3f3fcd){_0x33d766[_0xdf45('0x24')]=_0x3f3fcd;if(_0x3bcc5c[_0xdf45('0x45')][_0xdf45('0xde')]){_0x311e44['include']=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x311e44);})['then'](function(_0x22e1bd){_0x33d766[_0xdf45('0x4b')]=_0x22e1bd;return _0x33d766;});}})[_0xdf45('0x16')](respondWithFilteredResult(_0x90782,_0x311e44))[_0xdf45('0x5d')](handleError(_0x90782,null));};exports['getSmsInteractions']=function(_0x2bb75e,_0x148cae){var _0x26721d={};var _0x47c1e6={};var _0x51782c;var _0x333629;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x2bb75e[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x148cae,null))[_0xdf45('0x16')](function(_0x4d5f7f){if(_0x4d5f7f){_0x51782c=_0x4d5f7f;_0x47c1e6[_0xdf45('0x54')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x47c1e6[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x2bb75e[_0xdf45('0x45')]);_0x47c1e6[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x47c1e6[_0xdf45('0x54')],_0x47c1e6[_0xdf45('0x45')]);_0x26721d[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x47c1e6[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x2bb75e[_0xdf45('0x45')][_0xdf45('0x59')]));_0x26721d['attributes']=_0x26721d['attributes']['length']?_0x26721d[_0xdf45('0x48')]:_0x47c1e6[_0xdf45('0x54')];_0x26721d[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x2bb75e['query'][_0xdf45('0xcd')]);_0x26721d[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x2bb75e[_0xdf45('0x45')],_0x47c1e6[_0xdf45('0x57')]));if(_0x2bb75e[_0xdf45('0x45')][_0xdf45('0x31')]){_0x26721d[_0xdf45('0x43')]=_[_0xdf45('0x5b')](_0x26721d['where'],{'$or':_['map'](_0x26721d[_0xdf45('0x48')],function(_0x7f624f){var _0x1998a5={};_0x1998a5[_0x7f624f]={'$like':'%'+_0x2bb75e[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x1998a5;})});}_0x26721d=_[_0xdf45('0x5b')]({},_0x26721d,_0x2bb75e[_0xdf45('0x5c')]);return _0x51782c[_0xdf45('0xe5')](_0x26721d);}})[_0xdf45('0x16')](function(_0x357a96){if(_0x357a96){_0x333629=_0x357a96[_0xdf45('0x4c')];if(!_0x2bb75e[_0xdf45('0x45')]['hasOwnProperty']('nolimit')){_0x26721d[_0xdf45('0x26')]=qs[_0xdf45('0x26')](_0x2bb75e['query'][_0xdf45('0x26')]);_0x26721d['offset']=qs[_0xdf45('0x25')](_0x2bb75e[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0x51782c[_0xdf45('0xe5')](_0x26721d);}})[_0xdf45('0x16')](function(_0x4aa28c){if(_0x4aa28c){return _0x4aa28c?{'count':_0x333629,'rows':_0x4aa28c}:null;}})['then'](respondWithResult(_0x148cae,null))[_0xdf45('0x5d')](handleError(_0x148cae,null));};exports[_0xdf45('0xe6')]=function(_0xb81429,_0x374a35){var _0x124106={};var _0x4454f7={};var _0x1f71b7;var _0x520971;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0xb81429['params']['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x374a35,null))[_0xdf45('0x16')](function(_0x570f57){if(_0x570f57){_0x1f71b7=_0x570f57;_0x4454f7[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0xe7')]['rawAttributes']);_0x4454f7[_0xdf45('0x45')]=_['keys'](_0xb81429[_0xdf45('0x45')]);_0x4454f7[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x4454f7['model'],_0x4454f7[_0xdf45('0x45')]);_0x124106[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x4454f7['model'],qs[_0xdf45('0x59')](_0xb81429[_0xdf45('0x45')][_0xdf45('0x59')]));_0x124106[_0xdf45('0x48')]=_0x124106[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x124106[_0xdf45('0x48')]:_0x4454f7[_0xdf45('0x54')];_0x124106[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0xb81429[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x124106[_0xdf45('0x43')]=qs['filters'](_['pick'](_0xb81429[_0xdf45('0x45')],_0x4454f7[_0xdf45('0x57')]));if(_0xb81429['query'][_0xdf45('0x31')]){_0x124106[_0xdf45('0x43')]=_[_0xdf45('0x5b')](_0x124106[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0x124106[_0xdf45('0x48')],function(_0xbc9c0c){var _0x3c4da2={};_0x3c4da2[_0xbc9c0c]={'$like':'%'+_0xb81429[_0xdf45('0x45')]['filter']+'%'};return _0x3c4da2;})});}_0x124106=_[_0xdf45('0x5b')]({},_0x124106,_0xb81429['options']);return _0x1f71b7[_0xdf45('0xe6')](_0x124106);}})[_0xdf45('0x16')](function(_0x1262db){if(_0x1262db){_0x520971=_0x1262db[_0xdf45('0x4c')];if(!_0xb81429['query']['hasOwnProperty'](_0xdf45('0xd9'))){_0x124106[_0xdf45('0x26')]=qs[_0xdf45('0x26')](_0xb81429['query'][_0xdf45('0x26')]);_0x124106[_0xdf45('0x25')]=qs['offset'](_0xb81429[_0xdf45('0x45')]['offset']);}return _0x1f71b7[_0xdf45('0xe6')](_0x124106);}})['then'](function(_0x2e4dd4){if(_0x2e4dd4){return _0x2e4dd4?{'count':_0x520971,'rows':_0x2e4dd4}:null;}})[_0xdf45('0x16')](respondWithResult(_0x374a35,null))[_0xdf45('0x5d')](handleError(_0x374a35,null));};exports[_0xdf45('0xe8')]=function(_0x41ac26,_0xd60e6){var _0x4685bf={};var _0x38e8b3={};var _0x500929;var _0x1684ba;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x41ac26[_0xdf45('0x5f')]['id']}})['then'](handleEntityNotFound(_0xd60e6,null))[_0xdf45('0x16')](function(_0x101aef){if(_0x101aef){_0x500929=_0x101aef;_0x38e8b3[_0xdf45('0x54')]=_['keys'](db[_0xdf45('0xe9')][_0xdf45('0x3c')]);_0x38e8b3['query']=_['keys'](_0x41ac26[_0xdf45('0x45')]);_0x38e8b3[_0xdf45('0x57')]=_['intersection'](_0x38e8b3['model'],_0x38e8b3[_0xdf45('0x45')]);_0x4685bf[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x38e8b3[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x41ac26[_0xdf45('0x45')]['fields']));_0x4685bf[_0xdf45('0x48')]=_0x4685bf[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x4685bf[_0xdf45('0x48')]:_0x38e8b3['model'];_0x4685bf[_0xdf45('0xcc')]=qs['sort'](_0x41ac26[_0xdf45('0x45')]['sort']);_0x4685bf[_0xdf45('0x43')]=qs['filters'](_[_0xdf45('0xce')](_0x41ac26[_0xdf45('0x45')],_0x38e8b3[_0xdf45('0x57')]));if(_0x41ac26[_0xdf45('0x45')][_0xdf45('0x31')]){_0x4685bf['where']=_[_0xdf45('0x5b')](_0x4685bf[_0xdf45('0x43')],{'$or':_[_0xdf45('0x33')](_0x4685bf[_0xdf45('0x48')],function(_0x33d232){var _0x46d246={};_0x46d246[_0x33d232]={'$like':'%'+_0x41ac26[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x46d246;})});}_0x4685bf=_[_0xdf45('0x5b')]({},_0x4685bf,_0x41ac26[_0xdf45('0x5c')]);return _0x500929['getWhatsappInteractions'](_0x4685bf);}})[_0xdf45('0x16')](function(_0x342368){if(_0x342368){_0x1684ba=_0x342368[_0xdf45('0x4c')];if(!_0x41ac26[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x4685bf[_0xdf45('0x26')]=qs[_0xdf45('0x26')](_0x41ac26[_0xdf45('0x45')]['limit']);_0x4685bf['offset']=qs['offset'](_0x41ac26[_0xdf45('0x45')]['offset']);}return _0x500929['getWhatsappInteractions'](_0x4685bf);}})[_0xdf45('0x16')](function(_0x2c671a){if(_0x2c671a){return _0x2c671a?{'count':_0x1684ba,'rows':_0x2c671a}:null;}})[_0xdf45('0x16')](respondWithResult(_0xd60e6,null))[_0xdf45('0x5d')](handleError(_0xd60e6,null));};exports[_0xdf45('0xea')]=function(_0x38bdce,_0x4cd43c,_0x2365e0){var _0x58aa4b;var _0x436816;var _0x1141dc;var _0x3eeef0=!_[_0xdf45('0x6f')](_0x38bdce[_0xdf45('0x5f')]['id'])?_0x38bdce[_0xdf45('0x5f')]['id']:!_[_0xdf45('0x6f')](_0x38bdce[_0xdf45('0x2e')]['id'])?_0x38bdce[_0xdf45('0x2e')]['id']:null;return db['User'][_0xdf45('0x36')]({'where':{'id':_0x3eeef0,'role':{'$or':['admin',_0xdf45('0x2e'),_0xdf45('0x2a')]}},'attributes':['id',_0xdf45('0x38'),_0xdf45('0xeb'),_0xdf45('0xec'),'role','internal',_0xdf45('0xa2')]})[_0xdf45('0x16')](function(_0x262ebf){if(_0x262ebf){if(_0x262ebf[_0xdf45('0x29')]==='agent'){_0x58aa4b=_0x262ebf;if(_0x38bdce[_0xdf45('0x5e')][_0xdf45('0xa4')]){_0x1141dc=util[_0xdf45('0xae')]('LOCAL/%s@from-sip/n',_0x58aa4b[_0x38bdce['body'][_0xdf45('0xa4')]]);}else if(_0x38bdce[_0xdf45('0x5e')][_0xdf45('0xed')]){_0x1141dc=util[_0xdf45('0xae')](_0xdf45('0xee'),_0x38bdce['body'][_0xdf45('0xed')]);}else{_0x1141dc=util[_0xdf45('0xae')](_0xdf45('0xee'),_0x58aa4b[_0xdf45('0x38')]);}socket['to'](util[_0xdf45('0xae')](_0xdf45('0xef'),_0x58aa4b[_0xdf45('0x38')]))[_0xdf45('0xb6')](_0xdf45('0xf0'),{'user':{'id':_0x58aa4b['id'],'name':_0x58aa4b[_0xdf45('0x38')]},'ip':_0x38bdce[_0xdf45('0xf1')][_0xdf45('0xf2')]||_0x38bdce[_0xdf45('0xf3')]['remoteAddress']||_0x38bdce[_0xdf45('0xf4')][_0xdf45('0xf5')]||_0x38bdce[_0xdf45('0xf3')][_0xdf45('0xf4')]['remoteAddress']});return db[_0xdf45('0xaf')][_0xdf45('0x2c')]({'where':{'membername':_0x58aa4b[_0xdf45('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0xdf45('0x95'))][(_0xdf45('0x97'))](_0xdf45('0xf6'));}})[_0xdf45('0x16')](function(){if(_0x58aa4b){return _0x58aa4b[_0xdf45('0xf7')]({'raw':!![]});}})[_0xdf45('0x16')](function(_0x2c1689){if(_0x58aa4b){if(_0x2c1689){_0x436816=_0x2c1689;if(_0x436816['length']){var _0x379b2d=_0x436816[_0xdf45('0x33')](function(_0x43db61){var _0x4dfbbe={'membername':_0x58aa4b[_0xdf45('0x38')],'UserId':_0x58aa4b['id'],'queue_name':_0x43db61['name'],'VoiceQueueId':_0x43db61['id'],'interface':_0x1141dc,'paused':_0x58aa4b['loginInPause']||![],'penalty':_0x43db61[_0xdf45('0xf8')]||0x0};return db[_0xdf45('0xaf')][_0xdf45('0xf9')](_0x4dfbbe);});return Promise[_0xdf45('0x53')](_0x379b2d);}}}})[_0xdf45('0x16')](function(){if(_0x58aa4b){return db['MemberReport'][_0xdf45('0x8e')]({'where':{'membername':_0x58aa4b[_0xdf45('0x38')],'exitAt':null}});}})[_0xdf45('0x16')](function(_0x553ddd){if(_0x58aa4b){var _0x3359c0=[];_0x553ddd[_0xdf45('0xfa')](function(_0x2bf523){_0x3359c0['push'](_0x2bf523[_0xdf45('0x28')]({'exitAt':moment()[_0xdf45('0xae')](_0xdf45('0xfb'))}));});return Promise[_0xdf45('0x53')](_0x3359c0);}})['then'](function(){if(_0x58aa4b){var _0x267050=[];var _0x370163=[];var _0x24261e=utils['getChannels']();var _0x1f0fbe={'membername':_0x58aa4b[_0xdf45('0x38')],'interface':_0x1141dc,'enterAt':moment()[_0xdf45('0xae')](_0xdf45('0xfb')),'role':_0x58aa4b[_0xdf45('0x29')],'internal':_0x58aa4b[_0xdf45('0x64')]};_0x24261e[_0xdf45('0xfa')](function(_0x3b07fe){_0x267050[_0xdf45('0x49')](_['merge']({'channel':_0x3b07fe,'type':'LOGIN','data1':_0x38bdce[_0xdf45('0x5e')]['device'],'data2':_0x1141dc},_0x1f0fbe));if(_0x58aa4b[_0xdf45('0xa2')]){_0x370163[_0xdf45('0x49')](_[_0xdf45('0x5b')]({'channel':_0x3b07fe,'type':'PAUSE','data1':_0xdf45('0xfc')},_0x1f0fbe));}});return db[_0xdf45('0xfd')]['bulkCreate'](_0x267050[_0xdf45('0xca')](_0x370163),{'individualHooks':!![]});}})[_0xdf45('0x16')](function(){if(_0x58aa4b){return _0x58aa4b[_0xdf45('0x28')]({'online':!![],'lastLoginAt':moment()[_0xdf45('0xae')](_0xdf45('0xfb')),'voicePause':_0x58aa4b[_0xdf45('0xa2')]||![],'mailPause':_0x58aa4b['loginInPause']||![],'chatPause':_0x58aa4b['loginInPause']||![],'faxPause':_0x58aa4b[_0xdf45('0xa2')]||![],'smsPause':_0x58aa4b[_0xdf45('0xa2')]||![],'openchannelPause':_0x58aa4b[_0xdf45('0xa2')]||![],'whatsappPause':_0x58aa4b[_0xdf45('0xa2')]||![],'pauseType':_0x58aa4b[_0xdf45('0xa2')]?'LOGININPAUSE':null,'interface':_0x1141dc,'lastPauseAt':moment()['format'](_0xdf45('0xfb'))});}})[_0xdf45('0x16')](function(_0x25a42a){if(_0x38bdce[_0xdf45('0xfe')]){return _0x2365e0();}else{return Promise[_0xdf45('0xff')](_0x25a42a)[_0xdf45('0x16')](respondWithResult(_0x4cd43c,null));}})[_0xdf45('0x5d')](handleError(_0x4cd43c,null));};exports[_0xdf45('0x100')]=function(_0x4622ab,_0x1fecc0){var _0x2f44b1;return db[_0xdf45('0x3b')]['find']({'where':{'id':_0x4622ab[_0xdf45('0x5f')]['id'],'role':_0xdf45('0x2a')},'attributes':['id',_0xdf45('0x38'),'role']})[_0xdf45('0x16')](handleEntityNotFound(_0x1fecc0,null))['then'](function(_0x23b6f1){if(_0x23b6f1){_0x2f44b1=_0x23b6f1;return db[_0xdf45('0xaf')][_0xdf45('0x2c')]({'where':{'membername':_0x2f44b1['name']},'individualHooks':!![]});}})[_0xdf45('0x16')](function(){return db[_0xdf45('0xfd')][_0xdf45('0x8e')]({'where':{'membername':_0x2f44b1['name'],'exitAt':null}});})[_0xdf45('0x16')](function(_0x432fe4){var _0x5a0a04=[];_0x432fe4[_0xdf45('0xfa')](function(_0x8bc60d){_0x5a0a04[_0xdf45('0x49')](_0x8bc60d[_0xdf45('0x28')]({'exitAt':moment()[_0xdf45('0xae')](_0xdf45('0xfb'))}));});return Promise[_0xdf45('0x53')](_0x5a0a04);})[_0xdf45('0x16')](function(){return _0x2f44b1[_0xdf45('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xdf45('0x16')](respondWithResult(_0x1fecc0,null))['catch'](handleError(_0x1fecc0,null));};exports[_0xdf45('0x101')]=function(_0x1360d0,_0x3ed3e3){var _0x47a6bc;return db['UserVoiceQueueRt'][_0xdf45('0x28')]({'paused':0x1},{'where':{'UserId':_0x1360d0[_0xdf45('0x5f')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0x1360d0['params']['id'],'role':_0xdf45('0x2a')},'attributes':['id',_0xdf45('0x38'),'role','internal',_0xdf45('0xa4'),_0xdf45('0xad')]});})[_0xdf45('0x16')](handleEntityNotFound(_0x3ed3e3,null))[_0xdf45('0x16')](function(_0x239745){if(_0x239745){_0x47a6bc=_0x239745;return respondWithRpcPromise(_0xdf45('0x102'),_0xdf45('0x101'),{'id':_0x47a6bc['id'],'name':_0x47a6bc['name'],'pause':!![]});}})[_0xdf45('0x16')](function(){if(_0x47a6bc){return db['MemberReport'][_0xdf45('0x8e')]({'where':{'membername':_0x47a6bc['name'],'type':'PAUSE','exitAt':null}});}})[_0xdf45('0x16')](function(_0x4523ab){if(_0x4523ab[_0xdf45('0x4c')]){var _0x404e51=moment()[_0xdf45('0xae')](_0xdf45('0xfb'));for(var _0x40d924=0x0,_0x4a48f2=_0x4523ab[_0xdf45('0x4c')];_0x40d924<_0x4a48f2;_0x40d924++){_0x4523ab[_0x40d924][_0xdf45('0x103')]({'exitAt':_0x404e51});}}})[_0xdf45('0x16')](function(){var _0x4eb893=[];var _0x2e5987=utils[_0xdf45('0x104')]();_0x2e5987[_0xdf45('0xfa')](function(_0x1f515){_0x4eb893[_0xdf45('0x49')]({'channel':_0x1f515,'membername':_0x47a6bc[_0xdf45('0x38')],'interface':_[_0xdf45('0x6f')](_0x47a6bc[_0xdf45('0xa4')])?util[_0xdf45('0xae')](_0xdf45('0xee'),_0x47a6bc[_0xdf45('0x38')]):_0x47a6bc[_0xdf45('0xa4')],'type':_0xdf45('0x105'),'enterAt':moment()[_0xdf45('0xae')](_0xdf45('0xfb')),'data1':_0x1360d0['body']['type']||_0xdf45('0x106'),'role':_0x47a6bc[_0xdf45('0x29')],'internal':_0x47a6bc[_0xdf45('0x64')]});});return db['MemberReport']['bulkCreate'](_0x4eb893,{'individualHooks':!![]});})[_0xdf45('0x16')](function(){return _0x47a6bc[_0xdf45('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1360d0[_0xdf45('0x5e')][_0xdf45('0x3e')]||_0xdf45('0x106'),'lastPauseAt':moment()[_0xdf45('0xae')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdf45('0x16')](respondWithResult(_0x3ed3e3,null))['catch'](handleError(_0x3ed3e3,null));};exports[_0xdf45('0x107')]=function(_0xa3d3ad,_0x438012){if(_0xa3d3ad[_0xdf45('0x5e')][_0xdf45('0xa1')]&&!utils['isValidChannel'](_0xa3d3ad[_0xdf45('0x5e')][_0xdf45('0xa1')])){throw new APIBadRequestError(util[_0xdf45('0xae')](_0xdf45('0x108'),_0xa3d3ad[_0xdf45('0x5e')][_0xdf45('0xa1')]));}return db[_0xdf45('0x3b')][_0xdf45('0x36')]({'where':{'id':_0xa3d3ad['params']['id']},'attributes':['id','name','role',_0xdf45('0x64'),_0xdf45('0xa4'),_0xdf45('0xad'),_0xdf45('0xa3'),_0xdf45('0x109'),'chatPause',_0xdf45('0x10a'),'openchannelPause',_0xdf45('0x10b'),'whatsappPause',_0xdf45('0x10c'),_0xdf45('0x10d')]})[_0xdf45('0x16')](function(_0x1b6fe6){if(!_0x1b6fe6){throw new APINotFoundError(util['format'](_0xdf45('0x10e'),_0xa3d3ad[_0xdf45('0x5f')]['id']));}return _0x1b6fe6[_0xdf45('0x107')](_0xa3d3ad['body'][_0xdf45('0xa1')]);})[_0xdf45('0x16')](respondWithResult(_0x438012,null))[_0xdf45('0x5d')](APIHandleError(_0x438012));};exports[_0xdf45('0x10f')]=function(_0x21eee9,_0x2fff87){var _0x318dac={};var _0x2bb0da={};var _0x7e3da8;var _0x480634;return db[_0xdf45('0x3b')]['findOne']({'where':{'id':_0x21eee9[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x2fff87,null))[_0xdf45('0x16')](function(_0xef6861){if(_0xef6861){_0x7e3da8=_0xef6861;_0x2bb0da[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0x110')]['rawAttributes']);_0x2bb0da[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x21eee9['query']);_0x2bb0da[_0xdf45('0x57')]=_['intersection'](_0x2bb0da[_0xdf45('0x54')],_0x2bb0da[_0xdf45('0x45')]);_0x318dac[_0xdf45('0x48')]=_[_0xdf45('0x58')](_0x2bb0da[_0xdf45('0x54')],qs[_0xdf45('0x59')](_0x21eee9[_0xdf45('0x45')]['fields']));_0x318dac['attributes']=_0x318dac['attributes'][_0xdf45('0x4c')]?_0x318dac['attributes']:_0x2bb0da[_0xdf45('0x54')];_0x318dac[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x21eee9[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x318dac['where']=qs['filters'](_[_0xdf45('0xce')](_0x21eee9['query'],_0x2bb0da['filters']));if(_0x21eee9[_0xdf45('0x45')]['filter']){_0x318dac['where']=_['merge'](_0x318dac[_0xdf45('0x43')],{'$or':_['map'](_0x318dac[_0xdf45('0x48')],function(_0x35bd09){var _0x23eee8={};_0x23eee8[_0x35bd09]={'$like':'%'+_0x21eee9[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x23eee8;})});}_0x318dac=_[_0xdf45('0x5b')]({},_0x318dac,_0x21eee9['options']);return _0x7e3da8[_0xdf45('0x10f')](_0x318dac);}})[_0xdf45('0x16')](function(_0x23632b){if(_0x23632b){_0x480634=_0x23632b['length'];if(!_0x21eee9[_0xdf45('0x45')]['hasOwnProperty'](_0xdf45('0xd9'))){_0x318dac['limit']=qs['limit'](_0x21eee9[_0xdf45('0x45')][_0xdf45('0x26')]);_0x318dac['offset']=qs[_0xdf45('0x25')](_0x21eee9[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0x7e3da8[_0xdf45('0x10f')](_0x318dac);}})[_0xdf45('0x16')](function(_0x32d8c8){if(_0x32d8c8){return _0x32d8c8?{'count':_0x480634,'rows':_0x32d8c8}:null;}})[_0xdf45('0x16')](respondWithResult(_0x2fff87,null))[_0xdf45('0x5d')](handleError(_0x2fff87,null));};exports[_0xdf45('0x111')]=function(_0x218530,_0xb0d643){var _0x41206f=_0x218530[_0xdf45('0x5f')]['id'];var _0x50f694=_0x218530[_0xdf45('0x5e')]?_0x218530['body'][_0xdf45('0x62')]:null;var _0x3426fb=[];return Promise[_0xdf45('0xff')]()['then'](function(){if(!_0x50f694)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xdf45('0x16')](function(){return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x41206f}});})[_0xdf45('0x16')](function(_0x534b31){if(!_0x534b31)throw new APINotFoundError(util[_0xdf45('0xae')](_0xdf45('0x10e'),_0x218530[_0xdf45('0x5f')]['id']));return db[_0xdf45('0x6b')][_0xdf45('0x112')](function(_0x4a7ef9){return _0x534b31[_0xdf45('0x111')](_0x50f694,{'transaction':_0x4a7ef9})[_0xdf45('0x16')](function(){return db[_0xdf45('0x110')][_0xdf45('0x8e')]({'where':{'id':{'$in':_0x50f694}}});})[_0xdf45('0x16')](function(_0x257935){var _0x2e2f08=_['map'](_0x257935,function(_0x2b1587){return _0x2b1587[_0xdf45('0x113')]();});return Promise[_0xdf45('0x53')](_0x2e2f08);})['then'](function(_0x179ea5){_0x3426fb=_[_0xdf45('0x114')](_0x179ea5);var _0x28c8d7=_[_0xdf45('0x33')](_0x3426fb,function(_0x1df6de){return _0x1df6de['addAgent'](_0x534b31['id'],{'transaction':_0x4a7ef9});});return Promise['all'](_0x28c8d7);})['then'](function(){if(!_0x534b31['online'])return;var _0x26dfe1=_[_0xdf45('0x31')](_0x3426fb,function(_0x45c5e0){return _0x45c5e0['getDataValue']('channel')===_0xdf45('0x115');});var _0x5d5aed=_[_0xdf45('0x33')](_0x26dfe1,function(_0x43097b){return db[_0xdf45('0xaf')][_0xdf45('0xf9')]({'membername':_0x534b31[_0xdf45('0x38')],'UserId':_0x534b31['id'],'queue_name':_0x43097b[_0xdf45('0x38')],'VoiceQueueId':_0x43097b['id'],'interface':_[_0xdf45('0x6f')](_0x534b31[_0xdf45('0xa4')])?util['format'](_0xdf45('0xee'),_0x534b31[_0xdf45('0x38')]):_0x534b31[_0xdf45('0xa4')],'paused':_0x534b31['voicePause']||![],'penalty':_0x534b31[_0xdf45('0xa6')]},{'transaction':_0x4a7ef9});});return Promise['all'](_0x5d5aed);})[_0xdf45('0x16')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x50f694}}});})['then'](function(_0x2a623a){var _0x567647=_[_0xdf45('0x33')](_0x2a623a,function(_0x3df832){return db['UserVoicePrefix'][_0xdf45('0x80')]({'UserId':_0x534b31['id'],'VoicePrefixId':_0x3df832['VoicePrefixId']},{'transaction':_0x4a7ef9});});return Promise[_0xdf45('0x53')](_0x567647);});});})['then'](function(){for(var _0x4a5437=0x0;_0x4a5437<_0x3426fb[_0xdf45('0x4c')];_0x4a5437++){var _0xc1f595=_0x3426fb[_0x4a5437][_0xdf45('0x116')]('channel');var _0xf46881=_0xc1f595+'QueueId';socket[_0xdf45('0xb6')](_0xdf45('0x2e')+_0xc1f595+_0xdf45('0xaa'),{'UserId':_0x41206f,['queueField']:_0x3426fb[_0x4a5437]['id']});}})[_0xdf45('0x16')](respondWithStatusCode(_0xb0d643,null))[_0xdf45('0x5d')](APIHandleError(_0xb0d643));};exports[_0xdf45('0x117')]=function(_0x1179df,_0xb13053){var _0x5e7616=_0x1179df[_0xdf45('0x5f')]['id'];var _0x308da6=null;if(_0x1179df[_0xdf45('0x45')][_0xdf45('0x62')]){_0x308da6=_[_0xdf45('0xb5')](_0x1179df[_0xdf45('0x45')][_0xdf45('0x62')])?_0x1179df[_0xdf45('0x45')][_0xdf45('0x62')]:[_0x1179df[_0xdf45('0x45')][_0xdf45('0x62')]];}var _0x3eda7d=[];return Promise[_0xdf45('0xff')]()[_0xdf45('0x16')](function(){if(!_0x308da6)throw new APIBadRequestError(_0xdf45('0x118'));})[_0xdf45('0x16')](function(){return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x5e7616}});})['then'](function(_0x31177c){if(!_0x31177c)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x1179df[_0xdf45('0x5f')]['id']));return db['sequelize']['transaction'](function(_0x262936){return _0x31177c[_0xdf45('0x117')](_0x308da6,{'transaction':_0x262936})['then'](function(){return db[_0xdf45('0x110')]['findAll']({'where':{'id':{'$in':_0x308da6}}});})[_0xdf45('0x16')](function(_0x1318fb){var _0x2ea43e=_[_0xdf45('0x33')](_0x1318fb,function(_0x28e4b5){return _0x28e4b5[_0xdf45('0x113')]();});return Promise[_0xdf45('0x53')](_0x2ea43e);})[_0xdf45('0x16')](function(_0x1c5735){_0x3eda7d=_[_0xdf45('0x114')](_0x1c5735);var _0xcf4daa=_[_0xdf45('0x33')](_0x3eda7d,function(_0x32ab98){return _0x32ab98[_0xdf45('0x119')](_0x31177c['id'],{'transaction':_0x262936});});return Promise[_0xdf45('0x53')](_0xcf4daa);})['then'](function(){if(!_0x31177c['online'])return;var _0x1b7a85=_[_0xdf45('0x31')](_0x3eda7d,function(_0x58f035){return _0x58f035[_0xdf45('0x116')](_0xdf45('0xa1'))==='Voice';});var _0x157fe1=_[_0xdf45('0x33')](_0x1b7a85,function(_0x4df54b){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4df54b['id'],'UserId':_0x31177c['id']},'transaction':_0x262936});});return Promise[_0xdf45('0x53')](_0x157fe1);})[_0xdf45('0x16')](function(){return db[_0xdf45('0x11a')][_0xdf45('0x8e')]({'where':{'teamId':{'$in':_0x308da6}}});})['then'](function(_0x2e985c){var _0x491629=_[_0xdf45('0x33')](_0x2e985c,function(_0x4015a0){return db['UserVoicePrefix'][_0xdf45('0x2c')]({'where':{'UserId':_0x31177c['id'],'VoicePrefixId':_0x4015a0[_0xdf45('0x11b')]}},{'transaction':_0x262936});});return Promise['all'](_0x491629);});});})['then'](function(){for(var _0x1cc21d=0x0;_0x1cc21d<_0x3eda7d['length'];_0x1cc21d++){var _0x2b5336=_0x3eda7d[_0x1cc21d]['getDataValue'](_0xdf45('0xa1'));var _0x328fd4=_0x2b5336+'QueueId';socket[_0xdf45('0xb6')](_0xdf45('0x2e')+_0x2b5336+'Queue:remove',{'UserId':_0x5e7616,['queueField']:_0x3eda7d[_0x1cc21d]['id']});}})['then'](respondWithStatusCode(_0xb13053,null))[_0xdf45('0x5d')](APIHandleError(_0xb13053));};exports[_0xdf45('0x11c')]=function(_0x42a3ed,_0x16cfbd){var _0x3a8669={};var _0x340179={};var _0x544a39;var _0x294d25;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x42a3ed[_0xdf45('0x5f')]['id']}})[_0xdf45('0x16')](handleEntityNotFound(_0x16cfbd,null))[_0xdf45('0x16')](function(_0x4b4f2e){if(_0x4b4f2e){_0x544a39=_0x4b4f2e;_0x340179['model']=_['keys'](db['CmList'][_0xdf45('0x3c')]);_0x340179[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x42a3ed[_0xdf45('0x45')]);_0x340179[_0xdf45('0x57')]=_[_0xdf45('0x58')](_0x340179[_0xdf45('0x54')],_0x340179[_0xdf45('0x45')]);_0x3a8669['attributes']=_['intersection'](_0x340179['model'],qs['fields'](_0x42a3ed[_0xdf45('0x45')][_0xdf45('0x59')]));_0x3a8669['attributes']=_0x3a8669[_0xdf45('0x48')][_0xdf45('0x4c')]?_0x3a8669[_0xdf45('0x48')]:_0x340179['model'];_0x3a8669[_0xdf45('0xcc')]=qs[_0xdf45('0xcd')](_0x42a3ed[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x3a8669[_0xdf45('0x43')]=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x42a3ed[_0xdf45('0x45')],_0x340179[_0xdf45('0x57')]));if(_0x42a3ed['query']['filter']){_0x3a8669[_0xdf45('0x43')]=_[_0xdf45('0x5b')](_0x3a8669[_0xdf45('0x43')],{'$or':_['map'](_0x3a8669[_0xdf45('0x48')],function(_0x172625){var _0x4c000f={};_0x4c000f[_0x172625]={'$like':'%'+_0x42a3ed[_0xdf45('0x45')]['filter']+'%'};return _0x4c000f;})});}_0x3a8669=_[_0xdf45('0x5b')]({},_0x3a8669,_0x42a3ed['options']);return _0x544a39[_0xdf45('0x11c')](_0x3a8669);}})[_0xdf45('0x16')](function(_0x32c411){if(_0x32c411){_0x294d25=_0x32c411[_0xdf45('0x4c')];if(!_0x42a3ed[_0xdf45('0x45')][_0xdf45('0xcf')](_0xdf45('0xd9'))){_0x3a8669[_0xdf45('0x26')]=qs[_0xdf45('0x26')](_0x42a3ed[_0xdf45('0x45')][_0xdf45('0x26')]);_0x3a8669[_0xdf45('0x25')]=qs[_0xdf45('0x25')](_0x42a3ed[_0xdf45('0x45')][_0xdf45('0x25')]);}return _0x544a39[_0xdf45('0x11c')](_0x3a8669);}})['then'](function(_0x14969e){if(_0x14969e){return _0x14969e?{'count':_0x294d25,'rows':_0x14969e}:null;}})[_0xdf45('0x16')](respondWithResult(_0x16cfbd,null))[_0xdf45('0x5d')](handleError(_0x16cfbd,null));};exports[_0xdf45('0x11d')]=function(_0x2f57a2,_0x39ec5a){var _0x156d06={};var _0x41f816={};var _0x4a65dd;return db[_0xdf45('0x3b')][_0xdf45('0x9a')]({'where':{'id':_0x2f57a2['params']['id']}})['then'](handleEntityNotFound(_0x39ec5a,null))[_0xdf45('0x16')](function(_0xcc0a6c){if(_0xcc0a6c){_0x4a65dd=_0xcc0a6c;_0x41f816[_0xdf45('0x54')]=_[_0xdf45('0x56')](db[_0xdf45('0x3b')][_0xdf45('0x3c')]);_0x41f816[_0xdf45('0x45')]=_[_0xdf45('0x56')](_0x2f57a2['query']);_0x41f816[_0xdf45('0x57')]=_['intersection'](_0x41f816[_0xdf45('0x54')],_0x41f816[_0xdf45('0x45')]);_0x156d06['attributes']=_[_0xdf45('0x58')](_0x41f816[_0xdf45('0x54')],qs['fields'](_0x2f57a2[_0xdf45('0x45')][_0xdf45('0x59')]));_0x156d06[_0xdf45('0x48')]=_0x156d06[_0xdf45('0x48')]['length']?_0x156d06[_0xdf45('0x48')]:_0x41f816[_0xdf45('0x54')];_0x156d06[_0xdf45('0xcc')]=qs['sort'](_0x2f57a2[_0xdf45('0x45')][_0xdf45('0xcd')]);_0x156d06['where']=qs[_0xdf45('0x57')](_[_0xdf45('0xce')](_0x2f57a2[_0xdf45('0x45')],_0x41f816[_0xdf45('0x57')]));if(_0x2f57a2['query'][_0xdf45('0x31')]){_0x156d06[_0xdf45('0x43')]=_['merge'](_0x156d06[_0xdf45('0x43')],{'$or':_['map'](_0x156d06[_0xdf45('0x48')],function(_0x1fac5f){var _0x19678e={};_0x19678e[_0x1fac5f]={'$like':'%'+_0x2f57a2[_0xdf45('0x45')][_0xdf45('0x31')]+'%'};return _0x19678e;})});}_0x156d06[_0xdf45('0x54')]=db[_0xdf45('0x3b')];_0x156d06['as']=_0xdf45('0x89');_0x156d06=_[_0xdf45('0x5b')]({},_0x156d06,_0x2f57a2[_0xdf45('0x5c')]);return _0x4a65dd['getVoiceQueues']({'include':[_0x156d06]});}})[_0xdf45('0x16')](function(_0x28c533){if(_0x28c533){var _0x2144d7={},_0x4cdb10=[];for(var _0x43ff63=0x0;_0x43ff63<_0x28c533[_0xdf45('0x4c')];_0x43ff63+=0x1){for(var _0x22d03a=0x0,_0x13528e;_0x22d03a<_0x28c533[_0x43ff63][_0xdf45('0x89')][_0xdf45('0x4c')];_0x22d03a+=0x1){_0x13528e=_0x28c533[_0x43ff63][_0xdf45('0x89')][_0x22d03a][_0xdf45('0xd7')]({'plain':!![]});_0x2144d7[_0x13528e['id']]=_0x13528e;}}_0x2144d7=_['values'](_0x2144d7);for(var _0x21d180=qs['offset'](_0x2f57a2[_0xdf45('0x45')][_0xdf45('0x25')]);_0x21d180<_0x2144d7[_0xdf45('0x4c')]&&_0x4cdb10[_0xdf45('0x4c')]=_0x11cf9d[_0x26f9('0x4c')]){throw new Error(_0x26f9('0x4d'));}})[_0x26f9('0x11')](function(){if(_0x787ca0){return db[_0x26f9('0x41')][_0x26f9('0x42')]({'where':{'membername':_0x787ca0[_0x26f9('0x1c')]},'individualHooks':!![]});}})[_0x26f9('0x11')](function(){if(_0x787ca0){return _0x787ca0[_0x26f9('0x4e')]({'raw':!![]});}})[_0x26f9('0x11')](function(_0x283b9a){if(_0x787ca0){if(_0x283b9a){var _0x378297=[];_0xfdc547=_0x283b9a;if(_0xfdc547[_0x26f9('0x25')]){for(var _0x3a99da=0x0;_0x3a99da<_0xfdc547[_0x26f9('0x25')];_0x3a99da++){_0x378297[_0x26f9('0x29')](db[_0x26f9('0x41')]['upsert']({'membername':_0x787ca0[_0x26f9('0x1c')],'UserId':_0x787ca0['id'],'queue_name':_0xfdc547[_0x3a99da][_0x26f9('0x1c')],'VoiceQueueId':_0xfdc547[_0x3a99da]['id'],'interface':_0x67544,'paused':_0x787ca0[_0x26f9('0x47')]||![],'penalty':_0xfdc547[_0x3a99da][_0x26f9('0x4f')]||0x0}));}return BPromise[_0x26f9('0x43')](_0x378297);}}}})['then'](function(){if(_0x787ca0){return db['MemberReport'][_0x26f9('0xa')]({'where':{'membername':_0x787ca0[_0x26f9('0x1c')],'exitAt':null}});}})[_0x26f9('0x11')](function(_0x2327dc){if(_0x787ca0){if(_0x2327dc&&_0x2327dc[_0x26f9('0x25')]){var _0x17233f=[];_0x2327dc[_0x26f9('0x28')](function(_0x30cdb2){_0x17233f[_0x26f9('0x29')](_0x30cdb2['update']({'exitAt':moment()[_0x26f9('0x1f')](_0x26f9('0x2b'))}));});return BPromise[_0x26f9('0x43')](_0x17233f);}}})[_0x26f9('0x11')](function(){if(_0x787ca0){var _0x598217=[];var _0x4aa691=[];var _0x5563da=utils['getChannels']();var _0x466c3f={'membername':_0x787ca0[_0x26f9('0x1c')],'interface':_0x67544,'enterAt':moment()['format'](_0x26f9('0x2b')),'role':_0x787ca0[_0x26f9('0x2d')],'internal':_0x787ca0[_0x26f9('0x1d')]};_0x5563da[_0x26f9('0x28')](function(_0x593061){_0x598217[_0x26f9('0x29')](_['merge']({'channel':_0x593061,'type':_0x26f9('0x50'),'data1':'callysquare','data2':_0x67544},_0x466c3f));if(_0x787ca0['loginInPause']){_0x4aa691['push'](_[_0x26f9('0x51')]({'channel':_0x593061,'type':_0x26f9('0x24'),'data1':_0x26f9('0x52')},_0x466c3f));}});return db[_0x26f9('0x23')][_0x26f9('0x30')](_0x598217[_0x26f9('0x53')](_0x4aa691),{'individualHooks':!![]});}})['then'](function(){if(_0x787ca0){return _0x787ca0['update']({'online':!![],'lastLoginAt':moment()['format'](_0x26f9('0x2b')),'voicePause':_0x787ca0[_0x26f9('0x47')]||![],'mailPause':_0x787ca0[_0x26f9('0x47')]||![],'chatPause':_0x787ca0[_0x26f9('0x47')]||![],'faxPause':_0x787ca0['loginInPause']||![],'smsPause':_0x787ca0[_0x26f9('0x47')]||![],'openchannelPause':_0x787ca0['loginInPause']||![],'pauseType':_0x787ca0['loginInPause']?_0x26f9('0x52'):null,'lastPauseAt':moment()[_0x26f9('0x1f')](_0x26f9('0x2b')),'interface':_0x67544});}})[_0x26f9('0x11')](function(_0x5e0c07){_0x575a20(_0x5e0c07);})[_0x26f9('0x15')](function(_0x6f75e2){_0x76976b(_0xfeaee6[_0x26f9('0x16')](0x1f4,_0x6f75e2[_0x26f9('0x17')]));});});}; \ No newline at end of file +var _0x043e=['length','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../config/utils','rpc','defaults','redis','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','map','include','then','info','debug','stringify','error','message','ShowUser','find','catch','PauseUser','name','role','interface','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','SIP/%s','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','resolve','channel','isValidChannel','findOne','online','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','unpause','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','agents','getVoiceQueues'];(function(_0x46c1fd,_0x58c17e){var _0x57b672=function(_0xb707ac){while(--_0xb707ac){_0x46c1fd['push'](_0x46c1fd['shift']());}};_0x57b672(++_0x58c17e);}(_0x043e,0x156));var _0xe043=function(_0x35f748,_0x280e96){_0x35f748=_0x35f748-0x0;var _0x1b865b=_0x043e[_0x35f748];return _0x1b865b;};'use strict';var _=require(_0xe043('0x0'));var util=require(_0xe043('0x1'));var moment=require(_0xe043('0x2'));var BPromise=require('bluebird');var Redis=require(_0xe043('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe043('0x4'));var logger=require('../../config/logger')(_0xe043('0x5'));var config=require('../../config/environment');config['redis']=_[_0xe043('0x6')](config[_0xe043('0x7')],{'host':_0xe043('0x8'),'port':0x18eb});var socket=require(_0xe043('0x9'))(new Redis(config[_0xe043('0x7')]));require(_0xe043('0xa'))[_0xe043('0xb')](socket);exports[_0xe043('0xc')]=function(_0x456a2a){var _0x3bfc55=this;return new Promise(function(_0x417fea,_0x5c554c){return db[_0xe043('0xd')][_0xe043('0xe')]({'raw':_0x456a2a[_0xe043('0xf')]?_0x456a2a[_0xe043('0xf')][_0xe043('0x10')]===undefined?!![]:![]:!![],'where':_0x456a2a['options']?_0x456a2a[_0xe043('0xf')][_0xe043('0x11')]||null:null,'attributes':_0x456a2a['options']?_0x456a2a[_0xe043('0xf')][_0xe043('0x12')]||null:null,'limit':_0x456a2a[_0xe043('0xf')]?_0x456a2a[_0xe043('0xf')][_0xe043('0x13')]||null:null,'include':_0x456a2a[_0xe043('0xf')]?_0x456a2a[_0xe043('0xf')]['include']?_[_0xe043('0x14')](_0x456a2a[_0xe043('0xf')][_0xe043('0x15')],function(_0x557df8){return{'model':db[_0x557df8['model']],'as':_0x557df8['as'],'attributes':_0x557df8[_0xe043('0x12')],'include':_0x557df8[_0xe043('0x15')]?_[_0xe043('0x14')](_0x557df8['include'],function(_0x16fca6){return{'model':db[_0x16fca6['model']],'as':_0x16fca6['as'],'attributes':_0x16fca6[_0xe043('0x12')],'include':_0x16fca6[_0xe043('0x15')]?_[_0xe043('0x14')](_0x16fca6[_0xe043('0x15')],function(_0x467c87){return{'model':db[_0x467c87['model']],'as':_0x467c87['as'],'attributes':_0x467c87[_0xe043('0x12')]};}):[]};}):[]};}):[]:[]})[_0xe043('0x16')](function(_0x97fcfd){logger[_0xe043('0x17')](_0xe043('0xc'),_0x456a2a);logger[_0xe043('0x18')](_0xe043('0xc'),_0x456a2a,JSON[_0xe043('0x19')](_0x97fcfd));_0x417fea(_0x97fcfd);})['catch'](function(_0x2a48e8){logger[_0xe043('0x1a')](_0xe043('0xc'),_0x2a48e8[_0xe043('0x1b')],_0x456a2a);_0x5c554c(_0x3bfc55[_0xe043('0x1a')](0x1f4,_0x2a48e8['message']));});});};exports[_0xe043('0x1c')]=function(_0x5978bc){var _0x190fb7=this;return new Promise(function(_0x2124a2,_0x31502f){return db[_0xe043('0xd')][_0xe043('0x1d')]({'raw':_0x5978bc[_0xe043('0xf')]?_0x5978bc[_0xe043('0xf')][_0xe043('0x10')]===undefined?!![]:![]:!![],'where':_0x5978bc[_0xe043('0xf')]?_0x5978bc['options']['where']||null:null,'attributes':_0x5978bc['options']?_0x5978bc[_0xe043('0xf')]['attributes']||null:null,'include':_0x5978bc[_0xe043('0xf')]?_0x5978bc['options'][_0xe043('0x15')]?_['map'](_0x5978bc[_0xe043('0xf')]['include'],function(_0x69ecfa){return{'model':db[_0x69ecfa['model']],'as':_0x69ecfa['as'],'attributes':_0x69ecfa[_0xe043('0x12')],'include':_0x69ecfa['include']?_[_0xe043('0x14')](_0x69ecfa[_0xe043('0x15')],function(_0x4998bf){return{'model':db[_0x4998bf['model']],'as':_0x4998bf['as'],'attributes':_0x4998bf[_0xe043('0x12')],'include':_0x4998bf[_0xe043('0x15')]?_['map'](_0x4998bf['include'],function(_0x1f7fa5){return{'model':db[_0x1f7fa5['model']],'as':_0x1f7fa5['as'],'attributes':_0x1f7fa5[_0xe043('0x12')]};}):[]};}):[]};}):[]:[]})[_0xe043('0x16')](function(_0x40089d){logger[_0xe043('0x17')]('ShowUser',_0x5978bc);logger[_0xe043('0x18')]('ShowUser',_0x5978bc,JSON[_0xe043('0x19')](_0x40089d));_0x2124a2(_0x40089d);})[_0xe043('0x1e')](function(_0x33f62c){logger[_0xe043('0x1a')](_0xe043('0x1c'),_0x33f62c[_0xe043('0x1b')],_0x5978bc);_0x31502f(_0x190fb7[_0xe043('0x1a')](0x1f4,_0x33f62c[_0xe043('0x1b')]));});});};exports[_0xe043('0x1f')]=function(_0x5e2a77){var _0x1f733e;return db['User'][_0xe043('0x1d')]({'where':_0x5e2a77[_0xe043('0xf')][_0xe043('0x11')]||{},'attributes':['id',_0xe043('0x20'),_0xe043('0x21'),'internal',_0xe043('0x22')]})[_0xe043('0x16')](function(_0x29c2ca){if(!_0x29c2ca){throw new Error(util['format'](_0xe043('0x23'),_0x5e2a77[_0xe043('0x24')]['id']));}_0x1f733e=_0x29c2ca;return db[_0xe043('0x25')][_0xe043('0x26')]({'paused':0x1},{'where':{'UserId':_0x1f733e['id']},'individualHooks':!![]});})['then'](function(){return db[_0xe043('0x27')][_0xe043('0xe')]({'where':{'membername':_0x1f733e[_0xe043('0x20')],'type':_0xe043('0x28'),'exitAt':null}});})[_0xe043('0x16')](function(_0x4bbeec){if(_0x4bbeec&&_0x4bbeec['length']){var _0x4b9bc6=moment()[_0xe043('0x29')](_0xe043('0x2a'));for(var _0x507f9a=0x0,_0x2120b9=_0x4bbeec['length'];_0x507f9a<_0x2120b9;_0x507f9a++){_0x4bbeec[_0x507f9a]['updateAttributes']({'exitAt':_0x4b9bc6});}}})[_0xe043('0x16')](function(){var _0x1858f4=[];var _0x679759=utils[_0xe043('0x2b')]();_0x679759[_0xe043('0x2c')](function(_0x130cc0){_0x1858f4[_0xe043('0x2d')]({'channel':_0x130cc0,'membername':_0x1f733e[_0xe043('0x20')],'interface':_[_0xe043('0x2e')](_0x1f733e['interface'])?util[_0xe043('0x29')](_0xe043('0x2f'),_0x1f733e[_0xe043('0x20')]):_0x1f733e[_0xe043('0x22')],'type':_0xe043('0x28'),'enterAt':moment()['format'](_0xe043('0x2a')),'data1':_0x5e2a77[_0xe043('0x30')]['type']||_0xe043('0x31'),'role':_0x1f733e[_0xe043('0x21')],'internal':_0x1f733e[_0xe043('0x32')],'uniqueid':_0x5e2a77[_0xe043('0x30')][_0xe043('0x33')]||null});});return db[_0xe043('0x27')][_0xe043('0x34')](_0x1858f4,{'individualHooks':!![]});})['then'](function(){return _0x1f733e[_0xe043('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5e2a77['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe043('0x29')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xe043('0x1e')](function(_0x238520){throw _0x238520;});};exports['UnpauseUser']=function(_0x4a9cd4){return Promise[_0xe043('0x35')]()[_0xe043('0x16')](function(){if(_0x4a9cd4['body'][_0xe043('0x36')]&&!utils[_0xe043('0x37')](_0x4a9cd4[_0xe043('0x30')]['channel'])){throw new Error(util[_0xe043('0x29')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x4a9cd4[_0xe043('0x30')]['channel']));}return db[_0xe043('0xd')][_0xe043('0x38')]({'where':_0x4a9cd4[_0xe043('0xf')][_0xe043('0x11')]||{},'attributes':['id',_0xe043('0x20'),_0xe043('0x21'),_0xe043('0x32'),_0xe043('0x22'),_0xe043('0x39'),_0xe043('0x3a'),_0xe043('0x3b'),'chatPause',_0xe043('0x3c'),_0xe043('0x3d'),_0xe043('0x3e'),_0xe043('0x3f'),'pauseType',_0xe043('0x40')]});})[_0xe043('0x16')](function(_0x11d12b){if(!_0x11d12b){throw new Error(util['format'](_0xe043('0x23'),_0x4a9cd4[_0xe043('0x24')]['id']));}return _0x11d12b[_0xe043('0x41')](_0x4a9cd4[_0xe043('0x30')][_0xe043('0x36')],'system');})[_0xe043('0x1e')](function(_0x3f6f49){throw _0x3f6f49;});};exports[_0xe043('0x42')]=function(_0x4a2297){var _0xad5b49=this;return new Promise(function(_0x5632e6,_0x7ca786){var _0x325bb8;return db[_0xe043('0xd')][_0xe043('0x38')]({'where':_0x4a2297[_0xe043('0xf')][_0xe043('0x11')]||{},'attributes':['id',_0xe043('0x20')]})[_0xe043('0x16')](function(_0x39d389){if(_0x39d389){_0x325bb8=_0x39d389;return db[_0xe043('0x25')][_0xe043('0x43')]({'where':{'membername':_0x325bb8[_0xe043('0x20')]},'individualHooks':!![]});}})[_0xe043('0x16')](function(){if(_0x325bb8){return db['MemberReport'][_0xe043('0xe')]({'where':{'membername':_0x325bb8[_0xe043('0x20')],'exitAt':null}});}})[_0xe043('0x16')](function(_0x365fc1){if(_0x325bb8){if(_0x365fc1&&_0x365fc1['length']){var _0x2c8ada=[];_0x365fc1[_0xe043('0x2c')](function(_0x24b219){_0x2c8ada[_0xe043('0x2d')](_0x24b219[_0xe043('0x26')]({'exitAt':moment()[_0xe043('0x29')](_0xe043('0x2a'))}));});return BPromise[_0xe043('0x44')](_0x2c8ada);}}})[_0xe043('0x16')](function(){if(_0x325bb8){return _0x325bb8['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe043('0x16')](function(_0x1a51a3){_0x5632e6(_0x1a51a3);})[_0xe043('0x1e')](function(_0x43cf2e){_0x7ca786(_0xad5b49[_0xe043('0x1a')](0x1f4,_0x43cf2e[_0xe043('0x1b')]));});});};exports[_0xe043('0x45')]=function(_0x50a1cb){var _0x56e462=this;return new Promise(function(_0x556739,_0x373510){var _0x3a4d70;var _0x116b3d;var _0x1f6bb2;var _0x5df511;return db[_0xe043('0xd')][_0xe043('0x38')]({'where':_0x50a1cb[_0xe043('0xf')][_0xe043('0x11')]||{},'attributes':['id',_0xe043('0x20'),_0xe043('0x21'),_0xe043('0x46'),_0xe043('0x47'),_0xe043('0x32'),_0xe043('0x48'),_0xe043('0x22')]})['then'](function(_0x2f8287){if(_0x2f8287){_0x3a4d70=_0x2f8287;_0x5df511=_0x50a1cb['body']['interface']?_0x50a1cb[_0xe043('0x30')][_0xe043('0x22')]:util[_0xe043('0x29')]('SIP/%s',_0x3a4d70[_0xe043('0x20')]);return db[_0xe043('0xd')][_0xe043('0x49')]({'where':{'role':_0xe043('0x4a'),'online':!![],'id':{'$ne':_0x3a4d70['id']}}});}})[_0xe043('0x16')](function(_0x4c3941){if(_0x4c3941){_0x1f6bb2=_0x4c3941;return require(_0xe043('0x4b'))['getLicense']();}})[_0xe043('0x16')](function(_0x2d3299){if(_0x2d3299&&_0x2d3299[_0xe043('0x4c')]&&_0x1f6bb2>=_0x2d3299['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xe043('0x16')](function(){if(_0x3a4d70){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3a4d70[_0xe043('0x20')]},'individualHooks':!![]});}})[_0xe043('0x16')](function(){if(_0x3a4d70){return _0x3a4d70[_0xe043('0x4d')]({'raw':!![]});}})['then'](function(_0x4e67f4){if(_0x3a4d70){if(_0x4e67f4){var _0x21703f=[];_0x116b3d=_0x4e67f4;if(_0x116b3d[_0xe043('0x4e')]){for(var _0x4f6075=0x0;_0x4f6075<_0x116b3d[_0xe043('0x4e')];_0x4f6075++){_0x21703f[_0xe043('0x2d')](db[_0xe043('0x25')]['upsert']({'membername':_0x3a4d70[_0xe043('0x20')],'UserId':_0x3a4d70['id'],'queue_name':_0x116b3d[_0x4f6075]['name'],'VoiceQueueId':_0x116b3d[_0x4f6075]['id'],'interface':_0x5df511,'paused':_0x3a4d70[_0xe043('0x48')]||![],'penalty':_0x116b3d[_0x4f6075][_0xe043('0x4f')]||0x0}));}return BPromise[_0xe043('0x44')](_0x21703f);}}}})[_0xe043('0x16')](function(){if(_0x3a4d70){return db[_0xe043('0x27')][_0xe043('0xe')]({'where':{'membername':_0x3a4d70[_0xe043('0x20')],'exitAt':null}});}})['then'](function(_0x3ef2e5){if(_0x3a4d70){if(_0x3ef2e5&&_0x3ef2e5[_0xe043('0x4e')]){var _0x21e188=[];_0x3ef2e5[_0xe043('0x2c')](function(_0x22a74a){_0x21e188[_0xe043('0x2d')](_0x22a74a[_0xe043('0x26')]({'exitAt':moment()['format'](_0xe043('0x2a'))}));});return BPromise['all'](_0x21e188);}}})[_0xe043('0x16')](function(){if(_0x3a4d70){var _0x14e504=[];var _0x385334=[];var _0x43a766=utils[_0xe043('0x2b')]();var _0x18e7e1={'membername':_0x3a4d70[_0xe043('0x20')],'interface':_0x5df511,'enterAt':moment()[_0xe043('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3a4d70['role'],'internal':_0x3a4d70['internal']};_0x43a766[_0xe043('0x2c')](function(_0x1f74db){_0x14e504[_0xe043('0x2d')](_[_0xe043('0x50')]({'channel':_0x1f74db,'type':_0xe043('0x51'),'data1':'callysquare','data2':_0x5df511},_0x18e7e1));if(_0x3a4d70[_0xe043('0x48')]){_0x385334[_0xe043('0x2d')](_[_0xe043('0x50')]({'channel':_0x1f74db,'type':_0xe043('0x28'),'data1':_0xe043('0x52')},_0x18e7e1));}});return db['MemberReport'][_0xe043('0x34')](_0x14e504[_0xe043('0x53')](_0x385334),{'individualHooks':!![]});}})['then'](function(){if(_0x3a4d70){return _0x3a4d70[_0xe043('0x26')]({'online':!![],'lastLoginAt':moment()[_0xe043('0x29')](_0xe043('0x2a')),'voicePause':_0x3a4d70[_0xe043('0x48')]||![],'mailPause':_0x3a4d70[_0xe043('0x48')]||![],'chatPause':_0x3a4d70[_0xe043('0x48')]||![],'faxPause':_0x3a4d70['loginInPause']||![],'smsPause':_0x3a4d70[_0xe043('0x48')]||![],'openchannelPause':_0x3a4d70['loginInPause']||![],'pauseType':_0x3a4d70[_0xe043('0x48')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xe043('0x29')](_0xe043('0x2a')),'interface':_0x5df511});}})[_0xe043('0x16')](function(_0x15a309){_0x556739(_0x15a309);})[_0xe043('0x1e')](function(_0x1150e5){_0x373510(_0x56e462[_0xe043('0x1a')](0x1f4,_0x1150e5[_0xe043('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7fd1aab..6182b18 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 _0x3068=['update','emit','removeListener','register','length','user:'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x3068,0x7e));var _0x8306=function(_0x2dc209,_0x145989){_0x2dc209=_0x2dc209-0x0;var _0x4d8008=_0x3068[_0x2dc209];return _0x4d8008;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x8306('0x0')];function createListener(_0x5cfe7e,_0x4368d3){return function(_0x398d05){_0x4368d3[_0x8306('0x1')](_0x5cfe7e,_0x398d05);};}function removeListener(_0x582520,_0x40f9c1){return function(){UserEvents[_0x8306('0x2')](_0x582520,_0x40f9c1);};}exports[_0x8306('0x3')]=function(_0x572ee0){for(var _0x961dd8=0x0,_0x1a6f8e=events[_0x8306('0x4')];_0x961dd8<_0x1a6f8e;_0x961dd8++){var _0x50b193=events[_0x961dd8];var _0x56956b=createListener(_0x8306('0x5')+_0x50b193,_0x572ee0);UserEvents['on'](_0x50b193,_0x56956b);}}; \ No newline at end of file +var _0xd24a=['emit','removeListener','register','user:','./user.events','save','remove'];(function(_0x4fa622,_0x4e2fe9){var _0xc754da=function(_0x117cd7){while(--_0x117cd7){_0x4fa622['push'](_0x4fa622['shift']());}};_0xc754da(++_0x4e2fe9);}(_0xd24a,0x115));var _0xad24=function(_0x377482,_0x47272a){_0x377482=_0x377482-0x0;var _0x3a6171=_0xd24a[_0x377482];return _0x3a6171;};'use strict';var UserEvents=require(_0xad24('0x0'));var events=[_0xad24('0x1'),_0xad24('0x2'),'update'];function createListener(_0x49a5e7,_0x23fe86){return function(_0x1bdf2d){_0x23fe86[_0xad24('0x3')](_0x49a5e7,_0x1bdf2d);};}function removeListener(_0x200e7d,_0x217f58){return function(){UserEvents[_0xad24('0x4')](_0x200e7d,_0x217f58);};}exports[_0xad24('0x5')]=function(_0x4a5d39){for(var _0x4a48de=0x0,_0xb67e63=events['length'];_0x4a48de<_0xb67e63;_0x4a48de++){var _0x111a09=events[_0x4a48de];var _0x103825=createListener(_0xad24('0x6')+_0x111a09,_0x4a5d39);UserEvents['on'](_0x111a09,_0x103825);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 21e3784..858dad4 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(_0xbff2a1,_0x47429f){var _0x19767f=function(_0x2c2679){while(--_0x2c2679){_0xbff2a1['push'](_0xbff2a1['shift']());}};_0x19767f(++_0x47429f);}(_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(_0x2dee2f,_0x19572f){var _0x327c18=function(_0x130ec0){while(--_0x130ec0){_0x2dee2f['push'](_0x2dee2f['shift']());}};_0x327c18(++_0x19572f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index e5e1e15..00be349 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 _0x3863=['INTEGER'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x3863,0x72));var _0x3386=function(_0x1c7adc,_0xa9404a){_0x1c7adc=_0x1c7adc-0x0;var _0x2d8cf5=_0x3863[_0x1c7adc];return _0x2d8cf5;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x3386('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x854a=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x854a,0x1e8));var _0xa854=function(_0x2a9502,_0x4b9954){_0x2a9502=_0x2a9502-0x0;var _0x3f51da=_0x854a[_0x2a9502];return _0x3f51da;};'use strict';var Sequelize=require(_0xa854('0x0'));module[_0xa854('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 776bf1d..0c29048 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 _0xdbfb=['user_has_chat_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xfee47a,_0x448287){var _0x9820c=function(_0x4a96c0){while(--_0x4a96c0){_0xfee47a['push'](_0xfee47a['shift']());}};_0x9820c(++_0x448287);}(_0xdbfb,0xd2));var _0xbdbf=function(_0x266b1f,_0x2c210d){_0x266b1f=_0x266b1f-0x0;var _0x15b85e=_0xdbfb[_0x266b1f];return _0x15b85e;};'use strict';var _=require(_0xbdbf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdbf('0x1'));var moment=require(_0xbdbf('0x2'));var BPromise=require(_0xbdbf('0x3'));var rp=require(_0xbdbf('0x4'));var fs=require('fs');var path=require(_0xbdbf('0x5'));var rimraf=require(_0xbdbf('0x6'));var config=require(_0xbdbf('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xbdbf('0x8')]=function(_0x4915b5,_0x30392b){return _0x4915b5[_0xbdbf('0x9')]('UserChatQueue',attributes,{'tableName':_0xbdbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa077=['moment','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','define','lodash','util','api'];(function(_0x13c174,_0xda25fe){var _0x160654=function(_0x1b6ac2){while(--_0x1b6ac2){_0x13c174['push'](_0x13c174['shift']());}};_0x160654(++_0xda25fe);}(_0xa077,0x1bf));var _0x7a07=function(_0x1a39c4,_0x566bbb){_0x1a39c4=_0x1a39c4-0x0;var _0x4e7347=_0xa077[_0x1a39c4];return _0x4e7347;};'use strict';var _=require(_0x7a07('0x0'));var util=require(_0x7a07('0x1'));var logger=require('../../config/logger')(_0x7a07('0x2'));var moment=require(_0x7a07('0x3'));var BPromise=require(_0x7a07('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7a07('0x5'));var config=require(_0x7a07('0x6'));var attributes=require(_0x7a07('0x7'));module['exports']=function(_0x1dd2d0,_0x1d392d){return _0x1dd2d0[_0x7a07('0x8')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','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 6d76a2d..a4e3173 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 _0x1bba=['message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2755fc,_0x3ba057){var _0x440986=function(_0x1a465d){while(--_0x1a465d){_0x2755fc['push'](_0x2755fc['shift']());}};_0x440986(++_0x3ba057);}(_0x1bba,0xb3));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa1bb('0x0'));var moment=require('moment');var BPromise=require(_0xa1bb('0x1'));var rs=require(_0xa1bb('0x2'));var fs=require('fs');var Redis=require(_0xa1bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1bb('0x4'));var logger=require(_0xa1bb('0x5'))(_0xa1bb('0x6'));var config=require(_0xa1bb('0x7'));var jayson=require(_0xa1bb('0x8'));var client=jayson['client'][_0xa1bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc9320b,_0x4e762c,_0x2c00c0){return new BPromise(function(_0x826f5b,_0x38dba3){return client[_0xa1bb('0xa')](_0xc9320b,_0x2c00c0)[_0xa1bb('0xb')](function(_0x4b25bc){logger[_0xa1bb('0xc')](_0xa1bb('0xd'),_0x4e762c,'request\x20sent');logger[_0xa1bb('0xe')](_0xa1bb('0xf'),_0x4e762c,'request\x20sent',JSON[_0xa1bb('0x10')](_0x4b25bc));if(_0x4b25bc[_0xa1bb('0x11')]){if(_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x12')]===0x1f4){logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x4b25bc[_0xa1bb('0x11')]['message']);return _0x38dba3(_0x4b25bc['error'][_0xa1bb('0x13')]);}logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x13')]);return _0x826f5b(_0x4b25bc[_0xa1bb('0x11')][_0xa1bb('0x13')]);}else{logger[_0xa1bb('0xc')](_0xa1bb('0xd'),_0x4e762c,_0xa1bb('0x14'));_0x826f5b(_0x4b25bc['result']['message']);}})[_0xa1bb('0x15')](function(_0x10bd4c){logger[_0xa1bb('0x11')](_0xa1bb('0xd'),_0x4e762c,_0x10bd4c);_0x38dba3(_0x10bd4c);});});} \ No newline at end of file +var _0xe751=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment'];(function(_0x28a388,_0x4de539){var _0x175d8c=function(_0x3cea53){while(--_0x3cea53){_0x28a388['push'](_0x28a388['shift']());}};_0x175d8c(++_0x4de539);}(_0xe751,0x138));var _0x1e75=function(_0x3e906e,_0x2904a3){_0x3e906e=_0x3e906e-0x0;var _0x453d46=_0xe751[_0x3e906e];return _0x453d46;};'use strict';var _=require(_0x1e75('0x0'));var util=require(_0x1e75('0x1'));var moment=require(_0x1e75('0x2'));var BPromise=require(_0x1e75('0x3'));var rs=require(_0x1e75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e75('0x5'))['db'];var utils=require(_0x1e75('0x6'));var logger=require(_0x1e75('0x7'))('rpc');var config=require(_0x1e75('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1e75('0x9')][_0x1e75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5570da,_0x1f87bc,_0x308d8b){return new BPromise(function(_0x59a09f,_0x48eab0){return client[_0x1e75('0xb')](_0x5570da,_0x308d8b)['then'](function(_0x587170){logger[_0x1e75('0xc')](_0x1e75('0xd'),_0x1f87bc,'request\x20sent');logger[_0x1e75('0xe')](_0x1e75('0xf'),_0x1f87bc,_0x1e75('0x10'),JSON[_0x1e75('0x11')](_0x587170));if(_0x587170[_0x1e75('0x12')]){if(_0x587170[_0x1e75('0x12')]['code']===0x1f4){logger[_0x1e75('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x1f87bc,_0x587170[_0x1e75('0x12')]['message']);return _0x48eab0(_0x587170['error'][_0x1e75('0x13')]);}logger[_0x1e75('0x12')](_0x1e75('0xd'),_0x1f87bc,_0x587170['error']['message']);return _0x59a09f(_0x587170[_0x1e75('0x12')]['message']);}else{logger['info'](_0x1e75('0xd'),_0x1f87bc,'request\x20sent');_0x59a09f(_0x587170[_0x1e75('0x14')]['message']);}})['catch'](function(_0x186703){logger[_0x1e75('0x12')](_0x1e75('0xd'),_0x1f87bc,_0x186703);_0x48eab0(_0x186703);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index a85d54a..f3e9e87 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2c1524,_0x311a60){var _0x4ddd51=function(_0x2f7fa5){while(--_0x2f7fa5){_0x2c1524['push'](_0x2c1524['shift']());}};_0x4ddd51(++_0x311a60);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x487466,_0x51f723){var _0x5a04fc=function(_0x67e0d0){while(--_0x67e0d0){_0x487466['push'](_0x487466['shift']());}};_0x5a04fc(++_0x51f723);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0xcb91[_0x47c5bf];return _0x11b779;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b583cee..adb28c8 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 _0x75d9=['sequelize','exports','INTEGER'];(function(_0x3704d5,_0x51d71c){var _0x421308=function(_0x5f394e){while(--_0x5f394e){_0x3704d5['push'](_0x3704d5['shift']());}};_0x421308(++_0x51d71c);}(_0x75d9,0x174));var _0x975d=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x75d9[_0x5959c9];return _0x4ffcbc;};'use strict';var Sequelize=require(_0x975d('0x0'));module[_0x975d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x975d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xada7=['sequelize','exports','INTEGER','STRING'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xada7,0x188));var _0x7ada=function(_0x2f64f3,_0x231ba4){_0x2f64f3=_0x2f64f3-0x0;var _0x28b4e9=_0xada7[_0x2f64f3];return _0x28b4e9;};'use strict';var Sequelize=require(_0x7ada('0x0'));module[_0x7ada('0x1')]={'penalty':{'type':Sequelize[_0x7ada('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7ada('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2cdccd8..1633ae9 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 _0xbd19=['path','rimraf','define','UserFaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b711a,_0x1c2d26){var _0x4d5dd5=function(_0x29f8f1){while(--_0x29f8f1){_0x3b711a['push'](_0x3b711a['shift']());}};_0x4d5dd5(++_0x1c2d26);}(_0xbd19,0x1bc));var _0x9bd1=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xbd19[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var logger=require(_0x9bd1('0x2'))(_0x9bd1('0x3'));var moment=require(_0x9bd1('0x4'));var BPromise=require(_0x9bd1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bd1('0x6'));var rimraf=require(_0x9bd1('0x7'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x186917,_0x1b55c1){return _0x186917[_0x9bd1('0x8')](_0x9bd1('0x9'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b2b=['request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x364edc,_0x20b3c1){var _0x53e6a1=function(_0x3abc79){while(--_0x3abc79){_0x364edc['push'](_0x364edc['shift']());}};_0x53e6a1(++_0x20b3c1);}(_0x7b2b,0xe9));var _0xb7b2=function(_0x27dd6a,_0x37bdc1){_0x27dd6a=_0x27dd6a-0x0;var _0xd86a33=_0x7b2b[_0x27dd6a];return _0xd86a33;};'use strict';var _=require(_0xb7b2('0x0'));var util=require(_0xb7b2('0x1'));var logger=require(_0xb7b2('0x2'))('api');var moment=require(_0xb7b2('0x3'));var BPromise=require(_0xb7b2('0x4'));var rp=require(_0xb7b2('0x5'));var fs=require('fs');var path=require(_0xb7b2('0x6'));var rimraf=require(_0xb7b2('0x7'));var config=require(_0xb7b2('0x8'));var attributes=require(_0xb7b2('0x9'));module[_0xb7b2('0xa')]=function(_0x58bcb0,_0x5c4b53){return _0x58bcb0[_0xb7b2('0xb')](_0xb7b2('0xc'),attributes,{'tableName':_0xb7b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 2fe3d64..ed801cc 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 _0xcdeb=['UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36d6d0,_0xab6a44){var _0x426abc=function(_0x2e65ea){while(--_0x2e65ea){_0x36d6d0['push'](_0x36d6d0['shift']());}};_0x426abc(++_0xab6a44);}(_0xcdeb,0xd9));var _0xbcde=function(_0x5e9976,_0xcd4751){_0x5e9976=_0x5e9976-0x0;var _0x1d3895=_0xcdeb[_0x5e9976];return _0x1d3895;};'use strict';var _=require(_0xbcde('0x0'));var util=require('util');var moment=require(_0xbcde('0x1'));var BPromise=require(_0xbcde('0x2'));var rs=require(_0xbcde('0x3'));var fs=require('fs');var Redis=require(_0xbcde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcde('0x5'));var logger=require(_0xbcde('0x6'))('rpc');var config=require(_0xbcde('0x7'));var jayson=require(_0xbcde('0x8'));var client=jayson[_0xbcde('0x9')][_0xbcde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24cee0,_0x56f945,_0x316663){return new BPromise(function(_0x3f9f3e,_0x2e7587){return client[_0xbcde('0xb')](_0x24cee0,_0x316663)[_0xbcde('0xc')](function(_0x30299e){logger['info'](_0xbcde('0xd'),_0x56f945,'request\x20sent');logger[_0xbcde('0xe')](_0xbcde('0xf'),_0x56f945,_0xbcde('0x10'),JSON[_0xbcde('0x11')](_0x30299e));if(_0x30299e[_0xbcde('0x12')]){if(_0x30299e[_0xbcde('0x12')][_0xbcde('0x13')]===0x1f4){logger[_0xbcde('0x12')](_0xbcde('0xd'),_0x56f945,_0x30299e['error']['message']);return _0x2e7587(_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);}logger[_0xbcde('0x12')](_0xbcde('0xd'),_0x56f945,_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);return _0x3f9f3e(_0x30299e[_0xbcde('0x12')][_0xbcde('0x14')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x56f945,'request\x20sent');_0x3f9f3e(_0x30299e[_0xbcde('0x15')][_0xbcde('0x14')]);}})[_0xbcde('0x16')](function(_0x38a56a){logger['error'](_0xbcde('0xd'),_0x56f945,_0x38a56a);_0x2e7587(_0x38a56a);});});} \ No newline at end of file +var _0xf5df=['error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x480223,_0x23491e){var _0x244f30=function(_0x121a69){while(--_0x121a69){_0x480223['push'](_0x480223['shift']());}};_0x244f30(++_0x23491e);}(_0xf5df,0x180));var _0xff5d=function(_0x545d60,_0xef8187){_0x545d60=_0x545d60-0x0;var _0x382d95=_0xf5df[_0x545d60];return _0x382d95;};'use strict';var _=require('lodash');var util=require(_0xff5d('0x0'));var moment=require('moment');var BPromise=require(_0xff5d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff5d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xff5d('0x3'));var logger=require(_0xff5d('0x4'))(_0xff5d('0x5'));var config=require(_0xff5d('0x6'));var jayson=require(_0xff5d('0x7'));var client=jayson[_0xff5d('0x8')][_0xff5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417751,_0x4934c2,_0x5688a8){return new BPromise(function(_0x4eb365,_0x1f5aa4){return client[_0xff5d('0xa')](_0x417751,_0x5688a8)['then'](function(_0x228aca){logger[_0xff5d('0xb')](_0xff5d('0xc'),_0x4934c2,_0xff5d('0xd'));logger[_0xff5d('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4934c2,_0xff5d('0xd'),JSON[_0xff5d('0xf')](_0x228aca));if(_0x228aca[_0xff5d('0x10')]){if(_0x228aca['error']['code']===0x1f4){logger[_0xff5d('0x10')](_0xff5d('0xc'),_0x4934c2,_0x228aca[_0xff5d('0x10')][_0xff5d('0x11')]);return _0x1f5aa4(_0x228aca['error']['message']);}logger[_0xff5d('0x10')](_0xff5d('0xc'),_0x4934c2,_0x228aca['error'][_0xff5d('0x11')]);return _0x4eb365(_0x228aca[_0xff5d('0x10')][_0xff5d('0x11')]);}else{logger[_0xff5d('0xb')](_0xff5d('0xc'),_0x4934c2,'request\x20sent');_0x4eb365(_0x228aca[_0xff5d('0x12')][_0xff5d('0x11')]);}})[_0xff5d('0x13')](function(_0x1cb4a1){logger[_0xff5d('0x10')](_0xff5d('0xc'),_0x4934c2,_0x1cb4a1);_0x1f5aa4(_0x1cb4a1);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index bd5e657..f5a53a0 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b97d4,_0x461d54){var _0x37b741=function(_0x30ed53){while(--_0x30ed53){_0x2b97d4['push'](_0x2b97d4['shift']());}};_0x37b741(++_0x461d54);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0xe706[_0x2c1101];return _0x56f52f;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x565bfe,_0x5ecfb7){var _0x1e2291=function(_0x214a45){while(--_0x214a45){_0x565bfe['push'](_0x565bfe['shift']());}};_0x1e2291(++_0x5ecfb7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2062e4b..27b8e58 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 _0xa9c4=['INTEGER','sequelize','exports'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa9c4,0x11e));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a9c('0x0'));module[_0x4a9c('0x1')]={'penalty':{'type':Sequelize[_0x4a9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x65e6=['exports','INTEGER','sequelize'];(function(_0x38df27,_0x1265c8){var _0x158db1=function(_0x56e95e){while(--_0x56e95e){_0x38df27['push'](_0x38df27['shift']());}};_0x158db1(++_0x1265c8);}(_0x65e6,0x1eb));var _0x665e=function(_0x503f58,_0x1f88fb){_0x503f58=_0x503f58-0x0;var _0xc30d06=_0x65e6[_0x503f58];return _0xc30d06;};'use strict';var Sequelize=require(_0x665e('0x0'));module[_0x665e('0x1')]={'penalty':{'type':Sequelize[_0x665e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index c2b0e9d..68aec86 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 _0x9512=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x9512,0x73));var _0x2951=function(_0x4d830b,_0x27f78d){_0x4d830b=_0x4d830b-0x0;var _0x238c89=_0x9512[_0x4d830b];return _0x238c89;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var logger=require(_0x2951('0x2'))('api');var moment=require(_0x2951('0x3'));var BPromise=require(_0x2951('0x4'));var rp=require(_0x2951('0x5'));var fs=require('fs');var path=require(_0x2951('0x6'));var rimraf=require(_0x2951('0x7'));var config=require('../../config/environment');var attributes=require(_0x2951('0x8'));module[_0x2951('0x9')]=function(_0x55c3f1,_0x13822e){return _0x55c3f1[_0x2951('0xa')](_0x2951('0xb'),attributes,{'tableName':_0x2951('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1fc=['./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x2139c8,_0x2e22f1){var _0x4e9f84=function(_0x2ee187){while(--_0x2ee187){_0x2139c8['push'](_0x2139c8['shift']());}};_0x4e9f84(++_0x2e22f1);}(_0xa1fc,0x19b));var _0xca1f=function(_0x1ea124,_0x2244b3){_0x1ea124=_0x1ea124-0x0;var _0x480f33=_0xa1fc[_0x1ea124];return _0x480f33;};'use strict';var _=require(_0xca1f('0x0'));var util=require(_0xca1f('0x1'));var logger=require('../../config/logger')(_0xca1f('0x2'));var moment=require(_0xca1f('0x3'));var BPromise=require('bluebird');var rp=require(_0xca1f('0x4'));var fs=require('fs');var path=require(_0xca1f('0x5'));var rimraf=require('rimraf');var config=require(_0xca1f('0x6'));var attributes=require(_0xca1f('0x7'));module[_0xca1f('0x8')]=function(_0x3b66d3,_0x27cc72){return _0x3b66d3[_0xca1f('0x9')](_0xca1f('0xa'),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 ad88223..c8973fb 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 _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3f7eb3,_0x9416d1){var _0x32c913=function(_0x591483){while(--_0x591483){_0x3f7eb3['push'](_0x3f7eb3['shift']());}};_0x32c913(++_0x9416d1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x493bcc,_0x3e9066){_0x493bcc=_0x493bcc-0x0;var _0x51ddd9=_0x7fbe[_0x493bcc];return _0x51ddd9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5f3920,_0x4661c4){_0x5f3920=_0x5f3920-0x0;var _0x50ebcc=_0x1cb9[_0x5f3920];return _0x50ebcc;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 966d574..9e610b2 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 _0xf26a=['sendUserNotification','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xf26a,0x18e));var _0xaf26=function(_0x199c97,_0x2c3300){_0x199c97=_0x199c97-0x0;var _0x2f7742=_0xf26a[_0x199c97];return _0x2f7742;};'use strict';var multer=require('multer');var util=require(_0xaf26('0x0'));var path=require(_0xaf26('0x1'));var timeout=require(_0xaf26('0x2'));var express=require(_0xaf26('0x3'));var router=express['Router']();var fs_extra=require(_0xaf26('0x4'));var auth=require(_0xaf26('0x5'));var interaction=require(_0xaf26('0x6'));var config=require(_0xaf26('0x7'));var controller=require(_0xaf26('0x8'));router[_0xaf26('0x9')]('/',auth['isAuthenticated'](),controller[_0xaf26('0xa')]);module[_0xaf26('0xb')]=router; \ No newline at end of file +var _0xf688=['express','Router','../../config/environment','./userNotification.controller','multer','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf688,0x94));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8f68('0x0'));var util=require(_0x8f68('0x1'));var path=require(_0x8f68('0x2'));var timeout=require(_0x8f68('0x3'));var express=require(_0x8f68('0x4'));var router=express[_0x8f68('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f68('0x6'));var controller=require(_0x8f68('0x7'));router['post']('/',auth['isAuthenticated'](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 0816d96..ce73679 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 _0xcd68=['sequelize','STRING','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd68,0xb8));var _0x8cd6=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xcd68[_0x2a0183];return _0x158c3a;};'use strict';var Sequelize=require(_0x8cd6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x8cd6('0x1')]},'recipientsId':{'type':Sequelize[_0x8cd6('0x2')]},'recipientsDescription':{'type':Sequelize[_0x8cd6('0x1')]},'beep':{'type':Sequelize[_0x8cd6('0x3')]}}; \ No newline at end of file +var _0xb101=['TEXT','STRING','sequelize','exports'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0xb101,0x8e));var _0x1b10=function(_0x50628b,_0x5c7bfd){_0x50628b=_0x50628b-0x0;var _0x3cc9eb=_0xb101[_0x50628b];return _0x3cc9eb;};'use strict';var Sequelize=require(_0x1b10('0x0'));module[_0x1b10('0x1')]={'body':{'type':Sequelize[_0x1b10('0x2')]},'senderName':{'type':Sequelize[_0x1b10('0x3')]},'recipientsId':{'type':Sequelize[_0x1b10('0x2')]},'recipientsDescription':{'type':Sequelize[_0x1b10('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8408d30..8d61ea5 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 _0x72a4=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','chatqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','includes','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset'];(function(_0x47f9b7,_0x647c98){var _0xd519cd=function(_0x3a08f0){while(--_0x3a08f0){_0x47f9b7['push'](_0x47f9b7['shift']());}};_0xd519cd(++_0x647c98);}(_0x72a4,0xb1));var _0x472a=function(_0xf8aecd,_0x4631e1){_0xf8aecd=_0xf8aecd-0x0;var _0x41b3a1=_0x72a4[_0xf8aecd];return _0x41b3a1;};'use strict';var emlformat=require(_0x472a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x472a('0x1'));var rp=require('request-promise');var moment=require(_0x472a('0x2'));var BPromise=require(_0x472a('0x3'));var Mustache=require(_0x472a('0x4'));var util=require(_0x472a('0x5'));var path=require(_0x472a('0x6'));var sox=require(_0x472a('0x7'));var csv=require(_0x472a('0x8'));var ejs=require(_0x472a('0x9'));var fs=require('fs');var fs_extra=require(_0x472a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x472a('0xb'));var jsforce=require(_0x472a('0xc'));var deskjs=require(_0x472a('0xd'));var toCsv=require(_0x472a('0x8'));var querystring=require(_0x472a('0xe'));var Papa=require(_0x472a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x472a('0x10'));var as=require(_0x472a('0x11'));var hardwareService=require(_0x472a('0x12'));var logger=require(_0x472a('0x13'))(_0x472a('0x14'));var utils=require(_0x472a('0x15'));var config=require(_0x472a('0x16'));var licenseUtil=require(_0x472a('0x17'));var db=require(_0x472a('0x18'))['db'];config['redis']=_[_0x472a('0x19')](config[_0x472a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x472a('0x1b'))(new Redis(config[_0x472a('0x1a')]));require(_0x472a('0x1c'))[_0x472a('0x1d')](socket);function respondWithStatusCode(_0x3328f3,_0x2dbce9){_0x2dbce9=_0x2dbce9||0xcc;return function(_0x2cb573){if(_0x2cb573){return _0x3328f3[_0x472a('0x1e')](_0x2dbce9);}return _0x3328f3[_0x472a('0x1f')](_0x2dbce9)[_0x472a('0x20')]();};}function respondWithResult(_0x3903d1,_0x3b9050){_0x3b9050=_0x3b9050||0xc8;return function(_0x3b4a6b){if(_0x3b4a6b){return _0x3903d1[_0x472a('0x1f')](_0x3b9050)[_0x472a('0x21')](_0x3b4a6b);}};}function respondWithFilteredResult(_0x1142ae,_0x2cb995){return function(_0x3ac62c){if(_0x3ac62c){var _0x10ad9b=typeof _0x2cb995[_0x472a('0x22')]===_0x472a('0x23')&&typeof _0x2cb995[_0x472a('0x24')]==='undefined';var _0x54a53b=_0x3ac62c[_0x472a('0x25')];var _0x587d0c=_0x10ad9b?0x0:_0x2cb995[_0x472a('0x22')];var _0x5bffcc=_0x10ad9b?_0x3ac62c['count']:_0x2cb995['offset']+_0x2cb995[_0x472a('0x24')];var _0x55a5e0;if(_0x5bffcc>=_0x54a53b){_0x5bffcc=_0x54a53b;_0x55a5e0=0xc8;}else{_0x55a5e0=0xce;}_0x1142ae[_0x472a('0x1f')](_0x55a5e0);return _0x1142ae[_0x472a('0x26')](_0x472a('0x27'),_0x587d0c+'-'+_0x5bffcc+'/'+_0x54a53b)[_0x472a('0x21')](_0x3ac62c);}return null;};}function patchUpdates(_0x41d23e){return function(_0x1c064e){try{jsonpatch[_0x472a('0x28')](_0x1c064e,_0x41d23e,!![]);}catch(_0xaa3a1){return BPromise[_0x472a('0x29')](_0xaa3a1);}return _0x1c064e[_0x472a('0x2a')]();};}function saveUpdates(_0x5855c0,_0x3b5257){return function(_0x5a4269){if(_0x5a4269){return _0x5a4269[_0x472a('0x2b')](_0x5855c0)[_0x472a('0x2c')](function(_0x2ccc9c){return _0x2ccc9c;});}return null;};}function removeEntity(_0x2d6943,_0x387fad){return function(_0x49ac6a){if(_0x49ac6a){return _0x49ac6a[_0x472a('0x2d')]()[_0x472a('0x2c')](function(){_0x2d6943['status'](0xcc)[_0x472a('0x20')]();});}};}function handleEntityNotFound(_0x525a1a,_0x11a613){return function(_0x4c7cef){if(!_0x4c7cef){_0x525a1a[_0x472a('0x1e')](0x194);}return _0x4c7cef;};}function handleError(_0x3b1bd6,_0x5a8703){_0x5a8703=_0x5a8703||0x1f4;return function(_0x2796c9){logger['error'](_0x2796c9['stack']);if(_0x2796c9[_0x472a('0x2e')]){delete _0x2796c9[_0x472a('0x2e')];}_0x3b1bd6[_0x472a('0x1f')](_0x5a8703)[_0x472a('0x2f')](_0x2796c9);};}exports[_0x472a('0x30')]=function(_0x264569,_0x54fb28,_0x1f3fd9){if(!_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x33'))&&!_0x264569[_0x472a('0x31')][_0x472a('0x32')]('TemplateId')){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x36'));}else{if(_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x37'))&&!_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x38'))){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x39'));}if(!_0x264569['body'][_0x472a('0x32')]('recipients')){throw new db['Sequelize'][(_0x472a('0x35'))](_0x472a('0x3a'));}else{try{var _0x3d888e=JSON[_0x472a('0x3b')](_0x264569['body'][_0x472a('0x3c')]);}catch(_0x2dfd3a){logger[_0x472a('0x3d')](_0x2dfd3a);throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x407434=[_0x472a('0x3e'),'faxqueue','mailqueue',_0x472a('0x3f'),_0x472a('0x40'),'voicequeue',_0x472a('0x41'),'team',_0x472a('0x42')];if(_[_0x472a('0x43')](_0x3d888e,function(_0x3f666e){return!_['includes'](_0x407434,_0x3f666e[_0x472a('0x44')][_0x472a('0x45')]());})){throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x46'));}}}var _0x166bce={};_0x166bce[_0x472a('0x47')]=_0x264569[_0x472a('0x31')][_0x472a('0x32')](_0x472a('0x47'))?_0x264569['body'][_0x472a('0x47')]:_0x264569[_0x472a('0x42')][_0x472a('0x48')];_0x166bce[_0x472a('0x49')]=_[_0x472a('0x4a')](_0x264569['body'][_0x472a('0x49')])?null:_0x264569['body']['recipientsDescription'];_0x166bce['beep']=_0x264569[_0x472a('0x31')][_0x472a('0x4b')]||![];_0x166bce['SenderId']=_0x264569[_0x472a('0x42')]['id'];return getContent(_0x264569[_0x472a('0x31')])[_0x472a('0x2c')](function(_0x474b96){_0x166bce[_0x472a('0x31')]=_0x474b96;return getRecipients(_0x3d888e);})[_0x472a('0x2c')](function(_0x4ee5f9){_0x166bce[_0x472a('0x4c')]=_[_0x472a('0x4d')](_0x4ee5f9)[_0x472a('0x4e')](',');return db[_0x472a('0x4f')][_0x472a('0x50')](function(_0x236fb7){return db[_0x472a('0x51')][_0x472a('0x52')](_0x166bce,{'raw':!![],'transaction':_0x236fb7})[_0x472a('0x2c')](function(_0x3d3b54){var _0xda7327={'sender':_0x166bce[_0x472a('0x47')],'description':_0x166bce[_0x472a('0x49')],'content':_0x166bce[_0x472a('0x31')],'beep':_0x166bce['beep']};_0x4ee5f9[_0x472a('0x53')](function(_0x35c631){_0xda7327[_0x472a('0x54')]=_0x35c631;socket[_0x472a('0x55')](_0x472a('0x56'),_0xda7327);});return _0x3d3b54;});});})[_0x472a('0x2c')](respondWithResult(_0x54fb28,0xc9))['catch'](handleError(_0x54fb28,null));};function getContent(_0x5c5c09){return new BPromise(function(_0x25e6aa,_0x45e8c4){if(_0x5c5c09['text']){_0x25e6aa(_0x5c5c09[_0x472a('0x33')]);return;}return db[_0x472a('0x57')][_0x472a('0x58')]({'attributes':[_0x472a('0x59')],'where':{'id':_0x5c5c09[_0x472a('0x37')]},'raw':!![]})[_0x472a('0x2c')](function(_0x18216d){if(!_0x18216d)throw new db[(_0x472a('0x34'))][(_0x472a('0x35'))](_0x472a('0x5a'));var _0x383e7b=Mustache[_0x472a('0x5b')](_0x18216d['html'],_0x5c5c09[_0x472a('0x38')]);_0x25e6aa(_0x383e7b);})[_0x472a('0x5c')](function(_0x3773fc){_0x45e8c4(_0x3773fc);});});}function getRecipients(_0x5513eb){return new BPromise(function(_0x28029a,_0x43e2f7){var _0x4be71b=[];var _0x17a451=[];_0x5513eb[_0x472a('0x53')](function(_0x114d14){var _0x893f45=_[_0x472a('0x5d')](_0x114d14[_0x472a('0x44')][_0x472a('0x45')]());if(_0x893f45===_0x472a('0x5e')){_0x4be71b=_[_0x472a('0x5f')](_0x4be71b,_0x114d14[_0x472a('0x60')]);}else{if(_[_0x472a('0x61')](_0x893f45,_0x472a('0x62')))_0x893f45=_0x893f45[_0x472a('0x63')](_0x472a('0x62'),_0x472a('0x64'));_0x114d14[_0x472a('0x60')][_0x472a('0x53')](function(_0x303158){_0x17a451[_0x472a('0x65')](getAgents(_0x893f45,_0x303158));});}});return BPromise[_0x472a('0x66')](_0x17a451)[_0x472a('0x2c')](function(_0x2d3468){_0x4be71b=_['union'](_0x4be71b,_[_0x472a('0x67')](_0x2d3468));_0x28029a(_0x4be71b);})['catch'](function(_0x749bb3){_0x43e2f7(_0x749bb3);});});}function getAgents(_0x31b9c9,_0x489d40){return new BPromise(function(_0x4d71df,_0x587ae5){return db[_0x31b9c9][_0x472a('0x58')]({'where':{'id':_0x489d40}})[_0x472a('0x2c')](function(_0x6d1f9e){return _0x6d1f9e[_0x472a('0x68')]({'attributes':['id'],'raw':!![]})[_0x472a('0x2c')](function(_0x2f607e){var _0x187752=_[_0x472a('0x69')](_0x2f607e,'id');_0x4d71df(_0x187752);});})[_0x472a('0x5c')](function(_0x41f4dd){_0x587ae5(_0x41f4dd);});});} \ No newline at end of file +var _0x8a5a=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','sendStatus','stack','send','sendUserNotification','body','TemplateId','Sequelize','hasOwnProperty','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','beep','forEach','recipient','userNotification:send','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','toLowerCase','User','ids','includes','queue','replace','Queue','push','union','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x3eaa55,_0x323216){var _0x200085=function(_0x3c5fc0){while(--_0x3c5fc0){_0x3eaa55['push'](_0x3eaa55['shift']());}};_0x200085(++_0x323216);}(_0x8a5a,0xca));var _0xa8a5=function(_0x4ee28e,_0xfa0570){_0x4ee28e=_0x4ee28e-0x0;var _0x3d1e31=_0x8a5a[_0x4ee28e];return _0x3d1e31;};'use strict';var emlformat=require(_0xa8a5('0x0'));var rimraf=require(_0xa8a5('0x1'));var zipdir=require(_0xa8a5('0x2'));var jsonpatch=require(_0xa8a5('0x3'));var rp=require(_0xa8a5('0x4'));var moment=require(_0xa8a5('0x5'));var BPromise=require(_0xa8a5('0x6'));var Mustache=require(_0xa8a5('0x7'));var util=require(_0xa8a5('0x8'));var path=require('path');var sox=require(_0xa8a5('0x9'));var csv=require(_0xa8a5('0xa'));var ejs=require(_0xa8a5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8a5('0xc'));var squel=require('squel');var crypto=require(_0xa8a5('0xd'));var jsforce=require(_0xa8a5('0xe'));var deskjs=require(_0xa8a5('0xf'));var toCsv=require(_0xa8a5('0xa'));var querystring=require(_0xa8a5('0x10'));var Papa=require(_0xa8a5('0x11'));var Redis=require(_0xa8a5('0x12'));var authService=require(_0xa8a5('0x13'));var qs=require(_0xa8a5('0x14'));var as=require(_0xa8a5('0x15'));var hardwareService=require(_0xa8a5('0x16'));var logger=require(_0xa8a5('0x17'))(_0xa8a5('0x18'));var utils=require(_0xa8a5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa8a5('0x1a'))['db'];config[_0xa8a5('0x1b')]=_[_0xa8a5('0x1c')](config[_0xa8a5('0x1b')],{'host':_0xa8a5('0x1d'),'port':0x18eb});var socket=require(_0xa8a5('0x1e'))(new Redis(config['redis']));require(_0xa8a5('0x1f'))[_0xa8a5('0x20')](socket);function respondWithStatusCode(_0x246ce2,_0x110a9e){_0x110a9e=_0x110a9e||0xcc;return function(_0xfd4713){if(_0xfd4713){return _0x246ce2['sendStatus'](_0x110a9e);}return _0x246ce2[_0xa8a5('0x21')](_0x110a9e)[_0xa8a5('0x22')]();};}function respondWithResult(_0x147fcd,_0x2038dd){_0x2038dd=_0x2038dd||0xc8;return function(_0x57962c){if(_0x57962c){return _0x147fcd[_0xa8a5('0x21')](_0x2038dd)[_0xa8a5('0x23')](_0x57962c);}};}function respondWithFilteredResult(_0x3074ff,_0x1b5a91){return function(_0x28069f){if(_0x28069f){var _0x26863f=typeof _0x1b5a91[_0xa8a5('0x24')]===_0xa8a5('0x25')&&typeof _0x1b5a91['limit']===_0xa8a5('0x25');var _0x50bd1a=_0x28069f['count'];var _0x283be9=_0x26863f?0x0:_0x1b5a91[_0xa8a5('0x24')];var _0x222a43=_0x26863f?_0x28069f[_0xa8a5('0x26')]:_0x1b5a91[_0xa8a5('0x24')]+_0x1b5a91[_0xa8a5('0x27')];var _0x1e4913;if(_0x222a43>=_0x50bd1a){_0x222a43=_0x50bd1a;_0x1e4913=0xc8;}else{_0x1e4913=0xce;}_0x3074ff[_0xa8a5('0x21')](_0x1e4913);return _0x3074ff[_0xa8a5('0x28')](_0xa8a5('0x29'),_0x283be9+'-'+_0x222a43+'/'+_0x50bd1a)['json'](_0x28069f);}return null;};}function patchUpdates(_0x65c1ea){return function(_0x5ef31a){try{jsonpatch['apply'](_0x5ef31a,_0x65c1ea,!![]);}catch(_0x392d8e){return BPromise['reject'](_0x392d8e);}return _0x5ef31a[_0xa8a5('0x2a')]();};}function saveUpdates(_0x5a5713,_0x4f8be1){return function(_0xb06c5e){if(_0xb06c5e){return _0xb06c5e[_0xa8a5('0x2b')](_0x5a5713)['then'](function(_0x427cc3){return _0x427cc3;});}return null;};}function removeEntity(_0x4710c8,_0x49e20c){return function(_0x5a5772){if(_0x5a5772){return _0x5a5772['destroy']()[_0xa8a5('0x2c')](function(){_0x4710c8[_0xa8a5('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x348f55,_0xd770d){return function(_0x526d2d){if(!_0x526d2d){_0x348f55[_0xa8a5('0x2d')](0x194);}return _0x526d2d;};}function handleError(_0xcc4cb3,_0x25b802){_0x25b802=_0x25b802||0x1f4;return function(_0x24649a){logger['error'](_0x24649a[_0xa8a5('0x2e')]);if(_0x24649a['name']){delete _0x24649a['name'];}_0xcc4cb3[_0xa8a5('0x21')](_0x25b802)[_0xa8a5('0x2f')](_0x24649a);};}exports[_0xa8a5('0x30')]=function(_0x40032b,_0x2c69fc,_0x5c9421){if(!_0x40032b[_0xa8a5('0x31')]['hasOwnProperty']('text')&&!_0x40032b[_0xa8a5('0x31')]['hasOwnProperty'](_0xa8a5('0x32'))){throw new db[(_0xa8a5('0x33'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x40032b['body'][_0xa8a5('0x34')](_0xa8a5('0x32'))&&!_0x40032b[_0xa8a5('0x31')][_0xa8a5('0x34')](_0xa8a5('0x35'))){throw new db[(_0xa8a5('0x33'))][(_0xa8a5('0x36'))](_0xa8a5('0x37'));}if(!_0x40032b[_0xa8a5('0x31')]['hasOwnProperty'](_0xa8a5('0x38'))){throw new db[(_0xa8a5('0x33'))]['ValidationError'](_0xa8a5('0x39'));}else{try{var _0x1b8974=JSON[_0xa8a5('0x3a')](_0x40032b[_0xa8a5('0x31')][_0xa8a5('0x38')]);}catch(_0x2cb18a){logger[_0xa8a5('0x3b')](_0x2cb18a);throw new db[(_0xa8a5('0x33'))][(_0xa8a5('0x36'))](_0xa8a5('0x3c'));}var _0x3c7e00=[_0xa8a5('0x3d'),_0xa8a5('0x3e'),_0xa8a5('0x3f'),_0xa8a5('0x40'),_0xa8a5('0x41'),_0xa8a5('0x42'),_0xa8a5('0x43'),_0xa8a5('0x44'),_0xa8a5('0x45')];if(_[_0xa8a5('0x46')](_0x1b8974,function(_0x5638ad){return!_['includes'](_0x3c7e00,_0x5638ad[_0xa8a5('0x47')]['toLowerCase']());})){throw new db[(_0xa8a5('0x33'))]['ValidationError'](_0xa8a5('0x48'));}}}var _0x3afda2={};_0x3afda2[_0xa8a5('0x49')]=_0x40032b['body'][_0xa8a5('0x34')]('senderName')?_0x40032b['body'][_0xa8a5('0x49')]:_0x40032b[_0xa8a5('0x45')][_0xa8a5('0x4a')];_0x3afda2[_0xa8a5('0x4b')]=_[_0xa8a5('0x4c')](_0x40032b['body'][_0xa8a5('0x4b')])?null:_0x40032b[_0xa8a5('0x31')][_0xa8a5('0x4b')];_0x3afda2['beep']=_0x40032b[_0xa8a5('0x31')]['beep']||![];_0x3afda2[_0xa8a5('0x4d')]=_0x40032b[_0xa8a5('0x45')]['id'];return getContent(_0x40032b[_0xa8a5('0x31')])[_0xa8a5('0x2c')](function(_0x4735f6){_0x3afda2[_0xa8a5('0x31')]=_0x4735f6;return getRecipients(_0x1b8974);})[_0xa8a5('0x2c')](function(_0x3b4adf){_0x3afda2[_0xa8a5('0x4e')]=_[_0xa8a5('0x4f')](_0x3b4adf)[_0xa8a5('0x50')](',');return db[_0xa8a5('0x51')]['transaction'](function(_0x2d2270){return db[_0xa8a5('0x52')][_0xa8a5('0x53')](_0x3afda2,{'raw':!![],'transaction':_0x2d2270})[_0xa8a5('0x2c')](function(_0x373d19){var _0x47024a={'sender':_0x3afda2['senderName'],'description':_0x3afda2[_0xa8a5('0x4b')],'content':_0x3afda2[_0xa8a5('0x31')],'beep':_0x3afda2[_0xa8a5('0x54')]};_0x3b4adf[_0xa8a5('0x55')](function(_0x1c070f){_0x47024a[_0xa8a5('0x56')]=_0x1c070f;socket['emit'](_0xa8a5('0x57'),_0x47024a);});return _0x373d19;});});})[_0xa8a5('0x2c')](respondWithResult(_0x2c69fc,0xc9))['catch'](handleError(_0x2c69fc,null));};function getContent(_0x11c392){return new BPromise(function(_0x20a6b4,_0x5695fb){if(_0x11c392[_0xa8a5('0x58')]){_0x20a6b4(_0x11c392[_0xa8a5('0x58')]);return;}return db['Template'][_0xa8a5('0x59')]({'attributes':[_0xa8a5('0x5a')],'where':{'id':_0x11c392['TemplateId']},'raw':!![]})[_0xa8a5('0x2c')](function(_0x5c7f8b){if(!_0x5c7f8b)throw new db[(_0xa8a5('0x33'))][(_0xa8a5('0x36'))](_0xa8a5('0x5b'));var _0x385738=Mustache[_0xa8a5('0x5c')](_0x5c7f8b[_0xa8a5('0x5a')],_0x11c392[_0xa8a5('0x35')]);_0x20a6b4(_0x385738);})[_0xa8a5('0x5d')](function(_0xe41996){_0x5695fb(_0xe41996);});});}function getRecipients(_0xe42352){return new BPromise(function(_0x16267d,_0x241b50){var _0x4ada71=[];var _0x4549a2=[];_0xe42352[_0xa8a5('0x55')](function(_0x4ca985){var _0x347d8a=_[_0xa8a5('0x5e')](_0x4ca985['model'][_0xa8a5('0x5f')]());if(_0x347d8a===_0xa8a5('0x60')){_0x4ada71=_['union'](_0x4ada71,_0x4ca985[_0xa8a5('0x61')]);}else{if(_[_0xa8a5('0x62')](_0x347d8a,_0xa8a5('0x63')))_0x347d8a=_0x347d8a[_0xa8a5('0x64')](_0xa8a5('0x63'),_0xa8a5('0x65'));_0x4ca985[_0xa8a5('0x61')]['forEach'](function(_0x1f0d4b){_0x4549a2[_0xa8a5('0x66')](getAgents(_0x347d8a,_0x1f0d4b));});}});return BPromise['all'](_0x4549a2)[_0xa8a5('0x2c')](function(_0x3faa92){_0x4ada71=_[_0xa8a5('0x67')](_0x4ada71,_[_0xa8a5('0x68')](_0x3faa92));_0x16267d(_0x4ada71);})[_0xa8a5('0x5d')](function(_0x4428d5){_0x241b50(_0x4428d5);});});}function getAgents(_0xe5f6fe,_0x58b56c){return new BPromise(function(_0x5852e3,_0xe8db29){return db[_0xe5f6fe][_0xa8a5('0x59')]({'where':{'id':_0x58b56c}})[_0xa8a5('0x2c')](function(_0x2ef6a7){return _0x2ef6a7[_0xa8a5('0x69')]({'attributes':['id'],'raw':!![]})['then'](function(_0x91bac3){var _0x1090f1=_['map'](_0x91bac3,'id');_0x5852e3(_0x1090f1);});})[_0xa8a5('0x5d')](function(_0x38a632){_0xe8db29(_0x38a632);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index a783833..37f16be 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 _0x4a3a=['events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5af8c2,_0x2aa6d8){var _0x2f2cc4=function(_0x2bc4db){while(--_0x2bc4db){_0x5af8c2['push'](_0x5af8c2['shift']());}};_0x2f2cc4(++_0x2aa6d8);}(_0x4a3a,0xb4));var _0xa4a3=function(_0x1a15a4,_0x13ed3b){_0x1a15a4=_0x1a15a4-0x0;var _0x214d03=_0x4a3a[_0x1a15a4];return _0x214d03;};'use strict';var EventEmitter=require(_0xa4a3('0x0'));var UserNotification=require(_0xa4a3('0x1'))['db'][_0xa4a3('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa4a3('0x3')](0x0);var events={'afterCreate':_0xa4a3('0x4'),'afterUpdate':'update','afterDestroy':_0xa4a3('0x5')};function emitEvent(_0x31e327){return function(_0xad4d06,_0x58b8c1,_0x59cd19){UserNotificationEvents[_0xa4a3('0x6')](_0x31e327+':'+_0xad4d06['id'],_0xad4d06);UserNotificationEvents[_0xa4a3('0x6')](_0x31e327,_0xad4d06);_0x59cd19(null);};}for(var e in events){if(events[_0xa4a3('0x7')](e)){var event=events[e];UserNotification[_0xa4a3('0x8')](e,emitEvent(event));}}module[_0xa4a3('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x66ae=['events','UserNotification','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66ae,0xd8));var _0xe66a=function(_0x26b086,_0x4a1b54){_0x26b086=_0x26b086-0x0;var _0x210b99=_0x66ae[_0x26b086];return _0x210b99;};'use strict';var EventEmitter=require(_0xe66a('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xe66a('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe66a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe66a('0x3'),'afterDestroy':_0xe66a('0x4')};function emitEvent(_0x52ab14){return function(_0x10ead2,_0x488b86,_0xb61f16){UserNotificationEvents[_0xe66a('0x5')](_0x52ab14+':'+_0x10ead2['id'],_0x10ead2);UserNotificationEvents[_0xe66a('0x5')](_0x52ab14,_0x10ead2);_0xb61f16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xe66a('0x6')](e,emitEvent(event));}}module[_0xe66a('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0ddabc8..924bec4 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 _0x8a56=['api','moment','request-promise','path','rimraf','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x316c50,_0x3811f1){var _0x150e8b=function(_0x4fbdcf){while(--_0x4fbdcf){_0x316c50['push'](_0x316c50['shift']());}};_0x150e8b(++_0x3811f1);}(_0x8a56,0x131));var _0x68a5=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x8a56[_0x5cc51f];return _0x315a2f;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var logger=require(_0x68a5('0x2'))(_0x68a5('0x3'));var moment=require(_0x68a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x68a5('0x5'));var fs=require('fs');var path=require(_0x68a5('0x6'));var rimraf=require(_0x68a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x68a5('0x8'));module[_0x68a5('0x9')]=function(_0x3010a7,_0x254eaa){return _0x3010a7['define'](_0x68a5('0xa'),attributes,{'tableName':_0x68a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68a5('0xc'),'collate':_0x68a5('0xd')});}; \ No newline at end of file +var _0x094d=['path','rimraf','exports','define','UserNotification','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x094d,0x102));var _0xd094=function(_0x5c6783,_0x515ec3){_0x5c6783=_0x5c6783-0x0;var _0xdc9f88=_0x094d[_0x5c6783];return _0xdc9f88;};'use strict';var _=require(_0xd094('0x0'));var util=require(_0xd094('0x1'));var logger=require(_0xd094('0x2'))(_0xd094('0x3'));var moment=require(_0xd094('0x4'));var BPromise=require('bluebird');var rp=require(_0xd094('0x5'));var fs=require('fs');var path=require(_0xd094('0x6'));var rimraf=require(_0xd094('0x7'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0xd094('0x8')]=function(_0x2489f3,_0x1e8b7c){return _0x2489f3[_0xd094('0x9')](_0xd094('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd094('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b37ea99..a88c0c1 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 _0x9921=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1e69e9,_0x5c47ba){var _0x4d4a14=function(_0x5ae945){while(--_0x5ae945){_0x1e69e9['push'](_0x1e69e9['shift']());}};_0x4d4a14(++_0x5c47ba);}(_0x9921,0x190));var _0x1992=function(_0x4f3e3f,_0x5126b6){_0x4f3e3f=_0x4f3e3f-0x0;var _0x597218=_0x9921[_0x4f3e3f];return _0x597218;};'use strict';var _=require('lodash');var util=require(_0x1992('0x0'));var moment=require(_0x1992('0x1'));var BPromise=require(_0x1992('0x2'));var rs=require(_0x1992('0x3'));var fs=require('fs');var Redis=require(_0x1992('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1992('0x5'))('rpc');var config=require(_0x1992('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1992('0x7')][_0x1992('0x8')]({'port':0x232a});config[_0x1992('0x9')]=_[_0x1992('0xa')](config['redis'],{'host':_0x1992('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1992('0x9')]));require(_0x1992('0xc'))[_0x1992('0xd')](socket);function respondWithRpcPromise(_0x44f30d,_0xd337a5,_0x28579e){return new BPromise(function(_0x3ab322,_0xfcfb2f){return client[_0x1992('0xe')](_0x44f30d,_0x28579e)[_0x1992('0xf')](function(_0x107071){logger['info'](_0x1992('0x10'),_0xd337a5,_0x1992('0x11'));logger[_0x1992('0x12')](_0x1992('0x13'),_0xd337a5,_0x1992('0x11'),JSON[_0x1992('0x14')](_0x107071));if(_0x107071[_0x1992('0x15')]){if(_0x107071[_0x1992('0x15')][_0x1992('0x16')]===0x1f4){logger['error'](_0x1992('0x10'),_0xd337a5,_0x107071[_0x1992('0x15')][_0x1992('0x17')]);return _0xfcfb2f(_0x107071['error']['message']);}logger[_0x1992('0x15')]('UserNotification,\x20%s,\x20%s',_0xd337a5,_0x107071[_0x1992('0x15')][_0x1992('0x17')]);return _0x3ab322(_0x107071['error'][_0x1992('0x17')]);}else{logger[_0x1992('0x18')](_0x1992('0x10'),_0xd337a5,_0x1992('0x11'));_0x3ab322(_0x107071[_0x1992('0x19')][_0x1992('0x17')]);}})[_0x1992('0x1a')](function(_0x34c76b){logger['error'](_0x1992('0x10'),_0xd337a5,_0x34c76b);_0xfcfb2f(_0x34c76b);});});} \ No newline at end of file +var _0x416d=['http','redis','defaults','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x7a986e,_0x1941d6){var _0x45c33c=function(_0x1a941c){while(--_0x1a941c){_0x7a986e['push'](_0x7a986e['shift']());}};_0x45c33c(++_0x1941d6);}(_0x416d,0x18b));var _0xd416=function(_0x562f0a,_0x1593f5){_0x562f0a=_0x562f0a-0x0;var _0x1b2cba=_0x416d[_0x562f0a];return _0x1b2cba;};'use strict';var _=require('lodash');var util=require(_0xd416('0x0'));var moment=require(_0xd416('0x1'));var BPromise=require(_0xd416('0x2'));var rs=require(_0xd416('0x3'));var fs=require('fs');var Redis=require(_0xd416('0x4'));var db=require(_0xd416('0x5'))['db'];var utils=require(_0xd416('0x6'));var logger=require(_0xd416('0x7'))(_0xd416('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd416('0x9')][_0xd416('0xa')]({'port':0x232a});config[_0xd416('0xb')]=_[_0xd416('0xc')](config[_0xd416('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd416('0xb')]));require(_0xd416('0xd'))[_0xd416('0xe')](socket);function respondWithRpcPromise(_0x43b128,_0x1a584a,_0xef36b4){return new BPromise(function(_0x1c3f97,_0x436daa){return client[_0xd416('0xf')](_0x43b128,_0xef36b4)[_0xd416('0x10')](function(_0x2a3865){logger[_0xd416('0x11')](_0xd416('0x12'),_0x1a584a,'request\x20sent');logger['debug'](_0xd416('0x13'),_0x1a584a,_0xd416('0x14'),JSON[_0xd416('0x15')](_0x2a3865));if(_0x2a3865[_0xd416('0x16')]){if(_0x2a3865[_0xd416('0x16')][_0xd416('0x17')]===0x1f4){logger[_0xd416('0x16')]('UserNotification,\x20%s,\x20%s',_0x1a584a,_0x2a3865[_0xd416('0x16')][_0xd416('0x18')]);return _0x436daa(_0x2a3865[_0xd416('0x16')][_0xd416('0x18')]);}logger['error'](_0xd416('0x12'),_0x1a584a,_0x2a3865[_0xd416('0x16')][_0xd416('0x18')]);return _0x1c3f97(_0x2a3865[_0xd416('0x16')][_0xd416('0x18')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x1a584a,_0xd416('0x14'));_0x1c3f97(_0x2a3865[_0xd416('0x19')]['message']);}})[_0xd416('0x1a')](function(_0x392806){logger[_0xd416('0x16')](_0xd416('0x12'),_0x1a584a,_0x392806);_0x436daa(_0x392806);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index f7af635..36ca1a9 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 _0x2bb1=['remove','update','emit','register','length','userNotification:','./userNotification.events','save'];(function(_0x2a2e95,_0x5c626e){var _0x54e62e=function(_0x4b1ace){while(--_0x4b1ace){_0x2a2e95['push'](_0x2a2e95['shift']());}};_0x54e62e(++_0x5c626e);}(_0x2bb1,0x1a6));var _0x12bb=function(_0x2cf565,_0x267a66){_0x2cf565=_0x2cf565-0x0;var _0x42a3fe=_0x2bb1[_0x2cf565];return _0x42a3fe;};'use strict';var UserNotificationEvents=require(_0x12bb('0x0'));var events=[_0x12bb('0x1'),_0x12bb('0x2'),_0x12bb('0x3')];function createListener(_0x3c273f,_0x2648a7){return function(_0x3dcb6b){_0x2648a7[_0x12bb('0x4')](_0x3c273f,_0x3dcb6b);};}function removeListener(_0x10cbea,_0x5ac7bf){return function(){UserNotificationEvents['removeListener'](_0x10cbea,_0x5ac7bf);};}exports[_0x12bb('0x5')]=function(_0x285111){for(var _0x4d066d=0x0,_0x33b877=events[_0x12bb('0x6')];_0x4d066d<_0x33b877;_0x4d066d++){var _0x4f3a40=events[_0x4d066d];var _0xe5a0d9=createListener(_0x12bb('0x7')+_0x4f3a40,_0x285111);UserNotificationEvents['on'](_0x4f3a40,_0xe5a0d9);}}; \ No newline at end of file +var _0x1ed3=['save','remove','update','emit','length','userNotification:'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x1ed3,0x198));var _0x31ed=function(_0x36be38,_0x50b484){_0x36be38=_0x36be38-0x0;var _0x10a629=_0x1ed3[_0x36be38];return _0x10a629;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x31ed('0x0'),_0x31ed('0x1'),_0x31ed('0x2')];function createListener(_0x265aeb,_0x4dc0ca){return function(_0x23cbf5){_0x4dc0ca[_0x31ed('0x3')](_0x265aeb,_0x23cbf5);};}function removeListener(_0x5c4580,_0x5a9711){return function(){UserNotificationEvents['removeListener'](_0x5c4580,_0x5a9711);};}exports['register']=function(_0x8df4f0){for(var _0x5d0b11=0x0,_0x317af5=events[_0x31ed('0x4')];_0x5d0b11<_0x317af5;_0x5d0b11++){var _0x1db18f=events[_0x5d0b11];var _0x1f335e=createListener(_0x31ed('0x5')+_0x1db18f,_0x8df4f0);UserNotificationEvents['on'](_0x1db18f,_0x1f335e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 7145e6a..74e9dbe 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x22e794,_0x4bab6e){var _0x1b1954=function(_0x428931){while(--_0x428931){_0x22e794['push'](_0x22e794['shift']());}};_0x1b1954(++_0x4bab6e);}(_0xedd9,0xfc));var _0x9edd=function(_0x179550,_0x1cee4c){_0x179550=_0x179550-0x0;var _0x4165bc=_0xedd9[_0x179550];return _0x4165bc;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d837c,_0x51a78d){var _0x26a768=function(_0x50eb07){while(--_0x50eb07){_0x1d837c['push'](_0x1d837c['shift']());}};_0x26a768(++_0x51a78d);}(_0xe706,0xa3));var _0x6e70=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0xe706[_0x485abd];return _0x3379f1;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e91092a..79b7319 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 _0x80ea=['INTEGER','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80ea,0x1cf));var _0xa80e=function(_0x1bdef8,_0x5c8d75){_0x1bdef8=_0x1bdef8-0x0;var _0x45755a=_0x80ea[_0x1bdef8];return _0x45755a;};'use strict';var Sequelize=require(_0xa80e('0x0'));module[_0xa80e('0x1')]={'penalty':{'type':Sequelize[_0xa80e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc05=['INTEGER','sequelize','exports'];(function(_0x308da8,_0x13d916){var _0x13c979=function(_0x1d130f){while(--_0x1d130f){_0x308da8['push'](_0x308da8['shift']());}};_0x13c979(++_0x13d916);}(_0xcc05,0x1e1));var _0x5cc0=function(_0x29914c,_0x143802){_0x29914c=_0x29914c-0x0;var _0x48d256=_0xcc05[_0x29914c];return _0x48d256;};'use strict';var Sequelize=require(_0x5cc0('0x0'));module[_0x5cc0('0x1')]={'penalty':{'type':Sequelize[_0x5cc0('0x2')],'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 d4051b2..0c28cc7 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 _0x574a=['path','rimraf','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1a4050,_0x3d27c9){var _0x20c621=function(_0x18f7ae){while(--_0x18f7ae){_0x1a4050['push'](_0x1a4050['shift']());}};_0x20c621(++_0x3d27c9);}(_0x574a,0x13a));var _0xa574=function(_0x585f6c,_0x537b7a){_0x585f6c=_0x585f6c-0x0;var _0x598331=_0x574a[_0x585f6c];return _0x598331;};'use strict';var _=require(_0xa574('0x0'));var util=require('util');var logger=require(_0xa574('0x1'))('api');var moment=require(_0xa574('0x2'));var BPromise=require(_0xa574('0x3'));var rp=require(_0xa574('0x4'));var fs=require('fs');var path=require(_0xa574('0x5'));var rimraf=require(_0xa574('0x6'));var config=require('../../config/environment');var attributes=require(_0xa574('0x7'));module[_0xa574('0x8')]=function(_0xa9bbc8,_0x2ff3d9){return _0xa9bbc8[_0xa574('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0xa574('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8803=['../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x3f1c4c,_0x2e948c){var _0x4a673a=function(_0x281184){while(--_0x281184){_0x3f1c4c['push'](_0x3f1c4c['shift']());}};_0x4a673a(++_0x2e948c);}(_0x8803,0x82));var _0x3880=function(_0x1ab73b,_0x3ea5c7){_0x1ab73b=_0x1ab73b-0x0;var _0x6370c=_0x8803[_0x1ab73b];return _0x6370c;};'use strict';var _=require(_0x3880('0x0'));var util=require(_0x3880('0x1'));var logger=require(_0x3880('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3880('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3880('0x4'));var config=require(_0x3880('0x5'));var attributes=require(_0x3880('0x6'));module['exports']=function(_0x4c7fa7,_0x569756){return _0x4c7fa7[_0x3880('0x7')](_0x3880('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 8e8eab1..b2fe848 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 _0x8786=['UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x2eee93,_0x2953b4){var _0x371bf9=function(_0x1594e8){while(--_0x1594e8){_0x2eee93['push'](_0x2eee93['shift']());}};_0x371bf9(++_0x2953b4);}(_0x8786,0x138));var _0x6878=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8786[_0x2641f9];return _0x585741;};'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});function respondWithRpcPromise(_0x1517d7,_0x153b9a,_0x1146bd){return new BPromise(function(_0x5ca7ec,_0x4b707d){return client['request'](_0x1517d7,_0x1146bd)['then'](function(_0x43a7b8){logger[_0x6878('0xa')](_0x6878('0xb'),_0x153b9a,'request\x20sent');logger['debug'](_0x6878('0xc'),_0x153b9a,_0x6878('0xd'),JSON['stringify'](_0x43a7b8));if(_0x43a7b8['error']){if(_0x43a7b8[_0x6878('0xe')]['code']===0x1f4){logger[_0x6878('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x153b9a,_0x43a7b8[_0x6878('0xe')]['message']);return _0x4b707d(_0x43a7b8[_0x6878('0xe')][_0x6878('0xf')]);}logger['error'](_0x6878('0xb'),_0x153b9a,_0x43a7b8[_0x6878('0xe')]['message']);return _0x5ca7ec(_0x43a7b8[_0x6878('0xe')][_0x6878('0xf')]);}else{logger[_0x6878('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x153b9a,_0x6878('0xd'));_0x5ca7ec(_0x43a7b8[_0x6878('0x10')][_0x6878('0xf')]);}})['catch'](function(_0x11efbf){logger[_0x6878('0xe')](_0x6878('0xb'),_0x153b9a,_0x11efbf);_0x4b707d(_0x11efbf);});});} \ No newline at end of file +var _0xf37a=['../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0xa8bac,_0x38bcc3){var _0xbdda4=function(_0x17bed7){while(--_0x17bed7){_0xa8bac['push'](_0xa8bac['shift']());}};_0xbdda4(++_0x38bcc3);}(_0xf37a,0x1c6));var _0xaf37=function(_0xf66a25,_0x527689){_0xf66a25=_0xf66a25-0x0;var _0x231422=_0xf37a[_0xf66a25];return _0x231422;};'use strict';var _=require(_0xaf37('0x0'));var util=require('util');var moment=require(_0xaf37('0x1'));var BPromise=require('bluebird');var rs=require(_0xaf37('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaf37('0x3'));var logger=require(_0xaf37('0x4'))(_0xaf37('0x5'));var config=require(_0xaf37('0x6'));var jayson=require(_0xaf37('0x7'));var client=jayson[_0xaf37('0x8')][_0xaf37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x408efa,_0x5a1bcd,_0x53848b){return new BPromise(function(_0x5ce1ef,_0x3d6e39){return client[_0xaf37('0xa')](_0x408efa,_0x53848b)[_0xaf37('0xb')](function(_0x2a674d){logger['info'](_0xaf37('0xc'),_0x5a1bcd,'request\x20sent');logger[_0xaf37('0xd')](_0xaf37('0xe'),_0x5a1bcd,_0xaf37('0xf'),JSON[_0xaf37('0x10')](_0x2a674d));if(_0x2a674d[_0xaf37('0x11')]){if(_0x2a674d[_0xaf37('0x11')][_0xaf37('0x12')]===0x1f4){logger['error'](_0xaf37('0xc'),_0x5a1bcd,_0x2a674d['error'][_0xaf37('0x13')]);return _0x3d6e39(_0x2a674d[_0xaf37('0x11')][_0xaf37('0x13')]);}logger[_0xaf37('0x11')](_0xaf37('0xc'),_0x5a1bcd,_0x2a674d[_0xaf37('0x11')]['message']);return _0x5ce1ef(_0x2a674d['error'][_0xaf37('0x13')]);}else{logger[_0xaf37('0x14')](_0xaf37('0xc'),_0x5a1bcd,'request\x20sent');_0x5ce1ef(_0x2a674d[_0xaf37('0x15')][_0xaf37('0x13')]);}})[_0xaf37('0x16')](function(_0x25d5df){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5a1bcd,_0x25d5df);_0x3d6e39(_0x25d5df);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a28be37..9140007 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 _0x177e=['post','create','/:id/clone','clone','addSections','addResources','put','update','delete','exports','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x1c6ea4,_0x21e492){var _0x24da5c=function(_0x361506){while(--_0x361506){_0x1c6ea4['push'](_0x1c6ea4['shift']());}};_0x24da5c(++_0x21e492);}(_0x177e,0xd0));var _0xe177=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x177e[_0x20a584];return _0x4b41a8;};'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['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe177('0x0'));var interaction=require(_0xe177('0x1'));var config=require(_0xe177('0x2'));var controller=require('./userProfile.controller');router['get']('/',auth[_0xe177('0x3')](),controller[_0xe177('0x4')]);router[_0xe177('0x5')]('/describe',auth[_0xe177('0x3')](),controller[_0xe177('0x6')]);router['get'](_0xe177('0x7'),auth[_0xe177('0x3')](),controller[_0xe177('0x8')]);router[_0xe177('0x5')](_0xe177('0x9'),auth['isAuthenticated'](),controller[_0xe177('0xa')]);router[_0xe177('0x5')](_0xe177('0xb'),auth[_0xe177('0x3')](),controller['getResources']);router[_0xe177('0xc')]('/',auth[_0xe177('0x3')](),controller[_0xe177('0xd')]);router[_0xe177('0xc')](_0xe177('0xe'),auth[_0xe177('0x3')](),controller[_0xe177('0xf')]);router['post']('/:id/sections',auth[_0xe177('0x3')](),controller[_0xe177('0x10')]);router[_0xe177('0xc')]('/:id/resources',auth[_0xe177('0x3')](),controller[_0xe177('0x11')]);router[_0xe177('0x12')](_0xe177('0x7'),auth[_0xe177('0x3')](),controller[_0xe177('0x13')]);router['delete']('/:id',auth[_0xe177('0x3')](),controller['destroy']);router['delete']('/:id/sections',auth[_0xe177('0x3')](),controller['removeSections']);router[_0xe177('0x14')]('/:id/resources',auth[_0xe177('0x3')](),controller['removeResources']);module[_0xe177('0x15')]=router; \ No newline at end of file +var _0xa6f5=['getSections','/:id/resources','post','create','/:id/clone','/:id/sections','addResources','update','delete','removeSections','removeResources','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa6f5,0x151));var _0x5a6f=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xa6f5[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require(_0x5a6f('0x0'));var util=require(_0x5a6f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a6f('0x2')]();var fs_extra=require(_0x5a6f('0x3'));var auth=require(_0x5a6f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5a6f('0x5'));var controller=require(_0x5a6f('0x6'));router[_0x5a6f('0x7')]('/',auth[_0x5a6f('0x8')](),controller['index']);router[_0x5a6f('0x7')](_0x5a6f('0x9'),auth[_0x5a6f('0x8')](),controller[_0x5a6f('0xa')]);router[_0x5a6f('0x7')](_0x5a6f('0xb'),auth['isAuthenticated'](),controller[_0x5a6f('0xc')]);router['get']('/:id/sections',auth[_0x5a6f('0x8')](),controller[_0x5a6f('0xd')]);router[_0x5a6f('0x7')](_0x5a6f('0xe'),auth[_0x5a6f('0x8')](),controller['getResources']);router[_0x5a6f('0xf')]('/',auth[_0x5a6f('0x8')](),controller[_0x5a6f('0x10')]);router[_0x5a6f('0xf')](_0x5a6f('0x11'),auth[_0x5a6f('0x8')](),controller['clone']);router['post'](_0x5a6f('0x12'),auth[_0x5a6f('0x8')](),controller['addSections']);router[_0x5a6f('0xf')](_0x5a6f('0xe'),auth['isAuthenticated'](),controller[_0x5a6f('0x13')]);router['put'](_0x5a6f('0xb'),auth['isAuthenticated'](),controller[_0x5a6f('0x14')]);router[_0x5a6f('0x15')](_0x5a6f('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5a6f('0x15')](_0x5a6f('0x12'),auth[_0x5a6f('0x8')](),controller[_0x5a6f('0x16')]);router['delete'](_0x5a6f('0xe'),auth[_0x5a6f('0x8')](),controller[_0x5a6f('0x17')]);module[_0x5a6f('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 09937ff..23c1e59 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 _0x5759=['STRING','name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x6e0d59,_0x4ffd88){var _0x11601d=function(_0x2b73ad){while(--_0x2b73ad){_0x6e0d59['push'](_0x6e0d59['shift']());}};_0x11601d(++_0x4ffd88);}(_0x5759,0x1c0));var _0x9575=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5759[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x9575('0x0'));module[_0x9575('0x1')]={'name':{'type':Sequelize[_0x9575('0x2')],'allowNull':![],'unique':_0x9575('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x31c8c7){this[_0x9575('0x4')](_0x9575('0x5'),_0x31c8c7?_0x31c8c7['join'](''):[]);},'get':function(){return this[_0x9575('0x6')]('crudPermissions')?this[_0x9575('0x6')](_0x9575('0x5'))[_0x9575('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9575('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9575('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9575('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x59c8=['STRING','name','crudPermissions','getDataValue','split','BOOLEAN','exports'];(function(_0x2a010e,_0x1fd179){var _0x18bbba=function(_0x3a90d9){while(--_0x3a90d9){_0x2a010e['push'](_0x2a010e['shift']());}};_0x18bbba(++_0x1fd179);}(_0x59c8,0xa0));var _0x859c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x59c8[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x859c('0x0')]={'name':{'type':Sequelize[_0x859c('0x1')],'allowNull':![],'unique':_0x859c('0x2')},'crudPermissions':{'type':Sequelize[_0x859c('0x1')],'set':function(_0x593829){this['setDataValue'](_0x859c('0x3'),_0x593829?_0x593829['join'](''):[]);},'get':function(){return this[_0x859c('0x4')](_0x859c('0x3'))?this[_0x859c('0x4')](_0x859c('0x3'))[_0x859c('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x859c('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x859c('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x859c('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x859c('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x859c('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x859c('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9a2494a..79c10ba 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 _0x6ab2=['findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','length','find','catch','create','body','clone','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection'];(function(_0x107424,_0x44e257){var _0x2675d4=function(_0x1960b5){while(--_0x1960b5){_0x107424['push'](_0x107424['shift']());}};_0x2675d4(++_0x44e257);}(_0x6ab2,0x8b));var _0x26ab=function(_0x1bc669,_0x55a207){_0x1bc669=_0x1bc669-0x0;var _0x1fe31b=_0x6ab2[_0x1bc669];return _0x1fe31b;};'use strict';var emlformat=require(_0x26ab('0x0'));var rimraf=require(_0x26ab('0x1'));var zipdir=require(_0x26ab('0x2'));var jsonpatch=require(_0x26ab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x26ab('0x4'));var Mustache=require(_0x26ab('0x5'));var util=require(_0x26ab('0x6'));var path=require(_0x26ab('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26ab('0x8'));var fs=require('fs');var fs_extra=require(_0x26ab('0x9'));var _=require(_0x26ab('0xa'));var squel=require(_0x26ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x26ab('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x26ab('0xd'));var querystring=require(_0x26ab('0xe'));var Papa=require(_0x26ab('0xf'));var Redis=require(_0x26ab('0x10'));var authService=require(_0x26ab('0x11'));var qs=require(_0x26ab('0x12'));var as=require(_0x26ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ab('0x14'))(_0x26ab('0x15'));var utils=require(_0x26ab('0x16'));var config=require(_0x26ab('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26ab('0x18'))['db'];config[_0x26ab('0x19')]=_['defaults'](config[_0x26ab('0x19')],{'host':_0x26ab('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26ab('0x19')]));require(_0x26ab('0x1b'))['register'](socket);function respondWithStatusCode(_0xa48957,_0x22a21a){_0x22a21a=_0x22a21a||0xcc;return function(_0x5ec067){if(_0x5ec067){return _0xa48957[_0x26ab('0x1c')](_0x22a21a);}return _0xa48957[_0x26ab('0x1d')](_0x22a21a)[_0x26ab('0x1e')]();};}function respondWithResult(_0x5103b8,_0x1450b8){_0x1450b8=_0x1450b8||0xc8;return function(_0x2a8e66){if(_0x2a8e66){return _0x5103b8['status'](_0x1450b8)[_0x26ab('0x1f')](_0x2a8e66);}};}function respondWithFilteredResult(_0x182734,_0x21458e){return function(_0x212121){if(_0x212121){var _0xfdb0d0=typeof _0x21458e[_0x26ab('0x20')]==='undefined'&&typeof _0x21458e[_0x26ab('0x21')]===_0x26ab('0x22');var _0x3df4c8=_0x212121['count'];var _0x3d0825=_0xfdb0d0?0x0:_0x21458e['offset'];var _0x3668e5=_0xfdb0d0?_0x212121['count']:_0x21458e[_0x26ab('0x20')]+_0x21458e['limit'];var _0x508aca;if(_0x3668e5>=_0x3df4c8){_0x3668e5=_0x3df4c8;_0x508aca=0xc8;}else{_0x508aca=0xce;}_0x182734[_0x26ab('0x1d')](_0x508aca);return _0x182734['set'](_0x26ab('0x23'),_0x3d0825+'-'+_0x3668e5+'/'+_0x3df4c8)[_0x26ab('0x1f')](_0x212121);}return null;};}function patchUpdates(_0x41e159){return function(_0x1c6b15){try{jsonpatch[_0x26ab('0x24')](_0x1c6b15,_0x41e159,!![]);}catch(_0x401168){return BPromise[_0x26ab('0x25')](_0x401168);}return _0x1c6b15[_0x26ab('0x26')]();};}function saveUpdates(_0x1352b9,_0xf0f3e6){return function(_0x4c6950){if(_0x4c6950){return _0x4c6950[_0x26ab('0x27')](_0x1352b9)[_0x26ab('0x28')](function(_0x25db91){return _0x25db91;});}return null;};}function removeEntity(_0x25cd6b,_0xf32791){return function(_0x32db5c){if(_0x32db5c){return _0x32db5c[_0x26ab('0x29')]()[_0x26ab('0x28')](function(){_0x25cd6b[_0x26ab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e0bc,_0x1a1b63){return function(_0x1db3a8){if(!_0x1db3a8){_0x34e0bc[_0x26ab('0x1c')](0x194);}return _0x1db3a8;};}function handleError(_0x16ad6c,_0x312244){_0x312244=_0x312244||0x1f4;return function(_0x13f624){logger['error'](_0x13f624['stack']);if(_0x13f624[_0x26ab('0x2a')]){delete _0x13f624[_0x26ab('0x2a')];}_0x16ad6c[_0x26ab('0x1d')](_0x312244)[_0x26ab('0x2b')](_0x13f624);};}exports[_0x26ab('0x2c')]=function(_0x11806c,_0x806a33){var _0x510bfb={},_0x23c105={},_0x1ee3a1={'count':0x0,'rows':[]};var _0x2e7dd7=_['map'](db[_0x26ab('0x2d')][_0x26ab('0x2e')],function(_0x23556c){return{'name':_0x23556c[_0x26ab('0x2f')],'type':_0x23556c[_0x26ab('0x30')][_0x26ab('0x31')]};});_0x23c105[_0x26ab('0x32')]=_['map'](_0x2e7dd7,_0x26ab('0x2a'));_0x23c105[_0x26ab('0x33')]=_[_0x26ab('0x34')](_0x11806c['query']);_0x23c105[_0x26ab('0x35')]=_['intersection'](_0x23c105[_0x26ab('0x32')],_0x23c105[_0x26ab('0x33')]);_0x510bfb[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x23c105[_0x26ab('0x32')],qs[_0x26ab('0x38')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x38')]));_0x510bfb[_0x26ab('0x36')]=_0x510bfb[_0x26ab('0x36')]['length']?_0x510bfb[_0x26ab('0x36')]:_0x23c105[_0x26ab('0x32')];if(!_0x11806c['query'][_0x26ab('0x39')](_0x26ab('0x3a'))){_0x510bfb[_0x26ab('0x21')]=qs[_0x26ab('0x21')](_0x11806c['query'][_0x26ab('0x21')]);_0x510bfb[_0x26ab('0x20')]=qs[_0x26ab('0x20')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x20')]);}_0x510bfb[_0x26ab('0x3b')]=qs[_0x26ab('0x3c')](_0x11806c[_0x26ab('0x33')][_0x26ab('0x3c')]);_0x510bfb[_0x26ab('0x3d')]=qs[_0x26ab('0x35')](_['pick'](_0x11806c['query'],_0x23c105[_0x26ab('0x35')]),_0x2e7dd7);if(_0x11806c[_0x26ab('0x33')][_0x26ab('0x3e')]){_0x510bfb['where']=_['merge'](_0x510bfb[_0x26ab('0x3d')],{'$or':_[_0x26ab('0x3f')](_0x2e7dd7,function(_0x4b3439){if(_0x4b3439[_0x26ab('0x30')]!==_0x26ab('0x40')){var _0x742a48={};_0x742a48[_0x4b3439[_0x26ab('0x2a')]]={'$like':'%'+_0x11806c[_0x26ab('0x33')][_0x26ab('0x3e')]+'%'};return _0x742a48;}})});}_0x510bfb=_[_0x26ab('0x41')]({},_0x510bfb,_0x11806c[_0x26ab('0x42')]);var _0x1aeb7c={'where':_0x510bfb[_0x26ab('0x3d')]};return db[_0x26ab('0x2d')][_0x26ab('0x43')](_0x1aeb7c)[_0x26ab('0x28')](function(_0x353399){_0x1ee3a1[_0x26ab('0x43')]=_0x353399;if(_0x11806c[_0x26ab('0x33')][_0x26ab('0x44')]){_0x510bfb[_0x26ab('0x45')]=[{'all':!![]}];}return db[_0x26ab('0x2d')]['findAll'](_0x510bfb);})[_0x26ab('0x28')](function(_0x5052d6){_0x1ee3a1[_0x26ab('0x46')]=_0x5052d6;return _0x1ee3a1;})['then'](respondWithFilteredResult(_0x806a33,_0x510bfb))['catch'](handleError(_0x806a33,null));};exports[_0x26ab('0x47')]=function(_0x1c28b7,_0x2aa1ac){var _0x4e4433={'raw':![],'where':{'id':_0x1c28b7[_0x26ab('0x48')]['id']}},_0x3123e2={};_0x3123e2['model']=_['keys'](db[_0x26ab('0x2d')][_0x26ab('0x2e')]);_0x3123e2[_0x26ab('0x33')]=_[_0x26ab('0x34')](_0x1c28b7[_0x26ab('0x33')]);_0x3123e2[_0x26ab('0x35')]=_['intersection'](_0x3123e2[_0x26ab('0x32')],_0x3123e2['query']);_0x4e4433[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x3123e2['model'],qs[_0x26ab('0x38')](_0x1c28b7[_0x26ab('0x33')][_0x26ab('0x38')]));_0x4e4433[_0x26ab('0x36')]=_0x4e4433[_0x26ab('0x36')][_0x26ab('0x49')]?_0x4e4433['attributes']:_0x3123e2[_0x26ab('0x32')];if(_0x1c28b7[_0x26ab('0x33')][_0x26ab('0x44')]){_0x4e4433['include']=[{'all':!![]}];}_0x4e4433=_[_0x26ab('0x41')]({},_0x4e4433,_0x1c28b7[_0x26ab('0x42')]);return db[_0x26ab('0x2d')][_0x26ab('0x4a')](_0x4e4433)['then'](handleEntityNotFound(_0x2aa1ac,null))[_0x26ab('0x28')](respondWithResult(_0x2aa1ac,null))[_0x26ab('0x4b')](handleError(_0x2aa1ac,null));};exports[_0x26ab('0x4c')]=function(_0x5dc7f5,_0x2eda8b){return db[_0x26ab('0x2d')][_0x26ab('0x4c')](_0x5dc7f5[_0x26ab('0x4d')],{})[_0x26ab('0x28')](respondWithResult(_0x2eda8b,0xc9))[_0x26ab('0x4b')](handleError(_0x2eda8b,null));};exports[_0x26ab('0x4e')]=function(_0x46a90d,_0x563060){var _0xe1523d={'where':{'id':_0x46a90d[_0x26ab('0x48')]['id']}},_0x5eb8a2={};_0x5eb8a2[_0x26ab('0x32')]=_[_0x26ab('0x34')](db[_0x26ab('0x2d')][_0x26ab('0x2e')]);_0xe1523d[_0x26ab('0x36')]=_[_0x26ab('0x37')](_0x5eb8a2['model'],qs[_0x26ab('0x38')](_0x46a90d['query']['fields']));_0xe1523d[_0x26ab('0x36')]=_0xe1523d[_0x26ab('0x36')][_0x26ab('0x49')]?_0xe1523d[_0x26ab('0x36')]:_0x5eb8a2['model'];if(_0x46a90d[_0x26ab('0x33')][_0x26ab('0x44')]){_0xe1523d[_0x26ab('0x45')]=[{'all':!![]}];}_0xe1523d=_[_0x26ab('0x41')]({},_0xe1523d,_0x46a90d['options']);return db[_0x26ab('0x2d')][_0x26ab('0x4a')](_0xe1523d)[_0x26ab('0x28')](handleEntityNotFound(_0x563060,null))[_0x26ab('0x28')](function(_0x15881f){if(_0x15881f){var _0x48de96=_0x15881f[_0x26ab('0x4f')]({'plain':!![]});_0x48de96=qs['omit'](_0x48de96,['id',_0x26ab('0x50'),_0x26ab('0x51'),_0x26ab('0x52')]);_0x46a90d['body']=_[_0x26ab('0x53')](_0x46a90d[_0x26ab('0x4d')],['id','createdAt',_0x26ab('0x51')]);return db[_0x26ab('0x54')][_0x26ab('0x55')](function(_0xec6d9b){return db[_0x26ab('0x2d')]['create'](_[_0x26ab('0x41')](_0x48de96,_0x46a90d[_0x26ab('0x4d')]),{'include':_0x46a90d[_0x26ab('0x33')][_0x26ab('0x44')]?[{'all':!![]}]:undefined,'transaction':_0xec6d9b})[_0x26ab('0x28')](function(_0x51e276){var _0x146be7=_0x51e276[_0x26ab('0x4f')]({'plain':!![]});return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x46a90d[_0x26ab('0x48')]['id']},'raw':!![]})['then'](function(_0x223626){if(_0x223626){return BPromise[_0x26ab('0x58')](_0x223626,function(_0x9c83a1){return new BPromise(function(_0x433abb,_0x520446){if(_0x9c83a1['autoAssociation']===null||_0x9c83a1[_0x26ab('0x59')]===0x1)_0x433abb(null);return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x9c83a1['id']},'raw':!![]})['then'](function(_0xfd09b0){var _0x548680=_[_0x26ab('0x3f')](_0xfd09b0,function(_0x3feeb6){return qs['omit'](_0x3feeb6,['id','createdAt',_0x26ab('0x51'),_0x26ab('0x5b')]);});_0x433abb(_0x548680);})[_0x26ab('0x4b')](function(_0x4813fe){_0x520446(_0x4813fe);});})['then'](function(_0x3902f9){var _0x4d5564=qs[_0x26ab('0x53')](_0x9c83a1,['id',_0x26ab('0x50'),_0x26ab('0x51')]);_0x4d5564[_0x26ab('0x5c')]=_0x146be7['id'];if(_0x3902f9)_0x4d5564[_0x26ab('0x5d')]=_0x3902f9;return _0x4d5564;})[_0x26ab('0x28')](function(_0x2c15cc){return db[_0x26ab('0x56')]['create'](_0x2c15cc,{'include':[{'model':db[_0x26ab('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0xec6d9b});});})[_0x26ab('0x28')](function(){return _0x146be7;});}});});});}})[_0x26ab('0x28')](respondWithResult(_0x563060,0xc9))['catch'](handleError(_0x563060,null));};exports[_0x26ab('0x27')]=function(_0x2c4f13,_0x32a40b){if(_0x2c4f13[_0x26ab('0x4d')]['id']){delete _0x2c4f13['body']['id'];}return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x2c4f13[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x32a40b,null))[_0x26ab('0x28')](saveUpdates(_0x2c4f13[_0x26ab('0x4d')],null))[_0x26ab('0x28')](respondWithResult(_0x32a40b,null))[_0x26ab('0x4b')](handleError(_0x32a40b,null));};exports[_0x26ab('0x29')]=function(_0x4e6fad,_0x1d2b9b){return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x4e6fad['params']['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x1d2b9b,null))[_0x26ab('0x28')](removeEntity(_0x1d2b9b,null))[_0x26ab('0x4b')](handleError(_0x1d2b9b,null));};exports[_0x26ab('0x5e')]=function(_0x57aabb,_0x53168a){return db['UserProfile'][_0x26ab('0x5e')]()[_0x26ab('0x28')](respondWithResult(_0x53168a,null))['catch'](handleError(_0x53168a,null));};exports['addSections']=function(_0x26bf88,_0x5c840f){var _0x155040=_0x26bf88[_0x26ab('0x4d')];return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x26bf88['params']['id']}})['then'](handleEntityNotFound(_0x5c840f,null))['then'](function(_0x480d7a){if(_0x480d7a){return db['sequelize'][_0x26ab('0x55')](function(_0x327e94){return db['UserProfileSection'][_0x26ab('0x29')]({'where':{'userProfileId':_0x26bf88['params']['id'],'sectionId':_[_0x26ab('0x3f')](_0x155040,function(_0x30bcd8){return _0x30bcd8['sectionId'];})},'transaction':_0x327e94})[_0x26ab('0x28')](function(){var _0x15d178=_[_0x26ab('0x3f')](_0x155040,function(_0x15d601){_0x15d601[_0x26ab('0x5c')]=_0x26bf88[_0x26ab('0x48')]['id'];return _0x15d601;});var _0x182341=[];return BPromise['each'](_0x15d178,function(_0x427fbb){return db[_0x26ab('0x56')][_0x26ab('0x4c')](_0x427fbb,{'include':[{'model':db['UserProfileResource'],'as':_0x26ab('0x5d')}],'raw':!![],'transaction':_0x327e94})[_0x26ab('0x28')](function(_0x213734){_0x182341[_0x26ab('0x5f')](_0x213734[_0x26ab('0x4f')]({'plain':!![]}));});})[_0x26ab('0x28')](function(){return _0x182341;});});});}})[_0x26ab('0x28')](function(_0x406882){return _0x406882;})[_0x26ab('0x28')](respondWithResult(_0x5c840f,null))[_0x26ab('0x4b')](handleError(_0x5c840f,null));};exports[_0x26ab('0x60')]=function(_0x27831c,_0x4635ca){var _0x1c525a;return db[_0x26ab('0x2d')]['find']({'where':{'id':_0x27831c['params']['id']},'attributes':['id',_0x26ab('0x2a')]})[_0x26ab('0x28')](handleEntityNotFound(_0x4635ca,null))[_0x26ab('0x28')](function(_0x3a6d30){if(_0x3a6d30){_0x1c525a=_0x3a6d30;return db[_0x26ab('0x56')][_0x26ab('0x29')]({'where':{'userProfileId':_0x27831c[_0x26ab('0x48')]['id'],'sectionId':_0x27831c['query'][_0x26ab('0x61')]}});}})['then'](function(){return _0x1c525a;})['then'](respondWithStatusCode(_0x4635ca,null))[_0x26ab('0x4b')](handleError(_0x4635ca,null));};exports[_0x26ab('0x62')]=function(_0x35beeb,_0x3fd783){var _0x48e966=[];var _0xb2c519=[];return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x35beeb[_0x26ab('0x48')]['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x536c41){_0x48e966=_[_0x26ab('0x3e')](_0x536c41,function(_0x2d83d5){return _0x2d83d5[_0x26ab('0x63')]===0x1||_['includes']([0x3eb,0x709],_0x2d83d5[_0x26ab('0x5b')]);});if(!_[_0x26ab('0x64')](_0x48e966)){return _[_0x26ab('0x3f')](_0x48e966,function(_0x4f66eb){return _0x4f66eb[_0x26ab('0x5b')];});}else{return;}})['then'](function(_0x5c69a2){if(_0x5c69a2)_0xb2c519=_0x5c69a2;if(_[_0x26ab('0x65')](_0xb2c519,0x64)){var _0x3ec224=_[_0x26ab('0x4a')](_0x48e966,{'sectionId':0x64});return hasDefaultDashboard(_0x3ec224)[_0x26ab('0x28')](function(_0x259163){return _[_0x26ab('0x3f')](_0x48e966,function(_0x28cfeb){if(_0x28cfeb['sectionId']===0x64){_0x28cfeb['subsections']=_0x259163;}return _0x28cfeb;});});}else{return;}})[_0x26ab('0x28')](function(_0x3c0abd){if(_0x3c0abd)_0x48e966=_0x3c0abd;if(_[_0x26ab('0x65')](_0xb2c519,0x3eb)){var _0x4b6ba1=_['find'](_0x48e966,{'sectionId':0x3eb});return getCustomDashboards(_0x4b6ba1)[_0x26ab('0x28')](function(_0x22dfa7){return _['map'](_0x48e966,function(_0x30422f){if(_0x4b6ba1[_0x26ab('0x63')]){if(_0x30422f['sectionId']===0x3eb){_0x30422f[_0x26ab('0x66')]=_0x22dfa7;}}else{if(_0x30422f[_0x26ab('0x5b')]===0x64){if(!_0x30422f[_0x26ab('0x66')]){_0x30422f[_0x26ab('0x66')]=[];}_0x30422f[_0x26ab('0x66')]=_0x30422f[_0x26ab('0x66')]['concat'](_0x22dfa7);}}return _0x30422f;});});}else{return;}})[_0x26ab('0x28')](function(_0x3e8a28){if(_0x3e8a28)_0x48e966=_0x3e8a28;if(_[_0x26ab('0x65')](_0xb2c519,0x709)){var _0x1e501a=_['find'](_0x48e966,{'sectionId':0x709});return getPlugins(_0x1e501a)['then'](function(_0x31874c){if(_0x1e501a[_0x26ab('0x63')]){return _[_0x26ab('0x3f')](_0x48e966,function(_0x38a5ac){if(_0x38a5ac[_0x26ab('0x5b')]===0x709){_0x38a5ac[_0x26ab('0x66')]=_0x31874c;}return _0x38a5ac;});}else{var _0xde460b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x31874c};var _0x16b890=_[_0x26ab('0x3f')](_0x48e966);_0x16b890[_0x26ab('0x5f')](_0xde460b);return _0x16b890;}});}else{return;}})[_0x26ab('0x28')](function(_0x4fb907){if(_0x4fb907)_0x48e966=_0x4fb907;return _[_0x26ab('0x3e')](_0x48e966,[_0x26ab('0x63'),0x1]);})[_0x26ab('0x28')](respondWithResult(_0x3fd783,null))[_0x26ab('0x4b')](handleError(_0x3fd783,null));};function hasDefaultDashboard(_0x4cdc2f){var _0x4f39eb=[0x65];return new BPromise(function(_0x739d0e,_0xd799c){try{if(_0x4cdc2f[_0x26ab('0x59')]){_0x739d0e(_0x4f39eb);}else{return db['UserProfileResource'][_0x26ab('0x67')]({'where':{'sectionId':_0x4cdc2f['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x45b5cf){_0x45b5cf?_0x739d0e(_0x4f39eb):_0x739d0e();});}}catch(_0x199daa){_0xd799c(_0x199daa);}});}function getCustomDashboards(_0x4e4893){var _0x2fabd0=[];return new BPromise(function(_0x191f42,_0x30dc0e){try{if(_0x4e4893[_0x26ab('0x59')]){return db[_0x26ab('0x68')]['findAll']({'raw':!![]})['then'](function(_0x4bf465){_0x4bf465['forEach'](function(_0x5f17c4){_0x2fabd0[_0x26ab('0x5f')](_0x5f17c4['id']+0x1869f);});_0x191f42(_0x2fabd0);});}else{return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x4e4893['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x360764){_0x360764[_0x26ab('0x69')](function(_0x2f5b84){_0x2fabd0[_0x26ab('0x5f')](_0x2f5b84[_0x26ab('0x6a')]+0x1869f);});_0x191f42(_0x2fabd0);});}}catch(_0x672b57){_0x30dc0e(_0x672b57);}});}function getPlugins(_0x494abb){var _0x413495=[];return new BPromise(function(_0x502e41,_0x289fe3){try{if(_0x494abb['autoAssociation']){return db[_0x26ab('0x6b')][_0x26ab('0x57')]({'raw':!![]})[_0x26ab('0x28')](function(_0x51fc96){_0x51fc96[_0x26ab('0x69')](function(_0x2e4da0){_0x413495['push'](_0x2e4da0['id']+0x15b38);});_0x502e41(_0x413495);});}else{return db[_0x26ab('0x5a')][_0x26ab('0x57')]({'where':{'sectionId':_0x494abb['id']},'raw':!![]})[_0x26ab('0x28')](function(_0x1d59d3){_0x1d59d3[_0x26ab('0x69')](function(_0x3ee376){_0x413495['push'](_0x3ee376[_0x26ab('0x6a')]+0x15b38);});_0x502e41(_0x413495);});}}catch(_0x1c5628){_0x289fe3(_0x1c5628);}});}exports[_0x26ab('0x6c')]=function(_0x2f952e,_0x426a67){return db[_0x26ab('0x2d')]['find']({'where':{'id':_0x2f952e[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](handleEntityNotFound(_0x426a67,null))[_0x26ab('0x28')](function(_0x2ad124){if(_0x2ad124){return db[_0x26ab('0x54')][_0x26ab('0x55')](function(_0x2c4476){return db[_0x26ab('0x56')]['findAll']({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x26ab('0x28')](function(_0x5c910f){if(_0x5c910f){return db[_0x26ab('0x56')]['destroy']({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id'],'id':_[_0x26ab('0x3f')](_0x5c910f,function(_0x4f688b){return _0x4f688b['id'];})},'transaction':_0x2c4476});}})[_0x26ab('0x28')](function(_0x5703eb){var _0x5c714e=_[_0x26ab('0x3f')](_0x2f952e[_0x26ab('0x4d')],function(_0x3a8310){_0x3a8310[_0x26ab('0x5c')]=_0x2f952e['params']['id'];return _0x3a8310;});return db[_0x26ab('0x56')][_0x26ab('0x6d')](_0x5c714e,{'raw':!![],'transaction':_0x2c4476});})[_0x26ab('0x28')](function(_0x5b05c7){var _0x2c6be5=_['filter'](_[_0x26ab('0x3f')](_0x5b05c7,function(_0x169ebe){return _0x169ebe[_0x26ab('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x2c6be5){return db[_0x26ab('0x56')][_0x26ab('0x57')]({'where':{'userProfileId':_0x2f952e[_0x26ab('0x48')]['id'],'sectionId':_[_0x26ab('0x3f')](_0x2c6be5,function(_0x527bd2){return _0x527bd2['sectionId'];})},'attributes':['id',_0x26ab('0x5b')],'raw':!![]})[_0x26ab('0x28')](function(_0x43141f){var _0xf7bf49=_[_0x26ab('0x3f')](_0x2f952e[_0x26ab('0x4d')],function(_0x78e019){_0x78e019[_0x26ab('0x5c')]=_0x2f952e['params']['id'];return _0x78e019;});return db[_0x26ab('0x5a')][_0x26ab('0x6d')](_0xf7bf49,{'raw':!![],'transaction':_0x2c4476});});}})[_0x26ab('0x4b')](handleError(_0x426a67,null));});}})[_0x26ab('0x28')](function(_0x4a8676){var _0x952627=_[_0x26ab('0x3f')](_0x4a8676,function(_0x352d75){return _0x352d75['get']({'plain':!![]});});})[_0x26ab('0x28')](respondWithResult(_0x426a67,null))['catch'](handleError(_0x426a67,null));};exports['removeResources']=function(_0x2f8a30,_0x1cd36f,_0x802527){return db[_0x26ab('0x2d')][_0x26ab('0x4a')]({'where':{'id':_0x2f8a30[_0x26ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cd36f,null))[_0x26ab('0x28')](function(_0x405008){if(_0x405008){return _0x405008[_0x26ab('0x6e')](_0x2f8a30[_0x26ab('0x33')][_0x26ab('0x61')]);}})['then'](respondWithStatusCode(_0x1cd36f,null))[_0x26ab('0x4b')](handleError(_0x1cd36f,null));};exports[_0x26ab('0x6f')]=function(_0x3d0167,_0x32c755){var _0x26bbda={};if(!_0x3d0167[_0x26ab('0x33')][_0x26ab('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0x3d0167[_0x26ab('0x33')][_0x26ab('0x39')](_0x26ab('0x3a'))){_0x26bbda['limit']=qs[_0x26ab('0x21')](_0x3d0167[_0x26ab('0x33')]['limit']);_0x26bbda[_0x26ab('0x20')]=qs[_0x26ab('0x20')](_0x3d0167[_0x26ab('0x33')][_0x26ab('0x20')]);}return db['UserProfile'][_0x26ab('0x4a')]({'where':{'id':_0x3d0167[_0x26ab('0x48')]['id']}})[_0x26ab('0x28')](function(_0x3a33c5){if(!_0x3a33c5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3d0167[_0x26ab('0x48')]['id']);return db['UserProfile'][_0x26ab('0x6f')](_0x3d0167);})['then'](respondWithFilteredResult(_0x32c755,_0x26bbda))['catch'](handleError(_0x32c755,null));}; \ No newline at end of file +var _0x02e6=['UserProfile','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','body','clone','params','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','sectionId','userProfileId','Resources','create','UserProfileResource','describe','addSections','each','push','removeSections','ids','getSections','includes','subsections','enabled','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','zip-dir','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x1e3d9d,_0x37c2b0){var _0x1ec215=function(_0x9e5350){while(--_0x9e5350){_0x1e3d9d['push'](_0x1e3d9d['shift']());}};_0x1ec215(++_0x37c2b0);}(_0x02e6,0x12b));var _0x602e=function(_0x4e4f14,_0x1cf811){_0x4e4f14=_0x4e4f14-0x0;var _0x3c42f5=_0x02e6[_0x4e4f14];return _0x3c42f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x602e('0x0'));var jsonpatch=require(_0x602e('0x1'));var rp=require(_0x602e('0x2'));var moment=require(_0x602e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x602e('0x4'));var path=require(_0x602e('0x5'));var sox=require(_0x602e('0x6'));var csv=require(_0x602e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x602e('0x8'));var _=require(_0x602e('0x9'));var squel=require(_0x602e('0xa'));var crypto=require(_0x602e('0xb'));var jsforce=require(_0x602e('0xc'));var deskjs=require(_0x602e('0xd'));var toCsv=require(_0x602e('0x7'));var querystring=require(_0x602e('0xe'));var Papa=require(_0x602e('0xf'));var Redis=require(_0x602e('0x10'));var authService=require(_0x602e('0x11'));var qs=require(_0x602e('0x12'));var as=require(_0x602e('0x13'));var hardwareService=require(_0x602e('0x14'));var logger=require(_0x602e('0x15'))(_0x602e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x602e('0x17'));var db=require(_0x602e('0x18'))['db'];config[_0x602e('0x19')]=_[_0x602e('0x1a')](config[_0x602e('0x19')],{'host':_0x602e('0x1b'),'port':0x18eb});var socket=require(_0x602e('0x1c'))(new Redis(config[_0x602e('0x19')]));require(_0x602e('0x1d'))[_0x602e('0x1e')](socket);function respondWithStatusCode(_0x3bfbd5,_0x5b2344){_0x5b2344=_0x5b2344||0xcc;return function(_0xf04043){if(_0xf04043){return _0x3bfbd5[_0x602e('0x1f')](_0x5b2344);}return _0x3bfbd5[_0x602e('0x20')](_0x5b2344)[_0x602e('0x21')]();};}function respondWithResult(_0x31b987,_0x2c2e3d){_0x2c2e3d=_0x2c2e3d||0xc8;return function(_0x1f5b6a){if(_0x1f5b6a){return _0x31b987[_0x602e('0x20')](_0x2c2e3d)[_0x602e('0x22')](_0x1f5b6a);}};}function respondWithFilteredResult(_0xc4f1a6,_0x356a25){return function(_0x3e9a15){if(_0x3e9a15){var _0x561c25=typeof _0x356a25[_0x602e('0x23')]===_0x602e('0x24')&&typeof _0x356a25[_0x602e('0x25')]===_0x602e('0x24');var _0xf210fe=_0x3e9a15['count'];var _0x5589ed=_0x561c25?0x0:_0x356a25[_0x602e('0x23')];var _0x3f3d83=_0x561c25?_0x3e9a15[_0x602e('0x26')]:_0x356a25[_0x602e('0x23')]+_0x356a25[_0x602e('0x25')];var _0x37595b;if(_0x3f3d83>=_0xf210fe){_0x3f3d83=_0xf210fe;_0x37595b=0xc8;}else{_0x37595b=0xce;}_0xc4f1a6[_0x602e('0x20')](_0x37595b);return _0xc4f1a6[_0x602e('0x27')](_0x602e('0x28'),_0x5589ed+'-'+_0x3f3d83+'/'+_0xf210fe)[_0x602e('0x22')](_0x3e9a15);}return null;};}function patchUpdates(_0x36eef8){return function(_0x39b93c){try{jsonpatch[_0x602e('0x29')](_0x39b93c,_0x36eef8,!![]);}catch(_0x572241){return BPromise[_0x602e('0x2a')](_0x572241);}return _0x39b93c[_0x602e('0x2b')]();};}function saveUpdates(_0x44cd31,_0x2de47b){return function(_0x5df50d){if(_0x5df50d){return _0x5df50d[_0x602e('0x2c')](_0x44cd31)[_0x602e('0x2d')](function(_0x130f65){return _0x130f65;});}return null;};}function removeEntity(_0x28cb4e,_0x140c19){return function(_0x309770){if(_0x309770){return _0x309770[_0x602e('0x2e')]()[_0x602e('0x2d')](function(){_0x28cb4e[_0x602e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223c50,_0xf093c8){return function(_0x29d5cc){if(!_0x29d5cc){_0x223c50['sendStatus'](0x194);}return _0x29d5cc;};}function handleError(_0x551154,_0x4d28ed){_0x4d28ed=_0x4d28ed||0x1f4;return function(_0x1ba8d3){logger[_0x602e('0x2f')](_0x1ba8d3[_0x602e('0x30')]);if(_0x1ba8d3[_0x602e('0x31')]){delete _0x1ba8d3[_0x602e('0x31')];}_0x551154[_0x602e('0x20')](_0x4d28ed)['send'](_0x1ba8d3);};}exports[_0x602e('0x32')]=function(_0x4de813,_0x3fca2b){var _0x42ae5e={},_0x3cab85={},_0x2f004e={'count':0x0,'rows':[]};var _0xc11c6d=_[_0x602e('0x33')](db[_0x602e('0x34')][_0x602e('0x35')],function(_0x4282d6){return{'name':_0x4282d6[_0x602e('0x36')],'type':_0x4282d6[_0x602e('0x37')]['key']};});_0x3cab85['model']=_[_0x602e('0x33')](_0xc11c6d,'name');_0x3cab85[_0x602e('0x38')]=_[_0x602e('0x39')](_0x4de813[_0x602e('0x38')]);_0x3cab85[_0x602e('0x3a')]=_[_0x602e('0x3b')](_0x3cab85['model'],_0x3cab85[_0x602e('0x38')]);_0x42ae5e[_0x602e('0x3c')]=_['intersection'](_0x3cab85[_0x602e('0x3d')],qs[_0x602e('0x3e')](_0x4de813[_0x602e('0x38')][_0x602e('0x3e')]));_0x42ae5e[_0x602e('0x3c')]=_0x42ae5e[_0x602e('0x3c')][_0x602e('0x3f')]?_0x42ae5e[_0x602e('0x3c')]:_0x3cab85[_0x602e('0x3d')];if(!_0x4de813[_0x602e('0x38')][_0x602e('0x40')](_0x602e('0x41'))){_0x42ae5e[_0x602e('0x25')]=qs[_0x602e('0x25')](_0x4de813['query'][_0x602e('0x25')]);_0x42ae5e[_0x602e('0x23')]=qs[_0x602e('0x23')](_0x4de813[_0x602e('0x38')]['offset']);}_0x42ae5e[_0x602e('0x42')]=qs[_0x602e('0x43')](_0x4de813[_0x602e('0x38')][_0x602e('0x43')]);_0x42ae5e['where']=qs[_0x602e('0x3a')](_[_0x602e('0x44')](_0x4de813['query'],_0x3cab85[_0x602e('0x3a')]),_0xc11c6d);if(_0x4de813['query'][_0x602e('0x45')]){_0x42ae5e['where']=_[_0x602e('0x46')](_0x42ae5e[_0x602e('0x47')],{'$or':_[_0x602e('0x33')](_0xc11c6d,function(_0x36c663){if(_0x36c663['type']!==_0x602e('0x48')){var _0x4fe72f={};_0x4fe72f[_0x36c663[_0x602e('0x31')]]={'$like':'%'+_0x4de813[_0x602e('0x38')][_0x602e('0x45')]+'%'};return _0x4fe72f;}})});}_0x42ae5e=_[_0x602e('0x46')]({},_0x42ae5e,_0x4de813[_0x602e('0x49')]);var _0x17f5b3={'where':_0x42ae5e['where']};return db['UserProfile'][_0x602e('0x26')](_0x17f5b3)[_0x602e('0x2d')](function(_0x1a11ca){_0x2f004e[_0x602e('0x26')]=_0x1a11ca;if(_0x4de813[_0x602e('0x38')][_0x602e('0x4a')]){_0x42ae5e[_0x602e('0x4b')]=[{'all':!![]}];}return db[_0x602e('0x34')][_0x602e('0x4c')](_0x42ae5e);})[_0x602e('0x2d')](function(_0x3771a3){_0x2f004e[_0x602e('0x4d')]=_0x3771a3;return _0x2f004e;})[_0x602e('0x2d')](respondWithFilteredResult(_0x3fca2b,_0x42ae5e))[_0x602e('0x4e')](handleError(_0x3fca2b,null));};exports['show']=function(_0x510e07,_0x53dfbb){var _0x3432d1={'raw':![],'where':{'id':_0x510e07['params']['id']}},_0x519a04={};_0x519a04[_0x602e('0x3d')]=_[_0x602e('0x39')](db[_0x602e('0x34')][_0x602e('0x35')]);_0x519a04[_0x602e('0x38')]=_[_0x602e('0x39')](_0x510e07[_0x602e('0x38')]);_0x519a04[_0x602e('0x3a')]=_[_0x602e('0x3b')](_0x519a04['model'],_0x519a04[_0x602e('0x38')]);_0x3432d1[_0x602e('0x3c')]=_[_0x602e('0x3b')](_0x519a04[_0x602e('0x3d')],qs[_0x602e('0x3e')](_0x510e07['query']['fields']));_0x3432d1[_0x602e('0x3c')]=_0x3432d1[_0x602e('0x3c')][_0x602e('0x3f')]?_0x3432d1[_0x602e('0x3c')]:_0x519a04[_0x602e('0x3d')];if(_0x510e07['query'][_0x602e('0x4a')]){_0x3432d1[_0x602e('0x4b')]=[{'all':!![]}];}_0x3432d1=_['merge']({},_0x3432d1,_0x510e07[_0x602e('0x49')]);return db[_0x602e('0x34')][_0x602e('0x4f')](_0x3432d1)[_0x602e('0x2d')](handleEntityNotFound(_0x53dfbb,null))[_0x602e('0x2d')](respondWithResult(_0x53dfbb,null))[_0x602e('0x4e')](handleError(_0x53dfbb,null));};exports['create']=function(_0x9cf787,_0x536445){return db[_0x602e('0x34')]['create'](_0x9cf787[_0x602e('0x50')],{})[_0x602e('0x2d')](respondWithResult(_0x536445,0xc9))[_0x602e('0x4e')](handleError(_0x536445,null));};exports[_0x602e('0x51')]=function(_0x184194,_0x345e0b){var _0x39a4cf={'where':{'id':_0x184194[_0x602e('0x52')]['id']}},_0x40a544={};_0x40a544['model']=_['keys'](db[_0x602e('0x34')][_0x602e('0x35')]);_0x39a4cf[_0x602e('0x3c')]=_['intersection'](_0x40a544['model'],qs['fields'](_0x184194[_0x602e('0x38')][_0x602e('0x3e')]));_0x39a4cf[_0x602e('0x3c')]=_0x39a4cf[_0x602e('0x3c')]['length']?_0x39a4cf[_0x602e('0x3c')]:_0x40a544[_0x602e('0x3d')];if(_0x184194[_0x602e('0x38')][_0x602e('0x4a')]){_0x39a4cf[_0x602e('0x4b')]=[{'all':!![]}];}_0x39a4cf=_['merge']({},_0x39a4cf,_0x184194['options']);return db[_0x602e('0x34')]['find'](_0x39a4cf)[_0x602e('0x2d')](handleEntityNotFound(_0x345e0b,null))[_0x602e('0x2d')](function(_0x34037f){if(_0x34037f){var _0x442582=_0x34037f[_0x602e('0x53')]({'plain':!![]});_0x442582=qs[_0x602e('0x54')](_0x442582,['id',_0x602e('0x55'),'updatedAt',_0x602e('0x56')]);_0x184194[_0x602e('0x50')]=_[_0x602e('0x54')](_0x184194[_0x602e('0x50')],['id',_0x602e('0x55'),_0x602e('0x57')]);return db[_0x602e('0x58')][_0x602e('0x59')](function(_0x28d157){return db[_0x602e('0x34')]['create'](_[_0x602e('0x46')](_0x442582,_0x184194[_0x602e('0x50')]),{'include':_0x184194[_0x602e('0x38')][_0x602e('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x28d157})['then'](function(_0x516837){var _0x574d02=_0x516837[_0x602e('0x53')]({'plain':!![]});return db[_0x602e('0x5a')][_0x602e('0x4c')]({'where':{'userProfileId':_0x184194['params']['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x26f63a){if(_0x26f63a){return BPromise['each'](_0x26f63a,function(_0x5e0351){return new BPromise(function(_0x19917a,_0x5b40d7){if(_0x5e0351[_0x602e('0x5b')]===null||_0x5e0351[_0x602e('0x5b')]===0x1)_0x19917a(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5e0351['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x4a4dcf){var _0x1710bc=_[_0x602e('0x33')](_0x4a4dcf,function(_0x4fb88f){return qs[_0x602e('0x54')](_0x4fb88f,['id',_0x602e('0x55'),_0x602e('0x57'),_0x602e('0x5c')]);});_0x19917a(_0x1710bc);})[_0x602e('0x4e')](function(_0x2b74b1){_0x5b40d7(_0x2b74b1);});})['then'](function(_0x3866e4){var _0x533166=qs[_0x602e('0x54')](_0x5e0351,['id',_0x602e('0x55'),_0x602e('0x57')]);_0x533166[_0x602e('0x5d')]=_0x574d02['id'];if(_0x3866e4)_0x533166[_0x602e('0x5e')]=_0x3866e4;return _0x533166;})[_0x602e('0x2d')](function(_0x1ad21d){return db[_0x602e('0x5a')][_0x602e('0x5f')](_0x1ad21d,{'include':[{'model':db[_0x602e('0x60')],'as':_0x602e('0x5e')}],'raw':!![],'transaction':_0x28d157});});})[_0x602e('0x2d')](function(){return _0x574d02;});}});});});}})['then'](respondWithResult(_0x345e0b,0xc9))[_0x602e('0x4e')](handleError(_0x345e0b,null));};exports['update']=function(_0x27509b,_0x46e928){if(_0x27509b[_0x602e('0x50')]['id']){delete _0x27509b['body']['id'];}return db[_0x602e('0x34')][_0x602e('0x4f')]({'where':{'id':_0x27509b[_0x602e('0x52')]['id']}})['then'](handleEntityNotFound(_0x46e928,null))[_0x602e('0x2d')](saveUpdates(_0x27509b[_0x602e('0x50')],null))[_0x602e('0x2d')](respondWithResult(_0x46e928,null))['catch'](handleError(_0x46e928,null));};exports[_0x602e('0x2e')]=function(_0x509af1,_0x5e599b){return db['UserProfile']['find']({'where':{'id':_0x509af1[_0x602e('0x52')]['id']}})[_0x602e('0x2d')](handleEntityNotFound(_0x5e599b,null))[_0x602e('0x2d')](removeEntity(_0x5e599b,null))['catch'](handleError(_0x5e599b,null));};exports['describe']=function(_0x3c6dd6,_0x7d1a9){return db[_0x602e('0x34')][_0x602e('0x61')]()[_0x602e('0x2d')](respondWithResult(_0x7d1a9,null))['catch'](handleError(_0x7d1a9,null));};exports[_0x602e('0x62')]=function(_0x49db2c,_0x430fcc){var _0x57e375=_0x49db2c[_0x602e('0x50')];return db[_0x602e('0x34')]['find']({'where':{'id':_0x49db2c['params']['id']}})[_0x602e('0x2d')](handleEntityNotFound(_0x430fcc,null))[_0x602e('0x2d')](function(_0x13db57){if(_0x13db57){return db[_0x602e('0x58')][_0x602e('0x59')](function(_0x429402){return db[_0x602e('0x5a')]['destroy']({'where':{'userProfileId':_0x49db2c[_0x602e('0x52')]['id'],'sectionId':_[_0x602e('0x33')](_0x57e375,function(_0x4a6615){return _0x4a6615['sectionId'];})},'transaction':_0x429402})['then'](function(){var _0x3e3d97=_[_0x602e('0x33')](_0x57e375,function(_0xf9d185){_0xf9d185['userProfileId']=_0x49db2c['params']['id'];return _0xf9d185;});var _0x4c06c2=[];return BPromise[_0x602e('0x63')](_0x3e3d97,function(_0x217424){return db['UserProfileSection']['create'](_0x217424,{'include':[{'model':db[_0x602e('0x60')],'as':_0x602e('0x5e')}],'raw':!![],'transaction':_0x429402})[_0x602e('0x2d')](function(_0x523a0f){_0x4c06c2[_0x602e('0x64')](_0x523a0f['get']({'plain':!![]}));});})[_0x602e('0x2d')](function(){return _0x4c06c2;});});});}})[_0x602e('0x2d')](function(_0x2a552a){return _0x2a552a;})[_0x602e('0x2d')](respondWithResult(_0x430fcc,null))[_0x602e('0x4e')](handleError(_0x430fcc,null));};exports[_0x602e('0x65')]=function(_0xdf2457,_0x1479bf){var _0x2cfbc7;return db[_0x602e('0x34')][_0x602e('0x4f')]({'where':{'id':_0xdf2457['params']['id']},'attributes':['id',_0x602e('0x31')]})[_0x602e('0x2d')](handleEntityNotFound(_0x1479bf,null))['then'](function(_0x19cd42){if(_0x19cd42){_0x2cfbc7=_0x19cd42;return db['UserProfileSection'][_0x602e('0x2e')]({'where':{'userProfileId':_0xdf2457[_0x602e('0x52')]['id'],'sectionId':_0xdf2457[_0x602e('0x38')][_0x602e('0x66')]}});}})[_0x602e('0x2d')](function(){return _0x2cfbc7;})['then'](respondWithStatusCode(_0x1479bf,null))[_0x602e('0x4e')](handleError(_0x1479bf,null));};exports[_0x602e('0x67')]=function(_0x913e0,_0x10ab6f){var _0x247ce0=[];var _0x160deb=[];return db[_0x602e('0x5a')][_0x602e('0x4c')]({'where':{'userProfileId':_0x913e0[_0x602e('0x52')]['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x389c07){_0x247ce0=_[_0x602e('0x45')](_0x389c07,function(_0x157c7f){return _0x157c7f['enabled']===0x1||_[_0x602e('0x68')]([0x3eb,0x709],_0x157c7f[_0x602e('0x5c')]);});if(!_['isEmpty'](_0x247ce0)){return _[_0x602e('0x33')](_0x247ce0,function(_0x37652d){return _0x37652d[_0x602e('0x5c')];});}else{return;}})[_0x602e('0x2d')](function(_0x709c83){if(_0x709c83)_0x160deb=_0x709c83;if(_[_0x602e('0x68')](_0x160deb,0x64)){var _0x1008c2=_['find'](_0x247ce0,{'sectionId':0x64});return hasDefaultDashboard(_0x1008c2)['then'](function(_0x55aa6e){return _['map'](_0x247ce0,function(_0x237075){if(_0x237075[_0x602e('0x5c')]===0x64){_0x237075[_0x602e('0x69')]=_0x55aa6e;}return _0x237075;});});}else{return;}})[_0x602e('0x2d')](function(_0x58d0d0){if(_0x58d0d0)_0x247ce0=_0x58d0d0;if(_[_0x602e('0x68')](_0x160deb,0x3eb)){var _0x36649b=_[_0x602e('0x4f')](_0x247ce0,{'sectionId':0x3eb});return getCustomDashboards(_0x36649b)[_0x602e('0x2d')](function(_0x403463){return _[_0x602e('0x33')](_0x247ce0,function(_0x5b80f8){if(_0x36649b[_0x602e('0x6a')]){if(_0x5b80f8[_0x602e('0x5c')]===0x3eb){_0x5b80f8['subsections']=_0x403463;}}else{if(_0x5b80f8[_0x602e('0x5c')]===0x64){if(!_0x5b80f8['subsections']){_0x5b80f8[_0x602e('0x69')]=[];}_0x5b80f8[_0x602e('0x69')]=_0x5b80f8[_0x602e('0x69')]['concat'](_0x403463);}}return _0x5b80f8;});});}else{return;}})['then'](function(_0x17fe71){if(_0x17fe71)_0x247ce0=_0x17fe71;if(_['includes'](_0x160deb,0x709)){var _0x2229f3=_['find'](_0x247ce0,{'sectionId':0x709});return getPlugins(_0x2229f3)[_0x602e('0x2d')](function(_0xacc367){if(_0x2229f3[_0x602e('0x6a')]){return _[_0x602e('0x33')](_0x247ce0,function(_0x20780e){if(_0x20780e['sectionId']===0x709){_0x20780e[_0x602e('0x69')]=_0xacc367;}return _0x20780e;});}else{var _0x59cc6e={'sectionId':0x76c,'enabled':0x1,'subsections':_0xacc367};var _0x188c91=_[_0x602e('0x33')](_0x247ce0);_0x188c91[_0x602e('0x64')](_0x59cc6e);return _0x188c91;}});}else{return;}})[_0x602e('0x2d')](function(_0x48a322){if(_0x48a322)_0x247ce0=_0x48a322;return _[_0x602e('0x45')](_0x247ce0,[_0x602e('0x6a'),0x1]);})[_0x602e('0x2d')](respondWithResult(_0x10ab6f,null))[_0x602e('0x4e')](handleError(_0x10ab6f,null));};function hasDefaultDashboard(_0x5ef61d){var _0x1c41d4=[0x65];return new BPromise(function(_0x11ee25,_0x3a49d5){try{if(_0x5ef61d[_0x602e('0x5b')]){_0x11ee25(_0x1c41d4);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x5ef61d['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x40520a){_0x40520a?_0x11ee25(_0x1c41d4):_0x11ee25();});}}catch(_0x5f12de){_0x3a49d5(_0x5f12de);}});}function getCustomDashboards(_0x5cd9ab){var _0x1e1e32=[];return new BPromise(function(_0x475638,_0x2360f2){try{if(_0x5cd9ab[_0x602e('0x5b')]){return db[_0x602e('0x6b')][_0x602e('0x4c')]({'raw':!![]})[_0x602e('0x2d')](function(_0x202a27){_0x202a27[_0x602e('0x6c')](function(_0x4b712b){_0x1e1e32[_0x602e('0x64')](_0x4b712b['id']+0x1869f);});_0x475638(_0x1e1e32);});}else{return db[_0x602e('0x60')]['findAll']({'where':{'sectionId':_0x5cd9ab['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x174ae5){_0x174ae5[_0x602e('0x6c')](function(_0x373b08){_0x1e1e32[_0x602e('0x64')](_0x373b08[_0x602e('0x6d')]+0x1869f);});_0x475638(_0x1e1e32);});}}catch(_0x5219f3){_0x2360f2(_0x5219f3);}});}function getPlugins(_0xfd4810){var _0x2c4f1b=[];return new BPromise(function(_0x50c945,_0x11fa9e){try{if(_0xfd4810[_0x602e('0x5b')]){return db[_0x602e('0x6e')]['findAll']({'raw':!![]})[_0x602e('0x2d')](function(_0x214d3d){_0x214d3d['forEach'](function(_0x28c73c){_0x2c4f1b[_0x602e('0x64')](_0x28c73c['id']+0x15b38);});_0x50c945(_0x2c4f1b);});}else{return db[_0x602e('0x60')]['findAll']({'where':{'sectionId':_0xfd4810['id']},'raw':!![]})[_0x602e('0x2d')](function(_0x5110bb){_0x5110bb['forEach'](function(_0x19470c){_0x2c4f1b[_0x602e('0x64')](_0x19470c[_0x602e('0x6d')]+0x15b38);});_0x50c945(_0x2c4f1b);});}}catch(_0x10d689){_0x11fa9e(_0x10d689);}});}exports[_0x602e('0x6f')]=function(_0x29f77f,_0x1f9c70){return db[_0x602e('0x34')]['find']({'where':{'id':_0x29f77f['params']['id']}})[_0x602e('0x2d')](handleEntityNotFound(_0x1f9c70,null))[_0x602e('0x2d')](function(_0x411d0f){if(_0x411d0f){return db[_0x602e('0x58')][_0x602e('0x59')](function(_0x1e0d34){return db[_0x602e('0x5a')][_0x602e('0x4c')]({'where':{'userProfileId':_0x29f77f[_0x602e('0x52')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x38b27a){if(_0x38b27a){return db['UserProfileSection'][_0x602e('0x2e')]({'where':{'userProfileId':_0x29f77f[_0x602e('0x52')]['id'],'id':_[_0x602e('0x33')](_0x38b27a,function(_0x22df11){return _0x22df11['id'];})},'transaction':_0x1e0d34});}})[_0x602e('0x2d')](function(_0x1ebd3c){var _0x233ac4=_['map'](_0x29f77f[_0x602e('0x50')],function(_0x2f2144){_0x2f2144[_0x602e('0x5d')]=_0x29f77f['params']['id'];return _0x2f2144;});return db[_0x602e('0x5a')][_0x602e('0x70')](_0x233ac4,{'raw':!![],'transaction':_0x1e0d34});})[_0x602e('0x2d')](function(_0x428c85){var _0x8688e0=_['filter'](_[_0x602e('0x33')](_0x428c85,function(_0x9641bc){return _0x9641bc[_0x602e('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x8688e0){return db[_0x602e('0x5a')][_0x602e('0x4c')]({'where':{'userProfileId':_0x29f77f['params']['id'],'sectionId':_['map'](_0x8688e0,function(_0x3034f4){return _0x3034f4[_0x602e('0x5c')];})},'attributes':['id',_0x602e('0x5c')],'raw':!![]})[_0x602e('0x2d')](function(_0x18e34d){var _0xf02d8f=_['map'](_0x29f77f['body'],function(_0x1abf1d){_0x1abf1d[_0x602e('0x5d')]=_0x29f77f[_0x602e('0x52')]['id'];return _0x1abf1d;});return db[_0x602e('0x60')]['bulkCreate'](_0xf02d8f,{'raw':!![],'transaction':_0x1e0d34});});}})['catch'](handleError(_0x1f9c70,null));});}})[_0x602e('0x2d')](function(_0x1bf6b3){var _0x32bcfb=_[_0x602e('0x33')](_0x1bf6b3,function(_0x3bde10){return _0x3bde10[_0x602e('0x53')]({'plain':!![]});});})[_0x602e('0x2d')](respondWithResult(_0x1f9c70,null))['catch'](handleError(_0x1f9c70,null));};exports['removeResources']=function(_0x2cd516,_0x54f538,_0x2d7193){return db['UserProfile'][_0x602e('0x4f')]({'where':{'id':_0x2cd516[_0x602e('0x52')]['id']}})[_0x602e('0x2d')](handleEntityNotFound(_0x54f538,null))[_0x602e('0x2d')](function(_0x70a42a){if(_0x70a42a){return _0x70a42a[_0x602e('0x71')](_0x2cd516[_0x602e('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x54f538,null))[_0x602e('0x4e')](handleError(_0x54f538,null));};exports['getResources']=function(_0x47bf50,_0x402020){var _0x2f1f24={};if(!_0x47bf50[_0x602e('0x38')][_0x602e('0x72')])throw new Error('Missing\x20section\x20parameter');if(!_0x47bf50[_0x602e('0x38')][_0x602e('0x40')](_0x602e('0x41'))){_0x2f1f24[_0x602e('0x25')]=qs[_0x602e('0x25')](_0x47bf50[_0x602e('0x38')][_0x602e('0x25')]);_0x2f1f24[_0x602e('0x23')]=qs[_0x602e('0x23')](_0x47bf50[_0x602e('0x38')][_0x602e('0x23')]);}return db['UserProfile'][_0x602e('0x4f')]({'where':{'id':_0x47bf50['params']['id']}})[_0x602e('0x2d')](function(_0x4482d1){if(!_0x4482d1)throw new Error(_0x602e('0x73')+_0x47bf50[_0x602e('0x52')]['id']);return db[_0x602e('0x34')][_0x602e('0x74')](_0x47bf50);})[_0x602e('0x2d')](respondWithFilteredResult(_0x402020,_0x2f1f24))[_0x602e('0x4e')](handleError(_0x402020,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 051cfbd..7a19a64 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 _0x27fb=['exports','events','../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','hook'];(function(_0x111b37,_0x1012aa){var _0x335dd0=function(_0x15d5bf){while(--_0x15d5bf){_0x111b37['push'](_0x111b37['shift']());}};_0x335dd0(++_0x1012aa);}(_0x27fb,0x1de));var _0xb27f=function(_0x4c7de1,_0x3f7bef){_0x4c7de1=_0x4c7de1-0x0;var _0x3f1864=_0x27fb[_0x4c7de1];return _0x3f1864;};'use strict';var EventEmitter=require(_0xb27f('0x0'));var UserProfile=require(_0xb27f('0x1'))['db'][_0xb27f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb27f('0x3'),'afterUpdate':'update','afterDestroy':_0xb27f('0x4')};function emitEvent(_0x111753){return function(_0xba5409,_0x5e0641,_0x403dc4){UserProfileEvents['emit'](_0x111753+':'+_0xba5409['id'],_0xba5409);UserProfileEvents[_0xb27f('0x5')](_0x111753,_0xba5409);_0x403dc4(null);};}for(var e in events){if(events[_0xb27f('0x6')](e)){var event=events[e];UserProfile[_0xb27f('0x7')](e,emitEvent(event));}}module[_0xb27f('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x71ab=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x4b2286,_0x20cfa5){var _0x2f32c2=function(_0x3e6efe){while(--_0x3e6efe){_0x4b2286['push'](_0x4b2286['shift']());}};_0x2f32c2(++_0x20cfa5);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xb71a('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb71a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb71a('0x2'),'afterDestroy':_0xb71a('0x3')};function emitEvent(_0x20fd9c){return function(_0x4094b2,_0x37ce74,_0x3c6438){UserProfileEvents[_0xb71a('0x4')](_0x20fd9c+':'+_0x4094b2['id'],_0x4094b2);UserProfileEvents[_0xb71a('0x4')](_0x20fd9c,_0x4094b2);_0x3c6438(null);};}for(var e in events){if(events[_0xb71a('0x5')](e)){var event=events[e];UserProfile[_0xb71a('0x6')](e,emitEvent(event));}}module[_0xb71a('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 611a1cf..8ca2a54 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 _0xdd51=['SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','ZohoAccount','Disposition','customdashboards','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','raw','mergeResources','isEmpty','length','push','find','params','all','union','ignore','autoAssociation','rawAttributes','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','findAll','then','map','catch','field','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','OpenchannelAccount','smsqueues'];(function(_0x4bc97d,_0x499a11){var _0x3282be=function(_0x1c142b){while(--_0x1c142b){_0x4bc97d['push'](_0x4bc97d['shift']());}};_0x3282be(++_0x499a11);}(_0xdd51,0x1ed));var _0x1dd5=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xdd51[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x1dd5('0x0'));var attributes=require(_0x1dd5('0x1'));var qs=require(_0x1dd5('0x2'));var squel=require('squel');module[_0x1dd5('0x3')]=function(_0x3b0a98){var _0x42cf9e=_0x3b0a98['models'];function _0x75fba5(_0xc47543,_0x3f10da){return new Promise(function(_0x3092fa,_0x484dbb){if(!_0x3f10da)return _0x3092fa(null);var _0x1074c0=_0x3f10da[_0x1dd5('0x4')]?{[_0x3f10da[_0x1dd5('0x4')]['field']]:_0x3f10da['filter']['value']}:undefined;return _0x42cf9e[_0xc47543][_0x1dd5('0x5')]({'where':_0x1074c0,'raw':!![]})[_0x1dd5('0x6')](function(_0x26c5c6){_0x3f10da['associatedResources']=_[_0x1dd5('0x7')](_0x26c5c6,'id');_0x3092fa(_0x3f10da);})[_0x1dd5('0x8')](function(_0x3ab76e){_0x484dbb(_0x3ab76e);});});}function _0x441aae(_0xbcbf9f,_0x3d40e4){return new Promise(function(_0x507508,_0x488e0c){var _0x1febf3=_0xbcbf9f[_0x1dd5('0x4')]?{[_0xbcbf9f[_0x1dd5('0x4')][_0x1dd5('0x9')]]:_0xbcbf9f['filter'][_0x1dd5('0xa')]}:undefined;return _0x42cf9e[_0xbcbf9f[_0x1dd5('0xb')]]['findAll']({'where':_0x1febf3,'raw':!![]})['then'](function(_0x3e378b){_0x3d40e4[_0x1dd5('0xc')]=_['map'](_0x3e378b,function(_0x56d460){return _0x56d460[_0x1dd5('0xd')];});_0x507508(_0x3d40e4);})['catch'](function(_0x43c6a8){_0x488e0c(_0x43c6a8);});});}function _0x249250(_0x397391,_0x1a8818,_0x165cec){if(!_0x1a8818)return Promise[_0x1dd5('0xe')](null);return new Promise(function(_0x2449db,_0x1a9258){return _0x42cf9e[_0x1dd5('0xf')]['findAll']({'where':{'sectionId':_0x1a8818['id']},'raw':!![]})['then'](function(_0x53a4b9){if(_0x397391[_0x1dd5('0x9')]&&_0x397391[_0x1dd5('0x9')]!=='id'){_0x1a8818[_0x1dd5('0xc')]=_['map'](_0x53a4b9,function(_0x1f87a5){return _0x1f87a5[_0x397391[_0x1dd5('0x9')]];});}else{if(_0x165cec===_0x1dd5('0x10')){_0x1a8818[_0x1dd5('0xc')]=_[_0x1dd5('0x7')](_0x53a4b9,function(_0x3076b7){return{'id':_0x3076b7[_0x1dd5('0x11')],'type':_0x3076b7[_0x1dd5('0x12')]};});}else{_0x1a8818[_0x1dd5('0xc')]=_['map'](_0x53a4b9,function(_0x47febe){return _0x47febe['resourceId'];});}}_0x2449db(_0x1a8818);})[_0x1dd5('0x8')](function(_0x3851fd){_0x1a9258(_0x3851fd);});});}function _0x5eaae7(_0x4a33d6,_0x1bdb99){var _0x36d228={'parentSections':[]};switch(_0x4a33d6[_0x1dd5('0x13')]()){case'squareprojects':_0x36d228[_0x1dd5('0x14')]='SquareProject';break;case _0x1dd5('0x15'):_0x36d228[_0x1dd5('0x14')]='SquareOdbc';break;case _0x1dd5('0x16'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x17');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x19'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x1a')}];break;case _0x1dd5('0x1b'):_0x36d228[_0x1dd5('0x14')]='JscriptyProject';break;case'contacts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x1c');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x1d'),'field':'id','foreignKey':_0x1dd5('0x1e')}];break;case _0x1dd5('0x1f'):_0x36d228['childModel']=_0x1dd5('0x20');break;case _0x1dd5('0x21'):_0x36d228['childModel']=_0x1dd5('0x22');break;case'globalcustomfields':_0x36d228['childModel']=_0x1dd5('0x23');break;case _0x1dd5('0x24'):_0x36d228[_0x1dd5('0x14')]='ChatQueue';break;case'chatwebsites':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x25');break;case _0x1dd5('0x26'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x27');break;case'faxaccounts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x28');break;case _0x1dd5('0x29'):case _0x1dd5('0x2a'):case'outboundroutes':_0x36d228['childModel']='VoiceExtension';break;case _0x1dd5('0x2b'):_0x36d228[_0x1dd5('0x14')]='VoiceContext';break;case'voicemails':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x2c');break;case _0x1dd5('0x2d'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x2e');_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x2f'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x30'),'model':_0x1dd5('0x31'),'filter':{'field':_0x1dd5('0x32'),'value':[_0x1dd5('0x33')]}},{'name':_0x1dd5('0x34'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x30'),'model':_0x1dd5('0x31'),'filter':{'field':_0x1dd5('0x32'),'value':[_0x1dd5('0x35')]}},{'name':_0x1dd5('0x36'),'field':_0x1dd5('0xd'),'foreignKey':'queue','model':_0x1dd5('0x37'),'filter':{'field':_0x1dd5('0x12'),'value':[_0x1dd5('0x38')]}},{'name':_0x1dd5('0x39'),'field':_0x1dd5('0xd'),'foreignKey':_0x1dd5('0x3a'),'model':_0x1dd5('0x37'),'filter':{'field':_0x1dd5('0x12'),'value':[_0x1dd5('0x3b')]}}];break;case _0x1dd5('0x3c'):_0x36d228['childModel']=_0x1dd5('0x3d');break;case _0x1dd5('0x3e'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x3f');break;case _0x1dd5('0x40'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x41');break;case _0x1dd5('0x42'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x43');break;case _0x1dd5('0x44'):_0x36d228[_0x1dd5('0x14')]='MailQueue';break;case _0x1dd5('0x45'):_0x36d228['childModel']=_0x1dd5('0x46');break;case _0x1dd5('0x47'):_0x36d228[_0x1dd5('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x36d228[_0x1dd5('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0x36d228['childModel']=_0x1dd5('0x48');break;case _0x1dd5('0x49'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4a');break;case _0x1dd5('0x4b'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4c');break;case'whatsappqueues':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4d');break;case _0x1dd5('0x4e'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x4f');break;case _0x1dd5('0x50'):_0x36d228['childModel']=_0x1dd5('0x51');break;case _0x1dd5('0x52'):case _0x1dd5('0x53'):_0x36d228[_0x1dd5('0x14')]='VoiceQueue';if(_0x1bdb99){_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x36')},{'name':_0x1dd5('0x39')}];}break;case _0x1dd5('0x54'):case'agents':case _0x1dd5('0x55'):_0x36d228[_0x1dd5('0x14')]='User';if(_0x1bdb99){_0x36d228[_0x1dd5('0x18')]=[{'name':_0x1dd5('0x56'),'filter':{'field':'role','value':[_0x1dd5('0x57'),_0x1dd5('0x58')]},'ignore':!![]},{'name':_0x1dd5('0x2f')},{'name':_0x1dd5('0x34')}];}break;case _0x1dd5('0x59'):_0x36d228[_0x1dd5('0x14')]='ZendeskAccount';break;case _0x1dd5('0x5a'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x5b');break;case _0x1dd5('0x5c'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x5d');break;case'sugarcrmaccounts':_0x36d228[_0x1dd5('0x14')]='SugarcrmAccount';break;case _0x1dd5('0x5e'):_0x36d228[_0x1dd5('0x14')]='DeskAccount';break;case'zohoaccounts':_0x36d228['childModel']=_0x1dd5('0x5f');break;case'vtigeraccounts':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x31');break;case'cannedanswers':_0x36d228['childModel']='CannedAnswer';break;case'dispositions':_0x36d228['childModel']=_0x1dd5('0x60');break;case _0x1dd5('0x61'):_0x36d228[_0x1dd5('0x14')]='Dashboard';break;case'intervals':_0x36d228['childModel']=_0x1dd5('0x62');break;case _0x1dd5('0x63'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x64');break;case'scheduler':_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x65');break;case _0x1dd5('0x66'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x67');break;case _0x1dd5('0x68'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x69');break;case _0x1dd5('0x6a'):_0x36d228['childModel']='Template';break;case _0x1dd5('0x6b'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x6c');break;case _0x1dd5('0x6d'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x6e');break;case _0x1dd5('0x6f'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x70');break;case _0x1dd5('0x71'):_0x36d228['childModel']=_0x1dd5('0x72');break;case _0x1dd5('0x73'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x10');_0x36d228['parentSections']=[{'name':_0x1dd5('0x74'),'field':'id','foreignKey':_0x1dd5('0x75')}];break;case _0x1dd5('0x76'):_0x36d228[_0x1dd5('0x14')]=_0x1dd5('0x77');break;}return _0x36d228;}function _0x496dc9(_0x75f93b,_0x3bc27a){var _0x5c7f62=_0x75f93b[_0x1dd5('0x78')](0x0)[_0x1dd5('0x79')]()+_0x75f93b[_0x1dd5('0x7a')](0x1);var _0x4a95fe={'type':_0x42cf9e[_0x1dd5('0x7b')]['QueryTypes'][_0x1dd5('0x7c')],'raw':!![]};return new Promise(function(_0x27ff98,_0x2b7453){var _0x326516=squel[_0x1dd5('0x7d')]()['field'](_0x1dd5('0x7e')+_0x5c7f62+_0x1dd5('0x7f'),'id')['field'](_0x1dd5('0x80'))[_0x1dd5('0x81')]('user_has_'+_0x75f93b+_0x1dd5('0x82'),'ui')[_0x1dd5('0x83')](_0x1dd5('0x84'),_0x3bc27a['id']);return _0x42cf9e[_0x1dd5('0x85')][_0x1dd5('0x86')](_0x326516['toString'](),_0x4a95fe)[_0x1dd5('0x6')](function(_0x4aaedd){_0x3bc27a[_0x5c7f62+_0x1dd5('0x87')]=_0x4aaedd;_0x27ff98(_0x4aaedd);})[_0x1dd5('0x8')](function(_0x17ae12){_0x2b7453(_0x17ae12);});});}return _0x3b0a98['define'](_0x1dd5('0x88'),attributes,{'tableName':_0x1dd5('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x54dc3e){var _0xa27821={'raw':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x8a')],'where':{}};var _0x22806b={};var _0x2e4d7a={'count':0x0,'rows':[]};var _0x482e27=_0x54dc3e[_0x1dd5('0x86')]['section'];var _0x1ac37f=_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x8b')]||![];var _0x517569=_0x5eaae7(_0x482e27,_0x1ac37f);if(!_0x517569['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x482e27+'\x27');var _0x36f0d9=[{'name':_0x482e27}];if(!_[_0x1dd5('0x8c')](_0x517569[_0x1dd5('0x18')]))_0x36f0d9=_0x517569[_0x1dd5('0x18')];var _0x40ba28=[];for(var _0x10ac44=0x0;_0x10ac44<_0x36f0d9[_0x1dd5('0x8d')];_0x10ac44++){_0x40ba28[_0x1dd5('0x8e')](_0x42cf9e['UserProfileSection'][_0x1dd5('0x8f')]({'where':{'userProfileId':_0x54dc3e[_0x1dd5('0x90')]['id'],'name':_0x36f0d9[_0x10ac44][_0x1dd5('0xd')]},'raw':!![]}));}return Promise[_0x1dd5('0x91')](_0x40ba28)[_0x1dd5('0x6')](function(_0x56aa6d){var _0x2c459f=_[_0x1dd5('0x4')](_0x56aa6d,function(_0x1f24c5){return _0x1f24c5?_0x1f24c5:undefined;});var _0x46d288=_[_0x1dd5('0x4')](_0x36f0d9,['ignore',!![]]);var _0x36e77f=_['isEmpty'](_0x2c459f)&&_['isEmpty'](_0x46d288)?null:_[_0x1dd5('0x92')](_0x46d288,_0x2c459f);if(!_0x36e77f)return null;var _0xfb6be0=[];for(var _0x519862=0x0;_0x519862<_0x36e77f['length'];_0x519862++){var _0x108aa8=_[_0x1dd5('0x8f')](_0x36f0d9,function(_0x357a79){return _0x36e77f[_0x519862]?_0x357a79[_0x1dd5('0xd')]===_0x36e77f[_0x519862][_0x1dd5('0xd')]:null;});if(_0x108aa8){if(_0x36e77f[_0x519862][_0x1dd5('0x93')]){_0xfb6be0[_0x1dd5('0x8e')](_0x75fba5(_0x517569[_0x1dd5('0x14')],_0x36e77f[_0x519862]));}else{if(!_0x36e77f[_0x519862][_0x1dd5('0x94')]){_0xfb6be0[_0x1dd5('0x8e')](_0x249250(_0x108aa8,_0x36e77f[_0x519862],_0x517569[_0x1dd5('0x14')]));}else{if(_0x108aa8[_0x1dd5('0xb')]){_0xfb6be0[_0x1dd5('0x8e')](_0x441aae(_0x108aa8,_0x36e77f[_0x519862]));}}}}}return Promise[_0x1dd5('0x91')](_0xfb6be0);})['then'](function(_0x363239){var _0x60dff=_0x363239;var _0xba936c=null;if(_0x60dff){_0xba936c=_0x60dff[_0x1dd5('0x8d')]===0x1?_0x60dff[0x0]:null;}if(!_0xba936c&&!_0x60dff)return _0x2e4d7a;var _0x39ba37=_0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0x95')];_0x22806b['model']=_[_0x1dd5('0x96')](_0x39ba37);_0x22806b['query']=_[_0x1dd5('0x96')](_0x54dc3e[_0x1dd5('0x86')]);_0x22806b['filters']=_['intersection'](_0x22806b[_0x1dd5('0xb')],_0x22806b['query']);_0xa27821[_0x1dd5('0x97')]=_[_0x1dd5('0x98')](_0x22806b[_0x1dd5('0xb')],qs['fields'](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x99')]));_0xa27821[_0x1dd5('0x97')]=_0xa27821[_0x1dd5('0x97')]['length']?_0xa27821['attributes']:_0x22806b[_0x1dd5('0xb')];if(!_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9a')](_0x1dd5('0x9b'))){_0xa27821[_0x1dd5('0x9c')]=qs['limit'](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9c')]);_0xa27821[_0x1dd5('0x9d')]=qs[_0x1dd5('0x9d')](_0x54dc3e[_0x1dd5('0x86')]['offset']);}_0xa27821[_0x1dd5('0x9e')]=qs[_0x1dd5('0x9f')](_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x9f')]);_0xa27821[_0x1dd5('0x83')]=qs[_0x1dd5('0xa0')](_[_0x1dd5('0xa1')](_0x54dc3e[_0x1dd5('0x86')],_0x22806b[_0x1dd5('0xa0')]));if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x4')]){_0xa27821[_0x1dd5('0x83')]=_[_0x1dd5('0xa2')](_0xa27821[_0x1dd5('0x83')],{'$or':_['map'](_0x39ba37,function(_0x556967){if(_0x556967[_0x1dd5('0x12')][_0x1dd5('0xa3')]!==_0x1dd5('0xa4')){var _0x9a09ea={};_0x9a09ea[_0x556967[_0x1dd5('0x9')]]={'$like':'%'+_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0x4')]+'%'};return _0x9a09ea;}})});}var _0x13bcf9=[];var _0x227c00=null;var _0x13e3f9={};if(_0xba936c){_0x227c00=_[_0x1dd5('0x8f')](_0x36f0d9,[_0x1dd5('0xd'),_0xba936c[_0x1dd5('0xd')]]);if(_0x227c00[_0x1dd5('0x9')]){_0x13e3f9={};if(_0x517569['childModel']===_0x1dd5('0x10')){_0x13e3f9[_0x227c00[_0x1dd5('0xa5')]]=_[_0x1dd5('0x7')](_0xba936c[_0x1dd5('0xc')],'id');}else{_0x13e3f9[_0x227c00[_0x1dd5('0xa5')]]=_0xba936c[_0x1dd5('0xc')];}_0x13bcf9[_0x1dd5('0x8e')](_0x13e3f9);}else{_0xa27821[_0x1dd5('0x83')]['id']=_0xba936c[_0x1dd5('0xc')];}}else{for(var _0x192020=0x0;_0x192020<_0x60dff[_0x1dd5('0x8d')];_0x192020++){_0x227c00=_[_0x1dd5('0x8f')](_0x36f0d9,[_0x1dd5('0xd'),_0x60dff[_0x192020][_0x1dd5('0xd')]]);if(_0x227c00[_0x1dd5('0x9')]){_0x13e3f9={};_0x13e3f9[_0x227c00['foreignKey']]=_0x60dff[_0x192020][_0x1dd5('0xc')];_0x13bcf9[_0x1dd5('0x8e')](_0x13e3f9);}else{if(!_0xa27821[_0x1dd5('0x83')]['id'])_0xa27821[_0x1dd5('0x83')]['id']=[];_0x60dff[_0x192020][_0x1dd5('0xc')][_0x1dd5('0xa6')](function(_0x4c7340){_0xa27821['where']['id'][_0x1dd5('0x8e')](_0x4c7340);});}}}if(!_[_0x1dd5('0x8c')](_0x13bcf9)){_0xa27821[_0x1dd5('0x83')]=_[_0x1dd5('0xa2')](_0xa27821[_0x1dd5('0x83')],{'$and':{'$or':_0x13bcf9}});}_0xa27821=_[_0x1dd5('0xa2')]({},_0xa27821,_0x54dc3e[_0x1dd5('0xa7')]);if(_0xba936c&&!_0xba936c[_0x1dd5('0x94')]&&_0x517569['childModel']==='AnalyticExtractedReport'){if(_0x54dc3e['query'][_0x1dd5('0xa8')]){_0xa27821[_0x1dd5('0xa9')]=[{'all':!![]}];}return _0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0x5')](_0xa27821)['then'](function(_0x26e526){var _0x294119=[];_0x26e526[_0x1dd5('0xa6')](function(_0x5ecec0){var _0x5cd4a3;switch(_0x5ecec0[_0x1dd5('0xaa')]){case _0x1dd5('0xab'):_0x5cd4a3=_[_0x1dd5('0x8f')](_0xba936c[_0x1dd5('0xc')],function(_0x463c77){return _0x463c77['id']===_0x5ecec0[_0x1dd5('0x75')]&&_0x463c77[_0x1dd5('0x12')]===_0x1dd5('0xac');});break;case _0x1dd5('0xad'):_0x5cd4a3=_[_0x1dd5('0x8f')](_0xba936c[_0x1dd5('0xc')],function(_0xf52bf3){return _0xf52bf3['id']===_0x5ecec0[_0x1dd5('0x75')]&&_0xf52bf3[_0x1dd5('0x12')]==='CustomReports';});break;}if(_0x5cd4a3)_0x294119['push'](_0x5ecec0);});_0x2e4d7a['count']=_0x294119['length'];_0x2e4d7a[_0x1dd5('0xae')]=_0x294119;return _0x2e4d7a;});}else{if(!_[_0x1dd5('0x8c')](_0x54dc3e['query']['ids'])){_0xa27821[_0x1dd5('0x83')]['id']=_0xa27821[_0x1dd5('0x83')]['id']?_[_0x1dd5('0x98')](_0xa27821[_0x1dd5('0x83')]['id'],_0x54dc3e['query'][_0x1dd5('0xaf')]):_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xaf')];if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb0')]){_0xa27821[_0x1dd5('0x9e')]=_0x54dc3e[_0x1dd5('0x86')]['customSorting'];}}if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb1')]){_0xa27821[_0x1dd5('0x83')]=_['merge'](_0xa27821[_0x1dd5('0x83')],{'$and':_0x54dc3e['query'][_0x1dd5('0xb1')]});}return _0x42cf9e[_0x517569[_0x1dd5('0x14')]][_0x1dd5('0xb2')]({'where':_0xa27821['where']})[_0x1dd5('0x6')](function(_0x3c6dfa){_0x2e4d7a['count']=_0x3c6dfa;if(_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xa8')]){if(_0x517569[_0x1dd5('0x14')]==='CmContact'){_0xa27821[_0x1dd5('0xa9')]=[{'model':_0x42cf9e[_0x1dd5('0x69')],'as':'Tags','attributes':['id',_0x1dd5('0xd'),_0x1dd5('0xb3')],'required':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb4')]?!![]:![]},{'model':_0x42cf9e['Tag'],'as':_0x1dd5('0xb5'),'attributes':['id',_0x1dd5('0xd'),'color'],'through':_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb4')]?{'attributes':[],'where':{'TagId':_0x54dc3e['query'][_0x1dd5('0xb4')]||undefined}}:{},'required':_0x54dc3e['query']['tag']?!![]:![]}];}else{_0xa27821[_0x1dd5('0xa9')]=[{'all':!![]}];}}return _0x42cf9e[_0x517569['childModel']][_0x1dd5('0x5')](_0xa27821);})[_0x1dd5('0x6')](function(_0x3585a5){_0x2e4d7a[_0x1dd5('0xae')]=_0x3585a5;if(_0x482e27===_0x1dd5('0x2f')&&_0x54dc3e[_0x1dd5('0x86')][_0x1dd5('0xb6')]==='true'){var _0x2f67b4=[];for(var _0x29a751=0x0;_0x29a751<_0x2e4d7a[_0x1dd5('0xae')][_0x1dd5('0x8d')];_0x29a751++){_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xb7'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xb9'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751]['dataValues']));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xba'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9('mail',_0x2e4d7a['rows'][_0x29a751]['dataValues']));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xbb'),_0x2e4d7a['rows'][_0x29a751][_0x1dd5('0xb8')]));_0x2f67b4[_0x1dd5('0x8e')](_0x496dc9(_0x1dd5('0xbc'),_0x2e4d7a[_0x1dd5('0xae')][_0x29a751][_0x1dd5('0xb8')]));}return Promise[_0x1dd5('0x91')](_0x2f67b4)[_0x1dd5('0x6')](function(){return _0x2e4d7a;});}return _0x2e4d7a;});}});}}});}; \ No newline at end of file +var _0x2ce4=['intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','forEach','includeAll','include','default','DefaultReports','custom','reportId','CustomReports','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','value','then','associatedResources','map','catch','model','findAll','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','User','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','metrics','slice','Sequelize','QueryTypes','SELECT','select','ui.','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','push','UserProfileSection','find','params','all','ignore','isEmpty','union','length','autoAssociation','keys','filters'];(function(_0x4f980f,_0x5c4a5e){var _0x2a4a5e=function(_0x49885d){while(--_0x49885d){_0x4f980f['push'](_0x4f980f['shift']());}};_0x2a4a5e(++_0x5c4a5e);}(_0x2ce4,0xe7));var _0x42ce=function(_0x2ccf79,_0x579b4b){_0x2ccf79=_0x2ccf79-0x0;var _0x512a6b=_0x2ce4[_0x2ccf79];return _0x512a6b;};'use strict';var _=require(_0x42ce('0x0'));var attributes=require(_0x42ce('0x1'));var qs=require(_0x42ce('0x2'));var squel=require(_0x42ce('0x3'));module[_0x42ce('0x4')]=function(_0x3ed170){var _0x4306b3=_0x3ed170['models'];function _0x87003b(_0x5c3fbe,_0x409a6a){return new Promise(function(_0x335be1,_0x5d838d){if(!_0x409a6a)return _0x335be1(null);var _0x23d019=_0x409a6a[_0x42ce('0x5')]?{[_0x409a6a[_0x42ce('0x5')][_0x42ce('0x6')]]:_0x409a6a[_0x42ce('0x5')][_0x42ce('0x7')]}:undefined;return _0x4306b3[_0x5c3fbe]['findAll']({'where':_0x23d019,'raw':!![]})[_0x42ce('0x8')](function(_0xef3680){_0x409a6a[_0x42ce('0x9')]=_[_0x42ce('0xa')](_0xef3680,'id');_0x335be1(_0x409a6a);})[_0x42ce('0xb')](function(_0x1caf60){_0x5d838d(_0x1caf60);});});}function _0x23349a(_0x2e2b61,_0x5113c7){return new Promise(function(_0x52c426,_0x44edd3){var _0x454ae1=_0x2e2b61[_0x42ce('0x5')]?{[_0x2e2b61['filter'][_0x42ce('0x6')]]:_0x2e2b61[_0x42ce('0x5')]['value']}:undefined;return _0x4306b3[_0x2e2b61[_0x42ce('0xc')]][_0x42ce('0xd')]({'where':_0x454ae1,'raw':!![]})[_0x42ce('0x8')](function(_0xe2e578){_0x5113c7[_0x42ce('0x9')]=_[_0x42ce('0xa')](_0xe2e578,function(_0x97bec){return _0x97bec[_0x42ce('0xe')];});_0x52c426(_0x5113c7);})[_0x42ce('0xb')](function(_0x4f4724){_0x44edd3(_0x4f4724);});});}function _0x3d9ed4(_0x4a1be5,_0x317cd8,_0xaa51cb){if(!_0x317cd8)return Promise['resolve'](null);return new Promise(function(_0x45df60,_0x310024){return _0x4306b3[_0x42ce('0xf')][_0x42ce('0xd')]({'where':{'sectionId':_0x317cd8['id']},'raw':!![]})[_0x42ce('0x8')](function(_0x4fc7c1){if(_0x4a1be5['field']&&_0x4a1be5[_0x42ce('0x6')]!=='id'){_0x317cd8[_0x42ce('0x9')]=_[_0x42ce('0xa')](_0x4fc7c1,function(_0x1dfc85){return _0x1dfc85[_0x4a1be5[_0x42ce('0x6')]];});}else{if(_0xaa51cb===_0x42ce('0x10')){_0x317cd8['associatedResources']=_[_0x42ce('0xa')](_0x4fc7c1,function(_0x48d234){return{'id':_0x48d234[_0x42ce('0x11')],'type':_0x48d234[_0x42ce('0x12')]};});}else{_0x317cd8[_0x42ce('0x9')]=_[_0x42ce('0xa')](_0x4fc7c1,function(_0x4d04e9){return _0x4d04e9[_0x42ce('0x11')];});}}_0x45df60(_0x317cd8);})[_0x42ce('0xb')](function(_0x43c801){_0x310024(_0x43c801);});});}function _0x5f13f5(_0x24258e,_0x5927f3){var _0x4c679a={'parentSections':[]};switch(_0x24258e['toLowerCase']()){case _0x42ce('0x13'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x15');break;case _0x42ce('0x16'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x17');break;case'squarerecordings':_0x4c679a[_0x42ce('0x14')]='SquareRecording';_0x4c679a[_0x42ce('0x18')]=[{'name':_0x42ce('0x19'),'field':_0x42ce('0xe'),'foreignKey':_0x42ce('0x1a')}];break;case _0x42ce('0x1b'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x1c');break;case _0x42ce('0x1d'):_0x4c679a['childModel']='CmContact';_0x4c679a[_0x42ce('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x42ce('0x1e')}];break;case'lists':_0x4c679a['childModel']=_0x42ce('0x1f');break;case _0x42ce('0x20'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x21');break;case'globalcustomfields':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x22');break;case _0x42ce('0x23'):_0x4c679a[_0x42ce('0x14')]='ChatQueue';break;case'chatwebsites':_0x4c679a['childModel']=_0x42ce('0x24');break;case _0x42ce('0x25'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x26');break;case'faxaccounts':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x27');break;case _0x42ce('0x28'):case _0x42ce('0x29'):case'outboundroutes':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x2a');break;case _0x42ce('0x2b'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x2c');break;case _0x42ce('0x2d'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x2e');break;case'voicerecordings':_0x4c679a['childModel']=_0x42ce('0x2f');_0x4c679a[_0x42ce('0x18')]=[{'name':_0x42ce('0x30'),'field':_0x42ce('0xe'),'foreignKey':_0x42ce('0x31'),'model':'User','filter':{'field':_0x42ce('0x32'),'value':[_0x42ce('0x33')]}},{'name':_0x42ce('0x34'),'field':_0x42ce('0xe'),'foreignKey':_0x42ce('0x31'),'model':'User','filter':{'field':_0x42ce('0x32'),'value':[_0x42ce('0x35')]}},{'name':_0x42ce('0x36'),'field':_0x42ce('0xe'),'foreignKey':'queue','model':_0x42ce('0x37'),'filter':{'field':_0x42ce('0x12'),'value':[_0x42ce('0x38')]}},{'name':_0x42ce('0x39'),'field':_0x42ce('0xe'),'foreignKey':_0x42ce('0x3a'),'model':_0x42ce('0x37'),'filter':{'field':'type','value':[_0x42ce('0x3b')]}}];break;case'musiconholds':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x3c');break;case _0x42ce('0x3d'):_0x4c679a['childModel']=_0x42ce('0x3e');break;case'voiceprefixes':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x3f');break;case _0x42ce('0x40'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x41');break;case _0x42ce('0x42'):_0x4c679a['childModel']=_0x42ce('0x43');break;case _0x42ce('0x44'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x45');break;case _0x42ce('0x46'):_0x4c679a[_0x42ce('0x14')]='MailSubstatus';break;case _0x42ce('0x47'):_0x4c679a[_0x42ce('0x14')]='OpenchannelQueue';break;case _0x42ce('0x48'):_0x4c679a['childModel']='OpenchannelAccount';break;case'smsqueues':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x49');break;case _0x42ce('0x4a'):_0x4c679a['childModel']=_0x42ce('0x4b');break;case _0x42ce('0x4c'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x4d');break;case _0x42ce('0x4e'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x4f');break;case _0x42ce('0x50'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x51');break;case'voicequeues':case _0x42ce('0x52'):_0x4c679a['childModel']=_0x42ce('0x37');if(_0x5927f3){_0x4c679a[_0x42ce('0x18')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0x42ce('0x53'):case _0x42ce('0x54'):_0x4c679a[_0x42ce('0x14')]='User';if(_0x5927f3){_0x4c679a[_0x42ce('0x18')]=[{'name':_0x42ce('0x55'),'filter':{'field':'role','value':[_0x42ce('0x56'),'user']},'ignore':!![]},{'name':_0x42ce('0x30')},{'name':_0x42ce('0x34')}];}break;case _0x42ce('0x57'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x58');break;case _0x42ce('0x59'):_0x4c679a[_0x42ce('0x14')]='SalesforceAccount';break;case _0x42ce('0x5a'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x5b');break;case _0x42ce('0x5c'):_0x4c679a[_0x42ce('0x14')]='SugarcrmAccount';break;case _0x42ce('0x5d'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x5e');break;case _0x42ce('0x5f'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x60');break;case _0x42ce('0x61'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x62');break;case'cannedanswers':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x63');break;case _0x42ce('0x64'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x65');break;case _0x42ce('0x66'):_0x4c679a['childModel']=_0x42ce('0x67');break;case _0x42ce('0x68'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x69');break;case _0x42ce('0x6a'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x6b');break;case _0x42ce('0x6c'):_0x4c679a['childModel']=_0x42ce('0x6d');break;case _0x42ce('0x6e'):_0x4c679a[_0x42ce('0x14')]='Sound';break;case _0x42ce('0x6f'):_0x4c679a['childModel']=_0x42ce('0x70');break;case'templates':_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x71');break;case _0x42ce('0x72'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x73');break;case _0x42ce('0x74'):_0x4c679a['childModel']=_0x42ce('0x75');break;case _0x42ce('0x76'):_0x4c679a[_0x42ce('0x14')]=_0x42ce('0x77');break;case'plugins':_0x4c679a['childModel']=_0x42ce('0x78');break;case _0x42ce('0x79'):_0x4c679a[_0x42ce('0x14')]='AnalyticExtractedReport';_0x4c679a[_0x42ce('0x18')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x42ce('0x7a'):_0x4c679a['childModel']='AnalyticMetric';break;}return _0x4c679a;}function _0x34d8a1(_0x1ba155,_0x175c37){var _0x1b58b8=_0x1ba155['charAt'](0x0)['toUpperCase']()+_0x1ba155[_0x42ce('0x7b')](0x1);var _0x13fe01={'type':_0x4306b3[_0x42ce('0x7c')][_0x42ce('0x7d')][_0x42ce('0x7e')],'raw':!![]};return new Promise(function(_0x189256,_0x1485a3){var _0x1b8cbe=squel[_0x42ce('0x7f')]()[_0x42ce('0x6')](_0x42ce('0x80')+_0x1b58b8+'InteractionId','id')[_0x42ce('0x6')]('ui.createdAt')[_0x42ce('0x81')]('user_has_'+_0x1ba155+_0x42ce('0x82'),'ui')[_0x42ce('0x83')](_0x42ce('0x84'),_0x175c37['id']);return _0x4306b3[_0x42ce('0x85')][_0x42ce('0x86')](_0x1b8cbe[_0x42ce('0x87')](),_0x13fe01)[_0x42ce('0x8')](function(_0x44d0e8){_0x175c37[_0x1b58b8+_0x42ce('0x88')]=_0x44d0e8;_0x189256(_0x44d0e8);})['catch'](function(_0x591dd7){_0x1485a3(_0x591dd7);});});}return _0x3ed170[_0x42ce('0x89')](_0x42ce('0x8a'),attributes,{'tableName':_0x42ce('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x296d36){var _0x5043a2={'raw':_0x296d36[_0x42ce('0x86')]['raw'],'where':{}};var _0x35ace3={};var _0x4fa49d={'count':0x0,'rows':[]};var _0x1951d2=_0x296d36[_0x42ce('0x86')][_0x42ce('0x8c')];var _0x3646e9=_0x296d36[_0x42ce('0x86')][_0x42ce('0x8d')]||![];var _0x1d8131=_0x5f13f5(_0x1951d2,_0x3646e9);if(!_0x1d8131[_0x42ce('0x14')])throw new Error(_0x42ce('0x8e')+_0x1951d2+'\x27');var _0x4717f3=[{'name':_0x1951d2}];if(!_['isEmpty'](_0x1d8131[_0x42ce('0x18')]))_0x4717f3=_0x1d8131[_0x42ce('0x18')];var _0x423d8b=[];for(var _0x3a9f7a=0x0;_0x3a9f7a<_0x4717f3['length'];_0x3a9f7a++){_0x423d8b[_0x42ce('0x8f')](_0x4306b3[_0x42ce('0x90')][_0x42ce('0x91')]({'where':{'userProfileId':_0x296d36[_0x42ce('0x92')]['id'],'name':_0x4717f3[_0x3a9f7a][_0x42ce('0xe')]},'raw':!![]}));}return Promise[_0x42ce('0x93')](_0x423d8b)['then'](function(_0x256f50){var _0xe22c5a=_['filter'](_0x256f50,function(_0x22881c){return _0x22881c?_0x22881c:undefined;});var _0xf2b59e=_[_0x42ce('0x5')](_0x4717f3,[_0x42ce('0x94'),!![]]);var _0x579a6a=_[_0x42ce('0x95')](_0xe22c5a)&&_[_0x42ce('0x95')](_0xf2b59e)?null:_[_0x42ce('0x96')](_0xf2b59e,_0xe22c5a);if(!_0x579a6a)return null;var _0x28d5e9=[];for(var _0x322597=0x0;_0x322597<_0x579a6a[_0x42ce('0x97')];_0x322597++){var _0x3575b6=_[_0x42ce('0x91')](_0x4717f3,function(_0xcaeb31){return _0x579a6a[_0x322597]?_0xcaeb31[_0x42ce('0xe')]===_0x579a6a[_0x322597][_0x42ce('0xe')]:null;});if(_0x3575b6){if(_0x579a6a[_0x322597][_0x42ce('0x94')]){_0x28d5e9[_0x42ce('0x8f')](_0x87003b(_0x1d8131[_0x42ce('0x14')],_0x579a6a[_0x322597]));}else{if(!_0x579a6a[_0x322597][_0x42ce('0x98')]){_0x28d5e9[_0x42ce('0x8f')](_0x3d9ed4(_0x3575b6,_0x579a6a[_0x322597],_0x1d8131[_0x42ce('0x14')]));}else{if(_0x3575b6[_0x42ce('0xc')]){_0x28d5e9[_0x42ce('0x8f')](_0x23349a(_0x3575b6,_0x579a6a[_0x322597]));}}}}}return Promise[_0x42ce('0x93')](_0x28d5e9);})['then'](function(_0xc61d19){var _0xb0b9da=_0xc61d19;var _0x188485=null;if(_0xb0b9da){_0x188485=_0xb0b9da[_0x42ce('0x97')]===0x1?_0xb0b9da[0x0]:null;}if(!_0x188485&&!_0xb0b9da)return _0x4fa49d;var _0x3669f5=_0x4306b3[_0x1d8131['childModel']]['rawAttributes'];_0x35ace3[_0x42ce('0xc')]=_[_0x42ce('0x99')](_0x3669f5);_0x35ace3[_0x42ce('0x86')]=_[_0x42ce('0x99')](_0x296d36['query']);_0x35ace3[_0x42ce('0x9a')]=_[_0x42ce('0x9b')](_0x35ace3[_0x42ce('0xc')],_0x35ace3[_0x42ce('0x86')]);_0x5043a2[_0x42ce('0x9c')]=_[_0x42ce('0x9b')](_0x35ace3[_0x42ce('0xc')],qs[_0x42ce('0x9d')](_0x296d36[_0x42ce('0x86')][_0x42ce('0x9d')]));_0x5043a2[_0x42ce('0x9c')]=_0x5043a2[_0x42ce('0x9c')][_0x42ce('0x97')]?_0x5043a2['attributes']:_0x35ace3[_0x42ce('0xc')];if(!_0x296d36[_0x42ce('0x86')][_0x42ce('0x9e')](_0x42ce('0x9f'))){_0x5043a2[_0x42ce('0xa0')]=qs[_0x42ce('0xa0')](_0x296d36[_0x42ce('0x86')][_0x42ce('0xa0')]);_0x5043a2[_0x42ce('0xa1')]=qs[_0x42ce('0xa1')](_0x296d36[_0x42ce('0x86')][_0x42ce('0xa1')]);}_0x5043a2[_0x42ce('0xa2')]=qs[_0x42ce('0xa3')](_0x296d36[_0x42ce('0x86')][_0x42ce('0xa3')]);_0x5043a2[_0x42ce('0x83')]=qs[_0x42ce('0x9a')](_[_0x42ce('0xa4')](_0x296d36['query'],_0x35ace3['filters']));if(_0x296d36['query'][_0x42ce('0x5')]){_0x5043a2[_0x42ce('0x83')]=_[_0x42ce('0xa5')](_0x5043a2[_0x42ce('0x83')],{'$or':_[_0x42ce('0xa')](_0x3669f5,function(_0x2d2f60){if(_0x2d2f60[_0x42ce('0x12')][_0x42ce('0xa6')]!=='VIRTUAL'){var _0x593fa9={};_0x593fa9[_0x2d2f60[_0x42ce('0x6')]]={'$like':'%'+_0x296d36[_0x42ce('0x86')]['filter']+'%'};return _0x593fa9;}})});}var _0x1b9d14=[];var _0x19de42=null;var _0x6e2052={};if(_0x188485){_0x19de42=_[_0x42ce('0x91')](_0x4717f3,['name',_0x188485[_0x42ce('0xe')]]);if(_0x19de42[_0x42ce('0x6')]){_0x6e2052={};if(_0x1d8131[_0x42ce('0x14')]===_0x42ce('0x10')){_0x6e2052[_0x19de42[_0x42ce('0xa7')]]=_[_0x42ce('0xa')](_0x188485['associatedResources'],'id');}else{_0x6e2052[_0x19de42[_0x42ce('0xa7')]]=_0x188485['associatedResources'];}_0x1b9d14['push'](_0x6e2052);}else{_0x5043a2[_0x42ce('0x83')]['id']=_0x188485[_0x42ce('0x9')];}}else{for(var _0x1b47ae=0x0;_0x1b47ae<_0xb0b9da[_0x42ce('0x97')];_0x1b47ae++){_0x19de42=_[_0x42ce('0x91')](_0x4717f3,['name',_0xb0b9da[_0x1b47ae]['name']]);if(_0x19de42[_0x42ce('0x6')]){_0x6e2052={};_0x6e2052[_0x19de42['foreignKey']]=_0xb0b9da[_0x1b47ae][_0x42ce('0x9')];_0x1b9d14[_0x42ce('0x8f')](_0x6e2052);}else{if(!_0x5043a2[_0x42ce('0x83')]['id'])_0x5043a2['where']['id']=[];_0xb0b9da[_0x1b47ae]['associatedResources'][_0x42ce('0xa8')](function(_0x17ee11){_0x5043a2[_0x42ce('0x83')]['id'][_0x42ce('0x8f')](_0x17ee11);});}}}if(!_['isEmpty'](_0x1b9d14)){_0x5043a2[_0x42ce('0x83')]=_[_0x42ce('0xa5')](_0x5043a2[_0x42ce('0x83')],{'$and':{'$or':_0x1b9d14}});}_0x5043a2=_[_0x42ce('0xa5')]({},_0x5043a2,_0x296d36['options']);if(_0x188485&&!_0x188485[_0x42ce('0x98')]&&_0x1d8131['childModel']===_0x42ce('0x10')){if(_0x296d36[_0x42ce('0x86')][_0x42ce('0xa9')]){_0x5043a2[_0x42ce('0xaa')]=[{'all':!![]}];}return _0x4306b3[_0x1d8131['childModel']][_0x42ce('0xd')](_0x5043a2)[_0x42ce('0x8')](function(_0x41fcd3){var _0x2b9e47=[];_0x41fcd3[_0x42ce('0xa8')](function(_0x15f0d1){var _0x19af3c;switch(_0x15f0d1['reportType']){case _0x42ce('0xab'):_0x19af3c=_[_0x42ce('0x91')](_0x188485[_0x42ce('0x9')],function(_0x2adeac){return _0x2adeac['id']===_0x15f0d1['reportId']&&_0x2adeac[_0x42ce('0x12')]===_0x42ce('0xac');});break;case _0x42ce('0xad'):_0x19af3c=_[_0x42ce('0x91')](_0x188485[_0x42ce('0x9')],function(_0x30e04f){return _0x30e04f['id']===_0x15f0d1[_0x42ce('0xae')]&&_0x30e04f[_0x42ce('0x12')]===_0x42ce('0xaf');});break;}if(_0x19af3c)_0x2b9e47[_0x42ce('0x8f')](_0x15f0d1);});_0x4fa49d['count']=_0x2b9e47[_0x42ce('0x97')];_0x4fa49d[_0x42ce('0xb0')]=_0x2b9e47;return _0x4fa49d;});}else{if(!_['isEmpty'](_0x296d36['query'][_0x42ce('0xb1')])){_0x5043a2[_0x42ce('0x83')]['id']=_0x5043a2['where']['id']?_[_0x42ce('0x9b')](_0x5043a2[_0x42ce('0x83')]['id'],_0x296d36['query']['ids']):_0x296d36[_0x42ce('0x86')][_0x42ce('0xb1')];if(_0x296d36[_0x42ce('0x86')][_0x42ce('0xb2')]){_0x5043a2[_0x42ce('0xa2')]=_0x296d36[_0x42ce('0x86')]['customSorting'];}}if(_0x296d36['query'][_0x42ce('0xb3')]){_0x5043a2[_0x42ce('0x83')]=_[_0x42ce('0xa5')](_0x5043a2['where'],{'$and':_0x296d36[_0x42ce('0x86')][_0x42ce('0xb3')]});}return _0x4306b3[_0x1d8131['childModel']][_0x42ce('0xb4')]({'where':_0x5043a2[_0x42ce('0x83')]})[_0x42ce('0x8')](function(_0x531ae4){_0x4fa49d[_0x42ce('0xb4')]=_0x531ae4;if(_0x296d36['query'][_0x42ce('0xa9')]){if(_0x1d8131[_0x42ce('0x14')]===_0x42ce('0xb5')){_0x5043a2[_0x42ce('0xaa')]=[{'model':_0x4306b3[_0x42ce('0x70')],'as':_0x42ce('0xb6'),'attributes':['id',_0x42ce('0xe'),'color'],'required':_0x296d36['query'][_0x42ce('0xb7')]?!![]:![]},{'model':_0x4306b3['Tag'],'as':'ThroughTags','attributes':['id','name','color'],'through':_0x296d36[_0x42ce('0x86')][_0x42ce('0xb7')]?{'attributes':[],'where':{'TagId':_0x296d36[_0x42ce('0x86')][_0x42ce('0xb7')]||undefined}}:{},'required':_0x296d36['query'][_0x42ce('0xb7')]?!![]:![]}];}else{_0x5043a2[_0x42ce('0xaa')]=[{'all':!![]}];}}return _0x4306b3[_0x1d8131[_0x42ce('0x14')]]['findAll'](_0x5043a2);})[_0x42ce('0x8')](function(_0x1b3a3c){_0x4fa49d[_0x42ce('0xb0')]=_0x1b3a3c;if(_0x1951d2==='Agents'&&_0x296d36[_0x42ce('0x86')][_0x42ce('0xb8')]===_0x42ce('0xb9')){var _0x5939ab=[];for(var _0x1244da=0x0;_0x1244da<_0x4fa49d['rows'][_0x42ce('0x97')];_0x1244da++){_0x5939ab['push'](_0x34d8a1(_0x42ce('0xba'),_0x4fa49d[_0x42ce('0xb0')][_0x1244da][_0x42ce('0xbb')]));_0x5939ab[_0x42ce('0x8f')](_0x34d8a1(_0x42ce('0xbc'),_0x4fa49d[_0x42ce('0xb0')][_0x1244da][_0x42ce('0xbb')]));_0x5939ab[_0x42ce('0x8f')](_0x34d8a1(_0x42ce('0xbd'),_0x4fa49d['rows'][_0x1244da]['dataValues']));_0x5939ab['push'](_0x34d8a1(_0x42ce('0xbe'),_0x4fa49d[_0x42ce('0xb0')][_0x1244da][_0x42ce('0xbb')]));_0x5939ab[_0x42ce('0x8f')](_0x34d8a1(_0x42ce('0xbf'),_0x4fa49d[_0x42ce('0xb0')][_0x1244da][_0x42ce('0xbb')]));_0x5939ab[_0x42ce('0x8f')](_0x34d8a1(_0x42ce('0xc0'),_0x4fa49d['rows'][_0x1244da]['dataValues']));}return Promise[_0x42ce('0x93')](_0x5939ab)['then'](function(){return _0x4fa49d;});}return _0x4fa49d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 03f8d85..75388d9 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 _0x1c63=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1826f7,_0x5c7c64){var _0x3bcebf=function(_0x5f4577){while(--_0x5f4577){_0x1826f7['push'](_0x1826f7['shift']());}};_0x3bcebf(++_0x5c7c64);}(_0x1c63,0xdc));var _0x31c6=function(_0x508a0a,_0x3ed316){_0x508a0a=_0x508a0a-0x0;var _0x4acf06=_0x1c63[_0x508a0a];return _0x4acf06;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x31c6('0xc')],{'host':_0x31c6('0xd'),'port':0x18eb});var socket=require(_0x31c6('0xe'))(new Redis(config[_0x31c6('0xc')]));require(_0x31c6('0xf'))['register'](socket);function respondWithRpcPromise(_0x731d0f,_0x1172bb,_0xb21602){return new BPromise(function(_0x2ee25a,_0x45466b){return client['request'](_0x731d0f,_0xb21602)[_0x31c6('0x10')](function(_0x4d02f1){logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x1172bb,'request\x20sent');logger[_0x31c6('0x13')](_0x31c6('0x14'),_0x1172bb,_0x31c6('0x15'),JSON[_0x31c6('0x16')](_0x4d02f1));if(_0x4d02f1[_0x31c6('0x17')]){if(_0x4d02f1[_0x31c6('0x17')]['code']===0x1f4){logger[_0x31c6('0x17')](_0x31c6('0x12'),_0x1172bb,_0x4d02f1[_0x31c6('0x17')][_0x31c6('0x18')]);return _0x45466b(_0x4d02f1[_0x31c6('0x17')]['message']);}logger['error']('UserProfile,\x20%s,\x20%s',_0x1172bb,_0x4d02f1['error'][_0x31c6('0x18')]);return _0x2ee25a(_0x4d02f1['error'][_0x31c6('0x18')]);}else{logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x1172bb,_0x31c6('0x15'));_0x2ee25a(_0x4d02f1[_0x31c6('0x19')][_0x31c6('0x18')]);}})[_0x31c6('0x1a')](function(_0x2fd91f){logger['error']('UserProfile,\x20%s,\x20%s',_0x1172bb,_0x2fd91f);_0x45466b(_0x2fd91f);});});} \ No newline at end of file +var _0x29eb=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x138ac4,_0x1decf7){var _0x52b740=function(_0x2684b9){while(--_0x2684b9){_0x138ac4['push'](_0x138ac4['shift']());}};_0x52b740(++_0x1decf7);}(_0x29eb,0x1c5));var _0xb29e=function(_0x4e2f41,_0x23d23e){_0x4e2f41=_0x4e2f41-0x0;var _0x4a5bc7=_0x29eb[_0x4e2f41];return _0x4a5bc7;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var moment=require(_0xb29e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb29e('0x3'));var fs=require('fs');var Redis=require(_0xb29e('0x4'));var db=require(_0xb29e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb29e('0x6'))('rpc');var config=require(_0xb29e('0x7'));var jayson=require(_0xb29e('0x8'));var client=jayson[_0xb29e('0x9')][_0xb29e('0xa')]({'port':0x232a});config[_0xb29e('0xb')]=_[_0xb29e('0xc')](config['redis'],{'host':_0xb29e('0xd'),'port':0x18eb});var socket=require(_0xb29e('0xe'))(new Redis(config[_0xb29e('0xb')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x12eebb,_0x521d07,_0x57d868){return new BPromise(function(_0x3844ef,_0x449db2){return client['request'](_0x12eebb,_0x57d868)[_0xb29e('0xf')](function(_0x2dc3d7){logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));logger['debug'](_0xb29e('0x13'),_0x521d07,'request\x20sent',JSON['stringify'](_0x2dc3d7));if(_0x2dc3d7['error']){if(_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x15')]===0x1f4){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')][_0xb29e('0x16')]);return _0x449db2(_0x2dc3d7['error'][_0xb29e('0x16')]);}logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x2dc3d7[_0xb29e('0x14')]['message']);return _0x3844ef(_0x2dc3d7['error'][_0xb29e('0x16')]);}else{logger[_0xb29e('0x10')](_0xb29e('0x11'),_0x521d07,_0xb29e('0x12'));_0x3844ef(_0x2dc3d7[_0xb29e('0x17')][_0xb29e('0x16')]);}})[_0xb29e('0x18')](function(_0x33f51f){logger[_0xb29e('0x14')](_0xb29e('0x11'),_0x521d07,_0x33f51f);_0x449db2(_0x33f51f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4f65540..f036980 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 _0xf24f=['userProfile:','save','remove','update','register'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf24f,0x1dc));var _0xff24=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xf24f[_0x41cfd4];return _0x190f48;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xff24('0x0'),_0xff24('0x1'),_0xff24('0x2')];function createListener(_0xdf8524,_0x45ac9c){return function(_0x358a18){_0x45ac9c['emit'](_0xdf8524,_0x358a18);};}function removeListener(_0x408bb0,_0x21ee44){return function(){UserProfileEvents['removeListener'](_0x408bb0,_0x21ee44);};}exports[_0xff24('0x3')]=function(_0x32b089){for(var _0x2d8c2b=0x0,_0x5d5fdf=events['length'];_0x2d8c2b<_0x5d5fdf;_0x2d8c2b++){var _0x4f2a8d=events[_0x2d8c2b];var _0x2a6dfc=createListener(_0xff24('0x4')+_0x4f2a8d,_0x32b089);UserProfileEvents['on'](_0x4f2a8d,_0x2a6dfc);}}; \ No newline at end of file +var _0xecc6=['length','userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0xecc6,0x1f1));var _0x6ecc=function(_0x248f2a,_0x583207){_0x248f2a=_0x248f2a-0x0;var _0x39699f=_0xecc6[_0x248f2a];return _0x39699f;};'use strict';var UserProfileEvents=require(_0x6ecc('0x0'));var events=[_0x6ecc('0x1'),_0x6ecc('0x2'),_0x6ecc('0x3')];function createListener(_0x2228f3,_0x2d2d5f){return function(_0x1998b3){_0x2d2d5f[_0x6ecc('0x4')](_0x2228f3,_0x1998b3);};}function removeListener(_0x1f920c,_0x5ccbee){return function(){UserProfileEvents[_0x6ecc('0x5')](_0x1f920c,_0x5ccbee);};}exports[_0x6ecc('0x6')]=function(_0x51d817){for(var _0x3817f5=0x0,_0x582d00=events[_0x6ecc('0x7')];_0x3817f5<_0x582d00;_0x3817f5++){var _0x2c52f6=events[_0x3817f5];var _0x531e78=createListener(_0x6ecc('0x8')+_0x2c52f6,_0x51d817);UserProfileEvents['on'](_0x2c52f6,_0x531e78);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d58cbec..494a051 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 _0xf7c7=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','/describe','isAuthenticated','describe','get','/:id','create','update','delete','destroy','exports','multer'];(function(_0x28a534,_0x52af08){var _0x4e24c5=function(_0x5307d5){while(--_0x5307d5){_0x28a534['push'](_0x28a534['shift']());}};_0x4e24c5(++_0x52af08);}(_0xf7c7,0x7d));var _0x7f7c=function(_0xa6c407,_0x178882){_0xa6c407=_0xa6c407-0x0;var _0x5c5753=_0xf7c7[_0xa6c407];return _0x5c5753;};'use strict';var multer=require(_0x7f7c('0x0'));var util=require('util');var path=require(_0x7f7c('0x1'));var timeout=require(_0x7f7c('0x2'));var express=require(_0x7f7c('0x3'));var router=express['Router']();var fs_extra=require(_0x7f7c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7f7c('0x5'));var config=require(_0x7f7c('0x6'));var controller=require(_0x7f7c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7f7c('0x8'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0xa')]);router[_0x7f7c('0xb')](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7f7c('0xd')]);router['put'](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0xe')]);router[_0x7f7c('0xf')](_0x7f7c('0xc'),auth[_0x7f7c('0x9')](),controller[_0x7f7c('0x10')]);module[_0x7f7c('0x11')]=router; \ No newline at end of file +var _0x7b51=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5dede5,_0x257504){var _0x488f14=function(_0x3e0e76){while(--_0x3e0e76){_0x5dede5['push'](_0x5dede5['shift']());}};_0x488f14(++_0x257504);}(_0x7b51,0xcb));var _0x17b5=function(_0x39d481,_0x468019){_0x39d481=_0x39d481-0x0;var _0x510b49=_0x7b51[_0x39d481];return _0x510b49;};'use strict';var multer=require(_0x17b5('0x0'));var util=require(_0x17b5('0x1'));var path=require(_0x17b5('0x2'));var timeout=require(_0x17b5('0x3'));var express=require(_0x17b5('0x4'));var router=express[_0x17b5('0x5')]();var fs_extra=require(_0x17b5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x17b5('0x7'));var config=require(_0x17b5('0x8'));var controller=require(_0x17b5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x17b5('0xa')]);router[_0x17b5('0xb')](_0x17b5('0xc'),auth[_0x17b5('0xd')](),controller[_0x17b5('0xe')]);router[_0x17b5('0xb')](_0x17b5('0xf'),auth[_0x17b5('0xd')](),controller[_0x17b5('0x10')]);router[_0x17b5('0x11')]('/',auth[_0x17b5('0xd')](),controller['create']);router[_0x17b5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x17b5('0x13')]);router[_0x17b5('0x14')](_0x17b5('0xf'),auth[_0x17b5('0xd')](),controller[_0x17b5('0x15')]);module[_0x17b5('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 180243a..09fefe0 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 _0x84fc=['exports','STRING'];(function(_0x3fd152,_0x42ddaf){var _0xcfc148=function(_0xc6c072){while(--_0xc6c072){_0x3fd152['push'](_0x3fd152['shift']());}};_0xcfc148(++_0x42ddaf);}(_0x84fc,0x18a));var _0xc84f=function(_0x5316d3,_0x5cba98){_0x5316d3=_0x5316d3-0x0;var _0x27d9fa=_0x84fc[_0x5316d3];return _0x27d9fa;};'use strict';var Sequelize=require('sequelize');module[_0xc84f('0x0')]={'name':{'type':Sequelize[_0xc84f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xc84f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5e56=['STRING','INTEGER','sequelize','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5e56,0x13a));var _0x65e5=function(_0x510846,_0x1c3142){_0x510846=_0x510846-0x0;var _0x149314=_0x5e56[_0x510846];return _0x149314;};'use strict';var Sequelize=require(_0x65e5('0x0'));module[_0x65e5('0x1')]={'name':{'type':Sequelize[_0x65e5('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x65e5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x65e5('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 96ab8a6..92ac8e6 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0xe98589,_0x1b3c02){var _0x496299=function(_0x887dcb){while(--_0x887dcb){_0xe98589['push'](_0xe98589['shift']());}};_0x496299(++_0x1b3c02);}(_0x2542,0x169));var _0x2254=function(_0x27c2b0,_0x38833){_0x27c2b0=_0x27c2b0-0x0;var _0x50817c=_0x2542[_0x27c2b0];return _0x50817c;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['UserProfileResource'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};exports[_0x2254('0x4d')]=function(_0x4ba6ef,_0x4cc18a){return db[_0x2254('0x2c')][_0x2254('0x4d')]()['then'](respondWithResult(_0x4cc18a,null))[_0x2254('0x45')](handleError(_0x4cc18a,null));}; \ No newline at end of file +var _0xdb28=['index','UserProfileResource','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','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'];(function(_0x48cac8,_0x150d03){var _0x539232=function(_0x2fe472){while(--_0x2fe472){_0x48cac8['push'](_0x48cac8['shift']());}};_0x539232(++_0x150d03);}(_0xdb28,0x106));var _0x8db2=function(_0x1d0379,_0x47e9e5){_0x1d0379=_0x1d0379-0x0;var _0x3e68dd=_0xdb28[_0x1d0379];return _0x3e68dd;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};exports[_0x8db2('0x4b')]=function(_0x426ae0,_0x3bc632){return db[_0x8db2('0x2b')][_0x8db2('0x4b')]()[_0x8db2('0x24')](respondWithResult(_0x3bc632,null))[_0x8db2('0x42')](handleError(_0x3bc632,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 7c4f877..b3b0ae4 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 _0xde04=['user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','moment','request-promise','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xde04,0xe0));var _0x4de0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde04[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4de0('0x0'));var util=require(_0x4de0('0x1'));var logger=require(_0x4de0('0x2'))('api');var moment=require(_0x4de0('0x3'));var BPromise=require('bluebird');var rp=require(_0x4de0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4de0('0x5'));var config=require('../../config/environment');var attributes=require(_0x4de0('0x6'));module[_0x4de0('0x7')]=function(_0x464a80,_0x561f9a){return _0x464a80[_0x4de0('0x8')](_0x4de0('0x9'),attributes,{'tableName':_0x4de0('0xa'),'paranoid':![],'indexes':[{'name':_0x4de0('0xb'),'fields':[_0x4de0('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e52=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','moment'];(function(_0x4260dc,_0x52b1f4){var _0x2ea010=function(_0x3c8e5c){while(--_0x3c8e5c){_0x4260dc['push'](_0x4260dc['shift']());}};_0x2ea010(++_0x52b1f4);}(_0x8e52,0x1dc));var _0x28e5=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x8e52[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x28e5('0x0'));var util=require(_0x28e5('0x1'));var logger=require('../../config/logger')(_0x28e5('0x2'));var moment=require(_0x28e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x28e5('0x4'));var fs=require('fs');var path=require(_0x28e5('0x5'));var rimraf=require(_0x28e5('0x6'));var config=require(_0x28e5('0x7'));var attributes=require(_0x28e5('0x8'));module[_0x28e5('0x9')]=function(_0xf64e40,_0x4706cb){return _0xf64e40[_0x28e5('0xa')](_0x28e5('0xb'),attributes,{'tableName':_0x28e5('0xc'),'paranoid':![],'indexes':[{'name':_0x28e5('0xd'),'fields':[_0x28e5('0xe'),_0x28e5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 1dd2b06..01cd461 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 _0xb055=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x12382f,_0x81f0dd){var _0x5e4733=function(_0x54b1cf){while(--_0x54b1cf){_0x12382f['push'](_0x12382f['shift']());}};_0x5e4733(++_0x81f0dd);}(_0xb055,0x18b));var _0x5b05=function(_0x14d5f9,_0x391035){_0x14d5f9=_0x14d5f9-0x0;var _0x8dbbef=_0xb055[_0x14d5f9];return _0x8dbbef;};'use strict';var _=require(_0x5b05('0x0'));var util=require(_0x5b05('0x1'));var moment=require(_0x5b05('0x2'));var BPromise=require(_0x5b05('0x3'));var rs=require(_0x5b05('0x4'));var fs=require('fs');var Redis=require(_0x5b05('0x5'));var db=require(_0x5b05('0x6'))['db'];var utils=require(_0x5b05('0x7'));var logger=require(_0x5b05('0x8'))('rpc');var config=require(_0x5b05('0x9'));var jayson=require(_0x5b05('0xa'));var client=jayson[_0x5b05('0xb')][_0x5b05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26f58a,_0x1341d6,_0xfe2bbd){return new BPromise(function(_0x1f8402,_0x1879c0){return client['request'](_0x26f58a,_0xfe2bbd)[_0x5b05('0xd')](function(_0x167669){logger[_0x5b05('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x1341d6,_0x5b05('0xf'));logger[_0x5b05('0x10')](_0x5b05('0x11'),_0x1341d6,_0x5b05('0xf'),JSON[_0x5b05('0x12')](_0x167669));if(_0x167669[_0x5b05('0x13')]){if(_0x167669['error'][_0x5b05('0x14')]===0x1f4){logger['error'](_0x5b05('0x15'),_0x1341d6,_0x167669[_0x5b05('0x13')]['message']);return _0x1879c0(_0x167669[_0x5b05('0x13')][_0x5b05('0x16')]);}logger[_0x5b05('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1341d6,_0x167669[_0x5b05('0x13')][_0x5b05('0x16')]);return _0x1f8402(_0x167669[_0x5b05('0x13')]['message']);}else{logger[_0x5b05('0xe')](_0x5b05('0x15'),_0x1341d6,_0x5b05('0xf'));_0x1f8402(_0x167669[_0x5b05('0x17')]['message']);}})[_0x5b05('0x18')](function(_0x16e837){logger[_0x5b05('0x13')](_0x5b05('0x15'),_0x1341d6,_0x16e837);_0x1879c0(_0x16e837);});});} \ No newline at end of file +var _0xd817=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x381af0,_0xd1c294){var _0x5ad7b2=function(_0x2d10d8){while(--_0x2d10d8){_0x381af0['push'](_0x381af0['shift']());}};_0x5ad7b2(++_0xd1c294);}(_0xd817,0xce));var _0x7d81=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0xd817[_0x4a9fb7];return _0x40b90e;};'use strict';var _=require(_0x7d81('0x0'));var util=require(_0x7d81('0x1'));var moment=require(_0x7d81('0x2'));var BPromise=require(_0x7d81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d81('0x4'));var db=require(_0x7d81('0x5'))['db'];var utils=require(_0x7d81('0x6'));var logger=require(_0x7d81('0x7'))(_0x7d81('0x8'));var config=require(_0x7d81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d81('0xa')][_0x7d81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3716b4,_0x4559ce,_0x3d97e0){return new BPromise(function(_0x1c22cf,_0x5045b1){return client[_0x7d81('0xc')](_0x3716b4,_0x3d97e0)[_0x7d81('0xd')](function(_0x363883){logger[_0x7d81('0xe')](_0x7d81('0xf'),_0x4559ce,_0x7d81('0x10'));logger[_0x7d81('0x11')](_0x7d81('0x12'),_0x4559ce,_0x7d81('0x10'),JSON[_0x7d81('0x13')](_0x363883));if(_0x363883[_0x7d81('0x14')]){if(_0x363883[_0x7d81('0x14')][_0x7d81('0x15')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x4559ce,_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);return _0x5045b1(_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);}logger[_0x7d81('0x14')](_0x7d81('0xf'),_0x4559ce,_0x363883[_0x7d81('0x14')][_0x7d81('0x16')]);return _0x1c22cf(_0x363883['error'][_0x7d81('0x16')]);}else{logger[_0x7d81('0xe')](_0x7d81('0xf'),_0x4559ce,_0x7d81('0x10'));_0x1c22cf(_0x363883[_0x7d81('0x17')][_0x7d81('0x16')]);}})[_0x7d81('0x18')](function(_0x526a99){logger[_0x7d81('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x4559ce,_0x526a99);_0x5045b1(_0x526a99);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index bbb0300..5967e74 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 _0x6ddb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','path'];(function(_0x5afd24,_0x165b99){var _0x2bc0b6=function(_0xcc8d55){while(--_0xcc8d55){_0x5afd24['push'](_0x5afd24['shift']());}};_0x2bc0b6(++_0x165b99);}(_0x6ddb,0x155));var _0xb6dd=function(_0x4c0f69,_0x448095){_0x4c0f69=_0x4c0f69-0x0;var _0x5e6765=_0x6ddb[_0x4c0f69];return _0x5e6765;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb6dd('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb6dd('0x1')]();var fs_extra=require(_0xb6dd('0x2'));var auth=require(_0xb6dd('0x3'));var interaction=require(_0xb6dd('0x4'));var config=require(_0xb6dd('0x5'));var controller=require(_0xb6dd('0x6'));router[_0xb6dd('0x7')]('/',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x9')]);router[_0xb6dd('0x7')]('/describe',auth[_0xb6dd('0x8')](),controller['describe']);router[_0xb6dd('0x7')]('/:id',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xa')]);router[_0xb6dd('0xb')]('/',auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xc')]);router[_0xb6dd('0xd')](_0xb6dd('0xe'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0xf')]);router['delete'](_0xb6dd('0xe'),auth[_0xb6dd('0x8')](),controller[_0xb6dd('0x10')]);module[_0xb6dd('0x11')]=router; \ No newline at end of file +var _0xa583=['destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete'];(function(_0x41c27e,_0x2620ae){var _0x4990e3=function(_0x186946){while(--_0x186946){_0x41c27e['push'](_0x41c27e['shift']());}};_0x4990e3(++_0x2620ae);}(_0xa583,0x6d));var _0x3a58=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa583[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x3a58('0x0'));var util=require(_0x3a58('0x1'));var path=require(_0x3a58('0x2'));var timeout=require(_0x3a58('0x3'));var express=require(_0x3a58('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3a58('0x5'));var interaction=require(_0x3a58('0x6'));var config=require('../../config/environment');var controller=require(_0x3a58('0x7'));router[_0x3a58('0x8')]('/',auth[_0x3a58('0x9')](),controller[_0x3a58('0xa')]);router[_0x3a58('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3a58('0xb')]);router['get'](_0x3a58('0xc'),auth[_0x3a58('0x9')](),controller[_0x3a58('0xd')]);router[_0x3a58('0xe')]('/',auth[_0x3a58('0x9')](),controller['create']);router[_0x3a58('0xf')](_0x3a58('0xc'),auth[_0x3a58('0x9')](),controller['update']);router[_0x3a58('0x10')](_0x3a58('0xc'),auth[_0x3a58('0x9')](),controller[_0x3a58('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index d98d302..2226864 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 _0x0713=['getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x2545e5,_0x430b52){var _0x353ced=function(_0x3f22d2){while(--_0x3f22d2){_0x2545e5['push'](_0x2545e5['shift']());}};_0x353ced(++_0x430b52);}(_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':![]},'category':{'type':Sequelize[_0x3071('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2c547f){this[_0x3071('0x3')](_0x3071('0x4'),_0x2c547f?_0x2c547f[_0x3071('0x5')](''):[]);},'get':function(){return this[_0x3071('0x6')](_0x3071('0x4'))?this[_0x3071('0x6')](_0x3071('0x4'))[_0x3071('0x7')](''):[];}}}; \ No newline at end of file +var _0xeb74=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x148d93,_0x9ad96a){var _0x3e143a=function(_0x56cd9a){while(--_0x56cd9a){_0x148d93['push'](_0x148d93['shift']());}};_0x3e143a(++_0x9ad96a);}(_0xeb74,0xe3));var _0x4eb7=function(_0x3fd068,_0x4f7b57){_0x3fd068=_0x3fd068-0x0;var _0x2497b2=_0xeb74[_0x3fd068];return _0x2497b2;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4eb7('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4eb7('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x35c7ca){this[_0x4eb7('0x5')](_0x4eb7('0x6'),_0x35c7ca?_0x35c7ca[_0x4eb7('0x7')](''):[]);},'get':function(){return this[_0x4eb7('0x8')]('crudPermissions')?this[_0x4eb7('0x8')]('crudPermissions')[_0x4eb7('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 0c3aacc..ca7e5e7 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 _0x6914=['sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','send','index','map','UserProfileSection','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6914,0x154));var _0x4691=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6914[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x4691('0x0'));var rimraf=require(_0x4691('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4691('0x2'));var moment=require(_0x4691('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4691('0x4'));var util=require(_0x4691('0x5'));var path=require(_0x4691('0x6'));var sox=require(_0x4691('0x7'));var csv=require(_0x4691('0x8'));var ejs=require(_0x4691('0x9'));var fs=require('fs');var fs_extra=require(_0x4691('0xa'));var _=require(_0x4691('0xb'));var squel=require(_0x4691('0xc'));var crypto=require(_0x4691('0xd'));var jsforce=require(_0x4691('0xe'));var deskjs=require(_0x4691('0xf'));var toCsv=require(_0x4691('0x8'));var querystring=require(_0x4691('0x10'));var Papa=require(_0x4691('0x11'));var Redis=require(_0x4691('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4691('0x13'));var hardwareService=require(_0x4691('0x14'));var logger=require('../../config/logger')(_0x4691('0x15'));var utils=require(_0x4691('0x16'));var config=require(_0x4691('0x17'));var licenseUtil=require(_0x4691('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469cef,_0x1af0d2){_0x1af0d2=_0x1af0d2||0xcc;return function(_0x4a1be1){if(_0x4a1be1){return _0x469cef[_0x4691('0x19')](_0x1af0d2);}return _0x469cef['status'](_0x1af0d2)['end']();};}function respondWithResult(_0x49e6e0,_0x1a7e0d){_0x1a7e0d=_0x1a7e0d||0xc8;return function(_0x29b622){if(_0x29b622){return _0x49e6e0[_0x4691('0x1a')](_0x1a7e0d)[_0x4691('0x1b')](_0x29b622);}};}function respondWithFilteredResult(_0x4ee1cf,_0x395250){return function(_0x1c49cb){if(_0x1c49cb){var _0x252979=typeof _0x395250[_0x4691('0x1c')]===_0x4691('0x1d')&&typeof _0x395250[_0x4691('0x1e')]==='undefined';var _0x3364c9=_0x1c49cb[_0x4691('0x1f')];var _0x448d71=_0x252979?0x0:_0x395250[_0x4691('0x1c')];var _0x181f1d=_0x252979?_0x1c49cb['count']:_0x395250[_0x4691('0x1c')]+_0x395250[_0x4691('0x1e')];var _0x305734;if(_0x181f1d>=_0x3364c9){_0x181f1d=_0x3364c9;_0x305734=0xc8;}else{_0x305734=0xce;}_0x4ee1cf[_0x4691('0x1a')](_0x305734);return _0x4ee1cf[_0x4691('0x20')]('Content-Range',_0x448d71+'-'+_0x181f1d+'/'+_0x3364c9)['json'](_0x1c49cb);}return null;};}function patchUpdates(_0x50ac1c){return function(_0x2732cf){try{jsonpatch[_0x4691('0x21')](_0x2732cf,_0x50ac1c,!![]);}catch(_0x16bd71){return BPromise['reject'](_0x16bd71);}return _0x2732cf[_0x4691('0x22')]();};}function saveUpdates(_0x35a53b,_0x24b22c){return function(_0x4e5073){if(_0x4e5073){return _0x4e5073[_0x4691('0x23')](_0x35a53b)['then'](function(_0x2c4412){return _0x2c4412;});}return null;};}function removeEntity(_0x2456f1,_0x436560){return function(_0x357b0c){if(_0x357b0c){return _0x357b0c['destroy']()[_0x4691('0x24')](function(){_0x2456f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3848f5,_0x26f528){return function(_0x142036){if(!_0x142036){_0x3848f5[_0x4691('0x19')](0x194);}return _0x142036;};}function handleError(_0x13eb22,_0x12d924){_0x12d924=_0x12d924||0x1f4;return function(_0x5b5ae8){logger[_0x4691('0x25')](_0x5b5ae8['stack']);if(_0x5b5ae8['name']){delete _0x5b5ae8[_0x4691('0x26')];}_0x13eb22[_0x4691('0x1a')](_0x12d924)[_0x4691('0x27')](_0x5b5ae8);};}exports[_0x4691('0x28')]=function(_0x14e148,_0x44ec5a){var _0x1e46ad={},_0x565200={},_0x41f331={'count':0x0,'rows':[]};var _0x4a0f36=_[_0x4691('0x29')](db[_0x4691('0x2a')][_0x4691('0x2b')],function(_0x30e128){return{'name':_0x30e128['fieldName'],'type':_0x30e128['type'][_0x4691('0x2c')]};});_0x565200['model']=_['map'](_0x4a0f36,_0x4691('0x26'));_0x565200[_0x4691('0x2d')]=_['keys'](_0x14e148[_0x4691('0x2d')]);_0x565200[_0x4691('0x2e')]=_[_0x4691('0x2f')](_0x565200['model'],_0x565200[_0x4691('0x2d')]);_0x1e46ad['attributes']=_[_0x4691('0x2f')](_0x565200[_0x4691('0x30')],qs[_0x4691('0x31')](_0x14e148[_0x4691('0x2d')]['fields']));_0x1e46ad[_0x4691('0x32')]=_0x1e46ad[_0x4691('0x32')][_0x4691('0x33')]?_0x1e46ad[_0x4691('0x32')]:_0x565200[_0x4691('0x30')];if(!_0x14e148[_0x4691('0x2d')][_0x4691('0x34')](_0x4691('0x35'))){_0x1e46ad[_0x4691('0x1e')]=qs['limit'](_0x14e148[_0x4691('0x2d')][_0x4691('0x1e')]);_0x1e46ad[_0x4691('0x1c')]=qs[_0x4691('0x1c')](_0x14e148[_0x4691('0x2d')]['offset']);}_0x1e46ad['order']=qs[_0x4691('0x36')](_0x14e148[_0x4691('0x2d')][_0x4691('0x36')]);_0x1e46ad[_0x4691('0x37')]=qs['filters'](_[_0x4691('0x38')](_0x14e148[_0x4691('0x2d')],_0x565200[_0x4691('0x2e')]),_0x4a0f36);if(_0x14e148['query']['filter']){_0x1e46ad['where']=_[_0x4691('0x39')](_0x1e46ad['where'],{'$or':_[_0x4691('0x29')](_0x4a0f36,function(_0x358b4c){if(_0x358b4c[_0x4691('0x3a')]!=='VIRTUAL'){var _0x2b2e11={};_0x2b2e11[_0x358b4c[_0x4691('0x26')]]={'$like':'%'+_0x14e148[_0x4691('0x2d')][_0x4691('0x3b')]+'%'};return _0x2b2e11;}})});}_0x1e46ad=_[_0x4691('0x39')]({},_0x1e46ad,_0x14e148[_0x4691('0x3c')]);var _0x14acc1={'where':_0x1e46ad[_0x4691('0x37')]};return db[_0x4691('0x2a')][_0x4691('0x1f')](_0x14acc1)[_0x4691('0x24')](function(_0x3faacd){_0x41f331['count']=_0x3faacd;if(_0x14e148['query'][_0x4691('0x3d')]){_0x1e46ad['include']=[{'all':!![]}];}return db[_0x4691('0x2a')][_0x4691('0x3e')](_0x1e46ad);})['then'](function(_0x59eb8c){_0x41f331[_0x4691('0x3f')]=_0x59eb8c;return _0x41f331;})[_0x4691('0x24')](respondWithFilteredResult(_0x44ec5a,_0x1e46ad))[_0x4691('0x40')](handleError(_0x44ec5a,null));};exports[_0x4691('0x41')]=function(_0x406eaa,_0xdb2097){var _0x146d90={'raw':![],'where':{'id':_0x406eaa['params']['id']}},_0x25e63d={};_0x25e63d['model']=_['keys'](db[_0x4691('0x2a')][_0x4691('0x2b')]);_0x25e63d['query']=_[_0x4691('0x42')](_0x406eaa[_0x4691('0x2d')]);_0x25e63d['filters']=_[_0x4691('0x2f')](_0x25e63d[_0x4691('0x30')],_0x25e63d[_0x4691('0x2d')]);_0x146d90[_0x4691('0x32')]=_[_0x4691('0x2f')](_0x25e63d[_0x4691('0x30')],qs['fields'](_0x406eaa[_0x4691('0x2d')][_0x4691('0x31')]));_0x146d90[_0x4691('0x32')]=_0x146d90[_0x4691('0x32')]['length']?_0x146d90[_0x4691('0x32')]:_0x25e63d[_0x4691('0x30')];if(_0x406eaa[_0x4691('0x2d')][_0x4691('0x3d')]){_0x146d90['include']=[{'all':!![]}];}_0x146d90=_[_0x4691('0x39')]({},_0x146d90,_0x406eaa[_0x4691('0x3c')]);return db[_0x4691('0x2a')][_0x4691('0x43')](_0x146d90)['then'](handleEntityNotFound(_0xdb2097,null))[_0x4691('0x24')](respondWithResult(_0xdb2097,null))[_0x4691('0x40')](handleError(_0xdb2097,null));};exports[_0x4691('0x44')]=function(_0x3ab48b,_0x28c7fc){return db[_0x4691('0x2a')][_0x4691('0x44')](_0x3ab48b[_0x4691('0x45')],{})[_0x4691('0x24')](respondWithResult(_0x28c7fc,0xc9))[_0x4691('0x40')](handleError(_0x28c7fc,null));};exports['update']=function(_0x24873d,_0x3663ac){if(_0x24873d[_0x4691('0x45')]['id']){delete _0x24873d[_0x4691('0x45')]['id'];}return db[_0x4691('0x2a')][_0x4691('0x43')]({'where':{'id':_0x24873d[_0x4691('0x46')]['id']}})[_0x4691('0x24')](handleEntityNotFound(_0x3663ac,null))[_0x4691('0x24')](saveUpdates(_0x24873d['body'],null))['then'](respondWithResult(_0x3663ac,null))[_0x4691('0x40')](handleError(_0x3663ac,null));};exports[_0x4691('0x47')]=function(_0x5d8c06,_0x4eb7b1){return db[_0x4691('0x2a')][_0x4691('0x43')]({'where':{'id':_0x5d8c06[_0x4691('0x46')]['id']}})[_0x4691('0x24')](handleEntityNotFound(_0x4eb7b1,null))[_0x4691('0x24')](removeEntity(_0x4eb7b1,null))['catch'](handleError(_0x4eb7b1,null));};exports[_0x4691('0x48')]=function(_0xed2246,_0x1a8190){return db[_0x4691('0x2a')][_0x4691('0x48')]()[_0x4691('0x24')](respondWithResult(_0x1a8190,null))[_0x4691('0x40')](handleError(_0x1a8190,null));}; \ No newline at end of file +var _0xa6ea=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','then','end','error','stack','name','send','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','destroy','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x46d20f,_0x326507){var _0x5da3bd=function(_0x13a61c){while(--_0x13a61c){_0x46d20f['push'](_0x46d20f['shift']());}};_0x5da3bd(++_0x326507);}(_0xa6ea,0x1b1));var _0xaa6e=function(_0x2b0dd5,_0xab9369){_0x2b0dd5=_0x2b0dd5-0x0;var _0x26f4ae=_0xa6ea[_0x2b0dd5];return _0x26f4ae;};'use strict';var emlformat=require(_0xaa6e('0x0'));var rimraf=require(_0xaa6e('0x1'));var zipdir=require(_0xaa6e('0x2'));var jsonpatch=require(_0xaa6e('0x3'));var rp=require(_0xaa6e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaa6e('0x5'));var path=require(_0xaa6e('0x6'));var sox=require(_0xaa6e('0x7'));var csv=require(_0xaa6e('0x8'));var ejs=require(_0xaa6e('0x9'));var fs=require('fs');var fs_extra=require(_0xaa6e('0xa'));var _=require(_0xaa6e('0xb'));var squel=require(_0xaa6e('0xc'));var crypto=require(_0xaa6e('0xd'));var jsforce=require(_0xaa6e('0xe'));var deskjs=require(_0xaa6e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaa6e('0x10'));var Papa=require(_0xaa6e('0x11'));var Redis=require(_0xaa6e('0x12'));var authService=require(_0xaa6e('0x13'));var qs=require(_0xaa6e('0x14'));var as=require(_0xaa6e('0x15'));var hardwareService=require(_0xaa6e('0x16'));var logger=require(_0xaa6e('0x17'))(_0xaa6e('0x18'));var utils=require(_0xaa6e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa6e('0x1a'))['db'];function respondWithStatusCode(_0x33ab0e,_0x506306){_0x506306=_0x506306||0xcc;return function(_0x549f6b){if(_0x549f6b){return _0x33ab0e[_0xaa6e('0x1b')](_0x506306);}return _0x33ab0e[_0xaa6e('0x1c')](_0x506306)['end']();};}function respondWithResult(_0x297d96,_0x3fed5f){_0x3fed5f=_0x3fed5f||0xc8;return function(_0x5bfba1){if(_0x5bfba1){return _0x297d96['status'](_0x3fed5f)[_0xaa6e('0x1d')](_0x5bfba1);}};}function respondWithFilteredResult(_0xeec93e,_0x513a37){return function(_0x1d3236){if(_0x1d3236){var _0x52fe94=typeof _0x513a37[_0xaa6e('0x1e')]==='undefined'&&typeof _0x513a37[_0xaa6e('0x1f')]===_0xaa6e('0x20');var _0x3b19ed=_0x1d3236[_0xaa6e('0x21')];var _0x2590dd=_0x52fe94?0x0:_0x513a37[_0xaa6e('0x1e')];var _0x1627be=_0x52fe94?_0x1d3236[_0xaa6e('0x21')]:_0x513a37[_0xaa6e('0x1e')]+_0x513a37[_0xaa6e('0x1f')];var _0x2caca3;if(_0x1627be>=_0x3b19ed){_0x1627be=_0x3b19ed;_0x2caca3=0xc8;}else{_0x2caca3=0xce;}_0xeec93e[_0xaa6e('0x1c')](_0x2caca3);return _0xeec93e['set'](_0xaa6e('0x22'),_0x2590dd+'-'+_0x1627be+'/'+_0x3b19ed)[_0xaa6e('0x1d')](_0x1d3236);}return null;};}function patchUpdates(_0x422cbc){return function(_0x1d58bb){try{jsonpatch[_0xaa6e('0x23')](_0x1d58bb,_0x422cbc,!![]);}catch(_0x294b09){return BPromise[_0xaa6e('0x24')](_0x294b09);}return _0x1d58bb['save']();};}function saveUpdates(_0x2170c0,_0x12c4e7){return function(_0x3c5b0a){if(_0x3c5b0a){return _0x3c5b0a['update'](_0x2170c0)[_0xaa6e('0x25')](function(_0x30f7b8){return _0x30f7b8;});}return null;};}function removeEntity(_0x4b5ee7,_0x1f25d2){return function(_0x2b49aa){if(_0x2b49aa){return _0x2b49aa['destroy']()[_0xaa6e('0x25')](function(){_0x4b5ee7[_0xaa6e('0x1c')](0xcc)[_0xaa6e('0x26')]();});}};}function handleEntityNotFound(_0x12d649,_0xf3ca01){return function(_0x5eb55d){if(!_0x5eb55d){_0x12d649[_0xaa6e('0x1b')](0x194);}return _0x5eb55d;};}function handleError(_0x2febe8,_0x491b9a){_0x491b9a=_0x491b9a||0x1f4;return function(_0xdd39ef){logger[_0xaa6e('0x27')](_0xdd39ef[_0xaa6e('0x28')]);if(_0xdd39ef[_0xaa6e('0x29')]){delete _0xdd39ef['name'];}_0x2febe8[_0xaa6e('0x1c')](_0x491b9a)[_0xaa6e('0x2a')](_0xdd39ef);};}exports['index']=function(_0x11c18c,_0x5de8ec){var _0x228af0={},_0x4305a7={},_0x12ca6d={'count':0x0,'rows':[]};var _0x29c0a8=_[_0xaa6e('0x2b')](db['UserProfileSection']['rawAttributes'],function(_0x2238ec){return{'name':_0x2238ec['fieldName'],'type':_0x2238ec[_0xaa6e('0x2c')][_0xaa6e('0x2d')]};});_0x4305a7['model']=_[_0xaa6e('0x2b')](_0x29c0a8,_0xaa6e('0x29'));_0x4305a7[_0xaa6e('0x2e')]=_[_0xaa6e('0x2f')](_0x11c18c['query']);_0x4305a7[_0xaa6e('0x30')]=_[_0xaa6e('0x31')](_0x4305a7[_0xaa6e('0x32')],_0x4305a7[_0xaa6e('0x2e')]);_0x228af0[_0xaa6e('0x33')]=_[_0xaa6e('0x31')](_0x4305a7['model'],qs[_0xaa6e('0x34')](_0x11c18c[_0xaa6e('0x2e')][_0xaa6e('0x34')]));_0x228af0[_0xaa6e('0x33')]=_0x228af0[_0xaa6e('0x33')][_0xaa6e('0x35')]?_0x228af0['attributes']:_0x4305a7[_0xaa6e('0x32')];if(!_0x11c18c[_0xaa6e('0x2e')]['hasOwnProperty'](_0xaa6e('0x36'))){_0x228af0[_0xaa6e('0x1f')]=qs[_0xaa6e('0x1f')](_0x11c18c['query'][_0xaa6e('0x1f')]);_0x228af0['offset']=qs['offset'](_0x11c18c[_0xaa6e('0x2e')]['offset']);}_0x228af0[_0xaa6e('0x37')]=qs['sort'](_0x11c18c[_0xaa6e('0x2e')]['sort']);_0x228af0[_0xaa6e('0x38')]=qs[_0xaa6e('0x30')](_[_0xaa6e('0x39')](_0x11c18c['query'],_0x4305a7[_0xaa6e('0x30')]),_0x29c0a8);if(_0x11c18c[_0xaa6e('0x2e')]['filter']){_0x228af0[_0xaa6e('0x38')]=_[_0xaa6e('0x3a')](_0x228af0[_0xaa6e('0x38')],{'$or':_[_0xaa6e('0x2b')](_0x29c0a8,function(_0x5683d1){if(_0x5683d1[_0xaa6e('0x2c')]!==_0xaa6e('0x3b')){var _0x312efa={};_0x312efa[_0x5683d1[_0xaa6e('0x29')]]={'$like':'%'+_0x11c18c[_0xaa6e('0x2e')][_0xaa6e('0x3c')]+'%'};return _0x312efa;}})});}_0x228af0=_[_0xaa6e('0x3a')]({},_0x228af0,_0x11c18c[_0xaa6e('0x3d')]);var _0x2ad435={'where':_0x228af0[_0xaa6e('0x38')]};return db[_0xaa6e('0x3e')][_0xaa6e('0x21')](_0x2ad435)[_0xaa6e('0x25')](function(_0x1c5da3){_0x12ca6d[_0xaa6e('0x21')]=_0x1c5da3;if(_0x11c18c[_0xaa6e('0x2e')][_0xaa6e('0x3f')]){_0x228af0[_0xaa6e('0x40')]=[{'all':!![]}];}return db[_0xaa6e('0x3e')][_0xaa6e('0x41')](_0x228af0);})['then'](function(_0xc19091){_0x12ca6d[_0xaa6e('0x42')]=_0xc19091;return _0x12ca6d;})[_0xaa6e('0x25')](respondWithFilteredResult(_0x5de8ec,_0x228af0))[_0xaa6e('0x43')](handleError(_0x5de8ec,null));};exports[_0xaa6e('0x44')]=function(_0x242009,_0x18a538){var _0x2beabe={'raw':![],'where':{'id':_0x242009[_0xaa6e('0x45')]['id']}},_0x19324c={};_0x19324c['model']=_[_0xaa6e('0x2f')](db[_0xaa6e('0x3e')][_0xaa6e('0x46')]);_0x19324c[_0xaa6e('0x2e')]=_['keys'](_0x242009['query']);_0x19324c[_0xaa6e('0x30')]=_[_0xaa6e('0x31')](_0x19324c[_0xaa6e('0x32')],_0x19324c[_0xaa6e('0x2e')]);_0x2beabe[_0xaa6e('0x33')]=_[_0xaa6e('0x31')](_0x19324c[_0xaa6e('0x32')],qs[_0xaa6e('0x34')](_0x242009[_0xaa6e('0x2e')][_0xaa6e('0x34')]));_0x2beabe[_0xaa6e('0x33')]=_0x2beabe[_0xaa6e('0x33')]['length']?_0x2beabe['attributes']:_0x19324c[_0xaa6e('0x32')];if(_0x242009['query']['includeAll']){_0x2beabe[_0xaa6e('0x40')]=[{'all':!![]}];}_0x2beabe=_[_0xaa6e('0x3a')]({},_0x2beabe,_0x242009[_0xaa6e('0x3d')]);return db[_0xaa6e('0x3e')]['find'](_0x2beabe)['then'](handleEntityNotFound(_0x18a538,null))[_0xaa6e('0x25')](respondWithResult(_0x18a538,null))[_0xaa6e('0x43')](handleError(_0x18a538,null));};exports[_0xaa6e('0x47')]=function(_0x15e588,_0x2b67ec){return db[_0xaa6e('0x3e')]['create'](_0x15e588[_0xaa6e('0x48')],{})[_0xaa6e('0x25')](respondWithResult(_0x2b67ec,0xc9))[_0xaa6e('0x43')](handleError(_0x2b67ec,null));};exports[_0xaa6e('0x49')]=function(_0x5c7625,_0x39c037){if(_0x5c7625[_0xaa6e('0x48')]['id']){delete _0x5c7625['body']['id'];}return db['UserProfileSection'][_0xaa6e('0x4a')]({'where':{'id':_0x5c7625['params']['id']}})[_0xaa6e('0x25')](handleEntityNotFound(_0x39c037,null))['then'](saveUpdates(_0x5c7625[_0xaa6e('0x48')],null))[_0xaa6e('0x25')](respondWithResult(_0x39c037,null))['catch'](handleError(_0x39c037,null));};exports[_0xaa6e('0x4b')]=function(_0x38ceaa,_0xff413c){return db[_0xaa6e('0x3e')]['find']({'where':{'id':_0x38ceaa['params']['id']}})[_0xaa6e('0x25')](handleEntityNotFound(_0xff413c,null))[_0xaa6e('0x25')](removeEntity(_0xff413c,null))['catch'](handleError(_0xff413c,null));};exports['describe']=function(_0x20c352,_0x14c854){return db[_0xaa6e('0x3e')]['describe']()['then'](respondWithResult(_0x14c854,null))[_0xaa6e('0x43')](handleError(_0x14c854,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 26379a0..e75a027 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 _0xc405=['define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc405,0x1f2));var _0x5c40=function(_0x256c49,_0x53f00a){_0x256c49=_0x256c49-0x0;var _0x280282=_0xc405[_0x256c49];return _0x280282;};'use strict';var _=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var logger=require(_0x5c40('0x2'))(_0x5c40('0x3'));var moment=require(_0x5c40('0x4'));var BPromise=require(_0x5c40('0x5'));var rp=require(_0x5c40('0x6'));var fs=require('fs');var path=require(_0x5c40('0x7'));var rimraf=require(_0x5c40('0x8'));var config=require(_0x5c40('0x9'));var attributes=require(_0x5c40('0xa'));module[_0x5c40('0xb')]=function(_0x1cafd5,_0x59446b){return _0x1cafd5[_0x5c40('0xc')](_0x5c40('0xd'),attributes,{'tableName':_0x5c40('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5c40('0xf'),_0x5c40('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9976=['path','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x195c6b,_0x558639){var _0x239123=function(_0x31b683){while(--_0x31b683){_0x195c6b['push'](_0x195c6b['shift']());}};_0x239123(++_0x558639);}(_0x9976,0x11f));var _0x6997=function(_0x812dcf,_0x12b0ed){_0x812dcf=_0x812dcf-0x0;var _0x146a71=_0x9976[_0x812dcf];return _0x146a71;};'use strict';var _=require(_0x6997('0x0'));var util=require(_0x6997('0x1'));var logger=require(_0x6997('0x2'))(_0x6997('0x3'));var moment=require(_0x6997('0x4'));var BPromise=require(_0x6997('0x5'));var rp=require(_0x6997('0x6'));var fs=require('fs');var path=require(_0x6997('0x7'));var rimraf=require('rimraf');var config=require(_0x6997('0x8'));var attributes=require(_0x6997('0x9'));module[_0x6997('0xa')]=function(_0xb41c9e,_0x5951d1){return _0xb41c9e['define'](_0x6997('0xb'),attributes,{'tableName':_0x6997('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x6997('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index db46992..8c2cfc0 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 _0x0263=['error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0263,0x75));var _0x3026=function(_0x1a288,_0x5eb9c7){_0x1a288=_0x1a288-0x0;var _0x4e53d4=_0x0263[_0x1a288];return _0x4e53d4;};'use strict';var _=require('lodash');var util=require(_0x3026('0x0'));var moment=require(_0x3026('0x1'));var BPromise=require(_0x3026('0x2'));var rs=require(_0x3026('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3026('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3026('0x5'))(_0x3026('0x6'));var config=require(_0x3026('0x7'));var jayson=require(_0x3026('0x8'));var client=jayson['client'][_0x3026('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5651f5,_0x48ab0e,_0x2ae3d7){return new BPromise(function(_0x2528a7,_0x4f7ab4){return client[_0x3026('0xa')](_0x5651f5,_0x2ae3d7)['then'](function(_0x5b5a92){logger[_0x3026('0xb')](_0x3026('0xc'),_0x48ab0e,_0x3026('0xd'));logger['debug'](_0x3026('0xe'),_0x48ab0e,'request\x20sent',JSON[_0x3026('0xf')](_0x5b5a92));if(_0x5b5a92['error']){if(_0x5b5a92[_0x3026('0x10')]['code']===0x1f4){logger[_0x3026('0x10')](_0x3026('0xc'),_0x48ab0e,_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);return _0x4f7ab4(_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);}logger[_0x3026('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x48ab0e,_0x5b5a92[_0x3026('0x10')]['message']);return _0x2528a7(_0x5b5a92[_0x3026('0x10')][_0x3026('0x11')]);}else{logger[_0x3026('0xb')](_0x3026('0xc'),_0x48ab0e,_0x3026('0xd'));_0x2528a7(_0x5b5a92['result'][_0x3026('0x11')]);}})[_0x3026('0x12')](function(_0x20b5bf){logger['error'](_0x3026('0xc'),_0x48ab0e,_0x20b5bf);_0x4f7ab4(_0x20b5bf);});});} \ No newline at end of file +var _0x8941=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x8941,0x1b4));var _0x1894=function(_0x42cad7,_0x2c6dfe){_0x42cad7=_0x42cad7-0x0;var _0x3c6da2=_0x8941[_0x42cad7];return _0x3c6da2;};'use strict';var _=require(_0x1894('0x0'));var util=require(_0x1894('0x1'));var moment=require(_0x1894('0x2'));var BPromise=require(_0x1894('0x3'));var rs=require(_0x1894('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1894('0x5'))['db'];var utils=require(_0x1894('0x6'));var logger=require('../../config/logger')(_0x1894('0x7'));var config=require(_0x1894('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1894('0x9')][_0x1894('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45fe3c,_0x42002a,_0x491848){return new BPromise(function(_0x2152a7,_0x68b315){return client['request'](_0x45fe3c,_0x491848)[_0x1894('0xb')](function(_0x599eb){logger[_0x1894('0xc')](_0x1894('0xd'),_0x42002a,_0x1894('0xe'));logger['debug'](_0x1894('0xf'),_0x42002a,_0x1894('0xe'),JSON[_0x1894('0x10')](_0x599eb));if(_0x599eb[_0x1894('0x11')]){if(_0x599eb[_0x1894('0x11')][_0x1894('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x42002a,_0x599eb[_0x1894('0x11')][_0x1894('0x13')]);return _0x68b315(_0x599eb[_0x1894('0x11')]['message']);}logger[_0x1894('0x11')](_0x1894('0xd'),_0x42002a,_0x599eb['error'][_0x1894('0x13')]);return _0x2152a7(_0x599eb['error'][_0x1894('0x13')]);}else{logger[_0x1894('0xc')](_0x1894('0xd'),_0x42002a,_0x1894('0xe'));_0x2152a7(_0x599eb[_0x1894('0x14')][_0x1894('0x13')]);}})['catch'](function(_0x11b224){logger['error'](_0x1894('0xd'),_0x42002a,_0x11b224);_0x68b315(_0x11b224);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c9ba8a2..50afc29 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x10b306,_0xc16433){var _0x3852ee=function(_0x1160ab){while(--_0x1160ab){_0x10b306['push'](_0x10b306['shift']());}};_0x3852ee(++_0xc16433);}(_0xe706,0xa3));var _0x6e70=function(_0x235884,_0x1c4355){_0x235884=_0x235884-0x0;var _0x211158=_0xe706[_0x235884];return _0x211158;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x178f23,_0x7122d8){var _0x8da005=function(_0x2d273a){while(--_0x2d273a){_0x178f23['push'](_0x178f23['shift']());}};_0x8da005(++_0x7122d8);}(_0xe706,0xa3));var _0x6e70=function(_0x36199a,_0x4f756c){_0x36199a=_0x36199a-0x0;var _0x5b36f1=_0xe706[_0x36199a];return _0x5b36f1;};'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 a3501b1..e9d3d9b 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 _0x01c0=['INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01c0,0x105));var _0x001c=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x01c0[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x001c('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x95d3=['sequelize','exports'];(function(_0x163572,_0x6e526f){var _0x1384a4=function(_0x24821b){while(--_0x24821b){_0x163572['push'](_0x163572['shift']());}};_0x1384a4(++_0x6e526f);}(_0x95d3,0x138));var _0x395d=function(_0x51a10c,_0x221b0b){_0x51a10c=_0x51a10c-0x0;var _0x38af28=_0x95d3[_0x51a10c];return _0x38af28;};'use strict';var Sequelize=require(_0x395d('0x0'));module[_0x395d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 8789346..ff62c61 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 _0xacf4=['define','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','exports'];(function(_0x548177,_0x32bfc5){var _0x431a7a=function(_0x1589ac){while(--_0x1589ac){_0x548177['push'](_0x548177['shift']());}};_0x431a7a(++_0x32bfc5);}(_0xacf4,0xe7));var _0x4acf=function(_0x50da1d,_0x1fa929){_0x50da1d=_0x50da1d-0x0;var _0x30cd08=_0xacf4[_0x50da1d];return _0x30cd08;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9206,0x176));var _0x6920=function(_0x46e29f,_0x256cee){_0x46e29f=_0x46e29f-0x0;var _0x3ab125=_0x9206[_0x46e29f];return _0x3ab125;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index ceb48a6..810b491 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 _0x6aef=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0x5ca5b0,_0x8a4bee){var _0x3abdc0=function(_0x62e4ca){while(--_0x62e4ca){_0x5ca5b0['push'](_0x5ca5b0['shift']());}};_0x3abdc0(++_0x8a4bee);}(_0x6aef,0xdd));var _0xf6ae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6aef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf6ae('0x0'));var util=require(_0xf6ae('0x1'));var moment=require(_0xf6ae('0x2'));var BPromise=require(_0xf6ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6ae('0x4'))['db'];var utils=require(_0xf6ae('0x5'));var logger=require(_0xf6ae('0x6'))(_0xf6ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xf6ae('0x8'));var client=jayson[_0xf6ae('0x9')][_0xf6ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d8503,_0x57b0f3,_0x52191b){return new BPromise(function(_0x161d8d,_0x333748){return client[_0xf6ae('0xb')](_0x5d8503,_0x52191b)[_0xf6ae('0xc')](function(_0x30028b){logger[_0xf6ae('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x57b0f3,_0xf6ae('0xe'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x57b0f3,_0xf6ae('0xe'),JSON[_0xf6ae('0xf')](_0x30028b));if(_0x30028b[_0xf6ae('0x10')]){if(_0x30028b[_0xf6ae('0x10')]['code']===0x1f4){logger['error'](_0xf6ae('0x11'),_0x57b0f3,_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);return _0x333748(_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);}logger[_0xf6ae('0x10')](_0xf6ae('0x11'),_0x57b0f3,_0x30028b[_0xf6ae('0x10')]['message']);return _0x161d8d(_0x30028b[_0xf6ae('0x10')][_0xf6ae('0x12')]);}else{logger[_0xf6ae('0xd')](_0xf6ae('0x11'),_0x57b0f3,_0xf6ae('0xe'));_0x161d8d(_0x30028b['result'][_0xf6ae('0x12')]);}})[_0xf6ae('0x13')](function(_0x3d98bb){logger[_0xf6ae('0x10')](_0xf6ae('0x11'),_0x57b0f3,_0x3d98bb);_0x333748(_0x3d98bb);});});} \ No newline at end of file +var _0x58fa=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x58fa,0x118));var _0xa58f=function(_0x424232,_0x37d094){_0x424232=_0x424232-0x0;var _0x2f596c=_0x58fa[_0x424232];return _0x2f596c;};'use strict';var _=require(_0xa58f('0x0'));var util=require(_0xa58f('0x1'));var moment=require(_0xa58f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa58f('0x3'));var fs=require('fs');var Redis=require(_0xa58f('0x4'));var db=require(_0xa58f('0x5'))['db'];var utils=require(_0xa58f('0x6'));var logger=require(_0xa58f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa58f('0x8'));var client=jayson['client'][_0xa58f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5312fc,_0x52c4f6,_0xc83438){return new BPromise(function(_0x3a7464,_0x1330a2){return client[_0xa58f('0xa')](_0x5312fc,_0xc83438)['then'](function(_0x537d0c){logger['info'](_0xa58f('0xb'),_0x52c4f6,_0xa58f('0xc'));logger[_0xa58f('0xd')](_0xa58f('0xe'),_0x52c4f6,_0xa58f('0xc'),JSON[_0xa58f('0xf')](_0x537d0c));if(_0x537d0c['error']){if(_0x537d0c[_0xa58f('0x10')][_0xa58f('0x11')]===0x1f4){logger['error'](_0xa58f('0xb'),_0x52c4f6,_0x537d0c[_0xa58f('0x10')][_0xa58f('0x12')]);return _0x1330a2(_0x537d0c[_0xa58f('0x10')]['message']);}logger[_0xa58f('0x10')](_0xa58f('0xb'),_0x52c4f6,_0x537d0c[_0xa58f('0x10')][_0xa58f('0x12')]);return _0x3a7464(_0x537d0c['error'][_0xa58f('0x12')]);}else{logger[_0xa58f('0x13')](_0xa58f('0xb'),_0x52c4f6,_0xa58f('0xc'));_0x3a7464(_0x537d0c['result'][_0xa58f('0x12')]);}})['catch'](function(_0x13bd50){logger['error'](_0xa58f('0xb'),_0x52c4f6,_0x13bd50);_0x1330a2(_0x13bd50);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 5ce591a..a5c1c17 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 _0xccbd=['INTEGER','exports'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0xccbd,0x1db));var _0xdccb=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xccbd[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0xdccb('0x0')]={'UserId':{'type':Sequelize[_0xdccb('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x99dc=['INTEGER'];(function(_0x479ba3,_0x55cd19){var _0x599789=function(_0x1298e1){while(--_0x1298e1){_0x479ba3['push'](_0x479ba3['shift']());}};_0x599789(++_0x55cd19);}(_0x99dc,0x1b4));var _0xc99d=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x99dc[_0x3dc68d];return _0xdf7f94;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xc99d('0x0')]},'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 4f2b349..de515fa 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(_0xb320a4,_0x14b8a3){var _0x3a7933=function(_0x472315){while(--_0x472315){_0xb320a4['push'](_0xb320a4['shift']());}};_0x3a7933(++_0x14b8a3);}(_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(_0x3e7053,_0x23d499){var _0x42fc68=function(_0x318dbb){while(--_0x318dbb){_0x3e7053['push'](_0x3e7053['shift']());}};_0x42fc68(++_0x23d499);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 b001cc6..17eedf8 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(_0x2cb4c2,_0xa294fa){var _0x45a313=function(_0x39bbb6){while(--_0x39bbb6){_0x2cb4c2['push'](_0x2cb4c2['shift']());}};_0x45a313(++_0xa294fa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0xcb91[_0x529f1c];return _0x4d57ab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xbf8f73,_0x2ca243){var _0x53d9a9=function(_0x7c851d){while(--_0x7c851d){_0xbf8f73['push'](_0xbf8f73['shift']());}};_0x53d9a9(++_0x2ca243);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9499a2a..63cc556 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 _0xdf81=['exports','INTEGER'];(function(_0x379a70,_0x367de6){var _0x3ddaa4=function(_0x5a2582){while(--_0x5a2582){_0x379a70['push'](_0x379a70['shift']());}};_0x3ddaa4(++_0x367de6);}(_0xdf81,0x92));var _0x1df8=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xdf81[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require('sequelize');module[_0x1df8('0x0')]={'penalty':{'type':Sequelize[_0x1df8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f2f=['sequelize','INTEGER'];(function(_0x5e4d0d,_0x39a3e4){var _0x489745=function(_0x103fa3){while(--_0x103fa3){_0x5e4d0d['push'](_0x5e4d0d['shift']());}};_0x489745(++_0x39a3e4);}(_0x3f2f,0x120));var _0xf3f2=function(_0x371b05,_0x1d5dcb){_0x371b05=_0x371b05-0x0;var _0x170f16=_0x3f2f[_0x371b05];return _0x170f16;};'use strict';var Sequelize=require(_0xf3f2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf3f2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 267002f..d8431fa 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 _0xdf0c=['bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x70e299,_0x598c1b){var _0xb6c5b=function(_0x16545a){while(--_0x16545a){_0x70e299['push'](_0x70e299['shift']());}};_0xb6c5b(++_0x598c1b);}(_0xdf0c,0xb2));var _0xcdf0=function(_0x22de09,_0x3db597){_0x22de09=_0x22de09-0x0;var _0x4a13dc=_0xdf0c[_0x22de09];return _0x4a13dc;};'use strict';var _=require(_0xcdf0('0x0'));var util=require(_0xcdf0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcdf0('0x2'));var rp=require(_0xcdf0('0x3'));var fs=require('fs');var path=require(_0xcdf0('0x4'));var rimraf=require('rimraf');var config=require(_0xcdf0('0x5'));var attributes=require(_0xcdf0('0x6'));module['exports']=function(_0x4575dc,_0x3e89ae){return _0x4575dc[_0xcdf0('0x7')](_0xcdf0('0x8'),attributes,{'tableName':_0xcdf0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a7b=['UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define'];(function(_0x1e6951,_0x4d39ee){var _0x235723=function(_0x41180e){while(--_0x41180e){_0x1e6951['push'](_0x1e6951['shift']());}};_0x235723(++_0x4d39ee);}(_0x6a7b,0x1bc));var _0xb6a7=function(_0x3487ce,_0x37b16f){_0x3487ce=_0x3487ce-0x0;var _0x2b93d9=_0x6a7b[_0x3487ce];return _0x2b93d9;};'use strict';var _=require(_0xb6a7('0x0'));var util=require(_0xb6a7('0x1'));var logger=require('../../config/logger')(_0xb6a7('0x2'));var moment=require(_0xb6a7('0x3'));var BPromise=require(_0xb6a7('0x4'));var rp=require(_0xb6a7('0x5'));var fs=require('fs');var path=require(_0xb6a7('0x6'));var rimraf=require(_0xb6a7('0x7'));var config=require(_0xb6a7('0x8'));var attributes=require(_0xb6a7('0x9'));module['exports']=function(_0x13574d,_0x117f38){return _0x13574d[_0xb6a7('0xa')](_0xb6a7('0xb'),attributes,{'tableName':_0xb6a7('0xc'),'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 9629a87..7c498cc 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 _0x3bdf=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x54182a,_0x517761){var _0x208374=function(_0x1f5a25){while(--_0x1f5a25){_0x54182a['push'](_0x54182a['shift']());}};_0x208374(++_0x517761);}(_0x3bdf,0x1a1));var _0xf3bd=function(_0x55ebc9,_0x49f602){_0x55ebc9=_0x55ebc9-0x0;var _0x54351f=_0x3bdf[_0x55ebc9];return _0x54351f;};'use strict';var _=require(_0xf3bd('0x0'));var util=require(_0xf3bd('0x1'));var moment=require(_0xf3bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3bd('0x3'));var fs=require('fs');var Redis=require(_0xf3bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3bd('0x5'));var logger=require(_0xf3bd('0x6'))(_0xf3bd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3bd('0x8')][_0xf3bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4febde,_0x120995,_0x342a2a){return new BPromise(function(_0x159cee,_0x398067){return client[_0xf3bd('0xa')](_0x4febde,_0x342a2a)[_0xf3bd('0xb')](function(_0x26905c){logger[_0xf3bd('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x120995,_0xf3bd('0xd'));logger[_0xf3bd('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x120995,_0xf3bd('0xd'),JSON[_0xf3bd('0xf')](_0x26905c));if(_0x26905c['error']){if(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x11')]===0x1f4){logger[_0xf3bd('0x10')](_0xf3bd('0x12'),_0x120995,_0x26905c[_0xf3bd('0x10')]['message']);return _0x398067(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);}logger[_0xf3bd('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x120995,_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);return _0x159cee(_0x26905c[_0xf3bd('0x10')][_0xf3bd('0x13')]);}else{logger[_0xf3bd('0xc')](_0xf3bd('0x12'),_0x120995,'request\x20sent');_0x159cee(_0x26905c[_0xf3bd('0x14')][_0xf3bd('0x13')]);}})[_0xf3bd('0x15')](function(_0xc698c8){logger[_0xf3bd('0x10')](_0xf3bd('0x12'),_0x120995,_0xc698c8);_0x398067(_0xc698c8);});});} \ No newline at end of file +var _0x9e16=['error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1f556f,_0x435274){var _0x4424c4=function(_0x3fa9b0){while(--_0x3fa9b0){_0x1f556f['push'](_0x1f556f['shift']());}};_0x4424c4(++_0x435274);}(_0x9e16,0x16a));var _0x69e1=function(_0x2a9891,_0x39ce21){_0x2a9891=_0x2a9891-0x0;var _0x1a5aa6=_0x9e16[_0x2a9891];return _0x1a5aa6;};'use strict';var _=require('lodash');var util=require(_0x69e1('0x0'));var moment=require('moment');var BPromise=require(_0x69e1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69e1('0x2'));var db=require(_0x69e1('0x3'))['db'];var utils=require(_0x69e1('0x4'));var logger=require(_0x69e1('0x5'))(_0x69e1('0x6'));var config=require(_0x69e1('0x7'));var jayson=require(_0x69e1('0x8'));var client=jayson[_0x69e1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9232,_0x4a1d90,_0x4877a7){return new BPromise(function(_0x1eea8d,_0x46a9f3){return client[_0x69e1('0xa')](_0x4c9232,_0x4877a7)[_0x69e1('0xb')](function(_0x5ee87c){logger[_0x69e1('0xc')](_0x69e1('0xd'),_0x4a1d90,'request\x20sent');logger['debug'](_0x69e1('0xe'),_0x4a1d90,_0x69e1('0xf'),JSON['stringify'](_0x5ee87c));if(_0x5ee87c[_0x69e1('0x10')]){if(_0x5ee87c[_0x69e1('0x10')][_0x69e1('0x11')]===0x1f4){logger['error'](_0x69e1('0xd'),_0x4a1d90,_0x5ee87c[_0x69e1('0x10')]['message']);return _0x46a9f3(_0x5ee87c[_0x69e1('0x10')]['message']);}logger[_0x69e1('0x10')](_0x69e1('0xd'),_0x4a1d90,_0x5ee87c['error']['message']);return _0x1eea8d(_0x5ee87c[_0x69e1('0x10')][_0x69e1('0x12')]);}else{logger[_0x69e1('0xc')](_0x69e1('0xd'),_0x4a1d90,'request\x20sent');_0x1eea8d(_0x5ee87c[_0x69e1('0x13')]['message']);}})[_0x69e1('0x14')](function(_0x2e4d33){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4a1d90,_0x2e4d33);_0x46a9f3(_0x2e4d33);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 34a8c35..2dd53cc 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x52d60a,_0xec41bc){var _0x1806fd=function(_0x1f38d0){while(--_0x1f38d0){_0x52d60a['push'](_0x52d60a['shift']());}};_0x1806fd(++_0xec41bc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xcb91[_0x3e182f];return _0x23edc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x39d859,_0x3f3ddb){var _0x2282ed=function(_0x32a193){while(--_0x32a193){_0x39d859['push'](_0x39d859['shift']());}};_0x2282ed(++_0x3f3ddb);}(_0x70e0,0x17b));var _0x070e=function(_0xb01d1a,_0x5b70b2){_0xb01d1a=_0xb01d1a-0x0;var _0x15feb6=_0x70e0[_0xb01d1a];return _0x15feb6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 75d27e5..96c1f2a 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 _0x3c3e=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0x5d44a6,_0x398111){var _0x5524f3=function(_0x272f5e){while(--_0x272f5e){_0x5d44a6['push'](_0x5d44a6['shift']());}};_0x5524f3(++_0x398111);}(_0x3c3e,0xe4));var _0xe3c3=function(_0x3570c3,_0x35471d){_0x3570c3=_0x3570c3-0x0;var _0x17659a=_0x3c3e[_0x3570c3];return _0x17659a;};'use strict';var Sequelize=require(_0xe3c3('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe3c3('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe3c3('0x2')},'membername':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xe3c3('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'unique':_0xe3c3('0x4'),'comment':_0xe3c3('0x2')},'VoiceQueueId':{'type':Sequelize[_0xe3c3('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xe3c3('0x3')],'allowNull':![],'unique':_0xe3c3('0x4'),'comment':_0xe3c3('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xc393=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xc393,0xd3));var _0x3c39=function(_0x360929,_0x190357){_0x360929=_0x360929-0x0;var _0x42cb22=_0xc393[_0x360929];return _0x42cb22;};'use strict';var Sequelize=require(_0x3c39('0x0'));module[_0x3c39('0x1')]={'uniqueid':{'type':Sequelize[_0x3c39('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x3c39('0x3')},'membername':{'type':Sequelize[_0x3c39('0x4')],'allowNull':![],'comment':_0x3c39('0x3')},'UserId':{'type':Sequelize[_0x3c39('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3c39('0x4')],'allowNull':![],'unique':_0x3c39('0x5'),'comment':_0x3c39('0x3')},'VoiceQueueId':{'type':Sequelize[_0x3c39('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3c39('0x5'),'comment':_0x3c39('0x3')},'penalty':{'type':Sequelize[_0x3c39('0x2')](0xb),'defaultValue':0x0,'comment':_0x3c39('0x3')},'paused':{'type':Sequelize[_0x3c39('0x2')](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 2baa8e7..a13f93f 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 _0xf24f=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x2b9a7a,_0x2b47db){var _0x88d458=function(_0x2df641){while(--_0x2df641){_0x2b9a7a['push'](_0x2b9a7a['shift']());}};_0x88d458(++_0x2b47db);}(_0xf24f,0xa6));var _0xff24=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0xf24f[_0x595bd1];return _0xd0344f;};'use strict';var EventEmitter=require(_0xff24('0x0'));var UserVoiceQueueRt=require(_0xff24('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xff24('0x2')](0x0);var events={'afterCreate':_0xff24('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15d73e){return function(_0x524ac9,_0x5515f7,_0x50be38){UserVoiceQueueRtEvents['emit'](_0x15d73e+':'+_0x524ac9['id'],_0x524ac9);UserVoiceQueueRtEvents[_0xff24('0x4')](_0x15d73e,_0x524ac9);_0x50be38(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xff24('0x5')](e,emitEvent(event));}}module[_0xff24('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xb260=['save','update','remove','emit','exports','events','UserVoiceQueueRt','setMaxListeners'];(function(_0x451c66,_0x32d3cd){var _0x191c25=function(_0x523454){while(--_0x523454){_0x451c66['push'](_0x451c66['shift']());}};_0x191c25(++_0x32d3cd);}(_0xb260,0x155));var _0x0b26=function(_0x4edf34,_0x481dd2){_0x4edf34=_0x4edf34-0x0;var _0x2304f7=_0xb260[_0x4edf34];return _0x2304f7;};'use strict';var EventEmitter=require(_0x0b26('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x0b26('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0b26('0x2')](0x0);var events={'afterCreate':_0x0b26('0x3'),'afterUpdate':_0x0b26('0x4'),'afterDestroy':_0x0b26('0x5')};function emitEvent(_0x5d03df){return function(_0x30a510,_0x7f3f3,_0x34a7b9){UserVoiceQueueRtEvents[_0x0b26('0x6')](_0x5d03df+':'+_0x30a510['id'],_0x30a510);UserVoiceQueueRtEvents[_0x0b26('0x6')](_0x5d03df,_0x30a510);_0x34a7b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x0b26('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 745de8e..708ca72 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 _0x228d=['user_has_voice_queues_rt','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x59729a,_0x1a33bb){var _0x1d7dcc=function(_0x981073){while(--_0x981073){_0x59729a['push'](_0x59729a['shift']());}};_0x1d7dcc(++_0x1a33bb);}(_0x228d,0x169));var _0xd228=function(_0x5b1370,_0x5beac4){_0x5b1370=_0x5b1370-0x0;var _0xf5075d=_0x228d[_0x5b1370];return _0xf5075d;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd228('0x2'));var BPromise=require('bluebird');var rp=require(_0xd228('0x3'));var fs=require('fs');var path=require(_0xd228('0x4'));var rimraf=require(_0xd228('0x5'));var config=require(_0xd228('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x2522e8,_0xd11853){return _0x2522e8['define']('UserVoiceQueueRt',attributes,{'tableName':_0xd228('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ed8=['../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','api','moment','bluebird','path','rimraf'];(function(_0x4aa26e,_0x45dc87){var _0x5aec38=function(_0x35edf8){while(--_0x35edf8){_0x4aa26e['push'](_0x4aa26e['shift']());}};_0x5aec38(++_0x45dc87);}(_0x1ed8,0x11c));var _0x81ed=function(_0x5ad410,_0x22bf60){_0x5ad410=_0x5ad410-0x0;var _0x4cc56b=_0x1ed8[_0x5ad410];return _0x4cc56b;};'use strict';var _=require(_0x81ed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x81ed('0x1'));var moment=require(_0x81ed('0x2'));var BPromise=require(_0x81ed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81ed('0x4'));var rimraf=require(_0x81ed('0x5'));var config=require(_0x81ed('0x6'));var attributes=require(_0x81ed('0x7'));module['exports']=function(_0xb25c5c,_0x20f884){return _0xb25c5c[_0x81ed('0x8')](_0x81ed('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','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 ad8a390..7316357 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 _0xc021=['redis','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1a22ef,_0x1ef6df){var _0x4a8226=function(_0x47508a){while(--_0x47508a){_0x1a22ef['push'](_0x1a22ef['shift']());}};_0x4a8226(++_0x1ef6df);}(_0xc021,0x177));var _0x1c02=function(_0x2526ac,_0x46372a){_0x2526ac=_0x2526ac-0x0;var _0x4d2e0c=_0xc021[_0x2526ac];return _0x4d2e0c;};'use strict';var _=require(_0x1c02('0x0'));var util=require(_0x1c02('0x1'));var moment=require(_0x1c02('0x2'));var BPromise=require(_0x1c02('0x3'));var rs=require(_0x1c02('0x4'));var fs=require('fs');var Redis=require(_0x1c02('0x5'));var db=require(_0x1c02('0x6'))['db'];var utils=require(_0x1c02('0x7'));var logger=require(_0x1c02('0x8'))(_0x1c02('0x9'));var config=require(_0x1c02('0xa'));var jayson=require(_0x1c02('0xb'));var client=jayson[_0x1c02('0xc')][_0x1c02('0xd')]({'port':0x232a});config['redis']=_[_0x1c02('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c02('0xf')]));require(_0x1c02('0x10'))['register'](socket);function respondWithRpcPromise(_0x53593d,_0x147b7c,_0x479dc4){return new BPromise(function(_0x32e276,_0xa0630a){return client[_0x1c02('0x11')](_0x53593d,_0x479dc4)[_0x1c02('0x12')](function(_0x56ca20){logger[_0x1c02('0x13')](_0x1c02('0x14'),_0x147b7c,_0x1c02('0x15'));logger[_0x1c02('0x16')](_0x1c02('0x17'),_0x147b7c,_0x1c02('0x15'),JSON['stringify'](_0x56ca20));if(_0x56ca20[_0x1c02('0x18')]){if(_0x56ca20['error'][_0x1c02('0x19')]===0x1f4){logger['error'](_0x1c02('0x14'),_0x147b7c,_0x56ca20['error'][_0x1c02('0x1a')]);return _0xa0630a(_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);}logger['error'](_0x1c02('0x14'),_0x147b7c,_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);return _0x32e276(_0x56ca20[_0x1c02('0x18')][_0x1c02('0x1a')]);}else{logger['info'](_0x1c02('0x14'),_0x147b7c,_0x1c02('0x15'));_0x32e276(_0x56ca20[_0x1c02('0x1b')][_0x1c02('0x1a')]);}})[_0x1c02('0x1c')](function(_0x465015){logger[_0x1c02('0x18')](_0x1c02('0x14'),_0x147b7c,_0x465015);_0xa0630a(_0x465015);});});}exports['GetVoiceQueueRtPauses']=function(_0x462b1f){var _0x5bb1b4=this;return new Promise(function(_0x2f92f4,_0xfcc8e6){return db['UserVoiceQueueRt']['findAll']({'raw':_0x462b1f[_0x1c02('0x1d')]?_0x462b1f[_0x1c02('0x1d')][_0x1c02('0x1e')]===undefined?!![]:![]:!![],'where':_0x462b1f['options']?_0x462b1f['options'][_0x1c02('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1c02('0x20'),db[_0x1c02('0x21')]['fn']('IF',db[_0x1c02('0x21')][_0x1c02('0x22')](_0x1c02('0x23')))),_0x1c02('0x24')]]})['then'](function(_0x468507){logger[_0x1c02('0x13')]('GetVoiceQueueRtPauses',_0x462b1f);logger[_0x1c02('0x16')](_0x1c02('0x25'),_0x462b1f,JSON[_0x1c02('0x26')](_0x468507));_0x2f92f4(_0x468507);})[_0x1c02('0x1c')](function(_0x44b083){logger[_0x1c02('0x18')](_0x1c02('0x25'),_0x44b083[_0x1c02('0x1a')],_0x462b1f);_0xfcc8e6(_0x5bb1b4[_0x1c02('0x18')](0x1f4,_0x44b083[_0x1c02('0x1a')]));});});}; \ No newline at end of file +var _0x956a=['client','http','redis','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3b88b7,_0x1553ab){var _0x107386=function(_0x42481f){while(--_0x42481f){_0x3b88b7['push'](_0x3b88b7['shift']());}};_0x107386(++_0x1553ab);}(_0x956a,0x1b1));var _0xa956=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x956a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xa956('0x0'));var util=require(_0xa956('0x1'));var moment=require(_0xa956('0x2'));var BPromise=require(_0xa956('0x3'));var rs=require(_0xa956('0x4'));var fs=require('fs');var Redis=require(_0xa956('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa956('0x6'));var logger=require(_0xa956('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa956('0x8'));var client=jayson[_0xa956('0x9')][_0xa956('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa956('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa956('0xb')]));require(_0xa956('0xc'))[_0xa956('0xd')](socket);function respondWithRpcPromise(_0x493e20,_0x574463,_0x4bf1eb){return new BPromise(function(_0x4ce2a5,_0x5dbddb){return client[_0xa956('0xe')](_0x493e20,_0x4bf1eb)[_0xa956('0xf')](function(_0x4b6e67){logger['info'](_0xa956('0x10'),_0x574463,_0xa956('0x11'));logger[_0xa956('0x12')](_0xa956('0x13'),_0x574463,'request\x20sent',JSON[_0xa956('0x14')](_0x4b6e67));if(_0x4b6e67[_0xa956('0x15')]){if(_0x4b6e67[_0xa956('0x15')]['code']===0x1f4){logger['error'](_0xa956('0x10'),_0x574463,_0x4b6e67['error']['message']);return _0x5dbddb(_0x4b6e67[_0xa956('0x15')][_0xa956('0x16')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x574463,_0x4b6e67[_0xa956('0x15')]['message']);return _0x4ce2a5(_0x4b6e67[_0xa956('0x15')][_0xa956('0x16')]);}else{logger[_0xa956('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x574463,'request\x20sent');_0x4ce2a5(_0x4b6e67[_0xa956('0x18')][_0xa956('0x16')]);}})[_0xa956('0x19')](function(_0xe5d51c){logger[_0xa956('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x574463,_0xe5d51c);_0x5dbddb(_0xe5d51c);});});}exports[_0xa956('0x1a')]=function(_0x51e091){var _0xe9ee78=this;return new Promise(function(_0x4b49d0,_0x445416){return db[_0xa956('0x1b')][_0xa956('0x1c')]({'raw':_0x51e091[_0xa956('0x1d')]?_0x51e091[_0xa956('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x51e091[_0xa956('0x1d')]?_0x51e091[_0xa956('0x1d')][_0xa956('0x1e')]||null:null,'attributes':[[db[_0xa956('0x1f')]['fn'](_0xa956('0x20'),db[_0xa956('0x1f')]['fn']('IF',db['sequelize']['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xa956('0x21')]]})[_0xa956('0xf')](function(_0x63fe46){logger['info'](_0xa956('0x1a'),_0x51e091);logger['debug'](_0xa956('0x1a'),_0x51e091,JSON[_0xa956('0x14')](_0x63fe46));_0x4b49d0(_0x63fe46);})[_0xa956('0x19')](function(_0x596de7){logger[_0xa956('0x15')](_0xa956('0x1a'),_0x596de7[_0xa956('0x16')],_0x51e091);_0x445416(_0xe9ee78[_0xa956('0x15')](0x1f4,_0x596de7[_0xa956('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b140af6..8980a28 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 _0x31af=['remove','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x4394a9,_0x51da99){var _0x107ce4=function(_0x176c51){while(--_0x176c51){_0x4394a9['push'](_0x4394a9['shift']());}};_0x107ce4(++_0x51da99);}(_0x31af,0xde));var _0xf31a=function(_0x1ec81a,_0x20fe29){_0x1ec81a=_0x1ec81a-0x0;var _0x5f2e51=_0x31af[_0x1ec81a];return _0x5f2e51;};'use strict';var UserVoiceQueueRtEvents=require(_0xf31a('0x0'));var events=[_0xf31a('0x1'),_0xf31a('0x2'),'update'];function createListener(_0x5f5639,_0x4596f6){return function(_0x4a8ef1){_0x4596f6[_0xf31a('0x3')](_0x5f5639,_0x4a8ef1);};}function removeListener(_0x1853d7,_0x820362){return function(){UserVoiceQueueRtEvents[_0xf31a('0x4')](_0x1853d7,_0x820362);};}exports['register']=function(_0x8d7853){for(var _0x209fcc=0x0,_0x405926=events[_0xf31a('0x5')];_0x209fcc<_0x405926;_0x209fcc++){var _0x47b7a1=events[_0x209fcc];var _0x31f8e7=createListener(_0xf31a('0x6')+_0x47b7a1,_0x8d7853);UserVoiceQueueRtEvents['on'](_0x47b7a1,_0x31f8e7);}}; \ No newline at end of file +var _0x077e=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x077e,0x14a));var _0xe077=function(_0x26bf47,_0x4aa3bc){_0x26bf47=_0x26bf47-0x0;var _0x4bb176=_0x077e[_0x26bf47];return _0x4bb176;};'use strict';var UserVoiceQueueRtEvents=require(_0xe077('0x0'));var events=[_0xe077('0x1'),_0xe077('0x2'),_0xe077('0x3')];function createListener(_0x5a1263,_0x5b4de2){return function(_0x15960d){_0x5b4de2[_0xe077('0x4')](_0x5a1263,_0x15960d);};}function removeListener(_0x4a203d,_0x391340){return function(){UserVoiceQueueRtEvents[_0xe077('0x5')](_0x4a203d,_0x391340);};}exports[_0xe077('0x6')]=function(_0xe4430c){for(var _0x3a9d18=0x0,_0xdc247=events[_0xe077('0x7')];_0x3a9d18<_0xdc247;_0x3a9d18++){var _0x2e5a85=events[_0x3a9d18];var _0x41dc63=createListener(_0xe077('0x8')+_0x2e5a85,_0xe4430c);UserVoiceQueueRtEvents['on'](_0x2e5a85,_0x41dc63);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 550d831..09ac297 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1ba5b8,_0x2f8d2f){var _0x417cbb=function(_0x599d62){while(--_0x599d62){_0x1ba5b8['push'](_0x1ba5b8['shift']());}};_0x417cbb(++_0x2f8d2f);}(_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(_0x4748ad,_0x224298){var _0x566c04=function(_0x57b805){while(--_0x57b805){_0x4748ad['push'](_0x4748ad['shift']());}};_0x566c04(++_0x224298);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 863b8ba..2271641 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 _0xe0a0=['exports','INTEGER'];(function(_0x43fc61,_0x55011f){var _0x261a48=function(_0x61938){while(--_0x61938){_0x43fc61['push'](_0x43fc61['shift']());}};_0x261a48(++_0x55011f);}(_0xe0a0,0x190));var _0x0e0a=function(_0xd94c46,_0x224854){_0xd94c46=_0xd94c46-0x0;var _0xc89d22=_0xe0a0[_0xd94c46];return _0xc89d22;};'use strict';var Sequelize=require('sequelize');module[_0x0e0a('0x0')]={'penalty':{'type':Sequelize[_0x0e0a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0fc0=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fc0,0x13a));var _0x00fc=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x0fc0[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x00fc('0x0'));module[_0x00fc('0x1')]={'penalty':{'type':Sequelize[_0x00fc('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 1df7bd2..81d05a8 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 _0x8f1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger'];(function(_0x57deed,_0x5e554f){var _0x3802d6=function(_0x25bab0){while(--_0x25bab0){_0x57deed['push'](_0x57deed['shift']());}};_0x3802d6(++_0x5e554f);}(_0x8f1b,0x15c));var _0xb8f1=function(_0x1a89df,_0x55a137){_0x1a89df=_0x1a89df-0x0;var _0x282029=_0x8f1b[_0x1a89df];return _0x282029;};'use strict';var _=require(_0xb8f1('0x0'));var util=require(_0xb8f1('0x1'));var logger=require(_0xb8f1('0x2'))('api');var moment=require(_0xb8f1('0x3'));var BPromise=require(_0xb8f1('0x4'));var rp=require(_0xb8f1('0x5'));var fs=require('fs');var path=require(_0xb8f1('0x6'));var rimraf=require(_0xb8f1('0x7'));var config=require(_0xb8f1('0x8'));var attributes=require(_0xb8f1('0x9'));module[_0xb8f1('0xa')]=function(_0x15dcf3,_0x215a1f){return _0x15dcf3[_0xb8f1('0xb')](_0xb8f1('0xc'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x54d422,_0x4676cd){var _0x5ea58b=function(_0x7777e5){while(--_0x7777e5){_0x54d422['push'](_0x54d422['shift']());}};_0x5ea58b(++_0x4676cd);}(_0xe14b,0x12f));var _0xbe14=function(_0x439ee4,_0x48aa5e){_0x439ee4=_0x439ee4-0x0;var _0x3f0f50=_0xe14b[_0x439ee4];return _0x3f0f50;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require(_0xbe14('0x2'))(_0xbe14('0x3'));var moment=require(_0xbe14('0x4'));var BPromise=require(_0xbe14('0x5'));var rp=require(_0xbe14('0x6'));var fs=require('fs');var path=require(_0xbe14('0x7'));var rimraf=require(_0xbe14('0x8'));var config=require('../../config/environment');var attributes=require(_0xbe14('0x9'));module[_0xbe14('0xa')]=function(_0x520303,_0x16d72e){return _0x520303[_0xbe14('0xb')](_0xbe14('0xc'),attributes,{'tableName':_0xbe14('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index b3c9586..19f74ca 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 _0x4824=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4824,0xcb));var _0x4482=function(_0x377a1f,_0x28a969){_0x377a1f=_0x377a1f-0x0;var _0x4da071=_0x4824[_0x377a1f];return _0x4da071;};'use strict';var _=require(_0x4482('0x0'));var util=require(_0x4482('0x1'));var moment=require(_0x4482('0x2'));var BPromise=require(_0x4482('0x3'));var rs=require(_0x4482('0x4'));var fs=require('fs');var Redis=require(_0x4482('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4482('0x6'))(_0x4482('0x7'));var config=require(_0x4482('0x8'));var jayson=require(_0x4482('0x9'));var client=jayson[_0x4482('0xa')][_0x4482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x353211,_0x3ce58c,_0x30d4d7){return new BPromise(function(_0xb020,_0x4260fc){return client['request'](_0x353211,_0x30d4d7)[_0x4482('0xc')](function(_0x287efc){logger[_0x4482('0xd')](_0x4482('0xe'),_0x3ce58c,_0x4482('0xf'));logger[_0x4482('0x10')](_0x4482('0x11'),_0x3ce58c,'request\x20sent',JSON['stringify'](_0x287efc));if(_0x287efc[_0x4482('0x12')]){if(_0x287efc['error'][_0x4482('0x13')]===0x1f4){logger[_0x4482('0x12')](_0x4482('0xe'),_0x3ce58c,_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);return _0x4260fc(_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);}logger[_0x4482('0x12')](_0x4482('0xe'),_0x3ce58c,_0x287efc[_0x4482('0x12')][_0x4482('0x14')]);return _0xb020(_0x287efc[_0x4482('0x12')]['message']);}else{logger[_0x4482('0xd')](_0x4482('0xe'),_0x3ce58c,_0x4482('0xf'));_0xb020(_0x287efc[_0x4482('0x15')][_0x4482('0x14')]);}})[_0x4482('0x16')](function(_0x3c3e0a){logger[_0x4482('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3ce58c,_0x3c3e0a);_0x4260fc(_0x3c3e0a);});});} \ No newline at end of file +var _0x8a63=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xeb35aa,_0x14d4de){var _0x3712ff=function(_0x58f96e){while(--_0x58f96e){_0xeb35aa['push'](_0xeb35aa['shift']());}};_0x3712ff(++_0x14d4de);}(_0x8a63,0x67));var _0x38a6=function(_0xafe946,_0x818840){_0xafe946=_0xafe946-0x0;var _0x1f4fd0=_0x8a63[_0xafe946];return _0x1f4fd0;};'use strict';var _=require(_0x38a6('0x0'));var util=require(_0x38a6('0x1'));var moment=require(_0x38a6('0x2'));var BPromise=require(_0x38a6('0x3'));var rs=require(_0x38a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38a6('0x5'))['db'];var utils=require(_0x38a6('0x6'));var logger=require(_0x38a6('0x7'))(_0x38a6('0x8'));var config=require(_0x38a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38a6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14b2ed,_0x195b5d,_0x1ebbbf){return new BPromise(function(_0x1dbfda,_0x44de71){return client[_0x38a6('0xb')](_0x14b2ed,_0x1ebbbf)['then'](function(_0x4a4b0d){logger['info'](_0x38a6('0xc'),_0x195b5d,_0x38a6('0xd'));logger[_0x38a6('0xe')](_0x38a6('0xf'),_0x195b5d,'request\x20sent',JSON[_0x38a6('0x10')](_0x4a4b0d));if(_0x4a4b0d[_0x38a6('0x11')]){if(_0x4a4b0d[_0x38a6('0x11')][_0x38a6('0x12')]===0x1f4){logger[_0x38a6('0x11')](_0x38a6('0xc'),_0x195b5d,_0x4a4b0d[_0x38a6('0x11')][_0x38a6('0x13')]);return _0x44de71(_0x4a4b0d[_0x38a6('0x11')]['message']);}logger[_0x38a6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x195b5d,_0x4a4b0d['error'][_0x38a6('0x13')]);return _0x1dbfda(_0x4a4b0d[_0x38a6('0x11')][_0x38a6('0x13')]);}else{logger[_0x38a6('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x195b5d,_0x38a6('0xd'));_0x1dbfda(_0x4a4b0d[_0x38a6('0x15')]['message']);}})[_0x38a6('0x16')](function(_0x306c4a){logger[_0x38a6('0x11')](_0x38a6('0xc'),_0x195b5d,_0x306c4a);_0x44de71(_0x306c4a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 06f28be..2c8f8ec 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 _0xc4a1=['get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x470907,_0x218b7a){var _0x5d31d5=function(_0xc40719){while(--_0xc40719){_0x470907['push'](_0x470907['shift']());}};_0x5d31d5(++_0x218b7a);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x5e5fe2,_0x36d201){_0x5e5fe2=_0x5e5fe2-0x0;var _0x347fb0=_0xc4a1[_0x5e5fe2];return _0x347fb0;};'use strict';var multer=require(_0x1c4a('0x0'));var util=require('util');var path=require(_0x1c4a('0x1'));var timeout=require(_0x1c4a('0x2'));var express=require(_0x1c4a('0x3'));var router=express['Router']();var fs_extra=require(_0x1c4a('0x4'));var auth=require(_0x1c4a('0x5'));var interaction=require(_0x1c4a('0x6'));var config=require(_0x1c4a('0x7'));var controller=require(_0x1c4a('0x8'));router[_0x1c4a('0x9')]('/',auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xb')]);router[_0x1c4a('0x9')](_0x1c4a('0xc'),auth[_0x1c4a('0xa')](),controller[_0x1c4a('0xd')]);router[_0x1c4a('0xe')]('/',auth['isAuthenticated'](),controller[_0x1c4a('0xf')]);router[_0x1c4a('0x10')]('/:id',auth[_0x1c4a('0xa')](),controller['update']);router['delete'](_0x1c4a('0xc'),auth[_0x1c4a('0xa')](),controller['destroy']);module[_0x1c4a('0x11')]=router; \ No newline at end of file +var _0xa98d=['put','update','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create'];(function(_0x4c0d80,_0x46a7c4){var _0x20ce89=function(_0x5617f3){while(--_0x5617f3){_0x4c0d80['push'](_0x4c0d80['shift']());}};_0x20ce89(++_0x46a7c4);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xda98('0x0'));var util=require('util');var path=require(_0xda98('0x1'));var timeout=require('connect-timeout');var express=require(_0xda98('0x2'));var router=express[_0xda98('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda98('0x4'));var interaction=require(_0xda98('0x5'));var config=require(_0xda98('0x6'));var controller=require('./variable.controller');router[_0xda98('0x7')]('/',auth[_0xda98('0x8')](),controller[_0xda98('0x9')]);router[_0xda98('0x7')](_0xda98('0xa'),auth[_0xda98('0x8')](),controller['show']);router[_0xda98('0xb')]('/',auth['isAuthenticated'](),controller[_0xda98('0xc')]);router[_0xda98('0xd')]('/:id',auth[_0xda98('0x8')](),controller[_0xda98('0xe')]);router['delete'](_0xda98('0xa'),auth[_0xda98('0x8')](),controller[_0xda98('0xf')]);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 63f5886..1253a7a 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 _0x2011=['exports','STRING','name','sequelize'];(function(_0x4c8352,_0x340f44){var _0x39b975=function(_0x4b9a9f){while(--_0x4b9a9f){_0x4c8352['push'](_0x4c8352['shift']());}};_0x39b975(++_0x340f44);}(_0x2011,0x73));var _0x1201=function(_0x57ad38,_0x2bba43){_0x57ad38=_0x57ad38-0x0;var _0x596a2c=_0x2011[_0x57ad38];return _0x596a2c;};'use strict';var Sequelize=require(_0x1201('0x0'));module[_0x1201('0x1')]={'name':{'type':Sequelize[_0x1201('0x2')],'unique':_0x1201('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1201('0x2')]}}; \ No newline at end of file +var _0x4082=['STRING','sequelize','exports'];(function(_0x4fc436,_0x2fc506){var _0x7e7bfc=function(_0x11adba){while(--_0x11adba){_0x4fc436['push'](_0x4fc436['shift']());}};_0x7e7bfc(++_0x2fc506);}(_0x4082,0x118));var _0x2408=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4082[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x2408('0x0'));module[_0x2408('0x1')]={'name':{'type':Sequelize[_0x2408('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2408('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 896a669..a969792 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 _0xb44d=['send','index','Variable','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','UserProfileResource','destroy','then','error','stack','name'];(function(_0xebd98e,_0x43b39d){var _0x5f4f75=function(_0x41019d){while(--_0x41019d){_0xebd98e['push'](_0xebd98e['shift']());}};_0x5f4f75(++_0x43b39d);}(_0xb44d,0x163));var _0xdb44=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb44d[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xdb44('0x0'));var rimraf=require(_0xdb44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb44('0x2'));var rp=require(_0xdb44('0x3'));var moment=require('moment');var BPromise=require(_0xdb44('0x4'));var Mustache=require(_0xdb44('0x5'));var util=require(_0xdb44('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdb44('0x7'));var ejs=require(_0xdb44('0x8'));var fs=require('fs');var fs_extra=require(_0xdb44('0x9'));var _=require('lodash');var squel=require(_0xdb44('0xa'));var crypto=require(_0xdb44('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdb44('0xc'));var toCsv=require(_0xdb44('0x7'));var querystring=require(_0xdb44('0xd'));var Papa=require(_0xdb44('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb44('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb44('0x10'))(_0xdb44('0x11'));var utils=require(_0xdb44('0x12'));var config=require(_0xdb44('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb44('0x14'))['db'];function respondWithStatusCode(_0x35f1ea,_0x1cbfb4){_0x1cbfb4=_0x1cbfb4||0xcc;return function(_0x2e3932){if(_0x2e3932){return _0x35f1ea[_0xdb44('0x15')](_0x1cbfb4);}return _0x35f1ea[_0xdb44('0x16')](_0x1cbfb4)[_0xdb44('0x17')]();};}function respondWithResult(_0x478150,_0x2d3680){_0x2d3680=_0x2d3680||0xc8;return function(_0x5caaef){if(_0x5caaef){return _0x478150[_0xdb44('0x16')](_0x2d3680)['json'](_0x5caaef);}};}function respondWithFilteredResult(_0x5b7fdd,_0x15f450){return function(_0x516c7d){if(_0x516c7d){var _0x23bb9f=typeof _0x15f450[_0xdb44('0x18')]===_0xdb44('0x19')&&typeof _0x15f450[_0xdb44('0x1a')]===_0xdb44('0x19');var _0x68671=_0x516c7d['count'];var _0x3adc60=_0x23bb9f?0x0:_0x15f450['offset'];var _0x5ab85c=_0x23bb9f?_0x516c7d[_0xdb44('0x1b')]:_0x15f450['offset']+_0x15f450['limit'];var _0x582193;if(_0x5ab85c>=_0x68671){_0x5ab85c=_0x68671;_0x582193=0xc8;}else{_0x582193=0xce;}_0x5b7fdd[_0xdb44('0x16')](_0x582193);return _0x5b7fdd['set'](_0xdb44('0x1c'),_0x3adc60+'-'+_0x5ab85c+'/'+_0x68671)[_0xdb44('0x1d')](_0x516c7d);}return null;};}function patchUpdates(_0x3fadd6){return function(_0x1bd05f){try{jsonpatch[_0xdb44('0x1e')](_0x1bd05f,_0x3fadd6,!![]);}catch(_0x5f2442){return BPromise[_0xdb44('0x1f')](_0x5f2442);}return _0x1bd05f[_0xdb44('0x20')]();};}function saveUpdates(_0x5d267e,_0x4a5b27){return function(_0x4082ee){if(_0x4082ee){return _0x4082ee[_0xdb44('0x21')](_0x5d267e)['then'](function(_0x20a668){return _0x20a668;});}return null;};}function removeEntity(_0x2e8171,_0x3af18a){return function(_0x24ecf3){if(_0x24ecf3){return _0x24ecf3['destroy']()['then'](function(){var _0x3d80c5=_0x24ecf3['get']({'plain':!![]});var _0x196842='Variables';return db[_0xdb44('0x22')][_0xdb44('0x23')]({'where':{'type':_0x196842,'resourceId':_0x3d80c5['id']}})['then'](function(){return _0x24ecf3;});})[_0xdb44('0x24')](function(){_0x2e8171[_0xdb44('0x16')](0xcc)[_0xdb44('0x17')]();});}};}function handleEntityNotFound(_0x3f5072,_0x2de6fb){return function(_0x114dd8){if(!_0x114dd8){_0x3f5072[_0xdb44('0x15')](0x194);}return _0x114dd8;};}function handleError(_0x21012f,_0x446364){_0x446364=_0x446364||0x1f4;return function(_0x2f5f81){logger[_0xdb44('0x25')](_0x2f5f81[_0xdb44('0x26')]);if(_0x2f5f81[_0xdb44('0x27')]){delete _0x2f5f81['name'];}_0x21012f['status'](_0x446364)[_0xdb44('0x28')](_0x2f5f81);};}exports[_0xdb44('0x29')]=function(_0x38fd9f,_0x32e356){var _0x4490e5={},_0x3f7b98={},_0x4a0310={'count':0x0,'rows':[]};var _0xfb7c09=_['map'](db[_0xdb44('0x2a')][_0xdb44('0x2b')],function(_0x1a7005){return{'name':_0x1a7005['fieldName'],'type':_0x1a7005[_0xdb44('0x2c')]['key']};});_0x3f7b98['model']=_[_0xdb44('0x2d')](_0xfb7c09,_0xdb44('0x27'));_0x3f7b98[_0xdb44('0x2e')]=_[_0xdb44('0x2f')](_0x38fd9f['query']);_0x3f7b98[_0xdb44('0x30')]=_['intersection'](_0x3f7b98[_0xdb44('0x31')],_0x3f7b98['query']);_0x4490e5[_0xdb44('0x32')]=_[_0xdb44('0x33')](_0x3f7b98[_0xdb44('0x31')],qs[_0xdb44('0x34')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x34')]));_0x4490e5[_0xdb44('0x32')]=_0x4490e5[_0xdb44('0x32')]['length']?_0x4490e5[_0xdb44('0x32')]:_0x3f7b98[_0xdb44('0x31')];if(!_0x38fd9f[_0xdb44('0x2e')]['hasOwnProperty'](_0xdb44('0x35'))){_0x4490e5[_0xdb44('0x1a')]=qs[_0xdb44('0x1a')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x1a')]);_0x4490e5[_0xdb44('0x18')]=qs[_0xdb44('0x18')](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x18')]);}_0x4490e5[_0xdb44('0x36')]=qs['sort'](_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x37')]);_0x4490e5[_0xdb44('0x38')]=qs['filters'](_[_0xdb44('0x39')](_0x38fd9f['query'],_0x3f7b98[_0xdb44('0x30')]),_0xfb7c09);if(_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3a')]){_0x4490e5['where']=_['merge'](_0x4490e5['where'],{'$or':_[_0xdb44('0x2d')](_0xfb7c09,function(_0x18c32b){if(_0x18c32b[_0xdb44('0x2c')]!=='VIRTUAL'){var _0x2d6358={};_0x2d6358[_0x18c32b[_0xdb44('0x27')]]={'$like':'%'+_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3a')]+'%'};return _0x2d6358;}})});}_0x4490e5=_[_0xdb44('0x3b')]({},_0x4490e5,_0x38fd9f['options']);var _0x1d1b7a={'where':_0x4490e5[_0xdb44('0x38')]};return db[_0xdb44('0x2a')]['count'](_0x1d1b7a)[_0xdb44('0x24')](function(_0x22e9c4){_0x4a0310[_0xdb44('0x1b')]=_0x22e9c4;if(_0x38fd9f[_0xdb44('0x2e')][_0xdb44('0x3c')]){_0x4490e5[_0xdb44('0x3d')]=[{'all':!![]}];}return db['Variable'][_0xdb44('0x3e')](_0x4490e5);})[_0xdb44('0x24')](function(_0x357b3f){_0x4a0310[_0xdb44('0x3f')]=_0x357b3f;return _0x4a0310;})['then'](respondWithFilteredResult(_0x32e356,_0x4490e5))[_0xdb44('0x40')](handleError(_0x32e356,null));};exports[_0xdb44('0x41')]=function(_0x28f69a,_0x38e0a2){var _0x3d93ce={'raw':!![],'where':{'id':_0x28f69a[_0xdb44('0x42')]['id']}},_0x1d5f17={};_0x1d5f17['model']=_[_0xdb44('0x2f')](db[_0xdb44('0x2a')]['rawAttributes']);_0x1d5f17['query']=_[_0xdb44('0x2f')](_0x28f69a[_0xdb44('0x2e')]);_0x1d5f17['filters']=_[_0xdb44('0x33')](_0x1d5f17['model'],_0x1d5f17['query']);_0x3d93ce[_0xdb44('0x32')]=_['intersection'](_0x1d5f17[_0xdb44('0x31')],qs['fields'](_0x28f69a['query'][_0xdb44('0x34')]));_0x3d93ce['attributes']=_0x3d93ce['attributes'][_0xdb44('0x43')]?_0x3d93ce[_0xdb44('0x32')]:_0x1d5f17[_0xdb44('0x31')];if(_0x28f69a['query'][_0xdb44('0x3c')]){_0x3d93ce[_0xdb44('0x3d')]=[{'all':!![]}];}_0x3d93ce=_[_0xdb44('0x3b')]({},_0x3d93ce,_0x28f69a['options']);return db[_0xdb44('0x2a')][_0xdb44('0x44')](_0x3d93ce)[_0xdb44('0x24')](handleEntityNotFound(_0x38e0a2,null))[_0xdb44('0x24')](respondWithResult(_0x38e0a2,null))[_0xdb44('0x40')](handleError(_0x38e0a2,null));};exports[_0xdb44('0x45')]=function(_0x529019,_0x2a29a2){return db[_0xdb44('0x2a')]['create'](_0x529019[_0xdb44('0x46')],{})[_0xdb44('0x24')](function(_0x1c8713){var _0x1411bd=_0x529019[_0xdb44('0x47')][_0xdb44('0x48')]({'plain':!![]});if(!_0x1411bd)throw new Error(_0xdb44('0x49'));if(_0x1411bd[_0xdb44('0x4a')]===_0xdb44('0x47')){var _0xbb43d6=_0x1c8713[_0xdb44('0x48')]({'plain':!![]});var _0x17a586=_0xdb44('0x4b');return db[_0xdb44('0x4c')][_0xdb44('0x44')]({'where':{'name':_0x17a586,'userProfileId':_0x1411bd[_0xdb44('0x4d')]},'raw':!![]})[_0xdb44('0x24')](function(_0x12f5c3){if(_0x12f5c3&&_0x12f5c3[_0xdb44('0x4e')]===0x0){return db[_0xdb44('0x22')][_0xdb44('0x45')]({'name':_0xbb43d6[_0xdb44('0x27')],'resourceId':_0xbb43d6['id'],'type':_0x12f5c3[_0xdb44('0x27')],'sectionId':_0x12f5c3['id']},{})[_0xdb44('0x24')](function(){return _0x1c8713;});}else{return _0x1c8713;}})['catch'](function(_0x54fc37){logger[_0xdb44('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fc37);throw _0x54fc37;});}return _0x1c8713;})['then'](respondWithResult(_0x2a29a2,0xc9))[_0xdb44('0x40')](handleError(_0x2a29a2,null));};exports[_0xdb44('0x21')]=function(_0x5e64db,_0x2b4ac3){if(_0x5e64db[_0xdb44('0x46')]['id']){delete _0x5e64db[_0xdb44('0x46')]['id'];}return db['Variable'][_0xdb44('0x44')]({'where':{'id':_0x5e64db[_0xdb44('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b4ac3,null))[_0xdb44('0x24')](saveUpdates(_0x5e64db[_0xdb44('0x46')],null))['then'](respondWithResult(_0x2b4ac3,null))[_0xdb44('0x40')](handleError(_0x2b4ac3,null));};exports[_0xdb44('0x23')]=function(_0x21a7d5,_0x3115d9){return db[_0xdb44('0x2a')]['find']({'where':{'id':_0x21a7d5['params']['id']}})[_0xdb44('0x24')](handleEntityNotFound(_0x3115d9,null))['then'](removeEntity(_0x3115d9,null))[_0xdb44('0x40')](handleError(_0x3115d9,null));}; \ No newline at end of file +var _0x97a7=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97a7,0xd9));var _0x797a=function(_0x3d593d,_0x1dec8d){_0x3d593d=_0x3d593d-0x0;var _0x501ec5=_0x97a7[_0x3d593d];return _0x501ec5;};'use strict';var emlformat=require(_0x797a('0x0'));var rimraf=require(_0x797a('0x1'));var zipdir=require(_0x797a('0x2'));var jsonpatch=require(_0x797a('0x3'));var rp=require(_0x797a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x797a('0x5'));var util=require(_0x797a('0x6'));var path=require(_0x797a('0x7'));var sox=require(_0x797a('0x8'));var csv=require(_0x797a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x797a('0xa'));var _=require(_0x797a('0xb'));var squel=require('squel');var crypto=require(_0x797a('0xc'));var jsforce=require(_0x797a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x797a('0xe'));var Papa=require(_0x797a('0xf'));var Redis=require(_0x797a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x797a('0x11'));var as=require(_0x797a('0x12'));var hardwareService=require(_0x797a('0x13'));var logger=require(_0x797a('0x14'))(_0x797a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x797a('0x16'))['db'];function respondWithStatusCode(_0x254d92,_0x321257){_0x321257=_0x321257||0xcc;return function(_0x313e46){if(_0x313e46){return _0x254d92[_0x797a('0x17')](_0x321257);}return _0x254d92[_0x797a('0x18')](_0x321257)[_0x797a('0x19')]();};}function respondWithResult(_0x47b341,_0x590f27){_0x590f27=_0x590f27||0xc8;return function(_0x4e3f0d){if(_0x4e3f0d){return _0x47b341[_0x797a('0x18')](_0x590f27)[_0x797a('0x1a')](_0x4e3f0d);}};}function respondWithFilteredResult(_0x5ac49a,_0x58a0f7){return function(_0x7990){if(_0x7990){var _0x1ee72d=typeof _0x58a0f7[_0x797a('0x1b')]===_0x797a('0x1c')&&typeof _0x58a0f7[_0x797a('0x1d')]===_0x797a('0x1c');var _0x4dc64f=_0x7990[_0x797a('0x1e')];var _0x38b7cd=_0x1ee72d?0x0:_0x58a0f7['offset'];var _0x421601=_0x1ee72d?_0x7990[_0x797a('0x1e')]:_0x58a0f7[_0x797a('0x1b')]+_0x58a0f7[_0x797a('0x1d')];var _0x5b679e;if(_0x421601>=_0x4dc64f){_0x421601=_0x4dc64f;_0x5b679e=0xc8;}else{_0x5b679e=0xce;}_0x5ac49a[_0x797a('0x18')](_0x5b679e);return _0x5ac49a['set'](_0x797a('0x1f'),_0x38b7cd+'-'+_0x421601+'/'+_0x4dc64f)['json'](_0x7990);}return null;};}function patchUpdates(_0x5e686){return function(_0x216f54){try{jsonpatch[_0x797a('0x20')](_0x216f54,_0x5e686,!![]);}catch(_0x3fa8e4){return BPromise[_0x797a('0x21')](_0x3fa8e4);}return _0x216f54[_0x797a('0x22')]();};}function saveUpdates(_0xdbbbc2,_0x4eb828){return function(_0x3bb867){if(_0x3bb867){return _0x3bb867[_0x797a('0x23')](_0xdbbbc2)[_0x797a('0x24')](function(_0x501f1e){return _0x501f1e;});}return null;};}function removeEntity(_0x44db00,_0x1f21d9){return function(_0x3627a0){if(_0x3627a0){return _0x3627a0[_0x797a('0x25')]()[_0x797a('0x24')](function(){var _0x1d6aeb=_0x3627a0[_0x797a('0x26')]({'plain':!![]});var _0x5362e6='Variables';return db[_0x797a('0x27')]['destroy']({'where':{'type':_0x5362e6,'resourceId':_0x1d6aeb['id']}})[_0x797a('0x24')](function(){return _0x3627a0;});})[_0x797a('0x24')](function(){_0x44db00[_0x797a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d39cc,_0x4aec52){return function(_0x2d89a7){if(!_0x2d89a7){_0x5d39cc[_0x797a('0x17')](0x194);}return _0x2d89a7;};}function handleError(_0x472b16,_0x490036){_0x490036=_0x490036||0x1f4;return function(_0x38636c){logger[_0x797a('0x28')](_0x38636c[_0x797a('0x29')]);if(_0x38636c[_0x797a('0x2a')]){delete _0x38636c['name'];}_0x472b16['status'](_0x490036)[_0x797a('0x2b')](_0x38636c);};}exports['index']=function(_0x36e93f,_0x178fcb){var _0x10d75c={},_0x11853b={},_0x5ef75f={'count':0x0,'rows':[]};var _0x22f723=_[_0x797a('0x2c')](db[_0x797a('0x2d')][_0x797a('0x2e')],function(_0x5172f1){return{'name':_0x5172f1[_0x797a('0x2f')],'type':_0x5172f1[_0x797a('0x30')][_0x797a('0x31')]};});_0x11853b[_0x797a('0x32')]=_[_0x797a('0x2c')](_0x22f723,_0x797a('0x2a'));_0x11853b[_0x797a('0x33')]=_['keys'](_0x36e93f['query']);_0x11853b[_0x797a('0x34')]=_[_0x797a('0x35')](_0x11853b[_0x797a('0x32')],_0x11853b[_0x797a('0x33')]);_0x10d75c[_0x797a('0x36')]=_[_0x797a('0x35')](_0x11853b['model'],qs[_0x797a('0x37')](_0x36e93f[_0x797a('0x33')][_0x797a('0x37')]));_0x10d75c['attributes']=_0x10d75c['attributes']['length']?_0x10d75c['attributes']:_0x11853b[_0x797a('0x32')];if(!_0x36e93f[_0x797a('0x33')][_0x797a('0x38')](_0x797a('0x39'))){_0x10d75c[_0x797a('0x1d')]=qs['limit'](_0x36e93f[_0x797a('0x33')]['limit']);_0x10d75c['offset']=qs['offset'](_0x36e93f[_0x797a('0x33')]['offset']);}_0x10d75c[_0x797a('0x3a')]=qs['sort'](_0x36e93f[_0x797a('0x33')]['sort']);_0x10d75c[_0x797a('0x3b')]=qs[_0x797a('0x34')](_[_0x797a('0x3c')](_0x36e93f['query'],_0x11853b[_0x797a('0x34')]),_0x22f723);if(_0x36e93f[_0x797a('0x33')][_0x797a('0x3d')]){_0x10d75c[_0x797a('0x3b')]=_[_0x797a('0x3e')](_0x10d75c[_0x797a('0x3b')],{'$or':_[_0x797a('0x2c')](_0x22f723,function(_0x117532){if(_0x117532[_0x797a('0x30')]!=='VIRTUAL'){var _0x4d6a2c={};_0x4d6a2c[_0x117532['name']]={'$like':'%'+_0x36e93f[_0x797a('0x33')]['filter']+'%'};return _0x4d6a2c;}})});}_0x10d75c=_[_0x797a('0x3e')]({},_0x10d75c,_0x36e93f['options']);var _0x2e82c5={'where':_0x10d75c[_0x797a('0x3b')]};return db[_0x797a('0x2d')][_0x797a('0x1e')](_0x2e82c5)[_0x797a('0x24')](function(_0x5d075e){_0x5ef75f['count']=_0x5d075e;if(_0x36e93f[_0x797a('0x33')][_0x797a('0x3f')]){_0x10d75c[_0x797a('0x40')]=[{'all':!![]}];}return db['Variable'][_0x797a('0x41')](_0x10d75c);})[_0x797a('0x24')](function(_0x48df5b){_0x5ef75f[_0x797a('0x42')]=_0x48df5b;return _0x5ef75f;})[_0x797a('0x24')](respondWithFilteredResult(_0x178fcb,_0x10d75c))[_0x797a('0x43')](handleError(_0x178fcb,null));};exports[_0x797a('0x44')]=function(_0x4af18b,_0xcad746){var _0x50a027={'raw':!![],'where':{'id':_0x4af18b[_0x797a('0x45')]['id']}},_0x2f9966={};_0x2f9966[_0x797a('0x32')]=_['keys'](db[_0x797a('0x2d')][_0x797a('0x2e')]);_0x2f9966[_0x797a('0x33')]=_['keys'](_0x4af18b['query']);_0x2f9966['filters']=_[_0x797a('0x35')](_0x2f9966['model'],_0x2f9966[_0x797a('0x33')]);_0x50a027[_0x797a('0x36')]=_[_0x797a('0x35')](_0x2f9966['model'],qs['fields'](_0x4af18b[_0x797a('0x33')]['fields']));_0x50a027['attributes']=_0x50a027[_0x797a('0x36')]['length']?_0x50a027['attributes']:_0x2f9966[_0x797a('0x32')];if(_0x4af18b[_0x797a('0x33')][_0x797a('0x3f')]){_0x50a027[_0x797a('0x40')]=[{'all':!![]}];}_0x50a027=_[_0x797a('0x3e')]({},_0x50a027,_0x4af18b['options']);return db['Variable'][_0x797a('0x46')](_0x50a027)[_0x797a('0x24')](handleEntityNotFound(_0xcad746,null))[_0x797a('0x24')](respondWithResult(_0xcad746,null))['catch'](handleError(_0xcad746,null));};exports['create']=function(_0x282758,_0x41a20a){return db[_0x797a('0x2d')][_0x797a('0x47')](_0x282758[_0x797a('0x48')],{})[_0x797a('0x24')](function(_0x228318){var _0x38368a=_0x282758['user'][_0x797a('0x26')]({'plain':!![]});if(!_0x38368a)throw new Error(_0x797a('0x49'));if(_0x38368a[_0x797a('0x4a')]===_0x797a('0x4b')){var _0x42a784=_0x228318['get']({'plain':!![]});var _0x26c20c=_0x797a('0x4c');return db[_0x797a('0x4d')][_0x797a('0x46')]({'where':{'name':_0x26c20c,'userProfileId':_0x38368a[_0x797a('0x4e')]},'raw':!![]})['then'](function(_0x271a0f){if(_0x271a0f&&_0x271a0f[_0x797a('0x4f')]===0x0){return db[_0x797a('0x27')][_0x797a('0x47')]({'name':_0x42a784['name'],'resourceId':_0x42a784['id'],'type':_0x271a0f[_0x797a('0x2a')],'sectionId':_0x271a0f['id']},{})[_0x797a('0x24')](function(){return _0x228318;});}else{return _0x228318;}})['catch'](function(_0x57165a){logger[_0x797a('0x28')](_0x797a('0x50'),_0x57165a);throw _0x57165a;});}return _0x228318;})[_0x797a('0x24')](respondWithResult(_0x41a20a,0xc9))[_0x797a('0x43')](handleError(_0x41a20a,null));};exports[_0x797a('0x23')]=function(_0x3cd45d,_0x18b94d){if(_0x3cd45d[_0x797a('0x48')]['id']){delete _0x3cd45d[_0x797a('0x48')]['id'];}return db['Variable'][_0x797a('0x46')]({'where':{'id':_0x3cd45d[_0x797a('0x45')]['id']}})['then'](handleEntityNotFound(_0x18b94d,null))[_0x797a('0x24')](saveUpdates(_0x3cd45d['body'],null))['then'](respondWithResult(_0x18b94d,null))[_0x797a('0x43')](handleError(_0x18b94d,null));};exports[_0x797a('0x25')]=function(_0x225ffd,_0x72cef9){return db['Variable'][_0x797a('0x46')]({'where':{'id':_0x225ffd['params']['id']}})[_0x797a('0x24')](handleEntityNotFound(_0x72cef9,null))['then'](removeEntity(_0x72cef9,null))[_0x797a('0x43')](handleError(_0x72cef9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0a8cff9..9e21c0e 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 _0x8d3a=['request-promise','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','util','api','moment','bluebird'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x8d3a,0x75));var _0xa8d3=function(_0x332d0a,_0x155185){_0x332d0a=_0x332d0a-0x0;var _0x13270f=_0x8d3a[_0x332d0a];return _0x13270f;};'use strict';var _=require('lodash');var util=require(_0xa8d3('0x0'));var logger=require('../../config/logger')(_0xa8d3('0x1'));var moment=require(_0xa8d3('0x2'));var BPromise=require(_0xa8d3('0x3'));var rp=require(_0xa8d3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8d3('0x5'));var config=require(_0xa8d3('0x6'));var attributes=require(_0xa8d3('0x7'));module['exports']=function(_0x57bbb2,_0x3ba805){return _0x57bbb2[_0xa8d3('0x8')](_0xa8d3('0x9'),attributes,{'tableName':_0xa8d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd08d=['request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird'];(function(_0x101066,_0x1c5c2f){var _0x4be7aa=function(_0x335c0b){while(--_0x335c0b){_0x101066['push'](_0x101066['shift']());}};_0x4be7aa(++_0x1c5c2f);}(_0xd08d,0xcb));var _0xdd08=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xd08d[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0xdd08('0x0'));var util=require(_0xdd08('0x1'));var logger=require(_0xdd08('0x2'))(_0xdd08('0x3'));var moment=require('moment');var BPromise=require(_0xdd08('0x4'));var rp=require(_0xdd08('0x5'));var fs=require('fs');var path=require(_0xdd08('0x6'));var rimraf=require(_0xdd08('0x7'));var config=require(_0xdd08('0x8'));var attributes=require(_0xdd08('0x9'));module['exports']=function(_0x1df167,_0x359c3d){return _0x1df167[_0xdd08('0xa')](_0xdd08('0xb'),attributes,{'tableName':_0xdd08('0xc'),'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 3403053..d78bc62 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 _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x138144,_0x14a733){var _0x489bbd=function(_0x5324c1){while(--_0x5324c1){_0x138144['push'](_0x138144['shift']());}};_0x489bbd(++_0x14a733);}(_0xf494,0x1c6));var _0x4f49=function(_0x4fd23e,_0x28c245){_0x4fd23e=_0x4fd23e-0x0;var _0x3e6dfc=_0xf494[_0x4fd23e];return _0x3e6dfc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x19beab,_0x2c9e3e){var _0x14d7fe=function(_0x96cb5){while(--_0x96cb5){_0x19beab['push'](_0x19beab['shift']());}};_0x14d7fe(++_0x2c9e3e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x336b79,_0x2b003b){_0x336b79=_0x336b79-0x0;var _0x35eabe=_0x8ef6[_0x336b79];return _0x35eabe;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 195aa07..3edd2d9 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 _0x8b79=['migrations','exports','express','./version.controller','get','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','pull','/restart','/migrations'];(function(_0x2c3c90,_0x35da39){var _0x324c4a=function(_0x55a2b8){while(--_0x55a2b8){_0x2c3c90['push'](_0x2c3c90['shift']());}};_0x324c4a(++_0x35da39);}(_0x8b79,0x136));var _0x98b7=function(_0x29c773,_0xb8a852){_0x29c773=_0x29c773-0x0;var _0x2bfc4d=_0x8b79[_0x29c773];return _0x2bfc4d;};'use strict';var express=require(_0x98b7('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x98b7('0x1'));router['get']('/',controller['index']);router[_0x98b7('0x2')]('/fetch',auth['isAuthenticated'](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x4')]);router[_0x98b7('0x2')](_0x98b7('0x5'),auth[_0x98b7('0x6')](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x7')]);router[_0x98b7('0x2')](_0x98b7('0x8'),auth['isAuthenticated'](),auth[_0x98b7('0x3')](),controller[_0x98b7('0x9')]);router[_0x98b7('0x2')](_0x98b7('0xa'),auth[_0x98b7('0x6')](),controller['restart']);router[_0x98b7('0x2')](_0x98b7('0xb'),controller[_0x98b7('0xc')]);module[_0x98b7('0xd')]=router; \ No newline at end of file +var _0x6b59=['/migrations','migrations','exports','express','Router','./version.controller','get','index','/fetch','fetch','/reset','canUpdate','reset','/pull','isAuthenticated','pull','/restart','restart'];(function(_0x1699e6,_0x42fdea){var _0x70470d=function(_0x2c538a){while(--_0x2c538a){_0x1699e6['push'](_0x1699e6['shift']());}};_0x70470d(++_0x42fdea);}(_0x6b59,0x1c5));var _0x96b5=function(_0x215eab,_0x3c3938){_0x215eab=_0x215eab-0x0;var _0x31d024=_0x6b59[_0x215eab];return _0x31d024;};'use strict';var express=require(_0x96b5('0x0'));var router=express[_0x96b5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x96b5('0x2'));router[_0x96b5('0x3')]('/',controller[_0x96b5('0x4')]);router[_0x96b5('0x3')](_0x96b5('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x96b5('0x6')]);router[_0x96b5('0x3')](_0x96b5('0x7'),auth['isAuthenticated'](),auth[_0x96b5('0x8')](),controller[_0x96b5('0x9')]);router[_0x96b5('0x3')](_0x96b5('0xa'),auth[_0x96b5('0xb')](),auth[_0x96b5('0x8')](),controller[_0x96b5('0xc')]);router[_0x96b5('0x3')](_0x96b5('0xd'),auth[_0x96b5('0xb')](),controller[_0x96b5('0xe')]);router[_0x96b5('0x3')](_0x96b5('0xf'),controller[_0x96b5('0x10')]);module[_0x96b5('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6cac9de..5f86e90 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 _0x2827=['exports','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','migrations','replace','push','length','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.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../config/pm2','update','simple-git','index'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x2827,0x9d));var _0x7282=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2827[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require(_0x7282('0x0'));var path=require(_0x7282('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x7282('0x2'))(module,_0x7282('0x3'));var compareVersions=require(_0x7282('0x4'));var exec=require(_0x7282('0x5'))[_0x7282('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x7282('0x7'));var logger=require('../../config/logger')(_0x7282('0x8'));var git=require(_0x7282('0x9'))(config['root']);exports[_0x7282('0xa')]=function(_0x35aaf1,_0x158278){var _0x2b527f={'current':module[_0x7282('0xb')][_0x7282('0x3')],'phonebar':0x2};if(_0x35aaf1[_0x7282('0xc')]&&_0x35aaf1[_0x7282('0xc')][_0x7282('0xd')]){return git[_0x7282('0xe')]()[_0x7282('0xf')](function(_0x35ad76,_0x3c0040){_0x2b527f[_0x7282('0xd')]=(_0x35ad76?module[_0x7282('0xb')][_0x7282('0x3')]:_0x3c0040[_0x7282('0xd')])||_0x7282('0x10');return _0x158278[_0x7282('0x11')](0xc8)[_0x7282('0x12')](_0x2b527f);});}else{return _0x158278[_0x7282('0x11')](0xc8)[_0x7282('0x12')](_0x2b527f);}};exports[_0x7282('0xe')]=function(_0x7cfa6b,_0x3a90fc){return git['fetch']([_0x7282('0x13'),'master'],function(_0x39d00d){if(_0x39d00d){logger[_0x7282('0x14')](_0x39d00d);return _0x3a90fc[_0x7282('0x11')](0x1f4)[_0x7282('0x12')](_0x39d00d);}logger[_0x7282('0x15')](_0x7282('0x16'));return _0x3a90fc['status'](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x17')});});};exports['reset']=function(_0x12b33d,_0x7ee64d){return git['reset']([_0x7282('0x18'),_0x7282('0x19')],function(_0xf81efa){if(_0xf81efa){logger[_0x7282('0x14')](_0xf81efa);return _0x7ee64d['status'](0x1f4)['json'](_0xf81efa);}logger['info'](_0x7282('0x1a'));return _0x7ee64d[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x1b')});});};exports[_0x7282('0x1c')]=function(_0x2f0b36,_0x3f31c3){exec(_0x7282('0x1d'),function(_0x3cbaa1,_0x31dd73,_0x19a561){logger[_0x7282('0x15')](_0x31dd73);logger['info'](_0x19a561);if(_0x3cbaa1){logger[_0x7282('0x14')](_0x3cbaa1);return _0x3f31c3['status'](0x1f4)[_0x7282('0x12')](_0x3cbaa1);}return _0x3f31c3[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x31dd73});});};exports[_0x7282('0x1e')]=function(_0xe9d76f,_0x5844d9){return pm2['restart'](_0x7282('0x1f'))[_0x7282('0x20')](function(_0x121b9b){logger['info'](_0x7282('0x21'),_0x121b9b);return _0x5844d9[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x22')});})[_0x7282('0x23')](function(_0x3cda07){logger[_0x7282('0x14')](_0x3cda07);return _0x5844d9['status'](0x1f4)[_0x7282('0x12')](_0x3cda07);});};exports['migrations']=function(_0x4f1ef1,_0x48bc26){var _0x32cb91=fs[_0x7282('0x24')](path[_0x7282('0x25')](config[_0x7282('0x26')],'server',_0x7282('0x27')));var _0x15bf61=[];for(var _0xd21429=0x0;_0xd21429<_0x32cb91['length'];_0xd21429++){var _0x4320a7=_0x32cb91[_0xd21429][_0x7282('0x28')]('.js','');if(compareVersions(module[_0x7282('0xb')][_0x7282('0x3')],_0x4320a7)===-0x1){_0x15bf61[_0x7282('0x29')](_0x4320a7);}}if(_0x15bf61[_0x7282('0x2a')]){var _0x3863bb=_0x15bf61[_0x7282('0x2b')](compareVersions);var _0x1aaa10=new Umzug({'storage':_0x7282('0x2c'),'storageOptions':{'model':db[_0x7282('0x2d')],'modelName':_0x7282('0x2d'),'columnName':_0x7282('0x3')},'migrations':{'params':[db['sequelize'][_0x7282('0x2e')](),db[_0x7282('0x2c')][_0x7282('0x2f')],function(){throw new Error(_0x7282('0x30'));}],'path':path[_0x7282('0x25')](config[_0x7282('0x26')],_0x7282('0x31'),_0x7282('0x27')),'pattern':/\.js$/}});_0x1aaa10['up']({'migrations':_[_0x7282('0x32')](_0x3863bb,function(_0xbc7a1){return _0xbc7a1+_0x7282('0x33');})})['then'](function(){return _0x48bc26[_0x7282('0x11')](0xc8)['json']({'output':_0x7282('0x34')+module[_0x7282('0xb')][_0x7282('0x3')]+_0x7282('0x35')+_[_0x7282('0x36')](_0x3863bb),'migrations':_[_0x7282('0x25')](_0x3863bb)});})[_0x7282('0x23')](function(_0x567ec5){if(_0x567ec5 instanceof db[_0x7282('0x2c')]['UniqueConstraintError']){return _0x48bc26[_0x7282('0x11')](0xc8)['json']({'output':_0x7282('0x37')});}else{return _0x48bc26[_0x7282('0x11')](0x1f4)[_0x7282('0x12')](_0x567ec5);}});}else{return _0x48bc26[_0x7282('0x11')](0xc8)[_0x7282('0x12')]({'output':_0x7282('0x37')});}}; \ No newline at end of file +var _0x172e=['query','tags','latest','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','replace','length','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/logger','update','simple-git','index','exports'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x172e,0x1b7));var _0xe172=function(_0x221917,_0x5c47db){_0x221917=_0x221917-0x0;var _0x5dc6bd=_0x172e[_0x221917];return _0x5dc6bd;};'use strict';var Umzug=require('umzug');var path=require(_0xe172('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xe172('0x1'))(module,_0xe172('0x2'));var compareVersions=require(_0xe172('0x3'));var exec=require('child_process')[_0xe172('0x4')];var db=require(_0xe172('0x5'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xe172('0x6'))(_0xe172('0x7'));var git=require(_0xe172('0x8'))(config['root']);exports[_0xe172('0x9')]=function(_0x4d4e43,_0x5937d9){var _0x3cff81={'current':module[_0xe172('0xa')]['version'],'phonebar':0x2};if(_0x4d4e43[_0xe172('0xb')]&&_0x4d4e43[_0xe172('0xb')]['latest']){return git['fetch']()[_0xe172('0xc')](function(_0x3f4ae6,_0x645565){_0x3cff81[_0xe172('0xd')]=(_0x3f4ae6?module['exports']['version']:_0x645565[_0xe172('0xd')])||'2.0.0';return _0x5937d9[_0xe172('0xe')](0xc8)[_0xe172('0xf')](_0x3cff81);});}else{return _0x5937d9[_0xe172('0xe')](0xc8)[_0xe172('0xf')](_0x3cff81);}};exports[_0xe172('0x10')]=function(_0x39082d,_0x2491cb){return git[_0xe172('0x10')]([_0xe172('0x11'),_0xe172('0x12')],function(_0x521fa5){if(_0x521fa5){logger[_0xe172('0x13')](_0x521fa5);return _0x2491cb[_0xe172('0xe')](0x1f4)[_0xe172('0xf')](_0x521fa5);}logger['info'](_0xe172('0x14'));return _0x2491cb[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':_0xe172('0x15')});});};exports[_0xe172('0x16')]=function(_0xd282ab,_0x2cfdac){return git[_0xe172('0x16')]([_0xe172('0x17'),_0xe172('0x18')],function(_0x339470){if(_0x339470){logger[_0xe172('0x13')](_0x339470);return _0x2cfdac[_0xe172('0xe')](0x1f4)[_0xe172('0xf')](_0x339470);}logger[_0xe172('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2cfdac[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0xe172('0x1a')]=function(_0x4186f1,_0x5dee70){exec(_0xe172('0x1b'),function(_0x369a14,_0x534c5d,_0x376cab){logger['info'](_0x534c5d);logger[_0xe172('0x19')](_0x376cab);if(_0x369a14){logger[_0xe172('0x13')](_0x369a14);return _0x5dee70[_0xe172('0xe')](0x1f4)['json'](_0x369a14);}return _0x5dee70[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':_0x534c5d});});};exports[_0xe172('0x1c')]=function(_0x30c34a,_0x3810b7){return pm2[_0xe172('0x1c')](_0xe172('0x1d'))[_0xe172('0x1e')](function(_0x495b2d){logger['info'](_0xe172('0x1f'),_0x495b2d);return _0x3810b7[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':_0xe172('0x20')});})[_0xe172('0x21')](function(_0x41c3ce){logger[_0xe172('0x13')](_0x41c3ce);return _0x3810b7[_0xe172('0xe')](0x1f4)[_0xe172('0xf')](_0x41c3ce);});};exports['migrations']=function(_0x45ed93,_0x102b7a){var _0x18fa0b=fs['readdirSync'](path[_0xe172('0x22')](config['root'],'server','migrations'));var _0x2f9529=[];for(var _0x294b06=0x0;_0x294b06<_0x18fa0b['length'];_0x294b06++){var _0x19c708=_0x18fa0b[_0x294b06][_0xe172('0x23')]('.js','');if(compareVersions(module[_0xe172('0xa')][_0xe172('0x2')],_0x19c708)===-0x1){_0x2f9529['push'](_0x19c708);}}if(_0x2f9529[_0xe172('0x24')]){var _0x1c97f2=_0x2f9529[_0xe172('0x25')](compareVersions);var _0x44ecd3=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xe172('0x26')],'modelName':_0xe172('0x26'),'columnName':_0xe172('0x2')},'migrations':{'params':[db[_0xe172('0x27')][_0xe172('0x28')](),db[_0xe172('0x27')][_0xe172('0x29')],function(){throw new Error(_0xe172('0x2a'));}],'path':path[_0xe172('0x22')](config['root'],_0xe172('0x2b'),'migrations'),'pattern':/\.js$/}});_0x44ecd3['up']({'migrations':_[_0xe172('0x2c')](_0x1c97f2,function(_0x3f12eb){return _0x3f12eb+_0xe172('0x2d');})})['then'](function(){return _0x102b7a[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':_0xe172('0x2e')+module[_0xe172('0xa')][_0xe172('0x2')]+'\x20to\x20'+_[_0xe172('0x2f')](_0x1c97f2),'migrations':_[_0xe172('0x22')](_0x1c97f2)});})[_0xe172('0x21')](function(_0xbecf2a){if(_0xbecf2a instanceof db[_0xe172('0x27')][_0xe172('0x30')]){return _0x102b7a[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':_0xe172('0x31')});}else{return _0x102b7a[_0xe172('0xe')](0x1f4)[_0xe172('0xf')](_0xbecf2a);}});}else{return _0x102b7a[_0xe172('0xe')](0xc8)[_0xe172('0xf')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b99a517..2317fe0 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 _0x2f9e=['post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4b3358,_0x5cda77){var _0x1ea011=function(_0x1a17ea){while(--_0x1a17ea){_0x4b3358['push'](_0x4b3358['shift']());}};_0x1ea011(++_0x5cda77);}(_0x2f9e,0x117));var _0xe2f9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2f9e[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xe2f9('0x0'));var util=require(_0xe2f9('0x1'));var path=require('path');var timeout=require(_0xe2f9('0x2'));var express=require(_0xe2f9('0x3'));var router=express[_0xe2f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe2f9('0x5'));var interaction=require(_0xe2f9('0x6'));var config=require(_0xe2f9('0x7'));var controller=require(_0xe2f9('0x8'));router[_0xe2f9('0x9')]('/',auth[_0xe2f9('0xa')](),controller['index']);router[_0xe2f9('0x9')](_0xe2f9('0xb'),auth['isAuthenticated'](),controller[_0xe2f9('0xc')]);router[_0xe2f9('0x9')](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0xe')]);router[_0xe2f9('0xf')]('/',auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x10')]);router[_0xe2f9('0x11')](_0xe2f9('0xd'),auth[_0xe2f9('0xa')](),controller[_0xe2f9('0x12')]);router['delete'](_0xe2f9('0xd'),auth['isAuthenticated'](),controller[_0xe2f9('0x13')]);module[_0xe2f9('0x14')]=router; \ No newline at end of file +var _0x3722=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x3cb62f,_0x253b0b){var _0x7b64dc=function(_0x39b7b4){while(--_0x39b7b4){_0x3cb62f['push'](_0x3cb62f['shift']());}};_0x7b64dc(++_0x253b0b);}(_0x3722,0xfa));var _0x2372=function(_0x5d96ec,_0x39248f){_0x5d96ec=_0x5d96ec-0x0;var _0x350f30=_0x3722[_0x5d96ec];return _0x350f30;};'use strict';var multer=require('multer');var util=require(_0x2372('0x0'));var path=require(_0x2372('0x1'));var timeout=require(_0x2372('0x2'));var express=require(_0x2372('0x3'));var router=express['Router']();var fs_extra=require(_0x2372('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2372('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x2372('0x6')]('/',auth[_0x2372('0x7')](),controller[_0x2372('0x8')]);router[_0x2372('0x6')](_0x2372('0x9'),auth[_0x2372('0x7')](),controller['describe']);router[_0x2372('0x6')](_0x2372('0xa'),auth[_0x2372('0x7')](),controller[_0x2372('0xb')]);router[_0x2372('0xc')]('/',auth[_0x2372('0x7')](),controller['create']);router[_0x2372('0xd')](_0x2372('0xa'),auth['isAuthenticated'](),controller[_0x2372('0xe')]);router[_0x2372('0xf')]('/:id',auth[_0x2372('0x7')](),controller[_0x2372('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 94d337f..d4d1c4e 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 _0x0c71=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0c71,0xfb));var _0x10c7=function(_0x4f1e30,_0xa05885){_0x4f1e30=_0x4f1e30-0x0;var _0x13efa6=_0x0c71[_0x4f1e30];return _0x13efa6;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x10c7('0x1')]},'calleridnum':{'type':Sequelize[_0x10c7('0x1')]},'calleridname':{'type':Sequelize[_0x10c7('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x10c7('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x10c7('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x10c7('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x10c7('0x2')]},'agentdumpAt':{'type':Sequelize[_0x10c7('0x2')]},'holdtime':{'type':Sequelize[_0x10c7('0x3')]},'agentcomplete':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x10c7('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x10c7('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x10c7('0x1')]},'channelstate':{'type':Sequelize[_0x10c7('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x10c7('0x1')]},'connectedlinename':{'type':Sequelize[_0x10c7('0x1')]},'language':{'type':Sequelize[_0x10c7('0x1')]},'accountcode':{'type':Sequelize[_0x10c7('0x1')]},'context':{'type':Sequelize[_0x10c7('0x1')]},'exten':{'type':Sequelize[_0x10c7('0x1')]},'priority':{'type':Sequelize[_0x10c7('0x1')]},'destchannel':{'type':Sequelize[_0x10c7('0x1')]},'destchannelstate':{'type':Sequelize[_0x10c7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x10c7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x10c7('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x10c7('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x10c7('0x1')]},'destlanguage':{'type':Sequelize[_0x10c7('0x1')]},'destaccountcode':{'type':Sequelize[_0x10c7('0x1')]},'destcontext':{'type':Sequelize[_0x10c7('0x1')]},'destexten':{'type':Sequelize[_0x10c7('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x10c7('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x10c7('0x1')],'comment':_0x10c7('0x5')},'transferexten':{'type':Sequelize[_0x10c7('0x1')]},'transferuniqueid':{'type':Sequelize[_0x10c7('0x1')]},'agententerreason':{'type':Sequelize[_0x10c7('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0abf=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'type':{'type':Sequelize[_0xf0ab('0x1')]},'uniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf0ab('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf0ab('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf0ab('0x2')]},'holdtime':{'type':Sequelize[_0xf0ab('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf0ab('0x3')]},'agentacw':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf0ab('0x1')]},'lastevent':{'type':Sequelize[_0xf0ab('0x1')]},'channel':{'type':Sequelize[_0xf0ab('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf0ab('0x1')]},'accountcode':{'type':Sequelize[_0xf0ab('0x1')]},'context':{'type':Sequelize[_0xf0ab('0x1')]},'exten':{'type':Sequelize[_0xf0ab('0x1')]},'priority':{'type':Sequelize[_0xf0ab('0x1')]},'destchannel':{'type':Sequelize[_0xf0ab('0x1')]},'destchannelstate':{'type':Sequelize[_0xf0ab('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf0ab('0x1')]},'destcalleridname':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf0ab('0x1')]},'destlanguage':{'type':Sequelize[_0xf0ab('0x1')]},'destaccountcode':{'type':Sequelize[_0xf0ab('0x1')]},'destcontext':{'type':Sequelize[_0xf0ab('0x1')]},'destexten':{'type':Sequelize[_0xf0ab('0x1')]},'destpriority':{'type':Sequelize[_0xf0ab('0x1')]},'destuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xf0ab('0x1')]},'transfer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf0ab('0x1')],'comment':_0xf0ab('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'agententerreason':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 5b69732..9ae17e4 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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var 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 36168e7..5f6dc28 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 _0x79d3=['VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x79d3,0x15f));var _0x379d=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x79d3[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x379d('0x0'));var util=require('util');var logger=require(_0x379d('0x1'))('api');var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x4'));var rimraf=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var attributes=require(_0x379d('0x7'));module[_0x379d('0x8')]=function(_0x2078a6,_0x2a1b43){return _0x2078a6['define'](_0x379d('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x379d('0xa'),_0x379d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa631=['api','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger'];(function(_0x21caa4,_0x44aac0){var _0x468955=function(_0x54f40b){while(--_0x54f40b){_0x21caa4['push'](_0x21caa4['shift']());}};_0x468955(++_0x44aac0);}(_0xa631,0xe4));var _0x1a63=function(_0x791841,_0x501103){_0x791841=_0x791841-0x0;var _0x3893e9=_0xa631[_0x791841];return _0x3893e9;};'use strict';var _=require('lodash');var util=require(_0x1a63('0x0'));var logger=require(_0x1a63('0x1'))(_0x1a63('0x2'));var moment=require('moment');var BPromise=require(_0x1a63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a63('0x4'));var config=require(_0x1a63('0x5'));var attributes=require(_0x1a63('0x6'));module['exports']=function(_0x51ff47,_0x5a2067){return _0x51ff47['define'](_0x1a63('0x7'),attributes,{'tableName':_0x1a63('0x8'),'paranoid':![],'indexes':[{'fields':[_0x1a63('0x9'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 531c42a..0699e71 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 _0x903a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','options','catch','UpdateVoiceAgentReport','update','raw','attributes','limit','lodash'];(function(_0x2ee90c,_0x4337b2){var _0x3561fc=function(_0x5a27e9){while(--_0x5a27e9){_0x2ee90c['push'](_0x2ee90c['shift']());}};_0x3561fc(++_0x4337b2);}(_0x903a,0x19f));var _0xa903=function(_0x36ad3c,_0x33949d){_0x36ad3c=_0x36ad3c-0x0;var _0x23e226=_0x903a[_0x36ad3c];return _0x23e226;};'use strict';var _=require(_0xa903('0x0'));var util=require(_0xa903('0x1'));var moment=require(_0xa903('0x2'));var BPromise=require('bluebird');var rs=require(_0xa903('0x3'));var fs=require('fs');var Redis=require(_0xa903('0x4'));var db=require(_0xa903('0x5'))['db'];var utils=require(_0xa903('0x6'));var logger=require(_0xa903('0x7'))('rpc');var config=require(_0xa903('0x8'));var jayson=require(_0xa903('0x9'));var client=jayson[_0xa903('0xa')][_0xa903('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186d2b,_0x4c2d67,_0x200377){return new BPromise(function(_0x2f0cdb,_0x5d2f8b){return client['request'](_0x186d2b,_0x200377)[_0xa903('0xc')](function(_0x16a38f){logger[_0xa903('0xd')](_0xa903('0xe'),_0x4c2d67,_0xa903('0xf'));logger[_0xa903('0x10')](_0xa903('0x11'),_0x4c2d67,_0xa903('0xf'),JSON[_0xa903('0x12')](_0x16a38f));if(_0x16a38f['error']){if(_0x16a38f[_0xa903('0x13')]['code']===0x1f4){logger[_0xa903('0x13')](_0xa903('0xe'),_0x4c2d67,_0x16a38f['error']['message']);return _0x5d2f8b(_0x16a38f[_0xa903('0x13')]['message']);}logger['error'](_0xa903('0xe'),_0x4c2d67,_0x16a38f[_0xa903('0x13')][_0xa903('0x14')]);return _0x2f0cdb(_0x16a38f[_0xa903('0x13')]['message']);}else{logger[_0xa903('0xd')](_0xa903('0xe'),_0x4c2d67,_0xa903('0xf'));_0x2f0cdb(_0x16a38f[_0xa903('0x15')][_0xa903('0x14')]);}})['catch'](function(_0x2cc4fc){logger[_0xa903('0x13')](_0xa903('0xe'),_0x4c2d67,_0x2cc4fc);_0x5d2f8b(_0x2cc4fc);});});}exports[_0xa903('0x16')]=function(_0x1799fc){var _0x285a49=this;return new Promise(function(_0x230c1a,_0x373bc2){return db[_0xa903('0x17')]['create'](_0x1799fc[_0xa903('0x18')],{'raw':_0x1799fc['options']?_0x1799fc[_0xa903('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xa53aac){logger['info'](_0xa903('0x16'),_0x1799fc);logger[_0xa903('0x10')](_0xa903('0x16'),_0x1799fc,JSON[_0xa903('0x12')](_0xa53aac));_0x230c1a(_0xa53aac);})[_0xa903('0x1a')](function(_0x140cb3){logger[_0xa903('0x13')](_0xa903('0x16'),_0x140cb3[_0xa903('0x14')],_0x1799fc);_0x373bc2(_0x285a49['error'](0x1f4,_0x140cb3['message']));});});};exports[_0xa903('0x1b')]=function(_0xaab2e6){var _0x41abf5=this;return new Promise(function(_0x17e126,_0x34c134){return db[_0xa903('0x17')][_0xa903('0x1c')](_0xaab2e6[_0xa903('0x18')],{'raw':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6[_0xa903('0x19')][_0xa903('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6['options']['where']||null:null,'attributes':_0xaab2e6['options']?_0xaab2e6[_0xa903('0x19')][_0xa903('0x1e')]||null:null,'limit':_0xaab2e6[_0xa903('0x19')]?_0xaab2e6['options'][_0xa903('0x1f')]||null:null})[_0xa903('0xc')](function(_0x248d46){logger[_0xa903('0xd')]('UpdateVoiceAgentReport',_0xaab2e6);logger[_0xa903('0x10')](_0xa903('0x1b'),_0xaab2e6,JSON['stringify'](_0x248d46));_0x17e126(_0x248d46);})['catch'](function(_0x2b4579){logger[_0xa903('0x13')](_0xa903('0x1b'),_0x2b4579[_0xa903('0x14')],_0xaab2e6);_0x34c134(_0x41abf5[_0xa903('0x13')](0x1f4,_0x2b4579[_0xa903('0x14')]));});});}; \ No newline at end of file +var _0x6976=['lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateVoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','VoiceAgentReport','where','attributes','limit'];(function(_0x1d7fc0,_0xa09a7c){var _0x35f3fd=function(_0x4c0ded){while(--_0x4c0ded){_0x1d7fc0['push'](_0x1d7fc0['shift']());}};_0x35f3fd(++_0xa09a7c);}(_0x6976,0x12c));var _0x6697=function(_0xf6563f,_0x4c8673){_0xf6563f=_0xf6563f-0x0;var _0x49c2a3=_0x6976[_0xf6563f];return _0x49c2a3;};'use strict';var _=require(_0x6697('0x0'));var util=require('util');var moment=require(_0x6697('0x1'));var BPromise=require(_0x6697('0x2'));var rs=require(_0x6697('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6697('0x4'));var logger=require('../../config/logger')(_0x6697('0x5'));var config=require(_0x6697('0x6'));var jayson=require(_0x6697('0x7'));var client=jayson['client'][_0x6697('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23d8e3,_0x1494e6,_0x459cd1){return new BPromise(function(_0x2f26da,_0x2dd160){return client[_0x6697('0x9')](_0x23d8e3,_0x459cd1)['then'](function(_0x362fe8){logger[_0x6697('0xa')](_0x6697('0xb'),_0x1494e6,'request\x20sent');logger[_0x6697('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x1494e6,_0x6697('0xd'),JSON[_0x6697('0xe')](_0x362fe8));if(_0x362fe8[_0x6697('0xf')]){if(_0x362fe8[_0x6697('0xf')][_0x6697('0x10')]===0x1f4){logger['error'](_0x6697('0xb'),_0x1494e6,_0x362fe8[_0x6697('0xf')][_0x6697('0x11')]);return _0x2dd160(_0x362fe8[_0x6697('0xf')][_0x6697('0x11')]);}logger[_0x6697('0xf')](_0x6697('0xb'),_0x1494e6,_0x362fe8[_0x6697('0xf')][_0x6697('0x11')]);return _0x2f26da(_0x362fe8['error'][_0x6697('0x11')]);}else{logger[_0x6697('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x1494e6,_0x6697('0xd'));_0x2f26da(_0x362fe8['result'][_0x6697('0x11')]);}})[_0x6697('0x12')](function(_0x475a76){logger[_0x6697('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x1494e6,_0x475a76);_0x2dd160(_0x475a76);});});}exports[_0x6697('0x13')]=function(_0x39ab00){var _0x29d2db=this;return new Promise(function(_0x5a6316,_0x59dd22){return db['VoiceAgentReport'][_0x6697('0x14')](_0x39ab00[_0x6697('0x15')],{'raw':_0x39ab00[_0x6697('0x16')]?_0x39ab00[_0x6697('0x16')][_0x6697('0x17')]===undefined?!![]:![]:!![]})[_0x6697('0x18')](function(_0x1278a6){logger[_0x6697('0xa')]('CreateVoiceAgentReport',_0x39ab00);logger[_0x6697('0xc')]('CreateVoiceAgentReport',_0x39ab00,JSON[_0x6697('0xe')](_0x1278a6));_0x5a6316(_0x1278a6);})[_0x6697('0x12')](function(_0x592141){logger[_0x6697('0xf')]('CreateVoiceAgentReport',_0x592141['message'],_0x39ab00);_0x59dd22(_0x29d2db[_0x6697('0xf')](0x1f4,_0x592141[_0x6697('0x11')]));});});};exports[_0x6697('0x19')]=function(_0x110a11){var _0xfa2ba4=this;return new Promise(function(_0x28af85,_0x255268){return db[_0x6697('0x1a')]['update'](_0x110a11['body'],{'raw':_0x110a11[_0x6697('0x16')]?_0x110a11['options'][_0x6697('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x110a11[_0x6697('0x16')]?_0x110a11[_0x6697('0x16')][_0x6697('0x1b')]||null:null,'attributes':_0x110a11['options']?_0x110a11[_0x6697('0x16')][_0x6697('0x1c')]||null:null,'limit':_0x110a11[_0x6697('0x16')]?_0x110a11['options'][_0x6697('0x1d')]||null:null})['then'](function(_0x177f20){logger[_0x6697('0xa')](_0x6697('0x19'),_0x110a11);logger[_0x6697('0xc')]('UpdateVoiceAgentReport',_0x110a11,JSON['stringify'](_0x177f20));_0x28af85(_0x177f20);})[_0x6697('0x12')](function(_0x2a1159){logger[_0x6697('0xf')](_0x6697('0x19'),_0x2a1159[_0x6697('0x11')],_0x110a11);_0x255268(_0xfa2ba4[_0x6697('0xf')](0x1f4,_0x2a1159['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 53fe735..2a4d63c 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 _0x425d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1eb786,_0x1b5f72){var _0x460cad=function(_0x3ec7a6){while(--_0x3ec7a6){_0x1eb786['push'](_0x1eb786['shift']());}};_0x460cad(++_0x1b5f72);}(_0x425d,0x1e0));var _0xd425=function(_0x370be6,_0x17c8c8){_0x370be6=_0x370be6-0x0;var _0xb512b2=_0x425d[_0x370be6];return _0xb512b2;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var fs_extra=require(_0xd425('0x5'));var auth=require(_0xd425('0x6'));var interaction=require(_0xd425('0x7'));var config=require('../../config/environment');var controller=require(_0xd425('0x8'));router[_0xd425('0x9')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0xb')]);router[_0xd425('0x9')](_0xd425('0xc'),auth['isAuthenticated'](),controller[_0xd425('0xd')]);router[_0xd425('0x9')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0xa')](),controller[_0xd425('0x11')]);router[_0xd425('0x12')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x13')]);router[_0xd425('0x14')](_0xd425('0xe'),auth[_0xd425('0xa')](),controller[_0xd425('0x15')]);module[_0xd425('0x16')]=router; \ No newline at end of file +var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x262c59,_0x3955a3){var _0x5231e4=function(_0x126a89){while(--_0x126a89){_0x262c59['push'](_0x262c59['shift']());}};_0x5231e4(++_0x3955a3);}(_0x4bc3,0x16e));var _0x34bc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4bc3[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 76e7237..6c87c2a 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 _0xac8e=['ENUM','inbound','internal','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x2bd9cd,_0x58d8f0){var _0x5f21cb=function(_0x8e8001){while(--_0x8e8001){_0x2bd9cd['push'](_0x2bd9cd['shift']());}};_0x5f21cb(++_0x58d8f0);}(_0xac8e,0x19f));var _0xeac8=function(_0x2eec9b,_0x2f6dbc){_0x2eec9b=_0x2eec9b-0x0;var _0x2910d1=_0xac8e[_0x2eec9b];return _0x2910d1;};'use strict';var Sequelize=require(_0xeac8('0x0'));module[_0xeac8('0x1')]={'uniqueid':{'type':Sequelize[_0xeac8('0x2')]},'type':{'type':Sequelize[_0xeac8('0x3')](_0xeac8('0x4'),_0xeac8('0x5'),'outbound',_0xeac8('0x6'),'outbound-fax',_0xeac8('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xeac8('0x2')]},'destination':{'type':Sequelize[_0xeac8('0x2')]},'destinationcontext':{'type':Sequelize[_0xeac8('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xeac8('0x2')]},'destinationchannel':{'type':Sequelize[_0xeac8('0x2')]},'lastapplication':{'type':Sequelize[_0xeac8('0x2')]},'lastdata':{'type':Sequelize[_0xeac8('0x8')]},'starttime':{'type':Sequelize[_0xeac8('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xeac8('0x9')]},'endtime':{'type':Sequelize[_0xeac8('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xeac8('0xa')]},'mohtime':{'type':Sequelize[_0xeac8('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xeac8('0x2')]},'amaflags':{'type':Sequelize[_0xeac8('0x2')]},'userfield':{'type':Sequelize[_0xeac8('0x2')]},'userDisposition':{'type':Sequelize[_0xeac8('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xeac8('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xeac8('0x2')]},'note':{'type':Sequelize[_0xeac8('0x2')]},'prefix':{'type':Sequelize[_0xeac8('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xeac8('0x2')]}}; \ No newline at end of file +var _0x93e6=['outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','internal','inbound-fax'];(function(_0xbc550a,_0x2bb605){var _0xd16ba4=function(_0x5e55e5){while(--_0x5e55e5){_0xbc550a['push'](_0xbc550a['shift']());}};_0xd16ba4(++_0x2bb605);}(_0x93e6,0x11e));var _0x693e=function(_0x34c2b3,_0x46b3fc){_0x34c2b3=_0x34c2b3-0x0;var _0x36a73f=_0x93e6[_0x34c2b3];return _0x36a73f;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x693e('0x1')]('inbound',_0x693e('0x2'),'outbound',_0x693e('0x3'),_0x693e('0x4'),_0x693e('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x693e('0x6')]},'source':{'type':Sequelize[_0x693e('0x6')]},'destination':{'type':Sequelize[_0x693e('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x693e('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x693e('0x7')]},'starttime':{'type':Sequelize[_0x693e('0x8')]},'systemanswertime':{'type':Sequelize[_0x693e('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x693e('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x693e('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x693e('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x693e('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x693e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x693e('0x6')]},'note':{'type':Sequelize[_0x693e('0x6')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x693e('0x9')]},'sipcallid':{'type':Sequelize[_0x693e('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 7476379..e6610b1 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x4f2729,_0x1b08a6){var _0x1fdcd6=function(_0x31f5bb){while(--_0x31f5bb){_0x4f2729['push'](_0x4f2729['shift']());}};_0x1fdcd6(++_0x1b08a6);}(_0xb10b,0x12a));var _0xbb10=function(_0x239650,_0x56aeda){_0x239650=_0x239650-0x0;var _0xee0bd6=_0xb10b[_0x239650];return _0xee0bd6;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x59e735,_0x30970e){_0x59e735=_0x59e735-0x0;var _0x1cfc15=_0x2032[_0x59e735];return _0x1cfc15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4e3155d..6ed30a9 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 _0x11d9=['define','report_call','uniqueid','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3d9ba7,_0x1c8b5f){var _0x4621ce=function(_0x5e3283){while(--_0x5e3283){_0x3d9ba7['push'](_0x3d9ba7['shift']());}};_0x4621ce(++_0x1c8b5f);}(_0x11d9,0x87));var _0x911d=function(_0x51be87,_0x4ff2ac){_0x51be87=_0x51be87-0x0;var _0xc9426f=_0x11d9[_0x51be87];return _0xc9426f;};'use strict';var _=require(_0x911d('0x0'));var util=require(_0x911d('0x1'));var logger=require('../../config/logger')(_0x911d('0x2'));var moment=require('moment');var BPromise=require(_0x911d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x911d('0x4'));var rimraf=require(_0x911d('0x5'));var config=require(_0x911d('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x911d('0x7')]=function(_0x5c7b5e,_0x2ec9c5){return _0x5c7b5e[_0x911d('0x8')]('VoiceCallReport',attributes,{'tableName':_0x911d('0x9'),'paranoid':![],'indexes':[{'fields':[_0x911d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf54c=['../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xf54c,0xa2));var _0xcf54=function(_0x2547df,_0x4a7a81){_0x2547df=_0x2547df-0x0;var _0x621fcb=_0xf54c[_0x2547df];return _0x621fcb;};'use strict';var _=require(_0xcf54('0x0'));var util=require('util');var logger=require(_0xcf54('0x1'))(_0xcf54('0x2'));var moment=require('moment');var BPromise=require(_0xcf54('0x3'));var rp=require(_0xcf54('0x4'));var fs=require('fs');var path=require(_0xcf54('0x5'));var rimraf=require(_0xcf54('0x6'));var config=require(_0xcf54('0x7'));var attributes=require(_0xcf54('0x8'));module['exports']=function(_0x58dd34,_0x4cf20c){return _0x58dd34[_0xcf54('0x9')](_0xcf54('0xa'),attributes,{'tableName':_0xcf54('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcf54('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 114b74d..b619f38 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 _0x8066=['map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include'];(function(_0x2edc72,_0x5b1576){var _0x43d470=function(_0x4707d6){while(--_0x4707d6){_0x2edc72['push'](_0x2edc72['shift']());}};_0x43d470(++_0x5b1576);}(_0x8066,0x127));var _0x6806=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x8066[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rs=require(_0x6806('0x4'));var fs=require('fs');var Redis=require(_0x6806('0x5'));var db=require(_0x6806('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6806('0x7'));var jayson=require(_0x6806('0x8'));var client=jayson[_0x6806('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b7ab3,_0x493245,_0x1eb93a){return new BPromise(function(_0x40bea8,_0x2186b5){return client[_0x6806('0xa')](_0x4b7ab3,_0x1eb93a)[_0x6806('0xb')](function(_0x90faf){logger[_0x6806('0xc')](_0x6806('0xd'),_0x493245,_0x6806('0xe'));logger[_0x6806('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x493245,_0x6806('0xe'),JSON[_0x6806('0x10')](_0x90faf));if(_0x90faf['error']){if(_0x90faf[_0x6806('0x11')]['code']===0x1f4){logger['error'](_0x6806('0xd'),_0x493245,_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);return _0x2186b5(_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);}logger[_0x6806('0x11')](_0x6806('0xd'),_0x493245,_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);return _0x40bea8(_0x90faf[_0x6806('0x11')][_0x6806('0x12')]);}else{logger[_0x6806('0xc')](_0x6806('0xd'),_0x493245,'request\x20sent');_0x40bea8(_0x90faf[_0x6806('0x13')][_0x6806('0x12')]);}})[_0x6806('0x14')](function(_0x168e4d){logger[_0x6806('0x11')](_0x6806('0xd'),_0x493245,_0x168e4d);_0x2186b5(_0x168e4d);});});}exports[_0x6806('0x15')]=function(_0x362883){var _0x1dd52a=this;return new Promise(function(_0x26a284,_0x4b73de){return db[_0x6806('0x16')][_0x6806('0x17')]({'raw':_0x362883[_0x6806('0x18')]?_0x362883[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![],'where':_0x362883[_0x6806('0x18')]?_0x362883['options'][_0x6806('0x1a')]||null:null,'attributes':_0x362883['options']?_0x362883[_0x6806('0x18')][_0x6806('0x1b')]||null:null,'limit':_0x362883['options']?_0x362883[_0x6806('0x18')]['limit']||null:null,'include':_0x362883[_0x6806('0x18')]?_0x362883['options'][_0x6806('0x1c')]?_['map'](_0x362883[_0x6806('0x18')][_0x6806('0x1c')],function(_0x4daf36){return{'model':db[_0x4daf36['model']],'as':_0x4daf36['as'],'attributes':_0x4daf36[_0x6806('0x1b')],'include':_0x4daf36[_0x6806('0x1c')]?_[_0x6806('0x1d')](_0x4daf36[_0x6806('0x1c')],function(_0x221335){return{'model':db[_0x221335[_0x6806('0x1e')]],'as':_0x221335['as'],'attributes':_0x221335[_0x6806('0x1b')],'include':_0x221335[_0x6806('0x1c')]?_[_0x6806('0x1d')](_0x221335[_0x6806('0x1c')],function(_0x3a5da0){return{'model':db[_0x3a5da0[_0x6806('0x1e')]],'as':_0x3a5da0['as'],'attributes':_0x3a5da0[_0x6806('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bafd3){logger[_0x6806('0xc')](_0x6806('0x15'),_0x362883);logger[_0x6806('0xf')](_0x6806('0x15'),_0x362883,JSON[_0x6806('0x10')](_0x1bafd3));_0x26a284(_0x1bafd3);})[_0x6806('0x14')](function(_0x50633f){logger[_0x6806('0x11')](_0x6806('0x15'),_0x50633f[_0x6806('0x12')],_0x362883);_0x4b73de(_0x1dd52a[_0x6806('0x11')](0x1f4,_0x50633f[_0x6806('0x12')]));});});};exports[_0x6806('0x1f')]=function(_0x593e13){var _0x23051c=this;return new Promise(function(_0x437c96,_0x576241){return db[_0x6806('0x16')][_0x6806('0x20')](_0x593e13[_0x6806('0x21')],{'raw':_0x593e13[_0x6806('0x18')]?_0x593e13[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![]})[_0x6806('0xb')](function(_0x45043d){logger[_0x6806('0xc')](_0x6806('0x1f'),_0x593e13);logger[_0x6806('0xf')]('CreateVoiceCallReport',_0x593e13,JSON['stringify'](_0x45043d));_0x437c96(_0x45043d);})[_0x6806('0x14')](function(_0x3c4dd7){logger['error'](_0x6806('0x1f'),_0x3c4dd7[_0x6806('0x12')],_0x593e13);_0x576241(_0x23051c[_0x6806('0x11')](0x1f4,_0x3c4dd7[_0x6806('0x12')]));});});};exports[_0x6806('0x22')]=function(_0x52edac){var _0x35d44d=this;return new Promise(function(_0x1e6bb5,_0x57cecd){return db[_0x6806('0x16')]['update'](_0x52edac[_0x6806('0x21')],{'raw':_0x52edac[_0x6806('0x18')]?_0x52edac[_0x6806('0x18')][_0x6806('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52edac[_0x6806('0x18')]?_0x52edac['options'][_0x6806('0x1a')]||null:null,'attributes':_0x52edac['options']?_0x52edac[_0x6806('0x18')][_0x6806('0x1b')]||null:null,'limit':_0x52edac['options']?_0x52edac[_0x6806('0x18')][_0x6806('0x23')]||null:null})[_0x6806('0xb')](function(_0x528102){logger['info'](_0x6806('0x22'),_0x52edac);logger[_0x6806('0xf')]('UpdateVoiceCallReport',_0x52edac,JSON['stringify'](_0x528102));_0x1e6bb5(_0x528102);})[_0x6806('0x14')](function(_0x51ba19){logger[_0x6806('0x11')](_0x6806('0x22'),_0x51ba19['message'],_0x52edac);_0x57cecd(_0x35d44d[_0x6806('0x11')](0x1f4,_0x51ba19[_0x6806('0x12')]));});});}; \ No newline at end of file +var _0x2f0d=['CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','stringify'];(function(_0x33c147,_0xd24400){var _0x216d7d=function(_0x1ac7f8){while(--_0x1ac7f8){_0x33c147['push'](_0x33c147['shift']());}};_0x216d7d(++_0xd24400);}(_0x2f0d,0xa6));var _0xd2f0=function(_0x29eb6f,_0x21bb39){_0x29eb6f=_0x29eb6f-0x0;var _0x5096a4=_0x2f0d[_0x29eb6f];return _0x5096a4;};'use strict';var _=require(_0xd2f0('0x0'));var util=require(_0xd2f0('0x1'));var moment=require(_0xd2f0('0x2'));var BPromise=require(_0xd2f0('0x3'));var rs=require(_0xd2f0('0x4'));var fs=require('fs');var Redis=require(_0xd2f0('0x5'));var db=require(_0xd2f0('0x6'))['db'];var utils=require(_0xd2f0('0x7'));var logger=require(_0xd2f0('0x8'))('rpc');var config=require(_0xd2f0('0x9'));var jayson=require(_0xd2f0('0xa'));var client=jayson['client'][_0xd2f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51e8a4,_0x235f66,_0x28c57e){return new BPromise(function(_0x1abeff,_0x319a51){return client[_0xd2f0('0xc')](_0x51e8a4,_0x28c57e)[_0xd2f0('0xd')](function(_0x28db96){logger[_0xd2f0('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x235f66,_0xd2f0('0xf'));logger[_0xd2f0('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x235f66,'request\x20sent',JSON['stringify'](_0x28db96));if(_0x28db96[_0xd2f0('0x11')]){if(_0x28db96['error'][_0xd2f0('0x12')]===0x1f4){logger[_0xd2f0('0x11')](_0xd2f0('0x13'),_0x235f66,_0x28db96[_0xd2f0('0x11')][_0xd2f0('0x14')]);return _0x319a51(_0x28db96[_0xd2f0('0x11')][_0xd2f0('0x14')]);}logger['error'](_0xd2f0('0x13'),_0x235f66,_0x28db96['error']['message']);return _0x1abeff(_0x28db96[_0xd2f0('0x11')]['message']);}else{logger[_0xd2f0('0xe')](_0xd2f0('0x13'),_0x235f66,'request\x20sent');_0x1abeff(_0x28db96[_0xd2f0('0x15')][_0xd2f0('0x14')]);}})[_0xd2f0('0x16')](function(_0xc8fb1e){logger[_0xd2f0('0x11')](_0xd2f0('0x13'),_0x235f66,_0xc8fb1e);_0x319a51(_0xc8fb1e);});});}exports[_0xd2f0('0x17')]=function(_0x4b0b4b){var _0x400f0d=this;return new Promise(function(_0x15ef26,_0x538c35){return db[_0xd2f0('0x18')][_0xd2f0('0x19')]({'raw':_0x4b0b4b[_0xd2f0('0x1a')]?_0x4b0b4b['options'][_0xd2f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b0b4b[_0xd2f0('0x1a')]?_0x4b0b4b[_0xd2f0('0x1a')][_0xd2f0('0x1c')]||null:null,'attributes':_0x4b0b4b['options']?_0x4b0b4b[_0xd2f0('0x1a')][_0xd2f0('0x1d')]||null:null,'limit':_0x4b0b4b[_0xd2f0('0x1a')]?_0x4b0b4b[_0xd2f0('0x1a')]['limit']||null:null,'include':_0x4b0b4b['options']?_0x4b0b4b['options'][_0xd2f0('0x1e')]?_[_0xd2f0('0x1f')](_0x4b0b4b[_0xd2f0('0x1a')][_0xd2f0('0x1e')],function(_0x5aef54){return{'model':db[_0x5aef54[_0xd2f0('0x20')]],'as':_0x5aef54['as'],'attributes':_0x5aef54['attributes'],'include':_0x5aef54[_0xd2f0('0x1e')]?_[_0xd2f0('0x1f')](_0x5aef54[_0xd2f0('0x1e')],function(_0x55fd81){return{'model':db[_0x55fd81[_0xd2f0('0x20')]],'as':_0x55fd81['as'],'attributes':_0x55fd81[_0xd2f0('0x1d')],'include':_0x55fd81[_0xd2f0('0x1e')]?_[_0xd2f0('0x1f')](_0x55fd81[_0xd2f0('0x1e')],function(_0x1581e6){return{'model':db[_0x1581e6[_0xd2f0('0x20')]],'as':_0x1581e6['as'],'attributes':_0x1581e6[_0xd2f0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd2f0('0xd')](function(_0x52639f){logger['info'](_0xd2f0('0x17'),_0x4b0b4b);logger['debug']('GetVoiceCallReport',_0x4b0b4b,JSON[_0xd2f0('0x21')](_0x52639f));_0x15ef26(_0x52639f);})['catch'](function(_0x4d3d0b){logger[_0xd2f0('0x11')]('GetVoiceCallReport',_0x4d3d0b[_0xd2f0('0x14')],_0x4b0b4b);_0x538c35(_0x400f0d[_0xd2f0('0x11')](0x1f4,_0x4d3d0b[_0xd2f0('0x14')]));});});};exports[_0xd2f0('0x22')]=function(_0x57f221){var _0x283391=this;return new Promise(function(_0x20c781,_0x4e7a36){return db[_0xd2f0('0x18')][_0xd2f0('0x23')](_0x57f221[_0xd2f0('0x24')],{'raw':_0x57f221[_0xd2f0('0x1a')]?_0x57f221['options'][_0xd2f0('0x1b')]===undefined?!![]:![]:!![]})[_0xd2f0('0xd')](function(_0x4f19ac){logger['info'](_0xd2f0('0x22'),_0x57f221);logger['debug']('CreateVoiceCallReport',_0x57f221,JSON[_0xd2f0('0x21')](_0x4f19ac));_0x20c781(_0x4f19ac);})['catch'](function(_0xc50e48){logger[_0xd2f0('0x11')](_0xd2f0('0x22'),_0xc50e48[_0xd2f0('0x14')],_0x57f221);_0x4e7a36(_0x283391[_0xd2f0('0x11')](0x1f4,_0xc50e48[_0xd2f0('0x14')]));});});};exports[_0xd2f0('0x25')]=function(_0x251fb9){var _0x3a353b=this;return new Promise(function(_0x552978,_0x220a49){return db['VoiceCallReport'][_0xd2f0('0x26')](_0x251fb9['body'],{'raw':_0x251fb9[_0xd2f0('0x1a')]?_0x251fb9[_0xd2f0('0x1a')][_0xd2f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251fb9['options']?_0x251fb9[_0xd2f0('0x1a')][_0xd2f0('0x1c')]||null:null,'attributes':_0x251fb9[_0xd2f0('0x1a')]?_0x251fb9['options'][_0xd2f0('0x1d')]||null:null,'limit':_0x251fb9[_0xd2f0('0x1a')]?_0x251fb9['options'][_0xd2f0('0x27')]||null:null})[_0xd2f0('0xd')](function(_0x2984d7){logger['info'](_0xd2f0('0x25'),_0x251fb9);logger['debug'](_0xd2f0('0x25'),_0x251fb9,JSON['stringify'](_0x2984d7));_0x552978(_0x2984d7);})[_0xd2f0('0x16')](function(_0xd10604){logger[_0xd2f0('0x11')](_0xd2f0('0x25'),_0xd10604[_0xd2f0('0x14')],_0x251fb9);_0x220a49(_0x3a353b[_0xd2f0('0x11')](0x1f4,_0xd10604[_0xd2f0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 85793d2..c0b7feb 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 _0x471e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util'];(function(_0x26578c,_0x286c7e){var _0x52ce85=function(_0x2e03f7){while(--_0x2e03f7){_0x26578c['push'](_0x26578c['shift']());}};_0x52ce85(++_0x286c7e);}(_0x471e,0x1ce));var _0xe471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe471('0x0'));var util=require(_0xe471('0x1'));var path=require('path');var timeout=require(_0xe471('0x2'));var express=require('express');var router=express[_0xe471('0x3')]();var fs_extra=require(_0xe471('0x4'));var auth=require(_0xe471('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe471('0x6'));var controller=require(_0xe471('0x7'));router['get']('/',auth[_0xe471('0x8')](),controller[_0xe471('0x9')]);router['get'](_0xe471('0xa'),auth[_0xe471('0x8')](),controller[_0xe471('0xb')]);router['post']('/',auth[_0xe471('0x8')](),controller[_0xe471('0xc')]);router[_0xe471('0xd')](_0xe471('0xa'),auth['isAuthenticated'](),controller[_0xe471('0xe')]);router['delete']('/:id',auth[_0xe471('0x8')](),controller[_0xe471('0xf')]);module['exports']=router; \ No newline at end of file +var _0x44b6=['show','post','put','/:id','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x364af7,_0x2a6b7b){var _0x584464=function(_0x234551){while(--_0x234551){_0x364af7['push'](_0x364af7['shift']());}};_0x584464(++_0x2a6b7b);}(_0x44b6,0xf6));var _0x644b=function(_0x10f060,_0x312a7b){_0x10f060=_0x10f060-0x0;var _0x512722=_0x44b6[_0x10f060];return _0x512722;};'use strict';var multer=require(_0x644b('0x0'));var util=require(_0x644b('0x1'));var path=require('path');var timeout=require(_0x644b('0x2'));var express=require(_0x644b('0x3'));var router=express[_0x644b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x644b('0x5'));var config=require(_0x644b('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x644b('0x7')]('/',auth[_0x644b('0x8')](),controller[_0x644b('0x9')]);router['get']('/:id',auth[_0x644b('0x8')](),controller[_0x644b('0xa')]);router[_0x644b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x644b('0xc')](_0x644b('0xd'),auth[_0x644b('0x8')](),controller[_0x644b('0xe')]);router[_0x644b('0xf')](_0x644b('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 817d6b6..e5bffde 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 _0xea61=['sequelize','STRING','name','join','getDataValue','options','split','BOOLEAN'];(function(_0x58a946,_0x40a9d9){var _0x3de861=function(_0x2d6808){while(--_0x2d6808){_0x58a946['push'](_0x58a946['shift']());}};_0x3de861(++_0x40a9d9);}(_0xea61,0xc0));var _0x1ea6=function(_0x556964,_0x79cf6b){_0x556964=_0x556964-0x0;var _0x3615cb=_0xea61[_0x556964];return _0x3615cb;};'use strict';var Sequelize=require(_0x1ea6('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ea6('0x1')]},'prefix':{'type':Sequelize[_0x1ea6('0x1')],'unique':_0x1ea6('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1ea6('0x1')],'set':function(_0x322bbb){this['setDataValue']('options',_0x322bbb?_0x322bbb[_0x1ea6('0x3')](''):[]);},'get':function(){return this[_0x1ea6('0x4')]('options')?this['getDataValue'](_0x1ea6('0x5'))[_0x1ea6('0x6')](''):[];}},'auth':{'type':Sequelize[_0x1ea6('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1ea6('0x1')]},'description':{'type':Sequelize[_0x1ea6('0x1')]}}; \ No newline at end of file +var _0xf91e=['sequelize','STRING','name','setDataValue','options','join','getDataValue','BOOLEAN'];(function(_0x1355f8,_0x5298cc){var _0x36645a=function(_0x99af8){while(--_0x99af8){_0x1355f8['push'](_0x1355f8['shift']());}};_0x36645a(++_0x5298cc);}(_0xf91e,0xc0));var _0xef91=function(_0x56ea3c,_0x46dbdc){_0x56ea3c=_0x56ea3c-0x0;var _0x15c1a4=_0xf91e[_0x56ea3c];return _0x15c1a4;};'use strict';var Sequelize=require(_0xef91('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xef91('0x1')],'unique':_0xef91('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x539122){this[_0xef91('0x3')](_0xef91('0x4'),_0x539122?_0x539122[_0xef91('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xef91('0x4'))?this[_0xef91('0x6')](_0xef91('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xef91('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xef91('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xef91('0x1')]},'description':{'type':Sequelize[_0xef91('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index c8b7474..f4b6446 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 _0x7daf=['request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','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/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x7daf,0xaa));var _0xf7da=function(_0x5412b8,_0x467f34){_0x5412b8=_0x5412b8-0x0;var _0x377de6=_0x7daf[_0x5412b8];return _0x377de6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7da('0x1'));var rp=require(_0xf7da('0x2'));var moment=require('moment');var BPromise=require(_0xf7da('0x3'));var Mustache=require(_0xf7da('0x4'));var util=require(_0xf7da('0x5'));var path=require(_0xf7da('0x6'));var sox=require(_0xf7da('0x7'));var csv=require('to-csv');var ejs=require(_0xf7da('0x8'));var fs=require('fs');var fs_extra=require(_0xf7da('0x9'));var _=require(_0xf7da('0xa'));var squel=require(_0xf7da('0xb'));var crypto=require(_0xf7da('0xc'));var jsforce=require(_0xf7da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7da('0xe'));var querystring=require(_0xf7da('0xf'));var Papa=require(_0xf7da('0x10'));var Redis=require(_0xf7da('0x11'));var authService=require(_0xf7da('0x12'));var qs=require(_0xf7da('0x13'));var as=require(_0xf7da('0x14'));var hardwareService=require(_0xf7da('0x15'));var logger=require(_0xf7da('0x16'))(_0xf7da('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7da('0x18'));var db=require(_0xf7da('0x19'))['db'];function respondWithStatusCode(_0x2a5afc,_0x392244){_0x392244=_0x392244||0xcc;return function(_0x2da6bd){if(_0x2da6bd){return _0x2a5afc[_0xf7da('0x1a')](_0x392244);}return _0x2a5afc['status'](_0x392244)[_0xf7da('0x1b')]();};}function respondWithResult(_0x61af71,_0x5bfc67){_0x5bfc67=_0x5bfc67||0xc8;return function(_0x1958dd){if(_0x1958dd){return _0x61af71[_0xf7da('0x1c')](_0x5bfc67)[_0xf7da('0x1d')](_0x1958dd);}};}function respondWithFilteredResult(_0x37d3f7,_0xe82d40){return function(_0x26f112){if(_0x26f112){var _0x4f5afa=typeof _0xe82d40['offset']==='undefined'&&typeof _0xe82d40[_0xf7da('0x1e')]===_0xf7da('0x1f');var _0x231d6e=_0x26f112[_0xf7da('0x20')];var _0x336fca=_0x4f5afa?0x0:_0xe82d40[_0xf7da('0x21')];var _0xb75a2c=_0x4f5afa?_0x26f112[_0xf7da('0x20')]:_0xe82d40[_0xf7da('0x21')]+_0xe82d40[_0xf7da('0x1e')];var _0x303459;if(_0xb75a2c>=_0x231d6e){_0xb75a2c=_0x231d6e;_0x303459=0xc8;}else{_0x303459=0xce;}_0x37d3f7[_0xf7da('0x1c')](_0x303459);return _0x37d3f7[_0xf7da('0x22')](_0xf7da('0x23'),_0x336fca+'-'+_0xb75a2c+'/'+_0x231d6e)['json'](_0x26f112);}return null;};}function patchUpdates(_0x3f5f58){return function(_0x3b0913){try{jsonpatch[_0xf7da('0x24')](_0x3b0913,_0x3f5f58,!![]);}catch(_0xa43acc){return BPromise[_0xf7da('0x25')](_0xa43acc);}return _0x3b0913[_0xf7da('0x26')]();};}function saveUpdates(_0x119f49,_0x35ac94){return function(_0x3affce){if(_0x3affce){return _0x3affce['update'](_0x119f49)[_0xf7da('0x27')](function(_0x1b68d3){return _0x1b68d3;});}return null;};}function removeEntity(_0x265192,_0x4b627e){return function(_0x3bf5d1){if(_0x3bf5d1){return _0x3bf5d1[_0xf7da('0x28')]()[_0xf7da('0x27')](function(){var _0x4630ae=_0x3bf5d1[_0xf7da('0x29')]({'plain':!![]});var _0x9d2da='ChanSpies';return db[_0xf7da('0x2a')][_0xf7da('0x28')]({'where':{'type':_0x9d2da,'resourceId':_0x4630ae['id']}})[_0xf7da('0x27')](function(){return _0x3bf5d1;});})['then'](function(){_0x265192[_0xf7da('0x1c')](0xcc)[_0xf7da('0x1b')]();});}};}function handleEntityNotFound(_0x3fa1f2,_0x3509a5){return function(_0x13dc9f){if(!_0x13dc9f){_0x3fa1f2['sendStatus'](0x194);}return _0x13dc9f;};}function handleError(_0x3fd76a,_0x545b15){_0x545b15=_0x545b15||0x1f4;return function(_0x258c74){logger[_0xf7da('0x2b')](_0x258c74[_0xf7da('0x2c')]);if(_0x258c74[_0xf7da('0x2d')]){delete _0x258c74['name'];}_0x3fd76a[_0xf7da('0x1c')](_0x545b15)[_0xf7da('0x2e')](_0x258c74);};}exports[_0xf7da('0x2f')]=function(_0x1d3662,_0x3a765e){var _0xccc6cb={},_0x10d731={},_0x21ee49={'count':0x0,'rows':[]};var _0x495fb0=_[_0xf7da('0x30')](db[_0xf7da('0x31')][_0xf7da('0x32')],function(_0x302b92){return{'name':_0x302b92[_0xf7da('0x33')],'type':_0x302b92['type'][_0xf7da('0x34')]};});_0x10d731[_0xf7da('0x35')]=_['map'](_0x495fb0,_0xf7da('0x2d'));_0x10d731['query']=_[_0xf7da('0x36')](_0x1d3662[_0xf7da('0x37')]);_0x10d731[_0xf7da('0x38')]=_[_0xf7da('0x39')](_0x10d731[_0xf7da('0x35')],_0x10d731[_0xf7da('0x37')]);_0xccc6cb['attributes']=_[_0xf7da('0x39')](_0x10d731[_0xf7da('0x35')],qs[_0xf7da('0x3a')](_0x1d3662['query']['fields']));_0xccc6cb[_0xf7da('0x3b')]=_0xccc6cb['attributes']['length']?_0xccc6cb['attributes']:_0x10d731['model'];if(!_0x1d3662[_0xf7da('0x37')]['hasOwnProperty'](_0xf7da('0x3c'))){_0xccc6cb['limit']=qs[_0xf7da('0x1e')](_0x1d3662['query'][_0xf7da('0x1e')]);_0xccc6cb[_0xf7da('0x21')]=qs[_0xf7da('0x21')](_0x1d3662[_0xf7da('0x37')][_0xf7da('0x21')]);}_0xccc6cb['order']=qs[_0xf7da('0x3d')](_0x1d3662[_0xf7da('0x37')][_0xf7da('0x3d')]);_0xccc6cb[_0xf7da('0x3e')]=qs[_0xf7da('0x38')](_[_0xf7da('0x3f')](_0x1d3662['query'],_0x10d731[_0xf7da('0x38')]),_0x495fb0);if(_0x1d3662[_0xf7da('0x37')][_0xf7da('0x40')]){_0xccc6cb[_0xf7da('0x3e')]=_[_0xf7da('0x41')](_0xccc6cb['where'],{'$or':_[_0xf7da('0x30')](_0x495fb0,function(_0x4262fb){if(_0x4262fb[_0xf7da('0x42')]!=='VIRTUAL'){var _0x858885={};_0x858885[_0x4262fb['name']]={'$like':'%'+_0x1d3662['query']['filter']+'%'};return _0x858885;}})});}_0xccc6cb=_[_0xf7da('0x41')]({},_0xccc6cb,_0x1d3662[_0xf7da('0x43')]);var _0x2ea896={'where':_0xccc6cb[_0xf7da('0x3e')]};return db[_0xf7da('0x31')][_0xf7da('0x20')](_0x2ea896)[_0xf7da('0x27')](function(_0x3e64de){_0x21ee49[_0xf7da('0x20')]=_0x3e64de;if(_0x1d3662[_0xf7da('0x37')][_0xf7da('0x44')]){_0xccc6cb[_0xf7da('0x45')]=[{'all':!![]}];}return db[_0xf7da('0x31')][_0xf7da('0x46')](_0xccc6cb);})[_0xf7da('0x27')](function(_0x5c9235){_0x21ee49[_0xf7da('0x47')]=_0x5c9235;return _0x21ee49;})[_0xf7da('0x27')](respondWithFilteredResult(_0x3a765e,_0xccc6cb))['catch'](handleError(_0x3a765e,null));};exports[_0xf7da('0x48')]=function(_0x3d1c64,_0xb08527){var _0x1e4c73={'raw':![],'where':{'id':_0x3d1c64[_0xf7da('0x49')]['id']}},_0x4d3be3={};_0x4d3be3['model']=_[_0xf7da('0x36')](db[_0xf7da('0x31')][_0xf7da('0x32')]);_0x4d3be3[_0xf7da('0x37')]=_[_0xf7da('0x36')](_0x3d1c64[_0xf7da('0x37')]);_0x4d3be3[_0xf7da('0x38')]=_[_0xf7da('0x39')](_0x4d3be3[_0xf7da('0x35')],_0x4d3be3[_0xf7da('0x37')]);_0x1e4c73['attributes']=_[_0xf7da('0x39')](_0x4d3be3[_0xf7da('0x35')],qs['fields'](_0x3d1c64[_0xf7da('0x37')][_0xf7da('0x3a')]));_0x1e4c73[_0xf7da('0x3b')]=_0x1e4c73[_0xf7da('0x3b')]['length']?_0x1e4c73[_0xf7da('0x3b')]:_0x4d3be3[_0xf7da('0x35')];if(_0x3d1c64[_0xf7da('0x37')][_0xf7da('0x44')]){_0x1e4c73[_0xf7da('0x45')]=[{'all':!![]}];}_0x1e4c73=_['merge']({},_0x1e4c73,_0x3d1c64[_0xf7da('0x43')]);return db[_0xf7da('0x31')][_0xf7da('0x4a')](_0x1e4c73)[_0xf7da('0x27')](handleEntityNotFound(_0xb08527,null))[_0xf7da('0x27')](respondWithResult(_0xb08527,null))[_0xf7da('0x4b')](handleError(_0xb08527,null));};exports[_0xf7da('0x4c')]=function(_0x1b3b96,_0x27bfe2){return db[_0xf7da('0x31')][_0xf7da('0x4c')](_0x1b3b96[_0xf7da('0x4d')],{})['then'](function(_0x1f43ed){var _0x17450a=_0x1b3b96['user'][_0xf7da('0x29')]({'plain':!![]});if(!_0x17450a)throw new Error(_0xf7da('0x4e'));if(_0x17450a[_0xf7da('0x4f')]==='user'){var _0x1aedb4=_0x1f43ed[_0xf7da('0x29')]({'plain':!![]});var _0x4b0255=_0xf7da('0x50');return db[_0xf7da('0x51')][_0xf7da('0x4a')]({'where':{'name':_0x4b0255,'userProfileId':_0x17450a[_0xf7da('0x52')]},'raw':!![]})[_0xf7da('0x27')](function(_0x24f079){if(_0x24f079&&_0x24f079[_0xf7da('0x53')]===0x0){return db[_0xf7da('0x2a')][_0xf7da('0x4c')]({'name':_0x1aedb4[_0xf7da('0x2d')],'resourceId':_0x1aedb4['id'],'type':_0x24f079[_0xf7da('0x2d')],'sectionId':_0x24f079['id']},{})['then'](function(){return _0x1f43ed;});}else{return _0x1f43ed;}})[_0xf7da('0x4b')](function(_0x6a3b1f){logger[_0xf7da('0x2b')](_0xf7da('0x54'),_0x6a3b1f);throw _0x6a3b1f;});}return _0x1f43ed;})[_0xf7da('0x27')](respondWithResult(_0x27bfe2,0xc9))['catch'](handleError(_0x27bfe2,null));};exports[_0xf7da('0x55')]=function(_0x3bec85,_0x1da66e){if(_0x3bec85['body']['id']){delete _0x3bec85[_0xf7da('0x4d')]['id'];}return db[_0xf7da('0x31')]['find']({'where':{'id':_0x3bec85['params']['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0x1da66e,null))['then'](saveUpdates(_0x3bec85[_0xf7da('0x4d')],null))['then'](respondWithResult(_0x1da66e,null))['catch'](handleError(_0x1da66e,null));};exports[_0xf7da('0x28')]=function(_0x1a07c2,_0xbfc595){return db[_0xf7da('0x31')][_0xf7da('0x4a')]({'where':{'id':_0x1a07c2[_0xf7da('0x49')]['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0xbfc595,null))[_0xf7da('0x27')](removeEntity(_0xbfc595,null))['catch'](handleError(_0xbfc595,null));}; \ No newline at end of file +var _0x851e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','get','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x851e,0x1e8));var _0xe851=function(_0x3b2a34,_0x55027c){_0x3b2a34=_0x3b2a34-0x0;var _0x3304cd=_0x851e[_0x3b2a34];return _0x3304cd;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){var _0x4ce93a=_0x181b19[_0xe851('0x25')]({'plain':!![]});var _0x2d508='ChanSpies';return db['UserProfileResource'][_0xe851('0x23')]({'where':{'type':_0x2d508,'resourceId':_0x4ce93a['id']}})['then'](function(){return _0x181b19;});})[_0xe851('0x24')](function(){_0x44ccb3[_0xe851('0x1a')](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2ff847,_0x1ad48e){return function(_0x1d4c78){if(!_0x1d4c78){_0x2ff847[_0xe851('0x18')](0x194);}return _0x1d4c78;};}function handleError(_0x4c67ee,_0x45771c){_0x45771c=_0x45771c||0x1f4;return function(_0x25f50a){logger['error'](_0x25f50a['stack']);if(_0x25f50a['name']){delete _0x25f50a[_0xe851('0x26')];}_0x4c67ee[_0xe851('0x1a')](_0x45771c)[_0xe851('0x27')](_0x25f50a);};}exports[_0xe851('0x28')]=function(_0x4ef1e2,_0x4d9d17){var _0x29f8d5={},_0x3d4ee3={},_0x160b7f={'count':0x0,'rows':[]};var _0x7d1569=_[_0xe851('0x29')](db[_0xe851('0x2a')][_0xe851('0x2b')],function(_0x592aa1){return{'name':_0x592aa1['fieldName'],'type':_0x592aa1[_0xe851('0x2c')][_0xe851('0x2d')]};});_0x3d4ee3[_0xe851('0x2e')]=_[_0xe851('0x29')](_0x7d1569,_0xe851('0x26'));_0x3d4ee3[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x4ef1e2[_0xe851('0x2f')]);_0x3d4ee3[_0xe851('0x31')]=_[_0xe851('0x32')](_0x3d4ee3['model'],_0x3d4ee3[_0xe851('0x2f')]);_0x29f8d5[_0xe851('0x33')]=_[_0xe851('0x32')](_0x3d4ee3['model'],qs[_0xe851('0x34')](_0x4ef1e2[_0xe851('0x2f')]['fields']));_0x29f8d5[_0xe851('0x33')]=_0x29f8d5[_0xe851('0x33')][_0xe851('0x35')]?_0x29f8d5['attributes']:_0x3d4ee3[_0xe851('0x2e')];if(!_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x36')](_0xe851('0x37'))){_0x29f8d5['limit']=qs[_0xe851('0x1e')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x1e')]);_0x29f8d5['offset']=qs[_0xe851('0x1c')](_0x4ef1e2['query'][_0xe851('0x1c')]);}_0x29f8d5[_0xe851('0x38')]=qs[_0xe851('0x39')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x39')]);_0x29f8d5[_0xe851('0x3a')]=qs[_0xe851('0x31')](_[_0xe851('0x3b')](_0x4ef1e2[_0xe851('0x2f')],_0x3d4ee3[_0xe851('0x31')]),_0x7d1569);if(_0x4ef1e2['query'][_0xe851('0x3c')]){_0x29f8d5['where']=_[_0xe851('0x3d')](_0x29f8d5[_0xe851('0x3a')],{'$or':_[_0xe851('0x29')](_0x7d1569,function(_0x189a1b){if(_0x189a1b['type']!==_0xe851('0x3e')){var _0x45d9f7={};_0x45d9f7[_0x189a1b[_0xe851('0x26')]]={'$like':'%'+_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x3c')]+'%'};return _0x45d9f7;}})});}_0x29f8d5=_[_0xe851('0x3d')]({},_0x29f8d5,_0x4ef1e2[_0xe851('0x3f')]);var _0x577eec={'where':_0x29f8d5[_0xe851('0x3a')]};return db[_0xe851('0x2a')][_0xe851('0x1f')](_0x577eec)[_0xe851('0x24')](function(_0x4890b9){_0x160b7f['count']=_0x4890b9;if(_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x40')]){_0x29f8d5[_0xe851('0x41')]=[{'all':!![]}];}return db[_0xe851('0x2a')][_0xe851('0x42')](_0x29f8d5);})[_0xe851('0x24')](function(_0x355f76){_0x160b7f[_0xe851('0x43')]=_0x355f76;return _0x160b7f;})['then'](respondWithFilteredResult(_0x4d9d17,_0x29f8d5))['catch'](handleError(_0x4d9d17,null));};exports[_0xe851('0x44')]=function(_0x2d0768,_0x3df1e9){var _0x1fdda8={'raw':![],'where':{'id':_0x2d0768[_0xe851('0x45')]['id']}},_0x487346={};_0x487346[_0xe851('0x2e')]=_[_0xe851('0x30')](db['VoiceChanSpy'][_0xe851('0x2b')]);_0x487346[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x2d0768[_0xe851('0x2f')]);_0x487346[_0xe851('0x31')]=_[_0xe851('0x32')](_0x487346[_0xe851('0x2e')],_0x487346['query']);_0x1fdda8['attributes']=_['intersection'](_0x487346['model'],qs[_0xe851('0x34')](_0x2d0768[_0xe851('0x2f')][_0xe851('0x34')]));_0x1fdda8[_0xe851('0x33')]=_0x1fdda8[_0xe851('0x33')][_0xe851('0x35')]?_0x1fdda8[_0xe851('0x33')]:_0x487346['model'];if(_0x2d0768[_0xe851('0x2f')][_0xe851('0x40')]){_0x1fdda8[_0xe851('0x41')]=[{'all':!![]}];}_0x1fdda8=_['merge']({},_0x1fdda8,_0x2d0768[_0xe851('0x3f')]);return db[_0xe851('0x2a')][_0xe851('0x46')](_0x1fdda8)[_0xe851('0x24')](handleEntityNotFound(_0x3df1e9,null))[_0xe851('0x24')](respondWithResult(_0x3df1e9,null))[_0xe851('0x47')](handleError(_0x3df1e9,null));};exports[_0xe851('0x48')]=function(_0x4662da,_0x1fb5ed){return db[_0xe851('0x2a')][_0xe851('0x48')](_0x4662da[_0xe851('0x49')],{})['then'](function(_0x328646){var _0x54782d=_0x4662da[_0xe851('0x4a')][_0xe851('0x25')]({'plain':!![]});if(!_0x54782d)throw new Error(_0xe851('0x4b'));if(_0x54782d[_0xe851('0x4c')]===_0xe851('0x4a')){var _0x5458f6=_0x328646[_0xe851('0x25')]({'plain':!![]});var _0x3c7f7c='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x3c7f7c,'userProfileId':_0x54782d[_0xe851('0x4d')]},'raw':!![]})[_0xe851('0x24')](function(_0x42e954){if(_0x42e954&&_0x42e954[_0xe851('0x4e')]===0x0){return db[_0xe851('0x4f')][_0xe851('0x48')]({'name':_0x5458f6[_0xe851('0x26')],'resourceId':_0x5458f6['id'],'type':_0x42e954[_0xe851('0x26')],'sectionId':_0x42e954['id']},{})[_0xe851('0x24')](function(){return _0x328646;});}else{return _0x328646;}})[_0xe851('0x47')](function(_0xc32db4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc32db4);throw _0xc32db4;});}return _0x328646;})[_0xe851('0x24')](respondWithResult(_0x1fb5ed,0xc9))[_0xe851('0x47')](handleError(_0x1fb5ed,null));};exports['update']=function(_0x341ae9,_0x52eccd){if(_0x341ae9[_0xe851('0x49')]['id']){delete _0x341ae9[_0xe851('0x49')]['id'];}return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x341ae9[_0xe851('0x45')]['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x52eccd,null))[_0xe851('0x24')](saveUpdates(_0x341ae9[_0xe851('0x49')],null))[_0xe851('0x24')](respondWithResult(_0x52eccd,null))[_0xe851('0x47')](handleError(_0x52eccd,null));};exports[_0xe851('0x23')]=function(_0x1ff342,_0x482b6d){return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x1ff342['params']['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x482b6d,null))[_0xe851('0x24')](removeEntity(_0x482b6d,null))[_0xe851('0x47')](handleError(_0x482b6d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 56db841..4bc06d2 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 _0x829d=['StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','then','destroy','lodash','util','./voiceChanSpy.attributes','context','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','SIP/%s,%s','name','options','join'];(function(_0x3fdd6e,_0x40c47b){var _0x1c6fbc=function(_0x48f9e9){while(--_0x48f9e9){_0x3fdd6e['push'](_0x3fdd6e['shift']());}};_0x1c6fbc(++_0x40c47b);}(_0x829d,0x10b));var _0xd829=function(_0x1f09b3,_0xc79c9e){_0x1f09b3=_0x1f09b3-0x0;var _0x34cc23=_0x829d[_0x1f09b3];return _0x34cc23;};'use strict';var _=require(_0xd829('0x0'));var util=require(_0xd829('0x1'));var BPromise=require('bluebird');var attributes=require(_0xd829('0x2'));var getUserApplications=function(_0x181c9c,_0x42549,_0xd80f59){var _0x50e093=0x1;var _0x5ccaab=[];var _0x225d13={'context':_0x42549[_0xd829('0x3')]||'from-sip','exten':util[_0xd829('0x4')]('%s%s',_0x181c9c[_0xd829('0x5')],_0xd80f59),'type':_0xd829('0x6'),'isApp':![],'ChanSpyId':_0x181c9c['id'],'UserId':_0x42549['id']};_0x5ccaab['push'](_[_0xd829('0x7')]({'app':_0xd829('0x8'),'appdata':util[_0xd829('0x4')](_0xd829('0x9'),_0xd829('0xa')),'priority':_0x50e093++},_0x225d13));if(_0x181c9c[_0xd829('0xb')]){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0xd'),'appdata':util[_0xd829('0x4')](_0xd829('0xe'),_0x181c9c[_0xd829('0xf')]),'priority':_0x50e093++},_0x225d13));}if(_0x181c9c['auth']){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0x10'),'appdata':_0x181c9c['password'],'priority':_0x50e093++},_0x225d13));}_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':'ChanSpy','appdata':util[_0xd829('0x4')](_0xd829('0x11'),_0x42549[_0xd829('0x12')],_0x181c9c[_0xd829('0x13')]?_0x181c9c[_0xd829('0x13')][_0xd829('0x14')](''):''),'priority':_0x50e093++},_0x225d13));if(_0x181c9c[_0xd829('0xb')]){_0x5ccaab[_0xd829('0xc')](_[_0xd829('0x7')]({'app':_0xd829('0x15'),'priority':_0x50e093++},_0x225d13));}return _0x5ccaab;};var getChanSpyApplications=function(_0x53fc90,_0x1bfba0){var _0x48e792=[];for(var _0xf449f1=0x0,_0x16c638=0x1;_0xf449f1<_0x1bfba0[_0xd829('0x16')];_0xf449f1++,_0x16c638=0x1){_0x48e792=_0x48e792[_0xd829('0x17')](getUserApplications(_0x53fc90,_0x1bfba0[_0xf449f1],_0x1bfba0[_0xf449f1][_0xd829('0x18')]));if(_0x1bfba0[_0xf449f1][_0xd829('0x18')]!=_0x1bfba0[_0xf449f1][_0xd829('0x12')]){_0x48e792=_0x48e792[_0xd829('0x17')](getUserApplications(_0x53fc90,_0x1bfba0[_0xf449f1],_0x1bfba0[_0xf449f1][_0xd829('0x12')]));}}return _0x48e792;};var getChanSpyPromise=function(_0x172ffe,_0x42b70d){return new BPromise(function(_0x5bd976,_0xf16364){return _0x172ffe[_0xd829('0x19')][_0xd829('0x1a')]({'attributes':['id',_0xd829('0x12'),_0xd829('0x18')],'where':{'role':_0xd829('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x342f61){if(_0x342f61){return _0x5bd976(getChanSpyApplications(_0x42b70d,_0x342f61));}return _0x5bd976([]);})[_0xd829('0x1c')](function(_0x596af0){_0xf16364(_0x596af0);});});};module['exports']=function(_0x554664,_0x4df383){var _0x31fe73=_0x554664[_0xd829('0x1d')];return _0x554664[_0xd829('0x1e')](_0xd829('0x1f'),attributes,{'tableName':_0xd829('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x428d0b,_0xcee9e8,_0x2f4a0f){return getChanSpyPromise(_0x31fe73,_0x428d0b)['then'](function(_0x3c5cb9){if(_0x3c5cb9&&_0x3c5cb9[_0xd829('0x16')]){return _0x31fe73[_0xd829('0x21')]['bulkCreate'](_0x3c5cb9);}})[_0xd829('0x22')](function(){_0x2f4a0f();})['catch'](function(_0x52eed2){_0x2f4a0f(_0x52eed2);});},'afterUpdate':function(_0x29853a,_0x4c8d9b,_0x1d0b85){return _0x31fe73[_0xd829('0x21')][_0xd829('0x23')]({'where':{'ChanSpyId':_0x29853a['id']}})['then'](function(){return getChanSpyPromise(_0x31fe73,_0x29853a);})['then'](function(_0x50b54e){if(_0x50b54e&&_0x50b54e['length']){return _0x31fe73[_0xd829('0x21')]['bulkCreate'](_0x50b54e);}})[_0xd829('0x22')](function(){_0x1d0b85();})[_0xd829('0x1c')](function(_0x5bc3c7){_0x1d0b85(_0x5bc3c7);});},'afterDestroy':function(_0x52db19,_0x2e4be1,_0x337f95){return _0x31fe73['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x52db19['id']}})['then'](function(){_0x337f95();})['catch'](function(_0x2699bc){_0x337f95(_0x2699bc);});}}});}; \ No newline at end of file +var _0x5104=['from-sip','format','%s%s','merge','Set','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','StopMixMonitor','concat','internal','name','User','findAll','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context'];(function(_0x29bd48,_0x360a8f){var _0x12f20d=function(_0x3e1f5a){while(--_0x3e1f5a){_0x29bd48['push'](_0x29bd48['shift']());}};_0x12f20d(++_0x360a8f);}(_0x5104,0x10c));var _0x4510=function(_0x55fdf1,_0x133350){_0x55fdf1=_0x55fdf1-0x0;var _0x18857d=_0x5104[_0x55fdf1];return _0x18857d;};'use strict';var _=require(_0x4510('0x0'));var util=require(_0x4510('0x1'));var BPromise=require(_0x4510('0x2'));var attributes=require(_0x4510('0x3'));var getUserApplications=function(_0x32a11f,_0xcbfd6d,_0x248429){var _0x40a438=0x1;var _0x20bb16=[];var _0x45cd0c={'context':_0xcbfd6d[_0x4510('0x4')]||_0x4510('0x5'),'exten':util[_0x4510('0x6')](_0x4510('0x7'),_0x32a11f['prefix'],_0x248429),'type':'system','isApp':![],'ChanSpyId':_0x32a11f['id'],'UserId':_0xcbfd6d['id']};_0x20bb16['push'](_[_0x4510('0x8')]({'app':_0x4510('0x9'),'appdata':util[_0x4510('0x6')](_0x4510('0xa'),'chanspy'),'priority':_0x40a438++},_0x45cd0c));if(_0x32a11f[_0x4510('0xb')]){_0x20bb16[_0x4510('0xc')](_[_0x4510('0x8')]({'app':_0x4510('0xd'),'appdata':util[_0x4510('0x6')](_0x4510('0xe'),_0x32a11f[_0x4510('0xf')]),'priority':_0x40a438++},_0x45cd0c));}if(_0x32a11f[_0x4510('0x10')]){_0x20bb16[_0x4510('0xc')](_[_0x4510('0x8')]({'app':_0x4510('0x11'),'appdata':_0x32a11f[_0x4510('0x12')],'priority':_0x40a438++},_0x45cd0c));}_0x20bb16['push'](_[_0x4510('0x8')]({'app':_0x4510('0x13'),'appdata':util['format']('SIP/%s,%s',_0xcbfd6d['name'],_0x32a11f[_0x4510('0x14')]?_0x32a11f[_0x4510('0x14')][_0x4510('0x15')](''):''),'priority':_0x40a438++},_0x45cd0c));if(_0x32a11f['record']){_0x20bb16['push'](_['merge']({'app':_0x4510('0x16'),'priority':_0x40a438++},_0x45cd0c));}return _0x20bb16;};var getChanSpyApplications=function(_0x5380a3,_0x4d2cbd){var _0x2620d9=[];for(var _0x4e388b=0x0,_0x27b942=0x1;_0x4e388b<_0x4d2cbd['length'];_0x4e388b++,_0x27b942=0x1){_0x2620d9=_0x2620d9[_0x4510('0x17')](getUserApplications(_0x5380a3,_0x4d2cbd[_0x4e388b],_0x4d2cbd[_0x4e388b][_0x4510('0x18')]));if(_0x4d2cbd[_0x4e388b][_0x4510('0x18')]!=_0x4d2cbd[_0x4e388b][_0x4510('0x19')]){_0x2620d9=_0x2620d9[_0x4510('0x17')](getUserApplications(_0x5380a3,_0x4d2cbd[_0x4e388b],_0x4d2cbd[_0x4e388b][_0x4510('0x19')]));}}return _0x2620d9;};var getChanSpyPromise=function(_0x32f532,_0x53f64d){return new BPromise(function(_0x57a7f7,_0x42e903){return _0x32f532[_0x4510('0x1a')][_0x4510('0x1b')]({'attributes':['id',_0x4510('0x19'),_0x4510('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0xfa5333){if(_0xfa5333){return _0x57a7f7(getChanSpyApplications(_0x53f64d,_0xfa5333));}return _0x57a7f7([]);})[_0x4510('0x1c')](function(_0x56adf3){_0x42e903(_0x56adf3);});});};module[_0x4510('0x1d')]=function(_0x1a1165,_0x32c10a){var _0x4ea5e1=_0x1a1165[_0x4510('0x1e')];return _0x1a1165[_0x4510('0x1f')](_0x4510('0x20'),attributes,{'tableName':_0x4510('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36c83a,_0x253c64,_0x3af2bf){return getChanSpyPromise(_0x4ea5e1,_0x36c83a)[_0x4510('0x22')](function(_0x55d5f5){if(_0x55d5f5&&_0x55d5f5[_0x4510('0x23')]){return _0x4ea5e1[_0x4510('0x24')][_0x4510('0x25')](_0x55d5f5);}})[_0x4510('0x22')](function(){_0x3af2bf();})[_0x4510('0x1c')](function(_0x2f4e58){_0x3af2bf(_0x2f4e58);});},'afterUpdate':function(_0x2becb0,_0x3cfcdd,_0x5b07c6){return _0x4ea5e1[_0x4510('0x24')][_0x4510('0x26')]({'where':{'ChanSpyId':_0x2becb0['id']}})[_0x4510('0x22')](function(){return getChanSpyPromise(_0x4ea5e1,_0x2becb0);})[_0x4510('0x22')](function(_0x1d1eb6){if(_0x1d1eb6&&_0x1d1eb6[_0x4510('0x23')]){return _0x4ea5e1[_0x4510('0x24')]['bulkCreate'](_0x1d1eb6);}})[_0x4510('0x22')](function(){_0x5b07c6();})[_0x4510('0x1c')](function(_0x5e41c6){_0x5b07c6(_0x5e41c6);});},'afterDestroy':function(_0x426fe0,_0x25559d,_0x213507){return _0x4ea5e1[_0x4510('0x24')][_0x4510('0x26')]({'where':{'ChanSpyId':_0x426fe0['id']}})[_0x4510('0x22')](function(){_0x213507();})['catch'](function(_0x172220){_0x213507(_0x172220);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index d38eb43..67706bc 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 _0x9567=['info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x9567,0xdc));var _0x7956=function(_0x3bee2d,_0x3f939e){_0x3bee2d=_0x3bee2d-0x0;var _0x4f9b9=_0x9567[_0x3bee2d];return _0x4f9b9;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file +var _0xd547=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','VoiceChanSpy,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','moment'];(function(_0xf0fec8,_0x58d396){var _0x32da3a=function(_0x1c96cd){while(--_0x1c96cd){_0xf0fec8['push'](_0xf0fec8['shift']());}};_0x32da3a(++_0x58d396);}(_0xd547,0x1c1));var _0x7d54=function(_0x4be79b,_0x21e987){_0x4be79b=_0x4be79b-0x0;var _0x14d71e=_0xd547[_0x4be79b];return _0x14d71e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d54('0x0'));var BPromise=require(_0x7d54('0x1'));var rs=require(_0x7d54('0x2'));var fs=require('fs');var Redis=require(_0x7d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d54('0x4'))('rpc');var config=require(_0x7d54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d54('0x6')][_0x7d54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b7fc1,_0x5186ae,_0x5b0b16){return new BPromise(function(_0x478f9b,_0xb224a9){return client[_0x7d54('0x8')](_0x1b7fc1,_0x5b0b16)['then'](function(_0xa5b980){logger['info'](_0x7d54('0x9'),_0x5186ae,'request\x20sent');logger[_0x7d54('0xa')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5186ae,_0x7d54('0xb'),JSON[_0x7d54('0xc')](_0xa5b980));if(_0xa5b980['error']){if(_0xa5b980['error']['code']===0x1f4){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0xa5b980[_0x7d54('0xd')]['message']);return _0xb224a9(_0xa5b980[_0x7d54('0xd')]['message']);}logger[_0x7d54('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x5186ae,_0xa5b980[_0x7d54('0xd')][_0x7d54('0xe')]);return _0x478f9b(_0xa5b980['error'][_0x7d54('0xe')]);}else{logger[_0x7d54('0xf')](_0x7d54('0x9'),_0x5186ae,'request\x20sent');_0x478f9b(_0xa5b980[_0x7d54('0x10')][_0x7d54('0xe')]);}})[_0x7d54('0x11')](function(_0x12c48d){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0x12c48d);_0xb224a9(_0x12c48d);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 710f57d..2eed877 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 _0x83ec=['../../components/interaction/service','./voiceContext.controller','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x147dc1,_0x566e6d){var _0x8ac885=function(_0xe219b){while(--_0xe219b){_0x147dc1['push'](_0x147dc1['shift']());}};_0x8ac885(++_0x566e6d);}(_0x83ec,0x19b));var _0xc83e=function(_0x2c237e,_0x5d5cde){_0x2c237e=_0x2c237e-0x0;var _0x1d9501=_0x83ec[_0x2c237e];return _0x1d9501;};'use strict';var multer=require(_0xc83e('0x0'));var util=require(_0xc83e('0x1'));var path=require(_0xc83e('0x2'));var timeout=require(_0xc83e('0x3'));var express=require(_0xc83e('0x4'));var router=express['Router']();var fs_extra=require(_0xc83e('0x5'));var auth=require(_0xc83e('0x6'));var interaction=require(_0xc83e('0x7'));var config=require('../../config/environment');var controller=require(_0xc83e('0x8'));router[_0xc83e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc83e('0xa')]);router[_0xc83e('0x9')](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller['show']);router[_0xc83e('0xd')]('/',auth['isAuthenticated'](),controller[_0xc83e('0xe')]);router['put'](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller[_0xc83e('0xf')]);router[_0xc83e('0x10')](_0xc83e('0xb'),auth[_0xc83e('0xc')](),controller[_0xc83e('0x11')]);module[_0xc83e('0x12')]=router; \ No newline at end of file +var _0x8d4f=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x466a9e,_0x57b3e3){var _0x42e26e=function(_0x4a0265){while(--_0x4a0265){_0x466a9e['push'](_0x466a9e['shift']());}};_0x42e26e(++_0x57b3e3);}(_0x8d4f,0x106));var _0xf8d4=function(_0x47b78c,_0x1b6295){_0x47b78c=_0x47b78c-0x0;var _0x230522=_0x8d4f[_0x47b78c];return _0x230522;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf8d4('0x0'));var timeout=require(_0xf8d4('0x1'));var express=require(_0xf8d4('0x2'));var router=express[_0xf8d4('0x3')]();var fs_extra=require(_0xf8d4('0x4'));var auth=require(_0xf8d4('0x5'));var interaction=require(_0xf8d4('0x6'));var config=require('../../config/environment');var controller=require(_0xf8d4('0x7'));router[_0xf8d4('0x8')]('/',auth[_0xf8d4('0x9')](),controller[_0xf8d4('0xa')]);router[_0xf8d4('0x8')](_0xf8d4('0xb'),auth['isAuthenticated'](),controller[_0xf8d4('0xc')]);router['post']('/',auth[_0xf8d4('0x9')](),controller[_0xf8d4('0xd')]);router[_0xf8d4('0xe')](_0xf8d4('0xb'),auth[_0xf8d4('0x9')](),controller[_0xf8d4('0xf')]);router[_0xf8d4('0x10')](_0xf8d4('0xb'),auth['isAuthenticated'](),controller[_0xf8d4('0x11')]);module[_0xf8d4('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 387e019..5be0f3c 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 _0x966f=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x966f,0x1af));var _0xf966=function(_0x3b9a3a,_0x372db3){_0x3b9a3a=_0x3b9a3a-0x0;var _0x456941=_0x966f[_0x3b9a3a];return _0x456941;};'use strict';var Sequelize=require(_0xf966('0x0'));module[_0xf966('0x1')]={'name':{'type':Sequelize[_0xf966('0x2')],'unique':_0xf966('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf966('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x768e=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x768e,0xc8));var _0xe768=function(_0x4c93ce,_0x9763af){_0x4c93ce=_0x4c93ce-0x0;var _0x2599dc=_0x768e[_0x4c93ce];return _0x2599dc;};'use strict';var Sequelize=require(_0xe768('0x0'));module[_0xe768('0x1')]={'name':{'type':Sequelize[_0xe768('0x2')],'unique':_0xe768('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe768('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 74ca495..5494719 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 _0x4e52=['update','destroy','then','get','Contexts','UserProfileResource','end','sendStatus','stack','name','send','map','VoiceContext','rawAttributes','key','model','keys','query','filters','intersection','attributes','length','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','chan_sip.so','readFileSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x1ae12d,_0x27346f){var _0x5170d0=function(_0x25028c){while(--_0x25028c){_0x1ae12d['push'](_0x1ae12d['shift']());}};_0x5170d0(++_0x27346f);}(_0x4e52,0xfb));var _0x24e5=function(_0x14d1b0,_0x497f75){_0x14d1b0=_0x14d1b0-0x0;var _0x24a73c=_0x4e52[_0x14d1b0];return _0x24a73c;};'use strict';var emlformat=require(_0x24e5('0x0'));var rimraf=require(_0x24e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24e5('0x2'));var rp=require(_0x24e5('0x3'));var moment=require('moment');var BPromise=require(_0x24e5('0x4'));var Mustache=require(_0x24e5('0x5'));var util=require(_0x24e5('0x6'));var path=require(_0x24e5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x24e5('0x8'));var fs=require('fs');var fs_extra=require(_0x24e5('0x9'));var _=require(_0x24e5('0xa'));var squel=require(_0x24e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x24e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x24e5('0xd'));var querystring=require(_0x24e5('0xe'));var Papa=require(_0x24e5('0xf'));var Redis=require(_0x24e5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24e5('0x11'));var hardwareService=require(_0x24e5('0x12'));var logger=require(_0x24e5('0x13'))('api');var utils=require(_0x24e5('0x14'));var config=require(_0x24e5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x24e5('0x16'))['db'];var jayson=require(_0x24e5('0x17'));var client=jayson[_0x24e5('0x18')][_0x24e5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x40f71d,_0x7d5f41,_0x5ba9c7,_0x37ac17){return new BPromise(function(_0x3e38e0,_0x4bb68a){var _0xfcb027=_0x37ac17||client;return _0xfcb027[_0x24e5('0x1a')](_0x40f71d,_0x5ba9c7)['then'](function(_0x4f13ec){logger['info']('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x24e5('0x1b'));logger[_0x24e5('0x1c')](_0x24e5('0x1d'),_0x7d5f41,_0x24e5('0x1b'),JSON[_0x24e5('0x1e')](_0x4f13ec));if(_0x4f13ec[_0x24e5('0x1f')]){if(_0x4f13ec[_0x24e5('0x1f')]['code']===0x1f4){logger[_0x24e5('0x1f')](_0x24e5('0x20'),_0x7d5f41,_0x4f13ec[_0x24e5('0x1f')][_0x24e5('0x21')]);return _0x4bb68a(_0x4f13ec['error'][_0x24e5('0x21')]);}logger[_0x24e5('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x4f13ec[_0x24e5('0x1f')]['message']);return _0x3e38e0(_0x4f13ec[_0x24e5('0x1f')]['message']);}else{logger['info'](_0x24e5('0x20'),_0x7d5f41,_0x24e5('0x1b'));_0x3e38e0(_0x4f13ec[_0x24e5('0x22')][_0x24e5('0x21')]);}})[_0x24e5('0x23')](function(_0x43ec9d){logger['error']('VoiceContext,\x20%s,\x20%s',_0x7d5f41,_0x43ec9d);_0x4bb68a(_0x43ec9d);});});}function respondWithStatusCode(_0x5d5fb0,_0x41da48){_0x41da48=_0x41da48||0xcc;return function(_0xd0ad3){if(_0xd0ad3){return _0x5d5fb0['sendStatus'](_0x41da48);}return _0x5d5fb0[_0x24e5('0x24')](_0x41da48)['end']();};}function respondWithResult(_0x3f25c1,_0x326516){_0x326516=_0x326516||0xc8;return function(_0x1d7d56){if(_0x1d7d56){return _0x3f25c1[_0x24e5('0x24')](_0x326516)[_0x24e5('0x25')](_0x1d7d56);}};}function respondWithFilteredResult(_0x1f5e9e,_0x172f56){return function(_0x339a80){if(_0x339a80){var _0x9fbc92=typeof _0x172f56[_0x24e5('0x26')]===_0x24e5('0x27')&&typeof _0x172f56[_0x24e5('0x28')]===_0x24e5('0x27');var _0x2d13d1=_0x339a80['count'];var _0x644fe8=_0x9fbc92?0x0:_0x172f56[_0x24e5('0x26')];var _0x1dea53=_0x9fbc92?_0x339a80[_0x24e5('0x29')]:_0x172f56[_0x24e5('0x26')]+_0x172f56[_0x24e5('0x28')];var _0x32b3d1;if(_0x1dea53>=_0x2d13d1){_0x1dea53=_0x2d13d1;_0x32b3d1=0xc8;}else{_0x32b3d1=0xce;}_0x1f5e9e[_0x24e5('0x24')](_0x32b3d1);return _0x1f5e9e[_0x24e5('0x2a')](_0x24e5('0x2b'),_0x644fe8+'-'+_0x1dea53+'/'+_0x2d13d1)['json'](_0x339a80);}return null;};}function patchUpdates(_0x1a4e39){return function(_0x18f3a6){try{jsonpatch[_0x24e5('0x2c')](_0x18f3a6,_0x1a4e39,!![]);}catch(_0xd9a0fa){return BPromise[_0x24e5('0x2d')](_0xd9a0fa);}return _0x18f3a6['save']();};}function saveUpdates(_0x7d4b29,_0x317c1a){return function(_0x421cea){if(_0x421cea){return _0x421cea[_0x24e5('0x2e')](_0x7d4b29)['then'](function(_0x3c6fe6){return _0x3c6fe6;});}return null;};}function removeEntity(_0x349c7b,_0x20180a){return function(_0x12f801){if(_0x12f801){return _0x12f801[_0x24e5('0x2f')]()[_0x24e5('0x30')](function(){var _0xd12e50=_0x12f801[_0x24e5('0x31')]({'plain':!![]});var _0xa32240=_0x24e5('0x32');return db[_0x24e5('0x33')]['destroy']({'where':{'type':_0xa32240,'resourceId':_0xd12e50['id']}})[_0x24e5('0x30')](function(){return _0x12f801;});})[_0x24e5('0x30')](function(){_0x349c7b['status'](0xcc)[_0x24e5('0x34')]();});}};}function handleEntityNotFound(_0x5df882,_0x1a4492){return function(_0x55b512){if(!_0x55b512){_0x5df882[_0x24e5('0x35')](0x194);}return _0x55b512;};}function handleError(_0x1a6bd4,_0x41fb95){_0x41fb95=_0x41fb95||0x1f4;return function(_0xda082e){logger[_0x24e5('0x1f')](_0xda082e[_0x24e5('0x36')]);if(_0xda082e[_0x24e5('0x37')]){delete _0xda082e[_0x24e5('0x37')];}_0x1a6bd4[_0x24e5('0x24')](_0x41fb95)[_0x24e5('0x38')](_0xda082e);};}exports['index']=function(_0x7fbaf6,_0x3b910a){var _0x2c5063={},_0x296d96={},_0x7d0b8c={'count':0x0,'rows':[]};var _0x248660=_[_0x24e5('0x39')](db[_0x24e5('0x3a')][_0x24e5('0x3b')],function(_0x59285d){return{'name':_0x59285d['fieldName'],'type':_0x59285d['type'][_0x24e5('0x3c')]};});_0x296d96[_0x24e5('0x3d')]=_[_0x24e5('0x39')](_0x248660,_0x24e5('0x37'));_0x296d96['query']=_[_0x24e5('0x3e')](_0x7fbaf6[_0x24e5('0x3f')]);_0x296d96[_0x24e5('0x40')]=_[_0x24e5('0x41')](_0x296d96[_0x24e5('0x3d')],_0x296d96[_0x24e5('0x3f')]);_0x2c5063[_0x24e5('0x42')]=_['intersection'](_0x296d96[_0x24e5('0x3d')],qs['fields'](_0x7fbaf6[_0x24e5('0x3f')]['fields']));_0x2c5063['attributes']=_0x2c5063[_0x24e5('0x42')][_0x24e5('0x43')]?_0x2c5063['attributes']:_0x296d96['model'];if(!_0x7fbaf6[_0x24e5('0x3f')]['hasOwnProperty']('nolimit')){_0x2c5063[_0x24e5('0x28')]=qs[_0x24e5('0x28')](_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x28')]);_0x2c5063[_0x24e5('0x26')]=qs[_0x24e5('0x26')](_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x26')]);}_0x2c5063[_0x24e5('0x44')]=qs[_0x24e5('0x45')](_0x7fbaf6[_0x24e5('0x3f')]['sort']);_0x2c5063[_0x24e5('0x46')]=qs[_0x24e5('0x40')](_['pick'](_0x7fbaf6[_0x24e5('0x3f')],_0x296d96[_0x24e5('0x40')]),_0x248660);if(_0x7fbaf6[_0x24e5('0x3f')]['filter']){_0x2c5063[_0x24e5('0x46')]=_[_0x24e5('0x47')](_0x2c5063[_0x24e5('0x46')],{'$or':_[_0x24e5('0x39')](_0x248660,function(_0x47dd14){if(_0x47dd14[_0x24e5('0x48')]!==_0x24e5('0x49')){var _0x3b0830={};_0x3b0830[_0x47dd14[_0x24e5('0x37')]]={'$like':'%'+_0x7fbaf6[_0x24e5('0x3f')]['filter']+'%'};return _0x3b0830;}})});}_0x2c5063=_[_0x24e5('0x47')]({},_0x2c5063,_0x7fbaf6[_0x24e5('0x4a')]);var _0x5cac1a={'where':_0x2c5063[_0x24e5('0x46')]};return db[_0x24e5('0x3a')][_0x24e5('0x29')](_0x5cac1a)[_0x24e5('0x30')](function(_0x57f4db){_0x7d0b8c[_0x24e5('0x29')]=_0x57f4db;if(_0x7fbaf6[_0x24e5('0x3f')][_0x24e5('0x4b')]){_0x2c5063[_0x24e5('0x4c')]=[{'all':!![]}];}return db[_0x24e5('0x3a')][_0x24e5('0x4d')](_0x2c5063);})['then'](function(_0x4b68dd){_0x7d0b8c[_0x24e5('0x4e')]=_0x4b68dd;return _0x7d0b8c;})[_0x24e5('0x30')](respondWithFilteredResult(_0x3b910a,_0x2c5063))[_0x24e5('0x23')](handleError(_0x3b910a,null));};exports['show']=function(_0x3ef92a,_0x296b8b){var _0x3299ad={'raw':![],'where':{'id':_0x3ef92a[_0x24e5('0x4f')]['id']}},_0xcdc2b7={};_0xcdc2b7[_0x24e5('0x3d')]=_[_0x24e5('0x3e')](db['VoiceContext'][_0x24e5('0x3b')]);_0xcdc2b7['query']=_[_0x24e5('0x3e')](_0x3ef92a[_0x24e5('0x3f')]);_0xcdc2b7['filters']=_[_0x24e5('0x41')](_0xcdc2b7[_0x24e5('0x3d')],_0xcdc2b7[_0x24e5('0x3f')]);_0x3299ad['attributes']=_[_0x24e5('0x41')](_0xcdc2b7[_0x24e5('0x3d')],qs['fields'](_0x3ef92a[_0x24e5('0x3f')]['fields']));_0x3299ad[_0x24e5('0x42')]=_0x3299ad['attributes']['length']?_0x3299ad['attributes']:_0xcdc2b7[_0x24e5('0x3d')];if(_0x3ef92a[_0x24e5('0x3f')]['includeAll']){_0x3299ad[_0x24e5('0x4c')]=[{'all':!![]}];}_0x3299ad=_[_0x24e5('0x47')]({},_0x3299ad,_0x3ef92a[_0x24e5('0x4a')]);return db[_0x24e5('0x3a')][_0x24e5('0x50')](_0x3299ad)[_0x24e5('0x30')](handleEntityNotFound(_0x296b8b,null))[_0x24e5('0x30')](respondWithResult(_0x296b8b,null))['catch'](handleError(_0x296b8b,null));};exports[_0x24e5('0x51')]=function(_0x8e7a49,_0x2acc52,_0x1aaadf){var _0x33ff7f;return db[_0x24e5('0x3a')][_0x24e5('0x51')](_0x8e7a49[_0x24e5('0x52')],{'raw':!![]})['then'](function(_0x3340a9){_0x33ff7f=_0x3340a9;return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});})[_0x24e5('0x30')](function(_0x531d29){var _0x509176=fs['readFileSync'](path[_0x24e5('0x53')](config[_0x24e5('0x54')],_0x24e5('0x55')),_0x24e5('0x56'));var _0x5ac9c7=ejs[_0x24e5('0x57')](_0x509176,{'contexts':_0x531d29||[]});fs[_0x24e5('0x58')](_0x24e5('0x59'),_0x5ac9c7);})[_0x24e5('0x30')](function(){return respondWithRpcPromise(_0x24e5('0x5a'),_0x24e5('0x51'),{'module':'chan_sip.so'});})[_0x24e5('0x30')](function(){var _0x101272=_0x8e7a49[_0x24e5('0x5b')][_0x24e5('0x31')]({'plain':!![]});if(!_0x101272)throw new Error(_0x24e5('0x5c'));if(_0x101272[_0x24e5('0x5d')]==='user'){var _0x2ef5b4=_0x33ff7f[_0x24e5('0x31')]({'plain':!![]});return db[_0x24e5('0x5e')][_0x24e5('0x50')]({'where':{'name':_0x24e5('0x32'),'userProfileId':_0x101272[_0x24e5('0x5f')]},'raw':!![]})[_0x24e5('0x30')](function(_0x5d7beb){if(_0x5d7beb&&_0x5d7beb[_0x24e5('0x60')]===0x0){return db[_0x24e5('0x33')]['create']({'name':_0x2ef5b4[_0x24e5('0x37')],'resourceId':_0x2ef5b4['id'],'type':_0x5d7beb[_0x24e5('0x37')],'sectionId':_0x5d7beb['id']},{})['then'](function(){return _0x33ff7f;});}else{return _0x33ff7f;}})[_0x24e5('0x23')](function(_0x2d8522){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d8522);throw _0x2d8522;});}return _0x33ff7f;})[_0x24e5('0x30')](respondWithResult(_0x2acc52,0xc9))['catch'](handleError(_0x2acc52,null));};exports['update']=function(_0x2d42a6,_0x2e575b,_0x32474e){var _0x316bcf;return db[_0x24e5('0x3a')]['find']({'where':{'id':_0x2d42a6[_0x24e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2e575b,null))[_0x24e5('0x30')](saveUpdates(_0x2d42a6['body'],null))[_0x24e5('0x30')](function(_0x330e13){if(_0x330e13){_0x316bcf=_0x330e13;return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});}})['then'](function(_0x35bec7){var _0x24d8c7=fs['readFileSync'](path[_0x24e5('0x53')](config['root'],_0x24e5('0x55')),_0x24e5('0x56'));var _0x10d7fe=ejs[_0x24e5('0x57')](_0x24d8c7,{'contexts':_0x35bec7||[]});fs[_0x24e5('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x10d7fe);})[_0x24e5('0x30')](function(){return respondWithRpcPromise(_0x24e5('0x5a'),_0x24e5('0x2e'),{'module':_0x24e5('0x61')});})[_0x24e5('0x30')](function(){return _0x316bcf;})[_0x24e5('0x30')](respondWithResult(_0x2e575b,null))[_0x24e5('0x23')](handleError(_0x2e575b,null));};exports[_0x24e5('0x2f')]=function(_0x500bb1,_0x1cdbaf,_0x532f0e){var _0x4ef5fc;return db['VoiceContext'][_0x24e5('0x50')]({'where':{'id':_0x500bb1[_0x24e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1cdbaf,null))[_0x24e5('0x30')](removeEntity(_0x1cdbaf,null))[_0x24e5('0x30')](function(){return db[_0x24e5('0x3a')][_0x24e5('0x4d')]({'raw':!![]});})[_0x24e5('0x30')](function(_0x10febf){var _0x46de11=fs[_0x24e5('0x62')](path[_0x24e5('0x53')](config[_0x24e5('0x54')],_0x24e5('0x55')),_0x24e5('0x56'));var _0x2973da=ejs['render'](_0x46de11,{'contexts':_0x10febf});fs[_0x24e5('0x58')](_0x24e5('0x59'),_0x2973da);return respondWithRpcPromise('Reload',_0x24e5('0x2f'),{'module':'chan_sip.so'});})[_0x24e5('0x23')](handleError(_0x1cdbaf,null));}; \ No newline at end of file +var _0x9c71=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','map','rawAttributes','fieldName','key','filters','intersection','query','attributes','model','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','keys','VoiceContext','create','body','findAll','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','get','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','join','/etc/asterisk/extensions_xcally_contexts.conf','root','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9c71,0x1e5));var _0x19c7=function(_0x27c22a,_0x13531d){_0x27c22a=_0x27c22a-0x0;var _0xf94833=_0x9c71[_0x27c22a];return _0xf94833;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x19c7('0x0'));var zipdir=require(_0x19c7('0x1'));var jsonpatch=require(_0x19c7('0x2'));var rp=require(_0x19c7('0x3'));var moment=require('moment');var BPromise=require(_0x19c7('0x4'));var Mustache=require(_0x19c7('0x5'));var util=require(_0x19c7('0x6'));var path=require(_0x19c7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x19c7('0x8'));var fs=require('fs');var fs_extra=require(_0x19c7('0x9'));var _=require(_0x19c7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x19c7('0xb'));var toCsv=require(_0x19c7('0xc'));var querystring=require(_0x19c7('0xd'));var Papa=require(_0x19c7('0xe'));var Redis=require('ioredis');var authService=require(_0x19c7('0xf'));var qs=require(_0x19c7('0x10'));var as=require(_0x19c7('0x11'));var hardwareService=require(_0x19c7('0x12'));var logger=require(_0x19c7('0x13'))(_0x19c7('0x14'));var utils=require(_0x19c7('0x15'));var config=require(_0x19c7('0x16'));var licenseUtil=require(_0x19c7('0x17'));var db=require(_0x19c7('0x18'))['db'];var jayson=require(_0x19c7('0x19'));var client=jayson[_0x19c7('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ac504,_0x5d109c,_0x3fae75,_0x36a329){return new BPromise(function(_0x1248ba,_0x2b6720){var _0x249ece=_0x36a329||client;return _0x249ece[_0x19c7('0x1b')](_0x3ac504,_0x3fae75)[_0x19c7('0x1c')](function(_0xf5c6be){logger[_0x19c7('0x1d')](_0x19c7('0x1e'),_0x5d109c,_0x19c7('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5d109c,_0x19c7('0x1f'),JSON[_0x19c7('0x20')](_0xf5c6be));if(_0xf5c6be[_0x19c7('0x21')]){if(_0xf5c6be['error'][_0x19c7('0x22')]===0x1f4){logger[_0x19c7('0x21')](_0x19c7('0x1e'),_0x5d109c,_0xf5c6be[_0x19c7('0x21')][_0x19c7('0x23')]);return _0x2b6720(_0xf5c6be['error'][_0x19c7('0x23')]);}logger['error'](_0x19c7('0x1e'),_0x5d109c,_0xf5c6be['error']['message']);return _0x1248ba(_0xf5c6be['error']['message']);}else{logger[_0x19c7('0x1d')](_0x19c7('0x1e'),_0x5d109c,_0x19c7('0x1f'));_0x1248ba(_0xf5c6be[_0x19c7('0x24')][_0x19c7('0x23')]);}})[_0x19c7('0x25')](function(_0x40f8f6){logger[_0x19c7('0x21')](_0x19c7('0x1e'),_0x5d109c,_0x40f8f6);_0x2b6720(_0x40f8f6);});});}function respondWithStatusCode(_0x5be1b9,_0x44d43a){_0x44d43a=_0x44d43a||0xcc;return function(_0x5c2e4e){if(_0x5c2e4e){return _0x5be1b9[_0x19c7('0x26')](_0x44d43a);}return _0x5be1b9[_0x19c7('0x27')](_0x44d43a)[_0x19c7('0x28')]();};}function respondWithResult(_0x1a1485,_0x3b84d6){_0x3b84d6=_0x3b84d6||0xc8;return function(_0x572a73){if(_0x572a73){return _0x1a1485['status'](_0x3b84d6)['json'](_0x572a73);}};}function respondWithFilteredResult(_0x420533,_0x304474){return function(_0x5c40a5){if(_0x5c40a5){var _0x2e213e=typeof _0x304474[_0x19c7('0x29')]===_0x19c7('0x2a')&&typeof _0x304474['limit']===_0x19c7('0x2a');var _0x476a90=_0x5c40a5[_0x19c7('0x2b')];var _0x3ca315=_0x2e213e?0x0:_0x304474[_0x19c7('0x29')];var _0x357012=_0x2e213e?_0x5c40a5[_0x19c7('0x2b')]:_0x304474['offset']+_0x304474[_0x19c7('0x2c')];var _0x3ce371;if(_0x357012>=_0x476a90){_0x357012=_0x476a90;_0x3ce371=0xc8;}else{_0x3ce371=0xce;}_0x420533[_0x19c7('0x27')](_0x3ce371);return _0x420533[_0x19c7('0x2d')]('Content-Range',_0x3ca315+'-'+_0x357012+'/'+_0x476a90)[_0x19c7('0x2e')](_0x5c40a5);}return null;};}function patchUpdates(_0x5a03da){return function(_0x319069){try{jsonpatch[_0x19c7('0x2f')](_0x319069,_0x5a03da,!![]);}catch(_0x1ea87b){return BPromise[_0x19c7('0x30')](_0x1ea87b);}return _0x319069[_0x19c7('0x31')]();};}function saveUpdates(_0x34919a,_0xa60967){return function(_0x2894b2){if(_0x2894b2){return _0x2894b2[_0x19c7('0x32')](_0x34919a)['then'](function(_0x4cb15c){return _0x4cb15c;});}return null;};}function removeEntity(_0x524768,_0x4d9dfa){return function(_0x2896bb){if(_0x2896bb){return _0x2896bb[_0x19c7('0x33')]()[_0x19c7('0x1c')](function(){var _0x485b77=_0x2896bb['get']({'plain':!![]});var _0x130277=_0x19c7('0x34');return db[_0x19c7('0x35')]['destroy']({'where':{'type':_0x130277,'resourceId':_0x485b77['id']}})[_0x19c7('0x1c')](function(){return _0x2896bb;});})[_0x19c7('0x1c')](function(){_0x524768['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bfb63,_0x40cccf){return function(_0x50905b){if(!_0x50905b){_0x5bfb63[_0x19c7('0x26')](0x194);}return _0x50905b;};}function handleError(_0x159040,_0x5da55e){_0x5da55e=_0x5da55e||0x1f4;return function(_0xce41e){logger[_0x19c7('0x21')](_0xce41e[_0x19c7('0x36')]);if(_0xce41e[_0x19c7('0x37')]){delete _0xce41e['name'];}_0x159040['status'](_0x5da55e)['send'](_0xce41e);};}exports['index']=function(_0x4a4007,_0x2ad087){var _0x480d41={},_0x1e3761={},_0x1a9620={'count':0x0,'rows':[]};var _0x14f43b=_[_0x19c7('0x38')](db['VoiceContext'][_0x19c7('0x39')],function(_0x4cc246){return{'name':_0x4cc246[_0x19c7('0x3a')],'type':_0x4cc246['type'][_0x19c7('0x3b')]};});_0x1e3761['model']=_[_0x19c7('0x38')](_0x14f43b,'name');_0x1e3761['query']=_['keys'](_0x4a4007['query']);_0x1e3761[_0x19c7('0x3c')]=_[_0x19c7('0x3d')](_0x1e3761['model'],_0x1e3761[_0x19c7('0x3e')]);_0x480d41[_0x19c7('0x3f')]=_['intersection'](_0x1e3761[_0x19c7('0x40')],qs['fields'](_0x4a4007['query'][_0x19c7('0x41')]));_0x480d41[_0x19c7('0x3f')]=_0x480d41[_0x19c7('0x3f')][_0x19c7('0x42')]?_0x480d41['attributes']:_0x1e3761['model'];if(!_0x4a4007[_0x19c7('0x3e')]['hasOwnProperty'](_0x19c7('0x43'))){_0x480d41[_0x19c7('0x2c')]=qs[_0x19c7('0x2c')](_0x4a4007[_0x19c7('0x3e')]['limit']);_0x480d41[_0x19c7('0x29')]=qs['offset'](_0x4a4007[_0x19c7('0x3e')][_0x19c7('0x29')]);}_0x480d41['order']=qs['sort'](_0x4a4007['query'][_0x19c7('0x44')]);_0x480d41[_0x19c7('0x45')]=qs['filters'](_[_0x19c7('0x46')](_0x4a4007['query'],_0x1e3761[_0x19c7('0x3c')]),_0x14f43b);if(_0x4a4007[_0x19c7('0x3e')]['filter']){_0x480d41[_0x19c7('0x45')]=_[_0x19c7('0x47')](_0x480d41[_0x19c7('0x45')],{'$or':_[_0x19c7('0x38')](_0x14f43b,function(_0xad0918){if(_0xad0918['type']!=='VIRTUAL'){var _0x51a0ff={};_0x51a0ff[_0xad0918['name']]={'$like':'%'+_0x4a4007[_0x19c7('0x3e')][_0x19c7('0x48')]+'%'};return _0x51a0ff;}})});}_0x480d41=_[_0x19c7('0x47')]({},_0x480d41,_0x4a4007[_0x19c7('0x49')]);var _0x258282={'where':_0x480d41['where']};return db['VoiceContext'][_0x19c7('0x2b')](_0x258282)[_0x19c7('0x1c')](function(_0x36f436){_0x1a9620[_0x19c7('0x2b')]=_0x36f436;if(_0x4a4007[_0x19c7('0x3e')][_0x19c7('0x4a')]){_0x480d41[_0x19c7('0x4b')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x480d41);})[_0x19c7('0x1c')](function(_0x29def3){_0x1a9620[_0x19c7('0x4c')]=_0x29def3;return _0x1a9620;})[_0x19c7('0x1c')](respondWithFilteredResult(_0x2ad087,_0x480d41))['catch'](handleError(_0x2ad087,null));};exports[_0x19c7('0x4d')]=function(_0x18ac5c,_0x105a8f){var _0x4bafae={'raw':![],'where':{'id':_0x18ac5c[_0x19c7('0x4e')]['id']}},_0x38fadd={};_0x38fadd[_0x19c7('0x40')]=_[_0x19c7('0x4f')](db[_0x19c7('0x50')][_0x19c7('0x39')]);_0x38fadd['query']=_[_0x19c7('0x4f')](_0x18ac5c[_0x19c7('0x3e')]);_0x38fadd[_0x19c7('0x3c')]=_[_0x19c7('0x3d')](_0x38fadd[_0x19c7('0x40')],_0x38fadd[_0x19c7('0x3e')]);_0x4bafae[_0x19c7('0x3f')]=_[_0x19c7('0x3d')](_0x38fadd['model'],qs['fields'](_0x18ac5c[_0x19c7('0x3e')][_0x19c7('0x41')]));_0x4bafae[_0x19c7('0x3f')]=_0x4bafae[_0x19c7('0x3f')]['length']?_0x4bafae[_0x19c7('0x3f')]:_0x38fadd[_0x19c7('0x40')];if(_0x18ac5c[_0x19c7('0x3e')][_0x19c7('0x4a')]){_0x4bafae['include']=[{'all':!![]}];}_0x4bafae=_['merge']({},_0x4bafae,_0x18ac5c['options']);return db[_0x19c7('0x50')]['find'](_0x4bafae)['then'](handleEntityNotFound(_0x105a8f,null))[_0x19c7('0x1c')](respondWithResult(_0x105a8f,null))[_0x19c7('0x25')](handleError(_0x105a8f,null));};exports[_0x19c7('0x51')]=function(_0x584dda,_0x3fd05b,_0x476801){var _0xb79c1a;return db['VoiceContext']['create'](_0x584dda[_0x19c7('0x52')],{'raw':!![]})[_0x19c7('0x1c')](function(_0x49ab31){_0xb79c1a=_0x49ab31;return db['VoiceContext'][_0x19c7('0x53')]({'raw':!![]});})[_0x19c7('0x1c')](function(_0x2acb9e){var _0x23d489=fs[_0x19c7('0x54')](path['join'](config['root'],_0x19c7('0x55')),_0x19c7('0x56'));var _0x16b297=ejs[_0x19c7('0x57')](_0x23d489,{'contexts':_0x2acb9e||[]});fs[_0x19c7('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x16b297);})[_0x19c7('0x1c')](function(){return respondWithRpcPromise(_0x19c7('0x59'),_0x19c7('0x51'),{'module':_0x19c7('0x5a')});})['then'](function(){var _0x1c410b=_0x584dda['user'][_0x19c7('0x5b')]({'plain':!![]});if(!_0x1c410b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c410b[_0x19c7('0x5c')]===_0x19c7('0x5d')){var _0x2f09d8=_0xb79c1a['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x19c7('0x34'),'userProfileId':_0x1c410b[_0x19c7('0x5e')]},'raw':!![]})[_0x19c7('0x1c')](function(_0x1851de){if(_0x1851de&&_0x1851de[_0x19c7('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f09d8['name'],'resourceId':_0x2f09d8['id'],'type':_0x1851de[_0x19c7('0x37')],'sectionId':_0x1851de['id']},{})[_0x19c7('0x1c')](function(){return _0xb79c1a;});}else{return _0xb79c1a;}})[_0x19c7('0x25')](function(_0x1edb42){logger[_0x19c7('0x21')](_0x19c7('0x60'),_0x1edb42);throw _0x1edb42;});}return _0xb79c1a;})[_0x19c7('0x1c')](respondWithResult(_0x3fd05b,0xc9))['catch'](handleError(_0x3fd05b,null));};exports['update']=function(_0x1e533d,_0x1cd3c4,_0x414bd9){var _0x5cdef7;return db[_0x19c7('0x50')][_0x19c7('0x61')]({'where':{'id':_0x1e533d['params']['id']}})[_0x19c7('0x1c')](handleEntityNotFound(_0x1cd3c4,null))[_0x19c7('0x1c')](saveUpdates(_0x1e533d['body'],null))[_0x19c7('0x1c')](function(_0x59118d){if(_0x59118d){_0x5cdef7=_0x59118d;return db[_0x19c7('0x50')][_0x19c7('0x53')]({'raw':!![]});}})[_0x19c7('0x1c')](function(_0x1b2b63){var _0x8a1d8b=fs['readFileSync'](path[_0x19c7('0x62')](config['root'],_0x19c7('0x55')),_0x19c7('0x56'));var _0x51893a=ejs[_0x19c7('0x57')](_0x8a1d8b,{'contexts':_0x1b2b63||[]});fs[_0x19c7('0x58')](_0x19c7('0x63'),_0x51893a);})[_0x19c7('0x1c')](function(){return respondWithRpcPromise(_0x19c7('0x59'),'update',{'module':_0x19c7('0x5a')});})[_0x19c7('0x1c')](function(){return _0x5cdef7;})[_0x19c7('0x1c')](respondWithResult(_0x1cd3c4,null))[_0x19c7('0x25')](handleError(_0x1cd3c4,null));};exports[_0x19c7('0x33')]=function(_0x55515a,_0x596768,_0x56ec58){var _0x51b13a;return db[_0x19c7('0x50')]['find']({'where':{'id':_0x55515a[_0x19c7('0x4e')]['id']}})[_0x19c7('0x1c')](handleEntityNotFound(_0x596768,null))['then'](removeEntity(_0x596768,null))[_0x19c7('0x1c')](function(){return db[_0x19c7('0x50')][_0x19c7('0x53')]({'raw':!![]});})[_0x19c7('0x1c')](function(_0x5f3f03){var _0xeb1237=fs[_0x19c7('0x54')](path[_0x19c7('0x62')](config[_0x19c7('0x64')],_0x19c7('0x55')),'utf8');var _0x5eba37=ejs[_0x19c7('0x57')](_0xeb1237,{'contexts':_0x5f3f03});fs['writeFileSync'](_0x19c7('0x63'),_0x5eba37);return respondWithRpcPromise(_0x19c7('0x59'),_0x19c7('0x33'),{'module':_0x19c7('0x5a')});})[_0x19c7('0x25')](handleError(_0x596768,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index be9f307..72191a7 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 _0x0f3e=['VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x0f3e,0x1e6));var _0xe0f3=function(_0x36769d,_0x2da274){_0x36769d=_0x36769d-0x0;var _0x124470=_0x0f3e[_0x36769d];return _0x124470;};'use strict';var _=require(_0xe0f3('0x0'));var util=require('util');var logger=require(_0xe0f3('0x1'))(_0xe0f3('0x2'));var moment=require('moment');var BPromise=require(_0xe0f3('0x3'));var rp=require(_0xe0f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0f3('0x5'));var config=require(_0xe0f3('0x6'));var attributes=require('./voiceContext.attributes');module[_0xe0f3('0x7')]=function(_0x4422ae,_0x3d98df){return _0x4422ae[_0xe0f3('0x8')](_0xe0f3('0x9'),attributes,{'tableName':_0xe0f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x552c=['api','moment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0x105114,_0x213db9){var _0xea4357=function(_0x56a477){while(--_0x56a477){_0x105114['push'](_0x105114['shift']());}};_0xea4357(++_0x213db9);}(_0x552c,0xa0));var _0xc552=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0x552c[_0x375efe];return _0x1d5db6;};'use strict';var _=require('lodash');var util=require(_0xc552('0x0'));var logger=require(_0xc552('0x1'))(_0xc552('0x2'));var moment=require(_0xc552('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(_0xc552('0x4'));module[_0xc552('0x5')]=function(_0x37da20,_0xc71556){return _0x37da20[_0xc552('0x6')](_0xc552('0x7'),attributes,{'tableName':_0xc552('0x8'),'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 aeff859..ebc9fc7 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 _0xbfcc=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0x8505e8,_0x59587b){var _0x3c3e07=function(_0x2bee5d){while(--_0x2bee5d){_0x8505e8['push'](_0x8505e8['shift']());}};_0x3c3e07(++_0x59587b);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xbfcc[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VoiceContext,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file +var _0x15e8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','bluebird','randomstring'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x15e8,0x13d));var _0x815e=function(_0x4cd71a,_0x446f37){_0x4cd71a=_0x4cd71a-0x0;var _0x24602e=_0x15e8[_0x4cd71a];return _0x24602e;};'use strict';var _=require('lodash');var util=require(_0x815e('0x0'));var moment=require('moment');var BPromise=require(_0x815e('0x1'));var rs=require(_0x815e('0x2'));var fs=require('fs');var Redis=require(_0x815e('0x3'));var db=require(_0x815e('0x4'))['db'];var utils=require(_0x815e('0x5'));var logger=require(_0x815e('0x6'))(_0x815e('0x7'));var config=require(_0x815e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x815e('0x9')][_0x815e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcbfe4e,_0x584e1a,_0x2563c4){return new BPromise(function(_0x5798b1,_0x1c6506){return client['request'](_0xcbfe4e,_0x2563c4)[_0x815e('0xb')](function(_0x2a273e){logger['info'](_0x815e('0xc'),_0x584e1a,'request\x20sent');logger[_0x815e('0xd')](_0x815e('0xe'),_0x584e1a,_0x815e('0xf'),JSON[_0x815e('0x10')](_0x2a273e));if(_0x2a273e[_0x815e('0x11')]){if(_0x2a273e[_0x815e('0x11')][_0x815e('0x12')]===0x1f4){logger['error'](_0x815e('0xc'),_0x584e1a,_0x2a273e[_0x815e('0x11')]['message']);return _0x1c6506(_0x2a273e[_0x815e('0x11')][_0x815e('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x584e1a,_0x2a273e[_0x815e('0x11')]['message']);return _0x5798b1(_0x2a273e[_0x815e('0x11')][_0x815e('0x13')]);}else{logger['info'](_0x815e('0xc'),_0x584e1a,'request\x20sent');_0x5798b1(_0x2a273e['result'][_0x815e('0x13')]);}})['catch'](function(_0x5a6df2){logger[_0x815e('0x11')](_0x815e('0xc'),_0x584e1a,_0x5a6df2);_0x1c6506(_0x5a6df2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 724b4b8..7b528e9 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 _0xde94=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xde94,0x134));var _0x4de9=function(_0x1f4400,_0x3c8593){_0x1f4400=_0x1f4400-0x0;var _0x2dd98a=_0xde94[_0x1f4400];return _0x2dd98a;};'use strict';var multer=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var path=require(_0x4de9('0x2'));var timeout=require(_0x4de9('0x3'));var express=require(_0x4de9('0x4'));var router=express[_0x4de9('0x5')]();var fs_extra=require(_0x4de9('0x6'));var auth=require(_0x4de9('0x7'));var interaction=require(_0x4de9('0x8'));var config=require(_0x4de9('0x9'));var controller=require('./voiceDialReport.controller');router[_0x4de9('0xa')]('/',auth[_0x4de9('0xb')](),controller[_0x4de9('0xc')]);router['get'](_0x4de9('0xd'),auth[_0x4de9('0xb')](),controller['describe']);router[_0x4de9('0xa')]('/:id',auth[_0x4de9('0xb')](),controller[_0x4de9('0xe')]);router['post']('/',auth[_0x4de9('0xb')](),controller[_0x4de9('0xf')]);router[_0x4de9('0x10')](_0x4de9('0x11'),auth[_0x4de9('0xb')](),controller[_0x4de9('0x12')]);router['delete']('/:id',auth[_0x4de9('0xb')](),controller[_0x4de9('0x13')]);module[_0x4de9('0x14')]=router; \ No newline at end of file +var _0x0884=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4088('0x0'));var util=require(_0x4088('0x1'));var path=require(_0x4088('0x2'));var timeout=require(_0x4088('0x3'));var express=require(_0x4088('0x4'));var router=express[_0x4088('0x5')]();var fs_extra=require(_0x4088('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4088('0x7'));var config=require(_0x4088('0x8'));var controller=require(_0x4088('0x9'));router[_0x4088('0xa')]('/',auth[_0x4088('0xb')](),controller['index']);router['get'](_0x4088('0xc'),auth['isAuthenticated'](),controller[_0x4088('0xd')]);router[_0x4088('0xa')](_0x4088('0xe'),auth[_0x4088('0xb')](),controller[_0x4088('0xf')]);router[_0x4088('0x10')]('/',auth[_0x4088('0xb')](),controller[_0x4088('0x11')]);router[_0x4088('0x12')]('/:id',auth[_0x4088('0xb')](),controller[_0x4088('0x13')]);router[_0x4088('0x14')]('/:id',auth[_0x4088('0xb')](),controller[_0x4088('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 93535c3..4c3591a 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 _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x11f9d7,_0x443cbc){var _0x51db81=function(_0x39f9f0){while(--_0x39f9f0){_0x11f9d7['push'](_0x11f9d7['shift']());}};_0x51db81(++_0x443cbc);}(_0x55ca,0x126));var _0xa55c=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x55ca[_0x431ff8];return _0x84ccd4;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x84ab,0x12f));var _0xb84a=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x84ab[_0x4f0e62];return _0x117ab8;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a688958..53e8868 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 _0x49c1=['destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','findAll','catch','show','params','includeAll','include','merge','find','create','body'];(function(_0x21b74b,_0x543c76){var _0x518cc6=function(_0x5b3010){while(--_0x5b3010){_0x21b74b['push'](_0x21b74b['shift']());}};_0x518cc6(++_0x543c76);}(_0x49c1,0x132));var _0x149c=function(_0x208c41,_0x244d82){_0x208c41=_0x208c41-0x0;var _0x537811=_0x49c1[_0x208c41];return _0x537811;};'use strict';var emlformat=require(_0x149c('0x0'));var rimraf=require(_0x149c('0x1'));var zipdir=require(_0x149c('0x2'));var jsonpatch=require(_0x149c('0x3'));var rp=require(_0x149c('0x4'));var moment=require(_0x149c('0x5'));var BPromise=require(_0x149c('0x6'));var Mustache=require(_0x149c('0x7'));var util=require(_0x149c('0x8'));var path=require(_0x149c('0x9'));var sox=require(_0x149c('0xa'));var csv=require(_0x149c('0xb'));var ejs=require(_0x149c('0xc'));var fs=require('fs');var fs_extra=require(_0x149c('0xd'));var _=require(_0x149c('0xe'));var squel=require(_0x149c('0xf'));var crypto=require(_0x149c('0x10'));var jsforce=require(_0x149c('0x11'));var deskjs=require(_0x149c('0x12'));var toCsv=require(_0x149c('0xb'));var querystring=require(_0x149c('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x149c('0x14'));var qs=require(_0x149c('0x15'));var as=require(_0x149c('0x16'));var hardwareService=require(_0x149c('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x149c('0x18'));var config=require(_0x149c('0x19'));var licenseUtil=require(_0x149c('0x1a'));var db=require(_0x149c('0x1b'))['db'];function respondWithStatusCode(_0x14fd90,_0x24b4b5){_0x24b4b5=_0x24b4b5||0xcc;return function(_0x158d6d){if(_0x158d6d){return _0x14fd90[_0x149c('0x1c')](_0x24b4b5);}return _0x14fd90[_0x149c('0x1d')](_0x24b4b5)[_0x149c('0x1e')]();};}function respondWithResult(_0x128950,_0x50c0ac){_0x50c0ac=_0x50c0ac||0xc8;return function(_0x48ba48){if(_0x48ba48){return _0x128950[_0x149c('0x1d')](_0x50c0ac)[_0x149c('0x1f')](_0x48ba48);}};}function respondWithFilteredResult(_0x141863,_0xbabfa9){return function(_0x1fa75b){if(_0x1fa75b){var _0x365a7c=typeof _0xbabfa9[_0x149c('0x20')]===_0x149c('0x21')&&typeof _0xbabfa9[_0x149c('0x22')]===_0x149c('0x21');var _0x557644=_0x1fa75b['count'];var _0x4c86df=_0x365a7c?0x0:_0xbabfa9[_0x149c('0x20')];var _0x2f6684=_0x365a7c?_0x1fa75b[_0x149c('0x23')]:_0xbabfa9['offset']+_0xbabfa9['limit'];var _0x1182f6;if(_0x2f6684>=_0x557644){_0x2f6684=_0x557644;_0x1182f6=0xc8;}else{_0x1182f6=0xce;}_0x141863[_0x149c('0x1d')](_0x1182f6);return _0x141863[_0x149c('0x24')](_0x149c('0x25'),_0x4c86df+'-'+_0x2f6684+'/'+_0x557644)[_0x149c('0x1f')](_0x1fa75b);}return null;};}function patchUpdates(_0x5dfc8b){return function(_0x5b7cee){try{jsonpatch[_0x149c('0x26')](_0x5b7cee,_0x5dfc8b,!![]);}catch(_0x1ea1c7){return BPromise['reject'](_0x1ea1c7);}return _0x5b7cee[_0x149c('0x27')]();};}function saveUpdates(_0x54dc34,_0x350f15){return function(_0x3b86ac){if(_0x3b86ac){return _0x3b86ac[_0x149c('0x28')](_0x54dc34)[_0x149c('0x29')](function(_0x5c554d){return _0x5c554d;});}return null;};}function removeEntity(_0x36947d,_0xc2b47d){return function(_0x45d5f0){if(_0x45d5f0){return _0x45d5f0['destroy']()[_0x149c('0x29')](function(){_0x36947d[_0x149c('0x1d')](0xcc)[_0x149c('0x1e')]();});}};}function handleEntityNotFound(_0x38e6be,_0x381dc9){return function(_0x40a959){if(!_0x40a959){_0x38e6be['sendStatus'](0x194);}return _0x40a959;};}function handleError(_0x55112d,_0x5cdefa){_0x5cdefa=_0x5cdefa||0x1f4;return function(_0x239f9b){logger['error'](_0x239f9b['stack']);if(_0x239f9b[_0x149c('0x2a')]){delete _0x239f9b[_0x149c('0x2a')];}_0x55112d[_0x149c('0x1d')](_0x5cdefa)['send'](_0x239f9b);};}exports['index']=function(_0xeaa917,_0x47b53b){var _0x2ed79a={},_0x440af8={},_0x146275={'count':0x0,'rows':[]};var _0x19df33=_['map'](db[_0x149c('0x2b')][_0x149c('0x2c')],function(_0x4d0903){return{'name':_0x4d0903[_0x149c('0x2d')],'type':_0x4d0903[_0x149c('0x2e')][_0x149c('0x2f')]};});_0x440af8[_0x149c('0x30')]=_[_0x149c('0x31')](_0x19df33,_0x149c('0x2a'));_0x440af8[_0x149c('0x32')]=_[_0x149c('0x33')](_0xeaa917['query']);_0x440af8[_0x149c('0x34')]=_['intersection'](_0x440af8[_0x149c('0x30')],_0x440af8['query']);_0x2ed79a[_0x149c('0x35')]=_[_0x149c('0x36')](_0x440af8[_0x149c('0x30')],qs[_0x149c('0x37')](_0xeaa917['query'][_0x149c('0x37')]));_0x2ed79a['attributes']=_0x2ed79a['attributes'][_0x149c('0x38')]?_0x2ed79a[_0x149c('0x35')]:_0x440af8['model'];if(!_0xeaa917[_0x149c('0x32')]['hasOwnProperty'](_0x149c('0x39'))){_0x2ed79a[_0x149c('0x22')]=qs['limit'](_0xeaa917[_0x149c('0x32')][_0x149c('0x22')]);_0x2ed79a[_0x149c('0x20')]=qs[_0x149c('0x20')](_0xeaa917[_0x149c('0x32')][_0x149c('0x20')]);}_0x2ed79a['order']=qs[_0x149c('0x3a')](_0xeaa917['query'][_0x149c('0x3a')]);_0x2ed79a[_0x149c('0x3b')]=qs['filters'](_[_0x149c('0x3c')](_0xeaa917[_0x149c('0x32')],_0x440af8[_0x149c('0x34')]),_0x19df33);if(_0xeaa917[_0x149c('0x32')][_0x149c('0x3d')]){_0x2ed79a['where']=_['merge'](_0x2ed79a[_0x149c('0x3b')],{'$or':_[_0x149c('0x31')](_0x19df33,function(_0x27a93f){if(_0x27a93f[_0x149c('0x2e')]!==_0x149c('0x3e')){var _0x4d6f29={};_0x4d6f29[_0x27a93f[_0x149c('0x2a')]]={'$like':'%'+_0xeaa917[_0x149c('0x32')][_0x149c('0x3d')]+'%'};return _0x4d6f29;}})});}_0x2ed79a=_['merge']({},_0x2ed79a,_0xeaa917[_0x149c('0x3f')]);var _0x562eea={'where':_0x2ed79a['where']};return db[_0x149c('0x2b')][_0x149c('0x23')](_0x562eea)['then'](function(_0x556180){_0x146275[_0x149c('0x23')]=_0x556180;if(_0xeaa917['query']['includeAll']){_0x2ed79a['include']=[{'all':!![]}];}return db[_0x149c('0x2b')][_0x149c('0x40')](_0x2ed79a);})['then'](function(_0x5f30a6){_0x146275['rows']=_0x5f30a6;return _0x146275;})[_0x149c('0x29')](respondWithFilteredResult(_0x47b53b,_0x2ed79a))[_0x149c('0x41')](handleError(_0x47b53b,null));};exports[_0x149c('0x42')]=function(_0x95777e,_0x2a8c3c){var _0x4977e6={'raw':!![],'where':{'id':_0x95777e[_0x149c('0x43')]['id']}},_0x138ee3={};_0x138ee3['model']=_[_0x149c('0x33')](db[_0x149c('0x2b')][_0x149c('0x2c')]);_0x138ee3['query']=_[_0x149c('0x33')](_0x95777e[_0x149c('0x32')]);_0x138ee3[_0x149c('0x34')]=_['intersection'](_0x138ee3[_0x149c('0x30')],_0x138ee3[_0x149c('0x32')]);_0x4977e6[_0x149c('0x35')]=_['intersection'](_0x138ee3['model'],qs[_0x149c('0x37')](_0x95777e['query'][_0x149c('0x37')]));_0x4977e6['attributes']=_0x4977e6['attributes'][_0x149c('0x38')]?_0x4977e6['attributes']:_0x138ee3[_0x149c('0x30')];if(_0x95777e[_0x149c('0x32')][_0x149c('0x44')]){_0x4977e6[_0x149c('0x45')]=[{'all':!![]}];}_0x4977e6=_[_0x149c('0x46')]({},_0x4977e6,_0x95777e[_0x149c('0x3f')]);return db[_0x149c('0x2b')][_0x149c('0x47')](_0x4977e6)[_0x149c('0x29')](handleEntityNotFound(_0x2a8c3c,null))['then'](respondWithResult(_0x2a8c3c,null))[_0x149c('0x41')](handleError(_0x2a8c3c,null));};exports[_0x149c('0x48')]=function(_0x1cac92,_0x36e74c){return db[_0x149c('0x2b')][_0x149c('0x48')](_0x1cac92[_0x149c('0x49')],{})['then'](respondWithResult(_0x36e74c,0xc9))['catch'](handleError(_0x36e74c,null));};exports[_0x149c('0x28')]=function(_0x1768ef,_0x1f1d6e){if(_0x1768ef[_0x149c('0x49')]['id']){delete _0x1768ef[_0x149c('0x49')]['id'];}return db[_0x149c('0x2b')]['find']({'where':{'id':_0x1768ef[_0x149c('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f1d6e,null))[_0x149c('0x29')](saveUpdates(_0x1768ef[_0x149c('0x49')],null))[_0x149c('0x29')](respondWithResult(_0x1f1d6e,null))[_0x149c('0x41')](handleError(_0x1f1d6e,null));};exports[_0x149c('0x4a')]=function(_0x59650a,_0x21e901){return db[_0x149c('0x2b')][_0x149c('0x47')]({'where':{'id':_0x59650a[_0x149c('0x43')]['id']}})[_0x149c('0x29')](handleEntityNotFound(_0x21e901,null))[_0x149c('0x29')](removeEntity(_0x21e901,null))['catch'](handleError(_0x21e901,null));};exports[_0x149c('0x4b')]=function(_0x48ad9a,_0x1fde6e){return db[_0x149c('0x2b')][_0x149c('0x4b')]()[_0x149c('0x29')](respondWithResult(_0x1fde6e,null))[_0x149c('0x41')](handleError(_0x1fde6e,null));}; \ No newline at end of file +var _0x8e71=['type','VIRTUAL','options','VoiceDialReport','includeAll','include','rows','show','params','keys','length','find','catch','create','body','destroy','describe','eml-format','rimraf','request-promise','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','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','order','sort','filter','merge','where'];(function(_0x367f18,_0x340e65){var _0x913696=function(_0x56b167){while(--_0x56b167){_0x367f18['push'](_0x367f18['shift']());}};_0x913696(++_0x340e65);}(_0x8e71,0x141));var _0x18e7=function(_0x1b9a9f,_0x482c35){_0x1b9a9f=_0x1b9a9f-0x0;var _0x2552fd=_0x8e71[_0x1b9a9f];return _0x2552fd;};'use strict';var emlformat=require(_0x18e7('0x0'));var rimraf=require(_0x18e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x18e7('0x2'));var moment=require('moment');var BPromise=require(_0x18e7('0x3'));var Mustache=require(_0x18e7('0x4'));var util=require(_0x18e7('0x5'));var path=require(_0x18e7('0x6'));var sox=require(_0x18e7('0x7'));var csv=require(_0x18e7('0x8'));var ejs=require(_0x18e7('0x9'));var fs=require('fs');var fs_extra=require(_0x18e7('0xa'));var _=require(_0x18e7('0xb'));var squel=require(_0x18e7('0xc'));var crypto=require(_0x18e7('0xd'));var jsforce=require(_0x18e7('0xe'));var deskjs=require(_0x18e7('0xf'));var toCsv=require(_0x18e7('0x8'));var querystring=require(_0x18e7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x18e7('0x11'));var qs=require(_0x18e7('0x12'));var as=require(_0x18e7('0x13'));var hardwareService=require(_0x18e7('0x14'));var logger=require(_0x18e7('0x15'))(_0x18e7('0x16'));var utils=require(_0x18e7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x18e7('0x18'))['db'];function respondWithStatusCode(_0x46ee85,_0x25c7a6){_0x25c7a6=_0x25c7a6||0xcc;return function(_0x1b0ab2){if(_0x1b0ab2){return _0x46ee85[_0x18e7('0x19')](_0x25c7a6);}return _0x46ee85[_0x18e7('0x1a')](_0x25c7a6)[_0x18e7('0x1b')]();};}function respondWithResult(_0x2f6b7a,_0x32cdcd){_0x32cdcd=_0x32cdcd||0xc8;return function(_0x3e5ec8){if(_0x3e5ec8){return _0x2f6b7a[_0x18e7('0x1a')](_0x32cdcd)[_0x18e7('0x1c')](_0x3e5ec8);}};}function respondWithFilteredResult(_0x496a43,_0x5a012d){return function(_0x351d82){if(_0x351d82){var _0x4d9921=typeof _0x5a012d[_0x18e7('0x1d')]==='undefined'&&typeof _0x5a012d[_0x18e7('0x1e')]==='undefined';var _0x1d56ec=_0x351d82[_0x18e7('0x1f')];var _0xbc24b4=_0x4d9921?0x0:_0x5a012d[_0x18e7('0x1d')];var _0x1e2cfb=_0x4d9921?_0x351d82[_0x18e7('0x1f')]:_0x5a012d[_0x18e7('0x1d')]+_0x5a012d[_0x18e7('0x1e')];var _0x1efbd2;if(_0x1e2cfb>=_0x1d56ec){_0x1e2cfb=_0x1d56ec;_0x1efbd2=0xc8;}else{_0x1efbd2=0xce;}_0x496a43['status'](_0x1efbd2);return _0x496a43[_0x18e7('0x20')](_0x18e7('0x21'),_0xbc24b4+'-'+_0x1e2cfb+'/'+_0x1d56ec)[_0x18e7('0x1c')](_0x351d82);}return null;};}function patchUpdates(_0x5eaecf){return function(_0x4ce133){try{jsonpatch[_0x18e7('0x22')](_0x4ce133,_0x5eaecf,!![]);}catch(_0x4bc83e){return BPromise[_0x18e7('0x23')](_0x4bc83e);}return _0x4ce133[_0x18e7('0x24')]();};}function saveUpdates(_0x51c706,_0x1ed6b6){return function(_0x2576d0){if(_0x2576d0){return _0x2576d0[_0x18e7('0x25')](_0x51c706)[_0x18e7('0x26')](function(_0x2c93fd){return _0x2c93fd;});}return null;};}function removeEntity(_0x5dac4d,_0x145d13){return function(_0x1e1aea){if(_0x1e1aea){return _0x1e1aea['destroy']()[_0x18e7('0x26')](function(){_0x5dac4d[_0x18e7('0x1a')](0xcc)[_0x18e7('0x1b')]();});}};}function handleEntityNotFound(_0x325a89,_0x3fca02){return function(_0x297b3a){if(!_0x297b3a){_0x325a89['sendStatus'](0x194);}return _0x297b3a;};}function handleError(_0x1ba8b1,_0xec108d){_0xec108d=_0xec108d||0x1f4;return function(_0x5f5ad8){logger[_0x18e7('0x27')](_0x5f5ad8[_0x18e7('0x28')]);if(_0x5f5ad8['name']){delete _0x5f5ad8['name'];}_0x1ba8b1[_0x18e7('0x1a')](_0xec108d)[_0x18e7('0x29')](_0x5f5ad8);};}exports[_0x18e7('0x2a')]=function(_0x359ffc,_0xe7b86){var _0x241dcb={},_0x5f199d={},_0x2e2570={'count':0x0,'rows':[]};var _0x294917=_[_0x18e7('0x2b')](db['VoiceDialReport'][_0x18e7('0x2c')],function(_0x5d211c){return{'name':_0x5d211c[_0x18e7('0x2d')],'type':_0x5d211c['type'][_0x18e7('0x2e')]};});_0x5f199d[_0x18e7('0x2f')]=_[_0x18e7('0x2b')](_0x294917,_0x18e7('0x30'));_0x5f199d[_0x18e7('0x31')]=_['keys'](_0x359ffc[_0x18e7('0x31')]);_0x5f199d[_0x18e7('0x32')]=_[_0x18e7('0x33')](_0x5f199d[_0x18e7('0x2f')],_0x5f199d[_0x18e7('0x31')]);_0x241dcb[_0x18e7('0x34')]=_['intersection'](_0x5f199d['model'],qs['fields'](_0x359ffc[_0x18e7('0x31')][_0x18e7('0x35')]));_0x241dcb[_0x18e7('0x34')]=_0x241dcb['attributes']['length']?_0x241dcb[_0x18e7('0x34')]:_0x5f199d[_0x18e7('0x2f')];if(!_0x359ffc[_0x18e7('0x31')]['hasOwnProperty']('nolimit')){_0x241dcb[_0x18e7('0x1e')]=qs[_0x18e7('0x1e')](_0x359ffc[_0x18e7('0x31')][_0x18e7('0x1e')]);_0x241dcb[_0x18e7('0x1d')]=qs['offset'](_0x359ffc['query']['offset']);}_0x241dcb[_0x18e7('0x36')]=qs[_0x18e7('0x37')](_0x359ffc[_0x18e7('0x31')]['sort']);_0x241dcb['where']=qs[_0x18e7('0x32')](_['pick'](_0x359ffc[_0x18e7('0x31')],_0x5f199d[_0x18e7('0x32')]),_0x294917);if(_0x359ffc[_0x18e7('0x31')][_0x18e7('0x38')]){_0x241dcb['where']=_[_0x18e7('0x39')](_0x241dcb[_0x18e7('0x3a')],{'$or':_[_0x18e7('0x2b')](_0x294917,function(_0x4bf2ab){if(_0x4bf2ab[_0x18e7('0x3b')]!==_0x18e7('0x3c')){var _0x159312={};_0x159312[_0x4bf2ab[_0x18e7('0x30')]]={'$like':'%'+_0x359ffc[_0x18e7('0x31')]['filter']+'%'};return _0x159312;}})});}_0x241dcb=_['merge']({},_0x241dcb,_0x359ffc[_0x18e7('0x3d')]);var _0x6ba052={'where':_0x241dcb['where']};return db[_0x18e7('0x3e')][_0x18e7('0x1f')](_0x6ba052)[_0x18e7('0x26')](function(_0x524884){_0x2e2570['count']=_0x524884;if(_0x359ffc[_0x18e7('0x31')][_0x18e7('0x3f')]){_0x241dcb[_0x18e7('0x40')]=[{'all':!![]}];}return db[_0x18e7('0x3e')]['findAll'](_0x241dcb);})[_0x18e7('0x26')](function(_0x543af8){_0x2e2570[_0x18e7('0x41')]=_0x543af8;return _0x2e2570;})[_0x18e7('0x26')](respondWithFilteredResult(_0xe7b86,_0x241dcb))['catch'](handleError(_0xe7b86,null));};exports[_0x18e7('0x42')]=function(_0x4f2817,_0x464a1c){var _0x19f246={'raw':!![],'where':{'id':_0x4f2817[_0x18e7('0x43')]['id']}},_0x5da144={};_0x5da144['model']=_[_0x18e7('0x44')](db[_0x18e7('0x3e')][_0x18e7('0x2c')]);_0x5da144[_0x18e7('0x31')]=_['keys'](_0x4f2817[_0x18e7('0x31')]);_0x5da144[_0x18e7('0x32')]=_[_0x18e7('0x33')](_0x5da144[_0x18e7('0x2f')],_0x5da144[_0x18e7('0x31')]);_0x19f246['attributes']=_['intersection'](_0x5da144[_0x18e7('0x2f')],qs['fields'](_0x4f2817[_0x18e7('0x31')][_0x18e7('0x35')]));_0x19f246['attributes']=_0x19f246['attributes'][_0x18e7('0x45')]?_0x19f246[_0x18e7('0x34')]:_0x5da144[_0x18e7('0x2f')];if(_0x4f2817[_0x18e7('0x31')][_0x18e7('0x3f')]){_0x19f246[_0x18e7('0x40')]=[{'all':!![]}];}_0x19f246=_['merge']({},_0x19f246,_0x4f2817[_0x18e7('0x3d')]);return db[_0x18e7('0x3e')][_0x18e7('0x46')](_0x19f246)[_0x18e7('0x26')](handleEntityNotFound(_0x464a1c,null))[_0x18e7('0x26')](respondWithResult(_0x464a1c,null))[_0x18e7('0x47')](handleError(_0x464a1c,null));};exports['create']=function(_0x1c6060,_0x223318){return db[_0x18e7('0x3e')][_0x18e7('0x48')](_0x1c6060['body'],{})[_0x18e7('0x26')](respondWithResult(_0x223318,0xc9))[_0x18e7('0x47')](handleError(_0x223318,null));};exports[_0x18e7('0x25')]=function(_0xeadd75,_0x10c1a7){if(_0xeadd75['body']['id']){delete _0xeadd75[_0x18e7('0x49')]['id'];}return db[_0x18e7('0x3e')][_0x18e7('0x46')]({'where':{'id':_0xeadd75[_0x18e7('0x43')]['id']}})['then'](handleEntityNotFound(_0x10c1a7,null))[_0x18e7('0x26')](saveUpdates(_0xeadd75[_0x18e7('0x49')],null))[_0x18e7('0x26')](respondWithResult(_0x10c1a7,null))[_0x18e7('0x47')](handleError(_0x10c1a7,null));};exports[_0x18e7('0x4a')]=function(_0x456928,_0x3d5e6f){return db[_0x18e7('0x3e')][_0x18e7('0x46')]({'where':{'id':_0x456928[_0x18e7('0x43')]['id']}})[_0x18e7('0x26')](handleEntityNotFound(_0x3d5e6f,null))['then'](removeEntity(_0x3d5e6f,null))['catch'](handleError(_0x3d5e6f,null));};exports[_0x18e7('0x4b')]=function(_0x213e28,_0x1ab5ac){return db[_0x18e7('0x3e')][_0x18e7('0x4b')]()[_0x18e7('0x26')](respondWithResult(_0x1ab5ac,null))[_0x18e7('0x47')](handleError(_0x1ab5ac,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f3dd43a..d605397 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 _0xcc4e=['moment','request-promise','path','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api'];(function(_0x4b5b25,_0x30816d){var _0x44b6ca=function(_0x507e31){while(--_0x507e31){_0x4b5b25['push'](_0x4b5b25['shift']());}};_0x44b6ca(++_0x30816d);}(_0xcc4e,0x174));var _0xecc4=function(_0x35d30d,_0x3979c8){_0x35d30d=_0x35d30d-0x0;var _0x322326=_0xcc4e[_0x35d30d];return _0x322326;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xecc4('0x0'))(_0xecc4('0x1'));var moment=require(_0xecc4('0x2'));var BPromise=require('bluebird');var rp=require(_0xecc4('0x3'));var fs=require('fs');var path=require(_0xecc4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xecc4('0x5'));module[_0xecc4('0x6')]=function(_0x5c29c7,_0x3eeb7d){return _0x5c29c7[_0xecc4('0x7')](_0xecc4('0x8'),attributes,{'tableName':_0xecc4('0x9'),'paranoid':![],'indexes':[{'fields':[_0xecc4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4e=['report_dial','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport'];(function(_0x3a6db9,_0x214cc0){var _0x30ce3d=function(_0x37a8df){while(--_0x37a8df){_0x3a6db9['push'](_0x3a6db9['shift']());}};_0x30ce3d(++_0x214cc0);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4a38e5,_0x2b1a5d){_0x4a38e5=_0x4a38e5-0x0;var _0x4bb82e=_0x4c4e[_0x4a38e5];return _0x4bb82e;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe4c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index cba6c1e..d0fc6d7 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 _0x40a9=['../../config/logger','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','UpdateVoiceDialReport','body','where','lodash','util','../../mysqldb','../../config/utils'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x40a9,0xb2));var _0x940a=function(_0x317fd3,_0x1536e7){_0x317fd3=_0x317fd3-0x0;var _0x281ac8=_0x40a9[_0x317fd3];return _0x281ac8;};'use strict';var _=require(_0x940a('0x0'));var util=require(_0x940a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x940a('0x2'))['db'];var utils=require(_0x940a('0x3'));var logger=require(_0x940a('0x4'))('rpc');var config=require(_0x940a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x940a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fa8a8,_0x508ec7,_0x5c9e91){return new BPromise(function(_0x4bf34b,_0x2fd526){return client[_0x940a('0x7')](_0x3fa8a8,_0x5c9e91)[_0x940a('0x8')](function(_0x3e9239){logger[_0x940a('0x9')](_0x940a('0xa'),_0x508ec7,_0x940a('0xb'));logger[_0x940a('0xc')](_0x940a('0xd'),_0x508ec7,_0x940a('0xb'),JSON[_0x940a('0xe')](_0x3e9239));if(_0x3e9239[_0x940a('0xf')]){if(_0x3e9239[_0x940a('0xf')]['code']===0x1f4){logger[_0x940a('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x508ec7,_0x3e9239['error'][_0x940a('0x10')]);return _0x2fd526(_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);}logger[_0x940a('0xf')](_0x940a('0xa'),_0x508ec7,_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);return _0x4bf34b(_0x3e9239[_0x940a('0xf')][_0x940a('0x10')]);}else{logger[_0x940a('0x9')](_0x940a('0xa'),_0x508ec7,_0x940a('0xb'));_0x4bf34b(_0x3e9239[_0x940a('0x11')][_0x940a('0x10')]);}})[_0x940a('0x12')](function(_0x509d73){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x508ec7,_0x509d73);_0x2fd526(_0x509d73);});});}exports[_0x940a('0x13')]=function(_0x2c1690){var _0x4d7ca3=this;return new Promise(function(_0x2aec1a,_0x26153d){return db[_0x940a('0x14')]['create'](_0x2c1690['body'],{'raw':_0x2c1690[_0x940a('0x15')]?_0x2c1690[_0x940a('0x15')][_0x940a('0x16')]===undefined?!![]:![]:!![]})[_0x940a('0x8')](function(_0x1fa6c9){logger[_0x940a('0x9')]('CreateVoiceDialReport',_0x2c1690);logger[_0x940a('0xc')](_0x940a('0x13'),_0x2c1690,JSON[_0x940a('0xe')](_0x1fa6c9));_0x2aec1a(_0x1fa6c9);})[_0x940a('0x12')](function(_0x49b3fd){logger[_0x940a('0xf')](_0x940a('0x13'),_0x49b3fd[_0x940a('0x10')],_0x2c1690);_0x26153d(_0x4d7ca3[_0x940a('0xf')](0x1f4,_0x49b3fd[_0x940a('0x10')]));});});};exports[_0x940a('0x17')]=function(_0x5dbe1a){var _0x509ac1=this;return new Promise(function(_0x52c78d,_0xb83d57){return db['VoiceDialReport']['update'](_0x5dbe1a[_0x940a('0x18')],{'raw':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')][_0x940a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')][_0x940a('0x19')]||null:null,'attributes':_0x5dbe1a['options']?_0x5dbe1a[_0x940a('0x15')]['attributes']||null:null,'limit':_0x5dbe1a[_0x940a('0x15')]?_0x5dbe1a[_0x940a('0x15')]['limit']||null:null})[_0x940a('0x8')](function(_0x3c7efa){logger[_0x940a('0x9')](_0x940a('0x17'),_0x5dbe1a);logger[_0x940a('0xc')](_0x940a('0x17'),_0x5dbe1a,JSON[_0x940a('0xe')](_0x3c7efa));_0x52c78d(_0x3c7efa);})['catch'](function(_0xf3d08d){logger['error'](_0x940a('0x17'),_0xf3d08d[_0x940a('0x10')],_0x5dbe1a);_0xb83d57(_0x509ac1['error'](0x1f4,_0xf3d08d[_0x940a('0x10')]));});});}; \ No newline at end of file +var _0xcae7=['stringify','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport'];(function(_0x5c8fbe,_0x1d091f){var _0x17536b=function(_0x11f1b2){while(--_0x11f1b2){_0x5c8fbe['push'](_0x5c8fbe['shift']());}};_0x17536b(++_0x1d091f);}(_0xcae7,0x1e2));var _0x7cae=function(_0x553956,_0x57a991){_0x553956=_0x553956-0x0;var _0x2e4172=_0xcae7[_0x553956];return _0x2e4172;};'use strict';var _=require('lodash');var util=require(_0x7cae('0x0'));var moment=require(_0x7cae('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cae('0x2'));var fs=require('fs');var Redis=require(_0x7cae('0x3'));var db=require(_0x7cae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7cae('0x5'))(_0x7cae('0x6'));var config=require(_0x7cae('0x7'));var jayson=require(_0x7cae('0x8'));var client=jayson[_0x7cae('0x9')][_0x7cae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f2c7c,_0x1198b5,_0x5ae93f){return new BPromise(function(_0x31838f,_0x40339d){return client[_0x7cae('0xb')](_0x2f2c7c,_0x5ae93f)[_0x7cae('0xc')](function(_0x3f89b9){logger[_0x7cae('0xd')](_0x7cae('0xe'),_0x1198b5,_0x7cae('0xf'));logger[_0x7cae('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1198b5,_0x7cae('0xf'),JSON['stringify'](_0x3f89b9));if(_0x3f89b9[_0x7cae('0x11')]){if(_0x3f89b9[_0x7cae('0x11')][_0x7cae('0x12')]===0x1f4){logger[_0x7cae('0x11')](_0x7cae('0xe'),_0x1198b5,_0x3f89b9[_0x7cae('0x11')][_0x7cae('0x13')]);return _0x40339d(_0x3f89b9['error'][_0x7cae('0x13')]);}logger[_0x7cae('0x11')](_0x7cae('0xe'),_0x1198b5,_0x3f89b9[_0x7cae('0x11')]['message']);return _0x31838f(_0x3f89b9[_0x7cae('0x11')][_0x7cae('0x13')]);}else{logger[_0x7cae('0xd')](_0x7cae('0xe'),_0x1198b5,_0x7cae('0xf'));_0x31838f(_0x3f89b9[_0x7cae('0x14')][_0x7cae('0x13')]);}})[_0x7cae('0x15')](function(_0x1214fe){logger[_0x7cae('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1198b5,_0x1214fe);_0x40339d(_0x1214fe);});});}exports['CreateVoiceDialReport']=function(_0x477e9e){var _0x44c893=this;return new Promise(function(_0x1e0e9b,_0x400f98){return db[_0x7cae('0x16')][_0x7cae('0x17')](_0x477e9e[_0x7cae('0x18')],{'raw':_0x477e9e[_0x7cae('0x19')]?_0x477e9e[_0x7cae('0x19')][_0x7cae('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3388ac){logger['info'](_0x7cae('0x1b'),_0x477e9e);logger['debug']('CreateVoiceDialReport',_0x477e9e,JSON[_0x7cae('0x1c')](_0x3388ac));_0x1e0e9b(_0x3388ac);})['catch'](function(_0x3f9c15){logger[_0x7cae('0x11')]('CreateVoiceDialReport',_0x3f9c15[_0x7cae('0x13')],_0x477e9e);_0x400f98(_0x44c893['error'](0x1f4,_0x3f9c15[_0x7cae('0x13')]));});});};exports[_0x7cae('0x1d')]=function(_0x1b9f33){var _0x56dbb4=this;return new Promise(function(_0xd61569,_0xfea7e8){return db[_0x7cae('0x16')][_0x7cae('0x1e')](_0x1b9f33[_0x7cae('0x18')],{'raw':_0x1b9f33[_0x7cae('0x19')]?_0x1b9f33['options'][_0x7cae('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b9f33[_0x7cae('0x19')]?_0x1b9f33[_0x7cae('0x19')][_0x7cae('0x1f')]||null:null,'attributes':_0x1b9f33[_0x7cae('0x19')]?_0x1b9f33[_0x7cae('0x19')][_0x7cae('0x20')]||null:null,'limit':_0x1b9f33['options']?_0x1b9f33[_0x7cae('0x19')][_0x7cae('0x21')]||null:null})['then'](function(_0x5160a7){logger['info']('UpdateVoiceDialReport',_0x1b9f33);logger[_0x7cae('0x10')](_0x7cae('0x1d'),_0x1b9f33,JSON['stringify'](_0x5160a7));_0xd61569(_0x5160a7);})[_0x7cae('0x15')](function(_0x4f48f3){logger['error'](_0x7cae('0x1d'),_0x4f48f3[_0x7cae('0x13')],_0x1b9f33);_0xfea7e8(_0x56dbb4['error'](0x1f4,_0x4f48f3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 1eb3ea1..efa9ba6 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 _0x011d=['post','/:id/applications','addApplications','/:id','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x44d752,_0x41bcdc){var _0x3c616e=function(_0x372911){while(--_0x372911){_0x44d752['push'](_0x44d752['shift']());}};_0x3c616e(++_0x41bcdc);}(_0x011d,0x1e0));var _0xd011=function(_0x157c61,_0x30bd32){_0x157c61=_0x157c61-0x0;var _0x2da230=_0x011d[_0x157c61];return _0x2da230;};'use strict';var multer=require(_0xd011('0x0'));var util=require('util');var path=require(_0xd011('0x1'));var timeout=require(_0xd011('0x2'));var express=require(_0xd011('0x3'));var router=express[_0xd011('0x4')]();var fs_extra=require(_0xd011('0x5'));var auth=require(_0xd011('0x6'));var interaction=require(_0xd011('0x7'));var config=require(_0xd011('0x8'));var controller=require('./voiceExtension.controller');router[_0xd011('0x9')]('/',auth[_0xd011('0xa')](),controller[_0xd011('0xb')]);router['get']('/:id',auth[_0xd011('0xa')](),controller[_0xd011('0xc')]);router['post']('/',auth[_0xd011('0xa')](),controller[_0xd011('0xd')]);router[_0xd011('0xe')](_0xd011('0xf'),auth[_0xd011('0xa')](),controller[_0xd011('0x10')]);router['put'](_0xd011('0x11'),auth[_0xd011('0xa')](),controller['update']);router[_0xd011('0x12')]('/:id',auth[_0xd011('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x41ca=['isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5567a5,_0xbb7e26){var _0x3fecd3=function(_0x209153){while(--_0x209153){_0x5567a5['push'](_0x5567a5['shift']());}};_0x3fecd3(++_0xbb7e26);}(_0x41ca,0xf6));var _0xa41c=function(_0x3af8b3,_0xe9122f){_0x3af8b3=_0x3af8b3-0x0;var _0x5791cf=_0x41ca[_0x3af8b3];return _0x5791cf;};'use strict';var multer=require('multer');var util=require(_0xa41c('0x0'));var path=require(_0xa41c('0x1'));var timeout=require(_0xa41c('0x2'));var express=require(_0xa41c('0x3'));var router=express[_0xa41c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa41c('0x5'));var interaction=require(_0xa41c('0x6'));var config=require(_0xa41c('0x7'));var controller=require('./voiceExtension.controller');router[_0xa41c('0x8')]('/',auth[_0xa41c('0x9')](),controller[_0xa41c('0xa')]);router['get'](_0xa41c('0xb'),auth[_0xa41c('0x9')](),controller[_0xa41c('0xc')]);router[_0xa41c('0xd')]('/',auth[_0xa41c('0x9')](),controller['create']);router[_0xa41c('0xd')](_0xa41c('0xe'),auth[_0xa41c('0x9')](),controller[_0xa41c('0xf')]);router[_0xa41c('0x10')]('/:id',auth[_0xa41c('0x9')](),controller['update']);router['delete']('/:id',auth[_0xa41c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b32418d..c5c1a2e 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 _0xd6e3=['wav','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN'];(function(_0x54761b,_0x3e65be){var _0x4caf3d=function(_0x569b0d){while(--_0x569b0d){_0x54761b['push'](_0x54761b['shift']());}};_0x4caf3d(++_0x3e65be);}(_0xd6e3,0x1b2));var _0x3d6e=function(_0x53c1cf,_0x4ff3ac){_0x53c1cf=_0x53c1cf-0x0;var _0x4e1dd9=_0xd6e3[_0x53c1cf];return _0x4e1dd9;};'use strict';var Sequelize=require(_0x3d6e('0x0'));module[_0x3d6e('0x1')]={'context':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'unique':_0x3d6e('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'unique':_0x3d6e('0x3')},'priority':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x3d6e('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d6e('0x4')},'appdata':{'type':Sequelize[_0x3d6e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3d6e('0x5')]('inbound',_0x3d6e('0x6'),_0x3d6e('0x7'),_0x3d6e('0x8'),_0x3d6e('0x9'),_0x3d6e('0xa'),_0x3d6e('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x3d6e('0x2')]},'interval':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x3d6e('0xc')]},'isApp':{'type':Sequelize[_0x3d6e('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3d6e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x3d6e('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3d6e('0xc')]},'recordingFormat':{'type':Sequelize[_0x3d6e('0x2')],'defaultValue':_0x3d6e('0xe')},'answer':{'type':Sequelize[_0x3d6e('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x25c86c){return this[_0x3d6e('0xf')]('exten');}},'alias':{'type':Sequelize[_0x3d6e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x6df8=['wav','exten','sequelize','STRING','compositeIndex','ENUM','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x265770,_0x2c6906){var _0x2516db=function(_0x29c629){while(--_0x29c629){_0x265770['push'](_0x265770['shift']());}};_0x2516db(++_0x2c6906);}(_0x6df8,0x136));var _0x86df=function(_0x2109ff,_0x59366e){_0x2109ff=_0x2109ff-0x0;var _0x1b22e6=_0x6df8[_0x2109ff];return _0x1b22e6;};'use strict';var Sequelize=require(_0x86df('0x0'));module['exports']={'context':{'type':Sequelize[_0x86df('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x86df('0x2')},'priority':{'type':Sequelize[_0x86df('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x86df('0x2')},'tag':{'type':Sequelize[_0x86df('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x86df('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x86df('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x86df('0x3')]('inbound',_0x86df('0x4'),_0x86df('0x5'),_0x86df('0x6'),_0x86df('0x7'),'system',_0x86df('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x86df('0x1')]},'interval':{'type':Sequelize[_0x86df('0x1')],'allowNull':![],'defaultValue':_0x86df('0x9')},'IntervalId':{'type':Sequelize[_0x86df('0xa')]},'isApp':{'type':Sequelize[_0x86df('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x86df('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x86df('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x86df('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x86df('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x844ad8){return this['getDataValue'](_0x86df('0xd'));}},'alias':{'type':Sequelize[_0x86df('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e033604..2a0ff7d 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 _0x2468=['hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','update','context','description','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','destroy','then','error','stack','name','send','VoiceExtension','fieldName','model','query','keys','filters','attributes','fields'];(function(_0x4634f8,_0x1ac5ec){var _0x2374f1=function(_0x7dcc77){while(--_0x7dcc77){_0x4634f8['push'](_0x4634f8['shift']());}};_0x2374f1(++_0x1ac5ec);}(_0x2468,0x1a2));var _0x8246=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2468[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x8246('0x0'));var Redis=require(_0x8246('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8246('0x2'));var config=require(_0x8246('0x3'));var db=require('../../mysqldb')['db'];config[_0x8246('0x4')]=_[_0x8246('0x5')](config['redis'],{'host':_0x8246('0x6'),'port':0x18eb});var socket=require(_0x8246('0x7'))(new Redis(config[_0x8246('0x4')]));require(_0x8246('0x8'))[_0x8246('0x9')](socket);function respondWithStatusCode(_0x2fe889,_0x32b9a8){_0x32b9a8=_0x32b9a8||0xcc;return function(_0x3dbdfd){if(_0x3dbdfd){return _0x2fe889[_0x8246('0xa')](_0x32b9a8);}return _0x2fe889[_0x8246('0xb')](_0x32b9a8)['end']();};}function respondWithResult(_0x4783b0,_0x55830d){_0x55830d=_0x55830d||0xc8;return function(_0x495bab){if(_0x495bab){return _0x4783b0[_0x8246('0xb')](_0x55830d)['json'](_0x495bab);}};}function respondWithFilteredResult(_0x27f6fe,_0x2ea0d2){return function(_0x5cdc5a){if(_0x5cdc5a){var _0x1fda7d=typeof _0x2ea0d2[_0x8246('0xc')]===_0x8246('0xd')&&typeof _0x2ea0d2[_0x8246('0xe')]===_0x8246('0xd');var _0x33f320=_0x5cdc5a[_0x8246('0xf')];var _0x3bada0=_0x1fda7d?0x0:_0x2ea0d2[_0x8246('0xc')];var _0x48e677=_0x1fda7d?_0x5cdc5a[_0x8246('0xf')]:_0x2ea0d2['offset']+_0x2ea0d2[_0x8246('0xe')];var _0x1fb52d;if(_0x48e677>=_0x33f320){_0x48e677=_0x33f320;_0x1fb52d=0xc8;}else{_0x1fb52d=0xce;}_0x27f6fe['status'](_0x1fb52d);return _0x27f6fe[_0x8246('0x10')](_0x8246('0x11'),_0x3bada0+'-'+_0x48e677+'/'+_0x33f320)[_0x8246('0x12')](_0x5cdc5a);}return null;};}function removeEntity(_0x2a56ca){return function(_0x470f6d){if(_0x470f6d){return _0x470f6d['destroy']()['then'](function(){var _0x4326f7=_0x470f6d[_0x8246('0x13')]({'plain':!![]});var _0x8ca745=[{'name':_0x8246('0x14'),'value':_0x8246('0x15'),'ignore':![]},{'name':_0x8246('0x16'),'value':_0x8246('0x17'),'ignore':![]},{'name':_0x8246('0x18'),'value':_0x8246('0x19'),'ignore':![]}];var _0x2ce7d8=_(_0x8ca745)[_0x8246('0x1a')](_0x8246('0x1b'))[_0x8246('0x1c')](_0x8246('0x1d'))['value']();if(_[_0x8246('0x1e')](_0x2ce7d8,_0x4326f7[_0x8246('0x1f')])){return;}var _0x2cf7de=_[_0x8246('0x20')](_0x8ca745,[_0x8246('0x1d'),_0x4326f7[_0x8246('0x1f')]])['name'];return db['UserProfileResource'][_0x8246('0x21')]({'where':{'type':_0x2cf7de,'resourceId':_0x4326f7['id']}})[_0x8246('0x22')](function(){return _0x470f6d;});})[_0x8246('0x22')](function(){_0x2a56ca[_0x8246('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3376e6){return function(_0x31d058){if(!_0x31d058){_0x3376e6['sendStatus'](0x194);}return _0x31d058;};}function handleError(_0x18dcb6,_0x2fdfc5){_0x2fdfc5=_0x2fdfc5||0x1f4;return function(_0x4545ed){logger[_0x8246('0x23')](_0x4545ed[_0x8246('0x24')]);if(_0x4545ed[_0x8246('0x25')]){delete _0x4545ed[_0x8246('0x25')];}_0x18dcb6[_0x8246('0xb')](_0x2fdfc5)[_0x8246('0x26')](_0x4545ed);};}exports['index']=function(_0x529e1c,_0x277a7b){var _0x556b23={},_0x55ba06={},_0x5c505a={'count':0x0,'rows':[]};var _0x5510e2=_['map'](db[_0x8246('0x27')]['rawAttributes'],function(_0x19a628){return{'name':_0x19a628[_0x8246('0x28')],'type':_0x19a628[_0x8246('0x1f')]['key']};});_0x55ba06[_0x8246('0x29')]=_[_0x8246('0x1c')](_0x5510e2,_0x8246('0x25'));_0x55ba06[_0x8246('0x2a')]=_[_0x8246('0x2b')](_0x529e1c['query']);_0x55ba06[_0x8246('0x2c')]=_['intersection'](_0x55ba06[_0x8246('0x29')],_0x55ba06[_0x8246('0x2a')]);_0x556b23[_0x8246('0x2d')]=_['intersection'](_0x55ba06[_0x8246('0x29')],qs[_0x8246('0x2e')](_0x529e1c[_0x8246('0x2a')][_0x8246('0x2e')]));_0x556b23[_0x8246('0x2d')]=_0x556b23[_0x8246('0x2d')]['length']?_0x556b23[_0x8246('0x2d')]:_0x55ba06[_0x8246('0x29')];if(!_0x529e1c[_0x8246('0x2a')][_0x8246('0x2f')](_0x8246('0x30'))){_0x556b23[_0x8246('0xe')]=qs[_0x8246('0xe')](_0x529e1c[_0x8246('0x2a')][_0x8246('0xe')]);_0x556b23[_0x8246('0xc')]=qs[_0x8246('0xc')](_0x529e1c[_0x8246('0x2a')]['offset']);}_0x556b23[_0x8246('0x31')]=qs[_0x8246('0x32')](_0x529e1c[_0x8246('0x2a')][_0x8246('0x32')]);_0x556b23['where']=qs['filters'](_[_0x8246('0x33')](_0x529e1c[_0x8246('0x2a')],_0x55ba06[_0x8246('0x2c')]),_0x5510e2);if(_0x529e1c[_0x8246('0x2a')][_0x8246('0x1a')]){_0x556b23[_0x8246('0x34')]=_[_0x8246('0x35')](_0x556b23[_0x8246('0x34')],{'$or':_[_0x8246('0x1c')](_0x5510e2,function(_0xc686dc){if(_0xc686dc[_0x8246('0x1f')]!==_0x8246('0x36')){var _0x539743={};_0x539743[_0xc686dc['name']]={'$like':'%'+_0x529e1c[_0x8246('0x2a')][_0x8246('0x1a')]+'%'};return _0x539743;}})});}_0x556b23=_[_0x8246('0x35')]({},_0x556b23,_0x529e1c[_0x8246('0x37')]);var _0x2348d5={'where':_0x556b23[_0x8246('0x34')]};return db[_0x8246('0x27')]['count'](_0x2348d5)[_0x8246('0x22')](function(_0xecf3d){_0x5c505a[_0x8246('0xf')]=_0xecf3d;if(_0x529e1c[_0x8246('0x2a')][_0x8246('0x38')]){_0x556b23[_0x8246('0x39')]=[{'all':!![]}];}return db[_0x8246('0x27')][_0x8246('0x3a')](_0x556b23);})['then'](function(_0x4ae43c){_0x5c505a[_0x8246('0x3b')]=_0x4ae43c;return _0x5c505a;})[_0x8246('0x22')](respondWithFilteredResult(_0x277a7b,_0x556b23))[_0x8246('0x3c')](handleError(_0x277a7b,null));};exports[_0x8246('0x3d')]=function(_0x134c9d,_0x1f2043){var _0x398380={'raw':![],'where':{'id':_0x134c9d[_0x8246('0x3e')]['id']}},_0x2ffbd4={};_0x2ffbd4[_0x8246('0x29')]=_[_0x8246('0x2b')](db[_0x8246('0x27')]['rawAttributes']);_0x2ffbd4[_0x8246('0x2a')]=_[_0x8246('0x2b')](_0x134c9d[_0x8246('0x2a')]);_0x2ffbd4[_0x8246('0x2c')]=_[_0x8246('0x3f')](_0x2ffbd4[_0x8246('0x29')],_0x2ffbd4[_0x8246('0x2a')]);_0x398380[_0x8246('0x2d')]=_[_0x8246('0x3f')](_0x2ffbd4[_0x8246('0x29')],qs['fields'](_0x134c9d['query'][_0x8246('0x2e')]));_0x398380[_0x8246('0x2d')]=_0x398380[_0x8246('0x2d')][_0x8246('0x40')]?_0x398380['attributes']:_0x2ffbd4[_0x8246('0x29')];if(_0x134c9d['query'][_0x8246('0x38')]){_0x398380[_0x8246('0x39')]=[{'all':!![]}];}_0x398380=_[_0x8246('0x35')]({},_0x398380,_0x134c9d[_0x8246('0x37')]);return db[_0x8246('0x27')]['find'](_0x398380)['then'](handleEntityNotFound(_0x1f2043,null))[_0x8246('0x22')](respondWithResult(_0x1f2043,null))['catch'](handleError(_0x1f2043,null));};exports[_0x8246('0x21')]=function(_0x4dc489,_0x14125d){return db[_0x8246('0x27')][_0x8246('0x20')]({'where':{'id':_0x4dc489[_0x8246('0x3e')]['id']}})[_0x8246('0x22')](handleEntityNotFound(_0x14125d,null))['then'](removeEntity(_0x14125d,null))['catch'](handleError(_0x14125d,null));};exports['create']=function(_0x3d6274,_0x2341bc){if(_0x3d6274[_0x8246('0x41')][_0x8246('0x1f')]===_0x8246('0x17')&&!_[_0x8246('0x42')](_0x3d6274[_0x8246('0x41')]['exten'],'_')){_0x3d6274[_0x8246('0x41')][_0x8246('0x43')]='_'[_0x8246('0x44')](_0x3d6274['body']['exten']);}return db[_0x8246('0x27')][_0x8246('0x45')](_0x3d6274[_0x8246('0x41')],{'raw':![]})[_0x8246('0x22')](function(_0x36c738){var _0x5515c4=_0x3d6274[_0x8246('0x46')]['get']({'plain':!![]});if(!_0x5515c4)throw new Error(_0x8246('0x47'));if(_0x5515c4['role']==='user'){var _0x5bd913=_0x36c738[_0x8246('0x13')]({'plain':!![]});var _0x344f56=[{'name':_0x8246('0x14'),'value':_0x8246('0x15')},{'name':_0x8246('0x16'),'value':'outbound'},{'name':'InternalRoutes','value':_0x8246('0x19')}];var _0x49e64b=_[_0x8246('0x20')](_0x344f56,[_0x8246('0x1d'),_0x5bd913['type']])[_0x8246('0x25')];return db[_0x8246('0x48')][_0x8246('0x20')]({'where':{'name':_0x49e64b,'userProfileId':_0x5515c4[_0x8246('0x49')]},'raw':!![]})['then'](function(_0x40fe7b){if(_0x40fe7b&&_0x40fe7b['autoAssociation']===0x0){return db[_0x8246('0x4a')][_0x8246('0x45')]({'name':_0x5bd913[_0x8246('0x25')],'resourceId':_0x5bd913['id'],'type':_0x40fe7b[_0x8246('0x25')],'sectionId':_0x40fe7b['id']},{})[_0x8246('0x22')](function(){return _0x36c738;});}else{return _0x36c738;}})[_0x8246('0x3c')](function(_0x554880){logger[_0x8246('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x554880);throw _0x554880;});}return _0x36c738;})[_0x8246('0x22')](respondWithResult(_0x2341bc,0xc9))[_0x8246('0x3c')](handleError(_0x2341bc,null));};exports[_0x8246('0x4b')]=function(_0x2a2666,_0x1c54d6){if(_0x2a2666[_0x8246('0x41')]['id']){delete _0x2a2666['body']['id'];}return db[_0x8246('0x27')][_0x8246('0x20')]({'where':{'id':_0x2a2666[_0x8246('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1c54d6,null))[_0x8246('0x22')](function(_0x446710){if(_0x446710){return db[_0x8246('0x27')]['update'](_[_0x8246('0x33')](_0x2a2666[_0x8246('0x41')],[_0x8246('0x43'),_0x8246('0x4c'),_0x8246('0x4d'),_0x8246('0x4e'),_0x8246('0x4f'),'mandatoryDisposition',_0x8246('0x50')]),{'where':{'context':_0x446710['context'],'exten':_0x446710['exten']},'individualHooks':!![]})[_0x8246('0x22')](function(_0x52a0c4){return _0x52a0c4;});}return null;})[_0x8246('0x22')](respondWithStatusCode(_0x1c54d6,null))[_0x8246('0x3c')](handleError(_0x1c54d6,null));};exports[_0x8246('0x51')]=function(_0x278694,_0x528538){var _0x50fb90=_0x278694['params']['id'];var _0x259cdc=_0x278694[_0x8246('0x41')];var _0x4a78c4=0xc8;var _0x1bee2f=null;return db['sequelize'][_0x8246('0x52')]({'isolationLevel':db[_0x8246('0x53')][_0x8246('0x54')][_0x8246('0x55')][_0x8246('0x56')]},function(_0x15fc23){return db[_0x8246('0x27')][_0x8246('0x57')]({'where':{'id':_0x50fb90},'transaction':_0x15fc23})[_0x8246('0x22')](function(_0xdc7cb9){if(_0xdc7cb9){return db[_0x8246('0x27')][_0x8246('0x21')]({'where':{'VoiceExtensionId':_0x50fb90},'transaction':_0x15fc23})[_0x8246('0x22')](function(){var _0x593254=_[_0x8246('0x1c')](_0x259cdc,function(_0x56212f){_0x56212f[_0x8246('0x58')]=_0x50fb90;_0x56212f[_0x8246('0x59')]=!![];return _0x56212f;});return _0xdc7cb9[_0x8246('0x5a')](_0x593254);})[_0x8246('0x22')](function(_0x1413c2){return db['VoiceExtension'][_0x8246('0x5b')](_0x1413c2,{'transaction':_0x15fc23});});}else{_0x4a78c4=0x194;_0x1bee2f=[];}});})[_0x8246('0x22')](function(){if(_0x4a78c4!==0x194){return db[_0x8246('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x50fb90},'order':_0x8246('0x5c')})[_0x8246('0x22')](function(_0x2f4085){_0x1bee2f=_0x2f4085;});}})['catch'](function(_0x3685a4){_0x4a78c4=0x1f4;logger[_0x8246('0x23')](_0x3685a4[_0x8246('0x24')]);if(_0x3685a4[_0x8246('0x25')]){delete _0x3685a4['name'];}_0x1bee2f=_0x3685a4;})['finally'](function(){if(_0x1bee2f===null){_0x528538['sendStatus'](_0x4a78c4);}else{if(_0x4a78c4===0x1f4){_0x528538[_0x8246('0xb')](_0x4a78c4)[_0x8246('0x26')](_0x1bee2f);}else{_0x528538[_0x8246('0xb')](_0x4a78c4)[_0x8246('0x12')](_0x1bee2f);}}});}; \ No newline at end of file +var _0xefdc=['transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','send','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','get','inbound','outbound','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','then','stack','index','VoiceExtension','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','findAll','rows','catch','show','rawAttributes','includeAll','include','params','create','body','startsWith','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','OutboundRoutes','InternalRoutes','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','exten','context','mandatoryDisposition','alias','sequelize'];(function(_0x641275,_0x4130fa){var _0x3bc46b=function(_0x4fa7e9){while(--_0x4fa7e9){_0x641275['push'](_0x641275['shift']());}};_0x3bc46b(++_0x4130fa);}(_0xefdc,0x119));var _0xcefd=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0xefdc[_0x874cf1];return _0x233579;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xcefd('0x0'));var logger=require(_0xcefd('0x1'))('api');var config=require('../../config/environment');var db=require(_0xcefd('0x2'))['db'];config['redis']=_['defaults'](config[_0xcefd('0x3')],{'host':_0xcefd('0x4'),'port':0x18eb});var socket=require(_0xcefd('0x5'))(new Redis(config['redis']));require(_0xcefd('0x6'))[_0xcefd('0x7')](socket);function respondWithStatusCode(_0x188ba9,_0xe4dc70){_0xe4dc70=_0xe4dc70||0xcc;return function(_0x56abee){if(_0x56abee){return _0x188ba9[_0xcefd('0x8')](_0xe4dc70);}return _0x188ba9['status'](_0xe4dc70)[_0xcefd('0x9')]();};}function respondWithResult(_0x382808,_0x833aaa){_0x833aaa=_0x833aaa||0xc8;return function(_0x59a9d1){if(_0x59a9d1){return _0x382808[_0xcefd('0xa')](_0x833aaa)[_0xcefd('0xb')](_0x59a9d1);}};}function respondWithFilteredResult(_0x3a0c27,_0x1c4165){return function(_0x5080d8){if(_0x5080d8){var _0x2217b4=typeof _0x1c4165[_0xcefd('0xc')]===_0xcefd('0xd')&&typeof _0x1c4165[_0xcefd('0xe')]==='undefined';var _0x16056f=_0x5080d8[_0xcefd('0xf')];var _0x545cc5=_0x2217b4?0x0:_0x1c4165['offset'];var _0x41ef2c=_0x2217b4?_0x5080d8['count']:_0x1c4165[_0xcefd('0xc')]+_0x1c4165['limit'];var _0x5362e9;if(_0x41ef2c>=_0x16056f){_0x41ef2c=_0x16056f;_0x5362e9=0xc8;}else{_0x5362e9=0xce;}_0x3a0c27[_0xcefd('0xa')](_0x5362e9);return _0x3a0c27['set'](_0xcefd('0x10'),_0x545cc5+'-'+_0x41ef2c+'/'+_0x16056f)[_0xcefd('0xb')](_0x5080d8);}return null;};}function removeEntity(_0x7541d3){return function(_0x30f2a4){if(_0x30f2a4){return _0x30f2a4[_0xcefd('0x11')]()['then'](function(){var _0x1afa92=_0x30f2a4[_0xcefd('0x12')]({'plain':!![]});var _0x370b60=[{'name':'InboundRoutes','value':_0xcefd('0x13'),'ignore':![]},{'name':'OutboundRoutes','value':_0xcefd('0x14'),'ignore':![]},{'name':'InternalRoutes','value':_0xcefd('0x15'),'ignore':![]}];var _0x152104=_(_0x370b60)[_0xcefd('0x16')](_0xcefd('0x17'))[_0xcefd('0x18')](_0xcefd('0x19'))['value']();if(_[_0xcefd('0x1a')](_0x152104,_0x1afa92['type'])){return;}var _0x2c4698=_[_0xcefd('0x1b')](_0x370b60,[_0xcefd('0x19'),_0x1afa92[_0xcefd('0x1c')]])[_0xcefd('0x1d')];return db[_0xcefd('0x1e')][_0xcefd('0x11')]({'where':{'type':_0x2c4698,'resourceId':_0x1afa92['id']}})[_0xcefd('0x1f')](function(){return _0x30f2a4;});})['then'](function(){_0x7541d3[_0xcefd('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ae2f8){return function(_0x25255c){if(!_0x25255c){_0x4ae2f8[_0xcefd('0x8')](0x194);}return _0x25255c;};}function handleError(_0x549a42,_0x44cac2){_0x44cac2=_0x44cac2||0x1f4;return function(_0x447981){logger['error'](_0x447981[_0xcefd('0x20')]);if(_0x447981[_0xcefd('0x1d')]){delete _0x447981[_0xcefd('0x1d')];}_0x549a42[_0xcefd('0xa')](_0x44cac2)['send'](_0x447981);};}exports[_0xcefd('0x21')]=function(_0x5ee3ad,_0x418657){var _0x5ea5c1={},_0x4b25a1={},_0x36ee29={'count':0x0,'rows':[]};var _0x388592=_['map'](db[_0xcefd('0x22')]['rawAttributes'],function(_0x196674){return{'name':_0x196674[_0xcefd('0x23')],'type':_0x196674[_0xcefd('0x1c')][_0xcefd('0x24')]};});_0x4b25a1[_0xcefd('0x25')]=_[_0xcefd('0x18')](_0x388592,_0xcefd('0x1d'));_0x4b25a1['query']=_[_0xcefd('0x26')](_0x5ee3ad[_0xcefd('0x27')]);_0x4b25a1[_0xcefd('0x28')]=_[_0xcefd('0x29')](_0x4b25a1[_0xcefd('0x25')],_0x4b25a1[_0xcefd('0x27')]);_0x5ea5c1[_0xcefd('0x2a')]=_['intersection'](_0x4b25a1[_0xcefd('0x25')],qs['fields'](_0x5ee3ad[_0xcefd('0x27')][_0xcefd('0x2b')]));_0x5ea5c1['attributes']=_0x5ea5c1[_0xcefd('0x2a')][_0xcefd('0x2c')]?_0x5ea5c1[_0xcefd('0x2a')]:_0x4b25a1[_0xcefd('0x25')];if(!_0x5ee3ad['query'][_0xcefd('0x2d')]('nolimit')){_0x5ea5c1[_0xcefd('0xe')]=qs[_0xcefd('0xe')](_0x5ee3ad[_0xcefd('0x27')][_0xcefd('0xe')]);_0x5ea5c1[_0xcefd('0xc')]=qs['offset'](_0x5ee3ad['query'][_0xcefd('0xc')]);}_0x5ea5c1[_0xcefd('0x2e')]=qs[_0xcefd('0x2f')](_0x5ee3ad[_0xcefd('0x27')]['sort']);_0x5ea5c1[_0xcefd('0x30')]=qs[_0xcefd('0x28')](_['pick'](_0x5ee3ad['query'],_0x4b25a1[_0xcefd('0x28')]),_0x388592);if(_0x5ee3ad['query'][_0xcefd('0x16')]){_0x5ea5c1['where']=_['merge'](_0x5ea5c1['where'],{'$or':_[_0xcefd('0x18')](_0x388592,function(_0x2504ac){if(_0x2504ac['type']!==_0xcefd('0x31')){var _0x5735d7={};_0x5735d7[_0x2504ac[_0xcefd('0x1d')]]={'$like':'%'+_0x5ee3ad[_0xcefd('0x27')]['filter']+'%'};return _0x5735d7;}})});}_0x5ea5c1=_[_0xcefd('0x32')]({},_0x5ea5c1,_0x5ee3ad[_0xcefd('0x33')]);var _0x3dfbb8={'where':_0x5ea5c1[_0xcefd('0x30')]};return db[_0xcefd('0x22')][_0xcefd('0xf')](_0x3dfbb8)[_0xcefd('0x1f')](function(_0xc79e48){_0x36ee29['count']=_0xc79e48;if(_0x5ee3ad[_0xcefd('0x27')]['includeAll']){_0x5ea5c1['include']=[{'all':!![]}];}return db[_0xcefd('0x22')][_0xcefd('0x34')](_0x5ea5c1);})[_0xcefd('0x1f')](function(_0x54de78){_0x36ee29[_0xcefd('0x35')]=_0x54de78;return _0x36ee29;})[_0xcefd('0x1f')](respondWithFilteredResult(_0x418657,_0x5ea5c1))[_0xcefd('0x36')](handleError(_0x418657,null));};exports[_0xcefd('0x37')]=function(_0x820c9,_0x1c0c8f){var _0x2825f7={'raw':![],'where':{'id':_0x820c9['params']['id']}},_0x38df83={};_0x38df83[_0xcefd('0x25')]=_[_0xcefd('0x26')](db['VoiceExtension'][_0xcefd('0x38')]);_0x38df83[_0xcefd('0x27')]=_['keys'](_0x820c9[_0xcefd('0x27')]);_0x38df83['filters']=_[_0xcefd('0x29')](_0x38df83['model'],_0x38df83['query']);_0x2825f7[_0xcefd('0x2a')]=_['intersection'](_0x38df83['model'],qs[_0xcefd('0x2b')](_0x820c9[_0xcefd('0x27')][_0xcefd('0x2b')]));_0x2825f7[_0xcefd('0x2a')]=_0x2825f7['attributes']['length']?_0x2825f7['attributes']:_0x38df83[_0xcefd('0x25')];if(_0x820c9[_0xcefd('0x27')][_0xcefd('0x39')]){_0x2825f7[_0xcefd('0x3a')]=[{'all':!![]}];}_0x2825f7=_[_0xcefd('0x32')]({},_0x2825f7,_0x820c9[_0xcefd('0x33')]);return db[_0xcefd('0x22')][_0xcefd('0x1b')](_0x2825f7)[_0xcefd('0x1f')](handleEntityNotFound(_0x1c0c8f,null))[_0xcefd('0x1f')](respondWithResult(_0x1c0c8f,null))[_0xcefd('0x36')](handleError(_0x1c0c8f,null));};exports[_0xcefd('0x11')]=function(_0x416bae,_0x52de00){return db[_0xcefd('0x22')][_0xcefd('0x1b')]({'where':{'id':_0x416bae[_0xcefd('0x3b')]['id']}})[_0xcefd('0x1f')](handleEntityNotFound(_0x52de00,null))[_0xcefd('0x1f')](removeEntity(_0x52de00,null))['catch'](handleError(_0x52de00,null));};exports[_0xcefd('0x3c')]=function(_0x1e693b,_0x1aa462){if(_0x1e693b[_0xcefd('0x3d')]['type']===_0xcefd('0x14')&&!_[_0xcefd('0x3e')](_0x1e693b[_0xcefd('0x3d')]['exten'],'_')){_0x1e693b[_0xcefd('0x3d')]['exten']='_'[_0xcefd('0x3f')](_0x1e693b[_0xcefd('0x3d')]['exten']);}return db[_0xcefd('0x22')][_0xcefd('0x3c')](_0x1e693b[_0xcefd('0x3d')],{'raw':![]})[_0xcefd('0x1f')](function(_0x1bad06){var _0x5508f3=_0x1e693b[_0xcefd('0x40')][_0xcefd('0x12')]({'plain':!![]});if(!_0x5508f3)throw new Error(_0xcefd('0x41'));if(_0x5508f3['role']===_0xcefd('0x40')){var _0x192246=_0x1bad06[_0xcefd('0x12')]({'plain':!![]});var _0x19c4ec=[{'name':_0xcefd('0x42'),'value':_0xcefd('0x13')},{'name':_0xcefd('0x43'),'value':_0xcefd('0x14')},{'name':_0xcefd('0x44'),'value':_0xcefd('0x15')}];var _0x1ed36c=_[_0xcefd('0x1b')](_0x19c4ec,[_0xcefd('0x19'),_0x192246[_0xcefd('0x1c')]])[_0xcefd('0x1d')];return db['UserProfileSection'][_0xcefd('0x1b')]({'where':{'name':_0x1ed36c,'userProfileId':_0x5508f3['userProfileId']},'raw':!![]})[_0xcefd('0x1f')](function(_0x54949d){if(_0x54949d&&_0x54949d[_0xcefd('0x45')]===0x0){return db[_0xcefd('0x1e')][_0xcefd('0x3c')]({'name':_0x192246['name'],'resourceId':_0x192246['id'],'type':_0x54949d[_0xcefd('0x1d')],'sectionId':_0x54949d['id']},{})[_0xcefd('0x1f')](function(){return _0x1bad06;});}else{return _0x1bad06;}})[_0xcefd('0x36')](function(_0x3466a2){logger[_0xcefd('0x46')](_0xcefd('0x47'),_0x3466a2);throw _0x3466a2;});}return _0x1bad06;})[_0xcefd('0x1f')](respondWithResult(_0x1aa462,0xc9))[_0xcefd('0x36')](handleError(_0x1aa462,null));};exports[_0xcefd('0x48')]=function(_0x590706,_0x19a447){if(_0x590706[_0xcefd('0x3d')]['id']){delete _0x590706['body']['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x590706[_0xcefd('0x3b')]['id']}})[_0xcefd('0x1f')](handleEntityNotFound(_0x19a447,null))[_0xcefd('0x1f')](function(_0x16be01){if(_0x16be01){return db[_0xcefd('0x22')]['update'](_[_0xcefd('0x49')](_0x590706['body'],[_0xcefd('0x4a'),_0xcefd('0x4b'),'description','recordingFormat','cutdigits',_0xcefd('0x4c'),_0xcefd('0x4d')]),{'where':{'context':_0x16be01['context'],'exten':_0x16be01[_0xcefd('0x4a')]},'individualHooks':!![]})[_0xcefd('0x1f')](function(_0xc62ce2){return _0xc62ce2;});}return null;})[_0xcefd('0x1f')](respondWithStatusCode(_0x19a447,null))[_0xcefd('0x36')](handleError(_0x19a447,null));};exports['addApplications']=function(_0x474e20,_0x5df484){var _0xd23697=_0x474e20[_0xcefd('0x3b')]['id'];var _0x5e55f3=_0x474e20[_0xcefd('0x3d')];var _0x1d0fcd=0xc8;var _0x58a402=null;return db[_0xcefd('0x4e')][_0xcefd('0x4f')]({'isolationLevel':db[_0xcefd('0x4e')]['Transaction'][_0xcefd('0x50')][_0xcefd('0x51')]},function(_0x38cebf){return db[_0xcefd('0x22')][_0xcefd('0x52')]({'where':{'id':_0xd23697},'transaction':_0x38cebf})[_0xcefd('0x1f')](function(_0x4783d0){if(_0x4783d0){return db[_0xcefd('0x22')][_0xcefd('0x11')]({'where':{'VoiceExtensionId':_0xd23697},'transaction':_0x38cebf})[_0xcefd('0x1f')](function(){var _0x25db18=_[_0xcefd('0x18')](_0x5e55f3,function(_0x36acc5){_0x36acc5[_0xcefd('0x53')]=_0xd23697;_0x36acc5[_0xcefd('0x54')]=!![];return _0x36acc5;});return _0x4783d0[_0xcefd('0x55')](_0x25db18);})['then'](function(_0x421759){return db['VoiceExtension'][_0xcefd('0x56')](_0x421759,{'transaction':_0x38cebf});});}else{_0x1d0fcd=0x194;_0x58a402=[];}});})[_0xcefd('0x1f')](function(){if(_0x1d0fcd!==0x194){return db[_0xcefd('0x22')][_0xcefd('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0xd23697},'order':'cast(priority\x20as\x20unsigned)'})[_0xcefd('0x1f')](function(_0x59696a){_0x58a402=_0x59696a;});}})[_0xcefd('0x36')](function(_0x15cf3e){_0x1d0fcd=0x1f4;logger[_0xcefd('0x46')](_0x15cf3e[_0xcefd('0x20')]);if(_0x15cf3e['name']){delete _0x15cf3e[_0xcefd('0x1d')];}_0x58a402=_0x15cf3e;})[_0xcefd('0x58')](function(){if(_0x58a402===null){_0x5df484['sendStatus'](_0x1d0fcd);}else{if(_0x1d0fcd===0x1f4){_0x5df484[_0xcefd('0xa')](_0x1d0fcd)[_0xcefd('0x59')](_0x58a402);}else{_0x5df484[_0xcefd('0xa')](_0x1d0fcd)[_0xcefd('0xb')](_0x58a402);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d4e50f4..57e7895 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 _0x1efe=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1efe,0x108));var _0xe1ef=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x1efe[_0x4709c0];return _0x13348b;};'use strict';var EventEmitter=require(_0xe1ef('0x0'));var VoiceExtension=require(_0xe1ef('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe1ef('0x2')](0x0);var events={'afterCreate':_0xe1ef('0x3'),'afterUpdate':'update','afterDestroy':_0xe1ef('0x4')};function emitEvent(_0x4c00b0){return function(_0x107b27,_0x2acc93,_0x45f814){VoiceExtensionEvents[_0xe1ef('0x5')](_0x4c00b0+':'+_0x107b27['id'],_0x107b27);VoiceExtensionEvents[_0xe1ef('0x5')](_0x4c00b0,_0x107b27);_0x45f814(null);};}for(var e in events){if(events[_0xe1ef('0x6')](e)){var event=events[e];VoiceExtension[_0xe1ef('0x7')](e,emitEvent(event));}}module[_0xe1ef('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x1937=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4e9933,_0x171d3a){var _0x1db091=function(_0x400c38){while(--_0x400c38){_0x4e9933['push'](_0x4e9933['shift']());}};_0x1db091(++_0x171d3a);}(_0x1937,0x1e7));var _0x7193=function(_0x407560,_0x31a103){_0x407560=_0x407560-0x0;var _0x375e68=_0x1937[_0x407560];return _0x375e68;};'use strict';var EventEmitter=require(_0x7193('0x0'));var VoiceExtension=require(_0x7193('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7193('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7193('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21795a){return function(_0xa1cb0a,_0x4782a2,_0x4fbb69){VoiceExtensionEvents[_0x7193('0x4')](_0x21795a+':'+_0xa1cb0a['id'],_0xa1cb0a);VoiceExtensionEvents[_0x7193('0x4')](_0x21795a,_0xa1cb0a);_0x4fbb69(null);};}for(var e in events){if(events[_0x7193('0x5')](e)){var event=events[e];VoiceExtension[_0x7193('0x6')](e,emitEvent(event));}}module[_0x7193('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2e2d273..dbbcfe8 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 _0xf0db=['CDR(routeid)=','exten','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','prefix','phone','param','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','callerID','queue','playback','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push'];(function(_0x2f055a,_0x7b49f6){var _0x148b5a=function(_0xb94b51){while(--_0xb94b51){_0x2f055a['push'](_0x2f055a['shift']());}};_0x148b5a(++_0x7b49f6);}(_0xf0db,0x12b));var _0xbf0d=function(_0xa75d70,_0x3b7fc3){_0xa75d70=_0xa75d70-0x0;var _0xd5d47f=_0xf0db[_0xa75d70];return _0xd5d47f;};'use strict';var _=require(_0xbf0d('0x0'));var attributes=require(_0xbf0d('0x1'));module['exports']=function(_0x138814){var _0x1a6fea=_0x138814[_0xbf0d('0x2')];function _0x5db968(_0x47436c){var _0x2ccd6c=0x2;var _0x56f648=[{'type':_0x47436c['type'],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x4')+_0x47436c[_0xbf0d('0x5')],'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c['exten'],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0x47436c[_0xbf0d('0x7')]?_0xbf0d('0x3'):_0xbf0d('0x8'),'appdata':_0x47436c[_0xbf0d('0x7')]?_0xbf0d('0x9')+_0x47436c[_0xbf0d('0x7')]:_0xbf0d('0xa'),'context':_0x47436c['context'],'exten':_0x47436c['exten'],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']}];if(_0x47436c[_0xbf0d('0x5')]===_0xbf0d('0xb')){_0x56f648[_0xbf0d('0xc')]({'type':_0xbf0d('0xb'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xd')+_0x47436c['id'],'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']});}_0x56f648['push']({'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xf'),'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']},{'type':_0x47436c[_0xbf0d('0x5')],'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x10'),'context':_0x47436c[_0xbf0d('0x6')],'exten':_0x47436c[_0xbf0d('0xe')],'priority':_0x2ccd6c++,'VoiceExtensionId':_0x47436c['id']});return _0x56f648;}function _0x474ac2(_0x1d1eb4){var _0x523802=0x2;var _0x11a5f1=[{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x12'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0x1d1eb4['alias']?_0xbf0d('0x3'):'NoOp','appdata':_0x1d1eb4[_0xbf0d('0x7')]?_0xbf0d('0x9')+_0x1d1eb4[_0xbf0d('0x7')]:_0xbf0d('0xa'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':'CDR(destination)='+(_0x1d1eb4['cutdigits']?_0xbf0d('0x13')+_0x1d1eb4['cutdigits']+'}':_0xbf0d('0x14')),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xd')+_0x1d1eb4['id'],'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x15'),'appdata':_0xbf0d('0x16')+(_0x523802+0x2)+_0xbf0d('0x17')+(_0x523802+0x1)+')','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0x1d1eb4[_0xbf0d('0x18')]?_0xbf0d('0x19')+_0x1d1eb4[_0xbf0d('0x18')]+'}':'CDR(prefix)=noprefix','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1a'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0xf'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':'outbound','app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1b')+_0x1d1eb4['id'],'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']}];if(_0x1d1eb4[_0xbf0d('0x1c')](_0xbf0d('0x1d'))&&_0x1d1eb4[_0xbf0d('0x1d')]!==_0xbf0d('0x1e')){_0x11a5f1[_0xbf0d('0xc')]({'type':_0xbf0d('0x11'),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x1f'),'context':_0x1d1eb4['context'],'exten':_0x1d1eb4['exten'],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']},{'type':_0xbf0d('0x11'),'app':'Set','appdata':_0xbf0d('0x20')+_0x1d1eb4[_0xbf0d('0x1d')]||_0xbf0d('0x21'),'context':_0x1d1eb4[_0xbf0d('0x6')],'exten':_0x1d1eb4[_0xbf0d('0xe')],'priority':_0x523802++,'VoiceExtensionId':_0x1d1eb4['id']});}return _0x11a5f1;}function _0x330b37(_0x549692,_0x24586e){var _0x2e5dcf=[{'name':_0xbf0d('0x22'),'param':0x0},{'name':_0xbf0d('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0xbf0d('0x24'),'param':0x3}];var _0x4b0ee9={};var _0x3faf27=_0x24586e[_0xbf0d('0x25')](',');var _0x1ed208=[];for(var _0x20cd8c=0x0;_0x20cd8c<_0x2e5dcf[_0xbf0d('0x26')];_0x20cd8c++){switch(_0x2e5dcf[_0x20cd8c]['name']){case _0xbf0d('0x22'):_0x4b0ee9[_0xbf0d('0x22')]=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']][_0xbf0d('0x25')]('/')[0x1];_0x4b0ee9['phone']=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']][_0xbf0d('0x25')]('/')[0x2];_0x4b0ee9[_0xbf0d('0x27')]=_0x4b0ee9['phone']?_0x4b0ee9[_0xbf0d('0x28')]['split']('$')[0x0]:undefined;_0x4b0ee9[_0xbf0d('0x28')]=_0x549692['cutdigits']?(_0x4b0ee9[_0xbf0d('0x27')]||'')+_0xbf0d('0x13')+_0x549692[_0xbf0d('0x18')]+'}':(_0x4b0ee9[_0xbf0d('0x27')]||'')+'${EXTEN}';_0x1ed208[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]]=[_0xbf0d('0x2a'),_0x4b0ee9['trunk'],_0x4b0ee9[_0xbf0d('0x28')]][_0xbf0d('0x2b')]('/');break;case _0xbf0d('0x2c'):_0x4b0ee9[_0xbf0d('0x2c')]=_0x3faf27[_0x2e5dcf[_0x20cd8c]['param']];if(_0x549692[_0xbf0d('0x1d')]!==_0xbf0d('0x1e')){if(_0x4b0ee9[_0xbf0d('0x2c')][_0xbf0d('0x2d')](_0xbf0d('0x2e'))<0x0){_0x4b0ee9[_0xbf0d('0x2c')]+=_0xbf0d('0x2e');}}else{_0x4b0ee9[_0xbf0d('0x2c')]=_0x4b0ee9['options'][_0xbf0d('0x2f')](_0xbf0d('0x2e'),'');}_0x1ed208[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]]=_0x4b0ee9[_0xbf0d('0x2c')];break;default:_0x1ed208[_0x2e5dcf[_0x20cd8c]['param']]=_0x3faf27[_0x2e5dcf[_0x20cd8c][_0xbf0d('0x29')]];}}return _0x1ed208['join'](',');}function _0x271bcf(_0x1aade1,_0x30d96e,_0x2d5193){return new Promise(function(_0x13a39e,_0x55a8d7){var _0x10261a=[];if(_['isEmpty'](_0x30d96e))return _0x13a39e(_0x10261a);_0x1a6fea[_0xbf0d('0x30')][_0xbf0d('0x31')]({'attributes':['id',_0xbf0d('0x32'),_0xbf0d('0x33')],'raw':!![]})[_0xbf0d('0x34')](function(_0x4997b7){for(var _0x31b8d0=0x0,_0x19c446=0x0;_0x31b8d0<_0x30d96e['length'];_0x31b8d0++,_0x19c446=0x0){var _0x3aefd8=_0x30d96e[_0x31b8d0];var _0x530b2d=[];var _0x2bcbc9=[];delete _0x3aefd8['id'];if(_0x3aefd8['interval']!==_0xbf0d('0x35')){_0x3aefd8[_0xbf0d('0x36')]=[_0x3aefd8['interval']];}else{_0x3aefd8[_0xbf0d('0x36')]=_0x3aefd8[_0xbf0d('0x33')]?_[_0xbf0d('0x37')](_[_0xbf0d('0x38')](_0x4997b7,{'IntervalId':_0x3aefd8[_0xbf0d('0x33')]}),'interval'):[];}_0x3aefd8[_0xbf0d('0x6')]=_0x1aade1['context'];_0x3aefd8['exten']=_0x1aade1['exten'];if(_0x3aefd8[_0xbf0d('0x5')])_0x3aefd8['type']=_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')]();if(_0x1aade1[_0xbf0d('0x5')]===_0xbf0d('0x11')){if(_0x3aefd8[_0xbf0d('0x1c')](_0xbf0d('0x3a'))&&_0x3aefd8[_0xbf0d('0x3a')]&&_0x3aefd8[_0xbf0d('0x3a')]!=='--'){_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x3b')+_0x3aefd8[_0xbf0d('0x3a')],'context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8['type'][_0xbf0d('0x39')](),'app':_0xbf0d('0x15'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3aefd8[_0xbf0d('0x3c')]?'Set(CALLERID(all)='+_0x3aefd8[_0xbf0d('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')]['length']+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}else{if(_0x3aefd8[_0xbf0d('0x1c')]('answer')){if([_0xbf0d('0x3d'),_0xbf0d('0x3e')]['includes'](_0x3aefd8[_0xbf0d('0x3f')][_0xbf0d('0x39')]())&&_0x3aefd8[_0xbf0d('0x40')]!=='custom'){if(_0x3aefd8['answer']){_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':'ExecIf','appdata':_0xbf0d('0x41'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1['exten'],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8[_0xbf0d('0x5')]['toLowerCase'](),'app':'Set','appdata':_0xbf0d('0x42'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}else{_0x530b2d['push']({'type':_0x3aefd8[_0xbf0d('0x5')][_0xbf0d('0x39')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1aade1['context'],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});_0x530b2d[_0xbf0d('0xc')]({'type':_0x3aefd8['type'][_0xbf0d('0x39')](),'app':_0xbf0d('0x3'),'appdata':_0xbf0d('0x43'),'context':_0x1aade1[_0xbf0d('0x6')],'exten':_0x1aade1[_0xbf0d('0xe')],'priority':_0x3aefd8[_0xbf0d('0x36')]['length']+_0x2d5193+_0x19c446++,'VoiceExtensionId':_0x1aade1['id']});}}}}for(var _0x52f5ca=0x0;_0x52f5ca<_0x3aefd8['intervals'][_0xbf0d('0x26')];_0x52f5ca++){var _0x345cde=_0x2d5193+_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')];var _0x4f1002=_0x52f5ca===_0x3aefd8[_0xbf0d('0x36')][_0xbf0d('0x26')]-0x1?_0x2d5193+_0x530b2d[_0xbf0d('0x26')]+_0x2bcbc9[_0xbf0d('0x26')]+0x2:_0x2d5193+_0x52f5ca+0x1;_0x530b2d['splice'](_0x52f5ca,0x0,{'type':_0x1aade1[_0xbf0d('0x5')],'app':'GotoIfTime','appdata':_0x3aefd8[_0xbf0d('0x36')][_0x52f5ca]+'?'+_0x1aade1['context']+_0xbf0d('0x44')+_0x345cde+':'+_0x1aade1[_0xbf0d('0x6')]+_0xbf0d('0x44')+_0x4f1002,'exten':_0x1aade1['exten'],'context':_0x1aade1[_0xbf0d('0x6')],'priority':_0x2d5193+_0x52f5ca,'VoiceExtensionId':_0x1aade1['id']});}if(_0x3aefd8[_0xbf0d('0x40')]===_0xbf0d('0x45'))_0x3aefd8[_0xbf0d('0x46')]=_0x330b37(_0x1aade1,_0x3aefd8['appdata']);_0x3aefd8[_0xbf0d('0x47')]=_0x530b2d[_0xbf0d('0x26')]?_[_0xbf0d('0x48')](_0x530b2d)[_0xbf0d('0x47')]+0x1:_0x2d5193;_0x10261a=_['concat'](_0x10261a,_0x530b2d,[_0x3aefd8],_0x2bcbc9);_0x2d5193=_[_0xbf0d('0x48')](_0x10261a)[_0xbf0d('0x47')]+0x1;}return _0x13a39e(_0x10261a);})[_0xbf0d('0x49')](function(_0x1128b9){_0x55a8d7(_0x1128b9);});});}return _0x138814[_0xbf0d('0x4a')](_0xbf0d('0x4b'),attributes,{'tableName':_0xbf0d('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xbd0fd8){var _0x204570=this[_0xbf0d('0x4d')]({'plain':!![]});var _0x4e8da9=_0x204570[_0xbf0d('0x5')]===_0xbf0d('0x11')?_0x474ac2(_0x204570):_0x5db968(_0x204570);return _0x271bcf(_0x204570,_0xbd0fd8,_['last'](_0x4e8da9)[_0xbf0d('0x47')]+0x1)[_0xbf0d('0x34')](function(_0x277046){var _0x35f2af=_['concat'](_0x4e8da9,_0x277046);_0x35f2af[_0xbf0d('0xc')]({'type':_0x204570[_0xbf0d('0x5')],'app':'Hangup','exten':_0x204570[_0xbf0d('0xe')],'context':_0x204570[_0xbf0d('0x6')],'priority':_['last'](_0x35f2af)['priority']+0x1,'VoiceExtensionId':_0x204570['id']});return _0x35f2af;});}}});}; \ No newline at end of file +var _0x2fac=['type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','timeout','url','split','length','name','param','phone','prefix','trunk','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','define','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models'];(function(_0x182f39,_0x50e84d){var _0x386398=function(_0xae12ca){while(--_0xae12ca){_0x182f39['push'](_0x182f39['shift']());}};_0x386398(++_0x50e84d);}(_0x2fac,0x1a5));var _0xc2fa=function(_0x3c4267,_0x32d88b){_0x3c4267=_0x3c4267-0x0;var _0x1bc931=_0x2fac[_0x3c4267];return _0x1bc931;};'use strict';var _=require(_0xc2fa('0x0'));var attributes=require(_0xc2fa('0x1'));module[_0xc2fa('0x2')]=function(_0x3e39da){var _0x46b2ff=_0x3e39da[_0xc2fa('0x3')];function _0x357857(_0x34b0b0){var _0x158644=0x2;var _0xf67859=[{'type':_0x34b0b0[_0xc2fa('0x4')],'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x6')+_0x34b0b0[_0xc2fa('0x4')],'context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']},{'type':_0x34b0b0[_0xc2fa('0x4')],'app':_0x34b0b0['alias']?_0xc2fa('0x5'):_0xc2fa('0x9'),'appdata':_0x34b0b0[_0xc2fa('0xa')]?_0xc2fa('0xb')+_0x34b0b0[_0xc2fa('0xa')]:_0xc2fa('0xc'),'context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']}];if(_0x34b0b0[_0xc2fa('0x4')]===_0xc2fa('0xd')){_0xf67859['push']({'type':_0xc2fa('0xd'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0xe')+_0x34b0b0['id'],'context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']});}_0xf67859[_0xc2fa('0xf')]({'type':_0x34b0b0[_0xc2fa('0x4')],'app':_0xc2fa('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']},{'type':_0x34b0b0[_0xc2fa('0x4')],'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x10'),'context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']},{'type':_0x34b0b0[_0xc2fa('0x4')],'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x11'),'context':_0x34b0b0[_0xc2fa('0x7')],'exten':_0x34b0b0[_0xc2fa('0x8')],'priority':_0x158644++,'VoiceExtensionId':_0x34b0b0['id']});return _0xf67859;}function _0x48b365(_0x13c11e){var _0x1b2324=0x2;var _0x19e243=[{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x13'),'context':_0x13c11e['context'],'exten':_0x13c11e['exten'],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0x13c11e[_0xc2fa('0xa')]?_0xc2fa('0x5'):_0xc2fa('0x9'),'appdata':_0x13c11e['alias']?_0xc2fa('0xb')+_0x13c11e[_0xc2fa('0xa')]:_0xc2fa('0xc'),'context':_0x13c11e['context'],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x14')+(_0x13c11e[_0xc2fa('0x15')]?_0xc2fa('0x16')+_0x13c11e['cutdigits']+'}':_0xc2fa('0x17')),'context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0xe')+_0x13c11e['id'],'context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x18'),'appdata':_0xc2fa('0x19')+(_0x1b2324+0x2)+_0xc2fa('0x1a')+(_0x1b2324+0x1)+')','context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':'outbound','app':_0xc2fa('0x5'),'appdata':_0x13c11e[_0xc2fa('0x15')]?_0xc2fa('0x1b')+_0x13c11e[_0xc2fa('0x15')]+'}':_0xc2fa('0x1c'),'context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e['exten'],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x1d'),'context':_0x13c11e['context'],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':'outbound','app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x10'),'context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':'outbound','app':_0xc2fa('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x1e')+_0x13c11e['id'],'context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']}];if(_0x13c11e[_0xc2fa('0x1f')]('recordingFormat')&&_0x13c11e[_0xc2fa('0x20')]!==_0xc2fa('0x21')){_0x19e243[_0xc2fa('0xf')]({'type':_0xc2fa('0x12'),'app':_0xc2fa('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x13c11e[_0xc2fa('0x7')],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x13c11e[_0xc2fa('0x20')]||_0xc2fa('0x22'),'context':_0x13c11e['context'],'exten':_0x13c11e[_0xc2fa('0x8')],'priority':_0x1b2324++,'VoiceExtensionId':_0x13c11e['id']});}return _0x19e243;}function _0x4967ac(_0x21d1d2,_0x5f36a6){var _0x2d9ac2=[{'name':'trunk','param':0x0},{'name':_0xc2fa('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':_0xc2fa('0x24'),'param':0x3}];var _0xcb1cc5={};var _0x252231=_0x5f36a6[_0xc2fa('0x25')](',');var _0xb12de5=[];for(var _0xf10e32=0x0;_0xf10e32<_0x2d9ac2[_0xc2fa('0x26')];_0xf10e32++){switch(_0x2d9ac2[_0xf10e32][_0xc2fa('0x27')]){case'trunk':_0xcb1cc5['trunk']=_0x252231[_0x2d9ac2[_0xf10e32][_0xc2fa('0x28')]][_0xc2fa('0x25')]('/')[0x1];_0xcb1cc5[_0xc2fa('0x29')]=_0x252231[_0x2d9ac2[_0xf10e32][_0xc2fa('0x28')]][_0xc2fa('0x25')]('/')[0x2];_0xcb1cc5['prefix']=_0xcb1cc5[_0xc2fa('0x29')]?_0xcb1cc5[_0xc2fa('0x29')][_0xc2fa('0x25')]('$')[0x0]:undefined;_0xcb1cc5['phone']=_0x21d1d2[_0xc2fa('0x15')]?(_0xcb1cc5[_0xc2fa('0x2a')]||'')+_0xc2fa('0x16')+_0x21d1d2[_0xc2fa('0x15')]+'}':(_0xcb1cc5['prefix']||'')+'${EXTEN}';_0xb12de5[_0x2d9ac2[_0xf10e32]['param']]=['SIP',_0xcb1cc5[_0xc2fa('0x2b')],_0xcb1cc5[_0xc2fa('0x29')]][_0xc2fa('0x2c')]('/');break;case _0xc2fa('0x2d'):_0xcb1cc5[_0xc2fa('0x2d')]=_0x252231[_0x2d9ac2[_0xf10e32][_0xc2fa('0x28')]];if(_0x21d1d2[_0xc2fa('0x20')]!=='none'){if(_0xcb1cc5[_0xc2fa('0x2d')][_0xc2fa('0x2e')](_0xc2fa('0x2f'))<0x0){_0xcb1cc5[_0xc2fa('0x2d')]+=_0xc2fa('0x2f');}}else{_0xcb1cc5['options']=_0xcb1cc5[_0xc2fa('0x2d')]['replace'](_0xc2fa('0x2f'),'');}_0xb12de5[_0x2d9ac2[_0xf10e32]['param']]=_0xcb1cc5[_0xc2fa('0x2d')];break;default:_0xb12de5[_0x2d9ac2[_0xf10e32]['param']]=_0x252231[_0x2d9ac2[_0xf10e32][_0xc2fa('0x28')]];}}return _0xb12de5[_0xc2fa('0x2c')](',');}function _0x5a2204(_0x444480,_0x5eed14,_0x3ced62){return new Promise(function(_0xfc0c29,_0x13aead){var _0x2ed53e=[];if(_[_0xc2fa('0x30')](_0x5eed14))return _0xfc0c29(_0x2ed53e);_0x46b2ff['Interval'][_0xc2fa('0x31')]({'attributes':['id',_0xc2fa('0x32'),_0xc2fa('0x33')],'raw':!![]})[_0xc2fa('0x34')](function(_0x3d5534){for(var _0x41ccf7=0x0,_0x400994=0x0;_0x41ccf7<_0x5eed14[_0xc2fa('0x26')];_0x41ccf7++,_0x400994=0x0){var _0x51f6e2=_0x5eed14[_0x41ccf7];var _0x193905=[];var _0x64e8c1=[];delete _0x51f6e2['id'];if(_0x51f6e2[_0xc2fa('0x32')]!=='*,*,*,*'){_0x51f6e2[_0xc2fa('0x35')]=[_0x51f6e2[_0xc2fa('0x32')]];}else{_0x51f6e2[_0xc2fa('0x35')]=_0x51f6e2[_0xc2fa('0x33')]?_[_0xc2fa('0x36')](_[_0xc2fa('0x37')](_0x3d5534,{'IntervalId':_0x51f6e2[_0xc2fa('0x33')]}),_0xc2fa('0x32')):[];}_0x51f6e2[_0xc2fa('0x7')]=_0x444480[_0xc2fa('0x7')];_0x51f6e2[_0xc2fa('0x8')]=_0x444480[_0xc2fa('0x8')];if(_0x51f6e2['type'])_0x51f6e2[_0xc2fa('0x4')]=_0x51f6e2[_0xc2fa('0x4')][_0xc2fa('0x38')]();if(_0x444480[_0xc2fa('0x4')]===_0xc2fa('0x12')){if(_0x51f6e2[_0xc2fa('0x1f')](_0xc2fa('0x39'))&&_0x51f6e2[_0xc2fa('0x39')]&&_0x51f6e2[_0xc2fa('0x39')]!=='--'){_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2[_0xc2fa('0x4')][_0xc2fa('0x38')](),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x3a')+_0x51f6e2[_0xc2fa('0x39')],'context':_0x444480[_0xc2fa('0x7')],'exten':_0x444480['exten'],'priority':_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});}_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2[_0xc2fa('0x4')][_0xc2fa('0x38')](),'app':_0xc2fa('0x18'),'appdata':_0xc2fa('0x3b')+(_0x51f6e2[_0xc2fa('0x3c')]?_0xc2fa('0x3d')+_0x51f6e2[_0xc2fa('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x444480['context'],'exten':_0x444480[_0xc2fa('0x8')],'priority':_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});}else{if(_0x51f6e2[_0xc2fa('0x1f')](_0xc2fa('0x3e'))){if([_0xc2fa('0x3f'),_0xc2fa('0x40')]['includes'](_0x51f6e2[_0xc2fa('0x41')][_0xc2fa('0x38')]())&&_0x51f6e2[_0xc2fa('0x42')]!==_0xc2fa('0x43')){if(_0x51f6e2[_0xc2fa('0x3e')]){_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2['type'][_0xc2fa('0x38')](),'app':_0xc2fa('0x18'),'appdata':_0xc2fa('0x44'),'context':_0x444480['context'],'exten':_0x444480[_0xc2fa('0x8')],'priority':_0x51f6e2['intervals'][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2['type'][_0xc2fa('0x38')](),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x45'),'context':_0x444480['context'],'exten':_0x444480[_0xc2fa('0x8')],'priority':_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});}else{_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2[_0xc2fa('0x4')]['toLowerCase'](),'app':_0xc2fa('0x18'),'appdata':_0xc2fa('0x46'),'context':_0x444480[_0xc2fa('0x7')],'exten':_0x444480[_0xc2fa('0x8')],'priority':_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});_0x193905[_0xc2fa('0xf')]({'type':_0x51f6e2[_0xc2fa('0x4')][_0xc2fa('0x38')](),'app':_0xc2fa('0x5'),'appdata':_0xc2fa('0x47'),'context':_0x444480[_0xc2fa('0x7')],'exten':_0x444480[_0xc2fa('0x8')],'priority':_0x51f6e2['intervals'][_0xc2fa('0x26')]+_0x3ced62+_0x400994++,'VoiceExtensionId':_0x444480['id']});}}}}for(var _0x56de9c=0x0;_0x56de9c<_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')];_0x56de9c++){var _0x143cfa=_0x3ced62+_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')];var _0x3ca150=_0x56de9c===_0x51f6e2[_0xc2fa('0x35')][_0xc2fa('0x26')]-0x1?_0x3ced62+_0x193905[_0xc2fa('0x26')]+_0x64e8c1[_0xc2fa('0x26')]+0x2:_0x3ced62+_0x56de9c+0x1;_0x193905[_0xc2fa('0x48')](_0x56de9c,0x0,{'type':_0x444480['type'],'app':_0xc2fa('0x49'),'appdata':_0x51f6e2[_0xc2fa('0x35')][_0x56de9c]+'?'+_0x444480['context']+_0xc2fa('0x4a')+_0x143cfa+':'+_0x444480[_0xc2fa('0x7')]+_0xc2fa('0x4a')+_0x3ca150,'exten':_0x444480['exten'],'context':_0x444480[_0xc2fa('0x7')],'priority':_0x3ced62+_0x56de9c,'VoiceExtensionId':_0x444480['id']});}if(_0x51f6e2[_0xc2fa('0x42')]===_0xc2fa('0x4b'))_0x51f6e2[_0xc2fa('0x4c')]=_0x4967ac(_0x444480,_0x51f6e2[_0xc2fa('0x4c')]);_0x51f6e2['priority']=_0x193905[_0xc2fa('0x26')]?_[_0xc2fa('0x4d')](_0x193905)[_0xc2fa('0x4e')]+0x1:_0x3ced62;_0x2ed53e=_['concat'](_0x2ed53e,_0x193905,[_0x51f6e2],_0x64e8c1);_0x3ced62=_['last'](_0x2ed53e)['priority']+0x1;}return _0xfc0c29(_0x2ed53e);})['catch'](function(_0x3f3772){_0x13aead(_0x3f3772);});});}return _0x3e39da[_0xc2fa('0x4f')](_0xc2fa('0x50'),attributes,{'tableName':_0xc2fa('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1b2007){var _0x25d75a=this[_0xc2fa('0x52')]({'plain':!![]});var _0x406e05=_0x25d75a['type']===_0xc2fa('0x12')?_0x48b365(_0x25d75a):_0x357857(_0x25d75a);return _0x5a2204(_0x25d75a,_0x1b2007,_[_0xc2fa('0x4d')](_0x406e05)[_0xc2fa('0x4e')]+0x1)[_0xc2fa('0x34')](function(_0x21e87c){var _0x260ee0=_[_0xc2fa('0x53')](_0x406e05,_0x21e87c);_0x260ee0['push']({'type':_0x25d75a[_0xc2fa('0x4')],'app':_0xc2fa('0x54'),'exten':_0x25d75a[_0xc2fa('0x8')],'context':_0x25d75a[_0xc2fa('0x7')],'priority':_[_0xc2fa('0x4d')](_0x260ee0)[_0xc2fa('0x4e')]+0x1,'VoiceExtensionId':_0x25d75a['id']});return _0x260ee0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6e2bfd3..981bd53 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 _0x5294=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetVoiceExtension','findAll','options','raw','attributes','include','map','model'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x5294,0x111));var _0x4529=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x5294[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x4529('0x0'));var util=require(_0x4529('0x1'));var moment=require(_0x4529('0x2'));var BPromise=require(_0x4529('0x3'));var rs=require(_0x4529('0x4'));var fs=require('fs');var Redis=require(_0x4529('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4529('0x6'));var logger=require(_0x4529('0x7'))(_0x4529('0x8'));var config=require('../../config/environment');var jayson=require(_0x4529('0x9'));var client=jayson[_0x4529('0xa')][_0x4529('0xb')]({'port':0x232a});config[_0x4529('0xc')]=_['defaults'](config[_0x4529('0xc')],{'host':_0x4529('0xd'),'port':0x18eb});var socket=require(_0x4529('0xe'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x350678,_0x2532f4,_0x19777f){return new BPromise(function(_0x579574,_0x1a13b6){return client[_0x4529('0xf')](_0x350678,_0x19777f)[_0x4529('0x10')](function(_0x3143ba){logger[_0x4529('0x11')](_0x4529('0x12'),_0x2532f4,'request\x20sent');logger['debug'](_0x4529('0x13'),_0x2532f4,_0x4529('0x14'),JSON['stringify'](_0x3143ba));if(_0x3143ba[_0x4529('0x15')]){if(_0x3143ba['error'][_0x4529('0x16')]===0x1f4){logger[_0x4529('0x15')](_0x4529('0x12'),_0x2532f4,_0x3143ba[_0x4529('0x15')]['message']);return _0x1a13b6(_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);}logger[_0x4529('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x2532f4,_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);return _0x579574(_0x3143ba[_0x4529('0x15')][_0x4529('0x17')]);}else{logger['info'](_0x4529('0x12'),_0x2532f4,_0x4529('0x14'));_0x579574(_0x3143ba['result'][_0x4529('0x17')]);}})[_0x4529('0x18')](function(_0x10b3e1){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2532f4,_0x10b3e1);_0x1a13b6(_0x10b3e1);});});}exports[_0x4529('0x19')]=function(_0x722e24){var _0x3e4467=this;return new Promise(function(_0x1c70d4,_0x32b8dc){return db['VoiceExtension'][_0x4529('0x1a')]({'raw':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1c')]===undefined?!![]:![]:!![],'where':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')]['where']||null:null,'attributes':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1d')]||null:null,'limit':_0x722e24['options']?_0x722e24[_0x4529('0x1b')]['limit']||null:null,'include':_0x722e24[_0x4529('0x1b')]?_0x722e24[_0x4529('0x1b')][_0x4529('0x1e')]?_[_0x4529('0x1f')](_0x722e24[_0x4529('0x1b')][_0x4529('0x1e')],function(_0x2647d3){return{'model':db[_0x2647d3[_0x4529('0x20')]],'as':_0x2647d3['as'],'attributes':_0x2647d3[_0x4529('0x1d')],'include':_0x2647d3['include']?_['map'](_0x2647d3['include'],function(_0x43c608){return{'model':db[_0x43c608[_0x4529('0x20')]],'as':_0x43c608['as'],'attributes':_0x43c608[_0x4529('0x1d')],'include':_0x43c608[_0x4529('0x1e')]?_[_0x4529('0x1f')](_0x43c608['include'],function(_0x534c2d){return{'model':db[_0x534c2d[_0x4529('0x20')]],'as':_0x534c2d['as'],'attributes':_0x534c2d[_0x4529('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4529('0x10')](function(_0x3e0d2c){logger['info']('GetVoiceExtension',_0x722e24);logger[_0x4529('0x21')](_0x4529('0x19'),_0x722e24,JSON['stringify'](_0x3e0d2c));_0x1c70d4(_0x3e0d2c);})[_0x4529('0x18')](function(_0x25519e){logger[_0x4529('0x15')](_0x4529('0x19'),_0x25519e[_0x4529('0x17')],_0x722e24);_0x32b8dc(_0x3e4467[_0x4529('0x15')](0x1f4,_0x25519e[_0x4529('0x17')]));});});}; \ No newline at end of file +var _0xe35c=['model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceExtension,\x20%s,\x20%s','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include'];(function(_0x357164,_0x5d4dfb){var _0x5d1323=function(_0x1e4f81){while(--_0x1e4f81){_0x357164['push'](_0x357164['shift']());}};_0x5d1323(++_0x5d4dfb);}(_0xe35c,0x146));var _0xce35=function(_0x1f491f,_0xfb5792){_0x1f491f=_0x1f491f-0x0;var _0x2d301c=_0xe35c[_0x1f491f];return _0x2d301c;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var moment=require(_0xce35('0x2'));var BPromise=require(_0xce35('0x3'));var rs=require(_0xce35('0x4'));var fs=require('fs');var Redis=require(_0xce35('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce35('0x6'))('rpc');var config=require(_0xce35('0x7'));var jayson=require(_0xce35('0x8'));var client=jayson[_0xce35('0x9')]['http']({'port':0x232a});config[_0xce35('0xa')]=_[_0xce35('0xb')](config[_0xce35('0xa')],{'host':_0xce35('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce35('0xa')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x31de15,_0x584cc6,_0x478ce1){return new BPromise(function(_0x3bd7fc,_0x46647b){return client[_0xce35('0xd')](_0x31de15,_0x478ce1)[_0xce35('0xe')](function(_0x3a1981){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x584cc6,_0xce35('0xf'));logger[_0xce35('0x10')](_0xce35('0x11'),_0x584cc6,_0xce35('0xf'),JSON[_0xce35('0x12')](_0x3a1981));if(_0x3a1981['error']){if(_0x3a1981['error'][_0xce35('0x13')]===0x1f4){logger[_0xce35('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x584cc6,_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);return _0x46647b(_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);}logger[_0xce35('0x14')](_0xce35('0x16'),_0x584cc6,_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);return _0x3bd7fc(_0x3a1981[_0xce35('0x14')][_0xce35('0x15')]);}else{logger[_0xce35('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x584cc6,_0xce35('0xf'));_0x3bd7fc(_0x3a1981[_0xce35('0x18')][_0xce35('0x15')]);}})[_0xce35('0x19')](function(_0x2b4b24){logger['error'](_0xce35('0x16'),_0x584cc6,_0x2b4b24);_0x46647b(_0x2b4b24);});});}exports[_0xce35('0x1a')]=function(_0x28f4ea){var _0x207c34=this;return new Promise(function(_0x433861,_0x8a0771){return db[_0xce35('0x1b')][_0xce35('0x1c')]({'raw':_0x28f4ea['options']?_0x28f4ea[_0xce35('0x1d')][_0xce35('0x1e')]===undefined?!![]:![]:!![],'where':_0x28f4ea[_0xce35('0x1d')]?_0x28f4ea[_0xce35('0x1d')][_0xce35('0x1f')]||null:null,'attributes':_0x28f4ea[_0xce35('0x1d')]?_0x28f4ea[_0xce35('0x1d')][_0xce35('0x20')]||null:null,'limit':_0x28f4ea[_0xce35('0x1d')]?_0x28f4ea[_0xce35('0x1d')]['limit']||null:null,'include':_0x28f4ea[_0xce35('0x1d')]?_0x28f4ea[_0xce35('0x1d')][_0xce35('0x21')]?_['map'](_0x28f4ea[_0xce35('0x1d')][_0xce35('0x21')],function(_0x510307){return{'model':db[_0x510307[_0xce35('0x22')]],'as':_0x510307['as'],'attributes':_0x510307[_0xce35('0x20')],'include':_0x510307[_0xce35('0x21')]?_[_0xce35('0x23')](_0x510307[_0xce35('0x21')],function(_0x564485){return{'model':db[_0x564485[_0xce35('0x22')]],'as':_0x564485['as'],'attributes':_0x564485[_0xce35('0x20')],'include':_0x564485[_0xce35('0x21')]?_[_0xce35('0x23')](_0x564485[_0xce35('0x21')],function(_0x3876ed){return{'model':db[_0x3876ed[_0xce35('0x22')]],'as':_0x3876ed['as'],'attributes':_0x3876ed[_0xce35('0x20')]};}):[]};}):[]};}):[]:[]})[_0xce35('0xe')](function(_0x5b619e){logger[_0xce35('0x17')]('GetVoiceExtension',_0x28f4ea);logger[_0xce35('0x10')](_0xce35('0x1a'),_0x28f4ea,JSON[_0xce35('0x12')](_0x5b619e));_0x433861(_0x5b619e);})[_0xce35('0x19')](function(_0x44694f){logger[_0xce35('0x14')](_0xce35('0x1a'),_0x44694f['message'],_0x28f4ea);_0x8a0771(_0x207c34[_0xce35('0x14')](0x1f4,_0x44694f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 85fb724..3a3ade9 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x5b5882,_0x3e86ec){var _0x7c8d0b=function(_0x5d4bb2){while(--_0x5d4bb2){_0x5b5882['push'](_0x5b5882['shift']());}};_0x7c8d0b(++_0x3e86ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'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 +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4edccc,_0x3a8ad9){var _0x924ffe=function(_0x17e1db){while(--_0x17e1db){_0x4edccc['push'](_0x4edccc['shift']());}};_0x924ffe(++_0x3a8ad9);}(_0x1261,0x144));var _0x1126=function(_0x2656a4,_0x28dd1b){_0x2656a4=_0x2656a4-0x0;var _0x48ce85=_0x1261[_0x2656a4];return _0x48ce85;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f3437c1..6922200 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 _0x5430=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x5430,0x10c));var _0x0543=function(_0x4850e8,_0x5f438e){_0x4850e8=_0x4850e8-0x0;var _0xb97c5b=_0x5430[_0x4850e8];return _0xb97c5b;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/',auth['isAuthenticated'](),controller[_0x0543('0xf')]);router[_0x0543('0x10')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0x11')]);router[_0x0543('0x12')](_0x0543('0xa'),auth[_0x0543('0x8')](),controller[_0x0543('0x13')]);module[_0x0543('0x14')]=router; \ No newline at end of file +var _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post','create','put','update'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x7046,0x144));var _0x6704=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7046[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6704('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x10')](_0x6704('0xc'),auth[_0x6704('0xa')](),controller[_0x6704('0x11')]);router['delete'](_0x6704('0xc'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 48cfccd..fc7458f 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 _0x41a0=['string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','exports','STRING','contest_mailbox','setDataValue','email'];(function(_0x2eff8d,_0x18fc8c){var _0x2a9b8c=function(_0x30edff){while(--_0x30edff){_0x2eff8d['push'](_0x2eff8d['shift']());}};_0x2a9b8c(++_0x18fc8c);}(_0x41a0,0xaf));var _0x041a=function(_0x1a7b88,_0x53607b){_0x1a7b88=_0x1a7b88-0x0;var _0x524e8f=_0x41a0[_0x1a7b88];return _0x524e8f;};'use strict';var Sequelize=require('sequelize');module[_0x041a('0x0')]={'customer_id':{'type':Sequelize[_0x041a('0x1')]},'context':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x041a('0x2')},'password':{'type':Sequelize[_0x041a('0x1')]},'fullname':{'type':Sequelize[_0x041a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x496dea){this[_0x041a('0x3')](_0x041a('0x4'),typeof _0x496dea===_0x041a('0x5')&&_0x496dea[_0x041a('0x6')]()?_0x496dea[_0x041a('0x6')]():null);}},'pager':{'type':Sequelize[_0x041a('0x1')]},'tz':{'type':Sequelize[_0x041a('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':_0x041a('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x041a('0x7')]('yes','no'),'defaultValue':_0x041a('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x041a('0x1')]},'callback':{'type':Sequelize[_0x041a('0x1')]},'review':{'type':Sequelize[_0x041a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x041a('0x7')](_0x041a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x041a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x041a('0x9')},'emailsubject':{'type':Sequelize[_0x041a('0x1')]},'emailbody':{'type':Sequelize[_0x041a('0x1')]},'maxsecs':{'type':Sequelize[_0x041a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x041a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x041a('0xb')],'get':function(){return this[_0x041a('0xc')](_0x041a('0xd'))+'\x20-\x20'+this[_0x041a('0xc')](_0x041a('0xe'));}}}; \ No newline at end of file +var _0x5fcd=['mailbox','exports','STRING','contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20'];(function(_0x8c2f43,_0x5b9e27){var _0x3f11f5=function(_0x4ed97e){while(--_0x4ed97e){_0x8c2f43['push'](_0x8c2f43['shift']());}};_0x3f11f5(++_0x5b9e27);}(_0x5fcd,0xb5));var _0xd5fc=function(_0xf595a8,_0x1bae57){_0xf595a8=_0xf595a8-0x0;var _0x29d1fb=_0x5fcd[_0xf595a8];return _0x29d1fb;};'use strict';var Sequelize=require('sequelize');module[_0xd5fc('0x0')]={'customer_id':{'type':Sequelize[_0xd5fc('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xd5fc('0x2')},'mailbox':{'type':Sequelize[_0xd5fc('0x1')],'defaultValue':'','allowNull':![],'unique':_0xd5fc('0x2')},'password':{'type':Sequelize[_0xd5fc('0x1')]},'fullname':{'type':Sequelize[_0xd5fc('0x1')]},'email':{'type':Sequelize[_0xd5fc('0x1')],'validate':{'isEmail':!![]},'set':function(_0xc989e0){this[_0xd5fc('0x3')](_0xd5fc('0x4'),typeof _0xc989e0==='string'&&_0xc989e0[_0xd5fc('0x5')]()?_0xc989e0[_0xd5fc('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xd5fc('0x1')],'defaultValue':_0xd5fc('0x6')},'attach':{'type':Sequelize[_0xd5fc('0x7')]('yes','no'),'defaultValue':_0xd5fc('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xd5fc('0x7')](_0xd5fc('0x8'),'no'),'defaultValue':_0xd5fc('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xd5fc('0x1')]},'review':{'type':Sequelize[_0xd5fc('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd5fc('0x7')](_0xd5fc('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd5fc('0x7')](_0xd5fc('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xd5fc('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xd5fc('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd5fc('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xd5fc('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd5fc('0x7')](_0xd5fc('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xd5fc('0x7')](_0xd5fc('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xd5fc('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xd5fc('0x1')]},'maxsecs':{'type':Sequelize[_0xd5fc('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd5fc('0xb')](_0xd5fc('0xc'))+_0xd5fc('0xd')+this[_0xd5fc('0xb')](_0xd5fc('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index e9a246b..b46f3c2 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 _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','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','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x5f1b1a,_0x34a1fc){var _0x441330=function(_0x3b0da3){while(--_0x3b0da3){_0x5f1b1a['push'](_0x5f1b1a['shift']());}};_0x441330(++_0x34a1fc);}(_0xbee3,0xd5));var _0x3bee=function(_0x3462e7,_0x4e47ca){_0x3462e7=_0x3462e7-0x0;var _0x1f2967=_0xbee3[_0x3462e7];return _0x1f2967;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file +var _0xb688=['fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','catch','show','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','filter','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','get','Voicemails','end','error','name','send','index','map','VoiceMail'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb688,0xcf));var _0x8b68=function(_0xf8e350,_0x36ce98){_0xf8e350=_0xf8e350-0x0;var _0x57b103=_0xb688[_0xf8e350];return _0x57b103;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){var _0x4ca77d=_0x59bb8a[_0x8b68('0x27')]({'plain':!![]});var _0x3cf8d2=_0x8b68('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cf8d2,'resourceId':_0x4ca77d['id']}})['then'](function(){return _0x59bb8a;});})[_0x8b68('0x25')](function(){_0x32ddc5[_0x8b68('0x1c')](0xcc)[_0x8b68('0x29')]();});}};}function handleEntityNotFound(_0x583476,_0x3311c7){return function(_0x53aaa2){if(!_0x53aaa2){_0x583476['sendStatus'](0x194);}return _0x53aaa2;};}function handleError(_0x3865ea,_0x59b3ce){_0x59b3ce=_0x59b3ce||0x1f4;return function(_0x26cad7){logger[_0x8b68('0x2a')](_0x26cad7['stack']);if(_0x26cad7['name']){delete _0x26cad7[_0x8b68('0x2b')];}_0x3865ea[_0x8b68('0x1c')](_0x59b3ce)[_0x8b68('0x2c')](_0x26cad7);};}exports[_0x8b68('0x2d')]=function(_0x210926,_0x2ad2df){var _0x460c37={},_0x5b7ed1={},_0x3b6d1b={'count':0x0,'rows':[]};var _0x50a1e9=_[_0x8b68('0x2e')](db[_0x8b68('0x2f')]['rawAttributes'],function(_0x216aa6){return{'name':_0x216aa6[_0x8b68('0x30')],'type':_0x216aa6[_0x8b68('0x31')]['key']};});_0x5b7ed1['model']=_[_0x8b68('0x2e')](_0x50a1e9,_0x8b68('0x2b'));_0x5b7ed1[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x210926[_0x8b68('0x32')]);_0x5b7ed1[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],_0x5b7ed1[_0x8b68('0x32')]);_0x460c37[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x210926[_0x8b68('0x32')][_0x8b68('0x38')]));_0x460c37[_0x8b68('0x37')]=_0x460c37[_0x8b68('0x37')][_0x8b68('0x39')]?_0x460c37[_0x8b68('0x37')]:_0x5b7ed1[_0x8b68('0x36')];if(!_0x210926[_0x8b68('0x32')][_0x8b68('0x3a')]('nolimit')){_0x460c37['limit']=qs[_0x8b68('0x1f')](_0x210926[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x460c37[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x210926[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x460c37[_0x8b68('0x3b')]=qs['sort'](_0x210926[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x460c37[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x210926[_0x8b68('0x32')],_0x5b7ed1[_0x8b68('0x34')]),_0x50a1e9);if(_0x210926[_0x8b68('0x32')]['filter']){_0x460c37[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x460c37[_0x8b68('0x3d')],{'$or':_[_0x8b68('0x2e')](_0x50a1e9,function(_0x3ecc60){if(_0x3ecc60[_0x8b68('0x31')]!==_0x8b68('0x40')){var _0x50a9c6={};_0x50a9c6[_0x3ecc60[_0x8b68('0x2b')]]={'$like':'%'+_0x210926[_0x8b68('0x32')]['filter']+'%'};return _0x50a9c6;}})});}_0x460c37=_[_0x8b68('0x3f')]({},_0x460c37,_0x210926[_0x8b68('0x41')]);var _0x50b2f1={'where':_0x460c37['where']};return db['VoiceMail']['count'](_0x50b2f1)[_0x8b68('0x25')](function(_0x23d24a){_0x3b6d1b['count']=_0x23d24a;if(_0x210926[_0x8b68('0x32')]['includeAll']){_0x460c37[_0x8b68('0x42')]=[{'all':!![]}];}return db[_0x8b68('0x2f')]['findAll'](_0x460c37);})[_0x8b68('0x25')](function(_0x5ae345){_0x3b6d1b['rows']=_0x5ae345;return _0x3b6d1b;})['then'](respondWithFilteredResult(_0x2ad2df,_0x460c37))[_0x8b68('0x43')](handleError(_0x2ad2df,null));};exports[_0x8b68('0x44')]=function(_0x3ba80e,_0xa70f60){var _0x50e425={'raw':!![],'where':{'id':_0x3ba80e['params']['id']}},_0x20162a={};_0x20162a[_0x8b68('0x36')]=_[_0x8b68('0x33')](db['VoiceMail'][_0x8b68('0x45')]);_0x20162a[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ba80e[_0x8b68('0x32')]);_0x20162a['filters']=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],_0x20162a[_0x8b68('0x32')]);_0x50e425[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x50e425[_0x8b68('0x37')]=_0x50e425[_0x8b68('0x37')][_0x8b68('0x39')]?_0x50e425[_0x8b68('0x37')]:_0x20162a[_0x8b68('0x36')];if(_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x46')]){_0x50e425['include']=[{'all':!![]}];}_0x50e425=_[_0x8b68('0x3f')]({},_0x50e425,_0x3ba80e[_0x8b68('0x41')]);return db['VoiceMail'][_0x8b68('0x47')](_0x50e425)['then'](handleEntityNotFound(_0xa70f60,null))['then'](respondWithResult(_0xa70f60,null))['catch'](handleError(_0xa70f60,null));};exports[_0x8b68('0x48')]=function(_0x35874b,_0x34047c){return db[_0x8b68('0x2f')]['create'](_0x35874b['body'],{})[_0x8b68('0x25')](function(_0x163fd5){var _0x1e900f=_0x35874b['user'][_0x8b68('0x27')]({'plain':!![]});if(!_0x1e900f)throw new Error(_0x8b68('0x49'));if(_0x1e900f['role']===_0x8b68('0x4a')){var _0xacac82=_0x163fd5['get']({'plain':!![]});var _0x18a9ae=_0x8b68('0x28');return db['UserProfileSection'][_0x8b68('0x47')]({'where':{'name':_0x18a9ae,'userProfileId':_0x1e900f[_0x8b68('0x4b')]},'raw':!![]})['then'](function(_0x543d74){if(_0x543d74&&_0x543d74['autoAssociation']===0x0){return db[_0x8b68('0x4c')][_0x8b68('0x48')]({'name':_0xacac82[_0x8b68('0x2b')],'resourceId':_0xacac82['id'],'type':_0x543d74[_0x8b68('0x2b')],'sectionId':_0x543d74['id']},{})['then'](function(){return _0x163fd5;});}else{return _0x163fd5;}})['catch'](function(_0x4492fd){logger[_0x8b68('0x2a')](_0x8b68('0x4d'),_0x4492fd);throw _0x4492fd;});}return _0x163fd5;})['then'](respondWithResult(_0x34047c,0xc9))[_0x8b68('0x43')](handleError(_0x34047c,null));};exports[_0x8b68('0x24')]=function(_0x3f9d34,_0x4dda69){if(_0x3f9d34[_0x8b68('0x4e')]['id']){delete _0x3f9d34['body']['id'];}return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x3f9d34['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x4dda69,null))[_0x8b68('0x25')](saveUpdates(_0x3f9d34[_0x8b68('0x4e')],null))[_0x8b68('0x25')](respondWithResult(_0x4dda69,null))[_0x8b68('0x43')](handleError(_0x4dda69,null));};exports['destroy']=function(_0x241166,_0x3f3e43){return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x241166[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x3f3e43,null))[_0x8b68('0x25')](removeEntity(_0x3f3e43,null))[_0x8b68('0x43')](handleError(_0x3f3e43,null));};exports['getMessages']=function(_0x3f423e,_0x1a85da,_0x1e8694){return db[_0x8b68('0x2f')][_0x8b68('0x50')]({'where':{'id':_0x3f423e[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x1a85da,null))[_0x8b68('0x25')](function(_0x6d63cb){var _0x271dbe;var _0x368c86={},_0x42871e={};_0x42871e[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x51')][_0x8b68('0x45')]);_0x42871e[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3f423e[_0x8b68('0x32')]);_0x42871e[_0x8b68('0x34')]=_['intersection'](_0x42871e[_0x8b68('0x36')],_0x42871e['query']);_0x368c86['attributes']=_[_0x8b68('0x35')](_0x42871e['model'],qs[_0x8b68('0x38')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x368c86['attributes']=_0x368c86[_0x8b68('0x37')][_0x8b68('0x39')]?_0x368c86[_0x8b68('0x37')]:_0x42871e[_0x8b68('0x36')];if(!_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3a')](_0x8b68('0x52'))){_0x368c86['limit']=qs['limit'](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x368c86[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x368c86[_0x8b68('0x3b')]=qs[_0x8b68('0x3c')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x368c86[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x3f423e[_0x8b68('0x32')],_0x42871e[_0x8b68('0x34')]));if(_0x3f423e[_0x8b68('0x32')][_0x8b68('0x53')]){_0x368c86[_0x8b68('0x3d')]=_['merge'](_0x368c86['where'],{'$or':_[_0x8b68('0x2e')](_0x368c86[_0x8b68('0x37')],function(_0x5bd581){var _0x48d57a={};_0x48d57a[_0x5bd581]={'$like':'%'+_0x3f423e['query'][_0x8b68('0x53')]+'%'};return _0x48d57a;})});}_0x368c86[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x368c86[_0x8b68('0x3d')],{'mailboxuser':_0x6d63cb[_0x8b68('0x54')]});_0x368c86=_['merge']({},_0x368c86,_0x3f423e[_0x8b68('0x41')]);return db[_0x8b68('0x51')]['findAndCountAll'](_0x368c86)[_0x8b68('0x25')](respondWithFilteredResult(_0x1a85da,_0x368c86));})['catch'](handleError(_0x1a85da,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index de50576..3b2c9c2 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 _0xeab0=['VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceMail.attributes','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xeab0,0x156));var _0x0eab=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xeab0[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x0eab('0x0'));var util=require(_0x0eab('0x1'));var logger=require(_0x0eab('0x2'))(_0x0eab('0x3'));var moment=require(_0x0eab('0x4'));var BPromise=require('bluebird');var rp=require(_0x0eab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0eab('0x6'));var config=require('../../config/environment');var attributes=require(_0x0eab('0x7'));module[_0x0eab('0x8')]=function(_0x452af7,_0x5e45ec){return _0x452af7['define'](_0x0eab('0x9'),attributes,{'tableName':_0x0eab('0xa'),'paranoid':![],'indexes':[{'name':_0x0eab('0xb'),'fields':['mailbox',_0x0eab('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xce28=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x1974bc,_0x3fa3f6){var _0x53be82=function(_0x1dbc43){while(--_0x1dbc43){_0x1974bc['push'](_0x1974bc['shift']());}};_0x53be82(++_0x3fa3f6);}(_0xce28,0x66));var _0x8ce2=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xce28[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x8ce2('0x0'));var util=require(_0x8ce2('0x1'));var logger=require(_0x8ce2('0x2'))(_0x8ce2('0x3'));var moment=require('moment');var BPromise=require(_0x8ce2('0x4'));var rp=require(_0x8ce2('0x5'));var fs=require('fs');var path=require(_0x8ce2('0x6'));var rimraf=require(_0x8ce2('0x7'));var config=require(_0x8ce2('0x8'));var attributes=require(_0x8ce2('0x9'));module[_0x8ce2('0xa')]=function(_0x386510,_0x22a769){return _0x386510[_0x8ce2('0xb')](_0x8ce2('0xc'),attributes,{'tableName':_0x8ce2('0xd'),'paranoid':![],'indexes':[{'name':_0x8ce2('0xe'),'fields':[_0x8ce2('0xf'),_0x8ce2('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 460172e..4779a41 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 _0xbddd=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xbddd,0x192));var _0xdbdd=function(_0x35165c,_0x33b479){_0x35165c=_0x35165c-0x0;var _0xb98013=_0xbddd[_0x35165c];return _0xb98013;};'use strict';var _=require(_0xdbdd('0x0'));var util=require('util');var moment=require(_0xdbdd('0x1'));var BPromise=require(_0xdbdd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbdd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbdd('0x4'));var logger=require(_0xdbdd('0x5'))(_0xdbdd('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x558bb8,_0x5753c3,_0x3cc5b0){return new BPromise(function(_0x619b28,_0x5d9453){return client[_0xdbdd('0x8')](_0x558bb8,_0x3cc5b0)[_0xdbdd('0x9')](function(_0x4b200){logger[_0xdbdd('0xa')](_0xdbdd('0xb'),_0x5753c3,'request\x20sent');logger[_0xdbdd('0xc')](_0xdbdd('0xd'),_0x5753c3,_0xdbdd('0xe'),JSON['stringify'](_0x4b200));if(_0x4b200[_0xdbdd('0xf')]){if(_0x4b200[_0xdbdd('0xf')]['code']===0x1f4){logger[_0xdbdd('0xf')](_0xdbdd('0xb'),_0x5753c3,_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);return _0x5d9453(_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);return _0x619b28(_0x4b200[_0xdbdd('0xf')][_0xdbdd('0x10')]);}else{logger[_0xdbdd('0xa')]('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0xdbdd('0xe'));_0x619b28(_0x4b200[_0xdbdd('0x11')][_0xdbdd('0x10')]);}})['catch'](function(_0x414c5c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x5753c3,_0x414c5c);_0x5d9453(_0x414c5c);});});} \ No newline at end of file +var _0x5a38=['client','http','request','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x5a38,0x1a7));var _0x85a3=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x5a38[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0x85a3('0x0'));var util=require(_0x85a3('0x1'));var moment=require('moment');var BPromise=require(_0x85a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85a3('0x3'));var db=require(_0x85a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x85a3('0x5'))(_0x85a3('0x6'));var config=require(_0x85a3('0x7'));var jayson=require(_0x85a3('0x8'));var client=jayson[_0x85a3('0x9')][_0x85a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x808b1c,_0xc418f2,_0x158652){return new BPromise(function(_0x461202,_0x3e73e0){return client[_0x85a3('0xb')](_0x808b1c,_0x158652)[_0x85a3('0xc')](function(_0x7322da){logger['info'](_0x85a3('0xd'),_0xc418f2,'request\x20sent');logger[_0x85a3('0xe')](_0x85a3('0xf'),_0xc418f2,_0x85a3('0x10'),JSON[_0x85a3('0x11')](_0x7322da));if(_0x7322da[_0x85a3('0x12')]){if(_0x7322da['error'][_0x85a3('0x13')]===0x1f4){logger['error'](_0x85a3('0xd'),_0xc418f2,_0x7322da[_0x85a3('0x12')]['message']);return _0x3e73e0(_0x7322da['error'][_0x85a3('0x14')]);}logger[_0x85a3('0x12')]('VoiceMail,\x20%s,\x20%s',_0xc418f2,_0x7322da['error']['message']);return _0x461202(_0x7322da['error'][_0x85a3('0x14')]);}else{logger[_0x85a3('0x15')]('VoiceMail,\x20%s,\x20%s',_0xc418f2,_0x85a3('0x10'));_0x461202(_0x7322da[_0x85a3('0x16')][_0x85a3('0x14')]);}})[_0x85a3('0x17')](function(_0xb279fb){logger[_0x85a3('0x12')](_0x85a3('0xd'),_0xc418f2,_0xb279fb);_0x3e73e0(_0xb279fb);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9e952bc..9a09dab 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 _0xc5ca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5ca,0x9b));var _0xac5c=function(_0x54c6b0,_0x400655){_0x54c6b0=_0x54c6b0-0x0;var _0x43a6e9=_0xc5ca[_0x54c6b0];return _0x43a6e9;};'use strict';var multer=require(_0xac5c('0x0'));var util=require(_0xac5c('0x1'));var path=require(_0xac5c('0x2'));var timeout=require(_0xac5c('0x3'));var express=require(_0xac5c('0x4'));var router=express[_0xac5c('0x5')]();var fs_extra=require(_0xac5c('0x6'));var auth=require(_0xac5c('0x7'));var interaction=require(_0xac5c('0x8'));var config=require(_0xac5c('0x9'));var controller=require(_0xac5c('0xa'));router['get']('/',auth[_0xac5c('0xb')](),controller[_0xac5c('0xc')]);router[_0xac5c('0xd')](_0xac5c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xac5c('0xd')](_0xac5c('0xf'),auth[_0xac5c('0xb')](),controller[_0xac5c('0x10')]);router[_0xac5c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac5c('0x12')](_0xac5c('0xe'),auth[_0xac5c('0xb')](),controller[_0xac5c('0x13')]);router[_0xac5c('0x14')](_0xac5c('0xe'),auth['isAuthenticated'](),controller[_0xac5c('0x15')]);module[_0xac5c('0x16')]=router; \ No newline at end of file +var _0xc5ea=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ba2b6,_0xd08d92){var _0x54c166=function(_0x4f03ab){while(--_0x4f03ab){_0x5ba2b6['push'](_0x5ba2b6['shift']());}};_0x54c166(++_0xd08d92);}(_0xc5ea,0x160));var _0xac5e=function(_0x426834,_0x78a366){_0x426834=_0x426834-0x0;var _0x575718=_0xc5ea[_0x426834];return _0x575718;};'use strict';var multer=require(_0xac5e('0x0'));var util=require(_0xac5e('0x1'));var path=require(_0xac5e('0x2'));var timeout=require(_0xac5e('0x3'));var express=require(_0xac5e('0x4'));var router=express[_0xac5e('0x5')]();var fs_extra=require(_0xac5e('0x6'));var auth=require(_0xac5e('0x7'));var interaction=require(_0xac5e('0x8'));var config=require(_0xac5e('0x9'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xac5e('0xa')](),controller['index']);router[_0xac5e('0xb')](_0xac5e('0xc'),auth[_0xac5e('0xa')](),controller[_0xac5e('0xd')]);router[_0xac5e('0xb')](_0xac5e('0xe'),auth[_0xac5e('0xa')](),controller['download']);router[_0xac5e('0xf')]('/',auth[_0xac5e('0xa')](),controller[_0xac5e('0x10')]);router[_0xac5e('0x11')](_0xac5e('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xac5e('0xc'),auth[_0xac5e('0xa')](),controller[_0xac5e('0x12')]);module[_0xac5e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 39a1180..bd6cfe4 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 _0xbdce=['VIRTUAL','INTEGER','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x48cdfe,_0x32c6c1){var _0xbd78be=function(_0x316e01){while(--_0x316e01){_0x48cdfe['push'](_0x48cdfe['shift']());}};_0xbd78be(++_0x32c6c1);}(_0xbdce,0x7c));var _0xebdc=function(_0x54f72a,_0x17ea1c){_0x54f72a=_0x54f72a-0x0;var _0x168c6a=_0xbdce[_0x54f72a];return _0x168c6a;};'use strict';var Sequelize=require(_0xebdc('0x0'));module[_0xebdc('0x1')]={'name':{'type':Sequelize[_0xebdc('0x2')],'get':function(_0x302588){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xebdc('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xebdc('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xebdc('0x5')](_0xebdc('0x6'))}}; \ No newline at end of file +var _0x8fbd=['VIRTUAL','getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','sequelize','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8fbd,0x1b7));var _0xd8fb=function(_0x4b126b,_0x579cd1){_0x4b126b=_0x4b126b-0x0;var _0x12f83d=_0x8fbd[_0x4b126b];return _0x12f83d;};'use strict';var Sequelize=require(_0xd8fb('0x0'));module[_0xd8fb('0x1')]={'name':{'type':Sequelize[_0xd8fb('0x2')],'get':function(_0x2b29e8){return this[_0xd8fb('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xd8fb('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd8fb('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd8fb('0x5')],'defaultValue':''},'stamp':{'type':_0xd8fb('0x7'),'defaultValue':Sequelize[_0xd8fb('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4a756ff..b153b9f 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 _0xafca=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafca,0x139));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaafc('0x0'));var rimraf=require(_0xaafc('0x1'));var zipdir=require(_0xaafc('0x2'));var jsonpatch=require(_0xaafc('0x3'));var rp=require(_0xaafc('0x4'));var moment=require(_0xaafc('0x5'));var BPromise=require(_0xaafc('0x6'));var Mustache=require(_0xaafc('0x7'));var util=require(_0xaafc('0x8'));var path=require('path');var sox=require(_0xaafc('0x9'));var csv=require(_0xaafc('0xa'));var ejs=require(_0xaafc('0xb'));var fs=require('fs');var fs_extra=require(_0xaafc('0xc'));var _=require(_0xaafc('0xd'));var squel=require(_0xaafc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaafc('0xf'));var Papa=require(_0xaafc('0x10'));var Redis=require(_0xaafc('0x11'));var authService=require(_0xaafc('0x12'));var qs=require(_0xaafc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaafc('0x14'));var logger=require(_0xaafc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaafc('0x16'));var db=require(_0xaafc('0x17'))['db'];function respondWithStatusCode(_0x8efb3b,_0x6f31c0){_0x6f31c0=_0x6f31c0||0xcc;return function(_0x161593){if(_0x161593){return _0x8efb3b['sendStatus'](_0x6f31c0);}return _0x8efb3b[_0xaafc('0x18')](_0x6f31c0)[_0xaafc('0x19')]();};}function respondWithResult(_0x17b986,_0x307adb){_0x307adb=_0x307adb||0xc8;return function(_0x2aa7f2){if(_0x2aa7f2){return _0x17b986['status'](_0x307adb)['json'](_0x2aa7f2);}};}function respondWithFilteredResult(_0x196f41,_0x17961a){return function(_0xe24787){if(_0xe24787){var _0x17d1d0=typeof _0x17961a[_0xaafc('0x1a')]===_0xaafc('0x1b')&&typeof _0x17961a[_0xaafc('0x1c')]==='undefined';var _0x4c9cd6=_0xe24787[_0xaafc('0x1d')];var _0x459363=_0x17d1d0?0x0:_0x17961a[_0xaafc('0x1a')];var _0x40b404=_0x17d1d0?_0xe24787[_0xaafc('0x1d')]:_0x17961a[_0xaafc('0x1a')]+_0x17961a[_0xaafc('0x1c')];var _0x1cd542;if(_0x40b404>=_0x4c9cd6){_0x40b404=_0x4c9cd6;_0x1cd542=0xc8;}else{_0x1cd542=0xce;}_0x196f41[_0xaafc('0x18')](_0x1cd542);return _0x196f41[_0xaafc('0x1e')](_0xaafc('0x1f'),_0x459363+'-'+_0x40b404+'/'+_0x4c9cd6)['json'](_0xe24787);}return null;};}function patchUpdates(_0x76a47f){return function(_0x27564b){try{jsonpatch[_0xaafc('0x20')](_0x27564b,_0x76a47f,!![]);}catch(_0xa3c9cd){return BPromise[_0xaafc('0x21')](_0xa3c9cd);}return _0x27564b['save']();};}function saveUpdates(_0x3aad7a,_0x158faa){return function(_0x153481){if(_0x153481){return _0x153481[_0xaafc('0x22')](_0x3aad7a)[_0xaafc('0x23')](function(_0x5d868a){return _0x5d868a;});}return null;};}function removeEntity(_0x2dc5b3,_0x2693a4){return function(_0x4c8424){if(_0x4c8424){return _0x4c8424[_0xaafc('0x24')]()['then'](function(){_0x2dc5b3[_0xaafc('0x18')](0xcc)[_0xaafc('0x19')]();});}};}function handleEntityNotFound(_0x2bb586,_0x174606){return function(_0xe37cb8){if(!_0xe37cb8){_0x2bb586[_0xaafc('0x25')](0x194);}return _0xe37cb8;};}function handleError(_0x4abaab,_0x17071c){_0x17071c=_0x17071c||0x1f4;return function(_0x1e82bf){logger[_0xaafc('0x26')](_0x1e82bf[_0xaafc('0x27')]);if(_0x1e82bf['name']){delete _0x1e82bf[_0xaafc('0x28')];}_0x4abaab[_0xaafc('0x18')](_0x17071c)['send'](_0x1e82bf);};}exports[_0xaafc('0x29')]=function(_0x311886,_0x143c0b){var _0x1cff38={},_0x540be9={},_0x28ce7a={'count':0x0,'rows':[]};var _0xb1dc81=_['map'](db[_0xaafc('0x2a')][_0xaafc('0x2b')],function(_0x4c0c54){return{'name':_0x4c0c54['fieldName'],'type':_0x4c0c54[_0xaafc('0x2c')][_0xaafc('0x2d')]};});_0x540be9[_0xaafc('0x2e')]=_[_0xaafc('0x2f')](_[_0xaafc('0x30')](_0xb1dc81,_0xaafc('0x28')),['name']);_0x540be9[_0xaafc('0x31')]=_[_0xaafc('0x32')](_0x311886[_0xaafc('0x31')]);_0x540be9['filters']=_['intersection'](_0x540be9[_0xaafc('0x2e')],_0x540be9[_0xaafc('0x31')]);_0x1cff38[_0xaafc('0x33')]=_[_0xaafc('0x34')](_0x540be9[_0xaafc('0x2e')],qs[_0xaafc('0x35')](_0x311886['query'][_0xaafc('0x35')]));_0x1cff38['attributes']=_0x1cff38[_0xaafc('0x33')][_0xaafc('0x36')]?_0x1cff38[_0xaafc('0x33')]:_0x540be9[_0xaafc('0x2e')];if(!_0x311886['query'][_0xaafc('0x37')]('nolimit')){_0x1cff38[_0xaafc('0x1c')]=qs['limit'](_0x311886[_0xaafc('0x31')][_0xaafc('0x1c')]);_0x1cff38[_0xaafc('0x1a')]=qs[_0xaafc('0x1a')](_0x311886[_0xaafc('0x31')][_0xaafc('0x1a')]);}_0x1cff38['order']=qs[_0xaafc('0x38')](_0x311886[_0xaafc('0x31')][_0xaafc('0x38')]);_0x1cff38[_0xaafc('0x39')]=qs[_0xaafc('0x3a')](_[_0xaafc('0x3b')](_0x311886['query'],_0x540be9[_0xaafc('0x3a')]),_0xb1dc81);if(_0x311886[_0xaafc('0x31')][_0xaafc('0x3c')]){_0x1cff38[_0xaafc('0x39')]=_[_0xaafc('0x3d')](_0x1cff38[_0xaafc('0x39')],{'$or':_[_0xaafc('0x30')](_0xb1dc81,function(_0x59e23f){if(_0x59e23f[_0xaafc('0x2c')]!==_0xaafc('0x3e')){var _0x1351b1={};_0x1351b1[_0x59e23f['name']]={'$like':'%'+_0x311886[_0xaafc('0x31')]['filter']+'%'};return _0x1351b1;}})});}_0x1cff38=_[_0xaafc('0x3d')]({},_0x1cff38,_0x311886[_0xaafc('0x3f')]);var _0x1843c0={'where':_0x1cff38['where']};return db[_0xaafc('0x2a')][_0xaafc('0x1d')](_0x1843c0)[_0xaafc('0x23')](function(_0x27265d){_0x28ce7a[_0xaafc('0x1d')]=_0x27265d;if(_0x311886[_0xaafc('0x31')][_0xaafc('0x40')]){_0x1cff38['include']=[{'all':!![]}];}return db[_0xaafc('0x2a')]['findAll'](_0x1cff38);})[_0xaafc('0x23')](function(_0x13c50e){_0x28ce7a['rows']=_0x13c50e;return _0x28ce7a;})[_0xaafc('0x23')](respondWithFilteredResult(_0x143c0b,_0x1cff38))[_0xaafc('0x41')](handleError(_0x143c0b,null));};exports['show']=function(_0x5f01f5,_0x24b640){var _0x37565f={'raw':!![],'where':{'id':_0x5f01f5[_0xaafc('0x42')]['id']}},_0x26058a={};_0x26058a[_0xaafc('0x2e')]=_[_0xaafc('0x32')](db[_0xaafc('0x2a')][_0xaafc('0x2b')]);_0x26058a[_0xaafc('0x31')]=_['keys'](_0x5f01f5[_0xaafc('0x31')]);_0x26058a[_0xaafc('0x3a')]=_[_0xaafc('0x34')](_0x26058a['model'],_0x26058a[_0xaafc('0x31')]);_0x37565f[_0xaafc('0x33')]=_[_0xaafc('0x34')](_0x26058a[_0xaafc('0x2e')],qs[_0xaafc('0x35')](_0x5f01f5['query'][_0xaafc('0x35')]));_0x37565f[_0xaafc('0x33')]=_0x37565f[_0xaafc('0x33')][_0xaafc('0x36')]?_0x37565f[_0xaafc('0x33')]:_0x26058a['model'];if(_0x5f01f5[_0xaafc('0x31')]['includeAll']){_0x37565f[_0xaafc('0x43')]=[{'all':!![]}];}_0x37565f=_['merge']({},_0x37565f,_0x5f01f5[_0xaafc('0x3f')]);return db['VoiceMailMessage'][_0xaafc('0x44')](_0x37565f)[_0xaafc('0x23')](handleEntityNotFound(_0x24b640,null))[_0xaafc('0x23')](respondWithResult(_0x24b640,null))[_0xaafc('0x41')](handleError(_0x24b640,null));};exports[_0xaafc('0x45')]=function(_0x3b2ee8,_0x29b63d){return db['VoiceMailMessage'][_0xaafc('0x45')](_0x3b2ee8[_0xaafc('0x46')],{})[_0xaafc('0x23')](respondWithResult(_0x29b63d,0xc9))['catch'](handleError(_0x29b63d,null));};exports[_0xaafc('0x22')]=function(_0x186efb,_0x4f0c91){if(_0x186efb['body']['id']){delete _0x186efb[_0xaafc('0x46')]['id'];}return db['VoiceMailMessage'][_0xaafc('0x44')]({'where':{'id':_0x186efb['params']['id']}})[_0xaafc('0x23')](handleEntityNotFound(_0x4f0c91,null))[_0xaafc('0x23')](saveUpdates(_0x186efb[_0xaafc('0x46')],null))['then'](respondWithResult(_0x4f0c91,null))[_0xaafc('0x41')](handleError(_0x4f0c91,null));};exports[_0xaafc('0x24')]=function(_0x3d7cbf,_0x5c238a){return db[_0xaafc('0x2a')][_0xaafc('0x44')]({'where':{'id':_0x3d7cbf[_0xaafc('0x42')]['id']}})[_0xaafc('0x23')](handleEntityNotFound(_0x5c238a,null))[_0xaafc('0x23')](removeEntity(_0x5c238a,null))['catch'](handleError(_0x5c238a,null));};exports[_0xaafc('0x47')]=function(_0x3516ed,_0x108668,_0x18d416){return db[_0xaafc('0x2a')][_0xaafc('0x44')]({'where':{'id':_0x3516ed[_0xaafc('0x42')]['id']},'attributes':['id',_0xaafc('0x48'),_0xaafc('0x49')]})[_0xaafc('0x23')](handleEntityNotFound(_0x108668,null))['then'](function(_0xa7ce08){if(_0xa7ce08){if(!_0xa7ce08[_0xaafc('0x48')]){throw new db[(_0xaafc('0x4a'))][(_0xaafc('0x4b'))](_0xaafc('0x4c'));}var _0x5e9ef6={'Content-Type':_0xaafc('0x4d'),'Content-Disposition':_0xaafc('0x4e')};if(_0xa7ce08[_0xaafc('0x49')]){_0x5e9ef6[_0xaafc('0x4f')]=_0xaafc('0x50')+_0xa7ce08[_0xaafc('0x49')]+_0xaafc('0x51');}_0x108668['set'](_0x5e9ef6);return _0x108668[_0xaafc('0x52')](new Buffer(_0xa7ce08[_0xaafc('0x48')]));}})[_0xaafc('0x41')](handleError(_0x108668,null));}; \ No newline at end of file +var _0x472d=['attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','VoiceMailMessage','includeAll','include','findAll','catch','show','find','create','body','params','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0xc9aa3,_0x44a629){var _0x4bf4e4=function(_0x265fb9){while(--_0x265fb9){_0xc9aa3['push'](_0xc9aa3['shift']());}};_0x4bf4e4(++_0x44a629);}(_0x472d,0xa8));var _0xd472=function(_0x19b4e7,_0x238f65){_0x19b4e7=_0x19b4e7-0x0;var _0x3030b3=_0x472d[_0x19b4e7];return _0x3030b3;};'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(_0xd472('0x0'));var moment=require(_0xd472('0x1'));var BPromise=require(_0xd472('0x2'));var Mustache=require(_0xd472('0x3'));var util=require(_0xd472('0x4'));var path=require(_0xd472('0x5'));var sox=require(_0xd472('0x6'));var csv=require('to-csv');var ejs=require(_0xd472('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd472('0x8'));var crypto=require(_0xd472('0x9'));var jsforce=require(_0xd472('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd472('0xb'));var querystring=require(_0xd472('0xc'));var Papa=require(_0xd472('0xd'));var Redis=require('ioredis');var authService=require(_0xd472('0xe'));var qs=require(_0xd472('0xf'));var as=require(_0xd472('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd472('0x11'))('api');var utils=require(_0xd472('0x12'));var config=require(_0xd472('0x13'));var licenseUtil=require(_0xd472('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53e93d,_0x26377e){_0x26377e=_0x26377e||0xcc;return function(_0x458766){if(_0x458766){return _0x53e93d[_0xd472('0x15')](_0x26377e);}return _0x53e93d['status'](_0x26377e)[_0xd472('0x16')]();};}function respondWithResult(_0x30d0dd,_0x3f315c){_0x3f315c=_0x3f315c||0xc8;return function(_0x2c2be9){if(_0x2c2be9){return _0x30d0dd[_0xd472('0x17')](_0x3f315c)['json'](_0x2c2be9);}};}function respondWithFilteredResult(_0x55a533,_0xc4df42){return function(_0xe3c51a){if(_0xe3c51a){var _0x51673b=typeof _0xc4df42[_0xd472('0x18')]===_0xd472('0x19')&&typeof _0xc4df42[_0xd472('0x1a')]===_0xd472('0x19');var _0x578017=_0xe3c51a[_0xd472('0x1b')];var _0x40a6ff=_0x51673b?0x0:_0xc4df42[_0xd472('0x18')];var _0x132a06=_0x51673b?_0xe3c51a[_0xd472('0x1b')]:_0xc4df42[_0xd472('0x18')]+_0xc4df42[_0xd472('0x1a')];var _0x41000d;if(_0x132a06>=_0x578017){_0x132a06=_0x578017;_0x41000d=0xc8;}else{_0x41000d=0xce;}_0x55a533[_0xd472('0x17')](_0x41000d);return _0x55a533['set'](_0xd472('0x1c'),_0x40a6ff+'-'+_0x132a06+'/'+_0x578017)['json'](_0xe3c51a);}return null;};}function patchUpdates(_0x31fa15){return function(_0x5bc4c7){try{jsonpatch[_0xd472('0x1d')](_0x5bc4c7,_0x31fa15,!![]);}catch(_0x41cc64){return BPromise['reject'](_0x41cc64);}return _0x5bc4c7[_0xd472('0x1e')]();};}function saveUpdates(_0x55103d,_0x82e49d){return function(_0x3485e9){if(_0x3485e9){return _0x3485e9[_0xd472('0x1f')](_0x55103d)[_0xd472('0x20')](function(_0x351f43){return _0x351f43;});}return null;};}function removeEntity(_0x588f08,_0x28d35c){return function(_0x474469){if(_0x474469){return _0x474469[_0xd472('0x21')]()[_0xd472('0x20')](function(){_0x588f08[_0xd472('0x17')](0xcc)[_0xd472('0x16')]();});}};}function handleEntityNotFound(_0x57e25e,_0x367127){return function(_0x5164ac){if(!_0x5164ac){_0x57e25e[_0xd472('0x15')](0x194);}return _0x5164ac;};}function handleError(_0x177cb5,_0x4ce797){_0x4ce797=_0x4ce797||0x1f4;return function(_0x2c4a44){logger['error'](_0x2c4a44[_0xd472('0x22')]);if(_0x2c4a44[_0xd472('0x23')]){delete _0x2c4a44['name'];}_0x177cb5['status'](_0x4ce797)[_0xd472('0x24')](_0x2c4a44);};}exports['index']=function(_0xe07774,_0x36066a){var _0x5286ef={},_0x17350a={},_0x46b379={'count':0x0,'rows':[]};var _0x5851f5=_[_0xd472('0x25')](db['VoiceMailMessage'][_0xd472('0x26')],function(_0xb02750){return{'name':_0xb02750[_0xd472('0x27')],'type':_0xb02750[_0xd472('0x28')]['key']};});_0x17350a[_0xd472('0x29')]=_[_0xd472('0x2a')](_[_0xd472('0x25')](_0x5851f5,'name'),['name']);_0x17350a['query']=_[_0xd472('0x2b')](_0xe07774[_0xd472('0x2c')]);_0x17350a[_0xd472('0x2d')]=_['intersection'](_0x17350a[_0xd472('0x29')],_0x17350a[_0xd472('0x2c')]);_0x5286ef[_0xd472('0x2e')]=_[_0xd472('0x2f')](_0x17350a[_0xd472('0x29')],qs[_0xd472('0x30')](_0xe07774[_0xd472('0x2c')]['fields']));_0x5286ef['attributes']=_0x5286ef[_0xd472('0x2e')][_0xd472('0x31')]?_0x5286ef[_0xd472('0x2e')]:_0x17350a[_0xd472('0x29')];if(!_0xe07774[_0xd472('0x2c')][_0xd472('0x32')](_0xd472('0x33'))){_0x5286ef[_0xd472('0x1a')]=qs[_0xd472('0x1a')](_0xe07774[_0xd472('0x2c')]['limit']);_0x5286ef['offset']=qs['offset'](_0xe07774[_0xd472('0x2c')][_0xd472('0x18')]);}_0x5286ef[_0xd472('0x34')]=qs['sort'](_0xe07774['query'][_0xd472('0x35')]);_0x5286ef['where']=qs[_0xd472('0x2d')](_[_0xd472('0x36')](_0xe07774[_0xd472('0x2c')],_0x17350a[_0xd472('0x2d')]),_0x5851f5);if(_0xe07774[_0xd472('0x2c')]['filter']){_0x5286ef[_0xd472('0x37')]=_['merge'](_0x5286ef[_0xd472('0x37')],{'$or':_['map'](_0x5851f5,function(_0x243e89){if(_0x243e89[_0xd472('0x28')]!==_0xd472('0x38')){var _0x31a5ab={};_0x31a5ab[_0x243e89[_0xd472('0x23')]]={'$like':'%'+_0xe07774[_0xd472('0x2c')][_0xd472('0x39')]+'%'};return _0x31a5ab;}})});}_0x5286ef=_[_0xd472('0x3a')]({},_0x5286ef,_0xe07774['options']);var _0x25db51={'where':_0x5286ef[_0xd472('0x37')]};return db[_0xd472('0x3b')]['count'](_0x25db51)['then'](function(_0x4e07ac){_0x46b379['count']=_0x4e07ac;if(_0xe07774['query'][_0xd472('0x3c')]){_0x5286ef[_0xd472('0x3d')]=[{'all':!![]}];}return db[_0xd472('0x3b')][_0xd472('0x3e')](_0x5286ef);})['then'](function(_0xcd3aa0){_0x46b379['rows']=_0xcd3aa0;return _0x46b379;})['then'](respondWithFilteredResult(_0x36066a,_0x5286ef))[_0xd472('0x3f')](handleError(_0x36066a,null));};exports[_0xd472('0x40')]=function(_0x567525,_0x5bed6f){var _0x32715d={'raw':!![],'where':{'id':_0x567525['params']['id']}},_0x448572={};_0x448572[_0xd472('0x29')]=_['keys'](db[_0xd472('0x3b')][_0xd472('0x26')]);_0x448572[_0xd472('0x2c')]=_['keys'](_0x567525['query']);_0x448572[_0xd472('0x2d')]=_['intersection'](_0x448572['model'],_0x448572[_0xd472('0x2c')]);_0x32715d[_0xd472('0x2e')]=_[_0xd472('0x2f')](_0x448572[_0xd472('0x29')],qs[_0xd472('0x30')](_0x567525[_0xd472('0x2c')][_0xd472('0x30')]));_0x32715d[_0xd472('0x2e')]=_0x32715d[_0xd472('0x2e')][_0xd472('0x31')]?_0x32715d['attributes']:_0x448572[_0xd472('0x29')];if(_0x567525[_0xd472('0x2c')]['includeAll']){_0x32715d[_0xd472('0x3d')]=[{'all':!![]}];}_0x32715d=_[_0xd472('0x3a')]({},_0x32715d,_0x567525['options']);return db[_0xd472('0x3b')][_0xd472('0x41')](_0x32715d)[_0xd472('0x20')](handleEntityNotFound(_0x5bed6f,null))['then'](respondWithResult(_0x5bed6f,null))['catch'](handleError(_0x5bed6f,null));};exports[_0xd472('0x42')]=function(_0x2321fb,_0x5e40b7){return db[_0xd472('0x3b')]['create'](_0x2321fb[_0xd472('0x43')],{})[_0xd472('0x20')](respondWithResult(_0x5e40b7,0xc9))['catch'](handleError(_0x5e40b7,null));};exports[_0xd472('0x1f')]=function(_0x3bf15a,_0x220923){if(_0x3bf15a[_0xd472('0x43')]['id']){delete _0x3bf15a[_0xd472('0x43')]['id'];}return db[_0xd472('0x3b')]['find']({'where':{'id':_0x3bf15a[_0xd472('0x44')]['id']}})['then'](handleEntityNotFound(_0x220923,null))[_0xd472('0x20')](saveUpdates(_0x3bf15a[_0xd472('0x43')],null))[_0xd472('0x20')](respondWithResult(_0x220923,null))[_0xd472('0x3f')](handleError(_0x220923,null));};exports[_0xd472('0x21')]=function(_0x46a515,_0x477335){return db[_0xd472('0x3b')]['find']({'where':{'id':_0x46a515[_0xd472('0x44')]['id']}})[_0xd472('0x20')](handleEntityNotFound(_0x477335,null))[_0xd472('0x20')](removeEntity(_0x477335,null))[_0xd472('0x3f')](handleError(_0x477335,null));};exports[_0xd472('0x45')]=function(_0x2265c1,_0x5f39ac,_0x609f62){return db['VoiceMailMessage']['find']({'where':{'id':_0x2265c1[_0xd472('0x44')]['id']},'attributes':['id',_0xd472('0x46'),'msg_id']})[_0xd472('0x20')](handleEntityNotFound(_0x5f39ac,null))['then'](function(_0x584a8a){if(_0x584a8a){if(!_0x584a8a[_0xd472('0x46')]){throw new db[(_0xd472('0x47'))][(_0xd472('0x48'))](_0xd472('0x49'));}var _0x4b6c8b={'Content-Type':_0xd472('0x4a'),'Content-Disposition':_0xd472('0x4b')};if(_0x584a8a[_0xd472('0x4c')]){_0x4b6c8b[_0xd472('0x4d')]=_0xd472('0x4e')+_0x584a8a[_0xd472('0x4c')]+_0xd472('0x4f');}_0x5f39ac[_0xd472('0x50')](_0x4b6c8b);return _0x5f39ac[_0xd472('0x24')](new Buffer(_0x584a8a['recording']));}})[_0xd472('0x3f')](handleError(_0x5f39ac,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6c4d848..f2d9bd7 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 _0xb26c=['rimraf','../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x453881,_0x2c2702){var _0xc4eba8=function(_0x5ae1e5){while(--_0x5ae1e5){_0x453881['push'](_0x453881['shift']());}};_0xc4eba8(++_0x2c2702);}(_0xb26c,0x1bf));var _0xcb26=function(_0x3b28fd,_0x5f4ad9){_0x3b28fd=_0x3b28fd-0x0;var _0xf00b1a=_0xb26c[_0x3b28fd];return _0xf00b1a;};'use strict';var _=require(_0xcb26('0x0'));var util=require(_0xcb26('0x1'));var logger=require(_0xcb26('0x2'))(_0xcb26('0x3'));var moment=require(_0xcb26('0x4'));var BPromise=require(_0xcb26('0x5'));var rp=require(_0xcb26('0x6'));var fs=require('fs');var path=require(_0xcb26('0x7'));var rimraf=require(_0xcb26('0x8'));var config=require(_0xcb26('0x9'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x376f0c,_0x1d7759){return _0x376f0c[_0xcb26('0xa')](_0xcb26('0xb'),attributes,{'tableName':_0xcb26('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x441b=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x441b,0x162));var _0xb441=function(_0x212855,_0x41e4ec){_0x212855=_0x212855-0x0;var _0x2059c0=_0x441b[_0x212855];return _0x2059c0;};'use strict';var _=require(_0xb441('0x0'));var util=require(_0xb441('0x1'));var logger=require('../../config/logger')(_0xb441('0x2'));var moment=require(_0xb441('0x3'));var BPromise=require(_0xb441('0x4'));var rp=require(_0xb441('0x5'));var fs=require('fs');var path=require(_0xb441('0x6'));var rimraf=require(_0xb441('0x7'));var config=require('../../config/environment');var attributes=require(_0xb441('0x8'));module[_0xb441('0x9')]=function(_0x3709bb,_0x2e0ee0){return _0x3709bb[_0xb441('0xa')](_0xb441('0xb'),attributes,{'tableName':_0xb441('0xc'),'paranoid':![],'indexes':[{'name':_0xb441('0xd'),'fields':[_0xb441('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 41179a0..abb1d69 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 _0x38a6=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x38a6,0x116));var _0x638a=function(_0x4d7d88,_0x434163){_0x4d7d88=_0x4d7d88-0x0;var _0x25da1e=_0x38a6[_0x4d7d88];return _0x25da1e;};'use strict';var _=require(_0x638a('0x0'));var util=require(_0x638a('0x1'));var moment=require(_0x638a('0x2'));var BPromise=require(_0x638a('0x3'));var rs=require(_0x638a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x638a('0x5'));var logger=require('../../config/logger')(_0x638a('0x6'));var config=require(_0x638a('0x7'));var jayson=require(_0x638a('0x8'));var client=jayson[_0x638a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a3c78,_0x499ad3,_0x59a65a){return new BPromise(function(_0x8b463,_0x49a060){return client[_0x638a('0xa')](_0x2a3c78,_0x59a65a)[_0x638a('0xb')](function(_0x50ae91){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x499ad3,_0x638a('0xc'));logger[_0x638a('0xd')](_0x638a('0xe'),_0x499ad3,_0x638a('0xc'),JSON[_0x638a('0xf')](_0x50ae91));if(_0x50ae91[_0x638a('0x10')]){if(_0x50ae91[_0x638a('0x10')][_0x638a('0x11')]===0x1f4){logger['error'](_0x638a('0x12'),_0x499ad3,_0x50ae91['error'][_0x638a('0x13')]);return _0x49a060(_0x50ae91[_0x638a('0x10')]['message']);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x499ad3,_0x50ae91[_0x638a('0x10')]['message']);return _0x8b463(_0x50ae91[_0x638a('0x10')]['message']);}else{logger[_0x638a('0x14')](_0x638a('0x12'),_0x499ad3,_0x638a('0xc'));_0x8b463(_0x50ae91[_0x638a('0x15')][_0x638a('0x13')]);}})[_0x638a('0x16')](function(_0x1559a9){logger[_0x638a('0x10')](_0x638a('0x12'),_0x499ad3,_0x1559a9);_0x49a060(_0x1559a9);});});} \ No newline at end of file +var _0xdfd5=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xde9724,_0x236bfc){var _0x28122e=function(_0x52a4be){while(--_0x52a4be){_0xde9724['push'](_0xde9724['shift']());}};_0x28122e(++_0x236bfc);}(_0xdfd5,0x17a));var _0x5dfd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfd5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5dfd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dfd('0x1'));var fs=require('fs');var Redis=require(_0x5dfd('0x2'));var db=require(_0x5dfd('0x3'))['db'];var utils=require(_0x5dfd('0x4'));var logger=require(_0x5dfd('0x5'))(_0x5dfd('0x6'));var config=require(_0x5dfd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dfd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1efbf2,_0x35e365,_0x528e13){return new BPromise(function(_0x408779,_0x582f4e){return client['request'](_0x1efbf2,_0x528e13)[_0x5dfd('0x9')](function(_0x4a9753){logger[_0x5dfd('0xa')](_0x5dfd('0xb'),_0x35e365,_0x5dfd('0xc'));logger[_0x5dfd('0xd')](_0x5dfd('0xe'),_0x35e365,_0x5dfd('0xc'),JSON[_0x5dfd('0xf')](_0x4a9753));if(_0x4a9753[_0x5dfd('0x10')]){if(_0x4a9753[_0x5dfd('0x10')][_0x5dfd('0x11')]===0x1f4){logger[_0x5dfd('0x10')](_0x5dfd('0xb'),_0x35e365,_0x4a9753[_0x5dfd('0x10')][_0x5dfd('0x12')]);return _0x582f4e(_0x4a9753[_0x5dfd('0x10')][_0x5dfd('0x12')]);}logger[_0x5dfd('0x10')](_0x5dfd('0xb'),_0x35e365,_0x4a9753[_0x5dfd('0x10')][_0x5dfd('0x12')]);return _0x408779(_0x4a9753[_0x5dfd('0x10')][_0x5dfd('0x12')]);}else{logger[_0x5dfd('0xa')](_0x5dfd('0xb'),_0x35e365,'request\x20sent');_0x408779(_0x4a9753[_0x5dfd('0x13')][_0x5dfd('0x12')]);}})[_0x5dfd('0x14')](function(_0x447035){logger[_0x5dfd('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x35e365,_0x447035);_0x582f4e(_0x447035);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 17c7b06..e8b5ac3 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 _0x5f5e=['destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','post','create','addSound','update','delete'];(function(_0x362e54,_0x437b93){var _0x4d36c1=function(_0x162824){while(--_0x162824){_0x362e54['push'](_0x362e54['shift']());}};_0x4d36c1(++_0x437b93);}(_0x5f5e,0x1e4));var _0xe5f5=function(_0xfeadd9,_0x39a3b0){_0xfeadd9=_0xfeadd9-0x0;var _0x26088b=_0x5f5e[_0xfeadd9];return _0x26088b;};'use strict';var multer=require('multer');var util=require(_0xe5f5('0x0'));var path=require('path');var timeout=require(_0xe5f5('0x1'));var express=require(_0xe5f5('0x2'));var router=express['Router']();var fs_extra=require(_0xe5f5('0x3'));var auth=require(_0xe5f5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe5f5('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0xe5f5('0x6')]('/',auth[_0xe5f5('0x7')](),controller[_0xe5f5('0x8')]);router[_0xe5f5('0x6')](_0xe5f5('0x9'),auth[_0xe5f5('0x7')](),controller['show']);router[_0xe5f5('0x6')](_0xe5f5('0xa'),auth['isAuthenticated'](),controller['getSounds']);router[_0xe5f5('0xb')]('/',auth[_0xe5f5('0x7')](),controller[_0xe5f5('0xc')]);router[_0xe5f5('0xb')](_0xe5f5('0xa'),auth['isAuthenticated'](),controller[_0xe5f5('0xd')]);router['put'](_0xe5f5('0x9'),auth[_0xe5f5('0x7')](),controller[_0xe5f5('0xe')]);router[_0xe5f5('0xf')](_0xe5f5('0x9'),auth['isAuthenticated'](),controller[_0xe5f5('0x10')]);router['delete'](_0xe5f5('0x11'),auth[_0xe5f5('0x7')](),controller[_0xe5f5('0x12')]);module[_0xe5f5('0x13')]=router; \ No newline at end of file +var _0x2562=['index','/:id','show','/:id/sounds','getSounds','post','addSound','update','delete','/:id/sounds/:id2','removeSound','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x491ded,_0x17abba){var _0x4ea2c9=function(_0x4013d3){while(--_0x4013d3){_0x491ded['push'](_0x491ded['shift']());}};_0x4ea2c9(++_0x17abba);}(_0x2562,0x1ef));var _0x2256=function(_0x24e9ca,_0x3e2c7f){_0x24e9ca=_0x24e9ca-0x0;var _0x3d4338=_0x2562[_0x24e9ca];return _0x3d4338;};'use strict';var multer=require(_0x2256('0x0'));var util=require('util');var path=require(_0x2256('0x1'));var timeout=require('connect-timeout');var express=require(_0x2256('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2256('0x3'));var interaction=require(_0x2256('0x4'));var config=require(_0x2256('0x5'));var controller=require(_0x2256('0x6'));router[_0x2256('0x7')]('/',auth[_0x2256('0x8')](),controller[_0x2256('0x9')]);router[_0x2256('0x7')](_0x2256('0xa'),auth[_0x2256('0x8')](),controller[_0x2256('0xb')]);router[_0x2256('0x7')](_0x2256('0xc'),auth[_0x2256('0x8')](),controller[_0x2256('0xd')]);router[_0x2256('0xe')]('/',auth[_0x2256('0x8')](),controller['create']);router[_0x2256('0xe')](_0x2256('0xc'),auth[_0x2256('0x8')](),controller[_0x2256('0xf')]);router['put'](_0x2256('0xa'),auth[_0x2256('0x8')](),controller[_0x2256('0x10')]);router[_0x2256('0x11')](_0x2256('0xa'),auth[_0x2256('0x8')](),controller['destroy']);router[_0x2256('0x11')](_0x2256('0x12'),auth['isAuthenticated'](),controller[_0x2256('0x13')]);module[_0x2256('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 a62c70b..f936ade 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 _0x788b=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x788b,0x179));var _0xb788=function(_0x28f51f,_0x7e340f){_0x28f51f=_0x28f51f-0x0;var _0x3762e9=_0x788b[_0x28f51f];return _0x3762e9;};'use strict';var Sequelize=require('sequelize');module[_0xb788('0x0')]={'name':{'type':Sequelize[_0xb788('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xb788('0x2')](_0xb788('0x3'),_0xb788('0x4'),_0xb788('0x5'),_0xb788('0x6'),_0xb788('0x7'),_0xb788('0x8')),'allowNull':!![],'defaultValue':_0xb788('0x4')},'directory':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![],'defaultValue':_0xb788('0x9')},'format':{'type':Sequelize[_0xb788('0x1')],'allowNull':!![]},'stamp':{'type':_0xb788('0xa')},'defaultEntry':{'type':Sequelize[_0xb788('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9cb4=['quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','mp3nb'];(function(_0x3433a2,_0x57ad59){var _0x12fd5e=function(_0x5184c9){while(--_0x5184c9){_0x3433a2['push'](_0x3433a2['shift']());}};_0x12fd5e(++_0x57ad59);}(_0x9cb4,0xe3));var _0x49cb=function(_0x3fd39e,_0x1a42ab){_0x3fd39e=_0x3fd39e-0x0;var _0x3d83a0=_0x9cb4[_0x3fd39e];return _0x3d83a0;};'use strict';var Sequelize=require(_0x49cb('0x0'));module[_0x49cb('0x1')]={'name':{'type':Sequelize[_0x49cb('0x2')],'allowNull':![],'unique':_0x49cb('0x3')},'mode':{'type':Sequelize[_0x49cb('0x4')](_0x49cb('0x5'),'files',_0x49cb('0x6'),_0x49cb('0x7'),_0x49cb('0x8'),_0x49cb('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x49cb('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x49cb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x49cb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x49cb('0x2')],'allowNull':!![],'defaultValue':_0x49cb('0xa')},'format':{'type':Sequelize[_0x49cb('0x2')],'allowNull':!![]},'stamp':{'type':_0x49cb('0xb')},'defaultEntry':{'type':Sequelize[_0x49cb('0xc')],'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 40d03cf..a9bd46c 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 _0x7a0b=['sequelize','transaction','directory','join','root','server/files/moh','mode','files','mkdirSync','0777','role','user','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','unlinkSync','getSounds','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','keys','find','body'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a0b,0x114));var _0xb7a0=function(_0x2b7fb8,_0x55d77e){_0x2b7fb8=_0x2b7fb8-0x0;var _0x419e92=_0x7a0b[_0x2b7fb8];return _0x419e92;};'use strict';var emlformat=require(_0xb7a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7a0('0x1'));var jsonpatch=require(_0xb7a0('0x2'));var rp=require(_0xb7a0('0x3'));var moment=require(_0xb7a0('0x4'));var BPromise=require(_0xb7a0('0x5'));var Mustache=require(_0xb7a0('0x6'));var util=require(_0xb7a0('0x7'));var path=require(_0xb7a0('0x8'));var sox=require(_0xb7a0('0x9'));var csv=require(_0xb7a0('0xa'));var ejs=require(_0xb7a0('0xb'));var fs=require('fs');var fs_extra=require(_0xb7a0('0xc'));var _=require('lodash');var squel=require(_0xb7a0('0xd'));var crypto=require(_0xb7a0('0xe'));var jsforce=require(_0xb7a0('0xf'));var deskjs=require(_0xb7a0('0x10'));var toCsv=require(_0xb7a0('0xa'));var querystring=require(_0xb7a0('0x11'));var Papa=require(_0xb7a0('0x12'));var Redis=require(_0xb7a0('0x13'));var authService=require(_0xb7a0('0x14'));var qs=require(_0xb7a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7a0('0x16'));var logger=require('../../config/logger')(_0xb7a0('0x17'));var utils=require(_0xb7a0('0x18'));var config=require(_0xb7a0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7a0('0x1a'))['db'];function respondWithStatusCode(_0x29af82,_0x1c74a5){_0x1c74a5=_0x1c74a5||0xcc;return function(_0x3ec6da){if(_0x3ec6da){return _0x29af82[_0xb7a0('0x1b')](_0x1c74a5);}return _0x29af82[_0xb7a0('0x1c')](_0x1c74a5)[_0xb7a0('0x1d')]();};}function respondWithResult(_0x4381e0,_0x154299){_0x154299=_0x154299||0xc8;return function(_0x1e4120){if(_0x1e4120){return _0x4381e0[_0xb7a0('0x1c')](_0x154299)[_0xb7a0('0x1e')](_0x1e4120);}};}function respondWithFilteredResult(_0xc704c3,_0x599796){return function(_0x5e617b){if(_0x5e617b){var _0x172355=typeof _0x599796[_0xb7a0('0x1f')]===_0xb7a0('0x20')&&typeof _0x599796['limit']==='undefined';var _0x30cc1b=_0x5e617b['count'];var _0x2f341c=_0x172355?0x0:_0x599796[_0xb7a0('0x1f')];var _0x485ed9=_0x172355?_0x5e617b[_0xb7a0('0x21')]:_0x599796[_0xb7a0('0x1f')]+_0x599796[_0xb7a0('0x22')];var _0x15feda;if(_0x485ed9>=_0x30cc1b){_0x485ed9=_0x30cc1b;_0x15feda=0xc8;}else{_0x15feda=0xce;}_0xc704c3['status'](_0x15feda);return _0xc704c3[_0xb7a0('0x23')](_0xb7a0('0x24'),_0x2f341c+'-'+_0x485ed9+'/'+_0x30cc1b)[_0xb7a0('0x1e')](_0x5e617b);}return null;};}function patchUpdates(_0x2a0bac){return function(_0x201133){try{jsonpatch[_0xb7a0('0x25')](_0x201133,_0x2a0bac,!![]);}catch(_0x269bc1){return BPromise[_0xb7a0('0x26')](_0x269bc1);}return _0x201133[_0xb7a0('0x27')]();};}function saveUpdates(_0x325315,_0x470bd4){return function(_0x403de9){if(_0x403de9){return _0x403de9[_0xb7a0('0x28')](_0x325315)[_0xb7a0('0x29')](function(_0x3331c3){return _0x3331c3;});}return null;};}function removeEntity(_0x39b8ac,_0x1c735c){return function(_0x16f13d){if(_0x16f13d){return _0x16f13d[_0xb7a0('0x2a')]()[_0xb7a0('0x29')](function(){var _0x5348ef=_0x16f13d[_0xb7a0('0x2b')]({'plain':!![]});var _0x2ba8c7='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ba8c7,'resourceId':_0x5348ef['id']}})['then'](function(){return _0x16f13d;});})[_0xb7a0('0x29')](function(){_0x39b8ac[_0xb7a0('0x1c')](0xcc)[_0xb7a0('0x1d')]();});}};}function handleEntityNotFound(_0x4484ec,_0xd9b8c8){return function(_0x39492b){if(!_0x39492b){_0x4484ec['sendStatus'](0x194);}return _0x39492b;};}function handleError(_0x10e0ba,_0x5bac11){_0x5bac11=_0x5bac11||0x1f4;return function(_0x271598){logger[_0xb7a0('0x2c')](_0x271598[_0xb7a0('0x2d')]);if(_0x271598[_0xb7a0('0x2e')]){delete _0x271598['name'];}_0x10e0ba[_0xb7a0('0x1c')](_0x5bac11)[_0xb7a0('0x2f')](_0x271598);};}exports['index']=function(_0x15736b,_0x167d08){var _0x2b3780={},_0x355906={},_0x56cb6e={'count':0x0,'rows':[]};var _0x1800f9=_[_0xb7a0('0x30')](db[_0xb7a0('0x31')][_0xb7a0('0x32')],function(_0x53a05c){return{'name':_0x53a05c['fieldName'],'type':_0x53a05c[_0xb7a0('0x33')]['key']};});_0x355906['model']=_[_0xb7a0('0x30')](_0x1800f9,_0xb7a0('0x2e'));_0x355906['query']=_['keys'](_0x15736b[_0xb7a0('0x34')]);_0x355906[_0xb7a0('0x35')]=_[_0xb7a0('0x36')](_0x355906['model'],_0x355906[_0xb7a0('0x34')]);_0x2b3780['attributes']=_[_0xb7a0('0x36')](_0x355906['model'],qs['fields'](_0x15736b['query'][_0xb7a0('0x37')]));_0x2b3780[_0xb7a0('0x38')]=_0x2b3780[_0xb7a0('0x38')][_0xb7a0('0x39')]?_0x2b3780['attributes']:_0x355906['model'];if(!_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3a')](_0xb7a0('0x3b'))){_0x2b3780['limit']=qs[_0xb7a0('0x22')](_0x15736b[_0xb7a0('0x34')]['limit']);_0x2b3780[_0xb7a0('0x1f')]=qs[_0xb7a0('0x1f')](_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x1f')]);}_0x2b3780['order']=qs[_0xb7a0('0x3c')](_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3c')]);delete _0x15736b['query']['sort'];_0x2b3780[_0xb7a0('0x3d')]=qs[_0xb7a0('0x35')](_[_0xb7a0('0x3e')](_0x15736b[_0xb7a0('0x34')],_0x355906[_0xb7a0('0x35')]),_0x1800f9);if(_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3f')]){_0x2b3780[_0xb7a0('0x3d')]=_[_0xb7a0('0x40')](_0x2b3780[_0xb7a0('0x3d')],{'$or':_['map'](_0x1800f9,function(_0x4484df){if(_0x4484df[_0xb7a0('0x33')]!==_0xb7a0('0x41')){var _0xc5bcf4={};_0xc5bcf4[_0x4484df[_0xb7a0('0x2e')]]={'$like':'%'+_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x3f')]+'%'};return _0xc5bcf4;}})});}_0x2b3780=_['merge']({},_0x2b3780,_0x15736b[_0xb7a0('0x42')]);var _0x68cdfa={'where':_0x2b3780[_0xb7a0('0x3d')]};return db['VoiceMusicOnHold']['count'](_0x68cdfa)[_0xb7a0('0x29')](function(_0x146d5c){_0x56cb6e[_0xb7a0('0x21')]=_0x146d5c;if(_0x15736b[_0xb7a0('0x34')][_0xb7a0('0x43')]){_0x2b3780[_0xb7a0('0x44')]=[{'all':!![]}];}return db[_0xb7a0('0x31')][_0xb7a0('0x45')](_0x2b3780);})[_0xb7a0('0x29')](function(_0x3f16d4){_0x56cb6e[_0xb7a0('0x46')]=_0x3f16d4;return _0x56cb6e;})[_0xb7a0('0x29')](respondWithFilteredResult(_0x167d08,_0x2b3780))[_0xb7a0('0x47')](handleError(_0x167d08,null));};exports[_0xb7a0('0x48')]=function(_0x38f1b6,_0x3aa724){var _0x1ef321={'raw':![],'where':{'id':_0x38f1b6[_0xb7a0('0x49')]['id']}},_0x13ddae={};_0x13ddae[_0xb7a0('0x4a')]=_[_0xb7a0('0x4b')](db['VoiceMusicOnHold']['rawAttributes']);_0x13ddae[_0xb7a0('0x34')]=_[_0xb7a0('0x4b')](_0x38f1b6[_0xb7a0('0x34')]);_0x13ddae[_0xb7a0('0x35')]=_['intersection'](_0x13ddae[_0xb7a0('0x4a')],_0x13ddae[_0xb7a0('0x34')]);_0x1ef321[_0xb7a0('0x38')]=_['intersection'](_0x13ddae[_0xb7a0('0x4a')],qs[_0xb7a0('0x37')](_0x38f1b6[_0xb7a0('0x34')][_0xb7a0('0x37')]));_0x1ef321['attributes']=_0x1ef321['attributes'][_0xb7a0('0x39')]?_0x1ef321[_0xb7a0('0x38')]:_0x13ddae['model'];if(_0x38f1b6['query']['includeAll']){_0x1ef321[_0xb7a0('0x44')]=[{'all':!![]}];}_0x1ef321=_[_0xb7a0('0x40')]({},_0x1ef321,_0x38f1b6[_0xb7a0('0x42')]);return db['VoiceMusicOnHold'][_0xb7a0('0x4c')](_0x1ef321)[_0xb7a0('0x29')](handleEntityNotFound(_0x3aa724,null))[_0xb7a0('0x29')](respondWithResult(_0x3aa724,null))[_0xb7a0('0x47')](handleError(_0x3aa724,null));};exports[_0xb7a0('0x28')]=function(_0x2dbee5,_0x12d44e){if(_0x2dbee5[_0xb7a0('0x4d')]['id']){delete _0x2dbee5[_0xb7a0('0x4d')]['id'];}return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x2dbee5[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](handleEntityNotFound(_0x12d44e,null))[_0xb7a0('0x29')](saveUpdates(_0x2dbee5[_0xb7a0('0x4d')],null))[_0xb7a0('0x29')](respondWithResult(_0x12d44e,null))[_0xb7a0('0x47')](handleError(_0x12d44e,null));};exports['create']=function(_0x14b802,_0x1afc76,_0x42ef4e){return db[_0xb7a0('0x4e')][_0xb7a0('0x4f')](function(_0x4e2d32){if(_0x14b802[_0xb7a0('0x4d')]['mode']==='files'){_0x14b802[_0xb7a0('0x4d')][_0xb7a0('0x50')]=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],_0xb7a0('0x53'),_0x14b802['body'][_0xb7a0('0x2e')]);}return db[_0xb7a0('0x31')]['create'](_0x14b802[_0xb7a0('0x4d')],{'transaction':_0x4e2d32})['then'](function(_0x162107){if(_0x14b802[_0xb7a0('0x4d')][_0xb7a0('0x54')]===_0xb7a0('0x55')){fs[_0xb7a0('0x56')](_0x162107[_0xb7a0('0x50')],parseInt(_0xb7a0('0x57'),0x8));}var _0x21a7fe=_0x14b802['user'][_0xb7a0('0x2b')]({'plain':!![]});if(!_0x21a7fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21a7fe[_0xb7a0('0x58')]===_0xb7a0('0x59')){var _0x2eba90=_0x162107[_0xb7a0('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0xb7a0('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x21a7fe[_0xb7a0('0x5a')]},'raw':!![]})[_0xb7a0('0x29')](function(_0x3eb2ff){if(_0x3eb2ff&&_0x3eb2ff[_0xb7a0('0x5b')]===0x0){return db[_0xb7a0('0x5c')][_0xb7a0('0x5d')]({'name':_0x2eba90['name'],'resourceId':_0x2eba90['id'],'type':_0x3eb2ff['name'],'sectionId':_0x3eb2ff['id']},{})[_0xb7a0('0x29')](function(){return _0x162107;});}else{return _0x162107;}})[_0xb7a0('0x47')](function(_0x1c8e26){logger['error'](_0xb7a0('0x5e'),_0x1c8e26);});}return _0x162107;});})[_0xb7a0('0x29')](respondWithResult(_0x1afc76,0xc9))[_0xb7a0('0x47')](handleError(_0x1afc76,null));};exports['destroy']=function(_0x33d59d,_0x1a81a5,_0x5bdffa){var _0x476c04;return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x33d59d[_0xb7a0('0x49')]['id']}})['then'](function(_0x48b0ba){if(_0x48b0ba){return db[_0xb7a0('0x4e')]['transaction'](function(_0x826e07){return _0x48b0ba[_0xb7a0('0x2a')]({'transaction':_0x826e07,'raw':!![]})[_0xb7a0('0x29')](function(_0x2d8355){if(_0x2d8355['directory']){fs[_0xb7a0('0x5f')](_0x2d8355[_0xb7a0('0x50')])[_0xb7a0('0x60')](function(_0x39785d){fs['unlinkSync'](path[_0xb7a0('0x51')](_0x2d8355[_0xb7a0('0x50')],_0x39785d));});fs[_0xb7a0('0x61')](_0x2d8355[_0xb7a0('0x50')]);}return _0x2d8355;});})[_0xb7a0('0x47')](function(_0x3ecd8b){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x3ecd8b[_0xb7a0('0x64')]);});}})['then'](handleEntityNotFound(_0x1a81a5,null))[_0xb7a0('0x29')](removeEntity(_0x1a81a5,null))[_0xb7a0('0x47')](handleError(_0x1a81a5,null));};exports[_0xb7a0('0x65')]=function(_0x58c96b,_0x1937d3,_0x4db5e6){return db[_0xb7a0('0x4e')][_0xb7a0('0x4f')](function(_0x42a2f6){var _0x102083;return db[_0xb7a0('0x31')][_0xb7a0('0x4c')]({'where':{'id':_0x58c96b[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](function(_0x14d031){if(_0x14d031){_0x102083=_0x14d031;return _0x14d031['addSound'](_0x58c96b['body']['id'],{'transaction':_0x42a2f6});}})[_0xb7a0('0x29')](function(_0xe3896c){if(_0xe3896c){return db[_0xb7a0('0x66')][_0xb7a0('0x67')]({'where':{'id':_0x58c96b['body']['id']},'attributes':['id',_0xb7a0('0x2e'),_0xb7a0('0x68'),_0xb7a0('0x69'),_0xb7a0('0x6a')],'raw':!![]});}})[_0xb7a0('0x29')](function(_0x38d1b0){if(_0x38d1b0){var _0x5beeb3=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],_0xb7a0('0x6b'),util[_0xb7a0('0x6c')](_0xb7a0('0x6d'),path[_0xb7a0('0x6e')](_0x38d1b0[_0xb7a0('0x68')],path[_0xb7a0('0x6f')](_0x38d1b0['save_name'])),_0x38d1b0[_0xb7a0('0x69')]));var _0x1706ff=path[_0xb7a0('0x51')](config[_0xb7a0('0x52')],'server/files/moh',_0x102083[_0xb7a0('0x2e')],util['format'](_0xb7a0('0x6d'),_0x38d1b0[_0xb7a0('0x2e')],_0x38d1b0['converted_format']));fs[_0xb7a0('0x70')](_0x5beeb3,_0x1706ff);return _0x38d1b0;}})[_0xb7a0('0x47')](function(_0x211c6d){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x211c6d[_0xb7a0('0x64')]);});})[_0xb7a0('0x29')](handleEntityNotFound(_0x1937d3,null))[_0xb7a0('0x29')](respondWithResult(_0x1937d3,0xc9))[_0xb7a0('0x47')](handleError(_0x1937d3,null));};exports['removeSound']=function(_0x591a27,_0xb31e98,_0x3370ed){return db['sequelize'][_0xb7a0('0x4f')](function(_0x6b17b1){var _0x218021;return db[_0xb7a0('0x31')]['findOne']({'where':{'id':_0x591a27['params']['id']}})['then'](handleEntityNotFound(_0xb31e98,null))['then'](function(_0x3ab685){if(_0x3ab685){_0x218021=_0x3ab685;return _0x3ab685[_0xb7a0('0x71')](_0x591a27[_0xb7a0('0x49')][_0xb7a0('0x72')]);}})['then'](function(_0x443a78){if(_0x443a78){return db[_0xb7a0('0x66')][_0xb7a0('0x67')]({'where':{'id':_0x591a27[_0xb7a0('0x49')][_0xb7a0('0x72')]},'attributes':['id',_0xb7a0('0x2e'),_0xb7a0('0x68'),_0xb7a0('0x69'),_0xb7a0('0x6a')],'raw':!![]});}})[_0xb7a0('0x29')](function(_0x5604ec){if(_0x5604ec){fs[_0xb7a0('0x73')](path[_0xb7a0('0x51')](_0x218021[_0xb7a0('0x50')],util[_0xb7a0('0x6c')]('%s.%s',_0x5604ec[_0xb7a0('0x2e')],_0x5604ec[_0xb7a0('0x69')])));return _0x5604ec;}})['catch'](function(_0x2ebe40){throw new db[(_0xb7a0('0x62'))][(_0xb7a0('0x63'))](_0x2ebe40[_0xb7a0('0x64')]);});})[_0xb7a0('0x29')](handleEntityNotFound(_0xb31e98,null))[_0xb7a0('0x29')](respondWithStatusCode(_0xb31e98,0xcc))['catch'](handleError(_0xb31e98,null));};exports[_0xb7a0('0x74')]=function(_0x4630f3,_0x316e85,_0x35db89){var _0x249c34={};var _0x192125={};var _0x2c9335;var _0x7c1f86;return db[_0xb7a0('0x31')][_0xb7a0('0x67')]({'where':{'id':_0x4630f3[_0xb7a0('0x49')]['id']}})[_0xb7a0('0x29')](handleEntityNotFound(_0x316e85,null))['then'](function(_0x458bbb){if(_0x458bbb){_0x2c9335=_0x458bbb;_0x192125[_0xb7a0('0x4a')]=_[_0xb7a0('0x4b')](db[_0xb7a0('0x66')]['rawAttributes']);_0x192125[_0xb7a0('0x34')]=_['keys'](_0x4630f3[_0xb7a0('0x34')]);_0x192125[_0xb7a0('0x35')]=_[_0xb7a0('0x36')](_0x192125[_0xb7a0('0x4a')],_0x192125[_0xb7a0('0x34')]);_0x249c34['attributes']=_[_0xb7a0('0x36')](_0x192125['model'],qs[_0xb7a0('0x37')](_0x4630f3[_0xb7a0('0x34')]['fields']));_0x249c34[_0xb7a0('0x38')]=_0x249c34[_0xb7a0('0x38')][_0xb7a0('0x39')]?_0x249c34[_0xb7a0('0x38')]:_0x192125[_0xb7a0('0x4a')];_0x249c34[_0xb7a0('0x75')]=qs[_0xb7a0('0x3c')](_0x4630f3[_0xb7a0('0x34')]['sort']);_0x249c34[_0xb7a0('0x3d')]=qs[_0xb7a0('0x35')](_['pick'](_0x4630f3['query'],_0x192125['filters']));if(_0x4630f3[_0xb7a0('0x34')][_0xb7a0('0x3f')]){_0x249c34[_0xb7a0('0x3d')]=_[_0xb7a0('0x40')](_0x249c34[_0xb7a0('0x3d')],{'$or':_[_0xb7a0('0x30')](_0x249c34[_0xb7a0('0x38')],function(_0x2ae505){var _0x3094bc={};_0x3094bc[_0x2ae505]={'$like':'%'+_0x4630f3['query'][_0xb7a0('0x3f')]+'%'};return _0x3094bc;})});}_0x249c34=_[_0xb7a0('0x40')]({},_0x249c34,_0x4630f3[_0xb7a0('0x42')]);return _0x2c9335[_0xb7a0('0x74')](_0x249c34);}})[_0xb7a0('0x29')](function(_0x91a052){if(_0x91a052){_0x7c1f86=_0x91a052['length'];if(!_0x4630f3[_0xb7a0('0x34')][_0xb7a0('0x3a')]('nolimit')){_0x249c34[_0xb7a0('0x22')]=qs['limit'](_0x4630f3[_0xb7a0('0x34')]['limit']);_0x249c34[_0xb7a0('0x1f')]=qs[_0xb7a0('0x1f')](_0x4630f3['query'][_0xb7a0('0x1f')]);}return _0x2c9335[_0xb7a0('0x74')](_0x249c34);}})['then'](function(_0x1471f2){if(_0x1471f2){return _0x1471f2?{'count':_0x7c1f86,'rows':_0x1471f2}:null;}})['then'](respondWithResult(_0x316e85,null))[_0xb7a0('0x47')](handleError(_0x316e85,null));}; \ No newline at end of file +var _0xc385=['UserProfileSection','MusicOnHolds','userProfileId','readdirSync','unlinkSync','join','Sequelize','ValidationError','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','message','removeSound','id2','getSounds','length','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','VoiceMusicOnHold','includeAll','findAll','rows','catch','show','params','include','update','body','find','sequelize','transaction','mode','root','server/files/moh','create','files','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x38b4f1,_0x3d7d52){var _0x322454=function(_0x236800){while(--_0x236800){_0x38b4f1['push'](_0x38b4f1['shift']());}};_0x322454(++_0x3d7d52);}(_0xc385,0xf8));var _0x5c38=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc385[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c38('0x0'));var zipdir=require(_0x5c38('0x1'));var jsonpatch=require(_0x5c38('0x2'));var rp=require(_0x5c38('0x3'));var moment=require(_0x5c38('0x4'));var BPromise=require(_0x5c38('0x5'));var Mustache=require(_0x5c38('0x6'));var util=require(_0x5c38('0x7'));var path=require(_0x5c38('0x8'));var sox=require(_0x5c38('0x9'));var csv=require(_0x5c38('0xa'));var ejs=require(_0x5c38('0xb'));var fs=require('fs');var fs_extra=require(_0x5c38('0xc'));var _=require(_0x5c38('0xd'));var squel=require(_0x5c38('0xe'));var crypto=require(_0x5c38('0xf'));var jsforce=require(_0x5c38('0x10'));var deskjs=require(_0x5c38('0x11'));var toCsv=require(_0x5c38('0xa'));var querystring=require(_0x5c38('0x12'));var Papa=require(_0x5c38('0x13'));var Redis=require(_0x5c38('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5c38('0x15'));var as=require(_0x5c38('0x16'));var hardwareService=require(_0x5c38('0x17'));var logger=require(_0x5c38('0x18'))(_0x5c38('0x19'));var utils=require(_0x5c38('0x1a'));var config=require(_0x5c38('0x1b'));var licenseUtil=require(_0x5c38('0x1c'));var db=require(_0x5c38('0x1d'))['db'];function respondWithStatusCode(_0x3803eb,_0x88b942){_0x88b942=_0x88b942||0xcc;return function(_0xd436a8){if(_0xd436a8){return _0x3803eb[_0x5c38('0x1e')](_0x88b942);}return _0x3803eb[_0x5c38('0x1f')](_0x88b942)[_0x5c38('0x20')]();};}function respondWithResult(_0x4e1e3e,_0x5e3d6e){_0x5e3d6e=_0x5e3d6e||0xc8;return function(_0x5d2100){if(_0x5d2100){return _0x4e1e3e[_0x5c38('0x1f')](_0x5e3d6e)['json'](_0x5d2100);}};}function respondWithFilteredResult(_0x281def,_0x4cbe21){return function(_0xd0d7c4){if(_0xd0d7c4){var _0x63e315=typeof _0x4cbe21[_0x5c38('0x21')]===_0x5c38('0x22')&&typeof _0x4cbe21[_0x5c38('0x23')]===_0x5c38('0x22');var _0x21da72=_0xd0d7c4[_0x5c38('0x24')];var _0x59112a=_0x63e315?0x0:_0x4cbe21[_0x5c38('0x21')];var _0x361300=_0x63e315?_0xd0d7c4['count']:_0x4cbe21[_0x5c38('0x21')]+_0x4cbe21[_0x5c38('0x23')];var _0x35aa2a;if(_0x361300>=_0x21da72){_0x361300=_0x21da72;_0x35aa2a=0xc8;}else{_0x35aa2a=0xce;}_0x281def[_0x5c38('0x1f')](_0x35aa2a);return _0x281def['set'](_0x5c38('0x25'),_0x59112a+'-'+_0x361300+'/'+_0x21da72)['json'](_0xd0d7c4);}return null;};}function patchUpdates(_0x6f1860){return function(_0x2dba63){try{jsonpatch[_0x5c38('0x26')](_0x2dba63,_0x6f1860,!![]);}catch(_0x47da56){return BPromise[_0x5c38('0x27')](_0x47da56);}return _0x2dba63['save']();};}function saveUpdates(_0x3dd160,_0x4d4568){return function(_0x59e086){if(_0x59e086){return _0x59e086['update'](_0x3dd160)[_0x5c38('0x28')](function(_0x33b925){return _0x33b925;});}return null;};}function removeEntity(_0x3cc5e5,_0x5d3a1d){return function(_0x15aa21){if(_0x15aa21){return _0x15aa21['destroy']()[_0x5c38('0x28')](function(){var _0x2f7828=_0x15aa21[_0x5c38('0x29')]({'plain':!![]});var _0x23bdf7='MusicOnHolds';return db[_0x5c38('0x2a')][_0x5c38('0x2b')]({'where':{'type':_0x23bdf7,'resourceId':_0x2f7828['id']}})[_0x5c38('0x28')](function(){return _0x15aa21;});})[_0x5c38('0x28')](function(){_0x3cc5e5[_0x5c38('0x1f')](0xcc)[_0x5c38('0x20')]();});}};}function handleEntityNotFound(_0x7d2a38,_0x1ef56d){return function(_0x431888){if(!_0x431888){_0x7d2a38['sendStatus'](0x194);}return _0x431888;};}function handleError(_0x782bcf,_0x44fe50){_0x44fe50=_0x44fe50||0x1f4;return function(_0x985c6){logger[_0x5c38('0x2c')](_0x985c6['stack']);if(_0x985c6[_0x5c38('0x2d')]){delete _0x985c6['name'];}_0x782bcf['status'](_0x44fe50)[_0x5c38('0x2e')](_0x985c6);};}exports['index']=function(_0x5d02fe,_0x2ecfee){var _0x110f0e={},_0x15bae2={},_0x3cf53d={'count':0x0,'rows':[]};var _0x4b5b09=_[_0x5c38('0x2f')](db['VoiceMusicOnHold'][_0x5c38('0x30')],function(_0x2679ca){return{'name':_0x2679ca[_0x5c38('0x31')],'type':_0x2679ca['type']['key']};});_0x15bae2[_0x5c38('0x32')]=_[_0x5c38('0x2f')](_0x4b5b09,_0x5c38('0x2d'));_0x15bae2[_0x5c38('0x33')]=_[_0x5c38('0x34')](_0x5d02fe['query']);_0x15bae2[_0x5c38('0x35')]=_[_0x5c38('0x36')](_0x15bae2['model'],_0x15bae2[_0x5c38('0x33')]);_0x110f0e['attributes']=_[_0x5c38('0x36')](_0x15bae2[_0x5c38('0x32')],qs[_0x5c38('0x37')](_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x37')]));_0x110f0e[_0x5c38('0x38')]=_0x110f0e[_0x5c38('0x38')]['length']?_0x110f0e[_0x5c38('0x38')]:_0x15bae2['model'];if(!_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x39')](_0x5c38('0x3a'))){_0x110f0e['limit']=qs['limit'](_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x23')]);_0x110f0e[_0x5c38('0x21')]=qs[_0x5c38('0x21')](_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x21')]);}_0x110f0e[_0x5c38('0x3b')]=qs['sort'](_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x3c')]);delete _0x5d02fe['query'][_0x5c38('0x3c')];_0x110f0e[_0x5c38('0x3d')]=qs[_0x5c38('0x35')](_[_0x5c38('0x3e')](_0x5d02fe[_0x5c38('0x33')],_0x15bae2[_0x5c38('0x35')]),_0x4b5b09);if(_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x3f')]){_0x110f0e[_0x5c38('0x3d')]=_['merge'](_0x110f0e[_0x5c38('0x3d')],{'$or':_['map'](_0x4b5b09,function(_0x13f0b1){if(_0x13f0b1[_0x5c38('0x40')]!=='VIRTUAL'){var _0x2a3d92={};_0x2a3d92[_0x13f0b1[_0x5c38('0x2d')]]={'$like':'%'+_0x5d02fe[_0x5c38('0x33')]['filter']+'%'};return _0x2a3d92;}})});}_0x110f0e=_[_0x5c38('0x41')]({},_0x110f0e,_0x5d02fe[_0x5c38('0x42')]);var _0x29a3a4={'where':_0x110f0e[_0x5c38('0x3d')]};return db[_0x5c38('0x43')][_0x5c38('0x24')](_0x29a3a4)[_0x5c38('0x28')](function(_0x406bb7){_0x3cf53d[_0x5c38('0x24')]=_0x406bb7;if(_0x5d02fe[_0x5c38('0x33')][_0x5c38('0x44')]){_0x110f0e['include']=[{'all':!![]}];}return db[_0x5c38('0x43')][_0x5c38('0x45')](_0x110f0e);})[_0x5c38('0x28')](function(_0x2bddeb){_0x3cf53d[_0x5c38('0x46')]=_0x2bddeb;return _0x3cf53d;})[_0x5c38('0x28')](respondWithFilteredResult(_0x2ecfee,_0x110f0e))[_0x5c38('0x47')](handleError(_0x2ecfee,null));};exports[_0x5c38('0x48')]=function(_0x452a1f,_0x3f977b){var _0x1b0b7e={'raw':![],'where':{'id':_0x452a1f[_0x5c38('0x49')]['id']}},_0xd3b523={};_0xd3b523[_0x5c38('0x32')]=_[_0x5c38('0x34')](db[_0x5c38('0x43')]['rawAttributes']);_0xd3b523[_0x5c38('0x33')]=_['keys'](_0x452a1f[_0x5c38('0x33')]);_0xd3b523[_0x5c38('0x35')]=_['intersection'](_0xd3b523[_0x5c38('0x32')],_0xd3b523[_0x5c38('0x33')]);_0x1b0b7e['attributes']=_[_0x5c38('0x36')](_0xd3b523['model'],qs[_0x5c38('0x37')](_0x452a1f['query'][_0x5c38('0x37')]));_0x1b0b7e[_0x5c38('0x38')]=_0x1b0b7e[_0x5c38('0x38')]['length']?_0x1b0b7e['attributes']:_0xd3b523['model'];if(_0x452a1f[_0x5c38('0x33')][_0x5c38('0x44')]){_0x1b0b7e[_0x5c38('0x4a')]=[{'all':!![]}];}_0x1b0b7e=_[_0x5c38('0x41')]({},_0x1b0b7e,_0x452a1f[_0x5c38('0x42')]);return db[_0x5c38('0x43')]['find'](_0x1b0b7e)[_0x5c38('0x28')](handleEntityNotFound(_0x3f977b,null))[_0x5c38('0x28')](respondWithResult(_0x3f977b,null))[_0x5c38('0x47')](handleError(_0x3f977b,null));};exports[_0x5c38('0x4b')]=function(_0x449d40,_0x495567){if(_0x449d40[_0x5c38('0x4c')]['id']){delete _0x449d40[_0x5c38('0x4c')]['id'];}return db[_0x5c38('0x43')][_0x5c38('0x4d')]({'where':{'id':_0x449d40[_0x5c38('0x49')]['id']}})['then'](handleEntityNotFound(_0x495567,null))[_0x5c38('0x28')](saveUpdates(_0x449d40[_0x5c38('0x4c')],null))[_0x5c38('0x28')](respondWithResult(_0x495567,null))['catch'](handleError(_0x495567,null));};exports['create']=function(_0x1be97f,_0x445a22,_0x130b25){return db[_0x5c38('0x4e')][_0x5c38('0x4f')](function(_0x3f5ead){if(_0x1be97f['body'][_0x5c38('0x50')]==='files'){_0x1be97f['body']['directory']=path['join'](config[_0x5c38('0x51')],_0x5c38('0x52'),_0x1be97f['body'][_0x5c38('0x2d')]);}return db['VoiceMusicOnHold'][_0x5c38('0x53')](_0x1be97f['body'],{'transaction':_0x3f5ead})[_0x5c38('0x28')](function(_0x2ccf90){if(_0x1be97f[_0x5c38('0x4c')][_0x5c38('0x50')]===_0x5c38('0x54')){fs['mkdirSync'](_0x2ccf90[_0x5c38('0x55')],parseInt('0777',0x8));}var _0x33d8d8=_0x1be97f['user'][_0x5c38('0x29')]({'plain':!![]});if(!_0x33d8d8)throw new Error(_0x5c38('0x56'));if(_0x33d8d8[_0x5c38('0x57')]==='user'){var _0x8dd693=_0x2ccf90['get']({'plain':!![]});return db[_0x5c38('0x58')]['find']({'where':{'name':_0x5c38('0x59'),'userProfileId':_0x33d8d8[_0x5c38('0x5a')]},'raw':!![]})[_0x5c38('0x28')](function(_0x294ec0){if(_0x294ec0&&_0x294ec0['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x8dd693[_0x5c38('0x2d')],'resourceId':_0x8dd693['id'],'type':_0x294ec0['name'],'sectionId':_0x294ec0['id']},{})[_0x5c38('0x28')](function(){return _0x2ccf90;});}else{return _0x2ccf90;}})['catch'](function(_0x594d37){logger[_0x5c38('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x594d37);});}return _0x2ccf90;});})[_0x5c38('0x28')](respondWithResult(_0x445a22,0xc9))['catch'](handleError(_0x445a22,null));};exports[_0x5c38('0x2b')]=function(_0x21fff9,_0x2eb521,_0x39a611){var _0x3b0505;return db[_0x5c38('0x43')][_0x5c38('0x4d')]({'where':{'id':_0x21fff9['params']['id']}})[_0x5c38('0x28')](function(_0x2b3008){if(_0x2b3008){return db[_0x5c38('0x4e')][_0x5c38('0x4f')](function(_0x5ccde4){return _0x2b3008[_0x5c38('0x2b')]({'transaction':_0x5ccde4,'raw':!![]})[_0x5c38('0x28')](function(_0x1c06a8){if(_0x1c06a8[_0x5c38('0x55')]){fs[_0x5c38('0x5b')](_0x1c06a8[_0x5c38('0x55')])['forEach'](function(_0x281ed6){fs[_0x5c38('0x5c')](path[_0x5c38('0x5d')](_0x1c06a8[_0x5c38('0x55')],_0x281ed6));});fs['rmdirSync'](_0x1c06a8[_0x5c38('0x55')]);}return _0x1c06a8;});})[_0x5c38('0x47')](function(_0x26e338){throw new db[(_0x5c38('0x5e'))][(_0x5c38('0x5f'))](_0x26e338['message']);});}})[_0x5c38('0x28')](handleEntityNotFound(_0x2eb521,null))[_0x5c38('0x28')](removeEntity(_0x2eb521,null))[_0x5c38('0x47')](handleError(_0x2eb521,null));};exports['addSound']=function(_0x1d9dcf,_0x1e6bad,_0x4853d7){return db['sequelize'][_0x5c38('0x4f')](function(_0x33c41e){var _0x89282;return db[_0x5c38('0x43')][_0x5c38('0x4d')]({'where':{'id':_0x1d9dcf[_0x5c38('0x49')]['id']}})['then'](function(_0x40e8a3){if(_0x40e8a3){_0x89282=_0x40e8a3;return _0x40e8a3['addSound'](_0x1d9dcf[_0x5c38('0x4c')]['id'],{'transaction':_0x33c41e});}})['then'](function(_0x13d1e6){if(_0x13d1e6){return db[_0x5c38('0x60')][_0x5c38('0x61')]({'where':{'id':_0x1d9dcf[_0x5c38('0x4c')]['id']},'attributes':['id',_0x5c38('0x2d'),_0x5c38('0x62'),_0x5c38('0x63'),_0x5c38('0x64')],'raw':!![]});}})[_0x5c38('0x28')](function(_0x37a834){if(_0x37a834){var _0x30e9bb=path[_0x5c38('0x5d')](config[_0x5c38('0x51')],_0x5c38('0x65'),util['format'](_0x5c38('0x66'),path[_0x5c38('0x67')](_0x37a834[_0x5c38('0x62')],path[_0x5c38('0x68')](_0x37a834[_0x5c38('0x62')])),_0x37a834[_0x5c38('0x63')]));var _0x463ee9=path[_0x5c38('0x5d')](config[_0x5c38('0x51')],_0x5c38('0x52'),_0x89282['name'],util[_0x5c38('0x69')]('%s.%s',_0x37a834[_0x5c38('0x2d')],_0x37a834[_0x5c38('0x63')]));fs[_0x5c38('0x6a')](_0x30e9bb,_0x463ee9);return _0x37a834;}})[_0x5c38('0x47')](function(_0xddafde){throw new db[(_0x5c38('0x5e'))]['ValidationError'](_0xddafde[_0x5c38('0x6b')]);});})['then'](handleEntityNotFound(_0x1e6bad,null))['then'](respondWithResult(_0x1e6bad,0xc9))[_0x5c38('0x47')](handleError(_0x1e6bad,null));};exports[_0x5c38('0x6c')]=function(_0x4be13a,_0x2ec712,_0x34a61e){return db[_0x5c38('0x4e')][_0x5c38('0x4f')](function(_0x455a3d){var _0x1c4b81;return db[_0x5c38('0x43')][_0x5c38('0x61')]({'where':{'id':_0x4be13a['params']['id']}})[_0x5c38('0x28')](handleEntityNotFound(_0x2ec712,null))[_0x5c38('0x28')](function(_0x511a7b){if(_0x511a7b){_0x1c4b81=_0x511a7b;return _0x511a7b[_0x5c38('0x6c')](_0x4be13a['params'][_0x5c38('0x6d')]);}})[_0x5c38('0x28')](function(_0x27eda9){if(_0x27eda9){return db[_0x5c38('0x60')][_0x5c38('0x61')]({'where':{'id':_0x4be13a['params']['id2']},'attributes':['id','name',_0x5c38('0x62'),_0x5c38('0x63'),_0x5c38('0x64')],'raw':!![]});}})['then'](function(_0x2d1497){if(_0x2d1497){fs[_0x5c38('0x5c')](path[_0x5c38('0x5d')](_0x1c4b81['directory'],util['format'](_0x5c38('0x66'),_0x2d1497[_0x5c38('0x2d')],_0x2d1497[_0x5c38('0x63')])));return _0x2d1497;}})['catch'](function(_0x5bdd30){throw new db[(_0x5c38('0x5e'))][(_0x5c38('0x5f'))](_0x5bdd30[_0x5c38('0x6b')]);});})['then'](handleEntityNotFound(_0x2ec712,null))['then'](respondWithStatusCode(_0x2ec712,0xcc))['catch'](handleError(_0x2ec712,null));};exports[_0x5c38('0x6e')]=function(_0x3491ef,_0x4501bc,_0x214057){var _0x257209={};var _0x3a54a1={};var _0x44e1df;var _0xd5d208;return db[_0x5c38('0x43')][_0x5c38('0x61')]({'where':{'id':_0x3491ef['params']['id']}})['then'](handleEntityNotFound(_0x4501bc,null))[_0x5c38('0x28')](function(_0x1f330b){if(_0x1f330b){_0x44e1df=_0x1f330b;_0x3a54a1[_0x5c38('0x32')]=_[_0x5c38('0x34')](db[_0x5c38('0x60')]['rawAttributes']);_0x3a54a1[_0x5c38('0x33')]=_['keys'](_0x3491ef['query']);_0x3a54a1[_0x5c38('0x35')]=_[_0x5c38('0x36')](_0x3a54a1['model'],_0x3a54a1[_0x5c38('0x33')]);_0x257209[_0x5c38('0x38')]=_[_0x5c38('0x36')](_0x3a54a1[_0x5c38('0x32')],qs['fields'](_0x3491ef[_0x5c38('0x33')][_0x5c38('0x37')]));_0x257209[_0x5c38('0x38')]=_0x257209[_0x5c38('0x38')][_0x5c38('0x6f')]?_0x257209['attributes']:_0x3a54a1['model'];_0x257209[_0x5c38('0x3b')]=qs[_0x5c38('0x3c')](_0x3491ef[_0x5c38('0x33')][_0x5c38('0x3c')]);_0x257209[_0x5c38('0x3d')]=qs[_0x5c38('0x35')](_[_0x5c38('0x3e')](_0x3491ef[_0x5c38('0x33')],_0x3a54a1[_0x5c38('0x35')]));if(_0x3491ef[_0x5c38('0x33')][_0x5c38('0x3f')]){_0x257209['where']=_[_0x5c38('0x41')](_0x257209[_0x5c38('0x3d')],{'$or':_['map'](_0x257209[_0x5c38('0x38')],function(_0x2d8f00){var _0x4cbb02={};_0x4cbb02[_0x2d8f00]={'$like':'%'+_0x3491ef[_0x5c38('0x33')]['filter']+'%'};return _0x4cbb02;})});}_0x257209=_['merge']({},_0x257209,_0x3491ef['options']);return _0x44e1df['getSounds'](_0x257209);}})[_0x5c38('0x28')](function(_0x5d1a77){if(_0x5d1a77){_0xd5d208=_0x5d1a77[_0x5c38('0x6f')];if(!_0x3491ef[_0x5c38('0x33')][_0x5c38('0x39')](_0x5c38('0x3a'))){_0x257209[_0x5c38('0x23')]=qs[_0x5c38('0x23')](_0x3491ef[_0x5c38('0x33')][_0x5c38('0x23')]);_0x257209[_0x5c38('0x21')]=qs[_0x5c38('0x21')](_0x3491ef[_0x5c38('0x33')][_0x5c38('0x21')]);}return _0x44e1df['getSounds'](_0x257209);}})[_0x5c38('0x28')](function(_0x2774aa){if(_0x2774aa){return _0x2774aa?{'count':_0xd5d208,'rows':_0x2774aa}:null;}})[_0x5c38('0x28')](respondWithResult(_0x4501bc,null))[_0x5c38('0x47')](handleError(_0x4501bc,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 358e764..8e9df1f 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 _0xa6be=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6be,0xab));var _0xea6b=function(_0x4a89fe,_0x4ac07d){_0x4a89fe=_0x4a89fe-0x0;var _0x5ba5d3=_0xa6be[_0x4a89fe];return _0x5ba5d3;};'use strict';var _=require(_0xea6b('0x0'));var util=require(_0xea6b('0x1'));var logger=require(_0xea6b('0x2'))(_0xea6b('0x3'));var moment=require(_0xea6b('0x4'));var BPromise=require(_0xea6b('0x5'));var rp=require(_0xea6b('0x6'));var fs=require('fs');var path=require(_0xea6b('0x7'));var rimraf=require(_0xea6b('0x8'));var config=require(_0xea6b('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xea6b('0xa')]=function(_0x21755c,_0x75b2e){return _0x21755c['define'](_0xea6b('0xb'),attributes,{'tableName':_0xea6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51b1=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x47fb54,_0x28698c){var _0x1139a7=function(_0x17c781){while(--_0x17c781){_0x47fb54['push'](_0x47fb54['shift']());}};_0x1139a7(++_0x28698c);}(_0x51b1,0x176));var _0x151b=function(_0x3c0e33,_0x4e9903){_0x3c0e33=_0x3c0e33-0x0;var _0x48d10c=_0x51b1[_0x3c0e33];return _0x48d10c;};'use strict';var _=require(_0x151b('0x0'));var util=require('util');var logger=require(_0x151b('0x1'))(_0x151b('0x2'));var moment=require(_0x151b('0x3'));var BPromise=require(_0x151b('0x4'));var rp=require(_0x151b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x151b('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x151b('0x7')]=function(_0x528700,_0x5869cc){return _0x528700[_0x151b('0x8')](_0x151b('0x9'),attributes,{'tableName':_0x151b('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 5d74e9e..564398b 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5bf468,_0x21dece){var _0x52bf74=function(_0x38cc9c){while(--_0x38cc9c){_0x5bf468['push'](_0x5bf468['shift']());}};_0x52bf74(++_0x21dece);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5f43d8,_0xdf4ef){var _0x515747=function(_0x174363){while(--_0x174363){_0x5f43d8['push'](_0x5f43d8['shift']());}};_0x515747(++_0xdf4ef);}(_0x70e0,0x17b));var _0x070e=function(_0x12912b,_0x12cf49){_0x12912b=_0x12912b-0x0;var _0x2cec12=_0x70e0[_0x12912b];return _0x2cec12;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 7f96646..e7fa434 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 _0xac22=['delete','removeAgents','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac22,0x138));var _0x2ac2=function(_0x858cdd,_0x6232c8){_0x858cdd=_0x858cdd-0x0;var _0xab57d5=_0xac22[_0x858cdd];return _0xab57d5;};'use strict';var multer=require('multer');var util=require(_0x2ac2('0x0'));var path=require(_0x2ac2('0x1'));var timeout=require(_0x2ac2('0x2'));var express=require(_0x2ac2('0x3'));var router=express[_0x2ac2('0x4')]();var fs_extra=require(_0x2ac2('0x5'));var auth=require(_0x2ac2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ac2('0x7'));var controller=require(_0x2ac2('0x8'));router[_0x2ac2('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ac2('0xa')]);router[_0x2ac2('0x9')]('/describe',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xc')]);router[_0x2ac2('0x9')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xe')]);router[_0x2ac2('0x9')](_0x2ac2('0xf'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x10')]);router[_0x2ac2('0x9')](_0x2ac2('0x11'),auth['isAuthenticated'](),controller[_0x2ac2('0x12')]);router[_0x2ac2('0x13')]('/',auth['isAuthenticated'](),controller[_0x2ac2('0x14')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x2ac2('0x11'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x15')]);router[_0x2ac2('0x16')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x17')]);router['delete'](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller['destroy']);router[_0x2ac2('0x18')]('/:id/users',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x19')]);router[_0x2ac2('0x18')](_0x2ac2('0x11'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x1a')]);module[_0x2ac2('0x1b')]=router; \ No newline at end of file +var _0x31af=['put','update','delete','destroy','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/users','getAgents','getTeams','post','addAgents','/:id/teams','addTeams'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x31af,0xde));var _0xf31a=function(_0x277d1f,_0x1e8bf7){_0x277d1f=_0x277d1f-0x0;var _0x336f3d=_0x31af[_0x277d1f];return _0x336f3d;};'use strict';var multer=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var path=require(_0xf31a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf31a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf31a('0x4'));var interaction=require(_0xf31a('0x5'));var config=require(_0xf31a('0x6'));var controller=require(_0xf31a('0x7'));router['get']('/',auth[_0xf31a('0x8')](),controller[_0xf31a('0x9')]);router[_0xf31a('0xa')](_0xf31a('0xb'),auth['isAuthenticated'](),controller[_0xf31a('0xc')]);router[_0xf31a('0xa')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller['show']);router[_0xf31a('0xa')](_0xf31a('0xe'),auth[_0xf31a('0x8')](),controller[_0xf31a('0xf')]);router[_0xf31a('0xa')]('/:id/teams',auth[_0xf31a('0x8')](),controller[_0xf31a('0x10')]);router[_0xf31a('0x11')]('/',auth[_0xf31a('0x8')](),controller['create']);router[_0xf31a('0x11')](_0xf31a('0xe'),auth['isAuthenticated'](),controller[_0xf31a('0x12')]);router[_0xf31a('0x11')](_0xf31a('0x13'),auth[_0xf31a('0x8')](),controller[_0xf31a('0x14')]);router[_0xf31a('0x15')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller[_0xf31a('0x16')]);router[_0xf31a('0x17')](_0xf31a('0xd'),auth[_0xf31a('0x8')](),controller[_0xf31a('0x18')]);router[_0xf31a('0x17')](_0xf31a('0xe'),auth['isAuthenticated'](),controller[_0xf31a('0x19')]);router[_0xf31a('0x17')](_0xf31a('0x13'),auth[_0xf31a('0x8')](),controller['removeTeams']);module[_0xf31a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index c706c75..c4d1b28 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 _0x8927=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x43e74f,_0x1a362b){var _0x369155=function(_0xb20b25){while(--_0xb20b25){_0x43e74f['push'](_0x43e74f['shift']());}};_0x369155(++_0x1a362b);}(_0x8927,0x17a));var _0x7892=function(_0x5a9077,_0x467f0c){_0x5a9077=_0x5a9077-0x0;var _0xdad46b=_0x8927[_0x5a9077];return _0xdad46b;};'use strict';var Sequelize=require(_0x7892('0x0'));module[_0x7892('0x1')]={'name':{'type':Sequelize[_0x7892('0x2')],'allowNull':![],'unique':_0x7892('0x3')},'prefix':{'type':Sequelize[_0x7892('0x4')],'get':function(_0x1e4d8c){return _0x7892('0x5')+this[_0x7892('0x6')](_0x7892('0x3'))+'-';}},'description':{'type':Sequelize[_0x7892('0x2')]},'callerIdAll':{'type':Sequelize[_0x7892('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7892('0x7')]}}; \ No newline at end of file +var _0x7286=['sequelize','exports','STRING','name','system-','getDataValue','INTEGER'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0x7286,0x1a4));var _0x6728=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7286[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x6728('0x0'));module[_0x6728('0x1')]={'name':{'type':Sequelize[_0x6728('0x2')],'allowNull':![],'unique':_0x6728('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x52a676){return _0x6728('0x4')+this[_0x6728('0x5')](_0x6728('0x3'))+'-';}},'description':{'type':Sequelize[_0x6728('0x2')]},'callerIdAll':{'type':Sequelize[_0x6728('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x6728('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d617e27..4147e2b 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 _0x58a4=['addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','getTeams','Team','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','describe','create','sequelize','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','findById'];(function(_0x10055a,_0x44efaf){var _0x49eb68=function(_0x136e2f){while(--_0x136e2f){_0x10055a['push'](_0x10055a['shift']());}};_0x49eb68(++_0x44efaf);}(_0x58a4,0xbf));var _0x458a=function(_0x589cdf,_0x53f463){_0x589cdf=_0x589cdf-0x0;var _0x5f0774=_0x58a4[_0x589cdf];return _0x5f0774;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];config[_0x458a('0x1a')]=_[_0x458a('0x1b')](config[_0x458a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458a('0x1a')]));require('./voicePrefix.socket')[_0x458a('0x1c')](socket);function respondWithStatusCode(_0x44f683,_0x10133b){_0x10133b=_0x10133b||0xcc;return function(_0x3b74f9){if(_0x3b74f9){return _0x44f683[_0x458a('0x1d')](_0x10133b);}return _0x44f683[_0x458a('0x1e')](_0x10133b)['end']();};}function respondWithResult(_0x4b26be,_0x5c7993){_0x5c7993=_0x5c7993||0xc8;return function(_0x2faf6a){if(_0x2faf6a){return _0x4b26be[_0x458a('0x1e')](_0x5c7993)[_0x458a('0x1f')](_0x2faf6a);}};}function respondWithFilteredResult(_0x5c5b41,_0x310569){return function(_0x260c87){if(_0x260c87){var _0x18504d=typeof _0x310569[_0x458a('0x20')]===_0x458a('0x21')&&typeof _0x310569['limit']==='undefined';var _0x178db9=_0x260c87['count'];var _0x3302b7=_0x18504d?0x0:_0x310569[_0x458a('0x20')];var _0x47a202=_0x18504d?_0x260c87[_0x458a('0x22')]:_0x310569['offset']+_0x310569[_0x458a('0x23')];var _0x1c79cb;if(_0x47a202>=_0x178db9){_0x47a202=_0x178db9;_0x1c79cb=0xc8;}else{_0x1c79cb=0xce;}_0x5c5b41['status'](_0x1c79cb);return _0x5c5b41[_0x458a('0x24')](_0x458a('0x25'),_0x3302b7+'-'+_0x47a202+'/'+_0x178db9)['json'](_0x260c87);}return null;};}function patchUpdates(_0xa6b8ff){return function(_0x5ad95a){try{jsonpatch[_0x458a('0x26')](_0x5ad95a,_0xa6b8ff,!![]);}catch(_0x5bca42){return BPromise[_0x458a('0x27')](_0x5bca42);}return _0x5ad95a['save']();};}function saveUpdates(_0x36b08e,_0x911eaf){return function(_0xcb0756){if(_0xcb0756){return _0xcb0756[_0x458a('0x28')](_0x36b08e)[_0x458a('0x29')](function(_0x19bd5){return _0x19bd5;});}return null;};}function removeEntity(_0x340375,_0x3012c7){return function(_0x1f2d0){if(_0x1f2d0){return _0x1f2d0[_0x458a('0x2a')]()[_0x458a('0x29')](function(){var _0x327fcb=_0x1f2d0[_0x458a('0x2b')]({'plain':!![]});var _0x5a55b7=_0x458a('0x2c');return db[_0x458a('0x2d')]['destroy']({'where':{'type':_0x5a55b7,'resourceId':_0x327fcb['id']}})['then'](function(){return _0x1f2d0;});})[_0x458a('0x29')](function(){_0x340375['status'](0xcc)[_0x458a('0x2e')]();});}};}function handleEntityNotFound(_0x29f9b5,_0x223f73){return function(_0x4a49e4){if(!_0x4a49e4){_0x29f9b5[_0x458a('0x1d')](0x194);}return _0x4a49e4;};}function handleError(_0x2531f7,_0x1426a8){_0x1426a8=_0x1426a8||0x1f4;return function(_0x562c36){logger['error'](_0x562c36[_0x458a('0x2f')]);if(_0x562c36['name']){delete _0x562c36[_0x458a('0x30')];}_0x2531f7['status'](_0x1426a8)[_0x458a('0x31')](_0x562c36);};}exports[_0x458a('0x32')]=function(_0x492843,_0x309a6a){var _0x269f53={},_0x625ae3={},_0x525caf={'count':0x0,'rows':[]};var _0x3371c3=_[_0x458a('0x33')](db[_0x458a('0x34')][_0x458a('0x35')],function(_0x5267fe){return{'name':_0x5267fe['fieldName'],'type':_0x5267fe[_0x458a('0x36')][_0x458a('0x37')]};});_0x625ae3[_0x458a('0x38')]=_[_0x458a('0x33')](_0x3371c3,_0x458a('0x30'));_0x625ae3[_0x458a('0x39')]=_['keys'](_0x492843[_0x458a('0x39')]);_0x625ae3[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],_0x625ae3[_0x458a('0x39')]);_0x269f53[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x492843['query'][_0x458a('0x3d')]));_0x269f53[_0x458a('0x3c')]=_0x269f53[_0x458a('0x3c')][_0x458a('0x3e')]?_0x269f53[_0x458a('0x3c')]:_0x625ae3[_0x458a('0x38')];if(!_0x492843[_0x458a('0x39')][_0x458a('0x3f')](_0x458a('0x40'))){_0x269f53[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x492843[_0x458a('0x39')][_0x458a('0x23')]);_0x269f53[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x492843['query'][_0x458a('0x20')]);}_0x269f53[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x492843[_0x458a('0x39')][_0x458a('0x42')]);_0x269f53[_0x458a('0x43')]=qs[_0x458a('0x3a')](_[_0x458a('0x44')](_0x492843[_0x458a('0x39')],_0x625ae3[_0x458a('0x3a')]),_0x3371c3);if(_0x492843[_0x458a('0x39')]['filter']){_0x269f53[_0x458a('0x43')]=_[_0x458a('0x45')](_0x269f53['where'],{'$or':_[_0x458a('0x33')](_0x3371c3,function(_0x422b45){if(_0x422b45[_0x458a('0x36')]!=='VIRTUAL'){var _0x406312={};_0x406312[_0x422b45[_0x458a('0x30')]]={'$like':'%'+_0x492843[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0x406312;}})});}_0x269f53=_[_0x458a('0x45')]({},_0x269f53,_0x492843[_0x458a('0x47')]);var _0x21d2d4={'where':_0x269f53[_0x458a('0x43')]};return db['VoicePrefix'][_0x458a('0x22')](_0x21d2d4)[_0x458a('0x29')](function(_0x2b9030){_0x525caf['count']=_0x2b9030;if(_0x492843[_0x458a('0x39')][_0x458a('0x48')]){_0x269f53['include']=[{'all':!![]}];}return db[_0x458a('0x34')][_0x458a('0x49')](_0x269f53);})[_0x458a('0x29')](function(_0x36c391){_0x525caf[_0x458a('0x4a')]=_0x36c391;return _0x525caf;})['then'](respondWithFilteredResult(_0x309a6a,_0x269f53))['catch'](handleError(_0x309a6a,null));};exports[_0x458a('0x4b')]=function(_0x301e61,_0x33a31d){var _0x18e4e2={'raw':![],'where':{'id':_0x301e61[_0x458a('0x4c')]['id']}},_0x5afd24={};_0x5afd24[_0x458a('0x38')]=_['keys'](db[_0x458a('0x34')]['rawAttributes']);_0x5afd24[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x301e61[_0x458a('0x39')]);_0x5afd24['filters']=_[_0x458a('0x3b')](_0x5afd24[_0x458a('0x38')],_0x5afd24[_0x458a('0x39')]);_0x18e4e2['attributes']=_['intersection'](_0x5afd24[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x301e61[_0x458a('0x39')]['fields']));_0x18e4e2['attributes']=_0x18e4e2[_0x458a('0x3c')][_0x458a('0x3e')]?_0x18e4e2[_0x458a('0x3c')]:_0x5afd24[_0x458a('0x38')];if(_0x301e61[_0x458a('0x39')][_0x458a('0x48')]){_0x18e4e2[_0x458a('0x4e')]=[{'all':!![]}];}_0x18e4e2=_[_0x458a('0x45')]({},_0x18e4e2,_0x301e61[_0x458a('0x47')]);return db[_0x458a('0x34')][_0x458a('0x4f')](_0x18e4e2)[_0x458a('0x29')](handleEntityNotFound(_0x33a31d,null))[_0x458a('0x29')](respondWithResult(_0x33a31d,null))[_0x458a('0x50')](handleError(_0x33a31d,null));};exports[_0x458a('0x2a')]=function(_0x25b44c,_0x51669b){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x25b44c[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x51669b,null))[_0x458a('0x29')](removeEntity(_0x51669b,null))['catch'](handleError(_0x51669b,null));};exports['describe']=function(_0x514d82,_0x2abf75){return db['VoicePrefix'][_0x458a('0x51')]()[_0x458a('0x29')](respondWithResult(_0x2abf75,null))[_0x458a('0x50')](handleError(_0x2abf75,null));};exports[_0x458a('0x52')]=function(_0xfa6e65,_0x5f0151){var _0x48f68e;return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x2587a1){return db[_0x458a('0x34')][_0x458a('0x52')](_0xfa6e65['body'],{'transaction':_0x2587a1})[_0x458a('0x29')](function(_0x4eed01){_0x48f68e=_0x4eed01[_0x458a('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x458a('0x4f')]({'where':{'id':_0x48f68e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b9928){return createVoicePrefixExtensions(_0x48f68e,_0x4b9928,_0x2587a1);});});})[_0x458a('0x29')](function(){var _0x3eb267=_0xfa6e65['user'][_0x458a('0x2b')]({'plain':!![]});if(!_0x3eb267)throw new Error(_0x458a('0x55'));if(_0x3eb267[_0x458a('0x56')]==='user'){var _0x2c1230=_0x48f68e;return db[_0x458a('0x57')][_0x458a('0x4f')]({'where':{'name':_0x458a('0x2c'),'userProfileId':_0x3eb267[_0x458a('0x58')]},'raw':!![]})[_0x458a('0x29')](function(_0x597e74){if(_0x597e74&&_0x597e74[_0x458a('0x59')]===0x0){return db[_0x458a('0x2d')][_0x458a('0x52')]({'name':_0x2c1230[_0x458a('0x30')],'resourceId':_0x2c1230['id'],'type':_0x597e74[_0x458a('0x30')],'sectionId':_0x597e74['id']},{})[_0x458a('0x29')](function(){return _0x48f68e;});}else{return _0x48f68e;}})[_0x458a('0x50')](function(_0x3b6cf9){logger['error'](_0x458a('0x5a'),_0x3b6cf9);throw _0x3b6cf9;});}return _0x48f68e;})['then'](respondWithResult(_0x5f0151,null))[_0x458a('0x50')](handleError(_0x5f0151,null));};function Extension(_0x2921ba,_0x222aa4,_0x42b748,_0x4da240){this['context']=_0x458a('0x5b');this[_0x458a('0x5c')]=_0x2921ba;this[_0x458a('0x5d')]=_0x42b748;this[_0x458a('0x36')]=_0x458a('0x5e');this[_0x458a('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x458a('0x60')]=_0x222aa4;this[_0x458a('0x61')]=_0x4da240;}function createVoicePrefixExtensions(_0x4f6913,_0x18d83a,_0x47b334){return new BPromise(function(_0x425a0f,_0x338127){var _0xa37d44=new Extension(formatPrefixName(_0x4f6913[_0x458a('0x62')]),0x1,_0x458a('0x63'),_0x458a('0x64'));_0xa37d44[_0x458a('0x65')]=_0x4f6913['id'];return db[_0x458a('0x66')]['create'](_0xa37d44,{'transaction':_0x47b334})[_0x458a('0x29')](function(_0x3ed05d){var _0x5d41a2=_0x3ed05d[_0x458a('0x2b')]({'plain':!![]});var _0x3da617=_['map'](addVoicePrefixExtensions(_0x4f6913,_0x18d83a),function(_0xaf7b50){_0xaf7b50[_0x458a('0x67')]=_0x5d41a2['id'];_0xaf7b50['VoicePrefixId']=_0x4f6913['id'];return _0xaf7b50;});return db[_0x458a('0x66')][_0x458a('0x68')](_0x3da617,{'transaction':_0x47b334})['then'](function(_0x16f82f){if(!_0x16f82f){return _0x338127(_0x458a('0x69'));}else{return _0x425a0f(_0x16f82f);}})[_0x458a('0x50')](function(_0x404d93){return _0x338127(_0x404d93);});});;});};function addVoicePrefixExtensions(_0x541375,_0x27d1f2){var _0x4199a7=[];var _0x397595=formatPrefixName(_0x541375['prefix']);_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x2,_0x458a('0x6b'),_0x458a('0x6c')+_0x541375[_0x458a('0x30')]));if(_0x541375[_0x458a('0x6d')]){_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,_0x458a('0x6b'),_0x458a('0x6e')+_0x541375[_0x458a('0x6d')]));}else{_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,'NoOp',_0x458a('0x6f')));}_0x4199a7['push'](new Extension(_0x397595,0x4,_0x458a('0x70'),_0x27d1f2[_0x458a('0x71')]+','+_0x458a('0x72')+(0x8+_0x541375[_0x458a('0x30')][_0x458a('0x3e')])+'}'+','+0x1));return _0x4199a7;}function formatPrefixName(_0x3d1d37){var _0x2c6a00='_';for(var _0x3745d5=0x0;_0x3745d5<_0x3d1d37[_0x458a('0x3e')];_0x3745d5++){if(_0x3d1d37[_0x458a('0x73')](_0x3745d5)=='-'){_0x2c6a00+=_0x3d1d37[_0x458a('0x73')](_0x3745d5);}else{_0x2c6a00+='['+_0x3d1d37[_0x458a('0x73')](_0x3745d5)+']';}}_0x2c6a00+='.';return _0x2c6a00;}exports[_0x458a('0x28')]=function(_0x435884,_0x3948aa,_0x2c131b){var _0x4c426a=_0x435884[_0x458a('0x74')];_0x4c426a['prefix']=_0x458a('0x75')+_0x4c426a[_0x458a('0x30')]+'-';return db['sequelize'][_0x458a('0x54')](function(_0xb028b3){return db[_0x458a('0x34')]['update'](_0x4c426a,{'where':{'id':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x2a')]({'where':{'VoicePrefixId':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x4f')]({'where':{'id':_0x4c426a['VoiceExtensionId']},'raw':!![]})[_0x458a('0x29')](function(_0x54abb1){return createVoicePrefixExtensions(_0x4c426a,_0x54abb1,_0xb028b3);});});});})['then'](function(){return db[_0x458a('0x34')][_0x458a('0x76')](_0x4c426a['id']);})[_0x458a('0x29')](respondWithResult(_0x3948aa,null))[_0x458a('0x50')](handleError(_0x3948aa,null));};exports[_0x458a('0x77')]=function(_0x434d04,_0x42eae7,_0x5aee0d){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x434d04[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x42eae7,null))[_0x458a('0x29')](function(_0x17398f){if(_0x17398f){return _0x17398f['addAgents'](_0x434d04['body']['ids'],_[_0x458a('0x78')](_0x434d04['body'],[_0x458a('0x79'),'id'])||{})[_0x458a('0x7a')](function(_0x46ef02){for(var _0x3d73d1=0x0;_0x3d73d1<_0x434d04[_0x458a('0x74')][_0x458a('0x79')][_0x458a('0x3e')];_0x3d73d1+=0x1){socket['emit'](_0x458a('0x7b'),{'UserId':Number(_0x434d04[_0x458a('0x74')]['ids'][_0x3d73d1]),'VoicePrefixId':Number(_0x434d04[_0x458a('0x4c')]['id'])});}return _0x46ef02;});}})['then'](respondWithResult(_0x42eae7,null))[_0x458a('0x50')](handleError(_0x42eae7,null));};exports['removeAgents']=function(_0x26b3f7,_0x177457,_0xce45b5){return db[_0x458a('0x34')]['find']({'where':{'id':_0x26b3f7[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x177457,null))[_0x458a('0x29')](function(_0x239e2f){if(_0x239e2f){return _0x239e2f[_0x458a('0x7c')](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])[_0x458a('0x29')](function(){if(_['isArray'](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])){for(var _0x12e367=0x0;_0x12e367<_0x26b3f7[_0x458a('0x39')]['ids'][_0x458a('0x3e')];_0x12e367+=0x1){socket[_0x458a('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')][_0x12e367]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}}else{socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':Number(_0x26b3f7['query'][_0x458a('0x79')]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}});}})[_0x458a('0x29')](respondWithStatusCode(_0x177457,null))[_0x458a('0x50')](handleError(_0x177457,null));};exports[_0x458a('0x7f')]=function(_0x46ac5c,_0x2eecf0,_0x573f46){var _0x1f9925={};var _0x4d3790={};var _0x396af9;var _0x36e650;return db[_0x458a('0x34')]['findOne']({'where':{'id':_0x46ac5c[_0x458a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2eecf0,null))['then'](function(_0x2574a3){if(_0x2574a3){_0x396af9=_0x2574a3;_0x4d3790[_0x458a('0x38')]=_['keys'](db['User'][_0x458a('0x35')]);_0x4d3790[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x46ac5c[_0x458a('0x39')]);_0x4d3790[_0x458a('0x3a')]=_['intersection'](_0x4d3790[_0x458a('0x38')],_0x4d3790['query']);_0x1f9925[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x4d3790[_0x458a('0x38')],qs['fields'](_0x46ac5c[_0x458a('0x39')][_0x458a('0x3d')]));_0x1f9925['attributes']=_0x1f9925[_0x458a('0x3c')]['length']?_0x1f9925[_0x458a('0x3c')]:_0x4d3790[_0x458a('0x38')];_0x1f9925[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x46ac5c['query'][_0x458a('0x42')]);_0x1f9925['where']=qs['filters'](_[_0x458a('0x44')](_0x46ac5c[_0x458a('0x39')],_0x4d3790[_0x458a('0x3a')]));if(_0x46ac5c[_0x458a('0x39')][_0x458a('0x46')]){_0x1f9925[_0x458a('0x43')]=_['merge'](_0x1f9925[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x1f9925[_0x458a('0x3c')],function(_0x222dcb){var _0x17099e={};_0x17099e[_0x222dcb]={'$like':'%'+_0x46ac5c[_0x458a('0x39')]['filter']+'%'};return _0x17099e;})});}_0x1f9925=_[_0x458a('0x45')]({},_0x1f9925,_0x46ac5c[_0x458a('0x47')]);return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})['then'](function(_0x2903c2){if(_0x2903c2){_0x36e650=_0x2903c2[_0x458a('0x3e')];if(!_0x46ac5c[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x1f9925[_0x458a('0x23')]=qs['limit'](_0x46ac5c['query']['limit']);_0x1f9925['offset']=qs['offset'](_0x46ac5c[_0x458a('0x39')]['offset']);}return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})[_0x458a('0x29')](function(_0x2adefe){if(_0x2adefe){return _0x2adefe?{'count':_0x36e650,'rows':_0x2adefe}:null;}})[_0x458a('0x29')](respondWithResult(_0x2eecf0,null))[_0x458a('0x50')](handleError(_0x2eecf0,null));};exports[_0x458a('0x80')]=function(_0x555190,_0x11ebe7,_0x59ad9c){var _0x24b1ee={};var _0x4e1d44={};var _0x23428c;var _0x333d74;return db['VoicePrefix']['findOne']({'where':{'id':_0x555190['params']['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x11ebe7,null))[_0x458a('0x29')](function(_0x21d8a9){if(_0x21d8a9){_0x23428c=_0x21d8a9;_0x4e1d44[_0x458a('0x38')]=_[_0x458a('0x4d')](db['Team'][_0x458a('0x35')]);_0x4e1d44[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x555190[_0x458a('0x39')]);_0x4e1d44[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],_0x4e1d44[_0x458a('0x39')]);_0x24b1ee['attributes']=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x555190[_0x458a('0x39')][_0x458a('0x3d')]));_0x24b1ee[_0x458a('0x3c')]=_0x24b1ee[_0x458a('0x3c')]['length']?_0x24b1ee['attributes']:_0x4e1d44['model'];_0x24b1ee['order']=qs[_0x458a('0x42')](_0x555190[_0x458a('0x39')][_0x458a('0x42')]);_0x24b1ee[_0x458a('0x43')]=qs['filters'](_[_0x458a('0x44')](_0x555190[_0x458a('0x39')],_0x4e1d44[_0x458a('0x3a')]));if(_0x555190[_0x458a('0x39')]['filter']){_0x24b1ee['where']=_[_0x458a('0x45')](_0x24b1ee[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x24b1ee[_0x458a('0x3c')],function(_0x4ff826){var _0xbb80ab={};_0xbb80ab[_0x4ff826]={'$like':'%'+_0x555190[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0xbb80ab;})});}_0x24b1ee=_[_0x458a('0x45')]({},_0x24b1ee,_0x555190[_0x458a('0x47')]);return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})[_0x458a('0x29')](function(_0xd05241){if(_0xd05241){_0x333d74=_0xd05241[_0x458a('0x3e')];if(!_0x555190[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x24b1ee[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x555190[_0x458a('0x39')][_0x458a('0x23')]);_0x24b1ee[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x555190[_0x458a('0x39')]['offset']);}return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})['then'](function(_0x165b0d){if(_0x165b0d){return _0x165b0d?{'count':_0x333d74,'rows':_0x165b0d}:null;}})[_0x458a('0x29')](respondWithResult(_0x11ebe7,null))[_0x458a('0x50')](handleError(_0x11ebe7,null));};exports['addTeams']=function(_0x589496,_0x4ee34,_0x1c9f4c){var _0x241c72=_0x589496[_0x458a('0x74')][_0x458a('0x79')];var _0x53d065;return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x241c72},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id',_0x458a('0x30'),_0x458a('0x84'),_0x458a('0x85'),_0x458a('0x86')],'raw':!![]}]})[_0x458a('0x29')](function(_0x52b844){if(_0x52b844){_0x53d065=_0x52b844;var _0x3051d2=_['flatMap'](_0x52b844,function(_0x2e496b){var _0x442b4a=_0x2e496b[_0x458a('0x2b')]({'plain':!![]});return _0x442b4a['Agents'];});return db['VoicePrefix'][_0x458a('0x4f')]({'where':{'id':_0x589496['params']['id']}})[_0x458a('0x29')](function(_0x5d97cc){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x1b8558){return _0x5d97cc['addTeams'](_0x241c72,{'transaction':_0x1b8558})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x53d065,function(_0x5dbeed){return db[_0x458a('0x88')]['upsert']({'TeamId':_0x5dbeed['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},{'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x3051d2,function(_0x49bdfc){return db[_0x458a('0x89')][_0x458a('0x8a')]({'where':{'UserId':_0x49bdfc['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){_0x3051d2[_0x458a('0x8b')](function(_0x477402){socket['emit'](_0x458a('0x7b'),{'UserId':_0x477402['id'],'VoicePrefixId':_0x5d97cc['id']});});});});});}})[_0x458a('0x29')](respondWithStatusCode(_0x4ee34,null))['catch'](handleError(_0x4ee34,null));};exports[_0x458a('0x8c')]=function(_0x187bc8,_0x197858,_0x48622f){return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x187bc8[_0x458a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id'],'raw':!![]}]})[_0x458a('0x29')](handleEntityNotFound(_0x197858,null))[_0x458a('0x29')](function(_0x2334f3){var _0x46bfc7=_[_0x458a('0x33')](_0x2334f3,'id');var _0x43cb92=[];var _0x5c42a4=[];var _0x3c3c7b=squel['select']();_0x3c3c7b['field'](_0x458a('0x8d'))[_0x458a('0x8e')]('team_has_voice_prefixes','tq')[_0x458a('0x8f')]('user_has_teams','ut',_0x458a('0x90'))['where'](_0x458a('0x91'),_0x187bc8[_0x458a('0x4c')]['id']);for(var _0x20ad0b=0x0;_0x20ad0b<_0x2334f3[_0x458a('0x3e')];_0x20ad0b+=0x1){let _0x55eab3=_0x2334f3[_0x20ad0b];for(var _0x4677a6=0x0;_0x4677a6<_0x55eab3[_0x458a('0x83')][_0x458a('0x3e')];_0x4677a6+=0x1){let _0x4df0b4=_0x55eab3[_0x458a('0x83')][_0x4677a6];var _0xfd1b68=_0x3c3c7b[_0x458a('0x92')]();_0xfd1b68[_0x458a('0x43')]('ut.UserId\x20=\x20?',_0x4df0b4['id']);_0x5c42a4[_0x458a('0x6a')](db['sequelize']['query'](_0xfd1b68['toString'](),{'type':db[_0x458a('0x53')][_0x458a('0x93')]['SELECT']})[_0x458a('0x29')](function(_0x49297c){if(_0x49297c[_0x458a('0x3e')]===0x1){return _0x4df0b4['id'];}else{var _0x4bfd6b=_[_0x458a('0x94')](_['map'](_0x49297c,_0x458a('0x95')),function(_0x3c9685){return _[_0x458a('0x96')](_0x46bfc7,_0x3c9685);});if(_0x4bfd6b){return _0x4df0b4['id'];}}}));}}return BPromise[_0x458a('0x97')](_0x5c42a4)[_0x458a('0x29')](function(_0x2e24aa){_0x43cb92=_(_0x43cb92)[_0x458a('0x98')](_0x2e24aa)['compact']()[_0x458a('0x99')]();return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x187bc8['params']['id']}})['then'](function(_0x334129){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x330330){return _0x334129[_0x458a('0x8c')](_0x187bc8['query'][_0x458a('0x79')],{'transaction':_0x330330})[_0x458a('0x29')](function(){if(!_[_0x458a('0x9a')](_0x43cb92)){return _0x334129[_0x458a('0x7c')](_0x43cb92,{'transaction':_0x330330});}})[_0x458a('0x29')](function(){_0x43cb92['forEach'](function(_0x16a747){socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':_0x16a747,'VoicePrefixId':_0x334129['id']});});});});});});})[_0x458a('0x29')](respondWithStatusCode(_0x197858,null))[_0x458a('0x50')](handleError(_0x197858,null));}; \ No newline at end of file +var _0x6343=['create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','type','priority','NoOp','Voice\x20Prefix','VoicePrefixId','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','${EXTEN:','charAt','prefix','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','order','getTeams','Team','pick','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','every','includes','all','union','compact','value','removeTeams','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','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','length','options','find','describe'];(function(_0x885082,_0x13f7e7){var _0x3b3a5e=function(_0x22aa73){while(--_0x22aa73){_0x885082['push'](_0x885082['shift']());}};_0x3b3a5e(++_0x13f7e7);}(_0x6343,0x168));var _0x3634=function(_0x70e342,_0x4ae83f){_0x70e342=_0x70e342-0x0;var _0x599e4c=_0x6343[_0x70e342];return _0x599e4c;};'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'];config[_0x3634('0x13')]=_[_0x3634('0x14')](config[_0x3634('0x13')],{'host':_0x3634('0x15'),'port':0x18eb});var socket=require(_0x3634('0x16'))(new Redis(config[_0x3634('0x13')]));require(_0x3634('0x17'))[_0x3634('0x18')](socket);function respondWithStatusCode(_0x7e4801,_0x2ad793){_0x2ad793=_0x2ad793||0xcc;return function(_0x5a5063){if(_0x5a5063){return _0x7e4801[_0x3634('0x19')](_0x2ad793);}return _0x7e4801['status'](_0x2ad793)[_0x3634('0x1a')]();};}function respondWithResult(_0x18285c,_0x2fc628){_0x2fc628=_0x2fc628||0xc8;return function(_0x78f93f){if(_0x78f93f){return _0x18285c[_0x3634('0x1b')](_0x2fc628)['json'](_0x78f93f);}};}function respondWithFilteredResult(_0x3121a3,_0x4b8ec8){return function(_0x50350d){if(_0x50350d){var _0x2aaac7=typeof _0x4b8ec8['offset']===_0x3634('0x1c')&&typeof _0x4b8ec8[_0x3634('0x1d')]===_0x3634('0x1c');var _0x5603d2=_0x50350d[_0x3634('0x1e')];var _0x4366bc=_0x2aaac7?0x0:_0x4b8ec8['offset'];var _0xeb9231=_0x2aaac7?_0x50350d['count']:_0x4b8ec8[_0x3634('0x1f')]+_0x4b8ec8[_0x3634('0x1d')];var _0x5b77a7;if(_0xeb9231>=_0x5603d2){_0xeb9231=_0x5603d2;_0x5b77a7=0xc8;}else{_0x5b77a7=0xce;}_0x3121a3[_0x3634('0x1b')](_0x5b77a7);return _0x3121a3[_0x3634('0x20')](_0x3634('0x21'),_0x4366bc+'-'+_0xeb9231+'/'+_0x5603d2)['json'](_0x50350d);}return null;};}function patchUpdates(_0x22b7ef){return function(_0x2c8874){try{jsonpatch['apply'](_0x2c8874,_0x22b7ef,!![]);}catch(_0x3936ee){return BPromise['reject'](_0x3936ee);}return _0x2c8874['save']();};}function saveUpdates(_0x3a8c41,_0x862ab5){return function(_0x5df6fb){if(_0x5df6fb){return _0x5df6fb[_0x3634('0x22')](_0x3a8c41)[_0x3634('0x23')](function(_0x17db44){return _0x17db44;});}return null;};}function removeEntity(_0x225ddc,_0x363ca2){return function(_0x12bca9){if(_0x12bca9){return _0x12bca9[_0x3634('0x24')]()[_0x3634('0x23')](function(){var _0x22f1f1=_0x12bca9['get']({'plain':!![]});var _0x1b0a44='VoicePrefixes';return db['UserProfileResource']['destroy']({'where':{'type':_0x1b0a44,'resourceId':_0x22f1f1['id']}})[_0x3634('0x23')](function(){return _0x12bca9;});})['then'](function(){_0x225ddc[_0x3634('0x1b')](0xcc)[_0x3634('0x1a')]();});}};}function handleEntityNotFound(_0x49804f,_0x55a77f){return function(_0x282f73){if(!_0x282f73){_0x49804f['sendStatus'](0x194);}return _0x282f73;};}function handleError(_0x281504,_0x5d273c){_0x5d273c=_0x5d273c||0x1f4;return function(_0x1e04cc){logger[_0x3634('0x25')](_0x1e04cc[_0x3634('0x26')]);if(_0x1e04cc[_0x3634('0x27')]){delete _0x1e04cc[_0x3634('0x27')];}_0x281504[_0x3634('0x1b')](_0x5d273c)[_0x3634('0x28')](_0x1e04cc);};}exports[_0x3634('0x29')]=function(_0x507753,_0x535215){var _0x4d26b4={},_0x3ebdbf={},_0x4abc18={'count':0x0,'rows':[]};var _0xb9bc8c=_[_0x3634('0x2a')](db[_0x3634('0x2b')][_0x3634('0x2c')],function(_0x28e3a0){return{'name':_0x28e3a0[_0x3634('0x2d')],'type':_0x28e3a0['type'][_0x3634('0x2e')]};});_0x3ebdbf[_0x3634('0x2f')]=_[_0x3634('0x2a')](_0xb9bc8c,_0x3634('0x27'));_0x3ebdbf[_0x3634('0x30')]=_[_0x3634('0x31')](_0x507753[_0x3634('0x30')]);_0x3ebdbf[_0x3634('0x32')]=_[_0x3634('0x33')](_0x3ebdbf['model'],_0x3ebdbf[_0x3634('0x30')]);_0x4d26b4[_0x3634('0x34')]=_[_0x3634('0x33')](_0x3ebdbf[_0x3634('0x2f')],qs['fields'](_0x507753[_0x3634('0x30')][_0x3634('0x35')]));_0x4d26b4[_0x3634('0x34')]=_0x4d26b4['attributes']['length']?_0x4d26b4['attributes']:_0x3ebdbf[_0x3634('0x2f')];if(!_0x507753[_0x3634('0x30')]['hasOwnProperty'](_0x3634('0x36'))){_0x4d26b4[_0x3634('0x1d')]=qs[_0x3634('0x1d')](_0x507753[_0x3634('0x30')][_0x3634('0x1d')]);_0x4d26b4[_0x3634('0x1f')]=qs[_0x3634('0x1f')](_0x507753['query'][_0x3634('0x1f')]);}_0x4d26b4['order']=qs[_0x3634('0x37')](_0x507753[_0x3634('0x30')][_0x3634('0x37')]);_0x4d26b4[_0x3634('0x38')]=qs[_0x3634('0x32')](_['pick'](_0x507753[_0x3634('0x30')],_0x3ebdbf[_0x3634('0x32')]),_0xb9bc8c);if(_0x507753[_0x3634('0x30')][_0x3634('0x39')]){_0x4d26b4[_0x3634('0x38')]=_[_0x3634('0x3a')](_0x4d26b4[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0xb9bc8c,function(_0x16b43d){if(_0x16b43d['type']!=='VIRTUAL'){var _0x14586d={};_0x14586d[_0x16b43d['name']]={'$like':'%'+_0x507753['query']['filter']+'%'};return _0x14586d;}})});}_0x4d26b4=_[_0x3634('0x3a')]({},_0x4d26b4,_0x507753['options']);var _0x197d65={'where':_0x4d26b4[_0x3634('0x38')]};return db['VoicePrefix']['count'](_0x197d65)['then'](function(_0x324970){_0x4abc18[_0x3634('0x1e')]=_0x324970;if(_0x507753['query'][_0x3634('0x3b')]){_0x4d26b4[_0x3634('0x3c')]=[{'all':!![]}];}return db[_0x3634('0x2b')][_0x3634('0x3d')](_0x4d26b4);})[_0x3634('0x23')](function(_0x5f0711){_0x4abc18['rows']=_0x5f0711;return _0x4abc18;})[_0x3634('0x23')](respondWithFilteredResult(_0x535215,_0x4d26b4))[_0x3634('0x3e')](handleError(_0x535215,null));};exports[_0x3634('0x3f')]=function(_0x2bced7,_0x14e88c){var _0x30dd54={'raw':![],'where':{'id':_0x2bced7[_0x3634('0x40')]['id']}},_0x4bfeec={};_0x4bfeec[_0x3634('0x2f')]=_[_0x3634('0x31')](db['VoicePrefix']['rawAttributes']);_0x4bfeec[_0x3634('0x30')]=_[_0x3634('0x31')](_0x2bced7[_0x3634('0x30')]);_0x4bfeec[_0x3634('0x32')]=_[_0x3634('0x33')](_0x4bfeec[_0x3634('0x2f')],_0x4bfeec[_0x3634('0x30')]);_0x30dd54[_0x3634('0x34')]=_['intersection'](_0x4bfeec[_0x3634('0x2f')],qs[_0x3634('0x35')](_0x2bced7[_0x3634('0x30')][_0x3634('0x35')]));_0x30dd54[_0x3634('0x34')]=_0x30dd54[_0x3634('0x34')][_0x3634('0x41')]?_0x30dd54[_0x3634('0x34')]:_0x4bfeec[_0x3634('0x2f')];if(_0x2bced7['query'][_0x3634('0x3b')]){_0x30dd54[_0x3634('0x3c')]=[{'all':!![]}];}_0x30dd54=_['merge']({},_0x30dd54,_0x2bced7[_0x3634('0x42')]);return db[_0x3634('0x2b')][_0x3634('0x43')](_0x30dd54)[_0x3634('0x23')](handleEntityNotFound(_0x14e88c,null))[_0x3634('0x23')](respondWithResult(_0x14e88c,null))[_0x3634('0x3e')](handleError(_0x14e88c,null));};exports['destroy']=function(_0x2663a2,_0x2356a9){return db[_0x3634('0x2b')][_0x3634('0x43')]({'where':{'id':_0x2663a2[_0x3634('0x40')]['id']}})['then'](handleEntityNotFound(_0x2356a9,null))[_0x3634('0x23')](removeEntity(_0x2356a9,null))[_0x3634('0x3e')](handleError(_0x2356a9,null));};exports['describe']=function(_0x52b79b,_0x3eb274){return db['VoicePrefix'][_0x3634('0x44')]()[_0x3634('0x23')](respondWithResult(_0x3eb274,null))[_0x3634('0x3e')](handleError(_0x3eb274,null));};exports[_0x3634('0x45')]=function(_0x5a024e,_0x274494){var _0x26d8d0;return db[_0x3634('0x46')][_0x3634('0x47')](function(_0x1ac9a9){return db[_0x3634('0x2b')][_0x3634('0x45')](_0x5a024e[_0x3634('0x48')],{'transaction':_0x1ac9a9})[_0x3634('0x23')](function(_0x320286){_0x26d8d0=_0x320286[_0x3634('0x49')]({'plain':!![]});return db[_0x3634('0x4a')]['find']({'where':{'id':_0x26d8d0[_0x3634('0x4b')]},'raw':!![]})[_0x3634('0x23')](function(_0x75547c){return createVoicePrefixExtensions(_0x26d8d0,_0x75547c,_0x1ac9a9);});});})[_0x3634('0x23')](function(){var _0x752546=_0x5a024e[_0x3634('0x4c')][_0x3634('0x49')]({'plain':!![]});if(!_0x752546)throw new Error(_0x3634('0x4d'));if(_0x752546[_0x3634('0x4e')]==='user'){var _0x2bcb9e=_0x26d8d0;return db[_0x3634('0x4f')]['find']({'where':{'name':_0x3634('0x50'),'userProfileId':_0x752546[_0x3634('0x51')]},'raw':!![]})['then'](function(_0x1089c2){if(_0x1089c2&&_0x1089c2[_0x3634('0x52')]===0x0){return db[_0x3634('0x53')]['create']({'name':_0x2bcb9e[_0x3634('0x27')],'resourceId':_0x2bcb9e['id'],'type':_0x1089c2['name'],'sectionId':_0x1089c2['id']},{})[_0x3634('0x23')](function(){return _0x26d8d0;});}else{return _0x26d8d0;}})['catch'](function(_0x960c9a){logger[_0x3634('0x25')](_0x3634('0x54'),_0x960c9a);throw _0x960c9a;});}return _0x26d8d0;})['then'](respondWithResult(_0x274494,null))[_0x3634('0x3e')](handleError(_0x274494,null));};function Extension(_0x2b72cd,_0x5df700,_0x2a2c92,_0xbc0017){this[_0x3634('0x55')]=_0x3634('0x56');this['exten']=_0x2b72cd;this[_0x3634('0x57')]=_0x2a2c92;this[_0x3634('0x58')]='system';this['description']='Voice\x20Prefix\x20Extension';this[_0x3634('0x59')]=_0x5df700;this['appdata']=_0xbc0017;}function createVoicePrefixExtensions(_0x1a3205,_0x31f838,_0x185b18){return new BPromise(function(_0x5e29a2,_0x1445a4){var _0x3f3dc1=new Extension(formatPrefixName(_0x1a3205['prefix']),0x1,_0x3634('0x5a'),_0x3634('0x5b'));_0x3f3dc1[_0x3634('0x5c')]=_0x1a3205['id'];return db['VoiceExtension'][_0x3634('0x45')](_0x3f3dc1,{'transaction':_0x185b18})[_0x3634('0x23')](function(_0x897c0e){var _0xb7dd01=_0x897c0e[_0x3634('0x49')]({'plain':!![]});var _0x4af226=_[_0x3634('0x2a')](addVoicePrefixExtensions(_0x1a3205,_0x31f838),function(_0x294703){_0x294703[_0x3634('0x4b')]=_0xb7dd01['id'];_0x294703['VoicePrefixId']=_0x1a3205['id'];return _0x294703;});return db[_0x3634('0x4a')]['bulkCreate'](_0x4af226,{'transaction':_0x185b18})[_0x3634('0x23')](function(_0x12ee97){if(!_0x12ee97){return _0x1445a4('Extensions\x20creation\x20failed');}else{return _0x5e29a2(_0x12ee97);}})[_0x3634('0x3e')](function(_0x1854da){return _0x1445a4(_0x1854da);});});;});};function addVoicePrefixExtensions(_0x11808f,_0x59011d){var _0x44b9c1=[];var _0x4b724c=formatPrefixName(_0x11808f['prefix']);_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x2,'Set',_0x3634('0x5e')+_0x11808f[_0x3634('0x27')]));if(_0x11808f[_0x3634('0x5f')]){_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x3,'Set',_0x3634('0x60')+_0x11808f[_0x3634('0x5f')]));}else{_0x44b9c1['push'](new Extension(_0x4b724c,0x3,_0x3634('0x5a'),'No\x20callerid\x20available'));}_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x4,'goto',_0x59011d['context']+','+_0x3634('0x61')+(0x8+_0x11808f[_0x3634('0x27')][_0x3634('0x41')])+'}'+','+0x1));return _0x44b9c1;}function formatPrefixName(_0x55f9dc){var _0x2d9115='_';for(var _0x49e63d=0x0;_0x49e63d<_0x55f9dc[_0x3634('0x41')];_0x49e63d++){if(_0x55f9dc[_0x3634('0x62')](_0x49e63d)=='-'){_0x2d9115+=_0x55f9dc[_0x3634('0x62')](_0x49e63d);}else{_0x2d9115+='['+_0x55f9dc[_0x3634('0x62')](_0x49e63d)+']';}}_0x2d9115+='.';return _0x2d9115;}exports[_0x3634('0x22')]=function(_0x11ecfb,_0x23f153,_0x18da49){var _0x347acc=_0x11ecfb[_0x3634('0x48')];_0x347acc[_0x3634('0x63')]='system-'+_0x347acc['name']+'-';return db[_0x3634('0x46')]['transaction'](function(_0x465712){return db[_0x3634('0x2b')][_0x3634('0x22')](_0x347acc,{'where':{'id':_0x347acc['id']},'transaction':_0x465712})[_0x3634('0x23')](function(){return db[_0x3634('0x4a')]['destroy']({'where':{'VoicePrefixId':_0x347acc['id']},'transaction':_0x465712})[_0x3634('0x23')](function(){return db[_0x3634('0x4a')][_0x3634('0x43')]({'where':{'id':_0x347acc[_0x3634('0x4b')]},'raw':!![]})[_0x3634('0x23')](function(_0x55b538){return createVoicePrefixExtensions(_0x347acc,_0x55b538,_0x465712);});});});})[_0x3634('0x23')](function(){return db[_0x3634('0x2b')][_0x3634('0x64')](_0x347acc['id']);})[_0x3634('0x23')](respondWithResult(_0x23f153,null))['catch'](handleError(_0x23f153,null));};exports['addAgents']=function(_0x15fa89,_0x248cd0,_0x3ac037){return db[_0x3634('0x2b')]['find']({'where':{'id':_0x15fa89[_0x3634('0x40')]['id']}})['then'](handleEntityNotFound(_0x248cd0,null))[_0x3634('0x23')](function(_0x543328){if(_0x543328){return _0x543328[_0x3634('0x65')](_0x15fa89[_0x3634('0x48')][_0x3634('0x66')],_[_0x3634('0x67')](_0x15fa89[_0x3634('0x48')],[_0x3634('0x66'),'id'])||{})['spread'](function(_0x3007d1){for(var _0x5cd87a=0x0;_0x5cd87a<_0x15fa89[_0x3634('0x48')][_0x3634('0x66')][_0x3634('0x41')];_0x5cd87a+=0x1){socket[_0x3634('0x68')](_0x3634('0x69'),{'UserId':Number(_0x15fa89[_0x3634('0x48')][_0x3634('0x66')][_0x5cd87a]),'VoicePrefixId':Number(_0x15fa89[_0x3634('0x40')]['id'])});}return _0x3007d1;});}})[_0x3634('0x23')](respondWithResult(_0x248cd0,null))['catch'](handleError(_0x248cd0,null));};exports[_0x3634('0x6a')]=function(_0x21a99c,_0x170e35,_0x3f21a3){return db[_0x3634('0x2b')][_0x3634('0x43')]({'where':{'id':_0x21a99c[_0x3634('0x40')]['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x170e35,null))[_0x3634('0x23')](function(_0x33c2aa){if(_0x33c2aa){return _0x33c2aa['removeAgents'](_0x21a99c[_0x3634('0x30')][_0x3634('0x66')])['then'](function(){if(_['isArray'](_0x21a99c[_0x3634('0x30')][_0x3634('0x66')])){for(var _0x32373b=0x0;_0x32373b<_0x21a99c[_0x3634('0x30')]['ids'][_0x3634('0x41')];_0x32373b+=0x1){socket[_0x3634('0x68')]('userVoicePrefix:remove',{'UserId':Number(_0x21a99c[_0x3634('0x30')][_0x3634('0x66')][_0x32373b]),'VoicePrefixId':Number(_0x21a99c['params']['id'])});}}else{socket[_0x3634('0x68')](_0x3634('0x6b'),{'UserId':Number(_0x21a99c['query'][_0x3634('0x66')]),'VoicePrefixId':Number(_0x21a99c[_0x3634('0x40')]['id'])});}});}})['then'](respondWithStatusCode(_0x170e35,null))[_0x3634('0x3e')](handleError(_0x170e35,null));};exports[_0x3634('0x6c')]=function(_0xf4ba17,_0x47c0ce,_0x54b94c){var _0x5466c4={};var _0x3018cd={};var _0x407727;var _0x1a0004;return db[_0x3634('0x2b')]['findOne']({'where':{'id':_0xf4ba17['params']['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x47c0ce,null))[_0x3634('0x23')](function(_0x2bc8c6){if(_0x2bc8c6){_0x407727=_0x2bc8c6;_0x3018cd[_0x3634('0x2f')]=_[_0x3634('0x31')](db[_0x3634('0x6d')][_0x3634('0x2c')]);_0x3018cd[_0x3634('0x30')]=_['keys'](_0xf4ba17[_0x3634('0x30')]);_0x3018cd[_0x3634('0x32')]=_[_0x3634('0x33')](_0x3018cd['model'],_0x3018cd[_0x3634('0x30')]);_0x5466c4[_0x3634('0x34')]=_[_0x3634('0x33')](_0x3018cd['model'],qs[_0x3634('0x35')](_0xf4ba17['query'][_0x3634('0x35')]));_0x5466c4['attributes']=_0x5466c4[_0x3634('0x34')][_0x3634('0x41')]?_0x5466c4[_0x3634('0x34')]:_0x3018cd[_0x3634('0x2f')];_0x5466c4[_0x3634('0x6e')]=qs[_0x3634('0x37')](_0xf4ba17[_0x3634('0x30')][_0x3634('0x37')]);_0x5466c4[_0x3634('0x38')]=qs[_0x3634('0x32')](_['pick'](_0xf4ba17[_0x3634('0x30')],_0x3018cd[_0x3634('0x32')]));if(_0xf4ba17[_0x3634('0x30')][_0x3634('0x39')]){_0x5466c4[_0x3634('0x38')]=_[_0x3634('0x3a')](_0x5466c4[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0x5466c4[_0x3634('0x34')],function(_0x10e0a2){var _0x8bca31={};_0x8bca31[_0x10e0a2]={'$like':'%'+_0xf4ba17[_0x3634('0x30')][_0x3634('0x39')]+'%'};return _0x8bca31;})});}_0x5466c4=_[_0x3634('0x3a')]({},_0x5466c4,_0xf4ba17[_0x3634('0x42')]);return _0x407727[_0x3634('0x6c')](_0x5466c4);}})[_0x3634('0x23')](function(_0x351c1f){if(_0x351c1f){_0x1a0004=_0x351c1f[_0x3634('0x41')];if(!_0xf4ba17['query']['hasOwnProperty'](_0x3634('0x36'))){_0x5466c4[_0x3634('0x1d')]=qs['limit'](_0xf4ba17[_0x3634('0x30')][_0x3634('0x1d')]);_0x5466c4['offset']=qs[_0x3634('0x1f')](_0xf4ba17['query'][_0x3634('0x1f')]);}return _0x407727[_0x3634('0x6c')](_0x5466c4);}})[_0x3634('0x23')](function(_0xfc3bd8){if(_0xfc3bd8){return _0xfc3bd8?{'count':_0x1a0004,'rows':_0xfc3bd8}:null;}})[_0x3634('0x23')](respondWithResult(_0x47c0ce,null))[_0x3634('0x3e')](handleError(_0x47c0ce,null));};exports[_0x3634('0x6f')]=function(_0x128714,_0x32a64e,_0x3363c1){var _0x5661cc={};var _0x249647={};var _0x2d60e3;var _0x498fb1;return db[_0x3634('0x2b')]['findOne']({'where':{'id':_0x128714['params']['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x32a64e,null))['then'](function(_0xac7d50){if(_0xac7d50){_0x2d60e3=_0xac7d50;_0x249647[_0x3634('0x2f')]=_[_0x3634('0x31')](db[_0x3634('0x70')][_0x3634('0x2c')]);_0x249647[_0x3634('0x30')]=_[_0x3634('0x31')](_0x128714[_0x3634('0x30')]);_0x249647['filters']=_[_0x3634('0x33')](_0x249647[_0x3634('0x2f')],_0x249647[_0x3634('0x30')]);_0x5661cc[_0x3634('0x34')]=_[_0x3634('0x33')](_0x249647[_0x3634('0x2f')],qs['fields'](_0x128714[_0x3634('0x30')][_0x3634('0x35')]));_0x5661cc['attributes']=_0x5661cc[_0x3634('0x34')][_0x3634('0x41')]?_0x5661cc[_0x3634('0x34')]:_0x249647[_0x3634('0x2f')];_0x5661cc[_0x3634('0x6e')]=qs['sort'](_0x128714[_0x3634('0x30')][_0x3634('0x37')]);_0x5661cc[_0x3634('0x38')]=qs['filters'](_[_0x3634('0x71')](_0x128714[_0x3634('0x30')],_0x249647[_0x3634('0x32')]));if(_0x128714[_0x3634('0x30')]['filter']){_0x5661cc['where']=_[_0x3634('0x3a')](_0x5661cc[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0x5661cc[_0x3634('0x34')],function(_0x55b759){var _0x4a0665={};_0x4a0665[_0x55b759]={'$like':'%'+_0x128714[_0x3634('0x30')]['filter']+'%'};return _0x4a0665;})});}_0x5661cc=_[_0x3634('0x3a')]({},_0x5661cc,_0x128714[_0x3634('0x42')]);return _0x2d60e3[_0x3634('0x6f')](_0x5661cc);}})[_0x3634('0x23')](function(_0x5885ea){if(_0x5885ea){_0x498fb1=_0x5885ea[_0x3634('0x41')];if(!_0x128714['query'][_0x3634('0x72')](_0x3634('0x36'))){_0x5661cc[_0x3634('0x1d')]=qs['limit'](_0x128714[_0x3634('0x30')]['limit']);_0x5661cc['offset']=qs[_0x3634('0x1f')](_0x128714[_0x3634('0x30')][_0x3634('0x1f')]);}return _0x2d60e3['getTeams'](_0x5661cc);}})['then'](function(_0x971689){if(_0x971689){return _0x971689?{'count':_0x498fb1,'rows':_0x971689}:null;}})[_0x3634('0x23')](respondWithResult(_0x32a64e,null))[_0x3634('0x3e')](handleError(_0x32a64e,null));};exports[_0x3634('0x73')]=function(_0xc9fe1a,_0x381331,_0xe79299){var _0x171490=_0xc9fe1a[_0x3634('0x48')][_0x3634('0x66')];var _0x4e313;return db[_0x3634('0x70')][_0x3634('0x3d')]({'where':{'id':_0x171490},'attributes':['id'],'include':[{'model':db[_0x3634('0x6d')],'as':_0x3634('0x74'),'attributes':['id',_0x3634('0x27'),_0x3634('0x75'),_0x3634('0x76'),_0x3634('0x77')],'raw':!![]}]})[_0x3634('0x23')](function(_0x3e7ae9){if(_0x3e7ae9){_0x4e313=_0x3e7ae9;var _0x336f18=_[_0x3634('0x78')](_0x3e7ae9,function(_0x54dad5){var _0x42d434=_0x54dad5[_0x3634('0x49')]({'plain':!![]});return _0x42d434['Agents'];});return db['VoicePrefix']['find']({'where':{'id':_0xc9fe1a[_0x3634('0x40')]['id']}})[_0x3634('0x23')](function(_0x10f006){return db['sequelize'][_0x3634('0x47')](function(_0xb0bfc2){return _0x10f006['addTeams'](_0x171490,{'transaction':_0xb0bfc2})[_0x3634('0x23')](function(){return BPromise['each'](_0x4e313,function(_0x56221c){return db[_0x3634('0x79')][_0x3634('0x7a')]({'TeamId':_0x56221c['id'],'VoicePrefixId':_0xc9fe1a[_0x3634('0x40')]['id']},{'transaction':_0xb0bfc2});});})[_0x3634('0x23')](function(){return BPromise['each'](_0x336f18,function(_0x2aa9b9){return db[_0x3634('0x7b')][_0x3634('0x7c')]({'where':{'UserId':_0x2aa9b9['id'],'VoicePrefixId':_0xc9fe1a[_0x3634('0x40')]['id']},'transaction':_0xb0bfc2});});})[_0x3634('0x23')](function(){_0x336f18[_0x3634('0x7d')](function(_0x4243ac){socket[_0x3634('0x68')](_0x3634('0x69'),{'UserId':_0x4243ac['id'],'VoicePrefixId':_0x10f006['id']});});});});});}})[_0x3634('0x23')](respondWithStatusCode(_0x381331,null))[_0x3634('0x3e')](handleError(_0x381331,null));};exports['removeTeams']=function(_0xca145e,_0x41af2b,_0x41df60){return db['Team'][_0x3634('0x3d')]({'where':{'id':_0xca145e[_0x3634('0x30')][_0x3634('0x66')]},'attributes':['id'],'include':[{'model':db[_0x3634('0x6d')],'as':_0x3634('0x74'),'attributes':['id'],'raw':!![]}]})[_0x3634('0x23')](handleEntityNotFound(_0x41af2b,null))['then'](function(_0x292441){var _0x2d341d=_[_0x3634('0x2a')](_0x292441,'id');var _0x5f2abf=[];var _0x2d9dcd=[];var _0x28ee79=squel['select']();_0x28ee79[_0x3634('0x7e')](_0x3634('0x7f'))[_0x3634('0x80')](_0x3634('0x81'),'tq')[_0x3634('0x82')](_0x3634('0x83'),'ut',_0x3634('0x84'))[_0x3634('0x38')](_0x3634('0x85'),_0xca145e['params']['id']);for(var _0xb5ca9f=0x0;_0xb5ca9f<_0x292441['length'];_0xb5ca9f+=0x1){let _0x300cfb=_0x292441[_0xb5ca9f];for(var _0x17ba97=0x0;_0x17ba97<_0x300cfb[_0x3634('0x74')]['length'];_0x17ba97+=0x1){let _0x9a5e22=_0x300cfb['Agents'][_0x17ba97];var _0x2390b9=_0x28ee79[_0x3634('0x86')]();_0x2390b9[_0x3634('0x38')]('ut.UserId\x20=\x20?',_0x9a5e22['id']);_0x2d9dcd[_0x3634('0x5d')](db[_0x3634('0x46')][_0x3634('0x30')](_0x2390b9[_0x3634('0x87')](),{'type':db[_0x3634('0x46')]['QueryTypes']['SELECT']})['then'](function(_0x92948d){if(_0x92948d['length']===0x1){return _0x9a5e22['id'];}else{var _0x4c0a7e=_[_0x3634('0x88')](_[_0x3634('0x2a')](_0x92948d,'TeamId'),function(_0x2dfb16){return _[_0x3634('0x89')](_0x2d341d,_0x2dfb16);});if(_0x4c0a7e){return _0x9a5e22['id'];}}}));}}return BPromise[_0x3634('0x8a')](_0x2d9dcd)['then'](function(_0x48eeaf){_0x5f2abf=_(_0x5f2abf)[_0x3634('0x8b')](_0x48eeaf)[_0x3634('0x8c')]()[_0x3634('0x8d')]();return db[_0x3634('0x2b')]['find']({'where':{'id':_0xca145e[_0x3634('0x40')]['id']}})[_0x3634('0x23')](function(_0x130205){return db['sequelize'][_0x3634('0x47')](function(_0x11253d){return _0x130205[_0x3634('0x8e')](_0xca145e['query']['ids'],{'transaction':_0x11253d})['then'](function(){if(!_['isEmpty'](_0x5f2abf)){return _0x130205[_0x3634('0x6a')](_0x5f2abf,{'transaction':_0x11253d});}})[_0x3634('0x23')](function(){_0x5f2abf[_0x3634('0x7d')](function(_0x36d826){socket[_0x3634('0x68')](_0x3634('0x6b'),{'UserId':_0x36d826,'VoicePrefixId':_0x130205['id']});});});});});});})[_0x3634('0x23')](respondWithStatusCode(_0x41af2b,null))[_0x3634('0x3e')](handleError(_0x41af2b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5e53e5a..c8e459c 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 _0xf75c=['emit','hasOwnProperty','hook','exports','events','VoicePrefix','save','update','remove'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0xf75c,0xc1));var _0xcf75=function(_0x5a6393,_0x569c16){_0x5a6393=_0x5a6393-0x0;var _0x411967=_0xf75c[_0x5a6393];return _0x411967;};'use strict';var EventEmitter=require(_0xcf75('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xcf75('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf75('0x2'),'afterUpdate':_0xcf75('0x3'),'afterDestroy':_0xcf75('0x4')};function emitEvent(_0xe183bc){return function(_0x23a827,_0x5a0b04,_0x503e0b){VoicePrefixEvents[_0xcf75('0x5')](_0xe183bc+':'+_0x23a827['id'],_0x23a827);VoicePrefixEvents[_0xcf75('0x5')](_0xe183bc,_0x23a827);_0x503e0b(null);};}for(var e in events){if(events[_0xcf75('0x6')](e)){var event=events[e];VoicePrefix[_0xcf75('0x7')](e,emitEvent(event));}}module[_0xcf75('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x2128=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2f5ab7,_0x56faf8){var _0x445943=function(_0x2e3900){while(--_0x2e3900){_0x2f5ab7['push'](_0x2f5ab7['shift']());}};_0x445943(++_0x56faf8);}(_0x2128,0x6d));var _0x8212=function(_0x30c605,_0x33ecbc){_0x30c605=_0x30c605-0x0;var _0x499c28=_0x2128[_0x30c605];return _0x499c28;};'use strict';var EventEmitter=require(_0x8212('0x0'));var VoicePrefix=require(_0x8212('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8212('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8212('0x3'),'afterDestroy':_0x8212('0x4')};function emitEvent(_0x4ca5f8){return function(_0x56937e,_0x400233,_0x2e0943){VoicePrefixEvents[_0x8212('0x5')](_0x4ca5f8+':'+_0x56937e['id'],_0x56937e);VoicePrefixEvents[_0x8212('0x5')](_0x4ca5f8,_0x56937e);_0x2e0943(null);};}for(var e in events){if(events[_0x8212('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8212('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 64e2747..3e6ffbf 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 _0x116d=['path','rimraf','../../config/environment','exports','define','voice_prefixes','lodash','../../config/logger','moment','bluebird'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x116d,0x13c));var _0xd116=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x116d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd116('0x0'));var util=require('util');var logger=require(_0xd116('0x1'))('api');var moment=require(_0xd116('0x2'));var BPromise=require(_0xd116('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd116('0x4'));var rimraf=require(_0xd116('0x5'));var config=require(_0xd116('0x6'));var attributes=require('./voicePrefix.attributes');module[_0xd116('0x7')]=function(_0x5f546c,_0x4f1542){return _0x5f546c[_0xd116('0x8')]('VoicePrefix',attributes,{'tableName':_0xd116('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2f5=['moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','util'];(function(_0x4d90f4,_0x40df8e){var _0x27d6d8=function(_0x25de7e){while(--_0x25de7e){_0x4d90f4['push'](_0x4d90f4['shift']());}};_0x27d6d8(++_0x40df8e);}(_0xa2f5,0x12b));var _0x5a2f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa2f5[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x5a2f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5a2f('0x1'));var BPromise=require(_0x5a2f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a2f('0x3'));var rimraf=require(_0x5a2f('0x4'));var config=require(_0x5a2f('0x5'));var attributes=require(_0x5a2f('0x6'));module[_0x5a2f('0x7')]=function(_0x4e9a3b,_0x3ce9a2){return _0x4e9a3b[_0x5a2f('0x8')](_0x5a2f('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index aed42b2..70e35c0 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 _0xef66=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xef66,0x1db));var _0x6ef6=function(_0x22f03c,_0x56a13e){_0x22f03c=_0x22f03c-0x0;var _0x531a6b=_0xef66[_0x22f03c];return _0x531a6b;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var moment=require(_0x6ef6('0x2'));var BPromise=require(_0x6ef6('0x3'));var rs=require(_0x6ef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ef6('0x5'));var logger=require(_0x6ef6('0x6'))(_0x6ef6('0x7'));var config=require(_0x6ef6('0x8'));var jayson=require(_0x6ef6('0x9'));var client=jayson[_0x6ef6('0xa')][_0x6ef6('0xb')]({'port':0x232a});config[_0x6ef6('0xc')]=_[_0x6ef6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ef6('0xe'))(new Redis(config[_0x6ef6('0xc')]));require(_0x6ef6('0xf'))[_0x6ef6('0x10')](socket);function respondWithRpcPromise(_0xc0ace,_0x49fed5,_0x1c719e){return new BPromise(function(_0x4bf459,_0x53db5e){return client[_0x6ef6('0x11')](_0xc0ace,_0x1c719e)['then'](function(_0x107bb4){logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,_0x6ef6('0x14'));logger['debug'](_0x6ef6('0x15'),_0x49fed5,_0x6ef6('0x14'),JSON[_0x6ef6('0x16')](_0x107bb4));if(_0x107bb4[_0x6ef6('0x17')]){if(_0x107bb4['error'][_0x6ef6('0x18')]===0x1f4){logger['error'](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')]['message']);return _0x53db5e(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);return _0x4bf459(_0x107bb4[_0x6ef6('0x17')][_0x6ef6('0x19')]);}else{logger[_0x6ef6('0x12')](_0x6ef6('0x13'),_0x49fed5,'request\x20sent');_0x4bf459(_0x107bb4[_0x6ef6('0x1a')][_0x6ef6('0x19')]);}})[_0x6ef6('0x1b')](function(_0x37d2ef){logger[_0x6ef6('0x17')](_0x6ef6('0x13'),_0x49fed5,_0x37d2ef);_0x53db5e(_0x37d2ef);});});} \ No newline at end of file +var _0x964b=['result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2185ac,_0x4ec43c){var _0x2e90a0=function(_0x370aac){while(--_0x370aac){_0x2185ac['push'](_0x2185ac['shift']());}};_0x2e90a0(++_0x4ec43c);}(_0x964b,0x112));var _0xb964=function(_0x337900,_0x4d48eb){_0x337900=_0x337900-0x0;var _0xbae722=_0x964b[_0x337900];return _0xbae722;};'use strict';var _=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var moment=require('moment');var BPromise=require(_0xb964('0x2'));var rs=require(_0xb964('0x3'));var fs=require('fs');var Redis=require(_0xb964('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb964('0x5'))('rpc');var config=require(_0xb964('0x6'));var jayson=require(_0xb964('0x7'));var client=jayson[_0xb964('0x8')][_0xb964('0x9')]({'port':0x232a});config[_0xb964('0xa')]=_[_0xb964('0xb')](config[_0xb964('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb964('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x295392,_0x4df011,_0x4433a5){return new BPromise(function(_0x38247c,_0x38bae5){return client[_0xb964('0xc')](_0x295392,_0x4433a5)['then'](function(_0x442595){logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));logger['debug'](_0xb964('0x10'),_0x4df011,'request\x20sent',JSON['stringify'](_0x442595));if(_0x442595[_0xb964('0x11')]){if(_0x442595[_0xb964('0x11')][_0xb964('0x12')]===0x1f4){logger[_0xb964('0x11')](_0xb964('0xe'),_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38bae5(_0x442595['error'][_0xb964('0x13')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x4df011,_0x442595[_0xb964('0x11')][_0xb964('0x13')]);return _0x38247c(_0x442595[_0xb964('0x11')][_0xb964('0x13')]);}else{logger[_0xb964('0xd')](_0xb964('0xe'),_0x4df011,_0xb964('0xf'));_0x38247c(_0x442595[_0xb964('0x14')][_0xb964('0x13')]);}})['catch'](function(_0x54da04){logger['error'](_0xb964('0xe'),_0x4df011,_0x54da04);_0x38bae5(_0x54da04);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ad3c19f..ab74bc2 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 _0x8721=['./voicePrefix.events','save','remove','removeListener','register','length','voicePrefix:'];(function(_0x85ff04,_0x1c2e9a){var _0x3ddd4b=function(_0x52c84b){while(--_0x52c84b){_0x85ff04['push'](_0x85ff04['shift']());}};_0x3ddd4b(++_0x1c2e9a);}(_0x8721,0xd9));var _0x1872=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x8721[_0x50f392];return _0x5926f2;};'use strict';var VoicePrefixEvents=require(_0x1872('0x0'));var events=[_0x1872('0x1'),_0x1872('0x2'),'update'];function createListener(_0x4edc0b,_0x43f8e9){return function(_0x532ce1){_0x43f8e9['emit'](_0x4edc0b,_0x532ce1);};}function removeListener(_0x50a1c5,_0x40690e){return function(){VoicePrefixEvents[_0x1872('0x3')](_0x50a1c5,_0x40690e);};}exports[_0x1872('0x4')]=function(_0x47ca3a){for(var _0x4befaf=0x0,_0x2dc064=events[_0x1872('0x5')];_0x4befaf<_0x2dc064;_0x4befaf++){var _0x4230d7=events[_0x4befaf];var _0x4d019e=createListener(_0x1872('0x6')+_0x4230d7,_0x47ca3a);VoicePrefixEvents['on'](_0x4230d7,_0x4d019e);}}; \ No newline at end of file +var _0xbc4a=['voicePrefix:','./voicePrefix.events','save','remove','removeListener','register','length'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x2d58ef,_0x291d23){_0x2d58ef=_0x2d58ef-0x0;var _0xce39a2=_0xbc4a[_0x2d58ef];return _0xce39a2;};'use strict';var VoicePrefixEvents=require(_0xabc4('0x0'));var events=[_0xabc4('0x1'),_0xabc4('0x2'),'update'];function createListener(_0x497e18,_0x4d2996){return function(_0x4fc0f9){_0x4d2996['emit'](_0x497e18,_0x4fc0f9);};}function removeListener(_0x145a9d,_0x4e84f9){return function(){VoicePrefixEvents[_0xabc4('0x3')](_0x145a9d,_0x4e84f9);};}exports[_0xabc4('0x4')]=function(_0x282a1e){for(var _0x422903=0x0,_0x244d3a=events[_0xabc4('0x5')];_0x422903<_0x244d3a;_0x422903++){var _0x244a46=events[_0x422903];var _0x28ea0b=createListener(_0xabc4('0x6')+_0x244a46,_0x282a1e);VoicePrefixEvents['on'](_0x244a46,_0x28ea0b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 1abf07c..295c787 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(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0xb10b,0x12a));var _0xbb10=function(_0xd8a448,_0x25c7a2){_0xd8a448=_0xd8a448-0x0;var _0x4771df=_0xb10b[_0xd8a448];return _0x4771df;};'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(_0x5c03f7,_0x2f8ce3){var _0xfdc33f=function(_0x4dd001){while(--_0x4dd001){_0x5c03f7['push'](_0x5c03f7['shift']());}};_0xfdc33f(++_0x2f8ce3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 ac286e3..208111a 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 _0x7bc8=['#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','getDataValue','type','strategy','outbound','booked','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x7bc8,0x1ac));var _0x87bc=function(_0x525c40,_0x37d16d){_0x525c40=_0x525c40-0x0;var _0x209f7f=_0x7bc8[_0x525c40];return _0x209f7f;};'use strict';var Sequelize=require(_0x87bc('0x0'));module[_0x87bc('0x1')]={'name':{'type':Sequelize[_0x87bc('0x2')],'allowNull':![],'unique':_0x87bc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x87bc('0x5')},'musiconhold':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x87bc('0x4')]('rr','ringall','leastrecent',_0x87bc('0x7'),_0x87bc('0x8'),_0x87bc('0x9'),_0x87bc('0xa'),_0x87bc('0xb'),_0x87bc('0xc')),'allowNull':![],'defaultValue':_0x87bc('0xd'),'set':function(_0x53a19e){this[_0x87bc('0xe')]('strategy',_0x53a19e?_0x53a19e:'rrmemory');},'get':function(){var _0x55e849=this[_0x87bc('0xf')](_0x87bc('0x10'));var _0x40ce15=this[_0x87bc('0xf')]('dialMethod');var _0x372528=this[_0x87bc('0xf')](_0x87bc('0x11'));if(_0x55e849===_0x87bc('0x12')){if(_0x40ce15==='preview'){return null;}if(_0x40ce15===_0x87bc('0x13')&&![_0x87bc('0x9'),'roundrobin'][_0x87bc('0x14')](_0x372528)){this[_0x87bc('0xe')](_0x87bc('0x11'),'rrmemory');}}return _0x372528;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x87bc('0x15')](0xb)},'timeout':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x87bc('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x87bc('0x16'),'no',_0x87bc('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x87bc('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x87bc('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':_0x87bc('0x16')},'announce_holdtime':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no',_0x87bc('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x87bc('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x87bc('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x87bc('0x2')]},'queue_youarenext':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x87bc('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x87bc('0x2')]},'queue_quantity1':{'type':Sequelize[_0x87bc('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x87bc('0x2')]},'queue_less_than':{'type':Sequelize[_0x87bc('0x2')]},'periodic_announce':{'type':Sequelize[_0x87bc('0x19')],'set':function(_0x4155ca){this['setDataValue']('periodic_announce',_0x4155ca?_0x4155ca[_0x87bc('0x1a')](','):[]);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1b'))?this[_0x87bc('0xf')](_0x87bc('0x1b'))[_0x87bc('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x16'),'set':function(_0x3f0b33){this['setDataValue']('joinempty',_0x3f0b33?_0x3f0b33['join'](','):undefined);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1d'))?this[_0x87bc('0xf')](_0x87bc('0x1d'))[_0x87bc('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':'no','set':function(_0x2b72a7){this['setDataValue'](_0x87bc('0x1e'),_0x2b72a7?_0x2b72a7[_0x87bc('0x1a')](','):undefined);},'get':function(){return this[_0x87bc('0xf')](_0x87bc('0x1e'))?this[_0x87bc('0xf')]('leavewhenempty')[_0x87bc('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x87bc('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'set':function(_0x273e26){this[_0x87bc('0xe')](_0x87bc('0x20'),_0x273e26);if(_0x273e26){if(this[_0x87bc('0xf')](_0x87bc('0x21'))<0x2){this[_0x87bc('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x87bc('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x22'),_0x87bc('0x23'),_0x87bc('0x24'),'predictive',_0x87bc('0x13')),'defaultValue':_0x87bc('0x23'),'comment':_0x87bc('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x87bc('0x26')},'dialLimitQueue':{'type':Sequelize[_0x87bc('0x15')](0x4)[_0x87bc('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x87bc('0x28')},'dialPowerLevel':{'type':Sequelize[_0x87bc('0x29')](0x2)[_0x87bc('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x87bc('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x2b'),_0x87bc('0x2c')),'defaultValue':_0x87bc('0x2c'),'comment':_0x87bc('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x87bc('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x87bc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x87bc('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x87bc('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':_0x87bc('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x31')},'dialQueueProject':{'type':Sequelize[_0x87bc('0x2')],'comment':_0x87bc('0x32')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'comment':_0x87bc('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x87bc('0x38')},'dialTimezone':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x87bc('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x87bc('0x4')](_0x87bc('0x39'),_0x87bc('0x3a'),_0x87bc('0x3b')),'defaultValue':_0x87bc('0x39')},'dialAMDActive':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':_0x87bc('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x87bc('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x87bc('0x3d')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x87bc('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x87bc('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87bc('0x40')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x87bc('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x87bc('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x87bc('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x87bc('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x87bc('0x44')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x87bc('0x15')](0x9)[_0x87bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':0x0,'comment':_0x87bc('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x87bc('0x4')]('DESC',_0x87bc('0x46')),'defaultValue':_0x87bc('0x47')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x87bc('0x48')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x87bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x87bc('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x87bc('0x15')](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87bc('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87bc('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x87bc('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![],'comment':_0x87bc('0x52'),'set':function(_0x20a2af){if(!_0x20a2af)this[_0x87bc('0xe')]('mandatoryDispositionPauseId',null);this[_0x87bc('0xe')](_0x87bc('0x53'),_0x20a2af);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x87bc('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x87bc('0x15')](0x3)[_0x87bc('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x87bc('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x9abf=['wrapuptime','Active/Disactive\x20Campaign','power','predictive','booked','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','STRING','name','inbound','default','ENUM','ringall','leastrecent','random','rrmemory','wrandom','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','preview','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','leavewhenempty','BOOLEAN','acw'];(function(_0x4430c7,_0x585527){var _0x4dd74e=function(_0x4d19fe){while(--_0x4d19fe){_0x4430c7['push'](_0x4430c7['shift']());}};_0x4dd74e(++_0x585527);}(_0x9abf,0x12a));var _0xf9ab=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9abf[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf9ab('0x0')],'allowNull':![],'unique':_0xf9ab('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0xf9ab('0x2')},'musiconhold':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':_0xf9ab('0x3')},'announce':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf9ab('0x4')]('rr',_0xf9ab('0x5'),_0xf9ab('0x6'),'fewestcalls',_0xf9ab('0x7'),_0xf9ab('0x8'),'linear',_0xf9ab('0x9'),_0xf9ab('0xa')),'allowNull':![],'defaultValue':_0xf9ab('0x5'),'set':function(_0x161cb0){this[_0xf9ab('0xb')](_0xf9ab('0xc'),_0x161cb0?_0x161cb0:_0xf9ab('0x8'));},'get':function(){var _0x57e56c=this['getDataValue'](_0xf9ab('0xd'));var _0x396fa7=this[_0xf9ab('0xe')](_0xf9ab('0xf'));var _0x2afb6f=this[_0xf9ab('0xe')]('strategy');if(_0x57e56c==='outbound'){if(_0x396fa7===_0xf9ab('0x10')){return null;}if(_0x396fa7==='booked'&&![_0xf9ab('0x8'),_0xf9ab('0x11')][_0xf9ab('0x12')](_0x2afb6f)){this[_0xf9ab('0xb')]('strategy',_0xf9ab('0x8'));}}return _0x2afb6f;}},'servicelevel':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf9ab('0x13')](0xb)},'timeout':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf9ab('0x0')]},'weight':{'type':Sequelize[_0xf9ab('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no'),'defaultValue':_0xf9ab('0x14')},'autopause':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no',_0xf9ab('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xf9ab('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf9ab('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf9ab('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no',_0xf9ab('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf9ab('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf9ab('0x0')]},'queue_youarenext':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf9ab('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xf9ab('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0xf9ab('0x0')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xf9ab('0x17')],'set':function(_0x44e7ef){this['setDataValue'](_0xf9ab('0x18'),_0x44e7ef?_0x44e7ef[_0xf9ab('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xf9ab('0x18'))?this[_0xf9ab('0xe')](_0xf9ab('0x18'))[_0xf9ab('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':_0xf9ab('0x14'),'set':function(_0x399343){this[_0xf9ab('0xb')]('joinempty',_0x399343?_0x399343[_0xf9ab('0x19')](','):undefined);},'get':function(){return this[_0xf9ab('0xe')]('joinempty')?this['getDataValue']('joinempty')[_0xf9ab('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':'no','set':function(_0x117834){this[_0xf9ab('0xb')]('leavewhenempty',_0x117834?_0x117834[_0xf9ab('0x19')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0xf9ab('0xe')](_0xf9ab('0x1b'))[_0xf9ab('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf9ab('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':0x0,'set':function(_0x1e7cf0){this[_0xf9ab('0xb')](_0xf9ab('0x1d'),_0x1e7cf0);if(_0x1e7cf0){if(this['getDataValue'](_0xf9ab('0x1e'))<0x2){this['setDataValue'](_0xf9ab('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf9ab('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':0x0,'comment':_0xf9ab('0x1f')},'dialMethod':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x10'),'progressive',_0xf9ab('0x20'),_0xf9ab('0x21'),_0xf9ab('0x22')),'defaultValue':_0xf9ab('0x23'),'comment':_0xf9ab('0x24')},'dialLimitChannel':{'type':Sequelize[_0xf9ab('0x13')](0x4)[_0xf9ab('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf9ab('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xf9ab('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf9ab('0x27')},'dialPowerLevel':{'type':Sequelize[_0xf9ab('0x28')](0x2)[_0xf9ab('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xf9ab('0x29'),_0xf9ab('0x2a')),'defaultValue':_0xf9ab('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf9ab('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf9ab('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xf9ab('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf9ab('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf9ab('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf9ab('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x2d')},'dialQueueOptions':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':_0xf9ab('0x2e'),'comment':_0xf9ab('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x30')},'dialQueueProject':{'type':Sequelize[_0xf9ab('0x0')],'comment':_0xf9ab('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf9ab('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf9ab('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf9ab('0x36')},'dialTimezone':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf9ab('0x37')},'dialPrefix':{'type':Sequelize[_0xf9ab('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xf9ab('0x38'),_0xf9ab('0x39'),_0xf9ab('0x3a')),'defaultValue':_0xf9ab('0x38')},'dialAMDActive':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf9ab('0x13')](0x9)[_0xf9ab('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf9ab('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0xf9ab('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf9ab('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf9ab('0x13')](0x9)[_0xf9ab('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf9ab('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf9ab('0x13')](0x9)[_0xf9ab('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf9ab('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xf9ab('0x13')](0x9)[_0xf9ab('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf9ab('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf9ab('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf9ab('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf9ab('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf9ab('0x13')](0x5)[_0xf9ab('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf9ab('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf9ab('0x13')](0x9)[_0xf9ab('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf9ab('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xf9ab('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf9ab('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf9ab('0x4')](_0xf9ab('0x45'),_0xf9ab('0x46')),'defaultValue':_0xf9ab('0x45')},'dialQueueProject2':{'type':Sequelize[_0xf9ab('0x0')],'comment':_0xf9ab('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf9ab('0x47')},'dialCutDigit':{'type':Sequelize[_0xf9ab('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf9ab('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0xf9ab('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf9ab('0x13')](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x4c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf9ab('0x13')](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9ab('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9ab('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9ab('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf9ab('0x13')],'allowNull':!![],'comment':_0xf9ab('0x50')},'mandatoryDisposition':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x36da20){if(!_0x36da20)this['setDataValue'](_0xf9ab('0x51'),null);this[_0xf9ab('0xb')]('mandatoryDisposition',_0x36da20);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf9ab('0x13')](0x3)[_0xf9ab('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xf9ab('0x13')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xf9ab('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1130332..33803ee 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 _0x870d=['addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','VoiceQueues','inbound','QueueCampaigns','filter','map','value','find','error','name','send','index','VoiceQueue','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','omit','destroy','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','nolimit','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','spread','online','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1135b1,_0x644ab2){var _0x387f6b=function(_0x515757){while(--_0x515757){_0x1135b1['push'](_0x1135b1['shift']());}};_0x387f6b(++_0x644ab2);}(_0x870d,0xde));var _0xd870=function(_0x562cd8,_0xa31e8a){_0x562cd8=_0x562cd8-0x0;var _0x282635=_0x870d[_0x562cd8];return _0x282635;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd870('0x0'));var zipdir=require(_0xd870('0x1'));var jsonpatch=require(_0xd870('0x2'));var rp=require(_0xd870('0x3'));var moment=require(_0xd870('0x4'));var BPromise=require(_0xd870('0x5'));var Mustache=require('mustache');var util=require(_0xd870('0x6'));var path=require(_0xd870('0x7'));var sox=require(_0xd870('0x8'));var csv=require(_0xd870('0x9'));var ejs=require(_0xd870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd870('0xb'));var squel=require(_0xd870('0xc'));var crypto=require(_0xd870('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd870('0x9'));var querystring=require(_0xd870('0xe'));var Papa=require(_0xd870('0xf'));var Redis=require(_0xd870('0x10'));var authService=require(_0xd870('0x11'));var qs=require(_0xd870('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd870('0x13'))(_0xd870('0x14'));var utils=require(_0xd870('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd870('0x16'));var db=require(_0xd870('0x17'))['db'];config['redis']=_[_0xd870('0x18')](config[_0xd870('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xd870('0x1a'))(new Redis(config['redis']));require(_0xd870('0x1b'))[_0xd870('0x1c')](socket);function respondWithStatusCode(_0x424f06,_0xeeb807){_0xeeb807=_0xeeb807||0xcc;return function(_0x49b5d8){if(_0x49b5d8){return _0x424f06[_0xd870('0x1d')](_0xeeb807);}return _0x424f06[_0xd870('0x1e')](_0xeeb807)['end']();};}function respondWithResult(_0x14e306,_0x356c8e){_0x356c8e=_0x356c8e||0xc8;return function(_0x427f90){if(_0x427f90){return _0x14e306['status'](_0x356c8e)[_0xd870('0x1f')](_0x427f90);}};}function respondWithFilteredResult(_0xc1f658,_0x5bd92c){return function(_0x2b7286){if(_0x2b7286){var _0x232cd7=typeof _0x5bd92c['offset']===_0xd870('0x20')&&typeof _0x5bd92c[_0xd870('0x21')]==='undefined';var _0x2e33a2=_0x2b7286[_0xd870('0x22')];var _0x475d52=_0x232cd7?0x0:_0x5bd92c[_0xd870('0x23')];var _0x503513=_0x232cd7?_0x2b7286['count']:_0x5bd92c[_0xd870('0x23')]+_0x5bd92c[_0xd870('0x21')];var _0x4dd75e;if(_0x503513>=_0x2e33a2){_0x503513=_0x2e33a2;_0x4dd75e=0xc8;}else{_0x4dd75e=0xce;}_0xc1f658['status'](_0x4dd75e);return _0xc1f658[_0xd870('0x24')](_0xd870('0x25'),_0x475d52+'-'+_0x503513+'/'+_0x2e33a2)[_0xd870('0x1f')](_0x2b7286);}return null;};}function patchUpdates(_0x247b90){return function(_0x4af534){try{jsonpatch[_0xd870('0x26')](_0x4af534,_0x247b90,!![]);}catch(_0x134b84){return BPromise['reject'](_0x134b84);}return _0x4af534[_0xd870('0x27')]();};}function saveUpdates(_0x44787d,_0x20cfcc){return function(_0xcbd2bf){if(_0xcbd2bf){return _0xcbd2bf[_0xd870('0x28')](_0x44787d)[_0xd870('0x29')](function(_0x3dbf19){return _0x3dbf19;});}return null;};}function removeEntity(_0xf22ff7,_0x2fa5bd){return function(_0x5c2cb4){if(_0x5c2cb4){return _0x5c2cb4['destroy']()[_0xd870('0x29')](function(){var _0x201c8f=_0x5c2cb4['get']({'plain':!![]});var _0x2ed80a=[{'name':_0xd870('0x2a'),'value':_0xd870('0x2b'),'ignore':![]},{'name':_0xd870('0x2c'),'value':'outbound','ignore':![]}];var _0x335c11=_(_0x2ed80a)[_0xd870('0x2d')]('ignore')[_0xd870('0x2e')]('value')[_0xd870('0x2f')]();if(_['includes'](_0x335c11,_0x201c8f['type'])){return;}var _0x53f41e=_[_0xd870('0x30')](_0x2ed80a,[_0xd870('0x2f'),_0x201c8f['type']])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x53f41e,'resourceId':_0x201c8f['id']}})[_0xd870('0x29')](function(){return _0x5c2cb4;});})['then'](function(){_0xf22ff7[_0xd870('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49176f,_0x156046){return function(_0x57f8f4){if(!_0x57f8f4){_0x49176f[_0xd870('0x1d')](0x194);}return _0x57f8f4;};}function handleError(_0x419354,_0x39c434){_0x39c434=_0x39c434||0x1f4;return function(_0x4ac56e){logger[_0xd870('0x31')](_0x4ac56e['stack']);if(_0x4ac56e[_0xd870('0x32')]){delete _0x4ac56e[_0xd870('0x32')];}_0x419354['status'](_0x39c434)[_0xd870('0x33')](_0x4ac56e);};}exports[_0xd870('0x34')]=function(_0x3306ed,_0x288c17){var _0x41a7af={},_0x56768f={},_0x2b26bc={'count':0x0,'rows':[]};var _0x558d01=_[_0xd870('0x2e')](db[_0xd870('0x35')]['rawAttributes'],function(_0x14a102){return{'name':_0x14a102['fieldName'],'type':_0x14a102[_0xd870('0x36')][_0xd870('0x37')]};});_0x56768f[_0xd870('0x38')]=_[_0xd870('0x2e')](_0x558d01,_0xd870('0x32'));_0x56768f[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x3306ed['query']);_0x56768f[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x56768f[_0xd870('0x38')],_0x56768f['query']);_0x41a7af[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x56768f[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x3306ed['query']['fields']));_0x41a7af[_0xd870('0x3d')]=_0x41a7af[_0xd870('0x3d')][_0xd870('0x3f')]?_0x41a7af[_0xd870('0x3d')]:_0x56768f[_0xd870('0x38')];if(!_0x3306ed['query'][_0xd870('0x40')]('nolimit')){_0x41a7af[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x3306ed[_0xd870('0x39')]['limit']);_0x41a7af['offset']=qs['offset'](_0x3306ed[_0xd870('0x39')][_0xd870('0x23')]);}_0x41a7af[_0xd870('0x41')]=qs['sort'](_0x3306ed[_0xd870('0x39')][_0xd870('0x42')]);_0x41a7af[_0xd870('0x43')]=qs['filters'](_[_0xd870('0x44')](_0x3306ed['query'],_0x56768f[_0xd870('0x3b')]),_0x558d01);if(_0x3306ed[_0xd870('0x39')][_0xd870('0x2d')]){_0x41a7af['where']=_[_0xd870('0x45')](_0x41a7af['where'],{'$or':_['map'](_0x558d01,function(_0x4276af){if(_0x4276af[_0xd870('0x36')]!==_0xd870('0x46')){var _0x3ba47c={};_0x3ba47c[_0x4276af[_0xd870('0x32')]]={'$like':'%'+_0x3306ed['query'][_0xd870('0x2d')]+'%'};return _0x3ba47c;}})});}_0x41a7af=_['merge']({},_0x41a7af,_0x3306ed[_0xd870('0x47')]);var _0x402610={'where':_0x41a7af[_0xd870('0x43')]};return db[_0xd870('0x35')][_0xd870('0x22')](_0x402610)[_0xd870('0x29')](function(_0x2fd79c){_0x2b26bc[_0xd870('0x22')]=_0x2fd79c;if(_0x3306ed[_0xd870('0x39')][_0xd870('0x48')]){_0x41a7af[_0xd870('0x49')]=[{'all':!![]}];}return db[_0xd870('0x35')][_0xd870('0x4a')](_0x41a7af);})[_0xd870('0x29')](function(_0x1f05a9){_0x2b26bc[_0xd870('0x4b')]=_0x1f05a9;return _0x2b26bc;})[_0xd870('0x29')](respondWithFilteredResult(_0x288c17,_0x41a7af))[_0xd870('0x4c')](handleError(_0x288c17,null));};exports['show']=function(_0x574c62,_0x15a97c){var _0x1e2af7={'raw':![],'where':{'id':_0x574c62[_0xd870('0x4d')]['id']}},_0x498d39={};_0x498d39['model']=_[_0xd870('0x3a')](db[_0xd870('0x35')]['rawAttributes']);_0x498d39['query']=_[_0xd870('0x3a')](_0x574c62['query']);_0x498d39[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x498d39[_0xd870('0x38')],_0x498d39[_0xd870('0x39')]);_0x1e2af7[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x498d39[_0xd870('0x38')],qs['fields'](_0x574c62[_0xd870('0x39')][_0xd870('0x3e')]));_0x1e2af7[_0xd870('0x3d')]=_0x1e2af7[_0xd870('0x3d')][_0xd870('0x3f')]?_0x1e2af7[_0xd870('0x3d')]:_0x498d39[_0xd870('0x38')];if(_0x574c62['query']['includeAll']){_0x1e2af7[_0xd870('0x49')]=[{'all':!![]}];}_0x1e2af7=_['merge']({},_0x1e2af7,_0x574c62[_0xd870('0x47')]);return db[_0xd870('0x35')][_0xd870('0x30')](_0x1e2af7)[_0xd870('0x29')](handleEntityNotFound(_0x15a97c,null))[_0xd870('0x29')](respondWithResult(_0x15a97c,null))[_0xd870('0x4c')](handleError(_0x15a97c,null));};exports[_0xd870('0x4e')]=function(_0x5789d4,_0x2c19c6){return db[_0xd870('0x35')][_0xd870('0x4e')](_0x5789d4[_0xd870('0x4f')],{})[_0xd870('0x29')](function(_0x400f4e){var _0x4c9ed7=_0x5789d4[_0xd870('0x50')][_0xd870('0x51')]({'plain':!![]});if(!_0x4c9ed7)throw new Error(_0xd870('0x52'));if(_0x4c9ed7[_0xd870('0x53')]===_0xd870('0x50')){var _0x4bd445=_0x400f4e[_0xd870('0x51')]({'plain':!![]});var _0xa28fba=[{'name':'VoiceQueues','value':_0xd870('0x2b')},{'name':_0xd870('0x2c'),'value':'outbound'}];var _0x27d648=_[_0xd870('0x30')](_0xa28fba,[_0xd870('0x2f'),_0x4bd445[_0xd870('0x36')]])[_0xd870('0x32')];return db[_0xd870('0x54')]['find']({'where':{'name':_0x27d648,'userProfileId':_0x4c9ed7[_0xd870('0x55')]},'raw':!![]})[_0xd870('0x29')](function(_0x16e2f4){if(_0x16e2f4&&_0x16e2f4[_0xd870('0x56')]===0x0){return db[_0xd870('0x57')]['create']({'name':_0x4bd445[_0xd870('0x32')],'resourceId':_0x4bd445['id'],'type':_0x16e2f4[_0xd870('0x32')],'sectionId':_0x16e2f4['id']},{})[_0xd870('0x29')](function(){return _0x400f4e;});}else{return _0x400f4e;}})[_0xd870('0x4c')](function(_0x128b40){logger['error'](_0xd870('0x58'),_0x128b40);throw _0x128b40;});}return _0x400f4e;})[_0xd870('0x29')](respondWithResult(_0x2c19c6,0xc9))['catch'](handleError(_0x2c19c6,null));};exports[_0xd870('0x59')]=function(_0xf1b544,_0x14e4a6){var _0x3feffd={'where':{'id':_0xf1b544[_0xd870('0x4d')]['id']}},_0x5c15a1={};_0x5c15a1['model']=_[_0xd870('0x3a')](db[_0xd870('0x35')][_0xd870('0x5a')]);_0x3feffd[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x5c15a1[_0xd870('0x38')],qs['fields'](_0xf1b544['query'][_0xd870('0x3e')]));_0x3feffd['attributes']=_0x3feffd[_0xd870('0x3d')][_0xd870('0x3f')]?_0x3feffd[_0xd870('0x3d')]:_0x5c15a1['model'];if(_0xf1b544[_0xd870('0x39')][_0xd870('0x48')]){_0x3feffd[_0xd870('0x49')]=[{'all':!![]}];}_0x3feffd=_['merge']({},_0x3feffd,_0xf1b544['options']);return db[_0xd870('0x35')][_0xd870('0x30')](_0x3feffd)['then'](handleEntityNotFound(_0x14e4a6,null))[_0xd870('0x29')](function(_0x746e00){if(_0x746e00){var _0x9c365=_0x746e00[_0xd870('0x51')]({'plain':!![]});_0x9c365=qs['omit'](_0x9c365,['id',_0xd870('0x5b'),_0xd870('0x5c')]);_0xf1b544[_0xd870('0x4f')]=_[_0xd870('0x5d')](_0xf1b544[_0xd870('0x4f')],['id','createdAt','updatedAt']);return db[_0xd870('0x35')][_0xd870('0x4e')](_[_0xd870('0x45')](_0x9c365,_0xf1b544[_0xd870('0x4f')]),{'include':_0xf1b544['query'][_0xd870('0x48')]?[{'all':!![]}]:undefined})[_0xd870('0x29')](function(_0x2adf5e){var _0x51e771=_0xf1b544[_0xd870('0x50')][_0xd870('0x51')]({'plain':!![]});if(!_0x51e771)throw new Error(_0xd870('0x52'));if(_0x51e771[_0xd870('0x53')]===_0xd870('0x50')){var _0x10c08f=_0x2adf5e[_0xd870('0x51')]({'plain':!![]});var _0x25ce00=[{'name':_0xd870('0x2a'),'value':_0xd870('0x2b')},{'name':_0xd870('0x2c'),'value':'outbound'}];var _0x1b335a=_[_0xd870('0x30')](_0x25ce00,['value',_0x10c08f['type']])[_0xd870('0x32')];return db[_0xd870('0x54')]['find']({'where':{'name':_0x1b335a,'userProfileId':_0x51e771['userProfileId']},'raw':!![]})[_0xd870('0x29')](function(_0x206ade){if(_0x206ade&&_0x206ade[_0xd870('0x56')]===0x0){return db[_0xd870('0x57')][_0xd870('0x4e')]({'name':_0x10c08f[_0xd870('0x32')],'resourceId':_0x10c08f['id'],'type':_0x206ade['name'],'sectionId':_0x206ade['id']},{})[_0xd870('0x29')](function(){return _0x2adf5e;});}else{return _0x2adf5e;}})[_0xd870('0x4c')](function(_0x5ee0b0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee0b0);throw _0x5ee0b0;});}return _0x2adf5e;});}})[_0xd870('0x29')](respondWithResult(_0x14e4a6,0xc9))[_0xd870('0x4c')](handleError(_0x14e4a6,null));};exports[_0xd870('0x28')]=function(_0x306f00,_0x149094){if(_0x306f00['body']['id']){delete _0x306f00[_0xd870('0x4f')]['id'];}return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x306f00['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x149094,null))[_0xd870('0x29')](saveUpdates(_0x306f00[_0xd870('0x4f')],null))[_0xd870('0x29')](respondWithResult(_0x149094,null))[_0xd870('0x4c')](handleError(_0x149094,null));};exports[_0xd870('0x5e')]=function(_0x43ce47,_0x2ce180){return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x43ce47[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2ce180,null))[_0xd870('0x29')](removeEntity(_0x2ce180,null))[_0xd870('0x4c')](handleError(_0x2ce180,null));};exports[_0xd870('0x5f')]=function(_0x5b7d55,_0x2f96a5,_0x1d8cbd){var _0x1dd047={'raw':![],'where':{}};var _0x4758eb={};var _0x3daa2e={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x5b7d55[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2f96a5,null))[_0xd870('0x29')](function(_0x51a285){if(_0x51a285){_0x4758eb['model']=_[_0xd870('0x3a')](db['CmHopper'][_0xd870('0x5a')]);_0x4758eb[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x5b7d55[_0xd870('0x39')]);_0x4758eb[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x4758eb[_0xd870('0x38')],_0x4758eb[_0xd870('0x39')]);_0x1dd047[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x4758eb['model'],qs[_0xd870('0x3e')](_0x5b7d55['query']['fields']));_0x1dd047[_0xd870('0x3d')]=_0x1dd047['attributes']['length']?_0x1dd047[_0xd870('0x3d')]:_0x4758eb[_0xd870('0x38')];if(!_0x5b7d55[_0xd870('0x39')]['hasOwnProperty']('nolimit')){_0x1dd047[_0xd870('0x21')]=qs['limit'](_0x5b7d55[_0xd870('0x39')]['limit']);_0x1dd047['offset']=qs[_0xd870('0x23')](_0x5b7d55[_0xd870('0x39')][_0xd870('0x23')]);}_0x1dd047[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x5b7d55[_0xd870('0x39')][_0xd870('0x42')]);_0x1dd047['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x5b7d55[_0xd870('0x39')],_0x4758eb[_0xd870('0x3b')]));_0x1dd047['where'][_0xd870('0x61')]=_0x51a285['id'];if(_0x5b7d55[_0xd870('0x39')]['filter']){_0x1dd047[_0xd870('0x43')]=_[_0xd870('0x45')](_0x1dd047[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x1dd047['attributes'],function(_0x35bee1){var _0x11cf08={};_0x11cf08[_0x35bee1]={'$like':'%'+_0x5b7d55['query'][_0xd870('0x2d')]+'%'};return _0x11cf08;})});}_0x1dd047=_[_0xd870('0x45')]({},_0x1dd047,_0x5b7d55[_0xd870('0x47')]);return db[_0xd870('0x62')]['count']({'where':_0x1dd047[_0xd870('0x43')]})[_0xd870('0x29')](function(_0x23d3a4){_0x3daa2e[_0xd870('0x22')]=_0x23d3a4;if(_0x5b7d55[_0xd870('0x39')][_0xd870('0x48')]){_0x1dd047[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1dd047);})[_0xd870('0x29')](function(_0x1dbc13){_0x3daa2e['rows']=_0x1dbc13;return _0x3daa2e;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x2f96a5,_0x1dd047))[_0xd870('0x4c')](handleError(_0x2f96a5,null));};exports[_0xd870('0x63')]=function(_0xddee85,_0x58d4fb,_0x59daa3){var _0x5149df={'raw':!![],'where':{}};var _0x5bca31={};var _0x382c29={'count':0x0,'rows':[]};return db[_0xd870('0x35')]['findOne']({'where':{'id':_0xddee85[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x58d4fb,null))[_0xd870('0x29')](function(_0x1e6a75){if(_0x1e6a75){_0x5bca31[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x64')]['rawAttributes']);_0x5bca31['query']=_[_0xd870('0x3a')](_0xddee85[_0xd870('0x39')]);_0x5bca31[_0xd870('0x3b')]=_['intersection'](_0x5bca31[_0xd870('0x38')],_0x5bca31[_0xd870('0x39')]);_0x5149df[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x5bca31['model'],qs[_0xd870('0x3e')](_0xddee85[_0xd870('0x39')][_0xd870('0x3e')]));_0x5149df[_0xd870('0x3d')]=_0x5149df[_0xd870('0x3d')][_0xd870('0x3f')]?_0x5149df[_0xd870('0x3d')]:_0x5bca31['model'];if(!_0xddee85['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x5149df[_0xd870('0x21')]=qs[_0xd870('0x21')](_0xddee85['query']['limit']);_0x5149df[_0xd870('0x23')]=qs[_0xd870('0x23')](_0xddee85[_0xd870('0x39')][_0xd870('0x23')]);}_0x5149df[_0xd870('0x41')]=qs['sort'](_0xddee85['query'][_0xd870('0x42')]);_0x5149df[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0xddee85[_0xd870('0x39')],_0x5bca31[_0xd870('0x3b')]));_0x5149df[_0xd870('0x43')][_0xd870('0x61')]=_0x1e6a75['id'];if(_0xddee85[_0xd870('0x39')][_0xd870('0x2d')]){_0x5149df[_0xd870('0x43')]=_[_0xd870('0x45')](_0x5149df[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x5149df[_0xd870('0x3d')],function(_0x5aaca5){var _0x5b4ab3={};_0x5b4ab3[_0x5aaca5]={'$like':'%'+_0xddee85[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x5b4ab3;})});}_0x5149df=_[_0xd870('0x45')]({},_0x5149df,_0xddee85[_0xd870('0x47')]);return db[_0xd870('0x64')][_0xd870('0x22')]({'where':_0x5149df[_0xd870('0x43')]})[_0xd870('0x29')](function(_0x49bd7f){_0x382c29[_0xd870('0x22')]=_0x49bd7f;if(_0xddee85[_0xd870('0x39')][_0xd870('0x48')]){_0x5149df[_0xd870('0x49')]=[{'all':!![]}];}return db[_0xd870('0x64')][_0xd870('0x4a')](_0x5149df);})['then'](function(_0x1886ce){_0x382c29[_0xd870('0x4b')]=_0x1886ce;return _0x382c29;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x58d4fb,_0x5149df))[_0xd870('0x4c')](handleError(_0x58d4fb,null));};exports['getHopperFinals']=function(_0x269233,_0x144d71,_0x4089d4){var _0xb619b8={'raw':!![],'where':{}};var _0x59a66b={};var _0x2f8395={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x269233['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x144d71,null))['then'](function(_0x12db91){if(_0x12db91){_0x59a66b['model']=_[_0xd870('0x3a')](db['CmHopperFinal'][_0xd870('0x5a')]);_0x59a66b['query']=_['keys'](_0x269233[_0xd870('0x39')]);_0x59a66b[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x59a66b['model'],_0x59a66b['query']);_0xb619b8[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x59a66b[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x269233[_0xd870('0x39')][_0xd870('0x3e')]));_0xb619b8['attributes']=_0xb619b8[_0xd870('0x3d')]['length']?_0xb619b8[_0xd870('0x3d')]:_0x59a66b[_0xd870('0x38')];if(!_0x269233[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0xb619b8[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x269233[_0xd870('0x39')]['limit']);_0xb619b8[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x269233[_0xd870('0x39')]['offset']);}_0xb619b8[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x269233[_0xd870('0x39')][_0xd870('0x42')]);_0xb619b8[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x269233[_0xd870('0x39')],_0x59a66b[_0xd870('0x3b')]));_0xb619b8[_0xd870('0x43')][_0xd870('0x61')]=_0x12db91['id'];if(_0x269233[_0xd870('0x39')][_0xd870('0x2d')]){_0xb619b8[_0xd870('0x43')]=_[_0xd870('0x45')](_0xb619b8['where'],{'$or':_['map'](_0xb619b8[_0xd870('0x3d')],function(_0x5da36c){var _0x4af142={};_0x4af142[_0x5da36c]={'$like':'%'+_0x269233[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x4af142;})});}_0xb619b8=_['merge']({},_0xb619b8,_0x269233[_0xd870('0x47')]);return db['CmHopperFinal']['count']({'where':_0xb619b8['where']})[_0xd870('0x29')](function(_0x4cb610){_0x2f8395[_0xd870('0x22')]=_0x4cb610;if(_0x269233[_0xd870('0x39')][_0xd870('0x48')]){_0xb619b8[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd870('0x4a')](_0xb619b8);})[_0xd870('0x29')](function(_0x507995){_0x2f8395[_0xd870('0x4b')]=_0x507995;return _0x2f8395;});}})[_0xd870('0x29')](respondWithFilteredResult(_0x144d71,_0xb619b8))['catch'](handleError(_0x144d71,null));};exports[_0xd870('0x66')]=function(_0x1b4a4c,_0x11fc04,_0x83ed91){var _0x48a835={'raw':!![],'where':{}};var _0x57b228={};var _0x2cfd76={'count':0x0,'rows':[]};return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x1b4a4c[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x11fc04,null))[_0xd870('0x29')](function(_0x4fbd8d){if(_0x4fbd8d){_0x57b228[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x67')][_0xd870('0x5a')]);_0x57b228[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x1b4a4c[_0xd870('0x39')]);_0x57b228[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x57b228['model'],_0x57b228[_0xd870('0x39')]);_0x48a835[_0xd870('0x3d')]=_['intersection'](_0x57b228[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x1b4a4c[_0xd870('0x39')]['fields']));_0x48a835[_0xd870('0x3d')]=_0x48a835['attributes'][_0xd870('0x3f')]?_0x48a835[_0xd870('0x3d')]:_0x57b228[_0xd870('0x38')];if(!_0x1b4a4c[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x48a835[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x1b4a4c['query']['limit']);_0x48a835[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x1b4a4c[_0xd870('0x39')][_0xd870('0x23')]);}_0x48a835[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x1b4a4c[_0xd870('0x39')][_0xd870('0x42')]);_0x48a835['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x1b4a4c['query'],_0x57b228[_0xd870('0x3b')]));_0x48a835['where'][_0xd870('0x61')]=_0x4fbd8d['id'];if(_0x1b4a4c[_0xd870('0x39')][_0xd870('0x2d')]){_0x48a835[_0xd870('0x43')]=_['merge'](_0x48a835[_0xd870('0x43')],{'$or':_['map'](_0x48a835['attributes'],function(_0x45ec72){var _0x5c8201={};_0x5c8201[_0x45ec72]={'$like':'%'+_0x1b4a4c[_0xd870('0x39')]['filter']+'%'};return _0x5c8201;})});}_0x48a835=_[_0xd870('0x45')]({},_0x48a835,_0x1b4a4c['options']);return db['CmHopperBlack'][_0xd870('0x22')]({'where':_0x48a835['where']})[_0xd870('0x29')](function(_0x1ae4c2){_0x2cfd76[_0xd870('0x22')]=_0x1ae4c2;if(_0x1b4a4c['query'][_0xd870('0x48')]){_0x48a835[_0xd870('0x49')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd870('0x4a')](_0x48a835);})[_0xd870('0x29')](function(_0x278810){_0x2cfd76[_0xd870('0x4b')]=_0x278810;return _0x2cfd76;});}})['then'](respondWithFilteredResult(_0x11fc04,_0x48a835))[_0xd870('0x4c')](handleError(_0x11fc04,null));};exports[_0xd870('0x68')]=function(_0x208dbf,_0x192ce6,_0x3b9758){var _0x5792f2={};var _0x5d6e21={};var _0x2bb53e;var _0x55f51d;return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x208dbf['params']['id']}})['then'](handleEntityNotFound(_0x192ce6,null))[_0xd870('0x29')](function(_0x3ca828){if(_0x3ca828){_0x2bb53e=_0x3ca828;_0x5d6e21['model']=_['keys'](db[_0xd870('0x69')][_0xd870('0x5a')]);_0x5d6e21[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x208dbf[_0xd870('0x39')]);_0x5d6e21[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x5d6e21[_0xd870('0x38')],_0x5d6e21['query']);_0x5792f2[_0xd870('0x3d')]=_['intersection'](_0x5d6e21['model'],qs[_0xd870('0x3e')](_0x208dbf[_0xd870('0x39')][_0xd870('0x3e')]));_0x5792f2[_0xd870('0x3d')]=_0x5792f2['attributes'][_0xd870('0x3f')]?_0x5792f2['attributes']:_0x5d6e21[_0xd870('0x38')];_0x5792f2['order']=qs[_0xd870('0x42')](_0x208dbf[_0xd870('0x39')][_0xd870('0x42')]);_0x5792f2[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x208dbf[_0xd870('0x39')],_0x5d6e21['filters']));if(_0x208dbf[_0xd870('0x39')][_0xd870('0x2d')]){_0x5792f2[_0xd870('0x43')]=_['merge'](_0x5792f2[_0xd870('0x43')],{'$or':_[_0xd870('0x2e')](_0x5792f2[_0xd870('0x3d')],function(_0x2a74c6){var _0x443c6b={};_0x443c6b[_0x2a74c6]={'$like':'%'+_0x208dbf[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x443c6b;})});}_0x5792f2=_['merge']({},_0x5792f2,_0x208dbf[_0xd870('0x47')]);return _0x2bb53e[_0xd870('0x68')](_0x5792f2);}})[_0xd870('0x29')](function(_0x104211){if(_0x104211){_0x55f51d=_0x104211[_0xd870('0x3f')];if(!_0x208dbf[_0xd870('0x39')]['hasOwnProperty']('nolimit')){_0x5792f2['limit']=qs[_0xd870('0x21')](_0x208dbf['query'][_0xd870('0x21')]);_0x5792f2[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x208dbf[_0xd870('0x39')][_0xd870('0x23')]);}return _0x2bb53e[_0xd870('0x68')](_0x5792f2);}})[_0xd870('0x29')](function(_0x5170e2){if(_0x5170e2){return _0x5170e2?{'count':_0x55f51d,'rows':_0x5170e2}:null;}})[_0xd870('0x29')](respondWithResult(_0x192ce6,null))[_0xd870('0x4c')](handleError(_0x192ce6,null));};exports[_0xd870('0x6a')]=function(_0x3d8571,_0x499e62,_0x1748dc){var _0x3a692d=_0x3d8571['body'][_0xd870('0x6b')];var _0x35d85d=_[_0xd870('0x2e')](_0x3a692d,'id');return db[_0xd870('0x69')][_0xd870('0x4a')]({'where':{'id':_0x35d85d},'attributes':['id'],'include':[{'model':db[_0xd870('0x6c')],'as':_0xd870('0x6d'),'attributes':['id',_0xd870('0x32'),'online',_0xd870('0x6e'),_0xd870('0x6f')],'raw':!![]}]})[_0xd870('0x29')](function(_0x39c37b){if(_0x39c37b){var _0x376756=_[_0xd870('0x70')](_0x39c37b,function(_0x4c302d){var _0x2c0984=_0x4c302d[_0xd870('0x51')]({'plain':!![]});_0x2c0984['Agents'][_0xd870('0x71')](function(_0x586d0f){_0x586d0f[_0xd870('0x72')]=_[_0xd870('0x30')](_0x3a692d,{'id':_0x2c0984['id']})[_0xd870('0x72')];});return _0x2c0984['Agents'];});return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x3d8571[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](function(_0x366234){return db[_0xd870('0x73')]['transaction'](function(_0x5e0590){return _0x366234[_0xd870('0x6a')](_0x35d85d,{'transaction':_0x5e0590})[_0xd870('0x29')](function(){return BPromise[_0xd870('0x74')](_0x3a692d,function(_0x2ff264){return db['TeamVoiceQueue'][_0xd870('0x75')]({'TeamId':_0x2ff264['id'],'VoiceQueueId':_0x3d8571['params']['id'],'penalty':_0x2ff264['penalty']},{'transaction':_0x5e0590});});})['then'](function(){return BPromise[_0xd870('0x74')](_0x376756,function(_0x1b07ea){return db[_0xd870('0x76')][_0xd870('0x77')]({'where':{'UserId':_0x1b07ea['id'],'VoiceQueueId':_0x3d8571[_0xd870('0x4d')]['id']},'defaults':{'penalty':_0x1b07ea['penalty']},'transaction':_0x5e0590});});})[_0xd870('0x29')](function(){return BPromise[_0xd870('0x74')](_[_0xd870('0x2d')](_0x376756,{'online':!![]}),function(_0x4c8048){return db[_0xd870('0x78')]['upsert']({'membername':_0x4c8048[_0xd870('0x32')],'UserId':_0x4c8048['id'],'queue_name':_0x366234[_0xd870('0x32')],'VoiceQueueId':_0x366234['id'],'interface':_[_0xd870('0x79')](_0x4c8048[_0xd870('0x6f')])?util[_0xd870('0x7a')](_0xd870('0x7b'),_0x4c8048[_0xd870('0x32')]):_0x4c8048[_0xd870('0x6f')],'paused':_0x4c8048[_0xd870('0x6e')]||![],'penalty':_0x4c8048['penalty']},{'transaction':_0x5e0590});});})[_0xd870('0x29')](function(){_0x376756[_0xd870('0x71')](function(_0xeaeff7){socket[_0xd870('0x7c')](_0xd870('0x7d'),{'UserId':_0xeaeff7['id'],'VoiceQueueId':_0x366234['id']});});});});});}})[_0xd870('0x29')](respondWithStatusCode(_0x499e62,null))[_0xd870('0x4c')](handleError(_0x499e62,null));};exports['removeTeams']=function(_0x118773,_0x833af8,_0x25b337){return db[_0xd870('0x69')]['findAll']({'where':{'id':_0x118773['query'][_0xd870('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xd870('0x6c')],'as':_0xd870('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xd870('0x29')](handleEntityNotFound(_0x833af8,null))[_0xd870('0x29')](function(_0x42b991){var _0x427eb5=_['map'](_0x42b991,'id');var _0x75ed69=[];var _0x2091bf=[];var _0x274915=squel['select']();_0x274915[_0xd870('0x7f')](_0xd870('0x80'))[_0xd870('0x81')]('team_has_voice_queues','tq')[_0xd870('0x82')]('user_has_teams','ut',_0xd870('0x83'))[_0xd870('0x43')]('VoiceQueueId\x20=\x20?',_0x118773[_0xd870('0x4d')]['id']);for(var _0x5a5794=0x0;_0x5a5794<_0x42b991['length'];_0x5a5794+=0x1){let _0x43aa5a=_0x42b991[_0x5a5794];for(var _0x1c5d6f=0x0;_0x1c5d6f<_0x43aa5a[_0xd870('0x6d')][_0xd870('0x3f')];_0x1c5d6f+=0x1){let _0x1d6f0e=_0x43aa5a[_0xd870('0x6d')][_0x1c5d6f];var _0x2a883e=_0x274915['clone']();_0x2a883e[_0xd870('0x43')](_0xd870('0x84'),_0x1d6f0e['id']);_0x2091bf[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x2a883e[_0xd870('0x86')](),{'type':db[_0xd870('0x73')]['QueryTypes'][_0xd870('0x87')]})[_0xd870('0x29')](function(_0x353820){if(_0x353820[_0xd870('0x3f')]===0x1){return _0x1d6f0e['id'];}else{var _0x2ea311=_[_0xd870('0x88')](_[_0xd870('0x2e')](_0x353820,_0xd870('0x89')),function(_0x101e99){return _[_0xd870('0x8a')](_0x427eb5,_0x101e99);});if(_0x2ea311){return _0x1d6f0e['id'];}}}));}}return BPromise[_0xd870('0x8b')](_0x2091bf)[_0xd870('0x29')](function(_0x5819dd){_0x75ed69=_(_0x75ed69)[_0xd870('0x8c')](_0x5819dd)[_0xd870('0x8d')]()[_0xd870('0x2f')]();return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x118773[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](function(_0x29079c){return db[_0xd870('0x73')][_0xd870('0x8e')](function(_0x3f176f){return _0x29079c['removeTeams'](_0x118773[_0xd870('0x39')][_0xd870('0x7e')],{'transaction':_0x3f176f})[_0xd870('0x29')](function(){if(!_[_0xd870('0x8f')](_0x75ed69)){return _0x29079c[_0xd870('0x90')](_0x75ed69,{'transaction':_0x3f176f})[_0xd870('0x29')](function(){return db['UserVoiceQueueRt'][_0xd870('0x5e')]({'where':{'VoiceQueueId':_0x118773[_0xd870('0x4d')]['id'],'UserId':_0x75ed69},'transaction':_0x3f176f});});}})[_0xd870('0x29')](function(){_0x75ed69['forEach'](function(_0x1111e0){socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':_0x1111e0,'VoiceQueueId':_0x29079c['id']});});});});});});})[_0xd870('0x29')](respondWithStatusCode(_0x833af8,null))[_0xd870('0x4c')](handleError(_0x833af8,null));};exports[_0xd870('0x91')]=function(_0x16ffc3,_0x4fac07,_0x2dd050){var _0x5bd473,_0x34bbcf;return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x16ffc3[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x4fac07,null))['then'](function(_0x127515){if(_0x127515){_0x34bbcf=_0x127515;return _0x127515['addAgents'](_0x16ffc3['body'][_0xd870('0x7e')],_['omit'](_0x16ffc3[_0xd870('0x4f')],[_0xd870('0x7e'),'id'])||{})[_0xd870('0x92')](function(_0x1fceed){for(var _0x4f7eef=0x0;_0x4f7eef<_0x16ffc3[_0xd870('0x4f')]['ids'][_0xd870('0x3f')];_0x4f7eef+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x16ffc3[_0xd870('0x4f')][_0xd870('0x7e')][_0x4f7eef]),'VoiceQueueId':Number(_0x16ffc3[_0xd870('0x4d')]['id'])});}return _0x1fceed;});}})[_0xd870('0x29')](function(_0x3b3218){_0x5bd473=_0x3b3218||[];if(_0x34bbcf){return db[_0xd870('0x6c')][_0xd870('0x4a')]({'where':{'id':_0x16ffc3[_0xd870('0x4f')]['ids']},'attributes':['id',_0xd870('0x32'),_0xd870('0x93'),_0xd870('0x6e'),_0xd870('0x6f')],'raw':!![]});}})['then'](function(_0x47b29a){if(!_[_0xd870('0x8f')](_0x47b29a)){var _0x5cca7a=[];for(var _0x4b5767=0x0;_0x4b5767<_0x47b29a[_0xd870('0x3f')];_0x4b5767++){if(_0x47b29a[_0x4b5767]['online']){_0x5cca7a[_0xd870('0x85')](db[_0xd870('0x78')][_0xd870('0x75')]({'membername':_0x47b29a[_0x4b5767][_0xd870('0x32')],'UserId':_0x47b29a[_0x4b5767]['id'],'queue_name':_0x34bbcf[_0xd870('0x32')],'VoiceQueueId':_0x34bbcf['id'],'interface':_[_0xd870('0x79')](_0x47b29a[_0x4b5767][_0xd870('0x6f')])?util['format'](_0xd870('0x7b'),_0x47b29a[_0x4b5767]['name']):_0x47b29a[_0x4b5767]['interface'],'paused':_0x47b29a[_0x4b5767]['voicePause']||![],'penalty':_0x16ffc3[_0xd870('0x4f')][_0xd870('0x72')]||0x0}));}}return BPromise[_0xd870('0x8b')](_0x5cca7a);}})[_0xd870('0x29')](function(){return _0x5bd473;})['then'](respondWithResult(_0x4fac07,null))['catch'](handleError(_0x4fac07,null));};exports['removeAgents']=function(_0x125ba1,_0x276114,_0x1b0b1d){return db['VoiceQueue'][_0xd870('0x30')]({'where':{'id':_0x125ba1[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x276114,null))[_0xd870('0x29')](function(_0xccadbf){if(_0xccadbf){return _0xccadbf[_0xd870('0x90')](_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')])[_0xd870('0x29')](function(){if(_[_0xd870('0x94')](_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')])){for(var _0x12d247=0x0;_0x12d247<_0x125ba1[_0xd870('0x39')]['ids'][_0xd870('0x3f')];_0x12d247+=0x1){socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x125ba1['query']['ids'][_0x12d247]),'VoiceQueueId':Number(_0x125ba1[_0xd870('0x4d')]['id'])});}}else{socket[_0xd870('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x125ba1[_0xd870('0x39')][_0xd870('0x7e')]),'VoiceQueueId':Number(_0x125ba1[_0xd870('0x4d')]['id'])});}});}})[_0xd870('0x29')](function(_0x196013){return db[_0xd870('0x78')][_0xd870('0x5e')]({'where':{'VoiceQueueId':_0x125ba1[_0xd870('0x4d')]['id'],'UserId':_0x125ba1[_0xd870('0x39')]['ids']}})[_0xd870('0x29')](function(){return _0x196013;});})[_0xd870('0x29')](respondWithStatusCode(_0x276114,null))[_0xd870('0x4c')](handleError(_0x276114,null));};exports[_0xd870('0x95')]=function(_0x3f6c54,_0x2b6780,_0x11115e){var _0x407b80={};var _0x1e0b32={};var _0x111ab6;var _0x36884c;return db['VoiceQueue'][_0xd870('0x60')]({'where':{'id':_0x3f6c54['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2b6780,null))[_0xd870('0x29')](function(_0x4e32b8){if(_0x4e32b8){_0x111ab6=_0x4e32b8;_0x1e0b32[_0xd870('0x38')]=_[_0xd870('0x3a')](db['User']['rawAttributes']);_0x1e0b32[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x3f6c54[_0xd870('0x39')]);_0x1e0b32[_0xd870('0x3b')]=_['intersection'](_0x1e0b32[_0xd870('0x38')],_0x1e0b32['query']);_0x407b80['attributes']=_[_0xd870('0x3c')](_0x1e0b32['model'],qs[_0xd870('0x3e')](_0x3f6c54['query'][_0xd870('0x3e')]));_0x407b80['attributes']=_0x407b80[_0xd870('0x3d')][_0xd870('0x3f')]?_0x407b80['attributes']:_0x1e0b32[_0xd870('0x38')];_0x407b80[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x3f6c54[_0xd870('0x39')][_0xd870('0x42')]);_0x407b80[_0xd870('0x43')]=qs['filters'](_[_0xd870('0x44')](_0x3f6c54['query'],_0x1e0b32['filters']));if(_0x3f6c54['query'][_0xd870('0x2d')]){_0x407b80[_0xd870('0x43')]=_[_0xd870('0x45')](_0x407b80['where'],{'$or':_[_0xd870('0x2e')](_0x407b80[_0xd870('0x3d')],function(_0x1eba64){var _0x1f6f80={};_0x1f6f80[_0x1eba64]={'$like':'%'+_0x3f6c54[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x1f6f80;})});}_0x407b80=_[_0xd870('0x45')]({},_0x407b80,_0x3f6c54['options']);return _0x111ab6['getAgents'](_0x407b80);}})[_0xd870('0x29')](function(_0x1c5239){if(_0x1c5239){_0x36884c=_0x1c5239[_0xd870('0x3f')];if(!_0x3f6c54[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x407b80['limit']=qs[_0xd870('0x21')](_0x3f6c54[_0xd870('0x39')][_0xd870('0x21')]);_0x407b80['offset']=qs['offset'](_0x3f6c54[_0xd870('0x39')]['offset']);}return _0x111ab6[_0xd870('0x95')](_0x407b80);}})[_0xd870('0x29')](function(_0x52b668){if(_0x52b668){return _0x52b668?{'count':_0x36884c,'rows':_0x52b668}:null;}})[_0xd870('0x29')](respondWithResult(_0x2b6780,null))[_0xd870('0x4c')](handleError(_0x2b6780,null));};exports[_0xd870('0x96')]=function(_0x2a2ef9,_0x367a5a,_0x47e6f7){var _0x3bda0c={};var _0x313da5={};var _0x2fc6c0;var _0x510935;return db[_0xd870('0x35')][_0xd870('0x60')]({'where':{'id':_0x2a2ef9[_0xd870('0x4d')]['id']}})['then'](handleEntityNotFound(_0x367a5a,null))[_0xd870('0x29')](function(_0x432cfd){if(_0x432cfd){_0x2fc6c0=_0x432cfd;_0x313da5[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x78')]['rawAttributes']);_0x313da5['query']=_[_0xd870('0x3a')](_0x2a2ef9[_0xd870('0x39')]);_0x313da5[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x313da5[_0xd870('0x38')],_0x313da5[_0xd870('0x39')]);_0x3bda0c[_0xd870('0x3d')]=_['intersection'](_0x313da5['model'],qs['fields'](_0x2a2ef9[_0xd870('0x39')]['fields']));_0x3bda0c[_0xd870('0x3d')]=_0x3bda0c[_0xd870('0x3d')][_0xd870('0x3f')]?_0x3bda0c[_0xd870('0x3d')]:_0x313da5[_0xd870('0x38')];_0x3bda0c[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x2a2ef9['query'][_0xd870('0x42')]);_0x3bda0c[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x2a2ef9['query'],_0x313da5['filters']));if(_0x2a2ef9[_0xd870('0x39')]['filter']){_0x3bda0c[_0xd870('0x43')]=_[_0xd870('0x45')](_0x3bda0c['where'],{'$or':_['map'](_0x3bda0c['attributes'],function(_0x44e25b){var _0x332d17={};_0x332d17[_0x44e25b]={'$like':'%'+_0x2a2ef9[_0xd870('0x39')]['filter']+'%'};return _0x332d17;})});}_0x3bda0c=_[_0xd870('0x45')]({},_0x3bda0c,_0x2a2ef9['options']);return _0x2fc6c0['getMembers'](_0x3bda0c);}})['then'](function(_0x160213){if(_0x160213){_0x510935=_0x160213[_0xd870('0x3f')];if(!_0x2a2ef9['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x3bda0c[_0xd870('0x21')]=qs['limit'](_0x2a2ef9['query']['limit']);_0x3bda0c[_0xd870('0x23')]=qs[_0xd870('0x23')](_0x2a2ef9['query'][_0xd870('0x23')]);}return _0x2fc6c0[_0xd870('0x96')](_0x3bda0c);}})[_0xd870('0x29')](function(_0x425611){return _0x425611?{'count':_0x510935,'rows':_0x425611}:null;})[_0xd870('0x29')](respondWithResult(_0x367a5a,null))[_0xd870('0x4c')](handleError(_0x367a5a,null));};exports[_0xd870('0x97')]=function(_0x53e791,_0xac12af,_0x59912b){var _0x18ac36={};var _0x45d68f={};var _0x5bd974;var _0x29f230;return db['VoiceQueue']['findOne']({'where':{'id':_0x53e791[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0xac12af,null))['then'](function(_0x46a55a){if(_0x46a55a){_0x5bd974=_0x46a55a;_0x45d68f[_0xd870('0x38')]=_[_0xd870('0x3a')](db[_0xd870('0x98')]['rawAttributes']);_0x45d68f[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x53e791[_0xd870('0x39')]);_0x45d68f[_0xd870('0x3b')]=_[_0xd870('0x3c')](_0x45d68f['model'],_0x45d68f[_0xd870('0x39')]);_0x18ac36[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0x45d68f[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x53e791['query']['fields']));_0x18ac36['attributes']=_0x18ac36['attributes'][_0xd870('0x3f')]?_0x18ac36[_0xd870('0x3d')]:_0x45d68f[_0xd870('0x38')];_0x18ac36['order']=qs[_0xd870('0x42')](_0x53e791[_0xd870('0x39')]['sort']);_0x18ac36[_0xd870('0x43')]=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x53e791[_0xd870('0x39')],_0x45d68f[_0xd870('0x3b')]));if(_0x53e791[_0xd870('0x39')][_0xd870('0x2d')]){_0x18ac36['where']=_['merge'](_0x18ac36['where'],{'$or':_['map'](_0x18ac36['attributes'],function(_0x15c84c){var _0x4f1a2c={};_0x4f1a2c[_0x15c84c]={'$like':'%'+_0x53e791[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x4f1a2c;})});}_0x18ac36=_[_0xd870('0x45')]({},_0x18ac36,_0x53e791[_0xd870('0x47')]);return _0x5bd974[_0xd870('0x97')](_0x18ac36);}})[_0xd870('0x29')](function(_0x1101be){if(_0x1101be){_0x29f230=_0x1101be[_0xd870('0x3f')];if(!_0x53e791['query'][_0xd870('0x40')](_0xd870('0x65'))){_0x18ac36[_0xd870('0x21')]=qs[_0xd870('0x21')](_0x53e791[_0xd870('0x39')][_0xd870('0x21')]);_0x18ac36['offset']=qs['offset'](_0x53e791[_0xd870('0x39')]['offset']);}return _0x5bd974[_0xd870('0x97')](_0x18ac36);}})['then'](function(_0x1eb90e){if(_0x1eb90e){return _0x1eb90e?{'count':_0x29f230,'rows':_0x1eb90e}:null;}})['then'](respondWithResult(_0xac12af,null))[_0xd870('0x4c')](handleError(_0xac12af,null));};exports['addLists']=function(_0x1ad4ff,_0x36730e,_0x59c117){var _0x5a89c=moment()[_0xd870('0x7a')](_0xd870('0x99'));var _0x2ad18e,_0x41164a;return db['VoiceQueue']['find']({'where':{'id':_0x1ad4ff['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x36730e,null))[_0xd870('0x29')](function(_0x53b94f){if(_0x53b94f){_0x41164a=_0x53b94f;return _0x53b94f[_0xd870('0x9a')](_0x1ad4ff[_0xd870('0x4f')][_0xd870('0x7e')],_[_0xd870('0x5d')](_0x1ad4ff[_0xd870('0x4f')],[_0xd870('0x7e'),'id'])||{});}return null;})[_0xd870('0x92')](function(_0x29d1cf){var _0x1d5fe5;_0x2ad18e=_0x29d1cf||[];var _0x3be94b=[];if(_0x29d1cf){for(var _0x2377b0=0x0;_0x2377b0<_0x29d1cf[_0xd870('0x3f')];_0x2377b0+=0x1){var _0x8eaa34=_0x29d1cf[_0x2377b0][_0xd870('0x51')]({'plain':!![]});_0x41164a[_0xd870('0x9b')]=_0x1ad4ff['body'][_0xd870('0x9b')]?_0x1ad4ff[_0xd870('0x4f')][_0xd870('0x9b')]:_0x41164a[_0xd870('0x9b')];switch(_0x41164a['dialCheckDuplicateType']){case _0xd870('0x9c'):_0x1d5fe5=squel[_0xd870('0x9d')]()[_0xd870('0x9e')](_0xd870('0x9f'))[_0xd870('0xa0')]([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel['select']()[_0xd870('0x7f')]('phone','phone')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','scheduledAt')['field']('id',_0xd870('0xa3'))['field'](_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id']['toString'](),_0xd870('0x61'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5b'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from'](_0xd870('0xa6'))[_0xd870('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xd870('0xa7'),_0x8eaa34['CmListId']['toString']())['where'](_0xd870('0xa8'))[_0xd870('0x43')](_0xd870('0xa9'),squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xab'))[_0xd870('0x81')](_0xd870('0xac'))[_0xd870('0x43')](_0xd870('0xad'),_0x1ad4ff['params']['id']['toString']()))[_0xd870('0x43')](_0xd870('0xa9'),squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xae'))[_0xd870('0x81')](_0xd870('0x9f'))[_0xd870('0x43')]('VoiceQueueId\x20=\x20?',_0x1ad4ff['params']['id'][_0xd870('0x86')]())))[_0xd870('0x86')]();break;case _0xd870('0xaf'):_0x1d5fe5=squel['insert']()['into'](_0xd870('0x9f'))['fromQuery']([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel['select']()[_0xd870('0x7f')]('phone',_0xd870('0xa1'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0xa2'))[_0xd870('0x7f')]('id',_0xd870('0xa3'))[_0xd870('0x7f')](_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id'][_0xd870('0x86')](),'VoiceQueueId')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5b'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from'](_0xd870('0xa6'))[_0xd870('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xd870('0xa7'),_0x8eaa34[_0xd870('0xa5')][_0xd870('0x86')]())[_0xd870('0x43')](_0xd870('0xa8'))[_0xd870('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd870('0xaa')]()[_0xd870('0x7f')]('COALESCE(phone,\x27\x27)')[_0xd870('0x81')](_0xd870('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0x1ad4ff['params']['id'][_0xd870('0x86')]())))[_0xd870('0x86')]();break;default:_0x1d5fe5=squel['insert']()[_0xd870('0x9e')](_0xd870('0x9f'))['fromQuery']([_0xd870('0xa1'),_0xd870('0xa2'),_0xd870('0xa3'),_0xd870('0xa4'),_0xd870('0x61'),'createdAt',_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xa1'),_0xd870('0xa1'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','scheduledAt')[_0xd870('0x7f')]('id',_0xd870('0xa3'))[_0xd870('0x7f')](_0x8eaa34['CmListId']['toString'](),'ListId')[_0xd870('0x7f')](_0x1ad4ff[_0xd870('0x4d')]['id']['toString'](),_0xd870('0x61'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','createdAt')[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))[_0xd870('0x81')](_0xd870('0xa6'))[_0xd870('0x43')](_0xd870('0xb0'))[_0xd870('0x43')](_0xd870('0xa7'),_0x8eaa34['CmListId'][_0xd870('0x86')]())[_0xd870('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xd870('0x86')]();}_0x3be94b[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x1d5fe5));}return BPromise[_0xd870('0x8b')](_0x3be94b);}})[_0xd870('0x29')](function(){var _0x3a6ea8=[];var _0x3c42fd=squel['insert']()[_0xd870('0x9e')]('cm_hopper_additional_phones')[_0xd870('0xa0')](['CmHopperId',_0xd870('0xa1'),'OrderBy',_0xd870('0x5b'),_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xb1'))[_0xd870('0x7f')]('ci.item')['field'](_0xd870('0xb2'))[_0xd870('0x7f')]('\x27'+_0x5a89c+'\x27','createdAt')['field']('\x27'+_0x5a89c+'\x27',_0xd870('0x5c'))['from']('cm_contact_has_items','ci')[_0xd870('0x82')](_0xd870('0x9f'),'h',_0xd870('0xb3'))[_0xd870('0x43')](_0xd870('0xb4'),_0x5a89c)[_0xd870('0x43')](_0xd870('0xb5'),_0xd870('0xb6')))[_0xd870('0x86')]();_0x3a6ea8[_0xd870('0x85')](db['sequelize'][_0xd870('0x39')](_0x3c42fd));return BPromise[_0xd870('0x8b')](_0x3a6ea8);})[_0xd870('0x29')](function(){return _0x2ad18e;})['then'](respondWithResult(_0x36730e,null))[_0xd870('0x4c')](handleError(_0x36730e,null));};exports[_0xd870('0xb7')]=function(_0x424011,_0x52cd3a,_0x19bf7a){return db[_0xd870('0x35')][_0xd870('0x30')]({'where':{'id':_0x424011[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x52cd3a,null))['then'](function(_0x5911ec){if(_0x5911ec){return _0x5911ec[_0xd870('0xb7')](_0x424011[_0xd870('0x39')][_0xd870('0x7e')]);}})[_0xd870('0x29')](function(_0x25ff4e){if(_0x25ff4e){return db[_0xd870('0x62')]['destroy']({'where':{'ListId':_0x424011[_0xd870('0x39')][_0xd870('0x7e')],'VoiceQueueId':_0x424011[_0xd870('0x4d')]['id']}})['then'](function(){return _0x25ff4e;});}})[_0xd870('0x29')](respondWithStatusCode(_0x52cd3a,null))[_0xd870('0x4c')](handleError(_0x52cd3a,null));};exports[_0xd870('0xb8')]=function(_0x51c179,_0x2d6ada,_0xb4c132){var _0x467fcf={};var _0xc85aa={};var _0x25fbe5;var _0x16209b;return db[_0xd870('0x35')]['findOne']({'where':{'id':_0x51c179[_0xd870('0x4d')]['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x2d6ada,null))[_0xd870('0x29')](function(_0x200876){if(_0x200876){_0x25fbe5=_0x200876;_0xc85aa[_0xd870('0x38')]=_[_0xd870('0x3a')](db['CmList'][_0xd870('0x5a')]);_0xc85aa[_0xd870('0x39')]=_[_0xd870('0x3a')](_0x51c179['query']);_0xc85aa[_0xd870('0x3b')]=_['intersection'](_0xc85aa[_0xd870('0x38')],_0xc85aa['query']);_0x467fcf[_0xd870('0x3d')]=_[_0xd870('0x3c')](_0xc85aa[_0xd870('0x38')],qs[_0xd870('0x3e')](_0x51c179['query']['fields']));_0x467fcf['attributes']=_0x467fcf[_0xd870('0x3d')][_0xd870('0x3f')]?_0x467fcf['attributes']:_0xc85aa['model'];_0x467fcf[_0xd870('0x41')]=qs[_0xd870('0x42')](_0x51c179[_0xd870('0x39')][_0xd870('0x42')]);_0x467fcf['where']=qs[_0xd870('0x3b')](_[_0xd870('0x44')](_0x51c179[_0xd870('0x39')],_0xc85aa[_0xd870('0x3b')]));if(_0x51c179[_0xd870('0x39')][_0xd870('0x2d')]){_0x467fcf[_0xd870('0x43')]=_[_0xd870('0x45')](_0x467fcf['where'],{'$or':_[_0xd870('0x2e')](_0x467fcf[_0xd870('0x3d')],function(_0xc07c57){var _0x1da086={};_0x1da086[_0xc07c57]={'$like':'%'+_0x51c179[_0xd870('0x39')][_0xd870('0x2d')]+'%'};return _0x1da086;})});}_0x467fcf=_[_0xd870('0x45')]({},_0x467fcf,_0x51c179[_0xd870('0x47')]);return _0x25fbe5[_0xd870('0xb8')](_0x467fcf);}})[_0xd870('0x29')](function(_0x339791){if(_0x339791){_0x16209b=_0x339791[_0xd870('0x3f')];if(!_0x51c179[_0xd870('0x39')][_0xd870('0x40')](_0xd870('0x65'))){_0x467fcf['limit']=qs['limit'](_0x51c179[_0xd870('0x39')][_0xd870('0x21')]);_0x467fcf[_0xd870('0x23')]=qs['offset'](_0x51c179['query'][_0xd870('0x23')]);}return _0x25fbe5['getBlackLists'](_0x467fcf);}})[_0xd870('0x29')](function(_0x444416){if(_0x444416){return _0x444416?{'count':_0x16209b,'rows':_0x444416}:null;}})[_0xd870('0x29')](respondWithResult(_0x2d6ada,null))['catch'](handleError(_0x2d6ada,null));};exports[_0xd870('0xb9')]=function(_0x437baa,_0x5c8fce,_0x300b1b){var _0x3b6ca9,_0x1ce73c;return db['VoiceQueue'][_0xd870('0x30')]({'where':{'id':_0x437baa[_0xd870('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c8fce,null))['then'](function(_0x4af792){if(_0x4af792){_0x1ce73c=_0x4af792;return _0x4af792[_0xd870('0xb9')](_0x437baa[_0xd870('0x4f')]['ids'],_['omit'](_0x437baa['body'],['ids','id'])||{});}return null;})[_0xd870('0x92')](function(_0x26c79c){var _0x72cba2;_0x3b6ca9=_0x26c79c||[];var _0x3555a3=[];if(_0x26c79c){for(var _0x2ff5da=0x0;_0x2ff5da<_0x26c79c['length'];_0x2ff5da+=0x1){var _0x20e4f6=_0x26c79c[_0x2ff5da]['get']({'plain':!![]});_0x72cba2=squel[_0xd870('0x9d')]()['into'](_0xd870('0xba'))[_0xd870('0xa0')]([_0xd870('0xa1'),_0xd870('0xa3'),_0xd870('0xa4'),'VoiceQueueId',_0xd870('0x5b'),_0xd870('0x5c')],squel[_0xd870('0xaa')]()[_0xd870('0x7f')](_0xd870('0xa1'),'phone')[_0xd870('0x7f')]('id','ContactId')[_0xd870('0x7f')](_0x20e4f6[_0xd870('0xa5')][_0xd870('0x86')](),_0xd870('0xa4'))[_0xd870('0x7f')](_0x437baa[_0xd870('0x4d')]['id'][_0xd870('0x86')](),_0xd870('0x61'))[_0xd870('0x7f')]('NOW()','createdAt')[_0xd870('0x7f')]('NOW()',_0xd870('0x5c'))['from']('cm_contacts')[_0xd870('0x43')](_0xd870('0xb0'))['where'](_0xd870('0xa7'),_0x20e4f6[_0xd870('0xa5')]['toString']())[_0xd870('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xd870('0x86')]();_0x3555a3[_0xd870('0x85')](db[_0xd870('0x73')][_0xd870('0x39')](_0x72cba2));}return BPromise[_0xd870('0x8b')](_0x3555a3);}})[_0xd870('0x29')](function(){return _0x3b6ca9;})[_0xd870('0x29')](respondWithResult(_0x5c8fce,null))['catch'](handleError(_0x5c8fce,null));};exports[_0xd870('0xbb')]=function(_0x5ba174,_0x460bcf,_0x2fa8c8){return db['VoiceQueue']['find']({'where':{'id':_0x5ba174['params']['id']}})[_0xd870('0x29')](handleEntityNotFound(_0x460bcf,null))['then'](function(_0x4b4669){if(_0x4b4669){return _0x4b4669[_0xd870('0xbb')](_0x5ba174[_0xd870('0x39')][_0xd870('0x7e')]);}})[_0xd870('0x29')](function(_0x52a9cf){if(_0x52a9cf){return db[_0xd870('0x67')][_0xd870('0x5e')]({'where':{'ListId':_0x5ba174[_0xd870('0x39')]['ids'],'VoiceQueueId':_0x5ba174[_0xd870('0x4d')]['id']}})['then'](function(){return _0x52a9cf;});}})[_0xd870('0x29')](respondWithStatusCode(_0x460bcf,null))[_0xd870('0x4c')](handleError(_0x460bcf,null));}; \ No newline at end of file +var _0xb931=['ignore','map','includes','type','value','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','VoiceQueues','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','autoAssociation','getHoppers','CmHopper','pick','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','penalty','sequelize','transaction','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','upsert','isNil','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','field','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','UserVoiceQueueRt','forEach','userVoiceQueue:remove','addAgents','spread','emit','format','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','phone','scheduledAt','ContactId','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','CmListId','deletedAt\x20IS\x20NULL','into','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','QueueCampaigns','outbound','filter'];(function(_0x5eb9e4,_0xfe886d){var _0xf661a4=function(_0x4aaa95){while(--_0x4aaa95){_0x5eb9e4['push'](_0x5eb9e4['shift']());}};_0xf661a4(++_0xfe886d);}(_0xb931,0x155));var _0x1b93=function(_0x1ea83e,_0x1cee11){_0x1ea83e=_0x1ea83e-0x0;var _0x4242d3=_0xb931[_0x1ea83e];return _0x4242d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b93('0x1'));var BPromise=require(_0x1b93('0x2'));var Mustache=require(_0x1b93('0x3'));var util=require(_0x1b93('0x4'));var path=require(_0x1b93('0x5'));var sox=require(_0x1b93('0x6'));var csv=require(_0x1b93('0x7'));var ejs=require(_0x1b93('0x8'));var fs=require('fs');var fs_extra=require(_0x1b93('0x9'));var _=require(_0x1b93('0xa'));var squel=require(_0x1b93('0xb'));var crypto=require(_0x1b93('0xc'));var jsforce=require(_0x1b93('0xd'));var deskjs=require(_0x1b93('0xe'));var toCsv=require(_0x1b93('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b93('0xf'));var authService=require(_0x1b93('0x10'));var qs=require(_0x1b93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b93('0x12'));var logger=require('../../config/logger')(_0x1b93('0x13'));var utils=require(_0x1b93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b93('0x15'))['db'];config[_0x1b93('0x16')]=_[_0x1b93('0x17')](config['redis'],{'host':_0x1b93('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b93('0x16')]));require(_0x1b93('0x19'))[_0x1b93('0x1a')](socket);function respondWithStatusCode(_0x1ea97a,_0xe5a8ab){_0xe5a8ab=_0xe5a8ab||0xcc;return function(_0x1512fd){if(_0x1512fd){return _0x1ea97a['sendStatus'](_0xe5a8ab);}return _0x1ea97a[_0x1b93('0x1b')](_0xe5a8ab)[_0x1b93('0x1c')]();};}function respondWithResult(_0x240b8f,_0x23d687){_0x23d687=_0x23d687||0xc8;return function(_0x4d4c47){if(_0x4d4c47){return _0x240b8f[_0x1b93('0x1b')](_0x23d687)[_0x1b93('0x1d')](_0x4d4c47);}};}function respondWithFilteredResult(_0x4f7199,_0x446cc2){return function(_0x339c5b){if(_0x339c5b){var _0x4ed0d5=typeof _0x446cc2['offset']===_0x1b93('0x1e')&&typeof _0x446cc2[_0x1b93('0x1f')]===_0x1b93('0x1e');var _0x4156d9=_0x339c5b[_0x1b93('0x20')];var _0x4c3a25=_0x4ed0d5?0x0:_0x446cc2[_0x1b93('0x21')];var _0x23428d=_0x4ed0d5?_0x339c5b['count']:_0x446cc2['offset']+_0x446cc2[_0x1b93('0x1f')];var _0x116775;if(_0x23428d>=_0x4156d9){_0x23428d=_0x4156d9;_0x116775=0xc8;}else{_0x116775=0xce;}_0x4f7199[_0x1b93('0x1b')](_0x116775);return _0x4f7199[_0x1b93('0x22')](_0x1b93('0x23'),_0x4c3a25+'-'+_0x23428d+'/'+_0x4156d9)[_0x1b93('0x1d')](_0x339c5b);}return null;};}function patchUpdates(_0x577a22){return function(_0x43e492){try{jsonpatch[_0x1b93('0x24')](_0x43e492,_0x577a22,!![]);}catch(_0x208217){return BPromise['reject'](_0x208217);}return _0x43e492[_0x1b93('0x25')]();};}function saveUpdates(_0x41f219,_0xa6ea){return function(_0x20ce59){if(_0x20ce59){return _0x20ce59[_0x1b93('0x26')](_0x41f219)[_0x1b93('0x27')](function(_0x13cddc){return _0x13cddc;});}return null;};}function removeEntity(_0x309ac5,_0x14626a){return function(_0x24f04e){if(_0x24f04e){return _0x24f04e[_0x1b93('0x28')]()[_0x1b93('0x27')](function(){var _0xa15258=_0x24f04e[_0x1b93('0x29')]({'plain':!![]});var _0x2f92a0=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x1b93('0x2a'),'value':_0x1b93('0x2b'),'ignore':![]}];var _0x28c014=_(_0x2f92a0)[_0x1b93('0x2c')](_0x1b93('0x2d'))[_0x1b93('0x2e')]('value')['value']();if(_[_0x1b93('0x2f')](_0x28c014,_0xa15258[_0x1b93('0x30')])){return;}var _0x394e18=_['find'](_0x2f92a0,[_0x1b93('0x31'),_0xa15258['type']])[_0x1b93('0x32')];return db[_0x1b93('0x33')][_0x1b93('0x28')]({'where':{'type':_0x394e18,'resourceId':_0xa15258['id']}})['then'](function(){return _0x24f04e;});})['then'](function(){_0x309ac5[_0x1b93('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1310a9,_0x1805ad){return function(_0x2d8b3b){if(!_0x2d8b3b){_0x1310a9['sendStatus'](0x194);}return _0x2d8b3b;};}function handleError(_0x21e053,_0x2d8a58){_0x2d8a58=_0x2d8a58||0x1f4;return function(_0x1b5cac){logger[_0x1b93('0x34')](_0x1b5cac[_0x1b93('0x35')]);if(_0x1b5cac[_0x1b93('0x32')]){delete _0x1b5cac[_0x1b93('0x32')];}_0x21e053[_0x1b93('0x1b')](_0x2d8a58)[_0x1b93('0x36')](_0x1b5cac);};}exports[_0x1b93('0x37')]=function(_0x3efd5e,_0x52302d){var _0x5b55dc={},_0x1b0afa={},_0x6816b8={'count':0x0,'rows':[]};var _0x1109b4=_[_0x1b93('0x2e')](db[_0x1b93('0x38')][_0x1b93('0x39')],function(_0x2e6f54){return{'name':_0x2e6f54['fieldName'],'type':_0x2e6f54['type']['key']};});_0x1b0afa[_0x1b93('0x3a')]=_[_0x1b93('0x2e')](_0x1109b4,'name');_0x1b0afa['query']=_[_0x1b93('0x3b')](_0x3efd5e[_0x1b93('0x3c')]);_0x1b0afa['filters']=_[_0x1b93('0x3d')](_0x1b0afa['model'],_0x1b0afa[_0x1b93('0x3c')]);_0x5b55dc[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x1b0afa[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x3efd5e[_0x1b93('0x3c')]['fields']));_0x5b55dc[_0x1b93('0x3e')]=_0x5b55dc['attributes'][_0x1b93('0x40')]?_0x5b55dc['attributes']:_0x1b0afa[_0x1b93('0x3a')];if(!_0x3efd5e[_0x1b93('0x3c')][_0x1b93('0x41')](_0x1b93('0x42'))){_0x5b55dc[_0x1b93('0x1f')]=qs[_0x1b93('0x1f')](_0x3efd5e[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x5b55dc[_0x1b93('0x21')]=qs[_0x1b93('0x21')](_0x3efd5e[_0x1b93('0x3c')][_0x1b93('0x21')]);}_0x5b55dc[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x3efd5e['query'][_0x1b93('0x44')]);_0x5b55dc[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_['pick'](_0x3efd5e[_0x1b93('0x3c')],_0x1b0afa[_0x1b93('0x46')]),_0x1109b4);if(_0x3efd5e[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x5b55dc[_0x1b93('0x45')]=_['merge'](_0x5b55dc['where'],{'$or':_['map'](_0x1109b4,function(_0x16977a){if(_0x16977a['type']!=='VIRTUAL'){var _0x2f87fd={};_0x2f87fd[_0x16977a[_0x1b93('0x32')]]={'$like':'%'+_0x3efd5e[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0x2f87fd;}})});}_0x5b55dc=_[_0x1b93('0x47')]({},_0x5b55dc,_0x3efd5e[_0x1b93('0x48')]);var _0x1ba979={'where':_0x5b55dc['where']};return db['VoiceQueue'][_0x1b93('0x20')](_0x1ba979)[_0x1b93('0x27')](function(_0x50102c){_0x6816b8[_0x1b93('0x20')]=_0x50102c;if(_0x3efd5e[_0x1b93('0x3c')]['includeAll']){_0x5b55dc[_0x1b93('0x49')]=[{'all':!![]}];}return db['VoiceQueue'][_0x1b93('0x4a')](_0x5b55dc);})[_0x1b93('0x27')](function(_0x4fa0ff){_0x6816b8[_0x1b93('0x4b')]=_0x4fa0ff;return _0x6816b8;})[_0x1b93('0x27')](respondWithFilteredResult(_0x52302d,_0x5b55dc))[_0x1b93('0x4c')](handleError(_0x52302d,null));};exports[_0x1b93('0x4d')]=function(_0x49b3c8,_0x25929d){var _0x114ee3={'raw':![],'where':{'id':_0x49b3c8[_0x1b93('0x4e')]['id']}},_0x442b2a={};_0x442b2a['model']=_[_0x1b93('0x3b')](db[_0x1b93('0x38')]['rawAttributes']);_0x442b2a[_0x1b93('0x3c')]=_['keys'](_0x49b3c8[_0x1b93('0x3c')]);_0x442b2a[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x442b2a[_0x1b93('0x3a')],_0x442b2a['query']);_0x114ee3[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x442b2a[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x49b3c8[_0x1b93('0x3c')]['fields']));_0x114ee3[_0x1b93('0x3e')]=_0x114ee3['attributes']['length']?_0x114ee3[_0x1b93('0x3e')]:_0x442b2a[_0x1b93('0x3a')];if(_0x49b3c8[_0x1b93('0x3c')][_0x1b93('0x4f')]){_0x114ee3[_0x1b93('0x49')]=[{'all':!![]}];}_0x114ee3=_['merge']({},_0x114ee3,_0x49b3c8[_0x1b93('0x48')]);return db[_0x1b93('0x38')][_0x1b93('0x50')](_0x114ee3)[_0x1b93('0x27')](handleEntityNotFound(_0x25929d,null))[_0x1b93('0x27')](respondWithResult(_0x25929d,null))['catch'](handleError(_0x25929d,null));};exports[_0x1b93('0x51')]=function(_0x537a5a,_0x13b38c){return db['VoiceQueue']['create'](_0x537a5a[_0x1b93('0x52')],{})['then'](function(_0x2fcb83){var _0x4efe54=_0x537a5a['user'][_0x1b93('0x29')]({'plain':!![]});if(!_0x4efe54)throw new Error(_0x1b93('0x53'));if(_0x4efe54['role']===_0x1b93('0x54')){var _0x357f73=_0x2fcb83[_0x1b93('0x29')]({'plain':!![]});var _0x5a06ef=[{'name':_0x1b93('0x55'),'value':_0x1b93('0x56')},{'name':'QueueCampaigns','value':_0x1b93('0x2b')}];var _0x1308a0=_[_0x1b93('0x50')](_0x5a06ef,[_0x1b93('0x31'),_0x357f73['type']])[_0x1b93('0x32')];return db[_0x1b93('0x57')][_0x1b93('0x50')]({'where':{'name':_0x1308a0,'userProfileId':_0x4efe54[_0x1b93('0x58')]},'raw':!![]})['then'](function(_0x401240){if(_0x401240&&_0x401240['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x357f73[_0x1b93('0x32')],'resourceId':_0x357f73['id'],'type':_0x401240[_0x1b93('0x32')],'sectionId':_0x401240['id']},{})[_0x1b93('0x27')](function(){return _0x2fcb83;});}else{return _0x2fcb83;}})[_0x1b93('0x4c')](function(_0x3ba06a){logger[_0x1b93('0x34')](_0x1b93('0x59'),_0x3ba06a);throw _0x3ba06a;});}return _0x2fcb83;})[_0x1b93('0x27')](respondWithResult(_0x13b38c,0xc9))[_0x1b93('0x4c')](handleError(_0x13b38c,null));};exports['clone']=function(_0x1e4551,_0xcc189e){var _0x5382f0={'where':{'id':_0x1e4551[_0x1b93('0x4e')]['id']}},_0x4efe11={};_0x4efe11[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db[_0x1b93('0x38')][_0x1b93('0x39')]);_0x5382f0[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x4efe11[_0x1b93('0x3a')],qs['fields'](_0x1e4551[_0x1b93('0x3c')][_0x1b93('0x3f')]));_0x5382f0[_0x1b93('0x3e')]=_0x5382f0[_0x1b93('0x3e')][_0x1b93('0x40')]?_0x5382f0[_0x1b93('0x3e')]:_0x4efe11[_0x1b93('0x3a')];if(_0x1e4551[_0x1b93('0x3c')]['includeAll']){_0x5382f0[_0x1b93('0x49')]=[{'all':!![]}];}_0x5382f0=_[_0x1b93('0x47')]({},_0x5382f0,_0x1e4551[_0x1b93('0x48')]);return db[_0x1b93('0x38')][_0x1b93('0x50')](_0x5382f0)['then'](handleEntityNotFound(_0xcc189e,null))[_0x1b93('0x27')](function(_0x54aae1){if(_0x54aae1){var _0x4e021c=_0x54aae1[_0x1b93('0x29')]({'plain':!![]});_0x4e021c=qs[_0x1b93('0x5a')](_0x4e021c,['id',_0x1b93('0x5b'),_0x1b93('0x5c')]);_0x1e4551['body']=_[_0x1b93('0x5a')](_0x1e4551['body'],['id','createdAt',_0x1b93('0x5c')]);return db['VoiceQueue'][_0x1b93('0x51')](_[_0x1b93('0x47')](_0x4e021c,_0x1e4551[_0x1b93('0x52')]),{'include':_0x1e4551[_0x1b93('0x3c')][_0x1b93('0x4f')]?[{'all':!![]}]:undefined})[_0x1b93('0x27')](function(_0x285a2c){var _0x12e5d5=_0x1e4551['user'][_0x1b93('0x29')]({'plain':!![]});if(!_0x12e5d5)throw new Error(_0x1b93('0x53'));if(_0x12e5d5[_0x1b93('0x5d')]===_0x1b93('0x54')){var _0x12fb39=_0x285a2c[_0x1b93('0x29')]({'plain':!![]});var _0x43be74=[{'name':_0x1b93('0x55'),'value':'inbound'},{'name':_0x1b93('0x2a'),'value':_0x1b93('0x2b')}];var _0x550568=_[_0x1b93('0x50')](_0x43be74,[_0x1b93('0x31'),_0x12fb39['type']])['name'];return db['UserProfileSection'][_0x1b93('0x50')]({'where':{'name':_0x550568,'userProfileId':_0x12e5d5[_0x1b93('0x58')]},'raw':!![]})['then'](function(_0x3f8adc){if(_0x3f8adc&&_0x3f8adc[_0x1b93('0x5e')]===0x0){return db[_0x1b93('0x33')][_0x1b93('0x51')]({'name':_0x12fb39['name'],'resourceId':_0x12fb39['id'],'type':_0x3f8adc[_0x1b93('0x32')],'sectionId':_0x3f8adc['id']},{})[_0x1b93('0x27')](function(){return _0x285a2c;});}else{return _0x285a2c;}})[_0x1b93('0x4c')](function(_0x4eeaa5){logger[_0x1b93('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4eeaa5);throw _0x4eeaa5;});}return _0x285a2c;});}})['then'](respondWithResult(_0xcc189e,0xc9))[_0x1b93('0x4c')](handleError(_0xcc189e,null));};exports['update']=function(_0x21706a,_0x54f381){if(_0x21706a[_0x1b93('0x52')]['id']){delete _0x21706a[_0x1b93('0x52')]['id'];}return db[_0x1b93('0x38')]['find']({'where':{'id':_0x21706a[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x54f381,null))[_0x1b93('0x27')](saveUpdates(_0x21706a[_0x1b93('0x52')],null))[_0x1b93('0x27')](respondWithResult(_0x54f381,null))[_0x1b93('0x4c')](handleError(_0x54f381,null));};exports[_0x1b93('0x28')]=function(_0x20fd0d,_0x15d281){return db[_0x1b93('0x38')]['find']({'where':{'id':_0x20fd0d[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x15d281,null))['then'](removeEntity(_0x15d281,null))[_0x1b93('0x4c')](handleError(_0x15d281,null));};exports[_0x1b93('0x5f')]=function(_0x5333dd,_0x1ba759,_0x2e3b06){var _0x51fc34={'raw':![],'where':{}};var _0x1770ae={};var _0x380ece={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5333dd['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x1ba759,null))[_0x1b93('0x27')](function(_0x13f26e){if(_0x13f26e){_0x1770ae[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db[_0x1b93('0x60')][_0x1b93('0x39')]);_0x1770ae[_0x1b93('0x3c')]=_[_0x1b93('0x3b')](_0x5333dd[_0x1b93('0x3c')]);_0x1770ae[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x1770ae[_0x1b93('0x3a')],_0x1770ae[_0x1b93('0x3c')]);_0x51fc34[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x1770ae[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x5333dd[_0x1b93('0x3c')][_0x1b93('0x3f')]));_0x51fc34[_0x1b93('0x3e')]=_0x51fc34[_0x1b93('0x3e')]['length']?_0x51fc34[_0x1b93('0x3e')]:_0x1770ae[_0x1b93('0x3a')];if(!_0x5333dd['query'][_0x1b93('0x41')](_0x1b93('0x42'))){_0x51fc34[_0x1b93('0x1f')]=qs['limit'](_0x5333dd[_0x1b93('0x3c')]['limit']);_0x51fc34[_0x1b93('0x21')]=qs['offset'](_0x5333dd[_0x1b93('0x3c')]['offset']);}_0x51fc34[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x5333dd[_0x1b93('0x3c')]['sort']);_0x51fc34[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x5333dd['query'],_0x1770ae[_0x1b93('0x46')]));_0x51fc34[_0x1b93('0x45')][_0x1b93('0x62')]=_0x13f26e['id'];if(_0x5333dd[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x51fc34[_0x1b93('0x45')]=_['merge'](_0x51fc34[_0x1b93('0x45')],{'$or':_[_0x1b93('0x2e')](_0x51fc34[_0x1b93('0x3e')],function(_0x3badf4){var _0x266827={};_0x266827[_0x3badf4]={'$like':'%'+_0x5333dd[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0x266827;})});}_0x51fc34=_[_0x1b93('0x47')]({},_0x51fc34,_0x5333dd[_0x1b93('0x48')]);return db[_0x1b93('0x60')]['count']({'where':_0x51fc34[_0x1b93('0x45')]})[_0x1b93('0x27')](function(_0x2acbb7){_0x380ece[_0x1b93('0x20')]=_0x2acbb7;if(_0x5333dd[_0x1b93('0x3c')]['includeAll']){_0x51fc34[_0x1b93('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x1b93('0x4a')](_0x51fc34);})['then'](function(_0x5db261){_0x380ece[_0x1b93('0x4b')]=_0x5db261;return _0x380ece;});}})[_0x1b93('0x27')](respondWithFilteredResult(_0x1ba759,_0x51fc34))[_0x1b93('0x4c')](handleError(_0x1ba759,null));};exports[_0x1b93('0x63')]=function(_0x5d756b,_0x5230b6,_0x12e05f){var _0x39ce65={'raw':!![],'where':{}};var _0x4ff88a={};var _0x7c4e92={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1b93('0x64')]({'where':{'id':_0x5d756b[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x5230b6,null))['then'](function(_0x17f07c){if(_0x17f07c){_0x4ff88a['model']=_[_0x1b93('0x3b')](db[_0x1b93('0x65')]['rawAttributes']);_0x4ff88a[_0x1b93('0x3c')]=_['keys'](_0x5d756b[_0x1b93('0x3c')]);_0x4ff88a['filters']=_[_0x1b93('0x3d')](_0x4ff88a['model'],_0x4ff88a[_0x1b93('0x3c')]);_0x39ce65[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x4ff88a[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x5d756b[_0x1b93('0x3c')]['fields']));_0x39ce65[_0x1b93('0x3e')]=_0x39ce65['attributes'][_0x1b93('0x40')]?_0x39ce65['attributes']:_0x4ff88a['model'];if(!_0x5d756b[_0x1b93('0x3c')][_0x1b93('0x41')](_0x1b93('0x42'))){_0x39ce65[_0x1b93('0x1f')]=qs[_0x1b93('0x1f')](_0x5d756b[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x39ce65['offset']=qs[_0x1b93('0x21')](_0x5d756b[_0x1b93('0x3c')][_0x1b93('0x21')]);}_0x39ce65['order']=qs['sort'](_0x5d756b['query'][_0x1b93('0x44')]);_0x39ce65[_0x1b93('0x45')]=qs['filters'](_[_0x1b93('0x61')](_0x5d756b[_0x1b93('0x3c')],_0x4ff88a['filters']));_0x39ce65[_0x1b93('0x45')][_0x1b93('0x62')]=_0x17f07c['id'];if(_0x5d756b['query'][_0x1b93('0x2c')]){_0x39ce65['where']=_[_0x1b93('0x47')](_0x39ce65['where'],{'$or':_['map'](_0x39ce65['attributes'],function(_0x469f85){var _0x27769f={};_0x27769f[_0x469f85]={'$like':'%'+_0x5d756b[_0x1b93('0x3c')]['filter']+'%'};return _0x27769f;})});}_0x39ce65=_[_0x1b93('0x47')]({},_0x39ce65,_0x5d756b[_0x1b93('0x48')]);return db[_0x1b93('0x65')]['count']({'where':_0x39ce65[_0x1b93('0x45')]})['then'](function(_0x3a5086){_0x7c4e92['count']=_0x3a5086;if(_0x5d756b[_0x1b93('0x3c')][_0x1b93('0x4f')]){_0x39ce65['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x1b93('0x4a')](_0x39ce65);})[_0x1b93('0x27')](function(_0x5ae665){_0x7c4e92[_0x1b93('0x4b')]=_0x5ae665;return _0x7c4e92;});}})[_0x1b93('0x27')](respondWithFilteredResult(_0x5230b6,_0x39ce65))[_0x1b93('0x4c')](handleError(_0x5230b6,null));};exports[_0x1b93('0x66')]=function(_0x214a0b,_0x41c254,_0x31768b){var _0x33652a={'raw':!![],'where':{}};var _0x1db5c4={};var _0x23064a={'count':0x0,'rows':[]};return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x214a0b[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x41c254,null))['then'](function(_0x1ce8d4){if(_0x1ce8d4){_0x1db5c4[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db[_0x1b93('0x67')]['rawAttributes']);_0x1db5c4['query']=_[_0x1b93('0x3b')](_0x214a0b[_0x1b93('0x3c')]);_0x1db5c4[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x1db5c4[_0x1b93('0x3a')],_0x1db5c4['query']);_0x33652a[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x1db5c4['model'],qs[_0x1b93('0x3f')](_0x214a0b['query'][_0x1b93('0x3f')]));_0x33652a['attributes']=_0x33652a[_0x1b93('0x3e')][_0x1b93('0x40')]?_0x33652a['attributes']:_0x1db5c4[_0x1b93('0x3a')];if(!_0x214a0b['query'][_0x1b93('0x41')]('nolimit')){_0x33652a[_0x1b93('0x1f')]=qs['limit'](_0x214a0b[_0x1b93('0x3c')]['limit']);_0x33652a[_0x1b93('0x21')]=qs['offset'](_0x214a0b[_0x1b93('0x3c')][_0x1b93('0x21')]);}_0x33652a['order']=qs[_0x1b93('0x44')](_0x214a0b[_0x1b93('0x3c')]['sort']);_0x33652a['where']=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x214a0b[_0x1b93('0x3c')],_0x1db5c4[_0x1b93('0x46')]));_0x33652a[_0x1b93('0x45')]['VoiceQueueId']=_0x1ce8d4['id'];if(_0x214a0b[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x33652a[_0x1b93('0x45')]=_['merge'](_0x33652a[_0x1b93('0x45')],{'$or':_['map'](_0x33652a[_0x1b93('0x3e')],function(_0x44bf57){var _0x307f8b={};_0x307f8b[_0x44bf57]={'$like':'%'+_0x214a0b[_0x1b93('0x3c')]['filter']+'%'};return _0x307f8b;})});}_0x33652a=_[_0x1b93('0x47')]({},_0x33652a,_0x214a0b[_0x1b93('0x48')]);return db[_0x1b93('0x67')][_0x1b93('0x20')]({'where':_0x33652a[_0x1b93('0x45')]})['then'](function(_0x3e4dd1){_0x23064a[_0x1b93('0x20')]=_0x3e4dd1;if(_0x214a0b['query']['includeAll']){_0x33652a[_0x1b93('0x49')]=[{'all':!![]}];}return db[_0x1b93('0x67')][_0x1b93('0x4a')](_0x33652a);})[_0x1b93('0x27')](function(_0x26584e){_0x23064a['rows']=_0x26584e;return _0x23064a;});}})[_0x1b93('0x27')](respondWithFilteredResult(_0x41c254,_0x33652a))[_0x1b93('0x4c')](handleError(_0x41c254,null));};exports[_0x1b93('0x68')]=function(_0x3dd363,_0x2140d9,_0x33232e){var _0x319284={'raw':!![],'where':{}};var _0x3688e2={};var _0x5e0b3f={'count':0x0,'rows':[]};return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x3dd363[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x2140d9,null))[_0x1b93('0x27')](function(_0x2484cd){if(_0x2484cd){_0x3688e2[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db['CmHopperBlack'][_0x1b93('0x39')]);_0x3688e2[_0x1b93('0x3c')]=_['keys'](_0x3dd363[_0x1b93('0x3c')]);_0x3688e2[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x3688e2[_0x1b93('0x3a')],_0x3688e2[_0x1b93('0x3c')]);_0x319284[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x3688e2[_0x1b93('0x3a')],qs['fields'](_0x3dd363['query'][_0x1b93('0x3f')]));_0x319284['attributes']=_0x319284[_0x1b93('0x3e')][_0x1b93('0x40')]?_0x319284[_0x1b93('0x3e')]:_0x3688e2[_0x1b93('0x3a')];if(!_0x3dd363[_0x1b93('0x3c')]['hasOwnProperty']('nolimit')){_0x319284[_0x1b93('0x1f')]=qs[_0x1b93('0x1f')](_0x3dd363[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x319284[_0x1b93('0x21')]=qs['offset'](_0x3dd363['query'][_0x1b93('0x21')]);}_0x319284[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x3dd363[_0x1b93('0x3c')][_0x1b93('0x44')]);_0x319284['where']=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x3dd363['query'],_0x3688e2['filters']));_0x319284[_0x1b93('0x45')]['VoiceQueueId']=_0x2484cd['id'];if(_0x3dd363['query'][_0x1b93('0x2c')]){_0x319284[_0x1b93('0x45')]=_['merge'](_0x319284[_0x1b93('0x45')],{'$or':_[_0x1b93('0x2e')](_0x319284[_0x1b93('0x3e')],function(_0x289096){var _0x1e5b3a={};_0x1e5b3a[_0x289096]={'$like':'%'+_0x3dd363['query'][_0x1b93('0x2c')]+'%'};return _0x1e5b3a;})});}_0x319284=_[_0x1b93('0x47')]({},_0x319284,_0x3dd363[_0x1b93('0x48')]);return db[_0x1b93('0x69')][_0x1b93('0x20')]({'where':_0x319284[_0x1b93('0x45')]})['then'](function(_0x90a3e0){_0x5e0b3f[_0x1b93('0x20')]=_0x90a3e0;if(_0x3dd363[_0x1b93('0x3c')][_0x1b93('0x4f')]){_0x319284[_0x1b93('0x49')]=[{'all':!![]}];}return db[_0x1b93('0x69')][_0x1b93('0x4a')](_0x319284);})[_0x1b93('0x27')](function(_0xfcde91){_0x5e0b3f[_0x1b93('0x4b')]=_0xfcde91;return _0x5e0b3f;});}})[_0x1b93('0x27')](respondWithFilteredResult(_0x2140d9,_0x319284))['catch'](handleError(_0x2140d9,null));};exports[_0x1b93('0x6a')]=function(_0x263192,_0x5d4e68,_0x2ca0b9){var _0x51cccd={};var _0xc84968={};var _0x3865f9;var _0xb3354e;return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x263192[_0x1b93('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5d4e68,null))[_0x1b93('0x27')](function(_0x2fe5c0){if(_0x2fe5c0){_0x3865f9=_0x2fe5c0;_0xc84968[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db[_0x1b93('0x6b')][_0x1b93('0x39')]);_0xc84968['query']=_[_0x1b93('0x3b')](_0x263192[_0x1b93('0x3c')]);_0xc84968[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0xc84968[_0x1b93('0x3a')],_0xc84968['query']);_0x51cccd['attributes']=_[_0x1b93('0x3d')](_0xc84968[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x263192['query'][_0x1b93('0x3f')]));_0x51cccd[_0x1b93('0x3e')]=_0x51cccd[_0x1b93('0x3e')]['length']?_0x51cccd[_0x1b93('0x3e')]:_0xc84968[_0x1b93('0x3a')];_0x51cccd[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x263192['query']['sort']);_0x51cccd['where']=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x263192[_0x1b93('0x3c')],_0xc84968[_0x1b93('0x46')]));if(_0x263192[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x51cccd[_0x1b93('0x45')]=_[_0x1b93('0x47')](_0x51cccd[_0x1b93('0x45')],{'$or':_['map'](_0x51cccd[_0x1b93('0x3e')],function(_0x2a43c2){var _0x40566f={};_0x40566f[_0x2a43c2]={'$like':'%'+_0x263192[_0x1b93('0x3c')]['filter']+'%'};return _0x40566f;})});}_0x51cccd=_[_0x1b93('0x47')]({},_0x51cccd,_0x263192[_0x1b93('0x48')]);return _0x3865f9[_0x1b93('0x6a')](_0x51cccd);}})['then'](function(_0x4a232e){if(_0x4a232e){_0xb3354e=_0x4a232e[_0x1b93('0x40')];if(!_0x263192[_0x1b93('0x3c')][_0x1b93('0x41')](_0x1b93('0x42'))){_0x51cccd['limit']=qs[_0x1b93('0x1f')](_0x263192[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x51cccd[_0x1b93('0x21')]=qs[_0x1b93('0x21')](_0x263192[_0x1b93('0x3c')][_0x1b93('0x21')]);}return _0x3865f9['getTeams'](_0x51cccd);}})[_0x1b93('0x27')](function(_0x53efd8){if(_0x53efd8){return _0x53efd8?{'count':_0xb3354e,'rows':_0x53efd8}:null;}})[_0x1b93('0x27')](respondWithResult(_0x5d4e68,null))['catch'](handleError(_0x5d4e68,null));};exports[_0x1b93('0x6c')]=function(_0x3dd364,_0x351319,_0x338bef){var _0x1be45e=_0x3dd364[_0x1b93('0x52')][_0x1b93('0x6d')];var _0x48fb33=_[_0x1b93('0x2e')](_0x1be45e,'id');return db[_0x1b93('0x6b')][_0x1b93('0x4a')]({'where':{'id':_0x48fb33},'attributes':['id'],'include':[{'model':db[_0x1b93('0x6e')],'as':_0x1b93('0x6f'),'attributes':['id',_0x1b93('0x32'),_0x1b93('0x70'),_0x1b93('0x71'),_0x1b93('0x72')],'raw':!![]}]})[_0x1b93('0x27')](function(_0x20ecc9){if(_0x20ecc9){var _0xd848d0=_[_0x1b93('0x73')](_0x20ecc9,function(_0x3121ec){var _0x4f3a2a=_0x3121ec[_0x1b93('0x29')]({'plain':!![]});_0x4f3a2a[_0x1b93('0x6f')]['forEach'](function(_0x2b9e3f){_0x2b9e3f[_0x1b93('0x74')]=_[_0x1b93('0x50')](_0x1be45e,{'id':_0x4f3a2a['id']})[_0x1b93('0x74')];});return _0x4f3a2a['Agents'];});return db['VoiceQueue'][_0x1b93('0x50')]({'where':{'id':_0x3dd364[_0x1b93('0x4e')]['id']}})['then'](function(_0x882fad){return db[_0x1b93('0x75')][_0x1b93('0x76')](function(_0x25742b){return _0x882fad[_0x1b93('0x6c')](_0x48fb33,{'transaction':_0x25742b})[_0x1b93('0x27')](function(){return BPromise['each'](_0x1be45e,function(_0x239015){return db[_0x1b93('0x77')]['upsert']({'TeamId':_0x239015['id'],'VoiceQueueId':_0x3dd364['params']['id'],'penalty':_0x239015[_0x1b93('0x74')]},{'transaction':_0x25742b});});})['then'](function(){return BPromise[_0x1b93('0x78')](_0xd848d0,function(_0x17f062){return db[_0x1b93('0x79')][_0x1b93('0x7a')]({'where':{'UserId':_0x17f062['id'],'VoiceQueueId':_0x3dd364[_0x1b93('0x4e')]['id']},'defaults':{'penalty':_0x17f062[_0x1b93('0x74')]},'transaction':_0x25742b});});})['then'](function(){return BPromise[_0x1b93('0x78')](_[_0x1b93('0x2c')](_0xd848d0,{'online':!![]}),function(_0x2b0603){return db['UserVoiceQueueRt'][_0x1b93('0x7b')]({'membername':_0x2b0603[_0x1b93('0x32')],'UserId':_0x2b0603['id'],'queue_name':_0x882fad['name'],'VoiceQueueId':_0x882fad['id'],'interface':_[_0x1b93('0x7c')](_0x2b0603[_0x1b93('0x72')])?util['format'](_0x1b93('0x7d'),_0x2b0603[_0x1b93('0x32')]):_0x2b0603[_0x1b93('0x72')],'paused':_0x2b0603[_0x1b93('0x71')]||![],'penalty':_0x2b0603['penalty']},{'transaction':_0x25742b});});})['then'](function(){_0xd848d0['forEach'](function(_0x4890f4){socket['emit'](_0x1b93('0x7e'),{'UserId':_0x4890f4['id'],'VoiceQueueId':_0x882fad['id']});});});});});}})[_0x1b93('0x27')](respondWithStatusCode(_0x351319,null))['catch'](handleError(_0x351319,null));};exports[_0x1b93('0x7f')]=function(_0x157822,_0x1509ee,_0x4effb0){return db['Team'][_0x1b93('0x4a')]({'where':{'id':_0x157822[_0x1b93('0x3c')][_0x1b93('0x80')]},'attributes':['id'],'include':[{'model':db[_0x1b93('0x6e')],'as':_0x1b93('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1b93('0x27')](handleEntityNotFound(_0x1509ee,null))[_0x1b93('0x27')](function(_0x2f36eb){var _0x38b253=_[_0x1b93('0x2e')](_0x2f36eb,'id');var _0x563845=[];var _0x544181=[];var _0x1a2ff8=squel[_0x1b93('0x81')]();_0x1a2ff8[_0x1b93('0x82')]('tq.TeamId')['from']('team_has_voice_queues','tq')['join'](_0x1b93('0x83'),'ut',_0x1b93('0x84'))[_0x1b93('0x45')](_0x1b93('0x85'),_0x157822[_0x1b93('0x4e')]['id']);for(var _0x1854a7=0x0;_0x1854a7<_0x2f36eb[_0x1b93('0x40')];_0x1854a7+=0x1){let _0x58aacf=_0x2f36eb[_0x1854a7];for(var _0x336250=0x0;_0x336250<_0x58aacf[_0x1b93('0x6f')][_0x1b93('0x40')];_0x336250+=0x1){let _0x59cb22=_0x58aacf[_0x1b93('0x6f')][_0x336250];var _0x31057a=_0x1a2ff8['clone']();_0x31057a[_0x1b93('0x45')](_0x1b93('0x86'),_0x59cb22['id']);_0x544181[_0x1b93('0x87')](db[_0x1b93('0x75')][_0x1b93('0x3c')](_0x31057a[_0x1b93('0x88')](),{'type':db['sequelize'][_0x1b93('0x89')][_0x1b93('0x8a')]})[_0x1b93('0x27')](function(_0x49cdac){if(_0x49cdac['length']===0x1){return _0x59cb22['id'];}else{var _0x4bff6e=_['every'](_['map'](_0x49cdac,_0x1b93('0x8b')),function(_0x12b712){return _[_0x1b93('0x2f')](_0x38b253,_0x12b712);});if(_0x4bff6e){return _0x59cb22['id'];}}}));}}return BPromise[_0x1b93('0x8c')](_0x544181)[_0x1b93('0x27')](function(_0x170de5){_0x563845=_(_0x563845)[_0x1b93('0x8d')](_0x170de5)[_0x1b93('0x8e')]()[_0x1b93('0x31')]();return db['VoiceQueue'][_0x1b93('0x50')]({'where':{'id':_0x157822[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](function(_0x30803c){return db[_0x1b93('0x75')][_0x1b93('0x76')](function(_0x5a2e68){return _0x30803c[_0x1b93('0x7f')](_0x157822['query'][_0x1b93('0x80')],{'transaction':_0x5a2e68})[_0x1b93('0x27')](function(){if(!_[_0x1b93('0x8f')](_0x563845)){return _0x30803c['removeAgents'](_0x563845,{'transaction':_0x5a2e68})['then'](function(){return db[_0x1b93('0x90')][_0x1b93('0x28')]({'where':{'VoiceQueueId':_0x157822[_0x1b93('0x4e')]['id'],'UserId':_0x563845},'transaction':_0x5a2e68});});}})[_0x1b93('0x27')](function(){_0x563845[_0x1b93('0x91')](function(_0xfaa599){socket['emit'](_0x1b93('0x92'),{'UserId':_0xfaa599,'VoiceQueueId':_0x30803c['id']});});});});});});})[_0x1b93('0x27')](respondWithStatusCode(_0x1509ee,null))[_0x1b93('0x4c')](handleError(_0x1509ee,null));};exports[_0x1b93('0x93')]=function(_0x2fa806,_0x2ae44d,_0x109c6a){var _0x187687,_0x4ddde7;return db['VoiceQueue'][_0x1b93('0x50')]({'where':{'id':_0x2fa806['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x2ae44d,null))[_0x1b93('0x27')](function(_0x34bd2a){if(_0x34bd2a){_0x4ddde7=_0x34bd2a;return _0x34bd2a['addAgents'](_0x2fa806[_0x1b93('0x52')]['ids'],_[_0x1b93('0x5a')](_0x2fa806[_0x1b93('0x52')],[_0x1b93('0x80'),'id'])||{})[_0x1b93('0x94')](function(_0x4c01ab){for(var _0x5b3c84=0x0;_0x5b3c84<_0x2fa806[_0x1b93('0x52')]['ids'][_0x1b93('0x40')];_0x5b3c84+=0x1){socket[_0x1b93('0x95')](_0x1b93('0x7e'),{'UserId':Number(_0x2fa806[_0x1b93('0x52')][_0x1b93('0x80')][_0x5b3c84]),'VoiceQueueId':Number(_0x2fa806[_0x1b93('0x4e')]['id'])});}return _0x4c01ab;});}})[_0x1b93('0x27')](function(_0xe00b){_0x187687=_0xe00b||[];if(_0x4ddde7){return db[_0x1b93('0x6e')][_0x1b93('0x4a')]({'where':{'id':_0x2fa806[_0x1b93('0x52')][_0x1b93('0x80')]},'attributes':['id','name',_0x1b93('0x70'),_0x1b93('0x71'),_0x1b93('0x72')],'raw':!![]});}})[_0x1b93('0x27')](function(_0x56923f){if(!_['isEmpty'](_0x56923f)){var _0x3898f0=[];for(var _0x369908=0x0;_0x369908<_0x56923f[_0x1b93('0x40')];_0x369908++){if(_0x56923f[_0x369908]['online']){_0x3898f0[_0x1b93('0x87')](db[_0x1b93('0x90')][_0x1b93('0x7b')]({'membername':_0x56923f[_0x369908][_0x1b93('0x32')],'UserId':_0x56923f[_0x369908]['id'],'queue_name':_0x4ddde7[_0x1b93('0x32')],'VoiceQueueId':_0x4ddde7['id'],'interface':_[_0x1b93('0x7c')](_0x56923f[_0x369908]['interface'])?util[_0x1b93('0x96')]('SIP/%s',_0x56923f[_0x369908][_0x1b93('0x32')]):_0x56923f[_0x369908]['interface'],'paused':_0x56923f[_0x369908]['voicePause']||![],'penalty':_0x2fa806[_0x1b93('0x52')][_0x1b93('0x74')]||0x0}));}}return BPromise[_0x1b93('0x8c')](_0x3898f0);}})[_0x1b93('0x27')](function(){return _0x187687;})[_0x1b93('0x27')](respondWithResult(_0x2ae44d,null))[_0x1b93('0x4c')](handleError(_0x2ae44d,null));};exports[_0x1b93('0x97')]=function(_0x36e38c,_0x2b6d48,_0x3ff659){return db[_0x1b93('0x38')]['find']({'where':{'id':_0x36e38c[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x2b6d48,null))['then'](function(_0x28373d){if(_0x28373d){return _0x28373d['removeAgents'](_0x36e38c['query'][_0x1b93('0x80')])[_0x1b93('0x27')](function(){if(_[_0x1b93('0x98')](_0x36e38c[_0x1b93('0x3c')][_0x1b93('0x80')])){for(var _0x4d93a9=0x0;_0x4d93a9<_0x36e38c[_0x1b93('0x3c')][_0x1b93('0x80')]['length'];_0x4d93a9+=0x1){socket[_0x1b93('0x95')](_0x1b93('0x92'),{'UserId':Number(_0x36e38c[_0x1b93('0x3c')]['ids'][_0x4d93a9]),'VoiceQueueId':Number(_0x36e38c[_0x1b93('0x4e')]['id'])});}}else{socket['emit'](_0x1b93('0x92'),{'UserId':Number(_0x36e38c[_0x1b93('0x3c')]['ids']),'VoiceQueueId':Number(_0x36e38c[_0x1b93('0x4e')]['id'])});}});}})['then'](function(_0x163d95){return db[_0x1b93('0x90')]['destroy']({'where':{'VoiceQueueId':_0x36e38c[_0x1b93('0x4e')]['id'],'UserId':_0x36e38c[_0x1b93('0x3c')]['ids']}})[_0x1b93('0x27')](function(){return _0x163d95;});})[_0x1b93('0x27')](respondWithStatusCode(_0x2b6d48,null))['catch'](handleError(_0x2b6d48,null));};exports[_0x1b93('0x99')]=function(_0x3ee80d,_0x590641,_0x944356){var _0xe96a1={};var _0x14502b={};var _0x53365e;var _0x4c70fa;return db['VoiceQueue'][_0x1b93('0x64')]({'where':{'id':_0x3ee80d[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x590641,null))[_0x1b93('0x27')](function(_0x22cb80){if(_0x22cb80){_0x53365e=_0x22cb80;_0x14502b['model']=_[_0x1b93('0x3b')](db[_0x1b93('0x6e')][_0x1b93('0x39')]);_0x14502b['query']=_[_0x1b93('0x3b')](_0x3ee80d[_0x1b93('0x3c')]);_0x14502b[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x14502b[_0x1b93('0x3a')],_0x14502b[_0x1b93('0x3c')]);_0xe96a1['attributes']=_['intersection'](_0x14502b[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x3ee80d['query']['fields']));_0xe96a1[_0x1b93('0x3e')]=_0xe96a1[_0x1b93('0x3e')][_0x1b93('0x40')]?_0xe96a1['attributes']:_0x14502b['model'];_0xe96a1[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x3ee80d[_0x1b93('0x3c')][_0x1b93('0x44')]);_0xe96a1[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x3ee80d[_0x1b93('0x3c')],_0x14502b[_0x1b93('0x46')]));if(_0x3ee80d[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0xe96a1[_0x1b93('0x45')]=_[_0x1b93('0x47')](_0xe96a1[_0x1b93('0x45')],{'$or':_[_0x1b93('0x2e')](_0xe96a1[_0x1b93('0x3e')],function(_0x21c238){var _0xfa6676={};_0xfa6676[_0x21c238]={'$like':'%'+_0x3ee80d[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0xfa6676;})});}_0xe96a1=_[_0x1b93('0x47')]({},_0xe96a1,_0x3ee80d['options']);return _0x53365e[_0x1b93('0x99')](_0xe96a1);}})[_0x1b93('0x27')](function(_0x45f720){if(_0x45f720){_0x4c70fa=_0x45f720[_0x1b93('0x40')];if(!_0x3ee80d[_0x1b93('0x3c')]['hasOwnProperty']('nolimit')){_0xe96a1[_0x1b93('0x1f')]=qs['limit'](_0x3ee80d[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0xe96a1[_0x1b93('0x21')]=qs[_0x1b93('0x21')](_0x3ee80d[_0x1b93('0x3c')][_0x1b93('0x21')]);}return _0x53365e['getAgents'](_0xe96a1);}})[_0x1b93('0x27')](function(_0x3fbf43){if(_0x3fbf43){return _0x3fbf43?{'count':_0x4c70fa,'rows':_0x3fbf43}:null;}})[_0x1b93('0x27')](respondWithResult(_0x590641,null))[_0x1b93('0x4c')](handleError(_0x590641,null));};exports[_0x1b93('0x9a')]=function(_0x3f7425,_0x5dc209,_0x558910){var _0xd1ae46={};var _0x1e76f3={};var _0x3fda78;var _0x2527dc;return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x3f7425[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x5dc209,null))[_0x1b93('0x27')](function(_0x17a7f5){if(_0x17a7f5){_0x3fda78=_0x17a7f5;_0x1e76f3[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db['UserVoiceQueueRt'][_0x1b93('0x39')]);_0x1e76f3['query']=_[_0x1b93('0x3b')](_0x3f7425[_0x1b93('0x3c')]);_0x1e76f3['filters']=_[_0x1b93('0x3d')](_0x1e76f3[_0x1b93('0x3a')],_0x1e76f3[_0x1b93('0x3c')]);_0xd1ae46[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x1e76f3[_0x1b93('0x3a')],qs['fields'](_0x3f7425[_0x1b93('0x3c')][_0x1b93('0x3f')]));_0xd1ae46[_0x1b93('0x3e')]=_0xd1ae46[_0x1b93('0x3e')][_0x1b93('0x40')]?_0xd1ae46[_0x1b93('0x3e')]:_0x1e76f3['model'];_0xd1ae46[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x3f7425[_0x1b93('0x3c')][_0x1b93('0x44')]);_0xd1ae46[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_['pick'](_0x3f7425[_0x1b93('0x3c')],_0x1e76f3['filters']));if(_0x3f7425[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0xd1ae46[_0x1b93('0x45')]=_[_0x1b93('0x47')](_0xd1ae46[_0x1b93('0x45')],{'$or':_[_0x1b93('0x2e')](_0xd1ae46[_0x1b93('0x3e')],function(_0x44e887){var _0x5e504b={};_0x5e504b[_0x44e887]={'$like':'%'+_0x3f7425[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0x5e504b;})});}_0xd1ae46=_[_0x1b93('0x47')]({},_0xd1ae46,_0x3f7425['options']);return _0x3fda78['getMembers'](_0xd1ae46);}})['then'](function(_0x29a3dc){if(_0x29a3dc){_0x2527dc=_0x29a3dc['length'];if(!_0x3f7425['query'][_0x1b93('0x41')](_0x1b93('0x42'))){_0xd1ae46['limit']=qs[_0x1b93('0x1f')](_0x3f7425[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0xd1ae46['offset']=qs['offset'](_0x3f7425[_0x1b93('0x3c')]['offset']);}return _0x3fda78[_0x1b93('0x9a')](_0xd1ae46);}})[_0x1b93('0x27')](function(_0x4bb644){return _0x4bb644?{'count':_0x2527dc,'rows':_0x4bb644}:null;})['then'](respondWithResult(_0x5dc209,null))[_0x1b93('0x4c')](handleError(_0x5dc209,null));};exports[_0x1b93('0x9b')]=function(_0x1bc1bc,_0x45d243,_0x2efcef){var _0x4d40eb={};var _0x2e2649={};var _0x562147;var _0x341257;return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x1bc1bc[_0x1b93('0x4e')]['id']}})['then'](handleEntityNotFound(_0x45d243,null))[_0x1b93('0x27')](function(_0x31da38){if(_0x31da38){_0x562147=_0x31da38;_0x2e2649[_0x1b93('0x3a')]=_['keys'](db[_0x1b93('0x9c')]['rawAttributes']);_0x2e2649[_0x1b93('0x3c')]=_[_0x1b93('0x3b')](_0x1bc1bc[_0x1b93('0x3c')]);_0x2e2649[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x2e2649[_0x1b93('0x3a')],_0x2e2649['query']);_0x4d40eb[_0x1b93('0x3e')]=_[_0x1b93('0x3d')](_0x2e2649[_0x1b93('0x3a')],qs[_0x1b93('0x3f')](_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x3f')]));_0x4d40eb[_0x1b93('0x3e')]=_0x4d40eb[_0x1b93('0x3e')]['length']?_0x4d40eb[_0x1b93('0x3e')]:_0x2e2649[_0x1b93('0x3a')];_0x4d40eb[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x44')]);_0x4d40eb[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x1bc1bc[_0x1b93('0x3c')],_0x2e2649[_0x1b93('0x46')]));if(_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x4d40eb[_0x1b93('0x45')]=_['merge'](_0x4d40eb['where'],{'$or':_['map'](_0x4d40eb[_0x1b93('0x3e')],function(_0x8cdbda){var _0xd538e4={};_0xd538e4[_0x8cdbda]={'$like':'%'+_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0xd538e4;})});}_0x4d40eb=_[_0x1b93('0x47')]({},_0x4d40eb,_0x1bc1bc[_0x1b93('0x48')]);return _0x562147['getLists'](_0x4d40eb);}})[_0x1b93('0x27')](function(_0x11512e){if(_0x11512e){_0x341257=_0x11512e[_0x1b93('0x40')];if(!_0x1bc1bc['query'][_0x1b93('0x41')](_0x1b93('0x42'))){_0x4d40eb[_0x1b93('0x1f')]=qs[_0x1b93('0x1f')](_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x4d40eb[_0x1b93('0x21')]=qs['offset'](_0x1bc1bc[_0x1b93('0x3c')][_0x1b93('0x21')]);}return _0x562147[_0x1b93('0x9b')](_0x4d40eb);}})[_0x1b93('0x27')](function(_0xeb40b3){if(_0xeb40b3){return _0xeb40b3?{'count':_0x341257,'rows':_0xeb40b3}:null;}})['then'](respondWithResult(_0x45d243,null))[_0x1b93('0x4c')](handleError(_0x45d243,null));};exports[_0x1b93('0x9d')]=function(_0x1255f4,_0x17098b,_0x18d8c0){var _0x56937a=moment()['format'](_0x1b93('0x9e'));var _0x5a2378,_0x24d2ae;return db[_0x1b93('0x38')]['find']({'where':{'id':_0x1255f4[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x17098b,null))[_0x1b93('0x27')](function(_0x5ba40a){if(_0x5ba40a){_0x24d2ae=_0x5ba40a;return _0x5ba40a['addLists'](_0x1255f4[_0x1b93('0x52')][_0x1b93('0x80')],_['omit'](_0x1255f4[_0x1b93('0x52')],[_0x1b93('0x80'),'id'])||{});}return null;})[_0x1b93('0x94')](function(_0x9d472c){var _0x42c5d4;_0x5a2378=_0x9d472c||[];var _0xbc0d80=[];if(_0x9d472c){for(var _0x1b9e48=0x0;_0x1b9e48<_0x9d472c['length'];_0x1b9e48+=0x1){var _0x2b5a00=_0x9d472c[_0x1b9e48][_0x1b93('0x29')]({'plain':!![]});_0x24d2ae['dialCheckDuplicateType']=_0x1255f4['body']['dialCheckDuplicateType']?_0x1255f4[_0x1b93('0x52')][_0x1b93('0x9f')]:_0x24d2ae[_0x1b93('0x9f')];switch(_0x24d2ae[_0x1b93('0x9f')]){case _0x1b93('0xa0'):_0x42c5d4=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x1b93('0xa1'),_0x1b93('0xa2'),_0x1b93('0xa3'),'ListId',_0x1b93('0x62'),_0x1b93('0x5b'),_0x1b93('0x5c')],squel[_0x1b93('0x81')]()['field'](_0x1b93('0xa1'),_0x1b93('0xa1'))['field']('\x27'+_0x56937a+'\x27','scheduledAt')['field']('id',_0x1b93('0xa3'))[_0x1b93('0x82')](_0x2b5a00['CmListId']['toString'](),_0x1b93('0xa4'))[_0x1b93('0x82')](_0x1255f4[_0x1b93('0x4e')]['id'][_0x1b93('0x88')](),'VoiceQueueId')[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0x5b'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0x5c'))[_0x1b93('0xa5')](_0x1b93('0xa6'))[_0x1b93('0x45')]('deletedAt\x20IS\x20NULL')[_0x1b93('0x45')](_0x1b93('0xa7'),_0x2b5a00['CmListId'][_0x1b93('0x88')]())[_0x1b93('0x45')](_0x1b93('0xa8'))[_0x1b93('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1b93('0x81')]()[_0x1b93('0x82')]('COALESCE(calleridnum,\x27\x27)')[_0x1b93('0xa5')](_0x1b93('0xa9'))[_0x1b93('0x45')](_0x1b93('0x85'),_0x1255f4[_0x1b93('0x4e')]['id'][_0x1b93('0x88')]()))[_0x1b93('0x45')](_0x1b93('0xaa'),squel[_0x1b93('0x81')]()[_0x1b93('0x82')](_0x1b93('0xab'))[_0x1b93('0xa5')](_0x1b93('0xac'))[_0x1b93('0x45')](_0x1b93('0x85'),_0x1255f4[_0x1b93('0x4e')]['id'][_0x1b93('0x88')]())))[_0x1b93('0x88')]();break;case _0x1b93('0xad'):_0x42c5d4=squel['insert']()['into'](_0x1b93('0xac'))[_0x1b93('0xae')](['phone','scheduledAt',_0x1b93('0xa3'),_0x1b93('0xa4'),_0x1b93('0x62'),_0x1b93('0x5b'),_0x1b93('0x5c')],squel[_0x1b93('0x81')]()['field']('phone',_0x1b93('0xa1'))['field']('\x27'+_0x56937a+'\x27',_0x1b93('0xa2'))['field']('id',_0x1b93('0xa3'))[_0x1b93('0x82')](_0x2b5a00[_0x1b93('0xaf')][_0x1b93('0x88')](),_0x1b93('0xa4'))['field'](_0x1255f4[_0x1b93('0x4e')]['id'][_0x1b93('0x88')](),_0x1b93('0x62'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27','createdAt')['field']('\x27'+_0x56937a+'\x27',_0x1b93('0x5c'))[_0x1b93('0xa5')](_0x1b93('0xa6'))[_0x1b93('0x45')](_0x1b93('0xb0'))[_0x1b93('0x45')](_0x1b93('0xa7'),_0x2b5a00[_0x1b93('0xaf')][_0x1b93('0x88')]())['where'](_0x1b93('0xa8'))['where'](_0x1b93('0xaa'),squel['select']()[_0x1b93('0x82')]('COALESCE(phone,\x27\x27)')[_0x1b93('0xa5')](_0x1b93('0xac'))['where']('VoiceQueueId\x20=\x20?',_0x1255f4[_0x1b93('0x4e')]['id']['toString']())))[_0x1b93('0x88')]();break;default:_0x42c5d4=squel['insert']()[_0x1b93('0xb1')]('cm_hopper')[_0x1b93('0xae')]([_0x1b93('0xa1'),'scheduledAt',_0x1b93('0xa3'),'ListId',_0x1b93('0x62'),_0x1b93('0x5b'),_0x1b93('0x5c')],squel[_0x1b93('0x81')]()['field'](_0x1b93('0xa1'),_0x1b93('0xa1'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0xa2'))[_0x1b93('0x82')]('id',_0x1b93('0xa3'))[_0x1b93('0x82')](_0x2b5a00['CmListId'][_0x1b93('0x88')](),_0x1b93('0xa4'))[_0x1b93('0x82')](_0x1255f4[_0x1b93('0x4e')]['id']['toString'](),_0x1b93('0x62'))['field']('\x27'+_0x56937a+'\x27',_0x1b93('0x5b'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0x5c'))['from'](_0x1b93('0xa6'))[_0x1b93('0x45')](_0x1b93('0xb0'))[_0x1b93('0x45')]('ListId\x20=\x20?',_0x2b5a00['CmListId'][_0x1b93('0x88')]())['where'](_0x1b93('0xa8')))[_0x1b93('0x88')]();}_0xbc0d80[_0x1b93('0x87')](db['sequelize'][_0x1b93('0x3c')](_0x42c5d4));}return BPromise[_0x1b93('0x8c')](_0xbc0d80);}})[_0x1b93('0x27')](function(){var _0x5e03cd=[];var _0x1d52b7=squel['insert']()[_0x1b93('0xb1')](_0x1b93('0xb2'))[_0x1b93('0xae')]([_0x1b93('0xb3'),_0x1b93('0xa1'),_0x1b93('0xb4'),'createdAt','updatedAt'],squel['select']()[_0x1b93('0x82')](_0x1b93('0xb5'))[_0x1b93('0x82')](_0x1b93('0xb6'))[_0x1b93('0x82')](_0x1b93('0xb7'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0x5b'))[_0x1b93('0x82')]('\x27'+_0x56937a+'\x27',_0x1b93('0x5c'))[_0x1b93('0xa5')](_0x1b93('0xb8'),'ci')['join'](_0x1b93('0xac'),'h',_0x1b93('0xb9'))['where'](_0x1b93('0xba'),_0x56937a)[_0x1b93('0x45')]('ci.ItemClass=?','PHONE'))['toString']();_0x5e03cd[_0x1b93('0x87')](db[_0x1b93('0x75')]['query'](_0x1d52b7));return BPromise[_0x1b93('0x8c')](_0x5e03cd);})[_0x1b93('0x27')](function(){return _0x5a2378;})[_0x1b93('0x27')](respondWithResult(_0x17098b,null))[_0x1b93('0x4c')](handleError(_0x17098b,null));};exports[_0x1b93('0xbb')]=function(_0x381778,_0x38e410,_0x23ee16){return db[_0x1b93('0x38')]['find']({'where':{'id':_0x381778['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x38e410,null))[_0x1b93('0x27')](function(_0x50e0c1){if(_0x50e0c1){return _0x50e0c1[_0x1b93('0xbb')](_0x381778[_0x1b93('0x3c')][_0x1b93('0x80')]);}})[_0x1b93('0x27')](function(_0xe00a1e){if(_0xe00a1e){return db[_0x1b93('0x60')][_0x1b93('0x28')]({'where':{'ListId':_0x381778[_0x1b93('0x3c')][_0x1b93('0x80')],'VoiceQueueId':_0x381778[_0x1b93('0x4e')]['id']}})['then'](function(){return _0xe00a1e;});}})[_0x1b93('0x27')](respondWithStatusCode(_0x38e410,null))['catch'](handleError(_0x38e410,null));};exports[_0x1b93('0xbc')]=function(_0x5cd527,_0x4b9951,_0x29efe2){var _0x3f0586={};var _0x57b9d9={};var _0x5dbd38;var _0x337e77;return db[_0x1b93('0x38')][_0x1b93('0x64')]({'where':{'id':_0x5cd527['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x4b9951,null))['then'](function(_0xeae410){if(_0xeae410){_0x5dbd38=_0xeae410;_0x57b9d9[_0x1b93('0x3a')]=_[_0x1b93('0x3b')](db[_0x1b93('0x9c')]['rawAttributes']);_0x57b9d9[_0x1b93('0x3c')]=_[_0x1b93('0x3b')](_0x5cd527[_0x1b93('0x3c')]);_0x57b9d9[_0x1b93('0x46')]=_[_0x1b93('0x3d')](_0x57b9d9['model'],_0x57b9d9['query']);_0x3f0586['attributes']=_[_0x1b93('0x3d')](_0x57b9d9[_0x1b93('0x3a')],qs['fields'](_0x5cd527['query'][_0x1b93('0x3f')]));_0x3f0586['attributes']=_0x3f0586[_0x1b93('0x3e')][_0x1b93('0x40')]?_0x3f0586[_0x1b93('0x3e')]:_0x57b9d9[_0x1b93('0x3a')];_0x3f0586[_0x1b93('0x43')]=qs[_0x1b93('0x44')](_0x5cd527['query'][_0x1b93('0x44')]);_0x3f0586[_0x1b93('0x45')]=qs[_0x1b93('0x46')](_[_0x1b93('0x61')](_0x5cd527[_0x1b93('0x3c')],_0x57b9d9[_0x1b93('0x46')]));if(_0x5cd527[_0x1b93('0x3c')][_0x1b93('0x2c')]){_0x3f0586[_0x1b93('0x45')]=_[_0x1b93('0x47')](_0x3f0586[_0x1b93('0x45')],{'$or':_[_0x1b93('0x2e')](_0x3f0586[_0x1b93('0x3e')],function(_0x13d171){var _0x5e6642={};_0x5e6642[_0x13d171]={'$like':'%'+_0x5cd527[_0x1b93('0x3c')][_0x1b93('0x2c')]+'%'};return _0x5e6642;})});}_0x3f0586=_[_0x1b93('0x47')]({},_0x3f0586,_0x5cd527[_0x1b93('0x48')]);return _0x5dbd38['getBlackLists'](_0x3f0586);}})[_0x1b93('0x27')](function(_0x19a7f2){if(_0x19a7f2){_0x337e77=_0x19a7f2[_0x1b93('0x40')];if(!_0x5cd527[_0x1b93('0x3c')][_0x1b93('0x41')](_0x1b93('0x42'))){_0x3f0586[_0x1b93('0x1f')]=qs[_0x1b93('0x1f')](_0x5cd527[_0x1b93('0x3c')][_0x1b93('0x1f')]);_0x3f0586['offset']=qs['offset'](_0x5cd527['query'][_0x1b93('0x21')]);}return _0x5dbd38[_0x1b93('0xbc')](_0x3f0586);}})['then'](function(_0x219944){if(_0x219944){return _0x219944?{'count':_0x337e77,'rows':_0x219944}:null;}})[_0x1b93('0x27')](respondWithResult(_0x4b9951,null))[_0x1b93('0x4c')](handleError(_0x4b9951,null));};exports[_0x1b93('0xbd')]=function(_0x44fa30,_0x1703d7,_0x47d807){var _0x30c912,_0x37a311;return db['VoiceQueue'][_0x1b93('0x50')]({'where':{'id':_0x44fa30['params']['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x1703d7,null))[_0x1b93('0x27')](function(_0x44f1c7){if(_0x44f1c7){_0x37a311=_0x44f1c7;return _0x44f1c7['addBlackLists'](_0x44fa30['body']['ids'],_[_0x1b93('0x5a')](_0x44fa30[_0x1b93('0x52')],[_0x1b93('0x80'),'id'])||{});}return null;})[_0x1b93('0x94')](function(_0x13e50e){var _0x1e2dda;_0x30c912=_0x13e50e||[];var _0x16e053=[];if(_0x13e50e){for(var _0x2006c5=0x0;_0x2006c5<_0x13e50e[_0x1b93('0x40')];_0x2006c5+=0x1){var _0x119379=_0x13e50e[_0x2006c5][_0x1b93('0x29')]({'plain':!![]});_0x1e2dda=squel['insert']()[_0x1b93('0xb1')](_0x1b93('0xbe'))['fromQuery']([_0x1b93('0xa1'),'ContactId',_0x1b93('0xa4'),_0x1b93('0x62'),_0x1b93('0x5b'),'updatedAt'],squel[_0x1b93('0x81')]()[_0x1b93('0x82')](_0x1b93('0xa1'),'phone')[_0x1b93('0x82')]('id','ContactId')[_0x1b93('0x82')](_0x119379[_0x1b93('0xaf')]['toString'](),_0x1b93('0xa4'))[_0x1b93('0x82')](_0x44fa30[_0x1b93('0x4e')]['id'][_0x1b93('0x88')](),_0x1b93('0x62'))[_0x1b93('0x82')](_0x1b93('0xbf'),_0x1b93('0x5b'))[_0x1b93('0x82')]('NOW()','updatedAt')[_0x1b93('0xa5')](_0x1b93('0xa6'))[_0x1b93('0x45')]('deletedAt\x20IS\x20NULL')[_0x1b93('0x45')]('ListId\x20=\x20?',_0x119379[_0x1b93('0xaf')][_0x1b93('0x88')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x16e053[_0x1b93('0x87')](db[_0x1b93('0x75')][_0x1b93('0x3c')](_0x1e2dda));}return BPromise['all'](_0x16e053);}})[_0x1b93('0x27')](function(){return _0x30c912;})[_0x1b93('0x27')](respondWithResult(_0x1703d7,null))[_0x1b93('0x4c')](handleError(_0x1703d7,null));};exports[_0x1b93('0xc0')]=function(_0x484d78,_0x3aef09,_0x17d8d0){return db[_0x1b93('0x38')]['find']({'where':{'id':_0x484d78[_0x1b93('0x4e')]['id']}})[_0x1b93('0x27')](handleEntityNotFound(_0x3aef09,null))['then'](function(_0x2208e8){if(_0x2208e8){return _0x2208e8[_0x1b93('0xc0')](_0x484d78['query'][_0x1b93('0x80')]);}})[_0x1b93('0x27')](function(_0x30c603){if(_0x30c603){return db[_0x1b93('0x69')]['destroy']({'where':{'ListId':_0x484d78[_0x1b93('0x3c')][_0x1b93('0x80')],'VoiceQueueId':_0x484d78['params']['id']}})['then'](function(){return _0x30c603;});}})[_0x1b93('0x27')](respondWithStatusCode(_0x3aef09,null))['catch'](handleError(_0x3aef09,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 19c15e4..3f3ac81 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 _0x0b76=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','VoiceQueue'];(function(_0x323b3d,_0x8b47d0){var _0x76fc8f=function(_0x47dba6){while(--_0x47dba6){_0x323b3d['push'](_0x323b3d['shift']());}};_0x76fc8f(++_0x8b47d0);}(_0x0b76,0x18b));var _0x60b7=function(_0x55a690,_0x15b866){_0x55a690=_0x55a690-0x0;var _0x553a8e=_0x0b76[_0x55a690];return _0x553a8e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x60b7('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x60b7('0x1')](0x0);var events={'afterCreate':_0x60b7('0x2'),'afterUpdate':_0x60b7('0x3'),'afterDestroy':_0x60b7('0x4')};function emitEvent(_0x28e727){return function(_0x348818,_0x4cfd10,_0x4876d3){VoiceQueueEvents[_0x60b7('0x5')](_0x28e727+':'+_0x348818['id'],_0x348818);VoiceQueueEvents['emit'](_0x28e727,_0x348818);_0x4876d3(null);};}for(var e in events){if(events[_0x60b7('0x6')](e)){var event=events[e];VoiceQueue[_0x60b7('0x7')](e,emitEvent(event));}}module[_0x60b7('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x840b=['remove','emit','hook','exports','events','setMaxListeners','update'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x840b,0xba));var _0xb840=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x840b[_0x5d2803];return _0xdcad2c;};'use strict';var EventEmitter=require(_0xb840('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb840('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb840('0x2'),'afterDestroy':_0xb840('0x3')};function emitEvent(_0x2bcda0){return function(_0x408449,_0x1a38aa,_0x3f4332){VoiceQueueEvents[_0xb840('0x4')](_0x2bcda0+':'+_0x408449['id'],_0x408449);VoiceQueueEvents[_0xb840('0x4')](_0x2bcda0,_0x408449);_0x3f4332(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xb840('0x5')](e,emitEvent(event));}}module[_0xb840('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 004be52..d6d3f42 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x123035,_0x122952){var _0x516c5f=function(_0x29116c){while(--_0x29116c){_0x123035['push'](_0x123035['shift']());}};_0x516c5f(++_0x122952);}(_0x70e0,0x17b));var _0x070e=function(_0xf6fd1e,_0x2db352){_0xf6fd1e=_0xf6fd1e-0x0;var _0x2c6d23=_0x70e0[_0xf6fd1e];return _0x2c6d23;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x387c36,_0x39f878){var _0x4f4d78=function(_0xa92950){while(--_0xa92950){_0x387c36['push'](_0x387c36['shift']());}};_0x4f4d78(++_0x39f878);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 717c8a4..2e0cbbf 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 _0x090b=['../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','bluebird','randomstring','../../mysqldb'];(function(_0x38b147,_0x248914){var _0x301b12=function(_0x3574ce){while(--_0x3574ce){_0x38b147['push'](_0x38b147['shift']());}};_0x301b12(++_0x248914);}(_0x090b,0x12d));var _0xb090=function(_0xd1ca9b,_0x472c3e){_0xd1ca9b=_0xd1ca9b-0x0;var _0x21df15=_0x090b[_0xd1ca9b];return _0x21df15;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb090('0x0'));var rs=require(_0xb090('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb090('0x2'))['db'];var utils=require(_0xb090('0x3'));var logger=require(_0xb090('0x4'))(_0xb090('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb090('0x6')][_0xb090('0x7')]({'port':0x232a});config[_0xb090('0x8')]=_[_0xb090('0x9')](config[_0xb090('0x8')],{'host':_0xb090('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb090('0x8')]));require(_0xb090('0xb'))['register'](socket);function respondWithRpcPromise(_0x54de0c,_0x3814dc,_0x2bc2a7){return new BPromise(function(_0x57069d,_0x19669b){return client[_0xb090('0xc')](_0x54de0c,_0x2bc2a7)[_0xb090('0xd')](function(_0x44b1b4){logger[_0xb090('0xe')](_0xb090('0xf'),_0x3814dc,'request\x20sent');logger[_0xb090('0x10')](_0xb090('0x11'),_0x3814dc,'request\x20sent',JSON[_0xb090('0x12')](_0x44b1b4));if(_0x44b1b4[_0xb090('0x13')]){if(_0x44b1b4['error'][_0xb090('0x14')]===0x1f4){logger['error'](_0xb090('0xf'),_0x3814dc,_0x44b1b4[_0xb090('0x13')][_0xb090('0x15')]);return _0x19669b(_0x44b1b4[_0xb090('0x13')][_0xb090('0x15')]);}logger[_0xb090('0x13')](_0xb090('0xf'),_0x3814dc,_0x44b1b4['error'][_0xb090('0x15')]);return _0x57069d(_0x44b1b4['error'][_0xb090('0x15')]);}else{logger[_0xb090('0xe')](_0xb090('0xf'),_0x3814dc,_0xb090('0x16'));_0x57069d(_0x44b1b4[_0xb090('0x17')][_0xb090('0x15')]);}})[_0xb090('0x18')](function(_0x29dc77){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3814dc,_0x29dc77);_0x19669b(_0x29dc77);});});}exports[_0xb090('0x19')]=function(_0x1f499c){var _0xf46d33=this;return new Promise(function(_0x4a73e6,_0x177478){return db[_0xb090('0x1a')][_0xb090('0x1b')]({'raw':_0x1f499c[_0xb090('0x1c')]?_0x1f499c[_0xb090('0x1c')][_0xb090('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f499c[_0xb090('0x1c')]?_0x1f499c[_0xb090('0x1c')][_0xb090('0x1e')]||null:null,'attributes':_0x1f499c[_0xb090('0x1c')]?_0x1f499c['options'][_0xb090('0x1f')]||null:null,'limit':_0x1f499c['options']?_0x1f499c[_0xb090('0x1c')][_0xb090('0x20')]||null:null,'include':_0x1f499c['options']?_0x1f499c[_0xb090('0x1c')]['include']?_[_0xb090('0x21')](_0x1f499c[_0xb090('0x1c')][_0xb090('0x22')],function(_0x244499){return{'model':db[_0x244499[_0xb090('0x23')]],'as':_0x244499['as'],'attributes':_0x244499[_0xb090('0x1f')],'include':_0x244499['include']?_[_0xb090('0x21')](_0x244499[_0xb090('0x22')],function(_0x58e745){return{'model':db[_0x58e745['model']],'as':_0x58e745['as'],'attributes':_0x58e745['attributes'],'include':_0x58e745['include']?_[_0xb090('0x21')](_0x58e745['include'],function(_0x27d886){return{'model':db[_0x27d886[_0xb090('0x23')]],'as':_0x27d886['as'],'attributes':_0x27d886[_0xb090('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x493c6a){logger[_0xb090('0xe')]('GetVoiceQueue',_0x1f499c);logger[_0xb090('0x10')](_0xb090('0x19'),_0x1f499c,JSON[_0xb090('0x12')](_0x493c6a));_0x4a73e6(_0x493c6a);})[_0xb090('0x18')](function(_0x2b3364){logger['error']('GetVoiceQueue',_0x2b3364[_0xb090('0x15')],_0x1f499c);_0x177478(_0xf46d33[_0xb090('0x13')](0x1f4,_0x2b3364[_0xb090('0x15')]));});});};exports[_0xb090('0x24')]=function(_0xb54736){var _0x434a0e=this;return new Promise(function(_0x5eb197,_0x8c4737){return db[_0xb090('0x1a')][_0xb090('0x25')]({'raw':_0xb54736[_0xb090('0x1c')]?_0xb54736[_0xb090('0x1c')][_0xb090('0x1d')]===undefined?!![]:![]:!![],'where':_0xb54736[_0xb090('0x1c')]?_0xb54736['options'][_0xb090('0x1e')]||null:null,'attributes':_0xb54736['options']?_0xb54736[_0xb090('0x1c')][_0xb090('0x1f')]||null:null,'include':_0xb54736[_0xb090('0x1c')]?_0xb54736[_0xb090('0x1c')]['include']?_['map'](_0xb54736[_0xb090('0x1c')][_0xb090('0x22')],function(_0xd12561){return{'model':db[_0xd12561[_0xb090('0x23')]],'as':_0xd12561['as'],'attributes':_0xd12561[_0xb090('0x1f')],'include':_0xd12561[_0xb090('0x22')]?_['map'](_0xd12561[_0xb090('0x22')],function(_0x4bc0f7){return{'model':db[_0x4bc0f7['model']],'as':_0x4bc0f7['as'],'attributes':_0x4bc0f7[_0xb090('0x1f')],'include':_0x4bc0f7[_0xb090('0x22')]?_[_0xb090('0x21')](_0x4bc0f7[_0xb090('0x22')],function(_0x33d4ff){return{'model':db[_0x33d4ff['model']],'as':_0x33d4ff['as'],'attributes':_0x33d4ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a872f){logger['info'](_0xb090('0x24'),_0xb54736);logger[_0xb090('0x10')](_0xb090('0x24'),_0xb54736,JSON[_0xb090('0x12')](_0x1a872f));_0x5eb197(_0x1a872f);})['catch'](function(_0x9a9f4b){logger[_0xb090('0x13')](_0xb090('0x24'),_0x9a9f4b[_0xb090('0x15')],_0xb54736);_0x8c4737(_0x434a0e[_0xb090('0x13')](0x1f4,_0x9a9f4b[_0xb090('0x15')]));});});}; \ No newline at end of file +var _0x82d3=['model','find','ShowVoiceQueue','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x82d3,0x18f));var _0x382d=function(_0x1f6b45,_0x262f04){_0x1f6b45=_0x1f6b45-0x0;var _0x538c60=_0x82d3[_0x1f6b45];return _0x538c60;};'use strict';var _=require(_0x382d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x382d('0x1'));var db=require(_0x382d('0x2'))['db'];var utils=require(_0x382d('0x3'));var logger=require(_0x382d('0x4'))('rpc');var config=require(_0x382d('0x5'));var jayson=require(_0x382d('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x382d('0x7')]=_['defaults'](config[_0x382d('0x7')],{'host':_0x382d('0x8'),'port':0x18eb});var socket=require(_0x382d('0x9'))(new Redis(config['redis']));require(_0x382d('0xa'))[_0x382d('0xb')](socket);function respondWithRpcPromise(_0x2cd897,_0x7e0252,_0x54649b){return new BPromise(function(_0x5ad257,_0x154d40){return client['request'](_0x2cd897,_0x54649b)[_0x382d('0xc')](function(_0xeab893){logger[_0x382d('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x7e0252,_0x382d('0xe'));logger[_0x382d('0xf')](_0x382d('0x10'),_0x7e0252,'request\x20sent',JSON[_0x382d('0x11')](_0xeab893));if(_0xeab893[_0x382d('0x12')]){if(_0xeab893['error'][_0x382d('0x13')]===0x1f4){logger[_0x382d('0x12')](_0x382d('0x14'),_0x7e0252,_0xeab893[_0x382d('0x12')][_0x382d('0x15')]);return _0x154d40(_0xeab893[_0x382d('0x12')]['message']);}logger[_0x382d('0x12')](_0x382d('0x14'),_0x7e0252,_0xeab893[_0x382d('0x12')][_0x382d('0x15')]);return _0x5ad257(_0xeab893[_0x382d('0x12')]['message']);}else{logger['info'](_0x382d('0x14'),_0x7e0252,_0x382d('0xe'));_0x5ad257(_0xeab893['result'][_0x382d('0x15')]);}})[_0x382d('0x16')](function(_0x36304d){logger[_0x382d('0x12')](_0x382d('0x14'),_0x7e0252,_0x36304d);_0x154d40(_0x36304d);});});}exports[_0x382d('0x17')]=function(_0x441003){var _0xe3775a=this;return new Promise(function(_0xee8c22,_0x54a2fc){return db[_0x382d('0x18')][_0x382d('0x19')]({'raw':_0x441003[_0x382d('0x1a')]?_0x441003['options'][_0x382d('0x1b')]===undefined?!![]:![]:!![],'where':_0x441003['options']?_0x441003['options'][_0x382d('0x1c')]||null:null,'attributes':_0x441003['options']?_0x441003[_0x382d('0x1a')][_0x382d('0x1d')]||null:null,'limit':_0x441003[_0x382d('0x1a')]?_0x441003['options'][_0x382d('0x1e')]||null:null,'include':_0x441003[_0x382d('0x1a')]?_0x441003[_0x382d('0x1a')][_0x382d('0x1f')]?_[_0x382d('0x20')](_0x441003['options'][_0x382d('0x1f')],function(_0xfae99e){return{'model':db[_0xfae99e['model']],'as':_0xfae99e['as'],'attributes':_0xfae99e[_0x382d('0x1d')],'include':_0xfae99e[_0x382d('0x1f')]?_[_0x382d('0x20')](_0xfae99e[_0x382d('0x1f')],function(_0x307c3e){return{'model':db[_0x307c3e[_0x382d('0x21')]],'as':_0x307c3e['as'],'attributes':_0x307c3e[_0x382d('0x1d')],'include':_0x307c3e[_0x382d('0x1f')]?_[_0x382d('0x20')](_0x307c3e[_0x382d('0x1f')],function(_0x458bf3){return{'model':db[_0x458bf3[_0x382d('0x21')]],'as':_0x458bf3['as'],'attributes':_0x458bf3['attributes']};}):[]};}):[]};}):[]:[]})[_0x382d('0xc')](function(_0x54879d){logger[_0x382d('0xd')](_0x382d('0x17'),_0x441003);logger[_0x382d('0xf')]('GetVoiceQueue',_0x441003,JSON['stringify'](_0x54879d));_0xee8c22(_0x54879d);})[_0x382d('0x16')](function(_0x40f019){logger['error'](_0x382d('0x17'),_0x40f019[_0x382d('0x15')],_0x441003);_0x54a2fc(_0xe3775a[_0x382d('0x12')](0x1f4,_0x40f019[_0x382d('0x15')]));});});};exports['ShowVoiceQueue']=function(_0xd7b680){var _0x519819=this;return new Promise(function(_0x215b9e,_0x557d9d){return db[_0x382d('0x18')][_0x382d('0x22')]({'raw':_0xd7b680[_0x382d('0x1a')]?_0xd7b680[_0x382d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd7b680[_0x382d('0x1a')]?_0xd7b680[_0x382d('0x1a')]['where']||null:null,'attributes':_0xd7b680[_0x382d('0x1a')]?_0xd7b680[_0x382d('0x1a')][_0x382d('0x1d')]||null:null,'include':_0xd7b680[_0x382d('0x1a')]?_0xd7b680[_0x382d('0x1a')][_0x382d('0x1f')]?_[_0x382d('0x20')](_0xd7b680[_0x382d('0x1a')][_0x382d('0x1f')],function(_0x4374e0){return{'model':db[_0x4374e0['model']],'as':_0x4374e0['as'],'attributes':_0x4374e0[_0x382d('0x1d')],'include':_0x4374e0[_0x382d('0x1f')]?_[_0x382d('0x20')](_0x4374e0['include'],function(_0x4888c0){return{'model':db[_0x4888c0['model']],'as':_0x4888c0['as'],'attributes':_0x4888c0['attributes'],'include':_0x4888c0[_0x382d('0x1f')]?_['map'](_0x4888c0[_0x382d('0x1f')],function(_0x4cecbc){return{'model':db[_0x4cecbc['model']],'as':_0x4cecbc['as'],'attributes':_0x4cecbc[_0x382d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x382d('0xc')](function(_0x2969c6){logger[_0x382d('0xd')](_0x382d('0x23'),_0xd7b680);logger[_0x382d('0xf')]('ShowVoiceQueue',_0xd7b680,JSON[_0x382d('0x11')](_0x2969c6));_0x215b9e(_0x2969c6);})[_0x382d('0x16')](function(_0x1e67c4){logger[_0x382d('0x12')]('ShowVoiceQueue',_0x1e67c4[_0x382d('0x15')],_0xd7b680);_0x557d9d(_0x519819[_0x382d('0x12')](0x1f4,_0x1e67c4[_0x382d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index a9e0db4..ba8ff76 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 _0x1afc=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x2a3dde,_0x56f85d){var _0x2977f0=function(_0x50bd6e){while(--_0x50bd6e){_0x2a3dde['push'](_0x2a3dde['shift']());}};_0x2977f0(++_0x56f85d);}(_0x1afc,0x123));var _0xc1af=function(_0x2cc5f8,_0x3994e6){_0x2cc5f8=_0x2cc5f8-0x0;var _0x3a150d=_0x1afc[_0x2cc5f8];return _0x3a150d;};'use strict';var VoiceQueueEvents=require(_0xc1af('0x0'));var events=['save',_0xc1af('0x1'),_0xc1af('0x2')];function createListener(_0x468cb7,_0x1e993a){return function(_0x5afece){_0x1e993a[_0xc1af('0x3')](_0x468cb7,_0x5afece);};}function removeListener(_0x3064d3,_0x36aef4){return function(){VoiceQueueEvents[_0xc1af('0x4')](_0x3064d3,_0x36aef4);};}exports[_0xc1af('0x5')]=function(_0x2824c7){for(var _0x20082d=0x0,_0x2dca91=events['length'];_0x20082d<_0x2dca91;_0x20082d++){var _0x39329e=events[_0x20082d];var _0xf22337=createListener(_0xc1af('0x6')+_0x39329e,_0x2824c7);VoiceQueueEvents['on'](_0x39329e,_0xf22337);}}; \ No newline at end of file +var _0x5908=['remove','update','emit','register','length','save'];(function(_0x388827,_0xdc27bc){var _0x16e887=function(_0x3d3fc0){while(--_0x3d3fc0){_0x388827['push'](_0x388827['shift']());}};_0x16e887(++_0xdc27bc);}(_0x5908,0x8f));var _0x8590=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5908[_0x167cc1];return _0x10bc4b;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x8590('0x0'),_0x8590('0x1'),_0x8590('0x2')];function createListener(_0x50bfec,_0x188645){return function(_0x12ec5c){_0x188645[_0x8590('0x3')](_0x50bfec,_0x12ec5c);};}function removeListener(_0x3411bf,_0x26f9c2){return function(){VoiceQueueEvents['removeListener'](_0x3411bf,_0x26f9c2);};}exports[_0x8590('0x4')]=function(_0x523868){for(var _0x51cdb7=0x0,_0x3e6ea4=events[_0x8590('0x5')];_0x51cdb7<_0x3e6ea4;_0x51cdb7++){var _0x44a383=events[_0x51cdb7];var _0x3538a3=createListener('voiceQueue:'+_0x44a383,_0x523868);VoiceQueueEvents['on'](_0x44a383,_0x3538a3);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index f77e23e..10e4d07 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 _0x9b92=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path'];(function(_0x30603a,_0x5c2506){var _0x33c3b7=function(_0x5534a3){while(--_0x5534a3){_0x30603a['push'](_0x30603a['shift']());}};_0x33c3b7(++_0x5c2506);}(_0x9b92,0x156));var _0x29b9=function(_0x26b9d7,_0x1e9de1){_0x26b9d7=_0x26b9d7-0x0;var _0x370de3=_0x9b92[_0x26b9d7];return _0x370de3;};'use strict';var multer=require(_0x29b9('0x0'));var util=require(_0x29b9('0x1'));var path=require(_0x29b9('0x2'));var timeout=require(_0x29b9('0x3'));var express=require(_0x29b9('0x4'));var router=express[_0x29b9('0x5')]();var fs_extra=require(_0x29b9('0x6'));var auth=require(_0x29b9('0x7'));var interaction=require(_0x29b9('0x8'));var config=require(_0x29b9('0x9'));var controller=require(_0x29b9('0xa'));router[_0x29b9('0xb')]('/',auth[_0x29b9('0xc')](),controller['index']);router[_0x29b9('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x29b9('0xd')]);router[_0x29b9('0xb')](_0x29b9('0xe'),auth[_0x29b9('0xc')](),controller[_0x29b9('0xf')]);router[_0x29b9('0xb')](_0x29b9('0x10'),auth[_0x29b9('0xc')](),controller[_0x29b9('0x11')]);router[_0x29b9('0x12')]('/',auth['isAuthenticated'](),controller[_0x29b9('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x29b9('0x14')]);router[_0x29b9('0x15')](_0x29b9('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x29b9('0x16')]=router; \ No newline at end of file +var _0x3703=['/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get'];(function(_0x23a959,_0x5c39dd){var _0x2b73dd=function(_0x2ced19){while(--_0x2ced19){_0x23a959['push'](_0x23a959['shift']());}};_0x2b73dd(++_0x5c39dd);}(_0x3703,0x96));var _0x3370=function(_0x9ba57c,_0x5ecc0d){_0x9ba57c=_0x9ba57c-0x0;var _0x627a6e=_0x3703[_0x9ba57c];return _0x627a6e;};'use strict';var multer=require(_0x3370('0x0'));var util=require(_0x3370('0x1'));var path=require(_0x3370('0x2'));var timeout=require(_0x3370('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3370('0x4'));var interaction=require(_0x3370('0x5'));var config=require('../../config/environment');var controller=require(_0x3370('0x6'));router['get']('/',auth[_0x3370('0x7')](),controller[_0x3370('0x8')]);router[_0x3370('0x9')](_0x3370('0xa'),auth['isAuthenticated'](),controller[_0x3370('0xb')]);router[_0x3370('0x9')](_0x3370('0xc'),auth['isAuthenticated'](),controller[_0x3370('0xd')]);router['get'](_0x3370('0xe'),auth[_0x3370('0x7')](),controller[_0x3370('0xf')]);router[_0x3370('0x10')]('/',auth[_0x3370('0x7')](),controller[_0x3370('0x11')]);router[_0x3370('0x12')](_0x3370('0xe'),auth[_0x3370('0x7')](),controller['update']);router['delete'](_0x3370('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3370('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index e600e35..a7b3c46 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 _0x2ce3=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue'];(function(_0x462d95,_0xbd0b6b){var _0x213c65=function(_0x23673a){while(--_0x23673a){_0x462d95['push'](_0x462d95['shift']());}};_0x213c65(++_0xbd0b6b);}(_0x2ce3,0xaf));var _0x32ce=function(_0x428fc7,_0x3094d2){_0x428fc7=_0x428fc7-0x0;var _0x169864=_0x2ce3[_0x428fc7];return _0x169864;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x32ce('0x0'));module[_0x32ce('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x32ce('0x2')]},'calleridnum':{'type':Sequelize[_0x32ce('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x32ce('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x32ce('0x3')],'set':function(_0x31b3a3){var _0x653153=moment(_0x31b3a3);var _0x33df30=moment(this[_0x32ce('0x4')]('queuecallerjoinAt'))['format'](_0x32ce('0x5'));var _0x47a52c=_0x653153[_0x32ce('0x6')](_0x33df30,_0x32ce('0x7'));this[_0x32ce('0x8')](_0x32ce('0x9'),_0x31b3a3);this[_0x32ce('0x8')](_0x32ce('0xa'),_0x47a52c||null);}},'position':{'type':Sequelize[_0x32ce('0xb')]},'count':{'type':Sequelize[_0x32ce('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x32ce('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x32ce('0x2')],'comment':_0x32ce('0xd')},'originalposition':{'type':Sequelize[_0x32ce('0xb')]},'channel':{'type':Sequelize[_0x32ce('0x2')]},'connectedlinenum':{'type':Sequelize[_0x32ce('0x2')]},'connectedlinename':{'type':Sequelize[_0x32ce('0x2')]},'accountcode':{'type':Sequelize[_0x32ce('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x32ce('0x2')]},'priority':{'type':Sequelize[_0x32ce('0x2')]},'holdtime':{'type':Sequelize[_0x32ce('0xb')]},'mohtime':{'type':Sequelize[_0x32ce('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x32ce('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x32ce('0x2')],'comment':_0x32ce('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x32ce('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x32ce('0x2')]},'thirdDisposition':{'type':Sequelize[_0x32ce('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x32ce('0x2')]}}; \ No newline at end of file +var _0xa789=['DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','queuecallerjoinAt','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN'];(function(_0xde2f29,_0x4e7e5e){var _0x42752b=function(_0x2f76be){while(--_0x2f76be){_0xde2f29['push'](_0xde2f29['shift']());}};_0x42752b(++_0x4e7e5e);}(_0xa789,0x12e));var _0x9a78=function(_0x4c583c,_0x2121d1){_0x4c583c=_0x4c583c-0x0;var _0x5e17b7=_0xa789[_0x4c583c];return _0x5e17b7;};'use strict';var Sequelize=require(_0x9a78('0x0'));var moment=require(_0x9a78('0x1'));module[_0x9a78('0x2')]={'type':{'type':Sequelize[_0x9a78('0x3')]},'uniqueid':{'type':Sequelize[_0x9a78('0x3')]},'calleridnum':{'type':Sequelize[_0x9a78('0x3')]},'calleridname':{'type':Sequelize[_0x9a78('0x3')]},'queue':{'type':Sequelize[_0x9a78('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x218ff3){var _0x1bbfde=moment(_0x218ff3);var _0x3ad5af=moment(this['getDataValue'](_0x9a78('0x4')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x346aec=_0x1bbfde[_0x9a78('0x5')](_0x3ad5af,'seconds');this[_0x9a78('0x6')](_0x9a78('0x7'),_0x218ff3);this[_0x9a78('0x6')]('holdtime',_0x346aec||null);}},'position':{'type':Sequelize[_0x9a78('0x8')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x9a78('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9a78('0xa')]},'queuecallercomplete':{'type':Sequelize[_0x9a78('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9a78('0xa')]},'queuecallerexit':{'type':Sequelize[_0x9a78('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x9a78('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9a78('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9a78('0x3')]},'context':{'type':Sequelize[_0x9a78('0x3')]},'exten':{'type':Sequelize[_0x9a78('0x3')]},'priority':{'type':Sequelize[_0x9a78('0x3')]},'holdtime':{'type':Sequelize[_0x9a78('0x8')]},'mohtime':{'type':Sequelize[_0x9a78('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9a78('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9a78('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9a78('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 21bdb2f..d8226b1 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 _0x4e1c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceQueueReport','then','includeAll','findAll','catch','show','keys','options','create','body','find','params','describe','getVoiceQueuesReport','include','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x4e1c,0x167));var _0xc4e1=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x4e1c[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xc4e1('0x0'));var rimraf=require(_0xc4e1('0x1'));var zipdir=require(_0xc4e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e1('0x3'));var moment=require('moment');var BPromise=require(_0xc4e1('0x4'));var Mustache=require('mustache');var util=require(_0xc4e1('0x5'));var path=require(_0xc4e1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4e1('0x7'));var _=require(_0xc4e1('0x8'));var squel=require(_0xc4e1('0x9'));var crypto=require('crypto');var jsforce=require(_0xc4e1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc4e1('0xb'));var querystring=require('querystring');var Papa=require(_0xc4e1('0xc'));var Redis=require(_0xc4e1('0xd'));var authService=require(_0xc4e1('0xe'));var qs=require(_0xc4e1('0xf'));var as=require(_0xc4e1('0x10'));var hardwareService=require(_0xc4e1('0x11'));var logger=require(_0xc4e1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc4e1('0x13'));var licenseUtil=require(_0xc4e1('0x14'));var db=require(_0xc4e1('0x15'))['db'];config[_0xc4e1('0x16')]=_[_0xc4e1('0x17')](config[_0xc4e1('0x16')],{'host':_0xc4e1('0x18'),'port':0x18eb});var socket=require(_0xc4e1('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xc4e1('0x1a')](socket);function respondWithStatusCode(_0x3079d1,_0x2cad89){_0x2cad89=_0x2cad89||0xcc;return function(_0x4aa550){if(_0x4aa550){return _0x3079d1[_0xc4e1('0x1b')](_0x2cad89);}return _0x3079d1[_0xc4e1('0x1c')](_0x2cad89)[_0xc4e1('0x1d')]();};}function respondWithResult(_0x2c6d34,_0x17e688){_0x17e688=_0x17e688||0xc8;return function(_0x48bdf1){if(_0x48bdf1){return _0x2c6d34[_0xc4e1('0x1c')](_0x17e688)[_0xc4e1('0x1e')](_0x48bdf1);}};}function respondWithFilteredResult(_0x24ce9d,_0x427db9){return function(_0x274bfc){if(_0x274bfc){var _0x2edd79=typeof _0x427db9[_0xc4e1('0x1f')]===_0xc4e1('0x20')&&typeof _0x427db9[_0xc4e1('0x21')]===_0xc4e1('0x20');var _0x17c0b5=_0x274bfc[_0xc4e1('0x22')];var _0x17e601=_0x2edd79?0x0:_0x427db9[_0xc4e1('0x1f')];var _0x2358f2=_0x2edd79?_0x274bfc[_0xc4e1('0x22')]:_0x427db9['offset']+_0x427db9[_0xc4e1('0x21')];var _0x5a1b85;if(_0x2358f2>=_0x17c0b5){_0x2358f2=_0x17c0b5;_0x5a1b85=0xc8;}else{_0x5a1b85=0xce;}_0x24ce9d[_0xc4e1('0x1c')](_0x5a1b85);return _0x24ce9d['set']('Content-Range',_0x17e601+'-'+_0x2358f2+'/'+_0x17c0b5)[_0xc4e1('0x1e')](_0x274bfc);}return null;};}function patchUpdates(_0x2b7976){return function(_0x5a6d86){try{jsonpatch['apply'](_0x5a6d86,_0x2b7976,!![]);}catch(_0x3bb5d1){return BPromise['reject'](_0x3bb5d1);}return _0x5a6d86['save']();};}function saveUpdates(_0x1b850b,_0x57103f){return function(_0x5c77f7){if(_0x5c77f7){return _0x5c77f7[_0xc4e1('0x23')](_0x1b850b)['then'](function(_0x28e010){return _0x28e010;});}return null;};}function removeEntity(_0x5a042d,_0x2ec73a){return function(_0xe46afd){if(_0xe46afd){return _0xe46afd[_0xc4e1('0x24')]()['then'](function(){_0x5a042d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x480ef5,_0x3ae1a6){return function(_0x1e0ea4){if(!_0x1e0ea4){_0x480ef5[_0xc4e1('0x1b')](0x194);}return _0x1e0ea4;};}function handleError(_0x20e1ab,_0xde64bc){_0xde64bc=_0xde64bc||0x1f4;return function(_0x53d6eb){logger['error'](_0x53d6eb['stack']);if(_0x53d6eb[_0xc4e1('0x25')]){delete _0x53d6eb[_0xc4e1('0x25')];}_0x20e1ab[_0xc4e1('0x1c')](_0xde64bc)[_0xc4e1('0x26')](_0x53d6eb);};}exports[_0xc4e1('0x27')]=function(_0x53724f,_0xcabcfb){var _0x14041b={},_0x5303f6={},_0x1fb798={'count':0x0,'rows':[]};var _0x40e8cc=_[_0xc4e1('0x28')](db['VoiceQueueReport'][_0xc4e1('0x29')],function(_0x1e75fc){return{'name':_0x1e75fc['fieldName'],'type':_0x1e75fc[_0xc4e1('0x2a')][_0xc4e1('0x2b')]};});_0x5303f6['model']=_[_0xc4e1('0x28')](_0x40e8cc,_0xc4e1('0x25'));_0x5303f6[_0xc4e1('0x2c')]=_['keys'](_0x53724f[_0xc4e1('0x2c')]);_0x5303f6[_0xc4e1('0x2d')]=_[_0xc4e1('0x2e')](_0x5303f6[_0xc4e1('0x2f')],_0x5303f6[_0xc4e1('0x2c')]);_0x14041b['attributes']=_['intersection'](_0x5303f6[_0xc4e1('0x2f')],qs[_0xc4e1('0x30')](_0x53724f[_0xc4e1('0x2c')]['fields']));_0x14041b[_0xc4e1('0x31')]=_0x14041b[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x14041b[_0xc4e1('0x31')]:_0x5303f6[_0xc4e1('0x2f')];if(!_0x53724f['query'][_0xc4e1('0x33')](_0xc4e1('0x34'))){_0x14041b[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x21')]);_0x14041b['offset']=qs[_0xc4e1('0x1f')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x1f')]);}_0x14041b[_0xc4e1('0x35')]=qs[_0xc4e1('0x36')](_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x36')]);_0x14041b[_0xc4e1('0x37')]=qs[_0xc4e1('0x2d')](_[_0xc4e1('0x38')](_0x53724f[_0xc4e1('0x2c')],_0x5303f6[_0xc4e1('0x2d')]),_0x40e8cc);if(_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x39')]){_0x14041b['where']=_[_0xc4e1('0x3a')](_0x14041b[_0xc4e1('0x37')],{'$or':_[_0xc4e1('0x28')](_0x40e8cc,function(_0x59c5b9){if(_0x59c5b9[_0xc4e1('0x2a')]!==_0xc4e1('0x3b')){var _0x37757b={};_0x37757b[_0x59c5b9[_0xc4e1('0x25')]]={'$like':'%'+_0x53724f['query'][_0xc4e1('0x39')]+'%'};return _0x37757b;}})});}_0x14041b=_['merge']({},_0x14041b,_0x53724f['options']);var _0x37f5c7={'where':_0x14041b[_0xc4e1('0x37')]};return db[_0xc4e1('0x3c')]['count'](_0x37f5c7)[_0xc4e1('0x3d')](function(_0x563d1a){_0x1fb798['count']=_0x563d1a;if(_0x53724f[_0xc4e1('0x2c')][_0xc4e1('0x3e')]){_0x14041b['include']=[{'all':!![]}];}return db[_0xc4e1('0x3c')][_0xc4e1('0x3f')](_0x14041b);})['then'](function(_0x36a3ae){_0x1fb798['rows']=_0x36a3ae;return _0x1fb798;})[_0xc4e1('0x3d')](respondWithFilteredResult(_0xcabcfb,_0x14041b))[_0xc4e1('0x40')](handleError(_0xcabcfb,null));};exports[_0xc4e1('0x41')]=function(_0x5476a7,_0x32c2b5){var _0x150885={'raw':![],'where':{'id':_0x5476a7['params']['id']}},_0x5c70e4={};_0x5c70e4['model']=_['keys'](db['VoiceQueueReport'][_0xc4e1('0x29')]);_0x5c70e4[_0xc4e1('0x2c')]=_[_0xc4e1('0x42')](_0x5476a7[_0xc4e1('0x2c')]);_0x5c70e4['filters']=_[_0xc4e1('0x2e')](_0x5c70e4[_0xc4e1('0x2f')],_0x5c70e4['query']);_0x150885[_0xc4e1('0x31')]=_['intersection'](_0x5c70e4['model'],qs['fields'](_0x5476a7[_0xc4e1('0x2c')]['fields']));_0x150885[_0xc4e1('0x31')]=_0x150885[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x150885[_0xc4e1('0x31')]:_0x5c70e4[_0xc4e1('0x2f')];if(_0x5476a7['query']['includeAll']){_0x150885['include']=[{'all':!![]}];}_0x150885=_[_0xc4e1('0x3a')]({},_0x150885,_0x5476a7[_0xc4e1('0x43')]);return db[_0xc4e1('0x3c')]['find'](_0x150885)[_0xc4e1('0x3d')](handleEntityNotFound(_0x32c2b5,null))[_0xc4e1('0x3d')](respondWithResult(_0x32c2b5,null))[_0xc4e1('0x40')](handleError(_0x32c2b5,null));};exports[_0xc4e1('0x44')]=function(_0x18bffb,_0x22e956){return db[_0xc4e1('0x3c')]['create'](_0x18bffb[_0xc4e1('0x45')],{})[_0xc4e1('0x3d')](respondWithResult(_0x22e956,0xc9))['catch'](handleError(_0x22e956,null));};exports[_0xc4e1('0x23')]=function(_0x34b82f,_0x49a768){if(_0x34b82f['body']['id']){delete _0x34b82f[_0xc4e1('0x45')]['id'];}return db['VoiceQueueReport'][_0xc4e1('0x46')]({'where':{'id':_0x34b82f[_0xc4e1('0x47')]['id']}})[_0xc4e1('0x3d')](handleEntityNotFound(_0x49a768,null))[_0xc4e1('0x3d')](saveUpdates(_0x34b82f[_0xc4e1('0x45')],null))[_0xc4e1('0x3d')](respondWithResult(_0x49a768,null))[_0xc4e1('0x40')](handleError(_0x49a768,null));};exports[_0xc4e1('0x24')]=function(_0x5b7c15,_0x507c05){return db[_0xc4e1('0x3c')]['find']({'where':{'id':_0x5b7c15[_0xc4e1('0x47')]['id']}})[_0xc4e1('0x3d')](handleEntityNotFound(_0x507c05,null))[_0xc4e1('0x3d')](removeEntity(_0x507c05,null))[_0xc4e1('0x40')](handleError(_0x507c05,null));};exports[_0xc4e1('0x48')]=function(_0x25bb0b,_0x2ca167){return db['VoiceQueueReport'][_0xc4e1('0x48')]()['then'](respondWithResult(_0x2ca167,null))[_0xc4e1('0x40')](handleError(_0x2ca167,null));};exports[_0xc4e1('0x49')]=function(_0x5edd86,_0x47471){var _0x59e48f={},_0x225afd={},_0x3fd1a9={'count':0x0,'rows':[]};_0x225afd[_0xc4e1('0x2f')]=_[_0xc4e1('0x42')](db[_0xc4e1('0x3c')][_0xc4e1('0x29')]);_0x225afd[_0xc4e1('0x2c')]=_[_0xc4e1('0x42')](_0x5edd86[_0xc4e1('0x2c')]);_0x225afd[_0xc4e1('0x2d')]=_[_0xc4e1('0x2e')](_0x225afd['model'],_0x225afd[_0xc4e1('0x2c')]);_0x59e48f[_0xc4e1('0x31')]=_[_0xc4e1('0x2e')](_0x225afd['model'],qs['fields'](_0x5edd86['query'][_0xc4e1('0x30')]));_0x59e48f[_0xc4e1('0x31')]=_0x59e48f[_0xc4e1('0x31')][_0xc4e1('0x32')]?_0x59e48f[_0xc4e1('0x31')]:_0x225afd['model'];if(!_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x33')](_0xc4e1('0x34'))){_0x59e48f[_0xc4e1('0x21')]=qs[_0xc4e1('0x21')](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x21')]);_0x59e48f[_0xc4e1('0x1f')]=qs[_0xc4e1('0x1f')](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x1f')]);}_0x59e48f[_0xc4e1('0x35')]=qs['sort'](_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x36')]);_0x59e48f[_0xc4e1('0x37')]=qs[_0xc4e1('0x2d')](_[_0xc4e1('0x38')](_0x5edd86[_0xc4e1('0x2c')],_0x225afd[_0xc4e1('0x2d')]));if(_0x5edd86[_0xc4e1('0x2c')][_0xc4e1('0x39')]){_0x59e48f[_0xc4e1('0x37')]=_[_0xc4e1('0x3a')](_0x59e48f[_0xc4e1('0x37')],{'$or':_[_0xc4e1('0x28')](_0x59e48f['attributes'],function(_0x52ce8e){var _0x325efc={};_0x325efc[_0x52ce8e]={'$like':'%'+_0x5edd86['query']['filter']+'%'};return _0x325efc;})});}_0x59e48f=_[_0xc4e1('0x3a')]({},_0x59e48f,_0x5edd86[_0xc4e1('0x43')]);var _0x273be0={'where':_0x59e48f[_0xc4e1('0x37')]};return db[_0xc4e1('0x3c')][_0xc4e1('0x22')](_0x273be0)['then'](function(_0x338e40){_0x3fd1a9[_0xc4e1('0x22')]=_0x338e40;if(_0x5edd86[_0xc4e1('0x2c')]['includeAll']){_0x59e48f[_0xc4e1('0x4a')]=[{'all':!![]}];}return db[_0xc4e1('0x3c')]['findAll'](_0x59e48f);})[_0xc4e1('0x3d')](function(_0x489e7f){_0x3fd1a9['rows']=_0x489e7f;return _0x3fd1a9;})[_0xc4e1('0x3d')](respondWithFilteredResult(_0x47471,_0x59e48f,_0xc4e1('0x49')))[_0xc4e1('0x40')](handleError(_0x47471,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x3c7d=['hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','count','includeAll','findAll','rows','catch','show','params','options','find','create','body','update','describe','getVoiceQueuesReport','include','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','then','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1d9e1e,_0x10c013){var _0x1e5e84=function(_0x40a8b9){while(--_0x40a8b9){_0x1d9e1e['push'](_0x1d9e1e['shift']());}};_0x1e5e84(++_0x10c013);}(_0x3c7d,0x104));var _0xd3c7=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x3c7d[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0xd3c7('0x0'));var rimraf=require(_0xd3c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd3c7('0x2'));var moment=require(_0xd3c7('0x3'));var BPromise=require(_0xd3c7('0x4'));var Mustache=require(_0xd3c7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd3c7('0x6'));var csv=require(_0xd3c7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3c7('0x8'));var _=require(_0xd3c7('0x9'));var squel=require(_0xd3c7('0xa'));var crypto=require(_0xd3c7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd3c7('0xc'));var toCsv=require(_0xd3c7('0x7'));var querystring=require(_0xd3c7('0xd'));var Papa=require(_0xd3c7('0xe'));var Redis=require(_0xd3c7('0xf'));var authService=require(_0xd3c7('0x10'));var qs=require(_0xd3c7('0x11'));var as=require(_0xd3c7('0x12'));var hardwareService=require(_0xd3c7('0x13'));var logger=require(_0xd3c7('0x14'))(_0xd3c7('0x15'));var utils=require(_0xd3c7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd3c7('0x17')]=_['defaults'](config['redis'],{'host':_0xd3c7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd3c7('0x17')]));require(_0xd3c7('0x19'))[_0xd3c7('0x1a')](socket);function respondWithStatusCode(_0x5bc669,_0x5db8d5){_0x5db8d5=_0x5db8d5||0xcc;return function(_0x21b075){if(_0x21b075){return _0x5bc669[_0xd3c7('0x1b')](_0x5db8d5);}return _0x5bc669[_0xd3c7('0x1c')](_0x5db8d5)[_0xd3c7('0x1d')]();};}function respondWithResult(_0x37a04,_0x4009d1){_0x4009d1=_0x4009d1||0xc8;return function(_0xfa058e){if(_0xfa058e){return _0x37a04[_0xd3c7('0x1c')](_0x4009d1)['json'](_0xfa058e);}};}function respondWithFilteredResult(_0x26f857,_0x358aef){return function(_0x4166f9){if(_0x4166f9){var _0x4abdfd=typeof _0x358aef[_0xd3c7('0x1e')]===_0xd3c7('0x1f')&&typeof _0x358aef[_0xd3c7('0x20')]===_0xd3c7('0x1f');var _0x573eff=_0x4166f9['count'];var _0x1e65ae=_0x4abdfd?0x0:_0x358aef[_0xd3c7('0x1e')];var _0x2dd8c2=_0x4abdfd?_0x4166f9['count']:_0x358aef[_0xd3c7('0x1e')]+_0x358aef[_0xd3c7('0x20')];var _0x1401a7;if(_0x2dd8c2>=_0x573eff){_0x2dd8c2=_0x573eff;_0x1401a7=0xc8;}else{_0x1401a7=0xce;}_0x26f857[_0xd3c7('0x1c')](_0x1401a7);return _0x26f857[_0xd3c7('0x21')](_0xd3c7('0x22'),_0x1e65ae+'-'+_0x2dd8c2+'/'+_0x573eff)[_0xd3c7('0x23')](_0x4166f9);}return null;};}function patchUpdates(_0x1fd54b){return function(_0x4955fb){try{jsonpatch[_0xd3c7('0x24')](_0x4955fb,_0x1fd54b,!![]);}catch(_0x2eaf74){return BPromise[_0xd3c7('0x25')](_0x2eaf74);}return _0x4955fb[_0xd3c7('0x26')]();};}function saveUpdates(_0x549c3b,_0x3333d7){return function(_0x2570aa){if(_0x2570aa){return _0x2570aa['update'](_0x549c3b)[_0xd3c7('0x27')](function(_0x21b7ce){return _0x21b7ce;});}return null;};}function removeEntity(_0x212508,_0x329a4b){return function(_0x459964){if(_0x459964){return _0x459964['destroy']()[_0xd3c7('0x27')](function(){_0x212508[_0xd3c7('0x1c')](0xcc)[_0xd3c7('0x1d')]();});}};}function handleEntityNotFound(_0x888fb,_0x4df565){return function(_0x1f1420){if(!_0x1f1420){_0x888fb[_0xd3c7('0x1b')](0x194);}return _0x1f1420;};}function handleError(_0x377448,_0x21997d){_0x21997d=_0x21997d||0x1f4;return function(_0x1c3741){logger['error'](_0x1c3741['stack']);if(_0x1c3741['name']){delete _0x1c3741[_0xd3c7('0x28')];}_0x377448[_0xd3c7('0x1c')](_0x21997d)[_0xd3c7('0x29')](_0x1c3741);};}exports[_0xd3c7('0x2a')]=function(_0x32a3ca,_0x3c597b){var _0x385bae={},_0x2ff569={},_0x478bad={'count':0x0,'rows':[]};var _0x117f28=_[_0xd3c7('0x2b')](db[_0xd3c7('0x2c')][_0xd3c7('0x2d')],function(_0x5849c9){return{'name':_0x5849c9['fieldName'],'type':_0x5849c9[_0xd3c7('0x2e')][_0xd3c7('0x2f')]};});_0x2ff569[_0xd3c7('0x30')]=_[_0xd3c7('0x2b')](_0x117f28,_0xd3c7('0x28'));_0x2ff569['query']=_[_0xd3c7('0x31')](_0x32a3ca[_0xd3c7('0x32')]);_0x2ff569[_0xd3c7('0x33')]=_[_0xd3c7('0x34')](_0x2ff569['model'],_0x2ff569[_0xd3c7('0x32')]);_0x385bae[_0xd3c7('0x35')]=_[_0xd3c7('0x34')](_0x2ff569[_0xd3c7('0x30')],qs[_0xd3c7('0x36')](_0x32a3ca['query']['fields']));_0x385bae['attributes']=_0x385bae['attributes'][_0xd3c7('0x37')]?_0x385bae[_0xd3c7('0x35')]:_0x2ff569[_0xd3c7('0x30')];if(!_0x32a3ca[_0xd3c7('0x32')][_0xd3c7('0x38')](_0xd3c7('0x39'))){_0x385bae[_0xd3c7('0x20')]=qs['limit'](_0x32a3ca[_0xd3c7('0x32')]['limit']);_0x385bae[_0xd3c7('0x1e')]=qs[_0xd3c7('0x1e')](_0x32a3ca['query'][_0xd3c7('0x1e')]);}_0x385bae[_0xd3c7('0x3a')]=qs[_0xd3c7('0x3b')](_0x32a3ca[_0xd3c7('0x32')][_0xd3c7('0x3b')]);_0x385bae[_0xd3c7('0x3c')]=qs['filters'](_[_0xd3c7('0x3d')](_0x32a3ca[_0xd3c7('0x32')],_0x2ff569[_0xd3c7('0x33')]),_0x117f28);if(_0x32a3ca[_0xd3c7('0x32')]['filter']){_0x385bae[_0xd3c7('0x3c')]=_[_0xd3c7('0x3e')](_0x385bae[_0xd3c7('0x3c')],{'$or':_[_0xd3c7('0x2b')](_0x117f28,function(_0x15dad6){if(_0x15dad6[_0xd3c7('0x2e')]!=='VIRTUAL'){var _0x2712a1={};_0x2712a1[_0x15dad6[_0xd3c7('0x28')]]={'$like':'%'+_0x32a3ca[_0xd3c7('0x32')][_0xd3c7('0x3f')]+'%'};return _0x2712a1;}})});}_0x385bae=_[_0xd3c7('0x3e')]({},_0x385bae,_0x32a3ca['options']);var _0x57204b={'where':_0x385bae[_0xd3c7('0x3c')]};return db[_0xd3c7('0x2c')][_0xd3c7('0x40')](_0x57204b)[_0xd3c7('0x27')](function(_0x496d7e){_0x478bad['count']=_0x496d7e;if(_0x32a3ca[_0xd3c7('0x32')][_0xd3c7('0x41')]){_0x385bae['include']=[{'all':!![]}];}return db[_0xd3c7('0x2c')][_0xd3c7('0x42')](_0x385bae);})['then'](function(_0x37e74b){_0x478bad[_0xd3c7('0x43')]=_0x37e74b;return _0x478bad;})['then'](respondWithFilteredResult(_0x3c597b,_0x385bae))[_0xd3c7('0x44')](handleError(_0x3c597b,null));};exports[_0xd3c7('0x45')]=function(_0x259416,_0x404033){var _0x36962f={'raw':![],'where':{'id':_0x259416[_0xd3c7('0x46')]['id']}},_0x569b95={};_0x569b95[_0xd3c7('0x30')]=_[_0xd3c7('0x31')](db[_0xd3c7('0x2c')]['rawAttributes']);_0x569b95[_0xd3c7('0x32')]=_[_0xd3c7('0x31')](_0x259416['query']);_0x569b95[_0xd3c7('0x33')]=_[_0xd3c7('0x34')](_0x569b95[_0xd3c7('0x30')],_0x569b95['query']);_0x36962f['attributes']=_['intersection'](_0x569b95[_0xd3c7('0x30')],qs[_0xd3c7('0x36')](_0x259416[_0xd3c7('0x32')]['fields']));_0x36962f[_0xd3c7('0x35')]=_0x36962f['attributes'][_0xd3c7('0x37')]?_0x36962f[_0xd3c7('0x35')]:_0x569b95['model'];if(_0x259416[_0xd3c7('0x32')][_0xd3c7('0x41')]){_0x36962f['include']=[{'all':!![]}];}_0x36962f=_['merge']({},_0x36962f,_0x259416[_0xd3c7('0x47')]);return db['VoiceQueueReport'][_0xd3c7('0x48')](_0x36962f)[_0xd3c7('0x27')](handleEntityNotFound(_0x404033,null))['then'](respondWithResult(_0x404033,null))[_0xd3c7('0x44')](handleError(_0x404033,null));};exports['create']=function(_0x4064f2,_0x452343){return db[_0xd3c7('0x2c')][_0xd3c7('0x49')](_0x4064f2[_0xd3c7('0x4a')],{})[_0xd3c7('0x27')](respondWithResult(_0x452343,0xc9))[_0xd3c7('0x44')](handleError(_0x452343,null));};exports[_0xd3c7('0x4b')]=function(_0x22d0db,_0x3a5069){if(_0x22d0db[_0xd3c7('0x4a')]['id']){delete _0x22d0db[_0xd3c7('0x4a')]['id'];}return db[_0xd3c7('0x2c')][_0xd3c7('0x48')]({'where':{'id':_0x22d0db['params']['id']}})[_0xd3c7('0x27')](handleEntityNotFound(_0x3a5069,null))['then'](saveUpdates(_0x22d0db[_0xd3c7('0x4a')],null))['then'](respondWithResult(_0x3a5069,null))[_0xd3c7('0x44')](handleError(_0x3a5069,null));};exports['destroy']=function(_0x5c377c,_0xf2440d){return db[_0xd3c7('0x2c')][_0xd3c7('0x48')]({'where':{'id':_0x5c377c[_0xd3c7('0x46')]['id']}})['then'](handleEntityNotFound(_0xf2440d,null))[_0xd3c7('0x27')](removeEntity(_0xf2440d,null))[_0xd3c7('0x44')](handleError(_0xf2440d,null));};exports['describe']=function(_0x41fb56,_0x41d7b8){return db['VoiceQueueReport'][_0xd3c7('0x4c')]()[_0xd3c7('0x27')](respondWithResult(_0x41d7b8,null))[_0xd3c7('0x44')](handleError(_0x41d7b8,null));};exports[_0xd3c7('0x4d')]=function(_0x3121fa,_0x30755a){var _0xc7fb34={},_0x27d276={},_0xb3b274={'count':0x0,'rows':[]};_0x27d276[_0xd3c7('0x30')]=_['keys'](db[_0xd3c7('0x2c')][_0xd3c7('0x2d')]);_0x27d276[_0xd3c7('0x32')]=_['keys'](_0x3121fa[_0xd3c7('0x32')]);_0x27d276[_0xd3c7('0x33')]=_[_0xd3c7('0x34')](_0x27d276[_0xd3c7('0x30')],_0x27d276[_0xd3c7('0x32')]);_0xc7fb34[_0xd3c7('0x35')]=_[_0xd3c7('0x34')](_0x27d276[_0xd3c7('0x30')],qs[_0xd3c7('0x36')](_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x36')]));_0xc7fb34['attributes']=_0xc7fb34[_0xd3c7('0x35')][_0xd3c7('0x37')]?_0xc7fb34[_0xd3c7('0x35')]:_0x27d276[_0xd3c7('0x30')];if(!_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x38')](_0xd3c7('0x39'))){_0xc7fb34['limit']=qs[_0xd3c7('0x20')](_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x20')]);_0xc7fb34[_0xd3c7('0x1e')]=qs['offset'](_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x1e')]);}_0xc7fb34[_0xd3c7('0x3a')]=qs[_0xd3c7('0x3b')](_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x3b')]);_0xc7fb34[_0xd3c7('0x3c')]=qs[_0xd3c7('0x33')](_['pick'](_0x3121fa[_0xd3c7('0x32')],_0x27d276[_0xd3c7('0x33')]));if(_0x3121fa['query'][_0xd3c7('0x3f')]){_0xc7fb34[_0xd3c7('0x3c')]=_[_0xd3c7('0x3e')](_0xc7fb34['where'],{'$or':_['map'](_0xc7fb34[_0xd3c7('0x35')],function(_0xff3df0){var _0x57103b={};_0x57103b[_0xff3df0]={'$like':'%'+_0x3121fa[_0xd3c7('0x32')]['filter']+'%'};return _0x57103b;})});}_0xc7fb34=_[_0xd3c7('0x3e')]({},_0xc7fb34,_0x3121fa[_0xd3c7('0x47')]);var _0x273a1d={'where':_0xc7fb34[_0xd3c7('0x3c')]};return db[_0xd3c7('0x2c')][_0xd3c7('0x40')](_0x273a1d)[_0xd3c7('0x27')](function(_0x43231b){_0xb3b274[_0xd3c7('0x40')]=_0x43231b;if(_0x3121fa[_0xd3c7('0x32')][_0xd3c7('0x41')]){_0xc7fb34[_0xd3c7('0x4e')]=[{'all':!![]}];}return db[_0xd3c7('0x2c')][_0xd3c7('0x42')](_0xc7fb34);})['then'](function(_0x1144ae){_0xb3b274['rows']=_0x1144ae;return _0xb3b274;})['then'](respondWithFilteredResult(_0x30755a,_0xc7fb34,_0xd3c7('0x4d')))[_0xd3c7('0x44')](handleError(_0x30755a,null,_0xd3c7('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index fcb4085..c323bdb 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 _0x9a10=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x9a10,0x11e));var _0x09a1=function(_0x1dbb99,_0x24a0db){_0x1dbb99=_0x1dbb99-0x0;var _0x557b00=_0x9a10[_0x1dbb99];return _0x557b00;};'use strict';var EventEmitter=require(_0x09a1('0x0'));var VoiceQueueReport=require(_0x09a1('0x1'))['db'][_0x09a1('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x09a1('0x3')](0x0);var events={'afterCreate':_0x09a1('0x4'),'afterUpdate':_0x09a1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a1971){return function(_0x19b348,_0x5b8dff,_0x3c0c88){VoiceQueueReportEvents['emit'](_0x1a1971+':'+_0x19b348['id'],_0x19b348);VoiceQueueReportEvents[_0x09a1('0x6')](_0x1a1971,_0x19b348);_0x3c0c88(null);};}for(var e in events){if(events[_0x09a1('0x7')](e)){var event=events[e];VoiceQueueReport[_0x09a1('0x8')](e,emitEvent(event));}}module[_0x09a1('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x357d=['save','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4c8333,_0x3e403a){var _0x8be4d5=function(_0x5ce46e){while(--_0x5ce46e){_0x4c8333['push'](_0x4c8333['shift']());}};_0x8be4d5(++_0x3e403a);}(_0x357d,0x17a));var _0xd357=function(_0x21a480,_0x3644fe){_0x21a480=_0x21a480-0x0;var _0x3965bd=_0x357d[_0x21a480];return _0x3965bd;};'use strict';var EventEmitter=require(_0xd357('0x0'));var VoiceQueueReport=require(_0xd357('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd357('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d1127){return function(_0x47467,_0x1f4bf4,_0xdf0096){VoiceQueueReportEvents[_0xd357('0x3')](_0x2d1127+':'+_0x47467['id'],_0x47467);VoiceQueueReportEvents['emit'](_0x2d1127,_0x47467);_0xdf0096(null);};}for(var e in events){if(events[_0xd357('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index f896103..91616dd 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 _0x39be=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x39be,0xed));var _0xe39b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39be[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var logger=require(_0xe39b('0x2'))('api');var moment=require(_0xe39b('0x3'));var BPromise=require(_0xe39b('0x4'));var rp=require(_0xe39b('0x5'));var fs=require('fs');var path=require(_0xe39b('0x6'));var rimraf=require('rimraf');var config=require(_0xe39b('0x7'));var attributes=require(_0xe39b('0x8'));module[_0xe39b('0x9')]=function(_0x367dd1,_0x2879ed){return _0x367dd1['define'](_0xe39b('0xa'),attributes,{'tableName':_0xe39b('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe39b('0xc')]},{'fields':[_0xe39b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x989d=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2115dc,_0x47bbdb){var _0x37d0ba=function(_0x53af13){while(--_0x53af13){_0x2115dc['push'](_0x2115dc['shift']());}};_0x37d0ba(++_0x47bbdb);}(_0x989d,0x159));var _0xd989=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x989d[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xd989('0x0'));var util=require(_0xd989('0x1'));var logger=require(_0xd989('0x2'))('api');var moment=require(_0xd989('0x3'));var BPromise=require(_0xd989('0x4'));var rp=require(_0xd989('0x5'));var fs=require('fs');var path=require(_0xd989('0x6'));var rimraf=require(_0xd989('0x7'));var config=require(_0xd989('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0xd989('0x9')]=function(_0x472a4d,_0x3b322d){return _0x472a4d[_0xd989('0xa')](_0xd989('0xb'),attributes,{'tableName':_0xd989('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xd989('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 0766710..5dae047 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 _0x880c=['CreateVoiceQueueReport','UpdateVoiceQueueReport','VoiceQueueReport','update','body','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceQueueReport','findAll','options','raw','attributes','map','include','model'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x880c,0x8e));var _0xc880=function(_0x457481,_0x9f8bae){_0x457481=_0x457481-0x0;var _0x256915=_0x880c[_0x457481];return _0x256915;};'use strict';var _=require(_0xc880('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc880('0x1'));var rs=require(_0xc880('0x2'));var fs=require('fs');var Redis=require(_0xc880('0x3'));var db=require(_0xc880('0x4'))['db'];var utils=require(_0xc880('0x5'));var logger=require('../../config/logger')(_0xc880('0x6'));var config=require(_0xc880('0x7'));var jayson=require(_0xc880('0x8'));var client=jayson[_0xc880('0x9')][_0xc880('0xa')]({'port':0x232a});config[_0xc880('0xb')]=_[_0xc880('0xc')](config['redis'],{'host':_0xc880('0xd'),'port':0x18eb});var socket=require(_0xc880('0xe'))(new Redis(config[_0xc880('0xb')]));require(_0xc880('0xf'))[_0xc880('0x10')](socket);function respondWithRpcPromise(_0x28237a,_0x19790b,_0x369b98){return new BPromise(function(_0x45a9b0,_0x100a89){return client[_0xc880('0x11')](_0x28237a,_0x369b98)[_0xc880('0x12')](function(_0xce0dc){logger[_0xc880('0x13')](_0xc880('0x14'),_0x19790b,_0xc880('0x15'));logger[_0xc880('0x16')](_0xc880('0x17'),_0x19790b,_0xc880('0x15'),JSON[_0xc880('0x18')](_0xce0dc));if(_0xce0dc['error']){if(_0xce0dc['error'][_0xc880('0x19')]===0x1f4){logger[_0xc880('0x1a')](_0xc880('0x14'),_0x19790b,_0xce0dc[_0xc880('0x1a')]['message']);return _0x100a89(_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);}logger['error'](_0xc880('0x14'),_0x19790b,_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);return _0x45a9b0(_0xce0dc[_0xc880('0x1a')][_0xc880('0x1b')]);}else{logger['info'](_0xc880('0x14'),_0x19790b,_0xc880('0x15'));_0x45a9b0(_0xce0dc[_0xc880('0x1c')][_0xc880('0x1b')]);}})[_0xc880('0x1d')](function(_0x47ff71){logger['error'](_0xc880('0x14'),_0x19790b,_0x47ff71);_0x100a89(_0x47ff71);});});}exports[_0xc880('0x1e')]=function(_0x43ccf0){var _0x56553e=this;return new Promise(function(_0x2f5f1c,_0x18f763){return db['VoiceQueueReport'][_0xc880('0x1f')]({'raw':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0['options'][_0xc880('0x21')]===undefined?!![]:![]:!![],'where':_0x43ccf0['options']?_0x43ccf0[_0xc880('0x20')]['where']||null:null,'attributes':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0['options'][_0xc880('0x22')]||null:null,'limit':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0[_0xc880('0x20')]['limit']||null:null,'include':_0x43ccf0[_0xc880('0x20')]?_0x43ccf0[_0xc880('0x20')]['include']?_[_0xc880('0x23')](_0x43ccf0['options'][_0xc880('0x24')],function(_0x59d58e){return{'model':db[_0x59d58e[_0xc880('0x25')]],'as':_0x59d58e['as'],'attributes':_0x59d58e['attributes'],'include':_0x59d58e[_0xc880('0x24')]?_[_0xc880('0x23')](_0x59d58e['include'],function(_0x12b857){return{'model':db[_0x12b857[_0xc880('0x25')]],'as':_0x12b857['as'],'attributes':_0x12b857[_0xc880('0x22')],'include':_0x12b857['include']?_[_0xc880('0x23')](_0x12b857[_0xc880('0x24')],function(_0x47700c){return{'model':db[_0x47700c['model']],'as':_0x47700c['as'],'attributes':_0x47700c[_0xc880('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc880('0x12')](function(_0x5a954a){logger[_0xc880('0x13')](_0xc880('0x1e'),_0x43ccf0);logger['debug'](_0xc880('0x1e'),_0x43ccf0,JSON[_0xc880('0x18')](_0x5a954a));_0x2f5f1c(_0x5a954a);})[_0xc880('0x1d')](function(_0xef39be){logger[_0xc880('0x1a')](_0xc880('0x1e'),_0xef39be['message'],_0x43ccf0);_0x18f763(_0x56553e[_0xc880('0x1a')](0x1f4,_0xef39be[_0xc880('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0x38de50){var _0x5ef30b=this;return new Promise(function(_0x469b28,_0x300666){return db['VoiceQueueReport']['create'](_0x38de50['body'],{'raw':_0x38de50[_0xc880('0x20')]?_0x38de50[_0xc880('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xc880('0x12')](function(_0x570c79){logger[_0xc880('0x13')](_0xc880('0x26'),_0x38de50);logger[_0xc880('0x16')](_0xc880('0x26'),_0x38de50,JSON[_0xc880('0x18')](_0x570c79));_0x469b28(_0x570c79);})[_0xc880('0x1d')](function(_0x44104a){logger['error'](_0xc880('0x26'),_0x44104a['message'],_0x38de50);_0x300666(_0x5ef30b[_0xc880('0x1a')](0x1f4,_0x44104a[_0xc880('0x1b')]));});});};exports[_0xc880('0x27')]=function(_0x30666b){var _0x590dcd=this;return new Promise(function(_0x1abe13,_0x4bfcc4){return db[_0xc880('0x28')][_0xc880('0x29')](_0x30666b[_0xc880('0x2a')],{'raw':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x2b')]||null:null,'attributes':_0x30666b['options']?_0x30666b[_0xc880('0x20')][_0xc880('0x22')]||null:null,'limit':_0x30666b[_0xc880('0x20')]?_0x30666b[_0xc880('0x20')][_0xc880('0x2c')]||null:null})[_0xc880('0x12')](function(_0x567c9d){logger['info'](_0xc880('0x27'),_0x30666b);logger[_0xc880('0x16')](_0xc880('0x27'),_0x30666b,JSON[_0xc880('0x18')](_0x567c9d));_0x1abe13(_0x567c9d);})[_0xc880('0x1d')](function(_0x338be0){logger[_0xc880('0x1a')](_0xc880('0x27'),_0x338be0[_0xc880('0x1b')],_0x30666b);_0x4bfcc4(_0x590dcd[_0xc880('0x1a')](0x1f4,_0x338be0[_0xc880('0x1b')]));});});}; \ No newline at end of file +var _0xb66a=['register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceQueueReport','raw','options','where','include','map','model','attributes','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x49f3fc,_0x251720){var _0x176940=function(_0x4e2246){while(--_0x4e2246){_0x49f3fc['push'](_0x49f3fc['shift']());}};_0x176940(++_0x251720);}(_0xb66a,0x12a));var _0xab66=function(_0x547f11,_0x401c5a){_0x547f11=_0x547f11-0x0;var _0x169e4c=_0xb66a[_0x547f11];return _0x169e4c;};'use strict';var _=require(_0xab66('0x0'));var util=require(_0xab66('0x1'));var moment=require(_0xab66('0x2'));var BPromise=require(_0xab66('0x3'));var rs=require(_0xab66('0x4'));var fs=require('fs');var Redis=require(_0xab66('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab66('0x6'));var logger=require(_0xab66('0x7'))(_0xab66('0x8'));var config=require(_0xab66('0x9'));var jayson=require(_0xab66('0xa'));var client=jayson[_0xab66('0xb')][_0xab66('0xc')]({'port':0x232a});config[_0xab66('0xd')]=_[_0xab66('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xab66('0xf'))(new Redis(config[_0xab66('0xd')]));require(_0xab66('0x10'))[_0xab66('0x11')](socket);function respondWithRpcPromise(_0x2c5304,_0x40de8a,_0x512328){return new BPromise(function(_0x3b2ba0,_0x5ac9a3){return client[_0xab66('0x12')](_0x2c5304,_0x512328)[_0xab66('0x13')](function(_0x3a445b){logger[_0xab66('0x14')](_0xab66('0x15'),_0x40de8a,_0xab66('0x16'));logger[_0xab66('0x17')](_0xab66('0x18'),_0x40de8a,_0xab66('0x16'),JSON['stringify'](_0x3a445b));if(_0x3a445b[_0xab66('0x19')]){if(_0x3a445b['error']['code']===0x1f4){logger['error'](_0xab66('0x15'),_0x40de8a,_0x3a445b[_0xab66('0x19')][_0xab66('0x1a')]);return _0x5ac9a3(_0x3a445b[_0xab66('0x19')]['message']);}logger[_0xab66('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x40de8a,_0x3a445b[_0xab66('0x19')][_0xab66('0x1a')]);return _0x3b2ba0(_0x3a445b['error']['message']);}else{logger[_0xab66('0x14')](_0xab66('0x15'),_0x40de8a,_0xab66('0x16'));_0x3b2ba0(_0x3a445b[_0xab66('0x1b')][_0xab66('0x1a')]);}})[_0xab66('0x1c')](function(_0x1e357b){logger[_0xab66('0x19')](_0xab66('0x15'),_0x40de8a,_0x1e357b);_0x5ac9a3(_0x1e357b);});});}exports['GetVoiceQueueReport']=function(_0x3d4121){var _0x530db7=this;return new Promise(function(_0x4e0ca6,_0x271538){return db[_0xab66('0x1d')]['findAll']({'raw':_0x3d4121['options']?_0x3d4121['options'][_0xab66('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d4121[_0xab66('0x1f')]?_0x3d4121[_0xab66('0x1f')][_0xab66('0x20')]||null:null,'attributes':_0x3d4121['options']?_0x3d4121[_0xab66('0x1f')]['attributes']||null:null,'limit':_0x3d4121[_0xab66('0x1f')]?_0x3d4121[_0xab66('0x1f')]['limit']||null:null,'include':_0x3d4121[_0xab66('0x1f')]?_0x3d4121[_0xab66('0x1f')][_0xab66('0x21')]?_[_0xab66('0x22')](_0x3d4121['options'][_0xab66('0x21')],function(_0x41ad10){return{'model':db[_0x41ad10[_0xab66('0x23')]],'as':_0x41ad10['as'],'attributes':_0x41ad10[_0xab66('0x24')],'include':_0x41ad10['include']?_[_0xab66('0x22')](_0x41ad10['include'],function(_0x5ce7f8){return{'model':db[_0x5ce7f8['model']],'as':_0x5ce7f8['as'],'attributes':_0x5ce7f8[_0xab66('0x24')],'include':_0x5ce7f8[_0xab66('0x21')]?_['map'](_0x5ce7f8[_0xab66('0x21')],function(_0x12dbe3){return{'model':db[_0x12dbe3[_0xab66('0x23')]],'as':_0x12dbe3['as'],'attributes':_0x12dbe3[_0xab66('0x24')]};}):[]};}):[]};}):[]:[]})[_0xab66('0x13')](function(_0x52db3f){logger[_0xab66('0x14')](_0xab66('0x25'),_0x3d4121);logger['debug'](_0xab66('0x25'),_0x3d4121,JSON[_0xab66('0x26')](_0x52db3f));_0x4e0ca6(_0x52db3f);})['catch'](function(_0x43d467){logger[_0xab66('0x19')](_0xab66('0x25'),_0x43d467['message'],_0x3d4121);_0x271538(_0x530db7[_0xab66('0x19')](0x1f4,_0x43d467[_0xab66('0x1a')]));});});};exports[_0xab66('0x27')]=function(_0x11969c){var _0xecfdc=this;return new Promise(function(_0xa829bf,_0x1a7e11){return db[_0xab66('0x1d')][_0xab66('0x28')](_0x11969c['body'],{'raw':_0x11969c[_0xab66('0x1f')]?_0x11969c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x41460){logger[_0xab66('0x14')](_0xab66('0x27'),_0x11969c);logger[_0xab66('0x17')](_0xab66('0x27'),_0x11969c,JSON[_0xab66('0x26')](_0x41460));_0xa829bf(_0x41460);})[_0xab66('0x1c')](function(_0x3a82b2){logger['error'](_0xab66('0x27'),_0x3a82b2['message'],_0x11969c);_0x1a7e11(_0xecfdc[_0xab66('0x19')](0x1f4,_0x3a82b2['message']));});});};exports[_0xab66('0x29')]=function(_0x48eab3){var _0x5a13f1=this;return new Promise(function(_0x17a5d1,_0x134290){return db['VoiceQueueReport'][_0xab66('0x2a')](_0x48eab3[_0xab66('0x2b')],{'raw':_0x48eab3['options']?_0x48eab3[_0xab66('0x1f')][_0xab66('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48eab3[_0xab66('0x1f')]?_0x48eab3[_0xab66('0x1f')]['where']||null:null,'attributes':_0x48eab3[_0xab66('0x1f')]?_0x48eab3['options'][_0xab66('0x24')]||null:null,'limit':_0x48eab3[_0xab66('0x1f')]?_0x48eab3['options'][_0xab66('0x2c')]||null:null})[_0xab66('0x13')](function(_0x210496){logger['info'](_0xab66('0x29'),_0x48eab3);logger[_0xab66('0x17')](_0xab66('0x29'),_0x48eab3,JSON['stringify'](_0x210496));_0x17a5d1(_0x210496);})[_0xab66('0x1c')](function(_0x30e289){logger['error'](_0xab66('0x29'),_0x30e289[_0xab66('0x1a')],_0x48eab3);_0x134290(_0x5a13f1[_0xab66('0x19')](0x1f4,_0x30e289[_0xab66('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e4bcc80..ecba0e4 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 _0x75a2=['length','./voiceQueueReport.events','save','remove','emit'];(function(_0x2de99c,_0x523210){var _0x3a1968=function(_0x12b0d7){while(--_0x12b0d7){_0x2de99c['push'](_0x2de99c['shift']());}};_0x3a1968(++_0x523210);}(_0x75a2,0x187));var _0x275a=function(_0x34d59e,_0x350418){_0x34d59e=_0x34d59e-0x0;var _0x954a8c=_0x75a2[_0x34d59e];return _0x954a8c;};'use strict';var VoiceQueueReportEvents=require(_0x275a('0x0'));var events=[_0x275a('0x1'),_0x275a('0x2'),'update'];function createListener(_0x2221c5,_0x116ea8){return function(_0x339ace){_0x116ea8[_0x275a('0x3')](_0x2221c5,_0x339ace);};}function removeListener(_0x5019d2,_0x251db9){return function(){VoiceQueueReportEvents['removeListener'](_0x5019d2,_0x251db9);};}exports['register']=function(_0x4ab56d){for(var _0x5ecd7b=0x0,_0x32f0cb=events[_0x275a('0x4')];_0x5ecd7b<_0x32f0cb;_0x5ecd7b++){var _0x17ad5e=events[_0x5ecd7b];var _0x38b303=createListener('voiceQueueReport:'+_0x17ad5e,_0x4ab56d);VoiceQueueReportEvents['on'](_0x17ad5e,_0x38b303);}}; \ No newline at end of file +var _0x5243=['update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x283026,_0x45a077){var _0x40487b=function(_0x254ce8){while(--_0x254ce8){_0x283026['push'](_0x283026['shift']());}};_0x40487b(++_0x45a077);}(_0x5243,0x71));var _0x3524=function(_0x131744,_0xc0e0ac){_0x131744=_0x131744-0x0;var _0x2d379f=_0x5243[_0x131744];return _0x2d379f;};'use strict';var VoiceQueueReportEvents=require(_0x3524('0x0'));var events=['save','remove',_0x3524('0x1')];function createListener(_0x14d26d,_0x496f0f){return function(_0x5449cf){_0x496f0f[_0x3524('0x2')](_0x14d26d,_0x5449cf);};}function removeListener(_0x34bba7,_0x4855ea){return function(){VoiceQueueReportEvents[_0x3524('0x3')](_0x34bba7,_0x4855ea);};}exports['register']=function(_0x2d8995){for(var _0x564239=0x0,_0x375729=events[_0x3524('0x4')];_0x564239<_0x375729;_0x564239++){var _0x1e9bf9=events[_0x564239];var _0x371171=createListener(_0x3524('0x5')+_0x1e9bf9,_0x2d8995);VoiceQueueReportEvents['on'](_0x1e9bf9,_0x371171);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 60a2cc5..b3dcb83 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 _0xfa24=['Router','fs-extra','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','post','create','update','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x404604,_0xd09610){var _0x1971b0=function(_0x4b704b){while(--_0x4b704b){_0x404604['push'](_0x404604['shift']());}};_0x1971b0(++_0xd09610);}(_0xfa24,0x17c));var _0x4fa2=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0xfa24[_0x483102];return _0x5cc885;};'use strict';var multer=require(_0x4fa2('0x0'));var util=require(_0x4fa2('0x1'));var path=require(_0x4fa2('0x2'));var timeout=require(_0x4fa2('0x3'));var express=require('express');var router=express[_0x4fa2('0x4')]();var fs_extra=require(_0x4fa2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4fa2('0x6'));var controller=require(_0x4fa2('0x7'));router['get']('/',auth[_0x4fa2('0x8')](),controller[_0x4fa2('0x9')]);router['get']('/:id',auth[_0x4fa2('0x8')](),controller['show']);router[_0x4fa2('0xa')]('/',auth[_0x4fa2('0x8')](),controller[_0x4fa2('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4fa2('0xc')]);router['delete'](_0x4fa2('0xd'),auth[_0x4fa2('0x8')](),controller[_0x4fa2('0xe')]);module[_0x4fa2('0xf')]=router; \ No newline at end of file +var _0x724f=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','show','post'];(function(_0x34d326,_0x43d183){var _0x48e348=function(_0x172d0b){while(--_0x172d0b){_0x34d326['push'](_0x34d326['shift']());}};_0x48e348(++_0x43d183);}(_0x724f,0x1ea));var _0xf724=function(_0x55eec8,_0x3957c3){_0x55eec8=_0x55eec8-0x0;var _0x4a6325=_0x724f[_0x55eec8];return _0x4a6325;};'use strict';var multer=require(_0xf724('0x0'));var util=require(_0xf724('0x1'));var path=require(_0xf724('0x2'));var timeout=require(_0xf724('0x3'));var express=require(_0xf724('0x4'));var router=express[_0xf724('0x5')]();var fs_extra=require(_0xf724('0x6'));var auth=require(_0xf724('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf724('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf724('0x9')]);router['get'](_0xf724('0xa'),auth[_0xf724('0xb')](),controller[_0xf724('0xc')]);router[_0xf724('0xd')]('/',auth[_0xf724('0xb')](),controller[_0xf724('0xe')]);router[_0xf724('0xf')](_0xf724('0xa'),auth[_0xf724('0xb')](),controller[_0xf724('0x10')]);router['delete'](_0xf724('0xa'),auth['isAuthenticated'](),controller[_0xf724('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 76bf323..77a3ebc 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 _0x0bf3=['sequelize','moment','STRING','DATE'];(function(_0x1887f5,_0xca3351){var _0x88684c=function(_0x19b78c){while(--_0x19b78c){_0x1887f5['push'](_0x1887f5['shift']());}};_0x88684c(++_0xca3351);}(_0x0bf3,0x1c8));var _0x30bf=function(_0x15a05a,_0x454528){_0x15a05a=_0x15a05a-0x0;var _0x47fb02=_0x0bf3[_0x15a05a];return _0x47fb02;};'use strict';var Sequelize=require(_0x30bf('0x0'));var moment=require(_0x30bf('0x1'));module['exports']={'time':{'type':Sequelize[_0x30bf('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x30bf('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x30bf('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x6837=['exports','STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x2a6d00,_0x364efc){var _0x1292ce=function(_0xc00836){while(--_0xc00836){_0x2a6d00['push'](_0x2a6d00['shift']());}};_0x1292ce(++_0x364efc);}(_0x6837,0xac));var _0x7683=function(_0x1656ca,_0x546cf2){_0x1656ca=_0x1656ca-0x0;var _0xf2759=_0x6837[_0x1656ca];return _0xf2759;};'use strict';var Sequelize=require(_0x7683('0x0'));var moment=require(_0x7683('0x1'));module[_0x7683('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7683('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7683('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x7683('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e37ceb7..ff467ee 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 _0x1245=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','length','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1245,0x89));var _0x5124=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1245[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5124('0x1'));var jsonpatch=require(_0x5124('0x2'));var rp=require(_0x5124('0x3'));var moment=require(_0x5124('0x4'));var BPromise=require(_0x5124('0x5'));var Mustache=require(_0x5124('0x6'));var util=require(_0x5124('0x7'));var path=require(_0x5124('0x8'));var sox=require(_0x5124('0x9'));var csv=require(_0x5124('0xa'));var ejs=require(_0x5124('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5124('0xc'));var jsforce=require(_0x5124('0xd'));var deskjs=require(_0x5124('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5124('0xf'));var Papa=require('papaparse');var Redis=require(_0x5124('0x10'));var authService=require(_0x5124('0x11'));var qs=require(_0x5124('0x12'));var as=require(_0x5124('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5124('0x14'))(_0x5124('0x15'));var utils=require(_0x5124('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5124('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45fcbf,_0x3d4393){_0x3d4393=_0x3d4393||0xcc;return function(_0x4bdace){if(_0x4bdace){return _0x45fcbf['sendStatus'](_0x3d4393);}return _0x45fcbf[_0x5124('0x18')](_0x3d4393)[_0x5124('0x19')]();};}function respondWithResult(_0x4ce4ee,_0xdf91e5){_0xdf91e5=_0xdf91e5||0xc8;return function(_0x42ef76){if(_0x42ef76){return _0x4ce4ee['status'](_0xdf91e5)[_0x5124('0x1a')](_0x42ef76);}};}function respondWithFilteredResult(_0x49665a,_0x4da581){return function(_0x52196a){if(_0x52196a){var _0x1a6536=typeof _0x4da581[_0x5124('0x1b')]===_0x5124('0x1c')&&typeof _0x4da581[_0x5124('0x1d')]==='undefined';var _0x3c6b3c=_0x52196a[_0x5124('0x1e')];var _0x37f24c=_0x1a6536?0x0:_0x4da581['offset'];var _0x40c990=_0x1a6536?_0x52196a[_0x5124('0x1e')]:_0x4da581[_0x5124('0x1b')]+_0x4da581['limit'];var _0x16207f;if(_0x40c990>=_0x3c6b3c){_0x40c990=_0x3c6b3c;_0x16207f=0xc8;}else{_0x16207f=0xce;}_0x49665a[_0x5124('0x18')](_0x16207f);return _0x49665a['set']('Content-Range',_0x37f24c+'-'+_0x40c990+'/'+_0x3c6b3c)[_0x5124('0x1a')](_0x52196a);}return null;};}function patchUpdates(_0x5c9547){return function(_0x2b2844){try{jsonpatch[_0x5124('0x1f')](_0x2b2844,_0x5c9547,!![]);}catch(_0x1cbca1){return BPromise[_0x5124('0x20')](_0x1cbca1);}return _0x2b2844[_0x5124('0x21')]();};}function saveUpdates(_0x3e199e,_0x2f9417){return function(_0x30203e){if(_0x30203e){return _0x30203e[_0x5124('0x22')](_0x3e199e)[_0x5124('0x23')](function(_0xab57eb){return _0xab57eb;});}return null;};}function removeEntity(_0x34ce62,_0x2c8da7){return function(_0x402a54){if(_0x402a54){return _0x402a54[_0x5124('0x24')]()['then'](function(){_0x34ce62[_0x5124('0x18')](0xcc)[_0x5124('0x19')]();});}};}function handleEntityNotFound(_0x1158ae,_0x187154){return function(_0x16d72d){if(!_0x16d72d){_0x1158ae['sendStatus'](0x194);}return _0x16d72d;};}function handleError(_0x3ebf9f,_0x22853e){_0x22853e=_0x22853e||0x1f4;return function(_0x54b721){logger['error'](_0x54b721[_0x5124('0x25')]);if(_0x54b721[_0x5124('0x26')]){delete _0x54b721[_0x5124('0x26')];}_0x3ebf9f['status'](_0x22853e)[_0x5124('0x27')](_0x54b721);};}exports[_0x5124('0x28')]=function(_0xcb424e,_0x551023){var _0x6a418b={},_0x29a6ef={},_0x2d0982={'count':0x0,'rows':[]};var _0x437628=_[_0x5124('0x29')](db[_0x5124('0x2a')][_0x5124('0x2b')],function(_0x33d8f7){return{'name':_0x33d8f7[_0x5124('0x2c')],'type':_0x33d8f7[_0x5124('0x2d')]['key']};});_0x29a6ef[_0x5124('0x2e')]=_[_0x5124('0x29')](_0x437628,_0x5124('0x26'));_0x29a6ef[_0x5124('0x2f')]=_[_0x5124('0x30')](_0xcb424e[_0x5124('0x2f')]);_0x29a6ef[_0x5124('0x31')]=_[_0x5124('0x32')](_0x29a6ef[_0x5124('0x2e')],_0x29a6ef[_0x5124('0x2f')]);_0x6a418b[_0x5124('0x33')]=_[_0x5124('0x32')](_0x29a6ef[_0x5124('0x2e')],qs[_0x5124('0x34')](_0xcb424e[_0x5124('0x2f')][_0x5124('0x34')]));_0x6a418b[_0x5124('0x33')]=_0x6a418b['attributes']['length']?_0x6a418b['attributes']:_0x29a6ef[_0x5124('0x2e')];if(!_0xcb424e[_0x5124('0x2f')]['hasOwnProperty']('nolimit')){_0x6a418b[_0x5124('0x1d')]=qs[_0x5124('0x1d')](_0xcb424e['query']['limit']);_0x6a418b['offset']=qs[_0x5124('0x1b')](_0xcb424e[_0x5124('0x2f')][_0x5124('0x1b')]);}_0x6a418b[_0x5124('0x35')]=qs['sort'](_0xcb424e[_0x5124('0x2f')][_0x5124('0x36')]);_0x6a418b['where']=qs[_0x5124('0x31')](_[_0x5124('0x37')](_0xcb424e[_0x5124('0x2f')],_0x29a6ef[_0x5124('0x31')]),_0x437628);if(_0xcb424e[_0x5124('0x2f')][_0x5124('0x38')]){_0x6a418b[_0x5124('0x39')]=_[_0x5124('0x3a')](_0x6a418b[_0x5124('0x39')],{'$or':_[_0x5124('0x29')](_0x437628,function(_0x34b91c){if(_0x34b91c['type']!==_0x5124('0x3b')){var _0x130379={};_0x130379[_0x34b91c[_0x5124('0x26')]]={'$like':'%'+_0xcb424e[_0x5124('0x2f')][_0x5124('0x38')]+'%'};return _0x130379;}})});}_0x6a418b=_['merge']({},_0x6a418b,_0xcb424e['options']);var _0x218bd7={'where':_0x6a418b[_0x5124('0x39')]};return db[_0x5124('0x2a')][_0x5124('0x1e')](_0x218bd7)[_0x5124('0x23')](function(_0x23125d){_0x2d0982[_0x5124('0x1e')]=_0x23125d;if(_0xcb424e[_0x5124('0x2f')][_0x5124('0x3c')]){_0x6a418b[_0x5124('0x3d')]=[{'all':!![]}];}return db[_0x5124('0x2a')][_0x5124('0x3e')](_0x6a418b);})[_0x5124('0x23')](function(_0x427d57){_0x2d0982[_0x5124('0x3f')]=_0x427d57;return _0x2d0982;})['then'](respondWithFilteredResult(_0x551023,_0x6a418b))['catch'](handleError(_0x551023,null));};exports[_0x5124('0x40')]=function(_0x574365,_0x4cdf02){var _0x24d5c8={'raw':!![],'where':{'id':_0x574365['params']['id']}},_0x55cf78={};_0x55cf78[_0x5124('0x2e')]=_[_0x5124('0x30')](db['VoiceQueuesLog'][_0x5124('0x2b')]);_0x55cf78['query']=_[_0x5124('0x30')](_0x574365[_0x5124('0x2f')]);_0x55cf78[_0x5124('0x31')]=_[_0x5124('0x32')](_0x55cf78[_0x5124('0x2e')],_0x55cf78['query']);_0x24d5c8[_0x5124('0x33')]=_[_0x5124('0x32')](_0x55cf78['model'],qs[_0x5124('0x34')](_0x574365[_0x5124('0x2f')][_0x5124('0x34')]));_0x24d5c8[_0x5124('0x33')]=_0x24d5c8[_0x5124('0x33')][_0x5124('0x41')]?_0x24d5c8[_0x5124('0x33')]:_0x55cf78['model'];if(_0x574365[_0x5124('0x2f')][_0x5124('0x3c')]){_0x24d5c8['include']=[{'all':!![]}];}_0x24d5c8=_[_0x5124('0x3a')]({},_0x24d5c8,_0x574365[_0x5124('0x42')]);return db['VoiceQueuesLog'][_0x5124('0x43')](_0x24d5c8)[_0x5124('0x23')](handleEntityNotFound(_0x4cdf02,null))[_0x5124('0x23')](respondWithResult(_0x4cdf02,null))[_0x5124('0x44')](handleError(_0x4cdf02,null));};exports[_0x5124('0x45')]=function(_0x548ef5,_0x40efbd){return db[_0x5124('0x2a')]['create'](_0x548ef5['body'],{})['then'](respondWithResult(_0x40efbd,0xc9))['catch'](handleError(_0x40efbd,null));};exports['update']=function(_0x54c3a9,_0x43eb8c){if(_0x54c3a9[_0x5124('0x46')]['id']){delete _0x54c3a9[_0x5124('0x46')]['id'];}return db[_0x5124('0x2a')]['find']({'where':{'id':_0x54c3a9['params']['id']}})[_0x5124('0x23')](handleEntityNotFound(_0x43eb8c,null))['then'](saveUpdates(_0x54c3a9[_0x5124('0x46')],null))[_0x5124('0x23')](respondWithResult(_0x43eb8c,null))['catch'](handleError(_0x43eb8c,null));};exports['destroy']=function(_0x4b063c,_0x4f73e7){return db[_0x5124('0x2a')][_0x5124('0x43')]({'where':{'id':_0x4b063c[_0x5124('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f73e7,null))[_0x5124('0x23')](removeEntity(_0x4f73e7,null))['catch'](handleError(_0x4f73e7,null));}; \ No newline at end of file +var _0xa418=['index','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0xa7228,_0x437876){var _0x273d85=function(_0x145d86){while(--_0x145d86){_0xa7228['push'](_0xa7228['shift']());}};_0x273d85(++_0x437876);}(_0xa418,0x1d0));var _0x8a41=function(_0x32cfaf,_0x42db30){_0x32cfaf=_0x32cfaf-0x0;var _0x3b1055=_0xa418[_0x32cfaf];return _0x3b1055;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a41('0x0'));var zipdir=require(_0x8a41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a41('0x2'));var moment=require(_0x8a41('0x3'));var BPromise=require(_0x8a41('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8a41('0x5'));var sox=require('sox');var csv=require(_0x8a41('0x6'));var ejs=require(_0x8a41('0x7'));var fs=require('fs');var fs_extra=require(_0x8a41('0x8'));var _=require(_0x8a41('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a41('0xa'));var deskjs=require(_0x8a41('0xb'));var toCsv=require(_0x8a41('0x6'));var querystring=require('querystring');var Papa=require(_0x8a41('0xc'));var Redis=require(_0x8a41('0xd'));var authService=require(_0x8a41('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8a41('0xf'));var hardwareService=require(_0x8a41('0x10'));var logger=require(_0x8a41('0x11'))('api');var utils=require(_0x8a41('0x12'));var config=require(_0x8a41('0x13'));var licenseUtil=require(_0x8a41('0x14'));var db=require(_0x8a41('0x15'))['db'];function respondWithStatusCode(_0x29b0b2,_0x175eaf){_0x175eaf=_0x175eaf||0xcc;return function(_0x309e42){if(_0x309e42){return _0x29b0b2[_0x8a41('0x16')](_0x175eaf);}return _0x29b0b2[_0x8a41('0x17')](_0x175eaf)[_0x8a41('0x18')]();};}function respondWithResult(_0x5ec0fd,_0x345ad1){_0x345ad1=_0x345ad1||0xc8;return function(_0x5b7145){if(_0x5b7145){return _0x5ec0fd['status'](_0x345ad1)['json'](_0x5b7145);}};}function respondWithFilteredResult(_0x438355,_0x18e4fa){return function(_0x250581){if(_0x250581){var _0x212c3a=typeof _0x18e4fa['offset']===_0x8a41('0x19')&&typeof _0x18e4fa['limit']===_0x8a41('0x19');var _0x338d10=_0x250581[_0x8a41('0x1a')];var _0x228132=_0x212c3a?0x0:_0x18e4fa[_0x8a41('0x1b')];var _0x3294ad=_0x212c3a?_0x250581[_0x8a41('0x1a')]:_0x18e4fa[_0x8a41('0x1b')]+_0x18e4fa[_0x8a41('0x1c')];var _0x129b12;if(_0x3294ad>=_0x338d10){_0x3294ad=_0x338d10;_0x129b12=0xc8;}else{_0x129b12=0xce;}_0x438355[_0x8a41('0x17')](_0x129b12);return _0x438355['set'](_0x8a41('0x1d'),_0x228132+'-'+_0x3294ad+'/'+_0x338d10)[_0x8a41('0x1e')](_0x250581);}return null;};}function patchUpdates(_0x3986bc){return function(_0xa8453f){try{jsonpatch[_0x8a41('0x1f')](_0xa8453f,_0x3986bc,!![]);}catch(_0x2d7333){return BPromise[_0x8a41('0x20')](_0x2d7333);}return _0xa8453f['save']();};}function saveUpdates(_0x24e499,_0x5f4b79){return function(_0x41dff2){if(_0x41dff2){return _0x41dff2[_0x8a41('0x21')](_0x24e499)[_0x8a41('0x22')](function(_0x1f4881){return _0x1f4881;});}return null;};}function removeEntity(_0x136200,_0x816866){return function(_0x1c2486){if(_0x1c2486){return _0x1c2486[_0x8a41('0x23')]()[_0x8a41('0x22')](function(){_0x136200[_0x8a41('0x17')](0xcc)[_0x8a41('0x18')]();});}};}function handleEntityNotFound(_0xbe9d2a,_0x297af7){return function(_0x4d1730){if(!_0x4d1730){_0xbe9d2a[_0x8a41('0x16')](0x194);}return _0x4d1730;};}function handleError(_0x4c3f2f,_0x3c2db2){_0x3c2db2=_0x3c2db2||0x1f4;return function(_0x11b341){logger[_0x8a41('0x24')](_0x11b341[_0x8a41('0x25')]);if(_0x11b341['name']){delete _0x11b341[_0x8a41('0x26')];}_0x4c3f2f[_0x8a41('0x17')](_0x3c2db2)[_0x8a41('0x27')](_0x11b341);};}exports[_0x8a41('0x28')]=function(_0x371746,_0x360a57){var _0x652593={},_0x32a059={},_0x4c0de2={'count':0x0,'rows':[]};var _0x3c40b6=_[_0x8a41('0x29')](db[_0x8a41('0x2a')][_0x8a41('0x2b')],function(_0x466a2c){return{'name':_0x466a2c['fieldName'],'type':_0x466a2c[_0x8a41('0x2c')][_0x8a41('0x2d')]};});_0x32a059[_0x8a41('0x2e')]=_['map'](_0x3c40b6,_0x8a41('0x26'));_0x32a059['query']=_[_0x8a41('0x2f')](_0x371746[_0x8a41('0x30')]);_0x32a059[_0x8a41('0x31')]=_[_0x8a41('0x32')](_0x32a059[_0x8a41('0x2e')],_0x32a059[_0x8a41('0x30')]);_0x652593[_0x8a41('0x33')]=_[_0x8a41('0x32')](_0x32a059['model'],qs[_0x8a41('0x34')](_0x371746[_0x8a41('0x30')][_0x8a41('0x34')]));_0x652593[_0x8a41('0x33')]=_0x652593['attributes']['length']?_0x652593[_0x8a41('0x33')]:_0x32a059[_0x8a41('0x2e')];if(!_0x371746[_0x8a41('0x30')][_0x8a41('0x35')](_0x8a41('0x36'))){_0x652593['limit']=qs[_0x8a41('0x1c')](_0x371746[_0x8a41('0x30')]['limit']);_0x652593[_0x8a41('0x1b')]=qs[_0x8a41('0x1b')](_0x371746[_0x8a41('0x30')][_0x8a41('0x1b')]);}_0x652593[_0x8a41('0x37')]=qs[_0x8a41('0x38')](_0x371746[_0x8a41('0x30')][_0x8a41('0x38')]);_0x652593[_0x8a41('0x39')]=qs[_0x8a41('0x31')](_[_0x8a41('0x3a')](_0x371746['query'],_0x32a059[_0x8a41('0x31')]),_0x3c40b6);if(_0x371746[_0x8a41('0x30')]['filter']){_0x652593['where']=_[_0x8a41('0x3b')](_0x652593[_0x8a41('0x39')],{'$or':_['map'](_0x3c40b6,function(_0x456c5f){if(_0x456c5f[_0x8a41('0x2c')]!==_0x8a41('0x3c')){var _0x5f85e6={};_0x5f85e6[_0x456c5f[_0x8a41('0x26')]]={'$like':'%'+_0x371746[_0x8a41('0x30')]['filter']+'%'};return _0x5f85e6;}})});}_0x652593=_['merge']({},_0x652593,_0x371746[_0x8a41('0x3d')]);var _0x11a220={'where':_0x652593[_0x8a41('0x39')]};return db[_0x8a41('0x2a')][_0x8a41('0x1a')](_0x11a220)['then'](function(_0x30c752){_0x4c0de2[_0x8a41('0x1a')]=_0x30c752;if(_0x371746[_0x8a41('0x30')][_0x8a41('0x3e')]){_0x652593['include']=[{'all':!![]}];}return db[_0x8a41('0x2a')][_0x8a41('0x3f')](_0x652593);})[_0x8a41('0x22')](function(_0x1287f2){_0x4c0de2[_0x8a41('0x40')]=_0x1287f2;return _0x4c0de2;})[_0x8a41('0x22')](respondWithFilteredResult(_0x360a57,_0x652593))[_0x8a41('0x41')](handleError(_0x360a57,null));};exports['show']=function(_0x2a7bec,_0x3c78ae){var _0x39c483={'raw':!![],'where':{'id':_0x2a7bec[_0x8a41('0x42')]['id']}},_0x253ed9={};_0x253ed9[_0x8a41('0x2e')]=_['keys'](db[_0x8a41('0x2a')][_0x8a41('0x2b')]);_0x253ed9[_0x8a41('0x30')]=_['keys'](_0x2a7bec['query']);_0x253ed9[_0x8a41('0x31')]=_[_0x8a41('0x32')](_0x253ed9[_0x8a41('0x2e')],_0x253ed9[_0x8a41('0x30')]);_0x39c483[_0x8a41('0x33')]=_[_0x8a41('0x32')](_0x253ed9[_0x8a41('0x2e')],qs[_0x8a41('0x34')](_0x2a7bec['query'][_0x8a41('0x34')]));_0x39c483[_0x8a41('0x33')]=_0x39c483[_0x8a41('0x33')][_0x8a41('0x43')]?_0x39c483[_0x8a41('0x33')]:_0x253ed9['model'];if(_0x2a7bec[_0x8a41('0x30')][_0x8a41('0x3e')]){_0x39c483[_0x8a41('0x44')]=[{'all':!![]}];}_0x39c483=_[_0x8a41('0x3b')]({},_0x39c483,_0x2a7bec[_0x8a41('0x3d')]);return db[_0x8a41('0x2a')]['find'](_0x39c483)[_0x8a41('0x22')](handleEntityNotFound(_0x3c78ae,null))[_0x8a41('0x22')](respondWithResult(_0x3c78ae,null))[_0x8a41('0x41')](handleError(_0x3c78ae,null));};exports[_0x8a41('0x45')]=function(_0x13cfbb,_0x2975d4){return db['VoiceQueuesLog']['create'](_0x13cfbb[_0x8a41('0x46')],{})[_0x8a41('0x22')](respondWithResult(_0x2975d4,0xc9))['catch'](handleError(_0x2975d4,null));};exports[_0x8a41('0x21')]=function(_0x2c6d4f,_0x5e7bb4){if(_0x2c6d4f['body']['id']){delete _0x2c6d4f[_0x8a41('0x46')]['id'];}return db['VoiceQueuesLog'][_0x8a41('0x47')]({'where':{'id':_0x2c6d4f[_0x8a41('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e7bb4,null))[_0x8a41('0x22')](saveUpdates(_0x2c6d4f['body'],null))[_0x8a41('0x22')](respondWithResult(_0x5e7bb4,null))[_0x8a41('0x41')](handleError(_0x5e7bb4,null));};exports[_0x8a41('0x23')]=function(_0x4bdb8e,_0x53b122){return db[_0x8a41('0x2a')][_0x8a41('0x47')]({'where':{'id':_0x4bdb8e[_0x8a41('0x42')]['id']}})[_0x8a41('0x22')](handleEntityNotFound(_0x53b122,null))[_0x8a41('0x22')](removeEntity(_0x53b122,null))['catch'](handleError(_0x53b122,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3a17b85..4a13aa7 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 _0xab2a=['dtm','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x43b9af,_0x2c8316){var _0x1df62e=function(_0x2b2e79){while(--_0x2b2e79){_0x43b9af['push'](_0x43b9af['shift']());}};_0x1df62e(++_0x2c8316);}(_0xab2a,0x1a1));var _0xaab2=function(_0x10804c,_0x4fa715){_0x10804c=_0x10804c-0x0;var _0x5b462e=_0xab2a[_0x10804c];return _0x5b462e;};'use strict';var _=require(_0xaab2('0x0'));var util=require(_0xaab2('0x1'));var logger=require(_0xaab2('0x2'))('api');var moment=require(_0xaab2('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab2('0x4'));var fs=require('fs');var path=require(_0xaab2('0x5'));var rimraf=require(_0xaab2('0x6'));var config=require('../../config/environment');var attributes=require(_0xaab2('0x7'));module['exports']=function(_0x5c14f2,_0x53ce4f){return _0x5c14f2['define'](_0xaab2('0x8'),attributes,{'tableName':_0xaab2('0x9'),'paranoid':![],'indexes':[{'name':_0xaab2('0xa'),'fields':[_0xaab2('0xb'),_0xaab2('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7857=['moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','util'];(function(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0x7857,0x1af));var _0x7785=function(_0x1eb660,_0x4fb7ea){_0x1eb660=_0x1eb660-0x0;var _0x768978=_0x7857[_0x1eb660];return _0x768978;};'use strict';var _=require('lodash');var util=require(_0x7785('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7785('0x1'));var BPromise=require(_0x7785('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7785('0x3'));var config=require(_0x7785('0x4'));var attributes=require(_0x7785('0x5'));module[_0x7785('0x6')]=function(_0x2f4e4f,_0x8ba976){return _0x2f4e4f[_0x7785('0x7')](_0x7785('0x8'),attributes,{'tableName':_0x7785('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x7785('0xa'),_0x7785('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 566e529..9e4be15 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 _0x0879=['code','VoiceQueuesLog,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2069b7,_0x212de2){var _0x3a3526=function(_0x4b52d1){while(--_0x4b52d1){_0x2069b7['push'](_0x2069b7['shift']());}};_0x3a3526(++_0x212de2);}(_0x0879,0x1e9));var _0x9087=function(_0x33bc05,_0x243cdc){_0x33bc05=_0x33bc05-0x0;var _0x830049=_0x0879[_0x33bc05];return _0x830049;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9087('0x5'));var logger=require(_0x9087('0x6'))(_0x9087('0x7'));var config=require(_0x9087('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9087('0x9')][_0x9087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1296ec,_0x1f2a9a,_0x277d2e){return new BPromise(function(_0x174a24,_0x3608c6){return client['request'](_0x1296ec,_0x277d2e)[_0x9087('0xb')](function(_0x5428ce){logger[_0x9087('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,'request\x20sent');logger[_0x9087('0xd')](_0x9087('0xe'),_0x1f2a9a,'request\x20sent',JSON[_0x9087('0xf')](_0x5428ce));if(_0x5428ce[_0x9087('0x10')]){if(_0x5428ce[_0x9087('0x10')][_0x9087('0x11')]===0x1f4){logger['error'](_0x9087('0x12'),_0x1f2a9a,_0x5428ce[_0x9087('0x10')][_0x9087('0x13')]);return _0x3608c6(_0x5428ce['error'][_0x9087('0x13')]);}logger[_0x9087('0x10')](_0x9087('0x12'),_0x1f2a9a,_0x5428ce['error'][_0x9087('0x13')]);return _0x174a24(_0x5428ce[_0x9087('0x10')][_0x9087('0x13')]);}else{logger[_0x9087('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,_0x9087('0x14'));_0x174a24(_0x5428ce[_0x9087('0x15')][_0x9087('0x13')]);}})['catch'](function(_0x364d17){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1f2a9a,_0x364d17);_0x3608c6(_0x364d17);});});} \ No newline at end of file +var _0xc9c3=['client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x38938b,_0x258902){var _0xe641af=function(_0x35e9b4){while(--_0x35e9b4){_0x38938b['push'](_0x38938b['shift']());}};_0xe641af(++_0x258902);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x378fb4,_0x248c21){_0x378fb4=_0x378fb4-0x0;var _0x4835bd=_0xc9c3[_0x378fb4];return _0x4835bd;};'use strict';var _=require('lodash');var util=require(_0x3c9c('0x0'));var moment=require(_0x3c9c('0x1'));var BPromise=require(_0x3c9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require('../../config/logger')(_0x3c9c('0x5'));var config=require(_0x3c9c('0x6'));var jayson=require(_0x3c9c('0x7'));var client=jayson[_0x3c9c('0x8')][_0x3c9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x330378,_0x353324,_0x4eaaf4){return new BPromise(function(_0x5a15f7,_0x290995){return client[_0x3c9c('0xa')](_0x330378,_0x4eaaf4)['then'](function(_0x185321){logger[_0x3c9c('0xb')](_0x3c9c('0xc'),_0x353324,_0x3c9c('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x353324,_0x3c9c('0xd'),JSON[_0x3c9c('0xe')](_0x185321));if(_0x185321[_0x3c9c('0xf')]){if(_0x185321[_0x3c9c('0xf')]['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x353324,_0x185321['error'][_0x3c9c('0x10')]);return _0x290995(_0x185321[_0x3c9c('0xf')]['message']);}logger[_0x3c9c('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x353324,_0x185321[_0x3c9c('0xf')][_0x3c9c('0x10')]);return _0x5a15f7(_0x185321[_0x3c9c('0xf')]['message']);}else{logger[_0x3c9c('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x353324,_0x3c9c('0xd'));_0x5a15f7(_0x185321['result'][_0x3c9c('0x10')]);}})[_0x3c9c('0x11')](function(_0x17a542){logger['error'](_0x3c9c('0xc'),_0x353324,_0x17a542);_0x290995(_0x17a542);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6402747..98b92c0 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 _0xd51f=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe','put','update','destroy','exports'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0xd51f,0x104));var _0xfd51=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd51f[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require(_0xfd51('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd51('0x3'));var router=express[_0xfd51('0x4')]();var fs_extra=require(_0xfd51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd51('0x6'));var config=require(_0xfd51('0x7'));var controller=require('./voiceRecording.controller');router[_0xfd51('0x8')]('/',auth[_0xfd51('0x9')](),controller['index']);router[_0xfd51('0x8')]('/describe',auth[_0xfd51('0x9')](),controller[_0xfd51('0xa')]);router[_0xfd51('0x8')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller[_0xfd51('0xc')]);router[_0xfd51('0x8')](_0xfd51('0xd'),auth['isAuthenticated'](),controller[_0xfd51('0xe')]);router['get'](_0xfd51('0xf'),controller[_0xfd51('0x10')]);router[_0xfd51('0x8')]('/:id/transcribe',auth[_0xfd51('0x9')](),controller[_0xfd51('0x11')]);router['post']('/',auth[_0xfd51('0x9')](),controller[_0xfd51('0x12')]);router[_0xfd51('0x13')](_0xfd51('0x14'),auth[_0xfd51('0x9')](),controller[_0xfd51('0x15')]);router[_0xfd51('0x16')]('/:id',auth[_0xfd51('0x9')](),controller[_0xfd51('0x17')]);router['delete'](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller[_0xfd51('0x18')]);module[_0xfd51('0x19')]=router; \ No newline at end of file +var _0x9291=['index','/describe','describe','show','/:id/download','downloads','/:id/transcribe','downloadTranscribe','post','create','update','delete','/:id','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x2a0da1,_0x126736){var _0x36c50e=function(_0x2d5a33){while(--_0x2d5a33){_0x2a0da1['push'](_0x2a0da1['shift']());}};_0x36c50e(++_0x126736);}(_0x9291,0xee));var _0x1929=function(_0x3d4fb3,_0x461f9b){_0x3d4fb3=_0x3d4fb3-0x0;var _0x4233b1=_0x9291[_0x3d4fb3];return _0x4233b1;};'use strict';var multer=require(_0x1929('0x0'));var util=require(_0x1929('0x1'));var path=require(_0x1929('0x2'));var timeout=require('connect-timeout');var express=require(_0x1929('0x3'));var router=express[_0x1929('0x4')]();var fs_extra=require(_0x1929('0x5'));var auth=require(_0x1929('0x6'));var interaction=require(_0x1929('0x7'));var config=require(_0x1929('0x8'));var controller=require(_0x1929('0x9'));router[_0x1929('0xa')]('/',auth[_0x1929('0xb')](),controller[_0x1929('0xc')]);router[_0x1929('0xa')](_0x1929('0xd'),auth[_0x1929('0xb')](),controller[_0x1929('0xe')]);router[_0x1929('0xa')]('/:id',auth[_0x1929('0xb')](),controller[_0x1929('0xf')]);router['get'](_0x1929('0x10'),auth[_0x1929('0xb')](),controller['download']);router[_0x1929('0xa')]('/:id/downloads',controller[_0x1929('0x11')]);router['get'](_0x1929('0x12'),auth[_0x1929('0xb')](),controller[_0x1929('0x13')]);router[_0x1929('0x14')]('/',auth[_0x1929('0xb')](),controller[_0x1929('0x15')]);router[_0x1929('0x14')](_0x1929('0x12'),auth[_0x1929('0xb')](),controller['runTranscribe']);router['put']('/:id',auth[_0x1929('0xb')](),controller[_0x1929('0x16')]);router[_0x1929('0x17')](_0x1929('0x18'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index df2b287..02b4d30 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(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 a41bfb4..eda087f 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 _0x0152=['describe','../../components/encryptor','uniqueid','value','format','existsSync','secrets','recording','Sequelize','filename','unlink','download','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','ValidationError','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','name','index','map','VoiceRecording','rawAttributes','model','differenceBy','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','body'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0152,0xdc));var _0x2015=function(_0x5a52ec,_0x297b65){_0x5a52ec=_0x5a52ec-0x0;var _0x55ffb7=_0x0152[_0x5a52ec];return _0x55ffb7;};'use strict';var emlformat=require(_0x2015('0x0'));var rimraf=require(_0x2015('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2015('0x2'));var BPromise=require(_0x2015('0x3'));var Mustache=require(_0x2015('0x4'));var util=require('util');var path=require(_0x2015('0x5'));var sox=require(_0x2015('0x6'));var csv=require(_0x2015('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2015('0x8'));var _=require('lodash');var squel=require(_0x2015('0x9'));var crypto=require(_0x2015('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2015('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x2015('0xb'));var authService=require(_0x2015('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2015('0xd'));var logger=require(_0x2015('0xe'))(_0x2015('0xf'));var utils=require(_0x2015('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2015('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279102,_0x26fac9){_0x26fac9=_0x26fac9||0xcc;return function(_0x584c62){if(_0x584c62){return _0x279102['sendStatus'](_0x26fac9);}return _0x279102[_0x2015('0x12')](_0x26fac9)['end']();};}function respondWithResult(_0x182731,_0x41953e){_0x41953e=_0x41953e||0xc8;return function(_0x3606da){if(_0x3606da){return _0x182731[_0x2015('0x12')](_0x41953e)[_0x2015('0x13')](_0x3606da);}};}function respondWithFilteredResult(_0x1013ed,_0x4c7d61){return function(_0x2f0b2f){if(_0x2f0b2f){var _0x267441=typeof _0x4c7d61[_0x2015('0x14')]===_0x2015('0x15')&&typeof _0x4c7d61[_0x2015('0x16')]===_0x2015('0x15');var _0x359664=_0x2f0b2f[_0x2015('0x17')];var _0x12db3d=_0x267441?0x0:_0x4c7d61[_0x2015('0x14')];var _0x100a3c=_0x267441?_0x2f0b2f[_0x2015('0x17')]:_0x4c7d61[_0x2015('0x14')]+_0x4c7d61[_0x2015('0x16')];var _0x83f4e;if(_0x100a3c>=_0x359664){_0x100a3c=_0x359664;_0x83f4e=0xc8;}else{_0x83f4e=0xce;}_0x1013ed[_0x2015('0x12')](_0x83f4e);return _0x1013ed['set'](_0x2015('0x18'),_0x12db3d+'-'+_0x100a3c+'/'+_0x359664)[_0x2015('0x13')](_0x2f0b2f);}return null;};}function patchUpdates(_0x23a267){return function(_0x42ad87){try{jsonpatch[_0x2015('0x19')](_0x42ad87,_0x23a267,!![]);}catch(_0x3cd1e5){return BPromise[_0x2015('0x1a')](_0x3cd1e5);}return _0x42ad87[_0x2015('0x1b')]();};}function saveUpdates(_0x469e7f,_0x37a4ab){return function(_0x309af1){if(_0x309af1){return _0x309af1[_0x2015('0x1c')](_0x469e7f)[_0x2015('0x1d')](function(_0x45cefa){return _0x45cefa;});}return null;};}function removeEntity(_0x14dfe3,_0x46beb6){return function(_0xd57d32){if(_0xd57d32){return _0xd57d32['destroy']()[_0x2015('0x1d')](function(){_0x14dfe3[_0x2015('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca1b7,_0x2b0ed0){return function(_0x122aee){if(!_0x122aee){_0x2ca1b7[_0x2015('0x1e')](0x194);}return _0x122aee;};}function handleError(_0x4fd607,_0x112395){_0x112395=_0x112395||0x1f4;return function(_0x68d37f){logger['error'](_0x68d37f['stack']);if(_0x68d37f[_0x2015('0x1f')]){delete _0x68d37f[_0x2015('0x1f')];}_0x4fd607['status'](_0x112395)['send'](_0x68d37f);};}exports[_0x2015('0x20')]=function(_0x3ff2f5,_0x57e798){var _0x4fe717={},_0x4f8da8={},_0x295bcb={'count':0x0,'rows':[]};var _0x2f0d2a=_[_0x2015('0x21')](db[_0x2015('0x22')][_0x2015('0x23')],function(_0x14f6ac){return{'name':_0x14f6ac['fieldName'],'type':_0x14f6ac['type']['key']};});_0x4f8da8[_0x2015('0x24')]=_[_0x2015('0x25')](_[_0x2015('0x21')](_0x2f0d2a,_0x2015('0x1f')),['format']);_0x4f8da8[_0x2015('0x26')]=_[_0x2015('0x27')](_0x3ff2f5['query']);_0x4f8da8[_0x2015('0x28')]=_['intersection'](_0x4f8da8[_0x2015('0x24')],_0x4f8da8[_0x2015('0x26')]);_0x4fe717['attributes']=_['intersection'](_0x4f8da8[_0x2015('0x24')],qs['fields'](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x29')]));_0x4fe717[_0x2015('0x2a')]=_0x4fe717['attributes'][_0x2015('0x2b')]?_0x4fe717['attributes']:_0x4f8da8[_0x2015('0x24')];if(!_0x3ff2f5[_0x2015('0x26')][_0x2015('0x2c')](_0x2015('0x2d'))){_0x4fe717['limit']=qs[_0x2015('0x16')](_0x3ff2f5['query'][_0x2015('0x16')]);_0x4fe717[_0x2015('0x14')]=qs[_0x2015('0x14')](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x14')]);}_0x4fe717['order']=qs[_0x2015('0x2e')](_0x3ff2f5[_0x2015('0x26')][_0x2015('0x2e')]);_0x4fe717[_0x2015('0x2f')]=qs[_0x2015('0x28')](_[_0x2015('0x30')](_0x3ff2f5[_0x2015('0x26')],_0x4f8da8['filters']),_0x2f0d2a);if(_0x3ff2f5['query'][_0x2015('0x31')]){_0x4fe717['where']=_[_0x2015('0x32')](_0x4fe717[_0x2015('0x2f')],{'$or':_[_0x2015('0x21')](_0x2f0d2a,function(_0x36fd0d){if(_0x36fd0d[_0x2015('0x33')]!=='VIRTUAL'){var _0x11b143={};_0x11b143[_0x36fd0d[_0x2015('0x1f')]]={'$like':'%'+_0x3ff2f5['query']['filter']+'%'};return _0x11b143;}})});}_0x4fe717=_[_0x2015('0x32')]({},_0x4fe717,_0x3ff2f5['options']);var _0x3cbd21={'where':_0x4fe717[_0x2015('0x2f')]};return db[_0x2015('0x22')][_0x2015('0x17')](_0x3cbd21)[_0x2015('0x1d')](function(_0x1d071c){_0x295bcb[_0x2015('0x17')]=_0x1d071c;if(_0x3ff2f5['query'][_0x2015('0x34')]){_0x4fe717['include']=[{'all':!![]}];}return db[_0x2015('0x22')][_0x2015('0x35')](_0x4fe717);})[_0x2015('0x1d')](function(_0x316b9a){_0x295bcb[_0x2015('0x36')]=_0x316b9a;return _0x295bcb;})['then'](respondWithFilteredResult(_0x57e798,_0x4fe717))[_0x2015('0x37')](handleError(_0x57e798,null));};exports[_0x2015('0x38')]=function(_0xb3aed1,_0x37372f){var _0x435721={'raw':![],'where':{'id':_0xb3aed1[_0x2015('0x39')]['id']}},_0x400500={};_0x400500[_0x2015('0x24')]=_['keys'](db[_0x2015('0x22')]['rawAttributes']);_0x400500['query']=_['keys'](_0xb3aed1[_0x2015('0x26')]);_0x400500[_0x2015('0x28')]=_[_0x2015('0x3a')](_0x400500[_0x2015('0x24')],_0x400500['query']);_0x435721['attributes']=_[_0x2015('0x3a')](_0x400500[_0x2015('0x24')],qs['fields'](_0xb3aed1[_0x2015('0x26')][_0x2015('0x29')]));_0x435721['attributes']=_0x435721[_0x2015('0x2a')]['length']?_0x435721[_0x2015('0x2a')]:_0x400500['model'];if(_0xb3aed1['query'][_0x2015('0x34')]){_0x435721[_0x2015('0x3b')]=[{'all':!![]}];}_0x435721=_['merge']({},_0x435721,_0xb3aed1[_0x2015('0x3c')]);return db['VoiceRecording'][_0x2015('0x3d')](_0x435721)[_0x2015('0x1d')](handleEntityNotFound(_0x37372f,null))[_0x2015('0x1d')](respondWithResult(_0x37372f,null))[_0x2015('0x37')](handleError(_0x37372f,null));};exports[_0x2015('0x3e')]=function(_0x420f4a,_0x2e1799){return db[_0x2015('0x22')]['create'](_0x420f4a[_0x2015('0x3f')],{})[_0x2015('0x1d')](respondWithResult(_0x2e1799,0xc9))[_0x2015('0x37')](handleError(_0x2e1799,null));};exports[_0x2015('0x1c')]=function(_0xf32079,_0x22c2b1){if(_0xf32079['body']['id']){delete _0xf32079[_0x2015('0x3f')]['id'];}return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':{'id':_0xf32079['params']['id']}})['then'](handleEntityNotFound(_0x22c2b1,null))['then'](saveUpdates(_0xf32079[_0x2015('0x3f')],null))[_0x2015('0x1d')](respondWithResult(_0x22c2b1,null))[_0x2015('0x37')](handleError(_0x22c2b1,null));};exports[_0x2015('0x40')]=function(_0x26267d,_0x37d98e){return db[_0x2015('0x22')][_0x2015('0x40')]()[_0x2015('0x1d')](respondWithResult(_0x37d98e,null))[_0x2015('0x37')](handleError(_0x37d98e,null));};exports['download']=function(_0x3f9d15,_0x513d38,_0x193c29){var _0x51da2=require(_0x2015('0x41'));var _0x4778ae=![];var _0x94f4d0={};if(_0x3f9d15['query'][_0x2015('0x33')]&&_0x3f9d15[_0x2015('0x26')][_0x2015('0x33')]===_0x2015('0x42')){_0x94f4d0[_0x2015('0x42')]=_0x3f9d15['params']['id'];}else{_0x94f4d0['id']=_0x3f9d15[_0x2015('0x39')]['id'];}return db['VoiceRecording'][_0x2015('0x3d')]({'where':_0x94f4d0,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x513d38,null))[_0x2015('0x1d')](function(_0x1d2781){if(_0x1d2781){var _0x530ce2=_0x1d2781[_0x2015('0x43')];var _0x2e7a7a=util[_0x2015('0x44')]('%s.cypher',_0x530ce2);if(fs[_0x2015('0x45')](_0x2e7a7a)){_0x4778ae=!![];return _0x51da2['decryptFile'](_0x2e7a7a,_0x530ce2,config[_0x2015('0x46')][_0x2015('0x47')])['then'](function(){return _0x1d2781;});}return _0x1d2781;}})[_0x2015('0x1d')](function(_0x33d965){if(_0x33d965){var _0x274a1a=_0x33d965[_0x2015('0x43')];if(!fs['existsSync'](_0x274a1a)){throw new db[(_0x2015('0x48'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x33d965[_0x2015('0x49')]){return _0x513d38['download'](_0x274a1a,_0x33d965['filename']+path['extname'](_0x274a1a),function(){if(_0x4778ae){fs[_0x2015('0x4a')](_0x274a1a);}});}else{return _0x513d38[_0x2015('0x4b')](_0x274a1a,function(_0x106574){if(_0x4778ae){fs[_0x2015('0x4a')](_0x274a1a);}});}}})[_0x2015('0x37')](function(_0x1f50ea){if(_0x1f50ea[_0x2015('0x4c')]===_0x2015('0x4d')){_0x513d38['status'](0x194)['send'](_0x2015('0x4e'));}else{return handleError(_0x513d38,null);}});};exports[_0x2015('0x4f')]=function(_0x28855d,_0x772b48,_0x513b6f){var _0x239130=require(_0x2015('0x41'));var _0x11788c=![];var _0x38cd44={'$and':[db[_0x2015('0x50')][_0x2015('0x2f')](db[_0x2015('0x50')]['fn'](_0x2015('0x51'),db[_0x2015('0x50')][_0x2015('0x52')](_0x2015('0x42'))),_0x28855d[_0x2015('0x26')][_0x2015('0x53')])]};if(_0x28855d[_0x2015('0x26')][_0x2015('0x33')]&&_0x28855d[_0x2015('0x26')]['type']===_0x2015('0x42')){_0x38cd44[_0x2015('0x54')]['push']({'uniqueid':_0x28855d[_0x2015('0x39')]['id']});}else{_0x38cd44[_0x2015('0x54')][_0x2015('0x55')]({'id':_0x28855d[_0x2015('0x39')]['id']});}return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':_0x38cd44,'attributes':['id',_0x2015('0x43')],'raw':!![]})[_0x2015('0x1d')](handleEntityNotFound(_0x772b48,null))[_0x2015('0x1d')](function(_0x41c287){if(_0x41c287){var _0x3202a0=util['format']('%s.cypher',_0x41c287['value']);if(fs['existsSync'](_0x3202a0)){_0x11788c=!![];return _0x239130[_0x2015('0x56')](_0x3202a0,_0x41c287[_0x2015('0x43')],config[_0x2015('0x46')][_0x2015('0x47')])['then'](function(){return _0x41c287;});}return _0x41c287;}})[_0x2015('0x1d')](function(_0x162a1d){if(_0x162a1d){if(!fs[_0x2015('0x45')](_0x162a1d[_0x2015('0x43')])){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x162a1d['filename']){return _0x772b48[_0x2015('0x4b')](_0x162a1d[_0x2015('0x43')],_0x162a1d[_0x2015('0x49')]+path[_0x2015('0x58')](_0x162a1d[_0x2015('0x43')]),function(){if(_0x11788c){fs[_0x2015('0x4a')](_0x162a1d[_0x2015('0x43')]);}});}else{return _0x772b48[_0x2015('0x4b')](_0x162a1d[_0x2015('0x43')],function(_0x12e795){if(_0x11788c){fs[_0x2015('0x4a')](_0x162a1d['value']);}});}}})[_0x2015('0x37')](handleError(_0x772b48,null));};exports[_0x2015('0x59')]=function(_0xe7a6c8,_0xa3c8b6){return db[_0x2015('0x22')][_0x2015('0x3d')]({'where':{'id':_0xe7a6c8[_0x2015('0x39')]['id']}})['then'](function(_0x4f959c){if(_[_0x2015('0x5a')](_0x4f959c)){throw new ReferenceError(_0x2015('0x5b'));}return _0x4f959c;})[_0x2015('0x1d')](function(_0x40660c){var _0x49a099=_0x40660c[_0x2015('0x43')];logger[_0x2015('0x5c')](_0x2015('0x5d'),_0x49a099);if(!_[_0x2015('0x5a')](_0x40660c[_0x2015('0x43')])&&fs[_0x2015('0x45')](_0x49a099)){logger[_0x2015('0x5c')](_0x2015('0x5e')+_0x49a099+_0x2015('0x5f'));fs[_0x2015('0x60')](_0x49a099);}_0x49a099=_0x49a099+_0x2015('0x61');if(!_[_0x2015('0x5a')](_0x40660c[_0x2015('0x43')])&&fs['existsSync'](_0x49a099)){logger[_0x2015('0x5c')](_0x2015('0x5e')+_0x49a099+_0x2015('0x5f'));fs[_0x2015('0x60')](_0x49a099);}return _0x40660c;})[_0x2015('0x1d')](function(_0x598fb2){if(!_0x598fb2)throw new InternalError();return _0x598fb2[_0x2015('0x59')]();})['then'](function(){_0xa3c8b6[_0x2015('0x12')](0xcc)[_0x2015('0x62')]();})[_0x2015('0x37')](handleError(_0xa3c8b6,null));};function getBucketslist(_0x3beeb7,_0x4112d6,_0x56354f){return new Promise(function(_0x11c843,_0x1380db){var _0x2ac8c2=new AWS['S3']({'accessKeyId':_0x4112d6,'secretAccessKey':_0x3beeb7,'region':_0x56354f});_0x2ac8c2['listBuckets']({},function(_0x637d0f,_0x5d664f){if(_0x637d0f){return _0x1380db(_0x637d0f);}else{return _0x11c843(_0x5d664f);}});});}function createBucket(_0x1afcac,_0x5ee0d5,_0x332915,_0x230c27){return new Promise(function(_0x153ddc,_0x510b5a){var _0x49a401=new AWS['S3']({'accessKeyId':_0x5ee0d5,'secretAccessKey':_0x1afcac,'region':_0x332915});_0x49a401[_0x2015('0x63')]({'Bucket':_0x230c27},function(_0x59f722,_0x3f5096){if(_0x59f722){return _0x510b5a(_0x59f722);}else{return _0x153ddc(_0x3f5096);}});});}function uploadFile(_0x314abb,_0x48eea9,_0x10bda1,_0x25f252,_0x249397,_0x5e83f5){return new Promise(function(_0x51ce93,_0x13c02b){var _0x30f4b2=new AWS['S3']({'accessKeyId':_0x48eea9,'secretAccessKey':_0x314abb,'region':_0x10bda1});_0x30f4b2['upload']({'Bucket':_0x25f252,'Key':_0x249397,'Body':_0x5e83f5},function(_0x299858,_0x26adac){if(_0x299858){return _0x13c02b(_0x299858);}else{return _0x51ce93(_0x26adac);}});});}function startTranscribe(_0x353cd9,_0x5106cd,_0x125540,_0xe58a4e,_0x24c75b,_0x2a3f11){return new Promise(function(_0x24e54d,_0x526f5c){var _0x24c101=new AWS[(_0x2015('0x64'))]({'accessKeyId':_0x5106cd,'secretAccessKey':_0x353cd9,'region':_0x125540});_0x24c101[_0x2015('0x65')]({'TranscriptionJobName':_0xe58a4e,'LanguageCode':_0x24c75b,'Media':{'MediaFileUri':_0x2a3f11}},function(_0xc3ed9d,_0x2252d5){if(_0xc3ed9d){return _0x526f5c(_0xc3ed9d);}else{return _0x24e54d(_0x2252d5);}});});}function transcribe(_0x233153,_0x22d775,_0x568df4,_0x10ffb0,_0x3c70a6,_0x3d65f6,_0x5522bc){return new Promise(function(_0x4a42be,_0x3d4b71){var _0x14b53e={};logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x66'),_0x233153,_0x3c70a6));return uploadFile(_0x22d775,_0x568df4,_0x10ffb0,_0x3c70a6,path[_0x2015('0x67')](_0x3d65f6),fs['readFileSync'](_0x3d65f6))[_0x2015('0x1d')](function(_0x17a1ee){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x68'),_0x233153,_0x3c70a6,_0x17a1ee['Location']));_0x14b53e['bucket']=_0x17a1ee[_0x2015('0x69')];_0x14b53e[_0x2015('0x6a')]=_0x17a1ee[_0x2015('0x6b')];logger['info'](util['format'](_0x2015('0x6c'),_0x233153));return startTranscribe(_0x22d775,_0x568df4,_0x10ffb0,uuidv4(),_0x5522bc,_0x17a1ee[_0x2015('0x6b')]);})['then'](function(_0x3dceaa){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x6d'),_0x233153,_0x3dceaa['TranscriptionJob'][_0x2015('0x6e')]));_0x14b53e['transcribeName']=_0x3dceaa[_0x2015('0x6f')][_0x2015('0x6e')];_0x14b53e[_0x2015('0x70')]=_0x3dceaa[_0x2015('0x6f')][_0x2015('0x71')];return _0x4a42be(_0x14b53e);})[_0x2015('0x37')](function(_0x3bccbc){return _0x3d4b71(_0x3bccbc);});});}exports['runTranscribe']=function(_0x42bf78,_0x5221a3,_0x3bac59){var _0x120b0d;var _0xe0162a;var _0x50c2d5;var _0x5b6120=require(_0x2015('0x41'));return db['VoiceRecording'][_0x2015('0x72')]({'where':{'id':_0x42bf78['params']['id']}})[_0x2015('0x1d')](function(_0x425559){if(_0x425559){var _0x28a171=util[_0x2015('0x44')]('%s.cypher',_0x425559[_0x2015('0x43')]);if(fs['existsSync'](_0x28a171)){cypher=!![];return _0x5b6120[_0x2015('0x56')](_0x28a171,_0x425559[_0x2015('0x43')],config['secrets'][_0x2015('0x47')])[_0x2015('0x1d')](function(){return _0x425559;});}return _0x425559;}})[_0x2015('0x1d')](function(_0x289864){if(!_0x289864){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x73'));}_0xe0162a=_0x289864;return db[_0x2015('0x74')]['findOne']({'where':{'id':0x1}});})[_0x2015('0x1d')](handleEntityNotFound(_0x5221a3,null))[_0x2015('0x1d')](function(_0x5ea443){if(_0x5ea443){_0x120b0d=_0x5ea443;if(!_0x120b0d[_0x2015('0x75')]||!_0x120b0d[_0x2015('0x76')]||!_0x120b0d[_0x2015('0x77')]||!_0x120b0d[_0x2015('0x78')]||!_0x120b0d[_0x2015('0x79')]){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))]('Transcribe\x20not\x20configured');}if(_0x42bf78[_0x2015('0x3f')][_0x2015('0x7a')]&&(!_0x120b0d['sentiment']||!_0x120b0d['sentimentAccountId']||!_0x120b0d['sentimentRegion']||!_0x120b0d[_0x2015('0x78')]||!_0x120b0d[_0x2015('0x79')])){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7b'));}return db[_0x2015('0x7c')][_0x2015('0x72')]({'where':{'id':_0x120b0d[_0x2015('0x76')]}});}})[_0x2015('0x1d')](function(_0x2494cf){if(!_0x2494cf){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7d'));}if(!_0x2494cf['data1']||!_0x2494cf['data2']){throw new db[(_0x2015('0x48'))][(_0x2015('0x57'))](_0x2015('0x7e'));}_0x50c2d5=_0x2494cf;return getBucketslist(_0x50c2d5[_0x2015('0x7f')],_0x50c2d5['data2'],_0x120b0d[_0x2015('0x77')]);})[_0x2015('0x1d')](function(_0x104235){if(_0x104235&&_0x104235[_0x2015('0x80')]){var _0x44c4a1=_[_0x2015('0x3d')](_0x104235[_0x2015('0x80')],function(_0x1f3750){return _0x1f3750[_0x2015('0x81')]===_0x120b0d[_0x2015('0x79')];});if(!_0x44c4a1){logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x82'),_0x42bf78[_0x2015('0x39')]['id'],_0x120b0d[_0x2015('0x79')]));return createBucket(_0x50c2d5['data1'],_0x50c2d5[_0x2015('0x83')],_0x120b0d[_0x2015('0x77')],_0x120b0d['bucket']);}logger[_0x2015('0x5c')](util[_0x2015('0x44')](_0x2015('0x84'),_0x42bf78[_0x2015('0x39')]['id'],_0x120b0d[_0x2015('0x79')]));return;}})[_0x2015('0x1d')](function(_0x387545){if(_0xe0162a[_0x2015('0x70')]==='NEW'){return transcribe(_0x42bf78[_0x2015('0x39')]['id'],_0x50c2d5[_0x2015('0x7f')],_0x50c2d5['data2'],_0x120b0d[_0x2015('0x77')],_0x120b0d[_0x2015('0x79')],_0xe0162a[_0x2015('0x43')],_0x120b0d[_0x2015('0x78')]);}else{logger[_0x2015('0x5c')](util['format'](_0x2015('0x85'),_0x42bf78[_0x2015('0x39')]['id']));return{'transcribeStatus':_0x2015('0x86')};}})['then'](function(_0x173be4){if(_0x173be4){_0x173be4['tempSentiment']=_0x42bf78[_0x2015('0x3f')][_0x2015('0x7a')];return _0xe0162a[_0x2015('0x87')](_0x173be4);}})[_0x2015('0x1d')](respondWithResult(_0x5221a3,null))['catch'](handleError(_0x5221a3,null));};function writeFile(_0x4a621a,_0x4f6364){return new Promise(function(_0x4dbbd5,_0x46fedd){fs[_0x2015('0x88')](_0x4f6364,_0x4a621a,function(_0x296d83,_0x5d9f2e){if(_0x296d83){return _0x46fedd(_0x296d83);}else{return _0x4dbbd5(_0x5d9f2e);}});});}exports[_0x2015('0x89')]=function(_0x3e56ba,_0x5cd4ac,_0x3bc08e){return db[_0x2015('0x22')]['findOne']({'where':{'id':_0x3e56ba[_0x2015('0x39')]['id']}})[_0x2015('0x1d')](handleEntityNotFound(_0x5cd4ac))[_0x2015('0x1d')](function(_0xbc39d1){if(_0xbc39d1&&_0xbc39d1[_0x2015('0x8a')]){var _0x6170a6=_0xbc39d1[_0x2015('0x8a')];var _0x44e0c2=config[_0x2015('0x8b')]+_0x2015('0x8c')+_0xbc39d1['id']+'.txt';if(fs['existsSync'](_0x44e0c2)){return _0x44e0c2;}return writeFile(_0x6170a6,_0x44e0c2)[_0x2015('0x1d')](function(){return _0x44e0c2;});}else{throw new db['Sequelize']['ValidationError'](_0x2015('0x8d'));}})[_0x2015('0x1d')](function(_0x1f24b2){return _0x5cd4ac[_0x2015('0x4b')](_0x1f24b2);})[_0x2015('0x37')](handleError(_0x5cd4ac));}; \ No newline at end of file +var _0xcd91=['../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','error','stack','name','index','map','VoiceRecording','rawAttributes','key','model','differenceBy','format','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','merge','where','type','options','includeAll','include','rows','show','keys','length','find','create','catch','update','body','describe','download','uniqueid','params','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','recording','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xcd91,0x1c2));var _0x1cd9=function(_0x4da100,_0x43479b){_0x4da100=_0x4da100-0x0;var _0x2658a3=_0xcd91[_0x4da100];return _0x2658a3;};'use strict';var emlformat=require(_0x1cd9('0x0'));var rimraf=require(_0x1cd9('0x1'));var zipdir=require(_0x1cd9('0x2'));var jsonpatch=require(_0x1cd9('0x3'));var rp=require(_0x1cd9('0x4'));var moment=require(_0x1cd9('0x5'));var BPromise=require(_0x1cd9('0x6'));var Mustache=require(_0x1cd9('0x7'));var util=require('util');var path=require(_0x1cd9('0x8'));var sox=require(_0x1cd9('0x9'));var csv=require(_0x1cd9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cd9('0xb'));var _=require(_0x1cd9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1cd9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1cd9('0xa'));var querystring=require(_0x1cd9('0xe'));var Papa=require(_0x1cd9('0xf'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x1cd9('0x10'));var qs=require(_0x1cd9('0x11'));var as=require(_0x1cd9('0x12'));var hardwareService=require(_0x1cd9('0x13'));var logger=require(_0x1cd9('0x14'))(_0x1cd9('0x15'));var utils=require(_0x1cd9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1cd9('0x17'));var db=require(_0x1cd9('0x18'))['db'];function respondWithStatusCode(_0x47ba0c,_0x3c7319){_0x3c7319=_0x3c7319||0xcc;return function(_0x2bae3b){if(_0x2bae3b){return _0x47ba0c[_0x1cd9('0x19')](_0x3c7319);}return _0x47ba0c[_0x1cd9('0x1a')](_0x3c7319)[_0x1cd9('0x1b')]();};}function respondWithResult(_0x32ee90,_0xedfa22){_0xedfa22=_0xedfa22||0xc8;return function(_0x178554){if(_0x178554){return _0x32ee90[_0x1cd9('0x1a')](_0xedfa22)['json'](_0x178554);}};}function respondWithFilteredResult(_0xdd7f35,_0x2e4542){return function(_0x5d6b0a){if(_0x5d6b0a){var _0x125087=typeof _0x2e4542['offset']===_0x1cd9('0x1c')&&typeof _0x2e4542[_0x1cd9('0x1d')]===_0x1cd9('0x1c');var _0x37d1c7=_0x5d6b0a[_0x1cd9('0x1e')];var _0x1868cb=_0x125087?0x0:_0x2e4542[_0x1cd9('0x1f')];var _0x409107=_0x125087?_0x5d6b0a[_0x1cd9('0x1e')]:_0x2e4542['offset']+_0x2e4542[_0x1cd9('0x1d')];var _0x104b2d;if(_0x409107>=_0x37d1c7){_0x409107=_0x37d1c7;_0x104b2d=0xc8;}else{_0x104b2d=0xce;}_0xdd7f35['status'](_0x104b2d);return _0xdd7f35[_0x1cd9('0x20')](_0x1cd9('0x21'),_0x1868cb+'-'+_0x409107+'/'+_0x37d1c7)[_0x1cd9('0x22')](_0x5d6b0a);}return null;};}function patchUpdates(_0x166f8c){return function(_0x3dc599){try{jsonpatch[_0x1cd9('0x23')](_0x3dc599,_0x166f8c,!![]);}catch(_0x5ee23a){return BPromise[_0x1cd9('0x24')](_0x5ee23a);}return _0x3dc599[_0x1cd9('0x25')]();};}function saveUpdates(_0x42bcfb,_0x464687){return function(_0x2677e2){if(_0x2677e2){return _0x2677e2['update'](_0x42bcfb)[_0x1cd9('0x26')](function(_0x32f7b9){return _0x32f7b9;});}return null;};}function removeEntity(_0x3debd4,_0x5e430f){return function(_0x3236cc){if(_0x3236cc){return _0x3236cc['destroy']()[_0x1cd9('0x26')](function(){_0x3debd4[_0x1cd9('0x1a')](0xcc)[_0x1cd9('0x1b')]();});}};}function handleEntityNotFound(_0x5a4c68,_0x2bb91e){return function(_0x3fc971){if(!_0x3fc971){_0x5a4c68['sendStatus'](0x194);}return _0x3fc971;};}function handleError(_0x1dc2d2,_0x104ba3){_0x104ba3=_0x104ba3||0x1f4;return function(_0x44dcfb){logger[_0x1cd9('0x27')](_0x44dcfb[_0x1cd9('0x28')]);if(_0x44dcfb[_0x1cd9('0x29')]){delete _0x44dcfb[_0x1cd9('0x29')];}_0x1dc2d2[_0x1cd9('0x1a')](_0x104ba3)['send'](_0x44dcfb);};}exports[_0x1cd9('0x2a')]=function(_0x5afa4a,_0x50dc61){var _0x3b3ef5={},_0x4b4ef4={},_0x4661c4={'count':0x0,'rows':[]};var _0x3eee07=_[_0x1cd9('0x2b')](db[_0x1cd9('0x2c')][_0x1cd9('0x2d')],function(_0x4fb7e8){return{'name':_0x4fb7e8['fieldName'],'type':_0x4fb7e8['type'][_0x1cd9('0x2e')]};});_0x4b4ef4[_0x1cd9('0x2f')]=_[_0x1cd9('0x30')](_[_0x1cd9('0x2b')](_0x3eee07,'name'),[_0x1cd9('0x31')]);_0x4b4ef4[_0x1cd9('0x32')]=_['keys'](_0x5afa4a[_0x1cd9('0x32')]);_0x4b4ef4['filters']=_[_0x1cd9('0x33')](_0x4b4ef4[_0x1cd9('0x2f')],_0x4b4ef4[_0x1cd9('0x32')]);_0x3b3ef5[_0x1cd9('0x34')]=_[_0x1cd9('0x33')](_0x4b4ef4['model'],qs[_0x1cd9('0x35')](_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x35')]));_0x3b3ef5[_0x1cd9('0x34')]=_0x3b3ef5[_0x1cd9('0x34')]['length']?_0x3b3ef5['attributes']:_0x4b4ef4[_0x1cd9('0x2f')];if(!_0x5afa4a[_0x1cd9('0x32')]['hasOwnProperty'](_0x1cd9('0x36'))){_0x3b3ef5[_0x1cd9('0x1d')]=qs['limit'](_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x1d')]);_0x3b3ef5['offset']=qs['offset'](_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x1f')]);}_0x3b3ef5[_0x1cd9('0x37')]=qs[_0x1cd9('0x38')](_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x38')]);_0x3b3ef5['where']=qs[_0x1cd9('0x39')](_[_0x1cd9('0x3a')](_0x5afa4a[_0x1cd9('0x32')],_0x4b4ef4['filters']),_0x3eee07);if(_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x3b')]){_0x3b3ef5['where']=_[_0x1cd9('0x3c')](_0x3b3ef5[_0x1cd9('0x3d')],{'$or':_['map'](_0x3eee07,function(_0x20230e){if(_0x20230e[_0x1cd9('0x3e')]!=='VIRTUAL'){var _0x2c1dba={};_0x2c1dba[_0x20230e[_0x1cd9('0x29')]]={'$like':'%'+_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x3b')]+'%'};return _0x2c1dba;}})});}_0x3b3ef5=_[_0x1cd9('0x3c')]({},_0x3b3ef5,_0x5afa4a[_0x1cd9('0x3f')]);var _0x4dde59={'where':_0x3b3ef5[_0x1cd9('0x3d')]};return db[_0x1cd9('0x2c')][_0x1cd9('0x1e')](_0x4dde59)[_0x1cd9('0x26')](function(_0x5db7ee){_0x4661c4[_0x1cd9('0x1e')]=_0x5db7ee;if(_0x5afa4a[_0x1cd9('0x32')][_0x1cd9('0x40')]){_0x3b3ef5[_0x1cd9('0x41')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x3b3ef5);})[_0x1cd9('0x26')](function(_0x567434){_0x4661c4[_0x1cd9('0x42')]=_0x567434;return _0x4661c4;})[_0x1cd9('0x26')](respondWithFilteredResult(_0x50dc61,_0x3b3ef5))['catch'](handleError(_0x50dc61,null));};exports[_0x1cd9('0x43')]=function(_0x1301ef,_0xd768fa){var _0x3b1632={'raw':![],'where':{'id':_0x1301ef['params']['id']}},_0x239303={};_0x239303[_0x1cd9('0x2f')]=_['keys'](db['VoiceRecording'][_0x1cd9('0x2d')]);_0x239303[_0x1cd9('0x32')]=_[_0x1cd9('0x44')](_0x1301ef[_0x1cd9('0x32')]);_0x239303[_0x1cd9('0x39')]=_['intersection'](_0x239303[_0x1cd9('0x2f')],_0x239303['query']);_0x3b1632[_0x1cd9('0x34')]=_[_0x1cd9('0x33')](_0x239303[_0x1cd9('0x2f')],qs[_0x1cd9('0x35')](_0x1301ef[_0x1cd9('0x32')]['fields']));_0x3b1632['attributes']=_0x3b1632[_0x1cd9('0x34')][_0x1cd9('0x45')]?_0x3b1632['attributes']:_0x239303[_0x1cd9('0x2f')];if(_0x1301ef[_0x1cd9('0x32')]['includeAll']){_0x3b1632[_0x1cd9('0x41')]=[{'all':!![]}];}_0x3b1632=_[_0x1cd9('0x3c')]({},_0x3b1632,_0x1301ef[_0x1cd9('0x3f')]);return db[_0x1cd9('0x2c')][_0x1cd9('0x46')](_0x3b1632)[_0x1cd9('0x26')](handleEntityNotFound(_0xd768fa,null))[_0x1cd9('0x26')](respondWithResult(_0xd768fa,null))['catch'](handleError(_0xd768fa,null));};exports['create']=function(_0x3ee5d0,_0x493ab0){return db[_0x1cd9('0x2c')][_0x1cd9('0x47')](_0x3ee5d0['body'],{})['then'](respondWithResult(_0x493ab0,0xc9))[_0x1cd9('0x48')](handleError(_0x493ab0,null));};exports[_0x1cd9('0x49')]=function(_0x33b8e1,_0xc74e04){if(_0x33b8e1[_0x1cd9('0x4a')]['id']){delete _0x33b8e1[_0x1cd9('0x4a')]['id'];}return db[_0x1cd9('0x2c')]['find']({'where':{'id':_0x33b8e1['params']['id']}})[_0x1cd9('0x26')](handleEntityNotFound(_0xc74e04,null))[_0x1cd9('0x26')](saveUpdates(_0x33b8e1['body'],null))['then'](respondWithResult(_0xc74e04,null))['catch'](handleError(_0xc74e04,null));};exports['describe']=function(_0x51d8aa,_0x55b354){return db[_0x1cd9('0x2c')][_0x1cd9('0x4b')]()[_0x1cd9('0x26')](respondWithResult(_0x55b354,null))['catch'](handleError(_0x55b354,null));};exports[_0x1cd9('0x4c')]=function(_0x585dfd,_0x4d403c,_0x144439){var _0x48b651=require('../../components/encryptor');var _0x54876e=![];var _0x38c6ae={};if(_0x585dfd['query'][_0x1cd9('0x3e')]&&_0x585dfd[_0x1cd9('0x32')][_0x1cd9('0x3e')]===_0x1cd9('0x4d')){_0x38c6ae[_0x1cd9('0x4d')]=_0x585dfd[_0x1cd9('0x4e')]['id'];}else{_0x38c6ae['id']=_0x585dfd[_0x1cd9('0x4e')]['id'];}return db[_0x1cd9('0x2c')][_0x1cd9('0x46')]({'where':_0x38c6ae,'attributes':['id',_0x1cd9('0x4f')],'raw':!![]})[_0x1cd9('0x26')](handleEntityNotFound(_0x4d403c,null))[_0x1cd9('0x26')](function(_0x77c6ba){if(_0x77c6ba){var _0x4ea73f=_0x77c6ba['value'];var _0x348fc9=util[_0x1cd9('0x31')](_0x1cd9('0x50'),_0x4ea73f);if(fs[_0x1cd9('0x51')](_0x348fc9)){_0x54876e=!![];return _0x48b651[_0x1cd9('0x52')](_0x348fc9,_0x4ea73f,config[_0x1cd9('0x53')]['recording'])[_0x1cd9('0x26')](function(){return _0x77c6ba;});}return _0x77c6ba;}})[_0x1cd9('0x26')](function(_0x4c4945){if(_0x4c4945){var _0x5f2d02=_0x4c4945['value'];if(!fs[_0x1cd9('0x51')](_0x5f2d02)){throw new db[(_0x1cd9('0x54'))]['ValidationError'](_0x1cd9('0x55'));}if(_0x4c4945[_0x1cd9('0x56')]){return _0x4d403c[_0x1cd9('0x4c')](_0x5f2d02,_0x4c4945[_0x1cd9('0x56')]+path['extname'](_0x5f2d02),function(){if(_0x54876e){fs[_0x1cd9('0x57')](_0x5f2d02);}});}else{return _0x4d403c['download'](_0x5f2d02,function(_0x428307){if(_0x54876e){fs['unlink'](_0x5f2d02);}});}}})['catch'](function(_0x1d983f){if(_0x1d983f['message']===_0x1cd9('0x55')){_0x4d403c['status'](0x194)[_0x1cd9('0x58')](_0x1cd9('0x59'));}else{return handleError(_0x4d403c,null);}});};exports[_0x1cd9('0x5a')]=function(_0x597823,_0x378d51,_0x3d5b63){var _0x45fa48=require(_0x1cd9('0x5b'));var _0x6c2319=![];var _0x37d204={'$and':[db['sequelize'][_0x1cd9('0x3d')](db[_0x1cd9('0x5c')]['fn'](_0x1cd9('0x5d'),db[_0x1cd9('0x5c')]['col']('uniqueid')),_0x597823[_0x1cd9('0x32')][_0x1cd9('0x5e')])]};if(_0x597823[_0x1cd9('0x32')][_0x1cd9('0x3e')]&&_0x597823['query'][_0x1cd9('0x3e')]===_0x1cd9('0x4d')){_0x37d204[_0x1cd9('0x5f')][_0x1cd9('0x60')]({'uniqueid':_0x597823[_0x1cd9('0x4e')]['id']});}else{_0x37d204[_0x1cd9('0x5f')]['push']({'id':_0x597823['params']['id']});}return db[_0x1cd9('0x2c')][_0x1cd9('0x46')]({'where':_0x37d204,'attributes':['id',_0x1cd9('0x4f')],'raw':!![]})[_0x1cd9('0x26')](handleEntityNotFound(_0x378d51,null))[_0x1cd9('0x26')](function(_0x4fcfec){if(_0x4fcfec){var _0xf9099f=util[_0x1cd9('0x31')](_0x1cd9('0x50'),_0x4fcfec[_0x1cd9('0x4f')]);if(fs[_0x1cd9('0x51')](_0xf9099f)){_0x6c2319=!![];return _0x45fa48[_0x1cd9('0x52')](_0xf9099f,_0x4fcfec[_0x1cd9('0x4f')],config[_0x1cd9('0x53')][_0x1cd9('0x61')])[_0x1cd9('0x26')](function(){return _0x4fcfec;});}return _0x4fcfec;}})['then'](function(_0x4ffc26){if(_0x4ffc26){if(!fs[_0x1cd9('0x51')](_0x4ffc26[_0x1cd9('0x4f')])){throw new db[(_0x1cd9('0x54'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4ffc26[_0x1cd9('0x56')]){return _0x378d51[_0x1cd9('0x4c')](_0x4ffc26[_0x1cd9('0x4f')],_0x4ffc26[_0x1cd9('0x56')]+path['extname'](_0x4ffc26[_0x1cd9('0x4f')]),function(){if(_0x6c2319){fs['unlink'](_0x4ffc26[_0x1cd9('0x4f')]);}});}else{return _0x378d51['download'](_0x4ffc26['value'],function(_0x48e934){if(_0x6c2319){fs['unlink'](_0x4ffc26[_0x1cd9('0x4f')]);}});}}})[_0x1cd9('0x48')](handleError(_0x378d51,null));};exports[_0x1cd9('0x62')]=function(_0x37c17c,_0x41e05e){return db['VoiceRecording'][_0x1cd9('0x46')]({'where':{'id':_0x37c17c[_0x1cd9('0x4e')]['id']}})[_0x1cd9('0x26')](function(_0x3f68e3){if(_[_0x1cd9('0x63')](_0x3f68e3)){throw new ReferenceError(_0x1cd9('0x64'));}return _0x3f68e3;})[_0x1cd9('0x26')](function(_0x40d123){var _0x1b8a00=_0x40d123[_0x1cd9('0x4f')];logger[_0x1cd9('0x65')](_0x1cd9('0x66'),_0x1b8a00);if(!_[_0x1cd9('0x63')](_0x40d123[_0x1cd9('0x4f')])&&fs[_0x1cd9('0x51')](_0x1b8a00)){logger[_0x1cd9('0x65')](_0x1cd9('0x67')+_0x1b8a00+_0x1cd9('0x68'));fs['unlinkSync'](_0x1b8a00);}_0x1b8a00=_0x1b8a00+_0x1cd9('0x69');if(!_['isNil'](_0x40d123['value'])&&fs['existsSync'](_0x1b8a00)){logger[_0x1cd9('0x65')](_0x1cd9('0x67')+_0x1b8a00+_0x1cd9('0x68'));fs[_0x1cd9('0x6a')](_0x1b8a00);}return _0x40d123;})[_0x1cd9('0x26')](function(_0x1ce4c0){if(!_0x1ce4c0)throw new InternalError();return _0x1ce4c0['destroy']();})[_0x1cd9('0x26')](function(){_0x41e05e['status'](0xcc)['end']();})[_0x1cd9('0x48')](handleError(_0x41e05e,null));};function getBucketslist(_0x490b74,_0x4760e4,_0x3c72b6){return new Promise(function(_0x4048c5,_0x2530a6){var _0x463dfa=new AWS['S3']({'accessKeyId':_0x4760e4,'secretAccessKey':_0x490b74,'region':_0x3c72b6});_0x463dfa[_0x1cd9('0x6b')]({},function(_0x7ae7fe,_0x30efd9){if(_0x7ae7fe){return _0x2530a6(_0x7ae7fe);}else{return _0x4048c5(_0x30efd9);}});});}function createBucket(_0xc09d38,_0x89120a,_0x1809af,_0x1b63bd){return new Promise(function(_0x205f0c,_0x41c62d){var _0x1ce243=new AWS['S3']({'accessKeyId':_0x89120a,'secretAccessKey':_0xc09d38,'region':_0x1809af});_0x1ce243[_0x1cd9('0x6c')]({'Bucket':_0x1b63bd},function(_0x552a89,_0x4d8431){if(_0x552a89){return _0x41c62d(_0x552a89);}else{return _0x205f0c(_0x4d8431);}});});}function uploadFile(_0x5d71fa,_0x4eea5a,_0x1a41e0,_0x2c30d0,_0x54b347,_0x16f6b8){return new Promise(function(_0x127955,_0x1e38a1){var _0x25c538=new AWS['S3']({'accessKeyId':_0x4eea5a,'secretAccessKey':_0x5d71fa,'region':_0x1a41e0});_0x25c538[_0x1cd9('0x6d')]({'Bucket':_0x2c30d0,'Key':_0x54b347,'Body':_0x16f6b8},function(_0x5d6895,_0x5bc7b8){if(_0x5d6895){return _0x1e38a1(_0x5d6895);}else{return _0x127955(_0x5bc7b8);}});});}function startTranscribe(_0x560771,_0x1cf727,_0x273c1d,_0x380ed9,_0x51a70f,_0x1b7183){return new Promise(function(_0x3af0f1,_0x297d51){var _0x2a96d4=new AWS[(_0x1cd9('0x6e'))]({'accessKeyId':_0x1cf727,'secretAccessKey':_0x560771,'region':_0x273c1d});_0x2a96d4[_0x1cd9('0x6f')]({'TranscriptionJobName':_0x380ed9,'LanguageCode':_0x51a70f,'Media':{'MediaFileUri':_0x1b7183}},function(_0x38fb83,_0xbdfbbc){if(_0x38fb83){return _0x297d51(_0x38fb83);}else{return _0x3af0f1(_0xbdfbbc);}});});}function transcribe(_0x44173c,_0x27e84d,_0x2bb1a5,_0x1ff25c,_0x5bfada,_0x33bd13,_0x2fa99d){return new Promise(function(_0x58824b,_0x5b11f7){var _0x1608ad={};logger['info'](util[_0x1cd9('0x31')](_0x1cd9('0x70'),_0x44173c,_0x5bfada));return uploadFile(_0x27e84d,_0x2bb1a5,_0x1ff25c,_0x5bfada,path[_0x1cd9('0x71')](_0x33bd13),fs[_0x1cd9('0x72')](_0x33bd13))['then'](function(_0x2f4977){logger['info'](util[_0x1cd9('0x31')](_0x1cd9('0x73'),_0x44173c,_0x5bfada,_0x2f4977[_0x1cd9('0x74')]));_0x1608ad[_0x1cd9('0x75')]=_0x2f4977[_0x1cd9('0x76')];_0x1608ad[_0x1cd9('0x77')]=_0x2f4977[_0x1cd9('0x74')];logger[_0x1cd9('0x65')](util[_0x1cd9('0x31')](_0x1cd9('0x78'),_0x44173c));return startTranscribe(_0x27e84d,_0x2bb1a5,_0x1ff25c,uuidv4(),_0x2fa99d,_0x2f4977[_0x1cd9('0x74')]);})[_0x1cd9('0x26')](function(_0x4e85f6){logger[_0x1cd9('0x65')](util[_0x1cd9('0x31')](_0x1cd9('0x79'),_0x44173c,_0x4e85f6[_0x1cd9('0x7a')][_0x1cd9('0x7b')]));_0x1608ad['transcribeName']=_0x4e85f6[_0x1cd9('0x7a')]['TranscriptionJobName'];_0x1608ad[_0x1cd9('0x7c')]=_0x4e85f6['TranscriptionJob'][_0x1cd9('0x7d')];return _0x58824b(_0x1608ad);})[_0x1cd9('0x48')](function(_0x16d84d){return _0x5b11f7(_0x16d84d);});});}exports[_0x1cd9('0x7e')]=function(_0x50382e,_0x2c9a9e,_0x1dea06){var _0x3a255c;var _0x3bf0e1;var _0x5e8a98;var _0x361ce0=require(_0x1cd9('0x5b'));return db[_0x1cd9('0x2c')][_0x1cd9('0x7f')]({'where':{'id':_0x50382e[_0x1cd9('0x4e')]['id']}})[_0x1cd9('0x26')](function(_0x23fda9){if(_0x23fda9){var _0x45c33e=util[_0x1cd9('0x31')](_0x1cd9('0x50'),_0x23fda9[_0x1cd9('0x4f')]);if(fs[_0x1cd9('0x51')](_0x45c33e)){cypher=!![];return _0x361ce0[_0x1cd9('0x52')](_0x45c33e,_0x23fda9[_0x1cd9('0x4f')],config['secrets'][_0x1cd9('0x61')])[_0x1cd9('0x26')](function(){return _0x23fda9;});}return _0x23fda9;}})[_0x1cd9('0x26')](function(_0x29daba){if(!_0x29daba){throw new db[(_0x1cd9('0x54'))][(_0x1cd9('0x80'))](_0x1cd9('0x81'));}_0x3bf0e1=_0x29daba;return db[_0x1cd9('0x82')]['findOne']({'where':{'id':0x1}});})[_0x1cd9('0x26')](handleEntityNotFound(_0x2c9a9e,null))['then'](function(_0xc32a1b){if(_0xc32a1b){_0x3a255c=_0xc32a1b;if(!_0x3a255c[_0x1cd9('0x83')]||!_0x3a255c[_0x1cd9('0x84')]||!_0x3a255c[_0x1cd9('0x85')]||!_0x3a255c['language']||!_0x3a255c[_0x1cd9('0x75')]){throw new db[(_0x1cd9('0x54'))][(_0x1cd9('0x80'))](_0x1cd9('0x86'));}if(_0x50382e[_0x1cd9('0x4a')][_0x1cd9('0x87')]&&(!_0x3a255c[_0x1cd9('0x88')]||!_0x3a255c[_0x1cd9('0x89')]||!_0x3a255c['sentimentRegion']||!_0x3a255c[_0x1cd9('0x8a')]||!_0x3a255c[_0x1cd9('0x75')])){throw new db[(_0x1cd9('0x54'))][(_0x1cd9('0x80'))](_0x1cd9('0x8b'));}return db['CloudProvider'][_0x1cd9('0x7f')]({'where':{'id':_0x3a255c[_0x1cd9('0x84')]}});}})[_0x1cd9('0x26')](function(_0xd887cc){if(!_0xd887cc){throw new db['Sequelize'][(_0x1cd9('0x80'))](_0x1cd9('0x8c'));}if(!_0xd887cc['data1']||!_0xd887cc[_0x1cd9('0x8d')]){throw new db[(_0x1cd9('0x54'))][(_0x1cd9('0x80'))](_0x1cd9('0x8e'));}_0x5e8a98=_0xd887cc;return getBucketslist(_0x5e8a98[_0x1cd9('0x8f')],_0x5e8a98[_0x1cd9('0x8d')],_0x3a255c[_0x1cd9('0x85')]);})['then'](function(_0x3a39b7){if(_0x3a39b7&&_0x3a39b7[_0x1cd9('0x90')]){var _0x5427ac=_[_0x1cd9('0x46')](_0x3a39b7['Buckets'],function(_0x1f4351){return _0x1f4351[_0x1cd9('0x91')]===_0x3a255c[_0x1cd9('0x75')];});if(!_0x5427ac){logger[_0x1cd9('0x65')](util[_0x1cd9('0x31')](_0x1cd9('0x92'),_0x50382e[_0x1cd9('0x4e')]['id'],_0x3a255c[_0x1cd9('0x75')]));return createBucket(_0x5e8a98['data1'],_0x5e8a98[_0x1cd9('0x8d')],_0x3a255c[_0x1cd9('0x85')],_0x3a255c[_0x1cd9('0x75')]);}logger[_0x1cd9('0x65')](util[_0x1cd9('0x31')](_0x1cd9('0x93'),_0x50382e['params']['id'],_0x3a255c[_0x1cd9('0x75')]));return;}})['then'](function(_0x1d2d78){if(_0x3bf0e1[_0x1cd9('0x7c')]===_0x1cd9('0x94')){return transcribe(_0x50382e[_0x1cd9('0x4e')]['id'],_0x5e8a98[_0x1cd9('0x8f')],_0x5e8a98[_0x1cd9('0x8d')],_0x3a255c[_0x1cd9('0x85')],_0x3a255c[_0x1cd9('0x75')],_0x3bf0e1[_0x1cd9('0x4f')],_0x3a255c[_0x1cd9('0x8a')]);}else{logger[_0x1cd9('0x65')](util[_0x1cd9('0x31')](_0x1cd9('0x95'),_0x50382e['params']['id']));return{'transcribeStatus':_0x1cd9('0x96')};}})[_0x1cd9('0x26')](function(_0x363775){if(_0x363775){_0x363775[_0x1cd9('0x97')]=_0x50382e[_0x1cd9('0x4a')]['runSentiment'];return _0x3bf0e1[_0x1cd9('0x98')](_0x363775);}})[_0x1cd9('0x26')](respondWithResult(_0x2c9a9e,null))[_0x1cd9('0x48')](handleError(_0x2c9a9e,null));};function writeFile(_0x6e5900,_0x36925f){return new Promise(function(_0x32fe4f,_0x2bc0d7){fs[_0x1cd9('0x99')](_0x36925f,_0x6e5900,function(_0x3cce34,_0x177b1f){if(_0x3cce34){return _0x2bc0d7(_0x3cce34);}else{return _0x32fe4f(_0x177b1f);}});});}exports['downloadTranscribe']=function(_0x2a200b,_0x269b19,_0x285cf5){return db[_0x1cd9('0x2c')]['findOne']({'where':{'id':_0x2a200b[_0x1cd9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x269b19))['then'](function(_0x3161c1){if(_0x3161c1&&_0x3161c1[_0x1cd9('0x9a')]){var _0x444e25=_0x3161c1[_0x1cd9('0x9a')];var _0x3a979f=config[_0x1cd9('0x9b')]+'/server/files/transcribes/transcribe_'+_0x3161c1['id']+_0x1cd9('0x9c');if(fs[_0x1cd9('0x51')](_0x3a979f)){return _0x3a979f;}return writeFile(_0x444e25,_0x3a979f)[_0x1cd9('0x26')](function(){return _0x3a979f;});}else{throw new db[(_0x1cd9('0x54'))]['ValidationError'](_0x1cd9('0x9d'));}})[_0x1cd9('0x26')](function(_0x295937){return _0x269b19[_0x1cd9('0x4c')](_0x295937);})[_0x1cd9('0x48')](handleError(_0x269b19));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e5e1baf..c4d1c5d 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 _0xc999=['uniqueid','transcribeStatus','exports'];(function(_0x438fe1,_0x3308d5){var _0x3c8e1b=function(_0x2f8d41){while(--_0x2f8d41){_0x438fe1['push'](_0x438fe1['shift']());}};_0x3c8e1b(++_0x3308d5);}(_0xc999,0x176));var _0x9c99=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xc999[_0x354164];return _0x5db9a8;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x9c99('0x0')]=function(_0x7c806,_0x22a35f){return _0x7c806['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9c99('0x1')]},{'name':'transcribeStatus','fields':[_0x9c99('0x2')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f75=['uniqueid','transcribeStatus','./voiceRecording.attributes','voice_recordings'];(function(_0x24ec62,_0x42402b){var _0xbd7442=function(_0xbb5dd){while(--_0xbb5dd){_0x24ec62['push'](_0x24ec62['shift']());}};_0xbd7442(++_0x42402b);}(_0x9f75,0x15a));var _0x59f7=function(_0x1f7a1a,_0x47aa83){_0x1f7a1a=_0x1f7a1a-0x0;var _0x39f5ef=_0x9f75[_0x1f7a1a];return _0x39f5ef;};'use strict';var attributes=require(_0x59f7('0x0'));module['exports']=function(_0x2d26fa,_0x2a2154){return _0x2d26fa['define']('VoiceRecording',attributes,{'tableName':_0x59f7('0x1'),'paranoid':![],'indexes':[{'name':_0x59f7('0x2'),'fields':[_0x59f7('0x2')]},{'name':_0x59f7('0x3'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 8ba0cdc..7fcfd24 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 _0x2ef3=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x2ef3,0xba));var _0x32ef=function(_0x40a8b2,_0x2141bf){_0x40a8b2=_0x40a8b2-0x0;var _0x20d716=_0x2ef3[_0x40a8b2];return _0x20d716;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['update'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')]['where']||null:null,'attributes':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1a')]||null:null,'limit':_0x1a9476[_0x32ef('0x18')]?_0x1a9476['options'][_0x32ef('0x1b')]||null:null})[_0x32ef('0xb')](function(_0x5e8898){logger['info']('UpdateVoiceRecording',_0x1a9476);logger[_0x32ef('0x1c')](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x5e8898));_0x57863c(_0x5e8898);})['catch'](function(_0x59585f){logger[_0x32ef('0x11')]('UpdateVoiceRecording',_0x59585f['message'],_0x1a9476);_0xbe37f6(_0x286bfb[_0x32ef('0x11')](0x1f4,_0x59585f[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1d')]=function(_0x1dbe98){var _0x15ce54=this;return new Promise(function(_0x234175,_0x1874ea){var _0x38aed5=require(_0x32ef('0x1e'));var _0x2f52d7;return db[_0x32ef('0x1f')][_0x32ef('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x32ef('0xb')](function(_0x2f5d06){_0x2f52d7=_0x2f5d06;return db['VoiceRecording'][_0x32ef('0x21')](_0x1dbe98[_0x32ef('0x17')]);})[_0x32ef('0xb')](function(_0x26e207){if(_0x2f52d7['callRecordingEncryption']&&fs[_0x32ef('0x22')](_0x26e207[_0x32ef('0x23')])){var _0x31dbc3=util[_0x32ef('0x24')](_0x32ef('0x25'),_0x26e207[_0x32ef('0x23')]);return _0x38aed5[_0x32ef('0x26')](_0x26e207['value'],_0x31dbc3,config[_0x32ef('0x27')]['recording'])[_0x32ef('0xb')](function(){fs[_0x32ef('0x28')](_0x26e207['value']);logger[_0x32ef('0xc')](_0x32ef('0x29'));return _0x26e207;});}return _0x26e207;})[_0x32ef('0xb')](function(_0x20b467){logger[_0x32ef('0xc')]('CreateVoiceRecording',_0x1dbe98);logger['debug'](_0x32ef('0x1d'),_0x1dbe98,JSON['stringify'](_0x20b467));_0x234175(_0x20b467);})[_0x32ef('0x14')](function(_0x15b873){logger[_0x32ef('0x11')](_0x32ef('0x1d'),_0x15b873[_0x32ef('0x13')],_0x1dbe98);_0x1874ea(_0x15ce54[_0x32ef('0x11')](0x1f4,_0x15b873['message']));});});}; \ No newline at end of file +var _0x583c=['options','raw','where','attributes','limit','debug','stringify','catch','Setting','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x4f6512,_0x50ac37){var _0x34a0d1=function(_0x1f27a0){while(--_0x1f27a0){_0x4f6512['push'](_0x4f6512['shift']());}};_0x34a0d1(++_0x50ac37);}(_0x583c,0x12b));var _0xc583=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x583c[_0x16337a];return _0x422365;};'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')]('VoiceRecording,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['update'](_0x8a2d84[_0xc583('0x14')],{'raw':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x17')]||null:null,'attributes':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x18')]||null:null,'limit':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x19')]||null:null})['then'](function(_0x542256){logger[_0xc583('0xb')](_0xc583('0x12'),_0x8a2d84);logger[_0xc583('0x1a')]('UpdateVoiceRecording',_0x8a2d84,JSON[_0xc583('0x1b')](_0x542256));_0x36e0fd(_0x542256);})[_0xc583('0x1c')](function(_0x37f156){logger[_0xc583('0xf')](_0xc583('0x12'),_0x37f156['message'],_0x8a2d84);_0x5433ec(_0x12aac2['error'](0x1f4,_0x37f156[_0xc583('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x45ef74){var _0xcbe9b2=this;return new Promise(function(_0xbabf24,_0x1e7809){var _0x24aab5=require('../../components/encryptor');var _0x2dafb4;return db[_0xc583('0x1d')]['findOne']({'attributes':['id',_0xc583('0x1e')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x2c9088){_0x2dafb4=_0x2c9088;return db[_0xc583('0x13')][_0xc583('0x1f')](_0x45ef74[_0xc583('0x14')]);})[_0xc583('0xa')](function(_0x19079b){if(_0x2dafb4[_0xc583('0x1e')]&&fs['existsSync'](_0x19079b[_0xc583('0x20')])){var _0x390bc3=util[_0xc583('0x21')](_0xc583('0x22'),_0x19079b[_0xc583('0x20')]);return _0x24aab5[_0xc583('0x23')](_0x19079b['value'],_0x390bc3,config[_0xc583('0x24')]['recording'])['then'](function(){fs[_0xc583('0x25')](_0x19079b[_0xc583('0x20')]);logger[_0xc583('0xb')](_0xc583('0x26'));return _0x19079b;});}return _0x19079b;})[_0xc583('0xa')](function(_0x4a9679){logger[_0xc583('0xb')](_0xc583('0x27'),_0x45ef74);logger[_0xc583('0x1a')]('CreateVoiceRecording',_0x45ef74,JSON[_0xc583('0x1b')](_0x4a9679));_0xbabf24(_0x4a9679);})['catch'](function(_0x1aa62a){logger[_0xc583('0xf')](_0xc583('0x27'),_0x1aa62a[_0xc583('0x10')],_0x45ef74);_0x1e7809(_0xcbe9b2[_0xc583('0xf')](0x1f4,_0x1aa62a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index fb72099..d8f21f6 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 _0xb167=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb167,0x159));var _0x7b16=function(_0x26df12,_0x5b9df4){_0x26df12=_0x26df12-0x0;var _0x2ca213=_0xb167[_0x26df12];return _0x2ca213;};'use strict';var multer=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var path=require(_0x7b16('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b16('0x3'));var router=express[_0x7b16('0x4')]();var fs_extra=require(_0x7b16('0x5'));var auth=require(_0x7b16('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b16('0x7'));var controller=require(_0x7b16('0x8'));router[_0x7b16('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b16('0xa')]);router[_0x7b16('0x9')](_0x7b16('0xb'),auth[_0x7b16('0xc')](),controller['describe']);router[_0x7b16('0x9')](_0x7b16('0xd'),auth[_0x7b16('0xc')](),controller[_0x7b16('0xe')]);router['post']('/',auth[_0x7b16('0xc')](),controller['create']);router[_0x7b16('0xf')](_0x7b16('0xd'),auth[_0x7b16('0xc')](),controller[_0x7b16('0x10')]);router[_0x7b16('0x11')](_0x7b16('0xd'),auth['isAuthenticated'](),controller[_0x7b16('0x12')]);module[_0x7b16('0x13')]=router; \ No newline at end of file +var _0x1345=['multer','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','post','create','put','update','exports'];(function(_0x459b55,_0x44100c){var _0x654d78=function(_0x3b0990){while(--_0x3b0990){_0x459b55['push'](_0x459b55['shift']());}};_0x654d78(++_0x44100c);}(_0x1345,0x88));var _0x5134=function(_0xe2d14f,_0x49fd0e){_0xe2d14f=_0xe2d14f-0x0;var _0x4522d2=_0x1345[_0xe2d14f];return _0x4522d2;};'use strict';var multer=require(_0x5134('0x0'));var util=require(_0x5134('0x1'));var path=require(_0x5134('0x2'));var timeout=require('connect-timeout');var express=require(_0x5134('0x3'));var router=express[_0x5134('0x4')]();var fs_extra=require(_0x5134('0x5'));var auth=require(_0x5134('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x5134('0x7')]('/',auth[_0x5134('0x8')](),controller[_0x5134('0x9')]);router[_0x5134('0x7')](_0x5134('0xa'),auth[_0x5134('0x8')](),controller['describe']);router[_0x5134('0x7')](_0x5134('0xb'),auth[_0x5134('0x8')](),controller['show']);router[_0x5134('0xc')]('/',auth[_0x5134('0x8')](),controller[_0x5134('0xd')]);router[_0x5134('0xe')](_0x5134('0xb'),auth[_0x5134('0x8')](),controller[_0x5134('0xf')]);router['delete'](_0x5134('0xb'),auth[_0x5134('0x8')](),controller['destroy']);module[_0x5134('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ebc475f..778cf84 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 _0x4960=['Yes','sequelize','ENUM','blind','STRING'];(function(_0x5b5c4c,_0x587fb6){var _0x1980c4=function(_0x30637b){while(--_0x30637b){_0x5b5c4c['push'](_0x5b5c4c['shift']());}};_0x1980c4(++_0x587fb6);}(_0x4960,0x137));var _0x0496=function(_0x4e5f0d,_0xac055e){_0x4e5f0d=_0x4e5f0d-0x0;var _0x52dcf6=_0x4960[_0x4e5f0d];return _0x52dcf6;};'use strict';var Sequelize=require(_0x0496('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x0496('0x1')](_0x0496('0x2'),'attended')},'result':{'type':Sequelize[_0x0496('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x0496('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0496('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x0496('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x0496('0x3')]},'transferercontext':{'type':Sequelize[_0x0496('0x3')]},'transfererexten':{'type':Sequelize[_0x0496('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x0496('0x3')]},'transfereechannel':{'type':Sequelize[_0x0496('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x0496('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0496('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x0496('0x3')]},'transfereecontext':{'type':Sequelize[_0x0496('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x0496('0x3')]},'isexternal':{'type':Sequelize[_0x0496('0x1')](_0x0496('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd922=['moment','exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x4e0688,_0x3416c0){var _0x1c08aa=function(_0x507985){while(--_0x507985){_0x4e0688['push'](_0x4e0688['shift']());}};_0x1c08aa(++_0x3416c0);}(_0xd922,0x148));var _0x2d92=function(_0x69e920,_0x31e542){_0x69e920=_0x69e920-0x0;var _0xa7a111=_0xd922[_0x69e920];return _0xa7a111;};'use strict';var Sequelize=require(_0x2d92('0x0'));var moment=require(_0x2d92('0x1'));module[_0x2d92('0x2')]={'type':{'type':Sequelize[_0x2d92('0x3')]('blind',_0x2d92('0x4'))},'result':{'type':Sequelize[_0x2d92('0x5')]},'transfererchannel':{'type':Sequelize[_0x2d92('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x2d92('0x5')]},'transferercalleridname':{'type':Sequelize[_0x2d92('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2d92('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x2d92('0x5')]},'transferercontext':{'type':Sequelize[_0x2d92('0x5')]},'transfererexten':{'type':Sequelize[_0x2d92('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x2d92('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2d92('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2d92('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2d92('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2d92('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x2d92('0x5')]},'transfereecontext':{'type':Sequelize[_0x2d92('0x5')]},'transfereeexten':{'type':Sequelize[_0x2d92('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2d92('0x5')]},'isexternal':{'type':Sequelize[_0x2d92('0x3')](_0x2d92('0x6'),'No')},'context':{'type':Sequelize[_0x2d92('0x5')]},'extension':{'type':Sequelize[_0x2d92('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index a1586aa..2310379 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 _0x826e=['bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','filter','options','count','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x31fea3,_0x271aab){var _0x5a2771=function(_0xc054d){while(--_0xc054d){_0x31fea3['push'](_0x31fea3['shift']());}};_0x5a2771(++_0x271aab);}(_0x826e,0x178));var _0xe826=function(_0x96c9a5,_0x229e01){_0x96c9a5=_0x96c9a5-0x0;var _0x1aaa9a=_0x826e[_0x96c9a5];return _0x1aaa9a;};'use strict';var emlformat=require(_0xe826('0x0'));var rimraf=require(_0xe826('0x1'));var zipdir=require(_0xe826('0x2'));var jsonpatch=require(_0xe826('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe826('0x4'));var Mustache=require('mustache');var util=require(_0xe826('0x5'));var path=require(_0xe826('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe826('0x7'));var fs=require('fs');var fs_extra=require(_0xe826('0x8'));var _=require(_0xe826('0x9'));var squel=require(_0xe826('0xa'));var crypto=require(_0xe826('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe826('0xc'));var querystring=require(_0xe826('0xd'));var Papa=require(_0xe826('0xe'));var Redis=require(_0xe826('0xf'));var authService=require(_0xe826('0x10'));var qs=require(_0xe826('0x11'));var as=require(_0xe826('0x12'));var hardwareService=require(_0xe826('0x13'));var logger=require(_0xe826('0x14'))(_0xe826('0x15'));var utils=require('../../config/utils');var config=require(_0xe826('0x16'));var licenseUtil=require(_0xe826('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16bf40,_0x1f0003){_0x1f0003=_0x1f0003||0xcc;return function(_0x1b449a){if(_0x1b449a){return _0x16bf40[_0xe826('0x18')](_0x1f0003);}return _0x16bf40[_0xe826('0x19')](_0x1f0003)[_0xe826('0x1a')]();};}function respondWithResult(_0x5c0388,_0x54f54e){_0x54f54e=_0x54f54e||0xc8;return function(_0x5c2ff7){if(_0x5c2ff7){return _0x5c0388[_0xe826('0x19')](_0x54f54e)[_0xe826('0x1b')](_0x5c2ff7);}};}function respondWithFilteredResult(_0x4c6686,_0x3105d1){return function(_0x3eb693){if(_0x3eb693){var _0xf073c3=typeof _0x3105d1[_0xe826('0x1c')]===_0xe826('0x1d')&&typeof _0x3105d1[_0xe826('0x1e')]===_0xe826('0x1d');var _0x35b31b=_0x3eb693['count'];var _0x24f910=_0xf073c3?0x0:_0x3105d1[_0xe826('0x1c')];var _0x4654ea=_0xf073c3?_0x3eb693['count']:_0x3105d1[_0xe826('0x1c')]+_0x3105d1[_0xe826('0x1e')];var _0x25bed2;if(_0x4654ea>=_0x35b31b){_0x4654ea=_0x35b31b;_0x25bed2=0xc8;}else{_0x25bed2=0xce;}_0x4c6686[_0xe826('0x19')](_0x25bed2);return _0x4c6686[_0xe826('0x1f')](_0xe826('0x20'),_0x24f910+'-'+_0x4654ea+'/'+_0x35b31b)[_0xe826('0x1b')](_0x3eb693);}return null;};}function patchUpdates(_0x46a1cf){return function(_0x54c3f9){try{jsonpatch[_0xe826('0x21')](_0x54c3f9,_0x46a1cf,!![]);}catch(_0x48b9ff){return BPromise[_0xe826('0x22')](_0x48b9ff);}return _0x54c3f9[_0xe826('0x23')]();};}function saveUpdates(_0x2d60dd,_0x5751cb){return function(_0x5aa245){if(_0x5aa245){return _0x5aa245[_0xe826('0x24')](_0x2d60dd)[_0xe826('0x25')](function(_0x5f0380){return _0x5f0380;});}return null;};}function removeEntity(_0x5e2a60,_0x3b899f){return function(_0x2f88cf){if(_0x2f88cf){return _0x2f88cf[_0xe826('0x26')]()[_0xe826('0x25')](function(){_0x5e2a60[_0xe826('0x19')](0xcc)[_0xe826('0x1a')]();});}};}function handleEntityNotFound(_0x56bc50,_0x45b0d0){return function(_0xb3a48a){if(!_0xb3a48a){_0x56bc50[_0xe826('0x18')](0x194);}return _0xb3a48a;};}function handleError(_0x32e6d7,_0x4f7c19){_0x4f7c19=_0x4f7c19||0x1f4;return function(_0x54ed4a){logger[_0xe826('0x27')](_0x54ed4a[_0xe826('0x28')]);if(_0x54ed4a[_0xe826('0x29')]){delete _0x54ed4a[_0xe826('0x29')];}_0x32e6d7[_0xe826('0x19')](_0x4f7c19)[_0xe826('0x2a')](_0x54ed4a);};}exports[_0xe826('0x2b')]=function(_0x20b995,_0x117717){var _0x507c7d={},_0x1bf70d={},_0x341515={'count':0x0,'rows':[]};var _0x463c54=_['map'](db[_0xe826('0x2c')][_0xe826('0x2d')],function(_0x30395c){return{'name':_0x30395c[_0xe826('0x2e')],'type':_0x30395c[_0xe826('0x2f')]['key']};});_0x1bf70d[_0xe826('0x30')]=_[_0xe826('0x31')](_0x463c54,_0xe826('0x29'));_0x1bf70d['query']=_[_0xe826('0x32')](_0x20b995[_0xe826('0x33')]);_0x1bf70d[_0xe826('0x34')]=_[_0xe826('0x35')](_0x1bf70d[_0xe826('0x30')],_0x1bf70d[_0xe826('0x33')]);_0x507c7d[_0xe826('0x36')]=_[_0xe826('0x35')](_0x1bf70d[_0xe826('0x30')],qs['fields'](_0x20b995[_0xe826('0x33')][_0xe826('0x37')]));_0x507c7d[_0xe826('0x36')]=_0x507c7d[_0xe826('0x36')][_0xe826('0x38')]?_0x507c7d[_0xe826('0x36')]:_0x1bf70d[_0xe826('0x30')];if(!_0x20b995['query']['hasOwnProperty'](_0xe826('0x39'))){_0x507c7d[_0xe826('0x1e')]=qs['limit'](_0x20b995[_0xe826('0x33')][_0xe826('0x1e')]);_0x507c7d[_0xe826('0x1c')]=qs['offset'](_0x20b995[_0xe826('0x33')][_0xe826('0x1c')]);}_0x507c7d['order']=qs[_0xe826('0x3a')](_0x20b995[_0xe826('0x33')][_0xe826('0x3a')]);_0x507c7d['where']=qs[_0xe826('0x34')](_[_0xe826('0x3b')](_0x20b995['query'],_0x1bf70d[_0xe826('0x34')]),_0x463c54);if(_0x20b995[_0xe826('0x33')]['filter']){_0x507c7d[_0xe826('0x3c')]=_['merge'](_0x507c7d[_0xe826('0x3c')],{'$or':_['map'](_0x463c54,function(_0x5cd5e1){if(_0x5cd5e1[_0xe826('0x2f')]!=='VIRTUAL'){var _0x1ddd17={};_0x1ddd17[_0x5cd5e1[_0xe826('0x29')]]={'$like':'%'+_0x20b995[_0xe826('0x33')][_0xe826('0x3d')]+'%'};return _0x1ddd17;}})});}_0x507c7d=_['merge']({},_0x507c7d,_0x20b995[_0xe826('0x3e')]);var _0x7c2c8c={'where':_0x507c7d['where']};return db[_0xe826('0x2c')][_0xe826('0x3f')](_0x7c2c8c)['then'](function(_0x190c2b){_0x341515['count']=_0x190c2b;if(_0x20b995['query']['includeAll']){_0x507c7d[_0xe826('0x40')]=[{'all':!![]}];}return db[_0xe826('0x2c')][_0xe826('0x41')](_0x507c7d);})[_0xe826('0x25')](function(_0x134218){_0x341515[_0xe826('0x42')]=_0x134218;return _0x341515;})['then'](respondWithFilteredResult(_0x117717,_0x507c7d))['catch'](handleError(_0x117717,null));};exports[_0xe826('0x43')]=function(_0x4a715f,_0x4581b6){var _0x3ebb48={'raw':!![],'where':{'id':_0x4a715f[_0xe826('0x44')]['id']}},_0x1e48c3={};_0x1e48c3[_0xe826('0x30')]=_[_0xe826('0x32')](db[_0xe826('0x2c')][_0xe826('0x2d')]);_0x1e48c3[_0xe826('0x33')]=_[_0xe826('0x32')](_0x4a715f[_0xe826('0x33')]);_0x1e48c3['filters']=_['intersection'](_0x1e48c3[_0xe826('0x30')],_0x1e48c3['query']);_0x3ebb48[_0xe826('0x36')]=_[_0xe826('0x35')](_0x1e48c3['model'],qs[_0xe826('0x37')](_0x4a715f[_0xe826('0x33')][_0xe826('0x37')]));_0x3ebb48['attributes']=_0x3ebb48[_0xe826('0x36')][_0xe826('0x38')]?_0x3ebb48['attributes']:_0x1e48c3[_0xe826('0x30')];if(_0x4a715f[_0xe826('0x33')][_0xe826('0x45')]){_0x3ebb48[_0xe826('0x40')]=[{'all':!![]}];}_0x3ebb48=_[_0xe826('0x46')]({},_0x3ebb48,_0x4a715f[_0xe826('0x3e')]);return db['VoiceTransferReport'][_0xe826('0x47')](_0x3ebb48)[_0xe826('0x25')](handleEntityNotFound(_0x4581b6,null))[_0xe826('0x25')](respondWithResult(_0x4581b6,null))[_0xe826('0x48')](handleError(_0x4581b6,null));};exports[_0xe826('0x49')]=function(_0x11c029,_0x3efb65){return db[_0xe826('0x2c')]['create'](_0x11c029[_0xe826('0x4a')],{})[_0xe826('0x25')](respondWithResult(_0x3efb65,0xc9))[_0xe826('0x48')](handleError(_0x3efb65,null));};exports['update']=function(_0x50606a,_0x5bb065){if(_0x50606a[_0xe826('0x4a')]['id']){delete _0x50606a['body']['id'];}return db[_0xe826('0x2c')][_0xe826('0x47')]({'where':{'id':_0x50606a[_0xe826('0x44')]['id']}})[_0xe826('0x25')](handleEntityNotFound(_0x5bb065,null))[_0xe826('0x25')](saveUpdates(_0x50606a[_0xe826('0x4a')],null))[_0xe826('0x25')](respondWithResult(_0x5bb065,null))['catch'](handleError(_0x5bb065,null));};exports['destroy']=function(_0x2d6640,_0x56c843){return db[_0xe826('0x2c')][_0xe826('0x47')]({'where':{'id':_0x2d6640['params']['id']}})[_0xe826('0x25')](handleEntityNotFound(_0x56c843,null))[_0xe826('0x25')](removeEntity(_0x56c843,null))[_0xe826('0x48')](handleError(_0x56c843,null));};exports[_0xe826('0x4b')]=function(_0x171e98,_0x3b8130){return db['VoiceTransferReport'][_0xe826('0x4b')]()[_0xe826('0x25')](respondWithResult(_0x3b8130,null))[_0xe826('0x48')](handleError(_0x3b8130,null));}; \ No newline at end of file +var _0x1b26=['Content-Range','json','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','filters','query','attributes','intersection','fields','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','catch','show','params','keys','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit'];(function(_0x4c9299,_0x2ddce9){var _0x33c69a=function(_0x1a3c34){while(--_0x1a3c34){_0x4c9299['push'](_0x4c9299['shift']());}};_0x33c69a(++_0x2ddce9);}(_0x1b26,0x1d9));var _0x61b2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1b26[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x61b2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x61b2('0x1'));var rp=require(_0x61b2('0x2'));var moment=require(_0x61b2('0x3'));var BPromise=require(_0x61b2('0x4'));var Mustache=require(_0x61b2('0x5'));var util=require(_0x61b2('0x6'));var path=require(_0x61b2('0x7'));var sox=require(_0x61b2('0x8'));var csv=require(_0x61b2('0x9'));var ejs=require(_0x61b2('0xa'));var fs=require('fs');var fs_extra=require(_0x61b2('0xb'));var _=require('lodash');var squel=require(_0x61b2('0xc'));var crypto=require(_0x61b2('0xd'));var jsforce=require(_0x61b2('0xe'));var deskjs=require(_0x61b2('0xf'));var toCsv=require(_0x61b2('0x9'));var querystring=require('querystring');var Papa=require(_0x61b2('0x10'));var Redis=require(_0x61b2('0x11'));var authService=require(_0x61b2('0x12'));var qs=require(_0x61b2('0x13'));var as=require(_0x61b2('0x14'));var hardwareService=require(_0x61b2('0x15'));var logger=require('../../config/logger')(_0x61b2('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x61b2('0x17'));var db=require(_0x61b2('0x18'))['db'];function respondWithStatusCode(_0x1d7c4,_0x50d3e4){_0x50d3e4=_0x50d3e4||0xcc;return function(_0x194438){if(_0x194438){return _0x1d7c4[_0x61b2('0x19')](_0x50d3e4);}return _0x1d7c4[_0x61b2('0x1a')](_0x50d3e4)['end']();};}function respondWithResult(_0x4056de,_0x9b2c4e){_0x9b2c4e=_0x9b2c4e||0xc8;return function(_0x4d8f4e){if(_0x4d8f4e){return _0x4056de['status'](_0x9b2c4e)['json'](_0x4d8f4e);}};}function respondWithFilteredResult(_0x5aa5ce,_0x3135f6){return function(_0x255976){if(_0x255976){var _0x20b3f1=typeof _0x3135f6[_0x61b2('0x1b')]===_0x61b2('0x1c')&&typeof _0x3135f6['limit']===_0x61b2('0x1c');var _0x7e2889=_0x255976[_0x61b2('0x1d')];var _0x3d3348=_0x20b3f1?0x0:_0x3135f6[_0x61b2('0x1b')];var _0x3add94=_0x20b3f1?_0x255976[_0x61b2('0x1d')]:_0x3135f6[_0x61b2('0x1b')]+_0x3135f6[_0x61b2('0x1e')];var _0x2256c4;if(_0x3add94>=_0x7e2889){_0x3add94=_0x7e2889;_0x2256c4=0xc8;}else{_0x2256c4=0xce;}_0x5aa5ce[_0x61b2('0x1a')](_0x2256c4);return _0x5aa5ce['set'](_0x61b2('0x1f'),_0x3d3348+'-'+_0x3add94+'/'+_0x7e2889)[_0x61b2('0x20')](_0x255976);}return null;};}function patchUpdates(_0x5a4bde){return function(_0x4bb439){try{jsonpatch['apply'](_0x4bb439,_0x5a4bde,!![]);}catch(_0x566caa){return BPromise[_0x61b2('0x21')](_0x566caa);}return _0x4bb439[_0x61b2('0x22')]();};}function saveUpdates(_0x49a66b,_0x197802){return function(_0xb7a8a2){if(_0xb7a8a2){return _0xb7a8a2[_0x61b2('0x23')](_0x49a66b)['then'](function(_0x25b6c3){return _0x25b6c3;});}return null;};}function removeEntity(_0x5270ef,_0x297683){return function(_0x24a45f){if(_0x24a45f){return _0x24a45f[_0x61b2('0x24')]()[_0x61b2('0x25')](function(){_0x5270ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5552b0,_0x419dcb){return function(_0x17ec0b){if(!_0x17ec0b){_0x5552b0[_0x61b2('0x19')](0x194);}return _0x17ec0b;};}function handleError(_0x36b749,_0x4d25d9){_0x4d25d9=_0x4d25d9||0x1f4;return function(_0x224a9e){logger['error'](_0x224a9e[_0x61b2('0x26')]);if(_0x224a9e['name']){delete _0x224a9e[_0x61b2('0x27')];}_0x36b749[_0x61b2('0x1a')](_0x4d25d9)[_0x61b2('0x28')](_0x224a9e);};}exports[_0x61b2('0x29')]=function(_0x280f19,_0x357657){var _0x7bdcb0={},_0x5af4d1={},_0x4f56e7={'count':0x0,'rows':[]};var _0x2bba39=_['map'](db['VoiceTransferReport'][_0x61b2('0x2a')],function(_0x1e3772){return{'name':_0x1e3772[_0x61b2('0x2b')],'type':_0x1e3772[_0x61b2('0x2c')][_0x61b2('0x2d')]};});_0x5af4d1[_0x61b2('0x2e')]=_[_0x61b2('0x2f')](_0x2bba39,_0x61b2('0x27'));_0x5af4d1['query']=_['keys'](_0x280f19['query']);_0x5af4d1[_0x61b2('0x30')]=_['intersection'](_0x5af4d1[_0x61b2('0x2e')],_0x5af4d1[_0x61b2('0x31')]);_0x7bdcb0[_0x61b2('0x32')]=_[_0x61b2('0x33')](_0x5af4d1[_0x61b2('0x2e')],qs[_0x61b2('0x34')](_0x280f19[_0x61b2('0x31')][_0x61b2('0x34')]));_0x7bdcb0[_0x61b2('0x32')]=_0x7bdcb0[_0x61b2('0x32')]['length']?_0x7bdcb0[_0x61b2('0x32')]:_0x5af4d1[_0x61b2('0x2e')];if(!_0x280f19['query']['hasOwnProperty']('nolimit')){_0x7bdcb0[_0x61b2('0x1e')]=qs[_0x61b2('0x1e')](_0x280f19[_0x61b2('0x31')][_0x61b2('0x1e')]);_0x7bdcb0['offset']=qs[_0x61b2('0x1b')](_0x280f19[_0x61b2('0x31')][_0x61b2('0x1b')]);}_0x7bdcb0['order']=qs[_0x61b2('0x35')](_0x280f19[_0x61b2('0x31')][_0x61b2('0x35')]);_0x7bdcb0[_0x61b2('0x36')]=qs[_0x61b2('0x30')](_[_0x61b2('0x37')](_0x280f19[_0x61b2('0x31')],_0x5af4d1[_0x61b2('0x30')]),_0x2bba39);if(_0x280f19[_0x61b2('0x31')][_0x61b2('0x38')]){_0x7bdcb0[_0x61b2('0x36')]=_[_0x61b2('0x39')](_0x7bdcb0['where'],{'$or':_[_0x61b2('0x2f')](_0x2bba39,function(_0x45c582){if(_0x45c582['type']!==_0x61b2('0x3a')){var _0x1e6ba7={};_0x1e6ba7[_0x45c582[_0x61b2('0x27')]]={'$like':'%'+_0x280f19[_0x61b2('0x31')]['filter']+'%'};return _0x1e6ba7;}})});}_0x7bdcb0=_[_0x61b2('0x39')]({},_0x7bdcb0,_0x280f19[_0x61b2('0x3b')]);var _0x2445db={'where':_0x7bdcb0[_0x61b2('0x36')]};return db[_0x61b2('0x3c')]['count'](_0x2445db)['then'](function(_0x133665){_0x4f56e7[_0x61b2('0x1d')]=_0x133665;if(_0x280f19[_0x61b2('0x31')][_0x61b2('0x3d')]){_0x7bdcb0[_0x61b2('0x3e')]=[{'all':!![]}];}return db[_0x61b2('0x3c')]['findAll'](_0x7bdcb0);})[_0x61b2('0x25')](function(_0x12f9d5){_0x4f56e7['rows']=_0x12f9d5;return _0x4f56e7;})[_0x61b2('0x25')](respondWithFilteredResult(_0x357657,_0x7bdcb0))[_0x61b2('0x3f')](handleError(_0x357657,null));};exports[_0x61b2('0x40')]=function(_0x12e8e7,_0x269c98){var _0x12ca35={'raw':!![],'where':{'id':_0x12e8e7[_0x61b2('0x41')]['id']}},_0x36fd30={};_0x36fd30['model']=_[_0x61b2('0x42')](db['VoiceTransferReport'][_0x61b2('0x2a')]);_0x36fd30['query']=_['keys'](_0x12e8e7[_0x61b2('0x31')]);_0x36fd30[_0x61b2('0x30')]=_['intersection'](_0x36fd30[_0x61b2('0x2e')],_0x36fd30['query']);_0x12ca35[_0x61b2('0x32')]=_[_0x61b2('0x33')](_0x36fd30[_0x61b2('0x2e')],qs[_0x61b2('0x34')](_0x12e8e7[_0x61b2('0x31')][_0x61b2('0x34')]));_0x12ca35[_0x61b2('0x32')]=_0x12ca35[_0x61b2('0x32')][_0x61b2('0x43')]?_0x12ca35[_0x61b2('0x32')]:_0x36fd30[_0x61b2('0x2e')];if(_0x12e8e7[_0x61b2('0x31')][_0x61b2('0x3d')]){_0x12ca35[_0x61b2('0x3e')]=[{'all':!![]}];}_0x12ca35=_['merge']({},_0x12ca35,_0x12e8e7[_0x61b2('0x3b')]);return db[_0x61b2('0x3c')][_0x61b2('0x44')](_0x12ca35)[_0x61b2('0x25')](handleEntityNotFound(_0x269c98,null))[_0x61b2('0x25')](respondWithResult(_0x269c98,null))[_0x61b2('0x3f')](handleError(_0x269c98,null));};exports['create']=function(_0x4b59be,_0x3ef6a4){return db[_0x61b2('0x3c')][_0x61b2('0x45')](_0x4b59be[_0x61b2('0x46')],{})[_0x61b2('0x25')](respondWithResult(_0x3ef6a4,0xc9))['catch'](handleError(_0x3ef6a4,null));};exports['update']=function(_0x3f414e,_0x16ede8){if(_0x3f414e[_0x61b2('0x46')]['id']){delete _0x3f414e[_0x61b2('0x46')]['id'];}return db[_0x61b2('0x3c')][_0x61b2('0x44')]({'where':{'id':_0x3f414e[_0x61b2('0x41')]['id']}})[_0x61b2('0x25')](handleEntityNotFound(_0x16ede8,null))[_0x61b2('0x25')](saveUpdates(_0x3f414e[_0x61b2('0x46')],null))[_0x61b2('0x25')](respondWithResult(_0x16ede8,null))[_0x61b2('0x3f')](handleError(_0x16ede8,null));};exports['destroy']=function(_0x467f11,_0x5553ef){return db['VoiceTransferReport'][_0x61b2('0x44')]({'where':{'id':_0x467f11['params']['id']}})[_0x61b2('0x25')](handleEntityNotFound(_0x5553ef,null))[_0x61b2('0x25')](removeEntity(_0x5553ef,null))[_0x61b2('0x3f')](handleError(_0x5553ef,null));};exports[_0x61b2('0x47')]=function(_0x3e38af,_0x5a1970){return db['VoiceTransferReport'][_0x61b2('0x47')]()[_0x61b2('0x25')](respondWithResult(_0x5a1970,null))[_0x61b2('0x3f')](handleError(_0x5a1970,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 48955b2..8bdcd99 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 _0x3039=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x124ec4,_0x31307d){var _0x2a82fd=function(_0x5140dd){while(--_0x5140dd){_0x124ec4['push'](_0x124ec4['shift']());}};_0x2a82fd(++_0x31307d);}(_0x3039,0x19b));var _0x9303=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3039[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9303('0x0'));var util=require(_0x9303('0x1'));var logger=require(_0x9303('0x2'))(_0x9303('0x3'));var moment=require(_0x9303('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9303('0x5'));var rimraf=require(_0x9303('0x6'));var config=require(_0x9303('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x9303('0x8')]=function(_0x57f3bf,_0xe62948){return _0x57f3bf[_0x9303('0x9')](_0x9303('0xa'),attributes,{'tableName':_0x9303('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x065e=['request-promise','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x287e1f,_0x4afc9e){var _0x5b6e01=function(_0x11e948){while(--_0x11e948){_0x287e1f['push'](_0x287e1f['shift']());}};_0x5b6e01(++_0x4afc9e);}(_0x065e,0x1be));var _0xe065=function(_0x5265d5,_0x51a837){_0x5265d5=_0x5265d5-0x0;var _0x44899d=_0x065e[_0x5265d5];return _0x44899d;};'use strict';var _=require(_0xe065('0x0'));var util=require(_0xe065('0x1'));var logger=require(_0xe065('0x2'))(_0xe065('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe065('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe065('0x5'));var config=require('../../config/environment');var attributes=require(_0xe065('0x6'));module[_0xe065('0x7')]=function(_0x59c1dc,_0x43e124){return _0x59c1dc[_0xe065('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xe065('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 62a1003..c45707b 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 _0xe298=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c825d,_0x10ec2b){var _0x43de87=function(_0xcab4a3){while(--_0xcab4a3){_0x4c825d['push'](_0x4c825d['shift']());}};_0x43de87(++_0x10ec2b);}(_0xe298,0x1c5));var _0x8e29=function(_0x322ef6,_0x42685a){_0x322ef6=_0x322ef6-0x0;var _0x5d3a12=_0xe298[_0x322ef6];return _0x5d3a12;};'use strict';var _=require(_0x8e29('0x0'));var util=require(_0x8e29('0x1'));var moment=require('moment');var BPromise=require(_0x8e29('0x2'));var rs=require(_0x8e29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e29('0x4'))['db'];var utils=require(_0x8e29('0x5'));var logger=require('../../config/logger')(_0x8e29('0x6'));var config=require(_0x8e29('0x7'));var jayson=require(_0x8e29('0x8'));var client=jayson[_0x8e29('0x9')][_0x8e29('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f83d,_0x16358e,_0x1d1096){return new BPromise(function(_0x21943c,_0x13b507){return client[_0x8e29('0xb')](_0x47f83d,_0x1d1096)[_0x8e29('0xc')](function(_0x123ab9){logger[_0x8e29('0xd')](_0x8e29('0xe'),_0x16358e,_0x8e29('0xf'));logger[_0x8e29('0x10')](_0x8e29('0x11'),_0x16358e,_0x8e29('0xf'),JSON[_0x8e29('0x12')](_0x123ab9));if(_0x123ab9[_0x8e29('0x13')]){if(_0x123ab9['error'][_0x8e29('0x14')]===0x1f4){logger[_0x8e29('0x13')](_0x8e29('0xe'),_0x16358e,_0x123ab9['error'][_0x8e29('0x15')]);return _0x13b507(_0x123ab9[_0x8e29('0x13')]['message']);}logger[_0x8e29('0x13')](_0x8e29('0xe'),_0x16358e,_0x123ab9[_0x8e29('0x13')][_0x8e29('0x15')]);return _0x21943c(_0x123ab9['error'][_0x8e29('0x15')]);}else{logger[_0x8e29('0xd')](_0x8e29('0xe'),_0x16358e,_0x8e29('0xf'));_0x21943c(_0x123ab9[_0x8e29('0x16')][_0x8e29('0x15')]);}})[_0x8e29('0x17')](function(_0x2e274a){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x16358e,_0x2e274a);_0x13b507(_0x2e274a);});});}exports[_0x8e29('0x18')]=function(_0x2bced9){var _0x458bb7=this;return new Promise(function(_0x55b6ca,_0x498a59){return db[_0x8e29('0x19')][_0x8e29('0x1a')](_0x2bced9[_0x8e29('0x1b')],{'raw':_0x2bced9[_0x8e29('0x1c')]?_0x2bced9[_0x8e29('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3bafe7){logger[_0x8e29('0xd')]('CreateVoiceTransferReport',_0x2bced9);logger[_0x8e29('0x10')](_0x8e29('0x18'),_0x2bced9,JSON['stringify'](_0x3bafe7));_0x55b6ca(_0x3bafe7);})['catch'](function(_0x289eef){logger['error']('CreateVoiceTransferReport',_0x289eef[_0x8e29('0x15')],_0x2bced9);_0x498a59(_0x458bb7[_0x8e29('0x13')](0x1f4,_0x289eef[_0x8e29('0x15')]));});});}; \ No newline at end of file +var _0xddf8=['options','raw','CreateVoiceTransferReport','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceTransferReport','body'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xddf8,0x19a));var _0x8ddf=function(_0x2fe0b5,_0x399055){_0x2fe0b5=_0x2fe0b5-0x0;var _0x27af80=_0xddf8[_0x2fe0b5];return _0x27af80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ddf('0x0'));var BPromise=require(_0x8ddf('0x1'));var rs=require(_0x8ddf('0x2'));var fs=require('fs');var Redis=require(_0x8ddf('0x3'));var db=require(_0x8ddf('0x4'))['db'];var utils=require(_0x8ddf('0x5'));var logger=require(_0x8ddf('0x6'))(_0x8ddf('0x7'));var config=require(_0x8ddf('0x8'));var jayson=require(_0x8ddf('0x9'));var client=jayson['client'][_0x8ddf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35fc93,_0x2e0c36,_0x259682){return new BPromise(function(_0x169007,_0x51428d){return client[_0x8ddf('0xb')](_0x35fc93,_0x259682)[_0x8ddf('0xc')](function(_0x222dc3){logger[_0x8ddf('0xd')](_0x8ddf('0xe'),_0x2e0c36,_0x8ddf('0xf'));logger[_0x8ddf('0x10')](_0x8ddf('0x11'),_0x2e0c36,_0x8ddf('0xf'),JSON['stringify'](_0x222dc3));if(_0x222dc3[_0x8ddf('0x12')]){if(_0x222dc3[_0x8ddf('0x12')][_0x8ddf('0x13')]===0x1f4){logger[_0x8ddf('0x12')](_0x8ddf('0xe'),_0x2e0c36,_0x222dc3[_0x8ddf('0x12')]['message']);return _0x51428d(_0x222dc3[_0x8ddf('0x12')][_0x8ddf('0x14')]);}logger[_0x8ddf('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e0c36,_0x222dc3['error'][_0x8ddf('0x14')]);return _0x169007(_0x222dc3[_0x8ddf('0x12')][_0x8ddf('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2e0c36,'request\x20sent');_0x169007(_0x222dc3[_0x8ddf('0x15')][_0x8ddf('0x14')]);}})[_0x8ddf('0x16')](function(_0x27ba68){logger[_0x8ddf('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e0c36,_0x27ba68);_0x51428d(_0x27ba68);});});}exports['CreateVoiceTransferReport']=function(_0x448512){var _0x385f07=this;return new Promise(function(_0x82b428,_0x3f28dc){return db[_0x8ddf('0x17')]['create'](_0x448512[_0x8ddf('0x18')],{'raw':_0x448512[_0x8ddf('0x19')]?_0x448512[_0x8ddf('0x19')][_0x8ddf('0x1a')]===undefined?!![]:![]:!![]})[_0x8ddf('0xc')](function(_0x163cf8){logger[_0x8ddf('0xd')]('CreateVoiceTransferReport',_0x448512);logger['debug'](_0x8ddf('0x1b'),_0x448512,JSON[_0x8ddf('0x1c')](_0x163cf8));_0x82b428(_0x163cf8);})[_0x8ddf('0x16')](function(_0x4847ed){logger[_0x8ddf('0x12')](_0x8ddf('0x1b'),_0x4847ed[_0x8ddf('0x14')],_0x448512);_0x3f28dc(_0x385f07[_0x8ddf('0x12')](0x1f4,_0x4847ed[_0x8ddf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b845493..dd2ed01 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 _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0x5eb83e,_0x386039){var _0x2ba972=function(_0x324087){while(--_0x324087){_0x5eb83e['push'](_0x5eb83e['shift']());}};_0x2ba972(++_0x386039);}(_0xb821,0xa7));var _0x1b82=function(_0x3f5ef4,_0x2c7e3d){_0x3f5ef4=_0x3f5ef4-0x0;var _0x2bd9e7=_0xb821[_0x3f5ef4];return _0x2bd9e7;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);module['exports']=router; \ No newline at end of file +var _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x70e0,0x17b));var _0x070e=function(_0x7b1496,_0x46f363){_0x7b1496=_0x7b1496-0x0;var _0x4ee160=_0x70e0[_0x7b1496];return _0x4ee160;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ed8a092..b43c44f 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 _0x0a9a=['hold\x20executed!','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','body','length','status','json','userId','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','answer','format','webbar:answer','answer\x20executed!','hold','hold\x20fired:'];(function(_0x4af3bc,_0x500ff8){var _0x5f1111=function(_0x53fc6a){while(--_0x53fc6a){_0x4af3bc['push'](_0x4af3bc['shift']());}};_0x5f1111(++_0x500ff8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x142345,_0x58d9d0){_0x142345=_0x142345-0x0;var _0x592f4f=_0x0a9a[_0x142345];return _0x592f4f;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xa0a9('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xa0a9('0x1'));var util=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var jayson=require(_0xa0a9('0x4'));var amiClient=jayson['client'][_0xa0a9('0x5')]({'port':0x232a});var logger=require(_0xa0a9('0x6'))('webbarapi');var Redis=require(_0xa0a9('0x7'));config[_0xa0a9('0x8')]=_[_0xa0a9('0x9')](config[_0xa0a9('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa0a9('0xa'))(new Redis(config['redis']));var Schema=require(_0xa0a9('0xb'));var originateValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'callNumber':{'type':_0xa0a9('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa0a9('0xe')},'callbackUrl':{'type':_0xa0a9('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':[!![],_0xa0a9('0xf')]},'transferNumber':{'type':_0xa0a9('0xe'),'required':[!![],_0xa0a9('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]},'sessionId':{'type':_0xa0a9('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],_0xa0a9('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa0a9('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x176faa,_0x48c315,_0x4a57dd){logger[_0xa0a9('0x11')](_0x176faa,_0x48c315,JSON[_0xa0a9('0x12')](_0x4a57dd));io['to'](_0x176faa)[_0xa0a9('0x13')](_0x48c315,_0x4a57dd);}function handleError(_0x16c3e3){return function(_0x568409){console[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x568409,_0x568409 instanceof RangeError);logger[_0xa0a9('0x16')](_0x568409[_0xa0a9('0x17')]);if(_0x568409 instanceof RangeError){if(_0x568409[_0xa0a9('0x18')]){delete _0x568409[_0xa0a9('0x18')];}_0x16c3e3['status'](0x194)[_0xa0a9('0x19')](_0x568409);}else{if(_0x568409[_0xa0a9('0x18')]){delete _0x568409['name'];}_0x16c3e3['status'](0x1f4)[_0xa0a9('0x19')](_0x568409);}};}function checkError(){return function(_0x1f6955){if(!_0x1f6955){throw new RangeError(_0xa0a9('0x1a'));}return _0x1f6955;};}function respondWithRpcPromise(_0x54a9a9,_0x307d7e){return new BPromise(function(_0x4e6f4c,_0x1fb36b){var _0x5e6148=amiClient;return _0x5e6148[_0xa0a9('0x1b')](_0x54a9a9,_0x307d7e)[_0xa0a9('0x1c')](function(_0x2f0b14){if(_0x2f0b14[_0xa0a9('0x16')]){if(_0x2f0b14['error'][_0xa0a9('0x1d')]===0x1f4){return _0x1fb36b(_0x2f0b14['error'][_0xa0a9('0x1e')]);}return _0x4e6f4c(_0x2f0b14[_0xa0a9('0x16')][_0xa0a9('0x1e')]);}else{_0x4e6f4c(_0x2f0b14[_0xa0a9('0x1f')]);}})['catch'](function(_0x7c1502){_0x1fb36b(_0x7c1502);});});}function getAgent(_0xe49d3b){return db[_0xa0a9('0x20')][_0xa0a9('0x21')]({'where':{'id':_0xe49d3b,'role':'agent'}})[_0xa0a9('0x1c')](checkError());}function getAgentCheckSession(_0x38e454,_0x2eae30){return new BPromise(function(_0x5c446e,_0x54125d){var _0x2b3cbb=respondWithRpcPromise(_0xa0a9('0x22'));var _0x10bbfd=getAgent(_0x38e454);Promise[_0xa0a9('0x23')]([_0x2b3cbb,_0x10bbfd])[_0xa0a9('0x1c')](function(_0xe218ff){var _0x2386c9=_0xe218ff[0x0];var _0x24e744=_0xe218ff[0x1];var _0xc6a4=_[_0xa0a9('0x24')](_0x2386c9[_0xa0a9('0x25')],function(_0x554191){return _0x554191[_0xa0a9('0x26')]==_0x24e744['id']&&_0x554191[_0xa0a9('0x27')]==_0x2eae30;});if(_0xc6a4['length']==0x1){_0x5c446e(_0x24e744);}else{_0x54125d(new RangeError(_0xa0a9('0x28')+_0x2eae30+_0xa0a9('0x29')));}});});}exports['originate']=function(_0x47c19b,_0x45374e){logger['info']('originate\x20fired:',_0x47c19b[_0xa0a9('0x2a')]);var _0x104936=originateValidation[_0xa0a9('0xb')](_0x47c19b[_0xa0a9('0x2a')]);if(_0x104936[_0xa0a9('0x2b')]>0x0){return _0x45374e[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x104936);}var _0x4bbcc2=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x539807=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x2f')];var _0x2363e6=_0x47c19b['body']['callerId'];var _0x3b1a11=_0x47c19b[_0xa0a9('0x2a')][_0xa0a9('0x30')];return getAgent(_0x4bbcc2)[_0xa0a9('0x1c')](function(_0x520817){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x520817[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x520817[_0xa0a9('0x18')]),_0xa0a9('0x33'),{'callNumber':_0x539807,'callerId':_0x2363e6,'callbackUrl':_0x3b1a11});return _0x45374e['status'](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x34')});})[_0xa0a9('0x35')](handleError(_0x45374e));};exports[_0xa0a9('0x36')]=function(_0x2e11dc,_0x1d6bae){logger[_0xa0a9('0x11')](_0xa0a9('0x37'),_0x2e11dc[_0xa0a9('0x2a')]);var _0x2ea301=hangupValidation[_0xa0a9('0xb')](_0x2e11dc[_0xa0a9('0x2a')]);if(_0x2ea301[_0xa0a9('0x2b')]>0x0){return _0x1d6bae[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x2ea301);}var _0x1b1aff=_0x2e11dc[_0xa0a9('0x2a')]['userId'];var _0x3f1e4f=_0x2e11dc[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1b1aff)['then'](function(_0x757e10){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x757e10[_0xa0a9('0x18')]);emit(util['format'](_0xa0a9('0x32'),_0x757e10[_0xa0a9('0x18')]),_0xa0a9('0x38'),{'sessionId':_0x3f1e4f});return _0x1d6bae[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0xa0a9('0x35')](handleError(_0x1d6bae));};exports[_0xa0a9('0x39')]=function(_0x39c02a,_0x32d926){logger[_0xa0a9('0x11')]('answer\x20fired:',_0x39c02a[_0xa0a9('0x2a')]);var _0x11c130=answerValidation[_0xa0a9('0xb')](_0x39c02a[_0xa0a9('0x2a')]);if(_0x11c130[_0xa0a9('0x2b')]>0x0){return _0x32d926['status'](0x190)[_0xa0a9('0x2d')](_0x11c130);}var _0x1c8760=_0x39c02a['body']['userId'];var _0x41cd22=_0x39c02a[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x1c8760)[_0xa0a9('0x1c')](function(_0x4a128f){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x4a128f[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x4a128f[_0xa0a9('0x18')]),_0xa0a9('0x3b'),{'sessionId':_0x41cd22});return _0x32d926[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3c')});})[_0xa0a9('0x35')](handleError(_0x32d926));};exports[_0xa0a9('0x3d')]=function(_0x2fcc76,_0x3bb0fb){logger[_0xa0a9('0x11')](_0xa0a9('0x3e'),_0x2fcc76[_0xa0a9('0x2a')]);var _0x54e917=holdValidation[_0xa0a9('0xb')](_0x2fcc76['body']);if(_0x54e917[_0xa0a9('0x2b')]>0x0){return _0x3bb0fb[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x54e917);}var _0x132eca=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x38cb0d=_0x2fcc76[_0xa0a9('0x2a')][_0xa0a9('0x27')];return getAgent(_0x132eca)['then'](function(_0x5d4162){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5d4162['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5d4162[_0xa0a9('0x18')]),'webbar:hold',{'sessionId':_0x38cb0d});return _0x3bb0fb[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x3f')});})[_0xa0a9('0x35')](handleError(_0x3bb0fb));};exports['unhold']=function(_0x398501,_0x45db88){logger[_0xa0a9('0x11')](_0xa0a9('0x40'),_0x398501[_0xa0a9('0x2a')]);var _0x41128b=unholdValidation[_0xa0a9('0xb')](_0x398501['body']);if(_0x41128b[_0xa0a9('0x2b')]>0x0){return _0x45db88[_0xa0a9('0x2c')](0x190)['json'](_0x41128b);}var _0x2cbd5e=_0x398501[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x506168=_0x398501['body'][_0xa0a9('0x27')];return getAgent(_0x2cbd5e)[_0xa0a9('0x1c')](function(_0x3f67ac){logger[_0xa0a9('0x11')]('entityFound:',_0x3f67ac['name']);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x3f67ac['name']),'webbar:unhold',{'sessionId':_0x506168});return _0x45db88[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x41')});})[_0xa0a9('0x35')](handleError(_0x45db88));};exports[_0xa0a9('0x42')]=function(_0x361bf1,_0x24af09){logger[_0xa0a9('0x11')](_0xa0a9('0x43'),_0x24af09[_0xa0a9('0x2a')]);var _0x2da124=callsValidation['validate'](_0x361bf1[_0xa0a9('0x2a')]);if(_0x2da124[_0xa0a9('0x2b')]>0x0){return _0x24af09[_0xa0a9('0x2c')](0x190)['json'](_0x2da124);}var _0x426ddc=_0x361bf1[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x4a1912=respondWithRpcPromise(_0xa0a9('0x22'));var _0x18893f=getAgent(_0x426ddc);return Promise[_0xa0a9('0x23')]([_0x4a1912,_0x18893f])[_0xa0a9('0x1c')](function(_0x3d47b3){var _0x47107f=_0x3d47b3[0x0];var _0x12f97d=_0x3d47b3[0x1];var _0x577c1f=_[_0xa0a9('0x24')](_0x47107f[_0xa0a9('0x25')],function(_0x3f6ef4){return _0x3f6ef4[_0xa0a9('0x26')]==_0x12f97d['id'];});return _0x24af09[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'count':_0x577c1f[_0xa0a9('0x2b')],'rows':_0x577c1f});})['catch'](handleError(_0x24af09));};exports['conference']=function(_0x4a2307,_0x40d0f5){logger['info'](_0xa0a9('0x44'),_0x4a2307['body']);var _0x349f1b=conferenceValidation[_0xa0a9('0xb')](_0x4a2307[_0xa0a9('0x2a')]);if(_0x349f1b[_0xa0a9('0x2b')]>0x0){return _0x40d0f5[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x349f1b);}var _0x1c7191=_0x4a2307[_0xa0a9('0x2a')]['userId'];return getAgent(_0x1c7191)['then'](function(_0x471e1a){logger['info'](_0xa0a9('0x31'),_0x471e1a[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')]('user:%s',_0x471e1a[_0xa0a9('0x18')]),'webbar:conference');return _0x40d0f5[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x45')});})['catch'](handleError(_0x40d0f5));};exports[_0xa0a9('0x46')]=function(_0x478b4e,_0x2648e4){logger['info'](_0xa0a9('0x47'),_0x478b4e['body']);var _0x662a0=transferValidation[_0xa0a9('0xb')](_0x478b4e[_0xa0a9('0x2a')]);if(_0x662a0[_0xa0a9('0x2b')]>0x0){return _0x2648e4[_0xa0a9('0x2c')](0x190)[_0xa0a9('0x2d')](_0x662a0);}var _0x4cc06d=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x2e')];var _0x2e6d3f=_0x478b4e['body'][_0xa0a9('0x27')];var _0x184b0e=_0x478b4e[_0xa0a9('0x2a')][_0xa0a9('0x48')];return getAgent(_0x4cc06d)[_0xa0a9('0x1c')](function(_0x5581c7){logger[_0xa0a9('0x11')](_0xa0a9('0x31'),_0x5581c7[_0xa0a9('0x18')]);emit(util[_0xa0a9('0x3a')](_0xa0a9('0x32'),_0x5581c7[_0xa0a9('0x18')]),_0xa0a9('0x49'),{'sessionId':_0x2e6d3f,'transferNumber':_0x184b0e});return _0x2648e4[_0xa0a9('0x2c')](0xc8)[_0xa0a9('0x2d')]({'error':![],'message':_0xa0a9('0x4a')});})['catch'](handleError(_0x2648e4));}; \ No newline at end of file +var _0x16d2=['localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','then','error','code','message','findOne','agent','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','hangup','hangup\x20fired:','validate','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','catch','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults'];(function(_0x2797c6,_0x37421b){var _0x54809f=function(_0x2d100c){while(--_0x2d100c){_0x2797c6['push'](_0x2797c6['shift']());}};_0x54809f(++_0x37421b);}(_0x16d2,0x123));var _0x216d=function(_0x1a1ebc,_0x142e7e){_0x1a1ebc=_0x1a1ebc-0x0;var _0x1932fc=_0x16d2[_0x1a1ebc];return _0x1932fc;};'use strict';var path=require(_0x216d('0x0'));var fs=require('fs');var _=require(_0x216d('0x1'));var db=require(_0x216d('0x2'))['db'];var config=require(_0x216d('0x3'));var util=require(_0x216d('0x4'));var BPromise=require(_0x216d('0x5'));var jayson=require(_0x216d('0x6'));var amiClient=jayson[_0x216d('0x7')][_0x216d('0x8')]({'port':0x232a});var logger=require('../../config/logger')(_0x216d('0x9'));var Redis=require(_0x216d('0xa'));config[_0x216d('0xb')]=_[_0x216d('0xc')](config[_0x216d('0xb')],{'host':_0x216d('0xd'),'port':0x18eb});var io=require(_0x216d('0xe'))(new Redis(config[_0x216d('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'callNumber':{'type':_0x216d('0x11'),'required':[!![],_0x216d('0x12')]},'callerId':{'type':_0x216d('0x11')},'callbackUrl':{'type':_0x216d('0x11')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':_0x216d('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':_0x216d('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x216d('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x216d('0xf'),'required':[!![],_0x216d('0x10')]}});function emit(_0x4631b0,_0x23ff86,_0x3e5585){logger[_0x216d('0x13')](_0x4631b0,_0x23ff86,JSON[_0x216d('0x14')](_0x3e5585));io['to'](_0x4631b0)[_0x216d('0x15')](_0x23ff86,_0x3e5585);}function handleError(_0x19fdac){return function(_0x53d464){console[_0x216d('0x16')]('handleError:',_0x53d464,_0x53d464 instanceof RangeError);logger['error'](_0x53d464[_0x216d('0x17')]);if(_0x53d464 instanceof RangeError){if(_0x53d464[_0x216d('0x18')]){delete _0x53d464['name'];}_0x19fdac[_0x216d('0x19')](0x194)[_0x216d('0x1a')](_0x53d464);}else{if(_0x53d464['name']){delete _0x53d464[_0x216d('0x18')];}_0x19fdac[_0x216d('0x19')](0x1f4)[_0x216d('0x1a')](_0x53d464);}};}function checkError(){return function(_0x3e9818){if(!_0x3e9818){throw new RangeError('NotFound');}return _0x3e9818;};}function respondWithRpcPromise(_0x20ee7c,_0x294bbf){return new BPromise(function(_0x10f299,_0x438981){var _0x206782=amiClient;return _0x206782['request'](_0x20ee7c,_0x294bbf)[_0x216d('0x1b')](function(_0x1bd4db){if(_0x1bd4db[_0x216d('0x1c')]){if(_0x1bd4db[_0x216d('0x1c')][_0x216d('0x1d')]===0x1f4){return _0x438981(_0x1bd4db['error'][_0x216d('0x1e')]);}return _0x10f299(_0x1bd4db[_0x216d('0x1c')][_0x216d('0x1e')]);}else{_0x10f299(_0x1bd4db['result']);}})['catch'](function(_0x56460f){_0x438981(_0x56460f);});});}function getAgent(_0x4c792e){return db['User'][_0x216d('0x1f')]({'where':{'id':_0x4c792e,'role':_0x216d('0x20')}})[_0x216d('0x1b')](checkError());}function getAgentCheckSession(_0x73b509,_0x46d0ef){return new BPromise(function(_0x47fa6d,_0x5b21d8){var _0xa7624a=respondWithRpcPromise('VoiceChannels');var _0x23d1c3=getAgent(_0x73b509);Promise[_0x216d('0x21')]([_0xa7624a,_0x23d1c3])[_0x216d('0x1b')](function(_0x20bc16){var _0x307f2b=_0x20bc16[0x0];var _0x12bcab=_0x20bc16[0x1];var _0x28fcc2=_[_0x216d('0x22')](_0x307f2b[_0x216d('0x23')],function(_0x28f56a){return _0x28f56a[_0x216d('0x24')]==_0x12bcab['id']&&_0x28f56a[_0x216d('0x25')]==_0x46d0ef;});if(_0x28fcc2[_0x216d('0x26')]==0x1){_0x47fa6d(_0x12bcab);}else{_0x5b21d8(new RangeError('sessionId\x20'+_0x46d0ef+_0x216d('0x27')));}});});}exports[_0x216d('0x28')]=function(_0x37e8e6,_0x510ad9){logger[_0x216d('0x13')](_0x216d('0x29'),_0x37e8e6[_0x216d('0x2a')]);var _0xeff234=originateValidation['validate'](_0x37e8e6[_0x216d('0x2a')]);if(_0xeff234[_0x216d('0x26')]>0x0){return _0x510ad9[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0xeff234);}var _0x14d417=_0x37e8e6[_0x216d('0x2a')][_0x216d('0x2c')];var _0x35d4d2=_0x37e8e6[_0x216d('0x2a')][_0x216d('0x2d')];var _0x6eda4=_0x37e8e6['body'][_0x216d('0x2e')];var _0x451c4d=_0x37e8e6[_0x216d('0x2a')]['callbackUrl'];return getAgent(_0x14d417)[_0x216d('0x1b')](function(_0x2e86f9){logger['info'](_0x216d('0x2f'),_0x2e86f9['name']);emit(util['format'](_0x216d('0x30'),_0x2e86f9[_0x216d('0x18')]),_0x216d('0x31'),{'callNumber':_0x35d4d2,'callerId':_0x6eda4,'callbackUrl':_0x451c4d});return _0x510ad9[_0x216d('0x19')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x510ad9));};exports[_0x216d('0x32')]=function(_0x38972e,_0x47e006){logger[_0x216d('0x13')](_0x216d('0x33'),_0x38972e['body']);var _0xe49ba4=hangupValidation[_0x216d('0x34')](_0x38972e[_0x216d('0x2a')]);if(_0xe49ba4[_0x216d('0x26')]>0x0){return _0x47e006[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0xe49ba4);}var _0x35cb6e=_0x38972e[_0x216d('0x2a')]['userId'];var _0x4bc645=_0x38972e[_0x216d('0x2a')][_0x216d('0x25')];return getAgent(_0x35cb6e)['then'](function(_0xf33f9c){logger[_0x216d('0x13')](_0x216d('0x2f'),_0xf33f9c['name']);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0xf33f9c[_0x216d('0x18')]),_0x216d('0x36'),{'sessionId':_0x4bc645});return _0x47e006['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x37')});})['catch'](handleError(_0x47e006));};exports[_0x216d('0x38')]=function(_0x306e9f,_0x590eb6){logger['info'](_0x216d('0x39'),_0x306e9f[_0x216d('0x2a')]);var _0x3c491e=answerValidation['validate'](_0x306e9f[_0x216d('0x2a')]);if(_0x3c491e['length']>0x0){return _0x590eb6['status'](0x190)[_0x216d('0x2b')](_0x3c491e);}var _0x43336e=_0x306e9f[_0x216d('0x2a')]['userId'];var _0xaccf45=_0x306e9f['body'][_0x216d('0x25')];return getAgent(_0x43336e)[_0x216d('0x1b')](function(_0x842af2){logger['info'](_0x216d('0x2f'),_0x842af2[_0x216d('0x18')]);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0x842af2['name']),'webbar:answer',{'sessionId':_0xaccf45});return _0x590eb6['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x3a')});})[_0x216d('0x3b')](handleError(_0x590eb6));};exports[_0x216d('0x3c')]=function(_0x3344e3,_0x13f51c){logger[_0x216d('0x13')](_0x216d('0x3d'),_0x3344e3['body']);var _0x3771dc=holdValidation[_0x216d('0x34')](_0x3344e3[_0x216d('0x2a')]);if(_0x3771dc[_0x216d('0x26')]>0x0){return _0x13f51c['status'](0x190)[_0x216d('0x2b')](_0x3771dc);}var _0x542e1b=_0x3344e3[_0x216d('0x2a')][_0x216d('0x2c')];var _0xceb993=_0x3344e3['body']['sessionId'];return getAgent(_0x542e1b)[_0x216d('0x1b')](function(_0x32d499){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x32d499[_0x216d('0x18')]);emit(util[_0x216d('0x35')]('user:%s',_0x32d499['name']),_0x216d('0x3e'),{'sessionId':_0xceb993});return _0x13f51c['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x3f')});})['catch'](handleError(_0x13f51c));};exports['unhold']=function(_0x5f37e3,_0x4bac14){logger[_0x216d('0x13')](_0x216d('0x40'),_0x5f37e3[_0x216d('0x2a')]);var _0x216f44=unholdValidation[_0x216d('0x34')](_0x5f37e3[_0x216d('0x2a')]);if(_0x216f44[_0x216d('0x26')]>0x0){return _0x4bac14['status'](0x190)[_0x216d('0x2b')](_0x216f44);}var _0x34cdb9=_0x5f37e3[_0x216d('0x2a')]['userId'];var _0x1e1caf=_0x5f37e3[_0x216d('0x2a')][_0x216d('0x25')];return getAgent(_0x34cdb9)[_0x216d('0x1b')](function(_0x481754){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x481754[_0x216d('0x18')]);emit(util[_0x216d('0x35')]('user:%s',_0x481754[_0x216d('0x18')]),_0x216d('0x41'),{'sessionId':_0x1e1caf});return _0x4bac14['status'](0xc8)[_0x216d('0x2b')]({'error':![],'message':'unhold\x20executed!'});})[_0x216d('0x3b')](handleError(_0x4bac14));};exports[_0x216d('0x42')]=function(_0x22e025,_0xe65193){logger[_0x216d('0x13')](_0x216d('0x43'),_0xe65193[_0x216d('0x2a')]);var _0x2c6cb6=callsValidation[_0x216d('0x34')](_0x22e025['body']);if(_0x2c6cb6[_0x216d('0x26')]>0x0){return _0xe65193[_0x216d('0x19')](0x190)['json'](_0x2c6cb6);}var _0x241ce4=_0x22e025[_0x216d('0x2a')]['userId'];var _0x4edf77=respondWithRpcPromise(_0x216d('0x44'));var _0x5e4b3d=getAgent(_0x241ce4);return Promise[_0x216d('0x21')]([_0x4edf77,_0x5e4b3d])[_0x216d('0x1b')](function(_0x2c9b1f){var _0x590c4e=_0x2c9b1f[0x0];var _0x3acd4b=_0x2c9b1f[0x1];var _0x5112ea=_['filter'](_0x590c4e[_0x216d('0x23')],function(_0x38ee94){return _0x38ee94['UserId']==_0x3acd4b['id'];});return _0xe65193[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'count':_0x5112ea[_0x216d('0x26')],'rows':_0x5112ea});})[_0x216d('0x3b')](handleError(_0xe65193));};exports[_0x216d('0x45')]=function(_0xd723fc,_0x5276df){logger['info'](_0x216d('0x46'),_0xd723fc[_0x216d('0x2a')]);var _0x1ce36c=conferenceValidation[_0x216d('0x34')](_0xd723fc[_0x216d('0x2a')]);if(_0x1ce36c[_0x216d('0x26')]>0x0){return _0x5276df[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0x1ce36c);}var _0x3c01a4=_0xd723fc[_0x216d('0x2a')][_0x216d('0x2c')];return getAgent(_0x3c01a4)[_0x216d('0x1b')](function(_0x489bdd){logger['info'](_0x216d('0x2f'),_0x489bdd[_0x216d('0x18')]);emit(util['format'](_0x216d('0x30'),_0x489bdd['name']),'webbar:conference');return _0x5276df[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x47')});})[_0x216d('0x3b')](handleError(_0x5276df));};exports[_0x216d('0x48')]=function(_0x3847b6,_0xb00e58){logger[_0x216d('0x13')](_0x216d('0x49'),_0x3847b6[_0x216d('0x2a')]);var _0x1c08d9=transferValidation[_0x216d('0x34')](_0x3847b6[_0x216d('0x2a')]);if(_0x1c08d9[_0x216d('0x26')]>0x0){return _0xb00e58[_0x216d('0x19')](0x190)[_0x216d('0x2b')](_0x1c08d9);}var _0xb398cc=_0x3847b6[_0x216d('0x2a')][_0x216d('0x2c')];var _0x34540e=_0x3847b6[_0x216d('0x2a')][_0x216d('0x25')];var _0x5f04ba=_0x3847b6[_0x216d('0x2a')]['transferNumber'];return getAgent(_0xb398cc)[_0x216d('0x1b')](function(_0x51507b){logger[_0x216d('0x13')](_0x216d('0x2f'),_0x51507b['name']);emit(util[_0x216d('0x35')](_0x216d('0x30'),_0x51507b[_0x216d('0x18')]),_0x216d('0x4a'),{'sessionId':_0x34540e,'transferNumber':_0x5f04ba});return _0xb00e58[_0x216d('0x19')](0xc8)[_0x216d('0x2b')]({'error':![],'message':_0x216d('0x4b')});})[_0x216d('0x3b')](handleError(_0xb00e58));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 52fe884..2263aa0 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 _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x4c6109,_0x398504){var _0xc9384b=function(_0x2381af){while(--_0x2381af){_0x4c6109['push'](_0x4c6109['shift']());}};_0xc9384b(++_0x398504);}(_0x2a07,0x74));var _0x72a0=function(_0x575446,_0x1a13fa){_0x575446=_0x575446-0x0;var _0x2fb644=_0x2a07[_0x575446];return _0x2fb644;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['get'](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller['getDispositions']);router[_0x72a0('0xa')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x13')]);router[_0x72a0('0xa')]('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x14')]);router[_0x72a0('0xa')](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x16')]);router[_0x72a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x72a0('0x17')](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x18')]);router[_0x72a0('0x17')](_0x72a0('0x12'),auth['isAuthenticated'](),controller[_0x72a0('0x19')]);router[_0x72a0('0x17')](_0x72a0('0x1a'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1b')]);router['post'](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1c')]);router['post'](_0x72a0('0x1d'),controller[_0x72a0('0x1e')]);router[_0x72a0('0x17')](_0x72a0('0x1f'),auth['isAuthenticated'](),controller[_0x72a0('0x20')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x21')]);router['delete'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x22')]);router[_0x72a0('0x23')]('/:id/dispositions',auth[_0x72a0('0xb')](),controller[_0x72a0('0x24')]);router[_0x72a0('0x23')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x25')]);router['delete']('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x26')]);module[_0x72a0('0x27')]=router; \ No newline at end of file +var _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0xefc20,_0x7eff9d){var _0xfd0b66=function(_0x3671c6){while(--_0x3671c6){_0xefc20['push'](_0xefc20['shift']());}};_0xfd0b66(++_0x7eff9d);}(_0x14a0,0x8e));var _0x014a=function(_0x335dc8,_0x3dceeb){_0x335dc8=_0x335dc8-0x0;var _0x5e93d6=_0x14a0[_0x335dc8];return _0x5e93d6;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index ddadf09..6e56c0c 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 _0x03a3=['name','generate','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING'];(function(_0x10a12a,_0xee7529){var _0x1905af=function(_0x41c8b4){while(--_0x41c8b4){_0x10a12a['push'](_0x10a12a['shift']());}};_0x1905af(++_0xee7529);}(_0x03a3,0x14e));var _0x303a=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x03a3[_0x5806c3];return _0x48ac77;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x303a('0x0')]={'name':{'type':Sequelize[_0x303a('0x1')],'unique':_0x303a('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x303a('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x303a('0x1')],'defaultValue':function(){return rs[_0x303a('0x3')]();}},'phone':{'type':Sequelize[_0x303a('0x1')]},'type':{'type':Sequelize['ENUM']('twilio',_0x303a('0x4'))},'accountSid':{'type':Sequelize[_0x303a('0x1')]},'baseUrl':{'type':Sequelize[_0x303a('0x1')]},'authToken':{'type':Sequelize[_0x303a('0x1')]},'notificationTemplate':{'type':Sequelize[_0x303a('0x5')],'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['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x303a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x303a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x303a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x303a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x303a('0x7')],'comment':_0x303a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4ce51b){if(!_0x4ce51b){this[_0x303a('0x9')](_0x303a('0xa'),null);}this['setDataValue'](_0x303a('0xb'),_0x4ce51b);}},'description':{'type':Sequelize[_0x303a('0x1')]}}; \ No newline at end of file +var _0x068a=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x15915b,_0x3e3daa){var _0xe4747f=function(_0x3e82b7){while(--_0x3e82b7){_0x15915b['push'](_0x15915b['shift']());}};_0xe4747f(++_0x3e3daa);}(_0x068a,0xc6));var _0xa068=function(_0x5944e8,_0x556158){_0x5944e8=_0x5944e8-0x0;var _0xfc6c39=_0x068a[_0x5944e8];return _0xfc6c39;};'use strict';var Sequelize=require(_0xa068('0x0'));var rs=require('randomstring');module[_0xa068('0x1')]={'name':{'type':Sequelize[_0xa068('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa068('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa068('0x2')],'defaultValue':function(){return rs[_0xa068('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa068('0x4')]('twilio',_0xa068('0x5'))},'accountSid':{'type':Sequelize[_0xa068('0x2')]},'baseUrl':{'type':Sequelize[_0xa068('0x2')]},'authToken':{'type':Sequelize[_0xa068('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa068('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa068('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa068('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa068('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa068('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa068('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa068('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa068('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa068('0x7')],'defaultValue':![],'comment':_0xa068('0xa'),'set':function(_0x38f173){if(!_0x38f173){this[_0xa068('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0xa068('0xc'),_0x38f173);}},'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 e9e4ec6..d22defc 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 _0x0641=['../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','json','undefined','count','set','apply','reject','update','WhatsappAccounts','destroy','end','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','offset','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','Pause','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','WhatsappAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','pick','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','ValidationError','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','*,*,*,*','AttachmentId','User','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x17f9f4,_0x212dda){var _0x4dc32c=function(_0x1ed46d){while(--_0x1ed46d){_0x17f9f4['push'](_0x17f9f4['shift']());}};_0x4dc32c(++_0x212dda);}(_0x0641,0xb1));var _0x1064=function(_0x5ec06c,_0x4d27e7){_0x5ec06c=_0x5ec06c-0x0;var _0x2f95e6=_0x0641[_0x5ec06c];return _0x2f95e6;};'use strict';var emlformat=require(_0x1064('0x0'));var rimraf=require(_0x1064('0x1'));var zipdir=require(_0x1064('0x2'));var jsonpatch=require(_0x1064('0x3'));var rp=require(_0x1064('0x4'));var moment=require(_0x1064('0x5'));var BPromise=require(_0x1064('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1064('0x7'));var sox=require(_0x1064('0x8'));var csv=require('to-csv');var ejs=require(_0x1064('0x9'));var fs=require('fs');var fs_extra=require(_0x1064('0xa'));var _=require(_0x1064('0xb'));var squel=require(_0x1064('0xc'));var crypto=require(_0x1064('0xd'));var jsforce=require(_0x1064('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1064('0xf'));var querystring=require(_0x1064('0x10'));var Papa=require(_0x1064('0x11'));var Redis=require('ioredis');var authService=require(_0x1064('0x12'));var qs=require(_0x1064('0x13'));var as=require(_0x1064('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1064('0x15'))(_0x1064('0x16'));var utils=require(_0x1064('0x17'));var config=require(_0x1064('0x18'));var licenseUtil=require(_0x1064('0x19'));var db=require('../../mysqldb')['db'];config[_0x1064('0x1a')]=_['defaults'](config[_0x1064('0x1a')],{'host':_0x1064('0x1b'),'port':0x18eb});var socket=require(_0x1064('0x1c'))(new Redis(config[_0x1064('0x1a')]));require(_0x1064('0x1d'))[_0x1064('0x1e')](socket);var jayson=require(_0x1064('0x1f'));var client=jayson[_0x1064('0x20')][_0x1064('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2455df,_0x442d4f,_0x310a09,_0xf845a){return new BPromise(function(_0x11e5ea,_0x5093f8){var _0x5dda44=_0xf845a||client;return _0x5dda44[_0x1064('0x22')](_0x2455df,_0x310a09)[_0x1064('0x23')](function(_0x264ebc){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,'request\x20sent');logger[_0x1064('0x24')](_0x1064('0x25'),_0x442d4f,'request\x20sent',JSON[_0x1064('0x26')](_0x264ebc));if(_0x264ebc['error']){if(_0x264ebc[_0x1064('0x27')][_0x1064('0x28')]===0x1f4){logger[_0x1064('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0x264ebc['error']['message']);return _0x5093f8(_0x264ebc[_0x1064('0x27')][_0x1064('0x29')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0x264ebc[_0x1064('0x27')][_0x1064('0x29')]);return _0x11e5ea(_0x264ebc['error'][_0x1064('0x29')]);}else{logger[_0x1064('0x2a')](_0x1064('0x2b'),_0x442d4f,_0x1064('0x2c'));_0x11e5ea(_0x264ebc[_0x1064('0x2d')]['message']);}})[_0x1064('0x2e')](function(_0xb62ad4){logger[_0x1064('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x442d4f,_0xb62ad4);_0x5093f8(_0xb62ad4);});});}function respondWithStatusCode(_0x348912,_0x2439d3){_0x2439d3=_0x2439d3||0xcc;return function(_0x1711ad){if(_0x1711ad){return _0x348912[_0x1064('0x2f')](_0x2439d3);}return _0x348912[_0x1064('0x30')](_0x2439d3)['end']();};}function respondWithResult(_0x4c73ef,_0x3e36c9){_0x3e36c9=_0x3e36c9||0xc8;return function(_0x38b266){if(_0x38b266){return _0x4c73ef['status'](_0x3e36c9)[_0x1064('0x31')](_0x38b266);}};}function respondWithFilteredResult(_0x2dbba6,_0x45a8a7){return function(_0x23d82f){if(_0x23d82f){var _0x1c9c04=typeof _0x45a8a7['offset']===_0x1064('0x32')&&typeof _0x45a8a7['limit']===_0x1064('0x32');var _0x1477f4=_0x23d82f[_0x1064('0x33')];var _0x262404=_0x1c9c04?0x0:_0x45a8a7['offset'];var _0x14b201=_0x1c9c04?_0x23d82f['count']:_0x45a8a7['offset']+_0x45a8a7['limit'];var _0x29ad10;if(_0x14b201>=_0x1477f4){_0x14b201=_0x1477f4;_0x29ad10=0xc8;}else{_0x29ad10=0xce;}_0x2dbba6['status'](_0x29ad10);return _0x2dbba6[_0x1064('0x34')]('Content-Range',_0x262404+'-'+_0x14b201+'/'+_0x1477f4)['json'](_0x23d82f);}return null;};}function patchUpdates(_0x455265){return function(_0x5a548a){try{jsonpatch[_0x1064('0x35')](_0x5a548a,_0x455265,!![]);}catch(_0x3f6156){return BPromise[_0x1064('0x36')](_0x3f6156);}return _0x5a548a['save']();};}function saveUpdates(_0x3a9073,_0x21adbb){return function(_0x1fad57){if(_0x1fad57){return _0x1fad57[_0x1064('0x37')](_0x3a9073)['then'](function(_0x3dec31){return _0x3dec31;});}return null;};}function removeEntity(_0xfbd229,_0x210972){return function(_0x29ea45){if(_0x29ea45){return _0x29ea45['destroy']()[_0x1064('0x23')](function(){var _0x5cad88=_0x29ea45['get']({'plain':!![]});var _0x4f2bd7=_0x1064('0x38');return db['UserProfileResource'][_0x1064('0x39')]({'where':{'type':_0x4f2bd7,'resourceId':_0x5cad88['id']}})[_0x1064('0x23')](function(){return _0x29ea45;});})[_0x1064('0x23')](function(){_0xfbd229[_0x1064('0x30')](0xcc)[_0x1064('0x3a')]();});}};}function handleEntityNotFound(_0x3026b5,_0xa70cd){return function(_0x3d05e8){if(!_0x3d05e8){_0x3026b5[_0x1064('0x2f')](0x194);}return _0x3d05e8;};}function handleError(_0x48be8a,_0x31c869){_0x31c869=_0x31c869||0x1f4;return function(_0x27ae90){logger[_0x1064('0x27')](_0x27ae90[_0x1064('0x3b')]);if(_0x27ae90[_0x1064('0x3c')]){delete _0x27ae90[_0x1064('0x3c')];}_0x48be8a['status'](_0x31c869)[_0x1064('0x3d')](_0x27ae90);};}exports[_0x1064('0x3e')]=function(_0x396b0c,_0x1c385c){var _0x45c0fd={'include':[{'model':db['Pause'],'as':_0x1064('0x3f')}]},_0xcc66f0={},_0x52410b={'count':0x0,'rows':[]};var _0x512c64=_[_0x1064('0x40')](db[_0x1064('0x41')][_0x1064('0x42')],function(_0x15e592){return{'name':_0x15e592[_0x1064('0x43')],'type':_0x15e592[_0x1064('0x44')][_0x1064('0x45')]};});_0xcc66f0[_0x1064('0x46')]=_['map'](_0x512c64,_0x1064('0x3c'));_0xcc66f0[_0x1064('0x47')]=_[_0x1064('0x48')](_0x396b0c[_0x1064('0x47')]);_0xcc66f0[_0x1064('0x49')]=_[_0x1064('0x4a')](_0xcc66f0[_0x1064('0x46')],_0xcc66f0[_0x1064('0x47')]);_0x45c0fd[_0x1064('0x4b')]=_['intersection'](_0xcc66f0[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x396b0c['query'][_0x1064('0x4c')]));_0x45c0fd[_0x1064('0x4b')]=_0x45c0fd[_0x1064('0x4b')][_0x1064('0x4d')]?_0x45c0fd[_0x1064('0x4b')]:_0xcc66f0[_0x1064('0x46')];if(!_0x396b0c[_0x1064('0x47')][_0x1064('0x4e')]('nolimit')){_0x45c0fd['limit']=qs[_0x1064('0x4f')](_0x396b0c['query']['limit']);_0x45c0fd[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x396b0c[_0x1064('0x47')][_0x1064('0x50')]);}_0x45c0fd['order']=qs[_0x1064('0x51')](_0x396b0c[_0x1064('0x47')][_0x1064('0x51')]);_0x45c0fd[_0x1064('0x52')]=qs[_0x1064('0x49')](_['pick'](_0x396b0c[_0x1064('0x47')],_0xcc66f0[_0x1064('0x49')]),_0x512c64);if(_0x396b0c[_0x1064('0x47')][_0x1064('0x53')]){_0x45c0fd[_0x1064('0x52')]=_[_0x1064('0x54')](_0x45c0fd[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x512c64,function(_0x406c1e){if(_0x406c1e[_0x1064('0x44')]!==_0x1064('0x55')){var _0x17b962={};_0x17b962[_0x406c1e[_0x1064('0x3c')]]={'$like':'%'+_0x396b0c[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x17b962;}})});}_0x45c0fd=_[_0x1064('0x54')]({},_0x45c0fd,_0x396b0c[_0x1064('0x56')]);var _0x5c204f={'where':_0x45c0fd[_0x1064('0x52')]};return db['WhatsappAccount'][_0x1064('0x33')](_0x5c204f)[_0x1064('0x23')](function(_0x4283a1){_0x52410b[_0x1064('0x33')]=_0x4283a1;if(_0x396b0c['query'][_0x1064('0x57')]){_0x45c0fd['include']=[{'all':!![]}];}return db[_0x1064('0x41')][_0x1064('0x58')](_0x45c0fd);})['then'](function(_0x28894a){_0x52410b['rows']=_0x28894a;return _0x52410b;})[_0x1064('0x23')](respondWithFilteredResult(_0x1c385c,_0x45c0fd))[_0x1064('0x2e')](handleError(_0x1c385c,null));};exports[_0x1064('0x59')]=function(_0x2665dc,_0x419f18){var _0x145d75={'raw':![],'where':{'id':_0x2665dc['params']['id']},'include':[{'model':db[_0x1064('0x5a')],'as':_0x1064('0x3f')}]},_0x1ac938={};_0x1ac938[_0x1064('0x46')]=_[_0x1064('0x48')](db[_0x1064('0x41')][_0x1064('0x42')]);_0x1ac938['query']=_[_0x1064('0x48')](_0x2665dc[_0x1064('0x47')]);_0x1ac938['filters']=_[_0x1064('0x4a')](_0x1ac938[_0x1064('0x46')],_0x1ac938[_0x1064('0x47')]);_0x145d75['attributes']=_[_0x1064('0x4a')](_0x1ac938[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x2665dc[_0x1064('0x47')][_0x1064('0x4c')]));_0x145d75[_0x1064('0x4b')]=_0x145d75[_0x1064('0x4b')]['length']?_0x145d75['attributes']:_0x1ac938['model'];if(_0x2665dc[_0x1064('0x47')][_0x1064('0x57')]){_0x145d75[_0x1064('0x5b')]=[{'all':!![]}];}_0x145d75=_[_0x1064('0x54')]({},_0x145d75,_0x2665dc['options']);return db['WhatsappAccount'][_0x1064('0x5c')](_0x145d75)[_0x1064('0x23')](handleEntityNotFound(_0x419f18,null))['then'](respondWithResult(_0x419f18,null))['catch'](handleError(_0x419f18,null));};exports[_0x1064('0x5d')]=function(_0x5d678a,_0x15beb4){return db[_0x1064('0x41')][_0x1064('0x5d')](_0x5d678a[_0x1064('0x5e')],{})[_0x1064('0x23')](function(_0x4351a6){var _0x398887=_0x5d678a[_0x1064('0x5f')][_0x1064('0x60')]({'plain':!![]});if(!_0x398887)throw new Error(_0x1064('0x61'));if(_0x398887[_0x1064('0x62')]===_0x1064('0x5f')){var _0xb6ba7a=_0x4351a6['get']({'plain':!![]});var _0x5b1860='WhatsappAccounts';return db[_0x1064('0x63')][_0x1064('0x5c')]({'where':{'name':_0x5b1860,'userProfileId':_0x398887[_0x1064('0x64')]},'raw':!![]})[_0x1064('0x23')](function(_0x4d473d){if(_0x4d473d&&_0x4d473d['autoAssociation']===0x0){return db[_0x1064('0x65')][_0x1064('0x5d')]({'name':_0xb6ba7a[_0x1064('0x3c')],'resourceId':_0xb6ba7a['id'],'type':_0x4d473d['name'],'sectionId':_0x4d473d['id']},{})[_0x1064('0x23')](function(){return _0x4351a6;});}else{return _0x4351a6;}})['catch'](function(_0x41c246){logger['error'](_0x1064('0x66'),_0x41c246);throw _0x41c246;});}return _0x4351a6;})[_0x1064('0x23')](respondWithResult(_0x15beb4,0xc9))[_0x1064('0x2e')](handleError(_0x15beb4,null));};exports[_0x1064('0x37')]=function(_0x11d186,_0x2db68f){if(_0x11d186[_0x1064('0x5e')]['id']){delete _0x11d186['body']['id'];}return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x11d186['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1064('0x23')](handleEntityNotFound(_0x2db68f,null))[_0x1064('0x23')](saveUpdates(_0x11d186['body'],null))[_0x1064('0x23')](respondWithResult(_0x2db68f,null))[_0x1064('0x2e')](handleError(_0x2db68f,null));};exports['destroy']=function(_0x389be6,_0x7bc961){return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x389be6['params']['id']}})['then'](handleEntityNotFound(_0x7bc961,null))[_0x1064('0x23')](removeEntity(_0x7bc961,null))[_0x1064('0x2e')](handleError(_0x7bc961,null));};exports['describe']=function(_0x129f22,_0x1146c8){return db[_0x1064('0x41')][_0x1064('0x67')]()['then'](respondWithResult(_0x1146c8,null))[_0x1064('0x2e')](handleError(_0x1146c8,null));};exports[_0x1064('0x68')]=function(_0x26ce59,_0xe6026d,_0x153b86){if(_0x26ce59['body']['id']){delete _0x26ce59[_0x1064('0x5e')]['id'];}return db[_0x1064('0x41')]['find']({'where':{'id':_0x26ce59[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0xe6026d,null))[_0x1064('0x23')](function(_0x1da9fd){if(_0x1da9fd){_0x26ce59['body'][_0x1064('0x6a')]=_0x1da9fd['id'];return db[_0x1064('0x6b')][_0x1064('0x5d')](_0x26ce59['body']);}})['then'](respondWithResult(_0xe6026d,null))[_0x1064('0x2e')](handleError(_0xe6026d,null));};exports[_0x1064('0x6c')]=function(_0x55b23d,_0x241521,_0x45c4ab){var _0x54dd02={'raw':![],'where':{}};var _0x4a1301={};var _0x1127b7={'count':0x0,'rows':[]};return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x55b23d['params']['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x241521,null))[_0x1064('0x23')](function(_0x11a18e){if(_0x11a18e){_0x4a1301[_0x1064('0x46')]=_[_0x1064('0x48')](db['Disposition'][_0x1064('0x42')]);_0x4a1301['query']=_['keys'](_0x55b23d[_0x1064('0x47')]);_0x4a1301[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x4a1301[_0x1064('0x46')],_0x4a1301['query']);_0x54dd02[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x4a1301[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x55b23d[_0x1064('0x47')][_0x1064('0x4c')]));_0x54dd02[_0x1064('0x4b')]=_0x54dd02[_0x1064('0x4b')][_0x1064('0x4d')]?_0x54dd02[_0x1064('0x4b')]:_0x4a1301[_0x1064('0x46')];if(!_0x55b23d[_0x1064('0x47')][_0x1064('0x4e')]('nolimit')){_0x54dd02[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x55b23d[_0x1064('0x47')][_0x1064('0x4f')]);_0x54dd02[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x55b23d[_0x1064('0x47')][_0x1064('0x50')]);}_0x54dd02[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x55b23d[_0x1064('0x47')]['sort']);_0x54dd02['where']=qs[_0x1064('0x49')](_['pick'](_0x55b23d['query'],_0x4a1301[_0x1064('0x49')]));_0x54dd02['where'][_0x1064('0x6a')]=_0x11a18e['id'];if(_0x55b23d[_0x1064('0x47')]['filter']){_0x54dd02['where']=_[_0x1064('0x54')](_0x54dd02[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x54dd02[_0x1064('0x4b')],function(_0x4de16c){var _0x26f26d={};_0x26f26d[_0x4de16c]={'$like':'%'+_0x55b23d[_0x1064('0x47')]['filter']+'%'};return _0x26f26d;})});}_0x54dd02=_[_0x1064('0x54')]({},_0x54dd02,_0x55b23d['options']);return db[_0x1064('0x6b')]['count']({'where':_0x54dd02[_0x1064('0x52')]})[_0x1064('0x23')](function(_0xe491c9){_0x1127b7[_0x1064('0x33')]=_0xe491c9;if(_0x55b23d[_0x1064('0x47')][_0x1064('0x57')]){_0x54dd02[_0x1064('0x5b')]=[{'all':!![]}];}return db[_0x1064('0x6b')]['findAll'](_0x54dd02);})[_0x1064('0x23')](function(_0x33a5c5){_0x1127b7[_0x1064('0x6f')]=_0x33a5c5;return _0x1127b7;});}})[_0x1064('0x23')](respondWithFilteredResult(_0x241521,_0x54dd02))[_0x1064('0x2e')](handleError(_0x241521,null));};exports['removeDispositions']=function(_0x4a172d,_0x26c8d1,_0x168450){return db[_0x1064('0x41')][_0x1064('0x5c')]({'where':{'id':_0x4a172d[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x26c8d1,null))['then'](function(_0x461cd6){if(_0x461cd6){return _0x461cd6[_0x1064('0x70')](_0x4a172d['query'][_0x1064('0x71')]);}})[_0x1064('0x23')](respondWithStatusCode(_0x26c8d1,null))[_0x1064('0x2e')](handleError(_0x26c8d1,null));};exports[_0x1064('0x72')]=function(_0x279230,_0x977a58,_0x1c3773){if(_0x279230['body']['id']){delete _0x279230['body']['id'];}return db[_0x1064('0x41')][_0x1064('0x5c')]({'where':{'id':_0x279230[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x977a58,null))[_0x1064('0x23')](function(_0x1ee647){if(_0x1ee647){_0x279230[_0x1064('0x5e')]['WhatsappAccountId']=_0x1ee647['id'];return db['CannedAnswer'][_0x1064('0x5d')](_0x279230[_0x1064('0x5e')]);}})[_0x1064('0x23')](respondWithResult(_0x977a58,null))['catch'](handleError(_0x977a58,null));};exports['getAnswers']=function(_0x20aa57,_0x2c033b,_0x13eae0){var _0x31100a={'raw':![],'where':{}};var _0x189b51={};var _0x5bf8d7={'count':0x0,'rows':[]};return db[_0x1064('0x41')]['findOne']({'where':{'id':_0x20aa57[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x2c033b,null))[_0x1064('0x23')](function(_0x35cc76){if(_0x35cc76){_0x189b51[_0x1064('0x46')]=_[_0x1064('0x48')](db[_0x1064('0x73')][_0x1064('0x42')]);_0x189b51[_0x1064('0x47')]=_[_0x1064('0x48')](_0x20aa57[_0x1064('0x47')]);_0x189b51[_0x1064('0x49')]=_['intersection'](_0x189b51[_0x1064('0x46')],_0x189b51[_0x1064('0x47')]);_0x31100a['attributes']=_['intersection'](_0x189b51[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x20aa57[_0x1064('0x47')][_0x1064('0x4c')]));_0x31100a[_0x1064('0x4b')]=_0x31100a[_0x1064('0x4b')]['length']?_0x31100a[_0x1064('0x4b')]:_0x189b51[_0x1064('0x46')];if(!_0x20aa57[_0x1064('0x47')][_0x1064('0x4e')](_0x1064('0x74'))){_0x31100a[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x20aa57[_0x1064('0x47')][_0x1064('0x4f')]);_0x31100a[_0x1064('0x50')]=qs['offset'](_0x20aa57[_0x1064('0x47')][_0x1064('0x50')]);}_0x31100a[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x20aa57['query'][_0x1064('0x51')]);_0x31100a[_0x1064('0x52')]=qs[_0x1064('0x49')](_[_0x1064('0x75')](_0x20aa57['query'],_0x189b51[_0x1064('0x49')]));_0x31100a[_0x1064('0x52')][_0x1064('0x6a')]=_0x35cc76['id'];if(_0x20aa57[_0x1064('0x47')]['filter']){_0x31100a['where']=_[_0x1064('0x54')](_0x31100a['where'],{'$or':_['map'](_0x31100a[_0x1064('0x4b')],function(_0x32f4f7){var _0x2a45bf={};_0x2a45bf[_0x32f4f7]={'$like':'%'+_0x20aa57['query'][_0x1064('0x53')]+'%'};return _0x2a45bf;})});}_0x31100a=_[_0x1064('0x54')]({},_0x31100a,_0x20aa57[_0x1064('0x56')]);return db[_0x1064('0x73')][_0x1064('0x33')]({'where':_0x31100a['where']})['then'](function(_0x22498f){_0x5bf8d7[_0x1064('0x33')]=_0x22498f;if(_0x20aa57['query']['includeAll']){_0x31100a['include']=[{'all':!![]}];}return db[_0x1064('0x73')]['findAll'](_0x31100a);})[_0x1064('0x23')](function(_0x599dcb){_0x5bf8d7['rows']=_0x599dcb;return _0x5bf8d7;});}})[_0x1064('0x23')](respondWithFilteredResult(_0x2c033b,_0x31100a))[_0x1064('0x2e')](handleError(_0x2c033b,null));};exports['removeAnswers']=function(_0x5470bb,_0x184338,_0x14ca9b){return db['WhatsappAccount'][_0x1064('0x5c')]({'where':{'id':_0x5470bb[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x184338,null))[_0x1064('0x23')](function(_0x301d2e){if(_0x301d2e){return _0x301d2e[_0x1064('0x76')](_0x5470bb[_0x1064('0x47')][_0x1064('0x71')]);}})[_0x1064('0x23')](respondWithStatusCode(_0x184338,null))[_0x1064('0x2e')](handleError(_0x184338,null));};exports[_0x1064('0x77')]=function(_0x35a3ca,_0x246d61,_0x3d3099){return db['WhatsappAccount']['find']({'where':{'id':_0x35a3ca['params']['id']}})['then'](handleEntityNotFound(_0x246d61,null))[_0x1064('0x23')](function(_0x2f42ae){if(_0x2f42ae){return _0x2f42ae['addAgents'](_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')],_[_0x1064('0x78')](_0x35a3ca['body'],[_0x1064('0x71'),'id'])||{})[_0x1064('0x79')](function(_0x4f484e){for(var _0x552817=0x0;_0x552817<_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')]['length'];_0x552817+=0x1){socket[_0x1064('0x7a')]('userWhatsappAccount:save',{'UserId':Number(_0x35a3ca[_0x1064('0x5e')][_0x1064('0x71')][_0x552817]),'WhatsappAccountId':Number(_0x35a3ca['params']['id'])});}return _0x4f484e;});}})[_0x1064('0x23')](respondWithResult(_0x246d61,null))[_0x1064('0x2e')](handleError(_0x246d61,null));};exports[_0x1064('0x7b')]=function(_0x3d81ce,_0x3012e8,_0x1100e2){return db['WhatsappAccount']['find']({'where':{'id':_0x3d81ce[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x3012e8,null))[_0x1064('0x23')](function(_0x39145c){if(_0x39145c){return _0x39145c['removeAgents'](_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')])[_0x1064('0x23')](function(){if(_[_0x1064('0x7c')](_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')])){for(var _0x108838=0x0;_0x108838<_0x3d81ce[_0x1064('0x47')]['ids'][_0x1064('0x4d')];_0x108838+=0x1){socket[_0x1064('0x7a')](_0x1064('0x7d'),{'UserId':Number(_0x3d81ce[_0x1064('0x47')][_0x1064('0x71')][_0x108838]),'WhatsappAccountId':Number(_0x3d81ce[_0x1064('0x69')]['id'])});}}else{socket[_0x1064('0x7a')](_0x1064('0x7d'),{'UserId':Number(_0x3d81ce[_0x1064('0x47')]['ids']),'WhatsappAccountId':Number(_0x3d81ce[_0x1064('0x69')]['id'])});}});}})[_0x1064('0x23')](respondWithStatusCode(_0x3012e8,null))[_0x1064('0x2e')](handleError(_0x3012e8,null));};exports[_0x1064('0x7e')]=function(_0x29b84c,_0x14e678,_0x361653){var _0x393e8f={};var _0x3206b4={};var _0x15e783;var _0x3eeebf;return db['WhatsappAccount'][_0x1064('0x6d')]({'where':{'id':_0x29b84c[_0x1064('0x69')]['id']}})[_0x1064('0x23')](handleEntityNotFound(_0x14e678,null))[_0x1064('0x23')](function(_0x53985d){if(_0x53985d){_0x15e783=_0x53985d;_0x3206b4[_0x1064('0x46')]=_['keys'](db['User'][_0x1064('0x42')]);_0x3206b4[_0x1064('0x47')]=_[_0x1064('0x48')](_0x29b84c[_0x1064('0x47')]);_0x3206b4[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x3206b4[_0x1064('0x46')],_0x3206b4[_0x1064('0x47')]);_0x393e8f[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x3206b4[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x29b84c[_0x1064('0x47')][_0x1064('0x4c')]));_0x393e8f[_0x1064('0x4b')]=_0x393e8f[_0x1064('0x4b')][_0x1064('0x4d')]?_0x393e8f['attributes']:_0x3206b4[_0x1064('0x46')];_0x393e8f['order']=qs[_0x1064('0x51')](_0x29b84c[_0x1064('0x47')][_0x1064('0x51')]);_0x393e8f[_0x1064('0x52')]=qs['filters'](_[_0x1064('0x75')](_0x29b84c[_0x1064('0x47')],_0x3206b4[_0x1064('0x49')]));if(_0x29b84c['query'][_0x1064('0x53')]){_0x393e8f[_0x1064('0x52')]=_[_0x1064('0x54')](_0x393e8f[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x393e8f['attributes'],function(_0x59d0bc){var _0x41cfd3={};_0x41cfd3[_0x59d0bc]={'$like':'%'+_0x29b84c[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x41cfd3;})});}_0x393e8f=_[_0x1064('0x54')]({},_0x393e8f,_0x29b84c[_0x1064('0x56')]);return _0x15e783['getAgents'](_0x393e8f);}})[_0x1064('0x23')](function(_0x7c2cce){if(_0x7c2cce){_0x3eeebf=_0x7c2cce['length'];if(!_0x29b84c[_0x1064('0x47')][_0x1064('0x4e')](_0x1064('0x74'))){_0x393e8f['limit']=qs[_0x1064('0x4f')](_0x29b84c[_0x1064('0x47')][_0x1064('0x4f')]);_0x393e8f['offset']=qs[_0x1064('0x50')](_0x29b84c[_0x1064('0x47')][_0x1064('0x50')]);}return _0x15e783['getAgents'](_0x393e8f);}})['then'](function(_0x416b02){if(_0x416b02){return _0x416b02?{'count':_0x3eeebf,'rows':_0x416b02}:null;}})[_0x1064('0x23')](respondWithResult(_0x14e678,null))['catch'](handleError(_0x14e678,null));};exports[_0x1064('0x7f')]=function(_0x221f45,_0xcc1904){var _0x1cf06a=_0x221f45[_0x1064('0x69')]['id'];var _0x5b96b0=_0x221f45[_0x1064('0x5e')];var _0x117e4=0xc8;var _0x34a623=null;return db[_0x1064('0x80')][_0x1064('0x81')]({'isolationLevel':db[_0x1064('0x80')][_0x1064('0x82')][_0x1064('0x83')][_0x1064('0x84')]},function(_0xb32de0){return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x1cf06a},'transaction':_0xb32de0})[_0x1064('0x23')](function(_0x21d5f5){if(_0x21d5f5){return db[_0x1064('0x85')][_0x1064('0x39')]({'where':{'WhatsappAccountId':_0x1cf06a},'transaction':_0xb32de0})['then'](function(){var _0x5e6593=_[_0x1064('0x40')](_0x5b96b0,function(_0x4f4fba){_0x4f4fba[_0x1064('0x6a')]=_0x1cf06a;return _0x4f4fba;});return db[_0x1064('0x85')][_0x1064('0x86')](_0x5e6593,{'transaction':_0xb32de0});});}else{_0x117e4=0x194;_0x34a623=[];}});})[_0x1064('0x23')](function(){if(_0x117e4!==0x194){return db['WhatsappApplication'][_0x1064('0x87')]({'where':{'WhatsappAccountId':_0x1cf06a},'order':_0x1064('0x88')})[_0x1064('0x23')](function(_0x2bb5ab){_0x34a623=_0x2bb5ab;});}})[_0x1064('0x2e')](function(_0x4ea6be){_0x117e4=0x1f4;logger['error'](_0x4ea6be[_0x1064('0x3b')]);if(_0x4ea6be[_0x1064('0x3c')]){delete _0x4ea6be[_0x1064('0x3c')];}_0x34a623=_0x4ea6be;})[_0x1064('0x89')](function(){if(_0x34a623===null){_0xcc1904[_0x1064('0x2f')](_0x117e4);}else{if(_0x117e4===0x1f4){_0xcc1904['status'](_0x117e4)[_0x1064('0x3d')](_0x34a623);}else{_0xcc1904['status'](_0x117e4)[_0x1064('0x31')](_0x34a623);}}});};exports['getApplications']=function(_0x19bfb0,_0x12d0de,_0x4348f4){var _0x8f513e={};var _0x2d8310={};var _0xbeb94d;var _0xdac60d;return db[_0x1064('0x41')][_0x1064('0x6d')]({'where':{'id':_0x19bfb0[_0x1064('0x69')]['id']}})['then'](handleEntityNotFound(_0x12d0de,null))[_0x1064('0x23')](function(_0x30893a){if(_0x30893a){_0xbeb94d=_0x30893a;_0x2d8310['model']=_['keys'](db[_0x1064('0x85')][_0x1064('0x42')]);_0x2d8310[_0x1064('0x47')]=_['keys'](_0x19bfb0[_0x1064('0x47')]);_0x2d8310[_0x1064('0x49')]=_[_0x1064('0x4a')](_0x2d8310[_0x1064('0x46')],_0x2d8310[_0x1064('0x47')]);_0x8f513e[_0x1064('0x4b')]=_[_0x1064('0x4a')](_0x2d8310[_0x1064('0x46')],qs[_0x1064('0x4c')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x4c')]));_0x8f513e[_0x1064('0x4b')]=_0x8f513e[_0x1064('0x4b')][_0x1064('0x4d')]?_0x8f513e['attributes']:_0x2d8310[_0x1064('0x46')];_0x8f513e[_0x1064('0x6e')]=qs[_0x1064('0x51')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x51')]);_0x8f513e[_0x1064('0x52')]=qs['filters'](_[_0x1064('0x75')](_0x19bfb0['query'],_0x2d8310[_0x1064('0x49')]));if(_0x19bfb0[_0x1064('0x47')][_0x1064('0x53')]){_0x8f513e[_0x1064('0x52')]=_[_0x1064('0x54')](_0x8f513e[_0x1064('0x52')],{'$or':_[_0x1064('0x40')](_0x8f513e[_0x1064('0x4b')],function(_0xe74f84){var _0x1a6725={};_0x1a6725[_0xe74f84]={'$like':'%'+_0x19bfb0[_0x1064('0x47')][_0x1064('0x53')]+'%'};return _0x1a6725;})});}_0x8f513e=_[_0x1064('0x54')]({},_0x8f513e,_0x19bfb0[_0x1064('0x56')]);return _0xbeb94d['getApplications'](_0x8f513e);}})[_0x1064('0x23')](function(_0x26761a){if(_0x26761a){_0xdac60d=_0x26761a[_0x1064('0x4d')];if(!_0x19bfb0['query'][_0x1064('0x4e')](_0x1064('0x74'))){_0x8f513e[_0x1064('0x4f')]=qs[_0x1064('0x4f')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x4f')]);_0x8f513e[_0x1064('0x50')]=qs[_0x1064('0x50')](_0x19bfb0[_0x1064('0x47')][_0x1064('0x50')]);}return _0xbeb94d[_0x1064('0x8a')](_0x8f513e);}})['then'](function(_0x4407d3){if(_0x4407d3){return _0x4407d3?{'count':_0xdac60d,'rows':_0x4407d3}:null;}})[_0x1064('0x23')](respondWithResult(_0x12d0de,null))['catch'](handleError(_0x12d0de,null));};exports[_0x1064('0x8b')]=function(_0x357b46,_0x40d98b,_0x2e5205){var _0x34e708={'channel':_0x1064('0x8c')};var _0x5899a6=[];var _0x45ba19=[];var _0x2a89cb={};return db[_0x1064('0x41')]['find']({'where':{'id':_0x357b46[_0x1064('0x69')]['id']},'include':[{'model':db[_0x1064('0x85')],'as':_0x1064('0x8d')}]})[_0x1064('0x23')](handleEntityNotFound(_0x40d98b,null))['then'](function(_0x43fe03){_0x34e708[_0x1064('0x8e')]=_0x43fe03;if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')][_0x1064('0x44')]==='sinch'&&_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')]){if(_0x357b46['body'][_0x1064('0x8f')][_0x1064('0x4d')]===0x0)return;if(_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0][_0x1064('0x90')]!=='read')return;return db[_0x1064('0x91')][_0x1064('0x37')]({'read':!![],'readAt':_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0][_0x1064('0x92')]},{'where':{'messageId':_0x357b46[_0x1064('0x5e')][_0x1064('0x8f')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x5312f6){return _0x40d98b[_0x1064('0x30')](0xc8)[_0x1064('0x31')](_0x5312f6);});}_0x34e708[_0x1064('0x93')]=_[_0x1064('0x94')](_0x43fe03[_0x1064('0x8d')],[_0x1064('0x88')],[_0x1064('0x95')]);if(_0x34e708[_0x1064('0x8e')][_0x1064('0x8d')]){delete _0x34e708[_0x1064('0x8e')][_0x1064('0x8d')];}return db[_0x1064('0x96')][_0x1064('0x67')]()['then'](function(_0xbc6457){if(!_0xbc6457){throw new db['Sequelize'][(_0x1064('0x97'))]('no\x20available\x20attributes');}_0x5899a6=_['difference'](_['keys'](_0xbc6457),[_0x1064('0x98'),_0x1064('0x99')]);_0x45ba19=_[_0x1064('0x9a')](_[_0x1064('0x48')](_0xbc6457),['createdAt',_0x1064('0x99'),_0x1064('0x9b'),'ListId']);_0x34e708[_0x1064('0x5e')]={'mapKey':_0x1064('0x9c')};if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')]['type']===_0x1064('0x9d')){_0x34e708['body'][_0x1064('0x9e')]=_0x357b46[_0x1064('0x5e')]['From'][_0x1064('0x9f')](_0x1064('0xa0'),'');_0x34e708[_0x1064('0x5e')]['body']=_0x357b46[_0x1064('0x5e')][_0x1064('0xa1')];_0x34e708[_0x1064('0x5e')][_0x1064('0xa2')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa3')];}if(_0x34e708[_0x1064('0x8e')]&&_0x34e708[_0x1064('0x8e')]['type']===_0x1064('0xa4')){_0x34e708[_0x1064('0x5e')][_0x1064('0x9e')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa5')][0x0]['from'];_0x34e708[_0x1064('0x5e')][_0x1064('0x5e')]=_0x357b46[_0x1064('0x5e')][_0x1064('0xa5')][0x0]['message'][_0x1064('0x5e')];_0x34e708[_0x1064('0x5e')]['messageId']=_0x357b46['body'][_0x1064('0xa5')][0x0][_0x1064('0xa6')];}if(_0x34e708[_0x1064('0x5e')]['id']){delete _0x34e708['body']['id'];}if(_['isNil'](_0x34e708['body'][_0x1064('0x9e')])){throw new db[(_0x1064('0xa7'))]['ValidationError'](_0x1064('0xa8'));}if(_[_0x1064('0xa9')](_0x34e708[_0x1064('0x5e')][_0x1064('0x5e')])||_0x34e708['body']['body']===''){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1064('0xa9')](_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')])){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))](_0x1064('0xab')+_0x45ba19);}if(!_['includes'](_0x45ba19,_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')])){throw new db[(_0x1064('0xa7'))]['ValidationError'](_0x1064('0xac')+_0x45ba19);}_0x2a89cb[_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')]]=_0x34e708[_0x1064('0x5e')]['from'];return db[_0x1064('0xad')][_0x1064('0x5c')]({'where':{'id':_0x34e708[_0x1064('0x8e')][_0x1064('0xae')]},'include':[{'model':db[_0x1064('0x96')],'as':_0x1064('0xaf'),'where':_0x2a89cb,'limit':0x1,'order':[[_0x1064('0x99'),_0x1064('0xb0')]]}]});})['then'](handleEntityNotFound(_0x40d98b,null))['then'](function(_0x2c7686){if(_0x2c7686){_0x34e708[_0x1064('0xb1')]=_[_0x1064('0x78')](_0x2c7686,['Contacts']);if(_0x2c7686[_0x1064('0xaf')][_0x1064('0x4d')]){return _0x2c7686['Contacts'][0x0];}var _0x4f727b=_[_0x1064('0xb2')](_0x34e708[_0x1064('0x5e')],{'firstName':_0x34e708['body']['from'],'ListId':_0x2c7686['id']});_0x4f727b[_0x34e708[_0x1064('0x5e')][_0x1064('0xaa')]]=_0x34e708['body']['from'];return db[_0x1064('0x96')][_0x1064('0x5d')](_0x4f727b,{'fields':_0x5899a6,'raw':!![]});}})['then'](handleEntityNotFound(_0x40d98b,null))[_0x1064('0x23')](function(_0x39d306){if(_0x39d306){_0x34e708[_0x1064('0xb3')]=_0x39d306;var _0x4a8017={'ContactId':_0x39d306['id'],'phone':_0x34e708[_0x1064('0x5e')]['from'],'WhatsappAccountId':_0x357b46[_0x1064('0x69')]['id']};var _0x522377={'ContactId':_0x39d306['id'],'WhatsappAccountId':_0x357b46['params']['id'],'closed':![]};return db[_0x1064('0xb4')][_0x1064('0x5c')]({'where':_0x522377})[_0x1064('0x23')](function(_0x2b290a){if(_0x2b290a){return[_0x2b290a,![]];}return db[_0x1064('0xb4')]['create'](_0x4a8017)['then'](function(_0x58835f){return[_0x58835f,!![]];});});}})['spread'](function(_0x1db316,_0x4064c0){_0x34e708[_0x1064('0xb5')]=_0x1db316[_0x1064('0x60')]({'plain':!![]});_0x34e708[_0x1064('0xb5')][_0x1064('0xb6')]=![];if(_0x4064c0){if(_0x34e708[_0x1064('0x8e')][_0x1064('0xb7')]){_0x34e708[_0x1064('0x93')]['push']({'id':0x0,'priority':_0x34e708[_0x1064('0x93')][_0x1064('0x4d')]+0x1,'app':_0x1064('0xb8'),'appdata':'unmanaged','interval':_0x1064('0xb9')});}_0x34e708[_0x1064('0xb5')][_0x1064('0xb6')]=!![];}return db[_0x1064('0x91')]['create']({'phone':_0x34e708[_0x1064('0x5e')][_0x1064('0x9e')],'messageId':_0x34e708[_0x1064('0x5e')]['messageId'],'body':_0x34e708['body']['body'],'WhatsappAccountId':_0x357b46[_0x1064('0x69')]['id'],'WhatsappInteractionId':_0x1db316['id'],'direction':'in','ContactId':_0x1db316['ContactId'],'AttachmentId':_0x34e708[_0x1064('0x5e')][_0x1064('0xba')]});})[_0x1064('0x23')](function(_0x2b2b34){_0x34e708[_0x1064('0x29')]=_0x2b2b34;if(_0x34e708[_0x1064('0xb5')]['UserId']){return db[_0x1064('0xbb')]['find']({'attributes':['id','name'],'where':{'id':_0x34e708[_0x1064('0xb5')][_0x1064('0xbc')]}})[_0x1064('0x23')](function(_0x4a0999){if(_0x4a0999){_0x34e708['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a0999[_0x1064('0x3c')]+','+(_0x34e708[_0x1064('0x8e')][_0x1064('0xbd')]||0xa),'interval':_0x1064('0xb9')});}return respondWithRpcPromise(_0x1064('0xbe'),'startRouting',_0x34e708);});}return respondWithRpcPromise(_0x1064('0xbe'),_0x1064('0xbf'),_0x34e708);})[_0x1064('0x23')](function(_0x699635){if(_0x699635){var _0x2a6e12=0xc8;var _0x8f4aab=_0x1064('0xc0');logger['info'](_0x1064('0x25'),_0x8f4aab,_0x2a6e12,'entity\x20found');logger['debug'](_0x1064('0xc1'),_0x8f4aab,_0x2a6e12,'entity\x20found',JSON[_0x1064('0x26')](_0x699635));if(_0x34e708['account'][_0x1064('0x44')]===_0x1064('0x9d')){return _0x40d98b['status'](_0x2a6e12)[_0x1064('0x34')](_0x1064('0xc2'),_0x1064('0xc3'))[_0x1064('0x3d')]('\x0a');}else{return _0x40d98b[_0x1064('0x30')](_0x2a6e12)[_0x1064('0x31')](_0x699635);}}});})[_0x1064('0x2e')](handleError(_0x40d98b,null));};exports[_0x1064('0x3d')]=function(_0x577c0b,_0xddb0f7,_0x70885d){var _0x5a8b96,_0x14278c,_0x46d286;if(_[_0x1064('0xa9')](_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')])||_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')]===''){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))](_0x1064('0xc4'));}if(_[_0x1064('0xa9')](_0x577c0b['body']['to'])){throw new db[(_0x1064('0xa7'))][(_0x1064('0x97'))]('to\x20is\x20mandatory');}_0x5a8b96=_0x577c0b['body']['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x577c0b[_0x1064('0x69')]['id']},'include':[{'model':db[_0x1064('0xad')],'as':_0x1064('0xc5'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5a8b96},'limit':0x1,'order':[[_0x1064('0x99'),_0x1064('0xb0')]]}]}]})[_0x1064('0x23')](handleEntityNotFound(_0xddb0f7,null))[_0x1064('0x23')](function(_0x4df760){if(_0x4df760&&_0x4df760[_0x1064('0xc5')]){_0x14278c=_0x4df760[_0x1064('0x60')]({'plain':!![]});if(_0x14278c[_0x1064('0xc5')]&&_0x14278c['List']['Contacts']['length']){return _0x14278c[_0x1064('0xc5')][_0x1064('0xaf')][0x0];}return db[_0x1064('0x96')]['create'](_['defaults'](_0x577c0b[_0x1064('0x5e')],{'firstName':_0x5a8b96,'mobile':_0x5a8b96,'phone':_0x5a8b96,'ListId':_0x14278c[_0x1064('0xae')]}));}})[_0x1064('0x23')](handleEntityNotFound(_0xddb0f7,null))[_0x1064('0x23')](function(_0x42355d){if(_0x42355d){_0x46d286=_0x42355d;return db[_0x1064('0xb4')][_0x1064('0x5c')]({'where':{'ContactId':_0x46d286['id'],'closed':![],'WhatsappAccountId':_0x14278c['id']}})[_0x1064('0x23')](function(_0x40d581){if(_0x40d581){return[_0x40d581,![]];}return db['WhatsappInteraction'][_0x1064('0x5d')]({'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id'],'WhatsappAccountId':_0x14278c['id'],'phone':_0x5a8b96,'firstMsgDirection':_0x1064('0xc6'),'Messages':[_['merge'](_0x577c0b['body'],{'read':![],'body':_0x577c0b[_0x1064('0x5e')]['body'],'phone':_0x5a8b96,'WhatsappAccountId':_0x14278c['id'],'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id']})]},{'include':[{'model':db[_0x1064('0x91')],'as':_0x1064('0xc7')}]})['then'](function(_0x24681b){return[_0x24681b,!![]];});});}})[_0x1064('0x79')](function(_0x1a0872,_0x823749){if(_0x823749){return _0x1a0872;}return db[_0x1064('0x91')]['create'](_[_0x1064('0x54')](_0x577c0b['body'],{'read':![],'body':_0x577c0b[_0x1064('0x5e')][_0x1064('0x5e')],'phone':_0x5a8b96,'WhatsappAccountId':_0x14278c['id'],'WhatsappInteractionId':_0x1a0872['id'],'UserId':_0x577c0b[_0x1064('0x5f')]['id'],'ContactId':_0x46d286['id']}))[_0x1064('0x23')](function(_0x49af04){_0x1a0872[_0x1064('0xc8')][_0x1064('0xc7')]=[];_0x1a0872['dataValues'][_0x1064('0xc7')][_0x1064('0xc9')](_0x49af04[_0x1064('0xc8')]);return _0x1a0872;});})[_0x1064('0x23')](respondWithResult(_0xddb0f7,null))[_0x1064('0x2e')](handleError(_0xddb0f7,null));}; \ No newline at end of file +var _0xbca5=['./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','status','set','reject','save','WhatsappAccounts','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','WhatsappAccount','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','Applications','account','sinch','statuses','state','update','timestamp','applications','orderBy','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','message_id','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','CmContact','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','debug','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbca5,0x174));var _0x5bca=function(_0x34c825,_0x44cad4){_0x34c825=_0x34c825-0x0;var _0x2fde13=_0xbca5[_0x34c825];return _0x2fde13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bca('0x0'));var zipdir=require(_0x5bca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bca('0x2'));var moment=require(_0x5bca('0x3'));var BPromise=require(_0x5bca('0x4'));var Mustache=require('mustache');var util=require(_0x5bca('0x5'));var path=require(_0x5bca('0x6'));var sox=require(_0x5bca('0x7'));var csv=require('to-csv');var ejs=require(_0x5bca('0x8'));var fs=require('fs');var fs_extra=require(_0x5bca('0x9'));var _=require(_0x5bca('0xa'));var squel=require(_0x5bca('0xb'));var crypto=require(_0x5bca('0xc'));var jsforce=require(_0x5bca('0xd'));var deskjs=require(_0x5bca('0xe'));var toCsv=require(_0x5bca('0xf'));var querystring=require(_0x5bca('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5bca('0x11'));var qs=require(_0x5bca('0x12'));var as=require(_0x5bca('0x13'));var hardwareService=require(_0x5bca('0x14'));var logger=require(_0x5bca('0x15'))(_0x5bca('0x16'));var utils=require(_0x5bca('0x17'));var config=require(_0x5bca('0x18'));var licenseUtil=require(_0x5bca('0x19'));var db=require('../../mysqldb')['db'];config[_0x5bca('0x1a')]=_[_0x5bca('0x1b')](config[_0x5bca('0x1a')],{'host':_0x5bca('0x1c'),'port':0x18eb});var socket=require(_0x5bca('0x1d'))(new Redis(config[_0x5bca('0x1a')]));require(_0x5bca('0x1e'))[_0x5bca('0x1f')](socket);var jayson=require(_0x5bca('0x20'));var client=jayson[_0x5bca('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x220b53,_0x3981bf,_0x227438,_0x4196aa){return new BPromise(function(_0x2c8713,_0x49d94d){var _0x336328=_0x4196aa||client;return _0x336328[_0x5bca('0x22')](_0x220b53,_0x227438)[_0x5bca('0x23')](function(_0x208af9){logger[_0x5bca('0x24')](_0x5bca('0x25'),_0x3981bf,'request\x20sent');logger['debug'](_0x5bca('0x26'),_0x3981bf,_0x5bca('0x27'),JSON[_0x5bca('0x28')](_0x208af9));if(_0x208af9[_0x5bca('0x29')]){if(_0x208af9['error'][_0x5bca('0x2a')]===0x1f4){logger[_0x5bca('0x29')](_0x5bca('0x25'),_0x3981bf,_0x208af9[_0x5bca('0x29')][_0x5bca('0x2b')]);return _0x49d94d(_0x208af9[_0x5bca('0x29')][_0x5bca('0x2b')]);}logger[_0x5bca('0x29')](_0x5bca('0x25'),_0x3981bf,_0x208af9[_0x5bca('0x29')][_0x5bca('0x2b')]);return _0x2c8713(_0x208af9[_0x5bca('0x29')]['message']);}else{logger[_0x5bca('0x24')](_0x5bca('0x25'),_0x3981bf,_0x5bca('0x27'));_0x2c8713(_0x208af9[_0x5bca('0x2c')]['message']);}})[_0x5bca('0x2d')](function(_0x4ffd98){logger[_0x5bca('0x29')](_0x5bca('0x25'),_0x3981bf,_0x4ffd98);_0x49d94d(_0x4ffd98);});});}function respondWithStatusCode(_0x147ed6,_0x1c6cda){_0x1c6cda=_0x1c6cda||0xcc;return function(_0x300134){if(_0x300134){return _0x147ed6[_0x5bca('0x2e')](_0x1c6cda);}return _0x147ed6['status'](_0x1c6cda)['end']();};}function respondWithResult(_0x1a437c,_0x1d5924){_0x1d5924=_0x1d5924||0xc8;return function(_0x2760ae){if(_0x2760ae){return _0x1a437c['status'](_0x1d5924)[_0x5bca('0x2f')](_0x2760ae);}};}function respondWithFilteredResult(_0x54f3e9,_0x2734e5){return function(_0x43bb86){if(_0x43bb86){var _0x5abcea=typeof _0x2734e5[_0x5bca('0x30')]===_0x5bca('0x31')&&typeof _0x2734e5[_0x5bca('0x32')]===_0x5bca('0x31');var _0x5c8544=_0x43bb86['count'];var _0x47a8c4=_0x5abcea?0x0:_0x2734e5[_0x5bca('0x30')];var _0x4fe6a2=_0x5abcea?_0x43bb86['count']:_0x2734e5['offset']+_0x2734e5[_0x5bca('0x32')];var _0x5950a4;if(_0x4fe6a2>=_0x5c8544){_0x4fe6a2=_0x5c8544;_0x5950a4=0xc8;}else{_0x5950a4=0xce;}_0x54f3e9[_0x5bca('0x33')](_0x5950a4);return _0x54f3e9[_0x5bca('0x34')]('Content-Range',_0x47a8c4+'-'+_0x4fe6a2+'/'+_0x5c8544)[_0x5bca('0x2f')](_0x43bb86);}return null;};}function patchUpdates(_0x480d54){return function(_0x565901){try{jsonpatch['apply'](_0x565901,_0x480d54,!![]);}catch(_0xc5485a){return BPromise[_0x5bca('0x35')](_0xc5485a);}return _0x565901[_0x5bca('0x36')]();};}function saveUpdates(_0x45832a,_0x3c30bf){return function(_0x1a2e66){if(_0x1a2e66){return _0x1a2e66['update'](_0x45832a)[_0x5bca('0x23')](function(_0x5ccc4a){return _0x5ccc4a;});}return null;};}function removeEntity(_0xb54526,_0x245c6e){return function(_0x2d57b6){if(_0x2d57b6){return _0x2d57b6['destroy']()[_0x5bca('0x23')](function(){var _0x1f7557=_0x2d57b6['get']({'plain':!![]});var _0x556617=_0x5bca('0x37');return db['UserProfileResource'][_0x5bca('0x38')]({'where':{'type':_0x556617,'resourceId':_0x1f7557['id']}})[_0x5bca('0x23')](function(){return _0x2d57b6;});})[_0x5bca('0x23')](function(){_0xb54526[_0x5bca('0x33')](0xcc)[_0x5bca('0x39')]();});}};}function handleEntityNotFound(_0x3acd02,_0x1d759b){return function(_0x4e7151){if(!_0x4e7151){_0x3acd02[_0x5bca('0x2e')](0x194);}return _0x4e7151;};}function handleError(_0x511724,_0x5ecfb5){_0x5ecfb5=_0x5ecfb5||0x1f4;return function(_0x5536fd){logger[_0x5bca('0x29')](_0x5536fd[_0x5bca('0x3a')]);if(_0x5536fd[_0x5bca('0x3b')]){delete _0x5536fd['name'];}_0x511724[_0x5bca('0x33')](_0x5ecfb5)[_0x5bca('0x3c')](_0x5536fd);};}exports[_0x5bca('0x3d')]=function(_0x4a4fd7,_0x2f44a2){var _0x37f781={'include':[{'model':db[_0x5bca('0x3e')],'as':_0x5bca('0x3f')}]},_0x313364={},_0x5ddb5e={'count':0x0,'rows':[]};var _0x26399d=_[_0x5bca('0x40')](db['WhatsappAccount'][_0x5bca('0x41')],function(_0x42dbc2){return{'name':_0x42dbc2[_0x5bca('0x42')],'type':_0x42dbc2[_0x5bca('0x43')]['key']};});_0x313364[_0x5bca('0x44')]=_[_0x5bca('0x40')](_0x26399d,'name');_0x313364[_0x5bca('0x45')]=_[_0x5bca('0x46')](_0x4a4fd7['query']);_0x313364[_0x5bca('0x47')]=_[_0x5bca('0x48')](_0x313364['model'],_0x313364['query']);_0x37f781[_0x5bca('0x49')]=_[_0x5bca('0x48')](_0x313364['model'],qs[_0x5bca('0x4a')](_0x4a4fd7['query'][_0x5bca('0x4a')]));_0x37f781[_0x5bca('0x49')]=_0x37f781[_0x5bca('0x49')][_0x5bca('0x4b')]?_0x37f781[_0x5bca('0x49')]:_0x313364[_0x5bca('0x44')];if(!_0x4a4fd7['query'][_0x5bca('0x4c')](_0x5bca('0x4d'))){_0x37f781[_0x5bca('0x32')]=qs[_0x5bca('0x32')](_0x4a4fd7[_0x5bca('0x45')]['limit']);_0x37f781[_0x5bca('0x30')]=qs[_0x5bca('0x30')](_0x4a4fd7[_0x5bca('0x45')]['offset']);}_0x37f781[_0x5bca('0x4e')]=qs[_0x5bca('0x4f')](_0x4a4fd7[_0x5bca('0x45')]['sort']);_0x37f781[_0x5bca('0x50')]=qs[_0x5bca('0x47')](_[_0x5bca('0x51')](_0x4a4fd7['query'],_0x313364[_0x5bca('0x47')]),_0x26399d);if(_0x4a4fd7['query'][_0x5bca('0x52')]){_0x37f781['where']=_[_0x5bca('0x53')](_0x37f781['where'],{'$or':_[_0x5bca('0x40')](_0x26399d,function(_0x5617cd){if(_0x5617cd[_0x5bca('0x43')]!==_0x5bca('0x54')){var _0x20ce51={};_0x20ce51[_0x5617cd['name']]={'$like':'%'+_0x4a4fd7[_0x5bca('0x45')][_0x5bca('0x52')]+'%'};return _0x20ce51;}})});}_0x37f781=_[_0x5bca('0x53')]({},_0x37f781,_0x4a4fd7[_0x5bca('0x55')]);var _0xf7c352={'where':_0x37f781[_0x5bca('0x50')]};return db['WhatsappAccount'][_0x5bca('0x56')](_0xf7c352)[_0x5bca('0x23')](function(_0x2b314a){_0x5ddb5e[_0x5bca('0x56')]=_0x2b314a;if(_0x4a4fd7['query'][_0x5bca('0x57')]){_0x37f781['include']=[{'all':!![]}];}return db[_0x5bca('0x58')][_0x5bca('0x59')](_0x37f781);})[_0x5bca('0x23')](function(_0x2071e9){_0x5ddb5e[_0x5bca('0x5a')]=_0x2071e9;return _0x5ddb5e;})[_0x5bca('0x23')](respondWithFilteredResult(_0x2f44a2,_0x37f781))['catch'](handleError(_0x2f44a2,null));};exports[_0x5bca('0x5b')]=function(_0xd88560,_0xeaa146){var _0x44897e={'raw':![],'where':{'id':_0xd88560[_0x5bca('0x5c')]['id']},'include':[{'model':db[_0x5bca('0x3e')],'as':_0x5bca('0x3f')}]},_0x51ea32={};_0x51ea32[_0x5bca('0x44')]=_[_0x5bca('0x46')](db[_0x5bca('0x58')]['rawAttributes']);_0x51ea32[_0x5bca('0x45')]=_['keys'](_0xd88560[_0x5bca('0x45')]);_0x51ea32[_0x5bca('0x47')]=_['intersection'](_0x51ea32[_0x5bca('0x44')],_0x51ea32['query']);_0x44897e['attributes']=_['intersection'](_0x51ea32['model'],qs[_0x5bca('0x4a')](_0xd88560[_0x5bca('0x45')][_0x5bca('0x4a')]));_0x44897e['attributes']=_0x44897e['attributes']['length']?_0x44897e['attributes']:_0x51ea32[_0x5bca('0x44')];if(_0xd88560[_0x5bca('0x45')][_0x5bca('0x57')]){_0x44897e[_0x5bca('0x5d')]=[{'all':!![]}];}_0x44897e=_['merge']({},_0x44897e,_0xd88560[_0x5bca('0x55')]);return db['WhatsappAccount'][_0x5bca('0x5e')](_0x44897e)[_0x5bca('0x23')](handleEntityNotFound(_0xeaa146,null))[_0x5bca('0x23')](respondWithResult(_0xeaa146,null))['catch'](handleError(_0xeaa146,null));};exports[_0x5bca('0x5f')]=function(_0x26a92d,_0x10cbd4){return db[_0x5bca('0x58')]['create'](_0x26a92d[_0x5bca('0x60')],{})[_0x5bca('0x23')](function(_0x126fe3){var _0x629776=_0x26a92d['user']['get']({'plain':!![]});if(!_0x629776)throw new Error(_0x5bca('0x61'));if(_0x629776[_0x5bca('0x62')]===_0x5bca('0x63')){var _0x535e5f=_0x126fe3[_0x5bca('0x64')]({'plain':!![]});var _0x57c8b8=_0x5bca('0x37');return db[_0x5bca('0x65')][_0x5bca('0x5e')]({'where':{'name':_0x57c8b8,'userProfileId':_0x629776[_0x5bca('0x66')]},'raw':!![]})[_0x5bca('0x23')](function(_0x54a778){if(_0x54a778&&_0x54a778[_0x5bca('0x67')]===0x0){return db['UserProfileResource'][_0x5bca('0x5f')]({'name':_0x535e5f[_0x5bca('0x3b')],'resourceId':_0x535e5f['id'],'type':_0x54a778[_0x5bca('0x3b')],'sectionId':_0x54a778['id']},{})[_0x5bca('0x23')](function(){return _0x126fe3;});}else{return _0x126fe3;}})[_0x5bca('0x2d')](function(_0x5e1ad6){logger[_0x5bca('0x29')](_0x5bca('0x68'),_0x5e1ad6);throw _0x5e1ad6;});}return _0x126fe3;})['then'](respondWithResult(_0x10cbd4,0xc9))['catch'](handleError(_0x10cbd4,null));};exports['update']=function(_0x179552,_0x380da9){if(_0x179552[_0x5bca('0x60')]['id']){delete _0x179552[_0x5bca('0x60')]['id'];}return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0x179552[_0x5bca('0x5c')]['id']},'include':[{'model':db[_0x5bca('0x3e')],'as':_0x5bca('0x3f')}]})[_0x5bca('0x23')](handleEntityNotFound(_0x380da9,null))[_0x5bca('0x23')](saveUpdates(_0x179552[_0x5bca('0x60')],null))[_0x5bca('0x23')](respondWithResult(_0x380da9,null))[_0x5bca('0x2d')](handleError(_0x380da9,null));};exports[_0x5bca('0x38')]=function(_0x428841,_0x187738){return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0x428841[_0x5bca('0x5c')]['id']}})['then'](handleEntityNotFound(_0x187738,null))['then'](removeEntity(_0x187738,null))[_0x5bca('0x2d')](handleError(_0x187738,null));};exports[_0x5bca('0x69')]=function(_0x468f41,_0x840b01){return db[_0x5bca('0x58')][_0x5bca('0x69')]()['then'](respondWithResult(_0x840b01,null))['catch'](handleError(_0x840b01,null));};exports[_0x5bca('0x6a')]=function(_0x511ea8,_0x3fa797,_0xbda80e){if(_0x511ea8[_0x5bca('0x60')]['id']){delete _0x511ea8[_0x5bca('0x60')]['id'];}return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0x511ea8[_0x5bca('0x5c')]['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x3fa797,null))['then'](function(_0x25639e){if(_0x25639e){_0x511ea8[_0x5bca('0x60')][_0x5bca('0x6b')]=_0x25639e['id'];return db[_0x5bca('0x6c')][_0x5bca('0x5f')](_0x511ea8['body']);}})[_0x5bca('0x23')](respondWithResult(_0x3fa797,null))['catch'](handleError(_0x3fa797,null));};exports[_0x5bca('0x6d')]=function(_0x552f02,_0x25c04d,_0x104945){var _0x58961d={'raw':![],'where':{}};var _0x3fcdd5={};var _0x564d72={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5bca('0x6e')]({'where':{'id':_0x552f02['params']['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x25c04d,null))[_0x5bca('0x23')](function(_0x35e3e8){if(_0x35e3e8){_0x3fcdd5['model']=_[_0x5bca('0x46')](db['Disposition']['rawAttributes']);_0x3fcdd5[_0x5bca('0x45')]=_['keys'](_0x552f02['query']);_0x3fcdd5['filters']=_[_0x5bca('0x48')](_0x3fcdd5['model'],_0x3fcdd5['query']);_0x58961d[_0x5bca('0x49')]=_[_0x5bca('0x48')](_0x3fcdd5['model'],qs['fields'](_0x552f02[_0x5bca('0x45')]['fields']));_0x58961d['attributes']=_0x58961d[_0x5bca('0x49')][_0x5bca('0x4b')]?_0x58961d[_0x5bca('0x49')]:_0x3fcdd5['model'];if(!_0x552f02[_0x5bca('0x45')][_0x5bca('0x4c')](_0x5bca('0x4d'))){_0x58961d[_0x5bca('0x32')]=qs[_0x5bca('0x32')](_0x552f02[_0x5bca('0x45')][_0x5bca('0x32')]);_0x58961d['offset']=qs[_0x5bca('0x30')](_0x552f02[_0x5bca('0x45')][_0x5bca('0x30')]);}_0x58961d[_0x5bca('0x4e')]=qs['sort'](_0x552f02[_0x5bca('0x45')][_0x5bca('0x4f')]);_0x58961d[_0x5bca('0x50')]=qs[_0x5bca('0x47')](_['pick'](_0x552f02['query'],_0x3fcdd5[_0x5bca('0x47')]));_0x58961d[_0x5bca('0x50')][_0x5bca('0x6b')]=_0x35e3e8['id'];if(_0x552f02['query'][_0x5bca('0x52')]){_0x58961d[_0x5bca('0x50')]=_[_0x5bca('0x53')](_0x58961d[_0x5bca('0x50')],{'$or':_[_0x5bca('0x40')](_0x58961d[_0x5bca('0x49')],function(_0x54c6de){var _0x1c2555={};_0x1c2555[_0x54c6de]={'$like':'%'+_0x552f02[_0x5bca('0x45')][_0x5bca('0x52')]+'%'};return _0x1c2555;})});}_0x58961d=_[_0x5bca('0x53')]({},_0x58961d,_0x552f02['options']);return db['Disposition'][_0x5bca('0x56')]({'where':_0x58961d['where']})[_0x5bca('0x23')](function(_0x48689c){_0x564d72['count']=_0x48689c;if(_0x552f02[_0x5bca('0x45')][_0x5bca('0x57')]){_0x58961d[_0x5bca('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x5bca('0x59')](_0x58961d);})[_0x5bca('0x23')](function(_0x421272){_0x564d72[_0x5bca('0x5a')]=_0x421272;return _0x564d72;});}})[_0x5bca('0x23')](respondWithFilteredResult(_0x25c04d,_0x58961d))[_0x5bca('0x2d')](handleError(_0x25c04d,null));};exports[_0x5bca('0x6f')]=function(_0xc61b93,_0x409622,_0x5b534c){return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0xc61b93[_0x5bca('0x5c')]['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x409622,null))[_0x5bca('0x23')](function(_0x5bcf9e){if(_0x5bcf9e){return _0x5bcf9e[_0x5bca('0x6f')](_0xc61b93['query']['ids']);}})[_0x5bca('0x23')](respondWithStatusCode(_0x409622,null))[_0x5bca('0x2d')](handleError(_0x409622,null));};exports['addAnswer']=function(_0x3d553b,_0x386644,_0x27f51e){if(_0x3d553b[_0x5bca('0x60')]['id']){delete _0x3d553b[_0x5bca('0x60')]['id'];}return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0x3d553b[_0x5bca('0x5c')]['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x386644,null))[_0x5bca('0x23')](function(_0x5b8636){if(_0x5b8636){_0x3d553b[_0x5bca('0x60')][_0x5bca('0x6b')]=_0x5b8636['id'];return db['CannedAnswer'][_0x5bca('0x5f')](_0x3d553b['body']);}})[_0x5bca('0x23')](respondWithResult(_0x386644,null))[_0x5bca('0x2d')](handleError(_0x386644,null));};exports[_0x5bca('0x70')]=function(_0xedc87f,_0x2d3bf2,_0x1d6cf4){var _0x3fa178={'raw':![],'where':{}};var _0x358c8d={};var _0x317d78={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5bca('0x6e')]({'where':{'id':_0xedc87f['params']['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x2d3bf2,null))[_0x5bca('0x23')](function(_0x2bbf30){if(_0x2bbf30){_0x358c8d[_0x5bca('0x44')]=_[_0x5bca('0x46')](db[_0x5bca('0x71')]['rawAttributes']);_0x358c8d[_0x5bca('0x45')]=_['keys'](_0xedc87f['query']);_0x358c8d['filters']=_[_0x5bca('0x48')](_0x358c8d['model'],_0x358c8d['query']);_0x3fa178[_0x5bca('0x49')]=_[_0x5bca('0x48')](_0x358c8d[_0x5bca('0x44')],qs['fields'](_0xedc87f['query']['fields']));_0x3fa178['attributes']=_0x3fa178[_0x5bca('0x49')]['length']?_0x3fa178[_0x5bca('0x49')]:_0x358c8d[_0x5bca('0x44')];if(!_0xedc87f[_0x5bca('0x45')][_0x5bca('0x4c')](_0x5bca('0x4d'))){_0x3fa178[_0x5bca('0x32')]=qs[_0x5bca('0x32')](_0xedc87f[_0x5bca('0x45')][_0x5bca('0x32')]);_0x3fa178['offset']=qs[_0x5bca('0x30')](_0xedc87f[_0x5bca('0x45')][_0x5bca('0x30')]);}_0x3fa178[_0x5bca('0x4e')]=qs[_0x5bca('0x4f')](_0xedc87f[_0x5bca('0x45')][_0x5bca('0x4f')]);_0x3fa178[_0x5bca('0x50')]=qs[_0x5bca('0x47')](_['pick'](_0xedc87f[_0x5bca('0x45')],_0x358c8d[_0x5bca('0x47')]));_0x3fa178[_0x5bca('0x50')][_0x5bca('0x6b')]=_0x2bbf30['id'];if(_0xedc87f[_0x5bca('0x45')][_0x5bca('0x52')]){_0x3fa178[_0x5bca('0x50')]=_['merge'](_0x3fa178[_0x5bca('0x50')],{'$or':_[_0x5bca('0x40')](_0x3fa178[_0x5bca('0x49')],function(_0x211a7f){var _0x562c95={};_0x562c95[_0x211a7f]={'$like':'%'+_0xedc87f[_0x5bca('0x45')][_0x5bca('0x52')]+'%'};return _0x562c95;})});}_0x3fa178=_[_0x5bca('0x53')]({},_0x3fa178,_0xedc87f[_0x5bca('0x55')]);return db['CannedAnswer']['count']({'where':_0x3fa178[_0x5bca('0x50')]})[_0x5bca('0x23')](function(_0x42bfc1){_0x317d78[_0x5bca('0x56')]=_0x42bfc1;if(_0xedc87f[_0x5bca('0x45')]['includeAll']){_0x3fa178['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3fa178);})[_0x5bca('0x23')](function(_0x54d6ec){_0x317d78['rows']=_0x54d6ec;return _0x317d78;});}})[_0x5bca('0x23')](respondWithFilteredResult(_0x2d3bf2,_0x3fa178))['catch'](handleError(_0x2d3bf2,null));};exports[_0x5bca('0x72')]=function(_0x203de8,_0x255683,_0x777f49){return db['WhatsappAccount'][_0x5bca('0x5e')]({'where':{'id':_0x203de8[_0x5bca('0x5c')]['id']}})['then'](handleEntityNotFound(_0x255683,null))['then'](function(_0x2a1419){if(_0x2a1419){return _0x2a1419[_0x5bca('0x72')](_0x203de8['query'][_0x5bca('0x73')]);}})[_0x5bca('0x23')](respondWithStatusCode(_0x255683,null))[_0x5bca('0x2d')](handleError(_0x255683,null));};exports[_0x5bca('0x74')]=function(_0x3314b0,_0x2214b5,_0x2c473a){return db['WhatsappAccount'][_0x5bca('0x5e')]({'where':{'id':_0x3314b0['params']['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x2214b5,null))['then'](function(_0x5c50f4){if(_0x5c50f4){return _0x5c50f4[_0x5bca('0x74')](_0x3314b0[_0x5bca('0x60')][_0x5bca('0x73')],_[_0x5bca('0x75')](_0x3314b0[_0x5bca('0x60')],[_0x5bca('0x73'),'id'])||{})['spread'](function(_0x5a53c9){for(var _0x303e95=0x0;_0x303e95<_0x3314b0['body'][_0x5bca('0x73')][_0x5bca('0x4b')];_0x303e95+=0x1){socket[_0x5bca('0x76')](_0x5bca('0x77'),{'UserId':Number(_0x3314b0[_0x5bca('0x60')][_0x5bca('0x73')][_0x303e95]),'WhatsappAccountId':Number(_0x3314b0[_0x5bca('0x5c')]['id'])});}return _0x5a53c9;});}})[_0x5bca('0x23')](respondWithResult(_0x2214b5,null))[_0x5bca('0x2d')](handleError(_0x2214b5,null));};exports[_0x5bca('0x78')]=function(_0xd34a97,_0x2d660a,_0x60cbae){return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0xd34a97[_0x5bca('0x5c')]['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x2d660a,null))[_0x5bca('0x23')](function(_0x544a62){if(_0x544a62){return _0x544a62[_0x5bca('0x78')](_0xd34a97[_0x5bca('0x45')][_0x5bca('0x73')])[_0x5bca('0x23')](function(){if(_[_0x5bca('0x79')](_0xd34a97[_0x5bca('0x45')][_0x5bca('0x73')])){for(var _0x24f378=0x0;_0x24f378<_0xd34a97['query'][_0x5bca('0x73')]['length'];_0x24f378+=0x1){socket[_0x5bca('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0xd34a97[_0x5bca('0x45')][_0x5bca('0x73')][_0x24f378]),'WhatsappAccountId':Number(_0xd34a97[_0x5bca('0x5c')]['id'])});}}else{socket[_0x5bca('0x76')](_0x5bca('0x7a'),{'UserId':Number(_0xd34a97[_0x5bca('0x45')][_0x5bca('0x73')]),'WhatsappAccountId':Number(_0xd34a97['params']['id'])});}});}})[_0x5bca('0x23')](respondWithStatusCode(_0x2d660a,null))[_0x5bca('0x2d')](handleError(_0x2d660a,null));};exports['getAgents']=function(_0x47518e,_0x1c3e93,_0x21f4b3){var _0x20781e={};var _0x3f7cd9={};var _0x2bf1d1;var _0x22e76a;return db['WhatsappAccount'][_0x5bca('0x6e')]({'where':{'id':_0x47518e[_0x5bca('0x5c')]['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x1c3e93,null))[_0x5bca('0x23')](function(_0xc94b06){if(_0xc94b06){_0x2bf1d1=_0xc94b06;_0x3f7cd9[_0x5bca('0x44')]=_[_0x5bca('0x46')](db[_0x5bca('0x7b')][_0x5bca('0x41')]);_0x3f7cd9['query']=_[_0x5bca('0x46')](_0x47518e[_0x5bca('0x45')]);_0x3f7cd9[_0x5bca('0x47')]=_[_0x5bca('0x48')](_0x3f7cd9[_0x5bca('0x44')],_0x3f7cd9[_0x5bca('0x45')]);_0x20781e['attributes']=_[_0x5bca('0x48')](_0x3f7cd9[_0x5bca('0x44')],qs[_0x5bca('0x4a')](_0x47518e[_0x5bca('0x45')][_0x5bca('0x4a')]));_0x20781e[_0x5bca('0x49')]=_0x20781e[_0x5bca('0x49')][_0x5bca('0x4b')]?_0x20781e['attributes']:_0x3f7cd9[_0x5bca('0x44')];_0x20781e[_0x5bca('0x4e')]=qs[_0x5bca('0x4f')](_0x47518e[_0x5bca('0x45')][_0x5bca('0x4f')]);_0x20781e[_0x5bca('0x50')]=qs[_0x5bca('0x47')](_[_0x5bca('0x51')](_0x47518e['query'],_0x3f7cd9[_0x5bca('0x47')]));if(_0x47518e[_0x5bca('0x45')][_0x5bca('0x52')]){_0x20781e['where']=_['merge'](_0x20781e['where'],{'$or':_[_0x5bca('0x40')](_0x20781e[_0x5bca('0x49')],function(_0x58c87a){var _0x4384d0={};_0x4384d0[_0x58c87a]={'$like':'%'+_0x47518e[_0x5bca('0x45')][_0x5bca('0x52')]+'%'};return _0x4384d0;})});}_0x20781e=_[_0x5bca('0x53')]({},_0x20781e,_0x47518e[_0x5bca('0x55')]);return _0x2bf1d1['getAgents'](_0x20781e);}})[_0x5bca('0x23')](function(_0x10d168){if(_0x10d168){_0x22e76a=_0x10d168[_0x5bca('0x4b')];if(!_0x47518e['query']['hasOwnProperty'](_0x5bca('0x4d'))){_0x20781e[_0x5bca('0x32')]=qs['limit'](_0x47518e['query'][_0x5bca('0x32')]);_0x20781e[_0x5bca('0x30')]=qs[_0x5bca('0x30')](_0x47518e[_0x5bca('0x45')][_0x5bca('0x30')]);}return _0x2bf1d1[_0x5bca('0x7c')](_0x20781e);}})[_0x5bca('0x23')](function(_0xb2ec8c){if(_0xb2ec8c){return _0xb2ec8c?{'count':_0x22e76a,'rows':_0xb2ec8c}:null;}})[_0x5bca('0x23')](respondWithResult(_0x1c3e93,null))[_0x5bca('0x2d')](handleError(_0x1c3e93,null));};exports[_0x5bca('0x7d')]=function(_0x33b171,_0xebf81e){var _0x21a726=_0x33b171[_0x5bca('0x5c')]['id'];var _0x4e782d=_0x33b171['body'];var _0x2f0d77=0xc8;var _0x244e73=null;return db[_0x5bca('0x7e')]['transaction']({'isolationLevel':db['sequelize'][_0x5bca('0x7f')][_0x5bca('0x80')][_0x5bca('0x81')]},function(_0x4be413){return db[_0x5bca('0x58')][_0x5bca('0x6e')]({'where':{'id':_0x21a726},'transaction':_0x4be413})[_0x5bca('0x23')](function(_0x227235){if(_0x227235){return db['WhatsappApplication'][_0x5bca('0x38')]({'where':{'WhatsappAccountId':_0x21a726},'transaction':_0x4be413})[_0x5bca('0x23')](function(){var _0x358379=_['map'](_0x4e782d,function(_0x56b8b0){_0x56b8b0[_0x5bca('0x6b')]=_0x21a726;return _0x56b8b0;});return db[_0x5bca('0x82')][_0x5bca('0x83')](_0x358379,{'transaction':_0x4be413});});}else{_0x2f0d77=0x194;_0x244e73=[];}});})['then'](function(){if(_0x2f0d77!==0x194){return db[_0x5bca('0x82')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x21a726},'order':_0x5bca('0x84')})['then'](function(_0xfba2dd){_0x244e73=_0xfba2dd;});}})[_0x5bca('0x2d')](function(_0xfbf9f2){_0x2f0d77=0x1f4;logger[_0x5bca('0x29')](_0xfbf9f2[_0x5bca('0x3a')]);if(_0xfbf9f2['name']){delete _0xfbf9f2[_0x5bca('0x3b')];}_0x244e73=_0xfbf9f2;})[_0x5bca('0x85')](function(){if(_0x244e73===null){_0xebf81e[_0x5bca('0x2e')](_0x2f0d77);}else{if(_0x2f0d77===0x1f4){_0xebf81e[_0x5bca('0x33')](_0x2f0d77)['send'](_0x244e73);}else{_0xebf81e[_0x5bca('0x33')](_0x2f0d77)[_0x5bca('0x2f')](_0x244e73);}}});};exports[_0x5bca('0x86')]=function(_0x28dbe4,_0x51d4e7,_0x2039fa){var _0x1fa747={};var _0x4398db={};var _0x1dc142;var _0x175fba;return db[_0x5bca('0x58')]['findOne']({'where':{'id':_0x28dbe4['params']['id']}})[_0x5bca('0x23')](handleEntityNotFound(_0x51d4e7,null))[_0x5bca('0x23')](function(_0x1c456c){if(_0x1c456c){_0x1dc142=_0x1c456c;_0x4398db[_0x5bca('0x44')]=_['keys'](db[_0x5bca('0x82')][_0x5bca('0x41')]);_0x4398db['query']=_[_0x5bca('0x46')](_0x28dbe4[_0x5bca('0x45')]);_0x4398db[_0x5bca('0x47')]=_[_0x5bca('0x48')](_0x4398db[_0x5bca('0x44')],_0x4398db['query']);_0x1fa747[_0x5bca('0x49')]=_[_0x5bca('0x48')](_0x4398db[_0x5bca('0x44')],qs[_0x5bca('0x4a')](_0x28dbe4[_0x5bca('0x45')]['fields']));_0x1fa747[_0x5bca('0x49')]=_0x1fa747['attributes'][_0x5bca('0x4b')]?_0x1fa747[_0x5bca('0x49')]:_0x4398db['model'];_0x1fa747[_0x5bca('0x4e')]=qs[_0x5bca('0x4f')](_0x28dbe4[_0x5bca('0x45')]['sort']);_0x1fa747[_0x5bca('0x50')]=qs[_0x5bca('0x47')](_[_0x5bca('0x51')](_0x28dbe4[_0x5bca('0x45')],_0x4398db[_0x5bca('0x47')]));if(_0x28dbe4[_0x5bca('0x45')][_0x5bca('0x52')]){_0x1fa747[_0x5bca('0x50')]=_['merge'](_0x1fa747[_0x5bca('0x50')],{'$or':_[_0x5bca('0x40')](_0x1fa747['attributes'],function(_0x35bb96){var _0xe71c40={};_0xe71c40[_0x35bb96]={'$like':'%'+_0x28dbe4['query'][_0x5bca('0x52')]+'%'};return _0xe71c40;})});}_0x1fa747=_[_0x5bca('0x53')]({},_0x1fa747,_0x28dbe4[_0x5bca('0x55')]);return _0x1dc142['getApplications'](_0x1fa747);}})[_0x5bca('0x23')](function(_0x52cff0){if(_0x52cff0){_0x175fba=_0x52cff0[_0x5bca('0x4b')];if(!_0x28dbe4[_0x5bca('0x45')][_0x5bca('0x4c')](_0x5bca('0x4d'))){_0x1fa747[_0x5bca('0x32')]=qs[_0x5bca('0x32')](_0x28dbe4[_0x5bca('0x45')][_0x5bca('0x32')]);_0x1fa747['offset']=qs[_0x5bca('0x30')](_0x28dbe4[_0x5bca('0x45')][_0x5bca('0x30')]);}return _0x1dc142[_0x5bca('0x86')](_0x1fa747);}})[_0x5bca('0x23')](function(_0x10f6af){if(_0x10f6af){return _0x10f6af?{'count':_0x175fba,'rows':_0x10f6af}:null;}})[_0x5bca('0x23')](respondWithResult(_0x51d4e7,null))['catch'](handleError(_0x51d4e7,null));};exports[_0x5bca('0x87')]=function(_0x530ded,_0x18c03f,_0x98893c){var _0x2eb832={'channel':'whatsapp'};var _0x5e0046=[];var _0x3b295d=[];var _0x388be6={};return db[_0x5bca('0x58')][_0x5bca('0x5e')]({'where':{'id':_0x530ded[_0x5bca('0x5c')]['id']},'include':[{'model':db[_0x5bca('0x82')],'as':_0x5bca('0x88')}]})[_0x5bca('0x23')](handleEntityNotFound(_0x18c03f,null))[_0x5bca('0x23')](function(_0xf749ec){_0x2eb832[_0x5bca('0x89')]=_0xf749ec;if(_0x2eb832[_0x5bca('0x89')]&&_0x2eb832['account'][_0x5bca('0x43')]===_0x5bca('0x8a')&&_0x530ded[_0x5bca('0x60')][_0x5bca('0x8b')]){if(_0x530ded[_0x5bca('0x60')][_0x5bca('0x8b')]['length']===0x0)return;if(_0x530ded['body'][_0x5bca('0x8b')][0x0][_0x5bca('0x8c')]!=='read')return;return db['WhatsappMessage'][_0x5bca('0x8d')]({'read':!![],'readAt':_0x530ded[_0x5bca('0x60')][_0x5bca('0x8b')][0x0][_0x5bca('0x8e')]},{'where':{'messageId':_0x530ded[_0x5bca('0x60')][_0x5bca('0x8b')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x56a150){return _0x18c03f['status'](0xc8)[_0x5bca('0x2f')](_0x56a150);});}_0x2eb832[_0x5bca('0x8f')]=_[_0x5bca('0x90')](_0xf749ec[_0x5bca('0x88')],['priority'],[_0x5bca('0x91')]);if(_0x2eb832[_0x5bca('0x89')][_0x5bca('0x88')]){delete _0x2eb832[_0x5bca('0x89')]['Applications'];}return db['CmContact'][_0x5bca('0x69')]()[_0x5bca('0x23')](function(_0x2a8068){if(!_0x2a8068){throw new db[(_0x5bca('0x92'))][(_0x5bca('0x93'))]('no\x20available\x20attributes');}_0x5e0046=_[_0x5bca('0x94')](_[_0x5bca('0x46')](_0x2a8068),[_0x5bca('0x95'),'updatedAt']);_0x3b295d=_['difference'](_[_0x5bca('0x46')](_0x2a8068),[_0x5bca('0x95'),_0x5bca('0x96'),_0x5bca('0x97'),_0x5bca('0x98')]);_0x2eb832['body']={'mapKey':'mobile'};if(_0x2eb832[_0x5bca('0x89')]&&_0x2eb832[_0x5bca('0x89')]['type']===_0x5bca('0x99')){_0x2eb832['body'][_0x5bca('0x9a')]=_0x530ded[_0x5bca('0x60')][_0x5bca('0x9b')][_0x5bca('0x9c')](_0x5bca('0x9d'),'');_0x2eb832[_0x5bca('0x60')][_0x5bca('0x60')]=_0x530ded[_0x5bca('0x60')][_0x5bca('0x9e')];_0x2eb832['body'][_0x5bca('0x9f')]=_0x530ded[_0x5bca('0x60')][_0x5bca('0xa0')];}if(_0x2eb832[_0x5bca('0x89')]&&_0x2eb832[_0x5bca('0x89')][_0x5bca('0x43')]==='sinch'){_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9a')]=_0x530ded[_0x5bca('0x60')][_0x5bca('0xa1')][0x0][_0x5bca('0x9a')];_0x2eb832['body'][_0x5bca('0x60')]=_0x530ded[_0x5bca('0x60')][_0x5bca('0xa1')][0x0][_0x5bca('0x2b')]['body'];_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9f')]=_0x530ded['body'][_0x5bca('0xa1')][0x0][_0x5bca('0xa2')];}if(_0x2eb832[_0x5bca('0x60')]['id']){delete _0x2eb832['body']['id'];}if(_['isNil'](_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9a')])){throw new db['Sequelize'][(_0x5bca('0x93'))](_0x5bca('0xa3'));}if(_['isNil'](_0x2eb832['body'][_0x5bca('0x60')])||_0x2eb832[_0x5bca('0x60')][_0x5bca('0x60')]===''){throw new db[(_0x5bca('0x92'))]['ValidationError'](_0x5bca('0xa4'));}if(_[_0x5bca('0xa5')](_0x2eb832[_0x5bca('0x60')][_0x5bca('0xa6')])){throw new db[(_0x5bca('0x92'))]['ValidationError'](_0x5bca('0xa7')+_0x3b295d);}if(!_[_0x5bca('0xa8')](_0x3b295d,_0x2eb832[_0x5bca('0x60')][_0x5bca('0xa6')])){throw new db[(_0x5bca('0x92'))][(_0x5bca('0x93'))](_0x5bca('0xa9')+_0x3b295d);}_0x388be6[_0x2eb832['body'][_0x5bca('0xa6')]]=_0x2eb832['body'][_0x5bca('0x9a')];return db[_0x5bca('0xaa')][_0x5bca('0x5e')]({'where':{'id':_0x2eb832[_0x5bca('0x89')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x5bca('0xab'),'where':_0x388be6,'limit':0x1,'order':[[_0x5bca('0x96'),'DESC']]}]});})[_0x5bca('0x23')](handleEntityNotFound(_0x18c03f,null))['then'](function(_0x5153ab){if(_0x5153ab){_0x2eb832['list']=_['omit'](_0x5153ab,[_0x5bca('0xab')]);if(_0x5153ab[_0x5bca('0xab')][_0x5bca('0x4b')]){return _0x5153ab[_0x5bca('0xab')][0x0];}var _0xa316b=_[_0x5bca('0x1b')](_0x2eb832[_0x5bca('0x60')],{'firstName':_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9a')],'ListId':_0x5153ab['id']});_0xa316b[_0x2eb832[_0x5bca('0x60')][_0x5bca('0xa6')]]=_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9a')];return db[_0x5bca('0xac')][_0x5bca('0x5f')](_0xa316b,{'fields':_0x5e0046,'raw':!![]});}})['then'](handleEntityNotFound(_0x18c03f,null))[_0x5bca('0x23')](function(_0x2ef78a){if(_0x2ef78a){_0x2eb832[_0x5bca('0xad')]=_0x2ef78a;var _0x238f34={'ContactId':_0x2ef78a['id'],'phone':_0x2eb832['body'][_0x5bca('0x9a')],'WhatsappAccountId':_0x530ded[_0x5bca('0x5c')]['id']};var _0xee01a3={'ContactId':_0x2ef78a['id'],'WhatsappAccountId':_0x530ded['params']['id'],'closed':![]};return db[_0x5bca('0xae')][_0x5bca('0x5e')]({'where':_0xee01a3})['then'](function(_0x504b49){if(_0x504b49){return[_0x504b49,![]];}return db[_0x5bca('0xae')][_0x5bca('0x5f')](_0x238f34)[_0x5bca('0x23')](function(_0x47c20e){return[_0x47c20e,!![]];});});}})[_0x5bca('0xaf')](function(_0x2d861e,_0x3bc17d){_0x2eb832[_0x5bca('0xb0')]=_0x2d861e['get']({'plain':!![]});_0x2eb832[_0x5bca('0xb0')][_0x5bca('0xb1')]=![];if(_0x3bc17d){if(_0x2eb832[_0x5bca('0x89')][_0x5bca('0xb2')]){_0x2eb832[_0x5bca('0x8f')][_0x5bca('0xb3')]({'id':0x0,'priority':_0x2eb832[_0x5bca('0x8f')][_0x5bca('0x4b')]+0x1,'app':_0x5bca('0xb4'),'appdata':_0x5bca('0xb5'),'interval':_0x5bca('0xb6')});}_0x2eb832['interaction']['created']=!![];}return db['WhatsappMessage'][_0x5bca('0x5f')]({'phone':_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9a')],'messageId':_0x2eb832[_0x5bca('0x60')][_0x5bca('0x9f')],'body':_0x2eb832['body']['body'],'WhatsappAccountId':_0x530ded[_0x5bca('0x5c')]['id'],'WhatsappInteractionId':_0x2d861e['id'],'direction':'in','ContactId':_0x2d861e['ContactId'],'AttachmentId':_0x2eb832['body'][_0x5bca('0xb7')]});})[_0x5bca('0x23')](function(_0xea691a){_0x2eb832[_0x5bca('0x2b')]=_0xea691a;if(_0x2eb832['interaction'][_0x5bca('0xb8')]){return db[_0x5bca('0x7b')][_0x5bca('0x5e')]({'attributes':['id','name'],'where':{'id':_0x2eb832[_0x5bca('0xb0')][_0x5bca('0xb8')]}})[_0x5bca('0x23')](function(_0x1de3a7){if(_0x1de3a7){_0x2eb832[_0x5bca('0x8f')][_0x5bca('0xb9')]({'id':0x0,'priority':0x0,'app':_0x5bca('0xba'),'appdata':_0x1de3a7[_0x5bca('0x3b')]+','+(_0x2eb832[_0x5bca('0x89')][_0x5bca('0xbb')]||0xa),'interval':_0x5bca('0xb6')});}return respondWithRpcPromise(_0x5bca('0xbc'),_0x5bca('0xbd'),_0x2eb832);});}return respondWithRpcPromise('Start',_0x5bca('0xbd'),_0x2eb832);})[_0x5bca('0x23')](function(_0x159e28){if(_0x159e28){var _0x252184=0xc8;var _0x409e41='receiveMessage';logger[_0x5bca('0x24')](_0x5bca('0x26'),_0x409e41,_0x252184,_0x5bca('0xbe'));logger[_0x5bca('0xbf')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x409e41,_0x252184,_0x5bca('0xbe'),JSON[_0x5bca('0x28')](_0x159e28));if(_0x2eb832['account'][_0x5bca('0x43')]===_0x5bca('0x99')){return _0x18c03f[_0x5bca('0x33')](_0x252184)[_0x5bca('0x34')](_0x5bca('0xc0'),_0x5bca('0xc1'))['send'](_0x5bca('0xc2'));}else{return _0x18c03f[_0x5bca('0x33')](_0x252184)[_0x5bca('0x2f')](_0x159e28);}}});})['catch'](handleError(_0x18c03f,null));};exports[_0x5bca('0x3c')]=function(_0x21e914,_0x5d973b,_0x50fd6d){var _0x269b4d,_0x437935,_0x1b9068;if(_[_0x5bca('0xa5')](_0x21e914[_0x5bca('0x60')][_0x5bca('0x60')])||_0x21e914[_0x5bca('0x60')]['body']===''){throw new db['Sequelize'][(_0x5bca('0x93'))](_0x5bca('0xa4'));}if(_['isNil'](_0x21e914[_0x5bca('0x60')]['to'])){throw new db[(_0x5bca('0x92'))][(_0x5bca('0x93'))](_0x5bca('0xc3'));}_0x269b4d=_0x21e914[_0x5bca('0x60')]['to'];return db[_0x5bca('0x58')]['find']({'where':{'id':_0x21e914[_0x5bca('0x5c')]['id']},'include':[{'model':db[_0x5bca('0xaa')],'as':_0x5bca('0xc4'),'include':[{'model':db['CmContact'],'as':_0x5bca('0xab'),'where':{'mobile':_0x269b4d},'limit':0x1,'order':[[_0x5bca('0x96'),'DESC']]}]}]})[_0x5bca('0x23')](handleEntityNotFound(_0x5d973b,null))[_0x5bca('0x23')](function(_0x7c280a){if(_0x7c280a&&_0x7c280a['List']){_0x437935=_0x7c280a[_0x5bca('0x64')]({'plain':!![]});if(_0x437935[_0x5bca('0xc4')]&&_0x437935[_0x5bca('0xc4')]['Contacts'][_0x5bca('0x4b')]){return _0x437935[_0x5bca('0xc4')][_0x5bca('0xab')][0x0];}return db[_0x5bca('0xac')][_0x5bca('0x5f')](_[_0x5bca('0x1b')](_0x21e914[_0x5bca('0x60')],{'firstName':_0x269b4d,'mobile':_0x269b4d,'phone':_0x269b4d,'ListId':_0x437935['ListId']}));}})['then'](handleEntityNotFound(_0x5d973b,null))[_0x5bca('0x23')](function(_0x5b11ed){if(_0x5b11ed){_0x1b9068=_0x5b11ed;return db[_0x5bca('0xae')][_0x5bca('0x5e')]({'where':{'ContactId':_0x1b9068['id'],'closed':![],'WhatsappAccountId':_0x437935['id']}})[_0x5bca('0x23')](function(_0x4adcc0){if(_0x4adcc0){return[_0x4adcc0,![]];}return db[_0x5bca('0xae')][_0x5bca('0x5f')]({'UserId':_0x21e914['user']['id'],'ContactId':_0x1b9068['id'],'WhatsappAccountId':_0x437935['id'],'phone':_0x269b4d,'firstMsgDirection':_0x5bca('0xc5'),'Messages':[_['merge'](_0x21e914['body'],{'read':![],'body':_0x21e914['body'][_0x5bca('0x60')],'phone':_0x269b4d,'WhatsappAccountId':_0x437935['id'],'UserId':_0x21e914[_0x5bca('0x63')]['id'],'ContactId':_0x1b9068['id']})]},{'include':[{'model':db[_0x5bca('0xc6')],'as':_0x5bca('0xc7')}]})['then'](function(_0x49e794){return[_0x49e794,!![]];});});}})[_0x5bca('0xaf')](function(_0x2aa4d4,_0x414464){if(_0x414464){return _0x2aa4d4;}return db['WhatsappMessage'][_0x5bca('0x5f')](_[_0x5bca('0x53')](_0x21e914[_0x5bca('0x60')],{'read':![],'body':_0x21e914['body'][_0x5bca('0x60')],'phone':_0x269b4d,'WhatsappAccountId':_0x437935['id'],'WhatsappInteractionId':_0x2aa4d4['id'],'UserId':_0x21e914[_0x5bca('0x63')]['id'],'ContactId':_0x1b9068['id']}))[_0x5bca('0x23')](function(_0x18f973){_0x2aa4d4[_0x5bca('0xc8')][_0x5bca('0xc7')]=[];_0x2aa4d4[_0x5bca('0xc8')][_0x5bca('0xc7')][_0x5bca('0xb3')](_0x18f973[_0x5bca('0xc8')]);return _0x2aa4d4;});})[_0x5bca('0x23')](respondWithResult(_0x5d973b,null))[_0x5bca('0x2d')](handleError(_0x5d973b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f2cb377..f98e6aa 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 _0xe3d1=['remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','update'];(function(_0x2a09bc,_0x20f4a4){var _0x2ec3e3=function(_0x396c3c){while(--_0x396c3c){_0x2a09bc['push'](_0x2a09bc['shift']());}};_0x2ec3e3(++_0x20f4a4);}(_0xe3d1,0x14d));var _0x1e3d=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0xe3d1[_0x5ed54b];return _0x4b58c7;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x1e3d('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1e3d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e3d('0x2'),'afterDestroy':_0x1e3d('0x3')};function emitEvent(_0x130b6d){return function(_0x598d05,_0x4f06e8,_0x17f852){WhatsappAccountEvents[_0x1e3d('0x4')](_0x130b6d+':'+_0x598d05['id'],_0x598d05);WhatsappAccountEvents['emit'](_0x130b6d,_0x598d05);_0x17f852(null);};}for(var e in events){if(events[_0x1e3d('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x1e3d('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x0d56=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x2612cb,_0x5d8647){var _0x5075a7=function(_0x337920){while(--_0x337920){_0x2612cb['push'](_0x2612cb['shift']());}};_0x5075a7(++_0x5d8647);}(_0x0d56,0xc9));var _0x60d5=function(_0x1d1031,_0x4c8354){_0x1d1031=_0x1d1031-0x0;var _0x371d1b=_0x0d56[_0x1d1031];return _0x371d1b;};'use strict';var EventEmitter=require(_0x60d5('0x0'));var WhatsappAccount=require(_0x60d5('0x1'))['db'][_0x60d5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x60d5('0x3')](0x0);var events={'afterCreate':_0x60d5('0x4'),'afterUpdate':_0x60d5('0x5'),'afterDestroy':_0x60d5('0x6')};function emitEvent(_0x34d3f2){return function(_0x15b659,_0x2e9a84,_0x5d4ba0){WhatsappAccountEvents['emit'](_0x34d3f2+':'+_0x15b659['id'],_0x15b659);WhatsappAccountEvents['emit'](_0x34d3f2,_0x15b659);_0x5d4ba0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x60d5('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 44a9336..15e89b4 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 _0x6381=['./whatsappAccount.attributes','exports','WhatsappAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x24bd83,_0x1830c4){var _0x3a047e=function(_0x5d8bc4){while(--_0x5d8bc4){_0x24bd83['push'](_0x24bd83['shift']());}};_0x3a047e(++_0x1830c4);}(_0x6381,0x1ef));var _0x1638=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6381[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1638('0x0'));var util=require(_0x1638('0x1'));var logger=require(_0x1638('0x2'))(_0x1638('0x3'));var moment=require(_0x1638('0x4'));var BPromise=require(_0x1638('0x5'));var rp=require(_0x1638('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1638('0x7'));var config=require(_0x1638('0x8'));var attributes=require(_0x1638('0x9'));module[_0x1638('0xa')]=function(_0x201420,_0x2ac003){return _0x201420['define'](_0x1638('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b6e=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount','lodash'];(function(_0x5bd938,_0x1f02f2){var _0x283b61=function(_0x8eae88){while(--_0x8eae88){_0x5bd938['push'](_0x5bd938['shift']());}};_0x283b61(++_0x1f02f2);}(_0x8b6e,0x143));var _0xe8b6=function(_0x1e9549,_0x50c47b){_0x1e9549=_0x1e9549-0x0;var _0x57935d=_0x8b6e[_0x1e9549];return _0x57935d;};'use strict';var _=require(_0xe8b6('0x0'));var util=require(_0xe8b6('0x1'));var logger=require(_0xe8b6('0x2'))(_0xe8b6('0x3'));var moment=require(_0xe8b6('0x4'));var BPromise=require(_0xe8b6('0x5'));var rp=require(_0xe8b6('0x6'));var fs=require('fs');var path=require(_0xe8b6('0x7'));var rimraf=require('rimraf');var config=require(_0xe8b6('0x8'));var attributes=require(_0xe8b6('0x9'));module[_0xe8b6('0xa')]=function(_0x31ca77,_0x31f07e){return _0x31ca77['define'](_0xe8b6('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 4fa1218..de3226d 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 _0x1573=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','model','map','lodash','bluebird','randomstring','ioredis'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x1573,0x193));var _0x3157=function(_0x85d56d,_0x37f5c1){_0x85d56d=_0x85d56d-0x0;var _0x51f613=_0x1573[_0x85d56d];return _0x51f613;};'use strict';var _=require(_0x3157('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3157('0x1'));var rs=require(_0x3157('0x2'));var fs=require('fs');var Redis=require(_0x3157('0x3'));var db=require(_0x3157('0x4'))['db'];var utils=require(_0x3157('0x5'));var logger=require(_0x3157('0x6'))(_0x3157('0x7'));var config=require(_0x3157('0x8'));var jayson=require(_0x3157('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3157('0xa')]=_['defaults'](config[_0x3157('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3157('0xb'))(new Redis(config[_0x3157('0xa')]));require(_0x3157('0xc'))[_0x3157('0xd')](socket);function respondWithRpcPromise(_0x5ba0a7,_0x56d8e7,_0x4e39d8){return new BPromise(function(_0x5a647e,_0x370683){return client[_0x3157('0xe')](_0x5ba0a7,_0x4e39d8)[_0x3157('0xf')](function(_0x2a225b){logger[_0x3157('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x56d8e7,_0x3157('0x11'));logger[_0x3157('0x12')](_0x3157('0x13'),_0x56d8e7,_0x3157('0x11'),JSON[_0x3157('0x14')](_0x2a225b));if(_0x2a225b['error']){if(_0x2a225b[_0x3157('0x15')][_0x3157('0x16')]===0x1f4){logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);return _0x370683(_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);}logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);return _0x5a647e(_0x2a225b[_0x3157('0x15')][_0x3157('0x18')]);}else{logger[_0x3157('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x56d8e7,_0x3157('0x11'));_0x5a647e(_0x2a225b[_0x3157('0x19')][_0x3157('0x18')]);}})[_0x3157('0x1a')](function(_0x4225ad){logger[_0x3157('0x15')](_0x3157('0x17'),_0x56d8e7,_0x4225ad);_0x370683(_0x4225ad);});});}exports[_0x3157('0x1b')]=function(_0x499084){var _0xfc3927=this;return new Promise(function(_0x3a09d9,_0x21694f){return db[_0x3157('0x1c')][_0x3157('0x1d')]({'raw':_0x499084['options']?_0x499084['options'][_0x3157('0x1e')]===undefined?!![]:![]:!![],'where':_0x499084[_0x3157('0x1f')]?_0x499084[_0x3157('0x1f')][_0x3157('0x20')]||null:null,'attributes':_0x499084['options']?_0x499084[_0x3157('0x1f')][_0x3157('0x21')]||null:null,'include':_0x499084[_0x3157('0x1f')]?_0x499084[_0x3157('0x1f')][_0x3157('0x22')]?_['map'](_0x499084['options'][_0x3157('0x22')],function(_0x5cd093){return{'model':db[_0x5cd093[_0x3157('0x23')]],'as':_0x5cd093['as'],'attributes':_0x5cd093['attributes'],'include':_0x5cd093[_0x3157('0x22')]?_[_0x3157('0x24')](_0x5cd093['include'],function(_0x23fbda){return{'model':db[_0x23fbda[_0x3157('0x23')]],'as':_0x23fbda['as'],'attributes':_0x23fbda[_0x3157('0x21')],'include':_0x23fbda[_0x3157('0x22')]?_[_0x3157('0x24')](_0x23fbda[_0x3157('0x22')],function(_0x1cc4f8){return{'model':db[_0x1cc4f8['model']],'as':_0x1cc4f8['as'],'attributes':_0x1cc4f8[_0x3157('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3157('0xf')](function(_0x1edbd3){logger[_0x3157('0x10')](_0x3157('0x1b'),_0x499084);logger[_0x3157('0x12')](_0x3157('0x1b'),_0x499084,JSON['stringify'](_0x1edbd3));_0x3a09d9(_0x1edbd3);})[_0x3157('0x1a')](function(_0x513075){logger[_0x3157('0x15')]('ShowWhatsappAccount',_0x513075['message'],_0x499084);_0x21694f(_0xfc3927[_0x3157('0x15')](0x1f4,_0x513075[_0x3157('0x18')]));});});}; \ No newline at end of file +var _0xf745=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','randomstring'];(function(_0x4bab88,_0x495d2c){var _0x408938=function(_0x4925cc){while(--_0x4925cc){_0x4bab88['push'](_0x4bab88['shift']());}};_0x408938(++_0x495d2c);}(_0xf745,0xe6));var _0x5f74=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf745[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5f74('0x0'));var util=require(_0x5f74('0x1'));var moment=require(_0x5f74('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f74('0x3'));var fs=require('fs');var Redis=require(_0x5f74('0x4'));var db=require(_0x5f74('0x5'))['db'];var utils=require(_0x5f74('0x6'));var logger=require(_0x5f74('0x7'))(_0x5f74('0x8'));var config=require(_0x5f74('0x9'));var jayson=require(_0x5f74('0xa'));var client=jayson[_0x5f74('0xb')]['http']({'port':0x232a});config[_0x5f74('0xc')]=_[_0x5f74('0xd')](config[_0x5f74('0xc')],{'host':_0x5f74('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f74('0xc')]));require(_0x5f74('0xf'))[_0x5f74('0x10')](socket);function respondWithRpcPromise(_0x184a6f,_0x201c2e,_0x177f6b){return new BPromise(function(_0x30110f,_0x134890){return client[_0x5f74('0x11')](_0x184a6f,_0x177f6b)[_0x5f74('0x12')](function(_0x514d5c){logger[_0x5f74('0x13')](_0x5f74('0x14'),_0x201c2e,_0x5f74('0x15'));logger[_0x5f74('0x16')](_0x5f74('0x17'),_0x201c2e,'request\x20sent',JSON[_0x5f74('0x18')](_0x514d5c));if(_0x514d5c[_0x5f74('0x19')]){if(_0x514d5c[_0x5f74('0x19')][_0x5f74('0x1a')]===0x1f4){logger[_0x5f74('0x19')](_0x5f74('0x14'),_0x201c2e,_0x514d5c[_0x5f74('0x19')]['message']);return _0x134890(_0x514d5c[_0x5f74('0x19')][_0x5f74('0x1b')]);}logger[_0x5f74('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x201c2e,_0x514d5c['error'][_0x5f74('0x1b')]);return _0x30110f(_0x514d5c['error']['message']);}else{logger[_0x5f74('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x201c2e,_0x5f74('0x15'));_0x30110f(_0x514d5c['result'][_0x5f74('0x1b')]);}})[_0x5f74('0x1c')](function(_0x312229){logger[_0x5f74('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x201c2e,_0x312229);_0x134890(_0x312229);});});}exports['ShowWhatsappAccount']=function(_0x48944a){var _0x5119bc=this;return new Promise(function(_0x19d51a,_0xa86519){return db[_0x5f74('0x1d')][_0x5f74('0x1e')]({'raw':_0x48944a[_0x5f74('0x1f')]?_0x48944a[_0x5f74('0x1f')][_0x5f74('0x20')]===undefined?!![]:![]:!![],'where':_0x48944a[_0x5f74('0x1f')]?_0x48944a[_0x5f74('0x1f')][_0x5f74('0x21')]||null:null,'attributes':_0x48944a[_0x5f74('0x1f')]?_0x48944a['options'][_0x5f74('0x22')]||null:null,'include':_0x48944a[_0x5f74('0x1f')]?_0x48944a['options'][_0x5f74('0x23')]?_[_0x5f74('0x24')](_0x48944a[_0x5f74('0x1f')]['include'],function(_0x156637){return{'model':db[_0x156637[_0x5f74('0x25')]],'as':_0x156637['as'],'attributes':_0x156637[_0x5f74('0x22')],'include':_0x156637[_0x5f74('0x23')]?_['map'](_0x156637['include'],function(_0x2c443f){return{'model':db[_0x2c443f[_0x5f74('0x25')]],'as':_0x2c443f['as'],'attributes':_0x2c443f[_0x5f74('0x22')],'include':_0x2c443f['include']?_[_0x5f74('0x24')](_0x2c443f[_0x5f74('0x23')],function(_0x357aff){return{'model':db[_0x357aff['model']],'as':_0x357aff['as'],'attributes':_0x357aff[_0x5f74('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5f74('0x12')](function(_0x2be098){logger[_0x5f74('0x13')]('ShowWhatsappAccount',_0x48944a);logger[_0x5f74('0x16')](_0x5f74('0x26'),_0x48944a,JSON[_0x5f74('0x18')](_0x2be098));_0x19d51a(_0x2be098);})[_0x5f74('0x1c')](function(_0x4fcb44){logger[_0x5f74('0x19')](_0x5f74('0x26'),_0x4fcb44['message'],_0x48944a);_0xa86519(_0x5119bc[_0x5f74('0x19')](0x1f4,_0x4fcb44[_0x5f74('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 13c82d0..c2046f9 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 _0xb1ca=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener'];(function(_0x20dc39,_0x5f261f){var _0x26a52b=function(_0x54ad3a){while(--_0x54ad3a){_0x20dc39['push'](_0x20dc39['shift']());}};_0x26a52b(++_0x5f261f);}(_0xb1ca,0x14a));var _0xab1c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb1ca[_0x2c7618];return _0x5ce3f0;};'use strict';var WhatsappAccountEvents=require(_0xab1c('0x0'));var events=[_0xab1c('0x1'),_0xab1c('0x2'),_0xab1c('0x3')];function createListener(_0x4e6066,_0x553d8c){return function(_0x2dfa4f){_0x553d8c[_0xab1c('0x4')](_0x4e6066,_0x2dfa4f);};}function removeListener(_0x2a88b6,_0x98266){return function(){WhatsappAccountEvents[_0xab1c('0x5')](_0x2a88b6,_0x98266);};}exports['register']=function(_0xb13ed9){for(var _0x26b468=0x0,_0x5aa9cc=events['length'];_0x26b468<_0x5aa9cc;_0x26b468++){var _0x34bf1f=events[_0x26b468];var _0x2d37fd=createListener(_0xab1c('0x6')+_0x34bf1f,_0xb13ed9);WhatsappAccountEvents['on'](_0x34bf1f,_0x2d37fd);}}; \ No newline at end of file +var _0x0384=['length','whatsappAccount:','save','remove','update'];(function(_0x9220ff,_0x5dcaee){var _0x13d8fd=function(_0x4e6e0d){while(--_0x4e6e0d){_0x9220ff['push'](_0x9220ff['shift']());}};_0x13d8fd(++_0x5dcaee);}(_0x0384,0x1b5));var _0x4038=function(_0x460d33,_0x323deb){_0x460d33=_0x460d33-0x0;var _0x6d9eb2=_0x0384[_0x460d33];return _0x6d9eb2;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x4038('0x0'),_0x4038('0x1'),_0x4038('0x2')];function createListener(_0x120328,_0x1e3efc){return function(_0x1ca8c5){_0x1e3efc['emit'](_0x120328,_0x1ca8c5);};}function removeListener(_0x107137,_0x2f481d){return function(){WhatsappAccountEvents['removeListener'](_0x107137,_0x2f481d);};}exports['register']=function(_0x559a13){for(var _0x29ce22=0x0,_0x2de186=events[_0x4038('0x3')];_0x29ce22<_0x2de186;_0x29ce22++){var _0x4b62ed=events[_0x29ce22];var _0x3011ec=createListener(_0x4038('0x4')+_0x4b62ed,_0x559a13);WhatsappAccountEvents['on'](_0x4b62ed,_0x3011ec);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 9b899fe..9a964b4 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 _0x68dd=['delete','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x68dd,0x159));var _0xd68d=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x68dd[_0x292f93];return _0x5a94b1;};'use strict';var multer=require(_0xd68d('0x0'));var util=require(_0xd68d('0x1'));var path=require(_0xd68d('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(_0xd68d('0x3'));var config=require(_0xd68d('0x4'));var controller=require(_0xd68d('0x5'));router[_0xd68d('0x6')]('/',auth[_0xd68d('0x7')](),controller[_0xd68d('0x8')]);router[_0xd68d('0x6')](_0xd68d('0x9'),auth['isAuthenticated'](),controller[_0xd68d('0xa')]);router[_0xd68d('0xb')]('/',auth[_0xd68d('0x7')](),controller[_0xd68d('0xc')]);router[_0xd68d('0xd')](_0xd68d('0x9'),auth['isAuthenticated'](),controller[_0xd68d('0xe')]);router[_0xd68d('0xf')](_0xd68d('0x9'),auth[_0xd68d('0x7')](),controller[_0xd68d('0x10')]);module[_0xd68d('0x11')]=router; \ No newline at end of file +var _0x7115=['show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','index','get','/:id','isAuthenticated'];(function(_0x904003,_0x1fdb5c){var _0x243bc5=function(_0x2a86f6){while(--_0x2a86f6){_0x904003['push'](_0x904003['shift']());}};_0x243bc5(++_0x1fdb5c);}(_0x7115,0x183));var _0x5711=function(_0x327c12,_0x2874c9){_0x327c12=_0x327c12-0x0;var _0x4cd602=_0x7115[_0x327c12];return _0x4cd602;};'use strict';var multer=require(_0x5711('0x0'));var util=require(_0x5711('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5711('0x2'));var router=express[_0x5711('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5711('0x4'));var interaction=require(_0x5711('0x5'));var config=require(_0x5711('0x6'));var controller=require(_0x5711('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5711('0x8')]);router[_0x5711('0x9')](_0x5711('0xa'),auth[_0x5711('0xb')](),controller[_0x5711('0xc')]);router[_0x5711('0xd')]('/',auth[_0x5711('0xb')](),controller[_0x5711('0xe')]);router[_0x5711('0xf')](_0x5711('0xa'),auth[_0x5711('0xb')](),controller[_0x5711('0x10')]);router[_0x5711('0x11')](_0x5711('0xa'),auth[_0x5711('0xb')](),controller[_0x5711('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 9b1644d..d546845 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 _0x31a7=['TEXT','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x31a7,0x172));var _0x731a=function(_0x324c27,_0x4383d8){_0x324c27=_0x324c27-0x0;var _0x5782a7=_0x31a7[_0x324c27];return _0x5782a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x731a('0x0')]()},'description':{'type':Sequelize[_0x731a('0x1')]},'interval':{'type':Sequelize[_0x731a('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4406=['TEXT','STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x53a429,_0x2ee53f){var _0x841f99=function(_0xfe32fe){while(--_0xfe32fe){_0x53a429['push'](_0x53a429['shift']());}};_0x841f99(++_0x2ee53f);}(_0x4406,0xa5));var _0x6440=function(_0x1c08f6,_0x14c077){_0x1c08f6=_0x1c08f6-0x0;var _0xbc156a=_0x4406[_0x1c08f6];return _0xbc156a;};'use strict';var Sequelize=require('sequelize');module[_0x6440('0x0')]={'priority':{'type':Sequelize[_0x6440('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6440('0x2')},'appdata':{'type':Sequelize[_0x6440('0x3')]()},'description':{'type':Sequelize[_0x6440('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6440('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e32f9be..3f04346 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 _0xb1fa=['send','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','zip-dir','request-promise','sox','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','sendStatus','error','stack','name'];(function(_0x3ad4e1,_0x3d2ca8){var _0x21ca64=function(_0x13f86a){while(--_0x13f86a){_0x3ad4e1['push'](_0x3ad4e1['shift']());}};_0x21ca64(++_0x3d2ca8);}(_0xb1fa,0x9e));var _0xab1f=function(_0x4a80fa,_0x2eb951){_0x4a80fa=_0x4a80fa-0x0;var _0x56daa0=_0xb1fa[_0x4a80fa];return _0x56daa0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab1f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xab1f('0x2'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1f('0x3'));var squel=require('squel');var crypto=require(_0xab1f('0x4'));var jsforce=require(_0xab1f('0x5'));var deskjs=require('desk.js');var toCsv=require(_0xab1f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab1f('0x7'));var authService=require(_0xab1f('0x8'));var qs=require(_0xab1f('0x9'));var as=require(_0xab1f('0xa'));var hardwareService=require(_0xab1f('0xb'));var logger=require('../../config/logger')(_0xab1f('0xc'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab1f('0xd'));var db=require(_0xab1f('0xe'))['db'];function respondWithStatusCode(_0x5168bb,_0x4cb402){_0x4cb402=_0x4cb402||0xcc;return function(_0xea4a03){if(_0xea4a03){return _0x5168bb['sendStatus'](_0x4cb402);}return _0x5168bb[_0xab1f('0xf')](_0x4cb402)[_0xab1f('0x10')]();};}function respondWithResult(_0x68b4e4,_0x58a0fb){_0x58a0fb=_0x58a0fb||0xc8;return function(_0x2ee266){if(_0x2ee266){return _0x68b4e4[_0xab1f('0xf')](_0x58a0fb)[_0xab1f('0x11')](_0x2ee266);}};}function respondWithFilteredResult(_0x1c0260,_0x5124d6){return function(_0x33fc3a){if(_0x33fc3a){var _0x4c68b0=typeof _0x5124d6[_0xab1f('0x12')]===_0xab1f('0x13')&&typeof _0x5124d6[_0xab1f('0x14')]==='undefined';var _0x1582bd=_0x33fc3a[_0xab1f('0x15')];var _0x558c52=_0x4c68b0?0x0:_0x5124d6[_0xab1f('0x12')];var _0x4ba3f4=_0x4c68b0?_0x33fc3a[_0xab1f('0x15')]:_0x5124d6[_0xab1f('0x12')]+_0x5124d6[_0xab1f('0x14')];var _0x547fc0;if(_0x4ba3f4>=_0x1582bd){_0x4ba3f4=_0x1582bd;_0x547fc0=0xc8;}else{_0x547fc0=0xce;}_0x1c0260[_0xab1f('0xf')](_0x547fc0);return _0x1c0260[_0xab1f('0x16')]('Content-Range',_0x558c52+'-'+_0x4ba3f4+'/'+_0x1582bd)[_0xab1f('0x11')](_0x33fc3a);}return null;};}function patchUpdates(_0x30f973){return function(_0x4fe6d7){try{jsonpatch['apply'](_0x4fe6d7,_0x30f973,!![]);}catch(_0x3103e1){return BPromise[_0xab1f('0x17')](_0x3103e1);}return _0x4fe6d7[_0xab1f('0x18')]();};}function saveUpdates(_0x425b61,_0x1bd51b){return function(_0x2915b9){if(_0x2915b9){return _0x2915b9[_0xab1f('0x19')](_0x425b61)['then'](function(_0x37ae5e){return _0x37ae5e;});}return null;};}function removeEntity(_0x85f20a,_0x3662b8){return function(_0x33b647){if(_0x33b647){return _0x33b647['destroy']()[_0xab1f('0x1a')](function(){_0x85f20a[_0xab1f('0xf')](0xcc)[_0xab1f('0x10')]();});}};}function handleEntityNotFound(_0x162041,_0x5e5434){return function(_0x153083){if(!_0x153083){_0x162041[_0xab1f('0x1b')](0x194);}return _0x153083;};}function handleError(_0xaae884,_0x173a11){_0x173a11=_0x173a11||0x1f4;return function(_0x27d4c3){logger[_0xab1f('0x1c')](_0x27d4c3[_0xab1f('0x1d')]);if(_0x27d4c3['name']){delete _0x27d4c3[_0xab1f('0x1e')];}_0xaae884['status'](_0x173a11)[_0xab1f('0x1f')](_0x27d4c3);};}exports['index']=function(_0x3357b9,_0xf55a53){var _0x2e9ac4={},_0x449e16={},_0x137042={'count':0x0,'rows':[]};var _0x3a6d9d=_[_0xab1f('0x20')](db[_0xab1f('0x21')][_0xab1f('0x22')],function(_0x5d924b){return{'name':_0x5d924b[_0xab1f('0x23')],'type':_0x5d924b['type'][_0xab1f('0x24')]};});_0x449e16[_0xab1f('0x25')]=_[_0xab1f('0x20')](_0x3a6d9d,_0xab1f('0x1e'));_0x449e16[_0xab1f('0x26')]=_['keys'](_0x3357b9[_0xab1f('0x26')]);_0x449e16[_0xab1f('0x27')]=_[_0xab1f('0x28')](_0x449e16['model'],_0x449e16[_0xab1f('0x26')]);_0x2e9ac4['attributes']=_[_0xab1f('0x28')](_0x449e16['model'],qs[_0xab1f('0x29')](_0x3357b9['query'][_0xab1f('0x29')]));_0x2e9ac4[_0xab1f('0x2a')]=_0x2e9ac4[_0xab1f('0x2a')][_0xab1f('0x2b')]?_0x2e9ac4['attributes']:_0x449e16['model'];if(!_0x3357b9[_0xab1f('0x26')]['hasOwnProperty'](_0xab1f('0x2c'))){_0x2e9ac4[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x14')]);_0x2e9ac4[_0xab1f('0x12')]=qs['offset'](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x12')]);}_0x2e9ac4['order']=qs['sort'](_0x3357b9[_0xab1f('0x26')][_0xab1f('0x2d')]);_0x2e9ac4[_0xab1f('0x2e')]=qs[_0xab1f('0x27')](_[_0xab1f('0x2f')](_0x3357b9[_0xab1f('0x26')],_0x449e16['filters']),_0x3a6d9d);if(_0x3357b9[_0xab1f('0x26')][_0xab1f('0x30')]){_0x2e9ac4[_0xab1f('0x2e')]=_[_0xab1f('0x31')](_0x2e9ac4[_0xab1f('0x2e')],{'$or':_[_0xab1f('0x20')](_0x3a6d9d,function(_0x2bfbae){if(_0x2bfbae['type']!==_0xab1f('0x32')){var _0x315ea1={};_0x315ea1[_0x2bfbae[_0xab1f('0x1e')]]={'$like':'%'+_0x3357b9[_0xab1f('0x26')][_0xab1f('0x30')]+'%'};return _0x315ea1;}})});}_0x2e9ac4=_[_0xab1f('0x31')]({},_0x2e9ac4,_0x3357b9[_0xab1f('0x33')]);var _0x3579e5={'where':_0x2e9ac4[_0xab1f('0x2e')]};return db['WhatsappApplication'][_0xab1f('0x15')](_0x3579e5)[_0xab1f('0x1a')](function(_0x2879bd){_0x137042[_0xab1f('0x15')]=_0x2879bd;if(_0x3357b9[_0xab1f('0x26')][_0xab1f('0x34')]){_0x2e9ac4[_0xab1f('0x35')]=[{'all':!![]}];}return db[_0xab1f('0x21')][_0xab1f('0x36')](_0x2e9ac4);})[_0xab1f('0x1a')](function(_0xe349a6){_0x137042[_0xab1f('0x37')]=_0xe349a6;return _0x137042;})[_0xab1f('0x1a')](respondWithFilteredResult(_0xf55a53,_0x2e9ac4))[_0xab1f('0x38')](handleError(_0xf55a53,null));};exports[_0xab1f('0x39')]=function(_0x58ec4c,_0x13f7e2){var _0x4e0943={'raw':!![],'where':{'id':_0x58ec4c['params']['id']}},_0x3e12c3={};_0x3e12c3[_0xab1f('0x25')]=_[_0xab1f('0x3a')](db[_0xab1f('0x21')][_0xab1f('0x22')]);_0x3e12c3['query']=_[_0xab1f('0x3a')](_0x58ec4c[_0xab1f('0x26')]);_0x3e12c3[_0xab1f('0x27')]=_['intersection'](_0x3e12c3[_0xab1f('0x25')],_0x3e12c3['query']);_0x4e0943['attributes']=_[_0xab1f('0x28')](_0x3e12c3['model'],qs[_0xab1f('0x29')](_0x58ec4c['query']['fields']));_0x4e0943[_0xab1f('0x2a')]=_0x4e0943[_0xab1f('0x2a')][_0xab1f('0x2b')]?_0x4e0943['attributes']:_0x3e12c3[_0xab1f('0x25')];if(_0x58ec4c['query'][_0xab1f('0x34')]){_0x4e0943[_0xab1f('0x35')]=[{'all':!![]}];}_0x4e0943=_[_0xab1f('0x31')]({},_0x4e0943,_0x58ec4c['options']);return db[_0xab1f('0x21')][_0xab1f('0x3b')](_0x4e0943)['then'](handleEntityNotFound(_0x13f7e2,null))[_0xab1f('0x1a')](respondWithResult(_0x13f7e2,null))[_0xab1f('0x38')](handleError(_0x13f7e2,null));};exports[_0xab1f('0x3c')]=function(_0x4e9683,_0x28b1b8){return db[_0xab1f('0x21')][_0xab1f('0x3c')](_0x4e9683[_0xab1f('0x3d')],{})[_0xab1f('0x1a')](respondWithResult(_0x28b1b8,0xc9))['catch'](handleError(_0x28b1b8,null));};exports[_0xab1f('0x19')]=function(_0xa21313,_0x2c11df){if(_0xa21313[_0xab1f('0x3d')]['id']){delete _0xa21313['body']['id'];}return db[_0xab1f('0x21')]['find']({'where':{'id':_0xa21313[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x2c11df,null))[_0xab1f('0x1a')](saveUpdates(_0xa21313['body'],null))['then'](respondWithResult(_0x2c11df,null))[_0xab1f('0x38')](handleError(_0x2c11df,null));};exports['destroy']=function(_0x4905b0,_0x4a2451){return db[_0xab1f('0x21')][_0xab1f('0x3b')]({'where':{'id':_0x4905b0[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x4a2451,null))['then'](removeEntity(_0x4a2451,null))[_0xab1f('0x38')](handleError(_0x4a2451,null));}; \ No newline at end of file +var _0x9aac=['set','save','then','name','send','index','map','WhatsappApplication','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x9aac,0x135));var _0xc9aa=function(_0x280ac9,_0x1ca3c8){_0x280ac9=_0x280ac9-0x0;var _0x4cdbf5=_0x9aac[_0x280ac9];return _0x4cdbf5;};'use strict';var emlformat=require(_0xc9aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc9aa('0x1'));var jsonpatch=require(_0xc9aa('0x2'));var rp=require('request-promise');var moment=require(_0xc9aa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc9aa('0x4'));var util=require('util');var path=require(_0xc9aa('0x5'));var sox=require(_0xc9aa('0x6'));var csv=require('to-csv');var ejs=require(_0xc9aa('0x7'));var fs=require('fs');var fs_extra=require(_0xc9aa('0x8'));var _=require(_0xc9aa('0x9'));var squel=require('squel');var crypto=require(_0xc9aa('0xa'));var jsforce=require(_0xc9aa('0xb'));var deskjs=require(_0xc9aa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc9aa('0xd'));var Papa=require(_0xc9aa('0xe'));var Redis=require(_0xc9aa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc9aa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9aa('0x11'))(_0xc9aa('0x12'));var utils=require(_0xc9aa('0x13'));var config=require(_0xc9aa('0x14'));var licenseUtil=require(_0xc9aa('0x15'));var db=require(_0xc9aa('0x16'))['db'];function respondWithStatusCode(_0x21e9c3,_0x2b38da){_0x2b38da=_0x2b38da||0xcc;return function(_0xfc9acd){if(_0xfc9acd){return _0x21e9c3[_0xc9aa('0x17')](_0x2b38da);}return _0x21e9c3[_0xc9aa('0x18')](_0x2b38da)[_0xc9aa('0x19')]();};}function respondWithResult(_0x39331d,_0x406422){_0x406422=_0x406422||0xc8;return function(_0x2b5708){if(_0x2b5708){return _0x39331d[_0xc9aa('0x18')](_0x406422)[_0xc9aa('0x1a')](_0x2b5708);}};}function respondWithFilteredResult(_0x53834b,_0x129cc1){return function(_0x4ed0c1){if(_0x4ed0c1){var _0x5b351f=typeof _0x129cc1[_0xc9aa('0x1b')]===_0xc9aa('0x1c')&&typeof _0x129cc1[_0xc9aa('0x1d')]===_0xc9aa('0x1c');var _0x4b42a4=_0x4ed0c1[_0xc9aa('0x1e')];var _0x28a1a0=_0x5b351f?0x0:_0x129cc1[_0xc9aa('0x1b')];var _0x4bacb3=_0x5b351f?_0x4ed0c1[_0xc9aa('0x1e')]:_0x129cc1[_0xc9aa('0x1b')]+_0x129cc1[_0xc9aa('0x1d')];var _0x22ad7f;if(_0x4bacb3>=_0x4b42a4){_0x4bacb3=_0x4b42a4;_0x22ad7f=0xc8;}else{_0x22ad7f=0xce;}_0x53834b[_0xc9aa('0x18')](_0x22ad7f);return _0x53834b[_0xc9aa('0x1f')]('Content-Range',_0x28a1a0+'-'+_0x4bacb3+'/'+_0x4b42a4)[_0xc9aa('0x1a')](_0x4ed0c1);}return null;};}function patchUpdates(_0x55037f){return function(_0x2c634a){try{jsonpatch['apply'](_0x2c634a,_0x55037f,!![]);}catch(_0x7c837f){return BPromise['reject'](_0x7c837f);}return _0x2c634a[_0xc9aa('0x20')]();};}function saveUpdates(_0x3f8bfd,_0x214c09){return function(_0x465f52){if(_0x465f52){return _0x465f52['update'](_0x3f8bfd)[_0xc9aa('0x21')](function(_0x122d0c){return _0x122d0c;});}return null;};}function removeEntity(_0xbb6dc1,_0x1b4246){return function(_0x3f5347){if(_0x3f5347){return _0x3f5347['destroy']()[_0xc9aa('0x21')](function(){_0xbb6dc1[_0xc9aa('0x18')](0xcc)[_0xc9aa('0x19')]();});}};}function handleEntityNotFound(_0x59dcfe,_0x1f6646){return function(_0x13cb3f){if(!_0x13cb3f){_0x59dcfe[_0xc9aa('0x17')](0x194);}return _0x13cb3f;};}function handleError(_0x4dab46,_0x44108f){_0x44108f=_0x44108f||0x1f4;return function(_0x40e628){logger['error'](_0x40e628['stack']);if(_0x40e628[_0xc9aa('0x22')]){delete _0x40e628[_0xc9aa('0x22')];}_0x4dab46[_0xc9aa('0x18')](_0x44108f)[_0xc9aa('0x23')](_0x40e628);};}exports[_0xc9aa('0x24')]=function(_0x12e908,_0x1251e1){var _0x5865b5={},_0x1d1215={},_0x3446aa={'count':0x0,'rows':[]};var _0x25d3e5=_[_0xc9aa('0x25')](db[_0xc9aa('0x26')][_0xc9aa('0x27')],function(_0x363394){return{'name':_0x363394['fieldName'],'type':_0x363394[_0xc9aa('0x28')][_0xc9aa('0x29')]};});_0x1d1215[_0xc9aa('0x2a')]=_[_0xc9aa('0x25')](_0x25d3e5,_0xc9aa('0x22'));_0x1d1215[_0xc9aa('0x2b')]=_[_0xc9aa('0x2c')](_0x12e908[_0xc9aa('0x2b')]);_0x1d1215[_0xc9aa('0x2d')]=_[_0xc9aa('0x2e')](_0x1d1215[_0xc9aa('0x2a')],_0x1d1215['query']);_0x5865b5['attributes']=_[_0xc9aa('0x2e')](_0x1d1215['model'],qs[_0xc9aa('0x2f')](_0x12e908[_0xc9aa('0x2b')][_0xc9aa('0x2f')]));_0x5865b5['attributes']=_0x5865b5[_0xc9aa('0x30')][_0xc9aa('0x31')]?_0x5865b5['attributes']:_0x1d1215[_0xc9aa('0x2a')];if(!_0x12e908[_0xc9aa('0x2b')]['hasOwnProperty'](_0xc9aa('0x32'))){_0x5865b5[_0xc9aa('0x1d')]=qs[_0xc9aa('0x1d')](_0x12e908[_0xc9aa('0x2b')]['limit']);_0x5865b5[_0xc9aa('0x1b')]=qs[_0xc9aa('0x1b')](_0x12e908['query'][_0xc9aa('0x1b')]);}_0x5865b5[_0xc9aa('0x33')]=qs[_0xc9aa('0x34')](_0x12e908[_0xc9aa('0x2b')][_0xc9aa('0x34')]);_0x5865b5[_0xc9aa('0x35')]=qs['filters'](_['pick'](_0x12e908[_0xc9aa('0x2b')],_0x1d1215[_0xc9aa('0x2d')]),_0x25d3e5);if(_0x12e908[_0xc9aa('0x2b')][_0xc9aa('0x36')]){_0x5865b5[_0xc9aa('0x35')]=_[_0xc9aa('0x37')](_0x5865b5[_0xc9aa('0x35')],{'$or':_['map'](_0x25d3e5,function(_0x3631ef){if(_0x3631ef[_0xc9aa('0x28')]!==_0xc9aa('0x38')){var _0x2c680b={};_0x2c680b[_0x3631ef['name']]={'$like':'%'+_0x12e908['query']['filter']+'%'};return _0x2c680b;}})});}_0x5865b5=_[_0xc9aa('0x37')]({},_0x5865b5,_0x12e908[_0xc9aa('0x39')]);var _0x311a2c={'where':_0x5865b5[_0xc9aa('0x35')]};return db[_0xc9aa('0x26')][_0xc9aa('0x1e')](_0x311a2c)[_0xc9aa('0x21')](function(_0x55bd4f){_0x3446aa[_0xc9aa('0x1e')]=_0x55bd4f;if(_0x12e908[_0xc9aa('0x2b')][_0xc9aa('0x3a')]){_0x5865b5[_0xc9aa('0x3b')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x5865b5);})[_0xc9aa('0x21')](function(_0x5699c3){_0x3446aa[_0xc9aa('0x3c')]=_0x5699c3;return _0x3446aa;})[_0xc9aa('0x21')](respondWithFilteredResult(_0x1251e1,_0x5865b5))[_0xc9aa('0x3d')](handleError(_0x1251e1,null));};exports[_0xc9aa('0x3e')]=function(_0x51c85e,_0x6cf2dd){var _0x59006b={'raw':!![],'where':{'id':_0x51c85e[_0xc9aa('0x3f')]['id']}},_0x2990f0={};_0x2990f0[_0xc9aa('0x2a')]=_[_0xc9aa('0x2c')](db[_0xc9aa('0x26')]['rawAttributes']);_0x2990f0[_0xc9aa('0x2b')]=_['keys'](_0x51c85e[_0xc9aa('0x2b')]);_0x2990f0[_0xc9aa('0x2d')]=_[_0xc9aa('0x2e')](_0x2990f0[_0xc9aa('0x2a')],_0x2990f0[_0xc9aa('0x2b')]);_0x59006b[_0xc9aa('0x30')]=_[_0xc9aa('0x2e')](_0x2990f0['model'],qs['fields'](_0x51c85e[_0xc9aa('0x2b')]['fields']));_0x59006b[_0xc9aa('0x30')]=_0x59006b['attributes'][_0xc9aa('0x31')]?_0x59006b[_0xc9aa('0x30')]:_0x2990f0[_0xc9aa('0x2a')];if(_0x51c85e[_0xc9aa('0x2b')][_0xc9aa('0x3a')]){_0x59006b[_0xc9aa('0x3b')]=[{'all':!![]}];}_0x59006b=_[_0xc9aa('0x37')]({},_0x59006b,_0x51c85e[_0xc9aa('0x39')]);return db[_0xc9aa('0x26')][_0xc9aa('0x40')](_0x59006b)[_0xc9aa('0x21')](handleEntityNotFound(_0x6cf2dd,null))[_0xc9aa('0x21')](respondWithResult(_0x6cf2dd,null))['catch'](handleError(_0x6cf2dd,null));};exports[_0xc9aa('0x41')]=function(_0x16851c,_0x575c7b){return db['WhatsappApplication']['create'](_0x16851c['body'],{})['then'](respondWithResult(_0x575c7b,0xc9))['catch'](handleError(_0x575c7b,null));};exports['update']=function(_0x53f5f1,_0x44c5db){if(_0x53f5f1[_0xc9aa('0x42')]['id']){delete _0x53f5f1[_0xc9aa('0x42')]['id'];}return db[_0xc9aa('0x26')][_0xc9aa('0x40')]({'where':{'id':_0x53f5f1[_0xc9aa('0x3f')]['id']}})[_0xc9aa('0x21')](handleEntityNotFound(_0x44c5db,null))[_0xc9aa('0x21')](saveUpdates(_0x53f5f1['body'],null))[_0xc9aa('0x21')](respondWithResult(_0x44c5db,null))[_0xc9aa('0x3d')](handleError(_0x44c5db,null));};exports[_0xc9aa('0x43')]=function(_0x5e99e0,_0x1855d5){return db[_0xc9aa('0x26')][_0xc9aa('0x40')]({'where':{'id':_0x5e99e0[_0xc9aa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1855d5,null))['then'](removeEntity(_0x1855d5,null))[_0xc9aa('0x3d')](handleError(_0x1855d5,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index a626c7a..49e6541 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 _0x447b=['exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0x3f2f67,_0x4d1d8b){var _0x4e3afb=function(_0xe32d9a){while(--_0xe32d9a){_0x3f2f67['push'](_0x3f2f67['shift']());}};_0x4e3afb(++_0x4d1d8b);}(_0x447b,0xe4));var _0xb447=function(_0x1bec49,_0x5d673c){_0x1bec49=_0x1bec49-0x0;var _0x5cf497=_0x447b[_0x1bec49];return _0x5cf497;};'use strict';var _=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var logger=require('../../config/logger')(_0xb447('0x2'));var moment=require(_0xb447('0x3'));var BPromise=require(_0xb447('0x4'));var rp=require(_0xb447('0x5'));var fs=require('fs');var path=require(_0xb447('0x6'));var rimraf=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var attributes=require(_0xb447('0x9'));module[_0xb447('0xa')]=function(_0x1f132a,_0x514a91){return _0x1f132a['define'](_0xb447('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb447('0xc'),'collate':_0xb447('0xd')});}; \ No newline at end of file +var _0x7119=['api','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x4fc117,_0x5b1e74){var _0x2e3a23=function(_0x22dc89){while(--_0x22dc89){_0x4fc117['push'](_0x4fc117['shift']());}};_0x2e3a23(++_0x5b1e74);}(_0x7119,0x1c7));var _0x9711=function(_0x45c9f4,_0x2eec90){_0x45c9f4=_0x45c9f4-0x0;var _0x1f9be9=_0x7119[_0x45c9f4];return _0x1f9be9;};'use strict';var _=require('lodash');var util=require(_0x9711('0x0'));var logger=require('../../config/logger')(_0x9711('0x1'));var moment=require('moment');var BPromise=require(_0x9711('0x2'));var rp=require(_0x9711('0x3'));var fs=require('fs');var path=require(_0x9711('0x4'));var rimraf=require(_0x9711('0x5'));var config=require('../../config/environment');var attributes=require(_0x9711('0x6'));module[_0x9711('0x7')]=function(_0x2ffe6c,_0x101827){return _0x2ffe6c[_0x9711('0x8')]('WhatsappApplication',attributes,{'tableName':_0x9711('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9711('0xa'),'collate':_0x9711('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 50b4356..2b689f1 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','WhatsappApplication,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2886ff,_0x2bf412){var _0x514b59=function(_0x344cf3){while(--_0x344cf3){_0x2886ff['push'](_0x2886ff['shift']());}};_0x514b59(++_0x2bf412);}(_0x3e74,0x175));var _0x43e7=function(_0x91fe2c,_0x2a24ea){_0x91fe2c=_0x91fe2c-0x0;var _0x101a59=_0x3e74[_0x91fe2c];return _0x101a59;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0xf8cafb,_0x416d92){var _0x5c3f5e=function(_0x3931d1){while(--_0x3931d1){_0xf8cafb['push'](_0xf8cafb['shift']());}};_0x5c3f5e(++_0x416d92);}(_0x9f62,0x154));var _0x29f6=function(_0x1fe1a0,_0x21641b){_0x1fe1a0=_0x1fe1a0-0x0;var _0x36c88d=_0x9f62[_0x1fe1a0];return _0x36c88d;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0aee6f2..84b3036 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 _0x4074=['destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0x598ef9,_0xb65f88){var _0x5ca020=function(_0x17cec3){while(--_0x17cec3){_0x598ef9['push'](_0x598ef9['shift']());}};_0x5ca020(++_0xb65f88);}(_0x4074,0xf0));var _0x4407=function(_0x28ebe6,_0xb7a686){_0x28ebe6=_0x28ebe6-0x0;var _0x4c75d7=_0x4074[_0x28ebe6];return _0x4c75d7;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xa')](_0x4407('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4407('0x10'),auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);router[_0x4407('0xa')](_0x4407('0x12'),auth[_0x4407('0xb')](),controller[_0x4407('0x13')]);router[_0x4407('0x14')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0x15')]);router[_0x4407('0x14')]('/:id/messages',auth[_0x4407('0xb')](),controller[_0x4407('0x16')]);router['post'](_0x4407('0x17'),auth['isAuthenticated'](),interaction[_0x4407('0x18')](_0x4407('0x19'),_0x4407('0x1a')),controller[_0x4407('0x1b')]);router[_0x4407('0x1c')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction[_0x4407('0x18')]('whatsapp',_0x4407('0x1d')),controller[_0x4407('0x1e')]);router[_0x4407('0x1f')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction['tracked'](_0x4407('0x19'),'whatsappinteraction:destroy'),controller[_0x4407('0x20')]);router[_0x4407('0x1f')](_0x4407('0x17'),auth[_0x4407('0xb')](),controller[_0x4407('0x21')]);module['exports']=router; \ No newline at end of file +var _0xaa3f=['/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage'];(function(_0x41a0a1,_0x50744b){var _0x39bcf3=function(_0x151b8a){while(--_0x151b8a){_0x41a0a1['push'](_0x41a0a1['shift']());}};_0x39bcf3(++_0x50744b);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4200ac,_0x54fa9a){_0x4200ac=_0x4200ac-0x0;var _0x464fa6=_0xaa3f[_0x4200ac];return _0x464fa6;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfaa3('0x10')]);router[_0xfaa3('0x9')](_0xfaa3('0x11'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x12')]);router[_0xfaa3('0x13')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0x14')]);router['post'](_0xfaa3('0x15'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x16')]);router['post'](_0xfaa3('0x17'),auth['isAuthenticated'](),interaction[_0xfaa3('0x18')](_0xfaa3('0x19'),_0xfaa3('0x1a')),controller[_0xfaa3('0x1b')]);router[_0xfaa3('0x1c')](_0xfaa3('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xfaa3('0x19'),_0xfaa3('0x1d')),controller[_0xfaa3('0x1e')]);router[_0xfaa3('0x1f')]('/:id',auth['isAuthenticated'](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xfaa3('0x20')]);router['delete'](_0xfaa3('0x17'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x21')]);module[_0xfaa3('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e07bb72..6dd83fe 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 _0xce50=['STRING','ENUM','out','moment','exports','BOOLEAN','DATE'];(function(_0x516672,_0x432343){var _0x4906b4=function(_0xf5bd8d){while(--_0xf5bd8d){_0x516672['push'](_0x516672['shift']());}};_0x4906b4(++_0x432343);}(_0xce50,0x1d8));var _0x0ce5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xce50[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0ce5('0x0'));module[_0x0ce5('0x1')]={'closed':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0ce5('0x3')]},'disposition':{'type':Sequelize[_0x0ce5('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0ce5('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0ce5('0x5')]('in',_0x0ce5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0ce5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0ce5('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0ce5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe5e0=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x5ad97b,_0x377302){var _0x548eee=function(_0x54ec9c){while(--_0x54ec9c){_0x5ad97b['push'](_0x5ad97b['shift']());}};_0x548eee(++_0x377302);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x3c2ca5,_0x4f6801){_0x3c2ca5=_0x3c2ca5-0x0;var _0x1d0801=_0xe5e0[_0x3c2ca5];return _0x1d0801;};'use strict';var Sequelize=require(_0x0e5e('0x0'));var moment=require(_0x0e5e('0x1'));module[_0x0e5e('0x2')]={'closed':{'type':Sequelize[_0x0e5e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0e5e('0x4')]},'disposition':{'type':Sequelize[_0x0e5e('0x5')]},'secondDisposition':{'type':Sequelize[_0x0e5e('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0e5e('0x5')]},'note':{'type':Sequelize[_0x0e5e('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0e5e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0e5e('0x6')]('in',_0x0e5e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e5e('0x6')]('in',_0x0e5e('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0e5e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 2e35cb5..eaea6ac 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 _0x45a0=['tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Whatsapp','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','pipe','createWriteStream','basename','out','System','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','end','stack','name','index','map','WhatsappInteraction','rawAttributes','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','attributes','fields','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','ids','findOne','intersection','nolimit','sort','where','WhatsappInteractionId','filter','$gte','format','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x45a0,0x1a2));var _0x045a=function(_0x56a5ff,_0x44bb97){_0x56a5ff=_0x56a5ff-0x0;var _0x596c86=_0x45a0[_0x56a5ff];return _0x596c86;};'use strict';var rimraf=require(_0x045a('0x0'));var zipdir=require(_0x045a('0x1'));var moment=require(_0x045a('0x2'));var BPromise=require(_0x045a('0x3'));var util=require(_0x045a('0x4'));var path=require(_0x045a('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x045a('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x045a('0x7'));var pdf=require(_0x045a('0x8'));var logger=require(_0x045a('0x9'))(_0x045a('0xa'));var config=require(_0x045a('0xb'));var db=require(_0x045a('0xc'))['db'];config['redis']=_[_0x045a('0xd')](config[_0x045a('0xe')],{'host':_0x045a('0xf'),'port':0x18eb});var socket=require(_0x045a('0x10'))(new Redis(config[_0x045a('0xe')]));require(_0x045a('0x11'))[_0x045a('0x12')](socket);function respondWithStatusCode(_0x4886ae,_0x4eaf12){_0x4eaf12=_0x4eaf12||0xcc;return function(_0x289b69){if(_0x289b69){return _0x4886ae[_0x045a('0x13')](_0x4eaf12);}return _0x4886ae[_0x045a('0x14')](_0x4eaf12)['end']();};}function respondWithResult(_0x306b9b,_0x5a4003){_0x5a4003=_0x5a4003||0xc8;return function(_0x4e4ee6){if(_0x4e4ee6){return _0x306b9b['status'](_0x5a4003)[_0x045a('0x15')](_0x4e4ee6);}};}function respondWithFilteredResult(_0x214971,_0x44f19c){return function(_0x30b2d8){if(_0x30b2d8){var _0x47adf5=typeof _0x44f19c[_0x045a('0x16')]===_0x045a('0x17')&&typeof _0x44f19c[_0x045a('0x18')]===_0x045a('0x17');var _0x2f87e2=_0x30b2d8[_0x045a('0x19')];var _0x5171c6=_0x47adf5?0x0:_0x44f19c[_0x045a('0x16')];var _0x11141d=_0x47adf5?_0x30b2d8[_0x045a('0x19')]:_0x44f19c[_0x045a('0x16')]+_0x44f19c[_0x045a('0x18')];var _0x4681fc;if(_0x11141d>=_0x2f87e2){_0x11141d=_0x2f87e2;_0x4681fc=0xc8;}else{_0x4681fc=0xce;}_0x214971[_0x045a('0x14')](_0x4681fc);return _0x214971[_0x045a('0x1a')](_0x045a('0x1b'),_0x5171c6+'-'+_0x11141d+'/'+_0x2f87e2)[_0x045a('0x15')](_0x30b2d8);}return null;};}function saveUpdates(_0x328d76){return function(_0x1ebe1c){if(_0x1ebe1c){return _0x1ebe1c['update'](_0x328d76)['then'](function(_0x1af496){return _0x1af496;});}return null;};}function removeEntity(_0x11d621){return function(_0x4cbc57){if(_0x4cbc57){return _0x4cbc57[_0x045a('0x1c')]()[_0x045a('0x1d')](function(){_0x11d621[_0x045a('0x14')](0xcc)[_0x045a('0x1e')]();});}};}function handleEntityNotFound(_0x1de387){return function(_0x5be490){if(!_0x5be490){_0x1de387[_0x045a('0x13')](0x194);}return _0x5be490;};}function handleError(_0x9785f6,_0x367a69){_0x367a69=_0x367a69||0x1f4;return function(_0x202baa){logger['error'](_0x202baa[_0x045a('0x1f')]);if(_0x202baa[_0x045a('0x20')]){delete _0x202baa[_0x045a('0x20')];}_0x9785f6[_0x045a('0x14')](_0x367a69)['send'](_0x202baa);};}exports[_0x045a('0x21')]=function(_0x4f0aa3,_0x1d6522){var _0x5cf7d6={};var _0x254c99=_[_0x045a('0x22')](db[_0x045a('0x23')][_0x045a('0x24')],function(_0x231080){return{'name':_0x231080['fieldName'],'type':_0x231080['type']['key']};});_0x5cf7d6=qs[_0x045a('0x25')](_0x254c99,_0x4f0aa3);return interaction[_0x045a('0x26')](_0x045a('0x27'),_0x4f0aa3[_0x045a('0x28')],_0x4f0aa3[_0x045a('0x29')],_0x5cf7d6,_0x254c99)[_0x045a('0x1d')](respondWithFilteredResult(_0x1d6522,_0x5cf7d6))[_0x045a('0x2a')](handleError(_0x1d6522,null));};exports[_0x045a('0x2b')]=function(_0x6ae4e3,_0x427b5f){var _0x3f6296={'raw':![],'where':{'id':_0x6ae4e3[_0x045a('0x2c')]['id']}},_0x57f317={};_0x57f317[_0x045a('0x2d')]=_['keys'](db['WhatsappInteraction'][_0x045a('0x24')]);_0x57f317['query']=_[_0x045a('0x2e')](_0x6ae4e3[_0x045a('0x28')]);_0x57f317[_0x045a('0x2f')]=_['intersection'](_0x57f317[_0x045a('0x2d')],_0x57f317[_0x045a('0x28')]);_0x3f6296[_0x045a('0x30')]=_['intersection'](_0x57f317[_0x045a('0x2d')],qs[_0x045a('0x31')](_0x6ae4e3[_0x045a('0x28')][_0x045a('0x31')]));_0x3f6296[_0x045a('0x30')]=_0x3f6296[_0x045a('0x30')][_0x045a('0x32')]?_0x3f6296['attributes']:_0x57f317[_0x045a('0x2d')];if(_0x6ae4e3[_0x045a('0x28')][_0x045a('0x33')]){_0x3f6296[_0x045a('0x34')]=[{'all':!![]}];}_0x3f6296=_[_0x045a('0x35')]({},_0x3f6296,_0x6ae4e3[_0x045a('0x36')]);return db[_0x045a('0x23')]['find'](_0x3f6296)['then'](handleEntityNotFound(_0x427b5f,null))[_0x045a('0x1d')](respondWithResult(_0x427b5f,null))['catch'](handleError(_0x427b5f,null));};exports[_0x045a('0x37')]=function(_0x4b95c7,_0x51efd4){return db[_0x045a('0x23')][_0x045a('0x37')](_0x4b95c7[_0x045a('0x38')],{})[_0x045a('0x1d')](respondWithResult(_0x51efd4,0xc9))['catch'](handleError(_0x51efd4,null));};exports[_0x045a('0x39')]=function(_0x106ddd,_0x14e18f){if(_0x106ddd[_0x045a('0x38')]['id']){delete _0x106ddd[_0x045a('0x38')]['id'];}return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x106ddd[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0x14e18f,null))[_0x045a('0x1d')](saveUpdates(_0x106ddd[_0x045a('0x38')],null))['then'](respondWithResult(_0x14e18f,null))[_0x045a('0x2a')](handleError(_0x14e18f,null));};exports['destroy']=function(_0xc7e1e0,_0x1f8386){return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0xc7e1e0[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0x1f8386,null))['then'](removeEntity(_0x1f8386,null))[_0x045a('0x2a')](handleError(_0x1f8386,null));};exports[_0x045a('0x3b')]=function(_0x78cce1,_0x70b6b4){return db[_0x045a('0x23')][_0x045a('0x3b')]()[_0x045a('0x1d')](respondWithResult(_0x70b6b4,null))[_0x045a('0x2a')](handleError(_0x70b6b4,null));};exports[_0x045a('0x3c')]=function(_0x3cb98b,_0xb9b150){return db[_0x045a('0x3d')][_0x045a('0x3a')]({'where':{'id':_0x3cb98b[_0x045a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xb9b150,null))[_0x045a('0x1d')](function(_0x92871c){if(_0x92871c){return _0x92871c['addMessage'](_0x3cb98b[_0x045a('0x38')]['ids'],_['omit'](_0x3cb98b[_0x045a('0x38')],[_0x045a('0x3e'),'id'])||{});}})[_0x045a('0x1d')](respondWithResult(_0xb9b150,null))['catch'](handleError(_0xb9b150,null));};exports['getMessages']=function(_0x5e8d8f,_0xbc829f){var _0x354fbd={'raw':![],'where':{}};var _0x57be41={};var _0x1ec744={'count':0x0,'rows':[]};return db[_0x045a('0x23')][_0x045a('0x3f')]({'where':{'id':_0x5e8d8f['params']['id']}})['then'](handleEntityNotFound(_0xbc829f,null))[_0x045a('0x1d')](function(_0x3f131d){if(_0x3f131d){_0x57be41[_0x045a('0x2d')]=_[_0x045a('0x2e')](db[_0x045a('0x3d')][_0x045a('0x24')]);_0x57be41[_0x045a('0x28')]=_[_0x045a('0x2e')](_0x5e8d8f['query']);_0x57be41[_0x045a('0x2f')]=_[_0x045a('0x40')](_0x57be41[_0x045a('0x2d')],_0x57be41[_0x045a('0x28')]);_0x354fbd[_0x045a('0x30')]=_[_0x045a('0x40')](_0x57be41['model'],qs[_0x045a('0x31')](_0x5e8d8f['query'][_0x045a('0x31')]));_0x354fbd[_0x045a('0x30')]=_0x354fbd[_0x045a('0x30')]['length']?_0x354fbd[_0x045a('0x30')]:_0x57be41[_0x045a('0x2d')];if(!_0x5e8d8f['query']['hasOwnProperty'](_0x045a('0x41'))){_0x354fbd['limit']=qs['limit'](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x18')]);_0x354fbd[_0x045a('0x16')]=qs[_0x045a('0x16')](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x16')]);}_0x354fbd['order']=qs[_0x045a('0x42')](_0x5e8d8f[_0x045a('0x28')][_0x045a('0x42')]);_0x354fbd[_0x045a('0x43')]=qs[_0x045a('0x2f')](_['pick'](_0x5e8d8f[_0x045a('0x28')],_0x57be41[_0x045a('0x2f')]));_0x354fbd['where'][_0x045a('0x44')]=_0x3f131d['id'];if(_0x5e8d8f[_0x045a('0x28')][_0x045a('0x45')]){_0x354fbd['where']=_[_0x045a('0x35')](_0x354fbd[_0x045a('0x43')],{'$or':_[_0x045a('0x22')](_0x354fbd[_0x045a('0x30')],function(_0x5685d4){var _0x2f2776={};_0x2f2776[_0x5685d4]={'$like':'%'+_0x5e8d8f[_0x045a('0x28')][_0x045a('0x45')]+'%'};return _0x2f2776;})});}if(_0x5e8d8f[_0x045a('0x28')]['$gte']){var _0x2698bb=_0x5e8d8f[_0x045a('0x28')][_0x045a('0x46')]['split'](',');var _0xb909e6={};_0xb909e6[_0x2698bb[0x0]]={'$gte':moment(_0x2698bb[0x1])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x354fbd[_0x045a('0x43')]=_[_0x045a('0x35')](_0x354fbd[_0x045a('0x43')],_0xb909e6);}_0x354fbd=_[_0x045a('0x35')]({},_0x354fbd,_0x5e8d8f[_0x045a('0x36')]);return db[_0x045a('0x3d')][_0x045a('0x19')]({'where':_0x354fbd['where']})[_0x045a('0x1d')](function(_0x4b729b){_0x1ec744[_0x045a('0x19')]=_0x4b729b;if(_0x5e8d8f[_0x045a('0x28')][_0x045a('0x33')]){_0x354fbd[_0x045a('0x34')]=[{'all':!![]}];}return db[_0x045a('0x3d')][_0x045a('0x26')](_0x354fbd);})['then'](function(_0x18f712){_0x1ec744['rows']=_0x18f712;return _0x1ec744;});}})[_0x045a('0x1d')](respondWithFilteredResult(_0xbc829f,_0x354fbd))[_0x045a('0x2a')](handleError(_0xbc829f,null));};exports['addTags']=function(_0x381baf,_0xee9aaf){return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x381baf[_0x045a('0x2c')]['id']}})[_0x045a('0x1d')](handleEntityNotFound(_0xee9aaf,null))[_0x045a('0x1d')](function(_0x17150e){if(_0x17150e){return _0x17150e[_0x045a('0x48')](_0x381baf[_0x045a('0x38')][_0x045a('0x3e')],_[_0x045a('0x49')](_0x381baf[_0x045a('0x38')],[_0x045a('0x3e'),'id'])||{})[_0x045a('0x4a')](function(){return db[_0x045a('0x4b')][_0x045a('0x26')]({'attributes':['id',_0x045a('0x20'),_0x045a('0x4c')],'where':{'id':_0x381baf['body'][_0x045a('0x3e')]}});})[_0x045a('0x1d')](function(_0x136e18){socket[_0x045a('0x4d')](_0x045a('0x4e'),{'id':Number(_0x381baf[_0x045a('0x2c')]['id']),'tags':_0x136e18||[]});return{'id':Number(_0x381baf[_0x045a('0x2c')]['id']),'tags':_0x136e18||[]};});}})[_0x045a('0x1d')](respondWithResult(_0xee9aaf,null))[_0x045a('0x2a')](handleError(_0xee9aaf,null));};exports[_0x045a('0x4f')]=function(_0x509ab2,_0x16cb62){return db['WhatsappInteraction'][_0x045a('0x3a')]({'where':{'id':_0x509ab2[_0x045a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x16cb62,null))['then'](function(_0x2cbeaa){if(_0x2cbeaa){return _0x2cbeaa[_0x045a('0x4f')](_0x509ab2[_0x045a('0x28')][_0x045a('0x3e')]);}})[_0x045a('0x1d')](respondWithStatusCode(_0x16cb62,null))[_0x045a('0x2a')](handleError(_0x16cb62,null));};exports[_0x045a('0x50')]=function(_0x2ee865,_0x3306e3){var _0x34def3=moment()[_0x045a('0x51')]()[_0x045a('0x52')]();var _0x218131=path[_0x045a('0x53')](config[_0x045a('0x54')],'server',_0x045a('0x55'),_0x045a('0x56'));var _0x480743=path[_0x045a('0x53')](config[_0x045a('0x54')],_0x045a('0x57'),'files',_0x045a('0x58'));var _0x4334e4=path[_0x045a('0x53')](_0x218131,_0x34def3);var _0x225653=util[_0x045a('0x47')](_0x045a('0x59'),_0x2ee865[_0x045a('0x2c')]['id'],_0x34def3);var _0x373d88=path[_0x045a('0x53')](_0x218131,_0x225653);var _0x141ab2=[];_0x141ab2['push']({'model':db['User'],'as':_0x045a('0x5a'),'attributes':['id',_0x045a('0x5b')],'raw':!![]});_0x141ab2[_0x045a('0x5c')]({'model':db[_0x045a('0x5d')],'as':_0x045a('0x5e'),'attributes':['id','firstName',_0x045a('0x5f')],'raw':!![]});if(_0x2ee865['query']['attachments']){_0x141ab2[_0x045a('0x5c')]({'model':db[_0x045a('0x60')],'as':_0x045a('0x60'),'raw':!![]});}var _0x3c8395=[{'model':db[_0x045a('0x3d')],'as':_0x045a('0x61'),'attributes':['id',_0x045a('0x38'),_0x045a('0x62'),_0x045a('0x63'),_0x045a('0x64'),_0x045a('0x65')],'include':_0x141ab2}];_0x3c8395[_0x045a('0x5c')]({'model':db['WhatsappAccount'],'as':_0x045a('0x66'),'attributes':['id','name']});_0x3c8395[_0x045a('0x5c')]({'model':db[_0x045a('0x5a')],'as':_0x045a('0x67'),'attributes':['id',_0x045a('0x5b')]});return db[_0x045a('0x23')][_0x045a('0x3a')]({'where':{'id':_0x2ee865[_0x045a('0x2c')]['id']},'include':_0x3c8395})[_0x045a('0x1d')](handleEntityNotFound(_0x3306e3,null))[_0x045a('0x1d')](function(_0xc0208c){if(_0xc0208c){var _0x990ee4=_0xc0208c[_0x045a('0x68')]({'plain':!![]});fs[_0x045a('0x69')](_0x4334e4);var _0x2a6580={'channel':_0x045a('0x6a'),'account':_0x990ee4[_0x045a('0x66')][_0x045a('0x20')],'agent':_0x990ee4[_0x045a('0x67')]?_0x990ee4[_0x045a('0x67')][_0x045a('0x5b')]:'N.A.','createdAt':moment(_0x990ee4['createdAt'])[_0x045a('0x47')](_0x045a('0x6b'))['toString'](),'closedAt':_0x990ee4[_0x045a('0x6c')]?moment(_0x990ee4[_0x045a('0x6d')])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x990ee4[_0x045a('0x6e')],'messages':_(_0x990ee4['Messages'])[_0x045a('0x45')]({'secret':![]})[_0x045a('0x22')](function(_0x569080){if(_0x569080[_0x045a('0x60')]){var _0x50bbdd=path[_0x045a('0x53')](_0x480743,_0x569080['Attachment']['basename']);if(fs[_0x045a('0x6f')](_0x50bbdd)){fs['createReadStream'](_0x50bbdd)[_0x045a('0x70')](fs[_0x045a('0x71')](path[_0x045a('0x53')](_0x4334e4,_0x569080[_0x045a('0x60')][_0x045a('0x72')])));}}return{'date':moment(_0x569080[_0x045a('0x62')])[_0x045a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x569080[_0x045a('0x63')]===_0x045a('0x73')?_0x569080['User']?_0x569080['User']['fullname']:_0x045a('0x74'):_0x569080[_0x045a('0x5e')][_0x045a('0x75')]+(_0x569080[_0x045a('0x5e')][_0x045a('0x5f')]?'\x20'+_0x569080[_0x045a('0x5e')][_0x045a('0x5f')]:''),'body':_0x569080['Attachment']?_0x569080[_0x045a('0x60')][_0x045a('0x72')]:_0x569080[_0x045a('0x38')],'direction':_0x569080[_0x045a('0x63')]==='out'?'A':'C','secret':_0x569080[_0x045a('0x64')],'read':_0x569080['read'],'attachment':_0x569080['Attachment']};})[_0x045a('0x76')]()};return ejs[_0x045a('0x77')](path[_0x045a('0x53')](config[_0x045a('0x54')],_0x045a('0x57'),_0x045a('0x78'),_0x045a('0x79')),{'interaction':_0x2a6580})[_0x045a('0x1d')](function(_0x120ffd){var _0x4caeaa=path['join'](_0x4334e4,_0x045a('0x7a')+_0x990ee4['id']+'-'+_0x34def3+_0x045a('0x7b'));var _0x1268bd={'path':_0x4caeaa,'channel':_0x045a('0x6a'),'interactionId':_0x990ee4['id']};return pdf[_0x045a('0x7c')](_0x120ffd,_0x1268bd);})[_0x045a('0x1d')](function(){return new BPromise(function(_0x2c8489,_0x54988c){zipdir(_0x4334e4,{'saveTo':_0x373d88},function(_0x4fca25,_0x20a557){if(_0x4fca25)return _0x54988c(_0x4fca25);return _0x2c8489(_0x20a557);});})[_0x045a('0x1d')](function(){return new BPromise(function(_0x3b53c5,_0x3c2256){rimraf(_0x4334e4,function(_0x525f1f){if(_0x525f1f)_0x3c2256(_0x525f1f);return _0x3b53c5();});});})[_0x045a('0x1d')](function(){return _0x3306e3[_0x045a('0x50')](_0x373d88,_0x225653,function(_0x4b7cde){if(_0x4b7cde){console['log']('err',_0x4b7cde);}else{fs[_0x045a('0x7d')](_0x373d88);}});});});}else{return _0x3306e3['sendStatus'](0xc8);}})[_0x045a('0x2a')](handleError(_0x3306e3,null));}; \ No newline at end of file +var _0xe85f=['Attachment','WhatsappMessage','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','fullname','Whatsapp','N.A.','closed','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','Contact','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','show','params','model','keys','intersection','fields','attributes','length','catch','create','body','find','describe','addMessage','ids','omit','findOne','hasOwnProperty','order','sort','where','filters','pick','merge','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','toString','join','root','server','files','push','User','CmContact','firstName'];(function(_0x3bc82d,_0x59187f){var _0x2cfb3d=function(_0x515ac3){while(--_0x515ac3){_0x3bc82d['push'](_0x3bc82d['shift']());}};_0x2cfb3d(++_0x59187f);}(_0xe85f,0x116));var _0xfe85=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xe85f[_0x35da42];return _0x370035;};'use strict';var rimraf=require(_0xfe85('0x0'));var zipdir=require(_0xfe85('0x1'));var moment=require(_0xfe85('0x2'));var BPromise=require(_0xfe85('0x3'));var util=require(_0xfe85('0x4'));var path=require(_0xfe85('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xfe85('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xfe85('0x7'));var logger=require(_0xfe85('0x8'))(_0xfe85('0x9'));var config=require(_0xfe85('0xa'));var db=require(_0xfe85('0xb'))['db'];config[_0xfe85('0xc')]=_[_0xfe85('0xd')](config[_0xfe85('0xc')],{'host':_0xfe85('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe85('0xc')]));require(_0xfe85('0xf'))[_0xfe85('0x10')](socket);function respondWithStatusCode(_0x7e379,_0x479eaa){_0x479eaa=_0x479eaa||0xcc;return function(_0x2b203b){if(_0x2b203b){return _0x7e379[_0xfe85('0x11')](_0x479eaa);}return _0x7e379['status'](_0x479eaa)['end']();};}function respondWithResult(_0x3429b2,_0x58da4e){_0x58da4e=_0x58da4e||0xc8;return function(_0x11abc0){if(_0x11abc0){return _0x3429b2[_0xfe85('0x12')](_0x58da4e)[_0xfe85('0x13')](_0x11abc0);}};}function respondWithFilteredResult(_0xe20fd2,_0x5a2f1c){return function(_0x295d40){if(_0x295d40){var _0x5b9f59=typeof _0x5a2f1c[_0xfe85('0x14')]==='undefined'&&typeof _0x5a2f1c['limit']===_0xfe85('0x15');var _0x49fd14=_0x295d40['count'];var _0x2cd058=_0x5b9f59?0x0:_0x5a2f1c[_0xfe85('0x14')];var _0x314044=_0x5b9f59?_0x295d40[_0xfe85('0x16')]:_0x5a2f1c['offset']+_0x5a2f1c[_0xfe85('0x17')];var _0x4aba0a;if(_0x314044>=_0x49fd14){_0x314044=_0x49fd14;_0x4aba0a=0xc8;}else{_0x4aba0a=0xce;}_0xe20fd2[_0xfe85('0x12')](_0x4aba0a);return _0xe20fd2[_0xfe85('0x18')](_0xfe85('0x19'),_0x2cd058+'-'+_0x314044+'/'+_0x49fd14)['json'](_0x295d40);}return null;};}function saveUpdates(_0x1d406a){return function(_0x29675b){if(_0x29675b){return _0x29675b[_0xfe85('0x1a')](_0x1d406a)[_0xfe85('0x1b')](function(_0x168a01){return _0x168a01;});}return null;};}function removeEntity(_0xa398c2){return function(_0x2da9fb){if(_0x2da9fb){return _0x2da9fb[_0xfe85('0x1c')]()[_0xfe85('0x1b')](function(){_0xa398c2[_0xfe85('0x12')](0xcc)[_0xfe85('0x1d')]();});}};}function handleEntityNotFound(_0x50be24){return function(_0x184b2c){if(!_0x184b2c){_0x50be24['sendStatus'](0x194);}return _0x184b2c;};}function handleError(_0x3db066,_0x1a6656){_0x1a6656=_0x1a6656||0x1f4;return function(_0x5d25f1){logger[_0xfe85('0x1e')](_0x5d25f1[_0xfe85('0x1f')]);if(_0x5d25f1[_0xfe85('0x20')]){delete _0x5d25f1['name'];}_0x3db066['status'](_0x1a6656)[_0xfe85('0x21')](_0x5d25f1);};}exports['index']=function(_0x51835e,_0x453144){var _0x419e39={};var _0x5b644c=_['map'](db[_0xfe85('0x22')][_0xfe85('0x23')],function(_0x231fe7){return{'name':_0x231fe7[_0xfe85('0x24')],'type':_0x231fe7[_0xfe85('0x25')]['key']};});_0x419e39=qs[_0xfe85('0x26')](_0x5b644c,_0x51835e);return interaction[_0xfe85('0x27')](_0xfe85('0x28'),_0x51835e[_0xfe85('0x29')],_0x51835e['user'],_0x419e39,_0x5b644c)['then'](respondWithFilteredResult(_0x453144,_0x419e39))['catch'](handleError(_0x453144,null));};exports[_0xfe85('0x2a')]=function(_0xb702ad,_0x1659c4){var _0x1f245d={'raw':![],'where':{'id':_0xb702ad[_0xfe85('0x2b')]['id']}},_0x428ab4={};_0x428ab4[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](db['WhatsappInteraction'][_0xfe85('0x23')]);_0x428ab4['query']=_[_0xfe85('0x2d')](_0xb702ad[_0xfe85('0x29')]);_0x428ab4['filters']=_['intersection'](_0x428ab4['model'],_0x428ab4[_0xfe85('0x29')]);_0x1f245d['attributes']=_[_0xfe85('0x2e')](_0x428ab4[_0xfe85('0x2c')],qs[_0xfe85('0x2f')](_0xb702ad[_0xfe85('0x29')]['fields']));_0x1f245d['attributes']=_0x1f245d[_0xfe85('0x30')][_0xfe85('0x31')]?_0x1f245d[_0xfe85('0x30')]:_0x428ab4[_0xfe85('0x2c')];if(_0xb702ad[_0xfe85('0x29')]['includeAll']){_0x1f245d['include']=[{'all':!![]}];}_0x1f245d=_['merge']({},_0x1f245d,_0xb702ad['options']);return db[_0xfe85('0x22')]['find'](_0x1f245d)[_0xfe85('0x1b')](handleEntityNotFound(_0x1659c4,null))[_0xfe85('0x1b')](respondWithResult(_0x1659c4,null))[_0xfe85('0x32')](handleError(_0x1659c4,null));};exports[_0xfe85('0x33')]=function(_0x5b9e92,_0x3edaff){return db[_0xfe85('0x22')][_0xfe85('0x33')](_0x5b9e92[_0xfe85('0x34')],{})[_0xfe85('0x1b')](respondWithResult(_0x3edaff,0xc9))[_0xfe85('0x32')](handleError(_0x3edaff,null));};exports[_0xfe85('0x1a')]=function(_0x189282,_0x263c44){if(_0x189282['body']['id']){delete _0x189282[_0xfe85('0x34')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x189282[_0xfe85('0x2b')]['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x263c44,null))[_0xfe85('0x1b')](saveUpdates(_0x189282['body'],null))[_0xfe85('0x1b')](respondWithResult(_0x263c44,null))[_0xfe85('0x32')](handleError(_0x263c44,null));};exports['destroy']=function(_0x1b222f,_0x3d60c4){return db[_0xfe85('0x22')][_0xfe85('0x35')]({'where':{'id':_0x1b222f['params']['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x3d60c4,null))[_0xfe85('0x1b')](removeEntity(_0x3d60c4,null))['catch'](handleError(_0x3d60c4,null));};exports[_0xfe85('0x36')]=function(_0x2edbb7,_0x4efaa4){return db[_0xfe85('0x22')][_0xfe85('0x36')]()[_0xfe85('0x1b')](respondWithResult(_0x4efaa4,null))['catch'](handleError(_0x4efaa4,null));};exports[_0xfe85('0x37')]=function(_0x289845,_0x434be0){return db['WhatsappMessage']['find']({'where':{'id':_0x289845[_0xfe85('0x2b')]['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x434be0,null))[_0xfe85('0x1b')](function(_0x45e5cb){if(_0x45e5cb){return _0x45e5cb[_0xfe85('0x37')](_0x289845['body'][_0xfe85('0x38')],_[_0xfe85('0x39')](_0x289845['body'],[_0xfe85('0x38'),'id'])||{});}})[_0xfe85('0x1b')](respondWithResult(_0x434be0,null))['catch'](handleError(_0x434be0,null));};exports['getMessages']=function(_0x48d695,_0x28a03d){var _0x43f872={'raw':![],'where':{}};var _0x5103fb={};var _0x455b7a={'count':0x0,'rows':[]};return db[_0xfe85('0x22')][_0xfe85('0x3a')]({'where':{'id':_0x48d695[_0xfe85('0x2b')]['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x28a03d,null))['then'](function(_0x26b0d4){if(_0x26b0d4){_0x5103fb[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](db['WhatsappMessage'][_0xfe85('0x23')]);_0x5103fb[_0xfe85('0x29')]=_[_0xfe85('0x2d')](_0x48d695[_0xfe85('0x29')]);_0x5103fb['filters']=_['intersection'](_0x5103fb['model'],_0x5103fb[_0xfe85('0x29')]);_0x43f872[_0xfe85('0x30')]=_[_0xfe85('0x2e')](_0x5103fb['model'],qs[_0xfe85('0x2f')](_0x48d695[_0xfe85('0x29')][_0xfe85('0x2f')]));_0x43f872[_0xfe85('0x30')]=_0x43f872[_0xfe85('0x30')][_0xfe85('0x31')]?_0x43f872[_0xfe85('0x30')]:_0x5103fb[_0xfe85('0x2c')];if(!_0x48d695[_0xfe85('0x29')][_0xfe85('0x3b')]('nolimit')){_0x43f872[_0xfe85('0x17')]=qs['limit'](_0x48d695['query'][_0xfe85('0x17')]);_0x43f872[_0xfe85('0x14')]=qs['offset'](_0x48d695[_0xfe85('0x29')][_0xfe85('0x14')]);}_0x43f872[_0xfe85('0x3c')]=qs[_0xfe85('0x3d')](_0x48d695[_0xfe85('0x29')][_0xfe85('0x3d')]);_0x43f872[_0xfe85('0x3e')]=qs[_0xfe85('0x3f')](_[_0xfe85('0x40')](_0x48d695[_0xfe85('0x29')],_0x5103fb[_0xfe85('0x3f')]));_0x43f872[_0xfe85('0x3e')]['WhatsappInteractionId']=_0x26b0d4['id'];if(_0x48d695['query']['filter']){_0x43f872[_0xfe85('0x3e')]=_[_0xfe85('0x41')](_0x43f872[_0xfe85('0x3e')],{'$or':_[_0xfe85('0x42')](_0x43f872[_0xfe85('0x30')],function(_0x8f049f){var _0xe53083={};_0xe53083[_0x8f049f]={'$like':'%'+_0x48d695['query'][_0xfe85('0x43')]+'%'};return _0xe53083;})});}if(_0x48d695[_0xfe85('0x29')][_0xfe85('0x44')]){var _0x5c5d01=_0x48d695[_0xfe85('0x29')]['$gte'][_0xfe85('0x45')](',');var _0x106394={};_0x106394[_0x5c5d01[0x0]]={'$gte':moment(_0x5c5d01[0x1])[_0xfe85('0x46')](_0xfe85('0x47'))};_0x43f872[_0xfe85('0x3e')]=_[_0xfe85('0x41')](_0x43f872[_0xfe85('0x3e')],_0x106394);}_0x43f872=_[_0xfe85('0x41')]({},_0x43f872,_0x48d695['options']);return db['WhatsappMessage']['count']({'where':_0x43f872[_0xfe85('0x3e')]})[_0xfe85('0x1b')](function(_0x4a58d9){_0x455b7a[_0xfe85('0x16')]=_0x4a58d9;if(_0x48d695[_0xfe85('0x29')][_0xfe85('0x48')]){_0x43f872[_0xfe85('0x49')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xfe85('0x27')](_0x43f872);})['then'](function(_0x32697){_0x455b7a[_0xfe85('0x4a')]=_0x32697;return _0x455b7a;});}})[_0xfe85('0x1b')](respondWithFilteredResult(_0x28a03d,_0x43f872))['catch'](handleError(_0x28a03d,null));};exports[_0xfe85('0x4b')]=function(_0x5927c4,_0x159dc7){return db[_0xfe85('0x22')]['find']({'where':{'id':_0x5927c4[_0xfe85('0x2b')]['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x159dc7,null))['then'](function(_0x175fa5){if(_0x175fa5){return _0x175fa5['setTags'](_0x5927c4['body'][_0xfe85('0x38')],_['omit'](_0x5927c4[_0xfe85('0x34')],[_0xfe85('0x38'),'id'])||{})[_0xfe85('0x4c')](function(){return db[_0xfe85('0x4d')]['findAll']({'attributes':['id','name',_0xfe85('0x4e')],'where':{'id':_0x5927c4[_0xfe85('0x34')]['ids']}});})[_0xfe85('0x1b')](function(_0xe68e2){socket['emit'](_0xfe85('0x4f'),{'id':Number(_0x5927c4[_0xfe85('0x2b')]['id']),'tags':_0xe68e2||[]});return{'id':Number(_0x5927c4[_0xfe85('0x2b')]['id']),'tags':_0xe68e2||[]};});}})[_0xfe85('0x1b')](respondWithResult(_0x159dc7,null))[_0xfe85('0x32')](handleError(_0x159dc7,null));};exports[_0xfe85('0x50')]=function(_0x2dff72,_0x52c0e8){return db[_0xfe85('0x22')]['find']({'where':{'id':_0x2dff72[_0xfe85('0x2b')]['id']}})[_0xfe85('0x1b')](handleEntityNotFound(_0x52c0e8,null))[_0xfe85('0x1b')](function(_0x5ccc4c){if(_0x5ccc4c){return _0x5ccc4c[_0xfe85('0x50')](_0x2dff72[_0xfe85('0x29')][_0xfe85('0x38')]);}})[_0xfe85('0x1b')](respondWithStatusCode(_0x52c0e8,null))[_0xfe85('0x32')](handleError(_0x52c0e8,null));};exports[_0xfe85('0x51')]=function(_0x2bee1f,_0x291b63){var _0x3be387=moment()['unix']()[_0xfe85('0x52')]();var _0x4edf23=path[_0xfe85('0x53')](config[_0xfe85('0x54')],_0xfe85('0x55'),_0xfe85('0x56'),'tmp');var _0x4cff83=path['join'](config[_0xfe85('0x54')],'server',_0xfe85('0x56'),'attachments');var _0x43b0a7=path[_0xfe85('0x53')](_0x4edf23,_0x3be387);var _0x57ea87=util[_0xfe85('0x46')]('transcript-%d-%s.zip',_0x2bee1f[_0xfe85('0x2b')]['id'],_0x3be387);var _0x47a3f6=path[_0xfe85('0x53')](_0x4edf23,_0x57ea87);var _0x2f5890=[];_0x2f5890[_0xfe85('0x57')]({'model':db['User'],'as':_0xfe85('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x2f5890[_0xfe85('0x57')]({'model':db[_0xfe85('0x59')],'as':'Contact','attributes':['id',_0xfe85('0x5a'),'lastName'],'raw':!![]});if(_0x2bee1f[_0xfe85('0x29')]['attachments']){_0x2f5890[_0xfe85('0x57')]({'model':db[_0xfe85('0x5b')],'as':_0xfe85('0x5b'),'raw':!![]});}var _0x3439ae=[{'model':db[_0xfe85('0x5c')],'as':_0xfe85('0x5d'),'attributes':['id',_0xfe85('0x34'),_0xfe85('0x5e'),_0xfe85('0x5f'),_0xfe85('0x60'),_0xfe85('0x61')],'include':_0x2f5890}];_0x3439ae[_0xfe85('0x57')]({'model':db[_0xfe85('0x62')],'as':_0xfe85('0x63'),'attributes':['id','name']});_0x3439ae[_0xfe85('0x57')]({'model':db[_0xfe85('0x58')],'as':_0xfe85('0x64'),'attributes':['id',_0xfe85('0x65')]});return db['WhatsappInteraction'][_0xfe85('0x35')]({'where':{'id':_0x2bee1f[_0xfe85('0x2b')]['id']},'include':_0x3439ae})[_0xfe85('0x1b')](handleEntityNotFound(_0x291b63,null))['then'](function(_0x2819b3){if(_0x2819b3){var _0x514b29=_0x2819b3['get']({'plain':!![]});fs['mkdirSync'](_0x43b0a7);var _0x23372a={'channel':_0xfe85('0x66'),'account':_0x514b29[_0xfe85('0x63')][_0xfe85('0x20')],'agent':_0x514b29[_0xfe85('0x64')]?_0x514b29[_0xfe85('0x64')][_0xfe85('0x65')]:_0xfe85('0x67'),'createdAt':moment(_0x514b29[_0xfe85('0x5e')])[_0xfe85('0x46')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x514b29[_0xfe85('0x68')]?moment(_0x514b29['closedAt'])[_0xfe85('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfe85('0x52')]():'','disposition':_0x514b29[_0xfe85('0x69')],'messages':_(_0x514b29[_0xfe85('0x5d')])['filter']({'secret':![]})['map'](function(_0x299e7d){if(_0x299e7d[_0xfe85('0x5b')]){var _0x4cace6=path['join'](_0x4cff83,_0x299e7d[_0xfe85('0x5b')]['basename']);if(fs[_0xfe85('0x6a')](_0x4cace6)){fs[_0xfe85('0x6b')](_0x4cace6)[_0xfe85('0x6c')](fs[_0xfe85('0x6d')](path[_0xfe85('0x53')](_0x43b0a7,_0x299e7d[_0xfe85('0x5b')][_0xfe85('0x6e')])));}}return{'date':moment(_0x299e7d[_0xfe85('0x5e')])[_0xfe85('0x46')](_0xfe85('0x47'))[_0xfe85('0x52')](),'sender':_0x299e7d[_0xfe85('0x5f')]===_0xfe85('0x6f')?_0x299e7d[_0xfe85('0x58')]?_0x299e7d[_0xfe85('0x58')]['fullname']:_0xfe85('0x70'):_0x299e7d[_0xfe85('0x71')][_0xfe85('0x5a')]+(_0x299e7d['Contact'][_0xfe85('0x72')]?'\x20'+_0x299e7d[_0xfe85('0x71')][_0xfe85('0x72')]:''),'body':_0x299e7d['Attachment']?_0x299e7d[_0xfe85('0x5b')][_0xfe85('0x6e')]:_0x299e7d['body'],'direction':_0x299e7d[_0xfe85('0x5f')]===_0xfe85('0x6f')?'A':'C','secret':_0x299e7d['secret'],'read':_0x299e7d[_0xfe85('0x61')],'attachment':_0x299e7d[_0xfe85('0x5b')]};})[_0xfe85('0x73')]()};return ejs[_0xfe85('0x74')](path[_0xfe85('0x53')](config[_0xfe85('0x54')],_0xfe85('0x55'),_0xfe85('0x75'),_0xfe85('0x76')),{'interaction':_0x23372a})[_0xfe85('0x1b')](function(_0x59fd9f){var _0x10df60=path[_0xfe85('0x53')](_0x43b0a7,'transcript-'+_0x514b29['id']+'-'+_0x3be387+_0xfe85('0x77'));var _0x565851={'path':_0x10df60,'channel':_0xfe85('0x66'),'interactionId':_0x514b29['id']};return pdf[_0xfe85('0x78')](_0x59fd9f,_0x565851);})['then'](function(){return new BPromise(function(_0x576b0a,_0x621b70){zipdir(_0x43b0a7,{'saveTo':_0x47a3f6},function(_0x59d0f6,_0x3a33aa){if(_0x59d0f6)return _0x621b70(_0x59d0f6);return _0x576b0a(_0x3a33aa);});})[_0xfe85('0x1b')](function(){return new BPromise(function(_0x6d938d,_0x38bb94){rimraf(_0x43b0a7,function(_0xd9fddc){if(_0xd9fddc)_0x38bb94(_0xd9fddc);return _0x6d938d();});});})[_0xfe85('0x1b')](function(){return _0x291b63[_0xfe85('0x51')](_0x47a3f6,_0x57ea87,function(_0x35156b){if(_0x35156b){console[_0xfe85('0x79')]('err',_0x35156b);}else{fs[_0xfe85('0x7a')](_0x47a3f6);}});});});}else{return _0x291b63[_0xfe85('0x11')](0xc8);}})['catch'](handleError(_0x291b63,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 41d987e..15b5fed 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 _0x65d2=['setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65d2,0xb8));var _0x265d=function(_0x5a3024,_0x21586d){_0x5a3024=_0x5a3024-0x0;var _0x1f4424=_0x65d2[_0x5a3024];return _0x1f4424;};'use strict';var EventEmitter=require(_0x265d('0x0'));var WhatsappInteraction=require(_0x265d('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x265d('0x1'))['db'][_0x265d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x265d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x265d('0x4'),'afterDestroy':_0x265d('0x5')};function emitEvent(_0x2f91bf){return function(_0x579b25,_0x3e4ca8,_0xd49e24){_0x579b25[_0x265d('0x6')]({'attributes':['id'],'raw':!![]})[_0x265d('0x7')](function(_0x96e943){_0x579b25['setDataValue'](_0x265d('0x8'),_0x96e943[_0x265d('0x9')](function(_0x258ae0){return{'id':_0x258ae0['id']};}));return WhatsappMessage[_0x265d('0xa')]({'where':{'WhatsappInteractionId':_0x579b25['id'],'direction':'in','read':![]},'raw':!![]});})[_0x265d('0x7')](function(_0x479640){_0x579b25[_0x265d('0xb')](_0x265d('0xc'),_0x479640['length']);WhatsappInteractionEvents[_0x265d('0xd')](_0x2f91bf+':'+_0x579b25['id'],_0x579b25);WhatsappInteractionEvents[_0x265d('0xd')](_0x2f91bf,_0x579b25);_0xd49e24(null);})[_0x265d('0xe')](_0xd49e24(null));};}for(var e in events){if(events[_0x265d('0xf')](e)){var event=events[e];WhatsappInteraction[_0x265d('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x55e0=['update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','save'];(function(_0x41c635,_0x83ded2){var _0x5e4664=function(_0x1aebbf){while(--_0x1aebbf){_0x41c635['push'](_0x41c635['shift']());}};_0x5e4664(++_0x83ded2);}(_0x55e0,0xdc));var _0x055e=function(_0x1ebeb3,_0x21b94b){_0x1ebeb3=_0x1ebeb3-0x0;var _0x44bf36=_0x55e0[_0x1ebeb3];return _0x44bf36;};'use strict';var EventEmitter=require(_0x055e('0x0'));var WhatsappInteraction=require(_0x055e('0x1'))['db'][_0x055e('0x2')];var WhatsappMessage=require(_0x055e('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x055e('0x3'),'afterUpdate':_0x055e('0x4'),'afterDestroy':_0x055e('0x5')};function emitEvent(_0x2773e4){return function(_0x157473,_0x196394,_0x490ee1){_0x157473['getUsers']({'attributes':['id'],'raw':!![]})[_0x055e('0x6')](function(_0x4a442e){_0x157473[_0x055e('0x7')](_0x055e('0x8'),_0x4a442e[_0x055e('0x9')](function(_0x230c32){return{'id':_0x230c32['id']};}));return WhatsappMessage[_0x055e('0xa')]({'where':{'WhatsappInteractionId':_0x157473['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x40779c){_0x157473[_0x055e('0x7')](_0x055e('0xb'),_0x40779c[_0x055e('0xc')]);WhatsappInteractionEvents[_0x055e('0xd')](_0x2773e4+':'+_0x157473['id'],_0x157473);WhatsappInteractionEvents['emit'](_0x2773e4,_0x157473);_0x490ee1(null);})['catch'](_0x490ee1(null));};}for(var e in events){if(events[_0x055e('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x055e('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e1a5df9..1143c59 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 _0xa977=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xf953fc,_0x3d5e44){var _0x40226d=function(_0x27884b){while(--_0x27884b){_0xf953fc['push'](_0xf953fc['shift']());}};_0x40226d(++_0x3d5e44);}(_0xa977,0x7e));var _0x7a97=function(_0x42c419,_0xefad8c){_0x42c419=_0x42c419-0x0;var _0x45b3b0=_0xa977[_0x42c419];return _0x45b3b0;};'use strict';var _=require(_0x7a97('0x0'));var util=require(_0x7a97('0x1'));var logger=require(_0x7a97('0x2'))(_0x7a97('0x3'));var moment=require('moment');var BPromise=require(_0x7a97('0x4'));var rp=require(_0x7a97('0x5'));var fs=require('fs');var path=require(_0x7a97('0x6'));var rimraf=require('rimraf');var config=require(_0x7a97('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x7a97('0x8')]=function(_0x5260c4,_0x391bfc){return _0x5260c4[_0x7a97('0x9')](_0x7a97('0xa'),attributes,{'tableName':_0x7a97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x445dfa,_0x52557f,_0x55278b){if(_0x445dfa[_0x7a97('0xc')](_0x7a97('0xd'))){_0x445dfa[_0x7a97('0xe')]=moment()['format'](_0x7a97('0xf'));}_0x55278b(null,_0x445dfa);}}});}; \ No newline at end of file +var _0xff24=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','changed','closedAt','format','lodash'];(function(_0x103be5,_0xe24819){var _0x306562=function(_0x3fbcdc){while(--_0x3fbcdc){_0x103be5['push'](_0x103be5['shift']());}};_0x306562(++_0xe24819);}(_0xff24,0x109));var _0x4ff2=function(_0x309e82,_0x354047){_0x309e82=_0x309e82-0x0;var _0x13b02c=_0xff24[_0x309e82];return _0x13b02c;};'use strict';var _=require(_0x4ff2('0x0'));var util=require('util');var logger=require(_0x4ff2('0x1'))(_0x4ff2('0x2'));var moment=require(_0x4ff2('0x3'));var BPromise=require(_0x4ff2('0x4'));var rp=require(_0x4ff2('0x5'));var fs=require('fs');var path=require(_0x4ff2('0x6'));var rimraf=require(_0x4ff2('0x7'));var config=require('../../config/environment');var attributes=require(_0x4ff2('0x8'));module[_0x4ff2('0x9')]=function(_0x475977,_0xeb1399){return _0x475977[_0x4ff2('0xa')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c261d,_0x25d117,_0xdc3dc7){if(_0x2c261d[_0x4ff2('0xb')]('closed')){_0x2c261d[_0x4ff2('0xc')]=moment()[_0x4ff2('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xdc3dc7(null,_0x2c261d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0a10ee6..ea6dbc0 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 _0xfcea=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','moment'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xfcea,0x178));var _0xafce=function(_0x5d7b2a,_0x38b4c6){_0x5d7b2a=_0x5d7b2a-0x0;var _0x1748d6=_0xfcea[_0x5d7b2a];return _0x1748d6;};'use strict';var _=require('lodash');var util=require(_0xafce('0x0'));var moment=require(_0xafce('0x1'));var BPromise=require(_0xafce('0x2'));var rs=require(_0xafce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafce('0x4'))['db'];var utils=require(_0xafce('0x5'));var logger=require(_0xafce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xafce('0x7')][_0xafce('0x8')]({'port':0x232a});config[_0xafce('0x9')]=_['defaults'](config[_0xafce('0x9')],{'host':_0xafce('0xa'),'port':0x18eb});var socket=require(_0xafce('0xb'))(new Redis(config[_0xafce('0x9')]));require(_0xafce('0xc'))[_0xafce('0xd')](socket);function respondWithRpcPromise(_0x5d6f14,_0x14fcbe,_0x3b40ea){return new BPromise(function(_0x5e5b9f,_0x2f7d06){return client[_0xafce('0xe')](_0x5d6f14,_0x3b40ea)[_0xafce('0xf')](function(_0x59e3d7){logger[_0xafce('0x10')](_0xafce('0x11'),_0x14fcbe,_0xafce('0x12'));logger[_0xafce('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x14fcbe,'request\x20sent',JSON['stringify'](_0x59e3d7));if(_0x59e3d7['error']){if(_0x59e3d7[_0xafce('0x14')][_0xafce('0x15')]===0x1f4){logger['error'](_0xafce('0x11'),_0x14fcbe,_0x59e3d7[_0xafce('0x14')][_0xafce('0x16')]);return _0x2f7d06(_0x59e3d7[_0xafce('0x14')]['message']);}logger['error'](_0xafce('0x11'),_0x14fcbe,_0x59e3d7['error'][_0xafce('0x16')]);return _0x5e5b9f(_0x59e3d7[_0xafce('0x14')][_0xafce('0x16')]);}else{logger[_0xafce('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x14fcbe,_0xafce('0x12'));_0x5e5b9f(_0x59e3d7[_0xafce('0x17')][_0xafce('0x16')]);}})['catch'](function(_0x34d1de){logger[_0xafce('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x14fcbe,_0x34d1de);_0x2f7d06(_0x34d1de);});});}exports[_0xafce('0x18')]=function(_0x2d2edc){var _0x110d7e=this;return new Promise(function(_0x55d7c4,_0xc43089){return db[_0xafce('0x19')][_0xafce('0x1a')](_0x2d2edc[_0xafce('0x1b')],{'raw':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x1e')]||null:null,'attributes':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc['options'][_0xafce('0x1f')]||null:null,'limit':_0x2d2edc[_0xafce('0x1c')]?_0x2d2edc[_0xafce('0x1c')][_0xafce('0x20')]||null:null})['then'](function(_0x261343){logger['info'](_0xafce('0x18'),_0x2d2edc);logger[_0xafce('0x13')](_0xafce('0x18'),_0x2d2edc,JSON[_0xafce('0x21')](_0x261343));_0x55d7c4(_0x261343);})[_0xafce('0x22')](function(_0x1ed20a){logger['error'](_0xafce('0x18'),_0x1ed20a[_0xafce('0x16')],_0x2d2edc);_0xc43089(_0x110d7e[_0xafce('0x14')](0x1f4,_0x1ed20a[_0xafce('0x16')]));});});};exports[_0xafce('0x23')]=function(_0x51823b){return new Promise(function(_0x12721e,_0x22064a){return db[_0xafce('0x19')][_0xafce('0x24')]({'where':_0x51823b[_0xafce('0x1c')]?_0x51823b[_0xafce('0x1c')]['where']||null:null})[_0xafce('0xf')](function(_0x1cc5a2){if(_0x1cc5a2){return _0x1cc5a2[_0xafce('0x25')](_0x51823b[_0xafce('0x1b')][_0xafce('0x26')],_[_0xafce('0x27')](_0x51823b[_0xafce('0x1b')],[_0xafce('0x26'),'id'])||{});}})[_0xafce('0x28')](function(_0x490097){logger[_0xafce('0x10')](_0xafce('0x29'),_0x51823b);logger[_0xafce('0x13')](_0xafce('0x29'),_0x51823b,JSON[_0xafce('0x21')](_0x490097));_0x12721e(_0x490097);})[_0xafce('0x22')](function(_0x5556c0){logger[_0xafce('0x14')](_0xafce('0x29'),_0x5556c0[_0xafce('0x16')],_0x51823b);_0x22064a(_this[_0xafce('0x14')](0x1f4,_0x5556c0[_0xafce('0x16')]));});});}; \ No newline at end of file +var _0x622a=['UpdateWhatsappInteraction','update','options','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','body','omit','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x23b6f0,_0x27ed3b){var _0x9547d5=function(_0x1eae75){while(--_0x1eae75){_0x23b6f0['push'](_0x23b6f0['shift']());}};_0x9547d5(++_0x27ed3b);}(_0x622a,0xae));var _0xa622=function(_0x308182,_0x5c805a){_0x308182=_0x308182-0x0;var _0x423e4c=_0x622a[_0x308182];return _0x423e4c;};'use strict';var _=require(_0xa622('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa622('0x1'));var rs=require(_0xa622('0x2'));var fs=require('fs');var Redis=require(_0xa622('0x3'));var db=require(_0xa622('0x4'))['db'];var utils=require(_0xa622('0x5'));var logger=require(_0xa622('0x6'))(_0xa622('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa622('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xa622('0x9')],{'host':_0xa622('0xa'),'port':0x18eb});var socket=require(_0xa622('0xb'))(new Redis(config[_0xa622('0x9')]));require(_0xa622('0xc'))[_0xa622('0xd')](socket);function respondWithRpcPromise(_0x293824,_0x1f4c9d,_0x229b33){return new BPromise(function(_0x3453f4,_0x731ff1){return client['request'](_0x293824,_0x229b33)[_0xa622('0xe')](function(_0x11d05f){logger[_0xa622('0xf')](_0xa622('0x10'),_0x1f4c9d,'request\x20sent');logger[_0xa622('0x11')](_0xa622('0x12'),_0x1f4c9d,_0xa622('0x13'),JSON[_0xa622('0x14')](_0x11d05f));if(_0x11d05f[_0xa622('0x15')]){if(_0x11d05f['error'][_0xa622('0x16')]===0x1f4){logger[_0xa622('0x15')](_0xa622('0x10'),_0x1f4c9d,_0x11d05f[_0xa622('0x15')][_0xa622('0x17')]);return _0x731ff1(_0x11d05f[_0xa622('0x15')]['message']);}logger[_0xa622('0x15')](_0xa622('0x10'),_0x1f4c9d,_0x11d05f['error'][_0xa622('0x17')]);return _0x3453f4(_0x11d05f[_0xa622('0x15')]['message']);}else{logger[_0xa622('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1f4c9d,_0xa622('0x13'));_0x3453f4(_0x11d05f[_0xa622('0x18')][_0xa622('0x17')]);}})[_0xa622('0x19')](function(_0x535678){logger['error'](_0xa622('0x10'),_0x1f4c9d,_0x535678);_0x731ff1(_0x535678);});});}exports[_0xa622('0x1a')]=function(_0x2099d5){var _0x267a4d=this;return new Promise(function(_0x4ad3c2,_0x125589){return db['WhatsappInteraction'][_0xa622('0x1b')](_0x2099d5['body'],{'raw':_0x2099d5[_0xa622('0x1c')]?_0x2099d5[_0xa622('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2099d5[_0xa622('0x1c')]?_0x2099d5[_0xa622('0x1c')][_0xa622('0x1d')]||null:null,'attributes':_0x2099d5[_0xa622('0x1c')]?_0x2099d5[_0xa622('0x1c')][_0xa622('0x1e')]||null:null,'limit':_0x2099d5[_0xa622('0x1c')]?_0x2099d5[_0xa622('0x1c')][_0xa622('0x1f')]||null:null})[_0xa622('0xe')](function(_0x31b6eb){logger['info'](_0xa622('0x1a'),_0x2099d5);logger[_0xa622('0x11')](_0xa622('0x1a'),_0x2099d5,JSON[_0xa622('0x14')](_0x31b6eb));_0x4ad3c2(_0x31b6eb);})[_0xa622('0x19')](function(_0x2d8b53){logger[_0xa622('0x15')](_0xa622('0x1a'),_0x2d8b53[_0xa622('0x17')],_0x2099d5);_0x125589(_0x267a4d[_0xa622('0x15')](0x1f4,_0x2d8b53['message']));});});};exports[_0xa622('0x20')]=function(_0xadee48){return new Promise(function(_0x1b5524,_0x1d14d6){return db[_0xa622('0x21')]['find']({'where':_0xadee48['options']?_0xadee48[_0xa622('0x1c')][_0xa622('0x1d')]||null:null})[_0xa622('0xe')](function(_0x45c190){if(_0x45c190){return _0x45c190[_0xa622('0x22')](_0xadee48[_0xa622('0x23')]['ids'],_[_0xa622('0x24')](_0xadee48[_0xa622('0x23')],[_0xa622('0x25'),'id'])||{});}})[_0xa622('0x26')](function(_0x193c7e){logger['info'](_0xa622('0x27'),_0xadee48);logger['debug'](_0xa622('0x27'),_0xadee48,JSON['stringify'](_0x193c7e));_0x1b5524(_0x193c7e);})[_0xa622('0x19')](function(_0x477b9f){logger['error'](_0xa622('0x27'),_0x477b9f[_0xa622('0x17')],_0xadee48);_0x1d14d6(_this[_0xa622('0x15')](0x1f4,_0x477b9f[_0xa622('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index dafcba5..60e8eaa 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 _0x9df3=['emit','./whatsappInteraction.events','remove','update'];(function(_0x1243b2,_0x2fe5dd){var _0xcb48d3=function(_0x1cd8a6){while(--_0x1cd8a6){_0x1243b2['push'](_0x1243b2['shift']());}};_0xcb48d3(++_0x2fe5dd);}(_0x9df3,0xcd));var _0x39df=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9df3[_0x484e36];return _0xafc85d;};'use strict';var WhatsappInteractionEvents=require(_0x39df('0x0'));var events=['save',_0x39df('0x1'),_0x39df('0x2')];function createListener(_0x1fec6a,_0x183686){return function(_0x4ca416){_0x183686[_0x39df('0x3')](_0x1fec6a,_0x4ca416);};}function removeListener(_0x4f29d4,_0x14ac7e){return function(){WhatsappInteractionEvents['removeListener'](_0x4f29d4,_0x14ac7e);};}exports['register']=function(_0x20e8ee){for(var _0x410189=0x0,_0x46494d=events['length'];_0x410189<_0x46494d;_0x410189++){var _0x3e6414=events[_0x410189];var _0x318783=createListener('whatsappInteraction:'+_0x3e6414,_0x20e8ee);WhatsappInteractionEvents['on'](_0x3e6414,_0x318783);}}; \ No newline at end of file +var _0xc2a3=['length','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x5a306d,_0x3ea7b4){var _0x267fbc=function(_0x3f3c44){while(--_0x3f3c44){_0x5a306d['push'](_0x5a306d['shift']());}};_0x267fbc(++_0x3ea7b4);}(_0xc2a3,0x17b));var _0x3c2a=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xc2a3[_0x1a89ca];return _0x29cbb2;};'use strict';var WhatsappInteractionEvents=require(_0x3c2a('0x0'));var events=[_0x3c2a('0x1'),_0x3c2a('0x2'),_0x3c2a('0x3')];function createListener(_0x555186,_0x2c283d){return function(_0x66cafa){_0x2c283d['emit'](_0x555186,_0x66cafa);};}function removeListener(_0x43aa78,_0x101139){return function(){WhatsappInteractionEvents[_0x3c2a('0x4')](_0x43aa78,_0x101139);};}exports['register']=function(_0x399754){for(var _0x513201=0x0,_0x3ea6cb=events[_0x3c2a('0x5')];_0x513201<_0x3ea6cb;_0x513201++){var _0x5211c9=events[_0x513201];var _0x1dcf27=createListener('whatsappInteraction:'+_0x5211c9,_0x399754);WhatsappInteractionEvents['on'](_0x5211c9,_0x1dcf27);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index becbf85..fd16f27 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 _0x0c6f=['put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsappmessage:create','create','/:id/status','status'];(function(_0x3b40e5,_0xd8ca73){var _0x31d8ec=function(_0x1e4127){while(--_0x1e4127){_0x3b40e5['push'](_0x3b40e5['shift']());}};_0x31d8ec(++_0xd8ca73);}(_0x0c6f,0x10b));var _0xf0c6=function(_0xa1bac2,_0x14c67d){_0xa1bac2=_0xa1bac2-0x0;var _0x53092e=_0x0c6f[_0xa1bac2];return _0x53092e;};'use strict';var multer=require(_0xf0c6('0x0'));var util=require('util');var path=require(_0xf0c6('0x1'));var timeout=require(_0xf0c6('0x2'));var express=require('express');var router=express[_0xf0c6('0x3')]();var fs_extra=require(_0xf0c6('0x4'));var auth=require(_0xf0c6('0x5'));var interaction=require(_0xf0c6('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xf0c6('0x7')]('/',auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x9')]);router[_0xf0c6('0x7')](_0xf0c6('0xa'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0xb')]);router[_0xf0c6('0x7')](_0xf0c6('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf0c6('0xd')]('/',auth[_0xf0c6('0x8')](),interaction[_0xf0c6('0xe')]('whatsapp',_0xf0c6('0xf')),controller[_0xf0c6('0x10')]);router['post'](_0xf0c6('0x11'),controller[_0xf0c6('0x12')]);router[_0xf0c6('0x13')]('/:id',auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x14')]);router[_0xf0c6('0x13')](_0xf0c6('0x15'),auth[_0xf0c6('0x8')](),controller['accept']);router[_0xf0c6('0x13')](_0xf0c6('0x16'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x17')]);router[_0xf0c6('0x18')](_0xf0c6('0xc'),auth[_0xf0c6('0x8')](),controller[_0xf0c6('0x19')]);module['exports']=router; \ No newline at end of file +var _0x74d4=['put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','whatsapp','whatsappmessage:create','/:id/status','status'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x74d4,0x190));var _0x474d=function(_0x509177,_0x4f3f69){_0x509177=_0x509177-0x0;var _0x5a67f5=_0x74d4[_0x509177];return _0x5a67f5;};'use strict';var multer=require(_0x474d('0x0'));var util=require(_0x474d('0x1'));var path=require(_0x474d('0x2'));var timeout=require(_0x474d('0x3'));var express=require(_0x474d('0x4'));var router=express['Router']();var fs_extra=require(_0x474d('0x5'));var auth=require(_0x474d('0x6'));var interaction=require(_0x474d('0x7'));var config=require(_0x474d('0x8'));var controller=require('./whatsappMessage.controller');router[_0x474d('0x9')]('/',auth[_0x474d('0xa')](),controller[_0x474d('0xb')]);router[_0x474d('0x9')](_0x474d('0xc'),auth[_0x474d('0xa')](),controller['describe']);router['get'](_0x474d('0xd'),auth[_0x474d('0xa')](),controller[_0x474d('0xe')]);router[_0x474d('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x474d('0x10'),_0x474d('0x11')),controller['create']);router[_0x474d('0xf')](_0x474d('0x12'),controller[_0x474d('0x13')]);router[_0x474d('0x14')](_0x474d('0xd'),auth[_0x474d('0xa')](),controller['update']);router['put'](_0x474d('0x15'),auth[_0x474d('0xa')](),controller[_0x474d('0x16')]);router['put'](_0x474d('0x17'),auth[_0x474d('0xa')](),controller[_0x474d('0x18')]);router[_0x474d('0x19')](_0x474d('0xd'),auth[_0x474d('0xa')](),controller[_0x474d('0x1a')]);module[_0x474d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index ad9aa4f..2e266c0 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 _0x0bc3=['TEXT','medium','BOOLEAN','ENUM','STRING','DATE','sequelize'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x0bc3,0x6f));var _0x30bc=function(_0x209584,_0x48b48c){_0x209584=_0x209584-0x0;var _0x3b5ea6=_0x0bc3[_0x209584];return _0x3b5ea6;};'use strict';var Sequelize=require(_0x30bc('0x0'));module['exports']={'body':{'type':Sequelize[_0x30bc('0x1')](_0x30bc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x30bc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x30bc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x30bc('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x30bc('0x6')]},'secret':{'type':Sequelize[_0x30bc('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x30bc('0x5')]},'providerResponse':{'type':Sequelize[_0x30bc('0x1')]}}; \ No newline at end of file +var _0x80d0=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x30eb90,_0x1dc6b7){var _0x3eadae=function(_0x4eed81){while(--_0x4eed81){_0x30eb90['push'](_0x30eb90['shift']());}};_0x3eadae(++_0x1dc6b7);}(_0x80d0,0x1b5));var _0x080d=function(_0x593d91,_0x558d81){_0x593d91=_0x593d91-0x0;var _0x4afafc=_0x80d0[_0x593d91];return _0x4afafc;};'use strict';var Sequelize=require(_0x080d('0x0'));module['exports']={'body':{'type':Sequelize[_0x080d('0x1')](_0x080d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x080d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x080d('0x4')]('in',_0x080d('0x5')),'defaultValue':_0x080d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x080d('0x6')]},'secret':{'type':Sequelize[_0x080d('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 43f042c..fe8e967 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 _0x3235=['create','body','destroy','describe','accept','whatsapp','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','interface','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','read','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0x3235,0x145));var _0x5323=function(_0x38388c,_0x1924ff){_0x38388c=_0x38388c-0x0;var _0x314d69=_0x3235[_0x38388c];return _0x314d69;};'use strict';var emlformat=require(_0x5323('0x0'));var rimraf=require(_0x5323('0x1'));var zipdir=require(_0x5323('0x2'));var jsonpatch=require(_0x5323('0x3'));var rp=require('request-promise');var moment=require(_0x5323('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5323('0x5'));var util=require(_0x5323('0x6'));var path=require(_0x5323('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5323('0x8'));var fs=require('fs');var fs_extra=require(_0x5323('0x9'));var _=require(_0x5323('0xa'));var squel=require('squel');var crypto=require(_0x5323('0xb'));var jsforce=require(_0x5323('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5323('0xd'));var Papa=require(_0x5323('0xe'));var Redis=require(_0x5323('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5323('0x10'));var hardwareService=require(_0x5323('0x11'));var logger=require(_0x5323('0x12'))('api');var utils=require(_0x5323('0x13'));var config=require(_0x5323('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5323('0x15'))['db'];config[_0x5323('0x16')]=_['defaults'](config[_0x5323('0x16')],{'host':_0x5323('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5323('0x16')]));require(_0x5323('0x18'))[_0x5323('0x19')](socket);var jayson=require(_0x5323('0x1a'));var client=jayson['client'][_0x5323('0x1b')]({'port':0x232c});var client9002=jayson[_0x5323('0x1c')][_0x5323('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x25bfc7,_0x53ba67,_0x265bee,_0x4740e7){return new BPromise(function(_0x5a4e5c,_0x384893){var _0x208a98=_0x4740e7||client;return _0x208a98[_0x5323('0x1d')](_0x25bfc7,_0x265bee)[_0x5323('0x1e')](function(_0x5b0462){logger[_0x5323('0x1f')](_0x5323('0x20'),_0x53ba67,_0x5323('0x21'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x53ba67,_0x5323('0x21'),JSON[_0x5323('0x22')](_0x5b0462));if(_0x5b0462[_0x5323('0x23')]){if(_0x5b0462[_0x5323('0x23')][_0x5323('0x24')]===0x1f4){logger[_0x5323('0x23')](_0x5323('0x20'),_0x53ba67,_0x5b0462['error'][_0x5323('0x25')]);return _0x384893(_0x5b0462[_0x5323('0x23')][_0x5323('0x25')]);}logger['error'](_0x5323('0x20'),_0x53ba67,_0x5b0462[_0x5323('0x23')][_0x5323('0x25')]);return _0x5a4e5c(_0x5b0462[_0x5323('0x23')]['message']);}else{logger[_0x5323('0x1f')](_0x5323('0x20'),_0x53ba67,_0x5323('0x21'));_0x5a4e5c(_0x5b0462[_0x5323('0x26')]['message']);}})[_0x5323('0x27')](function(_0xce9995){logger['error'](_0x5323('0x20'),_0x53ba67,_0xce9995);_0x384893(_0xce9995);});});}function respondWithStatusCode(_0xb8f7bc,_0x2e1596){_0x2e1596=_0x2e1596||0xcc;return function(_0x3f9105){if(_0x3f9105){return _0xb8f7bc[_0x5323('0x28')](_0x2e1596);}return _0xb8f7bc['status'](_0x2e1596)['end']();};}function respondWithResult(_0x4c4807,_0x219f13){_0x219f13=_0x219f13||0xc8;return function(_0x25fbf2){if(_0x25fbf2){return _0x4c4807['status'](_0x219f13)[_0x5323('0x29')](_0x25fbf2);}};}function respondWithFilteredResult(_0x3882aa,_0x2db4ad){return function(_0x2ed9c4){if(_0x2ed9c4){var _0x5f15d8=typeof _0x2db4ad[_0x5323('0x2a')]===_0x5323('0x2b')&&typeof _0x2db4ad[_0x5323('0x2c')]==='undefined';var _0x287721=_0x2ed9c4[_0x5323('0x2d')];var _0x56eca3=_0x5f15d8?0x0:_0x2db4ad[_0x5323('0x2a')];var _0x353da0=_0x5f15d8?_0x2ed9c4[_0x5323('0x2d')]:_0x2db4ad[_0x5323('0x2a')]+_0x2db4ad['limit'];var _0xfd1080;if(_0x353da0>=_0x287721){_0x353da0=_0x287721;_0xfd1080=0xc8;}else{_0xfd1080=0xce;}_0x3882aa[_0x5323('0x2e')](_0xfd1080);return _0x3882aa[_0x5323('0x2f')](_0x5323('0x30'),_0x56eca3+'-'+_0x353da0+'/'+_0x287721)[_0x5323('0x29')](_0x2ed9c4);}return null;};}function patchUpdates(_0xb3e06d){return function(_0x39989d){try{jsonpatch['apply'](_0x39989d,_0xb3e06d,!![]);}catch(_0x574e1a){return BPromise[_0x5323('0x31')](_0x574e1a);}return _0x39989d[_0x5323('0x32')]();};}function saveUpdates(_0xebea3a,_0x342616){return function(_0x57b2ea){if(_0x57b2ea){return _0x57b2ea['update'](_0xebea3a)['then'](function(_0x900b0c){return _0x900b0c;});}return null;};}function removeEntity(_0x583a4d,_0x442a68){return function(_0x119f70){if(_0x119f70){return _0x119f70['destroy']()[_0x5323('0x1e')](function(){_0x583a4d[_0x5323('0x2e')](0xcc)[_0x5323('0x33')]();});}};}function handleEntityNotFound(_0x442fb9,_0x24b412){return function(_0x2f9903){if(!_0x2f9903){_0x442fb9[_0x5323('0x28')](0x194);}return _0x2f9903;};}function handleError(_0x59917a,_0x4c8e78){_0x4c8e78=_0x4c8e78||0x1f4;return function(_0x6d2682){logger[_0x5323('0x23')](_0x6d2682[_0x5323('0x34')]);if(_0x6d2682['name']){delete _0x6d2682[_0x5323('0x35')];}_0x59917a[_0x5323('0x2e')](_0x4c8e78)[_0x5323('0x36')](_0x6d2682);};}exports[_0x5323('0x37')]=function(_0x134a67,_0x2f5bf7){var _0x32a8de={},_0x17734b={},_0x37dac2={'count':0x0,'rows':[]};var _0x1fc157=_[_0x5323('0x38')](db[_0x5323('0x39')][_0x5323('0x3a')],function(_0x18c68a){return{'name':_0x18c68a[_0x5323('0x3b')],'type':_0x18c68a[_0x5323('0x3c')][_0x5323('0x3d')]};});_0x17734b[_0x5323('0x3e')]=_[_0x5323('0x38')](_0x1fc157,_0x5323('0x35'));_0x17734b['query']=_[_0x5323('0x3f')](_0x134a67['query']);_0x17734b[_0x5323('0x40')]=_[_0x5323('0x41')](_0x17734b[_0x5323('0x3e')],_0x17734b['query']);_0x32a8de[_0x5323('0x42')]=_['intersection'](_0x17734b[_0x5323('0x3e')],qs[_0x5323('0x43')](_0x134a67[_0x5323('0x44')][_0x5323('0x43')]));_0x32a8de[_0x5323('0x42')]=_0x32a8de[_0x5323('0x42')]['length']?_0x32a8de[_0x5323('0x42')]:_0x17734b['model'];if(!_0x134a67[_0x5323('0x44')][_0x5323('0x45')](_0x5323('0x46'))){_0x32a8de[_0x5323('0x2c')]=qs[_0x5323('0x2c')](_0x134a67[_0x5323('0x44')][_0x5323('0x2c')]);_0x32a8de['offset']=qs[_0x5323('0x2a')](_0x134a67[_0x5323('0x44')]['offset']);}_0x32a8de[_0x5323('0x47')]=qs[_0x5323('0x48')](_0x134a67[_0x5323('0x44')][_0x5323('0x48')]);_0x32a8de[_0x5323('0x49')]=qs[_0x5323('0x40')](_['pick'](_0x134a67[_0x5323('0x44')],_0x17734b[_0x5323('0x40')]),_0x1fc157);if(_0x134a67[_0x5323('0x44')][_0x5323('0x4a')]){_0x32a8de[_0x5323('0x49')]=_[_0x5323('0x4b')](_0x32a8de[_0x5323('0x49')],{'$or':_['map'](_0x1fc157,function(_0x450931){if(_0x450931['type']!==_0x5323('0x4c')){var _0x399dc7={};_0x399dc7[_0x450931[_0x5323('0x35')]]={'$like':'%'+_0x134a67['query']['filter']+'%'};return _0x399dc7;}})});}_0x32a8de=_['merge']({},_0x32a8de,_0x134a67[_0x5323('0x4d')]);var _0x2115b5={'where':_0x32a8de[_0x5323('0x49')]};return db[_0x5323('0x39')][_0x5323('0x2d')](_0x2115b5)[_0x5323('0x1e')](function(_0x59a3dc){_0x37dac2[_0x5323('0x2d')]=_0x59a3dc;if(_0x134a67[_0x5323('0x44')][_0x5323('0x4e')]){_0x32a8de[_0x5323('0x4f')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x5323('0x50')](_0x32a8de);})[_0x5323('0x1e')](function(_0x7a6245){_0x37dac2[_0x5323('0x51')]=_0x7a6245;return _0x37dac2;})[_0x5323('0x1e')](respondWithFilteredResult(_0x2f5bf7,_0x32a8de))['catch'](handleError(_0x2f5bf7,null));};exports[_0x5323('0x52')]=function(_0x483a5f,_0x3f2432){var _0x3dae2b={'raw':!![],'where':{'id':_0x483a5f[_0x5323('0x53')]['id']}},_0x5c4c57={};_0x5c4c57[_0x5323('0x3e')]=_[_0x5323('0x3f')](db[_0x5323('0x39')][_0x5323('0x3a')]);_0x5c4c57['query']=_[_0x5323('0x3f')](_0x483a5f[_0x5323('0x44')]);_0x5c4c57[_0x5323('0x40')]=_['intersection'](_0x5c4c57['model'],_0x5c4c57[_0x5323('0x44')]);_0x3dae2b[_0x5323('0x42')]=_[_0x5323('0x41')](_0x5c4c57[_0x5323('0x3e')],qs[_0x5323('0x43')](_0x483a5f[_0x5323('0x44')]['fields']));_0x3dae2b['attributes']=_0x3dae2b[_0x5323('0x42')][_0x5323('0x54')]?_0x3dae2b[_0x5323('0x42')]:_0x5c4c57['model'];if(_0x483a5f[_0x5323('0x44')][_0x5323('0x4e')]){_0x3dae2b[_0x5323('0x4f')]=[{'all':!![]}];}_0x3dae2b=_[_0x5323('0x4b')]({},_0x3dae2b,_0x483a5f['options']);return db[_0x5323('0x39')][_0x5323('0x55')](_0x3dae2b)['then'](handleEntityNotFound(_0x3f2432,null))[_0x5323('0x1e')](respondWithResult(_0x3f2432,null))['catch'](handleError(_0x3f2432,null));};exports[_0x5323('0x56')]=function(_0x485d3c,_0x464a74){return db[_0x5323('0x39')]['create'](_0x485d3c[_0x5323('0x57')],{})[_0x5323('0x1e')](respondWithResult(_0x464a74,0xc9))[_0x5323('0x27')](handleError(_0x464a74,null));};exports['update']=function(_0x31483c,_0x5f3435){if(_0x31483c['body']['id']){delete _0x31483c['body']['id'];}return db['WhatsappMessage'][_0x5323('0x55')]({'where':{'id':_0x31483c[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x5f3435,null))[_0x5323('0x1e')](saveUpdates(_0x31483c['body'],null))[_0x5323('0x1e')](respondWithResult(_0x5f3435,null))['catch'](handleError(_0x5f3435,null));};exports[_0x5323('0x58')]=function(_0x471ac4,_0x4a4446){return db['WhatsappMessage'][_0x5323('0x55')]({'where':{'id':_0x471ac4[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x4a4446,null))[_0x5323('0x1e')](removeEntity(_0x4a4446,null))[_0x5323('0x27')](handleError(_0x4a4446,null));};exports[_0x5323('0x59')]=function(_0x5d9235,_0xf79be7){return db[_0x5323('0x39')]['describe']()[_0x5323('0x1e')](respondWithResult(_0xf79be7,null))['catch'](handleError(_0xf79be7,null));};var interaction_log=require(_0x5323('0x12'))('whatsapp-interactions');exports[_0x5323('0x5a')]=function(_0x45fbb6,_0x243f40,_0x57e28e){var _0x40ce30={'agent':{},'channel':_0x5323('0x5b')};if(_0x45fbb6['body']['id']){delete _0x45fbb6[_0x5323('0x57')]['id'];}_0x45fbb6['body']['read']=!![];_0x45fbb6[_0x5323('0x57')]['readAt']=moment()[_0x5323('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x45fbb6[_0x5323('0x57')]['UserId']=_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')]||_0x45fbb6[_0x5323('0x5e')]['id'];_0x40ce30[_0x5323('0x5f')]['id']=_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')];return db[_0x5323('0x39')][_0x5323('0x55')]({'where':{'id':_0x45fbb6[_0x5323('0x53')]['id'],'UserId':null}})[_0x5323('0x1e')](handleEntityNotFound(_0x243f40,null))[_0x5323('0x1e')](saveUpdates(_0x45fbb6['body'],null))[_0x5323('0x1e')](function(_0x36af29){if(_0x36af29){_0x40ce30[_0x5323('0x25')]=_0x36af29[_0x5323('0x60')]({'plain':!![]});return db[_0x5323('0x61')][_0x5323('0x55')]({'where':{'id':_0x36af29[_0x5323('0x62')]}});}return null;})[_0x5323('0x1e')](handleEntityNotFound(_0x243f40,null))[_0x5323('0x1e')](function(_0x5cff64){if(_0x5cff64){return _0x5cff64['update']({'UserId':_0x45fbb6[_0x5323('0x57')][_0x5323('0x5d')],'read1stAt':_['isNil'](_0x5cff64[_0x5323('0x63')])?moment()[_0x5323('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5323('0x1e')](function(_0x28aca9){if(_0x28aca9){_0x40ce30['interaction']=_0x28aca9[_0x5323('0x60')]({'plain':!![]});interaction_log[_0x5323('0x1f')](_0x5323('0x64'),_0x45fbb6[_0x5323('0x5e')]['id'],_0x45fbb6[_0x5323('0x5e')]['name'],_0x45fbb6['user'][_0x5323('0x65')],_0x40ce30[_0x5323('0x66')]['id'],_0x45fbb6[_0x5323('0x57')]?JSON[_0x5323('0x22')](_0x45fbb6[_0x5323('0x57')]):_0x5323('0x67'));return respondWithRpcPromise(_0x5323('0x68'),'acceptMessage',_0x40ce30);}return null;})[_0x5323('0x1e')](function(_0x33034d){var _0x2b4fdd=_0x5323('0x69')+_0x33034d[_0x5323('0x25')]['ContactId'];return db[_0x5323('0x6a')][_0x5323('0x44')](_0x2b4fdd,{'type':db[_0x5323('0x6b')][_0x5323('0x6c')][_0x5323('0x6d')],'raw':!![]})[_0x5323('0x1e')](function(_0x1397ad){return _0x1397ad;});})[_0x5323('0x1e')](function(_0x4b0cc5){if(_0x4b0cc5){_0x40ce30[_0x5323('0x25')][_0x5323('0x6e')]=_0x4b0cc5[0x0];if(!_0x45fbb6[_0x5323('0x57')]['UserId'])return;return db[_0x5323('0x6f')][_0x5323('0x55')]({'where':{'id':_0x45fbb6[_0x5323('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x5323('0x35'),_0x5323('0x70'),_0x5323('0x71'),_0x5323('0x72')],'raw':!![]});}return null;})['then'](function(_0x5df20d){if(!_0x5df20d)return null;_0x40ce30[_0x5323('0x25')]['agent']=_0x5df20d;return _0x40ce30;})[_0x5323('0x1e')](function(_0x588250){if(_0x588250){if(_0x45fbb6[_0x5323('0x57')]['manual']){_0x40ce30[_0x5323('0x25')]['interface']=util['format'](_0x5323('0x73'),_0x45fbb6[_0x5323('0x5e')][_0x5323('0x35')]);_0x40ce30[_0x5323('0x25')][_0x5323('0x74')]=_0x40ce30[_0x5323('0x74')];_0x40ce30[_0x5323('0x25')][_0x5323('0x75')]=_0x40ce30[_0x5323('0x74')];_0x40ce30[_0x5323('0x25')][_0x5323('0x76')]=_0x5323('0x5a');return respondWithRpcPromise(_0x5323('0x77'),_0x5323('0x77'),{'event':'acceptmessage','message':_0x40ce30[_0x5323('0x25')]},client9002)['then'](function(){return _0x40ce30;});}return _0x40ce30;}return null;})[_0x5323('0x1e')](respondWithResult(_0x243f40,null))[_0x5323('0x27')](handleError(_0x243f40,null));};var interaction_log=require(_0x5323('0x12'))(_0x5323('0x78'));exports[_0x5323('0x31')]=function(_0x52540c,_0x380563,_0x12a2a0){var _0x388740={'agent':{},'channel':_0x5323('0x5b')};if(_0x52540c[_0x5323('0x57')]['id']){delete _0x52540c[_0x5323('0x57')]['id'];}_0x52540c[_0x5323('0x57')][_0x5323('0x5d')]=_0x52540c[_0x5323('0x57')]['UserId']||_0x52540c[_0x5323('0x5e')]['id'];_0x388740[_0x5323('0x5f')]['id']=_0x52540c[_0x5323('0x57')][_0x5323('0x5d')];return db[_0x5323('0x39')][_0x5323('0x55')]({'where':{'id':_0x52540c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x380563,null))[_0x5323('0x1e')](function(_0x336ae3){if(_0x336ae3){_0x388740[_0x5323('0x25')]=_0x336ae3[_0x5323('0x60')]({'plain':!![]});return db[_0x5323('0x61')]['find']({'where':{'id':_0x336ae3[_0x5323('0x62')]}});}return null;})[_0x5323('0x1e')](handleEntityNotFound(_0x380563,null))[_0x5323('0x1e')](function(_0x135b4b){if(_0x135b4b){_0x388740['interaction']=_0x135b4b[_0x5323('0x60')]({'plain':!![]});interaction_log[_0x5323('0x1f')](_0x5323('0x79'),_0x52540c[_0x5323('0x5e')]['id'],_0x52540c[_0x5323('0x5e')][_0x5323('0x35')],_0x52540c[_0x5323('0x5e')][_0x5323('0x65')],_0x388740[_0x5323('0x66')]['id'],_0x52540c[_0x5323('0x57')]?JSON[_0x5323('0x22')](_0x52540c['body']):'null');return respondWithRpcPromise(_0x5323('0x7a'),_0x5323('0x7b'),_0x388740);}return null;})[_0x5323('0x1e')](function(_0x2c70eb){var _0x2586a4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c70eb['message'][_0x5323('0x7c')];return db[_0x5323('0x6a')][_0x5323('0x44')](_0x2586a4,{'type':db[_0x5323('0x6b')][_0x5323('0x6c')][_0x5323('0x6d')],'raw':!![]})[_0x5323('0x1e')](function(_0x44458a){return _0x44458a;});})[_0x5323('0x1e')](function(_0x4520a0){if(_0x4520a0){_0x388740[_0x5323('0x25')][_0x5323('0x6e')]=_0x4520a0[0x0];if(!_0x52540c[_0x5323('0x57')][_0x5323('0x5d')])return;return db[_0x5323('0x6f')]['find']({'where':{'id':_0x52540c[_0x5323('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x5323('0x35'),'fullname',_0x5323('0x71'),'internal'],'raw':!![]});}return null;})[_0x5323('0x1e')](function(_0x1aa8f7){if(!_0x1aa8f7)return null;_0x388740['message']['agent']=_0x1aa8f7;return _0x388740;})[_0x5323('0x1e')](function(_0x351675){if(_0x351675){_0x351675[_0x5323('0x25')][_0x5323('0x7d')]=util['format'](_0x5323('0x73'),_0x52540c[_0x5323('0x5e')]['name']);_0x351675['message'][_0x5323('0x74')]=_0x388740[_0x5323('0x74')];_0x351675[_0x5323('0x25')][_0x5323('0x75')]=_0x388740[_0x5323('0x74')];_0x351675['message'][_0x5323('0x76')]=_0x5323('0x31');respondWithRpcPromise(_0x5323('0x77'),_0x5323('0x77'),{'event':'rejectmessage','message':_0x351675[_0x5323('0x25')]},client9002);return _0x388740;}return null;})[_0x5323('0x1e')](respondWithResult(_0x380563,null))[_0x5323('0x27')](handleError(_0x380563,null));};exports[_0x5323('0x2e')]=function(_0x2ae15e,_0x2ff15f,_0x417e43){if(_0x2ae15e[_0x5323('0x57')]['id']){delete _0x2ae15e[_0x5323('0x57')]['id'];}var _0x3360bd;return db[_0x5323('0x39')]['find']({'where':{'id':_0x2ae15e[_0x5323('0x53')]['id']}})[_0x5323('0x1e')](handleEntityNotFound(_0x2ff15f,null))[_0x5323('0x1e')](function(_0x534751){if(_0x534751){_0x3360bd=_0x534751;return db[_0x5323('0x7e')][_0x5323('0x55')]({'where':{'id':_0x534751[_0x5323('0x7f')]}});}})[_0x5323('0x1e')](handleEntityNotFound(_0x2ff15f,null))[_0x5323('0x1e')](function(_0x5538ef){if(_0x5538ef){logger[_0x5323('0x80')](_0x5323('0x81'),_0x5323('0x2e'),'received\x20delivery\x20report\x20from',_0x5538ef['type'],util[_0x5323('0x82')](_0x2ae15e[_0x5323('0x57')],{'showHidden':![],'depth':null}));switch(_0x5538ef[_0x5323('0x3c')]){case _0x5323('0x83'):if(_0x2ae15e[_0x5323('0x57')][_0x5323('0x84')]&&_0x2ae15e[_0x5323('0x57')][_0x5323('0x84')]===_0x3360bd[_0x5323('0x85')]&&_0x2ae15e['body']['MessageStatus']&&_0x2ae15e[_0x5323('0x57')][_0x5323('0x86')]===_0x5323('0x87')){return _0x3360bd[_0x5323('0x88')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5323('0x2e'),_0x5323('0x83'),util[_0x5323('0x82')](_0x2ae15e[_0x5323('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x3360bd;}})[_0x5323('0x1e')](respondWithResult(_0x2ff15f,null))['catch'](handleError(_0x2ff15f,null));}; \ No newline at end of file +var _0x1f16=['role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','internal','manual','interface','format','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','User','fullname','email','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','sendStatus','stack','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','name','keys','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','intersection','find','create','body','destroy','describe','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x152740,_0x42cd39){var _0x53dd10=function(_0x518e7d){while(--_0x518e7d){_0x152740['push'](_0x152740['shift']());}};_0x53dd10(++_0x42cd39);}(_0x1f16,0xb2));var _0x61f1=function(_0xd304db,_0x1d6939){_0xd304db=_0xd304db-0x0;var _0x19a3dc=_0x1f16[_0xd304db];return _0x19a3dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61f1('0x0'));var zipdir=require(_0x61f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61f1('0x2'));var moment=require(_0x61f1('0x3'));var BPromise=require(_0x61f1('0x4'));var Mustache=require(_0x61f1('0x5'));var util=require(_0x61f1('0x6'));var path=require(_0x61f1('0x7'));var sox=require(_0x61f1('0x8'));var csv=require(_0x61f1('0x9'));var ejs=require(_0x61f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x61f1('0xb'));var jsforce=require(_0x61f1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x61f1('0xd'));var qs=require(_0x61f1('0xe'));var as=require(_0x61f1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61f1('0x10'))(_0x61f1('0x11'));var utils=require('../../config/utils');var config=require(_0x61f1('0x12'));var licenseUtil=require(_0x61f1('0x13'));var db=require(_0x61f1('0x14'))['db'];config['redis']=_['defaults'](config[_0x61f1('0x15')],{'host':_0x61f1('0x16'),'port':0x18eb});var socket=require(_0x61f1('0x17'))(new Redis(config[_0x61f1('0x15')]));require(_0x61f1('0x18'))[_0x61f1('0x19')](socket);var jayson=require(_0x61f1('0x1a'));var client=jayson[_0x61f1('0x1b')][_0x61f1('0x1c')]({'port':0x232c});var client9002=jayson[_0x61f1('0x1b')][_0x61f1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x499c6f,_0x1e2520,_0x893a91,_0xc87cb2){return new BPromise(function(_0x296534,_0x3de2c4){var _0x11760f=_0xc87cb2||client;return _0x11760f['request'](_0x499c6f,_0x893a91)['then'](function(_0xe5c283){logger['info'](_0x61f1('0x1d'),_0x1e2520,_0x61f1('0x1e'));logger[_0x61f1('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1e2520,_0x61f1('0x1e'),JSON[_0x61f1('0x20')](_0xe5c283));if(_0xe5c283[_0x61f1('0x21')]){if(_0xe5c283[_0x61f1('0x21')]['code']===0x1f4){logger[_0x61f1('0x21')](_0x61f1('0x1d'),_0x1e2520,_0xe5c283[_0x61f1('0x21')]['message']);return _0x3de2c4(_0xe5c283['error'][_0x61f1('0x22')]);}logger[_0x61f1('0x21')](_0x61f1('0x1d'),_0x1e2520,_0xe5c283[_0x61f1('0x21')][_0x61f1('0x22')]);return _0x296534(_0xe5c283[_0x61f1('0x21')][_0x61f1('0x22')]);}else{logger[_0x61f1('0x23')](_0x61f1('0x1d'),_0x1e2520,_0x61f1('0x1e'));_0x296534(_0xe5c283[_0x61f1('0x24')][_0x61f1('0x22')]);}})[_0x61f1('0x25')](function(_0xad574a){logger[_0x61f1('0x21')](_0x61f1('0x1d'),_0x1e2520,_0xad574a);_0x3de2c4(_0xad574a);});});}function respondWithStatusCode(_0x3e5e7e,_0x2ab0fe){_0x2ab0fe=_0x2ab0fe||0xcc;return function(_0x4df9f2){if(_0x4df9f2){return _0x3e5e7e['sendStatus'](_0x2ab0fe);}return _0x3e5e7e[_0x61f1('0x26')](_0x2ab0fe)[_0x61f1('0x27')]();};}function respondWithResult(_0x37690a,_0x2829af){_0x2829af=_0x2829af||0xc8;return function(_0x5b4995){if(_0x5b4995){return _0x37690a[_0x61f1('0x26')](_0x2829af)[_0x61f1('0x28')](_0x5b4995);}};}function respondWithFilteredResult(_0x35f8c1,_0x433278){return function(_0x599d42){if(_0x599d42){var _0x909ace=typeof _0x433278[_0x61f1('0x29')]===_0x61f1('0x2a')&&typeof _0x433278['limit']===_0x61f1('0x2a');var _0x145d1d=_0x599d42[_0x61f1('0x2b')];var _0x962616=_0x909ace?0x0:_0x433278[_0x61f1('0x29')];var _0x2f81c7=_0x909ace?_0x599d42[_0x61f1('0x2b')]:_0x433278['offset']+_0x433278[_0x61f1('0x2c')];var _0x11d57c;if(_0x2f81c7>=_0x145d1d){_0x2f81c7=_0x145d1d;_0x11d57c=0xc8;}else{_0x11d57c=0xce;}_0x35f8c1['status'](_0x11d57c);return _0x35f8c1['set'](_0x61f1('0x2d'),_0x962616+'-'+_0x2f81c7+'/'+_0x145d1d)[_0x61f1('0x28')](_0x599d42);}return null;};}function patchUpdates(_0x8b303a){return function(_0x11b778){try{jsonpatch[_0x61f1('0x2e')](_0x11b778,_0x8b303a,!![]);}catch(_0x47973e){return BPromise[_0x61f1('0x2f')](_0x47973e);}return _0x11b778[_0x61f1('0x30')]();};}function saveUpdates(_0x316903,_0x59fdfd){return function(_0x4afe26){if(_0x4afe26){return _0x4afe26[_0x61f1('0x31')](_0x316903)[_0x61f1('0x32')](function(_0x46f412){return _0x46f412;});}return null;};}function removeEntity(_0x56a031,_0x12c862){return function(_0x1ff6e6){if(_0x1ff6e6){return _0x1ff6e6['destroy']()[_0x61f1('0x32')](function(){_0x56a031[_0x61f1('0x26')](0xcc)[_0x61f1('0x27')]();});}};}function handleEntityNotFound(_0x4ea0ae,_0x424cd0){return function(_0x16263b){if(!_0x16263b){_0x4ea0ae[_0x61f1('0x33')](0x194);}return _0x16263b;};}function handleError(_0x5dd4f,_0x5ebae2){_0x5ebae2=_0x5ebae2||0x1f4;return function(_0x4f51fb){logger[_0x61f1('0x21')](_0x4f51fb[_0x61f1('0x34')]);if(_0x4f51fb['name']){delete _0x4f51fb['name'];}_0x5dd4f[_0x61f1('0x26')](_0x5ebae2)[_0x61f1('0x35')](_0x4f51fb);};}exports['index']=function(_0x4ec8fe,_0x16b19a){var _0x34548f={},_0x1fca0b={},_0x1624cc={'count':0x0,'rows':[]};var _0x497ffd=_[_0x61f1('0x36')](db[_0x61f1('0x37')][_0x61f1('0x38')],function(_0x134901){return{'name':_0x134901[_0x61f1('0x39')],'type':_0x134901[_0x61f1('0x3a')][_0x61f1('0x3b')]};});_0x1fca0b[_0x61f1('0x3c')]=_['map'](_0x497ffd,_0x61f1('0x3d'));_0x1fca0b['query']=_[_0x61f1('0x3e')](_0x4ec8fe[_0x61f1('0x3f')]);_0x1fca0b['filters']=_['intersection'](_0x1fca0b[_0x61f1('0x3c')],_0x1fca0b[_0x61f1('0x3f')]);_0x34548f[_0x61f1('0x40')]=_['intersection'](_0x1fca0b[_0x61f1('0x3c')],qs[_0x61f1('0x41')](_0x4ec8fe['query'][_0x61f1('0x41')]));_0x34548f['attributes']=_0x34548f[_0x61f1('0x40')][_0x61f1('0x42')]?_0x34548f[_0x61f1('0x40')]:_0x1fca0b[_0x61f1('0x3c')];if(!_0x4ec8fe['query'][_0x61f1('0x43')]('nolimit')){_0x34548f[_0x61f1('0x2c')]=qs[_0x61f1('0x2c')](_0x4ec8fe[_0x61f1('0x3f')][_0x61f1('0x2c')]);_0x34548f[_0x61f1('0x29')]=qs['offset'](_0x4ec8fe[_0x61f1('0x3f')]['offset']);}_0x34548f[_0x61f1('0x44')]=qs['sort'](_0x4ec8fe[_0x61f1('0x3f')][_0x61f1('0x45')]);_0x34548f[_0x61f1('0x46')]=qs[_0x61f1('0x47')](_[_0x61f1('0x48')](_0x4ec8fe[_0x61f1('0x3f')],_0x1fca0b[_0x61f1('0x47')]),_0x497ffd);if(_0x4ec8fe[_0x61f1('0x3f')]['filter']){_0x34548f[_0x61f1('0x46')]=_[_0x61f1('0x49')](_0x34548f[_0x61f1('0x46')],{'$or':_['map'](_0x497ffd,function(_0x1d9877){if(_0x1d9877[_0x61f1('0x3a')]!==_0x61f1('0x4a')){var _0x5a1a44={};_0x5a1a44[_0x1d9877[_0x61f1('0x3d')]]={'$like':'%'+_0x4ec8fe[_0x61f1('0x3f')][_0x61f1('0x4b')]+'%'};return _0x5a1a44;}})});}_0x34548f=_[_0x61f1('0x49')]({},_0x34548f,_0x4ec8fe['options']);var _0x2b23d0={'where':_0x34548f[_0x61f1('0x46')]};return db[_0x61f1('0x37')]['count'](_0x2b23d0)[_0x61f1('0x32')](function(_0x5bd502){_0x1624cc[_0x61f1('0x2b')]=_0x5bd502;if(_0x4ec8fe[_0x61f1('0x3f')][_0x61f1('0x4c')]){_0x34548f[_0x61f1('0x4d')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x61f1('0x4e')](_0x34548f);})[_0x61f1('0x32')](function(_0x2ff519){_0x1624cc[_0x61f1('0x4f')]=_0x2ff519;return _0x1624cc;})[_0x61f1('0x32')](respondWithFilteredResult(_0x16b19a,_0x34548f))['catch'](handleError(_0x16b19a,null));};exports['show']=function(_0x45c044,_0x5cd291){var _0x1c5187={'raw':!![],'where':{'id':_0x45c044[_0x61f1('0x50')]['id']}},_0xa45354={};_0xa45354[_0x61f1('0x3c')]=_[_0x61f1('0x3e')](db['WhatsappMessage'][_0x61f1('0x38')]);_0xa45354[_0x61f1('0x3f')]=_[_0x61f1('0x3e')](_0x45c044['query']);_0xa45354[_0x61f1('0x47')]=_[_0x61f1('0x51')](_0xa45354[_0x61f1('0x3c')],_0xa45354[_0x61f1('0x3f')]);_0x1c5187['attributes']=_[_0x61f1('0x51')](_0xa45354[_0x61f1('0x3c')],qs[_0x61f1('0x41')](_0x45c044['query'][_0x61f1('0x41')]));_0x1c5187[_0x61f1('0x40')]=_0x1c5187['attributes']['length']?_0x1c5187[_0x61f1('0x40')]:_0xa45354[_0x61f1('0x3c')];if(_0x45c044[_0x61f1('0x3f')][_0x61f1('0x4c')]){_0x1c5187[_0x61f1('0x4d')]=[{'all':!![]}];}_0x1c5187=_[_0x61f1('0x49')]({},_0x1c5187,_0x45c044['options']);return db['WhatsappMessage'][_0x61f1('0x52')](_0x1c5187)['then'](handleEntityNotFound(_0x5cd291,null))['then'](respondWithResult(_0x5cd291,null))[_0x61f1('0x25')](handleError(_0x5cd291,null));};exports[_0x61f1('0x53')]=function(_0x1a1cac,_0x1393c2){return db['WhatsappMessage'][_0x61f1('0x53')](_0x1a1cac[_0x61f1('0x54')],{})['then'](respondWithResult(_0x1393c2,0xc9))[_0x61f1('0x25')](handleError(_0x1393c2,null));};exports['update']=function(_0x51a829,_0x5a87a9){if(_0x51a829['body']['id']){delete _0x51a829[_0x61f1('0x54')]['id'];}return db['WhatsappMessage'][_0x61f1('0x52')]({'where':{'id':_0x51a829['params']['id']}})[_0x61f1('0x32')](handleEntityNotFound(_0x5a87a9,null))[_0x61f1('0x32')](saveUpdates(_0x51a829[_0x61f1('0x54')],null))[_0x61f1('0x32')](respondWithResult(_0x5a87a9,null))[_0x61f1('0x25')](handleError(_0x5a87a9,null));};exports[_0x61f1('0x55')]=function(_0x400235,_0x5b4b1d){return db[_0x61f1('0x37')][_0x61f1('0x52')]({'where':{'id':_0x400235[_0x61f1('0x50')]['id']}})[_0x61f1('0x32')](handleEntityNotFound(_0x5b4b1d,null))['then'](removeEntity(_0x5b4b1d,null))[_0x61f1('0x25')](handleError(_0x5b4b1d,null));};exports[_0x61f1('0x56')]=function(_0x51e600,_0x4bc880){return db[_0x61f1('0x37')][_0x61f1('0x56')]()[_0x61f1('0x32')](respondWithResult(_0x4bc880,null))[_0x61f1('0x25')](handleError(_0x4bc880,null));};var interaction_log=require(_0x61f1('0x10'))('whatsapp-interactions');exports['accept']=function(_0x5ae616,_0x2f67aa,_0x3d1c47){var _0x3f275c={'agent':{},'channel':_0x61f1('0x57')};if(_0x5ae616[_0x61f1('0x54')]['id']){delete _0x5ae616[_0x61f1('0x54')]['id'];}_0x5ae616[_0x61f1('0x54')]['read']=!![];_0x5ae616['body'][_0x61f1('0x58')]=moment()['format'](_0x61f1('0x59'));_0x5ae616[_0x61f1('0x54')][_0x61f1('0x5a')]=_0x5ae616['body'][_0x61f1('0x5a')]||_0x5ae616[_0x61f1('0x5b')]['id'];_0x3f275c[_0x61f1('0x5c')]['id']=_0x5ae616[_0x61f1('0x54')][_0x61f1('0x5a')];return db[_0x61f1('0x37')][_0x61f1('0x52')]({'where':{'id':_0x5ae616['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f67aa,null))[_0x61f1('0x32')](saveUpdates(_0x5ae616[_0x61f1('0x54')],null))[_0x61f1('0x32')](function(_0x45b299){if(_0x45b299){_0x3f275c[_0x61f1('0x22')]=_0x45b299[_0x61f1('0x5d')]({'plain':!![]});return db[_0x61f1('0x5e')][_0x61f1('0x52')]({'where':{'id':_0x45b299[_0x61f1('0x5f')]}});}return null;})[_0x61f1('0x32')](handleEntityNotFound(_0x2f67aa,null))['then'](function(_0x107c04){if(_0x107c04){return _0x107c04[_0x61f1('0x31')]({'UserId':_0x5ae616[_0x61f1('0x54')]['UserId'],'read1stAt':_[_0x61f1('0x60')](_0x107c04[_0x61f1('0x61')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x61f1('0x32')](function(_0x2ff6ad){if(_0x2ff6ad){_0x3f275c[_0x61f1('0x62')]=_0x2ff6ad['get']({'plain':!![]});interaction_log[_0x61f1('0x23')](_0x61f1('0x63'),_0x5ae616['user']['id'],_0x5ae616[_0x61f1('0x5b')][_0x61f1('0x3d')],_0x5ae616[_0x61f1('0x5b')][_0x61f1('0x64')],_0x3f275c['interaction']['id'],_0x5ae616[_0x61f1('0x54')]?JSON[_0x61f1('0x20')](_0x5ae616[_0x61f1('0x54')]):_0x61f1('0x65'));return respondWithRpcPromise(_0x61f1('0x66'),_0x61f1('0x67'),_0x3f275c);}return null;})[_0x61f1('0x32')](function(_0x2de864){var _0x321212=_0x61f1('0x68')+_0x2de864[_0x61f1('0x22')]['ContactId'];return db[_0x61f1('0x69')][_0x61f1('0x3f')](_0x321212,{'type':db[_0x61f1('0x6a')][_0x61f1('0x6b')][_0x61f1('0x6c')],'raw':!![]})[_0x61f1('0x32')](function(_0x2bad9d){return _0x2bad9d;});})[_0x61f1('0x32')](function(_0x40e49a){if(_0x40e49a){_0x3f275c[_0x61f1('0x22')][_0x61f1('0x6d')]=_0x40e49a[0x0];if(!_0x5ae616['body']['UserId'])return;return db['User'][_0x61f1('0x52')]({'where':{'id':_0x5ae616['body'][_0x61f1('0x5a')],'role':_0x61f1('0x5c')},'attributes':['id','name','fullname','email',_0x61f1('0x6e')],'raw':!![]});}return null;})[_0x61f1('0x32')](function(_0x440986){if(!_0x440986)return null;_0x3f275c[_0x61f1('0x22')]['agent']=_0x440986;return _0x3f275c;})[_0x61f1('0x32')](function(_0x4e0df1){if(_0x4e0df1){if(_0x5ae616[_0x61f1('0x54')][_0x61f1('0x6f')]){_0x3f275c[_0x61f1('0x22')][_0x61f1('0x70')]=util[_0x61f1('0x71')](_0x61f1('0x72'),_0x5ae616[_0x61f1('0x5b')][_0x61f1('0x3d')]);_0x3f275c[_0x61f1('0x22')][_0x61f1('0x73')]=_0x3f275c['channel'];_0x3f275c[_0x61f1('0x22')][_0x61f1('0x74')]=_0x3f275c[_0x61f1('0x73')];_0x3f275c[_0x61f1('0x22')]['event']=_0x61f1('0x75');return respondWithRpcPromise(_0x61f1('0x76'),_0x61f1('0x76'),{'event':_0x61f1('0x77'),'message':_0x3f275c[_0x61f1('0x22')]},client9002)[_0x61f1('0x32')](function(){return _0x3f275c;});}return _0x3f275c;}return null;})[_0x61f1('0x32')](respondWithResult(_0x2f67aa,null))[_0x61f1('0x25')](handleError(_0x2f67aa,null));};var interaction_log=require(_0x61f1('0x10'))(_0x61f1('0x78'));exports[_0x61f1('0x2f')]=function(_0x5e71f4,_0x100bb2,_0x5ad9b9){var _0x2dadf6={'agent':{},'channel':_0x61f1('0x57')};if(_0x5e71f4[_0x61f1('0x54')]['id']){delete _0x5e71f4[_0x61f1('0x54')]['id'];}_0x5e71f4[_0x61f1('0x54')][_0x61f1('0x5a')]=_0x5e71f4[_0x61f1('0x54')][_0x61f1('0x5a')]||_0x5e71f4[_0x61f1('0x5b')]['id'];_0x2dadf6[_0x61f1('0x5c')]['id']=_0x5e71f4[_0x61f1('0x54')][_0x61f1('0x5a')];return db['WhatsappMessage'][_0x61f1('0x52')]({'where':{'id':_0x5e71f4[_0x61f1('0x50')]['id'],'UserId':null}})[_0x61f1('0x32')](handleEntityNotFound(_0x100bb2,null))[_0x61f1('0x32')](function(_0x2f81b2){if(_0x2f81b2){_0x2dadf6['message']=_0x2f81b2['get']({'plain':!![]});return db[_0x61f1('0x5e')][_0x61f1('0x52')]({'where':{'id':_0x2f81b2[_0x61f1('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x100bb2,null))[_0x61f1('0x32')](function(_0x103d9f){if(_0x103d9f){_0x2dadf6['interaction']=_0x103d9f['get']({'plain':!![]});interaction_log['info'](_0x61f1('0x79'),_0x5e71f4[_0x61f1('0x5b')]['id'],_0x5e71f4[_0x61f1('0x5b')]['name'],_0x5e71f4[_0x61f1('0x5b')]['role'],_0x2dadf6[_0x61f1('0x62')]['id'],_0x5e71f4['body']?JSON[_0x61f1('0x20')](_0x5e71f4[_0x61f1('0x54')]):_0x61f1('0x65'));return respondWithRpcPromise(_0x61f1('0x7a'),_0x61f1('0x7b'),_0x2dadf6);}return null;})['then'](function(_0x2d792e){var _0x5267bd=_0x61f1('0x68')+_0x2d792e['message'][_0x61f1('0x7c')];return db[_0x61f1('0x69')]['query'](_0x5267bd,{'type':db[_0x61f1('0x6a')][_0x61f1('0x6b')][_0x61f1('0x6c')],'raw':!![]})[_0x61f1('0x32')](function(_0x136990){return _0x136990;});})[_0x61f1('0x32')](function(_0x3c54f5){if(_0x3c54f5){_0x2dadf6[_0x61f1('0x22')]['contact']=_0x3c54f5[0x0];if(!_0x5e71f4['body'][_0x61f1('0x5a')])return;return db[_0x61f1('0x7d')][_0x61f1('0x52')]({'where':{'id':_0x5e71f4[_0x61f1('0x54')][_0x61f1('0x5a')],'role':_0x61f1('0x5c')},'attributes':['id',_0x61f1('0x3d'),_0x61f1('0x7e'),_0x61f1('0x7f'),_0x61f1('0x6e')],'raw':!![]});}return null;})['then'](function(_0x4f5775){if(!_0x4f5775)return null;_0x2dadf6['message'][_0x61f1('0x5c')]=_0x4f5775;return _0x2dadf6;})[_0x61f1('0x32')](function(_0x1a1f45){if(_0x1a1f45){_0x1a1f45[_0x61f1('0x22')][_0x61f1('0x70')]=util[_0x61f1('0x71')]('SIP/%s',_0x5e71f4[_0x61f1('0x5b')]['name']);_0x1a1f45[_0x61f1('0x22')]['channel']=_0x2dadf6[_0x61f1('0x73')];_0x1a1f45[_0x61f1('0x22')]['motionChannel']=_0x2dadf6[_0x61f1('0x73')];_0x1a1f45[_0x61f1('0x22')][_0x61f1('0x80')]=_0x61f1('0x2f');respondWithRpcPromise('EventManager',_0x61f1('0x76'),{'event':_0x61f1('0x81'),'message':_0x1a1f45[_0x61f1('0x22')]},client9002);return _0x2dadf6;}return null;})[_0x61f1('0x32')](respondWithResult(_0x100bb2,null))['catch'](handleError(_0x100bb2,null));};exports[_0x61f1('0x26')]=function(_0x12d8ab,_0x44599f,_0x517a12){if(_0x12d8ab[_0x61f1('0x54')]['id']){delete _0x12d8ab[_0x61f1('0x54')]['id'];}var _0x242e58;return db[_0x61f1('0x37')]['find']({'where':{'id':_0x12d8ab['params']['id']}})[_0x61f1('0x32')](handleEntityNotFound(_0x44599f,null))[_0x61f1('0x32')](function(_0x4746e2){if(_0x4746e2){_0x242e58=_0x4746e2;return db[_0x61f1('0x82')][_0x61f1('0x52')]({'where':{'id':_0x4746e2[_0x61f1('0x83')]}});}})[_0x61f1('0x32')](handleEntityNotFound(_0x44599f,null))[_0x61f1('0x32')](function(_0x442f32){if(_0x442f32){logger[_0x61f1('0x1f')](_0x61f1('0x84'),_0x61f1('0x26'),_0x61f1('0x85'),_0x442f32[_0x61f1('0x3a')],util[_0x61f1('0x86')](_0x12d8ab[_0x61f1('0x54')],{'showHidden':![],'depth':null}));switch(_0x442f32[_0x61f1('0x3a')]){case _0x61f1('0x87'):if(_0x12d8ab[_0x61f1('0x54')][_0x61f1('0x88')]&&_0x12d8ab[_0x61f1('0x54')][_0x61f1('0x88')]===_0x242e58['messageId']&&_0x12d8ab[_0x61f1('0x54')][_0x61f1('0x89')]&&_0x12d8ab[_0x61f1('0x54')][_0x61f1('0x89')]==='read'){return _0x242e58[_0x61f1('0x31')]({'read':!![]});}else{logger[_0x61f1('0x21')](_0x61f1('0x8a'),_0x61f1('0x26'),'twilio',util[_0x61f1('0x86')](_0x12d8ab[_0x61f1('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x242e58;}})[_0x61f1('0x32')](respondWithResult(_0x44599f,null))['catch'](handleError(_0x44599f,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 955bc62..687b371 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 _0x58a4=['emit','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1be82f,_0x1816dc){var _0x1a742b=function(_0x1aec5b){while(--_0x1aec5b){_0x1be82f['push'](_0x1be82f['shift']());}};_0x1a742b(++_0x1816dc);}(_0x58a4,0xbf));var _0x458a=function(_0xac8055,_0x5ababb){_0xac8055=_0xac8055-0x0;var _0x2d5608=_0x58a4[_0xac8055];return _0x2d5608;};'use strict';var EventEmitter=require(_0x458a('0x0'));var WhatsappMessage=require(_0x458a('0x1'))['db'][_0x458a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x458a('0x3')](0x0);var events={'afterCreate':_0x458a('0x4'),'afterUpdate':_0x458a('0x5'),'afterDestroy':_0x458a('0x6')};function emitEvent(_0xacd5b3){return function(_0x362079,_0x1b4d2e,_0x2fde72){WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3+':'+_0x362079['id'],_0x362079);WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3,_0x362079);_0x2fde72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x458a('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xcf66=['exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0x129dd8,_0x5faf82){var _0x7cd150=function(_0x4515e7){while(--_0x4515e7){_0x129dd8['push'](_0x129dd8['shift']());}};_0x7cd150(++_0x5faf82);}(_0xcf66,0x71));var _0x6cf6=function(_0x7d53ba,_0x1fd7de){_0x7d53ba=_0x7d53ba-0x0;var _0x5e1533=_0xcf66[_0x7d53ba];return _0x5e1533;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var WhatsappMessage=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6cf6('0x3'),'afterUpdate':_0x6cf6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e16eb){return function(_0x1c599d,_0x45d0d8,_0x57f22f){WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb+':'+_0x1c599d['id'],_0x1c599d);WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb,_0x1c599d);_0x57f22f(null);};}for(var e in events){if(events[_0x6cf6('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x6cf6('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index e57854c..ea3a824 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 _0x3b31=['models','get','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','direction','catch','error','WhatsappAccount','find','then','type','twilio','authToken','phone','accountSid','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId'];(function(_0x5b705e,_0x11bcd8){var _0x20eea7=function(_0xa5d725){while(--_0xa5d725){_0x5b705e['push'](_0x5b705e['shift']());}};_0x20eea7(++_0x11bcd8);}(_0x3b31,0x9c));var _0x13b3=function(_0x36fd38,_0xfe6384){_0x36fd38=_0x36fd38-0x0;var _0xf24b75=_0x3b31[_0x36fd38];return _0xf24b75;};'use strict';var _=require('lodash');var util=require(_0x13b3('0x0'));var logger=require(_0x13b3('0x1'))(_0x13b3('0x2'));var moment=require('moment');var BPromise=require(_0x13b3('0x3'));var rp=require('request-promise');var fetch=require(_0x13b3('0x4'));var fs=require('fs');var path=require(_0x13b3('0x5'));var rimraf=require(_0x13b3('0x6'));var config=require(_0x13b3('0x7'));var attributes=require(_0x13b3('0x8'));module['exports']=function(_0x5bfa43,_0x641da7){return _0x5bfa43[_0x13b3('0x9')]('WhatsappMessage',attributes,{'tableName':_0x13b3('0xa'),'paranoid':![],'indexes':[{'name':_0x13b3('0xb'),'fields':[_0x13b3('0xb')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ef4fd,_0x22e125,_0x257ec0){var _0x4c806b=_0x5bfa43[_0x13b3('0xc')];var _0x4b5688=_0x1ef4fd[_0x13b3('0xd')]({'plain':!![]});if(_0x4b5688['direction'][_0x13b3('0xe')]()==='in'||_0x4b5688['direction'][_0x13b3('0xe')]()===_0x13b3('0xf')&&!_0x4b5688[_0x13b3('0x10')]&&!_[_0x13b3('0x11')](_0x4b5688[_0x13b3('0x12')])){_0x4c806b[_0x13b3('0x13')][_0x13b3('0x14')]({'where':{'id':_0x4b5688[_0x13b3('0x15')]}})['then'](function(_0x16d9a0){if(_0x16d9a0){_0x16d9a0[_0x13b3('0x16')]({'lastMsgAt':_0x4b5688[_0x13b3('0x17')],'lastMsgDirection':_0x4b5688[_0x13b3('0x18')][_0x13b3('0xe')]()});}})[_0x13b3('0x19')](function(_0x168895){console[_0x13b3('0x1a')](_0x168895);});}if(_0x4b5688[_0x13b3('0x18')]===_0x13b3('0xf')&&!_0x4b5688['secret']){var _0x328a16;_0x4c806b[_0x13b3('0x1b')][_0x13b3('0x1c')]({'where':{'id':_0x4b5688['WhatsappAccountId']},'raw':!![]})[_0x13b3('0x1d')](function(_0x3e8f80){_0x328a16=_0x3e8f80;if(_0x328a16&&_0x328a16[_0x13b3('0x1e')]){switch(_0x328a16[_0x13b3('0x1e')]){case _0x13b3('0x1f'):var _0x5173fe=require(_0x13b3('0x1f'));if(_0x328a16['accountSid']&&_0x328a16[_0x13b3('0x20')]&&_0x328a16[_0x13b3('0x21')]){var _0x5578dc=new _0x5173fe(_0x328a16[_0x13b3('0x22')],_0x328a16[_0x13b3('0x20')]);_0x5578dc[_0x13b3('0x23')][_0x13b3('0x24')]({'body':_0x4b5688[_0x13b3('0x25')],'to':'whatsapp:'+_0x4b5688[_0x13b3('0x21')],'from':_0x13b3('0x26')+_0x328a16['phone'],'statusCallback':_0x328a16[_0x13b3('0x27')]+_0x13b3('0x28')+_0x4b5688['id']+_0x13b3('0x29')+_0x328a16[_0x13b3('0x2a')]})['then'](function(_0x591a77){if(_0x591a77[_0x13b3('0x2b')]){return _0x1ef4fd['update']({'messageId':_0x591a77['sid']});}})[_0x13b3('0x19')](function(_0x19e702){logger[_0x13b3('0x1a')](_0x13b3('0x2c'),_0x13b3('0x2d'),_0x13b3('0x1f'),util['inspect'](_0x19e702,{'showHidden':![],'depth':null}));});}else{logger[_0x13b3('0x1a')](_0x13b3('0x2c'),_0x13b3('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4ff17d=_0x328a16[_0x13b3('0x22')];var _0x23d339=_0x328a16[_0x13b3('0x20')];var _0xd38cfa=_0x328a16['baseUrl']+_0x13b3('0x2e')+_0x4ff17d+'/messages/';var _0x7f1838={'to':[_0x4b5688[_0x13b3('0x21')]],'message':{'type':_0x13b3('0x2f'),'text':_0x4b5688[_0x13b3('0x25')]}};var _0x53fb1e={'method':_0x13b3('0x30'),'uri':_0xd38cfa,'headers':{'Authorization':_0x13b3('0x31')+_0x23d339,'Content-Type':_0x13b3('0x32')},'body':_0x7f1838,'json':!![]};rp(_0x53fb1e)[_0x13b3('0x1d')](function(_0x2870a7){if(_0x2870a7[_0x13b3('0x33')][0x0][_0x13b3('0x34')]){return _0x1ef4fd[_0x13b3('0x16')]({'messageId':_0x2870a7[_0x13b3('0x33')][0x0][_0x13b3('0x34')]});}})[_0x13b3('0x19')](function(_0x3f65f6){logger[_0x13b3('0x35')](_0x13b3('0x36'),_0x3f65f6);});break;}}})['finally'](function(){_0x257ec0();});}else{_0x257ec0();}}},'charset':'utf8mb4','collate':_0x13b3('0x37')});}; \ No newline at end of file +var _0xb8ec=['direction','secret','UserId','findOne','WhatsappInteractionId','update','createdAt','catch','error','out','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','statuses','message_id','finally','utf8mb4','lodash','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','toLowerCase'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb8ec,0x98));var _0xcb8e=function(_0x86aef4,_0x123dbd){_0x86aef4=_0x86aef4-0x0;var _0x51ea18=_0xb8ec[_0x86aef4];return _0x51ea18;};'use strict';var _=require(_0xcb8e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb8e('0x1'));var moment=require(_0xcb8e('0x2'));var BPromise=require(_0xcb8e('0x3'));var rp=require(_0xcb8e('0x4'));var fetch=require(_0xcb8e('0x5'));var fs=require('fs');var path=require(_0xcb8e('0x6'));var rimraf=require(_0xcb8e('0x7'));var config=require(_0xcb8e('0x8'));var attributes=require(_0xcb8e('0x9'));module[_0xcb8e('0xa')]=function(_0x4b8f45,_0x35b1ea){return _0x4b8f45['define'](_0xcb8e('0xb'),attributes,{'tableName':_0xcb8e('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xcb8e('0xd')]},{'name':_0xcb8e('0xe'),'fields':[_0xcb8e('0xf')],'type':_0xcb8e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x83d289,_0x18f235,_0x39844d){var _0x2c135d=_0x4b8f45['models'];var _0x25f5dd=_0x83d289[_0xcb8e('0x11')]({'plain':!![]});if(_0x25f5dd['direction'][_0xcb8e('0x12')]()==='in'||_0x25f5dd[_0xcb8e('0x13')][_0xcb8e('0x12')]()==='out'&&!_0x25f5dd[_0xcb8e('0x14')]&&!_['isNil'](_0x25f5dd[_0xcb8e('0x15')])){_0x2c135d['WhatsappInteraction'][_0xcb8e('0x16')]({'where':{'id':_0x25f5dd[_0xcb8e('0x17')]}})['then'](function(_0xcf4805){if(_0xcf4805){_0xcf4805[_0xcb8e('0x18')]({'lastMsgAt':_0x25f5dd[_0xcb8e('0x19')],'lastMsgDirection':_0x25f5dd[_0xcb8e('0x13')]['toLowerCase']()});}})[_0xcb8e('0x1a')](function(_0x4f3325){console[_0xcb8e('0x1b')](_0x4f3325);});}if(_0x25f5dd[_0xcb8e('0x13')]===_0xcb8e('0x1c')&&!_0x25f5dd['secret']){var _0x4662b5;_0x2c135d['WhatsappAccount'][_0xcb8e('0x1d')]({'where':{'id':_0x25f5dd[_0xcb8e('0x1e')]},'raw':!![]})[_0xcb8e('0x1f')](function(_0x36c1cf){_0x4662b5=_0x36c1cf;if(_0x4662b5&&_0x4662b5[_0xcb8e('0x20')]){switch(_0x4662b5['type']){case _0xcb8e('0x21'):var _0x488287=require('twilio');if(_0x4662b5[_0xcb8e('0x22')]&&_0x4662b5[_0xcb8e('0x23')]&&_0x4662b5[_0xcb8e('0x24')]){var _0x5316f9=new _0x488287(_0x4662b5['accountSid'],_0x4662b5[_0xcb8e('0x23')]);_0x5316f9[_0xcb8e('0x25')][_0xcb8e('0x26')]({'body':_0x25f5dd[_0xcb8e('0xf')],'to':_0xcb8e('0x27')+_0x25f5dd['phone'],'from':_0xcb8e('0x27')+_0x4662b5[_0xcb8e('0x24')],'statusCallback':_0x4662b5['remote']+_0xcb8e('0x28')+_0x25f5dd['id']+'/status?token='+_0x4662b5[_0xcb8e('0x29')]})[_0xcb8e('0x1f')](function(_0x243402){if(_0x243402[_0xcb8e('0x2a')]){return _0x83d289['update']({'messageId':_0x243402['sid']});}})[_0xcb8e('0x1a')](function(_0x4a5173){logger[_0xcb8e('0x1b')](_0xcb8e('0x2b'),_0xcb8e('0x2c'),'twilio',util[_0xcb8e('0x2d')](_0x4a5173,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcb8e('0x21'),_0xcb8e('0x2e'));}break;case _0xcb8e('0x2f'):var _0x532608=_0x4662b5[_0xcb8e('0x22')];var _0x41fe61=_0x4662b5[_0xcb8e('0x23')];var _0x2fced8=_0x4662b5[_0xcb8e('0x30')]+_0xcb8e('0x31')+_0x532608+_0xcb8e('0x32');var _0x19dd35={'to':[_0x25f5dd[_0xcb8e('0x24')]],'message':{'type':'text','text':_0x25f5dd[_0xcb8e('0xf')]}};var _0xdd1b9a={'method':_0xcb8e('0x33'),'uri':_0x2fced8,'headers':{'Authorization':'Bearer\x20'+_0x41fe61,'Content-Type':_0xcb8e('0x34')},'body':_0x19dd35,'json':!![]};rp(_0xdd1b9a)[_0xcb8e('0x1f')](function(_0x129c78){if(_0x129c78[_0xcb8e('0x35')][0x0][_0xcb8e('0x36')]){return _0x83d289['update']({'messageId':_0x129c78[_0xcb8e('0x35')][0x0]['message_id']});}})['catch'](function(_0x30fea9){logger['err']('WhatsappMessage,\x20%s',_0x30fea9);});break;}}})[_0xcb8e('0x37')](function(){_0x39844d();});}else{_0x39844d();}}},'charset':_0xcb8e('0x38'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 8248ff0..a386ebe 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 _0x0b66=['client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','create','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b66,0x182));var _0x60b6=function(_0x4c3957,_0x51a17c){_0x4c3957=_0x4c3957-0x0;var _0x9671f9=_0x0b66[_0x4c3957];return _0x9671f9;};'use strict';var _=require(_0x60b6('0x0'));var util=require('util');var moment=require(_0x60b6('0x1'));var BPromise=require(_0x60b6('0x2'));var rs=require(_0x60b6('0x3'));var fs=require('fs');var Redis=require(_0x60b6('0x4'));var db=require(_0x60b6('0x5'))['db'];var utils=require(_0x60b6('0x6'));var logger=require(_0x60b6('0x7'))(_0x60b6('0x8'));var config=require(_0x60b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x60b6('0xa')][_0x60b6('0xb')]({'port':0x232a});config[_0x60b6('0xc')]=_[_0x60b6('0xd')](config[_0x60b6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x60b6('0xe'))(new Redis(config[_0x60b6('0xc')]));require(_0x60b6('0xf'))[_0x60b6('0x10')](socket);function respondWithRpcPromise(_0x13fe44,_0x599b7d,_0x7ef6fe){return new BPromise(function(_0x58c33a,_0x48aebc){return client[_0x60b6('0x11')](_0x13fe44,_0x7ef6fe)[_0x60b6('0x12')](function(_0x4123b2){logger[_0x60b6('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x60b6('0x14'));logger['debug'](_0x60b6('0x15'),_0x599b7d,_0x60b6('0x14'),JSON['stringify'](_0x4123b2));if(_0x4123b2[_0x60b6('0x16')]){if(_0x4123b2['error'][_0x60b6('0x17')]===0x1f4){logger[_0x60b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x4123b2[_0x60b6('0x16')][_0x60b6('0x18')]);return _0x48aebc(_0x4123b2['error'][_0x60b6('0x18')]);}logger[_0x60b6('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x599b7d,_0x4123b2['error']['message']);return _0x58c33a(_0x4123b2['error'][_0x60b6('0x18')]);}else{logger[_0x60b6('0x13')](_0x60b6('0x19'),_0x599b7d,_0x60b6('0x14'));_0x58c33a(_0x4123b2[_0x60b6('0x1a')]['message']);}})[_0x60b6('0x1b')](function(_0x120d91){logger['error'](_0x60b6('0x19'),_0x599b7d,_0x120d91);_0x48aebc(_0x120d91);});});}exports[_0x60b6('0x1c')]=function(_0x2b8ba2){var _0x34ee53=this;return new Promise(function(_0x4eecb6,_0x354a1d){return db['WhatsappMessage'][_0x60b6('0x1d')](_0x2b8ba2[_0x60b6('0x1e')],{'raw':_0x2b8ba2['options']?_0x2b8ba2[_0x60b6('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x587a5c){logger[_0x60b6('0x13')](_0x60b6('0x1c'),_0x2b8ba2);logger['debug'](_0x60b6('0x1c'),_0x2b8ba2,JSON[_0x60b6('0x20')](_0x587a5c));_0x4eecb6(_0x587a5c);})[_0x60b6('0x1b')](function(_0x9a3968){logger[_0x60b6('0x16')](_0x60b6('0x1c'),_0x9a3968[_0x60b6('0x18')],_0x2b8ba2);_0x354a1d(_0x34ee53[_0x60b6('0x16')](0x1f4,_0x9a3968['message']));});});}; \ No newline at end of file +var _0x7709=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','./whatsappMessage.socket'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7709,0x199));var _0x9770=function(_0x336b51,_0x361cad){_0x336b51=_0x336b51-0x0;var _0x316388=_0x7709[_0x336b51];return _0x316388;};'use strict';var _=require(_0x9770('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9770('0x1'));var rs=require(_0x9770('0x2'));var fs=require('fs');var Redis=require(_0x9770('0x3'));var db=require(_0x9770('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9770('0x5'))('rpc');var config=require(_0x9770('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9770('0x7')]['http']({'port':0x232a});config[_0x9770('0x8')]=_[_0x9770('0x9')](config[_0x9770('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9770('0xa'))[_0x9770('0xb')](socket);function respondWithRpcPromise(_0x59f360,_0x3ce6e2,_0x571eb7){return new BPromise(function(_0x1b658c,_0x474614){return client[_0x9770('0xc')](_0x59f360,_0x571eb7)[_0x9770('0xd')](function(_0x34d1c1){logger[_0x9770('0xe')](_0x9770('0xf'),_0x3ce6e2,_0x9770('0x10'));logger[_0x9770('0x11')](_0x9770('0x12'),_0x3ce6e2,_0x9770('0x10'),JSON[_0x9770('0x13')](_0x34d1c1));if(_0x34d1c1[_0x9770('0x14')]){if(_0x34d1c1['error'][_0x9770('0x15')]===0x1f4){logger[_0x9770('0x14')](_0x9770('0xf'),_0x3ce6e2,_0x34d1c1['error'][_0x9770('0x16')]);return _0x474614(_0x34d1c1[_0x9770('0x14')][_0x9770('0x16')]);}logger[_0x9770('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x3ce6e2,_0x34d1c1[_0x9770('0x14')][_0x9770('0x16')]);return _0x1b658c(_0x34d1c1[_0x9770('0x14')][_0x9770('0x16')]);}else{logger['info'](_0x9770('0xf'),_0x3ce6e2,_0x9770('0x10'));_0x1b658c(_0x34d1c1[_0x9770('0x17')][_0x9770('0x16')]);}})[_0x9770('0x18')](function(_0x1d1502){logger[_0x9770('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x3ce6e2,_0x1d1502);_0x474614(_0x1d1502);});});}exports[_0x9770('0x19')]=function(_0x100c2b){var _0x36d875=this;return new Promise(function(_0x4dc19d,_0x17d217){return db[_0x9770('0x1a')]['create'](_0x100c2b[_0x9770('0x1b')],{'raw':_0x100c2b[_0x9770('0x1c')]?_0x100c2b[_0x9770('0x1c')][_0x9770('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x186972){logger[_0x9770('0xe')](_0x9770('0x19'),_0x100c2b);logger[_0x9770('0x11')]('CreateWhatsappMessage',_0x100c2b,JSON[_0x9770('0x13')](_0x186972));_0x4dc19d(_0x186972);})[_0x9770('0x18')](function(_0x30d88b){logger['error'](_0x9770('0x19'),_0x30d88b[_0x9770('0x16')],_0x100c2b);_0x17d217(_0x36d875[_0x9770('0x14')](0x1f4,_0x30d88b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 28882b1..ea0a143 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 _0xb068=['remove','update','removeListener','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb068,0x7c));var _0x8b06=function(_0x38423a,_0x4735b8){_0x38423a=_0x38423a-0x0;var _0x3491d3=_0xb068[_0x38423a];return _0x3491d3;};'use strict';var WhatsappMessageEvents=require(_0x8b06('0x0'));var events=[_0x8b06('0x1'),_0x8b06('0x2'),_0x8b06('0x3')];function createListener(_0x49dbec,_0xe284fb){return function(_0x308a5a){_0xe284fb['emit'](_0x49dbec,_0x308a5a);};}function removeListener(_0x48038e,_0x50ecbd){return function(){WhatsappMessageEvents[_0x8b06('0x4')](_0x48038e,_0x50ecbd);};}exports['register']=function(_0x27f23d){for(var _0x5a52ca=0x0,_0x19e339=events[_0x8b06('0x5')];_0x5a52ca<_0x19e339;_0x5a52ca++){var _0x256fc3=events[_0x5a52ca];var _0x72fb13=createListener(_0x8b06('0x6')+_0x256fc3,_0x27f23d);WhatsappMessageEvents['on'](_0x256fc3,_0x72fb13);}}; \ No newline at end of file +var _0x157a=['whatsappMessage:','save','remove','update','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x157a,0x17b));var _0xa157=function(_0x1c5adf,_0x12a026){_0x1c5adf=_0x1c5adf-0x0;var _0x3dd9c2=_0x157a[_0x1c5adf];return _0x3dd9c2;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xa157('0x0'),_0xa157('0x1'),_0xa157('0x2')];function createListener(_0x7bf612,_0x4da183){return function(_0x25772e){_0x4da183['emit'](_0x7bf612,_0x25772e);};}function removeListener(_0x5d9cf2,_0x211683){return function(){WhatsappMessageEvents['removeListener'](_0x5d9cf2,_0x211683);};}exports[_0xa157('0x3')]=function(_0x5eca7e){for(var _0x328a13=0x0,_0x237e44=events[_0xa157('0x4')];_0x328a13<_0x237e44;_0x328a13++){var _0x3abc83=events[_0x328a13];var _0x3e0ef6=createListener(_0xa157('0x5')+_0x3abc83,_0x5eca7e);WhatsappMessageEvents['on'](_0x3abc83,_0x3e0ef6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 2664033..4f28e84 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 _0xa186=['show','/:id/members','getMembers','get','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3ce555,_0x5b1f36){var _0x5a014c=function(_0x4fc95d){while(--_0x4fc95d){_0x3ce555['push'](_0x3ce555['shift']());}};_0x5a014c(++_0x5b1f36);}(_0xa186,0x8d));var _0x6a18=function(_0x57c9ae,_0x3d66a0){_0x57c9ae=_0x57c9ae-0x0;var _0x35b78b=_0xa186[_0x57c9ae];return _0x35b78b;};'use strict';var multer=require(_0x6a18('0x0'));var util=require(_0x6a18('0x1'));var path=require(_0x6a18('0x2'));var timeout=require(_0x6a18('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a18('0x4'));var auth=require(_0x6a18('0x5'));var interaction=require(_0x6a18('0x6'));var config=require(_0x6a18('0x7'));var controller=require(_0x6a18('0x8'));router['get']('/',auth[_0x6a18('0x9')](),controller[_0x6a18('0xa')]);router['get'](_0x6a18('0xb'),auth[_0x6a18('0x9')](),controller[_0x6a18('0xc')]);router['get'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0xe')]);router['get'](_0x6a18('0xf'),auth['isAuthenticated'](),controller[_0x6a18('0x10')]);router[_0x6a18('0x11')](_0x6a18('0x12'),auth['isAuthenticated'](),controller[_0x6a18('0x13')]);router[_0x6a18('0x11')](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x15')]);router[_0x6a18('0x16')]('/',auth['isAuthenticated'](),controller[_0x6a18('0x17')]);router[_0x6a18('0x16')](_0x6a18('0x12'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x18')]);router[_0x6a18('0x16')](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x19')]);router['put'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1a')]);router['delete'](_0x6a18('0xd'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1b')]);router['delete'](_0x6a18('0x12'),auth['isAuthenticated'](),controller[_0x6a18('0x1c')]);router['delete'](_0x6a18('0x14'),auth[_0x6a18('0x9')](),controller[_0x6a18('0x1d')]);module[_0x6a18('0x1e')]=router; \ No newline at end of file +var _0xde4b=['getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id','update','destroy','delete','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','describe','get','show','/:id/members','getMembers','/:id/teams'];(function(_0x4f976d,_0xf7193e){var _0x5adc5e=function(_0x468b44){while(--_0x468b44){_0x4f976d['push'](_0x4f976d['shift']());}};_0x5adc5e(++_0xf7193e);}(_0xde4b,0x1a3));var _0xbde4=function(_0x15cfa2,_0x23b1e1){_0x15cfa2=_0x15cfa2-0x0;var _0x2b04f2=_0xde4b[_0x15cfa2];return _0x2b04f2;};'use strict';var multer=require('multer');var util=require(_0xbde4('0x0'));var path=require(_0xbde4('0x1'));var timeout=require(_0xbde4('0x2'));var express=require(_0xbde4('0x3'));var router=express[_0xbde4('0x4')]();var fs_extra=require(_0xbde4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbde4('0x6'));var controller=require(_0xbde4('0x7'));router['get']('/',auth[_0xbde4('0x8')](),controller[_0xbde4('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbde4('0xa')]);router[_0xbde4('0xb')]('/:id',auth[_0xbde4('0x8')](),controller[_0xbde4('0xc')]);router[_0xbde4('0xb')](_0xbde4('0xd'),auth[_0xbde4('0x8')](),controller[_0xbde4('0xe')]);router[_0xbde4('0xb')](_0xbde4('0xf'),auth['isAuthenticated'](),controller[_0xbde4('0x10')]);router[_0xbde4('0xb')](_0xbde4('0x11'),auth[_0xbde4('0x8')](),controller[_0xbde4('0x12')]);router[_0xbde4('0x13')]('/',auth[_0xbde4('0x8')](),controller[_0xbde4('0x14')]);router[_0xbde4('0x13')](_0xbde4('0xf'),auth['isAuthenticated'](),controller[_0xbde4('0x15')]);router[_0xbde4('0x13')]('/:id/users',auth[_0xbde4('0x8')](),controller['addAgents']);router[_0xbde4('0x16')](_0xbde4('0x17'),auth[_0xbde4('0x8')](),controller[_0xbde4('0x18')]);router['delete'](_0xbde4('0x17'),auth['isAuthenticated'](),controller[_0xbde4('0x19')]);router[_0xbde4('0x1a')](_0xbde4('0xf'),auth[_0xbde4('0x8')](),controller[_0xbde4('0x1b')]);router[_0xbde4('0x1a')]('/:id/users',auth[_0xbde4('0x8')](),controller[_0xbde4('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 8624bdf..ecb6868 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 _0x1120=['sequelize','exports','STRING','beepall','roundrobin'];(function(_0x2a1826,_0x27f029){var _0x58e5cf=function(_0x25fd51){while(--_0x25fd51){_0x2a1826['push'](_0x2a1826['shift']());}};_0x58e5cf(++_0x27f029);}(_0x1120,0x140));var _0x0112=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x1120[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x0112('0x0'));module[_0x0112('0x1')]={'name':{'type':Sequelize[_0x0112('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0112('0x3'),_0x0112('0x4'))},'description':{'type':Sequelize[_0x0112('0x2')]}}; \ No newline at end of file +var _0x3f19=['sequelize','INTEGER','rrmemory','beepall','roundrobin','STRING'];(function(_0x5e5565,_0x41ce6f){var _0x50825e=function(_0x22db29){while(--_0x22db29){_0x5e5565['push'](_0x5e5565['shift']());}};_0x50825e(++_0x41ce6f);}(_0x3f19,0xc0));var _0x93f1=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x3f19[_0x621bee];return _0x3076c8;};'use strict';var Sequelize=require(_0x93f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x93f1('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x93f1('0x2'),_0x93f1('0x3'),_0x93f1('0x4'))},'description':{'type':Sequelize[_0x93f1('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4336886..2384a61 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 _0x60b3=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','WhatsappQueues','end','error','stack','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','name','filter','options','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','findOrCreate','emit','ids','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','omit','spread','userWhatsappQueue:save','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x48d182,_0x21dfe8){var _0x8f0606=function(_0xaa0261){while(--_0xaa0261){_0x48d182['push'](_0x48d182['shift']());}};_0x8f0606(++_0x21dfe8);}(_0x60b3,0x83));var _0x360b=function(_0x5ae350,_0x24edc7){_0x5ae350=_0x5ae350-0x0;var _0x4e3073=_0x60b3[_0x5ae350];return _0x4e3073;};'use strict';var emlformat=require(_0x360b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x360b('0x1'));var jsonpatch=require(_0x360b('0x2'));var rp=require(_0x360b('0x3'));var moment=require('moment');var BPromise=require(_0x360b('0x4'));var Mustache=require(_0x360b('0x5'));var util=require('util');var path=require(_0x360b('0x6'));var sox=require(_0x360b('0x7'));var csv=require(_0x360b('0x8'));var ejs=require(_0x360b('0x9'));var fs=require('fs');var fs_extra=require(_0x360b('0xa'));var _=require(_0x360b('0xb'));var squel=require(_0x360b('0xc'));var crypto=require(_0x360b('0xd'));var jsforce=require(_0x360b('0xe'));var deskjs=require(_0x360b('0xf'));var toCsv=require(_0x360b('0x8'));var querystring=require('querystring');var Papa=require(_0x360b('0x10'));var Redis=require('ioredis');var authService=require(_0x360b('0x11'));var qs=require(_0x360b('0x12'));var as=require(_0x360b('0x13'));var hardwareService=require(_0x360b('0x14'));var logger=require(_0x360b('0x15'))(_0x360b('0x16'));var utils=require(_0x360b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x360b('0x18'));var db=require(_0x360b('0x19'))['db'];config['redis']=_[_0x360b('0x1a')](config['redis'],{'host':_0x360b('0x1b'),'port':0x18eb});var socket=require(_0x360b('0x1c'))(new Redis(config[_0x360b('0x1d')]));require(_0x360b('0x1e'))[_0x360b('0x1f')](socket);function respondWithStatusCode(_0xda42e4,_0x1a524a){_0x1a524a=_0x1a524a||0xcc;return function(_0x481375){if(_0x481375){return _0xda42e4[_0x360b('0x20')](_0x1a524a);}return _0xda42e4[_0x360b('0x21')](_0x1a524a)['end']();};}function respondWithResult(_0x41f63b,_0x551173){_0x551173=_0x551173||0xc8;return function(_0x29fd40){if(_0x29fd40){return _0x41f63b[_0x360b('0x21')](_0x551173)[_0x360b('0x22')](_0x29fd40);}};}function respondWithFilteredResult(_0x1b632d,_0x5022c0){return function(_0xea67b7){if(_0xea67b7){var _0x157a47=typeof _0x5022c0[_0x360b('0x23')]===_0x360b('0x24')&&typeof _0x5022c0['limit']===_0x360b('0x24');var _0x15bbee=_0xea67b7[_0x360b('0x25')];var _0x1e7714=_0x157a47?0x0:_0x5022c0[_0x360b('0x23')];var _0x416d3b=_0x157a47?_0xea67b7[_0x360b('0x25')]:_0x5022c0[_0x360b('0x23')]+_0x5022c0[_0x360b('0x26')];var _0x11ce1d;if(_0x416d3b>=_0x15bbee){_0x416d3b=_0x15bbee;_0x11ce1d=0xc8;}else{_0x11ce1d=0xce;}_0x1b632d[_0x360b('0x21')](_0x11ce1d);return _0x1b632d[_0x360b('0x27')](_0x360b('0x28'),_0x1e7714+'-'+_0x416d3b+'/'+_0x15bbee)['json'](_0xea67b7);}return null;};}function patchUpdates(_0x5035c1){return function(_0x41be5f){try{jsonpatch[_0x360b('0x29')](_0x41be5f,_0x5035c1,!![]);}catch(_0x501c26){return BPromise['reject'](_0x501c26);}return _0x41be5f[_0x360b('0x2a')]();};}function saveUpdates(_0x41c449,_0x4f9d10){return function(_0x23ff4b){if(_0x23ff4b){return _0x23ff4b[_0x360b('0x2b')](_0x41c449)[_0x360b('0x2c')](function(_0x3ef698){return _0x3ef698;});}return null;};}function removeEntity(_0x5a517b,_0x39e7a1){return function(_0x57d4f4){if(_0x57d4f4){return _0x57d4f4[_0x360b('0x2d')]()[_0x360b('0x2c')](function(){var _0x350a94=_0x57d4f4['get']({'plain':!![]});var _0x297336=_0x360b('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x297336,'resourceId':_0x350a94['id']}})['then'](function(){return _0x57d4f4;});})[_0x360b('0x2c')](function(){_0x5a517b[_0x360b('0x21')](0xcc)[_0x360b('0x2f')]();});}};}function handleEntityNotFound(_0x32dd9e,_0x325e88){return function(_0x7e96f1){if(!_0x7e96f1){_0x32dd9e[_0x360b('0x20')](0x194);}return _0x7e96f1;};}function handleError(_0x2408ea,_0x3ba5cf){_0x3ba5cf=_0x3ba5cf||0x1f4;return function(_0x3dbef0){logger[_0x360b('0x30')](_0x3dbef0[_0x360b('0x31')]);if(_0x3dbef0['name']){delete _0x3dbef0['name'];}_0x2408ea[_0x360b('0x21')](_0x3ba5cf)[_0x360b('0x32')](_0x3dbef0);};}exports[_0x360b('0x33')]=function(_0x39c364,_0x4edd1d){var _0x2c96f5={},_0x87fd4d={},_0x305530={'count':0x0,'rows':[]};var _0x2e17c6=_['map'](db[_0x360b('0x34')][_0x360b('0x35')],function(_0x313fe6){return{'name':_0x313fe6[_0x360b('0x36')],'type':_0x313fe6[_0x360b('0x37')][_0x360b('0x38')]};});_0x87fd4d[_0x360b('0x39')]=_[_0x360b('0x3a')](_0x2e17c6,'name');_0x87fd4d[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x39c364[_0x360b('0x3b')]);_0x87fd4d[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x87fd4d['model'],_0x87fd4d[_0x360b('0x3b')]);_0x2c96f5['attributes']=_[_0x360b('0x3e')](_0x87fd4d[_0x360b('0x39')],qs[_0x360b('0x3f')](_0x39c364[_0x360b('0x3b')][_0x360b('0x3f')]));_0x2c96f5['attributes']=_0x2c96f5[_0x360b('0x40')][_0x360b('0x41')]?_0x2c96f5[_0x360b('0x40')]:_0x87fd4d[_0x360b('0x39')];if(!_0x39c364[_0x360b('0x3b')][_0x360b('0x42')]('nolimit')){_0x2c96f5['limit']=qs[_0x360b('0x26')](_0x39c364[_0x360b('0x3b')][_0x360b('0x26')]);_0x2c96f5[_0x360b('0x23')]=qs[_0x360b('0x23')](_0x39c364['query'][_0x360b('0x23')]);}_0x2c96f5[_0x360b('0x43')]=qs['sort'](_0x39c364[_0x360b('0x3b')][_0x360b('0x44')]);_0x2c96f5[_0x360b('0x45')]=qs[_0x360b('0x3d')](_[_0x360b('0x46')](_0x39c364['query'],_0x87fd4d[_0x360b('0x3d')]),_0x2e17c6);if(_0x39c364[_0x360b('0x3b')]['filter']){_0x2c96f5[_0x360b('0x45')]=_[_0x360b('0x47')](_0x2c96f5[_0x360b('0x45')],{'$or':_[_0x360b('0x3a')](_0x2e17c6,function(_0x3b7dfe){if(_0x3b7dfe[_0x360b('0x37')]!==_0x360b('0x48')){var _0x19e8ce={};_0x19e8ce[_0x3b7dfe[_0x360b('0x49')]]={'$like':'%'+_0x39c364[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x19e8ce;}})});}_0x2c96f5=_[_0x360b('0x47')]({},_0x2c96f5,_0x39c364[_0x360b('0x4b')]);var _0x1bad18={'where':_0x2c96f5[_0x360b('0x45')]};return db[_0x360b('0x34')]['count'](_0x1bad18)[_0x360b('0x2c')](function(_0x46b80e){_0x305530[_0x360b('0x25')]=_0x46b80e;if(_0x39c364[_0x360b('0x3b')]['includeAll']){_0x2c96f5['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x360b('0x4c')](_0x2c96f5);})[_0x360b('0x2c')](function(_0x2d5f88){_0x305530[_0x360b('0x4d')]=_0x2d5f88;return _0x305530;})[_0x360b('0x2c')](respondWithFilteredResult(_0x4edd1d,_0x2c96f5))[_0x360b('0x4e')](handleError(_0x4edd1d,null));};exports[_0x360b('0x4f')]=function(_0x16fff1,_0x1e0697){var _0x5d4fd4={'raw':!![],'where':{'id':_0x16fff1['params']['id']}},_0x2f712f={};_0x2f712f[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x34')][_0x360b('0x35')]);_0x2f712f[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x16fff1[_0x360b('0x3b')]);_0x2f712f[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x2f712f[_0x360b('0x39')],_0x2f712f[_0x360b('0x3b')]);_0x5d4fd4['attributes']=_[_0x360b('0x3e')](_0x2f712f['model'],qs[_0x360b('0x3f')](_0x16fff1['query'][_0x360b('0x3f')]));_0x5d4fd4[_0x360b('0x40')]=_0x5d4fd4[_0x360b('0x40')][_0x360b('0x41')]?_0x5d4fd4[_0x360b('0x40')]:_0x2f712f[_0x360b('0x39')];if(_0x16fff1[_0x360b('0x3b')][_0x360b('0x50')]){_0x5d4fd4['include']=[{'all':!![]}];}_0x5d4fd4=_[_0x360b('0x47')]({},_0x5d4fd4,_0x16fff1[_0x360b('0x4b')]);return db[_0x360b('0x34')][_0x360b('0x51')](_0x5d4fd4)['then'](handleEntityNotFound(_0x1e0697,null))[_0x360b('0x2c')](respondWithResult(_0x1e0697,null))['catch'](handleError(_0x1e0697,null));};exports[_0x360b('0x52')]=function(_0x534c7b,_0x53a933){return db['WhatsappQueue'][_0x360b('0x52')](_0x534c7b[_0x360b('0x53')],{})[_0x360b('0x2c')](function(_0x4ca0d5){var _0x9f259b=_0x534c7b[_0x360b('0x54')]['get']({'plain':!![]});if(!_0x9f259b)throw new Error(_0x360b('0x55'));if(_0x9f259b[_0x360b('0x56')]===_0x360b('0x54')){var _0x9effb=_0x4ca0d5[_0x360b('0x57')]({'plain':!![]});var _0x14a0e6=_0x360b('0x2e');return db[_0x360b('0x58')][_0x360b('0x51')]({'where':{'name':_0x14a0e6,'userProfileId':_0x9f259b[_0x360b('0x59')]},'raw':!![]})[_0x360b('0x2c')](function(_0x37d3da){if(_0x37d3da&&_0x37d3da[_0x360b('0x5a')]===0x0){return db['UserProfileResource'][_0x360b('0x52')]({'name':_0x9effb[_0x360b('0x49')],'resourceId':_0x9effb['id'],'type':_0x37d3da[_0x360b('0x49')],'sectionId':_0x37d3da['id']},{})[_0x360b('0x2c')](function(){return _0x4ca0d5;});}else{return _0x4ca0d5;}})[_0x360b('0x4e')](function(_0x4eb15b){logger['error'](_0x360b('0x5b'),_0x4eb15b);throw _0x4eb15b;});}return _0x4ca0d5;})['then'](respondWithResult(_0x53a933,0xc9))['catch'](handleError(_0x53a933,null));};exports[_0x360b('0x2b')]=function(_0x45acab,_0x5f336a){if(_0x45acab['body']['id']){delete _0x45acab[_0x360b('0x53')]['id'];}return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x45acab[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x5f336a,null))[_0x360b('0x2c')](saveUpdates(_0x45acab[_0x360b('0x53')],null))['then'](respondWithResult(_0x5f336a,null))[_0x360b('0x4e')](handleError(_0x5f336a,null));};exports[_0x360b('0x2d')]=function(_0x29dc58,_0x502f9e){return db['WhatsappQueue'][_0x360b('0x51')]({'where':{'id':_0x29dc58[_0x360b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x502f9e,null))[_0x360b('0x2c')](removeEntity(_0x502f9e,null))[_0x360b('0x4e')](handleError(_0x502f9e,null));};exports[_0x360b('0x5d')]=function(_0x5dc908,_0x56f2e7){return db[_0x360b('0x34')][_0x360b('0x5d')]()[_0x360b('0x2c')](respondWithResult(_0x56f2e7,null))['catch'](handleError(_0x56f2e7,null));};exports[_0x360b('0x5e')]=function(_0x5650ef,_0x24394a,_0x514a89){var _0x29f624={'raw':!![],'where':{}},_0x5b8378={},_0xa85f4e;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0x5650ef[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x24394a,null))['then'](function(_0x5791bf){if(_0x5791bf){_0xa85f4e=_0x5791bf[_0x360b('0x57')]({'plain':!![]});_0x5b8378[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x60')][_0x360b('0x35')]);_0x5b8378[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0x5650ef['query']);_0x5b8378[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x5b8378[_0x360b('0x39')],_0x5b8378['query']);_0x29f624[_0x360b('0x40')]=_['intersection'](_0x5b8378[_0x360b('0x39')],qs[_0x360b('0x3f')](_0x5650ef[_0x360b('0x3b')][_0x360b('0x3f')]));_0x29f624[_0x360b('0x40')]=_0x29f624['attributes'][_0x360b('0x41')]?_0x29f624[_0x360b('0x40')]:_0x5b8378[_0x360b('0x39')];if(!_0x5650ef[_0x360b('0x3b')]['hasOwnProperty'](_0x360b('0x61'))){_0x29f624['limit']=qs[_0x360b('0x26')](_0x5650ef[_0x360b('0x3b')]['limit']);_0x29f624['offset']=qs[_0x360b('0x23')](_0x5650ef[_0x360b('0x3b')][_0x360b('0x23')]);}_0x29f624[_0x360b('0x43')]=qs['sort'](_0x5650ef[_0x360b('0x3b')][_0x360b('0x44')]);_0x29f624['where']=qs[_0x360b('0x3d')](_['pick'](_0x5650ef[_0x360b('0x3b')],_0x5b8378['filters']));_0x29f624[_0x360b('0x45')][_0x360b('0x62')]=_0x5791bf['id'];if(_0x5650ef[_0x360b('0x3b')]['filter']){_0x29f624['where']=_['merge'](_0x29f624['where'],{'$or':_[_0x360b('0x3a')](_0x29f624[_0x360b('0x40')],function(_0x42e269){var _0x433afa={};_0x433afa[_0x42e269]={'$like':'%'+_0x5650ef[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x433afa;})});}_0x29f624=_[_0x360b('0x47')]({},_0x29f624,_0x5650ef[_0x360b('0x4b')]);return db[_0x360b('0x60')][_0x360b('0x4c')](_0x29f624);}})[_0x360b('0x2c')](function(_0x851ad5){if(_0x851ad5){return db['User'][_0x360b('0x63')]({'where':{'id':_[_0x360b('0x3a')](_0x851ad5,_0x360b('0x64')),'role':_0x360b('0x65')},'attributes':['id',_0x360b('0x49'),_0x360b('0x66'),_0x360b('0x67'),_0x360b('0x68')]});}})[_0x360b('0x2c')](function(_0x522226){if(_0x522226){return{'count':_0x522226[_0x360b('0x25')],'rows':_[_0x360b('0x3a')](_0x522226[_0x360b('0x4d')],function(_0x2959f8){return{'membername':_0x2959f8[_0x360b('0x49')],'UserId':_0x2959f8['id'],'queue_name':_0xa85f4e[_0x360b('0x49')],'WhatsappQueueId':_0xa85f4e['id'],'interface':util[_0x360b('0x69')](_0x360b('0x6a'),_0x360b('0x6b'),_0x2959f8[_0x360b('0x49')]),'penalty':0x0,'paused':_0x2959f8['whatsappPause'],'createdAt':_0x2959f8[_0x360b('0x68')],'updatedAt':_0x2959f8[_0x360b('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x360b('0x2c')](respondWithFilteredResult(_0x24394a,_0x29f624))[_0x360b('0x4e')](handleError(_0x24394a,null));};exports[_0x360b('0x6c')]=function(_0xe0a7bd,_0x2d88e5,_0x39e30b){var _0x4df7bf={};var _0x4d0906={};var _0x3e0c12;var _0x39f07b;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0xe0a7bd[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x2d88e5,null))['then'](function(_0x33132c){if(_0x33132c){_0x3e0c12=_0x33132c;_0x4d0906[_0x360b('0x39')]=_[_0x360b('0x3c')](db[_0x360b('0x6d')][_0x360b('0x35')]);_0x4d0906[_0x360b('0x3b')]=_[_0x360b('0x3c')](_0xe0a7bd['query']);_0x4d0906[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x4d0906[_0x360b('0x39')],_0x4d0906['query']);_0x4df7bf[_0x360b('0x40')]=_['intersection'](_0x4d0906[_0x360b('0x39')],qs[_0x360b('0x3f')](_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x3f')]));_0x4df7bf[_0x360b('0x40')]=_0x4df7bf[_0x360b('0x40')]['length']?_0x4df7bf[_0x360b('0x40')]:_0x4d0906[_0x360b('0x39')];_0x4df7bf[_0x360b('0x43')]=qs[_0x360b('0x44')](_0xe0a7bd['query'][_0x360b('0x44')]);_0x4df7bf[_0x360b('0x45')]=qs[_0x360b('0x3d')](_['pick'](_0xe0a7bd[_0x360b('0x3b')],_0x4d0906[_0x360b('0x3d')]));if(_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x4a')]){_0x4df7bf[_0x360b('0x45')]=_[_0x360b('0x47')](_0x4df7bf['where'],{'$or':_[_0x360b('0x3a')](_0x4df7bf[_0x360b('0x40')],function(_0x48c51d){var _0x9a676f={};_0x9a676f[_0x48c51d]={'$like':'%'+_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x9a676f;})});}_0x4df7bf=_[_0x360b('0x47')]({},_0x4df7bf,_0xe0a7bd[_0x360b('0x4b')]);return _0x3e0c12[_0x360b('0x6c')](_0x4df7bf);}})[_0x360b('0x2c')](function(_0x35efc5){if(_0x35efc5){_0x39f07b=_0x35efc5[_0x360b('0x41')];if(!_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x42')](_0x360b('0x61'))){_0x4df7bf['limit']=qs[_0x360b('0x26')](_0xe0a7bd['query']['limit']);_0x4df7bf['offset']=qs['offset'](_0xe0a7bd[_0x360b('0x3b')][_0x360b('0x23')]);}return _0x3e0c12[_0x360b('0x6c')](_0x4df7bf);}})[_0x360b('0x2c')](function(_0x2a43d2){if(_0x2a43d2){return _0x2a43d2?{'count':_0x39f07b,'rows':_0x2a43d2}:null;}})[_0x360b('0x2c')](respondWithResult(_0x2d88e5,null))[_0x360b('0x4e')](handleError(_0x2d88e5,null));};exports[_0x360b('0x6e')]=function(_0x3e5b04,_0x43af68,_0x51a02b){var _0x35bc1a=_0x3e5b04['body']['ids'];return db[_0x360b('0x6d')][_0x360b('0x4c')]({'where':{'id':_0x35bc1a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x360b('0x6f'),'attributes':['id',_0x360b('0x49'),_0x360b('0x70'),'voicePause','interface'],'raw':!![]}]})[_0x360b('0x2c')](function(_0x547550){if(_0x547550){var _0x24ea2e=_[_0x360b('0x71')](_0x547550,function(_0x671c8c){var _0xa3cdef=_0x671c8c['get']({'plain':!![]});return _0xa3cdef['Agents'];});return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x3e5b04['params']['id']}})[_0x360b('0x2c')](function(_0x3e9516){return db[_0x360b('0x72')]['transaction'](function(_0x1ab3a6){return _0x3e9516['addTeams'](_0x35bc1a,{'transaction':_0x1ab3a6})['then'](function(){return BPromise[_0x360b('0x73')](_0x24ea2e,function(_0x240793){return db[_0x360b('0x60')][_0x360b('0x74')]({'where':{'UserId':_0x240793['id'],'WhatsappQueueId':_0x3e5b04[_0x360b('0x5c')]['id']},'transaction':_0x1ab3a6});});})[_0x360b('0x2c')](function(){_0x24ea2e['forEach'](function(_0x15995d){socket[_0x360b('0x75')]('userWhatsappQueue:save',{'UserId':_0x15995d['id'],'WhatsappQueueId':_0x3e9516['id']});});});});});}})[_0x360b('0x2c')](respondWithStatusCode(_0x43af68,null))[_0x360b('0x4e')](handleError(_0x43af68,null));};exports['removeTeams']=function(_0x373bd2,_0x351726,_0x52bf1c){return db[_0x360b('0x6d')][_0x360b('0x4c')]({'where':{'id':_0x373bd2[_0x360b('0x3b')][_0x360b('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x360b('0x2c')](handleEntityNotFound(_0x351726,null))[_0x360b('0x2c')](function(_0x1bfbf5){var _0x774039=_[_0x360b('0x3a')](_0x1bfbf5,'id');var _0x443edd=[];var _0x10a680=[];var _0x112fab=squel[_0x360b('0x77')]();_0x112fab[_0x360b('0x78')]('tq.TeamId')['from'](_0x360b('0x79'),'tq')[_0x360b('0x7a')](_0x360b('0x7b'),'ut',_0x360b('0x7c'))['where'](_0x360b('0x7d'),_0x373bd2[_0x360b('0x5c')]['id']);for(var _0x19155b=0x0;_0x19155b<_0x1bfbf5['length'];_0x19155b+=0x1){let _0x58b416=_0x1bfbf5[_0x19155b];for(var _0x18f948=0x0;_0x18f948<_0x58b416[_0x360b('0x6f')]['length'];_0x18f948+=0x1){let _0x5e5da8=_0x58b416[_0x360b('0x6f')][_0x18f948];var _0x24c650=_0x112fab['clone']();_0x24c650[_0x360b('0x45')](_0x360b('0x7e'),_0x5e5da8['id']);_0x10a680[_0x360b('0x7f')](db['sequelize'][_0x360b('0x3b')](_0x24c650[_0x360b('0x80')](),{'type':db['sequelize'][_0x360b('0x81')][_0x360b('0x82')]})['then'](function(_0x3dd127){if(_0x3dd127[_0x360b('0x41')]===0x1){return _0x5e5da8['id'];}else{var _0x1bd0bf=_['every'](_[_0x360b('0x3a')](_0x3dd127,_0x360b('0x83')),function(_0x44d723){return _[_0x360b('0x84')](_0x774039,_0x44d723);});if(_0x1bd0bf){return _0x5e5da8['id'];}}}));}}return BPromise[_0x360b('0x85')](_0x10a680)[_0x360b('0x2c')](function(_0x2ae36a){_0x443edd=_(_0x443edd)[_0x360b('0x86')](_0x2ae36a)['compact']()[_0x360b('0x87')]();return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x373bd2[_0x360b('0x5c')]['id']}})[_0x360b('0x2c')](function(_0x10aeb4){return db['sequelize'][_0x360b('0x88')](function(_0x1d2b10){return _0x10aeb4[_0x360b('0x89')](_0x373bd2[_0x360b('0x3b')][_0x360b('0x76')],{'transaction':_0x1d2b10})[_0x360b('0x2c')](function(){if(!_[_0x360b('0x8a')](_0x443edd)){return _0x10aeb4[_0x360b('0x8b')](_0x443edd,{'transaction':_0x1d2b10});}})[_0x360b('0x2c')](function(){_0x443edd[_0x360b('0x8c')](function(_0x46fdfa){socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':_0x46fdfa,'WhatsappQueueId':_0x10aeb4['id']});});});});});});})[_0x360b('0x2c')](respondWithStatusCode(_0x351726,null))[_0x360b('0x4e')](handleError(_0x351726,null));};exports['addAgents']=function(_0x2f0bfd,_0x1b00bb,_0x34349b){return db['WhatsappQueue'][_0x360b('0x51')]({'where':{'id':_0x2f0bfd['params']['id']}})['then'](handleEntityNotFound(_0x1b00bb,null))[_0x360b('0x2c')](function(_0x412d2a){if(_0x412d2a){return _0x412d2a['addAgents'](_0x2f0bfd['body'][_0x360b('0x76')],_[_0x360b('0x8e')](_0x2f0bfd['body'],['ids','id'])||{})[_0x360b('0x8f')](function(_0x3b0438){for(var _0xca1522=0x0;_0xca1522<_0x2f0bfd[_0x360b('0x53')][_0x360b('0x76')][_0x360b('0x41')];_0xca1522+=0x1){socket[_0x360b('0x75')](_0x360b('0x90'),{'UserId':Number(_0x2f0bfd[_0x360b('0x53')]['ids'][_0xca1522]),'WhatsappQueueId':Number(_0x2f0bfd['params']['id'])});}return _0x3b0438;});}})[_0x360b('0x2c')](respondWithResult(_0x1b00bb,null))[_0x360b('0x4e')](handleError(_0x1b00bb,null));};exports['removeAgents']=function(_0x6a393c,_0x3111d6,_0x573eb3){return db[_0x360b('0x34')][_0x360b('0x51')]({'where':{'id':_0x6a393c[_0x360b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3111d6,null))['then'](function(_0x1724a3){if(_0x1724a3){return _0x1724a3[_0x360b('0x8b')](_0x6a393c['query'][_0x360b('0x76')])[_0x360b('0x2c')](function(){if(_['isArray'](_0x6a393c[_0x360b('0x3b')][_0x360b('0x76')])){for(var _0x22ceac=0x0;_0x22ceac<_0x6a393c[_0x360b('0x3b')][_0x360b('0x76')][_0x360b('0x41')];_0x22ceac+=0x1){socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':Number(_0x6a393c[_0x360b('0x3b')]['ids'][_0x22ceac]),'WhatsappQueueId':Number(_0x6a393c['params']['id'])});}}else{socket[_0x360b('0x75')](_0x360b('0x8d'),{'UserId':Number(_0x6a393c['query'][_0x360b('0x76')]),'WhatsappQueueId':Number(_0x6a393c[_0x360b('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x3111d6,null))[_0x360b('0x4e')](handleError(_0x3111d6,null));};exports[_0x360b('0x91')]=function(_0xf99b68,_0x20797b,_0x1438e1){var _0x151e9f={};var _0x4a99bc={};var _0x4cb5b4;var _0x524c7a;return db[_0x360b('0x34')][_0x360b('0x5f')]({'where':{'id':_0xf99b68['params']['id']}})[_0x360b('0x2c')](handleEntityNotFound(_0x20797b,null))[_0x360b('0x2c')](function(_0x45021c){if(_0x45021c){_0x4cb5b4=_0x45021c;_0x4a99bc['model']=_[_0x360b('0x3c')](db[_0x360b('0x92')][_0x360b('0x35')]);_0x4a99bc[_0x360b('0x3b')]=_['keys'](_0xf99b68[_0x360b('0x3b')]);_0x4a99bc[_0x360b('0x3d')]=_[_0x360b('0x3e')](_0x4a99bc[_0x360b('0x39')],_0x4a99bc['query']);_0x151e9f[_0x360b('0x40')]=_[_0x360b('0x3e')](_0x4a99bc[_0x360b('0x39')],qs[_0x360b('0x3f')](_0xf99b68[_0x360b('0x3b')][_0x360b('0x3f')]));_0x151e9f['attributes']=_0x151e9f[_0x360b('0x40')][_0x360b('0x41')]?_0x151e9f['attributes']:_0x4a99bc[_0x360b('0x39')];_0x151e9f['order']=qs[_0x360b('0x44')](_0xf99b68['query'][_0x360b('0x44')]);_0x151e9f[_0x360b('0x45')]=qs[_0x360b('0x3d')](_[_0x360b('0x46')](_0xf99b68[_0x360b('0x3b')],_0x4a99bc[_0x360b('0x3d')]));if(_0xf99b68['query']['filter']){_0x151e9f[_0x360b('0x45')]=_[_0x360b('0x47')](_0x151e9f[_0x360b('0x45')],{'$or':_['map'](_0x151e9f['attributes'],function(_0x12baf1){var _0x2d449c={};_0x2d449c[_0x12baf1]={'$like':'%'+_0xf99b68[_0x360b('0x3b')][_0x360b('0x4a')]+'%'};return _0x2d449c;})});}_0x151e9f=_[_0x360b('0x47')]({},_0x151e9f,_0xf99b68['options']);return _0x4cb5b4[_0x360b('0x91')](_0x151e9f);}})[_0x360b('0x2c')](function(_0x225b75){if(_0x225b75){_0x524c7a=_0x225b75[_0x360b('0x41')];if(!_0xf99b68[_0x360b('0x3b')][_0x360b('0x42')](_0x360b('0x61'))){_0x151e9f[_0x360b('0x26')]=qs[_0x360b('0x26')](_0xf99b68[_0x360b('0x3b')]['limit']);_0x151e9f[_0x360b('0x23')]=qs[_0x360b('0x23')](_0xf99b68[_0x360b('0x3b')]['offset']);}return _0x4cb5b4[_0x360b('0x91')](_0x151e9f);}})['then'](function(_0xf2129){if(_0xf2129){return _0xf2129?{'count':_0x524c7a,'rows':_0xf2129}:null;}})[_0x360b('0x2c')](respondWithResult(_0x20797b,null))[_0x360b('0x4e')](handleError(_0x20797b,null));}; \ No newline at end of file +var _0xfd1d=['stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','pick','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','whatsappPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','sequelize','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','value','transaction','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource'];(function(_0x31bc95,_0x1aa45b){var _0x3373b0=function(_0x498db9){while(--_0x498db9){_0x31bc95['push'](_0x31bc95['shift']());}};_0x3373b0(++_0x1aa45b);}(_0xfd1d,0x170));var _0xdfd1=function(_0x58287d,_0x1c9ce4){_0x58287d=_0x58287d-0x0;var _0x575572=_0xfd1d[_0x58287d];return _0x575572;};'use strict';var emlformat=require(_0xdfd1('0x0'));var rimraf=require(_0xdfd1('0x1'));var zipdir=require(_0xdfd1('0x2'));var jsonpatch=require(_0xdfd1('0x3'));var rp=require(_0xdfd1('0x4'));var moment=require(_0xdfd1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdfd1('0x6'));var util=require(_0xdfd1('0x7'));var path=require('path');var sox=require(_0xdfd1('0x8'));var csv=require('to-csv');var ejs=require(_0xdfd1('0x9'));var fs=require('fs');var fs_extra=require(_0xdfd1('0xa'));var _=require(_0xdfd1('0xb'));var squel=require('squel');var crypto=require(_0xdfd1('0xc'));var jsforce=require(_0xdfd1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdfd1('0xe'));var querystring=require(_0xdfd1('0xf'));var Papa=require(_0xdfd1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfd1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfd1('0x12'));var logger=require(_0xdfd1('0x13'))(_0xdfd1('0x14'));var utils=require(_0xdfd1('0x15'));var config=require(_0xdfd1('0x16'));var licenseUtil=require(_0xdfd1('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdfd1('0x18')](config['redis'],{'host':_0xdfd1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xdfd1('0x1a')](socket);function respondWithStatusCode(_0x5889c8,_0x1464dd){_0x1464dd=_0x1464dd||0xcc;return function(_0x4e60e7){if(_0x4e60e7){return _0x5889c8[_0xdfd1('0x1b')](_0x1464dd);}return _0x5889c8[_0xdfd1('0x1c')](_0x1464dd)[_0xdfd1('0x1d')]();};}function respondWithResult(_0x659169,_0x3c9da0){_0x3c9da0=_0x3c9da0||0xc8;return function(_0x3a45cc){if(_0x3a45cc){return _0x659169[_0xdfd1('0x1c')](_0x3c9da0)[_0xdfd1('0x1e')](_0x3a45cc);}};}function respondWithFilteredResult(_0xd09b14,_0x3265df){return function(_0x3bfe48){if(_0x3bfe48){var _0x13306a=typeof _0x3265df['offset']===_0xdfd1('0x1f')&&typeof _0x3265df['limit']===_0xdfd1('0x1f');var _0x3b1cde=_0x3bfe48[_0xdfd1('0x20')];var _0x187158=_0x13306a?0x0:_0x3265df[_0xdfd1('0x21')];var _0x3b09f0=_0x13306a?_0x3bfe48['count']:_0x3265df[_0xdfd1('0x21')]+_0x3265df[_0xdfd1('0x22')];var _0x487c40;if(_0x3b09f0>=_0x3b1cde){_0x3b09f0=_0x3b1cde;_0x487c40=0xc8;}else{_0x487c40=0xce;}_0xd09b14['status'](_0x487c40);return _0xd09b14[_0xdfd1('0x23')](_0xdfd1('0x24'),_0x187158+'-'+_0x3b09f0+'/'+_0x3b1cde)['json'](_0x3bfe48);}return null;};}function patchUpdates(_0x40ddfc){return function(_0x3e01fb){try{jsonpatch[_0xdfd1('0x25')](_0x3e01fb,_0x40ddfc,!![]);}catch(_0x3c467a){return BPromise[_0xdfd1('0x26')](_0x3c467a);}return _0x3e01fb[_0xdfd1('0x27')]();};}function saveUpdates(_0x4e3ca7,_0x1070f8){return function(_0x43accd){if(_0x43accd){return _0x43accd[_0xdfd1('0x28')](_0x4e3ca7)['then'](function(_0x4d030b){return _0x4d030b;});}return null;};}function removeEntity(_0x5b10c4,_0x41e014){return function(_0x22266f){if(_0x22266f){return _0x22266f[_0xdfd1('0x29')]()[_0xdfd1('0x2a')](function(){var _0x276652=_0x22266f[_0xdfd1('0x2b')]({'plain':!![]});var _0x3d7ece=_0xdfd1('0x2c');return db[_0xdfd1('0x2d')]['destroy']({'where':{'type':_0x3d7ece,'resourceId':_0x276652['id']}})[_0xdfd1('0x2a')](function(){return _0x22266f;});})['then'](function(){_0x5b10c4['status'](0xcc)[_0xdfd1('0x1d')]();});}};}function handleEntityNotFound(_0x4d4f3d,_0x274799){return function(_0x467717){if(!_0x467717){_0x4d4f3d[_0xdfd1('0x1b')](0x194);}return _0x467717;};}function handleError(_0xb315f9,_0x2609c9){_0x2609c9=_0x2609c9||0x1f4;return function(_0x1e82b2){logger['error'](_0x1e82b2[_0xdfd1('0x2e')]);if(_0x1e82b2[_0xdfd1('0x2f')]){delete _0x1e82b2[_0xdfd1('0x2f')];}_0xb315f9[_0xdfd1('0x1c')](_0x2609c9)[_0xdfd1('0x30')](_0x1e82b2);};}exports[_0xdfd1('0x31')]=function(_0x376c11,_0xa39aee){var _0x11e216={},_0x120188={},_0x2b4df5={'count':0x0,'rows':[]};var _0x57d5ac=_[_0xdfd1('0x32')](db[_0xdfd1('0x33')]['rawAttributes'],function(_0x14bf36){return{'name':_0x14bf36[_0xdfd1('0x34')],'type':_0x14bf36[_0xdfd1('0x35')][_0xdfd1('0x36')]};});_0x120188[_0xdfd1('0x37')]=_['map'](_0x57d5ac,_0xdfd1('0x2f'));_0x120188[_0xdfd1('0x38')]=_[_0xdfd1('0x39')](_0x376c11[_0xdfd1('0x38')]);_0x120188[_0xdfd1('0x3a')]=_['intersection'](_0x120188[_0xdfd1('0x37')],_0x120188['query']);_0x11e216[_0xdfd1('0x3b')]=_[_0xdfd1('0x3c')](_0x120188[_0xdfd1('0x37')],qs['fields'](_0x376c11[_0xdfd1('0x38')]['fields']));_0x11e216[_0xdfd1('0x3b')]=_0x11e216['attributes'][_0xdfd1('0x3d')]?_0x11e216[_0xdfd1('0x3b')]:_0x120188[_0xdfd1('0x37')];if(!_0x376c11[_0xdfd1('0x38')][_0xdfd1('0x3e')](_0xdfd1('0x3f'))){_0x11e216['limit']=qs[_0xdfd1('0x22')](_0x376c11[_0xdfd1('0x38')][_0xdfd1('0x22')]);_0x11e216[_0xdfd1('0x21')]=qs['offset'](_0x376c11[_0xdfd1('0x38')]['offset']);}_0x11e216[_0xdfd1('0x40')]=qs[_0xdfd1('0x41')](_0x376c11['query']['sort']);_0x11e216[_0xdfd1('0x42')]=qs['filters'](_['pick'](_0x376c11[_0xdfd1('0x38')],_0x120188[_0xdfd1('0x3a')]),_0x57d5ac);if(_0x376c11[_0xdfd1('0x38')][_0xdfd1('0x43')]){_0x11e216[_0xdfd1('0x42')]=_['merge'](_0x11e216[_0xdfd1('0x42')],{'$or':_[_0xdfd1('0x32')](_0x57d5ac,function(_0x58ed1c){if(_0x58ed1c[_0xdfd1('0x35')]!==_0xdfd1('0x44')){var _0x173bf1={};_0x173bf1[_0x58ed1c[_0xdfd1('0x2f')]]={'$like':'%'+_0x376c11[_0xdfd1('0x38')][_0xdfd1('0x43')]+'%'};return _0x173bf1;}})});}_0x11e216=_[_0xdfd1('0x45')]({},_0x11e216,_0x376c11[_0xdfd1('0x46')]);var _0x253c11={'where':_0x11e216['where']};return db[_0xdfd1('0x33')][_0xdfd1('0x20')](_0x253c11)[_0xdfd1('0x2a')](function(_0x5e7308){_0x2b4df5['count']=_0x5e7308;if(_0x376c11['query'][_0xdfd1('0x47')]){_0x11e216[_0xdfd1('0x48')]=[{'all':!![]}];}return db[_0xdfd1('0x33')][_0xdfd1('0x49')](_0x11e216);})[_0xdfd1('0x2a')](function(_0x58672e){_0x2b4df5['rows']=_0x58672e;return _0x2b4df5;})[_0xdfd1('0x2a')](respondWithFilteredResult(_0xa39aee,_0x11e216))[_0xdfd1('0x4a')](handleError(_0xa39aee,null));};exports['show']=function(_0x39dbe5,_0x55308c){var _0x119864={'raw':!![],'where':{'id':_0x39dbe5[_0xdfd1('0x4b')]['id']}},_0x46575d={};_0x46575d[_0xdfd1('0x37')]=_[_0xdfd1('0x39')](db['WhatsappQueue'][_0xdfd1('0x4c')]);_0x46575d[_0xdfd1('0x38')]=_['keys'](_0x39dbe5[_0xdfd1('0x38')]);_0x46575d[_0xdfd1('0x3a')]=_[_0xdfd1('0x3c')](_0x46575d[_0xdfd1('0x37')],_0x46575d['query']);_0x119864[_0xdfd1('0x3b')]=_[_0xdfd1('0x3c')](_0x46575d['model'],qs[_0xdfd1('0x4d')](_0x39dbe5[_0xdfd1('0x38')]['fields']));_0x119864['attributes']=_0x119864[_0xdfd1('0x3b')][_0xdfd1('0x3d')]?_0x119864[_0xdfd1('0x3b')]:_0x46575d[_0xdfd1('0x37')];if(_0x39dbe5['query'][_0xdfd1('0x47')]){_0x119864[_0xdfd1('0x48')]=[{'all':!![]}];}_0x119864=_['merge']({},_0x119864,_0x39dbe5[_0xdfd1('0x46')]);return db[_0xdfd1('0x33')][_0xdfd1('0x4e')](_0x119864)[_0xdfd1('0x2a')](handleEntityNotFound(_0x55308c,null))[_0xdfd1('0x2a')](respondWithResult(_0x55308c,null))[_0xdfd1('0x4a')](handleError(_0x55308c,null));};exports[_0xdfd1('0x4f')]=function(_0x58f7d9,_0x416823){return db[_0xdfd1('0x33')][_0xdfd1('0x4f')](_0x58f7d9[_0xdfd1('0x50')],{})[_0xdfd1('0x2a')](function(_0x17d7b2){var _0x181f78=_0x58f7d9['user']['get']({'plain':!![]});if(!_0x181f78)throw new Error(_0xdfd1('0x51'));if(_0x181f78[_0xdfd1('0x52')]===_0xdfd1('0x53')){var _0x463e00=_0x17d7b2[_0xdfd1('0x2b')]({'plain':!![]});var _0x2e413a=_0xdfd1('0x2c');return db[_0xdfd1('0x54')]['find']({'where':{'name':_0x2e413a,'userProfileId':_0x181f78[_0xdfd1('0x55')]},'raw':!![]})[_0xdfd1('0x2a')](function(_0x3345c0){if(_0x3345c0&&_0x3345c0[_0xdfd1('0x56')]===0x0){return db['UserProfileResource'][_0xdfd1('0x4f')]({'name':_0x463e00[_0xdfd1('0x2f')],'resourceId':_0x463e00['id'],'type':_0x3345c0[_0xdfd1('0x2f')],'sectionId':_0x3345c0['id']},{})['then'](function(){return _0x17d7b2;});}else{return _0x17d7b2;}})[_0xdfd1('0x4a')](function(_0x237215){logger['error'](_0xdfd1('0x57'),_0x237215);throw _0x237215;});}return _0x17d7b2;})[_0xdfd1('0x2a')](respondWithResult(_0x416823,0xc9))[_0xdfd1('0x4a')](handleError(_0x416823,null));};exports[_0xdfd1('0x28')]=function(_0x5a656c,_0x3d487c){if(_0x5a656c['body']['id']){delete _0x5a656c[_0xdfd1('0x50')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x5a656c[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x3d487c,null))['then'](saveUpdates(_0x5a656c['body'],null))[_0xdfd1('0x2a')](respondWithResult(_0x3d487c,null))[_0xdfd1('0x4a')](handleError(_0x3d487c,null));};exports[_0xdfd1('0x29')]=function(_0x29e88b,_0x4ab8e2){return db[_0xdfd1('0x33')]['find']({'where':{'id':_0x29e88b[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x4ab8e2,null))['then'](removeEntity(_0x4ab8e2,null))[_0xdfd1('0x4a')](handleError(_0x4ab8e2,null));};exports[_0xdfd1('0x58')]=function(_0x2b4380,_0x500874){return db[_0xdfd1('0x33')]['describe']()[_0xdfd1('0x2a')](respondWithResult(_0x500874,null))[_0xdfd1('0x4a')](handleError(_0x500874,null));};exports['getMembers']=function(_0x2612d1,_0x5c38e7,_0x2078c5){var _0xaf2a9d={'raw':!![],'where':{}},_0x3affd8={},_0x1df0cd;return db[_0xdfd1('0x33')][_0xdfd1('0x59')]({'where':{'id':_0x2612d1[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x5c38e7,null))[_0xdfd1('0x2a')](function(_0x27d538){if(_0x27d538){_0x1df0cd=_0x27d538[_0xdfd1('0x2b')]({'plain':!![]});_0x3affd8[_0xdfd1('0x37')]=_[_0xdfd1('0x39')](db['UserWhatsappQueue']['rawAttributes']);_0x3affd8[_0xdfd1('0x38')]=_[_0xdfd1('0x39')](_0x2612d1[_0xdfd1('0x38')]);_0x3affd8[_0xdfd1('0x3a')]=_['intersection'](_0x3affd8[_0xdfd1('0x37')],_0x3affd8[_0xdfd1('0x38')]);_0xaf2a9d[_0xdfd1('0x3b')]=_['intersection'](_0x3affd8[_0xdfd1('0x37')],qs[_0xdfd1('0x4d')](_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x4d')]));_0xaf2a9d[_0xdfd1('0x3b')]=_0xaf2a9d['attributes'][_0xdfd1('0x3d')]?_0xaf2a9d['attributes']:_0x3affd8[_0xdfd1('0x37')];if(!_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x3e')](_0xdfd1('0x3f'))){_0xaf2a9d[_0xdfd1('0x22')]=qs[_0xdfd1('0x22')](_0x2612d1['query'][_0xdfd1('0x22')]);_0xaf2a9d[_0xdfd1('0x21')]=qs['offset'](_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x21')]);}_0xaf2a9d[_0xdfd1('0x40')]=qs['sort'](_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x41')]);_0xaf2a9d[_0xdfd1('0x42')]=qs[_0xdfd1('0x3a')](_[_0xdfd1('0x5a')](_0x2612d1[_0xdfd1('0x38')],_0x3affd8[_0xdfd1('0x3a')]));_0xaf2a9d[_0xdfd1('0x42')][_0xdfd1('0x5b')]=_0x27d538['id'];if(_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x43')]){_0xaf2a9d[_0xdfd1('0x42')]=_[_0xdfd1('0x45')](_0xaf2a9d['where'],{'$or':_[_0xdfd1('0x32')](_0xaf2a9d['attributes'],function(_0x4aa9d8){var _0x486191={};_0x486191[_0x4aa9d8]={'$like':'%'+_0x2612d1[_0xdfd1('0x38')][_0xdfd1('0x43')]+'%'};return _0x486191;})});}_0xaf2a9d=_[_0xdfd1('0x45')]({},_0xaf2a9d,_0x2612d1[_0xdfd1('0x46')]);return db[_0xdfd1('0x5c')][_0xdfd1('0x49')](_0xaf2a9d);}})[_0xdfd1('0x2a')](function(_0x933ad6){if(_0x933ad6){return db['User'][_0xdfd1('0x5d')]({'where':{'id':_['map'](_0x933ad6,_0xdfd1('0x5e')),'role':'agent'},'attributes':['id','name',_0xdfd1('0x5f'),_0xdfd1('0x60'),'createdAt']});}})[_0xdfd1('0x2a')](function(_0x8ad79){if(_0x8ad79){return{'count':_0x8ad79[_0xdfd1('0x20')],'rows':_[_0xdfd1('0x32')](_0x8ad79[_0xdfd1('0x61')],function(_0x440776){return{'membername':_0x440776['name'],'UserId':_0x440776['id'],'queue_name':_0x1df0cd['name'],'WhatsappQueueId':_0x1df0cd['id'],'interface':util[_0xdfd1('0x62')](_0xdfd1('0x63'),_0xdfd1('0x64'),_0x440776['name']),'penalty':0x0,'paused':_0x440776['whatsappPause'],'createdAt':_0x440776[_0xdfd1('0x65')],'updatedAt':_0x440776[_0xdfd1('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c38e7,_0xaf2a9d))[_0xdfd1('0x4a')](handleError(_0x5c38e7,null));};exports[_0xdfd1('0x66')]=function(_0x21b347,_0x5e5159,_0x413c5c){var _0x3449fc={};var _0x341f0={};var _0x4f7246;var _0x45bfdb;return db['WhatsappQueue'][_0xdfd1('0x59')]({'where':{'id':_0x21b347[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x5e5159,null))[_0xdfd1('0x2a')](function(_0x34e3b9){if(_0x34e3b9){_0x4f7246=_0x34e3b9;_0x341f0[_0xdfd1('0x37')]=_[_0xdfd1('0x39')](db[_0xdfd1('0x67')][_0xdfd1('0x4c')]);_0x341f0[_0xdfd1('0x38')]=_['keys'](_0x21b347[_0xdfd1('0x38')]);_0x341f0[_0xdfd1('0x3a')]=_[_0xdfd1('0x3c')](_0x341f0[_0xdfd1('0x37')],_0x341f0['query']);_0x3449fc[_0xdfd1('0x3b')]=_[_0xdfd1('0x3c')](_0x341f0['model'],qs[_0xdfd1('0x4d')](_0x21b347[_0xdfd1('0x38')][_0xdfd1('0x4d')]));_0x3449fc[_0xdfd1('0x3b')]=_0x3449fc[_0xdfd1('0x3b')]['length']?_0x3449fc[_0xdfd1('0x3b')]:_0x341f0[_0xdfd1('0x37')];_0x3449fc['order']=qs[_0xdfd1('0x41')](_0x21b347[_0xdfd1('0x38')]['sort']);_0x3449fc[_0xdfd1('0x42')]=qs[_0xdfd1('0x3a')](_[_0xdfd1('0x5a')](_0x21b347[_0xdfd1('0x38')],_0x341f0[_0xdfd1('0x3a')]));if(_0x21b347[_0xdfd1('0x38')][_0xdfd1('0x43')]){_0x3449fc[_0xdfd1('0x42')]=_['merge'](_0x3449fc[_0xdfd1('0x42')],{'$or':_['map'](_0x3449fc[_0xdfd1('0x3b')],function(_0x11ed18){var _0x341767={};_0x341767[_0x11ed18]={'$like':'%'+_0x21b347[_0xdfd1('0x38')]['filter']+'%'};return _0x341767;})});}_0x3449fc=_[_0xdfd1('0x45')]({},_0x3449fc,_0x21b347[_0xdfd1('0x46')]);return _0x4f7246[_0xdfd1('0x66')](_0x3449fc);}})[_0xdfd1('0x2a')](function(_0x257880){if(_0x257880){_0x45bfdb=_0x257880[_0xdfd1('0x3d')];if(!_0x21b347[_0xdfd1('0x38')][_0xdfd1('0x3e')]('nolimit')){_0x3449fc['limit']=qs[_0xdfd1('0x22')](_0x21b347[_0xdfd1('0x38')]['limit']);_0x3449fc['offset']=qs['offset'](_0x21b347[_0xdfd1('0x38')][_0xdfd1('0x21')]);}return _0x4f7246['getTeams'](_0x3449fc);}})[_0xdfd1('0x2a')](function(_0x11407c){if(_0x11407c){return _0x11407c?{'count':_0x45bfdb,'rows':_0x11407c}:null;}})[_0xdfd1('0x2a')](respondWithResult(_0x5e5159,null))['catch'](handleError(_0x5e5159,null));};exports[_0xdfd1('0x68')]=function(_0x3f6da2,_0x3dd841,_0x5c3d94){var _0x28e120=_0x3f6da2['body'][_0xdfd1('0x69')];return db['Team'][_0xdfd1('0x49')]({'where':{'id':_0x28e120},'attributes':['id'],'include':[{'model':db[_0xdfd1('0x6a')],'as':_0xdfd1('0x6b'),'attributes':['id','name','online',_0xdfd1('0x6c'),_0xdfd1('0x6d')],'raw':!![]}]})['then'](function(_0x4cfeb0){if(_0x4cfeb0){var _0x31a15c=_['flatMap'](_0x4cfeb0,function(_0x127f5b){var _0x40471d=_0x127f5b['get']({'plain':!![]});return _0x40471d[_0xdfd1('0x6b')];});return db['WhatsappQueue'][_0xdfd1('0x4e')]({'where':{'id':_0x3f6da2[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](function(_0x867703){return db[_0xdfd1('0x6e')]['transaction'](function(_0x33cbcc){return _0x867703['addTeams'](_0x28e120,{'transaction':_0x33cbcc})[_0xdfd1('0x2a')](function(){return BPromise['each'](_0x31a15c,function(_0x52c523){return db[_0xdfd1('0x5c')]['findOrCreate']({'where':{'UserId':_0x52c523['id'],'WhatsappQueueId':_0x3f6da2['params']['id']},'transaction':_0x33cbcc});});})[_0xdfd1('0x2a')](function(){_0x31a15c[_0xdfd1('0x6f')](function(_0x5a3a70){socket[_0xdfd1('0x70')](_0xdfd1('0x71'),{'UserId':_0x5a3a70['id'],'WhatsappQueueId':_0x867703['id']});});});});});}})[_0xdfd1('0x2a')](respondWithStatusCode(_0x3dd841,null))[_0xdfd1('0x4a')](handleError(_0x3dd841,null));};exports[_0xdfd1('0x72')]=function(_0xf6680a,_0x4d7842,_0x4bf682){return db['Team']['findAll']({'where':{'id':_0xf6680a[_0xdfd1('0x38')][_0xdfd1('0x69')]},'attributes':['id'],'include':[{'model':db[_0xdfd1('0x6a')],'as':_0xdfd1('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xdfd1('0x2a')](handleEntityNotFound(_0x4d7842,null))['then'](function(_0x14364f){var _0x4dbd99=_['map'](_0x14364f,'id');var _0x267ff5=[];var _0xb79298=[];var _0x332fc7=squel['select']();_0x332fc7[_0xdfd1('0x73')](_0xdfd1('0x74'))['from'](_0xdfd1('0x75'),'tq')[_0xdfd1('0x76')](_0xdfd1('0x77'),'ut',_0xdfd1('0x78'))[_0xdfd1('0x42')]('WhatsappQueueId\x20=\x20?',_0xf6680a[_0xdfd1('0x4b')]['id']);for(var _0x53ccf2=0x0;_0x53ccf2<_0x14364f[_0xdfd1('0x3d')];_0x53ccf2+=0x1){let _0x2692b1=_0x14364f[_0x53ccf2];for(var _0x5e09c5=0x0;_0x5e09c5<_0x2692b1['Agents'][_0xdfd1('0x3d')];_0x5e09c5+=0x1){let _0x29c8f0=_0x2692b1[_0xdfd1('0x6b')][_0x5e09c5];var _0x322096=_0x332fc7['clone']();_0x322096['where'](_0xdfd1('0x79'),_0x29c8f0['id']);_0xb79298[_0xdfd1('0x7a')](db[_0xdfd1('0x6e')]['query'](_0x322096[_0xdfd1('0x7b')](),{'type':db['sequelize'][_0xdfd1('0x7c')][_0xdfd1('0x7d')]})['then'](function(_0xd51888){if(_0xd51888[_0xdfd1('0x3d')]===0x1){return _0x29c8f0['id'];}else{var _0x433c89=_['every'](_['map'](_0xd51888,'TeamId'),function(_0x245847){return _[_0xdfd1('0x7e')](_0x4dbd99,_0x245847);});if(_0x433c89){return _0x29c8f0['id'];}}}));}}return BPromise[_0xdfd1('0x7f')](_0xb79298)[_0xdfd1('0x2a')](function(_0x243e3b){_0x267ff5=_(_0x267ff5)[_0xdfd1('0x80')](_0x243e3b)['compact']()[_0xdfd1('0x81')]();return db[_0xdfd1('0x33')]['find']({'where':{'id':_0xf6680a['params']['id']}})[_0xdfd1('0x2a')](function(_0x3463d6){return db[_0xdfd1('0x6e')][_0xdfd1('0x82')](function(_0x122308){return _0x3463d6[_0xdfd1('0x72')](_0xf6680a[_0xdfd1('0x38')]['ids'],{'transaction':_0x122308})[_0xdfd1('0x2a')](function(){if(!_['isEmpty'](_0x267ff5)){return _0x3463d6['removeAgents'](_0x267ff5,{'transaction':_0x122308});}})[_0xdfd1('0x2a')](function(){_0x267ff5[_0xdfd1('0x6f')](function(_0x1058d){socket[_0xdfd1('0x70')](_0xdfd1('0x83'),{'UserId':_0x1058d,'WhatsappQueueId':_0x3463d6['id']});});});});});});})[_0xdfd1('0x2a')](respondWithStatusCode(_0x4d7842,null))[_0xdfd1('0x4a')](handleError(_0x4d7842,null));};exports[_0xdfd1('0x84')]=function(_0x5b8acb,_0x34e99e,_0x1e1203){return db['WhatsappQueue'][_0xdfd1('0x4e')]({'where':{'id':_0x5b8acb[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x34e99e,null))[_0xdfd1('0x2a')](function(_0x5b76c1){if(_0x5b76c1){return _0x5b76c1['addAgents'](_0x5b8acb[_0xdfd1('0x50')][_0xdfd1('0x69')],_[_0xdfd1('0x85')](_0x5b8acb[_0xdfd1('0x50')],[_0xdfd1('0x69'),'id'])||{})[_0xdfd1('0x86')](function(_0x58186b){for(var _0x594c52=0x0;_0x594c52<_0x5b8acb[_0xdfd1('0x50')][_0xdfd1('0x69')][_0xdfd1('0x3d')];_0x594c52+=0x1){socket[_0xdfd1('0x70')](_0xdfd1('0x71'),{'UserId':Number(_0x5b8acb['body'][_0xdfd1('0x69')][_0x594c52]),'WhatsappQueueId':Number(_0x5b8acb['params']['id'])});}return _0x58186b;});}})[_0xdfd1('0x2a')](respondWithResult(_0x34e99e,null))['catch'](handleError(_0x34e99e,null));};exports['removeAgents']=function(_0x7088c7,_0x5efff1,_0x30ee4b){return db['WhatsappQueue'][_0xdfd1('0x4e')]({'where':{'id':_0x7088c7[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x5efff1,null))[_0xdfd1('0x2a')](function(_0x28c240){if(_0x28c240){return _0x28c240[_0xdfd1('0x87')](_0x7088c7['query'][_0xdfd1('0x69')])[_0xdfd1('0x2a')](function(){if(_[_0xdfd1('0x88')](_0x7088c7[_0xdfd1('0x38')]['ids'])){for(var _0x2d1da6=0x0;_0x2d1da6<_0x7088c7['query'][_0xdfd1('0x69')][_0xdfd1('0x3d')];_0x2d1da6+=0x1){socket[_0xdfd1('0x70')](_0xdfd1('0x83'),{'UserId':Number(_0x7088c7['query'][_0xdfd1('0x69')][_0x2d1da6]),'WhatsappQueueId':Number(_0x7088c7[_0xdfd1('0x4b')]['id'])});}}else{socket[_0xdfd1('0x70')](_0xdfd1('0x83'),{'UserId':Number(_0x7088c7['query'][_0xdfd1('0x69')]),'WhatsappQueueId':Number(_0x7088c7[_0xdfd1('0x4b')]['id'])});}});}})[_0xdfd1('0x2a')](respondWithStatusCode(_0x5efff1,null))[_0xdfd1('0x4a')](handleError(_0x5efff1,null));};exports[_0xdfd1('0x89')]=function(_0x4501d7,_0x15522b,_0x55abfc){var _0x3fbfb7={};var _0x1cabab={};var _0xed212a;var _0x3e0ae8;return db[_0xdfd1('0x33')][_0xdfd1('0x59')]({'where':{'id':_0x4501d7[_0xdfd1('0x4b')]['id']}})[_0xdfd1('0x2a')](handleEntityNotFound(_0x15522b,null))['then'](function(_0x2561ca){if(_0x2561ca){_0xed212a=_0x2561ca;_0x1cabab[_0xdfd1('0x37')]=_['keys'](db[_0xdfd1('0x6a')]['rawAttributes']);_0x1cabab[_0xdfd1('0x38')]=_[_0xdfd1('0x39')](_0x4501d7[_0xdfd1('0x38')]);_0x1cabab['filters']=_[_0xdfd1('0x3c')](_0x1cabab[_0xdfd1('0x37')],_0x1cabab[_0xdfd1('0x38')]);_0x3fbfb7['attributes']=_[_0xdfd1('0x3c')](_0x1cabab[_0xdfd1('0x37')],qs[_0xdfd1('0x4d')](_0x4501d7[_0xdfd1('0x38')][_0xdfd1('0x4d')]));_0x3fbfb7[_0xdfd1('0x3b')]=_0x3fbfb7['attributes'][_0xdfd1('0x3d')]?_0x3fbfb7['attributes']:_0x1cabab[_0xdfd1('0x37')];_0x3fbfb7['order']=qs[_0xdfd1('0x41')](_0x4501d7[_0xdfd1('0x38')][_0xdfd1('0x41')]);_0x3fbfb7[_0xdfd1('0x42')]=qs[_0xdfd1('0x3a')](_[_0xdfd1('0x5a')](_0x4501d7[_0xdfd1('0x38')],_0x1cabab[_0xdfd1('0x3a')]));if(_0x4501d7[_0xdfd1('0x38')][_0xdfd1('0x43')]){_0x3fbfb7[_0xdfd1('0x42')]=_['merge'](_0x3fbfb7['where'],{'$or':_[_0xdfd1('0x32')](_0x3fbfb7['attributes'],function(_0x2056a7){var _0x3d325a={};_0x3d325a[_0x2056a7]={'$like':'%'+_0x4501d7['query'][_0xdfd1('0x43')]+'%'};return _0x3d325a;})});}_0x3fbfb7=_[_0xdfd1('0x45')]({},_0x3fbfb7,_0x4501d7['options']);return _0xed212a[_0xdfd1('0x89')](_0x3fbfb7);}})[_0xdfd1('0x2a')](function(_0x2fff80){if(_0x2fff80){_0x3e0ae8=_0x2fff80[_0xdfd1('0x3d')];if(!_0x4501d7['query']['hasOwnProperty'](_0xdfd1('0x3f'))){_0x3fbfb7[_0xdfd1('0x22')]=qs[_0xdfd1('0x22')](_0x4501d7[_0xdfd1('0x38')][_0xdfd1('0x22')]);_0x3fbfb7[_0xdfd1('0x21')]=qs['offset'](_0x4501d7['query'][_0xdfd1('0x21')]);}return _0xed212a[_0xdfd1('0x89')](_0x3fbfb7);}})[_0xdfd1('0x2a')](function(_0x3b7cc4){if(_0x3b7cc4){return _0x3b7cc4?{'count':_0x3e0ae8,'rows':_0x3b7cc4}:null;}})[_0xdfd1('0x2a')](respondWithResult(_0x15522b,null))[_0xdfd1('0x4a')](handleError(_0x15522b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 4e4b733..3afe1a3 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 _0xf8c0=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3a6880,_0x4946dc){var _0x3ce6c9=function(_0x5e3589){while(--_0x5e3589){_0x3a6880['push'](_0x3a6880['shift']());}};_0x3ce6c9(++_0x4946dc);}(_0xf8c0,0xa4));var _0x0f8c=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xf8c0[_0x1e03a6];return _0x295b64;};'use strict';var EventEmitter=require(_0x0f8c('0x0'));var WhatsappQueue=require(_0x0f8c('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x0f8c('0x2')](0x0);var events={'afterCreate':_0x0f8c('0x3'),'afterUpdate':'update','afterDestroy':_0x0f8c('0x4')};function emitEvent(_0x25c480){return function(_0x1b7e0c,_0x36af2a,_0x1b2bfe){WhatsappQueueEvents[_0x0f8c('0x5')](_0x25c480+':'+_0x1b7e0c['id'],_0x1b7e0c);WhatsappQueueEvents[_0x0f8c('0x5')](_0x25c480,_0x1b7e0c);_0x1b2bfe(null);};}for(var e in events){if(events[_0x0f8c('0x6')](e)){var event=events[e];WhatsappQueue[_0x0f8c('0x7')](e,emitEvent(event));}}module[_0x0f8c('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x0247=['update','remove','emit','hasOwnProperty','WhatsappQueue','setMaxListeners','save'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0247,0xac));var _0x7024=function(_0x16c21c,_0x25e47d){_0x16c21c=_0x16c21c-0x0;var _0x53796f=_0x0247[_0x16c21c];return _0x53796f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x7024('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7024('0x1')](0x0);var events={'afterCreate':_0x7024('0x2'),'afterUpdate':_0x7024('0x3'),'afterDestroy':_0x7024('0x4')};function emitEvent(_0x328457){return function(_0x123a68,_0xd0c889,_0x31486c){WhatsappQueueEvents[_0x7024('0x5')](_0x328457+':'+_0x123a68['id'],_0x123a68);WhatsappQueueEvents[_0x7024('0x5')](_0x328457,_0x123a68);_0x31486c(null);};}for(var e in events){if(events[_0x7024('0x6')](e)){var event=events[e];WhatsappQueue['hook'](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 f5a5bca..e155b5e 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 _0x1562=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x1562,0xc3));var _0x2156=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x1562[_0x32b122];return _0x4ad25a;};'use strict';var _=require(_0x2156('0x0'));var util=require(_0x2156('0x1'));var logger=require('../../config/logger')(_0x2156('0x2'));var moment=require(_0x2156('0x3'));var BPromise=require(_0x2156('0x4'));var rp=require(_0x2156('0x5'));var fs=require('fs');var path=require(_0x2156('0x6'));var rimraf=require(_0x2156('0x7'));var config=require(_0x2156('0x8'));var attributes=require(_0x2156('0x9'));module[_0x2156('0xa')]=function(_0x5cce6e,_0x2d4cf6){return _0x5cce6e[_0x2156('0xb')]('WhatsappQueue',attributes,{'tableName':_0x2156('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b9b=['moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x5db8b1,_0x1f0db0){var _0xf78878=function(_0x59f5cb){while(--_0x59f5cb){_0x5db8b1['push'](_0x5db8b1['shift']());}};_0xf78878(++_0x1f0db0);}(_0x2b9b,0x14d));var _0xb2b9=function(_0x3db3fa,_0x2791fc){_0x3db3fa=_0x3db3fa-0x0;var _0x54f372=_0x2b9b[_0x3db3fa];return _0x54f372;};'use strict';var _=require(_0xb2b9('0x0'));var util=require('util');var logger=require(_0xb2b9('0x1'))(_0xb2b9('0x2'));var moment=require(_0xb2b9('0x3'));var BPromise=require(_0xb2b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b9('0x5'));var rimraf=require(_0xb2b9('0x6'));var config=require(_0xb2b9('0x7'));var attributes=require(_0xb2b9('0x8'));module[_0xb2b9('0x9')]=function(_0x522057,_0x5c040c){return _0x522057[_0xb2b9('0xa')]('WhatsappQueue',attributes,{'tableName':_0xb2b9('0xb'),'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 bb5aa3a..879180e 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 _0x9416=['ShowWhatsappQueue','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','model','map','catch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9416,0x173));var _0x6941=function(_0x5d604f,_0x264306){_0x5d604f=_0x5d604f-0x0;var _0x9857d0=_0x9416[_0x5d604f];return _0x9857d0;};'use strict';var _=require(_0x6941('0x0'));var util=require(_0x6941('0x1'));var moment=require('moment');var BPromise=require(_0x6941('0x2'));var rs=require(_0x6941('0x3'));var fs=require('fs');var Redis=require(_0x6941('0x4'));var db=require(_0x6941('0x5'))['db'];var utils=require(_0x6941('0x6'));var logger=require(_0x6941('0x7'))(_0x6941('0x8'));var config=require(_0x6941('0x9'));var jayson=require(_0x6941('0xa'));var client=jayson['client'][_0x6941('0xb')]({'port':0x232a});config[_0x6941('0xc')]=_[_0x6941('0xd')](config[_0x6941('0xc')],{'host':_0x6941('0xe'),'port':0x18eb});var socket=require(_0x6941('0xf'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x6941('0x10')](socket);function respondWithRpcPromise(_0x39a14b,_0x4730e0,_0x465731){return new BPromise(function(_0x5d90ba,_0x45a37a){return client[_0x6941('0x11')](_0x39a14b,_0x465731)[_0x6941('0x12')](function(_0x59501e){logger[_0x6941('0x13')](_0x6941('0x14'),_0x4730e0,_0x6941('0x15'));logger[_0x6941('0x16')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4730e0,_0x6941('0x15'),JSON[_0x6941('0x17')](_0x59501e));if(_0x59501e['error']){if(_0x59501e[_0x6941('0x18')][_0x6941('0x19')]===0x1f4){logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);return _0x45a37a(_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);}logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x59501e[_0x6941('0x18')][_0x6941('0x1a')]);return _0x5d90ba(_0x59501e['error'][_0x6941('0x1a')]);}else{logger['info'](_0x6941('0x14'),_0x4730e0,'request\x20sent');_0x5d90ba(_0x59501e[_0x6941('0x1b')][_0x6941('0x1a')]);}})['catch'](function(_0x1ef463){logger[_0x6941('0x18')](_0x6941('0x14'),_0x4730e0,_0x1ef463);_0x45a37a(_0x1ef463);});});}exports[_0x6941('0x1c')]=function(_0x42cf1a){var _0x5ac53a=this;return new Promise(function(_0x14ea6d,_0x66034d){return db[_0x6941('0x1d')][_0x6941('0x1e')]({'raw':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x20')]===undefined?!![]:![]:!![],'where':_0x42cf1a['options']?_0x42cf1a[_0x6941('0x1f')]['where']||null:null,'attributes':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a['options'][_0x6941('0x21')]||null:null,'limit':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x22')]||null:null,'include':_0x42cf1a[_0x6941('0x1f')]?_0x42cf1a[_0x6941('0x1f')][_0x6941('0x23')]?_['map'](_0x42cf1a['options'][_0x6941('0x23')],function(_0x5b32d9){return{'model':db[_0x5b32d9[_0x6941('0x24')]],'as':_0x5b32d9['as'],'attributes':_0x5b32d9['attributes'],'include':_0x5b32d9['include']?_[_0x6941('0x25')](_0x5b32d9[_0x6941('0x23')],function(_0x529370){return{'model':db[_0x529370[_0x6941('0x24')]],'as':_0x529370['as'],'attributes':_0x529370[_0x6941('0x21')],'include':_0x529370[_0x6941('0x23')]?_[_0x6941('0x25')](_0x529370[_0x6941('0x23')],function(_0x1b7914){return{'model':db[_0x1b7914[_0x6941('0x24')]],'as':_0x1b7914['as'],'attributes':_0x1b7914[_0x6941('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6941('0x12')](function(_0x356510){logger[_0x6941('0x13')](_0x6941('0x1c'),_0x42cf1a);logger['debug'](_0x6941('0x1c'),_0x42cf1a,JSON[_0x6941('0x17')](_0x356510));_0x14ea6d(_0x356510);})[_0x6941('0x26')](function(_0x59a63f){logger['error'](_0x6941('0x1c'),_0x59a63f[_0x6941('0x1a')],_0x42cf1a);_0x66034d(_0x5ac53a[_0x6941('0x18')](0x1f4,_0x59a63f[_0x6941('0x1a')]));});});};exports[_0x6941('0x27')]=function(_0x28cf01){var _0x24afc6=this;return new Promise(function(_0x58e84b,_0x3b0de5){return db[_0x6941('0x1d')]['find']({'raw':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x20')]===undefined?!![]:![]:!![],'where':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x28')]||null:null,'attributes':_0x28cf01['options']?_0x28cf01[_0x6941('0x1f')][_0x6941('0x21')]||null:null,'include':_0x28cf01[_0x6941('0x1f')]?_0x28cf01[_0x6941('0x1f')][_0x6941('0x23')]?_['map'](_0x28cf01[_0x6941('0x1f')]['include'],function(_0x2e2b5a){return{'model':db[_0x2e2b5a['model']],'as':_0x2e2b5a['as'],'attributes':_0x2e2b5a[_0x6941('0x21')],'include':_0x2e2b5a[_0x6941('0x23')]?_[_0x6941('0x25')](_0x2e2b5a[_0x6941('0x23')],function(_0x145f83){return{'model':db[_0x145f83['model']],'as':_0x145f83['as'],'attributes':_0x145f83[_0x6941('0x21')],'include':_0x145f83[_0x6941('0x23')]?_[_0x6941('0x25')](_0x145f83[_0x6941('0x23')],function(_0x2b1467){return{'model':db[_0x2b1467[_0x6941('0x24')]],'as':_0x2b1467['as'],'attributes':_0x2b1467[_0x6941('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6941('0x12')](function(_0x4cbb75){logger[_0x6941('0x13')]('ShowWhatsappQueue',_0x28cf01);logger[_0x6941('0x16')](_0x6941('0x27'),_0x28cf01,JSON[_0x6941('0x17')](_0x4cbb75));_0x58e84b(_0x4cbb75);})[_0x6941('0x26')](function(_0x5c28cc){logger[_0x6941('0x18')](_0x6941('0x27'),_0x5c28cc[_0x6941('0x1a')],_0x28cf01);_0x3b0de5(_0x24afc6[_0x6941('0x18')](0x1f4,_0x5c28cc[_0x6941('0x1a')]));});});}; \ No newline at end of file +var _0xb5c6=['limit','include','map','model','info','debug','stringify','WhatsappQueue','find','raw','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetWhatsappQueue','options','where','attributes'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xb5c6,0x11c));var _0x6b5c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb5c6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6b5c('0x0'));var util=require(_0x6b5c('0x1'));var moment=require(_0x6b5c('0x2'));var BPromise=require(_0x6b5c('0x3'));var rs=require(_0x6b5c('0x4'));var fs=require('fs');var Redis=require(_0x6b5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b5c('0x6'))('rpc');var config=require(_0x6b5c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6b5c('0x8')]({'port':0x232a});config[_0x6b5c('0x9')]=_[_0x6b5c('0xa')](config[_0x6b5c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b5c('0xb'))(new Redis(config[_0x6b5c('0x9')]));require(_0x6b5c('0xc'))[_0x6b5c('0xd')](socket);function respondWithRpcPromise(_0x17cf14,_0x4b0341,_0x1325e2){return new BPromise(function(_0x53f2a5,_0x1cca4b){return client[_0x6b5c('0xe')](_0x17cf14,_0x1325e2)[_0x6b5c('0xf')](function(_0x593607){logger['info'](_0x6b5c('0x10'),_0x4b0341,_0x6b5c('0x11'));logger['debug'](_0x6b5c('0x12'),_0x4b0341,_0x6b5c('0x11'),JSON['stringify'](_0x593607));if(_0x593607[_0x6b5c('0x13')]){if(_0x593607[_0x6b5c('0x13')][_0x6b5c('0x14')]===0x1f4){logger[_0x6b5c('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x4b0341,_0x593607[_0x6b5c('0x13')]['message']);return _0x1cca4b(_0x593607[_0x6b5c('0x13')]['message']);}logger[_0x6b5c('0x13')](_0x6b5c('0x10'),_0x4b0341,_0x593607[_0x6b5c('0x13')][_0x6b5c('0x15')]);return _0x53f2a5(_0x593607[_0x6b5c('0x13')][_0x6b5c('0x15')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x4b0341,_0x6b5c('0x11'));_0x53f2a5(_0x593607[_0x6b5c('0x16')]['message']);}})[_0x6b5c('0x17')](function(_0x296591){logger[_0x6b5c('0x13')](_0x6b5c('0x10'),_0x4b0341,_0x296591);_0x1cca4b(_0x296591);});});}exports[_0x6b5c('0x18')]=function(_0x390ea7){var _0x35a74c=this;return new Promise(function(_0x2acb0a,_0xd63e6){return db['WhatsappQueue']['findAll']({'raw':_0x390ea7['options']?_0x390ea7[_0x6b5c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x390ea7[_0x6b5c('0x19')]?_0x390ea7[_0x6b5c('0x19')][_0x6b5c('0x1a')]||null:null,'attributes':_0x390ea7[_0x6b5c('0x19')]?_0x390ea7['options'][_0x6b5c('0x1b')]||null:null,'limit':_0x390ea7[_0x6b5c('0x19')]?_0x390ea7['options'][_0x6b5c('0x1c')]||null:null,'include':_0x390ea7[_0x6b5c('0x19')]?_0x390ea7[_0x6b5c('0x19')][_0x6b5c('0x1d')]?_[_0x6b5c('0x1e')](_0x390ea7[_0x6b5c('0x19')][_0x6b5c('0x1d')],function(_0x32c7c0){return{'model':db[_0x32c7c0['model']],'as':_0x32c7c0['as'],'attributes':_0x32c7c0[_0x6b5c('0x1b')],'include':_0x32c7c0['include']?_[_0x6b5c('0x1e')](_0x32c7c0[_0x6b5c('0x1d')],function(_0x3ae89b){return{'model':db[_0x3ae89b[_0x6b5c('0x1f')]],'as':_0x3ae89b['as'],'attributes':_0x3ae89b[_0x6b5c('0x1b')],'include':_0x3ae89b[_0x6b5c('0x1d')]?_[_0x6b5c('0x1e')](_0x3ae89b[_0x6b5c('0x1d')],function(_0x1187cb){return{'model':db[_0x1187cb[_0x6b5c('0x1f')]],'as':_0x1187cb['as'],'attributes':_0x1187cb[_0x6b5c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6b5c('0xf')](function(_0x4d5daf){logger[_0x6b5c('0x20')]('GetWhatsappQueue',_0x390ea7);logger[_0x6b5c('0x21')](_0x6b5c('0x18'),_0x390ea7,JSON[_0x6b5c('0x22')](_0x4d5daf));_0x2acb0a(_0x4d5daf);})[_0x6b5c('0x17')](function(_0x1a99f1){logger[_0x6b5c('0x13')]('GetWhatsappQueue',_0x1a99f1[_0x6b5c('0x15')],_0x390ea7);_0xd63e6(_0x35a74c['error'](0x1f4,_0x1a99f1[_0x6b5c('0x15')]));});});};exports['ShowWhatsappQueue']=function(_0x417986){var _0x2dbc97=this;return new Promise(function(_0x372566,_0x494fe0){return db[_0x6b5c('0x23')][_0x6b5c('0x24')]({'raw':_0x417986[_0x6b5c('0x19')]?_0x417986[_0x6b5c('0x19')][_0x6b5c('0x25')]===undefined?!![]:![]:!![],'where':_0x417986[_0x6b5c('0x19')]?_0x417986[_0x6b5c('0x19')][_0x6b5c('0x1a')]||null:null,'attributes':_0x417986[_0x6b5c('0x19')]?_0x417986[_0x6b5c('0x19')][_0x6b5c('0x1b')]||null:null,'include':_0x417986[_0x6b5c('0x19')]?_0x417986[_0x6b5c('0x19')][_0x6b5c('0x1d')]?_[_0x6b5c('0x1e')](_0x417986[_0x6b5c('0x19')][_0x6b5c('0x1d')],function(_0x1297c2){return{'model':db[_0x1297c2['model']],'as':_0x1297c2['as'],'attributes':_0x1297c2['attributes'],'include':_0x1297c2['include']?_[_0x6b5c('0x1e')](_0x1297c2[_0x6b5c('0x1d')],function(_0x405b5e){return{'model':db[_0x405b5e[_0x6b5c('0x1f')]],'as':_0x405b5e['as'],'attributes':_0x405b5e[_0x6b5c('0x1b')],'include':_0x405b5e['include']?_[_0x6b5c('0x1e')](_0x405b5e[_0x6b5c('0x1d')],function(_0x773a27){return{'model':db[_0x773a27[_0x6b5c('0x1f')]],'as':_0x773a27['as'],'attributes':_0x773a27['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b5c('0xf')](function(_0x3d903d){logger[_0x6b5c('0x20')]('ShowWhatsappQueue',_0x417986);logger['debug'](_0x6b5c('0x26'),_0x417986,JSON[_0x6b5c('0x22')](_0x3d903d));_0x372566(_0x3d903d);})[_0x6b5c('0x17')](function(_0x26d416){logger[_0x6b5c('0x13')]('ShowWhatsappQueue',_0x26d416[_0x6b5c('0x15')],_0x417986);_0x494fe0(_0x2dbc97[_0x6b5c('0x13')](0x1f4,_0x26d416['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c9f38c4..528f825 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 _0x3028=['save','emit','removeListener','register'];(function(_0x384f18,_0x4aab2c){var _0x4ac0a7=function(_0x32ffb9){while(--_0x32ffb9){_0x384f18['push'](_0x384f18['shift']());}};_0x4ac0a7(++_0x4aab2c);}(_0x3028,0x128));var _0x8302=function(_0x275ccf,_0x459d2a){_0x275ccf=_0x275ccf-0x0;var _0x3146c5=_0x3028[_0x275ccf];return _0x3146c5;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x8302('0x0'),'remove','update'];function createListener(_0x1aa0a2,_0x3aa369){return function(_0x3d2732){_0x3aa369[_0x8302('0x1')](_0x1aa0a2,_0x3d2732);};}function removeListener(_0x40de28,_0x548990){return function(){WhatsappQueueEvents[_0x8302('0x2')](_0x40de28,_0x548990);};}exports[_0x8302('0x3')]=function(_0x1c21ab){for(var _0x99b61=0x0,_0x14f2fe=events['length'];_0x99b61<_0x14f2fe;_0x99b61++){var _0x491679=events[_0x99b61];var _0x5608d6=createListener('whatsappQueue:'+_0x491679,_0x1c21ab);WhatsappQueueEvents['on'](_0x491679,_0x5608d6);}}; \ No newline at end of file +var _0xf65e=['whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener','length'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xf65e,0x1ba));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xef65('0x0'));var events=['save',_0xef65('0x1'),_0xef65('0x2')];function createListener(_0x425465,_0x351e23){return function(_0x53a49a){_0x351e23[_0xef65('0x3')](_0x425465,_0x53a49a);};}function removeListener(_0x37fb9a,_0x3fc5b4){return function(){WhatsappQueueEvents[_0xef65('0x4')](_0x37fb9a,_0x3fc5b4);};}exports['register']=function(_0x6f6dad){for(var _0x351699=0x0,_0x2a8b17=events[_0xef65('0x5')];_0x351699<_0x2a8b17;_0x351699++){var _0x2c92da=events[_0x351699];var _0x5b99ac=createListener(_0xef65('0x6')+_0x2c92da,_0x6f6dad);WhatsappQueueEvents['on'](_0x2c92da,_0x5b99ac);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 3eb739e..b2f657d 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 _0x758a=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','describe','get','/:id','create','put','update','destroy'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x758a,0x121));var _0xa758=function(_0x5f1cd0,_0x1c32d4){_0x5f1cd0=_0x5f1cd0-0x0;var _0x577cb2=_0x758a[_0x5f1cd0];return _0x577cb2;};'use strict';var multer=require(_0xa758('0x0'));var util=require(_0xa758('0x1'));var path=require(_0xa758('0x2'));var timeout=require(_0xa758('0x3'));var express=require(_0xa758('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa758('0x5'));var config=require(_0xa758('0x6'));var controller=require(_0xa758('0x7'));router['get']('/',auth[_0xa758('0x8')](),controller[_0xa758('0x9')]);router['get']('/describe',auth[_0xa758('0x8')](),controller[_0xa758('0xa')]);router[_0xa758('0xb')](_0xa758('0xc'),auth[_0xa758('0x8')](),controller['show']);router['post']('/',auth[_0xa758('0x8')](),controller[_0xa758('0xd')]);router[_0xa758('0xe')](_0xa758('0xc'),auth[_0xa758('0x8')](),controller[_0xa758('0xf')]);router['delete'](_0xa758('0xc'),auth[_0xa758('0x8')](),controller[_0xa758('0x10')]);module[_0xa758('0x11')]=router; \ No newline at end of file +var _0xfe6c=['describe','show','isAuthenticated','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','/describe'];(function(_0x1cc2a9,_0x2c5885){var _0xdcc257=function(_0x3b0739){while(--_0x3b0739){_0x1cc2a9['push'](_0x1cc2a9['shift']());}};_0xdcc257(++_0x2c5885);}(_0xfe6c,0x74));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcfe6('0x0'));var timeout=require(_0xcfe6('0x1'));var express=require(_0xcfe6('0x2'));var router=express[_0xcfe6('0x3')]();var fs_extra=require(_0xcfe6('0x4'));var auth=require(_0xcfe6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcfe6('0x6'));var controller=require(_0xcfe6('0x7'));router[_0xcfe6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcfe6('0x8')](_0xcfe6('0x9'),auth['isAuthenticated'](),controller[_0xcfe6('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcfe6('0xb')]);router['post']('/',auth[_0xcfe6('0xc')](),controller['create']);router['put'](_0xcfe6('0xd'),auth[_0xcfe6('0xc')](),controller[_0xcfe6('0xe')]);router[_0xcfe6('0xf')](_0xcfe6('0xd'),auth[_0xcfe6('0xc')](),controller[_0xcfe6('0x10')]);module[_0xcfe6('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 84b1fd7..34b437a 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(_0x27f967,_0x44dfdd){var _0x251f7c=function(_0x420e59){while(--_0x420e59){_0x27f967['push'](_0x27f967['shift']());}};_0x251f7c(++_0x44dfdd);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x228779,_0x2349d5){var _0x4661c4=function(_0x4b9ad8){while(--_0x4b9ad8){_0x228779['push'](_0x228779['shift']());}};_0x4661c4(++_0x2349d5);}(_0x7a54,0x106));var _0x47a5=function(_0x478c41,_0x5857d1){_0x478c41=_0x478c41-0x0;var _0x51d35a=_0x7a54[_0x478c41];return _0x51d35a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 87f8e1e..3364fc7 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 _0x373d=['order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','show','rawAttributes','includeAll','options','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x588fa4,_0x58fbd7){var _0x3f8bf3=function(_0x287fc9){while(--_0x287fc9){_0x588fa4['push'](_0x588fa4['shift']());}};_0x3f8bf3(++_0x58fbd7);}(_0x373d,0x1e2));var _0xd373=function(_0x57aad4,_0x108f28){_0x57aad4=_0x57aad4-0x0;var _0x26b886=_0x373d[_0x57aad4];return _0x26b886;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x437110,_0x34f05a){return function(_0x388182){if(!_0x388182){_0x437110[_0xd373('0x15')](0x194);}return _0x388182;};}function handleError(_0x18d7ab,_0x38ba50){_0x38ba50=_0x38ba50||0x1f4;return function(_0x50b987){logger[_0xd373('0x25')](_0x50b987[_0xd373('0x26')]);if(_0x50b987[_0xd373('0x27')]){delete _0x50b987[_0xd373('0x27')];}_0x18d7ab[_0xd373('0x17')](_0x38ba50)[_0xd373('0x28')](_0x50b987);};}exports[_0xd373('0x29')]=function(_0xf85ca8,_0x2869e5){var _0x158825={},_0xbc420b={},_0x2ee37c={'count':0x0,'rows':[]};var _0x7dad3e=_['map'](db[_0xd373('0x2a')]['rawAttributes'],function(_0x498aaa){return{'name':_0x498aaa[_0xd373('0x2b')],'type':_0x498aaa[_0xd373('0x2c')][_0xd373('0x2d')]};});_0xbc420b[_0xd373('0x2e')]=_[_0xd373('0x2f')](_0x7dad3e,'name');_0xbc420b[_0xd373('0x30')]=_[_0xd373('0x31')](_0xf85ca8['query']);_0xbc420b[_0xd373('0x32')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],_0xbc420b[_0xd373('0x30')]);_0x158825[_0xd373('0x34')]=_[_0xd373('0x33')](_0xbc420b[_0xd373('0x2e')],qs[_0xd373('0x35')](_0xf85ca8[_0xd373('0x30')]['fields']));_0x158825[_0xd373('0x34')]=_0x158825[_0xd373('0x34')][_0xd373('0x36')]?_0x158825[_0xd373('0x34')]:_0xbc420b[_0xd373('0x2e')];if(!_0xf85ca8[_0xd373('0x30')][_0xd373('0x37')](_0xd373('0x38'))){_0x158825[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x1b')]);_0x158825[_0xd373('0x19')]=qs[_0xd373('0x19')](_0xf85ca8[_0xd373('0x30')]['offset']);}_0x158825[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0xf85ca8[_0xd373('0x30')][_0xd373('0x3a')]);_0x158825['where']=qs[_0xd373('0x32')](_[_0xd373('0x3b')](_0xf85ca8[_0xd373('0x30')],_0xbc420b[_0xd373('0x32')]),_0x7dad3e);if(_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]){_0x158825['where']=_['merge'](_0x158825[_0xd373('0x3d')],{'$or':_['map'](_0x7dad3e,function(_0x37c97e){if(_0x37c97e[_0xd373('0x2c')]!==_0xd373('0x3e')){var _0x51ba69={};_0x51ba69[_0x37c97e[_0xd373('0x27')]]={'$like':'%'+_0xf85ca8[_0xd373('0x30')][_0xd373('0x3c')]+'%'};return _0x51ba69;}})});}_0x158825=_[_0xd373('0x3f')]({},_0x158825,_0xf85ca8['options']);var _0x513038={'where':_0x158825['where']};return db[_0xd373('0x2a')]['count'](_0x513038)[_0xd373('0x23')](function(_0x2fa6c4){_0x2ee37c['count']=_0x2fa6c4;if(_0xf85ca8['query']['includeAll']){_0x158825[_0xd373('0x40')]=[{'all':!![]}];}return db[_0xd373('0x2a')][_0xd373('0x41')](_0x158825);})['then'](function(_0x5c3b22){_0x2ee37c[_0xd373('0x42')]=_0x5c3b22;return _0x2ee37c;})[_0xd373('0x23')](respondWithFilteredResult(_0x2869e5,_0x158825))['catch'](handleError(_0x2869e5,null));};exports[_0xd373('0x43')]=function(_0x2ee75f,_0x1e3de1){var _0x9989e4={'raw':!![],'where':{'id':_0x2ee75f['params']['id']}},_0x2d8c7d={};_0x2d8c7d['model']=_[_0xd373('0x31')](db[_0xd373('0x2a')][_0xd373('0x44')]);_0x2d8c7d[_0xd373('0x30')]=_['keys'](_0x2ee75f[_0xd373('0x30')]);_0x2d8c7d['filters']=_[_0xd373('0x33')](_0x2d8c7d[_0xd373('0x2e')],_0x2d8c7d[_0xd373('0x30')]);_0x9989e4[_0xd373('0x34')]=_[_0xd373('0x33')](_0x2d8c7d['model'],qs[_0xd373('0x35')](_0x2ee75f[_0xd373('0x30')]['fields']));_0x9989e4[_0xd373('0x34')]=_0x9989e4[_0xd373('0x34')][_0xd373('0x36')]?_0x9989e4[_0xd373('0x34')]:_0x2d8c7d[_0xd373('0x2e')];if(_0x2ee75f[_0xd373('0x30')][_0xd373('0x45')]){_0x9989e4[_0xd373('0x40')]=[{'all':!![]}];}_0x9989e4=_[_0xd373('0x3f')]({},_0x9989e4,_0x2ee75f[_0xd373('0x46')]);return db['WhatsappQueueReport']['find'](_0x9989e4)[_0xd373('0x23')](handleEntityNotFound(_0x1e3de1,null))['then'](respondWithResult(_0x1e3de1,null))[_0xd373('0x47')](handleError(_0x1e3de1,null));};exports['create']=function(_0x5e5279,_0x5cbc16){return db[_0xd373('0x2a')][_0xd373('0x48')](_0x5e5279[_0xd373('0x49')],{})[_0xd373('0x23')](respondWithResult(_0x5cbc16,0xc9))[_0xd373('0x47')](handleError(_0x5cbc16,null));};exports[_0xd373('0x22')]=function(_0x1855aa,_0x4d1088){if(_0x1855aa[_0xd373('0x49')]['id']){delete _0x1855aa['body']['id'];}return db[_0xd373('0x2a')][_0xd373('0x4a')]({'where':{'id':_0x1855aa['params']['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4d1088,null))['then'](saveUpdates(_0x1855aa[_0xd373('0x49')],null))[_0xd373('0x23')](respondWithResult(_0x4d1088,null))[_0xd373('0x47')](handleError(_0x4d1088,null));};exports[_0xd373('0x24')]=function(_0xe22cbd,_0x4bc631){return db['WhatsappQueueReport']['find']({'where':{'id':_0xe22cbd[_0xd373('0x4b')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x4bc631,null))['then'](removeEntity(_0x4bc631,null))[_0xd373('0x47')](handleError(_0x4bc631,null));};exports[_0xd373('0x4c')]=function(_0x4d7020,_0xae7067){return db[_0xd373('0x2a')][_0xd373('0x4c')]()[_0xd373('0x23')](respondWithResult(_0xae7067,null))[_0xd373('0x47')](handleError(_0xae7067,null));}; \ No newline at end of file +var _0xac4a=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5d99c9,_0x12312b){var _0x36e648=function(_0x14231d){while(--_0x14231d){_0x5d99c9['push'](_0x5d99c9['shift']());}};_0x36e648(++_0x12312b);}(_0xac4a,0x13f));var _0xaac4=function(_0x126159,_0x9fb002){_0x126159=_0x126159-0x0;var _0x18bb28=_0xac4a[_0x126159];return _0x18bb28;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['WhatsappQueueReport'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));};exports[_0xaac4('0x4a')]=function(_0x38f9af,_0x56201b){return db[_0xaac4('0x2a')]['describe']()[_0xaac4('0x23')](respondWithResult(_0x56201b,null))[_0xaac4('0x47')](handleError(_0x56201b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index e88ce0c..60161d1 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 _0x845a=['../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','bluebird','request-promise','path'];(function(_0x4fac7b,_0x78b07c){var _0xdfd85=function(_0x126e47){while(--_0x126e47){_0x4fac7b['push'](_0x4fac7b['shift']());}};_0xdfd85(++_0x78b07c);}(_0x845a,0x1ea));var _0xa845=function(_0x8df750,_0x22c0f5){_0x8df750=_0x8df750-0x0;var _0x290bc8=_0x845a[_0x8df750];return _0x290bc8;};'use strict';var _=require('lodash');var util=require(_0xa845('0x0'));var logger=require('../../config/logger')(_0xa845('0x1'));var moment=require('moment');var BPromise=require(_0xa845('0x2'));var rp=require(_0xa845('0x3'));var fs=require('fs');var path=require(_0xa845('0x4'));var rimraf=require('rimraf');var config=require(_0xa845('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0xa845('0x6')]=function(_0x4be636,_0x545926){return _0x4be636[_0xa845('0x7')](_0xa845('0x8'),attributes,{'tableName':_0xa845('0x9'),'paranoid':![],'indexes':[{'name':_0xa845('0xa'),'fields':[_0xa845('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe04a=['report_whatsapp_queue','uniqueid','lodash','util','api','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define'];(function(_0x3f472e,_0x23fbf2){var _0x336c98=function(_0x322c02){while(--_0x322c02){_0x3f472e['push'](_0x3f472e['shift']());}};_0x336c98(++_0x23fbf2);}(_0xe04a,0xb6));var _0xae04=function(_0x35e8c6,_0x51570a){_0x35e8c6=_0x35e8c6-0x0;var _0x151861=_0xe04a[_0x35e8c6];return _0x151861;};'use strict';var _=require(_0xae04('0x0'));var util=require(_0xae04('0x1'));var logger=require('../../config/logger')(_0xae04('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae04('0x3'));var rimraf=require(_0xae04('0x4'));var config=require(_0xae04('0x5'));var attributes=require(_0xae04('0x6'));module['exports']=function(_0x4986d7,_0x3e6f3b){return _0x4986d7[_0xae04('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xae04('0x8'),'paranoid':![],'indexes':[{'name':_0xae04('0x9'),'fields':[_0xae04('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 5880d01..97cfda8 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 _0x7b4f=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','update','where','attributes','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x7b4f,0x134));var _0xf7b4=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x7b4f[_0x5af59e];return _0x4240df;};'use strict';var _=require('lodash');var util=require(_0xf7b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf7b4('0x1'));var fs=require('fs');var Redis=require(_0xf7b4('0x2'));var db=require(_0xf7b4('0x3'))['db'];var utils=require(_0xf7b4('0x4'));var logger=require(_0xf7b4('0x5'))(_0xf7b4('0x6'));var config=require('../../config/environment');var jayson=require(_0xf7b4('0x7'));var client=jayson[_0xf7b4('0x8')][_0xf7b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20c8c9,_0x4f577a,_0x242851){return new BPromise(function(_0x320669,_0x14838d){return client[_0xf7b4('0xa')](_0x20c8c9,_0x242851)['then'](function(_0x4569a1){logger[_0xf7b4('0xb')](_0xf7b4('0xc'),_0x4f577a,_0xf7b4('0xd'));logger['debug'](_0xf7b4('0xe'),_0x4f577a,_0xf7b4('0xd'),JSON[_0xf7b4('0xf')](_0x4569a1));if(_0x4569a1[_0xf7b4('0x10')]){if(_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x11')]===0x1f4){logger[_0xf7b4('0x10')](_0xf7b4('0xc'),_0x4f577a,_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);return _0x14838d(_0x4569a1[_0xf7b4('0x10')]['message']);}logger[_0xf7b4('0x10')](_0xf7b4('0xc'),_0x4f577a,_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);return _0x320669(_0x4569a1[_0xf7b4('0x10')][_0xf7b4('0x12')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x4f577a,_0xf7b4('0xd'));_0x320669(_0x4569a1['result'][_0xf7b4('0x12')]);}})[_0xf7b4('0x13')](function(_0x73d55e){logger['error'](_0xf7b4('0xc'),_0x4f577a,_0x73d55e);_0x14838d(_0x73d55e);});});}exports[_0xf7b4('0x14')]=function(_0xb665d7){var _0x1fab13=this;return new Promise(function(_0x33a0e4,_0x479b06){return db[_0xf7b4('0x15')][_0xf7b4('0x16')](_0xb665d7[_0xf7b4('0x17')],{'raw':_0xb665d7['options']?_0xb665d7[_0xf7b4('0x18')][_0xf7b4('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x58f32d){logger['info'](_0xf7b4('0x14'),_0xb665d7);logger[_0xf7b4('0x1a')](_0xf7b4('0x14'),_0xb665d7,JSON['stringify'](_0x58f32d));_0x33a0e4(_0x58f32d);})[_0xf7b4('0x13')](function(_0x4f8c38){logger[_0xf7b4('0x10')](_0xf7b4('0x14'),_0x4f8c38[_0xf7b4('0x12')],_0xb665d7);_0x479b06(_0x1fab13['error'](0x1f4,_0x4f8c38[_0xf7b4('0x12')]));});});};exports[_0xf7b4('0x1b')]=function(_0x25373){var _0x41ba5f=this;return new Promise(function(_0xb1d9c8,_0x1a1448){return db[_0xf7b4('0x15')][_0xf7b4('0x1c')](_0x25373[_0xf7b4('0x17')],{'raw':_0x25373['options']?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25373['options']?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x1d')]||null:null,'attributes':_0x25373[_0xf7b4('0x18')]?_0x25373[_0xf7b4('0x18')][_0xf7b4('0x1e')]||null:null,'limit':_0x25373[_0xf7b4('0x18')]?_0x25373[_0xf7b4('0x18')]['limit']||null:null})[_0xf7b4('0x1f')](function(_0x458cfe){logger[_0xf7b4('0xb')]('UpdateWhatsappQueueReport',_0x25373);logger[_0xf7b4('0x1a')]('UpdateWhatsappQueueReport',_0x25373,JSON[_0xf7b4('0xf')](_0x458cfe));_0xb1d9c8(_0x458cfe);})[_0xf7b4('0x13')](function(_0x1ccb8e){logger[_0xf7b4('0x10')](_0xf7b4('0x1b'),_0x1ccb8e[_0xf7b4('0x12')],_0x25373);_0x1a1448(_0x41ba5f[_0xf7b4('0x10')](0x1f4,_0x1ccb8e[_0xf7b4('0x12')]));});});}; \ No newline at end of file +var _0x691f=['limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','info','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes'];(function(_0x176460,_0x1d4e43){var _0x8bb56a=function(_0x5e0cd9){while(--_0x5e0cd9){_0x176460['push'](_0x176460['shift']());}};_0x8bb56a(++_0x1d4e43);}(_0x691f,0xa6));var _0xf691=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x691f[_0x28407a];return _0x8bd6ef;};'use strict';var _=require(_0xf691('0x0'));var util=require('util');var moment=require(_0xf691('0x1'));var BPromise=require(_0xf691('0x2'));var rs=require(_0xf691('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf691('0x4'));var logger=require(_0xf691('0x5'))('rpc');var config=require(_0xf691('0x6'));var jayson=require(_0xf691('0x7'));var client=jayson[_0xf691('0x8')][_0xf691('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x316cd1,_0x25fc5e,_0x1374f2){return new BPromise(function(_0x383cb2,_0x10b128){return client[_0xf691('0xa')](_0x316cd1,_0x1374f2)[_0xf691('0xb')](function(_0x5f5c40){logger['info'](_0xf691('0xc'),_0x25fc5e,'request\x20sent');logger[_0xf691('0xd')](_0xf691('0xe'),_0x25fc5e,_0xf691('0xf'),JSON[_0xf691('0x10')](_0x5f5c40));if(_0x5f5c40[_0xf691('0x11')]){if(_0x5f5c40[_0xf691('0x11')][_0xf691('0x12')]===0x1f4){logger['error'](_0xf691('0xc'),_0x25fc5e,_0x5f5c40[_0xf691('0x11')][_0xf691('0x13')]);return _0x10b128(_0x5f5c40[_0xf691('0x11')]['message']);}logger[_0xf691('0x11')](_0xf691('0xc'),_0x25fc5e,_0x5f5c40[_0xf691('0x11')]['message']);return _0x383cb2(_0x5f5c40[_0xf691('0x11')]['message']);}else{logger['info'](_0xf691('0xc'),_0x25fc5e,_0xf691('0xf'));_0x383cb2(_0x5f5c40[_0xf691('0x14')][_0xf691('0x13')]);}})[_0xf691('0x15')](function(_0x364013){logger[_0xf691('0x11')](_0xf691('0xc'),_0x25fc5e,_0x364013);_0x10b128(_0x364013);});});}exports[_0xf691('0x16')]=function(_0x3ff0fe){var _0x17cda3=this;return new Promise(function(_0xb483ec,_0xb99500){return db['WhatsappQueueReport'][_0xf691('0x17')](_0x3ff0fe[_0xf691('0x18')],{'raw':_0x3ff0fe[_0xf691('0x19')]?_0x3ff0fe['options'][_0xf691('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1d4269){logger[_0xf691('0x1b')](_0xf691('0x16'),_0x3ff0fe);logger[_0xf691('0xd')](_0xf691('0x16'),_0x3ff0fe,JSON[_0xf691('0x10')](_0x1d4269));_0xb483ec(_0x1d4269);})[_0xf691('0x15')](function(_0x2aaca5){logger[_0xf691('0x11')](_0xf691('0x16'),_0x2aaca5[_0xf691('0x13')],_0x3ff0fe);_0xb99500(_0x17cda3[_0xf691('0x11')](0x1f4,_0x2aaca5[_0xf691('0x13')]));});});};exports[_0xf691('0x1c')]=function(_0x21444b){var _0x5d149d=this;return new Promise(function(_0x37bcde,_0x3c56ee){return db[_0xf691('0x1d')][_0xf691('0x1e')](_0x21444b[_0xf691('0x18')],{'raw':_0x21444b[_0xf691('0x19')]?_0x21444b[_0xf691('0x19')][_0xf691('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21444b['options']?_0x21444b['options']['where']||null:null,'attributes':_0x21444b[_0xf691('0x19')]?_0x21444b[_0xf691('0x19')][_0xf691('0x1f')]||null:null,'limit':_0x21444b[_0xf691('0x19')]?_0x21444b[_0xf691('0x19')][_0xf691('0x20')]||null:null})[_0xf691('0xb')](function(_0x242e4f){logger[_0xf691('0x1b')](_0xf691('0x1c'),_0x21444b);logger[_0xf691('0xd')](_0xf691('0x1c'),_0x21444b,JSON[_0xf691('0x10')](_0x242e4f));_0x37bcde(_0x242e4f);})[_0xf691('0x15')](function(_0x3439df){logger[_0xf691('0x11')](_0xf691('0x1c'),_0x3439df[_0xf691('0x13')],_0x21444b);_0x3c56ee(_0x5d149d[_0xf691('0x11')](0x1f4,_0x3439df[_0xf691('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f4d2b6d..ab6611a 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 _0xbdc3=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xbdc3,0x129));var _0x3bdc=function(_0x1ea952,_0x369e26){_0x1ea952=_0x1ea952-0x0;var _0x4d6d83=_0xbdc3[_0x1ea952];return _0x4d6d83;};'use strict';var multer=require('multer');var util=require(_0x3bdc('0x0'));var path=require(_0x3bdc('0x1'));var timeout=require(_0x3bdc('0x2'));var express=require(_0x3bdc('0x3'));var router=express[_0x3bdc('0x4')]();var fs_extra=require(_0x3bdc('0x5'));var auth=require(_0x3bdc('0x6'));var interaction=require(_0x3bdc('0x7'));var config=require(_0x3bdc('0x8'));var controller=require(_0x3bdc('0x9'));router[_0x3bdc('0xa')]('/',auth[_0x3bdc('0xb')](),controller['index']);router['get'](_0x3bdc('0xc'),auth[_0x3bdc('0xb')](),controller[_0x3bdc('0xd')]);router[_0x3bdc('0xa')]('/:id',auth[_0x3bdc('0xb')](),controller[_0x3bdc('0xe')]);router['post']('/',auth[_0x3bdc('0xb')](),controller['create']);router[_0x3bdc('0xf')](_0x3bdc('0x10'),auth[_0x3bdc('0xb')](),controller['update']);router[_0x3bdc('0x11')](_0x3bdc('0x10'),auth[_0x3bdc('0xb')](),controller[_0x3bdc('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdb33=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','exports','multer','util','path'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xdb33,0x11e));var _0x3db3=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0xdb33[_0x3f9584];return _0x9d54c;};'use strict';var multer=require(_0x3db3('0x0'));var util=require(_0x3db3('0x1'));var path=require(_0x3db3('0x2'));var timeout=require('connect-timeout');var express=require(_0x3db3('0x3'));var router=express['Router']();var fs_extra=require(_0x3db3('0x4'));var auth=require(_0x3db3('0x5'));var interaction=require(_0x3db3('0x6'));var config=require(_0x3db3('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x3db3('0x8')]('/',auth[_0x3db3('0x9')](),controller['index']);router['get'](_0x3db3('0xa'),auth[_0x3db3('0x9')](),controller[_0x3db3('0xb')]);router[_0x3db3('0x8')](_0x3db3('0xc'),auth[_0x3db3('0x9')](),controller[_0x3db3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3db3('0xe')]);router[_0x3db3('0xf')](_0x3db3('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3db3('0xc'),auth[_0x3db3('0x9')](),controller['destroy']);module[_0x3db3('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 178886a..54537ea 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 _0xdc91=['exports','queue','DATE','sequelize'];(function(_0xc981b,_0x3d2524){var _0xf1edc0=function(_0x3e6c2a){while(--_0x3e6c2a){_0xc981b['push'](_0xc981b['shift']());}};_0xf1edc0(++_0x3d2524);}(_0xdc91,0x8b));var _0x1dc9=function(_0x272a78,_0x219004){_0x272a78=_0x272a78-0x0;var _0x3e59d5=_0xdc91[_0x272a78];return _0x3e59d5;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0x1dc9('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1dc9('0x3')]}}; \ No newline at end of file +var _0x3c91=['exports','STRING','agent','queue','DATE','sequelize'];(function(_0x404620,_0x3af2a6){var _0x11e731=function(_0x4bfcdb){while(--_0x4bfcdb){_0x404620['push'](_0x404620['shift']());}};_0x11e731(++_0x3af2a6);}(_0x3c91,0x1af));var _0x13c9=function(_0xbf2442,_0x50fca3){_0xbf2442=_0xbf2442-0x0;var _0xf6fd30=_0x3c91[_0xbf2442];return _0xf6fd30;};'use strict';var Sequelize=require(_0x13c9('0x0'));module[_0x13c9('0x1')]={'uniqueid':{'type':Sequelize[_0x13c9('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x13c9('0x3'),_0x13c9('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x13c9('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c4434ae..a69947c 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 _0x573c=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','fields','length','find','create','body'];(function(_0x5df3ab,_0x4a0a7e){var _0x42cce5=function(_0x430d0a){while(--_0x430d0a){_0x5df3ab['push'](_0x5df3ab['shift']());}};_0x42cce5(++_0x4a0a7e);}(_0x573c,0x125));var _0xc573=function(_0x3aab2a,_0x18ec2c){_0x3aab2a=_0x3aab2a-0x0;var _0x8a14ff=_0x573c[_0x3aab2a];return _0x8a14ff;};'use strict';var emlformat=require(_0xc573('0x0'));var rimraf=require(_0xc573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc573('0x2'));var rp=require(_0xc573('0x3'));var moment=require(_0xc573('0x4'));var BPromise=require(_0xc573('0x5'));var Mustache=require(_0xc573('0x6'));var util=require(_0xc573('0x7'));var path=require('path');var sox=require(_0xc573('0x8'));var csv=require(_0xc573('0x9'));var ejs=require(_0xc573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc573('0xb'));var squel=require('squel');var crypto=require(_0xc573('0xc'));var jsforce=require(_0xc573('0xd'));var deskjs=require(_0xc573('0xe'));var toCsv=require(_0xc573('0x9'));var querystring=require('querystring');var Papa=require(_0xc573('0xf'));var Redis=require(_0xc573('0x10'));var authService=require(_0xc573('0x11'));var qs=require(_0xc573('0x12'));var as=require(_0xc573('0x13'));var hardwareService=require(_0xc573('0x14'));var logger=require(_0xc573('0x15'))(_0xc573('0x16'));var utils=require(_0xc573('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc573('0x18'))['db'];function respondWithStatusCode(_0x1a626e,_0x1949d0){_0x1949d0=_0x1949d0||0xcc;return function(_0x2c4239){if(_0x2c4239){return _0x1a626e[_0xc573('0x19')](_0x1949d0);}return _0x1a626e[_0xc573('0x1a')](_0x1949d0)[_0xc573('0x1b')]();};}function respondWithResult(_0x377a5d,_0x2e0c02){_0x2e0c02=_0x2e0c02||0xc8;return function(_0x258231){if(_0x258231){return _0x377a5d[_0xc573('0x1a')](_0x2e0c02)[_0xc573('0x1c')](_0x258231);}};}function respondWithFilteredResult(_0x4199b6,_0x2b25f9){return function(_0x2f8a3e){if(_0x2f8a3e){var _0x5b6e=typeof _0x2b25f9['offset']===_0xc573('0x1d')&&typeof _0x2b25f9[_0xc573('0x1e')]==='undefined';var _0x25a70a=_0x2f8a3e['count'];var _0x54a4b7=_0x5b6e?0x0:_0x2b25f9['offset'];var _0xe671ca=_0x5b6e?_0x2f8a3e[_0xc573('0x1f')]:_0x2b25f9['offset']+_0x2b25f9[_0xc573('0x1e')];var _0x5e01cc;if(_0xe671ca>=_0x25a70a){_0xe671ca=_0x25a70a;_0x5e01cc=0xc8;}else{_0x5e01cc=0xce;}_0x4199b6[_0xc573('0x1a')](_0x5e01cc);return _0x4199b6[_0xc573('0x20')](_0xc573('0x21'),_0x54a4b7+'-'+_0xe671ca+'/'+_0x25a70a)[_0xc573('0x1c')](_0x2f8a3e);}return null;};}function patchUpdates(_0x4b9fed){return function(_0xe40809){try{jsonpatch['apply'](_0xe40809,_0x4b9fed,!![]);}catch(_0x9b2c9a){return BPromise[_0xc573('0x22')](_0x9b2c9a);}return _0xe40809[_0xc573('0x23')]();};}function saveUpdates(_0xaf4def,_0x49a6a6){return function(_0x494954){if(_0x494954){return _0x494954[_0xc573('0x24')](_0xaf4def)[_0xc573('0x25')](function(_0x328e58){return _0x328e58;});}return null;};}function removeEntity(_0x3ba794,_0x296e60){return function(_0x27f5af){if(_0x27f5af){return _0x27f5af[_0xc573('0x26')]()[_0xc573('0x25')](function(){_0x3ba794[_0xc573('0x1a')](0xcc)[_0xc573('0x1b')]();});}};}function handleEntityNotFound(_0x13833a,_0x5c4d76){return function(_0x7bc184){if(!_0x7bc184){_0x13833a[_0xc573('0x19')](0x194);}return _0x7bc184;};}function handleError(_0x1330f9,_0x300a86){_0x300a86=_0x300a86||0x1f4;return function(_0xb6e87b){logger[_0xc573('0x27')](_0xb6e87b[_0xc573('0x28')]);if(_0xb6e87b[_0xc573('0x29')]){delete _0xb6e87b[_0xc573('0x29')];}_0x1330f9[_0xc573('0x1a')](_0x300a86)['send'](_0xb6e87b);};}exports['index']=function(_0x1de2c8,_0x6e2917){var _0x3181c8={},_0x276e39={},_0x139f1d={'count':0x0,'rows':[]};var _0x5d053b=_[_0xc573('0x2a')](db[_0xc573('0x2b')][_0xc573('0x2c')],function(_0x5efc19){return{'name':_0x5efc19['fieldName'],'type':_0x5efc19[_0xc573('0x2d')][_0xc573('0x2e')]};});_0x276e39['model']=_['map'](_0x5d053b,_0xc573('0x29'));_0x276e39[_0xc573('0x2f')]=_[_0xc573('0x30')](_0x1de2c8['query']);_0x276e39[_0xc573('0x31')]=_['intersection'](_0x276e39[_0xc573('0x32')],_0x276e39[_0xc573('0x2f')]);_0x3181c8[_0xc573('0x33')]=_[_0xc573('0x34')](_0x276e39[_0xc573('0x32')],qs['fields'](_0x1de2c8[_0xc573('0x2f')]['fields']));_0x3181c8[_0xc573('0x33')]=_0x3181c8[_0xc573('0x33')]['length']?_0x3181c8[_0xc573('0x33')]:_0x276e39[_0xc573('0x32')];if(!_0x1de2c8[_0xc573('0x2f')]['hasOwnProperty'](_0xc573('0x35'))){_0x3181c8['limit']=qs[_0xc573('0x1e')](_0x1de2c8[_0xc573('0x2f')]['limit']);_0x3181c8['offset']=qs['offset'](_0x1de2c8['query']['offset']);}_0x3181c8[_0xc573('0x36')]=qs[_0xc573('0x37')](_0x1de2c8[_0xc573('0x2f')][_0xc573('0x37')]);_0x3181c8['where']=qs['filters'](_[_0xc573('0x38')](_0x1de2c8[_0xc573('0x2f')],_0x276e39[_0xc573('0x31')]),_0x5d053b);if(_0x1de2c8[_0xc573('0x2f')][_0xc573('0x39')]){_0x3181c8[_0xc573('0x3a')]=_[_0xc573('0x3b')](_0x3181c8[_0xc573('0x3a')],{'$or':_[_0xc573('0x2a')](_0x5d053b,function(_0x2c44f7){if(_0x2c44f7['type']!=='VIRTUAL'){var _0x33ee5d={};_0x33ee5d[_0x2c44f7['name']]={'$like':'%'+_0x1de2c8[_0xc573('0x2f')][_0xc573('0x39')]+'%'};return _0x33ee5d;}})});}_0x3181c8=_[_0xc573('0x3b')]({},_0x3181c8,_0x1de2c8[_0xc573('0x3c')]);var _0x78fb98={'where':_0x3181c8['where']};return db[_0xc573('0x2b')][_0xc573('0x1f')](_0x78fb98)['then'](function(_0x3a31f4){_0x139f1d[_0xc573('0x1f')]=_0x3a31f4;if(_0x1de2c8[_0xc573('0x2f')][_0xc573('0x3d')]){_0x3181c8['include']=[{'all':!![]}];}return db[_0xc573('0x2b')][_0xc573('0x3e')](_0x3181c8);})[_0xc573('0x25')](function(_0x30ea46){_0x139f1d[_0xc573('0x3f')]=_0x30ea46;return _0x139f1d;})[_0xc573('0x25')](respondWithFilteredResult(_0x6e2917,_0x3181c8))[_0xc573('0x40')](handleError(_0x6e2917,null));};exports[_0xc573('0x41')]=function(_0xd0b52c,_0x49e779){var _0x4fa707={'raw':!![],'where':{'id':_0xd0b52c[_0xc573('0x42')]['id']}},_0x3eaa9a={};_0x3eaa9a[_0xc573('0x32')]=_[_0xc573('0x30')](db[_0xc573('0x2b')][_0xc573('0x2c')]);_0x3eaa9a[_0xc573('0x2f')]=_[_0xc573('0x30')](_0xd0b52c['query']);_0x3eaa9a['filters']=_[_0xc573('0x34')](_0x3eaa9a[_0xc573('0x32')],_0x3eaa9a['query']);_0x4fa707[_0xc573('0x33')]=_[_0xc573('0x34')](_0x3eaa9a[_0xc573('0x32')],qs[_0xc573('0x43')](_0xd0b52c[_0xc573('0x2f')][_0xc573('0x43')]));_0x4fa707[_0xc573('0x33')]=_0x4fa707[_0xc573('0x33')][_0xc573('0x44')]?_0x4fa707['attributes']:_0x3eaa9a[_0xc573('0x32')];if(_0xd0b52c['query'][_0xc573('0x3d')]){_0x4fa707['include']=[{'all':!![]}];}_0x4fa707=_['merge']({},_0x4fa707,_0xd0b52c[_0xc573('0x3c')]);return db[_0xc573('0x2b')][_0xc573('0x45')](_0x4fa707)['then'](handleEntityNotFound(_0x49e779,null))[_0xc573('0x25')](respondWithResult(_0x49e779,null))[_0xc573('0x40')](handleError(_0x49e779,null));};exports[_0xc573('0x46')]=function(_0x20b1f5,_0x146f02){return db['WhatsappTransferReport'][_0xc573('0x46')](_0x20b1f5[_0xc573('0x47')],{})[_0xc573('0x25')](respondWithResult(_0x146f02,0xc9))[_0xc573('0x40')](handleError(_0x146f02,null));};exports[_0xc573('0x24')]=function(_0xf21bbf,_0xd56359){if(_0xf21bbf['body']['id']){delete _0xf21bbf[_0xc573('0x47')]['id'];}return db[_0xc573('0x2b')][_0xc573('0x45')]({'where':{'id':_0xf21bbf[_0xc573('0x42')]['id']}})[_0xc573('0x25')](handleEntityNotFound(_0xd56359,null))['then'](saveUpdates(_0xf21bbf['body'],null))[_0xc573('0x25')](respondWithResult(_0xd56359,null))[_0xc573('0x40')](handleError(_0xd56359,null));};exports[_0xc573('0x26')]=function(_0x1dc1aa,_0xae74a6){return db[_0xc573('0x2b')][_0xc573('0x45')]({'where':{'id':_0x1dc1aa['params']['id']}})['then'](handleEntityNotFound(_0xae74a6,null))['then'](removeEntity(_0xae74a6,null))[_0xc573('0x40')](handleError(_0xae74a6,null));};exports[_0xc573('0x48')]=function(_0x2d37f3,_0x3f8e94){return db[_0xc573('0x2b')]['describe']()[_0xc573('0x25')](respondWithResult(_0x3f8e94,null))[_0xc573('0x40')](handleError(_0x3f8e94,null));}; \ No newline at end of file +var _0x61c0=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','show','params','keys','length','include','find','create','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','send','index','WhatsappTransferReport','rawAttributes','fieldName','key','model','map','query'];(function(_0x214ac6,_0x3f018e){var _0x5a0703=function(_0x389961){while(--_0x389961){_0x214ac6['push'](_0x214ac6['shift']());}};_0x5a0703(++_0x3f018e);}(_0x61c0,0x1b1));var _0x061c=function(_0x7df8aa,_0x425b33){_0x7df8aa=_0x7df8aa-0x0;var _0x49e41a=_0x61c0[_0x7df8aa];return _0x49e41a;};'use strict';var emlformat=require(_0x061c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x061c('0x1'));var jsonpatch=require(_0x061c('0x2'));var rp=require(_0x061c('0x3'));var moment=require(_0x061c('0x4'));var BPromise=require(_0x061c('0x5'));var Mustache=require(_0x061c('0x6'));var util=require(_0x061c('0x7'));var path=require(_0x061c('0x8'));var sox=require('sox');var csv=require(_0x061c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x061c('0xa'));var _=require(_0x061c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x061c('0xc'));var deskjs=require(_0x061c('0xd'));var toCsv=require(_0x061c('0x9'));var querystring=require('querystring');var Papa=require(_0x061c('0xe'));var Redis=require(_0x061c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x061c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x061c('0x11'));var utils=require('../../config/utils');var config=require(_0x061c('0x12'));var licenseUtil=require(_0x061c('0x13'));var db=require(_0x061c('0x14'))['db'];function respondWithStatusCode(_0xe3b2be,_0x340c2a){_0x340c2a=_0x340c2a||0xcc;return function(_0x1ae3a6){if(_0x1ae3a6){return _0xe3b2be['sendStatus'](_0x340c2a);}return _0xe3b2be[_0x061c('0x15')](_0x340c2a)[_0x061c('0x16')]();};}function respondWithResult(_0x5697eb,_0x8458f6){_0x8458f6=_0x8458f6||0xc8;return function(_0xa5c3ba){if(_0xa5c3ba){return _0x5697eb[_0x061c('0x15')](_0x8458f6)['json'](_0xa5c3ba);}};}function respondWithFilteredResult(_0x2f601e,_0x5a6c77){return function(_0x4cda06){if(_0x4cda06){var _0x4d9cc0=typeof _0x5a6c77['offset']==='undefined'&&typeof _0x5a6c77[_0x061c('0x17')]===_0x061c('0x18');var _0x53fb9e=_0x4cda06[_0x061c('0x19')];var _0x26e192=_0x4d9cc0?0x0:_0x5a6c77[_0x061c('0x1a')];var _0x53bf3a=_0x4d9cc0?_0x4cda06[_0x061c('0x19')]:_0x5a6c77[_0x061c('0x1a')]+_0x5a6c77[_0x061c('0x17')];var _0x544a77;if(_0x53bf3a>=_0x53fb9e){_0x53bf3a=_0x53fb9e;_0x544a77=0xc8;}else{_0x544a77=0xce;}_0x2f601e['status'](_0x544a77);return _0x2f601e[_0x061c('0x1b')](_0x061c('0x1c'),_0x26e192+'-'+_0x53bf3a+'/'+_0x53fb9e)['json'](_0x4cda06);}return null;};}function patchUpdates(_0x3922f0){return function(_0xe023be){try{jsonpatch['apply'](_0xe023be,_0x3922f0,!![]);}catch(_0x3c9bc3){return BPromise[_0x061c('0x1d')](_0x3c9bc3);}return _0xe023be[_0x061c('0x1e')]();};}function saveUpdates(_0x58a511,_0x214fce){return function(_0x5ed451){if(_0x5ed451){return _0x5ed451[_0x061c('0x1f')](_0x58a511)['then'](function(_0x3d38aa){return _0x3d38aa;});}return null;};}function removeEntity(_0x7ecf95,_0x1a6c6d){return function(_0x285cff){if(_0x285cff){return _0x285cff[_0x061c('0x20')]()['then'](function(){_0x7ecf95[_0x061c('0x15')](0xcc)[_0x061c('0x16')]();});}};}function handleEntityNotFound(_0xfc1378,_0x4db328){return function(_0x2073c7){if(!_0x2073c7){_0xfc1378[_0x061c('0x21')](0x194);}return _0x2073c7;};}function handleError(_0x2fa920,_0x2214bb){_0x2214bb=_0x2214bb||0x1f4;return function(_0x325a15){logger['error'](_0x325a15['stack']);if(_0x325a15['name']){delete _0x325a15['name'];}_0x2fa920[_0x061c('0x15')](_0x2214bb)[_0x061c('0x22')](_0x325a15);};}exports[_0x061c('0x23')]=function(_0x3e84fd,_0x51a0a3){var _0x5b7367={},_0x4938bd={},_0x530e1f={'count':0x0,'rows':[]};var _0x2bdedc=_['map'](db[_0x061c('0x24')][_0x061c('0x25')],function(_0x5b8a21){return{'name':_0x5b8a21[_0x061c('0x26')],'type':_0x5b8a21['type'][_0x061c('0x27')]};});_0x4938bd[_0x061c('0x28')]=_[_0x061c('0x29')](_0x2bdedc,'name');_0x4938bd['query']=_['keys'](_0x3e84fd[_0x061c('0x2a')]);_0x4938bd[_0x061c('0x2b')]=_[_0x061c('0x2c')](_0x4938bd[_0x061c('0x28')],_0x4938bd[_0x061c('0x2a')]);_0x5b7367[_0x061c('0x2d')]=_[_0x061c('0x2c')](_0x4938bd[_0x061c('0x28')],qs[_0x061c('0x2e')](_0x3e84fd[_0x061c('0x2a')][_0x061c('0x2e')]));_0x5b7367[_0x061c('0x2d')]=_0x5b7367[_0x061c('0x2d')]['length']?_0x5b7367[_0x061c('0x2d')]:_0x4938bd[_0x061c('0x28')];if(!_0x3e84fd[_0x061c('0x2a')][_0x061c('0x2f')](_0x061c('0x30'))){_0x5b7367['limit']=qs[_0x061c('0x17')](_0x3e84fd[_0x061c('0x2a')][_0x061c('0x17')]);_0x5b7367['offset']=qs['offset'](_0x3e84fd['query'][_0x061c('0x1a')]);}_0x5b7367[_0x061c('0x31')]=qs[_0x061c('0x32')](_0x3e84fd[_0x061c('0x2a')]['sort']);_0x5b7367[_0x061c('0x33')]=qs[_0x061c('0x2b')](_[_0x061c('0x34')](_0x3e84fd['query'],_0x4938bd[_0x061c('0x2b')]),_0x2bdedc);if(_0x3e84fd[_0x061c('0x2a')][_0x061c('0x35')]){_0x5b7367[_0x061c('0x33')]=_['merge'](_0x5b7367[_0x061c('0x33')],{'$or':_['map'](_0x2bdedc,function(_0x1da24a){if(_0x1da24a['type']!==_0x061c('0x36')){var _0x2659e8={};_0x2659e8[_0x1da24a['name']]={'$like':'%'+_0x3e84fd[_0x061c('0x2a')][_0x061c('0x35')]+'%'};return _0x2659e8;}})});}_0x5b7367=_[_0x061c('0x37')]({},_0x5b7367,_0x3e84fd['options']);var _0xc80f42={'where':_0x5b7367['where']};return db['WhatsappTransferReport'][_0x061c('0x19')](_0xc80f42)[_0x061c('0x38')](function(_0x29e18d){_0x530e1f[_0x061c('0x19')]=_0x29e18d;if(_0x3e84fd[_0x061c('0x2a')][_0x061c('0x39')]){_0x5b7367['include']=[{'all':!![]}];}return db[_0x061c('0x24')]['findAll'](_0x5b7367);})[_0x061c('0x38')](function(_0x540c9d){_0x530e1f['rows']=_0x540c9d;return _0x530e1f;})[_0x061c('0x38')](respondWithFilteredResult(_0x51a0a3,_0x5b7367))['catch'](handleError(_0x51a0a3,null));};exports[_0x061c('0x3a')]=function(_0x5283ac,_0x495d24){var _0x32a4e3={'raw':!![],'where':{'id':_0x5283ac[_0x061c('0x3b')]['id']}},_0x350e36={};_0x350e36[_0x061c('0x28')]=_[_0x061c('0x3c')](db[_0x061c('0x24')][_0x061c('0x25')]);_0x350e36['query']=_['keys'](_0x5283ac[_0x061c('0x2a')]);_0x350e36[_0x061c('0x2b')]=_['intersection'](_0x350e36[_0x061c('0x28')],_0x350e36[_0x061c('0x2a')]);_0x32a4e3['attributes']=_[_0x061c('0x2c')](_0x350e36['model'],qs[_0x061c('0x2e')](_0x5283ac[_0x061c('0x2a')][_0x061c('0x2e')]));_0x32a4e3[_0x061c('0x2d')]=_0x32a4e3['attributes'][_0x061c('0x3d')]?_0x32a4e3[_0x061c('0x2d')]:_0x350e36[_0x061c('0x28')];if(_0x5283ac[_0x061c('0x2a')][_0x061c('0x39')]){_0x32a4e3[_0x061c('0x3e')]=[{'all':!![]}];}_0x32a4e3=_[_0x061c('0x37')]({},_0x32a4e3,_0x5283ac['options']);return db[_0x061c('0x24')][_0x061c('0x3f')](_0x32a4e3)[_0x061c('0x38')](handleEntityNotFound(_0x495d24,null))[_0x061c('0x38')](respondWithResult(_0x495d24,null))['catch'](handleError(_0x495d24,null));};exports[_0x061c('0x40')]=function(_0x14e26c,_0x6418f3){return db[_0x061c('0x24')]['create'](_0x14e26c['body'],{})['then'](respondWithResult(_0x6418f3,0xc9))[_0x061c('0x41')](handleError(_0x6418f3,null));};exports['update']=function(_0x389851,_0x3d13fd){if(_0x389851[_0x061c('0x42')]['id']){delete _0x389851[_0x061c('0x42')]['id'];}return db[_0x061c('0x24')][_0x061c('0x3f')]({'where':{'id':_0x389851[_0x061c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3d13fd,null))['then'](saveUpdates(_0x389851[_0x061c('0x42')],null))[_0x061c('0x38')](respondWithResult(_0x3d13fd,null))[_0x061c('0x41')](handleError(_0x3d13fd,null));};exports[_0x061c('0x20')]=function(_0x155eeb,_0x52b1bc){return db[_0x061c('0x24')]['find']({'where':{'id':_0x155eeb[_0x061c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x52b1bc,null))[_0x061c('0x38')](removeEntity(_0x52b1bc,null))[_0x061c('0x41')](handleError(_0x52b1bc,null));};exports['describe']=function(_0x29cb4f,_0x45234e){return db[_0x061c('0x24')][_0x061c('0x43')]()[_0x061c('0x38')](respondWithResult(_0x45234e,null))[_0x061c('0x41')](handleError(_0x45234e,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 241c457..234368e 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 _0x3824=['path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','api','bluebird'];(function(_0x1cf67b,_0x497ea5){var _0x3ed38f=function(_0x256c2e){while(--_0x256c2e){_0x1cf67b['push'](_0x1cf67b['shift']());}};_0x3ed38f(++_0x497ea5);}(_0x3824,0x147));var _0x4382=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x3824[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0x4382('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4382('0x1'));var moment=require('moment');var BPromise=require(_0x4382('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4382('0x3'));var rimraf=require(_0x4382('0x4'));var config=require('../../config/environment');var attributes=require(_0x4382('0x5'));module[_0x4382('0x6')]=function(_0x3c675b,_0x14edd9){return _0x3c675b[_0x4382('0x7')](_0x4382('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x4382('0x9'),'fields':[_0x4382('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3539=['./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0xcefa00,_0x270c24){var _0x2a1bde=function(_0x88f061){while(--_0x88f061){_0xcefa00['push'](_0xcefa00['shift']());}};_0x2a1bde(++_0x270c24);}(_0x3539,0x9f));var _0x9353=function(_0x1e5b37,_0xca4d6d){_0x1e5b37=_0x1e5b37-0x0;var _0x24a311=_0x3539[_0x1e5b37];return _0x24a311;};'use strict';var _=require(_0x9353('0x0'));var util=require('util');var logger=require(_0x9353('0x1'))('api');var moment=require(_0x9353('0x2'));var BPromise=require('bluebird');var rp=require(_0x9353('0x3'));var fs=require('fs');var path=require(_0x9353('0x4'));var rimraf=require(_0x9353('0x5'));var config=require('../../config/environment');var attributes=require(_0x9353('0x6'));module[_0x9353('0x7')]=function(_0x51a109,_0x5a6b98){return _0x51a109['define'](_0x9353('0x8'),attributes,{'tableName':_0x9353('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9353('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index f3242f1..423e9b2 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 _0xc84d=['WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0xc84d,0x114));var _0xdc84=function(_0x4456f5,_0x1b0bad){_0x4456f5=_0x4456f5-0x0;var _0x46e916=_0xc84d[_0x4456f5];return _0x46e916;};'use strict';var _=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var moment=require('moment');var BPromise=require(_0xdc84('0x2'));var rs=require(_0xdc84('0x3'));var fs=require('fs');var Redis=require(_0xdc84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc84('0x5'));var logger=require('../../config/logger')(_0xdc84('0x6'));var config=require(_0xdc84('0x7'));var jayson=require(_0xdc84('0x8'));var client=jayson[_0xdc84('0x9')][_0xdc84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c45f,_0x145ac9,_0x40ffcd){return new BPromise(function(_0x36c1bd,_0x2e3e36){return client['request'](_0x51c45f,_0x40ffcd)['then'](function(_0x1e40c2){logger[_0xdc84('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x145ac9,_0xdc84('0xc'));logger[_0xdc84('0xd')](_0xdc84('0xe'),_0x145ac9,_0xdc84('0xc'),JSON[_0xdc84('0xf')](_0x1e40c2));if(_0x1e40c2[_0xdc84('0x10')]){if(_0x1e40c2[_0xdc84('0x10')][_0xdc84('0x11')]===0x1f4){logger[_0xdc84('0x10')](_0xdc84('0x12'),_0x145ac9,_0x1e40c2['error'][_0xdc84('0x13')]);return _0x2e3e36(_0x1e40c2['error'][_0xdc84('0x13')]);}logger['error'](_0xdc84('0x12'),_0x145ac9,_0x1e40c2[_0xdc84('0x10')][_0xdc84('0x13')]);return _0x36c1bd(_0x1e40c2['error'][_0xdc84('0x13')]);}else{logger[_0xdc84('0xb')](_0xdc84('0x12'),_0x145ac9,'request\x20sent');_0x36c1bd(_0x1e40c2[_0xdc84('0x14')]['message']);}})['catch'](function(_0x192cb1){logger[_0xdc84('0x10')](_0xdc84('0x12'),_0x145ac9,_0x192cb1);_0x2e3e36(_0x192cb1);});});} \ No newline at end of file +var _0x07f8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x154f01,_0x559671){var _0x44546f=function(_0x1172b6){while(--_0x1172b6){_0x154f01['push'](_0x154f01['shift']());}};_0x44546f(++_0x559671);}(_0x07f8,0x94));var _0x807f=function(_0x290467,_0x3b4b10){_0x290467=_0x290467-0x0;var _0x188ebb=_0x07f8[_0x290467];return _0x188ebb;};'use strict';var _=require(_0x807f('0x0'));var util=require(_0x807f('0x1'));var moment=require(_0x807f('0x2'));var BPromise=require(_0x807f('0x3'));var rs=require(_0x807f('0x4'));var fs=require('fs');var Redis=require(_0x807f('0x5'));var db=require(_0x807f('0x6'))['db'];var utils=require(_0x807f('0x7'));var logger=require(_0x807f('0x8'))(_0x807f('0x9'));var config=require(_0x807f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x807f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbc4c4c,_0x151661,_0x31f1d0){return new BPromise(function(_0x5b1eab,_0x2632a5){return client[_0x807f('0xc')](_0xbc4c4c,_0x31f1d0)['then'](function(_0x479bf8){logger['info'](_0x807f('0xd'),_0x151661,_0x807f('0xe'));logger[_0x807f('0xf')](_0x807f('0x10'),_0x151661,_0x807f('0xe'),JSON['stringify'](_0x479bf8));if(_0x479bf8['error']){if(_0x479bf8[_0x807f('0x11')]['code']===0x1f4){logger[_0x807f('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x151661,_0x479bf8[_0x807f('0x11')]['message']);return _0x2632a5(_0x479bf8['error'][_0x807f('0x12')]);}logger['error'](_0x807f('0xd'),_0x151661,_0x479bf8[_0x807f('0x11')]['message']);return _0x5b1eab(_0x479bf8[_0x807f('0x11')]['message']);}else{logger[_0x807f('0x13')](_0x807f('0xd'),_0x151661,_0x807f('0xe'));_0x5b1eab(_0x479bf8['result'][_0x807f('0x12')]);}})[_0x807f('0x14')](function(_0x5887b8){logger['error'](_0x807f('0xd'),_0x151661,_0x5887b8);_0x2632a5(_0x5887b8);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 98ae006..2106834 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f2e=['info','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','listen','start'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x2f2e,0x146));var _0xe2f2=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x2f2e[_0x147497];return _0x35f45;};'use strict';var _=require('lodash');var db=require(_0xe2f2('0x0'))['db'];var seedDb=require(_0xe2f2('0x1'));var checkLicense=require('./config/license');var rpc=require(_0xe2f2('0x2'));var config=require('./config/environment');var logger=require(_0xe2f2('0x3'))(_0xe2f2('0x4'));var pm2=require(_0xe2f2('0x5'));var pm2Config=require(_0xe2f2('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xe2f2('0x7'));var provider=require(_0xe2f2('0x8'));function main(){return db[_0xe2f2('0x9')][_0xe2f2('0xa')]()['then'](function(){if(config['seedDB']){return seedDb['default']();}})[_0xe2f2('0xb')](function(){return checkLicense['default']();})[_0xe2f2('0xb')](function(){return rpc[_0xe2f2('0xc')]();})[_0xe2f2('0xb')](function(_0x7ab967){logger['info'](_0x7ab967);return chat[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return whatsapp['start']();})[_0xe2f2('0xb')](function(){return schedule[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return transcribe[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(){return provider[_0xe2f2('0xd')]();})[_0xe2f2('0xb')](function(_0x47525f){logger[_0xe2f2('0xe')](_0x47525f);return pm2[_0xe2f2('0xd')](pm2Config);})['then'](function(_0x3bfa74){var _0x375fc0=_0x3bfa74[_0xe2f2('0xf')](function(_0x45cd29){return typeof _0x45cd29[_0xe2f2('0x10')]==='number'&&_0x45cd29['exitCode']>=0x0;});if(_0x375fc0[_0xe2f2('0x11')]>0x0){throw new Error(_0x375fc0[_0xe2f2('0x11')]+_0xe2f2('0x12')+_['map'](_0x375fc0,function(_0x86c42b){return'\x22'+_0x86c42b[_0xe2f2('0x13')][_0xe2f2('0x14')]+'\x22';}));}logger['info'](_0xe2f2('0x15'),_[_0xe2f2('0x16')](_[_0xe2f2('0xf')](_0x3bfa74,{'status':_0xe2f2('0x17')}),_0xe2f2('0x14'))[_0xe2f2('0x18')]());logger['info'](_0xe2f2('0x19'),_[_0xe2f2('0x16')](_[_0xe2f2('0xf')](_0x3bfa74,function(_0x596dd9){return _0x596dd9[_0xe2f2('0x1a')]!==_0xe2f2('0x17');}),_0xe2f2('0x14'))[_0xe2f2('0x18')]()||_0xe2f2('0x1b'));console[_0xe2f2('0x1c')](_0xe2f2('0x1d'));})['catch'](function(_0x2d3b5d){console[_0xe2f2('0x1c')](_0xe2f2('0x1e'),_0x2d3b5d);logger[_0xe2f2('0x1f')](_0xe2f2('0x20'),_0x2d3b5d);process[_0xe2f2('0x21')](0x1);});}main(); \ No newline at end of file +var _0xf8ee=['default','listen','info','start','filter','exitCode','length','map','name','Online\x20apps:','online','join','Offline\x20apps:','None','log','App\x20Ready!','catch','error','exit','core-js/web','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xf8ee,0x169));var _0xef8e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf8ee[_0x122ef9];return _0x42fba0;};'use strict';require(_0xef8e('0x0'));var _=require(_0xef8e('0x1'));var db=require('./mysqldb')['db'];var seedDb=require(_0xef8e('0x2'));var checkLicense=require(_0xef8e('0x3'));var rpc=require(_0xef8e('0x4'));var config=require(_0xef8e('0x5'));var logger=require(_0xef8e('0x6'))(_0xef8e('0x7'));var pm2=require(_0xef8e('0x8'));var pm2Config=require(_0xef8e('0x9'));var schedule=require(_0xef8e('0xa'));var chat=require(_0xef8e('0xb'));var whatsapp=require(_0xef8e('0xc'));var transcribe=require(_0xef8e('0xd'));var provider=require(_0xef8e('0xe'));function main(){return db[_0xef8e('0xf')][_0xef8e('0x10')]()[_0xef8e('0x11')](function(){if(config[_0xef8e('0x12')]){return seedDb[_0xef8e('0x13')]();}})[_0xef8e('0x11')](function(){return checkLicense[_0xef8e('0x13')]();})['then'](function(){return rpc[_0xef8e('0x14')]();})[_0xef8e('0x11')](function(_0x4443de){logger[_0xef8e('0x15')](_0x4443de);return chat[_0xef8e('0x16')]();})['then'](function(){return whatsapp[_0xef8e('0x16')]();})['then'](function(){return schedule[_0xef8e('0x16')]();})[_0xef8e('0x11')](function(){return transcribe[_0xef8e('0x16')]();})[_0xef8e('0x11')](function(){return provider[_0xef8e('0x16')]();})[_0xef8e('0x11')](function(_0x32f8e0){logger[_0xef8e('0x15')](_0x32f8e0);return pm2[_0xef8e('0x16')](pm2Config);})[_0xef8e('0x11')](function(_0x47969f){var _0x39f3bd=_0x47969f[_0xef8e('0x17')](function(_0x1a9a7d){return typeof _0x1a9a7d[_0xef8e('0x18')]==='number'&&_0x1a9a7d[_0xef8e('0x18')]>=0x0;});if(_0x39f3bd[_0xef8e('0x19')]>0x0){throw new Error(_0x39f3bd[_0xef8e('0x19')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xef8e('0x1a')](_0x39f3bd,function(_0x1a1855){return'\x22'+_0x1a1855['pm2_env'][_0xef8e('0x1b')]+'\x22';}));}logger[_0xef8e('0x15')](_0xef8e('0x1c'),_[_0xef8e('0x1a')](_[_0xef8e('0x17')](_0x47969f,{'status':_0xef8e('0x1d')}),_0xef8e('0x1b'))[_0xef8e('0x1e')]());logger[_0xef8e('0x15')](_0xef8e('0x1f'),_[_0xef8e('0x1a')](_[_0xef8e('0x17')](_0x47969f,function(_0x1fe981){return _0x1fe981['status']!==_0xef8e('0x1d');}),_0xef8e('0x1b'))[_0xef8e('0x1e')]()||_0xef8e('0x20'));console[_0xef8e('0x21')](_0xef8e('0x22'));})[_0xef8e('0x23')](function(_0x171a07){console[_0xef8e('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x171a07);logger[_0xef8e('0x24')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x171a07);process[_0xef8e('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index e15b2e9..a162f5e 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 _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','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.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x276279,_0x3f12ce){var _0x125071=function(_0x245a60){while(--_0x245a60){_0x276279['push'](_0x276279['shift']());}};_0x125071(++_0x3f12ce);}(_0xa41a,0x6b));var _0xaa41=function(_0x16cf18,_0x248d91){_0x16cf18=_0x16cf18-0x0;var _0xe9f480=_0xa41a[_0x16cf18];return _0xe9f480;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file +var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','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.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0xcaa268,_0x1e5ad1){var _0xa94049=function(_0x19423f){while(--_0x19423f){_0xcaa268['push'](_0xcaa268['shift']());}};_0xa94049(++_0x1e5ad1);}(_0xa41a,0x6b));var _0xaa41=function(_0x1c0641,_0xa326ee){_0x1c0641=_0x1c0641-0x0;var _0x48054d=_0xa41a[_0x1c0641];return _0x48054d;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 2f9a114..ac77e7c 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 _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x20ae13,_0x2a0c8e){var _0x533fd5=function(_0x3bb746){while(--_0x3bb746){_0x20ae13['push'](_0x20ae13['shift']());}};_0x533fd5(++_0x2a0c8e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file +var _0xbaf0=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','startsWith','slice','length','cf_','type','map','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','clause','tags','user'];(function(_0x41159b,_0x18ae88){var _0x5bea4e=function(_0x95177e){while(--_0x95177e){_0x41159b['push'](_0x41159b['shift']());}};_0x5bea4e(++_0x18ae88);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var sqlUtils=require(_0x0baf('0x0'));var db=require(_0x0baf('0x1'))['db'];exports[_0x0baf('0x2')]=function(_0x263f79,_0x1688bc,_0x4d2e72,_0x5a3e42){var _0x232cc7={'count':0x0,'rows':[]};var _0x1c383e=sqlUtils[_0x0baf('0x3')](_0x1688bc,_0x263f79);if(_0x1c383e){return Promise[_0x0baf('0x4')](_0x232cc7);}var _0xe4c3c4=sqlUtils[_0x0baf('0x5')]();var _0x1a10b1={};var _0x2dcaac=![];var _0x1d0a0d=![];return Promise['resolve']()[_0x0baf('0x6')](function(){if(_0x263f79['search']){return sqlUtils[_0x0baf('0x7')](_0x263f79[_0x0baf('0x8')],_0x5a3e42);}else{return sqlUtils[_0x0baf('0x9')](_0x263f79,_0x5a3e42);}})[_0x0baf('0x6')](function(_0x7f54d4){_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xb')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xc')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xd')]);_0xe4c3c4['where'](_0x7f54d4['user'][_0x0baf('0xe')]);_0x1a10b1=_0x7f54d4[_0x0baf('0xf')];_0x1d0a0d=_0x7f54d4[_0x0baf('0x10')][_0x0baf('0x11')];return sqlUtils['checkListsRestrictions'](_0x1688bc,_0x263f79,_0x1d0a0d);})[_0x0baf('0x6')](function(_0x49e44b){_0xe4c3c4[_0x0baf('0xa')](_0x49e44b);var _0x1f50c3=_0x263f79[_0x0baf('0x8')]?_0x1a10b1[_0x0baf('0x12')]:_0x263f79[_0x0baf('0x13')];_0x2dcaac=_0x1f50c3?!![]:![];return sqlUtils[_0x0baf('0x14')](_0xe4c3c4,_0x1f50c3);})['then'](function(_0x4cd79d){_0x232cc7[_0x0baf('0x15')]=_0x4cd79d;if(_0x232cc7[_0x0baf('0x15')]===0x0){return;}return sqlUtils[_0x0baf('0x16')](_0xe4c3c4,_0x263f79[_0x0baf('0xc')],_0x4d2e72,_0x2dcaac,_0x1a10b1[_0x0baf('0xe')],_0x1d0a0d);})[_0x0baf('0x6')](function(_0x53c338){if(!_0x53c338){return[];}return sqlUtils[_0x0baf('0x17')](_0x53c338,_0x263f79,_0x4d2e72);})[_0x0baf('0x6')](function(_0x1ef0e5){_0x232cc7[_0x0baf('0x18')]=_0x1ef0e5;return _0x232cc7;})[_0x0baf('0x19')](function(_0x42b7f2){throw _0x42b7f2;});};exports['describe']=function(){var _0x5cff5d={};var _0x1410ec=[];return db[_0x0baf('0x1a')][_0x0baf('0x1b')]()[_0x0baf('0x6')](function(_0x1fa92b){_0x5cff5d=_0x1fa92b;var _0x3e3e20=Object[_0x0baf('0x1c')](_0x5cff5d)[_0x0baf('0xd')](function(_0x2c42e2){return _[_0x0baf('0x1d')](_0x2c42e2,'cf_')?_0x2c42e2:undefined;});var _0x334bd6=_0x3e3e20['map'](function(_0xf6c158){return db['CmCustomField']['findOne']({'where':{'id':_0xf6c158[_0x0baf('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x334bd6);})['then'](function(_0x47c4b){for(var _0x27b59c=0x0;_0x27b59c<_0x47c4b[_0x0baf('0x1f')];_0x27b59c++){if(_0x47c4b[_0x27b59c]){var _0x19d9fd=_0x0baf('0x20')+_0x47c4b[_0x27b59c]['id'];_0x5cff5d[_0x19d9fd]['fieldType']=_0x47c4b[_0x27b59c][_0x0baf('0x21')];}}_0x1410ec=_[_0x0baf('0x22')](Object[_0x0baf('0x1c')](_0x5cff5d),function(_0x366e71){return{'name':_0x366e71,'type':_0x5cff5d[_0x366e71][_0x0baf('0x21')]};});return _0x1410ec;})[_0x0baf('0x19')](function(_0x453525){throw _0x453525;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index dd5a59f..5708215 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 _0x6d51=['limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','Sequelize','CmContact','sequelize','query','Tags','clone','COUNT(*)','t.id\x20IN\x20?','QueryTypes','SELECT','exports','lodash','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','cm_contacts','where','left_join','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','email','CompanyId','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','default','start','value','end','map','tags','clause','User','and','user','skip','keys','some','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','agent','getLists','c.ListId\x20IS\x20NULL','select','group'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x6d51,0xe2));var _0x16d5=function(_0x165524,_0x1e12c5){_0x165524=_0x165524-0x0;var _0x185d38=_0x6d51[_0x165524];return _0x185d38;};'use strict';var _=require(_0x16d5('0x0'));var squel=require('squel');var as=require(_0x16d5('0x1'));var qs=require('../parsers/qs');var utils=require(_0x16d5('0x2'));var db=require(_0x16d5('0x3'))['db'];function skipContactsQuery(_0x540f21,_0x1eb3bb){var _0x17a9e3=![];if(_0x540f21[_0x16d5('0x4')]==='agent'&&!_0x1eb3bb[_0x16d5('0x5')]&&!_0x1eb3bb[_0x16d5('0x6')]&&_0x1eb3bb[_0x16d5('0x7')]!==_0x16d5('0x8')){_0x17a9e3=!![];}return _0x17a9e3;}function getContactsSubquery(){return squel['select']()['from'](_0x16d5('0x9'),'c')[_0x16d5('0xa')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0xd1030e,_0x526a46){var _0x58aa80=_0x526a46?'c':'subqry';_0xd1030e[_0x16d5('0xb')]('cm_user_has_contacts','uc',_0x16d5('0xc')+_0x58aa80+_0x16d5('0xd'))['left_join']('cm_contact_has_tags','ct',_0x16d5('0xe')+_0x58aa80+_0x16d5('0xd'))[_0x16d5('0xb')](_0x16d5('0xf'),'t',_0x16d5('0x10'));return _0xd1030e;}function addFieldsToQuery(_0x4966d6,_0xe4d32d,_0x3c0896,_0x239d05,_0x570782){var _0x2dd41a=_0x570782?'c':_0x16d5('0x11');if(!_0xe4d32d){_0xe4d32d=['id',_0x16d5('0x12'),_0x16d5('0x13'),_0x16d5('0x14'),_0x16d5('0x15'),'fax',_0x16d5('0x16'),_0x16d5('0x6'),_0x16d5('0x17'),'createdAt','updatedAt','deletedAt',_0x16d5('0x18')];}else if(!_0xe4d32d[_0x16d5('0x19')]('id')){_0xe4d32d[_0x16d5('0x1a')]('id');}var _0xca526f=_0x3c0896&&_0x570782||!_0x3c0896&&!_0x570782;if(_0x239d05){_0xca526f=_0x239d05&&_0x570782||!_0x239d05&&!_0x570782;}_0xe4d32d['forEach'](function(_0x5efa79){if(_0x5efa79===_0x16d5('0x18')){if(_0xca526f){_0x4966d6[_0x16d5('0x1b')](_0x16d5('0x1c'),_0x5efa79);}else if(_0x3c0896||_0x239d05){_0x4966d6['field'](_0x2dd41a+'.'+_0x5efa79);}}else{_0x4966d6[_0x16d5('0x1b')](_0x2dd41a+'.'+_0x5efa79);}});return _0x4966d6;}function getSqlClauses(){var _0x580917={'default':squel[_0x16d5('0x1d')](),'fields':squel[_0x16d5('0x1d')](),'filter':squel[_0x16d5('0x1d')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x580917;}function parseTagParameter(_0x2e06f8){var _0x41e7d3=squel['expr']();if(_0x2e06f8){var _0x43192f=utils[_0x16d5('0x1e')](_0x2e06f8);_0x43192f[_0x16d5('0x1f')](function(_0x457457){_0x41e7d3['or'](_0x16d5('0x20'),'%,'+_0x457457+',%');});}return _0x41e7d3;}function parseSearchFilter(_0x42262c){var _0x58b950=squel['expr']();if(_0x42262c){var _0x3eb6ff=_0x42262c[_0x16d5('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x3eb6ff[_0x16d5('0x22')]('\x20')['length']>0x1){_0x58b950['or'](_0x16d5('0x23'),qs[_0x16d5('0x24')](_0x3eb6ff),null);}else{if(qs[_0x16d5('0x25')](_0x3eb6ff)){_0x58b950['or'](_0x16d5('0x26'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x27'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x28'),_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x29'),_0x3eb6ff+'%');}else if(qs['isEmail'](_0x3eb6ff)){_0x58b950['or']('c.email\x20LIKE\x20?',_0x3eb6ff+'%');}else{_0x58b950['or']('c.firstName\x20LIKE\x20?','%'+_0x3eb6ff+'%');_0x58b950['or']('c.lastName\x20LIKE\x20?','%'+_0x3eb6ff+'%');_0x58b950['or'](_0x16d5('0x2a'),'%'+_0x3eb6ff+'%');}}}return _0x58b950;}function parseAdvancedSearchFilter(_0xd3f29b,_0x4e2c60){var _0x2ef336=getSqlClauses();var _0x18c718=as[_0x16d5('0x2b')](_0xd3f29b);var _0x160017=_0x18c718[_0x16d5('0x2c')];for(var _0x188d43=0x0;_0x188d43<_0x18c718[_0x16d5('0x2d')][_0x16d5('0x2e')];_0x188d43++){var _0x8e029b=_0x18c718['conditions'][_0x188d43];var _0x4624d0='c';var _0xbbe065=_[_0x16d5('0x2f')](_0x4e2c60,[_0x16d5('0x30'),_0x8e029b[_0x16d5('0x1b')]]);if(_0xbbe065){if(_0x8e029b[_0x16d5('0x1b')]==='dateOfBirth'||_0xbbe065[_0x16d5('0x31')]===_0x16d5('0x32')){_0x8e029b[_0x16d5('0x33')]=_0x16d5('0x34');}var _0x41fc2c=as[_0x16d5('0x35')](_0x4624d0,_0xbbe065[_0x16d5('0x36')],_0x8e029b);_0x2ef336[_0x16d5('0x37')][_0x160017](_0x41fc2c['text'],_0x41fc2c['value'][_0x16d5('0x38')],_0x41fc2c[_0x16d5('0x39')][_0x16d5('0x3a')]);}else{if(_0x8e029b[_0x16d5('0x1b')]==='Tag'){var _0x3547d4=_0x8e029b[_0x16d5('0x39')][_0x16d5('0x22')](',')[_0x16d5('0x3b')](function(_0x81ec77){return Number(_0x81ec77);});var _0x53d74d=parseTagParameter(_0x3547d4);_0x2ef336[_0x16d5('0x3c')][_0x16d5('0x3d')]['and'](_0x53d74d);_0x2ef336[_0x16d5('0x3c')]['ids']=_0x3547d4;}else if(_0x8e029b[_0x16d5('0x1b')]===_0x16d5('0x3e')){_0x2ef336['user'][_0x16d5('0x3d')][_0x16d5('0x3f')]('uc.UserId\x20=\x20?',_0x8e029b[_0x16d5('0x39')]);_0x2ef336[_0x16d5('0x40')][_0x16d5('0x41')]=!![];}}}return _0x2ef336;}function parseModelFields(_0xca9e4d,_0x51f276){var _0x31d31c=squel[_0x16d5('0x1d')]();var _0x3c5b0a=_(_0xca9e4d)[_0x16d5('0x42')]()[_0x16d5('0x3b')](function(_0x266c90){return _[_0x16d5('0x43')](_0x51f276,[_0x16d5('0x30'),_0x266c90])?_0x266c90:undefined;})[_0x16d5('0x44')]()[_0x16d5('0x39')]();if(_0xca9e4d['Contact']){_0x3c5b0a['push'](_0x16d5('0x45'));}if(_0x3c5b0a[_0x16d5('0x2e')]>0x0){_0x3c5b0a[_0x16d5('0x1f')](function(_0x18f8dc){if(_0x18f8dc===_0x16d5('0x6')){_0x31d31c[_0x16d5('0x3f')](_0x16d5('0x46'),[][_0x16d5('0x47')](_0xca9e4d[_0x18f8dc]));}else if(_0x18f8dc==='Contact'){var _0x557102='%'+_0xca9e4d[_0x18f8dc]+'%';_0x31d31c[_0x16d5('0x3f')](_0x16d5('0x48'),_0x557102);}else{_0x31d31c[_0x16d5('0x3f')]('c.'+_0x18f8dc+_0x16d5('0x49'),_0xca9e4d[_0x18f8dc]);}});}return _0x31d31c;}function parseQueryParameters(_0x5cb90a,_0x222159){var _0x469e6e=getSqlClauses();return Promise[_0x16d5('0x4a')]()[_0x16d5('0x4b')](function(){return parseModelFields(_0x5cb90a,_0x222159);})[_0x16d5('0x4b')](function(_0x414979){_0x469e6e[_0x16d5('0x4c')][_0x16d5('0x3f')](_0x414979);return parseTagParameter(_0x5cb90a[_0x16d5('0x4d')]);})['then'](function(_0x392a79){_0x469e6e[_0x16d5('0x3c')][_0x16d5('0x3d')][_0x16d5('0x3f')](_0x392a79);return parseSearchFilter(_0x5cb90a['filter']);})[_0x16d5('0x4b')](function(_0x271cb4){_0x469e6e['filter']=_0x271cb4;return _0x469e6e;});}function checkListsRestrictions(_0x5f5c6c,_0xfdce15,_0xeb6c44){var _0x492bd4=squel[_0x16d5('0x1d')]();return Promise[_0x16d5('0x4a')]()['then'](function(){if(_0xfdce15[_0x16d5('0x5')]&&_0x5f5c6c[_0x16d5('0x4')]===_0x16d5('0x4e')&&!_0xeb6c44){return _0x5f5c6c[_0x16d5('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0x16d5('0x4b')](function(_0x66ba49){if(_0x66ba49){if(_0x66ba49[_0x16d5('0x2e')]===0x0){_0x492bd4[_0x16d5('0x3f')](_0x16d5('0x50'));}else{_0x492bd4[_0x16d5('0x3f')]('c.ListId\x20IN\x20?',_['map'](_0x66ba49,'id'));}}})['then'](function(){return _0x492bd4;});}function buildContactsQuery(_0xb3cbad,_0x53edbc,_0x5bc27c,_0x1175e2,_0x51e561,_0x43cef7){if(_0x53edbc){_0x53edbc=_0x5bc27c['attributes'];}_0xb3cbad=addFieldsToQuery(_0xb3cbad,_0x53edbc,_0x1175e2,_0x43cef7,!![]);var _0x2d5d8e=squel[_0x16d5('0x51')]();_0x2d5d8e=addFieldsToQuery(_0x2d5d8e,_0x53edbc,_0x1175e2,_0x43cef7,![]);if(_0x1175e2||_0x43cef7){_0xb3cbad=applyJoinClauses(_0xb3cbad,!![]);_0xb3cbad[_0x16d5('0x52')]('c.id');if(_0x5bc27c[_0x16d5('0x53')]){_0x2d5d8e[_0x16d5('0x53')](_0x5bc27c[_0x16d5('0x53')]);}if(_0x5bc27c[_0x16d5('0x54')]){_0x2d5d8e['offset'](_0x5bc27c[_0x16d5('0x54')]);}}else{_0x2d5d8e=applyJoinClauses(_0x2d5d8e,![]);_0x2d5d8e[_0x16d5('0x52')](_0x16d5('0x55'));if(_0x5bc27c[_0x16d5('0x53')]){_0xb3cbad[_0x16d5('0x53')](_0x5bc27c[_0x16d5('0x53')]);}if(_0x5bc27c[_0x16d5('0x54')]){_0xb3cbad[_0x16d5('0x54')](_0x5bc27c[_0x16d5('0x54')]);}}_0x2d5d8e[_0x16d5('0x56')](_0x51e561);if(_0x5bc27c[_0x16d5('0x57')]){_0x5bc27c[_0x16d5('0x57')][_0x16d5('0x1f')](function(_0x40c4a4){_0xb3cbad[_0x16d5('0x57')]('c.'+_0x40c4a4[0x0],_0x40c4a4[0x1]===_0x16d5('0x58')?![]:!![]);_0x2d5d8e[_0x16d5('0x57')](_0x16d5('0x59')+_0x40c4a4[0x0],_0x40c4a4[0x1]==='DESC'?![]:!![]);});}_0x2d5d8e['from'](_0xb3cbad,_0x16d5('0x11'));return _0x2d5d8e;}function getFilteredContacts(_0x5902cb){var _0x4f66ac=[];return db[_0x16d5('0x5a')][_0x16d5('0x5b')]({'attributes':['id',_0x16d5('0x30'),'color'],'raw':!![]})[_0x16d5('0x4b')](function(_0x5d6c82){_0x4f66ac=_['keyBy'](_0x5d6c82,'id');var _0x405905={'type':db[_0x16d5('0x5c')]['QueryTypes']['SELECT'],'model':db[_0x16d5('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x16d5('0x5e')][_0x16d5('0x5f')](_0x5902cb['toString'](),_0x405905);})[_0x16d5('0x4b')](function(_0x1bee1b){_0x1bee1b[_0x16d5('0x1f')](function(_0x5ab336){if(_0x5ab336[_0x16d5('0x18')]){_0x5ab336['Tags']=[];_0x5ab336[_0x16d5('0x18')][_0x16d5('0x22')](',')[_0x16d5('0x1f')](function(_0x2cbaec){_0x5ab336[_0x16d5('0x60')][_0x16d5('0x1a')](_0x4f66ac[_0x2cbaec]);});}delete _0x5ab336[_0x16d5('0x18')];});return _0x1bee1b;});}function countFilteredContacts(_0x2eb7a0,_0x241919){var _0x5494dc=_0x2eb7a0[_0x16d5('0x61')]();_0x5494dc['field'](_0x16d5('0x62'));_0x5494dc=applyJoinClauses(_0x5494dc,!![]);_0x2eb7a0[_0x16d5('0x52')]('c.id');var _0x162f17=utils['getSelectedTags'](_0x241919);if(!_['isEmpty'](_0x162f17)){_0x5494dc[_0x16d5('0xa')](_0x16d5('0x63'),_0x162f17);}var _0x2f6b62={'type':db['Sequelize'][_0x16d5('0x64')][_0x16d5('0x65')],'raw':!![]};return db[_0x16d5('0x5e')][_0x16d5('0x5f')](_0x5494dc['toString'](),_0x2f6b62)[_0x16d5('0x4b')](function(_0x1208e0){return _0x1208e0[0x0][_0x16d5('0x62')];});}module[_0x16d5('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x48fc=['ids','User','user','uc.UserId\x20=\x20?','skip','some','name','Contact','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','Sequelize','SELECT','sequelize','toString','TagIds','Tags','clone','c.id','getSelectedTags','isEmpty','t.id\x20IN\x20?','QueryTypes','query','COUNT(*)','exports','lodash','squel','../parsers/qs','../../mysqldb','role','agent','ListId','autocomplete','true','select','from','where','c.deletedAt\x20IS\x20NULL','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','fax','email','CompanyId','updatedAt','deletedAt','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','dateOfBirth','fieldType','castTo','type','default','text','start','value','end','Tag','map','tags','clause','and'];(function(_0x38b724,_0x5b95f4){var _0x53738f=function(_0x5292d8){while(--_0x5292d8){_0x38b724['push'](_0x38b724['shift']());}};_0x53738f(++_0x5b95f4);}(_0x48fc,0x98));var _0xc48f=function(_0x2b3bec,_0x5bf441){_0x2b3bec=_0x2b3bec-0x0;var _0x8ea2a6=_0x48fc[_0x2b3bec];return _0x8ea2a6;};'use strict';var _=require(_0xc48f('0x0'));var squel=require(_0xc48f('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xc48f('0x2'));var utils=require('../interaction/utils');var db=require(_0xc48f('0x3'))['db'];function skipContactsQuery(_0x3ccc44,_0x3a18f6){var _0x306937=![];if(_0x3ccc44[_0xc48f('0x4')]===_0xc48f('0x5')&&!_0x3a18f6['search']&&!_0x3a18f6[_0xc48f('0x6')]&&_0x3a18f6[_0xc48f('0x7')]!==_0xc48f('0x8')){_0x306937=!![];}return _0x306937;}function getContactsSubquery(){return squel[_0xc48f('0x9')]()[_0xc48f('0xa')]('cm_contacts','c')[_0xc48f('0xb')](_0xc48f('0xc'));}function applyJoinClauses(_0xe23b92,_0x573ccf){var _0x336a0d=_0x573ccf?'c':'subqry';_0xe23b92['left_join'](_0xc48f('0xd'),'uc',_0xc48f('0xe')+_0x336a0d+_0xc48f('0xf'))[_0xc48f('0x10')](_0xc48f('0x11'),'ct',_0xc48f('0x12')+_0x336a0d+_0xc48f('0xf'))[_0xc48f('0x10')](_0xc48f('0x13'),'t',_0xc48f('0x14'));return _0xe23b92;}function addFieldsToQuery(_0x47b44c,_0x1ef512,_0x13d911,_0x369bc4,_0x3802bb){var _0x56bb64=_0x3802bb?'c':_0xc48f('0x15');if(!_0x1ef512){_0x1ef512=['id',_0xc48f('0x16'),_0xc48f('0x17'),_0xc48f('0x18'),'mobile',_0xc48f('0x19'),_0xc48f('0x1a'),'ListId',_0xc48f('0x1b'),'createdAt',_0xc48f('0x1c'),_0xc48f('0x1d'),'TagIds'];}else if(!_0x1ef512['includes']('id')){_0x1ef512[_0xc48f('0x1e')]('id');}var _0x22575d=_0x13d911&&_0x3802bb||!_0x13d911&&!_0x3802bb;if(_0x369bc4){_0x22575d=_0x369bc4&&_0x3802bb||!_0x369bc4&&!_0x3802bb;}_0x1ef512['forEach'](function(_0x38f6c9){if(_0x38f6c9==='TagIds'){if(_0x22575d){_0x47b44c[_0xc48f('0x1f')](_0xc48f('0x20'),_0x38f6c9);}else if(_0x13d911||_0x369bc4){_0x47b44c[_0xc48f('0x1f')](_0x56bb64+'.'+_0x38f6c9);}}else{_0x47b44c[_0xc48f('0x1f')](_0x56bb64+'.'+_0x38f6c9);}});return _0x47b44c;}function getSqlClauses(){var _0x3b5248={'default':squel[_0xc48f('0x21')](),'fields':squel['expr'](),'filter':squel[_0xc48f('0x21')](),'tags':{'clause':squel[_0xc48f('0x21')](),'ids':null},'user':{'clause':squel[_0xc48f('0x21')](),'skip':![]}};return _0x3b5248;}function parseTagParameter(_0x2b0fa0){var _0xd3d4f7=squel['expr']();if(_0x2b0fa0){var _0x5ae248=utils['getSelectedTags'](_0x2b0fa0);_0x5ae248[_0xc48f('0x22')](function(_0x556ccb){_0xd3d4f7['or'](_0xc48f('0x23'),'%,'+_0x556ccb+',%');});}return _0xd3d4f7;}function parseSearchFilter(_0x561579){var _0x59f36a=squel[_0xc48f('0x21')]();if(_0x561579){var _0x1f5c44=_0x561579[_0xc48f('0x24')]('\x5c','\x5c\x5c')[_0xc48f('0x24')](/'/g,'\x27\x27');if(_0x1f5c44[_0xc48f('0x25')]('\x20')[_0xc48f('0x26')]>0x1){_0x59f36a['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc48f('0x27')](_0x1f5c44),null);}else{if(qs['isNumeric'](_0x1f5c44)){_0x59f36a['or'](_0xc48f('0x28'),_0x1f5c44+'%');_0x59f36a['or'](_0xc48f('0x29'),_0x1f5c44+'%');_0x59f36a['or'](_0xc48f('0x2a'),_0x1f5c44+'%');_0x59f36a['or']('c.fax\x20LIKE\x20?',_0x1f5c44+'%');}else if(qs[_0xc48f('0x2b')](_0x1f5c44)){_0x59f36a['or'](_0xc48f('0x2c'),_0x1f5c44+'%');}else{_0x59f36a['or'](_0xc48f('0x2d'),'%'+_0x1f5c44+'%');_0x59f36a['or'](_0xc48f('0x2e'),'%'+_0x1f5c44+'%');_0x59f36a['or'](_0xc48f('0x2c'),'%'+_0x1f5c44+'%');}}}return _0x59f36a;}function parseAdvancedSearchFilter(_0x3764c5,_0x12c492){var _0x2f713c=getSqlClauses();var _0x2abd57=as[_0xc48f('0x2f')](_0x3764c5);var _0xf4b925=_0x2abd57['sqlOperator'];for(var _0x2996bb=0x0;_0x2996bb<_0x2abd57[_0xc48f('0x30')]['length'];_0x2996bb++){var _0x16a9d0=_0x2abd57[_0xc48f('0x30')][_0x2996bb];var _0x7c3ca6='c';var _0x4b97f1=_[_0xc48f('0x31')](_0x12c492,['name',_0x16a9d0[_0xc48f('0x1f')]]);if(_0x4b97f1){if(_0x16a9d0[_0xc48f('0x1f')]===_0xc48f('0x32')||_0x4b97f1[_0xc48f('0x33')]==='datetime'){_0x16a9d0[_0xc48f('0x34')]='DATE';}var _0x104dff=as['buildExpression'](_0x7c3ca6,_0x4b97f1[_0xc48f('0x35')],_0x16a9d0);_0x2f713c[_0xc48f('0x36')][_0xf4b925](_0x104dff[_0xc48f('0x37')],_0x104dff['value'][_0xc48f('0x38')],_0x104dff[_0xc48f('0x39')][_0xc48f('0x3a')]);}else{if(_0x16a9d0[_0xc48f('0x1f')]===_0xc48f('0x3b')){var _0x6e297=_0x16a9d0[_0xc48f('0x39')][_0xc48f('0x25')](',')[_0xc48f('0x3c')](function(_0x5869bb){return Number(_0x5869bb);});var _0x28779c=parseTagParameter(_0x6e297);_0x2f713c[_0xc48f('0x3d')][_0xc48f('0x3e')][_0xc48f('0x3f')](_0x28779c);_0x2f713c[_0xc48f('0x3d')][_0xc48f('0x40')]=_0x6e297;}else if(_0x16a9d0['field']===_0xc48f('0x41')){_0x2f713c[_0xc48f('0x42')][_0xc48f('0x3e')][_0xc48f('0x3f')](_0xc48f('0x43'),_0x16a9d0[_0xc48f('0x39')]);_0x2f713c['user'][_0xc48f('0x44')]=!![];}}}return _0x2f713c;}function parseModelFields(_0x2750af,_0x5764fe){var _0xf7f0c2=squel[_0xc48f('0x21')]();var _0xf1ab96=_(_0x2750af)['keys']()['map'](function(_0xd63bd6){return _[_0xc48f('0x45')](_0x5764fe,[_0xc48f('0x46'),_0xd63bd6])?_0xd63bd6:undefined;})['compact']()[_0xc48f('0x39')]();if(_0x2750af[_0xc48f('0x47')]){_0xf1ab96[_0xc48f('0x1e')](_0xc48f('0x47'));}if(_0xf1ab96[_0xc48f('0x26')]>0x0){_0xf1ab96[_0xc48f('0x22')](function(_0x32ec86){if(_0x32ec86===_0xc48f('0x6')){_0xf7f0c2[_0xc48f('0x3f')](_0xc48f('0x48'),[]['concat'](_0x2750af[_0x32ec86]));}else if(_0x32ec86===_0xc48f('0x47')){var _0x2aa2b2='%'+_0x2750af[_0x32ec86]+'%';_0xf7f0c2[_0xc48f('0x3f')](_0xc48f('0x49'),_0x2aa2b2);}else{_0xf7f0c2[_0xc48f('0x3f')]('c.'+_0x32ec86+'\x20=\x20?',_0x2750af[_0x32ec86]);}});}return _0xf7f0c2;}function parseQueryParameters(_0x3a6274,_0x47cec6){var _0xdbe87e=getSqlClauses();return Promise[_0xc48f('0x4a')]()[_0xc48f('0x4b')](function(){return parseModelFields(_0x3a6274,_0x47cec6);})['then'](function(_0x22abe1){_0xdbe87e[_0xc48f('0x4c')][_0xc48f('0x3f')](_0x22abe1);return parseTagParameter(_0x3a6274[_0xc48f('0x4d')]);})[_0xc48f('0x4b')](function(_0x797528){_0xdbe87e[_0xc48f('0x3d')][_0xc48f('0x3e')][_0xc48f('0x3f')](_0x797528);return parseSearchFilter(_0x3a6274[_0xc48f('0x4e')]);})[_0xc48f('0x4b')](function(_0x2a1e49){_0xdbe87e['filter']=_0x2a1e49;return _0xdbe87e;});}function checkListsRestrictions(_0x26b9a8,_0xc0e183,_0x19ebb6){var _0x57feec=squel['expr']();return Promise['resolve']()[_0xc48f('0x4b')](function(){if(_0xc0e183[_0xc48f('0x4f')]&&_0x26b9a8[_0xc48f('0x4')]===_0xc48f('0x5')&&!_0x19ebb6){return _0x26b9a8[_0xc48f('0x50')]({'attributes':['id'],'raw':!![]});}})[_0xc48f('0x4b')](function(_0x46088d){if(_0x46088d){if(_0x46088d['length']===0x0){_0x57feec[_0xc48f('0x3f')](_0xc48f('0x51'));}else{_0x57feec['and'](_0xc48f('0x48'),_[_0xc48f('0x3c')](_0x46088d,'id'));}}})[_0xc48f('0x4b')](function(){return _0x57feec;});}function buildContactsQuery(_0x181230,_0x35e9fb,_0x488cb3,_0x22e753,_0x14c7ee,_0xc552b0){if(_0x35e9fb){_0x35e9fb=_0x488cb3[_0xc48f('0x52')];}_0x181230=addFieldsToQuery(_0x181230,_0x35e9fb,_0x22e753,_0xc552b0,!![]);var _0x5639cf=squel['select']();_0x5639cf=addFieldsToQuery(_0x5639cf,_0x35e9fb,_0x22e753,_0xc552b0,![]);if(_0x22e753||_0xc552b0){_0x181230=applyJoinClauses(_0x181230,!![]);_0x181230[_0xc48f('0x53')]('c.id');if(_0x488cb3['limit']){_0x5639cf[_0xc48f('0x54')](_0x488cb3[_0xc48f('0x54')]);}if(_0x488cb3[_0xc48f('0x55')]){_0x5639cf[_0xc48f('0x55')](_0x488cb3[_0xc48f('0x55')]);}}else{_0x5639cf=applyJoinClauses(_0x5639cf,![]);_0x5639cf[_0xc48f('0x53')](_0xc48f('0x56'));if(_0x488cb3[_0xc48f('0x54')]){_0x181230[_0xc48f('0x54')](_0x488cb3[_0xc48f('0x54')]);}if(_0x488cb3['offset']){_0x181230[_0xc48f('0x55')](_0x488cb3[_0xc48f('0x55')]);}}_0x5639cf[_0xc48f('0x57')](_0x14c7ee);if(_0x488cb3[_0xc48f('0x58')]){_0x488cb3[_0xc48f('0x58')][_0xc48f('0x22')](function(_0x355c4d){_0x181230[_0xc48f('0x58')]('c.'+_0x355c4d[0x0],_0x355c4d[0x1]===_0xc48f('0x59')?![]:!![]);_0x5639cf[_0xc48f('0x58')]('subqry.'+_0x355c4d[0x0],_0x355c4d[0x1]===_0xc48f('0x59')?![]:!![]);});}_0x5639cf['from'](_0x181230,'subqry');return _0x5639cf;}function getFilteredContacts(_0x4685bc){var _0x9c7c64=[];return db[_0xc48f('0x3b')][_0xc48f('0x5a')]({'attributes':['id',_0xc48f('0x46'),_0xc48f('0x5b')],'raw':!![]})[_0xc48f('0x4b')](function(_0x33c52c){_0x9c7c64=_[_0xc48f('0x5c')](_0x33c52c,'id');var _0x19b34e={'type':db[_0xc48f('0x5d')]['QueryTypes'][_0xc48f('0x5e')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xc48f('0x5f')]['query'](_0x4685bc[_0xc48f('0x60')](),_0x19b34e);})[_0xc48f('0x4b')](function(_0x17657d){_0x17657d[_0xc48f('0x22')](function(_0x3eb7ed){if(_0x3eb7ed[_0xc48f('0x61')]){_0x3eb7ed[_0xc48f('0x62')]=[];_0x3eb7ed[_0xc48f('0x61')][_0xc48f('0x25')](',')[_0xc48f('0x22')](function(_0x221a12){_0x3eb7ed['Tags'][_0xc48f('0x1e')](_0x9c7c64[_0x221a12]);});}delete _0x3eb7ed['TagIds'];});return _0x17657d;});}function countFilteredContacts(_0x7f59ac,_0x26e55e){var _0x308a6e=_0x7f59ac[_0xc48f('0x63')]();_0x308a6e[_0xc48f('0x1f')]('COUNT(*)');_0x308a6e=applyJoinClauses(_0x308a6e,!![]);_0x7f59ac[_0xc48f('0x53')](_0xc48f('0x64'));var _0x23aae6=utils[_0xc48f('0x65')](_0x26e55e);if(!_[_0xc48f('0x66')](_0x23aae6)){_0x308a6e[_0xc48f('0xb')](_0xc48f('0x67'),_0x23aae6);}var _0x1bb80f={'type':db[_0xc48f('0x5d')][_0xc48f('0x68')][_0xc48f('0x5e')],'raw':!![]};return db[_0xc48f('0x5f')][_0xc48f('0x69')](_0x308a6e['toString'](),_0x1bb80f)['then'](function(_0x5cb781){return _0x5cb781[0x0][_0xc48f('0x6a')];});}module[_0xc48f('0x6b')]={'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 0e6a0cb..1331515 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 _0x6360=['app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close','decryptFile','createDecipher','unlink','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger'];(function(_0x13db07,_0x590761){var _0x358fba=function(_0x74b668){while(--_0x74b668){_0x13db07['push'](_0x13db07['shift']());}};_0x358fba(++_0x590761);}(_0x6360,0x150));var _0x0636=function(_0xadb6f3,_0x222be7){_0xadb6f3=_0xadb6f3-0x0;var _0x137807=_0x6360[_0xadb6f3];return _0x137807;};'use strict';var crypto=require(_0x0636('0x0'));var fs=require('fs');var BPromise=require(_0x0636('0x1'));var _=require(_0x0636('0x2'));var config=require('../../config/environment');var logger=require(_0x0636('0x3'))(_0x0636('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0636('0x5')]['session'],'algorithm':_0x0636('0x6')};const fileOptions={'algorithm':_0x0636('0x7')};if(config[_0x0636('0x8')]&&config['encrypt'][_0x0636('0x9')]){var isSupported=isAlgorithmSupported(config[_0x0636('0x8')][_0x0636('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x0636('0x8')][_0x0636('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0636('0xa')](',\x20');logger[_0x0636('0xb')](config[_0x0636('0x8')][_0x0636('0x9')],_0x0636('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1f11e6){return AES_SUPPORTED_RX[_0x0636('0xd')](_0x1f11e6);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x0636('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x334c4f){return getSupportedCiphers()[_0x0636('0xf')](_0x334c4f)>-0x1;}function combineOptions(_0xb83c11){var _0x812c58={};for(var _0x4033fc in fileOptions){if(fileOptions['hasOwnProperty'](_0x4033fc)){_0x812c58[_0x4033fc]=fileOptions[_0x4033fc];}}if(_0xb83c11){for(var _0x45a96f in _0xb83c11){if(_0xb83c11[_0x0636('0x10')](_0x45a96f)){_0x812c58[_0x45a96f]=_0xb83c11[_0x45a96f];}}}return _0x812c58;}exports['encryptFile']=function(_0x443009,_0x527d30,_0x306a00,_0x462abc){return new BPromise(function(_0x419c7f,_0x5c525f){_0x462abc=combineOptions(_0x462abc);var _0x578bed=new Buffer(_0x306a00);var _0x2354eb=fs['createReadStream'](_0x443009);var _0x16a4bd=fs[_0x0636('0x11')](_0x527d30);var _0x3b417f=crypto[_0x0636('0x12')](_0x462abc[_0x0636('0x9')],_0x578bed);_0x2354eb['on'](_0x0636('0x13'),function(_0x3181fe){var _0x1858a3=new Buffer(_0x3b417f[_0x0636('0x14')](_0x3181fe),_0x0636('0x15'));_0x16a4bd[_0x0636('0x16')](_0x1858a3);});_0x2354eb['on'](_0x0636('0x17'),function(){try{var _0x418932=new Buffer(_0x3b417f[_0x0636('0x18')](_0x0636('0x15')),'binary');_0x16a4bd[_0x0636('0x16')](_0x418932);_0x16a4bd['end']();_0x16a4bd['on'](_0x0636('0x19'),function(){return _0x419c7f(_0x527d30);});}catch(_0x1229d1){fs['unlink'](_0x527d30);return _0x5c525f(_0x1229d1);}});});};exports[_0x0636('0x1a')]=function(_0x4d5200,_0x117fcf,_0x2ed76c,_0x2518c1){return new BPromise(function(_0x3d0474,_0x2e93e0){_0x2518c1=combineOptions(_0x2518c1);var _0x4872c2=new Buffer(_0x2ed76c);var _0x4ccb91=fs['createReadStream'](_0x4d5200);var _0x2e1a70=fs[_0x0636('0x11')](_0x117fcf);var _0x5d4a58=crypto[_0x0636('0x1b')](_0x2518c1[_0x0636('0x9')],_0x4872c2);_0x4ccb91['on']('data',function(_0x2d2680){var _0x3fd118=new Buffer(_0x5d4a58['update'](_0x2d2680),_0x0636('0x15'));_0x2e1a70[_0x0636('0x16')](_0x3fd118);});_0x4ccb91['on'](_0x0636('0x17'),function(){try{var _0x1442a7=new Buffer(_0x5d4a58[_0x0636('0x18')](_0x0636('0x15')),'binary');_0x2e1a70[_0x0636('0x16')](_0x1442a7);_0x2e1a70['end']();_0x2e1a70['on']('close',function(){return _0x3d0474(_0x117fcf);});}catch(_0x4a18a3){fs[_0x0636('0x1c')](_0x117fcf);return _0x2e93e0(_0x4a18a3);}});});};exports[_0x0636('0x1d')]=function(_0x2299c5,_0xcd4308,_0x1080c4){var _0x227463=_0x1080c4||stringOptions['algorithm'];var _0x512def=_0xcd4308||stringOptions[_0x0636('0x1e')];var _0xd7004f=crypto[_0x0636('0x12')](_0x227463,_0x512def);var _0x594fdd=_0xd7004f['update'](_0x2299c5,_0x0636('0x1f'),_0x0636('0x20'));_0x594fdd+=_0xd7004f[_0x0636('0x18')](_0x0636('0x20'));return _0x594fdd;};exports[_0x0636('0x21')]=function(_0x254ba5,_0x2ae224,_0x53765c){var _0x5c2a17=_0x53765c||stringOptions[_0x0636('0x9')];var _0x1c43f6=_0x2ae224||stringOptions[_0x0636('0x1e')];var _0x5cb5e1=crypto[_0x0636('0x1b')](_0x5c2a17,_0x1c43f6);var _0x193add=_0x5cb5e1[_0x0636('0x14')](_0x254ba5,_0x0636('0x20'),_0x0636('0x1f'));_0x193add+=_0x5cb5e1['final'](_0x0636('0x1f'));return _0x193add;}; \ No newline at end of file +var _0xdfbf=['encryptFile','createReadStream','createWriteStream','createCipher','binary','write','end','final','close','decryptFile','createDecipher','data','update','encryptString','secret','utf8','base64','decryptString','../../config/logger','app','secrets','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xdfbf,0x148));var _0xfdfb=function(_0x1866df,_0x3cda12){_0x1866df=_0x1866df-0x0;var _0x19b7c2=_0xdfbf[_0x1866df];return _0x19b7c2;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xfdfb('0x0'))(_0xfdfb('0x1'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xfdfb('0x2')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xfdfb('0x3')};if(config[_0xfdfb('0x4')]&&config[_0xfdfb('0x4')][_0xfdfb('0x5')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xfdfb('0x5')]);if(isSupported){fileOptions[_0xfdfb('0x5')]=config[_0xfdfb('0x4')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xfdfb('0x6')](',\x20');logger[_0xfdfb('0x7')](config[_0xfdfb('0x4')][_0xfdfb('0x5')],_0xfdfb('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x1525d0){return AES_SUPPORTED_RX['test'](_0x1525d0);}function getSupportedCiphers(){return crypto[_0xfdfb('0x9')]()[_0xfdfb('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x124526){return getSupportedCiphers()[_0xfdfb('0xb')](_0x124526)>-0x1;}function combineOptions(_0x33e345){var _0x6b77d6={};for(var _0x5dbbc7 in fileOptions){if(fileOptions[_0xfdfb('0xc')](_0x5dbbc7)){_0x6b77d6[_0x5dbbc7]=fileOptions[_0x5dbbc7];}}if(_0x33e345){for(var _0x43c5d4 in _0x33e345){if(_0x33e345[_0xfdfb('0xc')](_0x43c5d4)){_0x6b77d6[_0x43c5d4]=_0x33e345[_0x43c5d4];}}}return _0x6b77d6;}exports[_0xfdfb('0xd')]=function(_0x313c95,_0x375f12,_0xc0aab8,_0x5ec3af){return new BPromise(function(_0x330be6,_0x4334e8){_0x5ec3af=combineOptions(_0x5ec3af);var _0xdce598=new Buffer(_0xc0aab8);var _0x21e984=fs[_0xfdfb('0xe')](_0x313c95);var _0x319dd9=fs[_0xfdfb('0xf')](_0x375f12);var _0x28599d=crypto[_0xfdfb('0x10')](_0x5ec3af[_0xfdfb('0x5')],_0xdce598);_0x21e984['on']('data',function(_0xbc25be){var _0x553d2b=new Buffer(_0x28599d['update'](_0xbc25be),_0xfdfb('0x11'));_0x319dd9[_0xfdfb('0x12')](_0x553d2b);});_0x21e984['on'](_0xfdfb('0x13'),function(){try{var _0x28dc90=new Buffer(_0x28599d[_0xfdfb('0x14')](_0xfdfb('0x11')),_0xfdfb('0x11'));_0x319dd9[_0xfdfb('0x12')](_0x28dc90);_0x319dd9[_0xfdfb('0x13')]();_0x319dd9['on'](_0xfdfb('0x15'),function(){return _0x330be6(_0x375f12);});}catch(_0x1a063d){fs['unlink'](_0x375f12);return _0x4334e8(_0x1a063d);}});});};exports[_0xfdfb('0x16')]=function(_0x57aa75,_0x20c0c0,_0x556a84,_0x4bbfd5){return new BPromise(function(_0x3a02c1,_0x103024){_0x4bbfd5=combineOptions(_0x4bbfd5);var _0x142c71=new Buffer(_0x556a84);var _0x40f147=fs[_0xfdfb('0xe')](_0x57aa75);var _0x4876aa=fs['createWriteStream'](_0x20c0c0);var _0x47aef5=crypto[_0xfdfb('0x17')](_0x4bbfd5[_0xfdfb('0x5')],_0x142c71);_0x40f147['on'](_0xfdfb('0x18'),function(_0xf1b375){var _0x31ad17=new Buffer(_0x47aef5[_0xfdfb('0x19')](_0xf1b375),_0xfdfb('0x11'));_0x4876aa[_0xfdfb('0x12')](_0x31ad17);});_0x40f147['on'](_0xfdfb('0x13'),function(){try{var _0x3aaee3=new Buffer(_0x47aef5[_0xfdfb('0x14')](_0xfdfb('0x11')),'binary');_0x4876aa['write'](_0x3aaee3);_0x4876aa[_0xfdfb('0x13')]();_0x4876aa['on'](_0xfdfb('0x15'),function(){return _0x3a02c1(_0x20c0c0);});}catch(_0x194b26){fs['unlink'](_0x20c0c0);return _0x103024(_0x194b26);}});});};exports[_0xfdfb('0x1a')]=function(_0x5b57c0,_0x560cda,_0x35c1dc){var _0x2719fd=_0x35c1dc||stringOptions[_0xfdfb('0x5')];var _0x2dc494=_0x560cda||stringOptions[_0xfdfb('0x1b')];var _0x2330fe=crypto[_0xfdfb('0x10')](_0x2719fd,_0x2dc494);var _0x413dbb=_0x2330fe[_0xfdfb('0x19')](_0x5b57c0,_0xfdfb('0x1c'),_0xfdfb('0x1d'));_0x413dbb+=_0x2330fe[_0xfdfb('0x14')](_0xfdfb('0x1d'));return _0x413dbb;};exports[_0xfdfb('0x1e')]=function(_0x2cfee6,_0x8186f0,_0x2d8b73){var _0x220259=_0x2d8b73||stringOptions[_0xfdfb('0x5')];var _0x4e79e2=_0x8186f0||stringOptions['secret'];var _0x45e37f=crypto['createDecipher'](_0x220259,_0x4e79e2);var _0x47f28c=_0x45e37f[_0xfdfb('0x19')](_0x2cfee6,_0xfdfb('0x1d'),'utf8');_0x47f28c+=_0x45e37f[_0xfdfb('0x14')]('utf8');return _0x47f28c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 97d62dd..f42db58 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 _0x8d4d=['Failed','finally','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','find','splitSizeCsv','then','sequelize','format','QueryTypes','SELECT','Empty','length','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','split','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3b9ec3,_0xc931a9){var _0x36f5e3=function(_0x27bacf){while(--_0x27bacf){_0x3b9ec3['push'](_0x3b9ec3['shift']());}};_0x36f5e3(++_0xc931a9);}(_0x8d4d,0xbe));var _0xd8d4=function(_0x23332e,_0x333733){_0x23332e=_0x23332e-0x0;var _0x1742c7=_0x8d4d[_0x23332e];return _0x1742c7;};'use strict';var util=require(_0xd8d4('0x0'));var path=require(_0xd8d4('0x1'));var _=require(_0xd8d4('0x2'));var csv=require(_0xd8d4('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xd8d4('0x4'));var rimraf=require(_0xd8d4('0x5'));var db=require(_0xd8d4('0x6'))['db'];var dbH=require(_0xd8d4('0x6'))['dbH'];var logger=require('../../config/logger')(_0xd8d4('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xd8d4('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd8d4('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8ca02d,_0x332745){var _0x1a9b58={'status':_0x8ca02d};var _0x4199ed={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x332745){_0x1a9b58[_0xd8d4('0x9')]=_0x332745;}return db[_0xd8d4('0xa')][_0xd8d4('0xb')](_0x1a9b58,_0x4199ed);}function main(){var _0xc6f64a=0x1388;var _0x55d0f9;logger[_0xd8d4('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd8d4('0xd')));return db[_0xd8d4('0xe')][_0xd8d4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd8d4('0x10')]})[_0xd8d4('0x11')](function(_0x54ad28){if(_0x54ad28){_0x55d0f9=_0x54ad28;_0xc6f64a=_0x55d0f9[_0xd8d4('0x10')]||0x1388;}})[_0xd8d4('0x11')](function(){return dbH[_0xd8d4('0x12')]['query'](util[_0xd8d4('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]});})[_0xd8d4('0x11')](function(_0x1bf434){if(!_0x1bf434[0x0]['num']){return analyticExtractedReport(_0xd8d4('0x16'));}var _0x130b0c=[];var _0xba437c=0x0;if(_0x55d0f9['split']){if(_0x1bf434&&_0x1bf434[_0xd8d4('0x17')]){var _0x3c186e=_['range'](_0x1bf434[0x0][_0xd8d4('0x18')]/_0xc6f64a);var _0x57fe2c=Number[_0xd8d4('0x19')](_0x1bf434[0x0][_0xd8d4('0x18')]/_0xc6f64a)?_0x1bf434[0x0][_0xd8d4('0x18')]%_0xc6f64a:0x0;_0x3c186e[_0xd8d4('0x1a')](function(_0x1b0cbf){if(_0x1b0cbf>0x0){_0xba437c+=_0xc6f64a;}_0x130b0c[_0xd8d4('0x1b')](dbH[_0xd8d4('0x12')][_0xd8d4('0x1c')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc6f64a,_0xba437c),{'type':dbH[_0xd8d4('0x12')]['QueryTypes']['SELECT']}));});if(_0x57fe2c>0x0){_0xba437c+=_0xc6f64a;_0x130b0c[_0xd8d4('0x1b')](dbH['sequelize']['query'](util[_0xd8d4('0x13')](_0xd8d4('0x1d'),QUERY,_0x57fe2c,_0xba437c),{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]}));}}}else{_0x130b0c[_0xd8d4('0x1b')](dbH[_0xd8d4('0x12')][_0xd8d4('0x1c')](QUERY,{'type':dbH[_0xd8d4('0x12')][_0xd8d4('0x14')][_0xd8d4('0x15')]}));}var _0x3f1bf7=path[_0xd8d4('0x1e')](PATH);var _0x2bc397=path['basename'](PATH,_0xd8d4('0x1f'));var _0x589455=_0x55d0f9[_0xd8d4('0x20')]&&_0x130b0c[_0xd8d4('0x17')]>0x1;var _0x2aa1a0=[];if(!fs[_0xd8d4('0x21')](path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397))&&_0x589455){fs[_0xd8d4('0x23')](path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397));}return BPromise[_0xd8d4('0x24')](_0x130b0c,function(_0x2f3501){_0x2aa1a0['push'](_0x2f3501);})['then'](function(){for(var _0x3d9e3a=0x0;_0x3d9e3a<_0x2aa1a0['length'];_0x3d9e3a+=0x1){var _0x322834;var _0x13d939=_0x2aa1a0[_0x3d9e3a];if(_0x589455){_0x322834=path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397,util['format'](_0xd8d4('0x25'),_0x2bc397,_0x3d9e3a,_0xd8d4('0x26')));}else{_0x322834=path[_0xd8d4('0x22')](_0x3f1bf7,util[_0xd8d4('0x13')](_0xd8d4('0x27'),_0x2bc397,_0xd8d4('0x26')));}fs[_0xd8d4('0x28')](_0x322834,csv(_0x13d939));}})[_0xd8d4('0x11')](function(){if(_0x589455){return new Promise(function(_0x2750ef){zipdir(path['join'](_0x3f1bf7,_0x2bc397),{'saveTo':path[_0xd8d4('0x22')](_0x3f1bf7,util['format'](_0xd8d4('0x27'),_0x2bc397,_0xd8d4('0x29')))},function(_0x23a3f6,_0x357f57){rimraf(path[_0xd8d4('0x22')](_0x3f1bf7,_0x2bc397),function(){});_0x2750ef(_0xd8d4('0x2a'));});});}})[_0xd8d4('0x11')](function(){logger['info'](util[_0xd8d4('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd8d4('0x2b'),_0x589455?util[_0xd8d4('0x13')](_0xd8d4('0x27'),_0x2bc397,_0x589455?_0xd8d4('0x29'):'csv'):null);});})['catch'](function(_0x5d411c){logger[_0xd8d4('0xc')](util[_0xd8d4('0x13')](_0xd8d4('0x2c'),EXTRACTED_REPORT_ID,_0xd8d4('0xd')),util['inspect'](_0x5d411c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd8d4('0x2d'));})[_0xd8d4('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xeb27=['mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Completed','zip','catch','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','info','format','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','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','dirname','basename','.csv','existsSync','join'];(function(_0x533381,_0x8a69fa){var _0x2877ed=function(_0x45cb54){while(--_0x45cb54){_0x533381['push'](_0x533381['shift']());}};_0x2877ed(++_0x8a69fa);}(_0xeb27,0x1a6));var _0x7eb2=function(_0x476ce4,_0x217732){_0x476ce4=_0x476ce4-0x0;var _0x1380d5=_0xeb27[_0x476ce4];return _0x1380d5;};'use strict';var util=require(_0x7eb2('0x0'));var path=require(_0x7eb2('0x1'));var _=require(_0x7eb2('0x2'));var csv=require(_0x7eb2('0x3'));var fs=require('fs');var BPromise=require(_0x7eb2('0x4'));var zipdir=require(_0x7eb2('0x5'));var rimraf=require(_0x7eb2('0x6'));var db=require(_0x7eb2('0x7'))['db'];var dbH=require(_0x7eb2('0x7'))[_0x7eb2('0x8')];var logger=require('../../config/logger')(_0x7eb2('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x7eb2('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x499994,_0x4aa1a6){var _0xb38dab={'status':_0x499994};var _0x5b8f23={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4aa1a6){_0xb38dab[_0x7eb2('0xb')]=_0x4aa1a6;}return db['AnalyticExtractedReport']['update'](_0xb38dab,_0x5b8f23);}function main(){var _0x42fa03=0x1388;var _0x2c4ed6;logger[_0x7eb2('0xc')](util[_0x7eb2('0xd')](_0x7eb2('0xe'),EXTRACTED_REPORT_ID,_0x7eb2('0xf')));return db['Setting'][_0x7eb2('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7eb2('0x11'),_0x7eb2('0x12')]})['then'](function(_0x46816d){if(_0x46816d){_0x2c4ed6=_0x46816d;_0x42fa03=_0x2c4ed6[_0x7eb2('0x12')]||0x1388;}})[_0x7eb2('0x13')](function(){return dbH[_0x7eb2('0x14')][_0x7eb2('0x15')](util[_0x7eb2('0xd')](_0x7eb2('0x16'),QUERY),{'type':dbH[_0x7eb2('0x14')]['QueryTypes']['SELECT']});})[_0x7eb2('0x13')](function(_0x3b1873){if(!_0x3b1873[0x0][_0x7eb2('0x17')]){return analyticExtractedReport('Empty');}var _0x8a65db=[];var _0x368f49=0x0;if(_0x2c4ed6[_0x7eb2('0x11')]){if(_0x3b1873&&_0x3b1873[_0x7eb2('0x18')]){var _0x180923=_[_0x7eb2('0x19')](_0x3b1873[0x0]['num']/_0x42fa03);var _0x40d9b4=Number[_0x7eb2('0x1a')](_0x3b1873[0x0][_0x7eb2('0x17')]/_0x42fa03)?_0x3b1873[0x0]['num']%_0x42fa03:0x0;_0x180923[_0x7eb2('0x1b')](function(_0xdf1d12){if(_0xdf1d12>0x0){_0x368f49+=_0x42fa03;}_0x8a65db['push'](dbH[_0x7eb2('0x14')]['query'](util['format'](_0x7eb2('0x1c'),QUERY,_0x42fa03,_0x368f49),{'type':dbH[_0x7eb2('0x14')][_0x7eb2('0x1d')][_0x7eb2('0x1e')]}));});if(_0x40d9b4>0x0){_0x368f49+=_0x42fa03;_0x8a65db[_0x7eb2('0x1f')](dbH[_0x7eb2('0x14')][_0x7eb2('0x15')](util['format'](_0x7eb2('0x1c'),QUERY,_0x40d9b4,_0x368f49),{'type':dbH[_0x7eb2('0x14')][_0x7eb2('0x1d')][_0x7eb2('0x1e')]}));}}}else{_0x8a65db[_0x7eb2('0x1f')](dbH['sequelize'][_0x7eb2('0x15')](QUERY,{'type':dbH[_0x7eb2('0x14')][_0x7eb2('0x1d')][_0x7eb2('0x1e')]}));}var _0x51d53d=path[_0x7eb2('0x20')](PATH);var _0x5618be=path[_0x7eb2('0x21')](PATH,_0x7eb2('0x22'));var _0x163b30=_0x2c4ed6[_0x7eb2('0x11')]&&_0x8a65db[_0x7eb2('0x18')]>0x1;var _0x29cc7a=[];if(!fs[_0x7eb2('0x23')](path[_0x7eb2('0x24')](_0x51d53d,_0x5618be))&&_0x163b30){fs[_0x7eb2('0x25')](path[_0x7eb2('0x24')](_0x51d53d,_0x5618be));}return BPromise[_0x7eb2('0x26')](_0x8a65db,function(_0x110945){_0x29cc7a[_0x7eb2('0x1f')](_0x110945);})[_0x7eb2('0x13')](function(){for(var _0x5f3a29=0x0;_0x5f3a29<_0x29cc7a[_0x7eb2('0x18')];_0x5f3a29+=0x1){var _0x1be325;var _0x59ea0f=_0x29cc7a[_0x5f3a29];if(_0x163b30){_0x1be325=path[_0x7eb2('0x24')](_0x51d53d,_0x5618be,util['format'](_0x7eb2('0x27'),_0x5618be,_0x5f3a29,_0x7eb2('0x28')));}else{_0x1be325=path[_0x7eb2('0x24')](_0x51d53d,util['format'](_0x7eb2('0x29'),_0x5618be,_0x7eb2('0x28')));}fs[_0x7eb2('0x2a')](_0x1be325,csv(_0x59ea0f));}})[_0x7eb2('0x13')](function(){if(_0x163b30){return new Promise(function(_0x32e711){zipdir(path['join'](_0x51d53d,_0x5618be),{'saveTo':path['join'](_0x51d53d,util[_0x7eb2('0xd')](_0x7eb2('0x29'),_0x5618be,'zip'))},function(_0x6fd140,_0x4a05cc){rimraf(path[_0x7eb2('0x24')](_0x51d53d,_0x5618be),function(){});_0x32e711(_0x7eb2('0x2b'));});});}})['then'](function(){logger[_0x7eb2('0xc')](util[_0x7eb2('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x7eb2('0x2c'),_0x163b30?util[_0x7eb2('0xd')](_0x7eb2('0x29'),_0x5618be,_0x163b30?_0x7eb2('0x2d'):_0x7eb2('0x28')):null);});})[_0x7eb2('0x2e')](function(_0x1dd90a){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7eb2('0xf')),util[_0x7eb2('0x2f')](_0x1dd90a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7eb2('0x30'));})[_0x7eb2('0x31')](function(){process[_0x7eb2('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 70f8f68..2778a52 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 _0x59c9=['center','pipe','finish','error','end','createPdfFromHTML','path','util','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','fill','length','auto','body','concat','chunk','keys','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','before','margin','landscape','footer','Arial','black','right','Empty','Setting','find','splitSizePdf','split','range','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','each','then','createPdfKitDocument','%s%d.%s','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x59c9,0x173));var _0x959c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x59c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x959c('0x0'));var path=require('path');var moment=require(_0x959c('0x1'));var htmlToPdfmake=require(_0x959c('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x959c('0x3'));var rimraf=require(_0x959c('0x4'));var JSDOM=require(_0x959c('0x5'))[_0x959c('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0x959c('0x7'));var db=require(_0x959c('0x8'))['db'];var dbH=require(_0x959c('0x8'))[_0x959c('0x9')];var logger=require('../../config/logger')(_0x959c('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x959c('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x959c('0xb')][0x4];var NAME=process[_0x959c('0xb')][0x5];var FORMAT=_0x959c('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x35b3ba,_0x3bbde5){var _0x454e91={'status':_0x35b3ba};var _0x1a7745={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bbde5){_0x454e91[_0x959c('0xd')]=_0x3bbde5;}return db[_0x959c('0xe')][_0x959c('0xf')](_0x454e91,_0x1a7745);}function getHeaders(_0x1a6f04){return _[_0x959c('0x10')](_0x1a6f04,function(_0xc43ba7){return{'text':_0xc43ba7,'style':'tableHeader'};});}function getRows(_0x3fe418,_0x58f336){return _[_0x959c('0x10')](_0x58f336,function(_0x1e84e9){return _(_0x1e84e9)['pick'](_0x3fe418)[_0x959c('0x10')](function(_0x2ce0c6){return _0x2ce0c6?_[_0x959c('0x11')](_0x2ce0c6):'';})['value']();});}function createTable(_0x3bedd8,_0x1fe082){var _0x5c4d53={'widths':_[_0x959c('0x12')](Array(_0x3bedd8[_0x959c('0x13')]),0x91),'heights':function(_0xb58eb8){return _0xb58eb8===0x0?_0x959c('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3f600f=getHeaders(_0x3bedd8);_0x5c4d53[_0x959c('0x15')]['push'](_0x3f600f);var _0x345315=getRows(_0x3bedd8,_0x1fe082);_0x5c4d53[_0x959c('0x15')]=_0x5c4d53['body'][_0x959c('0x16')](_0x345315);return _0x5c4d53;}function createTables(_0x21aad3){var _0x8c4ea5=[];var _0x43dcc2=_[_0x959c('0x17')](Object[_0x959c('0x18')](_0x21aad3[0x0]),0x5);_0x43dcc2['forEach'](function(_0x1d1893){_0x8c4ea5[_0x959c('0x19')](createTable(_0x1d1893,_0x21aad3));});return _0x8c4ea5;}function getPDFDocDefinition(_0x2ad432){var _0x1a3d2a=util['format'](_0x959c('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x959c('0x1b')])[_0x959c('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x959c('0x1d')])[_0x959c('0x1c')](FORMAT));var _0x18da9e=[];for(var _0x2fb809=0x0;_0x2fb809<_0x2ad432['length'];_0x2fb809++){var _0x4d4d5b=[];if(_0x2fb809===0x0){_0x4d4d5b[_0x959c('0x19')]({'text':_0x1a3d2a,'style':_0x959c('0x1e')});}var _0x1a97eb={'table':_0x2ad432[_0x2fb809]};if(_0x2fb809>0x0){_0x1a97eb['pageBreak']=_0x959c('0x1f');_0x1a97eb[_0x959c('0x20')]=[0x0,0x46,0x0,0x0];}_0x4d4d5b[_0x959c('0x19')](_0x1a97eb);_0x18da9e[_0x959c('0x19')](_0x4d4d5b);}return{'pageSize':'A4','pageOrientation':_0x959c('0x21'),'content':_0x18da9e,'footer':function(_0x5f29a5,_0x3ec78a){return{'text':_0x5f29a5[_0x959c('0x11')]()+'\x20/\x20'+_0x3ec78a,'style':_0x959c('0x22')};},'defaultStyle':{'font':_0x959c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x959c('0x24')},'footer':{'alignment':_0x959c('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1ab7e5){var _0x23ea3c=0x1388;var _0x4b26eb;if(!_0x1ab7e5[0x0]['num']){return analyticExtractedReport(_0x959c('0x26'));}return db[_0x959c('0x27')][_0x959c('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})['then'](function(_0x3bcce2){if(_0x3bcce2){_0x4b26eb=_0x3bcce2;_0x23ea3c=_0x4b26eb[_0x959c('0x29')]||0x3e8;}})['then'](function(){var _0x21f807=[];var _0x24b185=0x0;if(_0x4b26eb[_0x959c('0x2a')]){if(_0x1ab7e5&&_0x1ab7e5[_0x959c('0x13')]){var _0x4db156=_[_0x959c('0x2b')](_0x1ab7e5[0x0][_0x959c('0x2c')]/_0x23ea3c);var _0x54ace9=Number[_0x959c('0x2d')](_0x1ab7e5[0x0]['num']/_0x23ea3c)?_0x1ab7e5[0x0][_0x959c('0x2c')]%_0x23ea3c:0x0;_0x4db156[_0x959c('0x2e')](function(_0xaf1177){if(_0xaf1177>0x0){_0x24b185+=_0x23ea3c;}_0x21f807[_0x959c('0x19')](dbH[_0x959c('0x2f')][_0x959c('0x30')](util[_0x959c('0x1c')](_0x959c('0x31'),QUERY,_0x23ea3c,_0x24b185),{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')][_0x959c('0x33')]}));});if(_0x54ace9>0x0){_0x24b185+=_0x23ea3c;_0x21f807[_0x959c('0x19')](dbH['sequelize']['query'](util[_0x959c('0x1c')](_0x959c('0x31'),QUERY,_0x54ace9,_0x24b185),{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')][_0x959c('0x33')]}));}}}else{_0x21f807['push'](dbH[_0x959c('0x2f')][_0x959c('0x30')](QUERY,{'type':dbH[_0x959c('0x2f')][_0x959c('0x32')]['SELECT']}));}var _0x853733=path[_0x959c('0x34')](PATH);var _0x459622=path[_0x959c('0x35')](PATH,'.pdf');var _0x14bae1=_0x4b26eb[_0x959c('0x2a')]&&_0x21f807[_0x959c('0x13')]>0x1;var _0x181a9d=[];if(!fs[_0x959c('0x36')](path[_0x959c('0x37')](_0x853733,_0x459622))&&_0x14bae1){fs['mkdirSync'](path[_0x959c('0x37')](_0x853733,_0x459622));}return BPromise[_0x959c('0x38')](_0x21f807,function(_0x1a9caa){_0x181a9d['push'](_0x1a9caa);})[_0x959c('0x39')](function(){var _0x351b56=[];for(var _0x375e26=0x0;_0x375e26<_0x181a9d['length'];_0x375e26+=0x1){var _0x53e4b2=_0x181a9d[_0x375e26];var _0x1f59c4=createTables(_['flatten'](_0x53e4b2));var _0x380bc9;var _0x14c531=getPDFDocDefinition(_0x1f59c4);var _0x44cbf7=getPDFPrinter();var _0x26f5a9=_0x44cbf7[_0x959c('0x3a')](_0x14c531);if(_0x14bae1){_0x380bc9=path[_0x959c('0x37')](_0x853733,_0x459622,util['format'](_0x959c('0x3b'),_0x459622,_0x375e26,'pdf'));}else{_0x380bc9=path['join'](_0x853733,util['format'](_0x959c('0x3c'),_0x459622,'pdf'));}_0x351b56['push'](writePDFDocument(_0x26f5a9,_0x380bc9));}return Promise['all'](_0x351b56);})[_0x959c('0x39')](function(){if(_0x14bae1){return new Promise(function(_0xfbee2a){zipdir(path[_0x959c('0x37')](_0x853733,_0x459622),{'saveTo':path['join'](_0x853733,util['format'](_0x959c('0x3c'),_0x459622,_0x959c('0x3d')))},function(){rimraf(path[_0x959c('0x37')](_0x853733,_0x459622),function(){});_0xfbee2a(_0x959c('0x3e'));});});}})[_0x959c('0x39')](function(){if(!_0x14bae1)return;rimraf(path[_0x959c('0x37')](_0x853733,_0x459622),function(){});})['then'](function(){logger[_0x959c('0x3f')](util[_0x959c('0x1c')](_0x959c('0x40'),EXTRACTED_REPORT_ID,_0x959c('0x41')));return analyticExtractedReport(_0x959c('0x42'),_0x14bae1?util['format']('%s.%s',_0x459622,_0x14bae1?_0x959c('0x3d'):_0x959c('0x43')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x959c('0x1c')](_0x959c('0x44'),EXTRACTED_REPORT_ID,_0x959c('0x41')));return db[_0x959c('0xe')][_0x959c('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x959c('0x39')](function(_0x4e0727){EXTRACTED_REPORT=_0x4e0727;return dbH[_0x959c('0x2f')][_0x959c('0x30')](util[_0x959c('0x1c')](_0x959c('0x46'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x959c('0x39')](extractReport)[_0x959c('0x47')](function(_0x27cff9){logger[_0x959c('0x3f')](util['format'](_0x959c('0x48'),EXTRACTED_REPORT_ID,'PDF'),util[_0x959c('0x49')](_0x27cff9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x959c('0x4a'));})[_0x959c('0x4b')](function(){process[_0x959c('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4bafc1=new PdfPrinter({'Arial':{'normal':__dirname+_0x959c('0x4d'),'bold':__dirname+_0x959c('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x959c('0x4f')}});return _0x4bafc1;}function getPDFDocDefinitionFromHTML(_0x291f4a,_0x3940c7){var _0x2de8d8=util[_0x959c('0x1c')](_0x959c('0x50'),_0x3940c7[_0x959c('0x51')],_0x3940c7[_0x959c('0x52')]);var _0x4d1200=moment()[_0x959c('0x1c')](_0x959c('0x53'))[_0x959c('0x11')]();var _0x23e0d2=htmlToPdfmake(_0x291f4a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x23e0d2],'defaultStyle':{'font':_0x959c('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x959c('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x959c('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x959c('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x959c('0x1e')}];},'footer':function(_0x25ba3b,_0x4aa2d0){return[{'text':util[_0x959c('0x1c')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2de8d8,_0x25ba3b,_0x4aa2d0,_0x4d1200),'style':_0x959c('0x22')}];}};}function writePDFDocument(_0x246f9a,_0x4fa5ef){return new Promise(function(_0x5a664f,_0x116a79){var _0x2e30cb=_0x246f9a[_0x959c('0x55')](fs['createWriteStream'](_0x4fa5ef));_0x2e30cb['on'](_0x959c('0x56'),function(){_0x5a664f(_0x959c('0x56'));});_0x2e30cb['on'](_0x959c('0x57'),function(_0x2094e3){_0x116a79(_0x2094e3);});_0x246f9a[_0x959c('0x58')]();});}exports[_0x959c('0x59')]=function(_0x49c0fe,_0x454a63){var _0x3eff35=getPDFPrinter();var _0x1f5e12=getPDFDocDefinitionFromHTML(_0x49c0fe,_0x454a63);var _0x45319c=_0x3eff35[_0x959c('0x3a')](_0x1f5e12);return writePDFDocument(_0x45319c,_0x454a63[_0x959c('0x5a')])[_0x959c('0x47')](function(_0x48c6cf){throw _0x48c6cf;});}; \ No newline at end of file +var _0xb7c0=['tableHeader','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','name','format','push','header','pageBreak','before','margin','landscape','\x20/\x20','footer','right','num','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','SELECT','QueryTypes','dirname','basename','.pdf','join','flatten','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','end','createPdfFromHTML','lodash','util','path','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map'];(function(_0x58bd5d,_0x440cc2){var _0x5c0d44=function(_0x1893b8){while(--_0x1893b8){_0x58bd5d['push'](_0x58bd5d['shift']());}};_0x5c0d44(++_0x440cc2);}(_0xb7c0,0xa0));var _0x0b7c=function(_0x13e902,_0x1d2d7b){_0x13e902=_0x13e902-0x0;var _0x3bb354=_0xb7c0[_0x13e902];return _0x3bb354;};'use strict';var _=require(_0x0b7c('0x0'));var fs=require('fs');var util=require(_0x0b7c('0x1'));var path=require(_0x0b7c('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x0b7c('0x3'));var zipdir=require(_0x0b7c('0x4'));var rimraf=require(_0x0b7c('0x5'));var JSDOM=require(_0x0b7c('0x6'))[_0x0b7c('0x7')];var window=new JSDOM('')[_0x0b7c('0x8')];var BPromise=require(_0x0b7c('0x9'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x0b7c('0xa')];var logger=require(_0x0b7c('0xb'))(_0x0b7c('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0b7c('0xd')][0x3];var PATH=process[_0x0b7c('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x0b7c('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xcb9f5a,_0x21d4d5){var _0x8d2bce={'status':_0xcb9f5a};var _0x5a0020={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21d4d5){_0x8d2bce['savename']=_0x21d4d5;}return db[_0x0b7c('0xf')][_0x0b7c('0x10')](_0x8d2bce,_0x5a0020);}function getHeaders(_0x45b6fd){return _[_0x0b7c('0x11')](_0x45b6fd,function(_0x3809de){return{'text':_0x3809de,'style':_0x0b7c('0x12')};});}function getRows(_0x521f9e,_0x39de3e){return _[_0x0b7c('0x11')](_0x39de3e,function(_0x2a941d){return _(_0x2a941d)[_0x0b7c('0x13')](_0x521f9e)[_0x0b7c('0x11')](function(_0x5b0137){return _0x5b0137?_[_0x0b7c('0x14')](_0x5b0137):'';})[_0x0b7c('0x15')]();});}function createTable(_0x20bd0e,_0x2c33a5){var _0x55c1e5={'widths':_[_0x0b7c('0x16')](Array(_0x20bd0e[_0x0b7c('0x17')]),0x91),'heights':function(_0x1fcdf9){return _0x1fcdf9===0x0?_0x0b7c('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1117a3=getHeaders(_0x20bd0e);_0x55c1e5[_0x0b7c('0x19')]['push'](_0x1117a3);var _0x5a7d55=getRows(_0x20bd0e,_0x2c33a5);_0x55c1e5[_0x0b7c('0x19')]=_0x55c1e5[_0x0b7c('0x19')][_0x0b7c('0x1a')](_0x5a7d55);return _0x55c1e5;}function createTables(_0x241d25){var _0x2ad7e9=[];var _0x5d124f=_[_0x0b7c('0x1b')](Object[_0x0b7c('0x1c')](_0x241d25[0x0]),0x5);_0x5d124f[_0x0b7c('0x1d')](function(_0x2b98c3){_0x2ad7e9['push'](createTable(_0x2b98c3,_0x241d25));});return _0x2ad7e9;}function getPDFDocDefinition(_0x28faca){var _0x3e6fa2=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x0b7c('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x0b7c('0x1f')](FORMAT));var _0x311146=[];for(var _0x5d1b70=0x0;_0x5d1b70<_0x28faca[_0x0b7c('0x17')];_0x5d1b70++){var _0x4e5fbb=[];if(_0x5d1b70===0x0){_0x4e5fbb[_0x0b7c('0x20')]({'text':_0x3e6fa2,'style':_0x0b7c('0x21')});}var _0x3e6dc6={'table':_0x28faca[_0x5d1b70]};if(_0x5d1b70>0x0){_0x3e6dc6[_0x0b7c('0x22')]=_0x0b7c('0x23');_0x3e6dc6[_0x0b7c('0x24')]=[0x0,0x46,0x0,0x0];}_0x4e5fbb['push'](_0x3e6dc6);_0x311146[_0x0b7c('0x20')](_0x4e5fbb);}return{'pageSize':'A4','pageOrientation':_0x0b7c('0x25'),'content':_0x311146,'footer':function(_0x31cab4,_0x3bdffc){return{'text':_0x31cab4[_0x0b7c('0x14')]()+_0x0b7c('0x26')+_0x3bdffc,'style':_0x0b7c('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x0b7c('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x13f7fc){var _0x187dbb=0x1388;var _0x2e7599;if(!_0x13f7fc[0x0][_0x0b7c('0x29')]){return analyticExtractedReport('Empty');}return db[_0x0b7c('0x2a')][_0x0b7c('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0b7c('0x2c')]})[_0x0b7c('0x2d')](function(_0x55f7e0){if(_0x55f7e0){_0x2e7599=_0x55f7e0;_0x187dbb=_0x2e7599[_0x0b7c('0x2c')]||0x3e8;}})['then'](function(){var _0x595130=[];var _0x141a0a=0x0;if(_0x2e7599[_0x0b7c('0x2e')]){if(_0x13f7fc&&_0x13f7fc[_0x0b7c('0x17')]){var _0x87352b=_[_0x0b7c('0x2f')](_0x13f7fc[0x0]['num']/_0x187dbb);var _0x117192=Number[_0x0b7c('0x30')](_0x13f7fc[0x0][_0x0b7c('0x29')]/_0x187dbb)?_0x13f7fc[0x0][_0x0b7c('0x29')]%_0x187dbb:0x0;_0x87352b[_0x0b7c('0x1d')](function(_0xabbf90){if(_0xabbf90>0x0){_0x141a0a+=_0x187dbb;}_0x595130[_0x0b7c('0x20')](dbH[_0x0b7c('0x31')][_0x0b7c('0x32')](util[_0x0b7c('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x187dbb,_0x141a0a),{'type':dbH['sequelize']['QueryTypes'][_0x0b7c('0x33')]}));});if(_0x117192>0x0){_0x141a0a+=_0x187dbb;_0x595130['push'](dbH[_0x0b7c('0x31')][_0x0b7c('0x32')](util[_0x0b7c('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x117192,_0x141a0a),{'type':dbH[_0x0b7c('0x31')][_0x0b7c('0x34')][_0x0b7c('0x33')]}));}}}else{_0x595130[_0x0b7c('0x20')](dbH[_0x0b7c('0x31')][_0x0b7c('0x32')](QUERY,{'type':dbH['sequelize'][_0x0b7c('0x34')][_0x0b7c('0x33')]}));}var _0xfe5685=path[_0x0b7c('0x35')](PATH);var _0x4a7caa=path[_0x0b7c('0x36')](PATH,_0x0b7c('0x37'));var _0xf77e1d=_0x2e7599['split']&&_0x595130[_0x0b7c('0x17')]>0x1;var _0xda74d5=[];if(!fs['existsSync'](path[_0x0b7c('0x38')](_0xfe5685,_0x4a7caa))&&_0xf77e1d){fs['mkdirSync'](path[_0x0b7c('0x38')](_0xfe5685,_0x4a7caa));}return BPromise['each'](_0x595130,function(_0x2db25c){_0xda74d5[_0x0b7c('0x20')](_0x2db25c);})['then'](function(){var _0x38355c=[];for(var _0x24d12e=0x0;_0x24d12e<_0xda74d5[_0x0b7c('0x17')];_0x24d12e+=0x1){var _0x42642c=_0xda74d5[_0x24d12e];var _0x297bb6=createTables(_[_0x0b7c('0x39')](_0x42642c));var _0xa1a4f7;var _0x425f11=getPDFDocDefinition(_0x297bb6);var _0x9e43df=getPDFPrinter();var _0x33ac32=_0x9e43df['createPdfKitDocument'](_0x425f11);if(_0xf77e1d){_0xa1a4f7=path[_0x0b7c('0x38')](_0xfe5685,_0x4a7caa,util[_0x0b7c('0x1f')](_0x0b7c('0x3a'),_0x4a7caa,_0x24d12e,_0x0b7c('0x3b')));}else{_0xa1a4f7=path[_0x0b7c('0x38')](_0xfe5685,util['format']('%s.%s',_0x4a7caa,'pdf'));}_0x38355c[_0x0b7c('0x20')](writePDFDocument(_0x33ac32,_0xa1a4f7));}return Promise[_0x0b7c('0x3c')](_0x38355c);})[_0x0b7c('0x2d')](function(){if(_0xf77e1d){return new Promise(function(_0x3c5bc5){zipdir(path[_0x0b7c('0x38')](_0xfe5685,_0x4a7caa),{'saveTo':path[_0x0b7c('0x38')](_0xfe5685,util[_0x0b7c('0x1f')](_0x0b7c('0x3d'),_0x4a7caa,_0x0b7c('0x3e')))},function(){rimraf(path[_0x0b7c('0x38')](_0xfe5685,_0x4a7caa),function(){});_0x3c5bc5(_0x0b7c('0x3f'));});});}})[_0x0b7c('0x2d')](function(){if(!_0xf77e1d)return;rimraf(path['join'](_0xfe5685,_0x4a7caa),function(){});})[_0x0b7c('0x2d')](function(){logger[_0x0b7c('0x40')](util[_0x0b7c('0x1f')](_0x0b7c('0x41'),EXTRACTED_REPORT_ID,_0x0b7c('0x42')));return analyticExtractedReport(_0x0b7c('0x43'),_0xf77e1d?util[_0x0b7c('0x1f')](_0x0b7c('0x3d'),_0x4a7caa,_0xf77e1d?_0x0b7c('0x3e'):_0x0b7c('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0b7c('0x40')](util[_0x0b7c('0x1f')](_0x0b7c('0x44'),EXTRACTED_REPORT_ID,_0x0b7c('0x42')));return db[_0x0b7c('0xf')][_0x0b7c('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0b7c('0x2d')](function(_0x5b0856){EXTRACTED_REPORT=_0x5b0856;return dbH[_0x0b7c('0x31')][_0x0b7c('0x32')](util[_0x0b7c('0x1f')](_0x0b7c('0x46'),QUERY),{'type':dbH[_0x0b7c('0x31')][_0x0b7c('0x34')][_0x0b7c('0x33')]});})[_0x0b7c('0x2d')](extractReport)[_0x0b7c('0x47')](function(_0x14eb4a){logger[_0x0b7c('0x40')](util[_0x0b7c('0x1f')](_0x0b7c('0x48'),EXTRACTED_REPORT_ID,_0x0b7c('0x42')),util['inspect'](_0x14eb4a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0b7c('0x49'));})[_0x0b7c('0x4a')](function(){process[_0x0b7c('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2d6456=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x0b7c('0x4c'),'italics':__dirname+_0x0b7c('0x4d'),'bolditalics':__dirname+_0x0b7c('0x4e')}});return _0x2d6456;}function getPDFDocDefinitionFromHTML(_0x3ea826,_0x362e05){var _0x59d842=util[_0x0b7c('0x1f')](_0x0b7c('0x4f'),_0x362e05['channel'],_0x362e05[_0x0b7c('0x50')]);var _0x573e7e=moment()['format'](_0x0b7c('0x51'))[_0x0b7c('0x14')]();var _0x440b5f=htmlToPdfmake(_0x3ea826,{'window':window,'tableAutoSize':!![]});return{'content':[_0x440b5f],'defaultStyle':{'font':_0x0b7c('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0b7c('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0b7c('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x0b7c('0x54'),'style':_0x0b7c('0x21')}];},'footer':function(_0x122445,_0x152730){return[{'text':util[_0x0b7c('0x1f')](_0x0b7c('0x55'),_0x59d842,_0x122445,_0x152730,_0x573e7e),'style':_0x0b7c('0x27')}];}};}function writePDFDocument(_0x583945,_0x4c83ca){return new Promise(function(_0x204996,_0x924e86){var _0x550ec8=_0x583945['pipe'](fs['createWriteStream'](_0x4c83ca));_0x550ec8['on'](_0x0b7c('0x56'),function(){_0x204996(_0x0b7c('0x56'));});_0x550ec8['on']('error',function(_0x2b307f){_0x924e86(_0x2b307f);});_0x583945[_0x0b7c('0x57')]();});}exports[_0x0b7c('0x58')]=function(_0x2f6e7a,_0x2ccdae){var _0x1f753a=getPDFPrinter();var _0x11018a=getPDFDocDefinitionFromHTML(_0x2f6e7a,_0x2ccdae);var _0x110678=_0x1f753a['createPdfKitDocument'](_0x11018a);return writePDFDocument(_0x110678,_0x2ccdae['path'])[_0x0b7c('0x47')](function(_0x13ea80){throw _0x13ea80;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 1e4a3c1..d39bec4 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 _0xae6c=['Empty','length','range','forEach','sequelize','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','argv','savename','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num'];(function(_0x3a7cd9,_0x5090af){var _0x13874f=function(_0x3b0fd5){while(--_0x3b0fd5){_0x3a7cd9['push'](_0x3a7cd9['shift']());}};_0x13874f(++_0x5090af);}(_0xae6c,0x7a));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xcae6('0x0'));var path=require('path');var _=require(_0xcae6('0x1'));var fs=require('fs');var json2xls=require(_0xcae6('0x2'));var BPromise=require(_0xcae6('0x3'));var zipdir=require(_0xcae6('0x4'));var rimraf=require('rimraf');var db=require(_0xcae6('0x5'))['db'];var dbH=require('../../mysqldb')[_0xcae6('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcae6('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcae6('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x380302,_0x5dd8b4){var _0x4fb836={'status':_0x380302};var _0x5203d5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5dd8b4){_0x4fb836[_0xcae6('0x8')]=_0x5dd8b4;}return db['AnalyticExtractedReport']['update'](_0x4fb836,_0x5203d5);}function main(){var _0xa28145=0x1388;var _0x57cbb6;logger[_0xcae6('0x9')](util[_0xcae6('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcae6('0xb')));return db[_0xcae6('0xc')][_0xcae6('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcae6('0xe'),_0xcae6('0xf')]})[_0xcae6('0x10')](function(_0x9509f4){if(_0x9509f4){_0x57cbb6=_0x9509f4;_0xa28145=_0x57cbb6['splitSizeXlsx']||0x1388;}})[_0xcae6('0x10')](function(){return dbH['sequelize'][_0xcae6('0x11')](util[_0xcae6('0xa')](_0xcae6('0x12'),QUERY),{'type':dbH['sequelize'][_0xcae6('0x13')][_0xcae6('0x14')]});})['then'](function(_0x53efd9){if(!_0x53efd9[0x0][_0xcae6('0x15')]){return analyticExtractedReport(_0xcae6('0x16'));}var _0x1c3aa9=[];var _0x2ea061=0x0;if(_0x57cbb6[_0xcae6('0xe')]){if(_0x53efd9&&_0x53efd9[_0xcae6('0x17')]){var _0x36a0b5=_[_0xcae6('0x18')](_0x53efd9[0x0]['num']/_0xa28145);var _0x41f444=Number['isInteger'](_0x53efd9[0x0][_0xcae6('0x15')]/_0xa28145)?_0x53efd9[0x0][_0xcae6('0x15')]%_0xa28145:0x0;_0x36a0b5[_0xcae6('0x19')](function(_0x2480a6){if(_0x2480a6>0x0){_0x2ea061+=_0xa28145;}_0x1c3aa9['push'](dbH[_0xcae6('0x1a')][_0xcae6('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xa28145,_0x2ea061),{'type':dbH['sequelize'][_0xcae6('0x13')]['SELECT']}));});if(_0x41f444>0x0){_0x2ea061+=_0xa28145;_0x1c3aa9[_0xcae6('0x1b')](dbH[_0xcae6('0x1a')][_0xcae6('0x11')](util[_0xcae6('0xa')](_0xcae6('0x1c'),QUERY,_0x41f444,_0x2ea061),{'type':dbH[_0xcae6('0x1a')][_0xcae6('0x13')][_0xcae6('0x14')]}));}}}else{_0x1c3aa9[_0xcae6('0x1b')](dbH[_0xcae6('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xcae6('0x13')]['SELECT']}));}var _0x8edc2c=path[_0xcae6('0x1d')](PATH);var _0x2d8d1f=path[_0xcae6('0x1e')](PATH,_0xcae6('0x1f'));var _0x562dc3=_0x57cbb6['split']&&_0x1c3aa9[_0xcae6('0x17')]>0x1;var _0x3ede10=[];if(!fs[_0xcae6('0x20')](path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f))&&_0x562dc3){fs[_0xcae6('0x22')](path['join'](_0x8edc2c,_0x2d8d1f));}return BPromise[_0xcae6('0x23')](_0x1c3aa9,function(_0x5df061){_0x3ede10[_0xcae6('0x1b')](_0x5df061);})[_0xcae6('0x10')](function(){for(var _0x12dd82=0x0;_0x12dd82<_0x3ede10[_0xcae6('0x17')];_0x12dd82+=0x1){var _0x4c1346;var _0x3391ef=_0x3ede10[_0x12dd82];if(_0x562dc3){_0x4c1346=path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f,util['format'](_0xcae6('0x24'),_0x2d8d1f,_0x12dd82,_0xcae6('0x25')));}else{_0x4c1346=path[_0xcae6('0x21')](_0x8edc2c,util[_0xcae6('0xa')]('%s.%s',_0x2d8d1f,_0xcae6('0x25')));}fs['writeFileSync'](_0x4c1346,json2xls(_0x3391ef),'binary');}})[_0xcae6('0x10')](function(){if(_0x562dc3){return new Promise(function(_0x4c52ba){zipdir(path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f),{'saveTo':path[_0xcae6('0x21')](_0x8edc2c,util[_0xcae6('0xa')](_0xcae6('0x26'),_0x2d8d1f,_0xcae6('0x27')))},function(_0x109e38,_0x2715d2){rimraf(path[_0xcae6('0x21')](_0x8edc2c,_0x2d8d1f),function(){});_0x4c52ba(_0xcae6('0x28'));});});}})[_0xcae6('0x10')](function(){logger[_0xcae6('0x9')](util['format'](_0xcae6('0x29'),EXTRACTED_REPORT_ID,_0xcae6('0xb')));return analyticExtractedReport(_0xcae6('0x2a'),_0x562dc3?util[_0xcae6('0xa')](_0xcae6('0x26'),_0x2d8d1f,_0x562dc3?_0xcae6('0x27'):_0xcae6('0x25')):null);});})[_0xcae6('0x2b')](function(_0x250a4f){logger['info'](util[_0xcae6('0xa')](_0xcae6('0x2c'),EXTRACTED_REPORT_ID,_0xcae6('0xb')),util[_0xcae6('0x2d')](_0x250a4f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcae6('0x2e'));})['finally'](function(){process[_0xcae6('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xc5a8=['length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','mkdirSync','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty'];(function(_0x146ca3,_0x29a10e){var _0x30dd24=function(_0x4b4f36){while(--_0x4b4f36){_0x146ca3['push'](_0x146ca3['shift']());}};_0x30dd24(++_0x29a10e);}(_0xc5a8,0x11a));var _0x8c5a=function(_0x37e424,_0x13896b){_0x37e424=_0x37e424-0x0;var _0x66397a=_0xc5a8[_0x37e424];return _0x66397a;};'use strict';var util=require(_0x8c5a('0x0'));var path=require(_0x8c5a('0x1'));var _=require(_0x8c5a('0x2'));var fs=require('fs');var json2xls=require(_0x8c5a('0x3'));var BPromise=require(_0x8c5a('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x8c5a('0x5'))['db'];var dbH=require(_0x8c5a('0x5'))[_0x8c5a('0x6')];var logger=require('../../config/logger')(_0x8c5a('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x8c5a('0x8')][0x2]);var QUERY=process[_0x8c5a('0x8')][0x3];var PATH=process[_0x8c5a('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x20353b,_0x549bc3){var _0x2ade80={'status':_0x20353b};var _0x1a74d2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x549bc3){_0x2ade80[_0x8c5a('0x9')]=_0x549bc3;}return db[_0x8c5a('0xa')][_0x8c5a('0xb')](_0x2ade80,_0x1a74d2);}function main(){var _0x368f07=0x1388;var _0x2f6971;logger['info'](util[_0x8c5a('0xc')](_0x8c5a('0xd'),EXTRACTED_REPORT_ID,_0x8c5a('0xe')));return db['Setting'][_0x8c5a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8c5a('0x10'),_0x8c5a('0x11')]})[_0x8c5a('0x12')](function(_0x371ff6){if(_0x371ff6){_0x2f6971=_0x371ff6;_0x368f07=_0x2f6971['splitSizeXlsx']||0x1388;}})[_0x8c5a('0x12')](function(){return dbH[_0x8c5a('0x13')][_0x8c5a('0x14')](util['format'](_0x8c5a('0x15'),QUERY),{'type':dbH['sequelize'][_0x8c5a('0x16')]['SELECT']});})[_0x8c5a('0x12')](function(_0x550111){if(!_0x550111[0x0]['num']){return analyticExtractedReport(_0x8c5a('0x17'));}var _0x163a17=[];var _0x4d1c37=0x0;if(_0x2f6971[_0x8c5a('0x10')]){if(_0x550111&&_0x550111[_0x8c5a('0x18')]){var _0xcf7167=_[_0x8c5a('0x19')](_0x550111[0x0][_0x8c5a('0x1a')]/_0x368f07);var _0x50442d=Number[_0x8c5a('0x1b')](_0x550111[0x0]['num']/_0x368f07)?_0x550111[0x0]['num']%_0x368f07:0x0;_0xcf7167['forEach'](function(_0x4e94e6){if(_0x4e94e6>0x0){_0x4d1c37+=_0x368f07;}_0x163a17[_0x8c5a('0x1c')](dbH[_0x8c5a('0x13')]['query'](util[_0x8c5a('0xc')](_0x8c5a('0x1d'),QUERY,_0x368f07,_0x4d1c37),{'type':dbH['sequelize']['QueryTypes'][_0x8c5a('0x1e')]}));});if(_0x50442d>0x0){_0x4d1c37+=_0x368f07;_0x163a17[_0x8c5a('0x1c')](dbH['sequelize'][_0x8c5a('0x14')](util[_0x8c5a('0xc')](_0x8c5a('0x1d'),QUERY,_0x50442d,_0x4d1c37),{'type':dbH[_0x8c5a('0x13')][_0x8c5a('0x16')][_0x8c5a('0x1e')]}));}}}else{_0x163a17[_0x8c5a('0x1c')](dbH[_0x8c5a('0x13')][_0x8c5a('0x14')](QUERY,{'type':dbH['sequelize'][_0x8c5a('0x16')]['SELECT']}));}var _0x5e0489=path[_0x8c5a('0x1f')](PATH);var _0xb7155a=path[_0x8c5a('0x20')](PATH,_0x8c5a('0x21'));var _0x3480df=_0x2f6971[_0x8c5a('0x10')]&&_0x163a17[_0x8c5a('0x18')]>0x1;var _0x44f32d=[];if(!fs[_0x8c5a('0x22')](path['join'](_0x5e0489,_0xb7155a))&&_0x3480df){fs[_0x8c5a('0x23')](path['join'](_0x5e0489,_0xb7155a));}return BPromise['each'](_0x163a17,function(_0x3e176e){_0x44f32d['push'](_0x3e176e);})['then'](function(){for(var _0x36b286=0x0;_0x36b286<_0x44f32d[_0x8c5a('0x18')];_0x36b286+=0x1){var _0x42be58;var _0x80c481=_0x44f32d[_0x36b286];if(_0x3480df){_0x42be58=path[_0x8c5a('0x24')](_0x5e0489,_0xb7155a,util[_0x8c5a('0xc')](_0x8c5a('0x25'),_0xb7155a,_0x36b286,_0x8c5a('0x26')));}else{_0x42be58=path[_0x8c5a('0x24')](_0x5e0489,util[_0x8c5a('0xc')]('%s.%s',_0xb7155a,'xlsx'));}fs[_0x8c5a('0x27')](_0x42be58,json2xls(_0x80c481),_0x8c5a('0x28'));}})['then'](function(){if(_0x3480df){return new Promise(function(_0x4765f4){zipdir(path[_0x8c5a('0x24')](_0x5e0489,_0xb7155a),{'saveTo':path[_0x8c5a('0x24')](_0x5e0489,util[_0x8c5a('0xc')](_0x8c5a('0x29'),_0xb7155a,'zip'))},function(_0x4ff8e5,_0x6e7ca8){rimraf(path[_0x8c5a('0x24')](_0x5e0489,_0xb7155a),function(){});_0x4765f4(_0x8c5a('0x2a'));});});}})[_0x8c5a('0x12')](function(){logger[_0x8c5a('0x2b')](util[_0x8c5a('0xc')](_0x8c5a('0x2c'),EXTRACTED_REPORT_ID,_0x8c5a('0xe')));return analyticExtractedReport(_0x8c5a('0x2d'),_0x3480df?util[_0x8c5a('0xc')](_0x8c5a('0x29'),_0xb7155a,_0x3480df?'zip':_0x8c5a('0x26')):null);});})[_0x8c5a('0x2e')](function(_0x103d2d){logger[_0x8c5a('0x2b')](util[_0x8c5a('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8c5a('0xe')),util[_0x8c5a('0x2f')](_0x103d2d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8c5a('0x30'));})[_0x8c5a('0x31')](function(){process[_0x8c5a('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 0313606..9171d83 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 _0xa421=['queue','playback','hasOwnProperty','extension','find','extensions','push','type','Set','CDR(type)=%s','context','priority','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','intervals','findAll','IntervalId','then','VoiceExtension','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten'];(function(_0x55f380,_0x3e27f0){var _0x36b38e=function(_0x31bbc6){while(--_0x31bbc6){_0x55f380['push'](_0x55f380['shift']());}};_0x36b38e(++_0x3e27f0);}(_0xa421,0x1c7));var _0x1a42=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa421[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x1a42('0x0'));var util=require(_0x1a42('0x1'));function rewrite(_0x6787a,_0x9483c7){var _0x5c22d3=this;return _0x6787a[_0x1a42('0x2')][_0x1a42('0x3')]['findAll']({'raw':!![]})['then'](function(_0x35d13d){_0x5c22d3[_0x1a42('0x4')]=_0x35d13d;return _0x6787a[_0x1a42('0x2')]['VoiceExtension'][_0x1a42('0x5')]({'where':{'IntervalId':_0x9483c7[_0x1a42('0x6')]},'raw':!![]});})[_0x1a42('0x7')](function(_0x3d8255){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x5')]({'where':{'exten':{'$in':_[_0x1a42('0x9')](_['map'](_0x3d8255,'exten'))}},'order':[{'raw':_0x1a42('0xa')}],'raw':!![]});})[_0x1a42('0x7')](function(_0x19b748){var _0x1adbe2=_[_0x1a42('0xb')](_0x19b748,{'priority':'1'});var _0x296f8f=_[_0x1a42('0xb')](_0x19b748,{'isApp':0x1});var _0x497789=_['groupBy'](_0x296f8f,_0x1a42('0xc'));var _0x359bc6=[_0x1a42('0xd'),_0x1a42('0xe')];var _0x1fa89c=[];var _0x468f6d=[];for(var _0x4133b7 in _0x497789){if(_0x497789[_0x1a42('0xf')](_0x4133b7)){_0x5c22d3['priority']=0x2;_0x5c22d3['extensions']=[];_0x5c22d3[_0x1a42('0x10')]=_[_0x1a42('0x11')](_0x1adbe2,{'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')]});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':util['format'](_0x1a42('0x16'),_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});if(_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]==='inbound'){_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x19')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}else if(_0x497789[_0x4133b7][0x0][_0x1a42('0x14')]===_0x1a42('0x1b')){if(_0x5c22d3[_0x1a42('0x10')]){_0x5c22d3['extensions']['push']({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x1c')+(_0x5c22d3[_0x1a42('0x10')]['cutdigits']?_0x1a42('0x1d')+_0x5c22d3[_0x1a42('0x10')]['cutdigits']+'}':_0x1a42('0x1e')),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':'Set','appdata':_0x1a42('0x19')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});var _0x217681=_0x5c22d3[_0x1a42('0x18')]++;_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x20')+(_0x217681+0x2)+_0x1a42('0x21')+(_0x217681+0x1)+')','context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x217681,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});if(_0x5c22d3['extension']){_0x5c22d3[_0x1a42('0x12')]['push']({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x22')]?_0x1a42('0x23')+_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x22')]+'}':_0x1a42('0x24'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x25')+_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')],'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});if(_0x5c22d3[_0x1a42('0x10')]&&_0x5c22d3['extension']['hasOwnProperty']('recordingFormat')&&_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x26')]!==_0x1a42('0x27')){_0x5c22d3['extensions']['push']({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x28'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x29')+_0x5c22d3[_0x1a42('0x10')][_0x1a42('0x26')]||_0x1a42('0x2a'),'context':_0x497789[_0x4133b7][0x0]['context'],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});}}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x2b'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0][_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3['priority']++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x5c22d3[_0x1a42('0x12')]['push']({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x2c'),'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'exten':_0x497789[_0x4133b7][0x0]['exten'],'priority':_0x5c22d3[_0x1a42('0x18')]++,'VoiceExtensionId':_0x497789[_0x4133b7][0x0][_0x1a42('0x1a')]});for(var _0x55098=0x0,_0x4ea060=0x0;_0x55098<_0x497789[_0x4133b7][_0x1a42('0x2d')];_0x55098+=0x1,_0x4ea060=0x0){var _0x4eb69b=_0x497789[_0x4133b7][_0x55098];if(_0x4eb69b['type']){_0x4eb69b['type']=_0x4eb69b[_0x1a42('0x14')]['toLowerCase']();}var _0x207894=[];var _0x1697e7=[];delete _0x4eb69b['id'];delete _0x4eb69b[_0x1a42('0x2e')];delete _0x4eb69b[_0x1a42('0x2f')];var _0x4c4e39=_0x4eb69b[_0x1a42('0x30')]!==_0x1a42('0x31')?[_0x4eb69b[_0x1a42('0x30')]]:_0x4eb69b[_0x1a42('0x6')]?_[_0x1a42('0x32')](_['filter'](_0x5c22d3[_0x1a42('0x4')],{'IntervalId':_0x4eb69b[_0x1a42('0x6')]}),_0x1a42('0x30')):[];if(_0x4eb69b['hasOwnProperty'](_0x1a42('0x33'))){if(_0x4eb69b[_0x1a42('0x33')]&&_0x4eb69b[_0x1a42('0x33')]!=='--'){_0x207894['push']({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x34')+_0x4eb69b[_0x1a42('0x33')],'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b['exten'],'priority':_0x4c4e39['length']+_0x5c22d3['priority']+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}if(_0x4eb69b[_0x1a42('0x14')]===_0x1a42('0x1b')&&_0x4eb69b[_0x1a42('0xf')](_0x1a42('0x35'))){if(_0x4eb69b[_0x1a42('0x35')]){_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x36')+_0x4eb69b[_0x1a42('0x35')]+')','context':_0x4eb69b['context'],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}else{_0x207894['push']({'type':_0x4eb69b['type'],'app':'ExecIf','appdata':_0x1a42('0x37'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}if(_0x4eb69b[_0x1a42('0xf')](_0x1a42('0x38'))){if(_0x359bc6[_0x1a42('0x39')](_0x4eb69b[_0x1a42('0x3a')][_0x1a42('0x3b')]())>=0x0&&_0x4eb69b[_0x1a42('0x3c')]!==_0x1a42('0x3d')){if(_0x4eb69b[_0x1a42('0x38')]){_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x1f'),'appdata':_0x1a42('0x3e'),'context':_0x4eb69b['context'],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x15'),'appdata':_0x1a42('0x3f'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}else{_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':'ExecIf','appdata':_0x1a42('0x40'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});_0x207894[_0x1a42('0x13')]({'type':_0x4eb69b[_0x1a42('0x14')],'app':'Set','appdata':_0x1a42('0x41'),'context':_0x4eb69b[_0x1a42('0x17')],'exten':_0x4eb69b[_0x1a42('0xc')],'priority':_0x4c4e39[_0x1a42('0x2d')]+_0x5c22d3[_0x1a42('0x18')]+_0x4ea060++,'VoiceExtensionId':_0x4eb69b[_0x1a42('0x1a')]});}}}for(var _0x32c14d=0x0;_0x32c14d<_0x4c4e39['length'];_0x32c14d+=0x1){var _0x43556d=_0x5c22d3[_0x1a42('0x18')]+_0x4c4e39['length'];var _0x2edad7=_0x32c14d===_0x4c4e39[_0x1a42('0x2d')]-0x1?_0x5c22d3['priority']+_0x207894[_0x1a42('0x2d')]+_0x1697e7['length']+0x2:_0x5c22d3[_0x1a42('0x18')]+_0x32c14d+0x1;_0x207894['splice'](_0x32c14d,0x0,{'type':_0x4eb69b[_0x1a42('0x14')],'app':_0x1a42('0x42'),'appdata':_0x4c4e39[_0x32c14d]+'?'+_0x4eb69b[_0x1a42('0x17')]+_0x1a42('0x43')+_0x43556d+':'+_0x4eb69b[_0x1a42('0x17')]+_0x1a42('0x43')+_0x2edad7,'exten':_0x4eb69b[_0x1a42('0xc')],'context':_0x4eb69b[_0x1a42('0x17')],'priority':_0x5c22d3[_0x1a42('0x18')]+_0x32c14d,'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});}_0x4eb69b['priority']=_0x207894[_0x1a42('0x2d')]?_['last'](_0x207894)[_0x1a42('0x18')]+0x1:_0x5c22d3[_0x1a42('0x18')];_0x5c22d3[_0x1a42('0x18')]=(_0x1697e7[_0x1a42('0x2d')]?_[_0x1a42('0x44')](_0x1697e7)['priority']:_0x4eb69b[_0x1a42('0x18')])+0x1;_0x5c22d3[_0x1a42('0x12')]=_[_0x1a42('0x45')](_0x5c22d3[_0x1a42('0x12')],_0x207894,[_0x4eb69b],_0x1697e7);}_0x5c22d3[_0x1a42('0x12')][_0x1a42('0x13')]({'type':_0x497789[_0x4133b7][0x0]['type'],'app':_0x1a42('0x46'),'exten':_0x497789[_0x4133b7][0x0][_0x1a42('0xc')],'context':_0x497789[_0x4133b7][0x0][_0x1a42('0x17')],'priority':_0x5c22d3[_0x1a42('0x18')],'VoiceExtensionId':_0x497789[_0x4133b7][0x0]['VoiceExtensionId']});_0x1fa89c[_0x1a42('0x13')](_0x497789[_0x4133b7][0x0]['VoiceExtensionId']);_0x468f6d=_['concat'](_0x468f6d,_0x5c22d3[_0x1a42('0x12')]);}}return _0x6787a[_0x1a42('0x47')](function(_0x2a4db6){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x48')]({'where':{'VoiceExtensionId':{'$in':_0x1fa89c}},'transaction':_0x2a4db6})[_0x1a42('0x7')](function(_0x16345c){return _0x6787a[_0x1a42('0x2')][_0x1a42('0x8')][_0x1a42('0x49')](_[_0x1a42('0x4a')](_0x468f6d,'priority'),{'transaction':_0x2a4db6});});});})[_0x1a42('0x4b')](function(_0x1b677b){console[_0x1a42('0x4c')](_0x1b677b);});}exports[_0x1a42('0x4d')]=rewrite; \ No newline at end of file +var _0xe4a8=['splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','extension','find','extensions','type','Set','CDR(type)=%s','context','priority','VoiceExtensionId','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x216275,_0x24413c){var _0x19baff=function(_0x55c972){while(--_0x55c972){_0x216275['push'](_0x216275['shift']());}};_0x19baff(++_0x24413c);}(_0xe4a8,0xd8));var _0x8e4a=function(_0x353247,_0x1466f9){_0x353247=_0x353247-0x0;var _0x45886e=_0xe4a8[_0x353247];return _0x45886e;};'use strict';var _=require(_0x8e4a('0x0'));var util=require(_0x8e4a('0x1'));function rewrite(_0xd2dab2,_0x5f1d47){var _0x3993d9=this;return _0xd2dab2[_0x8e4a('0x2')][_0x8e4a('0x3')][_0x8e4a('0x4')]({'raw':!![]})[_0x8e4a('0x5')](function(_0x3187a2){_0x3993d9[_0x8e4a('0x6')]=_0x3187a2;return _0xd2dab2[_0x8e4a('0x2')][_0x8e4a('0x7')][_0x8e4a('0x4')]({'where':{'IntervalId':_0x5f1d47[_0x8e4a('0x8')]},'raw':!![]});})['then'](function(_0x229607){return _0xd2dab2[_0x8e4a('0x2')][_0x8e4a('0x7')][_0x8e4a('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x8e4a('0x9')](_0x229607,_0x8e4a('0xa')))}},'order':[{'raw':_0x8e4a('0xb')}],'raw':!![]});})[_0x8e4a('0x5')](function(_0x4797dc){var _0x3e3276=_[_0x8e4a('0xc')](_0x4797dc,{'priority':'1'});var _0x46b96d=_[_0x8e4a('0xc')](_0x4797dc,{'isApp':0x1});var _0x50fe5c=_['groupBy'](_0x46b96d,_0x8e4a('0xa'));var _0x205abc=[_0x8e4a('0xd'),_0x8e4a('0xe')];var _0x17fd70=[];var _0x17145b=[];for(var _0xfc842f in _0x50fe5c){if(_0x50fe5c['hasOwnProperty'](_0xfc842f)){_0x3993d9['priority']=0x2;_0x3993d9['extensions']=[];_0x3993d9[_0x8e4a('0xf')]=_[_0x8e4a('0x10')](_0x3e3276,{'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')]});_0x3993d9[_0x8e4a('0x11')]['push']({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':util['format'](_0x8e4a('0x14'),_0x50fe5c[_0xfc842f][0x0]['type']),'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0]['exten'],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});if(_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')]==='inbound'){_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x19')+_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')],'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});}else if(_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')]===_0x8e4a('0x1a')){if(_0x3993d9[_0x8e4a('0xf')]){_0x3993d9[_0x8e4a('0x11')]['push']({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':'Set','appdata':_0x8e4a('0x1b')+(_0x3993d9['extension'][_0x8e4a('0x1c')]?'${EXTEN:'+_0x3993d9['extension'][_0x8e4a('0x1c')]+'}':_0x8e4a('0x1d')),'context':_0x50fe5c[_0xfc842f][0x0]['context'],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9['priority']++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});}_0x3993d9['extensions']['push']({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x19')+_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')],'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0]['VoiceExtensionId']});var _0x41c611=_0x3993d9[_0x8e4a('0x16')]++;_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x1e'),'appdata':_0x8e4a('0x1f')+(_0x41c611+0x2)+_0x8e4a('0x20')+(_0x41c611+0x1)+')','context':_0x50fe5c[_0xfc842f][0x0]['context'],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x41c611,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0]['VoiceExtensionId']});if(_0x3993d9[_0x8e4a('0xf')]){_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x3993d9[_0x8e4a('0xf')][_0x8e4a('0x1c')]?_0x8e4a('0x21')+_0x3993d9[_0x8e4a('0xf')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0]['exten'],'priority':_0x3993d9['priority']++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});}_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x22')+_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')],'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9['priority']++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0]['VoiceExtensionId']});if(_0x3993d9[_0x8e4a('0xf')]&&_0x3993d9[_0x8e4a('0xf')][_0x8e4a('0x23')](_0x8e4a('0x24'))&&_0x3993d9[_0x8e4a('0xf')][_0x8e4a('0x24')]!=='none'){_0x3993d9['extensions']['push']({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x50fe5c[_0xfc842f][0x0]['context'],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0]['VoiceExtensionId']});_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3993d9[_0x8e4a('0xf')][_0x8e4a('0x24')]||_0x8e4a('0x25'),'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0]['VoiceExtensionId']});}}_0x3993d9[_0x8e4a('0x11')]['push']({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x26'),'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0]['exten'],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x27'),'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});_0x3993d9[_0x8e4a('0x11')][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x28'),'context':_0x50fe5c[_0xfc842f][0x0]['context'],'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'priority':_0x3993d9[_0x8e4a('0x16')]++,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});for(var _0x26e7de=0x0,_0x13f742=0x0;_0x26e7de<_0x50fe5c[_0xfc842f][_0x8e4a('0x29')];_0x26e7de+=0x1,_0x13f742=0x0){var _0x5ddabe=_0x50fe5c[_0xfc842f][_0x26e7de];if(_0x5ddabe[_0x8e4a('0x12')]){_0x5ddabe[_0x8e4a('0x12')]=_0x5ddabe[_0x8e4a('0x12')][_0x8e4a('0x2a')]();}var _0x593848=[];var _0xdc0876=[];delete _0x5ddabe['id'];delete _0x5ddabe[_0x8e4a('0x2b')];delete _0x5ddabe[_0x8e4a('0x2c')];var _0x3186d3=_0x5ddabe['interval']!==_0x8e4a('0x2d')?[_0x5ddabe[_0x8e4a('0x2e')]]:_0x5ddabe[_0x8e4a('0x8')]?_['map'](_[_0x8e4a('0xc')](_0x3993d9[_0x8e4a('0x6')],{'IntervalId':_0x5ddabe['IntervalId']}),'interval'):[];if(_0x5ddabe[_0x8e4a('0x23')]('tag')){if(_0x5ddabe[_0x8e4a('0x2f')]&&_0x5ddabe[_0x8e4a('0x2f')]!=='--'){_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe[_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':_0x8e4a('0x30')+_0x5ddabe[_0x8e4a('0x2f')],'context':_0x5ddabe['context'],'exten':_0x5ddabe[_0x8e4a('0xa')],'priority':_0x3186d3[_0x8e4a('0x29')]+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe[_0x8e4a('0x17')]});}}if(_0x5ddabe[_0x8e4a('0x12')]===_0x8e4a('0x1a')&&_0x5ddabe[_0x8e4a('0x23')](_0x8e4a('0x31'))){if(_0x5ddabe['callerID']){_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe['type'],'app':_0x8e4a('0x1e'),'appdata':_0x8e4a('0x32')+_0x5ddabe['callerID']+')','context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe[_0x8e4a('0xa')],'priority':_0x3186d3[_0x8e4a('0x29')]+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe['VoiceExtensionId']});}else{_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe['type'],'app':_0x8e4a('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe['exten'],'priority':_0x3186d3[_0x8e4a('0x29')]+_0x3993d9['priority']+_0x13f742++,'VoiceExtensionId':_0x5ddabe[_0x8e4a('0x17')]});}}if(_0x5ddabe['hasOwnProperty'](_0x8e4a('0x33'))){if(_0x205abc[_0x8e4a('0x34')](_0x5ddabe[_0x8e4a('0x35')][_0x8e4a('0x2a')]())>=0x0&&_0x5ddabe[_0x8e4a('0x36')]!=='custom'){if(_0x5ddabe[_0x8e4a('0x33')]){_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe[_0x8e4a('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe['exten'],'priority':_0x3186d3['length']+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe['VoiceExtensionId']});_0x593848['push']({'type':_0x5ddabe[_0x8e4a('0x12')],'app':_0x8e4a('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe[_0x8e4a('0xa')],'priority':_0x3186d3[_0x8e4a('0x29')]+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe[_0x8e4a('0x17')]});}else{_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe[_0x8e4a('0x12')],'app':_0x8e4a('0x1e'),'appdata':_0x8e4a('0x37'),'context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe[_0x8e4a('0xa')],'priority':_0x3186d3[_0x8e4a('0x29')]+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe[_0x8e4a('0x17')]});_0x593848[_0x8e4a('0x18')]({'type':_0x5ddabe[_0x8e4a('0x12')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5ddabe[_0x8e4a('0x15')],'exten':_0x5ddabe[_0x8e4a('0xa')],'priority':_0x3186d3['length']+_0x3993d9[_0x8e4a('0x16')]+_0x13f742++,'VoiceExtensionId':_0x5ddabe['VoiceExtensionId']});}}}for(var _0x2290b6=0x0;_0x2290b6<_0x3186d3[_0x8e4a('0x29')];_0x2290b6+=0x1){var _0x282ba8=_0x3993d9['priority']+_0x3186d3[_0x8e4a('0x29')];var _0x521528=_0x2290b6===_0x3186d3[_0x8e4a('0x29')]-0x1?_0x3993d9[_0x8e4a('0x16')]+_0x593848[_0x8e4a('0x29')]+_0xdc0876[_0x8e4a('0x29')]+0x2:_0x3993d9[_0x8e4a('0x16')]+_0x2290b6+0x1;_0x593848[_0x8e4a('0x38')](_0x2290b6,0x0,{'type':_0x5ddabe[_0x8e4a('0x12')],'app':_0x8e4a('0x39'),'appdata':_0x3186d3[_0x2290b6]+'?'+_0x5ddabe['context']+_0x8e4a('0x3a')+_0x282ba8+':'+_0x5ddabe[_0x8e4a('0x15')]+_0x8e4a('0x3a')+_0x521528,'exten':_0x5ddabe[_0x8e4a('0xa')],'context':_0x5ddabe[_0x8e4a('0x15')],'priority':_0x3993d9[_0x8e4a('0x16')]+_0x2290b6,'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});}_0x5ddabe['priority']=_0x593848[_0x8e4a('0x29')]?_[_0x8e4a('0x3b')](_0x593848)['priority']+0x1:_0x3993d9[_0x8e4a('0x16')];_0x3993d9[_0x8e4a('0x16')]=(_0xdc0876[_0x8e4a('0x29')]?_[_0x8e4a('0x3b')](_0xdc0876)[_0x8e4a('0x16')]:_0x5ddabe['priority'])+0x1;_0x3993d9[_0x8e4a('0x11')]=_[_0x8e4a('0x3c')](_0x3993d9['extensions'],_0x593848,[_0x5ddabe],_0xdc0876);}_0x3993d9['extensions'][_0x8e4a('0x18')]({'type':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x12')],'app':_0x8e4a('0x3d'),'exten':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0xa')],'context':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x15')],'priority':_0x3993d9[_0x8e4a('0x16')],'VoiceExtensionId':_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]});_0x17fd70['push'](_0x50fe5c[_0xfc842f][0x0][_0x8e4a('0x17')]);_0x17145b=_[_0x8e4a('0x3c')](_0x17145b,_0x3993d9['extensions']);}}return _0xd2dab2[_0x8e4a('0x3e')](function(_0x2abec8){return _0xd2dab2[_0x8e4a('0x2')][_0x8e4a('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x17fd70}},'transaction':_0x2abec8})['then'](function(_0x1390a5){return _0xd2dab2[_0x8e4a('0x2')][_0x8e4a('0x7')][_0x8e4a('0x3f')](_[_0x8e4a('0x40')](_0x17145b,_0x8e4a('0x16')),{'transaction':_0x2abec8});});});})[_0x8e4a('0x41')](function(_0x25eac2){console[_0x8e4a('0x42')](_0x25eac2);});}exports[_0x8e4a('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 72a6423..e645224 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 _0x8eab=['info','CSV\x20parsed\x20correctly!','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','register','argv','undefined','Missing\x20filepath\x20parameter!','null','zipObject','split','error','contact','test','isNil','errors','message','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','then','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','ListId','createdAt','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','fromQuery','updatedAt','cm_contacts','str','calleridnum','cm_hopper_final','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','createReadStream','pause'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x8eab,0x69));var _0xb8ea=function(_0x8f2d82,_0x5a658a){_0x8f2d82=_0x8f2d82-0x0;var _0x571614=_0x8eab[_0x8f2d82];return _0x571614;};'use strict';var BPromise=require('bluebird');var util=require(_0xb8ea('0x0'));var _=require(_0xb8ea('0x1'));var fs=require('fs');var squel=require(_0xb8ea('0x2'));var Papa=require(_0xb8ea('0x3'));var Redis=require(_0xb8ea('0x4'));var db=require(_0xb8ea('0x5'))['db'];var config=require(_0xb8ea('0x6'));var logger=require(_0xb8ea('0x7'))(_0xb8ea('0x8'));config[_0xb8ea('0x9')]=_['defaults'](config['redis'],{'host':_0xb8ea('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xb8ea('0xb')](socket);try{if(!process[_0xb8ea('0xc')][0x2]||process[_0xb8ea('0xc')][0x2]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x2]==='null'){throw new Error(_0xb8ea('0xe'));}var FILEPATH=process[_0xb8ea('0xc')][0x2];if(!process[_0xb8ea('0xc')][0x3]||process[_0xb8ea('0xc')][0x3]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x3]===_0xb8ea('0xf')||!process[_0xb8ea('0xc')][0x4]||process[_0xb8ea('0xc')][0x4]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x4]===_0xb8ea('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb8ea('0x10')](process[_0xb8ea('0xc')][0x3][_0xb8ea('0x11')](','),process[_0xb8ea('0xc')][0x4][_0xb8ea('0x11')](','));if(!process['argv'][0x5]||process[_0xb8ea('0xc')][0x5]===_0xb8ea('0xd')||process['argv'][0x5]===_0xb8ea('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb8ea('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb8ea('0xc')][0x6]!==_0xb8ea('0xd')&&process[_0xb8ea('0xc')][0x6]!==_0xb8ea('0xf')?process[_0xb8ea('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb8ea('0xc')][0x7]!==_0xb8ea('0xd')&&process[_0xb8ea('0xc')][0x7]!==_0xb8ea('0xf')?process[_0xb8ea('0xc')][0x7]:null;if(!process[_0xb8ea('0xc')][0x8]||process[_0xb8ea('0xc')][0x8]===_0xb8ea('0xd')||process[_0xb8ea('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x43734a){logger[_0xb8ea('0x12')](_0x43734a);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(_0x51cbb5,_0x235ab5,_0x58721c,_0x1f5627){var _0x25d5c8={'message':_0x235ab5};_0x25d5c8[_0x51cbb5]=!![];if(_0x58721c){_0x25d5c8[_0xb8ea('0x13')]=_0x58721c;}if(_0x1f5627){_0x25d5c8['index']=_0x1f5627;}return _0x25d5c8;}function isEmail(_0x542af2){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))*$/[_0xb8ea('0x14')](_0x542af2);}function checkRow(_0x3f2840,_0x5332ae,_0x1be4d8){return new BPromise(function(_0x342537,_0x4b13a5){if(_[_0xb8ea('0x15')](_0x3f2840)){return _0x4b13a5(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1be4d8));}if(_0x3f2840[_0xb8ea('0x16')]&&_0x3f2840['errors']['length']){var _0x497412=_['map'](_0x3f2840[_0xb8ea('0x16')],_0xb8ea('0x17'))['join'](';');return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0x497412,null,_0x1be4d8));}var _0x18fd7f={};for(var _0x30ed8d in FIELDS){if(FIELDS[_0xb8ea('0x18')](_0x30ed8d)&&FIELDS[_0x30ed8d]){_0x18fd7f[_0x30ed8d]=_0x3f2840['data'][0x0][FIELDS[_0x30ed8d]]||_0x3f2840['data'][0x0]['\ufeff'+FIELDS[_0x30ed8d]];}}if(!_0x18fd7f[_0xb8ea('0x19')]){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1a'),null,_0x1be4d8));}if(!_0x18fd7f[_0xb8ea('0x1b')]){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1c'),null,_0x1be4d8));}if(_0x18fd7f[_0xb8ea('0x1d')]){var _0x3fb6a0=moment(_0x18fd7f[_0xb8ea('0x1d')],_0xb8ea('0x1e'));if(!_0x3fb6a0['isValid']()){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x1f'),null,_0x1be4d8));}}if(_0x18fd7f[_0xb8ea('0x20')]){if(!isEmail(_0x18fd7f['email'])){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x1be4d8));}}_0x18fd7f['ListId']=LISTID;_0x18fd7f[_0xb8ea('0x21')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb8ea('0x22')]&&_0x5332ae){var _0x1eef9d={};for(var _0x2f3749=0x0,_0x15d791=DUPLICATES[_0xb8ea('0x22')];_0x2f3749<_0x15d791;_0x2f3749+=0x1){_0x1eef9d[DUPLICATES[_0x2f3749]]=_0x18fd7f[DUPLICATES[_0x2f3749]];}var _0x2688a8=_[_0xb8ea('0x23')](_0x5332ae,_0x1eef9d);if(_0x2688a8){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x24'),_0xb8ea('0x25'),_0x2688a8,_0x1be4d8));}}return db[_0xb8ea('0x26')][_0xb8ea('0x27')](_0x18fd7f,{'raw':!![],'hooks':![],'fields':_['keys'](_0x18fd7f)})[_0xb8ea('0x28')](function(_0x16faed){if(DUPLICATES&&DUPLICATES[_0xb8ea('0x22')]&&_0x5332ae){_0x5332ae['push'](_['pick'](_0x18fd7f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x16faed['id'];return _0x342537();})[_0xb8ea('0x29')](function(_0x59951c){return _0x4b13a5(handleCheckRowError(_0xb8ea('0x12'),_0xb8ea('0x2a')+(_0x59951c[_0xb8ea('0x17')]||JSON['stringify'](_0x59951c)),null,_0x1be4d8));});});}function checkHopper(){function _0x4f341c(){return function(_0x32db06){logger['error'](_0xb8ea('0x2b'),'checkHopper',util[_0xb8ea('0x2c')](_0x32db06,{'showHidden':![],'depth':null}));};}var _0x5ec4fc=function(_0x2578d2,_0x36ba2b){var _0x46689d=squel[_0xb8ea('0x2d')]()[_0xb8ea('0x2e')](_0xb8ea('0x2f'))['fromQuery']([_0xb8ea('0x1b'),_0xb8ea('0x30'),_0xb8ea('0x31'),_0xb8ea('0x32'),_0x36ba2b,_0xb8ea('0x33'),'updatedAt'],squel['select']()[_0xb8ea('0x34')]('phone','phone')['field'](_0xb8ea('0x35'),_0xb8ea('0x30'))[_0xb8ea('0x34')]('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),_0xb8ea('0x32'))[_0xb8ea('0x34')](_0x2578d2['id'][_0xb8ea('0x36')](),_0x36ba2b)[_0xb8ea('0x34')](_0xb8ea('0x35'),'createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),'updatedAt')[_0xb8ea('0x37')]('cm_contacts')[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')](_0xb8ea('0x3b'))[_0xb8ea('0x38')](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()['field'](_0xb8ea('0x1b'))[_0xb8ea('0x37')](_0xb8ea('0x2f'))['where'](_0x36ba2b+_0xb8ea('0x3e'),_0x2578d2['id'][_0xb8ea('0x36')]())))[_0xb8ea('0x36')]();return _0x46689d;};var _0x1187a0=function(_0x115e90,_0x23458a){var _0x5e985c=squel[_0xb8ea('0x2d')]()['into'](_0xb8ea('0x2f'))[_0xb8ea('0x3f')]([_0xb8ea('0x1b'),_0xb8ea('0x30'),'ContactId',_0xb8ea('0x32'),_0x23458a,_0xb8ea('0x33'),_0xb8ea('0x40')],squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'),'phone')[_0xb8ea('0x34')](_0xb8ea('0x35'),'scheduledAt')['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),_0xb8ea('0x32'))[_0xb8ea('0x34')](_0x115e90['id']['toString'](),_0x23458a)[_0xb8ea('0x34')](_0xb8ea('0x35'),_0xb8ea('0x33'))['field'](_0xb8ea('0x35'),_0xb8ea('0x40'))[_0xb8ea('0x37')](_0xb8ea('0x41'))[_0xb8ea('0x38')]('deletedAt\x20IS\x20NULL')[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())['where']('id\x20IN\x20?',squel[_0xb8ea('0x42')](hopperContacts))[_0xb8ea('0x38')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x43'))[_0xb8ea('0x37')](_0xb8ea('0x44'))['where'](_0x23458a+_0xb8ea('0x3e'),_0x115e90['id'][_0xb8ea('0x36')]()))['where'](_0xb8ea('0x3c'),squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'))[_0xb8ea('0x37')](_0xb8ea('0x2f'))[_0xb8ea('0x38')](_0x23458a+'\x20=\x20?',_0x115e90['id'][_0xb8ea('0x36')]())))[_0xb8ea('0x36')]();return _0x5e985c;};function _0x16c67b(_0x266b3f,_0x4cad91){var _0x445057=squel[_0xb8ea('0x2d')]()[_0xb8ea('0x2e')]('cm_hopper')[_0xb8ea('0x3f')]([_0xb8ea('0x1b'),'scheduledAt',_0xb8ea('0x31'),_0xb8ea('0x32'),_0x4cad91,_0xb8ea('0x33'),_0xb8ea('0x40')],squel[_0xb8ea('0x3d')]()['field'](_0xb8ea('0x1b'),_0xb8ea('0x1b'))[_0xb8ea('0x34')]('NOW()',_0xb8ea('0x30'))['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),'ListId')[_0xb8ea('0x34')](_0x266b3f['id'][_0xb8ea('0x36')](),_0x4cad91)[_0xb8ea('0x34')]('NOW()','createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),_0xb8ea('0x40'))[_0xb8ea('0x37')]('cm_contacts')[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')]('id\x20IN\x20?',squel[_0xb8ea('0x42')](hopperContacts))['where'](_0xb8ea('0x3b')))[_0xb8ea('0x36')]();return _0x445057;}function _0xde433c(_0x1f54cb,_0xc4af3a){var _0x7c745c=squel['insert']()[_0xb8ea('0x2e')](_0xb8ea('0x45'))['fromQuery'](['phone',_0xb8ea('0x31'),_0xb8ea('0x32'),_0xc4af3a,_0xb8ea('0x33'),'updatedAt'],squel[_0xb8ea('0x3d')]()[_0xb8ea('0x34')](_0xb8ea('0x1b'),_0xb8ea('0x1b'))['field']('id',_0xb8ea('0x31'))[_0xb8ea('0x34')](LISTID[_0xb8ea('0x36')](),'ListId')[_0xb8ea('0x34')](_0x1f54cb['id']['toString'](),_0xc4af3a)['field'](_0xb8ea('0x35'),'createdAt')[_0xb8ea('0x34')](_0xb8ea('0x35'),'updatedAt')[_0xb8ea('0x37')](_0xb8ea('0x41'))[_0xb8ea('0x38')](_0xb8ea('0x39'))[_0xb8ea('0x38')](_0xb8ea('0x3a'),LISTID[_0xb8ea('0x36')]())[_0xb8ea('0x38')](_0xb8ea('0x46'),squel[_0xb8ea('0x42')](hopperContacts))[_0xb8ea('0x38')](_0xb8ea('0x3b')))[_0xb8ea('0x36')]();return _0x7c745c;}return db[_0xb8ea('0x47')][_0xb8ea('0x48')]({'where':{'type':_0xb8ea('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x481acd){var _0x18ec4f=[];if(_0x481acd){var _0x1508b3;for(var _0x1eaf88=0x0,_0x29f670;_0x1eaf88<_0x481acd[_0xb8ea('0x22')];_0x1eaf88+=0x1){_0x29f670=_0x481acd[_0x1eaf88]['get']({'plain':!![]});switch(_0x29f670[_0xb8ea('0x4c')]){case _0xb8ea('0x4d'):_0x18ec4f[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x1187a0(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})[_0xb8ea('0x29')](_0x4f341c()));break;case _0xb8ea('0x52'):_0x18ec4f[_0xb8ea('0x4e')](db['sequelize'][_0xb8ea('0x50')](_0x5ec4fc(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));break;default:_0x18ec4f[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x16c67b(_0x29f670,_0xb8ea('0x51')))[_0xb8ea('0x28')](function(){})[_0xb8ea('0x29')](_0x4f341c()));}}}return _0x18ec4f;})['all']()['then'](function(){return db[_0xb8ea('0x47')][_0xb8ea('0x48')]({'where':{'type':_0xb8ea('0x49')},'attributes':['id'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x53'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x375a8c){var _0x280d5c=[];if(_0x375a8c){var _0x29d6a0;for(var _0x3b62fc=0x0,_0x2f44b1;_0x3b62fc<_0x375a8c[_0xb8ea('0x22')];_0x3b62fc+=0x1){_0x2f44b1=_0x375a8c[_0x3b62fc][_0xb8ea('0x54')]({'plain':!![]});_0x280d5c['push'](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0xde433c(_0x2f44b1,_0xb8ea('0x51')))['then'](function(){})['catch'](_0x4f341c()));}}return _0x280d5c;})[_0xb8ea('0x55')]();})[_0xb8ea('0x28')](function(){return db[_0xb8ea('0x56')][_0xb8ea('0x48')]({'attributes':['id',_0xb8ea('0x4c')],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x4b'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x3e25de){var _0x47e32b=[];if(_0x3e25de){for(var _0x2f804d=0x0,_0x300ce5;_0x2f804d<_0x3e25de['length'];_0x2f804d+=0x1){_0x300ce5=_0x3e25de[_0x2f804d][_0xb8ea('0x54')]({'plain':!![]});switch(_0x300ce5['dialCheckDuplicateType']){case _0xb8ea('0x4d'):_0x47e32b[_0xb8ea('0x4e')](db[_0xb8ea('0x4f')][_0xb8ea('0x50')](_0x1187a0(_0x300ce5,_0xb8ea('0x57')))['then'](function(){})[_0xb8ea('0x29')](_0x4f341c()));break;case _0xb8ea('0x52'):_0x47e32b['push'](db['sequelize'][_0xb8ea('0x50')](_0x5ec4fc(_0x300ce5,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));break;default:_0x47e32b['push'](db['sequelize']['query'](_0x16c67b(_0x300ce5,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));}}}return _0x47e32b;})[_0xb8ea('0x55')]();})[_0xb8ea('0x28')](function(){return db['Campaign'][_0xb8ea('0x48')]({'attributes':['id'],'include':[{'model':db[_0xb8ea('0x4a')],'as':_0xb8ea('0x53'),'where':{'id':LISTID}}]})[_0xb8ea('0x28')](function(_0x56ee97){var _0x15bb56=[];if(_0x56ee97){for(var _0x348349=0x0,_0x4c3d65;_0x348349<_0x56ee97[_0xb8ea('0x22')];_0x348349+=0x1){_0x4c3d65=_0x56ee97[_0x348349]['get']({'plain':!![]});_0x15bb56[_0xb8ea('0x4e')](db['sequelize'][_0xb8ea('0x50')](_0xde433c(_0x4c3d65,_0xb8ea('0x57')))[_0xb8ea('0x28')](function(){})['catch'](_0x4f341c()));}}return _0x15bb56;})['all']();})[_0xb8ea('0x29')](function(_0x38d327){logger['error'](_0xb8ea('0x58'),'generalCheckHopper',_0x38d327[_0xb8ea('0x17')]);});}var processPromises=function(_0x3b19ee){return BPromise['all'](promises)[_0xb8ea('0x28')](function(_0x366423){})[_0xb8ea('0x29')](function(_0x5df524){logger[_0xb8ea('0x12')](_0xb8ea('0x59'),JSON[_0xb8ea('0x5a')](_0x5df524));})[_0xb8ea('0x5b')](function(){socket[_0xb8ea('0x5c')](_0xb8ea('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3b19ee){return _0x3b19ee[_0xb8ea('0x5e')]();}});};var endCsv=function(){return BPromise[_0xb8ea('0x5f')]()[_0xb8ea('0x28')](function(){if(hopperContacts){return checkHopper();}})[_0xb8ea('0x28')](function(){socket[_0xb8ea('0x5c')](_0xb8ea('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb8ea('0x60')](FILEPATH);}catch(_0x20cdb5){logger[_0xb8ea('0x12')](_0xb8ea('0x61'),JSON[_0xb8ea('0x5a')](_0x20cdb5));}finally{process['exit'](0x0);}});};process['on'](_0xb8ea('0x62'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb8ea('0x5f')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb8ea('0x11')](',');return db[_0xb8ea('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb8ea('0x28')](function(_0x4d247c){var _0x136037=fs[_0xb8ea('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x136037,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f6e04,_0x52636d){total+=0x1;var _0x40998e=total;promises['push'](checkRow(_0x2f6e04,_0x4d247c,_0x40998e)[_0xb8ea('0x28')](function(){success+=0x1;})['catch'](function(_0x581a9a){if(_0x581a9a['error']){errors+=0x1;delete _0x581a9a[_0xb8ea('0x12')];}else if(_0x581a9a[_0xb8ea('0x24')]){duplicates+=0x1;delete _0x581a9a[_0xb8ea('0x24')];}rows[_0xb8ea('0x4e')](_0x581a9a);}));if(total%0xc8===0x0){_0x52636d[_0xb8ea('0x64')]();return processPromises(_0x52636d);}},'complete':function(){return processPromises()[_0xb8ea('0x28')](function(){logger[_0xb8ea('0x65')](_0xb8ea('0x66'));endCsv();});},'error':function(_0x477243,_0x1a7c74){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x477243));endCsv();}});})[_0xb8ea('0x29')](function(_0x583e70){logger[_0xb8ea('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xb8ea('0x5a')](_0x583e70));});}main(); \ No newline at end of file +var _0xe34e=['outbound','dialCheckDuplicateType','CmList','Lists','then','get','sequelize','query','VoiceQueueId','onlyIfOpen','catch','findAll','BlackLists','push','always','CampaignId','cmContact,\x20%s,\x20%s','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','contact','index','isNil','error','errors','length','message','data','firstName','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','cm_hopper','phone','scheduledAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','ContactId','createdAt','select','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','fromQuery','str','VoiceQueue'];(function(_0x5e8c38,_0x455b27){var _0x456a71=function(_0x174d86){while(--_0x174d86){_0x5e8c38['push'](_0x5e8c38['shift']());}};_0x456a71(++_0x455b27);}(_0xe34e,0x7d));var _0xee34=function(_0x4bb4cc,_0x330973){_0x4bb4cc=_0x4bb4cc-0x0;var _0x3a20d2=_0xe34e[_0x4bb4cc];return _0x3a20d2;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xee34('0x0'));var fs=require('fs');var squel=require(_0xee34('0x1'));var Papa=require('papaparse');var Redis=require(_0xee34('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xee34('0x3'));var logger=require(_0xee34('0x4'))(_0xee34('0x5'));config[_0xee34('0x6')]=_[_0xee34('0x7')](config[_0xee34('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xee34('0x8'))(new Redis(config[_0xee34('0x6')]));require(_0xee34('0x9'))[_0xee34('0xa')](socket);try{if(!process[_0xee34('0xb')][0x2]||process[_0xee34('0xb')][0x2]===_0xee34('0xc')||process[_0xee34('0xb')][0x2]===_0xee34('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xee34('0xb')][0x2];if(!process[_0xee34('0xb')][0x3]||process[_0xee34('0xb')][0x3]===_0xee34('0xc')||process[_0xee34('0xb')][0x3]===_0xee34('0xd')||!process[_0xee34('0xb')][0x4]||process[_0xee34('0xb')][0x4]==='undefined'||process[_0xee34('0xb')][0x4]==='null'){throw new Error(_0xee34('0xe'));}var FIELDS=_['zipObject'](process[_0xee34('0xb')][0x3][_0xee34('0xf')](','),process[_0xee34('0xb')][0x4][_0xee34('0xf')](','));if(!process[_0xee34('0xb')][0x5]||process[_0xee34('0xb')][0x5]===_0xee34('0xc')||process['argv'][0x5]===_0xee34('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xee34('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xee34('0xb')][0x6]!==_0xee34('0xc')&&process[_0xee34('0xb')][0x6]!==_0xee34('0xd')?process[_0xee34('0xb')][0x6]:null;var DUPLICATES=process[_0xee34('0xb')][0x7]&&process[_0xee34('0xb')][0x7]!==_0xee34('0xc')&&process[_0xee34('0xb')][0x7]!==_0xee34('0xd')?process['argv'][0x7]:null;if(!process[_0xee34('0xb')][0x8]||process[_0xee34('0xb')][0x8]===_0xee34('0xc')||process[_0xee34('0xb')][0x8]==='null'){throw new Error(_0xee34('0x10'));}var SOCKET_TIMESTAMP=process[_0xee34('0xb')][0x8];}catch(_0x389d78){logger['error'](_0x389d78);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(_0x2cd3b7,_0xc4e01d,_0x4fa09e,_0x464677){var _0xad20fa={'message':_0xc4e01d};_0xad20fa[_0x2cd3b7]=!![];if(_0x4fa09e){_0xad20fa[_0xee34('0x11')]=_0x4fa09e;}if(_0x464677){_0xad20fa[_0xee34('0x12')]=_0x464677;}return _0xad20fa;}function isEmail(_0x398a1c){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'](_0x398a1c);}function checkRow(_0x4cf5fc,_0xa96205,_0x5a83fc){return new BPromise(function(_0x4278b6,_0x489638){if(_[_0xee34('0x13')](_0x4cf5fc)){return _0x489638(handleCheckRowError(_0xee34('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x5a83fc));}if(_0x4cf5fc['errors']&&_0x4cf5fc[_0xee34('0x15')][_0xee34('0x16')]){var _0x4afdb2=_['map'](_0x4cf5fc[_0xee34('0x15')],_0xee34('0x17'))['join'](';');return _0x489638(handleCheckRowError(_0xee34('0x14'),_0x4afdb2,null,_0x5a83fc));}var _0x5a2dc5={};for(var _0x2afe45 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2afe45)&&FIELDS[_0x2afe45]){_0x5a2dc5[_0x2afe45]=_0x4cf5fc[_0xee34('0x18')][0x0][FIELDS[_0x2afe45]]||_0x4cf5fc[_0xee34('0x18')][0x0]['\ufeff'+FIELDS[_0x2afe45]];}}if(!_0x5a2dc5[_0xee34('0x19')]){return _0x489638(handleCheckRowError(_0xee34('0x14'),'firstName\x20not\x20specified!',null,_0x5a83fc));}if(!_0x5a2dc5['phone']){return _0x489638(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x5a83fc));}if(_0x5a2dc5[_0xee34('0x1a')]){var _0x159bc1=moment(_0x5a2dc5['birthDate'],_0xee34('0x1b'));if(!_0x159bc1['isValid']()){return _0x489638(handleCheckRowError(_0xee34('0x14'),_0xee34('0x1c'),null,_0x5a83fc));}}if(_0x5a2dc5[_0xee34('0x1d')]){if(!isEmail(_0x5a2dc5[_0xee34('0x1d')])){return _0x489638(handleCheckRowError(_0xee34('0x14'),'email\x20format\x20is\x20not\x20valid!',null,_0x5a83fc));}}_0x5a2dc5[_0xee34('0x1e')]=LISTID;_0x5a2dc5[_0xee34('0x1f')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xee34('0x16')]&&_0xa96205){var _0x409830={};for(var _0xfdf4=0x0,_0x2aaede=DUPLICATES[_0xee34('0x16')];_0xfdf4<_0x2aaede;_0xfdf4+=0x1){_0x409830[DUPLICATES[_0xfdf4]]=_0x5a2dc5[DUPLICATES[_0xfdf4]];}var _0x3af6b9=_[_0xee34('0x20')](_0xa96205,_0x409830);if(_0x3af6b9){return _0x489638(handleCheckRowError('duplicate',_0xee34('0x21'),_0x3af6b9,_0x5a83fc));}}return db[_0xee34('0x22')][_0xee34('0x23')](_0x5a2dc5,{'raw':!![],'hooks':![],'fields':_[_0xee34('0x24')](_0x5a2dc5)})['then'](function(_0x40f850){if(DUPLICATES&&DUPLICATES['length']&&_0xa96205){_0xa96205['push'](_['pick'](_0x5a2dc5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x40f850['id'];return _0x4278b6();})['catch'](function(_0x5ba53b){return _0x489638(handleCheckRowError(_0xee34('0x14'),_0xee34('0x25')+(_0x5ba53b[_0xee34('0x17')]||JSON[_0xee34('0x26')](_0x5ba53b)),null,_0x5a83fc));});});}function checkHopper(){function _0x350902(){return function(_0x53cb4e){logger[_0xee34('0x14')]('cmContact',_0xee34('0x27'),util['inspect'](_0x53cb4e,{'showHidden':![],'depth':null}));};}var _0x69bdde=function(_0x2553fd,_0x5be590){var _0x53ddd3=squel['insert']()['into'](_0xee34('0x28'))['fromQuery']([_0xee34('0x29'),_0xee34('0x2a'),'ContactId','ListId',_0x5be590,'createdAt',_0xee34('0x2b')],squel['select']()[_0xee34('0x2c')](_0xee34('0x29'),_0xee34('0x29'))[_0xee34('0x2c')](_0xee34('0x2d'),'scheduledAt')['field']('id','ContactId')[_0xee34('0x2c')](LISTID[_0xee34('0x2e')](),_0xee34('0x1e'))['field'](_0x2553fd['id'][_0xee34('0x2e')](),_0x5be590)['field'](_0xee34('0x2d'),'createdAt')['field'](_0xee34('0x2d'),_0xee34('0x2b'))[_0xee34('0x2f')](_0xee34('0x30'))[_0xee34('0x31')]('deletedAt\x20IS\x20NULL')[_0xee34('0x31')](_0xee34('0x32'),LISTID[_0xee34('0x2e')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xee34('0x33'),squel['select']()['field'](_0xee34('0x29'))[_0xee34('0x2f')](_0xee34('0x28'))[_0xee34('0x31')](_0x5be590+_0xee34('0x34'),_0x2553fd['id']['toString']())))[_0xee34('0x2e')]();return _0x53ddd3;};var _0x203ed9=function(_0x1c9a40,_0xafc410){var _0x1fabdc=squel[_0xee34('0x35')]()[_0xee34('0x36')](_0xee34('0x28'))['fromQuery']([_0xee34('0x29'),_0xee34('0x2a'),_0xee34('0x37'),'ListId',_0xafc410,_0xee34('0x38'),_0xee34('0x2b')],squel[_0xee34('0x39')]()['field'](_0xee34('0x29'),'phone')[_0xee34('0x2c')](_0xee34('0x2d'),_0xee34('0x2a'))[_0xee34('0x2c')]('id',_0xee34('0x37'))[_0xee34('0x2c')](LISTID[_0xee34('0x2e')](),_0xee34('0x1e'))[_0xee34('0x2c')](_0x1c9a40['id'][_0xee34('0x2e')](),_0xafc410)['field'](_0xee34('0x2d'),'createdAt')[_0xee34('0x2c')](_0xee34('0x2d'),_0xee34('0x2b'))[_0xee34('0x2f')](_0xee34('0x30'))[_0xee34('0x31')](_0xee34('0x3a'))[_0xee34('0x31')](_0xee34('0x32'),LISTID['toString']())[_0xee34('0x31')](_0xee34('0x3b'),squel['str'](hopperContacts))[_0xee34('0x31')](_0xee34('0x3c'))[_0xee34('0x31')](_0xee34('0x33'),squel[_0xee34('0x39')]()[_0xee34('0x2c')](_0xee34('0x3d'))[_0xee34('0x2f')]('cm_hopper_final')[_0xee34('0x31')](_0xafc410+'\x20=\x20?',_0x1c9a40['id'][_0xee34('0x2e')]()))[_0xee34('0x31')](_0xee34('0x33'),squel['select']()['field'](_0xee34('0x29'))['from']('cm_hopper')[_0xee34('0x31')](_0xafc410+_0xee34('0x34'),_0x1c9a40['id'][_0xee34('0x2e')]())))[_0xee34('0x2e')]();return _0x1fabdc;};function _0x408199(_0xaa6f8d,_0x1e6878){var _0x939f93=squel[_0xee34('0x35')]()[_0xee34('0x36')](_0xee34('0x28'))[_0xee34('0x3e')]([_0xee34('0x29'),_0xee34('0x2a'),_0xee34('0x37'),'ListId',_0x1e6878,_0xee34('0x38'),_0xee34('0x2b')],squel[_0xee34('0x39')]()['field']('phone',_0xee34('0x29'))[_0xee34('0x2c')](_0xee34('0x2d'),_0xee34('0x2a'))[_0xee34('0x2c')]('id','ContactId')['field'](LISTID[_0xee34('0x2e')](),'ListId')[_0xee34('0x2c')](_0xaa6f8d['id'][_0xee34('0x2e')](),_0x1e6878)[_0xee34('0x2c')](_0xee34('0x2d'),_0xee34('0x38'))[_0xee34('0x2c')]('NOW()',_0xee34('0x2b'))[_0xee34('0x2f')](_0xee34('0x30'))[_0xee34('0x31')](_0xee34('0x3a'))[_0xee34('0x31')](_0xee34('0x32'),LISTID[_0xee34('0x2e')]())['where']('id\x20IN\x20?',squel[_0xee34('0x3f')](hopperContacts))[_0xee34('0x31')](_0xee34('0x3c')))[_0xee34('0x2e')]();return _0x939f93;}function _0x28e57e(_0x166ef3,_0x4a5050){var _0x1f9196=squel[_0xee34('0x35')]()[_0xee34('0x36')]('cm_hopper_black')[_0xee34('0x3e')]([_0xee34('0x29'),'ContactId','ListId',_0x4a5050,'createdAt','updatedAt'],squel[_0xee34('0x39')]()[_0xee34('0x2c')](_0xee34('0x29'),_0xee34('0x29'))['field']('id',_0xee34('0x37'))['field'](LISTID[_0xee34('0x2e')](),_0xee34('0x1e'))[_0xee34('0x2c')](_0x166ef3['id'][_0xee34('0x2e')](),_0x4a5050)[_0xee34('0x2c')](_0xee34('0x2d'),_0xee34('0x38'))['field'](_0xee34('0x2d'),'updatedAt')[_0xee34('0x2f')](_0xee34('0x30'))[_0xee34('0x31')]('deletedAt\x20IS\x20NULL')[_0xee34('0x31')]('ListId\x20=\x20?',LISTID[_0xee34('0x2e')]())['where'](_0xee34('0x3b'),squel[_0xee34('0x3f')](hopperContacts))['where'](_0xee34('0x3c')))[_0xee34('0x2e')]();return _0x1f9196;}return db[_0xee34('0x40')]['findAll']({'where':{'type':_0xee34('0x41')},'attributes':['id',_0xee34('0x42')],'include':[{'model':db[_0xee34('0x43')],'as':_0xee34('0x44'),'where':{'id':LISTID}}]})[_0xee34('0x45')](function(_0x31d1a4){var _0x3cc896=[];if(_0x31d1a4){var _0x6ab298;for(var _0x53c9aa=0x0,_0x1c4c4b;_0x53c9aa<_0x31d1a4['length'];_0x53c9aa+=0x1){_0x1c4c4b=_0x31d1a4[_0x53c9aa][_0xee34('0x46')]({'plain':!![]});switch(_0x1c4c4b[_0xee34('0x42')]){case'always':_0x3cc896['push'](db[_0xee34('0x47')][_0xee34('0x48')](_0x203ed9(_0x1c4c4b,_0xee34('0x49')))[_0xee34('0x45')](function(){})['catch'](_0x350902()));break;case _0xee34('0x4a'):_0x3cc896['push'](db[_0xee34('0x47')]['query'](_0x69bdde(_0x1c4c4b,_0xee34('0x49')))[_0xee34('0x45')](function(){})[_0xee34('0x4b')](_0x350902()));break;default:_0x3cc896['push'](db[_0xee34('0x47')]['query'](_0x408199(_0x1c4c4b,_0xee34('0x49')))[_0xee34('0x45')](function(){})[_0xee34('0x4b')](_0x350902()));}}}return _0x3cc896;})['all']()[_0xee34('0x45')](function(){return db[_0xee34('0x40')][_0xee34('0x4c')]({'where':{'type':_0xee34('0x41')},'attributes':['id'],'include':[{'model':db[_0xee34('0x43')],'as':_0xee34('0x4d'),'where':{'id':LISTID}}]})[_0xee34('0x45')](function(_0x213df7){var _0x2b22ba=[];if(_0x213df7){var _0x9fba7b;for(var _0x5e855b=0x0,_0x490036;_0x5e855b<_0x213df7[_0xee34('0x16')];_0x5e855b+=0x1){_0x490036=_0x213df7[_0x5e855b][_0xee34('0x46')]({'plain':!![]});_0x2b22ba[_0xee34('0x4e')](db[_0xee34('0x47')][_0xee34('0x48')](_0x28e57e(_0x490036,'VoiceQueueId'))['then'](function(){})['catch'](_0x350902()));}}return _0x2b22ba;})['all']();})[_0xee34('0x45')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xee34('0x42')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xee34('0x45')](function(_0x3ad29a){var _0x23cf57=[];if(_0x3ad29a){for(var _0x2948d8=0x0,_0x269b72;_0x2948d8<_0x3ad29a[_0xee34('0x16')];_0x2948d8+=0x1){_0x269b72=_0x3ad29a[_0x2948d8][_0xee34('0x46')]({'plain':!![]});switch(_0x269b72['dialCheckDuplicateType']){case _0xee34('0x4f'):_0x23cf57[_0xee34('0x4e')](db['sequelize']['query'](_0x203ed9(_0x269b72,'CampaignId'))[_0xee34('0x45')](function(){})[_0xee34('0x4b')](_0x350902()));break;case _0xee34('0x4a'):_0x23cf57['push'](db[_0xee34('0x47')][_0xee34('0x48')](_0x69bdde(_0x269b72,_0xee34('0x50')))['then'](function(){})[_0xee34('0x4b')](_0x350902()));break;default:_0x23cf57[_0xee34('0x4e')](db[_0xee34('0x47')][_0xee34('0x48')](_0x408199(_0x269b72,_0xee34('0x50')))[_0xee34('0x45')](function(){})['catch'](_0x350902()));}}}return _0x23cf57;})['all']();})[_0xee34('0x45')](function(){return db['Campaign'][_0xee34('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xee34('0x43')],'as':_0xee34('0x4d'),'where':{'id':LISTID}}]})[_0xee34('0x45')](function(_0x3744b5){var _0x1c30a0=[];if(_0x3744b5){for(var _0x28910f=0x0,_0xc802c;_0x28910f<_0x3744b5[_0xee34('0x16')];_0x28910f+=0x1){_0xc802c=_0x3744b5[_0x28910f][_0xee34('0x46')]({'plain':!![]});_0x1c30a0[_0xee34('0x4e')](db[_0xee34('0x47')][_0xee34('0x48')](_0x28e57e(_0xc802c,_0xee34('0x50')))[_0xee34('0x45')](function(){})['catch'](_0x350902()));}}return _0x1c30a0;})['all']();})['catch'](function(_0x26c1ab){logger[_0xee34('0x14')](_0xee34('0x51'),'generalCheckHopper',_0x26c1ab[_0xee34('0x17')]);});}var processPromises=function(_0x14b8ab){return BPromise['all'](promises)[_0xee34('0x45')](function(_0x25dc04){})['catch'](function(_0x293be6){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xee34('0x26')](_0x293be6));})['finally'](function(){socket[_0xee34('0x52')](_0xee34('0x53')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x14b8ab){return _0x14b8ab[_0xee34('0x54')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xee34('0x45')](function(){if(hopperContacts){return checkHopper();}})[_0xee34('0x45')](function(){socket[_0xee34('0x52')](_0xee34('0x53')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xee34('0x55')](FILEPATH);}catch(_0x2bd628){logger[_0xee34('0x14')](_0xee34('0x56'),JSON[_0xee34('0x26')](_0x2bd628));}finally{process[_0xee34('0x57')](0x0);}});};process['on']('SIGINT',function(){logger[_0xee34('0x58')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xee34('0xf')](',');return db[_0xee34('0x22')][_0xee34('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xee34('0x45')](function(_0x18aed2){var _0x3af57f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xee34('0x59')](_0x3af57f,{'header':!![],'skipEmptyLines':!![],'step':function(_0xdfa360,_0x2fe23e){total+=0x1;var _0x4a5201=total;promises['push'](checkRow(_0xdfa360,_0x18aed2,_0x4a5201)[_0xee34('0x45')](function(){success+=0x1;})[_0xee34('0x4b')](function(_0x5bed35){if(_0x5bed35[_0xee34('0x14')]){errors+=0x1;delete _0x5bed35[_0xee34('0x14')];}else if(_0x5bed35[_0xee34('0x5a')]){duplicates+=0x1;delete _0x5bed35[_0xee34('0x5a')];}rows['push'](_0x5bed35);}));if(total%0xc8===0x0){_0x2fe23e[_0xee34('0x5b')]();return processPromises(_0x2fe23e);}},'complete':function(){return processPromises()[_0xee34('0x45')](function(){logger['info'](_0xee34('0x5c'));endCsv();});},'error':function(_0x573dc3,_0x57b16e){logger[_0xee34('0x58')](_0xee34('0x5d'),JSON[_0xee34('0x26')](_0x573dc3));endCsv();}});})[_0xee34('0x4b')](function(_0x7a0103){logger['error'](_0xee34('0x5e'),JSON['stringify'](_0x7a0103));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 301f438..6da1447 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 _0xe5e3=['voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','length','push','all','then','split','isNil','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_hopper_black','fields','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','ContactId','priority','cm_contacts','\x22always\x22','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','message','info','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','catch','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','dialTimezone','utcOffset','set','offset','main','stringify','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','_description','parse','createReadStream','data','errors','trim','replace','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','\x20not\x20specified','hasOwnProperty','find','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','VoiceQueueId'];(function(_0x24472f,_0x469831){var _0x1f7ad1=function(_0x3e4607){while(--_0x3e4607){_0x24472f['push'](_0x24472f['shift']());}};_0x1f7ad1(++_0x469831);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x45ef76,_0x237f80){_0x45ef76=_0x45ef76-0x0;var _0x52e328=_0xe5e3[_0x45ef76];return _0x52e328;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x3e5e('0x0'));var Papa=require(_0x3e5e('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x3e5e('0x2'));var squel=require('squel');var Redis=require(_0x3e5e('0x3'));var db=require(_0x3e5e('0x4'))['db'];var config=require('../../../config/environment');var shared=require(_0x3e5e('0x5'));var logger=require(_0x3e5e('0x6'))('import');config[_0x3e5e('0x7')]=_['defaults'](config[_0x3e5e('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e5e('0x8'))(new Redis(config[_0x3e5e('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x3e5e('0x9')](_0x3e5e('0xa'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x3e5e('0x9')](_0x3e5e('0xa'));function isEmail(_0x16f64b){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))*$/[_0x3e5e('0xb')](_0x16f64b);}function selectNotIn(_0x19b93c,_0x135011,_0x1dd99b,_0x5c9349,_0x83263a){return squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')](_0x3e5e('0xe'))[_0x3e5e('0xf')](_0x5c9349)[_0x3e5e('0x10')](_0x135011,null,_0x135011+_0x3e5e('0x11')+_0x5c9349+'.'+_0x1dd99b)[_0x3e5e('0x12')](_0x5c9349+'.'+_0x1dd99b+_0x3e5e('0x13')+_0x19b93c+'.'+_0x1dd99b)[_0x3e5e('0x12')](_0x135011+_0x3e5e('0x14')+_0x83263a[_0x3e5e('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1949bc,_0x9065c8){promisesAdditionalPhones=[];return db['CmContact'][_0x3e5e('0x15')]({'raw':!![],'attributes':['id',_0x3e5e('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x5dea39){if(_0x5dea39!==null){var _0x15f414=[];for(var _0x106218=0x0;_0x106218<_0x5dea39[_0x3e5e('0x17')];_0x106218++){var _0x445648=_0x5dea39[_0x106218];_0x15f414[_0x3e5e('0x18')](insertAdditionalPhones(_0x445648));}}Promise[_0x3e5e('0x19')](_0x15f414)[_0x3e5e('0x1a')](function(){_0x1949bc({'val':0x1});});});});}function insertAdditionalPhones(_0x5d84b7){return new Promise(function(_0x229977,_0x859854){var _0x295e8c=_0x5d84b7[_0x3e5e('0x16')];var _0xfc5acc=_0x295e8c[_0x3e5e('0x1b')](';');var _0x3d2d90=[];orderBy=0x0;for(var _0x59b25a=0x0;_0x59b25a<_0xfc5acc['length'];_0x59b25a++){_0x3d2d90['push'](splitAdditionalPhone(_0x5d84b7['id'],_0xfc5acc[_0x59b25a]));}Promise[_0x3e5e('0x19')](_0x3d2d90)[_0x3e5e('0x1a')](function(){_0x229977({'val':_0xfc5acc['length']});});});}function splitAdditionalPhone(_0x5c9169,_0x251ae5){return new Promise(function(_0xd24e1d,_0x2e19d6){var _0x1d199a=_0x251ae5[_0x3e5e('0x1b')](':');var _0x212a2d=_0x1d199a[0x0];var _0x3ee768=_0x1d199a[0x1];if(!_[_0x3e5e('0x1c')](_0x3ee768)){var _0x457db9=_0x3ee768['split']('|');var _0x3ea062=[];for(var _0x409a5c=0x0;_0x409a5c<_0x457db9[_0x3e5e('0x17')];_0x409a5c++){if(_0x457db9[_0x409a5c]!==''){var _0x3c61ba=_['filter'](promisesAdditionalPhones,{'contactId':_0x5c9169,'phone':_0x457db9[_0x409a5c]});if(_0x3c61ba[_0x3e5e('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x3e5e('0x18')]({'contactId':_0x5c9169,'contactTypeId':_0x212a2d,'phone':_0x457db9[_0x409a5c],'orderBy':orderBy});}}}_0xd24e1d({'ok':0x1});}else _0xd24e1d({'res':0x0});});}function createAdditionalPhone(_0xdcc088,_0x31b570,_0x28af5e,_0x37a02c){var _0x13d25c='';var _0x2d4c60='';var _0x5dabb1=_0x28af5e['split']('§');_0x13d25c=_0x5dabb1[0x0];if(_0x5dabb1[_0x3e5e('0x17')]==0x2)_0x2d4c60=_0x5dabb1[0x1];return new Promise(function(_0x2c4e88,_0x189ea1){return db['CmContactHasItem'][_0x3e5e('0x1d')]({'where':{'CmContactId':_0xdcc088,'item':_0x13d25c}})['then'](function(_0x412b2c){if(_0x412b2c){return db[_0x3e5e('0x1e')][_0x3e5e('0x1f')]({'ItemTypeId':_0x31b570,'description':_0x2d4c60,'OrderBy':_0x37a02c},{'where':{'CmContactId':_0xdcc088,'item':_0x13d25c}})[_0x3e5e('0x1a')](function(_0x377ca2){_0x2c4e88({'res':_0x3e5e('0x20')});});}else{return db[_0x3e5e('0x1e')][_0x3e5e('0x21')]({'CmContactId':_0xdcc088,'item':_0x13d25c,'description':_0x2d4c60,'ItemTypeId':_0x31b570,'OrderBy':_0x37a02c,'ItemClass':_0x3e5e('0x22')})[_0x3e5e('0x1a')](function(_0x32bb84){_0x2c4e88({'res':_0x3e5e('0x23')});});}});});}function insertCmHopper(_0x4be358,_0x29aae1,_0x16cece,_0x20001c,_0x7be4ff){var _0x5079d4=[_0x3e5e('0x24'),_0x3e5e('0x25'),'cm_contacts.id',_0x3e5e('0x26'),_0x29aae1+'.'+_0x20001c,_0x3e5e('0x27'),_0x3e5e('0x28'),_0x3e5e('0x29'),'cm_contacts.UserId','\x22'+_0x7be4ff+'\x22'];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x2c'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),'scheduledat','ContactId',_0x3e5e('0x2e'),_0x20001c,_0x3e5e('0x2f'),_0x3e5e('0x30'),'priority',_0x3e5e('0x31'),_0x3e5e('0x32')],squel[_0x3e5e('0xc')]()['fields'](_0x5079d4)[_0x3e5e('0xf')](_0x29aae1)[_0x3e5e('0x10')]('cm_contacts',null,_0x3e5e('0x33')+_0x29aae1+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x16cece,null,_0x16cece+_0x3e5e('0x11')+_0x29aae1+'.'+_0x20001c)[_0x3e5e('0x12')](_0x29aae1+_0x3e5e('0x35'),_0x4be358)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)[_0x3e5e('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x29aae1,_0x16cece,_0x20001c,_0x3e5e('0x2c'),['\x22always\x22',_0x3e5e('0x37')]))[_0x3e5e('0x12')](_0x3e5e('0x38'),selectNotIn(_0x29aae1,_0x16cece,_0x20001c,'cm_hopper',['\x22always\x22'])))[_0x3e5e('0x39')]();}function insertCmHopperBlack(_0x51b11c,_0x2d43e5,_0x16eaae,_0x3af6d8){var _0x19f2fe=['cm_contacts.phone',_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x2d43e5+'.'+_0x3af6d8,_0x3e5e('0x27'),'cm_contacts.updatedAt'];return squel['insert']()[_0x3e5e('0x2b')](_0x3e5e('0x3b'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),'ContactId',_0x3e5e('0x2e'),_0x3af6d8,'createdAt','updatedAt'],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x19f2fe)[_0x3e5e('0xf')](_0x2d43e5)[_0x3e5e('0x10')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2d43e5+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x16eaae,null,_0x16eaae+_0x3e5e('0x11')+_0x2d43e5+'.'+_0x3af6d8)[_0x3e5e('0x12')](_0x2d43e5+'.CmListId\x20=\x20?',_0x51b11c)[_0x3e5e('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3e5e('0x38'),squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')]('phone')[_0x3e5e('0xf')](_0x3e5e('0x3b'))['where'](_0x3e5e('0x3d'),_0x51b11c)['where'](_0x3af6d8+_0x3e5e('0x13')+_0x2d43e5+'.'+_0x3af6d8)))[_0x3e5e('0x39')]();}function insertTzCmHopper(_0x4635c0,_0x373ddf,_0x56610a,_0x2a4ee5,_0x206c0d,_0x3561ca){var _0x40ed7f=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x3561ca+_0x3e5e('0x3e'),_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x373ddf+'.'+_0x2a4ee5,'cm_contacts.createdAt',_0x3e5e('0x28'),_0x3e5e('0x29'),'cm_contacts.UserId','\x22'+_0x206c0d+'\x22'];var _0x309634=squel['insert']()[_0x3e5e('0x2b')](_0x3e5e('0x2c'))[_0x3e5e('0x2d')]([_0x3e5e('0xe'),_0x3e5e('0x3f'),_0x3e5e('0x40'),_0x3e5e('0x2e'),_0x2a4ee5,_0x3e5e('0x2f'),_0x3e5e('0x30'),_0x3e5e('0x41'),_0x3e5e('0x31'),'recallme'],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x40ed7f)['from'](_0x373ddf)[_0x3e5e('0x10')](_0x3e5e('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x373ddf+'.CmListId')[_0x3e5e('0x10')](_0x56610a,null,_0x56610a+_0x3e5e('0x11')+_0x373ddf+'.'+_0x2a4ee5)[_0x3e5e('0x10')](_0x3561ca,null,_0x3561ca+_0x3e5e('0x11')+_0x373ddf+'.'+_0x2a4ee5)[_0x3e5e('0x12')](_0x373ddf+'.CmListId\x20=\x20?',_0x4635c0)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)['where'](_0x3e5e('0x38'),selectNotIn(_0x373ddf,_0x56610a,_0x2a4ee5,_0x3e5e('0x2c'),[_0x3e5e('0x43'),_0x3e5e('0x37')]))[_0x3e5e('0x12')](_0x3e5e('0x38'),selectNotIn(_0x373ddf,_0x56610a,_0x2a4ee5,_0x3e5e('0x2c'),[_0x3e5e('0x43')])))['toString']();return _0x309634;}function insertTzCmHopperBlack(_0x4b0da5,_0x175c7d,_0x42a231,_0x1df8ef){var _0xe7f6f0=[_0x3e5e('0x24'),_0x3e5e('0x3a'),_0x3e5e('0x26'),_0x175c7d+'.'+_0x1df8ef,_0x3e5e('0x27'),_0x3e5e('0x28')];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x3b'))['fromQuery']([_0x3e5e('0xe'),_0x3e5e('0x40'),_0x3e5e('0x2e'),_0x1df8ef,_0x3e5e('0x2f'),_0x3e5e('0x30')],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0xe7f6f0)['from'](_0x175c7d)[_0x3e5e('0x10')](_0x3e5e('0x42'),null,_0x3e5e('0x33')+_0x175c7d+_0x3e5e('0x34'))[_0x3e5e('0x10')](_0x42a231,null,_0x42a231+_0x3e5e('0x11')+_0x175c7d+'.'+_0x1df8ef)['where'](_0x175c7d+_0x3e5e('0x35'),_0x4b0da5)[_0x3e5e('0x12')](_0x3e5e('0x36'),NOW)['where'](_0x3e5e('0x38'),squel['select']()['field'](_0x3e5e('0xe'))['from'](_0x3e5e('0x3b'))[_0x3e5e('0x12')](_0x3e5e('0x3d'),_0x4b0da5)['where'](_0x1df8ef+_0x3e5e('0x13')+_0x175c7d+'.'+_0x1df8ef)))['toString']();}function insertCmHopperAdditionalPhones(_0x395fcf){var _0x15dcb3=[_0x3e5e('0x44'),_0x3e5e('0x45'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x3e5e('0x46')];return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3e5e('0x47'))[_0x3e5e('0x2d')]([_0x3e5e('0x48'),'phone',_0x3e5e('0x49'),_0x3e5e('0x2f'),_0x3e5e('0x30')],squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x15dcb3)[_0x3e5e('0xf')]('cm_hopper')[_0x3e5e('0x10')](_0x3e5e('0x42'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x3e5e('0x4a'),null,_0x3e5e('0x4b'))[_0x3e5e('0x12')](_0x3e5e('0x4c'),_0x395fcf)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x3e5e('0x39')]();}function insertCmContact(_0x4c8477,_0x486740,_0x1f083a,_0x4b7c4d){var _0x25c677=_[_0x3e5e('0x4d')](_[_0x3e5e('0x4e')](_0x4b7c4d),[_0x3e5e('0x2e'),_0x3e5e('0x4f'),'createdAt',_0x3e5e('0x30')]);return squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')]('cm_contacts')[_0x3e5e('0x2d')](_0x25c677,squel['select']()[_0x3e5e('0x3c')](_0x25c677)[_0x3e5e('0xf')](_0x486740)[_0x3e5e('0x12')]('('+_0x1f083a[_0x3e5e('0x10')](',')+_0x3e5e('0x50'),squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](_0x1f083a)['from'](_0x3e5e('0x42'))['where'](_0x3e5e('0x3d'),_0x4c8477)['where'](_0x3e5e('0x51')))[_0x3e5e('0x12')](_0x3e5e('0x52'),squel[_0x3e5e('0xc')]()[_0x3e5e('0xd')](_0x3e5e('0x53'),_0x3e5e('0x54'))[_0x3e5e('0xf')](_0x486740)[_0x3e5e('0x55')](_0x1f083a[_0x3e5e('0x10')](','))))[_0x3e5e('0x39')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1bb96c){logger[_0x3e5e('0x56')](_0x1bb96c['message']);process['exit'](0x1);}function handleError(_0x4cb433,_0x5f556d){stats['errors'][_0x3e5e('0x18')]({'name':_0x5f556d['code'],'message':_0x5f556d[_0x3e5e('0x57')],'row':_0x4cb433});}function handleQuery(_0x3d06b3){logger[_0x3e5e('0x58')](_0x3d06b3);return db[_0x3e5e('0x59')][_0x3e5e('0x5a')](_0x3d06b3)[_0x3e5e('0x5b')](function(_0x19173b){results[_0x3e5e('0x18')](_0x19173b);})['catch'](function(_0x139b31){logger[_0x3e5e('0x56')](_0x139b31[_0x3e5e('0x57')]);});}function updateTzCampaigns(_0x5933cc){return new Promise(function(_0x36abe7,_0x31d49e){var _0xea4928=squel['select']()['fields']([_0x3e5e('0x5c'),_0x3e5e('0x5d')])[_0x3e5e('0xf')](_0x3e5e('0x5e'))['join'](_0x3e5e('0x5f'),null,_0x3e5e('0x60'))[_0x3e5e('0x12')](_0x3e5e('0x61')+_0x5933cc);db['sequelize'][_0x3e5e('0x5a')](_0xea4928[_0x3e5e('0x39')]())[_0x3e5e('0x5b')](function(_0x4ff001){var _0x117d77=[];for(var _0x122eb0=0x0;_0x122eb0<_0x4ff001[_0x3e5e('0x17')];_0x122eb0++){_0x117d77[_0x3e5e('0x18')](getTimezoneData(_0x4ff001[_0x122eb0],tmp_campaigns));}BPromise[_0x3e5e('0x19')](_0x117d77)[_0x3e5e('0x1a')](function(){_0x36abe7({'val':0x1});});})[_0x3e5e('0x62')](function(_0x1992b0){logger['error'](_0x1992b0[_0x3e5e('0x57')]);_0x36abe7({'val':0x0});});});}function updateTzVoiceQueues(_0x2e169f){return new Promise(function(_0x4a839e,_0x416300){var _0x196ef4=squel[_0x3e5e('0xc')]()[_0x3e5e('0x3c')](['voice_queues.id',_0x3e5e('0x63')])[_0x3e5e('0xf')](_0x3e5e('0x64'))[_0x3e5e('0x10')](_0x3e5e('0x65'),null,_0x3e5e('0x66'))[_0x3e5e('0x12')]('voice_queues_has_cm_lists.CmListId='+_0x2e169f);db[_0x3e5e('0x59')]['query'](_0x196ef4[_0x3e5e('0x39')]())[_0x3e5e('0x5b')](function(_0x10aed3){var _0x16b1aa=[];for(var _0x3d6711=0x0;_0x3d6711<_0x10aed3[_0x3e5e('0x17')];_0x3d6711++){_0x16b1aa[_0x3e5e('0x18')](getTimezoneData(_0x10aed3[_0x3d6711],tmp_voice_queues));}BPromise[_0x3e5e('0x19')](_0x16b1aa)[_0x3e5e('0x1a')](function(){_0x4a839e({'val':0x1});});})[_0x3e5e('0x62')](function(_0x5a5cca){logger['error'](_0x5a5cca[_0x3e5e('0x57')]);_0x4a839e({'val':0x0});});});}function getTimezoneData(_0x23e159,_0x3a7bd3){return new Promise(function(_0x5c8a5b,_0x52d0ea){var _0x296323=shared['timezones'];var _0x31159d=_0x296323[_0x23e159[_0x3e5e('0x67')]];if(_[_0x3e5e('0x1c')](_0x31159d)){_0x5c8a5b({'ret':0x1});}else{var _0x38ddfe=_0x31159d[_0x3e5e('0x68')];var _0x4e9d1e=squel[_0x3e5e('0x2a')]()[_0x3e5e('0x2b')](_0x3a7bd3)[_0x3e5e('0x69')]('id',_0x23e159['id'])['set'](_0x3e5e('0x6a'),_0x38ddfe)['set'](_0x3e5e('0x67'),_0x23e159[_0x3e5e('0x67')])['toString']();return db['sequelize'][_0x3e5e('0x5a')](_0x4e9d1e)[_0x3e5e('0x5b')](function(_0x2ca192){_0x5c8a5b({'ret':0x1});})[_0x3e5e('0x62')](function(_0x2b4df0){logger[_0x3e5e('0x56')](_0x2b4df0[_0x3e5e('0x57')]);_0x52d0ea({'ret':0x1});});}});}function handleTZQuery(_0x1e44f3){logger['info'](_0x1e44f3);return db[_0x3e5e('0x59')]['query'](_0x1e44f3)[_0x3e5e('0x5b')](function(_0x519b31){})[_0x3e5e('0x62')](function(_0x891df3){logger[_0x3e5e('0x56')](_0x891df3[_0x3e5e('0x57')]);});}function main(_0x17276b,_0x42cb11,_0x10d671,_0x4b849e){logger['info'](_0x3e5e('0x6b'),_0x17276b,JSON[_0x3e5e('0x6c')](_0x42cb11));process['send'](_0x3e5e('0x6d'));var _0x1a2dfe=_0x42cb11['binding'];var _0x2a0e93=_[_0x3e5e('0x6e')](_0x1a2dfe);var _0x2117a4=_0x42cb11[_0x3e5e('0x6f')];var _0x1c1545=path[_0x3e5e('0x10')](config[_0x3e5e('0x70')],_0x3e5e('0x71'),_0x2117a4+_0x3e5e('0x72'));hasTZ=_[_0x3e5e('0x4e')](_0x1a2dfe)[_0x3e5e('0x73')](_0x3e5e('0x67'));var _0x25f0ce=_[_0x3e5e('0x4e')](_0x1a2dfe)[_0x3e5e('0x10')]();logger['info'](_0x3e5e('0x74'),_0x25f0ce);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x3e5e('0x75')]})[_0x3e5e('0x1a')](function(_0x5af9d0){for(var _0x406f25=0x0;_0x406f25<_0x5af9d0[_0x3e5e('0x17')];_0x406f25++){if(_0x5af9d0[_0x406f25][_0x3e5e('0x75')]in _0x1a2dfe){contactItemTypes[_0x3e5e('0x18')](_0x5af9d0[_0x406f25]);delete _0x2a0e93[_0x5af9d0[_0x406f25]['name']];hasAdditionalPhones=!![];}for(var _0x19880b in _0x1a2dfe){if(_0x5af9d0[_0x406f25][_0x3e5e('0x75')]+_0x3e5e('0x76')===_0x19880b){phoneDescriptions['push']({'itemTypeId':_0x5af9d0[_0x406f25]['id'],'description':_0x19880b});delete _0x2a0e93[_0x19880b];}}}if(hasAdditionalPhones)_0x2a0e93['AdditionalPhones']='';var _0x4e7a4d=_[_0x3e5e('0x4e')](_0x2a0e93)[_0x3e5e('0x10')]();logger[_0x3e5e('0x58')](_0x3e5e('0x74'),_0x4e7a4d);fs['writeFileSync'](_0x1c1545,_0x4e7a4d+'\x0a');Papa[_0x3e5e('0x77')](fs[_0x3e5e('0x78')](_0x17276b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x66fb9f,_0x3b26ae){try{for(var _0x3c5753=0x0,_0x2bfcac=[];_0x3c5753<_0x66fb9f['data']['length'];_0x3c5753++){stats['rows']+=0x1;if(_0x66fb9f['errors'][_0x3c5753]){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],_0x66fb9f[_0x3e5e('0x7a')][_0x3c5753]);}else{var _0x355145=[];var _0x12baae=[];var _0x1d4d36={};for(var _0x50654e in _0x1a2dfe){let _0x2fd0d7=contactItemTypes['find'](_0x3db510=>_0x3db510['name']===_0x50654e);let _0x3ac49b=contactItemTypes['find'](_0x721c73=>_0x721c73[_0x3e5e('0x75')]+_0x3e5e('0x76')===_0x50654e);if(_['isNil'](_0x2fd0d7)&&_[_0x3e5e('0x1c')](_0x3ac49b)){if(_0x1a2dfe['hasOwnProperty'](_0x50654e)){if(_0x66fb9f['data'][_0x3c5753][_0x1a2dfe[_0x50654e]]){var _0x1a80a7=_[_0x3e5e('0x7b')](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x50654e]][_0x3e5e('0x7c')](/"/g,'\x27'));switch(_0x50654e){case'scheduledat':var _0x26e703=moment(_0x1a80a7,_0x3e5e('0xa'),!![]);if(_0x26e703['isValid']()){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3e5e('0x41'):var _0x18099b=parseInt(_0x1a80a7);_0x1a80a7=_['isNaN'](_0x18099b)||_0x18099b<0x0||_0x18099b>0x4?_0x4b849e?0x3:0x2:_0x18099b;_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');break;case _0x3e5e('0x31'):var _0x2d28c7=parseInt(_0x1a80a7);if(_[_0x3e5e('0x7d')](_0x2d28c7)&&_[_0x3e5e('0x73')](_0x10d671,_0x2d28c7)){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x2d28c7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x7e'));}break;case'email':if(isEmail(_0x1a80a7)){_0x2bfcac['push']('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x7f'));}break;case _0x3e5e('0x80'):var _0x57b8bc=moment(_0x1a80a7,_0x3e5e('0x81'),!![]);if(_0x57b8bc[_0x3e5e('0x82')]()){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');}else{_0x355145[_0x3e5e('0x18')](_0x3e5e('0x83'));}break;case _0x3e5e('0x67'):var _0x27d0f9=shared[_0x3e5e('0x84')];var _0x1f6810=_0x27d0f9[_0x1a80a7];if(!_['isNil'](_0x1f6810)){var _0x46f5f5=_0x1f6810[_0x3e5e('0x68')];_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x1a80a7+'\x22');_0x2bfcac['push']('\x22'+_0x46f5f5+'\x22');}break;default:_0x2bfcac['push']('\x22'+_0x1a80a7+'\x22');}}else{switch(_0x50654e){case'firstName':case _0x3e5e('0xe'):_0x355145[_0x3e5e('0x18')](_0x50654e+_0x3e5e('0x85'));break;default:_0x2bfcac[_0x3e5e('0x18')]('\x22\x22');}}}}else{var _0x862e67='';if(!_[_0x3e5e('0x1c')](_0x2fd0d7)){if(!_0x1d4d36[_0x3e5e('0x86')](_0x2fd0d7['id'])){if(!_[_0x3e5e('0x1c')](_0x66fb9f['data'][_0x3c5753][_0x1a2dfe[_0x50654e]])){var _0x1a80a7=_['trim'](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x50654e]]['replace'](/"/g,'\x27'));var _0x1652d5=phoneDescriptions[_0x3e5e('0x87')](_0x321eb8=>_0x321eb8[_0x3e5e('0x88')]===_0x2fd0d7['id']);if(!_[_0x3e5e('0x1c')](_0x1652d5)){var _0x335a3f=_[_0x3e5e('0x7b')](_0x66fb9f[_0x3e5e('0x79')][_0x3c5753][_0x1a2dfe[_0x1652d5[_0x3e5e('0x89')]]]['replace'](/"/g,'\x27'));if(!_[_0x3e5e('0x1c')](_0x335a3f))_0x1a80a7=_0x1a80a7+'§'+_0x335a3f;}if(_0x862e67=='')_0x862e67=_0x1a80a7;else _0x862e67+='|'+_0x1a80a7;}_0x12baae['push'](_0x2fd0d7['id']+':'+_0x862e67);_0x1d4d36[_0x2fd0d7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2bfcac[_0x3e5e('0x18')]('\x22'+_0x12baae[_0x3e5e('0x10')](';')+'\x22');}if(_0x355145[_0x3e5e('0x17')]){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],{'code':_0x3e5e('0x8a'),'message':_0x355145[_0x3e5e('0x10')]()});}else{fs[_0x3e5e('0x8b')](_0x1c1545,_0x2bfcac[_0x3e5e('0x10')]()+'\x0a');}_0x2bfcac=[];}if(!(stats[_0x3e5e('0x8c')]%0xc8)){socket[_0x3e5e('0x8d')](_0x3e5e('0x8e')+_0x2117a4,stats);stats[_0x3e5e('0x7a')]=[];}}if(stopped){logger[_0x3e5e('0x58')](_0x3e5e('0x8f'));_0x3b26ae[_0x3e5e('0x90')]();}}catch(_0x383004){handleError(_0x66fb9f[_0x3e5e('0x79')][_0x3c5753],{'code':'SystemError','message':_0x383004['message']});logger[_0x3e5e('0x56')](_0x3e5e('0x91'),_0x383004[_0x3e5e('0x57')]);}},'complete':function(){try{var _0xb2c4da=[];var _0x3cccfb=[];var _0x43fd64=_0x3e5e('0x42');if(_0x42cb11[_0x3e5e('0x92')]&&_0x42cb11['duplicates'][_0x3e5e('0x17')]){_0x43fd64='cm_contacts_'+_0x2117a4;_0xb2c4da['push'](_0x3e5e('0x93')+_0x43fd64+_0x3e5e('0x94'));}tmp_campaigns='campaigns_'+_0x2117a4;tmp_voice_queues=_0x3e5e('0x95')+_0x2117a4;_0x3cccfb[_0x3e5e('0x18')](_0x3e5e('0x93')+tmp_campaigns+_0x3e5e('0x96'));_0x3cccfb[_0x3e5e('0x18')](_0x3e5e('0x93')+tmp_voice_queues+_0x3e5e('0x96'));BPromise['each'](_0x3cccfb,handleTZQuery)['then'](function(_0x263e13){updateTzCampaigns(_0x42cb11[_0x3e5e('0x2e')])['then'](function(_0x5aa957){updateTzVoiceQueues(_0x42cb11[_0x3e5e('0x2e')])[_0x3e5e('0x1a')](function(_0x5bbab4){if(hasTZ)_0x4e7a4d=_0x4e7a4d[_0x3e5e('0x7c')](_0x3e5e('0x67'),_0x3e5e('0x97'));var _0x280f1a=util[_0x3e5e('0x9')]('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',_0x1c1545,_0x43fd64,_0x4e7a4d,_0x42cb11[_0x3e5e('0x2e')],_0x42cb11[_0x3e5e('0x4f')]||null,NOW,NOW);if(_[_0x3e5e('0x1c')](_0x1a2dfe[_0x3e5e('0x3f')])){_0x280f1a+=_0x3e5e('0x98');}_0xb2c4da[_0x3e5e('0x18')](_0x280f1a);if(_0x42cb11[_0x3e5e('0x92')]&&_0x42cb11['duplicates']['length']){_0xb2c4da['push'](insertCmContact(_0x42cb11['ListId'],_0x43fd64,_0x42cb11[_0x3e5e('0x92')],_0x1a2dfe));_0xb2c4da[_0x3e5e('0x18')](_0x3e5e('0x99')+_0x43fd64+';');}BPromise[_0x3e5e('0x9a')](_0xb2c4da,handleQuery)['then'](function(_0x39c713){BPromise[_0x3e5e('0x19')]([handleAdditionalPhones()])['then'](function(){_0xb2c4da=[];for(var _0x5a111f=0x0;_0x5a111f\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','field','phone','join','.id\x20=\x20'];(function(_0x1536e1,_0x427b05){var _0x46f1ee=function(_0x9738de){while(--_0x9738de){_0x1536e1['push'](_0x1536e1['shift']());}};_0x46f1ee(++_0x427b05);}(_0x85a7,0xa7));var _0x785a=function(_0x282c5b,_0x553bc4){_0x282c5b=_0x282c5b-0x0;var _0x3be0e8=_0x85a7[_0x282c5b];return _0x3be0e8;};'use strict';var fs=require('fs');var path=require(_0x785a('0x0'));var _=require(_0x785a('0x1'));var Papa=require(_0x785a('0x2'));var util=require(_0x785a('0x3'));var BPromise=require('bluebird');var moment=require(_0x785a('0x4'));var squel=require(_0x785a('0x5'));var Redis=require('ioredis');var db=require(_0x785a('0x6'))['db'];var config=require(_0x785a('0x7'));var shared=require(_0x785a('0x8'));var logger=require('../../../config/logger')(_0x785a('0x9'));config[_0x785a('0xa')]=_[_0x785a('0xb')](config[_0x785a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x785a('0xc'))(new Redis(config[_0x785a('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x785a('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x785a('0xe')](_0x785a('0xd'));function isEmail(_0x5af56b){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))*$/[_0x785a('0xf')](_0x5af56b);}function selectNotIn(_0x1d9350,_0x143a0e,_0x3cf9da,_0x5a0a6f,_0x239368){return squel['select']()[_0x785a('0x10')](_0x785a('0x11'))['from'](_0x5a0a6f)[_0x785a('0x12')](_0x143a0e,null,_0x143a0e+_0x785a('0x13')+_0x5a0a6f+'.'+_0x3cf9da)[_0x785a('0x14')](_0x5a0a6f+'.'+_0x3cf9da+_0x785a('0x15')+_0x1d9350+'.'+_0x3cf9da)[_0x785a('0x14')](_0x143a0e+_0x785a('0x16')+_0x239368[_0x785a('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x39032c,_0x429d4b){promisesAdditionalPhones=[];return db[_0x785a('0x17')][_0x785a('0x18')]({'raw':!![],'attributes':['id',_0x785a('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x785a('0x1a')](function(_0x2c2916){if(_0x2c2916!==null){var _0x2f322a=[];for(var _0x4bfa3b=0x0;_0x4bfa3b<_0x2c2916[_0x785a('0x1b')];_0x4bfa3b++){var _0xf52353=_0x2c2916[_0x4bfa3b];_0x2f322a[_0x785a('0x1c')](insertAdditionalPhones(_0xf52353));}}Promise[_0x785a('0x1d')](_0x2f322a)[_0x785a('0x1a')](function(){_0x39032c({'val':0x1});});});});}function insertAdditionalPhones(_0x3fda5e){return new Promise(function(_0x15d8c0,_0x441ef0){var _0x56444b=_0x3fda5e[_0x785a('0x19')];var _0xd742aa=_0x56444b[_0x785a('0x1e')](';');var _0x105875=[];orderBy=0x0;for(var _0x324b1b=0x0;_0x324b1b<_0xd742aa['length'];_0x324b1b++){_0x105875[_0x785a('0x1c')](splitAdditionalPhone(_0x3fda5e['id'],_0xd742aa[_0x324b1b]));}Promise[_0x785a('0x1d')](_0x105875)[_0x785a('0x1a')](function(){_0x15d8c0({'val':_0xd742aa[_0x785a('0x1b')]});});});}function splitAdditionalPhone(_0x4cbcd4,_0x4beca9){return new Promise(function(_0x2e74bc,_0x3161f7){var _0x3c01fb=_0x4beca9['split'](':');var _0x4aa5bb=_0x3c01fb[0x0];var _0x1bac57=_0x3c01fb[0x1];if(!_['isNil'](_0x1bac57)){var _0x4b7876=_0x1bac57[_0x785a('0x1e')]('|');var _0x390eb1=[];for(var _0x5c6005=0x0;_0x5c6005<_0x4b7876[_0x785a('0x1b')];_0x5c6005++){if(_0x4b7876[_0x5c6005]!==''){var _0x4718e2=_[_0x785a('0x1f')](promisesAdditionalPhones,{'contactId':_0x4cbcd4,'phone':_0x4b7876[_0x5c6005]});if(_0x4718e2[_0x785a('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x785a('0x1c')]({'contactId':_0x4cbcd4,'contactTypeId':_0x4aa5bb,'phone':_0x4b7876[_0x5c6005],'orderBy':orderBy});}}}_0x2e74bc({'ok':0x1});}else _0x2e74bc({'res':0x0});});}function createAdditionalPhone(_0x9a2dea,_0x4765f4,_0x4db502,_0x5a5db5){var _0x409f98='';var _0xaa9659='';var _0x128853=_0x4db502[_0x785a('0x1e')]('§');_0x409f98=_0x128853[0x0];if(_0x128853['length']==0x2)_0xaa9659=_0x128853[0x1];return new Promise(function(_0x1a04cb,_0x4dd87a){return db[_0x785a('0x20')][_0x785a('0x21')]({'where':{'CmContactId':_0x9a2dea,'item':_0x409f98}})[_0x785a('0x1a')](function(_0x574238){if(_0x574238){return db[_0x785a('0x20')]['update']({'ItemTypeId':_0x4765f4,'description':_0xaa9659,'OrderBy':_0x5a5db5},{'where':{'CmContactId':_0x9a2dea,'item':_0x409f98}})[_0x785a('0x1a')](function(_0x146d24){_0x1a04cb({'res':_0x785a('0x22')});});}else{return db['CmContactHasItem'][_0x785a('0x23')]({'CmContactId':_0x9a2dea,'item':_0x409f98,'description':_0xaa9659,'ItemTypeId':_0x4765f4,'OrderBy':_0x5a5db5,'ItemClass':_0x785a('0x24')})[_0x785a('0x1a')](function(_0x3a0272){_0x1a04cb({'res':_0x785a('0x25')});});}});});}function insertCmHopper(_0x2e9e51,_0x9cf079,_0x14ce32,_0x334a40,_0x5a440a){var _0x4f9666=[_0x785a('0x26'),_0x785a('0x27'),'cm_contacts.id',_0x785a('0x28'),_0x9cf079+'.'+_0x334a40,_0x785a('0x29'),_0x785a('0x2a'),_0x785a('0x2b'),_0x785a('0x2c'),'\x22'+_0x5a440a+'\x22'];return squel[_0x785a('0x2d')]()[_0x785a('0x2e')](_0x785a('0x2f'))[_0x785a('0x30')](['phone','scheduledat',_0x785a('0x31'),_0x785a('0x32'),_0x334a40,_0x785a('0x33'),'updatedAt','priority',_0x785a('0x34'),'recallme'],squel[_0x785a('0x35')]()[_0x785a('0x36')](_0x4f9666)[_0x785a('0x37')](_0x9cf079)[_0x785a('0x12')](_0x785a('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x9cf079+_0x785a('0x39'))[_0x785a('0x12')](_0x14ce32,null,_0x14ce32+_0x785a('0x13')+_0x9cf079+'.'+_0x334a40)[_0x785a('0x14')](_0x9cf079+'.CmListId\x20=\x20?',_0x2e9e51)['where'](_0x785a('0x3a'),NOW)['where'](_0x785a('0x3b'),selectNotIn(_0x9cf079,_0x14ce32,_0x334a40,_0x785a('0x2f'),[_0x785a('0x3c'),_0x785a('0x3d')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x9cf079,_0x14ce32,_0x334a40,_0x785a('0x2f'),[_0x785a('0x3c')])))['toString']();}function insertCmHopperBlack(_0x1dc492,_0x2fa43e,_0x36cf01,_0x24dbb2){var _0x439aae=['cm_contacts.phone','cm_contacts.id',_0x785a('0x28'),_0x2fa43e+'.'+_0x24dbb2,_0x785a('0x29'),_0x785a('0x2a')];return squel[_0x785a('0x2d')]()[_0x785a('0x2e')](_0x785a('0x3e'))[_0x785a('0x30')]([_0x785a('0x11'),_0x785a('0x31'),_0x785a('0x32'),_0x24dbb2,_0x785a('0x33'),_0x785a('0x3f')],squel[_0x785a('0x35')]()[_0x785a('0x36')](_0x439aae)[_0x785a('0x37')](_0x2fa43e)[_0x785a('0x12')](_0x785a('0x38'),null,_0x785a('0x40')+_0x2fa43e+'.CmListId')[_0x785a('0x12')](_0x36cf01,null,_0x36cf01+_0x785a('0x13')+_0x2fa43e+'.'+_0x24dbb2)[_0x785a('0x14')](_0x2fa43e+_0x785a('0x41'),_0x1dc492)['where'](_0x785a('0x3a'),NOW)[_0x785a('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x785a('0x10')]('phone')[_0x785a('0x37')](_0x785a('0x3e'))[_0x785a('0x14')](_0x785a('0x42'),_0x1dc492)[_0x785a('0x14')](_0x24dbb2+_0x785a('0x15')+_0x2fa43e+'.'+_0x24dbb2)))['toString']();}function insertTzCmHopper(_0x5c96b3,_0x4f645f,_0x24499b,_0x5d3ad2,_0x5767ee,_0x2aeb08){var _0x40da44=[_0x785a('0x26'),_0x785a('0x43')+_0x2aeb08+'.offset-cm_contacts.utcOffset\x20minute)',_0x785a('0x44'),_0x785a('0x28'),_0x4f645f+'.'+_0x5d3ad2,_0x785a('0x29'),_0x785a('0x2a'),'cm_contacts.priority',_0x785a('0x2c'),'\x22'+_0x5767ee+'\x22'];var _0x4e5c1d=squel[_0x785a('0x2d')]()[_0x785a('0x2e')](_0x785a('0x2f'))[_0x785a('0x30')]([_0x785a('0x11'),_0x785a('0x45'),_0x785a('0x31'),_0x785a('0x32'),_0x5d3ad2,_0x785a('0x33'),_0x785a('0x3f'),'priority',_0x785a('0x34'),'recallme'],squel[_0x785a('0x35')]()['fields'](_0x40da44)['from'](_0x4f645f)[_0x785a('0x12')]('cm_contacts',null,_0x785a('0x40')+_0x4f645f+_0x785a('0x39'))[_0x785a('0x12')](_0x24499b,null,_0x24499b+_0x785a('0x13')+_0x4f645f+'.'+_0x5d3ad2)[_0x785a('0x12')](_0x2aeb08,null,_0x2aeb08+_0x785a('0x13')+_0x4f645f+'.'+_0x5d3ad2)[_0x785a('0x14')](_0x4f645f+_0x785a('0x41'),_0x5c96b3)[_0x785a('0x14')](_0x785a('0x3a'),NOW)['where'](_0x785a('0x3b'),selectNotIn(_0x4f645f,_0x24499b,_0x5d3ad2,_0x785a('0x2f'),['\x22always\x22',_0x785a('0x3d')]))[_0x785a('0x14')](_0x785a('0x3b'),selectNotIn(_0x4f645f,_0x24499b,_0x5d3ad2,_0x785a('0x2f'),[_0x785a('0x3c')])))[_0x785a('0x46')]();return _0x4e5c1d;}function insertTzCmHopperBlack(_0x5c27a5,_0x508b8e,_0x5af24e,_0x12de08){var _0x2a65d7=[_0x785a('0x26'),_0x785a('0x44'),_0x785a('0x28'),_0x508b8e+'.'+_0x12de08,_0x785a('0x29'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x785a('0x3e'))[_0x785a('0x30')]([_0x785a('0x11'),'ContactId','ListId',_0x12de08,_0x785a('0x33'),_0x785a('0x3f')],squel[_0x785a('0x35')]()[_0x785a('0x36')](_0x2a65d7)[_0x785a('0x37')](_0x508b8e)[_0x785a('0x12')](_0x785a('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x508b8e+'.CmListId')[_0x785a('0x12')](_0x5af24e,null,_0x5af24e+_0x785a('0x13')+_0x508b8e+'.'+_0x12de08)['where'](_0x508b8e+_0x785a('0x41'),_0x5c27a5)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x785a('0x3b'),squel['select']()['field'](_0x785a('0x11'))[_0x785a('0x37')](_0x785a('0x3e'))[_0x785a('0x14')](_0x785a('0x42'),_0x5c27a5)['where'](_0x12de08+_0x785a('0x15')+_0x508b8e+'.'+_0x12de08)))['toString']();}function insertCmHopperAdditionalPhones(_0x198c23){var _0x2081cf=[_0x785a('0x47'),_0x785a('0x48'),_0x785a('0x49'),_0x785a('0x4a'),_0x785a('0x4b')];return squel[_0x785a('0x2d')]()[_0x785a('0x2e')](_0x785a('0x4c'))['fromQuery'](['CmHopperId',_0x785a('0x11'),_0x785a('0x4d'),_0x785a('0x33'),_0x785a('0x3f')],squel[_0x785a('0x35')]()[_0x785a('0x36')](_0x2081cf)[_0x785a('0x37')]('cm_hopper')['join'](_0x785a('0x38'),null,_0x785a('0x4e'))[_0x785a('0x12')]('cm_contact_has_items',null,_0x785a('0x4f'))[_0x785a('0x14')](_0x785a('0x50'),_0x198c23)[_0x785a('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x1d2a45,_0x41f18f,_0x2b2288,_0x2a6e9f){var _0x279725=_[_0x785a('0x51')](_['keys'](_0x2a6e9f),[_0x785a('0x32'),'CompanyId',_0x785a('0x33'),_0x785a('0x3f')]);return squel[_0x785a('0x2d')]()['into'](_0x785a('0x38'))[_0x785a('0x30')](_0x279725,squel['select']()[_0x785a('0x36')](_0x279725)[_0x785a('0x37')](_0x41f18f)['where']('('+_0x2b2288[_0x785a('0x12')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x785a('0x36')](_0x2b2288)[_0x785a('0x37')](_0x785a('0x38'))[_0x785a('0x14')](_0x785a('0x42'),_0x1d2a45)['where'](_0x785a('0x52')))['where'](_0x785a('0x53'),squel[_0x785a('0x35')]()[_0x785a('0x10')](_0x785a('0x54'),_0x785a('0x55'))[_0x785a('0x37')](_0x41f18f)['group'](_0x2b2288[_0x785a('0x12')](','))))[_0x785a('0x46')]();}function handleStop(){logger[_0x785a('0x56')](_0x785a('0x57'));stopped=!![];}function handleUncaughtException(_0x42c9b6){logger[_0x785a('0x58')](_0x42c9b6[_0x785a('0x59')]);process['exit'](0x1);}function handleError(_0x1c0573,_0x47bbb7){stats[_0x785a('0x5a')][_0x785a('0x1c')]({'name':_0x47bbb7['code'],'message':_0x47bbb7[_0x785a('0x59')],'row':_0x1c0573});}function handleQuery(_0x2e005f){logger[_0x785a('0x56')](_0x2e005f);return db[_0x785a('0x5b')][_0x785a('0x5c')](_0x2e005f)[_0x785a('0x5d')](function(_0x2dd22b){results[_0x785a('0x1c')](_0x2dd22b);})[_0x785a('0x5e')](function(_0x4647a0){logger[_0x785a('0x58')](_0x4647a0[_0x785a('0x59')]);});}function updateTzCampaigns(_0x14270a){return new Promise(function(_0xc5b09e,_0x577731){var _0x1ae123=squel[_0x785a('0x35')]()['fields']([_0x785a('0x5f'),_0x785a('0x60')])[_0x785a('0x37')](_0x785a('0x61'))[_0x785a('0x12')]('campaigns_has_cm_lists',null,_0x785a('0x62'))[_0x785a('0x14')](_0x785a('0x63')+_0x14270a);db['sequelize']['query'](_0x1ae123['toString']())[_0x785a('0x5d')](function(_0x33d644){var _0x48aaa0=[];for(var _0x3eaede=0x0;_0x3eaede<_0x33d644['length'];_0x3eaede++){_0x48aaa0[_0x785a('0x1c')](getTimezoneData(_0x33d644[_0x3eaede],tmp_campaigns));}BPromise[_0x785a('0x1d')](_0x48aaa0)['then'](function(){_0xc5b09e({'val':0x1});});})[_0x785a('0x5e')](function(_0x22105e){logger['error'](_0x22105e[_0x785a('0x59')]);_0xc5b09e({'val':0x0});});});}function updateTzVoiceQueues(_0x450b84){return new Promise(function(_0x10ae82,_0x1b0bda){var _0x22e079=squel[_0x785a('0x35')]()['fields']([_0x785a('0x64'),_0x785a('0x65')])['from'](_0x785a('0x66'))[_0x785a('0x12')](_0x785a('0x67'),null,_0x785a('0x68'))[_0x785a('0x14')](_0x785a('0x69')+_0x450b84);db['sequelize'][_0x785a('0x5c')](_0x22e079[_0x785a('0x46')]())[_0x785a('0x5d')](function(_0x5b4efd){var _0x2a454b=[];for(var _0x23fb00=0x0;_0x23fb00<_0x5b4efd[_0x785a('0x1b')];_0x23fb00++){_0x2a454b[_0x785a('0x1c')](getTimezoneData(_0x5b4efd[_0x23fb00],tmp_voice_queues));}BPromise[_0x785a('0x1d')](_0x2a454b)[_0x785a('0x1a')](function(){_0x10ae82({'val':0x1});});})['catch'](function(_0x307624){logger[_0x785a('0x58')](_0x307624[_0x785a('0x59')]);_0x10ae82({'val':0x0});});});}function getTimezoneData(_0x3cc862,_0x3cb33c){return new Promise(function(_0x5f0c6b,_0x5bbfa9){var _0x25e6ed=shared['timezones'];var _0x4334e4=_0x25e6ed[_0x3cc862[_0x785a('0x6a')]];if(_['isNil'](_0x4334e4)){_0x5f0c6b({'ret':0x1});}else{var _0x2bce86=_0x4334e4[_0x785a('0x6b')];var _0x3ef576=squel[_0x785a('0x2d')]()[_0x785a('0x2e')](_0x3cb33c)[_0x785a('0x6c')]('id',_0x3cc862['id'])[_0x785a('0x6c')](_0x785a('0x6d'),_0x2bce86)[_0x785a('0x6c')](_0x785a('0x6a'),_0x3cc862[_0x785a('0x6a')])[_0x785a('0x46')]();return db['sequelize'][_0x785a('0x5c')](_0x3ef576)[_0x785a('0x5d')](function(_0x30126c){_0x5f0c6b({'ret':0x1});})[_0x785a('0x5e')](function(_0x52c53c){logger[_0x785a('0x58')](_0x52c53c[_0x785a('0x59')]);_0x5bbfa9({'ret':0x1});});}});}function handleTZQuery(_0xb6600b){logger[_0x785a('0x56')](_0xb6600b);return db[_0x785a('0x5b')][_0x785a('0x5c')](_0xb6600b)['spread'](function(_0x198d9f){})[_0x785a('0x5e')](function(_0x54e6bd){logger[_0x785a('0x58')](_0x54e6bd['message']);});}function main(_0x333556,_0xa9f50e,_0x472ca7,_0x5143c5){logger[_0x785a('0x56')](_0x785a('0x6e'),_0x333556,JSON[_0x785a('0x6f')](_0xa9f50e));process[_0x785a('0x70')](_0x785a('0x71'));var _0x3cfcaf=_0xa9f50e[_0x785a('0x72')];var _0x5680d8=_[_0x785a('0x73')](_0x3cfcaf);var _0x45455b=_0xa9f50e[_0x785a('0x74')];var _0x3835db=path[_0x785a('0x12')](config[_0x785a('0x75')],_0x785a('0x76'),_0x45455b+_0x785a('0x77'));hasTZ=_['keys'](_0x3cfcaf)['includes']('dialTimezone');var _0x3848e2=_['keys'](_0x3cfcaf)[_0x785a('0x12')]();logger[_0x785a('0x56')](_0x785a('0x78'),_0x3848e2);db[_0x785a('0x79')][_0x785a('0x18')]({'raw':!![],'attributes':['id',_0x785a('0x7a')]})[_0x785a('0x1a')](function(_0x385ffd){for(var _0x3eb7bd=0x0;_0x3eb7bd<_0x385ffd[_0x785a('0x1b')];_0x3eb7bd++){if(_0x385ffd[_0x3eb7bd][_0x785a('0x7a')]in _0x3cfcaf){contactItemTypes['push'](_0x385ffd[_0x3eb7bd]);delete _0x5680d8[_0x385ffd[_0x3eb7bd]['name']];hasAdditionalPhones=!![];}for(var _0xc4728d in _0x3cfcaf){if(_0x385ffd[_0x3eb7bd][_0x785a('0x7a')]+'_description'===_0xc4728d){phoneDescriptions['push']({'itemTypeId':_0x385ffd[_0x3eb7bd]['id'],'description':_0xc4728d});delete _0x5680d8[_0xc4728d];}}}if(hasAdditionalPhones)_0x5680d8[_0x785a('0x19')]='';var _0x23fffe=_[_0x785a('0x7b')](_0x5680d8)['join']();logger[_0x785a('0x56')](_0x785a('0x78'),_0x23fffe);fs[_0x785a('0x7c')](_0x3835db,_0x23fffe+'\x0a');Papa[_0x785a('0x7d')](fs[_0x785a('0x7e')](_0x333556),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b5a02,_0x5b7673){try{for(var _0x5a0e13=0x0,_0x510167=[];_0x5a0e13<_0x3b5a02['data']['length'];_0x5a0e13++){stats[_0x785a('0x7f')]+=0x1;if(_0x3b5a02[_0x785a('0x5a')][_0x5a0e13]){handleError(_0x3b5a02[_0x785a('0x80')][_0x5a0e13],_0x3b5a02['errors'][_0x5a0e13]);}else{var _0x6366e6=[];var _0xf779af=[];var _0x1aaef3={};for(var _0x39ace2 in _0x3cfcaf){let _0x7270e3=contactItemTypes[_0x785a('0x81')](_0x19e74e=>_0x19e74e[_0x785a('0x7a')]===_0x39ace2);let _0x38faa6=contactItemTypes['find'](_0x50a1c5=>_0x50a1c5[_0x785a('0x7a')]+_0x785a('0x82')===_0x39ace2);if(_[_0x785a('0x83')](_0x7270e3)&&_[_0x785a('0x83')](_0x38faa6)){if(_0x3cfcaf[_0x785a('0x84')](_0x39ace2)){if(_0x3b5a02[_0x785a('0x80')][_0x5a0e13][_0x3cfcaf[_0x39ace2]]){var _0x2d3a2b=_[_0x785a('0x85')](_0x3b5a02[_0x785a('0x80')][_0x5a0e13][_0x3cfcaf[_0x39ace2]][_0x785a('0x86')](/"/g,'\x27'));switch(_0x39ace2){case _0x785a('0x45'):var _0xe1c63e=moment(_0x2d3a2b,_0x785a('0xd'),!![]);if(_0xe1c63e[_0x785a('0x87')]()){_0x510167[_0x785a('0x1c')]('\x22'+_0x2d3a2b+'\x22');}else{_0x6366e6[_0x785a('0x1c')](_0x785a('0x88'));}break;case'priority':var _0x110601=parseInt(_0x2d3a2b);_0x2d3a2b=_['isNaN'](_0x110601)||_0x110601<0x0||_0x110601>0x4?_0x5143c5?0x3:0x2:_0x110601;_0x510167[_0x785a('0x1c')]('\x22'+_0x2d3a2b+'\x22');break;case _0x785a('0x34'):var _0x1143ed=parseInt(_0x2d3a2b);if(_[_0x785a('0x89')](_0x1143ed)&&_['includes'](_0x472ca7,_0x1143ed)){_0x510167[_0x785a('0x1c')]('\x22'+_0x1143ed+'\x22');}else{_0x6366e6[_0x785a('0x1c')]('agent\x20not\x20exists');}break;case _0x785a('0x8a'):if(isEmail(_0x2d3a2b)){_0x510167[_0x785a('0x1c')]('\x22'+_0x2d3a2b+'\x22');}else{_0x6366e6[_0x785a('0x1c')](_0x785a('0x8b'));}break;case _0x785a('0x8c'):var _0x48e4d1=moment(_0x2d3a2b,'YYYY-MM-DD',!![]);if(_0x48e4d1[_0x785a('0x87')]()){_0x510167[_0x785a('0x1c')]('\x22'+_0x2d3a2b+'\x22');}else{_0x6366e6[_0x785a('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x785a('0x6a'):var _0x1918d5=shared[_0x785a('0x8d')];var _0x2cca78=_0x1918d5[_0x2d3a2b];if(!_[_0x785a('0x83')](_0x2cca78)){var _0x242afe=_0x2cca78[_0x785a('0x6b')];_0x510167['push']('\x22'+_0x2d3a2b+'\x22');_0x510167[_0x785a('0x1c')]('\x22'+_0x242afe+'\x22');}break;default:_0x510167['push']('\x22'+_0x2d3a2b+'\x22');}}else{switch(_0x39ace2){case _0x785a('0x8e'):case _0x785a('0x11'):_0x6366e6[_0x785a('0x1c')](_0x39ace2+_0x785a('0x8f'));break;default:_0x510167[_0x785a('0x1c')]('\x22\x22');}}}}else{var _0x25eba='';if(!_[_0x785a('0x83')](_0x7270e3)){if(!_0x1aaef3[_0x785a('0x84')](_0x7270e3['id'])){if(!_['isNil'](_0x3b5a02[_0x785a('0x80')][_0x5a0e13][_0x3cfcaf[_0x39ace2]])){var _0x2d3a2b=_['trim'](_0x3b5a02[_0x785a('0x80')][_0x5a0e13][_0x3cfcaf[_0x39ace2]][_0x785a('0x86')](/"/g,'\x27'));var _0x33e0d1=phoneDescriptions[_0x785a('0x81')](_0x2cbca0=>_0x2cbca0[_0x785a('0x90')]===_0x7270e3['id']);if(!_[_0x785a('0x83')](_0x33e0d1)){var _0x21e30a=_['trim'](_0x3b5a02[_0x785a('0x80')][_0x5a0e13][_0x3cfcaf[_0x33e0d1[_0x785a('0x91')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x21e30a))_0x2d3a2b=_0x2d3a2b+'§'+_0x21e30a;}if(_0x25eba=='')_0x25eba=_0x2d3a2b;else _0x25eba+='|'+_0x2d3a2b;}_0xf779af[_0x785a('0x1c')](_0x7270e3['id']+':'+_0x25eba);_0x1aaef3[_0x7270e3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x510167['push']('\x22'+_0xf779af['join'](';')+'\x22');}if(_0x6366e6[_0x785a('0x1b')]){handleError(_0x3b5a02[_0x785a('0x80')][_0x5a0e13],{'code':_0x785a('0x92'),'message':_0x6366e6['join']()});}else{fs[_0x785a('0x93')](_0x3835db,_0x510167[_0x785a('0x12')]()+'\x0a');}_0x510167=[];}if(!(stats[_0x785a('0x7f')]%0xc8)){socket[_0x785a('0x94')]('contact:import:'+_0x45455b,stats);stats[_0x785a('0x5a')]=[];}}if(stopped){logger[_0x785a('0x56')](_0x785a('0x95'));_0x5b7673['abort']();}}catch(_0x1f1d3d){handleError(_0x3b5a02[_0x785a('0x80')][_0x5a0e13],{'code':_0x785a('0x96'),'message':_0x1f1d3d[_0x785a('0x59')]});logger[_0x785a('0x58')](_0x785a('0x97'),_0x1f1d3d[_0x785a('0x59')]);}},'complete':function(){try{var _0x5cbbae=[];var _0x136839=[];var _0x37c946=_0x785a('0x38');if(_0xa9f50e['duplicates']&&_0xa9f50e[_0x785a('0x98')][_0x785a('0x1b')]){_0x37c946='cm_contacts_'+_0x45455b;_0x5cbbae[_0x785a('0x1c')](_0x785a('0x99')+_0x37c946+_0x785a('0x9a'));}tmp_campaigns='campaigns_'+_0x45455b;tmp_voice_queues=_0x785a('0x9b')+_0x45455b;_0x136839[_0x785a('0x1c')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x785a('0x9c'));_0x136839[_0x785a('0x1c')](_0x785a('0x99')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x785a('0x9d')](_0x136839,handleTZQuery)[_0x785a('0x1a')](function(_0x434615){updateTzCampaigns(_0xa9f50e[_0x785a('0x32')])['then'](function(_0x4cc477){updateTzVoiceQueues(_0xa9f50e[_0x785a('0x32')])[_0x785a('0x1a')](function(_0xd91751){if(hasTZ)_0x23fffe=_0x23fffe[_0x785a('0x86')](_0x785a('0x6a'),_0x785a('0x9e'));var _0x229aca=util['format'](_0x785a('0x9f'),_0x3835db,_0x37c946,_0x23fffe,_0xa9f50e['ListId'],_0xa9f50e[_0x785a('0xa0')]||null,NOW,NOW);if(_[_0x785a('0x83')](_0x3cfcaf[_0x785a('0x45')])){_0x229aca+=_0x785a('0xa1');}_0x5cbbae[_0x785a('0x1c')](_0x229aca);if(_0xa9f50e[_0x785a('0x98')]&&_0xa9f50e[_0x785a('0x98')][_0x785a('0x1b')]){_0x5cbbae[_0x785a('0x1c')](insertCmContact(_0xa9f50e[_0x785a('0x32')],_0x37c946,_0xa9f50e[_0x785a('0x98')],_0x3cfcaf));_0x5cbbae[_0x785a('0x1c')](_0x785a('0xa2')+_0x37c946+';');}BPromise[_0x785a('0x9d')](_0x5cbbae,handleQuery)['then'](function(_0x711a1f){BPromise['all']([handleAdditionalPhones()])[_0x785a('0x1a')](function(){_0x5cbbae=[];for(var _0xf59bbe=0x0;_0xf59bbe\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','then','catch','split','all','findOne','CmContactHasItem','update','updated','create','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','exit','errors','code','info','spread','error','message','start','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','writeFileSync','createReadStream','rows','data','find','_description','hasOwnProperty','trim'];(function(_0x119a47,_0x54a124){var _0x4bdd48=function(_0xf222e4){while(--_0xf222e4){_0x119a47['push'](_0x119a47['shift']());}};_0x4bdd48(++_0x54a124);}(_0xede3,0xc0));var _0x3ede=function(_0x24ad61,_0x53e969){_0x24ad61=_0x24ad61-0x0;var _0x4e7962=_0xede3[_0x24ad61];return _0x4e7962;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x3ede('0x0'));var Papa=require('papaparse');var util=require(_0x3ede('0x1'));var BPromise=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var squel=require(_0x3ede('0x4'));var Redis=require(_0x3ede('0x5'));var db=require(_0x3ede('0x6'))['db'];var config=require(_0x3ede('0x7'));var logger=require(_0x3ede('0x8'))(_0x3ede('0x9'));config[_0x3ede('0xa')]=_[_0x3ede('0xb')](config[_0x3ede('0xa')],{'host':_0x3ede('0xc'),'port':0x18eb});var socket=require(_0x3ede('0xd'))(new Redis(config['redis']));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()[_0x3ede('0xe')](_0x3ede('0xf'));var tempTableName=_0x3ede('0x10')+moment()['format'](_0x3ede('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x555bd){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))*$/[_0x3ede('0x12')](_0x555bd);}function selectNotIn(_0x377182,_0x1e5240,_0x4ed90c,_0x3d2c6c,_0x16077b){return squel[_0x3ede('0x13')]()[_0x3ede('0x14')](_0x3ede('0x15'))[_0x3ede('0x16')](_0x3d2c6c)[_0x3ede('0x17')](_0x1e5240,null,_0x1e5240+_0x3ede('0x18')+_0x3d2c6c+'.'+_0x4ed90c)[_0x3ede('0x19')](_0x3d2c6c+'.'+_0x4ed90c+_0x3ede('0x1a')+_0x377182+'.'+_0x4ed90c)[_0x3ede('0x19')](_0x1e5240+_0x3ede('0x1b')+_0x16077b[_0x3ede('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5d2d69,_0x4e03a5){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3ede('0x1c')]['query'](_0x3ede('0x1d')+tempTableName)['spread'](function(_0x54ae57){if(_0x54ae57!==null){var _0x18e11c=[];for(var _0x3563f7=0x0;_0x3563f7<_0x54ae57[_0x3ede('0x1e')];_0x3563f7++){var _0x57ac4f=_0x54ae57[_0x3563f7];if(!_[_0x3ede('0x1f')](_0x57ac4f['phone'])){if(!_['isNil'](_0x57ac4f[_0x3ede('0x20')]))_0x18e11c[_0x3ede('0x21')](insertAdditionalPhones(_0x57ac4f));promisesContact[_0x3ede('0x21')]({'contact':_0x57ac4f});}}}Promise['all'](_0x18e11c)[_0x3ede('0x22')](function(){_0x5d2d69({'val':0x1});});})[_0x3ede('0x23')](function(_0x4fdcc6){logger['error'](_0x4fdcc6['message']);});});}function insertAdditionalPhones(_0x2f5c95){return new Promise(function(_0x47ed7f,_0x38ebd6){var _0x5a45ff=_0x2f5c95[_0x3ede('0x20')];if(_[_0x3ede('0x1f')](_0x5a45ff))_0x38ebd6({'val':0x0});else{var _0x26e082=_0x5a45ff[_0x3ede('0x24')](';');var _0x33b2d6=[];orderBy=0x0;for(var _0x472924=0x0;_0x472924<_0x26e082['length'];_0x472924++){_0x33b2d6[_0x3ede('0x21')](splitAdditionalPhone(_0x2f5c95['id'],_0x26e082[_0x472924]));}Promise[_0x3ede('0x25')](_0x33b2d6)[_0x3ede('0x22')](function(){_0x47ed7f({'val':_0x26e082[_0x3ede('0x1e')]});});}});}function splitAdditionalPhone(_0x313699,_0x10636f){return new Promise(function(_0xc9192d,_0x44713b){var _0x252e4e=_0x10636f[_0x3ede('0x24')](':');var _0x553584=_0x252e4e[0x0];var _0x5e3304=_0x252e4e[0x1];if(_0x5e3304!==''){var _0x3765fe=_0x5e3304[_0x3ede('0x24')]('|');var _0x248e17=[];for(var _0x8e750c=0x0;_0x8e750c<_0x3765fe[_0x3ede('0x1e')];_0x8e750c++){if(_0x3765fe[_0x8e750c]!==''){var _0x43363a=_['filter'](promisesAdditionalPhones,{'contactId':_0x313699,'phone':_0x3765fe[_0x8e750c]});if(_0x43363a[_0x3ede('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x3ede('0x21')]({'contactId':_0x313699,'contactTypeId':_0x553584,'phone':_0x3765fe[_0x8e750c],'orderBy':orderBy});}}}_0xc9192d({'ok':0x1});}else _0xc9192d({'res':0x0});});}function createAdditionalPhone(_0xa600fa,_0x4b4429,_0x26f04e,_0x8daee8){var _0x449e94='';var _0x57cf8a='';var _0x3d064a=_0x26f04e['split']('§');_0x449e94=_0x3d064a[0x0];if(_0x3d064a[_0x3ede('0x1e')]==0x2)_0x57cf8a=_0x3d064a[0x1];return new Promise(function(_0x436b86,_0x5930f4){return db['CmContactHasItem'][_0x3ede('0x26')]({'where':{'CmContactId':_0xa600fa,'item':_0x449e94}})[_0x3ede('0x22')](function(_0x3f8f6c){if(_0x3f8f6c){return db[_0x3ede('0x27')][_0x3ede('0x28')]({'ItemTypeId':_0x4b4429,'description':_0x57cf8a,'OrderBy':_0x8daee8},{'where':{'CmContactId':_0xa600fa,'item':_0x449e94}})[_0x3ede('0x22')](function(_0x41c790){_0x436b86({'res':_0x3ede('0x29')});});}else{return db[_0x3ede('0x27')][_0x3ede('0x2a')]({'CmContactId':_0xa600fa,'item':_0x449e94,'ItemTypeId':_0x4b4429,'description':_0x57cf8a,'OrderBy':_0x8daee8,'ItemClass':'PHONE'})[_0x3ede('0x22')](function(_0x8a0ebc){_0x436b86({'res':'inserted'});});}});});}function updateContact(_0x232b90){return new Promise(function(_0x131074,_0x3a03b6){var _0x4da83d=_0x232b90['id'];delete _0x232b90['id'];return db[_0x3ede('0x2b')]['update'](_0x232b90,{'where':{'id':_0x4da83d}})[_0x3ede('0x22')](function(_0x2e61b5){updatedRows+=0x1;return db[_0x3ede('0x2c')]['update']({'phone':_0x232b90['phone']},{'where':{'ContactId':_0x4da83d}})[_0x3ede('0x22')](function(_0x2600b6){_0x131074({'ret':'OK'});});});});}function insertCmHopper(_0x19b105,_0x36a636,_0x1a3130,_0x5d8a03,_0x8a94f){var _0x1caffb=[_0x3ede('0x2d'),_0x3ede('0x2e'),'cm_contacts.id',_0x3ede('0x2f'),_0x36a636+'.'+_0x5d8a03,_0x3ede('0x30'),_0x3ede('0x31'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x8a94f+'\x22'];return squel[_0x3ede('0x32')]()[_0x3ede('0x33')](_0x3ede('0x34'))[_0x3ede('0x35')]([_0x3ede('0x15'),_0x3ede('0x36'),_0x3ede('0x37'),'ListId',_0x5d8a03,_0x3ede('0x38'),_0x3ede('0x39'),_0x3ede('0x3a'),'UserId','recallme'],squel['select']()[_0x3ede('0x3b')](_0x1caffb)[_0x3ede('0x16')](_0x36a636)[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x3d')+_0x36a636+_0x3ede('0x3e'))[_0x3ede('0x17')](_0x1a3130,null,_0x1a3130+_0x3ede('0x18')+_0x36a636+'.'+_0x5d8a03)[_0x3ede('0x19')](_0x36a636+'.CmListId\x20=\x20?',_0x19b105)[_0x3ede('0x19')](_0x3ede('0x3f'),NOW)[_0x3ede('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36a636,_0x1a3130,_0x5d8a03,_0x3ede('0x34'),[_0x3ede('0x40'),_0x3ede('0x41')]))[_0x3ede('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x36a636,_0x1a3130,_0x5d8a03,'cm_hopper',[_0x3ede('0x40')])))[_0x3ede('0x42')]();}function insertCmHopperBlack(_0x441864,_0x15bfbb,_0x507054,_0x133c73){var _0x342bf7=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x15bfbb+'.'+_0x133c73,_0x3ede('0x30'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x3ede('0x43'))[_0x3ede('0x35')]([_0x3ede('0x15'),_0x3ede('0x37'),_0x3ede('0x44'),_0x133c73,_0x3ede('0x38'),'updatedAt'],squel[_0x3ede('0x13')]()['fields'](_0x342bf7)['from'](_0x15bfbb)[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x3d')+_0x15bfbb+'.CmListId')['join'](_0x507054,null,_0x507054+_0x3ede('0x18')+_0x15bfbb+'.'+_0x133c73)[_0x3ede('0x19')](_0x15bfbb+_0x3ede('0x45'),_0x441864)['where'](_0x3ede('0x3f'),NOW)[_0x3ede('0x19')](_0x3ede('0x46'),squel[_0x3ede('0x13')]()[_0x3ede('0x14')](_0x3ede('0x15'))[_0x3ede('0x16')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x441864)['where'](_0x133c73+'\x20=\x20?',_0x15bfbb+'.'+_0x133c73)))[_0x3ede('0x42')]();}function insertCmHopperAdditionalPhones(_0x44ba2a){var _0x13b7a0=[_0x3ede('0x47'),_0x3ede('0x48'),_0x3ede('0x49'),_0x3ede('0x4a'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x3ede('0x33')](_0x3ede('0x4b'))[_0x3ede('0x35')]([_0x3ede('0x4c'),_0x3ede('0x15'),_0x3ede('0x4d'),'createdAt',_0x3ede('0x39')],squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x13b7a0)[_0x3ede('0x16')](_0x3ede('0x34'))[_0x3ede('0x17')](_0x3ede('0x3c'),null,_0x3ede('0x4e'))['join']('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x3ede('0x19')](_0x3ede('0x4f'),_0x44ba2a)[_0x3ede('0x19')](_0x3ede('0x3f'),NOW))['toString']();}function insertCmContact(_0x253773,_0x2ca7fe,_0x5d0ddb,_0x5e021f){var _0x1393d9=_['concat'](_['keys'](_0x5e021f),[_0x3ede('0x44'),_0x3ede('0x50'),_0x3ede('0x38'),'updatedAt']);return squel[_0x3ede('0x32')]()['into']('cm_contacts')[_0x3ede('0x35')](_0x1393d9,squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x1393d9)['from'](_0x2ca7fe)['where']('('+_0x5d0ddb['join'](',')+_0x3ede('0x51'),squel[_0x3ede('0x13')]()[_0x3ede('0x3b')](_0x5d0ddb)['from']('cm_contacts')['where'](_0x3ede('0x52'),_0x253773))[_0x3ede('0x19')](_0x3ede('0x53'),squel[_0x3ede('0x13')]()['field'](_0x3ede('0x54'),_0x3ede('0x55'))[_0x3ede('0x16')](_0x2ca7fe)[_0x3ede('0x56')](_0x5d0ddb[_0x3ede('0x17')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x13f96d){logger['error'](_0x13f96d['message']);process[_0x3ede('0x57')](0x1);}function handleError(_0x83c40c,_0x2c138b){stats[_0x3ede('0x58')][_0x3ede('0x21')]({'name':_0x2c138b[_0x3ede('0x59')],'message':_0x2c138b['message'],'row':_0x83c40c});}function handleQuery(_0x35f41a){logger[_0x3ede('0x5a')](_0x35f41a);return db[_0x3ede('0x1c')]['query'](_0x35f41a)[_0x3ede('0x5b')](function(_0x4b6e51){results['push'](_0x4b6e51);})[_0x3ede('0x23')](function(_0x2cacb6){logger[_0x3ede('0x5c')](_0x2cacb6[_0x3ede('0x5d')]);});}function main(_0x6137a,_0x57e9fc,_0xc09107,_0x165410){logger[_0x3ede('0x5a')]('main',_0x6137a,JSON['stringify'](_0x57e9fc));process['send'](_0x3ede('0x5e'));var _0x3ed3a9=_0x57e9fc['binding'];var _0x108da3=_[_0x3ede('0x5f')](_0x3ed3a9);var _0x28ba81=_0x57e9fc['socket_timestamp'];var _0x54eed5=path[_0x3ede('0x17')](config[_0x3ede('0x60')],_0x3ede('0x61'),_0x28ba81+_0x3ede('0x62'));logger[_0x3ede('0x5a')](_0x3ede('0x63'),_0x57e9fc);db[_0x3ede('0x64')][_0x3ede('0x65')]({'raw':!![],'attributes':['id',_0x3ede('0x66')]})[_0x3ede('0x22')](function(_0x56ffe9){for(var _0x4c19d7=0x0;_0x4c19d7<_0x56ffe9[_0x3ede('0x1e')];_0x4c19d7++){if(_0x56ffe9[_0x4c19d7]['name']in _0x3ed3a9){contactItemTypes[_0x3ede('0x21')](_0x56ffe9[_0x4c19d7]);delete _0x108da3[_0x56ffe9[_0x4c19d7][_0x3ede('0x66')]];hasAdditionalPhones=!![];}for(var _0x9981cb in _0x3ed3a9){if(_0x56ffe9[_0x4c19d7][_0x3ede('0x66')]+'_description'===_0x9981cb){phoneDescriptions['push']({'itemTypeId':_0x56ffe9[_0x4c19d7]['id'],'description':_0x9981cb});delete _0x108da3[_0x9981cb];}}}if(hasAdditionalPhones)_0x108da3[_0x3ede('0x20')]='';var _0x7e1b8e=_['keys'](_0x108da3)[_0x3ede('0x17')]();logger[_0x3ede('0x5a')](_0x3ede('0x67'),_0x7e1b8e);fs[_0x3ede('0x68')](_0x54eed5,_0x7e1b8e+'\x0a');Papa['parse'](fs[_0x3ede('0x69')](_0x6137a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x483860,_0x12731d){try{for(var _0x322bf6=0x0,_0x4d7540=[];_0x322bf6<_0x483860['data'][_0x3ede('0x1e')];_0x322bf6++){stats[_0x3ede('0x6a')]+=0x1;if(_0x483860[_0x3ede('0x58')][_0x322bf6]){handleError(_0x483860[_0x3ede('0x6b')][_0x322bf6],_0x483860['errors'][_0x322bf6]);}else{var _0xbee737=[];var _0x4b8e3a=[];var _0x4c05bf={};for(var _0x511190 in _0x3ed3a9){let _0x53c8cb=contactItemTypes[_0x3ede('0x6c')](_0xb53fbc=>_0xb53fbc[_0x3ede('0x66')]===_0x511190);let _0x120b0b=contactItemTypes['find'](_0x3fde8d=>_0x3fde8d[_0x3ede('0x66')]+_0x3ede('0x6d')===_0x511190);if(_[_0x3ede('0x1f')](_0x53c8cb)&&_[_0x3ede('0x1f')](_0x120b0b)){if(_0x3ed3a9[_0x3ede('0x6e')](_0x511190)){if(_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x511190]]){var _0x223ba2=_[_0x3ede('0x6f')](_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x511190]][_0x3ede('0x70')](/"/g,'\x27'));switch(_0x511190){case _0x3ede('0x36'):var _0x4215bf=moment(_0x223ba2,_0x3ede('0xf'),!![]);if(_0x4215bf['isValid']()){_0x4d7540['push']('\x22'+_0x223ba2+'\x22');}else{_0xbee737['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x3ede('0x3a'):var _0x5904b4=parseInt(_0x223ba2);_0x223ba2=_['isNaN'](_0x5904b4)||_0x5904b4<0x0||_0x5904b4>0x4?_0x165410?0x3:0x2:_0x5904b4;_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');break;case _0x3ede('0x71'):var _0x17e55c=parseInt(_0x223ba2);if(_['isNumber'](_0x17e55c)&&_[_0x3ede('0x72')](_0xc09107,_0x17e55c)){_0x4d7540[_0x3ede('0x21')]('\x22'+_0x17e55c+'\x22');}else{_0xbee737[_0x3ede('0x21')](_0x3ede('0x73'));}break;case _0x3ede('0x74'):if(isEmail(_0x223ba2)){_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');}else{_0xbee737[_0x3ede('0x21')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x50953a=moment(_0x223ba2,_0x3ede('0x75'),!![]);if(_0x50953a[_0x3ede('0x76')]()){_0x4d7540['push']('\x22'+_0x223ba2+'\x22');}else{_0xbee737[_0x3ede('0x21')](_0x3ede('0x77'));}break;default:_0x4d7540[_0x3ede('0x21')]('\x22'+_0x223ba2+'\x22');}}else{switch(_0x511190){case _0x3ede('0x78'):case'phone':_0xbee737[_0x3ede('0x21')](_0x511190+'\x20not\x20specified');break;default:_0x4d7540['push']('\x22\x22');}}}}else{var _0x171ba3='';if(!_['isNil'](_0x53c8cb)){if(!_0x4c05bf[_0x3ede('0x6e')](_0x53c8cb['id'])){for(var _0x130f11=0x0;_0x130f11<_0x3ed3a9[_0x511190]['length'];_0x130f11++){var _0x223ba2=_[_0x3ede('0x6f')](_0x483860['data'][_0x322bf6][_0x3ed3a9[_0x511190][_0x130f11]][_0x3ede('0x70')](/"/g,'\x27'));var _0x2c586b=phoneDescriptions['find'](_0x49862a=>_0x49862a['itemTypeId']===_0x53c8cb['id']);if(!_['isNil'](_0x2c586b)){var _0x240685=_[_0x3ede('0x6f')](_0x483860[_0x3ede('0x6b')][_0x322bf6][_0x3ed3a9[_0x2c586b[_0x3ede('0x79')]][0x0]][_0x3ede('0x70')](/"/g,'\x27'));if(!_[_0x3ede('0x1f')](_0x240685))_0x223ba2=_0x223ba2+'§'+_0x240685;}if(_0x171ba3=='')_0x171ba3=_0x223ba2;else _0x171ba3+='|'+_0x223ba2;}_0x4b8e3a[_0x3ede('0x21')](_0x53c8cb['id']+':'+_0x171ba3);_0x4c05bf[_0x53c8cb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4d7540['push']('\x22'+_0x4b8e3a['join'](';')+'\x22');}if(_0xbee737[_0x3ede('0x1e')]){handleError(_0x483860['data'][_0x322bf6],{'code':_0x3ede('0x7a'),'message':_0xbee737[_0x3ede('0x17')]()});}else{fs['appendFileSync'](_0x54eed5,_0x4d7540['join']()+'\x0a');}_0x4d7540=[];}if(!(stats['rows']%0xc8)){socket[_0x3ede('0x7b')](_0x3ede('0x7c')+_0x28ba81,stats);stats[_0x3ede('0x58')]=[];}}if(stopped){logger[_0x3ede('0x5a')](_0x3ede('0x7d'));_0x12731d['abort']();}}catch(_0x47d485){handleError(_0x483860[_0x3ede('0x6b')][_0x322bf6],{'code':_0x3ede('0x7e'),'message':_0x47d485[_0x3ede('0x5d')]});logger['error'](_0x3ede('0x7f'),_0x47d485[_0x3ede('0x5d')]);}},'complete':function(){try{var _0x5d73bf=[];var _0x252b87=tempTableName;_0x5d73bf[_0x3ede('0x21')](_0x3ede('0x80')+_0x252b87+'\x20LIKE\x20cm_contacts;');logger[_0x3ede('0x5a')](_0x3ede('0x81'),contactItemTypes[_0x3ede('0x1e')]);var _0x4b831b=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x54eed5,_0x252b87,_0x7e1b8e,_0x57e9fc[_0x3ede('0x44')],_0x57e9fc[_0x3ede('0x50')]||null,NOW,NOW);if(_[_0x3ede('0x1f')](_0x3ed3a9[_0x3ede('0x36')])){_0x4b831b+=_0x3ede('0x82');}_0x5d73bf[_0x3ede('0x21')](_0x4b831b);BPromise[_0x3ede('0x83')](_0x5d73bf,handleQuery)['then'](function(_0x38b9d3){BPromise[_0x3ede('0x25')]([handleAdditionalPhones()])[_0x3ede('0x22')](function(){_0x5d73bf=[];for(var _0x4b87bd=0x0;_0x4b87bd\x20\x20','existsSync'];(function(_0x46094d,_0x225d65){var _0x1e6457=function(_0x331ca7){while(--_0x331ca7){_0x46094d['push'](_0x46094d['shift']());}};_0x1e6457(++_0x225d65);}(_0xbaf7,0x137));var _0x7baf=function(_0x5b50a1,_0x3f2783){_0x5b50a1=_0x5b50a1-0x0;var _0x173370=_0xbaf7[_0x5b50a1];return _0x173370;};'use strict';var fs=require('fs');var path=require(_0x7baf('0x0'));var _=require(_0x7baf('0x1'));var Papa=require(_0x7baf('0x2'));var util=require(_0x7baf('0x3'));var BPromise=require(_0x7baf('0x4'));var moment=require('moment');var squel=require(_0x7baf('0x5'));var Redis=require(_0x7baf('0x6'));var db=require(_0x7baf('0x7'))['db'];var config=require(_0x7baf('0x8'));var logger=require(_0x7baf('0x9'))(_0x7baf('0xa'));config[_0x7baf('0xb')]=_['defaults'](config[_0x7baf('0xb')],{'host':_0x7baf('0xc'),'port':0x18eb});var socket=require(_0x7baf('0xd'))(new Redis(config[_0x7baf('0xb')]));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()[_0x7baf('0xe')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()[_0x7baf('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1e472a){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'](_0x1e472a);}function selectNotIn(_0x59303b,_0x1dd133,_0x1dadf8,_0x1d09c3,_0x48cf41){return squel[_0x7baf('0xf')]()[_0x7baf('0x10')](_0x7baf('0x11'))[_0x7baf('0x12')](_0x1d09c3)[_0x7baf('0x13')](_0x1dd133,null,_0x1dd133+_0x7baf('0x14')+_0x1d09c3+'.'+_0x1dadf8)[_0x7baf('0x15')](_0x1d09c3+'.'+_0x1dadf8+_0x7baf('0x16')+_0x59303b+'.'+_0x1dadf8)['where'](_0x1dd133+_0x7baf('0x17')+_0x48cf41['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x38df2e,_0x3be400){promisesAdditionalPhones=[];promisesContact=[];return db[_0x7baf('0x18')]['query'](_0x7baf('0x19')+tempTableName)[_0x7baf('0x1a')](function(_0x2bacad){if(_0x2bacad!==null){var _0x3b70fd=[];for(var _0x4748ca=0x0;_0x4748ca<_0x2bacad[_0x7baf('0x1b')];_0x4748ca++){var _0x184aa5=_0x2bacad[_0x4748ca];if(!_[_0x7baf('0x1c')](_0x184aa5[_0x7baf('0x11')])){if(!_[_0x7baf('0x1c')](_0x184aa5[_0x7baf('0x1d')]))_0x3b70fd[_0x7baf('0x1e')](insertAdditionalPhones(_0x184aa5));promisesContact[_0x7baf('0x1e')]({'contact':_0x184aa5});}}}Promise[_0x7baf('0x1f')](_0x3b70fd)[_0x7baf('0x20')](function(){_0x38df2e({'val':0x1});});})[_0x7baf('0x21')](function(_0x33c58e){logger[_0x7baf('0x22')](_0x33c58e['message']);});});}function insertAdditionalPhones(_0x9a8f82){return new Promise(function(_0x4cb942,_0x4800c4){var _0x3428a4=_0x9a8f82[_0x7baf('0x1d')];if(_[_0x7baf('0x1c')](_0x3428a4))_0x4800c4({'val':0x0});else{var _0xaca134=_0x3428a4[_0x7baf('0x23')](';');var _0xd324a=[];orderBy=0x0;for(var _0x341dbd=0x0;_0x341dbd<_0xaca134[_0x7baf('0x1b')];_0x341dbd++){_0xd324a[_0x7baf('0x1e')](splitAdditionalPhone(_0x9a8f82['id'],_0xaca134[_0x341dbd]));}Promise['all'](_0xd324a)['then'](function(){_0x4cb942({'val':_0xaca134[_0x7baf('0x1b')]});});}});}function splitAdditionalPhone(_0x485171,_0x15eb2a){return new Promise(function(_0x116224,_0xa4bfad){var _0x594094=_0x15eb2a[_0x7baf('0x23')](':');var _0x5cedc5=_0x594094[0x0];var _0x3a7691=_0x594094[0x1];if(_0x3a7691!==''){var _0x539ebf=_0x3a7691[_0x7baf('0x23')]('|');var _0x4f1d52=[];for(var _0x4d64e5=0x0;_0x4d64e5<_0x539ebf[_0x7baf('0x1b')];_0x4d64e5++){if(_0x539ebf[_0x4d64e5]!==''){var _0x5b9c9c=_[_0x7baf('0x24')](promisesAdditionalPhones,{'contactId':_0x485171,'phone':_0x539ebf[_0x4d64e5]});if(_0x5b9c9c[_0x7baf('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x7baf('0x1e')]({'contactId':_0x485171,'contactTypeId':_0x5cedc5,'phone':_0x539ebf[_0x4d64e5],'orderBy':orderBy});}}}_0x116224({'ok':0x1});}else _0x116224({'res':0x0});});}function createAdditionalPhone(_0x1cf5be,_0x1c9f3d,_0x415484,_0x144e9c){var _0x4b0b3b='';var _0x267809='';var _0x34bfd8=_0x415484[_0x7baf('0x23')]('§');_0x4b0b3b=_0x34bfd8[0x0];if(_0x34bfd8[_0x7baf('0x1b')]==0x2)_0x267809=_0x34bfd8[0x1];return new Promise(function(_0x16f8fb,_0x363080){return db[_0x7baf('0x25')][_0x7baf('0x26')]({'where':{'CmContactId':_0x1cf5be,'item':_0x4b0b3b}})[_0x7baf('0x20')](function(_0x54943e){if(_0x54943e){return db[_0x7baf('0x25')][_0x7baf('0x27')]({'ItemTypeId':_0x1c9f3d,'description':_0x267809,'OrderBy':_0x144e9c},{'where':{'CmContactId':_0x1cf5be,'item':_0x4b0b3b}})[_0x7baf('0x20')](function(_0xe3e562){_0x16f8fb({'res':_0x7baf('0x28')});});}else{return db[_0x7baf('0x25')]['create']({'CmContactId':_0x1cf5be,'item':_0x4b0b3b,'ItemTypeId':_0x1c9f3d,'description':_0x267809,'OrderBy':_0x144e9c,'ItemClass':_0x7baf('0x29')})[_0x7baf('0x20')](function(_0x4cf568){_0x16f8fb({'res':_0x7baf('0x2a')});});}});});}function updateContact(_0xddaebf){return new Promise(function(_0x335f97,_0x29da9d){var _0x5898a0=_0xddaebf['id'];delete _0xddaebf['id'];return db[_0x7baf('0x2b')][_0x7baf('0x27')](_0xddaebf,{'where':{'id':_0x5898a0}})[_0x7baf('0x20')](function(_0x39c124){updatedRows+=0x1;return db['CmHopper'][_0x7baf('0x27')]({'phone':_0xddaebf['phone']},{'where':{'ContactId':_0x5898a0}})[_0x7baf('0x20')](function(_0x42d1a3){_0x335f97({'ret':'OK'});});});});}function insertCmHopper(_0x2c9256,_0x480e6d,_0x40fcdd,_0x5893ac,_0x45b29c){var _0x4a07cc=[_0x7baf('0x2c'),_0x7baf('0x2d'),_0x7baf('0x2e'),_0x7baf('0x2f'),_0x480e6d+'.'+_0x5893ac,_0x7baf('0x30'),_0x7baf('0x31'),_0x7baf('0x32'),'cm_contacts.UserId','\x22'+_0x45b29c+'\x22'];return squel[_0x7baf('0x33')]()['into'](_0x7baf('0x34'))['fromQuery']([_0x7baf('0x11'),_0x7baf('0x35'),_0x7baf('0x36'),_0x7baf('0x37'),_0x5893ac,'createdAt',_0x7baf('0x38'),_0x7baf('0x39'),_0x7baf('0x3a'),_0x7baf('0x3b')],squel[_0x7baf('0xf')]()['fields'](_0x4a07cc)[_0x7baf('0x12')](_0x480e6d)[_0x7baf('0x13')](_0x7baf('0x3c'),null,_0x7baf('0x3d')+_0x480e6d+_0x7baf('0x3e'))[_0x7baf('0x13')](_0x40fcdd,null,_0x40fcdd+'.id\x20=\x20'+_0x480e6d+'.'+_0x5893ac)['where'](_0x480e6d+'.CmListId\x20=\x20?',_0x2c9256)[_0x7baf('0x15')](_0x7baf('0x3f'),NOW)[_0x7baf('0x15')](_0x7baf('0x40'),selectNotIn(_0x480e6d,_0x40fcdd,_0x5893ac,_0x7baf('0x34'),[_0x7baf('0x41'),_0x7baf('0x42')]))['where'](_0x7baf('0x40'),selectNotIn(_0x480e6d,_0x40fcdd,_0x5893ac,'cm_hopper',[_0x7baf('0x41')])))[_0x7baf('0x43')]();}function insertCmHopperBlack(_0xa98a9b,_0x4793c7,_0x5f0326,_0x2f225e){var _0x273b43=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x4793c7+'.'+_0x2f225e,'cm_contacts.createdAt',_0x7baf('0x31')];return squel[_0x7baf('0x33')]()['into'](_0x7baf('0x44'))[_0x7baf('0x45')](['phone','ContactId','ListId',_0x2f225e,_0x7baf('0x46'),_0x7baf('0x38')],squel[_0x7baf('0xf')]()['fields'](_0x273b43)[_0x7baf('0x12')](_0x4793c7)['join'](_0x7baf('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x4793c7+_0x7baf('0x3e'))[_0x7baf('0x13')](_0x5f0326,null,_0x5f0326+'.id\x20=\x20'+_0x4793c7+'.'+_0x2f225e)[_0x7baf('0x15')](_0x4793c7+_0x7baf('0x47'),_0xa98a9b)[_0x7baf('0x15')](_0x7baf('0x3f'),NOW)[_0x7baf('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7baf('0x10')]('phone')[_0x7baf('0x12')](_0x7baf('0x44'))[_0x7baf('0x15')](_0x7baf('0x48'),_0xa98a9b)[_0x7baf('0x15')](_0x2f225e+'\x20=\x20?',_0x4793c7+'.'+_0x2f225e)))[_0x7baf('0x43')]();}function insertCmHopperAdditionalPhones(_0x4ab023){var _0x20628d=[_0x7baf('0x49'),_0x7baf('0x4a'),_0x7baf('0x4b'),_0x7baf('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x7baf('0x33')]()[_0x7baf('0x4d')](_0x7baf('0x4e'))['fromQuery']([_0x7baf('0x4f'),_0x7baf('0x11'),'OrderBy',_0x7baf('0x46'),_0x7baf('0x38')],squel['select']()['fields'](_0x20628d)[_0x7baf('0x12')](_0x7baf('0x34'))[_0x7baf('0x13')](_0x7baf('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join']('cm_contact_has_items',null,_0x7baf('0x50'))[_0x7baf('0x15')](_0x7baf('0x51'),_0x4ab023)[_0x7baf('0x15')](_0x7baf('0x3f'),NOW))[_0x7baf('0x43')]();}function insertCmContact(_0x41d022,_0x1fb86f,_0x42ca0d,_0x788c5d){var _0x142a55=_[_0x7baf('0x52')](_[_0x7baf('0x53')](_0x788c5d),[_0x7baf('0x37'),_0x7baf('0x54'),_0x7baf('0x46'),_0x7baf('0x38')]);return squel['insert']()['into'](_0x7baf('0x3c'))[_0x7baf('0x45')](_0x142a55,squel['select']()['fields'](_0x142a55)[_0x7baf('0x12')](_0x1fb86f)[_0x7baf('0x15')]('('+_0x42ca0d['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x7baf('0xf')]()[_0x7baf('0x55')](_0x42ca0d)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0x41d022))[_0x7baf('0x15')]('id\x20IN\x20?',squel[_0x7baf('0xf')]()[_0x7baf('0x10')](_0x7baf('0x56'),_0x7baf('0x57'))['from'](_0x1fb86f)[_0x7baf('0x58')](_0x42ca0d['join'](','))))[_0x7baf('0x43')]();}function handleStop(){logger[_0x7baf('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x393e78){logger['error'](_0x393e78[_0x7baf('0x5a')]);process['exit'](0x1);}function handleError(_0x7ae1d5,_0x3b82a5){stats['errors'][_0x7baf('0x1e')]({'name':_0x3b82a5[_0x7baf('0x5b')],'message':_0x3b82a5[_0x7baf('0x5a')],'row':_0x7ae1d5});}function handleQuery(_0x280c87){logger['info'](_0x280c87);return db['sequelize']['query'](_0x280c87)[_0x7baf('0x1a')](function(_0x6fd6c2){results['push'](_0x6fd6c2);})['catch'](function(_0x5dc42d){logger[_0x7baf('0x22')](_0x5dc42d[_0x7baf('0x5a')]);});}function main(_0x39bee7,_0x300248,_0x331781,_0x111321){logger['info'](_0x7baf('0x5c'),_0x39bee7,JSON[_0x7baf('0x5d')](_0x300248));process['send'](_0x7baf('0x5e'));var _0x415003=_0x300248[_0x7baf('0x5f')];var _0x2730f2=_['clone'](_0x415003);var _0xa0c0c4=_0x300248['socket_timestamp'];var _0x12a030=path[_0x7baf('0x13')](config[_0x7baf('0x60')],_0x7baf('0x61'),_0xa0c0c4+_0x7baf('0x62'));logger[_0x7baf('0x59')](_0x7baf('0x63'),_0x300248);db[_0x7baf('0x64')][_0x7baf('0x65')]({'raw':!![],'attributes':['id',_0x7baf('0x66')]})[_0x7baf('0x20')](function(_0x570a9b){for(var _0x2cca09=0x0;_0x2cca09<_0x570a9b[_0x7baf('0x1b')];_0x2cca09++){if(_0x570a9b[_0x2cca09][_0x7baf('0x66')]in _0x415003){contactItemTypes['push'](_0x570a9b[_0x2cca09]);delete _0x2730f2[_0x570a9b[_0x2cca09][_0x7baf('0x66')]];hasAdditionalPhones=!![];}for(var _0x26560a in _0x415003){if(_0x570a9b[_0x2cca09][_0x7baf('0x66')]+_0x7baf('0x67')===_0x26560a){phoneDescriptions[_0x7baf('0x1e')]({'itemTypeId':_0x570a9b[_0x2cca09]['id'],'description':_0x26560a});delete _0x2730f2[_0x26560a];}}}if(hasAdditionalPhones)_0x2730f2[_0x7baf('0x1d')]='';var _0x5da221=_[_0x7baf('0x53')](_0x2730f2)[_0x7baf('0x13')]();logger[_0x7baf('0x59')]('header',_0x5da221);fs['writeFileSync'](_0x12a030,_0x5da221+'\x0a');Papa[_0x7baf('0x68')](fs[_0x7baf('0x69')](_0x39bee7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x44c330,_0x2f862d){try{for(var _0x499dda=0x0,_0x1bf0c3=[];_0x499dda<_0x44c330[_0x7baf('0x6a')]['length'];_0x499dda++){stats[_0x7baf('0x6b')]+=0x1;if(_0x44c330['errors'][_0x499dda]){handleError(_0x44c330[_0x7baf('0x6a')][_0x499dda],_0x44c330[_0x7baf('0x6c')][_0x499dda]);}else{var _0x208fd6=[];var _0x3c3ab4=[];var _0x1a8eb0={};for(var _0x1dbbe6 in _0x415003){let _0x172661=contactItemTypes[_0x7baf('0x6d')](_0x41682a=>_0x41682a[_0x7baf('0x66')]===_0x1dbbe6);let _0x53bb0b=contactItemTypes[_0x7baf('0x6d')](_0x4005e8=>_0x4005e8[_0x7baf('0x66')]+_0x7baf('0x67')===_0x1dbbe6);if(_[_0x7baf('0x1c')](_0x172661)&&_[_0x7baf('0x1c')](_0x53bb0b)){if(_0x415003['hasOwnProperty'](_0x1dbbe6)){if(_0x44c330[_0x7baf('0x6a')][_0x499dda][_0x415003[_0x1dbbe6]]){var _0x4fce7f=_[_0x7baf('0x6e')](_0x44c330[_0x7baf('0x6a')][_0x499dda][_0x415003[_0x1dbbe6]][_0x7baf('0x6f')](/"/g,'\x27'));switch(_0x1dbbe6){case'scheduledat':var _0x238c23=moment(_0x4fce7f,_0x7baf('0x70'),!![]);if(_0x238c23[_0x7baf('0x71')]()){_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x4fce7f+'\x22');}else{_0x208fd6[_0x7baf('0x1e')](_0x7baf('0x72'));}break;case'priority':var _0x5c8210=parseInt(_0x4fce7f);_0x4fce7f=_[_0x7baf('0x73')](_0x5c8210)||_0x5c8210<0x0||_0x5c8210>0x4?_0x111321?0x3:0x2:_0x5c8210;_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x4fce7f+'\x22');break;case'UserId':var _0x486b69=parseInt(_0x4fce7f);if(_[_0x7baf('0x74')](_0x486b69)&&_[_0x7baf('0x75')](_0x331781,_0x486b69)){_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x486b69+'\x22');}else{_0x208fd6[_0x7baf('0x1e')](_0x7baf('0x76'));}break;case _0x7baf('0x77'):if(isEmail(_0x4fce7f)){_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x4fce7f+'\x22');}else{_0x208fd6[_0x7baf('0x1e')](_0x7baf('0x78'));}break;case _0x7baf('0x79'):var _0x5af0b2=moment(_0x4fce7f,_0x7baf('0x7a'),!![]);if(_0x5af0b2[_0x7baf('0x71')]()){_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x4fce7f+'\x22');}else{_0x208fd6['push'](_0x7baf('0x7b'));}break;default:_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x4fce7f+'\x22');}}else{switch(_0x1dbbe6){case'firstName':case'phone':_0x208fd6['push'](_0x1dbbe6+_0x7baf('0x7c'));break;default:_0x1bf0c3[_0x7baf('0x1e')]('\x22\x22');}}}}else{var _0x18d5da='';if(!_[_0x7baf('0x1c')](_0x172661)){if(!_0x1a8eb0[_0x7baf('0x7d')](_0x172661['id'])){for(var _0x2b5c1e=0x0;_0x2b5c1e<_0x415003[_0x1dbbe6][_0x7baf('0x1b')];_0x2b5c1e++){var _0x4fce7f=_[_0x7baf('0x6e')](_0x44c330['data'][_0x499dda][_0x415003[_0x1dbbe6][_0x2b5c1e]][_0x7baf('0x6f')](/"/g,'\x27'));var _0x2b801c=phoneDescriptions[_0x7baf('0x6d')](_0x2d3cf0=>_0x2d3cf0['itemTypeId']===_0x172661['id']);if(!_[_0x7baf('0x1c')](_0x2b801c)){var _0x3a7702=_[_0x7baf('0x6e')](_0x44c330[_0x7baf('0x6a')][_0x499dda][_0x415003[_0x2b801c[_0x7baf('0x7e')]][0x0]][_0x7baf('0x6f')](/"/g,'\x27'));if(!_[_0x7baf('0x1c')](_0x3a7702))_0x4fce7f=_0x4fce7f+'§'+_0x3a7702;}if(_0x18d5da=='')_0x18d5da=_0x4fce7f;else _0x18d5da+='|'+_0x4fce7f;}_0x3c3ab4['push'](_0x172661['id']+':'+_0x18d5da);_0x1a8eb0[_0x172661['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1bf0c3[_0x7baf('0x1e')]('\x22'+_0x3c3ab4[_0x7baf('0x13')](';')+'\x22');}if(_0x208fd6[_0x7baf('0x1b')]){handleError(_0x44c330['data'][_0x499dda],{'code':_0x7baf('0x7f'),'message':_0x208fd6['join']()});}else{fs[_0x7baf('0x80')](_0x12a030,_0x1bf0c3[_0x7baf('0x13')]()+'\x0a');}_0x1bf0c3=[];}if(!(stats[_0x7baf('0x6b')]%0xc8)){socket[_0x7baf('0x81')]('contact:import:'+_0xa0c0c4,stats);stats[_0x7baf('0x6c')]=[];}}if(stopped){logger[_0x7baf('0x59')]('Abort\x20parser');_0x2f862d[_0x7baf('0x82')]();}}catch(_0x53fe1c){handleError(_0x44c330[_0x7baf('0x6a')][_0x499dda],{'code':_0x7baf('0x83'),'message':_0x53fe1c[_0x7baf('0x5a')]});logger[_0x7baf('0x22')](_0x7baf('0x84'),_0x53fe1c['message']);}},'complete':function(){try{var _0x3b6cf0=[];var _0x599487=tempTableName;_0x3b6cf0[_0x7baf('0x1e')](_0x7baf('0x85')+_0x599487+'\x20LIKE\x20cm_contacts;');logger['info'](_0x7baf('0x86'),contactItemTypes[_0x7baf('0x1b')]);var _0x2bf60f=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x12a030,_0x599487,_0x5da221,_0x300248[_0x7baf('0x37')],_0x300248[_0x7baf('0x54')]||null,NOW,NOW);if(_[_0x7baf('0x1c')](_0x415003['scheduledat'])){_0x2bf60f+=_0x7baf('0x87');}_0x3b6cf0['push'](_0x2bf60f);BPromise[_0x7baf('0x88')](_0x3b6cf0,handleQuery)['then'](function(_0x30b9a9){BPromise[_0x7baf('0x1f')]([handleAdditionalPhones()])['then'](function(){_0x3b6cf0=[];for(var _0x23d115=0x0;_0x23d115\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','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','map','getInteractionsTables','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','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','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression'];(function(_0x1d9dcf,_0x284f9d){var _0x114ba1=function(_0x2f559a){while(--_0x2f559a){_0x1d9dcf['push'](_0x1d9dcf['shift']());}};_0x114ba1(++_0x284f9d);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var squel=require(_0xca0b('0x0'));var as=require(_0xca0b('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0xca0b('0x2'))[_0xca0b('0x3')];var utils=require(_0xca0b('0x4'));var db=require(_0xca0b('0x5'))['db'];function skipInteractionsQuery(_0x2f7b56,_0x3a53b4,_0xf39a90){var _0x29ae7e=![];var _0x3cb084=utils[_0xca0b('0x6')](_0x2f7b56);if(_0x3a53b4[_0xca0b('0x7')]===_0xca0b('0x8')&&!_0xf39a90[_0xca0b('0x9')]&&!_0xf39a90[_0x3cb084]){_0x29ae7e=!![];}return _0x29ae7e;}function getTagsQuery(){return squel[_0xca0b('0xa')]()['field']('id')[_0xca0b('0xb')](_0xca0b('0xc'))[_0xca0b('0xb')](_0xca0b('0xd'))[_0xca0b('0xe')](_0xca0b('0xf'));}function getUsersQuery(_0x589187,_0x31a0d1){var _0x45c0cf=utils[_0xca0b('0x10')](_0x589187);var _0x18af13=_0xca0b('0x11')+_0x589187+_0xca0b('0x12');var _0x2ab14f=squel[_0xca0b('0xa')]()[_0xca0b('0xb')](_0xca0b('0x13'))['field'](_0xca0b('0x14'))[_0xca0b('0xb')](_0xca0b('0x15')+_0x45c0cf)['from'](_0x18af13,'ui')[_0xca0b('0x16')](_0xca0b('0x17'),'u',_0xca0b('0x18'));if(_0x31a0d1[_0xca0b('0x19')]>0x0){_0x2ab14f[_0xca0b('0x1a')](_0xca0b('0x15')+_0x45c0cf+'\x20IN\x20?',_[_0xca0b('0x1b')](_0x31a0d1,'id'));}return _0x2ab14f;}function getInteractionsQuery(_0x3bcd2a){var _0x4d9b16=utils[_0xca0b('0x1c')](_0x3bcd2a);var _0x5db810=utils[_0xca0b('0x6')](_0x3bcd2a);var _0x5050b7=utils[_0xca0b('0x10')](_0x3bcd2a);return squel[_0xca0b('0xa')]()[_0xca0b('0xe')](_0x4d9b16['interactions'],'i')[_0xca0b('0x16')](_0xca0b('0x1d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xca0b('0x16')](_0xca0b('0x17'),'o',_0xca0b('0x1e'))['left_join'](_0x4d9b16[_0xca0b('0x1f')],'a',_0xca0b('0x20')+_0x5db810)[_0xca0b('0x16')](_0x4d9b16[_0xca0b('0x21')],'me',_0xca0b('0x22')+_0x5050b7+_0xca0b('0x23'))['left_join'](_0x4d9b16[_0xca0b('0x24')],'it',_0xca0b('0x25')+_0x5050b7+_0xca0b('0x23'))['left_join']('tools_tags','t',_0xca0b('0x26'));}function getSqlClauses(){var _0x428459={'body':squel[_0xca0b('0x27')](),'contact':squel[_0xca0b('0x27')](),'default':squel[_0xca0b('0x27')](),'fields':squel['expr'](),'filter':squel[_0xca0b('0x27')](),'read':squel[_0xca0b('0x27')](),'tags':{'clause':squel[_0xca0b('0x27')](),'ids':null},'user':squel[_0xca0b('0x27')]()};return _0x428459;}function parseTagParameter(_0x15478d){var _0x48e172=squel['expr']();if(_0x15478d){var _0x4e0515=utils[_0xca0b('0x28')](_0x15478d);_0x4e0515[_0xca0b('0x29')](function(_0x3fd832){_0x48e172['or'](_0xca0b('0x2a'),'%,'+_0x3fd832+',%');});}return _0x48e172;}function parseReadParameter(_0xe7673b){var _0x515f83='';if(_0xe7673b){_0x515f83=_0xca0b('0x2b');if(_0xe7673b==='1'){_0x515f83=_0x515f83[_0xca0b('0x2c')](_0xca0b('0x2d'),'=');}else{_0x515f83=_0x515f83[_0xca0b('0x2c')](_0xca0b('0x2d'),'>');}}return _0x515f83;}function parseSearchFilter(_0x449a3a,_0xa59ab0){var _0x4a99cb=squel[_0xca0b('0x27')]();if(_0xa59ab0){var _0x17a365=_0xa59ab0[_0xca0b('0x2c')]('\x5c','\x5c\x5c')[_0xca0b('0x2c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x17a365)){_0x4a99cb['or'](_0xca0b('0x2e'),_0x17a365+'%');if([_0xca0b('0x2f'),_0xca0b('0x30')][_0xca0b('0x31')](_0x449a3a)){_0x4a99cb['or'](_0xca0b('0x32'),_0x17a365+'%');}else if(_0x449a3a===_0xca0b('0x33')){_0x4a99cb['or'](_0xca0b('0x34'),_0x17a365+'%');}else if(_0x449a3a===_0xca0b('0x35')){_0x4a99cb['or'](_0xca0b('0x36'),_0x17a365+'%');}}else if(_0x449a3a===_0xca0b('0x37')&&qs[_0xca0b('0x38')](_0x17a365)){_0x4a99cb['or'](_0xca0b('0x39'),_0x17a365+'%');}else{if(_0x449a3a===_0xca0b('0x37')){_0x4a99cb['or'](_0xca0b('0x3a'),qs[_0xca0b('0x3b')](_0x17a365))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xca0b('0x3b')](_0x17a365));}else{if(_0x449a3a!==_0xca0b('0x33')){_0x4a99cb['or'](_0xca0b('0x3c'),qs[_0xca0b('0x3b')](_0x17a365));}_0x4a99cb['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x17a365+'%');}}}return _0x4a99cb;}function parseAdvancedSearchFilter(_0x3d5fef,_0x4657bd){var _0x50d87d=getSqlClauses();var _0x39846e=as[_0xca0b('0x3d')](_0x3d5fef);var _0xe7f5f5=_0x39846e[_0xca0b('0x3e')];for(var _0xe54fbc=0x0;_0xe54fbc<_0x39846e[_0xca0b('0x3f')][_0xca0b('0x19')];_0xe54fbc++){var _0x14acd3=_0x39846e['conditions'][_0xe54fbc];var _0x50642d='i';var _0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0x14acd3[_0xca0b('0xb')]]);if(_0x370db4){var _0x351f5a=as[_0xca0b('0x41')](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d[_0xca0b('0x43')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x46')],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x47')]);}else{switch(_0x14acd3[_0xca0b('0xb')]){case _0xca0b('0x48'):var _0x21b9a9=parseReadParameter(_0x14acd3[_0xca0b('0x45')]);_0x50d87d[_0xca0b('0x49')][_0xca0b('0x4a')](_0x21b9a9);break;case _0xca0b('0x4b'):if(_0x14acd3[_0xca0b('0x4c')]===_0xca0b('0x4d')){if(_0x14acd3[_0xca0b('0x45')][_0xca0b('0x4e')]('\x20')[_0xca0b('0x19')]>0x1){_0x50d87d['contact'][_0xe7f5f5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xca0b('0x3b')](_0x14acd3[_0xca0b('0x45')]),null);}else{var _0x5da705='%'+_0x14acd3['value']+'%';_0x50d87d['contact'][_0xe7f5f5](_0xca0b('0x4f'),_0x5da705,_0x5da705,_0x5da705);}}else{_0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0xca0b('0x50')]);_0x14acd3[_0xca0b('0xb')]='ContactId';_0x351f5a=as['buildExpression'](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d['contact'][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value']['start'],_0x351f5a['value'][_0xca0b('0x47')]);}break;case _0xca0b('0x51'):var _0x460819=_0x14acd3[_0xca0b('0x45')][_0xca0b('0x4e')](',')[_0xca0b('0x1b')](function(_0x54bcb7){return Number(_0x54bcb7);});var _0x8ecb03=parseTagParameter(_0x460819);_0x50d87d[_0xca0b('0x52')][_0xca0b('0x53')][_0xca0b('0x4a')](_0x8ecb03);_0x50d87d[_0xca0b('0x52')]['ids']=_0x460819;break;case'User':if(_0x14acd3[_0xca0b('0x4c')]===_0xca0b('0x4d')){_0x50d87d[_0xca0b('0x54')][_0xe7f5f5](_0xca0b('0x55'),'%'+_0x14acd3['value']+'%',null);}else{_0x370db4=_[_0xca0b('0x40')](_0x4657bd,[_0xca0b('0xc'),_0xca0b('0x56')]);_0x14acd3[_0xca0b('0xb')]='UserId';_0x351f5a=as['buildExpression'](_0x50642d,_0x370db4[_0xca0b('0x42')],_0x14acd3);_0x50d87d[_0xca0b('0x54')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value'][_0xca0b('0x46')],_0x351f5a[_0xca0b('0x45')]['end']);}break;case'body':case'plainBody':_0x351f5a=as[_0xca0b('0x41')]('me',null,_0x14acd3);_0x50d87d[_0xca0b('0x57')][_0xe7f5f5](_0x351f5a[_0xca0b('0x44')],_0x351f5a['value']['start'],_0x351f5a[_0xca0b('0x45')][_0xca0b('0x47')]);break;}}}return _0x50d87d;}function parseModelFields(_0x250288,_0x174e81,_0xeea21f){var _0x32e498=utils['getAccountFK'](_0x250288);var _0x4e81ec=squel['expr']();var _0x456ea1=_(_0x174e81)[_0xca0b('0x58')]()['map'](function(_0xcb9937){return _[_0xca0b('0x59')](_0xeea21f,[_0xca0b('0xc'),_0xcb9937])?_0xcb9937:undefined;})['compact']()[_0xca0b('0x45')]();if(_0x456ea1['length']>0x0){_0x456ea1[_0xca0b('0x29')](function(_0x40f0fe){if(_0x40f0fe===_0x32e498){_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x32e498+_0xca0b('0x5a'),[][_0xca0b('0x5b')](_0x174e81[_0x40f0fe]));}else if(_0x40f0fe===_0xca0b('0x5c')){var _0x1be210=JSON[_0xca0b('0x5d')](_0x174e81[_0x40f0fe])[_0xca0b('0x5e')];var _0x35a678=JSON[_0xca0b('0x5d')](_0x174e81[_0x40f0fe])[_0xca0b('0x5f')];_0x4e81ec[_0xca0b('0x4a')](_0xca0b('0x60'),_0x1be210,_0x35a678);}else{if(_0x174e81[_0x40f0fe]===_0xca0b('0x61')){_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x40f0fe+_0xca0b('0x62'));}else{_0x4e81ec[_0xca0b('0x4a')]('i.'+_0x40f0fe+'\x20=\x20?',_0x174e81[_0x40f0fe]);}}});}return _0x4e81ec;}function parseQueryParameters(_0x27fdbd,_0xbef02e,_0x597cc4){var _0x6b80aa=getSqlClauses();return Promise[_0xca0b('0x63')]()[_0xca0b('0x64')](function(){return parseModelFields(_0x27fdbd,_0xbef02e,_0x597cc4);})[_0xca0b('0x64')](function(_0x36763b){_0x6b80aa[_0xca0b('0x65')][_0xca0b('0x4a')](_0x36763b);return parseReadParameter(_0xbef02e[_0xca0b('0x49')]);})['then'](function(_0x197f17){_0x6b80aa[_0xca0b('0x49')][_0xca0b('0x4a')](_0x197f17);return parseTagParameter(_0xbef02e[_0xca0b('0x66')]);})['then'](function(_0x4e2e13){_0x6b80aa[_0xca0b('0x52')][_0xca0b('0x53')]['and'](_0x4e2e13);return parseSearchFilter(_0x27fdbd,_0xbef02e[_0xca0b('0x67')]);})['then'](function(_0x578bef){_0x6b80aa[_0xca0b('0x67')]=_0x578bef;return _0x6b80aa;});}function checkAccountsRestrictions(_0x3716e8,_0x30e70f,_0x47b3fc){var _0x571d30=utils[_0xca0b('0x6')](_0x3716e8);var _0x5aee92='get'+_[_0xca0b('0x68')](_0x3716e8)+(_0x3716e8==='chat'?_0xca0b('0x69'):_0xca0b('0x6a'));var _0x1426bc=squel['expr']();return Promise[_0xca0b('0x63')]()['then'](function(){if(_0x47b3fc[_0xca0b('0x9')]&&_0x30e70f[_0xca0b('0x7')]===_0xca0b('0x8')){return _0x30e70f[_0x5aee92]({'attributes':['id'],'raw':!![]});}})[_0xca0b('0x64')](function(_0x5cf29b){if(_0x5cf29b){if(_0x5cf29b[_0xca0b('0x19')]===0x0){_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x62'));}else{_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x5a'),_[_0xca0b('0x1b')](_0x5cf29b,'id'));}}else if(!_0x47b3fc[_0x571d30]){_0x1426bc[_0xca0b('0x4a')]('i.'+_0x571d30+_0xca0b('0x6b'));}})[_0xca0b('0x64')](function(){return _0x1426bc;});}function getClosedOrderClause(_0x52ad21,_0x5a7608){var _0x122764='';var _0xdcb0a0=[_0xca0b('0x6c'),_0xca0b('0x6d'),_0xca0b('0x6e')];if(_0x52ad21===_0xca0b('0x37')){_0xdcb0a0['unshift'](_0xca0b('0x6f'));}if(_0x5a7608[_0xca0b('0x70')]==='0'&&_0x52ad21===_0xca0b('0x37')){_0x122764='i.substatus';}else{if(_0x5a7608[_0xca0b('0x70')]==='1'){_0xdcb0a0[_0xca0b('0x71')]();}_0x122764=_0xca0b('0x72')+_0xdcb0a0[_0xca0b('0x73')](',\x20')+')';}return _0x122764;}function getFilteredInteractions(_0x7e1c9f,_0x395c99,_0x39c71e,_0x1f123b){var _0x4bf574=utils['getInteractionFK'](_0x7e1c9f);var _0x5cc68e=_['capitalize'](_0x7e1c9f)+'Interaction';var _0x412d78=[];var _0x294e6c=getTagsQuery();var _0x1d07a2={'type':db[_0xca0b('0x74')][_0xca0b('0x75')][_0xca0b('0x76')],'raw':!![]};var _0x28a14b=[];var _0x67c743=[];return db[_0xca0b('0x77')][_0xca0b('0x78')](_0x294e6c['toString'](),_0x1d07a2)[_0xca0b('0x64')](function(_0x5f31c6){_0x412d78=_[_0xca0b('0x79')](_0x5f31c6,'id');_0x1d07a2=_['merge'](_0x1d07a2,{'model':db[_0x5cc68e],'mapToModel':!![],'nest':!![]});if(_0x39c71e[_0xca0b('0x65')]){_0x1f123b[_0xca0b('0x7a')]['forEach'](function(_0x57bdb3){_0x395c99[_0xca0b('0xb')]('i.'+_0x57bdb3);});}else{_0x395c99[_0xca0b('0xb')](_0xca0b('0x7b'),'unreadMessages');_0x395c99[_0xca0b('0xb')](_0xca0b('0x7c'),_0xca0b('0x7d'));_0x395c99[_0xca0b('0xb')]('a.mandatoryDisposition',_0xca0b('0x7e'));if(_0x7e1c9f==='mail'){_0x395c99[_0xca0b('0xb')]('a.email',_0xca0b('0x7f'));_0x395c99[_0xca0b('0xb')]('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',_0xca0b('0x80'));_0x395c99[_0xca0b('0xb')]('i.id');_0x395c99[_0xca0b('0xb')](_0xca0b('0x81'));_0x395c99[_0xca0b('0xb')]('i.updatedAt');_0x395c99[_0xca0b('0xb')](_0xca0b('0x82'));_0x395c99[_0xca0b('0xb')]('i.closedAt');_0x395c99[_0xca0b('0xb')](_0xca0b('0x83'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x84'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x85'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x86'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6e'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6d'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x6c'));_0x395c99[_0xca0b('0xb')]('i.substatus');_0x395c99[_0xca0b('0xb')](_0xca0b('0x87'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x88'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x89'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x8a'));}else if(_0x7e1c9f==='openchannel'){_0x395c99[_0xca0b('0xb')](_0xca0b('0x8b'),_0xca0b('0x80'));}else{_0x395c99[_0xca0b('0xb')](_0xca0b('0x8c'),_0xca0b('0x80'));}if(_0x7e1c9f!=='mail'){_0x395c99[_0xca0b('0xb')](_0xca0b('0x8d'));}_0x395c99[_0xca0b('0xb')](_0xca0b('0x8e'),_0xca0b('0x8f'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x90'),_0xca0b('0x91'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x92'),_0xca0b('0x93'));_0x395c99[_0xca0b('0xb')]('c.phone',_0xca0b('0x94'));_0x395c99['field'](_0xca0b('0x95'),_0xca0b('0x96'));_0x395c99['field'](_0xca0b('0x97'),_0xca0b('0x98'));_0x395c99['field']('o.fullname',_0xca0b('0x99'));_0x395c99[_0xca0b('0xb')](_0xca0b('0x9a'),'Owner.internal');_0x395c99[_0xca0b('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xca0b('0x9b'));}if(_0x1f123b['limit']){_0x395c99[_0xca0b('0x9c')](_0x1f123b[_0xca0b('0x9c')]);}if(_0x1f123b[_0xca0b('0x9d')]){_0x395c99['offset'](_0x1f123b['offset']);}return db['sequelize'][_0xca0b('0x78')](_0x395c99[_0xca0b('0x9e')](),_0x1d07a2);})[_0xca0b('0x64')](function(_0x3cd7d6){_0x28a14b=_0x3cd7d6;var _0x23d2b1=getUsersQuery(_0x7e1c9f,_0x28a14b);return db[_0xca0b('0x77')][_0xca0b('0x78')](_0x23d2b1['toString'](),_0x1d07a2);})['then'](function(_0x283628){_0x67c743=_[_0xca0b('0x9f')](_0x283628,_0x4bf574);if(_0x7e1c9f===_0xca0b('0x37')){return db[_0xca0b('0xa0')][_0xca0b('0xa1')]({'attributes':[_0xca0b('0xa2')],'raw':!![]});}})[_0xca0b('0x64')](function(_0x2d857f){var _0x9b78b=_0x2d857f?_0x2d857f[_0xca0b('0xa2')]:undefined;var _0x4b9764=_0x28a14b['map'](function(_0x5a453b){return updateInteraction(_0x5a453b,_0x412d78,_0x67c743,_0x9b78b);});return Promise[_0xca0b('0xa3')](_0x4b9764);});}function countFilteredInteractions(_0x2cee7e,_0x144cc1){var _0x50e10a=_0x2cee7e['clone']();_0x50e10a[_0xca0b('0xb')](_0xca0b('0xa4'));_0x50e10a[_0xca0b('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xca0b('0x48'));var _0x3ff232=utils['getSelectedTags'](_0x144cc1);if(!_[_0xca0b('0xa5')](_0x3ff232)){_0x50e10a[_0xca0b('0x1a')](_0xca0b('0xa6'),_0x3ff232);}var _0x26e684={'type':db['Sequelize'][_0xca0b('0x75')][_0xca0b('0x76')],'raw':!![]};return db[_0xca0b('0x77')]['query'](_0x50e10a[_0xca0b('0x9e')](),_0x26e684);}module[_0xca0b('0xa7')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x867f=['i.thirdDisposition','i.secondDisposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','getInteractionFK','Interaction','Sequelize','SELECT','query','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.closed','i.attach','i.lastMsgDirection','i.disposition','i.to','i.ContactId','i.MailAccountId','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','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','enableEmailPreview','clone','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','field','name','color','from','tools_tags','select','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','fax','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','end','read','and','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','split','tags','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','some','compact','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','clause','filter','capitalize','chat','Websites','Accounts','search'];(function(_0x1c4b26,_0x3e3d84){var _0x2a19f9=function(_0x1bc096){while(--_0x1bc096){_0x1c4b26['push'](_0x1c4b26['shift']());}};_0x2a19f9(++_0x3e3d84);}(_0x867f,0xe6));var _0xf867=function(_0x50a732,_0x1eab82){_0x50a732=_0x50a732-0x0;var _0x2047a1=_0x867f[_0x50a732];return _0x2047a1;};'use strict';var _=require(_0xf867('0x0'));var squel=require(_0xf867('0x1'));var as=require(_0xf867('0x2'));var qs=require(_0xf867('0x3'));var updateInteraction=require(_0xf867('0x4'))[_0xf867('0x5')];var utils=require(_0xf867('0x6'));var db=require(_0xf867('0x7'))['db'];function skipInteractionsQuery(_0x333d91,_0x57ce95,_0x5456c9){var _0x31de37=![];var _0x2e0691=utils[_0xf867('0x8')](_0x333d91);if(_0x57ce95[_0xf867('0x9')]===_0xf867('0xa')&&!_0x5456c9['search']&&!_0x5456c9[_0x2e0691]){_0x31de37=!![];}return _0x31de37;}function getTagsQuery(){return squel['select']()[_0xf867('0xb')]('id')['field'](_0xf867('0xc'))[_0xf867('0xb')](_0xf867('0xd'))[_0xf867('0xe')](_0xf867('0xf'));}function getUsersQuery(_0x462870,_0x43eeb2){var _0x3c9a3f=utils['getInteractionFK'](_0x462870);var _0x2ff341='user_has_'+_0x462870+'_interactions';var _0x1711b0=squel[_0xf867('0x10')]()[_0xf867('0xb')]('u.id')['field'](_0xf867('0x11'))['field'](_0xf867('0x12')+_0x3c9a3f)['from'](_0x2ff341,'ui')['left_join'](_0xf867('0x13'),'u',_0xf867('0x14'));if(_0x43eeb2[_0xf867('0x15')]>0x0){_0x1711b0[_0xf867('0x16')](_0xf867('0x12')+_0x3c9a3f+_0xf867('0x17'),_[_0xf867('0x18')](_0x43eeb2,'id'));}return _0x1711b0;}function getInteractionsQuery(_0x3e8442){var _0x33c10b=utils['getInteractionsTables'](_0x3e8442);var _0x44f6f1=utils['getAccountFK'](_0x3e8442);var _0x39f9e8=utils['getInteractionFK'](_0x3e8442);return squel['select']()[_0xf867('0xe')](_0x33c10b['interactions'],'i')['left_join'](_0xf867('0x19'),'c',_0xf867('0x1a'))['left_join']('users','o',_0xf867('0x1b'))[_0xf867('0x1c')](_0x33c10b[_0xf867('0x1d')],'a',_0xf867('0x1e')+_0x44f6f1)[_0xf867('0x1c')](_0x33c10b[_0xf867('0x1f')],'me',_0xf867('0x20')+_0x39f9e8+_0xf867('0x21'))['left_join'](_0x33c10b['interactionsTags'],'it',_0xf867('0x22')+_0x39f9e8+'\x20=\x20i.id')[_0xf867('0x1c')](_0xf867('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x419b6f={'body':squel[_0xf867('0x23')](),'contact':squel['expr'](),'default':squel[_0xf867('0x23')](),'fields':squel[_0xf867('0x23')](),'filter':squel[_0xf867('0x23')](),'read':squel[_0xf867('0x23')](),'tags':{'clause':squel[_0xf867('0x23')](),'ids':null},'user':squel[_0xf867('0x23')]()};return _0x419b6f;}function parseTagParameter(_0x67e3a){var _0x2efca3=squel[_0xf867('0x23')]();if(_0x67e3a){var _0x2ce256=utils[_0xf867('0x24')](_0x67e3a);_0x2ce256[_0xf867('0x25')](function(_0xa40271){_0x2efca3['or'](_0xf867('0x26'),'%,'+_0xa40271+',%');});}return _0x2efca3;}function parseReadParameter(_0x327a13){var _0x3ed616='';if(_0x327a13){_0x3ed616='unreadMessages\x20{OPERATOR}\x200';if(_0x327a13==='1'){_0x3ed616=_0x3ed616[_0xf867('0x27')](_0xf867('0x28'),'=');}else{_0x3ed616=_0x3ed616[_0xf867('0x27')](_0xf867('0x28'),'>');}}return _0x3ed616;}function parseSearchFilter(_0x350d6d,_0x2678c9){var _0x1979c5=squel['expr']();if(_0x2678c9){var _0x44ddd4=_0x2678c9[_0xf867('0x27')]('\x5c','\x5c\x5c')[_0xf867('0x27')](/'/g,'\x27\x27');if(qs[_0xf867('0x29')](_0x44ddd4)){_0x1979c5['or'](_0xf867('0x2a'),_0x44ddd4+'%');if([_0xf867('0x2b'),_0xf867('0x2c')][_0xf867('0x2d')](_0x350d6d)){_0x1979c5['or']('i.phone\x20LIKE\x20?',_0x44ddd4+'%');}else if(_0x350d6d===_0xf867('0x2e')){_0x1979c5['or']('i.fax\x20LIKE\x20?',_0x44ddd4+'%');}else if(_0x350d6d===_0xf867('0x2f')){_0x1979c5['or']('i.from\x20LIKE\x20?',_0x44ddd4+'%');}}else if(_0x350d6d===_0xf867('0x30')&&qs[_0xf867('0x31')](_0x44ddd4)){_0x1979c5['or'](_0xf867('0x32'),_0x44ddd4+'%');}else{if(_0x350d6d==='mail'){_0x1979c5['or'](_0xf867('0x33'),qs[_0xf867('0x34')](_0x44ddd4))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x44ddd4));}else{if(_0x350d6d!==_0xf867('0x2e')){_0x1979c5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf867('0x34')](_0x44ddd4));}_0x1979c5['or'](_0xf867('0x35'),_0x44ddd4+'%');}}}return _0x1979c5;}function parseAdvancedSearchFilter(_0x419de3,_0x36540a){var _0x5ba0af=getSqlClauses();var _0x52a22f=as[_0xf867('0x36')](_0x419de3);var _0x1de91a=_0x52a22f[_0xf867('0x37')];for(var _0x50fb7d=0x0;_0x50fb7d<_0x52a22f[_0xf867('0x38')][_0xf867('0x15')];_0x50fb7d++){var _0x59ca8f=_0x52a22f[_0xf867('0x38')][_0x50fb7d];var _0x5e9234='i';var _0x349389=_[_0xf867('0x39')](_0x36540a,[_0xf867('0xc'),_0x59ca8f['field']]);if(_0x349389){var _0x17e99a=as['buildExpression'](_0x5e9234,_0x349389[_0xf867('0x3a')],_0x59ca8f);_0x5ba0af[_0xf867('0x3b')][_0x1de91a](_0x17e99a[_0xf867('0x3c')],_0x17e99a[_0xf867('0x3d')][_0xf867('0x3e')],_0x17e99a[_0xf867('0x3d')][_0xf867('0x3f')]);}else{switch(_0x59ca8f[_0xf867('0xb')]){case'unreadMessages':var _0x47880e=parseReadParameter(_0x59ca8f[_0xf867('0x3d')]);_0x5ba0af[_0xf867('0x40')][_0xf867('0x41')](_0x47880e);break;case _0xf867('0x42'):if(_0x59ca8f[_0xf867('0x43')]===_0xf867('0x44')){if(_0x59ca8f[_0xf867('0x3d')]['split']('\x20')[_0xf867('0x15')]>0x1){_0x5ba0af[_0xf867('0x45')][_0x1de91a](_0xf867('0x46'),qs[_0xf867('0x34')](_0x59ca8f[_0xf867('0x3d')]),null);}else{var _0x3e35d2='%'+_0x59ca8f[_0xf867('0x3d')]+'%';_0x5ba0af[_0xf867('0x45')][_0x1de91a](_0xf867('0x47'),_0x3e35d2,_0x3e35d2,_0x3e35d2);}}else{_0x349389=_['find'](_0x36540a,[_0xf867('0xc'),'ContactId']);_0x59ca8f[_0xf867('0xb')]=_0xf867('0x48');_0x17e99a=as[_0xf867('0x49')](_0x5e9234,_0x349389['type'],_0x59ca8f);_0x5ba0af[_0xf867('0x45')][_0x1de91a](_0x17e99a[_0xf867('0x3c')],_0x17e99a[_0xf867('0x3d')][_0xf867('0x3e')],_0x17e99a[_0xf867('0x3d')][_0xf867('0x3f')]);}break;case'Tag':var _0x421e12=_0x59ca8f[_0xf867('0x3d')][_0xf867('0x4a')](',')[_0xf867('0x18')](function(_0x3b8929){return Number(_0x3b8929);});var _0x5165bb=parseTagParameter(_0x421e12);_0x5ba0af[_0xf867('0x4b')]['clause'][_0xf867('0x41')](_0x5165bb);_0x5ba0af[_0xf867('0x4b')]['ids']=_0x421e12;break;case _0xf867('0x4c'):if(_0x59ca8f[_0xf867('0x43')]===_0xf867('0x44')){_0x5ba0af[_0xf867('0x4d')][_0x1de91a](_0xf867('0x4e'),'%'+_0x59ca8f[_0xf867('0x3d')]+'%',null);}else{_0x349389=_['find'](_0x36540a,[_0xf867('0xc'),'UserId']);_0x59ca8f[_0xf867('0xb')]=_0xf867('0x4f');_0x17e99a=as[_0xf867('0x49')](_0x5e9234,_0x349389[_0xf867('0x3a')],_0x59ca8f);_0x5ba0af[_0xf867('0x4d')][_0x1de91a](_0x17e99a[_0xf867('0x3c')],_0x17e99a[_0xf867('0x3d')]['start'],_0x17e99a['value'][_0xf867('0x3f')]);}break;case _0xf867('0x50'):case _0xf867('0x51'):_0x17e99a=as['buildExpression']('me',null,_0x59ca8f);_0x5ba0af[_0xf867('0x50')][_0x1de91a](_0x17e99a[_0xf867('0x3c')],_0x17e99a[_0xf867('0x3d')]['start'],_0x17e99a[_0xf867('0x3d')]['end']);break;}}}return _0x5ba0af;}function parseModelFields(_0xc01c03,_0x2d56c0,_0x290e22){var _0x35a94a=utils[_0xf867('0x8')](_0xc01c03);var _0x210ee1=squel[_0xf867('0x23')]();var _0x1b6253=_(_0x2d56c0)['keys']()['map'](function(_0x1c1c90){return _[_0xf867('0x52')](_0x290e22,[_0xf867('0xc'),_0x1c1c90])?_0x1c1c90:undefined;})[_0xf867('0x53')]()[_0xf867('0x3d')]();if(_0x1b6253[_0xf867('0x15')]>0x0){_0x1b6253[_0xf867('0x25')](function(_0x4ba9af){if(_0x4ba9af===_0x35a94a){_0x210ee1[_0xf867('0x41')]('i.'+_0x35a94a+_0xf867('0x17'),[][_0xf867('0x54')](_0x2d56c0[_0x4ba9af]));}else if(_0x4ba9af===_0xf867('0x55')){var _0x52d4bf=JSON[_0xf867('0x56')](_0x2d56c0[_0x4ba9af])[_0xf867('0x57')];var _0x5b8a1d=JSON['parse'](_0x2d56c0[_0x4ba9af])['$lte'];_0x210ee1[_0xf867('0x41')](_0xf867('0x58'),_0x52d4bf,_0x5b8a1d);}else{if(_0x2d56c0[_0x4ba9af]==='null'){_0x210ee1[_0xf867('0x41')]('i.'+_0x4ba9af+_0xf867('0x59'));}else{_0x210ee1['and']('i.'+_0x4ba9af+_0xf867('0x5a'),_0x2d56c0[_0x4ba9af]);}}});}return _0x210ee1;}function parseQueryParameters(_0x3041cf,_0x59d460,_0x694574){var _0x3e9ad0=getSqlClauses();return Promise[_0xf867('0x5b')]()[_0xf867('0x5c')](function(){return parseModelFields(_0x3041cf,_0x59d460,_0x694574);})[_0xf867('0x5c')](function(_0x5cdd1b){_0x3e9ad0['fields'][_0xf867('0x41')](_0x5cdd1b);return parseReadParameter(_0x59d460[_0xf867('0x40')]);})[_0xf867('0x5c')](function(_0x626097){_0x3e9ad0[_0xf867('0x40')][_0xf867('0x41')](_0x626097);return parseTagParameter(_0x59d460['tag']);})[_0xf867('0x5c')](function(_0x4220e8){_0x3e9ad0[_0xf867('0x4b')][_0xf867('0x5d')][_0xf867('0x41')](_0x4220e8);return parseSearchFilter(_0x3041cf,_0x59d460[_0xf867('0x5e')]);})[_0xf867('0x5c')](function(_0x2e5e49){_0x3e9ad0[_0xf867('0x5e')]=_0x2e5e49;return _0x3e9ad0;});}function checkAccountsRestrictions(_0x466582,_0xe60950,_0x591267){var _0x2f27ca=utils[_0xf867('0x8')](_0x466582);var _0x33ae40='get'+_[_0xf867('0x5f')](_0x466582)+(_0x466582===_0xf867('0x60')?_0xf867('0x61'):_0xf867('0x62'));var _0x550622=squel['expr']();return Promise[_0xf867('0x5b')]()[_0xf867('0x5c')](function(){if(_0x591267[_0xf867('0x63')]&&_0xe60950[_0xf867('0x9')]==='agent'){return _0xe60950[_0x33ae40]({'attributes':['id'],'raw':!![]});}})[_0xf867('0x5c')](function(_0x526027){if(_0x526027){if(_0x526027[_0xf867('0x15')]===0x0){_0x550622[_0xf867('0x41')]('i.'+_0x2f27ca+_0xf867('0x59'));}else{_0x550622['and']('i.'+_0x2f27ca+_0xf867('0x17'),_[_0xf867('0x18')](_0x526027,'id'));}}else if(!_0x591267[_0x2f27ca]){_0x550622['and']('i.'+_0x2f27ca+'\x20IS\x20NOT\x20NULL');}})[_0xf867('0x5c')](function(){return _0x550622;});}function getClosedOrderClause(_0x447d75,_0x449848){var _0x30fe40='';var _0x386e8a=[_0xf867('0x64'),_0xf867('0x65'),'i.disposition'];if(_0x447d75===_0xf867('0x30')){_0x386e8a[_0xf867('0x66')](_0xf867('0x67'));}if(_0x449848[_0xf867('0x68')]==='0'&&_0x447d75===_0xf867('0x30')){_0x30fe40=_0xf867('0x67');}else{if(_0x449848[_0xf867('0x68')]==='1'){_0x386e8a[_0xf867('0x69')]();}_0x30fe40=_0xf867('0x6a')+_0x386e8a[_0xf867('0x6b')](',\x20')+')';}return _0x30fe40;}function getFilteredInteractions(_0x200f47,_0x191884,_0x2164be,_0x485b20){var _0x34c45c=utils[_0xf867('0x6c')](_0x200f47);var _0x496fa5=_[_0xf867('0x5f')](_0x200f47)+_0xf867('0x6d');var _0x3b696b=[];var _0x5ac100=getTagsQuery();var _0x2bd5c5={'type':db[_0xf867('0x6e')]['QueryTypes'][_0xf867('0x6f')],'raw':!![]};var _0xc663ba=[];var _0x60d795=[];return db['sequelize'][_0xf867('0x70')](_0x5ac100[_0xf867('0x71')](),_0x2bd5c5)[_0xf867('0x5c')](function(_0x189484){_0x3b696b=_[_0xf867('0x72')](_0x189484,'id');_0x2bd5c5=_['merge'](_0x2bd5c5,{'model':db[_0x496fa5],'mapToModel':!![],'nest':!![]});if(_0x2164be[_0xf867('0x73')]){_0x485b20['attributes']['forEach'](function(_0x2e7683){_0x191884[_0xf867('0xb')]('i.'+_0x2e7683);});}else{_0x191884[_0xf867('0xb')](_0xf867('0x74'),_0xf867('0x75'));_0x191884[_0xf867('0xb')](_0xf867('0x76'),_0xf867('0x77'));_0x191884[_0xf867('0xb')](_0xf867('0x78'),_0xf867('0x79'));if(_0x200f47==='mail'){_0x191884[_0xf867('0xb')](_0xf867('0x7a'),_0xf867('0x7b'));_0x191884[_0xf867('0xb')]('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',_0xf867('0x7c'));_0x191884['field'](_0xf867('0x7d'));_0x191884['field']('i.createdAt');_0x191884[_0xf867('0xb')]('i.updatedAt');_0x191884['field'](_0xf867('0x7e'));_0x191884[_0xf867('0xb')]('i.closedAt');_0x191884['field'](_0xf867('0x7f'));_0x191884[_0xf867('0xb')]('i.lastMsgAt');_0x191884[_0xf867('0xb')](_0xf867('0x80'));_0x191884[_0xf867('0xb')]('i.subject');_0x191884[_0xf867('0xb')](_0xf867('0x81'));_0x191884['field']('i.secondDisposition');_0x191884['field'](_0xf867('0x64'));_0x191884[_0xf867('0xb')](_0xf867('0x67'));_0x191884['field'](_0xf867('0x82'));_0x191884['field'](_0xf867('0x83'));_0x191884[_0xf867('0xb')](_0xf867('0x84'));_0x191884['field'](_0xf867('0x85'));}else if(_0x200f47===_0xf867('0x2f')){_0x191884[_0xf867('0xb')](_0xf867('0x86'),_0xf867('0x7c'));}else{_0x191884['field'](_0xf867('0x87'),_0xf867('0x7c'));}if(_0x200f47!==_0xf867('0x30')){_0x191884[_0xf867('0xb')](_0xf867('0x88'));}_0x191884['field'](_0xf867('0x89'),_0xf867('0x8a'));_0x191884['field'](_0xf867('0x8b'),_0xf867('0x8c'));_0x191884['field'](_0xf867('0x8d'),_0xf867('0x8e'));_0x191884[_0xf867('0xb')](_0xf867('0x8f'),_0xf867('0x90'));_0x191884[_0xf867('0xb')](_0xf867('0x91'),_0xf867('0x92'));_0x191884['field'](_0xf867('0x93'),_0xf867('0x94'));_0x191884['field'](_0xf867('0x95'),_0xf867('0x96'));_0x191884[_0xf867('0xb')](_0xf867('0x97'),_0xf867('0x98'));_0x191884[_0xf867('0xb')](_0xf867('0x99'),_0xf867('0x9a'));}if(_0x485b20[_0xf867('0x9b')]){_0x191884[_0xf867('0x9b')](_0x485b20['limit']);}if(_0x485b20['offset']){_0x191884[_0xf867('0x9c')](_0x485b20[_0xf867('0x9c')]);}return db[_0xf867('0x9d')][_0xf867('0x70')](_0x191884[_0xf867('0x71')](),_0x2bd5c5);})[_0xf867('0x5c')](function(_0x4b8d0e){_0xc663ba=_0x4b8d0e;var _0x53be63=getUsersQuery(_0x200f47,_0xc663ba);return db[_0xf867('0x9d')][_0xf867('0x70')](_0x53be63[_0xf867('0x71')](),_0x2bd5c5);})['then'](function(_0x535847){_0x60d795=_[_0xf867('0x9e')](_0x535847,_0x34c45c);if(_0x200f47===_0xf867('0x30')){return db['Setting']['findOne']({'attributes':[_0xf867('0x9f')],'raw':!![]});}})[_0xf867('0x5c')](function(_0x29865d){var _0x477667=_0x29865d?_0x29865d[_0xf867('0x9f')]:undefined;var _0x187b69=_0xc663ba['map'](function(_0x4b628e){return updateInteraction(_0x4b628e,_0x3b696b,_0x60d795,_0x477667);});return Promise['all'](_0x187b69);});}function countFilteredInteractions(_0x2fde83,_0x5d4ca5){var _0x51b226=_0x2fde83[_0xf867('0xa0')]();_0x51b226[_0xf867('0xb')]('COUNT(*)');_0x51b226[_0xf867('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf867('0x75'));var _0x22bf2e=utils[_0xf867('0x24')](_0x5d4ca5);if(!_[_0xf867('0xa1')](_0x22bf2e)){_0x51b226[_0xf867('0x16')](_0xf867('0xa2'),_0x22bf2e);}var _0x3b01e3={'type':db[_0xf867('0x6e')][_0xf867('0xa3')][_0xf867('0x6f')],'raw':!![]};return db['sequelize'][_0xf867('0x70')](_0x51b226[_0xf867('0x71')](),_0x3b01e3);}module[_0xf867('0xa4')]={'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 dad408a..0ad5e18 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 _0x095a=['forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Tags','TagIds','lodash','fullname','split'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0x095a,0x75));var _0xa095=function(_0x5cbb5f,_0x302e6a){_0x5cbb5f=_0x5cbb5f-0x0;var _0x47853c=_0x095a[_0x5cbb5f];return _0x47853c;};'use strict';var _=require(_0xa095('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x325f3f,_0x4c51b4){return new Promise(function(_0x4cc678,_0x62e85f){try{var _0xa599ba=[];if(_0x4c51b4[_0x325f3f]){_0xa599ba=_0x4c51b4[_0x325f3f]['map'](function(_0x4fe2e7){return{'id':_0x4fe2e7['id'],'fullname':_0x4fe2e7[_0xa095('0x1')]};});}return _0x4cc678(_0xa599ba);}catch(_0x2cbfae){_0x62e85f(_0x2cbfae);}});}function getInteractionTags(_0x17a8ad,_0xb55638){var _0x168607=[];if(_0x17a8ad){_0x17a8ad[_0xa095('0x2')](',')[_0xa095('0x3')](function(_0x1f7107){_0x168607[_0xa095('0x4')](_0xb55638[_0x1f7107]);});}return _0x168607;}function updateWaitingCounter(_0x1ccb93){if(_0x1ccb93[_0xa095('0x5')]){_0x1ccb93['waiting']-=0x1;}}function updateInteractionCounters(_0x3c9494){_0x3c9494[_0xa095('0x5')]=0x0;_0x3c9494[_0xa095('0x6')]=0x0;_0x3c9494[_0xa095('0x7')]=0x0;_0x3c9494[_0xa095('0x8')]=0x0;_0x3c9494[_0xa095('0x9')]=0x0;_0x3c9494[_0xa095('0xa')]=0x0;if(_0x3c9494[_0xa095('0xb')]){if(_0x3c9494[_0xa095('0xc')]==='abandoned'){_0x3c9494[_0xa095('0x9')]+=0x1;updateWaitingCounter(_0x3c9494);}if(_0x3c9494['UserId']){_0x3c9494[_0xa095('0x7')]+=0x1;if(_0x3c9494[_0xa095('0x6')]){_0x3c9494[_0xa095('0x6')]-=0x1;}}else{if(_0x3c9494['disposition']){_0x3c9494[_0xa095('0x8')]+=0x1;updateWaitingCounter(_0x3c9494);}}}else{if(!_0x3c9494[_0xa095('0xd')]){_0x3c9494[_0xa095('0x5')]+=0x1;}if(_0x3c9494['UserId']){_0x3c9494[_0xa095('0x6')]+=0x1;updateWaitingCounter(_0x3c9494);}}_0x3c9494[_0xa095('0xa')]+=0x1;return _0x3c9494;}function getLastMessageText(_0x3309f1){return db['MailMessage'][_0xa095('0xe')]({'where':{'$and':[{'MailInteractionId':_0x3309f1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xa095('0xf')],'order':_0xa095('0x10'),'raw':!![]})[_0xa095('0x11')](function(_0x57e927){if(_0x57e927&&_0x57e927['plainBody']){_0x3309f1[_0xa095('0x12')]=_[_0xa095('0x13')](_0x57e927[_0xa095('0xf')]);}return _0x3309f1;})[_0xa095('0x14')](function(_0x341614){throw _0x341614;});}exports[_0xa095('0x15')]=function(_0x5d5b64,_0x48eb44,_0x176e8f,_0x1bd28a){return new Promise(function(_0x172899,_0x371db8){return getInteractionUsers(_0x5d5b64['id'],_0x176e8f)[_0xa095('0x11')](function(_0x578586){_0x5d5b64['Users']=_0x578586;return getInteractionTags(_0x5d5b64['TagIds'],_0x48eb44);})[_0xa095('0x11')](function(_0x644153){_0x5d5b64[_0xa095('0x16')]=_0x644153;delete _0x5d5b64[_0xa095('0x17')];return updateInteractionCounters(_0x5d5b64);})['then'](function(_0x447565){if(_0x1bd28a){return getLastMessageText(_0x447565);}else{return _0x447565;}})[_0xa095('0x11')](function(_0x26bf08){_0x172899(_0x26bf08);})[_0xa095('0x14')](function(_0x5c011f){_0x371db8(_0x5c011f);});});}; \ No newline at end of file +var _0xd22e=['answered','abandoned','total','closed','disposition','UserId','unmanaged','MailMessage','out','plainBody','-id','then','trimStart','catch','Users','TagIds','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking'];(function(_0xfc71ad,_0x4e0e20){var _0x90f587=function(_0x4fd89b){while(--_0x4fd89b){_0xfc71ad['push'](_0xfc71ad['shift']());}};_0x90f587(++_0x4e0e20);}(_0xd22e,0xa0));var _0xed22=function(_0x3de5a1,_0x4dd204){_0x3de5a1=_0x3de5a1-0x0;var _0x280b66=_0xd22e[_0x3de5a1];return _0x280b66;};'use strict';var _=require(_0xed22('0x0'));var db=require(_0xed22('0x1'))['db'];function getInteractionUsers(_0x17a622,_0x4b309f){return new Promise(function(_0x1e8ddd,_0x6e3268){try{var _0x48ab5f=[];if(_0x4b309f[_0x17a622]){_0x48ab5f=_0x4b309f[_0x17a622][_0xed22('0x2')](function(_0x8c22ee){return{'id':_0x8c22ee['id'],'fullname':_0x8c22ee[_0xed22('0x3')]};});}return _0x1e8ddd(_0x48ab5f);}catch(_0x4b2051){_0x6e3268(_0x4b2051);}});}function getInteractionTags(_0x34cec7,_0x5214c9){var _0x226596=[];if(_0x34cec7){_0x34cec7[_0xed22('0x4')](',')[_0xed22('0x5')](function(_0x380cb7){_0x226596['push'](_0x5214c9[_0x380cb7]);});}return _0x226596;}function updateWaitingCounter(_0x1b14f0){if(_0x1b14f0[_0xed22('0x6')]){_0x1b14f0[_0xed22('0x6')]-=0x1;}}function updateInteractionCounters(_0x3ace72){_0x3ace72['waiting']=0x0;_0x3ace72[_0xed22('0x7')]=0x0;_0x3ace72[_0xed22('0x8')]=0x0;_0x3ace72['unmanaged']=0x0;_0x3ace72[_0xed22('0x9')]=0x0;_0x3ace72[_0xed22('0xa')]=0x0;if(_0x3ace72[_0xed22('0xb')]){if(_0x3ace72[_0xed22('0xc')]===_0xed22('0x9')){_0x3ace72[_0xed22('0x9')]+=0x1;updateWaitingCounter(_0x3ace72);}if(_0x3ace72[_0xed22('0xd')]){_0x3ace72['answered']+=0x1;if(_0x3ace72['talking']){_0x3ace72['talking']-=0x1;}}else{if(_0x3ace72[_0xed22('0xc')]){_0x3ace72[_0xed22('0xe')]+=0x1;updateWaitingCounter(_0x3ace72);}}}else{if(!_0x3ace72[_0xed22('0xd')]){_0x3ace72[_0xed22('0x6')]+=0x1;}if(_0x3ace72[_0xed22('0xd')]){_0x3ace72[_0xed22('0x7')]+=0x1;updateWaitingCounter(_0x3ace72);}}_0x3ace72['total']+=0x1;return _0x3ace72;}function getLastMessageText(_0x4688c8){return db[_0xed22('0xf')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x4688c8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xed22('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xed22('0x11')],'order':_0xed22('0x12'),'raw':!![]})[_0xed22('0x13')](function(_0x3cd4e1){if(_0x3cd4e1&&_0x3cd4e1[_0xed22('0x11')]){_0x4688c8['lastMsgText']=_[_0xed22('0x14')](_0x3cd4e1[_0xed22('0x11')]);}return _0x4688c8;})[_0xed22('0x15')](function(_0x316f8b){throw _0x316f8b;});}exports['updateInteraction']=function(_0x3746ae,_0x1f5739,_0x1cc7d8,_0x5f25dd){return new Promise(function(_0x2e1b0c,_0x4fa602){return getInteractionUsers(_0x3746ae['id'],_0x1cc7d8)[_0xed22('0x13')](function(_0x30c723){_0x3746ae[_0xed22('0x16')]=_0x30c723;return getInteractionTags(_0x3746ae[_0xed22('0x17')],_0x1f5739);})[_0xed22('0x13')](function(_0xfa5e15){_0x3746ae['Tags']=_0xfa5e15;delete _0x3746ae[_0xed22('0x17')];return updateInteractionCounters(_0x3746ae);})[_0xed22('0x13')](function(_0x460a21){if(_0x5f25dd){return getLastMessageText(_0x460a21);}else{return _0x460a21;}})['then'](function(_0x1e142a){_0x2e1b0c(_0x1e142a);})[_0xed22('0x15')](function(_0x1bae19){_0x4fa602(_0x1bae19);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index bdd7bc4..bcf7241 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 _0x0b8c=['_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','Interaction','findOne','then','info','error','exports','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','InteractionId','upperFirst'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x0b8c,0x1a5));var _0xc0b8=function(_0x5616b0,_0x14ac3b){_0x5616b0=_0x5616b0-0x0;var _0x502d8b=_0x0b8c[_0x5616b0];return _0x502d8b;};'use strict';var _=require('lodash');var db=require(_0xc0b8('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xc0b8('0x1')),'mail':require(_0xc0b8('0x2'))(_0xc0b8('0x3')),'fax':require(_0xc0b8('0x2'))(_0xc0b8('0x4')),'sms':require(_0xc0b8('0x2'))(_0xc0b8('0x5')),'chat':require(_0xc0b8('0x2'))(_0xc0b8('0x6')),'whatsapp':require(_0xc0b8('0x2'))('whatsapp-interactions')};function getAccountFK(_0x2bcfc9){return _[_0xc0b8('0x7')](_0x2bcfc9)+(_0x2bcfc9===_0xc0b8('0x8')?'Website':'Account')+'Id';}function getInteractionFK(_0x37e695){return _['capitalize'](_0x37e695)+_0xc0b8('0x9');}function getInteractionId(_0x51d0f4,_0x1c4b92,_0x35663b){if(_0x51d0f4&&_0x51d0f4[_['upperFirst'](_0x35663b)+_0xc0b8('0x9')]){return _0x51d0f4[_[_0xc0b8('0xa')](_0x35663b)+_0xc0b8('0x9')];}else if(_0x51d0f4&&_0x51d0f4['id']){return _0x51d0f4['id'];}else if(_0x1c4b92&&_0x1c4b92['id']){return _0x1c4b92['id'];}else{return'unknown';}}function getInteractionsTables(_0x443c64){return{'accounts':_0x443c64+'_'+(_0x443c64===_0xc0b8('0x8')?'websites':'accounts'),'interactions':_0x443c64+_0xc0b8('0xb'),'interactionsTags':_0x443c64+_0xc0b8('0xc'),'messages':_0x443c64+_0xc0b8('0xd'),'userInteractions':_0xc0b8('0xe')+_0x443c64+_0xc0b8('0xb')};}function getSelectedTags(_0x39b6a8){var _0x24ff7b=[];if(_0x39b6a8){_0x24ff7b=Array[_0xc0b8('0xf')](_0x39b6a8)?_0x39b6a8:[_0x39b6a8];}return _0x24ff7b;}function log(_0x2413a7,_0x1df2c1,_0x1f4d1b,_0x433aab,_0x8ad420,_0x3c5aef){loggers[_0x8ad420[_0xc0b8('0x10')]()][_0x2413a7](_0xc0b8('0x11'),_0x3c5aef[_0xc0b8('0x12')](),_0x1df2c1?_0x1df2c1['id']:null,_0x1df2c1?_0x1df2c1[_0xc0b8('0x13')]:null,_0x1df2c1?_0x1df2c1['role']:null,getInteractionId(_0x1f4d1b,_0x433aab,_0x8ad420),_0x1f4d1b?JSON['stringify'](_0x1f4d1b):_0xc0b8('0x14'));}function updateUser(_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328){db[_['upperFirst'](_0x1bbf60)+_0xc0b8('0x15')][_0xc0b8('0x16')]({'where':{'id':getInteractionId(_0x55b4bb,_0x5c38aa,_0x1bbf60)}})[_0xc0b8('0x17')](function(_0x178392){if(_0x178392){return _0x178392['update']({'UserId':_0x5037fe?_0x5037fe['id']:null});}})[_0xc0b8('0x17')](function(_0x1721f5){if(_0x1721f5){log(_0xc0b8('0x18'),_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328);}})['catch'](function(){log(_0xc0b8('0x19'),_0x5037fe,_0x55b4bb,_0x5c38aa,_0x1bbf60,_0x9b2328);});}module[_0xc0b8('0x1a')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x2b3a=['findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_interactions','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2b3a,0x1c7));var _0xa2b3=function(_0x3c7b8b,_0xe26e37){_0x3c7b8b=_0x3c7b8b-0x0;var _0x471796=_0x2b3a[_0x3c7b8b];return _0x471796;};'use strict';var _=require(_0xa2b3('0x0'));var db=require(_0xa2b3('0x1'))['db'];var loggers={'openchannel':require(_0xa2b3('0x2'))(_0xa2b3('0x3')),'mail':require(_0xa2b3('0x2'))(_0xa2b3('0x4')),'fax':require(_0xa2b3('0x2'))(_0xa2b3('0x5')),'sms':require(_0xa2b3('0x2'))(_0xa2b3('0x6')),'chat':require(_0xa2b3('0x2'))(_0xa2b3('0x7')),'whatsapp':require('../../config/logger')(_0xa2b3('0x8'))};function getAccountFK(_0x5b3ddd){return _[_0xa2b3('0x9')](_0x5b3ddd)+(_0x5b3ddd===_0xa2b3('0xa')?_0xa2b3('0xb'):_0xa2b3('0xc'))+'Id';}function getInteractionFK(_0x42f321){return _[_0xa2b3('0x9')](_0x42f321)+_0xa2b3('0xd');}function getInteractionId(_0x52efe0,_0x27b0ee,_0x3cd692){if(_0x52efe0&&_0x52efe0[_[_0xa2b3('0xe')](_0x3cd692)+_0xa2b3('0xd')]){return _0x52efe0[_[_0xa2b3('0xe')](_0x3cd692)+'InteractionId'];}else if(_0x52efe0&&_0x52efe0['id']){return _0x52efe0['id'];}else if(_0x27b0ee&&_0x27b0ee['id']){return _0x27b0ee['id'];}else{return'unknown';}}function getInteractionsTables(_0x51f764){return{'accounts':_0x51f764+'_'+(_0x51f764===_0xa2b3('0xa')?_0xa2b3('0xf'):_0xa2b3('0x10')),'interactions':_0x51f764+_0xa2b3('0x11'),'interactionsTags':_0x51f764+'_interaction_has_tags','messages':_0x51f764+'_messages','userInteractions':_0xa2b3('0x12')+_0x51f764+_0xa2b3('0x11')};}function getSelectedTags(_0x46b8dd){var _0xab985c=[];if(_0x46b8dd){_0xab985c=Array[_0xa2b3('0x13')](_0x46b8dd)?_0x46b8dd:[_0x46b8dd];}return _0xab985c;}function log(_0x139fa0,_0x56b5a9,_0x681869,_0x22d164,_0x4a4325,_0x59a9c2){loggers[_0x4a4325['toLowerCase']()][_0x139fa0](_0xa2b3('0x14'),_0x59a9c2[_0xa2b3('0x15')](),_0x56b5a9?_0x56b5a9['id']:null,_0x56b5a9?_0x56b5a9['name']:null,_0x56b5a9?_0x56b5a9['role']:null,getInteractionId(_0x681869,_0x22d164,_0x4a4325),_0x681869?JSON[_0xa2b3('0x16')](_0x681869):_0xa2b3('0x17'));}function updateUser(_0x5f405c,_0x4a3626,_0x4eef7c,_0x11e28c,_0x4ee4ac){db[_['upperFirst'](_0x11e28c)+_0xa2b3('0x18')][_0xa2b3('0x19')]({'where':{'id':getInteractionId(_0x4a3626,_0x4eef7c,_0x11e28c)}})[_0xa2b3('0x1a')](function(_0x19e396){if(_0x19e396){return _0x19e396[_0xa2b3('0x1b')]({'UserId':_0x5f405c?_0x5f405c['id']:null});}})['then'](function(_0x1fd833){if(_0x1fd833){log(_0xa2b3('0x1c'),_0x5f405c,_0x4a3626,_0x4eef7c,_0x11e28c,_0x4ee4ac);}})[_0xa2b3('0x1d')](function(){log(_0xa2b3('0x1e'),_0x5f405c,_0x4a3626,_0x4eef7c,_0x11e28c,_0x4ee4ac);});}module[_0xa2b3('0x1f')]={'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 f51c0b1..e7e8500 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 _0x6dc3=['admin','crypto','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','format','update','base64','final','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x529464,_0xce492c){var _0x2cdef7=function(_0x5e215f){while(--_0x5e215f){_0x529464['push'](_0x529464['shift']());}};_0x2cdef7(++_0xce492c);}(_0x6dc3,0x1a1));var _0x36dc=function(_0x2e828b,_0x57a7a4){_0x2e828b=_0x2e828b-0x0;var _0x3d1167=_0x6dc3[_0x2e828b];return _0x3d1167;};'use strict';var crypto=require(_0x36dc('0x0'));var util=require('util');var compose=require(_0x36dc('0x1'));var db=require(_0x36dc('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x876296,_0x21ecff){if(_0x876296&&_0x21ecff){if(_0x21ecff[_0x36dc('0x3')]&&_0x21ecff[_0x36dc('0x4')]){var _0x197016=_0x21ecff[_0x36dc('0x3')];var _0x416a12=_0x21ecff[_0x36dc('0x4')];var _0x5a1a83=_0x197016[_0x36dc('0x5')]('-')[0x4];var _0xbd794e=_0x197016['split']('-')[0x0];var _0x3b24b3=crypto['createDecipher'](_0x36dc('0x6'),util[_0x36dc('0x7')]('%s:%s:%s',_0x5a1a83,_0x197016,_0xbd794e));var _0x3885d9=_0x3b24b3[_0x36dc('0x8')](_0x416a12,_0x36dc('0x9'),'utf8');_0x3885d9+=_0x3b24b3[_0x36dc('0xa')](_0x36dc('0xb'));var _0x1bf8cb=JSON[_0x36dc('0xc')](_0x3885d9);return _0x1bf8cb[_0x36dc('0xd')](_0x876296)?_0x1bf8cb[_0x876296]:null;}}return null;}function isLimit(_0x5eb534,_0x19c2be,_0x1b27fe,_0x366cf1){var _0x5bfe33=_0x19c2be;return compose()[_0x36dc('0xe')](function(_0x407690,_0x2b0f27,_0x3b4f96){return db[_0x36dc('0xf')][_0x36dc('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x36dc('0x11')](function(_0x265b6b){var _0x567e5d=getValueFromLicense(_0x5eb534,_0x265b6b);return _0x567e5d?_0x567e5d:_0x5bfe33;})[_0x36dc('0x11')](function(_0x46dd47){_0x5bfe33=_0x46dd47;return _0x1b27fe[_0x36dc('0x12')](_0x366cf1);})[_0x36dc('0x11')](function(_0x348eb7){if(_0x348eb7>=_0x5bfe33){return _0x2b0f27[_0x36dc('0x13')](0x193)[_0x36dc('0x14')]({'message':util[_0x36dc('0x7')](_0x36dc('0x15'),_0x5eb534)});}_0x3b4f96();})[_0x36dc('0x16')](function(_0x129c03){_0x3b4f96(_0x129c03);});});}function isUserLimit(){return isLimit(_0x36dc('0x17'),0x1,db[_0x36dc('0x18')],{'where':{'$or':[{'role':_0x36dc('0x19')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x303e=['count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','findOne','then'];(function(_0x50b2ea,_0x52c92d){var _0x10f77f=function(_0x4d2bdd){while(--_0x4d2bdd){_0x50b2ea['push'](_0x50b2ea['shift']());}};_0x10f77f(++_0x52c92d);}(_0x303e,0xf1));var _0xe303=function(_0x59d462,_0x387b3b){_0x59d462=_0x59d462-0x0;var _0x24e664=_0x303e[_0x59d462];return _0x24e664;};'use strict';var crypto=require(_0xe303('0x0'));var util=require('util');var compose=require(_0xe303('0x1'));var db=require(_0xe303('0x2'))['db'];var config=require(_0xe303('0x3'));function getValueFromLicense(_0x52dee8,_0xe59cca){if(_0x52dee8&&_0xe59cca){if(_0xe59cca[_0xe303('0x4')]&&_0xe59cca[_0xe303('0x5')]){var _0x19f11a=_0xe59cca['data1'];var _0x5a00c5=_0xe59cca[_0xe303('0x5')];var _0x16c0fb=_0x19f11a[_0xe303('0x6')]('-')[0x4];var _0x5a7c5f=_0x19f11a[_0xe303('0x6')]('-')[0x0];var _0x187fe5=crypto[_0xe303('0x7')](_0xe303('0x8'),util[_0xe303('0x9')](_0xe303('0xa'),_0x16c0fb,_0x19f11a,_0x5a7c5f));var _0x3e6d8a=_0x187fe5['update'](_0x5a00c5,_0xe303('0xb'),_0xe303('0xc'));_0x3e6d8a+=_0x187fe5['final'](_0xe303('0xc'));var _0x155595=JSON[_0xe303('0xd')](_0x3e6d8a);return _0x155595[_0xe303('0xe')](_0x52dee8)?_0x155595[_0x52dee8]:null;}}return null;}function isLimit(_0x1a6295,_0x532044,_0x1eca71,_0x4df4e2){var _0x22ee44=_0x532044;return compose()[_0xe303('0xf')](function(_0x514d6f,_0x1019ba,_0x51d38b){return db[_0xe303('0x10')][_0xe303('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5ef2af){var _0x53502c=getValueFromLicense(_0x1a6295,_0x5ef2af);return _0x53502c?_0x53502c:_0x22ee44;})[_0xe303('0x12')](function(_0x52b059){_0x22ee44=_0x52b059;return _0x1eca71[_0xe303('0x13')](_0x4df4e2);})[_0xe303('0x12')](function(_0x4a6153){if(_0x4a6153>=_0x22ee44){return _0x1019ba['status'](0x193)[_0xe303('0x14')]({'message':util[_0xe303('0x9')](_0xe303('0x15'),_0x1a6295)});}_0x51d38b();})[_0xe303('0x16')](function(_0x20bb31){_0x51d38b(_0x20bb31);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe303('0x17')],{'where':{'$or':[{'role':_0xe303('0x18')},{'role':'user'}]}});}exports[_0xe303('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 81a2fb3..dc1f8f0 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 _0x1358=['minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','shift','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','$eq','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','pop','DATE','format','utcOffset','hours'];(function(_0x594d31,_0x8ef2e3){var _0x5e54ab=function(_0x20aaba){while(--_0x20aaba){_0x594d31['push'](_0x594d31['shift']());}};_0x5e54ab(++_0x8ef2e3);}(_0x1358,0x6c));var _0x8135=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x1358[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x8135('0x0'));var moment=require(_0x8135('0x1'));exports[_0x8135('0x2')]=function(_0x522785){var _0x220783={'conditions':[]};_0x220783[_0x8135('0x3')]=_[_0x8135('0x4')](_0x522785,_0x8135('0x5'))?'or':_0x8135('0x6');var _0x478b50=_0x522785[_0x8135('0x7')]('[$and]','')['replace'](_0x8135('0x5'),'')[_0x8135('0x8')]('||');for(var _0x5d9198=0x0;_0x5d9198<_0x478b50[_0x8135('0x9')];_0x5d9198++){var _0x268734=_0x478b50[_0x5d9198]['split'](':=');var _0x3d51e9=_0x268734[0x0];var _0x379986=_0x268734[_0x8135('0xa')](0x1);_0x379986['forEach'](function(_0x42efe3){var _0x2e705f=_0x42efe3['split']('[')[_0x8135('0xb')]();var _0x45402d=_0x42efe3['match'](/\[(.*?)\]/g);_0x45402d['forEach'](function(_0x281f26){var _0x5a2276=_0x281f26[_0x8135('0x8')]('[')[_0x8135('0xc')](function(_0x248923){return _0x248923[_0x8135('0xd')](']')>-0x1;})[_0x8135('0xe')](function(_0x3dcd38){return _0x3dcd38[_0x8135('0x8')](']')[0x0];})[0x0];_0x220783[_0x8135('0xf')][_0x8135('0x10')]({'field':_0x3d51e9,'operator':_0x2e705f,'value':_0x5a2276});});});}return _0x220783;};exports[_0x8135('0x11')]=function(_0x3f104c,_0x3464b5,_0x14a3c4){var _0x47eb76={};if(_0x3464b5==='DATE'){if(_0x14a3c4[_0x8135('0x12')]==='$eq'){_0x14a3c4['operator']=_0x8135('0x13');_0x14a3c4[_0x8135('0x14')]+=','+_0x14a3c4['value'];}else if(_[_0x8135('0x15')]([_0x8135('0x16'),'$lte'],_0x14a3c4[_0x8135('0x12')])){_0x14a3c4[_0x8135('0x14')]=moment(_0x14a3c4[_0x8135('0x14')])[_0x8135('0x17')](0x1,_0x8135('0x18'))['format'](_0x8135('0x19'));}}if(_0x14a3c4[_0x8135('0x1a')]){_0x3464b5=_0x14a3c4['castTo'];_0x47eb76[_0x8135('0x1b')]=_0x8135('0x1c')+_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20AS\x20'+_0x14a3c4['castTo']+')\x20'+parseOperator(_0x14a3c4['operator']);}else{_0x47eb76[_0x8135('0x1b')]=_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20'+parseOperator(_0x14a3c4[_0x8135('0x12')]);}if(_[_0x8135('0x15')](['$ne','$notIn'],_0x14a3c4[_0x8135('0x12')]))_0x47eb76[_0x8135('0x1b')]='('+_0x47eb76[_0x8135('0x1b')]+'\x20OR\x20'+_0x3f104c+'.'+_0x14a3c4[_0x8135('0x1d')]+'\x20IS\x20NULL)';_0x47eb76[_0x8135('0x14')]=parseValue(_0x3464b5,_0x14a3c4[_0x8135('0x12')],_0x14a3c4['value']);return _0x47eb76;};function parseOperator(_0x41a460){var _0x3e2b3b;switch(_0x41a460){case'$in':_0x3e2b3b='IN\x20?';break;case _0x8135('0x1e'):_0x3e2b3b='NOT\x20IN\x20?';break;case _0x8135('0x1f'):_0x3e2b3b='=\x20?';break;case _0x8135('0x20'):_0x3e2b3b=_0x8135('0x21');break;case _0x8135('0x22'):case _0x8135('0x23'):case _0x8135('0x24'):_0x3e2b3b=_0x8135('0x25');break;case _0x8135('0x26'):_0x3e2b3b=_0x8135('0x27');break;case _0x8135('0x16'):_0x3e2b3b=_0x8135('0x28');break;case _0x8135('0x29'):_0x3e2b3b=_0x8135('0x2a');break;case _0x8135('0x2b'):_0x3e2b3b=_0x8135('0x2c');break;case _0x8135('0x13'):_0x3e2b3b='BETWEEN\x20?\x20AND\x20?';break;}return _0x3e2b3b;}function parseValue(_0x5a68c4,_0x142c72,_0x5a479e){var _0x2c8aec={'start':undefined,'end':undefined};switch(_0x142c72){case'$in':case'$notIn':_0x2c8aec[_0x8135('0x2d')]=_0x5a479e[_0x8135('0x8')](',');break;case _0x8135('0x22'):_0x2c8aec[_0x8135('0x2d')]='%'+_0x5a479e+'%';break;case _0x8135('0x23'):_0x2c8aec[_0x8135('0x2d')]=_0x5a479e+'%';break;case _0x8135('0x24'):_0x2c8aec[_0x8135('0x2d')]='%'+_0x5a479e;break;case _0x8135('0x13'):var _0x5573de=_0x5a479e[_0x8135('0x8')](',');var _0x5a479e=_0x5573de[_0x8135('0xb')]();var _0x5bee0b=_0x5573de[_0x8135('0x2e')]();if(_0x5a68c4===_0x8135('0x2f')){_0x5a479e=moment(_0x5a479e)['utcOffset'](0x0,!![])[_0x8135('0x30')]();_0x5bee0b=moment(_0x5bee0b)[_0x8135('0x31')](0x0,!![])[_0x8135('0x17')](0x17,_0x8135('0x32'))['add'](0x3b,_0x8135('0x33'))[_0x8135('0x17')](0x3b,_0x8135('0x34'))['format']();}_0x2c8aec={'start':_0x5a479e,'end':_0x5bee0b};break;default:_0x2c8aec[_0x8135('0x2d')]=_0x5a479e;break;}return _0x2c8aec;} \ No newline at end of file +var _0x09c1=['indexOf','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','$ne','$notIn','text','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','start','$substring','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','slice','forEach','match','filter'];(function(_0x16ed05,_0x1210ae){var _0x3efcc3=function(_0x5d669d){while(--_0x5d669d){_0x16ed05['push'](_0x16ed05['shift']());}};_0x3efcc3(++_0x1210ae);}(_0x09c1,0x114));var _0x109c=function(_0x4ac761,_0x228735){_0x4ac761=_0x4ac761-0x0;var _0x4de38d=_0x09c1[_0x4ac761];return _0x4de38d;};'use strict';var _=require(_0x109c('0x0'));var moment=require(_0x109c('0x1'));exports[_0x109c('0x2')]=function(_0x354068){var _0x16d857={'conditions':[]};_0x16d857[_0x109c('0x3')]=_[_0x109c('0x4')](_0x354068,'[$or]')?'or':_0x109c('0x5');var _0x2b6147=_0x354068[_0x109c('0x6')](_0x109c('0x7'),'')[_0x109c('0x6')](_0x109c('0x8'),'')[_0x109c('0x9')]('||');for(var _0x362c76=0x0;_0x362c76<_0x2b6147['length'];_0x362c76++){var _0x302b5e=_0x2b6147[_0x362c76][_0x109c('0x9')](':=');var _0x4b57c1=_0x302b5e[0x0];var _0xf886ac=_0x302b5e[_0x109c('0xa')](0x1);_0xf886ac[_0x109c('0xb')](function(_0x453233){var _0x586457=_0x453233['split']('[')['shift']();var _0x336a63=_0x453233[_0x109c('0xc')](/\[(.*?)\]/g);_0x336a63[_0x109c('0xb')](function(_0x255085){var _0x274205=_0x255085[_0x109c('0x9')]('[')[_0x109c('0xd')](function(_0x8a2b75){return _0x8a2b75[_0x109c('0xe')](']')>-0x1;})['map'](function(_0x33af24){return _0x33af24[_0x109c('0x9')](']')[0x0];})[0x0];_0x16d857[_0x109c('0xf')][_0x109c('0x10')]({'field':_0x4b57c1,'operator':_0x586457,'value':_0x274205});});});}return _0x16d857;};exports[_0x109c('0x11')]=function(_0x49a88c,_0x5e613a,_0x9c8301){var _0x12e5bb={};if(_0x5e613a===_0x109c('0x12')){if(_0x9c8301['operator']==='$eq'){_0x9c8301[_0x109c('0x13')]=_0x109c('0x14');_0x9c8301[_0x109c('0x15')]+=','+_0x9c8301[_0x109c('0x15')];}else if(_[_0x109c('0x16')]([_0x109c('0x17'),'$lte'],_0x9c8301[_0x109c('0x13')])){_0x9c8301[_0x109c('0x15')]=moment(_0x9c8301[_0x109c('0x15')])[_0x109c('0x18')](0x1,_0x109c('0x19'))[_0x109c('0x1a')](_0x109c('0x1b'));}}if(_0x9c8301[_0x109c('0x1c')]){_0x5e613a=_0x9c8301[_0x109c('0x1c')];_0x12e5bb['text']=_0x109c('0x1d')+_0x49a88c+'.'+_0x9c8301[_0x109c('0x1e')]+_0x109c('0x1f')+_0x9c8301[_0x109c('0x1c')]+')\x20'+parseOperator(_0x9c8301[_0x109c('0x13')]);}else{_0x12e5bb['text']=_0x49a88c+'.'+_0x9c8301['field']+'\x20'+parseOperator(_0x9c8301[_0x109c('0x13')]);}if(_[_0x109c('0x16')]([_0x109c('0x20'),_0x109c('0x21')],_0x9c8301[_0x109c('0x13')]))_0x12e5bb[_0x109c('0x22')]='('+_0x12e5bb[_0x109c('0x22')]+'\x20OR\x20'+_0x49a88c+'.'+_0x9c8301['field']+_0x109c('0x23');_0x12e5bb['value']=parseValue(_0x5e613a,_0x9c8301[_0x109c('0x13')],_0x9c8301[_0x109c('0x15')]);return _0x12e5bb;};function parseOperator(_0x527d9d){var _0xe9163a;switch(_0x527d9d){case _0x109c('0x24'):_0xe9163a=_0x109c('0x25');break;case'$notIn':_0xe9163a=_0x109c('0x26');break;case _0x109c('0x27'):_0xe9163a=_0x109c('0x28');break;case _0x109c('0x20'):_0xe9163a=_0x109c('0x29');break;case'$substring':case _0x109c('0x2a'):case _0x109c('0x2b'):_0xe9163a=_0x109c('0x2c');break;case _0x109c('0x2d'):_0xe9163a=_0x109c('0x2e');break;case _0x109c('0x17'):_0xe9163a='>\x20?';break;case'$lte':_0xe9163a=_0x109c('0x2f');break;case _0x109c('0x30'):_0xe9163a=_0x109c('0x31');break;case _0x109c('0x14'):_0xe9163a='BETWEEN\x20?\x20AND\x20?';break;}return _0xe9163a;}function parseValue(_0x40c712,_0x2e872e,_0x4b9193){var _0x339dc0={'start':undefined,'end':undefined};switch(_0x2e872e){case _0x109c('0x24'):case _0x109c('0x21'):_0x339dc0[_0x109c('0x32')]=_0x4b9193['split'](',');break;case _0x109c('0x33'):_0x339dc0[_0x109c('0x32')]='%'+_0x4b9193+'%';break;case _0x109c('0x2a'):_0x339dc0[_0x109c('0x32')]=_0x4b9193+'%';break;case _0x109c('0x2b'):_0x339dc0[_0x109c('0x32')]='%'+_0x4b9193;break;case _0x109c('0x14'):var _0x52c494=_0x4b9193[_0x109c('0x9')](',');var _0x4b9193=_0x52c494[_0x109c('0x34')]();var _0x13a0e0=_0x52c494[_0x109c('0x35')]();if(_0x40c712==='DATE'){_0x4b9193=moment(_0x4b9193)[_0x109c('0x36')](0x0,!![])[_0x109c('0x1a')]();_0x13a0e0=moment(_0x13a0e0)['utcOffset'](0x0,!![])[_0x109c('0x18')](0x17,_0x109c('0x37'))[_0x109c('0x18')](0x3b,_0x109c('0x38'))['add'](0x3b,_0x109c('0x39'))[_0x109c('0x1a')]();}_0x339dc0={'start':_0x4b9193,'end':_0x13a0e0};break;default:_0x339dc0[_0x109c('0x32')]=_0x4b9193;break;}return _0x339dc0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9ef0265..fc3d00b 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 _0x7dfd=['col','unsigned','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','getFullTextValue','replace','match','push','join','getOptions','query','$id','model','intersection','fields','attributes','offset','order','where','object','filter','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','substr','DESC'];(function(_0x36654f,_0x12cccd){var _0x3f8168=function(_0x5bb101){while(--_0x5bb101){_0x36654f['push'](_0x36654f['shift']());}};_0x3f8168(++_0x12cccd);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var sequelize=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2d48e6){var _0x346f5f=['ne'];try{var _0x28c3c9=JSON[_0xd7df('0x3')](_0x2d48e6);var _0x38eee7=Object[_0xd7df('0x4')](_0x28c3c9)[0x0];return _0x346f5f[_0xd7df('0x5')](_0x38eee7);}catch(_0x65a0b6){return![];}}function getOperatorValue(_0x3304f9){var _0x36cf0f=JSON[_0xd7df('0x3')](_0x3304f9);var _0x354ea7=Object[_0xd7df('0x4')](_0x36cf0f)[0x0];var _0x2c48a4=_0x36cf0f[_0x354ea7];return{['$'+_0x354ea7]:_0x2c48a4};}exports['fields']=function(_0xab6742){var _0xb3557a=null;if(_0xab6742){_0xb3557a=_0xab6742[_0xd7df('0x6')](',');}return _0xb3557a;};exports[_0xd7df('0x7')]=function(_0x5e59c3,_0x32c5b5){var _0x532c14={};if(!_[_0xd7df('0x8')](_0x5e59c3)){_['forOwn'](_0x5e59c3,function(_0x394d32,_0x82f1c0){try{if(_0x32c5b5){var _0x28d358=_[_0xd7df('0x9')](_0x32c5b5,{'name':_0x82f1c0})||{};if(hasSequelizeOperator(_0x394d32)){_0x532c14[_0x82f1c0]=getOperatorValue(_0x394d32);}else if(_0x28d358[_0xd7df('0xa')]===_0xd7df('0xb')&&_[_0xd7df('0xc')](_0x394d32)){var _0x3da618=JSON[_0xd7df('0x3')](_0x394d32);var _0x4d6f17={'$gte':moment(moment(_0x3da618[_0xd7df('0xd')])[_0xd7df('0xe')](_0xd7df('0xf')))[_0xd7df('0x10')]()[_0xd7df('0xe')](),'$lte':moment(moment(_0x3da618[_0xd7df('0x11')])[_0xd7df('0xe')]('YYYY-MM-DD'))[_0xd7df('0x10')]()[_0xd7df('0x12')](0x1,'s')['format']()};_0x532c14[_0x82f1c0]=_0x4d6f17;}else if(_0x28d358[_0xd7df('0x13')]===_0xd7df('0x14')){_0x532c14[_0x82f1c0]=_0x394d32;}else{_0x532c14[_0x82f1c0]=_['isArray'](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}else{_0x532c14[_0x82f1c0]=_[_0xd7df('0x15')](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}catch(_0x5210e5){_0x532c14[_0x82f1c0]=_0x394d32[_0xd7df('0x6')](',');}});}return _0x532c14;};exports[_0xd7df('0x16')]=function(_0x3cea3){_0x3cea3=parseInt(_0x3cea3,0xa);if(!_0x3cea3||_0x3cea3<0x0){_0x3cea3=LIMIT_VALUE;}return _0x3cea3;};exports['offset']=function(_0x96d86e){_0x96d86e=parseInt(_0x96d86e,0xa);if(!_0x96d86e||_0x96d86e<0x0){_0x96d86e=0x0;}return _0x96d86e;};exports[_0xd7df('0x17')]=function(_0x4e1985){var _0x5acb0a,_0x4188af=null;if(_0x4e1985){_0x5acb0a=_0x4e1985['split'](',');_0x4188af=_[_0xd7df('0x18')](_0x5acb0a,function(_0x5ab737){if(_0x5ab737[_0xd7df('0x19')]('-')===0x0){return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize['col'](_0xd7df('0x1a')),'unsigned'):_0x5ab737[_0xd7df('0x1c')](0x1),_0xd7df('0x1d')];}else{return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize[_0xd7df('0x1e')](_0xd7df('0x1a')),_0xd7df('0x1f')):_0x5ab737,'ASC'];}});}return _0x4188af;};exports['omit']=function(_0x36f2bd,_0x38db14){if(_[_0xd7df('0x8')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x15')](_0x36f2bd)){for(var _0x13f190=0x0;_0x13f190<_0x36f2bd[_0xd7df('0x20')];_0x13f190+=0x1){_0x36f2bd[_0x13f190]=this[_0xd7df('0x21')](_0x36f2bd[_0x13f190],_0x38db14);}return _0x36f2bd;}if(!_[_0xd7df('0x22')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x23')](_0x38db14)){_0x38db14=[_0x38db14];}if(!_['isArray'](_0x38db14)){return _0x36f2bd;}for(var _0xe53f53=0x0;_0xe53f53<_0x38db14[_0xd7df('0x20')];_0xe53f53+=0x1){_[_0xd7df('0x24')](_0x36f2bd,_0x38db14[_0xe53f53]);}for(var _0x29f0e8 in _0x36f2bd){if(_0x36f2bd[_0xd7df('0x25')](_0x29f0e8)){_0x36f2bd[_0x29f0e8]=this[_0xd7df('0x21')](_0x36f2bd[_0x29f0e8],_0x38db14);}}return _0x36f2bd;};exports[_0xd7df('0x26')]=function(_0x36de76){return _0x36de76['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x58584d){return _0x58584d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd7df('0x27')]=function(_0x4e87cd){var _0xd366b=[];_0x4e87cd[_0xd7df('0x6')](/[ ,]+/)['forEach'](function(_0x3ef553){_0x3ef553=_0x3ef553[_0xd7df('0x28')](/([^:]")"+/g,'$1');_0x3ef553='+'+_0x3ef553+'*';var _0x4fe918=/[ `!@#$%^&*()_\-?~]/;if(_0x3ef553[_0xd7df('0x29')](_0x4fe918))_0x3ef553='\x22'+_0x3ef553+'\x22';_0xd366b[_0xd7df('0x2a')](_0x3ef553);});return _0xd366b[_0xd7df('0x2b')]('\x20');};exports[_0xd7df('0x2c')]=function(_0x40f965,_0x3304c4,_0x5a658f){var _0x428b4b={},_0x149813={};if(_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')]){_0x3304c4[_0xd7df('0x2d')]['id']=_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];delete _0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];}_0x428b4b[_0xd7df('0x2f')]=_[_0xd7df('0x18')](_0x40f965,'name');_0x428b4b['query']=_[_0xd7df('0x4')](_0x3304c4['query']);_0x428b4b[_0xd7df('0x7')]=_[_0xd7df('0x30')](_0x428b4b[_0xd7df('0x2f')],_0x428b4b[_0xd7df('0x2d')]);_0x149813['attributes']=_['intersection'](_0x428b4b['model'],this[_0xd7df('0x31')](_0x3304c4[_0xd7df('0x2d')]['fields']));_0x149813[_0xd7df('0x32')]=_0x149813[_0xd7df('0x32')][_0xd7df('0x20')]?_0x149813[_0xd7df('0x32')]:_0x428b4b['model'];if(!_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x25')]('nolimit')){_0x149813[_0xd7df('0x16')]=this['limit'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x16')]);_0x149813[_0xd7df('0x33')]=this['offset'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x33')]);}_0x149813[_0xd7df('0x34')]=this[_0xd7df('0x17')](_0x3304c4['query'][_0xd7df('0x17')]);_0x149813[_0xd7df('0x35')]=this[_0xd7df('0x7')](_['pick'](_0x3304c4[_0xd7df('0x2d')],_0x428b4b[_0xd7df('0x7')]),_0x40f965);if(_0x3304c4[_0xd7df('0x2d')]['filter']){var _0x80019d=_0x40f965;var _0x445467=_0x3304c4['query']['filter'];if(typeof _0x445467===_0xd7df('0x36')){_0x80019d=_[_0xd7df('0x37')](_0x40f965,function(_0x6a024a){return _['includes'](_0x445467['columns'],_0x6a024a[_0xd7df('0x13')]);});_0x445467=_0x445467['value'];}_0x149813[_0xd7df('0x35')]=_['merge'](_0x149813['where'],{'$or':_[_0xd7df('0x18')](_0x80019d,function(_0x579d0f){if(_0x579d0f[_0xd7df('0xa')]!==_0xd7df('0x38')){if(_0x5a658f){return sequelize[_0xd7df('0x35')](sequelize['fn'](_0xd7df('0x39'),sequelize[_0xd7df('0x1e')](_0x579d0f[_0xd7df('0x13')])),{'$like':sequelize['fn'](_0xd7df('0x39'),'%'+_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x37')]+'%')});}else{var _0x5b3179={};_0x5b3179[_0x579d0f[_0xd7df('0x13')]]={'$like':'%'+_0x3304c4['query'][_0xd7df('0x37')]+'%'};return _0x5b3179;}}})});}_0x149813=_[_0xd7df('0x3a')]({},_0x149813,_0x3304c4[_0xd7df('0x3b')]);return _0x149813;}; \ No newline at end of file +var _0x5fc3=['YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','$id','query','model','keys','intersection','attributes','nolimit','offset','order','where','pick','filter','object','value','merge','lower','options','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','find','type','$gte','format'];(function(_0x4f6d1a,_0x42ab92){var _0x476e61=function(_0x306aba){while(--_0x306aba){_0x4f6d1a['push'](_0x4f6d1a['shift']());}};_0x476e61(++_0x42ab92);}(_0x5fc3,0xa8));var _0x35fc=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x5fc3[_0x420f2a];return _0x28f802;};'use strict';var _=require(_0x35fc('0x0'));var sequelize=require(_0x35fc('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x253d6e){var _0x2ac6da=['ne'];try{var _0x196bc2=JSON[_0x35fc('0x2')](_0x253d6e);var _0xb4f9ce=Object['keys'](_0x196bc2)[0x0];return _0x2ac6da[_0x35fc('0x3')](_0xb4f9ce);}catch(_0x1d5fec){return![];}}function getOperatorValue(_0x186a06){var _0x5b85ad=JSON['parse'](_0x186a06);var _0x19a0d1=Object['keys'](_0x5b85ad)[0x0];var _0x16e153=_0x5b85ad[_0x19a0d1];return{['$'+_0x19a0d1]:_0x16e153};}exports[_0x35fc('0x4')]=function(_0xc72d93){var _0x1e5f90=null;if(_0xc72d93){_0x1e5f90=_0xc72d93[_0x35fc('0x5')](',');}return _0x1e5f90;};exports[_0x35fc('0x6')]=function(_0x2051ab,_0x565f95){var _0x1083a9={};if(!_[_0x35fc('0x7')](_0x2051ab)){_['forOwn'](_0x2051ab,function(_0x471549,_0x33f491){try{if(_0x565f95){var _0x5021d4=_[_0x35fc('0x8')](_0x565f95,{'name':_0x33f491})||{};if(hasSequelizeOperator(_0x471549)){_0x1083a9[_0x33f491]=getOperatorValue(_0x471549);}else if(_0x5021d4[_0x35fc('0x9')]==='DATE'&&_['isPlainObject'](_0x471549)){var _0x409357=JSON['parse'](_0x471549);var _0x397738={'$gte':moment(moment(_0x409357[_0x35fc('0xa')])[_0x35fc('0xb')](_0x35fc('0xc')))[_0x35fc('0xd')]()['format'](),'$lte':moment(moment(_0x409357['$lte'])['format']('YYYY-MM-DD'))[_0x35fc('0xd')]()[_0x35fc('0xe')](0x1,'s')[_0x35fc('0xb')]()};_0x1083a9[_0x33f491]=_0x397738;}else if(_0x5021d4[_0x35fc('0xf')]===_0x35fc('0x10')){_0x1083a9[_0x33f491]=_0x471549;}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON['parse'](_0x471549);}}else{_0x1083a9[_0x33f491]=_[_0x35fc('0x11')](_0x471549)?_0x471549:JSON[_0x35fc('0x2')](_0x471549);}}catch(_0x553677){_0x1083a9[_0x33f491]=_0x471549[_0x35fc('0x5')](',');}});}return _0x1083a9;};exports[_0x35fc('0x12')]=function(_0x2e513b){_0x2e513b=parseInt(_0x2e513b,0xa);if(!_0x2e513b||_0x2e513b<0x0){_0x2e513b=LIMIT_VALUE;}return _0x2e513b;};exports['offset']=function(_0x1a86e9){_0x1a86e9=parseInt(_0x1a86e9,0xa);if(!_0x1a86e9||_0x1a86e9<0x0){_0x1a86e9=0x0;}return _0x1a86e9;};exports[_0x35fc('0x13')]=function(_0x465eb3){var _0x488234,_0x402cff=null;if(_0x465eb3){_0x488234=_0x465eb3[_0x35fc('0x5')](',');_0x402cff=_[_0x35fc('0x14')](_0x488234,function(_0x251a1f){if(_0x251a1f[_0x35fc('0x15')]('-')===0x0){return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),_0x35fc('0x19')):_0x251a1f['substr'](0x1),_0x35fc('0x1a')];}else{return[_0x251a1f===_0x35fc('0x16')?sequelize[_0x35fc('0x17')](sequelize[_0x35fc('0x18')](_0x35fc('0x16')),'unsigned'):_0x251a1f,_0x35fc('0x1b')];}});}return _0x402cff;};exports[_0x35fc('0x1c')]=function(_0x561bf8,_0x265324){if(_[_0x35fc('0x7')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x11')](_0x561bf8)){for(var _0x51cfec=0x0;_0x51cfec<_0x561bf8[_0x35fc('0x1d')];_0x51cfec+=0x1){_0x561bf8[_0x51cfec]=this['omit'](_0x561bf8[_0x51cfec],_0x265324);}return _0x561bf8;}if(!_[_0x35fc('0x1e')](_0x561bf8)){return _0x561bf8;}if(_[_0x35fc('0x1f')](_0x265324)){_0x265324=[_0x265324];}if(!_['isArray'](_0x265324)){return _0x561bf8;}for(var _0x519264=0x0;_0x519264<_0x265324[_0x35fc('0x1d')];_0x519264+=0x1){_['unset'](_0x561bf8,_0x265324[_0x519264]);}for(var _0x274208 in _0x561bf8){if(_0x561bf8[_0x35fc('0x20')](_0x274208)){_0x561bf8[_0x274208]=this['omit'](_0x561bf8[_0x274208],_0x265324);}}return _0x561bf8;};exports[_0x35fc('0x21')]=function(_0x645eac){return _0x645eac[_0x35fc('0x22')](RegExp(_0x35fc('0x23')))?!![]:![];};exports[_0x35fc('0x24')]=function(_0x134dfa){return _0x134dfa[_0x35fc('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x35fc('0x25')]=function(_0x54aedc){var _0x1cd1ae=[];_0x54aedc[_0x35fc('0x5')](/[ ,]+/)[_0x35fc('0x26')](function(_0x52acc5){_0x52acc5=_0x52acc5[_0x35fc('0x27')](/([^:]")"+/g,'$1');_0x52acc5='+'+_0x52acc5+'*';var _0x16f067=/[ `!@#$%^&*()_\-?~]/;if(_0x52acc5[_0x35fc('0x22')](_0x16f067))_0x52acc5='\x22'+_0x52acc5+'\x22';_0x1cd1ae[_0x35fc('0x28')](_0x52acc5);});return _0x1cd1ae[_0x35fc('0x29')]('\x20');};exports[_0x35fc('0x2a')]=function(_0x222ddb,_0x37b435,_0xf4dfab){var _0x127bfc={},_0x57072d={};if(_0x37b435['query'][_0x35fc('0x2b')]){_0x37b435['query']['id']=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];delete _0x37b435[_0x35fc('0x2c')][_0x35fc('0x2b')];}_0x127bfc[_0x35fc('0x2d')]=_[_0x35fc('0x14')](_0x222ddb,'name');_0x127bfc[_0x35fc('0x2c')]=_[_0x35fc('0x2e')](_0x37b435[_0x35fc('0x2c')]);_0x127bfc[_0x35fc('0x6')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],_0x127bfc['query']);_0x57072d[_0x35fc('0x30')]=_[_0x35fc('0x2f')](_0x127bfc[_0x35fc('0x2d')],this['fields'](_0x37b435[_0x35fc('0x2c')]['fields']));_0x57072d[_0x35fc('0x30')]=_0x57072d[_0x35fc('0x30')][_0x35fc('0x1d')]?_0x57072d[_0x35fc('0x30')]:_0x127bfc['model'];if(!_0x37b435['query']['hasOwnProperty'](_0x35fc('0x31'))){_0x57072d['limit']=this[_0x35fc('0x12')](_0x37b435['query'][_0x35fc('0x12')]);_0x57072d[_0x35fc('0x32')]=this[_0x35fc('0x32')](_0x37b435[_0x35fc('0x2c')][_0x35fc('0x32')]);}_0x57072d[_0x35fc('0x33')]=this[_0x35fc('0x13')](_0x37b435['query'][_0x35fc('0x13')]);_0x57072d[_0x35fc('0x34')]=this['filters'](_[_0x35fc('0x35')](_0x37b435[_0x35fc('0x2c')],_0x127bfc[_0x35fc('0x6')]),_0x222ddb);if(_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]){var _0x31d926=_0x222ddb;var _0x58f25c=_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')];if(typeof _0x58f25c===_0x35fc('0x37')){_0x31d926=_['filter'](_0x222ddb,function(_0x17821e){return _[_0x35fc('0x3')](_0x58f25c['columns'],_0x17821e[_0x35fc('0xf')]);});_0x58f25c=_0x58f25c[_0x35fc('0x38')];}_0x57072d[_0x35fc('0x34')]=_[_0x35fc('0x39')](_0x57072d[_0x35fc('0x34')],{'$or':_[_0x35fc('0x14')](_0x31d926,function(_0x211b70){if(_0x211b70[_0x35fc('0x9')]!=='VIRTUAL'){if(_0xf4dfab){return sequelize['where'](sequelize['fn'](_0x35fc('0x3a'),sequelize[_0x35fc('0x18')](_0x211b70['name'])),{'$like':sequelize['fn']('lower','%'+_0x37b435['query'][_0x35fc('0x36')]+'%')});}else{var _0x10f98b={};_0x10f98b[_0x211b70['name']]={'$like':'%'+_0x37b435[_0x35fc('0x2c')][_0x35fc('0x36')]+'%'};return _0x10f98b;}}})});}_0x57072d=_[_0x35fc('0x39')]({},_0x57072d,_0x37b435[_0x35fc('0x3b')]);return _0x57072d;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 0b8bd93..54b4b29 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 _0x6e64=['chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','voiceStatus','chatStatusTime','mailStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','lodash','jayson/promise','client','http','chatPause','faxPause','voicePause','filter','length','idle','unknown','unavailable','ringing','every','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','pause','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','mailPause','smsPause','whatsappPause','pauseType','merge','globalStatus','getSortedAgentsIdsByStatus','split','order','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','DESC','lastLoginAt','lastPauseAt','address','openchannelPause'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x6e64,0x184));var _0x46e6=function(_0x10901e,_0x50d084){_0x10901e=_0x10901e-0x0;var _0x4eb1f6=_0x6e64[_0x10901e];return _0x4eb1f6;};'use strict';var _=require(_0x46e6('0x0'));var jayson=require(_0x46e6('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x46e6('0x2')][_0x46e6('0x3')]({'port':0x232a});var routingClient=jayson[_0x46e6('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x9a90ea,_0xcb1562){var _0x474f90=[_0x9a90ea[_0x46e6('0x4')],_0x9a90ea[_0x46e6('0x5')],_0x9a90ea['mailPause'],_0x9a90ea['openchannelPause'],_0x9a90ea['smsPause'],_0x9a90ea[_0x46e6('0x6')],_0x9a90ea['whatsappPause']];if(!_0xcb1562)return _['every'](_0x474f90);var _0x5aa091=_[_0x46e6('0x7')](_0x474f90);return _0x5aa091['length']>0x0&&_0x5aa091[_0x46e6('0x8')]<_0x474f90[_0x46e6('0x8')]?!![]:![];}function isIdle(_0x23016f){return _0x23016f===_0x46e6('0x9')||_0x23016f===_0x46e6('0xa')||_0x23016f===_0x46e6('0xb')||_0x23016f===_0x46e6('0xc')||_['isNil'](_0x23016f);}function isAgentIdle(_0x4c82d0){if(_0x4c82d0['voiceStatus']!==_0x46e6('0x9')&&_0x4c82d0['voicePause']){_0x4c82d0['voiceStatus']='pause';return![];}return _[_0x46e6('0xd')]([_0x4c82d0[_0x46e6('0xe')],_0x4c82d0['faxStatus'],_0x4c82d0[_0x46e6('0xf')],_0x4c82d0[_0x46e6('0x10')],_0x4c82d0[_0x46e6('0x11')],_0x4c82d0['voiceStatus'],_0x4c82d0[_0x46e6('0x12')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x46e6('0x13')](_0x46e6('0x14'),{})['then'](function(_0x2b0090){if(_0x2b0090[_0x46e6('0x15')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0xebba0e=_0x2b0090['result'];return routingClient['request'](_0x46e6('0x14'),{})[_0x46e6('0x16')](function(_0x24db4a){if(_0x24db4a[_0x46e6('0x15')]){throw new Error(_0x46e6('0x17'));}var _0x3e0f9c=_0x24db4a[_0x46e6('0x18')];return _['merge']({},_0xebba0e,_0x3e0f9c);});})[_0x46e6('0x19')](function(_0x36f29c){throw _0x36f29c;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x2c0d47){var _0x114858=_0x46e6('0xa');if(isAgentPaused(_0x2c0d47))_0x114858=_0x46e6('0x1a');else if(isAgentPaused(_0x2c0d47,!![]))_0x114858=_0x46e6('0x1b');else if(isAgentIdle(_0x2c0d47))_0x114858=_0x46e6('0x9');else _0x114858=_0x46e6('0x1c');return _0x114858;}exports[_0x46e6('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x527973,_0x16a23b){var _0x5f01af=_[_0x46e6('0x1e')](_0x527973)?_0x527973:[_0x527973];var _0x565780=_['startCase'](_0x16a23b)+_0x46e6('0x1f');var _0x1283dc=_[_0x46e6('0x20')](_0x5f01af,function(_0x1b7155){return db[_0x565780][_0x46e6('0x21')]({'where':{'id':_0x1b7155}})['then'](function(_0x49fdb0){if(!_0x49fdb0)return[];return _0x49fdb0[_0x46e6('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x1283dc)['then'](function(_0x1d7f94){var _0x3c4491=_(_0x1d7f94)['flatten']()[_0x46e6('0x20')]('id')[_0x46e6('0x23')]()[_0x46e6('0x24')]();return _0x3c4491;});}exports[_0x46e6('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x363e8e,_0x573c87,_0x162744){try{if(_0x573c87['length']>0x0){_0x363e8e=_0x363e8e[_0x46e6('0x7')](function(_0x3d1ce8){return _0x573c87[_0x46e6('0x26')](_0x3d1ce8['id']);});}var _0x2e195f=_0x363e8e[_0x46e6('0x7')](function(_0x418409){var _0x3ae317=_0x46e6('0x1c');if(isAgentIdle(_0x418409)){_0x3ae317=_0x46e6('0x9');}return _0x3ae317===_0x162744;});return _[_0x46e6('0x20')](_0x2e195f,'id');}catch(_0x47066e){throw _0x47066e;}}exports[_0x46e6('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x310a69,_0x2ddd23,_0x2b1548){return Promise[_0x46e6('0x28')]()[_0x46e6('0x16')](function(){if(_0x2ddd23[_0x46e6('0x8')]>0x0){_0x310a69=_0x310a69['filter'](function(_0x346c9c){return _0x2ddd23['includes'](_0x346c9c['id']);});}return _0x310a69;})['then'](function(){return db[_0x46e6('0x29')][_0x46e6('0x2a')]({'attributes':['id',_0x46e6('0x2b'),_0x46e6('0x2c'),_0x46e6('0x4'),_0x46e6('0x5'),_0x46e6('0x2d'),'openchannelPause',_0x46e6('0x2e'),_0x46e6('0x6'),_0x46e6('0x2f'),_0x46e6('0x30')],'where':{'id':{'$in':_[_0x46e6('0x20')](_0x310a69,'id')}},'raw':!![]});})[_0x46e6('0x16')](function(_0x3f06d1){return _0x3f06d1[_0x46e6('0x20')](function(_0x30d3d8){var _0x14dfa5=_['find'](_0x310a69,['id',_0x30d3d8['id']]);var _0x312fbb=filterAgentAttributes(_0x14dfa5);_[_0x46e6('0x31')](_0x30d3d8,_0x312fbb);_0x30d3d8[_0x46e6('0x32')]=getAgentStatus(_0x30d3d8);return _0x30d3d8;});})[_0x46e6('0x16')](function(_0x496806){var _0x5e652e=sortAgentsByStatus(_0x496806,_0x2b1548);return _[_0x46e6('0x20')](_0x5e652e,'id');})[_0x46e6('0x19')](function(_0x41c99a){throw _0x41c99a;});}exports[_0x46e6('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x224ced){var _0xf82565={'fields':[],'order':null};var _0x209e46=_0x224ced[_0x46e6('0x34')](',');_0xf82565['fields']=_[_0x46e6('0x7')](_0x209e46,function(_0x3066f4){if(!_0x3066f4['includes'](_0x46e6('0x32'))){return!![];}_0xf82565[_0x46e6('0x35')]=_['startsWith'](_0x3066f4,'-')?'DESC':_0x46e6('0x36');return![];});return _0xf82565;}exports[_0x46e6('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0xe401ec){if(_0xe401ec[_0x46e6('0x26')]('fullname')&&!_0xe401ec['includes'](_0x46e6('0x38'))){var _0xec23e7=_0xe401ec[_0x46e6('0x39')](0x0,_0xe401ec[_0x46e6('0x3a')]('fullname'));_0xe401ec+=','+_0xec23e7+_0x46e6('0x38');}return _0xe401ec;}exports[_0x46e6('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x571331,_0xd558b6){var _0x12d8f3=_0x571331[_0x46e6('0x3c')](function(_0x35815a,_0x19361d){if(_0x35815a[_0x46e6('0x32')]===_0x19361d[_0x46e6('0x32')]){if(_0x35815a[_0x46e6('0x32')]===_0x46e6('0x1a')){if(_0xd558b6==='DESC'){return(_0x35815a[_0x46e6('0x30')]||'')<(_0x19361d['pauseType']||'')||_0x35815a[_0x46e6('0x2c')]['toLowerCase']()>_0x19361d[_0x46e6('0x2c')][_0x46e6('0x3d')]()?0x1:-0x1;}else{return(_0x35815a[_0x46e6('0x30')]||'')<(_0x19361d[_0x46e6('0x30')]||'')||_0x35815a['fullname'][_0x46e6('0x3d')]()>_0x19361d['fullname'][_0x46e6('0x3d')]()?-0x1:0x1;}}else{if(_0xd558b6===_0x46e6('0x3e')){return _0x35815a[_0x46e6('0x2c')]['toLowerCase']()<_0x19361d[_0x46e6('0x2c')][_0x46e6('0x3d')]()?0x1:-0x1;}else{return _0x35815a[_0x46e6('0x2c')][_0x46e6('0x3d')]()<_0x19361d[_0x46e6('0x2c')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0xd558b6===_0x46e6('0x3e')){return _0x35815a[_0x46e6('0x32')]<_0x19361d[_0x46e6('0x32')]?0x1:-0x1;}else{return _0x35815a[_0x46e6('0x32')]<_0x19361d[_0x46e6('0x32')]?-0x1:0x1;}}});return _0x12d8f3;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x2a10c2){var _0x1fdbe9=['userpic','online',_0x46e6('0x3f'),_0x46e6('0x40'),_0x46e6('0x30'),'lastPauseAt',_0x46e6('0x38'),_0x46e6('0x41'),_0x46e6('0x4'),_0x46e6('0x42'),_0x46e6('0x2d'),_0x46e6('0x2e'),'whatsappPause','faxPause',_0x46e6('0x6'),_0x46e6('0x43'),'openchannelCapacity',_0x46e6('0x44'),_0x46e6('0x45'),_0x46e6('0x46'),_0x46e6('0x47'),_0x46e6('0x48'),_0x46e6('0x49'),_0x46e6('0x4a'),_0x46e6('0x4b'),_0x46e6('0x4c'),_0x46e6('0x4d'),_0x46e6('0xe'),_0x46e6('0x10'),_0x46e6('0xf'),_0x46e6('0x11'),_0x46e6('0x12'),_0x46e6('0x4e'),_0x46e6('0x4f'),_0x46e6('0x50'),'openchannelStatusTime',_0x46e6('0x51'),'smsStatusTime','whatsappStatusTime',_0x46e6('0x52'),'voiceStatusTime',_0x46e6('0x53'),_0x46e6('0x54'),'screenrecording',_0x46e6('0x55'),_0x46e6('0x56'),_0x46e6('0x57')];var _0x3859ac=['chatPause',_0x46e6('0x42'),_0x46e6('0x2d'),_0x46e6('0x2e'),_0x46e6('0x2f'),_0x46e6('0x5'),_0x46e6('0x6'),_0x46e6('0x58')];var _0x2ccf11=_(_0x2a10c2)[_0x46e6('0x59')](_0x3859ac)[_0x46e6('0x5a')](_0x1fdbe9)[_0x46e6('0x24')]();return _0x2ccf11;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x3fe9=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','unknown','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','busy','getAgentIdsByStatus','resolve','findAll','fullname','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','Agents','then','error','result'];(function(_0xc758dd,_0x19b7a6){var _0xc4980=function(_0x4621cb){while(--_0x4621cb){_0xc758dd['push'](_0xc758dd['shift']());}};_0xc4980(++_0x19b7a6);}(_0x3fe9,0x9f));var _0x93fe=function(_0x4eda72,_0x22172d){_0x4eda72=_0x4eda72-0x0;var _0x2c6c8b=_0x3fe9[_0x4eda72];return _0x2c6c8b;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0x93fe('0x0'))['db'];var amiClient=jayson['client'][_0x93fe('0x1')]({'port':0x232a});var routingClient=jayson[_0x93fe('0x2')][_0x93fe('0x1')]({'port':0x232c});function isAgentPaused(_0x4b6d9e,_0x28f1ab){var _0x3e01f0=[_0x4b6d9e[_0x93fe('0x3')],_0x4b6d9e[_0x93fe('0x4')],_0x4b6d9e[_0x93fe('0x5')],_0x4b6d9e[_0x93fe('0x6')],_0x4b6d9e[_0x93fe('0x7')],_0x4b6d9e[_0x93fe('0x8')],_0x4b6d9e[_0x93fe('0x9')]];if(!_0x28f1ab)return _[_0x93fe('0xa')](_0x3e01f0);var _0x16218b=_[_0x93fe('0xb')](_0x3e01f0);return _0x16218b[_0x93fe('0xc')]>0x0&&_0x16218b[_0x93fe('0xc')]<_0x3e01f0[_0x93fe('0xc')]?!![]:![];}function isIdle(_0x2ff1c0){return _0x2ff1c0===_0x93fe('0xd')||_0x2ff1c0==='unknown'||_0x2ff1c0===_0x93fe('0xe')||_0x2ff1c0===_0x93fe('0xf')||_[_0x93fe('0x10')](_0x2ff1c0);}function isAgentIdle(_0x4a320f){if(_0x4a320f[_0x93fe('0x11')]!=='idle'&&_0x4a320f['voicePause']){_0x4a320f[_0x93fe('0x11')]=_0x93fe('0x12');return![];}return _[_0x93fe('0xa')]([_0x4a320f[_0x93fe('0x13')],_0x4a320f[_0x93fe('0x14')],_0x4a320f[_0x93fe('0x15')],_0x4a320f[_0x93fe('0x16')],_0x4a320f[_0x93fe('0x17')],_0x4a320f[_0x93fe('0x11')],_0x4a320f['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x93fe('0x18')](_0x93fe('0x19'),{})[_0x93fe('0x1a')](function(_0x2f25c6){if(_0x2f25c6[_0x93fe('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x1af76e=_0x2f25c6[_0x93fe('0x1c')];return routingClient[_0x93fe('0x18')](_0x93fe('0x19'),{})[_0x93fe('0x1a')](function(_0x451c7a){if(_0x451c7a[_0x93fe('0x1b')]){throw new Error(_0x93fe('0x1d'));}var _0x46d548=_0x451c7a[_0x93fe('0x1c')];return _[_0x93fe('0x1e')]({},_0x1af76e,_0x46d548);});})[_0x93fe('0x1f')](function(_0x1ff665){throw _0x1ff665;});}exports[_0x93fe('0x20')]=getRealtimeAgents;function getAgentStatus(_0x5ba66d){var _0x21ec91=_0x93fe('0x21');if(isAgentPaused(_0x5ba66d))_0x21ec91='pause';else if(isAgentPaused(_0x5ba66d,!![]))_0x21ec91='*pause';else if(isAgentIdle(_0x5ba66d))_0x21ec91=_0x93fe('0xd');else _0x21ec91='busy';return _0x21ec91;}exports[_0x93fe('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x3d8581,_0x225a84){var _0x5cc46b=_[_0x93fe('0x23')](_0x3d8581)?_0x3d8581:[_0x3d8581];var _0x115f2a=_[_0x93fe('0x24')](_0x225a84)+_0x93fe('0x25');var _0x3cc411=_[_0x93fe('0x26')](_0x5cc46b,function(_0x6edb67){return db[_0x115f2a][_0x93fe('0x27')]({'where':{'id':_0x6edb67}})[_0x93fe('0x1a')](function(_0x45640c){if(!_0x45640c)return[];return _0x45640c[_0x93fe('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x93fe('0x29')](_0x3cc411)[_0x93fe('0x1a')](function(_0x1bc271){var _0x574035=_(_0x1bc271)[_0x93fe('0x2a')]()[_0x93fe('0x26')]('id')[_0x93fe('0x2b')]()[_0x93fe('0x2c')]();return _0x574035;});}exports[_0x93fe('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1d617b,_0x4b4055,_0xa4e374){try{if(_0x4b4055['length']>0x0){_0x1d617b=_0x1d617b[_0x93fe('0xb')](function(_0x59d74f){return _0x4b4055[_0x93fe('0x2e')](_0x59d74f['id']);});}var _0x12398a=_0x1d617b[_0x93fe('0xb')](function(_0x55d5cf){var _0x2de5fc=_0x93fe('0x2f');if(isAgentIdle(_0x55d5cf)){_0x2de5fc=_0x93fe('0xd');}return _0x2de5fc===_0xa4e374;});return _[_0x93fe('0x26')](_0x12398a,'id');}catch(_0xecf697){throw _0xecf697;}}exports[_0x93fe('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x390a6b,_0xc1da26,_0x1fd781){return Promise[_0x93fe('0x31')]()[_0x93fe('0x1a')](function(){if(_0xc1da26['length']>0x0){_0x390a6b=_0x390a6b['filter'](function(_0x24ef69){return _0xc1da26[_0x93fe('0x2e')](_0x24ef69['id']);});}return _0x390a6b;})[_0x93fe('0x1a')](function(){return db['User'][_0x93fe('0x32')]({'attributes':['id','name',_0x93fe('0x33'),'chatPause',_0x93fe('0x4'),'mailPause',_0x93fe('0x6'),_0x93fe('0x7'),_0x93fe('0x8'),_0x93fe('0x9'),_0x93fe('0x34')],'where':{'id':{'$in':_['map'](_0x390a6b,'id')}},'raw':!![]});})[_0x93fe('0x1a')](function(_0x393cd2){return _0x393cd2[_0x93fe('0x26')](function(_0x4222e7){var _0xfebbd4=_[_0x93fe('0x35')](_0x390a6b,['id',_0x4222e7['id']]);var _0x280660=filterAgentAttributes(_0xfebbd4);_[_0x93fe('0x1e')](_0x4222e7,_0x280660);_0x4222e7[_0x93fe('0x36')]=getAgentStatus(_0x4222e7);return _0x4222e7;});})['then'](function(_0x4f42ac){var _0x260ed5=sortAgentsByStatus(_0x4f42ac,_0x1fd781);return _[_0x93fe('0x26')](_0x260ed5,'id');})[_0x93fe('0x1f')](function(_0x2d0343){throw _0x2d0343;});}exports[_0x93fe('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x59bffe){var _0x5e8eb5={'fields':[],'order':null};var _0x13ea73=_0x59bffe[_0x93fe('0x38')](',');_0x5e8eb5[_0x93fe('0x39')]=_[_0x93fe('0xb')](_0x13ea73,function(_0x539ded){if(!_0x539ded[_0x93fe('0x2e')]('globalStatus')){return!![];}_0x5e8eb5['order']=_['startsWith'](_0x539ded,'-')?_0x93fe('0x3a'):_0x93fe('0x3b');return![];});return _0x5e8eb5;}exports[_0x93fe('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x24900c){if(_0x24900c[_0x93fe('0x2e')](_0x93fe('0x33'))&&!_0x24900c[_0x93fe('0x2e')](_0x93fe('0x3d'))){var _0x10f207=_0x24900c[_0x93fe('0x3e')](0x0,_0x24900c[_0x93fe('0x3f')]('fullname'));_0x24900c+=','+_0x10f207+'internal';}return _0x24900c;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x59bf03,_0x51ec5d){var _0x447965=_0x59bf03['sort'](function(_0x22f286,_0xd9e9f2){if(_0x22f286[_0x93fe('0x36')]===_0xd9e9f2[_0x93fe('0x36')]){if(_0x22f286[_0x93fe('0x36')]===_0x93fe('0x12')){if(_0x51ec5d===_0x93fe('0x3a')){return(_0x22f286[_0x93fe('0x34')]||'')<(_0xd9e9f2[_0x93fe('0x34')]||'')||_0x22f286[_0x93fe('0x33')][_0x93fe('0x40')]()>_0xd9e9f2[_0x93fe('0x33')][_0x93fe('0x40')]()?0x1:-0x1;}else{return(_0x22f286['pauseType']||'')<(_0xd9e9f2['pauseType']||'')||_0x22f286[_0x93fe('0x33')][_0x93fe('0x40')]()>_0xd9e9f2[_0x93fe('0x33')][_0x93fe('0x40')]()?-0x1:0x1;}}else{if(_0x51ec5d==='DESC'){return _0x22f286[_0x93fe('0x33')][_0x93fe('0x40')]()<_0xd9e9f2[_0x93fe('0x33')][_0x93fe('0x40')]()?0x1:-0x1;}else{return _0x22f286['fullname'][_0x93fe('0x40')]()<_0xd9e9f2[_0x93fe('0x33')][_0x93fe('0x40')]()?-0x1:0x1;}}}else{if(_0x51ec5d===_0x93fe('0x3a')){return _0x22f286['globalStatus']<_0xd9e9f2[_0x93fe('0x36')]?0x1:-0x1;}else{return _0x22f286[_0x93fe('0x36')]<_0xd9e9f2[_0x93fe('0x36')]?-0x1:0x1;}}});return _0x447965;}exports[_0x93fe('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x213a5e){var _0x5dd72b=[_0x93fe('0x42'),_0x93fe('0x43'),_0x93fe('0x44'),_0x93fe('0x45'),'pauseType',_0x93fe('0x45'),_0x93fe('0x3d'),_0x93fe('0x46'),_0x93fe('0x3'),_0x93fe('0x6'),'mailPause',_0x93fe('0x7'),_0x93fe('0x9'),'faxPause',_0x93fe('0x8'),_0x93fe('0x47'),_0x93fe('0x48'),_0x93fe('0x49'),_0x93fe('0x4a'),'whatsappCapacity','faxCapacity',_0x93fe('0x4b'),_0x93fe('0x4c'),_0x93fe('0x4d'),_0x93fe('0x4e'),'whatsappCurrentCapacity',_0x93fe('0x4f'),_0x93fe('0x13'),_0x93fe('0x16'),'mailStatus','smsStatus',_0x93fe('0x50'),_0x93fe('0x14'),_0x93fe('0x11'),_0x93fe('0x51'),_0x93fe('0x52'),_0x93fe('0x53'),_0x93fe('0x54'),_0x93fe('0x55'),_0x93fe('0x56'),_0x93fe('0x57'),_0x93fe('0x58'),_0x93fe('0x59'),_0x93fe('0x5a'),'phoneBarEnableScreenRecordingByAgent',_0x93fe('0x5b'),'routealias'];var _0x3ea260=[_0x93fe('0x3'),_0x93fe('0x6'),_0x93fe('0x5'),_0x93fe('0x7'),'whatsappPause',_0x93fe('0x4'),'voicePause',_0x93fe('0x43')];var _0x1c46da=_(_0x213a5e)[_0x93fe('0x5c')](_0x3ea260)[_0x93fe('0x5d')](_0x5dd72b)[_0x93fe('0x2c')]();return _0x1c46da;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index cda3b46..68fbb54 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 _0x9d89=['voice','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','paused','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime'];(function(_0xa1f3d9,_0x2a0fa4){var _0x5dcb0a=function(_0x52c7dd){while(--_0x52c7dd){_0xa1f3d9['push'](_0xa1f3d9['shift']());}};_0x5dcb0a(++_0x2a0fa4);}(_0x9d89,0x10b));var _0x99d8=function(_0x2fc8c0,_0x58163a){_0x2fc8c0=_0x2fc8c0-0x0;var _0x29041b=_0x9d89[_0x2fc8c0];return _0x29041b;};'use strict';var _=require(_0x99d8('0x0'));var jayson=require(_0x99d8('0x1'));var util=require(_0x99d8('0x2'));var amiClient=jayson[_0x99d8('0x3')][_0x99d8('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x99d8('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x99d8('0x5'),_0x99d8('0x6'),'paused',_0x99d8('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x99d8('0x8'),_0x99d8('0x9'),_0x99d8('0xa'),_0x99d8('0xb'),_0x99d8('0xc'),_0x99d8('0xd'),'ringing',_0x99d8('0xe'),_0x99d8('0xf'),_0x99d8('0x10'),_0x99d8('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x99d8('0x12'),_0x99d8('0x13'),'message',_0x99d8('0x14'),'dialActive',_0x99d8('0x15'),_0x99d8('0x16'),_0x99d8('0x17'),'startProgressive',_0x99d8('0x18'),_0x99d8('0x19'),_0x99d8('0x1a'),'erlangBusyFactor',_0x99d8('0x1b'),_0x99d8('0x1c'),_0x99d8('0x1d'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x99d8('0x1e'),'predictiveIntervalDroppedCallsTimeout',_0x99d8('0x1f'),_0x99d8('0x20'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x120e52,_0x52a1de){var _0x5411af=_0x52a1de===_0x99d8('0x21')?amiClient:routingClient;return _0x5411af[_0x99d8('0x22')](_[_0x99d8('0x23')](_0x52a1de)+_0x99d8('0x24'),_0x120e52)['then'](function(_0x163943){if(_0x163943[_0x99d8('0x25')])throw new Error(util[_0x99d8('0x26')](_0x99d8('0x27'),_0x52a1de));return _0x163943[_0x99d8('0x28')];})['catch'](function(_0x3fdfa8){throw _0x3fdfa8;});}exports[_0x99d8('0x29')]=getRealtimeQueues;function initializeQueues(_0x9fee35,_0x3e1259,_0x5b9575,_0x2bf994){var _0x5c8479=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5b9575==='voice'){if(_0x2bf994===_0x99d8('0x2a')){_0x5c8479=_0x5c8479['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2bf994==='outbound'){_0x5c8479=_0x5c8479[_0x99d8('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x9fee35['map'](function(_0x25080c){var _0x4eaaf7=_0x25080c['get']({'plain':!![]});_0x4eaaf7[_0x99d8('0x2c')]=0x0;_0x4eaaf7[_0x99d8('0xb')]=0x0;_0x4eaaf7[_0x99d8('0x6')]=0x0;_0x4eaaf7['available']=0x0;_0x4eaaf7[_0x99d8('0x7')]=0x0;if(_0x5b9575==='voice'){_0x4eaaf7[_0x99d8('0xf')]=0x0;_0x4eaaf7[_0x99d8('0x8')]=0x0;if(_0x2bf994===_0x99d8('0x2d')){_0x4eaaf7['pTalking']=0x0;_0x4eaaf7[_0x99d8('0x13')]=0x0;}}var _0x399c60=_[_0x99d8('0x2e')](_0x3e1259,['id',_0x4eaaf7['id']]);if(_0x399c60){_[_0x99d8('0x2f')](_0x4eaaf7,_[_0x99d8('0x30')](_0x399c60,_0x5c8479));}return _0x4eaaf7;});}exports[_0x99d8('0x31')]=initializeQueues; \ No newline at end of file +var _0x532f=['lodash','jayson/promise','http','client','available','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','message','dialMethod','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','then','error','format','catch','getRealtimeQueues','concat','outbound','map','get','waiting','pTalking','originated','pick'];(function(_0x1e45f6,_0x39afc9){var _0x54c780=function(_0x10f8f5){while(--_0x10f8f5){_0x1e45f6['push'](_0x1e45f6['shift']());}};_0x54c780(++_0x39afc9);}(_0x532f,0x11a));var _0xf532=function(_0x39b28b,_0x384002){_0x39b28b=_0x39b28b-0x0;var _0x28a46b=_0x532f[_0x39b28b];return _0x28a46b;};'use strict';var _=require(_0xf532('0x0'));var jayson=require(_0xf532('0x1'));var util=require('util');var amiClient=jayson['client'][_0xf532('0x2')]({'port':0x232a});var routingClient=jayson[_0xf532('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xf532('0x4'),_0xf532('0x5'),_0xf532('0x6'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xf532('0x7'),_0xf532('0x8'),_0xf532('0x9'),_0xf532('0xa'),_0xf532('0xb'),_0xf532('0xc'),_0xf532('0xd'),_0xf532('0xe'),_0xf532('0xf'),_0xf532('0x10'),_0xf532('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0xf532('0x12'),'statusMessage','dialActive',_0xf532('0x13'),'Trunk',_0xf532('0x14'),'startProgressive',_0xf532('0x15'),_0xf532('0x16'),_0xf532('0x17'),_0xf532('0x18'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xf532('0x19'),_0xf532('0x1a'),'predictiveIntervalTotalCalls',_0xf532('0x1b'),_0xf532('0x1c'),_0xf532('0x1d'),_0xf532('0x1e'),_0xf532('0x1f')];function getRealtimeQueues(_0x43b390,_0xb7d0b5){var _0x12932b=_0xb7d0b5===_0xf532('0x20')?amiClient:routingClient;return _0x12932b['request'](_['startCase'](_0xb7d0b5)+_0xf532('0x21'),_0x43b390)[_0xf532('0x22')](function(_0x5acdc0){if(_0x5acdc0[_0xf532('0x23')])throw new Error(util[_0xf532('0x24')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xb7d0b5));return _0x5acdc0['result'];})[_0xf532('0x25')](function(_0x241bac){throw _0x241bac;});}exports[_0xf532('0x26')]=getRealtimeQueues;function initializeQueues(_0x5301f3,_0x367f09,_0x2c9c4f,_0x3c9c1c){var _0x2af98e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2c9c4f===_0xf532('0x20')){if(_0x3c9c1c==='inbound'){_0x2af98e=_0x2af98e[_0xf532('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3c9c1c===_0xf532('0x28')){_0x2af98e=_0x2af98e[_0xf532('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5301f3[_0xf532('0x29')](function(_0x200152){var _0x11be43=_0x200152[_0xf532('0x2a')]({'plain':!![]});_0x11be43[_0xf532('0x6')]=0x0;_0x11be43['loggedInDb']=0x0;_0x11be43[_0xf532('0x5')]=0x0;_0x11be43['available']=0x0;_0x11be43[_0xf532('0x2b')]=0x0;if(_0x2c9c4f===_0xf532('0x20')){_0x11be43['talking']=0x0;_0x11be43[_0xf532('0x7')]=0x0;if(_0x3c9c1c===_0xf532('0x28')){_0x11be43[_0xf532('0x2c')]=0x0;_0x11be43[_0xf532('0x2d')]=0x0;}}var _0x45c81d=_['find'](_0x367f09,['id',_0x11be43['id']]);if(_0x45c81d){_['merge'](_0x11be43,_[_0xf532('0x2e')](_0x45c81d,_0x2af98e));}return _0x11be43;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 473ffd0..302bd5c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x599aaf,_0x3d3622){var _0xd995f3=function(_0x19825e){while(--_0x19825e){_0x599aaf['push'](_0x599aaf['shift']());}};_0xd995f3(++_0x3d3622);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5e1591,_0x597776){var _0x33d511=function(_0x416120){while(--_0x416120){_0x5e1591['push'](_0x5e1591['shift']());}};_0x33d511(++_0x597776);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a330ebf..9097017 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 _0x2468=['macAddress','ipAddress','createHash','md5','update','digest','substring','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','filter','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','hex','getUuid','platform','test','licenseToken','dmidecode\x20--string\x20system-uuid','hostname'];(function(_0x1b5f64,_0x13e900){var _0x1a249e=function(_0x4d829b){while(--_0x4d829b){_0x1b5f64['push'](_0x1b5f64['shift']());}};_0x1a249e(++_0x13e900);}(_0x2468,0x1d7));var _0x8246=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x2468[_0x934425];return _0x31d596;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x8246('0x0'));var exec=require(_0x8246('0x1'))['execSync'];var config=require(_0x8246('0x2'));function getInterfaces(){var _0xed3e12=[];var _0x28f3fb=os[_0x8246('0x3')]();var _0x150739=_[_0x8246('0x4')](_['keys'](_0x28f3fb));for(var _0x37fb69=0x0;_0x37fb69<_0x150739['length'];_0x37fb69++){var _0x57db16=_0x28f3fb[_0x150739[_0x37fb69]][_0x8246('0x5')](function(_0x1871d7){return _0x1871d7['family']==='IPv4'&&_0x1871d7['internal']===![];});_0xed3e12=_0xed3e12[_0x8246('0x6')](_0x57db16);}return _0xed3e12;}function getFirstInterface(){var _0x1b61f0=_[_0x8246('0x7')](getInterfaces());return{'macAddress':_0x1b61f0&&_0x1b61f0[_0x8246('0x8')]?_0x1b61f0['mac']:_0x8246('0x9'),'ipAddress':_0x1b61f0&&_0x1b61f0['address']?_0x1b61f0[_0x8246('0xa')]:_0x8246('0xb')};}exports[_0x8246('0xc')]=getFirstInterface;function getCPUhash(){var _0x26c47=_[_0x8246('0x4')](os['cpus']()[_0x8246('0xd')](function(_0x51a7a1){return _0x51a7a1['model'];}))[_0x8246('0xe')](':');return crypto['createHash']('md5')['update'](_0x26c47)['digest'](_0x8246('0xf'));}exports[_0x8246('0x10')]=function(){var _0x4c9b37=os[_0x8246('0x11')]();var _0x54fc6f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x54fc6f[_0x8246('0x12')](config[_0x8246('0x13')])){return config[_0x8246('0x13')];}else if(_0x4c9b37==='win32'){return exec(_0x8246('0x14'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x59cb48=getFirstInterface();var _0x24b496=getCPUhash();var _0x427073=_0x24b496+'|'+os[_0x8246('0x15')]()+'|'+_0x59cb48[_0x8246('0x16')]+'|'+_0x59cb48[_0x8246('0x17')];var _0x347034=crypto[_0x8246('0x18')](_0x8246('0x19'))[_0x8246('0x1a')](_0x427073)[_0x8246('0x1b')](_0x8246('0xf'));return _0x347034[_0x8246('0x1c')](0x0,0x8)+'-'+_0x347034[_0x8246('0x1c')](0x8,0xc)+'-'+_0x347034[_0x8246('0x1c')](0xc,0x10)+'-'+_0x347034[_0x8246('0x1c')](0x10,0x14)+'-'+_0x347034['substring'](0x14);}}; \ No newline at end of file +var _0xfb3b=['getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','createHash','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','cpus','map','model','join','md5','update','digest'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xfb3b,0x1e7));var _0xbfb3=function(_0x1e465d,_0xd05d9c){_0x1e465d=_0x1e465d-0x0;var _0x5bd471=_0xfb3b[_0x1e465d];return _0x5bd471;};'use strict';var _=require(_0xbfb3('0x0'));var os=require('os');var crypto=require(_0xbfb3('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xbfb3('0x2'))[_0xbfb3('0x3')];var config=require(_0xbfb3('0x4'));function getInterfaces(){var _0x45680d=[];var _0x36ebc2=os[_0xbfb3('0x5')]();var _0x314804=_[_0xbfb3('0x6')](_[_0xbfb3('0x7')](_0x36ebc2));for(var _0x5570ed=0x0;_0x5570ed<_0x314804['length'];_0x5570ed++){var _0x5a29d8=_0x36ebc2[_0x314804[_0x5570ed]][_0xbfb3('0x8')](function(_0x2c8d10){return _0x2c8d10['family']===_0xbfb3('0x9')&&_0x2c8d10[_0xbfb3('0xa')]===![];});_0x45680d=_0x45680d[_0xbfb3('0xb')](_0x5a29d8);}return _0x45680d;}function getFirstInterface(){var _0x50572f=_[_0xbfb3('0xc')](getInterfaces());return{'macAddress':_0x50572f&&_0x50572f[_0xbfb3('0xd')]?_0x50572f[_0xbfb3('0xd')]:_0xbfb3('0xe'),'ipAddress':_0x50572f&&_0x50572f['address']?_0x50572f[_0xbfb3('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x595cdc=_[_0xbfb3('0x6')](os[_0xbfb3('0x10')]()[_0xbfb3('0x11')](function(_0x55aaaa){return _0x55aaaa[_0xbfb3('0x12')];}))[_0xbfb3('0x13')](':');return crypto['createHash'](_0xbfb3('0x14'))[_0xbfb3('0x15')](_0x595cdc)[_0xbfb3('0x16')]('hex');}exports[_0xbfb3('0x17')]=function(){var _0x552178=os[_0xbfb3('0x18')]();var _0xfa6bc=/[0-9a-f-]{36}/;if(config[_0xbfb3('0x19')]&&_0xfa6bc[_0xbfb3('0x1a')](config[_0xbfb3('0x19')])){return config[_0xbfb3('0x19')];}else if(_0x552178==='win32'){return exec(_0xbfb3('0x1b'),{'encoding':_0xbfb3('0x1c')})[_0xbfb3('0x1d')]('\x0d\x0a','');}else{var _0x55fa26=getFirstInterface();var _0x1f9fa7=getCPUhash();var _0x4b007c=_0x1f9fa7+'|'+os[_0xbfb3('0x1e')]()+'|'+_0x55fa26['macAddress']+'|'+_0x55fa26['ipAddress'];var _0x488fd9=crypto[_0xbfb3('0x1f')](_0xbfb3('0x14'))['update'](_0x4b007c)['digest'](_0xbfb3('0x20'));return _0x488fd9[_0xbfb3('0x21')](0x0,0x8)+'-'+_0x488fd9[_0xbfb3('0x21')](0x8,0xc)+'-'+_0x488fd9[_0xbfb3('0x21')](0xc,0x10)+'-'+_0x488fd9[_0xbfb3('0x21')](0x10,0x14)+'-'+_0x488fd9['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c5d4259..1443826 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 _0xd91b=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','catch','get','data1','then','license','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','info','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x5c22aa,_0x47d389){var _0x4d9a6f=function(_0x41b02d){while(--_0x41b02d){_0x5c22aa['push'](_0x5c22aa['shift']());}};_0x4d9a6f(++_0x47d389);}(_0xd91b,0x125));var _0xbd91=function(_0x4b9530,_0x11a96e){_0x4b9530=_0x4b9530-0x0;var _0x2dc41a=_0xd91b[_0x4b9530];return _0x2dc41a;};'use strict';var util=require(_0xbd91('0x0'));var moment=require(_0xbd91('0x1'));var rp=require(_0xbd91('0x2'));var BPromise=require(_0xbd91('0x3'));var pkginfo=require(_0xbd91('0x4'))(module,_0xbd91('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xbd91('0x6'));var hardware=require(_0xbd91('0x7'));var logger=require(_0xbd91('0x8'))('license');var HOST=_0xbd91('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xf100bf){return new BPromise(function(_0x1aeaf4,_0x19437b){var _0x41338e=util[_0xbd91('0xa')](_0xbd91('0xb'),HOST,_0xf100bf,module[_0xbd91('0xc')][_0xbd91('0x5')]);if(oldToken){_0x41338e=util[_0xbd91('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0xf100bf,module['exports']['version'],oldToken);}var _0x675a04={'uri':_0x41338e,'method':_0xbd91('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x675a04)['then'](function(_0x12171b){_0x1aeaf4(_0x12171b);})[_0xbd91('0xe')](function(_0x1e2651){_0x19437b(_0x1e2651);});});}function manageLicense(_0x3f0771,_0x55be74){var _0x1637ca=_0x55be74[_0xbd91('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1637ca[_0xbd91('0x10')]!==_0x3f0771&&!_0x1637ca['data2']){oldToken=_0x1637ca[_0xbd91('0x10')];}httpRequest(_0x3f0771)[_0xbd91('0x11')](function(_0x399ee8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x399ee8['active']){isOldTokenSent=![];if(!_0x1637ca[_0xbd91('0x12')]&&_0x1637ca[_0xbd91('0x12')]!=_0x399ee8[_0xbd91('0x12')]||_0x1637ca[_0xbd91('0x12')]&&_0x1637ca[_0xbd91('0x13')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x1637ca[_0xbd91('0x12')]&&!_0x1637ca[_0xbd91('0x13')]&&_0x1637ca['license']!=_0x399ee8[_0xbd91('0x12')]){logger['info'](_0xbd91('0x14'));}if(_0x1637ca[_0xbd91('0x12')]&&!_0x1637ca[_0xbd91('0x13')]&&_0x1637ca['license']==_0x399ee8['license']){return _0x55be74;}return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':_0x399ee8[_0xbd91('0x12')]});}else{if(_0x399ee8[_0xbd91('0x12')]||_0x1637ca[_0xbd91('0x12')]){if(!_0x1637ca[_0xbd91('0x13')]){if(_0x1637ca[_0xbd91('0x10')]==_0x3f0771){GRAY_PERIOD_REASON=_0xbd91('0x16');logger['info'](_0xbd91('0x17'));}else{GRAY_PERIOD_REASON=_0xbd91('0x18');logger[_0xbd91('0x19')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1637ca[_0xbd91('0x10')],_0x3f0771);}logger[_0xbd91('0x19')](_0xbd91('0x1a'),GRAY_PERIOD_REASON[_0xbd91('0x1b')](),moment()['format'](_0xbd91('0x1c')));return _0x55be74['update']({'data2':encryptor[_0xbd91('0x1d')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xbd91('0x1e')](encryptor['decryptString'](_0x1637ca[_0xbd91('0x13')]),_0xbd91('0x1f'))>DAYS){logger['info'](_0xbd91('0x20'),moment()['format'](_0xbd91('0x1c')));isOldTokenSent=![];return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':null});}}}else{if(_0x1637ca[_0xbd91('0x10')]!=_0x3f0771){logger[_0xbd91('0x19')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1637ca[_0xbd91('0x10')],_0x3f0771);return _0x55be74[_0xbd91('0x15')]({'data1':_0x3f0771,'data2':null,'license':null});}}}return _0x55be74;})['then'](function(_0x1a053a){_0x55be74=_0x1a053a;})[_0xbd91('0xe')](function(_0x5e8d55){logger[_0xbd91('0x21')](_0x5e8d55[_0xbd91('0x22')]);})[_0xbd91('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xbd91('0x24')](),_0x55be74);},TIME);});}function defaultLicense(){var _0x4216fc=hardware['getUuid']();if(_0x4216fc){return db[_0xbd91('0x25')][_0xbd91('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x4216fc}})[_0xbd91('0x27')](function(_0x2e72c4,_0x24ed7e){logger[_0xbd91('0x19')](_0xbd91('0x28'),_0x4216fc);manageLicense(_0x4216fc,_0x2e72c4);})['catch'](function(_0x5823bd){logger[_0xbd91('0x21')](_0x5823bd[_0xbd91('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x97ac=['format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','update','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com'];(function(_0x2aa48c,_0x21c556){var _0x424fc4=function(_0x2f821c){while(--_0x2f821c){_0x2aa48c['push'](_0x2aa48c['shift']());}};_0x424fc4(++_0x21c556);}(_0x97ac,0x1e2));var _0xc97a=function(_0x130039,_0x2e15db){_0x130039=_0x130039-0x0;var _0x13ce4b=_0x97ac[_0x130039];return _0x13ce4b;};'use strict';var util=require(_0xc97a('0x0'));var moment=require(_0xc97a('0x1'));var rp=require(_0xc97a('0x2'));var BPromise=require(_0xc97a('0x3'));var pkginfo=require(_0xc97a('0x4'))(module,_0xc97a('0x5'));var db=require(_0xc97a('0x6'))['db'];var encryptor=require(_0xc97a('0x7'));var hardware=require(_0xc97a('0x8'));var logger=require(_0xc97a('0x9'))(_0xc97a('0xa'));var HOST=_0xc97a('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x6f07e){return new BPromise(function(_0x46ffdb,_0x242514){var _0x48d4ee=util[_0xc97a('0xc')]('%s/api/servers/%s/check?version=%s',HOST,_0x6f07e,module[_0xc97a('0xd')][_0xc97a('0x5')]);if(oldToken){_0x48d4ee=util['format'](_0xc97a('0xe'),HOST,_0x6f07e,module[_0xc97a('0xd')][_0xc97a('0x5')],oldToken);}var _0x9d4a16={'uri':_0x48d4ee,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x9d4a16)['then'](function(_0x230102){_0x46ffdb(_0x230102);})[_0xc97a('0xf')](function(_0x1f74e5){_0x242514(_0x1f74e5);});});}function manageLicense(_0x4fc2b6,_0x2ef5ef){var _0x568b90=_0x2ef5ef[_0xc97a('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x568b90[_0xc97a('0x11')]!==_0x4fc2b6&&!_0x568b90[_0xc97a('0x12')]){oldToken=_0x568b90[_0xc97a('0x11')];}httpRequest(_0x4fc2b6)['then'](function(_0x3eb9f8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3eb9f8[_0xc97a('0x13')]){isOldTokenSent=![];if(!_0x568b90[_0xc97a('0xa')]&&_0x568b90['license']!=_0x3eb9f8['license']||_0x568b90['license']&&_0x568b90['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x568b90[_0xc97a('0xa')]&&!_0x568b90[_0xc97a('0x12')]&&_0x568b90[_0xc97a('0xa')]!=_0x3eb9f8[_0xc97a('0xa')]){logger[_0xc97a('0x14')](_0xc97a('0x15'));}if(_0x568b90['license']&&!_0x568b90[_0xc97a('0x12')]&&_0x568b90[_0xc97a('0xa')]==_0x3eb9f8[_0xc97a('0xa')]){return _0x2ef5ef;}return _0x2ef5ef['update']({'data1':_0x4fc2b6,'data2':null,'license':_0x3eb9f8['license']});}else{if(_0x3eb9f8['license']||_0x568b90[_0xc97a('0xa')]){if(!_0x568b90['data2']){if(_0x568b90['data1']==_0x4fc2b6){GRAY_PERIOD_REASON=_0xc97a('0x16');logger[_0xc97a('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xc97a('0x17');logger[_0xc97a('0x14')](_0xc97a('0x18'),_0x568b90['data1'],_0x4fc2b6);}logger[_0xc97a('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xc97a('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x2ef5ef[_0xc97a('0x19')]({'data2':encryptor['encryptString'](moment()[_0xc97a('0xc')](_0xc97a('0x1a')))});}else{if(moment()['diff'](encryptor[_0xc97a('0x1b')](_0x568b90['data2']),_0xc97a('0x1c'))>DAYS){logger[_0xc97a('0x14')](_0xc97a('0x1d'),moment()[_0xc97a('0xc')](_0xc97a('0x1a')));isOldTokenSent=![];return _0x2ef5ef['update']({'data1':_0x4fc2b6,'data2':null,'license':null});}}}else{if(_0x568b90[_0xc97a('0x11')]!=_0x4fc2b6){logger[_0xc97a('0x14')](_0xc97a('0x18'),_0x568b90[_0xc97a('0x11')],_0x4fc2b6);return _0x2ef5ef[_0xc97a('0x19')]({'data1':_0x4fc2b6,'data2':null,'license':null});}}}return _0x2ef5ef;})['then'](function(_0x5a83ca){_0x2ef5ef=_0x5a83ca;})[_0xc97a('0xf')](function(_0xc39777){logger[_0xc97a('0x1e')](_0xc39777[_0xc97a('0x1f')]);})[_0xc97a('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xc97a('0x21')](),_0x2ef5ef);},TIME);});}function defaultLicense(){var _0x2d4057=hardware['getUuid']();if(_0x2d4057){return db[_0xc97a('0x22')][_0xc97a('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x2d4057}})[_0xc97a('0x24')](function(_0x2036bb,_0x411598){logger[_0xc97a('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2d4057);manageLicense(_0x2d4057,_0x2036bb);})[_0xc97a('0xf')](function(_0x231e73){logger[_0xc97a('0x1e')](_0x231e73[_0xc97a('0x1f')]);});}}exports[_0xc97a('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 37eed80..f3a8e42 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 _0xf447=['add','grayReason','uuid','changed','disabled','User','role','sequelize','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','defaults','then','catch','license','isEmpty','data1','split','format','parse','demo','machineUuid','decryptString','gray','deadline'];(function(_0x22efd6,_0x1e9599){var _0x442a6a=function(_0x53d328){while(--_0x53d328){_0x22efd6['push'](_0x22efd6['shift']());}};_0x442a6a(++_0x1e9599);}(_0xf447,0x69));var _0x7f44=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xf447[_0xfa634c];return _0x73e478;};'use strict';var util=require('util');var _=require(_0x7f44('0x0'));var moment=require(_0x7f44('0x1'));var BPromise=require('bluebird');var hardware=require(_0x7f44('0x2'));var encryptor=require(_0x7f44('0x3'));var db=require(_0x7f44('0x4'))['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':_0x7f44('0x5'),'machineUuid':hardware[_0x7f44('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7f44('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x7f44('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x20482f){return new BPromise(function(_0x3f6827,_0x55f21e){return db[_0x7f44('0x8')][_0x7f44('0x9')](_[_0x7f44('0xa')](_0x20482f,{'raw':!![],'where':{'id':0x1}}))[_0x7f44('0xb')](function(_0x3eb9aa){return checkLicense(_0x3eb9aa,null);})[_0x7f44('0xb')](function(_0x504f8b){_0x3f6827(_0x504f8b);return;})[_0x7f44('0xc')](function(_0x4fcb9f){_0x55f21e(_0x4fcb9f);});});}function checkLicense(_0x5b9dda,_0x3295ae){if(!_0x5b9dda){demoLicense['uuid']=_0x5b9dda['data1'];return demoLicense;}try{var _0x3a69d6=_0x3295ae||_0x5b9dda[_0x7f44('0xd')];if(_[_0x7f44('0xe')](_0x3a69d6)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x40ca33=_0x5b9dda[_0x7f44('0xf')];var _0x405a68=_0x5b9dda['data2'];var _0x4d15ef=_0x40ca33[_0x7f44('0x10')]('-')[0x4];var _0x23aef4=_0x40ca33[_0x7f44('0x10')]('-')[0x0];var _0x21a001=encryptor['decryptString'](_0x3a69d6,util[_0x7f44('0x11')]('%s:%s:%s',_0x4d15ef,_0x40ca33,_0x23aef4));var _0x749886=JSON[_0x7f44('0x12')](_0x21a001);_0x749886[_0x7f44('0x13')]=![];_0x749886['uuid']=_0x40ca33;_0x749886[_0x7f44('0x14')]=hardware['getUuid']();if(_0x405a68){var _0x1484f3=encryptor[_0x7f44('0x15')](_0x405a68);_0x749886[_0x7f44('0x16')]=_0x1484f3;_0x749886[_0x7f44('0x17')]=moment(_0x1484f3)[_0x7f44('0x18')](0x7,'days')['format']();_0x749886[_0x7f44('0x19')]=_0x749886[_0x7f44('0x1a')]!=_0x749886['machineUuid']?_0x7f44('0x1b'):_0x7f44('0x1c');}return _0x749886;}catch(_0x5f37f3){breakingLicense[_0x7f44('0x1a')]=_0x5b9dda[_0x7f44('0xf')];breakingLicense['message']=_0x5f37f3['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x558bb1,_0x4b2ca8){getLicense()['then'](function(_0x264de6){return db[_0x7f44('0x1d')]['findAll']({'attributes':[_0x7f44('0x1e'),[db[_0x7f44('0x1f')]['fn']('COUNT',db[_0x7f44('0x1f')]['col'](_0x7f44('0x1e'))),_0x7f44('0x20')]],'group':_0x7f44('0x1e'),'where':{'role':{'$or':[_0x7f44('0x21'),'user',_0x7f44('0x22')]}},'raw':!![]})['then'](function(_0x49b534){var _0x31dc59={'user':_0x264de6[_0x7f44('0x23')]||0x0,'telephone':_0x264de6[_0x7f44('0x24')]||0x0};_0x49b534[_0x7f44('0x25')](function(_0x35333e){var _0x550c6e=_0x35333e['role']===_0x7f44('0x21')?_0x7f44('0x26'):_0x35333e[_0x7f44('0x1e')];_0x31dc59[_0x550c6e]-=_0x35333e[_0x7f44('0x20')];if(_0x31dc59[_0x550c6e]<0x0)_0x31dc59[_0x550c6e]=0x0;});_0x558bb1(_0x31dc59);return;});})[_0x7f44('0xc')](function(_0x2db4be){_0x4b2ca8(_0x2db4be);});});}function checkUserLimits(_0x92191a){return new BPromise(function(_0x364b78,_0x198460){getLimits()['then'](function(_0x2d94ae){var _0x31c8d4=_[_0x7f44('0x27')](_[_0x7f44('0x28')](_0x92191a,_0x7f44('0x1e')),[_0x7f44('0x21'),_0x7f44('0x26'),_0x7f44('0x22')]);var _0x1a3432=(_0x31c8d4[_0x7f44('0x21')]||0x0)+(_0x31c8d4[_0x7f44('0x26')]||0x0);var _0x4c7405=_0x31c8d4[_0x7f44('0x22')]||0x0;if(_0x1a3432>_0x2d94ae[_0x7f44('0x26')])return _0x198460('License\x20limit\x20reached\x20for\x20users');if(_0x4c7405>_0x2d94ae[_0x7f44('0x22')])return _0x198460(_0x7f44('0x29'));return _0x364b78();})['catch'](function(_0x3910fe){_0x198460(_0x3910fe);});});}module[_0x7f44('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb60e=['format','%s:%s:%s','parse','demo','machineUuid','getUuid','decryptString','gray','deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','uuid','license','data1','data2','split'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb60e,0xa1));var _0xeb60=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0xb60e[_0x29f014];return _0x316be5;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require(_0xeb60('0x0'));var hardware=require(_0xeb60('0x1'));var encryptor=require(_0xeb60('0x2'));var db=require(_0xeb60('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeb60('0x4'),'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':_0xeb60('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xeb60('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x11c9d4){return new BPromise(function(_0x2d8bb6,_0x2513a4){return db[_0xeb60('0x6')][_0xeb60('0x7')](_['defaults'](_0x11c9d4,{'raw':!![],'where':{'id':0x1}}))[_0xeb60('0x8')](function(_0x44766f){return checkLicense(_0x44766f,null);})[_0xeb60('0x8')](function(_0x266911){_0x2d8bb6(_0x266911);return;})[_0xeb60('0x9')](function(_0x2fee0b){_0x2513a4(_0x2fee0b);});});}function checkLicense(_0x56906c,_0x517672){if(!_0x56906c){demoLicense[_0xeb60('0xa')]=_0x56906c['data1'];return demoLicense;}try{var _0x30b3f1=_0x517672||_0x56906c[_0xeb60('0xb')];if(_['isEmpty'](_0x30b3f1)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x201ec3=_0x56906c[_0xeb60('0xc')];var _0x39f0e5=_0x56906c[_0xeb60('0xd')];var _0x3c4ef4=_0x201ec3['split']('-')[0x4];var _0x38572f=_0x201ec3[_0xeb60('0xe')]('-')[0x0];var _0x4ce862=encryptor['decryptString'](_0x30b3f1,util[_0xeb60('0xf')](_0xeb60('0x10'),_0x3c4ef4,_0x201ec3,_0x38572f));var _0x380773=JSON[_0xeb60('0x11')](_0x4ce862);_0x380773[_0xeb60('0x12')]=![];_0x380773[_0xeb60('0xa')]=_0x201ec3;_0x380773[_0xeb60('0x13')]=hardware[_0xeb60('0x14')]();if(_0x39f0e5){var _0x5e2f20=encryptor[_0xeb60('0x15')](_0x39f0e5);_0x380773[_0xeb60('0x16')]=_0x5e2f20;_0x380773[_0xeb60('0x17')]=moment(_0x5e2f20)[_0xeb60('0x18')](0x7,_0xeb60('0x19'))[_0xeb60('0xf')]();_0x380773[_0xeb60('0x1a')]=_0x380773[_0xeb60('0xa')]!=_0x380773[_0xeb60('0x13')]?'changed':_0xeb60('0x1b');}return _0x380773;}catch(_0x1ee48b){breakingLicense[_0xeb60('0xa')]=_0x56906c[_0xeb60('0xc')];breakingLicense[_0xeb60('0x1c')]=_0x1ee48b[_0xeb60('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xe9a113,_0x32cd7e){getLicense()[_0xeb60('0x8')](function(_0x4e3e8e){return db[_0xeb60('0x1d')][_0xeb60('0x1e')]({'attributes':[_0xeb60('0x1f'),[db[_0xeb60('0x20')]['fn'](_0xeb60('0x21'),db[_0xeb60('0x20')][_0xeb60('0x22')](_0xeb60('0x1f'))),'count']],'group':_0xeb60('0x1f'),'where':{'role':{'$or':[_0xeb60('0x23'),_0xeb60('0x24'),_0xeb60('0x25')]}},'raw':!![]})['then'](function(_0x46833e){var _0x440f5d={'user':_0x4e3e8e[_0xeb60('0x26')]||0x0,'telephone':_0x4e3e8e['telephones']||0x0};_0x46833e[_0xeb60('0x27')](function(_0x1d6c78){var _0x12f44b=_0x1d6c78['role']===_0xeb60('0x23')?_0xeb60('0x24'):_0x1d6c78[_0xeb60('0x1f')];_0x440f5d[_0x12f44b]-=_0x1d6c78[_0xeb60('0x28')];if(_0x440f5d[_0x12f44b]<0x0)_0x440f5d[_0x12f44b]=0x0;});_0xe9a113(_0x440f5d);return;});})[_0xeb60('0x9')](function(_0x30b9a5){_0x32cd7e(_0x30b9a5);});});}function checkUserLimits(_0x5a38ee){return new BPromise(function(_0x48faed,_0x4b3f22){getLimits()[_0xeb60('0x8')](function(_0x35f113){var _0x461d34=_[_0xeb60('0x29')](_[_0xeb60('0x2a')](_0x5a38ee,_0xeb60('0x1f')),[_0xeb60('0x23'),'user','telephone']);var _0x1bf35f=(_0x461d34[_0xeb60('0x23')]||0x0)+(_0x461d34[_0xeb60('0x24')]||0x0);var _0x121d3b=_0x461d34['telephone']||0x0;if(_0x1bf35f>_0x35f113[_0xeb60('0x24')])return _0x4b3f22(_0xeb60('0x2b'));if(_0x121d3b>_0x35f113[_0xeb60('0x25')])return _0x4b3f22('License\x20limit\x20reached\x20for\x20telephones');return _0x48faed();})[_0xeb60('0x9')](function(_0x5d54b3){_0x4b3f22(_0x5d54b3);});});}module['exports']={'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 e4ca65e..383743c 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 _0x32b6=['secret','exports','http://localhost:9000','app-id'];(function(_0x1c8d06,_0x544dd3){var _0x5bf0b6=function(_0x120113){while(--_0x120113){_0x1c8d06['push'](_0x1c8d06['shift']());}};_0x5bf0b6(++_0x544dd3);}(_0x32b6,0x1d1));var _0x632b=function(_0x343294,_0x5b384e){_0x343294=_0x343294-0x0;var _0xca5e9a=_0x32b6[_0x343294];return _0xca5e9a;};'use strict';module[_0x632b('0x0')]={'DOMAIN':_0x632b('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x632b('0x2'),'GOOGLE_SECRET':_0x632b('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x1893=['myappanuglar-secret','app-id','secret'];(function(_0x3e284d,_0x42c938){var _0x278746=function(_0xde3859){while(--_0xde3859){_0x3e284d['push'](_0x3e284d['shift']());}};_0x278746(++_0x42c938);}(_0x1893,0xa2));var _0x3189=function(_0x4e7b37,_0x33b1fa){_0x4e7b37=_0x4e7b37-0x0;var _0x20b707=_0x1893[_0x4e7b37];return _0x20b707;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3189('0x0'),'GOOGLE_ID':_0x3189('0x1'),'GOOGLE_SECRET':_0x3189('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 867352a..46cfa91 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc20=['../utils/loggers','fileLogger'];(function(_0x2d2226,_0x49f48e){var _0x32aef1=function(_0x105d12){while(--_0x105d12){_0x2d2226['push'](_0x2d2226['shift']());}};_0x32aef1(++_0x49f48e);}(_0xcc20,0x96));var _0x0cc2=function(_0x54735c,_0x11765c){_0x54735c=_0x54735c-0x0;var _0x402cb3=_0xcc20[_0x54735c];return _0x402cb3;};'use strict';var fileLogger=require(_0x0cc2('0x0'))[_0x0cc2('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0xbe82=['../utils/loggers','exports'];(function(_0x257be8,_0x16f123){var _0x21a27f=function(_0x5e4cbc){while(--_0x5e4cbc){_0x257be8['push'](_0x257be8['shift']());}};_0x21a27f(++_0x16f123);}(_0xbe82,0x156));var _0x2be8=function(_0x36a1dd,_0x1b890f){_0x36a1dd=_0x36a1dd-0x0;var _0x5b77de=_0xbe82[_0x36a1dd];return _0x5b77de;};'use strict';var fileLogger=require(_0x2be8('0x0'))['fileLogger'];module[_0x2be8('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 758d1f0..19471c4 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 _0xdd42=['../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','../../config/environment','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x459958,_0x189bb4){var _0x2bba98=function(_0x21efeb){while(--_0x21efeb){_0x459958['push'](_0x459958['shift']());}};_0x2bba98(++_0x189bb4);}(_0xdd42,0x9f));var _0x2dd4=function(_0x3510f4,_0x3da004){_0x3510f4=_0x3510f4-0x0;var _0x2f03ac=_0xdd42[_0x3510f4];return _0x2f03ac;};'use strict';var path=require('path');var cfg=require(_0x2dd4('0x0'));var env={'NODE_PATH':path['resolve'](path[_0x2dd4('0x1')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x2')),'env':env},{'name':_0x2dd4('0x3'),'script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x4')),'env':env},{'name':_0x2dd4('0x5'),'script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x6')),'env':env},{'name':_0x2dd4('0x7'),'script':path[_0x2dd4('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x2dd4('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0x2dd4('0x1')](__dirname,_0x2dd4('0x9')),'env':env}]};module[_0x2dd4('0xa')]=pm2config; \ No newline at end of file +var _0xe001=['resolve','join','root','legacy-libs','express','ami','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','../../config/environment'];(function(_0x32ad13,_0x49f4a9){var _0xfc30ff=function(_0x25996d){while(--_0x25996d){_0x32ad13['push'](_0x32ad13['shift']());}};_0xfc30ff(++_0x49f4a9);}(_0xe001,0x141));var _0x1e00=function(_0x275b16,_0xb0a60d){_0x275b16=_0x275b16-0x0;var _0x1f8ce0=_0xe001[_0x275b16];return _0x1f8ce0;};'use strict';var path=require('path');var cfg=require(_0x1e00('0x0'));var env={'NODE_PATH':path[_0x1e00('0x1')](path[_0x1e00('0x2')](cfg[_0x1e00('0x3')],_0x1e00('0x4')))};var pm2config={'apps':[{'name':_0x1e00('0x5'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x1e00('0x6'),'script':path[_0x1e00('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x1e00('0x7'),'script':path[_0x1e00('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x1e00('0x8'),'script':path['join'](__dirname,_0x1e00('0x9')),'env':env},{'name':_0x1e00('0xa'),'script':path['join'](__dirname,_0x1e00('0xb')),'env':env},{'name':_0x1e00('0xc'),'script':path[_0x1e00('0x2')](__dirname,_0x1e00('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index af0338c..90066fe 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 _0x7fb1=['stop','restart','list','describe','delete','dump','pm2','bluebird','connected','start','then','disconnect'];(function(_0x4af9dc,_0x2a0b9c){var _0x44a273=function(_0x1a5cdd){while(--_0x1a5cdd){_0x4af9dc['push'](_0x4af9dc['shift']());}};_0x44a273(++_0x2a0b9c);}(_0x7fb1,0x1ce));var _0x17fb=function(_0x5c722e,_0x83c9bd){_0x5c722e=_0x5c722e-0x0;var _0x680a07=_0x7fb1[_0x5c722e];return _0x680a07;};'use strict';var pm2=require(_0x17fb('0x0'));var BPromise=require(_0x17fb('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x53a3f1,_0x50b4d6){return pm2['connect'](function(_0xba3d42){if(_0xba3d42){return _0x50b4d6(_0xba3d42);}return _0x53a3f1(_0x17fb('0x2'));});});};exports[_0x17fb('0x3')]=function(_0x2e5058){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x58f395,_0x4b5f66){return pm2['start'](_0x2e5058,function(_0x5becf2,_0x40e1c8){if(_0x5becf2){return _0x4b5f66(_0x5becf2);}pm2[_0x17fb('0x5')]();return _0x58f395(_0x40e1c8);});});});};exports[_0x17fb('0x6')]=function(_0x3b5ebc){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x366aaa,_0x5f1f5b){return pm2[_0x17fb('0x6')](_0x3b5ebc,function(_0x5d29c2,_0x2ed4b5){if(_0x5d29c2){return _0x5f1f5b(_0x5d29c2);}pm2[_0x17fb('0x5')]();return _0x366aaa(_0x2ed4b5);});});});};exports[_0x17fb('0x7')]=function(_0x376944){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x4a33e1,_0x23bb08){return pm2['restart'](_0x376944,function(_0x56d73d,_0xe84bf9){if(_0x56d73d){return _0x23bb08(_0x56d73d);}pm2['disconnect']();return _0x4a33e1(_0xe84bf9);});});});};exports['list']=function(){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x181609,_0x18ba21){return pm2[_0x17fb('0x8')](function(_0x2d5928,_0x135856){if(_0x2d5928){return _0x18ba21(_0x2d5928);}pm2[_0x17fb('0x5')]();return _0x181609(_0x135856);});});});};exports[_0x17fb('0x9')]=function(_0x94b2e){return connect()['then'](function(){return new BPromise(function(_0x385a9f,_0x1e8d1){return pm2['describe'](_0x94b2e,function(_0x3bf3b8,_0x3c0a7c){if(_0x3bf3b8){return _0x1e8d1(_0x3bf3b8);}pm2['disconnect']();return _0x385a9f(_0x3c0a7c);});});});};exports[_0x17fb('0xa')]=function(_0x5ef570){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x518a08,_0x17786e){return pm2['delete'](_0x5ef570,function(_0x16871f,_0x872ca4){if(_0x16871f){return _0x17786e(_0x16871f);}pm2[_0x17fb('0x5')]();return _0x518a08(_0x872ca4);});});});};exports[_0x17fb('0xb')]=function(){return connect()[_0x17fb('0x4')](function(){return new BPromise(function(_0x20bf51,_0x40b48c){return pm2[_0x17fb('0xb')](function(_0x17b265){if(_0x17b265){return _0x40b48c(_0x17b265);}return _0x20bf51('saved');});});});}; \ No newline at end of file +var _0x0499=['./config','connect','connected','start','then','disconnect','stop','restart','list','delete','dump','saved'];(function(_0x75f4e1,_0xd5702a){var _0x54e8dd=function(_0x562d3c){while(--_0x562d3c){_0x75f4e1['push'](_0x75f4e1['shift']());}};_0x54e8dd(++_0xd5702a);}(_0x0499,0x6c));var _0x9049=function(_0x38aef9,_0x4d28be){_0x38aef9=_0x38aef9-0x0;var _0x2fec35=_0x0499[_0x38aef9];return _0x2fec35;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x9049('0x0'));function connect(){return new BPromise(function(_0x58e92e,_0x238ef2){return pm2[_0x9049('0x1')](function(_0x3b9e07){if(_0x3b9e07){return _0x238ef2(_0x3b9e07);}return _0x58e92e(_0x9049('0x2'));});});};exports[_0x9049('0x3')]=function(_0x26ba54){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x5bed66,_0x2ff376){return pm2['start'](_0x26ba54,function(_0x2fb67e,_0x4e0249){if(_0x2fb67e){return _0x2ff376(_0x2fb67e);}pm2[_0x9049('0x5')]();return _0x5bed66(_0x4e0249);});});});};exports[_0x9049('0x6')]=function(_0x53d29e){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x4db849,_0x35aed3){return pm2[_0x9049('0x6')](_0x53d29e,function(_0x5f2ac4,_0x3e4505){if(_0x5f2ac4){return _0x35aed3(_0x5f2ac4);}pm2[_0x9049('0x5')]();return _0x4db849(_0x3e4505);});});});};exports['restart']=function(_0x8f9d41){return connect()['then'](function(){return new BPromise(function(_0x2dfb61,_0x5c539e){return pm2[_0x9049('0x7')](_0x8f9d41,function(_0x1be2e3,_0x22ad4c){if(_0x1be2e3){return _0x5c539e(_0x1be2e3);}pm2['disconnect']();return _0x2dfb61(_0x22ad4c);});});});};exports[_0x9049('0x8')]=function(){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x3b60e9,_0x58aa07){return pm2['list'](function(_0x512cf1,_0x1fd601){if(_0x512cf1){return _0x58aa07(_0x512cf1);}pm2[_0x9049('0x5')]();return _0x3b60e9(_0x1fd601);});});});};exports['describe']=function(_0x5158fa){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x51e923,_0x1e63a8){return pm2['describe'](_0x5158fa,function(_0x218b85,_0x4644bc){if(_0x218b85){return _0x1e63a8(_0x218b85);}pm2['disconnect']();return _0x51e923(_0x4644bc);});});});};exports['delete']=function(_0x5d589a){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x425c3d,_0x2ac640){return pm2[_0x9049('0x9')](_0x5d589a,function(_0x56f8af,_0x37fb69){if(_0x56f8af){return _0x2ac640(_0x56f8af);}pm2[_0x9049('0x5')]();return _0x425c3d(_0x37fb69);});});});};exports['dump']=function(){return connect()[_0x9049('0x4')](function(){return new BPromise(function(_0x4c396c,_0x2e061d){return pm2[_0x9049('0xa')](function(_0x195534){if(_0x195534){return _0x2e061d(_0x195534);}return _0x4c396c(_0x9049('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 061cd10..9cb31bf 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 _0xd093=['../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis'];(function(_0x46fdf6,_0x3e1d7b){var _0x1eb206=function(_0x310d1f){while(--_0x310d1f){_0x46fdf6['push'](_0x46fdf6['shift']());}};_0x1eb206(++_0x3e1d7b);}(_0xd093,0x183));var _0x3d09=function(_0x4125ef,_0x1855e9){_0x4125ef=_0x4125ef-0x0;var _0x1818b4=_0xd093[_0x4125ef];return _0x1818b4;};'use strict';var _=require(_0x3d09('0x0'));var moment=require(_0x3d09('0x1'));var Redis=require(_0x3d09('0x2'));var util=require('util');var config=require(_0x3d09('0x3'));var db=require(_0x3d09('0x4'))['db'];var logger=require(_0x3d09('0x5'))('schedule');config['redis']=_['defaults'](config[_0x3d09('0x6')],{'host':_0x3d09('0x7'),'port':0x18eb});var io=require(_0x3d09('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x41ac2c=0x0;var _0x5b0d40=[];return db[_0x3d09('0x9')][_0x3d09('0xa')]({'raw':!![],'attributes':['id',_0x3d09('0xb')],'where':{'id':0x1}})[_0x3d09('0xc')](function(_0x5e99d9){_0x41ac2c=_0x5e99d9['chatTimeout'];if(_0x41ac2c){return db[_0x3d09('0xd')][_0x3d09('0xe')]({'raw':!![],'attributes':['id',_0x3d09('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3d09('0x10')](_0x5e99d9[_0x3d09('0xb')],'minutes')}}});}else{return[];}})[_0x3d09('0xc')](function(_0x3b9d06){if(_0x3b9d06&&_0x3b9d06[_0x3d09('0x11')]){_0x5b0d40=_[_0x3d09('0x12')](_0x3b9d06||[],'id');logger[_0x3d09('0x13')](_0x3d09('0x14'),_0x5b0d40['join']());return db[_0x3d09('0xd')][_0x3d09('0x15')]({'closeReason':_0x3d09('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x3d09('0x17'))},{'where':{'id':_0x5b0d40}});}})['then'](function(){if(_0x5b0d40&&_0x5b0d40[_0x3d09('0x11')]){logger['info'](_0x3d09('0x18'),_0x5b0d40[_0x3d09('0x19')]());for(var _0x3ea4e9=0x0;_0x3ea4e9<_0x5b0d40[_0x3d09('0x11')];_0x3ea4e9++){io[_0x3d09('0x1a')]('chatInteraction:update',{'id':_0x5b0d40[_0x3ea4e9],'closed':!![]});}}})['catch'](function(_0x5653be){logger[_0x3d09('0x1b')](_0x3d09('0x1c'),_0x5653be?util['inspect'](_0x5653be,{'showHidden':![],'depth':null}):'');});}exports[_0x3d09('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3415=['find','chatTimeout','then','findAll','lastMsgAt','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','util','redis','defaults','localhost'];(function(_0x16986e,_0xc25cec){var _0x4da685=function(_0x55e82){while(--_0x55e82){_0x16986e['push'](_0x16986e['shift']());}};_0x4da685(++_0xc25cec);}(_0x3415,0xfe));var _0x5341=function(_0x5cb39a,_0x46e41c){_0x5cb39a=_0x5cb39a-0x0;var _0x419d9a=_0x3415[_0x5cb39a];return _0x419d9a;};'use strict';var _=require('lodash');var moment=require(_0x5341('0x0'));var Redis=require(_0x5341('0x1'));var util=require(_0x5341('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0x5341('0x3')]=_[_0x5341('0x4')](config['redis'],{'host':_0x5341('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5341('0x3')]));function closeInteractions(){var _0x13d1ad=0x0;var _0x27cded=[];return db['Setting'][_0x5341('0x6')]({'raw':!![],'attributes':['id',_0x5341('0x7')],'where':{'id':0x1}})[_0x5341('0x8')](function(_0x25d6df){_0x13d1ad=_0x25d6df[_0x5341('0x7')];if(_0x13d1ad){return db['ChatInteraction'][_0x5341('0x9')]({'raw':!![],'attributes':['id',_0x5341('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x25d6df['chatTimeout'],'minutes')}}});}else{return[];}})[_0x5341('0x8')](function(_0xe35817){if(_0xe35817&&_0xe35817['length']){_0x27cded=_[_0x5341('0xb')](_0xe35817||[],'id');logger[_0x5341('0xc')](_0x5341('0xd'),_0x27cded[_0x5341('0xe')]());return db[_0x5341('0xf')][_0x5341('0x10')]({'closeReason':_0x5341('0x11'),'disposition':_0x5341('0x12'),'closed':!![],'closedAt':moment()['format'](_0x5341('0x13'))},{'where':{'id':_0x27cded}});}})['then'](function(){if(_0x27cded&&_0x27cded['length']){logger[_0x5341('0xc')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x27cded[_0x5341('0xe')]());for(var _0x4d1007=0x0;_0x4d1007<_0x27cded[_0x5341('0x14')];_0x4d1007++){io['emit'](_0x5341('0x15'),{'id':_0x27cded[_0x4d1007],'closed':!![]});}}})[_0x5341('0x16')](function(_0x4b5489){logger[_0x5341('0x17')](_0x5341('0x18'),_0x4b5489?util[_0x5341('0x19')](_0x4b5489,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 7a427d2..1d34de3 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 _0x2f5c=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3eb858,_0x2ad922){var _0x147946=function(_0x399601){while(--_0x399601){_0x3eb858['push'](_0x3eb858['shift']());}};_0x147946(++_0x2ad922);}(_0x2f5c,0x99));var _0xc2f5=function(_0x206d71,_0x13db9c){_0x206d71=_0x206d71-0x0;var _0x1e8590=_0x2f5c[_0x206d71];return _0x1e8590;};'use strict';function start(){var _0x3c416c=require(_0xc2f5('0x0'));return _0x3c416c[_0xc2f5('0x1')]();}module[_0xc2f5('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x8cc8=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8cc8,0x1bf));var _0x88cc=function(_0x42008d,_0x19cab7){_0x42008d=_0x42008d-0x0;var _0x1309c9=_0x8cc8[_0x42008d];return _0x1309c9;};'use strict';function start(){var _0x5678b7=require(_0x88cc('0x0'));return _0x5678b7[_0x88cc('0x1')]();}module[_0x88cc('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 9d7217f..d4e9ad0 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 _0x32ab=['add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','user','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','Sent','attachments','message','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','map','toString','difference','intersection','exists','stop','deleteJob','toRun','length','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start'];(function(_0x166282,_0x368cce){var _0x411f14=function(_0x4879a6){while(--_0x4879a6){_0x166282['push'](_0x166282['shift']());}};_0x411f14(++_0x368cce);}(_0x32ab,0xb7));var _0xb32a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x32ab[_0x5d6456];return _0x4d66c1;};'use strict';var fs=require('fs');var util=require(_0xb32a('0x0'));var path=require('path');var _=require(_0xb32a('0x1'));var moment=require(_0xb32a('0x2'));var CronJobManager=require(_0xb32a('0x3'));var jayson=require(_0xb32a('0x4'));var BPromise=require(_0xb32a('0x5'));var logger=require(_0xb32a('0x6'))(_0xb32a('0x7'));var db=require(_0xb32a('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb32a('0x9'));var client=jayson[_0xb32a('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x45a378,_0x268227){return function(){logger[_0xb32a('0xb')](_0xb32a('0xc'),_0x45a378[_0xb32a('0xd')]);var _0x47b9fe=!![];var _0xfd0afc=_0x45a378['MailAccount'][_0xb32a('0xe')]();var _0x547a35={'account':_0xfd0afc,'message':{'from':util[_0xb32a('0xf')](_0xb32a('0x10'),_0x45a378[_0xb32a('0x11')]['name'],_0x45a378[_0xb32a('0x11')][_0xb32a('0xd')]||_0x45a378['MailAccount']['Smtp'][_0xb32a('0x12')]),'to':_0x45a378['email'],'cc':_0x45a378['cc'],'bcc':_0x45a378[_0xb32a('0x13')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x268227[_0xb32a('0x14')],_0x45a378[_0xb32a('0x15')],_0x45a378[_0xb32a('0x16')])}};var _0x63faa7=path[_0xb32a('0x17')](__dirname,_0xb32a('0x18'));var _0x209123=_0x268227[_0xb32a('0x19')];var _0x16edec=util[_0xb32a('0xf')](_0xb32a('0x1a'),path[_0xb32a('0x1b')](_0x268227[_0xb32a('0x19')],path[_0xb32a('0x1c')](_0x268227['savename'])),'zip');var _0x4344c5=path[_0xb32a('0x17')](_0x63faa7,_0x209123);var _0x573079=path[_0xb32a('0x17')](_0x63faa7,_0x16edec);if(fs[_0xb32a('0x1d')](_0x4344c5)){_0x268227[_0xb32a('0x1e')]=_0xb32a('0x1f');_0x547a35['message'][_0xb32a('0x20')]=[{'filename':_0x209123,'path':_0x4344c5}];_0x547a35[_0xb32a('0x21')][_0xb32a('0x22')]=util[_0xb32a('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xb32a('0x23')](_0x268227,null,0x2));}else if(fs[_0xb32a('0x1d')](_0x573079)){_0x268227[_0xb32a('0x1e')]=_0xb32a('0x1f');_0x547a35[_0xb32a('0x21')][_0xb32a('0x20')]=[{'filename':_0x16edec,'path':_0x573079}];}else{_0x547a35[_0xb32a('0x21')]['text']=_0xb32a('0x24');if(!_0x45a378[_0xb32a('0x25')]){_0x47b9fe=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x47b9fe){return client[_0xb32a('0x26')]('SendMail',_0x547a35)[_0xb32a('0x27')](function(_0x15f95d){if(_0x15f95d[_0xb32a('0x28')]){return logger[_0xb32a('0x28')]('error\x20mail',JSON[_0xb32a('0x23')](_0x15f95d));}return logger[_0xb32a('0xb')](_0xb32a('0x29'));})[_0xb32a('0x2a')](function(_0x5ad02c){return logger[_0xb32a('0x28')](_0xb32a('0x2b'),JSON[_0xb32a('0x23')](_0x5ad02c));});}};}function handleError(){return function(_0x2dcaae){return logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x2dcaae));};}function handleResult(_0x336b2d){return function(_0x1b69ab){logger[_0xb32a('0xb')](_0xb32a('0x2c'),JSON[_0xb32a('0x23')](_0x1b69ab));if(_0x336b2d[_0xb32a('0x11')]&&_0x336b2d[_0xb32a('0x11')]['Smtp']&&!_[_0xb32a('0x2d')](_0x336b2d['email'])){setTimeout(handleSendEmail(_0x336b2d,_0x1b69ab),0x3c*0x3e8);}};}function handleJob(_0x5a35a8){return function(){try{if(_['isNil'](_0x5a35a8['subtractNumber'])){return logger['info'](_0xb32a('0x2e'));}if(_[_0xb32a('0x2d')](_0x5a35a8['subtractUnit'])){return logger['info'](_0xb32a('0x2f'));}var _0x34d689={'startDate':moment()[_0xb32a('0x30')](_0x5a35a8['subtractNumber'],_0x5a35a8[_0xb32a('0x16')])[_0xb32a('0xf')](_0xb32a('0x31')),'endDate':moment()['format'](_0xb32a('0x31')),'type':_0xb32a('0x32'),'output':_0x5a35a8[_0xb32a('0x33')],'name':_0x5a35a8[_0xb32a('0x14')]};if(!_[_0xb32a('0x2d')](_0x5a35a8[_0xb32a('0x34')])){logger[_0xb32a('0xb')](_0xb32a('0x35'),_0x5a35a8[_0xb32a('0x34')]);return analyticDefaultReportController[_0xb32a('0x36')]({'id':_0x5a35a8[_0xb32a('0x34')]},_0x34d689)[_0xb32a('0x27')](handleResult(_0x5a35a8))[_0xb32a('0x2a')](handleError());}if(!_[_0xb32a('0x2d')](_0x5a35a8[_0xb32a('0x37')])){logger[_0xb32a('0xb')](_0xb32a('0x38'),_0x5a35a8['CustomReportId']);return analyticCustomReportController[_0xb32a('0x36')]({'id':_0x5a35a8[_0xb32a('0x37')]},_0x34d689)[_0xb32a('0x27')](handleResult(_0x5a35a8))[_0xb32a('0x2a')](handleError());}}catch(_0x303cf7){logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x303cf7));}return logger['info'](_0xb32a('0x39'));};}function getJobs(_0x339ddb){var _0x273ffd={};if(_0x339ddb){_0x273ffd['id']=_0x339ddb;}return db[_0xb32a('0x3a')][_0xb32a('0x3b')]({'where':_0x273ffd,'include':[{'model':db[_0xb32a('0x11')],'attributes':['id',_0xb32a('0x14'),_0xb32a('0xd')],'include':[{'model':db[_0xb32a('0x3c')],'as':_0xb32a('0x3d'),'include':[{'model':db['CloudProvider'],'as':_0xb32a('0x3e')}]}]}]})[_0xb32a('0x27')](function(_0x36820b){var _0x47a77a=_[_0xb32a('0x3f')](manager[_0xb32a('0x40')]);var _0x3aede8=_[_0xb32a('0x41')](_0x36820b,function(_0x5d04c4){return _0x5d04c4['id'][_0xb32a('0x42')]();});var _0xd625b8=_['keyBy'](_0x36820b,function(_0x376b6a){return _0x376b6a['id']['toString']();});var _0x4fa70a=_0x339ddb?_0x3aede8:_[_0xb32a('0x43')](_0x3aede8,_0x47a77a);var _0xef6b07=_[_0xb32a('0x44')](_0x3aede8,_0x47a77a);var _0x829d25=_[_0xb32a('0x43')](_0x47a77a,_0x3aede8);var _0x37855a;var _0x304edc;for(_0x37855a=0x0;_0x37855a<_0x829d25['length']&&!_0x339ddb;_0x37855a+=0x1){_0x304edc=_0x829d25[_0x37855a]['toString']();if(manager[_0xb32a('0x45')](_0x304edc)){manager[_0xb32a('0x46')](_0x304edc);manager[_0xb32a('0x47')](_0x304edc);logger[_0xb32a('0xb')]('delete\x20cron',_0x304edc);}}logger[_0xb32a('0xb')](_0xb32a('0x48'),JSON[_0xb32a('0x23')](_0x4fa70a));for(_0x37855a=0x0;_0x37855a<_0x4fa70a[_0xb32a('0x49')];_0x37855a+=0x1){_0x304edc=_0x4fa70a[_0x37855a][_0xb32a('0x42')]();logger[_0xb32a('0xb')]('index',_0x304edc);if(_0x339ddb){logger[_0xb32a('0xb')](_0xb32a('0x4a'),_0x339ddb);logger['info'](JSON[_0xb32a('0x23')](_0xd625b8[_0x304edc]));BPromise[_0xb32a('0x4b')]()[_0xb32a('0x27')](handleJob(_0xd625b8[_0x304edc]));logger[_0xb32a('0xb')](_0xb32a('0x4c'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else if(_0xd625b8[_0x304edc][_0xb32a('0x4d')]&&_0xd625b8[_0x304edc][_0xb32a('0x4e')]&&moment()[_0xb32a('0x4f')](_0xd625b8[_0x304edc][_0xb32a('0x50')],_0xd625b8[_0x304edc][_0xb32a('0x51')])){manager[_0xb32a('0x52')](_0x304edc,_0xd625b8[_0x304edc][_0xb32a('0x4d')],handleJob(_0xd625b8[_0x304edc]));manager[_0xb32a('0x53')](_0x304edc);logger[_0xb32a('0xb')](_0xb32a('0x54'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else if(manager['exists'](_0x304edc)){manager[_0xb32a('0x46')](_0x304edc);manager['deleteJob'](_0x304edc);logger[_0xb32a('0xb')](_0xb32a('0x55'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc]['cron']);}}for(_0x37855a=0x0,_0x304edc;_0x37855a<_0xef6b07[_0xb32a('0x49')]&&!_0x339ddb;_0x37855a+=0x1){_0x304edc=_0xef6b07[_0x37855a][_0xb32a('0x42')]();if(manager['exists'](_0x304edc)){if(_0xd625b8[_0x304edc][_0xb32a('0x4d')]&&_0xd625b8[_0x304edc][_0xb32a('0x4e')]&&moment()[_0xb32a('0x4f')](_0xd625b8[_0x304edc]['startAt'],_0xd625b8[_0x304edc]['endAt'])){manager[_0xb32a('0x56')](_0x304edc,_0xd625b8[_0x304edc][_0xb32a('0x4d')],handleJob(_0xd625b8[_0x304edc]));logger['info'](_0xb32a('0x57'),_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc][_0xb32a('0x4d')]);}else{manager['stop'](_0x304edc);manager[_0xb32a('0x47')](_0x304edc);logger[_0xb32a('0xb')]('stop\x20cron',_0xd625b8[_0x304edc][_0xb32a('0x14')],_0xd625b8[_0x304edc]['cron']);}}}})[_0xb32a('0x2a')](function(_0x4e6d75){logger[_0xb32a('0x28')](JSON[_0xb32a('0x23')](_0x4e6d75));});}exports[_0xb32a('0x58')]=function(_0x2549f0){return getJobs(_0x2549f0);};exports[_0xb32a('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x7ebb=['index','my\x20id','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','info','email','MailAccount','getSmtpOptions','format','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','sendIfEmpty','then','error','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','map','toString','difference','intersection','exists','stop','deleteJob','toRun','length'];(function(_0x3b4350,_0x5e8762){var _0x588012=function(_0xd2b687){while(--_0xd2b687){_0x3b4350['push'](_0x3b4350['shift']());}};_0x588012(++_0x5e8762);}(_0x7ebb,0x1e2));var _0xb7eb=function(_0x9ec221,_0x2594a6){_0x9ec221=_0x9ec221-0x0;var _0xdbe55e=_0x7ebb[_0x9ec221];return _0xdbe55e;};'use strict';var fs=require('fs');var util=require(_0xb7eb('0x0'));var path=require('path');var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xb7eb('0x1'));var jayson=require(_0xb7eb('0x2'));var BPromise=require(_0xb7eb('0x3'));var logger=require('../logger')(_0xb7eb('0x4'));var db=require(_0xb7eb('0x5'))['db'];var analyticCustomReportController=require(_0xb7eb('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xdd3af5,_0x324e37){return function(){logger[_0xb7eb('0x7')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xdd3af5[_0xb7eb('0x8')]);var _0xa36038=!![];var _0x552f30=_0xdd3af5[_0xb7eb('0x9')][_0xb7eb('0xa')]();var _0xf0c27d={'account':_0x552f30,'message':{'from':util[_0xb7eb('0xb')]('\x22%s\x22\x20<%s>',_0xdd3af5[_0xb7eb('0x9')]['name'],_0xdd3af5[_0xb7eb('0x9')][_0xb7eb('0x8')]||_0xdd3af5[_0xb7eb('0x9')][_0xb7eb('0xc')][_0xb7eb('0xd')]),'to':_0xdd3af5['email'],'cc':_0xdd3af5['cc'],'bcc':_0xdd3af5[_0xb7eb('0xe')],'subject':util[_0xb7eb('0xb')](_0xb7eb('0xf'),_0x324e37[_0xb7eb('0x10')],_0xdd3af5['subtractNumber'],_0xdd3af5[_0xb7eb('0x11')])}};var _0x512d9=path['join'](__dirname,_0xb7eb('0x12'));var _0x332d2f=_0x324e37[_0xb7eb('0x13')];var _0x527aba=util['format'](_0xb7eb('0x14'),path[_0xb7eb('0x15')](_0x324e37[_0xb7eb('0x13')],path[_0xb7eb('0x16')](_0x324e37[_0xb7eb('0x13')])),_0xb7eb('0x17'));var _0x4740bf=path[_0xb7eb('0x18')](_0x512d9,_0x332d2f);var _0x535bc9=path['join'](_0x512d9,_0x527aba);if(fs[_0xb7eb('0x19')](_0x4740bf)){_0x324e37[_0xb7eb('0x1a')]=_0xb7eb('0x1b');_0xf0c27d[_0xb7eb('0x1c')]['attachments']=[{'filename':_0x332d2f,'path':_0x4740bf}];_0xf0c27d['message'][_0xb7eb('0x1d')]=util[_0xb7eb('0xb')](_0xb7eb('0x1e'),JSON[_0xb7eb('0x1f')](_0x324e37,null,0x2));}else if(fs[_0xb7eb('0x19')](_0x535bc9)){_0x324e37[_0xb7eb('0x1a')]=_0xb7eb('0x1b');_0xf0c27d[_0xb7eb('0x1c')][_0xb7eb('0x20')]=[{'filename':_0x527aba,'path':_0x535bc9}];}else{_0xf0c27d[_0xb7eb('0x1c')][_0xb7eb('0x1d')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xdd3af5[_0xb7eb('0x21')]){_0xa36038=![];logger[_0xb7eb('0x7')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xa36038){return client['request']('SendMail',_0xf0c27d)[_0xb7eb('0x22')](function(_0x401669){if(_0x401669[_0xb7eb('0x23')]){return logger[_0xb7eb('0x23')]('error\x20mail',JSON[_0xb7eb('0x1f')](_0x401669));}return logger['info']('email\x20sent');})[_0xb7eb('0x24')](function(_0x2cb938){return logger['error']('error\x20mail',JSON[_0xb7eb('0x1f')](_0x2cb938));});}};}function handleError(){return function(_0x24c9ed){return logger['error'](JSON[_0xb7eb('0x1f')](_0x24c9ed));};}function handleResult(_0x3d2843){return function(_0x19eaf2){logger[_0xb7eb('0x7')](_0xb7eb('0x25'),JSON[_0xb7eb('0x1f')](_0x19eaf2));if(_0x3d2843[_0xb7eb('0x9')]&&_0x3d2843['MailAccount'][_0xb7eb('0xc')]&&!_['isNil'](_0x3d2843[_0xb7eb('0x8')])){setTimeout(handleSendEmail(_0x3d2843,_0x19eaf2),0x3c*0x3e8);}};}function handleJob(_0x511eb3){return function(){try{if(_[_0xb7eb('0x26')](_0x511eb3['subtractNumber'])){return logger[_0xb7eb('0x7')](_0xb7eb('0x27'));}if(_[_0xb7eb('0x26')](_0x511eb3['subtractUnit'])){return logger[_0xb7eb('0x7')](_0xb7eb('0x28'));}var _0x2a1760={'startDate':moment()[_0xb7eb('0x29')](_0x511eb3[_0xb7eb('0x2a')],_0x511eb3[_0xb7eb('0x11')])[_0xb7eb('0xb')](_0xb7eb('0x2b')),'endDate':moment()[_0xb7eb('0xb')](_0xb7eb('0x2b')),'type':_0xb7eb('0x2c'),'output':_0x511eb3[_0xb7eb('0x2d')],'name':_0x511eb3['name']};if(!_[_0xb7eb('0x26')](_0x511eb3[_0xb7eb('0x2e')])){logger[_0xb7eb('0x7')]('exec\x20defaul\x20report\x20id:%s',_0x511eb3[_0xb7eb('0x2e')]);return analyticDefaultReportController[_0xb7eb('0x2f')]({'id':_0x511eb3[_0xb7eb('0x2e')]},_0x2a1760)[_0xb7eb('0x22')](handleResult(_0x511eb3))[_0xb7eb('0x24')](handleError());}if(!_[_0xb7eb('0x26')](_0x511eb3['CustomReportId'])){logger[_0xb7eb('0x7')](_0xb7eb('0x30'),_0x511eb3[_0xb7eb('0x31')]);return analyticCustomReportController[_0xb7eb('0x2f')]({'id':_0x511eb3[_0xb7eb('0x31')]},_0x2a1760)[_0xb7eb('0x22')](handleResult(_0x511eb3))[_0xb7eb('0x24')](handleError());}}catch(_0x216aeb){logger[_0xb7eb('0x23')](JSON['stringify'](_0x216aeb));}return logger[_0xb7eb('0x7')](_0xb7eb('0x32'));};}function getJobs(_0x18db79){var _0xbab83e={};if(_0x18db79){_0xbab83e['id']=_0x18db79;}return db[_0xb7eb('0x33')][_0xb7eb('0x34')]({'where':_0xbab83e,'include':[{'model':db[_0xb7eb('0x9')],'attributes':['id',_0xb7eb('0x10'),_0xb7eb('0x8')],'include':[{'model':db[_0xb7eb('0x35')],'as':'Smtp','include':[{'model':db[_0xb7eb('0x36')],'as':_0xb7eb('0x36')}]}]}]})[_0xb7eb('0x22')](function(_0x10479a){var _0x70640a=_['keys'](manager['jobs']);var _0xb032ac=_[_0xb7eb('0x37')](_0x10479a,function(_0x20ff46){return _0x20ff46['id'][_0xb7eb('0x38')]();});var _0x39a930=_['keyBy'](_0x10479a,function(_0x160e39){return _0x160e39['id']['toString']();});var _0x18b803=_0x18db79?_0xb032ac:_[_0xb7eb('0x39')](_0xb032ac,_0x70640a);var _0x5704be=_[_0xb7eb('0x3a')](_0xb032ac,_0x70640a);var _0x1bfc59=_[_0xb7eb('0x39')](_0x70640a,_0xb032ac);var _0x426eb3;var _0x474387;for(_0x426eb3=0x0;_0x426eb3<_0x1bfc59['length']&&!_0x18db79;_0x426eb3+=0x1){_0x474387=_0x1bfc59[_0x426eb3][_0xb7eb('0x38')]();if(manager[_0xb7eb('0x3b')](_0x474387)){manager[_0xb7eb('0x3c')](_0x474387);manager[_0xb7eb('0x3d')](_0x474387);logger[_0xb7eb('0x7')]('delete\x20cron',_0x474387);}}logger[_0xb7eb('0x7')](_0xb7eb('0x3e'),JSON[_0xb7eb('0x1f')](_0x18b803));for(_0x426eb3=0x0;_0x426eb3<_0x18b803[_0xb7eb('0x3f')];_0x426eb3+=0x1){_0x474387=_0x18b803[_0x426eb3][_0xb7eb('0x38')]();logger[_0xb7eb('0x7')](_0xb7eb('0x40'),_0x474387);if(_0x18db79){logger['info'](_0xb7eb('0x41'),_0x18db79);logger[_0xb7eb('0x7')](JSON[_0xb7eb('0x1f')](_0x39a930[_0x474387]));BPromise['resolve']()['then'](handleJob(_0x39a930[_0x474387]));logger[_0xb7eb('0x7')]('run\x20job',_0x39a930[_0x474387][_0xb7eb('0x10')],_0x39a930[_0x474387][_0xb7eb('0x42')]);}else if(_0x39a930[_0x474387]['cron']&&_0x39a930[_0x474387][_0xb7eb('0x43')]&&moment()[_0xb7eb('0x44')](_0x39a930[_0x474387][_0xb7eb('0x45')],_0x39a930[_0x474387][_0xb7eb('0x46')])){manager[_0xb7eb('0x47')](_0x474387,_0x39a930[_0x474387][_0xb7eb('0x42')],handleJob(_0x39a930[_0x474387]));manager[_0xb7eb('0x48')](_0x474387);logger[_0xb7eb('0x7')](_0xb7eb('0x49'),_0x39a930[_0x474387][_0xb7eb('0x10')],_0x39a930[_0x474387][_0xb7eb('0x42')]);}else if(manager['exists'](_0x474387)){manager[_0xb7eb('0x3c')](_0x474387);manager['deleteJob'](_0x474387);logger[_0xb7eb('0x7')](_0xb7eb('0x4a'),_0x39a930[_0x474387][_0xb7eb('0x10')],_0x39a930[_0x474387][_0xb7eb('0x42')]);}}for(_0x426eb3=0x0,_0x474387;_0x426eb3<_0x5704be[_0xb7eb('0x3f')]&&!_0x18db79;_0x426eb3+=0x1){_0x474387=_0x5704be[_0x426eb3][_0xb7eb('0x38')]();if(manager['exists'](_0x474387)){if(_0x39a930[_0x474387][_0xb7eb('0x42')]&&_0x39a930[_0x474387][_0xb7eb('0x43')]&&moment()['isBetween'](_0x39a930[_0x474387]['startAt'],_0x39a930[_0x474387][_0xb7eb('0x46')])){manager[_0xb7eb('0x4b')](_0x474387,_0x39a930[_0x474387]['cron'],handleJob(_0x39a930[_0x474387]));logger['info'](_0xb7eb('0x4c'),_0x39a930[_0x474387][_0xb7eb('0x10')],_0x39a930[_0x474387][_0xb7eb('0x42')]);}else{manager[_0xb7eb('0x3c')](_0x474387);manager['deleteJob'](_0x474387);logger[_0xb7eb('0x7')](_0xb7eb('0x4a'),_0x39a930[_0x474387][_0xb7eb('0x10')],_0x39a930[_0x474387][_0xb7eb('0x42')]);}}}})[_0xb7eb('0x24')](function(_0xe0c62c){logger[_0xb7eb('0x23')](JSON[_0xb7eb('0x1f')](_0xe0c62c));});}exports[_0xb7eb('0x4d')]=function(_0x52717a){return getJobs(_0x52717a);};exports[_0xb7eb('0x48')]=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 f423552..b806393 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 _0x6c9f=['TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Positive','Negative','Mixed','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','length','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start','lodash','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6c9f,0x16a));var _0xf6c9=function(_0x3d9912,_0x5d4f2d){_0x3d9912=_0x3d9912-0x0;var _0x3ed887=_0x6c9f[_0x3d9912];return _0x3ed887;};var _=require(_0xf6c9('0x0'));var AWS=require('aws-sdk');var rp=require(_0xf6c9('0x1'));var util=require('util');var BPromise=require(_0xf6c9('0x2'));var db=require(_0xf6c9('0x3'))['db'];var logger=require(_0xf6c9('0x4'))(_0xf6c9('0x5'));function getTranscriptionJob(_0x1bb07c,_0x2e5222,_0x519365,_0x1e7f09){return new Promise(function(_0x1b92e6,_0x1de8c2){var _0x2abc04=new AWS[(_0xf6c9('0x6'))]({'accessKeyId':_0x2e5222,'secretAccessKey':_0x1bb07c,'region':_0x519365});_0x2abc04[_0xf6c9('0x7')]({'TranscriptionJobName':_0x1e7f09},function(_0x24901b,_0x105f16){if(_0x24901b){return _0x1de8c2(_0x24901b);}else{return _0x1b92e6(_0x105f16);}});});}function sentiment(_0x1e16cc,_0x521526,_0x3d93f7,_0x2a09aa,_0x311c11){return new Promise(function(_0x125b03,_0x475bff){var _0x3ac4d2=new AWS[(_0xf6c9('0x8'))]({'accessKeyId':_0x521526,'secretAccessKey':_0x1e16cc,'region':_0x3d93f7});_0x3ac4d2[_0xf6c9('0x9')]({'Text':_0x2a09aa,'LanguageCode':_0x311c11[_0xf6c9('0xa')](0x0,0x2)},function(_0x516298,_0x21923f){if(_0x516298){return _0x475bff(_0x516298);}else{return _0x125b03(_0x21923f);}});});}function checkTranscribeJob(_0x163f62,_0x1c5b31,_0x2f99db){var _0x564e64;return new BPromise(function(_0x5d7a24,_0x2eec37){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0xd'),_0x163f62['id'],_0x163f62[_0xf6c9('0xe')]));return getTranscriptionJob(_0x2f99db[_0xf6c9('0xf')],_0x2f99db['data2'],_0x1c5b31['transcribeRegion'],_0x163f62[_0xf6c9('0xe')])[_0xf6c9('0x10')](function(_0x5cb57e){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x11'),_0x163f62['id'],_0x163f62[_0xf6c9('0xe')],_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')]));if(!_0x163f62['fileText']){switch(_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')]){case _0xf6c9('0x14'):var _0x2ba234={'transcribeStatus':_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x13')],'fileUri':_0x5cb57e[_0xf6c9('0x12')][_0xf6c9('0x15')][_0xf6c9('0x16')]};logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x17'),_0x163f62['id']));return rp({'uri':_0x5cb57e['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0xf6c9('0x10')](function(_0x4b2340){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x18'),_0x163f62['id']));if(_0x4b2340&&_0x4b2340['results']&&_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]&&_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]['length']){_0x2ba234[_0xf6c9('0x1b')]='';for(var _0x32870e=0x0;_0x32870e<_0x4b2340[_0xf6c9('0x19')][_0xf6c9('0x1a')]['length'];_0x32870e++){_0x2ba234[_0xf6c9('0x1b')]+=_0x4b2340['results']['transcripts'][_0x32870e][_0xf6c9('0x1c')]+'';}}return _0x163f62[_0xf6c9('0x1d')](_0x2ba234);})[_0xf6c9('0x10')](function(){logger['info'](util['format'](_0xf6c9('0x1e'),_0x163f62['id']));if(!_0x163f62[_0xf6c9('0x1f')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x22'));}if(!_0x1c5b31[_0xf6c9('0x23')]||!_0x1c5b31[_0xf6c9('0x24')]||!_0x1c5b31['sentimentRegion']||!_0x1c5b31[_0xf6c9('0x25')]||!_0x1c5b31['bucket']){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x26'));}if(!_0x2ba234[_0xf6c9('0x1b')]){throw new Error(_0xf6c9('0x27'));}if(_0x1c5b31[_0xf6c9('0x24')]===_0x2f99db['id']){return _0x2f99db;}else{return db[_0xf6c9('0x28')][_0xf6c9('0x29')]({'where':{'id':_settings[_0xf6c9('0x24')]}});}})['then'](function(_0x450d80){if(!_0x450d80){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x450d80[_0xf6c9('0xf')]||!_0x450d80[_0xf6c9('0x2b')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2c'));}_0x564e64=_0x450d80;logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2d'),_0x163f62['id']));return sentiment(_0x564e64[_0xf6c9('0xf')],_0x564e64['data2'],_0x1c5b31[_0xf6c9('0x2e')],_0x2ba234[_0xf6c9('0x1b')],_0x1c5b31[_0xf6c9('0x25')]);})[_0xf6c9('0x10')](function(_0x24ce84){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2f'),_0x163f62['id']));return _0x163f62['update']({'sentiment':_0x24ce84[_0xf6c9('0x30')],'sPositive':_0x24ce84['SentimentScore']['Positive'],'sNegative':_0x24ce84[_0xf6c9('0x31')]['Negative'],'sMixed':_0x24ce84[_0xf6c9('0x31')]['Mixed'],'sNeutral':_0x24ce84[_0xf6c9('0x31')][_0xf6c9('0x32')]});})[_0xf6c9('0x10')](function(){logger['info'](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});case _0xf6c9('0x33'):return _0x163f62[_0xf6c9('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x5cb57e[_0xf6c9('0x12')]['FailureReason']})[_0xf6c9('0x10')](function(){logger['info'](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});default:logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x34'),_0x163f62['id']));break;}}else{return BPromise[_0xf6c9('0x35')]()['then'](function(){if(!_0x163f62[_0xf6c9('0x1f')]){throw new db[(_0xf6c9('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c5b31[_0xf6c9('0x23')]||!_0x1c5b31['sentimentAccountId']||!_0x1c5b31[_0xf6c9('0x2e')]||!_0x1c5b31[_0xf6c9('0x25')]||!_0x1c5b31[_0xf6c9('0x36')]){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x26'));}if(!_0x163f62['fileText']){throw new Error(_0xf6c9('0x27'));}if(_0x1c5b31['sentimentAccountId']===_0x2f99db['id']){return _0x2f99db;}else{return db[_0xf6c9('0x28')][_0xf6c9('0x29')]({'where':{'id':_settings[_0xf6c9('0x24')]}});}})[_0xf6c9('0x10')](function(_0x23b28b){if(!_0x23b28b){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x23b28b[_0xf6c9('0xf')]||!_0x23b28b[_0xf6c9('0x2b')]){throw new db[(_0xf6c9('0x20'))]['ValidationError'](_0xf6c9('0x2c'));}_0x564e64=_0x23b28b;logger['info'](util[_0xf6c9('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x163f62['id']));return sentiment(_0x564e64[_0xf6c9('0xf')],_0x564e64['data2'],_0x1c5b31[_0xf6c9('0x2e')],_0x163f62['fileText'],_0x1c5b31[_0xf6c9('0x25')]);})['then'](function(_0x4cd2b9){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x2f'),_0x163f62['id']));return _0x163f62[_0xf6c9('0x1d')]({'sentiment':_0x4cd2b9[_0xf6c9('0x30')],'sPositive':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x37')],'sNegative':_0x4cd2b9['SentimentScore'][_0xf6c9('0x38')],'sMixed':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x39')],'sNeutral':_0x4cd2b9[_0xf6c9('0x31')][_0xf6c9('0x32')],'transcribeStatus':_0xf6c9('0x14')});})['then'](function(){logger[_0xf6c9('0xb')](util[_0xf6c9('0xc')](_0xf6c9('0x1e'),_0x163f62['id']));_0x5d7a24();});}})[_0xf6c9('0x3a')](function(_0x384bd2){if(_0x384bd2){if(!_0x384bd2[_0xf6c9('0x3b')]||_0x384bd2['name']!=='SequelizeValidationError'){logger[_0xf6c9('0x3c')](util[_0xf6c9('0xc')](_0xf6c9('0x3d'),_0x163f62['id']),util[_0xf6c9('0x3e')](_0x384bd2,{'showHidden':![],'depth':null}));}}_0x5d7a24();});});}function checkTranscribe(){var _0x13e50a;var _0x5cd665;var _0x5a62c4;return db[_0xf6c9('0x3f')][_0xf6c9('0x40')]({'where':{'transcribeStatus':_0xf6c9('0x41')}})[_0xf6c9('0x10')](function(_0x3006a6){if(!_0x3006a6||!_0x3006a6[_0xf6c9('0x42')]){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x43'));}_0x13e50a=_0x3006a6;return db['Setting'][_0xf6c9('0x29')]({'where':{'id':0x1}});})['then'](function(_0x38b410){if(!_0x38b410){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x44'));}_0x5cd665=_0x38b410;if(!_0x5cd665['transcribe']||!_0x5cd665[_0xf6c9('0x45')]||!_0x5cd665[_0xf6c9('0x46')]||!_0x5cd665['language']||!_0x5cd665[_0xf6c9('0x36')]){throw new db['Sequelize'][(_0xf6c9('0x21'))](_0xf6c9('0x47'));}return db[_0xf6c9('0x28')]['findOne']({'where':{'id':_0x5cd665[_0xf6c9('0x45')]}});})[_0xf6c9('0x10')](function(_0x490beb){if(!_0x490beb){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2a'));}if(!_0x490beb[_0xf6c9('0xf')]||!_0x490beb['data2']){throw new db[(_0xf6c9('0x20'))][(_0xf6c9('0x21'))](_0xf6c9('0x2c'));}_0x5a62c4=_0x490beb;var _0x1f7c9a=[];_0x13e50a['forEach'](function(_0x1bc77c){_0x1f7c9a[_0xf6c9('0x48')](checkTranscribeJob(_0x1bc77c,_0x5cd665,_0x5a62c4));});return BPromise[_0xf6c9('0x49')](_0x1f7c9a);})[_0xf6c9('0x3a')](function(_0x3abc4d){if(_0x3abc4d){if(!_0x3abc4d['name']||_0x3abc4d[_0xf6c9('0x3b')]!==_0xf6c9('0x4a')){logger[_0xf6c9('0x3c')](util['inspect'](_0x3abc4d,{'showHidden':![],'depth':null}));}}});}exports[_0xf6c9('0x4b')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x9434=['inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Cloud\x20Provider\x20not\x20available','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Neutral','catch','name','error'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x9434,0x168));var _0x4943=function(_0xc5722d,_0x4ca45f){_0xc5722d=_0xc5722d-0x0;var _0x3c5bdf=_0x9434[_0xc5722d];return _0x3c5bdf;};var _=require(_0x4943('0x0'));var AWS=require(_0x4943('0x1'));var rp=require(_0x4943('0x2'));var util=require(_0x4943('0x3'));var BPromise=require(_0x4943('0x4'));var db=require(_0x4943('0x5'))['db'];var logger=require('../../config/logger')(_0x4943('0x6'));function getTranscriptionJob(_0xda4cba,_0x5117c7,_0x2ce3d9,_0x43b5b0){return new Promise(function(_0x4f930e,_0x394d9d){var _0x56a55a=new AWS['TranscribeService']({'accessKeyId':_0x5117c7,'secretAccessKey':_0xda4cba,'region':_0x2ce3d9});_0x56a55a[_0x4943('0x7')]({'TranscriptionJobName':_0x43b5b0},function(_0x2f4119,_0x1876eb){if(_0x2f4119){return _0x394d9d(_0x2f4119);}else{return _0x4f930e(_0x1876eb);}});});}function sentiment(_0x32f535,_0x439158,_0x553991,_0x51b504,_0x3057c4){return new Promise(function(_0x1bc269,_0xf6d6c8){var _0x519060=new AWS[(_0x4943('0x8'))]({'accessKeyId':_0x439158,'secretAccessKey':_0x32f535,'region':_0x553991});_0x519060[_0x4943('0x9')]({'Text':_0x51b504,'LanguageCode':_0x3057c4['substring'](0x0,0x2)},function(_0x20ca75,_0x4a6943){if(_0x20ca75){return _0xf6d6c8(_0x20ca75);}else{return _0x1bc269(_0x4a6943);}});});}function checkTranscribeJob(_0x590f41,_0x943461,_0x1e95be){var _0x33fd73;return new BPromise(function(_0x37a0f2,_0x2763cb){logger[_0x4943('0xa')](util[_0x4943('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x590f41['id'],_0x590f41[_0x4943('0xc')]));return getTranscriptionJob(_0x1e95be[_0x4943('0xd')],_0x1e95be[_0x4943('0xe')],_0x943461[_0x4943('0xf')],_0x590f41[_0x4943('0xc')])[_0x4943('0x10')](function(_0x4b075e){logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x11'),_0x590f41['id'],_0x590f41['transcribeName'],_0x4b075e['TranscriptionJob'][_0x4943('0x12')]));if(!_0x590f41['fileText']){switch(_0x4b075e[_0x4943('0x13')][_0x4943('0x12')]){case'COMPLETED':var _0x156c8c={'transcribeStatus':_0x4b075e[_0x4943('0x13')][_0x4943('0x12')],'fileUri':_0x4b075e['TranscriptionJob'][_0x4943('0x14')]['TranscriptFileUri']};logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x15'),_0x590f41['id']));return rp({'uri':_0x4b075e[_0x4943('0x13')][_0x4943('0x14')][_0x4943('0x16')],'json':!![]})['then'](function(_0x1ceb6f){logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x17'),_0x590f41['id']));if(_0x1ceb6f&&_0x1ceb6f[_0x4943('0x18')]&&_0x1ceb6f[_0x4943('0x18')][_0x4943('0x19')]&&_0x1ceb6f[_0x4943('0x18')]['transcripts']['length']){_0x156c8c[_0x4943('0x1a')]='';for(var _0x127a53=0x0;_0x127a53<_0x1ceb6f[_0x4943('0x18')]['transcripts'][_0x4943('0x1b')];_0x127a53++){_0x156c8c[_0x4943('0x1a')]+=_0x1ceb6f['results'][_0x4943('0x19')][_0x127a53][_0x4943('0x1c')]+'';}}return _0x590f41[_0x4943('0x1d')](_0x156c8c);})[_0x4943('0x10')](function(){logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x1e'),_0x590f41['id']));if(!_0x590f41[_0x4943('0x1f')]){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))](_0x4943('0x22'));}if(!_0x943461[_0x4943('0x23')]||!_0x943461[_0x4943('0x24')]||!_0x943461[_0x4943('0x25')]||!_0x943461[_0x4943('0x26')]||!_0x943461[_0x4943('0x27')]){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x156c8c[_0x4943('0x1a')]){throw new Error('Transcript\x20not\x20available');}if(_0x943461[_0x4943('0x24')]===_0x1e95be['id']){return _0x1e95be;}else{return db[_0x4943('0x28')][_0x4943('0x29')]({'where':{'id':_settings[_0x4943('0x24')]}});}})[_0x4943('0x10')](function(_0x248486){if(!_0x248486){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x248486[_0x4943('0xd')]||!_0x248486[_0x4943('0xe')]){throw new db['Sequelize'][(_0x4943('0x21'))](_0x4943('0x2a'));}_0x33fd73=_0x248486;logger['info'](util[_0x4943('0xb')](_0x4943('0x2b'),_0x590f41['id']));return sentiment(_0x33fd73[_0x4943('0xd')],_0x33fd73['data2'],_0x943461[_0x4943('0x25')],_0x156c8c[_0x4943('0x1a')],_0x943461[_0x4943('0x26')]);})[_0x4943('0x10')](function(_0x3526c1){logger['info'](util[_0x4943('0xb')](_0x4943('0x2c'),_0x590f41['id']));return _0x590f41[_0x4943('0x1d')]({'sentiment':_0x3526c1[_0x4943('0x2d')],'sPositive':_0x3526c1[_0x4943('0x2e')][_0x4943('0x2f')],'sNegative':_0x3526c1[_0x4943('0x2e')][_0x4943('0x30')],'sMixed':_0x3526c1[_0x4943('0x2e')][_0x4943('0x31')],'sNeutral':_0x3526c1[_0x4943('0x2e')]['Neutral']});})[_0x4943('0x10')](function(){logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x1e'),_0x590f41['id']));_0x37a0f2();});case _0x4943('0x32'):return _0x590f41['update']({'transcribeStatus':'FAILED','failureReason':_0x4b075e['TranscriptionJob'][_0x4943('0x33')]})[_0x4943('0x10')](function(){logger['info'](util[_0x4943('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x590f41['id']));_0x37a0f2();});default:logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x34'),_0x590f41['id']));break;}}else{return BPromise[_0x4943('0x35')]()[_0x4943('0x10')](function(){if(!_0x590f41[_0x4943('0x1f')]){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))](_0x4943('0x22'));}if(!_0x943461[_0x4943('0x23')]||!_0x943461[_0x4943('0x24')]||!_0x943461[_0x4943('0x25')]||!_0x943461[_0x4943('0x26')]||!_0x943461[_0x4943('0x27')]){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))](_0x4943('0x36'));}if(!_0x590f41[_0x4943('0x1a')]){throw new Error(_0x4943('0x37'));}if(_0x943461[_0x4943('0x24')]===_0x1e95be['id']){return _0x1e95be;}else{return db[_0x4943('0x28')][_0x4943('0x29')]({'where':{'id':_settings[_0x4943('0x24')]}});}})[_0x4943('0x10')](function(_0x32e4c1){if(!_0x32e4c1){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x32e4c1[_0x4943('0xd')]||!_0x32e4c1[_0x4943('0xe')]){throw new db['Sequelize']['ValidationError'](_0x4943('0x2a'));}_0x33fd73=_0x32e4c1;logger['info'](util[_0x4943('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x590f41['id']));return sentiment(_0x33fd73[_0x4943('0xd')],_0x33fd73['data2'],_0x943461[_0x4943('0x25')],_0x590f41['fileText'],_0x943461[_0x4943('0x26')]);})[_0x4943('0x10')](function(_0x1e1ef){logger['info'](util['format'](_0x4943('0x2c'),_0x590f41['id']));return _0x590f41['update']({'sentiment':_0x1e1ef[_0x4943('0x2d')],'sPositive':_0x1e1ef['SentimentScore'][_0x4943('0x2f')],'sNegative':_0x1e1ef[_0x4943('0x2e')][_0x4943('0x30')],'sMixed':_0x1e1ef[_0x4943('0x2e')]['Mixed'],'sNeutral':_0x1e1ef['SentimentScore'][_0x4943('0x38')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x4943('0xa')](util[_0x4943('0xb')](_0x4943('0x1e'),_0x590f41['id']));_0x37a0f2();});}})[_0x4943('0x39')](function(_0x227e79){if(_0x227e79){if(!_0x227e79[_0x4943('0x3a')]||_0x227e79[_0x4943('0x3a')]!=='SequelizeValidationError'){logger[_0x4943('0x3b')](util[_0x4943('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x590f41['id']),util[_0x4943('0x3c')](_0x227e79,{'showHidden':![],'depth':null}));}}_0x37a0f2();});});}function checkTranscribe(){var _0x3aba7a;var _0x204429;var _0x4d1a31;return db[_0x4943('0x3d')][_0x4943('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x4943('0x10')](function(_0xa8668b){if(!_0xa8668b||!_0xa8668b['length']){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))](_0x4943('0x3f'));}_0x3aba7a=_0xa8668b;return db['Setting'][_0x4943('0x29')]({'where':{'id':0x1}});})['then'](function(_0x51636a){if(!_0x51636a){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))](_0x4943('0x40'));}_0x204429=_0x51636a;if(!_0x204429['transcribe']||!_0x204429['transcribeAccountId']||!_0x204429['transcribeRegion']||!_0x204429[_0x4943('0x26')]||!_0x204429['bucket']){throw new db['Sequelize'][(_0x4943('0x21'))]('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x204429[_0x4943('0x41')]}});})[_0x4943('0x10')](function(_0x24288a){if(!_0x24288a){throw new db['Sequelize'][(_0x4943('0x21'))](_0x4943('0x42'));}if(!_0x24288a[_0x4943('0xd')]||!_0x24288a['data2']){throw new db[(_0x4943('0x20'))][(_0x4943('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x4d1a31=_0x24288a;var _0x567e7b=[];_0x3aba7a['forEach'](function(_0x56eda3){_0x567e7b[_0x4943('0x43')](checkTranscribeJob(_0x56eda3,_0x204429,_0x4d1a31));});return BPromise[_0x4943('0x44')](_0x567e7b);})[_0x4943('0x39')](function(_0x3056c6){if(_0x3056c6){if(!_0x3056c6['name']||_0x3056c6[_0x4943('0x3a')]!=='SequelizeValidationError'){logger['error'](util[_0x4943('0x3c')](_0x3056c6,{'showHidden':![],'depth':null}));}}});}exports[_0x4943('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index d10bd75..7204860 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 _0xdbed=['[WHATSAPP]\x20Interactions\x20to\x20close:','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','localhost','socket.io-emitter','redis','WhatsappInteraction','findAll','subtract','length','map','info'];(function(_0x10a0ab,_0x37b227){var _0x35f4c3=function(_0x22d405){while(--_0x22d405){_0x10a0ab['push'](_0x10a0ab['shift']());}};_0x35f4c3(++_0x37b227);}(_0xdbed,0xca));var _0xddbe=function(_0x5f5aea,_0x521da6){_0x5f5aea=_0x5f5aea-0x0;var _0x5dfb6c=_0xdbed[_0x5f5aea];return _0x5dfb6c;};'use strict';var _=require(_0xddbe('0x0'));var moment=require(_0xddbe('0x1'));var Redis=require(_0xddbe('0x2'));var util=require(_0xddbe('0x3'));var config=require('../../config/environment');var db=require(_0xddbe('0x4'))['db'];var logger=require('../logger')('schedule');config['redis']=_['defaults'](config['redis'],{'host':_0xddbe('0x5'),'port':0x18eb});var io=require(_0xddbe('0x6'))(new Redis(config[_0xddbe('0x7')]));function closeInteractions(){var _0x17addb=[];return db[_0xddbe('0x8')][_0xddbe('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xddbe('0xa')](0x18,'hours')}}})['then'](function(_0x13bb71){if(_0x13bb71&&_0x13bb71[_0xddbe('0xb')]){_0x17addb=_[_0xddbe('0xc')](_0x13bb71||[],'id');logger[_0xddbe('0xd')](_0xddbe('0xe'),_0x17addb['join']());return db['WhatsappInteraction']['update']({'closeReason':_0xddbe('0xf'),'disposition':_0xddbe('0x10'),'closed':!![],'closedAt':moment()[_0xddbe('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x17addb}});}})[_0xddbe('0x12')](function(){if(_0x17addb&&_0x17addb[_0xddbe('0xb')]){logger[_0xddbe('0xd')](_0xddbe('0x13'),_0x17addb[_0xddbe('0x14')]());for(var _0x425146=0x0;_0x425146<_0x17addb[_0xddbe('0xb')];_0x425146++){io[_0xddbe('0x15')](_0xddbe('0x16'),{'id':_0x17addb[_0x425146],'closed':!![]});}}})[_0xddbe('0x17')](function(_0x226522){logger['error'](_0xddbe('0x18'),_0x226522?util[_0xddbe('0x19')](_0x226522,{'showHidden':![],'depth':null}):'');});}exports[_0xddbe('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa5ef=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info'];(function(_0x2a0d82,_0x477be0){var _0x9031c6=function(_0x398cca){while(--_0x398cca){_0x2a0d82['push'](_0x2a0d82['shift']());}};_0x9031c6(++_0x477be0);}(_0xa5ef,0x18e));var _0xfa5e=function(_0x4b49c9,_0x290d55){_0x4b49c9=_0x4b49c9-0x0;var _0xab2d67=_0xa5ef[_0x4b49c9];return _0xab2d67;};'use strict';var _=require(_0xfa5e('0x0'));var moment=require(_0xfa5e('0x1'));var Redis=require(_0xfa5e('0x2'));var util=require(_0xfa5e('0x3'));var config=require(_0xfa5e('0x4'));var db=require(_0xfa5e('0x5'))['db'];var logger=require('../logger')('schedule');config[_0xfa5e('0x6')]=_[_0xfa5e('0x7')](config[_0xfa5e('0x6')],{'host':_0xfa5e('0x8'),'port':0x18eb});var io=require(_0xfa5e('0x9'))(new Redis(config[_0xfa5e('0x6')]));function closeInteractions(){var _0x304e14=[];return db[_0xfa5e('0xa')][_0xfa5e('0xb')]({'raw':!![],'attributes':['id',_0xfa5e('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfa5e('0xd')](0x18,_0xfa5e('0xe'))}}})[_0xfa5e('0xf')](function(_0x272ea8){if(_0x272ea8&&_0x272ea8[_0xfa5e('0x10')]){_0x304e14=_['map'](_0x272ea8||[],'id');logger[_0xfa5e('0x11')](_0xfa5e('0x12'),_0x304e14[_0xfa5e('0x13')]());return db[_0xfa5e('0xa')][_0xfa5e('0x14')]({'closeReason':_0xfa5e('0x15'),'disposition':_0xfa5e('0x16'),'closed':!![],'closedAt':moment()['format'](_0xfa5e('0x17'))},{'where':{'id':_0x304e14}});}})['then'](function(){if(_0x304e14&&_0x304e14[_0xfa5e('0x10')]){logger[_0xfa5e('0x11')](_0xfa5e('0x18'),_0x304e14['join']());for(var _0x107e89=0x0;_0x107e89<_0x304e14[_0xfa5e('0x10')];_0x107e89++){io[_0xfa5e('0x19')](_0xfa5e('0x1a'),{'id':_0x304e14[_0x107e89],'closed':!![]});}}})[_0xfa5e('0x1b')](function(_0x8f5b68){logger[_0xfa5e('0x1c')](_0xfa5e('0x1d'),_0x8f5b68?util[_0xfa5e('0x1e')](_0x8f5b68,{'showHidden':![],'depth':null}):'');});}exports[_0xfa5e('0x1f')]=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 36d4706..bc527f8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2b5=['hopper2','catch','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','then','CmContact','log','finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','contacts2'];(function(_0x4c5f3b,_0x272103){var _0x2e2add=function(_0x37f4a8){while(--_0x37f4a8){_0x4c5f3b['push'](_0x4c5f3b['shift']());}};_0x2e2add(++_0x272103);}(_0xe2b5,0x17c));var _0x5e2b=function(_0x397c86,_0x24edb8){_0x397c86=_0x397c86-0x0;var _0x5c40c5=_0xe2b5[_0x397c86];return _0x5c40c5;};'use strict';var util=require('util');var db=require(_0x5e2b('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x5e2b('0x1')+i,'lastName':_0x5e2b('0x2')+i,'phone':0xf879fb460+i,'email':_0x5e2b('0x3')+i+_0x5e2b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5e2b('0x5')](),'updatedAt':Date[_0x5e2b('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5e2b('0x6')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5e2b('0x2')+i,'phone':0xf879fb460+i,'email':_0x5e2b('0x3')+i+_0x5e2b('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5e2b('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x5e2b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5e2b('0x5')](),'updatedAt':Date[_0x5e2b('0x5')]()});}db['CmContact']['destroy']({'where':{}})[_0x5e2b('0x7')](function(){return db[_0x5e2b('0x8')]['bulkCreate'](contacts);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0xb'));return db[_0x5e2b('0xc')][_0x5e2b('0xd')]({'where':{}});})[_0x5e2b('0x7')](function(){return db[_0x5e2b('0xc')]['bulkCreate'](hopper);})[_0x5e2b('0x7')](function(){console['log'](_0x5e2b('0xa'),'hopper1');return db[_0x5e2b('0x8')][_0x5e2b('0xe')](contacts2);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0xf'));return db['CmHopper']['bulkCreate'](hopper2);})[_0x5e2b('0x7')](function(){console[_0x5e2b('0x9')](_0x5e2b('0xa'),_0x5e2b('0x10'));})[_0x5e2b('0x11')](function(_0x45ee0d){console[_0x5e2b('0x9')](_0x45ee0d);}); \ No newline at end of file +var _0x3691=['hopper1','hopper2','catch','util','../mysqldb','Biondo','innocenzo.biondo','now','push','destroy','then','CmContact','bulkCreate','finished\x20populating','contacts1','CmHopper','log'];(function(_0x17473c,_0xaf58d5){var _0x5e3226=function(_0x2a73a7){while(--_0x2a73a7){_0x17473c['push'](_0x17473c['shift']());}};_0x5e3226(++_0xaf58d5);}(_0x3691,0xcf));var _0x1369=function(_0x20db5e,_0x23a6b7){_0x20db5e=_0x20db5e-0x0;var _0x1772ab=_0x3691[_0x20db5e];return _0x1772ab;};'use strict';var util=require(_0x1369('0x0'));var db=require(_0x1369('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1369('0x2')+i,'phone':0xf879fb460+i,'email':_0x1369('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x1369('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x1369('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1369('0x5')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1369('0x2')+i,'phone':0xf879fb460+i,'email':_0x1369('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1369('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x1369('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1369('0x4')](),'updatedAt':Date[_0x1369('0x4')]()});}db['CmContact'][_0x1369('0x6')]({'where':{}})[_0x1369('0x7')](function(){return db[_0x1369('0x8')][_0x1369('0x9')](contacts);})[_0x1369('0x7')](function(){console['log'](_0x1369('0xa'),_0x1369('0xb'));return db[_0x1369('0xc')]['destroy']({'where':{}});})[_0x1369('0x7')](function(){return db['CmHopper'][_0x1369('0x9')](hopper);})[_0x1369('0x7')](function(){console[_0x1369('0xd')]('finished\x20populating',_0x1369('0xe'));return db[_0x1369('0x8')][_0x1369('0x9')](contacts2);})['then'](function(){console[_0x1369('0xd')](_0x1369('0xa'),'contacts2');return db[_0x1369('0xc')][_0x1369('0x9')](hopper2);})['then'](function(){console[_0x1369('0xd')](_0x1369('0xa'),_0x1369('0xf'));})[_0x1369('0x10')](function(_0x10fb5b){console[_0x1369('0xd')](_0x10fb5b);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index dd31c22..7a6e9db 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2bf=['agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','util','../mysqldb','push','format','%s%s'];(function(_0x10566b,_0x2e11b4){var _0x11d34b=function(_0x2f93d4){while(--_0x2f93d4){_0x10566b['push'](_0x10566b['shift']());}};_0x11d34b(++_0x2e11b4);}(_0xf2bf,0x8e));var _0xff2b=function(_0x443ec0,_0x186140){_0x443ec0=_0x443ec0-0x0;var _0x227249=_0xf2bf[_0x443ec0];return _0x227249;};'use strict';var util=require(_0xff2b('0x0'));var db=require(_0xff2b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xff2b('0x2')]({'name':util[_0xff2b('0x3')](_0xff2b('0x4'),'agent',i),'fullname':util[_0xff2b('0x3')]('%s%s',_0xff2b('0x5'),i),'email':util[_0xff2b('0x3')](_0xff2b('0x6'),_0xff2b('0x5'),i),'role':_0xff2b('0x5'),'password':_0xff2b('0x7'),'internal':0xfa0+i,'type':_0xff2b('0x8'),'transport':[_0xff2b('0x9'),'ws',_0xff2b('0xa')],'disallow':[_0xff2b('0xb')],'allow':['ulaw'],'defaultuser':util[_0xff2b('0x3')](_0xff2b('0x4'),'agent',i),'encryption':_0xff2b('0xc'),'avpf':_0xff2b('0xc'),'force_avp':_0xff2b('0xc'),'icesupport':_0xff2b('0xc'),'dtlsenable':_0xff2b('0xc'),'dtlsverify':'no','dtlscertfile':_0xff2b('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xff2b('0xe'),'callerid':util[_0xff2b('0x3')](_0xff2b('0xf'),util[_0xff2b('0x3')]('%s%s','agent',i),0xfa0+i)});}db[_0xff2b('0x10')][_0xff2b('0x11')](users)[_0xff2b('0x12')](function(){console['log'](_0xff2b('0x13'));})[_0xff2b('0x14')](function(_0x356151){console['log'](_0x356151);}); \ No newline at end of file +var _0xf9bd=['%s%s','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','push','format','agent'];(function(_0x1e4278,_0x19db75){var _0x2e3b28=function(_0x22e907){while(--_0x22e907){_0x1e4278['push'](_0x1e4278['shift']());}};_0x2e3b28(++_0x19db75);}(_0xf9bd,0xb9));var _0xdf9b=function(_0x3586bb,_0x511a05){_0x3586bb=_0x3586bb-0x0;var _0x55264f=_0xf9bd[_0x3586bb];return _0x55264f;};'use strict';var util=require(_0xdf9b('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xdf9b('0x1')]({'name':util[_0xdf9b('0x2')]('%s%s',_0xdf9b('0x3'),i),'fullname':util[_0xdf9b('0x2')](_0xdf9b('0x4'),_0xdf9b('0x3'),i),'email':util['format'](_0xdf9b('0x5'),'agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xdf9b('0x6'),'transport':[_0xdf9b('0x7'),'ws',_0xdf9b('0x8')],'disallow':[_0xdf9b('0x9')],'allow':[_0xdf9b('0xa')],'defaultuser':util[_0xdf9b('0x2')]('%s%s',_0xdf9b('0x3'),i),'encryption':'yes','avpf':_0xdf9b('0xb'),'force_avp':_0xdf9b('0xb'),'icesupport':'yes','dtlsenable':_0xdf9b('0xb'),'dtlsverify':'no','dtlscertfile':_0xdf9b('0xc'),'dtlsprivatekey':_0xdf9b('0xd'),'dtlssetup':_0xdf9b('0xe'),'callerid':util[_0xdf9b('0x2')](_0xdf9b('0xf'),util['format'](_0xdf9b('0x4'),_0xdf9b('0x3'),i),0xfa0+i)});}db[_0xdf9b('0x10')][_0xdf9b('0x11')](users)['then'](function(){console[_0xdf9b('0x12')](_0xdf9b('0x13'));})[_0xdf9b('0x14')](function(_0x37b9dd){console[_0xdf9b('0x12')](_0x37b9dd);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6afd127..863cdf6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9b7=['WhatsappQueue','user','VoiceQueues','FaxQueues','SmsQueue','Telephones','Trunks','Trunk','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','nsp','address','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','UserProfileSection','findOne','autoAssociation','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','then','map','where','role','Campaign','length','format','user:%s','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xf9b7,0x91));var _0x7f9b=function(_0x11683e,_0x460a93){_0x11683e=_0x11683e-0x0;var _0x1c32ff=_0xf9b7[_0x11683e];return _0x1c32ff;};'use strict';var _=require(_0x7f9b('0x0'));var util=require(_0x7f9b('0x1'));var BPromise=require(_0x7f9b('0x2'));var db=require(_0x7f9b('0x3'))['db'];var config=require(_0x7f9b('0x4'));var queryQueues={'attributes':['id',_0x7f9b('0x5')],'include':[{'as':_0x7f9b('0x6'),'model':db[_0x7f9b('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x7f9b('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7f9b('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7f9b('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7f9b('0x5'),_0x7f9b('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x52bbf1,_0x5251d0,_0x19c186){return db[_0x7f9b('0xb')][_0x7f9b('0xc')]({'where':{'name':_0x52bbf1,'userProfileId':_0x5251d0},'raw':!![]})['then'](function(_0x1c8e07){if(_0x1c8e07){if(_0x1c8e07[_0x7f9b('0xd')]){switch(_0x52bbf1){case'VoiceQueues':case _0x7f9b('0xe'):case'FaxQueues':case _0x7f9b('0xf'):case _0x7f9b('0x10'):case _0x7f9b('0x11'):case _0x7f9b('0x12'):return db[_0x19c186][_0x7f9b('0x13')](queryQueues);case'Telephones':return db[_0x19c186][_0x7f9b('0x13')](queryTelephones);case'Trunks':return db[_0x19c186][_0x7f9b('0x13')](queryTrunks);case _0x7f9b('0x14'):return db[_0x19c186][_0x7f9b('0x13')](queryCampaigns);}}else{return db[_0x7f9b('0x15')][_0x7f9b('0x13')]({'attributes':[_0x7f9b('0x16')],'where':{'sectionId':_0x1c8e07['id']},'raw':!![]})[_0x7f9b('0x17')](function(_0x2ba158){if(_0x2ba158){var _0x447255={'where':{'id':_[_0x7f9b('0x18')](_0x2ba158,_0x7f9b('0x16'))},'raw':!![]};switch(_0x19c186){case _0x7f9b('0x7'):_0x447255[_0x7f9b('0x19')][_0x7f9b('0x1a')]='telephone';break;case _0x7f9b('0x1b'):_0x447255['where'][_0x7f9b('0xa')]='ivr';break;}return db[_0x19c186][_0x7f9b('0x13')](_0x447255);}else{return[];}});}}else{return[];}})['then'](function(_0x5c2e23){return _0x5c2e23;});}function joinOrLeaveQueues(_0x5cec50,_0x269763,_0x5f3d29,_0x200b31){_0x5cec50[_0x269763](util['format']('%s:queue:%s',_0x5f3d29,_0x200b31[_0x7f9b('0x5')]));if(_0x200b31[_0x7f9b('0x6')]){for(var _0x318203=0x0;_0x318203<_0x200b31['Agents'][_0x7f9b('0x1c')];_0x318203+=0x1){_0x5cec50[_0x269763](util[_0x7f9b('0x1d')](_0x7f9b('0x1e'),_0x200b31['Agents'][_0x318203][_0x7f9b('0x5')]));}}}function joinOrLeave(_0x46eb86,_0x25b6ac,_0x28d6de){var _0x38e7d6;if(_0x46eb86['handshake']['query']['id']){db[_0x7f9b('0x7')][_0x7f9b('0x1f')]({'attributes':['id','name',_0x7f9b('0x1a'),_0x7f9b('0x20')],'where':{'id':_0x46eb86[_0x7f9b('0x21')][_0x7f9b('0x22')]['id']},'include':[{'model':db[_0x7f9b('0x23')],'as':_0x7f9b('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x26')],'as':_0x7f9b('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x28')],'as':_0x7f9b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f9b('0x2a')],'as':_0x7f9b('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0xe72154){if(_0xe72154){_0x38e7d6=_0xe72154;_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')]('user:%s',_0xe72154[_0x7f9b('0x5')]));var _0x5d5e47=[];switch(_0xe72154['role']){case'admin':_0x46eb86[_0x25b6ac](_0x7f9b('0x2c'));_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));if(queryQueues[_0x7f9b('0x2e')](_0x7f9b('0x2f'))){delete queryQueues[_0x7f9b('0x2f')];}_0x5d5e47[_0x7f9b('0x30')](db['VoiceQueue'][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x31')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x32')][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db['SmsQueue']['findAll'](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x33')][_0x7f9b('0x13')](queryQueues));_0x5d5e47['push'](db[_0x7f9b('0x34')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x35')][_0x7f9b('0x13')](queryQueues));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')]['findAll'](queryTelephones));_0x5d5e47['push'](db['Trunk'][_0x7f9b('0x13')](queryTrunks));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x1b')][_0x7f9b('0x13')](queryCampaigns));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')][_0x7f9b('0x13')](queryAgents));break;case _0x7f9b('0x36'):_0x46eb86[_0x25b6ac]('voice:inbound');_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x37'),_0xe72154[_0x7f9b('0x20')],'VoiceQueue'));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0xe'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x31')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x38'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x32')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0xf'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x39')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources('MailQueues',_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x33')));_0x5d5e47['push'](getAssociatedResources(_0x7f9b('0x11'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x34')));_0x5d5e47['push'](getAssociatedResources('WhatsappQueues',_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x35')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x3a'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x7')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x3b'),_0xe72154[_0x7f9b('0x20')],_0x7f9b('0x3c')));_0x5d5e47[_0x7f9b('0x30')](getAssociatedResources(_0x7f9b('0x14'),_0xe72154['userProfileId'],_0x7f9b('0x1b')));_0x5d5e47[_0x7f9b('0x30')](db[_0x7f9b('0x7')][_0x7f9b('0x13')](queryAgents));break;case'agent':_0x46eb86[_0x25b6ac](_0x7f9b('0x2c'));_0x46eb86[_0x25b6ac](_0x7f9b('0x2d'));_0x5d5e47['push'](_0xe72154[_0x7f9b('0x3d')]({'attributes':['id','name']}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x3e')]({'attributes':['id','name']}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154['getFaxQueues']({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47['push'](_0xe72154['getSmsQueues']({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x3f')]({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x40')]({'attributes':['id',_0x7f9b('0x5')]}));_0x5d5e47[_0x7f9b('0x30')](_0xe72154[_0x7f9b('0x41')]({'attributes':['id',_0x7f9b('0x5')]}));break;}return BPromise['all'](_0x5d5e47);}})[_0x7f9b('0x17')](function(_0x59d6de){if(_0x59d6de&&_0x59d6de[_0x7f9b('0x1c')]){for(var _0x19329c=0x0;_0x19329c<_0x59d6de['length'];_0x19329c+=0x1){for(var _0x4e76f8=0x0;_0x4e76f8<_0x59d6de[_0x19329c][_0x7f9b('0x1c')];_0x4e76f8+=0x1){switch(_0x19329c){case 0x0:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x42'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x1:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x43'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x2:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'fax',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x3:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'sms',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x4:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x44'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x5:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,_0x7f9b('0x45'),_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x6:joinOrLeaveQueues(_0x46eb86,_0x25b6ac,'whatsapp',_0x59d6de[_0x19329c][_0x4e76f8]);break;case 0x7:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')](_0x7f9b('0x46'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;case 0x8:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util[_0x7f9b('0x1d')](_0x7f9b('0x47'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;case 0x9:if(_0x38e7d6[_0x7f9b('0x1a')]!==_0x7f9b('0x8'))_0x46eb86[_0x25b6ac](util['format'](_0x7f9b('0x48'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0xa')],_0x59d6de[_0x19329c][_0x4e76f8]['name']));break;case 0xa:_0x46eb86[_0x25b6ac](util['format'](_0x7f9b('0x1e'),_0x59d6de[_0x19329c][_0x4e76f8][_0x7f9b('0x5')]));break;}}}}})[_0x7f9b('0x17')](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x298c40=_['map'](_0x38e7d6['ChatInteractions'],'id');return _0x38e7d6[_0x7f9b('0x4a')](_0x298c40)['then'](function(){for(var _0x175388=0x0;_0x175388<_0x298c40[_0x7f9b('0x1c')];_0x175388+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x4c'),{'ChatInteractionId':Number(_0x298c40[_0x175388]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x1d7551=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x4d')],'id');return _0x38e7d6['removeMailInteractions'](_0x1d7551)[_0x7f9b('0x17')](function(){for(var _0x3f7837=0x0;_0x3f7837<_0x1d7551[_0x7f9b('0x1c')];_0x3f7837+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x4e'),{'MailInteractionId':Number(_0x1d7551[_0x3f7837]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac==='leave'){var _0x5a818c=_[_0x7f9b('0x18')](_0x38e7d6['FaxInteractions'],'id');return _0x38e7d6[_0x7f9b('0x4f')](_0x5a818c)[_0x7f9b('0x17')](function(){for(var _0x4ba113=0x0;_0x4ba113<_0x5a818c['length'];_0x4ba113+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x50'),{'FaxInteractionId':Number(_0x5a818c[_0x4ba113]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x17')](function(){if(_0x25b6ac==='leave'){var _0x6496f0=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x29')],'id');return _0x38e7d6[_0x7f9b('0x51')](_0x6496f0)[_0x7f9b('0x17')](function(){for(var _0xb0d9b2=0x0;_0xb0d9b2<_0x6496f0[_0x7f9b('0x1c')];_0xb0d9b2+=0x1){_0x28d6de['emit'](_0x7f9b('0x52'),{'SmsInteractionId':Number(_0x6496f0[_0xb0d9b2]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x17')](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x51d3d=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x2b')],'id');return _0x38e7d6[_0x7f9b('0x53')](_0x51d3d)['then'](function(){for(var _0x1cdc78=0x0;_0x1cdc78<_0x51d3d[_0x7f9b('0x1c')];_0x1cdc78+=0x1){_0x28d6de[_0x7f9b('0x4b')](_0x7f9b('0x54'),{'OpenchannelInteractionId':Number(_0x51d3d[_0x1cdc78]),'UserId':Number(_0x38e7d6['id'])});}});}})['then'](function(){if(_0x25b6ac===_0x7f9b('0x49')){var _0x2956e2=_[_0x7f9b('0x18')](_0x38e7d6[_0x7f9b('0x55')],'id');return _0x38e7d6['removeWhatsappInteractions'](_0x2956e2)[_0x7f9b('0x17')](function(){for(var _0x588b22=0x0;_0x588b22<_0x2956e2[_0x7f9b('0x1c')];_0x588b22+=0x1){_0x28d6de['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2956e2[_0x588b22]),'UserId':Number(_0x38e7d6['id'])});}});}})[_0x7f9b('0x56')](function(_0x1a9268){_0x46eb86[_0x7f9b('0x57')](_0x1a9268);});}}function onDisconnect(_0xdf7724,_0x3556ab){joinOrLeave(_0xdf7724,_0x7f9b('0x49'),_0x3556ab);}function onConnect(_0x172525){joinOrLeave(_0x172525,_0x7f9b('0x58'));}exports['default']=function(_0x29b125){_0x29b125['on'](_0x7f9b('0x59'),function(_0x321b58){_0x321b58[_0x7f9b('0x5a')](0x0);_0x321b58['address']=_0x321b58[_0x7f9b('0x5b')][_0x7f9b('0x59')][_0x7f9b('0x5c')]+':'+_0x321b58[_0x7f9b('0x5b')][_0x7f9b('0x59')][_0x7f9b('0x5d')];_0x321b58['connectedAt']=new Date();_0x321b58['log']=function(_0x2a0376){console[_0x7f9b('0x57')](_0x7f9b('0x5e')+_0x321b58[_0x7f9b('0x5f')][_0x7f9b('0x5')]+'['+_0x321b58[_0x7f9b('0x60')]+']',_0x2a0376);};_0x321b58['on']('disconnect',function(){onDisconnect(_0x321b58,_0x29b125);_0x321b58['log'](_0x7f9b('0x61'));});onConnect(_0x321b58);_0x321b58['log'](_0x7f9b('0x62'));});}; \ No newline at end of file +var _0xdccd=['user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','VoiceQueue','SmsQueues','SmsQueue','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','chat','fax','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_mail_interactions:remove','leave','removeFaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','ivr','%s:queue:%s','length','format'];(function(_0x2e30c6,_0x1985ba){var _0x1bed54=function(_0x430f65){while(--_0x430f65){_0x2e30c6['push'](_0x2e30c6['shift']());}};_0x1bed54(++_0x1985ba);}(_0xdccd,0x102));var _0xddcc=function(_0x712ee,_0x31cde7){_0x712ee=_0x712ee-0x0;var _0x530cfc=_0xdccd[_0x712ee];return _0x530cfc;};'use strict';var _=require(_0xddcc('0x0'));var util=require(_0xddcc('0x1'));var BPromise=require(_0xddcc('0x2'));var db=require(_0xddcc('0x3'))['db'];var config=require(_0xddcc('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xddcc('0x5'),'model':db[_0xddcc('0x6')],'attributes':['id',_0xddcc('0x7'),_0xddcc('0x8')],'raw':!![],'where':{'role':_0xddcc('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xddcc('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0xddcc('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0xddcc('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xddcc('0x7'),_0xddcc('0xb')],'where':{'type':'ivr'}};function getAssociatedResources(_0x431beb,_0x2b96ae,_0x15e02f){return db[_0xddcc('0xc')][_0xddcc('0xd')]({'where':{'name':_0x431beb,'userProfileId':_0x2b96ae},'raw':!![]})[_0xddcc('0xe')](function(_0x1f192d){if(_0x1f192d){if(_0x1f192d['autoAssociation']){switch(_0x431beb){case _0xddcc('0xf'):case _0xddcc('0x10'):case _0xddcc('0x11'):case'SmsQueues':case _0xddcc('0x12'):case _0xddcc('0x13'):case _0xddcc('0x14'):return db[_0x15e02f][_0xddcc('0x15')](queryQueues);case _0xddcc('0x16'):return db[_0x15e02f][_0xddcc('0x15')](queryTelephones);case _0xddcc('0x17'):return db[_0x15e02f]['findAll'](queryTrunks);case _0xddcc('0x18'):return db[_0x15e02f][_0xddcc('0x15')](queryCampaigns);}}else{return db[_0xddcc('0x19')][_0xddcc('0x15')]({'attributes':[_0xddcc('0x1a')],'where':{'sectionId':_0x1f192d['id']},'raw':!![]})[_0xddcc('0xe')](function(_0x277dbc){if(_0x277dbc){var _0x5a6b55={'where':{'id':_['map'](_0x277dbc,_0xddcc('0x1a'))},'raw':!![]};switch(_0x15e02f){case _0xddcc('0x6'):_0x5a6b55[_0xddcc('0x1b')]['role']=_0xddcc('0xa');break;case _0xddcc('0x1c'):_0x5a6b55['where'][_0xddcc('0xb')]=_0xddcc('0x1d');break;}return db[_0x15e02f][_0xddcc('0x15')](_0x5a6b55);}else{return[];}});}}else{return[];}})[_0xddcc('0xe')](function(_0x1095ac){return _0x1095ac;});}function joinOrLeaveQueues(_0x676bf,_0x133f42,_0x15749a,_0x5f119f){_0x676bf[_0x133f42](util['format'](_0xddcc('0x1e'),_0x15749a,_0x5f119f[_0xddcc('0x7')]));if(_0x5f119f[_0xddcc('0x5')]){for(var _0xfc9ce7=0x0;_0xfc9ce7<_0x5f119f[_0xddcc('0x5')][_0xddcc('0x1f')];_0xfc9ce7+=0x1){_0x676bf[_0x133f42](util[_0xddcc('0x20')](_0xddcc('0x21'),_0x5f119f[_0xddcc('0x5')][_0xfc9ce7]['name']));}}}function joinOrLeave(_0x4c40c4,_0x1b8d29,_0x303750){var _0xa9503e;if(_0x4c40c4[_0xddcc('0x22')][_0xddcc('0x23')]['id']){db[_0xddcc('0x6')]['find']({'attributes':['id',_0xddcc('0x7'),_0xddcc('0x8'),_0xddcc('0x24')],'where':{'id':_0x4c40c4['handshake'][_0xddcc('0x23')]['id']},'include':[{'model':db[_0xddcc('0x25')],'as':_0xddcc('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xddcc('0x27')],'as':_0xddcc('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xddcc('0x29')],'as':_0xddcc('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xddcc('0x2b')],'as':_0xddcc('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0xddcc('0x2d')],'as':_0xddcc('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0xddcc('0x2f')],'as':_0xddcc('0x30'),'attributes':['id'],'raw':!![]}]})[_0xddcc('0xe')](function(_0x2223a4){if(_0x2223a4){_0xa9503e=_0x2223a4;_0x4c40c4[_0x1b8d29](util[_0xddcc('0x20')](_0xddcc('0x21'),_0x2223a4[_0xddcc('0x7')]));var _0x25aab0=[];switch(_0x2223a4[_0xddcc('0x8')]){case _0xddcc('0x31'):_0x4c40c4[_0x1b8d29]('voice:inbound');_0x4c40c4[_0x1b8d29](_0xddcc('0x32'));if(queryQueues[_0xddcc('0x33')](_0xddcc('0x34'))){delete queryQueues[_0xddcc('0x34')];}_0x25aab0['push'](db['VoiceQueue']['findAll'](queryQueues));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x36')][_0xddcc('0x15')](queryQueues));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x37')][_0xddcc('0x15')](queryQueues));_0x25aab0['push'](db['SmsQueue']['findAll'](queryQueues));_0x25aab0['push'](db[_0xddcc('0x38')][_0xddcc('0x15')](queryQueues));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x39')][_0xddcc('0x15')](queryQueues));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x3a')]['findAll'](queryQueues));_0x25aab0['push'](db[_0xddcc('0x6')]['findAll'](queryTelephones));_0x25aab0['push'](db[_0xddcc('0x3b')][_0xddcc('0x15')](queryTrunks));_0x25aab0['push'](db['Campaign'][_0xddcc('0x15')](queryCampaigns));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x6')]['findAll'](queryAgents));break;case'user':_0x4c40c4[_0x1b8d29]('voice:inbound');_0x4c40c4[_0x1b8d29](_0xddcc('0x32'));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0xf'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x3c')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x10'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x36')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources('FaxQueues',_0x2223a4[_0xddcc('0x24')],_0xddcc('0x37')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x3d'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x3e')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x12'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x38')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x13'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x39')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources('WhatsappQueues',_0x2223a4[_0xddcc('0x24')],_0xddcc('0x3a')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x16'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x6')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources(_0xddcc('0x17'),_0x2223a4[_0xddcc('0x24')],_0xddcc('0x3b')));_0x25aab0[_0xddcc('0x35')](getAssociatedResources('IvrCampaigns',_0x2223a4[_0xddcc('0x24')],_0xddcc('0x1c')));_0x25aab0[_0xddcc('0x35')](db[_0xddcc('0x6')][_0xddcc('0x15')](queryAgents));break;case _0xddcc('0x9'):_0x4c40c4[_0x1b8d29]('voice:inbound');_0x4c40c4[_0x1b8d29](_0xddcc('0x32'));_0x25aab0['push'](_0x2223a4[_0xddcc('0x3f')]({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0[_0xddcc('0x35')](_0x2223a4['getChatQueues']({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0['push'](_0x2223a4['getFaxQueues']({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0[_0xddcc('0x35')](_0x2223a4[_0xddcc('0x40')]({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0[_0xddcc('0x35')](_0x2223a4[_0xddcc('0x41')]({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0['push'](_0x2223a4[_0xddcc('0x42')]({'attributes':['id',_0xddcc('0x7')]}));_0x25aab0[_0xddcc('0x35')](_0x2223a4['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise['all'](_0x25aab0);}})['then'](function(_0x41da3c){if(_0x41da3c&&_0x41da3c[_0xddcc('0x1f')]){for(var _0x3f41ed=0x0;_0x3f41ed<_0x41da3c[_0xddcc('0x1f')];_0x3f41ed+=0x1){for(var _0x5a9039=0x0;_0x5a9039<_0x41da3c[_0x3f41ed][_0xddcc('0x1f')];_0x5a9039+=0x1){switch(_0x3f41ed){case 0x0:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,'voice',_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x1:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,_0xddcc('0x43'),_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x2:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,_0xddcc('0x44'),_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x3:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,'sms',_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x4:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,_0xddcc('0x45'),_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x5:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,_0xddcc('0x46'),_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x6:joinOrLeaveQueues(_0x4c40c4,_0x1b8d29,_0xddcc('0x47'),_0x41da3c[_0x3f41ed][_0x5a9039]);break;case 0x7:if(_0xa9503e[_0xddcc('0x8')]!==_0xddcc('0x9'))_0x4c40c4[_0x1b8d29](util[_0xddcc('0x20')](_0xddcc('0x48'),_0x41da3c[_0x3f41ed][_0x5a9039]['name']));break;case 0x8:if(_0xa9503e[_0xddcc('0x8')]!=='agent')_0x4c40c4[_0x1b8d29](util[_0xddcc('0x20')]('trunk:%s',_0x41da3c[_0x3f41ed][_0x5a9039][_0xddcc('0x7')]));break;case 0x9:if(_0xa9503e[_0xddcc('0x8')]!==_0xddcc('0x9'))_0x4c40c4[_0x1b8d29](util[_0xddcc('0x20')](_0xddcc('0x49'),_0x41da3c[_0x3f41ed][_0x5a9039][_0xddcc('0xb')],_0x41da3c[_0x3f41ed][_0x5a9039][_0xddcc('0x7')]));break;case 0xa:_0x4c40c4[_0x1b8d29](util[_0xddcc('0x20')]('user:%s',_0x41da3c[_0x3f41ed][_0x5a9039]['name']));break;}}}}})[_0xddcc('0xe')](function(){if(_0x1b8d29==='leave'){var _0x29f70d=_[_0xddcc('0x4a')](_0xa9503e[_0xddcc('0x26')],'id');return _0xa9503e[_0xddcc('0x4b')](_0x29f70d)[_0xddcc('0xe')](function(){for(var _0x4bb734=0x0;_0x4bb734<_0x29f70d['length'];_0x4bb734+=0x1){_0x303750[_0xddcc('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x29f70d[_0x4bb734]),'UserId':Number(_0xa9503e['id'])});}});}})['then'](function(){if(_0x1b8d29==='leave'){var _0x4b3954=_[_0xddcc('0x4a')](_0xa9503e[_0xddcc('0x28')],'id');return _0xa9503e['removeMailInteractions'](_0x4b3954)[_0xddcc('0xe')](function(){for(var _0x767f3c=0x0;_0x767f3c<_0x4b3954['length'];_0x767f3c+=0x1){_0x303750[_0xddcc('0x4c')](_0xddcc('0x4d'),{'MailInteractionId':Number(_0x4b3954[_0x767f3c]),'UserId':Number(_0xa9503e['id'])});}});}})[_0xddcc('0xe')](function(){if(_0x1b8d29===_0xddcc('0x4e')){var _0x1c9ff5=_[_0xddcc('0x4a')](_0xa9503e[_0xddcc('0x2a')],'id');return _0xa9503e[_0xddcc('0x4f')](_0x1c9ff5)[_0xddcc('0xe')](function(){for(var _0x2667d2=0x0;_0x2667d2<_0x1c9ff5['length'];_0x2667d2+=0x1){_0x303750[_0xddcc('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1c9ff5[_0x2667d2]),'UserId':Number(_0xa9503e['id'])});}});}})[_0xddcc('0xe')](function(){if(_0x1b8d29===_0xddcc('0x4e')){var _0x585d52=_[_0xddcc('0x4a')](_0xa9503e[_0xddcc('0x2c')],'id');return _0xa9503e['removeSmsInteractions'](_0x585d52)['then'](function(){for(var _0xa8b8c4=0x0;_0xa8b8c4<_0x585d52[_0xddcc('0x1f')];_0xa8b8c4+=0x1){_0x303750[_0xddcc('0x4c')](_0xddcc('0x50'),{'SmsInteractionId':Number(_0x585d52[_0xa8b8c4]),'UserId':Number(_0xa9503e['id'])});}});}})[_0xddcc('0xe')](function(){if(_0x1b8d29===_0xddcc('0x4e')){var _0x15c17c=_[_0xddcc('0x4a')](_0xa9503e[_0xddcc('0x2e')],'id');return _0xa9503e[_0xddcc('0x51')](_0x15c17c)[_0xddcc('0xe')](function(){for(var _0x5bad5f=0x0;_0x5bad5f<_0x15c17c['length'];_0x5bad5f+=0x1){_0x303750['emit'](_0xddcc('0x52'),{'OpenchannelInteractionId':Number(_0x15c17c[_0x5bad5f]),'UserId':Number(_0xa9503e['id'])});}});}})[_0xddcc('0xe')](function(){if(_0x1b8d29===_0xddcc('0x4e')){var _0xf2ee37=_[_0xddcc('0x4a')](_0xa9503e['WhatsappInteractions'],'id');return _0xa9503e[_0xddcc('0x53')](_0xf2ee37)[_0xddcc('0xe')](function(){for(var _0x408c48=0x0;_0x408c48<_0xf2ee37[_0xddcc('0x1f')];_0x408c48+=0x1){_0x303750['emit'](_0xddcc('0x54'),{'WhatsappInteractionId':Number(_0xf2ee37[_0x408c48]),'UserId':Number(_0xa9503e['id'])});}});}})[_0xddcc('0x55')](function(_0x32e358){_0x4c40c4[_0xddcc('0x56')](_0x32e358);});}}function onDisconnect(_0x964fd0,_0x22abbd){joinOrLeave(_0x964fd0,_0xddcc('0x4e'),_0x22abbd);}function onConnect(_0x174c4e){joinOrLeave(_0x174c4e,'join');}exports[_0xddcc('0x57')]=function(_0x5839d3){_0x5839d3['on']('connection',function(_0x2d3444){_0x2d3444['setMaxListeners'](0x0);_0x2d3444['address']=_0x2d3444[_0xddcc('0x58')][_0xddcc('0x59')][_0xddcc('0x5a')]+':'+_0x2d3444['request'][_0xddcc('0x59')][_0xddcc('0x5b')];_0x2d3444[_0xddcc('0x5c')]=new Date();_0x2d3444[_0xddcc('0x56')]=function(_0x3ef936){console[_0xddcc('0x56')](_0xddcc('0x5d')+_0x2d3444[_0xddcc('0x5e')][_0xddcc('0x7')]+'['+_0x2d3444[_0xddcc('0x5f')]+']',_0x3ef936);};_0x2d3444['on']('disconnect',function(){onDisconnect(_0x2d3444,_0x5839d3);_0x2d3444[_0xddcc('0x56')](_0xddcc('0x60'));});onConnect(_0x2d3444);_0x2d3444['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index ac3c325..628f490 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 _0x5237=['hook','callback','toLowerCase','../../mysqldb','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','afterUpdate','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','then','info','Trigger,\x20%s','error','code','EventManager','catch','get','channel','motionChannel','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','SIP/%s','agent','incomingmessage','outgoingmessage','AfterCreateMessage','event','offlineMessage','opened','sequelize','format','name','AfterCreate','changed','closed','substatus','AfterUpdate','find','fullname','email','internal','default','length','hasOwnProperty','model'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5237,0x1cb));var _0x7523=function(_0x2a628e,_0x3d2e54){_0x2a628e=_0x2a628e-0x0;var _0x573ef9=_0x5237[_0x2a628e];return _0x573ef9;};'use strict';var util=require('util');var db=require(_0x7523('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x7523('0x1'))(_0x7523('0x2'));var client=jayson[_0x7523('0x3')][_0x7523('0x4')]({'port':0x232a});var triggers=[{'channel':_0x7523('0x5'),'model':_0x7523('0x6'),'event':_0x7523('0x7'),'condition':_0x7523('0x8'),'callback':afterCreate},{'channel':_0x7523('0x5'),'model':_0x7523('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7523('0x5'),'model':_0x7523('0x9'),'event':_0x7523('0x7'),'condition':_0x7523('0xa'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x7523('0xb'),'event':_0x7523('0x7'),'condition':_0x7523('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0x7523('0xc'),'model':_0x7523('0xd'),'event':_0x7523('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7523('0xc'),'model':'SmsInteraction','event':_0x7523('0xe'),'condition':_0x7523('0xf'),'callback':afterUpdate},{'channel':_0x7523('0xc'),'model':_0x7523('0x10'),'event':_0x7523('0x7'),'condition':_0x7523('0xa'),'callback':afterCreateMessage},{'channel':_0x7523('0x11'),'model':_0x7523('0x12'),'event':'afterCreate','condition':_0x7523('0x8'),'callback':afterCreate},{'channel':_0x7523('0x11'),'model':_0x7523('0x12'),'event':_0x7523('0xe'),'condition':_0x7523('0xf'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x7523('0x13'),'event':_0x7523('0x7'),'condition':_0x7523('0xa'),'callback':afterCreateMessage},{'channel':_0x7523('0x14'),'model':_0x7523('0x15'),'event':_0x7523('0x7'),'condition':_0x7523('0x8'),'callback':afterCreate},{'channel':_0x7523('0x14'),'model':_0x7523('0x15'),'event':_0x7523('0xe'),'condition':_0x7523('0xf'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x7523('0x7'),'condition':_0x7523('0xa'),'callback':afterCreateMessage},{'channel':_0x7523('0x16'),'model':_0x7523('0x17'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x7523('0x16'),'model':'MailInteraction','event':_0x7523('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7523('0x16'),'model':_0x7523('0x18'),'event':_0x7523('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7523('0x19'),'model':_0x7523('0x1a'),'event':_0x7523('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7523('0x19'),'model':_0x7523('0x1a'),'event':'afterUpdate','condition':_0x7523('0xf'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0x7523('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x45e845){return client['request']('EventManager',_0x45e845)[_0x7523('0x1b')](function(_0x168a2f){logger[_0x7523('0x1c')](_0x7523('0x1d'),'EventManager',_0x168a2f);if(_0x168a2f[_0x7523('0x1e')]){if(_0x168a2f[_0x7523('0x1e')][_0x7523('0x1f')]===0x1f4){logger['error'](_0x7523('0x1d'),_0x7523('0x20'),_0x168a2f[_0x7523('0x1e')]);}}})[_0x7523('0x21')](function(_0x5ae758){logger['error'](_0x7523('0x1d'),_0x7523('0x20'),_0x5ae758);});}function afterCreateMessage(_0xc75500){return function(_0x3bac8a){_0x3bac8a=_0x3bac8a[_0x7523('0x22')]({'plain':!![]});_0x3bac8a[_0x7523('0x23')]=_0xc75500;_0x3bac8a[_0x7523('0x24')]=_0xc75500;_0x3bac8a['event']=_0x3bac8a[_0x7523('0x25')];Promise[_0x7523('0x26')]()[_0x7523('0x1b')](function(){if(typeof _0x3bac8a[_0x7523('0x27')]==='undefined')return null;var _0x5747d0=_0x7523('0x28')+_0x3bac8a[_0x7523('0x27')];return db['sequelize'][_0x7523('0x29')](_0x5747d0,{'type':db[_0x7523('0x2a')][_0x7523('0x2b')][_0x7523('0x2c')],'raw':!![]});})['then'](function(_0x1cd82e){if(_0x1cd82e){_0x3bac8a[_0x7523('0x2d')]=_0x1cd82e[0x0];}if(typeof _0x3bac8a[_0x7523('0x2e')]===_0x7523('0x2f'))return;return getAgent(_0x3bac8a[_0x7523('0x2e')]);})['then'](function(_0x1080d5){if(_0x1080d5){_0x3bac8a[_0x7523('0x30')]=util['format'](_0x7523('0x31'),_0x1080d5['name']);_0x3bac8a[_0x7523('0x32')]=_0x1080d5;_0x3bac8a[_0x7523('0x23')]=_0xc75500;return request({'event':_0x7523('0x33'),'message':_0x3bac8a});}else{return request({'event':_0x7523('0x34'),'message':_0x3bac8a});}})['catch'](function(_0xceed72){logger[_0x7523('0x1e')](_0x7523('0x1d'),_0x7523('0x35'),_0xceed72);});};}function afterCreateOfflineMessage(_0x3ffb03){return function(_0x52ef92){_0x52ef92=_0x52ef92[_0x7523('0x22')]({'plain':!![]});_0x52ef92[_0x7523('0x23')]=_0x3ffb03;_0x52ef92[_0x7523('0x24')]=_0x3ffb03;_0x52ef92[_0x7523('0x36')]=_0x7523('0x37');return request({'event':_0x52ef92['event'],'message':_0x52ef92});};}function afterCreate(_0x242b87,_0x4fcf01){return function(_0x1987b3){_0x1987b3=_0x1987b3['get']({'plain':!![]});_0x1987b3[_0x7523('0x23')]=_0x242b87;_0x1987b3[_0x7523('0x24')]=_0x242b87;_0x1987b3[_0x7523('0x36')]=_0x7523('0x38');Promise[_0x7523('0x26')]()['then'](function(){var _0x438448='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1987b3[_0x7523('0x27')];return db[_0x7523('0x39')][_0x7523('0x29')](_0x438448,{'type':db[_0x7523('0x2a')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x7523('0x1b')](function(_0x4587e3){if(_0x4587e3){_0x1987b3['contact']=_0x4587e3[0x0];}if(typeof _0x1987b3[_0x7523('0x2e')]===_0x7523('0x2f'))return;return getAgent(_0x1987b3[_0x7523('0x2e')]);})[_0x7523('0x1b')](function(_0x139af0){if(_0x139af0){_0x1987b3['interface']=util[_0x7523('0x3a')](_0x7523('0x31'),_0x139af0[_0x7523('0x3b')]);_0x1987b3[_0x7523('0x32')]=_0x139af0;}return request({'event':_0x4fcf01,'message':_0x1987b3});})['catch'](function(_0x2afc00){logger[_0x7523('0x1e')]('Trigger,\x20%s',_0x7523('0x3c'),_0x2afc00);});};}function afterUpdate(_0x3d8146){return function(_0x4124e4){var _0x2095d7=_0x4124e4[_0x7523('0x3d')](_0x7523('0x3e'))&&_0x4124e4[_0x7523('0x3e')];var _0x4f7925=_0x4124e4[_0x7523('0x3d')]('substatus');if(_0x2095d7||_0x4f7925){var _0x4dace8=_0x2095d7?_0x7523('0xf'):_0x7523('0x3f');var _0x5ad5b7=_0x4124e4['get']({'plain':!![]});_0x5ad5b7[_0x7523('0x23')]=_0x3d8146;_0x5ad5b7['motionChannel']=_0x3d8146;_0x5ad5b7[_0x7523('0x36')]=_0x2095d7?'closed':_0x7523('0x3f');var _0x339eb4=_0x7523('0x28')+_0x5ad5b7[_0x7523('0x27')];return db[_0x7523('0x39')][_0x7523('0x29')](_0x339eb4,{'type':db[_0x7523('0x2a')]['QueryTypes'][_0x7523('0x2c')],'raw':!![]})[_0x7523('0x1b')](function(_0x564023){if(_0x564023){_0x5ad5b7[_0x7523('0x2d')]=_0x564023[0x0];}if(typeof _0x5ad5b7[_0x7523('0x2e')]===_0x7523('0x2f'))return;return getAgent(_0x5ad5b7[_0x7523('0x2e')]);})[_0x7523('0x1b')](function(_0x1e3cca){if(_0x1e3cca){_0x5ad5b7[_0x7523('0x30')]=util['format'](_0x7523('0x31'),_0x1e3cca[_0x7523('0x3b')]);_0x5ad5b7['agent']=_0x1e3cca;}return request({'event':_0x4dace8,'message':_0x5ad5b7});})[_0x7523('0x21')](function(_0x429fcf){logger[_0x7523('0x1e')](_0x7523('0x1d'),_0x7523('0x40'),_0x429fcf);});}};}function getAgent(_0x302b2f){return db['User'][_0x7523('0x41')]({'where':{'id':_0x302b2f},'attributes':['id',_0x7523('0x3b'),_0x7523('0x42'),_0x7523('0x43'),_0x7523('0x44')],'raw':!![]})['then'](function(_0x4b887d){return _0x4b887d;});}exports[_0x7523('0x45')]=function(){for(var _0x275f75=0x0;_0x275f75=_0x301d0b[_0x8f81('0x11')]){throw Error(_0x8f81('0x12'));}_0x304c43(_0x24ef6c);})[_0x8f81('0x13')](function(_0x5aa321){_0x15b5b6(_0x5aa321);});});}; \ No newline at end of file +var _0x1643=['catch','lodash','bluebird','../mysqldb','./license/util','chat','fax','sms','whatsapp','isValidChannel','includes','clearBlockUser','role','count','agent','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x279286,_0x40754e){var _0x343392=function(_0x423683){while(--_0x423683){_0x279286['push'](_0x279286['shift']());}};_0x343392(++_0x40754e);}(_0x1643,0x131));var _0x3164=function(_0x17f97d,_0x629f23){_0x17f97d=_0x17f97d-0x0;var _0x3e488b=_0x1643[_0x17f97d];return _0x3e488b;};'use strict';var _=require(_0x3164('0x0'));var BPromise=require(_0x3164('0x1'));var db=require(_0x3164('0x2'))['db'];var util=require(_0x3164('0x3'));var channels=['voice','mail',_0x3164('0x4'),_0x3164('0x5'),_0x3164('0x6'),_0x3164('0x7'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x3164('0x8')]=function(_0x44ce9d){_0x44ce9d=_0x44ce9d['toLowerCase']();return _[_0x3164('0x9')](channels,_0x44ce9d);};exports[_0x3164('0xa')]=function(_0x345662,_0x1ad28e,_0x416dc6,_0x2fb306){var _0x4dad76={'loginAttempts':_0x1ad28e,'blocked':_0x416dc6};if(!_['isUndefined'](_0x2fb306)){_0x4dad76['blockedAt']=_0x2fb306;}return _0x345662['updateAttributes'](_0x4dad76);};exports['getLicense']=function(_0x1635b0){return new BPromise(function(_0x16df7b,_0x11b2eb){var _0x20b6d9=0x0;if(_0x1635b0[_0x3164('0xb')]!=='agent'){_0x16df7b(_0x1635b0);}db['User'][_0x3164('0xc')]({'where':{'role':_0x3164('0xd'),'online':!![],'id':{'$ne':_0x1635b0['id']}}})[_0x3164('0xe')](function(_0x317382){_0x20b6d9=_0x317382;return util[_0x3164('0xf')]();})[_0x3164('0xe')](function(_0x165236){if(_0x165236&&_0x165236[_0x3164('0x10')]&&_0x20b6d9>=_0x165236[_0x3164('0x10')]){throw Error(_0x3164('0x11'));}_0x16df7b(_0x1635b0);})[_0x3164('0x12')](function(_0x45092d){_0x11b2eb(_0x45092d);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 562d0ab..f14a7b9 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdace=['send','exports','util','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','status'];(function(_0x22c7c4,_0x3cb514){var _0x5119a4=function(_0x3e2e76){while(--_0x3e2e76){_0x22c7c4['push'](_0x22c7c4['shift']());}};_0x5119a4(++_0x3cb514);}(_0xdace,0xc5));var _0xedac=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xdace[_0x1abb09];return _0xea1c07;};'use strict';var util=require(_0xedac('0x0'));var logger=require('../config/logger')(_0xedac('0x1'));var APIError=function(_0x13adb5,_0x46eba0){this['message']=_0x13adb5||_0xedac('0x2');this[_0xedac('0x3')]=_0x46eba0||_0xedac('0x4');util[_0xedac('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5a97c0){this[_0xedac('0x6')]=_0x5a97c0||_0xedac('0x7');this[_0xedac('0x3')]='Bad\x20Request';util[_0xedac('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x21440e){this[_0xedac('0x6')]=_0x21440e||'Entity\x20not\x20found';this[_0xedac('0x3')]=_0xedac('0x8');util[_0xedac('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4af030){switch(_0x4af030){case'Bad\x20Request':return 0x190;case _0xedac('0x9'),_0xedac('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d6a29){return function(_0x4db2ad){logger[_0xedac('0xb')](_0x4db2ad['stack']);var _0x261401=getStatusCode(_0x4db2ad['name']);if(_0x4db2ad[_0xedac('0x3')])delete _0x4db2ad[_0xedac('0x3')];return _0x4d6a29[_0xedac('0xc')](_0x261401)[_0xedac('0xd')](_0x4db2ad);};}module[_0xedac('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x1e40b0,_0x5f2090){var _0x2a34c1=function(_0x463552){while(--_0x463552){_0x1e40b0['push'](_0x1e40b0['shift']());}};_0x2a34c1(++_0x5f2090);}(_0xb821,0xa7));var _0x1b82=function(_0x90deef,_0x2ceee6){_0x90deef=_0x90deef-0x0;var _0x14fa42=_0xb821[_0x90deef];return _0x14fa42;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 3c4b9c3..c2b59e2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f85=['exports','404','status','render','json'];(function(_0x19e642,_0x4a902a){var _0x1795ae=function(_0x1110bb){while(--_0x1110bb){_0x19e642['push'](_0x19e642['shift']());}};_0x1795ae(++_0x4a902a);}(_0x9f85,0xf5));var _0x59f8=function(_0x1abe2f,_0x32e47c){_0x1abe2f=_0x1abe2f-0x0;var _0x4bbe3f=_0x9f85[_0x1abe2f];return _0x4bbe3f;};'use strict';module[_0x59f8('0x0')][0x194]=function pageNotFound(_0x5a7d8e,_0x22abd8){var _0x42ab47=_0x59f8('0x1');var _0x225e68=0x194;var _0x3fa33b={'status':_0x225e68};_0x22abd8[_0x59f8('0x2')](_0x3fa33b[_0x59f8('0x2')]);_0x22abd8[_0x59f8('0x3')](_0x42ab47,{},function(_0x1d89ca,_0x39240e){if(_0x1d89ca){return _0x22abd8[_0x59f8('0x2')](_0x3fa33b[_0x59f8('0x2')])[_0x59f8('0x4')](_0x3fa33b);}_0x22abd8['send'](_0x39240e);});}; \ No newline at end of file +var _0x7fff=['render','json','exports','404','status'];(function(_0x99d983,_0x20efdd){var _0x3ea576=function(_0x46b1e5){while(--_0x46b1e5){_0x99d983['push'](_0x99d983['shift']());}};_0x3ea576(++_0x20efdd);}(_0x7fff,0x1a6));var _0xf7ff=function(_0x2b9314,_0x5e9693){_0x2b9314=_0x2b9314-0x0;var _0x4f7b2e=_0x7fff[_0x2b9314];return _0x4f7b2e;};'use strict';module[_0xf7ff('0x0')][0x194]=function pageNotFound(_0x53ced3,_0x568f44){var _0x39d438=_0xf7ff('0x1');var _0x381de9=0x194;var _0x390aa3={'status':_0x381de9};_0x568f44['status'](_0x390aa3[_0xf7ff('0x2')]);_0x568f44[_0xf7ff('0x3')](_0x39d438,{},function(_0x1bc252,_0x28f39f){if(_0x1bc252){return _0x568f44['status'](_0x390aa3[_0xf7ff('0x2')])[_0xf7ff('0x4')](_0x390aa3);}_0x568f44['send'](_0x28f39f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 86f583d..8a71ee0 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a7d=['Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../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','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','AgentReports','Contact','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','Applications','ListId','Agents','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','Users','Attachments','ChatWebsiteId','ChatOfflineMessageId','TagId','List','Items','FaxAccountId','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','ThroughTags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','user_has_chat_websites','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','Website','CompanyId','Phones','CmContactId','CmHopper','cm_contact_has_tags','Agent','Campaign','CampaignId','OwnerId','Condition','All','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','DefaultReportId','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','Configurations','int_desk_configuration_has_tags','ZohoConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','MailQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromUserId','ToFaxAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','utf8mb4','name','defaultsDeep','sequelizeHistory','127.0.0.1','mysql','utf8','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model'];(function(_0x45e1ca,_0x1d9d40){var _0x20a9cc=function(_0x13deb9){while(--_0x13deb9){_0x45e1ca['push'](_0x45e1ca['shift']());}};_0x20a9cc(++_0x1d9d40);}(_0x4a7d,0x1b7));var _0xd4a7=function(_0x42dab7,_0x59aa29){_0x42dab7=_0x42dab7-0x0;var _0x271a0f=_0x4a7d[_0x42dab7];return _0x271a0f;};'use strict';var config=require(_0xd4a7('0x0'));var Sequelize=require(_0xd4a7('0x1'));var _=require(_0xd4a7('0x2'));var jstz=require(_0xd4a7('0x3'));var timezone=jstz[_0xd4a7('0x4')]();config[_0xd4a7('0x1')]=_['defaultsDeep'](config[_0xd4a7('0x1')],{'database':_0xd4a7('0x5'),'username':_0xd4a7('0x6'),'password':_0xd4a7('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd4a7('0x8')},'logging':![],'timezone':timezone[_0xd4a7('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xd4a7('0xa')](config[_0xd4a7('0xb')],{'database':'motion2','username':'xcall','password':_0xd4a7('0x7'),'options':{'host':_0xd4a7('0xc'),'port':0xcea,'dialect':_0xd4a7('0xd'),'dialectOptions':{'charset':_0xd4a7('0x8')},'logging':![],'timezone':timezone[_0xd4a7('0x9')](),'define':{'charset':_0xd4a7('0xe'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd4a7('0x1')][_0xd4a7('0xf')],config[_0xd4a7('0x1')][_0xd4a7('0x10')],config[_0xd4a7('0x1')]['password'],config[_0xd4a7('0x1')][_0xd4a7('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd4a7('0xb')][_0xd4a7('0xf')],config[_0xd4a7('0xb')]['username'],config[_0xd4a7('0xb')][_0xd4a7('0x12')],config['sequelizeHistory']['options'])};db[_0xd4a7('0x13')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x15'));db[_0xd4a7('0x16')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x17'));db[_0xd4a7('0x18')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x19'));db[_0xd4a7('0x1a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x1b'));db[_0xd4a7('0x1c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x1d'));db[_0xd4a7('0x1e')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x1f'));db[_0xd4a7('0x20')]=db['sequelize']['import'](_0xd4a7('0x21'));db[_0xd4a7('0x22')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x23'));db[_0xd4a7('0x24')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceMail/voiceMail.model');db[_0xd4a7('0x25')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x26'));db['VoiceCallReport']=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x27'));db[_0xd4a7('0x28')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xd4a7('0x29')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x2a'));db[_0xd4a7('0x2b')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xd4a7('0x2c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x2d'));db[_0xd4a7('0x2e')]=db['sequelize']['import'](_0xd4a7('0x2f'));db['VoiceTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x30'));db[_0xd4a7('0x31')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x32'));db[_0xd4a7('0x33')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd4a7('0x34')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x35'));db[_0xd4a7('0x36')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x37'));db['UserFaxQueue']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x38'));db[_0xd4a7('0x39')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0xd4a7('0x3a')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd4a7('0x3b')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x3c'));db[_0xd4a7('0x3d')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x3e'));db[_0xd4a7('0x3f')]=db['sequelize']['import'](_0xd4a7('0x40'));db[_0xd4a7('0x41')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x42'));db[_0xd4a7('0x43')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x44'));db['MailSubstatus']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x45'));db[_0xd4a7('0x46')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x47'));db[_0xd4a7('0x48')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x49'));db[_0xd4a7('0x4a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x4b'));db[_0xd4a7('0x4c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x4d'));db[_0xd4a7('0x4e')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x4f'));db[_0xd4a7('0x50')]=db['sequelize']['import'](_0xd4a7('0x51'));db[_0xd4a7('0x52')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x53'));db[_0xd4a7('0x54')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x55'));db[_0xd4a7('0x56')]=db[_0xd4a7('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x57'));db[_0xd4a7('0x58')]=db['sequelize']['import'](_0xd4a7('0x59'));db[_0xd4a7('0x5a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x5b'));db[_0xd4a7('0x5c')]=db['sequelize'][_0xd4a7('0x14')]('../api/smsAccount/smsAccount.model');db[_0xd4a7('0x5d')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0xd4a7('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x5e'));db[_0xd4a7('0x5f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x60'));db[_0xd4a7('0x61')]=db['sequelize']['import'](_0xd4a7('0x62'));db[_0xd4a7('0x63')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x64'));db[_0xd4a7('0x65')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x66'));db[_0xd4a7('0x67')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x68'));db[_0xd4a7('0x69')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x6a'));db['ChatWebsite']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0xd4a7('0x6b')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x6c'));db[_0xd4a7('0x6d')]=db['sequelize']['import'](_0xd4a7('0x6e'));db[_0xd4a7('0x6f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x70'));db[_0xd4a7('0x71')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x72'));db[_0xd4a7('0x73')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x74'));db[_0xd4a7('0x75')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatQueue/chatQueue.model');db[_0xd4a7('0x76')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x77'));db['ChatProactiveAction']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xd4a7('0x78')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x79'));db[_0xd4a7('0x7a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x7b'));db['CmHopper']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/cmHopper/cmHopper.model');db[_0xd4a7('0x7c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x7d'));db['CmHopperFinal']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x7e'));db[_0xd4a7('0x7f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x80'));db[_0xd4a7('0x81')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x82'));db[_0xd4a7('0x83')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x84'));db[_0xd4a7('0x85')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x86'));db[_0xd4a7('0x87')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x88'));db[_0xd4a7('0x89')]=db['sequelize'][_0xd4a7('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0xd4a7('0x8a')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x8b'));db['Condition']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/condition/condition.model');db['Interval']=db['sequelize']['import'](_0xd4a7('0x8c'));db[_0xd4a7('0x8d')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x8e'));db[_0xd4a7('0x8f')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x90'));db[_0xd4a7('0x91')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x92'));db[_0xd4a7('0x93')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x94'));db[_0xd4a7('0x95')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x96'));db[_0xd4a7('0x97')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x98'));db[_0xd4a7('0x99')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x9a'));db[_0xd4a7('0x9b')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x9c'));db[_0xd4a7('0x9d')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x9e'));db[_0xd4a7('0x9f')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xa0'));db[_0xd4a7('0xa1')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa2'));db[_0xd4a7('0xa3')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa4'));db[_0xd4a7('0xa5')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa6'));db['IntegrationReport']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xa7'));db[_0xd4a7('0xa8')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa9'));db[_0xd4a7('0xaa')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xab'));db[_0xd4a7('0xac')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xad'));db[_0xd4a7('0xae')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xaf'));db['AnalyticFieldReport']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb0'));db[_0xd4a7('0xb1')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb2'));db[_0xd4a7('0xb3')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd4a7('0xb4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xb5'));db[_0xd4a7('0xb6')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xb7'));db[_0xd4a7('0xb8')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xb9'));db[_0xd4a7('0xba')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xbb'));db[_0xd4a7('0xbc')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xbd'));db[_0xd4a7('0xbe')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xbf'));db[_0xd4a7('0xc0')]=db[_0xd4a7('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xd4a7('0xc1')]=db['sequelize']['import'](_0xd4a7('0xc2'));db['ZohoConfiguration']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc3'));db[_0xd4a7('0xc4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc5'));db[_0xd4a7('0xc6')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xc7'));db[_0xd4a7('0xc8')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xc9'));db[_0xd4a7('0xca')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xcb'));db[_0xd4a7('0xcc')]=db['sequelize'][_0xd4a7('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xd4a7('0xcd')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xce'));db[_0xd4a7('0xcf')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xd0'));db[_0xd4a7('0xd1')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xd2'));db[_0xd4a7('0xd3')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xd4'));db[_0xd4a7('0xd5')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xd6'));db[_0xd4a7('0xd7')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xd8'));db[_0xd4a7('0xd9')]=db[_0xd4a7('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xd4a7('0xda')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xdb'));db['Dynamics365Account']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xd4a7('0xdc')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xdd'));db[_0xd4a7('0xde')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xdf'));db['FreshsalesAccount']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xd4a7('0xe0')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe1'));db[_0xd4a7('0xa5')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xa6'));db[_0xd4a7('0xe2')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xe3'));db[_0xd4a7('0xe4')]=db['sequelize'][_0xd4a7('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0xd4a7('0xe5')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe6'));db[_0xd4a7('0xe7')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xe8'));db[_0xd4a7('0xe9')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xea'));db[_0xd4a7('0xeb')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xec'));db[_0xd4a7('0xed')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xee'));db['SquareDetailsReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xef'));db[_0xd4a7('0xf0')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xf1'));db[_0xd4a7('0xf2')]=db[_0xd4a7('0x1')]['import']('../api/setting/setting.model');db[_0xd4a7('0xf3')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0xd4a7('0xf4')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xf5'));db[_0xd4a7('0xf6')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xf7'));db[_0xd4a7('0xf8')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0xf9'));db[_0xd4a7('0xfa')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xfb'));db[_0xd4a7('0xfc')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0xfd'));db['Campaign']=db[_0xd4a7('0x1')]['import']('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xd4a7('0x14')]('../api/migration/migration.model');db[_0xd4a7('0xfe')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0xff'));db['Plugin']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x100'));db[_0xd4a7('0x101')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x102'));db['ChatTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x103'));db[_0xd4a7('0x104')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x105'));db[_0xd4a7('0x106')]=db['sequelize'][_0xd4a7('0x14')](_0xd4a7('0x107'));db['CmList']=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x108'));db[_0xd4a7('0x109')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xd4a7('0x10a')]=db['sequelize'][_0xd4a7('0x14')]('../api/userProfile/userProfile.model');db[_0xd4a7('0x10b')]=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0xd4a7('0x10c')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x10d'));db['UserNotification']=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x10e'));db[_0xd4a7('0x10f')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x110'));db[_0xd4a7('0x111')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x112'));db[_0xd4a7('0x113')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xd4a7('0x114')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x115'));db[_0xd4a7('0x116')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x117'));db[_0xd4a7('0x118')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x119'));db[_0xd4a7('0x11a')]=db['sequelize'][_0xd4a7('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0xd4a7('0x11b')]=db['sequelize'][_0xd4a7('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0xd4a7('0x11c')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x11d'));db[_0xd4a7('0x11e')]=db[_0xd4a7('0x1')][_0xd4a7('0x14')](_0xd4a7('0x11f'));db[_0xd4a7('0x120')]=db[_0xd4a7('0x1')]['import'](_0xd4a7('0x121'));db[_0xd4a7('0x122')]=db['sequelize'][_0xd4a7('0x14')]('../api/user-setting/user-setting.model');db[_0xd4a7('0x13')][_0xd4a7('0x123')](db['VoiceMail'],{'as':_0xd4a7('0x24'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x123')](db['UserSetting'],{'as':_0xd4a7('0x126'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x20')],{'as':'Recordings','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xd4a7('0x128'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':_0xd4a7('0x129'),'onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':'HopperFinals','foreignKey':'UserId'});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0xd4a7('0x12b'),'foreignKey':_0xd4a7('0x125')});db['User']['hasMany'](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x65')],{'as':'OpenchannelInteractions','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')]['hasMany'](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'foreignKey':'UserId'});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db['SmsInteraction'],{'as':_0xd4a7('0x12d'),'foreignKey':'UserId'});db['User'][_0xd4a7('0x127')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x46')],{'as':_0xd4a7('0x12f'),'foreignKey':'UserId'});db[_0xd4a7('0x13')]['hasMany'](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x130'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x13')][_0xd4a7('0x127')](db[_0xd4a7('0x131')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0xd4a7('0x132')](db[_0xd4a7('0x10a')],{'as':_0xd4a7('0x10a'),'foreignKey':_0xd4a7('0x133')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0x76')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xd4a7('0x134')](db['CmContact'],{'as':_0xd4a7('0x135'),'through':_0xd4a7('0x136')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x139')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x13a')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x46')],{'as':'MailInteractions','through':_0xd4a7('0x13b')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'through':_0xd4a7('0x13c')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'through':_0xd4a7('0x13d')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x12d'),'through':_0xd4a7('0x13f')});db['User'][_0xd4a7('0x134')](db['OpenchannelInteraction'],{'as':_0xd4a7('0x140'),'through':_0xd4a7('0x141')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x130'),'through':_0xd4a7('0x142')});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x143'),'through':_0xd4a7('0x33'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db['VoicePrefix'],{'as':_0xd4a7('0x144'),'through':'UserVoicePrefix','required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x43')],{'as':'MailQueues','through':_0xd4a7('0x36'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x75')],{'as':_0xd4a7('0x145'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xd4a7('0x58')],{'as':_0xd4a7('0x146'),'through':_0xd4a7('0x147'),'required':![]});db['User'][_0xd4a7('0x134')](db['SmsQueue'],{'as':_0xd4a7('0x148'),'through':_0xd4a7('0x39'),'required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x69')],{'as':_0xd4a7('0x149'),'through':_0xd4a7('0x3a'),'required':![]});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db['WhatsappQueue'],{'as':_0xd4a7('0x14a'),'through':_0xd4a7('0x3b'),'required':![]});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'through':_0xd4a7('0x139')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x14c'),'through':'user_has_chat_websites'});db['User'][_0xd4a7('0x134')](db[_0xd4a7('0x52')],{'as':_0xd4a7('0x14d'),'through':_0xd4a7('0x14e')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x14f'),'through':'user_has_mail_accounts'});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x61')],{'as':_0xd4a7('0x150'),'through':_0xd4a7('0x151')});db[_0xd4a7('0x13')][_0xd4a7('0x134')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x152'),'through':_0xd4a7('0x153')});db[_0xd4a7('0x13')]['belongsToMany'](db[_0xd4a7('0x10f')],{'as':_0xd4a7('0x154'),'through':_0xd4a7('0x155')});db[_0xd4a7('0x16')][_0xd4a7('0x127')](db['VoiceExtension'],{'as':_0xd4a7('0x156'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x157')});db[_0xd4a7('0x18')]['hasMany'](db[_0xd4a7('0x1a')],{'onDelete':'cascade'});db[_0xd4a7('0x1a')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Applications','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x1c')][_0xd4a7('0x134')](db['Sound'],{'as':'Sounds','through':_0xd4a7('0x158')});db['VoiceQueue'][_0xd4a7('0x127')](db[_0xd4a7('0x31')],{'as':_0xd4a7('0x159'),'foreignKey':_0xd4a7('0x15a')});db['VoiceQueue'][_0xd4a7('0x127')](db['CmHopper'],{'as':_0xd4a7('0x15b'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db['CmHopperHistory'],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':'ReportAgentPreview','foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')][_0xd4a7('0x127')](db['CmHopperBlack'],{'as':_0xd4a7('0x15e'),'foreignKey':_0xd4a7('0x15a')});db[_0xd4a7('0x1e')]['hasMany'](db[_0xd4a7('0xe9')],{'as':_0xd4a7('0x15f'),'foreignKey':_0xd4a7('0x15a')});db['VoiceQueue'][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':_0xd4a7('0x2e'),'foreignKey':_0xd4a7('0x160')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':_0xd4a7('0x161'),'foreignKey':_0xd4a7('0x162')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x1e')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db['VoiceQueue'][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x167')});db[_0xd4a7('0x1e')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x33')});db[_0xd4a7('0x1e')]['belongsToMany'](db[_0xd4a7('0xfa')],{'as':_0xd4a7('0x168'),'through':_0xd4a7('0x11c')});db[_0xd4a7('0x1e')][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x169'),'through':'voice_queues_has_cm_blacklists'});db[_0xd4a7('0x20')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x22')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x24')][_0xd4a7('0x127')](db[_0xd4a7('0x25')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x16b'),'sourceKey':_0xd4a7('0x16c')});db[_0xd4a7('0x25')][_0xd4a7('0x132')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xd4a7('0x16c')});db[_0xd4a7('0x16d')]['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xd4a7('0x16e'),'constraints':![]});db[_0xd4a7('0x16d')]['hasMany'](db['VoiceAgentReport'],{'as':_0xd4a7('0x16f'),'foreignKey':_0xd4a7('0x16e'),'constraints':![]});db[_0xd4a7('0x16d')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13'),'foreignKey':_0xd4a7('0x125')});db['VoiceCallReport'][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x3d')][_0xd4a7('0x132')](db['MailAccount'],{'as':_0xd4a7('0x41'),'foreignKey':'MailAccountId'});db['MailServerIn'][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x3f')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x41'),'foreignKey':_0xd4a7('0x173')});db['MailServerOut'][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171'),'onDelete':'restrict'});db[_0xd4a7('0x41')][_0xd4a7('0x123')](db[_0xd4a7('0x3d')],{'as':_0xd4a7('0x174'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x123')](db[_0xd4a7('0x3f')],{'as':_0xd4a7('0x175'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x173'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x48')],{'as':_0xd4a7('0x16a'),'foreignKey':'MailAccountId'});db[_0xd4a7('0x41')]['hasMany'](db[_0xd4a7('0x46')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x41')][_0xd4a7('0x127')](db[_0xd4a7('0x4a')],{'as':_0xd4a7('0x179')});db['MailAccount'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':'List','foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x41')][_0xd4a7('0x132')](db['Template'],{'as':_0xd4a7('0x9f'),'foreignKey':'TemplateId'});db[_0xd4a7('0x41')][_0xd4a7('0x132')](db['Pause'],{'as':_0xd4a7('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd4a7('0x41')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'user_has_mail_accounts'});db[_0xd4a7('0x43')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x17b'),'through':'UserMailQueue'});db[_0xd4a7('0x43')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x17c'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x46')][_0xd4a7('0x127')](db[_0xd4a7('0x48')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x17d')});db[_0xd4a7('0x46')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x17e'),'foreignKey':'MailAccountId'});db[_0xd4a7('0x46')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x46')]['belongsTo'](db['User'],{'as':_0xd4a7('0x180'),'foreignKey':'UserId'});db[_0xd4a7('0x46')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x181'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x46')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x181'),'as':'ThroughTags'});db[_0xd4a7('0x46')]['belongsToMany'](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x13b'),'foreignKey':_0xd4a7('0x17d')});db['MailMessage'][_0xd4a7('0x127')](db['Attachment'],{'as':_0xd4a7('0x184'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x13')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x170')});db[_0xd4a7('0x48')]['belongsTo'](db[_0xd4a7('0x46')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'ChatWebsite','foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x48')][_0xd4a7('0x132')](db['ChatOfflineMessage'],{'as':_0xd4a7('0x73'),'foreignKey':_0xd4a7('0x186')});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{'onDelete':'restrict'});db[_0xd4a7('0x4a')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x4a')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xd4a7('0x164')});db['MailApplication']['belongsTo'](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db['MailQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':'ListId'});db[_0xd4a7('0x4c')]['belongsTo'](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db['MailQueueReport'][_0xd4a7('0x132')](db['MailInteraction'],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x48')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x4c')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{});db['Dashboard'][_0xd4a7('0x127')](db[_0xd4a7('0x50')],{'as':_0xd4a7('0x189'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':'Dispositions','foreignKey':_0xd4a7('0x18a'),'onDelete':_0xd4a7('0x124')});db['FaxAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x18a')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db['FaxInteraction'],{'as':_0xd4a7('0x178')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Exntensions','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x52')][_0xd4a7('0x127')](db[_0xd4a7('0x18b')],{'as':_0xd4a7('0x16a')});db[_0xd4a7('0x52')]['belongsTo'](db['Trunk'],{'as':_0xd4a7('0x2e')});db[_0xd4a7('0x52')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x52')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x52')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x14e')});db[_0xd4a7('0x54')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x54')][_0xd4a7('0x132')](db['FaxQueue'],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x54')]['belongsTo'](db[_0xd4a7('0x52')],{'onDelete':_0xd4a7('0x172')});db['FaxApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db[_0xd4a7('0x56')]['hasMany'](db[_0xd4a7('0x18b')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x18c')});db[_0xd4a7('0x56')][_0xd4a7('0x132')](db[_0xd4a7('0x52')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x18a')});db['FaxInteraction']['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db['FaxInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'Owner','foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':'fax_interaction_has_tags','as':_0xd4a7('0x182')});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x18d'),'as':'ThroughTags'});db[_0xd4a7('0x56')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':'user_has_fax_interactions','foreignKey':_0xd4a7('0x18c')});db['FaxMessage'][_0xd4a7('0x132')](db['User'],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x13')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xd4a7('0x18c')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':'cascade','as':_0xd4a7('0x170')});db[_0xd4a7('0x18b')][_0xd4a7('0x132')](db[_0xd4a7('0xfe')],{'as':_0xd4a7('0xfe'),'foreignKey':_0xd4a7('0x18e')});db['FaxMessage']['belongsTo'](db[_0xd4a7('0x52')],{'as':'Account','foreignKey':_0xd4a7('0x18a')});db[_0xd4a7('0x58')]['belongsToMany'](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0xd4a7('0x58')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x18f'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x5a')]['belongsTo'](db['FaxAccount'],{});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x56')],{});db[_0xd4a7('0x5a')]['belongsTo'](db[_0xd4a7('0x18b')],{});db[_0xd4a7('0x5a')]['belongsTo'](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x5a')][_0xd4a7('0x132')](db[_0xd4a7('0x58')],{});db['SmsAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':'Dispositions','foreignKey':_0xd4a7('0x190'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x5c')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x190')});db[_0xd4a7('0x5c')]['hasMany'](db[_0xd4a7('0x191')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x5c')]['hasMany'](db[_0xd4a7('0x5d')],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x5c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x5c')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x5c')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x153')});db[_0xd4a7('0x5d')]['belongsTo'](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x5d')][_0xd4a7('0x132')](db['SmsQueue'],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x5d')]['belongsTo'](db[_0xd4a7('0x5c')],{'onDelete':_0xd4a7('0x172')});db['SmsApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x164')});db['SmsApplication']['belongsTo'](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0xd4a7('0x127')](db[_0xd4a7('0x191')],{'as':'Messages','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x192')});db[_0xd4a7('0x13e')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x190')});db['SmsInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x13e')][_0xd4a7('0x132')](db['User'],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db['SmsInteraction']['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x193'),'as':_0xd4a7('0x182')});db['SmsInteraction'][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x193'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x13e')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x13f'),'foreignKey':_0xd4a7('0x192')});db['SmsMessage']['belongsTo'](db[_0xd4a7('0x13')],{'as':'User'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':'Contact'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x13e')],{'onDelete':'cascade','as':_0xd4a7('0x195'),'foreignKey':'SmsInteractionId'});db[_0xd4a7('0x191')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x190')});db[_0xd4a7('0x5f')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x39'),'foreignKey':_0xd4a7('0x196')});db[_0xd4a7('0x5f')][_0xd4a7('0x134')](db['Team'],{'through':_0xd4a7('0x197'),'as':'Teams'});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x198'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':_0xd4a7('0x177'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')]['hasMany'](db[_0xd4a7('0x65')],{'as':_0xd4a7('0x178'),'foreignKey':_0xd4a7('0x198')});db['OpenchannelAccount'][_0xd4a7('0x127')](db[_0xd4a7('0x67')],{'as':_0xd4a7('0x16a'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')][_0xd4a7('0x127')](db[_0xd4a7('0x63')],{'as':_0xd4a7('0x179'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x61')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db['OpenchannelAccount'][_0xd4a7('0x132')](db['Pause'],{'as':_0xd4a7('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd4a7('0x61')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'user_has_openchannel_accounts'});db[_0xd4a7('0x63')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x199')});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x63')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'onDelete':_0xd4a7('0x172'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db['OpenchannelInteraction']['hasMany'](db[_0xd4a7('0x67')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':'OpenchannelInteractionId'});db[_0xd4a7('0x65')]['belongsTo'](db[_0xd4a7('0x61')],{'as':'Account','foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x65')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x65')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x19a'),'as':'Tags'});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x19a'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x65')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x141'),'foreignKey':'OpenchannelInteractionId'});db[_0xd4a7('0x67')]['belongsTo'](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x13')});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':_0xd4a7('0x124'),'as':'Contact'});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x65')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x195'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xd4a7('0x132')](db['Attachment'],{'as':_0xd4a7('0xfe'),'foreignKey':'AttachmentId'});db[_0xd4a7('0x67')][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x198')});db[_0xd4a7('0x69')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x3a'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x19b'),'as':_0xd4a7('0x168')});db['ChatWebsite'][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x89')],{'as':'Answers','foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x19c')],{'as':_0xd4a7('0x19d')});db[_0xd4a7('0x14b')][_0xd4a7('0x127')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x178')});db['ChatWebsite']['hasMany'](db[_0xd4a7('0x6d')],{'as':'Applications'});db[_0xd4a7('0x14b')]['hasMany'](db[_0xd4a7('0x71')],{'as':_0xd4a7('0x16a')});db['ChatWebsite'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':'List','foreignKey':'ListId'});db[_0xd4a7('0x14b')][_0xd4a7('0x132')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':'IntervalId'});db[_0xd4a7('0x14b')]['belongsTo'](db[_0xd4a7('0x41')],{'as':'MailAccount','foreignKey':_0xd4a7('0x173')});db[_0xd4a7('0x14b')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db['ChatWebsite']['belongsToMany'](db['User'],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x19e')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0xd4a7('0x6b')]['belongsTo'](db[_0xd4a7('0x67')],{});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x6b')][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{});db['ChatApplication'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'Agent','foreignKey':_0xd4a7('0x125'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')][_0xd4a7('0x132')](db['ChatQueue'],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x1a0'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'Website','foreignKey':_0xd4a7('0x185'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x6d')]['belongsTo'](db['Tag'],{'onDelete':_0xd4a7('0x172'),'foreignKey':'TagId'});db['ChatInteraction'][_0xd4a7('0x127')](db['ChatMessage'],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x6f')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':'Account','foreignKey':_0xd4a7('0x185')});db['ChatInteraction'][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':'Contact','foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x6f')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':'UserId'});db[_0xd4a7('0x6f')][_0xd4a7('0x134')](db['Tag'],{'through':_0xd4a7('0x1a2'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x6f')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1a2'),'as':'ThroughTags'});db['ChatInteraction'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':'user_has_chat_interactions','foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'as':'User'});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db['CmContact'],{'onDelete':'cascade','as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x6f')],{'onDelete':_0xd4a7('0x124'),'as':'Interaction','foreignKey':_0xd4a7('0x1a1')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0xfe')],{'as':_0xd4a7('0xfe'),'foreignKey':_0xd4a7('0x18e')});db[_0xd4a7('0x71')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x73')][_0xd4a7('0x127')](db['Attachment'],{'as':_0xd4a7('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0x73')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatOfflineMessage']['belongsTo'](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x17e'),'foreignKey':'ChatWebsiteId'});db[_0xd4a7('0x75')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':'UserChatQueue','hooks':!![]});db[_0xd4a7('0x75')]['belongsToMany'](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x1a3'),'as':_0xd4a7('0x168')});db['ChatGroup'][_0xd4a7('0x127')](db[_0xd4a7('0xe5')],{'as':_0xd4a7('0x16a'),'foreignKey':_0xd4a7('0x1a4'),'onDelete':'cascade'});db['ChatGroup'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Members','through':_0xd4a7('0x1a5')});db[_0xd4a7('0x19c')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'as':_0xd4a7('0x1a6'),'foreignKey':_0xd4a7('0x185')});db[_0xd4a7('0x78')]['hasMany'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x135'),'foreignKey':_0xd4a7('0x1a7')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x9b')],{'as':_0xd4a7('0x1a8'),'foreignKey':_0xd4a7('0x1a9')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x1aa')],{'as':_0xd4a7('0x15b'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0xe9')],{'as':_0xd4a7('0x15f'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x65')],{'as':_0xd4a7('0x140'),'foreignKey':'ContactId','onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x6f')],{'as':_0xd4a7('0x12c'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')]['hasMany'](db[_0xd4a7('0x13e')],{'as':_0xd4a7('0x12d'),'foreignKey':_0xd4a7('0x17f'),'onDelete':'restrict'});db[_0xd4a7('0x7a')][_0xd4a7('0x127')](db[_0xd4a7('0x56')],{'as':_0xd4a7('0x12e'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x7a')]['hasMany'](db['MailInteraction'],{'as':_0xd4a7('0x12f'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xd4a7('0x7a')][_0xd4a7('0x132')](db[_0xd4a7('0x78')],{'as':'Company','foreignKey':_0xd4a7('0x1a7')});db[_0xd4a7('0x7a')]['belongsTo'](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x7a')][_0xd4a7('0x134')](db['User'],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x136')});db['CmContact']['belongsToMany'](db[_0xd4a7('0x97')],{'as':_0xd4a7('0x182'),'through':'cm_contact_has_tags'});db[_0xd4a7('0x7a')]['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1ab'),'as':_0xd4a7('0x194')});db[_0xd4a7('0x1aa')][_0xd4a7('0x127')](db[_0xd4a7('0x9d')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f'),'onDelete':_0xd4a7('0x124')});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':'ListId','onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x1ac'),'foreignKey':'UserId'});db[_0xd4a7('0x1aa')]['belongsTo'](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x15a'),'onDelete':'cascade'});db['CmHopper'][_0xd4a7('0x132')](db[_0xd4a7('0x1ad')],{'as':_0xd4a7('0x1ad'),'foreignKey':_0xd4a7('0x1ae'),'onDelete':'cascade'});db[_0xd4a7('0x1aa')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x1af')});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x19f'),'foreignKey':_0xd4a7('0x15a'),'onDelete':'cascade'});db[_0xd4a7('0x7c')][_0xd4a7('0x132')](db['Campaign'],{'as':_0xd4a7('0x1ad'),'foreignKey':_0xd4a7('0x1ae'),'onDelete':'cascade'});db['Automation'][_0xd4a7('0x127')](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1b1'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x87')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':'Any','singular':_0xd4a7('0x1b2')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x87')][_0xd4a7('0x127')](db[_0xd4a7('0x85')],{'as':_0xd4a7('0x1b3'),'foreignKey':_0xd4a7('0x1b4'),'onDelete':'cascade','hooks':!![]});db[_0xd4a7('0x8a')][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x1b5'),'onDelete':_0xd4a7('0x124')});db['Interval'][_0xd4a7('0x127')](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x1b6'),'foreignKey':_0xd4a7('0x164'),'onDelete':_0xd4a7('0x124'),'hooks':!![],'required':![]});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x1a')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x4a')],{'as':'MailApplications','foreignKey':_0xd4a7('0x164')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0xd4a7('0x1b7'),'foreignKey':'IntervalId'});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db['FaxApplication'],{'as':_0xd4a7('0x1b8'),'foreignKey':'IntervalId'});db[_0xd4a7('0x163')][_0xd4a7('0x127')](db[_0xd4a7('0x5d')],{'as':_0xd4a7('0x1b9'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x93')]['belongsTo'](db[_0xd4a7('0x41')],{});db['Schedule'][_0xd4a7('0x132')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xd4a7('0x93')][_0xd4a7('0x132')](db[_0xd4a7('0xa8')],{'foreignKey':_0xd4a7('0x1ba')});db[_0xd4a7('0x95')][_0xd4a7('0x134')](db['VoiceMusicOnHold'],{'as':_0xd4a7('0x1bb'),'through':_0xd4a7('0x158'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db['CmContact'],{'through':_0xd4a7('0x1ab')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x6f')],{'through':_0xd4a7('0x1a2')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x46')],{'through':'mail_interaction_has_tags'});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x13e')],{'through':_0xd4a7('0x193')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x56')],{'through':_0xd4a7('0x18d')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x65')],{'through':_0xd4a7('0x19a')});db[_0xd4a7('0x97')][_0xd4a7('0x134')](db[_0xd4a7('0x113')],{'through':_0xd4a7('0x1bc')});db['CmContactHasItem'][_0xd4a7('0x132')](db['ContactItemType'],{'as':_0xd4a7('0x1bd'),'foreignKey':_0xd4a7('0x1be')});db[_0xd4a7('0x9d')][_0xd4a7('0x132')](db[_0xd4a7('0x1aa')],{'as':_0xd4a7('0x1bf'),'foreignKey':_0xd4a7('0x1c0')});db[_0xd4a7('0x9b')][_0xd4a7('0x132')](db['CmContact'],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x1a9')});db[_0xd4a7('0xa1')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1c1'),'singular':_0xd4a7('0x1c2')},'foreignKey':_0xd4a7('0x1c3'),'onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0xa1')]['hasMany'](db[_0xd4a7('0x1b0')],{'as':{'plural':_0xd4a7('0x1c4'),'singular':_0xd4a7('0x1c5')},'foreignKey':_0xd4a7('0x1c6'),'onDelete':_0xd4a7('0x124'),'hooks':!![]});db['Trigger'][_0xd4a7('0x127')](db['Action'],{'as':_0xd4a7('0x1b3'),'foreignKey':_0xd4a7('0x1c7'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0xd4a7('0x127')](db[_0xd4a7('0x1c8')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ba'),'hooks':!![]});db[_0xd4a7('0xaa')][_0xd4a7('0x127')](db[_0xd4a7('0x1c8')],{'as':_0xd4a7('0x1c9'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1ca')});db[_0xd4a7('0xae')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cb')});db[_0xd4a7('0x1c8')]['belongsTo'](db[_0xd4a7('0xae')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xd4a7('0x127')](db[_0xd4a7('0xb4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1cd'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xb4')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xb4')]['belongsTo'](db[_0xd4a7('0xb3')],{'as':_0xd4a7('0x17e'),'foreignKey':'AccountId'});db[_0xd4a7('0xb6')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xb6')][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db['SalesforceField'][_0xd4a7('0x127')](db[_0xd4a7('0xb6')],{'as':_0xd4a7('0x1d4'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xb6')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xb8')][_0xd4a7('0x127')](db[_0xd4a7('0x1d6')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db['SugarcrmField'],{'as':_0xd4a7('0x1cd'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0x1d6')][_0xd4a7('0x127')](db['SugarcrmField'],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db['SugarcrmConfiguration'][_0xd4a7('0x132')](db[_0xd4a7('0xb8')],{'as':'Account','foreignKey':_0xd4a7('0x1cc')});db['SugarcrmField'][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xba')]['hasMany'](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xba')][_0xd4a7('0x127')](db[_0xd4a7('0xba')],{'as':_0xd4a7('0x1d4'),'foreignKey':'FieldId'});db[_0xd4a7('0xba')]['belongsTo'](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':'VariableId'});db[_0xd4a7('0xbc')][_0xd4a7('0x127')](db['DeskConfiguration'],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':'AccountId'});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db['DeskField'],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':'SubjectId'});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db[_0xd4a7('0xc0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xbe')][_0xd4a7('0x127')](db[_0xd4a7('0xc0')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xbe')][_0xd4a7('0x132')](db[_0xd4a7('0xbc')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xbe')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1d8')});db[_0xd4a7('0xc0')][_0xd4a7('0x127')](db['DeskField'],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc0')][_0xd4a7('0x127')](db['DeskField'],{'as':'Description','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xc0')]['hasMany'](db[_0xd4a7('0xc0')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xc0')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xc1')][_0xd4a7('0x127')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['ZohoConfiguration'][_0xd4a7('0x127')](db['ZohoField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xd4a7('0x1d9')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db['ZohoConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xd4a7('0x1d9')][_0xd4a7('0x132')](db[_0xd4a7('0xc1')],{'as':'Account','foreignKey':_0xd4a7('0x1cc')});db['ZohoField'][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc4')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xc4')][_0xd4a7('0x127')](db[_0xd4a7('0xc4')],{'as':'Field','foreignKey':'FieldId'});db[_0xd4a7('0xc4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xc6')]['hasMany'](db[_0xd4a7('0xc8')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['ZendeskConfiguration'][_0xd4a7('0x127')](db['ZendeskField'],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xc8')][_0xd4a7('0x127')](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1cf'),'foreignKey':'DescriptionId'});db[_0xd4a7('0xc8')][_0xd4a7('0x127')](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1c9'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xc8')][_0xd4a7('0x132')](db[_0xd4a7('0xc6')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xc8')][_0xd4a7('0x134')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0xd4a7('0xca')]['hasMany'](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd4a7('0xca')]['hasMany'](db[_0xd4a7('0xca')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xca')]['hasMany'](db[_0xd4a7('0xca')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db['ZendeskField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xcc')][_0xd4a7('0x127')](db[_0xd4a7('0xcd')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['FreshdeskConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xcd')][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xcd')][_0xd4a7('0x127')](db['FreshdeskField'],{'as':_0xd4a7('0x1c9'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xd4a7('0xcd')][_0xd4a7('0x132')](db[_0xd4a7('0xcc')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xcd')]['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1da')});db[_0xd4a7('0xcf')][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xcf')]['hasMany'](db[_0xd4a7('0xcf')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db['FreshdeskField'][_0xd4a7('0x127')](db[_0xd4a7('0xcf')],{'as':'Field','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xcf')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db['VtigerAccount']['hasMany'](db[_0xd4a7('0xd3')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db['VtigerConfiguration'][_0xd4a7('0x127')](db['VtigerField'],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xd3')][_0xd4a7('0x127')](db['VtigerField'],{'as':_0xd4a7('0x1cf'),'foreignKey':_0xd4a7('0x1d0')});db['VtigerConfiguration']['hasMany'](db[_0xd4a7('0xd5')],{'as':'Fields','foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xd3')]['belongsTo'](db[_0xd4a7('0xd1')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xd5')][_0xd4a7('0x127')](db[_0xd4a7('0xd5')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xd5')][_0xd4a7('0x127')](db[_0xd4a7('0xd5')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xd5')]['hasMany'](db[_0xd4a7('0xd5')],{'as':'Field','foreignKey':'FieldId'});db['VtigerField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xd7')][_0xd4a7('0x127')](db[_0xd4a7('0xd9')],{'as':_0xd4a7('0x1d7'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xd9')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1cd'),'foreignKey':_0xd4a7('0x1ce')});db['ServicenowConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd4a7('0xd9')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1c9'),'foreignKey':_0xd4a7('0x1d1')});db[_0xd4a7('0xd9')][_0xd4a7('0x132')](db[_0xd4a7('0xd7')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db['ServicenowField'][_0xd4a7('0x127')](db['ServicenowField'],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xda')][_0xd4a7('0x127')](db[_0xd4a7('0xda')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xda')][_0xd4a7('0x127')](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db[_0xd4a7('0xda')][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db['Dynamics365Account'][_0xd4a7('0x127')](db[_0xd4a7('0xdc')],{'as':_0xd4a7('0x1d7'),'onDelete':'cascade','foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1db')][_0xd4a7('0x132')](db[_0xd4a7('0x11b')],{'as':_0xd4a7('0x11b'),'foreignKey':_0xd4a7('0x171')});db['Dynamics365Configuration'][_0xd4a7('0x127')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1ce')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0xd4a7('0x1cf'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d0')});db['Dynamics365Configuration']['hasMany'](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1c9'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1d1')});db['Dynamics365Configuration'][_0xd4a7('0x132')](db[_0xd4a7('0x1db')],{'as':_0xd4a7('0x17e'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0xde')]['hasMany'](db[_0xd4a7('0xde')],{'as':'Subject','foreignKey':_0xd4a7('0x1ce')});db['Dynamics365Field'][_0xd4a7('0x127')](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1d3'),'foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0xde')][_0xd4a7('0x127')](db[_0xd4a7('0xde')],{'as':_0xd4a7('0x1d4'),'foreignKey':_0xd4a7('0x1d1')});db['Dynamics365Field'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':_0xd4a7('0xa3'),'foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0x1dc')][_0xd4a7('0x127')](db[_0xd4a7('0x1dd')],{'as':_0xd4a7('0x1d7'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1cc')});db[_0xd4a7('0x1dd')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1cd'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':'Descriptions','foreignKey':_0xd4a7('0x1d0')});db[_0xd4a7('0x1dd')]['hasMany'](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1c9'),'foreignKey':'FieldId'});db[_0xd4a7('0x1dd')][_0xd4a7('0x132')](db[_0xd4a7('0x1dc')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d2'),'foreignKey':_0xd4a7('0x1ce')});db[_0xd4a7('0xe0')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d3'),'foreignKey':'DescriptionId'});db[_0xd4a7('0xe0')][_0xd4a7('0x127')](db[_0xd4a7('0xe0')],{'as':_0xd4a7('0x1d4'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xd4a7('0x132')](db[_0xd4a7('0xa3')],{'as':'Variable','foreignKey':_0xd4a7('0x1d5')});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':'ListId'});db[_0xd4a7('0xe4')]['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0xe4')][_0xd4a7('0x132')](db[_0xd4a7('0x6f')],{});db['ChatQueueReport'][_0xd4a7('0x132')](db['ChatMessage'],{});db[_0xd4a7('0xe4')]['belongsTo'](db[_0xd4a7('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0xd4a7('0x75')],{});db[_0xd4a7('0xe5')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1de')});db['ChatInternalMessage'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x1df')});db[_0xd4a7('0xe9')][_0xd4a7('0x127')](db[_0xd4a7('0xe7')],{'foreignKey':_0xd4a7('0x1e0'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0xe9')]['hasMany'](db[_0xd4a7('0x1e1')],{'foreignKey':_0xd4a7('0x1e0'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{});db['SmsQueueReport'][_0xd4a7('0x132')](db['CmList'],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x7a')],{'as':'Contact','foreignKey':_0xd4a7('0x17f')});db[_0xd4a7('0xeb')]['belongsTo'](db[_0xd4a7('0x13e')],{});db['SmsQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x191')],{});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0xeb')][_0xd4a7('0x132')](db['SmsQueue'],{});db[_0xd4a7('0xf0')][_0xd4a7('0x127')](db[_0xd4a7('0xe9')],{'foreignKey':_0xd4a7('0x1e2')});db['JscriptyProject'][_0xd4a7('0x127')](db['JscriptyQuestionReport'],{'foreignKey':_0xd4a7('0x1e2')});db[_0xd4a7('0xf0')][_0xd4a7('0x127')](db['JscriptyAnswerReport'],{'foreignKey':_0xd4a7('0x1e2')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x17b'),'through':_0xd4a7('0x13a')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xd4a7('0x143')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db[_0xd4a7('0x43')],{'through':_0xd4a7('0x17c'),'as':_0xd4a7('0x1e3')});db[_0xd4a7('0xfa')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xd4a7('0x145')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x58')],{'through':_0xd4a7('0x18f'),'as':'FaxQueues'});db['Team'][_0xd4a7('0x134')](db['SmsQueue'],{'through':_0xd4a7('0x197'),'as':_0xd4a7('0x148')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x69')],{'through':'team_has_openchannel_queues','as':_0xd4a7('0x149')});db['Team'][_0xd4a7('0x134')](db[_0xd4a7('0x11a')],{'through':_0xd4a7('0x1e4'),'as':_0xd4a7('0x14a')});db[_0xd4a7('0xfa')][_0xd4a7('0x134')](db[_0xd4a7('0x109')],{'through':_0xd4a7('0x11e'),'as':'VoicePrefixes'});db[_0xd4a7('0x1ad')][_0xd4a7('0x127')](db[_0xd4a7('0x1aa')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':'CampaignId'});db[_0xd4a7('0x1ad')][_0xd4a7('0x127')](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x15d'),'foreignKey':_0xd4a7('0x1ae')});db['Campaign'][_0xd4a7('0x127')](db[_0xd4a7('0x7c')],{'as':_0xd4a7('0x15e'),'foreignKey':_0xd4a7('0x1ae')});db[_0xd4a7('0x1ad')][_0xd4a7('0x132')](db['Trunk'],{'as':'Trunk','foreignKey':_0xd4a7('0x160')});db[_0xd4a7('0x1ad')][_0xd4a7('0x132')](db[_0xd4a7('0x2e')],{'as':'TrunkBackup','foreignKey':_0xd4a7('0x162')});db[_0xd4a7('0x1ad')]['belongsTo'](db[_0xd4a7('0x163')],{'as':_0xd4a7('0x163'),'foreignKey':'IntervalId'});db['Campaign'][_0xd4a7('0x132')](db[_0xd4a7('0xf4')],{'as':'SquareProject','foreignKey':_0xd4a7('0x1e5')});db[_0xd4a7('0x1ad')][_0xd4a7('0x134')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x138'),'through':_0xd4a7('0x1e6')});db[_0xd4a7('0x1ad')][_0xd4a7('0x134')](db['CmList'],{'as':_0xd4a7('0x169'),'through':_0xd4a7('0x1e7')});db[_0xd4a7('0xfe')][_0xd4a7('0x132')](db[_0xd4a7('0x73')],{'as':'ChatOfflineMessage','foreignKey':_0xd4a7('0x186')});db['MailTransferReport']['belongsTo'](db[_0xd4a7('0x48')],{});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db['MailInteraction'],{});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db['MailTransferReport'][_0xd4a7('0x132')](db['User'],{'foreignKey':'FromUserId','as':_0xd4a7('0x1e8')});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db['User'],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x101')][_0xd4a7('0x132')](db[_0xd4a7('0x43')],{'foreignKey':_0xd4a7('0x1eb'),'as':_0xd4a7('0x1ec')});db['MailTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x41')],{'foreignKey':_0xd4a7('0x1ed'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x71')],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db['ChatWebsite'],{'foreignKey':_0xd4a7('0x1f0'),'as':_0xd4a7('0x1f1')});db['ChatTransferReport'][_0xd4a7('0x132')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xd4a7('0x1ef')]['belongsTo'](db[_0xd4a7('0x13')],{'foreignKey':'ToUserId','as':_0xd4a7('0x1ea')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x75')],{'foreignKey':_0xd4a7('0x1f2'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x1ef')][_0xd4a7('0x132')](db[_0xd4a7('0x14b')],{'foreignKey':_0xd4a7('0x1f3'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db['FaxMessage'],{});db[_0xd4a7('0x1f4')]['belongsTo'](db[_0xd4a7('0x56')],{});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db[_0xd4a7('0x52')],{'foreignKey':_0xd4a7('0x1f5'),'as':_0xd4a7('0x1f1')});db[_0xd4a7('0x1f4')][_0xd4a7('0x132')](db['User'],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x1f4')]['belongsTo'](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db['FaxTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x58')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport']['belongsTo'](db[_0xd4a7('0x52')],{'foreignKey':_0xd4a7('0x1f7'),'as':_0xd4a7('0x1ee')});db[_0xd4a7('0x104')]['belongsTo'](db[_0xd4a7('0x67')],{});db[_0xd4a7('0x104')]['belongsTo'](db[_0xd4a7('0x65')],{});db['OpenchannelTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'foreignKey':'FromOpenchannelAccountId','as':_0xd4a7('0x1f1')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x69')],{'foreignKey':'ToOpenchannelQueueId','as':_0xd4a7('0x1ec')});db[_0xd4a7('0x104')][_0xd4a7('0x132')](db[_0xd4a7('0x61')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xd4a7('0x106')]['belongsTo'](db[_0xd4a7('0x191')],{});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db['SmsInteraction'],{});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x5c')],{'foreignKey':_0xd4a7('0x1f8'),'as':_0xd4a7('0x1f1')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1f6'),'as':_0xd4a7('0x1e8')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':'ToAgent'});db['SmsTransferReport'][_0xd4a7('0x132')](db['SmsQueue'],{'foreignKey':_0xd4a7('0x1f9'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x106')][_0xd4a7('0x132')](db['SmsAccount'],{'foreignKey':_0xd4a7('0x1fa'),'as':_0xd4a7('0x1ee')});db['CmList'][_0xd4a7('0x127')](db[_0xd4a7('0x8a')],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x17a'),'onDelete':_0xd4a7('0x124')});db['CmList'][_0xd4a7('0x127')](db[_0xd4a7('0x83')],{'as':_0xd4a7('0x1fb'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x7a')],{'as':'Contacts','onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x12a')],{'as':_0xd4a7('0x15c'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xd4a7('0x7f')],{'as':_0xd4a7('0x12b'),'foreignKey':'ListId'});db[_0xd4a7('0x137')][_0xd4a7('0x127')](db[_0xd4a7('0x81')],{'as':_0xd4a7('0x81'),'foreignKey':'ListId'});db[_0xd4a7('0x137')][_0xd4a7('0x134')](db[_0xd4a7('0x1e')],{'as':_0xd4a7('0x1fc'),'through':_0xd4a7('0x167')});db[_0xd4a7('0x137')]['belongsToMany'](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x139')});db[_0xd4a7('0x109')][_0xd4a7('0x127')](db['VoiceExtension'],{'as':_0xd4a7('0x129'),'onDelete':_0xd4a7('0x124')});db['VoicePrefix'][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xd4a7('0x109')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':_0xd4a7('0x11e'),'as':_0xd4a7('0x168')});db[_0xd4a7('0x10a')][_0xd4a7('0x127')](db['User'],{'as':_0xd4a7('0x183'),'foreignKey':'userProfileId'});db[_0xd4a7('0x10a')][_0xd4a7('0x127')](db[_0xd4a7('0x10b')],{'as':_0xd4a7('0x1fd'),'foreignKey':_0xd4a7('0x133'),'onDelete':'cascade'});db[_0xd4a7('0x10b')][_0xd4a7('0x127')](db['UserProfileResource'],{'as':_0xd4a7('0x1fe'),'foreignKey':_0xd4a7('0x1ff'),'onDelete':'cascade'});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['Disposition'],{'as':_0xd4a7('0x176'),'foreignKey':_0xd4a7('0x200'),'onDelete':_0xd4a7('0x124')});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xd4a7('0x200')});db['WhatsappAccount'][_0xd4a7('0x127')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xd4a7('0x200')});db['WhatsappAccount']['hasMany'](db[_0xd4a7('0x113')],{'as':_0xd4a7('0x178')});db[_0xd4a7('0x10f')][_0xd4a7('0x127')](db['WhatsappApplication'],{'as':_0xd4a7('0x179')});db[_0xd4a7('0x10f')][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x10f')][_0xd4a7('0x132')](db[_0xd4a7('0x8d')],{'as':_0xd4a7('0x165'),'foreignKey':_0xd4a7('0x166')});db[_0xd4a7('0x10f')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':'Agents','through':_0xd4a7('0x155')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x11a')],{'onDelete':'restrict'});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db['Interval'],{'onDelete':_0xd4a7('0x172'),'foreignKey':_0xd4a7('0x164')});db[_0xd4a7('0x111')][_0xd4a7('0x132')](db[_0xd4a7('0x97')],{'onDelete':'restrict','foreignKey':_0xd4a7('0x187')});db[_0xd4a7('0x113')][_0xd4a7('0x127')](db[_0xd4a7('0x114')],{'as':_0xd4a7('0x16a'),'onDelete':_0xd4a7('0x124'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x113')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xd4a7('0x113')]['belongsTo'](db[_0xd4a7('0x7a')],{'as':_0xd4a7('0x170'),'foreignKey':'ContactId'});db[_0xd4a7('0x113')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x180'),'foreignKey':_0xd4a7('0x125')});db['WhatsappInteraction']['belongsToMany'](db[_0xd4a7('0x97')],{'through':_0xd4a7('0x1bc'),'as':_0xd4a7('0x182')});db[_0xd4a7('0x113')][_0xd4a7('0x134')](db[_0xd4a7('0x97')],{'through':'whatsapp_interaction_has_tags','as':_0xd4a7('0x194')});db[_0xd4a7('0x113')][_0xd4a7('0x134')](db[_0xd4a7('0x13')],{'as':_0xd4a7('0x183'),'through':_0xd4a7('0x142'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x114')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'User'});db[_0xd4a7('0x114')]['belongsTo'](db['CmContact'],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x170')});db['WhatsappMessage'][_0xd4a7('0x132')](db[_0xd4a7('0x113')],{'onDelete':_0xd4a7('0x124'),'as':_0xd4a7('0x195'),'foreignKey':_0xd4a7('0x201')});db[_0xd4a7('0x114')]['belongsTo'](db[_0xd4a7('0x10f')],{'as':_0xd4a7('0x17e'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport']['belongsTo'](db[_0xd4a7('0x10f')],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x137')],{'as':_0xd4a7('0x188'),'foreignKey':_0xd4a7('0x17a')});db[_0xd4a7('0x116')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xd4a7('0x116')][_0xd4a7('0x132')](db[_0xd4a7('0x113')],{});db[_0xd4a7('0x116')][_0xd4a7('0x132')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x114')],{});db['WhatsappQueueReport'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x114')],{});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db['WhatsappInteraction'],{});db['WhatsappTransferReport']['belongsTo'](db[_0xd4a7('0x10f')],{'foreignKey':'FromWhatsappAccountId','as':_0xd4a7('0x1f1')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x10f')],{'foreignKey':'ToWhatsappAccountId','as':_0xd4a7('0x1ee')});db['WhatsappTransferReport'][_0xd4a7('0x132')](db[_0xd4a7('0x11a')],{'foreignKey':_0xd4a7('0x202'),'as':_0xd4a7('0x1ec')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':'FromUserId','as':_0xd4a7('0x1e8')});db[_0xd4a7('0x118')][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'foreignKey':_0xd4a7('0x1e9'),'as':_0xd4a7('0x1ea')});db[_0xd4a7('0x11a')][_0xd4a7('0x134')](db['User'],{'as':'Agents','through':_0xd4a7('0x3b'),'foreignKey':_0xd4a7('0x203')});db[_0xd4a7('0x11a')][_0xd4a7('0x134')](db[_0xd4a7('0xfa')],{'through':'team_has_whatsapp_queues','as':_0xd4a7('0x168')});db['UserSetting'][_0xd4a7('0x132')](db[_0xd4a7('0x13')],{'as':'user','foreignKey':'UserId','onDelete':_0xd4a7('0x124'),'hooks':!![]});db[_0xd4a7('0x11b')]['hasOne'](db[_0xd4a7('0x1db')],{'as':_0xd4a7('0x1db'),'onDelete':'restrict'});db[_0xd4a7('0x11b')]['hasOne'](db[_0xd4a7('0x3d')],{'as':_0xd4a7('0x174'),'onDelete':_0xd4a7('0x172')});db[_0xd4a7('0x11b')][_0xd4a7('0x123')](db[_0xd4a7('0x3f')],{'as':_0xd4a7('0x175'),'onDelete':_0xd4a7('0x172')});module[_0xd4a7('0x204')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x42e4=['FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','Recordings','UserId','VoiceQueuesRt','hasMany','VoiceExtension','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','CloudProviderId','MailAccountId','Smtp','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','TemplateId','Pause','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Dashboard','Disposition','FaxAccountId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsApplication','Applications','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatInteraction','ChatMessage','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CmCompany','Phones','CmContactId','JscriptySessions','MailInteractions','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','OwnerId','CampaignId','All','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','ItemTypeId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','Subjects','Descriptions','DescriptionId','AccountId','Subject','SubjectId','Description','Field','FieldId','VariableId','SugarcrmConfiguration','DeskAccount','DeskField','int_desk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','ToId','SessionId','JscriptyProject','ProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileResource','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','WhatsappTransferReport','FromWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','user','Imap','../config/environment','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','sequelizeHistory','defaultsDeep','utf8','database','password','options','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model'];(function(_0x3ad0a1,_0x31eb28){var _0x5aae7f=function(_0x23b74c){while(--_0x23b74c){_0x3ad0a1['push'](_0x3ad0a1['shift']());}};_0x5aae7f(++_0x31eb28);}(_0x42e4,0x146));var _0x442e=function(_0x947ea2,_0x5e4ba6){_0x947ea2=_0x947ea2-0x0;var _0x1c4be7=_0x42e4[_0x947ea2];return _0x1c4be7;};'use strict';var config=require(_0x442e('0x0'));var Sequelize=require(_0x442e('0x1'));var _=require(_0x442e('0x2'));var jstz=require(_0x442e('0x3'));var timezone=jstz[_0x442e('0x4')]();config['sequelize']=_['defaultsDeep'](config[_0x442e('0x1')],{'database':_0x442e('0x5'),'username':_0x442e('0x6'),'password':_0x442e('0x7'),'options':{'host':_0x442e('0x8'),'port':0xcea,'dialect':_0x442e('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x442e('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x442e('0xb')]=_[_0x442e('0xc')](config[_0x442e('0xb')],{'database':_0x442e('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x442e('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x442e('0xa')](),'define':{'charset':_0x442e('0xd'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x442e('0x1')][_0x442e('0xe')],config['sequelize']['username'],config[_0x442e('0x1')][_0x442e('0xf')],config[_0x442e('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x442e('0xb')]['database'],config[_0x442e('0xb')]['username'],config[_0x442e('0xb')][_0x442e('0xf')],config['sequelizeHistory'][_0x442e('0x10')])};db[_0x442e('0x11')]=db[_0x442e('0x1')]['import']('../api/user/user.model');db[_0x442e('0x12')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x14'));db[_0x442e('0x15')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x16'));db['VoiceExtension']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x17'));db[_0x442e('0x18')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x19'));db[_0x442e('0x1a')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x1b'));db[_0x442e('0x1c')]=db['sequelize'][_0x442e('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x442e('0x1d')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x1e'));db[_0x442e('0x1f')]=db[_0x442e('0x1')]['import'](_0x442e('0x20'));db[_0x442e('0x21')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x22'));db[_0x442e('0x23')]=db[_0x442e('0x1')]['import'](_0x442e('0x24'));db[_0x442e('0x25')]=db[_0x442e('0x1')]['import'](_0x442e('0x26'));db['VoiceAgentReport']=db[_0x442e('0x1')][_0x442e('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x27'));db[_0x442e('0x28')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x29'));db['Trunk']=db[_0x442e('0x1')]['import'](_0x442e('0x2a'));db[_0x442e('0x2b')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x2c'));db[_0x442e('0x2d')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x2e'));db[_0x442e('0x2f')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x442e('0x30')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x31'));db['UserMailQueue']=db[_0x442e('0x1')][_0x442e('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x442e('0x32')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x33'));db[_0x442e('0x34')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x35'));db[_0x442e('0x36')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x37'));db[_0x442e('0x38')]=db[_0x442e('0x1')]['import'](_0x442e('0x39'));db[_0x442e('0x3a')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x442e('0x3b')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x3c'));db[_0x442e('0x3d')]=db[_0x442e('0x1')]['import'](_0x442e('0x3e'));db[_0x442e('0x3f')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db['sequelize'][_0x442e('0x13')](_0x442e('0x40'));db[_0x442e('0x41')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x42'));db[_0x442e('0x43')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/mailMessage/mailMessage.model');db[_0x442e('0x44')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x45'));db['MailQueueReport']=db[_0x442e('0x1')]['import'](_0x442e('0x46'));db['Dashboard']=db[_0x442e('0x1')]['import'](_0x442e('0x47'));db[_0x442e('0x48')]=db['sequelize'][_0x442e('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0x442e('0x49')]=db[_0x442e('0x1')]['import'](_0x442e('0x4a'));db[_0x442e('0x4b')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x4c'));db[_0x442e('0x4d')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x4e'));db[_0x442e('0x4f')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x50'));db[_0x442e('0x51')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x52'));db['FaxQueueReport']=db[_0x442e('0x1')]['import'](_0x442e('0x53'));db[_0x442e('0x54')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x55'));db['SmsApplication']=db['sequelize'][_0x442e('0x13')](_0x442e('0x56'));db[_0x442e('0x57')]=db[_0x442e('0x1')]['import'](_0x442e('0x58'));db['SmsMessage']=db[_0x442e('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0x442e('0x59')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x5a'));db[_0x442e('0x5b')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x5c'));db[_0x442e('0x5d')]=db['sequelize']['import'](_0x442e('0x5e'));db['OpenchannelInteraction']=db['sequelize'][_0x442e('0x13')](_0x442e('0x5f'));db[_0x442e('0x60')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x442e('0x13')](_0x442e('0x61'));db[_0x442e('0x62')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x63'));db[_0x442e('0x64')]=db[_0x442e('0x1')]['import'](_0x442e('0x65'));db[_0x442e('0x66')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db['sequelize'][_0x442e('0x13')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x67'));db[_0x442e('0x68')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x69'));db[_0x442e('0x6a')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x6b'));db[_0x442e('0x6c')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x6d'));db['ChatProactiveAction']=db[_0x442e('0x1')]['import'](_0x442e('0x6e'));db['CmCompany']=db['sequelize'][_0x442e('0x13')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x6f'));db[_0x442e('0x70')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x71'));db[_0x442e('0x72')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x73'));db[_0x442e('0x74')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x75'));db['CmHopperHistory']=db[_0x442e('0x1')]['import'](_0x442e('0x76'));db[_0x442e('0x77')]=db[_0x442e('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x442e('0x78')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x79'));db[_0x442e('0x7a')]=db[_0x442e('0x1')]['import'](_0x442e('0x7b'));db[_0x442e('0x7c')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x7d'));db['CannedAnswer']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x7e'));db['Disposition']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x7f'));db[_0x442e('0x80')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x81'));db[_0x442e('0x82')]=db['sequelize']['import'](_0x442e('0x83'));db['Pause']=db[_0x442e('0x1')]['import']('../api/pause/pause.model');db[_0x442e('0x84')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/cdr/cdr.model');db[_0x442e('0x85')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x442e('0x86')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x87'));db[_0x442e('0x88')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x89'));db[_0x442e('0x8a')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/tag/tag.model');db[_0x442e('0x8b')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x8c'));db[_0x442e('0x8d')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x8e'));db['CmHopperAdditionalPhone']=db['sequelize']['import']('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x442e('0x8f')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x90'));db[_0x442e('0x91')]=db['sequelize']['import'](_0x442e('0x92'));db[_0x442e('0x93')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x94'));db[_0x442e('0x95')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x96'));db['IntegrationReport']=db['sequelize']['import'](_0x442e('0x97'));db['AnalyticCustomReport']=db['sequelize'][_0x442e('0x13')](_0x442e('0x98'));db[_0x442e('0x99')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x9a'));db['AnalyticExtractedReport']=db[_0x442e('0x1')]['import'](_0x442e('0x9b'));db[_0x442e('0x9c')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x9d'));db[_0x442e('0x9e')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x9f'));db['AnalyticTreeReport']=db[_0x442e('0x1')][_0x442e('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x442e('0xa0')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xa1'));db[_0x442e('0xa2')]=db[_0x442e('0x1')]['import'](_0x442e('0xa3'));db[_0x442e('0xa4')]=db[_0x442e('0x1')]['import'](_0x442e('0xa5'));db[_0x442e('0xa6')]=db[_0x442e('0x1')]['import'](_0x442e('0xa7'));db['SugarcrmConfiguration']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xa8'));db[_0x442e('0xa9')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xaa'));db['DeskAccount']=db[_0x442e('0x1')]['import'](_0x442e('0xab'));db[_0x442e('0xac')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intDeskField/intDeskField.model');db[_0x442e('0xad')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xae'));db[_0x442e('0xaf')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xb0'));db[_0x442e('0xb1')]=db[_0x442e('0x1')]['import']('../api/intZohoField/intZohoField.model');db[_0x442e('0xb2')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xb3'));db[_0x442e('0xb4')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xb5'));db[_0x442e('0xb6')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xb7'));db[_0x442e('0xb8')]=db['sequelize']['import'](_0x442e('0xb9'));db[_0x442e('0xba')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x442e('0xbb')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x442e('0xbc')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xbd'));db[_0x442e('0xbe')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xbf'));db[_0x442e('0xc0')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x442e('0xc1')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x442e('0xc2')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x442e('0xc3')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xc4'));db['Dynamics365Account']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xc5'));db[_0x442e('0xc6')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xc7'));db[_0x442e('0xc8')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xc9'));db[_0x442e('0xca')]=db[_0x442e('0x1')]['import'](_0x442e('0xcb'));db[_0x442e('0xcc')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x442e('0xcd')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xce'));db[_0x442e('0x95')]=db[_0x442e('0x1')]['import'](_0x442e('0x96'));db['Network']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xcf'));db[_0x442e('0xd0')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xd1'));db['ChatInternalMessage']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xd2'));db[_0x442e('0xd3')]=db[_0x442e('0x1')]['import'](_0x442e('0xd4'));db[_0x442e('0xd5')]=db[_0x442e('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x442e('0xd6')]=db[_0x442e('0x1')]['import'](_0x442e('0xd7'));db[_0x442e('0xd8')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xd9'));db[_0x442e('0xda')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xdb'));db[_0x442e('0xdc')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xdd'));db['JscriptyProject']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xde'));db[_0x442e('0xdf')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xe0'));db['SquareOdbc']=db[_0x442e('0x1')]['import'](_0x442e('0xe1'));db[_0x442e('0xe2')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xe3'));db['SquareRecording']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xe4'));db[_0x442e('0xe5')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xe6'));db[_0x442e('0xe7')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/team/team.model');db[_0x442e('0xe8')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xe9'));db[_0x442e('0xea')]=db[_0x442e('0x1')]['import'](_0x442e('0xeb'));db[_0x442e('0xec')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xed'));db[_0x442e('0xee')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xef'));db['Plugin']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xf0'));db['MailTransferReport']=db['sequelize'][_0x442e('0x13')](_0x442e('0xf1'));db[_0x442e('0xf2')]=db[_0x442e('0x1')]['import'](_0x442e('0xf3'));db[_0x442e('0xf4')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xf5'));db[_0x442e('0xf6')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xf7'));db[_0x442e('0xf8')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xf9'));db[_0x442e('0xfa')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/cmList/cmList.model');db[_0x442e('0xfb')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0xfc'));db[_0x442e('0xfd')]=db['sequelize'][_0x442e('0x13')](_0x442e('0xfe'));db[_0x442e('0xff')]=db[_0x442e('0x1')]['import'](_0x442e('0x100'));db['UserProfileResource']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x101'));db[_0x442e('0x102')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x103'));db['WhatsappAccount']=db[_0x442e('0x1')][_0x442e('0x13')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x442e('0x1')]['import'](_0x442e('0x104'));db[_0x442e('0x105')]=db['sequelize']['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x442e('0x106')]=db[_0x442e('0x1')]['import'](_0x442e('0x107'));db['WhatsappQueueReport']=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x108'));db['WhatsappTransferReport']=db['sequelize']['import'](_0x442e('0x109'));db[_0x442e('0x10a')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x10b'));db[_0x442e('0x10c')]=db[_0x442e('0x1')][_0x442e('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x442e('0x10d')]=db[_0x442e('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x442e('0x10e')]=db[_0x442e('0x1')][_0x442e('0x13')](_0x442e('0x10f'));db[_0x442e('0x110')]=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0x442e('0x111')]=db['sequelize'][_0x442e('0x13')](_0x442e('0x112'));db[_0x442e('0x11')]['hasOne'](db[_0x442e('0x1f')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x442e('0x11')][_0x442e('0x113')](db[_0x442e('0x111')],{'as':'userSetting','onDelete':_0x442e('0x114'),'foreignKey':'UserId'});db[_0x442e('0x11')]['hasMany'](db[_0x442e('0x1c')],{'as':_0x442e('0x115'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')]['hasMany'](db[_0x442e('0x2d')],{'as':_0x442e('0x117'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db[_0x442e('0x119')],{'as':_0x442e('0x11a'),'onDelete':'cascade','hooks':!![]});db['User']['hasMany'](db['CmHopperFinal'],{'as':_0x442e('0x11b'),'foreignKey':'UserId'});db[_0x442e('0x11')][_0x442e('0x118')](db[_0x442e('0x11c')],{'as':_0x442e('0x11d'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db[_0x442e('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x442e('0x116')});db[_0x442e('0x11')]['hasMany'](db[_0x442e('0x11e')],{'as':_0x442e('0x11f'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db['ChatInteraction'],{'as':_0x442e('0x120'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db[_0x442e('0x57')],{'as':_0x442e('0x121'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db[_0x442e('0x4d')],{'as':_0x442e('0x122'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x11')][_0x442e('0x118')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x442e('0x116')});db['User'][_0x442e('0x118')](db[_0x442e('0x105')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x442e('0x11')]['hasMany'](db[_0x442e('0x102')],{'as':_0x442e('0x123'),'foreignKey':_0x442e('0x124')});db[_0x442e('0x11')][_0x442e('0x125')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x442e('0x126')});db[_0x442e('0x11')][_0x442e('0x127')](db['ChatGroup'],{'as':'Groups','through':_0x442e('0x128')});db['User']['belongsToMany'](db[_0x442e('0x129')],{'as':_0x442e('0x12a'),'through':_0x442e('0x12b')});db['User'][_0x442e('0x127')](db[_0x442e('0xfa')],{'as':_0x442e('0x12c'),'through':'cm_user_has_lists'});db['User'][_0x442e('0x127')](db['Team'],{'through':_0x442e('0x12d')});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x41')],{'as':'MailInteractions','through':_0x442e('0x12e')});db[_0x442e('0x11')][_0x442e('0x127')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x442e('0x12f')});db[_0x442e('0x11')][_0x442e('0x127')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0x442e('0x130')});db[_0x442e('0x11')]['belongsToMany'](db[_0x442e('0x57')],{'as':'SmsInteractions','through':_0x442e('0x131')});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x11e')],{'as':'OpenchannelInteractions','through':_0x442e('0x132')});db[_0x442e('0x11')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x1a')],{'as':_0x442e('0x133'),'through':_0x442e('0x2f'),'required':![]});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0xfb')],{'as':_0x442e('0x134'),'through':'UserVoicePrefix','required':![]});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x3f')],{'as':_0x442e('0x135'),'through':_0x442e('0x136'),'required':![]});db[_0x442e('0x11')]['belongsToMany'](db[_0x442e('0x6a')],{'as':_0x442e('0x137'),'through':_0x442e('0x30'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x442e('0x51')],{'as':_0x442e('0x138'),'through':_0x442e('0x32'),'required':![]});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x59')],{'as':_0x442e('0x139'),'through':_0x442e('0x34'),'required':![]});db['User']['belongsToMany'](db[_0x442e('0x13a')],{'as':_0x442e('0x13b'),'through':_0x442e('0x36'),'required':![]});db[_0x442e('0x11')][_0x442e('0x127')](db['WhatsappQueue'],{'as':_0x442e('0x13c'),'through':'UserWhatsappQueue','required':![]});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0xfa')],{'through':_0x442e('0x13d')});db['User']['belongsToMany'](db[_0x442e('0x62')],{'as':'ChatWebsites','through':_0x442e('0x13e')});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x49')],{'as':_0x442e('0x13f'),'through':'user_has_fax_accounts'});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x3d')],{'as':_0x442e('0x140'),'through':_0x442e('0x141')});db['User']['belongsToMany'](db[_0x442e('0x5b')],{'as':_0x442e('0x142'),'through':'user_has_openchannel_accounts'});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x54')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x442e('0x11')][_0x442e('0x127')](db[_0x442e('0x143')],{'as':_0x442e('0x144'),'through':_0x442e('0x145')});db[_0x442e('0x12')][_0x442e('0x118')](db[_0x442e('0x119')],{'as':_0x442e('0x146'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x147')});db['VoiceContext'][_0x442e('0x118')](db[_0x442e('0x119')],{'onDelete':_0x442e('0x114')});db[_0x442e('0x119')][_0x442e('0x118')](db[_0x442e('0x119')],{'as':'Applications','onDelete':'cascade'});db[_0x442e('0x18')][_0x442e('0x127')](db['Sound'],{'as':_0x442e('0x148'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db[_0x442e('0x2d')],{'as':_0x442e('0x149'),'foreignKey':_0x442e('0x14a')});db[_0x442e('0x1a')][_0x442e('0x118')](db[_0x442e('0x70')],{'as':_0x442e('0x14b'),'foreignKey':_0x442e('0x14a')});db[_0x442e('0x1a')][_0x442e('0x118')](db[_0x442e('0x74')],{'as':'HopperFinals','foreignKey':_0x442e('0x14a')});db['VoiceQueue'][_0x442e('0x118')](db['CmHopperHistory'],{'as':_0x442e('0x14c'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x442e('0x118')](db['ReportAgentPreview'],{'as':_0x442e('0x77'),'foreignKey':_0x442e('0x14a')});db[_0x442e('0x1a')][_0x442e('0x118')](db[_0x442e('0x72')],{'as':_0x442e('0x14d'),'foreignKey':_0x442e('0x14a')});db[_0x442e('0x1a')][_0x442e('0x118')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x442e('0x14a')});db['VoiceQueue']['belongsTo'](db[_0x442e('0x14e')],{'as':'Trunk','foreignKey':_0x442e('0x14f')});db[_0x442e('0x1a')][_0x442e('0x125')](db[_0x442e('0x14e')],{'as':_0x442e('0x150'),'foreignKey':_0x442e('0x151')});db[_0x442e('0x1a')][_0x442e('0x125')](db[_0x442e('0x82')],{'as':_0x442e('0x82'),'foreignKey':_0x442e('0x152')});db[_0x442e('0x1a')][_0x442e('0x125')](db['Pause'],{'as':_0x442e('0x153'),'foreignKey':_0x442e('0x154')});db[_0x442e('0x1a')][_0x442e('0x127')](db[_0x442e('0xfa')],{'as':_0x442e('0x12c'),'through':_0x442e('0x155')});db[_0x442e('0x1a')][_0x442e('0x127')](db['User'],{'as':_0x442e('0x156'),'through':_0x442e('0x2f')});db[_0x442e('0x1a')][_0x442e('0x127')](db[_0x442e('0xe7')],{'as':_0x442e('0x157'),'through':_0x442e('0x10d')});db[_0x442e('0x1a')][_0x442e('0x127')](db['CmList'],{'as':_0x442e('0x158'),'through':_0x442e('0x159')});db[_0x442e('0x1c')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x11'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x1d')]['belongsTo'](db[_0x442e('0x11')],{'as':_0x442e('0x11'),'foreignKey':'UserId'});db[_0x442e('0x1f')]['hasMany'](db[_0x442e('0x21')],{'as':_0x442e('0x15a'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x15b'),'sourceKey':_0x442e('0x15c')});db[_0x442e('0x21')]['belongsTo'](db[_0x442e('0x1f')],{'foreignKey':_0x442e('0x15b'),'targetKey':_0x442e('0x15c')});db[_0x442e('0x23')]['hasMany'](db[_0x442e('0x15d')],{'as':_0x442e('0x15e'),'foreignKey':_0x442e('0x15f'),'constraints':![]});db[_0x442e('0x23')][_0x442e('0x118')](db['VoiceAgentReport'],{'as':_0x442e('0x160'),'foreignKey':'uniqueid','constraints':![]});db[_0x442e('0x23')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x11'),'foreignKey':'UserId'});db['VoiceCallReport'][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x3a')][_0x442e('0x125')](db[_0x442e('0x3d')],{'as':_0x442e('0x3d'),'foreignKey':'MailAccountId'});db[_0x442e('0x3a')][_0x442e('0x125')](db[_0x442e('0x10c')],{'as':_0x442e('0x10c'),'foreignKey':_0x442e('0x163'),'onDelete':'restrict'});db[_0x442e('0x3b')]['belongsTo'](db[_0x442e('0x3d')],{'as':_0x442e('0x3d'),'foreignKey':_0x442e('0x164')});db[_0x442e('0x3b')][_0x442e('0x125')](db['CloudProvider'],{'as':_0x442e('0x10c'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x442e('0x3d')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x442e('0x114')});db[_0x442e('0x3d')][_0x442e('0x113')](db[_0x442e('0x3b')],{'as':_0x442e('0x165'),'onDelete':'cascade'});db[_0x442e('0x3d')][_0x442e('0x118')](db['Disposition'],{'as':_0x442e('0x166'),'foreignKey':'MailAccountId','onDelete':_0x442e('0x114')});db[_0x442e('0x3d')][_0x442e('0x118')](db[_0x442e('0x167')],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x164')});db[_0x442e('0x3d')]['hasMany'](db['MailMessage'],{'as':_0x442e('0x15a'),'foreignKey':_0x442e('0x164')});db['MailAccount'][_0x442e('0x118')](db[_0x442e('0x41')],{'as':_0x442e('0x169')});db['MailAccount']['hasMany'](db[_0x442e('0x44')],{'as':'Applications'});db[_0x442e('0x3d')][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db['MailAccount'][_0x442e('0x125')](db['Template'],{'as':_0x442e('0x8f'),'foreignKey':_0x442e('0x16c')});db['MailAccount']['belongsTo'](db[_0x442e('0x16d')],{'as':'mandatoryDispositionPause','foreignKey':_0x442e('0x154')});db['MailAccount']['belongsToMany'](db['User'],{'as':_0x442e('0x156'),'through':_0x442e('0x141')});db['MailQueue'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x136')});db[_0x442e('0x3f')][_0x442e('0x127')](db['Team'],{'through':_0x442e('0x16e'),'as':_0x442e('0x157')});db[_0x442e('0x41')]['hasMany'](db[_0x442e('0x43')],{'as':'Messages','onDelete':_0x442e('0x114'),'foreignKey':'MailInteractionId'});db[_0x442e('0x41')][_0x442e('0x125')](db[_0x442e('0x3d')],{'as':_0x442e('0x16f'),'foreignKey':'MailAccountId'});db[_0x442e('0x41')][_0x442e('0x125')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailInteraction'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x170'),'foreignKey':'UserId'});db[_0x442e('0x41')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x171'),'as':_0x442e('0x172')});db['MailInteraction'][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x171'),'as':_0x442e('0x173')});db[_0x442e('0x41')]['belongsToMany'](db[_0x442e('0x11')],{'as':_0x442e('0x174'),'through':_0x442e('0x12e'),'foreignKey':'MailInteractionId'});db[_0x442e('0x43')][_0x442e('0x118')](db['Attachment'],{'as':_0x442e('0x175'),'onDelete':_0x442e('0x114')});db[_0x442e('0x43')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x11')});db[_0x442e('0x43')]['belongsTo'](db[_0x442e('0x129')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x161')});db[_0x442e('0x43')][_0x442e('0x125')](db['MailInteraction'],{'as':_0x442e('0x176'),'foreignKey':'MailInteractionId'});db[_0x442e('0x43')][_0x442e('0x125')](db[_0x442e('0x3d')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x164')});db[_0x442e('0x43')][_0x442e('0x125')](db[_0x442e('0x62')],{'as':'ChatWebsite','foreignKey':_0x442e('0x177')});db['MailMessage'][_0x442e('0x125')](db[_0x442e('0x68')],{'as':_0x442e('0x68'),'foreignKey':_0x442e('0x178')});db['MailApplication'][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':'restrict'});db[_0x442e('0x44')]['belongsTo'](db['MailQueue'],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x442e('0x3d')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x44')][_0x442e('0x125')](db[_0x442e('0x82')],{'onDelete':'restrict','foreignKey':_0x442e('0x152')});db[_0x442e('0x44')][_0x442e('0x125')](db['Tag'],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x17a')});db[_0x442e('0x17b')][_0x442e('0x125')](db[_0x442e('0x3d')],{});db['MailQueueReport'][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db['MailQueueReport']['belongsTo'](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x17b')]['belongsTo'](db[_0x442e('0x41')],{});db[_0x442e('0x17b')][_0x442e('0x125')](db[_0x442e('0x43')],{});db['MailQueueReport'][_0x442e('0x125')](db[_0x442e('0x11')],{});db[_0x442e('0x17b')][_0x442e('0x125')](db[_0x442e('0x3f')],{});db[_0x442e('0x17c')][_0x442e('0x118')](db[_0x442e('0x48')],{'as':'Items','onDelete':_0x442e('0x114')});db['FaxAccount'][_0x442e('0x118')](db[_0x442e('0x17d')],{'as':'Dispositions','foreignKey':_0x442e('0x17e'),'onDelete':_0x442e('0x114')});db[_0x442e('0x49')][_0x442e('0x118')](db['CannedAnswer'],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x17e')});db[_0x442e('0x49')]['hasMany'](db[_0x442e('0x4d')],{'as':_0x442e('0x169')});db[_0x442e('0x49')][_0x442e('0x118')](db[_0x442e('0x4b')],{'as':'Applications'});db['FaxAccount'][_0x442e('0x118')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0x442e('0x114')});db[_0x442e('0x49')][_0x442e('0x118')](db[_0x442e('0x4f')],{'as':_0x442e('0x15a')});db[_0x442e('0x49')][_0x442e('0x125')](db[_0x442e('0x14e')],{'as':_0x442e('0x14e')});db[_0x442e('0x49')][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0x49')][_0x442e('0x125')](db[_0x442e('0x16d')],{'as':_0x442e('0x153'),'foreignKey':_0x442e('0x154')});db[_0x442e('0x49')]['belongsToMany'](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x17f')});db[_0x442e('0x4b')][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x4b')][_0x442e('0x125')](db[_0x442e('0x51')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x4b')][_0x442e('0x125')](db[_0x442e('0x49')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x4b')][_0x442e('0x125')](db[_0x442e('0x8a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x442e('0x4d')][_0x442e('0x118')](db[_0x442e('0x4f')],{'as':_0x442e('0x15a'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x180')});db['FaxInteraction'][_0x442e('0x125')](db[_0x442e('0x49')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x442e('0x4d')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db['FaxInteraction'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x170'),'foreignKey':_0x442e('0x116')});db['FaxInteraction'][_0x442e('0x127')](db['Tag'],{'through':_0x442e('0x181'),'as':'Tags'});db[_0x442e('0x4d')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x181'),'as':_0x442e('0x173')});db['FaxInteraction']['belongsToMany'](db[_0x442e('0x11')],{'as':_0x442e('0x174'),'through':_0x442e('0x130'),'foreignKey':_0x442e('0x180')});db['FaxMessage']['belongsTo'](db[_0x442e('0x11')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x11')});db[_0x442e('0x4f')][_0x442e('0x125')](db[_0x442e('0x4d')],{'as':_0x442e('0x176'),'foreignKey':_0x442e('0x180')});db[_0x442e('0x4f')][_0x442e('0x125')](db[_0x442e('0x129')],{'onDelete':_0x442e('0x114'),'as':'Contact'});db[_0x442e('0x4f')][_0x442e('0x125')](db[_0x442e('0xee')],{'as':_0x442e('0xee'),'foreignKey':'AttachmentId'});db[_0x442e('0x4f')]['belongsTo'](db[_0x442e('0x49')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x17e')});db['FaxQueue'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x32')});db[_0x442e('0x51')][_0x442e('0x127')](db['Team'],{'through':_0x442e('0x182'),'as':'Teams'});db[_0x442e('0x183')][_0x442e('0x125')](db[_0x442e('0x49')],{});db[_0x442e('0x183')][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0x183')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db['FaxQueueReport']['belongsTo'](db[_0x442e('0x4d')],{});db['FaxQueueReport'][_0x442e('0x125')](db[_0x442e('0x4f')],{});db[_0x442e('0x183')][_0x442e('0x125')](db[_0x442e('0x11')],{});db[_0x442e('0x183')][_0x442e('0x125')](db[_0x442e('0x51')],{});db[_0x442e('0x54')][_0x442e('0x118')](db[_0x442e('0x17d')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x442e('0x114')});db[_0x442e('0x54')][_0x442e('0x118')](db[_0x442e('0x167')],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x184')});db[_0x442e('0x54')]['hasMany'](db[_0x442e('0x185')],{'as':_0x442e('0x15a'),'foreignKey':_0x442e('0x184')});db[_0x442e('0x54')][_0x442e('0x118')](db[_0x442e('0x57')],{'as':'Interactions'});db[_0x442e('0x54')]['hasMany'](db[_0x442e('0x186')],{'as':_0x442e('0x187')});db['SmsAccount'][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0x54')][_0x442e('0x125')](db['Pause'],{'as':_0x442e('0x153'),'foreignKey':_0x442e('0x154')});db[_0x442e('0x54')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x188')});db[_0x442e('0x186')]['belongsTo'](db[_0x442e('0x11')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x186')][_0x442e('0x125')](db[_0x442e('0x59')],{'onDelete':'restrict'});db['SmsApplication'][_0x442e('0x125')](db[_0x442e('0x54')],{'onDelete':_0x442e('0x179')});db['SmsApplication'][_0x442e('0x125')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x442e('0x186')][_0x442e('0x125')](db['Tag'],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x17a')});db[_0x442e('0x57')]['hasMany'](db[_0x442e('0x185')],{'as':_0x442e('0x15a'),'onDelete':_0x442e('0x114'),'foreignKey':'SmsInteractionId'});db[_0x442e('0x57')][_0x442e('0x125')](db[_0x442e('0x54')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x184')});db[_0x442e('0x57')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':'Contact','foreignKey':_0x442e('0x162')});db['SmsInteraction'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x170'),'foreignKey':_0x442e('0x116')});db[_0x442e('0x57')]['belongsToMany'](db['Tag'],{'through':_0x442e('0x189'),'as':_0x442e('0x172')});db[_0x442e('0x57')][_0x442e('0x127')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x442e('0x173')});db['SmsInteraction'][_0x442e('0x127')](db['User'],{'as':_0x442e('0x174'),'through':'user_has_sms_interactions','foreignKey':_0x442e('0x18a')});db[_0x442e('0x185')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x11')});db[_0x442e('0x185')][_0x442e('0x125')](db[_0x442e('0x129')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x161')});db[_0x442e('0x185')][_0x442e('0x125')](db[_0x442e('0x57')],{'onDelete':_0x442e('0x114'),'as':'Interaction','foreignKey':_0x442e('0x18a')});db[_0x442e('0x185')][_0x442e('0x125')](db[_0x442e('0x54')],{'as':'Account','foreignKey':_0x442e('0x184')});db[_0x442e('0x59')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':'UserSmsQueue','foreignKey':_0x442e('0x18b')});db[_0x442e('0x59')][_0x442e('0x127')](db['Team'],{'through':_0x442e('0x18c'),'as':'Teams'});db['OpenchannelAccount'][_0x442e('0x118')](db[_0x442e('0x17d')],{'as':_0x442e('0x166'),'foreignKey':_0x442e('0x18d'),'onDelete':'cascade'});db[_0x442e('0x5b')][_0x442e('0x118')](db[_0x442e('0x167')],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x18d')});db[_0x442e('0x5b')][_0x442e('0x118')](db[_0x442e('0x11e')],{'as':'Interactions','foreignKey':_0x442e('0x18d')});db[_0x442e('0x5b')][_0x442e('0x118')](db[_0x442e('0x60')],{'as':_0x442e('0x15a'),'foreignKey':_0x442e('0x18d')});db['OpenchannelAccount'][_0x442e('0x118')](db[_0x442e('0x5d')],{'as':_0x442e('0x187'),'foreignKey':_0x442e('0x18d')});db[_0x442e('0x5b')]['belongsTo'](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db['OpenchannelAccount'][_0x442e('0x125')](db[_0x442e('0x16d')],{'as':_0x442e('0x153'),'foreignKey':_0x442e('0x154')});db[_0x442e('0x5b')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':'Agents','through':_0x442e('0x18e')});db[_0x442e('0x5d')]['belongsTo'](db[_0x442e('0x11')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x5d')][_0x442e('0x125')](db['OpenchannelQueue'],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x18f')});db[_0x442e('0x5d')]['belongsTo'](db[_0x442e('0x5b')],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x18d')});db['OpenchannelApplication'][_0x442e('0x125')](db[_0x442e('0x82')],{'onDelete':_0x442e('0x179'),'foreignKey':'IntervalId'});db[_0x442e('0x5d')][_0x442e('0x125')](db[_0x442e('0x8a')],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x17a')});db[_0x442e('0x11e')]['hasMany'](db[_0x442e('0x60')],{'as':_0x442e('0x15a'),'onDelete':'cascade','foreignKey':_0x442e('0x190')});db[_0x442e('0x11e')][_0x442e('0x125')](db[_0x442e('0x5b')],{'as':'Account','foreignKey':_0x442e('0x18d')});db['OpenchannelInteraction'][_0x442e('0x125')](db[_0x442e('0x129')],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x170'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0x442e('0x172')});db[_0x442e('0x11e')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x191'),'as':_0x442e('0x173')});db['OpenchannelInteraction'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x174'),'through':_0x442e('0x132'),'foreignKey':_0x442e('0x190')});db[_0x442e('0x60')][_0x442e('0x125')](db['User'],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x11')});db['OpenchannelMessage']['belongsTo'](db[_0x442e('0x129')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x161')});db[_0x442e('0x60')][_0x442e('0x125')](db[_0x442e('0x11e')],{'onDelete':_0x442e('0x114'),'as':'Interaction','foreignKey':_0x442e('0x190')});db['OpenchannelMessage'][_0x442e('0x125')](db['Attachment'],{'as':_0x442e('0xee'),'foreignKey':_0x442e('0x192')});db[_0x442e('0x60')][_0x442e('0x125')](db[_0x442e('0x5b')],{'as':'Account','foreignKey':_0x442e('0x18d')});db['OpenchannelQueue'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':'UserOpenchannelQueue','foreignKey':_0x442e('0x18f')});db['OpenchannelQueue'][_0x442e('0x127')](db['Team'],{'through':_0x442e('0x193'),'as':_0x442e('0x157')});db['ChatWebsite'][_0x442e('0x118')](db[_0x442e('0x17d')],{'as':_0x442e('0x166'),'foreignKey':_0x442e('0x177'),'onDelete':'cascade'});db[_0x442e('0x62')][_0x442e('0x118')](db[_0x442e('0x167')],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x177')});db['ChatWebsite'][_0x442e('0x118')](db[_0x442e('0x194')],{'as':_0x442e('0x195')});db[_0x442e('0x62')][_0x442e('0x118')](db[_0x442e('0x196')],{'as':_0x442e('0x169')});db[_0x442e('0x62')][_0x442e('0x118')](db[_0x442e('0x66')],{'as':_0x442e('0x187')});db[_0x442e('0x62')][_0x442e('0x118')](db[_0x442e('0x197')],{'as':_0x442e('0x15a')});db['ChatWebsite']['belongsTo'](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0x62')][_0x442e('0x125')](db[_0x442e('0x82')],{'as':_0x442e('0x82'),'foreignKey':'IntervalId'});db[_0x442e('0x62')][_0x442e('0x125')](db[_0x442e('0x3d')],{'as':_0x442e('0x3d'),'foreignKey':_0x442e('0x164')});db[_0x442e('0x62')][_0x442e('0x125')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x442e('0x154')});db[_0x442e('0x62')][_0x442e('0x127')](db['User'],{'as':_0x442e('0x156'),'through':_0x442e('0x13e')});db[_0x442e('0x64')][_0x442e('0x125')](db[_0x442e('0x5b')],{});db[_0x442e('0x64')]['belongsTo'](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db['OpenchannelQueueReport'][_0x442e('0x125')](db['CmContact'],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x64')][_0x442e('0x125')](db[_0x442e('0x11e')],{});db[_0x442e('0x64')][_0x442e('0x125')](db[_0x442e('0x60')],{});db[_0x442e('0x64')][_0x442e('0x125')](db[_0x442e('0x11')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x442e('0x13a')],{});db[_0x442e('0x66')]['belongsTo'](db[_0x442e('0x11')],{'as':_0x442e('0x198'),'foreignKey':_0x442e('0x116'),'onDelete':'restrict'});db[_0x442e('0x66')][_0x442e('0x125')](db[_0x442e('0x6a')],{'as':_0x442e('0x199'),'foreignKey':_0x442e('0x19a'),'onDelete':_0x442e('0x179')});db[_0x442e('0x66')][_0x442e('0x125')](db[_0x442e('0x62')],{'as':_0x442e('0x19b'),'foreignKey':_0x442e('0x177'),'onDelete':_0x442e('0x179')});db[_0x442e('0x66')]['belongsTo'](db['Tag'],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x17a')});db['ChatInteraction'][_0x442e('0x118')](db[_0x442e('0x197')],{'as':_0x442e('0x15a'),'onDelete':_0x442e('0x114'),'foreignKey':'ChatInteractionId'});db[_0x442e('0x196')]['belongsTo'](db[_0x442e('0x62')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x177')});db[_0x442e('0x196')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x196')]['belongsTo'](db[_0x442e('0x11')],{'as':_0x442e('0x170'),'foreignKey':'UserId'});db[_0x442e('0x196')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x19c'),'as':'Tags'});db[_0x442e('0x196')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x19c'),'as':_0x442e('0x173')});db[_0x442e('0x196')]['belongsToMany'](db[_0x442e('0x11')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0x442e('0x197')][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x11')});db[_0x442e('0x197')][_0x442e('0x125')](db['CmContact'],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x197')][_0x442e('0x125')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x442e('0x176'),'foreignKey':_0x442e('0x19d')});db[_0x442e('0x197')][_0x442e('0x125')](db[_0x442e('0xee')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x442e('0x197')]['belongsTo'](db['ChatWebsite'],{'as':_0x442e('0x16f'),'foreignKey':'ChatWebsiteId'});db[_0x442e('0x68')][_0x442e('0x118')](db[_0x442e('0xee')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x68')][_0x442e('0x125')](db[_0x442e('0x129')],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x68')][_0x442e('0x125')](db['ChatWebsite'],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x177')});db['ChatQueue'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x30'),'hooks':!![]});db['ChatQueue'][_0x442e('0x127')](db[_0x442e('0xe7')],{'through':_0x442e('0x19e'),'as':_0x442e('0x157')});db[_0x442e('0x6c')][_0x442e('0x118')](db[_0x442e('0x19f')],{'as':_0x442e('0x15a'),'foreignKey':_0x442e('0x1a0'),'onDelete':'cascade'});db['ChatGroup'][_0x442e('0x127')](db['User'],{'as':_0x442e('0x149'),'through':_0x442e('0x128')});db[_0x442e('0x194')][_0x442e('0x125')](db[_0x442e('0x62')],{'as':'Website','foreignKey':_0x442e('0x177')});db[_0x442e('0x1a1')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0x442e('0x118')](db[_0x442e('0x8d')],{'as':_0x442e('0x1a2'),'foreignKey':_0x442e('0x1a3')});db[_0x442e('0x129')]['hasMany'](db['CmHopper'],{'as':_0x442e('0x14b'),'foreignKey':_0x442e('0x162')});db[_0x442e('0x129')][_0x442e('0x118')](db[_0x442e('0x74')],{'as':_0x442e('0x11b'),'foreignKey':'ContactId'});db['CmContact'][_0x442e('0x118')](db[_0x442e('0x11c')],{'as':_0x442e('0x14c'),'foreignKey':'ContactId'});db[_0x442e('0x129')][_0x442e('0x118')](db[_0x442e('0x77')],{'as':_0x442e('0x77'),'foreignKey':_0x442e('0x162')});db['CmContact'][_0x442e('0x118')](db['JscriptySessionReport'],{'as':_0x442e('0x1a4'),'foreignKey':_0x442e('0x162')});db['CmContact'][_0x442e('0x118')](db[_0x442e('0x11e')],{'as':_0x442e('0x11f'),'foreignKey':'ContactId','onDelete':_0x442e('0x179')});db[_0x442e('0x129')][_0x442e('0x118')](db[_0x442e('0x196')],{'as':'ChatInteractions','foreignKey':_0x442e('0x162'),'onDelete':_0x442e('0x179')});db[_0x442e('0x129')]['hasMany'](db[_0x442e('0x57')],{'as':_0x442e('0x121'),'foreignKey':_0x442e('0x162'),'onDelete':_0x442e('0x179')});db[_0x442e('0x129')][_0x442e('0x118')](db[_0x442e('0x4d')],{'as':_0x442e('0x122'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x442e('0x129')][_0x442e('0x118')](db[_0x442e('0x41')],{'as':_0x442e('0x1a5'),'foreignKey':_0x442e('0x162'),'onDelete':_0x442e('0x179')});db[_0x442e('0x129')][_0x442e('0x125')](db[_0x442e('0x1a1')],{'as':'Company','foreignKey':_0x442e('0x1a6')});db['CmContact']['belongsTo'](db['CmList'],{'as':_0x442e('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x442e('0x129')]['belongsToMany'](db['User'],{'as':_0x442e('0x174'),'through':_0x442e('0x12b')});db[_0x442e('0x129')][_0x442e('0x127')](db['Tag'],{'as':_0x442e('0x172'),'through':_0x442e('0x1a7')});db[_0x442e('0x129')][_0x442e('0x127')](db['Tag'],{'through':_0x442e('0x1a7'),'as':_0x442e('0x173')});db[_0x442e('0x70')][_0x442e('0x118')](db[_0x442e('0x1a8')],{'as':_0x442e('0x1a9'),'foreignKey':_0x442e('0x1aa')});db[_0x442e('0x70')]['belongsTo'](db[_0x442e('0x129')],{'as':'Contact','foreignKey':_0x442e('0x162'),'onDelete':_0x442e('0x114')});db[_0x442e('0x70')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x442e('0x114')});db['CmHopper'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x198'),'foreignKey':'UserId'});db[_0x442e('0x70')][_0x442e('0x125')](db['VoiceQueue'],{'as':_0x442e('0x199'),'foreignKey':'VoiceQueueId','onDelete':_0x442e('0x114')});db[_0x442e('0x70')][_0x442e('0x125')](db[_0x442e('0xea')],{'as':_0x442e('0xea'),'foreignKey':'CampaignId','onDelete':_0x442e('0x114')});db['CmHopper'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':'Owner','foreignKey':_0x442e('0x1ab')});db[_0x442e('0x72')]['belongsTo'](db[_0x442e('0x129')],{'as':'Contact','foreignKey':_0x442e('0x162'),'onDelete':_0x442e('0x114')});db['CmHopperBlack']['belongsTo'](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b'),'onDelete':_0x442e('0x114')});db[_0x442e('0x72')][_0x442e('0x125')](db[_0x442e('0x1a')],{'as':_0x442e('0x199'),'foreignKey':_0x442e('0x14a'),'onDelete':_0x442e('0x114')});db[_0x442e('0x72')][_0x442e('0x125')](db[_0x442e('0xea')],{'as':_0x442e('0xea'),'foreignKey':_0x442e('0x1ac'),'onDelete':_0x442e('0x114')});db[_0x442e('0x7c')][_0x442e('0x118')](db[_0x442e('0x80')],{'as':{'plural':_0x442e('0x1ad'),'singular':_0x442e('0x1ae')},'foreignKey':'AutomationAllId','onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x7c')]['hasMany'](db['Condition'],{'as':{'plural':'Any','singular':_0x442e('0x1af')},'foreignKey':_0x442e('0x1b0'),'onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x7c')][_0x442e('0x118')](db[_0x442e('0x7a')],{'as':_0x442e('0x1b1'),'foreignKey':_0x442e('0x1b2'),'onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db['Disposition'],{'as':_0x442e('0x166'),'foreignKey':'ParentId','onDelete':_0x442e('0x114')});db[_0x442e('0x82')][_0x442e('0x118')](db[_0x442e('0x82')],{'as':_0x442e('0x1b3'),'foreignKey':_0x442e('0x152'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x442e('0x119')],{'as':_0x442e('0x11a'),'foreignKey':_0x442e('0x152'),'onDelete':'restrict'});db[_0x442e('0x82')][_0x442e('0x118')](db[_0x442e('0x44')],{'as':_0x442e('0x1b4'),'foreignKey':_0x442e('0x152')});db[_0x442e('0x82')]['hasMany'](db['ChatApplication'],{'as':_0x442e('0x1b5'),'foreignKey':_0x442e('0x152')});db[_0x442e('0x82')][_0x442e('0x118')](db[_0x442e('0x4b')],{'as':'FaxApplications','foreignKey':_0x442e('0x152')});db[_0x442e('0x82')][_0x442e('0x118')](db['SmsApplication'],{'as':_0x442e('0x1b6'),'foreignKey':_0x442e('0x152')});db[_0x442e('0x86')][_0x442e('0x125')](db[_0x442e('0x3d')],{});db[_0x442e('0x86')][_0x442e('0x125')](db[_0x442e('0x99')],{'foreignKey':_0x442e('0x1b7')});db[_0x442e('0x86')][_0x442e('0x125')](db[_0x442e('0x1b8')],{'foreignKey':_0x442e('0x1b9')});db[_0x442e('0x88')][_0x442e('0x127')](db[_0x442e('0x18')],{'as':_0x442e('0x1ba'),'through':_0x442e('0x1bb'),'onDelete':'restrict'});db['Tag'][_0x442e('0x127')](db[_0x442e('0x129')],{'through':_0x442e('0x1a7')});db[_0x442e('0x8a')][_0x442e('0x127')](db[_0x442e('0x196')],{'through':_0x442e('0x19c')});db[_0x442e('0x8a')][_0x442e('0x127')](db[_0x442e('0x41')],{'through':_0x442e('0x171')});db[_0x442e('0x8a')][_0x442e('0x127')](db[_0x442e('0x57')],{'through':'sms_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x442e('0x4d')],{'through':_0x442e('0x181')});db[_0x442e('0x8a')][_0x442e('0x127')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x442e('0x105')],{'through':_0x442e('0x1bc')});db['CmContactHasItem'][_0x442e('0x125')](db[_0x442e('0x8b')],{'as':_0x442e('0x1bd'),'foreignKey':_0x442e('0x1be')});db[_0x442e('0x1a8')][_0x442e('0x125')](db[_0x442e('0x70')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0x442e('0x8d')]['belongsTo'](db['CmContact'],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x1a3')});db[_0x442e('0x91')][_0x442e('0x118')](db[_0x442e('0x80')],{'as':{'plural':_0x442e('0x1bf'),'singular':_0x442e('0x1c0')},'foreignKey':_0x442e('0x1c1'),'onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x91')][_0x442e('0x118')](db[_0x442e('0x80')],{'as':{'plural':_0x442e('0x1c2'),'singular':_0x442e('0x1c3')},'foreignKey':_0x442e('0x1c4'),'onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x91')][_0x442e('0x118')](db[_0x442e('0x7a')],{'as':_0x442e('0x1b1'),'foreignKey':_0x442e('0x1c5'),'onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x1b8')][_0x442e('0x118')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1b9'),'hooks':!![]});db[_0x442e('0x99')][_0x442e('0x118')](db[_0x442e('0x9e')],{'as':_0x442e('0x1c6'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1b7')});db[_0x442e('0x9c')][_0x442e('0x118')](db[_0x442e('0x9e')],{'as':_0x442e('0x1c6'),'onDelete':_0x442e('0x114'),'foreignKey':'MetricId'});db[_0x442e('0x9e')][_0x442e('0x125')](db[_0x442e('0x9c')],{'foreignKey':_0x442e('0x1c7')});db['SalesforceAccount']['hasMany'](db[_0x442e('0xa2')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':'AccountId'});db[_0x442e('0xa2')][_0x442e('0x118')](db[_0x442e('0xa4')],{'as':_0x442e('0x1c9'),'onDelete':_0x442e('0x114'),'foreignKey':'SubjectId'});db[_0x442e('0xa2')][_0x442e('0x118')](db[_0x442e('0xa4')],{'as':_0x442e('0x1ca'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cb')});db['SalesforceConfiguration'][_0x442e('0x118')](db[_0x442e('0xa4')],{'as':_0x442e('0x1c6'),'onDelete':_0x442e('0x114'),'foreignKey':'FieldId'});db[_0x442e('0xa2')][_0x442e('0x125')](db[_0x442e('0xa0')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xa4')][_0x442e('0x118')](db[_0x442e('0xa4')],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xa4')][_0x442e('0x118')](db['SalesforceField'],{'as':_0x442e('0x1cf'),'foreignKey':'DescriptionId'});db[_0x442e('0xa4')][_0x442e('0x118')](db[_0x442e('0xa4')],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xa4')]['belongsTo'](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db[_0x442e('0xa6')][_0x442e('0x118')](db[_0x442e('0x1d3')],{'as':'Configurations','onDelete':_0x442e('0x114'),'foreignKey':'AccountId'});db[_0x442e('0x1d3')][_0x442e('0x118')](db['SugarcrmField'],{'as':_0x442e('0x1c9'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0x1d3')][_0x442e('0x118')](db[_0x442e('0xa9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x442e('0x1d3')][_0x442e('0x118')](db[_0x442e('0xa9')],{'as':_0x442e('0x1c6'),'onDelete':'cascade','foreignKey':_0x442e('0x1d1')});db[_0x442e('0x1d3')][_0x442e('0x125')](db[_0x442e('0xa6')],{'as':_0x442e('0x16f'),'foreignKey':'AccountId'});db[_0x442e('0xa9')]['hasMany'](db['SugarcrmField'],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xa9')][_0x442e('0x118')](db[_0x442e('0xa9')],{'as':_0x442e('0x1cf'),'foreignKey':'DescriptionId'});db[_0x442e('0xa9')][_0x442e('0x118')](db[_0x442e('0xa9')],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xa9')]['belongsTo'](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db[_0x442e('0x1d4')]['hasMany'](db[_0x442e('0xac')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xac')][_0x442e('0x118')](db[_0x442e('0x1d5')],{'as':_0x442e('0x1c9'),'onDelete':'cascade','foreignKey':_0x442e('0x1ce')});db['DeskConfiguration'][_0x442e('0x118')](db[_0x442e('0x1d5')],{'as':'Descriptions','onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cb')});db['DeskConfiguration'][_0x442e('0x118')](db['DeskField'],{'as':_0x442e('0x1c6'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x442e('0xac')][_0x442e('0x125')](db[_0x442e('0x1d4')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db['DeskConfiguration'][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x1d6')});db['DeskField'][_0x442e('0x118')](db[_0x442e('0x1d5')],{'as':'Subject','foreignKey':_0x442e('0x1ce')});db[_0x442e('0x1d5')][_0x442e('0x118')](db[_0x442e('0x1d5')],{'as':_0x442e('0x1cf'),'foreignKey':'DescriptionId'});db[_0x442e('0x1d5')]['hasMany'](db[_0x442e('0x1d5')],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0x1d5')]['belongsTo'](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':'VariableId'});db['ZohoAccount'][_0x442e('0x118')](db[_0x442e('0xaf')],{'as':'Configurations','onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xaf')]['hasMany'](db[_0x442e('0xb1')],{'as':_0x442e('0x1c9'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xaf')]['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':_0x442e('0x114'),'foreignKey':'DescriptionId'});db[_0x442e('0xaf')][_0x442e('0x118')](db[_0x442e('0xb1')],{'as':_0x442e('0x1c6'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xaf')]['belongsTo'](db[_0x442e('0xad')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xb1')][_0x442e('0x118')](db[_0x442e('0xb1')],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db['ZohoField']['hasMany'](db[_0x442e('0xb1')],{'as':'Description','foreignKey':_0x442e('0x1cb')});db[_0x442e('0xb1')][_0x442e('0x118')](db[_0x442e('0xb1')],{'as':_0x442e('0x1d0'),'foreignKey':'FieldId'});db[_0x442e('0xb1')][_0x442e('0x125')](db['Variable'],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db['ZendeskAccount'][_0x442e('0x118')](db[_0x442e('0xb4')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db['ZendeskConfiguration'][_0x442e('0x118')](db[_0x442e('0xb6')],{'as':_0x442e('0x1c9'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xb4')][_0x442e('0x118')](db['ZendeskField'],{'as':_0x442e('0x1ca'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xb4')][_0x442e('0x118')](db['ZendeskField'],{'as':_0x442e('0x1c6'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xb4')]['belongsTo'](db[_0x442e('0xb2')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db['ZendeskConfiguration'][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':'int_zendesk_configuration_has_tags'});db[_0x442e('0xb6')][_0x442e('0x118')](db[_0x442e('0xb6')],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xb6')]['hasMany'](db[_0x442e('0xb6')],{'as':_0x442e('0x1cf'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xb6')][_0x442e('0x118')](db[_0x442e('0xb6')],{'as':_0x442e('0x1d0'),'foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x442e('0x1d2')});db[_0x442e('0xb8')][_0x442e('0x118')](db[_0x442e('0xba')],{'as':'Configurations','onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db['FreshdeskConfiguration'][_0x442e('0x118')](db[_0x442e('0xbb')],{'as':_0x442e('0x1c9'),'onDelete':_0x442e('0x114'),'foreignKey':'SubjectId'});db[_0x442e('0xba')][_0x442e('0x118')](db[_0x442e('0xbb')],{'as':_0x442e('0x1ca'),'onDelete':_0x442e('0x114'),'foreignKey':'DescriptionId'});db[_0x442e('0xba')][_0x442e('0x118')](db[_0x442e('0xbb')],{'as':_0x442e('0x1c6'),'onDelete':'cascade','foreignKey':_0x442e('0x1d1')});db[_0x442e('0xba')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xba')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x1d7')});db[_0x442e('0xbb')]['hasMany'](db[_0x442e('0xbb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x442e('0xbb')]['hasMany'](db[_0x442e('0xbb')],{'as':_0x442e('0x1cf'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xbb')]['hasMany'](db[_0x442e('0xbb')],{'as':_0x442e('0x1d0'),'foreignKey':'FieldId'});db[_0x442e('0xbb')]['belongsTo'](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xbe')][_0x442e('0x118')](db[_0x442e('0xc0')],{'as':'Subjects','foreignKey':_0x442e('0x1ce')});db['VtigerConfiguration']['hasMany'](db[_0x442e('0xc0')],{'as':_0x442e('0x1ca'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xbe')]['hasMany'](db[_0x442e('0xc0')],{'as':_0x442e('0x1c6'),'foreignKey':'FieldId'});db[_0x442e('0xbe')][_0x442e('0x125')](db[_0x442e('0xbc')],{'as':_0x442e('0x16f'),'foreignKey':'AccountId'});db[_0x442e('0xc0')][_0x442e('0x118')](db[_0x442e('0xc0')],{'as':'Subject','foreignKey':_0x442e('0x1ce')});db['VtigerField'][_0x442e('0x118')](db[_0x442e('0xc0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x442e('0xc0')][_0x442e('0x118')](db[_0x442e('0xc0')],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xc0')][_0x442e('0x125')](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db[_0x442e('0xc1')][_0x442e('0x118')](db[_0x442e('0xc2')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xc2')][_0x442e('0x118')](db[_0x442e('0xc3')],{'as':_0x442e('0x1c9'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xc2')][_0x442e('0x118')](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x442e('0x1cb')});db['ServicenowConfiguration'][_0x442e('0x118')](db[_0x442e('0xc3')],{'as':_0x442e('0x1c6'),'foreignKey':'FieldId'});db[_0x442e('0xc2')][_0x442e('0x125')](db[_0x442e('0xc1')],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xc3')][_0x442e('0x118')](db[_0x442e('0xc3')],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db['ServicenowField'][_0x442e('0x118')](db[_0x442e('0xc3')],{'as':_0x442e('0x1cf'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xc3')][_0x442e('0x118')](db[_0x442e('0xc3')],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xc3')][_0x442e('0x125')](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':_0x442e('0x1d2')});db[_0x442e('0x1d8')][_0x442e('0x118')](db[_0x442e('0xc6')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':'AccountId'});db[_0x442e('0x1d8')][_0x442e('0x125')](db['CloudProvider'],{'as':_0x442e('0x10c'),'foreignKey':'CloudProviderId'});db['Dynamics365Configuration']['hasMany'](db[_0x442e('0xc8')],{'as':_0x442e('0x1c9'),'onDelete':_0x442e('0x114'),'foreignKey':'SubjectId'});db[_0x442e('0xc6')][_0x442e('0x118')](db['Dynamics365Field'],{'as':_0x442e('0x1ca'),'onDelete':'cascade','foreignKey':_0x442e('0x1cb')});db[_0x442e('0xc6')]['hasMany'](db[_0x442e('0xc8')],{'as':_0x442e('0x1c6'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x442e('0xc6')][_0x442e('0x125')](db[_0x442e('0x1d8')],{'as':_0x442e('0x16f'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db[_0x442e('0xc8')],{'as':_0x442e('0x1cd'),'foreignKey':_0x442e('0x1ce')});db[_0x442e('0xc8')][_0x442e('0x118')](db[_0x442e('0xc8')],{'as':_0x442e('0x1cf'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xc8')][_0x442e('0x118')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x442e('0x1d1')});db[_0x442e('0xc8')][_0x442e('0x125')](db['Variable'],{'as':_0x442e('0x93'),'foreignKey':'VariableId'});db[_0x442e('0xca')][_0x442e('0x118')](db[_0x442e('0xcc')],{'as':_0x442e('0x1c8'),'onDelete':_0x442e('0x114'),'foreignKey':_0x442e('0x1cc')});db[_0x442e('0xcc')][_0x442e('0x118')](db[_0x442e('0xcd')],{'as':_0x442e('0x1c9'),'foreignKey':'SubjectId'});db[_0x442e('0xcc')][_0x442e('0x118')](db[_0x442e('0xcd')],{'as':_0x442e('0x1ca'),'foreignKey':'DescriptionId'});db[_0x442e('0xcc')]['hasMany'](db[_0x442e('0xcd')],{'as':_0x442e('0x1c6'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xcc')][_0x442e('0x125')](db[_0x442e('0xca')],{'as':_0x442e('0x16f'),'foreignKey':'AccountId'});db[_0x442e('0xcd')][_0x442e('0x118')](db[_0x442e('0xcd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x442e('0xcd')][_0x442e('0x118')](db[_0x442e('0xcd')],{'as':_0x442e('0x1cf'),'foreignKey':_0x442e('0x1cb')});db[_0x442e('0xcd')]['hasMany'](db['FreshsalesField'],{'as':_0x442e('0x1d0'),'foreignKey':_0x442e('0x1d1')});db[_0x442e('0xcd')][_0x442e('0x125')](db[_0x442e('0x93')],{'as':_0x442e('0x93'),'foreignKey':'VariableId'});db[_0x442e('0xd0')][_0x442e('0x125')](db[_0x442e('0x62')],{});db[_0x442e('0xd0')][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0x442e('0xd0')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0xd0')]['belongsTo'](db[_0x442e('0x196')],{});db[_0x442e('0xd0')][_0x442e('0x125')](db[_0x442e('0x197')],{});db['ChatQueueReport'][_0x442e('0x125')](db['User'],{});db[_0x442e('0xd0')][_0x442e('0x125')](db[_0x442e('0x6a')],{});db[_0x442e('0x19f')][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':_0x442e('0x114'),'foreignKey':'FromId'});db[_0x442e('0x19f')][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':'cascade','foreignKey':_0x442e('0x1d9')});db[_0x442e('0xd6')][_0x442e('0x118')](db[_0x442e('0xd5')],{'foreignKey':'SessionId','onDelete':_0x442e('0x114')});db[_0x442e('0xd6')][_0x442e('0x118')](db[_0x442e('0xd3')],{'foreignKey':_0x442e('0x1da'),'onDelete':_0x442e('0x114')});db['SmsQueueReport']['belongsTo'](db[_0x442e('0x54')],{});db[_0x442e('0xd8')]['belongsTo'](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0xd8')][_0x442e('0x125')](db['CmContact'],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db[_0x442e('0xd8')][_0x442e('0x125')](db[_0x442e('0x57')],{});db[_0x442e('0xd8')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db['User'],{});db[_0x442e('0xd8')][_0x442e('0x125')](db[_0x442e('0x59')],{});db[_0x442e('0x1db')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x442e('0x1dc')});db[_0x442e('0x1db')][_0x442e('0x118')](db[_0x442e('0xd5')],{'foreignKey':'ProjectId'});db[_0x442e('0x1db')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x442e('0x1dc')});db[_0x442e('0xe7')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x12d')});db[_0x442e('0xe7')][_0x442e('0x127')](db[_0x442e('0x1a')],{'through':_0x442e('0x10d'),'as':_0x442e('0x133')});db['Team'][_0x442e('0x127')](db[_0x442e('0x3f')],{'through':_0x442e('0x16e'),'as':_0x442e('0x135')});db['Team']['belongsToMany'](db[_0x442e('0x6a')],{'through':'team_has_chat_queues','as':_0x442e('0x137')});db['Team'][_0x442e('0x127')](db['FaxQueue'],{'through':_0x442e('0x182'),'as':_0x442e('0x138')});db[_0x442e('0xe7')]['belongsToMany'](db[_0x442e('0x59')],{'through':'team_has_sms_queues','as':_0x442e('0x139')});db[_0x442e('0xe7')][_0x442e('0x127')](db[_0x442e('0x13a')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x442e('0xe7')]['belongsToMany'](db[_0x442e('0x10a')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x442e('0xe7')]['belongsToMany'](db['VoicePrefix'],{'through':_0x442e('0x10e'),'as':_0x442e('0x134')});db['Campaign'][_0x442e('0x118')](db[_0x442e('0x70')],{'as':_0x442e('0x14b'),'foreignKey':_0x442e('0x1ac')});db[_0x442e('0xea')][_0x442e('0x118')](db[_0x442e('0x74')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x442e('0xea')][_0x442e('0x118')](db[_0x442e('0x11c')],{'as':_0x442e('0x14c'),'foreignKey':_0x442e('0x1ac')});db[_0x442e('0xea')][_0x442e('0x118')](db[_0x442e('0x72')],{'as':_0x442e('0x14d'),'foreignKey':'CampaignId'});db[_0x442e('0xea')]['belongsTo'](db[_0x442e('0x14e')],{'as':_0x442e('0x14e'),'foreignKey':_0x442e('0x14f')});db['Campaign'][_0x442e('0x125')](db[_0x442e('0x14e')],{'as':'TrunkBackup','foreignKey':_0x442e('0x151')});db[_0x442e('0xea')][_0x442e('0x125')](db[_0x442e('0x82')],{'as':_0x442e('0x82'),'foreignKey':_0x442e('0x152')});db[_0x442e('0xea')][_0x442e('0x125')](db[_0x442e('0xe2')],{'as':_0x442e('0xe2'),'foreignKey':'SquareProjectId'});db[_0x442e('0xea')]['belongsToMany'](db['CmList'],{'as':_0x442e('0x12c'),'through':_0x442e('0x1dd')});db[_0x442e('0xea')][_0x442e('0x127')](db['CmList'],{'as':_0x442e('0x158'),'through':_0x442e('0x1de')});db[_0x442e('0xee')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x442e('0x68'),'foreignKey':_0x442e('0x178')});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x43')],{});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x41')],{});db[_0x442e('0x1df')]['belongsTo'](db[_0x442e('0x3d')],{'foreignKey':_0x442e('0x1e0'),'as':_0x442e('0x1e1')});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e2'),'as':_0x442e('0x1e3')});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':_0x442e('0x1e5')});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x3f')],{'foreignKey':'ToMailQueueId','as':_0x442e('0x1e6')});db[_0x442e('0x1df')][_0x442e('0x125')](db[_0x442e('0x3d')],{'foreignKey':_0x442e('0x1e7'),'as':_0x442e('0x1e8')});db[_0x442e('0xf2')]['belongsTo'](db[_0x442e('0x197')],{});db[_0x442e('0xf2')][_0x442e('0x125')](db['ChatInteraction'],{});db[_0x442e('0xf2')]['belongsTo'](db[_0x442e('0x62')],{'foreignKey':'FromChatWebsiteId','as':_0x442e('0x1e1')});db['ChatTransferReport'][_0x442e('0x125')](db['User'],{'foreignKey':'FromUserId','as':_0x442e('0x1e3')});db[_0x442e('0xf2')]['belongsTo'](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':'ToAgent'});db[_0x442e('0xf2')][_0x442e('0x125')](db[_0x442e('0x6a')],{'foreignKey':'ToChatQueueId','as':_0x442e('0x1e6')});db[_0x442e('0xf2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x442e('0x1e9'),'as':'ToAccount'});db[_0x442e('0xf4')][_0x442e('0x125')](db[_0x442e('0x4f')],{});db[_0x442e('0xf4')]['belongsTo'](db[_0x442e('0x4d')],{});db[_0x442e('0xf4')][_0x442e('0x125')](db[_0x442e('0x49')],{'foreignKey':_0x442e('0x1ea'),'as':_0x442e('0x1e1')});db[_0x442e('0xf4')][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e2'),'as':_0x442e('0x1e3')});db[_0x442e('0xf4')]['belongsTo'](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':'ToAgent'});db[_0x442e('0xf4')][_0x442e('0x125')](db[_0x442e('0x51')],{'foreignKey':_0x442e('0x1eb'),'as':_0x442e('0x1e6')});db[_0x442e('0xf4')][_0x442e('0x125')](db[_0x442e('0x49')],{'foreignKey':_0x442e('0x1ec'),'as':_0x442e('0x1e8')});db[_0x442e('0xf6')][_0x442e('0x125')](db[_0x442e('0x60')],{});db[_0x442e('0xf6')][_0x442e('0x125')](db['OpenchannelInteraction'],{});db[_0x442e('0xf6')][_0x442e('0x125')](db[_0x442e('0x5b')],{'foreignKey':'FromOpenchannelAccountId','as':_0x442e('0x1e1')});db['OpenchannelTransferReport'][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':'FromUserId','as':_0x442e('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':'ToAgent'});db[_0x442e('0xf6')][_0x442e('0x125')](db[_0x442e('0x13a')],{'foreignKey':_0x442e('0x1ed'),'as':_0x442e('0x1e6')});db[_0x442e('0xf6')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x442e('0x1ee'),'as':_0x442e('0x1e8')});db[_0x442e('0xf8')][_0x442e('0x125')](db[_0x442e('0x185')],{});db[_0x442e('0xf8')][_0x442e('0x125')](db[_0x442e('0x57')],{});db[_0x442e('0xf8')]['belongsTo'](db[_0x442e('0x54')],{'foreignKey':_0x442e('0x1ef'),'as':'FromAccount'});db[_0x442e('0xf8')][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e2'),'as':'FromAgent'});db[_0x442e('0xf8')][_0x442e('0x125')](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':_0x442e('0x1e5')});db[_0x442e('0xf8')][_0x442e('0x125')](db['SmsQueue'],{'foreignKey':_0x442e('0x1f0'),'as':_0x442e('0x1e6')});db['SmsTransferReport'][_0x442e('0x125')](db['SmsAccount'],{'foreignKey':_0x442e('0x1f1'),'as':_0x442e('0x1e8')});db[_0x442e('0xfa')][_0x442e('0x118')](db[_0x442e('0x17d')],{'as':'Dispositions','foreignKey':_0x442e('0x16b'),'onDelete':_0x442e('0x114')});db['CmList'][_0x442e('0x118')](db[_0x442e('0x78')],{'as':_0x442e('0x1f2'),'foreignKey':'ListId'});db[_0x442e('0xfa')][_0x442e('0x118')](db['CmContact'],{'as':_0x442e('0x12a'),'onDelete':_0x442e('0x114'),'foreignKey':'ListId'});db['CmList'][_0x442e('0x118')](db[_0x442e('0x74')],{'as':_0x442e('0x11b'),'foreignKey':_0x442e('0x16b')});db[_0x442e('0xfa')][_0x442e('0x118')](db[_0x442e('0x11c')],{'as':'HopperHistory','foreignKey':_0x442e('0x16b')});db[_0x442e('0xfa')]['hasMany'](db[_0x442e('0x77')],{'as':_0x442e('0x77'),'foreignKey':_0x442e('0x16b')});db['CmList'][_0x442e('0x127')](db[_0x442e('0x1a')],{'as':_0x442e('0x1f3'),'through':_0x442e('0x155')});db[_0x442e('0xfa')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':'cm_user_has_lists'});db[_0x442e('0xfb')][_0x442e('0x118')](db[_0x442e('0x119')],{'as':'Extensions','onDelete':_0x442e('0x114')});db['VoicePrefix'][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x110')});db[_0x442e('0xfb')]['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':_0x442e('0x157')});db[_0x442e('0xfd')][_0x442e('0x118')](db[_0x442e('0x11')],{'as':_0x442e('0x174'),'foreignKey':_0x442e('0x126')});db[_0x442e('0xfd')][_0x442e('0x118')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x442e('0x114')});db[_0x442e('0xff')][_0x442e('0x118')](db[_0x442e('0x1f4')],{'as':'Resources','foreignKey':_0x442e('0x1f5'),'onDelete':_0x442e('0x114')});db[_0x442e('0x143')]['hasMany'](db['Disposition'],{'as':_0x442e('0x166'),'foreignKey':_0x442e('0x1f6'),'onDelete':_0x442e('0x114')});db[_0x442e('0x143')][_0x442e('0x118')](db[_0x442e('0x167')],{'as':_0x442e('0x168'),'foreignKey':_0x442e('0x1f6')});db[_0x442e('0x143')][_0x442e('0x118')](db['WhatsappMessage'],{'as':_0x442e('0x15a'),'foreignKey':_0x442e('0x1f6')});db[_0x442e('0x143')][_0x442e('0x118')](db[_0x442e('0x105')],{'as':_0x442e('0x169')});db['WhatsappAccount']['hasMany'](db[_0x442e('0x1f7')],{'as':_0x442e('0x187')});db[_0x442e('0x143')][_0x442e('0x125')](db['CmList'],{'as':_0x442e('0x16a'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x442e('0x125')](db[_0x442e('0x16d')],{'as':_0x442e('0x153'),'foreignKey':_0x442e('0x154')});db[_0x442e('0x143')][_0x442e('0x127')](db['User'],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0x442e('0x1f7')][_0x442e('0x125')](db[_0x442e('0x11')],{'onDelete':_0x442e('0x179')});db[_0x442e('0x1f7')][_0x442e('0x125')](db['WhatsappQueue'],{'onDelete':'restrict'});db['WhatsappApplication'][_0x442e('0x125')](db['WhatsappAccount'],{'onDelete':_0x442e('0x179')});db[_0x442e('0x1f7')][_0x442e('0x125')](db[_0x442e('0x82')],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x152')});db[_0x442e('0x1f7')][_0x442e('0x125')](db[_0x442e('0x8a')],{'onDelete':_0x442e('0x179'),'foreignKey':_0x442e('0x17a')});db[_0x442e('0x105')][_0x442e('0x118')](db[_0x442e('0x106')],{'as':_0x442e('0x15a'),'onDelete':'cascade','foreignKey':_0x442e('0x1f8')});db[_0x442e('0x105')][_0x442e('0x125')](db[_0x442e('0x143')],{'as':'Account','foreignKey':_0x442e('0x1f6')});db[_0x442e('0x105')][_0x442e('0x125')](db[_0x442e('0x129')],{'as':_0x442e('0x161'),'foreignKey':_0x442e('0x162')});db['WhatsappInteraction'][_0x442e('0x125')](db[_0x442e('0x11')],{'as':'Owner','foreignKey':_0x442e('0x116')});db[_0x442e('0x105')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x1bc'),'as':_0x442e('0x172')});db[_0x442e('0x105')][_0x442e('0x127')](db[_0x442e('0x8a')],{'through':_0x442e('0x1bc'),'as':_0x442e('0x173')});db[_0x442e('0x105')][_0x442e('0x127')](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x442e('0x1f8')});db[_0x442e('0x106')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x11')});db[_0x442e('0x106')][_0x442e('0x125')](db[_0x442e('0x129')],{'onDelete':'cascade','as':_0x442e('0x161')});db['WhatsappMessage']['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x442e('0x114'),'as':_0x442e('0x176'),'foreignKey':_0x442e('0x1f8')});db[_0x442e('0x106')]['belongsTo'](db['WhatsappAccount'],{'as':_0x442e('0x16f'),'foreignKey':_0x442e('0x1f6')});db[_0x442e('0x1f9')]['belongsTo'](db[_0x442e('0x143')],{});db[_0x442e('0x1f9')][_0x442e('0x125')](db[_0x442e('0xfa')],{'as':_0x442e('0x16a'),'foreignKey':_0x442e('0x16b')});db['WhatsappQueueReport'][_0x442e('0x125')](db[_0x442e('0x129')],{'as':'Contact','foreignKey':_0x442e('0x162')});db[_0x442e('0x1f9')][_0x442e('0x125')](db[_0x442e('0x105')],{});db[_0x442e('0x1f9')]['belongsTo'](db[_0x442e('0x10a')],{});db['WhatsappQueueReport'][_0x442e('0x125')](db[_0x442e('0x106')],{});db[_0x442e('0x1f9')]['belongsTo'](db['User'],{});db['WhatsappTransferReport'][_0x442e('0x125')](db[_0x442e('0x106')],{});db[_0x442e('0x1fa')][_0x442e('0x125')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x442e('0x125')](db[_0x442e('0x143')],{'foreignKey':_0x442e('0x1fb'),'as':'FromAccount'});db[_0x442e('0x1fa')][_0x442e('0x125')](db[_0x442e('0x143')],{'foreignKey':'ToWhatsappAccountId','as':_0x442e('0x1e8')});db[_0x442e('0x1fa')][_0x442e('0x125')](db[_0x442e('0x10a')],{'foreignKey':'ToQueueId','as':_0x442e('0x1e6')});db[_0x442e('0x1fa')]['belongsTo'](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e2'),'as':_0x442e('0x1e3')});db[_0x442e('0x1fa')]['belongsTo'](db[_0x442e('0x11')],{'foreignKey':_0x442e('0x1e4'),'as':_0x442e('0x1e5')});db[_0x442e('0x10a')][_0x442e('0x127')](db[_0x442e('0x11')],{'as':_0x442e('0x156'),'through':_0x442e('0x38'),'foreignKey':_0x442e('0x1fc')});db[_0x442e('0x10a')]['belongsToMany'](db[_0x442e('0xe7')],{'through':_0x442e('0x1fd'),'as':_0x442e('0x157')});db[_0x442e('0x111')][_0x442e('0x125')](db[_0x442e('0x11')],{'as':_0x442e('0x1fe'),'foreignKey':_0x442e('0x116'),'onDelete':_0x442e('0x114'),'hooks':!![]});db[_0x442e('0x10c')]['hasOne'](db[_0x442e('0x1d8')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0x442e('0x10c')][_0x442e('0x113')](db[_0x442e('0x3a')],{'as':_0x442e('0x1ff'),'onDelete':_0x442e('0x179')});db[_0x442e('0x10c')][_0x442e('0x113')](db[_0x442e('0x3b')],{'as':'Smtp','onDelete':_0x442e('0x179')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6038254..51fb237 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd996=['/api/sms/interactions','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/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/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','static','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','/index.html','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','./api/user','use','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication'];(function(_0x24e37c,_0x5aa189){var _0x161dda=function(_0x10857f){while(--_0x10857f){_0x24e37c['push'](_0x24e37c['shift']());}};_0x161dda(++_0x5aa189);}(_0xd996,0xd0));var _0x6d99=function(_0x19258d,_0x5f2768){_0x19258d=_0x19258d-0x0;var _0x2239d7=_0xd996[_0x19258d];return _0x2239d7;};'use strict';var path=require('path');var express=require(_0x6d99('0x0'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0x6d99('0x1'))[_0x6d99('0x2')];var clientSideLogs=require(_0x6d99('0x3'));exports['default']=function(_0x454ee5){return setupLoggers(_0x454ee5)[_0x6d99('0x4')](function(){_0x454ee5['use']('/api/users',require(_0x6d99('0x5')));_0x454ee5['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x7'),require(_0x6d99('0x8')));_0x454ee5['use']('/api/voice/extensions',require(_0x6d99('0x9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa'),require(_0x6d99('0xb')));_0x454ee5['use'](_0x6d99('0xc'),require(_0x6d99('0xd')));_0x454ee5['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x454ee5[_0x6d99('0x6')]('/api/screen/recordings',require('./api/screenRecording'));_0x454ee5['use'](_0x6d99('0xe'),require('./api/voiceMail'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf'),require(_0x6d99('0x10')));_0x454ee5[_0x6d99('0x6')]('/api/voice/calls/reports',require(_0x6d99('0x11')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x12'),require('./api/voiceDialReport'));_0x454ee5[_0x6d99('0x6')]('/api/voice/agents/reports',require(_0x6d99('0x13')));_0x454ee5[_0x6d99('0x6')]('/api/voice/queues/reports',require(_0x6d99('0x14')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x15'),require(_0x6d99('0x16')));_0x454ee5['use'](_0x6d99('0x17'),require(_0x6d99('0x18')));_0x454ee5[_0x6d99('0x6')]('/api/voice/transfers/reports',require(_0x6d99('0x19')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1a'),require(_0x6d99('0x1b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1c'),require(_0x6d99('0x1d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x1e'),require(_0x6d99('0x1f')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x20'),require(_0x6d99('0x21')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x22'),require(_0x6d99('0x23')));_0x454ee5[_0x6d99('0x6')]('/api/mail/messages',require(_0x6d99('0x24')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x25'),require(_0x6d99('0x26')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x27'),require('./api/mailQueueReport'));_0x454ee5['use'](_0x6d99('0x28'),require(_0x6d99('0x29')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2a'),require(_0x6d99('0x2b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2c'),require('./api/faxAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x2d'),require(_0x6d99('0x2e')));_0x454ee5['use'](_0x6d99('0x2f'),require('./api/faxInteraction'));_0x454ee5[_0x6d99('0x6')]('/api/fax/messages',require(_0x6d99('0x30')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x31'),require(_0x6d99('0x32')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x33'),require(_0x6d99('0x34')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x35'),require('./api/smsAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x36'),require(_0x6d99('0x37')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x38'),require('./api/smsInteraction'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x39'),require('./api/smsMessage'));_0x454ee5[_0x6d99('0x6')]('/api/sms/queues',require(_0x6d99('0x3a')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3b'),require('./api/openchannelAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3c'),require(_0x6d99('0x3d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x3e'),require('./api/openchannelInteraction'));_0x454ee5[_0x6d99('0x6')]('/api/openchannel/messages',require(_0x6d99('0x3f')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x40'),require(_0x6d99('0x41')));_0x454ee5['use'](_0x6d99('0x42'),require(_0x6d99('0x43')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x44'),require('./api/openchannelQueueReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x45'),require('./api/chatApplication'));_0x454ee5['use'](_0x6d99('0x46'),require(_0x6d99('0x47')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x48'),require('./api/chatMessage'));_0x454ee5['use'](_0x6d99('0x49'),require(_0x6d99('0x4a')));_0x454ee5['use'](_0x6d99('0x4b'),require(_0x6d99('0x4c')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x4d'),require(_0x6d99('0x4e')));_0x454ee5['use'](_0x6d99('0x4f'),require(_0x6d99('0x50')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x51'),require(_0x6d99('0x52')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x53'),require(_0x6d99('0x54')));_0x454ee5['use'](_0x6d99('0x55'),require('./api/cmHopper'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x56'),require('./api/cmHopperBlack'));_0x454ee5[_0x6d99('0x6')]('/api/cm/hopper_final',require(_0x6d99('0x57')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x58'),require('./api/cmHopperHistory'));_0x454ee5['use']('/api/cm/custom_fields',require(_0x6d99('0x59')));_0x454ee5[_0x6d99('0x6')]('/api/actions',require(_0x6d99('0x5a')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5b'),require(_0x6d99('0x5c')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5d'),require(_0x6d99('0x5e')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x5f'),require(_0x6d99('0x60')));_0x454ee5['use']('/api/conditions',require(_0x6d99('0x61')));_0x454ee5[_0x6d99('0x6')]('/api/intervals',require(_0x6d99('0x62')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x63'),require(_0x6d99('0x64')));_0x454ee5[_0x6d99('0x6')]('/api/cdr',require('./api/cdr'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x65'),require('./api/voiceQueuesLog'));_0x454ee5[_0x6d99('0x6')]('/api/schedules',require(_0x6d99('0x66')));_0x454ee5['use']('/api/sounds',require(_0x6d99('0x67')));_0x454ee5['use'](_0x6d99('0x68'),require(_0x6d99('0x69')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6a'),require(_0x6d99('0x6b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6c'),require('./api/cmContactHasItem'));_0x454ee5['use']('/api/cm_hopper_additional_phones',require(_0x6d99('0x6d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x6e'),require(_0x6d99('0x6f')));_0x454ee5[_0x6d99('0x6')]('/api/triggers',require(_0x6d99('0x70')));_0x454ee5[_0x6d99('0x6')]('/api/variables',require(_0x6d99('0x71')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x72'),require(_0x6d99('0x73')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/reports',require('./api/integrationReport'));_0x454ee5[_0x6d99('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x74'),require('./api/analyticDefaultReport'));_0x454ee5['use'](_0x6d99('0x75'),require(_0x6d99('0x76')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x77'),require(_0x6d99('0x78')));_0x454ee5[_0x6d99('0x6')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x454ee5[_0x6d99('0x6')]('/api/analytics/tree_reports',require(_0x6d99('0x79')));_0x454ee5['use'](_0x6d99('0x7a'),require(_0x6d99('0x7b')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x454ee5['use']('/api/integrations/salesforce/fields',require(_0x6d99('0x7c')));_0x454ee5['use'](_0x6d99('0x7d'),require(_0x6d99('0x7e')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x7f'),require(_0x6d99('0x80')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x81'),require(_0x6d99('0x82')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/desk/accounts',require(_0x6d99('0x83')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/desk/configurations',require(_0x6d99('0x84')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x85'),require('./api/intDeskField'));_0x454ee5['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x86'),require(_0x6d99('0x87')));_0x454ee5['use'](_0x6d99('0x88'),require(_0x6d99('0x89')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x8a'),require(_0x6d99('0x8b')));_0x454ee5[_0x6d99('0x6')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x454ee5[_0x6d99('0x6')]('/api/integrations/zendesk/fields',require(_0x6d99('0x8c')));_0x454ee5['use']('/api/integrations/freshdesk/accounts',require(_0x6d99('0x8d')));_0x454ee5['use'](_0x6d99('0x8e'),require('./api/intFreshdeskConfiguration'));_0x454ee5['use'](_0x6d99('0x8f'),require(_0x6d99('0x90')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x91'),require(_0x6d99('0x92')));_0x454ee5['use'](_0x6d99('0x93'),require(_0x6d99('0x94')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x95'),require(_0x6d99('0x96')));_0x454ee5['use'](_0x6d99('0x97'),require(_0x6d99('0x98')));_0x454ee5['use'](_0x6d99('0x99'),require('./api/intServicenowConfiguration'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9a'),require(_0x6d99('0x9b')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9c'),require(_0x6d99('0x9d')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x9e'),require(_0x6d99('0x9f')));_0x454ee5['use'](_0x6d99('0xa0'),require(_0x6d99('0xa1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa2'),require('./api/intFreshsalesAccount'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa3'),require(_0x6d99('0xa4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa5'),require(_0x6d99('0xa6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xa7'),require(_0x6d99('0xa8')));_0x454ee5[_0x6d99('0x6')]('/api/chat/reports/queue',require(_0x6d99('0xa9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xaa'),require('./api/chatInternalMessage'));_0x454ee5['use'](_0x6d99('0xab'),require(_0x6d99('0xac')));_0x454ee5['use'](_0x6d99('0xad'),require(_0x6d99('0xae')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xaf'),require('./api/jscriptySessionReport'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb0'),require(_0x6d99('0xb1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb2'),require(_0x6d99('0xb3')));_0x454ee5[_0x6d99('0x6')]('/api/square/details/reports',require(_0x6d99('0xb4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xb5'),require(_0x6d99('0xb6')));_0x454ee5[_0x6d99('0x6')]('/api/settings',require(_0x6d99('0xb7')));_0x454ee5['use'](_0x6d99('0xb8'),require(_0x6d99('0xb9')));_0x454ee5['use'](_0x6d99('0xba'),require('./api/squareProject'));_0x454ee5['use'](_0x6d99('0xbb'),require('./api/squareRecording'));_0x454ee5['use'](_0x6d99('0xbc'),require('./api/squareMessage'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xbd'),require(_0x6d99('0xbe')));_0x454ee5['use'](_0x6d99('0xbf'),require(_0x6d99('0xc0')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc1'),require(_0x6d99('0xc2')));_0x454ee5['use'](_0x6d99('0xc3'),require(_0x6d99('0xc4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc5'),require(_0x6d99('0xc6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc7'),require('./api/plugin'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xc8'),require(_0x6d99('0xc9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xca'),require(_0x6d99('0xcb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xcc'),require(_0x6d99('0xcd')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xce'),require(_0x6d99('0xcf')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd0'),require(_0x6d99('0xd1')));_0x454ee5[_0x6d99('0x6')]('/api/cm/lists',require(_0x6d99('0xd2')));_0x454ee5['use'](_0x6d99('0xd3'),require(_0x6d99('0xd4')));_0x454ee5['use'](_0x6d99('0xd5'),require(_0x6d99('0xd6')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd7'),require('./api/userProfileSection'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xd8'),require(_0x6d99('0xd9')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xda'),require(_0x6d99('0xdb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xdc'),require(_0x6d99('0xdd')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/applications',require(_0x6d99('0xde')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xdf'),require(_0x6d99('0xe0')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/messages',require(_0x6d99('0xe1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe2'),require(_0x6d99('0xe3')));_0x454ee5[_0x6d99('0x6')]('/api/whatsapp/reports/transfer',require(_0x6d99('0xe4')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe5'),require('./api/whatsappQueue'));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe6'),require(_0x6d99('0xe7')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xe8'),require(_0x6d99('0xe9')));_0x454ee5['use'](_0x6d99('0xea'),require(_0x6d99('0xeb')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xec'),require('./api/authLocal'));_0x454ee5['use'](_0x6d99('0xed'),require(_0x6d99('0xee')));_0x454ee5[_0x6d99('0x6')]('/api/auth/activedirectory',require(_0x6d99('0xef')));_0x454ee5['use'](_0x6d99('0xf0'),require(_0x6d99('0xf1')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf2'),require(_0x6d99('0xf3')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf4'),require(_0x6d99('0xf5')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf6'),require(_0x6d99('0xf7')));_0x454ee5[_0x6d99('0x6')]('/api/pm2',require(_0x6d99('0xf8')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xf9'),require(_0x6d99('0xfa')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0xfb'),clientSideLogs);_0x454ee5[_0x6d99('0x6')](_0x6d99('0xfc'),express['static'](path[_0x6d99('0xfd')](config[_0x6d99('0xfe')],_0x6d99('0xfc'))));_0x454ee5[_0x6d99('0x6')]('/www',express[_0x6d99('0xff')](path['join'](config[_0x6d99('0xfe')],'/www')));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x100'),express[_0x6d99('0xff')](path[_0x6d99('0xfd')](config[_0x6d99('0xfe')],_0x6d99('0x100'))));_0x454ee5[_0x6d99('0x6')](_0x6d99('0x101'),express[_0x6d99('0xff')](path[_0x6d99('0xfd')](config['root'],_0x6d99('0x102'),'3.1.0')));_0x454ee5[_0x6d99('0x6')]('/plugins',express[_0x6d99('0xff')](path['join'](config[_0x6d99('0xfe')],_0x6d99('0x103'))));_0x454ee5[_0x6d99('0x104')](_0x6d99('0x105'))[_0x6d99('0x106')](errors[0x194]);_0x454ee5[_0x6d99('0x104')]('/*')[_0x6d99('0x106')](function(_0xded49a,_0xc9dc60){_0xc9dc60['sendFile'](path['resolve'](_0x454ee5['get']('appPath')+_0x6d99('0x107')));});return _0x454ee5;});}; \ No newline at end of file +var _0xc589=['./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','/apidoc','/www','root','/demo','/snippet','3.1.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/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/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/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/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime'];(function(_0x422aed,_0x5a48ac){var _0x2cf65d=function(_0x4e2a49){while(--_0x4e2a49){_0x422aed['push'](_0x422aed['shift']());}};_0x2cf65d(++_0x5a48ac);}(_0xc589,0x13e));var _0x9c58=function(_0x1a36c5,_0x23a798){_0x1a36c5=_0x1a36c5-0x0;var _0x3afc0f=_0xc589[_0x1a36c5];return _0x3afc0f;};'use strict';var path=require('path');var express=require(_0x9c58('0x0'));var errors=require(_0x9c58('0x1'));var config=require(_0x9c58('0x2'));var setupLoggers=require(_0x9c58('0x3'))[_0x9c58('0x4')];var clientSideLogs=require(_0x9c58('0x5'));exports['default']=function(_0x52c5ad){return setupLoggers(_0x52c5ad)[_0x9c58('0x6')](function(){_0x52c5ad[_0x9c58('0x7')]('/api/users',require(_0x9c58('0x8')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x9'),require(_0x9c58('0xa')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xb'),require(_0x9c58('0xc')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xd'),require(_0x9c58('0xe')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xf'),require(_0x9c58('0x10')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x11'),require(_0x9c58('0x12')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x13'),require(_0x9c58('0x14')));_0x52c5ad[_0x9c58('0x7')]('/api/screen/recordings',require(_0x9c58('0x15')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x16'),require(_0x9c58('0x17')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x18'),require(_0x9c58('0x19')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x1a'),require('./api/voiceCallReport'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x1b'),require('./api/voiceDialReport'));_0x52c5ad['use'](_0x9c58('0x1c'),require('./api/voiceAgentReport'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x1d'),require(_0x9c58('0x1e')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x1f'),require(_0x9c58('0x20')));_0x52c5ad['use']('/api/trunks',require(_0x9c58('0x21')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x22'),require(_0x9c58('0x23')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x24'),require(_0x9c58('0x25')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x26'),require('./api/mailAccount'));_0x52c5ad['use'](_0x9c58('0x27'),require(_0x9c58('0x28')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x29'),require(_0x9c58('0x2a')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x2b'),require(_0x9c58('0x2c')));_0x52c5ad['use']('/api/mail/messages',require(_0x9c58('0x2d')));_0x52c5ad['use'](_0x9c58('0x2e'),require(_0x9c58('0x2f')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x30'),require(_0x9c58('0x31')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x32'),require(_0x9c58('0x33')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x34'),require(_0x9c58('0x35')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x36'),require(_0x9c58('0x37')));_0x52c5ad['use'](_0x9c58('0x38'),require(_0x9c58('0x39')));_0x52c5ad[_0x9c58('0x7')]('/api/fax/interactions',require(_0x9c58('0x3a')));_0x52c5ad['use']('/api/fax/messages',require('./api/faxMessage'));_0x52c5ad[_0x9c58('0x7')]('/api/fax/queues',require(_0x9c58('0x3b')));_0x52c5ad['use'](_0x9c58('0x3c'),require(_0x9c58('0x3d')));_0x52c5ad['use'](_0x9c58('0x3e'),require('./api/smsAccount'));_0x52c5ad[_0x9c58('0x7')]('/api/sms/applications',require(_0x9c58('0x3f')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x40'),require(_0x9c58('0x41')));_0x52c5ad[_0x9c58('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x42'),require(_0x9c58('0x43')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x44'),require(_0x9c58('0x45')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x46'),require(_0x9c58('0x47')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x48'),require(_0x9c58('0x49')));_0x52c5ad['use'](_0x9c58('0x4a'),require('./api/openchannelMessage'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x4b'),require('./api/openchannelQueue'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x4c'),require('./api/chatWebsite'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x4d'),require(_0x9c58('0x4e')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x4f'),require(_0x9c58('0x50')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x51'),require(_0x9c58('0x52')));_0x52c5ad[_0x9c58('0x7')]('/api/chat/messages',require(_0x9c58('0x53')));_0x52c5ad['use'](_0x9c58('0x54'),require(_0x9c58('0x55')));_0x52c5ad['use'](_0x9c58('0x56'),require(_0x9c58('0x57')));_0x52c5ad['use'](_0x9c58('0x58'),require(_0x9c58('0x59')));_0x52c5ad['use'](_0x9c58('0x5a'),require('./api/chatProactiveAction'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x5b'),require(_0x9c58('0x5c')));_0x52c5ad[_0x9c58('0x7')]('/api/cm/contacts',require(_0x9c58('0x5d')));_0x52c5ad[_0x9c58('0x7')]('/api/cm/hopper',require(_0x9c58('0x5e')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x5f'),require(_0x9c58('0x60')));_0x52c5ad['use']('/api/cm/hopper_final',require(_0x9c58('0x61')));_0x52c5ad[_0x9c58('0x7')]('/api/cm/hopper_history',require(_0x9c58('0x62')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x63'),require(_0x9c58('0x64')));_0x52c5ad['use'](_0x9c58('0x65'),require(_0x9c58('0x66')));_0x52c5ad[_0x9c58('0x7')]('/api/automations',require(_0x9c58('0x67')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x68'),require(_0x9c58('0x69')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x6a'),require(_0x9c58('0x6b')));_0x52c5ad['use'](_0x9c58('0x6c'),require(_0x9c58('0x6d')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x6e'),require(_0x9c58('0x6f')));_0x52c5ad['use'](_0x9c58('0x70'),require(_0x9c58('0x71')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x72'),require('./api/cdr'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x73'),require(_0x9c58('0x74')));_0x52c5ad[_0x9c58('0x7')]('/api/schedules',require('./api/schedule'));_0x52c5ad['use']('/api/sounds',require(_0x9c58('0x75')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x76'),require(_0x9c58('0x77')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x78'),require(_0x9c58('0x79')));_0x52c5ad['use'](_0x9c58('0x7a'),require(_0x9c58('0x7b')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x7c'),require(_0x9c58('0x7d')));_0x52c5ad[_0x9c58('0x7')]('/api/templates',require(_0x9c58('0x7e')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x7f'),require('./api/trigger'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x80'),require(_0x9c58('0x81')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x82'),require(_0x9c58('0x83')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x84'),require(_0x9c58('0x85')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x86'),require(_0x9c58('0x87')));_0x52c5ad['use'](_0x9c58('0x88'),require(_0x9c58('0x89')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x8a'),require(_0x9c58('0x8b')));_0x52c5ad['use'](_0x9c58('0x8c'),require(_0x9c58('0x8d')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x8e'),require(_0x9c58('0x8f')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x90'),require('./api/analyticTreeReport'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x91'),require('./api/intSalesforceAccount'));_0x52c5ad['use'](_0x9c58('0x92'),require(_0x9c58('0x93')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x94'),require(_0x9c58('0x95')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x96'),require(_0x9c58('0x97')));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x9c58('0x98')));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x99'),require(_0x9c58('0x9a')));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/desk/configurations',require(_0x9c58('0x9b')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x9c'),require(_0x9c58('0x9d')));_0x52c5ad['use'](_0x9c58('0x9e'),require(_0x9c58('0x9f')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xa0'),require(_0x9c58('0xa1')));_0x52c5ad['use']('/api/integrations/zoho/fields',require(_0x9c58('0xa2')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xa3'),require('./api/intZendeskAccount'));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xa4'),require('./api/intZendeskField'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xa5'),require(_0x9c58('0xa6')));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xa7'),require(_0x9c58('0xa8')));_0x52c5ad['use'](_0x9c58('0xa9'),require(_0x9c58('0xaa')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xab'),require(_0x9c58('0xac')));_0x52c5ad['use']('/api/integrations/vtiger/fields',require(_0x9c58('0xad')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xae'),require('./api/intServicenowAccount'));_0x52c5ad['use'](_0x9c58('0xaf'),require(_0x9c58('0xb0')));_0x52c5ad['use'](_0x9c58('0xb1'),require(_0x9c58('0xb2')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xb3'),require(_0x9c58('0xb4')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xb5'),require(_0x9c58('0xb6')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xb7'),require(_0x9c58('0xb8')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xb9'),require(_0x9c58('0xba')));_0x52c5ad[_0x9c58('0x7')]('/api/integrations/freshsales/configurations',require(_0x9c58('0xbb')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xbc'),require(_0x9c58('0xbd')));_0x52c5ad['use'](_0x9c58('0xbe'),require(_0x9c58('0xbf')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xc0'),require(_0x9c58('0xc1')));_0x52c5ad['use'](_0x9c58('0xc2'),require(_0x9c58('0xc3')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xc4'),require(_0x9c58('0xc5')));_0x52c5ad[_0x9c58('0x7')]('/api/jscripty/questions/reports',require(_0x9c58('0xc6')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xc7'),require(_0x9c58('0xc8')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xc9'),require(_0x9c58('0xca')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xcb'),require(_0x9c58('0xcc')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xcd'),require(_0x9c58('0xce')));_0x52c5ad[_0x9c58('0x7')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xcf'),require('./api/setting'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xd0'),require(_0x9c58('0xd1')));_0x52c5ad[_0x9c58('0x7')]('/api/square/projects',require('./api/squareProject'));_0x52c5ad['use'](_0x9c58('0xd2'),require(_0x9c58('0xd3')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xd4'),require(_0x9c58('0xd5')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xd6'),require(_0x9c58('0xd7')));_0x52c5ad['use']('/api/license',require(_0x9c58('0xd8')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xd9'),require(_0x9c58('0xda')));_0x52c5ad['use']('/api/migrations',require(_0x9c58('0xdb')));_0x52c5ad['use'](_0x9c58('0xdc'),require(_0x9c58('0xdd')));_0x52c5ad[_0x9c58('0x7')]('/api/plugins',require(_0x9c58('0xde')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xdf'),require('./api/mailTransferReport'));_0x52c5ad['use'](_0x9c58('0xe0'),require(_0x9c58('0xe1')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xe2'),require('./api/faxTransferReport'));_0x52c5ad[_0x9c58('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x52c5ad['use'](_0x9c58('0xe3'),require(_0x9c58('0xe4')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xe5'),require('./api/cmList'));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xe6'),require('./api/voicePrefix'));_0x52c5ad['use'](_0x9c58('0xe7'),require(_0x9c58('0xe8')));_0x52c5ad['use'](_0x9c58('0xe9'),require('./api/userProfileSection'));_0x52c5ad['use'](_0x9c58('0xea'),require(_0x9c58('0xeb')));_0x52c5ad[_0x9c58('0x7')]('/api/userNotifications',require(_0x9c58('0xec')));_0x52c5ad['use'](_0x9c58('0xed'),require('./api/whatsappAccount'));_0x52c5ad['use']('/api/whatsapp/applications',require(_0x9c58('0xee')));_0x52c5ad['use'](_0x9c58('0xef'),require(_0x9c58('0xf0')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xf1'),require(_0x9c58('0xf2')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xf3'),require(_0x9c58('0xf4')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xf5'),require(_0x9c58('0xf6')));_0x52c5ad[_0x9c58('0x7')]('/api/whatsapp/queues',require(_0x9c58('0xf7')));_0x52c5ad['use']('/api/cloudProviders',require(_0x9c58('0xf8')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xf9'),require(_0x9c58('0xfa')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xfb'),require(_0x9c58('0xfc')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0xfd'),require('./api/authLocal'));_0x52c5ad['use'](_0x9c58('0xfe'),require(_0x9c58('0xff')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x100'),require(_0x9c58('0x101')));_0x52c5ad['use'](_0x9c58('0x102'),require('./api/jira'));_0x52c5ad[_0x9c58('0x7')]('/api/rpc',require(_0x9c58('0x103')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x104'),require(_0x9c58('0x105')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x106'),require(_0x9c58('0x107')));_0x52c5ad['use'](_0x9c58('0x108'),require(_0x9c58('0x109')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x10a'),require(_0x9c58('0x10b')));_0x52c5ad[_0x9c58('0x7')]('/api/logs',clientSideLogs);_0x52c5ad[_0x9c58('0x7')]('/apidoc',express[_0x9c58('0x10c')](path[_0x9c58('0x10d')](config['root'],_0x9c58('0x10e'))));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x10f'),express['static'](path['join'](config[_0x9c58('0x110')],'/www')));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x111'),express[_0x9c58('0x10c')](path['join'](config[_0x9c58('0x110')],_0x9c58('0x111'))));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x112'),express[_0x9c58('0x10c')](path[_0x9c58('0x10d')](config[_0x9c58('0x110')],'snippet',_0x9c58('0x113'))));_0x52c5ad[_0x9c58('0x7')](_0x9c58('0x114'),express[_0x9c58('0x10c')](path[_0x9c58('0x10d')](config[_0x9c58('0x110')],_0x9c58('0x115'))));_0x52c5ad[_0x9c58('0x116')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x9c58('0x117')](errors[0x194]);_0x52c5ad['route']('/*')[_0x9c58('0x117')](function(_0x4897a9,_0x51f5df){_0x51f5df[_0x9c58('0x118')](path[_0x9c58('0x119')](_0x52c5ad[_0x9c58('0x117')](_0x9c58('0x11a'))+_0x9c58('0x11b')));});return _0x52c5ad;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 251bfa1..1c37b7a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x465c=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../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/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','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/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0x1f44e4,_0x22d9fd){var _0x591989=function(_0x3aeb88){while(--_0x3aeb88){_0x1f44e4['push'](_0x1f44e4['shift']());}};_0x591989(++_0x22d9fd);}(_0x465c,0x1ae));var _0xc465=function(_0x4bf163,_0x5988f7){_0x4bf163=_0x4bf163-0x0;var _0x29a5dd=_0x465c[_0x4bf163];return _0x29a5dd;};'use strict';var jayson=require(_0xc465('0x0'));var _=require(_0xc465('0x1'));var config=require('../config/environment');exports[_0xc465('0x2')]=function(){return new Promise(function(_0x49e320,_0x5bc934){var _0x1a90c4={};_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x4')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x5')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x6')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x7')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x8')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x9')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xa')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xb')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xc')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xd')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xe')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailServerIn/mailServerIn.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0xf')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x10')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x11')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailMessage/mailMessage.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x12')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/faxAccount/faxAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x13')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x14')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x15')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x16')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x17')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x18')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsInteraction/smsInteraction.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsMessage/smsMessage.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/smsQueue/smsQueue.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x19')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1a90c4=_['merge'](_0x1a90c4,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1c')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x1e')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x1f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x20')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x21')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x22')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x23')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x24')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x25')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x26')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x27')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x28')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x29')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2c')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2e')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x2f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x30')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x31')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x32')));_0x1a90c4=_['merge'](_0x1a90c4,require(_0xc465('0x33')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x34')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x35')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x36')));_0x1a90c4=_['merge'](_0x1a90c4,require('../api/setting/setting.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x37')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x38')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x39')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3a')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3b')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/attachment/attachment.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3c')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3d')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3e')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x3f')));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1a90c4=_[_0xc465('0x3')](_0x1a90c4,require(_0xc465('0x40')));var _0x56ca1b=jayson[_0xc465('0x41')](_0x1a90c4)[_0xc465('0x42')]();var _0x426a91=config[_0xc465('0x43')][_0xc465('0x44')]||config[_0xc465('0x44')]+0x1;var _0x551a78=config[_0xc465('0x43')]['ip']||_0xc465('0x45');_0x56ca1b['on']('error',function(_0x264ee9){return _0x5bc934(_0x264ee9);});_0x56ca1b[_0xc465('0x2')](_0x426a91,_0x551a78,function(){console['log'](_0xc465('0x46'),_0x551a78,_0x426a91);require(_0xc465('0x47'))[_0xc465('0x48')]();return _0x49e320(_0xc465('0x49')+_0x551a78+':'+_0x426a91);});});}; \ No newline at end of file +var _0x8f05=['../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','listen','log','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.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/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x517f0e,_0x557448){var _0x513b60=function(_0x8f0a20){while(--_0x8f0a20){_0x517f0e['push'](_0x517f0e['shift']());}};_0x513b60(++_0x557448);}(_0x8f05,0x1cb));var _0x58f0=function(_0x941401,_0x1c7cb5){_0x941401=_0x941401-0x0;var _0x61a142=_0x8f05[_0x941401];return _0x61a142;};'use strict';var jayson=require(_0x58f0('0x0'));var _=require(_0x58f0('0x1'));var config=require(_0x58f0('0x2'));exports['listen']=function(){return new Promise(function(_0x4655f8,_0x48b6ca){var _0x489772={};_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/user/user.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x4')));_0x489772=_['merge'](_0x489772,require('../api/voiceQueue/voiceQueue.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x5')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x6')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x7')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x8')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x9')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xa')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xb')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xc')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/mailAccount/mailAccount.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/mailQueue/mailQueue.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xd')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xe')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0xf')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x10')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x11')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x12')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x13')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x14')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x15')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x16')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x17')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/smsInteraction/smsInteraction.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x18')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x19')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x1a')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x1b')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x1c')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x1d')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x1e')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x1f')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/chatQueue/chatQueue.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x20')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x21')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x22')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x23')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x24')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x25')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x26')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x27')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/sound/sound.rpc'));_0x489772=_['merge'](_0x489772,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x28')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x29')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x2a')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x2b')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x2c')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x2d')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x2e')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x2f')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x30')));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x31')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x32')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x33')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x34')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x35')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x36')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/squareProject/squareProject.rpc'));_0x489772=_['merge'](_0x489772,require(_0x58f0('0x37')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x38')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x39')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x3a')));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x3b')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x3c')));_0x489772=_[_0x58f0('0x3')](_0x489772,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x489772=_['merge'](_0x489772,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x489772=_[_0x58f0('0x3')](_0x489772,require(_0x58f0('0x3d')));var _0x1d1c05=jayson[_0x58f0('0x3e')](_0x489772)[_0x58f0('0x3f')]();var _0x4ec459=config['rpc']['port']||config[_0x58f0('0x40')]+0x1;var _0x4f05da=config[_0x58f0('0x41')]['ip']||_0x58f0('0x42');_0x1d1c05['on'](_0x58f0('0x43'),function(_0x319ecc){return _0x48b6ca(_0x319ecc);});_0x1d1c05[_0x58f0('0x44')](_0x4ec459,_0x4f05da,function(){console[_0x58f0('0x45')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4f05da,_0x4ec459);require('../config/triggers')['default']();return _0x4655f8(_0x58f0('0x46')+_0x4f05da+':'+_0x4ec459);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0463bc9..383e0c1 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 _0x4d68=['noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','ready','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','inherits','sendRequest','command','sync','answer','ANSWER','prototype','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x13f09a,_0x13040a){var _0x5116f8=function(_0x18dea4){while(--_0x18dea4){_0x13f09a['push'](_0x13f09a['shift']());}};_0x5116f8(++_0x13040a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4d68[_0x465028];return _0xb783d4;};'use strict';var util=require(_0x84d6('0x0'));var _=require(_0x84d6('0x1'));var EventEmitter=require(_0x84d6('0x2'))[_0x84d6('0x3')];var AGIReply=require(_0x84d6('0x4'));var AGIError=require(_0x84d6('0x5'));function AGIChannel(_0x508cb6){var _0x319f1f=this,_0x5ee114=new AGIReply(),_0x3a2f0b=![],_0x589711={};EventEmitter[_0x84d6('0x6')](_0x319f1f);_0x508cb6[_0x84d6('0x7')](_0x84d6('0x8'));_0x508cb6['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5ee114['setEncoding'](_0x84d6('0x8'));_0x5ee114['on'](_0x84d6('0x9'),function(_0x260859){for(var _0x367139 in _0x260859){_0x319f1f[_0x367139]=_0x260859[_0x367139];}_0x319f1f['emit'](_0x84d6('0xa'));});_0x5ee114['on']('line',function(_0x2fb185){if(_0x2fb185[_0x84d6('0xb')]()==_0x84d6('0xc')){_0x319f1f['emit']('hangup');return;}if(_0x2fb185[_0x84d6('0xd')](0x0,0xb)=='520-Invalid'){_0x3a2f0b=!![];}if(_0x3a2f0b){_0x589711['rx']+=_0x2fb185+'\x0a';if(_0x2fb185[_0x84d6('0xe')](_0x84d6('0xf'))!=-0x1){_0x3a2f0b=![];}}else{_0x589711['rx']=_0x2fb185;}if(_0x3a2f0b){return;}if(typeof _0x589711['cb']==_0x84d6('0x10')){var _0x19e7a9=_0x589711['rx'][_0x84d6('0xd')](0x0,0x3),_0x203c54=null,_0x506edc=null;_0x19e7a9=parseInt(_0x19e7a9);if(isNaN(_0x19e7a9)){_0x589711['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x19e7a9!=0xc8){_0x589711['cb'](null,{'code':_0x19e7a9,'result':-0x1,'extra':'KO'});return;}_0x203c54=_0x589711['rx'][_0x84d6('0xd')](0x4)[_0x84d6('0x11')](_0x84d6('0x12'),'');if(_0x203c54[_0x84d6('0x13')]('\x20')!=-0x1){_0x203c54=_0x203c54[_0x84d6('0x14')](0x0,_0x203c54[_0x84d6('0x13')]('\x20'));}if(_[_0x84d6('0x15')](_0x203c54,'-1')){_0x203c54=parseInt(_0x203c54);}_0x506edc=_0x589711['rx']['split']('\x20');if(_0x506edc[_0x84d6('0x16')]==0x3){_0x506edc=_0x506edc[0x2][_0x84d6('0xd')](0x1,_0x506edc[0x2][_0x84d6('0x16')]-0x1);}else if(_0x506edc[_0x84d6('0x16')]>0x3){var _0x385e2b=/\((.+)\)/;var _0x4b1a8b=_0x589711['rx'][_0x84d6('0x17')](_0x385e2b);if(_0x4b1a8b){_0x506edc=_0x4b1a8b[0x1];}else{_0x506edc=null;}}else{_0x506edc=null;}_0x589711['cb'](null,{'code':_0x19e7a9,'result':_0x203c54,'extra':_0x506edc});}});_0x508cb6['on'](_0x84d6('0x18'),function(_0x579aa8){_0x319f1f[_0x84d6('0x19')]('error',new AGIError(_0x84d6('0x1a'),_0x579aa8[_0x84d6('0x1b')]));});_0x508cb6['on'](_0x84d6('0x1c'),function(){_0x319f1f[_0x84d6('0x19')](_0x84d6('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x508cb6['on'](_0x84d6('0x1d'),function(){_0x319f1f[_0x84d6('0x19')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x508cb6[_0x84d6('0x1e')]();});_0x508cb6['pipe'](_0x5ee114);this['command']=function(_0x1aa38c,_0x256787){var _0x1aa38c=_0x1aa38c||'',_0x256787=typeof _0x256787==_0x84d6('0x10')?_0x256787:new Function();_0x589711={'tx':_0x1aa38c,'rx':'','cb':_0x256787};_0x508cb6['write'](_0x1aa38c+'\x0a');},this['close']=function(){_0x508cb6[_0x84d6('0x1e')]();};}util[_0x84d6('0x1f')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x84d6('0x20')]=function(_0x256e42){return this[_0x84d6('0x21')][_0x84d6('0x22')](this,_0x256e42);};AGIChannel['prototype'][_0x84d6('0x23')]=function(){return this['sendRequest'](_0x84d6('0x24'));};AGIChannel[_0x84d6('0x25')]['getData']=function(_0x500a81,_0x1fcb3b,_0x5c9532){_0x500a81=_0x500a81===undefined?'beep':_0x500a81;_0x1fcb3b=_0x1fcb3b===undefined?'5':_0x1fcb3b;_0x5c9532=_0x5c9532===undefined?'1':_0x5c9532;return this[_0x84d6('0x20')](util['format'](_0x84d6('0x26'),_0x500a81,_0x1fcb3b*0x3e8,_0x5c9532));};AGIChannel['prototype'][_0x84d6('0x27')]=function(_0x2c76e2){_0x2c76e2=_0x2c76e2||_0x84d6('0x28');return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x2a'),_0x2c76e2));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x2b')]=function(_0x3866d6,_0x1ebff2){if(_[_0x84d6('0x2c')](_0x1ebff2)){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x2d'),_0x3866d6,_0x1ebff2[_0x84d6('0x2e')](',')));}return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x2d'),_0x3866d6,_0x1ebff2));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x2f')]=function(_0x3275f9){return this['sendRequest'](util[_0x84d6('0x29')]('SET\x20CONTEXT\x20%s',_0x3275f9));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x30')]=function(_0x51f235){return this[_0x84d6('0x20')](util[_0x84d6('0x29')]('SET\x20EXTENSION\x20%s',_0x51f235));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x31')]=function(_0x4450af){return this[_0x84d6('0x20')](util[_0x84d6('0x29')]('SET\x20PRIORITY\x20%s',_0x4450af));};AGIChannel[_0x84d6('0x25')][_0x84d6('0xc')]=function(){return this[_0x84d6('0x20')]('HANGUP');};AGIChannel[_0x84d6('0x25')]['setVariable']=function(_0x373a1e,_0x525b56){var _0x4b93f9=_[_0x84d6('0x32')](_0x525b56)||_[_0x84d6('0x33')](_0x525b56)?_0x525b56[_0x84d6('0x34')]():_0x525b56;return this['sendRequest'](util[_0x84d6('0x29')](_0x84d6('0x35'),_0x373a1e,_0x4b93f9?_0x4b93f9[_0x84d6('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x1c5424,_0x448df0){return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x36'),_0x1c5424,_0x448df0));};AGIChannel[_0x84d6('0x25')]['sayDigits']=function(_0x573025,_0x30836a){return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x37'),_0x573025,_0x30836a));};AGIChannel[_0x84d6('0x25')]['sayPhonetic']=function(_0x59ea9b,_0x5a55ec){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x38'),_0x59ea9b,_0x5a55ec));};AGIChannel[_0x84d6('0x25')]['continueAt']=function(_0xba6f29,_0x29ee56,_0x513552){_0x29ee56=_0x29ee56||this[_0x84d6('0x39')];_0x513552=_0x513552||0x1;this[_0x84d6('0x2f')](_0xba6f29);this[_0x84d6('0x30')](_0x29ee56);this[_0x84d6('0x31')](_0x513552);return this[_0x84d6('0x27')](util['format'](_0x84d6('0x3a'),_0xba6f29,_0x29ee56,_0x513552));};AGIChannel['prototype'][_0x84d6('0x3b')]=function(_0x1930af){return this[_0x84d6('0x20')](util['format'](_0x84d6('0x3c'),_0x1930af));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x3d')]=function(_0x20f0b9,_0x313230,_0x108232,_0x49845c,_0x3f0029,_0x4badef){_0x313230=_0x313230||'wav';_0x108232=_0x108232||'';_0x49845c=_0x49845c===undefined?-0x1:_0x49845c==='-1'?-0x1:_0x49845c*0x3e8;_0x3f0029=_0x3f0029===undefined?'':'s='+_0x3f0029;_0x4badef=_0x4badef?'BEEP':'';return this[_0x84d6('0x20')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x20f0b9,_0x313230,_0x108232,_0x49845c,_0x4badef,_0x3f0029));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x3e')]=function(_0x4e44f2,_0x1c27cf){_0x1c27cf=_0x1c27cf||'';return this[_0x84d6('0x20')](util[_0x84d6('0x29')](_0x84d6('0x3f'),_0x4e44f2,_0x1c27cf));};AGIChannel[_0x84d6('0x25')][_0x84d6('0x40')]=function(_0x56aa1e){return this['exec'](_0x84d6('0x41'),_0x56aa1e);};AGIChannel[_0x84d6('0x25')][_0x84d6('0x42')]=function(_0x44f33d){return this[_0x84d6('0x2b')](_0x84d6('0x43'),_0x44f33d);};AGIChannel[_0x84d6('0x25')]['error']=function(_0x52e2ee,_0x1adbdc){this['noop'](util[_0x84d6('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x52e2ee['id'],_0x52e2ee[_0x84d6('0x44')],_0x1adbdc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x84d6('0x45')]=AGIChannel; \ No newline at end of file +var _0xe951=['SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','search','function','no\x20code','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority'];(function(_0x3ad71b,_0x27ca1f){var _0x373634=function(_0x433288){while(--_0x433288){_0x3ad71b['push'](_0x3ad71b['shift']());}};_0x373634(++_0x27ca1f);}(_0xe951,0x105));var _0x1e95=function(_0x57b4cc,_0x2ae50e){_0x57b4cc=_0x57b4cc-0x0;var _0x45ba9d=_0xe951[_0x57b4cc];return _0x45ba9d;};'use strict';var util=require(_0x1e95('0x0'));var _=require('lodash');var EventEmitter=require(_0x1e95('0x1'))[_0x1e95('0x2')];var AGIReply=require(_0x1e95('0x3'));var AGIError=require(_0x1e95('0x4'));function AGIChannel(_0x38b91e){var _0x4d9b7f=this,_0x19192a=new AGIReply(),_0x1be004=![],_0x214133={};EventEmitter[_0x1e95('0x5')](_0x4d9b7f);_0x38b91e[_0x1e95('0x6')](_0x1e95('0x7'));_0x38b91e[_0x1e95('0x8')](0x8*0x3c*0x3c*0x3e8);_0x19192a[_0x1e95('0x6')](_0x1e95('0x7'));_0x19192a['on']('headers',function(_0x71093){for(var _0x23a292 in _0x71093){_0x4d9b7f[_0x23a292]=_0x71093[_0x23a292];}_0x4d9b7f[_0x1e95('0x9')](_0x1e95('0xa'));});_0x19192a['on'](_0x1e95('0xb'),function(_0x3a1523){if(_0x3a1523[_0x1e95('0xc')]()==_0x1e95('0xd')){_0x4d9b7f['emit'](_0x1e95('0xd'));return;}if(_0x3a1523[_0x1e95('0xe')](0x0,0xb)=='520-Invalid'){_0x1be004=!![];}if(_0x1be004){_0x214133['rx']+=_0x3a1523+'\x0a';if(_0x3a1523[_0x1e95('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x1be004=![];}}else{_0x214133['rx']=_0x3a1523;}if(_0x1be004){return;}if(typeof _0x214133['cb']==_0x1e95('0x10')){var _0x7547f8=_0x214133['rx'][_0x1e95('0xe')](0x0,0x3),_0x30934b=null,_0x131762=null;_0x7547f8=parseInt(_0x7547f8);if(isNaN(_0x7547f8)){_0x214133['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1e95('0x11')});return;}if(_0x7547f8!=0xc8){_0x214133['cb'](null,{'code':_0x7547f8,'result':-0x1,'extra':'KO'});return;}_0x30934b=_0x214133['rx'][_0x1e95('0xe')](0x4)['replace'](_0x1e95('0x12'),'');if(_0x30934b[_0x1e95('0x13')]('\x20')!=-0x1){_0x30934b=_0x30934b[_0x1e95('0x14')](0x0,_0x30934b[_0x1e95('0x13')]('\x20'));}if(_['startsWith'](_0x30934b,'-1')){_0x30934b=parseInt(_0x30934b);}_0x131762=_0x214133['rx'][_0x1e95('0x15')]('\x20');if(_0x131762['length']==0x3){_0x131762=_0x131762[0x2][_0x1e95('0xe')](0x1,_0x131762[0x2][_0x1e95('0x16')]-0x1);}else if(_0x131762['length']>0x3){var _0x1b7d89=/\((.+)\)/;var _0x45b80e=_0x214133['rx'][_0x1e95('0x17')](_0x1b7d89);if(_0x45b80e){_0x131762=_0x45b80e[0x1];}else{_0x131762=null;}}else{_0x131762=null;}_0x214133['cb'](null,{'code':_0x7547f8,'result':_0x30934b,'extra':_0x131762});}});_0x38b91e['on'](_0x1e95('0x18'),function(_0xc6179a){_0x4d9b7f[_0x1e95('0x9')](_0x1e95('0x18'),new AGIError(_0x1e95('0x19'),_0xc6179a['code']));});_0x38b91e['on'](_0x1e95('0x1a'),function(){_0x4d9b7f['emit']('close',new AGIError(_0x1e95('0x1b')));});_0x38b91e['on'](_0x1e95('0x1c'),function(){_0x4d9b7f[_0x1e95('0x9')](_0x1e95('0x1c'),new AGIError(_0x1e95('0x1d')));_0x38b91e[_0x1e95('0x1e')]();});_0x38b91e[_0x1e95('0x1f')](_0x19192a);this[_0x1e95('0x20')]=function(_0x304215,_0x46b2fe){var _0x304215=_0x304215||'',_0x46b2fe=typeof _0x46b2fe==_0x1e95('0x10')?_0x46b2fe:new Function();_0x214133={'tx':_0x304215,'rx':'','cb':_0x46b2fe};_0x38b91e[_0x1e95('0x21')](_0x304215+'\x0a');},this[_0x1e95('0x1a')]=function(){_0x38b91e[_0x1e95('0x1e')]();};}util[_0x1e95('0x22')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x1e95('0x23')]=function(_0x3570f5){return this[_0x1e95('0x20')][_0x1e95('0x24')](this,_0x3570f5);};AGIChannel[_0x1e95('0x25')][_0x1e95('0x26')]=function(){return this[_0x1e95('0x23')](_0x1e95('0x27'));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x28')]=function(_0x2584b7,_0x2b17b0,_0x126adb){_0x2584b7=_0x2584b7===undefined?_0x1e95('0x29'):_0x2584b7;_0x2b17b0=_0x2b17b0===undefined?'5':_0x2b17b0;_0x126adb=_0x126adb===undefined?'1':_0x126adb;return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x2b'),_0x2584b7,_0x2b17b0*0x3e8,_0x126adb));};AGIChannel['prototype'][_0x1e95('0x2c')]=function(_0x4da211){_0x4da211=_0x4da211||'NO\x20MESSAGE';return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x2d'),_0x4da211));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x2e')]=function(_0x3d8d48,_0x2cc9d4){if(_[_0x1e95('0x2f')](_0x2cc9d4)){return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x30'),_0x3d8d48,_0x2cc9d4[_0x1e95('0x31')](',')));}return this[_0x1e95('0x23')](util[_0x1e95('0x2a')]('EXEC\x20%s\x20%s',_0x3d8d48,_0x2cc9d4));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x32')]=function(_0x37a341){return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x33'),_0x37a341));};AGIChannel['prototype'][_0x1e95('0x34')]=function(_0x2b7ef0){return this['sendRequest'](util['format'](_0x1e95('0x35'),_0x2b7ef0));};AGIChannel['prototype'][_0x1e95('0x36')]=function(_0x50140f){return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x37'),_0x50140f));};AGIChannel[_0x1e95('0x25')][_0x1e95('0xd')]=function(){return this['sendRequest'](_0x1e95('0x38'));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x39')]=function(_0x441813,_0x8c3464){var _0x42cef2=_['isBoolean'](_0x8c3464)||_[_0x1e95('0x3a')](_0x8c3464)?_0x8c3464[_0x1e95('0x3b')]():_0x8c3464;return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x3c'),_0x441813,_0x42cef2?_0x42cef2[_0x1e95('0x3b')]()[_0x1e95('0x3d')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x3e')]=function(_0x3d38db,_0x238983){return this['sendRequest'](util[_0x1e95('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x3d38db,_0x238983));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x3f')]=function(_0x581807,_0x1c4eea){return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x40'),_0x581807,_0x1c4eea));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x41')]=function(_0x32f72d,_0x542d2c){return this[_0x1e95('0x23')](util['format'](_0x1e95('0x42'),_0x32f72d,_0x542d2c));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x43')]=function(_0x1dce2e,_0x16e460,_0x573445){_0x16e460=_0x16e460||this[_0x1e95('0x44')];_0x573445=_0x573445||0x1;this['setContext'](_0x1dce2e);this['setExtension'](_0x16e460);this['setPriority'](_0x573445);return this['noop'](util[_0x1e95('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x1dce2e,_0x16e460,_0x573445));};AGIChannel[_0x1e95('0x25')]['getVariable']=function(_0x4672c2){return this[_0x1e95('0x23')](util[_0x1e95('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4672c2));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x45')]=function(_0x393196,_0x171dfd,_0x61daa9,_0x13c694,_0x1b9b5c,_0x52a20a){_0x171dfd=_0x171dfd||_0x1e95('0x46');_0x61daa9=_0x61daa9||'';_0x13c694=_0x13c694===undefined?-0x1:_0x13c694==='-1'?-0x1:_0x13c694*0x3e8;_0x1b9b5c=_0x1b9b5c===undefined?'':'s='+_0x1b9b5c;_0x52a20a=_0x52a20a?'BEEP':'';return this[_0x1e95('0x23')](util[_0x1e95('0x2a')](_0x1e95('0x47'),_0x393196,_0x171dfd,_0x61daa9,_0x13c694,_0x52a20a,_0x1b9b5c));};AGIChannel[_0x1e95('0x25')][_0x1e95('0x48')]=function(_0x317abf,_0x3bfc79){_0x3bfc79=_0x3bfc79||'';return this[_0x1e95('0x23')](util[_0x1e95('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x317abf,_0x3bfc79));};AGIChannel['prototype'][_0x1e95('0x49')]=function(_0x408aaf){return this[_0x1e95('0x2e')](_0x1e95('0x4a'),_0x408aaf);};AGIChannel['prototype'][_0x1e95('0x4b')]=function(_0x465002){return this[_0x1e95('0x2e')]('WAIT',_0x465002);};AGIChannel['prototype'][_0x1e95('0x18')]=function(_0x1ea8c0,_0x54b2d1){this['noop'](util['format'](_0x1e95('0x4c'),_0x1ea8c0['id'],_0x1ea8c0[_0x1e95('0x4d')],_0x54b2d1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1e95('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 23a91f5..fe33b2c 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 _0x007c=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x50b027,_0x454c57){var _0xd732e6=function(_0x25bd32){while(--_0x25bd32){_0x50b027['push'](_0x50b027['shift']());}};_0xd732e6(++_0x454c57);}(_0x007c,0x1da));var _0xc007=function(_0x3b7457,_0x7d66d4){_0x3b7457=_0x3b7457-0x0;var _0x53d633=_0x007c[_0x3b7457];return _0x53d633;};'use strict';var util=require(_0xc007('0x0'));var error={'E_AGI_UNDEFINED':_0xc007('0x1'),'E_AGI_ARGUMENT_PORT':_0xc007('0x2'),'E_AGI_SERVER_ERROR':_0xc007('0x3'),'E_AGI_SERVER_CLOSE':_0xc007('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xc007('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xc007('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xc007('0x7'),'E_AGI_COMMAND_EMPTY':_0xc007('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc007('0x9'),'E_AGI_IVR_ENTRY':_0xc007('0xa')};function AGIError(_0x2cd944){var _0x2cd944=_0x2cd944||null,_0x1879a9=_0x1879a9||[],_0x2c99fd=0x1,_0x48a286='';if(!error[_0x2cd944]){_0x2cd944='E_AGI_UNDEFINED';}_0x1879a9[_0xc007('0xb')](error[_0x2cd944]);while(arguments[_0x2c99fd]){_0x1879a9['push'](arguments[_0x2c99fd]);_0x2c99fd++;}_0x48a286=util[_0xc007('0xc')][_0xc007('0xd')](util,_0x1879a9);this['message']=_0x48a286;this[_0xc007('0xe')]=_0x2cd944;}module['exports']=AGIError; \ No newline at end of file +var _0x2e90=['Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0xc38cd8,_0x3bf4d8){var _0x3dfc71=function(_0x31e8b5){while(--_0x31e8b5){_0xc38cd8['push'](_0xc38cd8['shift']());}};_0x3dfc71(++_0x3bf4d8);}(_0x2e90,0xbd));var _0x02e9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2e90[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x02e9('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x02e9('0x1'),'E_AGI_SERVER_ERROR':_0x02e9('0x2'),'E_AGI_SERVER_CLOSE':_0x02e9('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x02e9('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x02e9('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x02e9('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x57369){var _0x57369=_0x57369||null,_0x2656ad=_0x2656ad||[],_0x434517=0x1,_0x159ad4='';if(!error[_0x57369]){_0x57369='E_AGI_UNDEFINED';}_0x2656ad[_0x02e9('0x7')](error[_0x57369]);while(arguments[_0x434517]){_0x2656ad[_0x02e9('0x7')](arguments[_0x434517]);_0x434517++;}_0x159ad4=util[_0x02e9('0x8')][_0x02e9('0x9')](util,_0x2656ad);this[_0x02e9('0xa')]=_0x159ad4;this[_0x02e9('0xb')]=_0x57369;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index d096eb5..14b6a5f 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 _0x6bc4=['parse','projectUpdate','error','E_AGI_SERVER_ERROR','ioredis','./error','../../config/environment','defaults','redis','subscribe','agi','emit'];(function(_0x5b1970,_0x3a594f){var _0x5ce24a=function(_0x2203e1){while(--_0x2203e1){_0x5b1970['push'](_0x5b1970['shift']());}};_0x5ce24a(++_0x3a594f);}(_0x6bc4,0x130));var _0x46bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc4[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x46bc('0x0'));var AGIError=require(_0x46bc('0x1'));var config=require(_0x46bc('0x2'));config['redis']=_[_0x46bc('0x3')](config[_0x46bc('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x46bc('0x4')]);sub[_0x46bc('0x5')](_0x46bc('0x6'),function(_0x4d434f){if(_0x4d434f)return eventEmitter[_0x46bc('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x4d434f));});sub['on']('message',function(_0x43d8eb,_0x3eaeed){if(_0x43d8eb!==_0x46bc('0x6'))return;try{var _0x4d0d0f=JSON[_0x46bc('0x8')](_0x3eaeed);eventEmitter[_0x46bc('0x7')](_0x46bc('0x9'),_0x4d0d0f);}catch(_0x253aa9){eventEmitter[_0x46bc('0x7')](_0x46bc('0xa'),new AGIError(_0x46bc('0xb'),_0x253aa9));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x71ee=['subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x9de445,_0x143498){var _0x22087a=function(_0x48f0bf){while(--_0x48f0bf){_0x9de445['push'](_0x9de445['shift']());}};_0x22087a(++_0x143498);}(_0x71ee,0x18e));var _0xe71e=function(_0x10b6ae,_0x56a559){_0x10b6ae=_0x10b6ae-0x0;var _0x1321e9=_0x71ee[_0x10b6ae];return _0x1321e9;};'use strict';var _=require(_0xe71e('0x0'));var EventEmitter=require(_0xe71e('0x1'))[_0xe71e('0x2')];var Redis=require(_0xe71e('0x3'));var AGIError=require(_0xe71e('0x4'));var config=require(_0xe71e('0x5'));config[_0xe71e('0x6')]=_['defaults'](config[_0xe71e('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xe71e('0x6')]);sub[_0xe71e('0x7')](_0xe71e('0x8'),function(_0x121c25){if(_0x121c25)return eventEmitter[_0xe71e('0x9')](_0xe71e('0xa'),new AGIError(_0xe71e('0xb'),_0x121c25));});sub['on'](_0xe71e('0xc'),function(_0x2d7a5a,_0x42018c){if(_0x2d7a5a!=='agi')return;try{var _0x258fbc=JSON['parse'](_0x42018c);eventEmitter['emit'](_0xe71e('0xd'),_0x258fbc);}catch(_0x2e3875){eventEmitter['emit']('error',new AGIError(_0xe71e('0xb'),_0x2e3875));}});module[_0xe71e('0xe')]={'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 0773e3b..3fd4488 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 _0xcb82=['lodash','../../../config/logger','agi','menu','getdigits','edges','prototype','addVertex','vertices','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports'];(function(_0x1defb2,_0x429099){var _0xad8973=function(_0xe26c42){while(--_0xe26c42){_0x1defb2['push'](_0x1defb2['shift']());}};_0xad8973(++_0x429099);}(_0xcb82,0x155));var _0x2cb8=function(_0x12fec1,_0x20be9c){_0x12fec1=_0x12fec1-0x0;var _0x26c3af=_0xcb82[_0x12fec1];return _0x26c3af;};'use strict';var _=require(_0x2cb8('0x0'));var logger=require(_0x2cb8('0x1'))(_0x2cb8('0x2'));var verticesWithRetry=[_0x2cb8('0x3'),_0x2cb8('0x4'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x2cb8('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x2cb8('0x6')][_0x2cb8('0x7')]=function(_0x38dd1c){this[_0x2cb8('0x8')][_0x38dd1c['id']]=_0x38dd1c;this[_0x2cb8('0x5')][_0x38dd1c['id']]=[];};Graph[_0x2cb8('0x6')][_0x2cb8('0x9')]=function(_0x3d98b9,_0x53ed51,_0x2fd4d2){this['edges'][_0x3d98b9][_0x2cb8('0xa')]({'target':_0x53ed51,'condition':_0x2fd4d2});this[_0x2cb8('0xb')]+=0x1;};Graph['prototype'][_0x2cb8('0xc')]=function(){return _['size'](this[_0x2cb8('0x8')]);};Graph[_0x2cb8('0x6')][_0x2cb8('0xd')]=function(){return this[_0x2cb8('0xb')];};Graph[_0x2cb8('0x6')][_0x2cb8('0xe')]=function(_0x2793b6){return this[_0x2cb8('0x8')][_0x2793b6];};Graph[_0x2cb8('0x6')][_0x2cb8('0xf')]=function(_0x13bff2,_0x29d231){if(!this[_0x2cb8('0x8')][_0x13bff2]){return logger['info'](_0x2cb8('0x10'));}var _0x104e3b=_0x29d231(this[_0x2cb8('0x8')][_0x13bff2]);if(!_0x104e3b){return logger[_0x2cb8('0x11')]('stop\x20traverse');}if(this[_0x2cb8('0x5')][_0x13bff2][_0x2cb8('0x12')]===0x0){return logger[_0x2cb8('0x11')](_0x2cb8('0x13'));}for(var _0x37e931=0x0,_0x4afad0=[],_0x33efdf=![];_0x37e931\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','listening','connection','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','splice','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty'];(function(_0x1f3413,_0x15be2d){var _0x33ee8d=function(_0x33e11f){while(--_0x33e11f){_0x1f3413['push'](_0x1f3413['shift']());}};_0x33ee8d(++_0x15be2d);}(_0xde35,0xd0));var _0x5de3=function(_0x4fbd9,_0x3a2421){_0x4fbd9=_0x4fbd9-0x0;var _0x26d1de=_0xde35[_0x4fbd9];return _0x26d1de;};'use strict';var _=require('lodash');var syncho=require(_0x5de3('0x0'));var util=require(_0x5de3('0x1'));var config=require('../../config/environment');var logger=require(_0x5de3('0x2'))(_0x5de3('0x3'));var utilLicense=require(_0x5de3('0x4'));var rpc=require(_0x5de3('0x5'));var Project=require(_0x5de3('0x6'));var AGIEmitter=require(_0x5de3('0x7'))[_0x5de3('0x8')];var projects=[];config['agi']=_[_0x5de3('0x9')](config[_0x5de3('0x3')],{'ip':_0x5de3('0xa'),'port':0x11dd});AGIEmitter['on'](_0x5de3('0xb'),projectUpdateHandler);function connectionHandler(_0x454baf){process[_0x5de3('0xc')](function(){syncho(function(){try{setChannelVariables(_0x454baf);agiHandler(_0x454baf);}catch(_0x1ff0c2){logger['error'](_0x1ff0c2[_0x5de3('0xd')]);}});});}function projectUpdateHandler(_0x20b0d3){try{var _0x1ca622=_[_0x5de3('0xe')](projects,['id',_0x20b0d3['id']]);if(_0x1ca622>-0x1){if(_0x20b0d3[_0x5de3('0xf')]===!![]){projects[_0x5de3('0x10')](_0x1ca622,0x1);}else{projects[_0x1ca622]=_0x20b0d3;}}else{projects['push'](_0x20b0d3);}}catch(_0x808a13){logger[_0x5de3('0x11')](_0x808a13[_0x5de3('0xd')]);}}function listeningHandler(){console[_0x5de3('0x12')](_0x5de3('0x13'),config['agi'][_0x5de3('0x14')]);logger[_0x5de3('0x15')](util[_0x5de3('0x16')](_0x5de3('0x17'),config[_0x5de3('0x3')]['ip'],config[_0x5de3('0x3')][_0x5de3('0x14')]));}function errorHandler(_0x1a85f8){if(_0x1a85f8&&_0x1a85f8[_0x5de3('0x18')]&&_0x1a85f8['message']){logger['error'](util[_0x5de3('0x16')](_0x5de3('0x19'),_0x1a85f8[_0x5de3('0x18')],_0x1a85f8[_0x5de3('0x1a')]));}else{logger[_0x5de3('0x11')](util['format'](_0x5de3('0x1b'),_0x1a85f8['stack']));}}function closeHandler(){logger['info'](util[_0x5de3('0x16')](_0x5de3('0x1c'),this[_0x5de3('0x1d')],this[_0x5de3('0x1e')],this[_0x5de3('0x1f')],this[_0x5de3('0x20')],this[_0x5de3('0x21')]));try{createSquareReport(this);}catch(_0x147de1){logger['error'](_0x147de1[_0x5de3('0xd')]);}}function timeoutHandler(){logger[_0x5de3('0x15')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x5de3('0x1f')],this['dnid'],this[_0x5de3('0x21')]));}function hangupHandler(){logger[_0x5de3('0x15')](util[_0x5de3('0x16')](_0x5de3('0x22'),this[_0x5de3('0x1d')],this[_0x5de3('0x1e')],this[_0x5de3('0x1f')],this[_0x5de3('0x20')],this[_0x5de3('0x21')]));this[_0x5de3('0x23')]=!![];}function createSquareReport(_0x468283,_0x2a499b){rpc[_0x5de3('0x24')](_0x468283)[_0x5de3('0x25')](function(_0x453e57){if(_0x2a499b){_0x2a499b(null,_0x453e57);}})[_0x5de3('0x26')](function(_0x3044f8){if(_0x2a499b){_0x2a499b(null,_0x3044f8);}});}function setChannelVariables(_0x133a85){for(var _0x6906b6 in _0x133a85){if(_0x133a85[_0x5de3('0x27')](_0x6906b6)){if(_0x6906b6['indexOf'](_0x5de3('0x28'))===0x0){_0x133a85[_0x6906b6[_0x5de3('0x29')](0x4)]=_0x133a85[_0x6906b6];delete _0x133a85[_0x6906b6];}}}}function agiHandler(_0x411459){logger[_0x5de3('0x2a')](_0x5de3('0x2b'),JSON[_0x5de3('0x2c')](_0x411459,null,0x2));logger[_0x5de3('0x15')](util['format'](_0x5de3('0x2d'),_0x411459[_0x5de3('0x1d')],_0x411459[_0x5de3('0x1e')],_0x411459[_0x5de3('0x1f')],_0x411459[_0x5de3('0x20')],_0x411459['uniqueid']));_0x411459['on'](_0x5de3('0x11'),errorHandler);_0x411459['on'](_0x5de3('0x2e'),closeHandler);_0x411459['on'](_0x5de3('0x2f'),timeoutHandler);_0x411459[_0x5de3('0x23')]=![];_0x411459['on'](_0x5de3('0x30'),hangupHandler);var _0x4bc0f3=_['find'](projects,[_0x5de3('0x18'),_0x411459[_0x5de3('0x1d')]]);if(!_0x4bc0f3)return Project[_0x5de3('0x31')](_0x411459);if(!_0x4bc0f3[_0x5de3('0x32')])return Project[_0x5de3('0x33')](_0x411459);return Project[_0x5de3('0x34')](_0x4bc0f3,_0x411459);}function main(){var _0x2c0b43;return utilLicense[_0x5de3('0x35')]()[_0x5de3('0x25')](function(_0x47360e){if(!_0x47360e)return;if(_0x47360e['voice']){if(_0x47360e[_0x5de3('0x36')]&&_0x47360e['callysquare']>0x0){logger['info'](util[_0x5de3('0x16')](_0x5de3('0x37'),_0x47360e[_0x5de3('0x36')]));_0x2c0b43=_0x47360e[_0x5de3('0x36')];}else{logger[_0x5de3('0x15')](_0x5de3('0x38'));}}else{logger[_0x5de3('0x15')](_0x5de3('0x39'));_0x2c0b43=-0x1;}})[_0x5de3('0x25')](function(){return Project[_0x5de3('0x3a')]();})[_0x5de3('0x25')](function(_0x3bd548){projects=_0x3bd548;return;})[_0x5de3('0x26')](function(_0x21ca8a){logger[_0x5de3('0x11')](_0x5de3('0x3b'),_0x21ca8a['stack']);})['finally'](function(){var _0x7eefc5=require('./server')(config[_0x5de3('0x3')][_0x5de3('0x14')],config['agi']['ip'],_0x2c0b43);_0x7eefc5['on'](_0x5de3('0x11'),errorHandler);_0x7eefc5['on'](_0x5de3('0x3c'),listeningHandler);_0x7eefc5['on'](_0x5de3('0x3d'),connectionHandler);_0x7eefc5['on'](_0x5de3('0x2e'),closeHandler);});}main(); \ No newline at end of file +var _0xaebc=['projectUpdate','nextTick','error','stack','findIndex','splice','push','log','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[%s]\x20%s','[ERROR]\x20%s','info','arg_1','calleridname','dnid','uniqueid','callerid','evtHangup','createSquareReport','then','catch','hasOwnProperty','substring','debug','variables','stringify','close','timeout','hangup','find','handleNotFound','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0xaebc,0x9d));var _0xcaeb=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xaebc[_0x5c8827];return _0x50ffd5;};'use strict';var _=require('lodash');var syncho=require(_0xcaeb('0x0'));var util=require(_0xcaeb('0x1'));var config=require(_0xcaeb('0x2'));var logger=require(_0xcaeb('0x3'))(_0xcaeb('0x4'));var utilLicense=require(_0xcaeb('0x5'));var rpc=require(_0xcaeb('0x6'));var Project=require(_0xcaeb('0x7'));var AGIEmitter=require(_0xcaeb('0x8'))['EventEmitter'];var projects=[];config[_0xcaeb('0x4')]=_[_0xcaeb('0x9')](config['agi'],{'ip':_0xcaeb('0xa'),'port':0x11dd});AGIEmitter['on'](_0xcaeb('0xb'),projectUpdateHandler);function connectionHandler(_0x551d1c){process[_0xcaeb('0xc')](function(){syncho(function(){try{setChannelVariables(_0x551d1c);agiHandler(_0x551d1c);}catch(_0x16856b){logger[_0xcaeb('0xd')](_0x16856b[_0xcaeb('0xe')]);}});});}function projectUpdateHandler(_0x2bd1b7){try{var _0xfb2d94=_[_0xcaeb('0xf')](projects,['id',_0x2bd1b7['id']]);if(_0xfb2d94>-0x1){if(_0x2bd1b7['deleted']===!![]){projects[_0xcaeb('0x10')](_0xfb2d94,0x1);}else{projects[_0xfb2d94]=_0x2bd1b7;}}else{projects[_0xcaeb('0x11')](_0x2bd1b7);}}catch(_0x3830a9){logger['error'](_0x3830a9[_0xcaeb('0xe')]);}}function listeningHandler(){console[_0xcaeb('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcaeb('0x4')]['port']);logger['info'](util['format'](_0xcaeb('0x13'),config[_0xcaeb('0x4')]['ip'],config['agi'][_0xcaeb('0x14')]));}function errorHandler(_0x3f29cb){if(_0x3f29cb&&_0x3f29cb[_0xcaeb('0x15')]&&_0x3f29cb[_0xcaeb('0x16')]){logger['error'](util[_0xcaeb('0x17')](_0xcaeb('0x18'),_0x3f29cb['name'],_0x3f29cb[_0xcaeb('0x16')]));}else{logger[_0xcaeb('0xd')](util['format'](_0xcaeb('0x19'),_0x3f29cb[_0xcaeb('0xe')]));}}function closeHandler(){logger[_0xcaeb('0x1a')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xcaeb('0x1b')],this[_0xcaeb('0x1c')],this['callerid'],this[_0xcaeb('0x1d')],this[_0xcaeb('0x1e')]));try{createSquareReport(this);}catch(_0x4fb8ed){logger[_0xcaeb('0xd')](_0x4fb8ed[_0xcaeb('0xe')]);}}function timeoutHandler(){logger['info'](util[_0xcaeb('0x17')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xcaeb('0x1b')],this[_0xcaeb('0x1c')],this[_0xcaeb('0x1f')],this[_0xcaeb('0x1d')],this[_0xcaeb('0x1e')]));}function hangupHandler(){logger['info'](util[_0xcaeb('0x17')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xcaeb('0x1b')],this[_0xcaeb('0x1c')],this[_0xcaeb('0x1f')],this[_0xcaeb('0x1d')],this[_0xcaeb('0x1e')]));this[_0xcaeb('0x20')]=!![];}function createSquareReport(_0x487feb,_0x2e6155){rpc[_0xcaeb('0x21')](_0x487feb)[_0xcaeb('0x22')](function(_0x44ff20){if(_0x2e6155){_0x2e6155(null,_0x44ff20);}})[_0xcaeb('0x23')](function(_0x236d28){if(_0x2e6155){_0x2e6155(null,_0x236d28);}});}function setChannelVariables(_0x5d6faa){for(var _0x4aa0b6 in _0x5d6faa){if(_0x5d6faa[_0xcaeb('0x24')](_0x4aa0b6)){if(_0x4aa0b6['indexOf']('agi_')===0x0){_0x5d6faa[_0x4aa0b6[_0xcaeb('0x25')](0x4)]=_0x5d6faa[_0x4aa0b6];delete _0x5d6faa[_0x4aa0b6];}}}}function agiHandler(_0x506097){logger[_0xcaeb('0x26')](_0xcaeb('0x27'),JSON[_0xcaeb('0x28')](_0x506097,null,0x2));logger[_0xcaeb('0x1a')](util[_0xcaeb('0x17')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x506097[_0xcaeb('0x1b')],_0x506097[_0xcaeb('0x1c')],_0x506097[_0xcaeb('0x1f')],_0x506097[_0xcaeb('0x1d')],_0x506097[_0xcaeb('0x1e')]));_0x506097['on'](_0xcaeb('0xd'),errorHandler);_0x506097['on'](_0xcaeb('0x29'),closeHandler);_0x506097['on'](_0xcaeb('0x2a'),timeoutHandler);_0x506097[_0xcaeb('0x20')]=![];_0x506097['on'](_0xcaeb('0x2b'),hangupHandler);var _0x3eb875=_[_0xcaeb('0x2c')](projects,[_0xcaeb('0x15'),_0x506097[_0xcaeb('0x1b')]]);if(!_0x3eb875)return Project[_0xcaeb('0x2d')](_0x506097);if(!_0x3eb875['production'])return Project['handleUnpublished'](_0x506097);return Project['initialize'](_0x3eb875,_0x506097);}function main(){var _0x265df4;return utilLicense['getLicense']()[_0xcaeb('0x22')](function(_0x4c061d){if(!_0x4c061d)return;if(_0x4c061d[_0xcaeb('0x2e')]){if(_0x4c061d[_0xcaeb('0x2f')]&&_0x4c061d[_0xcaeb('0x2f')]>0x0){logger[_0xcaeb('0x1a')](util[_0xcaeb('0x17')](_0xcaeb('0x30'),_0x4c061d[_0xcaeb('0x2f')]));_0x265df4=_0x4c061d[_0xcaeb('0x2f')];}else{logger[_0xcaeb('0x1a')](_0xcaeb('0x31'));}}else{logger[_0xcaeb('0x1a')](_0xcaeb('0x32'));_0x265df4=-0x1;}})[_0xcaeb('0x22')](function(){return Project[_0xcaeb('0x33')]();})[_0xcaeb('0x22')](function(_0x41b0a2){projects=_0x41b0a2;return;})[_0xcaeb('0x23')](function(_0xeee116){logger[_0xcaeb('0xd')](_0xcaeb('0x34'),_0xeee116['stack']);})[_0xcaeb('0x35')](function(){var _0x54e39e=require(_0xcaeb('0x36'))(config[_0xcaeb('0x4')]['port'],config[_0xcaeb('0x4')]['ip'],_0x265df4);_0x54e39e['on'](_0xcaeb('0xd'),errorHandler);_0x54e39e['on'](_0xcaeb('0x37'),listeningHandler);_0x54e39e['on']('connection',connectionHandler);_0x54e39e['on'](_0xcaeb('0x29'),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 157958e..4973706 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 _0xcbca=['bluebird','jayson/promise','client','request','error','message','result','sendMailMessage'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xcbca,0x1b0));var _0xacbc=function(_0x131f26,_0x24b0e7){_0x131f26=_0x131f26-0x0;var _0x9b4584=_0xcbca[_0x131f26];return _0x9b4584;};'use strict';var BPromise=require(_0xacbc('0x0'));var jayson=require(_0xacbc('0x1'));var client=jayson[_0xacbc('0x2')]['http']({'port':0x232b});function request(_0x4b1745,_0x426be8){return new BPromise(function(_0x39b30b,_0x510319){return client[_0xacbc('0x3')](_0x4b1745,_0x426be8)['then'](function(_0x2e7c8b){if(_0x2e7c8b[_0xacbc('0x4')]){return _0x510319(_0x2e7c8b[_0xacbc('0x4')][_0xacbc('0x5')]);}else{return _0x39b30b(_0x2e7c8b[_0xacbc('0x6')]);}})['catch'](function(_0x2eec62){return _0x510319(_0x2eec62);});});}exports[_0xacbc('0x7')]=function(_0x2acb70,_0x2694da){return request('SendMail',{'account':_0x2acb70,'message':_0x2694da});}; \ No newline at end of file +var _0x2a1d=['then','error','message','sendMailMessage','SendMail','http','request'];(function(_0x2c50cd,_0x442a0e){var _0x4936dc=function(_0x5b02f6){while(--_0x5b02f6){_0x2c50cd['push'](_0x2c50cd['shift']());}};_0x4936dc(++_0x442a0e);}(_0x2a1d,0xc9));var _0xd2a1=function(_0xb8c3f8,_0x177ed9){_0xb8c3f8=_0xb8c3f8-0x0;var _0x169d31=_0x2a1d[_0xb8c3f8];return _0x169d31;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client'][_0xd2a1('0x0')]({'port':0x232b});function request(_0x17079e,_0x5c4270){return new BPromise(function(_0x382a7e,_0x2ae8a1){return client[_0xd2a1('0x1')](_0x17079e,_0x5c4270)[_0xd2a1('0x2')](function(_0x5f5cea){if(_0x5f5cea[_0xd2a1('0x3')]){return _0x2ae8a1(_0x5f5cea[_0xd2a1('0x3')][_0xd2a1('0x4')]);}else{return _0x382a7e(_0x5f5cea['result']);}})['catch'](function(_0x2331d9){return _0x2ae8a1(_0x2331d9);});});}exports[_0xd2a1('0x5')]=function(_0x192a07,_0x13ad5f){return request(_0xd2a1('0x6'),{'account':_0x192a07,'message':_0x13ad5f});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 9567d06..7e3d057 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 _0x4971=['arg_1','calleridname','dnid','uniqueid','traverseBFS','vertex','agicommand','gotoc','context','extension','priority','response','code','evtHangup','isUndefined','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','clear','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4971,0x93));var _0x1497=function(_0x3c17c7,_0x251da){_0x3c17c7=_0x3c17c7-0x0;var _0x1b9bf8=_0x4971[_0x3c17c7];return _0x1b9bf8;};'use strict';var _=require(_0x1497('0x0'));var moment=require(_0x1497('0x1'));var parser=require('xml2json');var util=require(_0x1497('0x2'));var logger=require(_0x1497('0x3'))(_0x1497('0x4'));var rpc=require(_0x1497('0x5'));var mailRpc=require(_0x1497('0x6'));var Graph=require(_0x1497('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x3268a7){logger[_0x1497('0x8')](_0x1497('0x9'),_0x3268a7[_0x1497('0xa')]);return[];});}function addVertex(_0x273f10,_0x1558b7,_0x19e80b){_0x1558b7['agicommand']=_0x19e80b;if(_0x1558b7['hasOwnProperty'](_0x1497('0xb'))){_0x1558b7[_0x1497('0xc')]=parseInt(_0x1558b7[_0x1497('0xb')],0xa);}_0x273f10['addVertex'](_[_0x1497('0xd')](_0x1558b7,_0x1497('0xe')));}function initGraph(_0xe469ec,_0x47dbe0){var _0x2ea096=new Graph();for(var _0x5bfd95 in _0xe469ec){if(_0xe469ec[_0x1497('0xf')](_0x5bfd95)){if(_[_0x1497('0x10')](_0xe469ec[_0x5bfd95])){for(var _0x386085=0x0;_0x386085<_0xe469ec[_0x5bfd95][_0x1497('0x11')];_0x386085+=0x1){addVertex(_0x2ea096,_0xe469ec[_0x5bfd95][_0x386085],_0x5bfd95);}}else{addVertex(_0x2ea096,_0xe469ec[_0x5bfd95],_0x5bfd95);}}}for(var _0x564fea=0x0;_0x564fea<_0x47dbe0[_0x1497('0x11')];_0x564fea+=0x1){if(_0x47dbe0[_0x564fea][_0x1497('0x12')]&&_0x47dbe0[_0x564fea]['target']){_0x2ea096[_0x1497('0x13')](_0x47dbe0[_0x564fea]['source'],_0x47dbe0[_0x564fea][_0x1497('0x14')],_0x47dbe0[_0x564fea]['value']);}}return _0x2ea096;}function getRoot(_0x47b648){return parser['toJson'](_0x47b648,{'object':!![]})[_0x1497('0x15')][_0x1497('0x16')];}function inspect(_0x58757c){return util[_0x1497('0x17')](_0x58757c,{'showHidden':![],'depth':null});}function initialize(_0x3705fb,_0x3f59b2){var _0x2b12b6=getRoot(_0x3705fb[_0x1497('0x18')]);if(!_0x2b12b6||!_0x2b12b6[_0x1497('0x19')])return;var _0x3ec325,_0x42458c,_0x1f3a1e;logger[_0x1497('0x1a')](_0x1497('0x16'),JSON[_0x1497('0x1b')](_0x2b12b6,null,0x2));_0x3f59b2[_0x1497('0x1c')]=moment()['format'](_0x1497('0x1d'));_0x3ec325=initGraph(_[_0x1497('0xd')](_0x2b12b6,'mxCell'),_0x2b12b6[_0x1497('0xe')]);_0x42458c=new Vertices(_0x3f59b2,rpc,mailRpc);logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x20'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2['callerid'],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));_0x3ec325[_0x1497('0x25')](_0x2b12b6['start']['id'],function(_0x4aeb40){try{_0x4aeb40=_0x42458c['clear'](_0x4aeb40);logger[_0x1497('0x1a')](_0x1497('0x26'),JSON[_0x1497('0x1b')](_0x4aeb40,null,0x2));if(_0x4aeb40[_0x1497('0x27')]===_0x1497('0x28')){logger[_0x1497('0x1e')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3f59b2[_0x1497('0x29')]=_0x4aeb40[_0x1497('0x29')]||_0x3f59b2[_0x1497('0x29')];_0x3f59b2['extension']=_0x4aeb40[_0x1497('0x2a')];_0x3f59b2[_0x1497('0x2b')]=_0x4aeb40[_0x1497('0x2b')]?_0x4aeb40['priority']-0x1:0x1;return null;}else if(_0x4aeb40&&_0x42458c[_0x4aeb40[_0x1497('0x27')]]){_0x1f3a1e=_0x42458c[_0x4aeb40[_0x1497('0x27')]](_0x4aeb40);logger['info'](_0x1497('0x2c'),JSON[_0x1497('0x1b')](_0x1f3a1e,null,0x2));if(_0x1f3a1e&&_0x1f3a1e[_0x1497('0x2d')]===AGI_CODE_SUCCESS&&_0x1f3a1e['result']!==AGI_RESULT_ERROR&&!_0x3f59b2[_0x1497('0x2e')]){logger['debug'](_0x1497('0x2c'),inspect(_0x1f3a1e));return _[_0x1497('0x2f')](_0x1f3a1e[_0x1497('0x30')])?null:_0x1f3a1e[_0x1497('0x30')]['toString']();}else{logger[_0x1497('0x8')](_0x1497('0x2c'),inspect(_0x1f3a1e));return null;}}else{logger[_0x1497('0x8')](_0x1497('0x31'));return null;}}catch(_0x3e286b){logger[_0x1497('0x8')](_0x3e286b[_0x1497('0xa')]);return null;}});if(_0x2b12b6[_0x1497('0x32')]){logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x33'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2[_0x1497('0x34')],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));_0x3ec325[_0x1497('0x25')](_0x2b12b6[_0x1497('0x32')]['id'],function(_0x224c02){try{_0x224c02=_0x42458c[_0x1497('0x35')](_0x224c02);logger[_0x1497('0x1a')](_0x1497('0x26'),JSON[_0x1497('0x1b')](_0x224c02,null,0x2));if(_0x224c02&&_0x42458c[_0x224c02['agicommand']]){_0x1f3a1e=_0x42458c[_0x224c02[_0x1497('0x27')]](_0x224c02);if(_0x1f3a1e){logger['debug'](_0x1497('0x2c'),inspect(_0x1f3a1e));return _[_0x1497('0x2f')](_0x1f3a1e[_0x1497('0x30')])?null:_0x1f3a1e['result'][_0x1497('0x36')]();}else{logger[_0x1497('0x8')](_0x1497('0x2c'),inspect(_0x1f3a1e));return null;}}else{logger[_0x1497('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x29c36a){logger[_0x1497('0x8')](_0x29c36a[_0x1497('0xa')]);return null;}});}logger[_0x1497('0x1e')](util[_0x1497('0x1f')](_0x1497('0x37'),_0x3f59b2[_0x1497('0x21')],_0x3f59b2[_0x1497('0x22')],_0x3f59b2['callerid'],_0x3f59b2[_0x1497('0x23')],_0x3f59b2[_0x1497('0x24')]));logger[_0x1497('0x1e')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3f59b2[_0x1497('0x29')],_0x3f59b2[_0x1497('0x2a')],parseInt(_0x3f59b2[_0x1497('0x2b')],0xa)+0x1));_0x3f59b2[_0x1497('0x38')](_0x3f59b2[_0x1497('0x29')],_0x3f59b2[_0x1497('0x2a')],parseInt(_0x3f59b2['priority'],0xa)+0x1);_0x3f59b2['close']();}function handleNotFound(_0x5e84b1){logger[_0x1497('0x8')](util['format'](_0x1497('0x39'),_0x5e84b1[_0x1497('0x21')]));_0x5e84b1['continueAt'](_0x5e84b1['context'],_0x5e84b1[_0x1497('0x2a')],parseInt(_0x5e84b1[_0x1497('0x2b')],0xa)+0x1);_0x5e84b1['close']();}function handleUnpublished(_0x1ee70d){logger[_0x1497('0x8')](util[_0x1497('0x1f')](_0x1497('0x3a'),_0x1ee70d[_0x1497('0x21')]));_0x1ee70d[_0x1497('0x38')](_0x1ee70d[_0x1497('0x29')],_0x1ee70d[_0x1497('0x2a')],parseInt(_0x1ee70d[_0x1497('0x2b')],0xa)+0x1);_0x1ee70d['close']();}module[_0x1497('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x9f97=['[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','traverseBFS','vertex','agicommand','context','extension','priority','result','evtHangup','response','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid'];(function(_0x3f1983,_0xb42e50){var _0x1be7fd=function(_0x58cd5d){while(--_0x58cd5d){_0x3f1983['push'](_0x3f1983['shift']());}};_0x1be7fd(++_0xb42e50);}(_0x9f97,0xbb));var _0x79f9=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x9f97[_0xc40b9f];return _0x535b9c;};'use strict';var _=require(_0x79f9('0x0'));var moment=require(_0x79f9('0x1'));var parser=require(_0x79f9('0x2'));var util=require(_0x79f9('0x3'));var logger=require(_0x79f9('0x4'))('agi');var rpc=require(_0x79f9('0x5'));var mailRpc=require(_0x79f9('0x6'));var Graph=require('./graph');var Vertices=require(_0x79f9('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x79f9('0x8')]()[_0x79f9('0x9')](function(_0x3ee2f7){logger['error'](_0x79f9('0xa'),_0x3ee2f7[_0x79f9('0xb')]);return[];});}function addVertex(_0x1dc5e3,_0x5356d8,_0xa37b90){_0x5356d8['agicommand']=_0xa37b90;if(_0x5356d8[_0x79f9('0xc')](_0x79f9('0xd'))){_0x5356d8[_0x79f9('0xe')]=parseInt(_0x5356d8['retry'],0xa);}_0x1dc5e3[_0x79f9('0xf')](_[_0x79f9('0x10')](_0x5356d8,_0x79f9('0x11')));}function initGraph(_0xaa4ea7,_0x542817){var _0x5b8bab=new Graph();for(var _0x5f0aa2 in _0xaa4ea7){if(_0xaa4ea7[_0x79f9('0xc')](_0x5f0aa2)){if(_[_0x79f9('0x12')](_0xaa4ea7[_0x5f0aa2])){for(var _0x435df4=0x0;_0x435df4<_0xaa4ea7[_0x5f0aa2]['length'];_0x435df4+=0x1){addVertex(_0x5b8bab,_0xaa4ea7[_0x5f0aa2][_0x435df4],_0x5f0aa2);}}else{addVertex(_0x5b8bab,_0xaa4ea7[_0x5f0aa2],_0x5f0aa2);}}}for(var _0x472d7f=0x0;_0x472d7f<_0x542817[_0x79f9('0x13')];_0x472d7f+=0x1){if(_0x542817[_0x472d7f][_0x79f9('0x14')]&&_0x542817[_0x472d7f][_0x79f9('0x15')]){_0x5b8bab[_0x79f9('0x16')](_0x542817[_0x472d7f][_0x79f9('0x14')],_0x542817[_0x472d7f][_0x79f9('0x15')],_0x542817[_0x472d7f][_0x79f9('0x17')]);}}return _0x5b8bab;}function getRoot(_0x2616c8){return parser['toJson'](_0x2616c8,{'object':!![]})[_0x79f9('0x18')][_0x79f9('0x19')];}function inspect(_0x547e4b){return util[_0x79f9('0x1a')](_0x547e4b,{'showHidden':![],'depth':null});}function initialize(_0x242b8a,_0x1d8ab7){var _0xd4c499=getRoot(_0x242b8a[_0x79f9('0x1b')]);if(!_0xd4c499||!_0xd4c499[_0x79f9('0x1c')])return;var _0x4ec792,_0x27c413,_0x43d1cd;logger[_0x79f9('0x1d')](_0x79f9('0x19'),JSON[_0x79f9('0x1e')](_0xd4c499,null,0x2));_0x1d8ab7[_0x79f9('0x1f')]=moment()[_0x79f9('0x20')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ec792=initGraph(_['omit'](_0xd4c499,_0x79f9('0x11')),_0xd4c499[_0x79f9('0x11')]);_0x27c413=new Vertices(_0x1d8ab7,rpc,mailRpc);logger[_0x79f9('0x21')](util['format'](_0x79f9('0x22'),_0x1d8ab7[_0x79f9('0x23')],_0x1d8ab7['calleridname'],_0x1d8ab7['callerid'],_0x1d8ab7['dnid'],_0x1d8ab7[_0x79f9('0x24')]));_0x4ec792[_0x79f9('0x25')](_0xd4c499[_0x79f9('0x1c')]['id'],function(_0xa275ff){try{_0xa275ff=_0x27c413['clear'](_0xa275ff);logger[_0x79f9('0x1d')](_0x79f9('0x26'),JSON[_0x79f9('0x1e')](_0xa275ff,null,0x2));if(_0xa275ff[_0x79f9('0x27')]==='gotoc'){logger[_0x79f9('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1d8ab7['context']=_0xa275ff['context']||_0x1d8ab7[_0x79f9('0x28')];_0x1d8ab7[_0x79f9('0x29')]=_0xa275ff[_0x79f9('0x29')];_0x1d8ab7[_0x79f9('0x2a')]=_0xa275ff[_0x79f9('0x2a')]?_0xa275ff['priority']-0x1:0x1;return null;}else if(_0xa275ff&&_0x27c413[_0xa275ff[_0x79f9('0x27')]]){_0x43d1cd=_0x27c413[_0xa275ff[_0x79f9('0x27')]](_0xa275ff);logger[_0x79f9('0x21')]('response',JSON[_0x79f9('0x1e')](_0x43d1cd,null,0x2));if(_0x43d1cd&&_0x43d1cd['code']===AGI_CODE_SUCCESS&&_0x43d1cd[_0x79f9('0x2b')]!==AGI_RESULT_ERROR&&!_0x1d8ab7[_0x79f9('0x2c')]){logger[_0x79f9('0x1d')](_0x79f9('0x2d'),inspect(_0x43d1cd));return _[_0x79f9('0x2e')](_0x43d1cd[_0x79f9('0x2b')])?null:_0x43d1cd[_0x79f9('0x2b')][_0x79f9('0x2f')]();}else{logger[_0x79f9('0x30')]('response',inspect(_0x43d1cd));return null;}}else{logger[_0x79f9('0x30')](_0x79f9('0x31'));return null;}}catch(_0x3cfaa0){logger[_0x79f9('0x30')](_0x3cfaa0[_0x79f9('0xb')]);return null;}});if(_0xd4c499[_0x79f9('0x32')]){logger['info'](util[_0x79f9('0x20')](_0x79f9('0x33'),_0x1d8ab7['arg_1'],_0x1d8ab7['calleridname'],_0x1d8ab7['callerid'],_0x1d8ab7[_0x79f9('0x34')],_0x1d8ab7['uniqueid']));_0x4ec792[_0x79f9('0x25')](_0xd4c499['finally']['id'],function(_0x14bb70){try{_0x14bb70=_0x27c413['clear'](_0x14bb70);logger[_0x79f9('0x1d')](_0x79f9('0x26'),JSON[_0x79f9('0x1e')](_0x14bb70,null,0x2));if(_0x14bb70&&_0x27c413[_0x14bb70[_0x79f9('0x27')]]){_0x43d1cd=_0x27c413[_0x14bb70[_0x79f9('0x27')]](_0x14bb70);if(_0x43d1cd){logger[_0x79f9('0x1d')]('response',inspect(_0x43d1cd));return _[_0x79f9('0x2e')](_0x43d1cd[_0x79f9('0x2b')])?null:_0x43d1cd[_0x79f9('0x2b')]['toString']();}else{logger[_0x79f9('0x30')](_0x79f9('0x2d'),inspect(_0x43d1cd));return null;}}else{logger[_0x79f9('0x30')](_0x79f9('0x31'));return null;}}catch(_0xcbd0fe){logger[_0x79f9('0x30')](_0xcbd0fe[_0x79f9('0xb')]);return null;}});}logger[_0x79f9('0x21')](util[_0x79f9('0x20')](_0x79f9('0x35'),_0x1d8ab7['arg_1'],_0x1d8ab7[_0x79f9('0x36')],_0x1d8ab7['callerid'],_0x1d8ab7[_0x79f9('0x34')],_0x1d8ab7[_0x79f9('0x24')]));logger[_0x79f9('0x21')](util[_0x79f9('0x20')](_0x79f9('0x37'),_0x1d8ab7[_0x79f9('0x28')],_0x1d8ab7[_0x79f9('0x29')],parseInt(_0x1d8ab7[_0x79f9('0x2a')],0xa)+0x1));_0x1d8ab7[_0x79f9('0x38')](_0x1d8ab7[_0x79f9('0x28')],_0x1d8ab7[_0x79f9('0x29')],parseInt(_0x1d8ab7[_0x79f9('0x2a')],0xa)+0x1);_0x1d8ab7[_0x79f9('0x39')]();}function handleNotFound(_0x2aed08){logger[_0x79f9('0x30')](util[_0x79f9('0x20')]('Project\x20%s\x20not\x20found',_0x2aed08[_0x79f9('0x23')]));_0x2aed08[_0x79f9('0x38')](_0x2aed08[_0x79f9('0x28')],_0x2aed08['extension'],parseInt(_0x2aed08['priority'],0xa)+0x1);_0x2aed08[_0x79f9('0x39')]();}function handleUnpublished(_0x44bb05){logger['error'](util[_0x79f9('0x20')](_0x79f9('0x3a'),_0x44bb05['arg_1']));_0x44bb05['continueAt'](_0x44bb05[_0x79f9('0x28')],_0x44bb05[_0x79f9('0x29')],parseInt(_0x44bb05['priority'],0xa)+0x1);_0x44bb05[_0x79f9('0x39')]();}module[_0x79f9('0x3b')]={'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 e5632a9..a2d58f9 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 _0xab2a=['_localBuffer','toString','substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a'];(function(_0x2ce590,_0x2fa3c5){var _0x2c74d9=function(_0x4fe2ba){while(--_0x4fe2ba){_0x2ce590['push'](_0x2ce590['shift']());}};_0x2c74d9(++_0x2fa3c5);}(_0xab2a,0x1a1));var _0xaab2=function(_0x73b6ea,_0x1c29ea){_0x73b6ea=_0x73b6ea-0x0;var _0x122009=_0xab2a[_0x73b6ea];return _0x122009;};'use strict';var util=require(_0xaab2('0x0'));var Transform=require(_0xaab2('0x1'))[_0xaab2('0x2')];function AGIReply(_0x57aa2a){Transform[_0xaab2('0x3')](this,_0x57aa2a);this['_localBuffer']='';this[_0xaab2('0x4')]=![];}util[_0xaab2('0x5')](AGIReply,Transform);AGIReply[_0xaab2('0x6')]['_transform']=function(_0xae8b7d,_0x493481,_0x5c14f2){var _0x53ce4f='\x0a',_0x5ec536=['\x0a\x0a',_0xaab2('0x7')],_0x113939=-0x1,_0x2a700e=-0x1,_0x8ea9c0='',_0x19cbc4=0x0,_0x15f258='',_0x14cde3='';this[_0xaab2('0x8')]+=_0xae8b7d[_0xaab2('0x9')]();_0x15f258=this[_0xaab2('0x8')];if(!this[_0xaab2('0x4')]){_0x19cbc4=0x0;while(_0x5ec536[_0x19cbc4]){while((_0x2a700e=_0x15f258['indexOf'](_0x5ec536[_0x19cbc4]))!=-0x1){_0x8ea9c0=_0x5ec536[_0x19cbc4];_0x14cde3=_0x15f258[_0xaab2('0xa')](0x0,_0x2a700e);_0x15f258=_0x15f258['substring'](_0x2a700e+_0x8ea9c0[_0xaab2('0xb')]);var _0xc08108=_0x14cde3[_0xaab2('0xc')](_0x53ce4f),_0x1da8b8=0x0,_0x3d6b78={},_0x56d19d='',_0x433136='',_0x84d7db=-0x1;while(_0xc08108[_0x1da8b8]){_0x84d7db=_0xc08108[_0x1da8b8][_0xaab2('0xd')](':');if(_0x84d7db!=-0x1){_0x56d19d=_0xc08108[_0x1da8b8][_0xaab2('0xe')](0x0,_0x84d7db)[_0xaab2('0xf')]();_0x433136=_0xc08108[_0x1da8b8]['slice'](_0x84d7db+0x1)['trim']();if(_0x56d19d[_0xaab2('0xb')]>0x0){_0x3d6b78[_0x56d19d]=_0x433136;}}else{}_0x1da8b8++;}this[_0xaab2('0x10')]('headers',_0x3d6b78);this[_0xaab2('0x4')]=!![];}_0x19cbc4++;}this[_0xaab2('0x8')]=_0x15f258;}else{while((_0x113939=_0x15f258[_0xaab2('0xd')](_0x53ce4f))!=-0x1){_0x14cde3=_0x15f258[_0xaab2('0xa')](0x0,_0x113939);this[_0xaab2('0x10')]('line',_0x14cde3);_0x15f258=_0x15f258['substring'](_0x113939+_0x53ce4f[_0xaab2('0xb')]);}this[_0xaab2('0x8')]=_0x15f258;}_0x5c14f2();};module['exports']=AGIReply; \ No newline at end of file +var _0xcfa0=['\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','Transform','call','_inBody','inherits','_transform'];(function(_0x39782f,_0x4aa931){var _0x47768c=function(_0x2672e4){while(--_0x2672e4){_0x39782f['push'](_0x39782f['shift']());}};_0x47768c(++_0x4aa931);}(_0xcfa0,0xde));var _0x0cfa=function(_0x6400b6,_0x124bd3){_0x6400b6=_0x6400b6-0x0;var _0x5a48b1=_0xcfa0[_0x6400b6];return _0x5a48b1;};'use strict';var util=require(_0x0cfa('0x0'));var Transform=require('stream')[_0x0cfa('0x1')];function AGIReply(_0x551249){Transform[_0x0cfa('0x2')](this,_0x551249);this['_localBuffer']='';this[_0x0cfa('0x3')]=![];}util[_0x0cfa('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x0cfa('0x5')]=function(_0xd8f7e4,_0x36b8d8,_0x5f026e){var _0x2627a2='\x0a',_0x3371cb=['\x0a\x0a',_0x0cfa('0x6')],_0x255c45=-0x1,_0x106169=-0x1,_0x1b28af='',_0x5df040=0x0,_0x771f62='',_0xa5f5f7='';this['_localBuffer']+=_0xd8f7e4[_0x0cfa('0x7')]();_0x771f62=this[_0x0cfa('0x8')];if(!this['_inBody']){_0x5df040=0x0;while(_0x3371cb[_0x5df040]){while((_0x106169=_0x771f62[_0x0cfa('0x9')](_0x3371cb[_0x5df040]))!=-0x1){_0x1b28af=_0x3371cb[_0x5df040];_0xa5f5f7=_0x771f62[_0x0cfa('0xa')](0x0,_0x106169);_0x771f62=_0x771f62[_0x0cfa('0xa')](_0x106169+_0x1b28af[_0x0cfa('0xb')]);var _0x400104=_0xa5f5f7[_0x0cfa('0xc')](_0x2627a2),_0xf23451=0x0,_0x1cdcf7={},_0x4353b2='',_0x216571='',_0x29bbda=-0x1;while(_0x400104[_0xf23451]){_0x29bbda=_0x400104[_0xf23451][_0x0cfa('0x9')](':');if(_0x29bbda!=-0x1){_0x4353b2=_0x400104[_0xf23451][_0x0cfa('0xd')](0x0,_0x29bbda)[_0x0cfa('0xe')]();_0x216571=_0x400104[_0xf23451][_0x0cfa('0xd')](_0x29bbda+0x1)['trim']();if(_0x4353b2['length']>0x0){_0x1cdcf7[_0x4353b2]=_0x216571;}}else{}_0xf23451++;}this[_0x0cfa('0xf')](_0x0cfa('0x10'),_0x1cdcf7);this[_0x0cfa('0x3')]=!![];}_0x5df040++;}this['_localBuffer']=_0x771f62;}else{while((_0x255c45=_0x771f62[_0x0cfa('0x9')](_0x2627a2))!=-0x1){_0xa5f5f7=_0x771f62['substring'](0x0,_0x255c45);this[_0x0cfa('0xf')](_0x0cfa('0x11'),_0xa5f5f7);_0x771f62=_0x771f62['substring'](_0x255c45+_0x2627a2[_0x0cfa('0xb')]);}this[_0x0cfa('0x8')]=_0x771f62;}_0x5f026e();};module[_0x0cfa('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 2493c6e..daf0134 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 _0x5089=['PauseUser','UnpauseUser','agentLogout','lodash','moment','client','http','request','error','result','catch','getSquareProjects','GetSquareProjects','production','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','name','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser'];(function(_0x5ad4e6,_0x12361f){var _0x511972=function(_0x292354){while(--_0x292354){_0x5ad4e6['push'](_0x5ad4e6['shift']());}};_0x511972(++_0x12361f);}(_0x5089,0x1bb));var _0x9508=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0x5089[_0x28678d];return _0x1643e9;};'use strict';var _=require(_0x9508('0x0'));var moment=require(_0x9508('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x9508('0x2')][_0x9508('0x3')]({'port':0x2329});function request(_0x7dd13d,_0x100d7e){return new Promise(function(_0x172549,_0x59d3ee){return client[_0x9508('0x4')](_0x7dd13d,_0x100d7e)['then'](function(_0x3d6516){if(_0x3d6516[_0x9508('0x5')]){return _0x59d3ee(_0x3d6516[_0x9508('0x5')]['message']);}else{return _0x172549(_0x3d6516[_0x9508('0x6')]);}})[_0x9508('0x7')](function(_0x55a5de){return _0x59d3ee(_0x55a5de);});});}exports[_0x9508('0x8')]=function(){return request(_0x9508('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x9508('0xa')]}});};exports['getSquareProject']=function(_0x424e6a){return request(_0x9508('0xb'),{'options':{'raw':![],'where':{'name':_0x424e6a},'attributes':[_0x9508('0xa')]}});};exports[_0x9508('0xc')]=function(_0x839509){return request(_0x9508('0xd'),{'options':{'raw':![],'where':{'id':_0x839509},'include':[{'model':'MailServerOut','as':_0x9508('0xe'),'include':[{'model':'CloudProvider','as':_0x9508('0xf')}]}],'attributes':['id',_0x9508('0x10'),'email'],'smtp':!![]}});};exports[_0x9508('0x11')]=function(_0x3b7427){return request(_0x9508('0xb'),{'options':{'where':{'id':_0x3b7427},'attributes':[_0x9508('0x10')]}});};exports['getVoiceQueueById']=function(_0x440709){return request(_0x9508('0x12'),{'options':{'where':{'id':_0x440709},'attributes':['name']}});};exports[_0x9508('0x13')]=function(_0x539746){return request(_0x9508('0x14'),{'options':{'where':{'id':_0x539746},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x15')]=function(_0x255a03){return request(_0x9508('0x16'),{'options':{'where':{'id':_0x255a03},'attributes':[_0x9508('0x17')]}});};exports[_0x9508('0x18')]=function(_0x20df7d){return request('ShowUser',{'options':{'where':{'id':_0x20df7d},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x19')]=function(_0xfcc29d){return request(_0x9508('0x1a'),{'options':{'where':{'phone':_0xfcc29d[_0x9508('0x1b')]},'attributes':['id']}});};exports[_0x9508('0x1c')]=function(_0x52e3c4){return request('ShowTrunk',{'options':{'where':{'id':_0x52e3c4},'attributes':[_0x9508('0x10')]}});};exports['getSoundById']=function(_0x2272e2){return request('ShowSound',{'options':{'where':{'id':_0x2272e2},'attributes':[_0x9508('0x1d')]}});};exports[_0x9508('0x1e')]=function(_0x226f29){return request(_0x9508('0x1f'),{'options':{'raw':![],'where':{'id':_0x226f29},'include':[{'model':_0x9508('0x20'),'as':_0x9508('0x21')}]}});};exports[_0x9508('0x22')]=function(_0x5f4f0c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5f4f0c},'attributes':['id',_0x9508('0x10')]}});};exports[_0x9508('0x23')]=function(_0x39e6b0){return request(_0x9508('0x24'),{'body':_0x39e6b0});};exports[_0x9508('0x25')]=function(_0x20d2ce){return request('CreateSquareDetailsReport',{'body':_0x20d2ce});};exports['createSquareReport']=function(_0x46d23f){return request('CreateSquareReport',{'body':_['merge'](_0x46d23f,{'project_name':_0x46d23f[_0x9508('0x26')],'prev_project_name':_0x46d23f['arg_2']||'','is_subproject':_0x46d23f['arg_2']?!![]:![],'leaveAt':moment()[_0x9508('0x27')](_0x9508('0x28'))})});};exports['createSquareRecording']=function(_0x49246b){return request(_0x9508('0x29'),{'body':_0x49246b});};exports[_0x9508('0x2a')]=function(_0x4529a8){return request(_0x9508('0x2b'),{'body':_0x4529a8});};exports[_0x9508('0x2c')]=function(_0x15c32e){return request(_0x9508('0x2d'),{'options':{'raw':![],'where':{'phone':_0x15c32e[_0x9508('0x1b')],'ListId':_0x15c32e[_0x9508('0x2e')]}}})[_0x9508('0x2f')](function(_0x55f36c){if(_0x55f36c){return _0x55f36c;}return request(_0x9508('0x30'),{'body':_0x15c32e});});};exports[_0x9508('0x31')]=function(_0x2b3738){return request('ShowPause',{'options':{'where':{'id':_0x2b3738},'attributes':[_0x9508('0x10')]}});};exports[_0x9508('0x32')]=function(_0x5e1d31,_0x3334d4){return request(_0x9508('0x33'),{'body':{'interface':_0x3334d4},'options':{'where':_0x5e1d31}});};exports['agentPause']=function(_0x1bce4f,_0x2fd00e,_0xb06b10){return request(_0x9508('0x34'),{'body':{'type':_0x2fd00e,'uniqueid':_0xb06b10},'options':{'where':_0x1bce4f}});};exports['agentUnpause']=function(_0x52a715){return request(_0x9508('0x35'),{'body':{},'options':{'where':_0x52a715}});};exports[_0x9508('0x36')]=function(_0x2677d6){return request('LogoutUser',{'body':{},'options':{'where':_0x2677d6}});}; \ No newline at end of file +var _0x43f3=['ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','moment','jayson/promise','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x43f3,0xab));var _0x343f=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x43f3[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var moment=require(_0x343f('0x0'));var jayson=require(_0x343f('0x1'));var client=jayson['client'][_0x343f('0x2')]({'port':0x2329});function request(_0x56b1ea,_0x26241f){return new Promise(function(_0x48008f,_0x3339a9){return client[_0x343f('0x3')](_0x56b1ea,_0x26241f)[_0x343f('0x4')](function(_0x5615d2){if(_0x5615d2[_0x343f('0x5')]){return _0x3339a9(_0x5615d2[_0x343f('0x5')][_0x343f('0x6')]);}else{return _0x48008f(_0x5615d2[_0x343f('0x7')]);}})[_0x343f('0x8')](function(_0x2808b9){return _0x3339a9(_0x2808b9);});});}exports[_0x343f('0x9')]=function(){return request(_0x343f('0xa'),{'options':{'raw':![],'attributes':['id',_0x343f('0xb'),_0x343f('0xc')]}});};exports[_0x343f('0xd')]=function(_0x37e416){return request(_0x343f('0xe'),{'options':{'raw':![],'where':{'name':_0x37e416},'attributes':[_0x343f('0xc')]}});};exports[_0x343f('0xf')]=function(_0x194230){return request(_0x343f('0x10'),{'options':{'raw':![],'where':{'id':_0x194230},'include':[{'model':_0x343f('0x11'),'as':_0x343f('0x12'),'include':[{'model':'CloudProvider','as':_0x343f('0x13')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x343f('0x14')]=function(_0x1923ee){return request('ShowSquareProject',{'options':{'where':{'id':_0x1923ee},'attributes':['name']}});};exports[_0x343f('0x15')]=function(_0x552c07){return request(_0x343f('0x16'),{'options':{'where':{'id':_0x552c07},'attributes':['name']}});};exports[_0x343f('0x17')]=function(_0x950400){return request(_0x343f('0x18'),{'options':{'where':{'id':_0x950400},'attributes':[_0x343f('0xb')]}});};exports[_0x343f('0x19')]=function(_0x50ccfe){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x50ccfe},'attributes':[_0x343f('0x1a')]}});};exports[_0x343f('0x1b')]=function(_0x199774){return request(_0x343f('0x1c'),{'options':{'where':{'id':_0x199774},'attributes':[_0x343f('0xb')]}});};exports[_0x343f('0x1d')]=function(_0x47a6e1){return request(_0x343f('0x1e'),{'options':{'where':{'phone':_0x47a6e1[_0x343f('0x1f')]},'attributes':['id']}});};exports[_0x343f('0x20')]=function(_0x1637d9){return request(_0x343f('0x21'),{'options':{'where':{'id':_0x1637d9},'attributes':[_0x343f('0xb')]}});};exports[_0x343f('0x22')]=function(_0x32e3e8){return request(_0x343f('0x23'),{'options':{'where':{'id':_0x32e3e8},'attributes':[_0x343f('0x24')]}});};exports[_0x343f('0x25')]=function(_0xb3e39f){return request(_0x343f('0x26'),{'options':{'raw':![],'where':{'id':_0xb3e39f},'include':[{'model':'Interval','as':_0x343f('0x27')}]}});};exports['getSmsAccountById']=function(_0x24d568){return request(_0x343f('0x28'),{'options':{'where':{'id':_0x24d568},'attributes':['id',_0x343f('0xb')]}});};exports[_0x343f('0x29')]=function(_0x489eaa){return request(_0x343f('0x2a'),{'body':_0x489eaa});};exports[_0x343f('0x2b')]=function(_0x3b82fe){return request(_0x343f('0x2c'),{'body':_0x3b82fe});};exports[_0x343f('0x2d')]=function(_0x2ef4c3){return request(_0x343f('0x2e'),{'body':_[_0x343f('0x2f')](_0x2ef4c3,{'project_name':_0x2ef4c3[_0x343f('0x30')],'prev_project_name':_0x2ef4c3[_0x343f('0x31')]||'','is_subproject':_0x2ef4c3[_0x343f('0x31')]?!![]:![],'leaveAt':moment()[_0x343f('0x32')](_0x343f('0x33'))})});};exports[_0x343f('0x34')]=function(_0x4f42c2){return request(_0x343f('0x35'),{'body':_0x4f42c2});};exports[_0x343f('0x36')]=function(_0x1c8dd6){return request('CreateSquareMessage',{'body':_0x1c8dd6});};exports[_0x343f('0x37')]=function(_0x2304d4){return request(_0x343f('0x38'),{'options':{'raw':![],'where':{'phone':_0x2304d4[_0x343f('0x1f')],'ListId':_0x2304d4[_0x343f('0x39')]}}})['then'](function(_0x30e827){if(_0x30e827){return _0x30e827;}return request(_0x343f('0x3a'),{'body':_0x2304d4});});};exports['getPauseById']=function(_0x52100b){return request('ShowPause',{'options':{'where':{'id':_0x52100b},'attributes':['name']}});};exports[_0x343f('0x3b')]=function(_0x26f82d,_0x4a985d){return request(_0x343f('0x3c'),{'body':{'interface':_0x4a985d},'options':{'where':_0x26f82d}});};exports[_0x343f('0x3d')]=function(_0x4fbf24,_0x7dace6,_0x5420c5){return request(_0x343f('0x3e'),{'body':{'type':_0x7dace6,'uniqueid':_0x5420c5},'options':{'where':_0x4fbf24}});};exports[_0x343f('0x3f')]=function(_0x144b8b){return request(_0x343f('0x40'),{'body':{},'options':{'where':_0x144b8b}});};exports['agentLogout']=function(_0x227871){return request('LogoutUser',{'body':{},'options':{'where':_0x227871}});}; \ 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 7775bb3..920f91b 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 _0x6eed=['./polly','./lex','exports'];(function(_0x2734e4,_0x3dfc1d){var _0x150623=function(_0x2cb799){while(--_0x2cb799){_0x2734e4['push'](_0x2734e4['shift']());}};_0x150623(++_0x3dfc1d);}(_0x6eed,0xff));var _0xd6ee=function(_0x30a1c4,_0x156223){_0x30a1c4=_0x30a1c4-0x0;var _0x555e13=_0x6eed[_0x30a1c4];return _0x555e13;};var polly=require(_0xd6ee('0x0'));var lex=require(_0xd6ee('0x1'));module[_0xd6ee('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc029=['./lex','exports','./polly'];(function(_0x3ba9cc,_0x32c51f){var _0x2818ee=function(_0x487569){while(--_0x487569){_0x3ba9cc['push'](_0x3ba9cc['shift']());}};_0x2818ee(++_0x32c51f);}(_0xc029,0x1df));var _0x9c02=function(_0x1734ab,_0x254bb2){_0x1734ab=_0x1734ab-0x0;var _0x41008e=_0xc029[_0x1734ab];return _0x41008e;};var polly=require(_0x9c02('0x0'));var lex=require(_0x9c02('0x1'));module[_0x9c02('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 28053ed..72a3827 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 _0xee5b=['./lib/api'];(function(_0x59dede,_0x30cb83){var _0x1c2d0f=function(_0x2c382d){while(--_0x2c382d){_0x59dede['push'](_0x59dede['shift']());}};_0x1c2d0f(++_0x30cb83);}(_0xee5b,0x1f4));var _0xbee5=function(_0x17c750,_0x2f7244){_0x17c750=_0x17c750-0x0;var _0x344099=_0xee5b[_0x17c750];return _0x344099;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file +var _0x750a=['exports'];(function(_0x49cb7b,_0x46376c){var _0x24819c=function(_0x3254a3){while(--_0x3254a3){_0x49cb7b['push'](_0x49cb7b['shift']());}};_0x24819c(++_0x46376c);}(_0x750a,0x140));var _0xa750=function(_0x323921,_0x25ecdd){_0x323921=_0x323921-0x0;var _0x54ae0d=_0x750a[_0x323921];return _0x54ae0d;};'use strict';var lex=require('./lib/api');module[_0xa750('0x0')]=function(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f){return lex(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f);}; \ 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 b1d87ca..f487809 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(_0x154bc2,_0xb5c59e){var _0x50bbf0=function(_0x1ced51){while(--_0x1ced51){_0x154bc2['push'](_0x154bc2['shift']());}};_0x50bbf0(++_0xb5c59e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x28f391,_0x2bc6e2){var _0x6758aa=function(_0x4fac99){while(--_0x4fac99){_0x28f391['push'](_0x28f391['shift']());}};_0x6758aa(++_0x2bc6e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 760188a..7d117d0 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 _0xfd53=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd53,0x1ea));var _0x3fd5=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xfd53[_0x3305de];return _0x3b5a84;};'use strict';var polly=require(_0x3fd5('0x0'));module[_0x3fd5('0x1')]=function(_0x4429bb,_0x557280,_0x314f24,_0x1446a9,_0x59ee0f,_0x4a6528,_0x3d83bd){return polly(_0x4429bb,_0x557280,_0x314f24,_0x1446a9,_0x59ee0f,_0x4a6528,_0x3d83bd);}; \ No newline at end of file +var _0x9c8d=['exports','./lib/api'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x9c8d,0x9d));var _0xd9c8=function(_0x3d9c33,_0x258979){_0x3d9c33=_0x3d9c33-0x0;var _0x36410a=_0x9c8d[_0x3d9c33];return _0x36410a;};'use strict';var polly=require(_0xd9c8('0x0'));module[_0xd9c8('0x1')]=function(_0x1991c0,_0x583dce,_0x7f85c0,_0x5c8ad5,_0x4a546e,_0xe39ed7,_0x12b41a){return polly(_0x1991c0,_0x583dce,_0x7f85c0,_0x5c8ad5,_0x4a546e,_0xe39ed7,_0x12b41a);}; \ 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 97e8c8c..e12af54 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 _0x27b9=['Polly','mp3','randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x27b9,0xfe));var _0x927b=function(_0xea1bcd,_0x465e08){_0xea1bcd=_0xea1bcd-0x0;var _0xfbe4c6=_0x27b9[_0xea1bcd];return _0xfbe4c6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x927b('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x31fa28,_0x24aefa,_0x590501){return new BPromise(function(_0xfade53,_0x2a5834){_0x31fa28['synthesizeSpeech'](_0x24aefa,function(_0x32668e,_0x4228fd){if(_0x32668e){_0x2a5834(_0x32668e);}else if(_0x4228fd){if(_0x4228fd[_0x927b('0x1')]instanceof Buffer){fs[_0x927b('0x2')](_0x590501,_0x4228fd[_0x927b('0x1')],function(_0xa30b6b){if(_0xa30b6b){_0x2a5834(_0xa30b6b);}else{_0xfade53();}});}else{_0x2a5834(new Error(_0x927b('0x3')));}}else{_0x2a5834(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x927b('0x4')]=function(_0x44180f,_0x56d181,_0x431ae6,_0x3dd7be,_0x265b1d,_0x3be71e,_0x44d272){var _0x596039=new AWS[(_0x927b('0x5'))]({'accessKeyId':_0x44180f,'secretAccessKey':_0x56d181,'region':_0x431ae6});var _0x1bfa0e={'Text':_0x265b1d,'TextType':_0x3be71e||'text','OutputFormat':_0x927b('0x6'),'VoiceId':_0x3dd7be};return pollyResult(_0x596039,_0x1bfa0e,_0x44d272);}; \ No newline at end of file +var _0xb087=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x12f0c6,_0x49b333){var _0xae9fce=function(_0x191c1f){while(--_0x191c1f){_0x12f0c6['push'](_0x12f0c6['shift']());}};_0xae9fce(++_0x49b333);}(_0xb087,0x10d));var _0x7b08=function(_0x18a9db,_0x2185ae){_0x18a9db=_0x18a9db-0x0;var _0x390255=_0xb087[_0x18a9db];return _0x390255;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x7b08('0x0'));var rs=require(_0x7b08('0x1'));var AWS=require(_0x7b08('0x2'));function pollyResult(_0x147372,_0x30fdab,_0x48324e){return new BPromise(function(_0xedf7f8,_0x4cd92a){_0x147372[_0x7b08('0x3')](_0x30fdab,function(_0xabd6db,_0x344d03){if(_0xabd6db){_0x4cd92a(_0xabd6db);}else if(_0x344d03){if(_0x344d03[_0x7b08('0x4')]instanceof Buffer){fs[_0x7b08('0x5')](_0x48324e,_0x344d03['AudioStream'],function(_0x4b2ea3){if(_0x4b2ea3){_0x4cd92a(_0x4b2ea3);}else{_0xedf7f8();}});}else{_0x4cd92a(new Error(_0x7b08('0x6')));}}else{_0x4cd92a(new Error(_0x7b08('0x7')));}});});}module[_0x7b08('0x8')]=function(_0x5ceb9f,_0x51e734,_0x1e840d,_0x46fc88,_0x2e105a,_0x5a7865,_0x48148e){var _0x532cc6=new AWS[(_0x7b08('0x9'))]({'accessKeyId':_0x5ceb9f,'secretAccessKey':_0x51e734,'region':_0x1e840d});var _0x1a72f9={'Text':_0x2e105a,'TextType':_0x5a7865||_0x7b08('0xa'),'OutputFormat':_0x7b08('0xb'),'VoiceId':_0x46fc88};return pollyResult(_0x532cc6,_0x1a72f9,_0x48148e);}; \ 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 edf365a..9b50acd 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 _0x96a1=['./lib/api','exports'];(function(_0x55f0df,_0x5abf1b){var _0x3a058e=function(_0x302c61){while(--_0x302c61){_0x55f0df['push'](_0x55f0df['shift']());}};_0x3a058e(++_0x5abf1b);}(_0x96a1,0x1cc));var _0x196a=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x96a1[_0x1ebd10];return _0x1004d3;};'use strict';var asr=require(_0x196a('0x0'));module[_0x196a('0x1')]=function(_0x1f7567,_0x16c020,_0x41ce21,_0x2461b9){return asr(_0x1f7567,_0x16c020,_0x41ce21);}; \ No newline at end of file +var _0xe395=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe395,0x1cb));var _0x5e39=function(_0x501cdd,_0x2a0da5){_0x501cdd=_0x501cdd-0x0;var _0xb9bdb8=_0xe395[_0x501cdd];return _0xb9bdb8;};'use strict';var asr=require(_0x5e39('0x0'));module[_0x5e39('0x1')]=function(_0x27a89a,_0x1360c0,_0x19c4fd,_0x4470a2){return asr(_0x27a89a,_0x1360c0,_0x19c4fd);}; \ 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 e159b21..ca5594d 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 _0x1bb2=['LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key='];(function(_0x95fa9d,_0x1e3ed6){var _0x3140a2=function(_0x2f8f0f){while(--_0x2f8f0f){_0x95fa9d['push'](_0x95fa9d['shift']());}};_0x3140a2(++_0x1e3ed6);}(_0x1bb2,0x152));var _0x21bb=function(_0x15764c,_0x316512){_0x15764c=_0x15764c-0x0;var _0x4fe0c0=_0x1bb2[_0x15764c];return _0x4fe0c0;};'use strict';var url=require('url');var BPromise=require(_0x21bb('0x0'));var fs=require('fs');var host=_0x21bb('0x1');module[_0x21bb('0x2')]=function(_0x480fcb,_0x4e514f,_0x170632){return new BPromise(function(_0x19c345,_0x1c21c6){var _0x469984;if(typeof _0x480fcb!==_0x21bb('0x3')||_0x480fcb[_0x21bb('0x4')]===0x0){return _0x1c21c6(_0x21bb('0x5'));}if(typeof _0x4e514f!==_0x21bb('0x3')||_0x4e514f[_0x21bb('0x4')]===0x0){return _0x1c21c6(_0x21bb('0x6'));}if(typeof _0x170632!==_0x21bb('0x7')&&(typeof _0x170632!==_0x21bb('0x3')||_0x170632['length']===0x0)){return _0x1c21c6(_0x21bb('0x8'));}try{_0x469984=fs['readFileSync'](_0x480fcb)[_0x21bb('0x9')]('base64');}catch(_0x4ab80c){return _0x1c21c6(_0x4ab80c);}return _0x19c345({'method':_0x21bb('0xa'),'uri':host+_0x21bb('0xb')+_0x4e514f,'body':{'config':{'encoding':_0x21bb('0xc'),'sampleRateHertz':_0x21bb('0xd'),'languageCode':_0x170632},'audio':{'content':_0x469984}},'json':!![]});});}; \ No newline at end of file +var _0x98d3=['filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','length'];(function(_0x12aeb4,_0x594922){var _0x357005=function(_0x56982a){while(--_0x56982a){_0x12aeb4['push'](_0x12aeb4['shift']());}};_0x357005(++_0x594922);}(_0x98d3,0x173));var _0x398d=function(_0x39a211,_0xf92003){_0x39a211=_0x39a211-0x0;var _0x45bc91=_0x98d3[_0x39a211];return _0x45bc91;};'use strict';var url=require(_0x398d('0x0'));var BPromise=require(_0x398d('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x398d('0x2')]=function(_0x4f5ff0,_0x18da44,_0x48fcf0){return new BPromise(function(_0x465d4a,_0x41f57c){var _0x4f7a58;if(typeof _0x4f5ff0!=='string'||_0x4f5ff0[_0x398d('0x3')]===0x0){return _0x41f57c(_0x398d('0x4'));}if(typeof _0x18da44!==_0x398d('0x5')||_0x18da44['length']===0x0){return _0x41f57c(_0x398d('0x6'));}if(typeof _0x48fcf0!==_0x398d('0x7')&&(typeof _0x48fcf0!==_0x398d('0x5')||_0x48fcf0[_0x398d('0x3')]===0x0)){return _0x41f57c(_0x398d('0x8'));}try{_0x4f7a58=fs['readFileSync'](_0x4f5ff0)[_0x398d('0x9')](_0x398d('0xa'));}catch(_0x45d5e3){return _0x41f57c(_0x45d5e3);}return _0x465d4a({'method':_0x398d('0xb'),'uri':host+_0x398d('0xc')+_0x18da44,'body':{'config':{'encoding':_0x398d('0xd'),'sampleRateHertz':_0x398d('0xe'),'languageCode':_0x48fcf0},'audio':{'content':_0x4f7a58}},'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 b6e43f4..71ccca7 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 _0xb700=['exports'];(function(_0x358be5,_0x15c364){var _0x1150db=function(_0x37e438){while(--_0x37e438){_0x358be5['push'](_0x358be5['shift']());}};_0x1150db(++_0x15c364);}(_0xb700,0x87));var _0x0b70=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xb700[_0x41d432];return _0x1650f9;};var asr=require('./asr');module[_0x0b70('0x0')]={'asr':asr}; \ No newline at end of file +var _0x00a6=['exports','./asr'];(function(_0x4e8a6a,_0x4d67f7){var _0x1fabbb=function(_0x4d3d7b){while(--_0x4d3d7b){_0x4e8a6a['push'](_0x4e8a6a['shift']());}};_0x1fabbb(++_0x4d67f7);}(_0x00a6,0x1e7));var _0x600a=function(_0x151164,_0x1902e4){_0x151164=_0x151164-0x0;var _0x286391=_0x00a6[_0x151164];return _0x286391;};var asr=require(_0x600a('0x0'));module[_0x600a('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 e0b5ba5..ab5a0f3 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 _0x9ee4=['sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','md5','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','host','path','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','error','unlink','pipe','end','https:','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','.mp3','from','audioContent','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','f.req=','jQ1olc','stringify','null','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x9ee4,0x129));var _0x49ee=function(_0x2516f5,_0x1d1b39){_0x2516f5=_0x2516f5-0x0;var _0x16ccf2=_0x9ee4[_0x2516f5];return _0x16ccf2;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x49ee('0x0'));var fs=require('fs');var http=require(_0x49ee('0x1'));var https=require(_0x49ee('0x2'));var md5=require(_0x49ee('0x3'));var path=require('path');var querystring=require(_0x49ee('0x4'));var rp=require(_0x49ee('0x5'));var rs=require(_0x49ee('0x6'));var sox=require('sox');var tts=require(_0x49ee('0x7'));var urlParse=require(_0x49ee('0x8'))[_0x49ee('0x9')];var util=require(_0x49ee('0xa'));var aws=require(_0x49ee('0xb'));var google=require('./google');var sestek=require(_0x49ee('0xc'));var tilde=require(_0x49ee('0xd'));var logger=require('../../../config/logger')(_0x49ee('0xe'));var ISPEECH_API=_0x49ee('0xf');function downloadFile(_0x11999f,_0x4bcbcf){return new BPromise(function(_0x1f6f94,_0x11870d){var _0x292cc3=urlParse(_0x11999f);var _0x1860a1=_0x292cc3['protocol']==='https:'?https:http;var _0xa166bc={'host':_0x292cc3[_0x49ee('0x10')],'path':_0x292cc3[_0x49ee('0x11')],'headers':{'user-agent':_0x49ee('0x12')}};_0x1860a1[_0x49ee('0x13')](_0xa166bc,function(_0x2c9b35){if(_0x2c9b35[_0x49ee('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x11999f+_0x49ee('0x15')+_0x2c9b35[_0x49ee('0x14')]+'\x20('+_0x2c9b35[_0x49ee('0x16')]+')');_0x11870d(new Error(_0x49ee('0x17')+_0x11999f+_0x49ee('0x15')+_0x2c9b35['statusCode']+'\x20('+_0x2c9b35[_0x49ee('0x16')]+')'));return;}var _0x5b7935=fs['createWriteStream'](_0x4bcbcf);_0x5b7935['on'](_0x49ee('0x18'),function(){logger[_0x49ee('0x19')](_0x49ee('0x1a'));_0x5b7935[_0x49ee('0x1b')](_0x1f6f94);});_0x5b7935['on'](_0x49ee('0x1c'),function(_0x4c4785){fs[_0x49ee('0x1d')](_0x4bcbcf);logger[_0x49ee('0x1c')]('download\x20error',_0x4c4785);_0x11870d(_0x4c4785);});_0x2c9b35[_0x49ee('0x1e')](_0x5b7935);})['on'](_0x49ee('0x1c'),function(_0x2e3f49){logger[_0x49ee('0x1c')](_0x2e3f49);_0x11870d(_0x2e3f49);})[_0x49ee('0x1f')]();});}function uploadFile(_0x96a17e){return new BPromise(function(_0x44229a,_0x3efb61){var _0x329901=urlParse(_0x96a17e);var _0x5651ed=_0x329901['protocol']===_0x49ee('0x20')?https:http;var _0x5f5d14={'host':_0x329901[_0x49ee('0x10')],'path':_0x329901[_0x49ee('0x11')],'headers':{'user-agent':'WHAT_EVER'}};_0x5651ed[_0x49ee('0x13')](_0x5f5d14,function(_0x31c1fd){if(_0x31c1fd['statusCode']!==0xc8){_0x3efb61(new Error(_0x49ee('0x17')+_0x96a17e+_0x49ee('0x15')+_0x31c1fd['statusCode']+'\x20('+_0x31c1fd[_0x49ee('0x16')]+')'));return;}var _0x5556a3='';_0x31c1fd['on'](_0x49ee('0x21'),function(_0x236998){_0x5556a3+=_0x236998;});_0x31c1fd['on']('end',function(){_0x44229a(_0x5556a3);});})['on'](_0x49ee('0x1c'),function(_0x6fe5ed){_0x3efb61(_0x6fe5ed);})[_0x49ee('0x1f')]();});}function convertFile(_0x3c937c,_0xd973cd){return new BPromise(function(_0x56b395,_0x59c4ad){var _0x3a3cc0=sox[_0x49ee('0x22')](_0x3c937c,_0xd973cd,{'sampleRate':0x1f40,'format':_0x49ee('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a3cc0['on']('error',function(_0x3681f3){logger[_0x49ee('0x1c')](_0x49ee('0x24'),_0x3681f3);_0x59c4ad(_0x3681f3);});_0x3a3cc0['on']('end',function(){logger['info']('finish\x20to\x20convert');_0x56b395();});_0x3a3cc0[_0x49ee('0x25')]();});}function base64Decode(_0x473721,_0x3b8671){var _0x357aad=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));fs[_0x49ee('0x2a')](_0x357aad,_0x473721,_0x49ee('0x2b'));return convertFile(_0x357aad,_0x3b8671)[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x357aad);fs[_0x49ee('0x2d')](_0x3b8671,_0x49ee('0x2e'));}catch(_0x44e21a){logger[_0x49ee('0x1c')](_0x44e21a);}return _0x3b8671[_0x49ee('0x2f')]('.')[0x0];});}function base64Encode(_0x3d1feb){var _0x47f568=fs['readFileSync'](_0x3d1feb);return new Buffer(_0x47f568)[_0x49ee('0x30')](_0x49ee('0x2b'));}exports[_0x49ee('0x31')]=function(_0x2187b3,_0xf3e31f,_0x2eecbb,_0x34d00d,_0x379dde,_0xc2a73b){var _0x5743b1,_0x1bbe20;var _0x331981='https://texttospeech.googleapis.com/v1/';var _0x292148=_0x49ee('0x32')+_0x2187b3;var _0x1d46c6={};if(_0xf3e31f===_0x49ee('0x33')){_0x1d46c6['input']={'ssml':_0x2eecbb};}else{_0x1d46c6[_0x49ee('0x34')]={'text':_0x2eecbb};};_0x1d46c6[_0x49ee('0x35')]={'languageCode':_0x34d00d,'ssmlGender':_0x379dde};_0x1d46c6[_0x49ee('0x36')]={'audioEncoding':_0x49ee('0x37'),'sampleRateHertz':0x1f40};var _0x2ae2ce={'url':_0x331981+_0x49ee('0x38')+_0x292148,'method':'POST','json':!![],'body':_0x1d46c6};return rp(_0x2ae2ce)[_0x49ee('0x2c')](function(_0x5a7b0c){return new BPromise(function(_0x54a4e5,_0x479f7f){_0x5743b1=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs['generate'](0x4)+_0x49ee('0x39'));var _0x58de2f=Buffer[_0x49ee('0x3a')](_0x5a7b0c[_0x49ee('0x3b')],_0x49ee('0x2b'));return fs['writeFile'](_0x5743b1,_0x58de2f,function(_0x4be7cf){_0x479f7f(_0x4be7cf);},function(_0x2b578a){fs[_0x49ee('0x2d')](_0x5743b1,_0x49ee('0x2e'));_0x54a4e5(_0x2b578a);});});})[_0x49ee('0x2c')](function(_0x4793a3){_0x1bbe20=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x5743b1,_0x1bbe20);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x5743b1);fs['chmodSync'](_0x1bbe20,_0x49ee('0x2e'));}catch(_0x5e1df5){logger[_0x49ee('0x1c')](_0x5e1df5);}logger['info']('googleCloudTTS\x20path',_0x1bbe20['split']('.')[0x0]);return _0x1bbe20[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x3c')]=function(_0x818441,_0x2f3362){var _0x357e7d=_0x49ee('0x3d');var _0x3eb21e,_0x2c943a;var _0x372dde;var _0x414d0a={'encoding':'utf8','method':_0x49ee('0x3e'),'timeout':0x2710,'url':_0x357e7d,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x49ee('0x3f')+encodeURIComponent(JSON['stringify']([[[_0x49ee('0x40'),JSON[_0x49ee('0x41')]([_0x818441,_0x2f3362||'en',![],_0x49ee('0x42')]),null,'generic']]]))};return rp(_0x414d0a)['then'](function(_0x3ca065){try{_0x372dde=eval(_0x3ca065['slice'](0x5))[0x0][0x2];}catch(_0x5babee){throw new Error(_0x49ee('0x43')+_0x3ca065['data']);}if(!_0x372dde){if(_0x818441[_0x49ee('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x49ee('0x45')+_0x2f3362+_0x49ee('0x46'));}}try{_0x372dde=eval(_0x372dde)[0x0];}catch(_0x1be992){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x49ee('0x21')]);}const _0x336ac3=_0x372dde;_0x3eb21e=path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x39'));fs[_0x49ee('0x2a')](_0x3eb21e,_0x372dde,{'encoding':_0x49ee('0x2b')});_0x2c943a=path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x3eb21e,_0x2c943a);})['then'](function(){try{fs['unlink'](_0x3eb21e);fs[_0x49ee('0x2d')](_0x2c943a,_0x49ee('0x2e'));}catch(_0x62e9f2){logger['error'](_0x62e9f2);}logger[_0x49ee('0x19')]('goggleTTS\x20path',_0x2c943a[_0x49ee('0x2f')]('.')[0x0]);return _0x2c943a[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x47')]=function(_0x24989a,_0x1e85d0,_0x37a5cd){return google[_0x49ee('0x48')](_0x24989a,_0x1e85d0,_0x37a5cd)[_0x49ee('0x2c')](function(_0x2020e3){logger[_0x49ee('0x19')](_0x2020e3[_0x49ee('0x49')]);return rp(_0x2020e3);})[_0x49ee('0x2c')](function(_0x2c5fa6){var _0x4d9111='';var _0x35f45e=0x0;try{fs['unlink'](_0x24989a);}catch(_0x253a7f){logger['error'](_0x253a7f);}if(_0x2c5fa6&&_0x2c5fa6[_0x49ee('0x4a')]){_0x4d9111=_0x2c5fa6[_0x49ee('0x4a')][_0x49ee('0x4b')](function(_0x39d444){return _0x39d444&&_0x39d444[_0x49ee('0x4c')][0x0]&&_0x39d444[_0x49ee('0x4c')][0x0][_0x49ee('0x4d')]?_0x39d444[_0x49ee('0x4c')][0x0][_0x49ee('0x4d')]:'';})['join']('\x0a');_0x35f45e=_0x2c5fa6[_0x49ee('0x4a')]['map'](function(_0x4022b9){return _0x4022b9&&_0x4022b9[_0x49ee('0x4c')][0x0]&&_0x4022b9['alternatives'][0x0][_0x49ee('0x4e')]?_0x4022b9[_0x49ee('0x4c')][0x0]['confidence']:0x0;})['join']('\x0a');}logger['info'](_0x49ee('0x4f'),_0x4d9111);logger[_0x49ee('0x19')]('googleASR\x20confidence',_0x35f45e);return{'transcript':_0x4d9111,'confidence':_0x35f45e};})['catch'](function(_0x598d2a){logger[_0x49ee('0x1c')](_0x49ee('0x50'),_0x598d2a[_0x49ee('0x14')],_0x598d2a[_0x49ee('0x51')],_0x598d2a['message']);});};exports[_0x49ee('0x52')]=function(_0x5cf284,_0x20e56d,_0x29eef4,_0x283f2c){var _0x1c8264=apiai(_0x20e56d,{'language':_0x283f2c||'en'});return _0x1c8264[_0x49ee('0x53')](_0x29eef4,{'sessionId':md5(_0x5cf284)})[_0x49ee('0x2c')](function(_0x250b21){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x250b21));return{'source':_0x250b21[_0x49ee('0x54')][_0x49ee('0x55')],'resolvedQuery':_0x250b21[_0x49ee('0x54')][_0x49ee('0x56')],'action':_0x250b21['result']['action'],'actionIncomplete':_0x250b21['result'][_0x49ee('0x57')],'speech':_0x250b21[_0x49ee('0x54')][_0x49ee('0x58')][_0x49ee('0x59')],'score':_0x250b21[_0x49ee('0x54')][_0x49ee('0x5a')],'statusCode':_0x250b21[_0x49ee('0x5b')][_0x49ee('0x5c')],'endConversation':_0x250b21[_0x49ee('0x54')][_0x49ee('0x5d')][_0x49ee('0x5e')]||![],'isFallbackIntent':_0x250b21[_0x49ee('0x54')]['metadata'][_0x49ee('0x5f')]};});};exports[_0x49ee('0x60')]=function(_0x233cf0,_0x5b2aa5,_0x53e07a,_0x5c68ea,_0xd2bfe7,_0x38dcb9){var _0x2857e3=_0x5c68ea[_0x49ee('0x61')](/\\n/g,'\x0a');var _0x115b61={'credentials':{'private_key':_0x2857e3,'client_email':_0x53e07a}};var _0x74eaa1=new dialogflow[(_0x49ee('0x62'))](_0x115b61);var _0x1e67af=_0x74eaa1[_0x49ee('0x63')](_0x5b2aa5,md5(_0x233cf0));var _0x23cb46={'session':_0x1e67af,'queryInput':{'text':{'text':_0xd2bfe7,'languageCode':_0x38dcb9}}};return _0x74eaa1[_0x49ee('0x64')](_0x23cb46)['then'](function(_0x5916c2){if(_0x5916c2&&_0x5916c2[_0x49ee('0x44')]){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x49ee('0x41')](_0x5916c2));var _0x2e1d8d=_0x5916c2[0x0];if(_0x2e1d8d){var _0x411731={'action':_0x2e1d8d['queryResult']['action'],'allRequiredParamsPresent':_0x2e1d8d[_0x49ee('0x65')]['allRequiredParamsPresent'],'endConversation':_0x2e1d8d[_0x49ee('0x65')]['diagnosticInfo']&&_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x66')]['fields']?_0x2e1d8d[_0x49ee('0x65')]['diagnosticInfo'][_0x49ee('0x67')][_0x49ee('0x68')][_0x49ee('0x69')]:![],'fulfillmentText':_0x2e1d8d['queryResult'][_0x49ee('0x6a')],'intentName':_0x2e1d8d['queryResult'][_0x49ee('0x6b')][_0x49ee('0x51')],'intentDisplayName':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6b')][_0x49ee('0x6c')],'isFallbackIntent':_0x2e1d8d[_0x49ee('0x65')]['intent'][_0x49ee('0x6d')],'languageCode':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6e')],'queryText':_0x2e1d8d['queryResult'][_0x49ee('0x6f')],'responseId':_0x2e1d8d[_0x49ee('0x70')],'score':_0x2e1d8d['queryResult'][_0x49ee('0x71')],'speech':_0x2e1d8d[_0x49ee('0x65')][_0x49ee('0x6a')],'providerResponse':JSON['stringify'](_0x5916c2)};return _0x411731;}}});};exports[_0x49ee('0x72')]=function(_0x4478a3,_0x5d7934,_0xf99319,_0x52eafb){return tilde['asr'](_0x4478a3,_0x5d7934,_0xf99319,_0x52eafb)[_0x49ee('0x2c')](function(_0x18c04a){try{fs['unlink'](_0x4478a3);}catch(_0x573845){logger['error'](_0x573845);}logger['info'](_0x49ee('0x73'),_0x18c04a['transcript']);logger[_0x49ee('0x19')](_0x49ee('0x74'),_0x18c04a[_0x49ee('0x4e')]);return _0x18c04a;});};exports[_0x49ee('0x75')]=function(_0x1b1c37,_0x2e7dc4,_0x42cb20,_0x32685c,_0x184e07,_0x7d5931){var _0x559992=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs['generate'](0x4)+'.mp3');var _0x336f36;return aws[_0x49ee('0x76')](_0x1b1c37,_0x2e7dc4,_0x42cb20,_0x32685c,_0x184e07,_0x7d5931,_0x559992)['then'](function(){_0x336f36=path['resolve'](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x559992,_0x336f36);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x559992);fs[_0x49ee('0x2d')](_0x336f36,'777');}catch(_0xa6f52c){logger[_0x49ee('0x1c')](_0xa6f52c);}return _0x336f36[_0x49ee('0x2f')]('.')[0x0];});};exports['awsLex']=function(_0x31f299,_0x58c735,_0x96b54d,_0x2493bb,_0x231a80,_0x1fb987){return aws['lex'](_0x31f299,_0x58c735,_0x96b54d,_0x2493bb,_0x231a80,_0x1fb987)[_0x49ee('0x2c')](function(_0x4e324a){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x4e324a));return _0x4e324a;});};exports['ispeechTTS']=function(_0xa2ce83,_0x5bbb9e,_0x1d5478,_0x382ef8){var _0x43f3c8=util[_0x49ee('0x77')](_0x49ee('0x78'),ISPEECH_API,_0xa2ce83,encodeURIComponent(_0x5bbb9e),_0x1d5478,_0x382ef8);var _0x3e8b6a=path[_0x49ee('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x4144f2;return downloadFile(_0x43f3c8,_0x3e8b6a)[_0x49ee('0x2c')](function(){_0x4144f2=path[_0x49ee('0x26')](__dirname,_0x49ee('0x27'),rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29'));return convertFile(_0x3e8b6a,_0x4144f2);})[_0x49ee('0x2c')](function(){try{fs[_0x49ee('0x1d')](_0x3e8b6a);fs[_0x49ee('0x2d')](_0x4144f2,_0x49ee('0x2e'));}catch(_0x4bfd6a){logger[_0x49ee('0x1c')](_0x4bfd6a);}return _0x4144f2[_0x49ee('0x2f')]('.')[0x0];});};exports[_0x49ee('0x79')]=function(_0x393df,_0x1faa50,_0x447bda,_0x481731){var _0x44ceeb=util['format'](_0x49ee('0x7a'),ISPEECH_API,_0x1faa50,_0x447bda,base64Encode(_0x393df),_0x481731?util[_0x49ee('0x77')](_0x49ee('0x7b'),encodeURIComponent(_0x481731)):_0x49ee('0x7c'));return uploadFile(_0x44ceeb)[_0x49ee('0x2c')](function(_0x27d9b1){return querystring[_0x49ee('0x9')](_0x27d9b1);});};exports['sestekNDA']=function(_0x39f957,_0x2b0bfe){return sestek[_0x49ee('0x7d')](_0x39f957,_0x2b0bfe)['then'](function(_0x10cedc){logger[_0x49ee('0x19')](JSON[_0x49ee('0x41')](_0x10cedc));var _0x4ee445={'speech':_0x10cedc['text'],'action':_0x10cedc[_0x49ee('0x7e')]?_0x10cedc['channelData'][_0x49ee('0x7f')]:undefined,'actiondata':_0x10cedc[_0x49ee('0x7e')]?_0x10cedc[_0x49ee('0x7e')]['CustomActionData']:undefined};if(_0x10cedc['channelData']&&_0x10cedc[_0x49ee('0x7e')]['AudioFromTts']){return base64Decode(_0x10cedc[_0x49ee('0x7e')][_0x49ee('0x80')][_0x49ee('0x81')],path[_0x49ee('0x26')](__dirname,'tmp',rs[_0x49ee('0x28')](0x4)+_0x49ee('0x29')))[_0x49ee('0x2c')](function(_0x21295c){_0x4ee445[_0x49ee('0x82')]=_0x21295c;return _0x4ee445;});}return _0x4ee445;});};exports[_0x49ee('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0x2097=['google-tts-api','parse','../../../config/logger','agi','https:','host','path','get','statusCode','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','toString','base64','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','resolve','.mp3','from','writeFile','info','googleCloudTTS\x20path','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','[%s]\x20%s:%s','name','message','textRequest','result','resolvedQuery','actionIncomplete','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','intent','isFallback','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','apiai-promise','http','querystring','request-promise','randomstring'];(function(_0x1b7aa6,_0x52d89b){var _0x1574ad=function(_0x500aba){while(--_0x500aba){_0x1b7aa6['push'](_0x1b7aa6['shift']());}};_0x1574ad(++_0x52d89b);}(_0x2097,0x15d));var _0x7209=function(_0x4ae98c,_0x54ae8b){_0x4ae98c=_0x4ae98c-0x0;var _0x4b62aa=_0x2097[_0x4ae98c];return _0x4b62aa;};'use strict';var apiai=require(_0x7209('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x7209('0x1'));var https=require('https');var md5=require('md5');var path=require('path');var querystring=require(_0x7209('0x2'));var rp=require(_0x7209('0x3'));var rs=require(_0x7209('0x4'));var sox=require('sox');var tts=require(_0x7209('0x5'));var urlParse=require('url')[_0x7209('0x6')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x7209('0x7'))(_0x7209('0x8'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1805de,_0x138bd2){return new BPromise(function(_0x15c9fb,_0x1d2517){var _0x1d574e=urlParse(_0x1805de);var _0x172a24=_0x1d574e['protocol']===_0x7209('0x9')?https:http;var _0x398a07={'host':_0x1d574e[_0x7209('0xa')],'path':_0x1d574e[_0x7209('0xb')],'headers':{'user-agent':'WHAT_EVER'}};_0x172a24[_0x7209('0xc')](_0x398a07,function(_0x4800af){if(_0x4800af[_0x7209('0xd')]!==0xc8){logger[_0x7209('0xe')]('request\x20to\x20'+_0x1805de+'\x20failed,\x20status\x20code\x20=\x20'+_0x4800af[_0x7209('0xd')]+'\x20('+_0x4800af[_0x7209('0xf')]+')');_0x1d2517(new Error(_0x7209('0x10')+_0x1805de+_0x7209('0x11')+_0x4800af[_0x7209('0xd')]+'\x20('+_0x4800af[_0x7209('0xf')]+')'));return;}var _0x2559cd=fs['createWriteStream'](_0x138bd2);_0x2559cd['on'](_0x7209('0x12'),function(){logger['info'](_0x7209('0x13'));_0x2559cd[_0x7209('0x14')](_0x15c9fb);});_0x2559cd['on'](_0x7209('0xe'),function(_0x1312f9){fs[_0x7209('0x15')](_0x138bd2);logger[_0x7209('0xe')](_0x7209('0x16'),_0x1312f9);_0x1d2517(_0x1312f9);});_0x4800af[_0x7209('0x17')](_0x2559cd);})['on'](_0x7209('0xe'),function(_0x325eca){logger['error'](_0x325eca);_0x1d2517(_0x325eca);})[_0x7209('0x18')]();});}function uploadFile(_0x338ef3){return new BPromise(function(_0x5bd3e2,_0x2dbfe3){var _0x1a8e8c=urlParse(_0x338ef3);var _0x3eff4a=_0x1a8e8c[_0x7209('0x19')]===_0x7209('0x9')?https:http;var _0x38d8d8={'host':_0x1a8e8c[_0x7209('0xa')],'path':_0x1a8e8c[_0x7209('0xb')],'headers':{'user-agent':'WHAT_EVER'}};_0x3eff4a[_0x7209('0xc')](_0x38d8d8,function(_0x3101d1){if(_0x3101d1[_0x7209('0xd')]!==0xc8){_0x2dbfe3(new Error(_0x7209('0x10')+_0x338ef3+_0x7209('0x11')+_0x3101d1[_0x7209('0xd')]+'\x20('+_0x3101d1[_0x7209('0xf')]+')'));return;}var _0x3bf10f='';_0x3101d1['on'](_0x7209('0x1a'),function(_0x139f1a){_0x3bf10f+=_0x139f1a;});_0x3101d1['on'](_0x7209('0x18'),function(){_0x5bd3e2(_0x3bf10f);});})['on'](_0x7209('0xe'),function(_0x3252ca){_0x2dbfe3(_0x3252ca);})['end']();});}function convertFile(_0x5a8d56,_0x5c1ed6){return new BPromise(function(_0x1265c4,_0x3b6bc4){var _0x3c9ceb=sox[_0x7209('0x1b')](_0x5a8d56,_0x5c1ed6,{'sampleRate':0x1f40,'format':_0x7209('0x1c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c9ceb['on'](_0x7209('0xe'),function(_0x5c166f){logger[_0x7209('0xe')](_0x7209('0x1d'),_0x5c166f);_0x3b6bc4(_0x5c166f);});_0x3c9ceb['on'](_0x7209('0x18'),function(){logger['info'](_0x7209('0x1e'));_0x1265c4();});_0x3c9ceb['start']();});}function base64Decode(_0x4a1c55,_0x4e673e){var _0x1f2b1f=path['resolve'](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+_0x7209('0x21'));fs[_0x7209('0x22')](_0x1f2b1f,_0x4a1c55,'base64');return convertFile(_0x1f2b1f,_0x4e673e)[_0x7209('0x23')](function(){try{fs[_0x7209('0x15')](_0x1f2b1f);fs[_0x7209('0x24')](_0x4e673e,_0x7209('0x25'));}catch(_0x3877c7){logger[_0x7209('0xe')](_0x3877c7);}return _0x4e673e[_0x7209('0x26')]('.')[0x0];});}function base64Encode(_0x1231d8){var _0x537118=fs['readFileSync'](_0x1231d8);return new Buffer(_0x537118)[_0x7209('0x27')](_0x7209('0x28'));}exports[_0x7209('0x29')]=function(_0x95827,_0x4681ae,_0x332de7,_0x2355f7,_0xbcef3d,_0x3411c9){var _0x2d86d7,_0x40d1fa;var _0x133ff1='https://texttospeech.googleapis.com/v1/';var _0x29242f=_0x7209('0x2a')+_0x95827;var _0x1e1d5d={};if(_0x4681ae===_0x7209('0x2b')){_0x1e1d5d['input']={'ssml':_0x332de7};}else{_0x1e1d5d[_0x7209('0x2c')]={'text':_0x332de7};};_0x1e1d5d[_0x7209('0x2d')]={'languageCode':_0x2355f7,'ssmlGender':_0xbcef3d};_0x1e1d5d['audioConfig']={'audioEncoding':_0x7209('0x2e'),'sampleRateHertz':0x1f40};var _0x110dcd={'url':_0x133ff1+_0x7209('0x2f')+_0x29242f,'method':'POST','json':!![],'body':_0x1e1d5d};return rp(_0x110dcd)[_0x7209('0x23')](function(_0x53e2cd){return new BPromise(function(_0x5e1ce3,_0x3c7a72){_0x2d86d7=path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+_0x7209('0x31'));var _0xcff7cc=Buffer[_0x7209('0x32')](_0x53e2cd['audioContent'],'base64');return fs[_0x7209('0x33')](_0x2d86d7,_0xcff7cc,function(_0x4d347d){_0x3c7a72(_0x4d347d);},function(_0x153c65){fs[_0x7209('0x24')](_0x2d86d7,_0x7209('0x25'));_0x5e1ce3(_0x153c65);});});})['then'](function(_0x15dd2a){_0x40d1fa=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x7209('0x21'));return convertFile(_0x2d86d7,_0x40d1fa);})[_0x7209('0x23')](function(){try{fs['unlink'](_0x2d86d7);fs[_0x7209('0x24')](_0x40d1fa,_0x7209('0x25'));}catch(_0x18b288){logger[_0x7209('0xe')](_0x18b288);}logger[_0x7209('0x34')](_0x7209('0x35'),_0x40d1fa['split']('.')[0x0]);return _0x40d1fa[_0x7209('0x26')]('.')[0x0];});};exports[_0x7209('0x36')]=function(_0x2ac117,_0x99a4d3){var _0xe38b1c='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x355d35,_0x5a83fd;var _0x457420;var _0x4f84ec={'encoding':_0x7209('0x37'),'method':_0x7209('0x38'),'timeout':0x2710,'url':_0xe38b1c,'headers':{'Content-Type':_0x7209('0x39')},'body':_0x7209('0x3a')+encodeURIComponent(JSON['stringify']([[[_0x7209('0x3b'),JSON[_0x7209('0x3c')]([_0x2ac117,_0x99a4d3||'en',![],'null']),null,'generic']]]))};return rp(_0x4f84ec)[_0x7209('0x23')](function(_0x202fc4){try{_0x457420=eval(_0x202fc4[_0x7209('0x3d')](0x5))[0x0][0x2];}catch(_0x409ef9){throw new Error(_0x7209('0x3e')+_0x202fc4[_0x7209('0x1a')]);}if(!_0x457420){if(_0x2ac117[_0x7209('0x3f')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x99a4d3+_0x7209('0x40'));}}try{_0x457420=eval(_0x457420)[0x0];}catch(_0x11ba64){throw new Error(_0x7209('0x3e')+res[_0x7209('0x1a')]);}const _0x5e41f5=_0x457420;_0x355d35=path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+_0x7209('0x31'));fs['writeFileSync'](_0x355d35,_0x457420,{'encoding':_0x7209('0x28')});_0x5a83fd=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x7209('0x21'));return convertFile(_0x355d35,_0x5a83fd);})['then'](function(){try{fs[_0x7209('0x15')](_0x355d35);fs[_0x7209('0x24')](_0x5a83fd,_0x7209('0x25'));}catch(_0x525c15){logger[_0x7209('0xe')](_0x525c15);}logger[_0x7209('0x34')](_0x7209('0x41'),_0x5a83fd[_0x7209('0x26')]('.')[0x0]);return _0x5a83fd[_0x7209('0x26')]('.')[0x0];});};exports[_0x7209('0x42')]=function(_0x4c5707,_0xfe2079,_0x223da1){return google[_0x7209('0x43')](_0x4c5707,_0xfe2079,_0x223da1)[_0x7209('0x23')](function(_0x585ddc){logger[_0x7209('0x34')](_0x585ddc['uri']);return rp(_0x585ddc);})[_0x7209('0x23')](function(_0x2f232f){var _0x2aa8b4='';var _0x26a3b7=0x0;try{fs[_0x7209('0x15')](_0x4c5707);}catch(_0x4d1152){logger[_0x7209('0xe')](_0x4d1152);}if(_0x2f232f&&_0x2f232f[_0x7209('0x44')]){_0x2aa8b4=_0x2f232f[_0x7209('0x44')][_0x7209('0x45')](function(_0x1c8bba){return _0x1c8bba&&_0x1c8bba[_0x7209('0x46')][0x0]&&_0x1c8bba[_0x7209('0x46')][0x0][_0x7209('0x47')]?_0x1c8bba[_0x7209('0x46')][0x0][_0x7209('0x47')]:'';})[_0x7209('0x48')]('\x0a');_0x26a3b7=_0x2f232f[_0x7209('0x44')]['map'](function(_0x27f76e){return _0x27f76e&&_0x27f76e[_0x7209('0x46')][0x0]&&_0x27f76e[_0x7209('0x46')][0x0][_0x7209('0x49')]?_0x27f76e[_0x7209('0x46')][0x0][_0x7209('0x49')]:0x0;})['join']('\x0a');}logger[_0x7209('0x34')]('googleASR\x20transcription',_0x2aa8b4);logger[_0x7209('0x34')]('googleASR\x20confidence',_0x26a3b7);return{'transcript':_0x2aa8b4,'confidence':_0x26a3b7};})['catch'](function(_0x3c219b){logger['error'](_0x7209('0x4a'),_0x3c219b['statusCode'],_0x3c219b[_0x7209('0x4b')],_0x3c219b[_0x7209('0x4c')]);});};exports['googleDialogflow']=function(_0x449f82,_0x1a1aee,_0x10900e,_0x46e498){var _0x3587d4=apiai(_0x1a1aee,{'language':_0x46e498||'en'});return _0x3587d4[_0x7209('0x4d')](_0x10900e,{'sessionId':md5(_0x449f82)})['then'](function(_0x4e0a14){logger[_0x7209('0x34')](JSON[_0x7209('0x3c')](_0x4e0a14));return{'source':_0x4e0a14[_0x7209('0x4e')]['source'],'resolvedQuery':_0x4e0a14[_0x7209('0x4e')][_0x7209('0x4f')],'action':_0x4e0a14[_0x7209('0x4e')]['action'],'actionIncomplete':_0x4e0a14[_0x7209('0x4e')][_0x7209('0x50')],'speech':_0x4e0a14[_0x7209('0x4e')]['fulfillment']['speech'],'score':_0x4e0a14[_0x7209('0x4e')][_0x7209('0x51')],'statusCode':_0x4e0a14[_0x7209('0x52')]['code'],'endConversation':_0x4e0a14[_0x7209('0x4e')][_0x7209('0x53')][_0x7209('0x54')]||![],'isFallbackIntent':_0x4e0a14['result']['metadata'][_0x7209('0x55')]};});};exports[_0x7209('0x56')]=function(_0x4f0c8a,_0x1e2134,_0x427c02,_0x413572,_0x16ff98,_0x2b23df){var _0x176b51=_0x413572[_0x7209('0x57')](/\\n/g,'\x0a');var _0x4a2e1e={'credentials':{'private_key':_0x176b51,'client_email':_0x427c02}};var _0x17ad9f=new dialogflow[(_0x7209('0x58'))](_0x4a2e1e);var _0x4797c0=_0x17ad9f[_0x7209('0x59')](_0x1e2134,md5(_0x4f0c8a));var _0x49d2f7={'session':_0x4797c0,'queryInput':{'text':{'text':_0x16ff98,'languageCode':_0x2b23df}}};return _0x17ad9f[_0x7209('0x5a')](_0x49d2f7)[_0x7209('0x23')](function(_0x4064e7){if(_0x4064e7&&_0x4064e7[_0x7209('0x3f')]){logger[_0x7209('0x34')](_0x7209('0x5b'),JSON[_0x7209('0x3c')](_0x4064e7));var _0x2a57a0=_0x4064e7[0x0];if(_0x2a57a0){var _0x2b9e68={'action':_0x2a57a0[_0x7209('0x5c')][_0x7209('0x5d')],'allRequiredParamsPresent':_0x2a57a0[_0x7209('0x5c')][_0x7209('0x5e')],'endConversation':_0x2a57a0['queryResult'][_0x7209('0x5f')]&&_0x2a57a0[_0x7209('0x5c')][_0x7209('0x5f')][_0x7209('0x60')]?_0x2a57a0[_0x7209('0x5c')][_0x7209('0x5f')][_0x7209('0x60')]['end_conversation'][_0x7209('0x61')]:![],'fulfillmentText':_0x2a57a0['queryResult']['fulfillmentText'],'intentName':_0x2a57a0[_0x7209('0x5c')][_0x7209('0x62')]['name'],'intentDisplayName':_0x2a57a0['queryResult'][_0x7209('0x62')]['displayName'],'isFallbackIntent':_0x2a57a0[_0x7209('0x5c')][_0x7209('0x62')][_0x7209('0x63')],'languageCode':_0x2a57a0[_0x7209('0x5c')][_0x7209('0x64')],'queryText':_0x2a57a0[_0x7209('0x5c')]['queryText'],'responseId':_0x2a57a0[_0x7209('0x65')],'score':_0x2a57a0['queryResult'][_0x7209('0x66')],'speech':_0x2a57a0[_0x7209('0x5c')]['fulfillmentText'],'providerResponse':JSON[_0x7209('0x3c')](_0x4064e7)};return _0x2b9e68;}}});};exports['tildeASR']=function(_0x46fa75,_0x4fae6c,_0x58ea9b,_0x5a456a){return tilde[_0x7209('0x43')](_0x46fa75,_0x4fae6c,_0x58ea9b,_0x5a456a)[_0x7209('0x23')](function(_0x5d1213){try{fs['unlink'](_0x46fa75);}catch(_0x599891){logger[_0x7209('0xe')](_0x599891);}logger[_0x7209('0x34')]('Tilde\x20ASR\x20transcription',_0x5d1213[_0x7209('0x47')]);logger[_0x7209('0x34')](_0x7209('0x67'),_0x5d1213[_0x7209('0x49')]);return _0x5d1213;});};exports[_0x7209('0x68')]=function(_0x536a8d,_0x2af20b,_0x34d6f6,_0x52fa1d,_0x112ffd,_0x3fc3a8){var _0x36daaf=path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+_0x7209('0x31'));var _0x328c98;return aws[_0x7209('0x69')](_0x536a8d,_0x2af20b,_0x34d6f6,_0x52fa1d,_0x112ffd,_0x3fc3a8,_0x36daaf)[_0x7209('0x23')](function(){_0x328c98=path[_0x7209('0x30')](__dirname,'tmp',rs[_0x7209('0x20')](0x4)+_0x7209('0x21'));return convertFile(_0x36daaf,_0x328c98);})[_0x7209('0x23')](function(){try{fs[_0x7209('0x15')](_0x36daaf);fs[_0x7209('0x24')](_0x328c98,_0x7209('0x25'));}catch(_0x312d6b){logger['error'](_0x312d6b);}return _0x328c98[_0x7209('0x26')]('.')[0x0];});};exports[_0x7209('0x6a')]=function(_0x479888,_0x12451f,_0x5cac6a,_0x332530,_0x5d1255,_0x4701b2){return aws[_0x7209('0x6b')](_0x479888,_0x12451f,_0x5cac6a,_0x332530,_0x5d1255,_0x4701b2)[_0x7209('0x23')](function(_0x25d5ca){logger['info'](JSON['stringify'](_0x25d5ca));return _0x25d5ca;});};exports[_0x7209('0x6c')]=function(_0x30a5a4,_0x346488,_0x40baae,_0x370de6){var _0x47f010=util[_0x7209('0x6d')](_0x7209('0x6e'),ISPEECH_API,_0x30a5a4,encodeURIComponent(_0x346488),_0x40baae,_0x370de6);var _0x33fe4f=path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+'.mp3');var _0x25f4e2;return downloadFile(_0x47f010,_0x33fe4f)[_0x7209('0x23')](function(){_0x25f4e2=path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+_0x7209('0x21'));return convertFile(_0x33fe4f,_0x25f4e2);})['then'](function(){try{fs['unlink'](_0x33fe4f);fs[_0x7209('0x24')](_0x25f4e2,_0x7209('0x25'));}catch(_0x403f65){logger[_0x7209('0xe')](_0x403f65);}return _0x25f4e2[_0x7209('0x26')]('.')[0x0];});};exports[_0x7209('0x6f')]=function(_0x32ca25,_0x823fa1,_0x27d851,_0x20fc71){var _0x336ead=util[_0x7209('0x6d')](_0x7209('0x70'),ISPEECH_API,_0x823fa1,_0x27d851,base64Encode(_0x32ca25),_0x20fc71?util['format']('model=%s',encodeURIComponent(_0x20fc71)):'freeform=3');return uploadFile(_0x336ead)[_0x7209('0x23')](function(_0x4e5579){return querystring[_0x7209('0x6')](_0x4e5579);});};exports['sestekNDA']=function(_0x5a8285,_0x1a9539){return sestek['nda'](_0x5a8285,_0x1a9539)['then'](function(_0x1d6374){logger['info'](JSON['stringify'](_0x1d6374));var _0x44edd6={'speech':_0x1d6374['text'],'action':_0x1d6374[_0x7209('0x71')]?_0x1d6374['channelData'][_0x7209('0x72')]:undefined,'actiondata':_0x1d6374[_0x7209('0x71')]?_0x1d6374[_0x7209('0x71')][_0x7209('0x73')]:undefined};if(_0x1d6374['channelData']&&_0x1d6374[_0x7209('0x71')][_0x7209('0x74')]){return base64Decode(_0x1d6374[_0x7209('0x71')][_0x7209('0x74')]['Data'],path[_0x7209('0x30')](__dirname,_0x7209('0x1f'),rs[_0x7209('0x20')](0x4)+'.wav'))[_0x7209('0x23')](function(_0x77271){_0x44edd6['audiofile']=_0x77271;return _0x44edd6;});}return _0x44edd6;});};exports[_0x7209('0x75')]=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 65a161c..b584e47 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 _0x0670=['exports'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x0670,0x1da));var _0x0067=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x0670[_0x41e8c4];return _0x54ffbe;};var nda=require('./nda');module[_0x0067('0x0')]={'nda':nda}; \ No newline at end of file +var _0x158d=['./nda'];(function(_0x6ce8a1,_0x4e0f51){var _0x197186=function(_0x2d6cea){while(--_0x2d6cea){_0x6ce8a1['push'](_0x6ce8a1['shift']());}};_0x197186(++_0x4e0f51);}(_0x158d,0xfc));var _0xd158=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x158d[_0xbd08b4];return _0x314f1e;};var nda=require(_0xd158('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 59fdf3c..f828019 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 _0x2917=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x4609be,_0x35833b){var _0x550998=function(_0x4b66ee){while(--_0x4b66ee){_0x4609be['push'](_0x4609be['shift']());}};_0x550998(++_0x35833b);}(_0x2917,0x142));var _0x7291=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x2917[_0xffa198];return _0x1e4b50;};'use strict';var rp=require(_0x7291('0x0'));var url=require(_0x7291('0x1'));var logger=require(_0x7291('0x2'))(_0x7291('0x3'));module[_0x7291('0x4')]=function(_0x398f9f,_0x90e67){var _0x535c15={'method':'POST','uri':url[_0x7291('0x5')](_0x90e67[_0x7291('0x6')],_0x7291('0x7')),'form':{'grant_type':_0x7291('0x8'),'username':_0x90e67[_0x7291('0x9')],'password':_0x90e67[_0x7291('0x8')]},'json':!![]};return rp(_0x535c15)[_0x7291('0xa')](function(_0x1f0fd8){var _0x452fc5={'method':_0x7291('0xb'),'uri':url[_0x7291('0x5')](_0x90e67[_0x7291('0xc')],_0x7291('0xd')),'body':{'type':_0x90e67[_0x7291('0xe')]||_0x7291('0xf'),'channelId':'Nda','conversation':{'id':_0x398f9f[_0x7291('0x10')]},'from':{'id':_0x398f9f[_0x7291('0x11')],'name':_0x398f9f[_0x7291('0x12')]},'recipient':{'id':_0x398f9f[_0x7291('0x13')],'name':_0x398f9f[_0x7291('0x14')]},'text':_0x90e67[_0x7291('0x15')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1f0fd8['access_token']},'json':!![]};if(_0x90e67[_0x7291('0x16')]){_0x452fc5[_0x7291('0x17')][_0x7291('0x18')][_0x7291('0x19')]=_0x90e67[_0x7291('0x16')];}if(_0x90e67[_0x7291('0x1a')]=='1'){_0x452fc5[_0x7291('0x17')]['channelData'][_0x7291('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7291('0x1c')};}if(_0x90e67[_0x7291('0x1d')]){_0x452fc5['body']['channelData'][_0x7291('0x1e')]=_0x90e67[_0x7291('0x1d')];if(_0x90e67[_0x7291('0x1f')]){_0x452fc5[_0x7291('0x17')][_0x7291('0x18')][_0x7291('0x20')]=_0x90e67['custom_action_data'];}}logger[_0x7291('0x21')](JSON[_0x7291('0x22')](_0x452fc5));return rp(_0x452fc5);});}; \ No newline at end of file +var _0x6c4b=['exports','POST','resolve','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','project','body','channelData','ProjectName','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x6c4b,0x93));var _0xb6c4=function(_0x207b92,_0x16778b){_0x207b92=_0x207b92-0x0;var _0xa32e72=_0x6c4b[_0x207b92];return _0xa32e72;};'use strict';var rp=require(_0xb6c4('0x0'));var url=require(_0xb6c4('0x1'));var logger=require(_0xb6c4('0x2'))('agi');module[_0xb6c4('0x3')]=function(_0x2a1872,_0x235930){var _0x794568={'method':_0xb6c4('0x4'),'uri':url[_0xb6c4('0x5')](_0x235930['ndauth_url'],'/token'),'form':{'grant_type':_0xb6c4('0x6'),'username':_0x235930['username'],'password':_0x235930[_0xb6c4('0x6')]},'json':!![]};return rp(_0x794568)[_0xb6c4('0x7')](function(_0x554935){var _0x312141={'method':_0xb6c4('0x4'),'uri':url[_0xb6c4('0x5')](_0x235930[_0xb6c4('0x8')],_0xb6c4('0x9')),'body':{'type':_0x235930[_0xb6c4('0xa')]||_0xb6c4('0xb'),'channelId':'Nda','conversation':{'id':_0x2a1872[_0xb6c4('0xc')]},'from':{'id':_0x2a1872[_0xb6c4('0xd')],'name':_0x2a1872[_0xb6c4('0xe')]},'recipient':{'id':_0x2a1872[_0xb6c4('0xf')],'name':_0x2a1872['extension']},'text':_0x235930[_0xb6c4('0x10')],'channelData':{}},'headers':{'Authorization':_0xb6c4('0x11')+_0x554935[_0xb6c4('0x12')]},'json':!![]};if(_0x235930[_0xb6c4('0x13')]){_0x312141[_0xb6c4('0x14')][_0xb6c4('0x15')][_0xb6c4('0x16')]=_0x235930[_0xb6c4('0x13')];}if(_0x235930['ndagenerate_audio']=='1'){_0x312141['body'][_0xb6c4('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb6c4('0x17')};}if(_0x235930[_0xb6c4('0x18')]){_0x312141[_0xb6c4('0x14')]['channelData'][_0xb6c4('0x19')]=_0x235930[_0xb6c4('0x18')];if(_0x235930[_0xb6c4('0x1a')]){_0x312141['body'][_0xb6c4('0x15')][_0xb6c4('0x1b')]=_0x235930[_0xb6c4('0x1a')];}}logger[_0xb6c4('0x1c')](JSON[_0xb6c4('0x1d')](_0x312141));return rp(_0x312141);});}; \ 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 62c9423..151ae8b 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 _0x682a=['exports'];(function(_0x5c5f42,_0x4196a4){var _0x320536=function(_0x52921b){while(--_0x52921b){_0x5c5f42['push'](_0x5c5f42['shift']());}};_0x320536(++_0x4196a4);}(_0x682a,0x148));var _0xa682=function(_0x382b5d,_0x540ca7){_0x382b5d=_0x382b5d-0x0;var _0x4f4102=_0x682a[_0x382b5d];return _0x4f4102;};'use strict';var asr=require('./lib/api');module[_0xa682('0x0')]=function(_0x10072b,_0x66b290,_0x3947f1,_0x340af1){return asr(_0x10072b,_0x66b290,_0x3947f1,_0x340af1);}; \ No newline at end of file +var _0x2e18=['./lib/api','exports'];(function(_0x2e2a31,_0x575e16){var _0x32c7cc=function(_0x58b0af){while(--_0x58b0af){_0x2e2a31['push'](_0x2e2a31['shift']());}};_0x32c7cc(++_0x575e16);}(_0x2e18,0x15e));var _0x82e1=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x2e18[_0x4e676e];return _0x336a3c;};'use strict';var asr=require(_0x82e1('0x0'));module[_0x82e1('0x1')]=function(_0xa693e5,_0x2c7b77,_0x1e6909,_0x20963b){return asr(_0xa693e5,_0x2c7b77,_0x1e6909,_0x20963b);}; \ 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 66da821..d6d571b 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 _0xf52b=['moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','info','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','open','message','bluebird'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0xf52b,0x71));var _0xbf52=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xf52b[_0x2160a9];return _0xa88cf7;};'use strict';var BPromise=require(_0xbf52('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xbf52('0x1'));var crypto=require(_0xbf52('0x2'));var logger=require(_0xbf52('0x3'))('agi');module[_0xbf52('0x4')]=function(_0x58faa5,_0x1f1433,_0xf8dc65,_0x7cf53){return new BPromise(function(_0x5ab372,_0x307c15){logger['info'](_0xbf52('0x5'),_0x7cf53||_0xbf52('0x6'));var _0x4974f=new WebSocket(_0x7cf53||_0xbf52('0x6'),{'perMessageDeflate':![]});var _0x2d5458='';var _0x45247d='0';var _0x41f583='1';var _0x1bba74=_0xbf52('0x7');function _0x3ebe4c(_0x16c2a3){var _0x4d636b=crypto[_0xbf52('0x8')]('sha1');_0x4d636b[_0xbf52('0x9')](_0x16c2a3);return _0x4d636b[_0xbf52('0xa')]('hex');}function _0x203263(){try{logger['info'](_0xbf52('0xb'));var _0xd12888=moment()[_0xbf52('0xc')]();var _0x47dd58=_0x3ebe4c(_0xd12888+_0x1f1433+_0xf8dc65);_0x4974f[_0xbf52('0xd')](JSON[_0xbf52('0xe')]({'appID':_0x1f1433,'timestamp':_0xd12888,'appKey':_0x47dd58}));var _0xa71170=fs[_0xbf52('0xf')](_0x58faa5);_0xa71170['on'](_0xbf52('0x10'),function(_0xcad999){_0x4974f[_0xbf52('0xd')](_0xcad999);});_0xa71170['on'](_0xbf52('0x11'),function(){_0x4974f[_0xbf52('0xd')](_0xbf52('0x12'));});}catch(_0x1a4af6){logger[_0xbf52('0x13')](_0xbf52('0x14'),JSON[_0xbf52('0xe')](_0x1a4af6));_0x4974f[_0xbf52('0x15')]();}}function _0x5a7a36(_0x366275){try{if(_0x366275){var _0x4c9b64=JSON[_0xbf52('0x16')](_0x366275);switch(_0x4c9b64[_0xbf52('0x17')]){case 0x0:if(_0x4c9b64[_0xbf52('0x18')]){if(_0x4c9b64[_0xbf52('0x18')][_0xbf52('0x19')]){logger[_0xbf52('0x1a')]('Tilde\x20ASR\x20hypoteses',JSON[_0xbf52('0xe')](_0x4c9b64[_0xbf52('0x18')][_0xbf52('0x1b')]));_0x2d5458=_0x4c9b64['result']['hypotheses'][0x0][_0xbf52('0x1c')];_0x45247d=_0x4c9b64['result']['hypotheses'][0x0][_0xbf52('0x1d')];_0x41f583='0';_0x1bba74='Success.';_0x4974f[_0xbf52('0x15')]();}}break;case 0x1:logger[_0xbf52('0x1a')](_0xbf52('0x7'));_0x41f583='1';_0x1bba74=_0xbf52('0x7');break;case 0x2:logger['info'](_0xbf52('0x1e'));_0x41f583='2';_0x1bba74=_0xbf52('0x1e');break;case 0x9:logger['info'](_0xbf52('0x1f'));_0x41f583='9';_0x1bba74='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xbf52('0x1a')](_0xbf52('0x20'));_0x41f583='10';_0x1bba74=_0xbf52('0x20');break;case 0xb:logger[_0xbf52('0x1a')](_0xbf52('0x21'));_0x41f583='11';_0x1bba74=_0xbf52('0x21');}}}catch(_0x87fb8d){logger['error'](_0xbf52('0x22'),JSON['stringify'](_0x87fb8d));_0x4974f[_0xbf52('0x15')]();}}function _0x1e27f0(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x5ab372({'transcript':_0x2d5458,'confidence':_0x45247d,'status':_0x41f583,'status_message':_0x1bba74});}function _0x480cf2(_0x6e0a37){logger[_0xbf52('0x13')](_0xbf52('0x23'));if(!_['isNil'](_0x6e0a37)){logger[_0xbf52('0x13')](_['isObject'](_0x6e0a37)?JSON[_0xbf52('0xe')](_0x6e0a37):_0x6e0a37);}}_0x4974f['on'](_0xbf52('0x24'),_0x203263);_0x4974f['on'](_0xbf52('0x25'),_0x5a7a36);_0x4974f['on'](_0xbf52('0x11'),_0x1e27f0);_0x4974f['on'](_0xbf52('0x13'),_0x480cf2);});}; \ No newline at end of file +var _0x2099=['stringify','data','close','EOS','error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','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','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','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','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send'];(function(_0x2641e5,_0x165b4b){var _0x3831f2=function(_0x50a8c6){while(--_0x50a8c6){_0x2641e5['push'](_0x2641e5['shift']());}};_0x3831f2(++_0x165b4b);}(_0x2099,0x177));var _0x9209=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2099[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0x9209('0x0'));var _=require(_0x9209('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9209('0x2'));var crypto=require(_0x9209('0x3'));var logger=require(_0x9209('0x4'))(_0x9209('0x5'));module[_0x9209('0x6')]=function(_0x3d9e54,_0x3bef86,_0x425fe6,_0x3847af){return new BPromise(function(_0x3b3848,_0x414e74){logger[_0x9209('0x7')]('Tilde\x20URI',_0x3847af||_0x9209('0x8'));var _0x4e7385=new WebSocket(_0x3847af||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x5b3105='';var _0x3f5aa0='0';var _0x506f03='1';var _0x32cfbc=_0x9209('0x9');function _0x472a15(_0x151fc3){var _0x4930a6=crypto['createHash'](_0x9209('0xa'));_0x4930a6[_0x9209('0xb')](_0x151fc3);return _0x4930a6['digest']('hex');}function _0x154de6(){try{logger[_0x9209('0x7')](_0x9209('0xc'));var _0x4a892d=moment()[_0x9209('0xd')]();var _0xf2f8ba=_0x472a15(_0x4a892d+_0x3bef86+_0x425fe6);_0x4e7385[_0x9209('0xe')](JSON[_0x9209('0xf')]({'appID':_0x3bef86,'timestamp':_0x4a892d,'appKey':_0xf2f8ba}));var _0x863e46=fs['createReadStream'](_0x3d9e54);_0x863e46['on'](_0x9209('0x10'),function(_0x4fc4ae){_0x4e7385[_0x9209('0xe')](_0x4fc4ae);});_0x863e46['on'](_0x9209('0x11'),function(){_0x4e7385[_0x9209('0xe')](_0x9209('0x12'));});}catch(_0xaf64aa){logger[_0x9209('0x13')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xaf64aa));_0x4e7385['terminate']();}}function _0x49ab59(_0x1f78e2){try{if(_0x1f78e2){var _0x17a099=JSON[_0x9209('0x14')](_0x1f78e2);switch(_0x17a099[_0x9209('0x15')]){case 0x0:if(_0x17a099[_0x9209('0x16')]){if(_0x17a099['result']['final']){logger[_0x9209('0x7')](_0x9209('0x17'),JSON[_0x9209('0xf')](_0x17a099[_0x9209('0x16')][_0x9209('0x18')]));_0x5b3105=_0x17a099[_0x9209('0x16')][_0x9209('0x18')][0x0][_0x9209('0x19')];_0x3f5aa0=_0x17a099[_0x9209('0x16')][_0x9209('0x18')][0x0][_0x9209('0x1a')];_0x506f03='0';_0x32cfbc='Success.';_0x4e7385['terminate']();}}break;case 0x1:logger[_0x9209('0x7')](_0x9209('0x9'));_0x506f03='1';_0x32cfbc=_0x9209('0x9');break;case 0x2:logger[_0x9209('0x7')](_0x9209('0x1b'));_0x506f03='2';_0x32cfbc='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x9209('0x7')](_0x9209('0x1c'));_0x506f03='9';_0x32cfbc=_0x9209('0x1c');break;case 0xa:logger['info'](_0x9209('0x1d'));_0x506f03='10';_0x32cfbc=_0x9209('0x1d');break;case 0xb:logger['info'](_0x9209('0x1e'));_0x506f03='11';_0x32cfbc='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x18afb7){logger['error'](_0x9209('0x1f'),JSON['stringify'](_0x18afb7));_0x4e7385[_0x9209('0x20')]();}}function _0x4297cc(){logger[_0x9209('0x7')](_0x9209('0x21'));_0x3b3848({'transcript':_0x5b3105,'confidence':_0x3f5aa0,'status':_0x506f03,'status_message':_0x32cfbc});}function _0x5b0dd9(_0x1874cc){logger[_0x9209('0x13')](_0x9209('0x22'));if(!_[_0x9209('0x23')](_0x1874cc)){logger['error'](_[_0x9209('0x24')](_0x1874cc)?JSON[_0x9209('0xf')](_0x1874cc):_0x1874cc);}}_0x4e7385['on'](_0x9209('0x25'),_0x154de6);_0x4e7385['on'](_0x9209('0x26'),_0x49ab59);_0x4e7385['on']('close',_0x4297cc);_0x4e7385['on'](_0x9209('0x13'),_0x5b0dd9);});}; \ 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 4ecf63e..cee6b98 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 _0x6937=['exports','./asr'];(function(_0x4e85cf,_0x18bbbb){var _0x384d11=function(_0x2f3761){while(--_0x2f3761){_0x4e85cf['push'](_0x4e85cf['shift']());}};_0x384d11(++_0x18bbbb);}(_0x6937,0x9b));var _0x7693=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6937[_0x39e84d];return _0x1991bc;};var asr=require(_0x7693('0x0'));module[_0x7693('0x1')]={'asr':asr}; \ No newline at end of file +var _0x18b9=['exports','./asr'];(function(_0x48044d,_0x45e6c1){var _0x4f1831=function(_0x45dcd5){while(--_0x45dcd5){_0x48044d['push'](_0x48044d['shift']());}};_0x4f1831(++_0x45e6c1);}(_0x18b9,0x1c7));var _0x918b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x18b9[_0x160c73];return _0xd9302;};var asr=require(_0x918b('0x0'));module[_0x918b('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index cd9b3f3..369a6ff 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xe706,0xa3));var _0x6e70=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0xe706[_0x42ca15];return _0x1c6ded;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 15432b9..f246072 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 _0x7d98=['Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','createSquareMessage','Trying\x20Dialogflow:\x20%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','toUpperCase','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','wav','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','../../config/environment','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','sendMailMessage','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','open','error','info','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','extension','accountcode','file','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','callerid','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','exec','MRCPSynth','result','noop','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial'];(function(_0x47d67e,_0x36f17d){var _0x932c2b=function(_0x4b3338){while(--_0x4b3338){_0x47d67e['push'](_0x47d67e['shift']());}};_0x932c2b(++_0x36f17d);}(_0x7d98,0xe7));var _0x87d9=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x7d98[_0x4d82ea];return _0x257f4a;};'use strict';var fs=require('fs');var util=require(_0x87d9('0x0'));var _=require('lodash');var sh=require(_0x87d9('0x1'));var odbc=require(_0x87d9('0x2'))();var rs=require(_0x87d9('0x3'));var moment=require(_0x87d9('0x4'));var Mustache=require('mustache');var rp=require(_0x87d9('0x5'));var logger=require(_0x87d9('0x6'))('agi');var config=require(_0x87d9('0x7'));var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x87d9('0x8'),_0x87d9('0x9')];var verticesWithRetry=[_0x87d9('0xa'),'getdigits',_0x87d9('0xb')];var AGIVertices=function(_0x7107a0,_0x4168cf,_0x545f4f){this[_0x87d9('0xc')]=_0x7107a0;this[_0x87d9('0xd')]=_0x4168cf;this[_0x87d9('0xe')]=_0x545f4f;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x10')]=function(_0x3c662f,_0x2b8e2c){this[_0x87d9('0xd')][_0x87d9('0x11')](_0x3c662f)[_0x87d9('0x12')](function(_0x1ed5f9){_0x2b8e2c(null,_0x1ed5f9?_0x1ed5f9[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x22758){_0x2b8e2c(_0x22758);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15')]=function(_0x2c3965,_0x185401){this[_0x87d9('0xd')][_0x87d9('0x16')](_0x2c3965)['then'](function(_0x5a7ba4){_0x185401(null,_0x5a7ba4?_0x5a7ba4[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x3231e7){_0x185401(_0x3231e7);});};AGIVertices['prototype']['getSquareProject']=function(_0x407c62,_0x109d61){this[_0x87d9('0xd')][_0x87d9('0x17')](_0x407c62)[_0x87d9('0x12')](function(_0xebc1eb){_0x109d61(null,_0xebc1eb?_0xebc1eb[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x6cbbca){_0x109d61(_0x6cbbca);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x18')]=function(_0x5d6da1,_0x6f6284){this['rpc'][_0x87d9('0x19')](_0x5d6da1)[_0x87d9('0x12')](function(_0x334d31){_0x6f6284(null,_0x334d31?_0x334d31['dsn']:![]);})['catch'](function(_0x545241){_0x6f6284(_0x545241);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1a')]=function(_0x28aaaa,_0x6ab839){this[_0x87d9('0xd')][_0x87d9('0x1b')](_0x28aaaa)[_0x87d9('0x12')](function(_0x3b24e7){_0x6ab839(null,_0x3b24e7?_0x3b24e7[_0x87d9('0x13')]:![]);})['catch'](function(_0x31e1b2){_0x6ab839(_0x31e1b2);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1c')]=function(_0xb2a651,_0x1b170e){this[_0x87d9('0xd')][_0x87d9('0x1d')](_0xb2a651)[_0x87d9('0x12')](function(_0x4b2914){_0x1b170e(null,_0x4b2914?_0x4b2914[_0x87d9('0x13')]:![]);})[_0x87d9('0x14')](function(_0x2f63fa){_0x1b170e(_0x2f63fa);});};AGIVertices[_0x87d9('0xf')]['getSound']=function(_0x121368,_0x12d733){var _0x438e84=this;this[_0x87d9('0xd')]['getSoundById'](_0x121368)[_0x87d9('0x12')](function(_0x3c0283){_0x12d733(null,_0x3c0283?_0x438e84[_0x87d9('0x1e')](_0x3c0283['save_name']):![]);})[_0x87d9('0x14')](function(_0x22a401){_0x12d733(_0x22a401);});};AGIVertices['prototype']['getMailAccount']=function(_0x4f13db,_0x31122b){this[_0x87d9('0xd')]['getMailAccountById'](_0x4f13db)[_0x87d9('0x12')](function(_0x4a820e){_0x31122b(null,_0x4a820e?_0x4a820e:![]);})[_0x87d9('0x14')](function(_0x50df68){_0x31122b(_0x50df68);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1f')]=function(_0x5cfb33,_0x1bc8c5,_0x5a06d6){this[_0x87d9('0xe')][_0x87d9('0x1f')](_0x5cfb33,_0x1bc8c5)[_0x87d9('0x12')](function(){_0x5a06d6(null);})[_0x87d9('0x14')](function(_0x16453b){_0x5a06d6(_0x16453b);});};AGIVertices[_0x87d9('0xf')]['getIntervals']=function(_0x2e22c8,_0x1f69f5){this[_0x87d9('0xd')][_0x87d9('0x20')](_0x2e22c8)[_0x87d9('0x12')](function(_0x1c2ea6){if(_0x1c2ea6){if(_0x1c2ea6[_0x87d9('0x21')]){_0x1f69f5(null,[_0x1c2ea6[_0x87d9('0x22')]]);}else{_0x1f69f5(null,_[_0x87d9('0x23')](_0x1c2ea6['Intervals'],_0x87d9('0x22')));}}else{_0x1f69f5(null,![]);}})[_0x87d9('0x14')](function(_0x4361b0){_0x1f69f5(_0x4361b0);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1e')]=function(_0x49fa99){return util[_0x87d9('0x24')](_0x87d9('0x25'),FILES_PATH,_0x49fa99);};AGIVertices[_0x87d9('0xf')]['getQueryOdbc']=function(_0x469306,_0x4c01e1,_0x37431c){odbc[_0x87d9('0x26')](_0x469306,function(_0x157fa1){if(_0x157fa1){logger[_0x87d9('0x27')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x157fa1);_0x37431c(_0x157fa1);}else{logger[_0x87d9('0x28')]('ODBC\x20connection\x20successfully');odbc[_0x87d9('0x29')](_0x4c01e1,function(_0x3dc7a7,_0x2158a7){if(_0x3dc7a7){logger[_0x87d9('0x28')]('Error\x20executing\x20query\x20%s',_0x4c01e1);_0x37431c(_0x3dc7a7);}else{logger['info'](_0x87d9('0x2a'),_0x4c01e1);odbc['close'](function(_0x363337){if(_0x363337){logger['error'](_0x87d9('0x2b'),_0x363337);}_0x37431c(null,_0x2158a7);});}});}});};AGIVertices['prototype'][_0x87d9('0x2c')]=function(_0x341322,_0x5d8a5c){this[_0x87d9('0xd')]['getSmsAccountById'](_0x341322)['then'](function(_0x5c91af){_0x5d8a5c(null,_0x5c91af?_0x5c91af:![]);})[_0x87d9('0x14')](function(_0x5d3963){_0x5d8a5c(_0x5d3963);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x2d')]=function(_0x2af6fd,_0x5e2fe1){this[_0x87d9('0xd')][_0x87d9('0x2d')](_0x2af6fd)[_0x87d9('0x12')](function(_0x5a0d96){_0x5e2fe1(null,_0x5a0d96);})[_0x87d9('0x14')](function(_0x58ec85){_0x5e2fe1(_0x58ec85);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x39e807,_0x585bcc,_0x4a411b){this[_0x87d9('0xd')][_0x87d9('0x2e')]({'uniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'node':_0x39e807[_0x87d9('0x30')],'application':_0x39e807['agicommand'],'data':_0x585bcc||null,'project_name':this[_0x87d9('0xc')][_0x87d9('0x31')],'callerid':this['channel']['callerid']})[_0x87d9('0x12')](function(_0x323a76){if(_0x4a411b){_0x4a411b(null,_0x323a76);}})[_0x87d9('0x14')](function(_0x3f2b93){if(_0x4a411b){_0x4a411b(_0x3f2b93);}});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x32')]=function(_0x9790f7,_0xa675ad,_0x497c44,_0x44b359){this[_0x87d9('0xd')]['createSquareRecording']({'uniqueid':this['channel'][_0x87d9('0x2f')],'callerid':this[_0x87d9('0xc')]['callerid'],'calleridname':this[_0x87d9('0xc')]['calleridname'],'context':this['channel']['context'],'extension':this['channel'][_0x87d9('0x33')],'priority':this[_0x87d9('0xc')]['priority'],'accountcode':this[_0x87d9('0xc')][_0x87d9('0x34')],'dnid':this[_0x87d9('0xc')]['dnid'],'projectName':this[_0x87d9('0xc')][_0x87d9('0x31')],'saveName':_0xa675ad,'filename':_0x9790f7[_0x87d9('0x35')]||_0xa675ad,'savePath':_0x497c44})[_0x87d9('0x12')](function(_0x154995){_0x44b359(null,_0x154995);})[_0x87d9('0x14')](function(_0x556e0d){_0x44b359(_0x556e0d);});};AGIVertices[_0x87d9('0xf')]['createSquareMessage']=function(_0x512d91,_0x23b4c6,_0x39f9b7,_0x329088,_0x2e81bd){this[_0x87d9('0xd')]['createSquareMessage']({'uniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'body':_0x512d91,'direction':_0x23b4c6,'providerName':_0x39f9b7,'providerResponse':_0x329088})[_0x87d9('0x12')](function(_0x18cf6b){if(_0x2e81bd){_0x2e81bd(null,_0x18cf6b);}})['catch'](function(_0x645821){if(_0x2e81bd){_0x2e81bd(_0x645821);}});};AGIVertices[_0x87d9('0xf')]['createCmContact']=function(_0x5eef90,_0x2e493a){this[_0x87d9('0xd')][_0x87d9('0x36')]({'firstName':_[_0x87d9('0x37')](_0x5eef90[_0x87d9('0x13')])||_['isNil'](_0x5eef90[_0x87d9('0x13')])?_0x87d9('0x38')+Math[_0x87d9('0x39')]():_0x5eef90[_0x87d9('0x13')],'lastName':_[_0x87d9('0x37')](_0x5eef90[_0x87d9('0x3a')])||_[_0x87d9('0x3b')](_0x5eef90[_0x87d9('0x3a')])?null:_0x5eef90[_0x87d9('0x3a')],'phone':_0x5eef90[_0x87d9('0x3c')],'ListId':_0x5eef90[_0x87d9('0x3d')],'scheduledat':_0x5eef90['scheduledAt'],'callbackUniqueid':this[_0x87d9('0xc')][_0x87d9('0x2f')],'tags':_0x87d9('0x3e'),'description':_0x87d9('0x3f')+_0x5eef90[_0x87d9('0x40')][_0x87d9('0x41')](),'priority':_0x5eef90['callback_priority']})[_0x87d9('0x12')](function(_0xcde8de){_0x2e493a(null,_0xcde8de);})['catch'](function(_0x237b5b){_0x2e493a(_0x237b5b);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x42')]=function(_0x5854a2,_0x410ae2){this[_0x87d9('0xd')][_0x87d9('0x43')](_0x5854a2)[_0x87d9('0x12')](function(_0xac7f78){_0x410ae2(null,_0xac7f78?_0xac7f78[_0x87d9('0x13')]:![]);})['catch'](function(_0x183661){_0x410ae2(_0x183661);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x44')]=function(_0x4f7e6c,_0x4e4669,_0x52243f){var _0x4fadd9={'role':_0x87d9('0x45')};_0x4fadd9[_0x4f7e6c]=this[_0x87d9('0xc')]['callerid'];this[_0x87d9('0xd')][_0x87d9('0x44')](_0x4fadd9,_0x4e4669,this[_0x87d9('0xc')][_0x87d9('0x2f')])['then'](function(_0x186ed2){_0x52243f(null,_[_0x87d9('0x3b')](_0x186ed2)?![]:!![]);})[_0x87d9('0x14')](function(_0x260944){logger['error'](_0x260944);_0x52243f(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x46')]=function(_0x3100b2,_0x6b3e8){var _0x162a3a={'role':_0x87d9('0x45')};_0x162a3a[_0x3100b2]=this[_0x87d9('0xc')][_0x87d9('0x47')];this[_0x87d9('0xd')]['agentUnpause'](_0x162a3a)[_0x87d9('0x12')](function(_0x371563){_0x6b3e8(null,_[_0x87d9('0x3b')](_0x371563)?![]:!![]);})[_0x87d9('0x14')](function(_0x24c9fd){logger[_0x87d9('0x27')](_0x24c9fd);_0x6b3e8(null,![]);});};AGIVertices[_0x87d9('0xf')]['agentLogout']=function(_0x1acebb,_0x329887){var _0xd47e6d={'role':_0x87d9('0x45')};_0xd47e6d[_0x1acebb]=this[_0x87d9('0xc')][_0x87d9('0x47')];this['rpc']['agentLogout'](_0xd47e6d)['then'](function(_0x4d8c23){_0x329887(null,_[_0x87d9('0x3b')](_0x4d8c23)?![]:!![]);})[_0x87d9('0x14')](function(_0x3aae37){logger[_0x87d9('0x27')](_0x3aae37);_0x329887(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x48')]=function(_0x595313,_0xdeb8ce){var _0x253d5e={'role':_0x87d9('0x45')};_0x253d5e[_0x595313]=this[_0x87d9('0xc')][_0x87d9('0x47')];var _0x14a3cc=_0x595313!=_0x87d9('0x49')?util[_0x87d9('0x24')](_0x87d9('0x4a'),_0x87d9('0x4b'),this[_0x87d9('0xc')]['callerid']):undefined;this[_0x87d9('0xd')][_0x87d9('0x48')](_0x253d5e,_0x14a3cc)[_0x87d9('0x12')](function(_0xfa4a99){_0xdeb8ce(null,_[_0x87d9('0x3b')](_0xfa4a99)?![]:!![]);})['catch'](function(_0xa4a9d8){logger[_0x87d9('0x27')](_0xa4a9d8);_0xdeb8ce(null,![]);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x4c')]=function(_0x1fb5a2,_0x192c56){sh['exec'](_['trim'](_0x1fb5a2),function(_0x2b591c,_0x4830d3){var _0x353c89=_0x4830d3['replace'](/(\r\n|\n|\r)/gm,'');_0x192c56(null,_0x353c89);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x4d')]=function(_0x11ee83,_0xe7d3af){scripts[_0x87d9('0x4d')](_0x11ee83['apiKey'],_0x11ee83[_0x87d9('0x4e')]||'text',_0x11ee83[_0x87d9('0x4f')],_0x11ee83[_0x87d9('0x50')]||_0x87d9('0x51'),_0x11ee83[_0x87d9('0x52')]||_0x87d9('0x53'),_0x11ee83[_0x87d9('0x54')]||_0x87d9('0x55'))['then'](function(_0x436c47){_0xe7d3af(null,_0x436c47);})[_0x87d9('0x14')](function(_0x2cf918){_0xe7d3af(_0x2cf918);});};AGIVertices['prototype']['googleTTS']=function(_0x507582,_0x4cfdaa){scripts[_0x87d9('0x56')](_0x507582[_0x87d9('0x4f')],_0x507582[_0x87d9('0x57')]||'en',0x1)[_0x87d9('0x12')](function(_0x27a46f){_0x4cfdaa(null,_0x27a46f);})[_0x87d9('0x14')](function(_0x14ac7c){_0x4cfdaa(_0x14ac7c);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x58')]=function(_0x549f13,_0x3e29dd){var _0x21b068={'uri':_0x549f13[_0x87d9('0x59')],'method':_0x549f13[_0x87d9('0x5a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x549f13[_0x87d9('0x5b')])===_0x87d9('0x5c')&&parseInt(_0x549f13[_0x87d9('0x5b')])>=0x1?parseInt(_0x549f13['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x87d9('0x5d'),_0x87d9('0x5e')],_0x21b068[_0x87d9('0x5a')]['toUpperCase']())){try{_0x21b068[_0x87d9('0x5f')]=_0x549f13['rawBody']?JSON[_0x87d9('0x60')](_0x549f13[_0x87d9('0x9')]):{};}catch(_0xdd72e5){logger[_0x87d9('0x27')](_0x87d9('0x61'),_0xdd72e5);}}try{_0x21b068[_0x87d9('0x62')]=_0x549f13[_0x87d9('0x8')]?JSON[_0x87d9('0x60')](_0x549f13[_0x87d9('0x8')]):{};}catch(_0x2f630c){logger[_0x87d9('0x27')](_0x87d9('0x63'),_0x2f630c);}if(_0x549f13[_0x87d9('0x64')]){try{var _0xdffdbd=require(_0x549f13[_0x87d9('0x64')])[_0x87d9('0x65')](this,_0x21b068);_0x21b068[_0x87d9('0x66')]=Mustache[_0x87d9('0x67')](_0x549f13[_0x87d9('0x59')],_0xdffdbd,{},['$$','$$']);if(_0x21b068[_0x87d9('0x62')]){_0x21b068['headers']=JSON['parse'](Mustache[_0x87d9('0x67')](JSON[_0x87d9('0x68')](_0x21b068[_0x87d9('0x62')]),_0xdffdbd,{},['$$','$$']));}if(_0x21b068[_0x87d9('0x5f')]){_0x21b068['body']=JSON[_0x87d9('0x60')](Mustache[_0x87d9('0x67')](JSON[_0x87d9('0x68')](_0x21b068[_0x87d9('0x5f')]),_0xdffdbd,{},['$$','$$']));}}catch(_0x1b8ef3){logger[_0x87d9('0x27')](_0x87d9('0x69'),_0x1b8ef3);}}rp(_0x21b068)[_0x87d9('0x12')](function(_0x5b2b17){var _0x3ac340={'statusCode':_0x5b2b17[_0x87d9('0x6a')]||0xc8,'statusMessage':_0x5b2b17[_0x87d9('0x6b')]||'OK','headers':_0x5b2b17[_0x87d9('0x62')]||{},'body':_0x5b2b17['body']||{}};_0x3e29dd(null,_0x3ac340);})['catch'](function(_0x3b93a8){var _0x22f074={'statusCode':_0x3b93a8['statusCode']||0x1f4,'statusMessage':_0x3b93a8[_0x87d9('0x6c')]||_0x87d9('0x6d'),'headers':_0x3b93a8[_0x87d9('0x6e')][_0x87d9('0x62')]||{},'body':_0x3b93a8[_0x87d9('0x6e')][_0x87d9('0x5f')]||{}};_0x3e29dd(null,_0x22f074);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x6f')]=function(_0x7c3c51,_0x4d4e46){scripts['googleDialogflow'](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x7c3c51['key'],_0x7c3c51[_0x87d9('0x4f')],_0x7c3c51[_0x87d9('0x70')]||'en')[_0x87d9('0x12')](function(_0x46ad4c){_0x4d4e46(null,_0x46ad4c);})[_0x87d9('0x14')](function(_0x4a6f0c){_0x4d4e46(_0x4a6f0c);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x71')]=function(_0x2a3b65,_0x5e3056){scripts[_0x87d9('0x71')](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x2a3b65[_0x87d9('0x72')],_0x2a3b65[_0x87d9('0x73')],_0x2a3b65[_0x87d9('0x74')],_0x2a3b65[_0x87d9('0x4f')],_0x2a3b65[_0x87d9('0x75')]||'en')['then'](function(_0x3aebf5){_0x5e3056(null,_0x3aebf5);})[_0x87d9('0x14')](function(_0x436e5a){_0x5e3056(_0x436e5a);});};AGIVertices['prototype'][_0x87d9('0x76')]=function(_0x39580f,_0x11f4b5){scripts[_0x87d9('0x76')](this[_0x87d9('0xc')],_0x39580f)[_0x87d9('0x12')](function(_0x1992f3){_0x11f4b5(null,_0x1992f3);})[_0x87d9('0x14')](function(_0x509340){_0x11f4b5(_0x509340);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x77')]=function(_0x4aaf86,_0x3313b9){scripts[_0x87d9('0x77')](_0x4aaf86[_0x87d9('0x78')],_0x4aaf86['text'],_0x4aaf86[_0x87d9('0x79')]||_0x87d9('0x51'),_0x4aaf86[_0x87d9('0x7a')])[_0x87d9('0x12')](function(_0x4e9fdb){_0x3313b9(null,_0x4e9fdb);})['catch'](function(_0x223367){_0x3313b9(_0x223367);});};AGIVertices[_0x87d9('0xf')]['ispeechASR']=function(_0x125ed6,_0x47f9d1,_0x1a6159){scripts[_0x87d9('0x7b')](_0x47f9d1,_0x125ed6[_0x87d9('0x78')],_0x125ed6[_0x87d9('0x7c')]||_0x87d9('0x51'),this['isConfigured'](_0x125ed6[_0x87d9('0x7d')])?_0x125ed6['model']:undefined)[_0x87d9('0x12')](function(_0x18568a){_0x1a6159(null,_0x18568a);})[_0x87d9('0x14')](function(_0x26c49e){_0x1a6159(_0x26c49e);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x7e')]=function(_0x5c4a7b,_0x4b5898){scripts['awsPolly'](_0x5c4a7b[_0x87d9('0x7f')],_0x5c4a7b[_0x87d9('0x80')],_0x5c4a7b[_0x87d9('0x81')],_0x5c4a7b[_0x87d9('0x82')]||_0x87d9('0x83'),_0x5c4a7b['text'],_0x5c4a7b[_0x87d9('0x84')]||'text')[_0x87d9('0x12')](function(_0x1304d8){_0x4b5898(null,_0x1304d8);})[_0x87d9('0x14')](function(_0xc03c57){_0x4b5898(_0xc03c57);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x85')]=function(_0x46d472,_0x53c009){scripts[_0x87d9('0x85')](this[_0x87d9('0xc')][_0x87d9('0x2f')],_0x46d472[_0x87d9('0x7f')],_0x46d472[_0x87d9('0x80')],_0x46d472['aws_lex_region'],_0x46d472[_0x87d9('0x4f')],_0x46d472['aws_bot_name'])[_0x87d9('0x12')](function(_0x255cdf){_0x53c009(null,_0x255cdf);})[_0x87d9('0x14')](function(_0x64b146){_0x53c009(_0x64b146);});};AGIVertices[_0x87d9('0xf')]['googleASR']=function(_0x15f887,_0x3fd310,_0xb490b7){scripts[_0x87d9('0x86')](_0x3fd310,_0x15f887[_0x87d9('0x78')],_0x15f887['google_asr_language']||_0x87d9('0x51'))['then'](function(_0x5427e9){_0xb490b7(null,_0x5427e9);})[_0x87d9('0x14')](function(_0x22289b){_0xb490b7(_0x22289b);});};AGIVertices[_0x87d9('0xf')]['tildeASR']=function(_0x2eb866,_0x4c15a2,_0x30d07d){scripts[_0x87d9('0x87')](_0x4c15a2,_0x2eb866[_0x87d9('0x88')],_0x2eb866[_0x87d9('0x89')],_0x2eb866[_0x87d9('0x66')])[_0x87d9('0x12')](function(_0x13d66c){_0x30d07d(null,_0x13d66c);})[_0x87d9('0x14')](function(_0x2fbeb9){_0x30d07d(_0x2fbeb9);});};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8a')]=function(_0x1ea2a6){var _0x18eedc=_['includes'](verticesWithRetry,_0x1ea2a6['agicommand'])?_0x1ea2a6:_['clone'](_0x1ea2a6);for(var _0x25cb7f in _0x18eedc){if(_0x18eedc[_0x87d9('0x8b')](_0x25cb7f)){if(_0x18eedc[_0x25cb7f]&&_[_0x87d9('0x8c')](_0x18eedc[_0x25cb7f])){if(_[_0x87d9('0x8d')](recursiveMapAttributes,_0x25cb7f)){_0x18eedc[_0x25cb7f]=this[_0x87d9('0x8e')](_0x18eedc[_0x25cb7f]);}else{_0x18eedc[_0x25cb7f]=this[_0x87d9('0x8f')](_0x18eedc[_0x25cb7f]);}}}}return _0x18eedc;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x90')]=function(_0x86130f){for(var _0x3c5cb9 in _0x86130f){if(_0x86130f[_0x87d9('0x8b')](_0x3c5cb9)){if(_[_0x87d9('0x91')](_0x86130f[_0x3c5cb9])){this[_0x87d9('0x90')](_0x86130f[_0x3c5cb9]);}else if(_[_0x87d9('0x92')](_0x86130f[_0x3c5cb9])){for(var _0x2e4a48=0x0;_0x2e4a48<_0x86130f[_0x3c5cb9][_0x87d9('0x93')];_0x2e4a48++){this[_0x87d9('0x90')](_0x86130f[_0x3c5cb9][_0x2e4a48]);}}else if(_[_0x87d9('0x8c')](_0x86130f[_0x3c5cb9])){_0x86130f[_0x3c5cb9]=this[_0x87d9('0x8f')](_0x86130f[_0x3c5cb9]);}}}};AGIVertices[_0x87d9('0xf')]['saveRestApiResult']=function(_0x3d8657,_0x585f94){for(var _0x5e6fad in _0x3d8657){if(_0x3d8657[_0x87d9('0x8b')](_0x5e6fad)){if(_[_0x87d9('0x91')](_0x3d8657[_0x5e6fad])){if(!_['isEmpty'](_0x3d8657[_0x5e6fad])){this[_0x87d9('0x94')](_0x3d8657[_0x5e6fad],util['format'](_0x87d9('0x95'),_0x585f94,_0x5e6fad));}}else if(_[_0x87d9('0x92')](_0x3d8657[_0x5e6fad])){for(var _0x55aa60=0x0;_0x55aa60<_0x3d8657[_0x5e6fad]['length'];_0x55aa60++){this[_0x87d9('0x94')](_0x3d8657[_0x5e6fad][_0x55aa60],util[_0x87d9('0x24')](_0x87d9('0x95'),_0x585f94,_0x5e6fad+'['+_0x55aa60+']'));}}else{if(!_[_0x87d9('0x3b')](_0x3d8657[_0x5e6fad])){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x95'),_0x585f94,_0x5e6fad),_0x3d8657[_0x5e6fad]);}}}}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8e')]=function(_0x5180fe){try{var _0x187194=JSON[_0x87d9('0x60')](_0x5180fe);this[_0x87d9('0x90')](_0x187194);return JSON[_0x87d9('0x68')](_0x187194);}catch(_0x46494b){return this[_0x87d9('0x8f')](_0x5180fe);}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x8f')]=function(_0x2ab3bf){var _0x3badaa=_0x2ab3bf[_0x87d9('0x97')]('{');for(var _0xd80066=0x1;_0xd80066<_0x3badaa[_0x87d9('0x93')];_0xd80066+=0x1){var _0x239dde=_0x3badaa[_0xd80066][_0x87d9('0x97')]('}');if(_0x239dde['length']>0x1){_0x2ab3bf=_0x2ab3bf[_0x87d9('0x98')]('{'+_0x239dde[0x0]+'}',this[_0x87d9('0xc')]['getVariable'](_0x239dde[0x0])[_0x87d9('0x99')]||_0x239dde[0x0]);}}if(_0x3badaa[_0x87d9('0x93')]===0x1){return _0x2ab3bf[_0x87d9('0x41')]();}return this['replaceAllVariables'](_0x2ab3bf);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9a')]=function(_0x358cd6,_0x17b3f1){var _0x452147=this[_0x87d9('0xc')][_0x87d9('0x10')](_0x358cd6);if(_0x452147['result']===-0x1){return _0x452147;}logger['info'](util['format'](_0x87d9('0x9b'),_0x17b3f1,_0x452147[_0x87d9('0x99')]));return this[_0x87d9('0xc')][_0x87d9('0x96')](_0x17b3f1,_0x452147['extra']);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9c')]=function(_0x125c9f){return _0x125c9f&&_0x125c9f!=='0'&&_0x125c9f!=='-1'&&_0x125c9f!=='';};AGIVertices[_0x87d9('0xf')]['maxRetry']=function(_0x1381bc){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x1381bc,'-');_0x1381bc[_0x87d9('0x9d')]=_0x1381bc['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x87d9('0xf')][_0x87d9('0x9e')]=function(_0x4372dd){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x9f'),_0x4372dd[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4372dd[_0x87d9('0x4f')])){return this[_0x87d9('0xc')]['noop']('no\x20text\x20configured');}var _0x4e32cc='\x22'+_0x4372dd[_0x87d9('0x4f')]+'\x22';if(this[_0x87d9('0x9c')](_0x4372dd['options'])){_0x4e32cc+=','+_0x4372dd['options'];}var _0x19dd61=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0xa1'),_0x4e32cc);if(_0x19dd61[_0x87d9('0xa2')]===-0x1){return _0x19dd61;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4e32cc));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xa4')]=function(_0x132edf){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x132edf[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x132edf[_0x87d9('0xa5')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xa6'));}var _0x3e5711=_0x132edf[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x132edf['options'])){_0x3e5711+=','+_0x132edf['options'];}var _0x578bc8=this[_0x87d9('0xc')]['exec'](_0x87d9('0xa7'),_0x3e5711);if(_0x578bc8[_0x87d9('0xa2')]===-0x1){return _0x578bc8;}var _0x257fa0=this[_0x87d9('0x9a')]('RECOG_CONFIDENCE()',_0x87d9('0xa8'));if(_0x257fa0[_0x87d9('0xa2')]===-0x1){return _0x257fa0;}var _0x26ae85=this[_0x87d9('0x9a')]('RECOG_INPUT()',_0x87d9('0xa9'));if(_0x26ae85[_0x87d9('0xa2')]===-0x1){return _0x26ae85;}var _0x3e0756=this[_0x87d9('0x9a')]('RECOG_INSTANCE()',_0x87d9('0xaa'));if(_0x3e0756[_0x87d9('0xa2')]===-0x1){return _0x3e0756;}return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0xab'),_0x3e5711));};AGIVertices['prototype'][_0x87d9('0xac')]=function(_0xdf42b3){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xad'),_0xdf42b3['label']));return this[_0x87d9('0xc')][_0x87d9('0xac')]([_0xdf42b3[_0x87d9('0xae')],_0xdf42b3[_0x87d9('0xaf')]]);};AGIVertices[_0x87d9('0xf')]['answer']=function(_0x4f298e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4f298e[_0x87d9('0x30')]));if(this['isConfigured'](_0x4f298e[_0x87d9('0x5b')])){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xb0'),_0x4f298e[_0x87d9('0x5b')]));var _0x166abf=this[_0x87d9('0xc')][_0x87d9('0xb1')](_0x4f298e[_0x87d9('0x5b')]);if(_0x166abf[_0x87d9('0xa2')]===-0x1){return _0x166abf;}}return this['channel'][_0x87d9('0xb2')]();};AGIVertices[_0x87d9('0xf')]['callback']=function(_0x12988f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xb3'),_0x12988f[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x12988f[_0x87d9('0x3d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x12988f,_0x87d9('0xb4'));}_0x12988f[_0x87d9('0x40')]=moment();if(this[_0x87d9('0x9c')](_0x12988f['delay'])){_0x12988f[_0x87d9('0x40')]=moment()[_0x87d9('0xb5')](_0x12988f[_0x87d9('0xb6')],'minutes');}if(!this['isConfigured'](_0x12988f[_0x87d9('0xb7')])){_0x12988f['callback_priority']=0x2;}this[_0x87d9('0x36')]['sync'](this,_0x12988f);return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xb8'),_0x12988f[_0x87d9('0x3c')],_0x12988f[_0x87d9('0x3d')],_0x12988f['scheduledAt']));};AGIVertices['prototype'][_0x87d9('0xb9')]=function(_0x272153){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x272153['label']));var _0x43dadc=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x272153[_0x87d9('0xba')],_0x272153[_0x87d9('0x6e')]);if(_0x43dadc['result']===-0x1){return _0x43dadc;}return this['channel'][_0x87d9('0xa3')](util['format']('Executed\x20command\x20%s\x20%s',_0x272153['application'],_0x272153[_0x87d9('0x6e')]));};AGIVertices['prototype'][_0x87d9('0xbb')]=function(_0x36e73f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xbc'),_0x36e73f[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x36e73f['text'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}var _0x2eda8f='\x22'+_0x36e73f[_0x87d9('0x4f')]+'\x22';if(this['isConfigured'](_0x36e73f[_0x87d9('0x6e')])){_0x2eda8f+=','+_0x36e73f[_0x87d9('0x6e')];}var _0x40be7f=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0xa1'),_0x2eda8f);if(_0x40be7f[_0x87d9('0xa2')]===-0x1){return _0x40be7f;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xbe'),_0x2eda8f));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xbf')]=function(_0x5808d9){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5808d9[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x5808d9['text'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20text\x20configured');}var _0x2abf7c='\x22'+_0x5808d9['text']+'\x22';if(this[_0x87d9('0x9c')](_0x5808d9[_0x87d9('0x6e')])){_0x2abf7c+=','+_0x5808d9['options'];}var _0x357767=this[_0x87d9('0xc')][_0x87d9('0xa0')]('MRCPSynth',_0x2abf7c);if(_0x357767['result']===-0x1){return _0x357767;}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xbe'),_0x2abf7c));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xc0')]=function(_0x42937d){logger['info'](util[_0x87d9('0x24')](_0x87d9('0xc1'),_0x42937d['label']));if(!this[_0x87d9('0x9c')](_0x42937d[_0x87d9('0xa5')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xa6'));}var _0x19f24b=_0x42937d[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x42937d['options'])){_0x19f24b+=','+_0x42937d[_0x87d9('0x6e')];}var _0x170566=this['channel'][_0x87d9('0xa0')](_0x87d9('0xa7'),_0x19f24b);if(_0x170566['result']===-0x1){return _0x170566;}var _0x545536=this['getAndSetVariable'](_0x87d9('0xc2'),_0x87d9('0xc3'));if(_0x545536[_0x87d9('0xa2')]===-0x1){return _0x545536;}var _0x1294fa=this[_0x87d9('0x9a')](_0x87d9('0xc4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1294fa['result']===-0x1){return _0x1294fa;}var _0xd94569=this[_0x87d9('0x9a')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0xd94569[_0x87d9('0xa2')]===-0x1){return _0xd94569;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xab'),_0x19f24b));};AGIVertices[_0x87d9('0xf')][_0x87d9('0xc5')]=function(_0x111ad1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xc6'),_0x111ad1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x111ad1['grammar'])){return this['channel'][_0x87d9('0xa3')]('no\x20grammar\x20configured');}var _0x4163d3=_0x111ad1[_0x87d9('0xa5')];if(this[_0x87d9('0x9c')](_0x111ad1[_0x87d9('0x6e')])){_0x4163d3+=','+_0x111ad1['options'];}var _0x36d2f6=this[_0x87d9('0xc')]['exec']('MRCPRecog',_0x4163d3);if(_0x36d2f6['result']===-0x1){return _0x36d2f6;}var _0x336465=this[_0x87d9('0x9a')]('RECOG_CONFIDENCE()',_0x87d9('0xc7'));if(_0x336465[_0x87d9('0xa2')]===-0x1){return _0x336465;}var _0x2bf2db=this['getAndSetVariable']('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x2bf2db[_0x87d9('0xa2')]===-0x1){return _0x2bf2db;}var _0x440cb3=this['getAndSetVariable'](_0x87d9('0xc8'),_0x87d9('0xc9'));if(_0x440cb3[_0x87d9('0xa2')]===-0x1){return _0x440cb3;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xab'),_0x4163d3));};AGIVertices[_0x87d9('0xf')]['database']=function(_0x4c4fe1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xca'),_0x4c4fe1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4c4fe1[_0x87d9('0xcb')])){return this[_0x87d9('0xc')]['error'](_0x4c4fe1,_0x87d9('0xcc'));}var _0x2e3d36=this['getSquareOdbc'][_0x87d9('0x65')](this,_0x4c4fe1[_0x87d9('0xcb')]);if(!_0x2e3d36){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x4c4fe1,_0x87d9('0xcd'));}if(!this['isConfigured'](_0x4c4fe1[_0x87d9('0x29')])){return this['channel'][_0x87d9('0x27')](_0x4c4fe1,'no\x20query\x20configured');}var _0x3940d2=_0x4c4fe1[_0x87d9('0x29')][_0x87d9('0xce')](/(\r\n|\n|\r)/gm,'\x20');this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0xcf'),_0x3940d2));var _0xb1251b=this[_0x87d9('0xd0')]['sync'](this,_0x2e3d36,_0x3940d2);this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x4c4fe1,_0x3940d2);if(!this[_0x87d9('0x9c')](_0x4c4fe1[_0x87d9('0xd1')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xd2'));}var _0x39ce04=this[_0x87d9('0x10')]['sync'](this,_0x4c4fe1[_0x87d9('0xd1')]);if(!_0x39ce04){return this['channel'][_0x87d9('0x27')](_0x4c4fe1,_0x87d9('0xd3'));}var _0x59575b=this;_0xb1251b[_0x87d9('0xd4')](function(_0x2cd6b9,_0x283c6a){Object[_0x87d9('0xd5')](_0x2cd6b9)[_0x87d9('0xd4')](function(_0x5ca0d5){_0x59575b['channel']['setVariable'](util[_0x87d9('0x24')](_0x87d9('0xd6'),_0x39ce04,_0x283c6a,_0x5ca0d5),_0x2cd6b9[_0x5ca0d5]);});});this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xd7'),_0x39ce04),_0xb1251b[_0x87d9('0x93')]);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xd8'),_0x39ce04));};AGIVertices['prototype'][_0x87d9('0xd9')]=function(_0x3b3deb){logger['debug'](util['format'](_0x87d9('0xda'),_0x3b3deb[_0x87d9('0x30')]));if(!this['isConfigured'](_0x3b3deb[_0x87d9('0xdb')])){return this['channel'][_0x87d9('0x27')](_0x3b3deb,_0x87d9('0xdc'));}var _0x26c1bd=this['getUser'][_0x87d9('0x65')](this,_0x3b3deb[_0x87d9('0xdb')]);if(!_0x26c1bd){return this['channel'][_0x87d9('0x27')](_0x3b3deb,'no\x20user\x20found');}var _0x305e67=this[_0x87d9('0xc')]['exec'](_0x87d9('0xdd'),[util[_0x87d9('0x24')](_0x87d9('0xde'),_0x26c1bd),_0x3b3deb['timeout'],_0x3b3deb['opts'],_0x3b3deb[_0x87d9('0x59')]]);if(_0x305e67['result']===-0x1){return _0x305e67;}return this['channel']['noop'](util[_0x87d9('0x24')](_0x87d9('0xdf'),_0x87d9('0xdd')));};AGIVertices['prototype']['dialogflow']=function(_0x33db9b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0xe0'),_0x33db9b[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x33db9b[_0x87d9('0x78')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xe1'));}if(!this[_0x87d9('0x9c')](_0x33db9b[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel']['bot']=!![];this[_0x87d9('0x2e')](_0x33db9b);this[_0x87d9('0xe2')](_0x33db9b[_0x87d9('0x4f')],'in','','');this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xe3'),_0x33db9b['text']));var _0x53d061=this['googleDialogflow'][_0x87d9('0x65')](this,_0x33db9b);if(_0x53d061){for(var _0x31b2fe in _0x53d061){if(_0x53d061['hasOwnProperty'](_0x31b2fe)){this['channel'][_0x87d9('0x96')](util[_0x87d9('0x24')]('DIALOGFLOW_%s',_0x31b2fe['toUpperCase']()),_0x53d061[_0x31b2fe]);}}this['createSquareMessage'](_0x53d061[_0x87d9('0xe4')],_0x87d9('0xe5'),_0x87d9('0xe6'),'');return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xe7'),_0x53d061['speech']));}return this['channel'][_0x87d9('0x27')](_0x33db9b,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0xe8')]=function(_0x2bd9cc){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2bd9cc[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x72')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe9'));}if(!this['isConfigured'](_0x2bd9cc['client_email'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xea'));}if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x74')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xeb'));}if(!this[_0x87d9('0x9c')](_0x2bd9cc[_0x87d9('0x75')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xec'));}if(!this['isConfigured'](_0x2bd9cc[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xed')]=!![];this[_0x87d9('0x2e')](_0x2bd9cc);this[_0x87d9('0xe2')](_0x2bd9cc[_0x87d9('0x4f')],'in','','');this['channel'][_0x87d9('0xa3')](util['format'](_0x87d9('0xee'),_0x2bd9cc['text']));var _0x5c7b2e=this[_0x87d9('0x71')][_0x87d9('0x65')](this,_0x2bd9cc);if(_0x5c7b2e){for(var _0xe0c7b0 in _0x5c7b2e){if(_0x5c7b2e[_0x87d9('0x8b')](_0xe0c7b0)){if(_0xe0c7b0!==_0x87d9('0xef')){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xf0'),_0xe0c7b0[_0x87d9('0xf1')]()),_0x5c7b2e[_0xe0c7b0]);}}}this[_0x87d9('0xe2')](_0x5c7b2e[_0x87d9('0xe4')],_0x87d9('0xe5'),'dialogflowV2',_0x5c7b2e[_0x87d9('0xef')]);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0xf2'),_0x5c7b2e[_0x87d9('0xe4')]));}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2bd9cc,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0xf3')]=function(_0x589334){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x589334['label']));if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf4')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xf5'));}if(!this['isConfigured'](_0x589334[_0x87d9('0xf6')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xf7'));}if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf8')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20password\x20configured');}if(!this[_0x87d9('0x9c')](_0x589334[_0x87d9('0xf9')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x589334);this[_0x87d9('0xe2')](_0x589334[_0x87d9('0x4f')],'in','','');this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xfa'),_0x589334[_0x87d9('0x4f')]));var _0x1fbab1=this[_0x87d9('0x76')][_0x87d9('0x65')](this,_0x589334);if(_0x1fbab1){for(var _0x28c112 in _0x1fbab1){if(_0x1fbab1[_0x87d9('0x8b')](_0x28c112)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0xfb'),_0x28c112['toUpperCase']()),_0x1fbab1[_0x28c112]);}}this[_0x87d9('0xe2')](_0x1fbab1['speech'],'out','sesteknda','');if(_0x1fbab1[_0x87d9('0xfc')]){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xfd'),_0x1fbab1[_0x87d9('0xfc')]));var _0x4b8ccc=this['channel'][_0x87d9('0xfe')](_0x1fbab1[_0x87d9('0xfc')]);try{fs[_0x87d9('0xff')](_0x1fbab1[_0x87d9('0xfc')]+'.wav');}catch(_0x14ba94){logger[_0x87d9('0x27')](_0x14ba94);}return _0x4b8ccc;}else{return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x100'),_0x1fbab1[_0x87d9('0xe4')]));}}return this[_0x87d9('0xc')]['error'](_0x589334,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x87d9('0x101')]=function(_0x54577f){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x102'),_0x54577f['label']));return this[_0x87d9('0xc')]['noop'](_0x87d9('0x101'));};AGIVertices[_0x87d9('0xf')]['ext_dial']=function(_0x35ffa5){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x103'),_0x35ffa5['label']));var _0xbb3b3b='';if(_0x35ffa5[_0x87d9('0x104')]){if(!this[_0x87d9('0x9c')](_0x35ffa5[_0x87d9('0x104')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,_0x87d9('0x105'));}else{var _0x5e1e67=parseInt(_0x35ffa5[_0x87d9('0x104')],0xa);if(isNaN(_0x5e1e67)){_0xbb3b3b=_0x35ffa5[_0x87d9('0x104')];}else{_0xbb3b3b=this[_0x87d9('0x1c')]['sync'](this,_0x35ffa5[_0x87d9('0x104')]);if(!_0xbb3b3b){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,_0x87d9('0x106'));}}}}else if(_0x35ffa5[_0x87d9('0x107')]){_0xbb3b3b=_0x35ffa5['trunk_name'];}else{return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x35ffa5,'no\x20trunk\x20selected');}var _0x389a5e=this[_0x87d9('0xc')]['exec'](_0x87d9('0xdd'),[util['format'](_0x87d9('0x108'),_0xbb3b3b,_0x35ffa5[_0x87d9('0x3c')]),_0x35ffa5[_0x87d9('0x5b')],_0x35ffa5['opts'],_0x35ffa5[_0x87d9('0x59')]]);if(_0x389a5e[_0x87d9('0xa2')]===-0x1){return _0x389a5e;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0xdf'),_0x87d9('0xdd')));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x109')]=function(_0x5e1d27){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5e1d27[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0xa3')]('finally');};AGIVertices[_0x87d9('0xf')][_0x87d9('0x10a')]=function(_0x528ca7){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x10b'),_0x528ca7['label']));if(_0x528ca7['retry']===0x0){return this[_0x87d9('0x10c')](_0x528ca7);}_0x528ca7[_0x87d9('0x9d')]-=0x1;if(!this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0x10d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0x10e'));}var _0x2567a7=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x528ca7[_0x87d9('0x10d')]);if(!_0x2567a7){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0x110'));}if(!this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x87d9('0xd2'));}var _0xf33548=this[_0x87d9('0xc')][_0x87d9('0x111')](_0x2567a7,_0x528ca7[_0x87d9('0x112')],_0x528ca7[_0x87d9('0x113')]);var _0x186a7a=_0xf33548[_0x87d9('0xa2')]?_0xf33548[_0x87d9('0xa2')][_0x87d9('0x41')]():'';logger[_0x87d9('0x28')]('test',JSON[_0x87d9('0x68')](_0xf33548));if(_0xf33548[_0x87d9('0xa2')]===-0x1){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,_0x186a7a);return _0xf33548;}else if(_0xf33548[_0x87d9('0x99')]===_0x87d9('0x5b')){_0xf33548[_0x87d9('0xa2')]=_0x186a7a[_0x87d9('0x93')]>=parseInt(_0x528ca7[_0x87d9('0x114')])?'x':'i';}else{_0xf33548[_0x87d9('0xa2')]=_0x186a7a[_0x87d9('0x93')]>=parseInt(_0x528ca7['mindigit'])&&_0x186a7a[_0x87d9('0x93')]<=parseInt(_0x528ca7['maxdigit'])?'x':'i';}var _0x31a259=this[_0x87d9('0x10')]['sync'](this,_0x528ca7[_0x87d9('0xd1')]);if(!_0x31a259){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x528ca7,_0x87d9('0xd3'));}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x31a259,_0x186a7a);if(this[_0x87d9('0x9c')](_0x528ca7[_0x87d9('0x115')])){var _0x122ca4=parseInt(_0x528ca7['hiddendigitsnum'],0xa);var _0x532ab3=rs[_0x87d9('0x116')]({'charset':'*','length':_0x122ca4});var _0x1611c2=_0x186a7a[_0x87d9('0x93')];if(_0x1611c2>0x0){if(_0x1611c2>_0x122ca4){this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,_0x528ca7[_0x87d9('0x117')]===_0x87d9('0x118')?_0x532ab3+_0x186a7a[_0x87d9('0x119')](_0x122ca4):_0x186a7a['substr'](0x0,_0x1611c2-_0x122ca4)+_0x532ab3);}else{this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,rs[_0x87d9('0x116')]({'charset':'*','length':_0x1611c2}));}}else{this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x528ca7,'');}}else{this[_0x87d9('0x2e')]['sync'](this,_0x528ca7,_0x186a7a);}return _0xf33548;};AGIVertices[_0x87d9('0xf')][_0x87d9('0xb')]=function(_0xe22b7d){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x11a'),_0xe22b7d[_0x87d9('0x30')]));return this[_0x87d9('0x10a')](_0xe22b7d);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x11b')]=function(_0x36dbf8){logger['info'](util[_0x87d9('0x24')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x36dbf8[_0x87d9('0x30')]));this[_0x87d9('0x2e')]['sync'](this,_0x36dbf8,_0x36dbf8[_0x87d9('0x11c')]);return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x11d'),_0x36dbf8[_0x87d9('0x11c')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x11e')]=function(_0x46c85b){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x11f'),_0x46c85b[_0x87d9('0x30')]));if(!this['isConfigured'](_0x46c85b[_0x87d9('0x7f')])||!this['isConfigured'](_0x46c85b[_0x87d9('0x80')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x120'));}if(!this[_0x87d9('0x9c')](_0x46c85b[_0x87d9('0x4f')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Trying\x20aws\x20Polly\x20%s',_0x46c85b[_0x87d9('0x4f')]));var _0x12b3c7=this['awsPolly'][_0x87d9('0x65')](this,_0x46c85b);if(_0x12b3c7){this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x12b3c7));var _0x5dfed9=this[_0x87d9('0xc')][_0x87d9('0xfe')](_0x12b3c7);try{fs[_0x87d9('0xff')](_0x12b3c7+_0x87d9('0x121'));}catch(_0x19c529){logger[_0x87d9('0x27')](_0x19c529);}return _0x5dfed9;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x46c85b,_0x87d9('0x122'));};AGIVertices['prototype'][_0x87d9('0x123')]=function(_0x251d20){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x124'),_0x251d20['label']));if(!this[_0x87d9('0x9c')](_0x251d20['aws_access_key_id'])||!this[_0x87d9('0x9c')](_0x251d20[_0x87d9('0x80')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x251d20[_0x87d9('0x125')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0x126'));}if(!this[_0x87d9('0x9c')](_0x251d20[_0x87d9('0x4f')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')]['bot']=!![];this['createSquareDetailsReport'](_0x251d20);this['createSquareMessage'](_0x251d20[_0x87d9('0x4f')],'in','','');this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x127'),_0x251d20[_0x87d9('0x4f')]));var _0x2e4e9d=this['awsLex'][_0x87d9('0x65')](this,_0x251d20);if(_0x2e4e9d){for(var _0x360ac9 in _0x2e4e9d){if(_0x2e4e9d[_0x87d9('0x8b')](_0x360ac9)&&_[_0x87d9('0x8c')](_0x2e4e9d[_0x360ac9])){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x128'),_0x360ac9[_0x87d9('0xf1')]()),_0x2e4e9d[_0x360ac9]);}}if(_[_0x87d9('0x3b')](_0x2e4e9d[_0x87d9('0x6c')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x129'));}else{this[_0x87d9('0xe2')](_0x2e4e9d[_0x87d9('0x6c')],_0x87d9('0xe5'),'amazonlex','');return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x12a'),_0x2e4e9d[_0x87d9('0x6c')]));}}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x251d20,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x87d9('0x12b')]=function(_0x1b0873){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x12c'),_0x1b0873[_0x87d9('0x30')],_0x1b0873['timeout']));if(!this[_0x87d9('0x9c')](_0x1b0873[_0x87d9('0x78')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe1'));}var _0x11f596='wav';var _0x5d10a7=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x17cdde=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x5d10a7,_0x11f596);var _0x329850=!![];if(_0x1b0873['beep']===_0x87d9('0x12e')){_0x329850=![];}var _0x31a58a=this[_0x87d9('0xc')][_0x87d9('0x12f')](_0x5d10a7,_0x11f596,_0x1b0873['intKey'],_0x1b0873[_0x87d9('0x5b')],undefined,_0x329850);if(_0x31a58a[_0x87d9('0xa2')]!==-0x1){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('google\x20%s\x20file\x20created',_0x17cdde));var _0x1b6950=this[_0x87d9('0x86')][_0x87d9('0x65')](this,_0x1b0873,_0x17cdde);if(_0x1b6950){for(var _0x14cb8e in _0x1b6950){if(_0x1b6950[_0x87d9('0x8b')](_0x14cb8e)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x130'),_0x14cb8e[_0x87d9('0xf1')]()),_0x1b6950[_0x14cb8e]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x131'),JSON[_0x87d9('0x68')](_0x1b6950)));}}return _0x31a58a;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x132')]=function(_0x4a6e32){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x133'),_0x4a6e32[_0x87d9('0x30')]));if(!this['isConfigured'](_0x4a6e32['appid'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0x134'));}if(!this[_0x87d9('0x9c')](_0x4a6e32[_0x87d9('0x89')])){return this[_0x87d9('0xc')]['noop']('no\x20appsecret\x20configured');}var _0x20fde3=_0x87d9('0x135');var _0x505eee=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x15d703=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x505eee,_0x20fde3);var _0x45b718=!![];if(_0x4a6e32[_0x87d9('0x136')]===_0x87d9('0x12e')){_0x45b718=![];}var _0x39bb24=this[_0x87d9('0xc')][_0x87d9('0x12f')](_0x505eee,_0x20fde3,_0x4a6e32[_0x87d9('0x137')],_0x4a6e32[_0x87d9('0x5b')],undefined,_0x45b718);if(_0x39bb24['result']!==-0x1){this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x138'),_0x15d703));var _0x4fd0e7=this[_0x87d9('0x87')][_0x87d9('0x65')](this,_0x4a6e32,_0x15d703);if(_0x4fd0e7){for(var _0x40e52a in _0x4fd0e7){if(_0x4fd0e7[_0x87d9('0x8b')](_0x40e52a)){this['channel'][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x139'),_0x40e52a[_0x87d9('0xf1')]()),_0x4fd0e7[_0x40e52a]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x13a'),JSON['stringify'](_0x4fd0e7)));}}return _0x39bb24;};AGIVertices[_0x87d9('0xf')][_0x87d9('0x13b')]=function(_0x2f78be){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x13c'),_0x2f78be['label']));return this[_0x87d9('0xc')][_0x87d9('0x13d')](_0x2f78be[_0x87d9('0x13e')],_0x2f78be['extension'],_0x2f78be['priority']);};AGIVertices['prototype']['gotoif']=function(_0x359e50){logger['info'](util['format'](_0x87d9('0x13f'),_0x359e50[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x359e50['condition'])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x359e50,'no\x20condition\x20configured');}try{var _0x12113f=eval(_0x359e50[_0x87d9('0x140')])?_0x87d9('0x141'):_0x87d9('0x142');this['channel'][_0x87d9('0xa3')](util['format'](_0x87d9('0x143'),_0x359e50[_0x87d9('0x140')],_0x12113f));return{'code':0xc8,'result':_0x12113f};}catch(_0x120b36){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x144')]=function(_0x2a0f66){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x2a0f66[_0x87d9('0x30')]));if(!this['isConfigured'](_0x2a0f66[_0x87d9('0x145')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2a0f66,_0x87d9('0x146'));}var _0x1a986b=this['getIntervals'][_0x87d9('0x65')](this,_0x2a0f66[_0x87d9('0x145')]);if(!_0x1a986b){return this['channel']['error'](_0x2a0f66,_0x87d9('0x147'));}for(var _0x29980a=0x0;_0x29980a<_0x1a986b[_0x87d9('0x93')];_0x29980a+=0x1){var _0x4f298d=this[_0x87d9('0xc')][_0x87d9('0x10')](util['format'](_0x87d9('0x148'),_0x1a986b[_0x29980a]));if(_0x4f298d['result']===-0x1){return _0x4f298d;}logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x4f298d[_0x87d9('0x99')]));if(_0x4f298d[_0x87d9('0x99')]===_0x87d9('0x141')){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x141')));this['channel']['noop'](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x141')));return{'code':0xc8,'result':_0x87d9('0x141')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],'false'));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x149'),_0x1a986b[_0x29980a],_0x87d9('0x142')));}}return{'code':0xc8,'result':_0x87d9('0x142')};};AGIVertices[_0x87d9('0xf')][_0x87d9('0x14a')]=function(_0x5652c2){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x14b'),_0x5652c2[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0x14a')]();};AGIVertices['prototype'][_0x87d9('0x14c')]=function(_0xf62dff){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x14d'),_0xf62dff[_0x87d9('0x30')]));if(!this['isConfigured'](_0xf62dff[_0x87d9('0x78')])){return this['channel'][_0x87d9('0xa3')]('no\x20key\x20configured');}var _0x3b0ebf=_0x87d9('0x135');var _0x106dc5=util[_0x87d9('0x24')]('%s/recordings/%s',FILES_PATH,rs[_0x87d9('0x116')](0x4));var _0x238b31=util[_0x87d9('0x24')](_0x87d9('0x95'),_0x106dc5,_0x3b0ebf);var _0x25e474=!![];if(_0xf62dff['beep']==='NOBEEP'){_0x25e474=![];}var _0x1f82a8=this['channel'][_0x87d9('0x12f')](_0x106dc5,_0x3b0ebf,_0xf62dff['intKey'],_0xf62dff[_0x87d9('0x5b')],undefined,_0x25e474);if(_0x1f82a8[_0x87d9('0xa2')]!==-0x1){this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')]('ispeech\x20%s\x20file\x20created',_0x238b31));var _0x5c3756=this['ispeechASR'][_0x87d9('0x65')](this,_0xf62dff,_0x238b31);if(_0x5c3756){for(var _0x3298b1 in _0x5c3756){if(_0x5c3756[_0x87d9('0x8b')](_0x3298b1)){this[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x14e'),_0x3298b1['toUpperCase']()),_0x5c3756[_0x3298b1]);}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x5c3756)));}}return _0x1f82a8;};AGIVertices[_0x87d9('0xf')]['ispeechtts']=function(_0x50aaac){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x14f'),_0x50aaac[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x50aaac[_0x87d9('0x78')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')](_0x87d9('0xe1'));}if(!this[_0x87d9('0x9c')](_0x50aaac[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x150'),_0x50aaac['text']));var _0x271192=this['ispeechTTS'][_0x87d9('0x65')](this,_0x50aaac);if(_0x271192){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x151'),_0x271192));var _0x7a0cc2=this['channel'][_0x87d9('0xfe')](_0x271192,_0x50aaac[_0x87d9('0x137')]);try{fs[_0x87d9('0xff')](_0x271192+'.wav');}catch(_0x3d0279){logger[_0x87d9('0x27')](_0x3d0279);}return _0x7a0cc2;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x50aaac,_0x87d9('0x152'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x153')]=function(_0x5635d2){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x154'),_0x5635d2['label']));if(!this[_0x87d9('0x9c')](_0x5635d2['findBy'])){return this[_0x87d9('0xc')]['error'](_0x5635d2,_0x87d9('0x155'));}logger['info'](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x87d9('0xc')]['callerid'],_0x5635d2['findBy']));var _0x2c28e5=this[_0x87d9('0x48')][_0x87d9('0x65')](this,_0x5635d2[_0x87d9('0x156')]);if(_0x2c28e5){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x157'),this['channel'][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2['findBy']));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x5635d2[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x15a')};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15b')]=function(_0x1ea608){logger['info'](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1ea608[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x1ea608['findBy'])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x1ea608,_0x87d9('0x155'));}logger['info'](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608[_0x87d9('0x156')]));var _0xac1ea4=this['agentLogout'][_0x87d9('0x65')](this,_0x1ea608[_0x87d9('0x156')]);if(_0xac1ea4){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608['findBy']));this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x157'),this[_0x87d9('0xc')]['callerid'],_0x1ea608['findBy']));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')]['callerid'],_0x1ea608[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x1ea608[_0x87d9('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x15c')]=function(_0x5af92b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5af92b[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x5af92b[_0x87d9('0x15d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5af92b,_0x87d9('0x15e'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x15f'),_0x5af92b[_0x87d9('0x15d')]));var _0x42c81e=eval(_0x5af92b[_0x87d9('0x15d')]);if(!this[_0x87d9('0x9c')](_0x5af92b[_0x87d9('0xd1')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xd2'));}var _0x32dfda=this[_0x87d9('0x10')]['sync'](this,_0x5af92b[_0x87d9('0xd1')]);if(!_0x32dfda){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5af92b,_0x87d9('0xd3'));}if(_['isArray'](_0x42c81e)){var _0x21ac4f=this;_0x42c81e['forEach'](function(_0x2a4eb3,_0x128c92){_0x21ac4f[_0x87d9('0xc')][_0x87d9('0x96')](util[_0x87d9('0x24')](_0x87d9('0x160'),_0x32dfda,_0x128c92),_0x2a4eb3);});return this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x161'),_0x32dfda));}else{return this[_0x87d9('0xc')]['setVariable'](_0x32dfda,_0x42c81e);}};AGIVertices[_0x87d9('0xf')]['menu']=function(_0x5ce18e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x162'),_0x5ce18e[_0x87d9('0x30')]));if(_0x5ce18e['retry']===0x0){return this['maxRetry'](_0x5ce18e);}_0x5ce18e[_0x87d9('0x9d')]-=0x1;if(!this[_0x87d9('0x9c')](_0x5ce18e[_0x87d9('0x10d')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5ce18e,_0x87d9('0x10e'));}var _0x235898=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x5ce18e['file_id']);if(!_0x235898){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x5ce18e,_0x87d9('0x110'));}var _0x227cd7=this['channel'][_0x87d9('0x111')](_0x235898,_0x5ce18e[_0x87d9('0x112')],_0x5ce18e[_0x87d9('0x163')]);var _0x1c1564=_0x227cd7['result'];if(_0x227cd7['result']===-0x1){this['createSquareDetailsReport'][_0x87d9('0x65')](this,_0x5ce18e,'-1');return _0x227cd7;}else if(_0x227cd7['extra']===_0x87d9('0x5b')){_0x227cd7[_0x87d9('0xa2')]=_0x227cd7[_0x87d9('0xa2')][_0x87d9('0x93')]>0x0?_0x227cd7['result']:'t';}else if(_[_0x87d9('0x37')](_0x227cd7[_0x87d9('0xa2')])){_0x227cd7['result']='#';_0x1c1564='#';}if(!this['isConfigured'](_0x5ce18e[_0x87d9('0xd1')])){this[_0x87d9('0xc')]['noop'](_0x87d9('0xd2'));}else{var _0x5c5007=this['getVariable'][_0x87d9('0x65')](this,_0x5ce18e[_0x87d9('0xd1')]);if(!_0x5c5007){return this[_0x87d9('0xc')]['error'](_0x5ce18e,'no\x20variable\x20found');}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x5c5007,_0x1c1564);}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x5ce18e,_0x1c1564);return _0x227cd7;};AGIVertices['prototype'][_0x87d9('0xa3')]=function(_0x3176d1){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x164'),_0x3176d1['label']));return this['channel'][_0x87d9('0xa3')](_0x3176d1[_0x87d9('0x165')]||_0x3176d1[_0x87d9('0x30')]);};AGIVertices['prototype'][_0x87d9('0x166')]=function(_0x354ba8){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x354ba8[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x354ba8[_0x87d9('0x156')])){return this[_0x87d9('0xc')]['error'](_0x354ba8,_0x87d9('0x155'));}logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x354ba8[_0x87d9('0x156')]));var _0x4fc43e=this[_0x87d9('0x42')][_0x87d9('0x65')](this,_0x354ba8[_0x87d9('0x167')]);var _0x38e2b2=this[_0x87d9('0x44')][_0x87d9('0x65')](this,_0x354ba8[_0x87d9('0x156')],_0x4fc43e);if(_0x38e2b2){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')]['callerid'],_0x354ba8[_0x87d9('0x156')]));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x87d9('0x47')],_0x354ba8[_0x87d9('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x87d9('0x47')],_0x354ba8['findBy']));this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x87d9('0xc')][_0x87d9('0x47')],_0x354ba8[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x15a')};}};AGIVertices[_0x87d9('0xf')][_0x87d9('0x168')]=function(_0x18033e){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x169'),_0x18033e[_0x87d9('0x30')]));if(!this['isConfigured'](_0x18033e[_0x87d9('0x10d')])){return this[_0x87d9('0xc')]['error'](_0x18033e,'no\x20file\x20audio\x20selected');}var _0x35426d=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x18033e[_0x87d9('0x10d')]);if(!_0x35426d){return this['channel'][_0x87d9('0x27')](_0x18033e,_0x87d9('0x110'));}var _0xe539ec=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x16a'),[_0x35426d,_0x18033e[_0x87d9('0x16b')]]);if(_0xe539ec['result']===-0x1){return _0xe539ec;}return this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x16c'),_0x87d9('0x16a'),_0x35426d));};AGIVertices['prototype'][_0x87d9('0x16d')]=function(_0x14f79c){logger[_0x87d9('0x28')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x14f79c[_0x87d9('0x30')]));if(!this['isConfigured'](_0x14f79c[_0x87d9('0x16e')])){return this['channel']['error'](_0x14f79c,'no\x20queue\x20selected');}var _0x34426c='';var _0x6fda9f=parseInt(_0x14f79c[_0x87d9('0x16e')],0xa);if(isNaN(_0x6fda9f)){_0x34426c=_0x14f79c[_0x87d9('0x16e')];}else{_0x34426c=this[_0x87d9('0x15')][_0x87d9('0x65')](this,_0x14f79c[_0x87d9('0x16e')]);if(!_0x34426c){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x14f79c,_0x87d9('0x16f'));}}var _0x54501e='';if(this['isConfigured'](_0x14f79c[_0x87d9('0x10d')])){var _0x5334c5=this[_0x87d9('0x10f')][_0x87d9('0x65')](this,_0x14f79c[_0x87d9('0x10d')]);if(_0x5334c5){_0x54501e=_0x5334c5;}}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x14f79c,_0x34426c);if(_0x14f79c[_0x87d9('0x16b')][_0x87d9('0x170')]('x')<0x0){_0x14f79c['opts']+='x';}if(_0x14f79c[_0x87d9('0x16b')]['indexOf']('X')<0x0){_0x14f79c[_0x87d9('0x16b')]+='X';}this[_0x87d9('0xc')][_0x87d9('0x96')](_0x87d9('0x171'),_0x34426c?_0x34426c[_0x87d9('0x172')]():'');var _0x5f2819=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x173'),[_0x34426c,_0x14f79c['opts'],_0x14f79c[_0x87d9('0x59')],_0x54501e,_0x14f79c[_0x87d9('0x5b')],_0x14f79c[_0x87d9('0xac')],_0x14f79c[_0x87d9('0x174')],_0x14f79c['gosub'],'',_0x14f79c[_0x87d9('0x175')]]);if(_0x5f2819[_0x87d9('0xa2')]===-0x1){return _0x5f2819;}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Executed\x20command\x20%s\x20%s',_0x87d9('0x173'),_0x34426c));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x176')]=function(_0x21a9c3){logger[_0x87d9('0x28')](util[_0x87d9('0x24')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x21a9c3[_0x87d9('0x30')]));var _0x44f9ab=_0x21a9c3['recordingFormat']||'wav';var _0x2baf8b=util[_0x87d9('0x24')]('%s_%s',this['channel'][_0x87d9('0x2f')],rs[_0x87d9('0x116')](0x5));var _0x553081=util[_0x87d9('0x24')]('%s/recordings/%s.%s',FILES_PATH,_0x2baf8b,_0x44f9ab);var _0x196fef=util[_0x87d9('0x24')](_0x87d9('0x12d'),FILES_PATH,_0x2baf8b);this['createSquareRecording'][_0x87d9('0x65')](this,_0x21a9c3,_0x2baf8b,_0x553081);this[_0x87d9('0xc')]['setVariable'](_0x87d9('0x177'),_0x2baf8b);logger[_0x87d9('0x28')](_0x87d9('0x178'),_0x196fef,_0x44f9ab,_0x21a9c3[_0x87d9('0x179')],_0x21a9c3[_0x87d9('0x5b')]);return this[_0x87d9('0xc')]['recordFile'](_0x196fef,_0x44f9ab,_0x21a9c3[_0x87d9('0x179')],_0x21a9c3[_0x87d9('0x5b')],undefined,!![]);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x17a')]=function(_0x2d86f1){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x17b'),_0x2d86f1[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x2d86f1[_0x87d9('0x59')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0x17c'));}var _0x5af1dd=this[_0x87d9('0x58')][_0x87d9('0x65')](this,_0x2d86f1);logger[_0x87d9('0x28')](util['format'](_0x87d9('0x17d'),util['inspect'](_0x5af1dd,{'showHidden':![],'depth':null})));if(!this[_0x87d9('0x9c')](_0x2d86f1[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1a1591=this['getVariable'][_0x87d9('0x65')](this,_0x2d86f1['variable_id']);if(!_0x1a1591){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x2d86f1,'no\x20variable\x20found');}this[_0x87d9('0xc')][_0x87d9('0x96')](util['format']('%s_STATUS_CODE',_0x1a1591),_0x5af1dd[_0x87d9('0x6a')]?_0x5af1dd[_0x87d9('0x6a')]:'200');this[_0x87d9('0xc')]['setVariable'](util[_0x87d9('0x24')](_0x87d9('0x17e'),_0x1a1591),_0x5af1dd[_0x87d9('0x6b')]?_0x5af1dd[_0x87d9('0x6b')]:'OK');if(_0x5af1dd[_0x87d9('0x5f')]){try{this[_0x87d9('0x94')](_0x5af1dd[_0x87d9('0x5f')],_0x1a1591);}catch(_0x36a974){logger[_0x87d9('0x27')](util[_0x87d9('0x24')](_0x87d9('0x17f'),_0x1a1591));}}return this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')]('variable\x20%s\x20set',_0x1a1591));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x180')]=function(_0x11040b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x181'),_0x11040b[_0x87d9('0x30')]));return this[_0x87d9('0xc')]['sayDigits'](_0x11040b['digits'][_0x87d9('0xce')](/\s+/g,''),_0x11040b[_0x87d9('0x179')]);};AGIVertices['prototype'][_0x87d9('0x182')]=function(_0x29c377){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x183'),_0x29c377['label']));return this[_0x87d9('0xc')][_0x87d9('0x184')](_0x29c377[_0x87d9('0x5c')]['replace'](/\s+/g,''),_0x29c377[_0x87d9('0x179')]);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x185')]=function(_0x1d3b2f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x186'),_0x1d3b2f[_0x87d9('0x30')]));return this[_0x87d9('0xc')][_0x87d9('0x187')](_0x1d3b2f[_0x87d9('0x4f')],_0x1d3b2f['escape_digits']);};AGIVertices[_0x87d9('0xf')][_0x87d9('0x188')]=function(_0x4ecb84){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x189'),_0x4ecb84[_0x87d9('0x30')]));if(!this['isConfigured'](_0x4ecb84[_0x87d9('0x18a')])){return this['channel']['noop'](_0x87d9('0x18b'));}var _0x3ae76f=this[_0x87d9('0x18c')][_0x87d9('0x65')](this,_0x4ecb84[_0x87d9('0x18a')]);if(!_0x3ae76f||!_0x3ae76f[_0x87d9('0x18d')]){return this['channel']['error'](_0x4ecb84,'no\x20mail\x20account\x20found');}var _0x30af9b={'from':util[_0x87d9('0x24')]('\x22%s\x22\x20<%s>',_0x3ae76f[_0x87d9('0x13')],_0x3ae76f['email']||_0x3ae76f[_0x87d9('0x18d')]['user']),'to':_0x4ecb84['to']||'','cc':_0x4ecb84['cc']||'','bcc':_0x4ecb84[_0x87d9('0x18e')]||'','subject':_0x4ecb84[_0x87d9('0x18f')],'html':_0x4ecb84['text'],'text':_0x4ecb84['text']};if(this['isConfigured'](_0x4ecb84[_0x87d9('0x190')])){}logger[_0x87d9('0x191')](_0x87d9('0x192'),JSON[_0x87d9('0x68')](_0x30af9b));this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x4ecb84,_0x4ecb84[_0x87d9('0x18a')]);this[_0x87d9('0xc')]['noop'](util['format'](_0x87d9('0x193'),_0x3ae76f[_0x87d9('0x13')]));this['sendMailMessage']['sync'](this,_0x3ae76f[_0x87d9('0x194')],_0x30af9b);return this['channel'][_0x87d9('0xa3')](_0x87d9('0x195'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x196')]=function(_0xd18f67){logger['info'](util['format'](_0x87d9('0x197'),_0xd18f67[_0x87d9('0x30')]));return this['channel'][_0x87d9('0xa3')](_0x87d9('0x198'));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x199')]=function(_0x2ebc28){logger['info'](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2ebc28['label']));if(!this[_0x87d9('0x9c')](_0x2ebc28['sms_account_id'])){return this[_0x87d9('0xc')][_0x87d9('0xa3')]('no\x20sms\x20account\x20configured');}var _0x20691b=this[_0x87d9('0x2c')][_0x87d9('0x65')](this,_0x2ebc28[_0x87d9('0x19a')]);if(!_0x20691b){return this['channel'][_0x87d9('0x27')](_0x2ebc28,'no\x20sms\x20account\x20found');}var _0x5112b7={'body':_0x2ebc28[_0x87d9('0x19b')],'phone':_0x2ebc28['to']||'','SmsAccountId':_0x20691b['id']};logger[_0x87d9('0x191')](_0x87d9('0x19c'),JSON[_0x87d9('0x68')](_0x5112b7));this['createSquareDetailsReport'][_0x87d9('0x65')](this,_0x2ebc28,_0x2ebc28[_0x87d9('0x19a')]);this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x19d'),_0x20691b[_0x87d9('0x13')]));this[_0x87d9('0x2d')][_0x87d9('0x65')](this,_0x5112b7);return this['channel'][_0x87d9('0xa3')](_0x87d9('0x19e'));};AGIVertices['prototype'][_0x87d9('0x19f')]=function(_0x553dc6){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1a0'),_0x553dc6['label']));if(!this[_0x87d9('0x9c')](_0x553dc6['variable_id'])){return this['channel'][_0x87d9('0x27')](_0x553dc6,'no\x20variable\x20selected');}var _0x4623d1=this[_0x87d9('0x10')][_0x87d9('0x65')](this,_0x553dc6[_0x87d9('0xd1')]);if(!_0x4623d1){return this[_0x87d9('0xc')]['error'](_0x553dc6,_0x87d9('0xd3'));}return this['channel'][_0x87d9('0x96')](_0x4623d1,_0x553dc6['variable_value']);};AGIVertices['prototype']['start']=function(_0x59e68b){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1a1'),_0x59e68b[_0x87d9('0x30')]));this['channel'][_0x87d9('0xa3')](_0x87d9('0x1a2'));if(_0x59e68b[_0x87d9('0xb2')]===_0x87d9('0x1a3')){this[_0x87d9('0xc')]['noop']('Answer');return this['channel'][_0x87d9('0xb2')]();}return this[_0x87d9('0xc')][_0x87d9('0xa3')]('Skipped\x20Answer');};AGIVertices[_0x87d9('0xf')]['subproject']=function(_0xfc8890){logger['info'](util[_0x87d9('0x24')](_0x87d9('0x1a4'),_0xfc8890[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0xfc8890['project_id'])){return this[_0x87d9('0xc')]['error'](_0xfc8890,'no\x20subproject\x20selected');}var _0x2ac98a=this[_0x87d9('0x1a5')][_0x87d9('0x65')](this,_0xfc8890['project_id']);if(!this[_0x87d9('0x9c')](_0x2ac98a)){return this['channel']['error'](_0xfc8890,util['format'](_0x87d9('0x1a6'),_0xfc8890[_0x87d9('0x1a7')]));}if(_0x2ac98a===this[_0x87d9('0xc')][_0x87d9('0x31')]){return this[_0x87d9('0xc')]['error'](_0xfc8890,_0x87d9('0x1a8'));}this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0xfc8890,_0x2ac98a);var _0x18ee9f=this[_0x87d9('0xc')][_0x87d9('0xa0')](_0x87d9('0x1a9'),util[_0x87d9('0x24')](_0x87d9('0x1aa'),config[_0x87d9('0xac')][_0x87d9('0x1ab')]||_0x87d9('0x1ac'),_0x2ac98a,this[_0x87d9('0xc')][_0x87d9('0x31')]));if(_0x18ee9f[_0x87d9('0xa2')]===-0x1){return _0x18ee9f;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x16c'),'AGI',_0x2ac98a));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1ad')]=function(_0x1d833f){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1ae'),_0x1d833f[_0x87d9('0x30')]));var _0x455243=this['shellCommand'][_0x87d9('0x65')](this,_0x1d833f[_0x87d9('0xae')]);this[_0x87d9('0x2e')][_0x87d9('0x65')](this,_0x1d833f,_0x1d833f[_0x87d9('0xae')]);if(this[_0x87d9('0x9c')](_0x1d833f[_0x87d9('0xd1')])){var _0x43f912=this[_0x87d9('0x10')]['sync'](this,_0x1d833f[_0x87d9('0xd1')]);if(_0x43f912){this['channel'][_0x87d9('0x96')](_0x43f912,_0x455243);return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1d833f[_0x87d9('0xae')],_0x43f912));}}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1af'),_0x1d833f[_0x87d9('0xae')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1b0')]=function(_0x515c46){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1b1'),_0x515c46['label']));_0x515c46[_0x87d9('0x4f')]=_0x515c46[_0x87d9('0x4f')][_0x87d9('0xce')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x87d9('0x9c')](_0x515c46[_0x87d9('0x1b2')])){return this[_0x87d9('0xc')]['noop'](_0x87d9('0x1b3'));}if(!this[_0x87d9('0x9c')](_0x515c46[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x515c46[_0x87d9('0x4f')]));var _0x197572=this[_0x87d9('0x4d')][_0x87d9('0x65')](this,_0x515c46);if(_0x197572){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1b4'),_0x197572));var _0x1f1314=this[_0x87d9('0xc')]['streamFile'](_0x197572);try{fs[_0x87d9('0xff')](_0x197572+'.wav');}catch(_0x3ef56c){logger['error'](_0x3ef56c);}return _0x1f1314;}return this[_0x87d9('0xc')]['error'](_0x515c46,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1b5')]=function(_0x3413dc){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1b6'),_0x3413dc[_0x87d9('0x30')]));_0x3413dc[_0x87d9('0x4f')]=_0x3413dc[_0x87d9('0x4f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3413dc[_0x87d9('0x4f')])){return this['channel'][_0x87d9('0xa3')](_0x87d9('0xbd'));}this['channel'][_0x87d9('0xa3')](util[_0x87d9('0x24')](_0x87d9('0x1b7'),_0x3413dc[_0x87d9('0x4f')]));var _0x2edf42=this['googleTTS'][_0x87d9('0x65')](this,_0x3413dc);if(_0x2edf42){this[_0x87d9('0xc')][_0x87d9('0xa3')](util[_0x87d9('0x24')]('Google\x20TTS\x20%s\x20file\x20created',_0x2edf42));var _0x5dc003=this[_0x87d9('0xc')]['streamFile'](_0x2edf42);try{fs[_0x87d9('0xff')](_0x2edf42+_0x87d9('0x121'));}catch(_0xde7454){logger[_0x87d9('0x27')](_0xde7454);}return _0x5dc003;}return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3413dc,_0x87d9('0x1b8'));};AGIVertices['prototype'][_0x87d9('0x1b9')]=function(_0x4a79b8){logger[_0x87d9('0x28')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4a79b8[_0x87d9('0x30')]));if(!this[_0x87d9('0x9c')](_0x4a79b8[_0x87d9('0x156')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x4a79b8,'no\x20find\x20by\x20configured');}logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1ba'),this[_0x87d9('0xc')]['callerid'],_0x4a79b8[_0x87d9('0x156')]));var _0xa83263=this[_0x87d9('0x46')][_0x87d9('0x65')](this,_0x4a79b8[_0x87d9('0x156')]);if(_0xa83263){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x157'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));return{'code':0xc8,'result':_0x87d9('0x158')};}else{logger[_0x87d9('0x28')](util['format'](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));this[_0x87d9('0xc')]['noop'](util[_0x87d9('0x24')](_0x87d9('0x159'),this[_0x87d9('0xc')][_0x87d9('0x47')],_0x4a79b8[_0x87d9('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x87d9('0xf')]['voicemail']=function(_0x526867){logger[_0x87d9('0x28')](util['format'](_0x87d9('0x1bb'),_0x526867[_0x87d9('0x30')]));var _0x27f99e=this[_0x87d9('0xc')][_0x87d9('0xa0')]('VOICEMAIL',[_0x526867[_0x87d9('0x1bc')],_0x526867[_0x87d9('0x6e')]]);if(_0x27f99e[_0x87d9('0xa2')]===-0x1){return _0x27f99e;}return this[_0x87d9('0xc')][_0x87d9('0xa3')](util['format'](_0x87d9('0x16c'),'VOICEMAIL',_0x526867[_0x87d9('0x1bc')]));};AGIVertices[_0x87d9('0xf')][_0x87d9('0x1bd')]=function(_0x3c58d8){logger[_0x87d9('0x28')](util[_0x87d9('0x24')](_0x87d9('0x1be'),_0x3c58d8[_0x87d9('0x30')]));if(!this['isConfigured'](_0x3c58d8[_0x87d9('0xd1')])){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3c58d8,_0x87d9('0x1bf'));}var _0x81aa=this[_0x87d9('0x10')][_0x87d9('0x65')](this,_0x3c58d8[_0x87d9('0xd1')]);if(!_0x81aa){return this[_0x87d9('0xc')][_0x87d9('0x27')](_0x3c58d8,'no\x20variable\x20found');}var _0x5cb214=this['channel']['getVariable'](_0x81aa);return{'code':0xc8,'result':_0x5cb214['extra']?_0x5cb214[_0x87d9('0x99')]:'-'};};String['prototype'][_0x87d9('0x98')]=function(_0x31b7db,_0x135911){return this[_0x87d9('0x97')](_0x31b7db)[_0x87d9('0x1c0')](_0x135911);};module['exports']=AGIVertices; \ No newline at end of file +var _0x36ee=['url','Executed\x20command\x20%s','dialogflow','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','SESTEK_NDA_%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','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','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','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','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','getIntervalById','map','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','PUT','toUpperCase','body','parse','headers','computedVariables','uri','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','tildeASR','appid','appsecret','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','stringify','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','list_id','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL'];(function(_0x2506a9,_0x4e1062){var _0x2139a2=function(_0x3458b0){while(--_0x3458b0){_0x2506a9['push'](_0x2506a9['shift']());}};_0x2139a2(++_0x4e1062);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require(_0xe36e('0x0'));var odbc=require('odbc')();var rs=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var Mustache=require(_0xe36e('0x3'));var rp=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var shared=require(_0xe36e('0x8'));var scripts=require(_0xe36e('0x9'));var FILES_PATH=_0xe36e('0xa');var recursiveMapAttributes=[_0xe36e('0xb'),_0xe36e('0xc')];var verticesWithRetry=['menu',_0xe36e('0xd'),'getsecretdigits'];var AGIVertices=function(_0x2236e9,_0x123c16,_0x46f239){this['channel']=_0x2236e9;this[_0xe36e('0xe')]=_0x123c16;this['mailRpc']=_0x46f239;};AGIVertices[_0xe36e('0xf')][_0xe36e('0x10')]=function(_0x43d604,_0x2ad6fd){this[_0xe36e('0xe')][_0xe36e('0x11')](_0x43d604)[_0xe36e('0x12')](function(_0x265473){_0x2ad6fd(null,_0x265473?_0x265473['name']:![]);})[_0xe36e('0x13')](function(_0x27841e){_0x2ad6fd(_0x27841e);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x14')]=function(_0x5c3f3c,_0x3e264a){this['rpc']['getVoiceQueueById'](_0x5c3f3c)[_0xe36e('0x12')](function(_0x300f21){_0x3e264a(null,_0x300f21?_0x300f21[_0xe36e('0x15')]:![]);})[_0xe36e('0x13')](function(_0xd6828e){_0x3e264a(_0xd6828e);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x16')]=function(_0x39bae8,_0x387c37){this[_0xe36e('0xe')]['getSquareProjectById'](_0x39bae8)[_0xe36e('0x12')](function(_0x2184ae){_0x387c37(null,_0x2184ae?_0x2184ae['name']:![]);})[_0xe36e('0x13')](function(_0x533c06){_0x387c37(_0x533c06);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x17')]=function(_0x5e15f5,_0x472825){this[_0xe36e('0xe')][_0xe36e('0x18')](_0x5e15f5)['then'](function(_0x21e95e){_0x472825(null,_0x21e95e?_0x21e95e[_0xe36e('0x19')]:![]);})[_0xe36e('0x13')](function(_0x3c4017){_0x472825(_0x3c4017);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1a')]=function(_0x4f438a,_0xd71137){this[_0xe36e('0xe')][_0xe36e('0x1b')](_0x4f438a)[_0xe36e('0x12')](function(_0x437f3f){_0xd71137(null,_0x437f3f?_0x437f3f['name']:![]);})['catch'](function(_0x4749a8){_0xd71137(_0x4749a8);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1c')]=function(_0xb32195,_0x31c12c){this[_0xe36e('0xe')][_0xe36e('0x1d')](_0xb32195)['then'](function(_0x3cafbf){_0x31c12c(null,_0x3cafbf?_0x3cafbf[_0xe36e('0x15')]:![]);})[_0xe36e('0x13')](function(_0x262caa){_0x31c12c(_0x262caa);});};AGIVertices['prototype'][_0xe36e('0x1e')]=function(_0x5a3133,_0xf7b02e){var _0x5993de=this;this[_0xe36e('0xe')]['getSoundById'](_0x5a3133)[_0xe36e('0x12')](function(_0x4c5d98){_0xf7b02e(null,_0x4c5d98?_0x5993de[_0xe36e('0x1f')](_0x4c5d98['save_name']):![]);})['catch'](function(_0x5d8fd8){_0xf7b02e(_0x5d8fd8);});};AGIVertices['prototype'][_0xe36e('0x20')]=function(_0x1fc639,_0x4cf185){this['rpc'][_0xe36e('0x21')](_0x1fc639)[_0xe36e('0x12')](function(_0x259e19){_0x4cf185(null,_0x259e19?_0x259e19:![]);})[_0xe36e('0x13')](function(_0x3d826e){_0x4cf185(_0x3d826e);});};AGIVertices[_0xe36e('0xf')]['sendMailMessage']=function(_0xb98e78,_0x11c95d,_0x57272f){this[_0xe36e('0x22')][_0xe36e('0x23')](_0xb98e78,_0x11c95d)[_0xe36e('0x12')](function(){_0x57272f(null);})[_0xe36e('0x13')](function(_0x21623e){_0x57272f(_0x21623e);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x24')]=function(_0x127807,_0x36cee2){this[_0xe36e('0xe')][_0xe36e('0x25')](_0x127807)['then'](function(_0x4507b9){if(_0x4507b9){if(_0x4507b9['IntervalId']){_0x36cee2(null,[_0x4507b9['interval']]);}else{_0x36cee2(null,_[_0xe36e('0x26')](_0x4507b9['Intervals'],_0xe36e('0x27')));}}else{_0x36cee2(null,![]);}})[_0xe36e('0x13')](function(_0x38bdbc){_0x36cee2(_0x38bdbc);});};AGIVertices[_0xe36e('0xf')]['getSoundPath']=function(_0x56135c){return util[_0xe36e('0x28')](_0xe36e('0x29'),FILES_PATH,_0x56135c);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x2a')]=function(_0x51894c,_0xb2046c,_0x2f828e){odbc[_0xe36e('0x2b')](_0x51894c,function(_0x5b7a97){if(_0x5b7a97){logger[_0xe36e('0x2c')](_0xe36e('0x2d'),_0x5b7a97);_0x2f828e(_0x5b7a97);}else{logger['info'](_0xe36e('0x2e'));odbc[_0xe36e('0x2f')](_0xb2046c,function(_0x3a95d7,_0x11d7b9){if(_0x3a95d7){logger[_0xe36e('0x30')](_0xe36e('0x31'),_0xb2046c);_0x2f828e(_0x3a95d7);}else{logger[_0xe36e('0x30')](_0xe36e('0x32'),_0xb2046c);odbc[_0xe36e('0x33')](function(_0x23da09){if(_0x23da09){logger[_0xe36e('0x2c')](_0xe36e('0x34'),_0x23da09);}_0x2f828e(null,_0x11d7b9);});}});}});};AGIVertices[_0xe36e('0xf')]['getSmsAccount']=function(_0x23d36e,_0x134fb2){this[_0xe36e('0xe')][_0xe36e('0x35')](_0x23d36e)[_0xe36e('0x12')](function(_0x4d133b){_0x134fb2(null,_0x4d133b?_0x4d133b:![]);})['catch'](function(_0x4094c6){_0x134fb2(_0x4094c6);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x36')]=function(_0x537e1a,_0x27caff){this[_0xe36e('0xe')][_0xe36e('0x36')](_0x537e1a)[_0xe36e('0x12')](function(_0x48066c){_0x27caff(null,_0x48066c);})[_0xe36e('0x13')](function(_0x2d392c){_0x27caff(_0x2d392c);});};AGIVertices['prototype'][_0xe36e('0x37')]=function(_0x5ef3e4,_0x23e344,_0x44d5cc){this[_0xe36e('0xe')][_0xe36e('0x37')]({'uniqueid':this[_0xe36e('0x38')]['uniqueid'],'node':_0x5ef3e4[_0xe36e('0x39')],'application':_0x5ef3e4[_0xe36e('0x3a')],'data':_0x23e344||null,'project_name':this[_0xe36e('0x38')][_0xe36e('0x3b')],'callerid':this[_0xe36e('0x38')][_0xe36e('0x3c')]})['then'](function(_0x122704){if(_0x44d5cc){_0x44d5cc(null,_0x122704);}})[_0xe36e('0x13')](function(_0x2a6817){if(_0x44d5cc){_0x44d5cc(_0x2a6817);}});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x3d')]=function(_0x49cf4b,_0x3db8ce,_0x31e1ec,_0x390d9d){this[_0xe36e('0xe')][_0xe36e('0x3d')]({'uniqueid':this[_0xe36e('0x38')][_0xe36e('0x3e')],'callerid':this[_0xe36e('0x38')][_0xe36e('0x3c')],'calleridname':this['channel']['calleridname'],'context':this[_0xe36e('0x38')]['context'],'extension':this[_0xe36e('0x38')][_0xe36e('0x3f')],'priority':this[_0xe36e('0x38')][_0xe36e('0x40')],'accountcode':this['channel'][_0xe36e('0x41')],'dnid':this[_0xe36e('0x38')]['dnid'],'projectName':this[_0xe36e('0x38')][_0xe36e('0x3b')],'saveName':_0x3db8ce,'filename':_0x49cf4b[_0xe36e('0x42')]||_0x3db8ce,'savePath':_0x31e1ec})[_0xe36e('0x12')](function(_0x15895d){_0x390d9d(null,_0x15895d);})[_0xe36e('0x13')](function(_0x436a12){_0x390d9d(_0x436a12);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x43')]=function(_0x3a99aa,_0x7307bc,_0x13ccc5,_0x3147c0,_0x25eb4a){this[_0xe36e('0xe')]['createSquareMessage']({'uniqueid':this[_0xe36e('0x38')]['uniqueid'],'body':_0x3a99aa,'direction':_0x7307bc,'providerName':_0x13ccc5,'providerResponse':_0x3147c0})['then'](function(_0x10b8ff){if(_0x25eb4a){_0x25eb4a(null,_0x10b8ff);}})[_0xe36e('0x13')](function(_0x5b6ea2){if(_0x25eb4a){_0x25eb4a(_0x5b6ea2);}});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x44')]=function(_0x8a767a,_0x1f4a5d){this[_0xe36e('0xe')][_0xe36e('0x44')]({'firstName':_[_0xe36e('0x45')](_0x8a767a[_0xe36e('0x15')])||_[_0xe36e('0x46')](_0x8a767a['name'])?_0xe36e('0x47')+Math[_0xe36e('0x48')]():_0x8a767a['name'],'lastName':_[_0xe36e('0x45')](_0x8a767a[_0xe36e('0x49')])||_[_0xe36e('0x46')](_0x8a767a[_0xe36e('0x49')])?null:_0x8a767a[_0xe36e('0x49')],'phone':_0x8a767a['phone'],'ListId':_0x8a767a['list_id'],'scheduledat':_0x8a767a['scheduledAt'],'callbackUniqueid':this['channel'][_0xe36e('0x3e')],'tags':_0xe36e('0x4a'),'description':_0xe36e('0x4b')+_0x8a767a[_0xe36e('0x4c')][_0xe36e('0x4d')](),'priority':_0x8a767a[_0xe36e('0x4e')]})[_0xe36e('0x12')](function(_0x17965c){_0x1f4a5d(null,_0x17965c);})[_0xe36e('0x13')](function(_0x5045e6){_0x1f4a5d(_0x5045e6);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x4f')]=function(_0x5a058b,_0xd0733f){this[_0xe36e('0xe')][_0xe36e('0x50')](_0x5a058b)[_0xe36e('0x12')](function(_0x700b63){_0xd0733f(null,_0x700b63?_0x700b63[_0xe36e('0x15')]:![]);})[_0xe36e('0x13')](function(_0x1a70d1){_0xd0733f(_0x1a70d1);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x51')]=function(_0x56718a,_0x2cf7fc,_0x389e91){var _0x6f979f={'role':_0xe36e('0x52')};_0x6f979f[_0x56718a]=this[_0xe36e('0x38')][_0xe36e('0x3c')];this[_0xe36e('0xe')][_0xe36e('0x51')](_0x6f979f,_0x2cf7fc,this[_0xe36e('0x38')][_0xe36e('0x3e')])[_0xe36e('0x12')](function(_0x23c5e0){_0x389e91(null,_[_0xe36e('0x46')](_0x23c5e0)?![]:!![]);})[_0xe36e('0x13')](function(_0x5a8795){logger[_0xe36e('0x2c')](_0x5a8795);_0x389e91(null,![]);});};AGIVertices[_0xe36e('0xf')]['agentUnpause']=function(_0xce5583,_0x41bad0){var _0x180dc3={'role':_0xe36e('0x52')};_0x180dc3[_0xce5583]=this[_0xe36e('0x38')][_0xe36e('0x3c')];this['rpc'][_0xe36e('0x53')](_0x180dc3)['then'](function(_0x3b8ed8){_0x41bad0(null,_[_0xe36e('0x46')](_0x3b8ed8)?![]:!![]);})[_0xe36e('0x13')](function(_0x4148d0){logger[_0xe36e('0x2c')](_0x4148d0);_0x41bad0(null,![]);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x54')]=function(_0xfea627,_0x4c8d2b){var _0x34c7a5={'role':_0xe36e('0x52')};_0x34c7a5[_0xfea627]=this['channel'][_0xe36e('0x3c')];this[_0xe36e('0xe')][_0xe36e('0x54')](_0x34c7a5)[_0xe36e('0x12')](function(_0x30786a){_0x4c8d2b(null,_[_0xe36e('0x46')](_0x30786a)?![]:!![]);})[_0xe36e('0x13')](function(_0x48ff05){logger[_0xe36e('0x2c')](_0x48ff05);_0x4c8d2b(null,![]);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x55')]=function(_0x1b7268,_0x1fd5d1){var _0x43d8c2={'role':_0xe36e('0x52')};_0x43d8c2[_0x1b7268]=this[_0xe36e('0x38')][_0xe36e('0x3c')];var _0xeab452=_0x1b7268!=_0xe36e('0x56')?util['format'](_0xe36e('0x57'),_0xe36e('0x58'),this[_0xe36e('0x38')][_0xe36e('0x3c')]):undefined;this['rpc']['agentLogin'](_0x43d8c2,_0xeab452)[_0xe36e('0x12')](function(_0x55911b){_0x1fd5d1(null,_['isNil'](_0x55911b)?![]:!![]);})['catch'](function(_0xe0a282){logger['error'](_0xe0a282);_0x1fd5d1(null,![]);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x59')]=function(_0x258a63,_0x221a90){sh[_0xe36e('0x5a')](_[_0xe36e('0x5b')](_0x258a63),function(_0x11e610,_0x14a9b4){var _0x2a26f4=_0x14a9b4['replace'](/(\r\n|\n|\r)/gm,'');_0x221a90(null,_0x2a26f4);});};AGIVertices[_0xe36e('0xf')]['googleCloudTTS']=function(_0x13ad07,_0x517c2a){scripts[_0xe36e('0x5c')](_0x13ad07[_0xe36e('0x5d')],_0x13ad07[_0xe36e('0x5e')]||_0xe36e('0x5f'),_0x13ad07['text'],_0x13ad07['languageCode']||_0xe36e('0x60'),_0x13ad07[_0xe36e('0x61')]||_0xe36e('0x62'),_0x13ad07[_0xe36e('0x63')]||_0xe36e('0x64'))[_0xe36e('0x12')](function(_0x57ae0d){_0x517c2a(null,_0x57ae0d);})[_0xe36e('0x13')](function(_0x1e216c){_0x517c2a(_0x1e216c);});};AGIVertices['prototype'][_0xe36e('0x65')]=function(_0x5eea4f,_0x45ebca){scripts[_0xe36e('0x65')](_0x5eea4f[_0xe36e('0x5f')],_0x5eea4f[_0xe36e('0x66')]||'en',0x1)['then'](function(_0x2d920e){_0x45ebca(null,_0x2d920e);})['catch'](function(_0x49a74b){_0x45ebca(_0x49a74b);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x67')]=function(_0x5554ab,_0x51f319){var _0x460cc9={'uri':_0x5554ab['url'],'method':_0x5554ab[_0xe36e('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5554ab[_0xe36e('0x69')])===_0xe36e('0x6a')&&parseInt(_0x5554ab[_0xe36e('0x69')])>=0x1?parseInt(_0x5554ab[_0xe36e('0x69')])*0x3e8:0x5*0x3e8};if(_[_0xe36e('0x6b')](['POST',_0xe36e('0x6c')],_0x460cc9[_0xe36e('0x68')][_0xe36e('0x6d')]())){try{_0x460cc9[_0xe36e('0x6e')]=_0x5554ab['rawBody']?JSON[_0xe36e('0x6f')](_0x5554ab[_0xe36e('0xc')]):{};}catch(_0x2eef73){logger[_0xe36e('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2eef73);}}try{_0x460cc9[_0xe36e('0x70')]=_0x5554ab['rawHeaders']?JSON[_0xe36e('0x6f')](_0x5554ab['rawHeaders']):{};}catch(_0x160621){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x160621);}if(_0x5554ab[_0xe36e('0x71')]){try{var _0x1fcddb=require(_0x5554ab[_0xe36e('0x71')])['sync'](this,_0x460cc9);_0x460cc9[_0xe36e('0x72')]=Mustache[_0xe36e('0x73')](_0x5554ab['url'],_0x1fcddb,{},['$$','$$']);if(_0x460cc9[_0xe36e('0x70')]){_0x460cc9[_0xe36e('0x70')]=JSON[_0xe36e('0x6f')](Mustache['render'](JSON['stringify'](_0x460cc9[_0xe36e('0x70')]),_0x1fcddb,{},['$$','$$']));}if(_0x460cc9[_0xe36e('0x6e')]){_0x460cc9[_0xe36e('0x6e')]=JSON[_0xe36e('0x6f')](Mustache[_0xe36e('0x73')](JSON['stringify'](_0x460cc9[_0xe36e('0x6e')]),_0x1fcddb,{},['$$','$$']));}}catch(_0x2847a2){logger[_0xe36e('0x2c')](_0xe36e('0x74'),_0x2847a2);}}rp(_0x460cc9)[_0xe36e('0x12')](function(_0x5bdeea){var _0x3712f6={'statusCode':_0x5bdeea[_0xe36e('0x75')]||0xc8,'statusMessage':_0x5bdeea[_0xe36e('0x76')]||'OK','headers':_0x5bdeea['headers']||{},'body':_0x5bdeea[_0xe36e('0x6e')]||{}};_0x51f319(null,_0x3712f6);})['catch'](function(_0x2ee394){var _0x4c1845={'statusCode':_0x2ee394[_0xe36e('0x75')]||0x1f4,'statusMessage':_0x2ee394[_0xe36e('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2ee394[_0xe36e('0x78')]['headers']||{},'body':_0x2ee394[_0xe36e('0x78')][_0xe36e('0x6e')]||{}};_0x51f319(null,_0x4c1845);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x79')]=function(_0x431aac,_0x47ce05){scripts[_0xe36e('0x79')](this['channel'][_0xe36e('0x3e')],_0x431aac[_0xe36e('0x7a')],_0x431aac[_0xe36e('0x5f')],_0x431aac[_0xe36e('0x7b')]||'en')[_0xe36e('0x12')](function(_0x7cffc6){_0x47ce05(null,_0x7cffc6);})['catch'](function(_0x401715){_0x47ce05(_0x401715);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x7c')]=function(_0x4fd01d,_0xf55a4b){scripts[_0xe36e('0x7c')](this[_0xe36e('0x38')][_0xe36e('0x3e')],_0x4fd01d['dialogflowV2_project_id'],_0x4fd01d[_0xe36e('0x7d')],_0x4fd01d['private_key'],_0x4fd01d[_0xe36e('0x5f')],_0x4fd01d['dialogflowV2_language']||'en')[_0xe36e('0x12')](function(_0x357d74){_0xf55a4b(null,_0x357d74);})[_0xe36e('0x13')](function(_0x49a89c){_0xf55a4b(_0x49a89c);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x7e')]=function(_0x4dcadf,_0x12f371){scripts[_0xe36e('0x7e')](this[_0xe36e('0x38')],_0x4dcadf)['then'](function(_0x4acaa4){_0x12f371(null,_0x4acaa4);})[_0xe36e('0x13')](function(_0xad1faf){_0x12f371(_0xad1faf);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x7f')]=function(_0x1fb729,_0x5e62f1){scripts[_0xe36e('0x7f')](_0x1fb729[_0xe36e('0x7a')],_0x1fb729[_0xe36e('0x5f')],_0x1fb729[_0xe36e('0x80')]||'en-US',_0x1fb729[_0xe36e('0x81')])[_0xe36e('0x12')](function(_0x4b1024){_0x5e62f1(null,_0x4b1024);})['catch'](function(_0x5368cb){_0x5e62f1(_0x5368cb);});};AGIVertices[_0xe36e('0xf')]['ispeechASR']=function(_0x58b0df,_0x310ec2,_0x96f37a){scripts[_0xe36e('0x82')](_0x310ec2,_0x58b0df[_0xe36e('0x7a')],_0x58b0df[_0xe36e('0x83')]||_0xe36e('0x60'),this['isConfigured'](_0x58b0df[_0xe36e('0x84')])?_0x58b0df['model']:undefined)['then'](function(_0x4451ec){_0x96f37a(null,_0x4451ec);})[_0xe36e('0x13')](function(_0x1e45c7){_0x96f37a(_0x1e45c7);});};AGIVertices[_0xe36e('0xf')]['awsPolly']=function(_0x30ce48,_0x17d66a){scripts[_0xe36e('0x85')](_0x30ce48[_0xe36e('0x86')],_0x30ce48['aws_secret_access_key'],_0x30ce48[_0xe36e('0x87')],_0x30ce48['aws_polly_voice']||_0xe36e('0x88'),_0x30ce48[_0xe36e('0x5f')],_0x30ce48[_0xe36e('0x89')]||_0xe36e('0x5f'))[_0xe36e('0x12')](function(_0x4c51b3){_0x17d66a(null,_0x4c51b3);})[_0xe36e('0x13')](function(_0x1a57d1){_0x17d66a(_0x1a57d1);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x8a')]=function(_0x11d3bc,_0x28d1cc){scripts[_0xe36e('0x8a')](this[_0xe36e('0x38')][_0xe36e('0x3e')],_0x11d3bc[_0xe36e('0x86')],_0x11d3bc[_0xe36e('0x8b')],_0x11d3bc[_0xe36e('0x8c')],_0x11d3bc[_0xe36e('0x5f')],_0x11d3bc['aws_bot_name'])['then'](function(_0x51ec1f){_0x28d1cc(null,_0x51ec1f);})[_0xe36e('0x13')](function(_0x4386ee){_0x28d1cc(_0x4386ee);});};AGIVertices[_0xe36e('0xf')][_0xe36e('0x8d')]=function(_0x5026ee,_0x1edfd5,_0x882697){scripts[_0xe36e('0x8d')](_0x1edfd5,_0x5026ee[_0xe36e('0x7a')],_0x5026ee['google_asr_language']||_0xe36e('0x60'))[_0xe36e('0x12')](function(_0xdd1816){_0x882697(null,_0xdd1816);})[_0xe36e('0x13')](function(_0x515a79){_0x882697(_0x515a79);});};AGIVertices['prototype'][_0xe36e('0x8e')]=function(_0x33f65f,_0x505c9a,_0x4a40f9){scripts['tildeASR'](_0x505c9a,_0x33f65f[_0xe36e('0x8f')],_0x33f65f[_0xe36e('0x90')],_0x33f65f[_0xe36e('0x72')])['then'](function(_0x33ad0c){_0x4a40f9(null,_0x33ad0c);})[_0xe36e('0x13')](function(_0x280812){_0x4a40f9(_0x280812);});};AGIVertices[_0xe36e('0xf')]['clear']=function(_0x470095){var _0xd25f52=_[_0xe36e('0x6b')](verticesWithRetry,_0x470095[_0xe36e('0x3a')])?_0x470095:_['clone'](_0x470095);for(var _0x3de53b in _0xd25f52){if(_0xd25f52['hasOwnProperty'](_0x3de53b)){if(_0xd25f52[_0x3de53b]&&_[_0xe36e('0x91')](_0xd25f52[_0x3de53b])){if(_['includes'](recursiveMapAttributes,_0x3de53b)){_0xd25f52[_0x3de53b]=this[_0xe36e('0x92')](_0xd25f52[_0x3de53b]);}else{_0xd25f52[_0x3de53b]=this[_0xe36e('0x93')](_0xd25f52[_0x3de53b]);}}}}return _0xd25f52;};AGIVertices['prototype'][_0xe36e('0x94')]=function(_0x3878d3){for(var _0x553509 in _0x3878d3){if(_0x3878d3[_0xe36e('0x95')](_0x553509)){if(_[_0xe36e('0x96')](_0x3878d3[_0x553509])){this[_0xe36e('0x94')](_0x3878d3[_0x553509]);}else if(_[_0xe36e('0x97')](_0x3878d3[_0x553509])){for(var _0x1db9b3=0x0;_0x1db9b3<_0x3878d3[_0x553509][_0xe36e('0x98')];_0x1db9b3++){this['recursiveNodeIndex'](_0x3878d3[_0x553509][_0x1db9b3]);}}else if(_[_0xe36e('0x91')](_0x3878d3[_0x553509])){_0x3878d3[_0x553509]=this[_0xe36e('0x93')](_0x3878d3[_0x553509]);}}}};AGIVertices['prototype'][_0xe36e('0x99')]=function(_0x48e276,_0x110ef9){for(var _0x7872d5 in _0x48e276){if(_0x48e276[_0xe36e('0x95')](_0x7872d5)){if(_[_0xe36e('0x96')](_0x48e276[_0x7872d5])){if(!_['isEmpty'](_0x48e276[_0x7872d5])){this[_0xe36e('0x99')](_0x48e276[_0x7872d5],util[_0xe36e('0x28')](_0xe36e('0x9a'),_0x110ef9,_0x7872d5));}}else if(_[_0xe36e('0x97')](_0x48e276[_0x7872d5])){for(var _0x43f149=0x0;_0x43f149<_0x48e276[_0x7872d5]['length'];_0x43f149++){this[_0xe36e('0x99')](_0x48e276[_0x7872d5][_0x43f149],util[_0xe36e('0x28')]('%s.%s',_0x110ef9,_0x7872d5+'['+_0x43f149+']'));}}else{if(!_['isNil'](_0x48e276[_0x7872d5])){this[_0xe36e('0x38')]['setVariable'](util[_0xe36e('0x28')](_0xe36e('0x9a'),_0x110ef9,_0x7872d5),_0x48e276[_0x7872d5]);}}}}};AGIVertices[_0xe36e('0xf')][_0xe36e('0x92')]=function(_0x43bfa7){try{var _0x3bd8e1=JSON[_0xe36e('0x6f')](_0x43bfa7);this[_0xe36e('0x94')](_0x3bd8e1);return JSON[_0xe36e('0x9b')](_0x3bd8e1);}catch(_0x11958b){return this['replaceAllVariables'](_0x43bfa7);}};AGIVertices[_0xe36e('0xf')]['replaceAllVariables']=function(_0x207ee5){var _0x1be378=_0x207ee5[_0xe36e('0x9c')]('{');for(var _0x5bd002=0x1;_0x5bd002<_0x1be378[_0xe36e('0x98')];_0x5bd002+=0x1){var _0x947053=_0x1be378[_0x5bd002]['split']('}');if(_0x947053[_0xe36e('0x98')]>0x1){_0x207ee5=_0x207ee5['replaceAll']('{'+_0x947053[0x0]+'}',this[_0xe36e('0x38')][_0xe36e('0x10')](_0x947053[0x0])[_0xe36e('0x9d')]||_0x947053[0x0]);}}if(_0x1be378[_0xe36e('0x98')]===0x1){return _0x207ee5[_0xe36e('0x4d')]();}return this[_0xe36e('0x93')](_0x207ee5);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x9e')]=function(_0x7be4ef,_0x31ae71){var _0x166c22=this['channel']['getVariable'](_0x7be4ef);if(_0x166c22[_0xe36e('0x9f')]===-0x1){return _0x166c22;}logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xa0'),_0x31ae71,_0x166c22['extra']));return this[_0xe36e('0x38')][_0xe36e('0xa1')](_0x31ae71,_0x166c22['extra']);};AGIVertices[_0xe36e('0xf')]['isConfigured']=function(_0x260fff){return _0x260fff&&_0x260fff!=='0'&&_0x260fff!=='-1'&&_0x260fff!=='';};AGIVertices[_0xe36e('0xf')][_0xe36e('0xa2')]=function(_0x5bc8b1){this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x5bc8b1,'-');_0x5bc8b1[_0xe36e('0xa4')]=_0x5bc8b1[_0xe36e('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe36e('0xf')][_0xe36e('0xa5')]=function(_0x3c325d){logger['info'](util[_0xe36e('0x28')](_0xe36e('0xa6'),_0x3c325d[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x3c325d[_0xe36e('0x5f')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}var _0xacc91e='\x22'+_0x3c325d['text']+'\x22';if(this[_0xe36e('0xa7')](_0x3c325d[_0xe36e('0x78')])){_0xacc91e+=','+_0x3c325d['options'];}var _0x5f22ee=this['channel'][_0xe36e('0x5a')](_0xe36e('0xaa'),_0xacc91e);if(_0x5f22ee['result']===-0x1){return _0x5f22ee;}return this[_0xe36e('0x38')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0xacc91e));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xab')]=function(_0x59e396){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x59e396[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x59e396['grammar'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20grammar\x20configured');}var _0x553f80=_0x59e396[_0xe36e('0xac')];if(this[_0xe36e('0xa7')](_0x59e396[_0xe36e('0x78')])){_0x553f80+=','+_0x59e396[_0xe36e('0x78')];}var _0x38dced=this[_0xe36e('0x38')][_0xe36e('0x5a')](_0xe36e('0xad'),_0x553f80);if(_0x38dced['result']===-0x1){return _0x38dced;}var _0x44cf3d=this[_0xe36e('0x9e')](_0xe36e('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x44cf3d[_0xe36e('0x9f')]===-0x1){return _0x44cf3d;}var _0x15018a=this[_0xe36e('0x9e')](_0xe36e('0xaf'),_0xe36e('0xb0'));if(_0x15018a[_0xe36e('0x9f')]===-0x1){return _0x15018a;}var _0x481f02=this[_0xe36e('0x9e')](_0xe36e('0xb1'),'MRCP_RECOG_INSTANCE');if(_0x481f02['result']===-0x1){return _0x481f02;}return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0xb2'),_0x553f80));};AGIVertices['prototype'][_0xe36e('0x6')]=function(_0x2bff1b){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x2bff1b['label']));return this[_0xe36e('0x38')][_0xe36e('0x6')]([_0x2bff1b[_0xe36e('0xb3')],_0x2bff1b[_0xe36e('0xb4')]]);};AGIVertices[_0xe36e('0xf')][_0xe36e('0xb5')]=function(_0x1ec6c5){logger['info'](util[_0xe36e('0x28')](_0xe36e('0xb6'),_0x1ec6c5[_0xe36e('0x39')]));if(this[_0xe36e('0xa7')](_0x1ec6c5[_0xe36e('0x69')])){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xb7'),_0x1ec6c5[_0xe36e('0x69')]));var _0x120229=this[_0xe36e('0x38')]['wait'](_0x1ec6c5[_0xe36e('0x69')]);if(_0x120229[_0xe36e('0x9f')]===-0x1){return _0x120229;}}return this[_0xe36e('0x38')][_0xe36e('0xb5')]();};AGIVertices['prototype']['callback']=function(_0x37f186){logger['info'](util[_0xe36e('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x37f186[_0xe36e('0x39')]));if(!this['isConfigured'](_0x37f186[_0xe36e('0xb8')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x37f186,_0xe36e('0xb9'));}_0x37f186[_0xe36e('0x4c')]=moment();if(this['isConfigured'](_0x37f186[_0xe36e('0xba')])){_0x37f186[_0xe36e('0x4c')]=moment()[_0xe36e('0xbb')](_0x37f186['delay'],'minutes');}if(!this[_0xe36e('0xa7')](_0x37f186[_0xe36e('0x4e')])){_0x37f186['callback_priority']=0x2;}this[_0xe36e('0x44')]['sync'](this,_0x37f186);return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xbc'),_0x37f186[_0xe36e('0xbd')],_0x37f186[_0xe36e('0xb8')],_0x37f186[_0xe36e('0x4c')]));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xbe')]=function(_0x2de215){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xbf'),_0x2de215['label']));var _0x2ad011=this['channel'][_0xe36e('0x5a')](_0x2de215[_0xe36e('0xc0')],_0x2de215[_0xe36e('0x78')]);if(_0x2ad011[_0xe36e('0x9f')]===-0x1){return _0x2ad011;}return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0xc1'),_0x2de215[_0xe36e('0xc0')],_0x2de215[_0xe36e('0x78')]));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xc2')]=function(_0x34ce6b){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xc3'),_0x34ce6b[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x34ce6b[_0xe36e('0x5f')])){return this[_0xe36e('0x38')]['noop'](_0xe36e('0xa9'));}var _0x266c7c='\x22'+_0x34ce6b['text']+'\x22';if(this[_0xe36e('0xa7')](_0x34ce6b['options'])){_0x266c7c+=','+_0x34ce6b[_0xe36e('0x78')];}var _0x5ce26c=this[_0xe36e('0x38')][_0xe36e('0x5a')](_0xe36e('0xaa'),_0x266c7c);if(_0x5ce26c[_0xe36e('0x9f')]===-0x1){return _0x5ce26c;}return this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xc4'),_0x266c7c));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xc5')]=function(_0x442c90){logger['info'](util[_0xe36e('0x28')](_0xe36e('0xc6'),_0x442c90[_0xe36e('0x39')]));if(!this['isConfigured'](_0x442c90['text'])){return this[_0xe36e('0x38')]['noop'](_0xe36e('0xa9'));}var _0x53db88='\x22'+_0x442c90[_0xe36e('0x5f')]+'\x22';if(this['isConfigured'](_0x442c90[_0xe36e('0x78')])){_0x53db88+=','+_0x442c90[_0xe36e('0x78')];}var _0x3e2327=this[_0xe36e('0x38')][_0xe36e('0x5a')](_0xe36e('0xaa'),_0x53db88);if(_0x3e2327['result']===-0x1){return _0x3e2327;}return this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xc4'),_0x53db88));};AGIVertices['prototype'][_0xe36e('0xc7')]=function(_0x44477c){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xc8'),_0x44477c[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x44477c['grammar'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xc9'));}var _0x5ade23=_0x44477c[_0xe36e('0xac')];if(this[_0xe36e('0xa7')](_0x44477c['options'])){_0x5ade23+=','+_0x44477c[_0xe36e('0x78')];}var _0x5dab5a=this['channel'][_0xe36e('0x5a')]('MRCPRecog',_0x5ade23);if(_0x5dab5a[_0xe36e('0x9f')]===-0x1){return _0x5dab5a;}var _0x3a7fdf=this[_0xe36e('0x9e')]('RECOG_CONFIDENCE()',_0xe36e('0xca'));if(_0x3a7fdf[_0xe36e('0x9f')]===-0x1){return _0x3a7fdf;}var _0x2a76e9=this[_0xe36e('0x9e')](_0xe36e('0xaf'),_0xe36e('0xcb'));if(_0x2a76e9[_0xe36e('0x9f')]===-0x1){return _0x2a76e9;}var _0x30d0e2=this[_0xe36e('0x9e')](_0xe36e('0xb1'),_0xe36e('0xcc'));if(_0x30d0e2[_0xe36e('0x9f')]===-0x1){return _0x30d0e2;}return this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5ade23));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xcd')]=function(_0x49fe4f){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x49fe4f[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x49fe4f[_0xe36e('0xac')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xc9'));}var _0x7daf47=_0x49fe4f[_0xe36e('0xac')];if(this[_0xe36e('0xa7')](_0x49fe4f[_0xe36e('0x78')])){_0x7daf47+=','+_0x49fe4f['options'];}var _0x2d593b=this[_0xe36e('0x38')]['exec'](_0xe36e('0xad'),_0x7daf47);if(_0x2d593b['result']===-0x1){return _0x2d593b;}var _0x55ac87=this['getAndSetVariable'](_0xe36e('0xae'),_0xe36e('0xce'));if(_0x55ac87[_0xe36e('0x9f')]===-0x1){return _0x55ac87;}var _0x2f028b=this[_0xe36e('0x9e')]('RECOG_INPUT()',_0xe36e('0xcf'));if(_0x2f028b[_0xe36e('0x9f')]===-0x1){return _0x2f028b;}var _0x578464=this['getAndSetVariable'](_0xe36e('0xb1'),_0xe36e('0xd0'));if(_0x578464[_0xe36e('0x9f')]===-0x1){return _0x578464;}return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x7daf47));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xd1')]=function(_0x936340){logger['info'](util[_0xe36e('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x936340[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x936340[_0xe36e('0xd2')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x936340,_0xe36e('0xd3'));}var _0x670288=this['getSquareOdbc'][_0xe36e('0xa3')](this,_0x936340[_0xe36e('0xd2')]);if(!_0x670288){return this['channel'][_0xe36e('0x2c')](_0x936340,'no\x20odbc\x20database\x20found');}if(!this[_0xe36e('0xa7')](_0x936340['query'])){return this[_0xe36e('0x38')]['error'](_0x936340,'no\x20query\x20configured');}var _0x4e50aa=_0x936340[_0xe36e('0x2f')][_0xe36e('0xd4')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xd5'),_0x4e50aa));var _0x143ef6=this[_0xe36e('0x2a')][_0xe36e('0xa3')](this,_0x670288,_0x4e50aa);this['createSquareDetailsReport'][_0xe36e('0xa3')](this,_0x936340,_0x4e50aa);if(!this[_0xe36e('0xa7')](_0x936340[_0xe36e('0xd6')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xd7'));}var _0x2f854a=this[_0xe36e('0x10')][_0xe36e('0xa3')](this,_0x936340[_0xe36e('0xd6')]);if(!_0x2f854a){return this['channel'][_0xe36e('0x2c')](_0x936340,'no\x20variable\x20found');}var _0x147249=this;_0x143ef6[_0xe36e('0xd8')](function(_0x181962,_0xf974f8){Object[_0xe36e('0xd9')](_0x181962)['forEach'](function(_0x4b4e4f){_0x147249['channel']['setVariable'](util[_0xe36e('0x28')](_0xe36e('0xda'),_0x2f854a,_0xf974f8,_0x4b4e4f),_0x181962[_0x4b4e4f]);});});this['channel'][_0xe36e('0xa1')](util['format']('%s_ROWS_COUNT',_0x2f854a),_0x143ef6[_0xe36e('0x98')]);return this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')]('variable\x20%s\x20set',_0x2f854a));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xdb')]=function(_0x577ca0){logger[_0xe36e('0xdc')](util[_0xe36e('0x28')](_0xe36e('0xdd'),_0x577ca0[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x577ca0[_0xe36e('0xde')])){return this[_0xe36e('0x38')]['error'](_0x577ca0,_0xe36e('0xdf'));}var _0x1eaedd=this['getUser']['sync'](this,_0x577ca0[_0xe36e('0xde')]);if(!_0x1eaedd){return this[_0xe36e('0x38')]['error'](_0x577ca0,_0xe36e('0xe0'));}var _0x117563=this[_0xe36e('0x38')][_0xe36e('0x5a')](_0xe36e('0xe1'),[util[_0xe36e('0x28')]('SIP/%s',_0x1eaedd),_0x577ca0['timeout'],_0x577ca0['opts'],_0x577ca0[_0xe36e('0xe2')]]);if(_0x117563[_0xe36e('0x9f')]===-0x1){return _0x117563;}return this['channel'][_0xe36e('0xa8')](util['format'](_0xe36e('0xe3'),_0xe36e('0xe1')));};AGIVertices['prototype'][_0xe36e('0xe4')]=function(_0x44c6c9){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x44c6c9[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x44c6c9[_0xe36e('0x7a')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x44c6c9[_0xe36e('0x5f')])){return this['channel']['noop'](_0xe36e('0xa9'));}this[_0xe36e('0x38')][_0xe36e('0xe5')]=!![];this[_0xe36e('0x37')](_0x44c6c9);this[_0xe36e('0x43')](_0x44c6c9[_0xe36e('0x5f')],'in','','');this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')]('Trying\x20Dialogflow:\x20%s',_0x44c6c9[_0xe36e('0x5f')]));var _0xf5ec44=this[_0xe36e('0x79')][_0xe36e('0xa3')](this,_0x44c6c9);if(_0xf5ec44){for(var _0x43a0ba in _0xf5ec44){if(_0xf5ec44[_0xe36e('0x95')](_0x43a0ba)){this[_0xe36e('0x38')]['setVariable'](util[_0xe36e('0x28')](_0xe36e('0xe6'),_0x43a0ba[_0xe36e('0x6d')]()),_0xf5ec44[_0x43a0ba]);}}this[_0xe36e('0x43')](_0xf5ec44[_0xe36e('0xe7')],_0xe36e('0xe8'),_0xe36e('0xe4'),'');return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xe9'),_0xf5ec44[_0xe36e('0xe7')]));}return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x44c6c9,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe36e('0xf')][_0xe36e('0xea')]=function(_0x19f952){logger[_0xe36e('0x30')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x19f952[_0xe36e('0x39')]));if(!this['isConfigured'](_0x19f952[_0xe36e('0xeb')])){return this['channel'][_0xe36e('0xa8')](_0xe36e('0xec'));}if(!this['isConfigured'](_0x19f952[_0xe36e('0x7d')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20client_email\x20configured');}if(!this[_0xe36e('0xa7')](_0x19f952[_0xe36e('0xed')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xee'));}if(!this['isConfigured'](_0x19f952[_0xe36e('0xef')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xf0'));}if(!this[_0xe36e('0xa7')](_0x19f952['text'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}this[_0xe36e('0x38')][_0xe36e('0xe5')]=!![];this['createSquareDetailsReport'](_0x19f952);this[_0xe36e('0x43')](_0x19f952['text'],'in','','');this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0xf1'),_0x19f952[_0xe36e('0x5f')]));var _0x308dcf=this[_0xe36e('0x7c')][_0xe36e('0xa3')](this,_0x19f952);if(_0x308dcf){for(var _0x400d99 in _0x308dcf){if(_0x308dcf[_0xe36e('0x95')](_0x400d99)){if(_0x400d99!==_0xe36e('0xf2')){this[_0xe36e('0x38')][_0xe36e('0xa1')](util[_0xe36e('0x28')](_0xe36e('0xe6'),_0x400d99['toUpperCase']()),_0x308dcf[_0x400d99]);}}}this['createSquareMessage'](_0x308dcf[_0xe36e('0xe7')],_0xe36e('0xe8'),_0xe36e('0xea'),_0x308dcf[_0xe36e('0xf2')]);return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xf3'),_0x308dcf[_0xe36e('0xe7')]));}return this['channel'][_0xe36e('0x2c')](_0x19f952,_0xe36e('0xf4'));};AGIVertices['prototype']['sesteknda']=function(_0x39c15b){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0xf5'),_0x39c15b['label']));if(!this[_0xe36e('0xa7')](_0x39c15b['ndauth_url'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xf6'));}if(!this[_0xe36e('0xa7')](_0x39c15b[_0xe36e('0xf7')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20username\x20configured');}if(!this[_0xe36e('0xa7')](_0x39c15b[_0xe36e('0xf8')])){return this['channel'][_0xe36e('0xa8')](_0xe36e('0xf9'));}if(!this[_0xe36e('0xa7')](_0x39c15b['ndassistant_url'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}this['channel'][_0xe36e('0xe5')]=!![];this[_0xe36e('0x37')](_0x39c15b);this['createSquareMessage'](_0x39c15b[_0xe36e('0x5f')],'in','','');this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')]('Trying\x20SestekNDA:\x20%s',_0x39c15b[_0xe36e('0x5f')]));var _0x29e1fb=this['sestekNDA']['sync'](this,_0x39c15b);if(_0x29e1fb){for(var _0x32a07e in _0x29e1fb){if(_0x29e1fb[_0xe36e('0x95')](_0x32a07e)){this['channel']['setVariable'](util[_0xe36e('0x28')](_0xe36e('0xfa'),_0x32a07e[_0xe36e('0x6d')]()),_0x29e1fb[_0x32a07e]);}}this[_0xe36e('0x43')](_0x29e1fb[_0xe36e('0xe7')],_0xe36e('0xe8'),_0xe36e('0xfb'),'');if(_0x29e1fb['audiofile']){this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xfc'),_0x29e1fb[_0xe36e('0xfd')]));var _0xbf76cd=this[_0xe36e('0x38')][_0xe36e('0xfe')](_0x29e1fb['audiofile']);try{fs['unlink'](_0x29e1fb[_0xe36e('0xfd')]+_0xe36e('0xff'));}catch(_0x262797){logger[_0xe36e('0x2c')](_0x262797);}return _0xbf76cd;}else{return this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format'](_0xe36e('0x100'),_0x29e1fb['speech']));}}return this['channel'][_0xe36e('0x2c')](_0x39c15b,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xe36e('0xf')][_0xe36e('0x101')]=function(_0x11d209){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x102'),_0x11d209[_0xe36e('0x39')]));return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x101'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x103')]=function(_0x2c2671){logger['info'](util[_0xe36e('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2c2671[_0xe36e('0x39')]));var _0x41d930='';if(_0x2c2671[_0xe36e('0x104')]){if(!this['isConfigured'](_0x2c2671[_0xe36e('0x104')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x2c2671,_0xe36e('0x105'));}else{var _0x71c885=parseInt(_0x2c2671['trunk_id'],0xa);if(isNaN(_0x71c885)){_0x41d930=_0x2c2671[_0xe36e('0x104')];}else{_0x41d930=this[_0xe36e('0x1c')][_0xe36e('0xa3')](this,_0x2c2671[_0xe36e('0x104')]);if(!_0x41d930){return this['channel'][_0xe36e('0x2c')](_0x2c2671,_0xe36e('0x106'));}}}}else if(_0x2c2671[_0xe36e('0x107')]){_0x41d930=_0x2c2671[_0xe36e('0x107')];}else{return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x2c2671,_0xe36e('0x105'));}var _0x39f1c8=this[_0xe36e('0x38')][_0xe36e('0x5a')]('DIAL',[util[_0xe36e('0x28')](_0xe36e('0x108'),_0x41d930,_0x2c2671['phone']),_0x2c2671[_0xe36e('0x69')],_0x2c2671[_0xe36e('0x109')],_0x2c2671[_0xe36e('0xe2')]]);if(_0x39f1c8[_0xe36e('0x9f')]===-0x1){return _0x39f1c8;}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xe3'),_0xe36e('0xe1')));};AGIVertices[_0xe36e('0xf')]['finally']=function(_0x36026f){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x10a'),_0x36026f[_0xe36e('0x39')]));return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x10b'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0xd')]=function(_0x4197e9){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4197e9[_0xe36e('0x39')]));if(_0x4197e9['retry']===0x0){return this[_0xe36e('0xa2')](_0x4197e9);}_0x4197e9[_0xe36e('0xa4')]-=0x1;if(!this[_0xe36e('0xa7')](_0x4197e9[_0xe36e('0x10c')])){return this['channel'][_0xe36e('0x2c')](_0x4197e9,_0xe36e('0x10d'));}var _0x576964=this[_0xe36e('0x1e')][_0xe36e('0xa3')](this,_0x4197e9[_0xe36e('0x10c')]);if(!_0x576964){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x4197e9,'no\x20file\x20audio\x20found');}if(!this[_0xe36e('0xa7')](_0x4197e9[_0xe36e('0xd6')])){return this['channel'][_0xe36e('0x2c')](_0xe36e('0xd7'));}var _0x114547=this['channel']['getData'](_0x576964,_0x4197e9['response'],_0x4197e9[_0xe36e('0x10e')]);var _0x4c8d9a=_0x114547[_0xe36e('0x9f')]?_0x114547['result']['toString']():'';logger[_0xe36e('0x30')]('test',JSON[_0xe36e('0x9b')](_0x114547));if(_0x114547['result']===-0x1){this[_0xe36e('0x37')]['sync'](this,_0x4197e9,_0x4c8d9a);return _0x114547;}else if(_0x114547[_0xe36e('0x9d')]===_0xe36e('0x69')){_0x114547[_0xe36e('0x9f')]=_0x4c8d9a[_0xe36e('0x98')]>=parseInt(_0x4197e9[_0xe36e('0x10f')])?'x':'i';}else{_0x114547[_0xe36e('0x9f')]=_0x4c8d9a[_0xe36e('0x98')]>=parseInt(_0x4197e9[_0xe36e('0x10f')])&&_0x4c8d9a[_0xe36e('0x98')]<=parseInt(_0x4197e9[_0xe36e('0x10e')])?'x':'i';}var _0x24ace5=this[_0xe36e('0x10')]['sync'](this,_0x4197e9[_0xe36e('0xd6')]);if(!_0x24ace5){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x4197e9,_0xe36e('0x110'));}this['channel'][_0xe36e('0xa1')](_0x24ace5,_0x4c8d9a);if(this[_0xe36e('0xa7')](_0x4197e9[_0xe36e('0x111')])){var _0x5550e1=parseInt(_0x4197e9['hiddendigitsnum'],0xa);var _0x1223e4=rs[_0xe36e('0x112')]({'charset':'*','length':_0x5550e1});var _0x47fc58=_0x4c8d9a[_0xe36e('0x98')];if(_0x47fc58>0x0){if(_0x47fc58>_0x5550e1){this[_0xe36e('0x37')]['sync'](this,_0x4197e9,_0x4197e9[_0xe36e('0x113')]===_0xe36e('0x114')?_0x1223e4+_0x4c8d9a['substr'](_0x5550e1):_0x4c8d9a['substr'](0x0,_0x47fc58-_0x5550e1)+_0x1223e4);}else{this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x4197e9,rs[_0xe36e('0x112')]({'charset':'*','length':_0x47fc58}));}}else{this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x4197e9,'');}}else{this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x4197e9,_0x4c8d9a);}return _0x114547;};AGIVertices['prototype']['getsecretdigits']=function(_0x5517fd){logger['info'](util[_0xe36e('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5517fd['label']));return this[_0xe36e('0xd')](_0x5517fd);};AGIVertices[_0xe36e('0xf')]['goal']=function(_0x5e19e2){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x115'),_0x5e19e2[_0xe36e('0x39')]));this['createSquareDetailsReport'][_0xe36e('0xa3')](this,_0x5e19e2,_0x5e19e2['goalname']);return this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x116'),_0x5e19e2[_0xe36e('0x117')]));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x118')]=function(_0x33b239){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x119'),_0x33b239[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x33b239['aws_access_key_id'])||!this['isConfigured'](_0x33b239[_0xe36e('0x8b')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xe36e('0xa7')](_0x33b239[_0xe36e('0x5f')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}this['channel']['noop'](util[_0xe36e('0x28')](_0xe36e('0x11a'),_0x33b239[_0xe36e('0x5f')]));var _0x4d9207=this['awsPolly'][_0xe36e('0xa3')](this,_0x33b239);if(_0x4d9207){this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0x11b'),_0x4d9207));var _0xb8b409=this[_0xe36e('0x38')]['streamFile'](_0x4d9207);try{fs[_0xe36e('0x11c')](_0x4d9207+_0xe36e('0xff'));}catch(_0x5191a8){logger['error'](_0x5191a8);}return _0xb8b409;}return this['channel'][_0xe36e('0x2c')](_0x33b239,_0xe36e('0x11d'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x11e')]=function(_0x19f488){logger['info'](util[_0xe36e('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x19f488[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x19f488[_0xe36e('0x86')])||!this['isConfigured'](_0x19f488[_0xe36e('0x8b')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x11f'));}if(!this[_0xe36e('0xa7')](_0x19f488['aws_bot_name'])){return this[_0xe36e('0x38')]['noop'](_0xe36e('0x120'));}if(!this[_0xe36e('0xa7')](_0x19f488[_0xe36e('0x5f')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}this[_0xe36e('0x38')][_0xe36e('0xe5')]=!![];this[_0xe36e('0x37')](_0x19f488);this[_0xe36e('0x43')](_0x19f488[_0xe36e('0x5f')],'in','','');this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x121'),_0x19f488[_0xe36e('0x5f')]));var _0x2bc199=this[_0xe36e('0x8a')]['sync'](this,_0x19f488);if(_0x2bc199){for(var _0x5f5ce0 in _0x2bc199){if(_0x2bc199[_0xe36e('0x95')](_0x5f5ce0)&&_['isString'](_0x2bc199[_0x5f5ce0])){this[_0xe36e('0x38')][_0xe36e('0xa1')](util['format']('AWS_LEX_%s',_0x5f5ce0['toUpperCase']()),_0x2bc199[_0x5f5ce0]);}}if(_[_0xe36e('0x46')](_0x2bc199[_0xe36e('0x77')])){return this['channel'][_0xe36e('0xa8')](_0xe36e('0x122'));}else{this[_0xe36e('0x43')](_0x2bc199['message'],_0xe36e('0xe8'),_0xe36e('0x123'),'');return this['channel']['noop'](util[_0xe36e('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x2bc199[_0xe36e('0x77')]));}}return this['channel'][_0xe36e('0x2c')](_0x19f488,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe36e('0xf')][_0xe36e('0x124')]=function(_0x2ec228){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x125'),_0x2ec228[_0xe36e('0x39')],_0x2ec228[_0xe36e('0x69')]));if(!this['isConfigured'](_0x2ec228[_0xe36e('0x7a')])){return this['channel'][_0xe36e('0xa8')](_0xe36e('0x126'));}var _0x3f7c4f=_0xe36e('0x127');var _0x5d645b=util[_0xe36e('0x28')](_0xe36e('0x128'),FILES_PATH,rs[_0xe36e('0x112')](0x4));var _0xd6069d=util['format'](_0xe36e('0x9a'),_0x5d645b,_0x3f7c4f);var _0x23c39b=!![];if(_0x2ec228[_0xe36e('0x129')]==='NOBEEP'){_0x23c39b=![];}var _0xe7dd13=this[_0xe36e('0x38')][_0xe36e('0x12a')](_0x5d645b,_0x3f7c4f,_0x2ec228[_0xe36e('0x12b')],_0x2ec228[_0xe36e('0x69')],undefined,_0x23c39b);if(_0xe7dd13[_0xe36e('0x9f')]!==-0x1){this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x12c'),_0xd6069d));var _0x3e7302=this[_0xe36e('0x8d')][_0xe36e('0xa3')](this,_0x2ec228,_0xd6069d);if(_0x3e7302){for(var _0x5668b7 in _0x3e7302){if(_0x3e7302[_0xe36e('0x95')](_0x5668b7)){this[_0xe36e('0x38')][_0xe36e('0xa1')](util[_0xe36e('0x28')](_0xe36e('0x12d'),_0x5668b7['toUpperCase']()),_0x3e7302[_0x5668b7]);}}return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0x12e'),JSON[_0xe36e('0x9b')](_0x3e7302)));}}return _0xe7dd13;};AGIVertices['prototype'][_0xe36e('0x12f')]=function(_0x49f6e1){logger[_0xe36e('0x30')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x49f6e1['label']));if(!this['isConfigured'](_0x49f6e1[_0xe36e('0x8f')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')]('no\x20appid\x20configured');}if(!this[_0xe36e('0xa7')](_0x49f6e1[_0xe36e('0x90')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x130'));}var _0x2e05f4=_0xe36e('0x127');var _0x263060=util[_0xe36e('0x28')](_0xe36e('0x128'),FILES_PATH,rs['generate'](0x4));var _0x33dab6=util[_0xe36e('0x28')]('%s.%s',_0x263060,_0x2e05f4);var _0x27005f=!![];if(_0x49f6e1[_0xe36e('0x129')]==='NOBEEP'){_0x27005f=![];}var _0x18ef46=this[_0xe36e('0x38')][_0xe36e('0x12a')](_0x263060,_0x2e05f4,_0x49f6e1[_0xe36e('0x12b')],_0x49f6e1[_0xe36e('0x69')],undefined,_0x27005f);if(_0x18ef46['result']!==-0x1){this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')]('tilde\x20%s\x20file\x20created',_0x33dab6));var _0x43a65b=this['tildeASR']['sync'](this,_0x49f6e1,_0x33dab6);if(_0x43a65b){for(var _0x39eb99 in _0x43a65b){if(_0x43a65b['hasOwnProperty'](_0x39eb99)){this[_0xe36e('0x38')][_0xe36e('0xa1')](util[_0xe36e('0x28')](_0xe36e('0x131'),_0x39eb99[_0xe36e('0x6d')]()),_0x43a65b[_0x39eb99]);}}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x132'),JSON[_0xe36e('0x9b')](_0x43a65b)));}}return _0x18ef46;};AGIVertices[_0xe36e('0xf')][_0xe36e('0x133')]=function(_0x372d74){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x372d74[_0xe36e('0x39')]));return this[_0xe36e('0x38')][_0xe36e('0x134')](_0x372d74[_0xe36e('0x135')],_0x372d74[_0xe36e('0x3f')],_0x372d74[_0xe36e('0x40')]);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x136')]=function(_0x4692fe){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x137'),_0x4692fe[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x4692fe[_0xe36e('0x138')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x4692fe,_0xe36e('0x139'));}try{var _0x88602a=eval(_0x4692fe[_0xe36e('0x138')])?'true':_0xe36e('0x13a');this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x13b'),_0x4692fe[_0xe36e('0x138')],_0x88602a));return{'code':0xc8,'result':_0x88602a};}catch(_0x255450){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xe36e('0xf')]['gotoiftime']=function(_0x23308e){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x23308e[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x23308e[_0xe36e('0x13c')])){return this[_0xe36e('0x38')]['error'](_0x23308e,_0xe36e('0x13d'));}var _0x1d2f8e=this[_0xe36e('0x24')][_0xe36e('0xa3')](this,_0x23308e['interval_id']);if(!_0x1d2f8e){return this[_0xe36e('0x38')]['error'](_0x23308e,'no\x20intervals\x20found');}for(var _0x1c35d1=0x0;_0x1c35d1<_0x1d2f8e['length'];_0x1c35d1+=0x1){var _0x22dc03=this[_0xe36e('0x38')][_0xe36e('0x10')](util[_0xe36e('0x28')]('IFTIME(%s?true:false)',_0x1d2f8e[_0x1c35d1]));if(_0x22dc03['result']===-0x1){return _0x22dc03;}logger['info'](util[_0xe36e('0x28')]('IFTIME\x20%s\x20%s',_0x1d2f8e[_0x1c35d1],_0x22dc03[_0xe36e('0x9d')]));if(_0x22dc03[_0xe36e('0x9d')]===_0xe36e('0x13e')){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('IFTIME\x20%s\x20%s',_0x1d2f8e[_0x1c35d1],'true'));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')]('IFTIME\x20%s\x20%s',_0x1d2f8e[_0x1c35d1],'true'));return{'code':0xc8,'result':_0xe36e('0x13e')};}else{logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x13f'),_0x1d2f8e[_0x1c35d1],_0xe36e('0x13a')));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x13f'),_0x1d2f8e[_0x1c35d1],_0xe36e('0x13a')));}}return{'code':0xc8,'result':_0xe36e('0x13a')};};AGIVertices[_0xe36e('0xf')]['hangup']=function(_0x4da28d){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x140'),_0x4da28d[_0xe36e('0x39')]));return this['channel'][_0xe36e('0x141')]();};AGIVertices[_0xe36e('0xf')][_0xe36e('0x142')]=function(_0x1da6bf){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x143'),_0x1da6bf['label']));if(!this['isConfigured'](_0x1da6bf['key'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x126'));}var _0x4f0902=_0xe36e('0x127');var _0x5c3b55=util[_0xe36e('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x368e40=util[_0xe36e('0x28')]('%s.%s',_0x5c3b55,_0x4f0902);var _0x36c279=!![];if(_0x1da6bf[_0xe36e('0x129')]===_0xe36e('0x144')){_0x36c279=![];}var _0x32b417=this[_0xe36e('0x38')][_0xe36e('0x12a')](_0x5c3b55,_0x4f0902,_0x1da6bf[_0xe36e('0x12b')],_0x1da6bf[_0xe36e('0x69')],undefined,_0x36c279);if(_0x32b417['result']!==-0x1){this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x145'),_0x368e40));var _0x1a0fba=this[_0xe36e('0x82')][_0xe36e('0xa3')](this,_0x1da6bf,_0x368e40);if(_0x1a0fba){for(var _0x5bdac9 in _0x1a0fba){if(_0x1a0fba[_0xe36e('0x95')](_0x5bdac9)){this['channel']['setVariable'](util[_0xe36e('0x28')](_0xe36e('0x146'),_0x5bdac9[_0xe36e('0x6d')]()),_0x1a0fba[_0x5bdac9]);}}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format'](_0xe36e('0x147'),JSON[_0xe36e('0x9b')](_0x1a0fba)));}}return _0x32b417;};AGIVertices['prototype']['ispeechtts']=function(_0x2b23a7){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2b23a7[_0xe36e('0x39')]));if(!this['isConfigured'](_0x2b23a7[_0xe36e('0x7a')])){return this['channel'][_0xe36e('0xa8')]('no\x20key\x20configured');}if(!this[_0xe36e('0xa7')](_0x2b23a7[_0xe36e('0x5f')])){return this['channel'][_0xe36e('0xa8')](_0xe36e('0xa9'));}this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x148'),_0x2b23a7[_0xe36e('0x5f')]));var _0x366d1d=this[_0xe36e('0x7f')][_0xe36e('0xa3')](this,_0x2b23a7);if(_0x366d1d){this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format']('ispeech\x20%s\x20file\x20created',_0x366d1d));var _0x473a65=this[_0xe36e('0x38')][_0xe36e('0xfe')](_0x366d1d,_0x2b23a7['intKey']);try{fs[_0xe36e('0x11c')](_0x366d1d+_0xe36e('0xff'));}catch(_0x1da902){logger['error'](_0x1da902);}return _0x473a65;}return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x2b23a7,_0xe36e('0x149'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x14a')]=function(_0x1a0896){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x14b'),_0x1a0896['label']));if(!this['isConfigured'](_0x1a0896[_0xe36e('0x14c')])){return this['channel'][_0xe36e('0x2c')](_0x1a0896,_0xe36e('0x14d'));}logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xe36e('0x3c')],_0x1a0896[_0xe36e('0x14c')]));var _0x39ab9c=this[_0xe36e('0x55')][_0xe36e('0xa3')](this,_0x1a0896[_0xe36e('0x14c')]);if(_0x39ab9c){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x14e'),this['channel'][_0xe36e('0x3c')],_0x1a0896[_0xe36e('0x14c')]));this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x1a0896[_0xe36e('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe36e('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xe36e('0x3c')],_0x1a0896['findBy']));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x14f'),this['channel'][_0xe36e('0x3c')],_0x1a0896[_0xe36e('0x14c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe36e('0xf')]['logout']=function(_0x44e4ab){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x150'),_0x44e4ab[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x44e4ab['findBy'])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x44e4ab,_0xe36e('0x14d'));}logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x151'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x44e4ab['findBy']));var _0xe7233c=this['agentLogout'][_0xe36e('0xa3')](this,_0x44e4ab[_0xe36e('0x14c')]);if(_0xe7233c){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x14e'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x44e4ab['findBy']));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe36e('0x38')]['callerid'],_0x44e4ab[_0xe36e('0x14c')]));return{'code':0xc8,'result':_0xe36e('0x152')};}else{logger[_0xe36e('0x30')](util['format'](_0xe36e('0x14f'),this['channel'][_0xe36e('0x3c')],_0x44e4ab[_0xe36e('0x14c')]));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x14f'),this[_0xe36e('0x38')]['callerid'],_0x44e4ab[_0xe36e('0x14c')]));return{'code':0xc8,'result':_0xe36e('0x153')};}};AGIVertices[_0xe36e('0xf')][_0xe36e('0x154')]=function(_0x33fb72){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x155'),_0x33fb72['label']));if(!this['isConfigured'](_0x33fb72[_0xe36e('0x156')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x33fb72,_0xe36e('0x157'));}this['channel'][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x158'),_0x33fb72[_0xe36e('0x156')]));var _0x5c87aa=eval(_0x33fb72[_0xe36e('0x156')]);if(!this[_0xe36e('0xa7')](_0x33fb72[_0xe36e('0xd6')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xd7'));}var _0x41a472=this['getVariable']['sync'](this,_0x33fb72[_0xe36e('0xd6')]);if(!_0x41a472){return this[_0xe36e('0x38')]['error'](_0x33fb72,_0xe36e('0x110'));}if(_[_0xe36e('0x97')](_0x5c87aa)){var _0x45ec6b=this;_0x5c87aa[_0xe36e('0xd8')](function(_0xbf8d03,_0x2fd95e){_0x45ec6b[_0xe36e('0x38')][_0xe36e('0xa1')](util[_0xe36e('0x28')](_0xe36e('0x159'),_0x41a472,_0x2fd95e),_0xbf8d03);});return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')]('variable\x20%s[key]\x20set',_0x41a472));}else{return this['channel'][_0xe36e('0xa1')](_0x41a472,_0x5c87aa);}};AGIVertices['prototype'][_0xe36e('0x15a')]=function(_0x493807){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x15b'),_0x493807[_0xe36e('0x39')]));if(_0x493807[_0xe36e('0xa4')]===0x0){return this[_0xe36e('0xa2')](_0x493807);}_0x493807['retry']-=0x1;if(!this['isConfigured'](_0x493807['file_id'])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x493807,_0xe36e('0x10d'));}var _0x215461=this[_0xe36e('0x1e')][_0xe36e('0xa3')](this,_0x493807['file_id']);if(!_0x215461){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x493807,_0xe36e('0x15c'));}var _0x1a05c6=this['channel'][_0xe36e('0x15d')](_0x215461,_0x493807[_0xe36e('0x15e')],_0x493807[_0xe36e('0x15f')]);var _0x4a5111=_0x1a05c6[_0xe36e('0x9f')];if(_0x1a05c6['result']===-0x1){this['createSquareDetailsReport'][_0xe36e('0xa3')](this,_0x493807,'-1');return _0x1a05c6;}else if(_0x1a05c6['extra']==='timeout'){_0x1a05c6[_0xe36e('0x9f')]=_0x1a05c6[_0xe36e('0x9f')][_0xe36e('0x98')]>0x0?_0x1a05c6['result']:'t';}else if(_[_0xe36e('0x45')](_0x1a05c6[_0xe36e('0x9f')])){_0x1a05c6[_0xe36e('0x9f')]='#';_0x4a5111='#';}if(!this[_0xe36e('0xa7')](_0x493807[_0xe36e('0xd6')])){this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xd7'));}else{var _0x59f751=this[_0xe36e('0x10')][_0xe36e('0xa3')](this,_0x493807['variable_id']);if(!_0x59f751){return this[_0xe36e('0x38')]['error'](_0x493807,_0xe36e('0x110'));}this['channel'][_0xe36e('0xa1')](_0x59f751,_0x4a5111);}this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x493807,_0x4a5111);return _0x1a05c6;};AGIVertices[_0xe36e('0xf')][_0xe36e('0xa8')]=function(_0x3d0e61){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x160'),_0x3d0e61[_0xe36e('0x39')]));return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0x3d0e61[_0xe36e('0x161')]||_0x3d0e61[_0xe36e('0x39')]);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x162')]=function(_0x1fa1d8){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x163'),_0x1fa1d8[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x1fa1d8[_0xe36e('0x14c')])){return this['channel'][_0xe36e('0x2c')](_0x1fa1d8,_0xe36e('0x14d'));}logger['info'](util[_0xe36e('0x28')](_0xe36e('0x151'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x1fa1d8[_0xe36e('0x14c')]));var _0x26e59b=this[_0xe36e('0x4f')][_0xe36e('0xa3')](this,_0x1fa1d8['pause_id']);var _0x1a387b=this['agentPause']['sync'](this,_0x1fa1d8['findBy'],_0x26e59b);if(_0x1a387b){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x14e'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x1fa1d8[_0xe36e('0x14c')]));this[_0xe36e('0x38')]['noop'](util['format'](_0xe36e('0x14e'),this[_0xe36e('0x38')]['callerid'],_0x1fa1d8[_0xe36e('0x14c')]));return{'code':0xc8,'result':_0xe36e('0x152')};}else{logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x14f'),this['channel'][_0xe36e('0x3c')],_0x1fa1d8[_0xe36e('0x14c')]));this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0x14e'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x1fa1d8[_0xe36e('0x14c')]));return{'code':0xc8,'result':_0xe36e('0x153')};}};AGIVertices['prototype'][_0xe36e('0x164')]=function(_0x362d86){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x165'),_0x362d86[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x362d86[_0xe36e('0x10c')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x362d86,_0xe36e('0x10d'));}var _0x17071a=this[_0xe36e('0x1e')][_0xe36e('0xa3')](this,_0x362d86[_0xe36e('0x10c')]);if(!_0x17071a){return this[_0xe36e('0x38')]['error'](_0x362d86,'no\x20file\x20audio\x20found');}var _0x33dfcc=this[_0xe36e('0x38')][_0xe36e('0x5a')]('PLAYBACK',[_0x17071a,_0x362d86['opts']]);if(_0x33dfcc['result']===-0x1){return _0x33dfcc;}return this[_0xe36e('0x38')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xe36e('0x166'),_0x17071a));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x167')]=function(_0x536612){logger[_0xe36e('0x30')](util['format'](_0xe36e('0x168'),_0x536612[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x536612[_0xe36e('0x169')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x536612,'no\x20queue\x20selected');}var _0x24a9ce='';var _0xbf41e3=parseInt(_0x536612[_0xe36e('0x169')],0xa);if(isNaN(_0xbf41e3)){_0x24a9ce=_0x536612['queue_id'];}else{_0x24a9ce=this[_0xe36e('0x14')]['sync'](this,_0x536612[_0xe36e('0x169')]);if(!_0x24a9ce){return this['channel'][_0xe36e('0x2c')](_0x536612,_0xe36e('0x16a'));}}var _0x5dd087='';if(this['isConfigured'](_0x536612[_0xe36e('0x10c')])){var _0x5d3126=this['getSound'][_0xe36e('0xa3')](this,_0x536612[_0xe36e('0x10c')]);if(_0x5d3126){_0x5dd087=_0x5d3126;}}this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x536612,_0x24a9ce);if(_0x536612[_0xe36e('0x109')][_0xe36e('0x16b')]('x')<0x0){_0x536612[_0xe36e('0x109')]+='x';}if(_0x536612[_0xe36e('0x109')]['indexOf']('X')<0x0){_0x536612[_0xe36e('0x109')]+='X';}this[_0xe36e('0x38')][_0xe36e('0xa1')](_0xe36e('0x16c'),_0x24a9ce?_0x24a9ce[_0xe36e('0x16d')]():'');var _0x1edc54=this[_0xe36e('0x38')][_0xe36e('0x5a')]('QUEUE',[_0x24a9ce,_0x536612['opts'],_0x536612['url'],_0x5dd087,_0x536612['timeout'],_0x536612[_0xe36e('0x6')],_0x536612[_0xe36e('0x16e')],_0x536612[_0xe36e('0x16f')],'',_0x536612[_0xe36e('0x170')]]);if(_0x1edc54['result']===-0x1){return _0x1edc54;}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0xc1'),_0xe36e('0x171'),_0x24a9ce));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x172')]=function(_0x55212e){logger[_0xe36e('0x30')](util[_0xe36e('0x28')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x55212e[_0xe36e('0x39')]));var _0x4e513d=_0x55212e[_0xe36e('0x173')]||_0xe36e('0x127');var _0x1cf0cd=util['format'](_0xe36e('0x174'),this['channel'][_0xe36e('0x3e')],rs['generate'](0x5));var _0x1a41d1=util['format'](_0xe36e('0x175'),FILES_PATH,_0x1cf0cd,_0x4e513d);var _0x34596c=util[_0xe36e('0x28')](_0xe36e('0x128'),FILES_PATH,_0x1cf0cd);this[_0xe36e('0x3d')][_0xe36e('0xa3')](this,_0x55212e,_0x1cf0cd,_0x1a41d1);this['channel'][_0xe36e('0xa1')]('RECORDING_SAVENAME',_0x1cf0cd);logger[_0xe36e('0x30')](_0xe36e('0x176'),_0x34596c,_0x4e513d,_0x55212e[_0xe36e('0x177')],_0x55212e[_0xe36e('0x69')]);return this[_0xe36e('0x38')]['recordFile'](_0x34596c,_0x4e513d,_0x55212e['escape_digits'],_0x55212e[_0xe36e('0x69')],undefined,!![]);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x178')]=function(_0x11f693){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x179'),_0x11f693['label']));if(!this[_0xe36e('0xa7')](_0x11f693[_0xe36e('0xe2')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x17a'));}var _0x35fc21=this[_0xe36e('0x67')][_0xe36e('0xa3')](this,_0x11f693);logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x17b'),util[_0xe36e('0x17c')](_0x35fc21,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x11f693['variable_id'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x17d'));}var _0x37aa9c=this['getVariable'][_0xe36e('0xa3')](this,_0x11f693[_0xe36e('0xd6')]);if(!_0x37aa9c){return this[_0xe36e('0x38')]['error'](_0x11f693,_0xe36e('0x110'));}this[_0xe36e('0x38')][_0xe36e('0xa1')](util['format'](_0xe36e('0x17e'),_0x37aa9c),_0x35fc21[_0xe36e('0x75')]?_0x35fc21[_0xe36e('0x75')]:'200');this[_0xe36e('0x38')]['setVariable'](util[_0xe36e('0x28')](_0xe36e('0x17f'),_0x37aa9c),_0x35fc21[_0xe36e('0x76')]?_0x35fc21[_0xe36e('0x76')]:'OK');if(_0x35fc21[_0xe36e('0x6e')]){try{this[_0xe36e('0x99')](_0x35fc21[_0xe36e('0x6e')],_0x37aa9c);}catch(_0x310c28){logger[_0xe36e('0x2c')](util[_0xe36e('0x28')](_0xe36e('0x180'),_0x37aa9c));}}return this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0x181'),_0x37aa9c));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x182')]=function(_0x28f45c){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x183'),_0x28f45c[_0xe36e('0x39')]));return this[_0xe36e('0x38')]['sayDigits'](_0x28f45c[_0xe36e('0x184')][_0xe36e('0xd4')](/\s+/g,''),_0x28f45c['escape_digits']);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x185')]=function(_0x1fee3c){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x186'),_0x1fee3c[_0xe36e('0x39')]));return this[_0xe36e('0x38')][_0xe36e('0x187')](_0x1fee3c[_0xe36e('0x6a')][_0xe36e('0xd4')](/\s+/g,''),_0x1fee3c['escape_digits']);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x188')]=function(_0x59b456){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x189'),_0x59b456['label']));return this[_0xe36e('0x38')][_0xe36e('0x18a')](_0x59b456[_0xe36e('0x5f')],_0x59b456[_0xe36e('0x177')]);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x18b')]=function(_0x8b6139){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x18c'),_0x8b6139[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x8b6139[_0xe36e('0x18d')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x18e'));}var _0x2b67ce=this[_0xe36e('0x20')][_0xe36e('0xa3')](this,_0x8b6139[_0xe36e('0x18d')]);if(!_0x2b67ce||!_0x2b67ce[_0xe36e('0x18f')]){return this[_0xe36e('0x38')]['error'](_0x8b6139,_0xe36e('0x190'));}var _0x33ad53={'from':util[_0xe36e('0x28')](_0xe36e('0x191'),_0x2b67ce['name'],_0x2b67ce[_0xe36e('0x192')]||_0x2b67ce['Smtp'][_0xe36e('0x193')]),'to':_0x8b6139['to']||'','cc':_0x8b6139['cc']||'','bcc':_0x8b6139[_0xe36e('0x194')]||'','subject':_0x8b6139[_0xe36e('0x195')],'html':_0x8b6139['text'],'text':_0x8b6139[_0xe36e('0x5f')]};if(this['isConfigured'](_0x8b6139['template_id'])){}logger[_0xe36e('0xdc')](_0xe36e('0x196'),JSON[_0xe36e('0x9b')](_0x33ad53));this['createSquareDetailsReport'][_0xe36e('0xa3')](this,_0x8b6139,_0x8b6139['account_id']);this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x197'),_0x2b67ce['name']));this[_0xe36e('0x23')]['sync'](this,_0x2b67ce[_0xe36e('0x198')],_0x33ad53);return this['channel'][_0xe36e('0xa8')](_0xe36e('0x199'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x19a')]=function(_0x3cf92f){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x19b'),_0x3cf92f[_0xe36e('0x39')]));return this['channel'][_0xe36e('0xa8')](_0xe36e('0x19c'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x19d')]=function(_0x8f9206){logger[_0xe36e('0x30')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x8f9206[_0xe36e('0x39')]));if(!this['isConfigured'](_0x8f9206['sms_account_id'])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x19e'));}var _0x360d3c=this['getSmsAccount'][_0xe36e('0xa3')](this,_0x8f9206[_0xe36e('0x19f')]);if(!_0x360d3c){return this[_0xe36e('0x38')]['error'](_0x8f9206,_0xe36e('0x1a0'));}var _0x34b9e4={'body':_0x8f9206[_0xe36e('0x1a1')],'phone':_0x8f9206['to']||'','SmsAccountId':_0x360d3c['id']};logger[_0xe36e('0xdc')](_0xe36e('0x1a2'),JSON['stringify'](_0x34b9e4));this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x8f9206,_0x8f9206[_0xe36e('0x19f')]);this[_0xe36e('0x38')]['noop'](util['format'](_0xe36e('0x1a3'),_0x360d3c['name']));this[_0xe36e('0x36')][_0xe36e('0xa3')](this,_0x34b9e4);return this[_0xe36e('0x38')]['noop'](_0xe36e('0x1a4'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1a5')]=function(_0x2aa01e){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1a6'),_0x2aa01e[_0xe36e('0x39')]));if(!this['isConfigured'](_0x2aa01e['variable_id'])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x2aa01e,_0xe36e('0x1a7'));}var _0x331ec3=this[_0xe36e('0x10')][_0xe36e('0xa3')](this,_0x2aa01e[_0xe36e('0xd6')]);if(!_0x331ec3){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x2aa01e,'no\x20variable\x20found');}return this['channel'][_0xe36e('0xa1')](_0x331ec3,_0x2aa01e['variable_value']);};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1a8')]=function(_0x356cd0){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1a9'),_0x356cd0['label']));this[_0xe36e('0x38')][_0xe36e('0xa8')]('START\x20CALLY\x20SQUARE');if(_0x356cd0['answer']==='yes'){this['channel'][_0xe36e('0xa8')](_0xe36e('0x1aa'));return this[_0xe36e('0x38')][_0xe36e('0xb5')]();}return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x1ab'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1ac')]=function(_0x16933c){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1ad'),_0x16933c[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x16933c[_0xe36e('0x1ae')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x16933c,'no\x20subproject\x20selected');}var _0x502686=this['getSquareProject'][_0xe36e('0xa3')](this,_0x16933c[_0xe36e('0x1ae')]);if(!this['isConfigured'](_0x502686)){return this[_0xe36e('0x38')]['error'](_0x16933c,util[_0xe36e('0x28')](_0xe36e('0x1af'),_0x16933c[_0xe36e('0x1ae')]));}if(_0x502686===this[_0xe36e('0x38')][_0xe36e('0x3b')]){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x16933c,_0xe36e('0x1b0'));}this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x16933c,_0x502686);var _0x276af4=this[_0xe36e('0x38')][_0xe36e('0x5a')](_0xe36e('0x1b1'),util[_0xe36e('0x28')](_0xe36e('0x1b2'),config[_0xe36e('0x6')][_0xe36e('0x1b3')]||_0xe36e('0x1b4'),_0x502686,this['channel'][_0xe36e('0x3b')]));if(_0x276af4['result']===-0x1){return _0x276af4;}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format'](_0xe36e('0xc1'),_0xe36e('0x1b1'),_0x502686));};AGIVertices['prototype']['system']=function(_0x51ff5a){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x1b5'),_0x51ff5a[_0xe36e('0x39')]));var _0x4d5686=this['shellCommand']['sync'](this,_0x51ff5a[_0xe36e('0xb3')]);this[_0xe36e('0x37')][_0xe36e('0xa3')](this,_0x51ff5a,_0x51ff5a['command']);if(this[_0xe36e('0xa7')](_0x51ff5a['variable_id'])){var _0x190dbf=this[_0xe36e('0x10')][_0xe36e('0xa3')](this,_0x51ff5a['variable_id']);if(_0x190dbf){this[_0xe36e('0x38')][_0xe36e('0xa1')](_0x190dbf,_0x4d5686);return this['channel']['noop'](util[_0xe36e('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x51ff5a[_0xe36e('0xb3')],_0x190dbf));}}return this[_0xe36e('0x38')][_0xe36e('0xa8')](util['format'](_0xe36e('0x1b6'),_0x51ff5a[_0xe36e('0xb3')]));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1b7')]=function(_0x33011b){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1b8'),_0x33011b[_0xe36e('0x39')]));_0x33011b['text']=_0x33011b[_0xe36e('0x5f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe36e('0xa7')](_0x33011b[_0xe36e('0x5d')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0x1b9'));}if(!this[_0xe36e('0xa7')](_0x33011b[_0xe36e('0x5f')])){return this[_0xe36e('0x38')][_0xe36e('0xa8')](_0xe36e('0xa9'));}this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x1ba'),_0x33011b[_0xe36e('0x5f')]));var _0x5ba804=this[_0xe36e('0x5c')][_0xe36e('0xa3')](this,_0x33011b);if(_0x5ba804){this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x1bb'),_0x5ba804));var _0x47afe8=this[_0xe36e('0x38')][_0xe36e('0xfe')](_0x5ba804);try{fs[_0xe36e('0x11c')](_0x5ba804+_0xe36e('0xff'));}catch(_0x5354e0){logger[_0xe36e('0x2c')](_0x5354e0);}return _0x47afe8;}return this[_0xe36e('0x38')]['error'](_0x33011b,_0xe36e('0x1bc'));};AGIVertices[_0xe36e('0xf')]['tts']=function(_0xc5ca13){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x1bd'),_0xc5ca13[_0xe36e('0x39')]));_0xc5ca13['text']=_0xc5ca13[_0xe36e('0x5f')][_0xe36e('0xd4')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xc5ca13['text'])){return this['channel'][_0xe36e('0xa8')]('no\x20text\x20configured');}this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x1be'),_0xc5ca13[_0xe36e('0x5f')]));var _0x48f859=this[_0xe36e('0x65')][_0xe36e('0xa3')](this,_0xc5ca13);if(_0x48f859){this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0x48f859));var _0xe14950=this['channel']['streamFile'](_0x48f859);try{fs['unlink'](_0x48f859+'.wav');}catch(_0x2e8875){logger[_0xe36e('0x2c')](_0x2e8875);}return _0xe14950;}return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0xc5ca13,_0xe36e('0x1bf'));};AGIVertices[_0xe36e('0xf')][_0xe36e('0x1c0')]=function(_0x5c859b){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1c1'),_0x5c859b[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x5c859b[_0xe36e('0x14c')])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x5c859b,_0xe36e('0x14d'));}logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x151'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x5c859b[_0xe36e('0x14c')]));var _0x503c67=this[_0xe36e('0x53')]['sync'](this,_0x5c859b[_0xe36e('0x14c')]);if(_0x503c67){logger[_0xe36e('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x5c859b[_0xe36e('0x14c')]));this[_0xe36e('0x38')]['noop'](util[_0xe36e('0x28')](_0xe36e('0x14e'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x5c859b['findBy']));return{'code':0xc8,'result':_0xe36e('0x152')};}else{logger[_0xe36e('0x30')](util['format'](_0xe36e('0x14f'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x5c859b[_0xe36e('0x14c')]));this[_0xe36e('0x38')][_0xe36e('0xa8')](util[_0xe36e('0x28')](_0xe36e('0x14f'),this[_0xe36e('0x38')][_0xe36e('0x3c')],_0x5c859b[_0xe36e('0x14c')]));return{'code':0xc8,'result':_0xe36e('0x153')};}};AGIVertices['prototype'][_0xe36e('0x1c2')]=function(_0x53b672){logger[_0xe36e('0x30')](util[_0xe36e('0x28')](_0xe36e('0x1c3'),_0x53b672['label']));var _0x4a9d71=this[_0xe36e('0x38')]['exec'](_0xe36e('0x1c4'),[_0x53b672[_0xe36e('0x1c5')],_0x53b672[_0xe36e('0x78')]]);if(_0x4a9d71[_0xe36e('0x9f')]===-0x1){return _0x4a9d71;}return this[_0xe36e('0x38')]['noop'](util['format'](_0xe36e('0xc1'),'VOICEMAIL',_0x53b672['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x544b1b){logger['info'](util[_0xe36e('0x28')](_0xe36e('0x1c6'),_0x544b1b[_0xe36e('0x39')]));if(!this[_0xe36e('0xa7')](_0x544b1b['variable_id'])){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x544b1b,_0xe36e('0x1a7'));}var _0x4b78fe=this[_0xe36e('0x10')]['sync'](this,_0x544b1b['variable_id']);if(!_0x4b78fe){return this[_0xe36e('0x38')][_0xe36e('0x2c')](_0x544b1b,_0xe36e('0x110'));}var _0x454477=this[_0xe36e('0x38')][_0xe36e('0x10')](_0x4b78fe);return{'code':0xc8,'result':_0x454477[_0xe36e('0x9d')]?_0x454477[_0xe36e('0x9d')]:'-'};};String[_0xe36e('0xf')][_0xe36e('0x1c7')]=function(_0x4448e9,_0x5aee32){return this['split'](_0x4448e9)[_0xe36e('0x1c8')](_0x5aee32);};module[_0xe36e('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 6c8420f..9ac37fd 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 _0x5da0=['mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','stringify','[ACW][STOP]\x20%s','uniqueid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','prototype','channels','interface','queue'];(function(_0x41cf46,_0x361040){var _0x222014=function(_0x167d32){while(--_0x167d32){_0x41cf46['push'](_0x41cf46['shift']());}};_0x222014(++_0x361040);}(_0x5da0,0xf0));var _0x05da=function(_0x526c83,_0x5800f6){_0x526c83=_0x526c83-0x0;var _0x151966=_0x5da0[_0x526c83];return _0x151966;};'use strict';var _=require('lodash');var moment=require(_0x05da('0x0'));var ami=require(_0x05da('0x1'));var logger=require('../../../config/logger')(_0x05da('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x05da('0x3'));function Acw(_0x43e943){this[_0x05da('0x4')]=_0x43e943[_0x05da('0x4')];this['agents']=_0x43e943[_0x05da('0x5')];this[_0x05da('0x6')]=_0x43e943['timers'];this['channels']={};ami['on'](_0x05da('0x7'),this[_0x05da('0x8')][_0x05da('0x9')](this));ami['on'](_0x05da('0xa'),this['syncHangupRequest']['bind'](this));ami['on'](_0x05da('0xb'),this['syncHangup']['bind'](this));ami['on'](_0x05da('0xc'),this[_0x05da('0xd')]['bind'](this));ami['on'](_0x05da('0xe'),this[_0x05da('0xf')][_0x05da('0x9')](this));ami['on'](_0x05da('0x10'),this['syncBlindTransfer'][_0x05da('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x05da('0x11')][_0x05da('0x9')](this));}function getDiff(_0x478ff3){var _0x2ad0c0=moment()[_0x05da('0x12')](0x0);var _0x4c226a=moment(_0x478ff3)['milliseconds'](0x0);return _0x2ad0c0[_0x05da('0x13')](_0x4c226a,'seconds');}Acw[_0x05da('0x14')]['startAcw']=function(_0x4fb65a){try{var _0x51be1a=this;var _0x38d95b=this[_0x05da('0x15')][_0x4fb65a][_0x05da('0x16')];var _0x358b53=this[_0x05da('0x15')][_0x4fb65a][_0x05da('0x17')];var _0x3f8682=this[_0x05da('0x4')][_0x358b53];var _0xe992e8=![];var _0x2aefd8='ACW';if(_0x3f8682[_0x05da('0x18')]){if(_0x3f8682[_0x05da('0x19')][_0x05da('0x1a')]){_0xe992e8=!![];_0x2aefd8=_0x3f8682[_0x05da('0x19')]['name'];}}return ami[_0x05da('0x1b')]({'action':_0x05da('0x1c'),'interface':_0x38d95b,'paused':!![],'reason':_0x2aefd8})['then'](function(){if(_0x51be1a[_0x05da('0x5')][_0x38d95b]){return RpcUser[_0x05da('0x1d')](_0x51be1a[_0x05da('0x5')][_0x38d95b]['id'])[_0x05da('0x1e')](function(_0x18806d){if(_0x18806d&&!_0x18806d[_0x05da('0x1f')]){logger['info'](_0x05da('0x20'),_0x4fb65a,_0x38d95b,_0x358b53);var _0x5c73bd=_0x51be1a['channels'][_0x4fb65a][_0x05da('0x21')]&&_0x51be1a[_0x05da('0x15')][_0x4fb65a][_0x05da('0x22')]?_0x51be1a[_0x05da('0x15')][_0x4fb65a][_0x05da('0x22')]:_0x4fb65a;return RpcUser['savePause'](_0x51be1a[_0x05da('0x5')][_0x38d95b],_0x2aefd8,_0x5c73bd)[_0x05da('0x1e')](function(){if(!_0xe992e8){_0x51be1a[_0x05da('0x6')][_0x38d95b]={};logger[_0x05da('0x23')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4fb65a,_0x51be1a[_0x05da('0x4')][_0x358b53][_0x05da('0x24')],_0x38d95b,_0x358b53);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x25')]=setTimeout(_0x51be1a['stopAcw']['bind'](_0x51be1a,_0x38d95b),_0x51be1a['voiceQueues'][_0x358b53][_0x05da('0x24')]*0x3e8);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x26')]=moment()[_0x05da('0x27')](_0x05da('0x28'));_0x51be1a[_0x05da('0x6')][_0x38d95b]['uniqueid']=_0x4fb65a;_0x51be1a['timers'][_0x38d95b][_0x05da('0x17')]=_0x358b53;_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x29')]=function(){var _0x9d4f32=getDiff(_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x26')]);clearTimeout(_0x51be1a['timers'][_0x38d95b][_0x05da('0x25')]);_0x51be1a[_0x05da('0x6')][_0x38d95b][_0x05da('0x25')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x9d4f32},_0x51be1a[_0x05da('0x6')][_0x38d95b]['uniqueid'],_0x38d95b)[_0x05da('0x1e')](function(_0x567e84){logger[_0x05da('0x23')](_0x05da('0x2a'),_0x4fb65a,_0x9d4f32,_0x567e84);})[_0x05da('0x2b')](function(_0x2966bd){logger[_0x05da('0x2c')](_0x05da('0x2d'),_0x4fb65a,_0x2966bd);});delete _0x51be1a[_0x05da('0x6')][_0x38d95b];};}});}else{logger[_0x05da('0x23')](_0x05da('0x2e'),_0x4fb65a,_0x38d95b,_0x358b53);}});}})[_0x05da('0x2b')](function(){logger[_0x05da('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4fb65a,_0x51be1a['voiceQueues'][_0x358b53][_0x05da('0x24')],_0x38d95b,_0x358b53);})[_0x05da('0x2f')](function(){delete _0x51be1a[_0x05da('0x15')][_0x4fb65a];});}catch(_0x56dec4){logger[_0x05da('0x2c')](_0x05da('0x30'),_0x56dec4[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x32')]=function(_0x42b21b){try{var _0x1bf03a=this;if(_0x1bf03a[_0x05da('0x6')][_0x42b21b]){_0x1bf03a[_0x05da('0x6')][_0x42b21b]['timer']=![];var _0x45b896=_0x1bf03a[_0x05da('0x6')][_0x42b21b]['uniqueid'];var _0x1f1e0c=_0x1bf03a['timers'][_0x42b21b][_0x05da('0x17')];var _0xaac08e=_0x1bf03a[_0x05da('0x4')][_0x1f1e0c]['acwTimeout'];logger[_0x05da('0x23')](_0x05da('0x33'),_0x45b896,_0x42b21b);RpcUser[_0x05da('0x34')](this[_0x05da('0x5')][_0x42b21b]);RpcVoiceAgentReport[_0x05da('0x35')]({'acwtime':_0xaac08e,'agentacw':!![]},_0x45b896,_0x42b21b)[_0x05da('0x1e')](function(_0x579e85){logger[_0x05da('0x23')](_0x05da('0x2a'),_0x45b896,_0xaac08e,_0x579e85);})['catch'](function(_0x12c0a8){logger[_0x05da('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x45b896,_0x12c0a8);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x42b21b);if(_0x1bf03a['timers']){logger[_0x05da('0x23')]('[ACW][TIMERS]',JSON[_0x05da('0x36')](_0x1bf03a[_0x05da('0x6')]));}}}catch(_0xfa5f10){logger['error'](_0x05da('0x37'),_0xfa5f10[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0x8')]=function(_0x50928f){try{if(this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]]&&(this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]][_0x05da('0x2')]||this[_0x05da('0x4')][_0x50928f[_0x05da('0x17')]]['mandatoryDisposition'])){if(this[_0x05da('0x5')][_0x50928f[_0x05da('0x16')]]){this[_0x05da('0x15')][_0x50928f[_0x05da('0x38')]]={'queue':_0x50928f[_0x05da('0x17')],'interface':_0x50928f[_0x05da('0x16')],'destlinkedid':_0x50928f[_0x05da('0x22')]};}}}catch(_0xea0858){logger[_0x05da('0x2c')](_0x05da('0x39'),_0xea0858[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0x11')]=function(_0x3b125d){try{if(this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]]&&(this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]][_0x05da('0x2')]||this[_0x05da('0x4')][_0x3b125d[_0x05da('0x17')]][_0x05da('0x18')])){if(this['agents'][_0x3b125d[_0x05da('0x16')]]){this[_0x05da('0x15')][_0x3b125d['uniqueid']]={'queue':_0x3b125d[_0x05da('0x17')],'interface':_0x3b125d[_0x05da('0x16')]};}}}catch(_0x49e85d){logger['error'](_0x05da('0x3a'),_0x49e85d[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x3b')]=function(_0x2bd821){try{if(this[_0x05da('0x15')][_0x2bd821[_0x05da('0x38')]]&&_[_0x05da('0x3c')](this['channels'][_0x2bd821[_0x05da('0x38')]][_0x05da('0x21')])){logger[_0x05da('0x23')](_0x05da('0x3d'),_0x2bd821['uniqueid']);this['startAcw'](_0x2bd821[_0x05da('0x38')]);}else if(this['channels'][_0x2bd821[_0x05da('0x3e')]]&&_[_0x05da('0x3c')](this[_0x05da('0x15')][_0x2bd821[_0x05da('0x3e')]][_0x05da('0x21')])){logger[_0x05da('0x23')](_0x05da('0x3f'),_0x2bd821[_0x05da('0x3e')]);this[_0x05da('0x40')](_0x2bd821['linkedid']);}}catch(_0x57a674){logger[_0x05da('0x2c')](_0x05da('0x41'),_0x57a674[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x42')]=function(_0x57fef9){try{if(this[_0x05da('0x15')][_0x57fef9['uniqueid']]&&this['channels'][_0x57fef9[_0x05da('0x38')]][_0x05da('0x21')]){logger['info'](_0x05da('0x43'),_0x57fef9['uniqueid']);this['startAcw'](_0x57fef9['uniqueid']);}else if(this['channels'][_0x57fef9[_0x05da('0x3e')]]&&this[_0x05da('0x15')][_0x57fef9[_0x05da('0x3e')]][_0x05da('0x21')]){logger['info'](_0x05da('0x44'),_0x57fef9['linkedid']);this[_0x05da('0x40')](_0x57fef9['linkedid']);}}catch(_0x181431){logger[_0x05da('0x2c')](_0x05da('0x45'),_0x181431[_0x05da('0x31')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x272d6a){try{if(!_[_0x05da('0x46')](this[_0x05da('0x15')][_0x272d6a['transfereeuniqueid']])){this[_0x05da('0x40')](_0x272d6a[_0x05da('0x47')]);if(this['channels'][_0x272d6a['secondtransfereruniqueid']]){this[_0x05da('0x15')][_0x272d6a[_0x05da('0x48')]]['attended']=!![];this[_0x05da('0x15')][_0x272d6a['transfertargetuniqueid']]=this[_0x05da('0x15')][_0x272d6a['secondtransfereruniqueid']];delete this[_0x05da('0x15')][_0x272d6a['secondtransfereruniqueid']];}}else if(!_[_0x05da('0x46')](this['channels'][_0x272d6a[_0x05da('0x49')]])){this[_0x05da('0x40')](_0x272d6a[_0x05da('0x49')]);if(this['channels'][_0x272d6a['origtransfereruniqueid']]){this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]][_0x05da('0x21')]=!![];this[_0x05da('0x15')][_0x272d6a[_0x05da('0x47')]]=this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]];delete this[_0x05da('0x15')][_0x272d6a[_0x05da('0x4a')]];}}}catch(_0x208945){logger[_0x05da('0x2c')](_0x05da('0x4b'),_0x208945[_0x05da('0x31')]);}};Acw[_0x05da('0x14')][_0x05da('0x4c')]=function(_0x1c03e5){try{if(this[_0x05da('0x15')][_0x1c03e5[_0x05da('0x4d')]]){logger[_0x05da('0x23')](_0x05da('0x4e'),JSON['stringify'](_0x1c03e5['transfereruniqueid']));this[_0x05da('0x40')](_0x1c03e5[_0x05da('0x4d')]);}else if(this[_0x05da('0x15')][_0x1c03e5[_0x05da('0x4f')]]){logger[_0x05da('0x23')](_0x05da('0x50'),JSON[_0x05da('0x36')](_0x1c03e5[_0x05da('0x4f')]));this[_0x05da('0x40')](_0x1c03e5[_0x05da('0x4f')]);}}catch(_0x464e37){logger['error'](_0x05da('0x51'),_0x464e37[_0x05da('0x31')]);}};Acw['prototype'][_0x05da('0xd')]=function(_0x2d21c0){try{if(this[_0x05da('0x4')][_0x2d21c0[_0x05da('0x17')]]&&this[_0x05da('0x4')][_0x2d21c0[_0x05da('0x17')]]['autopause']===_0x05da('0x52')){if(this[_0x05da('0x5')][_0x2d21c0[_0x05da('0x16')]]){logger[_0x05da('0x23')](_0x05da('0x53'),_0x2d21c0['uniqueid'],_0x2d21c0[_0x05da('0x16')],_0x2d21c0['queue']);return RpcUser[_0x05da('0x54')](this[_0x05da('0x5')][_0x2d21c0[_0x05da('0x16')]],_0x05da('0x55'),_0x2d21c0[_0x05da('0x38')]);}}}catch(_0x34455b){logger[_0x05da('0x2c')](_0x05da('0x56'),_0x34455b['message']);}};module[_0x05da('0x57')]=Acw; \ No newline at end of file +var _0xdca9=['[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','then','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','prototype','stopAcw','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','startAcw','isUndefined','attended','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0xdca9,0x164));var _0x9dca=function(_0x521e85,_0x48b8b0){_0x521e85=_0x521e85-0x0;var _0xb27342=_0xdca9[_0x521e85];return _0xb27342;};'use strict';var _=require(_0x9dca('0x0'));var moment=require(_0x9dca('0x1'));var ami=require(_0x9dca('0x2'));var logger=require(_0x9dca('0x3'))(_0x9dca('0x4'));var RpcUser=require(_0x9dca('0x5'));var RpcVoiceAgentReport=require(_0x9dca('0x6'));function Acw(_0x350dea){this['voiceQueues']=_0x350dea[_0x9dca('0x7')];this[_0x9dca('0x8')]=_0x350dea[_0x9dca('0x8')];this[_0x9dca('0x9')]=_0x350dea[_0x9dca('0x9')];this[_0x9dca('0xa')]={};ami['on']('agentconnect',this[_0x9dca('0xb')][_0x9dca('0xc')](this));ami['on'](_0x9dca('0xd'),this['syncHangupRequest'][_0x9dca('0xc')](this));ami['on']('hangup',this[_0x9dca('0xe')][_0x9dca('0xc')](this));ami['on']('agentringnoanswer',this[_0x9dca('0xf')]['bind'](this));ami['on'](_0x9dca('0x10'),this[_0x9dca('0x11')]['bind'](this));ami['on']('blindtransfer',this[_0x9dca('0x12')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x9dca('0x13')][_0x9dca('0xc')](this));}function getDiff(_0x1b336f){var _0x7ff8ff=moment()[_0x9dca('0x14')](0x0);var _0x3d052b=moment(_0x1b336f)[_0x9dca('0x14')](0x0);return _0x7ff8ff[_0x9dca('0x15')](_0x3d052b,_0x9dca('0x16'));}Acw['prototype']['startAcw']=function(_0x5ecf6a){try{var _0x55643a=this;var _0x621e7a=this[_0x9dca('0xa')][_0x5ecf6a][_0x9dca('0x17')];var _0x215875=this[_0x9dca('0xa')][_0x5ecf6a][_0x9dca('0x18')];var _0x55fe5d=this[_0x9dca('0x7')][_0x215875];var _0x52bdd1=![];var _0x167302=_0x9dca('0x19');if(_0x55fe5d[_0x9dca('0x1a')]){if(_0x55fe5d[_0x9dca('0x1b')][_0x9dca('0x1c')]){_0x52bdd1=!![];_0x167302=_0x55fe5d['mandatoryDispositionPause'][_0x9dca('0x1c')];}}return ami[_0x9dca('0x1d')]({'action':_0x9dca('0x1e'),'interface':_0x621e7a,'paused':!![],'reason':_0x167302})['then'](function(){if(_0x55643a[_0x9dca('0x8')][_0x621e7a]){return RpcUser[_0x9dca('0x1f')](_0x55643a[_0x9dca('0x8')][_0x621e7a]['id'])['then'](function(_0x360acd){if(_0x360acd&&!_0x360acd[_0x9dca('0x20')]){logger[_0x9dca('0x21')](_0x9dca('0x22'),_0x5ecf6a,_0x621e7a,_0x215875);var _0x3f6b93=_0x55643a[_0x9dca('0xa')][_0x5ecf6a]['attended']&&_0x55643a[_0x9dca('0xa')][_0x5ecf6a][_0x9dca('0x23')]?_0x55643a[_0x9dca('0xa')][_0x5ecf6a][_0x9dca('0x23')]:_0x5ecf6a;return RpcUser[_0x9dca('0x24')](_0x55643a[_0x9dca('0x8')][_0x621e7a],_0x167302,_0x3f6b93)['then'](function(){if(!_0x52bdd1){_0x55643a[_0x9dca('0x9')][_0x621e7a]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5ecf6a,_0x55643a[_0x9dca('0x7')][_0x215875][_0x9dca('0x25')],_0x621e7a,_0x215875);_0x55643a[_0x9dca('0x9')][_0x621e7a]['timer']=setTimeout(_0x55643a['stopAcw']['bind'](_0x55643a,_0x621e7a),_0x55643a[_0x9dca('0x7')][_0x215875][_0x9dca('0x25')]*0x3e8);_0x55643a[_0x9dca('0x9')][_0x621e7a][_0x9dca('0x26')]=moment()['format'](_0x9dca('0x27'));_0x55643a[_0x9dca('0x9')][_0x621e7a][_0x9dca('0x28')]=_0x5ecf6a;_0x55643a[_0x9dca('0x9')][_0x621e7a][_0x9dca('0x18')]=_0x215875;_0x55643a['timers'][_0x621e7a][_0x9dca('0x29')]=function(){var _0x4d1be4=getDiff(_0x55643a['timers'][_0x621e7a]['lastPauseAt']);clearTimeout(_0x55643a[_0x9dca('0x9')][_0x621e7a][_0x9dca('0x2a')]);_0x55643a[_0x9dca('0x9')][_0x621e7a]['timer']=![];RpcVoiceAgentReport[_0x9dca('0x2b')]({'acwtime':_0x4d1be4},_0x55643a[_0x9dca('0x9')][_0x621e7a]['uniqueid'],_0x621e7a)[_0x9dca('0x2c')](function(_0x162905){logger[_0x9dca('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x5ecf6a,_0x4d1be4,_0x162905);})['catch'](function(_0xfc172f){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x5ecf6a,_0xfc172f);});delete _0x55643a['timers'][_0x621e7a];};}});}else{logger[_0x9dca('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5ecf6a,_0x621e7a,_0x215875);}});}})[_0x9dca('0x2d')](function(){logger['error'](_0x9dca('0x2e'),_0x5ecf6a,_0x55643a[_0x9dca('0x7')][_0x215875][_0x9dca('0x25')],_0x621e7a,_0x215875);})[_0x9dca('0x2f')](function(){delete _0x55643a[_0x9dca('0xa')][_0x5ecf6a];});}catch(_0x544f8f){logger[_0x9dca('0x30')](_0x9dca('0x31'),_0x544f8f[_0x9dca('0x32')]);}};Acw[_0x9dca('0x33')][_0x9dca('0x34')]=function(_0x3c85e8){try{var _0x375c8c=this;if(_0x375c8c['timers'][_0x3c85e8]){_0x375c8c['timers'][_0x3c85e8][_0x9dca('0x2a')]=![];var _0x29519f=_0x375c8c['timers'][_0x3c85e8][_0x9dca('0x28')];var _0x3ed678=_0x375c8c[_0x9dca('0x9')][_0x3c85e8]['queue'];var _0x2f4558=_0x375c8c[_0x9dca('0x7')][_0x3ed678][_0x9dca('0x25')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x29519f,_0x3c85e8);RpcUser[_0x9dca('0x35')](this[_0x9dca('0x8')][_0x3c85e8]);RpcVoiceAgentReport[_0x9dca('0x2b')]({'acwtime':_0x2f4558,'agentacw':!![]},_0x29519f,_0x3c85e8)[_0x9dca('0x2c')](function(_0xd66d4a){logger[_0x9dca('0x21')](_0x9dca('0x36'),_0x29519f,_0x2f4558,_0xd66d4a);})[_0x9dca('0x2d')](function(_0xbc1f39){logger[_0x9dca('0x30')](_0x9dca('0x37'),_0x29519f,_0xbc1f39);});}else{logger[_0x9dca('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3c85e8);if(_0x375c8c[_0x9dca('0x9')]){logger[_0x9dca('0x21')](_0x9dca('0x38'),JSON[_0x9dca('0x39')](_0x375c8c[_0x9dca('0x9')]));}}}catch(_0x2b6a49){logger['error'](_0x9dca('0x3a'),_0x2b6a49[_0x9dca('0x32')]);}};Acw[_0x9dca('0x33')][_0x9dca('0xb')]=function(_0x5aac26){try{if(this['voiceQueues'][_0x5aac26[_0x9dca('0x18')]]&&(this[_0x9dca('0x7')][_0x5aac26[_0x9dca('0x18')]][_0x9dca('0x4')]||this[_0x9dca('0x7')][_0x5aac26[_0x9dca('0x18')]][_0x9dca('0x1a')])){if(this[_0x9dca('0x8')][_0x5aac26[_0x9dca('0x17')]]){this[_0x9dca('0xa')][_0x5aac26[_0x9dca('0x28')]]={'queue':_0x5aac26[_0x9dca('0x18')],'interface':_0x5aac26[_0x9dca('0x17')],'destlinkedid':_0x5aac26['destlinkedid']};}}}catch(_0x4a973a){logger[_0x9dca('0x30')](_0x9dca('0x3b'),_0x4a973a[_0x9dca('0x32')]);}};Acw[_0x9dca('0x33')][_0x9dca('0x13')]=function(_0x12a956){try{if(this['voiceQueues'][_0x12a956[_0x9dca('0x18')]]&&(this[_0x9dca('0x7')][_0x12a956[_0x9dca('0x18')]][_0x9dca('0x4')]||this[_0x9dca('0x7')][_0x12a956['queue']]['mandatoryDisposition'])){if(this[_0x9dca('0x8')][_0x12a956[_0x9dca('0x17')]]){this[_0x9dca('0xa')][_0x12a956['uniqueid']]={'queue':_0x12a956[_0x9dca('0x18')],'interface':_0x12a956['interface']};}}}catch(_0x13b4d1){logger[_0x9dca('0x30')](_0x9dca('0x3c'),_0x13b4d1[_0x9dca('0x32')]);}};Acw['prototype'][_0x9dca('0x3d')]=function(_0x254f04){try{if(this['channels'][_0x254f04[_0x9dca('0x28')]]&&_['isUndefined'](this[_0x9dca('0xa')][_0x254f04[_0x9dca('0x28')]]['attended'])){logger[_0x9dca('0x21')](_0x9dca('0x3e'),_0x254f04[_0x9dca('0x28')]);this[_0x9dca('0x3f')](_0x254f04[_0x9dca('0x28')]);}else if(this[_0x9dca('0xa')][_0x254f04['linkedid']]&&_[_0x9dca('0x40')](this[_0x9dca('0xa')][_0x254f04['linkedid']][_0x9dca('0x41')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x254f04[_0x9dca('0x42')]);this[_0x9dca('0x3f')](_0x254f04['linkedid']);}}catch(_0x2073b8){logger[_0x9dca('0x30')](_0x9dca('0x43'),_0x2073b8[_0x9dca('0x32')]);}};Acw['prototype'][_0x9dca('0xe')]=function(_0x22529a){try{if(this[_0x9dca('0xa')][_0x22529a[_0x9dca('0x28')]]&&this['channels'][_0x22529a[_0x9dca('0x28')]][_0x9dca('0x41')]){logger[_0x9dca('0x21')](_0x9dca('0x44'),_0x22529a[_0x9dca('0x28')]);this[_0x9dca('0x3f')](_0x22529a[_0x9dca('0x28')]);}else if(this[_0x9dca('0xa')][_0x22529a[_0x9dca('0x42')]]&&this[_0x9dca('0xa')][_0x22529a['linkedid']][_0x9dca('0x41')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x22529a[_0x9dca('0x42')]);this[_0x9dca('0x3f')](_0x22529a[_0x9dca('0x42')]);}}catch(_0x378ea9){logger[_0x9dca('0x30')](_0x9dca('0x45'),_0x378ea9['message']);}};Acw[_0x9dca('0x33')]['syncAttendedTransfer']=function(_0x5836e0){try{if(!_[_0x9dca('0x46')](this[_0x9dca('0xa')][_0x5836e0['transfereeuniqueid']])){this[_0x9dca('0x3f')](_0x5836e0['transfereeuniqueid']);if(this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x47')]]){this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x47')]][_0x9dca('0x41')]=!![];this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x48')]]=this[_0x9dca('0xa')][_0x5836e0['secondtransfereruniqueid']];delete this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x47')]];}}else if(!_[_0x9dca('0x46')](this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x48')]])){this[_0x9dca('0x3f')](_0x5836e0[_0x9dca('0x48')]);if(this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x49')]]){this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x49')]]['attended']=!![];this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x4a')]]=this[_0x9dca('0xa')][_0x5836e0['origtransfereruniqueid']];delete this[_0x9dca('0xa')][_0x5836e0[_0x9dca('0x49')]];}}}catch(_0x4b593a){logger[_0x9dca('0x30')](_0x9dca('0x4b'),_0x4b593a[_0x9dca('0x32')]);}};Acw[_0x9dca('0x33')][_0x9dca('0x12')]=function(_0x58ac08){try{if(this[_0x9dca('0xa')][_0x58ac08['transfereruniqueid']]){logger[_0x9dca('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x58ac08[_0x9dca('0x4c')]));this[_0x9dca('0x3f')](_0x58ac08['transfereruniqueid']);}else if(this['channels'][_0x58ac08['transfererlinkedid']]){logger['info'](_0x9dca('0x4d'),JSON['stringify'](_0x58ac08[_0x9dca('0x4e')]));this[_0x9dca('0x3f')](_0x58ac08[_0x9dca('0x4e')]);}}catch(_0x452e6f){logger[_0x9dca('0x30')](_0x9dca('0x4f'),_0x452e6f[_0x9dca('0x32')]);}};Acw[_0x9dca('0x33')]['syncAgentRingNoAnswer']=function(_0x246234){try{if(this[_0x9dca('0x7')][_0x246234[_0x9dca('0x18')]]&&this[_0x9dca('0x7')][_0x246234[_0x9dca('0x18')]][_0x9dca('0x50')]===_0x9dca('0x51')){if(this[_0x9dca('0x8')][_0x246234[_0x9dca('0x17')]]){logger[_0x9dca('0x21')](_0x9dca('0x52'),_0x246234[_0x9dca('0x28')],_0x246234[_0x9dca('0x17')],_0x246234[_0x9dca('0x18')]);return RpcUser[_0x9dca('0x24')](this[_0x9dca('0x8')][_0x246234[_0x9dca('0x17')]],'Auto-Pause',_0x246234[_0x9dca('0x28')]);}}}catch(_0x207f32){logger[_0x9dca('0x30')](_0x9dca('0x53'),_0x207f32[_0x9dca('0x32')]);}};module[_0x9dca('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 440a607..67ed66b 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 _0x3975=['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','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels'];(function(_0x377670,_0x10d1e1){var _0x15077d=function(_0x267f51){while(--_0x267f51){_0x377670['push'](_0x377670['shift']());}};_0x15077d(++_0x10d1e1);}(_0x3975,0xc6));var _0x5397=function(_0x20805b,_0x25a144){_0x20805b=_0x20805b-0x0;var _0x362154=_0x3975[_0x20805b];return _0x362154;};'use strict';var Manager=require(_0x5397('0x0'));var BPromise=require(_0x5397('0x1'));var util=require('util');var logger=require(_0x5397('0x2'))(_0x5397('0x3'));var config=require(_0x5397('0x4'));var ami=new Manager(config[_0x5397('0x5')]['port'],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['username'],config[_0x5397('0x5')][_0x5397('0x6')],!![]);ami['keepConnected']();ami[_0x5397('0x7')]=BPromise[_0x5397('0x8')](ami['action']);function error(_0x24b7f1){logger[_0x5397('0x9')](util[_0x5397('0xa')](_0x5397('0xb'),config['asterisk'][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['port'],util['inspect'](_0x24b7f1,![],null)));}function close(){logger[_0x5397('0x9')](util[_0x5397('0xa')](_0x5397('0xd'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')]));}ami[_0x5397('0xf')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x10')});};};ami[_0x5397('0x11')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x12')});};};ami[_0x5397('0x13')]=function(){return function(){return ami[_0x5397('0x7')]({'action':_0x5397('0x14')});};};ami[_0x5397('0x15')]=function(){return function(){return ami[_0x5397('0x7')]({'action':'queuesummary'});};};ami[_0x5397('0x16')]=function(){return function(){return ami['Action']({'action':_0x5397('0x17')});};};function connect(){logger[_0x5397('0x18')](util[_0x5397('0xa')](_0x5397('0x19'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')]['port']));ami[_0x5397('0x1a')]('error',error);ami[_0x5397('0x1a')](_0x5397('0x1b'),close);}ami['on'](_0x5397('0x1c'),connect);ami['on']('shutdown',function(_0x584771){logger[_0x5397('0x18')](util['format'](_0x5397('0x1d'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')],util[_0x5397('0x1e')](_0x584771,![],null)));});ami['on'](_0x5397('0x1f'),function(){logger[_0x5397('0x18')](util[_0x5397('0xa')](_0x5397('0x20'),config[_0x5397('0x5')][_0x5397('0xc')],config[_0x5397('0x5')]['ip'],config[_0x5397('0x5')][_0x5397('0xe')]));return Promise[_0x5397('0x21')]()['then'](ami[_0x5397('0xf')]())[_0x5397('0x22')](ami['actionDeviceStateList']())['then'](ami[_0x5397('0x13')]())[_0x5397('0x22')](ami['actionQueueSummary']())[_0x5397('0x22')](ami[_0x5397('0x16')]())[_0x5397('0x23')](function(_0x4b7b58){logger[_0x5397('0x9')](_0x5397('0x24'),util[_0x5397('0x1e')](_0x4b7b58,{'showHidden':![],'depth':null}));});});ami[_0x5397('0x1a')](_0x5397('0x9'),error);ami[_0x5397('0x1a')](_0x5397('0x1b'),close);module['exports']=ami; \ No newline at end of file +var _0xa2af=['actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','close','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionSipPeerStatus','sippeerstatus'];(function(_0x58562a,_0x7e4a01){var _0xc1271f=function(_0x46abc1){while(--_0x46abc1){_0x58562a['push'](_0x58562a['shift']());}};_0xc1271f(++_0x7e4a01);}(_0xa2af,0x1f0));var _0xfa2a=function(_0x27e369,_0x163737){_0x27e369=_0x27e369-0x0;var _0x208ab8=_0xa2af[_0x27e369];return _0x208ab8;};'use strict';var Manager=require(_0xfa2a('0x0'));var BPromise=require(_0xfa2a('0x1'));var util=require(_0xfa2a('0x2'));var logger=require(_0xfa2a('0x3'))(_0xfa2a('0x4'));var config=require(_0xfa2a('0x5'));var ami=new Manager(config[_0xfa2a('0x6')][_0xfa2a('0x7')],config[_0xfa2a('0x6')]['ip'],config['asterisk'][_0xfa2a('0x8')],config[_0xfa2a('0x6')][_0xfa2a('0x9')],!![]);ami[_0xfa2a('0xa')]();ami[_0xfa2a('0xb')]=BPromise[_0xfa2a('0xc')](ami[_0xfa2a('0xd')]);function error(_0x479cc9){logger[_0xfa2a('0xe')](util['format'](_0xfa2a('0xf'),config[_0xfa2a('0x6')][_0xfa2a('0x8')],config[_0xfa2a('0x6')]['ip'],config[_0xfa2a('0x6')][_0xfa2a('0x7')],util[_0xfa2a('0x10')](_0x479cc9,![],null)));}function close(){logger['error'](util[_0xfa2a('0x11')](_0xfa2a('0x12'),config[_0xfa2a('0x6')][_0xfa2a('0x8')],config[_0xfa2a('0x6')]['ip'],config['asterisk'][_0xfa2a('0x7')]));}ami[_0xfa2a('0x13')]=function(){return function(){return ami[_0xfa2a('0xb')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xfa2a('0xb')]({'action':'devicestatelist'});};};ami[_0xfa2a('0x14')]=function(){return function(){return ami[_0xfa2a('0xb')]({'action':_0xfa2a('0x15')});};};ami[_0xfa2a('0x16')]=function(){return function(){return ami[_0xfa2a('0xb')]({'action':_0xfa2a('0x17')});};};ami[_0xfa2a('0x18')]=function(){return function(){return ami[_0xfa2a('0xb')]({'action':'coreshowchannels'});};};function connect(){logger[_0xfa2a('0x19')](util['format'](_0xfa2a('0x1a'),config[_0xfa2a('0x6')]['username'],config[_0xfa2a('0x6')]['ip'],config['asterisk'][_0xfa2a('0x7')]));ami[_0xfa2a('0x1b')](_0xfa2a('0xe'),error);ami[_0xfa2a('0x1b')]('close',close);}ami['on'](_0xfa2a('0x1c'),connect);ami['on'](_0xfa2a('0x1d'),function(_0x2d323e){logger[_0xfa2a('0x19')](util[_0xfa2a('0x11')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xfa2a('0x6')][_0xfa2a('0x8')],config['asterisk']['ip'],config[_0xfa2a('0x6')][_0xfa2a('0x7')],util['inspect'](_0x2d323e,![],null)));});ami['on'](_0xfa2a('0x1e'),function(){logger[_0xfa2a('0x19')](util[_0xfa2a('0x11')](_0xfa2a('0x1f'),config['asterisk'][_0xfa2a('0x8')],config[_0xfa2a('0x6')]['ip'],config[_0xfa2a('0x6')][_0xfa2a('0x7')]));return Promise[_0xfa2a('0x20')]()['then'](ami[_0xfa2a('0x13')]())['then'](ami['actionDeviceStateList']())[_0xfa2a('0x21')](ami['actionSipPeerStatus']())[_0xfa2a('0x21')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0xfa2a('0x22')](function(_0x2af6c3){logger[_0xfa2a('0xe')]('[ami.js][fullybooted]',util[_0xfa2a('0x10')](_0x2af6c3,{'showHidden':![],'depth':null}));});});ami[_0xfa2a('0x1b')](_0xfa2a('0xe'),error);ami[_0xfa2a('0x1b')](_0xfa2a('0x23'),close);module[_0xfa2a('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5fe64be..33b80f4 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0xac4a,0x13f));var _0xaac4=function(_0x5313b4,_0x52b1a1){_0x5313b4=_0x5313b4-0x0;var _0x5955ef=_0xac4a[_0x5313b4];return _0x5955ef;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xda3f,0xec));var _0xfda3=function(_0x4572f6,_0xcccb57){_0x4572f6=_0x4572f6-0x0;var _0x4a2312=_0xda3f[_0x4572f6];return _0x4a2312;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0e219c6..b3cadb0 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 _0xf03a=['unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','Queue','dialTimezone','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','syncAgentComplete','outboundAnswerCallsDay','reason','agent','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','rrmemory','actionid','isNil','locked','paused','stateinterface','pick','idHopper','syncQueueStatusComplete','strategy','roundrobin','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','exten','xcally-motion-dialer','value','HangupInAMD','membername','AMD','buildObj','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','amd','emit','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HANGUP','custom:amd','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countnoanswerretry','reason19\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','talking','pTalking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','enqueue','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','actionOriginate','object','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','phone','variables','Action','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','predictiveIntervalHitRate','abandonmentRate','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\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','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','queuemember','queuestatuscomplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','type','outbound','debug','inspect','voice:queue:%s','name','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','[booked][unlockQueueStatus]','stringify','queueStatusComplete','NULL_INTERVAL','Interval','Intervals','isEmpty','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','format','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable'];(function(_0x2f1a6e,_0x3082cb){var _0x5865e5=function(_0x459f1a){while(--_0x459f1a){_0x2f1a6e['push'](_0x2f1a6e['shift']());}};_0x5865e5(++_0x3082cb);}(_0xf03a,0x198));var _0xaf03=function(_0x8762a0,_0x3b4a18){_0x8762a0=_0x8762a0-0x0;var _0xc68f49=_0xf03a[_0x8762a0];return _0xc68f49;};'use strict';var util=require('util');var _=require(_0xaf03('0x0'));var uuid=require('uuid');var moment=require(_0xaf03('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xaf03('0x2'));var hopperUtils=require(_0xaf03('0x3'));var ut=require(_0xaf03('0x4'));var config=require(_0xaf03('0x5'));var logger=require(_0xaf03('0x6'))(_0xaf03('0x7'));var loggerBooked=require('../../../config/logger')(_0xaf03('0x8'));var loggerPredictive=require('../../../config/logger')(_0xaf03('0x9'));var loggerPredictiveCalls=require(_0xaf03('0x6'))(_0xaf03('0xa'));var loggerSyncQueueSummary=require(_0xaf03('0x6'))(_0xaf03('0xb'));var ami=require(_0xaf03('0xc'));config[_0xaf03('0xd')]=_['defaults'](config[_0xaf03('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xaf03('0xe'))(new Redis(config[_0xaf03('0xd')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xaf03('0xf'));var RpcSetting=require(_0xaf03('0x10'));var Interval=require('../rpc/interval');var Action=require(_0xaf03('0x11'));var History=require(_0xaf03('0x12'));var Final=require(_0xaf03('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xaf03('0x14'));var Hangup=require('./models/hangup');var ipAgi=process[_0xaf03('0x15')][_0xaf03('0x16')]||_0xaf03('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xaf03('0x18')]['enqueue']=function(_0x19ca75){this[_0xaf03('0x19')]=this[_0xaf03('0x19')]?this[_0xaf03('0x19')][_0xaf03('0x1a')](_0x19ca75):_0x19ca75();};function Dialer(_0x438e2b,_0x28eed0){this[_0xaf03('0x1b')]=new Sequence();this['preview']=_0x28eed0;this[_0xaf03('0x1c')]=_0x438e2b['voiceQueues'];this[_0xaf03('0x1d')]=_0x438e2b[_0xaf03('0x1d')];this[_0xaf03('0x1e')]=_0x438e2b[_0xaf03('0x1e')];this[_0xaf03('0x1f')]=_0x438e2b[_0xaf03('0x1f')];this[_0xaf03('0x20')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xaf03('0x21')]={};this[_0xaf03('0x22')]={};this[_0xaf03('0x23')]={};this['optionPredictive']={};this[_0xaf03('0x24')]={};this[_0xaf03('0x25')]={};this[_0xaf03('0x26')]={};this[_0xaf03('0x27')]={};this[_0xaf03('0x28')]={};this[_0xaf03('0x29')]={};ami['on'](_0xaf03('0x2a'),this['syncAgentConnect'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x2c'),this[_0xaf03('0x2d')][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x2e'),this[_0xaf03('0x2f')]['bind'](this));ami['on'](_0xaf03('0x30'),this['syncAgentComplete'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x31'),this[_0xaf03('0xb')][_0xaf03('0x2b')](this));ami['on']('custom:queuesummarycomplete',this[_0xaf03('0x32')][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x33'),this[_0xaf03('0x34')]['bind'](this));ami['on'](_0xaf03('0x35'),this['syncNewExten'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x36'),this['syncVarSet'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x37'),this['syncQueueMember'][_0xaf03('0x2b')](this));ami['on'](_0xaf03('0x38'),this['syncQueueStatusComplete'][_0xaf03('0x2b')](this));this['loopCampaigns']();this[_0xaf03('0x39')]();RpcSetting[_0xaf03('0x3a')]()[_0xaf03('0x3b')](function(_0x28d80e){previewRecallmeReminderInterval=_0x28d80e[_0xaf03('0x3c')];});}function isNotNull(_0x1431f4){return _0x1431f4!==null&&!_['isUndefined'](_0x1431f4);}function msgResponse(_0x194aae,_0x2431df,_0x212f8e){return{'action':_0x194aae,'response':_0x2431df,'message':_0x212f8e,'stack':_0x212f8e};}function emit(_0x3e03bc,_0x3cf27b,_0x314108){io['to'](_0x3e03bc)['emit'](_0x3cf27b,_0x314108);}function emitOutboundVoiceQueueSummary(_0x3c8c90){if(_0x3c8c90[_0xaf03('0x3d')]===_0xaf03('0x3e')){logger[_0xaf03('0x3f')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xaf03('0x40')](_0x3c8c90,{'showHidden':![],'depth':null}));emit(util['format'](_0xaf03('0x41'),_0x3c8c90[_0xaf03('0x42')]),_0xaf03('0x43'),_0x3c8c90);}}function checkGetDataPredictive(_0x41b7f2){if(isNotNull(_0x41b7f2)&&!_['isEmpty'](_0x41b7f2)){loggerPredictive['info'](_0xaf03('0x44'));loggerPredictive[_0xaf03('0x45')](_0xaf03('0x46'),_0x41b7f2[_0xaf03('0x47')]);loggerPredictive[_0xaf03('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2[_0xaf03('0x48')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x49'),_0x41b7f2[_0xaf03('0x4a')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2[_0xaf03('0x4b')]);loggerPredictive['info'](_0xaf03('0x4c'),_0x41b7f2[_0xaf03('0x4d')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x41b7f2['predictiveIntervalAvgTalktime']);loggerPredictive[_0xaf03('0x45')]('---------------------------');if(_0x41b7f2['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x41b7f2[_0xaf03('0x4e')])&&_0x41b7f2['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xaf03('0x45')](_0xaf03('0x4f'));if(!_[_0xaf03('0x50')](_0x41b7f2[_0xaf03('0x4d')])&&_0x41b7f2[_0xaf03('0x4d')]>0x0){return!![];}loggerPredictive[_0xaf03('0x45')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xaf03('0x45')](_0xaf03('0x51'));}}else{loggerPredictive[_0xaf03('0x45')](_0xaf03('0x52'));}return![];}function mergeDataErlangB(_0x5e3f30){return function(_0x46b5ef){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xaf03('0x45')](_0xaf03('0x53'),_0x46b5ef['erlangCalls']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x54'),_0x46b5ef[_0xaf03('0x55')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x56'),_0x46b5ef[_0xaf03('0x57')]);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x58'),_0x46b5ef['erlangBusyFactor']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x56'),_0x46b5ef['erlangAbandonmentRate']);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x59'));_[_0xaf03('0x5a')](_0x5e3f30,_0x46b5ef);};}function ifInterval(_0x4541d0,_0x165e33){if(_['isUndefined'](_0x165e33)){return![];}return utils['getSeconds'](undefined,_0x165e33)<_0x4541d0*0x3c;}function clearPredictiveAttributes(_0x47b4b5){if(_0x47b4b5[_0xaf03('0x25')]){_0x47b4b5['startProgressive']=undefined;loggerPredictive['debug'](_0x47b4b5[_0xaf03('0x42')],_0xaf03('0x5b'));}if(_0x47b4b5[_0xaf03('0x24')]){_0x47b4b5[_0xaf03('0x24')]=undefined;loggerPredictive[_0xaf03('0x3f')](_0x47b4b5['name'],_0xaf03('0x5c'));}if(_0x47b4b5[_0xaf03('0x5d')]){clearInterval(_0x47b4b5[_0xaf03('0x5d')]);_0x47b4b5[_0xaf03('0x5d')]=undefined;loggerPredictive[_0xaf03('0x3f')](_0x47b4b5[_0xaf03('0x42')],_0xaf03('0x5e'));}}function loggerCatchPredictive(_0xe59c80,_0x2c4636){return function(_0x2d3ad3){loggerPredictive['error'](_0x2c4636[_0xaf03('0x42')],_0xe59c80);loggerPredictive[_0xaf03('0x5f')](_0x2d3ad3[_0xaf03('0x60')]);clearPredictiveAttributes(_0x2c4636);};}function loggerCatch(_0x402c5e){return function(_0x2bf779){logger[_0xaf03('0x5f')](_0x402c5e,util['inspect'](_0x2bf779,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x1123cb,_0xf08114,_0x46e74e){return function(_0x5eb4d0){utils[_0xaf03('0x61')](_0xf08114,_0x46e74e,0x0);logger['error'](_0x1123cb,util['inspect'](_0x5eb4d0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x14b570){return function(_0x50ed71){if(isNotNull(_0x50ed71)&&isNotNull(_0x50ed71[0x0])){if(_0x50ed71[0x0][_0xaf03('0x62')]>0x0){_0x14b570[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x65')];logger['info'](_0xaf03('0x66')+_0x14b570[_0xaf03('0x42')],_0x50ed71[0x0][_0xaf03('0x62')],_0xaf03('0x67'));}else{_0x14b570[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x68')];logger[_0xaf03('0x45')](_0xaf03('0x69')+_0x14b570[_0xaf03('0x42')]);}}};}function createObjHistory(_0x5363c8,_0x3720f6,_0x187e91,_0xc9d5ab,_0x477211){_0x5363c8['message']=_0x187e91;var _0x456902=new Action(_0x5363c8,_0x3720f6);var _0x3832b4=new History(_0x456902);_0x3832b4[_0xaf03('0x6a')]=_0xc9d5ab;_0x3832b4[_0xaf03('0x6b')]=_0x477211;_0x3832b4[_0xaf03('0x6c')]=_0x456902['starttime'];return _0x3832b4;}function unlockQueueStatus(_0x2d3ad0,_0x483bf0){setTimeout(function(){if(_[_0xaf03('0x50')](_0x2d3ad0['queueStatusComplete'])){loggerBooked[_0xaf03('0x5f')]('[unlockQueueStatus][undefined]',_0x483bf0);}_0x2d3ad0['queueStatusComplete']=!![];loggerBooked[_0xaf03('0x45')](_0xaf03('0x6d'),_0x483bf0,JSON[_0xaf03('0x6e')](_['pick'](_0x2d3ad0,[_0xaf03('0x42'),_0xaf03('0x6f')])));},0x1f3);}function checkInterval(_0x29eeda){return function(){if(!isNotNull(_0x29eeda['Interval'])){_0x29eeda['message']=utils[_0xaf03('0x64')][_0xaf03('0x70')];throw _0x29eeda[_0xaf03('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x29eeda[_0xaf03('0x71')][_0xaf03('0x72')])){_0x29eeda['message']=utils[_0xaf03('0x64')][_0xaf03('0x70')];throw _0x29eeda[_0xaf03('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xaf03('0x73')](_0x29eeda[_0xaf03('0x71')][_0xaf03('0x72')]))){_0x29eeda[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS'][_0xaf03('0x70')];throw _0x29eeda['name']+_0xaf03('0x74');}};}function checkIsIVRCampaignActive(_0x332312){return function(){if(!utils[_0xaf03('0x75')](_0x332312)){_0x332312[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x76')];throw _0x332312[_0xaf03('0x42')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x20ef02){if(utils['isIVRCampaign'](_0x20ef02)){emit(util[_0xaf03('0x77')](_0xaf03('0x78'),_0x20ef02[_0xaf03('0x42')]),'campaign:save',_0x20ef02);}}function loggerCatchQueueSummary(_0x2856fa,_0xfea2b1){return function(_0x31e539){clearPredictiveAttributes(_0xfea2b1);emitCampaignSummary(_0xfea2b1);loggerSyncQueueSummary[_0xaf03('0x3f')](_0x2856fa,util[_0xaf03('0x40')](_0x31e539,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x11493f){if(_0x11493f[_0xaf03('0x79')]){if(_0x11493f[_0xaf03('0x7a')]===0x0){_0x11493f[_0xaf03('0x79')]=![];_0x11493f[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x76')];loggerSyncQueueSummary[_0xaf03('0x3f')](_0xaf03('0x7b'),_0x11493f[_0xaf03('0x42')],_0xaf03('0x7c'));}else{_0x11493f[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary['debug'](_0xaf03('0x7b'),_0x11493f[_0xaf03('0x42')],_0xaf03('0x7d'));}emitCampaignSummary(_0x11493f);}}function myreject(_0x75c3af){return function(_0x2abae6){return _0x75c3af(msgResponse(_0xaf03('0x7e'),_0xaf03('0x7f'),JSON[_0xaf03('0x6e')](_0x2abae6)));};}Dialer['prototype'][_0xaf03('0x80')]=function(_0x53c29b){return!_[_0xaf03('0x50')](_0x53c29b)&&_0x53c29b&&!_['isUndefined'](_0x53c29b['name'])&&!_['isUndefined'](_0x53c29b[_0xaf03('0x81')])&&_0x53c29b['active']&&(this[_0xaf03('0x1f')][util['format'](_0xaf03('0x82'),_0x53c29b[_0xaf03('0x42')])][_0xaf03('0x83')]===_0xaf03('0x84')||this[_0xaf03('0x1f')][util['format'](_0xaf03('0x82'),_0x53c29b[_0xaf03('0x42')])][_0xaf03('0x83')]===_0xaf03('0x85'));};Dialer[_0xaf03('0x18')][_0xaf03('0x86')]=function(_0x389280){var _0x54d171=this;return function(){if(!_0x54d171[_0xaf03('0x80')](_0x389280[_0xaf03('0x87')])){if(!_0x54d171[_0xaf03('0x80')](_0x389280['TrunkBackup'])){_0x389280[_0xaf03('0x63')]=utils['CAMPAIGN_STATUS'][_0xaf03('0x88')];throw _0x389280['name']+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xaf03('0x89')]=function(_0x39ad61,_0x2a945b,_0x43d905,_0x3a165a){var _0x34052a=this;return function(){var _0x13d604=!![];return _0x34052a[_0xaf03('0x8a')](_0x39ad61,_0x2a945b,_0x43d905,_0x3a165a,_0x13d604);};};Dialer[_0xaf03('0x18')]['checkIfTimeIntervals']=function(_0x32f216,_0x15f99a,_0x4fca60,_0xf59e1){var _0x3d214d=this;return function(){var _0xc97777=![];return _0x3d214d[_0xaf03('0x8a')](_0x32f216[_0xaf03('0x72')],_0x15f99a,_0x4fca60,_0xf59e1,_0xc97777);};};Dialer['prototype'][_0xaf03('0x8a')]=function(_0x54658d,_0x249038,_0x11c023,_0x1b1781,_0x47d7ce){var _0x3dfa29=[];return new Promise(function(_0x5838af,_0x3cadaf){if(!isNotNull(_0x54658d)){_0x1b1781[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x70')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x8d')));}if(_[_0xaf03('0x73')](_0x54658d)){_0x1b1781['message']=utils['CAMPAIGN_STATUS'][_0xaf03('0x8e')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x8f')));}if(_0x249038&&_[_0xaf03('0x50')](config[_0xaf03('0x90')][_0x249038])){_0x1b1781['message']=utils[_0xaf03('0x64')][_0xaf03('0x91')];return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),_0x11c023+_0xaf03('0x92')+_0x249038));}if(_[_0xaf03('0x93')](_0x54658d)){for(var _0xaa55ef=0x0;_0xaa55ef<_0x54658d[_0xaf03('0x94')];_0xaa55ef+=0x1){_0x3dfa29[_0xaf03('0x95')](ami['Action']({'action':_0xaf03('0x96'),'command':util[_0xaf03('0x77')]('iftime\x20%s,%s',_0x54658d[_0xaa55ef][_0xaf03('0x97')],!_[_0xaf03('0x50')](config['timezones'][_0x249038])?_0x249038:'')})[_0xaf03('0x3b')](function(_0x366221){return _0x366221[_0xaf03('0x98')][_0xaf03('0x99')](_0xaf03('0x9a'))>=0x0;})[_0xaf03('0x9b')](myreject(_0x3cadaf)));}}else{_0x3dfa29[_0xaf03('0x95')](ami['Action']({'action':_0xaf03('0x96'),'command':util['format'](_0xaf03('0x9c'),_0x54658d,!_['isUndefined'](config[_0xaf03('0x90')][_0x249038])?_0x249038:'')})[_0xaf03('0x3b')](function(_0x3a130d){return _0x3a130d['content'][_0xaf03('0x99')](_0xaf03('0x9a'))>=0x0;})['catch'](myreject(_0x3cadaf)));}Promise['all'](_0x3dfa29)['then'](function(_0x2a5fa1){var _0x10867c=_[_0xaf03('0x9d')](_0x2a5fa1);if(_0x10867c){return _0x5838af(_0x10867c);}else{_0x1b1781[_0xaf03('0x63')]=_0x47d7ce?utils[_0xaf03('0x64')][_0xaf03('0x9e')]:utils[_0xaf03('0x64')]['OVERTIME_INTERVAL'];return _0x3cadaf(msgResponse(_0xaf03('0x9f'),_0xaf03('0x8c'),'Global:\x20'+_0x47d7ce+'\x20'+_0x11c023+_0xaf03('0xa0')+util[_0xaf03('0x40')](_0x54658d,{'showHidden':![],'depth':null})+_0xaf03('0xa1')+_0x249038));}})[_0xaf03('0x9b')](function(_0x504457){return _0x3cadaf(msgResponse(_0xaf03('0x8b'),_0xaf03('0x8c'),JSON[_0xaf03('0x6e')](_0x504457)));});});};Dialer[_0xaf03('0x18')][_0xaf03('0xa2')]=function(){var _0x22c0e6=this;return cmHopper[_0xaf03('0xa3')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x22c0e6[_0xaf03('0xa4')]();},0x3e8);});};Dialer[_0xaf03('0x18')]['syncCampaigns']=function(){var _0x3c7c3e=this;var _0x202c2c;for(var _0x1a0683 in this['campaigns']){if(typeof this[_0xaf03('0x1d')][_0x1a0683]!==_0xaf03('0xa5')){_0x202c2c=this['campaigns'][_0x1a0683];if(utils['isIVRCampaign'](_0x202c2c)&&utils[_0xaf03('0x75')](_0x202c2c)){_0x202c2c[_0xaf03('0x79')]=!![];Promise[_0xaf03('0xa6')]()['then'](checkIsIVRCampaignActive(_0x202c2c))[_0xaf03('0x3b')](checkInterval(_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e['checkIsTrunkReachable'](_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e['checkIfTime'](_0x202c2c[_0xaf03('0xa7')],_0x202c2c['dialTimezone'],_0x202c2c[_0xaf03('0x42')],_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e[_0xaf03('0xa8')](_0x202c2c['Interval'],_0x202c2c['dialTimezone'],_0x202c2c['name'],_0x202c2c))[_0xaf03('0x3b')](_0x3c7c3e[_0xaf03('0xa9')](_0x202c2c))['catch'](loggerCatchQueueSummary(_0xaf03('0xaa'),_0x202c2c));}else{notSendMessagesCampaign(_0x202c2c);}}}};Dialer['prototype'][_0xaf03('0xab')]=function(_0x5b0881){if(_0x5b0881[_0xaf03('0xac')]!==_0xaf03('0x9')){clearPredictiveAttributes(_0x5b0881);}switch(_0x5b0881[_0xaf03('0xac')]){case _0xaf03('0xad'):this['handlePower'](_0x5b0881,0x1);break;case _0xaf03('0xae'):this[_0xaf03('0xaf')](_0x5b0881,_0x5b0881[_0xaf03('0xb0')]);break;case _0xaf03('0x9'):this[_0xaf03('0x9')](_0x5b0881);break;case _0xaf03('0x8'):this[_0xaf03('0xaf')](_0x5b0881,0x1);break;default:logger[_0xaf03('0x5f')](_0xaf03('0xb1'),_0x5b0881[_0xaf03('0x42')],'method\x20not\x20recognized');}};Dialer[_0xaf03('0x18')][_0xaf03('0x8b')]=function(_0x34096f,_0x5418ad){var _0x2486c7=_0x34096f[_0xaf03('0xb2')];var _0x390446=_0x5418ad?_0x34096f['dialGlobalInterval']:_0x34096f[_0xaf03('0x71')][_0xaf03('0x72')];logger[_0xaf03('0xb3')]('Dialer::ifTime()',_0x390446,_0x2486c7,_0x34096f[_0xaf03('0x42')],util['format'](_0xaf03('0xb4'),_0x34096f[_0xaf03('0x42')],_0x34096f['id']));var _0x4d5f60=null;return Interval[_0xaf03('0xb5')](_0x390446,_0x2486c7)['then'](function(_0x1a5c7c){if(_0x1a5c7c===!![]){return _0x1a5c7c;}else{_0x34096f[_0xaf03('0x63')]=_0x5418ad?utils[_0xaf03('0x64')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xaf03('0x64')]['OVERTIME_INTERVAL'];_0x4d5f60=msgResponse(_0xaf03('0x9f'),_0xaf03('0x8c'),'Global:\x20'+_0x5418ad+'\x20'+_0x34096f[_0xaf03('0x42')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x390446,{'showHidden':![],'depth':null})+_0xaf03('0xa1')+_0x2486c7);}if(_0x4d5f60!==null){logger[_0xaf03('0xb3')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4d5f60);_0x4d5f60[_0xaf03('0xb6')]=_0x5418ad;throw _0x4d5f60;}})[_0xaf03('0x9b')](function(_0x49f4fe){logger[_0xaf03('0x5f')](_0xaf03('0xb7'),_0x49f4fe);throw msgResponse(_0xaf03('0x7e'),_0xaf03('0x7f'),util[_0xaf03('0x40')](_0x49f4fe,{'showHidden':![],'depth':null}));});};Dialer[_0xaf03('0x18')]['syncAgentConnect']=function(_0x29e17b){if(this[_0xaf03('0x1c')][_0x29e17b[_0xaf03('0xb8')]]){if(this[_0xaf03('0x23')][_0x29e17b[_0xaf03('0xb9')]]&&this[_0xaf03('0x23')][_0x29e17b[_0xaf03('0xb9')]][_0xaf03('0x3d')]!==_0xaf03('0xba')){this[_0xaf03('0xbb')](this['voiceQueues'][_0x29e17b[_0xaf03('0xb8')]]);this[_0xaf03('0x23')][_0x29e17b['uniqueid']][_0xaf03('0xbc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xaf03('0x18')][_0xaf03('0xbd')]=function(_0x4a0bbd){var _0x1b74eb=this[_0xaf03('0x23')][_0x4a0bbd[_0xaf03('0xb9')]];if(this[_0xaf03('0x1c')][_0x4a0bbd['queue']]){if(_0x1b74eb&&_0x1b74eb[_0xaf03('0x3d')]!=='ivr'){delete this[_0xaf03('0x23')][_0x4a0bbd[_0xaf03('0xb9')]];this['voiceQueues'][_0x4a0bbd['queue']][_0xaf03('0xbe')]+=0x1;var _0x543e5b=new AgentComplete(_0x1b74eb,_0x4a0bbd);if(_0x4a0bbd[_0xaf03('0xbf')]===_0xaf03('0xc0')){_0x543e5b['agiafterat']=this[_0xaf03('0x1c')][_0x4a0bbd['queue']]['dialQueueProject2']&&this[_0xaf03('0x1c')][_0x4a0bbd[_0xaf03('0xb8')]][_0xaf03('0xc1')]?moment()[_0xaf03('0x77')](_0xaf03('0xc2')):undefined;}hopperUtils['createHistory'](_0x543e5b)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc3')));hopperUtils['moveContactManagedDialer'](_0x543e5b)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc4')));}}};Dialer[_0xaf03('0x18')][_0xaf03('0x2d')]=function(_0x51bcc2){var _0x14ffa5=this['uniqueId'][_0x51bcc2[_0xaf03('0xb9')]];var _0x33c252=this;var _0xc65fe6=![];var _0x5b314e;var _0xacb8e9;if(this[_0xaf03('0x1c')][_0x51bcc2['queue']]){if(_0x14ffa5&&_0x14ffa5['type']!==_0xaf03('0xba')){delete this[_0xaf03('0x23')][_0x51bcc2[_0xaf03('0xb9')]];this['updateOriginated'](this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]);_0x14ffa5[_0xaf03('0xc5')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5774dd=new QueueCallerAbandon(_0x14ffa5,_0x51bcc2);if(utils[_0xaf03('0xc6')](_0x14ffa5['droptime'],_0x14ffa5[_0xaf03('0xc7')])>=_0x14ffa5['dialQueueTimeout']){this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xaf03('0x1c')][_0x51bcc2['queue']][_0xaf03('0xc8')]+=0x1;this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xc9')]+=0x1;_0x5774dd[_0xaf03('0x6a')]=0xa;_0x5774dd[_0xaf03('0x6b')]=_0xaf03('0xca');_0x5774dd['dropreason']=_0xaf03('0xcb');_0x5774dd['agiafterat']=this['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xcc')]?moment()[_0xaf03('0x77')](_0xaf03('0xc2')):undefined;_0x5774dd['countdropretry']+=0x1;_0x5774dd['countglobal']+=0x1;_0x5b314e=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xcd')];_0xacb8e9=this[_0xaf03('0x1c')][_0x51bcc2['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0xaf03('0xce')](_0x5774dd,_0x5774dd[_0xaf03('0x6a')],_0x14ffa5[_0xaf03('0xcf')])[_0xaf03('0x3b')](function(_0x5d5323){_0xc65fe6=_0x5d5323[_0xaf03('0xd0')]==0x1;if(_0x5774dd[_0xaf03('0xd1')]>=_0x33c252['voiceQueues'][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xd2')]){_0x33c252[_0xaf03('0xd3')](_0x5774dd,_0x5d5323[_0xaf03('0xd0')]);}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countdropretry':_0x5774dd[_0xaf03('0xd1')],'scheduledat':moment()[_0xaf03('0xd5')](_0x33c252[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xcd')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14ffa5[_0xaf03('0xd7')],'ListId':_0x14ffa5[_0xaf03('0xd8')],'VoiceQueueId':_0x14ffa5[_0xaf03('0xd9')]||undefined,'CampaignId':_0x14ffa5[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact][Drop]'));var _0x44d3a1=new History(_0x5774dd);_0x44d3a1['state']=0xa;_0x44d3a1['statedesc']='Drop';_0x44d3a1[_0xaf03('0xdb')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d3a1['endtime']=_0x44d3a1[_0xaf03('0xdb')];_0x44d3a1[_0xaf03('0xdc')]=_0x5774dd[_0xaf03('0xdc')];_0x44d3a1[_0xaf03('0xdd')]=_0x5774dd[_0xaf03('0xdd')];hopperUtils[_0xaf03('0xde')](_0x44d3a1)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xdf')));}})[_0xaf03('0x3b')](function(){if(_0xc65fe6)hopperUtils[_0xaf03('0xe0')](_0x5774dd,_0x5b314e,_0xacb8e9)[_0xaf03('0x3b')](function(){return 0x1;});});}else{this['voiceQueues'][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0x4b')]+=0x1;this['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xe1')]+=0x1;_0x5774dd[_0xaf03('0x6a')]=0xb;_0x5774dd[_0xaf03('0x6b')]=_0xaf03('0xe2');_0x5774dd['dropreason']=_0xaf03('0xe3');_0x5774dd[_0xaf03('0xe4')]+=0x1;_0x5774dd['countglobal']+=0x1;_0x5b314e=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]]['dialAbandonedRetryFrequency'];_0xacb8e9=this[_0xaf03('0x1c')][_0x51bcc2[_0xaf03('0xb8')]][_0xaf03('0xe5')];hopperUtils[_0xaf03('0xce')](_0x5774dd,_0x5774dd[_0xaf03('0x6a')],_0x14ffa5[_0xaf03('0xcf')])['then'](function(_0x53563d){if(_0x5774dd['countabandonedretry']>=_0x33c252[_0xaf03('0x1c')][_0x51bcc2['queue']][_0xaf03('0xe6')]){_0x33c252['queueCallerAbandonCreateState'](_0x5774dd,_0x53563d['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5774dd['countabandonedretry'],'scheduledat':moment()['add'](_0x33c252['voiceQueues'][_0x51bcc2['queue']][_0xaf03('0xe7')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x14ffa5[_0xaf03('0xd7')],'ListId':_0x14ffa5[_0xaf03('0xd8')],'VoiceQueueId':_0x14ffa5[_0xaf03('0xd9')]||undefined,'CampaignId':_0x14ffa5[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0xe8')));var _0x3c6d97=new History(_0x5774dd);_0x3c6d97[_0xaf03('0x6a')]=0xb;_0x3c6d97[_0xaf03('0x6b')]='Abandoned';_0x3c6d97[_0xaf03('0xdb')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c6d97[_0xaf03('0x6c')]=_0x3c6d97[_0xaf03('0xdb')];_0x3c6d97[_0xaf03('0xdc')]=_0x5774dd[_0xaf03('0xdc')];_0x3c6d97[_0xaf03('0xdd')]=_0x5774dd['calleridnum'];hopperUtils[_0xaf03('0xde')](_0x3c6d97)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xe9')));}})[_0xaf03('0x3b')](function(){if(_0xc65fe6)hopperUtils[_0xaf03('0xe0')](_0x5774dd,_0x5b314e,_0xacb8e9)['then'](function(){return 0x1;});});}}}};Dialer[_0xaf03('0x18')]['syncNewExten']=function(_0x2852d8){if(this[_0xaf03('0x21')][_0x2852d8[_0xaf03('0xb9')]]){this[_0xaf03('0x21')][_0x2852d8['uniqueid']][_0xaf03('0xea')]=_0x2852d8[_0xaf03('0xea')];}if(this['uniqueId'][_0x2852d8[_0xaf03('0xb9')]]){this[_0xaf03('0x23')][_0x2852d8[_0xaf03('0xb9')]][_0xaf03('0xea')]=_0x2852d8[_0xaf03('0xea')];}};Dialer['prototype'][_0xaf03('0xeb')]=function(_0x389eb0){if(!this['actions'][_0x389eb0['actionid']]){return;}var _0x56faeb=this[_0xaf03('0x1c')][this[_0xaf03('0x21')][_0x389eb0['actionid']][_0xaf03('0xb8')]]['strategy']||_0xaf03('0xec');if(_0x56faeb==='roundrobin'){if(this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]]&&_[_0xaf03('0xee')](this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xef')])&&_0x389eb0['status']==='1'&&_0x389eb0[_0xaf03('0xf0')]==='0'){if(this[_0xaf03('0x1e')][_0x389eb0[_0xaf03('0xf1')]]){if(!this[_0xaf03('0x1e')][_0x389eb0[_0xaf03('0xf1')]][_0xaf03('0xef')]){this[_0xaf03('0x1e')][_0x389eb0['stateinterface']][_0xaf03('0xef')]=!![];this[_0xaf03('0x21')][_0x389eb0['actionid']]['locked']=!![];this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xf1')]=_0x389eb0[_0xaf03('0xf1')];}}}}else if(_0x56faeb===_0xaf03('0xec')){if(this[_0xaf03('0x21')][_0x389eb0['actionid']]){if(this['agents'][_0x389eb0[_0xaf03('0xf1')]]){this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xf1')]=_0x389eb0[_0xaf03('0xf1')];if(_[_0xaf03('0xee')](this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0['actionid']]['queue']])){this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xb8')]]=[];}this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x389eb0[_0xaf03('0xed')]][_0xaf03('0xb8')]]['push'](_[_0xaf03('0x5a')](_[_0xaf03('0xf2')](this['actions'][_0x389eb0[_0xaf03('0xed')]],[_0xaf03('0xf3'),_0xaf03('0xf1')]),{'status':_0x389eb0[_0xaf03('0x83')],'paused':_0x389eb0[_0xaf03('0xf0')]}));}}}};Dialer[_0xaf03('0x18')][_0xaf03('0xf4')]=function(_0x1b12d7){if(!this[_0xaf03('0x21')][_0x1b12d7['actionid']]){return;}var _0x14b871=this;var _0x423889=this[_0xaf03('0x1c')][this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]];var _0x483770=_0x423889[_0xaf03('0xf5')]||_0xaf03('0xec');if(_0x483770===_0xaf03('0xf6')){if(this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]&&this['actions'][_0x1b12d7['actionid']]['stateinterface']){this[_0xaf03('0xf7')][_0xaf03('0xf8')](this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xf3')],this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xf1')])[_0xaf03('0x9b')](function(_0x39ea65){logger[_0xaf03('0x5f')](_0xaf03('0xf9'),util[_0xaf03('0x40')](_0x39ea65,{'showHidden':![],'depth':null}));})[_0xaf03('0x1a')](function(){_0x14b871['updateOriginated'](_0x14b871[_0xaf03('0x1c')][_0x14b871[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']]);_0x14b871[_0xaf03('0x1e')][_0x14b871['actions'][_0x1b12d7['actionid']][_0xaf03('0xf1')]][_0xaf03('0xef')]=![];delete _0x14b871[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]];unlockQueueStatus(_0x423889);});}else{this[_0xaf03('0xbb')](this[_0xaf03('0x1c')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xd7')],'ListId':this[_0xaf03('0x21')][_0x1b12d7['actionid']][_0xaf03('0xd8')],'VoiceQueueId':this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xd9')]||undefined,'CampaignId':this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xfa')));delete this[_0xaf03('0x21')][_0x1b12d7['actionid']];unlockQueueStatus(_0x423889);}}else if(_0x483770===_0xaf03('0xec')){var _0xdeb142;if(this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]&&!_[_0xaf03('0x73')](this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']])){if(this[_0xaf03('0x28')][_0x14b871['actions'][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]){this['queueBookedRR'][_0x14b871[_0xaf03('0x21')][_0x1b12d7['actionid']][_0xaf03('0xb8')]]=this[_0xaf03('0x28')][this['actions'][_0x1b12d7['actionid']]['queue']]?this[_0xaf03('0x28')][this['actions'][_0x1b12d7[_0xaf03('0xed')]]['queue']]:this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]]['queue']]?this[_0xaf03('0x27')][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]][_0xaf03('0xfb')]||0x0:0x0;}this['queueBooked'][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]]['_rr']=this['queueBookedRR'][this[_0xaf03('0x21')][_0x1b12d7[_0xaf03('0xed')]][_0xaf03('0xb8')]];for(var _0x138c4d=0x0;_0x138c4d=_0xe2a78d[_0xaf03('0x11e')]){_0x244dae[_0xaf03('0x11f')](_0x1c04e4,_0x4bade6,_0x147212,'reason19\x20machine....');}else{if(_0x1c04e4[_0xaf03('0x116')]>=_0xe2a78d[_0xaf03('0x120')]){_0x244dae[_0xaf03('0x121')](_0x1c04e4,_0x4bade6,_0x147212,_0xaf03('0x122'));}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0x1c04e4[_0xaf03('0x116')],'scheduledat':moment()['add'](_0xe2a78d[_0xaf03('0x123')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x1c04e4['ContactId'],'ListId':_0x1c04e4['ListId'],'VoiceQueueId':_0x1c04e4[_0xaf03('0xd9')]||undefined,'CampaignId':_0x1c04e4[_0xaf03('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x4bade6({'reschedule':0x1});}}});}if(_0x57eb20['type']===_0xaf03('0xba')&&this[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0x112')]&&_0x1800c1[_0xaf03('0x10c')]===_0xaf03('0x124')){delete this[_0xaf03('0x23')][_0x1800c1[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this[_0xaf03('0x1d')][_0x57eb20['queue']]);_0x375292=new Hangup(_0x57eb20,_0x1800c1);_0x375292[_0xaf03('0x6a')]=0x12;_0x375292[_0xaf03('0x6b')]=_0xaf03('0x10d');_0x375292[_0xaf03('0x10e')]=_0xaf03('0x10f');ami[_0xaf03('0x119')](_0xaf03('0x125'),ut[_0xaf03('0x110')](_0x375292,_0xaf03('0x118')));this[_0xaf03('0x126')](_0x375292,_0xaf03('0x127'),'[syncHangupInAMDIvr]');}if(_0x57eb20[_0xaf03('0x3d')]===_0xaf03('0xba')&&this[_0xaf03('0x1d')][_0x57eb20['queue']]['dialAMDActive']&&_0x1800c1['value']==='MACHINE'){return new Promise(function(_0x13aa52,_0x499ee7){delete _0x244dae['uniqueId'][_0x1800c1['uniqueid']];_0x244dae['updateOriginated'](_0x244dae['campaigns'][_0x57eb20[_0xaf03('0xb8')]]);_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0xbe')]+=0x1;_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]][_0xaf03('0x114')]+=0x1;var _0x173a24=_0x244dae[_0xaf03('0x1d')][_0x57eb20[_0xaf03('0xb8')]];var _0xb32e9e=new Hangup(_0x57eb20,_0x1800c1);_0xb32e9e[_0xaf03('0x6a')]=0x13;_0xb32e9e[_0xaf03('0x6b')]=_0xaf03('0x115');_0xb32e9e[_0xaf03('0x10e')]=_0xaf03('0x10f');_0xb32e9e[_0xaf03('0x116')]+=0x1;_0xb32e9e[_0xaf03('0x117')]+=0x1;_0xb32e9e[_0xaf03('0x118')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0xb32e9e,'amd'));hopperUtils[_0xaf03('0xde')](_0xb32e9e)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x128')));if(_0xb32e9e['countbusyretry']+_0xb32e9e[_0xaf03('0x11b')]+_0xb32e9e[_0xaf03('0x129')]+_0xb32e9e['countnosuchnumberretry']+_0xb32e9e[_0xaf03('0xd1')]+_0xb32e9e[_0xaf03('0xe4')]+_0xb32e9e[_0xaf03('0x116')]+_0xb32e9e[_0xaf03('0x11d')]>=_0x173a24[_0xaf03('0x11e')]){_0x244dae[_0xaf03('0x11f')](_0xb32e9e,_0x13aa52,_0x499ee7,_0xaf03('0x12a'));}else{if(_0xb32e9e[_0xaf03('0x116')]>=_0x173a24[_0xaf03('0x120')]){_0x244dae[_0xaf03('0x121')](_0xb32e9e,_0x13aa52,_0x499ee7,'reason\x2019\x20machine....');}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0xb32e9e[_0xaf03('0x116')],'scheduledat':moment()[_0xaf03('0xd5')](_0x173a24[_0xaf03('0x123')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb32e9e[_0xaf03('0xd7')],'ListId':_0xb32e9e[_0xaf03('0xd8')],'VoiceQueueId':_0xb32e9e[_0xaf03('0xd9')]||undefined,'CampaignId':_0xb32e9e[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x12b')));_0x13aa52({'reschedule':0x1});}}});}}};Dialer[_0xaf03('0x18')][_0xaf03('0x34')]=function(_0x97f0b){var _0x3b0145=this['uniqueId'][_0x97f0b['uniqueid']];var _0x3c80b4;if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]===_0xaf03('0xba')){delete this[_0xaf03('0x23')][_0x97f0b[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this[_0xaf03('0x1d')][_0x3b0145[_0xaf03('0xb8')]]);this[_0xaf03('0x1d')][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0x12c')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)['catch'](loggerCatch(_0xaf03('0x12e')));}if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]!==_0xaf03('0xba')&&isNotNull(this[_0xaf03('0x1c')][_0x3b0145['queue']][_0xaf03('0x12f')])){delete this[_0xaf03('0x23')][_0x97f0b[_0xaf03('0xb9')]];this['updateOriginated'](this[_0xaf03('0x1c')][_0x3b0145['queue']]);this[_0xaf03('0x1c')][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0xbe')]+=0x1;this['voiceQueues'][_0x3b0145[_0xaf03('0xb8')]][_0xaf03('0x114')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);_0x3c80b4[_0xaf03('0x6a')]=0x10;_0x3c80b4['statedesc']=_0xaf03('0x130');_0x3c80b4['membername']='AGI';hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x131')));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x3b0145&&_0x3b0145[_0xaf03('0x3d')]!==_0xaf03('0xba')&&!isNotNull(this[_0xaf03('0x1c')][_0x3b0145['queue']][_0xaf03('0x12f')])){delete this['uniqueId'][_0x97f0b[_0xaf03('0xb9')]];this[_0xaf03('0xbb')](this['voiceQueues'][_0x3b0145[_0xaf03('0xb8')]]);this['voiceQueues'][_0x3b0145['queue']][_0xaf03('0x132')]+=0x1;_0x3c80b4=new Hangup(_0x3b0145,_0x97f0b);_0x3c80b4[_0xaf03('0x6a')]=0xc;_0x3c80b4['statedesc']=_0x97f0b[_0xaf03('0x133')];_0x3c80b4[_0xaf03('0x10e')]=_0xaf03('0x134');hopperUtils[_0xaf03('0xde')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xaf03('0x12d')](_0x3c80b4)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x12e')));}};Dialer[_0xaf03('0x18')][_0xaf03('0xb')]=function(_0x1344e6){var _0x2a1aac=this;if(!_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]]){_0x2a1aac[_0xaf03('0x29')][_0x1344e6['name']]={'running':![]};}else if(_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]][_0xaf03('0x135')]===!![]){return;}else if(_0x2a1aac[_0xaf03('0x29')][_0x1344e6['name']]['running']===![]){_0x2a1aac[_0xaf03('0x29')][_0x1344e6[_0xaf03('0x42')]][_0xaf03('0x135')]=!![];}var _0x775de=_0x2a1aac[_0xaf03('0x1c')][_0x1344e6[_0xaf03('0x42')]];var _0x370ea5=_0x775de[_0xaf03('0x63')]!==utils[_0xaf03('0x64')]['INACTIVE'];var _0x374632=utils[_0xaf03('0x136')](_0x775de);_0x775de[_0xaf03('0x137')]=utils['getQueueCampaignStatusMessage'](_0x775de,_0x2a1aac[_0xaf03('0x1f')]);Promise[_0xaf03('0xa6')]()['then'](function(){if(_0x775de[_0xaf03('0x137')]===utils['CAMPAIGN_STATUS'][_0xaf03('0x76')]){if(_0x370ea5){clearPredictiveAttributes(_0x775de);_0x1344e6[_0xaf03('0x24')]=undefined;_0x1344e6[_0xaf03('0x25')]=undefined;}if(_0x775de[_0xaf03('0x137')]===utils[_0xaf03('0x64')][_0xaf03('0x76')]){_0x1344e6[_0xaf03('0x138')]=0x0;_0x1344e6[_0xaf03('0xf0')]=0x0;_0x1344e6[_0xaf03('0x139')]=0x0;_0x1344e6[_0xaf03('0x13a')]=0x0;_0x1344e6[_0xaf03('0x13b')]=0x0;}}else if(_0x775de['statusMessage']===utils[_0xaf03('0x64')][_0xaf03('0x13c')]&&!_0x374632){return _0x2a1aac[_0xaf03('0x8b')](_0x775de,!![])['then'](function(){return _0x2a1aac[_0xaf03('0x8b')](_0x775de,![]);})[_0xaf03('0x3b')](function(){return _0x2a1aac[_0xaf03('0xab')](_0x775de);})['catch'](function(_0x5346bf){loggerSyncQueueSummary[_0xaf03('0x3f')]('[syncQueueSummary]',util[_0xaf03('0x40')](_0x5346bf,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x775de);});}else{clearPredictiveAttributes(_0x775de);}})['then'](function(){var _0x5e8229=_0x1344e6[_0xaf03('0x13d')](_0x775de);if(_0x5e8229||_0x775de[_0xaf03('0x13e')]){_0x775de['queueSummaryCountersUpdated']=![];_0x1344e6[_0xaf03('0x13f')](_0x775de);Object[_0xaf03('0x140')](_0x775de,_0x1344e6);emitOutboundVoiceQueueSummary(_0x1344e6);}_0x2a1aac[_0xaf03('0x29')][_0x775de['name']]['running']=![];})[_0xaf03('0x9b')](function(_0x5858d2){logger[_0xaf03('0x5f')](_0xaf03('0x141'),util[_0xaf03('0x40')](_0x5858d2,{'showHidden':![],'depth':null}));_0x2a1aac['queuesSummary'][_0x775de['name']]['running']=![];});};Dialer['prototype'][_0xaf03('0x32')]=_[_0xaf03('0x142')](function(){var _0x508c71=_[_0xaf03('0x143')](this[_0xaf03('0x1c')],function(_0x30c129){return _0x30c129[_0xaf03('0x144')];});var _0x35b34f=_['filter'](this[_0xaf03('0x1e')],function(_0x5c7ed3){return _0x5c7ed3['online']&&_0x5c7ed3[_0xaf03('0x83')]===_0xaf03('0x84');});if(_0x508c71[_0xaf03('0x94')]>0x0&&_0x35b34f['length']>0x0){return Promise['resolve']()[_0xaf03('0x3b')](cmHopper['handlePreviewRecallNotifications'](_[_0xaf03('0x145')](_0x508c71,'id'),previewRecallmeReminderInterval,_['map'](_0x35b34f,'id')))[_0xaf03('0x3b')](function(_0x271520){for(var _0xda5cc6=0x0;_0xda5cc6<_0x271520[_0xaf03('0x94')];_0xda5cc6++){var _0x4cf05b=_0x271520[_0xda5cc6][_0xaf03('0x146')][_0xaf03('0x42')];if(_0x4cf05b)io['to'](util['format'](_0xaf03('0x147'),_0x4cf05b))['emit'](_0xaf03('0x148'),{'hopper':_0x271520[_0xda5cc6]});}})[_0xaf03('0x9b')](function(_0x4338f0){logger['error'](_0xaf03('0x149'),_0x4338f0);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x2d1bf0=this;setInterval(function(){_0x2d1bf0[_0xaf03('0x14a')](_0x2d1bf0[_0xaf03('0x23')],_0xaf03('0x14b'));_0x2d1bf0[_0xaf03('0x14a')](_0x2d1bf0[_0xaf03('0x21')],'[actions]');},0x32c8);};Dialer['prototype'][_0xaf03('0x14a')]=function(_0x5b5929,_0x2dad84){var _0x5779ee=this;for(var _0x2a9b59 in _0x5b5929){if(typeof _0x5b5929[_0x2a9b59]!=='undefined'){this['sequence'][_0xaf03('0x14c')](function(){if(!_['isNil'](_0x5b5929[_0x2a9b59])){return ami['Action']({'action':'status','channel':_0x5b5929[_0x2a9b59][_0xaf03('0xea')]})[_0xaf03('0x9b')](function(_0x4158ae){if(_0x4158ae[_0xaf03('0x63')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5b5929[_0x2a9b59]&&_0x5b5929[_0x2a9b59][_0xaf03('0x3d')]!==_0xaf03('0xba')){_0x5779ee[_0xaf03('0xbb')](_0x5779ee[_0xaf03('0x1c')][_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]]);logger['error']('[Dialer][checkChannel]',_0x2dad84,_0x2a9b59,_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]);delete _0x5b5929[_0x2a9b59];}if(_0x5b5929[_0x2a9b59]&&_0x5b5929[_0x2a9b59]['type']===_0xaf03('0xba')){_0x5779ee[_0xaf03('0xbb')](_0x5779ee[_0xaf03('0x1d')][_0x5b5929[_0x2a9b59][_0xaf03('0xb8')]]);logger[_0xaf03('0x5f')](_0xaf03('0x14d'),_0x2dad84,_0x2a9b59,_0x5b5929[_0x2a9b59]['queue']);delete _0x5b5929[_0x2a9b59];}},0x2328);}});}});}}};Dialer['prototype'][_0xaf03('0x14e')]=function(_0x56ba65){return Promise[_0xaf03('0xa6')]()[_0xaf03('0x3b')](voiceQueueRt[_0xaf03('0x14e')](_0x56ba65))['catch'](loggerCatch(_0xaf03('0x14f')));};Dialer[_0xaf03('0x18')]['updateOriginated']=function(_0x5cad1e){if(!_[_0xaf03('0x50')](_0x5cad1e)&&_0x5cad1e!==null){if(typeof _0x5cad1e[_0xaf03('0x7a')]!==_0xaf03('0xa5')){if(_0x5cad1e[_0xaf03('0x7a')]>0x0){_0x5cad1e[_0xaf03('0x7a')]-=0x1;}else{logger[_0xaf03('0x5f')](_0xaf03('0x150'));}}}else{logger['error'](_0xaf03('0x151'));}};Dialer[_0xaf03('0x18')]['loggerHandler']=function(_0x5bf75a,_0x19c51d){var _0x2b7a03=this;return function(_0x261475){_0x2b7a03[_0xaf03('0xbb')](_0x19c51d);logger['error'](_0x5bf75a,util[_0xaf03('0x40')](_0x261475,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xaf03('0x152')]=function(_0x5e95e5,_0x409255,_0x200432){var _0x28fd8e={'state':0x19,'statedesc':_0xaf03('0x153')};this[_0xaf03('0xbb')](_0x409255);this[_0xaf03('0x126')](_[_0xaf03('0x5a')](_0x28fd8e,_['pick'](_0x200432,[_0xaf03('0xd7'),_0xaf03('0xd8'),_0xaf03('0x154'),_0xaf03('0xd9'),_0xaf03('0xda')])),_0xaf03('0x155'),_0xaf03('0x156'));logger[_0xaf03('0x5f')](_0x5e95e5);};Dialer['prototype'][_0xaf03('0x126')]=function(_0x5a4460,_0xf197cb,_0x4d16a3){hopperUtils[_0xaf03('0xde')](_0x5a4460)[_0xaf03('0x9b')](loggerCatch(_0xf197cb));hopperUtils[_0xaf03('0x12d')](_0x5a4460)[_0xaf03('0x9b')](loggerCatch(_0x4d16a3));};Dialer['prototype'][_0xaf03('0xd3')]=function(_0x469c66,_0x1a250c){hopperUtils[_0xaf03('0xde')](_0x469c66)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xc3')));if(_0x1a250c==0x0){hopperUtils[_0xaf03('0x12d')](_0x469c66)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x157')));}};Dialer[_0xaf03('0x18')][_0xaf03('0x149')]=function(_0x3245e1){return Promise[_0xaf03('0xa6')]()[_0xaf03('0x3b')](cmHopper[_0xaf03('0x158')](_0x3245e1['id'],previewRecallmeReminderInterval))[_0xaf03('0x3b')](function(_0x475b0c){for(var _0x55ee71=0x0;_0x55ee71<_0x475b0c[_0xaf03('0x94')];_0x55ee71++){var _0x4ed780=_0x475b0c[_0x55ee71][_0xaf03('0x146')][_0xaf03('0x42')];if(_0x4ed780)io['to'](util[_0xaf03('0x77')](_0xaf03('0x147'),_0x4ed780))[_0xaf03('0x119')](_0xaf03('0x148'),{'hopper':_0x475b0c[_0x55ee71]});}})[_0xaf03('0x9b')](function(){});};Dialer[_0xaf03('0x18')][_0xaf03('0xa9')]=function(_0x3e586c){var _0x17a7cb=this;return function(){_0x17a7cb[_0xaf03('0x159')](_0x3e586c);};};Dialer[_0xaf03('0x18')][_0xaf03('0x15a')]=function(_0x20b2ba,_0x2f7624){var _0xceb9=this;var _0x1c7930=uuid['v4']();this[_0xaf03('0x21')][_0x1c7930]=new Action(_0x20b2ba,_0x2f7624,_0x1c7930);return new Promise(function(_0x39f441,_0x11598d){if(_[_0xaf03('0x50')](_0x20b2ba)&&typeof _0x20b2ba!==_0xaf03('0x15b')){return _0x11598d(msgResponse(_0xaf03('0x15c'),_0xaf03('0x8c'),'voiceQueue\x20is\x20undefine'));}if(_[_0xaf03('0x50')](_0x2f7624['phone'])||_0x2f7624['phone']===null){return _0x11598d(msgResponse(_0xaf03('0x15c'),'Failure',_0xaf03('0x15d')));}var _0x35158a={'XMD-CALLERID':_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x15e')](),'XMD-AGI':_0x20b2ba[_0xaf03('0x12f')]?util[_0xaf03('0x77')](_0xaf03('0x15f'),ipAgi,_0x20b2ba[_0xaf03('0x12f')]):_0xaf03('0x160'),'XMD-AGIAFTER':_0x20b2ba[_0xaf03('0xcc')]?util[_0xaf03('0x77')](_0xaf03('0x15f'),ipAgi,_0x20b2ba['dialQueueProject2']):_0xaf03('0x160'),'XMD-QUEUE':utils['isOutboundQueue'](_0x20b2ba)?util[_0xaf03('0x77')](_0xaf03('0x161'),_0x20b2ba['name'],_0x20b2ba[_0xaf03('0x162')]||'',_0x20b2ba[_0xaf03('0xc1')]?'c':'',_0x20b2ba[_0xaf03('0x163')]||0x3):_0xaf03('0x160'),'XMD-CONTACTID':_0x2f7624[_0xaf03('0xd7')],'XMD-CDRTYPE':_0xaf03('0x7'),'CALLERID(all)':_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x15e')](),'XMD-AMD':_0x20b2ba['dialAMDActive']?'ACTIVE':_0xaf03('0x160'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x20b2ba[_0xaf03('0x112')]){_0x35158a['XMD-AMDINITIALSILENCE']=_0x20b2ba[_0xaf03('0x164')]||0x9c4;_0x35158a[_0xaf03('0x165')]=_0x20b2ba[_0xaf03('0x166')]||0x5dc;_0x35158a[_0xaf03('0x167')]=_0x20b2ba[_0xaf03('0x168')]||0x320;_0x35158a['XMD-AMDTOTALANALYSISTIME']=_0x20b2ba['dialAMDTotalAnalysisTime']||0x1388;_0x35158a[_0xaf03('0x169')]=_0x20b2ba[_0xaf03('0x16a')]||0x64;_0x35158a[_0xaf03('0x16b')]=_0x20b2ba[_0xaf03('0x16c')]||0x32;_0x35158a[_0xaf03('0x16d')]=_0x20b2ba['dialAMDMaximumNumberOfWords']||0x3;_0x35158a[_0xaf03('0x16e')]=_0x20b2ba['dialAMDSilenceThreshold']||0x100;_0x35158a['XMD-AMDMAXIMUMWORDLENGTH']=_0x20b2ba[_0xaf03('0x16f')]||0x1388;}if(utils[_0xaf03('0x170')](_0x20b2ba)){_0x35158a[_0xaf03('0x171')]=_0x2f7624[_0xaf03('0xd9')];}else{_0x35158a[_0xaf03('0x172')]=_0x2f7624['CampaignId'];}for(var _0x2fc646 in _0x2f7624['Contact']){if(typeof _0x2f7624['Contact'][_0x2fc646]!=='undefined'){if(isNotNull(_0x2f7624[_0xaf03('0x173')][_0x2fc646])&&_0x2fc646!=='id'&&_0x2fc646!==_0xaf03('0x174')&&_0x2fc646!==_0xaf03('0x175')&&_0x2fc646!==_0xaf03('0x176')){_0x35158a[util[_0xaf03('0x77')](_0xaf03('0x177'),_0xaf03('0x178'),_[_0xaf03('0x179')](_0x2fc646))]=_0x2f7624[_0xaf03('0x173')][_0x2fc646];}}}var _0x47ef0f=_0xceb9[_0xaf03('0x80')](_0x20b2ba[_0xaf03('0x87')])?utils['getCallerId'](_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x17a')],_0x20b2ba['dialOriginateCallerIdName'],_0x20b2ba[_0xaf03('0x17b')]>0x0?utils[_0xaf03('0x17c')](_0x20b2ba[_0xaf03('0x17d')],_0x20b2ba[_0xaf03('0x17b')]):_0x20b2ba['dialOriginateCallerIdNumber']):utils[_0xaf03('0x17e')](_[_0xaf03('0xee')](_0x20b2ba[_0xaf03('0x17f')])?_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x17a')]:_0x20b2ba[_0xaf03('0x17f')][_0xaf03('0x17a')],_0x20b2ba[_0xaf03('0x180')],_0x20b2ba['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xaf03('0x17c')](_0x20b2ba[_0xaf03('0x17d')],_0x20b2ba['dialRandomLastDigitCallerIdNumber']):_0x20b2ba[_0xaf03('0x17d')]);if(_0x47ef0f){_0x35158a[_0xaf03('0x181')]=_0xceb9[_0xaf03('0x21')][_0x1c7930][_0xaf03('0x182')]=utils['extractCalleridName'](_0x47ef0f);_0x35158a[_0xaf03('0x183')]=_0x2f7624[_0xaf03('0x184')];}_0x20b2ba[_0xaf03('0x185')]=_0x35158a;return ami[_0xaf03('0x186')]({'actionid':_0x1c7930,'action':_0xaf03('0x15c'),'channel':_0xceb9[_0xaf03('0x80')](_0x20b2ba[_0xaf03('0x87')])?util[_0xaf03('0x77')](_0xaf03('0x187'),_0x20b2ba[_0xaf03('0x87')][_0xaf03('0x42')],isNotNull(_0x20b2ba[_0xaf03('0x188')])?_0x20b2ba[_0xaf03('0x188')][_0xaf03('0x189')]()||'':'',_0x20b2ba[_0xaf03('0x18a')]>0x0?_0x2f7624[_0xaf03('0x184')][_0xaf03('0x18b')](_0x20b2ba[_0xaf03('0x18a')]):_0x2f7624[_0xaf03('0x184')]):util[_0xaf03('0x77')](_0xaf03('0x187'),_[_0xaf03('0xee')](_0x20b2ba['TrunkBackup'])?_0x20b2ba[_0xaf03('0x87')]['name']:_0x20b2ba[_0xaf03('0x17f')][_0xaf03('0x42')],isNotNull(_0x20b2ba['dialPrefix'])?_0x20b2ba[_0xaf03('0x188')][_0xaf03('0x189')]()||'':'',_0x20b2ba[_0xaf03('0x18a')]>0x0?_0x2f7624[_0xaf03('0x184')][_0xaf03('0x18b')](_0x20b2ba[_0xaf03('0x18a')]):_0x2f7624[_0xaf03('0x184')]),'callerid':_0x47ef0f,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x35158a,'timeout':(_0x20b2ba[_0xaf03('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1c7930})[_0xaf03('0x3b')](function(_0x5a1277){return _0x39f441(_0x5a1277);})[_0xaf03('0x9b')](function(_0x3503a0){_0x20b2ba[_0xaf03('0x18d')]+=0x1;var _0x16d663=new History(_0xceb9[_0xaf03('0x21')][_0x1c7930]);logger[_0xaf03('0x5f')](util['format'](_0xaf03('0x18e'),JSON[_0xaf03('0x6e')](_0x3503a0)));_0x16d663['state']=0xe;_0x16d663[_0xaf03('0x6b')]=_0xaf03('0x18f');_0x16d663[_0xaf03('0xdb')]=moment()['format'](_0xaf03('0xc2'));_0x16d663['endtime']=_0x16d663[_0xaf03('0xdb')];hopperUtils[_0xaf03('0xde')](_0x16d663)['catch'](loggerCatch(_0xaf03('0x190')));_0xceb9[_0xaf03('0x12d')](_0x16d663)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x190')))[_0xaf03('0x1a')](function(){delete _0xceb9[_0xaf03('0x21')][_0x1c7930];return _0x11598d(msgResponse(_0xaf03('0x15c'),_0xaf03('0x7f'),_0xaf03('0x191')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x2de1cc,_0x10feb7,_0xd9e772){var _0x355c13=new History(_0x10feb7);if(_0x355c13['countbusyretry']+_0x355c13[_0xaf03('0x11b')]+_0x355c13[_0xaf03('0x129')]+_0x355c13[_0xaf03('0x11c')]+_0x355c13[_0xaf03('0xd1')]+_0x355c13[_0xaf03('0xe4')]+_0x355c13[_0xaf03('0x116')]+_0x355c13[_0xaf03('0x11d')]>=_0xd9e772[_0xaf03('0x11e')]-0x1){return!![];}switch(_0x2de1cc){case 0x3:if(_0x355c13[_0xaf03('0x129')]>=_0xd9e772[_0xaf03('0x192')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countnoanswerretry':_0x355c13[_0xaf03('0x129')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x193')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0x194')));break;case 0x5:if(_0x355c13[_0xaf03('0x11a')]>=_0xd9e772[_0xaf03('0x195')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countbusyretry':_0x355c13[_0xaf03('0x11a')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x196')],'minutes')[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x355c13['countcongestionretry']>=_0xd9e772[_0xaf03('0x197')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countcongestionretry':_0x355c13[_0xaf03('0x11b')]+=0x1,'scheduledat':moment()['add'](_0xd9e772[_0xaf03('0x198')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x199')));break;case 0x0:if(_0x355c13[_0xaf03('0x11c')]>=_0xd9e772['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0xaf03('0xd4')]({'active':![],'countnosuchnumberretry':_0x355c13[_0xaf03('0x11c')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0x19a')],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13['VoiceQueueId']||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x19b')));}break;case 0xa:if(_0x355c13[_0xaf03('0xd1')]>=_0xd9e772[_0xaf03('0xd2')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countdropretry':_0x355c13[_0xaf03('0xd1')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0xcd')],_0xaf03('0xd6'))[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x19c')));break;case 0xb:if(_0x355c13[_0xaf03('0xe4')]>=_0xd9e772[_0xaf03('0xe6')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countabandonedretry':_0x355c13['countabandonedretry']+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772[_0xaf03('0xe7')],'minutes')[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0xe8')));break;case 0x13:if(_0x355c13[_0xaf03('0x116')]>=_0xd9e772[_0xaf03('0x120')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countmachineretry':_0x355c13[_0xaf03('0x116')]+=0x1,'scheduledat':moment()['add'](_0xd9e772[_0xaf03('0x123')],_0xaf03('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x355c13[_0xaf03('0xd7')],'ListId':_0x355c13['ListId'],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x355c13[_0xaf03('0x11d')]>=_0xd9e772[_0xaf03('0x19d')]-0x1){return!![];}hopperUtils[_0xaf03('0xd4')]({'active':![],'countagentrejectretry':_0x355c13[_0xaf03('0x11d')]+=0x1,'scheduledat':moment()[_0xaf03('0xd5')](_0xd9e772['dialAgentRejectRetryFrequency'],_0xaf03('0xd6'))[_0xaf03('0x77')](_0xaf03('0xc2')),'ContactId':_0x355c13['ContactId'],'ListId':_0x355c13[_0xaf03('0xd8')],'VoiceQueueId':_0x355c13[_0xaf03('0xd9')]||undefined,'CampaignId':_0x355c13[_0xaf03('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xaf03('0x106')]=function(_0x4ad292,_0x42fb16,_0x1754a3){var _0x1e581b=this;var _0x577349=new History(_0x4ad292);var _0x24e124=![];var _0x30fb1b;var _0x523459;return new Promise(function(_0x419a93,_0x5a247d){if(_['isUndefined'](_0x42fb16)&&typeof _0x42fb16!==_0xaf03('0x15b')){return _0x5a247d(msgResponse(_0xaf03('0x19e'),_0xaf03('0x8c'),'entity\x20is\x20undefine'));}if(_[_0xaf03('0x50')](_0x1754a3)&&typeof _0x1754a3!==_0xaf03('0x15b')){return _0x5a247d(msgResponse(_0xaf03('0x19e'),'Failure',_0xaf03('0x19f')));}hopperUtils[_0xaf03('0xce')](_0x577349,_0x1754a3[_0xaf03('0xbf')],_0x42fb16)[_0xaf03('0x3b')](function(_0x82d73c){if(_0x82d73c[_0xaf03('0xd0')]==0x1)_0x24e124=!![];switch(_0x1754a3['reason']){case'0':_0x42fb16[_0xaf03('0x1a0')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x0;_0x577349[_0xaf03('0x6b')]='NoSuchNumber';_0x577349[_0xaf03('0x11c')]+=0x1;_0x577349['countglobal']+=0x1;ami[_0xaf03('0x119')](_0xaf03('0x1a1'),ut[_0xaf03('0x110')](_0x4ad292,'nosuchnumber'));_0x30fb1b=_0x42fb16[_0xaf03('0x19a')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1e581b[_0xaf03('0x1a2')](0x0,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11c')]>=_0x42fb16['dialNoSuchNumberMaxRetry']){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a3'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a3'));}}break;case'3':_0x42fb16[_0xaf03('0x1a4')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x3;_0x577349[_0xaf03('0x6b')]='NoAnswer';_0x577349[_0xaf03('0x129')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;var _0x560441=ut['buildNoAnswerEventPayload'](_0x4ad292,_0x42fb16);ami[_0xaf03('0x119')](_0xaf03('0x1a5'),_0x560441);_0x30fb1b=_0x42fb16[_0xaf03('0x193')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)['catch'](loggerCatch(_0xaf03('0x1a6')));if(_0x1e581b[_0xaf03('0x1a2')](0x3,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x129')]>=_0x42fb16[_0xaf03('0x192')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a7'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1a7'));}}break;case'5':_0x42fb16[_0xaf03('0x1a8')]+=0x1;_0x577349['state']=0x5;_0x577349['statedesc']=_0xaf03('0x1a9');_0x577349[_0xaf03('0x11a')]+=0x1;_0x577349['countglobal']+=0x1;ami['emit'](_0xaf03('0x1aa'),ut[_0xaf03('0x110')](_0x4ad292,_0xaf03('0x1ab')));_0x30fb1b=_0x42fb16['dialBusyRetryFrequency'];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1e581b[_0xaf03('0x1a2')](0x5,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349['countbusyretry']>=_0x42fb16[_0xaf03('0x195')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1ac'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1ac'));}}break;case'8':_0x42fb16[_0xaf03('0x1ad')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x8;_0x577349['statedesc']=_0xaf03('0x1ae');_0x577349['countcongestionretry']+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16['dialCongestionRetryFrequency'];_0x523459=_0x42fb16[_0xaf03('0xe5')];ami['emit'](_0xaf03('0x1af'),ut['buildObj'](_0x4ad292,_0xaf03('0x1b0')));hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1b1')));if(_0x1e581b['checkRetriveMax'](0x8,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11b')]>=_0x42fb16[_0xaf03('0x197')]){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b2'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b2'));}}break;case'11':_0x42fb16['outboundAbandonedCallsDay']+=0x1;_0x577349[_0xaf03('0x6a')]=0xb;_0x577349['statedesc']=_0xaf03('0xe2');_0x577349[_0xaf03('0xe4')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16[_0xaf03('0xe7')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils['createHistory'](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0xe9')));if(_0x1e581b[_0xaf03('0x1a2')](0xb,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349['countabandonedretry']>=_0x42fb16[_0xaf03('0xe6')]){_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,'reason\x2011\x20abandoned');}else{_0x1e581b['stateGlobal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b3'));}}break;case'20':_0x42fb16[_0xaf03('0x1b4')]+=0x1;_0x577349[_0xaf03('0x6a')]=0x14;_0x577349[_0xaf03('0x6b')]=_0xaf03('0x1b5');_0x577349[_0xaf03('0x11d')]+=0x1;_0x577349[_0xaf03('0x117')]+=0x1;_0x30fb1b=_0x42fb16[_0xaf03('0x1b6')];_0x523459=_0x42fb16[_0xaf03('0xe5')];ami[_0xaf03('0x119')](_0xaf03('0x1b7'),ut[_0xaf03('0x110')](_0x4ad292,'agentreject'));hopperUtils['createHistory'](_0x577349)[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1b8')));if(_0x1e581b['checkRetriveMax'](0x14,_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11d')]>=_0x42fb16[_0xaf03('0x19d')]){_0x1e581b['createStateFinal'](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b9'));}else{_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0xaf03('0x1b9'));}}break;default:_0x42fb16['outboundUnknownCallsDay']+=0x1;_0x577349[_0xaf03('0x6a')]=0xc;_0x577349['statedesc']=_0x1754a3['reason'];_0x30fb1b=_0x42fb16[_0xaf03('0x1b6')];_0x523459=_0x42fb16[_0xaf03('0xe5')];hopperUtils[_0xaf03('0xde')](_0x577349)[_0xaf03('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1e581b[_0xaf03('0x1a2')](_0x1754a3[_0xaf03('0xbf')],_0x4ad292,_0x42fb16)&&!_0x24e124){if(_0x577349[_0xaf03('0x11a')]+_0x577349[_0xaf03('0x11b')]+_0x577349[_0xaf03('0x129')]+_0x577349[_0xaf03('0x11c')]+_0x577349[_0xaf03('0xd1')]+_0x577349[_0xaf03('0xe4')]+_0x577349[_0xaf03('0x116')]+_0x577349[_0xaf03('0x11d')]>=_0x42fb16[_0xaf03('0x11e')]){_0x1e581b[_0xaf03('0x11f')](_0x577349,_0x419a93,_0x5a247d,_0x1754a3[_0xaf03('0xbf')]);}else{_0x1e581b[_0xaf03('0x121')](_0x577349,_0x419a93,_0x5a247d,_0x1754a3[_0xaf03('0xbf')]);}}}})[_0xaf03('0x3b')](function(){if(_0x24e124){hopperUtils[_0xaf03('0xe0')](_0x577349,_0x30fb1b,_0x523459)[_0xaf03('0x3b')](function(){return _0x419a93(0x1);});}});});};Dialer['prototype'][_0xaf03('0x11f')]=function(_0x9b8e20,_0x219b96,_0x39e1b2,_0x21cf9d){var _0x3c913f=new Final(_0x9b8e20);_0x3c913f[_0xaf03('0x6a')]=0xf;_0x3c913f[_0xaf03('0x6b')]=_0xaf03('0x1ba');this[_0xaf03('0x121')](_0x3c913f,_0x219b96,_0x39e1b2,_0x21cf9d);};Dialer[_0xaf03('0x18')][_0xaf03('0x121')]=function(_0x848f18,_0x670514,_0x8f612d,_0x3ba713){hopperUtils[_0xaf03('0x12d')](_0x848f18)[_0xaf03('0x3b')](function(){return _0x670514(msgResponse(_0xaf03('0x19e'),_0xaf03('0x1bb'),_0x3ba713));})[_0xaf03('0x9b')](function(){return _0x8f612d(msgResponse(_0xaf03('0x1bc'),'Failure',_0xaf03('0x1bd')));});};Dialer[_0xaf03('0x18')]['predictive']=function(_0x3e35e0){var _0x43994c=_0x3e35e0[_0xaf03('0x1be')]/0x64;var _0x31c04a=_0x3e35e0[_0xaf03('0xc8')]/(_0x3e35e0[_0xaf03('0xc8')]+_0x3e35e0[_0xaf03('0xbe')]);var _0x3bbc45=Math[_0xaf03('0x1bf')](_0x3e35e0[_0xaf03('0x1c0')]*(_0x3e35e0[_0xaf03('0x1c1')]/0x64));var _0x453443=Math['round'](_0x3e35e0[_0xaf03('0x1c0')]*(_0x3e35e0['predictiveIntervalMinThreshold']/0x64));var _0x137ece=_0x3e35e0[_0xaf03('0x138')]+_0x3e35e0[_0xaf03('0x13a')];var _0xc69add=Math[_0xaf03('0x1c2')](_0x3e35e0['erlangCalls']*_0x3e35e0[_0xaf03('0x57')]*_0x3e35e0['predictiveIntervalHitRate']*_0x3e35e0[_0xaf03('0x1c3')]);if(_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x25')])){if(!_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x24')])){_0x3e35e0[_0xaf03('0x24')]=undefined;loggerPredictive['error'](_0xaf03('0x1c4'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xaf03('0x50')](_0x3e35e0['handlePredictive'])){loggerPredictive[_0xaf03('0x5f')]('[startMethodPredictive][StartProgressive]',_0xaf03('0x1c5'));clearInterval(_0x3e35e0[_0xaf03('0x5d')]);_0x3e35e0[_0xaf03('0x5d')]=undefined;}_0x3e35e0[_0xaf03('0x25')]=moment()[_0xaf03('0x77')](_0xaf03('0xc2'));loggerPredictive[_0xaf03('0x45')](_0x3e35e0['name'],_0xaf03('0x1c6'),_0x3e35e0[_0xaf03('0x25')]);this[_0xaf03('0xaf')](_0x3e35e0,0x1);}else if(ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x25')])){this[_0xaf03('0xaf')](_0x3e35e0,0x1);loggerPredictiveCalls[_0xaf03('0x45')](_0xaf03('0x1c8'),_0x3e35e0['startProgressive'],_0x3e35e0['name']);_0x3e35e0['erlangCalls']=0x0;_0x3e35e0[_0xaf03('0xc9')]=0x0;}else if(_0x43994c<_0x31c04a&&_0x3e35e0[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xaf03('0x1cb'),_0x31c04a,_0xaf03('0x25'),_0x3e35e0[_0xaf03('0x42')]);}else if(_0xc69add<_0x3e35e0[_0xaf03('0xc9')]&&_0x3e35e0[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x1cc'),_0xaf03('0x1cd'),_0xc69add,_0xaf03('0x1ce'),_0x3e35e0[_0xaf03('0xc9')],_0xaf03('0x25'),_0x3e35e0[_0xaf03('0x42')]);}else if(!ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x25')])&&_[_0xaf03('0x50')](_0x3e35e0[_0xaf03('0x24')])&&!_['isUndefined'](_0x3e35e0[_0xaf03('0x25')])){_0x3e35e0[_0xaf03('0x24')]=moment()[_0xaf03('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1cf'),_0x3e35e0[_0xaf03('0x24')]);hopperUtils[_0xaf03('0x1d0')](_0x3e35e0['dialPredictiveInterval'])[_0xaf03('0x3b')](this['getDataPredictive'](_0x3e35e0))[_0xaf03('0x3b')](mergeDataErlangB(_0x3e35e0))['then'](this[_0xaf03('0x1d1')](_0x3e35e0))[_0xaf03('0x9b')](loggerCatchPredictive(_0xaf03('0x1d2'),_0x3e35e0));}else if(!ifInterval(_0x3e35e0[_0xaf03('0x1c7')],_0x3e35e0[_0xaf03('0x24')])){_0x3e35e0[_0xaf03('0xc9')]=0x0;_0x3e35e0[_0xaf03('0x24')]=moment()[_0xaf03('0x77')](_0xaf03('0xc2'));loggerPredictive[_0xaf03('0x45')](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d3'),_0x3e35e0[_0xaf03('0x24')]);clearInterval(_0x3e35e0['handlePredictive']);_0x3e35e0[_0xaf03('0x5d')]=undefined;hopperUtils[_0xaf03('0x1d0')](_0x3e35e0[_0xaf03('0x1c7')])['then'](this[_0xaf03('0x1d4')](_0x3e35e0))['then'](mergeDataErlangB(_0x3e35e0))[_0xaf03('0x3b')](this['startMethodPredictive'](_0x3e35e0))[_0xaf03('0x9b')](loggerCatchPredictive(_0xaf03('0x1d5'),_0x3e35e0));}else if(_0x3e35e0['predictiveIntervalAvailable']&&_0x137ece<_0x3e35e0[_0xaf03('0x1c0')]-_0x453443){clearPredictiveAttributes(_0x3e35e0);loggerPredictive[_0xaf03('0x45')](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d6'),_0x137ece,_0xaf03('0x1d7'),_0x3e35e0['predictiveIntervalAvailable'],'-',_0x453443,'=',_0x3e35e0[_0xaf03('0x1c0')]-_0x453443,')');}else if(_0x3e35e0[_0xaf03('0x1c0')]&&_0x137ece>_0x3e35e0[_0xaf03('0x1c0')]+_0x3bbc45){clearPredictiveAttributes(_0x3e35e0);loggerPredictive['info'](_0x3e35e0[_0xaf03('0x42')],_0xaf03('0x1d6'),_0x137ece,_0xaf03('0x1d8'),_0x3e35e0[_0xaf03('0x1c0')],'+',_0x3bbc45,'=',_0x3e35e0[_0xaf03('0x1c0')]+_0x3bbc45,')');}};Dialer['prototype'][_0xaf03('0x1d4')]=function(_0x5cfacb){var _0x5c9d4d=this;return function(_0x15d4fe){return new Promise(function(_0x43afab,_0x2bf291){_[_0xaf03('0x5a')](_0x5cfacb,_0x15d4fe[0x0]);if(checkGetDataPredictive(_0x15d4fe[0x0])){var _0x5591c5=_0x5cfacb['predictiveIntervalAvailable']=_0x5cfacb[_0xaf03('0x13a')]+_0x5cfacb[_0xaf03('0x138')];var _0x2375b=_0x5cfacb['dialPredictiveInterval']*0x3c;var _0x49cd80=_0x15d4fe[0x0][_0xaf03('0x4e')]+_0x15d4fe[0x0][_0xaf03('0x4d')];var _0x200853=(_0x15d4fe[0x0][_0xaf03('0x48')]+_0x15d4fe[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x15d4fe[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x15d4fe[0x0][_0xaf03('0x47')];_0x5cfacb['predictiveIntervalHitRate']=_0x200853>0x0?_0x200853:0x1;switch(_0x5cfacb[_0xaf03('0x1c9')]){case _0xaf03('0x1ca'):var _0x549b5d=_0x5cfacb[_0xaf03('0x1be')]/0x64;return _0x5c9d4d['abandonmentRate'](_0x5591c5,_0x2375b,_0x49cd80,_0x200853,_0x549b5d)[_0xaf03('0x3b')](function(_0x4e9c0c){return _0x43afab(_0x4e9c0c);});case _0xaf03('0x1d9'):var _0x555a08=_0x5cfacb[_0xaf03('0x1be')]/0x64;return _0x5c9d4d[_0xaf03('0x1da')](_0x5591c5,_0x2375b,_0x49cd80,_0x200853,_0x555a08)[_0xaf03('0x3b')](function(_0x4bd559){return _0x43afab(_0x4bd559);});default:return _0x2bf291(msgResponse(_0xaf03('0x1db'),'Failure','Unknown\x20Predictive'));}}else{return _0x2bf291(msgResponse('[getDataPredictive]',_0xaf03('0x8c'),'check\x20failure'));}});};};Dialer[_0xaf03('0x18')][_0xaf03('0x1dc')]=function(_0x3763b7){var _0x53fe81=this;return function(_0x31ba03){return new Promise(function(_0x586138,_0x5abb80){_[_0xaf03('0x5a')](_0x3763b7,_0x31ba03[0x0]);if(checkGetDataPredictive(_0x31ba03[0x0])){loggerPredictive[_0xaf03('0x45')](JSON[_0xaf03('0x6e')](_0x31ba03[0x0]));if(_0x3763b7[_0xaf03('0x1c9')]===_0xaf03('0x1ca')){return _0x53fe81[_0xaf03('0x14e')](_0x3763b7['id'])[_0xaf03('0x3b')](function(_0xfa6e98){var _0x1eaaed=_0x3763b7['loggedIn']-_0xfa6e98[0x0][_0xaf03('0x1dd')];var _0x582aaa=_0x3763b7[_0xaf03('0x1c7')]*0x3c;var _0x48b60a=_0x31ba03[0x0][_0xaf03('0x4e')]+_0x31ba03[0x0][_0xaf03('0x4d')];var _0x4ea745=(_0x31ba03[0x0][_0xaf03('0x48')]+_0x31ba03[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31ba03[0x0][_0xaf03('0x4b')])/_0x31ba03[0x0][_0xaf03('0x47')];var _0x486fdd=_0x3763b7[_0xaf03('0x1be')]/0x64;_0x3763b7[_0xaf03('0x1de')]=_0xfa6e98[0x0][_0xaf03('0x1dd')]||0x0;_0x3763b7[_0xaf03('0x1df')]=_0x4ea745>0x0?_0x4ea745:0x1;return _0x53fe81[_0xaf03('0x1e0')](_0x1eaaed,_0x582aaa,_0x48b60a,_0x4ea745,_0x486fdd);})[_0xaf03('0x3b')](function(_0x4188f9){return _0x586138(_0x4188f9);})[_0xaf03('0x9b')](function(_0x5843f7){return _0x5abb80(msgResponse('[CatchErlangB]','Failure',JSON[_0xaf03('0x6e')](_0x5843f7)));});}if(_0x3763b7[_0xaf03('0x1c9')]===_0xaf03('0x1d9')){return _0x53fe81[_0xaf03('0x14e')](_0x3763b7['id'])[_0xaf03('0x3b')](function(_0x17e927){var _0x48a7d4=_0x3763b7['loggedIn']-_0x17e927[0x0][_0xaf03('0x1dd')];var _0x4992de=_0x3763b7[_0xaf03('0x1c7')]*0x3c;var _0x37f5a3=_0x31ba03[0x0][_0xaf03('0x4e')]+_0x31ba03[0x0][_0xaf03('0x4d')];var _0x5195d6=(_0x31ba03[0x0][_0xaf03('0x48')]+_0x31ba03[0x0][_0xaf03('0x4a')]+_0x31ba03[0x0][_0xaf03('0x4b')])/_0x31ba03[0x0][_0xaf03('0x47')];var _0x27c859=_0x3763b7[_0xaf03('0x1be')]/0x64;_0x3763b7['predictiveIntervalPauses']=_0x17e927[0x0][_0xaf03('0x1dd')]||0x0;_0x3763b7[_0xaf03('0x1df')]=_0x5195d6>0x0?_0x5195d6:0x1;return _0x53fe81[_0xaf03('0x1da')](_0x48a7d4,_0x4992de,_0x37f5a3,_0x5195d6,_0x27c859);})[_0xaf03('0x3b')](function(_0x284257){return _0x586138(_0x284257);})[_0xaf03('0x9b')](function(_0xb34bfc){return _0x5abb80(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0xb34bfc)));});}}else{return _0x5abb80(msgResponse(_0xaf03('0x1db'),_0xaf03('0x8c'),_0xaf03('0x1e1')));}});};};Dialer[_0xaf03('0x18')][_0xaf03('0x1d1')]=function(_0x5a77b9){var _0x5b6d91=this;return function(){var _0xcfbdeb=0x0;var _0x2818d0=Math[_0xaf03('0x1c2')](_0x5a77b9['erlangCallToSecond']*0x3e8);if(_0x2818d0>0x0){_0x2818d0=_0x2818d0<0x64?0x64:_0x2818d0;loggerPredictive[_0xaf03('0x45')](_0x5a77b9['name'],_0xaf03('0x1e2'),_0x2818d0,_0xaf03('0x1e3'));_0x5a77b9['handlePredictive']=setInterval(function(){_0x5b6d91[_0xaf03('0x5d')](_0x5a77b9);loggerPredictiveCalls[_0xaf03('0x45')](_0xaf03('0x1e4'),_0xcfbdeb+=0x1);},_0x2818d0);}else{loggerPredictive[_0xaf03('0x45')](_0x5a77b9['name'],_0xaf03('0x1e5'));}};};Dialer['prototype'][_0xaf03('0x1e6')]=function(_0x2420f6,_0x28ff88){var _0xbbfad=this;return function(_0x5dea2d){if(_[_0xaf03('0x73')](_0x5dea2d)){if(_[_0xaf03('0xee')](_0x28ff88[_0xaf03('0x154')])||!_0x28ff88['recallme']){if(_0x2420f6[_0xaf03('0xac')]===_0xaf03('0x8')){_0x2420f6[_0xaf03('0x6f')]=_['isUndefined'](_0x2420f6[_0xaf03('0x6f')])?!![]:_0x2420f6[_0xaf03('0x6f')];var _0x221309=uuid['v4']();_0xbbfad[_0xaf03('0x21')][_0x221309]=new Action(_0x2420f6,_0x28ff88,_0x221309);loggerBooked[_0xaf03('0x45')](_0xaf03('0x1e7'),_0x221309,'queueStatusComplete:\x20',JSON[_0xaf03('0x6e')](_0x2420f6[_0xaf03('0x6f')]),_0xaf03('0x1e8'),_0x2420f6[_0xaf03('0x42')]);if(_0x2420f6[_0xaf03('0x6f')]){_0x2420f6[_0xaf03('0x6f')]=![];_0xbbfad['queueBooked'][_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xb8')]]=[];ami['Action']({'actionid':_0x221309,'action':_0xaf03('0x1e9'),'queue':_0x2420f6[_0xaf03('0x42')]})['catch'](function(){_0xbbfad[_0xaf03('0xbb')](_0x2420f6);hopperUtils[_0xaf03('0xd4')]({'active':![],'ContactId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd7')],'ListId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd8')],'VoiceQueueId':_0xbbfad['actions'][_0x221309][_0xaf03('0xd9')]||undefined,'CampaignId':_0xbbfad['actions'][_0x221309][_0xaf03('0xda')]||undefined})[_0xaf03('0x9b')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xbbfad[_0xaf03('0x21')][_0x221309];});}else{loggerBooked[_0xaf03('0x45')](_0xaf03('0x1ea'),JSON['stringify'](_0x2420f6[_0xaf03('0x6f')]),_0xaf03('0x1e8'),_0x2420f6[_0xaf03('0x42')]);_0xbbfad['updateOriginated'](_0x2420f6);hopperUtils[_0xaf03('0xd4')]({'active':![],'ContactId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd7')],'ListId':_0xbbfad[_0xaf03('0x21')][_0x221309]['ListId'],'VoiceQueueId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xd9')]||undefined,'CampaignId':_0xbbfad[_0xaf03('0x21')][_0x221309][_0xaf03('0xda')]||undefined})['catch'](loggerCatch(_0xaf03('0x1eb')));delete _0xbbfad[_0xaf03('0x21')][_0x221309];}}else{return _0xbbfad['actionOriginate'](_0x2420f6,_0x28ff88);}}else{if(utils['getSeconds'](undefined,_0x28ff88[_0xaf03('0x1ec')])<_0x2420f6[_0xaf03('0x1ed')]*0x3c){if(_0x28ff88[_0xaf03('0x146')]&&!_0x28ff88['Agent'][_0xaf03('0x1ee')]){_0xbbfad[_0xaf03('0xf7')][_0xaf03('0xf8')](_0x28ff88['id'])[_0xaf03('0x1a')](function(){_0xbbfad[_0xaf03('0xbb')](_0x2420f6);});}else{hopperUtils[_0xaf03('0x1ef')]({'active':![]},_0x28ff88['id'],0x1)[_0xaf03('0x1a')](function(){_0xbbfad['updateOriginated'](_0x2420f6);});}}else{_0x2420f6[_0xaf03('0x1f0')]+=0x1;_0xbbfad['updateOriginated'](_0x2420f6);if(_0x2420f6['dialRecallInQueue']){hopperUtils[_0xaf03('0xd4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28ff88['ContactId'],'ListId':_0x28ff88['ListId'],'VoiceQueueId':_0x28ff88[_0xaf03('0xd9')]||undefined,'CampaignId':_0x28ff88['CampaignId']||undefined})[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x1f1')));hopperUtils[_0xaf03('0xde')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f2')],0x17,'RecallInQueue'))[_0xaf03('0x9b')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xbbfad[_0xaf03('0x126')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f3')],0x16,'RecallFailedTimeout'),_0xaf03('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x2420f6[_0xaf03('0x1f5')]+=0x1;_0xbbfad[_0xaf03('0x126')](createObjHistory(_0x2420f6,_0x28ff88,utils[_0xaf03('0x64')][_0xaf03('0x1f6')],0xd,_0xaf03('0x1f7')),_0xaf03('0x1f8'),'[Originate][MoveBlacklist]');throw _0xaf03('0x1f9');}};};Dialer['prototype']['handleIvr']=function(_0x179e39){var _0x5bb534=this;var _0x165764=_0x179e39[_0xaf03('0x1fa')]-_0x179e39[_0xaf03('0x7a')]-_0x179e39[_0xaf03('0x1fb')];emitCampaignSummary(_0x179e39);if(_0x165764>0x0){if(_0x165764>this[_0xaf03('0x20')]){_0x165764=this['maxNumberOriginate'];}_0x179e39['temp']+=_0x165764;hopperUtils[_0xaf03('0x1fc')](_0x179e39['id'],_0x165764,_0x179e39['dialOrderByScheduledAt'],_0x179e39)[_0xaf03('0x3b')](function(_0x50df6c){_0x179e39['temp']-=_0x165764;_0x179e39['temp']=_0x179e39[_0xaf03('0x1fb')]>0x0?_0x179e39[_0xaf03('0x1fb')]:0x0;if(!utils['checkContactEmpty'](_0x50df6c)){_0x179e39['message']=utils['CAMPAIGN_STATUS'][_0xaf03('0x68')];logger[_0xaf03('0x45')]('[getContactCampaign2][Empty]'+_0x179e39['name']);}else{_0x179e39['originated']+=_0x50df6c[_0xaf03('0x94')];_0x179e39['message']=utils[_0xaf03('0x64')][_0xaf03('0x1fd')];for(var _0x4170e2=0x0;_0x4170e2<_0x50df6c[_0xaf03('0x94')];_0x4170e2+=0x1){_0x179e39['ivrTotalCallsDays']+=0x1;if(_[_0xaf03('0xee')](_0x50df6c[_0x4170e2])||_['isNil'](_0x50df6c[_0x4170e2]['Contact'])||_[_0xaf03('0xee')](_0x50df6c[_0x4170e2]['phone'])){_0x5bb534[_0xaf03('0x152')](_0xaf03('0x1fe'),_0x179e39,_0x50df6c[_0x4170e2]);}else{hopperUtils[_0xaf03('0x1ff')](_[_0xaf03('0xf2')](_0x50df6c[_0x4170e2],[_0xaf03('0xda'),_0xaf03('0x184')]))[_0xaf03('0x3b')](_0x5bb534[_0xaf03('0x1e6')](_0x179e39,_0x50df6c[_0x4170e2]))[_0xaf03('0x9b')](_0x5bb534['loggerHandler']('[actionOriginateIvr]\x20',_0x179e39));}}}})['catch'](loggerGetContactDialer(_0xaf03('0x200'),_0x179e39,_0x165764));}};Dialer[_0xaf03('0x18')][_0xaf03('0xaf')]=function(_0x1d0f2d,_0x28dc26){var _0x2d3fe5=this;var _0x4b983b=[];if(_0x28dc26<0x1||_0x1d0f2d[_0xaf03('0xac')]==='booked'){_0x28dc26=0x1;}var _0x2ba861=Math[_0xaf03('0x1c2')](_0x1d0f2d[_0xaf03('0x138')]*_0x28dc26)-_0x1d0f2d[_0xaf03('0x7a')]-_0x1d0f2d['temp'];if(_0x1d0f2d[_0xaf03('0x201')]>0x0){var _0x3630e2=_0x1d0f2d[_0xaf03('0x201')]-_0x1d0f2d[_0xaf03('0x7a')]-_0x1d0f2d[_0xaf03('0x13a')]-_0x1d0f2d['temp']-_0x1d0f2d[_0xaf03('0x13b')];if(_0x2ba861>_0x3630e2){_0x2ba861=_0x3630e2;}}if(_0x2ba861>0x0){if(_0x1d0f2d[_0xaf03('0xac')]===_0xaf03('0x8')){_0x2ba861=0x1;}if(_0x2ba861>this['maxNumberOriginate']){_0x2ba861=this[_0xaf03('0x20')];}_0x1d0f2d['temp']+=_0x2ba861;for(var _0x2a8d96 in this[_0xaf03('0x1e')]){if(typeof this['agents'][_0x2a8d96]!==_0xaf03('0xa5')){if(this[_0xaf03('0x1e')][_0x2a8d96]['state']===_0xaf03('0x202')&&this['agents'][_0x2a8d96][_0xaf03('0x83')]==='reachable'){_0x4b983b[_0xaf03('0x95')](this['agents'][_0x2a8d96]['id']);}}}hopperUtils[_0xaf03('0x203')](_0x1d0f2d,_0x4b983b,_0x2ba861)[_0xaf03('0x3b')](function(_0x22a40c){_0x1d0f2d[_0xaf03('0x1fb')]-=_0x2ba861;_0x1d0f2d[_0xaf03('0x1fb')]=_0x1d0f2d[_0xaf03('0x1fb')]>0x0?_0x1d0f2d['temp']:0x0;if(!utils[_0xaf03('0x204')](_0x22a40c)){hopperUtils[_0xaf03('0x205')](_0x1d0f2d)[_0xaf03('0x3b')](sendMessageReschedule(_0x1d0f2d))[_0xaf03('0x9b')](loggerCatch(_0xaf03('0x206')));}else{_0x1d0f2d[_0xaf03('0x7a')]+=_0x22a40c['length'];_0x1d0f2d[_0xaf03('0x63')]=_0x1d0f2d[_0xaf03('0xac')]===_0xaf03('0x8')?utils[_0xaf03('0x64')][_0xaf03('0x13c')]:utils['CAMPAIGN_STATUS'][_0xaf03('0x1fd')];for(var _0x6d120=0x0;_0x6d120<_0x22a40c['length'];_0x6d120+=0x1){if(_[_0xaf03('0xee')](_0x22a40c[_0x6d120])||_[_0xaf03('0xee')](_0x22a40c[_0x6d120][_0xaf03('0x173')])||_['isNil'](_0x22a40c[_0x6d120][_0xaf03('0x184')])){_0x2d3fe5[_0xaf03('0x152')](_0xaf03('0x1fe'),_0x1d0f2d,_0x22a40c[_0x6d120]);}else{hopperUtils[_0xaf03('0x207')](_[_0xaf03('0xf2')](_0x22a40c[_0x6d120],[_0xaf03('0xd9'),_0xaf03('0x184')]))['then'](_0x2d3fe5[_0xaf03('0x1e6')](_0x1d0f2d,_0x22a40c[_0x6d120]))[_0xaf03('0x9b')](_0x2d3fe5[_0xaf03('0x208')](_0xaf03('0x1fe'),_0x1d0f2d));}}}})['catch'](loggerGetContactDialer(_0xaf03('0x209'),_0x1d0f2d,_0x2ba861));}};Dialer[_0xaf03('0x18')][_0xaf03('0x5d')]=function(_0x185277){if(_0x185277['dialLimitQueue']>0x0){var _0x2c6db6=_0x185277[_0xaf03('0x201')]-_0x185277[_0xaf03('0x7a')]-_0x185277[_0xaf03('0x13a')];if(_0x2c6db6>0x0){this['tryOriginatePredictive'](_0x185277);}else{loggerPredictiveCalls[_0xaf03('0x45')]('[handlePredictive][limitChannel]');}}else{this[_0xaf03('0x20a')](_0x185277);}};Dialer[_0xaf03('0x18')]['tryOriginatePredictive']=function(_0xf245){var _0x36adbd=this;var _0x258c2a=[];_0xf245[_0xaf03('0x7a')]+=0x1;for(var _0x54cb03 in this[_0xaf03('0x1e')]){if(typeof this['agents'][_0x54cb03]!==_0xaf03('0xa5')){if(this[_0xaf03('0x1e')][_0x54cb03][_0xaf03('0x6a')]===_0xaf03('0x202')&&this[_0xaf03('0x1e')][_0x54cb03][_0xaf03('0x83')]===_0xaf03('0x84')){_0x258c2a['push'](this[_0xaf03('0x1e')][_0x54cb03]['id']);}}}return this[_0xaf03('0x203')](_0xf245['id'],_0x258c2a,0x1,_0xf245[_0xaf03('0x20b')],_0xf245)['then'](function(_0x5dbd7){if(!utils[_0xaf03('0x204')](_0x5dbd7)){utils[_0xaf03('0x61')](_0xf245,0x1,0x0);return hopperUtils[_0xaf03('0x205')](_0xf245)[_0xaf03('0x3b')](sendMessageReschedule(_0xf245))['catch'](loggerCatch(_0xaf03('0x206')));}else{_0xf245[_0xaf03('0x63')]=utils[_0xaf03('0x64')][_0xaf03('0x1fd')];if(_[_0xaf03('0xee')](_0x5dbd7[0x0])||_[_0xaf03('0xee')](_0x5dbd7[0x0][_0xaf03('0x173')])||_[_0xaf03('0xee')](_0x5dbd7[0x0]['phone'])){_0x36adbd['emptyContact'](_0xaf03('0x1fe'),_0xf245,_0x5dbd7[0x0]);}else{return hopperUtils[_0xaf03('0x207')](_[_0xaf03('0xf2')](_0x5dbd7[0x0],[_0xaf03('0xd9'),_0xaf03('0x184')]))[_0xaf03('0x3b')](_0x36adbd['checkContactBlack'](_0xf245,_0x5dbd7[0x0]))[_0xaf03('0x9b')](_0x36adbd[_0xaf03('0x208')](_0xaf03('0x20c'),_0xf245));}}})[_0xaf03('0x9b')](loggerGetContactDialer(_0xaf03('0x20d'),_0xf245,0x1));};Dialer['prototype'][_0xaf03('0x1e0')]=function(_0x35f47e,_0x5e7942,_0x240788,_0x3bb409,_0x583abd,_0x5c89be){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xaf03('0x45')]('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',_0x35f47e);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20e'),_0x5e7942);loggerPredictive[_0xaf03('0x45')]('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',_0x240788);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20f'),_0x3bb409);loggerPredictive[_0xaf03('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x583abd);loggerPredictive[_0xaf03('0x45')]('---------------------------');return new Promise(function(_0x528b33,_0x5b02a3){if(_0x35f47e<=0x0||isNaN(_0x35f47e)){return _0x5b02a3(msgResponse('[abandonmentRate]',_0xaf03('0x7f'),'m\x20=\x20'+_0x35f47e));}if(_0x240788<=0x0||isNaN(_0x240788)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),_0xaf03('0x211')+_0x240788));}if(_0x3bb409<=0x0||isNaN(_0x3bb409)){return _0x5b02a3(msgResponse('[abandonmentRate]',_0xaf03('0x7f'),'p\x20=\x20'+_0x3bb409));}if(_0x5e7942<=0x0||isNaN(_0x5e7942)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),_0xaf03('0x212')+_0x5e7942));}if(_0x583abd<=0x0||isNaN(_0x583abd)){return _0x5b02a3(msgResponse(_0xaf03('0x210'),_0xaf03('0x7f'),'Amax\x20=\x20'+_0x583abd));}_0x5c89be=_0x5c89be||0x0;var _0x2065de=0x1/_0x240788;var _0x323de1=0x0;var _0x754ea0=0x0;var _0x5aa2d3=0x0;var _0x363590=0x0;for(var _0x43f8d3=0x0;_0x5aa2d3<_0x583abd;_0x43f8d3+=0x1){_0x754ea0=_0x43f8d3/_0x5e7942;_0x323de1=(_0x3bb409*_0x754ea0+_0x5c89be)/_0x2065de;_0x5aa2d3=utils[_0xaf03('0x213')](_0x323de1,_0x35f47e);_0x363590=_0x323de1/_0x35f47e*(0x1-utils[_0xaf03('0x213')](_0x323de1,_0x35f47e));}return _0x528b33({'erlangCalls':_0x43f8d3,'erlangCallToSecond':_0x5e7942/_0x43f8d3,'erlangAbandonmentRate':_0x5aa2d3,'erlangBusyFactor':_0x363590});});};Dialer[_0xaf03('0x18')]['busyFactor']=function(_0xcc8c33,_0x36e8f0,_0xabda20,_0x4ddc00,_0x4bf6d2,_0x35c849){loggerPredictive[_0xaf03('0x45')](_0xaf03('0x214'));loggerPredictive[_0xaf03('0x45')](_0xaf03('0x215'),_0xcc8c33);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20e'),_0x36e8f0);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x216'),_0xabda20);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x20f'),_0x4ddc00);loggerPredictive[_0xaf03('0x45')](_0xaf03('0x217'),_0x4bf6d2);loggerPredictive['info'](_0xaf03('0x59'));return new Promise(function(_0x45ec93,_0xf8ae1f){if(_0xcc8c33<=0x0||isNaN(_0xcc8c33)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x219')+_0xcc8c33));}if(_0xabda20<=0x0||isNaN(_0xabda20)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),'Error',_0xaf03('0x211')+_0xabda20));}if(_0x4ddc00<=0x0||isNaN(_0x4ddc00)){return _0xf8ae1f(msgResponse('[busyFactor]','Error',_0xaf03('0x21a')+_0x4ddc00));}if(_0x36e8f0<=0x0||isNaN(_0x36e8f0)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x212')+_0x36e8f0));}if(_0x4bf6d2<=0x0||isNaN(_0x4bf6d2)){return _0xf8ae1f(msgResponse(_0xaf03('0x218'),_0xaf03('0x7f'),_0xaf03('0x21b')+_0x4bf6d2));}_0x35c849=_0x35c849||0x0;var _0x2af976=0x1/_0xabda20;var _0x3bd627=0x0;var _0xf806d7=0x0;var _0xef245a=0x0;var _0x223623=0x0;for(var _0x18ac2b=0x0;_0x223623<_0x4bf6d2;_0x18ac2b+=0x1){_0xf806d7=_0x18ac2b/_0x36e8f0;_0x3bd627=(_0x4ddc00*_0xf806d7+_0x35c849)/_0x2af976;_0xef245a=utils[_0xaf03('0x213')](_0x3bd627,_0xcc8c33);_0x223623=_0x3bd627/_0xcc8c33*(0x1-utils[_0xaf03('0x213')](_0x3bd627,_0xcc8c33));}return _0x45ec93({'erlangCalls':_0x18ac2b,'erlangCallToSecond':_0x36e8f0/_0x18ac2b,'erlangAbandonmentRate':_0xef245a,'erlangBusyFactor':_0x223623});});};module[_0xaf03('0x21c')]=Dialer; \ No newline at end of file +var _0x23e4=['unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','membername','emit','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countbusyretry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','reachable','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','[emptyContact]','handlePreviewRecallNotifications','launchHandleIvr','handleIvr','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-CAMPAIGNID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','Trunk','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason\x200\x20no\x20such\x20number....','stateGlobal','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalTotalCalls','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','milliseconds','[handlePredictive]','checkContactBlack','UserId','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','voicePause','unlockContact','outboundReCallsDay','RecallInQueue','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','syncVarSet','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','debug','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','inspect','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','message','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','status','SIP/%s','unmonitored','isTrunkReachable','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','timezones','content','indexOf','true','catch','then','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','predictive','handlePower','power','dialPowerLevel','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','isGlobal','AMI\x20IfTime','uniqueId','uniqueid','ivr','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','queue','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','updateOriginated','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','rescheduleContact','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedRetryFrequency','voiceQueue','[rescheduleContact][Abandoned]','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','strategy','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','isEmpty','_rr','length'];(function(_0x4642d0,_0x1d5b64){var _0x22197f=function(_0x5b68b9){while(--_0x5b68b9){_0x4642d0['push'](_0x4642d0['shift']());}};_0x22197f(++_0x1d5b64);}(_0x23e4,0x128));var _0x423e=function(_0x5e62fc,_0x477571){_0x5e62fc=_0x5e62fc-0x0;var _0x5cfd25=_0x23e4[_0x5e62fc];return _0x5cfd25;};'use strict';var util=require(_0x423e('0x0'));var _=require(_0x423e('0x1'));var uuid=require(_0x423e('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x423e('0x3'));var hopperUtils=require(_0x423e('0x4'));var ut=require(_0x423e('0x5'));var config=require(_0x423e('0x6'));var logger=require(_0x423e('0x7'))(_0x423e('0x8'));var loggerBooked=require('../../../config/logger')(_0x423e('0x9'));var loggerPredictive=require(_0x423e('0x7'))('predictive');var loggerPredictiveCalls=require(_0x423e('0x7'))(_0x423e('0xa'));var loggerSyncQueueSummary=require(_0x423e('0x7'))(_0x423e('0xb'));var ami=require(_0x423e('0xc'));config[_0x423e('0xd')]=_[_0x423e('0xe')](config[_0x423e('0xd')],{'host':_0x423e('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x423e('0xd')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x423e('0x10'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x423e('0x11'));var Action=require(_0x423e('0x12'));var History=require(_0x423e('0x13'));var Final=require(_0x423e('0x14'));var AgentComplete=require(_0x423e('0x15'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process['env'][_0x423e('0x16')]||_0x423e('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x423e('0x18')][_0x423e('0x19')]=function(_0x5b99e6){this[_0x423e('0x1a')]=this[_0x423e('0x1a')]?this[_0x423e('0x1a')]['finally'](_0x5b99e6):_0x5b99e6();};function Dialer(_0x618a91,_0x477b17){this[_0x423e('0x1b')]=new Sequence();this[_0x423e('0x1c')]=_0x477b17;this[_0x423e('0x1d')]=_0x618a91[_0x423e('0x1d')];this[_0x423e('0x1e')]=_0x618a91[_0x423e('0x1e')];this[_0x423e('0x1f')]=_0x618a91[_0x423e('0x1f')];this['trunks']=_0x618a91[_0x423e('0x20')];this[_0x423e('0x21')]=config[_0x423e('0x21')]||0x2;this[_0x423e('0x22')]={};this[_0x423e('0x23')]={};this[_0x423e('0x24')]={};this['uniqueId']={};this[_0x423e('0x25')]={};this[_0x423e('0x26')]={};this[_0x423e('0x27')]={};this[_0x423e('0x28')]={};this[_0x423e('0x29')]={};this[_0x423e('0x2a')]={};this[_0x423e('0x2b')]={};ami['on'](_0x423e('0x2c'),this[_0x423e('0x2d')][_0x423e('0x2e')](this));ami['on'](_0x423e('0x2f'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x423e('0x30'),this['syncOriginateResponse'][_0x423e('0x2e')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x423e('0x31'),this[_0x423e('0xb')]['bind'](this));ami['on'](_0x423e('0x32'),this[_0x423e('0x33')]['bind'](this));ami['on'](_0x423e('0x34'),this[_0x423e('0x35')][_0x423e('0x2e')](this));ami['on'](_0x423e('0x36'),this['syncNewExten'][_0x423e('0x2e')](this));ami['on'](_0x423e('0x37'),this[_0x423e('0x38')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0x423e('0x2e')](this));ami['on']('queuestatuscomplete',this[_0x423e('0x39')][_0x423e('0x2e')](this));this[_0x423e('0x3a')]();this[_0x423e('0x3b')]();RpcSetting[_0x423e('0x3c')]()['then'](function(_0x2b9b23){previewRecallmeReminderInterval=_0x2b9b23[_0x423e('0x3d')];});}function isNotNull(_0x44810d){return _0x44810d!==null&&!_[_0x423e('0x3e')](_0x44810d);}function msgResponse(_0x2f528a,_0x4a02ea,_0x5aff9a){return{'action':_0x2f528a,'response':_0x4a02ea,'message':_0x5aff9a,'stack':_0x5aff9a};}function emit(_0x2cd719,_0x26ea7d,_0x3b9f53){io['to'](_0x2cd719)['emit'](_0x26ea7d,_0x3b9f53);}function emitOutboundVoiceQueueSummary(_0x2cfa98){if(_0x2cfa98[_0x423e('0x3f')]==='outbound'){logger['debug'](_0x423e('0x40'),util['inspect'](_0x2cfa98,{'showHidden':![],'depth':null}));emit(util[_0x423e('0x41')](_0x423e('0x42'),_0x2cfa98[_0x423e('0x43')]),_0x423e('0x44'),_0x2cfa98);}}function checkGetDataPredictive(_0x72868d){if(isNotNull(_0x72868d)&&!_['isEmpty'](_0x72868d)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x423e('0x45')](_0x423e('0x46'),_0x72868d['predictiveIntervalTotalCalls']);loggerPredictive[_0x423e('0x45')](_0x423e('0x47'),_0x72868d['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x423e('0x45')](_0x423e('0x48'),_0x72868d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x423e('0x45')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x72868d[_0x423e('0x49')]);loggerPredictive[_0x423e('0x45')](_0x423e('0x4a'),_0x72868d[_0x423e('0x4b')]);loggerPredictive['info'](_0x423e('0x4c'),_0x72868d[_0x423e('0x4d')]);loggerPredictive['info'](_0x423e('0x4e'));if(_0x72868d['predictiveIntervalTotalCalls']>0x0){if(!_[_0x423e('0x3e')](_0x72868d[_0x423e('0x4d')])&&_0x72868d['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x423e('0x45')](_0x423e('0x4f'));if(!_[_0x423e('0x3e')](_0x72868d[_0x423e('0x4b')])&&_0x72868d[_0x423e('0x4b')]>0x0){return!![];}loggerPredictive['info'](_0x423e('0x50'));}else{loggerPredictive[_0x423e('0x45')](_0x423e('0x51'));}}else{loggerPredictive[_0x423e('0x45')](_0x423e('0x52'));}return![];}function mergeDataErlangB(_0x2beafc){return function(_0x4ba01b){loggerPredictive[_0x423e('0x45')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x423e('0x45')](_0x423e('0x53'),_0x4ba01b[_0x423e('0x54')]);loggerPredictive[_0x423e('0x45')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ba01b[_0x423e('0x55')]);loggerPredictive['info'](_0x423e('0x56'),_0x4ba01b[_0x423e('0x57')]);loggerPredictive[_0x423e('0x45')](_0x423e('0x58'),_0x4ba01b[_0x423e('0x59')]);loggerPredictive[_0x423e('0x45')](_0x423e('0x56'),_0x4ba01b[_0x423e('0x57')]);loggerPredictive[_0x423e('0x45')](_0x423e('0x4e'));_[_0x423e('0x5a')](_0x2beafc,_0x4ba01b);};}function ifInterval(_0x3ad874,_0x2c682b){if(_[_0x423e('0x3e')](_0x2c682b)){return![];}return utils['getSeconds'](undefined,_0x2c682b)<_0x3ad874*0x3c;}function clearPredictiveAttributes(_0x4a9b7a){if(_0x4a9b7a[_0x423e('0x27')]){_0x4a9b7a[_0x423e('0x27')]=undefined;loggerPredictive[_0x423e('0x5b')](_0x4a9b7a[_0x423e('0x43')],_0x423e('0x5c'));}if(_0x4a9b7a[_0x423e('0x26')]){_0x4a9b7a[_0x423e('0x26')]=undefined;loggerPredictive[_0x423e('0x5b')](_0x4a9b7a[_0x423e('0x43')],_0x423e('0x5d'));}if(_0x4a9b7a[_0x423e('0x5e')]){clearInterval(_0x4a9b7a[_0x423e('0x5e')]);_0x4a9b7a[_0x423e('0x5e')]=undefined;loggerPredictive['debug'](_0x4a9b7a['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x44d178,_0x3321b1){return function(_0x43677f){loggerPredictive[_0x423e('0x5f')](_0x3321b1[_0x423e('0x43')],_0x44d178);loggerPredictive[_0x423e('0x5f')](_0x43677f[_0x423e('0x60')]);clearPredictiveAttributes(_0x3321b1);};}function loggerCatch(_0x5cca8d){return function(_0x1dcdce){logger[_0x423e('0x5f')](_0x5cca8d,util['inspect'](_0x1dcdce,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x383024,_0x3a5e5d,_0x28f509){return function(_0x4dace7){utils[_0x423e('0x61')](_0x3a5e5d,_0x28f509,0x0);logger[_0x423e('0x5f')](_0x383024,util[_0x423e('0x62')](_0x4dace7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2ce507){return function(_0x55f732){if(isNotNull(_0x55f732)&&isNotNull(_0x55f732[0x0])){if(_0x55f732[0x0][_0x423e('0x63')]>0x0){_0x2ce507['message']=utils[_0x423e('0x64')][_0x423e('0x65')];logger['info'](_0x423e('0x66')+_0x2ce507['name'],_0x55f732[0x0][_0x423e('0x63')],_0x423e('0x67'));}else{_0x2ce507['message']=utils[_0x423e('0x64')][_0x423e('0x68')];logger[_0x423e('0x45')]('[getContactDialer2][Empty]'+_0x2ce507[_0x423e('0x43')]);}}};}function createObjHistory(_0x20eaa6,_0x141f71,_0x2eb1d3,_0x2f410e,_0x31e66a){_0x20eaa6[_0x423e('0x69')]=_0x2eb1d3;var _0x21330e=new Action(_0x20eaa6,_0x141f71);var _0x3b7b5b=new History(_0x21330e);_0x3b7b5b[_0x423e('0x6a')]=_0x2f410e;_0x3b7b5b[_0x423e('0x6b')]=_0x31e66a;_0x3b7b5b[_0x423e('0x6c')]=_0x21330e[_0x423e('0x6d')];return _0x3b7b5b;}function unlockQueueStatus(_0x43ffab,_0x371943){setTimeout(function(){if(_[_0x423e('0x3e')](_0x43ffab[_0x423e('0x6e')])){loggerBooked[_0x423e('0x5f')](_0x423e('0x6f'),_0x371943);}_0x43ffab[_0x423e('0x6e')]=!![];loggerBooked['info'](_0x423e('0x70'),_0x371943,JSON[_0x423e('0x71')](_[_0x423e('0x72')](_0x43ffab,['name','queueStatusComplete'])));},0x1f3);}function checkInterval(_0x4d104b){return function(){if(!isNotNull(_0x4d104b[_0x423e('0x73')])){_0x4d104b['message']=utils[_0x423e('0x64')][_0x423e('0x74')];throw _0x4d104b[_0x423e('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4d104b[_0x423e('0x73')][_0x423e('0x75')])){_0x4d104b['message']=utils['CAMPAIGN_STATUS'][_0x423e('0x74')];throw _0x4d104b[_0x423e('0x43')]+_0x423e('0x76');}if(!isNotNull(_['isEmpty'](_0x4d104b[_0x423e('0x73')][_0x423e('0x75')]))){_0x4d104b[_0x423e('0x69')]=utils[_0x423e('0x64')]['NULL_INTERVAL'];throw _0x4d104b[_0x423e('0x43')]+_0x423e('0x76');}};}function checkIsIVRCampaignActive(_0xf2c007){return function(){if(!utils[_0x423e('0x77')](_0xf2c007)){_0xf2c007[_0x423e('0x69')]=utils['CAMPAIGN_STATUS'][_0x423e('0x78')];throw _0xf2c007[_0x423e('0x43')]+_0x423e('0x79');}};}function emitCampaignSummary(_0x39c85f){if(utils[_0x423e('0x7a')](_0x39c85f)){emit(util['format']('campaign:ivr:%s',_0x39c85f[_0x423e('0x43')]),'campaign:save',_0x39c85f);}}function loggerCatchQueueSummary(_0x5da027,_0x26606d){return function(_0x59ad13){clearPredictiveAttributes(_0x26606d);emitCampaignSummary(_0x26606d);loggerSyncQueueSummary['debug'](_0x5da027,util['inspect'](_0x59ad13,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2132cb){if(_0x2132cb[_0x423e('0x7b')]){if(_0x2132cb[_0x423e('0x7c')]===0x0){_0x2132cb['sendMessageOneNotActive']=![];_0x2132cb[_0x423e('0x69')]=utils['CAMPAIGN_STATUS'][_0x423e('0x78')];loggerSyncQueueSummary['debug'](_0x423e('0x7d'),_0x2132cb['name'],_0x423e('0x7e'));}else{_0x2132cb['message']=utils[_0x423e('0x64')][_0x423e('0x7f')];loggerSyncQueueSummary[_0x423e('0x5b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2132cb[_0x423e('0x43')],_0x423e('0x80'));}emitCampaignSummary(_0x2132cb);}}function myreject(_0x31b63f){return function(_0x3d8a39){return _0x31b63f(msgResponse(_0x423e('0x81'),_0x423e('0x82'),JSON['stringify'](_0x3d8a39)));};}Dialer[_0x423e('0x18')]['isTrunkReachable']=function(_0x1df1b9){return!_[_0x423e('0x3e')](_0x1df1b9)&&_0x1df1b9&&!_[_0x423e('0x3e')](_0x1df1b9[_0x423e('0x43')])&&!_[_0x423e('0x3e')](_0x1df1b9['active'])&&_0x1df1b9['active']&&(this['trunks'][util[_0x423e('0x41')]('SIP/%s',_0x1df1b9[_0x423e('0x43')])][_0x423e('0x83')]==='reachable'||this['trunks'][util[_0x423e('0x41')](_0x423e('0x84'),_0x1df1b9['name'])][_0x423e('0x83')]===_0x423e('0x85'));};Dialer['prototype']['checkIsTrunkReachable']=function(_0x2cee2b){var _0x2ad60a=this;return function(){if(!_0x2ad60a[_0x423e('0x86')](_0x2cee2b['Trunk'])){if(!_0x2ad60a[_0x423e('0x86')](_0x2cee2b['TrunkBackup'])){_0x2cee2b[_0x423e('0x69')]=utils[_0x423e('0x64')][_0x423e('0x87')];throw _0x2cee2b[_0x423e('0x43')]+_0x423e('0x88');}}};};Dialer[_0x423e('0x18')][_0x423e('0x89')]=function(_0x2ba862,_0x4b7979,_0x4b9471,_0x2f41b4){var _0x41036f=this;return function(){var _0x33ee6a=!![];return _0x41036f[_0x423e('0x8a')](_0x2ba862,_0x4b7979,_0x4b9471,_0x2f41b4,_0x33ee6a);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x5c6373,_0x368f10,_0x24dc1f,_0x5b8799){var _0x2d17a2=this;return function(){var _0x9ba102=![];return _0x2d17a2[_0x423e('0x8a')](_0x5c6373[_0x423e('0x75')],_0x368f10,_0x24dc1f,_0x5b8799,_0x9ba102);};};Dialer[_0x423e('0x18')][_0x423e('0x8a')]=function(_0x24e766,_0x4dd959,_0x2eac3b,_0x4387a5,_0x4bf75b){var _0x2628b5=[];return new Promise(function(_0x153a51,_0x4d9269){if(!isNotNull(_0x24e766)){_0x4387a5[_0x423e('0x69')]=utils['CAMPAIGN_STATUS'][_0x423e('0x74')];return _0x4d9269(msgResponse(_0x423e('0x8b'),_0x423e('0x8c'),_0x2eac3b+_0x423e('0x8d')));}if(_['isEmpty'](_0x24e766)){_0x4387a5[_0x423e('0x69')]=utils['CAMPAIGN_STATUS']['EMPTY_INTERVAL'];return _0x4d9269(msgResponse(_0x423e('0x8b'),_0x423e('0x8c'),_0x2eac3b+_0x423e('0x8e')));}if(_0x4dd959&&_[_0x423e('0x3e')](config['timezones'][_0x4dd959])){_0x4387a5[_0x423e('0x69')]=utils[_0x423e('0x64')][_0x423e('0x8f')];return _0x4d9269(msgResponse(_0x423e('0x8b'),'Failure',_0x2eac3b+_0x423e('0x90')+_0x4dd959));}if(_[_0x423e('0x91')](_0x24e766)){for(var _0x14f299=0x0;_0x14f299<_0x24e766['length'];_0x14f299+=0x1){_0x2628b5[_0x423e('0x92')](ami[_0x423e('0x93')]({'action':_0x423e('0x94'),'command':util[_0x423e('0x41')](_0x423e('0x95'),_0x24e766[_0x14f299]['interval'],!_[_0x423e('0x3e')](config[_0x423e('0x96')][_0x4dd959])?_0x4dd959:'')})['then'](function(_0x18ab22){return _0x18ab22[_0x423e('0x97')][_0x423e('0x98')](_0x423e('0x99'))>=0x0;})[_0x423e('0x9a')](myreject(_0x4d9269)));}}else{_0x2628b5[_0x423e('0x92')](ami[_0x423e('0x93')]({'action':'command','command':util[_0x423e('0x41')](_0x423e('0x95'),_0x24e766,!_[_0x423e('0x3e')](config[_0x423e('0x96')][_0x4dd959])?_0x4dd959:'')})[_0x423e('0x9b')](function(_0x3a1811){return _0x3a1811[_0x423e('0x97')][_0x423e('0x98')](_0x423e('0x99'))>=0x0;})['catch'](myreject(_0x4d9269)));}Promise[_0x423e('0x9c')](_0x2628b5)[_0x423e('0x9b')](function(_0x1dafcc){var _0x283bd6=_[_0x423e('0x9d')](_0x1dafcc);if(_0x283bd6){return _0x153a51(_0x283bd6);}else{_0x4387a5[_0x423e('0x69')]=_0x4bf75b?utils[_0x423e('0x64')][_0x423e('0x9e')]:utils['CAMPAIGN_STATUS'][_0x423e('0x9f')];return _0x4d9269(msgResponse(_0x423e('0xa0'),_0x423e('0x8c'),_0x423e('0xa1')+_0x4bf75b+'\x20'+_0x2eac3b+_0x423e('0xa2')+util[_0x423e('0x62')](_0x24e766,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4dd959));}})[_0x423e('0x9a')](function(_0x2db39a){return _0x4d9269(msgResponse(_0x423e('0x8b'),_0x423e('0x8c'),JSON['stringify'](_0x2db39a)));});});};Dialer[_0x423e('0x18')]['loopCampaigns']=function(){var _0x3f3bd2=this;return cmHopper[_0x423e('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0x423e('0x9b')](function(){setInterval(function(){_0x3f3bd2[_0x423e('0xa4')]();},0x3e8);});};Dialer[_0x423e('0x18')]['syncCampaigns']=function(){var _0x13a0e4=this;var _0x716359;for(var _0x1ba731 in this[_0x423e('0x1e')]){if(typeof this[_0x423e('0x1e')][_0x1ba731]!==_0x423e('0xa5')){_0x716359=this[_0x423e('0x1e')][_0x1ba731];if(utils[_0x423e('0x7a')](_0x716359)&&utils[_0x423e('0x77')](_0x716359)){_0x716359[_0x423e('0x7b')]=!![];Promise['resolve']()[_0x423e('0x9b')](checkIsIVRCampaignActive(_0x716359))[_0x423e('0x9b')](checkInterval(_0x716359))['then'](_0x13a0e4[_0x423e('0xa6')](_0x716359))[_0x423e('0x9b')](_0x13a0e4[_0x423e('0x89')](_0x716359[_0x423e('0xa7')],_0x716359[_0x423e('0xa8')],_0x716359[_0x423e('0x43')],_0x716359))['then'](_0x13a0e4['checkIfTimeIntervals'](_0x716359['Interval'],_0x716359[_0x423e('0xa8')],_0x716359[_0x423e('0x43')],_0x716359))['then'](_0x13a0e4['launchHandleIvr'](_0x716359))[_0x423e('0x9a')](loggerCatchQueueSummary(_0x423e('0xa9'),_0x716359));}else{notSendMessagesCampaign(_0x716359);}}}};Dialer[_0x423e('0x18')][_0x423e('0xaa')]=function(_0x7ee1ca){if(_0x7ee1ca[_0x423e('0xab')]!==_0x423e('0xac')){clearPredictiveAttributes(_0x7ee1ca);}switch(_0x7ee1ca[_0x423e('0xab')]){case'progressive':this[_0x423e('0xad')](_0x7ee1ca,0x1);break;case _0x423e('0xae'):this[_0x423e('0xad')](_0x7ee1ca,_0x7ee1ca[_0x423e('0xaf')]);break;case _0x423e('0xac'):this[_0x423e('0xac')](_0x7ee1ca);break;case _0x423e('0x9'):this['handlePower'](_0x7ee1ca,0x1);break;default:logger[_0x423e('0x5f')]('Queue',_0x7ee1ca[_0x423e('0x43')],'method\x20not\x20recognized');}};Dialer['prototype']['ifTime']=function(_0x558e08,_0x51555c){var _0x57d0ae=_0x558e08[_0x423e('0xa8')];var _0x5a5245=_0x51555c?_0x558e08[_0x423e('0xa7')]:_0x558e08[_0x423e('0x73')][_0x423e('0x75')];logger[_0x423e('0xb0')]('Dialer::ifTime()',_0x5a5245,_0x57d0ae,_0x558e08[_0x423e('0x43')],util[_0x423e('0x41')](_0x423e('0xb1'),_0x558e08[_0x423e('0x43')],_0x558e08['id']));var _0x4ff113=null;return Interval[_0x423e('0xb2')](_0x5a5245,_0x57d0ae)[_0x423e('0x9b')](function(_0x175326){if(_0x175326===!![]){return _0x175326;}else{_0x558e08[_0x423e('0x69')]=_0x51555c?utils[_0x423e('0x64')][_0x423e('0x9e')]:utils[_0x423e('0x64')]['OVERTIME_INTERVAL'];_0x4ff113=msgResponse(_0x423e('0xa0'),_0x423e('0x8c'),'Global:\x20'+_0x51555c+'\x20'+_0x558e08[_0x423e('0x43')]+_0x423e('0xa2')+util[_0x423e('0x62')](_0x5a5245,{'showHidden':![],'depth':null})+_0x423e('0xb3')+_0x57d0ae);}if(_0x4ff113!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x4ff113);_0x4ff113[_0x423e('0xb4')]=_0x51555c;throw _0x4ff113;}})[_0x423e('0x9a')](function(_0x9c9b57){logger[_0x423e('0x5f')](_0x423e('0xb5'),_0x9c9b57);throw msgResponse('[ifTime][Action]',_0x423e('0x82'),util[_0x423e('0x62')](_0x9c9b57,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x423e('0x2d')]=function(_0x4d5254){if(this['voiceQueues'][_0x4d5254['queue']]){if(this[_0x423e('0xb6')][_0x4d5254[_0x423e('0xb7')]]&&this[_0x423e('0xb6')][_0x4d5254['uniqueid']]['type']!==_0x423e('0xb8')){this['updateOriginated'](this[_0x423e('0x1d')][_0x4d5254['queue']]);this[_0x423e('0xb6')][_0x4d5254[_0x423e('0xb7')]][_0x423e('0xb9')]=moment()[_0x423e('0x41')](_0x423e('0xba'));}}};Dialer[_0x423e('0x18')][_0x423e('0xbb')]=function(_0x20ebc5){var _0x11d5c2=this[_0x423e('0xb6')][_0x20ebc5[_0x423e('0xb7')]];if(this[_0x423e('0x1d')][_0x20ebc5[_0x423e('0xbc')]]){if(_0x11d5c2&&_0x11d5c2['type']!==_0x423e('0xb8')){delete this[_0x423e('0xb6')][_0x20ebc5[_0x423e('0xb7')]];this[_0x423e('0x1d')][_0x20ebc5['queue']][_0x423e('0xbd')]+=0x1;var _0x2437c6=new AgentComplete(_0x11d5c2,_0x20ebc5);if(_0x20ebc5[_0x423e('0xbe')]===_0x423e('0xbf')){_0x2437c6[_0x423e('0xc0')]=this[_0x423e('0x1d')][_0x20ebc5[_0x423e('0xbc')]][_0x423e('0xc1')]&&this[_0x423e('0x1d')][_0x20ebc5[_0x423e('0xbc')]][_0x423e('0xc2')]?moment()['format'](_0x423e('0xba')):undefined;}hopperUtils[_0x423e('0xc3')](_0x2437c6)['catch'](loggerCatch(_0x423e('0xc4')));hopperUtils[_0x423e('0xc5')](_0x2437c6)[_0x423e('0x9a')](loggerCatch(_0x423e('0xc6')));}}};Dialer[_0x423e('0x18')][_0x423e('0xc7')]=function(_0x55c766){var _0x19d5cc=this[_0x423e('0xb6')][_0x55c766[_0x423e('0xb7')]];var _0x3a716b=this;var _0x5d0ce0=![];var _0x3bb74b;var _0x21028d;if(this[_0x423e('0x1d')][_0x55c766['queue']]){if(_0x19d5cc&&_0x19d5cc['type']!==_0x423e('0xb8')){delete this[_0x423e('0xb6')][_0x55c766[_0x423e('0xb7')]];this[_0x423e('0xc8')](this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]);_0x19d5cc[_0x423e('0xc9')]=moment()['format'](_0x423e('0xba'));var _0x46f77d=new QueueCallerAbandon(_0x19d5cc,_0x55c766);if(utils[_0x423e('0xca')](_0x19d5cc[_0x423e('0xc9')],_0x19d5cc[_0x423e('0xcb')])>=_0x19d5cc['dialQueueTimeout']){this[_0x423e('0x1d')][_0x55c766['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]][_0x423e('0xcc')]+=0x1;this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x46f77d[_0x423e('0x6a')]=0xa;_0x46f77d['statedesc']=_0x423e('0xcd');_0x46f77d[_0x423e('0xce')]=_0x423e('0xcf');_0x46f77d[_0x423e('0xc0')]=this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['dialQueueProject2']?moment()['format'](_0x423e('0xba')):undefined;_0x46f77d[_0x423e('0xd0')]+=0x1;_0x46f77d['countglobal']+=0x1;_0x3bb74b=this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['dialDropRetryFrequency'];_0x21028d=this['voiceQueues'][_0x55c766['queue']][_0x423e('0xd1')];hopperUtils[_0x423e('0xd2')](_0x46f77d,_0x46f77d[_0x423e('0x6a')],_0x19d5cc['voiceQueue'])[_0x423e('0x9b')](function(_0x23d802){_0x5d0ce0=_0x23d802['additional']==0x1;if(_0x46f77d[_0x423e('0xd0')]>=_0x3a716b['voiceQueues'][_0x55c766[_0x423e('0xbc')]]['dialDropMaxRetry']){_0x3a716b['queueCallerAbandonCreateState'](_0x46f77d,_0x23d802[_0x423e('0xd3')]);}else{hopperUtils[_0x423e('0xd4')]({'active':![],'countdropretry':_0x46f77d[_0x423e('0xd0')],'scheduledat':moment()['add'](_0x3a716b[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]][_0x423e('0xd5')],_0x423e('0xd6'))[_0x423e('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19d5cc[_0x423e('0xd7')],'ListId':_0x19d5cc[_0x423e('0xd8')],'VoiceQueueId':_0x19d5cc[_0x423e('0xd9')]||undefined,'CampaignId':_0x19d5cc[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0xdb')));var _0x5202f4=new History(_0x46f77d);_0x5202f4[_0x423e('0x6a')]=0xa;_0x5202f4[_0x423e('0x6b')]=_0x423e('0xcd');_0x5202f4[_0x423e('0x6d')]=moment()[_0x423e('0x41')](_0x423e('0xba'));_0x5202f4[_0x423e('0x6c')]=_0x5202f4['starttime'];_0x5202f4[_0x423e('0xdc')]=_0x46f77d[_0x423e('0xdc')];_0x5202f4[_0x423e('0xdd')]=_0x46f77d[_0x423e('0xdd')];hopperUtils[_0x423e('0xc3')](_0x5202f4)[_0x423e('0x9a')](loggerCatch(_0x423e('0xde')));}})['then'](function(){if(_0x5d0ce0)hopperUtils[_0x423e('0xdf')](_0x46f77d,_0x3bb74b,_0x21028d)['then'](function(){return 0x1;});});}else{this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]][_0x423e('0xe0')]+=0x1;_0x46f77d[_0x423e('0x6a')]=0xb;_0x46f77d[_0x423e('0x6b')]=_0x423e('0xe1');_0x46f77d[_0x423e('0xce')]=_0x423e('0xe2');_0x46f77d[_0x423e('0xe3')]+=0x1;_0x46f77d[_0x423e('0xe4')]+=0x1;_0x3bb74b=this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]][_0x423e('0xe5')];_0x21028d=this[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x423e('0xd2')](_0x46f77d,_0x46f77d[_0x423e('0x6a')],_0x19d5cc[_0x423e('0xe6')])[_0x423e('0x9b')](function(_0x1c1d99){if(_0x46f77d[_0x423e('0xe3')]>=_0x3a716b[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]]['dialAbandonedMaxRetry']){_0x3a716b['queueCallerAbandonCreateState'](_0x46f77d,_0x1c1d99[_0x423e('0xd3')]);}else{hopperUtils[_0x423e('0xd4')]({'active':![],'countabandonedretry':_0x46f77d[_0x423e('0xe3')],'scheduledat':moment()['add'](_0x3a716b[_0x423e('0x1d')][_0x55c766[_0x423e('0xbc')]][_0x423e('0xe5')],_0x423e('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19d5cc['ContactId'],'ListId':_0x19d5cc['ListId'],'VoiceQueueId':_0x19d5cc[_0x423e('0xd9')]||undefined,'CampaignId':_0x19d5cc['CampaignId']||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0xe7')));var _0x197de7=new History(_0x46f77d);_0x197de7[_0x423e('0x6a')]=0xb;_0x197de7[_0x423e('0x6b')]=_0x423e('0xe1');_0x197de7[_0x423e('0x6d')]=moment()[_0x423e('0x41')](_0x423e('0xba'));_0x197de7['endtime']=_0x197de7[_0x423e('0x6d')];_0x197de7[_0x423e('0xdc')]=_0x46f77d[_0x423e('0xdc')];_0x197de7[_0x423e('0xdd')]=_0x46f77d['calleridnum'];hopperUtils[_0x423e('0xc3')](_0x197de7)[_0x423e('0x9a')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x423e('0x9b')](function(){if(_0x5d0ce0)hopperUtils['swapAdditionalPhones'](_0x46f77d,_0x3bb74b,_0x21028d)[_0x423e('0x9b')](function(){return 0x1;});});}}}};Dialer[_0x423e('0x18')]['syncNewExten']=function(_0x572fc1){if(this[_0x423e('0x23')][_0x572fc1[_0x423e('0xb7')]]){this['actions'][_0x572fc1[_0x423e('0xb7')]]['channel']=_0x572fc1[_0x423e('0xe8')];}if(this['uniqueId'][_0x572fc1[_0x423e('0xb7')]]){this[_0x423e('0xb6')][_0x572fc1[_0x423e('0xb7')]][_0x423e('0xe8')]=_0x572fc1[_0x423e('0xe8')];}};Dialer['prototype']['syncQueueMember']=function(_0x1c92f0){if(!this[_0x423e('0x23')][_0x1c92f0[_0x423e('0xe9')]]){return;}var _0x14cce2=this[_0x423e('0x1d')][this[_0x423e('0x23')][_0x1c92f0['actionid']]['queue']]['strategy']||_0x423e('0xea');if(_0x14cce2===_0x423e('0xeb')){if(this[_0x423e('0x23')][_0x1c92f0[_0x423e('0xe9')]]&&_[_0x423e('0xec')](this[_0x423e('0x23')][_0x1c92f0[_0x423e('0xe9')]][_0x423e('0xed')])&&_0x1c92f0[_0x423e('0x83')]==='1'&&_0x1c92f0[_0x423e('0xee')]==='0'){if(this[_0x423e('0x1f')][_0x1c92f0[_0x423e('0xef')]]){if(!this[_0x423e('0x1f')][_0x1c92f0[_0x423e('0xef')]][_0x423e('0xed')]){this[_0x423e('0x1f')][_0x1c92f0[_0x423e('0xef')]][_0x423e('0xed')]=!![];this[_0x423e('0x23')][_0x1c92f0[_0x423e('0xe9')]][_0x423e('0xed')]=!![];this[_0x423e('0x23')][_0x1c92f0['actionid']][_0x423e('0xef')]=_0x1c92f0[_0x423e('0xef')];}}}}else if(_0x14cce2==='rrmemory'){if(this['actions'][_0x1c92f0[_0x423e('0xe9')]]){if(this[_0x423e('0x1f')][_0x1c92f0['stateinterface']]){this[_0x423e('0x23')][_0x1c92f0['actionid']][_0x423e('0xef')]=_0x1c92f0[_0x423e('0xef')];if(_['isNil'](this[_0x423e('0x29')][this[_0x423e('0x23')][_0x1c92f0[_0x423e('0xe9')]][_0x423e('0xbc')]])){this['queueBooked'][this['actions'][_0x1c92f0[_0x423e('0xe9')]][_0x423e('0xbc')]]=[];}this['queueBooked'][this[_0x423e('0x23')][_0x1c92f0['actionid']][_0x423e('0xbc')]][_0x423e('0x92')](_[_0x423e('0x5a')](_[_0x423e('0x72')](this['actions'][_0x1c92f0['actionid']],[_0x423e('0xf0'),_0x423e('0xef')]),{'status':_0x1c92f0['status'],'paused':_0x1c92f0[_0x423e('0xee')]}));}}}};Dialer[_0x423e('0x18')][_0x423e('0x39')]=function(_0x41064d){if(!this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]){return;}var _0x1fd056=this;var _0x1bfbbc=this[_0x423e('0x1d')][this['actions'][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]];var _0x2373b7=_0x1bfbbc[_0x423e('0xf1')]||'rrmemory';if(_0x2373b7===_0x423e('0xeb')){if(this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]&&this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xef')]){this[_0x423e('0x1c')][_0x423e('0xf2')](this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xf0')],this[_0x423e('0x23')][_0x41064d['actionid']][_0x423e('0xef')])[_0x423e('0x9a')](function(_0x3efec3){logger[_0x423e('0x5f')](_0x423e('0xf3'),util['inspect'](_0x3efec3,{'showHidden':![],'depth':null}));})[_0x423e('0xf4')](function(){_0x1fd056[_0x423e('0xc8')](_0x1fd056['voiceQueues'][_0x1fd056[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]]);_0x1fd056[_0x423e('0x1f')][_0x1fd056[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]['stateinterface']][_0x423e('0xed')]=![];delete _0x1fd056[_0x423e('0x23')][_0x41064d['actionid']];unlockQueueStatus(_0x1bfbbc);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]]);hopperUtils[_0x423e('0xd4')]({'active':![],'ContactId':this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xd7')],'ListId':this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]['ListId'],'VoiceQueueId':this[_0x423e('0x23')][_0x41064d['actionid']][_0x423e('0xd9')]||undefined,'CampaignId':this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]['CampaignId']||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0xf5')));delete this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]];unlockQueueStatus(_0x1bfbbc);}}else if(_0x2373b7===_0x423e('0xea')){var _0x19be77;if(this[_0x423e('0x23')][_0x41064d['actionid']]&&!_[_0x423e('0xf6')](this['queueBooked'][this['actions'][_0x41064d[_0x423e('0xe9')]]['queue']])){if(this['queueBookedRR'][_0x1fd056[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]]['queue']]){this[_0x423e('0x2a')][_0x1fd056[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]]=this['queueBookedRR'][this[_0x423e('0x23')][_0x41064d['actionid']][_0x423e('0xbc')]]?this[_0x423e('0x2a')][this[_0x423e('0x23')][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]]:this[_0x423e('0x29')][this['actions'][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]]?this['queueBooked'][this['actions'][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]][_0x423e('0xf7')]||0x0:0x0;}this[_0x423e('0x29')][this[_0x423e('0x23')][_0x41064d['actionid']][_0x423e('0xbc')]]['_rr']=this['queueBookedRR'][this['actions'][_0x41064d[_0x423e('0xe9')]][_0x423e('0xbc')]];for(var _0x4106d4=0x0;_0x4106d4=_0x2bbc9c[_0x423e('0x11e')]){_0x18a90c['stateGlobal'](_0x427b2e,_0x4fa9e0,_0x3bbaf7,_0x423e('0x11f'));}else{if(_0x427b2e[_0x423e('0x11c')]>=_0x2bbc9c[_0x423e('0x120')]){_0x18a90c[_0x423e('0x121')](_0x427b2e,_0x4fa9e0,_0x3bbaf7,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x427b2e['countmachineretry'],'scheduledat':moment()[_0x423e('0x122')](_0x2bbc9c[_0x423e('0x123')],_0x423e('0xd6'))[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x427b2e[_0x423e('0xd7')],'ListId':_0x427b2e[_0x423e('0xd8')],'VoiceQueueId':_0x427b2e[_0x423e('0xd9')]||undefined,'CampaignId':_0x427b2e[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x124')));_0x4fa9e0({'reschedule':0x1});}}});}if(_0x3c7ea7[_0x423e('0x3f')]==='ivr'&&this[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]][_0x423e('0x108')]&&_0x4bd568['value']===_0x423e('0x10a')){delete this['uniqueId'][_0x4bd568['uniqueid']];this[_0x423e('0xc8')](this[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]]);_0xe814ae=new Hangup(_0x3c7ea7,_0x4bd568);_0xe814ae[_0x423e('0x6a')]=0x12;_0xe814ae[_0x423e('0x6b')]='HangupInAMD';_0xe814ae[_0x423e('0x115')]='AMD';ami[_0x423e('0x116')](_0x423e('0x10d'),ut[_0x423e('0x117')](_0xe814ae,'amd'));this[_0x423e('0x10f')](_0xe814ae,'[syncHangupInAMDIvr][createHistory]',_0x423e('0x125'));}if(_0x3c7ea7['type']==='ivr'&&this[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]][_0x423e('0x108')]&&_0x4bd568[_0x423e('0x109')]==='MACHINE'){return new Promise(function(_0x5be68f,_0x477b11){delete _0x18a90c[_0x423e('0xb6')][_0x4bd568[_0x423e('0xb7')]];_0x18a90c[_0x423e('0xc8')](_0x18a90c[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]]);_0x18a90c[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]][_0x423e('0xbd')]+=0x1;_0x18a90c[_0x423e('0x1e')][_0x3c7ea7[_0x423e('0xbc')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xd36439=_0x18a90c['campaigns'][_0x3c7ea7['queue']];var _0x1397ff=new Hangup(_0x3c7ea7,_0x4bd568);_0x1397ff[_0x423e('0x6a')]=0x13;_0x1397ff[_0x423e('0x6b')]='Machine';_0x1397ff[_0x423e('0x115')]=_0x423e('0x10c');_0x1397ff[_0x423e('0x11c')]+=0x1;_0x1397ff[_0x423e('0xe4')]+=0x1;_0x1397ff['amd']=!![];ami[_0x423e('0x116')](_0x423e('0x10d'),ut[_0x423e('0x117')](_0x1397ff,_0x423e('0x10e')));hopperUtils[_0x423e('0xc3')](_0x1397ff)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1397ff[_0x423e('0x126')]+_0x1397ff[_0x423e('0x119')]+_0x1397ff[_0x423e('0x11a')]+_0x1397ff[_0x423e('0x11b')]+_0x1397ff[_0x423e('0xd0')]+_0x1397ff['countabandonedretry']+_0x1397ff[_0x423e('0x11c')]+_0x1397ff[_0x423e('0x11d')]>=_0xd36439[_0x423e('0x11e')]){_0x18a90c['stateGlobal'](_0x1397ff,_0x5be68f,_0x477b11,_0x423e('0x11f'));}else{if(_0x1397ff['countmachineretry']>=_0xd36439[_0x423e('0x120')]){_0x18a90c[_0x423e('0x121')](_0x1397ff,_0x5be68f,_0x477b11,_0x423e('0x127'));}else{hopperUtils[_0x423e('0xd4')]({'active':![],'countmachineretry':_0x1397ff[_0x423e('0x11c')],'scheduledat':moment()[_0x423e('0x122')](_0xd36439[_0x423e('0x123')],_0x423e('0xd6'))[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x1397ff['ContactId'],'ListId':_0x1397ff[_0x423e('0xd8')],'VoiceQueueId':_0x1397ff[_0x423e('0xd9')]||undefined,'CampaignId':_0x1397ff['CampaignId']||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x124')));_0x5be68f({'reschedule':0x1});}}});}}};Dialer[_0x423e('0x18')][_0x423e('0x35')]=function(_0x3222b7){var _0x43b34b=this[_0x423e('0xb6')][_0x3222b7[_0x423e('0xb7')]];var _0x58aefd;if(_0x43b34b&&_0x43b34b[_0x423e('0x3f')]===_0x423e('0xb8')){delete this[_0x423e('0xb6')][_0x3222b7['uniqueid']];this['updateOriginated'](this[_0x423e('0x1e')][_0x43b34b['queue']]);this[_0x423e('0x1e')][_0x43b34b[_0x423e('0xbc')]][_0x423e('0x128')]+=0x1;_0x58aefd=new Hangup(_0x43b34b,_0x3222b7);hopperUtils['createHistory'](_0x58aefd)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x423e('0xc5')](_0x58aefd)[_0x423e('0x9a')](loggerCatch(_0x423e('0x129')));}if(_0x43b34b&&_0x43b34b[_0x423e('0x3f')]!==_0x423e('0xb8')&&isNotNull(this[_0x423e('0x1d')][_0x43b34b[_0x423e('0xbc')]]['dialQueueProject'])){delete this[_0x423e('0xb6')][_0x3222b7[_0x423e('0xb7')]];this['updateOriginated'](this['voiceQueues'][_0x43b34b[_0x423e('0xbc')]]);this['voiceQueues'][_0x43b34b['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x43b34b[_0x423e('0xbc')]][_0x423e('0x113')]+=0x1;_0x58aefd=new Hangup(_0x43b34b,_0x3222b7);_0x58aefd[_0x423e('0x6a')]=0x10;_0x58aefd[_0x423e('0x6b')]=_0x423e('0x12a');_0x58aefd[_0x423e('0x115')]=_0x423e('0x12b');hopperUtils[_0x423e('0xc3')](_0x58aefd)[_0x423e('0x9a')](loggerCatch(_0x423e('0x12c')));hopperUtils[_0x423e('0xc5')](_0x58aefd)[_0x423e('0x9a')](loggerCatch(_0x423e('0x129')));}if(_0x43b34b&&_0x43b34b[_0x423e('0x3f')]!==_0x423e('0xb8')&&!isNotNull(this['voiceQueues'][_0x43b34b[_0x423e('0xbc')]][_0x423e('0x12d')])){delete this[_0x423e('0xb6')][_0x3222b7[_0x423e('0xb7')]];this[_0x423e('0xc8')](this['voiceQueues'][_0x43b34b[_0x423e('0xbc')]]);this[_0x423e('0x1d')][_0x43b34b[_0x423e('0xbc')]][_0x423e('0x12e')]+=0x1;_0x58aefd=new Hangup(_0x43b34b,_0x3222b7);_0x58aefd[_0x423e('0x6a')]=0xc;_0x58aefd[_0x423e('0x6b')]=_0x3222b7['cause-txt'];_0x58aefd[_0x423e('0x115')]=_0x423e('0x12f');hopperUtils[_0x423e('0xc3')](_0x58aefd)['catch'](loggerCatch(_0x423e('0x12c')));hopperUtils[_0x423e('0xc5')](_0x58aefd)[_0x423e('0x9a')](loggerCatch(_0x423e('0x129')));}};Dialer['prototype']['syncQueueSummary']=function(_0x7cd612){var _0xa8c308=this;if(!_0xa8c308['queuesSummary'][_0x7cd612['name']]){_0xa8c308[_0x423e('0x2b')][_0x7cd612[_0x423e('0x43')]]={'running':![]};}else if(_0xa8c308[_0x423e('0x2b')][_0x7cd612[_0x423e('0x43')]][_0x423e('0x130')]===!![]){return;}else if(_0xa8c308[_0x423e('0x2b')][_0x7cd612[_0x423e('0x43')]][_0x423e('0x130')]===![]){_0xa8c308[_0x423e('0x2b')][_0x7cd612[_0x423e('0x43')]][_0x423e('0x130')]=!![];}var _0x1d4901=_0xa8c308[_0x423e('0x1d')][_0x7cd612['name']];var _0xfecefd=_0x1d4901[_0x423e('0x69')]!==utils[_0x423e('0x64')][_0x423e('0x78')];var _0x3a6b93=utils['isPreviewCampaign'](_0x1d4901);_0x1d4901[_0x423e('0x131')]=utils[_0x423e('0x132')](_0x1d4901,_0xa8c308[_0x423e('0x20')]);Promise[_0x423e('0x133')]()[_0x423e('0x9b')](function(){if(_0x1d4901[_0x423e('0x131')]===utils[_0x423e('0x64')][_0x423e('0x78')]){if(_0xfecefd){clearPredictiveAttributes(_0x1d4901);_0x7cd612[_0x423e('0x26')]=undefined;_0x7cd612[_0x423e('0x27')]=undefined;}if(_0x1d4901[_0x423e('0x131')]===utils[_0x423e('0x64')][_0x423e('0x78')]){_0x7cd612[_0x423e('0x134')]=0x0;_0x7cd612[_0x423e('0xee')]=0x0;_0x7cd612[_0x423e('0x135')]=0x0;_0x7cd612['talking']=0x0;_0x7cd612[_0x423e('0x136')]=0x0;}}else if(_0x1d4901[_0x423e('0x131')]===utils[_0x423e('0x64')][_0x423e('0x137')]&&!_0x3a6b93){return _0xa8c308[_0x423e('0x8b')](_0x1d4901,!![])[_0x423e('0x9b')](function(){return _0xa8c308[_0x423e('0x8b')](_0x1d4901,![]);})[_0x423e('0x9b')](function(){return _0xa8c308[_0x423e('0xaa')](_0x1d4901);})[_0x423e('0x9a')](function(_0x5e97a5){loggerSyncQueueSummary['debug'](_0x423e('0x138'),util[_0x423e('0x62')](_0x5e97a5,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1d4901);});}else{clearPredictiveAttributes(_0x1d4901);}})[_0x423e('0x9b')](function(){var _0x46feb1=_0x7cd612[_0x423e('0x139')](_0x1d4901);if(_0x46feb1||_0x1d4901['queueSummaryCountersUpdated']){_0x1d4901[_0x423e('0x13a')]=![];_0x7cd612[_0x423e('0x13b')](_0x1d4901);Object[_0x423e('0x13c')](_0x1d4901,_0x7cd612);emitOutboundVoiceQueueSummary(_0x7cd612);}_0xa8c308['queuesSummary'][_0x1d4901[_0x423e('0x43')]][_0x423e('0x130')]=![];})[_0x423e('0x9a')](function(_0x5f3e4e){logger['error'](_0x423e('0x138'),util[_0x423e('0x62')](_0x5f3e4e,{'showHidden':![],'depth':null}));_0xa8c308[_0x423e('0x2b')][_0x1d4901[_0x423e('0x43')]][_0x423e('0x130')]=![];});};Dialer[_0x423e('0x18')]['syncQueueSummaryComplete']=_[_0x423e('0x13d')](function(){var _0x8c16d3=_[_0x423e('0x13e')](this[_0x423e('0x1d')],function(_0x52773c){return _0x52773c[_0x423e('0x13f')];});var _0x5f3177=_[_0x423e('0x13e')](this[_0x423e('0x1f')],function(_0x2e5b71){return _0x2e5b71[_0x423e('0x140')]&&_0x2e5b71[_0x423e('0x83')]===_0x423e('0x141');});if(_0x8c16d3[_0x423e('0xf8')]>0x0&&_0x5f3177[_0x423e('0xf8')]>0x0){return Promise[_0x423e('0x133')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x423e('0x142')](_0x8c16d3,'id'),previewRecallmeReminderInterval,_[_0x423e('0x142')](_0x5f3177,'id')))['then'](function(_0x348d4a){for(var _0x18948b=0x0;_0x18948b<_0x348d4a[_0x423e('0xf8')];_0x18948b++){var _0x27457b=_0x348d4a[_0x18948b][_0x423e('0x143')]['name'];if(_0x27457b)io['to'](util['format'](_0x423e('0x144'),_0x27457b))['emit'](_0x423e('0x145'),{'hopper':_0x348d4a[_0x18948b]});}})[_0x423e('0x9a')](function(_0x28fb8f){logger['error'](_0x423e('0x146'),_0x28fb8f);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x423e('0x18')][_0x423e('0x3b')]=function(){var _0xfd26f9=this;setInterval(function(){_0xfd26f9[_0x423e('0x147')](_0xfd26f9['uniqueId'],_0x423e('0x148'));_0xfd26f9[_0x423e('0x147')](_0xfd26f9[_0x423e('0x23')],_0x423e('0x149'));},0x32c8);};Dialer[_0x423e('0x18')]['clearZombieChannels']=function(_0x243e53,_0x58c5f0){var _0x14f672=this;for(var _0x46bf27 in _0x243e53){if(typeof _0x243e53[_0x46bf27]!==_0x423e('0xa5')){this[_0x423e('0x1b')]['enqueue'](function(){if(!_[_0x423e('0xec')](_0x243e53[_0x46bf27])){return ami['Action']({'action':'status','channel':_0x243e53[_0x46bf27][_0x423e('0xe8')]})[_0x423e('0x9a')](function(_0x4bd0d9){if(_0x4bd0d9[_0x423e('0x69')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x243e53[_0x46bf27]&&_0x243e53[_0x46bf27][_0x423e('0x3f')]!==_0x423e('0xb8')){_0x14f672[_0x423e('0xc8')](_0x14f672[_0x423e('0x1d')][_0x243e53[_0x46bf27]['queue']]);logger[_0x423e('0x5f')](_0x423e('0x14a'),_0x58c5f0,_0x46bf27,_0x243e53[_0x46bf27][_0x423e('0xbc')]);delete _0x243e53[_0x46bf27];}if(_0x243e53[_0x46bf27]&&_0x243e53[_0x46bf27][_0x423e('0x3f')]===_0x423e('0xb8')){_0x14f672[_0x423e('0xc8')](_0x14f672[_0x423e('0x1e')][_0x243e53[_0x46bf27][_0x423e('0xbc')]]);logger[_0x423e('0x5f')](_0x423e('0x14b'),_0x58c5f0,_0x46bf27,_0x243e53[_0x46bf27]['queue']);delete _0x243e53[_0x46bf27];}},0x2328);}});}});}}};Dialer[_0x423e('0x18')][_0x423e('0x14c')]=function(_0x392fcc){return Promise[_0x423e('0x133')]()[_0x423e('0x9b')](voiceQueueRt[_0x423e('0x14c')](_0x392fcc))[_0x423e('0x9a')](loggerCatch(_0x423e('0x14d')));};Dialer[_0x423e('0x18')]['updateOriginated']=function(_0x294879){if(!_[_0x423e('0x3e')](_0x294879)&&_0x294879!==null){if(typeof _0x294879[_0x423e('0x7c')]!==_0x423e('0xa5')){if(_0x294879['originated']>0x0){_0x294879['originated']-=0x1;}else{logger['error'](_0x423e('0x14e'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x423e('0x18')][_0x423e('0x14f')]=function(_0x37ba81,_0x97f77f){var _0x166420=this;return function(_0x512a09){_0x166420[_0x423e('0xc8')](_0x97f77f);logger[_0x423e('0x5f')](_0x37ba81,util[_0x423e('0x62')](_0x512a09,{'showHidden':![],'depth':null}));};};Dialer[_0x423e('0x18')][_0x423e('0x150')]=function(_0x263efc,_0x5e79ca,_0x553e34){var _0x30cd7d={'state':0x19,'statedesc':_0x423e('0x151')};this[_0x423e('0xc8')](_0x5e79ca);this[_0x423e('0x10f')](_[_0x423e('0x5a')](_0x30cd7d,_[_0x423e('0x72')](_0x553e34,[_0x423e('0xd7'),_0x423e('0xd8'),'UserId',_0x423e('0xd9'),'CampaignId'])),'[emptyContact][createHistory]',_0x423e('0x152'));logger[_0x423e('0x5f')](_0x263efc);};Dialer[_0x423e('0x18')][_0x423e('0x10f')]=function(_0xaa1b2e,_0x2e9fa0,_0xabde9){hopperUtils[_0x423e('0xc3')](_0xaa1b2e)[_0x423e('0x9a')](loggerCatch(_0x2e9fa0));hopperUtils[_0x423e('0xc5')](_0xaa1b2e)[_0x423e('0x9a')](loggerCatch(_0xabde9));};Dialer[_0x423e('0x18')]['queueCallerAbandonCreateState']=function(_0x49b798,_0xd3e797){hopperUtils[_0x423e('0xc3')](_0x49b798)[_0x423e('0x9a')](loggerCatch(_0x423e('0xc4')));if(_0xd3e797==0x0){hopperUtils[_0x423e('0xc5')](_0x49b798)[_0x423e('0x9a')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x423e('0x18')][_0x423e('0x146')]=function(_0x3a96e){return Promise[_0x423e('0x133')]()[_0x423e('0x9b')](cmHopper[_0x423e('0x153')](_0x3a96e['id'],previewRecallmeReminderInterval))[_0x423e('0x9b')](function(_0x794ac5){for(var _0x16b822=0x0;_0x16b822<_0x794ac5[_0x423e('0xf8')];_0x16b822++){var _0x2c871e=_0x794ac5[_0x16b822]['Agent'][_0x423e('0x43')];if(_0x2c871e)io['to'](util[_0x423e('0x41')](_0x423e('0x144'),_0x2c871e))[_0x423e('0x116')](_0x423e('0x145'),{'hopper':_0x794ac5[_0x16b822]});}})[_0x423e('0x9a')](function(){});};Dialer[_0x423e('0x18')][_0x423e('0x154')]=function(_0x4e0673){var _0x325caa=this;return function(){_0x325caa[_0x423e('0x155')](_0x4e0673);};};Dialer[_0x423e('0x18')][_0x423e('0x156')]=function(_0x4470fe,_0x1929fc){var _0x27a1e6=this;var _0x420bd0=uuid['v4']();this[_0x423e('0x23')][_0x420bd0]=new Action(_0x4470fe,_0x1929fc,_0x420bd0);return new Promise(function(_0x5ab6b7,_0x427000){if(_[_0x423e('0x3e')](_0x4470fe)&&typeof _0x4470fe!=='object'){return _0x427000(msgResponse(_0x423e('0x157'),_0x423e('0x8c'),_0x423e('0x158')));}if(_[_0x423e('0x3e')](_0x1929fc['phone'])||_0x1929fc[_0x423e('0x159')]===null){return _0x427000(msgResponse(_0x423e('0x157'),_0x423e('0x8c'),_0x423e('0x15a')));}var _0x506596={'XMD-CALLERID':_0x27a1e6['actions'][_0x420bd0]['getCaller'](),'XMD-AGI':_0x4470fe['dialQueueProject']?util[_0x423e('0x41')](_0x423e('0x15b'),ipAgi,_0x4470fe['dialQueueProject']):_0x423e('0x15c'),'XMD-AGIAFTER':_0x4470fe[_0x423e('0xc1')]?util[_0x423e('0x41')](_0x423e('0x15b'),ipAgi,_0x4470fe[_0x423e('0xc1')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x4470fe)?util[_0x423e('0x41')](_0x423e('0x15d'),_0x4470fe[_0x423e('0x43')],_0x4470fe[_0x423e('0x15e')]||'',_0x4470fe['dialAgiAfterHangupAgent']?'c':'',_0x4470fe[_0x423e('0x15f')]||0x3):_0x423e('0x15c'),'XMD-CONTACTID':_0x1929fc['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x27a1e6[_0x423e('0x23')][_0x420bd0][_0x423e('0x160')](),'XMD-AMD':_0x4470fe['dialAMDActive']?'ACTIVE':_0x423e('0x15c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4470fe[_0x423e('0x108')]){_0x506596[_0x423e('0x161')]=_0x4470fe[_0x423e('0x162')]||0x9c4;_0x506596[_0x423e('0x163')]=_0x4470fe[_0x423e('0x164')]||0x5dc;_0x506596['XMD-AMDAFTERGREETINGSILENCE']=_0x4470fe[_0x423e('0x165')]||0x320;_0x506596['XMD-AMDTOTALANALYSISTIME']=_0x4470fe[_0x423e('0x166')]||0x1388;_0x506596[_0x423e('0x167')]=_0x4470fe[_0x423e('0x168')]||0x64;_0x506596[_0x423e('0x169')]=_0x4470fe[_0x423e('0x16a')]||0x32;_0x506596[_0x423e('0x16b')]=_0x4470fe['dialAMDMaximumNumberOfWords']||0x3;_0x506596['XMD-AMDSILENCETHRESHOLD']=_0x4470fe[_0x423e('0x16c')]||0x100;_0x506596[_0x423e('0x16d')]=_0x4470fe['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x423e('0x16e')](_0x4470fe)){_0x506596['XMD-VOICEQUEUEID']=_0x1929fc['VoiceQueueId'];}else{_0x506596[_0x423e('0x16f')]=_0x1929fc[_0x423e('0xda')];}for(var _0x161a77 in _0x1929fc[_0x423e('0x170')]){if(typeof _0x1929fc[_0x423e('0x170')][_0x161a77]!==_0x423e('0xa5')){if(isNotNull(_0x1929fc[_0x423e('0x170')][_0x161a77])&&_0x161a77!=='id'&&_0x161a77!=='tags'&&_0x161a77!==_0x423e('0x171')&&_0x161a77!==_0x423e('0x172')){_0x506596[util[_0x423e('0x41')](_0x423e('0x173'),_0x423e('0x174'),_[_0x423e('0x175')](_0x161a77))]=_0x1929fc[_0x423e('0x170')][_0x161a77];}}}var _0x5438c5=_0x27a1e6[_0x423e('0x86')](_0x4470fe[_0x423e('0x176')])?utils[_0x423e('0x177')](_0x4470fe[_0x423e('0x176')]['callerid'],_0x4470fe[_0x423e('0x178')],_0x4470fe[_0x423e('0x179')]>0x0?utils[_0x423e('0x17a')](_0x4470fe['dialOriginateCallerIdNumber'],_0x4470fe[_0x423e('0x179')]):_0x4470fe[_0x423e('0x17b')]):utils[_0x423e('0x177')](_[_0x423e('0xec')](_0x4470fe['TrunkBackup'])?_0x4470fe[_0x423e('0x176')][_0x423e('0x17c')]:_0x4470fe[_0x423e('0x17d')][_0x423e('0x17c')],_0x4470fe[_0x423e('0x178')],_0x4470fe[_0x423e('0x179')]>0x0?utils[_0x423e('0x17a')](_0x4470fe[_0x423e('0x17b')],_0x4470fe[_0x423e('0x179')]):_0x4470fe[_0x423e('0x17b')]);if(_0x5438c5){_0x506596[_0x423e('0x17e')]=_0x27a1e6[_0x423e('0x23')][_0x420bd0][_0x423e('0x17f')]=utils[_0x423e('0x180')](_0x5438c5);_0x506596[_0x423e('0x181')]=_0x1929fc['phone'];}_0x4470fe['variables']=_0x506596;return ami[_0x423e('0x93')]({'actionid':_0x420bd0,'action':_0x423e('0x157'),'channel':_0x27a1e6[_0x423e('0x86')](_0x4470fe[_0x423e('0x176')])?util[_0x423e('0x41')](_0x423e('0x182'),_0x4470fe[_0x423e('0x176')]['name'],isNotNull(_0x4470fe[_0x423e('0x183')])?_0x4470fe[_0x423e('0x183')][_0x423e('0x184')]()||'':'',_0x4470fe[_0x423e('0x185')]>0x0?_0x1929fc['phone'][_0x423e('0x186')](_0x4470fe[_0x423e('0x185')]):_0x1929fc[_0x423e('0x159')]):util['format'](_0x423e('0x182'),_[_0x423e('0xec')](_0x4470fe[_0x423e('0x17d')])?_0x4470fe[_0x423e('0x176')][_0x423e('0x43')]:_0x4470fe[_0x423e('0x17d')][_0x423e('0x43')],isNotNull(_0x4470fe[_0x423e('0x183')])?_0x4470fe[_0x423e('0x183')]['trim']()||'':'',_0x4470fe[_0x423e('0x185')]>0x0?_0x1929fc[_0x423e('0x159')][_0x423e('0x186')](_0x4470fe[_0x423e('0x185')]):_0x1929fc[_0x423e('0x159')]),'callerid':_0x5438c5,'Exten':_0x423e('0x107'),'Context':_0x423e('0x187'),'Priority':'1','variable':_0x506596,'timeout':(_0x4470fe[_0x423e('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x420bd0})[_0x423e('0x9b')](function(_0x354956){return _0x5ab6b7(_0x354956);})[_0x423e('0x9a')](function(_0x29e211){_0x4470fe[_0x423e('0x189')]+=0x1;var _0x57d468=new History(_0x27a1e6[_0x423e('0x23')][_0x420bd0]);logger[_0x423e('0x5f')](util[_0x423e('0x41')](_0x423e('0x18a'),JSON[_0x423e('0x71')](_0x29e211)));_0x57d468['state']=0xe;_0x57d468[_0x423e('0x6b')]=_0x423e('0x18b');_0x57d468[_0x423e('0x6d')]=moment()[_0x423e('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x57d468[_0x423e('0x6c')]=_0x57d468['starttime'];hopperUtils['createHistory'](_0x57d468)[_0x423e('0x9a')](loggerCatch(_0x423e('0x18c')));_0x27a1e6[_0x423e('0xc5')](_0x57d468)[_0x423e('0x9a')](loggerCatch(_0x423e('0x18c')))[_0x423e('0xf4')](function(){delete _0x27a1e6['actions'][_0x420bd0];return _0x427000(msgResponse('originate',_0x423e('0x82'),_0x423e('0x18d')));});});});};Dialer[_0x423e('0x18')][_0x423e('0x18e')]=function(_0x456f5d,_0x44206c,_0x40ca60){var _0x21efb2=new History(_0x44206c);if(_0x21efb2[_0x423e('0x126')]+_0x21efb2[_0x423e('0x119')]+_0x21efb2[_0x423e('0x11a')]+_0x21efb2[_0x423e('0x11b')]+_0x21efb2[_0x423e('0xd0')]+_0x21efb2['countabandonedretry']+_0x21efb2[_0x423e('0x11c')]+_0x21efb2[_0x423e('0x11d')]>=_0x40ca60['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x456f5d){case 0x3:if(_0x21efb2[_0x423e('0x11a')]>=_0x40ca60[_0x423e('0x18f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x21efb2['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x423e('0x122')](_0x40ca60['dialNoAnswerRetryFrequency'],'minutes')['format'](_0x423e('0xba')),'ContactId':_0x21efb2['ContactId'],'ListId':_0x21efb2['ListId'],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x190')));break;case 0x5:if(_0x21efb2['countbusyretry']>=_0x40ca60['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x423e('0xd4')]({'active':![],'countbusyretry':_0x21efb2[_0x423e('0x126')]+=0x1,'scheduledat':moment()['add'](_0x40ca60[_0x423e('0x191')],_0x423e('0xd6'))[_0x423e('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2['ListId'],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x192')));break;case 0x8:if(_0x21efb2[_0x423e('0x119')]>=_0x40ca60[_0x423e('0x193')]-0x1){return!![];}hopperUtils[_0x423e('0xd4')]({'active':![],'countcongestionretry':_0x21efb2['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x40ca60[_0x423e('0x194')],_0x423e('0xd6'))[_0x423e('0x41')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2[_0x423e('0xd8')],'VoiceQueueId':_0x21efb2['VoiceQueueId']||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x195')));break;case 0x0:if(_0x21efb2[_0x423e('0x11b')]>=_0x40ca60[_0x423e('0x196')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x21efb2['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x423e('0x122')](_0x40ca60[_0x423e('0x197')],_0x423e('0xd6'))['format'](_0x423e('0xba')),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2['ListId'],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x21efb2[_0x423e('0xd0')]>=_0x40ca60[_0x423e('0x198')]-0x1){return!![];}hopperUtils[_0x423e('0xd4')]({'active':![],'countdropretry':_0x21efb2[_0x423e('0xd0')]+=0x1,'scheduledat':moment()['add'](_0x40ca60[_0x423e('0xd5')],'minutes')[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2[_0x423e('0xd8')],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0xdb')));break;case 0xb:if(_0x21efb2[_0x423e('0xe3')]>=_0x40ca60[_0x423e('0x199')]-0x1){return!![];}hopperUtils[_0x423e('0xd4')]({'active':![],'countabandonedretry':_0x21efb2[_0x423e('0xe3')]+=0x1,'scheduledat':moment()[_0x423e('0x122')](_0x40ca60[_0x423e('0xe5')],_0x423e('0xd6'))[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2[_0x423e('0xd8')],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2[_0x423e('0xda')]||undefined})['catch'](loggerCatch(_0x423e('0xe7')));break;case 0x13:if(_0x21efb2[_0x423e('0x11c')]>=_0x40ca60[_0x423e('0x120')]-0x1){return!![];}hopperUtils[_0x423e('0xd4')]({'active':![],'countmachineretry':_0x21efb2[_0x423e('0x11c')]+=0x1,'scheduledat':moment()[_0x423e('0x122')](_0x40ca60[_0x423e('0x123')],_0x423e('0xd6'))[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2[_0x423e('0xd8')],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x21efb2[_0x423e('0x11d')]>=_0x40ca60[_0x423e('0x19a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x21efb2[_0x423e('0x11d')]+=0x1,'scheduledat':moment()[_0x423e('0x122')](_0x40ca60[_0x423e('0x19b')],_0x423e('0xd6'))[_0x423e('0x41')](_0x423e('0xba')),'ContactId':_0x21efb2[_0x423e('0xd7')],'ListId':_0x21efb2[_0x423e('0xd8')],'VoiceQueueId':_0x21efb2[_0x423e('0xd9')]||undefined,'CampaignId':_0x21efb2['CampaignId']||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x19c')));break;default:return!![];}};Dialer[_0x423e('0x18')][_0x423e('0x102')]=function(_0x333fd6,_0x8231c9,_0x3d8c45){var _0xcd049b=this;var _0x3b3d5d=new History(_0x333fd6);var _0x360521=![];var _0x2c8ebb;var _0x2346ba;return new Promise(function(_0x18063b,_0x4b011b){if(_['isUndefined'](_0x8231c9)&&typeof _0x8231c9!==_0x423e('0x19d')){return _0x4b011b(msgResponse(_0x423e('0x19e'),_0x423e('0x8c'),_0x423e('0x19f')));}if(_[_0x423e('0x3e')](_0x3d8c45)&&typeof _0x3d8c45!=='object'){return _0x4b011b(msgResponse('[callProgressDetecting]',_0x423e('0x8c'),_0x423e('0x1a0')));}hopperUtils[_0x423e('0xd2')](_0x3b3d5d,_0x3d8c45[_0x423e('0xbe')],_0x8231c9)[_0x423e('0x9b')](function(_0x4ca0ca){if(_0x4ca0ca[_0x423e('0xd3')]==0x1)_0x360521=!![];switch(_0x3d8c45[_0x423e('0xbe')]){case'0':_0x8231c9['outboundNoSuchCallsDay']+=0x1;_0x3b3d5d['state']=0x0;_0x3b3d5d[_0x423e('0x6b')]='NoSuchNumber';_0x3b3d5d['countnosuchnumberretry']+=0x1;_0x3b3d5d[_0x423e('0xe4')]+=0x1;ami[_0x423e('0x116')]('custom:agentnosuchnumber',ut[_0x423e('0x117')](_0x333fd6,'nosuchnumber'));_0x2c8ebb=_0x8231c9[_0x423e('0x197')];_0x2346ba=_0x8231c9['callAdditionalPhoneAfterMin'];hopperUtils[_0x423e('0xc3')](_0x3b3d5d)['catch'](loggerCatch(_0x423e('0x118')));if(_0xcd049b[_0x423e('0x18e')](0x0,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d['countnosuchnumberretry']>=_0x8231c9['dialNoSuchNumberMaxRetry']){_0xcd049b['createStateFinal'](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1a1'));}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1a1'));}}break;case'3':_0x8231c9[_0x423e('0x1a3')]+=0x1;_0x3b3d5d[_0x423e('0x6a')]=0x3;_0x3b3d5d[_0x423e('0x6b')]=_0x423e('0x1a4');_0x3b3d5d[_0x423e('0x11a')]+=0x1;_0x3b3d5d[_0x423e('0xe4')]+=0x1;var _0x47e6d4=ut['buildNoAnswerEventPayload'](_0x333fd6,_0x8231c9);ami[_0x423e('0x116')](_0x423e('0x1a5'),_0x47e6d4);_0x2c8ebb=_0x8231c9[_0x423e('0x1a6')];_0x2346ba=_0x8231c9[_0x423e('0xd1')];hopperUtils[_0x423e('0xc3')](_0x3b3d5d)['catch'](loggerCatch(_0x423e('0x1a7')));if(_0xcd049b['checkRetriveMax'](0x3,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d[_0x423e('0x11a')]>=_0x8231c9['dialNoAnswerMaxRetry']){_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1a8'));}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1a8'));}}break;case'5':_0x8231c9[_0x423e('0x1a9')]+=0x1;_0x3b3d5d[_0x423e('0x6a')]=0x5;_0x3b3d5d['statedesc']='Busy';_0x3b3d5d['countbusyretry']+=0x1;_0x3b3d5d[_0x423e('0xe4')]+=0x1;ami[_0x423e('0x116')](_0x423e('0x1aa'),ut[_0x423e('0x117')](_0x333fd6,_0x423e('0x1ab')));_0x2c8ebb=_0x8231c9[_0x423e('0x191')];_0x2346ba=_0x8231c9[_0x423e('0xd1')];hopperUtils[_0x423e('0xc3')](_0x3b3d5d)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xcd049b[_0x423e('0x18e')](0x5,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d[_0x423e('0x126')]>=_0x8231c9[_0x423e('0x1ac')]){_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1ad'));}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1ad'));}}break;case'8':_0x8231c9[_0x423e('0x1ae')]+=0x1;_0x3b3d5d['state']=0x8;_0x3b3d5d[_0x423e('0x6b')]=_0x423e('0x1af');_0x3b3d5d[_0x423e('0x119')]+=0x1;_0x3b3d5d[_0x423e('0xe4')]+=0x1;_0x2c8ebb=_0x8231c9['dialCongestionRetryFrequency'];_0x2346ba=_0x8231c9[_0x423e('0xd1')];ami[_0x423e('0x116')](_0x423e('0x1b0'),ut[_0x423e('0x117')](_0x333fd6,_0x423e('0x1b1')));hopperUtils['createHistory'](_0x3b3d5d)[_0x423e('0x9a')](loggerCatch(_0x423e('0x1b2')));if(_0xcd049b[_0x423e('0x18e')](0x8,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d[_0x423e('0x119')]>=_0x8231c9[_0x423e('0x193')]){_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1b3'));}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1b3'));}}break;case'11':_0x8231c9[_0x423e('0x1b4')]+=0x1;_0x3b3d5d['state']=0xb;_0x3b3d5d['statedesc']='Abandoned';_0x3b3d5d[_0x423e('0xe3')]+=0x1;_0x3b3d5d['countglobal']+=0x1;_0x2c8ebb=_0x8231c9[_0x423e('0xe5')];_0x2346ba=_0x8231c9['callAdditionalPhoneAfterMin'];hopperUtils[_0x423e('0xc3')](_0x3b3d5d)['catch'](loggerCatch(_0x423e('0x1b5')));if(_0xcd049b['checkRetriveMax'](0xb,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d[_0x423e('0xe3')]>=_0x8231c9[_0x423e('0x199')]){_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,'reason\x2011\x20abandoned');}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1b6'));}}break;case'20':_0x8231c9[_0x423e('0x1b7')]+=0x1;_0x3b3d5d[_0x423e('0x6a')]=0x14;_0x3b3d5d[_0x423e('0x6b')]=_0x423e('0x1b8');_0x3b3d5d[_0x423e('0x11d')]+=0x1;_0x3b3d5d['countglobal']+=0x1;_0x2c8ebb=_0x8231c9[_0x423e('0x19b')];_0x2346ba=_0x8231c9['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentreject',ut['buildObj'](_0x333fd6,_0x423e('0x1b9')));hopperUtils['createHistory'](_0x3b3d5d)[_0x423e('0x9a')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xcd049b[_0x423e('0x18e')](0x14,_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d['countagentrejectretry']>=_0x8231c9[_0x423e('0x19a')]){_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1ba'));}else{_0xcd049b[_0x423e('0x1a2')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x423e('0x1ba'));}}break;default:_0x8231c9['outboundUnknownCallsDay']+=0x1;_0x3b3d5d[_0x423e('0x6a')]=0xc;_0x3b3d5d[_0x423e('0x6b')]=_0x3d8c45[_0x423e('0xbe')];_0x2c8ebb=_0x8231c9['dialAgentRejectRetryFrequency'];_0x2346ba=_0x8231c9[_0x423e('0xd1')];hopperUtils[_0x423e('0xc3')](_0x3b3d5d)[_0x423e('0x9a')](loggerCatch(_0x423e('0x1bb')));if(_0xcd049b['checkRetriveMax'](_0x3d8c45[_0x423e('0xbe')],_0x333fd6,_0x8231c9)&&!_0x360521){if(_0x3b3d5d[_0x423e('0x126')]+_0x3b3d5d[_0x423e('0x119')]+_0x3b3d5d[_0x423e('0x11a')]+_0x3b3d5d[_0x423e('0x11b')]+_0x3b3d5d[_0x423e('0xd0')]+_0x3b3d5d[_0x423e('0xe3')]+_0x3b3d5d['countmachineretry']+_0x3b3d5d[_0x423e('0x11d')]>=_0x8231c9[_0x423e('0x11e')]){_0xcd049b['stateGlobal'](_0x3b3d5d,_0x18063b,_0x4b011b,_0x3d8c45[_0x423e('0xbe')]);}else{_0xcd049b[_0x423e('0x121')](_0x3b3d5d,_0x18063b,_0x4b011b,_0x3d8c45[_0x423e('0xbe')]);}}}})[_0x423e('0x9b')](function(){if(_0x360521){hopperUtils[_0x423e('0xdf')](_0x3b3d5d,_0x2c8ebb,_0x2346ba)[_0x423e('0x9b')](function(){return _0x18063b(0x1);});}});});};Dialer['prototype'][_0x423e('0x1a2')]=function(_0x4c4b83,_0x4ffd5f,_0x549d57,_0x426bea){var _0x3e5a52=new Final(_0x4c4b83);_0x3e5a52[_0x423e('0x6a')]=0xf;_0x3e5a52[_0x423e('0x6b')]='Global';this[_0x423e('0x121')](_0x3e5a52,_0x4ffd5f,_0x549d57,_0x426bea);};Dialer[_0x423e('0x18')][_0x423e('0x121')]=function(_0x54fd2b,_0x3adb89,_0x3f2949,_0x2c5138){hopperUtils[_0x423e('0xc5')](_0x54fd2b)[_0x423e('0x9b')](function(){return _0x3adb89(msgResponse('[callProgressDetecting]',_0x423e('0x1bc'),_0x2c5138));})[_0x423e('0x9a')](function(){return _0x3f2949(msgResponse(_0x423e('0x1bd'),_0x423e('0x8c'),_0x423e('0x1be')));});};Dialer[_0x423e('0x18')]['predictive']=function(_0x9e634d){var _0xd9a99b=_0x9e634d[_0x423e('0x1bf')]/0x64;var _0x5de58e=_0x9e634d[_0x423e('0xcc')]/(_0x9e634d[_0x423e('0xcc')]+_0x9e634d[_0x423e('0xbd')]);var _0x5798b0=Math['round'](_0x9e634d[_0x423e('0x1c0')]*(_0x9e634d[_0x423e('0x1c1')]/0x64));var _0x1248e3=Math[_0x423e('0x1c2')](_0x9e634d[_0x423e('0x1c0')]*(_0x9e634d[_0x423e('0x1c3')]/0x64));var _0x9d3128=_0x9e634d['available']+_0x9e634d[_0x423e('0x1c4')];var _0x2df85d=Math[_0x423e('0x1c5')](_0x9e634d[_0x423e('0x54')]*_0x9e634d[_0x423e('0x57')]*_0x9e634d[_0x423e('0x1c6')]*_0x9e634d[_0x423e('0x1c7')]);if(_[_0x423e('0x3e')](_0x9e634d[_0x423e('0x27')])){if(!_[_0x423e('0x3e')](_0x9e634d[_0x423e('0x26')])){_0x9e634d[_0x423e('0x26')]=undefined;loggerPredictive[_0x423e('0x5f')](_0x423e('0x1c8'),_0x423e('0x1c9'));}if(!_[_0x423e('0x3e')](_0x9e634d[_0x423e('0x5e')])){loggerPredictive[_0x423e('0x5f')](_0x423e('0x1c8'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x9e634d[_0x423e('0x5e')]);_0x9e634d[_0x423e('0x5e')]=undefined;}_0x9e634d[_0x423e('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x9e634d[_0x423e('0x43')],_0x423e('0x1ca'),_0x9e634d[_0x423e('0x27')]);this[_0x423e('0xad')](_0x9e634d,0x1);}else if(ifInterval(_0x9e634d['dialPredictiveInterval'],_0x9e634d[_0x423e('0x27')])){this[_0x423e('0xad')](_0x9e634d,0x1);loggerPredictiveCalls[_0x423e('0x45')](_0x423e('0x1cb'),_0x9e634d[_0x423e('0x27')],_0x9e634d[_0x423e('0x43')]);_0x9e634d[_0x423e('0x54')]=0x0;_0x9e634d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xd9a99b<_0x5de58e&&_0x9e634d[_0x423e('0x1cc')]===_0x423e('0x1cd')){clearPredictiveAttributes(_0x9e634d);loggerPredictive[_0x423e('0x45')](_0x423e('0x1ce'),_0x423e('0x1cf'),_0x5de58e,_0x423e('0x27'),_0x9e634d['name']);}else if(_0x2df85d<_0x9e634d['predictiveIntervalErlangCallsDroppedCalls']&&_0x9e634d[_0x423e('0x1cc')]===_0x423e('0x1cd')){clearPredictiveAttributes(_0x9e634d);loggerPredictive[_0x423e('0x45')](_0x423e('0x1d0'),'Max\x20Drop\x20',_0x2df85d,'Drop\x20in\x20this\x20interval',_0x9e634d[_0x423e('0x1d1')],_0x423e('0x27'),_0x9e634d[_0x423e('0x43')]);}else if(!ifInterval(_0x9e634d[_0x423e('0x1d2')],_0x9e634d[_0x423e('0x27')])&&_[_0x423e('0x3e')](_0x9e634d[_0x423e('0x26')])&&!_[_0x423e('0x3e')](_0x9e634d['startProgressive'])){_0x9e634d[_0x423e('0x26')]=moment()[_0x423e('0x41')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x423e('0x45')](_0x9e634d[_0x423e('0x43')],_0x423e('0x1d3'),_0x9e634d[_0x423e('0x26')]);hopperUtils[_0x423e('0x1d4')](_0x9e634d[_0x423e('0x1d2')])[_0x423e('0x9b')](this[_0x423e('0x1d5')](_0x9e634d))['then'](mergeDataErlangB(_0x9e634d))[_0x423e('0x9b')](this['startMethodPredictive'](_0x9e634d))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x9e634d));}else if(!ifInterval(_0x9e634d[_0x423e('0x1d2')],_0x9e634d[_0x423e('0x26')])){_0x9e634d[_0x423e('0x1d1')]=0x0;_0x9e634d[_0x423e('0x26')]=moment()['format'](_0x423e('0xba'));loggerPredictive[_0x423e('0x45')](_0x9e634d['name'],_0x423e('0x1d6'),_0x9e634d[_0x423e('0x26')]);clearInterval(_0x9e634d[_0x423e('0x5e')]);_0x9e634d[_0x423e('0x5e')]=undefined;hopperUtils['avgHandleTime'](_0x9e634d[_0x423e('0x1d2')])['then'](this[_0x423e('0x1d5')](_0x9e634d))[_0x423e('0x9b')](mergeDataErlangB(_0x9e634d))[_0x423e('0x9b')](this['startMethodPredictive'](_0x9e634d))[_0x423e('0x9a')](loggerCatchPredictive(_0x423e('0x1d7'),_0x9e634d));}else if(_0x9e634d[_0x423e('0x1c0')]&&_0x9d3128<_0x9e634d['predictiveIntervalAvailable']-_0x1248e3){clearPredictiveAttributes(_0x9e634d);loggerPredictive[_0x423e('0x45')](_0x9e634d[_0x423e('0x43')],_0x423e('0x1d8'),_0x9d3128,_0x423e('0x1d9'),_0x9e634d[_0x423e('0x1c0')],'-',_0x1248e3,'=',_0x9e634d[_0x423e('0x1c0')]-_0x1248e3,')');}else if(_0x9e634d[_0x423e('0x1c0')]&&_0x9d3128>_0x9e634d[_0x423e('0x1c0')]+_0x5798b0){clearPredictiveAttributes(_0x9e634d);loggerPredictive[_0x423e('0x45')](_0x9e634d[_0x423e('0x43')],_0x423e('0x1d8'),_0x9d3128,_0x423e('0x1da'),_0x9e634d[_0x423e('0x1c0')],'+',_0x5798b0,'=',_0x9e634d[_0x423e('0x1c0')]+_0x5798b0,')');}};Dialer['prototype'][_0x423e('0x1d5')]=function(_0x3ecf85){var _0x4964ba=this;return function(_0x49bd68){return new Promise(function(_0x76c422,_0x1f68ed){_[_0x423e('0x5a')](_0x3ecf85,_0x49bd68[0x0]);if(checkGetDataPredictive(_0x49bd68[0x0])){var _0x1500b7=_0x3ecf85['predictiveIntervalAvailable']=_0x3ecf85[_0x423e('0x1c4')]+_0x3ecf85[_0x423e('0x134')];var _0x36480d=_0x3ecf85['dialPredictiveInterval']*0x3c;var _0x443de7=_0x49bd68[0x0][_0x423e('0x4d')]+_0x49bd68[0x0][_0x423e('0x4b')];var _0xcf2a1d=(_0x49bd68[0x0][_0x423e('0x1db')]+_0x49bd68[0x0][_0x423e('0x1dc')]+_0x49bd68[0x0][_0x423e('0x49')])/_0x49bd68[0x0][_0x423e('0x1dd')];_0x3ecf85[_0x423e('0x1c6')]=_0xcf2a1d>0x0?_0xcf2a1d:0x1;switch(_0x3ecf85[_0x423e('0x1cc')]){case _0x423e('0x1cd'):var _0xaca3fa=_0x3ecf85[_0x423e('0x1bf')]/0x64;return _0x4964ba['abandonmentRate'](_0x1500b7,_0x36480d,_0x443de7,_0xcf2a1d,_0xaca3fa)[_0x423e('0x9b')](function(_0x21da8a){return _0x76c422(_0x21da8a);});case'agentBusyFactor':var _0x178cd7=_0x3ecf85[_0x423e('0x1bf')]/0x64;return _0x4964ba[_0x423e('0x1de')](_0x1500b7,_0x36480d,_0x443de7,_0xcf2a1d,_0x178cd7)[_0x423e('0x9b')](function(_0x2d9396){return _0x76c422(_0x2d9396);});default:return _0x1f68ed(msgResponse(_0x423e('0x1df'),_0x423e('0x8c'),_0x423e('0x1e0')));}}else{return _0x1f68ed(msgResponse('[getDataPredictive]','Failure',_0x423e('0x1e1')));}});};};Dialer[_0x423e('0x18')][_0x423e('0x1e2')]=function(_0x289a89){var _0xddd315=this;return function(_0x1b0208){return new Promise(function(_0x5400d5,_0xfd31ad){_[_0x423e('0x5a')](_0x289a89,_0x1b0208[0x0]);if(checkGetDataPredictive(_0x1b0208[0x0])){loggerPredictive['info'](JSON[_0x423e('0x71')](_0x1b0208[0x0]));if(_0x289a89['dialPredictiveOptimization']===_0x423e('0x1cd')){return _0xddd315[_0x423e('0x14c')](_0x289a89['id'])[_0x423e('0x9b')](function(_0x4668d9){var _0x54a1a9=_0x289a89['loggedIn']-_0x4668d9[0x0][_0x423e('0x1e3')];var _0x4bd633=_0x289a89[_0x423e('0x1d2')]*0x3c;var _0x309570=_0x1b0208[0x0][_0x423e('0x4d')]+_0x1b0208[0x0]['predictiveIntervalAvgHoldtime'];var _0x3fb1ca=(_0x1b0208[0x0][_0x423e('0x1db')]+_0x1b0208[0x0][_0x423e('0x1dc')]+_0x1b0208[0x0][_0x423e('0x49')])/_0x1b0208[0x0][_0x423e('0x1dd')];var _0x2e33b0=_0x289a89['dialPredictiveOptimizationPercentage']/0x64;_0x289a89[_0x423e('0x1e4')]=_0x4668d9[0x0][_0x423e('0x1e3')]||0x0;_0x289a89[_0x423e('0x1c6')]=_0x3fb1ca>0x0?_0x3fb1ca:0x1;return _0xddd315[_0x423e('0x1e5')](_0x54a1a9,_0x4bd633,_0x309570,_0x3fb1ca,_0x2e33b0);})[_0x423e('0x9b')](function(_0x2d0fa2){return _0x5400d5(_0x2d0fa2);})['catch'](function(_0x1a2ea2){return _0xfd31ad(msgResponse(_0x423e('0x1e6'),'Failure',JSON[_0x423e('0x71')](_0x1a2ea2)));});}if(_0x289a89[_0x423e('0x1cc')]===_0x423e('0x1e7')){return _0xddd315[_0x423e('0x14c')](_0x289a89['id'])[_0x423e('0x9b')](function(_0x375211){var _0x50eff0=_0x289a89['loggedIn']-_0x375211[0x0][_0x423e('0x1e3')];var _0x3109a0=_0x289a89['dialPredictiveInterval']*0x3c;var _0x201259=_0x1b0208[0x0][_0x423e('0x4d')]+_0x1b0208[0x0][_0x423e('0x4b')];var _0x578391=(_0x1b0208[0x0]['predictiveIntervalAnsweredCalls']+_0x1b0208[0x0][_0x423e('0x1dc')]+_0x1b0208[0x0][_0x423e('0x49')])/_0x1b0208[0x0][_0x423e('0x1dd')];var _0x43538d=_0x289a89[_0x423e('0x1bf')]/0x64;_0x289a89['predictiveIntervalPauses']=_0x375211[0x0][_0x423e('0x1e3')]||0x0;_0x289a89[_0x423e('0x1c6')]=_0x578391>0x0?_0x578391:0x1;return _0xddd315[_0x423e('0x1de')](_0x50eff0,_0x3109a0,_0x201259,_0x578391,_0x43538d);})[_0x423e('0x9b')](function(_0x485006){return _0x5400d5(_0x485006);})[_0x423e('0x9a')](function(_0x270c1b){return _0xfd31ad(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x270c1b)));});}}else{return _0xfd31ad(msgResponse(_0x423e('0x1df'),'Failure',_0x423e('0x1e1')));}});};};Dialer[_0x423e('0x18')]['startMethodPredictive']=function(_0xa993ba){var _0x267a71=this;return function(){var _0x511de4=0x0;var _0x1d5381=Math[_0x423e('0x1c5')](_0xa993ba[_0x423e('0x55')]*0x3e8);if(_0x1d5381>0x0){_0x1d5381=_0x1d5381<0x64?0x64:_0x1d5381;loggerPredictive[_0x423e('0x45')](_0xa993ba[_0x423e('0x43')],'one\x20call\x20every:',_0x1d5381,_0x423e('0x1e8'));_0xa993ba[_0x423e('0x5e')]=setInterval(function(){_0x267a71[_0x423e('0x5e')](_0xa993ba);loggerPredictiveCalls[_0x423e('0x45')](_0x423e('0x1e9'),_0x511de4+=0x1);},_0x1d5381);}else{loggerPredictive[_0x423e('0x45')](_0xa993ba[_0x423e('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x423e('0x18')][_0x423e('0x1ea')]=function(_0x159381,_0x8ea2c1){var _0x36cd0d=this;return function(_0xeaa45f){if(_[_0x423e('0xf6')](_0xeaa45f)){if(_['isNil'](_0x8ea2c1[_0x423e('0x1eb')])||!_0x8ea2c1[_0x423e('0x1ec')]){if(_0x159381[_0x423e('0xab')]===_0x423e('0x9')){_0x159381[_0x423e('0x6e')]=_['isUndefined'](_0x159381[_0x423e('0x6e')])?!![]:_0x159381['queueStatusComplete'];var _0x4c346a=uuid['v4']();_0x36cd0d[_0x423e('0x23')][_0x4c346a]=new Action(_0x159381,_0x8ea2c1,_0x4c346a);loggerBooked[_0x423e('0x45')]('[booked][checkContactBlack]',_0x4c346a,_0x423e('0x1ed'),JSON[_0x423e('0x71')](_0x159381['queueStatusComplete']),_0x423e('0x1ee'),_0x159381[_0x423e('0x43')]);if(_0x159381['queueStatusComplete']){_0x159381[_0x423e('0x6e')]=![];_0x36cd0d[_0x423e('0x29')][_0x36cd0d[_0x423e('0x23')][_0x4c346a]['queue']]=[];ami[_0x423e('0x93')]({'actionid':_0x4c346a,'action':_0x423e('0x1ef'),'queue':_0x159381[_0x423e('0x43')]})[_0x423e('0x9a')](function(){_0x36cd0d['updateOriginated'](_0x159381);hopperUtils[_0x423e('0xd4')]({'active':![],'ContactId':_0x36cd0d[_0x423e('0x23')][_0x4c346a]['ContactId'],'ListId':_0x36cd0d['actions'][_0x4c346a]['ListId'],'VoiceQueueId':_0x36cd0d['actions'][_0x4c346a][_0x423e('0xd9')]||undefined,'CampaignId':_0x36cd0d[_0x423e('0x23')][_0x4c346a][_0x423e('0xda')]||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x1f0')));delete _0x36cd0d[_0x423e('0x23')][_0x4c346a];});}else{loggerBooked[_0x423e('0x45')]('[booked][checkContactBlack][else]',JSON[_0x423e('0x71')](_0x159381[_0x423e('0x6e')]),'Queue:\x20',_0x159381[_0x423e('0x43')]);_0x36cd0d[_0x423e('0xc8')](_0x159381);hopperUtils[_0x423e('0xd4')]({'active':![],'ContactId':_0x36cd0d[_0x423e('0x23')][_0x4c346a][_0x423e('0xd7')],'ListId':_0x36cd0d[_0x423e('0x23')][_0x4c346a]['ListId'],'VoiceQueueId':_0x36cd0d['actions'][_0x4c346a][_0x423e('0xd9')]||undefined,'CampaignId':_0x36cd0d[_0x423e('0x23')][_0x4c346a]['CampaignId']||undefined})[_0x423e('0x9a')](loggerCatch(_0x423e('0x1f0')));delete _0x36cd0d[_0x423e('0x23')][_0x4c346a];}}else{return _0x36cd0d[_0x423e('0x156')](_0x159381,_0x8ea2c1);}}else{if(utils[_0x423e('0xca')](undefined,_0x8ea2c1[_0x423e('0x1f1')])<_0x159381['dialRecallMeTimeout']*0x3c){if(_0x8ea2c1[_0x423e('0x143')]&&!_0x8ea2c1[_0x423e('0x143')][_0x423e('0x1f2')]){_0x36cd0d['preview'][_0x423e('0xf2')](_0x8ea2c1['id'])[_0x423e('0xf4')](function(){_0x36cd0d[_0x423e('0xc8')](_0x159381);});}else{hopperUtils[_0x423e('0x1f3')]({'active':![]},_0x8ea2c1['id'],0x1)['finally'](function(){_0x36cd0d[_0x423e('0xc8')](_0x159381);});}}else{_0x159381[_0x423e('0x1f4')]+=0x1;_0x36cd0d[_0x423e('0xc8')](_0x159381);if(_0x159381['dialRecallInQueue']){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x8ea2c1[_0x423e('0xd7')],'ListId':_0x8ea2c1[_0x423e('0xd8')],'VoiceQueueId':_0x8ea2c1[_0x423e('0xd9')]||undefined,'CampaignId':_0x8ea2c1[_0x423e('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x423e('0xc3')](createObjHistory(_0x159381,_0x8ea2c1,utils[_0x423e('0x64')]['QUEUE_RECALL'],0x17,_0x423e('0x1f5')))[_0x423e('0x9a')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x36cd0d[_0x423e('0x10f')](createObjHistory(_0x159381,_0x8ea2c1,utils[_0x423e('0x64')][_0x423e('0x1f6')],0x16,'RecallFailedTimeout'),_0x423e('0x1f7'),_0x423e('0x1f8'));}}}}else{_0x159381['outboundBlacklistCallsDay']+=0x1;_0x36cd0d[_0x423e('0x10f')](createObjHistory(_0x159381,_0x8ea2c1,utils[_0x423e('0x64')][_0x423e('0x1f9')],0xd,_0x423e('0x1fa')),_0x423e('0x1fb'),_0x423e('0x1fc'));throw _0x423e('0x1fd');}};};Dialer[_0x423e('0x18')]['handleIvr']=function(_0x1fcd1e){var _0x4a0192=this;var _0x1edb2a=_0x1fcd1e[_0x423e('0x1fe')]-_0x1fcd1e['originated']-_0x1fcd1e['temp'];emitCampaignSummary(_0x1fcd1e);if(_0x1edb2a>0x0){if(_0x1edb2a>this[_0x423e('0x21')]){_0x1edb2a=this[_0x423e('0x21')];}_0x1fcd1e[_0x423e('0x1ff')]+=_0x1edb2a;hopperUtils['getContactDialerIvr'](_0x1fcd1e['id'],_0x1edb2a,_0x1fcd1e[_0x423e('0x200')],_0x1fcd1e)[_0x423e('0x9b')](function(_0x276b23){_0x1fcd1e[_0x423e('0x1ff')]-=_0x1edb2a;_0x1fcd1e[_0x423e('0x1ff')]=_0x1fcd1e[_0x423e('0x1ff')]>0x0?_0x1fcd1e['temp']:0x0;if(!utils[_0x423e('0x201')](_0x276b23)){_0x1fcd1e[_0x423e('0x69')]=utils[_0x423e('0x64')][_0x423e('0x68')];logger['info'](_0x423e('0x202')+_0x1fcd1e[_0x423e('0x43')]);}else{_0x1fcd1e[_0x423e('0x7c')]+=_0x276b23[_0x423e('0xf8')];_0x1fcd1e[_0x423e('0x69')]=utils[_0x423e('0x64')][_0x423e('0x203')];for(var _0xfede38=0x0;_0xfede38<_0x276b23[_0x423e('0xf8')];_0xfede38+=0x1){_0x1fcd1e[_0x423e('0x204')]+=0x1;if(_[_0x423e('0xec')](_0x276b23[_0xfede38])||_['isNil'](_0x276b23[_0xfede38]['Contact'])||_['isNil'](_0x276b23[_0xfede38][_0x423e('0x159')])){_0x4a0192['emptyContact'](_0x423e('0x205'),_0x1fcd1e,_0x276b23[_0xfede38]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x423e('0x72')](_0x276b23[_0xfede38],[_0x423e('0xda'),'phone']))[_0x423e('0x9b')](_0x4a0192[_0x423e('0x1ea')](_0x1fcd1e,_0x276b23[_0xfede38]))[_0x423e('0x9a')](_0x4a0192[_0x423e('0x14f')]('[actionOriginateIvr]\x20',_0x1fcd1e));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x1fcd1e,_0x1edb2a));}};Dialer[_0x423e('0x18')]['handlePower']=function(_0x468c63,_0x7d66fe){var _0x280a30=this;var _0x4a6089=[];if(_0x7d66fe<0x1||_0x468c63['dialMethod']===_0x423e('0x9')){_0x7d66fe=0x1;}var _0x371efe=Math[_0x423e('0x1c5')](_0x468c63[_0x423e('0x134')]*_0x7d66fe)-_0x468c63['originated']-_0x468c63[_0x423e('0x1ff')];if(_0x468c63[_0x423e('0x206')]>0x0){var _0xedd33=_0x468c63[_0x423e('0x206')]-_0x468c63['originated']-_0x468c63[_0x423e('0x1c4')]-_0x468c63[_0x423e('0x1ff')]-_0x468c63[_0x423e('0x136')];if(_0x371efe>_0xedd33){_0x371efe=_0xedd33;}}if(_0x371efe>0x0){if(_0x468c63[_0x423e('0xab')]===_0x423e('0x9')){_0x371efe=0x1;}if(_0x371efe>this[_0x423e('0x21')]){_0x371efe=this[_0x423e('0x21')];}_0x468c63[_0x423e('0x1ff')]+=_0x371efe;for(var _0x4be70d in this[_0x423e('0x1f')]){if(typeof this[_0x423e('0x1f')][_0x4be70d]!==_0x423e('0xa5')){if(this[_0x423e('0x1f')][_0x4be70d][_0x423e('0x6a')]===_0x423e('0x207')&&this[_0x423e('0x1f')][_0x4be70d][_0x423e('0x83')]===_0x423e('0x141')){_0x4a6089[_0x423e('0x92')](this['agents'][_0x4be70d]['id']);}}}hopperUtils[_0x423e('0x208')](_0x468c63,_0x4a6089,_0x371efe)[_0x423e('0x9b')](function(_0x40c88a){_0x468c63[_0x423e('0x1ff')]-=_0x371efe;_0x468c63[_0x423e('0x1ff')]=_0x468c63[_0x423e('0x1ff')]>0x0?_0x468c63[_0x423e('0x1ff')]:0x0;if(!utils['checkContactEmpty'](_0x40c88a)){hopperUtils[_0x423e('0x209')](_0x468c63)['then'](sendMessageReschedule(_0x468c63))[_0x423e('0x9a')](loggerCatch(_0x423e('0x20a')));}else{_0x468c63[_0x423e('0x7c')]+=_0x40c88a['length'];_0x468c63[_0x423e('0x69')]=_0x468c63[_0x423e('0xab')]==='booked'?utils[_0x423e('0x64')][_0x423e('0x137')]:utils['CAMPAIGN_STATUS'][_0x423e('0x203')];for(var _0x1ed234=0x0;_0x1ed234<_0x40c88a[_0x423e('0xf8')];_0x1ed234+=0x1){if(_[_0x423e('0xec')](_0x40c88a[_0x1ed234])||_[_0x423e('0xec')](_0x40c88a[_0x1ed234][_0x423e('0x170')])||_[_0x423e('0xec')](_0x40c88a[_0x1ed234][_0x423e('0x159')])){_0x280a30[_0x423e('0x150')]('[actionOriginate]\x20',_0x468c63,_0x40c88a[_0x1ed234]);}else{hopperUtils[_0x423e('0x20b')](_[_0x423e('0x72')](_0x40c88a[_0x1ed234],[_0x423e('0xd9'),_0x423e('0x159')]))[_0x423e('0x9b')](_0x280a30[_0x423e('0x1ea')](_0x468c63,_0x40c88a[_0x1ed234]))['catch'](_0x280a30[_0x423e('0x14f')](_0x423e('0x205'),_0x468c63));}}}})['catch'](loggerGetContactDialer(_0x423e('0x20c'),_0x468c63,_0x371efe));}};Dialer[_0x423e('0x18')]['handlePredictive']=function(_0x260252){if(_0x260252[_0x423e('0x206')]>0x0){var _0x566d7b=_0x260252[_0x423e('0x206')]-_0x260252['originated']-_0x260252[_0x423e('0x1c4')];if(_0x566d7b>0x0){this[_0x423e('0x20d')](_0x260252);}else{loggerPredictiveCalls['info'](_0x423e('0x20e'));}}else{this[_0x423e('0x20d')](_0x260252);}};Dialer['prototype'][_0x423e('0x20d')]=function(_0x562223){var _0x17707a=this;var _0x450853=[];_0x562223[_0x423e('0x7c')]+=0x1;for(var _0x46448b in this['agents']){if(typeof this['agents'][_0x46448b]!=='undefined'){if(this[_0x423e('0x1f')][_0x46448b][_0x423e('0x6a')]==='not_inuse'&&this['agents'][_0x46448b][_0x423e('0x83')]===_0x423e('0x141')){_0x450853['push'](this[_0x423e('0x1f')][_0x46448b]['id']);}}}return this[_0x423e('0x208')](_0x562223['id'],_0x450853,0x1,_0x562223[_0x423e('0x200')],_0x562223)['then'](function(_0x1e5523){if(!utils[_0x423e('0x201')](_0x1e5523)){utils['checkContactLowerLimitOriginate'](_0x562223,0x1,0x0);return hopperUtils[_0x423e('0x209')](_0x562223)[_0x423e('0x9b')](sendMessageReschedule(_0x562223))[_0x423e('0x9a')](loggerCatch(_0x423e('0x20a')));}else{_0x562223[_0x423e('0x69')]=utils[_0x423e('0x64')][_0x423e('0x203')];if(_[_0x423e('0xec')](_0x1e5523[0x0])||_['isNil'](_0x1e5523[0x0][_0x423e('0x170')])||_['isNil'](_0x1e5523[0x0][_0x423e('0x159')])){_0x17707a['emptyContact']('[actionOriginate]\x20',_0x562223,_0x1e5523[0x0]);}else{return hopperUtils[_0x423e('0x20b')](_[_0x423e('0x72')](_0x1e5523[0x0],[_0x423e('0xd9'),'phone']))[_0x423e('0x9b')](_0x17707a[_0x423e('0x1ea')](_0x562223,_0x1e5523[0x0]))[_0x423e('0x9a')](_0x17707a[_0x423e('0x14f')](_0x423e('0x20f'),_0x562223));}}})['catch'](loggerGetContactDialer(_0x423e('0x210'),_0x562223,0x1));};Dialer[_0x423e('0x18')][_0x423e('0x1e5')]=function(_0x28c97,_0x5930d4,_0x569dce,_0x3f970c,_0x387f8c,_0xa3ff97){loggerPredictive[_0x423e('0x45')](_0x423e('0x211'));loggerPredictive[_0x423e('0x45')](_0x423e('0x212'),_0x28c97);loggerPredictive['info'](_0x423e('0x213'),_0x5930d4);loggerPredictive[_0x423e('0x45')]('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',_0x569dce);loggerPredictive['info'](_0x423e('0x214'),_0x3f970c);loggerPredictive['info'](_0x423e('0x215'),_0x387f8c);loggerPredictive[_0x423e('0x45')]('---------------------------');return new Promise(function(_0x17be57,_0x5b2d0e){if(_0x28c97<=0x0||isNaN(_0x28c97)){return _0x5b2d0e(msgResponse(_0x423e('0x216'),_0x423e('0x82'),_0x423e('0x217')+_0x28c97));}if(_0x569dce<=0x0||isNaN(_0x569dce)){return _0x5b2d0e(msgResponse(_0x423e('0x216'),'Error',_0x423e('0x218')+_0x569dce));}if(_0x3f970c<=0x0||isNaN(_0x3f970c)){return _0x5b2d0e(msgResponse(_0x423e('0x216'),_0x423e('0x82'),_0x423e('0x219')+_0x3f970c));}if(_0x5930d4<=0x0||isNaN(_0x5930d4)){return _0x5b2d0e(msgResponse(_0x423e('0x216'),_0x423e('0x82'),_0x423e('0x21a')+_0x5930d4));}if(_0x387f8c<=0x0||isNaN(_0x387f8c)){return _0x5b2d0e(msgResponse(_0x423e('0x216'),_0x423e('0x82'),_0x423e('0x21b')+_0x387f8c));}_0xa3ff97=_0xa3ff97||0x0;var _0x2aa43a=0x1/_0x569dce;var _0x435cf7=0x0;var _0x10df9d=0x0;var _0x2cff15=0x0;var _0x35b235=0x0;for(var _0x585cc5=0x0;_0x2cff15<_0x387f8c;_0x585cc5+=0x1){_0x10df9d=_0x585cc5/_0x5930d4;_0x435cf7=(_0x3f970c*_0x10df9d+_0xa3ff97)/_0x2aa43a;_0x2cff15=utils[_0x423e('0x21c')](_0x435cf7,_0x28c97);_0x35b235=_0x435cf7/_0x28c97*(0x1-utils[_0x423e('0x21c')](_0x435cf7,_0x28c97));}return _0x17be57({'erlangCalls':_0x585cc5,'erlangCallToSecond':_0x5930d4/_0x585cc5,'erlangAbandonmentRate':_0x2cff15,'erlangBusyFactor':_0x35b235});});};Dialer[_0x423e('0x18')][_0x423e('0x1de')]=function(_0x563b30,_0x22ff6d,_0xd760a,_0x3d1c52,_0x414468,_0x450596){loggerPredictive[_0x423e('0x45')](_0x423e('0x21d'));loggerPredictive[_0x423e('0x45')]('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',_0x563b30);loggerPredictive[_0x423e('0x45')](_0x423e('0x213'),_0x22ff6d);loggerPredictive[_0x423e('0x45')]('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',_0xd760a);loggerPredictive[_0x423e('0x45')](_0x423e('0x214'),_0x3d1c52);loggerPredictive[_0x423e('0x45')](_0x423e('0x21e'),_0x414468);loggerPredictive[_0x423e('0x45')]('---------------------------');return new Promise(function(_0x2b600f,_0x37f012){if(_0x563b30<=0x0||isNaN(_0x563b30)){return _0x37f012(msgResponse(_0x423e('0x21f'),_0x423e('0x82'),_0x423e('0x217')+_0x563b30));}if(_0xd760a<=0x0||isNaN(_0xd760a)){return _0x37f012(msgResponse(_0x423e('0x21f'),'Error',_0x423e('0x218')+_0xd760a));}if(_0x3d1c52<=0x0||isNaN(_0x3d1c52)){return _0x37f012(msgResponse(_0x423e('0x21f'),_0x423e('0x82'),_0x423e('0x219')+_0x3d1c52));}if(_0x22ff6d<=0x0||isNaN(_0x22ff6d)){return _0x37f012(msgResponse(_0x423e('0x21f'),'Error','interval\x20=\x20'+_0x22ff6d));}if(_0x414468<=0x0||isNaN(_0x414468)){return _0x37f012(msgResponse(_0x423e('0x21f'),_0x423e('0x82'),'Umin\x20=\x20'+_0x414468));}_0x450596=_0x450596||0x0;var _0x4bde60=0x1/_0xd760a;var _0x2d9fde=0x0;var _0x3aca30=0x0;var _0x47bd63=0x0;var _0x52aff6=0x0;for(var _0xfd4183=0x0;_0x52aff6<_0x414468;_0xfd4183+=0x1){_0x3aca30=_0xfd4183/_0x22ff6d;_0x2d9fde=(_0x3d1c52*_0x3aca30+_0x450596)/_0x4bde60;_0x47bd63=utils['erlangb'](_0x2d9fde,_0x563b30);_0x52aff6=_0x2d9fde/_0x563b30*(0x1-utils[_0x423e('0x21c')](_0x2d9fde,_0x563b30));}return _0x2b600f({'erlangCalls':_0xfd4183,'erlangCallToSecond':_0x22ff6d/_0xfd4183,'erlangAbandonmentRate':_0x47bd63,'erlangBusyFactor':_0x52aff6});});};module[_0x423e('0x220')]=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 445f82d..0342986 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 _0x7cad=['format','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime'];(function(_0x4aa83b,_0xa90f1b){var _0xedff0b=function(_0x14bc57){while(--_0x14bc57){_0x4aa83b['push'](_0x4aa83b['shift']());}};_0xedff0b(++_0xa90f1b);}(_0x7cad,0x131));var _0xd7ca=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x7cad[_0x32f7d7];return _0x133d09;};'use strict';var util=require(_0xd7ca('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4feb07,_0x24ae77,_0x124eb8){var _0x2a58cf='';if(!_[_0xd7ca('0x1')](_0x24ae77)&&_0xd7ca('0x2')===typeof _0x24ae77){_0x2a58cf+=_0x24ae77;}if(!_[_0xd7ca('0x1')](_0x124eb8)&&_0xd7ca('0x2')===typeof _0x124eb8){_0x2a58cf+='\x20'+_0x124eb8;}if(_0x2a58cf!==''){return _0x2a58cf;}return _0x4feb07;}function Action(_0x20e073,_0x31bee9,_0x1eb2d3){this[_0xd7ca('0x3')]=_0x20e073;this['uniqueid']=_0x1eb2d3||undefined;this[_0xd7ca('0x4')]=checkNameSurname(_0x31bee9[_0xd7ca('0x5')]['phone'],_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x6')],_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x7')]);this[_0xd7ca('0x8')]=_0x31bee9[_0xd7ca('0x9')];this[_0xd7ca('0xa')]=_0x20e073['name'];this[_0xd7ca('0xb')]=_0x31bee9['active']||![];this['type']=_0x20e073[_0xd7ca('0xc')];this[_0xd7ca('0xd')]=_0x20e073[_0xd7ca('0xd')]||0x3;this[_0xd7ca('0xe')]=_0x31bee9[_0xd7ca('0xe')];this[_0xd7ca('0xf')]=_0x31bee9[_0xd7ca('0xf')];this[_0xd7ca('0x10')]=_0x31bee9[_0xd7ca('0x10')];this[_0xd7ca('0x11')]=_0x31bee9[_0xd7ca('0x11')];this[_0xd7ca('0x12')]=_0x31bee9['countnosuchnumberretry'];this[_0xd7ca('0x13')]=_0x31bee9[_0xd7ca('0x13')];this[_0xd7ca('0x14')]=_0x31bee9['countabandonedretry'];this['countmachineretry']=_0x31bee9[_0xd7ca('0x15')];this[_0xd7ca('0x16')]=_0x31bee9[_0xd7ca('0x16')];this[_0xd7ca('0x17')]=_0x31bee9['ContactId'];this[_0xd7ca('0x18')]=_0x31bee9[_0xd7ca('0x18')];this['UserId']=_0x31bee9[_0xd7ca('0x19')];this[_0xd7ca('0x1a')]=_0x31bee9[_0xd7ca('0x1a')];this[_0xd7ca('0x1b')]=_0x31bee9['CampaignId'];this[_0xd7ca('0x1c')]=_0x31bee9['id'];this[_0xd7ca('0x1d')]=_0x31bee9[_0xd7ca('0x5')][_0xd7ca('0x6')]||'';this[_0xd7ca('0x1e')]=moment()[_0xd7ca('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x31bee9[_0xd7ca('0x20')];this[_0xd7ca('0x21')]=_0x31bee9[_0xd7ca('0x21')];this[_0xd7ca('0x22')]=_0x31bee9['callbackat'];this['recallme']=_0x31bee9[_0xd7ca('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xd7ca('0x24')]['getCaller']=function(){return util[_0xd7ca('0x1f')](_0xd7ca('0x25'),this['name'],this['voiceQueue'][_0xd7ca('0x26')]>0x0?this[_0xd7ca('0x8')][_0xd7ca('0x27')](this[_0xd7ca('0x3')][_0xd7ca('0x26')]):this[_0xd7ca('0x8')]);};Action['prototype'][_0xd7ca('0x28')]=function(){return this['queue'];};module[_0xd7ca('0x29')]=Action; \ No newline at end of file +var _0x7694=['active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','prototype','getQueue','util','lodash','moment','isNil','string','name','firstName','Contact','lastName','number','queue'];(function(_0x595365,_0x36579b){var _0x5da53f=function(_0x1b0080){while(--_0x1b0080){_0x595365['push'](_0x595365['shift']());}};_0x5da53f(++_0x36579b);}(_0x7694,0xa5));var _0x4769=function(_0x5d3901,_0x5364db){_0x5d3901=_0x5d3901-0x0;var _0x5b7843=_0x7694[_0x5d3901];return _0x5b7843;};'use strict';var util=require(_0x4769('0x0'));var _=require(_0x4769('0x1'));var moment=require(_0x4769('0x2'));function checkNameSurname(_0x295142,_0x507889,_0xee3137){var _0x23ff65='';if(!_[_0x4769('0x3')](_0x507889)&&_0x4769('0x4')===typeof _0x507889){_0x23ff65+=_0x507889;}if(!_[_0x4769('0x3')](_0xee3137)&&_0x4769('0x4')===typeof _0xee3137){_0x23ff65+='\x20'+_0xee3137;}if(_0x23ff65!==''){return _0x23ff65;}return _0x295142;}function Action(_0x557aa2,_0xd3f184,_0x26dbfc){this['voiceQueue']=_0x557aa2;this['uniqueid']=_0x26dbfc||undefined;this[_0x4769('0x5')]=checkNameSurname(_0xd3f184['Contact']['phone'],_0xd3f184['Contact'][_0x4769('0x6')],_0xd3f184[_0x4769('0x7')][_0x4769('0x8')]);this[_0x4769('0x9')]=_0xd3f184['phone'];this[_0x4769('0xa')]=_0x557aa2[_0x4769('0x5')];this[_0x4769('0xb')]=_0xd3f184[_0x4769('0xb')]||![];this[_0x4769('0xc')]=_0x557aa2[_0x4769('0xc')];this['dialQueueTimeout']=_0x557aa2[_0x4769('0xd')]||0x3;this[_0x4769('0xe')]=_0xd3f184[_0x4769('0xe')];this[_0x4769('0xf')]=_0xd3f184[_0x4769('0xf')];this[_0x4769('0x10')]=_0xd3f184[_0x4769('0x10')];this['countnoanswerretry']=_0xd3f184[_0x4769('0x11')];this[_0x4769('0x12')]=_0xd3f184[_0x4769('0x12')];this[_0x4769('0x13')]=_0xd3f184[_0x4769('0x13')];this[_0x4769('0x14')]=_0xd3f184[_0x4769('0x14')];this[_0x4769('0x15')]=_0xd3f184[_0x4769('0x15')];this[_0x4769('0x16')]=_0xd3f184[_0x4769('0x16')];this[_0x4769('0x17')]=_0xd3f184[_0x4769('0x17')];this['ListId']=_0xd3f184[_0x4769('0x18')];this[_0x4769('0x19')]=_0xd3f184['UserId'];this[_0x4769('0x1a')]=_0xd3f184[_0x4769('0x1a')];this['CampaignId']=_0xd3f184[_0x4769('0x1b')];this[_0x4769('0x1c')]=_0xd3f184['id'];this[_0x4769('0x1d')]=_0xd3f184['Contact'][_0x4769('0x6')]||'';this[_0x4769('0x1e')]=moment()[_0x4769('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4769('0x20')]=_0xd3f184[_0x4769('0x20')];this[_0x4769('0x21')]=_0xd3f184[_0x4769('0x21')];this[_0x4769('0x22')]=_0xd3f184[_0x4769('0x22')];this[_0x4769('0x23')]=_0xd3f184[_0x4769('0x23')];this['originatecalleridnum']='';this[_0x4769('0x24')]='';}Action['prototype'][_0x4769('0x25')]=function(){return util[_0x4769('0x1f')](_0x4769('0x26'),this[_0x4769('0x5')],this[_0x4769('0x27')][_0x4769('0x28')]>0x0?this['number'][_0x4769('0x29')](this['voiceQueue'][_0x4769('0x28')]):this[_0x4769('0x9')]);};Action[_0x4769('0x2a')][_0x4769('0x2b')]=function(){return this[_0x4769('0xa')];};module['exports']=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 4e8d8fc..da0cd0a 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 _0x13dc=['state','statedesc','Answer','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','agiafterat','moment','../utils'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x13dc,0x100));var _0xc13d=function(_0x4962fc,_0x13dd8e){_0x4962fc=_0x4962fc-0x0;var _0x45cd28=_0x13dc[_0x4962fc];return _0x45cd28;};'use strict';var moment=require(_0xc13d('0x0'));var utils=require(_0xc13d('0x1'));function AgentComplete(_0x18eece,_0x4811bf){this[_0xc13d('0x2')]=0x4;this[_0xc13d('0x3')]=_0xc13d('0x4');this['scheduledat']=_0x18eece['scheduledat'];this['type']=_0x18eece[_0xc13d('0x5')];this[_0xc13d('0x6')]=_0x18eece[_0xc13d('0x5')]===_0xc13d('0x7')?_0xc13d('0x8'):_0x18eece[_0xc13d('0x5')];this['countbusyretry']=_0x18eece['countbusyretry'];this[_0xc13d('0x9')]=_0x18eece[_0xc13d('0x9')];this['countnoanswerretry']=_0x18eece[_0xc13d('0xa')];this[_0xc13d('0xb')]=_0x18eece['countbusyretry']+_0x18eece['countcongestionretry']+_0x18eece[_0xc13d('0xa')]+_0x18eece[_0xc13d('0xc')]+_0x18eece[_0xc13d('0xd')]+_0x18eece[_0xc13d('0xe')]+_0x18eece[_0xc13d('0xf')]+_0x18eece[_0xc13d('0x10')];this['countnosuchnumberretry']=_0x18eece['countnosuchnumberretry'];this[_0xc13d('0xd')]=_0x18eece[_0xc13d('0xd')];this['countabandonedretry']=_0x18eece[_0xc13d('0xe')];this[_0xc13d('0xf')]=_0x18eece[_0xc13d('0xf')];this[_0xc13d('0x10')]=_0x18eece['countagentrejectretry'];this[_0xc13d('0x11')]=_0x4811bf[_0xc13d('0x11')];this[_0xc13d('0x12')]=_0x18eece[_0xc13d('0x13')];this[_0xc13d('0x14')]=_0x18eece[_0xc13d('0x15')];this[_0xc13d('0x16')]=_0x18eece['starttime'];this[_0xc13d('0x17')]=_0x18eece[_0xc13d('0x17')];this[_0xc13d('0x18')]=_0x18eece[_0xc13d('0x18')];this[_0xc13d('0x19')]=moment()[_0xc13d('0x1a')](_0xc13d('0x1b'));this[_0xc13d('0x1c')]=utils[_0xc13d('0x1d')](_0x18eece[_0xc13d('0x17')],_0x18eece['starttime']);this[_0xc13d('0x1e')]=utils[_0xc13d('0x1d')](_0x18eece[_0xc13d('0x18')],_0x18eece[_0xc13d('0x17')]);this[_0xc13d('0x1f')]=utils['getSeconds'](this[_0xc13d('0x19')],_0x18eece[_0xc13d('0x18')]);this[_0xc13d('0x8')]=_0x4811bf['queue'];this[_0xc13d('0x20')]=_0x4811bf[_0xc13d('0x20')];this[_0xc13d('0x21')]=_0x4811bf[_0xc13d('0x21')];this[_0xc13d('0x22')]=_0x18eece[_0xc13d('0x22')];this['callbackuniqueid']=_0x18eece['callbackuniqueid'];this[_0xc13d('0x23')]=_0x18eece[_0xc13d('0x23')];this[_0xc13d('0x24')]=_0x18eece[_0xc13d('0x24')];this[_0xc13d('0x25')]=_0x18eece[_0xc13d('0x25')];this[_0xc13d('0x26')]=_0x18eece['ListId'];this[_0xc13d('0x27')]=_0x18eece[_0xc13d('0x27')];this[_0xc13d('0x28')]=_0x18eece[_0xc13d('0x28')];this['CampaignId']=_0x18eece['CampaignId'];this['originatecalleridnum']=_0x18eece['originatecalleridnum']||'';this[_0xc13d('0x29')]=_0x18eece[_0xc13d('0x29')]||'';this[_0xc13d('0x2a')]=_0x18eece[_0xc13d('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file +var _0x9ed6=['VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x558cc3,_0x524449){var _0x30e107=function(_0x3d516e){while(--_0x3d516e){_0x558cc3['push'](_0x558cc3['shift']());}};_0x30e107(++_0x524449);}(_0x9ed6,0x147));var _0x69ed=function(_0x37bb03,_0x1bf2e9){_0x37bb03=_0x37bb03-0x0;var _0x545bee=_0x9ed6[_0x37bb03];return _0x545bee;};'use strict';var moment=require(_0x69ed('0x0'));var utils=require(_0x69ed('0x1'));function AgentComplete(_0x19f391,_0x20f2fa){this[_0x69ed('0x2')]=0x4;this['statedesc']=_0x69ed('0x3');this['scheduledat']=_0x19f391[_0x69ed('0x4')];this[_0x69ed('0x5')]=_0x19f391['type'];this[_0x69ed('0x6')]=_0x19f391['type']===_0x69ed('0x7')?_0x69ed('0x8'):_0x19f391[_0x69ed('0x5')];this[_0x69ed('0x9')]=_0x19f391['countbusyretry'];this[_0x69ed('0xa')]=_0x19f391[_0x69ed('0xa')];this['countnoanswerretry']=_0x19f391[_0x69ed('0xb')];this[_0x69ed('0xc')]=_0x19f391[_0x69ed('0x9')]+_0x19f391[_0x69ed('0xa')]+_0x19f391[_0x69ed('0xb')]+_0x19f391[_0x69ed('0xd')]+_0x19f391[_0x69ed('0xe')]+_0x19f391[_0x69ed('0xf')]+_0x19f391[_0x69ed('0x10')]+_0x19f391[_0x69ed('0x11')];this[_0x69ed('0xd')]=_0x19f391[_0x69ed('0xd')];this['countdropretry']=_0x19f391[_0x69ed('0xe')];this[_0x69ed('0xf')]=_0x19f391[_0x69ed('0xf')];this[_0x69ed('0x10')]=_0x19f391['countmachineretry'];this[_0x69ed('0x11')]=_0x19f391[_0x69ed('0x11')];this[_0x69ed('0x12')]=_0x20f2fa[_0x69ed('0x12')];this['calleridname']=_0x19f391[_0x69ed('0x13')];this[_0x69ed('0x14')]=_0x19f391[_0x69ed('0x15')];this[_0x69ed('0x16')]=_0x19f391[_0x69ed('0x16')];this['responsetime']=_0x19f391[_0x69ed('0x17')];this['answertime']=_0x19f391[_0x69ed('0x18')];this[_0x69ed('0x19')]=moment()[_0x69ed('0x1a')](_0x69ed('0x1b'));this[_0x69ed('0x1c')]=utils['getSeconds'](_0x19f391['responsetime'],_0x19f391['starttime']);this[_0x69ed('0x1d')]=utils[_0x69ed('0x1e')](_0x19f391['answertime'],_0x19f391[_0x69ed('0x17')]);this[_0x69ed('0x1f')]=utils[_0x69ed('0x1e')](this[_0x69ed('0x19')],_0x19f391['answertime']);this[_0x69ed('0x8')]=_0x20f2fa[_0x69ed('0x8')];this[_0x69ed('0x20')]=_0x20f2fa['membername'];this[_0x69ed('0x21')]=_0x20f2fa[_0x69ed('0x21')];this[_0x69ed('0x22')]=_0x19f391[_0x69ed('0x22')];this['callbackuniqueid']=_0x19f391[_0x69ed('0x23')];this[_0x69ed('0x24')]=_0x19f391['callbackat'];this['recallme']=_0x19f391[_0x69ed('0x25')];this[_0x69ed('0x26')]=_0x19f391['ContactId'];this[_0x69ed('0x27')]=_0x19f391[_0x69ed('0x27')];this['UserId']=_0x19f391[_0x69ed('0x28')];this['VoiceQueueId']=_0x19f391[_0x69ed('0x29')];this['CampaignId']=_0x19f391['CampaignId'];this['originatecalleridnum']=_0x19f391[_0x69ed('0x2a')]||'';this[_0x69ed('0x2b')]=_0x19f391[_0x69ed('0x2b')]||'';this[_0x69ed('0x2c')]=_0x19f391[_0x69ed('0x2c')];}module[_0x69ed('0x2d')]=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 d1d3524..67c6084 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 _0x820d=['countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x820d,0x1c8));var _0xd820=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x820d[_0x5783f4];return _0x28e380;};'use strict';function Final(_0x182785){this[_0xd820('0x0')]=_0x182785[_0xd820('0x0')];this['scheduledat']=_0x182785[_0xd820('0x1')];this[_0xd820('0x2')]=_0x182785[_0xd820('0x2')];this[_0xd820('0x3')]=_0x182785[_0xd820('0x2')]===_0xd820('0x4')?'queue':_0x182785['type'];this[_0xd820('0x5')]=_0x182785[_0xd820('0x5')];this['countcongestionretry']=_0x182785[_0xd820('0x6')];this[_0xd820('0x7')]=_0x182785[_0xd820('0x7')];this[_0xd820('0x8')]=_0x182785[_0xd820('0x5')]+_0x182785[_0xd820('0x6')]+_0x182785['countnoanswerretry']+_0x182785[_0xd820('0x9')]+_0x182785[_0xd820('0xa')]+_0x182785[_0xd820('0xb')]+_0x182785[_0xd820('0xc')]+_0x182785[_0xd820('0xd')];this[_0xd820('0x9')]=_0x182785['countnosuchnumberretry'];this[_0xd820('0xa')]=_0x182785['countdropretry'];this[_0xd820('0xb')]=_0x182785['countabandonedretry'];this[_0xd820('0xc')]=_0x182785[_0xd820('0xc')];this['countagentrejectretry']=_0x182785['countagentrejectretry'];this[_0xd820('0xe')]=_0x182785[_0xd820('0xe')];this[_0xd820('0xf')]=_0x182785[_0xd820('0xf')];this['calleridnum']=_0x182785[_0xd820('0x10')];this[_0xd820('0x11')]=_0x182785[_0xd820('0x11')];this[_0xd820('0x12')]=_0x182785[_0xd820('0x12')];this[_0xd820('0x13')]=_0x182785[_0xd820('0x12')];this[_0xd820('0x14')]=_0x182785[_0xd820('0x14')]||0x0;this[_0xd820('0x15')]=_0x182785[_0xd820('0x15')]||0x0;this['talktime']=_0x182785[_0xd820('0x16')]||0x0;this[_0xd820('0x17')]=_0x182785['callback'];this['callbackuniqueid']=_0x182785[_0xd820('0x18')];this[_0xd820('0x19')]=_0x182785[_0xd820('0x19')];this['recallme']=_0x182785[_0xd820('0x1a')];this[_0xd820('0x1b')]=_0x182785[_0xd820('0x1b')];this[_0xd820('0x1c')]=_0x182785[_0xd820('0x1c')];this[_0xd820('0x1d')]=_0x182785[_0xd820('0x1d')];this[_0xd820('0x1e')]=_0x182785['VoiceQueueId'];this['CampaignId']=_0x182785[_0xd820('0x1f')];this['originatecalleridnum']=_0x182785['originatecalleridnum']||'';this[_0xd820('0x20')]=_0x182785[_0xd820('0x20')]||'';this['state']=_0x182785[_0xd820('0x21')];this[_0xd820('0x22')]=_0x182785[_0xd820('0x22')];}module[_0xd820('0x23')]=Final; \ No newline at end of file +var _0x27f7=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','callback','callbackuniqueid','callbackat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27f7,0x10b));var _0x727f=function(_0x2ff7bf,_0x1dfeeb){_0x2ff7bf=_0x2ff7bf-0x0;var _0x5a12a7=_0x27f7[_0x2ff7bf];return _0x5a12a7;};'use strict';function Final(_0x254a23){this[_0x727f('0x0')]=_0x254a23[_0x727f('0x0')];this['scheduledat']=_0x254a23[_0x727f('0x1')];this[_0x727f('0x2')]=_0x254a23[_0x727f('0x2')];this[_0x727f('0x3')]=_0x254a23[_0x727f('0x2')]==='outbound'?_0x727f('0x4'):_0x254a23[_0x727f('0x2')];this[_0x727f('0x5')]=_0x254a23['countbusyretry'];this[_0x727f('0x6')]=_0x254a23[_0x727f('0x6')];this['countnoanswerretry']=_0x254a23['countnoanswerretry'];this[_0x727f('0x7')]=_0x254a23['countbusyretry']+_0x254a23[_0x727f('0x6')]+_0x254a23['countnoanswerretry']+_0x254a23[_0x727f('0x8')]+_0x254a23[_0x727f('0x9')]+_0x254a23[_0x727f('0xa')]+_0x254a23[_0x727f('0xb')]+_0x254a23[_0x727f('0xc')];this[_0x727f('0x8')]=_0x254a23['countnosuchnumberretry'];this[_0x727f('0x9')]=_0x254a23[_0x727f('0x9')];this[_0x727f('0xa')]=_0x254a23[_0x727f('0xa')];this['countmachineretry']=_0x254a23[_0x727f('0xb')];this['countagentrejectretry']=_0x254a23[_0x727f('0xc')];this[_0x727f('0x4')]=_0x254a23[_0x727f('0x4')];this['calleridname']=_0x254a23[_0x727f('0xd')];this[_0x727f('0xe')]=_0x254a23[_0x727f('0xe')];this['starttime']=_0x254a23[_0x727f('0xf')];this[_0x727f('0x10')]=_0x254a23['responsetime'];this[_0x727f('0x11')]=_0x254a23['responsetime'];this['ringtime']=_0x254a23['ringtime']||0x0;this['holdtime']=_0x254a23['holdtime']||0x0;this['talktime']=_0x254a23['talktime']||0x0;this[_0x727f('0x12')]=_0x254a23[_0x727f('0x12')];this['callbackuniqueid']=_0x254a23[_0x727f('0x13')];this[_0x727f('0x14')]=_0x254a23[_0x727f('0x14')];this[_0x727f('0x15')]=_0x254a23[_0x727f('0x15')];this['ContactId']=_0x254a23[_0x727f('0x16')];this[_0x727f('0x17')]=_0x254a23['ListId'];this[_0x727f('0x18')]=_0x254a23[_0x727f('0x18')];this['VoiceQueueId']=_0x254a23[_0x727f('0x19')];this[_0x727f('0x1a')]=_0x254a23[_0x727f('0x1a')];this[_0x727f('0x1b')]=_0x254a23[_0x727f('0x1b')]||'';this[_0x727f('0x1c')]=_0x254a23[_0x727f('0x1c')]||'';this[_0x727f('0x1d')]=_0x254a23['state'];this[_0x727f('0x1e')]=_0x254a23[_0x727f('0x1e')];}module[_0x727f('0x1f')]=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 02de7a1..fcf769d 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 _0xad91=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xad91,0x1ba));var _0x1ad9=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0xad91[_0x1e2c73];return _0x46f8d5;};'use strict';var moment=require('moment');var utils=require(_0x1ad9('0x0'));function Hangup(_0x348e56,_0xe874db){this[_0x1ad9('0x1')]=0x4;this[_0x1ad9('0x2')]='Answer';this[_0x1ad9('0x3')]=_0x348e56['scheduledat'];this[_0x1ad9('0x4')]=_0x348e56['type'];this[_0x1ad9('0x5')]=_0x348e56[_0x1ad9('0x4')]===_0x1ad9('0x6')?_0x1ad9('0x7'):_0x348e56[_0x1ad9('0x4')];this[_0x1ad9('0x8')]=_0x348e56['amd']||![];this[_0x1ad9('0x9')]=_0x348e56['countbusyretry'];this[_0x1ad9('0xa')]=_0x348e56[_0x1ad9('0xa')];this[_0x1ad9('0xb')]=_0x348e56[_0x1ad9('0xb')];this['countglobal']=_0x348e56[_0x1ad9('0x9')]+_0x348e56[_0x1ad9('0xa')]+_0x348e56['countnoanswerretry']+_0x348e56[_0x1ad9('0xc')]+_0x348e56[_0x1ad9('0xd')]+_0x348e56['countabandonedretry']+_0x348e56[_0x1ad9('0xe')]+_0x348e56[_0x1ad9('0xf')];this['countnosuchnumberretry']=_0x348e56[_0x1ad9('0xc')];this[_0x1ad9('0xd')]=_0x348e56[_0x1ad9('0xd')];this[_0x1ad9('0x10')]=_0x348e56[_0x1ad9('0x10')];this[_0x1ad9('0xe')]=_0x348e56[_0x1ad9('0xe')];this[_0x1ad9('0xf')]=_0x348e56[_0x1ad9('0xf')];this[_0x1ad9('0x11')]=_0xe874db[_0x1ad9('0x11')];this['calleridname']=_0x348e56[_0x1ad9('0x12')];this[_0x1ad9('0x13')]=_0x348e56['number'];this[_0x1ad9('0x14')]=_0x348e56[_0x1ad9('0x14')];this['responsetime']=_0x348e56[_0x1ad9('0x15')];this['endtime']=moment()[_0x1ad9('0x16')](_0x1ad9('0x17'));this[_0x1ad9('0x18')]=utils[_0x1ad9('0x19')](_0x348e56['responsetime'],_0x348e56[_0x1ad9('0x14')]);this[_0x1ad9('0x1a')]=0x0;this[_0x1ad9('0x1b')]=utils['getSeconds'](this[_0x1ad9('0x1c')],_0x348e56[_0x1ad9('0x15')]);this[_0x1ad9('0x7')]=_0x348e56[_0x1ad9('0x7')];this[_0x1ad9('0x1d')]=_0x1ad9('0x1e');this[_0x1ad9('0x1f')]=_0xe874db[_0x1ad9('0x20')];this[_0x1ad9('0x21')]=_0x348e56['callback'];this[_0x1ad9('0x22')]=_0x348e56['callbackuniqueid'];this[_0x1ad9('0x23')]=_0x348e56[_0x1ad9('0x23')];this[_0x1ad9('0x24')]=_0x348e56[_0x1ad9('0x24')];this['ContactId']=_0x348e56[_0x1ad9('0x25')];this[_0x1ad9('0x26')]=_0x348e56[_0x1ad9('0x26')];this[_0x1ad9('0x27')]=_0x348e56[_0x1ad9('0x27')];this['VoiceQueueId']=_0x348e56['VoiceQueueId'];this['CampaignId']=_0x348e56[_0x1ad9('0x28')];}module[_0x1ad9('0x29')]=Hangup; \ No newline at end of file +var _0x0d39=['statedesc','scheduledat','type','campaigntype','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','../utils','state'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0d39,0x12a));var _0x90d3=function(_0x1b1523,_0x35f1e8){_0x1b1523=_0x1b1523-0x0;var _0x5856a1=_0x0d39[_0x1b1523];return _0x5856a1;};'use strict';var moment=require(_0x90d3('0x0'));var utils=require(_0x90d3('0x1'));function Hangup(_0x326cf7,_0x3ed285){this[_0x90d3('0x2')]=0x4;this[_0x90d3('0x3')]='Answer';this[_0x90d3('0x4')]=_0x326cf7[_0x90d3('0x4')];this[_0x90d3('0x5')]=_0x326cf7[_0x90d3('0x5')];this[_0x90d3('0x6')]=_0x326cf7[_0x90d3('0x5')]==='outbound'?'queue':_0x326cf7[_0x90d3('0x5')];this['amd']=_0x326cf7[_0x90d3('0x7')]||![];this['countbusyretry']=_0x326cf7[_0x90d3('0x8')];this[_0x90d3('0x9')]=_0x326cf7[_0x90d3('0x9')];this[_0x90d3('0xa')]=_0x326cf7['countnoanswerretry'];this[_0x90d3('0xb')]=_0x326cf7[_0x90d3('0x8')]+_0x326cf7[_0x90d3('0x9')]+_0x326cf7['countnoanswerretry']+_0x326cf7['countnosuchnumberretry']+_0x326cf7[_0x90d3('0xc')]+_0x326cf7[_0x90d3('0xd')]+_0x326cf7['countmachineretry']+_0x326cf7[_0x90d3('0xe')];this[_0x90d3('0xf')]=_0x326cf7[_0x90d3('0xf')];this[_0x90d3('0xc')]=_0x326cf7[_0x90d3('0xc')];this[_0x90d3('0xd')]=_0x326cf7['countabandonedretry'];this['countmachineretry']=_0x326cf7[_0x90d3('0x10')];this[_0x90d3('0xe')]=_0x326cf7[_0x90d3('0xe')];this[_0x90d3('0x11')]=_0x3ed285['uniqueid'];this[_0x90d3('0x12')]=_0x326cf7[_0x90d3('0x13')];this['calleridnum']=_0x326cf7[_0x90d3('0x14')];this['starttime']=_0x326cf7[_0x90d3('0x15')];this[_0x90d3('0x16')]=_0x326cf7[_0x90d3('0x16')];this['endtime']=moment()[_0x90d3('0x17')](_0x90d3('0x18'));this[_0x90d3('0x19')]=utils[_0x90d3('0x1a')](_0x326cf7[_0x90d3('0x16')],_0x326cf7[_0x90d3('0x15')]);this[_0x90d3('0x1b')]=0x0;this[_0x90d3('0x1c')]=utils[_0x90d3('0x1a')](this[_0x90d3('0x1d')],_0x326cf7[_0x90d3('0x16')]);this['queue']=_0x326cf7[_0x90d3('0x1e')];this[_0x90d3('0x1f')]=_0x90d3('0x20');this['reason']=_0x3ed285[_0x90d3('0x21')];this[_0x90d3('0x22')]=_0x326cf7[_0x90d3('0x22')];this[_0x90d3('0x23')]=_0x326cf7['callbackuniqueid'];this[_0x90d3('0x24')]=_0x326cf7[_0x90d3('0x24')];this['recallme']=_0x326cf7[_0x90d3('0x25')];this[_0x90d3('0x26')]=_0x326cf7['ContactId'];this[_0x90d3('0x27')]=_0x326cf7[_0x90d3('0x27')];this['UserId']=_0x326cf7[_0x90d3('0x28')];this['VoiceQueueId']=_0x326cf7['VoiceQueueId'];this[_0x90d3('0x29')]=_0x326cf7[_0x90d3('0x29')];}module[_0x90d3('0x2a')]=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 e4bbb0f..ae34e2d 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 _0x5cbb=['callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','callback','callbackuniqueid'];(function(_0xd5d426,_0x3709f0){var _0x91e6a9=function(_0x1be67b){while(--_0x1be67b){_0xd5d426['push'](_0xd5d426['shift']());}};_0x91e6a9(++_0x3709f0);}(_0x5cbb,0xe3));var _0xb5cb=function(_0x3e5fb5,_0x3b5ca2){_0x3e5fb5=_0x3e5fb5-0x0;var _0xc95d0=_0x5cbb[_0x3e5fb5];return _0xc95d0;};'use strict';var utils=require(_0xb5cb('0x0'));function History(_0x31d280){this[_0xb5cb('0x1')]=_0x31d280[_0xb5cb('0x1')];this[_0xb5cb('0x2')]=_0x31d280[_0xb5cb('0x2')]||undefined;this['type']=_0x31d280[_0xb5cb('0x3')];this[_0xb5cb('0x4')]=_0x31d280[_0xb5cb('0x3')]===_0xb5cb('0x5')?_0xb5cb('0x6'):_0x31d280['type'];this[_0xb5cb('0x7')]=_0x31d280[_0xb5cb('0x7')];this[_0xb5cb('0x8')]=_0x31d280['countcongestionretry'];this[_0xb5cb('0x9')]=_0x31d280[_0xb5cb('0x9')];this[_0xb5cb('0xa')]=_0x31d280[_0xb5cb('0x7')]+_0x31d280[_0xb5cb('0x8')]+_0x31d280[_0xb5cb('0x9')]+_0x31d280[_0xb5cb('0xb')]+_0x31d280[_0xb5cb('0xc')]+_0x31d280[_0xb5cb('0xd')]+_0x31d280[_0xb5cb('0xe')]+_0x31d280[_0xb5cb('0xf')];this[_0xb5cb('0xb')]=_0x31d280[_0xb5cb('0xb')];this[_0xb5cb('0xc')]=_0x31d280[_0xb5cb('0xc')];this['countabandonedretry']=_0x31d280['countabandonedretry'];this[_0xb5cb('0xe')]=_0x31d280[_0xb5cb('0xe')];this[_0xb5cb('0xf')]=_0x31d280['countagentrejectretry'];this[_0xb5cb('0x6')]=_0x31d280['queue'];this['calleridname']=_0x31d280[_0xb5cb('0x10')];this[_0xb5cb('0x11')]=_0x31d280['number'];this[_0xb5cb('0x12')]=_0x31d280[_0xb5cb('0x12')];this['responsetime']=_0x31d280[_0xb5cb('0x13')];this['endtime']=_0x31d280[_0xb5cb('0x13')];this[_0xb5cb('0x14')]=utils[_0xb5cb('0x15')](_0x31d280[_0xb5cb('0x13')],_0x31d280[_0xb5cb('0x12')]);this[_0xb5cb('0x16')]=0x0;this['talktime']=0x0;this[_0xb5cb('0x17')]=_0x31d280[_0xb5cb('0x17')];this[_0xb5cb('0x18')]=_0x31d280[_0xb5cb('0x18')];this[_0xb5cb('0x19')]=_0x31d280[_0xb5cb('0x19')];this[_0xb5cb('0x1a')]=_0x31d280[_0xb5cb('0x1a')];this[_0xb5cb('0x1b')]=_0x31d280[_0xb5cb('0x1b')];this[_0xb5cb('0x1c')]=_0x31d280[_0xb5cb('0x1c')];this[_0xb5cb('0x1d')]=_0x31d280[_0xb5cb('0x1d')];this['VoiceQueueId']=_0x31d280['VoiceQueueId'];this[_0xb5cb('0x1e')]=_0x31d280['CampaignId'];this[_0xb5cb('0x1f')]=_0x31d280['originatecalleridnum']||'';this[_0xb5cb('0x20')]=_0x31d280[_0xb5cb('0x20')]||'';this[_0xb5cb('0x21')]=_0x31d280[_0xb5cb('0x21')];this[_0xb5cb('0x22')]=_0x31d280['statedesc'];}module[_0xb5cb('0x23')]=History; \ No newline at end of file +var _0xde81=['endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xde81,0x86));var _0x1de8=function(_0x4c02c2,_0x490eab){_0x4c02c2=_0x4c02c2-0x0;var _0x1b980e=_0xde81[_0x4c02c2];return _0x1b980e;};'use strict';var utils=require(_0x1de8('0x0'));function History(_0x22829e){this['uniqueid']=_0x22829e[_0x1de8('0x1')];this[_0x1de8('0x2')]=_0x22829e[_0x1de8('0x2')]||undefined;this[_0x1de8('0x3')]=_0x22829e[_0x1de8('0x3')];this[_0x1de8('0x4')]=_0x22829e[_0x1de8('0x3')]===_0x1de8('0x5')?_0x1de8('0x6'):_0x22829e[_0x1de8('0x3')];this[_0x1de8('0x7')]=_0x22829e[_0x1de8('0x7')];this[_0x1de8('0x8')]=_0x22829e['countcongestionretry'];this[_0x1de8('0x9')]=_0x22829e[_0x1de8('0x9')];this[_0x1de8('0xa')]=_0x22829e[_0x1de8('0x7')]+_0x22829e[_0x1de8('0x8')]+_0x22829e[_0x1de8('0x9')]+_0x22829e['countnosuchnumberretry']+_0x22829e[_0x1de8('0xb')]+_0x22829e[_0x1de8('0xc')]+_0x22829e['countmachineretry']+_0x22829e['countagentrejectretry'];this['countnosuchnumberretry']=_0x22829e[_0x1de8('0xd')];this['countdropretry']=_0x22829e[_0x1de8('0xb')];this[_0x1de8('0xc')]=_0x22829e[_0x1de8('0xc')];this[_0x1de8('0xe')]=_0x22829e['countmachineretry'];this[_0x1de8('0xf')]=_0x22829e[_0x1de8('0xf')];this['queue']=_0x22829e[_0x1de8('0x6')];this[_0x1de8('0x10')]=_0x22829e[_0x1de8('0x11')];this[_0x1de8('0x12')]=_0x22829e[_0x1de8('0x13')];this['starttime']=_0x22829e[_0x1de8('0x14')];this[_0x1de8('0x15')]=_0x22829e['responsetime'];this[_0x1de8('0x16')]=_0x22829e[_0x1de8('0x15')];this[_0x1de8('0x17')]=utils['getSeconds'](_0x22829e[_0x1de8('0x15')],_0x22829e[_0x1de8('0x14')]);this[_0x1de8('0x18')]=0x0;this['talktime']=0x0;this[_0x1de8('0x19')]=_0x22829e[_0x1de8('0x19')];this[_0x1de8('0x1a')]=_0x22829e[_0x1de8('0x1a')];this['callbackat']=_0x22829e[_0x1de8('0x1b')];this['recallme']=_0x22829e[_0x1de8('0x1c')];this[_0x1de8('0x1d')]=_0x22829e['ContactId'];this['ListId']=_0x22829e[_0x1de8('0x1e')];this[_0x1de8('0x1f')]=_0x22829e[_0x1de8('0x1f')];this[_0x1de8('0x20')]=_0x22829e[_0x1de8('0x20')];this[_0x1de8('0x21')]=_0x22829e['CampaignId'];this[_0x1de8('0x22')]=_0x22829e[_0x1de8('0x22')]||'';this[_0x1de8('0x23')]=_0x22829e[_0x1de8('0x23')]||'';this[_0x1de8('0x24')]=_0x22829e[_0x1de8('0x24')];this[_0x1de8('0x25')]=_0x22829e[_0x1de8('0x25')];}module[_0x1de8('0x26')]=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 c1ad44a..a7af97f 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 _0xad5a=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','queue','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x28fec6,_0x175db0){var _0x1c1af6=function(_0x52dab3){while(--_0x52dab3){_0x28fec6['push'](_0x28fec6['shift']());}};_0x1c1af6(++_0x175db0);}(_0xad5a,0x18a));var _0xaad5=function(_0x3f91e6,_0x490ef3){_0x3f91e6=_0x3f91e6-0x0;var _0x21b5ca=_0xad5a[_0x3f91e6];return _0x21b5ca;};'use strict';var utils=require(_0xaad5('0x0'));function QueueCallerAbandon(_0x34532c,_0x3280c1){this[_0xaad5('0x1')]=_0x34532c[_0xaad5('0x1')];this['type']=_0x34532c[_0xaad5('0x2')];this[_0xaad5('0x3')]=_0x34532c['type']===_0xaad5('0x4')?'queue':_0x34532c['type'];this[_0xaad5('0x5')]=_0x34532c[_0xaad5('0x5')];this[_0xaad5('0x6')]=_0x34532c[_0xaad5('0x6')];this['countnoanswerretry']=_0x34532c[_0xaad5('0x7')];this[_0xaad5('0x8')]=_0x34532c['countbusyretry']+_0x34532c['countcongestionretry']+_0x34532c[_0xaad5('0x7')]+_0x34532c['countnosuchnumberretry']+_0x34532c[_0xaad5('0x9')]+_0x34532c[_0xaad5('0xa')]+_0x34532c[_0xaad5('0xb')]+_0x34532c[_0xaad5('0xc')];this[_0xaad5('0xd')]=_0x34532c[_0xaad5('0xd')];this[_0xaad5('0x9')]=_0x34532c[_0xaad5('0x9')];this['countabandonedretry']=_0x34532c[_0xaad5('0xa')];this[_0xaad5('0xb')]=_0x34532c[_0xaad5('0xb')];this['countagentrejectretry']=_0x34532c[_0xaad5('0xc')];this[_0xaad5('0xe')]=_0x3280c1[_0xaad5('0xe')];this[_0xaad5('0xf')]=_0x34532c[_0xaad5('0x10')];this[_0xaad5('0x11')]=_0x34532c[_0xaad5('0x12')];this[_0xaad5('0x13')]=_0x34532c[_0xaad5('0x13')];this[_0xaad5('0x14')]=_0x34532c[_0xaad5('0x14')];this[_0xaad5('0x15')]=_0x34532c[_0xaad5('0x15')];this[_0xaad5('0x16')]=_0x34532c[_0xaad5('0x16')];this['endtime']=this[_0xaad5('0x15')];this[_0xaad5('0x17')]=utils[_0xaad5('0x18')](_0x34532c[_0xaad5('0x14')],_0x34532c[_0xaad5('0x13')]);this[_0xaad5('0x19')]=utils[_0xaad5('0x18')](this[_0xaad5('0x15')],_0x34532c[_0xaad5('0x14')]);this[_0xaad5('0x1a')]=0x0;this[_0xaad5('0x1b')]=_0x3280c1[_0xaad5('0x1b')];this['membername']=_0x3280c1['connectedlinename'];this['reason']=_0x3280c1[_0xaad5('0x1c')];this[_0xaad5('0x1d')]=_0x34532c[_0xaad5('0x1d')];this['callbackuniqueid']=_0x34532c['callbackuniqueid'];this['callbackat']=_0x34532c[_0xaad5('0x1e')];this[_0xaad5('0x1f')]=_0x34532c[_0xaad5('0x1f')];this['ContactId']=_0x34532c[_0xaad5('0x20')];this[_0xaad5('0x21')]=_0x34532c[_0xaad5('0x21')];this['UserId']=_0x34532c[_0xaad5('0x22')];this[_0xaad5('0x23')]=_0x34532c[_0xaad5('0x23')];this[_0xaad5('0x24')]=_0x34532c[_0xaad5('0x24')];this[_0xaad5('0x25')]=_0x34532c[_0xaad5('0x25')]||'';this[_0xaad5('0x26')]=_0x34532c[_0xaad5('0x26')]||'';this[_0xaad5('0x27')]=_0x34532c[_0xaad5('0x27')];this[_0xaad5('0x28')]=_0x34532c[_0xaad5('0x28')];this[_0xaad5('0x29')]=_0x34532c[_0xaad5('0x29')];}module[_0xaad5('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x0ea7=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','reason','callback','callbackuniqueid'];(function(_0x39d5b9,_0x59898f){var _0x17ff1e=function(_0x452fbb){while(--_0x452fbb){_0x39d5b9['push'](_0x39d5b9['shift']());}};_0x17ff1e(++_0x59898f);}(_0x0ea7,0x8b));var _0x70ea=function(_0x4c2ffc,_0x1906db){_0x4c2ffc=_0x4c2ffc-0x0;var _0x2d9d87=_0x0ea7[_0x4c2ffc];return _0x2d9d87;};'use strict';var utils=require(_0x70ea('0x0'));function QueueCallerAbandon(_0x454efc,_0x47b896){this[_0x70ea('0x1')]=_0x454efc[_0x70ea('0x1')];this[_0x70ea('0x2')]=_0x454efc[_0x70ea('0x2')];this['campaigntype']=_0x454efc[_0x70ea('0x2')]===_0x70ea('0x3')?_0x70ea('0x4'):_0x454efc[_0x70ea('0x2')];this[_0x70ea('0x5')]=_0x454efc[_0x70ea('0x5')];this[_0x70ea('0x6')]=_0x454efc[_0x70ea('0x6')];this[_0x70ea('0x7')]=_0x454efc[_0x70ea('0x7')];this[_0x70ea('0x8')]=_0x454efc[_0x70ea('0x5')]+_0x454efc[_0x70ea('0x6')]+_0x454efc[_0x70ea('0x7')]+_0x454efc['countnosuchnumberretry']+_0x454efc[_0x70ea('0x9')]+_0x454efc[_0x70ea('0xa')]+_0x454efc[_0x70ea('0xb')]+_0x454efc[_0x70ea('0xc')];this['countnosuchnumberretry']=_0x454efc[_0x70ea('0xd')];this[_0x70ea('0x9')]=_0x454efc[_0x70ea('0x9')];this['countabandonedretry']=_0x454efc['countabandonedretry'];this[_0x70ea('0xb')]=_0x454efc['countmachineretry'];this[_0x70ea('0xc')]=_0x454efc['countagentrejectretry'];this[_0x70ea('0xe')]=_0x47b896[_0x70ea('0xe')];this[_0x70ea('0xf')]=_0x454efc['name'];this[_0x70ea('0x10')]=_0x454efc[_0x70ea('0x11')];this[_0x70ea('0x12')]=_0x454efc[_0x70ea('0x12')];this['responsetime']=_0x454efc[_0x70ea('0x13')];this[_0x70ea('0x14')]=_0x454efc[_0x70ea('0x14')];this['dropreason']=_0x454efc[_0x70ea('0x15')];this['endtime']=this[_0x70ea('0x14')];this[_0x70ea('0x16')]=utils[_0x70ea('0x17')](_0x454efc[_0x70ea('0x13')],_0x454efc[_0x70ea('0x12')]);this[_0x70ea('0x18')]=utils[_0x70ea('0x17')](this[_0x70ea('0x14')],_0x454efc[_0x70ea('0x13')]);this[_0x70ea('0x19')]=0x0;this[_0x70ea('0x4')]=_0x47b896['queue'];this['membername']=_0x47b896['connectedlinename'];this[_0x70ea('0x1a')]=_0x47b896[_0x70ea('0x1a')];this['callback']=_0x454efc[_0x70ea('0x1b')];this[_0x70ea('0x1c')]=_0x454efc[_0x70ea('0x1c')];this[_0x70ea('0x1d')]=_0x454efc[_0x70ea('0x1d')];this[_0x70ea('0x1e')]=_0x454efc['recallme'];this[_0x70ea('0x1f')]=_0x454efc['ContactId'];this[_0x70ea('0x20')]=_0x454efc['ListId'];this['UserId']=_0x454efc[_0x70ea('0x21')];this[_0x70ea('0x22')]=_0x454efc[_0x70ea('0x22')];this[_0x70ea('0x23')]=_0x454efc[_0x70ea('0x23')];this[_0x70ea('0x24')]=_0x454efc[_0x70ea('0x24')]||'';this[_0x70ea('0x25')]=_0x454efc[_0x70ea('0x25')]||'';this[_0x70ea('0x26')]=_0x454efc['agiafterat'];this[_0x70ea('0x27')]=_0x454efc[_0x70ea('0x27')];this[_0x70ea('0x28')]=_0x454efc['statedesc'];}module[_0x70ea('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 53d87eb..6eaed0b 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 _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3ba5ce,_0x3b266a){var _0x2f1690=function(_0x423c12){while(--_0x423c12){_0x3ba5ce['push'](_0x3ba5ce['shift']());}};_0x2f1690(++_0x3b266a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x9a041d,_0x309b27){var _0x61ad16=function(_0x3ac845){while(--_0x3ac845){_0x9a041d['push'](_0x9a041d['shift']());}};_0x61ad16(++_0x309b27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 09f1f94..4a74c22 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 _0xf28d=['string','isUndefined','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','replace','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','lodash','moment','util','../../../../config/logger','dialer','timezones','ACTIVE','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','milliseconds','diff','seconds','getSeconds','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName'];(function(_0x468623,_0x4a2bd1){var _0xb2c1d0=function(_0x98f9ff){while(--_0x98f9ff){_0x468623['push'](_0x468623['shift']());}};_0xb2c1d0(++_0x4a2bd1);}(_0xf28d,0x193));var _0xdf28=function(_0x25ab51,_0x4f84f5){_0x25ab51=_0x25ab51-0x0;var _0x3b4aa0=_0xf28d[_0x25ab51];return _0x3b4aa0;};'use strict';var _=require(_0xdf28('0x0'));var moment=require(_0xdf28('0x1'));var util=require(_0xdf28('0x2'));var logger=require(_0xdf28('0x3'))(_0xdf28('0x4'));var timezones=require('../../../../config/environment/shared')[_0xdf28('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xdf28('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xdf28('0x7'),'DISACTIVED':_0xdf28('0x8'),'EMPTY_INTERVAL':_0xdf28('0x9'),'INACTIVE':_0xdf28('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xdf28('0xb'),'NULL_INTERVAL':_0xdf28('0xc'),'OVERTIME_INTERVAL':_0xdf28('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xdf28('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xdf28('0xf'),'RUNNING':_0xdf28('0x10'),'UNKNOWN_TIMEZONE':_0xdf28('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xdf28('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2e4a34){return _0x2e4a34[_0xdf28('0x13')]===_0xdf28('0x14');}exports[_0xdf28('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x3be223){return _0x3be223[_0xdf28('0x16')]===_0xdf28('0x17');}exports[_0xdf28('0x18')]=isIVRCampaign;function isOutboundQueue(_0x179cb1){return _0x179cb1[_0xdf28('0x16')]===_0xdf28('0x19');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x588784){return _0x588784[_0xdf28('0x1a')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x1f61cc){return _0x1f61cc['active'];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x1e4e5f,_0x3c878a){var _0x3fc4eb=moment(_0x1e4e5f)[_0xdf28('0x1b')](0x0);var _0x5b5d95=moment(_0x3c878a)[_0xdf28('0x1b')](0x0);return _0x3fc4eb[_0xdf28('0x1c')](_0x5b5d95,_0xdf28('0x1d'));}exports[_0xdf28('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x4b81b5,_0x1e8041){var _0x3acbad=![];var _0x481924=_0x4b81b5[_0xdf28('0x13')]!==_0x1e8041['dialMethod']||_0x4b81b5[_0xdf28('0x1a')]!==_0x1e8041[_0xdf28('0x1a')]||_0x4b81b5['message']!==_0x1e8041['message'];var _0x49299d=_0x4b81b5[_0xdf28('0x1f')]!==_0x1e8041['available']||_0x4b81b5[_0xdf28('0x20')]!==_0x1e8041['loggedIn']||_0x4b81b5[_0xdf28('0x21')]!==_0x1e8041[_0xdf28('0x21')]||_0x4b81b5['paused']!==_0x1e8041[_0xdf28('0x22')]||_0x4b81b5[_0xdf28('0x23')]!==_0x1e8041[_0xdf28('0x23')]||_0x4b81b5[_0xdf28('0x24')]!==_0x1e8041[_0xdf28('0x24')]||_0x4b81b5['waiting']!==_0x1e8041[_0xdf28('0x25')]||_0x4b81b5['inUse']!==_0x1e8041[_0xdf28('0x26')]||_0x4b81b5[_0xdf28('0x27')]!==_0x1e8041[_0xdf28('0x27')];if(_0x4b81b5[_0xdf28('0x28')]&&_0x1e8041['Trunk']){_0x3acbad=_0x4b81b5[_0xdf28('0x28')][_0xdf28('0x29')]!==_0x1e8041['Trunk']['name']||_0x4b81b5[_0xdf28('0x28')][_0xdf28('0x2a')]!==_0x1e8041[_0xdf28('0x28')][_0xdf28('0x2a')];}return _0x481924||_0x49299d||_0x3acbad;}exports[_0xdf28('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x32f073){var _0x4c8d8b=null;var _0x33fdd9=_0x32f073[_0xdf28('0x2c')];if(_[_0xdf28('0x2d')](_0x32f073[_0xdf28('0x2e')])||_['isNil'](_0x32f073[_0xdf28('0x2f')])||_[_0xdf28('0x2d')](_0x32f073['Interval'][_0xdf28('0x30')])){_0x4c8d8b=CAMPAIGN_STATUS[_0xdf28('0x31')];}else if(_[_0xdf28('0x32')](_0x32f073[_0xdf28('0x2e')])||_['isEmpty'](_0x32f073[_0xdf28('0x2f')]['Intervals'])){_0x4c8d8b=CAMPAIGN_STATUS[_0xdf28('0x33')];}else if(_0x33fdd9&&!timezones[_0x33fdd9]){_0x4c8d8b=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x4c8d8b;}function checkAnyValidTrunk(_0x2b7acb,_0xc6f81f){var _0x2648a6=null;var _0x341a75=_0xdf28('0x34');var _0x428fb=[_0xdf28('0x35'),_0xdf28('0x36')];var _0x147982=!![];if(_0x2b7acb['Trunk']&&_0x2b7acb[_0xdf28('0x28')][_0xdf28('0x2a')]){_0x341a75+=_0x2b7acb[_0xdf28('0x28')][_0xdf28('0x29')];_0x2648a6=_0xc6f81f[_0x341a75];_0x147982=_0x428fb[_0xdf28('0x37')](_0x2648a6[_0xdf28('0x38')]);}else if(_0x2b7acb[_0xdf28('0x39')]&&_0x2b7acb[_0xdf28('0x39')]['active']){_0x341a75+=_0x2b7acb[_0xdf28('0x39')][_0xdf28('0x29')];_0x2648a6=_0xc6f81f[_0x341a75];_0x147982=_0x428fb['includes'](_0x2648a6[_0xdf28('0x38')]);}return _0x147982;}function getQueueCampaignStatusMessage(_0x219b2a,_0x1b5ea8){var _0x20f390=CAMPAIGN_STATUS[_0xdf28('0x6')];var _0x20e757=isPreviewCampaign(_0x219b2a);if(!isQueueCampaignActive(_0x219b2a)){if(_0x20e757){_0x20f390=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x219b2a[_0xdf28('0x27')]===0x0&&_0x219b2a[_0xdf28('0x23')]===0x0&&_0x219b2a[_0xdf28('0x25')]===0x0&&(_0x219b2a[_0xdf28('0x24')]||0x0)===0x0){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3a')];}else{_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3b')];}}}else if(_0x219b2a['loggedIn']===0x0){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3c')];}else if(!checkAnyValidTrunk(_0x219b2a,_0x1b5ea8)){_0x20f390=CAMPAIGN_STATUS[_0xdf28('0x3d')];}else if(!isPreviewCampaign(_0x219b2a)){var _0x43352f=checkAnyValidQueueCampaignInterval(_0x219b2a);if(_0x43352f){_0x20f390=_0x43352f;}}return _0x20f390;}exports[_0xdf28('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x44df04){var _0xfb4a6a=CAMPAIGN_STATUS[_0xdf28('0x3b')];if(_0x44df04['originated']===0x0&&_0x44df04['talking']===0x0&&_0x44df04['waiting']===0x0&&(_0x44df04[_0xdf28('0x24')]||0x0)===0x0){_0xfb4a6a=CAMPAIGN_STATUS['INACTIVE'];}return _0xfb4a6a;}exports[_0xdf28('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xbccb5a){var _0x2a249f=_0xbccb5a['match'](/"(.*?)"/);return _0x2a249f?_0x2a249f[0x1]:_0xbccb5a;}exports[_0xdf28('0x40')]=extractCalleridName;function getCallerId(_0x532280,_0x382228,_0x47fedc){if(!_['isUndefined'](_0x47fedc)&&typeof _0x47fedc===_0xdf28('0x41')&&!_[_0xdf28('0x32')](_0x47fedc)){if(!_[_0xdf28('0x42')](_0x382228)&&typeof _0x382228==='string'&&!_[_0xdf28('0x32')](_0x382228)){return util[_0xdf28('0x43')]('\x22%s\x22\x20<%s>',_0x382228,_0x47fedc);}return util[_0xdf28('0x43')](_0xdf28('0x44'),_0x47fedc,_0x47fedc);}if(!_[_0xdf28('0x42')](_0x532280)&&typeof _0x532280===_0xdf28('0x41')&&!_[_0xdf28('0x32')](_0x532280)){return _0x532280;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x384334,_0x2aa422){var _0x596601;var _0x10f369;var _0x4290f9;if(_0x2aa422<=0x0){_0x2aa422=0x1;}_0x596601=new RegExp(_0xdf28('0x45')+_0x2aa422+'}$');_0x10f369=Math['pow'](0xa,_0x2aa422-0x1);_0x4290f9=Math[_0xdf28('0x46')](0xa,_0x2aa422)-0x1;return util['format']('%s',_[_0xdf28('0x47')](_0x384334,_0x596601,_['random'](_0x10f369,_0x4290f9)['toString']()));}exports[_0xdf28('0x48')]=getCallerIdRandom;function decrementOriginate(_0x3b6411){if(_0x3b6411[_0xdf28('0x27')]&&_0x3b6411[_0xdf28('0x27')]>0x0){_0x3b6411[_0xdf28('0x27')]-=0x1;}else{logger['error'](_0xdf28('0x49'));}}exports[_0xdf28('0x4a')]=decrementOriginate;function checkContactEmpty(_0x59acf0){return _0x59acf0&&_0x59acf0[_0xdf28('0x4b')]>0x0;}exports[_0xdf28('0x4c')]=checkContactEmpty;function erlangb(_0x3d1fb4,_0x5e0509){if(_0x5e0509===0x0){return 0x0;}var _0x157bf3=0x1;for(var _0x19422d=0x1;_0x19422d<=_0x5e0509;_0x19422d+=0x1){_0x157bf3=0x1+_0x157bf3*_0x19422d/_0x3d1fb4;}return 0x1/_0x157bf3;}exports[_0xdf28('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x3d7323,_0x24e749,_0x2c347c){if(_0x24e749>_0x2c347c){for(var _0x4b0118=0x0;_0x4b0118<_0x24e749-_0x2c347c;_0x4b0118+=0x1){decrementOriginate(_0x3d7323);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xe524=['erlangb','checkContactLowerLimitOriginate','lodash','../../../../config/logger','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','length'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xe524,0x13a));var _0x4e52=function(_0x3b0e1d,_0x183284){_0x3b0e1d=_0x3b0e1d-0x0;var _0x3ff118=_0xe524[_0x3b0e1d];return _0x3ff118;};'use strict';var _=require(_0x4e52('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x4e52('0x1'))('dialer');var timezones=require('../../../../config/environment/shared')[_0x4e52('0x2')];var CAMPAIGN_STATUS={'ACTIVE':_0x4e52('0x3'),'BLACKLIST':_0x4e52('0x4'),'CONTACTS_RESCHEDULED':_0x4e52('0x5'),'DEACTIVATED':_0x4e52('0x6'),'DISACTIVED':_0x4e52('0x7'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x4e52('0x8'),'NO_AGENTS_LOGGED':_0x4e52('0x9'),'NO_AVAILABLE_CONTACTS':_0x4e52('0xa'),'NULL_INTERVAL':_0x4e52('0xb'),'OVERTIME_INTERVAL':_0x4e52('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0x4e52('0xd'),'QUEUE_RECALL':_0x4e52('0xe'),'RECALL_TIMEOUT':_0x4e52('0xf'),'RUNNING':_0x4e52('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x4e52('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x577a4b){return _0x577a4b[_0x4e52('0x12')]===_0x4e52('0x13');}exports[_0x4e52('0x14')]=isPreviewCampaign;function isIVRCampaign(_0xa6236f){return _0xa6236f[_0x4e52('0x15')]===_0x4e52('0x16');}exports[_0x4e52('0x17')]=isIVRCampaign;function isOutboundQueue(_0xfb1b10){return _0xfb1b10[_0x4e52('0x15')]===_0x4e52('0x18');}exports[_0x4e52('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x23135b){return _0x23135b[_0x4e52('0x1a')];}exports[_0x4e52('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x1fefc2){return _0x1fefc2[_0x4e52('0x1c')];}exports[_0x4e52('0x1d')]=isIVRCampaignActive;function getSeconds(_0xfd0bdc,_0x19bd2c){var _0xc7dc0e=moment(_0xfd0bdc)[_0x4e52('0x1e')](0x0);var _0x12f9fc=moment(_0x19bd2c)[_0x4e52('0x1e')](0x0);return _0xc7dc0e['diff'](_0x12f9fc,'seconds');}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x5011ba,_0x3c107d){var _0x22977e=![];var _0x171631=_0x5011ba[_0x4e52('0x12')]!==_0x3c107d[_0x4e52('0x12')]||_0x5011ba[_0x4e52('0x1a')]!==_0x3c107d['dialActive']||_0x5011ba[_0x4e52('0x1f')]!==_0x3c107d[_0x4e52('0x1f')];var _0x5f1314=_0x5011ba[_0x4e52('0x20')]!==_0x3c107d[_0x4e52('0x20')]||_0x5011ba[_0x4e52('0x21')]!==_0x3c107d[_0x4e52('0x21')]||_0x5011ba['loggedInDb']!==_0x3c107d[_0x4e52('0x22')]||_0x5011ba[_0x4e52('0x23')]!==_0x3c107d['paused']||_0x5011ba[_0x4e52('0x24')]!==_0x3c107d[_0x4e52('0x24')]||_0x5011ba[_0x4e52('0x25')]!==_0x3c107d[_0x4e52('0x25')]||_0x5011ba[_0x4e52('0x26')]!==_0x3c107d['waiting']||_0x5011ba[_0x4e52('0x27')]!==_0x3c107d[_0x4e52('0x27')]||_0x5011ba['originated']!==_0x3c107d[_0x4e52('0x28')];if(_0x5011ba[_0x4e52('0x29')]&&_0x3c107d[_0x4e52('0x29')]){_0x22977e=_0x5011ba[_0x4e52('0x29')][_0x4e52('0x2a')]!==_0x3c107d['Trunk'][_0x4e52('0x2a')]||_0x5011ba[_0x4e52('0x29')][_0x4e52('0x1c')]!==_0x3c107d[_0x4e52('0x29')][_0x4e52('0x1c')];}return _0x171631||_0x5f1314||_0x22977e;}exports[_0x4e52('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x20a4a8){var _0x430a04=null;var _0x3d8ea7=_0x20a4a8['dialTimezone'];if(_[_0x4e52('0x2c')](_0x20a4a8[_0x4e52('0x2d')])||_['isNil'](_0x20a4a8[_0x4e52('0x2e')])||_[_0x4e52('0x2c')](_0x20a4a8[_0x4e52('0x2e')][_0x4e52('0x2f')])){_0x430a04=CAMPAIGN_STATUS[_0x4e52('0x30')];}else if(_[_0x4e52('0x31')](_0x20a4a8[_0x4e52('0x2d')])||_['isEmpty'](_0x20a4a8[_0x4e52('0x2e')][_0x4e52('0x2f')])){_0x430a04=CAMPAIGN_STATUS[_0x4e52('0x32')];}else if(_0x3d8ea7&&!timezones[_0x3d8ea7]){_0x430a04=CAMPAIGN_STATUS[_0x4e52('0x33')];}return _0x430a04;}function checkAnyValidTrunk(_0x351737,_0x5779e6){var _0x5f5827=null;var _0x5abb2c=_0x4e52('0x34');var _0x330ef8=[_0x4e52('0x35'),_0x4e52('0x36')];var _0x30d313=!![];if(_0x351737[_0x4e52('0x29')]&&_0x351737['Trunk'][_0x4e52('0x1c')]){_0x5abb2c+=_0x351737[_0x4e52('0x29')][_0x4e52('0x2a')];_0x5f5827=_0x5779e6[_0x5abb2c];_0x30d313=_0x330ef8[_0x4e52('0x37')](_0x5f5827[_0x4e52('0x38')]);}else if(_0x351737[_0x4e52('0x39')]&&_0x351737[_0x4e52('0x39')][_0x4e52('0x1c')]){_0x5abb2c+=_0x351737[_0x4e52('0x39')]['name'];_0x5f5827=_0x5779e6[_0x5abb2c];_0x30d313=_0x330ef8[_0x4e52('0x37')](_0x5f5827['status']);}return _0x30d313;}function getQueueCampaignStatusMessage(_0x4affea,_0x21792f){var _0x391be0=CAMPAIGN_STATUS[_0x4e52('0x3')];var _0x188ae8=isPreviewCampaign(_0x4affea);if(!isQueueCampaignActive(_0x4affea)){if(_0x188ae8){_0x391be0=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x4affea['originated']===0x0&&_0x4affea[_0x4e52('0x24')]===0x0&&_0x4affea[_0x4e52('0x26')]===0x0&&(_0x4affea[_0x4e52('0x25')]||0x0)===0x0){_0x391be0=CAMPAIGN_STATUS[_0x4e52('0x3a')];}else{_0x391be0=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x4affea['loggedIn']===0x0){_0x391be0=CAMPAIGN_STATUS[_0x4e52('0x3b')];}else if(!checkAnyValidTrunk(_0x4affea,_0x21792f)){_0x391be0=CAMPAIGN_STATUS[_0x4e52('0x3c')];}else if(!isPreviewCampaign(_0x4affea)){var _0x2f2bb0=checkAnyValidQueueCampaignInterval(_0x4affea);if(_0x2f2bb0){_0x391be0=_0x2f2bb0;}}return _0x391be0;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xd64885){var _0x442387=CAMPAIGN_STATUS[_0x4e52('0x3d')];if(_0xd64885['originated']===0x0&&_0xd64885['talking']===0x0&&_0xd64885[_0x4e52('0x26')]===0x0&&(_0xd64885['pTalking']||0x0)===0x0){_0x442387=CAMPAIGN_STATUS[_0x4e52('0x3a')];}return _0x442387;}exports[_0x4e52('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2fe395){var _0x29a912=_0x2fe395[_0x4e52('0x3f')](/"(.*?)"/);return _0x29a912?_0x29a912[0x1]:_0x2fe395;}exports[_0x4e52('0x40')]=extractCalleridName;function getCallerId(_0x4c00be,_0x277f2f,_0x349876){if(!_[_0x4e52('0x41')](_0x349876)&&typeof _0x349876===_0x4e52('0x42')&&!_[_0x4e52('0x31')](_0x349876)){if(!_['isUndefined'](_0x277f2f)&&typeof _0x277f2f===_0x4e52('0x42')&&!_[_0x4e52('0x31')](_0x277f2f)){return util[_0x4e52('0x43')](_0x4e52('0x44'),_0x277f2f,_0x349876);}return util[_0x4e52('0x43')](_0x4e52('0x44'),_0x349876,_0x349876);}if(!_['isUndefined'](_0x4c00be)&&typeof _0x4c00be===_0x4e52('0x42')&&!_[_0x4e52('0x31')](_0x4c00be)){return _0x4c00be;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x2cf3de,_0xe7e50d){var _0x437a62;var _0x217aef;var _0xf3c50;if(_0xe7e50d<=0x0){_0xe7e50d=0x1;}_0x437a62=new RegExp(_0x4e52('0x45')+_0xe7e50d+'}$');_0x217aef=Math['pow'](0xa,_0xe7e50d-0x1);_0xf3c50=Math[_0x4e52('0x46')](0xa,_0xe7e50d)-0x1;return util[_0x4e52('0x43')]('%s',_[_0x4e52('0x47')](_0x2cf3de,_0x437a62,_[_0x4e52('0x48')](_0x217aef,_0xf3c50)[_0x4e52('0x49')]()));}exports[_0x4e52('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x4f6c49){if(_0x4f6c49[_0x4e52('0x28')]&&_0x4f6c49['originated']>0x0){_0x4f6c49['originated']-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x59a1a8){return _0x59a1a8&&_0x59a1a8[_0x4e52('0x4b')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x33bd4f,_0x5464bc){if(_0x5464bc===0x0){return 0x0;}var _0x2d6a7c=0x1;for(var _0x806cdb=0x1;_0x806cdb<=_0x5464bc;_0x806cdb+=0x1){_0x2d6a7c=0x1+_0x2d6a7c*_0x806cdb/_0x33bd4f;}return 0x1/_0x2d6a7c;}exports[_0x4e52('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x438af2,_0x47cfa5,_0x1c6e4f){if(_0x47cfa5>_0x1c6e4f){for(var _0x5704c2=0x0;_0x5704c2<_0x47cfa5-_0x1c6e4f;_0x5704c2+=0x1){decrementOriginate(_0x438af2);}}}exports[_0x4e52('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f7575e0..46de406 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(_0x572a77,_0x40fc36){var _0x4abb12=function(_0x56ba94){while(--_0x56ba94){_0x572a77['push'](_0x572a77['shift']());}};_0x4abb12(++_0x40fc36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x5ec0a1,_0x3da003){var _0x15d22e=function(_0x43dae7){while(--_0x43dae7){_0x5ec0a1['push'](_0x5ec0a1['shift']());}};_0x15d22e(++_0x3da003);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 3132b80..53e8658 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 _0x912b=['path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','syncNewchannel','varset','bind','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','from-voip-provider','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','value','channelstate','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','catch','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','message','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','bluebird'];(function(_0x25d97b,_0x235f20){var _0x30631e=function(_0x1b2f3f){while(--_0x1b2f3f){_0x25d97b['push'](_0x25d97b['shift']());}};_0x30631e(++_0x235f20);}(_0x912b,0xe3));var _0xb912=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x912b[_0x133296];return _0x193517;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xb912('0x0'));var uuid=require('uuid');var moment=require('moment');var path=require(_0xb912('0x1'));var tiff2pdf=require(_0xb912('0x2'));var gs=require(_0xb912('0x3'));var logger=require(_0xb912('0x4'))(_0xb912('0x5'));var ami=require(_0xb912('0x6'));var rpcDb=require(_0xb912('0x7'));var Channel=require(_0xb912('0x8'));var ut=require(_0xb912('0x9'));var Action=require(_0xb912('0xa'));var faxAccount=require(_0xb912('0xb'));var attachment=require(_0xb912('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x13ad02){this[_0xb912('0xd')]={};this[_0xb912('0xe')]=_0x13ad02[_0xb912('0xe')];this[_0xb912('0xf')]=_0x13ad02[_0xb912('0xf')];this[_0xb912('0x10')]={};ami['on']('newchannel',this[_0xb912('0x11')]['bind'](this));ami['on'](_0xb912('0x12'),this['syncVarSet'][_0xb912('0x13')](this));ami['on']('newstate',this[_0xb912('0x14')][_0xb912('0x13')](this));ami['on']('newexten',this[_0xb912('0x15')][_0xb912('0x13')](this));ami['on'](_0xb912('0x16'),this[_0xb912('0x17')]['bind'](this));ami['on'](_0xb912('0x18'),this[_0xb912('0x19')][_0xb912('0x13')](this));ami['on']('hangup',this['syncHangup'][_0xb912('0x13')](this));ami['on'](_0xb912('0x1a'),this[_0xb912('0x1b')][_0xb912('0x13')](this));}Fax['prototype'][_0xb912('0x11')]=function(_0x49ace2){if(_0x49ace2['context']===_0xb912('0x1c')){for(var _0x5b1268 in this['faxAccounts']){if(this[_0xb912('0xe')]['hasOwnProperty'](_0x5b1268)){if(_0x49ace2['exten']===this[_0xb912('0xe')][_0x5b1268]['localstationid']){this[_0xb912('0xd')][_0x49ace2[_0xb912('0x1d')]]={};this['channels'][_0x49ace2['uniqueid']]['channel']=_0x49ace2[_0xb912('0x1e')];this[_0xb912('0xd')][_0x49ace2['uniqueid']]['id']=this[_0xb912('0xe')][_0x5b1268]['id'];this[_0xb912('0xd')][_0x49ace2[_0xb912('0x1d')]][_0xb912('0x1f')]=this[_0xb912('0xe')][_0x5b1268][_0xb912('0x1f')];logger['info'](_0x49ace2['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xb912('0x10')][_0x49ace2['uniqueid']]){this['channels'][_0x49ace2[_0xb912('0x1d')]]={};this['channels'][_0x49ace2['uniqueid']]['channel']=_0x49ace2[_0xb912('0x1e')];logger[_0xb912('0x20')](_0x49ace2[_0xb912('0x1d')],_0xb912('0x21'));}};Fax[_0xb912('0x22')]['syncVarSet']=function(_0x28c768){if(this[_0xb912('0xd')][_0x28c768[_0xb912('0x1d')]]){for(var _0x7f0195 in _0x28c768[_0xb912('0x23')]){if(_0x28c768[_0xb912('0x23')][_0xb912('0x24')](_0x7f0195)){this[_0xb912('0xd')][_0x28c768[_0xb912('0x1d')]][_0x7f0195]=_0x28c768[_0xb912('0x25')];}}}};Fax['prototype'][_0xb912('0x14')]=function(_0x5cbb31){if(this[_0xb912('0xd')][_0x5cbb31[_0xb912('0x1d')]]){this['channels'][_0x5cbb31[_0xb912('0x1d')]][_0xb912('0x26')]=_0x5cbb31['channelstate'];this[_0xb912('0xd')][_0x5cbb31[_0xb912('0x1d')]]['channelstatedesc']=_0x5cbb31['channelstatedesc'];}};Fax['prototype'][_0xb912('0x15')]=function(_0x14f646){if(this[_0xb912('0xd')][_0x14f646[_0xb912('0x1d')]]){for(var _0x4bee05 in _0x14f646['variable']){if(_0x14f646[_0xb912('0x23')][_0xb912('0x24')](_0x4bee05)){this[_0xb912('0xd')][_0x14f646[_0xb912('0x1d')]][_0x4bee05]=_0x14f646[_0xb912('0x25')];}}}};Fax['prototype'][_0xb912('0x17')]=function(_0x1f024e){if(this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]]){this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x27')]=_0x1f024e[_0xb912('0x27')];this['channels'][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x28')]=_0x1f024e[_0xb912('0x28')];this[_0xb912('0xd')][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x29')]=_0x1f024e['localstationid'];this['channels'][_0x1f024e[_0xb912('0x1d')]][_0xb912('0x2a')]=_0x1f024e['filename'];logger['info'](_0x1f024e[_0xb912('0x1d')],'\x20syncFaxStatus\x20');}};Fax[_0xb912('0x22')]['syncReceiveFax']=function(_0xe687ce){var _0x51d4aa=this;if(this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]){var _0x150d80=this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]['id'];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2b')]=_0xe687ce[_0xb912('0x2b')];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]]['pagestransferred']=_0xe687ce[_0xb912('0x2c')];this[_0xb912('0xd')][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x29')]=_0xe687ce[_0xb912('0x29')];this['channels'][_0xe687ce['uniqueid']][_0xb912('0x2d')]=_0xe687ce['resolution'];this['channels'][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2e')]=_0xe687ce['transferrate'];this[_0xb912('0xd')][_0xe687ce['uniqueid']][_0xb912('0x2a')]=_0xe687ce[_0xb912('0x2a')];this['channels'][_0xe687ce[_0xb912('0x1d')]][_0xb912('0x2f')]=_0xe687ce[_0xb912('0x2f')];if(this['channels'][_0xe687ce['uniqueid']][_0xb912('0x2c')]>0x0){tiff2pdf(_0xe687ce['filename'],_0xb912('0x30'),function(_0x18d600){logger[_0xb912('0x20')](_0xe687ce[_0xb912('0x1d')],_0xb912('0x31'),_0x18d600['message']);attachment[_0xb912('0x32')]({'name':path[_0xb912('0x33')](_0xe687ce[_0xb912('0x2a')])['name'],'basename':path['parse'](_0xe687ce[_0xb912('0x2a')])[_0xb912('0x1f')]+_0xb912('0x34'),'type':_0xb912('0x35')})[_0xb912('0x36')](function(_0x15b3fe){faxAccount[_0xb912('0x37')](_0x150d80,{'from':_0xe687ce['calleridnum'],'mapKey':'fax','body':path['parse'](_0xe687ce[_0xb912('0x2a')])[_0xb912('0x1f')]+_0xb912('0x34'),'AttachmentId':_0x15b3fe['id']})[_0xb912('0x38')](function(_0x3550cd){logger['error'](_0xe687ce[_0xb912('0x1d')],'\x20notify\x20',JSON[_0xb912('0x39')](_0x3550cd));});})[_0xb912('0x38')](function(_0x2fbbfa){logger[_0xb912('0x3a')](_0xe687ce[_0xb912('0x1d')],_0xb912('0x3b'),JSON[_0xb912('0x39')](_0x2fbbfa));});});}logger[_0xb912('0x20')](_0xe687ce['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xb912('0x22')][_0xb912('0x1b')]=function(_0x5198f4){if(this[_0xb912('0x10')][_0x5198f4[_0xb912('0x1d')]]){_[_0xb912('0x3c')](this[_0xb912('0xd')][_0x5198f4[_0xb912('0x1d')]],_[_0xb912('0x3d')](_0x5198f4,[_0xb912('0x3e'),_0xb912('0x3f')]));}};function updateStatus(_0x2886fc){if(_0x2886fc[_0xb912('0x40')]){faxMessage[_0xb912('0x41')](_0x2886fc[_0xb912('0x40')],{'failMessage':_0xb912('0x42')})[_0xb912('0x36')](function(_0x38189d){ut[_0xb912('0x43')](_0xb912('0x44'),_0x38189d);})[_0xb912('0x38')](function(_0x9794b5){ut[_0xb912('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x9794b5);});}else{ut[_0xb912('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xb912('0x45')]=function(_0x59eb06,_0x5bc9ae,_0xb79132){var _0x1b47b9=this;var _0x559054={};if(_0x5bc9ae){_0x559054={'read':_0x5bc9ae};}else{_0x559054={'failMessage':_0xb79132};}if(this['actions'][_0x59eb06][_0xb912('0x40')]){faxMessage[_0xb912('0x41')](this['actions'][_0x59eb06][_0xb912('0x40')],_0x559054)[_0xb912('0x36')](function(_0x53f17a){ut[_0xb912('0x43')](_0xb912('0x46'),_0x53f17a);})[_0xb912('0x38')](function(_0x43cd46){ut[_0xb912('0x43')](_0xb912('0x47'),_0x43cd46);})[_0xb912('0x48')](function(){delete _0x1b47b9[_0xb912('0xd')][_0x59eb06];delete _0x1b47b9[_0xb912('0x10')][_0x59eb06];});}else{ut[_0xb912('0x43')](_0xb912('0x49'));delete this[_0xb912('0xd')][_0x59eb06];delete this[_0xb912('0x10')][_0x59eb06];}};Fax['prototype'][_0xb912('0x4a')]=function(_0x3f0a08){var _0x5e0306=this;if(this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]){if(this[_0xb912('0x10')][_0x3f0a08['uniqueid']]){this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]['id']=this[_0xb912('0x10')][_0x3f0a08['uniqueid']]['id'];this[_0xb912('0xd')][_0x3f0a08['uniqueid']][_0xb912('0x1f')]=this[_0xb912('0x10')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x1f')];}logger[_0xb912('0x20')](_0x3f0a08[_0xb912('0x1d')],this[_0xb912('0x10')][_0x3f0a08[_0xb912('0x1d')]]?_0xb912('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0xb912('0x39')](this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]]));if(this['actions'][_0x3f0a08['uniqueid']]){if(this[_0xb912('0xd')][_0x3f0a08['uniqueid']][_0xb912('0x4c')]>0x0&&this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x16')]===_0xb912('0x4d')){this[_0xb912('0x45')](_0x3f0a08['uniqueid'],!![]);}else{this[_0xb912('0x45')](_0x3f0a08[_0xb912('0x1d')],![],this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x4e')]?_0xb912('0x4f')+this[_0xb912('0xd')][_0x3f0a08[_0xb912('0x1d')]][_0xb912('0x4e')]:_0xb912('0x50'));}}}};Fax[_0xb912('0x22')][_0xb912('0x51')]=function(_0x391fcd){var _0x534edd=this;return new BPromise(function(_0x323a79,_0x5399e5){_0x534edd['execOriginate'](_0x391fcd,_0x534edd[_0xb912('0xe')][_0x391fcd['FaxAccountId']])[_0xb912('0x36')](function(_0x16bc53){ut[_0xb912('0x43')](_0xb912('0x52'),_0x16bc53);_0x323a79(ut['message'](_0xb912('0x53')));})[_0xb912('0x38')](function(_0x1c5788){ut['logger'](_0xb912('0x54'),_0x1c5788);updateStatus(_0x391fcd);_0x5399e5(ut['message'](_0xb912('0x55')));});});};Fax[_0xb912('0x22')][_0xb912('0x56')]=function(_0x4e16d9){var _0x372661=this;return new BPromise(function(_0x319a21,_0x2f31f1){var _0x277318=_0x372661[_0xb912('0x57')](_0x372661[_0xb912('0xe')][_0x4e16d9[_0xb912('0x58')]][_0xb912('0x59')],_0x4e16d9);if(_0x277318[_0xb912('0x5a')]){_0x319a21(ut[_0xb912('0x5b')](_0xb912('0x5c')));}else{_0x2f31f1(ut[_0xb912('0x5b')](_0x277318[_0xb912('0x5b')]));}});};function originate(_0x6a7449,_0x24678e,_0x2a098e){return new BPromise(function(_0x56d81e,_0x51478a){if(_0x2a098e){var _0x1cf323=util['format'](_0xb912('0x5d'),path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])['name'],_0x6a7449['path']);gs[_0xb912('0x5e')](_0x1cf323)[_0xb912('0x36')](function(){_0x6a7449[_0xb912('0x1')]=util[_0xb912('0x5f')](_0xb912('0x60'),path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])['dir'],path[_0xb912('0x33')](_0x6a7449[_0xb912('0x1')])[_0xb912('0x1f')]);_0x24678e[_0xb912('0x61')]=_0x6a7449[_0xb912('0x1')];ut[_0xb912('0x43')](_0xb912('0x62'),'');ami[_0xb912('0x63')](ut['variablesAction'](_0x6a7449,_0x24678e))[_0xb912('0x36')](function(_0x59325f){_0x56d81e(_0x59325f);})[_0xb912('0x38')](function(_0x51819b){_0x51478a(_0x51819b);});})[_0xb912('0x38')](function(_0x3cf77d){_0x51478a(_0x3cf77d);});}else{ami[_0xb912('0x63')](ut[_0xb912('0x64')](_0x6a7449,_0x24678e))['then'](function(_0xa819b1){_0x56d81e(_0xa819b1);})[_0xb912('0x38')](function(_0x159ca9){_0x51478a(_0x159ca9);});}});}Fax['prototype'][_0xb912('0x65')]=function(_0xb54e0c,_0x3db571){var _0x2fa69e=this;return new BPromise(function(_0x5d14c2,_0x35168a){var _0x4d8b0b=uuid['v4']();var _0x18f918=ut[_0xb912('0x66')](_0xb54e0c,_0x3db571);_0x2fa69e[_0xb912('0x10')][_0x4d8b0b]=new Action(_0x4d8b0b,_0x3db571,_0xb54e0c);var _0x4e8de0=_0x2fa69e['actions'][_0x4d8b0b];if(path['parse'](_0xb54e0c['path'])['ext']===_0xb912('0x34')){originate(_0x4e8de0,_0x18f918,!![])[_0xb912('0x36')](function(_0x3a4eaf){_0x5d14c2(_0x3a4eaf);})['catch'](function(_0x4df70b){_0x35168a(_0x4df70b);});}else{originate(_0x4e8de0,_0x18f918,![])[_0xb912('0x36')](function(_0x20b02b){_0x5d14c2(_0x20b02b);})[_0xb912('0x38')](function(_0x56d0e0){_0x35168a(_0x56d0e0);});}});};Fax[_0xb912('0x22')][_0xb912('0x67')]=function(_0x401618){return!_[_0xb912('0x68')](_0x401618)&&!_[_0xb912('0x68')](_0x401618[_0xb912('0x1f')])&&!_[_0xb912('0x68')](_0x401618[_0xb912('0x69')])&&_0x401618[_0xb912('0x69')]&&!_[_0xb912('0x68')](this['trunks'][util[_0xb912('0x5f')](_0xb912('0x6a'),_0x401618[_0xb912('0x1f')])])&&!_[_0xb912('0x68')](this[_0xb912('0xf')][util[_0xb912('0x5f')]('SIP/%s',_0x401618['name'])][_0xb912('0x28')])&&(this[_0xb912('0xf')][util[_0xb912('0x5f')]('SIP/%s',_0x401618[_0xb912('0x1f')])][_0xb912('0x28')]==='reachable'||this[_0xb912('0xf')][util[_0xb912('0x5f')](_0xb912('0x6a'),_0x401618[_0xb912('0x1f')])]['status']===_0xb912('0x6b'));};Fax[_0xb912('0x22')][_0xb912('0x57')]=function(_0x30e51b,_0x38392b){if(!this[_0xb912('0x67')](_0x30e51b)){ut[_0xb912('0x43')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xb912('0x68')](_0x30e51b)?'':_0x30e51b[_0xb912('0x1f')]+_0xb912('0x6c'));return{'isValid':![],'message':_0xb912('0x6d')};}if(_[_0xb912('0x68')](_0x38392b[_0xb912('0x5')])){ut[_0xb912('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xb912('0x39')](_0x38392b));return{'isValid':![],'message':_0xb912('0x6e')};}if(_[_0xb912('0x68')](_0x38392b['path'])){ut[_0xb912('0x43')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xb912('0x39')](_0x38392b));return{'isValid':![],'message':_0xb912('0x6f')};}return{'isValid':!![],'message':_0xb912('0x70')};};module[_0xb912('0x71')]=Fax; \ No newline at end of file +var _0x1333=['hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstatedesc','syncNewExten','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','actions','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isNil','active','status','reachable','SIP/%s','unmonitored','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','exports','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newexten','faxstatus','syncFaxStatus','syncReceiveFax'];(function(_0x228253,_0xd40862){var _0xf4576a=function(_0x1cc347){while(--_0x1cc347){_0x228253['push'](_0x228253['shift']());}};_0xf4576a(++_0xd40862);}(_0x1333,0x141));var _0x3133=function(_0x5acc78,_0x346597){_0x5acc78=_0x5acc78-0x0;var _0x467f97=_0x1333[_0x5acc78];return _0x467f97;};'use strict';var util=require('util');var _=require(_0x3133('0x0'));var BPromise=require(_0x3133('0x1'));var uuid=require(_0x3133('0x2'));var moment=require(_0x3133('0x3'));var path=require(_0x3133('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3133('0x5'));var logger=require(_0x3133('0x6'))(_0x3133('0x7'));var ami=require(_0x3133('0x8'));var rpcDb=require(_0x3133('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x3133('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x3133('0xb'));function Fax(_0x23f9b3){this[_0x3133('0xc')]={};this[_0x3133('0xd')]=_0x23f9b3[_0x3133('0xd')];this['trunks']=_0x23f9b3[_0x3133('0xe')];this['actions']={};ami['on'](_0x3133('0xf'),this[_0x3133('0x10')][_0x3133('0x11')](this));ami['on'](_0x3133('0x12'),this[_0x3133('0x13')][_0x3133('0x11')](this));ami['on']('newstate',this['syncNewState'][_0x3133('0x11')](this));ami['on'](_0x3133('0x14'),this['syncNewExten']['bind'](this));ami['on'](_0x3133('0x15'),this[_0x3133('0x16')][_0x3133('0x11')](this));ami['on']('receivefax',this[_0x3133('0x17')][_0x3133('0x11')](this));ami['on'](_0x3133('0x18'),this[_0x3133('0x19')][_0x3133('0x11')](this));ami['on'](_0x3133('0x1a'),this[_0x3133('0x1b')][_0x3133('0x11')](this));}Fax[_0x3133('0x1c')][_0x3133('0x10')]=function(_0x4f7922){if(_0x4f7922[_0x3133('0x1d')]===_0x3133('0x1e')){for(var _0x4677fd in this[_0x3133('0xd')]){if(this['faxAccounts'][_0x3133('0x1f')](_0x4677fd)){if(_0x4f7922[_0x3133('0x20')]===this[_0x3133('0xd')][_0x4677fd][_0x3133('0x21')]){this['channels'][_0x4f7922['uniqueid']]={};this['channels'][_0x4f7922[_0x3133('0x22')]][_0x3133('0x23')]=_0x4f7922[_0x3133('0x23')];this[_0x3133('0xc')][_0x4f7922[_0x3133('0x22')]]['id']=this['faxAccounts'][_0x4677fd]['id'];this[_0x3133('0xc')][_0x4f7922[_0x3133('0x22')]][_0x3133('0x24')]=this[_0x3133('0xd')][_0x4677fd][_0x3133('0x24')];logger[_0x3133('0x25')](_0x4f7922['uniqueid'],_0x3133('0x26'));}}}}if(this['actions'][_0x4f7922[_0x3133('0x22')]]){this[_0x3133('0xc')][_0x4f7922[_0x3133('0x22')]]={};this[_0x3133('0xc')][_0x4f7922[_0x3133('0x22')]]['channel']=_0x4f7922[_0x3133('0x23')];logger[_0x3133('0x25')](_0x4f7922[_0x3133('0x22')],_0x3133('0x26'));}};Fax[_0x3133('0x1c')]['syncVarSet']=function(_0x492216){if(this[_0x3133('0xc')][_0x492216[_0x3133('0x22')]]){for(var _0x529f8a in _0x492216[_0x3133('0x27')]){if(_0x492216[_0x3133('0x27')][_0x3133('0x1f')](_0x529f8a)){this[_0x3133('0xc')][_0x492216[_0x3133('0x22')]][_0x529f8a]=_0x492216[_0x3133('0x28')];}}}};Fax['prototype']['syncNewState']=function(_0xdc362){if(this[_0x3133('0xc')][_0xdc362[_0x3133('0x22')]]){this[_0x3133('0xc')][_0xdc362[_0x3133('0x22')]]['channelstate']=_0xdc362['channelstate'];this['channels'][_0xdc362[_0x3133('0x22')]]['channelstatedesc']=_0xdc362[_0x3133('0x29')];}};Fax[_0x3133('0x1c')][_0x3133('0x2a')]=function(_0x3dcb52){if(this['channels'][_0x3dcb52[_0x3133('0x22')]]){for(var _0x2f6c84 in _0x3dcb52[_0x3133('0x27')]){if(_0x3dcb52[_0x3133('0x27')][_0x3133('0x1f')](_0x2f6c84)){this[_0x3133('0xc')][_0x3dcb52[_0x3133('0x22')]][_0x2f6c84]=_0x3dcb52['value'];}}}};Fax[_0x3133('0x1c')][_0x3133('0x16')]=function(_0x48f38b){if(this[_0x3133('0xc')][_0x48f38b[_0x3133('0x22')]]){this[_0x3133('0xc')][_0x48f38b[_0x3133('0x22')]]['operation']=_0x48f38b[_0x3133('0x2b')];this[_0x3133('0xc')][_0x48f38b[_0x3133('0x22')]]['status']=_0x48f38b['status'];this['channels'][_0x48f38b[_0x3133('0x22')]][_0x3133('0x21')]=_0x48f38b[_0x3133('0x21')];this[_0x3133('0xc')][_0x48f38b[_0x3133('0x22')]][_0x3133('0x2c')]=_0x48f38b[_0x3133('0x2c')];logger['info'](_0x48f38b[_0x3133('0x22')],_0x3133('0x2d'));}};Fax['prototype'][_0x3133('0x17')]=function(_0x3307d7){var _0x29a5ba=this;if(this['channels'][_0x3307d7[_0x3133('0x22')]]){var _0x1b2e8b=this[_0x3133('0xc')][_0x3307d7['uniqueid']]['id'];this['channels'][_0x3307d7[_0x3133('0x22')]][_0x3133('0x2e')]=_0x3307d7[_0x3133('0x2e')];this[_0x3133('0xc')][_0x3307d7[_0x3133('0x22')]][_0x3133('0x2f')]=_0x3307d7[_0x3133('0x2f')];this['channels'][_0x3307d7[_0x3133('0x22')]][_0x3133('0x21')]=_0x3307d7[_0x3133('0x21')];this[_0x3133('0xc')][_0x3307d7[_0x3133('0x22')]][_0x3133('0x30')]=_0x3307d7[_0x3133('0x30')];this['channels'][_0x3307d7['uniqueid']][_0x3133('0x31')]=_0x3307d7['transferrate'];this[_0x3133('0xc')][_0x3307d7[_0x3133('0x22')]]['filename']=_0x3307d7['filename'];this[_0x3133('0xc')][_0x3307d7[_0x3133('0x22')]][_0x3133('0x32')]=_0x3307d7[_0x3133('0x32')];if(this['channels'][_0x3307d7[_0x3133('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x3307d7[_0x3133('0x2c')],_0x3133('0x33'),function(_0x3ed78c){logger[_0x3133('0x25')](_0x3307d7[_0x3133('0x22')],_0x3133('0x34'),_0x3ed78c[_0x3133('0x35')]);attachment[_0x3133('0x36')]({'name':path[_0x3133('0x37')](_0x3307d7[_0x3133('0x2c')])['name'],'basename':path['parse'](_0x3307d7[_0x3133('0x2c')])[_0x3133('0x24')]+_0x3133('0x38'),'type':'application/pdf'})[_0x3133('0x39')](function(_0x3c1f64){faxAccount[_0x3133('0x3a')](_0x1b2e8b,{'from':_0x3307d7[_0x3133('0x32')],'mapKey':_0x3133('0x7'),'body':path['parse'](_0x3307d7[_0x3133('0x2c')])[_0x3133('0x24')]+_0x3133('0x38'),'AttachmentId':_0x3c1f64['id']})['catch'](function(_0x5e174f){logger[_0x3133('0x3b')](_0x3307d7[_0x3133('0x22')],_0x3133('0x3c'),JSON[_0x3133('0x3d')](_0x5e174f));});})[_0x3133('0x3e')](function(_0xbcba41){logger['error'](_0x3307d7[_0x3133('0x22')],'\x20receiveFax\x20',JSON[_0x3133('0x3d')](_0xbcba41));});});}logger[_0x3133('0x25')](_0x3307d7[_0x3133('0x22')],_0x3133('0x3f'));}};Fax['prototype'][_0x3133('0x1b')]=function(_0x5a6c19){if(this[_0x3133('0x40')][_0x5a6c19[_0x3133('0x22')]]){_['merge'](this['channels'][_0x5a6c19[_0x3133('0x22')]],_[_0x3133('0x41')](_0x5a6c19,[_0x3133('0x42'),_0x3133('0x43')]));}};function updateStatus(_0x243cb1){if(_0x243cb1[_0x3133('0x44')]){faxMessage[_0x3133('0x45')](_0x243cb1[_0x3133('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x3133('0x39')](function(_0x25a244){ut[_0x3133('0x46')](_0x3133('0x47'),_0x25a244);})[_0x3133('0x3e')](function(_0x2f9a35){ut[_0x3133('0x46')](_0x3133('0x48'),_0x2f9a35);});}else{ut[_0x3133('0x46')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x3133('0x49')]=function(_0x5e31f4,_0xab24c0,_0x4ec620){var _0xb5cc7=this;var _0x482bc7={};if(_0xab24c0){_0x482bc7={'read':_0xab24c0};}else{_0x482bc7={'failMessage':_0x4ec620};}if(this[_0x3133('0x40')][_0x5e31f4][_0x3133('0x44')]){faxMessage['update'](this[_0x3133('0x40')][_0x5e31f4][_0x3133('0x44')],_0x482bc7)[_0x3133('0x39')](function(_0x4b3716){ut[_0x3133('0x46')](_0x3133('0x4a'),_0x4b3716);})[_0x3133('0x3e')](function(_0x214393){ut[_0x3133('0x46')]('[Fax][Message][NoUpdate1]',_0x214393);})[_0x3133('0x4b')](function(){delete _0xb5cc7['channels'][_0x5e31f4];delete _0xb5cc7[_0x3133('0x40')][_0x5e31f4];});}else{ut[_0x3133('0x46')]('[Fax][Message][NoUpdate2]');delete this[_0x3133('0xc')][_0x5e31f4];delete this['actions'][_0x5e31f4];}};Fax[_0x3133('0x1c')][_0x3133('0x19')]=function(_0x1dff03){var _0x59225a=this;if(this[_0x3133('0xc')][_0x1dff03[_0x3133('0x22')]]){if(this[_0x3133('0x40')][_0x1dff03['uniqueid']]){this['channels'][_0x1dff03['uniqueid']]['id']=this[_0x3133('0x40')][_0x1dff03['uniqueid']]['id'];this[_0x3133('0xc')][_0x1dff03[_0x3133('0x22')]]['name']=this[_0x3133('0x40')][_0x1dff03['uniqueid']][_0x3133('0x24')];}logger['info'](_0x1dff03[_0x3133('0x22')],this[_0x3133('0x40')][_0x1dff03[_0x3133('0x22')]]?_0x3133('0x4c'):_0x3133('0x4d'),JSON[_0x3133('0x3d')](this['channels'][_0x1dff03[_0x3133('0x22')]]));if(this[_0x3133('0x40')][_0x1dff03[_0x3133('0x22')]]){if(this[_0x3133('0xc')][_0x1dff03[_0x3133('0x22')]][_0x3133('0x4e')]>0x0&&this[_0x3133('0xc')][_0x1dff03['uniqueid']]['faxstatus']===_0x3133('0x4f')){this[_0x3133('0x49')](_0x1dff03[_0x3133('0x22')],!![]);}else{this[_0x3133('0x49')](_0x1dff03[_0x3133('0x22')],![],this[_0x3133('0xc')][_0x1dff03[_0x3133('0x22')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this['channels'][_0x1dff03[_0x3133('0x22')]][_0x3133('0x50')]:_0x3133('0x51'));}}}};Fax[_0x3133('0x1c')][_0x3133('0x52')]=function(_0x4c0099){var _0x23808b=this;return new BPromise(function(_0x552440,_0x229737){_0x23808b[_0x3133('0x53')](_0x4c0099,_0x23808b['faxAccounts'][_0x4c0099[_0x3133('0x54')]])[_0x3133('0x39')](function(_0x2c10d1){ut[_0x3133('0x46')](_0x3133('0x55'),_0x2c10d1);_0x552440(ut['message']('Fax\x20received'));})['catch'](function(_0x17fafe){ut['logger']('[Fax][execOriginate][failure]',_0x17fafe);updateStatus(_0x4c0099);_0x229737(ut['message'](_0x3133('0x56')));});});};Fax[_0x3133('0x1c')][_0x3133('0x57')]=function(_0x7844a7){var _0x18f4a6=this;return new BPromise(function(_0x240a0c,_0x446d15){var _0x1da4fd=_0x18f4a6['checkTrunk'](_0x18f4a6['faxAccounts'][_0x7844a7[_0x3133('0x54')]][_0x3133('0x58')],_0x7844a7);if(_0x1da4fd[_0x3133('0x59')]){_0x240a0c(ut[_0x3133('0x35')]('Trunk\x20Reachable'));}else{_0x446d15(ut[_0x3133('0x35')](_0x1da4fd[_0x3133('0x35')]));}});};function originate(_0x513447,_0x56cbee,_0x28b99c){return new BPromise(function(_0x2fa7fd,_0x519910){if(_0x28b99c){var _0x70821f=util[_0x3133('0x5a')](_0x3133('0x5b'),path['parse'](_0x513447[_0x3133('0x4')])['name'],_0x513447[_0x3133('0x4')]);gs['execute'](_0x70821f)[_0x3133('0x39')](function(){_0x513447[_0x3133('0x4')]=util['format']('%s/%s.tif',path['parse'](_0x513447[_0x3133('0x4')])[_0x3133('0x5c')],path[_0x3133('0x37')](_0x513447['path'])['name']);_0x56cbee[_0x3133('0x5d')]=_0x513447['path'];ut[_0x3133('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0x3133('0x5e')](ut[_0x3133('0x5f')](_0x513447,_0x56cbee))[_0x3133('0x39')](function(_0x346218){_0x2fa7fd(_0x346218);})['catch'](function(_0x190776){_0x519910(_0x190776);});})['catch'](function(_0x5b6bf1){_0x519910(_0x5b6bf1);});}else{ami[_0x3133('0x5e')](ut['variablesAction'](_0x513447,_0x56cbee))[_0x3133('0x39')](function(_0x42dc3b){_0x2fa7fd(_0x42dc3b);})[_0x3133('0x3e')](function(_0x397585){_0x519910(_0x397585);});}});}Fax[_0x3133('0x1c')][_0x3133('0x53')]=function(_0x4d8351,_0x39b1e2){var _0x3efd26=this;return new BPromise(function(_0x43507b,_0x1dcb3f){var _0xb0ae58=uuid['v4']();var _0x5eb921=ut[_0x3133('0x60')](_0x4d8351,_0x39b1e2);_0x3efd26['actions'][_0xb0ae58]=new Action(_0xb0ae58,_0x39b1e2,_0x4d8351);var _0x570d10=_0x3efd26[_0x3133('0x40')][_0xb0ae58];if(path[_0x3133('0x37')](_0x4d8351['path'])[_0x3133('0x61')]==='.pdf'){originate(_0x570d10,_0x5eb921,!![])[_0x3133('0x39')](function(_0x1a6df8){_0x43507b(_0x1a6df8);})[_0x3133('0x3e')](function(_0x4c9518){_0x1dcb3f(_0x4c9518);});}else{originate(_0x570d10,_0x5eb921,![])[_0x3133('0x39')](function(_0x5e5d6c){_0x43507b(_0x5e5d6c);})[_0x3133('0x3e')](function(_0x4127e7){_0x1dcb3f(_0x4127e7);});}});};Fax[_0x3133('0x1c')]['isTrunkReachable']=function(_0x43dadc){return!_[_0x3133('0x62')](_0x43dadc)&&!_[_0x3133('0x62')](_0x43dadc[_0x3133('0x24')])&&!_[_0x3133('0x62')](_0x43dadc[_0x3133('0x63')])&&_0x43dadc[_0x3133('0x63')]&&!_[_0x3133('0x62')](this[_0x3133('0xe')][util[_0x3133('0x5a')]('SIP/%s',_0x43dadc['name'])])&&!_[_0x3133('0x62')](this[_0x3133('0xe')][util[_0x3133('0x5a')]('SIP/%s',_0x43dadc[_0x3133('0x24')])][_0x3133('0x64')])&&(this['trunks'][util[_0x3133('0x5a')]('SIP/%s',_0x43dadc['name'])][_0x3133('0x64')]===_0x3133('0x65')||this[_0x3133('0xe')][util[_0x3133('0x5a')](_0x3133('0x66'),_0x43dadc[_0x3133('0x24')])][_0x3133('0x64')]===_0x3133('0x67'));};Fax[_0x3133('0x1c')][_0x3133('0x68')]=function(_0x1e960b,_0xbc6ac4){if(!this[_0x3133('0x69')](_0x1e960b)){ut['logger'](_0x3133('0x6a'),_[_0x3133('0x62')](_0x1e960b)?'':_0x1e960b['name']+_0x3133('0x6b'));return{'isValid':![],'message':_0x3133('0x6c')};}if(_['isNil'](_0xbc6ac4[_0x3133('0x7')])){ut[_0x3133('0x46')](_0x3133('0x6d'),JSON[_0x3133('0x3d')](_0xbc6ac4));return{'isValid':![],'message':_0x3133('0x6e')};}if(_[_0x3133('0x62')](_0xbc6ac4[_0x3133('0x4')])){ut['logger'](_0x3133('0x6f'),JSON[_0x3133('0x3d')](_0xbc6ac4));return{'isValid':![],'message':_0x3133('0x70')};}return{'isValid':!![],'message':_0x3133('0x71')};};module[_0x3133('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 64abd98..cb8507f 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 _0x262f=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20'];(function(_0x1e4050,_0x3fdee2){var _0x16b997=function(_0x1034ab){while(--_0x1034ab){_0x1e4050['push'](_0x1e4050['shift']());}};_0x16b997(++_0x3fdee2);}(_0x262f,0x1ef));var _0xf262=function(_0x454f36,_0x579666){_0x454f36=_0x454f36-0x0;var _0x387b6e=_0x262f[_0x454f36];return _0x387b6e;};'use strict';var util=require('util');var BPromise=require(_0xf262('0x0'));var logger=require(_0xf262('0x1'))(_0xf262('0x2'));var _=require(_0xf262('0x3'));var faxAccount=require(_0xf262('0x4'));function loggerCatch(_0x4e527b){return function(_0x1aa223){logger[_0xf262('0x5')](_0x4e527b,util[_0xf262('0x6')](_0x1aa223,{'showHidden':![],'depth':null}));};}exports[_0xf262('0x7')]=function(_0x9e410e,_0x1b24c0){return BPromise[_0xf262('0x8')]()[_0xf262('0x9')](faxAccount[_0xf262('0x7')](_0x9e410e,_0x1b24c0))['catch'](loggerCatch(_0xf262('0xa')));}; \ No newline at end of file +var _0xbfeb=['util','bluebird','../../../config/logger','lodash','error','notify','then','[Notify]\x20'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0xbfeb,0xd8));var _0xbbfe=function(_0x1333cc,_0x509acf){_0x1333cc=_0x1333cc-0x0;var _0x40caf8=_0xbfeb[_0x1333cc];return _0x40caf8;};'use strict';var util=require(_0xbbfe('0x0'));var BPromise=require(_0xbbfe('0x1'));var logger=require(_0xbbfe('0x2'))('preview');var _=require(_0xbbfe('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x24a90f){return function(_0x105d91){logger[_0xbbfe('0x4')](_0x24a90f,util['inspect'](_0x105d91,{'showHidden':![],'depth':null}));};}exports[_0xbbfe('0x5')]=function(_0x45d6a1,_0x46a220){return BPromise['resolve']()[_0xbbfe('0x6')](faxAccount[_0xbbfe('0x5')](_0x45d6a1,_0x46a220))['catch'](loggerCatch(_0xbbfe('0x7')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index a55e041..14ae661 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 _0x8222=['inspect','../../../../config/logger','fax','child_process','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x8222,0x191));var _0x2822=function(_0x514d12,_0x4b4234){_0x514d12=_0x514d12-0x0;var _0x519434=_0x8222[_0x514d12];return _0x519434;};'use strict';var util=require('util');var logger=require(_0x2822('0x0'))(_0x2822('0x1'));var BPromise=require('bluebird');var exec=require(_0x2822('0x2'))[_0x2822('0x3')];exports['execute']=function(_0x142edf){return new BPromise(function(_0x499f5c,_0x839c2d){exec(_0x142edf,function(_0x4057df,_0x3b3007,_0x367658){logger[_0x2822('0x4')](_0x2822('0x5'),_0x3b3007);if(_0x4057df){logger[_0x2822('0x4')](_0x2822('0x5'),_0x2822('0x6'),util[_0x2822('0x7')](_0x4057df,{'showHidden':![],'depth':null}),_0x3b3007,_0x367658);_0x839c2d(_0x4057df);}_0x499f5c(_0x3b3007);});});}; \ No newline at end of file +var _0xb298=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','Exec\x20gs','\x20Error\x20:'];(function(_0x46844c,_0x23961a){var _0x3a4278=function(_0x1c7d8b){while(--_0x1c7d8b){_0x46844c['push'](_0x46844c['shift']());}};_0x3a4278(++_0x23961a);}(_0xb298,0xc7));var _0x8b29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb298[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8b29('0x0'));var logger=require(_0x8b29('0x1'))(_0x8b29('0x2'));var BPromise=require(_0x8b29('0x3'));var exec=require(_0x8b29('0x4'))[_0x8b29('0x5')];exports['execute']=function(_0x3a8b62){return new BPromise(function(_0x50233b,_0x428d54){exec(_0x3a8b62,function(_0x54b9fa,_0x221b0b,_0x5b849e){logger['info'](_0x8b29('0x6'),_0x221b0b);if(_0x54b9fa){logger['info'](_0x8b29('0x6'),_0x8b29('0x7'),util[_0x8b29('0x8')](_0x54b9fa,{'showHidden':![],'depth':null}),_0x221b0b,_0x5b849e);_0x428d54(_0x54b9fa);}_0x50233b(_0x221b0b);});});}; \ 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 fe5c77d..4192506 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 _0x7cb2=['\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','message','info','addVariables','headerinfo','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x7cb2,0x178));var _0x27cb=function(_0x555497,_0x6a6ce7){_0x555497=_0x555497-0x0;var _0x1c5541=_0x7cb2[_0x555497];return _0x1c5541;};'use strict';var util=require('util');var _=require(_0x27cb('0x0'));var moment=require(_0x27cb('0x1'));var logger=require(_0x27cb('0x2'))(_0x27cb('0x3'));exports[_0x27cb('0x4')]=function(_0x2b7c7c){return{'message':_0x2b7c7c};};exports['logger']=function(_0x2c62b4,_0x37045a){logger[_0x27cb('0x5')](_0x2c62b4,util['inspect'](_0x37045a,{'showHidden':![],'depth':null}));};exports[_0x27cb('0x6')]=function(_0x3ca9ec,_0xeddcf3){var _0x1fade4={'XMF-ECM':_0xeddcf3['ecm'],'XMF-HEADERINFO':_0xeddcf3[_0x27cb('0x7')],'XMF-MINRATE':_0xeddcf3['minrate'],'XMF-MAXRATE':_0xeddcf3[_0x27cb('0x8')],'XMF-MODEM':util[_0x27cb('0x9')]('\x22%s\x22',_0xeddcf3[_0x27cb('0xa')]),'XMF-GATEWAY':_0xeddcf3[_0x27cb('0xb')],'XMF-FAXDETECT':_0xeddcf3[_0x27cb('0xc')],'XMF-T38TIMEOUT':_0xeddcf3[_0x27cb('0xd')],'XMF-LOCALSTATIONID':_0xeddcf3[_0x27cb('0xe')],'XMF-PATH':_0x3ca9ec[_0x27cb('0xf')]};return _0x1fade4;};exports[_0x27cb('0x10')]=function(_0x3fc305,_0x3e9a64){return{'actionid':_0x3fc305['uniqueid'],'action':'originate','channel':_0x3fc305[_0x27cb('0x11')],'Exten':_0x27cb('0x12'),'Context':_0x27cb('0x13'),'Priority':'1','callerid':util[_0x27cb('0x9')](_0x27cb('0x14'),_0x3fc305[_0x27cb('0x7')]?_0x3fc305['headerinfo']:'',_0x3fc305[_0x27cb('0xe')]),'variable':_0x3e9a64,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3fc305[_0x27cb('0x15')]};}; \ No newline at end of file +var _0x9550=['inspect','ecm','headerinfo','minrate','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','info'];(function(_0x342458,_0xda92da){var _0x206f32=function(_0x531644){while(--_0x531644){_0x342458['push'](_0x342458['shift']());}};_0x206f32(++_0xda92da);}(_0x9550,0xe3));var _0x0955=function(_0x950886,_0x4797ef){_0x950886=_0x950886-0x0;var _0x1c68ac=_0x9550[_0x950886];return _0x1c68ac;};'use strict';var util=require(_0x0955('0x0'));var _=require(_0x0955('0x1'));var moment=require(_0x0955('0x2'));var logger=require(_0x0955('0x3'))(_0x0955('0x4'));exports[_0x0955('0x5')]=function(_0xb6e850){return{'message':_0xb6e850};};exports['logger']=function(_0x3af961,_0x213b22){logger[_0x0955('0x6')](_0x3af961,util[_0x0955('0x7')](_0x213b22,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x32b036,_0x20f897){var _0x1d3e50={'XMF-ECM':_0x20f897[_0x0955('0x8')],'XMF-HEADERINFO':_0x20f897[_0x0955('0x9')],'XMF-MINRATE':_0x20f897[_0x0955('0xa')],'XMF-MAXRATE':_0x20f897[_0x0955('0xb')],'XMF-MODEM':util['format'](_0x0955('0xc'),_0x20f897['modem']),'XMF-GATEWAY':_0x20f897[_0x0955('0xd')],'XMF-FAXDETECT':_0x20f897[_0x0955('0xe')],'XMF-T38TIMEOUT':_0x20f897[_0x0955('0xf')],'XMF-LOCALSTATIONID':_0x20f897[_0x0955('0x10')],'XMF-PATH':_0x32b036[_0x0955('0x11')]};return _0x1d3e50;};exports[_0x0955('0x12')]=function(_0x874bac,_0x48141c){return{'actionid':_0x874bac[_0x0955('0x13')],'action':_0x0955('0x14'),'channel':_0x874bac[_0x0955('0x15')],'Exten':_0x0955('0x16'),'Context':_0x0955('0x17'),'Priority':'1','callerid':util[_0x0955('0x18')](_0x0955('0x19'),_0x874bac[_0x0955('0x9')]?_0x874bac[_0x0955('0x9')]:'',_0x874bac[_0x0955('0x10')]),'variable':_0x48141c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x874bac[_0x0955('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index a141e7d..6310a73 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 _0x5eed=['moment','./realtime','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','util'];(function(_0x525976,_0x31512c){var _0xc59856=function(_0x53d9a3){while(--_0x53d9a3){_0x525976['push'](_0x525976['shift']());}};_0xc59856(++_0x31512c);}(_0x5eed,0x8d));var _0xd5ee=function(_0x592cbf,_0x366c2a){_0x592cbf=_0x592cbf-0x0;var _0x1b573b=_0x5eed[_0x592cbf];return _0x1b573b;};'use strict';var util=require(_0xd5ee('0x0'));var moment=require(_0xd5ee('0x1'));var server=require('./server');var Realtime=require(_0xd5ee('0x2'));var Report=require(_0xd5ee('0x3'));var Acw=require(_0xd5ee('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0xd5ee('0x5'));var Fax=require(_0xd5ee('0x6'));var user=require(_0xd5ee('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xd5ee('0x8'));var voiceCallReport=require(_0xd5ee('0x9'));var trunk=require(_0xd5ee('0xa'));var trigger=require(_0xd5ee('0xb'));var template=require(_0xd5ee('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xd5ee('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xd5ee('0xe'));var zendesk=require(_0xd5ee('0xf'));var salesforce=require(_0xd5ee('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xd5ee('0x11'));var zoho=require(_0xd5ee('0x12'));var vtiger=require(_0xd5ee('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xd5ee('0x14'));var dynamics365=require(_0xd5ee('0x15'));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(_0xd5ee('0x16'))(_0xd5ee('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd5ee('0x18')](_0xd5ee('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd5ee('0x18')](_0xd5ee('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xd5ee('0x1a')]()[_0xd5ee('0x1b')](user[_0xd5ee('0x1c')]())['then'](realtime[_0xd5ee('0x1d')]())[_0xd5ee('0x1b')](user[_0xd5ee('0x1e')]())['then'](realtime[_0xd5ee('0x1f')]())['then'](trunk[_0xd5ee('0x20')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x21')]())[_0xd5ee('0x1b')](voiceQueue['getVoiceQueues']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x22')]())[_0xd5ee('0x1b')](trigger['getTriggers']())['then'](realtime[_0xd5ee('0x23')]())['then'](template[_0xd5ee('0x24')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x25')]())[_0xd5ee('0x1b')](zendesk['getZendeskAccounts']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x26')]())[_0xd5ee('0x1b')](salesforce[_0xd5ee('0x27')]())[_0xd5ee('0x1b')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xd5ee('0x28')]())['then'](realtime[_0xd5ee('0x29')]())[_0xd5ee('0x1b')](freshdesk[_0xd5ee('0x2a')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2b')]())[_0xd5ee('0x1b')](desk[_0xd5ee('0x2c')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2d')]())[_0xd5ee('0x1b')](zoho['getZohoAccounts']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x2e')]())[_0xd5ee('0x1b')](vtiger[_0xd5ee('0x2f')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x30')]())[_0xd5ee('0x1b')](freshsales[_0xd5ee('0x31')]())[_0xd5ee('0x1b')](realtime['initFreshsalesAccounts']())[_0xd5ee('0x1b')](servicenow[_0xd5ee('0x32')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x33')]())[_0xd5ee('0x1b')](dynamics365[_0xd5ee('0x34')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x35')]())[_0xd5ee('0x1b')](campaign['getCampaigns']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x36')]())[_0xd5ee('0x1b')](voiceExtension[_0xd5ee('0x37')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x38')]())['then'](faxAccount[_0xd5ee('0x39')]())['then'](realtime[_0xd5ee('0x3a')]())[_0xd5ee('0x1b')](function(){return realtime;});}function initParams(){return Promise[_0xd5ee('0x1a')]()[_0xd5ee('0x1b')](voiceQueueReport[_0xd5ee('0x3b')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x3c')]())[_0xd5ee('0x1b')](cmHopperHistory[_0xd5ee('0x3d')]())[_0xd5ee('0x1b')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x3e')]())[_0xd5ee('0x1b')](voiceCallReport[_0xd5ee('0x3f')]())[_0xd5ee('0x1b')](realtime[_0xd5ee('0x40')]())[_0xd5ee('0x41')](function(_0x1e1dc6){logger[_0xd5ee('0x42')](_0xd5ee('0x43'),util['inspect'](_0x1e1dc6,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd5ee('0x44')](realtime,preview,fax)[_0xd5ee('0x1b')](function(){return initRealtime();})[_0xd5ee('0x1b')](function(){return initParams();})[_0xd5ee('0x1b')](function(){report[_0xd5ee('0x45')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x17d69a){logger['error'](_0xd5ee('0x46'),util['inspect'](_0x17d69a,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x9d1c=['./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','listen','sync','catch','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory'];(function(_0x26069c,_0x53be6e){var _0x5d5680=function(_0x4c1b16){while(--_0x4c1b16){_0x26069c['push'](_0x26069c['shift']());}};_0x5d5680(++_0x53be6e);}(_0x9d1c,0xd4));var _0xc9d1=function(_0x4774b3,_0x37c087){_0x4774b3=_0x4774b3-0x0;var _0x2f4a90=_0x9d1c[_0x4774b3];return _0x2f4a90;};'use strict';var util=require(_0xc9d1('0x0'));var moment=require('moment');var server=require(_0xc9d1('0x1'));var Realtime=require(_0xc9d1('0x2'));var Report=require(_0xc9d1('0x3'));var Acw=require(_0xc9d1('0x4'));var Trigger=require(_0xc9d1('0x5'));var Dialer=require(_0xc9d1('0x6'));var Preview=require(_0xc9d1('0x7'));var Fax=require(_0xc9d1('0x8'));var user=require(_0xc9d1('0x9'));var voiceQueue=require(_0xc9d1('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xc9d1('0xb'));var trunk=require(_0xc9d1('0xc'));var trigger=require(_0xc9d1('0xd'));var template=require(_0xc9d1('0xe'));var cmHopperHistory=require(_0xc9d1('0xf'));var campaign=require(_0xc9d1('0x10'));var voiceExtension=require(_0xc9d1('0x11'));var faxAccount=require(_0xc9d1('0x12'));var zendesk=require(_0xc9d1('0x13'));var salesforce=require(_0xc9d1('0x14'));var sugarcrm=require(_0xc9d1('0x15'));var freshdesk=require(_0xc9d1('0x16'));var desk=require(_0xc9d1('0x17'));var zoho=require(_0xc9d1('0x18'));var vtiger=require(_0xc9d1('0x19'));var freshsales=require(_0xc9d1('0x1a'));var servicenow=require(_0xc9d1('0x1b'));var dynamics365=require(_0xc9d1('0x1c'));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(_0xc9d1('0x1d'))(_0xc9d1('0x1e'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc9d1('0x1f')](_0xc9d1('0x20'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xc9d1('0x20'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc9d1('0x21')]()[_0xc9d1('0x22')](user[_0xc9d1('0x23')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x24')]())['then'](user[_0xc9d1('0x25')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x26')]())[_0xc9d1('0x22')](trunk[_0xc9d1('0x27')]())[_0xc9d1('0x22')](realtime['initTrunks']())[_0xc9d1('0x22')](voiceQueue[_0xc9d1('0x28')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x29')]())[_0xc9d1('0x22')](trigger['getTriggers']())[_0xc9d1('0x22')](realtime['initTriggers']())[_0xc9d1('0x22')](template[_0xc9d1('0x2a')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x2b')]())[_0xc9d1('0x22')](zendesk[_0xc9d1('0x2c')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x2d')]())[_0xc9d1('0x22')](salesforce['getSalesforceAccounts']())[_0xc9d1('0x22')](realtime[_0xc9d1('0x2e')]())[_0xc9d1('0x22')](sugarcrm[_0xc9d1('0x2f')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x30')]())[_0xc9d1('0x22')](freshdesk[_0xc9d1('0x31')]())[_0xc9d1('0x22')](realtime['initFreshdeskAccounts']())['then'](desk['getDeskAccounts']())['then'](realtime[_0xc9d1('0x32')]())[_0xc9d1('0x22')](zoho['getZohoAccounts']())[_0xc9d1('0x22')](realtime['initZohoAccounts']())[_0xc9d1('0x22')](vtiger[_0xc9d1('0x33')]())[_0xc9d1('0x22')](realtime['initVtigerAccounts']())[_0xc9d1('0x22')](freshsales[_0xc9d1('0x34')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x35')]())[_0xc9d1('0x22')](servicenow[_0xc9d1('0x36')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x37')]())[_0xc9d1('0x22')](dynamics365['getDynamics365Accounts']())[_0xc9d1('0x22')](realtime[_0xc9d1('0x38')]())[_0xc9d1('0x22')](campaign[_0xc9d1('0x39')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x3a')]())['then'](voiceExtension[_0xc9d1('0x3b')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x3c')]())[_0xc9d1('0x22')](faxAccount[_0xc9d1('0x3d')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x3e')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xc9d1('0x21')]()[_0xc9d1('0x22')](voiceQueueReport[_0xc9d1('0x3f')]())[_0xc9d1('0x22')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xc9d1('0x40')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x41')]())[_0xc9d1('0x22')](cmHopperHistory[_0xc9d1('0x42')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x43')]())[_0xc9d1('0x22')](voiceCallReport[_0xc9d1('0x44')]())[_0xc9d1('0x22')](realtime[_0xc9d1('0x45')]())['catch'](function(_0x426907){logger[_0xc9d1('0x46')]('[index.js][initParams]',util[_0xc9d1('0x47')](_0x426907,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc9d1('0x48')](realtime,preview,fax)[_0xc9d1('0x22')](function(){return initRealtime();})['then'](function(){return initParams();})[_0xc9d1('0x22')](function(){report[_0xc9d1('0x49')]();setInterval(initRealtime,0x1388);})[_0xc9d1('0x4a')](function(_0x12d61c){logger[_0xc9d1('0x46')](_0xc9d1('0x4b'),util[_0xc9d1('0x47')](_0x12d61c,{'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 883ac15..059f75f 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 _0x880f=['md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','address','voiceStatusCallerIdNumber','stringify','user:%s','user:save','user:presence','exports','lodash','moment','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','phone','mobile','interface','online','voiceStatus','voiceStatusTime','onhold','local'];(function(_0x1e7add,_0x3f9fdc){var _0x56582d=function(_0x200e66){while(--_0x200e66){_0x1e7add['push'](_0x1e7add['shift']());}};_0x56582d(++_0x3f9fdc);}(_0x880f,0x12a));var _0xf880=function(_0x3768b2,_0x2c412f){_0x3768b2=_0x3768b2-0x0;var _0x28dadf=_0x880f[_0x3768b2];return _0x28dadf;};'use strict';var _=require(_0xf880('0x0'));var util=require('util');var moment=require(_0xf880('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xf880('0x2'));config[_0xf880('0x3')]=_['defaults'](config[_0xf880('0x3')],{'host':_0xf880('0x4'),'port':0x18eb});var io=require(_0xf880('0x5'))(new Redis(config[_0xf880('0x3')]));function Agent(_0x365b5a){this['id']=_0x365b5a['id']||0x0;this[_0xf880('0x6')]=_0x365b5a[_0xf880('0x6')]||'';this[_0xf880('0x7')]=_0x365b5a[_0xf880('0x7')]||'';this[_0xf880('0x8')]=_0x365b5a[_0xf880('0x8')]||'';this[_0xf880('0x9')]=_0x365b5a[_0xf880('0x9')]||'';this[_0xf880('0xa')]='unknown';this[_0xf880('0xb')]=0x0;this[_0xf880('0xc')]=_0xf880('0xd');this['address']='';this[_0xf880('0xe')]='';this[_0xf880('0xf')]='';this[_0xf880('0x10')]='';this[_0xf880('0x11')]=_0x365b5a[_0xf880('0x11')]||![];this[_0xf880('0x12')]=_0xf880('0xd');this[_0xf880('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0xf880('0x14')]=![];this[_0xf880('0x15')]=![];this[_0xf880('0x16')]='';}Agent[_0xf880('0x17')][_0xf880('0x18')]=function(_0xf354a1){var _0x5d05b0;if(_0xf354a1&&_0xf354a1['state']){_0x5d05b0=_0xf354a1[_0xf880('0xa')][_0xf880('0x19')]();switch(_0x5d05b0){case _0xf880('0x1a'):_0x5d05b0=_0xf880('0x1b');break;case _0xf880('0x1c'):_0x5d05b0=_0xf880('0x1d');break;}}if(_0x5d05b0&&this[_0xf880('0x12')]!==_0x5d05b0||_0xf354a1[_0xf880('0x1e')]){this[_0xf880('0x13')]=_[_0xf880('0x1f')](moment()[_0xf880('0x20')]('x'));}if(_0x5d05b0){this[_0xf880('0x12')]=_0x5d05b0;}var _0x2dfc83={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0xf880('0x9')],'state':this[_0xf880('0xa')],'stateTime':this[_0xf880('0xb')],'status':this[_0xf880('0xc')],'address':this[_0xf880('0x21')],'online':this[_0xf880('0x11')],'voiceStatus':this[_0xf880('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xf880('0x22')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xf880('0x14')]};var _0x1d32cc=md5(JSON[_0xf880('0x23')](_0x2dfc83));if(this[_0xf880('0x16')]!==_0x1d32cc){this[_0xf880('0x16')]=_0x1d32cc;io['to'](util[_0xf880('0x20')](_0xf880('0x24'),_0x2dfc83[_0xf880('0x6')]))['emit'](_0xf880('0x25'),_0x2dfc83);io['emit'](_0xf880('0x26'),_0x2dfc83);}};module[_0xf880('0x27')]=Agent; \ No newline at end of file +var _0x1ab3=['online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','voiceStatusCallerIdNumber','stringify','md5','format','user:%s','user:save','emit','user:presence','exports','lodash','util','../../../config/environment','redis','name','email','accountcode','fullname','unknown','status','address','phone','mobile','interface'];(function(_0x579681,_0x181f3f){var _0x3054e0=function(_0x3c57ac){while(--_0x3c57ac){_0x579681['push'](_0x579681['shift']());}};_0x3054e0(++_0x181f3f);}(_0x1ab3,0x8e));var _0x31ab=function(_0x1f24ac,_0x590846){_0x1f24ac=_0x1f24ac-0x0;var _0x2b71c7=_0x1ab3[_0x1f24ac];return _0x2b71c7;};'use strict';var _=require(_0x31ab('0x0'));var util=require(_0x31ab('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x31ab('0x2'));config[_0x31ab('0x3')]=_['defaults'](config[_0x31ab('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x31ab('0x3')]));function Agent(_0x24a700){this['id']=_0x24a700['id']||0x0;this[_0x31ab('0x4')]=_0x24a700['name']||'';this[_0x31ab('0x5')]=_0x24a700[_0x31ab('0x5')]||'';this[_0x31ab('0x6')]=_0x24a700[_0x31ab('0x6')]||'';this[_0x31ab('0x7')]=_0x24a700['fullname']||'';this['state']=_0x31ab('0x8');this['stateTime']=0x0;this[_0x31ab('0x9')]=_0x31ab('0x8');this[_0x31ab('0xa')]='';this[_0x31ab('0xb')]='';this[_0x31ab('0xc')]='';this[_0x31ab('0xd')]='';this['online']=_0x24a700[_0x31ab('0xe')]||![];this[_0x31ab('0xf')]=_0x31ab('0x8');this[_0x31ab('0x10')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x31ab('0x11')]='';this[_0x31ab('0x12')]=![];this[_0x31ab('0x13')]=![];this['md5']='';}Agent[_0x31ab('0x14')][_0x31ab('0x15')]=function(_0x566f2b){var _0x537109;if(_0x566f2b&&_0x566f2b[_0x31ab('0x16')]){_0x537109=_0x566f2b[_0x31ab('0x16')][_0x31ab('0x17')]();switch(_0x537109){case _0x31ab('0x18'):_0x537109=_0x31ab('0x19');break;case _0x31ab('0x1a'):_0x537109=_0x31ab('0x1b');break;}}if(_0x537109&&this[_0x31ab('0xf')]!==_0x537109||_0x566f2b[_0x31ab('0x1c')]){this[_0x31ab('0x10')]=_['toNumber'](moment()['format']('x'));}if(_0x537109){this[_0x31ab('0xf')]=_0x537109;}var _0x31a651={'id':this['id'],'name':this[_0x31ab('0x4')],'email':this[_0x31ab('0x5')],'accountcode':this[_0x31ab('0x6')],'fullname':this[_0x31ab('0x7')],'state':this['state'],'stateTime':this[_0x31ab('0x1d')],'status':this[_0x31ab('0x9')],'address':this[_0x31ab('0xa')],'online':this[_0x31ab('0xe')],'voiceStatus':this[_0x31ab('0xf')],'voiceStatusTime':this[_0x31ab('0x10')],'voiceStatusCallerIdNumber':this[_0x31ab('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x31ab('0xd')],'onhold':this[_0x31ab('0x12')]};var _0x340cd5=md5(JSON[_0x31ab('0x1f')](_0x31a651));if(this[_0x31ab('0x20')]!==_0x340cd5){this[_0x31ab('0x20')]=_0x340cd5;io['to'](util[_0x31ab('0x21')](_0x31ab('0x22'),_0x31a651[_0x31ab('0x4')]))['emit'](_0x31ab('0x23'),_0x31a651);io[_0x31ab('0x24')](_0x31ab('0x25'),_0x31a651);}};module[_0x31ab('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 5392f9f..9dea67d 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 _0x0b52=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x323001,_0x298913){var _0xed6576=function(_0x207ae1){while(--_0x207ae1){_0x323001['push'](_0x323001['shift']());}};_0xed6576(++_0x298913);}(_0x0b52,0x19c));var _0x20b5=function(_0x477abc,_0x8cd85c){_0x477abc=_0x477abc-0x0;var _0x1aa34a=_0x0b52[_0x477abc];return _0x1aa34a;};'use strict';function Campaign(_0x3a1c5f){this['id']=_0x3a1c5f['id']||0x0;this[_0x20b5('0x0')]=_0x3a1c5f[_0x20b5('0x0')]||'';this[_0x20b5('0x1')]=_0x3a1c5f[_0x20b5('0x1')]||_0x20b5('0x2');this[_0x20b5('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x20b5('0x4')]=0x0;this['message']='';this[_0x20b5('0x5')]=!![];this['active']=_0x3a1c5f[_0x20b5('0x6')];this['limitCalls']=_0x3a1c5f[_0x20b5('0x7')];this[_0x20b5('0x8')]=_0x3a1c5f['dialTimezone']||null;this[_0x20b5('0x9')]=_0x3a1c5f['dialGlobalInterval']?_0x3a1c5f[_0x20b5('0x9')]:null;this[_0x20b5('0xa')]=_0x3a1c5f[_0x20b5('0xa')];this[_0x20b5('0xb')]=_0x3a1c5f[_0x20b5('0xb')];this[_0x20b5('0xc')]=_0x3a1c5f[_0x20b5('0xc')]||0x1e;this[_0x20b5('0xd')]=_0x3a1c5f['dialCongestionMaxRetry'];this[_0x20b5('0xe')]=_0x3a1c5f[_0x20b5('0xe')];this['dialBusyMaxRetry']=_0x3a1c5f[_0x20b5('0xf')];this[_0x20b5('0x10')]=_0x3a1c5f[_0x20b5('0x10')];this[_0x20b5('0x11')]=_0x3a1c5f['dialNoAnswerMaxRetry'];this[_0x20b5('0x12')]=_0x3a1c5f[_0x20b5('0x12')];this[_0x20b5('0x13')]=_0x3a1c5f[_0x20b5('0x13')];this[_0x20b5('0x14')]=_0x3a1c5f['dialNoSuchNumberMaxRetry']||0x3;this[_0x20b5('0x15')]=_0x3a1c5f[_0x20b5('0x15')]||0x96;this['dialDropMaxRetry']=_0x3a1c5f[_0x20b5('0x16')]||0x3;this[_0x20b5('0x17')]=_0x3a1c5f[_0x20b5('0x17')]||0x96;this[_0x20b5('0x18')]=_0x3a1c5f[_0x20b5('0x18')]||0x3;this[_0x20b5('0x19')]=_0x3a1c5f[_0x20b5('0x19')]||0x96;this[_0x20b5('0x1a')]=_0x3a1c5f[_0x20b5('0x1a')]||0x3;this[_0x20b5('0x1b')]=_0x3a1c5f[_0x20b5('0x1b')]||0x96;this[_0x20b5('0x1c')]=_0x3a1c5f[_0x20b5('0x1c')]||0x3;this[_0x20b5('0x1d')]=_0x3a1c5f[_0x20b5('0x1d')]||0x96;this[_0x20b5('0x1e')]=_0x3a1c5f['dialOrderByScheduledAt']||_0x20b5('0x1f');this['dialPrefix']=_0x3a1c5f[_0x20b5('0x20')]||undefined;this[_0x20b5('0x21')]=_0x3a1c5f[_0x20b5('0x21')]||undefined;this['dialCutDigit']=_0x3a1c5f[_0x20b5('0x22')]||undefined;this['TrunkBackup']=_0x3a1c5f[_0x20b5('0x23')]?_0x3a1c5f[_0x20b5('0x23')]:undefined;this[_0x20b5('0x24')]=_0x3a1c5f[_0x20b5('0x24')]?_0x3a1c5f['Trunk']:undefined;this[_0x20b5('0x25')]=_0x3a1c5f[_0x20b5('0x25')]?_0x3a1c5f[_0x20b5('0x25')]:undefined;this[_0x20b5('0x26')]=_0x3a1c5f[_0x20b5('0x26')]?_0x3a1c5f[_0x20b5('0x26')]:undefined;this[_0x20b5('0x27')]=_0x3a1c5f['SquareProject']?_0x3a1c5f['SquareProject'][_0x20b5('0x0')]:undefined;this[_0x20b5('0x28')]=_0x3a1c5f[_0x20b5('0x28')]||![];this[_0x20b5('0x29')]=_0x3a1c5f['dialAMDInitialSilence'];this[_0x20b5('0x2a')]=_0x3a1c5f[_0x20b5('0x2a')];this[_0x20b5('0x2b')]=_0x3a1c5f[_0x20b5('0x2b')];this[_0x20b5('0x2c')]=_0x3a1c5f[_0x20b5('0x2c')];this[_0x20b5('0x2d')]=_0x3a1c5f[_0x20b5('0x2d')];this[_0x20b5('0x2e')]=_0x3a1c5f[_0x20b5('0x2e')];this[_0x20b5('0x2f')]=_0x3a1c5f['dialAMDMaximumNumberOfWords'];this[_0x20b5('0x30')]=_0x3a1c5f[_0x20b5('0x30')];this['dialAMDMaximumWordLength']=_0x3a1c5f[_0x20b5('0x31')];}module[_0x20b5('0x32')]=Campaign; \ No newline at end of file +var _0x289e=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive'];(function(_0x3762e2,_0x482ece){var _0x4355c3=function(_0xac82b2){while(--_0xac82b2){_0x3762e2['push'](_0x3762e2['shift']());}};_0x4355c3(++_0x482ece);}(_0x289e,0x6f));var _0xe289=function(_0x556a93,_0x2fde7c){_0x556a93=_0x556a93-0x0;var _0xe278b3=_0x289e[_0x556a93];return _0xe278b3;};'use strict';function Campaign(_0x233cd1){this['id']=_0x233cd1['id']||0x0;this[_0xe289('0x0')]=_0x233cd1['name']||'';this[_0xe289('0x1')]=_0x233cd1[_0xe289('0x1')]||_0xe289('0x2');this[_0xe289('0x3')]=0x0;this[_0xe289('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xe289('0x5')]=0x0;this[_0xe289('0x6')]='';this[_0xe289('0x7')]=!![];this['active']=_0x233cd1[_0xe289('0x8')];this[_0xe289('0x9')]=_0x233cd1['limitCalls'];this['dialTimezone']=_0x233cd1[_0xe289('0xa')]||null;this[_0xe289('0xb')]=_0x233cd1['dialGlobalInterval']?_0x233cd1[_0xe289('0xb')]:null;this[_0xe289('0xc')]=_0x233cd1['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x233cd1[_0xe289('0xd')];this[_0xe289('0xe')]=_0x233cd1['dialOriginateTimeout']||0x1e;this[_0xe289('0xf')]=_0x233cd1[_0xe289('0xf')];this['dialCongestionRetryFrequency']=_0x233cd1[_0xe289('0x10')];this['dialBusyMaxRetry']=_0x233cd1[_0xe289('0x11')];this[_0xe289('0x12')]=_0x233cd1[_0xe289('0x12')];this[_0xe289('0x13')]=_0x233cd1[_0xe289('0x13')];this[_0xe289('0x14')]=_0x233cd1[_0xe289('0x14')];this[_0xe289('0x15')]=_0x233cd1[_0xe289('0x15')];this[_0xe289('0x16')]=_0x233cd1[_0xe289('0x16')]||0x3;this[_0xe289('0x17')]=_0x233cd1['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x233cd1[_0xe289('0x18')]||0x3;this[_0xe289('0x19')]=_0x233cd1['dialDropRetryFrequency']||0x96;this[_0xe289('0x1a')]=_0x233cd1[_0xe289('0x1a')]||0x3;this[_0xe289('0x1b')]=_0x233cd1[_0xe289('0x1b')]||0x96;this[_0xe289('0x1c')]=_0x233cd1[_0xe289('0x1c')]||0x3;this[_0xe289('0x1d')]=_0x233cd1[_0xe289('0x1d')]||0x96;this[_0xe289('0x1e')]=_0x233cd1['dialAgentRejectMaxRetry']||0x3;this[_0xe289('0x1f')]=_0x233cd1[_0xe289('0x1f')]||0x96;this[_0xe289('0x20')]=_0x233cd1['dialOrderByScheduledAt']||_0xe289('0x21');this[_0xe289('0x22')]=_0x233cd1[_0xe289('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x233cd1[_0xe289('0x23')]||undefined;this[_0xe289('0x24')]=_0x233cd1['dialCutDigit']||undefined;this[_0xe289('0x25')]=_0x233cd1[_0xe289('0x25')]?_0x233cd1[_0xe289('0x25')]:undefined;this['Trunk']=_0x233cd1['Trunk']?_0x233cd1[_0xe289('0x26')]:undefined;this[_0xe289('0x27')]=_0x233cd1[_0xe289('0x27')]?_0x233cd1[_0xe289('0x27')]:undefined;this[_0xe289('0x28')]=_0x233cd1['SquareProject']?_0x233cd1[_0xe289('0x28')]:undefined;this['dialQueueProject']=_0x233cd1[_0xe289('0x28')]?_0x233cd1[_0xe289('0x28')][_0xe289('0x0')]:undefined;this['dialAMDActive']=_0x233cd1[_0xe289('0x29')]||![];this[_0xe289('0x2a')]=_0x233cd1[_0xe289('0x2a')];this['dialAMDGreeting']=_0x233cd1[_0xe289('0x2b')];this[_0xe289('0x2c')]=_0x233cd1[_0xe289('0x2c')];this[_0xe289('0x2d')]=_0x233cd1[_0xe289('0x2d')];this['dialAMDMinWordLength']=_0x233cd1['dialAMDMinWordLength'];this[_0xe289('0x2e')]=_0x233cd1[_0xe289('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x233cd1[_0xe289('0x2f')];this[_0xe289('0x30')]=_0x233cd1[_0xe289('0x30')];this['dialAMDMaximumWordLength']=_0x233cd1[_0xe289('0x31')];}module[_0xe289('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 30abecf..32b8bf0 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 _0xa3e8=['destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xa3e8,0x127));var _0x8a3e=function(_0xcef260,_0x577f88){_0xcef260=_0xcef260-0x0;var _0xdc1d67=_0xa3e8[_0xcef260];return _0xdc1d67;};'use strict';function Channel(){this[_0x8a3e('0x0')]=null;this[_0x8a3e('0x1')]='';this[_0x8a3e('0x2')]='';this['calleridnum']=0x0;this[_0x8a3e('0x3')]='';this[_0x8a3e('0x4')]=undefined;this[_0x8a3e('0x5')]=undefined;this[_0x8a3e('0x6')]=0x0;this[_0x8a3e('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x8a3e('0x8')]=![];this[_0x8a3e('0x9')]=null;this[_0x8a3e('0xa')]=null;this['unmanaged']=![];this[_0x8a3e('0xb')]=![];this[_0x8a3e('0xc')]='';this[_0x8a3e('0xd')]='';this[_0x8a3e('0xe')]=0x0;this[_0x8a3e('0xf')]=0x0;this[_0x8a3e('0x10')]=0x0;this[_0x8a3e('0x11')]=null;this[_0x8a3e('0x12')]=null;this[_0x8a3e('0x13')]=null;this['monitor']=![];this[_0x8a3e('0x14')]=null;this[_0x8a3e('0x15')]=null;this[_0x8a3e('0x16')]=[];this['transfercalleridnum']=undefined;this[_0x8a3e('0x17')]=undefined;this[_0x8a3e('0x18')]=undefined;this[_0x8a3e('0x19')]=0x0;}module[_0x8a3e('0x1a')]=Channel; \ No newline at end of file +var _0x32e7=['transferconnectedlinenum','transferType','mohtime','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','answered','endtime','unmanaged','lastapplication','lastdata','duration','holdtime','tag','disposition','monitor','monitorFilename','queue','transfercalleridnum'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x32e7,0xc3));var _0x732e=function(_0x5de008,_0x9fb7ea){_0x5de008=_0x5de008-0x0;var _0x41d777=_0x32e7[_0x5de008];return _0x41d777;};'use strict';function Channel(){this[_0x732e('0x0')]=null;this['channel']='';this[_0x732e('0x1')]='';this[_0x732e('0x2')]=0x0;this[_0x732e('0x3')]='';this['connectedlinenum']=undefined;this[_0x732e('0x4')]=undefined;this[_0x732e('0x5')]=0x0;this[_0x732e('0x6')]='';this[_0x732e('0x7')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x732e('0x8')]=![];this['answertime']=null;this[_0x732e('0x9')]=null;this[_0x732e('0xa')]=![];this['abandoned']=![];this[_0x732e('0xb')]='';this[_0x732e('0xc')]='';this[_0x732e('0xd')]=0x0;this['billableseconds']=0x0;this[_0x732e('0xe')]=0x0;this['type']=null;this[_0x732e('0xf')]=null;this[_0x732e('0x10')]=null;this[_0x732e('0x11')]=![];this[_0x732e('0x12')]=null;this[_0x732e('0x13')]=null;this['monitors']=[];this[_0x732e('0x14')]=undefined;this[_0x732e('0x15')]=undefined;this[_0x732e('0x16')]=undefined;this[_0x732e('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 63bba51..a9fa8c3 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 _0xe86d=['serverUrl','Configurations','exports','name','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xe86d,0x71));var _0xde86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe86d[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x1175c2){this['id']=_0x1175c2['id']||0x0;this[_0xde86('0x0')]=_0x1175c2[_0xde86('0x0')]||'';this['username']=_0x1175c2['username']||'';this['remoteUri']=_0x1175c2['remoteUri']||'';this[_0xde86('0x1')]=_0x1175c2[_0xde86('0x1')]||'';this['password']=_0x1175c2[_0xde86('0x2')]||'';this[_0xde86('0x3')]=_0x1175c2[_0xde86('0x3')]||'';this['consumerSecret']=_0x1175c2[_0xde86('0x4')]||'';this['token']=_0x1175c2[_0xde86('0x5')]||'';this[_0xde86('0x6')]=_0x1175c2[_0xde86('0x6')]||'';this[_0xde86('0x7')]=_0x1175c2['type']||'';this[_0xde86('0x8')]=_0x1175c2['serverUrl']||'';this['Configurations']=_0x1175c2[_0xde86('0x9')]||{};}module[_0xde86('0xa')]=DeskAccount; \ No newline at end of file +var _0x6d1f=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','type','serverUrl','Configurations'];(function(_0x2d9ce2,_0x32f5d7){var _0x5d7ab6=function(_0x448328){while(--_0x448328){_0x2d9ce2['push'](_0x2d9ce2['shift']());}};_0x5d7ab6(++_0x32f5d7);}(_0x6d1f,0xcd));var _0xf6d1=function(_0x45a5d9,_0x27e83a){_0x45a5d9=_0x45a5d9-0x0;var _0x51baa0=_0x6d1f[_0x45a5d9];return _0x51baa0;};'use strict';function DeskAccount(_0x11ca45){this['id']=_0x11ca45['id']||0x0;this[_0xf6d1('0x0')]=_0x11ca45[_0xf6d1('0x0')]||'';this[_0xf6d1('0x1')]=_0x11ca45[_0xf6d1('0x1')]||'';this[_0xf6d1('0x2')]=_0x11ca45[_0xf6d1('0x2')]||'';this[_0xf6d1('0x3')]=_0x11ca45[_0xf6d1('0x3')]||'';this['password']=_0x11ca45[_0xf6d1('0x4')]||'';this[_0xf6d1('0x5')]=_0x11ca45['consumerKey']||'';this[_0xf6d1('0x6')]=_0x11ca45['consumerSecret']||'';this['token']=_0x11ca45[_0xf6d1('0x7')]||'';this['tokenSecret']=_0x11ca45['tokenSecret']||'';this[_0xf6d1('0x8')]=_0x11ca45['type']||'';this[_0xf6d1('0x9')]=_0x11ca45[_0xf6d1('0x9')]||'';this[_0xf6d1('0xa')]=_0x11ca45[_0xf6d1('0xa')]||{};}module[_0xf6d1('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 5f51306..80e800f 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 _0xcfd2=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xcfd2,0x150));var _0x2cfd=function(_0x41ed4b,_0x5f0ce0){_0x41ed4b=_0x41ed4b-0x0;var _0x5077ff=_0xcfd2[_0x41ed4b];return _0x5077ff;};'use strict';function Dynamics365Account(_0x528ef3){this['id']=_0x528ef3['id']||0x0;this[_0x2cfd('0x0')]=_0x528ef3[_0x2cfd('0x0')]||'';this[_0x2cfd('0x1')]=_0x528ef3['username']||'';this[_0x2cfd('0x2')]=_0x528ef3[_0x2cfd('0x2')]||'';this['remoteUri']=_0x528ef3[_0x2cfd('0x3')]||'';this[_0x2cfd('0x4')]=_0x528ef3['tenantId']||'';this[_0x2cfd('0x5')]=_0x528ef3[_0x2cfd('0x5')]||'';this[_0x2cfd('0x6')]=_0x528ef3[_0x2cfd('0x6')]||{};this[_0x2cfd('0x7')]=_0x528ef3[_0x2cfd('0x7')]||'';this[_0x2cfd('0x8')]=_0x528ef3[_0x2cfd('0x8')]||![];this[_0x2cfd('0x9')]=_0x528ef3[_0x2cfd('0x9')]||{};this['CloudProvider']=_0x528ef3[_0x2cfd('0xa')]||{};}module[_0x2cfd('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xabfa=['clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x4602ca,_0x331f44){var _0xff652e=function(_0x4fe7f2){while(--_0x4fe7f2){_0x4602ca['push'](_0x4602ca['shift']());}};_0xff652e(++_0x331f44);}(_0xabfa,0xa2));var _0xaabf=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xabfa[_0x465a0c];return _0x1e202e;};'use strict';function Dynamics365Account(_0x58a32f){this['id']=_0x58a32f['id']||0x0;this[_0xaabf('0x0')]=_0x58a32f[_0xaabf('0x0')]||'';this[_0xaabf('0x1')]=_0x58a32f[_0xaabf('0x1')]||'';this[_0xaabf('0x2')]=_0x58a32f[_0xaabf('0x2')]||'';this['remoteUri']=_0x58a32f[_0xaabf('0x3')]||'';this[_0xaabf('0x4')]=_0x58a32f[_0xaabf('0x4')]||'';this[_0xaabf('0x5')]=_0x58a32f['clientId']||'';this['clientSecret']=_0x58a32f[_0xaabf('0x6')]||{};this[_0xaabf('0x7')]=_0x58a32f[_0xaabf('0x7')]||'';this['modernAuthentication']=_0x58a32f[_0xaabf('0x8')]||![];this['Configurations']=_0x58a32f[_0xaabf('0x9')]||{};this[_0xaabf('0xa')]=_0x58a32f['CloudProvider']||{};}module[_0xaabf('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 2e1b5c3..0ea89ee 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 _0x946c=['ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x36047b,_0x57a393){var _0x47bfeb=function(_0xe3e68d){while(--_0xe3e68d){_0x36047b['push'](_0x36047b['shift']());}};_0x47bfeb(++_0x57a393);}(_0x946c,0x19b));var _0xc946=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x946c[_0x167cc1];return _0x10bc4b;};'use strict';function FaxAccount(_0x1f34c6){this['id']=_0x1f34c6['id']||0x0;this[_0xc946('0x0')]=_0x1f34c6['name']||'';this['description']=_0x1f34c6['description'];this[_0xc946('0x1')]=_0x1f34c6[_0xc946('0x1')];this['headerinfo']=_0x1f34c6[_0xc946('0x2')];this[_0xc946('0x3')]=_0x1f34c6[_0xc946('0x3')];this[_0xc946('0x4')]=_0x1f34c6['minrate']||0x960;this[_0xc946('0x5')]=_0x1f34c6[_0xc946('0x5')]||0x3840;this[_0xc946('0x6')]=_0x1f34c6[_0xc946('0x6')]||_0xc946('0x7');this[_0xc946('0x8')]=_0x1f34c6[_0xc946('0x8')]||'no';this[_0xc946('0x9')]=_0x1f34c6['faxdetect']||'no';this[_0xc946('0xa')]=_0x1f34c6[_0xc946('0xa')]||0x1388;this[_0xc946('0xb')]=_0x1f34c6['tech']||_0xc946('0xc');this['Trunk']=_0x1f34c6['Trunk']?_0x1f34c6[_0xc946('0xd')]:undefined;this['ListId']=_0x1f34c6[_0xc946('0xe')];this[_0xc946('0xf')]=_0x1f34c6[_0xc946('0xf')];}module[_0xc946('0x10')]=FaxAccount; \ No newline at end of file +var _0x882f=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x16e9bd,_0x295838){var _0x465a87=function(_0x6851f9){while(--_0x6851f9){_0x16e9bd['push'](_0x16e9bd['shift']());}};_0x465a87(++_0x295838);}(_0x882f,0x192));var _0xf882=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x882f[_0xac151d];return _0x111dba;};'use strict';function FaxAccount(_0x1ecc79){this['id']=_0x1ecc79['id']||0x0;this['name']=_0x1ecc79[_0xf882('0x0')]||'';this['description']=_0x1ecc79[_0xf882('0x1')];this[_0xf882('0x2')]=_0x1ecc79[_0xf882('0x2')];this['headerinfo']=_0x1ecc79[_0xf882('0x3')];this[_0xf882('0x4')]=_0x1ecc79[_0xf882('0x4')];this[_0xf882('0x5')]=_0x1ecc79['minrate']||0x960;this[_0xf882('0x6')]=_0x1ecc79[_0xf882('0x6')]||0x3840;this['modem']=_0x1ecc79[_0xf882('0x7')]||_0xf882('0x8');this['gateway']=_0x1ecc79[_0xf882('0x9')]||'no';this[_0xf882('0xa')]=_0x1ecc79[_0xf882('0xa')]||'no';this[_0xf882('0xb')]=_0x1ecc79[_0xf882('0xb')]||0x1388;this[_0xf882('0xc')]=_0x1ecc79['tech']||_0xf882('0xd');this['Trunk']=_0x1ecc79[_0xf882('0xe')]?_0x1ecc79[_0xf882('0xe')]:undefined;this['ListId']=_0x1ecc79[_0xf882('0xf')];this[_0xf882('0x10')]=_0x1ecc79[_0xf882('0x10')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ba753ed..2d31a19 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 _0x61ca=['exports','name','apiKey','token','serverUrl','Configurations'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x61ca,0xc7));var _0xa61c=function(_0x22bff1,_0x1d964a){_0x22bff1=_0x22bff1-0x0;var _0x279396=_0x61ca[_0x22bff1];return _0x279396;};'use strict';function FreshdeskAccount(_0x58c95e){this['id']=_0x58c95e['id']||0x0;this[_0xa61c('0x0')]=_0x58c95e['name']||'';this['username']=_0x58c95e['username']||'';this[_0xa61c('0x1')]=_0x58c95e[_0xa61c('0x2')]||'';this['remoteUri']=_0x58c95e['remoteUri']||'';this[_0xa61c('0x3')]=_0x58c95e[_0xa61c('0x3')]||'';this[_0xa61c('0x4')]=_0x58c95e[_0xa61c('0x4')]||{};}module[_0xa61c('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x9659=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x5ca34d,_0x4ffc0f){var _0x5cf4d3=function(_0x2d6c03){while(--_0x2d6c03){_0x5ca34d['push'](_0x5ca34d['shift']());}};_0x5cf4d3(++_0x4ffc0f);}(_0x9659,0x150));var _0x9965=function(_0x1d5d3f,_0x3a9d08){_0x1d5d3f=_0x1d5d3f-0x0;var _0x6f9221=_0x9659[_0x1d5d3f];return _0x6f9221;};'use strict';function FreshdeskAccount(_0x2243ad){this['id']=_0x2243ad['id']||0x0;this[_0x9965('0x0')]=_0x2243ad[_0x9965('0x0')]||'';this[_0x9965('0x1')]=_0x2243ad[_0x9965('0x1')]||'';this[_0x9965('0x2')]=_0x2243ad['token']||'';this[_0x9965('0x3')]=_0x2243ad[_0x9965('0x3')]||'';this['serverUrl']=_0x2243ad[_0x9965('0x4')]||'';this[_0x9965('0x5')]=_0x2243ad[_0x9965('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index c586485..e1aa819 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 _0x7dee=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x64b31d,_0x393b36){var _0x42c45b=function(_0x2d2323){while(--_0x2d2323){_0x64b31d['push'](_0x64b31d['shift']());}};_0x42c45b(++_0x393b36);}(_0x7dee,0xb0));var _0xe7de=function(_0x4b18e7,_0x4dd0f5){_0x4b18e7=_0x4b18e7-0x0;var _0x3ae05f=_0x7dee[_0x4b18e7];return _0x3ae05f;};'use strict';function FreshsalesAccount(_0x554760){this['id']=_0x554760['id']||0x0;this['name']=_0x554760[_0xe7de('0x0')]||'';this['username']=_0x554760[_0xe7de('0x1')]||'';this[_0xe7de('0x2')]=_0x554760[_0xe7de('0x3')]||'';this[_0xe7de('0x4')]=_0x554760['remoteUri']||'';this[_0xe7de('0x5')]=_0x554760['serverUrl']||'';this[_0xe7de('0x6')]=_0x554760[_0xe7de('0x6')]||{};}module[_0xe7de('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x432b=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x4d0d85,_0x3250d3){var _0x290a74=function(_0x4762db){while(--_0x4762db){_0x4d0d85['push'](_0x4d0d85['shift']());}};_0x290a74(++_0x3250d3);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x582e8e){this['id']=_0x582e8e['id']||0x0;this['name']=_0x582e8e[_0xb432('0x0')]||'';this[_0xb432('0x1')]=_0x582e8e[_0xb432('0x1')]||'';this[_0xb432('0x2')]=_0x582e8e['token']||'';this['remoteUri']=_0x582e8e[_0xb432('0x3')]||'';this['serverUrl']=_0x582e8e[_0xb432('0x4')]||'';this['Configurations']=_0x582e8e[_0xb432('0x5')]||{};}module[_0xb432('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c2ceb76..ca79fa5 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 _0xdc2c=['holdtime','assigned','voice','variables','exports','type','calleridnum','calleridname','queue','position','queuecallerabandon','queuecallerabandonAt','queuecallerexit','originalposition','connectedlinenum','accountcode','exten','priority'];(function(_0x5dbaa7,_0x1f6d4a){var _0x481319=function(_0x116e27){while(--_0x116e27){_0x5dbaa7['push'](_0x5dbaa7['shift']());}};_0x481319(++_0x1f6d4a);}(_0xdc2c,0x1c7));var _0xcdc2=function(_0x4bbfb2,_0x4b1518){_0x4bbfb2=_0x4bbfb2-0x0;var _0x9fa82c=_0xdc2c[_0x4bbfb2];return _0x9fa82c;};'use strict';function QueueReport(){this[_0xcdc2('0x0')]='inbound';this['uniqueid']='';this[_0xcdc2('0x1')]='';this[_0xcdc2('0x2')]='';this[_0xcdc2('0x3')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xcdc2('0x4')]=0x1;this['count']=0x1;this[_0xcdc2('0x5')]=![];this[_0xcdc2('0x6')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xcdc2('0x7')]=![];this['queuecallerexitAt']=null;this[_0xcdc2('0x8')]=0x1;this['channel']='';this[_0xcdc2('0x9')]='';this['connectedlinename']='';this[_0xcdc2('0xa')]='';this['context']='';this[_0xcdc2('0xb')]='';this[_0xcdc2('0xc')]='';this[_0xcdc2('0xd')]=0x0;this[_0xcdc2('0xe')]=![];this['lastAssignedTo']='';this['motionChannel']=_0xcdc2('0xf');this['routealias']=null;this['mohtime']=0x0;this[_0xcdc2('0x10')]={};}module[_0xcdc2('0x11')]=QueueReport; \ No newline at end of file +var _0x8f73=['connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x8f73,0x79));var _0x38f7=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x8f73[_0x543084];return _0x306a57;};'use strict';function QueueReport(){this['type']=_0x38f7('0x0');this[_0x38f7('0x1')]='';this[_0x38f7('0x2')]='';this[_0x38f7('0x3')]='';this[_0x38f7('0x4')]='';this[_0x38f7('0x5')]=null;this[_0x38f7('0x6')]=null;this[_0x38f7('0x7')]=0x1;this['count']=0x1;this[_0x38f7('0x8')]=![];this[_0x38f7('0x9')]=null;this[_0x38f7('0xa')]=![];this[_0x38f7('0xb')]=null;this[_0x38f7('0xc')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x38f7('0xd')]='';this[_0x38f7('0xe')]='';this[_0x38f7('0xf')]='';this[_0x38f7('0x10')]='';this[_0x38f7('0x11')]='';this[_0x38f7('0x12')]='';this['priority']='';this[_0x38f7('0x13')]=0x0;this[_0x38f7('0x14')]=![];this[_0x38f7('0x15')]='';this[_0x38f7('0x16')]=_0x38f7('0x17');this[_0x38f7('0x18')]=null;this[_0x38f7('0x19')]=0x0;this['variables']={};}module[_0x38f7('0x1a')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9757502..6f402a2 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 _0x564d=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x4e8583,_0x13f294){var _0x5555c6=function(_0x2d864e){while(--_0x2d864e){_0x4e8583['push'](_0x4e8583['shift']());}};_0x5555c6(++_0x13f294);}(_0x564d,0x66));var _0xd564=function(_0x2fc9a5,_0x235b92){_0x2fc9a5=_0x2fc9a5-0x0;var _0x3fd730=_0x564d[_0x2fc9a5];return _0x3fd730;};'use strict';function SalesforceAccount(_0xf29421){this['id']=_0xf29421['id']||0x0;this[_0xd564('0x0')]=_0xf29421[_0xd564('0x0')]||'';this['username']=_0xf29421[_0xd564('0x1')]||'';this[_0xd564('0x2')]=_0xf29421['remoteUri']||'';this[_0xd564('0x3')]=_0xf29421['password']||'';this[_0xd564('0x4')]=_0xf29421[_0xd564('0x4')]||'';this[_0xd564('0x5')]=_0xf29421[_0xd564('0x5')]||'';this[_0xd564('0x6')]=_0xf29421[_0xd564('0x6')]||'';this[_0xd564('0x7')]=_0xf29421['type']||_0xd564('0x8');this[_0xd564('0x9')]=_0xf29421[_0xd564('0x9')]||'';this[_0xd564('0xa')]=_0xf29421[_0xd564('0xa')]||{};}module[_0xd564('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xa099=['securityToken','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret'];(function(_0x5376ff,_0x4682a8){var _0x10ed2d=function(_0x3d4e1f){while(--_0x3d4e1f){_0x5376ff['push'](_0x5376ff['shift']());}};_0x10ed2d(++_0x4682a8);}(_0xa099,0x69));var _0x9a09=function(_0x4eaf70,_0x42c528){_0x4eaf70=_0x4eaf70-0x0;var _0x38078d=_0xa099[_0x4eaf70];return _0x38078d;};'use strict';function SalesforceAccount(_0xb43449){this['id']=_0xb43449['id']||0x0;this['name']=_0xb43449['name']||'';this[_0x9a09('0x0')]=_0xb43449[_0x9a09('0x0')]||'';this[_0x9a09('0x1')]=_0xb43449[_0x9a09('0x1')]||'';this[_0x9a09('0x2')]=_0xb43449[_0x9a09('0x2')]||'';this[_0x9a09('0x3')]=_0xb43449['clientId']||'';this[_0x9a09('0x4')]=_0xb43449[_0x9a09('0x4')]||'';this[_0x9a09('0x5')]=_0xb43449[_0x9a09('0x5')]||'';this[_0x9a09('0x6')]=_0xb43449[_0x9a09('0x6')]||_0x9a09('0x7');this[_0x9a09('0x8')]=_0xb43449[_0x9a09('0x8')]||'';this[_0x9a09('0x9')]=_0xb43449['Configurations']||{};}module[_0x9a09('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index b5f903f..7ef7e80 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 _0xdd84=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1788e0,_0x5cbba7){var _0x4cb790=function(_0x51dc8b){while(--_0x51dc8b){_0x1788e0['push'](_0x1788e0['shift']());}};_0x4cb790(++_0x5cbba7);}(_0xdd84,0x1d0));var _0x4dd8=function(_0x5301a8,_0xf1a8ba){_0x5301a8=_0x5301a8-0x0;var _0x482a56=_0xdd84[_0x5301a8];return _0x482a56;};'use strict';function ServicenowAccount(_0x4fcfe0){this['id']=_0x4fcfe0['id']||0x0;this[_0x4dd8('0x0')]=_0x4fcfe0[_0x4dd8('0x0')]||'';this[_0x4dd8('0x1')]=_0x4fcfe0[_0x4dd8('0x1')]||'';this[_0x4dd8('0x2')]=_0x4fcfe0[_0x4dd8('0x2')]||'';this[_0x4dd8('0x3')]=_0x4fcfe0[_0x4dd8('0x3')]||'';this[_0x4dd8('0x4')]=_0x4fcfe0[_0x4dd8('0x4')]||'';this['Configurations']=_0x4fcfe0[_0x4dd8('0x5')]||{};}module[_0x4dd8('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x10c0=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1cca13,_0xd9bd5f){var _0x507295=function(_0x544e6b){while(--_0x544e6b){_0x1cca13['push'](_0x1cca13['shift']());}};_0x507295(++_0xd9bd5f);}(_0x10c0,0x12a));var _0x010c=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x10c0[_0x3c5e54];return _0x3ae1f3;};'use strict';function ServicenowAccount(_0xb50710){this['id']=_0xb50710['id']||0x0;this[_0x010c('0x0')]=_0xb50710[_0x010c('0x0')]||'';this[_0x010c('0x1')]=_0xb50710[_0x010c('0x1')]||'';this[_0x010c('0x2')]=_0xb50710[_0x010c('0x2')]||'';this[_0x010c('0x3')]=_0xb50710[_0x010c('0x3')]||'';this[_0x010c('0x4')]=_0xb50710[_0x010c('0x4')]||'';this[_0x010c('0x5')]=_0xb50710[_0x010c('0x5')]||{};}module[_0x010c('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 2a74ae0..228909f 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 _0xc502=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x20f39f,_0x1b6b7a){var _0x1f65cd=function(_0x4fbc1b){while(--_0x4fbc1b){_0x20f39f['push'](_0x20f39f['shift']());}};_0x1f65cd(++_0x1b6b7a);}(_0xc502,0x1cc));var _0x2c50=function(_0x358881,_0x1b748c){_0x358881=_0x358881-0x0;var _0x76792d=_0xc502[_0x358881];return _0x76792d;};'use strict';function SugarcrmAccount(_0x4e2fe9){this['id']=_0x4e2fe9['id']||0x0;this[_0x2c50('0x0')]=_0x4e2fe9[_0x2c50('0x0')]||'';this[_0x2c50('0x1')]=_0x4e2fe9[_0x2c50('0x1')]||'';this[_0x2c50('0x2')]=_0x4e2fe9[_0x2c50('0x2')]||'';this['remoteUri']=_0x4e2fe9[_0x2c50('0x3')]||'';this[_0x2c50('0x4')]=_0x4e2fe9[_0x2c50('0x4')]||'';this[_0x2c50('0x5')]=_0x4e2fe9[_0x2c50('0x5')]||{};}module[_0x2c50('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa264=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x2dc70d,_0x26e805){var _0x3b9ecc=function(_0x52f7ef){while(--_0x52f7ef){_0x2dc70d['push'](_0x2dc70d['shift']());}};_0x3b9ecc(++_0x26e805);}(_0xa264,0x130));var _0x4a26=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xa264[_0x1deb03];return _0x189fe7;};'use strict';function SugarcrmAccount(_0x41aab4){this['id']=_0x41aab4['id']||0x0;this['name']=_0x41aab4[_0x4a26('0x0')]||'';this['username']=_0x41aab4['username']||'';this[_0x4a26('0x1')]=_0x41aab4[_0x4a26('0x1')]||'';this[_0x4a26('0x2')]=_0x41aab4[_0x4a26('0x2')]||'';this[_0x4a26('0x3')]=_0x41aab4[_0x4a26('0x3')]||'';this[_0x4a26('0x4')]=_0x41aab4['Configurations']||{};}module[_0x4a26('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 42acb82..46cee3a 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 _0x8d08=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0xf250ac,_0x1aeb3b){var _0x5a2ba4=function(_0x1bf327){while(--_0x1bf327){_0xf250ac['push'](_0xf250ac['shift']());}};_0x5a2ba4(++_0x1aeb3b);}(_0x8d08,0x118));var _0x88d0=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x8d08[_0x458363];return _0x4d0290;};'use strict';function Telephone(_0x177606){this['id']=_0x177606['id']||0x0;this[_0x88d0('0x0')]=_0x177606[_0x88d0('0x0')]||'';this[_0x88d0('0x1')]=_0x177606[_0x88d0('0x1')]||'';this[_0x88d0('0x2')]=_0x88d0('0x3');this[_0x88d0('0x4')]=0x0;this[_0x88d0('0x5')]=_0x88d0('0x3');this[_0x88d0('0x6')]='';}module[_0x88d0('0x7')]=Telephone; \ No newline at end of file +var _0xc9fb=['unknown','stateTime','status','address','name','accountcode'];(function(_0x20c450,_0x524915){var _0x196655=function(_0x104fa1){while(--_0x104fa1){_0x20c450['push'](_0x20c450['shift']());}};_0x196655(++_0x524915);}(_0xc9fb,0x148));var _0xbc9f=function(_0x59bd89,_0x9569f8){_0x59bd89=_0x59bd89-0x0;var _0x58f8f4=_0xc9fb[_0x59bd89];return _0x58f8f4;};'use strict';function Telephone(_0x120e85){this['id']=_0x120e85['id']||0x0;this[_0xbc9f('0x0')]=_0x120e85[_0xbc9f('0x0')]||'';this['accountcode']=_0x120e85[_0xbc9f('0x1')]||'';this['state']=_0xbc9f('0x2');this[_0xbc9f('0x3')]=0x0;this[_0xbc9f('0x4')]=_0xbc9f('0x2');this[_0xbc9f('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index d93595c..fb713d7 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4ab2d0,_0x2a6727){var _0x98a719=function(_0x948e96){while(--_0x948e96){_0x4ab2d0['push'](_0x4ab2d0['shift']());}};_0x98a719(++_0x2a6727);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1d929b,_0x1f09c6){var _0x3c62a9=function(_0x46ba03){while(--_0x46ba03){_0x1d929b['push'](_0x1d929b['shift']());}};_0x3c62a9(++_0x1f09c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 fdac088..7d319cc 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(_0x2d3d11,_0x43ec26){var _0x4a7809=function(_0x42d561){while(--_0x42d561){_0x2d3d11['push'](_0x2d3d11['shift']());}};_0x4a7809(++_0x43ec26);}(_0xda3f,0xec));var _0xfda3=function(_0x3ae3e8,_0x1e83ff){_0x3ae3e8=_0x3ae3e8-0x0;var _0x13480d=_0xda3f[_0x3ae3e8];return _0x13480d;};'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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x393563,_0x512cd6){var _0x4e6005=function(_0x1bee9d){while(--_0x1bee9d){_0x393563['push'](_0x393563['shift']());}};_0x4e6005(++_0x512cd6);}(_0x4fc2,0x111));var _0x24fc=function(_0x3f85bf,_0x5ea4de){_0x3f85bf=_0x3f85bf-0x0;var _0x37e3cd=_0x4fc2[_0x3f85bf];return _0x37e3cd;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}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 feb003f..5b1928a 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 _0x10e9=['active','name','stateTime','unknown','registry','split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x193570,_0x35516d){var _0x1a7da7=function(_0x492ffe){while(--_0x492ffe){_0x193570['push'](_0x193570['shift']());}};_0x1a7da7(++_0x35516d);}(_0x10e9,0xc3));var _0x910e=function(_0x495ebf,_0x27df21){_0x495ebf=_0x495ebf-0x0;var _0x5841ef=_0x10e9[_0x495ebf];return _0x5841ef;};'use strict';function Trunk(_0x4f01d1){this['id']=_0x4f01d1['id']||0x0;this[_0x910e('0x0')]=_0x4f01d1['active']||![];this[_0x910e('0x1')]=_0x4f01d1[_0x910e('0x1')]||'';this['state']='unknown';this[_0x910e('0x2')]=0x0;this['status']=_0x910e('0x3');this['registry']=_0x4f01d1[_0x910e('0x4')]&&_0x4f01d1[_0x910e('0x4')]['indexOf'](':')?_0x4f01d1[_0x910e('0x4')][_0x910e('0x5')](':')[0x0]:'';this[_0x910e('0x6')]='';this['port']='';this[_0x910e('0x7')]='';this[_0x910e('0x8')]='';this[_0x910e('0x9')]='';this[_0x910e('0xa')]='unknown';this[_0x910e('0xb')]='';this[_0x910e('0xc')]='';this[_0x910e('0xd')]=_0x4f01d1['defaultuser']||'';}module[_0x910e('0xe')]=Trunk; \ No newline at end of file +var _0xb1a4=['registry','indexOf','split','host','port','domain','refresh','stateRegistry','unknown','defaultuser','exports','active','name','stateTime','status'];(function(_0xe30762,_0x2d8bd9){var _0x40c6fa=function(_0x22f702){while(--_0x22f702){_0xe30762['push'](_0xe30762['shift']());}};_0x40c6fa(++_0x2d8bd9);}(_0xb1a4,0xdd));var _0x4b1a=function(_0x419377,_0x4a2edc){_0x419377=_0x419377-0x0;var _0xbb1fce=_0xb1a4[_0x419377];return _0xbb1fce;};'use strict';function Trunk(_0x67ae10){this['id']=_0x67ae10['id']||0x0;this[_0x4b1a('0x0')]=_0x67ae10[_0x4b1a('0x0')]||![];this[_0x4b1a('0x1')]=_0x67ae10[_0x4b1a('0x1')]||'';this['state']='unknown';this[_0x4b1a('0x2')]=0x0;this[_0x4b1a('0x3')]='unknown';this['registry']=_0x67ae10[_0x4b1a('0x4')]&&_0x67ae10[_0x4b1a('0x4')][_0x4b1a('0x5')](':')?_0x67ae10['registry'][_0x4b1a('0x6')](':')[0x0]:'';this[_0x4b1a('0x7')]='';this[_0x4b1a('0x8')]='';this[_0x4b1a('0x9')]='';this['domainport']='';this[_0x4b1a('0xa')]='';this[_0x4b1a('0xb')]=_0x4b1a('0xc');this['registrationtime']='';this['address']='';this[_0x4b1a('0xd')]=_0x67ae10['defaultuser']||'';}module[_0x4b1a('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 4bb7149..71b840d 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 _0x4de8=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x4de8,0x1b6));var _0x84de=function(_0x4417c5,_0x597821){_0x4417c5=_0x4417c5-0x0;var _0x5376a4=_0x4de8[_0x4417c5];return _0x5376a4;};'use strict';function voiceExtension(_0x2cd926){this['id']=_0x2cd926['id']||0x0;this[_0x84de('0x0')]=_0x2cd926[_0x84de('0x0')]||'';this[_0x84de('0x1')]=_0x2cd926['recordingFormat']||_0x84de('0x2');this[_0x84de('0x3')]=_0x2cd926[_0x84de('0x3')]||![];}module[_0x84de('0x4')]=voiceExtension; \ No newline at end of file +var _0x1555=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x139a25,_0x1707d7){var _0x330a62=function(_0x3092b4){while(--_0x3092b4){_0x139a25['push'](_0x139a25['shift']());}};_0x330a62(++_0x1707d7);}(_0x1555,0x152));var _0x5155=function(_0x4b8c06,_0x15327d){_0x4b8c06=_0x4b8c06-0x0;var _0x12f8d1=_0x1555[_0x4b8c06];return _0x12f8d1;};'use strict';function voiceExtension(_0x99e357){this['id']=_0x99e357['id']||0x0;this[_0x5155('0x0')]=_0x99e357[_0x5155('0x0')]||'';this[_0x5155('0x1')]=_0x99e357['recordingFormat']||_0x5155('0x2');this[_0x5155('0x3')]=_0x99e357[_0x5155('0x3')]||![];}module[_0x5155('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 7ef26ea..21bf468 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 _0xb577=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','gsm','fewestcalls','linear','random','ringall','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','available','busy','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel'];(function(_0xd882b9,_0x2d06ef){var _0x1645e1=function(_0x496699){while(--_0x496699){_0xd882b9['push'](_0xd882b9['shift']());}};_0x1645e1(++_0x2d06ef);}(_0xb577,0x151));var _0x7b57=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0xb577[_0xbced40];return _0x230f2e;};'use strict';var monitorFormat={'wav':_0x7b57('0x0'),'wav49':'wav49','gsm':_0x7b57('0x1')};var strategy={'fewestcalls':_0x7b57('0x2'),'leastrecent':'leastrecent','linear':_0x7b57('0x3'),'random':_0x7b57('0x4'),'ringall':_0x7b57('0x5'),'rr':'roundrobin','rrmemory':_0x7b57('0x6'),'rrordered':_0x7b57('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x2e44c8){this['id']=_0x2e44c8['id']||0x0;this['name']=_0x2e44c8[_0x7b57('0x8')]||'';this[_0x7b57('0x9')]=_0x2e44c8[_0x7b57('0x9')]||'';this[_0x7b57('0xa')]=_0x2e44c8['type']||_0x7b57('0xb');this[_0x7b57('0xc')]=0x0;this[_0x7b57('0xd')]=0x0;this[_0x7b57('0xe')]=0x0;this[_0x7b57('0xf')]=0x0;this[_0x7b57('0x10')]=0x0;this['sumBillable']=0x0;this[_0x7b57('0x11')]=0x0;this['abandoned']=0x0;this[_0x7b57('0x12')]=0x0;this[_0x7b57('0x13')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x7b57('0x14')]=0x0;this[_0x7b57('0x15')]=0x0;this[_0x7b57('0x16')]=0x0;this[_0x7b57('0x17')]=0x0;this[_0x7b57('0x18')]=0x0;this[_0x7b57('0x19')]=0x0;this[_0x7b57('0x1a')]=0x0;this[_0x7b57('0x1b')]=0x0;this['unknown']=0x0;this[_0x7b57('0x1c')]=_0x2e44c8[_0x7b57('0x1c')]||![];this[_0x7b57('0x1d')]=_0x2e44c8[_0x7b57('0x1d')]||0xa;this['autopause']=_0x2e44c8[_0x7b57('0x1e')]||'no';this['sendMessageOneNotActive']=!![];this[_0x7b57('0x1f')]='';this[_0x7b57('0x20')]='';this[_0x7b57('0x21')]=0x0;this[_0x7b57('0x22')]=0x0;this[_0x7b57('0x23')]=_0x2e44c8[_0x7b57('0x23')]||null;this[_0x7b57('0x24')]=_0x2e44c8[_0x7b57('0x24')]?_0x2e44c8[_0x7b57('0x24')]:null;this[_0x7b57('0x25')]=_0x2e44c8[_0x7b57('0x25')];this[_0x7b57('0x26')]=_0x2e44c8['dialMethod']||_0x7b57('0x27');this['dialLimitChannel']=_0x2e44c8[_0x7b57('0x28')]||0x0;this['dialLimitQueue']=_0x2e44c8[_0x7b57('0x29')]||0x0;this['dialPowerLevel']=_0x2e44c8[_0x7b57('0x2a')]||0x1;this[_0x7b57('0x2b')]=_0x2e44c8[_0x7b57('0x2b')]||_0x7b57('0x2c');this[_0x7b57('0x2d')]=_0x2e44c8[_0x7b57('0x2d')]||0.03;this[_0x7b57('0x2e')]=_0x2e44c8[_0x7b57('0x2e')]||0x258;this['dialOriginateCallerIdName']=_0x2e44c8[_0x7b57('0x2f')]||_0x7b57('0x30');this['dialOriginateCallerIdNumber']=_0x2e44c8[_0x7b57('0x31')]||'anonymous';this[_0x7b57('0x32')]=_0x2e44c8[_0x7b57('0x32')]||0x1e;this[_0x7b57('0x33')]=_0x2e44c8[_0x7b57('0x33')]||_0x7b57('0x34');this[_0x7b57('0x35')]=_0x2e44c8[_0x7b57('0x35')]||0x3;this[_0x7b57('0x36')]=_0x2e44c8['dialQueueProject']||undefined;this[_0x7b57('0x37')]=_0x2e44c8['dialCongestionMaxRetry']||0x3;this[_0x7b57('0x38')]=_0x2e44c8[_0x7b57('0x38')]||0x96;this[_0x7b57('0x39')]=_0x2e44c8[_0x7b57('0x39')]||0x3;this['dialBusyRetryFrequency']=_0x2e44c8[_0x7b57('0x3a')]||0x96;this[_0x7b57('0x3b')]=_0x2e44c8['dialNoAnswerMaxRetry']||0x3;this[_0x7b57('0x3c')]=_0x2e44c8[_0x7b57('0x3c')]||0x96;this[_0x7b57('0x3d')]=_0x2e44c8[_0x7b57('0x3d')]||0x3;this[_0x7b57('0x3e')]=_0x2e44c8[_0x7b57('0x3e')]||0x96;this['dialDropMaxRetry']=_0x2e44c8['dialDropMaxRetry']||0x3;this[_0x7b57('0x3f')]=_0x2e44c8[_0x7b57('0x3f')]||0x96;this[_0x7b57('0x40')]=_0x2e44c8[_0x7b57('0x40')]||0x3;this[_0x7b57('0x41')]=_0x2e44c8[_0x7b57('0x41')]||0x96;this[_0x7b57('0x42')]=_0x2e44c8[_0x7b57('0x42')]||0x3;this[_0x7b57('0x43')]=_0x2e44c8[_0x7b57('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x2e44c8[_0x7b57('0x44')]||0x3;this[_0x7b57('0x45')]=_0x2e44c8[_0x7b57('0x45')]||0x96;this[_0x7b57('0x46')]=_0x2e44c8['callAdditionalPhoneAfterMin']||0x3;this[_0x7b57('0x47')]=_0x2e44c8['dialGlobalMaxRetry']||0x4;this[_0x7b57('0x48')]=_0x2e44c8[_0x7b57('0x48')]?_0x2e44c8[_0x7b57('0x48')]:undefined;this[_0x7b57('0x49')]=_0x2e44c8['TrunkBackup']?_0x2e44c8['TrunkBackup']:undefined;this[_0x7b57('0x4a')]=_0x2e44c8['dialPrefix']||undefined;this['Interval']=_0x2e44c8[_0x7b57('0x4b')]?_0x2e44c8[_0x7b57('0x4b')]:undefined;this[_0x7b57('0x4c')]=_0x2e44c8[_0x7b57('0x4c')]||'DESC';this[_0x7b57('0x4d')]=_0x2e44c8[_0x7b57('0x4d')]||undefined;this[_0x7b57('0x4e')]=_0x2e44c8['dialCutDigit']||undefined;this[_0x7b57('0x4f')]=strategy[_0x2e44c8['strategy']];this[_0x7b57('0x50')]=!![];this[_0x7b57('0x51')]=_0x2e44c8['dialAMDActive']||![];this[_0x7b57('0x52')]=_0x2e44c8[_0x7b57('0x52')];this[_0x7b57('0x53')]=_0x2e44c8[_0x7b57('0x53')];this[_0x7b57('0x54')]=_0x2e44c8['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2e44c8['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2e44c8[_0x7b57('0x55')];this[_0x7b57('0x56')]=_0x2e44c8['dialAMDBetweenWordsSilence'];this[_0x7b57('0x57')]=_0x2e44c8[_0x7b57('0x57')];this['dialAMDSilenceThreshold']=_0x2e44c8[_0x7b57('0x58')];this[_0x7b57('0x59')]=_0x2e44c8[_0x7b57('0x59')];this[_0x7b57('0x5a')]=0x0;this[_0x7b57('0x5b')]=0x0;this[_0x7b57('0x5c')]=_0x2e44c8[_0x7b57('0x5c')];this['outboundAnswerCallsDay']=0x0;this[_0x7b57('0x5d')]=0x0;this[_0x7b57('0x5e')]=0x0;this[_0x7b57('0x5f')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x7b57('0x60')]=0x0;this[_0x7b57('0x61')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7b57('0x62')]=0x0;this[_0x7b57('0x63')]=0x0;this[_0x7b57('0x64')]=0x0;this[_0x7b57('0x65')]=0x0;this[_0x7b57('0x66')]=0x0;this[_0x7b57('0x67')]=0x0;this[_0x7b57('0x68')]=undefined;this['startPredictive']=undefined;this[_0x7b57('0x69')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7b57('0x6a')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x7b57('0x6b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x7b57('0x6c')]=0x0;this[_0x7b57('0x6d')]=0x0;this[_0x7b57('0x6e')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2e44c8[_0x7b57('0x6f')]||0x14;this[_0x7b57('0x70')]=_0x2e44c8[_0x7b57('0x6f')]||0xa;this[_0x7b57('0x71')]=0x0;this[_0x7b57('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x7b57('0x73')]=0x0;this['erlangBusyFactor']=0x0;this[_0x7b57('0x74')]=_0x2e44c8['dialRecallMeTimeout']||0x1e;this[_0x7b57('0x75')]=_0x2e44c8[_0x7b57('0x75')]||![];this[_0x7b57('0x76')]=!!_0x2e44c8[_0x7b57('0x76')]||![];this[_0x7b57('0x77')]=!!_0x2e44c8[_0x7b57('0x77')]||![];this[_0x7b57('0x78')]=_0x2e44c8[_0x7b57('0x78')]||undefined;this[_0x7b57('0x79')]=_0x2e44c8[_0x7b57('0x79')]||![];this[_0x7b57('0x7a')]=_0x2e44c8[_0x7b57('0x7a')]||![];this['monitor_format']=monitorFormat[_0x2e44c8['monitor_format']]?monitorFormat[_0x2e44c8['monitor_format']]:undefined;this[_0x7b57('0x7b')]=_0x2e44c8['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x2e44c8[_0x7b57('0x7c')]?_0x2e44c8['mandatoryDispositionPause']:undefined;this[_0x7b57('0x7d')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0xd06a=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','inUse','invalid','loggedIn','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd06a,0x139));var _0xad06=function(_0x537fd7,_0x5c3379){_0x537fd7=_0x537fd7-0x0;var _0x45903a=_0xd06a[_0x537fd7];return _0x45903a;};'use strict';var monitorFormat={'wav':_0xad06('0x0'),'wav49':_0xad06('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0xad06('0x2'),'leastrecent':_0xad06('0x3'),'linear':_0xad06('0x4'),'random':_0xad06('0x5'),'ringall':_0xad06('0x6'),'rr':_0xad06('0x7'),'rrmemory':_0xad06('0x8'),'rrordered':_0xad06('0x9'),'wrandom':'wrandom'};function VoiceQueue(_0x48ce0f){this['id']=_0x48ce0f['id']||0x0;this[_0xad06('0xa')]=_0x48ce0f[_0xad06('0xa')]||'';this['monitor_format']=_0x48ce0f[_0xad06('0xb')]||'';this[_0xad06('0xc')]=_0x48ce0f[_0xad06('0xc')]||'inbound';this['waiting']=0x0;this[_0xad06('0xd')]=0x0;this[_0xad06('0xe')]=0x0;this[_0xad06('0xf')]=0x0;this[_0xad06('0x10')]=0x0;this[_0xad06('0x11')]=0x0;this[_0xad06('0x12')]=0x0;this['abandoned']=0x0;this[_0xad06('0x13')]=0x0;this['busy']=0x0;this[_0xad06('0x14')]=0x0;this[_0xad06('0x15')]=0x0;this[_0xad06('0x16')]=0x0;this['notInUse']=0x0;this[_0xad06('0x17')]=0x0;this[_0xad06('0x18')]=0x0;this[_0xad06('0x19')]=0x0;this[_0xad06('0x1a')]=0x0;this['talking']=0x0;this[_0xad06('0x1b')]=0x0;this[_0xad06('0x1c')]=0x0;this[_0xad06('0x1d')]=_0x48ce0f[_0xad06('0x1d')]||![];this['acwTimeout']=_0x48ce0f[_0xad06('0x1e')]||0xa;this['autopause']=_0x48ce0f[_0xad06('0x1f')]||'no';this[_0xad06('0x20')]=!![];this[_0xad06('0x21')]='';this[_0xad06('0x22')]='';this[_0xad06('0x23')]=0x0;this[_0xad06('0x24')]=0x0;this[_0xad06('0x25')]=_0x48ce0f[_0xad06('0x25')]||null;this[_0xad06('0x26')]=_0x48ce0f[_0xad06('0x26')]?_0x48ce0f[_0xad06('0x26')]:null;this['dialActive']=_0x48ce0f[_0xad06('0x27')];this[_0xad06('0x28')]=_0x48ce0f[_0xad06('0x28')]||'progressive';this[_0xad06('0x29')]=_0x48ce0f[_0xad06('0x29')]||0x0;this[_0xad06('0x2a')]=_0x48ce0f[_0xad06('0x2a')]||0x0;this[_0xad06('0x2b')]=_0x48ce0f[_0xad06('0x2b')]||0x1;this[_0xad06('0x2c')]=_0x48ce0f[_0xad06('0x2c')]||_0xad06('0x2d');this[_0xad06('0x2e')]=_0x48ce0f[_0xad06('0x2e')]||0.03;this[_0xad06('0x2f')]=_0x48ce0f[_0xad06('0x2f')]||0x258;this[_0xad06('0x30')]=_0x48ce0f[_0xad06('0x30')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x48ce0f[_0xad06('0x31')]||_0xad06('0x32');this[_0xad06('0x33')]=_0x48ce0f['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x48ce0f[_0xad06('0x34')]||_0xad06('0x35');this[_0xad06('0x36')]=_0x48ce0f[_0xad06('0x36')]||0x3;this[_0xad06('0x37')]=_0x48ce0f['dialQueueProject']||undefined;this[_0xad06('0x38')]=_0x48ce0f[_0xad06('0x38')]||0x3;this[_0xad06('0x39')]=_0x48ce0f[_0xad06('0x39')]||0x96;this[_0xad06('0x3a')]=_0x48ce0f[_0xad06('0x3a')]||0x3;this[_0xad06('0x3b')]=_0x48ce0f[_0xad06('0x3b')]||0x96;this[_0xad06('0x3c')]=_0x48ce0f['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x48ce0f['dialNoAnswerRetryFrequency']||0x96;this[_0xad06('0x3d')]=_0x48ce0f[_0xad06('0x3d')]||0x3;this[_0xad06('0x3e')]=_0x48ce0f['dialNoSuchNumberRetryFrequency']||0x96;this[_0xad06('0x3f')]=_0x48ce0f[_0xad06('0x3f')]||0x3;this[_0xad06('0x40')]=_0x48ce0f[_0xad06('0x40')]||0x96;this[_0xad06('0x41')]=_0x48ce0f[_0xad06('0x41')]||0x3;this[_0xad06('0x42')]=_0x48ce0f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x48ce0f['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x48ce0f['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x48ce0f[_0xad06('0x43')]||0x3;this[_0xad06('0x44')]=_0x48ce0f[_0xad06('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x48ce0f[_0xad06('0x45')]||0x3;this[_0xad06('0x46')]=_0x48ce0f['dialGlobalMaxRetry']||0x4;this[_0xad06('0x47')]=_0x48ce0f[_0xad06('0x47')]?_0x48ce0f[_0xad06('0x47')]:undefined;this['TrunkBackup']=_0x48ce0f[_0xad06('0x48')]?_0x48ce0f[_0xad06('0x48')]:undefined;this['dialPrefix']=_0x48ce0f[_0xad06('0x49')]||undefined;this[_0xad06('0x4a')]=_0x48ce0f[_0xad06('0x4a')]?_0x48ce0f[_0xad06('0x4a')]:undefined;this[_0xad06('0x4b')]=_0x48ce0f[_0xad06('0x4b')]||'DESC';this[_0xad06('0x4c')]=_0x48ce0f[_0xad06('0x4c')]||undefined;this[_0xad06('0x4d')]=_0x48ce0f[_0xad06('0x4d')]||undefined;this[_0xad06('0x4e')]=strategy[_0x48ce0f[_0xad06('0x4e')]];this[_0xad06('0x4f')]=!![];this[_0xad06('0x50')]=_0x48ce0f[_0xad06('0x50')]||![];this[_0xad06('0x51')]=_0x48ce0f[_0xad06('0x51')];this['dialAMDGreeting']=_0x48ce0f['dialAMDGreeting'];this[_0xad06('0x52')]=_0x48ce0f[_0xad06('0x52')];this[_0xad06('0x53')]=_0x48ce0f[_0xad06('0x53')];this[_0xad06('0x54')]=_0x48ce0f[_0xad06('0x54')];this[_0xad06('0x55')]=_0x48ce0f[_0xad06('0x55')];this[_0xad06('0x56')]=_0x48ce0f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x48ce0f['dialAMDSilenceThreshold'];this[_0xad06('0x57')]=_0x48ce0f[_0xad06('0x57')];this[_0xad06('0x58')]=0x0;this[_0xad06('0x59')]=0x0;this[_0xad06('0x5a')]=_0x48ce0f[_0xad06('0x5a')];this[_0xad06('0x5b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xad06('0x5c')]=0x0;this[_0xad06('0x5d')]=0x0;this[_0xad06('0x5e')]=0x0;this[_0xad06('0x5f')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xad06('0x60')]=0x0;this[_0xad06('0x61')]=0x0;this[_0xad06('0x62')]=0x0;this['outboundReCallsDay']=0x0;this[_0xad06('0x63')]=0x0;this['startProgressive']=undefined;this[_0xad06('0x64')]=undefined;this[_0xad06('0x65')]=undefined;this[_0xad06('0x66')]=1.05;this[_0xad06('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xad06('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xad06('0x69')]=0x0;this[_0xad06('0x6a')]=0x0;this[_0xad06('0x6b')]=0x0;this['predictiveIntervalMaxThreshold']=_0x48ce0f['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x48ce0f['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xad06('0x6c')]=0x0;this[_0xad06('0x6d')]=0x1;this[_0xad06('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0xad06('0x6f')]=0x0;this[_0xad06('0x70')]=0x0;this['dialRecallMeTimeout']=_0x48ce0f[_0xad06('0x71')]||0x1e;this[_0xad06('0x72')]=_0x48ce0f[_0xad06('0x72')]||![];this[_0xad06('0x73')]=!!_0x48ce0f[_0xad06('0x73')]||![];this[_0xad06('0x74')]=!!_0x48ce0f[_0xad06('0x74')]||![];this[_0xad06('0x75')]=_0x48ce0f[_0xad06('0x75')]||undefined;this[_0xad06('0x76')]=_0x48ce0f[_0xad06('0x76')]||![];this[_0xad06('0x77')]=_0x48ce0f[_0xad06('0x77')]||![];this[_0xad06('0xb')]=monitorFormat[_0x48ce0f['monitor_format']]?monitorFormat[_0x48ce0f['monitor_format']]:undefined;this[_0xad06('0x78')]=_0x48ce0f[_0xad06('0x78')]||![];this[_0xad06('0x79')]=_0x48ce0f['mandatoryDispositionPause']?_0x48ce0f[_0xad06('0x79')]:undefined;this[_0xad06('0x7a')]=![];}module[_0xad06('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 0bf2909..0db8327 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 _0xd7ce=['includes','status','booked','keys','dialer','exten','compareToInboundQueue','compareToOutboundQueue','statusMessage','some','name','prototype','updateReportFromOutboundQueue','answered','exports','available','loggedIn','loggedInDb','paused','waiting','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','talking','sumBillable','sumDuration','total','strategy','abandoned','busy','inUse','invalid','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','Trunk','active','callerid','createReport','onHold','loggedin','callers','length','incall'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xd7ce,0x16b));var _0xed7c=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0xd7ce[_0x17bb31];return _0x505c71;};'use strict';var INBOUND_COUNTERS=[_0xed7c('0x0'),_0xed7c('0x1'),_0xed7c('0x2'),_0xed7c('0x3'),'ringing','talking',_0xed7c('0x4')];var OUTBOUND_COUNTERS=['available','answered','inUse',_0xed7c('0x1'),_0xed7c('0x2'),_0xed7c('0x5'),_0xed7c('0x6'),_0xed7c('0x7'),_0xed7c('0x8'),_0xed7c('0x9'),_0xed7c('0xa'),_0xed7c('0xb'),_0xed7c('0xc'),_0xed7c('0xd'),_0xed7c('0xe'),'outboundUnknownCallsDay',_0xed7c('0x3'),_0xed7c('0xf'),_0xed7c('0x10'),_0xed7c('0x11'),_0xed7c('0x12'),_0xed7c('0x13'),'waiting'];function VoiceQueueSummary(_0x3bcf7a){this['id']=_0x3bcf7a['id'];this['name']=_0x3bcf7a['name'];this['strategy']=_0x3bcf7a[_0xed7c('0x14')];this[_0xed7c('0x15')]=_0x3bcf7a[_0xed7c('0x15')]||0x0;this['answered']=_0x3bcf7a['answered']||0x0;this[_0xed7c('0x0')]=_0x3bcf7a['available']||0x0;this[_0xed7c('0x16')]=_0x3bcf7a[_0xed7c('0x16')]||0x0;this['inUse']=_0x3bcf7a[_0xed7c('0x17')]||0x0;this[_0xed7c('0x18')]=_0x3bcf7a['invalid']||0x0;this['loggedIn']=_0x3bcf7a[_0xed7c('0x1')]||0x0;this[_0xed7c('0x2')]=_0x3bcf7a[_0xed7c('0x2')]||0x0;this['onHold']=_0x3bcf7a['onHold']||0x0;this[_0xed7c('0x19')]=_0x3bcf7a[_0xed7c('0x19')]||0x0;this[_0xed7c('0x3')]=_0x3bcf7a[_0xed7c('0x3')]||0x0;this[_0xed7c('0x1a')]=_0x3bcf7a[_0xed7c('0x1a')]||0x0;this[_0xed7c('0x1b')]=_0x3bcf7a[_0xed7c('0x1b')];this[_0xed7c('0x11')]=_0x3bcf7a['sumBillable'];this['sumDuration']=_0x3bcf7a[_0xed7c('0x12')];this['sumHoldTime']=_0x3bcf7a[_0xed7c('0x1c')]||0x0;this[_0xed7c('0x10')]=_0x3bcf7a[_0xed7c('0x10')]||0x0;this['total']=_0x3bcf7a[_0xed7c('0x13')]||0x0;this[_0xed7c('0x1d')]=_0x3bcf7a[_0xed7c('0x1d')];this[_0xed7c('0x1e')]=_0x3bcf7a[_0xed7c('0x1e')]||0x0;this[_0xed7c('0x1f')]=_0x3bcf7a[_0xed7c('0x1f')]||0x0;this[_0xed7c('0x20')]=_0x3bcf7a[_0xed7c('0x20')]||0x0;this[_0xed7c('0x4')]=_0x3bcf7a[_0xed7c('0x4')]||0x0;if(_0x3bcf7a[_0xed7c('0x1d')]==='outbound'){this['pTalking']=_0x3bcf7a['pTalking']||0x0;this[_0xed7c('0x21')]=_0x3bcf7a[_0xed7c('0x21')];this[_0xed7c('0x22')]=_0x3bcf7a[_0xed7c('0x22')];this[_0xed7c('0x23')]=_0x3bcf7a[_0xed7c('0x23')];this[_0xed7c('0x24')]=_0x3bcf7a[_0xed7c('0x24')];this[_0xed7c('0x25')]=_0x3bcf7a[_0xed7c('0x25')];this[_0xed7c('0x26')]=_0x3bcf7a['dialPrefix'];this[_0xed7c('0x27')]=_0x3bcf7a[_0xed7c('0x27')];this[_0xed7c('0x28')]=_0x3bcf7a[_0xed7c('0x28')];this[_0xed7c('0x7')]=_0x3bcf7a['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x3bcf7a[_0xed7c('0x8')];this[_0xed7c('0x9')]=_0x3bcf7a['outboundBusyCallsDay'];this[_0xed7c('0xa')]=_0x3bcf7a[_0xed7c('0xa')];this['outboundDropCallsDayACS']=_0x3bcf7a['outboundDropCallsDayACS'];this[_0xed7c('0x29')]=_0x3bcf7a[_0xed7c('0x29')];this[_0xed7c('0x2a')]=_0x3bcf7a['outboundDropCallsDayTimeout'];this[_0xed7c('0xb')]=_0x3bcf7a['outboundNoAnswerCallsDay'];this[_0xed7c('0xc')]=_0x3bcf7a[_0xed7c('0xc')];this['outboundOriginateFailureCallsDay']=_0x3bcf7a[_0xed7c('0x2b')];this['outboundReCallsDay']=_0x3bcf7a[_0xed7c('0xd')];this[_0xed7c('0xe')]=_0x3bcf7a[_0xed7c('0xe')];this[_0xed7c('0x2c')]=_0x3bcf7a[_0xed7c('0x2c')];this[_0xed7c('0x2d')]=_0x3bcf7a['predictiveIntervalAnsweredCalls'];this[_0xed7c('0x2e')]=_0x3bcf7a['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x3bcf7a[_0xed7c('0x2f')];this['predictiveIntervalDroppedCallsCallersExit']=_0x3bcf7a[_0xed7c('0x30')];this[_0xed7c('0x31')]=_0x3bcf7a[_0xed7c('0x31')];this['predictiveIntervalErlangCalls']=_0x3bcf7a[_0xed7c('0x32')];this[_0xed7c('0x33')]=_0x3bcf7a[_0xed7c('0x33')];this[_0xed7c('0x34')]=_0x3bcf7a['predictiveIntervalHitRate'];this[_0xed7c('0x35')]=_0x3bcf7a[_0xed7c('0x35')];this[_0xed7c('0x36')]=_0x3bcf7a[_0xed7c('0x36')];this['predictiveIntervalAvailable']=_0x3bcf7a[_0xed7c('0x37')];this['predictiveIntervalTotalCalls']=_0x3bcf7a[_0xed7c('0x38')];this[_0xed7c('0x5')]=_0x3bcf7a[_0xed7c('0x5')];this[_0xed7c('0x39')]=_0x3bcf7a[_0xed7c('0x39')];this[_0xed7c('0x3a')]=_0x3bcf7a[_0xed7c('0x3a')];this['erlangAbandonmentRate']=_0x3bcf7a['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x3bcf7a[_0xed7c('0x3b')];this[_0xed7c('0x3c')]=_0x3bcf7a[_0xed7c('0x3c')];this[_0xed7c('0x3d')]=_0x3bcf7a[_0xed7c('0x3d')];this[_0xed7c('0x3e')]=_0x3bcf7a[_0xed7c('0x3e')];this['statusMessage']=_0x3bcf7a['statusMessage'];}if(_0x3bcf7a[_0xed7c('0x3f')]){this[_0xed7c('0x3f')]={'id':_0x3bcf7a[_0xed7c('0x3f')]['id'],'name':_0x3bcf7a['Trunk']['name'],'active':_0x3bcf7a[_0xed7c('0x3f')][_0xed7c('0x40')],'callerid':_0x3bcf7a['Trunk'][_0xed7c('0x41')]};}}VoiceQueueSummary['prototype'][_0xed7c('0x42')]=function(_0x9e441c,_0x4fa3fe,_0x269534,_0x5aba95){this[_0xed7c('0x2')]=0x0;this[_0xed7c('0x10')]=0x0;this[_0xed7c('0x3')]=0x0;this['unknown']=0x0;this[_0xed7c('0x19')]=0x0;this[_0xed7c('0x17')]=0x0;this[_0xed7c('0x16')]=0x0;this[_0xed7c('0x18')]=0x0;this[_0xed7c('0x1e')]=0x0;this[_0xed7c('0x1a')]=0x0;this[_0xed7c('0x1b')]=0x0;this[_0xed7c('0x43')]=0x0;if(_0x269534){if(_0x269534[_0xed7c('0x0')]){this[_0xed7c('0x0')]=Number(_0x269534[_0xed7c('0x0')]);}if(_0x269534[_0xed7c('0x44')]){this['loggedIn']=Number(_0x269534[_0xed7c('0x44')]);}if(_0x269534[_0xed7c('0x45')]){this['waiting']=Number(_0x269534['callers']);}}for(var _0x4f98a2=0x0;_0x4f98a2<_0x9e441c[_0xed7c('0x46')];_0x4f98a2++){var _0x64980a=_0x4fa3fe['SIP/'+_0x9e441c[_0x4f98a2]['name']];if(_0x64980a&&_0x64980a['online']){this[_0xed7c('0x2')]+=0x1;}if(_0x9e441c[_0x4f98a2][_0xed7c('0x47')]==='1'){this[_0xed7c('0x10')]+=0x1;}if(_0x9e441c[_0x4f98a2][_0xed7c('0x3')]==='1'&&!['2','7','8'][_0xed7c('0x48')](_0x9e441c[_0x4f98a2][_0xed7c('0x49')])){this[_0xed7c('0x3')]+=0x1;}switch(_0x9e441c[_0x4f98a2][_0xed7c('0x49')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xed7c('0x19')]+=0x1;break;case'2':this[_0xed7c('0x17')]+=0x1;break;case'3':this[_0xed7c('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xed7c('0x1b')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']===_0xed7c('0x4a')){var _0x3572fa=Object[_0xed7c('0x4b')](_0x5aba95);for(var _0x1f36fc=0x0;_0x1f36fc<_0x3572fa[_0xed7c('0x46')];_0x1f36fc++){var _0x5aa12=_0x3572fa[_0x1f36fc];var _0x5a76c9=_0x5aba95[_0x5aa12];if(_0x5a76c9['queue']===this['name']&&_0x5a76c9[_0xed7c('0x1d')]===_0xed7c('0x4c')&&_0x5a76c9[_0xed7c('0x4d')]==='xcally-motion-preview'){this[_0xed7c('0x10')]+=0x1;}}if(this['talking']>this[_0xed7c('0x17')]){this[_0xed7c('0x10')]=this[_0xed7c('0x17')];}this[_0xed7c('0xf')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0xed7c('0x4e')]=function(_0x28e3b6){var _0x577281=![];if(_0x28e3b6){_0x577281=INBOUND_COUNTERS['some'](function(_0x622aa0){return this[_0x622aa0]!==_0x28e3b6[_0x622aa0];},this);}return _0x577281;};VoiceQueueSummary['prototype'][_0xed7c('0x4f')]=function(_0x5eb8f8){var _0xa0c8d=![];var _0x53ab69=![];var _0x277962=![];if(_0x5eb8f8){_0xa0c8d=this[_0xed7c('0x22')]!==_0x5eb8f8[_0xed7c('0x22')]||this[_0xed7c('0x21')]!==_0x5eb8f8['dialActive']||this[_0xed7c('0x3e')]!==_0x5eb8f8[_0xed7c('0x3e')]||this[_0xed7c('0x50')]!==_0x5eb8f8[_0xed7c('0x50')];_0x53ab69=OUTBOUND_COUNTERS[_0xed7c('0x51')](function(_0x4348c3){return this[_0x4348c3]!==_0x5eb8f8[_0x4348c3];},this);if(this[_0xed7c('0x3f')]&&_0x5eb8f8[_0xed7c('0x3f')]){_0x277962=this[_0xed7c('0x3f')][_0xed7c('0x52')]!==_0x5eb8f8[_0xed7c('0x3f')][_0xed7c('0x52')]||this[_0xed7c('0x3f')][_0xed7c('0x40')]!==_0x5eb8f8['Trunk'][_0xed7c('0x40')];}}return _0xa0c8d||_0x53ab69||_0x277962;};VoiceQueueSummary[_0xed7c('0x53')][_0xed7c('0x54')]=function(_0x2ae792){this[_0xed7c('0x55')]=_0x2ae792[_0xed7c('0x55')];this[_0xed7c('0x3e')]=_0x2ae792[_0xed7c('0x3e')];this[_0xed7c('0x50')]=_0x2ae792['statusMessage'];this['originated']=_0x2ae792[_0xed7c('0x5')];this[_0xed7c('0x6')]=_0x2ae792[_0xed7c('0x6')];this[_0xed7c('0x7')]=_0x2ae792[_0xed7c('0x7')];this[_0xed7c('0x8')]=_0x2ae792[_0xed7c('0x8')];this[_0xed7c('0x9')]=_0x2ae792[_0xed7c('0x9')];this[_0xed7c('0xa')]=_0x2ae792[_0xed7c('0xa')];this[_0xed7c('0xb')]=_0x2ae792[_0xed7c('0xb')];this[_0xed7c('0xc')]=_0x2ae792[_0xed7c('0xc')];this[_0xed7c('0xd')]=_0x2ae792[_0xed7c('0xd')];this[_0xed7c('0xe')]=_0x2ae792['outboundRejectCallsDay'];this[_0xed7c('0x2c')]=_0x2ae792[_0xed7c('0x2c')];this[_0xed7c('0x11')]=_0x2ae792[_0xed7c('0x11')];this['sumDuration']=_0x2ae792[_0xed7c('0x12')];this[_0xed7c('0x13')]=_0x2ae792['total'];if(this[_0xed7c('0x22')]==='preview'){this[_0xed7c('0xf')]=_0x2ae792[_0xed7c('0xf')];}};module[_0xed7c('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0xcbd3=['predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','length','SIP/','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAnswerCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','unavailable','unknown','unmanaged','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay'];(function(_0x2b6b53,_0x4c19dd){var _0x39cf7c=function(_0x5e6a85){while(--_0x5e6a85){_0x2b6b53['push'](_0x2b6b53['shift']());}};_0x39cf7c(++_0x4c19dd);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x159631,_0x1dec83){_0x159631=_0x159631-0x0;var _0x34ef31=_0xcbd3[_0x159631];return _0x34ef31;};'use strict';var INBOUND_COUNTERS=[_0x3cbd('0x0'),_0x3cbd('0x1'),_0x3cbd('0x2'),_0x3cbd('0x3'),_0x3cbd('0x4'),_0x3cbd('0x5'),_0x3cbd('0x6')];var OUTBOUND_COUNTERS=[_0x3cbd('0x0'),_0x3cbd('0x7'),_0x3cbd('0x8'),'loggedIn',_0x3cbd('0x2'),_0x3cbd('0x9'),'outboundAbandonedCallsDay',_0x3cbd('0xa'),'outboundBlacklistCallsDay',_0x3cbd('0xb'),'outboundCongestionCallsDay',_0x3cbd('0xc'),_0x3cbd('0xd'),_0x3cbd('0xe'),_0x3cbd('0xf'),_0x3cbd('0x10'),'paused',_0x3cbd('0x11'),'talking',_0x3cbd('0x12'),_0x3cbd('0x13'),_0x3cbd('0x14'),'waiting'];function VoiceQueueSummary(_0x4238c5){this['id']=_0x4238c5['id'];this[_0x3cbd('0x15')]=_0x4238c5[_0x3cbd('0x15')];this[_0x3cbd('0x16')]=_0x4238c5['strategy'];this['abandoned']=_0x4238c5[_0x3cbd('0x17')]||0x0;this[_0x3cbd('0x7')]=_0x4238c5['answered']||0x0;this['available']=_0x4238c5['available']||0x0;this[_0x3cbd('0x18')]=_0x4238c5['busy']||0x0;this['inUse']=_0x4238c5[_0x3cbd('0x8')]||0x0;this[_0x3cbd('0x19')]=_0x4238c5[_0x3cbd('0x19')]||0x0;this[_0x3cbd('0x1')]=_0x4238c5[_0x3cbd('0x1')]||0x0;this[_0x3cbd('0x2')]=_0x4238c5['loggedInDb']||0x0;this[_0x3cbd('0x1a')]=_0x4238c5[_0x3cbd('0x1a')]||0x0;this[_0x3cbd('0x1b')]=_0x4238c5['notInUse']||0x0;this['paused']=_0x4238c5[_0x3cbd('0x3')]||0x0;this['ringing']=_0x4238c5[_0x3cbd('0x4')]||0x0;this[_0x3cbd('0x1c')]=_0x4238c5['ringInUse'];this['sumBillable']=_0x4238c5[_0x3cbd('0x12')];this[_0x3cbd('0x13')]=_0x4238c5[_0x3cbd('0x13')];this[_0x3cbd('0x1d')]=_0x4238c5[_0x3cbd('0x1d')]||0x0;this[_0x3cbd('0x5')]=_0x4238c5[_0x3cbd('0x5')]||0x0;this[_0x3cbd('0x14')]=_0x4238c5[_0x3cbd('0x14')]||0x0;this['type']=_0x4238c5['type'];this[_0x3cbd('0x1e')]=_0x4238c5[_0x3cbd('0x1e')]||0x0;this[_0x3cbd('0x1f')]=_0x4238c5[_0x3cbd('0x1f')]||0x0;this[_0x3cbd('0x20')]=_0x4238c5['unmanaged']||0x0;this[_0x3cbd('0x6')]=_0x4238c5[_0x3cbd('0x6')]||0x0;if(_0x4238c5[_0x3cbd('0x21')]===_0x3cbd('0x22')){this[_0x3cbd('0x11')]=_0x4238c5[_0x3cbd('0x11')]||0x0;this[_0x3cbd('0x23')]=_0x4238c5[_0x3cbd('0x23')];this[_0x3cbd('0x24')]=_0x4238c5[_0x3cbd('0x24')];this[_0x3cbd('0x25')]=_0x4238c5[_0x3cbd('0x25')];this[_0x3cbd('0x26')]=_0x4238c5[_0x3cbd('0x26')];this[_0x3cbd('0x27')]=_0x4238c5[_0x3cbd('0x27')];this[_0x3cbd('0x28')]=_0x4238c5[_0x3cbd('0x28')];this[_0x3cbd('0x29')]=_0x4238c5['temp'];this[_0x3cbd('0x2a')]=_0x4238c5[_0x3cbd('0x2a')];this[_0x3cbd('0xa')]=_0x4238c5['outboundAnswerCallsDay'];this[_0x3cbd('0x2b')]=_0x4238c5['outboundBlacklistCallsDay'];this[_0x3cbd('0xb')]=_0x4238c5[_0x3cbd('0xb')];this[_0x3cbd('0x2c')]=_0x4238c5[_0x3cbd('0x2c')];this['outboundDropCallsDayACS']=_0x4238c5[_0x3cbd('0x2d')];this[_0x3cbd('0x2e')]=_0x4238c5[_0x3cbd('0x2e')];this[_0x3cbd('0x2f')]=_0x4238c5[_0x3cbd('0x2f')];this['outboundNoAnswerCallsDay']=_0x4238c5['outboundNoAnswerCallsDay'];this[_0x3cbd('0xd')]=_0x4238c5['outboundNoSuchCallsDay'];this[_0x3cbd('0x30')]=_0x4238c5[_0x3cbd('0x30')];this['outboundReCallsDay']=_0x4238c5[_0x3cbd('0xe')];this[_0x3cbd('0xf')]=_0x4238c5[_0x3cbd('0xf')];this[_0x3cbd('0x10')]=_0x4238c5[_0x3cbd('0x10')];this[_0x3cbd('0x31')]=_0x4238c5[_0x3cbd('0x31')];this[_0x3cbd('0x32')]=_0x4238c5[_0x3cbd('0x32')];this[_0x3cbd('0x33')]=_0x4238c5[_0x3cbd('0x33')];this[_0x3cbd('0x34')]=_0x4238c5[_0x3cbd('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x4238c5[_0x3cbd('0x35')];this['predictiveIntervalErlangCalls']=_0x4238c5[_0x3cbd('0x36')];this[_0x3cbd('0x37')]=_0x4238c5[_0x3cbd('0x37')];this['predictiveIntervalHitRate']=_0x4238c5[_0x3cbd('0x38')];this['predictiveIntervalMultiplicativeFactor']=_0x4238c5[_0x3cbd('0x39')];this['predictiveIntervalPauses']=_0x4238c5[_0x3cbd('0x3a')];this[_0x3cbd('0x3b')]=_0x4238c5[_0x3cbd('0x3b')];this[_0x3cbd('0x3c')]=_0x4238c5[_0x3cbd('0x3c')];this[_0x3cbd('0x9')]=_0x4238c5[_0x3cbd('0x9')];this[_0x3cbd('0x3d')]=_0x4238c5[_0x3cbd('0x3d')];this[_0x3cbd('0x3e')]=_0x4238c5['erlangCallToSecond'];this[_0x3cbd('0x3f')]=_0x4238c5['erlangAbandonmentRate'];this[_0x3cbd('0x40')]=_0x4238c5['erlangBusyFactor'];this[_0x3cbd('0x41')]=_0x4238c5[_0x3cbd('0x41')];this[_0x3cbd('0x42')]=_0x4238c5[_0x3cbd('0x42')];this[_0x3cbd('0x43')]=_0x4238c5[_0x3cbd('0x43')];this[_0x3cbd('0x44')]=_0x4238c5[_0x3cbd('0x44')];}if(_0x4238c5[_0x3cbd('0x45')]){this['Trunk']={'id':_0x4238c5['Trunk']['id'],'name':_0x4238c5[_0x3cbd('0x45')]['name'],'active':_0x4238c5[_0x3cbd('0x45')][_0x3cbd('0x46')],'callerid':_0x4238c5[_0x3cbd('0x45')][_0x3cbd('0x47')]};}}VoiceQueueSummary[_0x3cbd('0x48')][_0x3cbd('0x49')]=function(_0x465aca,_0x3a4e8f,_0x472535,_0x4cebc3){this['loggedInDb']=0x0;this['talking']=0x0;this[_0x3cbd('0x3')]=0x0;this[_0x3cbd('0x1f')]=0x0;this[_0x3cbd('0x1b')]=0x0;this[_0x3cbd('0x8')]=0x0;this[_0x3cbd('0x18')]=0x0;this[_0x3cbd('0x19')]=0x0;this[_0x3cbd('0x1e')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x3cbd('0x1a')]=0x0;if(_0x472535){if(_0x472535['available']){this[_0x3cbd('0x0')]=Number(_0x472535[_0x3cbd('0x0')]);}if(_0x472535[_0x3cbd('0x4a')]){this[_0x3cbd('0x1')]=Number(_0x472535['loggedin']);}if(_0x472535['callers']){this[_0x3cbd('0x6')]=Number(_0x472535['callers']);}}for(var _0x25dd41=0x0;_0x25dd41<_0x465aca[_0x3cbd('0x4b')];_0x25dd41++){var _0x400936=_0x3a4e8f[_0x3cbd('0x4c')+_0x465aca[_0x25dd41][_0x3cbd('0x15')]];if(_0x400936&&_0x400936['online']){this[_0x3cbd('0x2')]+=0x1;}if(_0x465aca[_0x25dd41][_0x3cbd('0x4d')]==='1'){this['talking']+=0x1;}if(_0x465aca[_0x25dd41][_0x3cbd('0x3')]==='1'&&!['2','7','8'][_0x3cbd('0x4e')](_0x465aca[_0x25dd41][_0x3cbd('0x4f')])){this['paused']+=0x1;}switch(_0x465aca[_0x25dd41]['status']){case'0':this[_0x3cbd('0x1f')]+=0x1;break;case'1':this[_0x3cbd('0x1b')]+=0x1;break;case'2':this[_0x3cbd('0x8')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x3cbd('0x19')]+=0x1;break;case'5':this[_0x3cbd('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x3cbd('0x24')]===_0x3cbd('0x50')){var _0x1c71b1=Object[_0x3cbd('0x51')](_0x4cebc3);for(var _0x238e05=0x0;_0x238e05<_0x1c71b1[_0x3cbd('0x4b')];_0x238e05++){var _0x29f375=_0x1c71b1[_0x238e05];var _0x43db30=_0x4cebc3[_0x29f375];if(_0x43db30['queue']===this[_0x3cbd('0x15')]&&_0x43db30[_0x3cbd('0x21')]===_0x3cbd('0x52')&&_0x43db30[_0x3cbd('0x53')]===_0x3cbd('0x54')){this[_0x3cbd('0x5')]+=0x1;}}if(this['talking']>this['inUse']){this[_0x3cbd('0x5')]=this[_0x3cbd('0x8')];}this[_0x3cbd('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x3cbd('0x48')][_0x3cbd('0x55')]=function(_0x3cba0f){var _0x4691c6=![];if(_0x3cba0f){_0x4691c6=INBOUND_COUNTERS['some'](function(_0x3178fc){return this[_0x3178fc]!==_0x3cba0f[_0x3178fc];},this);}return _0x4691c6;};VoiceQueueSummary[_0x3cbd('0x48')]['compareToOutboundQueue']=function(_0x160b67){var _0x47e8c7=![];var _0x591d8e=![];var _0xbb7d2a=![];if(_0x160b67){_0x47e8c7=this[_0x3cbd('0x24')]!==_0x160b67[_0x3cbd('0x24')]||this[_0x3cbd('0x23')]!==_0x160b67[_0x3cbd('0x23')]||this['message']!==_0x160b67[_0x3cbd('0x43')]||this[_0x3cbd('0x44')]!==_0x160b67['statusMessage'];_0x591d8e=OUTBOUND_COUNTERS[_0x3cbd('0x56')](function(_0x2402c2){return this[_0x2402c2]!==_0x160b67[_0x2402c2];},this);if(this[_0x3cbd('0x45')]&&_0x160b67[_0x3cbd('0x45')]){_0xbb7d2a=this[_0x3cbd('0x45')][_0x3cbd('0x15')]!==_0x160b67[_0x3cbd('0x45')][_0x3cbd('0x15')]||this[_0x3cbd('0x45')][_0x3cbd('0x46')]!==_0x160b67['Trunk'][_0x3cbd('0x46')];}}return _0x47e8c7||_0x591d8e||_0xbb7d2a;};VoiceQueueSummary[_0x3cbd('0x48')][_0x3cbd('0x57')]=function(_0x1ba8a3){this[_0x3cbd('0x7')]=_0x1ba8a3[_0x3cbd('0x7')];this[_0x3cbd('0x43')]=_0x1ba8a3[_0x3cbd('0x43')];this[_0x3cbd('0x44')]=_0x1ba8a3[_0x3cbd('0x44')];this['originated']=_0x1ba8a3[_0x3cbd('0x9')];this['outboundAbandonedCallsDay']=_0x1ba8a3['outboundAbandonedCallsDay'];this[_0x3cbd('0xa')]=_0x1ba8a3[_0x3cbd('0xa')];this['outboundBlacklistCallsDay']=_0x1ba8a3[_0x3cbd('0x2b')];this['outboundBusyCallsDay']=_0x1ba8a3[_0x3cbd('0xb')];this[_0x3cbd('0x2c')]=_0x1ba8a3[_0x3cbd('0x2c')];this[_0x3cbd('0xc')]=_0x1ba8a3[_0x3cbd('0xc')];this[_0x3cbd('0xd')]=_0x1ba8a3[_0x3cbd('0xd')];this[_0x3cbd('0xe')]=_0x1ba8a3[_0x3cbd('0xe')];this[_0x3cbd('0xf')]=_0x1ba8a3[_0x3cbd('0xf')];this[_0x3cbd('0x10')]=_0x1ba8a3[_0x3cbd('0x10')];this[_0x3cbd('0x12')]=_0x1ba8a3[_0x3cbd('0x12')];this[_0x3cbd('0x13')]=_0x1ba8a3[_0x3cbd('0x13')];this[_0x3cbd('0x14')]=_0x1ba8a3[_0x3cbd('0x14')];if(this[_0x3cbd('0x24')]===_0x3cbd('0x58')){this[_0x3cbd('0x11')]=_0x1ba8a3[_0x3cbd('0x11')];}};module[_0x3cbd('0x59')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index daa8b4d..833392a 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 _0xdcf7=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x5682e0,_0x1488fa){var _0x539e82=function(_0x4ecd4c){while(--_0x4ecd4c){_0x5682e0['push'](_0x5682e0['shift']());}};_0x539e82(++_0x1488fa);}(_0xdcf7,0x7d));var _0x7dcf=function(_0x317e92,_0x12ff60){_0x317e92=_0x317e92-0x0;var _0x12a430=_0xdcf7[_0x317e92];return _0x12a430;};'use strict';function VtigerAccount(_0x5b0b40){this['id']=_0x5b0b40['id']||0x0;this[_0x7dcf('0x0')]=_0x5b0b40[_0x7dcf('0x0')]||'';this[_0x7dcf('0x1')]=_0x5b0b40[_0x7dcf('0x1')]||'';this[_0x7dcf('0x2')]=_0x5b0b40[_0x7dcf('0x2')]||'';this[_0x7dcf('0x3')]=_0x5b0b40[_0x7dcf('0x3')]||'';this[_0x7dcf('0x4')]=_0x5b0b40[_0x7dcf('0x4')]||'';this['Configurations']=_0x5b0b40['Configurations']||{};}module[_0x7dcf('0x5')]=VtigerAccount; \ No newline at end of file +var _0x95c0=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x44adb7,_0xcfb33){var _0x3d4a96=function(_0xa5377b){while(--_0xa5377b){_0x44adb7['push'](_0x44adb7['shift']());}};_0x3d4a96(++_0xcfb33);}(_0x95c0,0x6e));var _0x095c=function(_0x3c8826,_0x1b80a5){_0x3c8826=_0x3c8826-0x0;var _0x5dfac9=_0x95c0[_0x3c8826];return _0x5dfac9;};'use strict';function VtigerAccount(_0x4be2ea){this['id']=_0x4be2ea['id']||0x0;this[_0x095c('0x0')]=_0x4be2ea[_0x095c('0x0')]||'';this[_0x095c('0x1')]=_0x4be2ea[_0x095c('0x1')]||'';this['accessKey']=_0x4be2ea['accessKey']||'';this[_0x095c('0x2')]=_0x4be2ea[_0x095c('0x2')]||'';this[_0x095c('0x3')]=_0x4be2ea['serverUrl']||'';this[_0x095c('0x4')]=_0x4be2ea['Configurations']||{};}module[_0x095c('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 70de75a..c6a1de9 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 _0x1e3c=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x411270,_0x3d85c8){var _0x1b148d=function(_0x4c1144){while(--_0x4c1144){_0x411270['push'](_0x411270['shift']());}};_0x1b148d(++_0x3d85c8);}(_0x1e3c,0xa2));var _0xc1e3=function(_0x457394,_0x5859fc){_0x457394=_0x457394-0x0;var _0x38951d=_0x1e3c[_0x457394];return _0x38951d;};'use strict';function ZendeskAccount(_0x421413){this['id']=_0x421413['id']||0x0;this[_0xc1e3('0x0')]=_0x421413[_0xc1e3('0x0')]||'';this['username']=_0x421413[_0xc1e3('0x1')]||'';this['password']=_0x421413[_0xc1e3('0x2')]||'';this[_0xc1e3('0x3')]=_0x421413[_0xc1e3('0x3')]||'';this[_0xc1e3('0x4')]=_0x421413['remoteUri']||'';this[_0xc1e3('0x5')]=_0x421413[_0xc1e3('0x5')]||'';this[_0xc1e3('0x6')]=_0x421413[_0xc1e3('0x6')]||_0xc1e3('0x7');this[_0xc1e3('0x8')]=_0x421413['serverUrl']||'';this[_0xc1e3('0x9')]=_0x421413['Configurations']||{};}module[_0xc1e3('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x7b5c=['name','username','password','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x3556a3,_0x42cc8e){var _0x938c13=function(_0xa49f1c){while(--_0xa49f1c){_0x3556a3['push'](_0x3556a3['shift']());}};_0x938c13(++_0x42cc8e);}(_0x7b5c,0xd8));var _0xc7b5=function(_0x3db23f,_0x4b30ad){_0x3db23f=_0x3db23f-0x0;var _0x5d2f55=_0x7b5c[_0x3db23f];return _0x5d2f55;};'use strict';function ZendeskAccount(_0x41fe6b){this['id']=_0x41fe6b['id']||0x0;this[_0xc7b5('0x0')]=_0x41fe6b['name']||'';this[_0xc7b5('0x1')]=_0x41fe6b['username']||'';this[_0xc7b5('0x2')]=_0x41fe6b[_0xc7b5('0x2')]||'';this['token']=_0x41fe6b['token']||'';this[_0xc7b5('0x3')]=_0x41fe6b[_0xc7b5('0x3')]||'';this[_0xc7b5('0x4')]=_0x41fe6b[_0xc7b5('0x4')]||'';this[_0xc7b5('0x5')]=_0x41fe6b['type']||_0xc7b5('0x6');this[_0xc7b5('0x7')]=_0x41fe6b[_0xc7b5('0x7')]||'';this[_0xc7b5('0x8')]=_0x41fe6b[_0xc7b5('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 60088b2..1681468 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 _0xcad4=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x21ead4,_0x3948b3){var _0x46055a=function(_0x1635d9){while(--_0x1635d9){_0x21ead4['push'](_0x21ead4['shift']());}};_0x46055a(++_0x3948b3);}(_0xcad4,0x159));var _0x4cad=function(_0x39326c,_0x26e7c8){_0x39326c=_0x39326c-0x0;var _0x332996=_0xcad4[_0x39326c];return _0x332996;};'use strict';function ZohoAccount(_0x570f97){this['id']=_0x570f97['id']||0x0;this[_0x4cad('0x0')]=_0x570f97[_0x4cad('0x0')]||'';this[_0x4cad('0x1')]=_0x570f97['description']||'';this[_0x4cad('0x2')]=_0x570f97[_0x4cad('0x2')]||'';this[_0x4cad('0x3')]=_0x570f97['zone']||'';this[_0x4cad('0x4')]=_0x570f97['clientId']||'';this[_0x4cad('0x5')]=_0x570f97['clientSecret']||'';this['serverUrl']=_0x570f97[_0x4cad('0x6')]||'';this[_0x4cad('0x7')]=_0x570f97[_0x4cad('0x7')]||'';this[_0x4cad('0x8')]=_0x570f97['refreshToken']||'';this[_0x4cad('0x9')]=_0x570f97['Configurations']||{};}module[_0x4cad('0xa')]=ZohoAccount; \ No newline at end of file +var _0xe1cd=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x56fea6,_0x4d720d){var _0x375790=function(_0x25edb1){while(--_0x25edb1){_0x56fea6['push'](_0x56fea6['shift']());}};_0x375790(++_0x4d720d);}(_0xe1cd,0xfe));var _0xde1c=function(_0x1042f4,_0x3abac8){_0x1042f4=_0x1042f4-0x0;var _0x35c082=_0xe1cd[_0x1042f4];return _0x35c082;};'use strict';function ZohoAccount(_0x4a3f09){this['id']=_0x4a3f09['id']||0x0;this[_0xde1c('0x0')]=_0x4a3f09[_0xde1c('0x0')]||'';this[_0xde1c('0x1')]=_0x4a3f09[_0xde1c('0x1')]||'';this[_0xde1c('0x2')]=_0x4a3f09[_0xde1c('0x2')]||'';this[_0xde1c('0x3')]=_0x4a3f09[_0xde1c('0x3')]||'';this[_0xde1c('0x4')]=_0x4a3f09[_0xde1c('0x4')]||'';this[_0xde1c('0x5')]=_0x4a3f09['clientSecret']||'';this[_0xde1c('0x6')]=_0x4a3f09['serverUrl']||'';this[_0xde1c('0x7')]=_0x4a3f09[_0xde1c('0x7')]||'';this[_0xde1c('0x8')]=_0x4a3f09['refreshToken']||'';this['Configurations']=_0x4a3f09[_0xde1c('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index cbb46ba..a1e4195 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 _0x5eb8=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x4c2d63,_0x18ac47){var _0x1ecdcf=function(_0x50103a){while(--_0x50103a){_0x4c2d63['push'](_0x4c2d63['shift']());}};_0x1ecdcf(++_0x18ac47);}(_0x5eb8,0xb0));var _0x85eb=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x5eb8[_0x11a220];return _0x20d8fe;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x85eb('0x0'));function checkNameSurname(_0x2598be,_0x393a8a,_0xd2f5dc){var _0x7e3c0='';if(!_[_0x85eb('0x1')](_0x393a8a)&&_0x85eb('0x2')===typeof _0x393a8a){_0x7e3c0+=_0x393a8a;}if(!_[_0x85eb('0x1')](_0xd2f5dc)&&_0x85eb('0x2')===typeof _0xd2f5dc){_0x7e3c0+='\x20'+_0xd2f5dc;}if(_0x7e3c0!==''){return _0x7e3c0;}return _0x2598be;}function Action(_0x1fde1a,_0x2bf83c,_0x1ba1d8,_0x4a8814,_0x16d7b9){this[_0x85eb('0x3')]=_0x1ba1d8||undefined;this[_0x85eb('0x4')]=_0x1fde1a['id'];this['queue']=_0x2bf83c[_0x85eb('0x5')];this['type']=_0x2bf83c[_0x85eb('0x6')];this[_0x85eb('0x7')]=_0x85eb('0x8');this[_0x85eb('0x9')]=![];this[_0x85eb('0xa')]=_[_0x85eb('0x1')](_0x1fde1a[_0x85eb('0xb')])?undefined:_0x1fde1a['Agent'][_0x85eb('0x5')];this[_0x85eb('0xc')]=this['membername']?util[_0x85eb('0xd')](_0x85eb('0xe'),this[_0x85eb('0xa')]):_0x4a8814||undefined;this[_0x85eb('0xf')]=checkNameSurname(_0x1fde1a['Contact']['phone'],_0x1fde1a[_0x85eb('0x10')]['firstName'],_0x1fde1a[_0x85eb('0x10')][_0x85eb('0x11')]);this[_0x85eb('0x12')]=_0x1fde1a[_0x85eb('0x12')]||![];this[_0x85eb('0x13')]=_0x1fde1a['phone'];this[_0x85eb('0x14')]=_0x1fde1a['scheduledat'];this[_0x85eb('0x15')]=_0x1fde1a[_0x85eb('0x15')]||0x0;this[_0x85eb('0x16')]=_0x1fde1a[_0x85eb('0x16')]||0x0;this['countnoanswerretry']=_0x1fde1a['countnoanswerretry']||0x0;this['countglobal']=(_0x1fde1a[_0x85eb('0x15')]||0x0)+(_0x1fde1a[_0x85eb('0x16')]||0x0)+(_0x1fde1a[_0x85eb('0x17')]||0x0)+(_0x1fde1a[_0x85eb('0x18')]||0x0)+(_0x1fde1a[_0x85eb('0x19')]||0x0)+(_0x1fde1a[_0x85eb('0x1a')]||0x0)+(_0x1fde1a['countmachineretry']||0x0)+(_0x1fde1a[_0x85eb('0x1b')]||0x0);this[_0x85eb('0x18')]=_0x1fde1a[_0x85eb('0x18')]||0x0;this['countdropretry']=_0x1fde1a['countdropretry']||0x0;this['countabandonedretry']=_0x1fde1a['countabandonedretry']||0x0;this[_0x85eb('0x1c')]=_0x1fde1a[_0x85eb('0x1c')]||0x0;this[_0x85eb('0x1b')]=_0x1fde1a[_0x85eb('0x1b')]||0x0;this[_0x85eb('0x1d')]=_0x1fde1a[_0x85eb('0x1d')];this['callbackuniqueid']=_0x1fde1a['callbackuniqueid'];this['callbackat']=_0x1fde1a[_0x85eb('0x1e')];this[_0x85eb('0x1f')]=_0x1fde1a[_0x85eb('0x1f')];this[_0x85eb('0x20')]=_0x1fde1a[_0x85eb('0x20')];this[_0x85eb('0x21')]=_0x1fde1a['ListId'];this[_0x85eb('0x22')]=_[_0x85eb('0x1')](_0x1fde1a[_0x85eb('0xb')])?_0x1fde1a[_0x85eb('0x22')]:_0x1fde1a[_0x85eb('0xb')]['id'];this['VoiceQueueId']=_0x1fde1a[_0x85eb('0x23')];this[_0x85eb('0x24')]='';this[_0x85eb('0x25')]='';}Action[_0x85eb('0x26')][_0x85eb('0x27')]=function(){return util[_0x85eb('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x85eb('0x28')]);};module['exports']=Action; \ No newline at end of file +var _0x7708=['uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil'];(function(_0x3dd9b5,_0x5134dd){var _0x39aa55=function(_0x57f602){while(--_0x57f602){_0x3dd9b5['push'](_0x3dd9b5['shift']());}};_0x39aa55(++_0x5134dd);}(_0x7708,0x188));var _0x8770=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0x7708[_0x318410];return _0x2898a3;};'use strict';var util=require(_0x8770('0x0'));var _=require(_0x8770('0x1'));var moment=require('moment');function checkNameSurname(_0x141ddf,_0x5a8b5b,_0x5ca46f){var _0x555477='';if(!_['isNil'](_0x5a8b5b)&&_0x8770('0x2')===typeof _0x5a8b5b){_0x555477+=_0x5a8b5b;}if(!_[_0x8770('0x3')](_0x5ca46f)&&'string'===typeof _0x5ca46f){_0x555477+='\x20'+_0x5ca46f;}if(_0x555477!==''){return _0x555477;}return _0x141ddf;}function Action(_0x40d401,_0x50bab7,_0x31390d,_0x42d305,_0x2b0295){this[_0x8770('0x4')]=_0x31390d||undefined;this[_0x8770('0x5')]=_0x40d401['id'];this[_0x8770('0x6')]=_0x50bab7[_0x8770('0x7')];this['type']=_0x50bab7[_0x8770('0x8')];this[_0x8770('0x9')]=_0x8770('0x6');this['dialAnswer']=![];this[_0x8770('0xa')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?undefined:_0x40d401[_0x8770('0xb')]['name'];this[_0x8770('0xc')]=this[_0x8770('0xa')]?util[_0x8770('0xd')]('SIP/%s',this[_0x8770('0xa')]):_0x42d305||undefined;this[_0x8770('0xe')]=checkNameSurname(_0x40d401[_0x8770('0xf')][_0x8770('0x10')],_0x40d401[_0x8770('0xf')][_0x8770('0x11')],_0x40d401[_0x8770('0xf')][_0x8770('0x12')]);this['active']=_0x40d401[_0x8770('0x13')]||![];this[_0x8770('0x14')]=_0x40d401['phone'];this[_0x8770('0x15')]=_0x40d401['scheduledat'];this[_0x8770('0x16')]=_0x40d401['countbusyretry']||0x0;this['countcongestionretry']=_0x40d401['countcongestionretry']||0x0;this[_0x8770('0x17')]=_0x40d401[_0x8770('0x17')]||0x0;this[_0x8770('0x18')]=(_0x40d401[_0x8770('0x16')]||0x0)+(_0x40d401['countcongestionretry']||0x0)+(_0x40d401['countnoanswerretry']||0x0)+(_0x40d401[_0x8770('0x19')]||0x0)+(_0x40d401[_0x8770('0x1a')]||0x0)+(_0x40d401[_0x8770('0x1b')]||0x0)+(_0x40d401[_0x8770('0x1c')]||0x0)+(_0x40d401[_0x8770('0x1d')]||0x0);this['countnosuchnumberretry']=_0x40d401[_0x8770('0x19')]||0x0;this[_0x8770('0x1a')]=_0x40d401[_0x8770('0x1a')]||0x0;this[_0x8770('0x1b')]=_0x40d401['countabandonedretry']||0x0;this['countmachineretry']=_0x40d401[_0x8770('0x1c')]||0x0;this[_0x8770('0x1d')]=_0x40d401[_0x8770('0x1d')]||0x0;this[_0x8770('0x1e')]=_0x40d401[_0x8770('0x1e')];this[_0x8770('0x1f')]=_0x40d401['callbackuniqueid'];this[_0x8770('0x20')]=_0x40d401[_0x8770('0x20')];this[_0x8770('0x21')]=_0x40d401[_0x8770('0x21')];this['ContactId']=_0x40d401[_0x8770('0x22')];this['ListId']=_0x40d401[_0x8770('0x23')];this[_0x8770('0x24')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?_0x40d401[_0x8770('0x24')]:_0x40d401[_0x8770('0xb')]['id'];this[_0x8770('0x25')]=_0x40d401[_0x8770('0x25')];this[_0x8770('0x26')]='';this[_0x8770('0x27')]='';}Action['prototype'][_0x8770('0x28')]=function(){return util[_0x8770('0xd')](_0x8770('0x29'),this[_0x8770('0xe')],this[_0x8770('0x2a')]);};module[_0x8770('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c924a23..e8bbe47 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 _0xa41a=['logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','checkInBlack','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logger','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','pick','unlock','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','dialActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','Action','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','lookAgent','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','CAMPAIGN_STATUS','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','message','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','VoiceQueueId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','INACTIVE','Trunk','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','countbusyretry','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','isUndefined','object','reason'];(function(_0x409ab9,_0x31a510){var _0x509fd2=function(_0x57384a){while(--_0x57384a){_0x409ab9['push'](_0x409ab9['shift']());}};_0x509fd2(++_0x31a510);}(_0xa41a,0x6b));var _0xaa41=function(_0x405944,_0x2271a7){_0x405944=_0x405944-0x0;var _0x3606b0=_0xa41a[_0x405944];return _0x3606b0;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var uuid=require('uuid');var moment=require(_0xaa41('0x2'));var Redis=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var logger=require(_0xaa41('0x5'))(_0xaa41('0x6'));var loggerAction=require(_0xaa41('0x5'))(_0xaa41('0x7'));var ami=require(_0xaa41('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xaa41('0x9'));var Action=require(_0xaa41('0xa'));var ut=require('./util/util');var utils=require('../dialer/utils');config[_0xaa41('0xb')]=_[_0xaa41('0xc')](config['redis'],{'host':_0xaa41('0xd'),'port':0x18eb});var io=require(_0xaa41('0xe'))(new Redis(config[_0xaa41('0xb')]));var Sequence=function(){};Sequence[_0xaa41('0xf')][_0xaa41('0x10')]=function(_0x38d930){this[_0xaa41('0x11')]=this[_0xaa41('0x11')]?this[_0xaa41('0x11')]['finally'](_0x38d930):_0x38d930();};function Preview(_0x1d3aac){this[_0xaa41('0x12')]=new Sequence();this['campaignsPreview']=_0x1d3aac['voiceQueues'];this[_0xaa41('0x13')]=_0x1d3aac['trunks'];this[_0xaa41('0x14')]={};this[_0xaa41('0x15')]=_0x1d3aac[_0xaa41('0x15')];this[_0xaa41('0x16')]=0x0;ami['on'](_0xaa41('0x17'),this['syncOriginateResponse'][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x19'),this[_0xaa41('0x1a')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1b'),this[_0xaa41('0x1c')][_0xaa41('0x18')](this));ami['on']('dialend',this[_0xaa41('0x1d')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x1e'),this[_0xaa41('0x1f')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x20'),this[_0xaa41('0x21')][_0xaa41('0x18')](this));ami['on'](_0xaa41('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xaa41('0x23'),this[_0xaa41('0x24')][_0xaa41('0x18')](this));this['loopCampaigns'](this[_0xaa41('0x25')]);}function emit(_0x1f692b,_0x4e768e,_0x513c61){io['to'](_0x1f692b)[_0xaa41('0x26')](_0x4e768e,_0x513c61);}function emitVoiceQueueChannelRemove(_0x5d4374){logger[_0xaa41('0x27')](_0xaa41('0x28'),JSON[_0xaa41('0x29')](_0x5d4374));emit(util[_0xaa41('0x2a')](_0xaa41('0x2b'),_0x5d4374['name']),_0xaa41('0x2c'),_0x5d4374);io[_0xaa41('0x26')](_0xaa41('0x2d'),_0x5d4374);}function notSendMessagesQueue(_0x21f596){if(_0x21f596[_0xaa41('0x2e')]){if(_0x21f596[_0xaa41('0x2f')]===0x0&&_0x21f596['pTalking']===0x0){_0x21f596['sendMessageOneNotActive']=![];_0x21f596[_0xaa41('0x30')]=0x0;_0x21f596['paused']=0x0;_0x21f596['message']=utils[_0xaa41('0x31')]['INACTIVE'];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x34'));}else{_0x21f596[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x36')];ut['logger'](_0xaa41('0x32'),_0x21f596[_0xaa41('0x33')]+_0xaa41('0x37'));}}}Preview[_0xaa41('0xf')][_0xaa41('0x38')]=function(){var _0x4466a3=this;setInterval(function(){_0x4466a3[_0xaa41('0x39')]();},0x7cf);};Preview[_0xaa41('0xf')]['syncCampaigns']=function(){var _0x377add=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x714537 in _0x377add){if(_0x377add[_0xaa41('0x3a')](_0x714537)&&(_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')||_0x377add[_0x714537][_0xaa41('0x3b')]==='booked')&&_0x377add[_0x714537]['type']==='outbound'){if(this[_0xaa41('0x16')]>0x7){this[_0xaa41('0x16')]=0x0;this[_0xaa41('0x3c')]();}}if(_0x377add[_0xaa41('0x3a')](_0x714537)&&_0x377add[_0x714537]['dialMethod']===_0xaa41('0x6')&&_0x377add[_0x714537][_0xaa41('0x3d')]===_0xaa41('0x3e')){if(_0x377add[_0x714537]['dialActive']){this[_0xaa41('0x3f')](_0x377add[_0x714537]);if(_0x377add[_0x714537][_0xaa41('0x40')])this[_0xaa41('0x41')](_0x377add[_0x714537]);}else{notSendMessagesQueue(_0x377add[_0x714537]);}}}};Preview['prototype'][_0xaa41('0x42')]=function(_0x374117){var _0x57fe1d=this;this[_0xaa41('0x12')][_0xaa41('0x10')](function(){if(!_[_0xaa41('0x43')](_0x57fe1d['actions'][_0x374117])){loggerAction[_0xaa41('0x27')]('[clearZombieChannels][talking]',_0x374117,_0xaa41('0x44'),_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')],'originated:\x20',JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x2f')]),_0xaa41('0x46'),JSON['stringify'](_0x57fe1d['campaignsPreview'][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]][_0xaa41('0x47')]),JSON[_0xaa41('0x29')](_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x48')]),JSON[_0xaa41('0x29')](_['pick'](_0x57fe1d[_0xaa41('0x14')][_0x374117],[_0xaa41('0x49'),_0xaa41('0x4a'),_0xaa41('0x4b'),'ListId'])));return ami['Action']({'action':_0xaa41('0x4c'),'channel':_0x57fe1d[_0xaa41('0x14')][_0x374117]['channel']})[_0xaa41('0x4d')](function(_0x563687){if(_0x563687[_0xaa41('0x35')]===_0xaa41('0x4e')){setTimeout(function(){if(_0x57fe1d[_0xaa41('0x14')][_0x374117]){ut[_0xaa41('0x4f')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));if(_0x57fe1d['actions'][_0x374117][_0xaa41('0x48')]===!![]){ut[_0xaa41('0x51')](_0x57fe1d[_0xaa41('0x25')][_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]],_0xaa41('0x50'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117]['queue']);}ut[_0xaa41('0x52')](_0xaa41('0x53')+_0x374117,_0x57fe1d[_0xaa41('0x14')][_0x374117][_0xaa41('0x45')]);delete _0x57fe1d[_0xaa41('0x14')][_0x374117];}},0x2328);}});}});};Preview[_0xaa41('0xf')][_0xaa41('0x3c')]=function(){var _0x5ee74c=this;loggerAction[_0xaa41('0x27')]('[action]',_['size'](this[_0xaa41('0x14')]));for(var _0x5ee127 in this['actions']){if(_0x5ee74c['actions'][_0xaa41('0x3a')](_0x5ee127)){_0x5ee74c['clearZombieChannel'](_0x5ee127);}}};Preview[_0xaa41('0xf')][_0xaa41('0x41')]=function(_0x4a6882){var _0x576f81=this;rpcDb[_0xaa41('0x54')](_0x4a6882['id'],ut[_0xaa41('0x55')](this[_0xaa41('0x15')]))[_0xaa41('0x56')](function(_0x3fe1a9){if(!_[_0xaa41('0x43')](_0x3fe1a9)){for(var _0x258096=0x0;_0x258096<_0x3fe1a9[_0xaa41('0x57')];_0x258096+=0x1){if(ut[_0xaa41('0x58')](_0x3fe1a9[_0x258096]['scheduledat'])<_0x4a6882[_0xaa41('0x59')]*0x3c){if(_0x3fe1a9[_0x258096][_0xaa41('0x5a')]&&!_0x3fe1a9[_0x258096][_0xaa41('0x5a')][_0xaa41('0x5b')]){_0x576f81[_0xaa41('0x5c')](_0x3fe1a9[_0x258096]['id'])[_0xaa41('0x56')](ut['logger2'](_0xaa41('0x5d')))[_0xaa41('0x4d')](ut[_0xaa41('0x5e')](_0xaa41('0x5d')));}else{rpcDb['disableContact'](_0x3fe1a9[_0x258096]['id']);}}else{var _0x23bc61=new Action(_0x3fe1a9[_0x258096],_0x4a6882);_0x23bc61['starttime']=moment()['format'](_0xaa41('0x5f'));_0x4a6882[_0xaa41('0x60')]+=0x1;ut[_0xaa41('0x61')](_0x23bc61,0x17,'RecallInQueue');if(_0x4a6882[_0xaa41('0x62')]){rpcDb[_0xaa41('0x63')](ut[_0xaa41('0x64')](_0x3fe1a9[_0x258096]));rpcDb['createCustomerHistory'](_0x23bc61,_0xaa41('0x65'));}else{ut[_0xaa41('0x61')](_0x23bc61,0x16,_0xaa41('0x66'));rpcDb[_0xaa41('0x67')](_0x23bc61,_0xaa41('0x68'));rpcDb[_0xaa41('0x69')](_0x23bc61,_0xaa41('0x68'));}}}}})[_0xaa41('0x4d')](ut['logger2'](_0xaa41('0x6a')));};Preview['prototype']['setMessage']=function(_0x1bdcd6){_0x1bdcd6[_0xaa41('0x2e')]=!![];if(ut[_0xaa41('0x6b')](_0x1bdcd6[_0xaa41('0x6c')])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6d')];}else if(!ut[_0xaa41('0x6e')](_0x1bdcd6['dialActive'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x6f')];}else if(!this['isTrunkReachable'](_0x1bdcd6[_0xaa41('0x70')])){if(!this[_0xaa41('0x71')](_0x1bdcd6['TrunkBackup'])){_0x1bdcd6[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x72')];}else{_0x1bdcd6['message']=utils[_0xaa41('0x31')][_0xaa41('0x73')];}}else{_0x1bdcd6['message']=utils['CAMPAIGN_STATUS'][_0xaa41('0x73')];}};Preview[_0xaa41('0xf')][_0xaa41('0x74')]=function(_0x4d20c6,_0x5a76b9,_0x137f3f){var _0x1746b4=this;var _0x32f2b4=this[_0xaa41('0x14')][_0x5a76b9];var _0x5ccdc5=this[_0xaa41('0x25')][_0x32f2b4['queue']];var _0x555186;var _0x3ba305=![];var _0x52ae7f=0x2;var _0x3621c0=0x3;if(_0x5ccdc5){switch(_0x137f3f){case'1':_0x5ccdc5[_0xaa41('0x75')]+=0x1;_0x32f2b4[_0xaa41('0x76')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x0,_0xaa41('0x78'));ami[_0xaa41('0x26')](_0xaa41('0x79'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0x7b')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0x7c'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'0',_0x5ccdc5)[_0xaa41('0x56')](function(_0x40cdfc){_0x3ba305=_0x40cdfc[_0xaa41('0x7d')]==0x1;_0x52ae7f=_0x5ccdc5['dialNoSuchNumberRetryFrequency'];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0x82'));}else{if(_0x32f2b4['countnosuchnumberretry']>=_0x5ccdc5['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x32f2b4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x32f2b4,_0xaa41('0x76'),_0x5ccdc5['dialNoSuchNumberRetryFrequency']),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x32f2b4[_0xaa41('0x76')]++;logger['info'](_0xaa41('0x85'),_0x32f2b4[_0xaa41('0x76')]);logger[_0xaa41('0x27')]('id',_0x32f2b4[_0xaa41('0x86')]);_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnosuchnumberretry':_0x32f2b4[_0xaa41('0x76')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});break;case _0xaa41('0x89'):var _0x2d2af8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32f2b4['responsetime']=_0x2d2af8;_0x32f2b4[_0xaa41('0x8a')]=_0x2d2af8;_0x32f2b4['dialAnswer']=!![];_0x5ccdc5[_0xaa41('0x47')]+=0x1;logger['info'](_0xaa41('0x8b'),_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);ami[_0xaa41('0x26')]('custom:agentconnect',ut['buildObj'](_0x32f2b4,_0xaa41('0x8d'),this[_0xaa41('0x25')][_0x32f2b4['queue']]));if(_0x5ccdc5['acw']){ami[_0xaa41('0x26')](_0xaa41('0x8e'),ut[_0xaa41('0x8f')](_0x32f2b4));}break;case'16':ami[_0xaa41('0x26')](_0xaa41('0x90'),ut['buildObj'](_0x32f2b4,_0xaa41('0x91'),this['campaignsPreview'][_0x32f2b4['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x32f2b4,_0xaa41('0x91')));_0x5ccdc5[_0xaa41('0x92')]+=0x1;_0x5ccdc5[_0xaa41('0x93')]+=0x1;_0x5ccdc5['answered']+=0x1;ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0x94'));_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x4,_0xaa41('0x96'));rpcDb[_0xaa41('0x67')](_0x32f2b4,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0x97'));rpcDb[_0xaa41('0x98')](_0x32f2b4);_0x5ccdc5[_0xaa41('0x99')]+=_0x32f2b4['talktime'];_0x5ccdc5[_0xaa41('0x9a')]+=_0x32f2b4['talktime'];logger[_0xaa41('0x27')](_0xaa41('0x9b'),_0x32f2b4[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x5ccdc5['name'],_0xaa41('0x46'),_0x5ccdc5[_0xaa41('0x47')]);delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];break;case'BUSY':_0x5ccdc5[_0xaa41('0x9d')]+=0x1;_0x32f2b4['countbusyretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x5,_0xaa41('0x9e'));_0x52ae7f=_0x5ccdc5[_0xaa41('0x9f')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xa0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xa1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xa2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'5',_0x5ccdc5)[_0xaa41('0x56')](function(_0x59a30b){_0x3ba305=_0x59a30b[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xa4'));}else{if(_0x32f2b4['countbusyretry']>=_0x5ccdc5[_0xaa41('0xa5')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xa8'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4[_0xaa41('0xa8')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countbusyretry':_0x32f2b4['countbusyretry']}})[_0xaa41('0x56')](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xaa'):_0x5ccdc5[_0xaa41('0xab')]+=0x1;_0x32f2b4['countnoanswerretry']+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x3,'NoAnswer');_0x52ae7f=_0x5ccdc5[_0xaa41('0xac')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];var _0x5bd574=ut[_0xaa41('0xad')](_0x32f2b4,_0x5ccdc5);ami['emit']('custom:agentnoanswer',_0x5bd574);rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xae'));_0x1746b4['verifyAdditionalPhones'](_0x32f2b4,'3',_0x5ccdc5)['then'](function(_0x241e1a){_0x3ba305=_0x241e1a[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut['cloneAction'](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xaf'));}else{if(_0x32f2b4['countnoanswerretry']>=_0x5ccdc5[_0xaa41('0xb0')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xae'));}else{rpcDb['rescheduleContact'](ut[_0xaa41('0xa7')](_0x32f2b4,'countnoanswerretry',_0x5ccdc5['dialNoAnswerRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})['then'](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xb2'):_0x5ccdc5[_0xaa41('0xb3')]+=0x1;_0x32f2b4[_0xaa41('0xb4')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0x8,_0xaa41('0xb5'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xb6')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xb7'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xb8')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xb9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'8',_0x5ccdc5)[_0xaa41('0x56')](function(_0x58ad21){_0x3ba305=_0x58ad21[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,'Global');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xba'));}else{if(_0x32f2b4[_0xaa41('0xb4')]>=_0x5ccdc5[_0xaa41('0xbb')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xb9'));}else{rpcDb[_0xaa41('0xa6')](ut['scheduledAt'](_0x32f2b4,_0xaa41('0xb4'),_0x5ccdc5[_0xaa41('0x9f')]),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countcongestionretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4['idContact'],'field':{'countcongestionretry':_0x32f2b4[_0xaa41('0xb4')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xbc'):_0x5ccdc5['outboundRejectCallsDay']+=0x1;_0x32f2b4[_0xaa41('0xbd')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x14,_0xaa41('0xbe'));_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];ami[_0xaa41('0x26')](_0xaa41('0xc0'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xc1')));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x78265){_0x3ba305=_0x78265[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut['cloneAction'](_0x32f2b4,0x14,'AgentReject');rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc3'));}else{if(_0x32f2b4['countagentrejectretry']>=_0x5ccdc5[_0xaa41('0xc4')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,_0xaa41('0xbd'),_0x5ccdc5[_0xaa41('0xbf')]),_0x32f2b4['unlockAgent'],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case _0xaa41('0xc5'):_0x5ccdc5[_0xaa41('0xc6')]+=0x1;_0x32f2b4[_0xaa41('0xc7')]+=0x1;_0x32f2b4['countglobal']=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0xb,_0xaa41('0xc8'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xc9'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'11',_0x5ccdc5)[_0xaa41('0x56')](function(_0x408d95){_0x3ba305=_0x408d95[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xc9'));}else{if(_0x32f2b4['countabandonedetry']>=_0x5ccdc5[_0xaa41('0xca')]){rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xc9'));}else{rpcDb[_0xaa41('0xa6')](ut[_0xaa41('0xa7')](_0x32f2b4,'countabandonedretry',_0x5ccdc5['dialAbandonedRetryFrequency']),_0x32f2b4[_0xaa41('0xa9')],_0x32f2b4[_0xaa41('0x83')]);}}}else{_0x32f2b4['countnoanswerretry']++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})['then'](function(){_0x1746b4['swapAdditionalPhones'](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});break;case'18':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0xcc')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x12,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,'amd'));rpcDb['createCustomerHistory'](_0x32f2b4,_0xaa41('0xd0'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)['then'](function(_0x30e8cb){_0x3ba305=_0x30e8cb['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0x12,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd0'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd0'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4['incrementPreviewCounters']({'id':_0x32f2b4['idContact'],'field':{'countnoanswerretry':_0x32f2b4['countnoanswerretry']}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)['then'](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;case'19':_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4['countglobal']=ut['totalGlobal'](_0x32f2b4);ut[_0xaa41('0x61')](_0x32f2b4,0x13,_0x4d20c6['cause-txt']||_0x4d20c6[_0xaa41('0xce')]);ami[_0xaa41('0x26')](_0xaa41('0xcf'),ut[_0xaa41('0x7a')](_0x32f2b4,_0xaa41('0xd1')));rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd2'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'18',_0x5ccdc5)[_0xaa41('0x56')](function(_0x573889){_0x3ba305=_0x573889['additional']==0x1;if(!_0x3ba305){if(ut[_0xaa41('0x77')](_0x32f2b4)>=_0x5ccdc5[_0xaa41('0x7f')]){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd2'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd2'));}}else{_0x32f2b4[_0xaa41('0xb1')]++;_0x1746b4[_0xaa41('0x87')]({'id':_0x32f2b4[_0xaa41('0x86')],'field':{'countnoanswerretry':_0x32f2b4[_0xaa41('0xb1')]}})[_0xaa41('0x56')](function(){_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});});}});delete this['actions'][_0x4d20c6[_0xaa41('0x84')]];break;default:if(_0x32f2b4['dialAnswer']){ut[_0xaa41('0x51')](_0x5ccdc5,_0xaa41('0xd3'));ut[_0xaa41('0x52')](_0xaa41('0xd4')+_0x5ccdc5[_0xaa41('0x33')],_0x4d20c6);}_0x5ccdc5[_0xaa41('0xcb')]+=0x1;_0x32f2b4[_0xaa41('0x95')]=ut[_0xaa41('0x77')](_0x32f2b4);ut['logCustomer'](_0x32f2b4,0xc,_0x4d20c6[_0xaa41('0xcd')]||_0x4d20c6[_0xaa41('0xce')]);_0x52ae7f=_0x5ccdc5[_0xaa41('0xbf')];_0x3621c0=_0x5ccdc5[_0xaa41('0x7e')];rpcDb[_0xaa41('0x67')](_0x32f2b4,_0xaa41('0xd5'));_0x1746b4[_0xaa41('0xa3')](_0x32f2b4,'20',_0x5ccdc5)[_0xaa41('0x56')](function(_0x1b5933){_0x3ba305=_0x1b5933[_0xaa41('0x7d')]==0x1;if(!_0x3ba305){if(ut['totalGlobal'](_0x32f2b4)>=_0x5ccdc5['dialGlobalMaxRetry']){_0x555186=ut[_0xaa41('0x80')](_0x32f2b4,0xf,_0xaa41('0x81'));rpcDb[_0xaa41('0x69')](_0x555186,_0xaa41('0xd6'));}else{rpcDb[_0xaa41('0x69')](_0x32f2b4,_0xaa41('0xd6'));}delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];}else{_0x1746b4[_0xaa41('0x88')](_0x32f2b4,_0x52ae7f,_0x3621c0)[_0xaa41('0x56')](function(){});}});}if(!(_0x32f2b4['dialAnswer']&&_0x137f3f==='16')){ut['updateOriginated'](_0x5ccdc5,_0xaa41('0xd7'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingCustomer]',_0x32f2b4[_0xaa41('0x8c')],'\x20Queue',_0x5ccdc5[_0xaa41('0x33')],_0xaa41('0xd8'),_0x5ccdc5['originated']);}if(_0x137f3f!=='ANSWER'){delete this[_0xaa41('0x14')][_0x4d20c6[_0xaa41('0x84')]];delete this[_0xaa41('0x14')][_0x4d20c6['destlinkedid']];}_0x5ccdc5['queueSummaryCountersUpdated']=!![];}};Preview[_0xaa41('0xf')]['callProgressDetectingAgent']=function(_0x94423a,_0x59d6cf,_0x37dc6f){if(_[_0xaa41('0xd9')](_0x59d6cf)&&_0xaa41('0xda')!==typeof _0x59d6cf){return;}if(_[_0xaa41('0xd9')](_0x37dc6f)&&_0xaa41('0xda')!==typeof _0x37dc6f){return;}switch(_0x37dc6f[_0xaa41('0xdb')]){case'0':ut[_0xaa41('0xdc')](_0x94423a,0x0,'NoSuchNumber');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xde'));break;case'3':ut['logAgent'](_0x94423a,0x3,_0xaa41('0xdf'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe0'));break;case'5':ut[_0xaa41('0xdc')](_0x94423a,0x5,'Busy');rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe1'));break;case'8':ut[_0xaa41('0xdc')](_0x94423a,0x8,_0xaa41('0xb5'));rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));break;case'22':ut[_0xaa41('0xdc')](_0x94423a,0x16,_0xaa41('0xe3'));rpcDb[_0xaa41('0xdd')](_0x94423a,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x94423a,0xc,_0x37dc6f[_0xaa41('0xdb')]);rpcDb[_0xaa41('0xdd')](_0x94423a,_0xaa41('0xe2'));}ut[_0xaa41('0x4f')](_0x59d6cf,_0xaa41('0xe4'));logger[_0xaa41('0x27')]('[originated][decrement][callProgressDetectingAgent]',_0x94423a[_0xaa41('0x8c')],_0xaa41('0x9c'),_0x59d6cf[_0xaa41('0x33')],_0xaa41('0xd8'),_0x59d6cf[_0xaa41('0x2f')]);delete this[_0xaa41('0x14')][_0x94423a['uniqueid']];};Preview[_0xaa41('0xf')][_0xaa41('0xa3')]=function(_0x13ddbe,_0x4cf0c5,_0x1ddfe5){return cmHopperAdditionalPhone[_0xaa41('0xa3')](_0x13ddbe,_0x4cf0c5,_0x1ddfe5)[_0xaa41('0x4d')](logger[_0xaa41('0x27')](_0xaa41('0xe5')));};Preview[_0xaa41('0xf')][_0xaa41('0x88')]=function(_0x943973,_0xe17579,_0x1a6de8){return cmHopperAdditionalPhone[_0xaa41('0x88')](_0x943973,_0xe17579,_0x1a6de8)[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xaa41('0x87')]=function(_0xb9d685){return Promise[_0xaa41('0xe6')]()[_0xaa41('0x56')](cmHopperAdditionalPhone[_0xaa41('0x87')](_0xb9d685))[_0xaa41('0x4d')](logger[_0xaa41('0x27')]('[incrementPreviewCounters]\x20'));};Preview[_0xaa41('0xf')][_0xaa41('0xe7')]=function(_0xa3687e,_0x7e0e69,_0x361819,_0x377e17,_0x1e879d){var _0x1a7527=this;return new Promise(function(_0x1aac0c,_0x1a5a7a){if(_[_0xaa41('0x43')](_0x7e0e69)||_[_0xaa41('0x43')](_0x7e0e69['Contact'])||_[_0xaa41('0x43')](_0x7e0e69[_0xaa41('0xe8')])||_['isNil'](_0x7e0e69[_0xaa41('0x4b')])){_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xe9'),_0x377e17,_0x1e879d));return;}var _0x400fb7=uuid['v4']();var _0x5c0c5c=_0x1a7527[_0xaa41('0x25')][_0x7e0e69[_0xaa41('0x44')][_0xaa41('0x33')]];var _0x3a223c=_0x361819?_0x1a7527[_0xaa41('0x15')][_0x361819]['id']:undefined;_0x1a7527['actions'][_0x400fb7]=new Action(_0x7e0e69,_0x5c0c5c,_0x400fb7,_0x361819,_0x3a223c);var _0xc59a12=_0x1a7527['actions'][_0x400fb7];_0xc59a12['unlockAgent']=_0x377e17;_0xc59a12[_0xaa41('0x83')]=_0x1e879d;_0xc59a12['lookAgent']=_0x361819;if(_['isEmpty'](_0xa3687e)){_0x1a7527[_0xaa41('0xea')](_0xc59a12,_0x5c0c5c,_0x7e0e69,_0x361819)[_0xaa41('0x56')](function(_0x5b241e){logger['info'](_0xaa41('0xeb'),_0xaa41('0xec')+_0xc59a12[_0xaa41('0x45')]+_0xaa41('0xed')+_0xc59a12[_0xaa41('0x86')],JSON[_0xaa41('0x29')](_0x5b241e));ami[_0xaa41('0x26')](_0xaa41('0xee'),ut['buildObj'](_0xc59a12,_0xaa41('0xef'),_0x1a7527[_0xaa41('0x25')][_0xc59a12[_0xaa41('0x45')]]));_0x1aac0c(ut[_0xaa41('0x35')](_0xaa41('0xf0')));})['catch'](function(_0x519843){ut[_0xaa41('0xf1')](_0xaa41('0xf2'),_0x519843);_0x1a5a7a(ut[_0xaa41('0x35')](_0xaa41('0xf3'),_0x377e17,_0x1e879d));});}else{_0x5c0c5c[_0xaa41('0xf4')]+=0x1;ut[_0xaa41('0xf5')](_0xc59a12);rpcDb['createHistory'](_0xc59a12,_0xaa41('0xf6'));delete _0x1a7527[_0xaa41('0x14')][_0x400fb7];_0x1a5a7a(ut['message'](_0xaa41('0xf7'),_0x377e17,_0x1e879d));}});};Preview[_0xaa41('0xf')][_0xaa41('0x71')]=function(_0x27149e){return!_[_0xaa41('0x43')](_0x27149e)&&!_[_0xaa41('0x43')](_0x27149e[_0xaa41('0x33')])&&!_['isNil'](_0x27149e[_0xaa41('0xf8')])&&_0x27149e[_0xaa41('0xf8')]&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])])&&!_['isNil'](this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')])&&(this['trunks'][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e['name'])]['status']===_0xaa41('0xfa')||this[_0xaa41('0x13')][util[_0xaa41('0x2a')](_0xaa41('0xf9'),_0x27149e[_0xaa41('0x33')])][_0xaa41('0x4c')]==='unmonitored');};Preview['prototype'][_0xaa41('0x5c')]=function(_0x2ff3fb,_0x566832){return this['execRun'](_0x2ff3fb,_0x566832)[_0xaa41('0x56')](function(_0x44dea3){return _[_0xaa41('0xfb')](_0x44dea3,['message']);})['catch'](function(_0x1d609e){if(_0x1d609e[_0xaa41('0xfc')]){rpcDb[_0xaa41('0xfd')](_0x2ff3fb);}if(_0x1d609e['active']){rpcDb[_0xaa41('0xfe')](_0x2ff3fb);}throw _[_0xaa41('0xfb')](_0x1d609e,['message']);});};Preview['prototype'][_0xaa41('0xff')]=function(_0x561447,_0x4679e5){var _0x3fb6f0=this;var _0xdf9297,_0x10252a;return rpcDb[_0xaa41('0x100')](_0x561447)[_0xaa41('0x56')](function(_0x2b083a){if(!_['isNil'](_0x2b083a[0x0])){_0x10252a=_0x2b083a[0x0][_0xaa41('0x101')]?![]:!![];_0xdf9297=_0x2b083a[0x0][_0xaa41('0x101')]?!![]:![];_0xdf9297=_0x4679e5?!![]:_0xdf9297;}var _0x5534ef=_0x3fb6f0[_0xaa41('0x102')](_0x2b083a);if(_0x5534ef[_0xaa41('0x103')]){rpcDb[_0xaa41('0x104')](_[_0xaa41('0xfb')](_0x2b083a[0x0],[_0xaa41('0x4b'),_0xaa41('0xe8')]))['then'](function(_0xa2d55d){_0x3fb6f0[_0xaa41('0xe7')](_0xa2d55d,_0x2b083a[0x0],_0x4679e5,_0x10252a,_0xdf9297)[_0xaa41('0x56')](function(_0x2fa831){return _0x2fa831;})[_0xaa41('0x4d')](function(_0xf8f3e1){throw _0xf8f3e1;});})[_0xaa41('0x4d')](function(_0x5083ff){ut[_0xaa41('0xf1')](_0xaa41('0x105'),_0x5083ff);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',_0x10252a,_0xdf9297);});}else{throw ut['message'](_0x5534ef['message'],_0x10252a,_0xdf9297);}})[_0xaa41('0x4d')](function(_0x1331f8){ut[_0xaa41('0xf1')](_0xaa41('0x106'),_0x1331f8);throw ut[_0xaa41('0x35')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xaa41('0xf')][_0xaa41('0x102')]=function(_0x1fe1e3){if(_[_0xaa41('0x43')](_0x1fe1e3)||_[_0xaa41('0x107')](_0x1fe1e3)||!_[_0xaa41('0x43')](_0x1fe1e3[0x0][_0xaa41('0x5a')])&&_['isNil'](_0x1fe1e3[0x0][_0xaa41('0x5a')][_0xaa41('0x33')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Empty\x20Contact]',_0x1fe1e3);return{'isValid':![],'message':_0xaa41('0x108')};}var _0x53a519=this['campaignsPreview'][_0x1fe1e3[0x0][_0xaa41('0x44')]['name']];_0x53a519[_0xaa41('0x35')]=utils[_0xaa41('0x31')][_0xaa41('0x73')];if(_[_0xaa41('0x43')](_0x53a519)){ut[_0xaa41('0xf1')](_0xaa41('0x109'),_0x53a519);return{'isValid':![],'message':_0xaa41('0x10a')};}if(!this['isTrunkReachable'](_0x53a519[_0xaa41('0x70')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0xaa41('0x10c')+_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10d'));if(!this[_0xaa41('0x71')](_0x53a519[_0xaa41('0x10e')])){ut[_0xaa41('0xf1')](_0xaa41('0x10b'),_0x53a519[_0xaa41('0x33')]+_0xaa41('0x10f'));return{'isValid':![],'message':_0xaa41('0x110')};}}if(!ut[_0xaa41('0x6e')](_0x53a519[_0xaa41('0x111')])){ut[_0xaa41('0xf1')]('[Preview][validateContact][Campaign\x20Active]',_0x53a519[_0xaa41('0x33')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x53a519['name']+_0xaa41('0x112')};}return{'isValid':!![],'message':_0xaa41('0x113')};};Preview['prototype'][_0xaa41('0xea')]=function(_0x356256,_0x1e86cc,_0x15bb60,_0x232732){var _0x34d857=this;return new Promise(function(_0x239f1b,_0x445925){var _0x1e8591=_0x356256[_0xaa41('0x8c')];var _0x347d0c=_0x34d857[_0xaa41('0x71')](_0x1e86cc[_0xaa41('0x70')])?util[_0xaa41('0x2a')](_0xaa41('0x114'),_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')],_['isNil'](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc[_0xaa41('0x115')][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60['phone'][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60['phone']):util[_0xaa41('0x2a')](_0xaa41('0x114'),_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x33')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x33')],_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x115')])?'':_0x1e86cc['dialPrefix'][_0xaa41('0x116')]()||'',_0x1e86cc[_0xaa41('0x117')]>0x0?_0x15bb60[_0xaa41('0xe8')][_0xaa41('0x118')](_0x1e86cc[_0xaa41('0x117')]):_0x15bb60[_0xaa41('0xe8')]);var _0x53dea3=_0x34d857[_0xaa41('0x71')](_0x1e86cc['Trunk'])?ut[_0xaa41('0x119')](_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut['getCallerIdRandom'](_0x1e86cc[_0xaa41('0x11d')],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc['dialOriginateCallerIdNumber']):ut[_0xaa41('0x119')](_[_0xaa41('0x43')](_0x1e86cc[_0xaa41('0x10e')])?_0x1e86cc[_0xaa41('0x70')][_0xaa41('0x11a')]:_0x1e86cc[_0xaa41('0x10e')][_0xaa41('0x11a')],_0x1e86cc[_0xaa41('0x11b')],_0x1e86cc[_0xaa41('0x11c')]>0x0?ut[_0xaa41('0x11e')](_0x1e86cc['dialOriginateCallerIdNumber'],_0x1e86cc[_0xaa41('0x11c')]):_0x1e86cc[_0xaa41('0x11d')]);if(_0x53dea3){_0x356256[_0xaa41('0x11f')]=ut['extractCalleridName'](_0x53dea3);_0x356256['originatecalleridnum']=ut[_0xaa41('0x120')](_0x53dea3);}var _0x5aee9b=ut['addVariables'](_0x1e86cc,_0x15bb60,_0x347d0c,_0x53dea3,_0x1e8591,_0x356256);_[_0xaa41('0x121')](_0x356256,ut[_0xaa41('0x122')](_0x5aee9b));_0x356256[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e86cc['variables']=_0x5aee9b;var _0xa63e60=ut[_0xaa41('0x124')](_0x356256,_0x1e86cc,_0x5aee9b,_0x356256[_0xaa41('0x83')],_0x232732);return ami[_0xaa41('0x125')](_0xa63e60)[_0xaa41('0x56')](function(_0x5e3bb2){_0x1e86cc[_0xaa41('0x2f')]+=0x1;logger[_0xaa41('0x27')]('[originated][increment]',_0x1e8591,_0xaa41('0x9c'),_0x1e86cc[_0xaa41('0x33')],'originated:\x20',_0x1e86cc[_0xaa41('0x2f')]);_0x239f1b(_0x5e3bb2);})[_0xaa41('0x4d')](function(_0x58a5e5){ut[_0xaa41('0xdc')](_0x356256,0xe,_0xaa41('0x126'));rpcDb['createAgentHistory'](_0x356256,_0xaa41('0x127'));_0x445925(_0x58a5e5);});});};Preview['prototype']['syncNewExten']=function(_0x1ffee2){if(this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]){this[_0xaa41('0x14')][_0x1ffee2[_0xaa41('0x84')]]['channel']=_0x1ffee2[_0xaa41('0x128')];}};Preview['prototype']['syncOriginateResponse']=function(_0x25548d){var _0x28685a=this;var _0x2f62f6=this[_0xaa41('0x14')][_0x25548d[_0xaa41('0x129')]];if(_0x2f62f6){if(_0x2f62f6[_0xaa41('0x12a')]&&this[_0xaa41('0x15')][_0x2f62f6['lookAgent']]){ut[_0xaa41('0x12b')](_0x2f62f6,this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]][_0xaa41('0x33')],this[_0xaa41('0x15')][_0x2f62f6[_0xaa41('0x12a')]]['id']);}var _0x3aafe6=_[_0xaa41('0x12c')](_0x2f62f6);_0x3aafe6[_0xaa41('0x12d')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));var _0x2e8c8f=_0x28685a['campaignsPreview'][_0x2f62f6['queue']];if(ut[_0xaa41('0x12e')](_0x25548d[_0xaa41('0x12f')])){if(_0x2f62f6[_0xaa41('0xa9')]){rpcDb['unlockContact'](_0x2f62f6[_0xaa41('0x86')]);}if(_0x2f62f6[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0x2f62f6[_0xaa41('0x86')]);}ami[_0xaa41('0x26')](_0xaa41('0x130'),ut[_0xaa41('0x7a')](_0x2f62f6,_0xaa41('0x131'),this[_0xaa41('0x25')][_0x2f62f6[_0xaa41('0x45')]]));this[_0xaa41('0x132')](_0x3aafe6,_0x2e8c8f,_0x25548d);}else{_0x2f62f6[_0xaa41('0x123')]=moment()[_0xaa41('0x2a')](_0xaa41('0x5f'));ut[_0xaa41('0xdc')](_0x3aafe6,0x4,'Answer');rpcDb[_0xaa41('0xdd')](_0x3aafe6,_0xaa41('0x133'));}}};Preview[_0xaa41('0xf')]['syncHangup']=function(_0x125efb){var _0xfc1e24=this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]];var _0x21c0c6;if(_0xfc1e24){_0x21c0c6=this[_0xaa41('0x25')][_0xfc1e24[_0xaa41('0x45')]];logger[_0xaa41('0x27')]('[syncHangup][talking]',_0x125efb[_0xaa41('0x84')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);}if(this['actions'][_0x125efb[_0xaa41('0x84')]]&&_0x125efb['linkedid']!==_0x125efb[_0xaa41('0x8c')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6[_0xaa41('0x33')],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')]);}}else if(_0xfc1e24&&_['isNil'](_0xfc1e24[_0xaa41('0x135')])&&_0x21c0c6[_0xaa41('0x136')]&&_0x125efb[_0xaa41('0x84')]===_0x125efb[_0xaa41('0x8c')]&&_[_0xaa41('0x43')](_0x125efb[_0xaa41('0xdb')])&&_0x125efb['cause']==='16'&&_0x125efb['channelstate']==='6'&&_[_0xaa41('0xd9')](_0xfc1e24['transfer'])){if(_0xfc1e24[_0xaa41('0xa9')]){rpcDb[_0xaa41('0xfd')](_0xfc1e24[_0xaa41('0x86')]);}if(_0xfc1e24[_0xaa41('0x83')]){rpcDb[_0xaa41('0xfe')](_0xfc1e24[_0xaa41('0x86')]);}_0x125efb[_0xaa41('0xdb')]='22';this[_0xaa41('0x132')](_0xfc1e24,_0x21c0c6,_0x125efb);}else if(_0xfc1e24&&_0xfc1e24[_0xaa41('0x137')]){if(_0x125efb[_0xaa41('0x134')]==='16'&&this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]][_0xaa41('0x48')]){logger[_0xaa41('0x27')]('[syncHangup][talking][transfer]',_0x125efb[_0xaa41('0x84')],_0x125efb['cause'],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this[_0xaa41('0x74')](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}else if(this[_0xaa41('0x14')][_0x125efb[_0xaa41('0x84')]]['dialAnswer']){logger[_0xaa41('0x27')]('[syncHangup][talking][cause]',_0x125efb['linkedid'],_0x125efb[_0xaa41('0x134')],_0xaa41('0x9c'),_0x21c0c6['name'],_0xaa41('0x46'),_0x21c0c6[_0xaa41('0x47')]);this['callProgressDetectingCustomer'](_0x125efb,_0x125efb[_0xaa41('0x84')],_0x125efb[_0xaa41('0x134')]);}}};Preview[_0xaa41('0xf')]['syncDialEnd']=function(_0x3ecde6){if(this['actions'][_0x3ecde6[_0xaa41('0x138')]]&&_0x3ecde6[_0xaa41('0x138')]!==_0x3ecde6[_0xaa41('0x139')]){this[_0xaa41('0x74')](_0x3ecde6,_0x3ecde6['destlinkedid'],_0x3ecde6[_0xaa41('0xce')]);}};Preview[_0xaa41('0xf')][_0xaa41('0x1c')]=function(_0x49e4a5){if(this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]]&&_0x49e4a5[_0xaa41('0x84')]!==_0x49e4a5[_0xaa41('0x8c')]&&!this[_0xaa41('0x14')][_0x49e4a5[_0xaa41('0x84')]][_0xaa41('0x48')]){if(_0x49e4a5[_0xaa41('0x134')]==='1'){this['callProgressDetectingCustomer'](_0x49e4a5,_0x49e4a5[_0xaa41('0x84')],_0x49e4a5['cause']);}}};Preview[_0xaa41('0xf')][_0xaa41('0x13a')]=function(_0x1fa855,_0x272f3f,_0x36cdd2){if(this[_0xaa41('0x14')][_0x1fa855]){if(_[_0xaa41('0x43')](this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')])){this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')]={};}this[_0xaa41('0x14')][_0x1fa855][_0xaa41('0x13b')][_0x272f3f]=_0x36cdd2;}};Preview['prototype'][_0xaa41('0x21')]=function(_0x366b1c){try{if(!_[_0xaa41('0x43')](_0x366b1c)){if(ut[_0xaa41('0x13c')](_[_0xaa41('0x13d')](_0x366b1c[_0xaa41('0x13e')])[0x0])){this[_0xaa41('0x13a')](_0x366b1c[_0xaa41('0x8c')],_[_0xaa41('0x13d')](_0x366b1c['variable'])[0x0],_0x366b1c[_0xaa41('0x13f')]);}}}catch(_0x30a438){logger[_0xaa41('0x140')](_0xaa41('0x141'),util[_0xaa41('0x142')](_0x30a438,{'showHidden':![],'depth':null}));}};Preview[_0xaa41('0xf')][_0xaa41('0x143')]=function(_0x3f1b1a){if(_0x3f1b1a){if(this[_0xaa41('0x14')][_0x3f1b1a[_0xaa41('0x144')]]){this['actions'][_0x3f1b1a['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xaa41('0xf')][_0xaa41('0x24')]=function(_0x5ccba6){if(_0x5ccba6){if(this[_0xaa41('0x14')][_0x5ccba6[_0xaa41('0x145')]]){this['actions'][_0x5ccba6[_0xaa41('0x145')]]['transfer']=!![];}}};module[_0xaa41('0x146')]=Preview; \ No newline at end of file +var _0xb43b=['custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','isTrunkReachable','active','trunks','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','phone','substring','TrunkBackup','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','agents','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./action','../dialer/utils','redis','defaults','localhost','prototype','tail','finally','campaignsPreview','voiceQueues','actions','clockClearZombieChannels','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','loopCampaigns','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','name','\x20is\x20deactivated','syncCampaigns','dialMethod','type','outbound','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','pTalking','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','countglobal','Busy','dialBusyRetryFrequency','[callProgressDetectingCustomer][logBusy]','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus'];(function(_0x27ec28,_0x247495){var _0x53512f=function(_0x25344b){while(--_0x25344b){_0x27ec28['push'](_0x27ec28['shift']());}};_0x53512f(++_0x247495);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5f08f2,_0x47875f){_0x5f08f2=_0x5f08f2-0x0;var _0x492836=_0xb43b[_0x5f08f2];return _0x492836;};'use strict';var util=require(_0xbb43('0x0'));var _=require(_0xbb43('0x1'));var uuid=require('uuid');var moment=require(_0xbb43('0x2'));var Redis=require(_0xbb43('0x3'));var config=require(_0xbb43('0x4'));var logger=require('../../../config/logger')(_0xbb43('0x5'));var loggerAction=require(_0xbb43('0x6'))(_0xbb43('0x7'));var ami=require(_0xbb43('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xbb43('0x9'));var ut=require('./util/util');var utils=require(_0xbb43('0xa'));config[_0xbb43('0xb')]=_[_0xbb43('0xc')](config[_0xbb43('0xb')],{'host':_0xbb43('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb43('0xb')]));var Sequence=function(){};Sequence[_0xbb43('0xe')]['enqueue']=function(_0x7e0fc2){this[_0xbb43('0xf')]=this[_0xbb43('0xf')]?this[_0xbb43('0xf')][_0xbb43('0x10')](_0x7e0fc2):_0x7e0fc2();};function Preview(_0x2bef86){this['sequence']=new Sequence();this[_0xbb43('0x11')]=_0x2bef86[_0xbb43('0x12')];this['trunks']=_0x2bef86['trunks'];this[_0xbb43('0x13')]={};this['agents']=_0x2bef86['agents'];this[_0xbb43('0x14')]=0x0;ami['on']('originateresponse',this[_0xbb43('0x15')][_0xbb43('0x16')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xbb43('0x17'),this[_0xbb43('0x18')]['bind'](this));ami['on']('dialend',this[_0xbb43('0x19')]['bind'](this));ami['on']('newexten',this[_0xbb43('0x1a')][_0xbb43('0x16')](this));ami['on'](_0xbb43('0x1b'),this['syncVarSet'][_0xbb43('0x16')](this));ami['on']('attendedtransfer',this[_0xbb43('0x1c')][_0xbb43('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbb43('0x16')](this));this[_0xbb43('0x1d')](this[_0xbb43('0x11')]);}function emit(_0x2bf2d4,_0x5bcce7,_0x40a650){io['to'](_0x2bf2d4)['emit'](_0x5bcce7,_0x40a650);}function emitVoiceQueueChannelRemove(_0x3a257d){logger['info'](_0xbb43('0x1e'),JSON['stringify'](_0x3a257d));emit(util[_0xbb43('0x1f')](_0xbb43('0x20'),_0x3a257d['name']),_0xbb43('0x21'),_0x3a257d);io['emit'](_0xbb43('0x22'),_0x3a257d);}function notSendMessagesQueue(_0x298ce2){if(_0x298ce2[_0xbb43('0x23')]){if(_0x298ce2['originated']===0x0&&_0x298ce2['pTalking']===0x0){_0x298ce2['sendMessageOneNotActive']=![];_0x298ce2[_0xbb43('0x24')]=0x0;_0x298ce2[_0xbb43('0x25')]=0x0;_0x298ce2['message']=utils[_0xbb43('0x26')][_0xbb43('0x27')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2['name']+'\x20is\x20not\x20active');}else{_0x298ce2[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x2b')];ut[_0xbb43('0x28')](_0xbb43('0x29'),_0x298ce2[_0xbb43('0x2c')]+_0xbb43('0x2d'));}}}Preview[_0xbb43('0xe')]['loopCampaigns']=function(){var _0x2ad6da=this;setInterval(function(){_0x2ad6da['syncCampaigns']();},0x7cf);};Preview[_0xbb43('0xe')][_0xbb43('0x2e')]=function(){var _0x34f5b2=this[_0xbb43('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x157d62 in _0x34f5b2){if(_0x34f5b2['hasOwnProperty'](_0x157d62)&&(_0x34f5b2[_0x157d62]['dialMethod']==='preview'||_0x34f5b2[_0x157d62][_0xbb43('0x2f')]==='booked')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(this[_0xbb43('0x14')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xbb43('0x32')]();}}if(_0x34f5b2[_0xbb43('0x33')](_0x157d62)&&_0x34f5b2[_0x157d62][_0xbb43('0x2f')]===_0xbb43('0x5')&&_0x34f5b2[_0x157d62][_0xbb43('0x30')]===_0xbb43('0x31')){if(_0x34f5b2[_0x157d62][_0xbb43('0x34')]){this[_0xbb43('0x35')](_0x34f5b2[_0x157d62]);if(_0x34f5b2[_0x157d62]['dialPreviewAutoRecallMe'])this[_0xbb43('0x36')](_0x34f5b2[_0x157d62]);}else{notSendMessagesQueue(_0x34f5b2[_0x157d62]);}}}};Preview[_0xbb43('0xe')][_0xbb43('0x37')]=function(_0x244d66){var _0x4015ec=this;this[_0xbb43('0x38')][_0xbb43('0x39')](function(){if(!_[_0xbb43('0x3a')](_0x4015ec[_0xbb43('0x13')][_0x244d66])){loggerAction[_0xbb43('0x3b')](_0xbb43('0x3c'),_0x244d66,_0xbb43('0x3d'),_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')],_0xbb43('0x3f'),JSON[_0xbb43('0x40')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]]['originated']),_0xbb43('0x41'),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x11')][_0x4015ec['actions'][_0x244d66]['queue']]['pTalking']),JSON[_0xbb43('0x40')](_0x4015ec[_0xbb43('0x13')][_0x244d66]['dialAnswer']),JSON['stringify'](_[_0xbb43('0x42')](_0x4015ec[_0xbb43('0x13')][_0x244d66],[_0xbb43('0x43'),_0xbb43('0x44'),_0xbb43('0x45'),'ListId'])));return ami[_0xbb43('0x46')]({'action':_0xbb43('0x47'),'channel':_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x48')]})[_0xbb43('0x49')](function(_0x531d96){if(_0x531d96[_0xbb43('0x2a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4015ec[_0xbb43('0x13')][_0x244d66]){ut[_0xbb43('0x4a')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66]['queue']],_0xbb43('0x4b'));if(_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x4c')]===!![]){ut[_0xbb43('0x4d')](_0x4015ec['campaignsPreview'][_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]],'[clearZombieChannel]');ut[_0xbb43('0x4e')]('[Dialer][checkChannel][pTalking][Preview]'+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);}ut[_0xbb43('0x4e')](_0xbb43('0x4f')+_0x244d66,_0x4015ec[_0xbb43('0x13')][_0x244d66][_0xbb43('0x3e')]);delete _0x4015ec['actions'][_0x244d66];}},0x2328);}});}});};Preview[_0xbb43('0xe')]['clearZombieChannels']=function(){var _0x307f1e=this;loggerAction[_0xbb43('0x3b')](_0xbb43('0x50'),_[_0xbb43('0x51')](this['actions']));for(var _0x4622ea in this[_0xbb43('0x13')]){if(_0x307f1e[_0xbb43('0x13')][_0xbb43('0x33')](_0x4622ea)){_0x307f1e[_0xbb43('0x37')](_0x4622ea);}}};Preview[_0xbb43('0xe')][_0xbb43('0x36')]=function(_0x3592fb){var _0x5a662b=this;rpcDb[_0xbb43('0x52')](_0x3592fb['id'],ut[_0xbb43('0x53')](this['agents']))[_0xbb43('0x54')](function(_0x5d4c19){if(!_['isNil'](_0x5d4c19)){for(var _0x4d7034=0x0;_0x4d7034<_0x5d4c19['length'];_0x4d7034+=0x1){if(ut[_0xbb43('0x55')](_0x5d4c19[_0x4d7034]['scheduledat'])<_0x3592fb[_0xbb43('0x56')]*0x3c){if(_0x5d4c19[_0x4d7034]['Agent']&&!_0x5d4c19[_0x4d7034][_0xbb43('0x57')][_0xbb43('0x58')]){_0x5a662b[_0xbb43('0x59')](_0x5d4c19[_0x4d7034]['id'])['then'](ut[_0xbb43('0x5a')]('[RecallMe]'))[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x5b')));}else{rpcDb[_0xbb43('0x5c')](_0x5d4c19[_0x4d7034]['id']);}}else{var _0x417ad9=new Action(_0x5d4c19[_0x4d7034],_0x3592fb);_0x417ad9[_0xbb43('0x5d')]=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3592fb[_0xbb43('0x5e')]+=0x1;ut[_0xbb43('0x5f')](_0x417ad9,0x17,_0xbb43('0x60'));if(_0x3592fb[_0xbb43('0x61')]){rpcDb['rescheduleContactInQueue'](ut[_0xbb43('0x62')](_0x5d4c19[_0x4d7034]));rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x64'));}else{ut[_0xbb43('0x5f')](_0x417ad9,0x16,'RecallFailedTimeout');rpcDb[_0xbb43('0x63')](_0x417ad9,_0xbb43('0x65'));rpcDb[_0xbb43('0x66')](_0x417ad9,'[HistoryRecallClose]');}}}}})[_0xbb43('0x49')](ut[_0xbb43('0x5a')](_0xbb43('0x67')));};Preview[_0xbb43('0xe')][_0xbb43('0x35')]=function(_0x59c805){_0x59c805['sendMessageOneNotActive']=!![];if(ut[_0xbb43('0x68')](_0x59c805['loggedIn'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xbb43('0x69')](_0x59c805[_0xbb43('0x34')])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x27')];}else if(!this['isTrunkReachable'](_0x59c805[_0xbb43('0x6a')])){if(!this['isTrunkReachable'](_0x59c805['TrunkBackup'])){_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6b')];}else{_0x59c805[_0xbb43('0x2a')]=utils[_0xbb43('0x26')]['ACTIVE'];}}else{_0x59c805['message']=utils[_0xbb43('0x26')][_0xbb43('0x6c')];}};Preview[_0xbb43('0xe')][_0xbb43('0x6d')]=function(_0x99cb09,_0x38d540,_0x44691b){var _0x14fce0=this;var _0x1a3f98=this['actions'][_0x38d540];var _0x1b6f96=this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]];var _0x3675d9;var _0x22bceb=![];var _0x1fae27=0x2;var _0x3f7262=0x3;if(_0x1b6f96){switch(_0x44691b){case'1':_0x1b6f96[_0xbb43('0x6e')]+=0x1;_0x1a3f98[_0xbb43('0x6f')]+=0x1;_0x1a3f98['countglobal']=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x0,_0xbb43('0x70'));ami[_0xbb43('0x71')](_0xbb43('0x72'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x74')));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoSuch]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'0',_0x1b6f96)['then'](function(_0x5a6ff0){_0x22bceb=_0x5a6ff0[_0xbb43('0x76')]==0x1;_0x1fae27=_0x1b6f96[_0xbb43('0x77')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1a3f98['countnosuchnumberretry']>=_0x1b6f96[_0xbb43('0x7d')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x7e'));}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0x6f'),_0x1b6f96[_0xbb43('0x77')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}delete this['actions'][_0x99cb09[_0xbb43('0x83')]];}else{_0x1a3f98[_0xbb43('0x6f')]++;logger[_0xbb43('0x3b')](_0xbb43('0x84'),_0x1a3f98[_0xbb43('0x6f')]);logger[_0xbb43('0x3b')]('id',_0x1a3f98['idContact']);_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnosuchnumberretry':_0x1a3f98[_0xbb43('0x6f')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0x88'):var _0x6f04b3=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));_0x1a3f98[_0xbb43('0x8a')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x8b')]=_0x6f04b3;_0x1a3f98[_0xbb43('0x4c')]=!![];_0x1b6f96[_0xbb43('0x8c')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x8d'),_0x1a3f98['uniqueid'],_0xbb43('0x8e'),_0x1b6f96['name'],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);ami[_0xbb43('0x71')](_0xbb43('0x8f'),ut[_0xbb43('0x73')](_0x1a3f98,'connect',this['campaignsPreview'][_0x1a3f98[_0xbb43('0x3e')]]));if(_0x1b6f96[_0xbb43('0x90')]){ami['emit'](_0xbb43('0x91'),ut[_0xbb43('0x92')](_0x1a3f98));}break;case'16':ami[_0xbb43('0x71')](_0xbb43('0x93'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94'),this[_0xbb43('0x11')][_0x1a3f98[_0xbb43('0x3e')]]));emitVoiceQueueChannelRemove(ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0x94')));_0x1b6f96[_0xbb43('0x95')]+=0x1;_0x1b6f96[_0xbb43('0x96')]+=0x1;_0x1b6f96[_0xbb43('0x97')]+=0x1;ut[_0xbb43('0x4d')](_0x1b6f96,'[16]');_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x4,_0xbb43('0x98'));rpcDb['createCustomerHistory'](_0x1a3f98,_0xbb43('0x99'));rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0x9a'));rpcDb[_0xbb43('0x9b')](_0x1a3f98);_0x1b6f96[_0xbb43('0x9c')]+=_0x1a3f98['talktime'];_0x1b6f96[_0xbb43('0x9d')]+=_0x1a3f98[_0xbb43('0x9e')];logger[_0xbb43('0x3b')]('[syncHangup][talking][decrement]',_0x1a3f98[_0xbb43('0x9f')],_0xbb43('0x8e'),_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1b6f96[_0xbb43('0x8c')]);delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case _0xbb43('0xa0'):_0x1b6f96[_0xbb43('0xa1')]+=0x1;_0x1a3f98[_0xbb43('0xa2')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut['totalGlobal'](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x5,_0xbb43('0xa4'));_0x1fae27=_0x1b6f96[_0xbb43('0xa5')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')]('custom:agentbusy',ut['buildObj'](_0x1a3f98,'busy'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xa6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'5',_0x1b6f96)[_0xbb43('0x54')](function(_0x8d5a8d){_0x22bceb=_0x8d5a8d[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x1a3f98[_0xbb43('0xa2')]>=_0x1b6f96['dialBusyMaxRetry']){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xa2'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xa2')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98['idContact'],'field':{'countbusyretry':_0x1a3f98[_0xbb43('0xa2')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xa7'):_0x1b6f96[_0xbb43('0xa8')]+=0x1;_0x1a3f98['countnoanswerretry']+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x3,_0xbb43('0xa9'));_0x1fae27=_0x1b6f96[_0xbb43('0xaa')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];var _0x4f356d=ut[_0xbb43('0xab')](_0x1a3f98,_0x1b6f96);ami['emit'](_0xbb43('0xac'),_0x4f356d);rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][logNoAnswer]');_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'3',_0x1b6f96)[_0xbb43('0x54')](function(_0x4d9668){_0x22bceb=_0x4d9668['additional']==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xad'));}else{if(_0x1a3f98[_0xbb43('0xae')]>=_0x1b6f96[_0xbb43('0xaf')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xb0'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xae'),_0x1b6f96[_0xbb43('0xaa')]),_0x1a3f98['unlockAgent'],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})['then'](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case _0xbb43('0xb1'):_0x1b6f96[_0xbb43('0xb2')]+=0x1;_0x1a3f98[_0xbb43('0xb3')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x8,'Congestion');_0x1fae27=_0x1b6f96['dialCongestionRetryFrequency'];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xb4'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xb5')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xb6'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'8',_0x1b6f96)['then'](function(_0xaa42f9){_0x22bceb=_0xaa42f9[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1a3f98[_0xbb43('0xb3')]>=_0x1b6f96[_0xbb43('0xb7')]){rpcDb[_0xbb43('0x66')](_0x1a3f98,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1a3f98,_0xbb43('0xb3'),_0x1b6f96[_0xbb43('0xa5')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xb3')]++;_0x14fce0['incrementPreviewCounters']({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countcongestionretry':_0x1a3f98['countcongestionretry']}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'CANCEL':_0x1b6f96[_0xbb43('0xb8')]+=0x1;_0x1a3f98[_0xbb43('0xb9')]+=0x1;_0x1a3f98['countglobal']=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x14,_0xbb43('0xba'));_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];ami[_0xbb43('0x71')](_0xbb43('0xbc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xbd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xbe'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x5bbbf4){_0x22bceb=_0x5bbbf4[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0x14,_0xbb43('0xba'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xbf'));}else{if(_0x1a3f98[_0xbb43('0xb9')]>=_0x1b6f96[_0xbb43('0xc0')]){rpcDb['createCustomerFinal'](_0x1a3f98,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xbb43('0x7f')](ut[_0xbb43('0x80')](_0x1a3f98,'countagentrejectretry',_0x1b6f96[_0xbb43('0xbb')]),_0x1a3f98['unlockAgent'],_0x1a3f98[_0xbb43('0x82')]);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});});}});break;case _0xbb43('0xc1'):_0x1b6f96[_0xbb43('0xc2')]+=0x1;_0x1a3f98[_0xbb43('0xc3')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0xb,_0xbb43('0xc4'));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xc5'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'11',_0x1b6f96)[_0xbb43('0x54')](function(_0x14cd97){_0x22bceb=_0x14cd97[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96['dialGlobalMaxRetry']){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1a3f98[_0xbb43('0xc6')]>=_0x1b6f96['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0xbb43('0x80')](_0x1a3f98,_0xbb43('0xc3'),_0x1b6f96[_0xbb43('0xc7')]),_0x1a3f98[_0xbb43('0x81')],_0x1a3f98['activeContact']);}}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});break;case'18':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xc9')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut[_0xbb43('0x5f')](_0x1a3f98,0x12,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,_0xbb43('0xcd')));rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xce'));_0x14fce0[_0xbb43('0x75')](_0x1a3f98,'18',_0x1b6f96)['then'](function(_0x1f5a0a){_0x22bceb=_0x1f5a0a[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut['cloneAction'](_0x1a3f98,0x12,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xce'));}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xce'));}}else{_0x1a3f98['countnoanswerretry']++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98['countnoanswerretry']}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];break;case'19':_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0x13,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);ami[_0xbb43('0x71')](_0xbb43('0xcc'),ut[_0xbb43('0x73')](_0x1a3f98,'amd'));rpcDb[_0xbb43('0x63')](_0x1a3f98,'[callProgressDetectingCustomer][machine]');_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'18',_0x1b6f96)[_0xbb43('0x54')](function(_0x54fd3b){_0x22bceb=_0x54fd3b[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,'Global');rpcDb['createCustomerFinal'](_0x3675d9,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xbb43('0x66')](_0x1a3f98,_0xbb43('0xcf'));}}else{_0x1a3f98[_0xbb43('0xae')]++;_0x14fce0[_0xbb43('0x85')]({'id':_0x1a3f98[_0xbb43('0x86')],'field':{'countnoanswerretry':_0x1a3f98[_0xbb43('0xae')]}})[_0xbb43('0x54')](function(){_0x14fce0[_0xbb43('0x87')](_0x1a3f98,_0x1fae27,_0x3f7262)['then'](function(){});});}});delete this[_0xbb43('0x13')][_0x99cb09['linkedid']];break;default:if(_0x1a3f98[_0xbb43('0x4c')]){ut[_0xbb43('0x4d')](_0x1b6f96,_0xbb43('0xd0'));ut[_0xbb43('0x4e')](_0xbb43('0xd1')+_0x1b6f96[_0xbb43('0x2c')],_0x99cb09);}_0x1b6f96[_0xbb43('0xc8')]+=0x1;_0x1a3f98[_0xbb43('0xa3')]=ut[_0xbb43('0x79')](_0x1a3f98);ut['logCustomer'](_0x1a3f98,0xc,_0x99cb09[_0xbb43('0xca')]||_0x99cb09[_0xbb43('0xcb')]);_0x1fae27=_0x1b6f96[_0xbb43('0xbb')];_0x3f7262=_0x1b6f96[_0xbb43('0x78')];rpcDb[_0xbb43('0x63')](_0x1a3f98,_0xbb43('0xd2'));_0x14fce0['verifyAdditionalPhones'](_0x1a3f98,'20',_0x1b6f96)[_0xbb43('0x54')](function(_0x2965ec){_0x22bceb=_0x2965ec[_0xbb43('0x76')]==0x1;if(!_0x22bceb){if(ut[_0xbb43('0x79')](_0x1a3f98)>=_0x1b6f96[_0xbb43('0x7a')]){_0x3675d9=ut[_0xbb43('0x7b')](_0x1a3f98,0xf,_0xbb43('0x7c'));rpcDb[_0xbb43('0x66')](_0x3675d9,_0xbb43('0xd3'));}else{rpcDb['createCustomerFinal'](_0x1a3f98,_0xbb43('0xd3'));}delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0x83')]];}else{_0x14fce0['swapAdditionalPhones'](_0x1a3f98,_0x1fae27,_0x3f7262)[_0xbb43('0x54')](function(){});}});}if(!(_0x1a3f98['dialAnswer']&&_0x44691b==='16')){ut['updateOriginated'](_0x1b6f96,_0xbb43('0xd4'));logger[_0xbb43('0x3b')]('[originated][decrement][callProgressDetectingCustomer]',_0x1a3f98[_0xbb43('0x9f')],'\x20Queue',_0x1b6f96[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x1b6f96[_0xbb43('0xd5')]);}if(_0x44691b!=='ANSWER'){delete this['actions'][_0x99cb09['linkedid']];delete this[_0xbb43('0x13')][_0x99cb09[_0xbb43('0xd6')]];}_0x1b6f96[_0xbb43('0xd7')]=!![];}};Preview[_0xbb43('0xe')][_0xbb43('0xd8')]=function(_0x53b9ee,_0xb54a91,_0x7271d0){if(_[_0xbb43('0xd9')](_0xb54a91)&&_0xbb43('0xda')!==typeof _0xb54a91){return;}if(_[_0xbb43('0xd9')](_0x7271d0)&&_0xbb43('0xda')!==typeof _0x7271d0){return;}switch(_0x7271d0['reason']){case'0':ut['logAgent'](_0x53b9ee,0x0,_0xbb43('0x70'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x53b9ee,0x3,_0xbb43('0xa9'));rpcDb['createAgentHistory'](_0x53b9ee,_0xbb43('0xdc'));break;case'5':ut[_0xbb43('0xdd')](_0x53b9ee,0x5,_0xbb43('0xa4'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xbb43('0xdd')](_0x53b9ee,0x8,_0xbb43('0xde'));rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));break;case'22':ut[_0xbb43('0xdd')](_0x53b9ee,0x16,_0xbb43('0xe0'));rpcDb['createAgentHistory'](_0x53b9ee,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbb43('0xdd')](_0x53b9ee,0xc,_0x7271d0[_0xbb43('0xe1')]);rpcDb[_0xbb43('0xdb')](_0x53b9ee,_0xbb43('0xdf'));}ut[_0xbb43('0x4a')](_0xb54a91,'[callProgressDetectingAgent]');logger['info'](_0xbb43('0xe2'),_0x53b9ee[_0xbb43('0x9f')],_0xbb43('0x8e'),_0xb54a91['name'],_0xbb43('0x3f'),_0xb54a91[_0xbb43('0xd5')]);delete this[_0xbb43('0x13')][_0x53b9ee['uniqueid']];};Preview[_0xbb43('0xe')]['verifyAdditionalPhones']=function(_0x2719ce,_0x235409,_0x3386bc){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2719ce,_0x235409,_0x3386bc)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe3')));};Preview[_0xbb43('0xe')][_0xbb43('0x87')]=function(_0x34e8b8,_0x339b30,_0x4122e7){return cmHopperAdditionalPhone[_0xbb43('0x87')](_0x34e8b8,_0x339b30,_0x4122e7)[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe4')));};Preview[_0xbb43('0xe')][_0xbb43('0x85')]=function(_0x5e2afe){return Promise[_0xbb43('0xe5')]()[_0xbb43('0x54')](cmHopperAdditionalPhone[_0xbb43('0x85')](_0x5e2afe))[_0xbb43('0x49')](logger[_0xbb43('0x3b')](_0xbb43('0xe6')));};Preview[_0xbb43('0xe')][_0xbb43('0xe7')]=function(_0x1f8f78,_0x3a05be,_0x2dd161,_0x2d2127,_0x3c537a){var _0x36af9a=this;return new Promise(function(_0x199b58,_0x357e45){if(_[_0xbb43('0x3a')](_0x3a05be)||_['isNil'](_0x3a05be[_0xbb43('0xe8')])||_['isNil'](_0x3a05be['phone'])||_[_0xbb43('0x3a')](_0x3a05be[_0xbb43('0x45')])){_0x357e45(ut['message']('Contact\x20is\x20undefined',_0x2d2127,_0x3c537a));return;}var _0x3fce74=uuid['v4']();var _0x5911fc=_0x36af9a['campaignsPreview'][_0x3a05be[_0xbb43('0x3d')]['name']];var _0x41f3fe=_0x2dd161?_0x36af9a['agents'][_0x2dd161]['id']:undefined;_0x36af9a[_0xbb43('0x13')][_0x3fce74]=new Action(_0x3a05be,_0x5911fc,_0x3fce74,_0x2dd161,_0x41f3fe);var _0x5fdbcd=_0x36af9a['actions'][_0x3fce74];_0x5fdbcd[_0xbb43('0x81')]=_0x2d2127;_0x5fdbcd[_0xbb43('0x82')]=_0x3c537a;_0x5fdbcd[_0xbb43('0xe9')]=_0x2dd161;if(_[_0xbb43('0xea')](_0x1f8f78)){_0x36af9a[_0xbb43('0xeb')](_0x5fdbcd,_0x5911fc,_0x3a05be,_0x2dd161)['then'](function(_0x6b0dd){logger[_0xbb43('0x3b')](_0xbb43('0xec'),_0xbb43('0xed')+_0x5fdbcd[_0xbb43('0x3e')]+'\x20IdHopper:\x20'+_0x5fdbcd[_0xbb43('0x86')],JSON[_0xbb43('0x40')](_0x6b0dd));ami[_0xbb43('0x71')]('custom:agentcalled',ut['buildObj'](_0x5fdbcd,_0xbb43('0xee'),_0x36af9a[_0xbb43('0x11')][_0x5fdbcd[_0xbb43('0x3e')]]));_0x199b58(ut['message']('Calling'));})[_0xbb43('0x49')](function(_0x1ab4c4){ut[_0xbb43('0x28')](_0xbb43('0xef'),_0x1ab4c4);_0x357e45(ut[_0xbb43('0x2a')]('Call\x20failed',_0x2d2127,_0x3c537a));});}else{_0x5911fc[_0xbb43('0xf0')]+=0x1;ut[_0xbb43('0xf1')](_0x5fdbcd);rpcDb[_0xbb43('0xf2')](_0x5fdbcd,_0xbb43('0xf3'));delete _0x36af9a[_0xbb43('0x13')][_0x3fce74];_0x357e45(ut[_0xbb43('0x2a')]('Contact\x20in\x20black\x20List',_0x2d2127,_0x3c537a));}});};Preview[_0xbb43('0xe')][_0xbb43('0xf4')]=function(_0x12f7a9){return!_['isNil'](_0x12f7a9)&&!_[_0xbb43('0x3a')](_0x12f7a9['name'])&&!_[_0xbb43('0x3a')](_0x12f7a9[_0xbb43('0xf5')])&&_0x12f7a9[_0xbb43('0xf5')]&&!_[_0xbb43('0x3a')](this['trunks'][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])])&&!_[_0xbb43('0x3a')](this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9['name'])][_0xbb43('0x47')])&&(this[_0xbb43('0xf6')][util[_0xbb43('0x1f')](_0xbb43('0xf7'),_0x12f7a9[_0xbb43('0x2c')])]['status']===_0xbb43('0xf8')||this[_0xbb43('0xf6')][util[_0xbb43('0x1f')]('SIP/%s',_0x12f7a9[_0xbb43('0x2c')])]['status']==='unmonitored');};Preview['prototype']['run']=function(_0x44b3de,_0x5d7629){return this[_0xbb43('0xf9')](_0x44b3de,_0x5d7629)[_0xbb43('0x54')](function(_0x20be22){return _[_0xbb43('0x42')](_0x20be22,['message']);})[_0xbb43('0x49')](function(_0x12c97f){if(_0x12c97f['unlock']){rpcDb[_0xbb43('0xfa')](_0x44b3de);}if(_0x12c97f[_0xbb43('0xf5')]){rpcDb['disableContact'](_0x44b3de);}throw _['pick'](_0x12c97f,[_0xbb43('0x2a')]);});};Preview[_0xbb43('0xe')][_0xbb43('0xf9')]=function(_0x5d6ec2,_0x17065d){var _0x59fc4a=this;var _0x448d75,_0x33edab;return rpcDb[_0xbb43('0xfb')](_0x5d6ec2)[_0xbb43('0x54')](function(_0x55df31){if(!_[_0xbb43('0x3a')](_0x55df31[0x0])){_0x33edab=_0x55df31[0x0][_0xbb43('0xfc')]?![]:!![];_0x448d75=_0x55df31[0x0][_0xbb43('0xfc')]?!![]:![];_0x448d75=_0x17065d?!![]:_0x448d75;}var _0x7c7f55=_0x59fc4a[_0xbb43('0xfd')](_0x55df31);if(_0x7c7f55['isValid']){rpcDb[_0xbb43('0xfe')](_[_0xbb43('0x42')](_0x55df31[0x0],['VoiceQueueId','phone']))[_0xbb43('0x54')](function(_0x4d0023){_0x59fc4a[_0xbb43('0xe7')](_0x4d0023,_0x55df31[0x0],_0x17065d,_0x33edab,_0x448d75)[_0xbb43('0x54')](function(_0x36fddb){return _0x36fddb;})[_0xbb43('0x49')](function(_0x6bbd30){throw _0x6bbd30;});})[_0xbb43('0x49')](function(_0x21a044){ut[_0xbb43('0x28')](_0xbb43('0xff'),_0x21a044);throw ut[_0xbb43('0x2a')]('Call\x20unsuccessful',_0x33edab,_0x448d75);});}else{throw ut[_0xbb43('0x2a')](_0x7c7f55[_0xbb43('0x2a')],_0x33edab,_0x448d75);}})[_0xbb43('0x49')](function(_0x544418){ut[_0xbb43('0x28')](_0xbb43('0x100'),_0x544418);throw ut[_0xbb43('0x2a')](_0xbb43('0x101'),![],!![]);});};Preview[_0xbb43('0xe')]['validateContact']=function(_0x3f4ab7){if(_['isNil'](_0x3f4ab7)||_['isEmpty'](_0x3f4ab7)||!_['isNil'](_0x3f4ab7[0x0]['Agent'])&&_[_0xbb43('0x3a')](_0x3f4ab7[0x0][_0xbb43('0x57')][_0xbb43('0x2c')])){ut[_0xbb43('0x28')](_0xbb43('0x102'),_0x3f4ab7);return{'isValid':![],'message':_0xbb43('0x103')};}var _0x108e6d=this['campaignsPreview'][_0x3f4ab7[0x0][_0xbb43('0x3d')][_0xbb43('0x2c')]];_0x108e6d[_0xbb43('0x2a')]=utils[_0xbb43('0x26')][_0xbb43('0x6c')];if(_[_0xbb43('0x3a')](_0x108e6d)){ut[_0xbb43('0x28')](_0xbb43('0x104'),_0x108e6d);return{'isValid':![],'message':_0xbb43('0x105')};}if(!this[_0xbb43('0xf4')](_0x108e6d[_0xbb43('0x6a')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x107'));if(!this[_0xbb43('0xf4')](_0x108e6d['TrunkBackup'])){ut[_0xbb43('0x28')](_0xbb43('0x108'),_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x108e6d[_0xbb43('0x34')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x108e6d[_0xbb43('0x2c')]+_0xbb43('0x10a'));return{'isValid':![],'message':_0xbb43('0x106')+_0x108e6d[_0xbb43('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xbb43('0x10b')};};Preview[_0xbb43('0xe')][_0xbb43('0xeb')]=function(_0x581645,_0x4e7cdb,_0x3eaada,_0x1c9c7f){var _0x1d5376=this;return new Promise(function(_0x2ba34c,_0x30e984){var _0x5d7a43=_0x581645[_0xbb43('0x9f')];var _0x540b8d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb[_0xbb43('0x6a')])?util[_0xbb43('0x1f')](_0xbb43('0x10c'),_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')]['trim']()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]):util[_0xbb43('0x1f')](_0xbb43('0x10c'),_[_0xbb43('0x3a')](_0x4e7cdb['TrunkBackup'])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x2c')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x2c')],_['isNil'](_0x4e7cdb[_0xbb43('0x10d')])?'':_0x4e7cdb[_0xbb43('0x10d')][_0xbb43('0x112')]()||'',_0x4e7cdb[_0xbb43('0x10e')]>0x0?_0x3eaada[_0xbb43('0x10f')][_0xbb43('0x110')](_0x4e7cdb[_0xbb43('0x10e')]):_0x3eaada[_0xbb43('0x10f')]);var _0x1f211d=_0x1d5376[_0xbb43('0xf4')](_0x4e7cdb['Trunk'])?ut[_0xbb43('0x113')](_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]):ut['getCallerId'](_[_0xbb43('0x3a')](_0x4e7cdb[_0xbb43('0x111')])?_0x4e7cdb[_0xbb43('0x6a')][_0xbb43('0x114')]:_0x4e7cdb[_0xbb43('0x111')][_0xbb43('0x114')],_0x4e7cdb['dialOriginateCallerIdName'],_0x4e7cdb[_0xbb43('0x115')]>0x0?ut[_0xbb43('0x116')](_0x4e7cdb[_0xbb43('0x117')],_0x4e7cdb[_0xbb43('0x115')]):_0x4e7cdb[_0xbb43('0x117')]);if(_0x1f211d){_0x581645[_0xbb43('0x118')]=ut[_0xbb43('0x119')](_0x1f211d);_0x581645[_0xbb43('0x11a')]=ut[_0xbb43('0x11b')](_0x1f211d);}var _0x19260c=ut[_0xbb43('0x11c')](_0x4e7cdb,_0x3eaada,_0x540b8d,_0x1f211d,_0x5d7a43,_0x581645);_[_0xbb43('0x11d')](_0x581645,ut[_0xbb43('0x11e')](_0x19260c));_0x581645[_0xbb43('0x5d')]=moment()['format'](_0xbb43('0x89'));_0x4e7cdb[_0xbb43('0x11f')]=_0x19260c;var _0x1baf8c=ut[_0xbb43('0x120')](_0x581645,_0x4e7cdb,_0x19260c,_0x581645[_0xbb43('0x82')],_0x1c9c7f);return ami[_0xbb43('0x46')](_0x1baf8c)['then'](function(_0x4345e4){_0x4e7cdb[_0xbb43('0xd5')]+=0x1;logger[_0xbb43('0x3b')](_0xbb43('0x121'),_0x5d7a43,_0xbb43('0x8e'),_0x4e7cdb[_0xbb43('0x2c')],_0xbb43('0x3f'),_0x4e7cdb[_0xbb43('0xd5')]);_0x2ba34c(_0x4345e4);})[_0xbb43('0x49')](function(_0x510584){ut[_0xbb43('0xdd')](_0x581645,0xe,_0xbb43('0x122'));rpcDb[_0xbb43('0xdb')](_0x581645,_0xbb43('0x123'));_0x30e984(_0x510584);});});};Preview[_0xbb43('0xe')]['syncNewExten']=function(_0x26825d){if(this['actions'][_0x26825d['linkedid']]){this['actions'][_0x26825d[_0xbb43('0x83')]][_0xbb43('0x48')]=_0x26825d['channel'];}};Preview['prototype'][_0xbb43('0x15')]=function(_0x59d31f){var _0x400c6e=this;var _0x26c450=this[_0xbb43('0x13')][_0x59d31f[_0xbb43('0x124')]];if(_0x26c450){if(_0x26c450[_0xbb43('0xe9')]&&this['agents'][_0x26c450[_0xbb43('0xe9')]]){ut[_0xbb43('0x125')](_0x26c450,this[_0xbb43('0x126')][_0x26c450[_0xbb43('0xe9')]][_0xbb43('0x2c')],this[_0xbb43('0x126')][_0x26c450['lookAgent']]['id']);}var _0x756278=_[_0xbb43('0x127')](_0x26c450);_0x756278[_0xbb43('0x8a')]=moment()[_0xbb43('0x1f')](_0xbb43('0x89'));var _0x4cd83a=_0x400c6e[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]];if(ut[_0xbb43('0x128')](_0x59d31f[_0xbb43('0x129')])){if(_0x26c450[_0xbb43('0x81')]){rpcDb[_0xbb43('0xfa')](_0x26c450[_0xbb43('0x86')]);}if(_0x26c450[_0xbb43('0x82')]){rpcDb[_0xbb43('0x5c')](_0x26c450['idContact']);}ami[_0xbb43('0x71')](_0xbb43('0x12a'),ut[_0xbb43('0x73')](_0x26c450,_0xbb43('0x12b'),this[_0xbb43('0x11')][_0x26c450[_0xbb43('0x3e')]]));this[_0xbb43('0xd8')](_0x756278,_0x4cd83a,_0x59d31f);}else{_0x26c450['starttime']=moment()[_0xbb43('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xbb43('0xdd')](_0x756278,0x4,'Answer');rpcDb[_0xbb43('0xdb')](_0x756278,_0xbb43('0x12c'));}}};Preview[_0xbb43('0xe')][_0xbb43('0x12d')]=function(_0x31d75c){var _0x570d24=this['actions'][_0x31d75c['linkedid']];var _0x1d4d0b;if(_0x570d24){_0x1d4d0b=this[_0xbb43('0x11')][_0x570d24['queue']];logger['info'](_0xbb43('0x12e'),_0x31d75c[_0xbb43('0x83')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);}if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]&&_0x31d75c['linkedid']!==_0x31d75c['uniqueid']){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],_0xbb43('0x41'),_0x1d4d0b['pTalking']);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c['cause']);}}else if(_0x570d24&&_['isNil'](_0x570d24[_0xbb43('0x130')])&&_0x1d4d0b[_0xbb43('0x131')]&&_0x31d75c['linkedid']===_0x31d75c['uniqueid']&&_[_0xbb43('0x3a')](_0x31d75c[_0xbb43('0xe1')])&&_0x31d75c[_0xbb43('0x12f')]==='16'&&_0x31d75c[_0xbb43('0x132')]==='6'&&_['isUndefined'](_0x570d24[_0xbb43('0x133')])){if(_0x570d24['unlockAgent']){rpcDb[_0xbb43('0xfa')](_0x570d24[_0xbb43('0x86')]);}if(_0x570d24[_0xbb43('0x82')]){rpcDb['disableContact'](_0x570d24[_0xbb43('0x86')]);}_0x31d75c[_0xbb43('0xe1')]='22';this[_0xbb43('0xd8')](_0x570d24,_0x1d4d0b,_0x31d75c);}else if(_0x570d24&&_0x570d24[_0xbb43('0x133')]){if(_0x31d75c[_0xbb43('0x12f')]==='16'&&this[_0xbb43('0x13')][_0x31d75c[_0xbb43('0x83')]]['dialAnswer']){logger[_0xbb43('0x3b')]('[syncHangup][talking][transfer]',_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')],_0xbb43('0x8e'),_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')]);}else if(this['actions'][_0x31d75c[_0xbb43('0x83')]][_0xbb43('0x4c')]){logger[_0xbb43('0x3b')]('[syncHangup][talking][cause]',_0x31d75c['linkedid'],_0x31d75c[_0xbb43('0x12f')],'\x20Queue',_0x1d4d0b[_0xbb43('0x2c')],'pTalking:\x20',_0x1d4d0b[_0xbb43('0x8c')]);this[_0xbb43('0x6d')](_0x31d75c,_0x31d75c[_0xbb43('0x83')],_0x31d75c[_0xbb43('0x12f')]);}}};Preview[_0xbb43('0xe')][_0xbb43('0x19')]=function(_0xa1e9ba){if(this[_0xbb43('0x13')][_0xa1e9ba['destlinkedid']]&&_0xa1e9ba[_0xbb43('0xd6')]!==_0xa1e9ba[_0xbb43('0x134')]){this[_0xbb43('0x6d')](_0xa1e9ba,_0xa1e9ba[_0xbb43('0xd6')],_0xa1e9ba['dialstatus']);}};Preview[_0xbb43('0xe')][_0xbb43('0x18')]=function(_0x3178f7){if(this[_0xbb43('0x13')][_0x3178f7[_0xbb43('0x83')]]&&_0x3178f7[_0xbb43('0x83')]!==_0x3178f7['uniqueid']&&!this['actions'][_0x3178f7['linkedid']][_0xbb43('0x4c')]){if(_0x3178f7['cause']==='1'){this[_0xbb43('0x6d')](_0x3178f7,_0x3178f7[_0xbb43('0x83')],_0x3178f7['cause']);}}};Preview[_0xbb43('0xe')][_0xbb43('0x135')]=function(_0xea8659,_0x157391,_0x2b60f0){if(this['actions'][_0xea8659]){if(_[_0xbb43('0x3a')](this[_0xbb43('0x13')][_0xea8659]['variables'])){this['actions'][_0xea8659][_0xbb43('0x11f')]={};}this['actions'][_0xea8659][_0xbb43('0x11f')][_0x157391]=_0x2b60f0;}};Preview[_0xbb43('0xe')]['syncVarSet']=function(_0x18a8d3){try{if(!_[_0xbb43('0x3a')](_0x18a8d3)){if(ut['filterKey'](_[_0xbb43('0x136')](_0x18a8d3['variable'])[0x0])){this['addVariable'](_0x18a8d3['uniqueid'],_['keys'](_0x18a8d3[_0xbb43('0x137')])[0x0],_0x18a8d3[_0xbb43('0x138')]);}}}catch(_0x21ba01){logger[_0xbb43('0x139')](_0xbb43('0x13a'),util[_0xbb43('0x13b')](_0x21ba01,{'showHidden':![],'depth':null}));}};Preview[_0xbb43('0xe')][_0xbb43('0x1c')]=function(_0x53b812){if(_0x53b812){if(this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]]){this[_0xbb43('0x13')][_0x53b812[_0xbb43('0x13c')]][_0xbb43('0x133')]=!![];}}};Preview[_0xbb43('0xe')]['syncBlindTransfer']=function(_0x47c884){if(_0x47c884){if(this[_0xbb43('0x13')][_0x47c884[_0xbb43('0x13d')]]){this[_0xbb43('0x13')][_0x47c884['transfererlinkedid']][_0xbb43('0x133')]=!![];}}};module[_0xbb43('0x13e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 7f7d061..1da303b 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 _0xbc5a=['inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error'];(function(_0x18d42c,_0x3121cb){var _0x37fc88=function(_0x5c75d0){while(--_0x5c75d0){_0x18d42c['push'](_0x18d42c['shift']());}};_0x37fc88(++_0x3121cb);}(_0xbc5a,0xf3));var _0xabc5=function(_0x299a98,_0x578011){_0x299a98=_0x299a98-0x0;var _0x6fd85a=_0xbc5a[_0x299a98];return _0x6fd85a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xabc5('0x0'))(_0xabc5('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xabc5('0x2'));var cmHopperBlack=require(_0xabc5('0x3'));var agentReportPreview=require(_0xabc5('0x4'));var voiceQueueReport=require(_0xabc5('0x5'));function loggerCatch(_0x363e64){return function(_0x18b31b){logger[_0xabc5('0x6')](_0x363e64,util[_0xabc5('0x7')](_0x18b31b,{'showHidden':![],'depth':null}));};}function create(_0x4b715d){return cmHopperHistory[_0xabc5('0x8')](_0x4b715d)[_0xabc5('0x9')](loggerCatch(_0xabc5('0xa')));}function createAgent(_0x2239ae){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](agentReportPreview['createHistory'](_0x2239ae))[_0xabc5('0x9')](loggerCatch(_0xabc5('0xa')));}function moveContact(_0xddb240){return cmHopper[_0xabc5('0xd')](_0xddb240,!![])[_0xabc5('0x9')](loggerCatch(_0xabc5('0xe')));}exports['checkIsBlackList']=function(_0xe18b4b){return cmHopperBlack[_0xabc5('0xf')](_0xe18b4b)['catch'](loggerCatch(_0xabc5('0x10')));};exports['getContactPreview']=function(_0x4b0fe7){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](cmHopper[_0xabc5('0x11')](_0x4b0fe7))[_0xabc5('0x9')](loggerCatch(_0xabc5('0x12')));};exports[_0xabc5('0x8')]=function(_0x4b7321,_0x42f74b){create(_0x4b7321)[_0xabc5('0x9')](loggerCatch(_0x42f74b));moveContact(_0x4b7321)[_0xabc5('0x9')](loggerCatch(_0x42f74b));};exports[_0xabc5('0x13')]=function(_0x4b56f6,_0x23f623){createAgent(_0x4b56f6)['catch'](loggerCatch(_0x23f623));};exports[_0xabc5('0x14')]=function(_0x3a97df,_0x2130ac){create(_0x3a97df)[_0xabc5('0x9')](loggerCatch(_0x2130ac));};exports['createCustomerFinal']=function(_0x17a63f,_0x4987fd){moveContact(_0x17a63f)[_0xabc5('0x9')](loggerCatch(_0x4987fd));};exports['rescheduleContact']=function(_0x59d30a,_0x2b07a9,_0xbc814e){if(_0x2b07a9){_0x59d30a['UserId']=null;}if(_0xbc814e){_0x59d30a[_0xabc5('0x15')]=![];}return cmHopper[_0xabc5('0x16')](_0x59d30a)[_0xabc5('0x9')](loggerCatch(_0xabc5('0x17')));};exports[_0xabc5('0x18')]=function(_0x34f7cb){return cmHopper[_0xabc5('0x18')](_0x34f7cb)[_0xabc5('0x9')](loggerCatch(_0xabc5('0x19')));};exports[_0xabc5('0x1a')]=function(_0x320ad){return cmHopper['unlockContact']({'UserId':null},_0x320ad,0x1)[_0xabc5('0x9')](loggerCatch('[unlockContact]\x20'));};exports[_0xabc5('0x1b')]=function(_0x1a05fb){return cmHopper[_0xabc5('0x1a')]({'active':![]},_0x1a05fb,0x1)['catch'](loggerCatch(_0xabc5('0x1c')));};exports[_0xabc5('0x1d')]=function(_0x333d24){var _0x74a7ff={};_0x74a7ff[_0xabc5('0x1e')]=_0x333d24[_0xabc5('0x1e')];_0x74a7ff[_0xabc5('0x1f')]=_0x333d24['uniqueid'];_0x74a7ff['calleridnum']=_0x333d24[_0xabc5('0x20')];_0x74a7ff[_0xabc5('0x21')]=_0x333d24[_0xabc5('0x21')];_0x74a7ff['queue']=_0x333d24[_0xabc5('0x22')];_0x74a7ff[_0xabc5('0x23')]=_0x333d24['answertime'];_0x74a7ff['queuecallerleaveAt']=_0x333d24['answertime'];_0x74a7ff[_0xabc5('0x24')]=0x1;_0x74a7ff[_0xabc5('0x25')]=_0x333d24[_0xabc5('0x26')];_0x74a7ff[_0xabc5('0x27')]=_0x333d24[_0xabc5('0x28')];_0x74a7ff[_0xabc5('0x29')]=_0xabc5('0x2a');_0x74a7ff['exten']='xcally-motion-preview';_0x74a7ff[_0xabc5('0x2b')]=0x0;_0x74a7ff['assigned']=0x1;_0x74a7ff['lastAssignedTo']=_0x333d24[_0xabc5('0x28')];_0x74a7ff[_0xabc5('0x2c')]=_0xabc5('0x2d');return BPromise['resolve']()['then'](voiceQueueReport[_0xabc5('0x2e')](_0x74a7ff))[_0xabc5('0x9')](loggerCatch(_0xabc5('0x2f')));};exports['getContactRecallMe']=function(_0x232ce7,_0x405967){return BPromise[_0xabc5('0xb')]()[_0xabc5('0xc')](cmHopper[_0xabc5('0x30')](_0x232ce7,_0x405967))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xabc5('0x31')]=function(_0x3d96da){return cmHopper['rescheduleContact'](_0x3d96da,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x3b5b=['context','from-sip','exten','xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','resolve','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','answertime','queuecallercompleteAt','connectedlinename','membername'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x3b5b,0x100));var _0xb3b5=function(_0x131c81,_0x12fe63){_0x131c81=_0x131c81-0x0;var _0x241e7a=_0x3b5b[_0x131c81];return _0x241e7a;};'use strict';var util=require(_0xb3b5('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var cmHopper=require(_0xb3b5('0x1'));var cmHopperHistory=require(_0xb3b5('0x2'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xb3b5('0x3'));var voiceQueueReport=require(_0xb3b5('0x4'));function loggerCatch(_0x476a2c){return function(_0x28b3ea){logger[_0xb3b5('0x5')](_0x476a2c,util[_0xb3b5('0x6')](_0x28b3ea,{'showHidden':![],'depth':null}));};}function create(_0x4c1244){return cmHopperHistory['createHistory'](_0x4c1244)[_0xb3b5('0x7')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x4c595c){return BPromise[_0xb3b5('0x8')]()['then'](agentReportPreview[_0xb3b5('0x9')](_0x4c595c))[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0xa')));}function moveContact(_0x467824){return cmHopper[_0xb3b5('0xb')](_0x467824,!![])[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0xc')));}exports[_0xb3b5('0xd')]=function(_0x66ee7b){return cmHopperBlack[_0xb3b5('0xd')](_0x66ee7b)[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0xe')));};exports[_0xb3b5('0xf')]=function(_0x1879ab){return BPromise[_0xb3b5('0x8')]()[_0xb3b5('0x10')](cmHopper[_0xb3b5('0xf')](_0x1879ab))['catch'](loggerCatch(_0xb3b5('0x11')));};exports[_0xb3b5('0x9')]=function(_0x1deaa8,_0x55337e){create(_0x1deaa8)[_0xb3b5('0x7')](loggerCatch(_0x55337e));moveContact(_0x1deaa8)[_0xb3b5('0x7')](loggerCatch(_0x55337e));};exports[_0xb3b5('0x12')]=function(_0x5ab6ac,_0x1079f4){createAgent(_0x5ab6ac)[_0xb3b5('0x7')](loggerCatch(_0x1079f4));};exports[_0xb3b5('0x13')]=function(_0x9f4f50,_0x41ccb5){create(_0x9f4f50)[_0xb3b5('0x7')](loggerCatch(_0x41ccb5));};exports[_0xb3b5('0x14')]=function(_0x146ae2,_0x174fb7){moveContact(_0x146ae2)['catch'](loggerCatch(_0x174fb7));};exports[_0xb3b5('0x15')]=function(_0x25e40e,_0x3ae51d,_0xa15549){if(_0x3ae51d){_0x25e40e[_0xb3b5('0x16')]=null;}if(_0xa15549){_0x25e40e[_0xb3b5('0x17')]=![];}return cmHopper[_0xb3b5('0x15')](_0x25e40e)[_0xb3b5('0x7')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xb3b5('0x18')]=function(_0x4ab32e){return cmHopper[_0xb3b5('0x18')](_0x4ab32e)[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0x19')));};exports[_0xb3b5('0x1a')]=function(_0x385b61){return cmHopper['unlockContact']({'UserId':null},_0x385b61,0x1)['catch'](loggerCatch(_0xb3b5('0x1b')));};exports['disableContact']=function(_0x47c08b){return cmHopper[_0xb3b5('0x1a')]({'active':![]},_0x47c08b,0x1)[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0x1c')));};exports[_0xb3b5('0x1d')]=function(_0x5a1beb){var _0x53935d={};_0x53935d['type']=_0x5a1beb[_0xb3b5('0x1e')];_0x53935d[_0xb3b5('0x1f')]=_0x5a1beb[_0xb3b5('0x1f')];_0x53935d['calleridnum']=_0x5a1beb[_0xb3b5('0x20')];_0x53935d['calleridname']=_0x5a1beb['calleridname'];_0x53935d[_0xb3b5('0x21')]=_0x5a1beb[_0xb3b5('0x21')];_0x53935d['queuecallerjoinAt']=_0x5a1beb[_0xb3b5('0x22')];_0x53935d['queuecallerleaveAt']=_0x5a1beb[_0xb3b5('0x22')];_0x53935d['queuecallercomplete']=0x1;_0x53935d[_0xb3b5('0x23')]=_0x5a1beb['endtime'];_0x53935d[_0xb3b5('0x24')]=_0x5a1beb[_0xb3b5('0x25')];_0x53935d[_0xb3b5('0x26')]=_0xb3b5('0x27');_0x53935d[_0xb3b5('0x28')]=_0xb3b5('0x29');_0x53935d[_0xb3b5('0x2a')]=0x0;_0x53935d['assigned']=0x1;_0x53935d['lastAssignedTo']=_0x5a1beb[_0xb3b5('0x25')];_0x53935d[_0xb3b5('0x2b')]=_0xb3b5('0x2c');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x53935d))[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0x2d')));};exports[_0xb3b5('0x2e')]=function(_0x207079,_0xecdf1b){return BPromise[_0xb3b5('0x8')]()[_0xb3b5('0x10')](cmHopper[_0xb3b5('0x2e')](_0x207079,_0xecdf1b))[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0x2f')));};exports['rescheduleContactInQueue']=function(_0x2d5700){return cmHopper['rescheduleContact'](_0x2d5700,!![],!![])[_0xb3b5('0x7')](loggerCatch(_0xb3b5('0x30')));}; \ 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 4c42e2c..512d6ce 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 _0x590f=['rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','add','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','filterKey','idContact','campaigntype','active','scheduledat','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged'];(function(_0x139580,_0x330ed4){var _0x2c5820=function(_0x50eb44){while(--_0x50eb44){_0x139580['push'](_0x139580['shift']());}};_0x2c5820(++_0x330ed4);}(_0x590f,0x145));var _0xf590=function(_0x592b62,_0x5111cb){_0x592b62=_0x592b62-0x0;var _0x1912aa=_0x590f[_0x592b62];return _0x1912aa;};'use strict';var util=require(_0xf590('0x0'));var _=require(_0xf590('0x1'));var moment=require(_0xf590('0x2'));var logger=require(_0xf590('0x3'))('preview');var ipAgi=process[_0xf590('0x4')][_0xf590('0x5')]||_0xf590('0x6');var utils=require(_0xf590('0x7'));exports[_0xf590('0x8')]=function(_0x1d25a4){return function(_0x3d9b3b){logger[_0xf590('0x9')](_0x1d25a4,util[_0xf590('0xa')](_0x3d9b3b,{'showHidden':![],'depth':null}));};};exports[_0xf590('0xb')]=function(_0x14edd2,_0x528aea){logger[_0xf590('0xc')](_0x14edd2,util['inspect'](_0x528aea,{'showHidden':![],'depth':null}));};exports[_0xf590('0xd')]=function(_0x29dba0,_0x488af9){logger[_0xf590('0x9')](_0x29dba0,util[_0xf590('0xa')](_0x488af9,{'showHidden':![],'depth':null}));};exports[_0xf590('0xe')]=function(_0x55244c){return function(_0x1fc1e4){logger[_0xf590('0xc')](_0x55244c,util[_0xf590('0xa')](_0x1fc1e4,{'showHidden':![],'depth':null}));};};exports[_0xf590('0xf')]=function(_0x11508c,_0x1f2b44,_0x349cae){return{'message':_0x11508c,'unlock':_0x1f2b44,'active':_0x349cae};};exports[_0xf590('0x10')]=function(_0x478138,_0x23a2c5,_0x141164){if(!_[_0xf590('0x11')](_0x141164)&&'string'===typeof _0x141164&&!_[_0xf590('0x12')](_0x141164)){if(!_['isUndefined'](_0x23a2c5)&&_0xf590('0x13')===typeof _0x23a2c5&&!_[_0xf590('0x12')](_0x23a2c5)){return util[_0xf590('0x14')](_0xf590('0x15'),_0x23a2c5,_0x141164);}return util[_0xf590('0x14')]('\x22%s\x22\x20<%s>',_0x141164,_0x141164);}if(!_['isUndefined'](_0x478138)&&'string'===typeof _0x478138&&!_[_0xf590('0x12')](_0x478138)){return _0x478138;}return _0xf590('0x16');};exports[_0xf590('0x17')]=function(_0x25bd20){if(_[_0xf590('0x18')](_0x25bd20)){return![];}return _0x25bd20;};exports[_0xf590('0x19')]=function(_0x29793f,_0x425976,_0x3a435e,_0x4a3b0e,_0x533251,_0x58f9e1){var _0x35c82e={'XMD-QUEUE':_0x425976['Queue']?_0x425976[_0xf590('0x1a')]['name']:'','XMD-CALLERID':_0x4a3b0e,'XMD-CALLERID-PREVIEW':_0x58f9e1?util[_0xf590('0x14')]('\x22%s\x22\x20<%s>',_0x58f9e1[_0xf590('0x1b')],_0x58f9e1[_0xf590('0x1c')]):_0x4a3b0e,'XMD-DIALID':_0x533251,'XMD-CONTACTID':_0x425976['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4a3b0e,'XMD-VOICEQUEUEID':_0x425976[_0xf590('0x1d')],'XMD-DIALCHANNEL':_0x3a435e,'XMD-DIALTIMEOUT':_0x29793f[_0xf590('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x29793f[_0xf590('0x1f')]?'g':'',_[_0xf590('0x12')](_0x29793f['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x29793f[_0xf590('0x20')]||'','XMD-AGI':_0x29793f['dialQueueProject']?util['format'](_0xf590('0x21'),ipAgi,_0x29793f[_0xf590('0x22')]):'NONE','XMD-AGIAFTER':_0x29793f['dialQueueProject2']?util[_0xf590('0x14')](_0xf590('0x21'),ipAgi,_0x29793f[_0xf590('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x58f9e1?_0x58f9e1[_0xf590('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x58f9e1?_0x58f9e1[_0xf590('0x24')]:'','XMD-DESTINATION':_0xf590('0x25'),'SIPADDHEADER':_0xf590('0x26')};if(!_[_0xf590('0x12')](_0x29793f[_0xf590('0x27')])){_0x35c82e[util['format']('%s',_0xf590('0x28'))]=_0x29793f[_0xf590('0x27')];_0x35c82e[util[_0xf590('0x14')]('%s',_0xf590('0x29'))]=_0x533251;}if(_0x425976&&_0x425976[_0xf590('0x2a')]){for(var _0x200f08 in _0x425976[_0xf590('0x2a')]){if(_0x425976[_0xf590('0x2a')][_0xf590('0x2b')](_0x200f08)){if(!_[_0xf590('0x18')](_0x425976[_0xf590('0x2a')][_0x200f08])&&_0x200f08!=='id'&&_0x200f08!==_0xf590('0x2c')&&_0x200f08!=='createdAt'&&_0x200f08!==_0xf590('0x2d')){_0x35c82e[util[_0xf590('0x14')](_0xf590('0x2e'),_0xf590('0x2f'),_[_0xf590('0x30')](_0x200f08))]=_0x425976[_0xf590('0x2a')][_0x200f08];}}}}return _0x35c82e;};exports[_0xf590('0x31')]=function(_0x14b20a){var _0x5b4698={};for(var _0x1ce51f in _0x14b20a){if(_0x14b20a['hasOwnProperty'](_0x1ce51f)){_0x5b4698[util['format']('%s',_[_0xf590('0x32')](_0x1ce51f))]=_0x14b20a[_0x1ce51f];}}return{'variables':_0x5b4698};};exports[_0xf590('0x33')]=function(_0x355107,_0xfa4c6d){if(!_[_0xf590('0x18')](_0x355107)){if(_0x355107['hasOwnProperty'](_0xf590('0x34'))){if(_0x355107[_0xf590('0x34')]>0x0){_0x355107['originated']-=0x1;}else{logger[_0xf590('0x9')](_0xf590('0x35'),_0xfa4c6d);}}}else{logger[_0xf590('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xfa4c6d);}};exports[_0xf590('0x36')]=function(_0x2bac07){var _0x4a5a41=moment()[_0xf590('0x14')](_0xf590('0x37'));_0x2bac07[_0xf590('0x38')]=0xd;_0x2bac07[_0xf590('0x39')]=_0xf590('0x3a');_0x2bac07[_0xf590('0x3b')]=_0x4a5a41;_0x2bac07[_0xf590('0x3c')]=_0x4a5a41;_0x2bac07[_0xf590('0x3d')]=_0x4a5a41;};exports[_0xf590('0x3e')]=function(_0xe7ad21,_0x2363fe,_0x544b80){var _0x2f3dff=moment()[_0xf590('0x14')](_0xf590('0x37'));_0xe7ad21[_0xf590('0x38')]=_0x2363fe;_0xe7ad21[_0xf590('0x39')]=_0x544b80;_0xe7ad21[_0xf590('0x3c')]=_0x2f3dff;_0xe7ad21[_0xf590('0x3f')]=utils[_0xf590('0x40')](_0xe7ad21[_0xf590('0x3c')],_0xe7ad21[_0xf590('0x3b')]);};exports[_0xf590('0x41')]=function(_0x3edc77,_0x4218a5,_0x21cf1c){_0x3edc77[_0xf590('0x42')]=_0x4218a5;_0x3edc77[_0xf590('0x43')]=_0x21cf1c;};exports['logCustomer']=function(_0x10a231,_0x969f7b,_0x78067d){var _0x50db5b=moment()[_0xf590('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x10a231[_0xf590('0x38')]=_0x969f7b;_0x10a231['statedesc']=_0x78067d;_0x10a231[_0xf590('0x3c')]=_0x10a231['responsetime']?_0x10a231[_0xf590('0x3c')]:_0x50db5b;_0x10a231['endtime']=_0x10a231[_0xf590('0x3d')]?_0x10a231[_0xf590('0x3d')]:_0x50db5b;_0x10a231['ringtime']=utils['getSeconds'](_0x10a231['responsetime']||0x0,_0x10a231['starttime']||0x0);_0x10a231[_0xf590('0x44')]=_0x10a231[_0xf590('0x45')]?utils[_0xf590('0x40')](_0x10a231[_0xf590('0x3d')],_0x10a231['answertime']):0x0;};exports[_0xf590('0x46')]=function(_0x254f27){return _0x254f27===_0xf590('0x47');};exports[_0xf590('0x48')]=function(_0x197c29,_0x243ef0,_0x3bd2eb,_0x3786a4,_0x323d41){var _0x8bc3ac=_0x3786a4?'RECALL':_0x197c29[_0xf590('0x1b')];_0x8bc3ac=_0x323d41?_0xf590('0x49'):_0x8bc3ac;return{'actionid':_0x197c29[_0xf590('0x4a')],'action':_0xf590('0x4b'),'channel':_0x197c29[_0xf590('0x4c')],'callerid':util[_0xf590('0x14')](_0xf590('0x15'),_0x8bc3ac,_0x197c29[_0xf590('0x1c')]),'Exten':_0xf590('0x25'),'Context':'from-sip','Priority':'1','variable':_0x3bd2eb,'timeout':(_0x243ef0[_0xf590('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x197c29[_0xf590('0x4a')]};};exports[_0xf590('0x4e')]=function(_0x2aac7e){return _0x2aac7e[_0xf590('0x4f')]+_0x2aac7e['countcongestionretry']+_0x2aac7e[_0xf590('0x50')]+_0x2aac7e[_0xf590('0x51')]+_0x2aac7e['countnosuchnumberretry'];};exports[_0xf590('0x52')]=function(_0x3e3e41){var _0x2713d1=_[_0xf590('0x53')](_0x3e3e41);_0x2713d1['state']=0xf;_0x2713d1[_0xf590('0x39')]=_0xf590('0x54');return _0x2713d1;};exports[_0xf590('0x55')]=function(_0x4363e2,_0x30de97,_0x44417a){var _0xba837e={};_0xba837e[_0x30de97]=_0x4363e2[_0x30de97];_0xba837e['active']=![];_0xba837e['scheduledat']=moment()[_0xf590('0x56')](_0x44417a,'minutes')[_0xf590('0x14')](_0xf590('0x37'));_0xba837e[_0xf590('0x57')]=_0x4363e2[_0xf590('0x57')];_0xba837e[_0xf590('0x58')]=_0x4363e2[_0xf590('0x58')];_0xba837e[_0xf590('0x1d')]=_0x4363e2[_0xf590('0x1d')]||undefined;return _0xba837e;};exports['decrementTalkink']=function(_0x467e76,_0x5e5bd7){if(!_['isNil'](_0x467e76)){if(_0x467e76['pTalking']>0x0){_0x467e76[_0xf590('0x59')]-=0x1;}else{logger['error'](_0x5e5bd7,_0xf590('0x5a'));}}else{logger[_0xf590('0x9')](_0x5e5bd7,_0xf590('0x5b'));}};exports[_0xf590('0x5c')]=function(_0x478d95){if(_0x478d95<=0x0){return!![];}return![];};function buildObj(_0x53b45c,_0x37fda8,_0x1b1294){_0x53b45c['lastevent']=_0x37fda8;_0x53b45c[_0xf590('0x5d')]=_0x53b45c[_0xf590('0x5e')];_0x53b45c[_0xf590('0x5f')]=_0x53b45c[_0xf590('0x4c')];_0x53b45c[_0xf590('0x60')]=_0xf590('0x61');if(_0x1b1294){_0x53b45c[_0xf590('0x62')]=_0x1b1294[_0xf590('0x62')];}return _0x53b45c;}exports[_0xf590('0x63')]=buildObj;exports[_0xf590('0x64')]=function(_0x462b55){var _0x5ca985={};_0x5ca985[_0xf590('0x5e')]=_0x462b55[_0xf590('0x5e')];_0x5ca985['interface']=_0x462b55['channelAgent'];_0x5ca985[_0xf590('0x4a')]=_0x462b55['uniqueid'];return _0x5ca985;};exports[_0xf590('0x65')]=function(_0x22a02d){var _0x4846a5=[];for(var _0xa35f37 in _0x22a02d){if(_0x22a02d['hasOwnProperty'](_0xa35f37)){if(!_[_0xf590('0x18')](_0x22a02d[_0xa35f37])&&_0x22a02d[_0xa35f37][_0xf590('0x38')]===_0xf590('0x66')&&_0x22a02d[_0xa35f37][_0xf590('0x67')]===_0xf590('0x68')){_0x4846a5[_0xf590('0x69')](_0x22a02d[_0xa35f37]['id']);}}}return _0x4846a5;};exports[_0xf590('0x6a')]=function(_0x49ad62){var _0x5c6761=moment()[_0xf590('0x6b')](0x0);var _0x4a80bb=moment(_0x49ad62)[_0xf590('0x6b')](0x0);return _0x5c6761[_0xf590('0x6c')](_0x4a80bb,_0xf590('0x6d'));};exports[_0xf590('0x6e')]=function(_0x3fcee7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fcee7[_0xf590('0x57')],'ListId':_0x3fcee7[_0xf590('0x58')],'VoiceQueueId':_0x3fcee7[_0xf590('0x1d')]||undefined,'CampaignId':_0x3fcee7['CampaignId']||undefined};};exports[_0xf590('0x6f')]=function(_0x5de683){if(_0x5de683===_0xf590('0x4a')||_0x5de683===_0xf590('0x70')||_0x5de683===_0xf590('0x5e')||_0x5de683==='type'||_0x5de683===_0xf590('0x71')||_0x5de683==='dialAnswer'||_0x5de683===_0xf590('0x42')||_0x5de683==='channelAgent'||_0x5de683===_0xf590('0x1b')||_0x5de683===_0xf590('0x72')||_0x5de683==='calleridnum'||_0x5de683===_0xf590('0x73')||_0x5de683===_0xf590('0x4f')||_0x5de683===_0xf590('0x74')||_0x5de683===_0xf590('0x50')||_0x5de683===_0xf590('0x75')||_0x5de683===_0xf590('0x76')||_0x5de683===_0xf590('0x77')||_0x5de683===_0xf590('0x78')||_0x5de683===_0xf590('0x79')||_0x5de683===_0xf590('0x57')||_0x5de683===_0xf590('0x58')||_0x5de683===_0xf590('0x43')||_0x5de683===_0xf590('0x1d')||_0x5de683===_0xf590('0x7a')||_0x5de683===_0xf590('0x7b')||_0x5de683===_0xf590('0x7c')||_0x5de683===_0xf590('0x7d')||_0x5de683===_0xf590('0x7e')||_0x5de683===_0xf590('0x7f')||_0x5de683===_0xf590('0x80')||_0x5de683==='xmd-dialoptions'||_0x5de683==='xmd-dialid'||_0x5de683==='xmd-dialchannel'||_0x5de683===_0xf590('0x81')||_0x5de683===_0xf590('0x82')||_0x5de683===_0xf590('0x83')||_0x5de683===_0xf590('0x84')||_0x5de683===_0xf590('0x85')||_0x5de683===_0xf590('0x86')||_0x5de683===_0xf590('0x87')||_0x5de683===_0xf590('0x88')||_0x5de683===_0xf590('0x89')||_0x5de683===_0xf590('0x8a')||_0x5de683===_0xf590('0x8b')||_0x5de683==='rtpaudioqosrtt'||_0x5de683==='rtpaudioqosrttbridged'||_0x5de683===_0xf590('0x86')||_0x5de683===_0xf590('0x87')||_0x5de683===_0xf590('0x88')||_0x5de683===_0xf590('0x89')||_0x5de683===_0xf590('0x8a')||_0x5de683===_0xf590('0x8b')||_0x5de683===_0xf590('0x8c')||_0x5de683==='rtpaudioqosrttbridged'||_0x5de683===_0xf590('0x8d')||_0x5de683===_0xf590('0x8e')||_0x5de683===_0xf590('0x38')||_0x5de683===_0xf590('0x39')){return![];}return!![];};exports[_0xf590('0x8f')]=function(_0x5c36d8,_0x34bc96){var _0x5efc49,_0x55e9c0,_0x3f03f4;if(_0x34bc96<=0x0){_0x34bc96=0x1;}_0x5efc49=new RegExp(_0xf590('0x90')+_0x34bc96+'}$');_0x55e9c0=Math[_0xf590('0x91')](0xa,_0x34bc96-0x1);_0x3f03f4=Math['pow'](0xa,_0x34bc96)-0x1;return util[_0xf590('0x14')]('%s',_[_0xf590('0x92')](_0x5c36d8,_0x5efc49,_[_0xf590('0x93')](_0x55e9c0,_0x3f03f4)));};exports[_0xf590('0x94')]=function(_0x58cfd1){var _0xde9342=_0x58cfd1[_0xf590('0x95')](/"(.*?)"/);return _0xde9342?_0xde9342[0x1]:_0x58cfd1;};exports[_0xf590('0x96')]=function(_0x257bc0){var _0x50b6d0=_0x257bc0['match'](/<(.*?)>/);return _0x50b6d0?_0x50b6d0[0x1]:_0x257bc0;};function buildNoAnswerEventPayload(_0x329f9f,_0x578bc3){var _0x2996dc=buildObj(_0x329f9f,'noanswer');if(!_[_0xf590('0x12')](_0x578bc3[_0xf590('0x97')])){Object['keys'](_0x578bc3[_0xf590('0x97')])[_0xf590('0x98')](function(_0x3401ab){_0x2996dc[_0x3401ab[_0xf590('0x99')]()]=_0x578bc3[_0xf590('0x97')][_0x3401ab];});}return _0x2996dc;}exports[_0xf590('0x9a')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xa0d2=['state','getSeconds','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledat','add','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','active','countglobal','callbackuniqueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime'];(function(_0x3e135e,_0x29e621){var _0x5265da=function(_0x13b63e){while(--_0x13b63e){_0x3e135e['push'](_0x3e135e['shift']());}};_0x5265da(++_0x29e621);}(_0xa0d2,0x181));var _0x2a0d=function(_0x4eff1d,_0x5cc7e2){_0x4eff1d=_0x4eff1d-0x0;var _0x66622f=_0xa0d2[_0x4eff1d];return _0x66622f;};'use strict';var util=require(_0x2a0d('0x0'));var _=require(_0x2a0d('0x1'));var moment=require(_0x2a0d('0x2'));var logger=require(_0x2a0d('0x3'))(_0x2a0d('0x4'));var ipAgi=process[_0x2a0d('0x5')][_0x2a0d('0x6')]||_0x2a0d('0x7');var utils=require(_0x2a0d('0x8'));exports[_0x2a0d('0x9')]=function(_0x76f13a){return function(_0x393060){logger[_0x2a0d('0xa')](_0x76f13a,util[_0x2a0d('0xb')](_0x393060,{'showHidden':![],'depth':null}));};};exports[_0x2a0d('0xc')]=function(_0x2b8082,_0x40e395){logger[_0x2a0d('0xd')](_0x2b8082,util[_0x2a0d('0xb')](_0x40e395,{'showHidden':![],'depth':null}));};exports[_0x2a0d('0xe')]=function(_0x196ca7,_0x4f4eaf){logger[_0x2a0d('0xa')](_0x196ca7,util['inspect'](_0x4f4eaf,{'showHidden':![],'depth':null}));};exports[_0x2a0d('0xf')]=function(_0x4a89a9){return function(_0x5e4527){logger['info'](_0x4a89a9,util[_0x2a0d('0xb')](_0x5e4527,{'showHidden':![],'depth':null}));};};exports[_0x2a0d('0x10')]=function(_0x3ce2c7,_0x29f3d1,_0x24ad5d){return{'message':_0x3ce2c7,'unlock':_0x29f3d1,'active':_0x24ad5d};};exports[_0x2a0d('0x11')]=function(_0x5e7679,_0x371fd1,_0x2c2706){if(!_['isUndefined'](_0x2c2706)&&_0x2a0d('0x12')===typeof _0x2c2706&&!_[_0x2a0d('0x13')](_0x2c2706)){if(!_['isUndefined'](_0x371fd1)&&_0x2a0d('0x12')===typeof _0x371fd1&&!_[_0x2a0d('0x13')](_0x371fd1)){return util[_0x2a0d('0x14')]('\x22%s\x22\x20<%s>',_0x371fd1,_0x2c2706);}return util['format'](_0x2a0d('0x15'),_0x2c2706,_0x2c2706);}if(!_['isUndefined'](_0x5e7679)&&'string'===typeof _0x5e7679&&!_['isEmpty'](_0x5e7679)){return _0x5e7679;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x3aa526){if(_[_0x2a0d('0x16')](_0x3aa526)){return![];}return _0x3aa526;};exports[_0x2a0d('0x17')]=function(_0x90cf91,_0x4fd26f,_0x5b1b31,_0x36b1a6,_0x575e58,_0x119a7f){var _0x211523={'XMD-QUEUE':_0x4fd26f[_0x2a0d('0x18')]?_0x4fd26f[_0x2a0d('0x18')][_0x2a0d('0x19')]:'','XMD-CALLERID':_0x36b1a6,'XMD-CALLERID-PREVIEW':_0x119a7f?util[_0x2a0d('0x14')](_0x2a0d('0x15'),_0x119a7f[_0x2a0d('0x1a')],_0x119a7f[_0x2a0d('0x1b')]):_0x36b1a6,'XMD-DIALID':_0x575e58,'XMD-CONTACTID':_0x4fd26f[_0x2a0d('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x36b1a6,'XMD-VOICEQUEUEID':_0x4fd26f[_0x2a0d('0x1d')],'XMD-DIALCHANNEL':_0x5b1b31,'XMD-DIALTIMEOUT':_0x90cf91[_0x2a0d('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x90cf91[_0x2a0d('0x1f')]?'g':'',_['isEmpty'](_0x90cf91[_0x2a0d('0x20')])?'':_0x2a0d('0x21')),'XMD-DIALURL':_0x90cf91[_0x2a0d('0x22')]||'','XMD-AGI':_0x90cf91[_0x2a0d('0x23')]?util[_0x2a0d('0x14')](_0x2a0d('0x24'),ipAgi,_0x90cf91[_0x2a0d('0x23')]):_0x2a0d('0x25'),'XMD-AGIAFTER':_0x90cf91[_0x2a0d('0x1f')]?util['format'](_0x2a0d('0x24'),ipAgi,_0x90cf91[_0x2a0d('0x1f')]):_0x2a0d('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x119a7f?_0x119a7f[_0x2a0d('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x119a7f?_0x119a7f[_0x2a0d('0x27')]:'','XMD-DESTINATION':_0x2a0d('0x28'),'SIPADDHEADER':_0x2a0d('0x29')};if(!_[_0x2a0d('0x13')](_0x90cf91['monitor_format'])){_0x211523[util[_0x2a0d('0x14')]('%s',_0x2a0d('0x2a'))]=_0x90cf91[_0x2a0d('0x20')];_0x211523[util[_0x2a0d('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x575e58;}if(_0x4fd26f&&_0x4fd26f[_0x2a0d('0x2b')]){for(var _0x4b7d0b in _0x4fd26f[_0x2a0d('0x2b')]){if(_0x4fd26f[_0x2a0d('0x2b')][_0x2a0d('0x2c')](_0x4b7d0b)){if(!_[_0x2a0d('0x16')](_0x4fd26f['Contact'][_0x4b7d0b])&&_0x4b7d0b!=='id'&&_0x4b7d0b!==_0x2a0d('0x2d')&&_0x4b7d0b!==_0x2a0d('0x2e')&&_0x4b7d0b!==_0x2a0d('0x2f')){_0x211523[util[_0x2a0d('0x14')]('%s%s',_0x2a0d('0x30'),_[_0x2a0d('0x31')](_0x4b7d0b))]=_0x4fd26f[_0x2a0d('0x2b')][_0x4b7d0b];}}}}return _0x211523;};exports[_0x2a0d('0x32')]=function(_0x9ae3da){var _0x5223b9={};for(var _0x364572 in _0x9ae3da){if(_0x9ae3da['hasOwnProperty'](_0x364572)){_0x5223b9[util[_0x2a0d('0x14')]('%s',_[_0x2a0d('0x33')](_0x364572))]=_0x9ae3da[_0x364572];}}return{'variables':_0x5223b9};};exports[_0x2a0d('0x34')]=function(_0x5efe1f,_0x2e4749){if(!_['isNil'](_0x5efe1f)){if(_0x5efe1f[_0x2a0d('0x2c')](_0x2a0d('0x35'))){if(_0x5efe1f[_0x2a0d('0x35')]>0x0){_0x5efe1f[_0x2a0d('0x35')]-=0x1;}else{logger['error'](_0x2a0d('0x36'),_0x2e4749);}}}else{logger[_0x2a0d('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2e4749);}};exports[_0x2a0d('0x37')]=function(_0x15d48b){var _0x2afabf=moment()[_0x2a0d('0x14')](_0x2a0d('0x38'));_0x15d48b['state']=0xd;_0x15d48b[_0x2a0d('0x39')]=_0x2a0d('0x3a');_0x15d48b[_0x2a0d('0x3b')]=_0x2afabf;_0x15d48b[_0x2a0d('0x3c')]=_0x2afabf;_0x15d48b[_0x2a0d('0x3d')]=_0x2afabf;};exports['logAgent']=function(_0x4ac0c9,_0x3209c3,_0x1de2c4){var _0x439d19=moment()['format'](_0x2a0d('0x38'));_0x4ac0c9[_0x2a0d('0x3e')]=_0x3209c3;_0x4ac0c9[_0x2a0d('0x39')]=_0x1de2c4;_0x4ac0c9[_0x2a0d('0x3c')]=_0x439d19;_0x4ac0c9['ringtime']=utils[_0x2a0d('0x3f')](_0x4ac0c9[_0x2a0d('0x3c')],_0x4ac0c9['starttime']);};exports[_0x2a0d('0x40')]=function(_0x552e84,_0x38dbfd,_0x295167){_0x552e84[_0x2a0d('0x41')]=_0x38dbfd;_0x552e84[_0x2a0d('0x42')]=_0x295167;};exports[_0x2a0d('0x43')]=function(_0x1d2201,_0x583825,_0x569db7){var _0x378e01=moment()[_0x2a0d('0x14')](_0x2a0d('0x38'));_0x1d2201[_0x2a0d('0x3e')]=_0x583825;_0x1d2201[_0x2a0d('0x39')]=_0x569db7;_0x1d2201[_0x2a0d('0x3c')]=_0x1d2201[_0x2a0d('0x3c')]?_0x1d2201[_0x2a0d('0x3c')]:_0x378e01;_0x1d2201['endtime']=_0x1d2201[_0x2a0d('0x3d')]?_0x1d2201[_0x2a0d('0x3d')]:_0x378e01;_0x1d2201[_0x2a0d('0x44')]=utils[_0x2a0d('0x3f')](_0x1d2201['responsetime']||0x0,_0x1d2201[_0x2a0d('0x3b')]||0x0);_0x1d2201[_0x2a0d('0x45')]=_0x1d2201[_0x2a0d('0x46')]?utils[_0x2a0d('0x3f')](_0x1d2201[_0x2a0d('0x3d')],_0x1d2201[_0x2a0d('0x46')]):0x0;};exports[_0x2a0d('0x47')]=function(_0x58f680){return _0x58f680===_0x2a0d('0x48');};exports[_0x2a0d('0x49')]=function(_0x1ce37f,_0x3e7a96,_0x325a4c,_0x2461f8,_0x431254){var _0x220bc0=_0x2461f8?_0x2a0d('0x4a'):_0x1ce37f['calleridname'];_0x220bc0=_0x431254?_0x2a0d('0x4b'):_0x220bc0;return{'actionid':_0x1ce37f[_0x2a0d('0x4c')],'action':_0x2a0d('0x4d'),'channel':_0x1ce37f[_0x2a0d('0x4e')],'callerid':util['format'](_0x2a0d('0x15'),_0x220bc0,_0x1ce37f[_0x2a0d('0x1b')]),'Exten':_0x2a0d('0x28'),'Context':_0x2a0d('0x4f'),'Priority':'1','variable':_0x325a4c,'timeout':(_0x3e7a96[_0x2a0d('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1ce37f[_0x2a0d('0x4c')]};};exports[_0x2a0d('0x51')]=function(_0x5313f8){return _0x5313f8[_0x2a0d('0x52')]+_0x5313f8[_0x2a0d('0x53')]+_0x5313f8[_0x2a0d('0x54')]+_0x5313f8[_0x2a0d('0x55')]+_0x5313f8[_0x2a0d('0x56')];};exports['cloneAction']=function(_0x29351a){var _0x4a48b9=_[_0x2a0d('0x57')](_0x29351a);_0x4a48b9['state']=0xf;_0x4a48b9[_0x2a0d('0x39')]='Global';return _0x4a48b9;};exports['scheduledAt']=function(_0x1caf49,_0xd1b3e6,_0x1658eb){var _0x38b3fa={};_0x38b3fa[_0xd1b3e6]=_0x1caf49[_0xd1b3e6];_0x38b3fa['active']=![];_0x38b3fa[_0x2a0d('0x58')]=moment()[_0x2a0d('0x59')](_0x1658eb,_0x2a0d('0x5a'))[_0x2a0d('0x14')](_0x2a0d('0x38'));_0x38b3fa[_0x2a0d('0x1c')]=_0x1caf49[_0x2a0d('0x1c')];_0x38b3fa[_0x2a0d('0x5b')]=_0x1caf49[_0x2a0d('0x5b')];_0x38b3fa['VoiceQueueId']=_0x1caf49[_0x2a0d('0x1d')]||undefined;return _0x38b3fa;};exports[_0x2a0d('0x5c')]=function(_0x2cf3d8,_0xa436d9){if(!_[_0x2a0d('0x16')](_0x2cf3d8)){if(_0x2cf3d8['pTalking']>0x0){_0x2cf3d8['pTalking']-=0x1;}else{logger['error'](_0xa436d9,_0x2a0d('0x5d'));}}else{logger[_0x2a0d('0xa')](_0xa436d9,_0x2a0d('0x5e'));}};exports['IsNotLoggedIn']=function(_0x133150){if(_0x133150<=0x0){return!![];}return![];};function buildObj(_0x299614,_0x4f91a5,_0x541c2d){_0x299614[_0x2a0d('0x5f')]=_0x4f91a5;_0x299614[_0x2a0d('0x19')]=_0x299614[_0x2a0d('0x60')];_0x299614[_0x2a0d('0x61')]=_0x299614[_0x2a0d('0x4e')];_0x299614[_0x2a0d('0x62')]=_0x2a0d('0x63');if(_0x541c2d){_0x299614[_0x2a0d('0x64')]=_0x541c2d['mandatoryDisposition'];}return _0x299614;}exports[_0x2a0d('0x65')]=buildObj;exports[_0x2a0d('0x66')]=function(_0x4a5289){var _0x37e084={};_0x37e084['queue']=_0x4a5289[_0x2a0d('0x60')];_0x37e084['interface']=_0x4a5289[_0x2a0d('0x4e')];_0x37e084[_0x2a0d('0x4c')]=_0x4a5289['uniqueid'];return _0x37e084;};exports[_0x2a0d('0x67')]=function(_0x23cea1){var _0x52cebd=[];for(var _0x17f13a in _0x23cea1){if(_0x23cea1['hasOwnProperty'](_0x17f13a)){if(!_[_0x2a0d('0x16')](_0x23cea1[_0x17f13a])&&_0x23cea1[_0x17f13a][_0x2a0d('0x3e')]==='not_inuse'&&_0x23cea1[_0x17f13a]['status']==='reachable'){_0x52cebd[_0x2a0d('0x68')](_0x23cea1[_0x17f13a]['id']);}}}return _0x52cebd;};exports[_0x2a0d('0x69')]=function(_0x6e6e1c){var _0x15c63a=moment()[_0x2a0d('0x6a')](0x0);var _0x27edcb=moment(_0x6e6e1c)[_0x2a0d('0x6a')](0x0);return _0x15c63a[_0x2a0d('0x6b')](_0x27edcb,'seconds');};exports[_0x2a0d('0x6c')]=function(_0x5df8a7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5df8a7[_0x2a0d('0x1c')],'ListId':_0x5df8a7[_0x2a0d('0x5b')],'VoiceQueueId':_0x5df8a7[_0x2a0d('0x1d')]||undefined,'CampaignId':_0x5df8a7[_0x2a0d('0x6d')]||undefined};};exports[_0x2a0d('0x6e')]=function(_0x572cae){if(_0x572cae===_0x2a0d('0x4c')||_0x572cae===_0x2a0d('0x6f')||_0x572cae==='queue'||_0x572cae===_0x2a0d('0x70')||_0x572cae===_0x2a0d('0x71')||_0x572cae==='dialAnswer'||_0x572cae===_0x2a0d('0x41')||_0x572cae==='channelAgent'||_0x572cae==='calleridname'||_0x572cae===_0x2a0d('0x72')||_0x572cae==='calleridnum'||_0x572cae===_0x2a0d('0x58')||_0x572cae==='countbusyretry'||_0x572cae===_0x2a0d('0x53')||_0x572cae==='countnoanswerretry'||_0x572cae===_0x2a0d('0x73')||_0x572cae==='callback'||_0x572cae===_0x2a0d('0x74')||_0x572cae==='callbackat'||_0x572cae==='recallme'||_0x572cae===_0x2a0d('0x1c')||_0x572cae==='ListId'||_0x572cae===_0x2a0d('0x42')||_0x572cae===_0x2a0d('0x1d')||_0x572cae==='sipcallid'||_0x572cae==='xmd-voicequeueid'||_0x572cae===_0x2a0d('0x75')||_0x572cae===_0x2a0d('0x76')||_0x572cae==='xmd-listid'||_0x572cae===_0x2a0d('0x77')||_0x572cae==='xmd-dialtimeout'||_0x572cae===_0x2a0d('0x78')||_0x572cae===_0x2a0d('0x79')||_0x572cae===_0x2a0d('0x7a')||_0x572cae===_0x2a0d('0x7b')||_0x572cae==='xmd-cdrtype'||_0x572cae===_0x2a0d('0x7c')||_0x572cae===_0x2a0d('0x7d')||_0x572cae===_0x2a0d('0x7e')||_0x572cae===_0x2a0d('0x7f')||_0x572cae===_0x2a0d('0x80')||_0x572cae===_0x2a0d('0x81')||_0x572cae==='rtpaudioqosjitterbridged'||_0x572cae===_0x2a0d('0x82')||_0x572cae===_0x2a0d('0x83')||_0x572cae===_0x2a0d('0x84')||_0x572cae===_0x2a0d('0x85')||_0x572cae===_0x2a0d('0x7f')||_0x572cae===_0x2a0d('0x80')||_0x572cae===_0x2a0d('0x81')||_0x572cae===_0x2a0d('0x86')||_0x572cae==='rtpaudioqosloss'||_0x572cae===_0x2a0d('0x83')||_0x572cae===_0x2a0d('0x84')||_0x572cae===_0x2a0d('0x85')||_0x572cae==='bridgepeer'||_0x572cae===_0x2a0d('0x87')||_0x572cae===_0x2a0d('0x3e')||_0x572cae===_0x2a0d('0x39')){return![];}return!![];};exports[_0x2a0d('0x88')]=function(_0x135955,_0x3f7520){var _0x2ab459,_0x1b317b,_0x374d27;if(_0x3f7520<=0x0){_0x3f7520=0x1;}_0x2ab459=new RegExp(_0x2a0d('0x89')+_0x3f7520+'}$');_0x1b317b=Math[_0x2a0d('0x8a')](0xa,_0x3f7520-0x1);_0x374d27=Math[_0x2a0d('0x8a')](0xa,_0x3f7520)-0x1;return util[_0x2a0d('0x14')]('%s',_[_0x2a0d('0x8b')](_0x135955,_0x2ab459,_[_0x2a0d('0x8c')](_0x1b317b,_0x374d27)));};exports[_0x2a0d('0x8d')]=function(_0x29802c){var _0x527646=_0x29802c[_0x2a0d('0x8e')](/"(.*?)"/);return _0x527646?_0x527646[0x1]:_0x29802c;};exports[_0x2a0d('0x8f')]=function(_0x2c3ed9){var _0x642f1f=_0x2c3ed9[_0x2a0d('0x8e')](/<(.*?)>/);return _0x642f1f?_0x642f1f[0x1]:_0x2c3ed9;};function buildNoAnswerEventPayload(_0x55c136,_0x1940e2){var _0x234a76=buildObj(_0x55c136,_0x2a0d('0x90'));if(!_[_0x2a0d('0x13')](_0x1940e2[_0x2a0d('0x91')])){Object[_0x2a0d('0x92')](_0x1940e2[_0x2a0d('0x91')])[_0x2a0d('0x93')](function(_0x34cd36){_0x234a76[_0x34cd36['toLowerCase']()]=_0x1940e2[_0x2a0d('0x91')][_0x34cd36];});}return _0x234a76;}exports[_0x2a0d('0x94')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f0b7419..6de8b1e 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 _0x6302=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x33b360,_0x90a737){var _0x5eed2a=function(_0x17587a){while(--_0x17587a){_0x33b360['push'](_0x33b360['shift']());}};_0x5eed2a(++_0x90a737);}(_0x6302,0xb2));var _0x2630=function(_0x5d6aef,_0x990afa){_0x5d6aef=_0x5d6aef-0x0;var _0x511122=_0x6302[_0x5d6aef];return _0x511122;};'use strict';exports[_0x2630('0x0')]={'queue':{'type':_0x2630('0x1'),'required':!![]},'interface':{'type':_0x2630('0x1'),'required':!![]},'membername':{'type':_0x2630('0x1'),'required':!![]},'penalty':{'type':_0x2630('0x2'),'required':![]},'paused':{'type':_0x2630('0x3'),'required':![]}};exports[_0x2630('0x4')]={'queue':{'type':_0x2630('0x1'),'required':!![]},'interface':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0x5')]={'interface':{'type':_0x2630('0x1'),'required':!![]},'paused':{'type':_0x2630('0x3')},'reason':{'type':_0x2630('0x1'),'required':![]}};exports[_0x2630('0x6')]={'module':{'type':_0x2630('0x1'),'required':![]}};exports[_0x2630('0x7')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0x8')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]},'filename':{'type':_0x2630('0x1')},'format':{'type':_0x2630('0x1')},'mixmonitorid':{'type':_0x2630('0x1')}};exports[_0x2630('0x9')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]}};exports[_0x2630('0xa')]={'uniqueid':{'type':_0x2630('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x3099=['queuepause','reload','voicechannel','voicequeuechannelredirect','string','number','boolean'];(function(_0x26f7da,_0xf1ba04){var _0x3acee1=function(_0x31b91a){while(--_0x31b91a){_0x26f7da['push'](_0x26f7da['shift']());}};_0x3acee1(++_0xf1ba04);}(_0x3099,0x193));var _0x9309=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3099[_0x321bb2];return _0x9c12ed;};'use strict';exports['queueadd']={'queue':{'type':_0x9309('0x0'),'required':!![]},'interface':{'type':_0x9309('0x0'),'required':!![]},'membername':{'type':_0x9309('0x0'),'required':!![]},'penalty':{'type':_0x9309('0x1'),'required':![]},'paused':{'type':_0x9309('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x9309('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x9309('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9309('0x2')},'reason':{'type':_0x9309('0x0'),'required':![]}};exports[_0x9309('0x4')]={'module':{'type':_0x9309('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x9309('0x0'),'required':!![]}};exports[_0x9309('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x9309('0x0')},'format':{'type':_0x9309('0x0')},'mixmonitorid':{'type':_0x9309('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x9309('0x0'),'required':!![]}};exports[_0x9309('0x6')]={'uniqueid':{'type':_0x9309('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x9309('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f5dabf1..5258bef 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x5ab970,_0x3753e6){var _0x523c3c=function(_0x19f73b){while(--_0x19f73b){_0x5ab970['push'](_0x5ab970['shift']());}};_0x523c3c(++_0x3753e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0xb10b[_0x32a81f];return _0x5b67a2;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x22f336,_0x481d0e){var _0x175fcc=function(_0xda74f2){while(--_0xda74f2){_0x22f336['push'](_0x22f336['shift']());}};_0x175fcc(++_0x481d0e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x334172,_0x419e41){_0x334172=_0x334172-0x0;var _0xbdbe2d=_0x5f2f[_0x334172];return _0xbdbe2d;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 477ad2d..4f3a535 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 _0x1e88=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x154a0a,_0x96977b){var _0x550392=function(_0xf5f946){while(--_0xf5f946){_0x154a0a['push'](_0x154a0a['shift']());}};_0x550392(++_0x96977b);}(_0x1e88,0x1c8));var _0x81e8=function(_0x3b1e7f,_0x2b62a1){_0x3b1e7f=_0x3b1e7f-0x0;var _0xd828ab=_0x1e88[_0x3b1e7f];return _0xd828ab;};'use strict';function mergeDBDataToRealtime(_0x121231,_0x11647e){var _0x55db52=Object[_0x81e8('0x0')]({},_0x121231);for(var _0x5375f1 in _0x11647e){if(_0x55db52[_0x81e8('0x1')](_0x5375f1)){_0x55db52[_0x5375f1]=_0x11647e[_0x5375f1];}}return _0x55db52;}exports[_0x81e8('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xb2e3=['assign'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xb2e3,0xbb));var _0x3b2e=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb2e3[_0x36c5b0];return _0xf19333;};'use strict';function mergeDBDataToRealtime(_0x598823,_0x6bb2f5){var _0x738775=Object[_0x3b2e('0x0')]({},_0x598823);for(var _0x24bbdb in _0x6bb2f5){if(_0x738775['hasOwnProperty'](_0x24bbdb)){_0x738775[_0x24bbdb]=_0x6bb2f5[_0x24bbdb];}}return _0x738775;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7c0ea43..acfb076 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 _0xd58d=['type','lastapplication','queue','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','connectedlinename','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','realtime','telephones','prototype','sync','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','voiceDialReport','attendedtransfer','findAgent','find','accountcode','name','isNil','agents','interface','format','length','connectedlinenum','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','destination','exten'];(function(_0x4214f2,_0x4e0d2c){var _0x5845f5=function(_0x440e74){while(--_0x440e74){_0x4214f2['push'](_0x4214f2['shift']());}};_0x5845f5(++_0x4e0d2c);}(_0xd58d,0x1ce));var _0xdd58=function(_0x5e1863,_0x2c131e){_0x5e1863=_0x5e1863-0x0;var _0x1a4fa5=_0xd58d[_0x5e1863];return _0x1a4fa5;};'use strict';var _=require(_0xdd58('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xdd58('0x1'));var ami=require(_0xdd58('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xdd58('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xdd58('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xdd58('0x5'));var VoiceQueueReport=require(_0xdd58('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xdd58('0x7'));var VoiceDialReport=require(_0xdd58('0x8'));var UserReport=require('./userReport');function Report(_0x3e52eb){this[_0xdd58('0x9')]=_0x3e52eb;this['agents']=_0x3e52eb['agents'];this['telephones']=_0x3e52eb[_0xdd58('0xa')];}Report[_0xdd58('0xb')][_0xdd58('0xc')]=function(_0x3c3579){var _0x3b202e=new VoiceQueueReport(this['realtime']);var _0x5ab74c=new VoiceAgentReport(this[_0xdd58('0x9')]);var _0x34375e=new VoiceDialReport(this['realtime']);var _0x4f3f58=new VoiceCallReport(this['realtime']);var _0x3ea66d=new UserReport(this[_0xdd58('0x9')]);if(config['xdr']&&config['xdr'][_0xdd58('0xd')]){ami['on'](_0xdd58('0xe'),this['voiceQueueReport'][_0xdd58('0xf')](this));ami['on'](_0xdd58('0x10'),this[_0xdd58('0x11')][_0xdd58('0xf')](this));ami['on']('custom:voiceAgentReport',this[_0xdd58('0x12')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xdd58('0x13')][_0xdd58('0xf')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0xdd58('0x14'),this['attendedTransfer'][_0xdd58('0xf')](this));}};Report[_0xdd58('0xb')][_0xdd58('0x15')]=function(_0x186f53){var _0x1745ff;_0x1745ff=_[_0xdd58('0x16')](this['agents'],function(_0x35edd3){return _0x35edd3[_0xdd58('0x17')]==_0x186f53||_0x35edd3[_0xdd58('0x18')]==_0x186f53;});if(_[_0xdd58('0x19')](_0x1745ff)){var _0x38e6b6=_[_0xdd58('0x16')](this[_0xdd58('0xa')],function(_0x4b87dc){return _0x4b87dc[_0xdd58('0x17')]==_0x186f53||_0x4b87dc[_0xdd58('0x18')]==_0x186f53;});if(_0x38e6b6){_0x1745ff=_[_0xdd58('0x16')](this[_0xdd58('0x1a')],function(_0x2831f1){return _0x2831f1[_0xdd58('0x1b')]==util[_0xdd58('0x1c')]('SIP/%s',_0x38e6b6[_0xdd58('0x18')]);});}}return _0x1745ff;};Report[_0xdd58('0xb')]['voiceQueueReport']=function(_0x40318a){for(var _0x1d8187=0x0;_0x1d8187<_0x40318a[_0xdd58('0x1d')];_0x1d8187+=0x1){var _0x9503f2=this[_0xdd58('0x15')](_0x40318a[_0x1d8187][_0xdd58('0x1e')]);if(_0x9503f2){_0x40318a[_0x1d8187]['accountcode']=_0x9503f2['accountcode'];_0x40318a[_0x1d8187]['assigned']=!![];_0x40318a[_0x1d8187]['lastAssignedTo']=_0x9503f2['name'];_0x40318a[_0x1d8187][_0xdd58('0x1b')]=_[_0xdd58('0x19')](_0x9503f2[_0xdd58('0x1b')])?util['format'](_0xdd58('0x1f'),_0x9503f2['name']):_0x9503f2[_0xdd58('0x1b')];if(_0x40318a[_0x1d8187][_0xdd58('0x20')]){_0x40318a[_0x1d8187][_0xdd58('0x21')]=moment()[_0xdd58('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x40318a[_0x1d8187][_0xdd58('0x22')]){_0x40318a[_0x1d8187][_0xdd58('0x23')]=moment()[_0xdd58('0x1c')](_0xdd58('0x24'));}RpcMemberReport[_0xdd58('0x25')](_0x40318a[_0x1d8187]);}RpcVoiceQueueReport[_0xdd58('0x26')](_0x40318a[_0x1d8187]);}};function extractCalleridNumber(_0x58bca0){var _0x3f9369=_0x58bca0[_0xdd58('0x27')](/<(.*?)>/);return _0x3f9369?_0x3f9369[0x1]:_0x58bca0;}Report[_0xdd58('0xb')][_0xdd58('0x28')]=function(_0x168761){for(var _0x2f436d=0x0;_0x2f436d','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','isNil','UserId','membername','monitor','monitors','monitorFilename','createdAt','xcally-motion-dialer','isArray','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer'];(function(_0x2d70fc,_0x38f3ac){var _0x396320=function(_0x226a5e){while(--_0x226a5e){_0x2d70fc['push'](_0x2d70fc['shift']());}};_0x396320(++_0x38f3ac);}(_0x7345,0x1b4));var _0x5734=function(_0x463cb1,_0x3cdf51){_0x463cb1=_0x463cb1-0x0;var _0xa6fea8=_0x7345[_0x463cb1];return _0xa6fea8;};'use strict';var _=require(_0x5734('0x0'));var moment=require(_0x5734('0x1'));var util=require(_0x5734('0x2'));var config=require(_0x5734('0x3'));var ami=require(_0x5734('0x4'));var RpcVoiceAgentReport=require(_0x5734('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x5734('0x6'));var RpcMemberReport=require(_0x5734('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x5734('0x8'));var RpcVoiceTransferReport=require(_0x5734('0x9'));var VoiceQueueReport=require(_0x5734('0xa'));var VoiceCallReport=require(_0x5734('0xb'));var VoiceAgentReport=require(_0x5734('0xc'));var VoiceDialReport=require(_0x5734('0xd'));var UserReport=require('./userReport');function Report(_0x21309d){this['realtime']=_0x21309d;this['agents']=_0x21309d[_0x5734('0xe')];this[_0x5734('0xf')]=_0x21309d['telephones'];}Report[_0x5734('0x10')]['sync']=function(_0x587165){var _0x2b1683=new VoiceQueueReport(this[_0x5734('0x11')]);var _0x102a93=new VoiceAgentReport(this[_0x5734('0x11')]);var _0x15a5d8=new VoiceDialReport(this[_0x5734('0x11')]);var _0x256ae8=new VoiceCallReport(this['realtime']);var _0x4cd6c0=new UserReport(this[_0x5734('0x11')]);if(config['xdr']&&config[_0x5734('0x12')][_0x5734('0x13')]){ami['on'](_0x5734('0x14'),this[_0x5734('0x15')][_0x5734('0x16')](this));ami['on'](_0x5734('0x17'),this[_0x5734('0x18')][_0x5734('0x16')](this));ami['on'](_0x5734('0x19'),this['voiceAgentReport']['bind'](this));ami['on'](_0x5734('0x1a'),this[_0x5734('0x1b')]['bind'](this));ami['on'](_0x5734('0x1c'),this['blindTransfer'][_0x5734('0x16')](this));ami['on'](_0x5734('0x1d'),this['attendedTransfer'][_0x5734('0x16')](this));}};Report[_0x5734('0x10')][_0x5734('0x1e')]=function(_0x11ce22){var _0x1bdf8a;_0x1bdf8a=_['find'](this[_0x5734('0xe')],function(_0x420461){return _0x420461[_0x5734('0x1f')]==_0x11ce22||_0x420461[_0x5734('0x20')]==_0x11ce22;});if(_['isNil'](_0x1bdf8a)){var _0x17bb53=_['find'](this[_0x5734('0xf')],function(_0x18877c){return _0x18877c['accountcode']==_0x11ce22||_0x18877c['name']==_0x11ce22;});if(_0x17bb53){_0x1bdf8a=_[_0x5734('0x21')](this['agents'],function(_0x5f984b){return _0x5f984b[_0x5734('0x22')]==util['format'](_0x5734('0x23'),_0x17bb53[_0x5734('0x20')]);});}}return _0x1bdf8a;};Report['prototype'][_0x5734('0x15')]=function(_0x364ded){for(var _0x186415=0x0;_0x186415<_0x364ded[_0x5734('0x24')];_0x186415+=0x1){var _0x2813e0=this[_0x5734('0x1e')](_0x364ded[_0x186415][_0x5734('0x25')]);if(_0x2813e0){_0x364ded[_0x186415]['accountcode']=_0x2813e0[_0x5734('0x1f')];_0x364ded[_0x186415][_0x5734('0x26')]=!![];_0x364ded[_0x186415]['lastAssignedTo']=_0x2813e0[_0x5734('0x20')];_0x364ded[_0x186415]['interface']=_['isNil'](_0x2813e0['interface'])?util[_0x5734('0x27')](_0x5734('0x23'),_0x2813e0[_0x5734('0x20')]):_0x2813e0[_0x5734('0x22')];if(_0x364ded[_0x186415]['queuecallercomplete']){_0x364ded[_0x186415][_0x5734('0x28')]=moment()[_0x5734('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x364ded[_0x186415][_0x5734('0x29')]){_0x364ded[_0x186415][_0x5734('0x2a')]=moment()[_0x5734('0x27')](_0x5734('0x2b'));}RpcMemberReport[_0x5734('0x15')](_0x364ded[_0x186415]);}RpcVoiceQueueReport[_0x5734('0x2c')](_0x364ded[_0x186415]);}};function extractCalleridNumber(_0x32deeb){var _0xd5254f=_0x32deeb[_0x5734('0x2d')](/<(.*?)>/);return _0xd5254f?_0xd5254f[0x1]:_0x32deeb;}Report['prototype'][_0x5734('0x2e')]=function(_0x3ed988){for(var _0x5d50da=0x0;_0x5d50da0x0?!![]:![];if(!_0x63e6d8){return this[_0xf5d5('0x18')](this[_0xf5d5('0x44')][_0xf5d5('0x6c')]);}};VoiceQueueReport['prototype'][_0xf5d5('0x1a')]=function(_0x99384){var _0x4f01a0=this[_0xf5d5('0x44')]['id'];if(this['summary'][_0xf5d5('0x62')][_0x4f01a0]&&this[_0xf5d5('0x44')][_0xf5d5('0x62')][_0x4f01a0][_0x99384['actionid']]){this['summary'][_0xf5d5('0x62')][_0x4f01a0][_0x99384[_0xf5d5('0x61')]][_0xf5d5('0x10')]['push'](_0x99384);}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x16')]=function(_0x2e5c08){var _0x55f76c=this;try{if(this[_0xf5d5('0x6d')](_0x2e5c08)&&this[_0xf5d5('0x6d')](_0x2e5c08[_0xf5d5('0x4e')])){logger[_0xf5d5('0x48')](_0xf5d5('0x6e'),util[_0xf5d5('0x3d')](_0x2e5c08,{'showHidden':![],'depth':null}));var _0x135753=this[_0xf5d5('0x12')][_0x2e5c08[_0xf5d5('0x4e')]];if(_0x135753){logger[_0xf5d5('0x6f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x135753[_0xf5d5('0x58')]);this['summary'][_0xf5d5('0x5d')][_0x135753[_0xf5d5('0x58')]]={'summaryEvent':_0x2e5c08};this[_0xf5d5('0x44')]['statusRequests']+=0x1;return ami['Action']({'action':_0xf5d5('0x62'),'queue':_0x135753[_0xf5d5('0x58')]})[_0xf5d5('0x60')](function(_0x4789aa){if(!_0x55f76c[_0xf5d5('0x44')][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]]){_0x55f76c['summary'][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]]={};}_0x55f76c['summary'][_0xf5d5('0x62')][_0x2e5c08[_0xf5d5('0x61')]][_0x4789aa[_0xf5d5('0x61')]]={'queue':_0x135753['name'],'agents':[]};})[_0xf5d5('0x3a')](function(_0x40befd){throw _0x40befd;});}}}catch(_0x5f5241){logger[_0xf5d5('0x3f')](_0xf5d5('0x70'),util[_0xf5d5('0x3d')](_0x5f5241,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x18')]=function(_0x5ac29f){if(this[_0xf5d5('0x44')][_0xf5d5('0x6b')]>0x0){this[_0xf5d5('0x44')][_0xf5d5('0x6c')]=_0x5ac29f;return;}logger['debug'](_0xf5d5('0x71'),util[_0xf5d5('0x3d')](_0x5ac29f,{'showHidden':![],'depth':null}));this[_0xf5d5('0x44')]=initializeSummary();ami[_0xf5d5('0x47')](_0xf5d5('0x72'),{});};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x1e')]=function(_0x53017c){try{if(this[_0xf5d5('0x6d')](_0x53017c)){logger[_0xf5d5('0x48')](_0xf5d5('0x73'),_0x53017c[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x53017c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x53017c[_0xf5d5('0x4b')]])){this['queueReports'][_0x53017c['uniqueid']]=[];}if(_[_0xf5d5('0x5a')](this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]])){this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]]={};}var _0x599dee=new QueueReport();_0x599dee['queue']=_0x53017c[_0xf5d5('0x4e')];_0x599dee['type']=this[_0xf5d5('0x12')][_0x599dee[_0xf5d5('0x4e')]]&&this[_0xf5d5('0x12')][_0x599dee[_0xf5d5('0x4e')]][_0xf5d5('0x55')]?this['voiceQueues'][_0x599dee[_0xf5d5('0x4e')]][_0xf5d5('0x55')]||_0xf5d5('0x56'):_0xf5d5('0x56');_0x599dee[_0xf5d5('0x74')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x599dee['position']=_0x53017c[_0xf5d5('0x76')];_0x599dee[_0xf5d5('0x77')]=_0x53017c[_0xf5d5('0x77')];_0x599dee['uniqueid']=_0x53017c['uniqueid'];_0x599dee[_0xf5d5('0x78')]=this['channels'][_0x53017c[_0xf5d5('0x4b')]]['routealias'];logger['info'](_0xf5d5('0x79'),_0x599dee[_0xf5d5('0x4e')],_0x599dee[_0xf5d5('0x55')]);_[_0xf5d5('0x7a')](_0x599dee,_['pick'](_0x53017c,_[_0xf5d5('0x7b')](_0x599dee)));this[_0xf5d5('0x3e')][_0x53017c[_0xf5d5('0x4b')]][_0xf5d5('0x7c')](_0x599dee);this[_0xf5d5('0x11')][_0x53017c[_0xf5d5('0x4b')]]=_0x599dee;this[_0xf5d5('0x7d')](_0x599dee,'queuecallerjoin');}}catch(_0x540b78){logger[_0xf5d5('0x3f')](_0xf5d5('0x73'),_0x53017c[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x540b78,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncQueueCallerAbandon']=function(_0x406888){try{if(this['isNotNull'](_0x406888)){logger['debug'](_0xf5d5('0x7e'),_0x406888[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x406888,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x406888[_0xf5d5('0x4b')]]){var _0x1f2bdd=_['last'](this[_0xf5d5('0x3e')][_0x406888[_0xf5d5('0x4b')]]);_0x1f2bdd[_0xf5d5('0x7f')]=![];_0x1f2bdd[_0xf5d5('0x80')]=null;_0x1f2bdd[_0xf5d5('0x81')]=_0x406888[_0xf5d5('0x81')];_0x1f2bdd[_0xf5d5('0x82')]=_0x406888[_0xf5d5('0x82')];_0x1f2bdd[_0xf5d5('0x83')]=!![];_0x1f2bdd[_0xf5d5('0x84')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x1f2bdd[_0xf5d5('0x85')]='ABANDONED';_0x1f2bdd[_0xf5d5('0x86')]=null;logger[_0xf5d5('0x6f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1f2bdd[_0xf5d5('0x4e')],_0x1f2bdd[_0xf5d5('0x55')]);this[_0xf5d5('0x11')][_0x406888['uniqueid']]=_0x1f2bdd;this[_0xf5d5('0x46')](_0x1f2bdd,_0xf5d5('0x83'));}}}catch(_0x303a81){logger['error'](_0xf5d5('0x7e'),_0x406888['uniqueid'],util['inspect'](_0x303a81,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0x21')]=function(_0x18250f){try{if(this['isNotNull'](_0x18250f)){logger[_0xf5d5('0x48')](_0xf5d5('0x87'),_0x18250f['uniqueid'],util[_0xf5d5('0x3d')](_0x18250f,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x18250f['uniqueid']]){var _0x1e7d64=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x18250f[_0xf5d5('0x4b')]]);_0x1e7d64[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));_0x1e7d64[_0xf5d5('0x8a')]=_0x18250f[_0xf5d5('0x8a')];_0x1e7d64[_0xf5d5('0x8b')]=_0x18250f['connectedlinename'];logger[_0xf5d5('0x6f')](_0xf5d5('0x8c'),_0x1e7d64[_0xf5d5('0x4e')],_0x1e7d64[_0xf5d5('0x55')],_0x18250f[_0xf5d5('0x8a')],_0x18250f['connectedlinename']);this[_0xf5d5('0x11')][_0x18250f[_0xf5d5('0x4b')]]=_0x1e7d64;this[_0xf5d5('0x7d')](_0x1e7d64,_0xf5d5('0x20'));}}}catch(_0x4ceec9){logger[_0xf5d5('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x18250f[_0xf5d5('0x4b')],util['inspect'](_0x4ceec9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncAgentConnect']=function(_0x22947d){try{if(this[_0xf5d5('0x6d')](_0x22947d)){logger[_0xf5d5('0x48')](_0xf5d5('0x8d'),_0x22947d[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x22947d,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x22947d[_0xf5d5('0x4b')]]){var _0x38bc2e=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x22947d[_0xf5d5('0x4b')]]);_0x38bc2e[_0xf5d5('0x7f')]=!![];_0x38bc2e[_0xf5d5('0x85')]=_0xf5d5('0x8e');logger[_0xf5d5('0x6f')](_0xf5d5('0x8f'),_0x38bc2e['queue'],_0x38bc2e[_0xf5d5('0x55')]);}}}catch(_0x179a69){logger['error'](_0xf5d5('0x8d'),_0x22947d['uniqueid'],util['inspect'](_0x179a69,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncAgentComplete']=function(_0x59c1e9){try{if(this[_0xf5d5('0x6d')](_0x59c1e9)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x59c1e9[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x59c1e9,{'showHidden':![],'depth':null}));if(this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]){var _0x2bf6c8=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]);_0x2bf6c8['queuecallerabandon']=![];_0x2bf6c8[_0xf5d5('0x84')]=null;_0x2bf6c8['assigned']=!![];_0x2bf6c8[_0xf5d5('0x86')]=_0x59c1e9['membername'];_0x2bf6c8[_0xf5d5('0x81')]=_0x59c1e9[_0xf5d5('0x81')];_0x2bf6c8[_0xf5d5('0x7f')]=!![];_0x2bf6c8['queuecallerexit']=![];_0x2bf6c8['queuecallerexitAt']=null;if(!_0x2bf6c8[_0xf5d5('0x90')]){if(_0x59c1e9['reason']=='transfer'){_0x2bf6c8[_0xf5d5('0x85')]=_0xf5d5('0x91');logger[_0xf5d5('0x6f')](_0xf5d5('0x92'),_0x2bf6c8[_0xf5d5('0x4e')],_0x2bf6c8[_0xf5d5('0x55')]);}else{if(_[_0xf5d5('0x93')](_0x59c1e9['channel']['toLowerCase'](),_0xf5d5('0x94'))){if(this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x95')]]){var _0x46aea8=_['last'](this['queueReports'][_0x59c1e9[_0xf5d5('0x95')]]);_0x46aea8['queuecallercomplete']=![];_0x46aea8[_0xf5d5('0x96')]=!![];_0x46aea8[_0xf5d5('0x97')]=moment(_0x2bf6c8[_0xf5d5('0x74')])[_0xf5d5('0x98')](_0x59c1e9[_0xf5d5('0x81')],_0xf5d5('0x99'))['format'](_0xf5d5('0x75'));_0x46aea8[_0xf5d5('0x85')]=_0xf5d5('0x9a');_0x46aea8[_0xf5d5('0x90')]=!![];_0x46aea8[_0xf5d5('0x9b')]='FORWARD';_0x46aea8['transferexten']=_0x59c1e9[_0xf5d5('0x9c')];_0x46aea8[_0xf5d5('0x9d')]=_0x59c1e9[_0xf5d5('0x4b')];logger[_0xf5d5('0x6f')](_0xf5d5('0x9e'),_0x46aea8[_0xf5d5('0x4e')],_0x46aea8[_0xf5d5('0x55')]);var _0x5a7eba=this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x95')]];this[_0xf5d5('0x3e')][_0x59c1e9['linkedid']]=this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]];this[_0xf5d5('0x3e')][_0x59c1e9[_0xf5d5('0x4b')]]=_0x5a7eba;}}else{_0x2bf6c8['queuecallerexitreason']=_0xf5d5('0x9f')+_0x59c1e9[_0xf5d5('0xa0')][_0xf5d5('0xa1')]();logger['info'](_0xf5d5('0xa2'),_0x2bf6c8[_0xf5d5('0x4e')],_0x2bf6c8[_0xf5d5('0x55')],_0x2bf6c8[_0xf5d5('0x85')]);}}}this['channels'][_0x59c1e9[_0xf5d5('0x4b')]]=_0x2bf6c8;this[_0xf5d5('0x46')](_0x2bf6c8,_0xf5d5('0x22'));}}}catch(_0x745ce5){logger[_0xf5d5('0x3f')](_0xf5d5('0xa3'),_0x59c1e9[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x745ce5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')]['syncVarSet']=function(_0x30f70e){try{if(this['isNotNull'](_0x30f70e)){logger[_0xf5d5('0x48')](_0xf5d5('0xa4'),_0x30f70e['uniqueid'],util['inspect'](_0x30f70e,{'showHidden':![],'depth':null}));this[_0xf5d5('0xa5')](_0x30f70e[_0xf5d5('0x4b')],_[_0xf5d5('0x7b')](_0x30f70e[_0xf5d5('0xa6')])[0x0],_0x30f70e[_0xf5d5('0xa7')]);if(this[_0xf5d5('0x3e')][_0x30f70e[_0xf5d5('0x4b')]]){var _0x273dd0=_[_0xf5d5('0x88')](this[_0xf5d5('0x3e')][_0x30f70e['uniqueid']]);if(_0x273dd0){if(this[_0xf5d5('0x6d')](_0x30f70e[_0xf5d5('0xa6')])&&this['isNotNull'](_0x30f70e[_0xf5d5('0xa6')][_0xf5d5('0x62')])){switch(_0x30f70e[_0xf5d5('0xa7')]){case _0xf5d5('0xa8'):_0x273dd0[_0xf5d5('0x96')]=![];_0x273dd0[_0xf5d5('0x97')]=null;break;case _0xf5d5('0xa9'):_0x273dd0['lastevent']=_0xf5d5('0xaa');_0x273dd0[_0xf5d5('0x96')]=!![];_0x273dd0[_0xf5d5('0x97')]=moment()[_0xf5d5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x273dd0['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xf5d5('0x48')](_0xf5d5('0xab'),_0x30f70e[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x273dd0,{'showHidden':![],'depth':null}));ami[_0xf5d5('0x47')](_0xf5d5('0xac'),_0x273dd0);break;default:_0x273dd0[_0xf5d5('0x96')]=!![];_0x273dd0['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x273dd0[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')](_0xf5d5('0x75'));}_0x273dd0[_0xf5d5('0x83')]=![];_0x273dd0[_0xf5d5('0x84')]=null;_0x273dd0['queuecallerexitreason']=_0x30f70e['value'];this['channels'][_0x30f70e[_0xf5d5('0x4b')]]=_0x273dd0;this[_0xf5d5('0x46')](_0x273dd0,_0xf5d5('0xad'));}else if(this[_0xf5d5('0x6d')](_0x30f70e[_0xf5d5('0xa6')])&&this[_0xf5d5('0x6d')](_0x30f70e['variable'][_0xf5d5('0xae')])){if(!_0x273dd0[_0xf5d5('0x83')]){_0x273dd0['queuecallerexit']=!![];_0x273dd0[_0xf5d5('0x97')]=moment()['format'](_0xf5d5('0x75'));_0x273dd0[_0xf5d5('0x85')]=_0xf5d5('0xaf');_0x273dd0[_0xf5d5('0x89')]=moment()[_0xf5d5('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30f70e[_0xf5d5('0x4b')]]=_0x273dd0;}}logger[_0xf5d5('0x6f')](_0xf5d5('0xb0'),_0x30f70e['uniqueid'],_0x273dd0[_0xf5d5('0x4e')],_0x273dd0[_0xf5d5('0x55')],_[_0xf5d5('0x7b')](_0x30f70e[_0xf5d5('0xa6')])[0x0],_0x30f70e[_0xf5d5('0xa7')]);_0x273dd0['variables']=this[_0xf5d5('0x14')][_0x30f70e[_0xf5d5('0x4b')]];}}}}catch(_0x393d4d){logger[_0xf5d5('0x3f')](_0xf5d5('0xa4'),_0x30f70e[_0xf5d5('0x4b')],util[_0xf5d5('0x3d')](_0x393d4d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0xa5')]=function(_0x54f174,_0x4192de,_0x27f2df){var _0x32dc0a=[_0xf5d5('0xb1'),_0xf5d5('0xb2'),_0xf5d5('0xb3'),_0xf5d5('0xb4'),_0xf5d5('0xb5'),'rtpaudioqoslossbridged',_0xf5d5('0xb6'),'rtpaudioqosrttbridged','sipcallid',_0xf5d5('0xb7'),_0xf5d5('0xb8'),_0xf5d5('0xb9'),_0xf5d5('0xba'),_0xf5d5('0xbb'),_0xf5d5('0xbc'),_0xf5d5('0xbd'),_0xf5d5('0xbe'),'memberpenalty',_0xf5d5('0xbf')];if(!_[_0xf5d5('0xc0')](_0x4192de)&&!_[_0xf5d5('0xc1')](_0x32dc0a,_0x4192de)){if(_[_0xf5d5('0x5a')](this[_0xf5d5('0x14')][_0x54f174])){this[_0xf5d5('0x14')][_0x54f174]={};}this['variables'][_0x54f174][_0x4192de]=_0x27f2df;}};VoiceQueueReport[_0xf5d5('0xc')][_0xf5d5('0xc2')]=function(_0x39bae0,_0x302aed,_0x2796c7){var _0x4a0341={};for(var _0x2d7d77=0x0;_0x2d7d770x0?!![]:![];if(!_0x407382){return this['syncQueueSummaryComplete'](this[_0x3fe0('0x18')]['completeEvent']);}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x71')]=function(_0x13e08c){var _0x2b629c=this[_0x3fe0('0x18')]['id'];if(this[_0x3fe0('0x18')][_0x3fe0('0x66')][_0x2b629c]&&this[_0x3fe0('0x18')][_0x3fe0('0x66')][_0x2b629c][_0x13e08c[_0x3fe0('0x65')]]){this[_0x3fe0('0x18')]['queuestatus'][_0x2b629c][_0x13e08c[_0x3fe0('0x65')]][_0x3fe0('0x13')][_0x3fe0('0x72')](_0x13e08c);}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x73')]=function(_0x35426e){var _0x82c4e=this;try{if(this[_0x3fe0('0x74')](_0x35426e)&&this['isNotNull'](_0x35426e['queue'])){logger[_0x3fe0('0x4c')](_0x3fe0('0x75'),util[_0x3fe0('0x44')](_0x35426e,{'showHidden':![],'depth':null}));var _0x2ff152=this['voiceQueues'][_0x35426e['queue']];if(_0x2ff152){logger[_0x3fe0('0x76')](_0x3fe0('0x77'),_0x2ff152[_0x3fe0('0x5d')]);this[_0x3fe0('0x18')][_0x3fe0('0x60')][_0x2ff152['name']]={'summaryEvent':_0x35426e};this['summary'][_0x3fe0('0x70')]+=0x1;return ami[_0x3fe0('0x63')]({'action':_0x3fe0('0x66'),'queue':_0x2ff152[_0x3fe0('0x5d')]})[_0x3fe0('0x64')](function(_0x552d68){if(!_0x82c4e[_0x3fe0('0x18')][_0x3fe0('0x66')][_0x35426e[_0x3fe0('0x65')]]){_0x82c4e[_0x3fe0('0x18')][_0x3fe0('0x66')][_0x35426e['actionid']]={};}_0x82c4e[_0x3fe0('0x18')][_0x3fe0('0x66')][_0x35426e[_0x3fe0('0x65')]][_0x552d68['actionid']]={'queue':_0x2ff152['name'],'agents':[]};})[_0x3fe0('0x3f')](function(_0x5c63d7){throw _0x5c63d7;});}}}catch(_0x2e27e7){logger[_0x3fe0('0x42')](_0x3fe0('0x67'),util[_0x3fe0('0x44')](_0x2e27e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x1b')]=function(_0x138fec){if(this[_0x3fe0('0x18')][_0x3fe0('0x70')]>0x0){this['summary']['completeEvent']=_0x138fec;return;}logger[_0x3fe0('0x4c')](_0x3fe0('0x78'),util['inspect'](_0x138fec,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x3fe0('0x4a')](_0x3fe0('0x79'),{});};VoiceQueueReport['prototype'][_0x3fe0('0x20')]=function(_0x90b7a2){try{if(this['isNotNull'](_0x90b7a2)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x90b7a2[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x90b7a2,{'showHidden':![],'depth':null}));if(_[_0x3fe0('0x5f')](this[_0x3fe0('0x11')][_0x90b7a2[_0x3fe0('0x4f')]])){this['queueReports'][_0x90b7a2[_0x3fe0('0x4f')]]=[];}if(_[_0x3fe0('0x5f')](this['channels'][_0x90b7a2['uniqueid']])){this[_0x3fe0('0x14')][_0x90b7a2[_0x3fe0('0x4f')]]={};}var _0x3f3a05=new QueueReport();_0x3f3a05['queue']=_0x90b7a2[_0x3fe0('0x57')];_0x3f3a05[_0x3fe0('0x5b')]=this[_0x3fe0('0x16')][_0x3f3a05[_0x3fe0('0x57')]]&&this[_0x3fe0('0x16')][_0x3f3a05[_0x3fe0('0x57')]][_0x3fe0('0x5b')]?this[_0x3fe0('0x16')][_0x3f3a05['queue']]['type']||_0x3fe0('0x5c'):_0x3fe0('0x5c');_0x3f3a05['queuecallerjoinAt']=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));_0x3f3a05['position']=_0x90b7a2[_0x3fe0('0x7b')];_0x3f3a05[_0x3fe0('0x7c')]=_0x90b7a2[_0x3fe0('0x7c')];_0x3f3a05[_0x3fe0('0x4f')]=_0x90b7a2['uniqueid'];_0x3f3a05['routealias']=this['channels'][_0x90b7a2[_0x3fe0('0x4f')]][_0x3fe0('0x7d')];logger[_0x3fe0('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x3f3a05[_0x3fe0('0x57')],_0x3f3a05[_0x3fe0('0x5b')]);_[_0x3fe0('0x7e')](_0x3f3a05,_[_0x3fe0('0x7f')](_0x90b7a2,_[_0x3fe0('0x80')](_0x3f3a05)));this[_0x3fe0('0x11')][_0x90b7a2[_0x3fe0('0x4f')]][_0x3fe0('0x72')](_0x3f3a05);this['channels'][_0x90b7a2[_0x3fe0('0x4f')]]=_0x3f3a05;this['emitVoiceQueueChannelSave'](_0x3f3a05,_0x3fe0('0x81'));}}catch(_0x848de4){logger[_0x3fe0('0x42')](_0x3fe0('0x82'),_0x90b7a2[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x848de4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x83')]=function(_0x3b5c8c){try{if(this[_0x3fe0('0x74')](_0x3b5c8c)){logger[_0x3fe0('0x4c')](_0x3fe0('0x84'),_0x3b5c8c[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x3b5c8c,{'showHidden':![],'depth':null}));if(this[_0x3fe0('0x11')][_0x3b5c8c[_0x3fe0('0x4f')]]){var _0x3cafc8=_['last'](this[_0x3fe0('0x11')][_0x3b5c8c[_0x3fe0('0x4f')]]);_0x3cafc8[_0x3fe0('0x85')]=![];_0x3cafc8[_0x3fe0('0x86')]=null;_0x3cafc8[_0x3fe0('0x87')]=_0x3b5c8c[_0x3fe0('0x87')];_0x3cafc8[_0x3fe0('0x88')]=_0x3b5c8c['originalposition'];_0x3cafc8[_0x3fe0('0x21')]=!![];_0x3cafc8[_0x3fe0('0x89')]=moment()[_0x3fe0('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cafc8['queuecallerexitreason']=_0x3fe0('0x8a');_0x3cafc8['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3cafc8[_0x3fe0('0x57')],_0x3cafc8[_0x3fe0('0x5b')]);this[_0x3fe0('0x14')][_0x3b5c8c[_0x3fe0('0x4f')]]=_0x3cafc8;this[_0x3fe0('0x48')](_0x3cafc8,'queuecallerabandon');}}}catch(_0x261d14){logger[_0x3fe0('0x42')](_0x3fe0('0x84'),_0x3b5c8c['uniqueid'],util[_0x3fe0('0x44')](_0x261d14,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')]['syncQueueCallerLeave']=function(_0x1b1ab4){try{if(this['isNotNull'](_0x1b1ab4)){logger[_0x3fe0('0x4c')]('[%s][voiceQueueReport][queuecallerleave]',_0x1b1ab4[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x1b1ab4,{'showHidden':![],'depth':null}));if(this[_0x3fe0('0x11')][_0x1b1ab4[_0x3fe0('0x4f')]]){var _0xc186eb=_[_0x3fe0('0x8b')](this[_0x3fe0('0x11')][_0x1b1ab4[_0x3fe0('0x4f')]]);_0xc186eb['queuecallerleaveAt']=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));_0xc186eb[_0x3fe0('0x8c')]=_0x1b1ab4[_0x3fe0('0x8c')];_0xc186eb['connectedlinename']=_0x1b1ab4['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xc186eb[_0x3fe0('0x57')],_0xc186eb['type'],_0x1b1ab4['connectedlinenum'],_0x1b1ab4[_0x3fe0('0x8d')]);this[_0x3fe0('0x14')][_0x1b1ab4[_0x3fe0('0x4f')]]=_0xc186eb;this[_0x3fe0('0x4b')](_0xc186eb,'queuecallerleave');}}}catch(_0x1cb1e1){logger[_0x3fe0('0x42')](_0x3fe0('0x8e'),_0x1b1ab4[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x1cb1e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x8f')]=function(_0x3caa5e){try{if(this[_0x3fe0('0x74')](_0x3caa5e)){logger[_0x3fe0('0x4c')](_0x3fe0('0x90'),_0x3caa5e[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x3caa5e,{'showHidden':![],'depth':null}));if(this[_0x3fe0('0x11')][_0x3caa5e[_0x3fe0('0x4f')]]){var _0x57e2bd=_[_0x3fe0('0x8b')](this[_0x3fe0('0x11')][_0x3caa5e[_0x3fe0('0x4f')]]);_0x57e2bd[_0x3fe0('0x85')]=!![];_0x57e2bd[_0x3fe0('0x55')]=_0x3fe0('0x91');logger[_0x3fe0('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x57e2bd[_0x3fe0('0x57')],_0x57e2bd[_0x3fe0('0x5b')]);}}}catch(_0x3c964a){logger[_0x3fe0('0x42')]('[%s][voiceQueueReport][agentconnect]',_0x3caa5e['uniqueid'],util[_0x3fe0('0x44')](_0x3c964a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x24')]=function(_0x14a9cc){try{if(this['isNotNull'](_0x14a9cc)){logger[_0x3fe0('0x4c')](_0x3fe0('0x92'),_0x14a9cc[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x14a9cc,{'showHidden':![],'depth':null}));if(this[_0x3fe0('0x11')][_0x14a9cc[_0x3fe0('0x4f')]]){var _0x2da6d0=_['last'](this[_0x3fe0('0x11')][_0x14a9cc[_0x3fe0('0x4f')]]);_0x2da6d0['queuecallerabandon']=![];_0x2da6d0[_0x3fe0('0x89')]=null;_0x2da6d0[_0x3fe0('0x93')]=!![];_0x2da6d0[_0x3fe0('0x94')]=_0x14a9cc['membername'];_0x2da6d0[_0x3fe0('0x87')]=_0x14a9cc['holdtime'];_0x2da6d0[_0x3fe0('0x85')]=!![];_0x2da6d0[_0x3fe0('0x95')]=![];_0x2da6d0[_0x3fe0('0x96')]=null;if(!_0x2da6d0[_0x3fe0('0x97')]){if(_0x14a9cc[_0x3fe0('0x98')]=='transfer'){_0x2da6d0[_0x3fe0('0x55')]=_0x3fe0('0x99');logger[_0x3fe0('0x76')](_0x3fe0('0x9a'),_0x2da6d0[_0x3fe0('0x57')],_0x2da6d0[_0x3fe0('0x5b')]);}else{if(_[_0x3fe0('0x9b')](_0x14a9cc['channel'][_0x3fe0('0x9c')](),_0x3fe0('0x9d'))){if(this[_0x3fe0('0x11')][_0x14a9cc[_0x3fe0('0x9e')]]){var _0x47366e=_[_0x3fe0('0x8b')](this[_0x3fe0('0x11')][_0x14a9cc['linkedid']]);_0x47366e[_0x3fe0('0x85')]=![];_0x47366e[_0x3fe0('0x95')]=!![];_0x47366e[_0x3fe0('0x96')]=moment(_0x2da6d0[_0x3fe0('0x9f')])[_0x3fe0('0xa0')](_0x14a9cc[_0x3fe0('0x87')],_0x3fe0('0xa1'))[_0x3fe0('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x47366e[_0x3fe0('0x55')]=_0x3fe0('0xa2');_0x47366e[_0x3fe0('0x97')]=!![];_0x47366e[_0x3fe0('0xa3')]='FORWARD';_0x47366e[_0x3fe0('0xa4')]=_0x14a9cc[_0x3fe0('0xa5')];_0x47366e[_0x3fe0('0xa6')]=_0x14a9cc[_0x3fe0('0x4f')];logger[_0x3fe0('0x76')](_0x3fe0('0xa7'),_0x47366e[_0x3fe0('0x57')],_0x47366e[_0x3fe0('0x5b')]);var _0x3d3507=this[_0x3fe0('0x11')][_0x14a9cc[_0x3fe0('0x9e')]];this['queueReports'][_0x14a9cc[_0x3fe0('0x9e')]]=this['queueReports'][_0x14a9cc[_0x3fe0('0x4f')]];this['queueReports'][_0x14a9cc[_0x3fe0('0x4f')]]=_0x3d3507;}}else{_0x2da6d0[_0x3fe0('0x55')]=_0x3fe0('0xa8')+_0x14a9cc[_0x3fe0('0x98')]['toUpperCase']();logger[_0x3fe0('0x76')](_0x3fe0('0xa9'),_0x2da6d0['queue'],_0x2da6d0[_0x3fe0('0x5b')],_0x2da6d0[_0x3fe0('0x55')]);}}}this['channels'][_0x14a9cc['uniqueid']]=_0x2da6d0;this['emitVoiceQueueChannelRemove'](_0x2da6d0,_0x3fe0('0x23'));}}}catch(_0x1b4b66){logger[_0x3fe0('0x42')](_0x3fe0('0x92'),_0x14a9cc[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x1b4b66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0x27')]=function(_0x46474e){try{if(this[_0x3fe0('0x74')](_0x46474e)){logger[_0x3fe0('0x4c')]('[%s][voiceQueueReport][varset]',_0x46474e['uniqueid'],util['inspect'](_0x46474e,{'showHidden':![],'depth':null}));this[_0x3fe0('0xaa')](_0x46474e['uniqueid'],_[_0x3fe0('0x80')](_0x46474e[_0x3fe0('0xab')])[0x0],_0x46474e['value']);if(this['queueReports'][_0x46474e[_0x3fe0('0x4f')]]){var _0x4abfe0=_[_0x3fe0('0x8b')](this[_0x3fe0('0x11')][_0x46474e[_0x3fe0('0x4f')]]);if(_0x4abfe0){if(this[_0x3fe0('0x74')](_0x46474e[_0x3fe0('0xab')])&&this['isNotNull'](_0x46474e['variable']['queuestatus'])){switch(_0x46474e[_0x3fe0('0xac')]){case _0x3fe0('0xad'):_0x4abfe0[_0x3fe0('0x95')]=![];_0x4abfe0['queuecallerexitAt']=null;break;case'TIMEOUT':_0x4abfe0[_0x3fe0('0xae')]=_0x3fe0('0xaf');_0x4abfe0['queuecallerexit']=!![];_0x4abfe0['queuecallerexitAt']=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));_0x4abfe0[_0x3fe0('0xb0')]=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));logger[_0x3fe0('0x4c')](_0x3fe0('0xb1'),_0x46474e['uniqueid'],util[_0x3fe0('0x44')](_0x4abfe0,{'showHidden':![],'depth':null}));ami[_0x3fe0('0x4a')](_0x3fe0('0xb2'),_0x4abfe0);break;default:_0x4abfe0['queuecallerexit']=!![];_0x4abfe0[_0x3fe0('0x96')]=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));_0x4abfe0[_0x3fe0('0xb0')]=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));}_0x4abfe0[_0x3fe0('0x21')]=![];_0x4abfe0[_0x3fe0('0x89')]=null;_0x4abfe0[_0x3fe0('0x55')]=_0x46474e['value'];this['channels'][_0x46474e[_0x3fe0('0x4f')]]=_0x4abfe0;this[_0x3fe0('0x48')](_0x4abfe0,_0x3fe0('0x26'));}else if(this['isNotNull'](_0x46474e['variable'])&&this[_0x3fe0('0x74')](_0x46474e[_0x3fe0('0xab')]['queueposition'])){if(!_0x4abfe0[_0x3fe0('0x21')]){_0x4abfe0[_0x3fe0('0x95')]=!![];_0x4abfe0[_0x3fe0('0x96')]=moment()[_0x3fe0('0x50')](_0x3fe0('0x7a'));_0x4abfe0['queuecallerexitreason']='EXITWITHKEY';_0x4abfe0[_0x3fe0('0xb0')]=moment()[_0x3fe0('0x50')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3fe0('0x14')][_0x46474e[_0x3fe0('0x4f')]]=_0x4abfe0;}}logger[_0x3fe0('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x46474e[_0x3fe0('0x4f')],_0x4abfe0[_0x3fe0('0x57')],_0x4abfe0[_0x3fe0('0x5b')],_[_0x3fe0('0x80')](_0x46474e[_0x3fe0('0xab')])[0x0],_0x46474e[_0x3fe0('0xac')]);_0x4abfe0[_0x3fe0('0x45')]=this[_0x3fe0('0x45')][_0x46474e[_0x3fe0('0x4f')]];}}}}catch(_0x30fe70){logger[_0x3fe0('0x42')]('[%s][voiceQueueReport][varset]',_0x46474e[_0x3fe0('0x4f')],util[_0x3fe0('0x44')](_0x30fe70,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0xaa')]=function(_0x1eea11,_0x53b53c,_0xe729ea){var _0x45f6d6=[_0x3fe0('0xb3'),_0x3fe0('0xb4'),_0x3fe0('0xb5'),_0x3fe0('0xb6'),_0x3fe0('0xb7'),_0x3fe0('0xb8'),_0x3fe0('0xb9'),_0x3fe0('0xba'),_0x3fe0('0xbb'),_0x3fe0('0xbc'),_0x3fe0('0xbd'),_0x3fe0('0xbe'),_0x3fe0('0xbf'),_0x3fe0('0xc0'),_0x3fe0('0xc1'),_0x3fe0('0xc2'),'membername',_0x3fe0('0xc3'),_0x3fe0('0xc4')];if(!_[_0x3fe0('0x3d')](_0x53b53c)&&!_[_0x3fe0('0xc5')](_0x45f6d6,_0x53b53c)){if(_['isUndefined'](this['variables'][_0x1eea11])){this[_0x3fe0('0x45')][_0x1eea11]={};}this[_0x3fe0('0x45')][_0x1eea11][_0x53b53c]=_0xe729ea;}};VoiceQueueReport[_0x3fe0('0x3a')][_0x3fe0('0xc6')]=function(_0x5a2106,_0x4f45a1,_0x5b886f){var _0x322a03={};for(var _0x18ae4c=0x0;_0x18ae4c=0x0?moment(_0x46c379['endtime'])[_0x0e46('0xe')](_0x46c379[_0x0e46('0x18')],_0x0e46('0x1a')):null,'data1':'outbound','data2':_0x46c379[_0x0e46('0x14')],'data3':_0x46c379[_0x0e46('0x11')],'data4':_0x46c379[_0x0e46('0x1b')]||null,'role':_0x0e46('0x13'),'internal':_0x46c379[_0x0e46('0x14')]?_[_0x0e46('0x15')](_0x46c379['accountcode']):undefined,'uniqueid':_0x46c379[_0x0e46('0x16')]},'log':_0x0e46('0x6')});}; \ No newline at end of file +var _0x5658=['queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','membername','endtime','starttime','dialstring','agent','lodash','util','../client','voiceQueueReport'];(function(_0x3e5180,_0x55d59f){var _0x2ab3ca=function(_0x1696e9){while(--_0x1696e9){_0x3e5180['push'](_0x3e5180['shift']());}};_0x2ab3ca(++_0x55d59f);}(_0x5658,0x146));var _0x8565=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5658[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require('moment');var _=require(_0x8565('0x0'));var util=require(_0x8565('0x1'));var client=require(_0x8565('0x2'));exports[_0x8565('0x3')]=function(_0x1bc260){var _0x5f050d=_0x1bc260[_0x8565('0x4')]||_0x1bc260[_0x8565('0x5')];return client[_0x8565('0x6')](_0x8565('0x7'),{'body':{'channel':_0x8565('0x8'),'membername':_0x1bc260[_0x8565('0x9')],'interface':_[_0x8565('0xa')](_0x1bc260[_0x8565('0xb')])?util[_0x8565('0xc')](_0x8565('0xd'),_0x1bc260['lastAssignedTo']):_0x1bc260[_0x8565('0xb')],'type':_0x8565('0xe'),'enterAt':_0x1bc260[_0x8565('0xf')],'exitAt':_0x5f050d,'duration':moment(_0x5f050d)[_0x8565('0x10')](_0x1bc260['queuecallerleaveAt'],_0x8565('0x11')),'data1':'inbound','data2':_0x1bc260[_0x8565('0x12')],'data3':_0x1bc260[_0x8565('0x13')],'data4':null,'data5':_0x1bc260[_0x8565('0x14')],'role':'agent','internal':_0x1bc260[_0x8565('0x15')]?_[_0x8565('0x16')](_0x1bc260[_0x8565('0x15')]):undefined,'uniqueid':_0x1bc260[_0x8565('0x17')]},'log':_0x8565('0x7')});};exports[_0x8565('0x18')]=function(_0x539774){return client[_0x8565('0x6')]('CreateMemberReport',{'body':{'channel':_0x8565('0x8'),'membername':_0x539774[_0x8565('0x19')],'interface':_0x539774[_0x8565('0xb')],'type':'TALKING','enterAt':_0x539774['starttime'],'exitAt':_0x539774[_0x8565('0x1a')],'duration':moment(_0x539774['endtime'])[_0x8565('0x10')](_0x539774['starttime'],_0x8565('0x11'))>=0x0?moment(_0x539774['endtime'])['diff'](_0x539774[_0x8565('0x1b')],_0x8565('0x11')):null,'data1':'outbound','data2':_0x539774[_0x8565('0x15')],'data3':_0x539774['exten'],'data4':_0x539774[_0x8565('0x1c')]||null,'role':_0x8565('0x1d'),'internal':_0x539774['accountcode']?_[_0x8565('0x16')](_0x539774[_0x8565('0x15')]):undefined,'uniqueid':_0x539774['uniqueid']},'log':_0x8565('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 4794fec..1d745b9 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 _0x65c9=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65c9,0x182));var _0x965c=function(_0x499684,_0x7efd4){_0x499684=_0x499684-0x0;var _0xa0d0a9=_0x65c9[_0x499684];return _0xa0d0a9;};'use strict';var client=require(_0x965c('0x0'));exports[_0x965c('0x1')]=function(){return client['Request'](_0x965c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x965c('0x3'),_0x965c('0x4')]},'log':_0x965c('0x5')});}; \ No newline at end of file +var _0x8f71=['stopRecordingOnTransfer','GetSettings','getSettings','Request'];(function(_0x17e9c4,_0x13991b){var _0x53922a=function(_0x47bd57){while(--_0x47bd57){_0x17e9c4['push'](_0x17e9c4['shift']());}};_0x53922a(++_0x13991b);}(_0x8f71,0x1e6));var _0x18f7=function(_0x249b47,_0x38b56c){_0x249b47=_0x249b47-0x0;var _0x3e5525=_0x8f71[_0x249b47];return _0x3e5525;};'use strict';var client=require('../client');exports[_0x18f7('0x0')]=function(){return client[_0x18f7('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x18f7('0x2'),'previewRecallmeReminderInterval']},'log':_0x18f7('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index babd766..5383308 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 _0x8bf1=['html','../client','Request','GetTemplate','name'];(function(_0x197043,_0x3ebf47){var _0x233e33=function(_0x17bd0f){while(--_0x17bd0f){_0x197043['push'](_0x197043['shift']());}};_0x233e33(++_0x3ebf47);}(_0x8bf1,0x65));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x18bf('0x0'));exports['getTemplates']=function(_0x3d7fa8){return function(_0x1d04b3){return client[_0x18bf('0x1')](_0x18bf('0x2'),{'options':{'raw':!![],'attributes':['id',_0x18bf('0x3'),_0x18bf('0x4')]},'log':_0x18bf('0x2')});};}; \ No newline at end of file +var _0x04af=['name','html','../client','getTemplates','Request'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x04af,0x1f1));var _0xf04a=function(_0x14071e,_0x343e75){_0x14071e=_0x14071e-0x0;var _0x45db41=_0x04af[_0x14071e];return _0x45db41;};'use strict';var client=require(_0xf04a('0x0'));exports[_0xf04a('0x1')]=function(_0x16cfe7){return function(_0x41b48d){return client[_0xf04a('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf04a('0x3'),_0xf04a('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3b531a4..4a3dbfd 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 _0x7d61=['field','value','AnyConditions','operator','Action','Actions','action','data1','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions'];(function(_0x199d94,_0x2a8775){var _0x15bc77=function(_0x325a6f){while(--_0x325a6f){_0x199d94['push'](_0x199d94['shift']());}};_0x15bc77(++_0x2a8775);}(_0x7d61,0x102));var _0x17d6=function(_0x19962e,_0x38c0d3){_0x19962e=_0x19962e-0x0;var _0x1ced88=_0x7d61[_0x19962e];return _0x1ced88;};'use strict';var client=require(_0x17d6('0x0'));exports[_0x17d6('0x1')]=function(_0x183122){return function(_0x1f3794){return client['Request'](_0x17d6('0x2'),{'options':{'raw':![],'attributes':['id',_0x17d6('0x3'),_0x17d6('0x4'),_0x17d6('0x5')],'include':[{'model':_0x17d6('0x6'),'as':_0x17d6('0x7'),'attributes':['id',_0x17d6('0x8'),'operator',_0x17d6('0x9')]},{'model':_0x17d6('0x6'),'as':_0x17d6('0xa'),'attributes':['id','field',_0x17d6('0xb'),_0x17d6('0x9')]},{'model':_0x17d6('0xc'),'as':_0x17d6('0xd'),'attributes':['id',_0x17d6('0xe'),_0x17d6('0xf'),'data2','data3',_0x17d6('0x10'),'data5',_0x17d6('0x11'),_0x17d6('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xfe75=['channel','field','operator','Condition','value','Action','action','data3','data4','data6','../client','Request','GetTrigger'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0xfe75,0x19d));var _0x5fe7=function(_0x15a3ef,_0x38833a){_0x15a3ef=_0x15a3ef-0x0;var _0x5b2a5c=_0xfe75[_0x15a3ef];return _0x5b2a5c;};'use strict';var client=require(_0x5fe7('0x0'));exports['getTriggers']=function(_0x69389c){return function(_0x12f973){return client[_0x5fe7('0x1')](_0x5fe7('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x5fe7('0x3'),'status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x5fe7('0x4'),_0x5fe7('0x5'),'value']},{'model':_0x5fe7('0x6'),'as':'AnyConditions','attributes':['id',_0x5fe7('0x4'),_0x5fe7('0x5'),_0x5fe7('0x7')]},{'model':_0x5fe7('0x8'),'as':'Actions','attributes':['id',_0x5fe7('0x9'),'data1','data2',_0x5fe7('0xa'),_0x5fe7('0xb'),'data5',_0x5fe7('0xc'),'data7']}]},'log':_0x5fe7('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7a35cc8..b0e2b14 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 _0x8bd2=['getTrunks','GetTrunk','name','registry','defaultuser','../client'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x8bd2,0x17f));var _0x28bd=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x8bd2[_0x4defd6];return _0x4c9276;};'use strict';var client=require(_0x28bd('0x0'));exports[_0x28bd('0x1')]=function(_0x50df01){return function(_0x5760de){return client['Request'](_0x28bd('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x28bd('0x3'),_0x28bd('0x4'),_0x28bd('0x5')]},'log':_0x28bd('0x2')});};}; \ No newline at end of file +var _0x8e0f=['GetTrunk','name','defaultuser','../client','getTrunks','Request'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x1fdae9,_0x1a0e57){_0x1fdae9=_0x1fdae9-0x0;var _0x435ae1=_0x8e0f[_0x1fdae9];return _0x435ae1;};'use strict';var client=require(_0xf8e0('0x0'));exports[_0xf8e0('0x1')]=function(_0x1615a7){return function(_0x5103f1){return client[_0xf8e0('0x2')](_0xf8e0('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf8e0('0x4'),'registry',_0xf8e0('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 9ecc9f3..672b69e 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x4391bc,_0x413330){var _0x255243=function(_0x272b27){while(--_0x272b27){_0x4391bc['push'](_0x4391bc['shift']());}};_0x255243(++_0x413330);}(_0xedd9,0xfc));var _0x9edd=function(_0x132523,_0x4a484c){_0x132523=_0x132523-0x0;var _0x710292=_0xedd9[_0x132523];return _0x710292;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x15de01,_0x339b6c){var _0x2a83df=function(_0x28dfb1){while(--_0x28dfb1){_0x15de01['push'](_0x15de01['shift']());}};_0x2a83df(++_0x339b6c);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b3c9f14..07bfb4e 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 _0x1f1f=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1f1f,0x111));var _0xf1f1=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x1f1f[_0x2dbce7];return _0x3a3ed0;};'use strict';var client=require(_0xf1f1('0x0'));exports['create']=function(_0x459979){return client[_0xf1f1('0x1')](_0xf1f1('0x2'),{'body':_0x459979,'log':_0xf1f1('0x2')});};exports['update']=function(_0x183762,_0x172a32,_0x4d5353){return client[_0xf1f1('0x1')](_0xf1f1('0x3'),{'body':_0x183762,'options':{'where':{'uniqueid':_0x172a32,'interface':_0x4d5353,'agentcomplete':!![]}},'log':_0xf1f1('0x3')});}; \ No newline at end of file +var _0x826e=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x826e,0x15a));var _0xe826=function(_0x332d2b,_0x2fbddb){_0x332d2b=_0x332d2b-0x0;var _0x49844a=_0x826e[_0x332d2b];return _0x49844a;};'use strict';var client=require('../client');exports[_0xe826('0x0')]=function(_0x433ae6){return client[_0xe826('0x1')](_0xe826('0x2'),{'body':_0x433ae6,'log':_0xe826('0x2')});};exports[_0xe826('0x3')]=function(_0x3cb8e1,_0x58e965,_0x566458){return client[_0xe826('0x1')]('UpdateVoiceAgentReport',{'body':_0x3cb8e1,'options':{'where':{'uniqueid':_0x58e965,'interface':_0x566458,'agentcomplete':!![]}},'log':_0xe826('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5c6e112..c5345ce 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 _0x2cd4=['endOf','format','type','disposition','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x310210,_0x2c97e5){var _0xb001ba=function(_0x5cef31){while(--_0x5cef31){_0x310210['push'](_0x310210['shift']());}};_0xb001ba(++_0x2c97e5);}(_0x2cd4,0x194));var _0x42cd=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0x2cd4[_0x1a0c59];return _0xed67c9;};'use strict';var moment=require(_0x42cd('0x0'));var util=require('util');var _=require(_0x42cd('0x1'));var client=require(_0x42cd('0x2'));exports[_0x42cd('0x3')]=function(_0x5cd97a){return client[_0x42cd('0x4')](_0x42cd('0x5'),{'body':_[_0x42cd('0x6')](_0x5cd97a,{'source':_0x5cd97a[_0x42cd('0x7')],'destinationcontext':_0x5cd97a[_0x42cd('0x8')],'callerid':_0x5cd97a[_0x42cd('0x9')],'amaflags':_0x42cd('0xa')}),'log':_0x42cd('0x5')});};exports[_0x42cd('0xb')]=function(){return function(){return client[_0x42cd('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x42cd('0xc')],'createdAt':{'$between':[moment()[_0x42cd('0xd')](_0x42cd('0xe'))['format'](_0x42cd('0xf')),moment()[_0x42cd('0x10')](_0x42cd('0xe'))[_0x42cd('0x11')](_0x42cd('0xf'))]}},'attributes':[_0x42cd('0x12'),_0x42cd('0x13'),'duration',_0x42cd('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xac1c=['moment','util','lodash','../client','create','CreateVoiceCallReport','calleridnum','context','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x4a694c,_0x2edd71){var _0x5c5ca8=function(_0x3ab27a){while(--_0x3ab27a){_0x4a694c['push'](_0x4a694c['shift']());}};_0x5c5ca8(++_0x2edd71);}(_0xac1c,0x12c));var _0xcac1=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xac1c[_0x581249];return _0x284bae;};'use strict';var moment=require(_0xcac1('0x0'));var util=require(_0xcac1('0x1'));var _=require(_0xcac1('0x2'));var client=require(_0xcac1('0x3'));exports[_0xcac1('0x4')]=function(_0x422c5e){return client['Request'](_0xcac1('0x5'),{'body':_['merge'](_0x422c5e,{'source':_0x422c5e[_0xcac1('0x6')],'destinationcontext':_0x422c5e[_0xcac1('0x7')],'callerid':_0x422c5e['callerid'],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xcac1('0x8')]=function(){return function(){return client['Request'](_0xcac1('0x9'),{'options':{'where':{'type':[_0xcac1('0xa')],'createdAt':{'$between':[moment()['startOf'](_0xcac1('0xb'))[_0xcac1('0xc')](_0xcac1('0xd')),moment()[_0xcac1('0xe')](_0xcac1('0xb'))['format'](_0xcac1('0xd'))]}},'attributes':[_0xcac1('0xf'),_0xcac1('0x10'),_0xcac1('0x11'),_0xcac1('0x12')]},'log':_0xcac1('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 787cba8..7b261f6 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 _0x7ff2=['CreateVoiceDialReport','Request'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x7ff2,0x18f));var _0x27ff=function(_0x3bb9a5,_0x552fc6){_0x3bb9a5=_0x3bb9a5-0x0;var _0x3f2d46=_0x7ff2[_0x3bb9a5];return _0x3f2d46;};'use strict';var client=require('../client');exports['create']=function(_0x5cad6c){return client[_0x27ff('0x0')](_0x27ff('0x1'),{'body':_0x5cad6c,'log':_0x27ff('0x1')});}; \ No newline at end of file +var _0x63c3=['CreateVoiceDialReport','../client','create','Request'];(function(_0x54e6b9,_0x13ee5b){var _0x5c0244=function(_0x53c5fa){while(--_0x53c5fa){_0x54e6b9['push'](_0x54e6b9['shift']());}};_0x5c0244(++_0x13ee5b);}(_0x63c3,0xe9));var _0x363c=function(_0xc1e968,_0x4a8fc5){_0xc1e968=_0xc1e968-0x0;var _0x29de11=_0x63c3[_0xc1e968];return _0x29de11;};'use strict';var client=require(_0x363c('0x0'));exports[_0x363c('0x1')]=function(_0x5c7c4b){return client[_0x363c('0x2')](_0x363c('0x3'),{'body':_0x5c7c4b,'log':_0x363c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 12f5342..7a776eb 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 _0xf403=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x133084,_0x39bb5a){var _0x1104d5=function(_0x3996c2){while(--_0x3996c2){_0x133084['push'](_0x133084['shift']());}};_0x1104d5(++_0x39bb5a);}(_0xf403,0x1d3));var _0x3f40=function(_0x48f892,_0x3b31e6){_0x48f892=_0x48f892-0x0;var _0x52c1cc=_0xf403[_0x48f892];return _0x52c1cc;};'use strict';var client=require(_0x3f40('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x3f40('0x1')](_0x3f40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3f40('0x3'),_0x3f40('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3f40('0x5')});};}; \ No newline at end of file +var _0x0834=['Request','GetVoiceExtension'];(function(_0x2df8f0,_0x566393){var _0x318ec5=function(_0x13b281){while(--_0x13b281){_0x2df8f0['push'](_0x2df8f0['shift']());}};_0x318ec5(++_0x566393);}(_0x0834,0x18e));var _0x4083=function(_0x5247f1,_0x16defa){_0x5247f1=_0x5247f1-0x0;var _0x18b6fa=_0x0834[_0x5247f1];return _0x18b6fa;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x4083('0x0')](_0x4083('0x1'),{'options':{'raw':!![],'attributes':['id','exten','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 bc06e85..8c64a66 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 _0x7a79=['dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x7a79,0xfc));var _0x97a7=function(_0xfadc1a,_0xc6a189){_0xfadc1a=_0xfadc1a-0x0;var _0x1be3a4=_0x7a79[_0xfadc1a];return _0x1be3a4;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x97a7('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x97a7('0x1'),_0x97a7('0x2'),_0x97a7('0x3'),'monitor_format',_0x97a7('0x4'),'dialActive',_0x97a7('0x5'),_0x97a7('0x6'),_0x97a7('0x7'),_0x97a7('0x8'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x97a7('0x9'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x97a7('0xa'),'dialQueueOptions',_0x97a7('0xb'),_0x97a7('0xc'),_0x97a7('0xd'),'dialCongestionRetryFrequency',_0x97a7('0xe'),_0x97a7('0xf'),_0x97a7('0x10'),_0x97a7('0x11'),'dialGlobalMaxRetry','dialTimezone',_0x97a7('0x12'),_0x97a7('0x13'),_0x97a7('0x14'),_0x97a7('0x15'),'dialAMDInitialSilence',_0x97a7('0x16'),_0x97a7('0x17'),_0x97a7('0x18'),_0x97a7('0x19'),_0x97a7('0x1a'),_0x97a7('0x1b'),_0x97a7('0x1c'),_0x97a7('0x1d'),_0x97a7('0x1e'),_0x97a7('0x1f'),'dialRecallInQueue',_0x97a7('0x20'),_0x97a7('0x21'),_0x97a7('0x22'),_0x97a7('0x23'),_0x97a7('0x24'),_0x97a7('0x25'),_0x97a7('0x26'),_0x97a7('0x27'),_0x97a7('0x28'),'dialNoSuchNumberRetryFrequency',_0x97a7('0x29'),'dialDropRetryFrequency',_0x97a7('0x2a'),_0x97a7('0x2b'),'dialMachineMaxRetry',_0x97a7('0x2c'),_0x97a7('0x2d'),_0x97a7('0x2e'),_0x97a7('0x2f'),'dialPredictiveIntervalMaxThreshold',_0x97a7('0x30'),_0x97a7('0x31'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x97a7('0x32'),'as':_0x97a7('0x32'),'attributes':['id',_0x97a7('0x33'),_0x97a7('0x34'),_0x97a7('0x35')]},{'model':_0x97a7('0x36'),'as':_0x97a7('0x37'),'attributes':['id',_0x97a7('0x33')]},{'model':_0x97a7('0x32'),'as':'TrunkBackup','attributes':['id','name',_0x97a7('0x34'),_0x97a7('0x35')]},{'model':_0x97a7('0x38'),'as':_0x97a7('0x38'),'attributes':['id','name'],'include':[{'model':_0x97a7('0x38'),'as':_0x97a7('0x39'),'attributes':['id','name',_0x97a7('0x3a')]}]}]},'log':_0x97a7('0x3b')});};}; \ No newline at end of file +var _0x1f31=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','GetVoiceQueue','name','acwTimeout','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x53f147,_0x2328c6){var _0x3b4eb7=function(_0x551acf){while(--_0x551acf){_0x53f147['push'](_0x53f147['shift']());}};_0x3b4eb7(++_0x2328c6);}(_0x1f31,0x14c));var _0x11f3=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x1f31[_0x4eb6ec];return _0x58881b;};'use strict';var client=require(_0x11f3('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x11f3('0x1'),{'options':{'raw':![],'attributes':['id',_0x11f3('0x2'),'acw',_0x11f3('0x3'),'autopause','monitor_format',_0x11f3('0x4'),_0x11f3('0x5'),_0x11f3('0x6'),_0x11f3('0x7'),'dialLimitQueue',_0x11f3('0x8'),_0x11f3('0x9'),_0x11f3('0xa'),_0x11f3('0xb'),'dialOriginateCallerIdName',_0x11f3('0xc'),_0x11f3('0xd'),_0x11f3('0xe'),'dialQueueTimeout','dialQueueProject',_0x11f3('0xf'),_0x11f3('0x10'),_0x11f3('0x11'),_0x11f3('0x12'),'dialNoAnswerMaxRetry',_0x11f3('0x13'),_0x11f3('0x14'),'dialTimezone',_0x11f3('0x15'),'dialPrefix',_0x11f3('0x16'),_0x11f3('0x17'),'dialAMDInitialSilence',_0x11f3('0x18'),_0x11f3('0x19'),_0x11f3('0x1a'),_0x11f3('0x1b'),_0x11f3('0x1c'),_0x11f3('0x1d'),_0x11f3('0x1e'),'dialAMDMaximumWordLength',_0x11f3('0x1f'),'dialRecallMeTimeout','dialRecallInQueue',_0x11f3('0x20'),_0x11f3('0x21'),_0x11f3('0x22'),_0x11f3('0x23'),_0x11f3('0x24'),_0x11f3('0x25'),'dialRandomLastDigitCallerIdNumber',_0x11f3('0x26'),_0x11f3('0x27'),_0x11f3('0x28'),'dialDropMaxRetry',_0x11f3('0x29'),_0x11f3('0x2a'),_0x11f3('0x2b'),_0x11f3('0x2c'),_0x11f3('0x2d'),'dialAgentRejectMaxRetry',_0x11f3('0x2e'),_0x11f3('0x2f'),_0x11f3('0x30'),'dialPredictiveIntervalMinThreshold',_0x11f3('0x31'),_0x11f3('0x32')],'include':[{'model':_0x11f3('0x33'),'as':'Trunk','attributes':['id',_0x11f3('0x2'),_0x11f3('0x34'),_0x11f3('0x35')]},{'model':_0x11f3('0x36'),'as':_0x11f3('0x37'),'attributes':['id',_0x11f3('0x2')]},{'model':'Trunk','as':_0x11f3('0x38'),'attributes':['id',_0x11f3('0x2'),_0x11f3('0x34'),_0x11f3('0x35')]},{'model':_0x11f3('0x39'),'as':_0x11f3('0x39'),'attributes':['id',_0x11f3('0x2')],'include':[{'model':_0x11f3('0x39'),'as':_0x11f3('0x3a'),'attributes':['id','name',_0x11f3('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 12cb249..e950d4f 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(_0x524daf,_0x41ed0a){var _0x938050=function(_0x58ca77){while(--_0x58ca77){_0x524daf['push'](_0x524daf['shift']());}};_0x938050(++_0x41ed0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x5b45e5,_0xa5c8ac){var _0x5801b4=function(_0x57cb9e){while(--_0x57cb9e){_0x5b45e5['push'](_0x5b45e5['shift']());}};_0x5801b4(++_0xa5c8ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 f77b970..9ed40ae 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 _0xf12c=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x4b3e72,_0x391646){var _0x2f1fa8=function(_0x29b513){while(--_0x29b513){_0x4b3e72['push'](_0x4b3e72['shift']());}};_0x2f1fa8(++_0x391646);}(_0xf12c,0x1d4));var _0xcf12=function(_0x5c8b01,_0x1102c1){_0x5c8b01=_0x5c8b01-0x0;var _0x180b22=_0xf12c[_0x5c8b01];return _0x180b22;};'use strict';var client=require(_0xcf12('0x0'));exports[_0xcf12('0x1')]=function(_0xc4ef1d){return function(){return client[_0xcf12('0x2')](_0xcf12('0x3'),{'options':{'where':{'VoiceQueueId':_0xc4ef1d,'paused':!![]},'raw':!![]},'log':_0xcf12('0x1')});};}; \ No newline at end of file +var _0xc36d=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x33e9b5,_0x36fbf1){var _0x3244c0=function(_0xeed14a){while(--_0xeed14a){_0x33e9b5['push'](_0x33e9b5['shift']());}};_0x3244c0(++_0x36fbf1);}(_0xc36d,0x14c));var _0xdc36=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0xc36d[_0x7b4397];return _0x16de0b;};'use strict';var client=require('../client');exports[_0xdc36('0x0')]=function(_0x37966f){return function(){return client[_0xdc36('0x1')](_0xdc36('0x2'),{'options':{'where':{'VoiceQueueId':_0x37966f,'paused':!![]},'raw':!![]},'log':_0xdc36('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7046eef..85019fb 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(_0x2d52f2,_0x77d294){var _0x5af923=function(_0x3bf3d2){while(--_0x3bf3d2){_0x2d52f2['push'](_0x2d52f2['shift']());}};_0x5af923(++_0x77d294);}(_0x7a54,0x106));var _0x47a5=function(_0x43d122,_0x502dad){_0x43d122=_0x43d122-0x0;var _0xc780d8=_0x7a54[_0x43d122];return _0xc780d8;};'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(_0x12dbfd,_0x2dc6ee){var _0x5f46cb=function(_0x3e1b18){while(--_0x3e1b18){_0x12dbfd['push'](_0x12dbfd['shift']());}};_0x5f46cb(++_0x2dc6ee);}(_0x7a54,0x106));var _0x47a5=function(_0x40ddba,_0x4b1db1){_0x40ddba=_0x40ddba-0x0;var _0x3c0719=_0x7a54[_0x40ddba];return _0x3c0719;};'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 0ec9e81..10e89f2 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 _0xc96e=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum'];(function(_0x33574c,_0x435727){var _0x13c1e7=function(_0x298ed1){while(--_0x298ed1){_0x33574c['push'](_0x33574c['shift']());}};_0x13c1e7(++_0x435727);}(_0xc96e,0x87));var _0xec96=function(_0xa75c12,_0x734a3a){_0xa75c12=_0xa75c12-0x0;var _0x4aa6d2=_0xc96e[_0xa75c12];return _0x4aa6d2;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xec96('0x0')]=function(_0x436b24){return client[_0xec96('0x1')](_0xec96('0x2'),{'body':{'result':_0x436b24[_0xec96('0x3')],'transfererchannel':_0x436b24[_0xec96('0x4')],'transferercalleridnum':_0x436b24[_0xec96('0x5')],'transferercalleridname':_0x436b24[_0xec96('0x6')],'transfererconnectedlinenum':_0x436b24[_0xec96('0x7')],'transfererconnectedlinename':_0x436b24[_0xec96('0x8')],'transfereraccountcode':_0x436b24['transfereraccountcode'],'transferercontext':_0x436b24[_0xec96('0x9')],'transfererexten':_0x436b24[_0xec96('0xa')],'transfererlinkedid':_0x436b24[_0xec96('0xb')],'transfereechannel':_0x436b24[_0xec96('0xc')],'transfereecalleridnum':_0x436b24[_0xec96('0xd')],'transfereecalleridname':_0x436b24['transfereecalleridname'],'transfereeconnectedlinenum':_0x436b24[_0xec96('0xe')],'transfereeconnectedlinename':_0x436b24[_0xec96('0xf')],'transfereeaccountcode':_0x436b24['transfereeaccountcode'],'transfereecontext':_0x436b24['transfereecontext'],'transfereeexten':_0x436b24[_0xec96('0x10')],'transfereelinkedid':_0x436b24[_0xec96('0x11')],'isexternal':_0x436b24[_0xec96('0x12')],'context':_0x436b24[_0xec96('0x13')],'extension':_0x436b24[_0xec96('0x14')],'type':_0xec96('0x15')},'log':_0xec96('0x2')});};exports[_0xec96('0x16')]=function(_0x3c1d3c){return client[_0xec96('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x3c1d3c[_0xec96('0x3')],'transfererchannel':_0x3c1d3c[_0xec96('0x17')],'transferercalleridnum':_0x3c1d3c[_0xec96('0x18')],'transferercalleridname':_0x3c1d3c[_0xec96('0x19')],'transfererconnectedlinenum':_0x3c1d3c[_0xec96('0x1a')],'transfererconnectedlinename':_0x3c1d3c[_0xec96('0x1b')],'transfereraccountcode':_0x3c1d3c[_0xec96('0x1c')],'transferercontext':_0x3c1d3c['secondtransferercontext'],'transfererexten':_0x3c1d3c[_0xec96('0x1d')],'transfererlinkedid':_0x3c1d3c[_0xec96('0x1e')],'transfereechannel':_0x3c1d3c[_0xec96('0x1f')],'transfereecalleridnum':_0x3c1d3c[_0xec96('0x20')],'transfereecalleridname':_0x3c1d3c[_0xec96('0x21')],'transfereeconnectedlinenum':_0x3c1d3c[_0xec96('0x22')],'transfereeconnectedlinename':_0x3c1d3c[_0xec96('0x23')],'transfereeaccountcode':_0x3c1d3c[_0xec96('0x24')],'transfereecontext':_0x3c1d3c['transfertargetcontext'],'transfereeexten':_0x3c1d3c[_0xec96('0x25')],'transfereelinkedid':_0x3c1d3c[_0xec96('0x26')],'isexternal':_0x3c1d3c[_0xec96('0x12')],'context':_0x3c1d3c[_0xec96('0x27')],'extension':_0x3c1d3c[_0xec96('0x28')],'type':_0xec96('0x29')},'log':_0xec96('0x2')});}; \ No newline at end of file +var _0x3df0=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','result','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','context','extension','CreateVoiceTransferReport','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten'];(function(_0x306194,_0x1fa8d9){var _0x1b548c=function(_0x3037e2){while(--_0x3037e2){_0x306194['push'](_0x306194['shift']());}};_0x1b548c(++_0x1fa8d9);}(_0x3df0,0x160));var _0x03df=function(_0x5e2f2a,_0x39eccf){_0x5e2f2a=_0x5e2f2a-0x0;var _0xf0257=_0x3df0[_0x5e2f2a];return _0xf0257;};'use strict';var client=require(_0x03df('0x0'));exports[_0x03df('0x1')]={};exports[_0x03df('0x2')]=function(_0x550e4b){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x550e4b[_0x03df('0x3')],'transfererchannel':_0x550e4b['transfererchannel'],'transferercalleridnum':_0x550e4b['transferercalleridnum'],'transferercalleridname':_0x550e4b['transferercalleridname'],'transfererconnectedlinenum':_0x550e4b[_0x03df('0x4')],'transfererconnectedlinename':_0x550e4b[_0x03df('0x5')],'transfereraccountcode':_0x550e4b[_0x03df('0x6')],'transferercontext':_0x550e4b[_0x03df('0x7')],'transfererexten':_0x550e4b[_0x03df('0x8')],'transfererlinkedid':_0x550e4b[_0x03df('0x9')],'transfereechannel':_0x550e4b[_0x03df('0xa')],'transfereecalleridnum':_0x550e4b[_0x03df('0xb')],'transfereecalleridname':_0x550e4b[_0x03df('0xc')],'transfereeconnectedlinenum':_0x550e4b[_0x03df('0xd')],'transfereeconnectedlinename':_0x550e4b[_0x03df('0xe')],'transfereeaccountcode':_0x550e4b[_0x03df('0xf')],'transfereecontext':_0x550e4b['transfereecontext'],'transfereeexten':_0x550e4b[_0x03df('0x10')],'transfereelinkedid':_0x550e4b['transfereelinkedid'],'isexternal':_0x550e4b[_0x03df('0x11')],'context':_0x550e4b[_0x03df('0x12')],'extension':_0x550e4b[_0x03df('0x13')],'type':'blind'},'log':_0x03df('0x14')});};exports[_0x03df('0x15')]=function(_0x12534f){return client[_0x03df('0x16')](_0x03df('0x14'),{'body':{'result':_0x12534f[_0x03df('0x3')],'transfererchannel':_0x12534f['origtransfererchannel'],'transferercalleridnum':_0x12534f[_0x03df('0x17')],'transferercalleridname':_0x12534f[_0x03df('0x18')],'transfererconnectedlinenum':_0x12534f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x12534f[_0x03df('0x19')],'transfereraccountcode':_0x12534f[_0x03df('0x1a')],'transferercontext':_0x12534f['secondtransferercontext'],'transfererexten':_0x12534f[_0x03df('0x1b')],'transfererlinkedid':_0x12534f['origtransfererlinkedid'],'transfereechannel':_0x12534f[_0x03df('0x1c')],'transfereecalleridnum':_0x12534f[_0x03df('0x1d')],'transfereecalleridname':_0x12534f[_0x03df('0x1e')],'transfereeconnectedlinenum':_0x12534f[_0x03df('0x1f')],'transfereeconnectedlinename':_0x12534f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x12534f[_0x03df('0x20')],'transfereecontext':_0x12534f[_0x03df('0x21')],'transfereeexten':_0x12534f[_0x03df('0x22')],'transfereelinkedid':_0x12534f['transfertargetlinkedid'],'isexternal':_0x12534f[_0x03df('0x11')],'context':_0x12534f[_0x03df('0x23')],'extension':_0x12534f[_0x03df('0x24')],'type':_0x03df('0x25')},'log':_0x03df('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a5bb242..856bcbc 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 _0x207c=['ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','toLowerCase','StopMixMonitor\x20Success','outbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','type','count','rows','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','message','catch','pick','command','Command','then','content','voiceQueues','hasOwnProperty','push','find','omit','undefined','values','channels','length','voicechannel','uniqueid','channel','wav'];(function(_0x2dffd7,_0x50e766){var _0x55e83f=function(_0x1cf727){while(--_0x1cf727){_0x2dffd7['push'](_0x2dffd7['shift']());}};_0x55e83f(++_0x50e766);}(_0x207c,0x1e8));var _0xc207=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x207c[_0x21e97b];return _0x10ba44;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var jayson=require(_0xc207('0x1'));var schema=require(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var config=require(_0xc207('0x4'));var properties=require(_0xc207('0x5'));var ami=require(_0xc207('0x6'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0xc207('0x7')]=function(_0x59bc89,_0x5a727b,_0x55023e){return new Promise(function(_0xc88789,_0x314561){var _0x3395e4={'QueuePause':function(_0x59ff6f){return new Promise(function(_0x25cb97){var _0xad159b=util[_0xc207('0x8')]('%s/%s',_0xc207('0x9'),_0x59ff6f[_0xc207('0xa')]);if(_0x59bc89[_0xc207('0xb')]&&_0x59bc89[_0xc207('0xb')][_0xad159b]&&_0x59bc89[_0xc207('0xb')][_0xad159b][_0xc207('0xc')]){_0x59bc89['timers'][_0xad159b]['updateAcw']();}if(_0x59bc89['agents'][_0xad159b]){_0x59bc89[_0xc207('0xd')][_0xad159b]['updateStatusRealtime']({'statePause':_0x59ff6f[_0xc207('0xe')]?!![]:![]});}_0x25cb97({'code':0xc8,'message':_0xc207('0xf')});});},'Reload':function(_0x59d401){var _0x3e1108=this;return new Promise(function(_0xb86b06,_0x3062f5){if(ami[_0xc207('0x10')]()==![]){return _0x3062f5(_0x3e1108[_0xc207('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}_0x59d401=_['pick'](_0x59d401,_['keys'](properties['reload'][_0xc207('0x16')]));_0x59d401[_0xc207('0x17')]=_0xc207('0x18');return ami[_0xc207('0x19')](_0x59d401)['then'](function(_0x1bc70c){_0xb86b06({'code':0xc8,'message':_0x1bc70c[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x5f288e){_0x3062f5(_0x3e1108[_0xc207('0x11')](0x1f5,_0x5f288e['message']));});});},'Command':function(_0x42c8ba){var _0x33ddb1=this;return new Promise(function(_0x131dc8,_0x461f6a){if(ami[_0xc207('0x10')]()==![]){return _0x461f6a(_0x33ddb1[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}_0x42c8ba=_[_0xc207('0x1c')](_0x42c8ba,_0xc207('0x1d'));_0x42c8ba['action']=_0xc207('0x1e');return ami['Action'](_0x42c8ba)[_0xc207('0x1f')](function(_0x3ac142){_0x131dc8({'code':0xc8,'message':_0x3ac142[_0xc207('0x20')]});})[_0xc207('0x1b')](function(_0x3539f4){_0x461f6a(_0x33ddb1[_0xc207('0x11')](0x1f5,_0x3539f4[_0xc207('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1493fb){var _0xa52138=[];for(var _0x2385f7 in _0x59bc89[_0xc207('0x21')]){if(_0x59bc89[_0xc207('0x21')][_0xc207('0x22')](_0x2385f7)){var _0x138970=_0x59bc89[_0xc207('0x21')][_0x2385f7];var _0x56a066=new VoiceQueueSummary(_0x138970);_0xa52138[_0xc207('0x23')](_0x56a066);}}_0x1493fb({'count':_0xa52138['length'],'rows':_0xa52138});});},'UpdateVoiceQueue':function(_0x4cb3af){return new Promise(function(_0x18ef72,_0x3a05f3){var _0x2e41b1=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x21')],{'id':parseInt(_0x4cb3af['id'])});var _0x478af7=_[_0xc207('0x25')](_0x4cb3af,['id']);if(_0x2e41b1){for(var _0x463ac8 in _0x478af7){if(typeof _0x478af7[_0x463ac8]!==_0xc207('0x26')&&typeof _0x2e41b1[_0x463ac8]!==_0xc207('0x26')){_0x2e41b1[_0x463ac8]=_0x478af7[_0x463ac8];}}_0x18ef72(_0x2e41b1);}else{_0x3a05f3();}});},'VoiceChannels':function(){return new Promise(function(_0x11a647){var _0x2ce847=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x28')]);_0x11a647({'count':_0x2ce847[_0xc207('0x29')],'rows':_0x2ce847});});},'VoiceChannelMixMonitor':function(_0x3f79e8){var _0x2043cf=this;return new Promise(function(_0xaa1b54,_0x3cd4b4){if(ami['isConnected']()==![]){return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config[_0xc207('0x12')][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x47d4c9=schema(properties[_0xc207('0x2a')])[_0xc207('0x2')](_0x3f79e8);if(_0x47d4c9[_0xc207('0x29')]>0x0){return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f4,_['map'](_0x47d4c9,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x3b05fd=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x28')],{'uniqueid':_0x3f79e8[_0xc207('0x2b')]});if(_0x3b05fd&&_0x3b05fd[_0xc207('0x2c')]){var _0x458de9=util[_0xc207('0x8')]('%s.%s',_0x3f79e8['filename']||_0x3f79e8[_0xc207('0x2b')],_0x3f79e8[_0xc207('0x8')]||_0xc207('0x2d'));return ami[_0xc207('0x19')]({'action':'MixMonitor','channel':_0x3b05fd[_0xc207('0x2c')],'file':_0x458de9,'options':_0xc207('0x2e')})[_0xc207('0x1f')](function(_0x2a1c60){var _0x1fa850=_['find'](_0x3b05fd[_0xc207('0x2f')],{'filename':_0xc207('0x30')+_0x458de9['toLowerCase']()});if(_[_0xc207('0x31')](_0x1fa850)){_0x3b05fd['monitors'][_0xc207('0x23')]({'filename':_0xc207('0x30')+_0x458de9['toLowerCase'](),'createdAt':moment()[_0xc207('0x8')](_0xc207('0x32')),'mixmonitorid':_0x2a1c60[_0xc207('0x33')],'status':'rec'});}else{_0x1fa850['mixmonitorid']=_0x2a1c60[_0xc207('0x33')];_0x1fa850[_0xc207('0x34')]=_0xc207('0x35');}_0xaa1b54({'code':0xc8,'message':[_0x3f79e8[_0xc207('0x2b')],'MixMonitor\x20Success',_0x2a1c60[_0xc207('0x33')]]['join']('\x20'),'mixmonitorid':_0x2a1c60['mixmonitorid']});})['catch'](function(_0x5c05fb){_0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f5,[_0x3f79e8[_0xc207('0x2b')],_0x5c05fb[_0xc207('0x1a')]['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x3cd4b4(_0x2043cf[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceChannelStopMixMonitor':function(_0x5ae1ab){var _0x48efac=this;return new Promise(function(_0x47d43a,_0x223349){if(ami[_0xc207('0x10')]()==![]){return _0x223349(_0x48efac[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x471a85=schema(properties[_0xc207('0x2a')])[_0xc207('0x2')](_0x5ae1ab);if(_0x471a85[_0xc207('0x29')]>0x0){return _0x223349(_0x48efac[_0xc207('0x11')](0x1f4,_[_0xc207('0x37')](_0x471a85,'message')[_0xc207('0x15')](',\x20')));}var _0x16ed4f=_['find'](_0x59bc89[_0xc207('0x28')],{'uniqueid':_0x5ae1ab[_0xc207('0x2b')]});if(_0x16ed4f){return Promise[_0xc207('0x38')]()[_0xc207('0x1f')](function(){if(_0x16ed4f[_0xc207('0x2c')]){return ami['Action']({'action':_0xc207('0x39'),'channel':_0x16ed4f[_0xc207('0x2c')],'mixmonitorid':_0x5ae1ab[_0xc207('0x33')]})['catch'](function(){});}})[_0xc207('0x1f')](function(){if(_0x16ed4f[_0xc207('0x3a')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x39'),'channel':_0x16ed4f['destinationchannel'],'mixmonitorid':_0x5ae1ab['mixmonitorid']})[_0xc207('0x1b')](function(){});}})[_0xc207('0x1f')](function(){var _0x45fa1d=_[_0xc207('0x24')](_0x16ed4f[_0xc207('0x2f')],{'mixmonitorid':_0x5ae1ab[_0xc207('0x33')]});if(_0x45fa1d){_0x45fa1d[_0xc207('0x34')]=_0xc207('0x3b');}})[_0xc207('0x1f')](function(){var _0x212552=util[_0xc207('0x8')](_0xc207('0x3c'),_0x5ae1ab['filename']||_0x5ae1ab['uniqueid'],_0x5ae1ab[_0xc207('0x8')]||_0xc207('0x2d'));var _0x2468d0=_['find'](_0x16ed4f[_0xc207('0x2f')],{'filename':_0xc207('0x30')+_0x212552[_0xc207('0x3d')]()});if(_0x2468d0){_0x2468d0[_0xc207('0x34')]='stop';}})[_0xc207('0x1f')](function(){_0x47d43a({'code':0xc8,'message':[_0x5ae1ab['uniqueid'],_0xc207('0x3e')]['join']('\x20')});})['catch'](function(_0x21d9b5){_0x223349(_0x48efac[_0xc207('0x11')](0x1f5,[_0x5ae1ab['uniqueid'],_0x21d9b5['message']['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x223349(_0x48efac[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceQueuesChannels':function(_0x1acc33){var _0x173acf=this;return new Promise(function(_0x35e967){var _0x3dc457=_[_0xc207('0x27')](_0x59bc89['queueChannels']);var _0x26bcfe={'count':_0x3dc457[_0xc207('0x29')],'rows':_0x3dc457};if(_0x1acc33&&_0x1acc33['type']){if(!['inbound',_0xc207('0x3f')]['includes'](_0x1acc33['type'])){return _0x314561(_0x173acf[_0xc207('0x11')](0x190,_0xc207('0x40')));}var _0x356c8c=_[_0xc207('0x41')](_0x3dc457,function(_0x3583b8){return _0x3583b8[_0xc207('0x42')]===_0x1acc33[_0xc207('0x42')];});_0x26bcfe[_0xc207('0x43')]=_0x356c8c[_0xc207('0x29')];_0x26bcfe[_0xc207('0x44')]=_0x356c8c;}_0x35e967(_0x26bcfe);});},'VoiceQueuesChannel':function(_0x2fcfee){var _0x5cd180=this;return new Promise(function(_0x529a21,_0x42d9a0){var _0x246f5b=schema(properties[_0xc207('0x45')])[_0xc207('0x2')](_0x2fcfee);if(_0x246f5b[_0xc207('0x29')]>0x0){return _0x42d9a0(_0x5cd180[_0xc207('0x11')](0x1f4,_[_0xc207('0x37')](_0x246f5b,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x49e724=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x2fcfee[_0xc207('0x2b')]});if(_0x49e724){_0x529a21(_0x49e724);}else{return _0x42d9a0(_0x5cd180[_0xc207('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x448f14){var _0x22cdf9=this;return new Promise(function(_0x22625d,_0x409b2d){if(ami[_0xc207('0x10')]()==![]){return _0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x298342=schema(properties['voicequeuechannelhangup'])[_0xc207('0x2')](_0x448f14);if(_0x298342['length']>0x0){return _0x409b2d(_0x22cdf9['error'](0x1f4,_[_0xc207('0x37')](_0x298342,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0x2ebda4=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x448f14[_0xc207('0x2b')]});if(_0x2ebda4&&_0x2ebda4[_0xc207('0x2c')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x47'),'channel':_0x2ebda4[_0xc207('0x2c')]})[_0xc207('0x1f')](function(_0x416e85){_0x22625d({'code':0xc8,'message':[_0x448f14[_0xc207('0x2b')],_0x416e85[_0xc207('0x1a')]['toLowerCase']()][_0xc207('0x15')]('\x20')});})['catch'](function(_0x29b49a){_0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f5,[_0x448f14[_0xc207('0x2b')],_0x29b49a['message']['toLowerCase']()][_0xc207('0x15')]('\x20')));});}else{return _0x409b2d(_0x22cdf9[_0xc207('0x11')](0x1f5,_0xc207('0x36')));}});},'VoiceQueuesChannelRedirect':function(_0x51a3c1){var _0x31182c=this;return new Promise(function(_0x1cefa3,_0x3509d8){if(ami['isConnected']()==![]){return _0x3509d8(_0x31182c['error'](0x1f4,[config[_0xc207('0x12')]['ip'],config['asterisk'][_0xc207('0x13')],_0xc207('0x14')][_0xc207('0x15')]('\x20')));}var _0x4b197=schema(properties[_0xc207('0x48')])[_0xc207('0x2')](_0x51a3c1);if(_0x4b197[_0xc207('0x29')]>0x0){return _0x3509d8(_0x31182c[_0xc207('0x11')](0x1f4,_['map'](_0x4b197,_0xc207('0x1a'))[_0xc207('0x15')](',\x20')));}var _0xa34ab5=_[_0xc207('0x24')](_0x59bc89[_0xc207('0x46')],{'uniqueid':_0x51a3c1[_0xc207('0x2b')]});if(_0xa34ab5&&_0xa34ab5[_0xc207('0x2c')]){return ami[_0xc207('0x19')]({'action':_0xc207('0x49'),'channel':_0xa34ab5[_0xc207('0x2c')],'exten':_0x51a3c1[_0xc207('0x4a')],'context':_0x51a3c1['context']||_0xa34ab5[_0xc207('0x4b')],'priority':0x1})[_0xc207('0x1f')](function(_0x45b4fb){_0x1cefa3({'code':0xc8,'message':[_0x51a3c1[_0xc207('0x2b')],_0x45b4fb['message']['toLowerCase']()][_0xc207('0x15')]('\x20')});})[_0xc207('0x1b')](function(_0x34f784){_0x3509d8(_0x31182c[_0xc207('0x11')](0x1f5,[_0x51a3c1['uniqueid'],_0x34f784[_0xc207('0x1a')][_0xc207('0x3d')]()][_0xc207('0x15')]('\x20')));});}else{return _0x3509d8(_0x31182c['error'](0x1f5,_0xc207('0x36')));}});},'Agents':function(_0x369b2d){return new Promise(function(_0x322b68){var _0x5a8241=_[_0xc207('0x27')](_0x59bc89['agents']);if(_0x369b2d&&_0x369b2d['id']){var _0x1290e4=_['find'](_0x5a8241,function(_0xf68aae){return _0xf68aae['id']===_0x369b2d['id'];});_0x322b68(_0x1290e4);}else{_0x322b68({'count':_0x5a8241[_0xc207('0x29')],'rows':_0x5a8241});}});},'Telephones':function(){return new Promise(function(_0x598fdb){var _0x2e0ead=_['values'](_0x59bc89[_0xc207('0x4c')]);_0x598fdb({'count':_0x2e0ead[_0xc207('0x29')],'rows':_0x2e0ead});});},'Trunks':function(){return new Promise(function(_0x3fad98){var _0x177e74=_[_0xc207('0x27')](_0x59bc89['trunks']);_0x3fad98({'count':_0x177e74['length'],'rows':_0x177e74});});},'OutboundChannels':function(){return new Promise(function(_0x3d1659){var _0x28b166=_['values'](_0x59bc89[_0xc207('0x4d')]);_0x3d1659({'count':_0x28b166[_0xc207('0x29')],'rows':_0x28b166});});},'Outbound':function(){return new Promise(function(_0x52d7f1){_0x52d7f1(_0x59bc89[_0xc207('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0x13954e){var _0x4fca05=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x4e')]);_0x13954e({'count':_0x4fca05[_0xc207('0x29')],'rows':_0x4fca05});});},'VoiceQueuesPreview':function(_0x1d550d){var _0x13c415=this;return new Promise(function(_0xef037c,_0x5be1e7){_0x5a727b['run'](_0x1d550d['id'])[_0xc207('0x1f')](function(_0x237df5){_0xef037c({'code':0xc8,'message':_0x237df5[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x7fd1a3){_0x5be1e7(_0x13c415['error'](0x1f4,_0x7fd1a3[_0xc207('0x1a')]));});});},'EventManager':function(_0x4f79b3){var _0x6b1089=this;return new Promise(function(_0x97f43,_0x47145a){if(!_0x4f79b3[_0xc207('0x4f')]){return _0x47145a(_0x6b1089[_0xc207('0x11')](0x1f4,_0xc207('0x50')));}ami['emit'](_0xc207('0x51')+_0x4f79b3[_0xc207('0x4f')],_0x4f79b3['message']);_0x97f43({'code':0xc8,'message':_0x4f79b3});});},'FaxAccounts':function(){return new Promise(function(_0x1e5aaf){var _0xf2f689=_[_0xc207('0x27')](_0x59bc89[_0xc207('0x52')]);_0x1e5aaf({'count':_0xf2f689[_0xc207('0x29')],'rows':_0xf2f689});});},'SendFax':function(_0x42d79e){var _0x9be0d2=this;return new Promise(function(_0x3a552c,_0x3bd56c){_0x55023e[_0xc207('0x53')](_0x42d79e)[_0xc207('0x1f')](function(_0x28d245){_0x3a552c({'code':0xc8,'message':_0x28d245[_0xc207('0x1a')]});})['catch'](function(_0x32a7ad){_0x3bd56c(_0x9be0d2[_0xc207('0x11')](0x1f4,_0x32a7ad[_0xc207('0x1a')]));});});},'CheckAfterSend':function(_0x266e65){var _0x48bed7=this;return new Promise(function(_0x327b9f,_0x49f0db){_0x55023e[_0xc207('0x54')](_0x266e65)['then'](function(_0x53cb21){_0x327b9f({'code':0xc8,'message':_0x53cb21[_0xc207('0x1a')]});})[_0xc207('0x1b')](function(_0x383f83){_0x49f0db(_0x48bed7[_0xc207('0x11')](0x1f4,_0x383f83[_0xc207('0x1a')]));});});}};var _0x1bdd51=jayson['server'](_0x3395e4)[_0xc207('0x55')]();_0x1bdd51['on']('error',function(_0x3bb53a){return _0x314561(_0x3bb53a);});_0x1bdd51[_0xc207('0x7')](0x232a,_0xc207('0x56'),function(){console[_0xc207('0x57')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xc88789(_0xc207('0x58')+0x232a);});});}; \ No newline at end of file +var _0x2123=['rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','queueChannels','inbound','outbound','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','custom:','faxAccounts','send','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','Command','content','catch','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid'];(function(_0x2e17ee,_0x2ca16d){var _0x3155ba=function(_0x3e2f01){while(--_0x3e2f01){_0x2e17ee['push'](_0x2e17ee['shift']());}};_0x3155ba(++_0x2ca16d);}(_0x2123,0x190));var _0x3212=function(_0x2e62d9,_0x21a5af){_0x2e62d9=_0x2e62d9-0x0;var _0x307cc4=_0x2123[_0x2e62d9];return _0x307cc4;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var jayson=require(_0x3212('0x2'));var schema=require(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var config=require(_0x3212('0x5'));var properties=require(_0x3212('0x6'));var ami=require(_0x3212('0x7'));var VoiceQueueSummary=require(_0x3212('0x8'));exports[_0x3212('0x9')]=function(_0x37058e,_0x265328,_0x5d9d36){return new Promise(function(_0x3859e4,_0x2b1302){var _0x1fec5d={'QueuePause':function(_0x4b35e9){return new Promise(function(_0x3e17a3){var _0x56c38f=util[_0x3212('0xa')](_0x3212('0xb'),_0x3212('0xc'),_0x4b35e9[_0x3212('0xd')]);if(_0x37058e['timers']&&_0x37058e['timers'][_0x56c38f]&&_0x37058e[_0x3212('0xe')][_0x56c38f][_0x3212('0xf')]){_0x37058e[_0x3212('0xe')][_0x56c38f][_0x3212('0x10')]();}if(_0x37058e[_0x3212('0x11')][_0x56c38f]){_0x37058e[_0x3212('0x11')][_0x56c38f][_0x3212('0x12')]({'statePause':_0x4b35e9[_0x3212('0x13')]?!![]:![]});}_0x3e17a3({'code':0xc8,'message':_0x3212('0x14')});});},'Reload':function(_0x2d5fce){var _0x40745f=this;return new Promise(function(_0x2e4cf0,_0x9f0bc){if(ami[_0x3212('0x15')]()==![]){return _0x9f0bc(_0x40745f[_0x3212('0x16')](0x1f4,[config[_0x3212('0x17')]['ip'],config[_0x3212('0x17')][_0x3212('0x18')],_0x3212('0x19')][_0x3212('0x1a')]('\x20')));}_0x2d5fce=_[_0x3212('0x1b')](_0x2d5fce,_[_0x3212('0x1c')](properties['reload'][_0x3212('0x1d')]));_0x2d5fce[_0x3212('0x1e')]=_0x3212('0x1f');return ami[_0x3212('0x20')](_0x2d5fce)[_0x3212('0x21')](function(_0x34ce95){_0x2e4cf0({'code':0xc8,'message':_0x34ce95[_0x3212('0x22')]});})['catch'](function(_0x4c1158){_0x9f0bc(_0x40745f[_0x3212('0x16')](0x1f5,_0x4c1158['message']));});});},'Command':function(_0x2380e8){var _0x41237c=this;return new Promise(function(_0xb0b717,_0x28a4cd){if(ami[_0x3212('0x15')]()==![]){return _0x28a4cd(_0x41237c['error'](0x1f4,[config[_0x3212('0x17')]['ip'],config[_0x3212('0x17')]['username'],_0x3212('0x19')][_0x3212('0x1a')]('\x20')));}_0x2380e8=_[_0x3212('0x1b')](_0x2380e8,'command');_0x2380e8['action']=_0x3212('0x23');return ami[_0x3212('0x20')](_0x2380e8)[_0x3212('0x21')](function(_0x3b1c35){_0xb0b717({'code':0xc8,'message':_0x3b1c35[_0x3212('0x24')]});})[_0x3212('0x25')](function(_0x47d941){_0x28a4cd(_0x41237c['error'](0x1f5,_0x47d941[_0x3212('0x22')]));});});},'VoiceQueues':function(){return new Promise(function(_0x47cfdc){var _0x24cdf3=[];for(var _0x3108a6 in _0x37058e[_0x3212('0x26')]){if(_0x37058e['voiceQueues'][_0x3212('0x27')](_0x3108a6)){var _0x32f7fd=_0x37058e[_0x3212('0x26')][_0x3108a6];var _0x4de92e=new VoiceQueueSummary(_0x32f7fd);_0x24cdf3[_0x3212('0x28')](_0x4de92e);}}_0x47cfdc({'count':_0x24cdf3[_0x3212('0x29')],'rows':_0x24cdf3});});},'UpdateVoiceQueue':function(_0x108eee){return new Promise(function(_0x443a5,_0x21f003){var _0x1638c5=_[_0x3212('0x2a')](_0x37058e[_0x3212('0x26')],{'id':parseInt(_0x108eee['id'])});var _0x1de338=_[_0x3212('0x2b')](_0x108eee,['id']);if(_0x1638c5){for(var _0x31c672 in _0x1de338){if(typeof _0x1de338[_0x31c672]!==_0x3212('0x2c')&&typeof _0x1638c5[_0x31c672]!=='undefined'){_0x1638c5[_0x31c672]=_0x1de338[_0x31c672];}}_0x443a5(_0x1638c5);}else{_0x21f003();}});},'VoiceChannels':function(){return new Promise(function(_0x1e2660){var _0x265368=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x2e')]);_0x1e2660({'count':_0x265368[_0x3212('0x29')],'rows':_0x265368});});},'VoiceChannelMixMonitor':function(_0x309420){var _0x3a7883=this;return new Promise(function(_0x5059bd,_0x3cbd1a){if(ami['isConnected']()==![]){return _0x3cbd1a(_0x3a7883[_0x3212('0x16')](0x1f4,[config['asterisk']['ip'],config[_0x3212('0x17')]['username'],'ami\x20disconnected'][_0x3212('0x1a')]('\x20')));}var _0x571ae0=schema(properties[_0x3212('0x2f')])[_0x3212('0x3')](_0x309420);if(_0x571ae0[_0x3212('0x29')]>0x0){return _0x3cbd1a(_0x3a7883['error'](0x1f4,_[_0x3212('0x30')](_0x571ae0,_0x3212('0x22'))[_0x3212('0x1a')](',\x20')));}var _0x487ce4=_[_0x3212('0x2a')](_0x37058e[_0x3212('0x2e')],{'uniqueid':_0x309420[_0x3212('0x31')]});if(_0x487ce4&&_0x487ce4[_0x3212('0x32')]){var _0xc690c4=util['format'](_0x3212('0x33'),_0x309420[_0x3212('0x34')]||_0x309420[_0x3212('0x31')],_0x309420['format']||_0x3212('0x35'));return ami[_0x3212('0x20')]({'action':_0x3212('0x36'),'channel':_0x487ce4[_0x3212('0x32')],'file':_0xc690c4,'options':'ai(mixmonitorid)'})[_0x3212('0x21')](function(_0x3f157c){var _0xf5d848=_[_0x3212('0x2a')](_0x487ce4['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xc690c4['toLowerCase']()});if(_['isNil'](_0xf5d848)){_0x487ce4[_0x3212('0x37')][_0x3212('0x28')]({'filename':_0x3212('0x38')+_0xc690c4[_0x3212('0x39')](),'createdAt':moment()['format'](_0x3212('0x3a')),'mixmonitorid':_0x3f157c[_0x3212('0x3b')],'status':_0x3212('0x3c')});}else{_0xf5d848[_0x3212('0x3b')]=_0x3f157c['mixmonitorid'];_0xf5d848['status']=_0x3212('0x3c');}_0x5059bd({'code':0xc8,'message':[_0x309420[_0x3212('0x31')],_0x3212('0x3d'),_0x3f157c[_0x3212('0x3b')]][_0x3212('0x1a')]('\x20'),'mixmonitorid':_0x3f157c[_0x3212('0x3b')]});})[_0x3212('0x25')](function(_0x52860f){_0x3cbd1a(_0x3a7883[_0x3212('0x16')](0x1f5,[_0x309420[_0x3212('0x31')],_0x52860f[_0x3212('0x22')][_0x3212('0x39')]()]['join']('\x20')));});}else{return _0x3cbd1a(_0x3a7883[_0x3212('0x16')](0x1f5,_0x3212('0x3e')));}});},'VoiceChannelStopMixMonitor':function(_0x1c71f7){var _0x262564=this;return new Promise(function(_0x572429,_0xb365f7){if(ami['isConnected']()==![]){return _0xb365f7(_0x262564[_0x3212('0x16')](0x1f4,[config[_0x3212('0x17')]['ip'],config[_0x3212('0x17')][_0x3212('0x18')],_0x3212('0x19')][_0x3212('0x1a')]('\x20')));}var _0x14626d=schema(properties[_0x3212('0x2f')])['validate'](_0x1c71f7);if(_0x14626d[_0x3212('0x29')]>0x0){return _0xb365f7(_0x262564[_0x3212('0x16')](0x1f4,_[_0x3212('0x30')](_0x14626d,_0x3212('0x22'))[_0x3212('0x1a')](',\x20')));}var _0x36ccb2=_[_0x3212('0x2a')](_0x37058e['channels'],{'uniqueid':_0x1c71f7[_0x3212('0x31')]});if(_0x36ccb2){return Promise[_0x3212('0x3f')]()[_0x3212('0x21')](function(){if(_0x36ccb2[_0x3212('0x32')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x36ccb2['channel'],'mixmonitorid':_0x1c71f7['mixmonitorid']})[_0x3212('0x25')](function(){});}})['then'](function(){if(_0x36ccb2[_0x3212('0x40')]){return ami[_0x3212('0x20')]({'action':_0x3212('0x41'),'channel':_0x36ccb2[_0x3212('0x40')],'mixmonitorid':_0x1c71f7['mixmonitorid']})[_0x3212('0x25')](function(){});}})[_0x3212('0x21')](function(){var _0x75286f=_['find'](_0x36ccb2[_0x3212('0x37')],{'mixmonitorid':_0x1c71f7[_0x3212('0x3b')]});if(_0x75286f){_0x75286f[_0x3212('0x42')]=_0x3212('0x43');}})['then'](function(){var _0x3ede8c=util[_0x3212('0xa')]('%s.%s',_0x1c71f7[_0x3212('0x34')]||_0x1c71f7[_0x3212('0x31')],_0x1c71f7[_0x3212('0xa')]||'wav');var _0x4c87d7=_[_0x3212('0x2a')](_0x36ccb2[_0x3212('0x37')],{'filename':_0x3212('0x38')+_0x3ede8c['toLowerCase']()});if(_0x4c87d7){_0x4c87d7[_0x3212('0x42')]=_0x3212('0x43');}})['then'](function(){_0x572429({'code':0xc8,'message':[_0x1c71f7[_0x3212('0x31')],_0x3212('0x44')][_0x3212('0x1a')]('\x20')});})['catch'](function(_0x523310){_0xb365f7(_0x262564[_0x3212('0x16')](0x1f5,[_0x1c71f7[_0x3212('0x31')],_0x523310[_0x3212('0x22')][_0x3212('0x39')]()]['join']('\x20')));});}else{return _0xb365f7(_0x262564[_0x3212('0x16')](0x1f5,_0x3212('0x3e')));}});},'VoiceQueuesChannels':function(_0x3ab8c0){var _0x541998=this;return new Promise(function(_0x1e77b3){var _0x4ff331=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x45')]);var _0x3304db={'count':_0x4ff331[_0x3212('0x29')],'rows':_0x4ff331};if(_0x3ab8c0&&_0x3ab8c0['type']){if(![_0x3212('0x46'),_0x3212('0x47')]['includes'](_0x3ab8c0[_0x3212('0x48')])){return _0x2b1302(_0x541998[_0x3212('0x16')](0x190,_0x3212('0x49')));}var _0x1639df=_[_0x3212('0x4a')](_0x4ff331,function(_0x1fa578){return _0x1fa578[_0x3212('0x48')]===_0x3ab8c0['type'];});_0x3304db[_0x3212('0x4b')]=_0x1639df[_0x3212('0x29')];_0x3304db[_0x3212('0x4c')]=_0x1639df;}_0x1e77b3(_0x3304db);});},'VoiceQueuesChannel':function(_0x8f9c82){var _0x54a6df=this;return new Promise(function(_0x5a6050,_0x5abdf6){var _0x52a506=schema(properties[_0x3212('0x4d')])['validate'](_0x8f9c82);if(_0x52a506[_0x3212('0x29')]>0x0){return _0x5abdf6(_0x54a6df[_0x3212('0x16')](0x1f4,_[_0x3212('0x30')](_0x52a506,_0x3212('0x22'))[_0x3212('0x1a')](',\x20')));}var _0x33120d=_[_0x3212('0x2a')](_0x37058e[_0x3212('0x45')],{'uniqueid':_0x8f9c82[_0x3212('0x31')]});if(_0x33120d){_0x5a6050(_0x33120d);}else{return _0x5abdf6(_0x54a6df[_0x3212('0x16')](0x1f5,_0x3212('0x3e')));}});},'VoiceQueuesChannelHangup':function(_0x587fc2){var _0x51751b=this;return new Promise(function(_0x5a8158,_0x1f111a){if(ami[_0x3212('0x15')]()==![]){return _0x1f111a(_0x51751b[_0x3212('0x16')](0x1f4,[config[_0x3212('0x17')]['ip'],config[_0x3212('0x17')][_0x3212('0x18')],'ami\x20disconnected']['join']('\x20')));}var _0x16867a=schema(properties[_0x3212('0x4e')])['validate'](_0x587fc2);if(_0x16867a['length']>0x0){return _0x1f111a(_0x51751b[_0x3212('0x16')](0x1f4,_[_0x3212('0x30')](_0x16867a,'message')[_0x3212('0x1a')](',\x20')));}var _0x1b3c60=_[_0x3212('0x2a')](_0x37058e[_0x3212('0x45')],{'uniqueid':_0x587fc2[_0x3212('0x31')]});if(_0x1b3c60&&_0x1b3c60['channel']){return ami[_0x3212('0x20')]({'action':_0x3212('0x4f'),'channel':_0x1b3c60[_0x3212('0x32')]})[_0x3212('0x21')](function(_0x581eb8){_0x5a8158({'code':0xc8,'message':[_0x587fc2[_0x3212('0x31')],_0x581eb8[_0x3212('0x22')][_0x3212('0x39')]()]['join']('\x20')});})[_0x3212('0x25')](function(_0x83a499){_0x1f111a(_0x51751b[_0x3212('0x16')](0x1f5,[_0x587fc2[_0x3212('0x31')],_0x83a499['message'][_0x3212('0x39')]()][_0x3212('0x1a')]('\x20')));});}else{return _0x1f111a(_0x51751b[_0x3212('0x16')](0x1f5,_0x3212('0x3e')));}});},'VoiceQueuesChannelRedirect':function(_0x49afb3){var _0x8564fa=this;return new Promise(function(_0x3f35a9,_0x4162ae){if(ami[_0x3212('0x15')]()==![]){return _0x4162ae(_0x8564fa['error'](0x1f4,[config[_0x3212('0x17')]['ip'],config[_0x3212('0x17')][_0x3212('0x18')],_0x3212('0x19')][_0x3212('0x1a')]('\x20')));}var _0x3ae978=schema(properties[_0x3212('0x50')])[_0x3212('0x3')](_0x49afb3);if(_0x3ae978[_0x3212('0x29')]>0x0){return _0x4162ae(_0x8564fa['error'](0x1f4,_['map'](_0x3ae978,_0x3212('0x22'))[_0x3212('0x1a')](',\x20')));}var _0x4a8d7e=_[_0x3212('0x2a')](_0x37058e[_0x3212('0x45')],{'uniqueid':_0x49afb3[_0x3212('0x31')]});if(_0x4a8d7e&&_0x4a8d7e[_0x3212('0x32')]){return ami['Action']({'action':_0x3212('0x51'),'channel':_0x4a8d7e[_0x3212('0x32')],'exten':_0x49afb3[_0x3212('0x52')],'context':_0x49afb3[_0x3212('0x53')]||_0x4a8d7e[_0x3212('0x53')],'priority':0x1})[_0x3212('0x21')](function(_0x59ebc2){_0x3f35a9({'code':0xc8,'message':[_0x49afb3[_0x3212('0x31')],_0x59ebc2[_0x3212('0x22')]['toLowerCase']()]['join']('\x20')});})[_0x3212('0x25')](function(_0xfd4d70){_0x4162ae(_0x8564fa[_0x3212('0x16')](0x1f5,[_0x49afb3[_0x3212('0x31')],_0xfd4d70[_0x3212('0x22')]['toLowerCase']()][_0x3212('0x1a')]('\x20')));});}else{return _0x4162ae(_0x8564fa[_0x3212('0x16')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0xa7fb5){return new Promise(function(_0x41af6d){var _0x4e43dd=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x11')]);if(_0xa7fb5&&_0xa7fb5['id']){var _0x1653b0=_['find'](_0x4e43dd,function(_0x304e0a){return _0x304e0a['id']===_0xa7fb5['id'];});_0x41af6d(_0x1653b0);}else{_0x41af6d({'count':_0x4e43dd['length'],'rows':_0x4e43dd});}});},'Telephones':function(){return new Promise(function(_0x593d31){var _0x58b9ad=_[_0x3212('0x2d')](_0x37058e['telephones']);_0x593d31({'count':_0x58b9ad[_0x3212('0x29')],'rows':_0x58b9ad});});},'Trunks':function(){return new Promise(function(_0x53ef60){var _0x30c897=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x54')]);_0x53ef60({'count':_0x30c897[_0x3212('0x29')],'rows':_0x30c897});});},'OutboundChannels':function(){return new Promise(function(_0x99fb9b){var _0x5aa666=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x55')]);_0x99fb9b({'count':_0x5aa666[_0x3212('0x29')],'rows':_0x5aa666});});},'Outbound':function(){return new Promise(function(_0x3ed543){_0x3ed543(_0x37058e[_0x3212('0x47')]);});},'Campaigns':function(){return new Promise(function(_0xba63){var _0x5c6a97=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x56')]);_0xba63({'count':_0x5c6a97[_0x3212('0x29')],'rows':_0x5c6a97});});},'VoiceQueuesPreview':function(_0x1d9afc){var _0x45c5ec=this;return new Promise(function(_0xe68c69,_0x1de5ea){_0x265328[_0x3212('0x57')](_0x1d9afc['id'])[_0x3212('0x21')](function(_0x3365d3){_0xe68c69({'code':0xc8,'message':_0x3365d3['message']});})['catch'](function(_0x10e970){_0x1de5ea(_0x45c5ec[_0x3212('0x16')](0x1f4,_0x10e970['message']));});});},'EventManager':function(_0x2addc5){var _0x5db3ec=this;return new Promise(function(_0x513e7a,_0x544134){if(!_0x2addc5['event']){return _0x544134(_0x5db3ec['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x3212('0x58')+_0x2addc5['event'],_0x2addc5[_0x3212('0x22')]);_0x513e7a({'code':0xc8,'message':_0x2addc5});});},'FaxAccounts':function(){return new Promise(function(_0x221882){var _0x20a308=_[_0x3212('0x2d')](_0x37058e[_0x3212('0x59')]);_0x221882({'count':_0x20a308[_0x3212('0x29')],'rows':_0x20a308});});},'SendFax':function(_0x566ea2){var _0xa21686=this;return new Promise(function(_0x1e4a42,_0x5a95ff){_0x5d9d36[_0x3212('0x5a')](_0x566ea2)[_0x3212('0x21')](function(_0x177a58){_0x1e4a42({'code':0xc8,'message':_0x177a58['message']});})[_0x3212('0x25')](function(_0x4c8dc8){_0x5a95ff(_0xa21686[_0x3212('0x16')](0x1f4,_0x4c8dc8[_0x3212('0x22')]));});});},'CheckAfterSend':function(_0x56b939){var _0x5488aa=this;return new Promise(function(_0x52062c,_0xde26b1){_0x5d9d36['checkAfterSend'](_0x56b939)['then'](function(_0x45fe83){_0x52062c({'code':0xc8,'message':_0x45fe83[_0x3212('0x22')]});})[_0x3212('0x25')](function(_0xef13c0){_0xde26b1(_0x5488aa[_0x3212('0x16')](0x1f4,_0xef13c0[_0x3212('0x22')]));});});}};var _0x4f24ad=jayson['server'](_0x1fec5d)['http']();_0x4f24ad['on']('error',function(_0x467458){return _0x2b1302(_0x467458);});_0x4f24ad[_0x3212('0x9')](0x232a,'127.0.0.1',function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3859e4(_0x3212('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 29c35fb..2620360 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 _0xcc04=['','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','createdAt','scheduledAt','union','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname'];(function(_0x1a7991,_0x1e5ec4){var _0xf98856=function(_0x536d71){while(--_0x536d71){_0x1a7991['push'](_0x1a7991['shift']());}};_0xf98856(++_0x1e5ec4);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x4286ee,_0x2f1d8e){_0x4286ee=_0x4286ee-0x0;var _0x2da14a=_0xcc04[_0x4286ee];return _0x2da14a;};'use strict';var _=require(_0x4cc0('0x0'));var BPromise=require(_0x4cc0('0x1'));var Redis=require(_0x4cc0('0x2'));var util=require(_0x4cc0('0x3'));var config=require(_0x4cc0('0x4'));var logger=require(_0x4cc0('0x5'))(_0x4cc0('0x6'));var cmContactRpc=require(_0x4cc0('0x7'));config[_0x4cc0('0x8')]=_[_0x4cc0('0x9')](config['redis'],{'host':_0x4cc0('0xa'),'port':0x18eb});var io=require(_0x4cc0('0xb'))(new Redis(config['redis']));function emit(_0x34f8a9,_0x23dbc9,_0x17f22f,_0x434b93,_0x510e5d){logger[_0x4cc0('0xc')](_0x4cc0('0xd'),_0x34f8a9,_0x23dbc9['id'],_0x17f22f,_0x434b93,JSON[_0x4cc0('0xe')](_0x510e5d));io['to'](_0x17f22f)['emit'](_0x434b93,_0x510e5d);}exports[_0x4cc0('0xf')]=function(_0x4c2b09,_0x3c7d2e,_0x4ce269,_0x2c7149){var _0x86216c,_0x572720;var _0x304caf={};var _0x908ae3;var _0x2758c7=Number(_0x4ce269[_0x4cc0('0x10')]);var _0x2da707=_0x4ce269[_0x4cc0('0x11')]?Boolean(Number(_0x4ce269[_0x4cc0('0x11')])):![];var _0x3d09ce;var _0x279a13=![];if(!_[_0x4cc0('0x12')](_0x4ce269['data5'])){if(_0x4ce269[_0x4cc0('0x13')]=='1')_0x279a13=!![];}if(!_0x279a13){if(_0x2c7149[_0x4cc0('0x14')]){_0x304caf['id']=_0x2c7149[_0x4cc0('0x14')];}}if(!_0x304caf['id']){_0x304caf[_0x4cc0('0x15')]=_0x2758c7;_0x3d09ce=_0x4ce269[_0x4cc0('0x16')]&&_0x4ce269[_0x4cc0('0x16')]!=='0'?_0x4ce269['data3'][_0x4cc0('0x17')](','):[_0x4cc0('0x18')];_0x304caf[_0x4cc0('0x19')]=_['map'](_0x3d09ce,function(_0x847c58){var _0x4e3f17={};_0x4e3f17[_0x847c58]=_0x2c7149[_0x4cc0('0x1a')]?_0x2c7149['destcalleridnum']:_0x2c7149[_0x4cc0('0x1b')];return _0x4e3f17;});_0x908ae3=_0x2c7149[_0x4cc0('0x1a')]?_0x2c7149[_0x4cc0('0x1c')]:_0x2c7149[_0x4cc0('0x1b')];}var _0x131ad9=['id',_0x4cc0('0x1d'),'lastName',_0x4cc0('0x18'),_0x4cc0('0x1e'),_0x4cc0('0x1f'),_0x4cc0('0x15'),_0x4cc0('0x20'),_0x4cc0('0x21'),'updatedAt'];var _0x2ebb56=_[_0x4cc0('0x22')](_0x131ad9,_0x3d09ce);BPromise['resolve']()[_0x4cc0('0x23')](cmContactRpc['getContacts']({'attributes':_0x2ebb56,'where':_0x304caf,'phone':_0x908ae3}))['then'](function(_0x302eb8){_0x572720=_0x302eb8;if(!_[_0x4cc0('0x24')](_0x572720)){if(_0x572720[_0x4cc0('0x25')]===0x1){_0x86216c=_0x572720[0x0];logger[_0x4cc0('0xc')](_0x4cc0('0x26'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_0x86216c['id']);}else{logger[_0x4cc0('0xc')](_0x4cc0('0x28'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_[_0x4cc0('0x29')](_0x572720,'id')[_0x4cc0('0x2a')](','));}return;}else{logger[_0x4cc0('0xc')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);var _0x946f23={'ListId':_0x2758c7};var _0x1a60bb=_0x4ce269[_0x4cc0('0x2b')]&&_0x4ce269['data4']!=='0'?_0x4ce269[_0x4cc0('0x2b')]:_0x4cc0('0x18');if(_0x2da707){logger[_0x4cc0('0xc')](_0x4cc0('0x2c'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);_0x946f23[_0x1a60bb]=_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])?_0x2c7149[_0x4cc0('0x1b')]:_0x2c7149[_0x4cc0('0x1c')];if(_['isNil'](_0x2c7149[_0x4cc0('0x1a')])){_0x946f23['firstName']=_0x2c7149['calleridname']&&_0x2c7149[_0x4cc0('0x2d')]!==''?_0x2c7149[_0x4cc0('0x2d')]:_0x4cc0('0x2e');}else{_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2f')]&&_0x2c7149[_0x4cc0('0x2f')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2f')]:'Unknown';}return BPromise[_0x4cc0('0x31')]()[_0x4cc0('0x23')](cmContactRpc[_0x4cc0('0x32')](_0x946f23))[_0x4cc0('0x23')](function(_0xd45fb7){_0x86216c=_0xd45fb7;_0x572720['push'](_0xd45fb7);if(_0x86216c){logger[_0x4cc0('0xc')](_0x4cc0('0x33'),_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id'],_0x86216c['id']);}return;});}else{logger[_0x4cc0('0xc')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e['id']);_0x946f23[_0x1a60bb]=_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])?_0x2c7149[_0x4cc0('0x1b')]:_0x2c7149['destcalleridnum'];if(_[_0x4cc0('0x12')](_0x2c7149[_0x4cc0('0x1a')])){_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2d')]&&_0x2c7149[_0x4cc0('0x2d')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2d')]:'Unknown';}else{_0x946f23[_0x4cc0('0x1d')]=_0x2c7149[_0x4cc0('0x2f')]&&_0x2c7149[_0x4cc0('0x2f')]!==_0x4cc0('0x30')?_0x2c7149[_0x4cc0('0x2f')]:_0x4cc0('0x2e');}_0x86216c=_0x946f23;_0x572720['push'](_0x946f23);return;}}})[_0x4cc0('0x23')](function(){if(_0x4c2b09){emit(_0x2c7149[_0x4cc0('0x27')],_0x3c7d2e,util[_0x4cc0('0x34')]('user:%s',_0x4c2b09['name']),util[_0x4cc0('0x34')]('trigger:%s',_0x4ce269[_0x4cc0('0x35')][_0x4cc0('0x36')]()),{'evt':_[_0x4cc0('0x37')](_0x2c7149,{'autoCreate':_0x2da707}),'contact':_0x86216c===undefined?{}:_0x86216c,'contacts':_0x572720['length']===0x0?undefined:_0x572720});}});}; \ No newline at end of file +var _0xbecf=['calleridname','','destcalleridname','Unknown','resolve','createContact','push','format','user:%s','toLowerCase','merge','length','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','mobile','fax','createdAt','scheduledAt','union','then','getContacts','isEmpty','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbecf,0x15c));var _0xfbec=function(_0x4c5e2e,_0x504df7){_0x4c5e2e=_0x4c5e2e-0x0;var _0x909336=_0xbecf[_0x4c5e2e];return _0x909336;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xfbec('0x0'));var util=require(_0xfbec('0x1'));var config=require(_0xfbec('0x2'));var logger=require(_0xfbec('0x3'))('trigger');var cmContactRpc=require(_0xfbec('0x4'));config[_0xfbec('0x5')]=_[_0xfbec('0x6')](config[_0xfbec('0x5')],{'host':_0xfbec('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfbec('0x5')]));function emit(_0x34a717,_0x33c701,_0x410cab,_0x43bc5b,_0x312ad1){logger[_0xfbec('0x8')](_0xfbec('0x9'),_0x34a717,_0x33c701['id'],_0x410cab,_0x43bc5b,JSON[_0xfbec('0xa')](_0x312ad1));io['to'](_0x410cab)['emit'](_0x43bc5b,_0x312ad1);}exports['exec']=function(_0x4ac395,_0x2f49da,_0x271f21,_0x12d057){var _0x2d0e02,_0x2f507d;var _0x495e33={};var _0x3bfe08;var _0x2b7d99=Number(_0x271f21[_0xfbec('0xb')]);var _0x2f8a60=_0x271f21['data2']?Boolean(Number(_0x271f21[_0xfbec('0xc')])):![];var _0x411562;var _0x3f06d4=![];if(!_[_0xfbec('0xd')](_0x271f21['data5'])){if(_0x271f21[_0xfbec('0xe')]=='1')_0x3f06d4=!![];}if(!_0x3f06d4){if(_0x12d057['xmd-contactid']){_0x495e33['id']=_0x12d057[_0xfbec('0xf')];}}if(!_0x495e33['id']){_0x495e33['ListId']=_0x2b7d99;_0x411562=_0x271f21[_0xfbec('0x10')]&&_0x271f21[_0xfbec('0x10')]!=='0'?_0x271f21[_0xfbec('0x10')]['split'](','):[_0xfbec('0x11')];_0x495e33[_0xfbec('0x12')]=_[_0xfbec('0x13')](_0x411562,function(_0x47d506){var _0x148453={};_0x148453[_0x47d506]=_0x12d057[_0xfbec('0x14')]?_0x12d057[_0xfbec('0x15')]:_0x12d057[_0xfbec('0x16')];return _0x148453;});_0x3bfe08=_0x12d057[_0xfbec('0x14')]?_0x12d057[_0xfbec('0x15')]:_0x12d057[_0xfbec('0x16')];}var _0x4f2431=['id','firstName','lastName',_0xfbec('0x11'),_0xfbec('0x17'),_0xfbec('0x18'),'ListId',_0xfbec('0x19'),_0xfbec('0x1a'),'updatedAt'];var _0x3150f1=_[_0xfbec('0x1b')](_0x4f2431,_0x411562);BPromise['resolve']()[_0xfbec('0x1c')](cmContactRpc[_0xfbec('0x1d')]({'attributes':_0x3150f1,'where':_0x495e33,'phone':_0x3bfe08}))[_0xfbec('0x1c')](function(_0x43e395){_0x2f507d=_0x43e395;if(!_[_0xfbec('0x1e')](_0x2f507d)){if(_0x2f507d['length']===0x1){_0x2d0e02=_0x2f507d[0x0];logger[_0xfbec('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x12d057[_0xfbec('0x1f')],_0x2f49da['id'],_0x2d0e02['id']);}else{logger[_0xfbec('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x12d057['uniqueid'],_0x2f49da['id'],_['map'](_0x2f507d,'id')[_0xfbec('0x20')](','));}return;}else{logger[_0xfbec('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x12d057[_0xfbec('0x1f')],_0x2f49da['id']);var _0xa56be8={'ListId':_0x2b7d99};var _0x1613de=_0x271f21['data4']&&_0x271f21[_0xfbec('0x21')]!=='0'?_0x271f21[_0xfbec('0x21')]:_0xfbec('0x11');if(_0x2f8a60){logger[_0xfbec('0x8')](_0xfbec('0x22'),_0x12d057[_0xfbec('0x1f')],_0x2f49da['id']);_0xa56be8[_0x1613de]=_['isNil'](_0x12d057[_0xfbec('0x14')])?_0x12d057[_0xfbec('0x16')]:_0x12d057[_0xfbec('0x15')];if(_[_0xfbec('0xd')](_0x12d057[_0xfbec('0x14')])){_0xa56be8[_0xfbec('0x23')]=_0x12d057[_0xfbec('0x24')]&&_0x12d057['calleridname']!==_0xfbec('0x25')?_0x12d057['calleridname']:'Unknown';}else{_0xa56be8['firstName']=_0x12d057[_0xfbec('0x26')]&&_0x12d057[_0xfbec('0x26')]!==''?_0x12d057['destcalleridname']:_0xfbec('0x27');}return BPromise[_0xfbec('0x28')]()[_0xfbec('0x1c')](cmContactRpc[_0xfbec('0x29')](_0xa56be8))[_0xfbec('0x1c')](function(_0x493be4){_0x2d0e02=_0x493be4;_0x2f507d[_0xfbec('0x2a')](_0x493be4);if(_0x2d0e02){logger[_0xfbec('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x12d057[_0xfbec('0x1f')],_0x2f49da['id'],_0x2d0e02['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x12d057[_0xfbec('0x1f')],_0x2f49da['id']);_0xa56be8[_0x1613de]=_[_0xfbec('0xd')](_0x12d057[_0xfbec('0x14')])?_0x12d057[_0xfbec('0x16')]:_0x12d057['destcalleridnum'];if(_[_0xfbec('0xd')](_0x12d057[_0xfbec('0x14')])){_0xa56be8[_0xfbec('0x23')]=_0x12d057['calleridname']&&_0x12d057['calleridname']!==_0xfbec('0x25')?_0x12d057['calleridname']:_0xfbec('0x27');}else{_0xa56be8[_0xfbec('0x23')]=_0x12d057[_0xfbec('0x26')]&&_0x12d057[_0xfbec('0x26')]!==_0xfbec('0x25')?_0x12d057[_0xfbec('0x26')]:'Unknown';}_0x2d0e02=_0xa56be8;_0x2f507d['push'](_0xa56be8);return;}}})[_0xfbec('0x1c')](function(){if(_0x4ac395){emit(_0x12d057[_0xfbec('0x1f')],_0x2f49da,util[_0xfbec('0x2b')](_0xfbec('0x2c'),_0x4ac395['name']),util[_0xfbec('0x2b')]('trigger:%s',_0x271f21['action'][_0xfbec('0x2d')]()),{'evt':_[_0xfbec('0x2e')](_0x12d057,{'autoCreate':_0x2f8a60}),'contact':_0x2d0e02===undefined?{}:_0x2d0e02,'contacts':_0x2f507d[_0xfbec('0x2f')]===0x0?undefined:_0x2f507d});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index c453f51..6f151f7 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 _0xb1ad=['../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','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:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','info','stringify','emit','prototype','clone','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winArguments','data3','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','queue','routeId','buildUri','parse','query','search','replace','AllConditions','every','channel','AnyConditions','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0xb1ad,0x184));var _0xdb1a=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xb1ad[_0x1da04e];return _0xdd8c41;};'use strict';var util=require(_0xdb1a('0x0'));var _=require(_0xdb1a('0x1'));var url=require(_0xdb1a('0x2'));var Mustache=require(_0xdb1a('0x3'));var Redis=require(_0xdb1a('0x4'));var urlforward=require(_0xdb1a('0x5'));var integration=require('./integration');var cmContact=require(_0xdb1a('0x6'));var script=require(_0xdb1a('0x7'));var config=require(_0xdb1a('0x8'));var logger=require(_0xdb1a('0x9'))(_0xdb1a('0xa'));var ami=require(_0xdb1a('0xb'));config[_0xdb1a('0xc')]=_[_0xdb1a('0xd')](config[_0xdb1a('0xc')],{'host':_0xdb1a('0xe'),'port':0x18eb});var io=require(_0xdb1a('0xf'))(new Redis(config[_0xdb1a('0xc')]));var operators={'equals':function(_0xf62df9,_0x174303){return _0xf62df9==_0x174303;},'not_equals':function(_0x122af8,_0x5f0ae1){return _0x122af8!=_0x5f0ae1;}};var barAndWebActions=[_0xdb1a('0x10'),_0xdb1a('0x2'),'winapp'];function Trigger(_0x5e3bcd){this['triggers']=_0x5e3bcd[_0xdb1a('0x11')];this[_0xdb1a('0x12')]=_0x5e3bcd[_0xdb1a('0x12')];this[_0xdb1a('0x13')]=_0x5e3bcd[_0xdb1a('0x13')];this[_0xdb1a('0x14')]=_0x5e3bcd[_0xdb1a('0x14')];this[_0xdb1a('0x15')]=_0x5e3bcd[_0xdb1a('0x15')];this[_0xdb1a('0x16')]=_0x5e3bcd[_0xdb1a('0x16')];this[_0xdb1a('0x17')]=_0x5e3bcd[_0xdb1a('0x17')];this['salesforceAccounts']=_0x5e3bcd[_0xdb1a('0x18')];this[_0xdb1a('0x19')]=_0x5e3bcd[_0xdb1a('0x19')];this['zohoAccounts']=_0x5e3bcd[_0xdb1a('0x1a')];this['deskAccounts']=_0x5e3bcd[_0xdb1a('0x1b')];this[_0xdb1a('0x1c')]=_0x5e3bcd[_0xdb1a('0x1c')];this['servicenowAccounts']=_0x5e3bcd[_0xdb1a('0x1d')];this[_0xdb1a('0x1e')]=_0x5e3bcd[_0xdb1a('0x1e')];this['freshsalesAccounts']=_0x5e3bcd[_0xdb1a('0x1f')];this[_0xdb1a('0x20')]={'zendesk':this[_0xdb1a('0x16')],'salesforce':this[_0xdb1a('0x18')],'freshdesk':this[_0xdb1a('0x17')],'sugarcrm':this[_0xdb1a('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0xdb1a('0x1b')],'vtiger':this[_0xdb1a('0x1c')],'dynamics365':this[_0xdb1a('0x1e')],'freshsales':this[_0xdb1a('0x1f')],'servicenow':this[_0xdb1a('0x1d')]};ami['on'](_0xdb1a('0x21'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x24'),this[_0xdb1a('0x22')]['bind'](this));ami['on'](_0xdb1a('0x25'),this['syncCustomEvent'][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x26'),this[_0xdb1a('0x22')]['bind'](this));ami['on'](_0xdb1a('0x27'),this['syncCustomEvent'][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x28'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x29'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0xdb1a('0x2b'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x2c'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on']('custom:queuecallerabandon',this[_0xdb1a('0x22')]['bind'](this));ami['on']('custom:timeout',this[_0xdb1a('0x22')]['bind'](this));ami['on']('custom:dialbegin',this[_0xdb1a('0x2d')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x2e'),this['syncAgentDial'][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x2f'),this[_0xdb1a('0x2d')][_0xdb1a('0x23')](this));ami['on']('custom:newinteraction',this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x30'),this['syncCustomEvent'][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x31'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0xdb1a('0x32'),this[_0xdb1a('0x22')]['bind'](this));ami['on'](_0xdb1a('0x33'),this[_0xdb1a('0x22')][_0xdb1a('0x23')](this));ami['on'](_0xdb1a('0x34'),this[_0xdb1a('0x22')]['bind'](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0xdb1a('0x23')](this));}Trigger['prototype']['emit']=function(_0x1bc5ba,_0x23a3eb,_0x57feab){logger[_0xdb1a('0x35')](_0x1bc5ba,_0x23a3eb,JSON[_0xdb1a('0x36')](_0x57feab));io['to'](_0x1bc5ba)[_0xdb1a('0x37')](_0x23a3eb,_0x57feab);};Trigger[_0xdb1a('0x38')][_0xdb1a('0x22')]=function(_0x5e2147){var _0x53aac7=_[_0xdb1a('0x39')](_0x5e2147);if(typeof _0x53aac7[_0xdb1a('0x3a')]===_0xdb1a('0x3b')){_0x53aac7[_0xdb1a('0x3a')]=_0xdb1a('0x3c');}this[_0xdb1a('0x3d')](_0x53aac7);};Trigger[_0xdb1a('0x38')]['syncAgentDial']=function(_0x4008d5){if(this['agents'][_0x4008d5['interface']]){this['syncCustomEvent'](_0x4008d5);}};Trigger['prototype'][_0xdb1a('0x3d')]=function(_0x194220){var _0x17b8a9;for(var _0x3c3755 in this[_0xdb1a('0x11')]){if(this[_0xdb1a('0x11')][_0xdb1a('0x3e')](_0x3c3755)){if(this[_0xdb1a('0x11')][_0x3c3755][_0xdb1a('0x3f')]){_0x17b8a9=this[_0xdb1a('0x40')](this[_0xdb1a('0x11')][_0x3c3755],_0x194220);if(_0x17b8a9){_[_0xdb1a('0x41')](_0x194220,_0x194220[_0xdb1a('0x42')]);for(var _0x2065e8=0x0,_0xa44603,_0xa5bea9,_0x4f42fd;_0x2065e80x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x4bebed,_0x41c725){var _0x6ec19d=function(_0x439299){while(--_0x439299){_0x4bebed['push'](_0x4bebed['shift']());}};_0x6ec19d(++_0x41c725);}(_0x814b,0x1a2));var _0xb814=function(_0x2e2292,_0x1891b8){_0x2e2292=_0x2e2292-0x0;var _0x4f77ab=_0x814b[_0x2e2292];return _0x4f77ab;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index c5c89ce..d493e6f 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 _0x90d2=['phonecall','queue','callDirection','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','then','access_token','catch','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','info',']\x20Agent\x20found\x20','systemuserid','userId','length','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields'];(function(_0x5446c7,_0x3e3c0a){var _0x2417ff=function(_0x11da90){while(--_0x11da90){_0x5446c7['push'](_0x5446c7['shift']());}};_0x2417ff(++_0x3e3c0a);}(_0x90d2,0x15c));var _0x290d=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x90d2[_0x1bb58c];return _0x277586;};'use strict';var _=require('lodash');var rp=require(_0x290d('0x0'));var util=require(_0x290d('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x290d('0x2'))(_0x290d('0x3'));var config=require(_0x290d('0x4'));config[_0x290d('0x5')]=_[_0x290d('0x6')](config[_0x290d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x290d('0x5')]));function getAuthToken(_0x60ec21,_0x49ed45,_0x20a81f){if(_0x60ec21[_0x290d('0x7')]){_0x60ec21[_0x290d('0x8')]=_0x60ec21[_0x290d('0x9')][_0x290d('0xa')];_0x60ec21[_0x290d('0xb')]=_0x60ec21[_0x290d('0x9')]['data2'];return Promise[_0x290d('0xc')](_0x60ec21[_0x290d('0x9')][_0x290d('0xd')]);}var _0x1c2ac3={'method':_0x290d('0xe'),'uri':_0x49ed45,'form':{'client_id':_0x60ec21[_0x290d('0xf')],'resource':_0x60ec21['remoteUri'],'username':_0x60ec21[_0x290d('0x10')],'password':_0x60ec21[_0x290d('0x11')],'grant_type':_0x290d('0x11'),'client_secret':_0x60ec21['clientSecret']},'json':!![]};return rp(_0x1c2ac3)[_0x290d('0x12')](function(_0x2a0c30){return _0x2a0c30[_0x290d('0x13')];})[_0x290d('0x14')](function(_0x399ad9){logger['error']('['+[_0x20a81f[_0x290d('0x15')]()]+']\x20Wrong\x20credentials!');return _0x399ad9[_0x290d('0x16')];});}function getUser(_0x4c12f3,_0x438d62,_0x22f813,_0x26db11,_0x3bc536,_0x36eba5){return new Promise(function(_0x3062d7,_0x1d5dae){return getAuthToken(_0x438d62,_0x26db11,_0x36eba5)[_0x290d('0x12')](function(_0x385694){var _0x11a144={'method':'GET','uri':_0x3bc536+_0x290d('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x385694,'OData-Version':_0x290d('0x18')},'json':!![]};return rp(_0x11a144);})['then'](function(_0x1c1703){var _0x4aa25c=_0x1c1703[_0x290d('0x19')];var _0x5574c3=![];var _0x341d83=null;if(!_[_0x290d('0x1a')](_0x22f813)){if(intUtil[_0x290d('0x1b')](_0x22f813[_0x290d('0x1c')])){_0x4c12f3[_0x290d('0x1d')]=_0x22f813[_0x290d('0x1c')];for(_0x341d83=0x0;_0x341d83<_0x4aa25c['length'];_0x341d83++){if(_0x4aa25c[_0x341d83]['internalemailaddress']===_0x22f813[_0x290d('0x1c')]&&!_0x4aa25c[_0x341d83]['isdisabled']){_0x5574c3=!![];logger[_0x290d('0x1e')]('['+[_0x36eba5[_0x290d('0x15')]()]+_0x290d('0x1f')+_0x4aa25c[_0x341d83][_0x290d('0x20')]+'!');_0x4c12f3[_0x290d('0x21')]=_0x4aa25c[_0x341d83][_0x290d('0x20')];}}}}if(!_0x5574c3){logger[_0x290d('0x1e')]('['+[_0x36eba5[_0x290d('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4c12f3['userEmail']=_0x438d62[_0x290d('0x10')];for(_0x341d83=0x0;_0x341d83<_0x4aa25c[_0x290d('0x22')];_0x341d83++){if(_0x4aa25c[_0x341d83][_0x290d('0x23')]===_0x438d62['username']){_0x4c12f3[_0x290d('0x21')]=_0x4aa25c[_0x341d83]['systemuserid'];}}}_0x3062d7(_0x4c12f3);})[_0x290d('0x14')](function(_0x345803){_0x1d5dae(_0x345803[_0x290d('0x16')]);});});}function createEndUser(_0x24de74,_0x1d6cbb,_0x4ff020,_0x393ca3,_0x278e6e,_0x4f062f,_0x2dfb05){return new Promise(function(_0x256703,_0x152253){return getAuthToken(_0x1d6cbb,_0x4ff020,_0x4f062f)[_0x290d('0x12')](function(_0x45b985){var _0x2f857d=_0x4f062f[_0x290d('0x24')]()===_0x290d('0x25')?_0x278e6e[_0x290d('0x26')]:_0x278e6e[_0x290d('0x27')];var _0x23c748={'method':_0x290d('0xe'),'uri':_0x393ca3+_0x290d('0x28'),'body':{'fullname':_0x2f857d,'firstname':_0x2f857d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x290d('0x29')+_0x24de74[_0x290d('0x21')]+')'},'headers':{'Authorization':_0x290d('0x2a')+_0x45b985,'OData-Version':_0x290d('0x18')},'json':!![],'resolveWithFullResponse':!![]};_0x23c748[_0x290d('0x2b')][_0x2dfb05]=_0x2f857d;return rp(_0x23c748);})[_0x290d('0x12')](function(_0x32e469){var _0x494290=_0x32e469[_0x290d('0x2c')][_0x290d('0x2d')];var _0x49f09e=_0x494290[_0x290d('0x2e')](_0x494290[_0x290d('0x2f')]('(')+0x1,_0x494290[_0x290d('0x2f')](')'));_0x24de74[_0x290d('0x30')]=_0x49f09e;_0x256703(_0x24de74);})[_0x290d('0x14')](function(_0x5e73ec){_0x152253(_0x5e73ec[_0x290d('0x16')]);});});}function getEndUser(_0x435878,_0x4a1db3,_0x1dccee,_0x1d3372,_0x81233e,_0x40f53c,_0x2cf21a,_0xad09f6){var _0x1d38cc=_0x40f53c[_0x290d('0x24')]()===_0x290d('0x25')?_0x81233e[_0x290d('0x26')]:_0x81233e[_0x290d('0x27')];return getAuthToken(_0x4a1db3,_0x1dccee,_0x40f53c)[_0x290d('0x12')](function(_0x1f8555){_0xad09f6=_0xad09f6?_0xad09f6:_0x290d('0x31');var _0x4bf31f={'method':'GET','uri':_0x1d3372+'contacts?$select='+_0xad09f6+'&$filter='+_0xad09f6+_0x290d('0x32')+_0x1d38cc[_0x290d('0x33')]('+',_0x290d('0x34'))+'\x27','headers':{'Authorization':_0x290d('0x2a')+_0x1f8555,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bf31f);})[_0x290d('0x12')](function(_0x3a7e24){var _0x42edf0=![];if(!_0x3a7e24)return _0x42edf0;var _0x4b2362=_0x3a7e24['value'];for(var _0xc60aa3=0x0;_0xc60aa3<_0x4b2362[_0x290d('0x22')];_0xc60aa3++){if(_0x4b2362[_0xc60aa3][_0xad09f6]===_0x1d38cc){_0x42edf0=!![];_0x435878[_0x290d('0x30')]=_0x4b2362[_0xc60aa3][_0x290d('0x35')];}}return _0x42edf0;})[_0x290d('0x12')](function(_0x354226){if(_0x354226)return _0x435878;if(_0x2cf21a==='nothing'){logger[_0x290d('0x1e')]('['+[_0x40f53c[_0x290d('0x15')]()]+_0x290d('0x36'));return _0x435878;}return createEndUser(_0x435878,_0x4a1db3,_0x1dccee,_0x1d3372,_0x81233e,_0x40f53c,_0xad09f6)[_0x290d('0x12')](function(_0x2f276e){logger[_0x290d('0x1e')]('['+[_0x40f53c['toUpperCase']()]+']\x20Enduser\x20created!',_0x2f276e['enduserId']);return _0x2f276e;});});}function getCustomFields(_0x4106ef,_0x57a359,_0x5edc6c){var _0x4a68e3={};if(_0x4106ef[_0x290d('0x22')]>0x0){_[_0x290d('0x37')](_0x4106ef,function(_0x3a9849){if(_[_0x290d('0x38')]([_0x290d('0x39'),_0x290d('0x3a')],_0x3a9849[_0x290d('0x3b')])&&_0x3a9849['nameField']&&!_0x3a9849['customField']){var _0x23a4c7=_0x3a9849[_0x290d('0x3c')][_0x290d('0x24')]();var _0x5ceb79=_0x23a4c7['substring'](0x0,_0x23a4c7[_0x290d('0x3d')]('_'));var _0x3df378=_0x23a4c7[_0x290d('0x2e')](_0x23a4c7[_0x290d('0x3d')]('_')+0x1);if(_0x5ceb79===_0x5edc6c){_0x4a68e3[_0x3df378]=_0x3a9849[_0x290d('0x3e')];}}});}return _0x4a68e3;}function getTicket(_0x54dea2,_0x2d509b,_0x467a65,_0xa10762,_0x5922e6,_0x26dbd9,_0x31a5ab){return new Promise(function(_0x2134d0,_0x1d961e){var _0x40f581;return getAuthToken(_0x2d509b,_0x467a65,_0x31a5ab)['then'](function(_0x23607f){if(_0x26dbd9[_0x290d('0x3f')]===_0x290d('0x40')){_0x40f581={'method':_0x290d('0xe'),'uri':_0xa10762+_0x290d('0x41'),'body':Object[_0x290d('0x42')]({},{'title':intUtil['getString'](_0x26dbd9[_0x290d('0x43')],_0x5922e6,'\x20'),'description':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x45')],_0x5922e6,'\x0a'),'customerid_contact@odata.bind':_0x54dea2[_0x290d('0x30')]?_0x290d('0x46')+_0x54dea2['enduserId']+')':undefined,'ownerid@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x26dbd9[_0x290d('0x47')],_0x5922e6,_0x26dbd9[_0x290d('0x3f')])),'headers':{'Authorization':'Bearer\x20'+_0x23607f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26dbd9['ticketType']===_0x290d('0x48')){var _0x3e28e8=_0x54dea2['enduserId']?[{'partyid_systemuser@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','participationtypemask':_0x54dea2['callDirection']===_0x290d('0x49')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x54dea2['enduserId']+')','participationtypemask':_0x54dea2[_0x290d('0x4a')]===_0x290d('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','participationtypemask':_0x54dea2[_0x290d('0x4a')]==='queue'?0x2:0x1}];_0x40f581={'method':_0x290d('0xe'),'uri':_0xa10762+_0x290d('0x4b'),'body':Object['assign']({},{'subject':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x43')],_0x5922e6,'\x20'),'phonenumber':String(_0x5922e6[_0x290d('0x27')]),'description':intUtil[_0x290d('0x44')](_0x26dbd9[_0x290d('0x45')],_0x5922e6,'\x0a'),'regardingobjectid_contact@odata.bind':_0x54dea2[_0x290d('0x30')]?_0x290d('0x46')+_0x54dea2['enduserId']+')':undefined,'ownerid@odata.bind':_0x290d('0x29')+_0x54dea2[_0x290d('0x21')]+')','directioncode':_0x54dea2[_0x290d('0x4a')]==='queue'?![]:!![],'phonecall_activity_parties':_0x3e28e8},getCustomFields(_0x26dbd9[_0x290d('0x47')],_0x5922e6,_0x26dbd9[_0x290d('0x3f')])),'headers':{'Authorization':_0x290d('0x2a')+_0x23607f,'OData-Version':_0x290d('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x40f581);})[_0x290d('0x12')](function(_0x279bd4){var _0x158d5=_0x279bd4[_0x290d('0x2c')][_0x290d('0x2d')];var _0x1f36ed=_0x158d5['substring'](_0x158d5[_0x290d('0x2f')]('(')+0x1,_0x158d5[_0x290d('0x2f')](')'));_0x54dea2[_0x290d('0x4c')]=_0x1f36ed;_0x2134d0(_0x54dea2);})[_0x290d('0x14')](function(_0xf9a034){_0x1d961e(_0xf9a034[_0x290d('0x16')]);});});}function emit(_0x47d9c8,_0x54ca9b,_0x4c2415,_0x414667){var _0x2292d4={'uri':util[_0x290d('0x4d')](_0x290d('0x4e'),_0x47d9c8,_0x4c2415,_0x414667)};io['to'](util['format'](_0x290d('0x4f'),_0x54ca9b))[_0x290d('0x50')](_0x290d('0x51'),_0x2292d4);}exports['cs']=function(_0xbea24b,_0x24ac69,_0x2f1a5b,_0x2c9f00,_0x28cd92,_0x29c599,_0x21eb26,_0x1e6b7d){var _0x2843e3={};_0x29c599[_0x290d('0x8')]=_0x29c599['modernAuthentication']?intUtil[_0x290d('0x52')](_0x29c599[_0x290d('0x9')][_0x290d('0xa')]):intUtil['stripTrailingSlash'](_0x29c599[_0x290d('0x8')]);_0x29c599['serverUrl']=intUtil[_0x290d('0x52')](_0x29c599[_0x290d('0x53')]);_0x2843e3['callDirection']=_0x1e6b7d===_0x290d('0x49')||_0x1e6b7d==='unmanaged'?'queue':_0x290d('0x25');var _0x14b815=_0x29c599[_0x290d('0x7')]?util[_0x290d('0x4d')](_0x290d('0x54'),_0x29c599[_0x290d('0x9')][_0x290d('0xa')]):util[_0x290d('0x4d')]('%s/api/data/v9.0/',_0x29c599['remoteUri']);var _0x5c9411=util['format'](_0x290d('0x55'),_0x29c599[_0x290d('0xb')]);var _0x3a7821=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29c599[_0x290d('0x53')],_0x24ac69[_0x290d('0x56')],md5(_0x24ac69[_0x290d('0x56')]));if(_0x28cd92&&_0x28cd92[_0x290d('0x57')]){logger[_0x290d('0x1e')](_0x290d('0x58'),_0x290d('0x59'));_0x24ac69[_0x290d('0x5a')]=_0x3a7821;}else if(_0x21eb26&&_0x21eb26[_0x290d('0x5b')]&&_0x21eb26['recordingFormat']!=='none'){logger['info'](_0x290d('0x5c'),_0x290d('0x59'));_0x24ac69[_0x290d('0x5a')]=_0x3a7821;}else{_0x24ac69['recordingURL']='';}return getUser(_0x2843e3,_0x29c599,_0x2c9f00,_0x5c9411,_0x14b815,_0x1e6b7d)[_0x290d('0x12')](function(_0xa682f3){logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x5d'),_0xa682f3['userId']);logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x5e'),_0xa682f3[_0x290d('0x1d')]);return getEndUser(_0xa682f3,_0x29c599,_0x5c9411,_0x14b815,_0x24ac69,_0x1e6b7d,_0x2f1a5b[_0x290d('0x5f')],_0x2f1a5b[_0x290d('0x60')]);})[_0x290d('0x12')](function(_0x25e61c){logger[_0x290d('0x1e')]('['+_0x1e6b7d['toUpperCase']()+_0x290d('0x61'),_0x25e61c[_0x290d('0x30')]);logger[_0x290d('0x1e')]('['+_0x1e6b7d['toUpperCase']()+_0x290d('0x62'),_0x24ac69['calleridnum']);return getTicket(_0x25e61c,_0x29c599,_0x5c9411,_0x14b815,_0x24ac69,_0x2f1a5b,_0x1e6b7d);})['then'](function(_0x54939d){logger['info'](util[_0x290d('0x4d')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x63'),_0x2f1a5b[_0x290d('0x3f')],_0x54939d[_0x290d('0x4c')]));logger[_0x290d('0x1e')](util['format']('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x64'),_0x1e6b7d));if(_0x1e6b7d!=='unmanaged'&&_0x2f1a5b[_0x290d('0x65')]){logger[_0x290d('0x1e')]('['+_0x1e6b7d[_0x290d('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x29c599[_0x290d('0x8')],_0x2c9f00['name'],_0x2f1a5b[_0x290d('0x3f')],_0x54939d['ticketId']);}})[_0x290d('0x14')](function(_0x10d27e){logger[_0x290d('0x66')]('['+_0x1e6b7d[_0x290d('0x15')]()+_0x290d('0x67'),_0x10d27e[_0x290d('0x16')]);console['error'](_0x290d('0x68'),_0x10d27e);});}; \ No newline at end of file +var _0x4127=['indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','/systemusers(','callDirection','queue','phonecalls','/contacts(','odata-entityid','ticketId','format','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','clientId','username','password','clientSecret','error','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','then','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','message','toLowerCase','outbound','destcalleridnum','POST','contacts','4.0','headers','lastIndexOf','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','substring'];(function(_0x819ce,_0xf25f51){var _0x1edcf0=function(_0x192389){while(--_0x192389){_0x819ce['push'](_0x819ce['shift']());}};_0x1edcf0(++_0xf25f51);}(_0x4127,0x1cc));var _0x7412=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4127[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var rp=require(_0x7412('0x0'));var util=require(_0x7412('0x1'));var intUtil=require(_0x7412('0x2'));var md5=require(_0x7412('0x3'));var Redis=require(_0x7412('0x4'));var logger=require(_0x7412('0x5'))('dynamics365');var config=require(_0x7412('0x6'));config[_0x7412('0x7')]=_['defaults'](config[_0x7412('0x7')],{'host':_0x7412('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7412('0x7')]));function getAuthToken(_0x29fa16,_0x54a134,_0x2ad3bf){if(_0x29fa16[_0x7412('0x9')]){_0x29fa16[_0x7412('0xa')]=_0x29fa16[_0x7412('0xb')]['data7'];_0x29fa16[_0x7412('0xc')]=_0x29fa16['CloudProvider'][_0x7412('0xd')];return Promise[_0x7412('0xe')](_0x29fa16[_0x7412('0xb')]['data5']);}var _0x106acb={'method':'POST','uri':_0x54a134,'form':{'client_id':_0x29fa16[_0x7412('0xf')],'resource':_0x29fa16[_0x7412('0xa')],'username':_0x29fa16[_0x7412('0x10')],'password':_0x29fa16[_0x7412('0x11')],'grant_type':_0x7412('0x11'),'client_secret':_0x29fa16[_0x7412('0x12')]},'json':!![]};return rp(_0x106acb)['then'](function(_0x38717b){return _0x38717b['access_token'];})['catch'](function(_0x3fa703){logger[_0x7412('0x13')]('['+[_0x2ad3bf[_0x7412('0x14')]()]+']\x20Wrong\x20credentials!');return _0x3fa703['message'];});}function getUser(_0x3a578d,_0x404ca5,_0x1291fb,_0x3e6ba9,_0x214708,_0x378ffc){return new Promise(function(_0x506ca1,_0x1fadbd){return getAuthToken(_0x404ca5,_0x3e6ba9,_0x378ffc)['then'](function(_0x45e9e5){var _0xa191be={'method':_0x7412('0x15'),'uri':_0x214708+_0x7412('0x16'),'headers':{'Authorization':_0x7412('0x17')+_0x45e9e5,'OData-Version':'4.0'},'json':!![]};return rp(_0xa191be);})[_0x7412('0x18')](function(_0x305cf3){var _0x1c60d9=_0x305cf3[_0x7412('0x19')];var _0xd5cfe5=![];var _0x184551=null;if(!_[_0x7412('0x1a')](_0x1291fb)){if(intUtil[_0x7412('0x1b')](_0x1291fb[_0x7412('0x1c')])){_0x3a578d['userEmail']=_0x1291fb[_0x7412('0x1c')];for(_0x184551=0x0;_0x184551<_0x1c60d9[_0x7412('0x1d')];_0x184551++){if(_0x1c60d9[_0x184551][_0x7412('0x1e')]===_0x1291fb['email']&&!_0x1c60d9[_0x184551][_0x7412('0x1f')]){_0xd5cfe5=!![];logger[_0x7412('0x20')]('['+[_0x378ffc[_0x7412('0x14')]()]+_0x7412('0x21')+_0x1c60d9[_0x184551]['systemuserid']+'!');_0x3a578d[_0x7412('0x22')]=_0x1c60d9[_0x184551][_0x7412('0x23')];}}}}if(!_0xd5cfe5){logger[_0x7412('0x20')]('['+[_0x378ffc[_0x7412('0x14')]()]+_0x7412('0x24'));_0x3a578d['userEmail']=_0x404ca5[_0x7412('0x10')];for(_0x184551=0x0;_0x184551<_0x1c60d9[_0x7412('0x1d')];_0x184551++){if(_0x1c60d9[_0x184551][_0x7412('0x1e')]===_0x404ca5[_0x7412('0x10')]){_0x3a578d['userId']=_0x1c60d9[_0x184551][_0x7412('0x23')];}}}_0x506ca1(_0x3a578d);})[_0x7412('0x25')](function(_0x423ef6){_0x1fadbd(_0x423ef6[_0x7412('0x26')]);});});}function createEndUser(_0x394c62,_0x16efac,_0x34260a,_0x491d7f,_0x1473d7,_0x589502,_0x3d8534){return new Promise(function(_0x1d8e2f,_0x138ddd){return getAuthToken(_0x16efac,_0x34260a,_0x589502)['then'](function(_0x1bb26f){var _0x4d42d5=_0x589502[_0x7412('0x27')]()===_0x7412('0x28')?_0x1473d7[_0x7412('0x29')]:_0x1473d7['calleridnum'];var _0x348cdf={'method':_0x7412('0x2a'),'uri':_0x491d7f+_0x7412('0x2b'),'body':{'fullname':_0x4d42d5,'firstname':_0x4d42d5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x394c62[_0x7412('0x22')]+')'},'headers':{'Authorization':_0x7412('0x17')+_0x1bb26f,'OData-Version':_0x7412('0x2c')},'json':!![],'resolveWithFullResponse':!![]};_0x348cdf['body'][_0x3d8534]=_0x4d42d5;return rp(_0x348cdf);})[_0x7412('0x18')](function(_0x199dbf){var _0x1b417b=_0x199dbf[_0x7412('0x2d')]['odata-entityid'];var _0x3394a9=_0x1b417b['substring'](_0x1b417b[_0x7412('0x2e')]('(')+0x1,_0x1b417b[_0x7412('0x2e')](')'));_0x394c62['enduserId']=_0x3394a9;_0x1d8e2f(_0x394c62);})[_0x7412('0x25')](function(_0x1eed9b){_0x138ddd(_0x1eed9b[_0x7412('0x26')]);});});}function getEndUser(_0x144132,_0x2287d6,_0x11eeb0,_0x42b449,_0x1bffcf,_0x56864e,_0x512a2c,_0x5750e1){var _0x1ea4d3=_0x56864e[_0x7412('0x27')]()===_0x7412('0x28')?_0x1bffcf[_0x7412('0x29')]:_0x1bffcf[_0x7412('0x2f')];return getAuthToken(_0x2287d6,_0x11eeb0,_0x56864e)['then'](function(_0x3e3b35){_0x5750e1=_0x5750e1?_0x5750e1:_0x7412('0x30');var _0x55c9b5={'method':'GET','uri':_0x42b449+_0x7412('0x31')+_0x5750e1+_0x7412('0x32')+_0x5750e1+_0x7412('0x33')+_0x1ea4d3['replace']('+',_0x7412('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3e3b35,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x55c9b5);})[_0x7412('0x18')](function(_0x190eaf){var _0x29a56a=![];if(!_0x190eaf)return _0x29a56a;var _0x283307=_0x190eaf['value'];for(var _0xcfa60=0x0;_0xcfa60<_0x283307['length'];_0xcfa60++){if(_0x283307[_0xcfa60][_0x5750e1]===_0x1ea4d3){_0x29a56a=!![];_0x144132[_0x7412('0x35')]=_0x283307[_0xcfa60][_0x7412('0x36')];}}return _0x29a56a;})[_0x7412('0x18')](function(_0x3bf4b1){if(_0x3bf4b1)return _0x144132;if(_0x512a2c===_0x7412('0x37')){logger['info']('['+[_0x56864e[_0x7412('0x14')]()]+_0x7412('0x38'));return _0x144132;}return createEndUser(_0x144132,_0x2287d6,_0x11eeb0,_0x42b449,_0x1bffcf,_0x56864e,_0x5750e1)['then'](function(_0x2b10ef){logger[_0x7412('0x20')]('['+[_0x56864e[_0x7412('0x14')]()]+_0x7412('0x39'),_0x2b10ef[_0x7412('0x35')]);return _0x2b10ef;});});}function getCustomFields(_0x4148bd,_0x5b913c,_0x46a11e){var _0x537993={};if(_0x4148bd[_0x7412('0x1d')]>0x0){_[_0x7412('0x3a')](_0x4148bd,function(_0x1a95d1){if(_[_0x7412('0x3b')]([_0x7412('0x3c'),_0x7412('0x3d')],_0x1a95d1[_0x7412('0x3e')])&&_0x1a95d1['nameField']&&!_0x1a95d1[_0x7412('0x3f')]){var _0x4bcb46=_0x1a95d1['idField'][_0x7412('0x27')]();var _0x1dc553=_0x4bcb46[_0x7412('0x40')](0x0,_0x4bcb46[_0x7412('0x41')]('_'));var _0x57e8e1=_0x4bcb46[_0x7412('0x40')](_0x4bcb46['indexOf']('_')+0x1);if(_0x1dc553===_0x46a11e){_0x537993[_0x57e8e1]=_0x1a95d1['content'];}}});}return _0x537993;}function getTicket(_0x16feb6,_0x2ae5e8,_0xb6fc4e,_0x5571d6,_0x4b5257,_0x442fb1,_0x1e7906){return new Promise(function(_0x3866c3,_0x1bb906){var _0x3c0d3d;return getAuthToken(_0x2ae5e8,_0xb6fc4e,_0x1e7906)[_0x7412('0x18')](function(_0x327839){if(_0x442fb1[_0x7412('0x42')]===_0x7412('0x43')){_0x3c0d3d={'method':_0x7412('0x2a'),'uri':_0x5571d6+_0x7412('0x44'),'body':Object[_0x7412('0x45')]({},{'title':intUtil[_0x7412('0x46')](_0x442fb1[_0x7412('0x47')],_0x4b5257,'\x20'),'description':intUtil[_0x7412('0x46')](_0x442fb1[_0x7412('0x48')],_0x4b5257,'\x0a'),'customerid_contact@odata.bind':_0x16feb6['enduserId']?'/contacts('+_0x16feb6[_0x7412('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x16feb6[_0x7412('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x442fb1[_0x7412('0x49')],_0x4b5257,_0x442fb1[_0x7412('0x42')])),'headers':{'Authorization':_0x7412('0x17')+_0x327839,'OData-Version':_0x7412('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x442fb1[_0x7412('0x42')]===_0x7412('0x4a')){var _0x22852c=_0x16feb6[_0x7412('0x35')]?[{'partyid_systemuser@odata.bind':_0x7412('0x4b')+_0x16feb6['userId']+')','participationtypemask':_0x16feb6[_0x7412('0x4c')]===_0x7412('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x16feb6[_0x7412('0x35')]+')','participationtypemask':_0x16feb6[_0x7412('0x4c')]===_0x7412('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x7412('0x4b')+_0x16feb6[_0x7412('0x22')]+')','participationtypemask':_0x16feb6['callDirection']===_0x7412('0x4d')?0x2:0x1}];_0x3c0d3d={'method':_0x7412('0x2a'),'uri':_0x5571d6+_0x7412('0x4e'),'body':Object[_0x7412('0x45')]({},{'subject':intUtil['getString'](_0x442fb1[_0x7412('0x47')],_0x4b5257,'\x20'),'phonenumber':String(_0x4b5257[_0x7412('0x2f')]),'description':intUtil[_0x7412('0x46')](_0x442fb1[_0x7412('0x48')],_0x4b5257,'\x0a'),'regardingobjectid_contact@odata.bind':_0x16feb6[_0x7412('0x35')]?_0x7412('0x4f')+_0x16feb6[_0x7412('0x35')]+')':undefined,'ownerid@odata.bind':_0x7412('0x4b')+_0x16feb6[_0x7412('0x22')]+')','directioncode':_0x16feb6[_0x7412('0x4c')]===_0x7412('0x4d')?![]:!![],'phonecall_activity_parties':_0x22852c},getCustomFields(_0x442fb1[_0x7412('0x49')],_0x4b5257,_0x442fb1[_0x7412('0x42')])),'headers':{'Authorization':_0x7412('0x17')+_0x327839,'OData-Version':_0x7412('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3c0d3d);})[_0x7412('0x18')](function(_0x16a6ae){var _0x20b32a=_0x16a6ae[_0x7412('0x2d')][_0x7412('0x50')];var _0x5b2577=_0x20b32a['substring'](_0x20b32a[_0x7412('0x2e')]('(')+0x1,_0x20b32a[_0x7412('0x2e')](')'));_0x16feb6[_0x7412('0x51')]=_0x5b2577;_0x3866c3(_0x16feb6);})['catch'](function(_0x2a10db){_0x1bb906(_0x2a10db['message']);});});}function emit(_0x40df3d,_0x139a5c,_0x421977,_0x472430){var _0x9f1e3c={'uri':util[_0x7412('0x52')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x40df3d,_0x421977,_0x472430)};io['to'](util[_0x7412('0x52')]('user:%s',_0x139a5c))[_0x7412('0x53')]('trigger:browser:url',_0x9f1e3c);}exports['cs']=function(_0x3b6fab,_0x4fd914,_0x5735ac,_0x1e9e4a,_0x175f04,_0x4e4b88,_0x3df5d4,_0x2f537e){var _0x1cfffc={};_0x4e4b88['remoteUri']=_0x4e4b88[_0x7412('0x9')]?intUtil[_0x7412('0x54')](_0x4e4b88[_0x7412('0xb')][_0x7412('0x55')]):intUtil[_0x7412('0x54')](_0x4e4b88[_0x7412('0xa')]);_0x4e4b88['serverUrl']=intUtil['stripTrailingSlash'](_0x4e4b88[_0x7412('0x56')]);_0x1cfffc[_0x7412('0x4c')]=_0x2f537e==='queue'||_0x2f537e===_0x7412('0x57')?_0x7412('0x4d'):'outbound';var _0xe5e03=_0x4e4b88[_0x7412('0x9')]?util['format'](_0x7412('0x58'),_0x4e4b88['CloudProvider'][_0x7412('0x55')]):util[_0x7412('0x52')]('%s/api/data/v9.0/',_0x4e4b88[_0x7412('0xa')]);var _0x474652=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x4e4b88[_0x7412('0xc')]);var _0x3ca81d=util[_0x7412('0x52')](_0x7412('0x59'),_0x4e4b88[_0x7412('0x56')],_0x4fd914[_0x7412('0x5a')],md5(_0x4fd914[_0x7412('0x5a')]));if(_0x175f04&&_0x175f04[_0x7412('0x5b')]){logger[_0x7412('0x20')](_0x7412('0x5c'),_0x7412('0x5d'));_0x4fd914[_0x7412('0x5e')]=_0x3ca81d;}else if(_0x3df5d4&&_0x3df5d4[_0x7412('0x5f')]&&_0x3df5d4[_0x7412('0x5f')]!==_0x7412('0x60')){logger[_0x7412('0x20')]('[OUTBOUND]',_0x7412('0x5d'));_0x4fd914[_0x7412('0x5e')]=_0x3ca81d;}else{_0x4fd914['recordingURL']='';}return getUser(_0x1cfffc,_0x4e4b88,_0x1e9e4a,_0x474652,_0xe5e03,_0x2f537e)['then'](function(_0x3d511f){logger[_0x7412('0x20')]('['+_0x2f537e['toUpperCase']()+_0x7412('0x61'),_0x3d511f[_0x7412('0x22')]);logger[_0x7412('0x20')]('['+_0x2f537e['toUpperCase']()+_0x7412('0x62'),_0x3d511f[_0x7412('0x63')]);return getEndUser(_0x3d511f,_0x4e4b88,_0x474652,_0xe5e03,_0x4fd914,_0x2f537e,_0x5735ac['moduleCreate'],_0x5735ac['additionalSearchContact']);})[_0x7412('0x18')](function(_0x5ecc0b){logger[_0x7412('0x20')]('['+_0x2f537e[_0x7412('0x14')]()+_0x7412('0x64'),_0x5ecc0b['enduserId']);logger['info']('['+_0x2f537e[_0x7412('0x14')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4fd914[_0x7412('0x2f')]);return getTicket(_0x5ecc0b,_0x4e4b88,_0x474652,_0xe5e03,_0x4fd914,_0x5735ac,_0x2f537e);})[_0x7412('0x18')](function(_0xb79744){logger[_0x7412('0x20')](util[_0x7412('0x52')]('['+_0x2f537e[_0x7412('0x14')]()+_0x7412('0x65'),_0x5735ac[_0x7412('0x42')],_0xb79744[_0x7412('0x51')]));logger[_0x7412('0x20')](util['format']('['+_0x2f537e[_0x7412('0x14')]()+']\x20Call\x20direction:\x20%s',_0x2f537e));if(_0x2f537e!=='unmanaged'&&_0x5735ac[_0x7412('0x66')]){logger[_0x7412('0x20')]('['+_0x2f537e[_0x7412('0x14')]()+']',_0x7412('0x67'));emit(_0x4e4b88['remoteUri'],_0x1e9e4a['name'],_0x5735ac[_0x7412('0x42')],_0xb79744[_0x7412('0x51')]);}})[_0x7412('0x25')](function(_0x521df7){logger[_0x7412('0x13')]('['+_0x2f537e[_0x7412('0x14')]()+_0x7412('0x68'),_0x521df7[_0x7412('0x26')]);console[_0x7412('0x13')]('Error\x20running\x20Dynamics365\x20integration',_0x521df7);});}; \ 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 0c10491..7569777 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 _0x573b=['catch','stringify','recordingFormat','none','[OUTBOUND]','email','destcalleridname','The\x20Ticket\x20ID\x20is:','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','
','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','POST','then','%s/api/v2/agents','remoteUri','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','includes','picklist','type','nameField','content','toString','idField','customField','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x573b,0x180));var _0xb573=function(_0x4111fc,_0x2e2f1f){_0x4111fc=_0x4111fc-0x0;var _0x3b1446=_0x573b[_0x4111fc];return _0x3b1446;};'use strict';var _=require(_0xb573('0x0'));var rp=require(_0xb573('0x1'));var md5=require(_0xb573('0x2'));var util=require(_0xb573('0x3'));var Redis=require(_0xb573('0x4'));var intUtil=require(_0xb573('0x5'));var config=require(_0xb573('0x6'));var logger=require(_0xb573('0x7'))('freshdesk');config[_0xb573('0x8')]=_[_0xb573('0x9')](config[_0xb573('0x8')],{'host':_0xb573('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xb573('0xb')};function emit(_0x7e06d9,_0x3836c4,_0x14c29a){io['to'](_0x7e06d9)[_0xb573('0xc')](_0x3836c4,_0x14c29a);}function getTicket(_0x58a1d2,_0x567a42,_0x14077e,_0x183879,_0x21935c){logger[_0xb573('0xd')](_0xb573('0xe'));var _0x48be56=_[_0xb573('0xf')]({'responder_id':_0x567a42['id'],'requester_id':_0x14077e['id'],'name':util[_0xb573('0x10')](_0xb573('0x11'),_0x21935c['calleridname']),'phone':_0x21935c['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb573('0x12')](_0x183879[_0xb573('0x13')],_0x21935c,'\x20'),'description':intUtil[_0xb573('0x12')](_0x183879[_0xb573('0x14')],_0x21935c,_0xb573('0x15')),'tags':getTags(_0x183879[_0xb573('0x16')],_0xb573('0x17'))},getCustomFields(_0x183879['Fields'],_0x21935c));_0x48be56[_0xb573('0x18')]=_['mapValues'](_[_0xb573('0x19')](_0x48be56[_0xb573('0x18')],'id'),_0xb573('0x1a'));return request({'uri':util[_0xb573('0x10')](_0xb573('0x1b'),_0x58a1d2['remoteUri']),'method':_0xb573('0x1c'),'body':_0x48be56})[_0xb573('0x1d')](function(_0x386cc4){logger[_0xb573('0xd')]('Ticket\x20created!');return _0x386cc4;});}function getUser(_0xe2a00d,_0x32ab3f){if(intUtil['validateEmail'](_0x32ab3f)){return request({'uri':util[_0xb573('0x10')](_0xb573('0x1e'),_0xe2a00d[_0xb573('0x1f')]),'qs':{'email':_0x32ab3f}})[_0xb573('0x1d')](function(_0x3c782b){if(_0x3c782b['length']){logger[_0xb573('0xd')](_0xb573('0x20'));return _[_0xb573('0x21')](_0x3c782b,function(_0x29892b){return _0x29892b[_0xb573('0x22')]['email']===_0x32ab3f;});}else{logger[_0xb573('0xd')](_0xb573('0x23'));return request({'uri':util['format'](_0xb573('0x24'),_0xe2a00d[_0xb573('0x1f')])})[_0xb573('0x1d')](function(_0x24cf93){logger['info'](_0xb573('0x25'));return _0x24cf93;});}});}else{logger[_0xb573('0xd')](_0xb573('0x26'));return request({'uri':util[_0xb573('0x10')]('%s/api/v2/agents/me',_0xe2a00d[_0xb573('0x1f')])})['then'](function(_0x2da261){logger[_0xb573('0xd')](_0xb573('0x25'));return _0x2da261;});}}function getEndUser(_0x382f4c,_0x138d6f,_0x45d248){logger[_0xb573('0xd')](_0xb573('0x27'),_0x45d248);return request({'uri':util[_0xb573('0x10')](_0xb573('0x28'),_0x382f4c[_0xb573('0x1f')]),'qs':{'phone':_0x45d248}})[_0xb573('0x1d')](function(_0x3f0e39){if(_0x3f0e39[_0xb573('0x29')]){logger['info']('Enduser\x20found!');return _[_0xb573('0x21')](_0x3f0e39,{'phone':_0x45d248});}else{logger[_0xb573('0xd')](_0xb573('0x2a'));return request({'uri':util['format']('%s/api/v2/contacts',_0x382f4c[_0xb573('0x1f')]),'method':_0xb573('0x1c'),'body':{'name':_0x138d6f,'phone':_0x45d248}})[_0xb573('0x1d')](function(_0x3a5445){logger[_0xb573('0xd')](_0xb573('0x2b'));return _0x3a5445;});}});}function getAuth(_0x44be1e){return util[_0xb573('0x10')](_0xb573('0x2c'),new Buffer(_0x44be1e['apiKey']+':X')['toString'](_0xb573('0x2d')));}function request(_0xf88d23){logger[_0xb573('0x2e')](_0xb573('0x2f'),JSON['stringify'](_0xf88d23));return rp(_[_0xb573('0x9')](_0xf88d23,{'method':_0xb573('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x151ae1,_0x1763e3){var _0x5d91d8=[];if(_0x151ae1&&_0x151ae1[_0xb573('0x29')]>0x0){_0x5d91d8=_[_0xb573('0x31')](_0x151ae1,_0x1763e3);}return _0x5d91d8;}function getCustomFields(_0x14619e,_0x3cf3d8){var _0x1d3bd8=[];var _0x21d82f={'custom_fields':[]};if(_0x14619e[_0xb573('0x29')]>0x0){_[_0xb573('0x32')](_0x14619e,function(_0xe72b50){if(_[_0xb573('0x33')](['string',_0xb573('0x34')],_0xe72b50[_0xb573('0x35')])&&_0xe72b50['nameField']&&!_0xe72b50['customField']){_0x21d82f[_0xe72b50[_0xb573('0x36')]['toLowerCase']()]=_0xe72b50[_0xb573('0x37')][_0xb573('0x38')]();}else if(_['includes'](['string',_0xb573('0x34')],_0xe72b50[_0xb573('0x35')])&&_0xe72b50[_0xb573('0x39')]&&_0xe72b50[_0xb573('0x3a')]){_0x21d82f['custom_fields']['push']({'id':_0xe72b50[_0xb573('0x39')],'value':_0xe72b50[_0xb573('0x37')][_0xb573('0x38')]()});}else if(_0xe72b50[_0xb573('0x35')]==='variable'&&_0xe72b50[_0xb573('0x3b')]&&_0xe72b50['idField']&&_0xe72b50[_0xb573('0x3a')]){_0x3cf3d8[_0xe72b50[_0xb573('0x3b')]]&&_0x21d82f['custom_fields']['push']({'id':_0xe72b50[_0xb573('0x39')],'value':_0x3cf3d8[_0xe72b50['variableName']]['toString']()});}else if(_0xe72b50[_0xb573('0x35')]===_0xb573('0x3c')&&_0xe72b50[_0xb573('0x3d')]&&_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]&&_0xe72b50[_0xb573('0x39')]&&_0xe72b50[_0xb573('0x3a')]){_0x3cf3d8[_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]['toLowerCase']()]&&_0x21d82f[_0xb573('0x18')][_0xb573('0x3e')]({'id':_0xe72b50['idField'],'value':_0x3cf3d8[_0xe72b50[_0xb573('0x3d')][_0xb573('0x17')]['toLowerCase']()][_0xb573('0x38')]()});}});}return _0x21d82f;}exports[_0xb573('0x3f')]=function(_0x135520,_0x289b93,_0x46a586,_0x147c4a,_0xdc13ca,_0x22cb1f){var _0x34fd5d,_0x9b974d;_0x22cb1f[_0xb573('0x1f')]=intUtil[_0xb573('0x40')](_0x22cb1f['remoteUri']);_0x22cb1f[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x22cb1f['serverUrl']);if(_0xdc13ca&&_0xdc13ca[_0xb573('0x42')]){logger['info']('[QUEUE]',_0xb573('0x43'));_0x289b93['recordingURL']=util[_0xb573('0x10')](_0xb573('0x44'),_0x22cb1f[_0xb573('0x41')],_0x289b93[_0xb573('0x45')],md5(_0x289b93[_0xb573('0x45')]));}else{_0x289b93[_0xb573('0x46')]='';}headers[_0xb573('0x47')]=getAuth(_0x22cb1f);return getUser(_0x22cb1f,_0x147c4a['email'])['then'](function(_0x3fc44a){_0x34fd5d=_0x3fc44a;logger[_0xb573('0xd')](_0xb573('0x48'),_0x34fd5d['id']);return getEndUser(_0x22cb1f,_0x289b93[_0xb573('0x49')],_0x289b93[_0xb573('0x4a')]);})[_0xb573('0x1d')](function(_0xa8b7c){_0x9b974d=_0xa8b7c;logger[_0xb573('0xd')](_0xb573('0x4b'),_0x9b974d['id']);return getTicket(_0x22cb1f,_0x34fd5d,_0x9b974d,_0x46a586,_0x289b93);})[_0xb573('0x1d')](function(_0x202dad){if(_0x202dad&&_0x202dad['id']){logger[_0xb573('0xd')](_0xb573('0x4c'));logger[_0xb573('0xd')]('The\x20Ticket\x20ID\x20is:',_0x202dad['id']);logger['info']('[QUEUE]',_0xb573('0x4d'));emit(util[_0xb573('0x10')](_0xb573('0x4e'),_0x147c4a[_0xb573('0x17')]),_0xb573('0x4f'),{'uri':util[_0xb573('0x10')](_0xb573('0x50'),_0x22cb1f[_0xb573('0x1f')],_0x202dad['id'])});}})[_0xb573('0x51')](function(_0x16d311){logger['error']('[QUEUE]',JSON[_0xb573('0x52')](_0x16d311));});};exports['outbound']=function(_0xd87f1a,_0x14d5ad,_0xa1327b,_0x5d6179,_0x3d7ef1,_0x58f2f9,_0x5c2a98){var _0x3a6ac1,_0x111a55;_0x58f2f9['remoteUri']=intUtil[_0xb573('0x40')](_0x58f2f9[_0xb573('0x1f')]);_0x58f2f9[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x58f2f9[_0xb573('0x41')]);if(_0x5c2a98&&_0x5c2a98[_0xb573('0x53')]&&_0x5c2a98['recordingFormat']!==_0xb573('0x54')){logger[_0xb573('0xd')](_0xb573('0x55'),_0xb573('0x43'));_0x14d5ad[_0xb573('0x46')]=util[_0xb573('0x10')](_0xb573('0x44'),_0x58f2f9['serverUrl'],_0x14d5ad[_0xb573('0x45')],md5(_0x14d5ad[_0xb573('0x45')]));}headers[_0xb573('0x47')]=getAuth(_0x58f2f9);return getUser(_0x58f2f9,_0x5d6179[_0xb573('0x56')])[_0xb573('0x1d')](function(_0x19eb17){_0x3a6ac1=_0x19eb17;logger[_0xb573('0xd')](_0xb573('0x48'),_0x3a6ac1['id']);return getEndUser(_0x58f2f9,_0x14d5ad[_0xb573('0x57')],_0x14d5ad['destcalleridnum']);})['then'](function(_0x1d2452){_0x111a55=_0x1d2452;logger[_0xb573('0xd')]('The\x20Enduser\x20ID\x20is:',_0x111a55['id']);return getTicket(_0x58f2f9,_0x3a6ac1,_0x111a55,_0xa1327b,_0x14d5ad);})[_0xb573('0x1d')](function(_0x194b83){if(_0x194b83&&_0x194b83['id']){logger[_0xb573('0xd')]('Ticket\x20created!');logger[_0xb573('0xd')](_0xb573('0x58'),_0x194b83['id']);logger[_0xb573('0xd')]('[OUTBOUND]',_0xb573('0x4d'));emit(util[_0xb573('0x10')](_0xb573('0x4e'),_0x5d6179[_0xb573('0x17')]),_0xb573('0x4f'),{'uri':util[_0xb573('0x10')]('%s/helpdesk/tickets/%d',_0x58f2f9[_0xb573('0x1f')],_0x194b83['id'])});}})[_0xb573('0x51')](function(_0x1ee61d){logger[_0xb573('0x59')](_0xb573('0x55'),JSON[_0xb573('0x52')](_0x1ee61d));});};exports[_0xb573('0x5a')]=function(_0x423c9b,_0x13a6f8,_0x6ecd0d,_0x9fe7d5,_0x4fac69,_0x3bce21){var _0x31334d,_0x57a392;_0x3bce21[_0xb573('0x1f')]=intUtil['stripTrailingSlash'](_0x3bce21[_0xb573('0x1f')]);_0x3bce21[_0xb573('0x41')]=intUtil[_0xb573('0x40')](_0x3bce21[_0xb573('0x41')]);if(_0x4fac69&&_0x4fac69['monitor_format']){logger[_0xb573('0xd')]('['+_0x13a6f8[_0xb573('0x5b')][_0xb573('0x5c')]()+']',_0xb573('0x43'));_0x13a6f8[_0xb573('0x46')]=util[_0xb573('0x10')](_0xb573('0x44'),_0x3bce21[_0xb573('0x41')],_0x13a6f8[_0xb573('0x45')],md5(_0x13a6f8[_0xb573('0x45')]));}else{_0x13a6f8['recordingURL']='';}headers[_0xb573('0x47')]=getAuth(_0x3bce21);return getUser(_0x3bce21,'')[_0xb573('0x1d')](function(_0x15ac0f){_0x31334d=_0x15ac0f;logger[_0xb573('0xd')](_0xb573('0x48'),_0x31334d['id']);return getEndUser(_0x3bce21,_0x13a6f8[_0xb573('0x49')],_0x13a6f8['calleridnum']);})[_0xb573('0x1d')](function(_0x4b2f78){_0x57a392=_0x4b2f78;logger[_0xb573('0xd')](_0xb573('0x4b'),_0x57a392['id']);return getTicket(_0x3bce21,_0x31334d,_0x57a392,_0x6ecd0d,_0x13a6f8);})[_0xb573('0x1d')](function(_0x44ad1b){if(_0x44ad1b){logger[_0xb573('0xd')](_0xb573('0x4c'));logger[_0xb573('0xd')](_0xb573('0x58'),_0x44ad1b['id']);}})[_0xb573('0x51')](function(_0x56e590){logger[_0xb573('0x59')]('['+_0x13a6f8[_0xb573('0x5b')][_0xb573('0x5c')]()+']',JSON[_0xb573('0x52')](_0x56e590));});}; \ No newline at end of file +var _0xb1dd=['recordingURL','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','info','Agent\x20found!','find','email','%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','Basic\x20%s','toString','GET','map','includes','string','picklist','type','nameField','toLowerCase','content','customField','push','idField','variable','variableName','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','stringify','outbound','[OUTBOUND]'];(function(_0x122cac,_0x473824){var _0xe35004=function(_0x2f7953){while(--_0x2f7953){_0x122cac['push'](_0x122cac['shift']());}};_0xe35004(++_0x473824);}(_0xb1dd,0xb1));var _0xdb1d=function(_0x14e757,_0x4dae30){_0x14e757=_0x14e757-0x0;var _0x208d9b=_0xb1dd[_0x14e757];return _0x208d9b;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xdb1d('0x0'));var util=require('util');var Redis=require(_0xdb1d('0x1'));var intUtil=require(_0xdb1d('0x2'));var config=require(_0xdb1d('0x3'));var logger=require(_0xdb1d('0x4'))(_0xdb1d('0x5'));config[_0xdb1d('0x6')]=_[_0xdb1d('0x7')](config[_0xdb1d('0x6')],{'host':_0xdb1d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb1d('0x6')]));var headers={'Content-Type':_0xdb1d('0x9'),'Accept':'application/json'};function emit(_0x330278,_0x312c5c,_0x22ebb9){io['to'](_0x330278)[_0xdb1d('0xa')](_0x312c5c,_0x22ebb9);}function getTicket(_0x2372fa,_0x42a984,_0x8633ec,_0x312cb0,_0x549b7f){logger['info'](_0xdb1d('0xb'));var _0x207984=_[_0xdb1d('0xc')]({'responder_id':_0x42a984['id'],'requester_id':_0x8633ec['id'],'name':util[_0xdb1d('0xd')](_0xdb1d('0xe'),_0x549b7f[_0xdb1d('0xf')]),'phone':_0x549b7f[_0xdb1d('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdb1d('0x11')](_0x312cb0[_0xdb1d('0x12')],_0x549b7f,'\x20'),'description':intUtil[_0xdb1d('0x11')](_0x312cb0[_0xdb1d('0x13')],_0x549b7f,_0xdb1d('0x14')),'tags':getTags(_0x312cb0['Tags'],'name')},getCustomFields(_0x312cb0[_0xdb1d('0x15')],_0x549b7f));_0x207984[_0xdb1d('0x16')]=_[_0xdb1d('0x17')](_[_0xdb1d('0x18')](_0x207984[_0xdb1d('0x16')],'id'),_0xdb1d('0x19'));return request({'uri':util[_0xdb1d('0xd')](_0xdb1d('0x1a'),_0x2372fa[_0xdb1d('0x1b')]),'method':_0xdb1d('0x1c'),'body':_0x207984})[_0xdb1d('0x1d')](function(_0x7830c0){logger['info']('Ticket\x20created!');return _0x7830c0;});}function getUser(_0x57c62e,_0xb8e77f){if(intUtil[_0xdb1d('0x1e')](_0xb8e77f)){return request({'uri':util[_0xdb1d('0xd')](_0xdb1d('0x1f'),_0x57c62e[_0xdb1d('0x1b')]),'qs':{'email':_0xb8e77f}})[_0xdb1d('0x1d')](function(_0x1ea5d9){if(_0x1ea5d9[_0xdb1d('0x20')]){logger[_0xdb1d('0x21')](_0xdb1d('0x22'));return _[_0xdb1d('0x23')](_0x1ea5d9,function(_0x13c7b6){return _0x13c7b6['contact'][_0xdb1d('0x24')]===_0xb8e77f;});}else{logger[_0xdb1d('0x21')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdb1d('0x25'),_0x57c62e['remoteUri'])})[_0xdb1d('0x1d')](function(_0x45787c){logger[_0xdb1d('0x21')](_0xdb1d('0x26'));return _0x45787c;});}});}else{logger[_0xdb1d('0x21')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdb1d('0xd')](_0xdb1d('0x25'),_0x57c62e['remoteUri'])})[_0xdb1d('0x1d')](function(_0x5827ef){logger[_0xdb1d('0x21')]('Admin\x20account\x20selected.');return _0x5827ef;});}}function getEndUser(_0x58b45a,_0x94170c,_0x5ccdb4){logger['info'](_0xdb1d('0x27'),_0x5ccdb4);return request({'uri':util['format']('%s/api/v2/contacts',_0x58b45a[_0xdb1d('0x1b')]),'qs':{'phone':_0x5ccdb4}})[_0xdb1d('0x1d')](function(_0xb3e240){if(_0xb3e240[_0xdb1d('0x20')]){logger[_0xdb1d('0x21')](_0xdb1d('0x28'));return _[_0xdb1d('0x23')](_0xb3e240,{'phone':_0x5ccdb4});}else{logger['info'](_0xdb1d('0x29'));return request({'uri':util[_0xdb1d('0xd')](_0xdb1d('0x2a'),_0x58b45a[_0xdb1d('0x1b')]),'method':_0xdb1d('0x1c'),'body':{'name':_0x94170c,'phone':_0x5ccdb4}})[_0xdb1d('0x1d')](function(_0x4aaa4c){logger[_0xdb1d('0x21')]('Enduser\x20created.');return _0x4aaa4c;});}});}function getAuth(_0x463b60){return util[_0xdb1d('0xd')](_0xdb1d('0x2b'),new Buffer(_0x463b60['apiKey']+':X')[_0xdb1d('0x2c')]('base64'));}function request(_0x176bcf){logger['debug']('[HTTP]',JSON['stringify'](_0x176bcf));return rp(_[_0xdb1d('0x7')](_0x176bcf,{'method':_0xdb1d('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0xe8506d,_0x470aa4){var _0x8c83a5=[];if(_0xe8506d&&_0xe8506d[_0xdb1d('0x20')]>0x0){_0x8c83a5=_[_0xdb1d('0x2e')](_0xe8506d,_0x470aa4);}return _0x8c83a5;}function getCustomFields(_0x256d5c,_0x219148){var _0x23eb54=[];var _0x3e75f9={'custom_fields':[]};if(_0x256d5c[_0xdb1d('0x20')]>0x0){_['forEach'](_0x256d5c,function(_0x4ebf60){if(_[_0xdb1d('0x2f')]([_0xdb1d('0x30'),_0xdb1d('0x31')],_0x4ebf60[_0xdb1d('0x32')])&&_0x4ebf60[_0xdb1d('0x33')]&&!_0x4ebf60['customField']){_0x3e75f9[_0x4ebf60[_0xdb1d('0x33')][_0xdb1d('0x34')]()]=_0x4ebf60[_0xdb1d('0x35')][_0xdb1d('0x2c')]();}else if(_[_0xdb1d('0x2f')]([_0xdb1d('0x30'),_0xdb1d('0x31')],_0x4ebf60['type'])&&_0x4ebf60['idField']&&_0x4ebf60[_0xdb1d('0x36')]){_0x3e75f9[_0xdb1d('0x16')][_0xdb1d('0x37')]({'id':_0x4ebf60[_0xdb1d('0x38')],'value':_0x4ebf60[_0xdb1d('0x35')][_0xdb1d('0x2c')]()});}else if(_0x4ebf60[_0xdb1d('0x32')]===_0xdb1d('0x39')&&_0x4ebf60[_0xdb1d('0x3a')]&&_0x4ebf60[_0xdb1d('0x38')]&&_0x4ebf60[_0xdb1d('0x36')]){_0x219148[_0x4ebf60['variableName']]&&_0x3e75f9['custom_fields'][_0xdb1d('0x37')]({'id':_0x4ebf60[_0xdb1d('0x38')],'value':_0x219148[_0x4ebf60[_0xdb1d('0x3a')]][_0xdb1d('0x2c')]()});}else if(_0x4ebf60[_0xdb1d('0x32')]===_0xdb1d('0x3b')&&_0x4ebf60['Variable']&&_0x4ebf60[_0xdb1d('0x3c')]['name']&&_0x4ebf60[_0xdb1d('0x38')]&&_0x4ebf60[_0xdb1d('0x36')]){_0x219148[_0x4ebf60[_0xdb1d('0x3c')]['name'][_0xdb1d('0x34')]()]&&_0x3e75f9[_0xdb1d('0x16')]['push']({'id':_0x4ebf60[_0xdb1d('0x38')],'value':_0x219148[_0x4ebf60[_0xdb1d('0x3c')][_0xdb1d('0x3d')][_0xdb1d('0x34')]()][_0xdb1d('0x2c')]()});}});}return _0x3e75f9;}exports[_0xdb1d('0x3e')]=function(_0xeca43b,_0x43f42c,_0x7a8f07,_0x490555,_0x3d7a80,_0x5f3655){var _0x3794b9,_0x36858d;_0x5f3655[_0xdb1d('0x1b')]=intUtil['stripTrailingSlash'](_0x5f3655[_0xdb1d('0x1b')]);_0x5f3655[_0xdb1d('0x3f')]=intUtil[_0xdb1d('0x40')](_0x5f3655[_0xdb1d('0x3f')]);if(_0x3d7a80&&_0x3d7a80['monitor_format']){logger[_0xdb1d('0x21')]('[QUEUE]',_0xdb1d('0x41'));_0x43f42c['recordingURL']=util[_0xdb1d('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5f3655['serverUrl'],_0x43f42c[_0xdb1d('0x42')],md5(_0x43f42c[_0xdb1d('0x42')]));}else{_0x43f42c['recordingURL']='';}headers[_0xdb1d('0x43')]=getAuth(_0x5f3655);return getUser(_0x5f3655,_0x490555[_0xdb1d('0x24')])[_0xdb1d('0x1d')](function(_0x5c9629){_0x3794b9=_0x5c9629;logger['info'](_0xdb1d('0x44'),_0x3794b9['id']);return getEndUser(_0x5f3655,_0x43f42c[_0xdb1d('0xf')],_0x43f42c[_0xdb1d('0x10')]);})[_0xdb1d('0x1d')](function(_0x56c5ca){_0x36858d=_0x56c5ca;logger['info'](_0xdb1d('0x45'),_0x36858d['id']);return getTicket(_0x5f3655,_0x3794b9,_0x36858d,_0x7a8f07,_0x43f42c);})[_0xdb1d('0x1d')](function(_0x5a65ed){if(_0x5a65ed&&_0x5a65ed['id']){logger[_0xdb1d('0x21')](_0xdb1d('0x46'));logger[_0xdb1d('0x21')](_0xdb1d('0x47'),_0x5a65ed['id']);logger['info'](_0xdb1d('0x48'),_0xdb1d('0x49'));emit(util[_0xdb1d('0xd')](_0xdb1d('0x4a'),_0x490555['name']),_0xdb1d('0x4b'),{'uri':util[_0xdb1d('0xd')]('%s/helpdesk/tickets/%d',_0x5f3655[_0xdb1d('0x1b')],_0x5a65ed['id'])});}})[_0xdb1d('0x4c')](function(_0x390458){logger[_0xdb1d('0x4d')]('[QUEUE]',JSON[_0xdb1d('0x4e')](_0x390458));});};exports[_0xdb1d('0x4f')]=function(_0x17d7e2,_0x33954a,_0xea4901,_0x21fd6e,_0x1ac902,_0x67f280,_0x5423ff){var _0x58f725,_0x511aa8;_0x67f280[_0xdb1d('0x1b')]=intUtil[_0xdb1d('0x40')](_0x67f280[_0xdb1d('0x1b')]);_0x67f280[_0xdb1d('0x3f')]=intUtil[_0xdb1d('0x40')](_0x67f280[_0xdb1d('0x3f')]);if(_0x5423ff&&_0x5423ff['recordingFormat']&&_0x5423ff['recordingFormat']!=='none'){logger['info'](_0xdb1d('0x50'),'Recording\x20is\x20enabled!');_0x33954a[_0xdb1d('0x51')]=util[_0xdb1d('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x67f280['serverUrl'],_0x33954a[_0xdb1d('0x42')],md5(_0x33954a[_0xdb1d('0x42')]));}headers[_0xdb1d('0x43')]=getAuth(_0x67f280);return getUser(_0x67f280,_0x21fd6e['email'])['then'](function(_0x4262d7){_0x58f725=_0x4262d7;logger['info'](_0xdb1d('0x44'),_0x58f725['id']);return getEndUser(_0x67f280,_0x33954a['destcalleridname'],_0x33954a['destcalleridnum']);})[_0xdb1d('0x1d')](function(_0x1d402c){_0x511aa8=_0x1d402c;logger[_0xdb1d('0x21')]('The\x20Enduser\x20ID\x20is:',_0x511aa8['id']);return getTicket(_0x67f280,_0x58f725,_0x511aa8,_0xea4901,_0x33954a);})[_0xdb1d('0x1d')](function(_0x4a1733){if(_0x4a1733&&_0x4a1733['id']){logger[_0xdb1d('0x21')](_0xdb1d('0x46'));logger[_0xdb1d('0x21')](_0xdb1d('0x47'),_0x4a1733['id']);logger[_0xdb1d('0x21')](_0xdb1d('0x50'),_0xdb1d('0x49'));emit(util[_0xdb1d('0xd')]('user:%s',_0x21fd6e[_0xdb1d('0x3d')]),_0xdb1d('0x4b'),{'uri':util[_0xdb1d('0xd')]('%s/helpdesk/tickets/%d',_0x67f280['remoteUri'],_0x4a1733['id'])});}})[_0xdb1d('0x4c')](function(_0x5441b8){logger[_0xdb1d('0x4d')](_0xdb1d('0x50'),JSON[_0xdb1d('0x4e')](_0x5441b8));});};exports['unmanaged']=function(_0x3651a7,_0x555575,_0x13fc1f,_0x5607bc,_0x120cf5,_0x3ba419){var _0x522b61,_0x289b36;_0x3ba419['remoteUri']=intUtil['stripTrailingSlash'](_0x3ba419['remoteUri']);_0x3ba419[_0xdb1d('0x3f')]=intUtil[_0xdb1d('0x40')](_0x3ba419['serverUrl']);if(_0x120cf5&&_0x120cf5[_0xdb1d('0x52')]){logger['info']('['+_0x555575[_0xdb1d('0x53')][_0xdb1d('0x54')]()+']','Recording\x20is\x20enabled!');_0x555575['recordingURL']=util[_0xdb1d('0xd')](_0xdb1d('0x55'),_0x3ba419[_0xdb1d('0x3f')],_0x555575[_0xdb1d('0x42')],md5(_0x555575[_0xdb1d('0x42')]));}else{_0x555575['recordingURL']='';}headers[_0xdb1d('0x43')]=getAuth(_0x3ba419);return getUser(_0x3ba419,'')[_0xdb1d('0x1d')](function(_0xf79df1){_0x522b61=_0xf79df1;logger[_0xdb1d('0x21')](_0xdb1d('0x44'),_0x522b61['id']);return getEndUser(_0x3ba419,_0x555575[_0xdb1d('0xf')],_0x555575['calleridnum']);})[_0xdb1d('0x1d')](function(_0x5c66a8){_0x289b36=_0x5c66a8;logger[_0xdb1d('0x21')](_0xdb1d('0x45'),_0x289b36['id']);return getTicket(_0x3ba419,_0x522b61,_0x289b36,_0x13fc1f,_0x555575);})[_0xdb1d('0x1d')](function(_0x494414){if(_0x494414){logger[_0xdb1d('0x21')]('Ticket\x20created!');logger[_0xdb1d('0x21')]('The\x20Ticket\x20ID\x20is:',_0x494414['id']);}})[_0xdb1d('0x4c')](function(_0x2b15be){logger[_0xdb1d('0x4d')]('['+_0x555575[_0xdb1d('0x53')]['toUpperCase']()+']',JSON[_0xdb1d('0x4e')](_0x2b15be));});}; \ 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 7e7d603..e76c0f3 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 _0x4993=['Contact','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','ticketId','/contacts/','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','userEmail','catch','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions'];(function(_0x5d6bd7,_0x3d97d2){var _0x29a88b=function(_0x540716){while(--_0x540716){_0x5d6bd7['push'](_0x5d6bd7['shift']());}};_0x29a88b(++_0x3d97d2);}(_0x4993,0x122));var _0x3499=function(_0x3b59aa,_0x7a990b){_0x3b59aa=_0x3b59aa-0x0;var _0x5cad80=_0x4993[_0x3b59aa];return _0x5cad80;};'use strict';var _=require('lodash');var rp=require(_0x3499('0x0'));var md5=require('md5');var util=require('util');var moment=require(_0x3499('0x1'));var Promise=require(_0x3499('0x2'));var Redis=require(_0x3499('0x3'));var intUtil=require(_0x3499('0x4'));var config=require(_0x3499('0x5'));var logger=require(_0x3499('0x6'))('freshsales');config[_0x3499('0x7')]=_[_0x3499('0x8')](config[_0x3499('0x7')],{'host':_0x3499('0x9'),'port':0x18eb});var io=require(_0x3499('0xa'))(new Redis(config[_0x3499('0x7')]));function getAdminId(_0x5945a1,_0x3bddf2,_0x2a8030,_0xfe34aa){return new Promise(function(_0x1e979b,_0x5b65ad){var _0x234ed6=![];var _0x299a0e={'method':_0x3499('0xb'),'uri':_0xfe34aa+_0x3499('0xc'),'json':!![]};_0x299a0e['headers']=_0x2a8030;logger[_0x3499('0xd')]('Getting\x20admin\x20information');return rp(_0x299a0e)[_0x3499('0xe')](function(_0xb3e434){if(_0xb3e434){var _0x7c67c0=_0xb3e434[_0x3499('0xf')];var _0x3252fa=null;for(_0x3252fa=0x0;_0x3252fa<_0x7c67c0['length'];_0x3252fa++){if(_0x7c67c0[_0x3252fa][_0x3499('0x10')]===_0x5945a1[_0x3499('0x11')]){_0x5945a1[_0x3499('0x12')]=_0x7c67c0[_0x3252fa]['id'];_0x234ed6=!![];}}if(_0x234ed6){logger[_0x3499('0xd')]('Admin\x20found:',_0x5945a1[_0x3499('0x12')]);_0x1e979b(_0x5945a1);}else{_0x5b65ad({'statusCode':0x194,'message':_0x3499('0x13')});}}else{_0x5b65ad({'statusCode':0x194,'message':_0x3499('0x13')});}})['catch'](function(_0x5636dc){logger[_0x3499('0x14')]('['+[_0x3bddf2[_0x3499('0x15')]()]+']',_0x5636dc['message']);_0x5b65ad(_0x5636dc);});});}function getUser(_0x4dec61,_0x4700bf,_0x2fad67){return function(_0x10533d){return new Promise(function(_0x4cec83,_0x40b594){var _0x46a35f={'method':_0x3499('0xb'),'uri':_0x2fad67+_0x3499('0xc'),'json':!![]};_0x46a35f[_0x3499('0x16')]=_0x4700bf;logger[_0x3499('0xd')](_0x3499('0x17'));return rp(_0x46a35f)[_0x3499('0xe')](function(_0x409023){if(_0x409023){var _0x2da448=_0x409023['users'];var _0x57ee42=![];var _0x5d6c06=null;if(_0x10533d[_0x3499('0x18')]!==null){logger[_0x3499('0xd')](_0x3499('0x19'),_0x10533d[_0x3499('0x18')]);_0x10533d['userEmail']=_0x10533d[_0x3499('0x18')];for(_0x5d6c06=0x0;_0x5d6c06<_0x2da448[_0x3499('0x1a')];_0x5d6c06++){if(_0x2da448[_0x5d6c06]['email']===_0x10533d[_0x3499('0x18')]){_0x57ee42=!![];_0x10533d[_0x3499('0x1b')]=_0x2da448[_0x5d6c06]['id'];logger[_0x3499('0xd')](_0x3499('0x1c'),_0x10533d[_0x3499('0x1b')]);}}}if(!_0x57ee42){logger[_0x3499('0xd')]('Admin\x20selected');_0x10533d[_0x3499('0x1d')]=_0x10533d[_0x3499('0x11')];_0x10533d['userId']=_0x10533d['adminId'];_0x57ee42=!![];}if(_0x57ee42){_0x4cec83(_0x10533d);}else{_0x40b594({'statusCode':0x194,'message':_0x3499('0x13')});}}else{_0x40b594({'statusCode':0x194,'message':_0x3499('0x13')});}})[_0x3499('0x1e')](function(_0x4a3287){logger[_0x3499('0x14')]('['+[_0x4dec61[_0x3499('0x15')]()]+']',_0x4a3287[_0x3499('0x1f')]);_0x40b594(_0x4a3287);});});};}function searchContact(_0x1d160c,_0x473494,_0x21e8ab,_0xf59929){return new Promise(function(_0xa7bbb3,_0x4416d7){var _0x32c961={'method':_0x3499('0xb'),'headers':_0x473494,'uri':_0x1d160c+_0x3499('0x20')+_0xf59929+_0x3499('0x21')+_0x21e8ab+_0x3499('0x22'),'json':!![]};rp(_0x32c961)['then'](function(_0x126940){var _0x17e51a=_[_0x3499('0x23')](_0x126940[_0x3499('0x24')][_0x3499('0x24')],[_0x21e8ab,_0xf59929]);_0xa7bbb3(_0x17e51a);})[_0x3499('0x1e')](function(_0x33cf51){_0x4416d7(_0x33cf51);});});}function getEndUser(_0x4f5d4c,_0x220931,_0x1ba63f){return function(_0x3d856a){return new Promise(function(_0x5ca0f1,_0x279866){logger[_0x3499('0xd')](util[_0x3499('0x25')](_0x3499('0x26'),_0x3d856a['contactNumber']));searchContact(_0x1ba63f,_0x220931,_0x3499('0x27'),_0x3d856a[_0x3499('0x28')])[_0x3499('0xe')](function(_0x478991){if(_0x478991){_0x3d856a[_0x3499('0x29')]=_0x478991['id'];logger[_0x3499('0xd')](_0x3499('0x2a'),_0x3d856a['endUserId']);return _0x5ca0f1(_0x3d856a);}searchContact(_0x1ba63f,_0x220931,_0x3499('0x2b'),_0x3d856a[_0x3499('0x28')])[_0x3499('0xe')](function(_0x3cfd03){if(_0x3cfd03){_0x3d856a[_0x3499('0x29')]=_0x3cfd03['id'];logger[_0x3499('0xd')](_0x3499('0x2c'),_0x3d856a[_0x3499('0x29')]);return _0x5ca0f1(_0x3d856a);}createEndUser(_0x3d856a,_0x4f5d4c,_0x220931,_0x1ba63f)[_0x3499('0xe')](function(_0x31d57e){logger['info'](_0x3499('0x2d'),_0x31d57e[_0x3499('0x29')]);return _0x5ca0f1(_0x31d57e);});});})[_0x3499('0x1e')](function(_0x5c3b1d){_0x279866(_0x5c3b1d);});});};}function createEndUser(_0x4e3c11,_0x59687a,_0x1d2da2,_0x141559){return new Promise(function(_0x2e7791,_0x4a9a12){var _0x9bcf73=moment();var _0x4606b7={'method':_0x3499('0x2e'),'uri':_0x141559+_0x3499('0x2f'),'body':{'contact':{'last_name':_0x4e3c11[_0x3499('0x28')],'work_number':_0x4e3c11[_0x3499('0x28')],'mobile_number':_0x4e3c11[_0x3499('0x28')],'owner_id':_0x4e3c11[_0x3499('0x1b')],'created_at':_0x9bcf73[_0x3499('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4606b7[_0x3499('0x16')]=_0x1d2da2;logger[_0x3499('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x4606b7)['then'](function(_0x38c527){_0x4e3c11[_0x3499('0x29')]=_0x38c527[_0x3499('0x30')]['id'];_0x2e7791(_0x4e3c11);})['catch'](function(_0x3e9544){logger[_0x3499('0x14')]('['+[_0x59687a[_0x3499('0x15')]()]+']',_0x3e9544['message']);_0x4a9a12(_0x3e9544[_0x3499('0x1f')]);});});}function getTicket(_0x510793,_0x2fb501,_0x1b194e,_0x23d681,_0x2f70d9){return function(_0x3f8cdb){logger[_0x3499('0xd')](_0x3499('0x31'));return new Promise(function(_0x757b6,_0x3bcbf4){var _0x353614=moment();var _0x44336f={'method':_0x3499('0x2e'),'uri':_0x1b194e+_0x3499('0x32'),'body':{'title':intUtil[_0x3499('0x33')](_0x23d681[_0x3499('0x34')],_0x2f70d9,'\x20'),'description':intUtil[_0x3499('0x33')](_0x23d681[_0x3499('0x35')],_0x2f70d9,'\x0a'),'owner_id':_0x3f8cdb['userId'],'creater_id':_0x3f8cdb['adminId'],'targetable_id':_0x3f8cdb[_0x3499('0x29')],'targetable_type':_0x3499('0x36'),'created_at':_0x353614[_0x3499('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x353614['add'](0x1e,'m')[_0x3499('0x25')](_0x3499('0x37'))},'json':!![]};_0x44336f[_0x3499('0x16')]=_0x2fb501;return rp(_0x44336f)[_0x3499('0xe')](function(_0x11bb21){_0x3f8cdb['ticketId']=_0x11bb21[_0x3499('0x38')]['id'];logger['info'](_0x3499('0x39'),_0x3f8cdb[_0x3499('0x3a')]);_0x757b6(_0x3f8cdb);})[_0x3499('0x1e')](function(_0x7e1e63){logger[_0x3499('0x14')]('['+[_0x510793[_0x3499('0x15')]()]+']',_0x7e1e63['message']);_0x3bcbf4(_0x7e1e63[_0x3499('0x1f')]);});});};}function emit(_0x5bee1c,_0x8792d4,_0x43d0de){var _0x56ad62={'uri':_0x5bee1c+_0x3499('0x3b')+_0x43d0de};io['to'](util[_0x3499('0x25')]('user:%s',_0x8792d4))['emit'](_0x3499('0x3c'),_0x56ad62);}exports['cs']=function(_0x1ac42a,_0x3e79a8,_0x575b68,_0x340df1,_0x5c6a07,_0x5f5524,_0x58c12b,_0xd1b21e){var _0x199fe4={};var _0x3f66f5={'Authorization':_0x3499('0x3d')+_0x5f5524[_0x3499('0x3e')]};_0x5f5524[_0x3499('0x3f')]=intUtil[_0x3499('0x40')](_0x5f5524[_0x3499('0x3f')]);_0x5f5524[_0x3499('0x41')]=intUtil[_0x3499('0x40')](_0x5f5524[_0x3499('0x41')]);var _0x2ce726=_0x5f5524['remoteUri'];_0x199fe4['adminEmail']=_0x5f5524[_0x3499('0x42')];_0x199fe4['contactNumber']=_0xd1b21e[_0x3499('0x43')]()===_0x3499('0x44')?_0x3e79a8[_0x3499('0x45')]:_0x3e79a8[_0x3499('0x46')];_0x199fe4[_0x3499('0x47')]=_0xd1b21e===_0x3499('0x48')||_0xd1b21e===_0x3499('0x49')?_0x3499('0x48'):_0x3499('0x44');if(_0x340df1){_0x199fe4[_0x3499('0x18')]=_0x340df1[_0x3499('0x10')];}var _0x3178e6=util['format'](_0x3499('0x4a'),_0x5f5524[_0x3499('0x41')],_0x3e79a8[_0x3499('0x4b')],md5(_0x3e79a8[_0x3499('0x4b')]));if(_0x5c6a07&&_0x5c6a07[_0x3499('0x4c')]){logger[_0x3499('0xd')](_0x3499('0x4d'),'Recording\x20is\x20enabled!');_0x3e79a8[_0x3499('0x4e')]=_0x3178e6;}else if(_0x58c12b&&_0x58c12b['recordingFormat']&&_0x58c12b[_0x3499('0x4f')]!==_0x3499('0x50')){logger['info'](_0x3499('0x51'),_0x3499('0x52'));_0x3e79a8[_0x3499('0x4e')]=_0x3178e6;}else{_0x3e79a8['recordingURL']='';}return getAdminId(_0x199fe4,_0xd1b21e,_0x3f66f5,_0x2ce726)[_0x3499('0xe')](getUser(_0xd1b21e,_0x3f66f5,_0x2ce726))[_0x3499('0xe')](getEndUser(_0xd1b21e,_0x3f66f5,_0x2ce726))[_0x3499('0xe')](getTicket(_0xd1b21e,_0x3f66f5,_0x2ce726,_0x575b68,_0x3e79a8))[_0x3499('0xe')](function(_0x431179){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x431179[_0x3499('0x3a')]));if(_0xd1b21e!==_0x3499('0x49')){logger[_0x3499('0xd')]('['+[_0xd1b21e[_0x3499('0x15')]()]+']',_0x3499('0x53'));emit(_0x2ce726,_0x340df1[_0x3499('0x54')],_0x431179[_0x3499('0x29')]);}})['catch'](function(_0x1bd36c){logger['error']('['+[_0xd1b21e[_0x3499('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x3499('0x55')](_0x1bd36c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x10f6=['message','Getting\x20user\x20with\x20email','userEmail','agentEmail','userId','error','&f=','&entities=contact','then','find','contacts','format','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','Token\x20token=','serverUrl','stripTrailingSlash','remoteUri','username','toLowerCase','outbound','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase'];(function(_0x492cd4,_0x1a98e5){var _0x4e46d0=function(_0x264d52){while(--_0x264d52){_0x492cd4['push'](_0x492cd4['shift']());}};_0x4e46d0(++_0x1a98e5);}(_0x10f6,0x11c));var _0x610f=function(_0x45038c,_0x25ec66){_0x45038c=_0x45038c-0x0;var _0x19b161=_0x10f6[_0x45038c];return _0x19b161;};'use strict';var _=require(_0x610f('0x0'));var rp=require(_0x610f('0x1'));var md5=require(_0x610f('0x2'));var util=require(_0x610f('0x3'));var moment=require(_0x610f('0x4'));var Promise=require(_0x610f('0x5'));var Redis=require('ioredis');var intUtil=require(_0x610f('0x6'));var config=require(_0x610f('0x7'));var logger=require(_0x610f('0x8'))('freshsales');config[_0x610f('0x9')]=_[_0x610f('0xa')](config[_0x610f('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x610f('0xb'))(new Redis(config[_0x610f('0x9')]));function getAdminId(_0x10dac3,_0x47c1b3,_0x4df6d6,_0x55078c){return new Promise(function(_0x5d0021,_0xd2cc78){var _0x47d1fa=![];var _0x2ec062={'method':_0x610f('0xc'),'uri':_0x55078c+_0x610f('0xd'),'json':!![]};_0x2ec062[_0x610f('0xe')]=_0x4df6d6;logger[_0x610f('0xf')]('Getting\x20admin\x20information');return rp(_0x2ec062)['then'](function(_0x21e79b){if(_0x21e79b){var _0x2ad852=_0x21e79b[_0x610f('0x10')];var _0x51dad4=null;for(_0x51dad4=0x0;_0x51dad4<_0x2ad852['length'];_0x51dad4++){if(_0x2ad852[_0x51dad4][_0x610f('0x11')]===_0x10dac3[_0x610f('0x12')]){_0x10dac3[_0x610f('0x13')]=_0x2ad852[_0x51dad4]['id'];_0x47d1fa=!![];}}if(_0x47d1fa){logger[_0x610f('0xf')](_0x610f('0x14'),_0x10dac3[_0x610f('0x13')]);_0x5d0021(_0x10dac3);}else{_0xd2cc78({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xd2cc78({'statusCode':0x194,'message':_0x610f('0x15')});}})[_0x610f('0x16')](function(_0x3d4da4){logger['error']('['+[_0x47c1b3[_0x610f('0x17')]()]+']',_0x3d4da4[_0x610f('0x18')]);_0xd2cc78(_0x3d4da4);});});}function getUser(_0x14570d,_0x253e83,_0x67bb8f){return function(_0x5daf5a){return new Promise(function(_0x129222,_0x4e3abf){var _0x1651cb={'method':_0x610f('0xc'),'uri':_0x67bb8f+'/api/selector/owners','json':!![]};_0x1651cb[_0x610f('0xe')]=_0x253e83;logger[_0x610f('0xf')]('Getting\x20user\x20list');return rp(_0x1651cb)['then'](function(_0x2d0914){if(_0x2d0914){var _0xd71414=_0x2d0914['users'];var _0x3dba5f=![];var _0x260240=null;if(_0x5daf5a['agentEmail']!==null){logger['info'](_0x610f('0x19'),_0x5daf5a['agentEmail']);_0x5daf5a[_0x610f('0x1a')]=_0x5daf5a[_0x610f('0x1b')];for(_0x260240=0x0;_0x260240<_0xd71414['length'];_0x260240++){if(_0xd71414[_0x260240][_0x610f('0x11')]===_0x5daf5a[_0x610f('0x1b')]){_0x3dba5f=!![];_0x5daf5a[_0x610f('0x1c')]=_0xd71414[_0x260240]['id'];logger[_0x610f('0xf')]('User\x20found:',_0x5daf5a[_0x610f('0x1c')]);}}}if(!_0x3dba5f){logger[_0x610f('0xf')]('Admin\x20selected');_0x5daf5a[_0x610f('0x1a')]=_0x5daf5a[_0x610f('0x12')];_0x5daf5a[_0x610f('0x1c')]=_0x5daf5a[_0x610f('0x13')];_0x3dba5f=!![];}if(_0x3dba5f){_0x129222(_0x5daf5a);}else{_0x4e3abf({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4e3abf({'statusCode':0x194,'message':_0x610f('0x15')});}})[_0x610f('0x16')](function(_0x591c58){logger[_0x610f('0x1d')]('['+[_0x14570d['toUpperCase']()]+']',_0x591c58[_0x610f('0x18')]);_0x4e3abf(_0x591c58);});});};}function searchContact(_0x217db3,_0x157024,_0x28430f,_0x431846){return new Promise(function(_0x5ede43,_0x185b33){var _0x23180a={'method':_0x610f('0xc'),'headers':_0x157024,'uri':_0x217db3+'/api/lookup?q='+_0x431846+_0x610f('0x1e')+_0x28430f+_0x610f('0x1f'),'json':!![]};rp(_0x23180a)[_0x610f('0x20')](function(_0x207275){var _0x5a56e3=_[_0x610f('0x21')](_0x207275[_0x610f('0x22')]['contacts'],[_0x28430f,_0x431846]);_0x5ede43(_0x5a56e3);})[_0x610f('0x16')](function(_0x48f7e4){_0x185b33(_0x48f7e4);});});}function getEndUser(_0x33092d,_0x30b266,_0x26d2f3){return function(_0x265799){return new Promise(function(_0x53c47d,_0x4538ff){logger[_0x610f('0xf')](util[_0x610f('0x23')]('Searching\x20contact\x20with\x20phone\x20%s',_0x265799[_0x610f('0x24')]));searchContact(_0x26d2f3,_0x30b266,'mobile_number',_0x265799[_0x610f('0x24')])[_0x610f('0x20')](function(_0x252ce3){if(_0x252ce3){_0x265799[_0x610f('0x25')]=_0x252ce3['id'];logger[_0x610f('0xf')]('Contact\x20found\x20mobile_number:',_0x265799[_0x610f('0x25')]);return _0x53c47d(_0x265799);}searchContact(_0x26d2f3,_0x30b266,_0x610f('0x26'),_0x265799[_0x610f('0x24')])[_0x610f('0x20')](function(_0x4fde10){if(_0x4fde10){_0x265799[_0x610f('0x25')]=_0x4fde10['id'];logger[_0x610f('0xf')](_0x610f('0x27'),_0x265799['endUserId']);return _0x53c47d(_0x265799);}createEndUser(_0x265799,_0x33092d,_0x30b266,_0x26d2f3)[_0x610f('0x20')](function(_0x41c7bc){logger[_0x610f('0xf')](_0x610f('0x28'),_0x41c7bc[_0x610f('0x25')]);return _0x53c47d(_0x41c7bc);});});})[_0x610f('0x16')](function(_0x1d1c0b){_0x4538ff(_0x1d1c0b);});});};}function createEndUser(_0x4a4cd8,_0x5aebc6,_0x19a9d8,_0x336e2c){return new Promise(function(_0x164f95,_0x171e65){var _0x3ed60f=moment();var _0x5594e0={'method':_0x610f('0x29'),'uri':_0x336e2c+_0x610f('0x2a'),'body':{'contact':{'last_name':_0x4a4cd8[_0x610f('0x24')],'work_number':_0x4a4cd8[_0x610f('0x24')],'mobile_number':_0x4a4cd8['contactNumber'],'owner_id':_0x4a4cd8[_0x610f('0x1c')],'created_at':_0x3ed60f[_0x610f('0x23')](_0x610f('0x2b'))}},'json':!![]};_0x5594e0[_0x610f('0xe')]=_0x19a9d8;logger[_0x610f('0xf')](_0x610f('0x2c'));return rp(_0x5594e0)['then'](function(_0x546adf){_0x4a4cd8[_0x610f('0x25')]=_0x546adf[_0x610f('0x2d')]['id'];_0x164f95(_0x4a4cd8);})[_0x610f('0x16')](function(_0x2e51c5){logger['error']('['+[_0x5aebc6[_0x610f('0x17')]()]+']',_0x2e51c5[_0x610f('0x18')]);_0x171e65(_0x2e51c5[_0x610f('0x18')]);});});}function getTicket(_0x9a7416,_0x24a9b5,_0x1904c2,_0x49e0e1,_0xbc8498){return function(_0x24b3ca){logger[_0x610f('0xf')](_0x610f('0x2e'));return new Promise(function(_0x52af80,_0xd59954){var _0x37529b=moment();var _0x1a86dc={'method':'POST','uri':_0x1904c2+_0x610f('0x2f'),'body':{'title':intUtil[_0x610f('0x30')](_0x49e0e1[_0x610f('0x31')],_0xbc8498,'\x20'),'description':intUtil['getString'](_0x49e0e1[_0x610f('0x32')],_0xbc8498,'\x0a'),'owner_id':_0x24b3ca['userId'],'creater_id':_0x24b3ca[_0x610f('0x13')],'targetable_id':_0x24b3ca[_0x610f('0x25')],'targetable_type':_0x610f('0x33'),'created_at':_0x37529b[_0x610f('0x23')](_0x610f('0x2b')),'due_date':_0x37529b['add'](0x1e,'m')[_0x610f('0x23')](_0x610f('0x2b'))},'json':!![]};_0x1a86dc[_0x610f('0xe')]=_0x24a9b5;return rp(_0x1a86dc)['then'](function(_0x536dc8){_0x24b3ca['ticketId']=_0x536dc8[_0x610f('0x34')]['id'];logger['info'](_0x610f('0x35'),_0x24b3ca[_0x610f('0x36')]);_0x52af80(_0x24b3ca);})[_0x610f('0x16')](function(_0x2c0ab1){logger[_0x610f('0x1d')]('['+[_0x9a7416[_0x610f('0x17')]()]+']',_0x2c0ab1[_0x610f('0x18')]);_0xd59954(_0x2c0ab1[_0x610f('0x18')]);});});};}function emit(_0x23ac72,_0x1850ac,_0x5b41b3){var _0x2c2c9c={'uri':_0x23ac72+_0x610f('0x37')+_0x5b41b3};io['to'](util[_0x610f('0x23')]('user:%s',_0x1850ac))[_0x610f('0x38')](_0x610f('0x39'),_0x2c2c9c);}exports['cs']=function(_0x292674,_0x5c9ed7,_0x53178c,_0x11cac4,_0xafbafc,_0x3b2480,_0x412bee,_0x378fa2){var _0x987e89={};var _0x5e9f13={'Authorization':_0x610f('0x3a')+_0x3b2480['apiKey']};_0x3b2480['remoteUri']=intUtil['stripTrailingSlash'](_0x3b2480['remoteUri']);_0x3b2480[_0x610f('0x3b')]=intUtil[_0x610f('0x3c')](_0x3b2480[_0x610f('0x3b')]);var _0x246dcf=_0x3b2480[_0x610f('0x3d')];_0x987e89[_0x610f('0x12')]=_0x3b2480[_0x610f('0x3e')];_0x987e89[_0x610f('0x24')]=_0x378fa2[_0x610f('0x3f')]()===_0x610f('0x40')?_0x5c9ed7['destcalleridnum']:_0x5c9ed7[_0x610f('0x41')];_0x987e89['callDirection']=_0x378fa2===_0x610f('0x42')||_0x378fa2===_0x610f('0x43')?'queue':_0x610f('0x40');if(_0x11cac4){_0x987e89['agentEmail']=_0x11cac4[_0x610f('0x11')];}var _0x1f8dd8=util[_0x610f('0x23')](_0x610f('0x44'),_0x3b2480[_0x610f('0x3b')],_0x5c9ed7['uniqueid'],md5(_0x5c9ed7[_0x610f('0x45')]));if(_0xafbafc&&_0xafbafc[_0x610f('0x46')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5c9ed7[_0x610f('0x47')]=_0x1f8dd8;}else if(_0x412bee&&_0x412bee[_0x610f('0x48')]&&_0x412bee[_0x610f('0x48')]!==_0x610f('0x49')){logger[_0x610f('0xf')]('[OUTBOUND]',_0x610f('0x4a'));_0x5c9ed7['recordingURL']=_0x1f8dd8;}else{_0x5c9ed7[_0x610f('0x47')]='';}return getAdminId(_0x987e89,_0x378fa2,_0x5e9f13,_0x246dcf)['then'](getUser(_0x378fa2,_0x5e9f13,_0x246dcf))[_0x610f('0x20')](getEndUser(_0x378fa2,_0x5e9f13,_0x246dcf))[_0x610f('0x20')](getTicket(_0x378fa2,_0x5e9f13,_0x246dcf,_0x53178c,_0x5c9ed7))[_0x610f('0x20')](function(_0xa8f714){logger['info'](util[_0x610f('0x23')](_0x610f('0x4b'),_0xa8f714[_0x610f('0x36')]));if(_0x378fa2!==_0x610f('0x43')){logger[_0x610f('0xf')]('['+[_0x378fa2['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x246dcf,_0x11cac4['name'],_0xa8f714[_0x610f('0x25')]);}})['catch'](function(_0x3665f8){logger[_0x610f('0x1d')]('['+[_0x378fa2[_0x610f('0x17')]()]+_0x610f('0x4c'),util['inspect'](_0x3665f8,{'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 0e4b26e..565b3f2 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 _0x5bd2=['lodash','util','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','[EXEC]','error','format','%s\x20account\x20#%s\x20not\x20found'];(function(_0x393345,_0x2a5a46){var _0xa9b815=function(_0x2af11b){while(--_0x2af11b){_0x393345['push'](_0x393345['shift']());}};_0xa9b815(++_0x2a5a46);}(_0x5bd2,0x1a2));var _0x25bd=function(_0x1e3b6e,_0x5ced5d){_0x1e3b6e=_0x1e3b6e-0x0;var _0x33a8c5=_0x5bd2[_0x1e3b6e];return _0x33a8c5;};'use strict';var _=require(_0x25bd('0x0'));var util=require(_0x25bd('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x25bd('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x25bd('0x3'));var desk=require(_0x25bd('0x4'));var vtiger=require(_0x25bd('0x5'));var servicenow=require(_0x25bd('0x6'));var dynamics365=require(_0x25bd('0x7'));var freshsales=require(_0x25bd('0x8'));var integrations=[_0x25bd('0x9'),_0x25bd('0xa'),_0x25bd('0xb'),_0x25bd('0xc'),_0x25bd('0xd'),_0x25bd('0xe'),'vtiger','dynamics365','freshsales',_0x25bd('0xf')];exports[_0x25bd('0x10')]=function(_0x319de4,_0x2f4208,_0x21466c,_0x4a8334,_0x6a4ad5,_0x559877){if(_0x21466c){if(_['includes'](integrations,_0x319de4['data1'][_0x25bd('0x11')]())){try{var _0x3b7cd=null;var _0x1d882a='';var _0x124da2=_0x21466c[_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]()];if(_0x124da2){var _0x54c7d3=_0x124da2[_0x319de4[_0x25bd('0x13')]];if(_0x54c7d3){var _0x3f79a8=_[_0x25bd('0x14')](_0x54c7d3[_0x25bd('0x15')],{'id':parseInt(_0x319de4[_0x25bd('0x16')],0xa)});if(_0x3f79a8){if(_0x4a8334){if(_0x6a4ad5&&_0x2f4208[_0x25bd('0x17')]){_0x1d882a=_0x25bd('0x17');}else if(_0x2f4208[_0x25bd('0x18')]){_0x1d882a=_0x25bd('0x19');}else{console[_0x25bd('0x1a')](_0x25bd('0x1b'),_0x2f4208);}}else{_0x1d882a=_0x25bd('0x1c');}switch(_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]()){case _0x25bd('0x9'):zendesk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xa'):salesforce[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case'sugarcrm':sugarcrm[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case'freshdesk':freshdesk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xd'):zoho[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0xe'):desk[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0x1d'):vtiger[_0x1d882a](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877);break;case _0x25bd('0x1e'):freshsales['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;case _0x25bd('0xf'):servicenow['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;case _0x25bd('0x1f'):dynamics365['cs'](_0x319de4,_0x2f4208,_0x3f79a8,_0x4a8334,_0x6a4ad5,_0x54c7d3,_0x559877,_0x1d882a);break;default:console['log'](_0x25bd('0x20'));}}else{_0x3b7cd=require(_0x25bd('0x21'))(_0x319de4[_0x25bd('0x12')][_0x25bd('0x11')]());_0x3b7cd['error'](_0x25bd('0x22'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x319de4[_0x25bd('0x12')]['toLowerCase'](),_0x319de4[_0x25bd('0x16')]));}}else{_0x3b7cd=require(_0x25bd('0x21'))(_0x319de4[_0x25bd('0x12')]['toLowerCase']());_0x3b7cd[_0x25bd('0x23')](_0x25bd('0x22'),util[_0x25bd('0x24')](_0x25bd('0x25'),_0x319de4[_0x25bd('0x12')]['toLowerCase'](),_0x319de4[_0x25bd('0x13')]));}}else{}}catch(_0x2cd63d){console[_0x25bd('0x23')](_0x2cd63d);}}}}; \ No newline at end of file +var _0xddc6=['zoho','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./desk','./vtiger','./servicenow','./dynamics365','zendesk','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','unmanaged','salesforce'];(function(_0x54b53d,_0x2d1c05){var _0x33c19d=function(_0x50a935){while(--_0x50a935){_0x54b53d['push'](_0x54b53d['shift']());}};_0x33c19d(++_0x2d1c05);}(_0xddc6,0x194));var _0x6ddc=function(_0x22d506,_0x47e664){_0x22d506=_0x22d506-0x0;var _0x2e2a3c=_0xddc6[_0x22d506];return _0x2e2a3c;};'use strict';var _=require(_0x6ddc('0x0'));var util=require('util');var zendesk=require(_0x6ddc('0x1'));var salesforce=require(_0x6ddc('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x6ddc('0x3'));var vtiger=require(_0x6ddc('0x4'));var servicenow=require(_0x6ddc('0x5'));var dynamics365=require(_0x6ddc('0x6'));var freshsales=require('./freshsales');var integrations=[_0x6ddc('0x7'),'salesforce',_0x6ddc('0x8'),_0x6ddc('0x9'),'zoho',_0x6ddc('0xa'),_0x6ddc('0xb'),_0x6ddc('0xc'),_0x6ddc('0xd'),_0x6ddc('0xe')];exports[_0x6ddc('0xf')]=function(_0x45ad4a,_0x1ebb69,_0x59ea88,_0xf7b85a,_0x44336f,_0x1d1d5c){if(_0x59ea88){if(_['includes'](integrations,_0x45ad4a[_0x6ddc('0x10')][_0x6ddc('0x11')]())){try{var _0x4adf5e=null;var _0x5a86ce='';var _0x5b8f16=_0x59ea88[_0x45ad4a[_0x6ddc('0x10')][_0x6ddc('0x11')]()];if(_0x5b8f16){var _0x250bf6=_0x5b8f16[_0x45ad4a[_0x6ddc('0x12')]];if(_0x250bf6){var _0x10e4bf=_[_0x6ddc('0x13')](_0x250bf6[_0x6ddc('0x14')],{'id':parseInt(_0x45ad4a[_0x6ddc('0x15')],0xa)});if(_0x10e4bf){if(_0xf7b85a){if(_0x44336f&&_0x1ebb69[_0x6ddc('0x16')]){_0x5a86ce='queue';}else if(_0x1ebb69[_0x6ddc('0x17')]){_0x5a86ce=_0x6ddc('0x18');}else{console[_0x6ddc('0x19')]('EVENT\x20UNKNOWN',_0x1ebb69);}}else{_0x5a86ce=_0x6ddc('0x1a');}switch(_0x45ad4a[_0x6ddc('0x10')][_0x6ddc('0x11')]()){case'zendesk':zendesk[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0x1b'):salesforce[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0x8'):sugarcrm[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0x9'):freshdesk[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0x1c'):zoho[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0xa'):desk[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case'vtiger':vtiger[_0x5a86ce](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c);break;case _0x6ddc('0xd'):freshsales['cs'](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c,_0x5a86ce);break;case _0x6ddc('0xe'):servicenow['cs'](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c,_0x5a86ce);break;case _0x6ddc('0xc'):dynamics365['cs'](_0x45ad4a,_0x1ebb69,_0x10e4bf,_0xf7b85a,_0x44336f,_0x250bf6,_0x1d1d5c,_0x5a86ce);break;default:console[_0x6ddc('0x19')](_0x6ddc('0x1d'));}}else{_0x4adf5e=require(_0x6ddc('0x1e'))(_0x45ad4a[_0x6ddc('0x10')]['toLowerCase']());_0x4adf5e[_0x6ddc('0x1f')](_0x6ddc('0x20'),util[_0x6ddc('0x21')](_0x6ddc('0x22'),_0x45ad4a[_0x6ddc('0x10')][_0x6ddc('0x11')](),_0x45ad4a[_0x6ddc('0x15')]));}}else{_0x4adf5e=require(_0x6ddc('0x1e'))(_0x45ad4a['data1']['toLowerCase']());_0x4adf5e[_0x6ddc('0x1f')](_0x6ddc('0x20'),util[_0x6ddc('0x21')](_0x6ddc('0x23'),_0x45ad4a[_0x6ddc('0x10')][_0x6ddc('0x11')](),_0x45ad4a[_0x6ddc('0x12')]));}}else{}}catch(_0x341f81){console[_0x6ddc('0x1f')](_0x341f81);}}}}; \ 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 e9950b0..552d60a 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 _0x1404=['emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','account','WhatId','Case','ContactId','AccountId','lead','leadId','info','sobject','create','isNil','User','find','execute','resolve','identity','then','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','$or','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','picklist','idField','toString','variable','variableName','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','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.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1404,0x1eb));var _0x4140=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x1404[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x4140('0x0'));var rp=require(_0x4140('0x1'));var moment=require(_0x4140('0x2'));var BPromise=require(_0x4140('0x3'));var md5=require(_0x4140('0x4'));var jsforce=require(_0x4140('0x5'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x4140('0x6'));var logger=require(_0x4140('0x7'))(_0x4140('0x8'));config[_0x4140('0x9')]=_[_0x4140('0xa')](config['redis'],{'host':_0x4140('0xb'),'port':0x18eb});var io=require(_0x4140('0xc'))(new Redis(config['redis']));function emit(_0x378f8f,_0xbf1d3e,_0x29c5e6){io['to'](_0x378f8f)[_0x4140('0xd')](_0xbf1d3e,_0x29c5e6);}function getTicket(_0x41fc06,_0xb5f10,_0x41b731,_0x5d1e39,_0x3d3223,_0x266f63,_0x49d7c5,_0x480e4c){var _0x4e7b4b=Object['assign']({},{'OwnerId':_0xb5f10['id'],'Subject':intUtil[_0x4140('0xe')](_0x5d1e39[_0x4140('0xf')],_0x3d3223,'\x20'),'Description':intUtil[_0x4140('0xe')](_0x5d1e39[_0x4140('0x10')],_0x3d3223,'\x0a')},getCustomFields(_0x266f63,_0x3d3223));if(_0x41b731){if(_0x5d1e39[_0x4140('0x11')]===_0x4140('0x12')){_0x4e7b4b[_0x4140('0x13')]=moment[_0x4140('0x14')]();_0x4e7b4b[_0x4140('0x15')]=![];_0x4e7b4b[_0x4140('0x16')]=![];if(_0x41b731[_0x4140('0x17')]===_0x4140('0x18')||_0x41b731[_0x4140('0x17')]==='lead'){_0x4e7b4b['WhoId']=_0x41b731['id'];}else if(_0x41b731['endUserType']===_0x4140('0x19')){_0x4e7b4b[_0x4140('0x1a')]=_0x41b731['id'];}}else if(_0x5d1e39[_0x4140('0x11')]===_0x4140('0x1b')){if(_0x41b731[_0x4140('0x17')]===_0x4140('0x18')){_0x4e7b4b[_0x4140('0x1c')]=_0x41b731['id'];}else if(_0x41b731[_0x4140('0x17')]===_0x4140('0x19')){_0x4e7b4b[_0x4140('0x1d')]=_0x41b731['id'];}else if(_0x41b731['endUserType']===_0x4140('0x1e')&&_0x5d1e39[_0x4140('0x1f')]){_0x4e7b4b[_0x5d1e39['leadId']]=_0x41b731['id'];}else{logger[_0x4140('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x49d7c5[_0x4140('0x21')](_0x5d1e39[_0x4140('0x11')])[_0x4140('0x22')](_0x4e7b4b);}function getUser(_0x5e61f6,_0x95c676,_0x3fd9a5){if(!_[_0x4140('0x23')](_0x95c676)&&intUtil['validateEmail'](_0x95c676)){var _0x40e21d={'Email':_0x95c676};var _0x40f131={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3fd9a5[_0x4140('0x21')](_0x4140('0x24'))[_0x4140('0x25')](_0x40e21d,_0x40f131)[_0x4140('0x26')]()['then'](function(_0x3f94a1){if(_0x3f94a1['length']){var _0x3f65fc=_[_0x4140('0x25')](_0x3f94a1,function(_0x3ec18f){return _0x3ec18f['Email']===_0x95c676;});if(_0x3f65fc){logger[_0x4140('0x20')]('Agent\x20%s\x20found.',_0x95c676);return BPromise[_0x4140('0x27')]({'id':_0x3f65fc['Id'],'name':_0x3f65fc['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x95c676);return _0x3fd9a5[_0x4140('0x28')]()[_0x4140('0x29')](function(_0x51d34f){return BPromise[_0x4140('0x27')]({'id':_0x51d34f[_0x4140('0x2a')],'name':_0x51d34f['display_name']});});}});}else{logger[_0x4140('0x20')](_0x4140('0x2b'),_0x95c676);return _0x3fd9a5['identity']()[_0x4140('0x29')](function(_0x22e93b){return BPromise[_0x4140('0x27')]({'id':_0x22e93b[_0x4140('0x2a')],'name':_0x22e93b[_0x4140('0x2c')]});});}}function getEndUser(_0x29a761,_0x3451c8,_0x4152c5,_0x5cf687,_0x3a7d2b){var _0x398527={'$or':{'Phone':_0x5cf687}};var _0x122e15={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4140('0x27')]()['then'](function(){logger[_0x4140('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5cf687,_0x3451c8[_0x4140('0x2d')]);switch(_0x3451c8['moduleSearch']){case _0x4140('0x2e'):var _0x221c33=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x30')]]=_0x5cf687;_[_0x4140('0x31')](_0x221c33['$or'],_0x3d07df);}return _0x3a7d2b['sobject'](_0x4140('0x32'))[_0x4140('0x25')](_0x221c33,_0x122e15)[_0x4140('0x26')]()[_0x4140('0x29')](function(_0xe7bdd0){if(_0xe7bdd0&&_0xe7bdd0[_0x4140('0x33')]){return _0xe7bdd0;}else{var _0x2a4490=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x334963={};_0x334963[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x2a4490['$or'],_0x334963);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x35'))[_0x4140('0x25')](_0x2a4490,_0x122e15);}});case _0x4140('0x36'):var _0x124ec5=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x37')]){var _0x3d07df={};_0x3d07df[_0x3451c8['additionalSearchAccount']]=_0x5cf687;_[_0x4140('0x31')](_0x124ec5[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')]('Account')[_0x4140('0x25')](_0x124ec5,_0x122e15)[_0x4140('0x26')]()[_0x4140('0x29')](function(_0x1e2489){if(_0x1e2489&&_0x1e2489[_0x4140('0x33')]){return _0x1e2489;}else{var _0x56d142=_['cloneDeep'](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x386a87={};_0x386a87[_0x3451c8['additionalSearchContact']]=_0x5cf687;_[_0x4140('0x31')](_0x56d142[_0x4140('0x38')],_0x386a87);}return _0x3a7d2b['sobject'](_0x4140('0x32'))[_0x4140('0x25')](_0x56d142,_0x122e15)[_0x4140('0x29')](function(_0x2a4072){if(_0x2a4072&&_0x2a4072[_0x4140('0x33')]){return _0x2a4072;}else{var _0x2fbc6e=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x87d21={};_0x87d21[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x2fbc6e['$or'],_0x87d21);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x35'))[_0x4140('0x25')](_0x2fbc6e,_0x122e15);}});}});case'contact':var _0x221c33=_['cloneDeep'](_0x398527);if(_0x3451c8[_0x4140('0x30')]){var _0x3d07df={};_0x3d07df[_0x3451c8['additionalSearchContact']]=_0x5cf687;_[_0x4140('0x31')](_0x221c33['$or'],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x32'))[_0x4140('0x25')](_0x221c33,_0x122e15)[_0x4140('0x26')]();case'lead':var _0x3d2e67=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x34')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x34')]]=_0x5cf687;_[_0x4140('0x31')](_0x3d2e67[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b['sobject'](_0x4140('0x35'))[_0x4140('0x25')](_0x3d2e67,_0x122e15);case _0x4140('0x19'):var _0x124ec5=_[_0x4140('0x2f')](_0x398527);if(_0x3451c8[_0x4140('0x37')]){var _0x3d07df={};_0x3d07df[_0x3451c8[_0x4140('0x37')]]=_0x5cf687;_[_0x4140('0x31')](_0x124ec5[_0x4140('0x38')],_0x3d07df);}return _0x3a7d2b[_0x4140('0x21')](_0x4140('0x39'))[_0x4140('0x25')](_0x124ec5,_0x122e15);default:return null;}})[_0x4140('0x29')](function(_0x2c7632){if(_0x2c7632&&_0x2c7632[_0x4140('0x33')]){var _0x42a92c=_[_0x4140('0x3a')](_0x2c7632);if(_0x42a92c){return BPromise['resolve']({'id':_0x42a92c['Id'],'name':_0x42a92c[_0x4140('0x3b')],'phone':_0x42a92c[_0x4140('0x3c')],'endUserType':_0x42a92c[_0x4140('0x3d')][_0x4140('0x3e')][_0x4140('0x3f')]()});}}})[_0x4140('0x29')](function(_0x385bcd){if(_0x385bcd){logger[_0x4140('0x20')](_0x4140('0x40'),_0x385bcd[_0x4140('0x17')],_0x5cf687);return BPromise[_0x4140('0x27')](_0x385bcd);}else{logger[_0x4140('0x20')](_0x4140('0x41'),_0x5cf687);var _0xd5bcfc={'Phone':_0x5cf687};if(_0x3451c8['moduleCreate']){if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x18')){logger[_0x4140('0x20')](_0x4140('0x43'),_0x5cf687,_0x3451c8['moduleCreate']);_0xd5bcfc[_0x4140('0x44')]=_0x4152c5!==_0x4140('0x45')?_0x4152c5:util[_0x4140('0x46')](_0x4140('0x47'),_0x5cf687);}else if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x1e')){logger['info'](_0x4140('0x43'),_0x5cf687,_0x3451c8[_0x4140('0x42')]);_0xd5bcfc[_0x4140('0x44')]=_0x4152c5!==_0x4140('0x45')?_0x4152c5:util[_0x4140('0x46')](_0x4140('0x47'),_0x5cf687);_0xd5bcfc[_0x4140('0x48')]=_0x4140('0x49');}else if(_0x3451c8[_0x4140('0x42')]===_0x4140('0x19')){logger[_0x4140('0x20')](_0x4140('0x43'),_0x5cf687,_0x3451c8['moduleCreate']);_0xd5bcfc[_0x4140('0x3b')]=_0x4152c5!==''?_0x4152c5:util['format']('Caller\x20-\x20%s',_0x5cf687);}else{return null;}}return _0x3a7d2b['sobject'](_[_0x4140('0x4a')](_0x3451c8[_0x4140('0x42')]))[_0x4140('0x22')](_0xd5bcfc)[_0x4140('0x29')](function(_0x119877){return BPromise[_0x4140('0x27')]({'id':_0x119877['id'],'endUserType':_0x3451c8['moduleCreate']});});}});}function getCustomFields(_0x176584,_0x47fc32){var _0x42dee7={};if(_0x176584[_0x4140('0x33')]>0x0){_['forEach'](_0x176584,function(_0x3ea2f3){if(_['includes'](['string',_0x4140('0x4b')],_0x3ea2f3[_0x4140('0x3e')])&&_0x3ea2f3[_0x4140('0x4c')]){_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x3ea2f3['content'][_0x4140('0x4d')]();}else if(_0x3ea2f3[_0x4140('0x3e')]===_0x4140('0x4e')&&_0x3ea2f3[_0x4140('0x4f')]&&_0x3ea2f3[_0x4140('0x4c')]){_0x47fc32[_0x3ea2f3[_0x4140('0x4f')]]&&(_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x47fc32[_0x3ea2f3['variableName']][_0x4140('0x4d')]());}else if(_0x3ea2f3[_0x4140('0x3e')]==='customVariable'&&_0x3ea2f3[_0x4140('0x50')]&&_0x3ea2f3['Variable'][_0x4140('0x51')]&&_0x3ea2f3[_0x4140('0x4c')]){_0x47fc32[_0x3ea2f3[_0x4140('0x50')]['name'][_0x4140('0x3f')]()]&&(_0x42dee7[_0x3ea2f3[_0x4140('0x4c')]]=_0x47fc32[_0x3ea2f3[_0x4140('0x50')]['name']['toLowerCase']()][_0x4140('0x4d')]());}});}return _0x42dee7;}function getConnection(_0x1b673c){var _0x1a4cdb=_0x1b673c[_0x4140('0x52')][_0x4140('0x53')](_0x1b673c[_0x4140('0x54')]);var _0x25be5d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1b673c['remoteUri']||_0x4140('0x55'),'clientId':_0x1b673c[_0x4140('0x56')],'clientSecret':_0x1b673c['clientSecret']}});return _0x25be5d[_0x4140('0x57')](_0x1b673c[_0x4140('0x58')],_0x1a4cdb)[_0x4140('0x29')](function(){logger[_0x4140('0x20')](_0x4140('0x59'));return _0x25be5d;});}exports[_0x4140('0x5a')]=function(_0x5c04bb,_0x29a55d,_0x23e50b,_0x190d87,_0x377663,_0x10d980){var _0x1a8602,_0x13122e,_0x249dd9,_0x346fab;_0x10d980[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x10d980['serverUrl']);_0x10d980[_0x4140('0x5d')]=intUtil[_0x4140('0x5c')](_0x10d980[_0x4140('0x5d')]);if(_0x377663&&_0x377663[_0x4140('0x5e')]){logger[_0x4140('0x20')](_0x4140('0x5f'),_0x4140('0x60'));_0x29a55d[_0x4140('0x61')]=util[_0x4140('0x46')](_0x4140('0x62'),_0x10d980[_0x4140('0x5b')],_0x29a55d[_0x4140('0x63')],md5(_0x29a55d[_0x4140('0x63')]));}else{_0x29a55d['recordingURL']='';}return getConnection(_0x10d980)['then'](function(_0x4139f6){_0x346fab=_0x4139f6;return getUser(_0x10d980,_0x190d87[_0x4140('0x64')],_0x346fab);})[_0x4140('0x29')](function(_0x310c8d){_0x1a8602=_0x310c8d;return getEndUser(_0x10d980,_0x23e50b,_0x29a55d[_0x4140('0x65')],_0x29a55d[_0x4140('0x66')],_0x346fab);})[_0x4140('0x29')](function(_0x2f677e){_0x13122e=_0x2f677e;return getTicket(_0x10d980,_0x1a8602,_0x13122e,_0x23e50b,_0x29a55d,_0x23e50b['Fields'],_0x346fab,'queue');})['then'](function(_0x147e4f){_0x249dd9=_0x147e4f;logger[_0x4140('0x20')](_0x4140('0x67'),_0x249dd9['id']);logger[_0x4140('0x20')](_0x4140('0x68'),_0x249dd9['id'],_0x190d87[_0x4140('0x51')],_0x10d980[_0x4140('0x3e')]);switch(_0x10d980[_0x4140('0x3e')]){case'integrationTab':emit(util['format']('user:%s',_0x190d87[_0x4140('0x51')]),_0x4140('0x69'),{'recordId':_0x249dd9['id']});break;case _0x4140('0x6a'):emit(util['format'](_0x4140('0x6b'),_0x190d87[_0x4140('0x51')]),_0x4140('0x6c'),{'uri':util[_0x4140('0x46')](_0x4140('0x6d'),_0x346fab[_0x4140('0x6e')],_0x249dd9['id'])});break;default:logger[_0x4140('0x6f')](_0x4140('0x70'));}})[_0x4140('0x71')](function(_0x14db78){logger['error'](_0x4140('0x5f'),_0x14db78);});};exports[_0x4140('0x72')]=function(_0x5386a8,_0x4af50b,_0xb4d11b,_0x536b9d,_0xb3349b,_0x4a60a0,_0x41f57c){var _0x3faa21,_0x548285,_0x3b7579,_0x5266fd;_0x4a60a0[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x4a60a0[_0x4140('0x5b')]);_0x4a60a0[_0x4140('0x5d')]=intUtil[_0x4140('0x5c')](_0x4a60a0[_0x4140('0x5d')]);if(_0x41f57c&&_0x41f57c[_0x4140('0x73')]&&_0x41f57c['recordingFormat']!=='none'){logger[_0x4140('0x20')](_0x4140('0x74'),_0x4140('0x60'));_0x4af50b['recordingURL']=util['format'](_0x4140('0x62'),_0x4a60a0[_0x4140('0x5b')],_0x4af50b[_0x4140('0x63')],md5(_0x4af50b['uniqueid']));}return getConnection(_0x4a60a0)['then'](function(_0x4c6a49){_0x5266fd=_0x4c6a49;return getUser(_0x4a60a0,_0x536b9d[_0x4140('0x64')],_0x5266fd);})['then'](function(_0x6472f4){_0x3faa21=_0x6472f4;return getEndUser(_0x4a60a0,_0xb4d11b,_0x4af50b['destcalleridname'],_0x4af50b['destcalleridnum'],_0x5266fd);})['then'](function(_0x875a2){_0x548285=_0x875a2;return getTicket(_0x4a60a0,_0x3faa21,_0x548285,_0xb4d11b,_0x4af50b,_0xb4d11b[_0x4140('0x75')],_0x5266fd,'outbound');})[_0x4140('0x29')](function(_0x50acc1){_0x3b7579=_0x50acc1;logger['info'](_0x4140('0x76'),_0x3b7579['id']);logger['info'](_0x4140('0x77'),_0x3b7579['id'],_0x536b9d[_0x4140('0x51')],_0x4a60a0[_0x4140('0x3e')]);switch(_0x4a60a0['type']){case _0x4140('0x78'):emit(util[_0x4140('0x46')]('user:%s',_0x536b9d[_0x4140('0x51')]),'trigger:salesforce:display',{'recordId':_0x3b7579['id']});break;case'newTab':emit(util[_0x4140('0x46')](_0x4140('0x6b'),_0x536b9d[_0x4140('0x51')]),_0x4140('0x6c'),{'uri':util[_0x4140('0x46')](_0x4140('0x6d'),_0x5266fd[_0x4140('0x6e')],_0x3b7579['id'])});break;default:logger[_0x4140('0x6f')](_0x4140('0x74'),_0x4140('0x79'));}})['catch'](function(_0x588e22){logger['error'](_0x4140('0x74'),_0x588e22);});};exports['unmanaged']=function(_0x31b771,_0x32c9e7,_0x191e18,_0x39298a,_0x517c60,_0x50cc06){var _0x419953,_0x21bbc0,_0x352d77,_0x4d9850;_0x50cc06[_0x4140('0x5b')]=intUtil[_0x4140('0x5c')](_0x50cc06[_0x4140('0x5b')]);_0x50cc06[_0x4140('0x5d')]=intUtil['stripTrailingSlash'](_0x50cc06['remoteUri']);if(_0x517c60&&_0x517c60[_0x4140('0x5e')]){logger[_0x4140('0x20')]('['+_0x32c9e7['lastevent'][_0x4140('0x7a')]()+']',_0x4140('0x60'));_0x32c9e7[_0x4140('0x61')]=util['format'](_0x4140('0x62'),_0x50cc06[_0x4140('0x5b')],_0x32c9e7[_0x4140('0x63')],md5(_0x32c9e7[_0x4140('0x63')]));}else{_0x32c9e7['recordingURL']='';}return getConnection(_0x50cc06)[_0x4140('0x29')](function(_0xea735e){_0x4d9850=_0xea735e;if(!_['isNil'](_0x39298a)){return getUser(_0x50cc06,_0x39298a['name'],_0x4d9850);}else{return getUser(_0x50cc06,null,_0x4d9850);}})[_0x4140('0x29')](function(_0x4b46df){_0x419953=_0x4b46df;return getEndUser(_0x50cc06,_0x191e18,_0x32c9e7['calleridname'],_0x32c9e7['calleridnum'],_0x4d9850);})[_0x4140('0x29')](function(_0x19d776){_0x21bbc0=_0x19d776;return getTicket(_0x50cc06,_0x419953,_0x21bbc0,_0x191e18,_0x32c9e7,_0x191e18[_0x4140('0x75')],_0x4d9850);})[_0x4140('0x29')](function(_0x451beb){_0x352d77=_0x451beb;logger[_0x4140('0x20')]('['+_0x32c9e7[_0x4140('0x7b')][_0x4140('0x7a')]()+_0x4140('0x7c'),_0x352d77['id']);logger[_0x4140('0x20')]('['+_0x32c9e7[_0x4140('0x7b')][_0x4140('0x7a')]()+_0x4140('0x7d'),_0x50cc06[_0x4140('0x3e')]);})[_0x4140('0x71')](function(_0x26b6da){logger[_0x4140('0x6f')]('['+_0x32c9e7[_0x4140('0x7b')]['toUpperCase']()+']',_0x26b6da);});}; \ No newline at end of file +var _0x7a73=['[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','emit','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','length','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','upperFirst','forEach','includes','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x7a73,0xfe));var _0x37a7=function(_0x4965af,_0x52cd6a){_0x4965af=_0x4965af-0x0;var _0x245977=_0x7a73[_0x4965af];return _0x245977;};'use strict';var _=require(_0x37a7('0x0'));var rp=require(_0x37a7('0x1'));var moment=require(_0x37a7('0x2'));var BPromise=require('bluebird');var md5=require(_0x37a7('0x3'));var jsforce=require(_0x37a7('0x4'));var util=require('util');var Redis=require(_0x37a7('0x5'));var intUtil=require(_0x37a7('0x6'));var config=require('../../../../config/environment');var logger=require(_0x37a7('0x7'))(_0x37a7('0x8'));config[_0x37a7('0x9')]=_['defaults'](config[_0x37a7('0x9')],{'host':_0x37a7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5190b8,_0x16f182,_0x2dbba4){io['to'](_0x5190b8)[_0x37a7('0xb')](_0x16f182,_0x2dbba4);}function getTicket(_0x1fdaa2,_0x17d477,_0xac28fe,_0x190a1f,_0x2ca9a3,_0x5d4e26,_0x2db5ed,_0x3b542d){var _0x2f605e=Object['assign']({},{'OwnerId':_0x17d477['id'],'Subject':intUtil[_0x37a7('0xc')](_0x190a1f[_0x37a7('0xd')],_0x2ca9a3,'\x20'),'Description':intUtil[_0x37a7('0xc')](_0x190a1f[_0x37a7('0xe')],_0x2ca9a3,'\x0a')},getCustomFields(_0x5d4e26,_0x2ca9a3));if(_0xac28fe){if(_0x190a1f[_0x37a7('0xf')]==='Task'){_0x2f605e[_0x37a7('0x10')]=moment[_0x37a7('0x11')]();_0x2f605e[_0x37a7('0x12')]=![];_0x2f605e[_0x37a7('0x13')]=![];if(_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x15')||_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x16')){_0x2f605e['WhoId']=_0xac28fe['id'];}else if(_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x17')){_0x2f605e[_0x37a7('0x18')]=_0xac28fe['id'];}}else if(_0x190a1f['ticketType']===_0x37a7('0x19')){if(_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x15')){_0x2f605e[_0x37a7('0x1a')]=_0xac28fe['id'];}else if(_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x17')){_0x2f605e['AccountId']=_0xac28fe['id'];}else if(_0xac28fe[_0x37a7('0x14')]===_0x37a7('0x16')&&_0x190a1f[_0x37a7('0x1b')]){_0x2f605e[_0x190a1f[_0x37a7('0x1b')]]=_0xac28fe['id'];}else{logger[_0x37a7('0x1c')](_0x37a7('0x1d'));}}}return _0x2db5ed[_0x37a7('0x1e')](_0x190a1f['ticketType'])[_0x37a7('0x1f')](_0x2f605e);}function getUser(_0x391808,_0x2054a7,_0x56a27e){if(!_[_0x37a7('0x20')](_0x2054a7)&&intUtil[_0x37a7('0x21')](_0x2054a7)){var _0x22c2c7={'Email':_0x2054a7};var _0xa32801={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x56a27e[_0x37a7('0x1e')]('User')[_0x37a7('0x22')](_0x22c2c7,_0xa32801)[_0x37a7('0x23')]()[_0x37a7('0x24')](function(_0x4ab75a){if(_0x4ab75a['length']){var _0x499f0d=_[_0x37a7('0x22')](_0x4ab75a,function(_0x4bd5e6){return _0x4bd5e6['Email']===_0x2054a7;});if(_0x499f0d){logger[_0x37a7('0x1c')](_0x37a7('0x25'),_0x2054a7);return BPromise[_0x37a7('0x26')]({'id':_0x499f0d['Id'],'name':_0x499f0d[_0x37a7('0x27')]});}}else{logger['info'](_0x37a7('0x28'),_0x2054a7);return _0x56a27e[_0x37a7('0x29')]()[_0x37a7('0x24')](function(_0x4cc0da){return BPromise[_0x37a7('0x26')]({'id':_0x4cc0da['user_id'],'name':_0x4cc0da[_0x37a7('0x2a')]});});}});}else{logger[_0x37a7('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2054a7);return _0x56a27e[_0x37a7('0x29')]()[_0x37a7('0x24')](function(_0x3c8df6){return BPromise[_0x37a7('0x26')]({'id':_0x3c8df6[_0x37a7('0x2b')],'name':_0x3c8df6[_0x37a7('0x2a')]});});}}function getEndUser(_0x2c16c2,_0x4422d2,_0x283e59,_0x2da710,_0x47788a){var _0x56f379={'$or':{'Phone':_0x2da710}};var _0x24566d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x37a7('0x26')]()[_0x37a7('0x24')](function(){logger[_0x37a7('0x1c')](_0x37a7('0x2c'),_0x2da710,_0x4422d2[_0x37a7('0x2d')]);switch(_0x4422d2['moduleSearch']){case _0x37a7('0x2e'):var _0x1557a0=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2[_0x37a7('0x30')]){var _0x45bf0={};_0x45bf0[_0x4422d2[_0x37a7('0x30')]]=_0x2da710;_[_0x37a7('0x31')](_0x1557a0[_0x37a7('0x32')],_0x45bf0);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x33'))[_0x37a7('0x22')](_0x1557a0,_0x24566d)[_0x37a7('0x23')]()[_0x37a7('0x24')](function(_0x30a70a){if(_0x30a70a&&_0x30a70a['length']){return _0x30a70a;}else{var _0x4c2259=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2['additionalSearchLead']){var _0x4e694b={};_0x4e694b[_0x4422d2[_0x37a7('0x34')]]=_0x2da710;_[_0x37a7('0x31')](_0x4c2259[_0x37a7('0x32')],_0x4e694b);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x35'))[_0x37a7('0x22')](_0x4c2259,_0x24566d);}});case _0x37a7('0x36'):var _0x470641=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2[_0x37a7('0x37')]){var _0x45bf0={};_0x45bf0[_0x4422d2['additionalSearchAccount']]=_0x2da710;_[_0x37a7('0x31')](_0x470641[_0x37a7('0x32')],_0x45bf0);}return _0x47788a['sobject'](_0x37a7('0x38'))[_0x37a7('0x22')](_0x470641,_0x24566d)[_0x37a7('0x23')]()[_0x37a7('0x24')](function(_0x474970){if(_0x474970&&_0x474970[_0x37a7('0x39')]){return _0x474970;}else{var _0x320d30=_['cloneDeep'](_0x56f379);if(_0x4422d2[_0x37a7('0x30')]){var _0x35f363={};_0x35f363[_0x4422d2[_0x37a7('0x30')]]=_0x2da710;_[_0x37a7('0x31')](_0x320d30[_0x37a7('0x32')],_0x35f363);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x33'))[_0x37a7('0x22')](_0x320d30,_0x24566d)[_0x37a7('0x24')](function(_0x1909b6){if(_0x1909b6&&_0x1909b6[_0x37a7('0x39')]){return _0x1909b6;}else{var _0x403728=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2[_0x37a7('0x34')]){var _0x4e89a0={};_0x4e89a0[_0x4422d2[_0x37a7('0x34')]]=_0x2da710;_[_0x37a7('0x31')](_0x403728[_0x37a7('0x32')],_0x4e89a0);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x35'))[_0x37a7('0x22')](_0x403728,_0x24566d);}});}});case _0x37a7('0x15'):var _0x1557a0=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2[_0x37a7('0x30')]){var _0x45bf0={};_0x45bf0[_0x4422d2[_0x37a7('0x30')]]=_0x2da710;_['merge'](_0x1557a0['$or'],_0x45bf0);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x33'))['find'](_0x1557a0,_0x24566d)[_0x37a7('0x23')]();case _0x37a7('0x16'):var _0x3df3c2=_[_0x37a7('0x2f')](_0x56f379);if(_0x4422d2[_0x37a7('0x34')]){var _0x45bf0={};_0x45bf0[_0x4422d2[_0x37a7('0x34')]]=_0x2da710;_[_0x37a7('0x31')](_0x3df3c2['$or'],_0x45bf0);}return _0x47788a[_0x37a7('0x1e')](_0x37a7('0x35'))['find'](_0x3df3c2,_0x24566d);case _0x37a7('0x17'):var _0x470641=_['cloneDeep'](_0x56f379);if(_0x4422d2['additionalSearchAccount']){var _0x45bf0={};_0x45bf0[_0x4422d2[_0x37a7('0x37')]]=_0x2da710;_[_0x37a7('0x31')](_0x470641[_0x37a7('0x32')],_0x45bf0);}return _0x47788a['sobject'](_0x37a7('0x38'))['find'](_0x470641,_0x24566d);default:return null;}})[_0x37a7('0x24')](function(_0x243394){if(_0x243394&&_0x243394[_0x37a7('0x39')]){var _0x37c4c3=_['first'](_0x243394);if(_0x37c4c3){return BPromise[_0x37a7('0x26')]({'id':_0x37c4c3['Id'],'name':_0x37c4c3['Name'],'phone':_0x37c4c3[_0x37a7('0x3a')],'endUserType':_0x37c4c3[_0x37a7('0x3b')][_0x37a7('0x3c')][_0x37a7('0x3d')]()});}}})[_0x37a7('0x24')](function(_0x1ecd72){if(_0x1ecd72){logger[_0x37a7('0x1c')](_0x37a7('0x3e'),_0x1ecd72['endUserType'],_0x2da710);return BPromise[_0x37a7('0x26')](_0x1ecd72);}else{logger[_0x37a7('0x1c')](_0x37a7('0x3f'),_0x2da710);var _0x582c21={'Phone':_0x2da710};if(_0x4422d2[_0x37a7('0x40')]){if(_0x4422d2[_0x37a7('0x40')]===_0x37a7('0x15')){logger[_0x37a7('0x1c')](_0x37a7('0x41'),_0x2da710,_0x4422d2[_0x37a7('0x40')]);_0x582c21[_0x37a7('0x42')]=_0x283e59!==_0x37a7('0x43')?_0x283e59:util['format'](_0x37a7('0x44'),_0x2da710);}else if(_0x4422d2[_0x37a7('0x40')]==='lead'){logger[_0x37a7('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2da710,_0x4422d2[_0x37a7('0x40')]);_0x582c21[_0x37a7('0x42')]=_0x283e59!==_0x37a7('0x43')?_0x283e59:util[_0x37a7('0x45')](_0x37a7('0x44'),_0x2da710);_0x582c21[_0x37a7('0x46')]='No\x20Company';}else if(_0x4422d2[_0x37a7('0x40')]===_0x37a7('0x17')){logger[_0x37a7('0x1c')](_0x37a7('0x41'),_0x2da710,_0x4422d2[_0x37a7('0x40')]);_0x582c21[_0x37a7('0x27')]=_0x283e59!==_0x37a7('0x43')?_0x283e59:util[_0x37a7('0x45')]('Caller\x20-\x20%s',_0x2da710);}else{return null;}}return _0x47788a[_0x37a7('0x1e')](_[_0x37a7('0x47')](_0x4422d2[_0x37a7('0x40')]))[_0x37a7('0x1f')](_0x582c21)[_0x37a7('0x24')](function(_0x4b0d95){return BPromise['resolve']({'id':_0x4b0d95['id'],'endUserType':_0x4422d2[_0x37a7('0x40')]});});}});}function getCustomFields(_0x17de59,_0x5113f7){var _0x56e91f={};if(_0x17de59['length']>0x0){_[_0x37a7('0x48')](_0x17de59,function(_0x4e9b05){if(_[_0x37a7('0x49')](['string','picklist'],_0x4e9b05[_0x37a7('0x3c')])&&_0x4e9b05[_0x37a7('0x4a')]){_0x56e91f[_0x4e9b05[_0x37a7('0x4a')]]=_0x4e9b05[_0x37a7('0x4b')][_0x37a7('0x4c')]();}else if(_0x4e9b05['type']===_0x37a7('0x4d')&&_0x4e9b05[_0x37a7('0x4e')]&&_0x4e9b05[_0x37a7('0x4a')]){_0x5113f7[_0x4e9b05[_0x37a7('0x4e')]]&&(_0x56e91f[_0x4e9b05['idField']]=_0x5113f7[_0x4e9b05[_0x37a7('0x4e')]][_0x37a7('0x4c')]());}else if(_0x4e9b05[_0x37a7('0x3c')]===_0x37a7('0x4f')&&_0x4e9b05[_0x37a7('0x50')]&&_0x4e9b05[_0x37a7('0x50')][_0x37a7('0x51')]&&_0x4e9b05[_0x37a7('0x4a')]){_0x5113f7[_0x4e9b05[_0x37a7('0x50')][_0x37a7('0x51')][_0x37a7('0x3d')]()]&&(_0x56e91f[_0x4e9b05[_0x37a7('0x4a')]]=_0x5113f7[_0x4e9b05[_0x37a7('0x50')]['name'][_0x37a7('0x3d')]()][_0x37a7('0x4c')]());}});}return _0x56e91f;}function getConnection(_0x246af3){var _0xa7a05a=_0x246af3['password'][_0x37a7('0x52')](_0x246af3[_0x37a7('0x53')]);var _0x39eb2f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x246af3[_0x37a7('0x54')]||_0x37a7('0x55'),'clientId':_0x246af3[_0x37a7('0x56')],'clientSecret':_0x246af3['clientSecret']}});return _0x39eb2f[_0x37a7('0x57')](_0x246af3[_0x37a7('0x58')],_0xa7a05a)[_0x37a7('0x24')](function(){logger[_0x37a7('0x1c')](_0x37a7('0x59'));return _0x39eb2f;});}exports[_0x37a7('0x5a')]=function(_0x2f25de,_0x16c7e6,_0x1fe971,_0x1b7018,_0x535b35,_0x581fe8){var _0x35e12a,_0x2ba685,_0x8e2314,_0x5811be;_0x581fe8[_0x37a7('0x5b')]=intUtil[_0x37a7('0x5c')](_0x581fe8[_0x37a7('0x5b')]);_0x581fe8[_0x37a7('0x54')]=intUtil[_0x37a7('0x5c')](_0x581fe8[_0x37a7('0x54')]);if(_0x535b35&&_0x535b35['monitor_format']){logger[_0x37a7('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x16c7e6[_0x37a7('0x5d')]=util['format'](_0x37a7('0x5e'),_0x581fe8[_0x37a7('0x5b')],_0x16c7e6['uniqueid'],md5(_0x16c7e6[_0x37a7('0x5f')]));}else{_0x16c7e6[_0x37a7('0x5d')]='';}return getConnection(_0x581fe8)[_0x37a7('0x24')](function(_0x278bc7){_0x5811be=_0x278bc7;return getUser(_0x581fe8,_0x1b7018[_0x37a7('0x60')],_0x5811be);})['then'](function(_0x4a8170){_0x35e12a=_0x4a8170;return getEndUser(_0x581fe8,_0x1fe971,_0x16c7e6[_0x37a7('0x61')],_0x16c7e6[_0x37a7('0x62')],_0x5811be);})['then'](function(_0x425aa8){_0x2ba685=_0x425aa8;return getTicket(_0x581fe8,_0x35e12a,_0x2ba685,_0x1fe971,_0x16c7e6,_0x1fe971[_0x37a7('0x63')],_0x5811be,_0x37a7('0x5a'));})[_0x37a7('0x24')](function(_0x286d28){_0x8e2314=_0x286d28;logger[_0x37a7('0x1c')](_0x37a7('0x64'),_0x8e2314['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x8e2314['id'],_0x1b7018[_0x37a7('0x51')],_0x581fe8[_0x37a7('0x3c')]);switch(_0x581fe8[_0x37a7('0x3c')]){case _0x37a7('0x65'):emit(util['format'](_0x37a7('0x66'),_0x1b7018[_0x37a7('0x51')]),_0x37a7('0x67'),{'recordId':_0x8e2314['id']});break;case _0x37a7('0x68'):emit(util[_0x37a7('0x45')](_0x37a7('0x66'),_0x1b7018['name']),_0x37a7('0x69'),{'uri':util[_0x37a7('0x45')](_0x37a7('0x6a'),_0x5811be['instanceUrl'],_0x8e2314['id'])});break;default:logger[_0x37a7('0x6b')](_0x37a7('0x6c'));}})['catch'](function(_0x57a2de){logger[_0x37a7('0x6b')]('[QUEUE]',_0x57a2de);});};exports[_0x37a7('0x6d')]=function(_0x36bbb0,_0x5b054d,_0x10ac96,_0x27733c,_0x1d1d99,_0x15ff70,_0x4a5eea){var _0xaecb51,_0x5f40a0,_0x1d80df,_0x870106;_0x15ff70[_0x37a7('0x5b')]=intUtil[_0x37a7('0x5c')](_0x15ff70['serverUrl']);_0x15ff70[_0x37a7('0x54')]=intUtil[_0x37a7('0x5c')](_0x15ff70[_0x37a7('0x54')]);if(_0x4a5eea&&_0x4a5eea['recordingFormat']&&_0x4a5eea[_0x37a7('0x6e')]!==_0x37a7('0x6f')){logger[_0x37a7('0x1c')]('[OUTBOUND]',_0x37a7('0x70'));_0x5b054d['recordingURL']=util[_0x37a7('0x45')](_0x37a7('0x5e'),_0x15ff70[_0x37a7('0x5b')],_0x5b054d[_0x37a7('0x5f')],md5(_0x5b054d[_0x37a7('0x5f')]));}return getConnection(_0x15ff70)[_0x37a7('0x24')](function(_0x15e5f1){_0x870106=_0x15e5f1;return getUser(_0x15ff70,_0x27733c['email'],_0x870106);})[_0x37a7('0x24')](function(_0x94734d){_0xaecb51=_0x94734d;return getEndUser(_0x15ff70,_0x10ac96,_0x5b054d[_0x37a7('0x71')],_0x5b054d[_0x37a7('0x72')],_0x870106);})[_0x37a7('0x24')](function(_0x54dfa1){_0x5f40a0=_0x54dfa1;return getTicket(_0x15ff70,_0xaecb51,_0x5f40a0,_0x10ac96,_0x5b054d,_0x10ac96['Fields'],_0x870106,_0x37a7('0x6d'));})[_0x37a7('0x24')](function(_0x1bb101){_0x1d80df=_0x1bb101;logger[_0x37a7('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1d80df['id']);logger[_0x37a7('0x1c')](_0x37a7('0x73'),_0x1d80df['id'],_0x27733c[_0x37a7('0x51')],_0x15ff70['type']);switch(_0x15ff70[_0x37a7('0x3c')]){case _0x37a7('0x65'):emit(util[_0x37a7('0x45')](_0x37a7('0x66'),_0x27733c['name']),'trigger:salesforce:display',{'recordId':_0x1d80df['id']});break;case _0x37a7('0x68'):emit(util[_0x37a7('0x45')]('user:%s',_0x27733c['name']),_0x37a7('0x69'),{'uri':util['format'](_0x37a7('0x6a'),_0x870106[_0x37a7('0x74')],_0x1d80df['id'])});break;default:logger[_0x37a7('0x6b')]('[OUTBOUND]',_0x37a7('0x75'));}})['catch'](function(_0x160993){logger['error']('[OUTBOUND]',_0x160993);});};exports[_0x37a7('0x76')]=function(_0x59500a,_0x5ea139,_0x52bc02,_0x269fbe,_0x187549,_0x421e8b){var _0x3b5b41,_0x387b77,_0x563e28,_0x45431a;_0x421e8b['serverUrl']=intUtil[_0x37a7('0x5c')](_0x421e8b[_0x37a7('0x5b')]);_0x421e8b[_0x37a7('0x54')]=intUtil[_0x37a7('0x5c')](_0x421e8b[_0x37a7('0x54')]);if(_0x187549&&_0x187549[_0x37a7('0x77')]){logger[_0x37a7('0x1c')]('['+_0x5ea139[_0x37a7('0x78')][_0x37a7('0x79')]()+']',_0x37a7('0x70'));_0x5ea139[_0x37a7('0x5d')]=util[_0x37a7('0x45')](_0x37a7('0x5e'),_0x421e8b[_0x37a7('0x5b')],_0x5ea139[_0x37a7('0x5f')],md5(_0x5ea139[_0x37a7('0x5f')]));}else{_0x5ea139[_0x37a7('0x5d')]='';}return getConnection(_0x421e8b)['then'](function(_0x47a098){_0x45431a=_0x47a098;if(!_[_0x37a7('0x20')](_0x269fbe)){return getUser(_0x421e8b,_0x269fbe[_0x37a7('0x51')],_0x45431a);}else{return getUser(_0x421e8b,null,_0x45431a);}})[_0x37a7('0x24')](function(_0x29446a){_0x3b5b41=_0x29446a;return getEndUser(_0x421e8b,_0x52bc02,_0x5ea139[_0x37a7('0x61')],_0x5ea139[_0x37a7('0x62')],_0x45431a);})[_0x37a7('0x24')](function(_0x139cb0){_0x387b77=_0x139cb0;return getTicket(_0x421e8b,_0x3b5b41,_0x387b77,_0x52bc02,_0x5ea139,_0x52bc02['Fields'],_0x45431a);})[_0x37a7('0x24')](function(_0x53e2a9){_0x563e28=_0x53e2a9;logger[_0x37a7('0x1c')]('['+_0x5ea139['lastevent'][_0x37a7('0x79')]()+_0x37a7('0x7a'),_0x563e28['id']);logger[_0x37a7('0x1c')]('['+_0x5ea139[_0x37a7('0x78')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x421e8b[_0x37a7('0x3c')]);})['catch'](function(_0x2d07a3){logger['error']('['+_0x5ea139[_0x37a7('0x78')][_0x37a7('0x79')]()+']',_0x2d07a3);});}; \ 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 75d6eec..56b6a4c 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 _0xa5be=['System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','variable','customField','variableName','toString','Variable',']\x20getTicket\x20input\x20crm','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','message',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber'];(function(_0x11162d,_0x3c7e4f){var _0x5f4aeb=function(_0x25dc99){while(--_0x25dc99){_0x11162d['push'](_0x11162d['shift']());}};_0x5f4aeb(++_0x3c7e4f);}(_0xa5be,0x121));var _0xea5b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa5be[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xea5b('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0xea5b('0x1'));var Redis=require(_0xea5b('0x2'));var intUtil=require(_0xea5b('0x3'));var config=require(_0xea5b('0x4'));var logger=require(_0xea5b('0x5'))('servicenow');config[_0xea5b('0x6')]=_[_0xea5b('0x7')](config[_0xea5b('0x6')],{'host':_0xea5b('0x8'),'port':0x18eb});var io=require(_0xea5b('0x9'))(new Redis(config[_0xea5b('0x6')]));function getAdminUser(_0x519818,_0x406239,_0x49d479,_0x4c98be,_0x2a8074,_0x5be141){return new Promise(function(_0x25ee58,_0x592a83){var _0x5d72bb={'method':'GET','uri':_0x4c98be+_0xea5b('0xa')+'&'+_0x2a8074+'&'+_0x5be141,'auth':_0x406239,'json':!![]};return rp(_0x5d72bb)[_0xea5b('0xb')](function(_0x1b344c){if(_0x1b344c['result'][_0xea5b('0xc')]>0x0){_0x49d479[_0xea5b('0xd')]=_0x1b344c[_0xea5b('0xe')][0x0][_0xea5b('0xf')];}logger[_0xea5b('0x10')]('['+[_0x519818[_0xea5b('0x11')]()]+_0xea5b('0x12'),_0x49d479);_0x25ee58(_0x49d479);})[_0xea5b('0x13')](function(_0x4c8773){logger[_0xea5b('0x14')]('['+[_0x519818['toUpperCase']()]+']',_0x4c8773['message']);_0x592a83(_0x4c8773['message']);});});}function getUser(_0x5435f8,_0x5ca052,_0x2eeb8d,_0x3e34ea,_0x3f96b7){return function(_0x596073){logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x15'),_0x596073);return new Promise(function(_0x3965d0,_0x4d2ea9){if(intUtil[_0xea5b('0x16')](_0x596073[_0xea5b('0x17')])){var _0x3ce1ae={'method':_0xea5b('0x18'),'uri':_0x2eeb8d+_0xea5b('0x19')+_0x596073[_0xea5b('0x17')]+'&'+_0x3e34ea+'&'+_0x3f96b7,'auth':_0x5ca052,'json':!![]};logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x3ce1ae);return rp(_0x3ce1ae)[_0xea5b('0xb')](function(_0x3c8373){logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x1a'),_0x3c8373);if(_0x3c8373['result'][_0xea5b('0xc')]>0x0&&String(_0x3c8373['result'][0x0][_0xea5b('0x1b')])===_0xea5b('0x1c')){_0x596073[_0xea5b('0x1d')]=_0x3c8373[_0xea5b('0xe')][0x0][_0xea5b('0xf')];}else{_0x596073[_0xea5b('0x1d')]=_0x596073[_0xea5b('0xd')];_0x596073[_0xea5b('0x17')]=_0x596073['adminEmail'];}logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x1e'),_0x596073);_0x3965d0(_0x596073);})['catch'](function(_0xb04389){logger[_0xea5b('0x14')]('['+[_0x5435f8['toUpperCase']()]+']',_0xb04389[_0xea5b('0x1f')]);_0x4d2ea9(_0xb04389[_0xea5b('0x1f')]);});}else{logger[_0xea5b('0x10')]('['+[_0x5435f8[_0xea5b('0x11')]()]+_0xea5b('0x20'));_0x596073['userId']=_0x596073['adminId'];_0x596073[_0xea5b('0x17')]=_0x596073[_0xea5b('0x21')];_0x3965d0(_0x596073);}});};}function createEndUser(_0x1518ec,_0x5cd4b2,_0x54fc3e,_0x453948,_0x274f88){logger[_0xea5b('0x10')]('['+[_0x1518ec[_0xea5b('0x11')]()]+_0xea5b('0x22'),_0x54fc3e);return new Promise(function(_0x52b2fa,_0xbf1b0c){var _0x59d348={'method':_0xea5b('0x23'),'uri':_0x453948+_0xea5b('0x24')+_0x274f88,'body':{'user_name':_0x54fc3e[_0xea5b('0x25')],'roles':'user','first_name':_0x54fc3e[_0xea5b('0x25')],'active':'true','date_format':_0xea5b('0x26'),'phone':_0x54fc3e['endUserNumber']},'auth':_0x5cd4b2,'json':!![]};return rp(_0x59d348)['then'](function(_0x56eace){logger[_0xea5b('0x10')]('['+[_0x1518ec[_0xea5b('0x11')]()]+_0xea5b('0x27'),_0x56eace['result']);_0x54fc3e[_0xea5b('0x28')]=_0x56eace[_0xea5b('0xe')][_0xea5b('0xf')];_0x52b2fa(_0x54fc3e);})[_0xea5b('0x13')](function(_0x21c169){logger['error']('['+[_0x1518ec[_0xea5b('0x11')]()]+']',_0x21c169[_0xea5b('0x1f')]);_0xbf1b0c(_0x21c169['message']);});});}function getEndUser(_0x1592c4,_0x441f15,_0x4d0adc,_0x48e722,_0x71880d){return function(_0x40160d){logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+_0xea5b('0x29'),_0x40160d);return new Promise(function(_0x17aa6a,_0x306a55){var _0x5e91f9={'method':_0xea5b('0x18'),'uri':_0x4d0adc+_0xea5b('0x2a')+_0x40160d[_0xea5b('0x25')]+'&'+_0x48e722+'&'+_0x71880d,'auth':_0x441f15,'json':!![]};return rp(_0x5e91f9)[_0xea5b('0xb')](function(_0x4e53b3){if(_0x4e53b3['result']['length']>0x0){_0x40160d[_0xea5b('0x28')]=_0x4e53b3['result'][0x0]['sys_id'];logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+_0xea5b('0x2b'),_0x40160d);_0x17aa6a(_0x40160d);}else{return createEndUser(_0x1592c4,_0x441f15,_0x40160d,_0x4d0adc,_0x48e722)[_0xea5b('0xb')](function(_0xd2686c){logger[_0xea5b('0x10')]('['+[_0x1592c4[_0xea5b('0x11')]()]+'],\x20createEndUser\x20crm',_0xd2686c);_0x17aa6a(_0xd2686c);});}})['catch'](function(_0x45d7d5){logger['error']('['+[_0x1592c4['toUpperCase']()]+']',_0x45d7d5[_0xea5b('0x1f')]);_0x306a55(_0x45d7d5['message']);});});};}function getCustomFields(_0x38d7e1,_0x2d53c8){var _0x396b93={};if(_0x38d7e1[_0xea5b('0xc')]>0x0){_[_0xea5b('0x2c')](_0x38d7e1,function(_0x793e1){if(_[_0xea5b('0x2d')]([_0xea5b('0x2e'),_0xea5b('0x2f')],_0x793e1[_0xea5b('0x30')])&&_0x793e1[_0xea5b('0x31')]&&!_0x793e1['customField']){_0x396b93[_0x793e1['nameField'][_0xea5b('0x32')]()]=_0x793e1[_0xea5b('0x33')]['toString']();}else if(_[_0xea5b('0x2d')]([_0xea5b('0x2e'),_0xea5b('0x2f')],_0x793e1[_0xea5b('0x30')])&&_0x793e1[_0xea5b('0x34')]&&_0x793e1['customField']){_0x396b93[_0x793e1[_0xea5b('0x34')][_0xea5b('0x32')]()]=_0x793e1[_0xea5b('0x33')]['toString']();}else if(_0x793e1[_0xea5b('0x30')]===_0xea5b('0x35')&&_0x793e1['variableName']&&_0x793e1[_0xea5b('0x34')]&&_0x793e1[_0xea5b('0x36')]){_0x396b93[_0x793e1[_0xea5b('0x34')][_0xea5b('0x32')]()]=_0x2d53c8[_0x793e1[_0xea5b('0x37')]][_0xea5b('0x38')]();}else if(_0x793e1['type']==='customVariable'&&_0x793e1[_0xea5b('0x39')]&&_0x793e1[_0xea5b('0x39')]['name']&&_0x793e1[_0xea5b('0x34')]&&_0x793e1[_0xea5b('0x36')]){_0x396b93[_0x793e1['idField']['toLowerCase']()]=_0x2d53c8[_0x793e1[_0xea5b('0x39')]['name'][_0xea5b('0x32')]()][_0xea5b('0x38')]();}});}return _0x396b93;}function getTicket(_0x398dda,_0x1a4bb8,_0x5658f7,_0x472a2a,_0x17d737,_0xfcc031){return function(_0x1987ac){logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x3a'),_0x1987ac);return new Promise(function(_0x38ac57,_0x5b0395){var _0x191d82=_0x398dda[_0xea5b('0x32')]()==='outbound'?_0x1987ac['userId']:_0x1987ac['endUserId'];var _0x202a3b={'method':_0xea5b('0x23'),'uri':_0x5658f7+'incident'+'?'+_0xfcc031,'body':Object['assign']({},{'active':_0xea5b('0x1c'),'caller_id':_0x191d82,'assigned_to':_0x1987ac['userId'],'short_description':intUtil[_0xea5b('0x3b')](_0x472a2a[_0xea5b('0x3c')],_0x17d737,'\x20'),'description':intUtil[_0xea5b('0x3b')](_0x472a2a[_0xea5b('0x3d')],_0x17d737,'\x0a')},getCustomFields(_0x472a2a[_0xea5b('0x3e')],_0x17d737)),'auth':_0x1a4bb8,'json':!![]};return rp(_0x202a3b)[_0xea5b('0xb')](function(_0x50d847){logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x3f'),_0x50d847[_0xea5b('0xe')]);_0x1987ac[_0xea5b('0x40')]=_0x50d847[_0xea5b('0xe')]['sys_id'];_0x1987ac['ticketNumber']=_0x50d847[_0xea5b('0xe')][_0xea5b('0x41')];logger[_0xea5b('0x10')]('['+[_0x398dda[_0xea5b('0x11')]()]+_0xea5b('0x42'),_0x1987ac);_0x38ac57(_0x1987ac);})[_0xea5b('0x13')](function(_0x21c136){logger[_0xea5b('0x14')]('['+[_0x398dda[_0xea5b('0x11')]()]+']',_0x21c136[_0xea5b('0x1f')]);_0x5b0395(_0x21c136[_0xea5b('0x1f')]);});});};}function createRemoteTag(_0x13efcf,_0x1438ba,_0x1ec795,_0x207102){return new Promise(function(_0x5bb28a,_0x4bb036){var _0x107510={'method':_0xea5b('0x23'),'uri':_0x1ec795+_0xea5b('0x43')+'?'+_0x207102,'body':{'short_description':_0x13efcf,'global':!![],'active':!![],'name':_0x13efcf},'auth':_0x1438ba,'json':!![]};return rp(_0x107510)[_0xea5b('0xb')](function(_0x1f7cc8){var _0x10c6bd=_0x1f7cc8[_0xea5b('0xe')][_0xea5b('0xf')];_0x5bb28a(_0x10c6bd);});});}function getRemoteTag(_0x2eaec4,_0x47ac52,_0x22d79b,_0x383900,_0x200826){return new Promise(function(_0x42226d,_0x3ea314){var _0x22d9d7={'method':_0xea5b('0x18'),'uri':_0x22d79b+_0xea5b('0x43')+_0xea5b('0x44')+_0x2eaec4+'&'+_0x383900,'auth':_0x47ac52,'json':!![]};return rp(_0x22d9d7)['then'](function(_0x16016b){if(_0x16016b[_0xea5b('0xe')]['length']>0x0){var _0x15b874=_0x16016b['result'][0x0][_0xea5b('0xf')];_0x42226d(_0x15b874);}else{return createRemoteTag(_0x2eaec4,_0x47ac52,_0x22d79b,_0x383900)[_0xea5b('0xb')](function(_0x2784f0){_0x42226d(_0x2784f0);});}});});}function assignTagToIncident(_0x16084e,_0x25a399,_0x4dac00,_0x2f78ae,_0x27c70b){return new Promise(function(_0x28a920,_0x243694){var _0x5a7de1={'method':'POST','uri':_0x4dac00+_0xea5b('0x45')+'?'+_0x27c70b,'body':{'label':_0x16084e,'table':_0xea5b('0x46'),'id_type':_0xea5b('0x47'),'table_key':_0x2f78ae['ticketId'],'title':_0xea5b('0x48')+_0x2f78ae[_0xea5b('0x49')],'id_display':_0x2f78ae['ticketNumber']},'auth':_0x25a399,'json':!![]};return rp(_0x5a7de1)[_0xea5b('0xb')](function(_0x23ce49){_0x28a920();})[_0xea5b('0x13')](function(){_0x28a920();});});}function manageTags(_0xbb7a8c,_0x4429c7,_0x1418fd,_0x4f2394,_0x6bd6d5,_0x1928c2,_0x1c0c8f){return new Promise(function(_0x586e02,_0x47d4a0){var _0x1256a5=[];_0x4429c7['forEach'](function(_0x35f8ef){_0x1256a5[_0xea5b('0x4a')](getRemoteTag(_0x35f8ef,_0x1418fd,_0x4f2394,_0x1928c2,_0x1c0c8f));});return Promise[_0xea5b('0x4b')](_0x1256a5)['then'](function(_0x102ca4){if(_0x102ca4[_0xea5b('0xc')]){logger[_0xea5b('0x10')]('['+[_0xbb7a8c[_0xea5b('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x102ca4);var _0x5953c9=[];_0x102ca4[_0xea5b('0x2c')](function(_0x15fd5c){_0x5953c9[_0xea5b('0x4a')](assignTagToIncident(_0x15fd5c,_0x1418fd,_0x4f2394,_0x6bd6d5,_0x1928c2));});return Promise[_0xea5b('0x4b')](_0x5953c9)[_0xea5b('0xb')](function(){_0x586e02();})['catch'](function(){_0x586e02();});}else{_0x586e02();}});});}function getTags(_0x563999,_0x22bf53,_0x408bdc,_0x353b79,_0x233137,_0x8101a0){return function(_0x187c44){return new Promise(function(_0x248db4,_0x462037){var _0x1e56ae=[];var _0xae5c8a=_0x353b79[_0xea5b('0x4c')];if(_0xae5c8a&&_0xae5c8a[_0xea5b('0xc')]>0x0){_0x1e56ae=_[_0xea5b('0x4d')](_0xae5c8a,'name');}if(_0x1e56ae[_0xea5b('0xc')]>0x0){return manageTags(_0x563999,_0x1e56ae,_0x22bf53,_0x408bdc,_0x187c44,_0x233137,_0x8101a0)[_0xea5b('0xb')](function(){_0x248db4(_0x187c44);});}else{_0x248db4(_0x187c44);}});};}function emit(_0x4ce5da,_0x46e1dc,_0x275f1c){var _0xdde96b=_0xea5b('0x4e')+_0xea5b('0x4f')+_0xea5b('0x50')+_0xea5b('0x51');var _0x43fd86={'uri':_0x4ce5da+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x275f1c+_0xdde96b};io['to'](util[_0xea5b('0x52')](_0xea5b('0x53'),_0x46e1dc))[_0xea5b('0x54')](_0xea5b('0x55'),_0x43fd86);}exports['cs']=function(_0x5a9396,_0x1fadd4,_0x5f0e04,_0xa130d8,_0x430b13,_0x5329de,_0x3af72b,_0x3c3145){var _0x3cea60={};var _0x293a22={'user':_0x5329de['username'],'pass':_0x5329de[_0xea5b('0x56')]};var _0x12b1cb=_0xea5b('0x57');var _0x4e922f='sysparm_display_value=true';_0x5329de[_0xea5b('0x58')]=intUtil[_0xea5b('0x59')](_0x5329de[_0xea5b('0x58')]);_0x5329de[_0xea5b('0x5a')]=intUtil[_0xea5b('0x59')](_0x5329de[_0xea5b('0x5a')]);var _0xde66a7=util[_0xea5b('0x52')](_0xea5b('0x5b'),_0x5329de[_0xea5b('0x58')]);_0x3cea60['userEmail']=!_[_0xea5b('0x5c')](_0xa130d8)?_0xa130d8[_0xea5b('0x5d')]:null;_0x3cea60[_0xea5b('0x21')]=_0x5329de['email'];_0x3cea60['endUserNumber']=_0x3c3145['toLowerCase']()===_0xea5b('0x5e')?_0x1fadd4[_0xea5b('0x5f')]:_0x1fadd4[_0xea5b('0x60')];_0x3cea60[_0xea5b('0x61')]=_0x3c3145==='queue'||_0x3c3145===_0xea5b('0x62')?_0xea5b('0x63'):_0xea5b('0x5e');var _0x29b72b=util[_0xea5b('0x52')](_0xea5b('0x64'),_0x5329de['serverUrl'],_0x1fadd4[_0xea5b('0x65')],md5(_0x1fadd4[_0xea5b('0x65')]));if(_0x430b13&&_0x430b13[_0xea5b('0x66')]){logger[_0xea5b('0x10')](_0xea5b('0x67'),_0xea5b('0x68'));_0x1fadd4[_0xea5b('0x69')]=_0x29b72b;}else if(_0x3af72b&&_0x3af72b['recordingFormat']&&_0x3af72b[_0xea5b('0x6a')]!=='none'){logger[_0xea5b('0x10')]('[OUTBOUND]',_0xea5b('0x68'));_0x1fadd4['recordingURL']=_0x29b72b;}else{_0x1fadd4[_0xea5b('0x69')]='';}return getAdminUser(_0x3c3145,_0x293a22,_0x3cea60,_0xde66a7,_0x4e922f,_0x12b1cb)['then'](getUser(_0x3c3145,_0x293a22,_0xde66a7,_0x4e922f,_0x12b1cb))[_0xea5b('0xb')](getEndUser(_0x3c3145,_0x293a22,_0xde66a7,_0x4e922f,_0x12b1cb))[_0xea5b('0xb')](getTicket(_0x3c3145,_0x293a22,_0xde66a7,_0x5f0e04,_0x1fadd4,_0x4e922f))[_0xea5b('0xb')](function(_0x1e9649){logger[_0xea5b('0x10')](util[_0xea5b('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1e9649[_0xea5b('0x40')]));logger[_0xea5b('0x10')](util[_0xea5b('0x52')]('call\x20direction:\x20%s',_0x3c3145));if(_0x3c3145!==_0xea5b('0x62')){logger['info']('['+[_0x3c3145[_0xea5b('0x11')]()]+']',_0xea5b('0x6b'));emit(_0x5329de['remoteUri'],_0xa130d8['name'],_0x1e9649['ticketId']);}})['catch'](function(_0x4b757a){logger[_0xea5b('0x14')]('['+[_0x3c3145['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xea5b('0x6c')](_0x4b757a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xacc9=['sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','customField','nameField','toLowerCase','content','toString','includes','idField','variableName','customVariable','Variable','name','outbound','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','ticketId','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST'];(function(_0x4eeef5,_0x41e9b0){var _0x276558=function(_0x233d26){while(--_0x233d26){_0x4eeef5['push'](_0x4eeef5['shift']());}};_0x276558(++_0x41e9b0);}(_0xacc9,0x116));var _0x9acc=function(_0x1e1ccc,_0x49e9d3){_0x1e1ccc=_0x1e1ccc-0x0;var _0x1a586e=_0xacc9[_0x1e1ccc];return _0x1a586e;};'use strict';var _=require(_0x9acc('0x0'));var Promise=require(_0x9acc('0x1'));var rp=require(_0x9acc('0x2'));var util=require('util');var md5=require(_0x9acc('0x3'));var Redis=require(_0x9acc('0x4'));var intUtil=require(_0x9acc('0x5'));var config=require(_0x9acc('0x6'));var logger=require(_0x9acc('0x7'))('servicenow');config['redis']=_[_0x9acc('0x8')](config['redis'],{'host':_0x9acc('0x9'),'port':0x18eb});var io=require(_0x9acc('0xa'))(new Redis(config['redis']));function getAdminUser(_0x17a38f,_0x1bb216,_0x18fbd5,_0x54ebc4,_0x1a938c,_0x73d638){return new Promise(function(_0x5e4d99,_0x367399){var _0x37e6b2={'method':_0x9acc('0xb'),'uri':_0x54ebc4+_0x9acc('0xc')+'&'+_0x1a938c+'&'+_0x73d638,'auth':_0x1bb216,'json':!![]};return rp(_0x37e6b2)[_0x9acc('0xd')](function(_0x269263){if(_0x269263['result'][_0x9acc('0xe')]>0x0){_0x18fbd5[_0x9acc('0xf')]=_0x269263[_0x9acc('0x10')][0x0][_0x9acc('0x11')];}logger[_0x9acc('0x12')]('['+[_0x17a38f[_0x9acc('0x13')]()]+_0x9acc('0x14'),_0x18fbd5);_0x5e4d99(_0x18fbd5);})['catch'](function(_0x2b00d1){logger[_0x9acc('0x15')]('['+[_0x17a38f['toUpperCase']()]+']',_0x2b00d1['message']);_0x367399(_0x2b00d1[_0x9acc('0x16')]);});});}function getUser(_0x43fb6c,_0x4d1cfe,_0x17888e,_0x180b45,_0x1d5097){return function(_0x457143){logger[_0x9acc('0x12')]('['+[_0x43fb6c[_0x9acc('0x13')]()]+_0x9acc('0x17'),_0x457143);return new Promise(function(_0x35c9dd,_0x1040e3){if(intUtil['validateEmail'](_0x457143['userEmail'])){var _0xd06a95={'method':'GET','uri':_0x17888e+_0x9acc('0x18')+_0x457143[_0x9acc('0x19')]+'&'+_0x180b45+'&'+_0x1d5097,'auth':_0x4d1cfe,'json':!![]};logger[_0x9acc('0x12')]('['+[_0x43fb6c['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xd06a95);return rp(_0xd06a95)[_0x9acc('0xd')](function(_0x471ec1){logger[_0x9acc('0x12')]('['+[_0x43fb6c[_0x9acc('0x13')]()]+_0x9acc('0x1a'),_0x471ec1);if(_0x471ec1[_0x9acc('0x10')][_0x9acc('0xe')]>0x0&&String(_0x471ec1['result'][0x0][_0x9acc('0x1b')])===_0x9acc('0x1c')){_0x457143[_0x9acc('0x1d')]=_0x471ec1[_0x9acc('0x10')][0x0]['sys_id'];}else{_0x457143[_0x9acc('0x1d')]=_0x457143[_0x9acc('0xf')];_0x457143[_0x9acc('0x19')]=_0x457143[_0x9acc('0x1e')];}logger[_0x9acc('0x12')]('['+[_0x43fb6c['toUpperCase']()]+_0x9acc('0x1f'),_0x457143);_0x35c9dd(_0x457143);})['catch'](function(_0x11381e){logger['error']('['+[_0x43fb6c[_0x9acc('0x13')]()]+']',_0x11381e[_0x9acc('0x16')]);_0x1040e3(_0x11381e['message']);});}else{logger[_0x9acc('0x12')]('['+[_0x43fb6c[_0x9acc('0x13')]()]+_0x9acc('0x20'));_0x457143[_0x9acc('0x1d')]=_0x457143['adminId'];_0x457143[_0x9acc('0x19')]=_0x457143[_0x9acc('0x1e')];_0x35c9dd(_0x457143);}});};}function createEndUser(_0x5c3118,_0x1f9098,_0x20c3ef,_0x236cca,_0xc38c0b){logger['info']('['+[_0x5c3118['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x20c3ef);return new Promise(function(_0x5f4b25,_0x4bd56c){var _0x13b2b5={'method':_0x9acc('0x21'),'uri':_0x236cca+_0x9acc('0x22')+_0xc38c0b,'body':{'user_name':_0x20c3ef['endUserNumber'],'roles':_0x9acc('0x23'),'first_name':_0x20c3ef[_0x9acc('0x24')],'active':_0x9acc('0x1c'),'date_format':_0x9acc('0x25'),'phone':_0x20c3ef['endUserNumber']},'auth':_0x1f9098,'json':!![]};return rp(_0x13b2b5)[_0x9acc('0xd')](function(_0x93245a){logger[_0x9acc('0x12')]('['+[_0x5c3118[_0x9acc('0x13')]()]+_0x9acc('0x26'),_0x93245a[_0x9acc('0x10')]);_0x20c3ef[_0x9acc('0x27')]=_0x93245a[_0x9acc('0x10')]['sys_id'];_0x5f4b25(_0x20c3ef);})[_0x9acc('0x28')](function(_0x2ce70f){logger[_0x9acc('0x15')]('['+[_0x5c3118[_0x9acc('0x13')]()]+']',_0x2ce70f[_0x9acc('0x16')]);_0x4bd56c(_0x2ce70f[_0x9acc('0x16')]);});});}function getEndUser(_0x3abd06,_0x18d28d,_0x233556,_0x14ef0d,_0x1946c7){return function(_0x3ad32e){logger[_0x9acc('0x12')]('['+[_0x3abd06[_0x9acc('0x13')]()]+_0x9acc('0x29'),_0x3ad32e);return new Promise(function(_0x5858ba,_0x38e36f){var _0x7b46d={'method':_0x9acc('0xb'),'uri':_0x233556+_0x9acc('0x2a')+_0x3ad32e[_0x9acc('0x24')]+'&'+_0x14ef0d+'&'+_0x1946c7,'auth':_0x18d28d,'json':!![]};return rp(_0x7b46d)['then'](function(_0x4b75dc){if(_0x4b75dc['result']['length']>0x0){_0x3ad32e[_0x9acc('0x27')]=_0x4b75dc['result'][0x0][_0x9acc('0x11')];logger['info']('['+[_0x3abd06[_0x9acc('0x13')]()]+_0x9acc('0x2b'),_0x3ad32e);_0x5858ba(_0x3ad32e);}else{return createEndUser(_0x3abd06,_0x18d28d,_0x3ad32e,_0x233556,_0x14ef0d)[_0x9acc('0xd')](function(_0x331c9c){logger[_0x9acc('0x12')]('['+[_0x3abd06[_0x9acc('0x13')]()]+_0x9acc('0x2c'),_0x331c9c);_0x5858ba(_0x331c9c);});}})['catch'](function(_0x12b99c){logger['error']('['+[_0x3abd06[_0x9acc('0x13')]()]+']',_0x12b99c[_0x9acc('0x16')]);_0x38e36f(_0x12b99c['message']);});});};}function getCustomFields(_0x326a18,_0x6409d9){var _0x43441a={};if(_0x326a18[_0x9acc('0xe')]>0x0){_[_0x9acc('0x2d')](_0x326a18,function(_0x4f1e21){if(_['includes'](['string','picklist'],_0x4f1e21[_0x9acc('0x2e')])&&_0x4f1e21['nameField']&&!_0x4f1e21[_0x9acc('0x2f')]){_0x43441a[_0x4f1e21[_0x9acc('0x30')][_0x9acc('0x31')]()]=_0x4f1e21[_0x9acc('0x32')][_0x9acc('0x33')]();}else if(_[_0x9acc('0x34')](['string','picklist'],_0x4f1e21['type'])&&_0x4f1e21[_0x9acc('0x35')]&&_0x4f1e21[_0x9acc('0x2f')]){_0x43441a[_0x4f1e21[_0x9acc('0x35')]['toLowerCase']()]=_0x4f1e21[_0x9acc('0x32')][_0x9acc('0x33')]();}else if(_0x4f1e21[_0x9acc('0x2e')]==='variable'&&_0x4f1e21['variableName']&&_0x4f1e21['idField']&&_0x4f1e21[_0x9acc('0x2f')]){_0x43441a[_0x4f1e21[_0x9acc('0x35')][_0x9acc('0x31')]()]=_0x6409d9[_0x4f1e21[_0x9acc('0x36')]][_0x9acc('0x33')]();}else if(_0x4f1e21[_0x9acc('0x2e')]===_0x9acc('0x37')&&_0x4f1e21['Variable']&&_0x4f1e21[_0x9acc('0x38')][_0x9acc('0x39')]&&_0x4f1e21[_0x9acc('0x35')]&&_0x4f1e21[_0x9acc('0x2f')]){_0x43441a[_0x4f1e21[_0x9acc('0x35')][_0x9acc('0x31')]()]=_0x6409d9[_0x4f1e21['Variable'][_0x9acc('0x39')][_0x9acc('0x31')]()][_0x9acc('0x33')]();}});}return _0x43441a;}function getTicket(_0x598b6c,_0x4a5e3f,_0x528725,_0x4690a6,_0x17583f,_0x5a3f04){return function(_0x4bc6d8){logger[_0x9acc('0x12')]('['+[_0x598b6c[_0x9acc('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x4bc6d8);return new Promise(function(_0x1fbc76,_0x2de86d){var _0x1b83e2=_0x598b6c[_0x9acc('0x31')]()===_0x9acc('0x3a')?_0x4bc6d8[_0x9acc('0x1d')]:_0x4bc6d8['endUserId'];var _0x572d02={'method':_0x9acc('0x21'),'uri':_0x528725+'incident'+'?'+_0x5a3f04,'body':Object['assign']({},{'active':_0x9acc('0x1c'),'caller_id':_0x1b83e2,'assigned_to':_0x4bc6d8['userId'],'short_description':intUtil[_0x9acc('0x3b')](_0x4690a6[_0x9acc('0x3c')],_0x17583f,'\x20'),'description':intUtil[_0x9acc('0x3b')](_0x4690a6[_0x9acc('0x3d')],_0x17583f,'\x0a')},getCustomFields(_0x4690a6[_0x9acc('0x3e')],_0x17583f)),'auth':_0x4a5e3f,'json':!![]};return rp(_0x572d02)[_0x9acc('0xd')](function(_0x3716ff){logger['info']('['+[_0x598b6c[_0x9acc('0x13')]()]+_0x9acc('0x3f'),_0x3716ff['result']);_0x4bc6d8['ticketId']=_0x3716ff[_0x9acc('0x10')][_0x9acc('0x11')];_0x4bc6d8[_0x9acc('0x40')]=_0x3716ff[_0x9acc('0x10')][_0x9acc('0x41')];logger[_0x9acc('0x12')]('['+[_0x598b6c[_0x9acc('0x13')]()]+_0x9acc('0x42'),_0x4bc6d8);_0x1fbc76(_0x4bc6d8);})['catch'](function(_0x2ecfaa){logger[_0x9acc('0x15')]('['+[_0x598b6c['toUpperCase']()]+']',_0x2ecfaa[_0x9acc('0x16')]);_0x2de86d(_0x2ecfaa['message']);});});};}function createRemoteTag(_0x29d78d,_0x415bb3,_0x5bca2a,_0x25c384){return new Promise(function(_0x1e2221,_0x45277a){var _0x2a12f4={'method':_0x9acc('0x21'),'uri':_0x5bca2a+_0x9acc('0x43')+'?'+_0x25c384,'body':{'short_description':_0x29d78d,'global':!![],'active':!![],'name':_0x29d78d},'auth':_0x415bb3,'json':!![]};return rp(_0x2a12f4)[_0x9acc('0xd')](function(_0x1c53ca){var _0xdadd60=_0x1c53ca[_0x9acc('0x10')][_0x9acc('0x11')];_0x1e2221(_0xdadd60);});});}function getRemoteTag(_0xc351e5,_0x2f08f0,_0x17dc9c,_0x4c6eb3,_0x2631c6){return new Promise(function(_0x55e8d8,_0x333c2b){var _0x176b0b={'method':'GET','uri':_0x17dc9c+_0x9acc('0x43')+_0x9acc('0x44')+_0xc351e5+'&'+_0x4c6eb3,'auth':_0x2f08f0,'json':!![]};return rp(_0x176b0b)['then'](function(_0x53f5aa){if(_0x53f5aa['result'][_0x9acc('0xe')]>0x0){var _0x51b17b=_0x53f5aa[_0x9acc('0x10')][0x0][_0x9acc('0x11')];_0x55e8d8(_0x51b17b);}else{return createRemoteTag(_0xc351e5,_0x2f08f0,_0x17dc9c,_0x4c6eb3)[_0x9acc('0xd')](function(_0x5cd799){_0x55e8d8(_0x5cd799);});}});});}function assignTagToIncident(_0x2002f6,_0xadb8cc,_0xe29688,_0x34c96d,_0x1f7291){return new Promise(function(_0x30b6d3,_0x377e15){var _0x358096={'method':'POST','uri':_0xe29688+_0x9acc('0x45')+'?'+_0x1f7291,'body':{'label':_0x2002f6,'table':'incident','id_type':'Incident','table_key':_0x34c96d[_0x9acc('0x46')],'title':_0x9acc('0x47')+_0x34c96d[_0x9acc('0x40')],'id_display':_0x34c96d['ticketNumber']},'auth':_0xadb8cc,'json':!![]};return rp(_0x358096)[_0x9acc('0xd')](function(_0x51b1c0){_0x30b6d3();})[_0x9acc('0x28')](function(){_0x30b6d3();});});}function manageTags(_0x144f5d,_0x22f29a,_0x8651f,_0x38b38c,_0x125526,_0x4d65e7,_0x3d9fde){return new Promise(function(_0x541d8,_0x13c115){var _0x39cfd1=[];_0x22f29a[_0x9acc('0x2d')](function(_0x413bd5){_0x39cfd1[_0x9acc('0x48')](getRemoteTag(_0x413bd5,_0x8651f,_0x38b38c,_0x4d65e7,_0x3d9fde));});return Promise['all'](_0x39cfd1)[_0x9acc('0xd')](function(_0x41d96c){if(_0x41d96c['length']){logger['info']('['+[_0x144f5d['toUpperCase']()]+_0x9acc('0x49'),_0x41d96c);var _0x3a2b77=[];_0x41d96c[_0x9acc('0x2d')](function(_0x47c13e){_0x3a2b77[_0x9acc('0x48')](assignTagToIncident(_0x47c13e,_0x8651f,_0x38b38c,_0x125526,_0x4d65e7));});return Promise[_0x9acc('0x4a')](_0x3a2b77)[_0x9acc('0xd')](function(){_0x541d8();})[_0x9acc('0x28')](function(){_0x541d8();});}else{_0x541d8();}});});}function getTags(_0x2cc8da,_0x3a6ba0,_0x477645,_0x56c539,_0x4d8786,_0x22612a){return function(_0x4fbead){return new Promise(function(_0x8ba4cc,_0x27aa85){var _0x310f9c=[];var _0x431f51=_0x56c539[_0x9acc('0x4b')];if(_0x431f51&&_0x431f51[_0x9acc('0xe')]>0x0){_0x310f9c=_['map'](_0x431f51,_0x9acc('0x39'));}if(_0x310f9c[_0x9acc('0xe')]>0x0){return manageTags(_0x2cc8da,_0x310f9c,_0x3a6ba0,_0x477645,_0x4fbead,_0x4d8786,_0x22612a)[_0x9acc('0xd')](function(){_0x8ba4cc(_0x4fbead);});}else{_0x8ba4cc(_0x4fbead);}});};}function emit(_0xc3ed9,_0x36a967,_0x269723){var _0x32392c=_0x9acc('0x4c')+_0x9acc('0x4d')+_0x9acc('0x4e')+_0x9acc('0x4f');var _0x3c20cf={'uri':_0xc3ed9+_0x9acc('0x50')+_0x269723+_0x32392c};io['to'](util[_0x9acc('0x51')]('user:%s',_0x36a967))[_0x9acc('0x52')](_0x9acc('0x53'),_0x3c20cf);}exports['cs']=function(_0x327099,_0x18a6e6,_0x21b3e8,_0x2084ad,_0x5f313,_0x92831c,_0x3710ad,_0x56919f){var _0x320fd4={};var _0x3a65ff={'user':_0x92831c[_0x9acc('0x54')],'pass':_0x92831c[_0x9acc('0x55')]};var _0x5bfe86=_0x9acc('0x56');var _0x47993a=_0x9acc('0x57');_0x92831c[_0x9acc('0x58')]=intUtil[_0x9acc('0x59')](_0x92831c[_0x9acc('0x58')]);_0x92831c[_0x9acc('0x5a')]=intUtil[_0x9acc('0x59')](_0x92831c['serverUrl']);var _0x13c1ae=util['format'](_0x9acc('0x5b'),_0x92831c['remoteUri']);_0x320fd4[_0x9acc('0x19')]=!_[_0x9acc('0x5c')](_0x2084ad)?_0x2084ad[_0x9acc('0x5d')]:null;_0x320fd4[_0x9acc('0x1e')]=_0x92831c[_0x9acc('0x5d')];_0x320fd4[_0x9acc('0x24')]=_0x56919f[_0x9acc('0x31')]()==='outbound'?_0x18a6e6['destcalleridnum']:_0x18a6e6[_0x9acc('0x5e')];_0x320fd4[_0x9acc('0x5f')]=_0x56919f===_0x9acc('0x60')||_0x56919f===_0x9acc('0x61')?_0x9acc('0x60'):_0x9acc('0x3a');var _0x5796db=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x92831c[_0x9acc('0x5a')],_0x18a6e6[_0x9acc('0x62')],md5(_0x18a6e6['uniqueid']));if(_0x5f313&&_0x5f313[_0x9acc('0x63')]){logger[_0x9acc('0x12')]('[QUEUE]','Recording\x20is\x20enabled!');_0x18a6e6['recordingURL']=_0x5796db;}else if(_0x3710ad&&_0x3710ad['recordingFormat']&&_0x3710ad['recordingFormat']!==_0x9acc('0x64')){logger['info'](_0x9acc('0x65'),_0x9acc('0x66'));_0x18a6e6[_0x9acc('0x67')]=_0x5796db;}else{_0x18a6e6['recordingURL']='';}return getAdminUser(_0x56919f,_0x3a65ff,_0x320fd4,_0x13c1ae,_0x47993a,_0x5bfe86)[_0x9acc('0xd')](getUser(_0x56919f,_0x3a65ff,_0x13c1ae,_0x47993a,_0x5bfe86))[_0x9acc('0xd')](getEndUser(_0x56919f,_0x3a65ff,_0x13c1ae,_0x47993a,_0x5bfe86))[_0x9acc('0xd')](getTicket(_0x56919f,_0x3a65ff,_0x13c1ae,_0x21b3e8,_0x18a6e6,_0x47993a))[_0x9acc('0xd')](function(_0x2baf32){logger[_0x9acc('0x12')](util[_0x9acc('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2baf32['ticketId']));logger[_0x9acc('0x12')](util[_0x9acc('0x51')]('call\x20direction:\x20%s',_0x56919f));if(_0x56919f!==_0x9acc('0x61')){logger[_0x9acc('0x12')]('['+[_0x56919f[_0x9acc('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x92831c[_0x9acc('0x58')],_0x2084ad[_0x9acc('0x39')],_0x2baf32[_0x9acc('0x46')]);}})[_0x9acc('0x28')](function(_0x365c3e){logger[_0x9acc('0x15')]('['+[_0x56919f[_0x9acc('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x365c3e,{'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 3a7da46..4b028a3 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 _0x8213=['sessionID','set_relationship','stripTrailingSlash','remoteUri','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','Recording\x20is\x20enabled!','Fields','contacts','[OUTBOUND]','error','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','Descriptions','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','then','entry_list','length','find','name_value_list','user_name','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','debug','[HTTP]','merge','map','type','customField','nameField','toLowerCase','idField','custom_fields','push','content','variable','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x8213,0x1ee));var _0x3821=function(_0x2e8988,_0x49fa99){_0x2e8988=_0x2e8988-0x0;var _0x5d40ec=_0x8213[_0x2e8988];return _0x5d40ec;};'use strict';var _=require(_0x3821('0x0'));var rp=require(_0x3821('0x1'));var BPromise=require('bluebird');var md5=require(_0x3821('0x2'));var util=require(_0x3821('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3821('0x4'));config[_0x3821('0x5')]=_[_0x3821('0x6')](config[_0x3821('0x5')],{'host':_0x3821('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x3821('0x8'),'json':!![]};function emit(_0x19f96,_0x985ec7,_0x251bac){io['to'](_0x19f96)[_0x3821('0x9')](_0x985ec7,_0x251bac);}function getTicket(_0x296bbf,_0x75f11c,_0xf5b9f6,_0x2ffdc7,_0x47d1e4,_0x7d03a4,_0x44447f,_0x2e8f4c){logger[_0x3821('0xa')](_0x3821('0xb'));var _0x56b1b9=new Date();var _0x53f320=[{'name':'name','value':intUtil[_0x3821('0xc')](_0x2ffdc7[_0x3821('0xd')],_0x47d1e4,'\x20')},{'name':'assigned_user_id','value':_0x75f11c['id']},{'name':_0x3821('0xe'),'value':_0x75f11c['id']},{'name':'description','value':intUtil[_0x3821('0xc')](_0x2ffdc7[_0x3821('0xf')],_0x47d1e4,'\x0a')},{'name':'date_start','value':_0x56b1b9[_0x3821('0x10')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x3821('0x11'),'value':'0'},{'name':_0x3821('0x12'),'value':'15'},{'name':_0x3821('0x13'),'value':_0xf5b9f6['id']},{'name':_0x3821('0x14'),'value':_0x3821('0x15')},{'name':_0x3821('0x16'),'value':_0xf5b9f6['name']},{'name':_0x3821('0x17'),'value':_0x2e8f4c}];if(_0x7d03a4['length']){_[_0x3821('0x18')](_0x7d03a4,function(_0x3ef49c){if(_0x47d1e4[_0x3ef49c[_0x3821('0x19')]]){_0x53f320['push']({'name':_0x3ef49c['idField'],'value':_0x47d1e4[_0x3ef49c[_0x3821('0x19')]]});}});}return request({'form':{'method':_0x3821('0x1a'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x44447f['id'],'module_name':_0x3821('0x1d'),'name_value_list':_0x53f320})}});}function getAuth(_0xd5b647){return util[_0x3821('0x1e')](_0x3821('0x1f'),new Buffer(_0xd5b647[_0x3821('0x20')]+':X')[_0x3821('0x21')](_0x3821('0x22')));}function getServerInfo(_0x4bc852){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x4bc852['id']})}});}function getUser(_0x2d303b,_0x42aeaa,_0x45e0d4){if(!_[_0x3821('0x23')](_0x42aeaa)){logger[_0x3821('0xa')](_0x3821('0x24'),_0x42aeaa);return request({'form':{'method':_0x3821('0x25'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0x45e0d4['id'],'module_name':_0x3821('0x26'),'query':util[_0x3821('0x1e')](_0x3821('0x27'),_0x42aeaa),'order_by':'','offset':'0','select_fields':['id',_0x3821('0x28'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3821('0x29')](function(_0x4471ad){if(_0x4471ad[_0x3821('0x2a')][_0x3821('0x2b')]){var _0x283171=_[_0x3821('0x2c')](_0x4471ad[_0x3821('0x2a')],function(_0x3336a2){return _0x3336a2[_0x3821('0x2d')][_0x3821('0x2e')][_0x3821('0x2f')]===_0x42aeaa;});if(_0x283171){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x283171['name_value_list']['id'][_0x3821('0x2f')],'name':_0x283171['name_value_list'][_0x3821('0x28')][_0x3821('0x2f')]});}}logger['info'](_0x3821('0x30'));return BPromise[_0x3821('0x31')]({'id':_0x45e0d4[_0x3821('0x2d')]['user_id'][_0x3821('0x2f')],'name':_0x45e0d4[_0x3821('0x2d')]['user_name'][_0x3821('0x2f')]});});}else{logger[_0x3821('0xa')](_0x3821('0x32'));return BPromise['resolve']({'id':_0x45e0d4[_0x3821('0x2d')][_0x3821('0x33')][_0x3821('0x2f')],'name':_0x45e0d4[_0x3821('0x2d')][_0x3821('0x2e')]['value']});}}function getEndUser(_0x6bff7a,_0x5d4a3b,_0xf099ae,_0xaf9fb2){logger[_0x3821('0xa')]('Searching\x20enduser\x20with\x20phone',_0xf099ae);return request({'form':{'method':_0x3821('0x25'),'input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xaf9fb2['id'],'module_name':_0x3821('0x15'),'query':util[_0x3821('0x1e')](_0x3821('0x34'),_0xf099ae),'order_by':'','offset':'0','select_fields':['id','name',_0x3821('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3821('0x29')](function(_0x408a77){if(_0x408a77[_0x3821('0x2a')][_0x3821('0x2b')]){var _0xa11a88=_[_0x3821('0x2c')](_0x408a77[_0x3821('0x2a')],function(_0x48b48a){return _0x48b48a[_0x3821('0x2d')]['phone_home']['value']===_0xf099ae;});if(_0xa11a88){logger[_0x3821('0xa')](_0x3821('0x36'));return BPromise[_0x3821('0x31')]({'id':_0xa11a88['name_value_list']['id'][_0x3821('0x2f')],'name':_0xa11a88[_0x3821('0x2d')][_0x3821('0x28')]['value'],'phone':_0xa11a88[_0x3821('0x2d')][_0x3821('0x35')][_0x3821('0x2f')]});}}else{logger[_0x3821('0xa')](_0x3821('0x37'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xaf9fb2['id'],'module_name':_0x3821('0x15'),'name_value_list':[{'name':'first_name','value':_0x5d4a3b!==_0x3821('0x38')?_0x5d4a3b:util[_0x3821('0x1e')]('Caller\x20-\x20%s',_0xf099ae)},{'name':_0x3821('0x35'),'value':_0xf099ae}]})}})[_0x3821('0x29')](function(_0x21dd3a){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x21dd3a['id'],'name':_0x21dd3a[_0x3821('0x2a')]['first_name'][_0x3821('0x2f')],'phone':_0x21dd3a['entry_list'][_0x3821('0x35')]['value']});});}});}function request(_0x26f75c){logger[_0x3821('0x39')](_0x3821('0x3a'),JSON[_0x3821('0x1c')](_0x26f75c));return rp(_[_0x3821('0x3b')](def,_0x26f75c));}function getTags(_0x1fd0a1,_0x14b6ff){var _0x389af3=[];if(_0x1fd0a1&&_0x1fd0a1[_0x3821('0x2b')]>0x0){_0x389af3=_[_0x3821('0x3c')](_0x1fd0a1,_0x14b6ff);}return _0x389af3;}function getCustomFields(_0x2ac634,_0x45abd7){var _0x202c19=[];var _0x58fde0={'custom_fields':[]};if(_0x2ac634[_0x3821('0x2b')]>0x0){_[_0x3821('0x18')](_0x2ac634,function(_0x3d7bbc){if(_0x3d7bbc[_0x3821('0x3d')]==='string'&&_0x3d7bbc['nameField']&&!_0x3d7bbc[_0x3821('0x3e')]){_0x58fde0[_0x3d7bbc[_0x3821('0x3f')][_0x3821('0x40')]()]=_0x3d7bbc['content'][_0x3821('0x21')]();}else if(_0x3d7bbc[_0x3821('0x3d')]==='string'&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc[_0x3821('0x3e')]){_0x58fde0[_0x3821('0x42')][_0x3821('0x43')]({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x3d7bbc[_0x3821('0x44')][_0x3821('0x21')]()});}else if(_0x3d7bbc[_0x3821('0x3d')]===_0x3821('0x45')&&_0x3d7bbc[_0x3821('0x19')]&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc['customField']){_0x45abd7[_0x3d7bbc[_0x3821('0x19')]]&&_0x58fde0['custom_fields'][_0x3821('0x43')]({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x45abd7[_0x3d7bbc[_0x3821('0x19')]][_0x3821('0x21')]()});}else if(_0x3d7bbc[_0x3821('0x3d')]===_0x3821('0x46')&&_0x3d7bbc[_0x3821('0x47')]&&_0x3d7bbc[_0x3821('0x47')]['name']&&_0x3d7bbc[_0x3821('0x41')]&&_0x3d7bbc[_0x3821('0x3e')]){_0x45abd7[_0x3d7bbc[_0x3821('0x47')][_0x3821('0x28')][_0x3821('0x40')]()]&&_0x58fde0[_0x3821('0x42')]['push']({'id':_0x3d7bbc[_0x3821('0x41')],'value':_0x45abd7[_0x3d7bbc[_0x3821('0x47')][_0x3821('0x28')][_0x3821('0x40')]()]['toString']()});}});}return _0x58fde0;}function getConnection(_0x3c765a){return request({'method':'POST','form':{'method':_0x3821('0x48'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3c765a[_0x3821('0x49')],'password':_0x3c765a[_0x3821('0x4a')],'encryption':'PLAIN'},'application':_0x3821('0x4b')})}})[_0x3821('0x29')](function(_0x328d8d){var _0x400e91=_0x328d8d;if(_0x400e91['id']){def[_0x3821('0x4c')]=_0x400e91['id'];return BPromise['resolve'](_0x400e91);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x3c765a['id']));}});}function setRelationship(_0xcd6bf9,_0x23d8a5,_0x39970d,_0x3ff3bc){return request({'form':{'method':_0x3821('0x4d'),'input_type':_0x3821('0x1b'),'response_type':_0x3821('0x1b'),'rest_data':JSON[_0x3821('0x1c')]({'session':_0xcd6bf9['id'],'module_name':_0x3821('0x1d'),'module_id':_0x39970d['id'],'link_field_name':_0x3ff3bc,'related_ids':[_0x23d8a5['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5bea9f,_0xfe83f1,_0x58664b,_0x489715,_0x6a898c,_0x22be2b){var _0x2756b2,_0x351922,_0x417e5f,_0x51fcdf;_0x22be2b['remoteUri']=intUtil[_0x3821('0x4e')](_0x22be2b[_0x3821('0x4f')]);_0x22be2b[_0x3821('0x50')]=intUtil[_0x3821('0x4e')](_0x22be2b[_0x3821('0x50')]);def['uri']=util[_0x3821('0x1e')]('%s/service/v4_1/rest.php',_0x22be2b['remoteUri']);if(_0x6a898c&&_0x6a898c['monitor_format']){logger[_0x3821('0xa')](_0x3821('0x51'),'Recording\x20is\x20enabled!');_0xfe83f1[_0x3821('0x52')]=util['format'](_0x3821('0x53'),_0x22be2b[_0x3821('0x50')],_0xfe83f1[_0x3821('0x54')],md5(_0xfe83f1[_0x3821('0x54')]));}else{_0xfe83f1[_0x3821('0x52')]='';}return getConnection(_0x22be2b)['then'](function(_0x20ccda){_0x51fcdf=_0x20ccda;return getUser(_0x22be2b,_0x489715[_0x3821('0x28')],_0x51fcdf);})['then'](function(_0x762856){_0x2756b2=_0x762856;logger['info'](_0x3821('0x55'),_0x2756b2['id']);return getEndUser(_0x22be2b,_0xfe83f1[_0x3821('0x56')],_0xfe83f1[_0x3821('0x57')],_0x51fcdf);})[_0x3821('0x29')](function(_0x314b32){_0x351922=_0x314b32;logger[_0x3821('0xa')](_0x3821('0x58'),_0x351922['id']);return getTicket(_0x22be2b,_0x2756b2,_0x351922,_0x58664b,_0xfe83f1,_0x58664b['Fields'],_0x51fcdf,_0x3821('0x59'));})['then'](function(_0x3ccb79){_0x417e5f=_0x3ccb79;logger[_0x3821('0xa')](_0x3821('0x5a'));logger[_0x3821('0xa')](_0x3821('0x5b'),_0x417e5f['id']);return setRelationship(_0x51fcdf,_0x2756b2,_0x417e5f,_0x3821('0x5c'));})[_0x3821('0x29')](function(){return setRelationship(_0x51fcdf,_0x351922,_0x417e5f,'contacts');})[_0x3821('0x29')](function(){return getServerInfo(_0x51fcdf);})[_0x3821('0x29')](function(_0x51295a){var _0x38c4b0=parseInt(_0x51295a[_0x3821('0x5d')][_0x3821('0x5e')](0x0));var _0x44e7b8=util['format'](_0x3821('0x5f'),_0x22be2b['remoteUri'],_0x417e5f['id']);if(_0x38c4b0>0x6){_0x44e7b8=util['format'](_0x3821('0x60'),_0x22be2b['remoteUri'],_0x417e5f['id']);}logger['info'](_0x3821('0x51'),_0x3821('0x61'));emit(util['format'](_0x3821('0x62'),_0x489715['name']),_0x3821('0x63'),{'uri':_0x44e7b8});})[_0x3821('0x64')](function(_0x5c4227){logger['error'](_0x3821('0x51'),JSON['stringify'](_0x5c4227));});};exports[_0x3821('0x65')]=function(_0x30b2b8,_0x3025c2,_0x4627fb,_0x1a69e6,_0x22e775,_0xa7a022,_0x544c21){var _0x267657,_0x508fa8,_0x5ca28e,_0x55b099;_0xa7a022[_0x3821('0x4f')]=intUtil[_0x3821('0x4e')](_0xa7a022['remoteUri']);_0xa7a022[_0x3821('0x50')]=intUtil['stripTrailingSlash'](_0xa7a022[_0x3821('0x50')]);def[_0x3821('0x66')]=util[_0x3821('0x1e')](_0x3821('0x67'),_0xa7a022[_0x3821('0x4f')]);if(_0x544c21&&_0x544c21[_0x3821('0x68')]&&_0x544c21[_0x3821('0x68')]!==_0x3821('0x69')){logger['info']('[OUTBOUND]',_0x3821('0x6a'));_0x3025c2[_0x3821('0x52')]=util['format'](_0x3821('0x53'),_0xa7a022[_0x3821('0x50')],_0x3025c2['uniqueid'],md5(_0x3025c2[_0x3821('0x54')]));}return getConnection(_0xa7a022)['then'](function(_0x411ebc){_0x55b099=_0x411ebc;return getUser(_0xa7a022,_0x1a69e6['name'],_0x55b099);})[_0x3821('0x29')](function(_0x2ab434){_0x267657=_0x2ab434;logger[_0x3821('0xa')](_0x3821('0x55'),_0x267657['id']);return getEndUser(_0xa7a022,_0x3025c2['destcalleridname'],_0x3025c2['destcalleridnum'],_0x55b099);})[_0x3821('0x29')](function(_0x24390d){_0x508fa8=_0x24390d;logger[_0x3821('0xa')](_0x3821('0x58'),_0x508fa8['id']);return getTicket(_0xa7a022,_0x267657,_0x508fa8,_0x4627fb,_0x3025c2,_0x4627fb[_0x3821('0x6b')],_0x55b099,'Outbound');})['then'](function(_0x5aaf3d){_0x5ca28e=_0x5aaf3d;logger[_0x3821('0xa')](_0x3821('0x5a'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5ca28e['id']);return setRelationship(_0x55b099,_0x267657,_0x5ca28e,_0x3821('0x5c'));})[_0x3821('0x29')](function(){return setRelationship(_0x55b099,_0x508fa8,_0x5ca28e,_0x3821('0x6c'));})['then'](function(){return getServerInfo(_0x55b099);})['then'](function(_0x22aa6c){var _0x62d9f5=parseInt(_0x22aa6c[_0x3821('0x5d')]['charAt'](0x0));var _0x198f27=util[_0x3821('0x1e')](_0x3821('0x5f'),_0xa7a022['remoteUri'],_0x5ca28e['id']);if(_0x62d9f5>0x6){_0x198f27=util[_0x3821('0x1e')](_0x3821('0x60'),_0xa7a022[_0x3821('0x4f')],_0x5ca28e['id']);}logger[_0x3821('0xa')](_0x3821('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3821('0x1e')](_0x3821('0x62'),_0x1a69e6['name']),_0x3821('0x63'),{'uri':_0x198f27});})[_0x3821('0x64')](function(_0x55d4e3){logger[_0x3821('0x6e')](_0x3821('0x6d'),JSON[_0x3821('0x1c')](_0x55d4e3));});};exports[_0x3821('0x6f')]=function(_0x30967e,_0x518493,_0x13579d,_0x425274,_0x14e97a,_0x4b7b56){var _0xbe7ba5,_0x2c095f,_0x3336ba,_0x4a8339;_0x4b7b56[_0x3821('0x4f')]=intUtil[_0x3821('0x4e')](_0x4b7b56['remoteUri']);_0x4b7b56[_0x3821('0x50')]=intUtil['stripTrailingSlash'](_0x4b7b56[_0x3821('0x50')]);def[_0x3821('0x66')]=util[_0x3821('0x1e')]('%s/service/v4_1/rest.php',_0x4b7b56[_0x3821('0x4f')]);if(_0x14e97a&&_0x14e97a[_0x3821('0x70')]){logger['info']('['+_0x518493['lastevent'][_0x3821('0x71')]()+']',_0x3821('0x6a'));_0x518493['recordingURL']=util[_0x3821('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b7b56[_0x3821('0x50')],_0x518493['uniqueid'],md5(_0x518493[_0x3821('0x54')]));}else{_0x518493[_0x3821('0x52')]='';}return getConnection(_0x4b7b56)['then'](function(_0xbe65de){_0x4a8339=_0xbe65de;if(!_[_0x3821('0x23')](_0x425274)){return getUser(_0x4b7b56,_0x425274[_0x3821('0x28')],_0x4a8339);}else{return getUser(_0x4b7b56,null,_0x4a8339);}})['then'](function(_0x234eb5){_0xbe7ba5=_0x234eb5;logger[_0x3821('0xa')](_0x3821('0x55'),_0xbe7ba5['id']);return getEndUser(_0x4b7b56,_0x518493['calleridname'],_0x518493[_0x3821('0x57')],_0x4a8339);})[_0x3821('0x29')](function(_0x4ce937){_0x2c095f=_0x4ce937;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2c095f['id']);return getTicket(_0x4b7b56,_0xbe7ba5,_0x2c095f,_0x13579d,_0x518493,_0x13579d['Fields'],_0x4a8339,_0x3821('0x59'));})[_0x3821('0x29')](function(_0x387666){_0x3336ba=_0x387666;logger['info'](_0x3821('0x5a'));logger[_0x3821('0xa')](_0x3821('0x5b'),_0x3336ba['id']);return setRelationship(_0x4a8339,_0xbe7ba5,_0x3336ba,_0x3821('0x5c'));})['then'](function(){return setRelationship(_0x4a8339,_0x2c095f,_0x3336ba,_0x3821('0x6c'));})[_0x3821('0x29')](function(){return getServerInfo(_0x4a8339);})[_0x3821('0x64')](function(_0x359341){logger[_0x3821('0x6e')]('['+_0x518493['lastevent'][_0x3821('0x71')]()+']',JSON[_0x3821('0x1c')](_0x359341));});}; \ No newline at end of file +var _0x1f44=['catch','error','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Fields','user:%s','trigger:browser:url','monitor_format','lastevent','recordingURL','isNil','calleridname','toUpperCase','lodash','bluebird','util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','Descriptions','date_start','toISOString','slice','duration_hours','direction','length','forEach','push','idField','variableName','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','customVariable','Variable','username','password','sessionID','set_relationship','stripTrailingSlash','remoteUri','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','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...'];(function(_0x3b267f,_0x2a7dd9){var _0x4c0cd8=function(_0x5c20c6){while(--_0x5c20c6){_0x3b267f['push'](_0x3b267f['shift']());}};_0x4c0cd8(++_0x2a7dd9);}(_0x1f44,0x83));var _0x41f4=function(_0xf34e,_0x5547db){_0xf34e=_0xf34e-0x0;var _0x23e1c7=_0x1f44[_0xf34e];return _0x23e1c7;};'use strict';var _=require(_0x41f4('0x0'));var rp=require('request-promise');var BPromise=require(_0x41f4('0x1'));var md5=require('md5');var util=require(_0x41f4('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x41f4('0x3'))(_0x41f4('0x4'));config[_0x41f4('0x5')]=_[_0x41f4('0x6')](config['redis'],{'host':_0x41f4('0x7'),'port':0x18eb});var io=require(_0x41f4('0x8'))(new Redis(config[_0x41f4('0x5')]));var def={'method':_0x41f4('0x9'),'json':!![]};function emit(_0x1790df,_0x5ae6d1,_0x398263){io['to'](_0x1790df)[_0x41f4('0xa')](_0x5ae6d1,_0x398263);}function getTicket(_0x1dfe4d,_0x37697e,_0x33ddc4,_0x45ab17,_0x4853df,_0x34a2fb,_0x1809dd,_0x5b9da5){logger[_0x41f4('0xb')](_0x41f4('0xc'));var _0x5651c7=new Date();var _0x73606a=[{'name':_0x41f4('0xd'),'value':intUtil['getString'](_0x45ab17[_0x41f4('0xe')],_0x4853df,'\x20')},{'name':_0x41f4('0xf'),'value':_0x37697e['id']},{'name':'created_by','value':_0x37697e['id']},{'name':'description','value':intUtil['getString'](_0x45ab17[_0x41f4('0x10')],_0x4853df,'\x0a')},{'name':_0x41f4('0x11'),'value':_0x5651c7[_0x41f4('0x12')]()[_0x41f4('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0x41f4('0x14'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x33ddc4['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x33ddc4[_0x41f4('0xd')]},{'name':_0x41f4('0x15'),'value':_0x5b9da5}];if(_0x34a2fb[_0x41f4('0x16')]){_[_0x41f4('0x17')](_0x34a2fb,function(_0x1730f3){if(_0x4853df[_0x1730f3['variableName']]){_0x73606a[_0x41f4('0x18')]({'name':_0x1730f3[_0x41f4('0x19')],'value':_0x4853df[_0x1730f3[_0x41f4('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x41f4('0x1b'),'response_type':_0x41f4('0x1b'),'rest_data':JSON['stringify']({'session':_0x1809dd['id'],'module_name':_0x41f4('0x1c'),'name_value_list':_0x73606a})}});}function getAuth(_0x494390){return util[_0x41f4('0x1d')](_0x41f4('0x1e'),new Buffer(_0x494390[_0x41f4('0x1f')]+':X')[_0x41f4('0x20')](_0x41f4('0x21')));}function getServerInfo(_0x119d57){return request({'form':{'method':_0x41f4('0x22'),'input_type':_0x41f4('0x1b'),'response_type':_0x41f4('0x1b'),'rest_data':JSON[_0x41f4('0x23')]({'session':_0x119d57['id']})}});}function getUser(_0x3c8b28,_0x323c98,_0x1eae4e){if(!_['isNil'](_0x323c98)){logger[_0x41f4('0xb')](_0x41f4('0x24'),_0x323c98);return request({'form':{'method':_0x41f4('0x25'),'input_type':_0x41f4('0x1b'),'response_type':_0x41f4('0x1b'),'rest_data':JSON[_0x41f4('0x23')]({'session':_0x1eae4e['id'],'module_name':_0x41f4('0x26'),'query':util[_0x41f4('0x1d')](_0x41f4('0x27'),_0x323c98),'order_by':'','offset':'0','select_fields':['id',_0x41f4('0xd'),_0x41f4('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x33f997){if(_0x33f997[_0x41f4('0x29')][_0x41f4('0x16')]){var _0x46ac8c=_[_0x41f4('0x2a')](_0x33f997[_0x41f4('0x29')],function(_0x147362){return _0x147362[_0x41f4('0x2b')][_0x41f4('0x28')][_0x41f4('0x2c')]===_0x323c98;});if(_0x46ac8c){logger[_0x41f4('0xb')]('Agent\x20found!');return BPromise[_0x41f4('0x2d')]({'id':_0x46ac8c[_0x41f4('0x2b')]['id'][_0x41f4('0x2c')],'name':_0x46ac8c[_0x41f4('0x2b')][_0x41f4('0xd')][_0x41f4('0x2c')]});}}logger[_0x41f4('0xb')](_0x41f4('0x2e'));return BPromise[_0x41f4('0x2d')]({'id':_0x1eae4e[_0x41f4('0x2b')][_0x41f4('0x2f')][_0x41f4('0x2c')],'name':_0x1eae4e[_0x41f4('0x2b')]['user_name'][_0x41f4('0x2c')]});});}else{logger[_0x41f4('0xb')](_0x41f4('0x30'));return BPromise[_0x41f4('0x2d')]({'id':_0x1eae4e[_0x41f4('0x2b')][_0x41f4('0x2f')][_0x41f4('0x2c')],'name':_0x1eae4e[_0x41f4('0x2b')]['user_name'][_0x41f4('0x2c')]});}}function getEndUser(_0x39db8c,_0x3b1865,_0x56b6f7,_0x31565d){logger['info'](_0x41f4('0x31'),_0x56b6f7);return request({'form':{'method':'get_entry_list','input_type':_0x41f4('0x1b'),'response_type':_0x41f4('0x1b'),'rest_data':JSON['stringify']({'session':_0x31565d['id'],'module_name':_0x41f4('0x32'),'query':util['format'](_0x41f4('0x33'),_0x56b6f7),'order_by':'','offset':'0','select_fields':['id',_0x41f4('0xd'),_0x41f4('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x41f4('0x35')](function(_0x5f217c){if(_0x5f217c[_0x41f4('0x29')][_0x41f4('0x16')]){var _0x4ee2a5=_[_0x41f4('0x2a')](_0x5f217c[_0x41f4('0x29')],function(_0x389142){return _0x389142[_0x41f4('0x2b')][_0x41f4('0x34')][_0x41f4('0x2c')]===_0x56b6f7;});if(_0x4ee2a5){logger[_0x41f4('0xb')](_0x41f4('0x36'));return BPromise[_0x41f4('0x2d')]({'id':_0x4ee2a5['name_value_list']['id'][_0x41f4('0x2c')],'name':_0x4ee2a5[_0x41f4('0x2b')][_0x41f4('0xd')]['value'],'phone':_0x4ee2a5[_0x41f4('0x2b')][_0x41f4('0x34')][_0x41f4('0x2c')]});}}else{logger['info'](_0x41f4('0x37'));return request({'form':{'method':_0x41f4('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x41f4('0x23')]({'session':_0x31565d['id'],'module_name':_0x41f4('0x32'),'name_value_list':[{'name':_0x41f4('0x39'),'value':_0x3b1865!==''?_0x3b1865:util[_0x41f4('0x1d')](_0x41f4('0x3a'),_0x56b6f7)},{'name':_0x41f4('0x34'),'value':_0x56b6f7}]})}})['then'](function(_0x4a52fc){logger[_0x41f4('0xb')](_0x41f4('0x3b'));return BPromise[_0x41f4('0x2d')]({'id':_0x4a52fc['id'],'name':_0x4a52fc[_0x41f4('0x29')][_0x41f4('0x39')][_0x41f4('0x2c')],'phone':_0x4a52fc[_0x41f4('0x29')]['phone_home'][_0x41f4('0x2c')]});});}});}function request(_0x4464e1){logger['debug'](_0x41f4('0x3c'),JSON[_0x41f4('0x23')](_0x4464e1));return rp(_[_0x41f4('0x3d')](def,_0x4464e1));}function getTags(_0x22a8b7,_0x314dfd){var _0x12e8eb=[];if(_0x22a8b7&&_0x22a8b7[_0x41f4('0x16')]>0x0){_0x12e8eb=_[_0x41f4('0x3e')](_0x22a8b7,_0x314dfd);}return _0x12e8eb;}function getCustomFields(_0x50eef5,_0x4e4f14){var _0x314797=[];var _0x1ae4ca={'custom_fields':[]};if(_0x50eef5['length']>0x0){_[_0x41f4('0x17')](_0x50eef5,function(_0x19b278){if(_0x19b278[_0x41f4('0x3f')]===_0x41f4('0x40')&&_0x19b278[_0x41f4('0x41')]&&!_0x19b278[_0x41f4('0x42')]){_0x1ae4ca[_0x19b278[_0x41f4('0x41')][_0x41f4('0x43')]()]=_0x19b278[_0x41f4('0x44')]['toString']();}else if(_0x19b278['type']===_0x41f4('0x40')&&_0x19b278[_0x41f4('0x19')]&&_0x19b278[_0x41f4('0x42')]){_0x1ae4ca[_0x41f4('0x45')][_0x41f4('0x18')]({'id':_0x19b278[_0x41f4('0x19')],'value':_0x19b278[_0x41f4('0x44')][_0x41f4('0x20')]()});}else if(_0x19b278[_0x41f4('0x3f')]==='variable'&&_0x19b278[_0x41f4('0x1a')]&&_0x19b278[_0x41f4('0x19')]&&_0x19b278[_0x41f4('0x42')]){_0x4e4f14[_0x19b278[_0x41f4('0x1a')]]&&_0x1ae4ca[_0x41f4('0x45')][_0x41f4('0x18')]({'id':_0x19b278['idField'],'value':_0x4e4f14[_0x19b278[_0x41f4('0x1a')]][_0x41f4('0x20')]()});}else if(_0x19b278[_0x41f4('0x3f')]===_0x41f4('0x46')&&_0x19b278[_0x41f4('0x47')]&&_0x19b278[_0x41f4('0x47')][_0x41f4('0xd')]&&_0x19b278[_0x41f4('0x19')]&&_0x19b278[_0x41f4('0x42')]){_0x4e4f14[_0x19b278[_0x41f4('0x47')][_0x41f4('0xd')]['toLowerCase']()]&&_0x1ae4ca['custom_fields'][_0x41f4('0x18')]({'id':_0x19b278['idField'],'value':_0x4e4f14[_0x19b278[_0x41f4('0x47')][_0x41f4('0xd')]['toLowerCase']()][_0x41f4('0x20')]()});}});}return _0x1ae4ca;}function getConnection(_0x1c5415){return request({'method':_0x41f4('0x9'),'form':{'method':'login','input_type':_0x41f4('0x1b'),'response_type':_0x41f4('0x1b'),'rest_data':JSON[_0x41f4('0x23')]({'user_auth':{'user_name':_0x1c5415[_0x41f4('0x48')],'password':_0x1c5415[_0x41f4('0x49')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x10327d){var _0x245129=_0x10327d;if(_0x245129['id']){def[_0x41f4('0x4a')]=_0x245129['id'];return BPromise[_0x41f4('0x2d')](_0x245129);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x1c5415['id']));}});}function setRelationship(_0x27bcd8,_0x2ef454,_0xe9a027,_0x388a0d){return request({'form':{'method':_0x41f4('0x4b'),'input_type':_0x41f4('0x1b'),'response_type':'JSON','rest_data':JSON[_0x41f4('0x23')]({'session':_0x27bcd8['id'],'module_name':_0x41f4('0x1c'),'module_id':_0xe9a027['id'],'link_field_name':_0x388a0d,'related_ids':[_0x2ef454['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x6dd925,_0x250061,_0xedc882,_0x55a2f8,_0x17fb77,_0x3014ab){var _0x57bcd7,_0x2f4e83,_0x4ac0f7,_0x5c6808;_0x3014ab['remoteUri']=intUtil[_0x41f4('0x4c')](_0x3014ab[_0x41f4('0x4d')]);_0x3014ab[_0x41f4('0x4e')]=intUtil[_0x41f4('0x4c')](_0x3014ab[_0x41f4('0x4e')]);def['uri']=util[_0x41f4('0x1d')]('%s/service/v4_1/rest.php',_0x3014ab['remoteUri']);if(_0x17fb77&&_0x17fb77['monitor_format']){logger[_0x41f4('0xb')](_0x41f4('0x4f'),_0x41f4('0x50'));_0x250061['recordingURL']=util['format'](_0x41f4('0x51'),_0x3014ab[_0x41f4('0x4e')],_0x250061[_0x41f4('0x52')],md5(_0x250061[_0x41f4('0x52')]));}else{_0x250061['recordingURL']='';}return getConnection(_0x3014ab)[_0x41f4('0x35')](function(_0x4877dd){_0x5c6808=_0x4877dd;return getUser(_0x3014ab,_0x55a2f8[_0x41f4('0xd')],_0x5c6808);})[_0x41f4('0x35')](function(_0xfe50c2){_0x57bcd7=_0xfe50c2;logger['info']('The\x20User\x20ID\x20is:',_0x57bcd7['id']);return getEndUser(_0x3014ab,_0x250061['calleridname'],_0x250061[_0x41f4('0x53')],_0x5c6808);})[_0x41f4('0x35')](function(_0x3e2987){_0x2f4e83=_0x3e2987;logger['info'](_0x41f4('0x54'),_0x2f4e83['id']);return getTicket(_0x3014ab,_0x57bcd7,_0x2f4e83,_0xedc882,_0x250061,_0xedc882['Fields'],_0x5c6808,_0x41f4('0x55'));})[_0x41f4('0x35')](function(_0x1d4a0e){_0x4ac0f7=_0x1d4a0e;logger[_0x41f4('0xb')](_0x41f4('0x56'));logger[_0x41f4('0xb')](_0x41f4('0x57'),_0x4ac0f7['id']);return setRelationship(_0x5c6808,_0x57bcd7,_0x4ac0f7,_0x41f4('0x58'));})[_0x41f4('0x35')](function(){return setRelationship(_0x5c6808,_0x2f4e83,_0x4ac0f7,_0x41f4('0x59'));})['then'](function(){return getServerInfo(_0x5c6808);})[_0x41f4('0x35')](function(_0x31410d){var _0x335b06=parseInt(_0x31410d[_0x41f4('0x5a')][_0x41f4('0x5b')](0x0));var _0x234d33=util['format'](_0x41f4('0x5c'),_0x3014ab[_0x41f4('0x4d')],_0x4ac0f7['id']);if(_0x335b06>0x6){_0x234d33=util[_0x41f4('0x1d')](_0x41f4('0x5d'),_0x3014ab[_0x41f4('0x4d')],_0x4ac0f7['id']);}logger[_0x41f4('0xb')]('[QUEUE]',_0x41f4('0x5e'));emit(util[_0x41f4('0x1d')]('user:%s',_0x55a2f8['name']),'trigger:browser:url',{'uri':_0x234d33});})[_0x41f4('0x5f')](function(_0x5bd37b){logger[_0x41f4('0x60')](_0x41f4('0x4f'),JSON['stringify'](_0x5bd37b));});};exports['outbound']=function(_0xa527a4,_0x56ce1a,_0x53570d,_0xc4122f,_0x3385a1,_0x4f25fa,_0x4ec5c3){var _0xdec3e8,_0x1616d5,_0x32518f,_0x3fa857;_0x4f25fa[_0x41f4('0x4d')]=intUtil[_0x41f4('0x4c')](_0x4f25fa[_0x41f4('0x4d')]);_0x4f25fa[_0x41f4('0x4e')]=intUtil['stripTrailingSlash'](_0x4f25fa['serverUrl']);def[_0x41f4('0x61')]=util['format'](_0x41f4('0x62'),_0x4f25fa[_0x41f4('0x4d')]);if(_0x4ec5c3&&_0x4ec5c3[_0x41f4('0x63')]&&_0x4ec5c3[_0x41f4('0x63')]!==_0x41f4('0x64')){logger['info'](_0x41f4('0x65'),'Recording\x20is\x20enabled!');_0x56ce1a['recordingURL']=util[_0x41f4('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4f25fa[_0x41f4('0x4e')],_0x56ce1a[_0x41f4('0x52')],md5(_0x56ce1a[_0x41f4('0x52')]));}return getConnection(_0x4f25fa)[_0x41f4('0x35')](function(_0x133050){_0x3fa857=_0x133050;return getUser(_0x4f25fa,_0xc4122f[_0x41f4('0xd')],_0x3fa857);})[_0x41f4('0x35')](function(_0x32ee27){_0xdec3e8=_0x32ee27;logger['info'](_0x41f4('0x66'),_0xdec3e8['id']);return getEndUser(_0x4f25fa,_0x56ce1a[_0x41f4('0x67')],_0x56ce1a['destcalleridnum'],_0x3fa857);})[_0x41f4('0x35')](function(_0xd5bf62){_0x1616d5=_0xd5bf62;logger['info'](_0x41f4('0x54'),_0x1616d5['id']);return getTicket(_0x4f25fa,_0xdec3e8,_0x1616d5,_0x53570d,_0x56ce1a,_0x53570d[_0x41f4('0x68')],_0x3fa857,'Outbound');})[_0x41f4('0x35')](function(_0x22f8b8){_0x32518f=_0x22f8b8;logger[_0x41f4('0xb')](_0x41f4('0x56'));logger['info'](_0x41f4('0x57'),_0x32518f['id']);return setRelationship(_0x3fa857,_0xdec3e8,_0x32518f,_0x41f4('0x58'));})['then'](function(){return setRelationship(_0x3fa857,_0x1616d5,_0x32518f,'contacts');})[_0x41f4('0x35')](function(){return getServerInfo(_0x3fa857);})['then'](function(_0x11eb1c){var _0x4b826a=parseInt(_0x11eb1c[_0x41f4('0x5a')][_0x41f4('0x5b')](0x0));var _0x3057e4=util['format'](_0x41f4('0x5c'),_0x4f25fa['remoteUri'],_0x32518f['id']);if(_0x4b826a>0x6){_0x3057e4=util[_0x41f4('0x1d')](_0x41f4('0x5d'),_0x4f25fa[_0x41f4('0x4d')],_0x32518f['id']);}logger[_0x41f4('0xb')](_0x41f4('0x65'),_0x41f4('0x5e'));emit(util[_0x41f4('0x1d')](_0x41f4('0x69'),_0xc4122f[_0x41f4('0xd')]),_0x41f4('0x6a'),{'uri':_0x3057e4});})[_0x41f4('0x5f')](function(_0x569d22){logger['error'](_0x41f4('0x65'),JSON['stringify'](_0x569d22));});};exports['unmanaged']=function(_0x4510f1,_0x4c18c1,_0x41ae1d,_0x3a0214,_0x22b7d4,_0x4dd820){var _0x2c5a3b,_0x595469,_0x1d4807,_0x5c51ee;_0x4dd820[_0x41f4('0x4d')]=intUtil[_0x41f4('0x4c')](_0x4dd820[_0x41f4('0x4d')]);_0x4dd820[_0x41f4('0x4e')]=intUtil['stripTrailingSlash'](_0x4dd820[_0x41f4('0x4e')]);def[_0x41f4('0x61')]=util[_0x41f4('0x1d')]('%s/service/v4_1/rest.php',_0x4dd820[_0x41f4('0x4d')]);if(_0x22b7d4&&_0x22b7d4[_0x41f4('0x6b')]){logger[_0x41f4('0xb')]('['+_0x4c18c1[_0x41f4('0x6c')]['toUpperCase']()+']',_0x41f4('0x50'));_0x4c18c1[_0x41f4('0x6d')]=util[_0x41f4('0x1d')](_0x41f4('0x51'),_0x4dd820['serverUrl'],_0x4c18c1[_0x41f4('0x52')],md5(_0x4c18c1[_0x41f4('0x52')]));}else{_0x4c18c1[_0x41f4('0x6d')]='';}return getConnection(_0x4dd820)[_0x41f4('0x35')](function(_0x2893e5){_0x5c51ee=_0x2893e5;if(!_[_0x41f4('0x6e')](_0x3a0214)){return getUser(_0x4dd820,_0x3a0214[_0x41f4('0xd')],_0x5c51ee);}else{return getUser(_0x4dd820,null,_0x5c51ee);}})[_0x41f4('0x35')](function(_0xef9154){_0x2c5a3b=_0xef9154;logger[_0x41f4('0xb')](_0x41f4('0x66'),_0x2c5a3b['id']);return getEndUser(_0x4dd820,_0x4c18c1[_0x41f4('0x6f')],_0x4c18c1['calleridnum'],_0x5c51ee);})[_0x41f4('0x35')](function(_0x5b63be){_0x595469=_0x5b63be;logger[_0x41f4('0xb')](_0x41f4('0x54'),_0x595469['id']);return getTicket(_0x4dd820,_0x2c5a3b,_0x595469,_0x41ae1d,_0x4c18c1,_0x41ae1d[_0x41f4('0x68')],_0x5c51ee,_0x41f4('0x55'));})[_0x41f4('0x35')](function(_0x2a5da0){_0x1d4807=_0x2a5da0;logger[_0x41f4('0xb')]('Ticket\x20created!');logger['info'](_0x41f4('0x57'),_0x1d4807['id']);return setRelationship(_0x5c51ee,_0x2c5a3b,_0x1d4807,_0x41f4('0x58'));})['then'](function(){return setRelationship(_0x5c51ee,_0x595469,_0x1d4807,'contacts');})[_0x41f4('0x35')](function(){return getServerInfo(_0x5c51ee);})['catch'](function(_0x56b9ce){logger[_0x41f4('0x60')]('['+_0x4c18c1[_0x41f4('0x6c')][_0x41f4('0x70')]()+']',JSON[_0x41f4('0x23')](_0x56b9ce));});}; \ 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 071251e..3427d47 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 _0xbe5d=['content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','string','format','%s:\x20%s','key','keyContent','keyType','join','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','push'];(function(_0xc508a2,_0x11be80){var _0x40743f=function(_0x3c1aca){while(--_0x3c1aca){_0xc508a2['push'](_0xc508a2['shift']());}};_0x40743f(++_0x11be80);}(_0xbe5d,0x13f));var _0xdbe5=function(_0x535720,_0x228406){_0x535720=_0x535720-0x0;var _0x12129b=_0xbe5d[_0x535720];return _0x12129b;};'use strict';var _=require(_0xdbe5('0x0'));var util=require('util');exports[_0xdbe5('0x1')]=function(_0x4fd338,_0x37bdda,_0xf9dbbb){var _0x365132=[];if(_0x4fd338[_0xdbe5('0x2')]>0x0){var _0x4810cb=_[_0xdbe5('0x3')](_0x4fd338,['id']);for(var _0x4038ba=0x0;_0x4038ba<_0x4810cb[_0xdbe5('0x2')];_0x4038ba++){var _0x4549e1=_0x4810cb[_0x4038ba];if(_0x4549e1['type']==='string'){_0x365132[_0xdbe5('0x4')](_0x4549e1[_0xdbe5('0x5')]);}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0x7')&&_0x4549e1['variableName']){_0x37bdda[_0x4549e1[_0xdbe5('0x8')]]&&_0x365132[_0xdbe5('0x4')](_0x37bdda[_0x4549e1[_0xdbe5('0x8')]][_0xdbe5('0x9')]());}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0xa')&&_0x4549e1[_0xdbe5('0xb')]&&_0x4549e1['Variable'][_0xdbe5('0xc')]){_0x37bdda[_0x4549e1['Variable'][_0xdbe5('0xc')][_0xdbe5('0xd')]()]&&_0x365132['push'](_0x37bdda[_0x4549e1['Variable'][_0xdbe5('0xc')][_0xdbe5('0xd')]()][_0xdbe5('0x9')]());}else if(_0x4549e1[_0xdbe5('0x6')]===_0xdbe5('0xe')){if(_0x4549e1['keyType']===_0xdbe5('0xf')&&_0x4549e1['key']){_0x365132[_0xdbe5('0x4')](util[_0xdbe5('0x10')](_0xdbe5('0x11'),_0x4549e1[_0xdbe5('0x12')],_0x4549e1[_0xdbe5('0x13')]));}else if(_0x4549e1[_0xdbe5('0x14')]==='variable'&&_0x4549e1[_0xdbe5('0x8')]&&_0x4549e1[_0xdbe5('0x12')]){_0x37bdda[_0x4549e1[_0xdbe5('0x8')]]&&_0x365132[_0xdbe5('0x4')](util['format'](_0xdbe5('0x11'),_0x4549e1['key'],_0x37bdda[_0x4549e1['variableName']]));}else if(_0x4549e1[_0xdbe5('0x14')]==='customVariable'&&_0x4549e1[_0xdbe5('0xb')]&&_0x4549e1[_0xdbe5('0xb')][_0xdbe5('0xc')]&&_0x4549e1[_0xdbe5('0x12')]){_0x37bdda[_0x4549e1[_0xdbe5('0xb')][_0xdbe5('0xc')]['toLowerCase']()]&&_0x365132[_0xdbe5('0x4')](util[_0xdbe5('0x10')](_0xdbe5('0x11'),_0x4549e1[_0xdbe5('0x12')],_0x37bdda[_0x4549e1[_0xdbe5('0xb')]['name']['toLowerCase']()]));}}}}return _0x365132[_0xdbe5('0x15')](_0xf9dbbb);};exports['stripTrailingSlash']=function(_0x5360d0){var _0x2b2484=_0x5360d0['slice'](-0x1);if(_0x2b2484==='/'){_0x5360d0=_0x5360d0[_0xdbe5('0x16')](0x0,_0x5360d0[_0xdbe5('0x17')](_0x2b2484));}return _0x5360d0;};exports[_0xdbe5('0x18')]=function(_0x43932c){if(!_[_0xdbe5('0x19')](_0x43932c)&&_0x43932c!==''){var _0x46ac33=/^(([^<>()\[\]\\.,;:\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 _0x46ac33[_0xdbe5('0x1a')](String(_0x43932c)[_0xdbe5('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x06ce=['substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','string','push','content','type','variable','variableName','Variable','name','toLowerCase','toString','key','format','%s:\x20%s','keyType','join','slice'];(function(_0x45d92d,_0x355c8d){var _0x3b638f=function(_0x237075){while(--_0x237075){_0x45d92d['push'](_0x45d92d['shift']());}};_0x3b638f(++_0x355c8d);}(_0x06ce,0xdd));var _0xe06c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x06ce[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xe06c('0x0'));var util=require(_0xe06c('0x1'));exports['getString']=function(_0x21bf3c,_0x3ef34f,_0x5b7fa5){var _0x38556f=[];if(_0x21bf3c[_0xe06c('0x2')]>0x0){var _0x5343d1=_['sortBy'](_0x21bf3c,['id']);for(var _0x322601=0x0;_0x322601<_0x5343d1[_0xe06c('0x2')];_0x322601++){var _0x23ffd9=_0x5343d1[_0x322601];if(_0x23ffd9['type']===_0xe06c('0x3')){_0x38556f[_0xe06c('0x4')](_0x23ffd9[_0xe06c('0x5')]);}else if(_0x23ffd9[_0xe06c('0x6')]===_0xe06c('0x7')&&_0x23ffd9[_0xe06c('0x8')]){_0x3ef34f[_0x23ffd9[_0xe06c('0x8')]]&&_0x38556f[_0xe06c('0x4')](_0x3ef34f[_0x23ffd9[_0xe06c('0x8')]]['toString']());}else if(_0x23ffd9['type']==='customVariable'&&_0x23ffd9[_0xe06c('0x9')]&&_0x23ffd9[_0xe06c('0x9')][_0xe06c('0xa')]){_0x3ef34f[_0x23ffd9[_0xe06c('0x9')][_0xe06c('0xa')][_0xe06c('0xb')]()]&&_0x38556f['push'](_0x3ef34f[_0x23ffd9[_0xe06c('0x9')]['name'][_0xe06c('0xb')]()][_0xe06c('0xc')]());}else if(_0x23ffd9[_0xe06c('0x6')]==='keyValue'){if(_0x23ffd9['keyType']==='string'&&_0x23ffd9[_0xe06c('0xd')]){_0x38556f[_0xe06c('0x4')](util[_0xe06c('0xe')](_0xe06c('0xf'),_0x23ffd9['key'],_0x23ffd9['keyContent']));}else if(_0x23ffd9['keyType']===_0xe06c('0x7')&&_0x23ffd9[_0xe06c('0x8')]&&_0x23ffd9[_0xe06c('0xd')]){_0x3ef34f[_0x23ffd9[_0xe06c('0x8')]]&&_0x38556f['push'](util[_0xe06c('0xe')](_0xe06c('0xf'),_0x23ffd9['key'],_0x3ef34f[_0x23ffd9['variableName']]));}else if(_0x23ffd9[_0xe06c('0x10')]==='customVariable'&&_0x23ffd9[_0xe06c('0x9')]&&_0x23ffd9['Variable'][_0xe06c('0xa')]&&_0x23ffd9['key']){_0x3ef34f[_0x23ffd9[_0xe06c('0x9')][_0xe06c('0xa')]['toLowerCase']()]&&_0x38556f[_0xe06c('0x4')](util['format'](_0xe06c('0xf'),_0x23ffd9[_0xe06c('0xd')],_0x3ef34f[_0x23ffd9['Variable'][_0xe06c('0xa')][_0xe06c('0xb')]()]));}}}}return _0x38556f[_0xe06c('0x11')](_0x5b7fa5);};exports['stripTrailingSlash']=function(_0x5528ce){var _0x3485ac=_0x5528ce[_0xe06c('0x12')](-0x1);if(_0x3485ac==='/'){_0x5528ce=_0x5528ce[_0xe06c('0x13')](0x0,_0x5528ce[_0xe06c('0x14')](_0x3485ac));}return _0x5528ce;};exports[_0xe06c('0x15')]=function(_0x2f4f9d){if(!_[_0xe06c('0x16')](_0x2f4f9d)&&_0x2f4f9d!==''){var _0x5569d5=/^(([^<>()\[\]\\.,;:\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 _0x5569d5[_0xe06c('0x17')](String(_0x2f4f9d)[_0xe06c('0xb')]());}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 21d4241..01cddea 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 _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(_0x5a8b13,_0x5ed93c){var _0x3149f9=function(_0x7271a6){while(--_0x7271a6){_0x5a8b13['push'](_0x5a8b13['shift']());}};_0x3149f9(++_0x5ed93c);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'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 +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(_0x3a5a47,_0x9651a9){var _0x35bfff=function(_0x2cbc91){while(--_0x2cbc91){_0x3a5a47['push'](_0x3a5a47['shift']());}};_0x35bfff(++_0x9651a9);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 ac34257..9fdfe61 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 _0xe4d1=['user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[OUTBOUND]','replace','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','GET','length','forEach','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','push','variable','variableName','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x4ac08e,_0x41f6d3){var _0x54f169=function(_0x23779a){while(--_0x23779a){_0x4ac08e['push'](_0x4ac08e['shift']());}};_0x54f169(++_0x41f6d3);}(_0xe4d1,0x86));var _0x1e4d=function(_0x5e0496,_0x160308){_0x5e0496=_0x5e0496-0x0;var _0x4fe243=_0xe4d1[_0x5e0496];return _0x4fe243;};'use strict';var _=require(_0x1e4d('0x0'));var rp=require('request-promise');var md5=require(_0x1e4d('0x1'));var util=require(_0x1e4d('0x2'));var Redis=require(_0x1e4d('0x3'));var intUtil=require(_0x1e4d('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1e4d('0x5'));config[_0x1e4d('0x6')]=_[_0x1e4d('0x7')](config[_0x1e4d('0x6')],{'host':_0x1e4d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3701e0,_0x168783,_0x109fc9){io['to'](_0x3701e0)[_0x1e4d('0x9')](_0x168783,_0x109fc9);}var headers={'Content-Type':_0x1e4d('0xa'),'Accept':_0x1e4d('0xa')};function getTicket(_0x318b60,_0x586128,_0x1fa0bf,_0x1d920e,_0x19554a){logger['info'](_0x1e4d('0xb'));return request({'uri':util[_0x1e4d('0xc')]('%s/tickets.json',_0x318b60[_0x1e4d('0xd')]),'method':_0x1e4d('0xe'),'body':{'ticket':_[_0x1e4d('0xf')]({'requester_id':_0x1fa0bf['id'],'submitter_id':_0x586128?_0x586128['id']:undefined,'assignee_id':_0x586128?_0x586128['id']:undefined,'tags':getTags(_0x1d920e[_0x1e4d('0x10')],'name'),'subject':intUtil[_0x1e4d('0x11')](_0x1d920e[_0x1e4d('0x12')],_0x19554a,'\x20'),'description':intUtil[_0x1e4d('0x11')](_0x1d920e['Descriptions'],_0x19554a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1e4d('0x11')](_0x1d920e[_0x1e4d('0x13')],_0x19554a,'\x0a')}},getCustomFields(_0x1d920e['Fields'],_0x19554a))}})[_0x1e4d('0x14')](function(_0xc245c7){logger[_0x1e4d('0x15')](_0x1e4d('0x16'));return _0xc245c7[_0x1e4d('0x17')];});}function getUser(_0x2b21dc,_0x1da568){if(intUtil[_0x1e4d('0x18')](_0x1da568)){logger[_0x1e4d('0x15')](_0x1e4d('0x19'),_0x1da568);return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x1a'),_0x2b21dc[_0x1e4d('0xd')]),'qs':{'query':util[_0x1e4d('0xc')](_0x1e4d('0x1b'),_0x1da568)}})['then'](function(_0x51c79e){if(_0x51c79e['count']){logger[_0x1e4d('0x15')](_0x1e4d('0x1c'));return _[_0x1e4d('0x1d')](_0x51c79e[_0x1e4d('0x1e')],{'email':_0x1da568,'role':_0x1e4d('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x1e4d('0x20'),_0x2b21dc[_0x1e4d('0xd')])})[_0x1e4d('0x14')](function(_0x2a2efe){logger['info'](_0x1e4d('0x21'));return _0x2a2efe[_0x1e4d('0x22')];});}});}else{logger['info'](_0x1e4d('0x23'));return request({'uri':util['format'](_0x1e4d('0x20'),_0x2b21dc[_0x1e4d('0xd')])})[_0x1e4d('0x14')](function(_0x557b54){logger['info'](_0x1e4d('0x21'));return _0x557b54['user'];});}}function getEndUser(_0xa417cb,_0x42e121,_0x4d44c8){logger['info'](_0x1e4d('0x24'),_0x4d44c8);return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x1a'),_0xa417cb[_0x1e4d('0xd')]),'qs':{'query':util['format'](_0x1e4d('0x25'),_0x4d44c8)}})[_0x1e4d('0x14')](function(_0x1e8413){var _0x57c0a5;if(_0x1e8413['results']['length']){_0x1e8413[_0x1e4d('0x1e')]=_[_0x1e4d('0x26')](_0x1e8413[_0x1e4d('0x1e')],{'suspended':![],'role':_0x1e4d('0x27')});if(_0x1e8413[_0x1e4d('0x1e')]['length']){_0x57c0a5=_['first'](_0x1e8413[_0x1e4d('0x1e')]);}}if(_0x57c0a5){logger[_0x1e4d('0x15')](_0x1e4d('0x28'));return _0x57c0a5;}else{logger[_0x1e4d('0x15')](_0x1e4d('0x29'));return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x2a'),_0xa417cb[_0x1e4d('0xd')]),'method':_0x1e4d('0xe'),'body':{'user':{'role':_0x1e4d('0x27'),'name':util[_0x1e4d('0xc')](_0x1e4d('0x2b'),_0x42e121||_0x4d44c8),'phone':_0x4d44c8}}})[_0x1e4d('0x14')](function(_0x1d590c){logger[_0x1e4d('0x15')](_0x1e4d('0x2c'));return _0x1d590c['user'];});}});}function getAuth(_0x2084c3){var _0x244f26;if(_0x2084c3[_0x1e4d('0x2d')]===_0x1e4d('0x2e')){_0x244f26=util[_0x1e4d('0xc')](_0x1e4d('0x2f'),_0x2084c3['username'],_0x2084c3[_0x1e4d('0x2e')]);}else if(_0x2084c3[_0x1e4d('0x2d')]===_0x1e4d('0x30')){_0x244f26=util[_0x1e4d('0xc')](_0x1e4d('0x31'),_0x2084c3[_0x1e4d('0x32')],_0x2084c3['token']);}return util[_0x1e4d('0xc')](_0x1e4d('0x33'),new Buffer(_0x244f26)[_0x1e4d('0x34')](_0x1e4d('0x35')));}function request(_0xbe0c23){logger[_0x1e4d('0x36')](_0x1e4d('0x37'),JSON['stringify'](_0xbe0c23));return rp(_[_0x1e4d('0x7')](_0xbe0c23,{'method':_0x1e4d('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x2c8d33,_0x39a16f){var _0xa666b2=[];if(_0x2c8d33&&_0x2c8d33[_0x1e4d('0x39')]>0x0){_0xa666b2=_['map'](_0x2c8d33,_0x39a16f);}return _0xa666b2;}function getCustomFields(_0x47c241,_0x28f89b){var _0x16c21d=[];var _0x2dd906={'custom_fields':[]};if(_0x47c241[_0x1e4d('0x39')]>0x0){_[_0x1e4d('0x3a')](_0x47c241,function(_0x27f60e){if(_[_0x1e4d('0x3b')]([_0x1e4d('0x3c'),_0x1e4d('0x3d')],_0x27f60e[_0x1e4d('0x3e')])&&_0x27f60e[_0x1e4d('0x3f')]&&!_0x27f60e[_0x1e4d('0x40')]){_0x2dd906[_0x27f60e[_0x1e4d('0x3f')]['toLowerCase']()]=_0x27f60e[_0x1e4d('0x41')]['toString']();}else if(_[_0x1e4d('0x3b')](['string',_0x1e4d('0x3d')],_0x27f60e[_0x1e4d('0x3e')])&&_0x27f60e[_0x1e4d('0x42')]&&_0x27f60e[_0x1e4d('0x40')]){_0x2dd906[_0x1e4d('0x43')][_0x1e4d('0x44')]({'id':_0x27f60e[_0x1e4d('0x42')],'value':_0x27f60e[_0x1e4d('0x41')]['toString']()});}else if(_0x27f60e[_0x1e4d('0x3e')]===_0x1e4d('0x45')&&_0x27f60e['variableName']&&_0x27f60e['idField']&&_0x27f60e[_0x1e4d('0x40')]){_0x28f89b[_0x27f60e[_0x1e4d('0x46')]]&&_0x2dd906['custom_fields']['push']({'id':_0x27f60e['idField'],'value':_0x28f89b[_0x27f60e['variableName']][_0x1e4d('0x34')]()});}else if(_0x27f60e[_0x1e4d('0x3e')]==='customVariable'&&_0x27f60e[_0x1e4d('0x47')]&&_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')]&&_0x27f60e['idField']&&_0x27f60e['customField']){_0x28f89b[_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')][_0x1e4d('0x49')]()]&&_0x2dd906[_0x1e4d('0x43')][_0x1e4d('0x44')]({'id':_0x27f60e[_0x1e4d('0x42')],'value':_0x28f89b[_0x27f60e[_0x1e4d('0x47')][_0x1e4d('0x48')][_0x1e4d('0x49')]()][_0x1e4d('0x34')]()});}});}return _0x2dd906;}exports['queue']=function(_0x4fc719,_0xe90cb8,_0x274149,_0x4d8438,_0x94c65f,_0x4e6e7a){var _0x20a783,_0x2f6d28;_0x4e6e7a[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0x4e6e7a[_0x1e4d('0xd')]);_0x4e6e7a[_0x1e4d('0x4b')]=intUtil['stripTrailingSlash'](_0x4e6e7a[_0x1e4d('0x4b')]);if(_0x94c65f&&_0x94c65f[_0x1e4d('0x4c')]){logger[_0x1e4d('0x15')](_0x1e4d('0x4d'),_0x1e4d('0x4e'));_0xe90cb8[_0x1e4d('0x4f')]=util[_0x1e4d('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e6e7a[_0x1e4d('0x4b')],_0xe90cb8[_0x1e4d('0x50')],md5(_0xe90cb8[_0x1e4d('0x50')]));}else{_0xe90cb8[_0x1e4d('0x4f')]='';}headers[_0x1e4d('0x51')]=getAuth(_0x4e6e7a);return getUser(_0x4e6e7a,_0x4d8438[_0x1e4d('0x52')])[_0x1e4d('0x14')](function(_0x294d24){_0x20a783=_0x294d24;logger[_0x1e4d('0x15')]('The\x20User\x20ID\x20is:',_0x20a783['id']);return getEndUser(_0x4e6e7a,_0xe90cb8[_0x1e4d('0x53')],_0xe90cb8[_0x1e4d('0x54')]);})['then'](function(_0x40e8d9){_0x2f6d28=_0x40e8d9;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2f6d28['id']);return getTicket(_0x4e6e7a,_0x20a783,_0x2f6d28,_0x274149,_0xe90cb8);})['then'](function(_0xf16f42){if(_0xf16f42){logger['info'](_0x1e4d('0x56'),_0xf16f42['id']);switch(_0x4e6e7a[_0x1e4d('0x3e')]){case _0x1e4d('0x57'):logger[_0x1e4d('0x15')](_0x1e4d('0x4d'),_0x1e4d('0x58'));return request({'uri':util[_0x1e4d('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e6e7a[_0x1e4d('0xd')],_0x20a783['id'],_0xf16f42['id']),'method':_0x1e4d('0xe')});case'newTab':logger[_0x1e4d('0x15')]('[QUEUE]',_0x1e4d('0x59'));emit(util[_0x1e4d('0xc')](_0x1e4d('0x5a'),_0x4d8438['name']),_0x1e4d('0x5b'),{'uri':util[_0x1e4d('0xc')](_0x1e4d('0x5c'),_0x4e6e7a[_0x1e4d('0xd')]['replace'](_0x1e4d('0x5d'),''),_0xf16f42['id'])});break;default:logger[_0x1e4d('0x5e')](_0x1e4d('0x4d'),_0x1e4d('0x5f'));}}})[_0x1e4d('0x60')](function(_0x50d497){logger[_0x1e4d('0x5e')](_0x1e4d('0x61'),util[_0x1e4d('0x62')](_0x50d497,{'showHidden':!![],'depth':null}));});};exports[_0x1e4d('0x63')]=function(_0x12f6c1,_0x3752c5,_0x2b8db6,_0x229b7b,_0x5aafac,_0x33d819,_0x195a9b){var _0x5b1b88,_0x2655c5;_0x33d819[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0x33d819[_0x1e4d('0xd')]);_0x33d819[_0x1e4d('0x4b')]=intUtil[_0x1e4d('0x4a')](_0x33d819[_0x1e4d('0x4b')]);if(_0x195a9b&&_0x195a9b[_0x1e4d('0x64')]&&_0x195a9b['recordingFormat']!==_0x1e4d('0x65')){logger[_0x1e4d('0x15')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3752c5[_0x1e4d('0x4f')]=util[_0x1e4d('0xc')](_0x1e4d('0x66'),_0x33d819['serverUrl'],_0x3752c5[_0x1e4d('0x50')],md5(_0x3752c5[_0x1e4d('0x50')]));}headers['Authorization']=getAuth(_0x33d819);return getUser(_0x33d819,_0x229b7b['email'])[_0x1e4d('0x14')](function(_0x231af4){_0x5b1b88=_0x231af4;logger['info'](_0x1e4d('0x67'),_0x5b1b88['id']);return getEndUser(_0x33d819,_0x3752c5[_0x1e4d('0x68')],_0x3752c5['destcalleridnum']);})[_0x1e4d('0x14')](function(_0x4142f4){_0x2655c5=_0x4142f4;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2655c5['id']);return getTicket(_0x33d819,_0x5b1b88,_0x2655c5,_0x2b8db6,_0x3752c5);})[_0x1e4d('0x14')](function(_0x539a96){if(_0x539a96){logger[_0x1e4d('0x15')](_0x1e4d('0x56'),_0x539a96['id']);switch(_0x33d819[_0x1e4d('0x3e')]){case _0x1e4d('0x57'):logger[_0x1e4d('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1e4d('0xc')](_0x1e4d('0x69'),_0x33d819[_0x1e4d('0xd')],_0x5b1b88['id'],_0x539a96['id']),'method':_0x1e4d('0xe')});case _0x1e4d('0x6a'):logger['info'](_0x1e4d('0x6b'),_0x1e4d('0x59'));emit(util[_0x1e4d('0xc')](_0x1e4d('0x5a'),_0x229b7b['name']),_0x1e4d('0x5b'),{'uri':util[_0x1e4d('0xc')]('%s/agent/tickets/%s',_0x33d819[_0x1e4d('0xd')][_0x1e4d('0x6c')](_0x1e4d('0x5d'),''),_0x539a96['id'])});break;default:logger[_0x1e4d('0x5e')]('[OUTBOUND]',_0x1e4d('0x5f'));}}})[_0x1e4d('0x60')](function(_0x4ca3cd){logger[_0x1e4d('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x1e4d('0x62')](_0x4ca3cd,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2a5c3b,_0x5470cd,_0x4b8362,_0x58c6c8,_0x4256e1,_0xfed559){var _0x5b272a,_0x2aeeec;_0xfed559[_0x1e4d('0xd')]=intUtil[_0x1e4d('0x4a')](_0xfed559[_0x1e4d('0xd')]);_0xfed559[_0x1e4d('0x4b')]=intUtil[_0x1e4d('0x4a')](_0xfed559[_0x1e4d('0x4b')]);if(_0x4256e1&&_0x4256e1[_0x1e4d('0x4c')]){logger[_0x1e4d('0x15')]('['+_0x5470cd[_0x1e4d('0x6d')][_0x1e4d('0x6e')]()+']',_0x1e4d('0x4e'));_0x5470cd[_0x1e4d('0x4f')]=util['format'](_0x1e4d('0x66'),_0xfed559[_0x1e4d('0x4b')],_0x5470cd['uniqueid'],md5(_0x5470cd[_0x1e4d('0x50')]));}else{_0x5470cd[_0x1e4d('0x4f')]='';}headers['Authorization']=getAuth(_0xfed559);return getUser(_0xfed559)['then'](function(_0x5f14ac){_0x5b272a=_0x5f14ac;logger[_0x1e4d('0x15')](_0x1e4d('0x67'),_0x5b272a['id']);return getEndUser(_0xfed559,_0x5470cd['calleridname'],_0x5470cd[_0x1e4d('0x54')]);})[_0x1e4d('0x14')](function(_0x3a9584){_0x2aeeec=_0x3a9584;logger[_0x1e4d('0x15')](_0x1e4d('0x55'),_0x2aeeec['id']);return getTicket(_0xfed559,_0x5b272a,_0x2aeeec,_0x4b8362,_0x5470cd);})[_0x1e4d('0x14')](function(_0x3ac20f){if(_0x3ac20f){logger[_0x1e4d('0x15')](_0x1e4d('0x56'),_0x3ac20f['id']);}})[_0x1e4d('0x60')](function(_0x40d53a){logger[_0x1e4d('0x5e')]('['+_0x5470cd[_0x1e4d('0x6d')][_0x1e4d('0x6e')]()+']'+_0x1e4d('0x6f'),util[_0x1e4d('0x62')](_0x40d53a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb29d=['push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','integrationTab','newTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','catch','toUpperCase','lodash','request-promise','ioredis','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','forEach','includes','string','picklist','type','customField','toLowerCase','content','idField','custom_fields','variableName'];(function(_0x2e321c,_0xcf2b71){var _0xc40bca=function(_0x54a7a6){while(--_0x54a7a6){_0x2e321c['push'](_0x2e321c['shift']());}};_0xc40bca(++_0xcf2b71);}(_0xb29d,0x1f3));var _0xdb29=function(_0x2b64fd,_0x332e9c){_0x2b64fd=_0x2b64fd-0x0;var _0x4e9130=_0xb29d[_0x2b64fd];return _0x4e9130;};'use strict';var _=require(_0xdb29('0x0'));var rp=require(_0xdb29('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xdb29('0x2'));var intUtil=require('./util');var config=require(_0xdb29('0x3'));var logger=require('../../../../config/logger')(_0xdb29('0x4'));config[_0xdb29('0x5')]=_[_0xdb29('0x6')](config[_0xdb29('0x5')],{'host':_0xdb29('0x7'),'port':0x18eb});var io=require(_0xdb29('0x8'))(new Redis(config[_0xdb29('0x5')]));function emit(_0x4c947a,_0x41a690,_0x4b5d8d){io['to'](_0x4c947a)[_0xdb29('0x9')](_0x41a690,_0x4b5d8d);}var headers={'Content-Type':_0xdb29('0xa'),'Accept':'application/json'};function getTicket(_0x369671,_0x1b3961,_0x59699b,_0x27e6d0,_0x19dcf4){logger[_0xdb29('0xb')](_0xdb29('0xc'));return request({'uri':util[_0xdb29('0xd')](_0xdb29('0xe'),_0x369671[_0xdb29('0xf')]),'method':_0xdb29('0x10'),'body':{'ticket':_[_0xdb29('0x11')]({'requester_id':_0x59699b['id'],'submitter_id':_0x1b3961?_0x1b3961['id']:undefined,'assignee_id':_0x1b3961?_0x1b3961['id']:undefined,'tags':getTags(_0x27e6d0['Tags'],_0xdb29('0x12')),'subject':intUtil[_0xdb29('0x13')](_0x27e6d0[_0xdb29('0x14')],_0x19dcf4,'\x20'),'description':intUtil['getString'](_0x27e6d0[_0xdb29('0x15')],_0x19dcf4,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x27e6d0[_0xdb29('0x15')],_0x19dcf4,'\x0a')}},getCustomFields(_0x27e6d0[_0xdb29('0x16')],_0x19dcf4))}})[_0xdb29('0x17')](function(_0x1485ec){logger[_0xdb29('0xb')](_0xdb29('0x18'));return _0x1485ec[_0xdb29('0x19')];});}function getUser(_0x3db17d,_0x142411){if(intUtil[_0xdb29('0x1a')](_0x142411)){logger['info'](_0xdb29('0x1b'),_0x142411);return request({'uri':util[_0xdb29('0xd')](_0xdb29('0x1c'),_0x3db17d['remoteUri']),'qs':{'query':util[_0xdb29('0xd')](_0xdb29('0x1d'),_0x142411)}})[_0xdb29('0x17')](function(_0x61af39){if(_0x61af39[_0xdb29('0x1e')]){logger[_0xdb29('0xb')](_0xdb29('0x1f'));return _[_0xdb29('0x20')](_0x61af39[_0xdb29('0x21')],{'email':_0x142411,'role':_0xdb29('0x22')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3db17d['remoteUri'])})[_0xdb29('0x17')](function(_0x5aa198){logger[_0xdb29('0xb')](_0xdb29('0x23'));return _0x5aa198['user'];});}});}else{logger[_0xdb29('0xb')](_0xdb29('0x24'));return request({'uri':util[_0xdb29('0xd')]('%s/users/me.json',_0x3db17d[_0xdb29('0xf')])})[_0xdb29('0x17')](function(_0x39bf03){logger[_0xdb29('0xb')](_0xdb29('0x23'));return _0x39bf03['user'];});}}function getEndUser(_0x442172,_0xcd2cad,_0x274b96){logger['info'](_0xdb29('0x25'),_0x274b96);return request({'uri':util['format'](_0xdb29('0x1c'),_0x442172[_0xdb29('0xf')]),'qs':{'query':util[_0xdb29('0xd')](_0xdb29('0x26'),_0x274b96)}})[_0xdb29('0x17')](function(_0x598075){var _0x8ccd88;if(_0x598075[_0xdb29('0x21')][_0xdb29('0x27')]){_0x598075[_0xdb29('0x21')]=_[_0xdb29('0x28')](_0x598075[_0xdb29('0x21')],{'suspended':![],'role':'end-user'});if(_0x598075[_0xdb29('0x21')]['length']){_0x8ccd88=_[_0xdb29('0x29')](_0x598075[_0xdb29('0x21')]);}}if(_0x8ccd88){logger[_0xdb29('0xb')](_0xdb29('0x2a'));return _0x8ccd88;}else{logger[_0xdb29('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdb29('0xd')](_0xdb29('0x2b'),_0x442172[_0xdb29('0xf')]),'method':_0xdb29('0x10'),'body':{'user':{'role':_0xdb29('0x2c'),'name':util[_0xdb29('0xd')](_0xdb29('0x2d'),_0xcd2cad||_0x274b96),'phone':_0x274b96}}})['then'](function(_0x2655d4){logger[_0xdb29('0xb')](_0xdb29('0x2e'));return _0x2655d4['user'];});}});}function getAuth(_0x6567fb){var _0x3b6e85;if(_0x6567fb['authType']===_0xdb29('0x2f')){_0x3b6e85=util[_0xdb29('0xd')](_0xdb29('0x30'),_0x6567fb[_0xdb29('0x31')],_0x6567fb[_0xdb29('0x2f')]);}else if(_0x6567fb[_0xdb29('0x32')]===_0xdb29('0x33')){_0x3b6e85=util[_0xdb29('0xd')](_0xdb29('0x34'),_0x6567fb['username'],_0x6567fb[_0xdb29('0x33')]);}return util[_0xdb29('0xd')](_0xdb29('0x35'),new Buffer(_0x3b6e85)[_0xdb29('0x36')](_0xdb29('0x37')));}function request(_0x2b2d15){logger[_0xdb29('0x38')]('[HTTP]',JSON[_0xdb29('0x39')](_0x2b2d15));return rp(_[_0xdb29('0x6')](_0x2b2d15,{'method':_0xdb29('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x1127a2,_0xd0215b){var _0x4451e0=[];if(_0x1127a2&&_0x1127a2[_0xdb29('0x27')]>0x0){_0x4451e0=_[_0xdb29('0x3b')](_0x1127a2,_0xd0215b);}return _0x4451e0;}function getCustomFields(_0x2836fd,_0x34cbe6){var _0x26e368=[];var _0x2dbc99={'custom_fields':[]};if(_0x2836fd[_0xdb29('0x27')]>0x0){_[_0xdb29('0x3c')](_0x2836fd,function(_0x5c3dca){if(_[_0xdb29('0x3d')]([_0xdb29('0x3e'),_0xdb29('0x3f')],_0x5c3dca[_0xdb29('0x40')])&&_0x5c3dca['nameField']&&!_0x5c3dca[_0xdb29('0x41')]){_0x2dbc99[_0x5c3dca['nameField'][_0xdb29('0x42')]()]=_0x5c3dca[_0xdb29('0x43')][_0xdb29('0x36')]();}else if(_[_0xdb29('0x3d')]([_0xdb29('0x3e'),'picklist'],_0x5c3dca['type'])&&_0x5c3dca[_0xdb29('0x44')]&&_0x5c3dca['customField']){_0x2dbc99[_0xdb29('0x45')]['push']({'id':_0x5c3dca[_0xdb29('0x44')],'value':_0x5c3dca['content']['toString']()});}else if(_0x5c3dca['type']==='variable'&&_0x5c3dca['variableName']&&_0x5c3dca[_0xdb29('0x44')]&&_0x5c3dca[_0xdb29('0x41')]){_0x34cbe6[_0x5c3dca[_0xdb29('0x46')]]&&_0x2dbc99[_0xdb29('0x45')][_0xdb29('0x47')]({'id':_0x5c3dca['idField'],'value':_0x34cbe6[_0x5c3dca[_0xdb29('0x46')]][_0xdb29('0x36')]()});}else if(_0x5c3dca['type']===_0xdb29('0x48')&&_0x5c3dca[_0xdb29('0x49')]&&_0x5c3dca[_0xdb29('0x49')][_0xdb29('0x12')]&&_0x5c3dca[_0xdb29('0x44')]&&_0x5c3dca['customField']){_0x34cbe6[_0x5c3dca[_0xdb29('0x49')][_0xdb29('0x12')]['toLowerCase']()]&&_0x2dbc99[_0xdb29('0x45')][_0xdb29('0x47')]({'id':_0x5c3dca[_0xdb29('0x44')],'value':_0x34cbe6[_0x5c3dca[_0xdb29('0x49')]['name']['toLowerCase']()][_0xdb29('0x36')]()});}});}return _0x2dbc99;}exports[_0xdb29('0x4a')]=function(_0x3d91f3,_0x1213ee,_0x5ddf02,_0x96e3fb,_0x83fef4,_0x5df05d){var _0x3399d7,_0x55456f;_0x5df05d[_0xdb29('0xf')]=intUtil['stripTrailingSlash'](_0x5df05d[_0xdb29('0xf')]);_0x5df05d[_0xdb29('0x4b')]=intUtil[_0xdb29('0x4c')](_0x5df05d[_0xdb29('0x4b')]);if(_0x83fef4&&_0x83fef4[_0xdb29('0x4d')]){logger[_0xdb29('0xb')]('[QUEUE]',_0xdb29('0x4e'));_0x1213ee[_0xdb29('0x4f')]=util[_0xdb29('0xd')](_0xdb29('0x50'),_0x5df05d[_0xdb29('0x4b')],_0x1213ee[_0xdb29('0x51')],md5(_0x1213ee['uniqueid']));}else{_0x1213ee['recordingURL']='';}headers[_0xdb29('0x52')]=getAuth(_0x5df05d);return getUser(_0x5df05d,_0x96e3fb['email'])[_0xdb29('0x17')](function(_0x4f8e42){_0x3399d7=_0x4f8e42;logger[_0xdb29('0xb')](_0xdb29('0x53'),_0x3399d7['id']);return getEndUser(_0x5df05d,_0x1213ee['calleridname'],_0x1213ee[_0xdb29('0x54')]);})[_0xdb29('0x17')](function(_0x5db0c6){_0x55456f=_0x5db0c6;logger['info'](_0xdb29('0x55'),_0x55456f['id']);return getTicket(_0x5df05d,_0x3399d7,_0x55456f,_0x5ddf02,_0x1213ee);})[_0xdb29('0x17')](function(_0x4daf34){if(_0x4daf34){logger[_0xdb29('0xb')](_0xdb29('0x56'),_0x4daf34['id']);switch(_0x5df05d[_0xdb29('0x40')]){case'integrationTab':logger[_0xdb29('0xb')](_0xdb29('0x57'),_0xdb29('0x58'));return request({'uri':util[_0xdb29('0xd')](_0xdb29('0x59'),_0x5df05d['remoteUri'],_0x3399d7['id'],_0x4daf34['id']),'method':_0xdb29('0x10')});case'newTab':logger[_0xdb29('0xb')]('[QUEUE]',_0xdb29('0x5a'));emit(util['format']('user:%s',_0x96e3fb[_0xdb29('0x12')]),_0xdb29('0x5b'),{'uri':util[_0xdb29('0xd')](_0xdb29('0x5c'),_0x5df05d['remoteUri'][_0xdb29('0x5d')](_0xdb29('0x5e'),''),_0x4daf34['id'])});break;default:logger['error'](_0xdb29('0x57'),_0xdb29('0x5f'));}}})['catch'](function(_0x4d7af2){logger[_0xdb29('0x60')](_0xdb29('0x61'),util[_0xdb29('0x62')](_0x4d7af2,{'showHidden':!![],'depth':null}));});};exports[_0xdb29('0x63')]=function(_0x35add6,_0x40679b,_0x16aaca,_0x5baea6,_0x456849,_0x16e7d6,_0x1018a2){var _0x409d81,_0x4600f6;_0x16e7d6['remoteUri']=intUtil[_0xdb29('0x4c')](_0x16e7d6[_0xdb29('0xf')]);_0x16e7d6[_0xdb29('0x4b')]=intUtil[_0xdb29('0x4c')](_0x16e7d6['serverUrl']);if(_0x1018a2&&_0x1018a2[_0xdb29('0x64')]&&_0x1018a2[_0xdb29('0x64')]!==_0xdb29('0x65')){logger[_0xdb29('0xb')](_0xdb29('0x66'),'Recording\x20is\x20enabled!');_0x40679b[_0xdb29('0x4f')]=util[_0xdb29('0xd')](_0xdb29('0x50'),_0x16e7d6[_0xdb29('0x4b')],_0x40679b[_0xdb29('0x51')],md5(_0x40679b[_0xdb29('0x51')]));}headers[_0xdb29('0x52')]=getAuth(_0x16e7d6);return getUser(_0x16e7d6,_0x5baea6[_0xdb29('0x67')])[_0xdb29('0x17')](function(_0x434a60){_0x409d81=_0x434a60;logger['info'](_0xdb29('0x53'),_0x409d81['id']);return getEndUser(_0x16e7d6,_0x40679b[_0xdb29('0x68')],_0x40679b[_0xdb29('0x69')]);})[_0xdb29('0x17')](function(_0x95e246){_0x4600f6=_0x95e246;logger['info'](_0xdb29('0x55'),_0x4600f6['id']);return getTicket(_0x16e7d6,_0x409d81,_0x4600f6,_0x16aaca,_0x40679b);})[_0xdb29('0x17')](function(_0x1cc368){if(_0x1cc368){logger[_0xdb29('0xb')](_0xdb29('0x56'),_0x1cc368['id']);switch(_0x16e7d6[_0xdb29('0x40')]){case _0xdb29('0x6a'):logger[_0xdb29('0xb')](_0xdb29('0x66'),_0xdb29('0x58'));return request({'uri':util[_0xdb29('0xd')](_0xdb29('0x59'),_0x16e7d6[_0xdb29('0xf')],_0x409d81['id'],_0x1cc368['id']),'method':'POST'});case _0xdb29('0x6b'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdb29('0xd')](_0xdb29('0x6c'),_0x5baea6[_0xdb29('0x12')]),_0xdb29('0x5b'),{'uri':util[_0xdb29('0xd')](_0xdb29('0x5c'),_0x16e7d6['remoteUri'][_0xdb29('0x5d')]('/api/v2',''),_0x1cc368['id'])});break;default:logger[_0xdb29('0x60')]('[OUTBOUND]',_0xdb29('0x5f'));}}})['catch'](function(_0x41e9f7){logger[_0xdb29('0x60')](_0xdb29('0x6d'),util[_0xdb29('0x62')](_0x41e9f7,{'showHidden':!![],'depth':null}));});};exports[_0xdb29('0x6e')]=function(_0x3977d5,_0x1b9ffd,_0x20abc7,_0x34eccd,_0x1034c9,_0x51aabc){var _0x4848bf,_0x1890a7;_0x51aabc[_0xdb29('0xf')]=intUtil[_0xdb29('0x4c')](_0x51aabc['remoteUri']);_0x51aabc[_0xdb29('0x4b')]=intUtil['stripTrailingSlash'](_0x51aabc[_0xdb29('0x4b')]);if(_0x1034c9&&_0x1034c9[_0xdb29('0x4d')]){logger[_0xdb29('0xb')]('['+_0x1b9ffd[_0xdb29('0x6f')]['toUpperCase']()+']',_0xdb29('0x4e'));_0x1b9ffd[_0xdb29('0x4f')]=util[_0xdb29('0xd')](_0xdb29('0x50'),_0x51aabc[_0xdb29('0x4b')],_0x1b9ffd['uniqueid'],md5(_0x1b9ffd[_0xdb29('0x51')]));}else{_0x1b9ffd[_0xdb29('0x4f')]='';}headers['Authorization']=getAuth(_0x51aabc);return getUser(_0x51aabc)['then'](function(_0x5f591c){_0x4848bf=_0x5f591c;logger[_0xdb29('0xb')]('The\x20User\x20ID\x20is:',_0x4848bf['id']);return getEndUser(_0x51aabc,_0x1b9ffd['calleridname'],_0x1b9ffd['calleridnum']);})['then'](function(_0x32b3b9){_0x1890a7=_0x32b3b9;logger[_0xdb29('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1890a7['id']);return getTicket(_0x51aabc,_0x4848bf,_0x1890a7,_0x20abc7,_0x1b9ffd);})[_0xdb29('0x17')](function(_0x176e8c){if(_0x176e8c){logger[_0xdb29('0xb')](_0xdb29('0x56'),_0x176e8c['id']);}})[_0xdb29('0x70')](function(_0x31eba9){logger[_0xdb29('0x60')]('['+_0x1b9ffd[_0xdb29('0x6f')][_0xdb29('0x71')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x31eba9,{'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 fd928b4..d01be6b 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 _0xc3d8=['refreshToken','clientId','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','moduleSearch','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','Called','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','host','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','lastevent','toUpperCase','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','picklist','type','idField','content','variableName','toString','customVariable','name','Variable','toLowerCase','indexOf','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token'];(function(_0x3bbbb2,_0x27c0ae){var _0x18d54c=function(_0x4a0f15){while(--_0x4a0f15){_0x3bbbb2['push'](_0x3bbbb2['shift']());}};_0x18d54c(++_0x27c0ae);}(_0xc3d8,0x70));var _0x8c3d=function(_0x27bf0e,_0x2b02fb){_0x27bf0e=_0x27bf0e-0x0;var _0x49ecea=_0xc3d8[_0x27bf0e];return _0x49ecea;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x8c3d('0x0'));var util=require(_0x8c3d('0x1'));var intUtil=require('./util');var moment=require(_0x8c3d('0x2'));var Redis=require(_0x8c3d('0x3'));var BPromise=require(_0x8c3d('0x4'));var config=require(_0x8c3d('0x5'));var logger=require(_0x8c3d('0x6'))('zoho');config[_0x8c3d('0x7')]=_[_0x8c3d('0x8')](config[_0x8c3d('0x7')],{'host':_0x8c3d('0x9'),'port':0x18eb});var io=require(_0x8c3d('0xa'))(new Redis(config[_0x8c3d('0x7')]));function emit(_0x5c6758,_0x94b9be,_0x1bac9e){io['to'](_0x5c6758)[_0x8c3d('0xb')](_0x94b9be,_0x1bac9e);}function request(_0x255be6){logger['debug'](_0x8c3d('0xc'),JSON[_0x8c3d('0xd')](_0x255be6));return rp(_0x255be6);}function getCustomFields(_0x1de29a,_0x299f31){var _0x4a2a19={};if(_0x1de29a[_0x8c3d('0xe')]>0x0){_['forEach'](_0x1de29a,function(_0x30cee2){if(_['includes'](['string',_0x8c3d('0xf')],_0x30cee2[_0x8c3d('0x10')])&&_0x30cee2[_0x8c3d('0x11')]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x30cee2[_0x8c3d('0x12')]['toString']();}else if(_0x30cee2['type']==='variable'&&_0x30cee2[_0x8c3d('0x13')]&&_0x30cee2['idField']&&_0x299f31[_0x30cee2[_0x8c3d('0x13')]]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x299f31[_0x30cee2[_0x8c3d('0x13')]][_0x8c3d('0x14')]();}else if(_0x30cee2['type']===_0x8c3d('0x15')&&_0x30cee2['Variable']&&_0x30cee2['Variable'][_0x8c3d('0x16')]&&_0x30cee2['idField']&&_0x299f31[_0x30cee2[_0x8c3d('0x17')][_0x8c3d('0x16')][_0x8c3d('0x18')]()]){_0x4a2a19[_0x30cee2[_0x8c3d('0x11')]]=_0x299f31[_0x30cee2[_0x8c3d('0x17')][_0x8c3d('0x16')][_0x8c3d('0x18')]()][_0x8c3d('0x14')]();}});}return _0x4a2a19;}function getName(_0x51e34a){if(_0x51e34a[_0x8c3d('0x19')]('\x20')>0x0){var _0x1d4936=_0x51e34a['split'](/ (.+)/);if(_0x1d4936[0x1]){return _0x1d4936;}}return[_0x51e34a,_0x51e34a];}var accountsTokens={};function getAccessToken(_0x4b9f85){return new Promise(function(_0x52c560,_0x5e455a){if(!_[_0x8c3d('0x1a')](accountsTokens[_0x4b9f85['id']])&&!_[_0x8c3d('0x1a')](accountsTokens[_0x4b9f85['id']]['access_token'])){if(moment()[_0x8c3d('0x1b')](accountsTokens[_0x4b9f85['id']][_0x8c3d('0x1c')])){_0x52c560(accountsTokens[_0x4b9f85['id']][_0x8c3d('0x1d')]);}}var _0x50adf2;switch(_0x4b9f85[_0x8c3d('0x1e')]){case'US':_0x50adf2='https://accounts.zoho.com';break;case'AU':_0x50adf2=_0x8c3d('0x1f');break;case'EU':_0x50adf2=_0x8c3d('0x20');break;case'IN':_0x50adf2=_0x8c3d('0x21');break;case'CN':_0x50adf2=_0x8c3d('0x22');break;default:_0x50adf2='https://accounts.zoho.eu';break;}var _0x47e2c9={'method':_0x8c3d('0x23'),'uri':_0x50adf2+_0x8c3d('0x24'),'qs':{'refresh_token':_0x4b9f85[_0x8c3d('0x25')],'client_id':_0x4b9f85[_0x8c3d('0x26')],'client_secret':_0x4b9f85['clientSecret'],'grant_type':_0x8c3d('0x27')},'json':!![]};return rp(_0x47e2c9)[_0x8c3d('0x28')](function(_0x21df3f){accountsTokens[_0x4b9f85['id']]={'access_token':_0x21df3f[_0x8c3d('0x1d')],'expires_in':moment()[_0x8c3d('0x29')](_0x21df3f[_0x8c3d('0x1c')],_0x8c3d('0x2a'))};_0x52c560(_0x21df3f[_0x8c3d('0x1d')]);})[_0x8c3d('0x2b')](function(_0xa49eb9){logger['error'](_0x8c3d('0x2c'),_0xa49eb9[_0x8c3d('0x2d')]);_0x5e455a(_0xa49eb9);});});}function getUser(_0x3ac65,_0x50397b,_0x3ea359,_0x4162ba){logger[_0x8c3d('0x2e')](_0x8c3d('0x2f'));return request({'method':_0x8c3d('0x30'),'uri':util[_0x8c3d('0x31')](_0x8c3d('0x32'),_0x50397b),'qs':{'type':_0x8c3d('0x33')},'headers':{'Authorization':_0x8c3d('0x34')+_0x3ac65},'json':!![]})['then'](function(_0xea4780){if(_0xea4780['users']){var _0x198945=-0x1;if(_[_0x8c3d('0x35')](_0xea4780[_0x8c3d('0x36')])){if(!_[_0x8c3d('0x1a')](_0x4162ba)){_0x198945=_[_0x8c3d('0x37')](_0xea4780['users'],function(_0x90ae6d){return _0x90ae6d[_0x8c3d('0x38')]===_0x4162ba;});}if(_0x198945>=0x0){logger[_0x8c3d('0x2e')](_0x8c3d('0x39'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x198945=_[_0x8c3d('0x37')](_0xea4780[_0x8c3d('0x36')],function(_0x4b546b){return _0x4b546b[_0x8c3d('0x3a')]['name']===_0x8c3d('0x3b');});}return _0xea4780[_0x8c3d('0x36')][_0x198945];}else{if(_0xea4780[_0x8c3d('0x3c')][_0x8c3d('0x3a')]['name']===_0x8c3d('0x3b')){logger[_0x8c3d('0x2e')](_0x8c3d('0x3d'));user=_0xea4780['user'];return user;}else{logger[_0x8c3d('0x3e')](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](_0xea4780));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8c3d('0xd')](_0xea4780));}}}else{logger['error'](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](_0xea4780));throw new Error(_0x8c3d('0x40')+JSON[_0x8c3d('0xd')](_0xea4780));}})['catch'](function(_0x5a6f8a){console[_0x8c3d('0x3e')](_0x5a6f8a);});}function getZohoUser(_0x1f49cf,_0xde6693){return new BPromise(function(_0x43e39d,_0x458c12){request(_0x1f49cf)[_0x8c3d('0x28')](function(_0x450f4b){var _0x4d16f4=null;if(_0x450f4b){_0x4d16f4=_0x450f4b[_0x8c3d('0x41')][0x0];_0x4d16f4[_0x8c3d('0x42')]=_0xde6693;}_0x43e39d(_0x4d16f4);})[_0x8c3d('0x2b')](function(_0x22bf60){_0x458c12(_0x22bf60);});});}function createEndUser(_0x9f15f,_0x2412dd,_0x3b4bde,_0x4e7ecb,_0xb719bd,_0x325071){var _0x3b4bde=getName(_0x3b4bde);return request({'method':_0x8c3d('0x23'),'uri':_0x8c3d('0x43')+_0x2412dd+_0x8c3d('0x44')+_[_0x8c3d('0x45')](_0x325071[_0x8c3d('0x46')])+'s','body':{'data':[{'Last_Name':_0x3b4bde[0x1],'First_Name':_0x3b4bde[0x0],'Phone':_0x4e7ecb,'Owner':{'name':!_[_0x8c3d('0x1a')](_0xb719bd[_0x8c3d('0x47')][_0x8c3d('0x16')])?_0xb719bd[_0x8c3d('0x47')][_0x8c3d('0x16')]:!_[_0x8c3d('0x1a')](_0xb719bd[_0x8c3d('0x48')])?_0xb719bd[_0x8c3d('0x48')]+'\x20'+_0xb719bd[_0x8c3d('0x49')]:_0xb719bd[_0x8c3d('0x49')],'id':_0xb719bd['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9f15f},'json':!![]})['then'](function(_0x39cb71){if(_0x39cb71&&_0x39cb71['data'][0x0][_0x8c3d('0x4a')]==='SUCCESS'){var _0x17f6e1=_0x39cb71[_0x8c3d('0x41')][0x0][_0x8c3d('0x4b')];_0x17f6e1[_0x8c3d('0x42')]=_[_0x8c3d('0x45')](_0x325071['moduleCreate'])+'s';return _0x17f6e1;}logger['error'](_0x8c3d('0x3f'),JSON[_0x8c3d('0xd')](data));throw new Error(_0x8c3d('0x4c')+JSON[_0x8c3d('0xd')](data));})[_0x8c3d('0x2b')](function(_0x5e3324){console[_0x8c3d('0x4d')]('CREATE\x20ERROR',_0x5e3324);});}function getEndUser(_0x10c1f4,_0x562a36,_0x4f3a28,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054){var _0x1df574={'method':'GET','uri':'','headers':{'Authorization':_0x8c3d('0x34')+_0x10c1f4},'json':!![]};switch(_0x8f3054[_0x8c3d('0x4e')]){case'contact_lead':_0x1df574[_0x8c3d('0x4f')]='https://www.zohoapis.'+_0x562a36+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ee20d+'))';return getZohoUser(_0x1df574,'Contacts')[_0x8c3d('0x28')](function(_0x58b265){if(_0x58b265)return _0x58b265;_0x1df574['uri']=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x50')+_0x3ee20d+'))';return getZohoUser(_0x1df574,_0x8c3d('0x51'))['then'](function(_0x276d4f){if(_0x276d4f)return _0x276d4f;if(_0x8f3054['moduleCreate']!='nothing'){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});});break;case _0x8c3d('0x52'):_0x1df574['uri']=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x53')+_0x3ee20d+'))';return getZohoUser(_0x1df574,'Contacts')[_0x8c3d('0x28')](function(_0x114d32){if(_0x114d32)return _0x114d32;if(_0x8f3054[_0x8c3d('0x46')]!=_0x8c3d('0x54')){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});break;case _0x8c3d('0x55'):_0x1df574[_0x8c3d('0x4f')]=_0x8c3d('0x43')+_0x562a36+_0x8c3d('0x50')+_0x3ee20d+'))';return getZohoUser(_0x1df574,_0x8c3d('0x51'))['then'](function(_0x17c32c){if(_0x17c32c)return _0x17c32c;if(_0x8f3054['moduleCreate']!='nothing'){return createEndUser(_0x10c1f4,_0x562a36,_0xc7d33a,_0x3ee20d,_0x4d4d32,_0x8f3054);}else{return{};}});break;}}function getCall(_0x274767,_0x1bb9d3,_0x2059eb,_0x49e050,_0x1baee9,_0x58a97b,_0x1f4ca6,_0x4da296){logger[_0x8c3d('0x2e')](_0x8c3d('0x56'));var _0x4045ad={};_0x4045ad['Owner']={'name':!_[_0x8c3d('0x1a')](_0x49e050[_0x8c3d('0x47')][_0x8c3d('0x16')])&&!_[_0x8c3d('0x1a')](_0x49e050[_0x8c3d('0x3a')][_0x8c3d('0x16')])&&_0x49e050[_0x8c3d('0x3a')][_0x8c3d('0x16')]===_0x8c3d('0x57')?_0x49e050[_0x8c3d('0x47')][_0x8c3d('0x16')]:!_['isNil'](_0x49e050[_0x8c3d('0x48')])?_0x49e050[_0x8c3d('0x48')]+'\x20'+_0x49e050[_0x8c3d('0x49')]:_0x49e050[_0x8c3d('0x49')],'id':_0x49e050['id']};_0x4045ad['Subject']=intUtil[_0x8c3d('0x58')](_0x58a97b[_0x8c3d('0x59')],_0x1f4ca6,'\x20');_0x4045ad[_0x8c3d('0x5a')]=intUtil[_0x8c3d('0x58')](_0x58a97b[_0x8c3d('0x5b')],_0x1f4ca6,'\x0a');if(_0x1baee9[_0x8c3d('0x42')]==='Contacts'){_0x4045ad['Who_Id']={'name':!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5c')])?_0x1baee9[_0x8c3d('0x5c')]:!_['isNil'](_0x1baee9[_0x8c3d('0x5d')])?_0x1baee9[_0x8c3d('0x5d')]+'\x20'+_0x1baee9[_0x8c3d('0x5e')]:_0x1baee9[_0x8c3d('0x5e')],'id':_0x1baee9['id']};}if(_0x1baee9[_0x8c3d('0x42')]===_0x8c3d('0x51')){_0x4045ad[_0x8c3d('0x5f')]={'name':!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5c')])?_0x1baee9[_0x8c3d('0x5c')]:!_[_0x8c3d('0x1a')](_0x1baee9[_0x8c3d('0x5d')])?_0x1baee9[_0x8c3d('0x5d')]+'\x20'+_0x1baee9[_0x8c3d('0x5e')]:_0x1baee9['Last_Name'],'id':_0x1baee9['id']};_0x4045ad['$se_module']=_[_0x8c3d('0x45')](_0x1baee9[_0x8c3d('0x42')]);}if(_0x1f4ca6[_0x8c3d('0x60')]){_0x4045ad[_0x8c3d('0x61')]=moment['utc'](parseInt(_0x1f4ca6[_0x8c3d('0x60')])*0x3e8)[_0x8c3d('0x31')]('mm:ss');}else if(_0x1f4ca6[_0x8c3d('0x62')]&&_0x1f4ca6[_0x8c3d('0x63')]){_0x4045ad['Call_Duration']=moment[_0x8c3d('0x64')](moment(_0x1f4ca6['endtime'],_0x8c3d('0x65'))[_0x8c3d('0x66')](moment(_0x1f4ca6[_0x8c3d('0x67')],_0x8c3d('0x65'))))[_0x8c3d('0x31')](_0x8c3d('0x68'));}switch(_0x1f4ca6['lastevent']){case'called':_0x4045ad['Call_Result']=_0x8c3d('0x69');break;case'complete':case _0x8c3d('0x6a'):_0x4045ad[_0x8c3d('0x6b')]=_0x8c3d('0x6c');break;case _0x8c3d('0x6d'):_0x4045ad[_0x8c3d('0x6b')]='Rejected';break;case _0x8c3d('0x6e'):_0x4045ad[_0x8c3d('0x6b')]=_0x8c3d('0x6f');break;case _0x8c3d('0x70'):_0x4045ad['Call_Result']=_0x8c3d('0x71');default:}_0x4045ad['Call_Start_Time']=(_0x4da296===_0x8c3d('0x72')?moment(_0x1f4ca6[_0x8c3d('0x67')])[_0x8c3d('0x31')](_0x8c3d('0x65')):moment(_0x1f4ca6['agentcalledAt'])[_0x8c3d('0x31')](_0x8c3d('0x65')))||moment()[_0x8c3d('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x4045ad[_0x8c3d('0x73')]=_0x4da296||_0x8c3d('0x74');_0x4045ad=_['merge'](_0x4045ad,getCustomFields(_0x58a97b[_0x8c3d('0x75')],_0x1f4ca6));return request({'method':_0x8c3d('0x23'),'uri':_0x8c3d('0x43')+_0x1bb9d3+_0x8c3d('0x76'),'headers':{'Authorization':_0x8c3d('0x34')+_0x274767},'body':{'data':[_0x4045ad]},'json':!![]})['then'](function(_0x168b2b){if(_0x168b2b&&_0x168b2b[_0x8c3d('0x41')][0x0][_0x8c3d('0x4a')]===_0x8c3d('0x77')){logger[_0x8c3d('0x2e')](_0x8c3d('0x78'));return{'id':_0x168b2b[_0x8c3d('0x41')][0x0][_0x8c3d('0x4b')]['id']};}})[_0x8c3d('0x2b')](function(_0x6dc105){logger[_0x8c3d('0x2e')](_0x8c3d('0x79'),_0x6dc105[_0x8c3d('0x2d')]);console['log']('err',_0x6dc105);});}exports['queue']=function(_0x177185,_0x23c8f1,_0x183ced,_0x3b8ad8,_0x50a0e1,_0x6bac2){var _0x7bd2b8,_0x1980bc,_0x5f14c9;_0x6bac2[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x6bac2[_0x8c3d('0x7a')]);_0x6bac2['serverUrl']=intUtil['stripTrailingSlash'](_0x6bac2['serverUrl']);if(_0x50a0e1&&_0x50a0e1[_0x8c3d('0x7c')]){logger[_0x8c3d('0x2e')](_0x8c3d('0x7d'),'Recording\x20is\x20enabled!');_0x23c8f1[_0x8c3d('0x7e')]=_0x6bac2[_0x8c3d('0x7f')]+_0x8c3d('0x80')+_0x23c8f1[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x23c8f1[_0x8c3d('0x81')]);}else{_0x23c8f1['recordingURL']='';}var _0x1cfa47=_0x6bac2['host']===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x6bac2)[_0x8c3d('0x28')](function(_0x914c44){_0x5f14c9=_0x914c44;return getUser(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x3b8ad8[_0x8c3d('0x38')]);})[_0x8c3d('0x28')](function(_0x1752ee){_0x7bd2b8=_0x1752ee;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x7bd2b8['id']);return getEndUser(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x23c8f1['calleridname'],_0x23c8f1[_0x8c3d('0x86')],_0x7bd2b8,_0x183ced);})[_0x8c3d('0x28')](function(_0x11c265){_0x1980bc=_0x11c265;return getCall(_0x5f14c9,_0x1cfa47,_0x6bac2,_0x7bd2b8,_0x1980bc,_0x183ced,_0x23c8f1,'Inbound');})['then'](function(_0x51aff2){if(_0x51aff2){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x51aff2['id']);logger[_0x8c3d('0x2e')]('[QUEUE]',_0x8c3d('0x88'));emit(util[_0x8c3d('0x31')]('user:%s',_0x3b8ad8[_0x8c3d('0x16')]),'trigger:browser:url',{'uri':'https://crm.'+_0x6bac2[_0x8c3d('0x7a')]+_0x8c3d('0x89')+_0x51aff2['id']});}})[_0x8c3d('0x2b')](function(_0x3f141e){logger[_0x8c3d('0x3e')]('[QUEUE]',JSON[_0x8c3d('0xd')](_0x3f141e));});};exports['outbound']=function(_0x140b9d,_0x2a0cfb,_0x5a6b3f,_0xa903a,_0xa74e5,_0x1addb6,_0x2ccf5e){var _0x398095,_0xd1998a,_0x3fd719;_0x1addb6[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x1addb6[_0x8c3d('0x7a')]);_0x1addb6['serverUrl']=intUtil[_0x8c3d('0x7b')](_0x1addb6[_0x8c3d('0x7f')]);if(_0x2ccf5e&&_0x2ccf5e[_0x8c3d('0x8a')]&&_0x2ccf5e[_0x8c3d('0x8a')]!==_0x8c3d('0x8b')){logger['info'](_0x8c3d('0x8c'),_0x8c3d('0x8d'));_0x2a0cfb['recordingURL']=_0x1addb6['serverUrl']+_0x8c3d('0x80')+_0x2a0cfb[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x2a0cfb[_0x8c3d('0x81')]);}var _0x6275c5=_0x1addb6[_0x8c3d('0x7a')]===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x1addb6)[_0x8c3d('0x28')](function(_0x4f91d0){_0x3fd719=_0x4f91d0;return getUser(_0x3fd719,_0x6275c5,_0x1addb6,_0xa903a[_0x8c3d('0x38')]);})['then'](function(_0x500409){_0x398095=_0x500409;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x398095['id']);return getEndUser(_0x3fd719,_0x6275c5,_0x1addb6,_0x2a0cfb[_0x8c3d('0x8e')],_0x2a0cfb[_0x8c3d('0x8f')],_0x398095,_0x5a6b3f);})[_0x8c3d('0x28')](function(_0x44fd23){_0xd1998a=_0x44fd23;return getCall(_0x3fd719,_0x6275c5,_0x1addb6,_0x398095,_0xd1998a,_0x5a6b3f,_0x2a0cfb,_0x8c3d('0x90'));})[_0x8c3d('0x28')](function(_0x2fb56e){if(_0x2fb56e){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x2fb56e['id']);logger['info'](_0x8c3d('0x8c'),_0x8c3d('0x88'));emit(util['format']('user:%s',_0xa903a[_0x8c3d('0x16')]),_0x8c3d('0x91'),{'uri':'https://crm.'+_0x1addb6[_0x8c3d('0x7a')]+_0x8c3d('0x89')+_0x2fb56e['id']});}})['catch'](function(_0xf998ba){logger[_0x8c3d('0x3e')](_0x8c3d('0x8c'),JSON[_0x8c3d('0xd')](_0xf998ba));});};exports[_0x8c3d('0x92')]=function(_0x312a67,_0x5b3089,_0x4720b4,_0x1fadd7,_0x11ba6a,_0x27f9a6){var _0x538606,_0x44514e,_0x42d19a;_0x27f9a6[_0x8c3d('0x7a')]=intUtil[_0x8c3d('0x7b')](_0x27f9a6[_0x8c3d('0x7a')]);_0x27f9a6[_0x8c3d('0x7f')]=intUtil['stripTrailingSlash'](_0x27f9a6['serverUrl']);if(_0x11ba6a&&_0x11ba6a[_0x8c3d('0x7c')]){logger[_0x8c3d('0x2e')]('['+_0x5b3089[_0x8c3d('0x93')][_0x8c3d('0x94')]()+']',_0x8c3d('0x8d'));_0x5b3089[_0x8c3d('0x7e')]=_0x27f9a6['serverUrl']+_0x8c3d('0x80')+_0x5b3089[_0x8c3d('0x81')]+_0x8c3d('0x82')+md5(_0x5b3089[_0x8c3d('0x81')]);}else{_0x5b3089['recordingURL']='';}var _0x17f3a2=_0x27f9a6[_0x8c3d('0x7a')]===_0x8c3d('0x83')?'eu':_0x8c3d('0x84');return getAccessToken(_0x27f9a6)[_0x8c3d('0x28')](function(_0xadc1ea){_0x42d19a=_0xadc1ea;return getUser(_0x42d19a,_0x17f3a2,_0x27f9a6);})['then'](function(_0x537f8c){_0x538606=_0x537f8c;logger[_0x8c3d('0x2e')](_0x8c3d('0x85'),_0x538606['id']);return getEndUser(_0x42d19a,_0x17f3a2,_0x27f9a6,_0x5b3089['calleridname'],_0x5b3089[_0x8c3d('0x86')],_0x538606,_0x4720b4);})[_0x8c3d('0x28')](function(_0x4168be){_0x44514e=_0x4168be;return getCall(_0x42d19a,_0x17f3a2,_0x27f9a6,_0x538606,_0x44514e,_0x4720b4,_0x5b3089,_0x8c3d('0x74'));})[_0x8c3d('0x28')](function(_0x3fb41b){if(_0x3fb41b){logger[_0x8c3d('0x2e')](_0x8c3d('0x87'),_0x3fb41b['id']);}})[_0x8c3d('0x2b')](function(_0x15bac5){logger[_0x8c3d('0x3e')]('['+_0x5b3089[_0x8c3d('0x93')]['toUpperCase']()+']',JSON[_0x8c3d('0xd')](_0x15bac5));});}; \ No newline at end of file +var _0x7747=['starttime','agentcalledAt','merge','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','email','calleridname','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','Inbound','lodash','request-promise','util','moment','bluebird','../../../../config/environment','zoho','defaults','redis','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isNil','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','administrator','Subject','Subjects','getString','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','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound'];(function(_0x27e19b,_0x3b8b98){var _0x49a8ad=function(_0x30bee1){while(--_0x30bee1){_0x27e19b['push'](_0x27e19b['shift']());}};_0x49a8ad(++_0x3b8b98);}(_0x7747,0xc5));var _0x7774=function(_0x51e51e,_0x1d852d){_0x51e51e=_0x51e51e-0x0;var _0x5ce929=_0x7747[_0x51e51e];return _0x5ce929;};'use strict';var _=require(_0x7774('0x0'));var rp=require(_0x7774('0x1'));var md5=require('md5');var util=require(_0x7774('0x2'));var intUtil=require('./util');var moment=require(_0x7774('0x3'));var Redis=require('ioredis');var BPromise=require(_0x7774('0x4'));var config=require(_0x7774('0x5'));var logger=require('../../../../config/logger')(_0x7774('0x6'));config['redis']=_[_0x7774('0x7')](config[_0x7774('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7774('0x9'))(new Redis(config['redis']));function emit(_0x2f2a59,_0x4c22bc,_0x429491){io['to'](_0x2f2a59)[_0x7774('0xa')](_0x4c22bc,_0x429491);}function request(_0x4c33a0){logger[_0x7774('0xb')](_0x7774('0xc'),JSON[_0x7774('0xd')](_0x4c33a0));return rp(_0x4c33a0);}function getCustomFields(_0x1383f4,_0x1d5d59){var _0x24b1f4={};if(_0x1383f4[_0x7774('0xe')]>0x0){_[_0x7774('0xf')](_0x1383f4,function(_0x5e7eaa){if(_[_0x7774('0x10')]([_0x7774('0x11'),_0x7774('0x12')],_0x5e7eaa[_0x7774('0x13')])&&_0x5e7eaa[_0x7774('0x14')]){_0x24b1f4[_0x5e7eaa[_0x7774('0x14')]]=_0x5e7eaa[_0x7774('0x15')]['toString']();}else if(_0x5e7eaa[_0x7774('0x13')]==='variable'&&_0x5e7eaa[_0x7774('0x16')]&&_0x5e7eaa['idField']&&_0x1d5d59[_0x5e7eaa[_0x7774('0x16')]]){_0x24b1f4[_0x5e7eaa['idField']]=_0x1d5d59[_0x5e7eaa[_0x7774('0x16')]][_0x7774('0x17')]();}else if(_0x5e7eaa[_0x7774('0x13')]===_0x7774('0x18')&&_0x5e7eaa[_0x7774('0x19')]&&_0x5e7eaa[_0x7774('0x19')]['name']&&_0x5e7eaa['idField']&&_0x1d5d59[_0x5e7eaa['Variable'][_0x7774('0x1a')][_0x7774('0x1b')]()]){_0x24b1f4[_0x5e7eaa[_0x7774('0x14')]]=_0x1d5d59[_0x5e7eaa[_0x7774('0x19')][_0x7774('0x1a')]['toLowerCase']()][_0x7774('0x17')]();}});}return _0x24b1f4;}function getName(_0x112b26){if(_0x112b26[_0x7774('0x1c')]('\x20')>0x0){var _0x273ba3=_0x112b26[_0x7774('0x1d')](/ (.+)/);if(_0x273ba3[0x1]){return _0x273ba3;}}return[_0x112b26,_0x112b26];}var accountsTokens={};function getAccessToken(_0x13c50f){return new Promise(function(_0xad20fe,_0x4bf3bf){if(!_['isNil'](accountsTokens[_0x13c50f['id']])&&!_['isNil'](accountsTokens[_0x13c50f['id']][_0x7774('0x1e')])){if(moment()[_0x7774('0x1f')](accountsTokens[_0x13c50f['id']][_0x7774('0x20')])){_0xad20fe(accountsTokens[_0x13c50f['id']][_0x7774('0x1e')]);}}var _0x4e5dd0;switch(_0x13c50f[_0x7774('0x21')]){case'US':_0x4e5dd0=_0x7774('0x22');break;case'AU':_0x4e5dd0=_0x7774('0x23');break;case'EU':_0x4e5dd0=_0x7774('0x24');break;case'IN':_0x4e5dd0=_0x7774('0x25');break;case'CN':_0x4e5dd0=_0x7774('0x26');break;default:_0x4e5dd0=_0x7774('0x24');break;}var _0x168c92={'method':_0x7774('0x27'),'uri':_0x4e5dd0+_0x7774('0x28'),'qs':{'refresh_token':_0x13c50f['refreshToken'],'client_id':_0x13c50f[_0x7774('0x29')],'client_secret':_0x13c50f[_0x7774('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x168c92)['then'](function(_0x176f51){accountsTokens[_0x13c50f['id']]={'access_token':_0x176f51[_0x7774('0x1e')],'expires_in':moment()[_0x7774('0x2b')](_0x176f51[_0x7774('0x20')],_0x7774('0x2c'))};_0xad20fe(_0x176f51['access_token']);})['catch'](function(_0x368bc2){logger[_0x7774('0x2d')](_0x7774('0x2e'),_0x368bc2[_0x7774('0x2f')]);_0x4bf3bf(_0x368bc2);});});}function getUser(_0x42acc2,_0x36f078,_0x5a8af2,_0x28ceba){logger['info'](_0x7774('0x30'));return request({'method':_0x7774('0x31'),'uri':util[_0x7774('0x32')](_0x7774('0x33'),_0x36f078),'qs':{'type':_0x7774('0x34')},'headers':{'Authorization':_0x7774('0x35')+_0x42acc2},'json':!![]})['then'](function(_0x206160){if(_0x206160['users']){var _0x891d2=-0x1;if(_['isArrayLikeObject'](_0x206160[_0x7774('0x36')])){if(!_[_0x7774('0x37')](_0x28ceba)){_0x891d2=_[_0x7774('0x38')](_0x206160['users'],function(_0x151218){return _0x151218['email']===_0x28ceba;});}if(_0x891d2>=0x0){logger[_0x7774('0x39')](_0x7774('0x3a'));}else{logger[_0x7774('0x39')](_0x7774('0x3b'));_0x891d2=_[_0x7774('0x38')](_0x206160['users'],function(_0x1c967a){return _0x1c967a[_0x7774('0x3c')][_0x7774('0x1a')]==='Administrator';});}return _0x206160[_0x7774('0x36')][_0x891d2];}else{if(_0x206160[_0x7774('0x3d')][_0x7774('0x3c')]['name']===_0x7774('0x3e')){logger[_0x7774('0x39')](_0x7774('0x3b'));user=_0x206160[_0x7774('0x3d')];return user;}else{logger[_0x7774('0x2d')](_0x7774('0x3f'),JSON['stringify'](_0x206160));throw new Error(_0x7774('0x40')+JSON[_0x7774('0xd')](_0x206160));}}}else{logger[_0x7774('0x2d')](_0x7774('0x3f'),JSON[_0x7774('0xd')](_0x206160));throw new Error(_0x7774('0x40')+JSON[_0x7774('0xd')](_0x206160));}})['catch'](function(_0x5d47fe){console[_0x7774('0x2d')](_0x5d47fe);});}function getZohoUser(_0x41a5d4,_0x4facc7){return new BPromise(function(_0x29631c,_0x2df51c){request(_0x41a5d4)[_0x7774('0x41')](function(_0x40de91){var _0x5622b0=null;if(_0x40de91){_0x5622b0=_0x40de91[_0x7774('0x42')][0x0];_0x5622b0['enduserType']=_0x4facc7;}_0x29631c(_0x5622b0);})[_0x7774('0x43')](function(_0x2161c8){_0x2df51c(_0x2161c8);});});}function createEndUser(_0x462521,_0x5d0098,_0x297c6b,_0x58d785,_0x45a8ee,_0x2f545f){var _0x297c6b=getName(_0x297c6b);return request({'method':_0x7774('0x27'),'uri':_0x7774('0x44')+_0x5d0098+_0x7774('0x45')+_[_0x7774('0x46')](_0x2f545f[_0x7774('0x47')])+'s','body':{'data':[{'Last_Name':_0x297c6b[0x1],'First_Name':_0x297c6b[0x0],'Phone':_0x58d785,'Owner':{'name':!_[_0x7774('0x37')](_0x45a8ee[_0x7774('0x48')]['name'])?_0x45a8ee['role'][_0x7774('0x1a')]:!_['isNil'](_0x45a8ee[_0x7774('0x49')])?_0x45a8ee[_0x7774('0x49')]+'\x20'+_0x45a8ee[_0x7774('0x4a')]:_0x45a8ee['last_name'],'id':_0x45a8ee['id']}}]},'headers':{'Authorization':_0x7774('0x35')+_0x462521},'json':!![]})[_0x7774('0x41')](function(_0x98b44){if(_0x98b44&&_0x98b44['data'][0x0][_0x7774('0x4b')]===_0x7774('0x4c')){var _0x15d650=_0x98b44['data'][0x0][_0x7774('0x4d')];_0x15d650[_0x7774('0x4e')]=_['startCase'](_0x2f545f[_0x7774('0x47')])+'s';return _0x15d650;}logger['error'](_0x7774('0x3f'),JSON[_0x7774('0xd')](data));throw new Error(_0x7774('0x4f')+JSON[_0x7774('0xd')](data));})[_0x7774('0x43')](function(_0x7f4c57){console[_0x7774('0x50')]('CREATE\x20ERROR',_0x7f4c57);});}function getEndUser(_0x39204c,_0x5a87b1,_0x18e852,_0x17ce3e,_0xc00541,_0x285699,_0xe1c9c0){var _0x22e1dd={'method':_0x7774('0x31'),'uri':'','headers':{'Authorization':_0x7774('0x35')+_0x39204c},'json':!![]};switch(_0xe1c9c0[_0x7774('0x51')]){case _0x7774('0x52'):_0x22e1dd[_0x7774('0x53')]=_0x7774('0x44')+_0x5a87b1+_0x7774('0x54')+_0xc00541+'))';return getZohoUser(_0x22e1dd,_0x7774('0x55'))[_0x7774('0x41')](function(_0x4668a8){if(_0x4668a8)return _0x4668a8;_0x22e1dd[_0x7774('0x53')]=_0x7774('0x44')+_0x5a87b1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xc00541+'))';return getZohoUser(_0x22e1dd,_0x7774('0x56'))[_0x7774('0x41')](function(_0x257159){if(_0x257159)return _0x257159;if(_0xe1c9c0['moduleCreate']!=_0x7774('0x57')){return createEndUser(_0x39204c,_0x5a87b1,_0x17ce3e,_0xc00541,_0x285699,_0xe1c9c0);}else{return{};}});});break;case _0x7774('0x58'):_0x22e1dd[_0x7774('0x53')]=_0x7774('0x44')+_0x5a87b1+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xc00541+'))';return getZohoUser(_0x22e1dd,_0x7774('0x55'))[_0x7774('0x41')](function(_0xc7c471){if(_0xc7c471)return _0xc7c471;if(_0xe1c9c0[_0x7774('0x47')]!=_0x7774('0x57')){return createEndUser(_0x39204c,_0x5a87b1,_0x17ce3e,_0xc00541,_0x285699,_0xe1c9c0);}else{return{};}});break;case _0x7774('0x59'):_0x22e1dd[_0x7774('0x53')]='https://www.zohoapis.'+_0x5a87b1+_0x7774('0x5a')+_0xc00541+'))';return getZohoUser(_0x22e1dd,_0x7774('0x56'))[_0x7774('0x41')](function(_0x4aae1a){if(_0x4aae1a)return _0x4aae1a;if(_0xe1c9c0['moduleCreate']!='nothing'){return createEndUser(_0x39204c,_0x5a87b1,_0x17ce3e,_0xc00541,_0x285699,_0xe1c9c0);}else{return{};}});break;}}function getCall(_0x4b3444,_0x59f5c0,_0x487aea,_0x11af46,_0x3c1bb7,_0x2bf987,_0x9a7dac,_0x26ce1c){logger[_0x7774('0x39')](_0x7774('0x5b'));var _0x5d5ae1={};_0x5d5ae1['Owner']={'name':!_['isNil'](_0x11af46[_0x7774('0x48')][_0x7774('0x1a')])&&!_[_0x7774('0x37')](_0x11af46[_0x7774('0x3c')][_0x7774('0x1a')])&&_0x11af46[_0x7774('0x3c')]['name']===_0x7774('0x5c')?_0x11af46[_0x7774('0x48')][_0x7774('0x1a')]:!_[_0x7774('0x37')](_0x11af46[_0x7774('0x49')])?_0x11af46['first_name']+'\x20'+_0x11af46[_0x7774('0x4a')]:_0x11af46[_0x7774('0x4a')],'id':_0x11af46['id']};_0x5d5ae1[_0x7774('0x5d')]=intUtil['getString'](_0x2bf987[_0x7774('0x5e')],_0x9a7dac,'\x20');_0x5d5ae1['Description']=intUtil[_0x7774('0x5f')](_0x2bf987[_0x7774('0x60')],_0x9a7dac,'\x0a');if(_0x3c1bb7[_0x7774('0x4e')]==='Contacts'){_0x5d5ae1['Who_Id']={'name':!_['isNil'](_0x3c1bb7[_0x7774('0x61')])?_0x3c1bb7[_0x7774('0x61')]:!_[_0x7774('0x37')](_0x3c1bb7[_0x7774('0x62')])?_0x3c1bb7[_0x7774('0x62')]+'\x20'+_0x3c1bb7['Last_Name']:_0x3c1bb7[_0x7774('0x63')],'id':_0x3c1bb7['id']};}if(_0x3c1bb7['enduserType']===_0x7774('0x56')){_0x5d5ae1[_0x7774('0x64')]={'name':!_[_0x7774('0x37')](_0x3c1bb7[_0x7774('0x61')])?_0x3c1bb7['Full_Name']:!_[_0x7774('0x37')](_0x3c1bb7[_0x7774('0x62')])?_0x3c1bb7['First_Name']+'\x20'+_0x3c1bb7['Last_Name']:_0x3c1bb7[_0x7774('0x63')],'id':_0x3c1bb7['id']};_0x5d5ae1[_0x7774('0x65')]=_[_0x7774('0x46')](_0x3c1bb7['enduserType']);}if(_0x9a7dac[_0x7774('0x66')]){_0x5d5ae1[_0x7774('0x67')]=moment[_0x7774('0x68')](parseInt(_0x9a7dac[_0x7774('0x66')])*0x3e8)[_0x7774('0x32')](_0x7774('0x69'));}else if(_0x9a7dac[_0x7774('0x6a')]&&_0x9a7dac['endtime']){_0x5d5ae1[_0x7774('0x67')]=moment[_0x7774('0x68')](moment(_0x9a7dac[_0x7774('0x6b')],_0x7774('0x6c'))[_0x7774('0x6d')](moment(_0x9a7dac['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x7774('0x32')]('mm:ss');}switch(_0x9a7dac['lastevent']){case'called':_0x5d5ae1[_0x7774('0x6e')]=_0x7774('0x6f');break;case _0x7774('0x70'):case _0x7774('0x71'):_0x5d5ae1[_0x7774('0x6e')]=_0x7774('0x72');break;case _0x7774('0x73'):_0x5d5ae1[_0x7774('0x6e')]='Rejected';break;case _0x7774('0x74'):_0x5d5ae1[_0x7774('0x6e')]=_0x7774('0x75');break;case'timeout':_0x5d5ae1['Call_Result']=_0x7774('0x76');default:}_0x5d5ae1[_0x7774('0x77')]=(_0x26ce1c===_0x7774('0x78')?moment(_0x9a7dac[_0x7774('0x79')])[_0x7774('0x32')](_0x7774('0x6c')):moment(_0x9a7dac[_0x7774('0x7a')])[_0x7774('0x32')](_0x7774('0x6c')))||moment()[_0x7774('0x32')]('YYYY-MM-DDTHH:mm:ss');_0x5d5ae1['Call_Type']=_0x26ce1c||'Inbound';_0x5d5ae1=_[_0x7774('0x7b')](_0x5d5ae1,getCustomFields(_0x2bf987['Fields'],_0x9a7dac));return request({'method':'POST','uri':_0x7774('0x44')+_0x59f5c0+_0x7774('0x7c'),'headers':{'Authorization':_0x7774('0x35')+_0x4b3444},'body':{'data':[_0x5d5ae1]},'json':!![]})[_0x7774('0x41')](function(_0x227119){if(_0x227119&&_0x227119[_0x7774('0x42')][0x0][_0x7774('0x4b')]==='SUCCESS'){logger[_0x7774('0x39')](_0x7774('0x7d'));return{'id':_0x227119[_0x7774('0x42')][0x0][_0x7774('0x4d')]['id']};}})[_0x7774('0x43')](function(_0x3f0db3){logger[_0x7774('0x39')](_0x7774('0x7e'),_0x3f0db3[_0x7774('0x2f')]);console[_0x7774('0x50')](_0x7774('0x7e'),_0x3f0db3);});}exports[_0x7774('0x7f')]=function(_0x110c97,_0x3ed7fa,_0x5680f0,_0x41a240,_0xb07b08,_0xa72ef8){var _0x1de39d,_0xb6e6ba,_0x11a6ce;_0xa72ef8[_0x7774('0x80')]=intUtil[_0x7774('0x81')](_0xa72ef8[_0x7774('0x80')]);_0xa72ef8[_0x7774('0x82')]=intUtil['stripTrailingSlash'](_0xa72ef8[_0x7774('0x82')]);if(_0xb07b08&&_0xb07b08[_0x7774('0x83')]){logger[_0x7774('0x39')](_0x7774('0x84'),'Recording\x20is\x20enabled!');_0x3ed7fa[_0x7774('0x85')]=_0xa72ef8[_0x7774('0x82')]+_0x7774('0x86')+_0x3ed7fa[_0x7774('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x3ed7fa[_0x7774('0x87')]);}else{_0x3ed7fa[_0x7774('0x85')]='';}var _0x585e2a=_0xa72ef8[_0x7774('0x80')]===_0x7774('0x88')?'eu':'com';return getAccessToken(_0xa72ef8)[_0x7774('0x41')](function(_0x1ae0fe){_0x11a6ce=_0x1ae0fe;return getUser(_0x11a6ce,_0x585e2a,_0xa72ef8,_0x41a240[_0x7774('0x89')]);})[_0x7774('0x41')](function(_0x67acaa){_0x1de39d=_0x67acaa;logger[_0x7774('0x39')]('The\x20User\x20ID\x20is:',_0x1de39d['id']);return getEndUser(_0x11a6ce,_0x585e2a,_0xa72ef8,_0x3ed7fa[_0x7774('0x8a')],_0x3ed7fa[_0x7774('0x8b')],_0x1de39d,_0x5680f0);})['then'](function(_0x29776d){_0xb6e6ba=_0x29776d;return getCall(_0x11a6ce,_0x585e2a,_0xa72ef8,_0x1de39d,_0xb6e6ba,_0x5680f0,_0x3ed7fa,'Inbound');})[_0x7774('0x41')](function(_0x2ace76){if(_0x2ace76){logger['info']('The\x20Call\x20ID\x20is:',_0x2ace76['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7774('0x32')](_0x7774('0x8c'),_0x41a240[_0x7774('0x1a')]),_0x7774('0x8d'),{'uri':_0x7774('0x8e')+_0xa72ef8[_0x7774('0x80')]+_0x7774('0x8f')+_0x2ace76['id']});}})[_0x7774('0x43')](function(_0x91243e){logger['error'](_0x7774('0x84'),JSON['stringify'](_0x91243e));});};exports[_0x7774('0x78')]=function(_0x4ebae6,_0x5ccf86,_0x2b0d21,_0x40d5d7,_0x493a9f,_0x234e2b,_0x2a3166){var _0x522195,_0x3c0d70,_0x239017;_0x234e2b['host']=intUtil['stripTrailingSlash'](_0x234e2b[_0x7774('0x80')]);_0x234e2b[_0x7774('0x82')]=intUtil[_0x7774('0x81')](_0x234e2b['serverUrl']);if(_0x2a3166&&_0x2a3166[_0x7774('0x90')]&&_0x2a3166['recordingFormat']!=='none'){logger['info'](_0x7774('0x91'),_0x7774('0x92'));_0x5ccf86[_0x7774('0x85')]=_0x234e2b[_0x7774('0x82')]+_0x7774('0x86')+_0x5ccf86[_0x7774('0x87')]+_0x7774('0x93')+md5(_0x5ccf86['uniqueid']);}var _0x8fc455=_0x234e2b['host']===_0x7774('0x88')?'eu':_0x7774('0x94');return getAccessToken(_0x234e2b)[_0x7774('0x41')](function(_0x2b9c17){_0x239017=_0x2b9c17;return getUser(_0x239017,_0x8fc455,_0x234e2b,_0x40d5d7[_0x7774('0x89')]);})[_0x7774('0x41')](function(_0x3c626d){_0x522195=_0x3c626d;logger[_0x7774('0x39')]('The\x20User\x20ID\x20is:',_0x522195['id']);return getEndUser(_0x239017,_0x8fc455,_0x234e2b,_0x5ccf86[_0x7774('0x95')],_0x5ccf86[_0x7774('0x96')],_0x522195,_0x2b0d21);})[_0x7774('0x41')](function(_0x2053c4){_0x3c0d70=_0x2053c4;return getCall(_0x239017,_0x8fc455,_0x234e2b,_0x522195,_0x3c0d70,_0x2b0d21,_0x5ccf86,_0x7774('0x97'));})[_0x7774('0x41')](function(_0x41466f){if(_0x41466f){logger[_0x7774('0x39')](_0x7774('0x98'),_0x41466f['id']);logger[_0x7774('0x39')]('[OUTBOUND]',_0x7774('0x99'));emit(util[_0x7774('0x32')](_0x7774('0x8c'),_0x40d5d7['name']),_0x7774('0x8d'),{'uri':_0x7774('0x8e')+_0x234e2b[_0x7774('0x80')]+_0x7774('0x8f')+_0x41466f['id']});}})['catch'](function(_0x15c3ac){logger[_0x7774('0x2d')]('[OUTBOUND]',JSON[_0x7774('0xd')](_0x15c3ac));});};exports[_0x7774('0x9a')]=function(_0x5db4dc,_0x579af7,_0x58883f,_0x5f0a84,_0x2a70f9,_0x42292e){var _0x203366,_0x3f344a,_0x37ead9;_0x42292e[_0x7774('0x80')]=intUtil[_0x7774('0x81')](_0x42292e[_0x7774('0x80')]);_0x42292e['serverUrl']=intUtil[_0x7774('0x81')](_0x42292e[_0x7774('0x82')]);if(_0x2a70f9&&_0x2a70f9['monitor_format']){logger[_0x7774('0x39')]('['+_0x579af7[_0x7774('0x9b')][_0x7774('0x9c')]()+']','Recording\x20is\x20enabled!');_0x579af7['recordingURL']=_0x42292e[_0x7774('0x82')]+_0x7774('0x86')+_0x579af7['uniqueid']+_0x7774('0x93')+md5(_0x579af7[_0x7774('0x87')]);}else{_0x579af7[_0x7774('0x85')]='';}var _0x56cd01=_0x42292e[_0x7774('0x80')]===_0x7774('0x88')?'eu':_0x7774('0x94');return getAccessToken(_0x42292e)[_0x7774('0x41')](function(_0x349963){_0x37ead9=_0x349963;return getUser(_0x37ead9,_0x56cd01,_0x42292e);})[_0x7774('0x41')](function(_0x174add){_0x203366=_0x174add;logger[_0x7774('0x39')](_0x7774('0x9d'),_0x203366['id']);return getEndUser(_0x37ead9,_0x56cd01,_0x42292e,_0x579af7[_0x7774('0x8a')],_0x579af7[_0x7774('0x8b')],_0x203366,_0x58883f);})[_0x7774('0x41')](function(_0x5a2ee1){_0x3f344a=_0x5a2ee1;return getCall(_0x37ead9,_0x56cd01,_0x42292e,_0x203366,_0x3f344a,_0x58883f,_0x579af7,_0x7774('0x9e'));})['then'](function(_0x23d3c0){if(_0x23d3c0){logger['info'](_0x7774('0x98'),_0x23d3c0['id']);}})['catch'](function(_0x3519e4){logger[_0x7774('0x2d')]('['+_0x579af7['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x3519e4));});}; \ 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 754a15b..384b2e3 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 _0x3a90=['info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x45462c,_0x3f20e9){var _0x28629b=function(_0x1f672b){while(--_0x1f672b){_0x45462c['push'](_0x45462c['shift']());}};_0x28629b(++_0x3f20e9);}(_0x3a90,0x77));var _0x03a9=function(_0x34cda0,_0x123123){_0x34cda0=_0x34cda0-0x0;var _0x5e1401=_0x3a90[_0x34cda0];return _0x5e1401;};'use strict';var util=require(_0x03a9('0x0'));var sh=require(_0x03a9('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x03a9('0x2'));exports[_0x03a9('0x3')]=function(_0x1b1ca4,_0x105eda){var _0x1cde45=_0x1b1ca4[_0x03a9('0x4')]?_0x1b1ca4['data2']:_0x03a9('0x5');var _0x5637bc=_0x1b1ca4[_0x03a9('0x6')]?Mustache[_0x03a9('0x7')](_0x1b1ca4[_0x03a9('0x6')],_0x105eda):_0x105eda;sh[_0x03a9('0x3')](_0x5637bc,function(_0x5144af,_0x5661f1,_0x4d5720){if(_0x5144af!==0x0){logger[_0x03a9('0x8')](util[_0x03a9('0x9')](_0x03a9('0xa'),_0x1cde45,_0x5637bc,_0x5144af,_0x4d5720));}else{logger[_0x03a9('0xb')](util[_0x03a9('0x9')](_0x03a9('0xc'),_0x1cde45,_0x5637bc,_0x5661f1));}});}; \ No newline at end of file +var _0x812a=['trigger','exec','data2','Script','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger'];(function(_0x4cd82d,_0x3ca566){var _0x4cf686=function(_0x1e11a3){while(--_0x1e11a3){_0x4cd82d['push'](_0x4cd82d['shift']());}};_0x4cf686(++_0x3ca566);}(_0x812a,0x98));var _0xa812=function(_0x2c5766,_0x487574){_0x2c5766=_0x2c5766-0x0;var _0x84086b=_0x812a[_0x2c5766];return _0x84086b;};'use strict';var util=require(_0xa812('0x0'));var sh=require(_0xa812('0x1'));var Mustache=require(_0xa812('0x2'));var logger=require(_0xa812('0x3'))(_0xa812('0x4'));exports[_0xa812('0x5')]=function(_0x14048d,_0x3d8742){var _0xf1af89=_0x14048d[_0xa812('0x6')]?_0x14048d[_0xa812('0x6')]:_0xa812('0x7');var _0xd201ea=_0x14048d[_0xa812('0x8')]?Mustache['render'](_0x14048d[_0xa812('0x8')],_0x3d8742):_0x3d8742;sh['exec'](_0xd201ea,function(_0xce42a6,_0x2da426,_0x29a146){if(_0xce42a6!==0x0){logger['error'](util[_0xa812('0x9')](_0xa812('0xa'),_0xf1af89,_0xd201ea,_0xce42a6,_0x29a146));}else{logger[_0xa812('0xb')](util[_0xa812('0x9')](_0xa812('0xc'),_0xf1af89,_0xd201ea,_0x2da426));}});}; \ 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 e06f8b3..7207f3d 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 _0xfe2e=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','body','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','GET','POST','PUT','data7'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfe2e,0xa8));var _0xefe2=function(_0x52e126,_0x440070){_0x52e126=_0x52e126-0x0;var _0x1337a7=_0xfe2e[_0x52e126];return _0x1337a7;};'use strict';var rp=require(_0xefe2('0x0'));var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0xefe2('0x1'))(_0xefe2('0x2'));exports['exec']=function(_0x5ae51d,_0x393eb5){var _0x38bd65,_0x22192c;var _0x366494={'method':_0x5ae51d[_0xefe2('0x3')][_0xefe2('0x4')](),'uri':Mustache[_0xefe2('0x5')](_0x5ae51d[_0xefe2('0x6')],_0x393eb5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ae51d[_0xefe2('0x7')])===_0xefe2('0x8')&&parseInt(_0x5ae51d['data5'])>=0x1&&parseInt(_0x5ae51d[_0xefe2('0x7')])<=0xa?parseInt(_0x5ae51d['data5'])*0x3e8:0x5*0x3e8};try{_0x366494[_0xefe2('0x9')]=_0x5ae51d['data6']?JSON[_0xefe2('0xa')](Mustache[_0xefe2('0x5')](_0x5ae51d[_0xefe2('0xb')],_0x393eb5)):{};}catch(_0x4be58f){logger[_0xefe2('0xc')](_0x4be58f[_0xefe2('0xd')]);}switch(_0x5ae51d[_0xefe2('0x3')][_0xefe2('0x4')]()){case _0xefe2('0xe'):case'DELETE':_0x38bd65=null;_0x366494['qs']=_0x393eb5;break;case _0xefe2('0xf'):case _0xefe2('0x10'):if(_0x5ae51d[_0xefe2('0x11')]){try{_0x38bd65=JSON[_0xefe2('0xa')](Mustache['render'](_0x5ae51d['data7'],_0x393eb5));_0x366494['body']=_0x38bd65;}catch(_0x3fae9b){logger[_0xefe2('0xc')](_0x3fae9b[_0xefe2('0xd')]);logger[_0xefe2('0xc')](_0xefe2('0x12'));}}else{_0x38bd65=_0x393eb5;_0x366494['body']=_0x38bd65;}break;}logger['info'](util[_0xefe2('0x13')](_0xefe2('0x14'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],JSON[_0xefe2('0x15')](_0x366494)));rp(_0x366494)[_0xefe2('0x16')](function(_0x299722){_0x38bd65=!_[_0xefe2('0x17')](_0x38bd65)?',\x20request\x20body:\x20'+_0x38bd65:'';_0x22192c=typeof _0x299722[_0xefe2('0x18')]===_0xefe2('0x19')?JSON[_0xefe2('0x15')](_0x299722[_0xefe2('0x18')]):_0x299722[_0xefe2('0x18')];logger[_0xefe2('0x1a')](util[_0xefe2('0x13')](_0xefe2('0x1b'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],_0x299722[_0xefe2('0x1c')],_0x22192c));})['catch'](function(_0x1e1370){logger['error'](util[_0xefe2('0x13')](_0xefe2('0x1d'),_0x5ae51d[_0xefe2('0x3')],_0x5ae51d[_0xefe2('0x6')],_0x1e1370[_0xefe2('0x1c')],_0x1e1370['name'],_0x1e1370[_0xefe2('0x1e')]));});}; \ No newline at end of file +var _0xf087=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','data6','parse','render','stack','GET','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format'];(function(_0x1b62a5,_0x1a0518){var _0x871391=function(_0x347d21){while(--_0x347d21){_0x1b62a5['push'](_0x1b62a5['shift']());}};_0x871391(++_0x1a0518);}(_0xf087,0x140));var _0x7f08=function(_0x29df9b,_0xd8b1ef){_0x29df9b=_0x29df9b-0x0;var _0x566705=_0xf087[_0x29df9b];return _0x566705;};'use strict';var rp=require(_0x7f08('0x0'));var util=require(_0x7f08('0x1'));var _=require(_0x7f08('0x2'));var Mustache=require('mustache');var logger=require(_0x7f08('0x3'))(_0x7f08('0x4'));exports['exec']=function(_0x1253ae,_0x197351){var _0x5815cd,_0x462184;var _0x5b014f={'method':_0x1253ae[_0x7f08('0x5')][_0x7f08('0x6')](),'uri':Mustache['render'](_0x1253ae[_0x7f08('0x7')],_0x197351),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1253ae[_0x7f08('0x8')])==='number'&&parseInt(_0x1253ae[_0x7f08('0x8')])>=0x1&&parseInt(_0x1253ae[_0x7f08('0x8')])<=0xa?parseInt(_0x1253ae['data5'])*0x3e8:0x5*0x3e8};try{_0x5b014f['headers']=_0x1253ae[_0x7f08('0x9')]?JSON[_0x7f08('0xa')](Mustache[_0x7f08('0xb')](_0x1253ae[_0x7f08('0x9')],_0x197351)):{};}catch(_0x13c548){logger['error'](_0x13c548[_0x7f08('0xc')]);}switch(_0x1253ae['data1']['toUpperCase']()){case _0x7f08('0xd'):case'DELETE':_0x5815cd=null;_0x5b014f['qs']=_0x197351;break;case'POST':case _0x7f08('0xe'):if(_0x1253ae['data7']){try{_0x5815cd=JSON[_0x7f08('0xa')](Mustache[_0x7f08('0xb')](_0x1253ae[_0x7f08('0xf')],_0x197351));_0x5b014f[_0x7f08('0x10')]=_0x5815cd;}catch(_0x185317){logger['error'](_0x185317[_0x7f08('0xc')]);logger[_0x7f08('0x11')](_0x7f08('0x12'));}}else{_0x5815cd=_0x197351;_0x5b014f['body']=_0x5815cd;}break;}logger[_0x7f08('0x13')](util[_0x7f08('0x14')](_0x7f08('0x15'),_0x1253ae[_0x7f08('0x5')],_0x1253ae[_0x7f08('0x7')],JSON[_0x7f08('0x16')](_0x5b014f)));rp(_0x5b014f)[_0x7f08('0x17')](function(_0x2cb45b){_0x5815cd=!_['isNil'](_0x5815cd)?_0x7f08('0x18')+_0x5815cd:'';_0x462184=typeof _0x2cb45b[_0x7f08('0x10')]===_0x7f08('0x19')?JSON[_0x7f08('0x16')](_0x2cb45b[_0x7f08('0x10')]):_0x2cb45b[_0x7f08('0x10')];logger[_0x7f08('0x13')](util['format'](_0x7f08('0x1a'),_0x1253ae[_0x7f08('0x5')],_0x1253ae['data2'],_0x2cb45b[_0x7f08('0x1b')],_0x462184));})[_0x7f08('0x1c')](function(_0x578333){logger[_0x7f08('0x11')](util[_0x7f08('0x14')](_0x7f08('0x1d'),_0x1253ae[_0x7f08('0x5')],_0x1253ae[_0x7f08('0x7')],_0x578333['statusCode'],_0x578333['name'],_0x578333[_0x7f08('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 3be3bc6..a026b6d 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 _0xe161=['jayson/promise','bluebird','../../config/logger','routing','client','http','rpc','error','message','result','catch'];(function(_0x2e9f22,_0x42fdd4){var _0x328f25=function(_0x4f3046){while(--_0x4f3046){_0x2e9f22['push'](_0x2e9f22['shift']());}};_0x328f25(++_0x42fdd4);}(_0xe161,0x134));var _0x1e16=function(_0x4f2b52,_0xb09854){_0x4f2b52=_0x4f2b52-0x0;var _0x816753=_0xe161[_0x4f2b52];return _0x816753;};'use strict';var jayson=require(_0x1e16('0x0'));var BPromise=require(_0x1e16('0x1'));var logger=require(_0x1e16('0x2'))(_0x1e16('0x3'));var client=jayson[_0x1e16('0x4')][_0x1e16('0x5')]({'port':0x2329});client['Request']=function(_0x121128,_0x3169e3){return new BPromise(function(_0x506bb1,_0x45f020){return client['request'](_0x121128,_0x3169e3)['then'](function(_0x13fa6a){logger['debug'](_0x1e16('0x6'),'routing',_0x121128,_0x3169e3,_0x13fa6a);if(_0x13fa6a[_0x1e16('0x7')]){logger[_0x1e16('0x7')](_0x1e16('0x6'),_0x1e16('0x3'),_0x121128,_0x13fa6a[_0x1e16('0x7')][_0x1e16('0x8')],_0x3169e3);return _0x45f020(_0x13fa6a[_0x1e16('0x7')][_0x1e16('0x8')]);}else{return _0x506bb1(_0x13fa6a[_0x1e16('0x9')]);}})[_0x1e16('0xa')](function(_0x217dad){logger[_0x1e16('0x7')](_0x1e16('0x6'),_0x1e16('0x3'),_0x121128,_0x217dad,_0x3169e3);return _0x45f020(_0x217dad);});});};module['exports']=client; \ No newline at end of file +var _0xc290=['debug','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xc290,0x1b8));var _0x0c29=function(_0xeaa661,_0xe50acb){_0xeaa661=_0xeaa661-0x0;var _0x2855d9=_0xc290[_0xeaa661];return _0x2855d9;};'use strict';var jayson=require(_0x0c29('0x0'));var BPromise=require(_0x0c29('0x1'));var logger=require(_0x0c29('0x2'))(_0x0c29('0x3'));var client=jayson[_0x0c29('0x4')][_0x0c29('0x5')]({'port':0x2329});client[_0x0c29('0x6')]=function(_0x3c0125,_0x4bda27){return new BPromise(function(_0x1529f5,_0x2e866c){return client[_0x0c29('0x7')](_0x3c0125,_0x4bda27)['then'](function(_0x475b1f){logger[_0x0c29('0x8')](_0x0c29('0x9'),_0x0c29('0x3'),_0x3c0125,_0x4bda27,_0x475b1f);if(_0x475b1f[_0x0c29('0xa')]){logger[_0x0c29('0xa')]('rpc','routing',_0x3c0125,_0x475b1f[_0x0c29('0xa')]['message'],_0x4bda27);return _0x2e866c(_0x475b1f[_0x0c29('0xa')][_0x0c29('0xb')]);}else{return _0x1529f5(_0x475b1f[_0x0c29('0xc')]);}})['catch'](function(_0x3d4e14){logger[_0x0c29('0xa')]('rpc','routing',_0x3c0125,_0x3d4e14,_0x4bda27);return _0x2e866c(_0x3d4e14);});});};module[_0x0c29('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 658c34c..dcaffda 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 _0x30ad=['../../config/logger','email','then','getMailAccounts','mailAccounts','listen','getSettings','error','./server','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x30ad,0x68));var _0xd30a=function(_0x70ba6e,_0x365d5a){_0x70ba6e=_0x70ba6e-0x0;var _0x31f02c=_0x30ad[_0x70ba6e];return _0x31f02c;};'use strict';var server=require(_0xd30a('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xd30a('0x1'));var mailAccount=require(_0xd30a('0x2'));var setting=require(_0xd30a('0x3'));var logger=require(_0xd30a('0x4'))(_0xd30a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xd30a('0x6')](mailAccount[_0xd30a('0x7')]())[_0xd30a('0x6')](realtime['initMailAccounts']())[_0xd30a('0x6')](function(){email['refresh'](realtime[_0xd30a('0x8')]);return realtime;});}function main(){return server[_0xd30a('0x9')](realtime,email)[_0xd30a('0x6')](function(){return initRealtime();})[_0xd30a('0x6')](function(){return setting[_0xd30a('0xa')]();})['then'](function(_0xfaf46){return setInterval(initRealtime,_0xfaf46['loginMailFrequency']*0x3e8);})['catch'](function(_0x4ba9a3){logger[_0xd30a('0xb')]('Email\x20service\x20initialization',_0x4ba9a3);});}main(); \ No newline at end of file +var _0x7c4d=['email','resolve','getMailAccounts','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger'];(function(_0x31f725,_0x36e095){var _0x5734ba=function(_0x1f0753){while(--_0x1f0753){_0x31f725['push'](_0x31f725['shift']());}};_0x5734ba(++_0x36e095);}(_0x7c4d,0x8a));var _0xd7c4=function(_0x3d05fd,_0x5ebaea){_0x3d05fd=_0x3d05fd-0x0;var _0x19e716=_0x7c4d[_0x3d05fd];return _0x19e716;};'use strict';var server=require(_0xd7c4('0x0'));var Realtime=require(_0xd7c4('0x1'));var EmailChannel=require(_0xd7c4('0x2'));var mailAccount=require(_0xd7c4('0x3'));var setting=require(_0xd7c4('0x4'));var logger=require(_0xd7c4('0x5'))(_0xd7c4('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xd7c4('0x7')]()['then'](mailAccount[_0xd7c4('0x8')]())[_0xd7c4('0x9')](realtime['initMailAccounts']())[_0xd7c4('0x9')](function(){email[_0xd7c4('0xa')](realtime[_0xd7c4('0xb')]);return realtime;});}function main(){return server[_0xd7c4('0xc')](realtime,email)[_0xd7c4('0x9')](function(){return initRealtime();})['then'](function(){return setting[_0xd7c4('0xd')]();})[_0xd7c4('0x9')](function(_0x3d6478){return setInterval(initRealtime,_0x3d6478[_0xd7c4('0xe')]*0x3e8);})[_0xd7c4('0xf')](function(_0x394ab3){logger[_0xd7c4('0x10')](_0xd7c4('0x11'),_0x394ab3);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 90817a8..d197ea7 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 _0xe255=['mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','mailAccount:update','refresh','service','provider','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError','isNil','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','../rpc/mailAccount','info','start\x20email\x20channel'];(function(_0x1d63d8,_0x3ec6ec){var _0x534135=function(_0x1e9f64){while(--_0x1e9f64){_0x1d63d8['push'](_0x1d63d8['shift']());}};_0x534135(++_0x3ec6ec);}(_0xe255,0xa3));var _0x5e25=function(_0x34b071,_0x415c5b){_0x34b071=_0x34b071-0x0;var _0x1b391d=_0xe255[_0x34b071];return _0x1b391d;};'use strict';var _=require(_0x5e25('0x0'));var moment=require('moment');var BPromise=require(_0x5e25('0x1'));var md5=require(_0x5e25('0x2'));var Redis=require(_0x5e25('0x3'));var config=require(_0x5e25('0x4'));var logger=require(_0x5e25('0x5'))(_0x5e25('0x6'));config[_0x5e25('0x7')]=_[_0x5e25('0x8')](config[_0x5e25('0x7')],{'host':_0x5e25('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e25('0x7')]));var EmailImap=require(_0x5e25('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5e25('0xb'));var md5Accounts={};function EmailChannel(_0x6528f2){logger[_0x5e25('0xc')](_0x5e25('0xd'));this[_0x5e25('0xe')]=_0x6528f2[_0x5e25('0xe')];this[_0x5e25('0xf')]={};this[_0x5e25('0x10')]=new EmailSmtp();}EmailChannel[_0x5e25('0x11')][_0x5e25('0x12')]=function(_0x220c46){var _0x42375b=this['mailAccounts'][_0x220c46];var _0x462696={'id':_0x42375b['id'],'name':_0x42375b[_0x5e25('0x13')],'key':_0x42375b[_0x5e25('0x14')],'active':_0x42375b[_0x5e25('0x15')],'Imap':{'status':_0x42375b[_0x5e25('0x16')][_0x5e25('0x17')],'messageStatus':_0x42375b[_0x5e25('0x16')][_0x5e25('0x18')],'total':_0x42375b[_0x5e25('0x16')][_0x5e25('0x19')]}};if(_['isNil'](md5Accounts[_0x220c46])){md5Accounts[_0x220c46]={};}var _0x529c27=md5(JSON['stringify'](_0x462696));if(md5Accounts[_0x220c46][_0x5e25('0x2')]!==_0x529c27){md5Accounts[_0x220c46][_0x5e25('0x2')]=_0x529c27;io[_0x5e25('0x12')](_0x5e25('0x1a'),_0x462696);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x1b')]=function(_0x2a7d7e){for(var _0x19c953 in _0x2a7d7e){if(_0x2a7d7e['hasOwnProperty'](_0x19c953)){if(_0x2a7d7e[_0x19c953][_0x5e25('0x16')]&&_0x2a7d7e[_0x19c953][_0x5e25('0x15')]){var _0x5d346d=_0x2a7d7e[_0x19c953]['Imap'];if(!_0x5d346d[_0x5e25('0x1c')]&&_0x2a7d7e[_0x19c953][_0x5e25('0x1d')]!=='custom')_0x5d346d['service']=_0x2a7d7e[_0x19c953][_0x5e25('0x1d')];if(!this[_0x5e25('0xf')][_0x5e25('0x1e')](_0x5d346d['id'])){this[_0x5e25('0xf')][_0x5d346d['id']]=new EmailImap(_0x5d346d,_0x2a7d7e[_0x19c953][_0x5e25('0x6')]);this[_0x5e25('0xf')][_0x5d346d['id']]['on'](_0x5e25('0x1f'),this[_0x5e25('0x20')]['bind'](this,_0x19c953));this[_0x5e25('0xf')][_0x5d346d['id']]['on'](_0x5e25('0x6'),this[_0x5e25('0x21')][_0x5e25('0x22')](this,_0x19c953));this['imapAccounts'][_0x5d346d['id']]['on'](_0x5e25('0x23'),this[_0x5e25('0x24')][_0x5e25('0x22')](this,_0x19c953));this[_0x5e25('0xf')][_0x5d346d['id']]['on']('error',this[_0x5e25('0x25')]['bind'](this,_0x19c953));}}else{if(_[_0x5e25('0x26')](this[_0x5e25('0xe')][_0x19c953]['Imap'])){this['mailAccounts'][_0x19c953][_0x5e25('0x16')]={};}this[_0x5e25('0xe')][_0x19c953][_0x5e25('0x16')][_0x5e25('0x17')]='disabled';this[_0x5e25('0xe')][_0x19c953][_0x5e25('0x16')][_0x5e25('0x18')]='';this[_0x5e25('0x12')](_0x19c953);}}}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x20')]=function(_0x4c0599,_0x18a692){if(this[_0x5e25('0xe')][_0x4c0599]){this[_0x5e25('0xe')][_0x4c0599][_0x5e25('0x16')][_0x5e25('0x17')]=_0x5e25('0x27');this[_0x5e25('0xe')][_0x4c0599][_0x5e25('0x16')][_0x5e25('0x18')]=_0x18a692[_0x5e25('0x13')];if(_0x18a692[_0x5e25('0x28')]){this[_0x5e25('0xe')][_0x4c0599]['Imap'][_0x5e25('0x19')]=_0x18a692[_0x5e25('0x28')][_0x5e25('0x19')];}return this['emit'](_0x4c0599);}};EmailChannel['prototype'][_0x5e25('0x21')]=function(_0x32484e,_0x48b05f){logger[_0x5e25('0xc')](_0x5e25('0x29'),_0x48b05f[_0x5e25('0x2a')],_0x48b05f[_0x5e25('0x2b')],_0x48b05f['from'],_0x32484e);if(this['mailAccounts'][_0x32484e]){return mailAccount[_0x5e25('0x2c')](_0x32484e,_0x48b05f)[_0x5e25('0x2d')](function(_0x3191c5){if(_0x3191c5){logger[_0x5e25('0xc')](_0x5e25('0x2e'));}})[_0x5e25('0x2f')](function(_0x39c21c){logger[_0x5e25('0x30')](_0x5e25('0x31'),JSON[_0x5e25('0x32')](_0x39c21c));});}};EmailChannel[_0x5e25('0x11')]['handleImapEnd']=function(_0x308e0a){if(this[_0x5e25('0xe')][_0x308e0a]&&this['mailAccounts'][_0x308e0a]['Imap']){if(this[_0x5e25('0xf')][this['mailAccounts'][_0x308e0a][_0x5e25('0x16')]['id']]){delete this[_0x5e25('0xf')][this[_0x5e25('0xe')][_0x308e0a][_0x5e25('0x16')]['id']];}this[_0x5e25('0xe')][_0x308e0a][_0x5e25('0x16')][_0x5e25('0x33')]=moment();this[_0x5e25('0x12')](_0x308e0a);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x25')]=function(_0x298071,_0x109083){if(this['mailAccounts'][_0x298071]){this[_0x5e25('0xe')][_0x298071][_0x5e25('0x16')]['status']='error';this[_0x5e25('0xe')][_0x298071][_0x5e25('0x16')][_0x5e25('0x18')]=_0x109083;return this[_0x5e25('0x12')](_0x298071);}};EmailChannel[_0x5e25('0x11')][_0x5e25('0x34')]=function(_0x48b871,_0xa9fb51){return this[_0x5e25('0x10')][_0x5e25('0x35')](_0x48b871,_0xa9fb51);};EmailChannel[_0x5e25('0x11')][_0x5e25('0x36')]=function(_0x525699){var _0x564638=this;if(this[_0x5e25('0xe')][_0x525699['id']]){if(_[_0x5e25('0x26')](this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')])){this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')]={};}this[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x33')]=moment();return new BPromise(function(_0x290106,_0x4ecbbe){return _0x564638[_0x5e25('0x10')][_0x5e25('0x38')](_0x525699)[_0x5e25('0x2d')](function(_0x58cf90){_0x564638[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')]['status']=_0x5e25('0x39');_0x564638[_0x5e25('0xe')][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x18')]='';_0x564638[_0x5e25('0x12')](_0x525699['id']);_0x290106(_0x58cf90);})['catch'](function(_0x16a377){_0x564638['mailAccounts'][_0x525699['id']][_0x5e25('0x37')][_0x5e25('0x17')]='error';_0x564638['mailAccounts'][_0x525699['id']]['Smtp'][_0x5e25('0x18')]=_0x16a377;_0x564638['emit'](_0x525699['id']);_0x4ecbbe(_0x16a377);});});}return this[_0x5e25('0x10')]['verify'](_0x525699);};module[_0x5e25('0x3a')]=EmailChannel; \ No newline at end of file +var _0x7a1e=['notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','smtp','prototype','emit','name','active','status','messageStatus','Imap','total','isNil','mailAccount:update','refresh','hasOwnProperty','provider','service','imapAccounts','bind','handleImapEnd','error','handleImapError','mailAccounts','disabled','handleImapBox','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName'];(function(_0x553a72,_0x120470){var _0x410e05=function(_0x40fed8){while(--_0x40fed8){_0x553a72['push'](_0x553a72['shift']());}};_0x410e05(++_0x120470);}(_0x7a1e,0x1cc));var _0xe7a1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7a1e[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xe7a1('0x0'));var moment=require(_0xe7a1('0x1'));var BPromise=require(_0xe7a1('0x2'));var md5=require(_0xe7a1('0x3'));var Redis=require(_0xe7a1('0x4'));var config=require(_0xe7a1('0x5'));var logger=require(_0xe7a1('0x6'))(_0xe7a1('0x7'));config['redis']=_[_0xe7a1('0x8')](config[_0xe7a1('0x9')],{'host':_0xe7a1('0xa'),'port':0x18eb});var io=require(_0xe7a1('0xb'))(new Redis(config[_0xe7a1('0x9')]));var EmailImap=require(_0xe7a1('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xe7a1('0xd'));var md5Accounts={};function EmailChannel(_0x2eaeff){logger[_0xe7a1('0xe')](_0xe7a1('0xf'));this['mailAccounts']=_0x2eaeff['mailAccounts'];this['imapAccounts']={};this[_0xe7a1('0x10')]=new EmailSmtp();}EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x12')]=function(_0x557830){var _0x4b4f65=this['mailAccounts'][_0x557830];var _0x33ede3={'id':_0x4b4f65['id'],'name':_0x4b4f65[_0xe7a1('0x13')],'key':_0x4b4f65['key'],'active':_0x4b4f65[_0xe7a1('0x14')],'Imap':{'status':_0x4b4f65['Imap'][_0xe7a1('0x15')],'messageStatus':_0x4b4f65['Imap'][_0xe7a1('0x16')],'total':_0x4b4f65[_0xe7a1('0x17')][_0xe7a1('0x18')]}};if(_[_0xe7a1('0x19')](md5Accounts[_0x557830])){md5Accounts[_0x557830]={};}var _0x49fde=md5(JSON['stringify'](_0x33ede3));if(md5Accounts[_0x557830][_0xe7a1('0x3')]!==_0x49fde){md5Accounts[_0x557830][_0xe7a1('0x3')]=_0x49fde;io['emit'](_0xe7a1('0x1a'),_0x33ede3);}};EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x1b')]=function(_0xac10cb){for(var _0x5163e5 in _0xac10cb){if(_0xac10cb[_0xe7a1('0x1c')](_0x5163e5)){if(_0xac10cb[_0x5163e5][_0xe7a1('0x17')]&&_0xac10cb[_0x5163e5][_0xe7a1('0x14')]){var _0x38da5f=_0xac10cb[_0x5163e5]['Imap'];if(!_0x38da5f['service']&&_0xac10cb[_0x5163e5][_0xe7a1('0x1d')]!=='custom')_0x38da5f[_0xe7a1('0x1e')]=_0xac10cb[_0x5163e5][_0xe7a1('0x1d')];if(!this[_0xe7a1('0x1f')][_0xe7a1('0x1c')](_0x38da5f['id'])){this[_0xe7a1('0x1f')][_0x38da5f['id']]=new EmailImap(_0x38da5f,_0xac10cb[_0x5163e5][_0xe7a1('0x7')]);this[_0xe7a1('0x1f')][_0x38da5f['id']]['on']('box',this['handleImapBox'][_0xe7a1('0x20')](this,_0x5163e5));this['imapAccounts'][_0x38da5f['id']]['on'](_0xe7a1('0x7'),this['handleImapEmail'][_0xe7a1('0x20')](this,_0x5163e5));this['imapAccounts'][_0x38da5f['id']]['on']('end',this[_0xe7a1('0x21')][_0xe7a1('0x20')](this,_0x5163e5));this[_0xe7a1('0x1f')][_0x38da5f['id']]['on'](_0xe7a1('0x22'),this[_0xe7a1('0x23')][_0xe7a1('0x20')](this,_0x5163e5));}}else{if(_['isNil'](this[_0xe7a1('0x24')][_0x5163e5][_0xe7a1('0x17')])){this[_0xe7a1('0x24')][_0x5163e5][_0xe7a1('0x17')]={};}this[_0xe7a1('0x24')][_0x5163e5][_0xe7a1('0x17')][_0xe7a1('0x15')]=_0xe7a1('0x25');this['mailAccounts'][_0x5163e5][_0xe7a1('0x17')]['messageStatus']='';this[_0xe7a1('0x12')](_0x5163e5);}}}};EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x26')]=function(_0x4f26b6,_0x32bb34){if(this[_0xe7a1('0x24')][_0x4f26b6]){this[_0xe7a1('0x24')][_0x4f26b6][_0xe7a1('0x17')]['status']='connected';this[_0xe7a1('0x24')][_0x4f26b6][_0xe7a1('0x17')][_0xe7a1('0x16')]=_0x32bb34['name'];if(_0x32bb34[_0xe7a1('0x27')]){this['mailAccounts'][_0x4f26b6][_0xe7a1('0x17')][_0xe7a1('0x18')]=_0x32bb34['messages']['total'];}return this[_0xe7a1('0x12')](_0x4f26b6);}};EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x28')]=function(_0x404375,_0x51cd22){logger[_0xe7a1('0xe')](_0xe7a1('0x29'),_0x51cd22[_0xe7a1('0x2a')],_0x51cd22[_0xe7a1('0x2b')],_0x51cd22['from'],_0x404375);if(this[_0xe7a1('0x24')][_0x404375]){return mailAccount[_0xe7a1('0x2c')](_0x404375,_0x51cd22)[_0xe7a1('0x2d')](function(_0x27eead){if(_0x27eead){logger[_0xe7a1('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0xe7a1('0x2e')](function(_0x77c981){logger[_0xe7a1('0x22')](_0xe7a1('0x2f'),JSON[_0xe7a1('0x30')](_0x77c981));});}};EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x21')]=function(_0x85b62d){if(this[_0xe7a1('0x24')][_0x85b62d]&&this[_0xe7a1('0x24')][_0x85b62d][_0xe7a1('0x17')]){if(this['imapAccounts'][this[_0xe7a1('0x24')][_0x85b62d][_0xe7a1('0x17')]['id']]){delete this['imapAccounts'][this[_0xe7a1('0x24')][_0x85b62d][_0xe7a1('0x17')]['id']];}this[_0xe7a1('0x24')][_0x85b62d][_0xe7a1('0x17')][_0xe7a1('0x31')]=moment();this['emit'](_0x85b62d);}};EmailChannel['prototype']['handleImapError']=function(_0x1c3721,_0x354253){if(this['mailAccounts'][_0x1c3721]){this[_0xe7a1('0x24')][_0x1c3721]['Imap'][_0xe7a1('0x15')]=_0xe7a1('0x22');this[_0xe7a1('0x24')][_0x1c3721][_0xe7a1('0x17')][_0xe7a1('0x16')]=_0x354253;return this[_0xe7a1('0x12')](_0x1c3721);}};EmailChannel[_0xe7a1('0x11')]['sendMail']=function(_0x50c3c9,_0x39e43b){return this['smtp'][_0xe7a1('0x32')](_0x50c3c9,_0x39e43b);};EmailChannel[_0xe7a1('0x11')][_0xe7a1('0x33')]=function(_0x597153){var _0x58d482=this;if(this[_0xe7a1('0x24')][_0x597153['id']]){if(_['isNil'](this['mailAccounts'][_0x597153['id']][_0xe7a1('0x34')])){this[_0xe7a1('0x24')][_0x597153['id']][_0xe7a1('0x34')]={};}this['mailAccounts'][_0x597153['id']][_0xe7a1('0x34')]['lastSync']=moment();return new BPromise(function(_0x1afa95,_0x2bdb93){return _0x58d482[_0xe7a1('0x10')][_0xe7a1('0x35')](_0x597153)[_0xe7a1('0x2d')](function(_0x36d9ed){_0x58d482[_0xe7a1('0x24')][_0x597153['id']][_0xe7a1('0x34')][_0xe7a1('0x15')]=_0xe7a1('0x36');_0x58d482[_0xe7a1('0x24')][_0x597153['id']]['Smtp'][_0xe7a1('0x16')]='';_0x58d482[_0xe7a1('0x12')](_0x597153['id']);_0x1afa95(_0x36d9ed);})[_0xe7a1('0x2e')](function(_0x1b1239){_0x58d482['mailAccounts'][_0x597153['id']][_0xe7a1('0x34')]['status']='error';_0x58d482['mailAccounts'][_0x597153['id']][_0xe7a1('0x34')]['messageStatus']=_0x1b1239;_0x58d482[_0xe7a1('0x12')](_0x597153['id']);_0x2bdb93(_0x1b1239);});});}return this[_0xe7a1('0x10')][_0xe7a1('0x35')](_0x597153);};module[_0xe7a1('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 370f545..96b3e22 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 _0xddfc=['authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','port','tls','autotls','required','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','handleReadUnseen','length','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','error','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','util','imap','mailparser','iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','end','handleError','bind','connect','inherits','prototype','connTimeout'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0xddfc,0x1bb));var _0xcddf=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xddfc[_0xbd08b4];return _0x314f1e;};'use strict';var _=require('lodash');var util=require(_0xcddf('0x0'));var Imap=require(_0xcddf('0x1'));var simpleParser=require(_0xcddf('0x2'))['simpleParser'];var Iconv=require(_0xcddf('0x3'))['Iconv'];var EventEmitter=require(_0xcddf('0x4'))[_0xcddf('0x5')];var utils=require(_0xcddf('0x6'));var logger=require('../../../config/logger')(_0xcddf('0x7'));function EmailImap(_0x5bef1f,_0x6adc39){this['mailbox']=_0x5bef1f[_0xcddf('0x8')];this[_0xcddf('0x9')]=this[_0xcddf('0xa')](_0x5bef1f,_0x6adc39);this[_0xcddf('0x1')]=new Imap(this['account']);this[_0xcddf('0x1')][_0xcddf('0xb')](_0xcddf('0xc'),this[_0xcddf('0xd')]['bind'](this));this[_0xcddf('0x1')]['once'](_0xcddf('0xe'),this['handleEnd']['bind'](this));this[_0xcddf('0x1')]['on']('error',this[_0xcddf('0xf')][_0xcddf('0x10')](this));this[_0xcddf('0x1')][_0xcddf('0x11')]();}util[_0xcddf('0x12')](EmailImap,EventEmitter);EmailImap[_0xcddf('0x13')][_0xcddf('0xa')]=function(_0x5eb584,_0x2ce24b){var _0x4a7a3c={'connTimeout':_0x5eb584[_0xcddf('0x14')]?_0x5eb584[_0xcddf('0x14')]*0x3e8:0x2710,'authTimeout':_0x5eb584[_0xcddf('0x15')]?_0x5eb584['authTimeout']*0x3e8:0x1388};if(_0x5eb584[_0xcddf('0x16')]){_0x4a7a3c[_0xcddf('0x17')]=_0x5eb584['user'];if(_0x5eb584[_0xcddf('0x18')]){_0x4a7a3c[_0xcddf('0x19')]=utils[_0xcddf('0x1a')](_0x5eb584['CloudProvider'][_0xcddf('0x1b')],_0x5eb584[_0xcddf('0x17')]);}else{_0x4a7a3c[_0xcddf('0x1c')]=_0x5eb584[_0xcddf('0x1c')];}}else{if(_0x5eb584['authentication']){_0x4a7a3c['user']=_0x5eb584['user'];_0x4a7a3c['password']=_0x5eb584[_0xcddf('0x1c')];}}_0x4a7a3c[_0xcddf('0x7')]=_0x2ce24b||_0x5eb584['user']||'anonymous@xcally.com';_0x4a7a3c['host']=_0x5eb584['host'];_0x4a7a3c[_0xcddf('0x1d')]=_0x5eb584[_0xcddf('0x1d')]||0x3e1;if(_0x5eb584[_0xcddf('0x1e')]){_0x4a7a3c[_0xcddf('0x1e')]=!![];}else{_0x4a7a3c[_0xcddf('0x1e')]=![];_0x4a7a3c[_0xcddf('0x1f')]=_0xcddf('0x20');}return _0x4a7a3c;};EmailImap[_0xcddf('0x13')]['handleReady']=function(){this['imap'][_0xcddf('0x21')](this['mailbox'],![],this[_0xcddf('0x22')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x22')]=function(_0x143613,_0x2270ea){if(_0x143613){this['handleError'](_0x143613,!![]);}else{this[_0xcddf('0x23')](_0xcddf('0x24'),_0x2270ea);this['readUnseen']();}};EmailImap[_0xcddf('0x13')][_0xcddf('0x25')]=function(_0x1fb546){if(_0x1fb546){this['handleError'](_0x1fb546,!![]);}else{this['imap'][_0xcddf('0xe')]();}};EmailImap['prototype'][_0xcddf('0x26')]=function(){this[_0xcddf('0x1')]['search'](['UNSEEN'],this[_0xcddf('0x27')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleReadUnseen']=function(_0x184b4e,_0xfb50f5){if(_0x184b4e){this[_0xcddf('0xf')](_0x184b4e,!![]);}else{if(_0xfb50f5[_0xcddf('0x28')]){try{var _0x5724e1=this[_0xcddf('0x1')]['fetch'](_0xfb50f5,{'bodies':'','markSeen':!![]});_0x5724e1['on'](_0xcddf('0x29'),this[_0xcddf('0x2a')][_0xcddf('0x10')](this));_0x5724e1['once']('error',this['handleFetchError'][_0xcddf('0x10')](this));_0x5724e1[_0xcddf('0xb')](_0xcddf('0xe'),this[_0xcddf('0x2b')][_0xcddf('0x10')](this));}catch(_0x50b2cf){logger['error'](_0x50b2cf);}}else{this['imap'][_0xcddf('0x2c')](!![],this[_0xcddf('0x25')]['bind'](this));}}};EmailImap[_0xcddf('0x13')][_0xcddf('0x2a')]=function(_0x4658b6){_0x4658b6['on'](_0xcddf('0x2d'),this[_0xcddf('0x2e')]['bind'](this));_0x4658b6['once'](_0xcddf('0x2f'),this[_0xcddf('0x30')][_0xcddf('0x10')](this));_0x4658b6[_0xcddf('0xb')](_0xcddf('0xe'),this[_0xcddf('0x31')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleMessageBody']=function(_0x3fa8c4){simpleParser(_0x3fa8c4,{'Iconv':Iconv},this[_0xcddf('0x32')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x30')]=function(){};EmailImap['prototype'][_0xcddf('0x31')]=function(){};EmailImap[_0xcddf('0x13')][_0xcddf('0x32')]=function(_0x2dc03d,_0x1c52ac){if(_0x2dc03d){logger[_0xcddf('0x33')](_0x2dc03d);}else{var _0x1aad06=this;utils[_0xcddf('0x34')](this[_0xcddf('0x9')],_0x1c52ac,function(_0x3a9600){_0x1aad06[_0xcddf('0x23')]('email',_0x3a9600);});}};EmailImap[_0xcddf('0x13')]['handleFetchEnd']=function(){this[_0xcddf('0x1')][_0xcddf('0x2c')](!![],this[_0xcddf('0x25')][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')]['handleFetchError']=function(_0x44b46f){this[_0xcddf('0xf')](_0x44b46f);this[_0xcddf('0x1')][_0xcddf('0x2c')](!![],this['handleCloseBox'][_0xcddf('0x10')](this));};EmailImap[_0xcddf('0x13')][_0xcddf('0x35')]=function(){this[_0xcddf('0x23')](_0xcddf('0xe'));};EmailImap[_0xcddf('0x13')][_0xcddf('0xf')]=function(_0x2125fe,_0x556df4){logger['error']('handleError',this[_0xcddf('0x9')]['email'],JSON[_0xcddf('0x36')](_0x2125fe));var _0x44be13='';if(_0x2125fe){if(_0x2125fe[_0xcddf('0x37')]){_0x44be13=_0x2125fe[_0xcddf('0x37')];}else{for(var _0x4a49f9 in _0x2125fe){if(_0x2125fe[_0xcddf('0x38')](_0x4a49f9)){_0x44be13+=_[_0xcddf('0x39')](_0x4a49f9)+':\x20'+_0x2125fe[_0x4a49f9]+'\x0a';}}}}if(_0x556df4){this[_0xcddf('0x1')][_0xcddf('0xe')]();}else{this['emit'](_0xcddf('0x33'),_0x44be13);this[_0xcddf('0x23')](_0xcddf('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x3d92=['authTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleEnd','textCode','upperFirst','lodash','util','imap','simpleParser','iconv','events','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','connTimeout'];(function(_0x1fd675,_0x587658){var _0x521d1c=function(_0x2d16e0){while(--_0x2d16e0){_0x1fd675['push'](_0x1fd675['shift']());}};_0x521d1c(++_0x587658);}(_0x3d92,0x107));var _0x23d9=function(_0x59c683,_0x209444){_0x59c683=_0x59c683-0x0;var _0x47251b=_0x3d92[_0x59c683];return _0x47251b;};'use strict';var _=require(_0x23d9('0x0'));var util=require(_0x23d9('0x1'));var Imap=require(_0x23d9('0x2'));var simpleParser=require('mailparser')[_0x23d9('0x3')];var Iconv=require(_0x23d9('0x4'))['Iconv'];var EventEmitter=require(_0x23d9('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x23d9('0x6'))(_0x23d9('0x7'));function EmailImap(_0x31d5df,_0x128fed){this[_0x23d9('0x8')]=_0x31d5df[_0x23d9('0x8')];this[_0x23d9('0x9')]=this[_0x23d9('0xa')](_0x31d5df,_0x128fed);this['imap']=new Imap(this[_0x23d9('0x9')]);this[_0x23d9('0x2')][_0x23d9('0xb')](_0x23d9('0xc'),this[_0x23d9('0xd')][_0x23d9('0xe')](this));this[_0x23d9('0x2')][_0x23d9('0xb')](_0x23d9('0xf'),this['handleEnd'][_0x23d9('0xe')](this));this[_0x23d9('0x2')]['on'](_0x23d9('0x10'),this[_0x23d9('0x11')]['bind'](this));this[_0x23d9('0x2')][_0x23d9('0x12')]();}util[_0x23d9('0x13')](EmailImap,EventEmitter);EmailImap[_0x23d9('0x14')][_0x23d9('0xa')]=function(_0x391528,_0x527d59){var _0x4cd3d8={'connTimeout':_0x391528[_0x23d9('0x15')]?_0x391528[_0x23d9('0x15')]*0x3e8:0x2710,'authTimeout':_0x391528[_0x23d9('0x16')]?_0x391528[_0x23d9('0x16')]*0x3e8:0x1388};if(_0x391528[_0x23d9('0x17')]){_0x4cd3d8[_0x23d9('0x18')]=_0x391528[_0x23d9('0x18')];if(_0x391528['modernAuthentication']){_0x4cd3d8[_0x23d9('0x19')]=utils[_0x23d9('0x1a')](_0x391528[_0x23d9('0x1b')][_0x23d9('0x1c')],_0x391528[_0x23d9('0x18')]);}else{_0x4cd3d8[_0x23d9('0x1d')]=_0x391528[_0x23d9('0x1d')];}}else{if(_0x391528[_0x23d9('0x1e')]){_0x4cd3d8['user']=_0x391528[_0x23d9('0x18')];_0x4cd3d8['password']=_0x391528[_0x23d9('0x1d')];}}_0x4cd3d8[_0x23d9('0x7')]=_0x527d59||_0x391528[_0x23d9('0x18')]||_0x23d9('0x1f');_0x4cd3d8[_0x23d9('0x20')]=_0x391528[_0x23d9('0x20')];_0x4cd3d8[_0x23d9('0x21')]=_0x391528['port']||0x3e1;if(_0x391528[_0x23d9('0x22')]){_0x4cd3d8[_0x23d9('0x22')]=!![];}else{_0x4cd3d8[_0x23d9('0x22')]=![];_0x4cd3d8[_0x23d9('0x23')]='required';}return _0x4cd3d8;};EmailImap[_0x23d9('0x14')]['handleReady']=function(){this[_0x23d9('0x2')]['openBox'](this['mailbox'],![],this[_0x23d9('0x24')][_0x23d9('0xe')](this));};EmailImap[_0x23d9('0x14')]['handleOpenBox']=function(_0x4af5cc,_0xbe8bac){if(_0x4af5cc){this[_0x23d9('0x11')](_0x4af5cc,!![]);}else{this[_0x23d9('0x25')](_0x23d9('0x26'),_0xbe8bac);this['readUnseen']();}};EmailImap['prototype'][_0x23d9('0x27')]=function(_0xb4fbef){if(_0xb4fbef){this[_0x23d9('0x11')](_0xb4fbef,!![]);}else{this[_0x23d9('0x2')][_0x23d9('0xf')]();}};EmailImap[_0x23d9('0x14')][_0x23d9('0x28')]=function(){this[_0x23d9('0x2')][_0x23d9('0x29')]([_0x23d9('0x2a')],this['handleReadUnseen'][_0x23d9('0xe')](this));};EmailImap[_0x23d9('0x14')]['handleReadUnseen']=function(_0x1c73ea,_0x434e2a){if(_0x1c73ea){this[_0x23d9('0x11')](_0x1c73ea,!![]);}else{if(_0x434e2a[_0x23d9('0x2b')]){try{var _0x412855=this['imap']['fetch'](_0x434e2a,{'bodies':'','markSeen':!![]});_0x412855['on'](_0x23d9('0x2c'),this[_0x23d9('0x2d')][_0x23d9('0xe')](this));_0x412855[_0x23d9('0xb')](_0x23d9('0x10'),this[_0x23d9('0x2e')][_0x23d9('0xe')](this));_0x412855[_0x23d9('0xb')](_0x23d9('0xf'),this[_0x23d9('0x2f')][_0x23d9('0xe')](this));}catch(_0x32fe05){logger['error'](_0x32fe05);}}else{this[_0x23d9('0x2')][_0x23d9('0x30')](!![],this[_0x23d9('0x27')][_0x23d9('0xe')](this));}}};EmailImap[_0x23d9('0x14')]['handleFetchMessage']=function(_0x313c6b){_0x313c6b['on'](_0x23d9('0x31'),this['handleMessageBody']['bind'](this));_0x313c6b['once'](_0x23d9('0x32'),this[_0x23d9('0x33')][_0x23d9('0xe')](this));_0x313c6b[_0x23d9('0xb')](_0x23d9('0xf'),this[_0x23d9('0x34')][_0x23d9('0xe')](this));};EmailImap[_0x23d9('0x14')]['handleMessageBody']=function(_0x4b4d2a){simpleParser(_0x4b4d2a,{'Iconv':Iconv},this[_0x23d9('0x35')][_0x23d9('0xe')](this));};EmailImap['prototype'][_0x23d9('0x33')]=function(){};EmailImap[_0x23d9('0x14')]['handleMessageEnd']=function(){};EmailImap[_0x23d9('0x14')][_0x23d9('0x35')]=function(_0xa6a98,_0x2cea91){if(_0xa6a98){logger['error'](_0xa6a98);}else{var _0x22b590=this;utils['parser'](this[_0x23d9('0x9')],_0x2cea91,function(_0x6782a3){_0x22b590[_0x23d9('0x25')](_0x23d9('0x7'),_0x6782a3);});}};EmailImap[_0x23d9('0x14')]['handleFetchEnd']=function(){this[_0x23d9('0x2')][_0x23d9('0x30')](!![],this['handleCloseBox'][_0x23d9('0xe')](this));};EmailImap[_0x23d9('0x14')][_0x23d9('0x2e')]=function(_0x2cf638){this[_0x23d9('0x11')](_0x2cf638);this[_0x23d9('0x2')][_0x23d9('0x30')](!![],this[_0x23d9('0x27')][_0x23d9('0xe')](this));};EmailImap[_0x23d9('0x14')][_0x23d9('0x36')]=function(){this[_0x23d9('0x25')](_0x23d9('0xf'));};EmailImap['prototype']['handleError']=function(_0x8809,_0x372654){logger[_0x23d9('0x10')](_0x23d9('0x11'),this['account'][_0x23d9('0x7')],JSON['stringify'](_0x8809));var _0x51d8d2='';if(_0x8809){if(_0x8809['textCode']){_0x51d8d2=_0x8809[_0x23d9('0x37')];}else{for(var _0x35e5a1 in _0x8809){if(_0x8809['hasOwnProperty'](_0x35e5a1)){_0x51d8d2+=_[_0x23d9('0x38')](_0x35e5a1)+':\x20'+_0x8809[_0x35e5a1]+'\x0a';}}}}if(_0x372654){this[_0x23d9('0x2')]['end']();}else{this[_0x23d9('0x25')]('error',_0x51d8d2);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f5f02bd..833dca9 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 _0xc88c=['createTransport','use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0xc88c,0x1e7));var _0xcc88=function(_0x252a7b,_0x33bf97){_0x252a7b=_0x252a7b-0x0;var _0x1d1c3d=_0xc88c[_0x252a7b];return _0x1d1c3d;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xcc88('0x0'));function EmailSmtp(){}EmailSmtp[_0xcc88('0x1')][_0xcc88('0x2')]=function(_0x651a26,_0x5dea5b){return new Promise(function(_0x3ea05e,_0x30cb20){var _0x36177f=nodemailer[_0xcc88('0x3')](_0x651a26);_0x36177f[_0xcc88('0x4')]('compile',inlineBase64());_0x36177f[_0xcc88('0x5')](_0x5dea5b,function(_0x5a4c73,_0x33a2c7){if(_0x5a4c73){_0x30cb20(_0x5a4c73[_0xcc88('0x6')]());}else{_0x3ea05e(_0x33a2c7);}});});};EmailSmtp[_0xcc88('0x1')][_0xcc88('0x7')]=function(_0x362d93){return new Promise(function(_0x1f2dab,_0x4ecbf0){var _0x237837=nodemailer['createTransport'](_0x362d93);_0x237837[_0xcc88('0x7')](function(_0x5571f2,_0x42d4e2){if(_0x5571f2){_0x4ecbf0(_0x5571f2[_0xcc88('0x6')]());}else{if(_0x42d4e2){_0x1f2dab(_0x42d4e2);}else{_0x4ecbf0(_0xcc88('0x8'));}}});});};module[_0xcc88('0x9')]=EmailSmtp; \ No newline at end of file +var _0x739a=['sendMail','toString','prototype','Not\x20verifired','nodemailer-plugin-inline-base64','send','use','compile'];(function(_0x145eb2,_0x396cab){var _0x447d25=function(_0x432b6b){while(--_0x432b6b){_0x145eb2['push'](_0x145eb2['shift']());}};_0x447d25(++_0x396cab);}(_0x739a,0x10c));var _0xa739=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x739a[_0x3a508a];return _0x5a8c34;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa739('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0xa739('0x1')]=function(_0x270e5f,_0x39b6e4){return new Promise(function(_0x47d94e,_0x54b87c){var _0x2a13f8=nodemailer['createTransport'](_0x270e5f);_0x2a13f8[_0xa739('0x2')](_0xa739('0x3'),inlineBase64());_0x2a13f8[_0xa739('0x4')](_0x39b6e4,function(_0x30222f,_0x935bb5){if(_0x30222f){_0x54b87c(_0x30222f[_0xa739('0x5')]());}else{_0x47d94e(_0x935bb5);}});});};EmailSmtp[_0xa739('0x6')]['verify']=function(_0x45c9ed){return new Promise(function(_0x19b7b5,_0x34d475){var _0x1a0efc=nodemailer['createTransport'](_0x45c9ed);_0x1a0efc['verify'](function(_0x468623,_0x47467c){if(_0x468623){_0x34d475(_0x468623[_0xa739('0x5')]());}else{if(_0x47467c){_0x19b7b5(_0x47467c);}else{_0x34d475(_0xa739('0x7'));}}});});};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 cd0215c..886d81c 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 _0xf0dc=['name','indexOf','split','length','slice','join','anonymous','generate','html','test','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','from','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','@xcally.com'];(function(_0x523cd6,_0x242aa1){var _0x3e3484=function(_0x360c02){while(--_0x360c02){_0x523cd6['push'](_0x523cd6['shift']());}};_0x3e3484(++_0x242aa1);}(_0xf0dc,0x117));var _0xcf0d=function(_0x80e9f,_0x1e84eb){_0x80e9f=_0x80e9f-0x0;var _0x49befa=_0xf0dc[_0x80e9f];return _0x49befa;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xcf0d('0x0'));var util=require('util');var tnef=require(_0xcf0d('0x1'));var logger=require(_0xcf0d('0x2'))(_0xcf0d('0x3'));var config=require(_0xcf0d('0x4'));function getAddress(_0x45f23f){var _0x3373f5=_[_0xcf0d('0x5')](_0x45f23f[_0xcf0d('0x6')]);return _0x3373f5&&_0x3373f5[_0xcf0d('0x7')]?_0x3373f5[_0xcf0d('0x7')]:'anonymous'+random['generate'](0x6)+_0xcf0d('0x8');}function getFirstName(_0xe07844){var _0x598e7f=_[_0xcf0d('0x5')](_0xe07844['value']);if(_0x598e7f&&_0x598e7f['name']){if(_0x598e7f[_0xcf0d('0x9')]==_0x598e7f[_0xcf0d('0x7')]){return _0x598e7f[_0xcf0d('0x9')]['substring'](0x0,_0x598e7f['name'][_0xcf0d('0xa')]('@'));}var _0x2f79dc=_0x598e7f[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x2f79dc[_0xcf0d('0xc')]>0x1?_0x2f79dc[_0xcf0d('0xd')](0x0,-0x1)[_0xcf0d('0xe')]('\x20'):_0x598e7f[_0xcf0d('0x9')];}return'Anonymous';}function getLastName(_0x45342a){var _0x51d306=_[_0xcf0d('0x5')](_0x45342a[_0xcf0d('0x6')]);if(_0x51d306&&_0x51d306['name']){var _0x531990=_0x51d306[_0xcf0d('0x9')][_0xcf0d('0xb')](/\s+/);return _0x531990[_0xcf0d('0xc')]>0x1?_0x531990['pop']():'';}return'';}function getMails(_0x3a383c,_0x3bfc74){var _0x36405b='';for(var _0x21b7ec=0x0;_0x21b7ec<_0x3bfc74['value'][_0xcf0d('0xc')];_0x21b7ec+=0x1){if(_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x7')]!==_0x3a383c){if(!_['isEmpty'](_0x36405b)){_0x36405b+=',';}_0x36405b+=_0x3bfc74['value'][_0x21b7ec][_0xcf0d('0x9')]||_0x3bfc74['value'][_0x21b7ec]['address']||'';_0x36405b+='\x20<';_0x36405b+=_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']?_0x3bfc74[_0xcf0d('0x6')][_0x21b7ec]['address']:_0xcf0d('0xf')+random[_0xcf0d('0x10')](0x6)+_0xcf0d('0x8');_0x36405b+='>';}}return _0x36405b;}function parseEmail(_0x1be55b,_0x36b964,_0x3f7fe4){if(_0x36b964[_0xcf0d('0x11')]){var _0x32400e=/)<[^<]*)*<\/script>/gi;while(_0x32400e[_0xcf0d('0x12')](_0x36b964['html'])){_0x36b964[_0xcf0d('0x11')]=_0x36b964[_0xcf0d('0x11')]['replace'](_0x32400e,'');}if(_0x36b964[_0xcf0d('0x11')][_0xcf0d('0x13')](_0xcf0d('0x14'))){var _0x225940=[];_0x36b964[_0xcf0d('0x15')][_0xcf0d('0x16')](_0x576cd9=>{_0x225940[_0xcf0d('0x17')](_0x576cd9[_0xcf0d('0x18')]);});var _0x5eef7e=/]+>/g;var _0x521850=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x26227d=_0x36b964[_0xcf0d('0x11')][_0xcf0d('0x19')](_0x521850,_0xcf0d('0x1a'));var _0x9abafd=_0x26227d['replace'](_0x5eef7e,_0xcf0d('0x1b'));for(let _0x41a20b=0x0;_0x41a20b<_0x225940['length'];_0x41a20b++){var _0x13501a=_0x9abafd[_0xcf0d('0x19')]('_IMG',_0xcf0d('0x1c')+_0x225940[_0x41a20b]+_0xcf0d('0x1d'));_0x9abafd=_0x13501a;}_0x36b964[_0xcf0d('0x11')]=_0x9abafd;}_0x3f7fe4['body']=_0x36b964[_0xcf0d('0x11')];}else{_0x3f7fe4[_0xcf0d('0x1e')]=_0x36b964['textAsHtml'];}if(_0x3f7fe4[_0xcf0d('0x1e')]){_0x3f7fe4[_0xcf0d('0x1e')]=_0x3f7fe4['body'][_0xcf0d('0x19')](/0x0){var _0x2852b2=[_0xcf0d('0x31'),_0xcf0d('0x32'),'Precedence:\x20auto_reply'];for(var _0x2a42db=0x0;_0x2a42db<_0x36b964[_0xcf0d('0x30')]['length'];_0x2a42db++){var _0x3c3f22=_[_0xcf0d('0xa')](_0x2852b2,_0x36b964['headerLines'][_0x2a42db][_0xcf0d('0x33')]);if(_0x3c3f22>=0x0){_0x3f7fe4[_0xcf0d('0x34')]=!![];}}}return _0x3f7fe4;}exports['parser']=function(_0x50b847,_0x5907a3,_0x5e7133){var _0x112b7a={'from':getAddress(_0x5907a3['from']),'firstName':getFirstName(_0x5907a3['from']),'lastName':getLastName(_0x5907a3['from']),'mapKey':_0xcf0d('0x3'),'message':{'from':getMails(_0x50b847['email'],_0x5907a3['from']),'to':_0x50b847[_0xcf0d('0x3')],'cc':'','subject':_0x5907a3['subject']||'','messageId':_0x5907a3[_0xcf0d('0x35')],'inReplyTo':_0x5907a3[_0xcf0d('0x36')],'sentAt':moment(_0x5907a3[_0xcf0d('0x37')])[_0xcf0d('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x5907a3[_0xcf0d('0x11')]&&!_0x5907a3['textAsHtml']){var _0x1e4420=_['filter'](_0x5907a3['attachments'],{'contentType':'application/ms-tnef'});if(_0x1e4420[_0xcf0d('0xc')]){logger[_0xcf0d('0x38')](util[_0xcf0d('0x29')](_0xcf0d('0x39'),_0x5907a3['messageId']));tnef[_0xcf0d('0x3a')](_[_0xcf0d('0x3b')](_0x1e4420)[_0xcf0d('0x3c')],function(_0x332c05,_0x88a168){if(_0x88a168){_0x5907a3[_0xcf0d('0x11')]=_0x88a168[_0xcf0d('0x3d')]||_0xcf0d('0x3e');if(_0x88a168[_0xcf0d('0x3f')]){for(var _0x3bc187=0x0;_0x3bc187<_0x88a168[_0xcf0d('0x3f')][_0xcf0d('0xc')];_0x3bc187++){var _0x256ef1=_0x88a168[_0xcf0d('0x3f')][_0x3bc187];_0x112b7a['message'][_0xcf0d('0x15')]['push']({'filename':_0x256ef1['Title'],'content':Buffer[_0xcf0d('0x40')](_0x256ef1[_0xcf0d('0x41')])});}}}_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));});}else{_0x5907a3[_0xcf0d('0x11')]=_0xcf0d('0x3e');_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));}}else{_0x5e7133(parseEmail(_0x50b847,_0x5907a3,_0x112b7a));}};exports[_0xcf0d('0x42')]=function(_0xdcafc0,_0xbf625){var _0xaa1f36=[_0xcf0d('0x43')+(_0xbf625||''),_0xcf0d('0x44')+_0xdcafc0,'',''];return Buffer['from'](_0xaa1f36[_0xcf0d('0xe')](''),_0xcf0d('0x45'))[_0xcf0d('0x46')](_0xcf0d('0x47'));}; \ No newline at end of file +var _0x0bfc=['parser','from','messageId','date','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','address','generate','value','name','substring','indexOf','split','length','join','Anonymous','head','pop','isEmpty','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x1be2b2['slice'](0x0,-0x1)[_0xc0bf('0x10')]('\x20'):_0x12192d[_0xc0bf('0xb')];}return _0xc0bf('0x11');}function getLastName(_0x2b951d){var _0x1139db=_[_0xc0bf('0x12')](_0x2b951d[_0xc0bf('0xa')]);if(_0x1139db&&_0x1139db[_0xc0bf('0xb')]){var _0x1c47b4=_0x1139db['name'][_0xc0bf('0xe')](/\s+/);return _0x1c47b4[_0xc0bf('0xf')]>0x1?_0x1c47b4[_0xc0bf('0x13')]():'';}return'';}function getMails(_0x15f730,_0x5818f7){var _0x5399e1='';for(var _0x16b850=0x0;_0x16b850<_0x5818f7[_0xc0bf('0xa')]['length'];_0x16b850+=0x1){if(_0x5818f7[_0xc0bf('0xa')][_0x16b850][_0xc0bf('0x8')]!==_0x15f730){if(!_[_0xc0bf('0x14')](_0x5399e1)){_0x5399e1+=',';}_0x5399e1+=_0x5818f7[_0xc0bf('0xa')][_0x16b850][_0xc0bf('0xb')]||_0x5818f7['value'][_0x16b850][_0xc0bf('0x8')]||'';_0x5399e1+='\x20<';_0x5399e1+=_0x5818f7[_0xc0bf('0xa')][_0x16b850][_0xc0bf('0x8')]?_0x5818f7[_0xc0bf('0xa')][_0x16b850][_0xc0bf('0x8')]:'anonymous'+random[_0xc0bf('0x9')](0x6)+_0xc0bf('0x15');_0x5399e1+='>';}}return _0x5399e1;}function parseEmail(_0x265eb6,_0x364349,_0x38f65d){if(_0x364349[_0xc0bf('0x16')]){var _0x38099e=/)<[^<]*)*<\/script>/gi;while(_0x38099e[_0xc0bf('0x17')](_0x364349[_0xc0bf('0x16')])){_0x364349[_0xc0bf('0x16')]=_0x364349['html'][_0xc0bf('0x18')](_0x38099e,'');}if(_0x364349[_0xc0bf('0x16')][_0xc0bf('0x19')](_0xc0bf('0x1a'))){var _0x3aceac=[];_0x364349[_0xc0bf('0x1b')]['forEach'](_0x38796a=>{_0x3aceac[_0xc0bf('0x1c')](_0x38796a[_0xc0bf('0x1d')]);});var _0x4fe9d6=/]+>/g;var _0x251f80=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x364af7=_0x364349[_0xc0bf('0x16')][_0xc0bf('0x18')](_0x251f80,_0xc0bf('0x1e'));var _0x1c71c8=_0x364af7[_0xc0bf('0x18')](_0x4fe9d6,'_IMG');for(let _0x1016a1=0x0;_0x1016a1<_0x3aceac[_0xc0bf('0xf')];_0x1016a1++){var _0x2f0309=_0x1c71c8[_0xc0bf('0x18')](_0xc0bf('0x1f'),_0xc0bf('0x20')+_0x3aceac[_0x1016a1]+_0xc0bf('0x21'));_0x1c71c8=_0x2f0309;}_0x364349[_0xc0bf('0x16')]=_0x1c71c8;}_0x38f65d[_0xc0bf('0x22')]=_0x364349[_0xc0bf('0x16')];}else{_0x38f65d[_0xc0bf('0x22')]=_0x364349['textAsHtml'];}if(_0x38f65d[_0xc0bf('0x22')]){_0x38f65d['body']=_0x38f65d[_0xc0bf('0x22')]['replace'](/0x0){var _0x265079=[_0xc0bf('0x34'),_0xc0bf('0x35'),_0xc0bf('0x36')];for(var _0x324b0c=0x0;_0x324b0c<_0x364349[_0xc0bf('0x33')][_0xc0bf('0xf')];_0x324b0c++){var _0x561211=_['indexOf'](_0x265079,_0x364349[_0xc0bf('0x33')][_0x324b0c][_0xc0bf('0x37')]);if(_0x561211>=0x0){_0x38f65d[_0xc0bf('0x38')]=!![];}}}return _0x38f65d;}exports[_0xc0bf('0x39')]=function(_0x487aa1,_0x28f4e7,_0x269ce6){var _0x36ce4c={'from':getAddress(_0x28f4e7[_0xc0bf('0x3a')]),'firstName':getFirstName(_0x28f4e7[_0xc0bf('0x3a')]),'lastName':getLastName(_0x28f4e7[_0xc0bf('0x3a')]),'mapKey':_0xc0bf('0x6'),'message':{'from':getMails(_0x487aa1[_0xc0bf('0x6')],_0x28f4e7[_0xc0bf('0x3a')]),'to':_0x487aa1[_0xc0bf('0x6')],'cc':'','subject':_0x28f4e7['subject']||'','messageId':_0x28f4e7[_0xc0bf('0x3b')],'inReplyTo':_0x28f4e7['inReplyTo'],'sentAt':moment(_0x28f4e7[_0xc0bf('0x3c')])[_0xc0bf('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x28f4e7[_0xc0bf('0x16')]&&!_0x28f4e7[_0xc0bf('0x3d')]){var _0x439f03=_[_0xc0bf('0x3e')](_0x28f4e7['attachments'],{'contentType':_0xc0bf('0x3f')});if(_0x439f03[_0xc0bf('0xf')]){logger[_0xc0bf('0x40')](util['format'](_0xc0bf('0x41'),_0x28f4e7[_0xc0bf('0x3b')]));tnef['parseBuffer'](_[_0xc0bf('0x42')](_0x439f03)[_0xc0bf('0x31')],function(_0x272329,_0x1ec562){if(_0x1ec562){_0x28f4e7[_0xc0bf('0x16')]=_0x1ec562[_0xc0bf('0x43')]||_0xc0bf('0x44');if(_0x1ec562[_0xc0bf('0x45')]){for(var _0x5cf8b2=0x0;_0x5cf8b2<_0x1ec562[_0xc0bf('0x45')][_0xc0bf('0xf')];_0x5cf8b2++){var _0xd8377e=_0x1ec562[_0xc0bf('0x45')][_0x5cf8b2];_0x36ce4c[_0xc0bf('0x24')][_0xc0bf('0x1b')][_0xc0bf('0x1c')]({'filename':_0xd8377e[_0xc0bf('0x46')],'content':Buffer['from'](_0xd8377e[_0xc0bf('0x47')])});}}}_0x269ce6(parseEmail(_0x487aa1,_0x28f4e7,_0x36ce4c));});}else{_0x28f4e7['html']='

Empty\x20message

';_0x269ce6(parseEmail(_0x487aa1,_0x28f4e7,_0x36ce4c));}}else{_0x269ce6(parseEmail(_0x487aa1,_0x28f4e7,_0x36ce4c));}};exports[_0xc0bf('0x48')]=function(_0x32632d,_0x456e3e){var _0x5332c9=['user='+(_0x456e3e||''),_0xc0bf('0x49')+_0x32632d,'',''];return Buffer['from'](_0x5332c9[_0xc0bf('0x10')](''),_0xc0bf('0x4a'))['toString'](_0xc0bf('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index eb96eab..551e961 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 _0xf7a8=['key','active','Imap','Smtp','exports','lodash','name','Service'];(function(_0x1d240a,_0x21c141){var _0x47c313=function(_0x4a4b00){while(--_0x4a4b00){_0x1d240a['push'](_0x1d240a['shift']());}};_0x47c313(++_0x21c141);}(_0xf7a8,0xa5));var _0x8f7a=function(_0x10dce4,_0x485f0f){_0x10dce4=_0x10dce4-0x0;var _0x2fb99c=_0xf7a8[_0x10dce4];return _0x2fb99c;};'use strict';var _=require(_0x8f7a('0x0'));function MailAccount(_0x3e2e27){this['id']=_0x3e2e27['id']||0x0;this[_0x8f7a('0x1')]=_0x3e2e27[_0x8f7a('0x1')]||_0x8f7a('0x2');this[_0x8f7a('0x3')]=_0x3e2e27[_0x8f7a('0x3')]||'SERV';this['active']=_0x3e2e27[_0x8f7a('0x4')]||![];this[_0x8f7a('0x5')]=_0x3e2e27[_0x8f7a('0x5')]||[];this[_0x8f7a('0x6')]=_0x3e2e27[_0x8f7a('0x6')]||[];}module[_0x8f7a('0x7')]=MailAccount; \ No newline at end of file +var _0x3c6f=['active','Imap','Smtp','exports','lodash','key','SERV'];(function(_0x569f14,_0x516664){var _0xcb17bb=function(_0x34ebcd){while(--_0x34ebcd){_0x569f14['push'](_0x569f14['shift']());}};_0xcb17bb(++_0x516664);}(_0x3c6f,0x154));var _0xf3c6=function(_0x1b73ba,_0x526301){_0x1b73ba=_0x1b73ba-0x0;var _0x41684d=_0x3c6f[_0x1b73ba];return _0x41684d;};'use strict';var _=require(_0xf3c6('0x0'));function MailAccount(_0x3faaba){this['id']=_0x3faaba['id']||0x0;this['name']=_0x3faaba['name']||'Service';this[_0xf3c6('0x1')]=_0x3faaba[_0xf3c6('0x1')]||_0xf3c6('0x2');this[_0xf3c6('0x3')]=_0x3faaba[_0xf3c6('0x3')]||![];this[_0xf3c6('0x4')]=_0x3faaba['Imap']||[];this['Smtp']=_0x3faaba[_0xf3c6('0x5')]||[];}module[_0xf3c6('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4eb4c96..de4236d 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 _0x128e=['merge','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined'];(function(_0x402030,_0x3501b9){var _0x453311=function(_0x2012a1){while(--_0x2012a1){_0x402030['push'](_0x402030['shift']());}};_0x453311(++_0x3501b9);}(_0x128e,0x123));var _0xe128=function(_0x1c382c,_0x3dbb3a){_0x1c382c=_0x1c382c-0x0;var _0x150eac=_0x128e[_0x1c382c];return _0x150eac;};'use strict';var _=require(_0xe128('0x0'));var MailAccount=require(_0xe128('0x1'));var Realtime=function(){this[_0xe128('0x2')]={};};function freeIsNotKey(_0x1a92cc,_0x37985d,_0x5abe9e){var _0x4be38d=_['mapKeys'](_0x1a92cc,function(_0x255669,_0x18a413){return _0x255669[_0x5abe9e];});for(var _0x4c2c3e in _0x37985d){if(_0x37985d[_0xe128('0x3')](_0x4c2c3e)){if(!_0x4be38d[_0x4c2c3e]){delete _0x37985d[_0x4c2c3e];}}}}Realtime['prototype'][_0xe128('0x4')]=function(_0x4c3216,_0x1b2941){for(var _0x34e941 in _0x1b2941){if(_0x4c3216[_0xe128('0x3')](_0x34e941)){_0x4c3216[_0x34e941]=_0x1b2941[_0x34e941];}}};Realtime[_0xe128('0x5')][_0xe128('0x6')]=function(){var _0x45c4ee=this;return function(_0x21f3df){if(_0x21f3df){freeIsNotKey(_0x21f3df,_0x45c4ee[_0xe128('0x2')],'id');for(var _0x32260f=0x0,_0x309324={},_0x3453a8={};_0x32260f<_0x21f3df[_0xe128('0x7')];_0x32260f+=0x1){_0x309324=_0x21f3df[_0x32260f];if(_[_0xe128('0x8')](_0x45c4ee['mailAccounts'][_0x309324['id']])){_0x45c4ee['mailAccounts'][_0x309324['id']]=new MailAccount(_0x309324);}else{_[_0xe128('0x9')](_0x45c4ee[_0xe128('0x2')][_0x309324['id']],_0x309324);}}}return _0x45c4ee[_0xe128('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0xf667=['isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','length'];(function(_0x3f4567,_0x33dcd6){var _0x56e527=function(_0x31679c){while(--_0x31679c){_0x3f4567['push'](_0x3f4567['shift']());}};_0x56e527(++_0x33dcd6);}(_0xf667,0x8f));var _0x7f66=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf667[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x7f66('0x0'));var MailAccount=require(_0x7f66('0x1'));var Realtime=function(){this[_0x7f66('0x2')]={};};function freeIsNotKey(_0x25f04f,_0x6c3fa3,_0x244fe7){var _0x20338f=_[_0x7f66('0x3')](_0x25f04f,function(_0x25d595,_0x6ef48e){return _0x25d595[_0x244fe7];});for(var _0xbdf6d in _0x6c3fa3){if(_0x6c3fa3[_0x7f66('0x4')](_0xbdf6d)){if(!_0x20338f[_0xbdf6d]){delete _0x6c3fa3[_0xbdf6d];}}}}Realtime[_0x7f66('0x5')]['mergeFromDatabase']=function(_0x3ab738,_0x2dc438){for(var _0x287176 in _0x2dc438){if(_0x3ab738[_0x7f66('0x4')](_0x287176)){_0x3ab738[_0x287176]=_0x2dc438[_0x287176];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x58a582=this;return function(_0x5cf84e){if(_0x5cf84e){freeIsNotKey(_0x5cf84e,_0x58a582[_0x7f66('0x2')],'id');for(var _0x251915=0x0,_0x48be31={},_0x35edd0={};_0x251915<_0x5cf84e[_0x7f66('0x6')];_0x251915+=0x1){_0x48be31=_0x5cf84e[_0x251915];if(_[_0x7f66('0x7')](_0x58a582['mailAccounts'][_0x48be31['id']])){_0x58a582['mailAccounts'][_0x48be31['id']]=new MailAccount(_0x48be31);}else{_[_0x7f66('0x8')](_0x58a582['mailAccounts'][_0x48be31['id']],_0x48be31);}}}return _0x58a582[_0x7f66('0x2')];};};module[_0x7f66('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 9dccde4..7a799f2 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 _0x7d8d=['notify','NotifyMailAccount','../client','getMailAccounts','Request','name','service','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','getMailAccount'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x7d8d,0x134));var _0xd7d8=function(_0x412fa4,_0x30f02a){_0x412fa4=_0x412fa4-0x0;var _0x3e1038=_0x7d8d[_0x412fa4];return _0x3e1038;};'use strict';var client=require(_0xd7d8('0x0'));exports[_0xd7d8('0x1')]=function(){return function(){return client[_0xd7d8('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xd7d8('0x3'),'provider',_0xd7d8('0x4'),_0xd7d8('0x5'),_0xd7d8('0x6'),_0xd7d8('0x7'),'ListId',_0xd7d8('0x8')],'raw':![],'include':[{'model':_0xd7d8('0x9'),'as':_0xd7d8('0xa'),'include':[{'model':_0xd7d8('0xb'),'attributes':['id',_0xd7d8('0x3'),_0xd7d8('0x4'),_0xd7d8('0xc'),_0xd7d8('0xd')],'as':_0xd7d8('0xb')}]},{'model':_0xd7d8('0xe'),'as':'Smtp','include':[{'model':_0xd7d8('0xb'),'attributes':['id','name',_0xd7d8('0x4'),_0xd7d8('0xc'),_0xd7d8('0xd')],'as':_0xd7d8('0xb')}]}]},'log':_0xd7d8('0xf')});};};exports[_0xd7d8('0x10')]=function(_0x49e210,_0x5ed3b6){return client[_0xd7d8('0x2')](_0xd7d8('0x11'),{'account':{'id':_0x49e210},'body':_0x5ed3b6,'log':_0xd7d8('0x11')});}; \ No newline at end of file +var _0xf17a=['MailServerOut','type','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','data5'];(function(_0x1d149f,_0x546683){var _0x44c40a=function(_0x28d47b){while(--_0x28d47b){_0x1d149f['push'](_0x1d149f['shift']());}};_0x44c40a(++_0x546683);}(_0xf17a,0x136));var _0xaf17=function(_0x1a4a21,_0x4f8b44){_0x1a4a21=_0x1a4a21-0x0;var _0x10afab=_0xf17a[_0x1a4a21];return _0x10afab;};'use strict';var client=require(_0xaf17('0x0'));exports[_0xaf17('0x1')]=function(){return function(){return client[_0xaf17('0x2')](_0xaf17('0x3'),{'options':{'attributes':['id',_0xaf17('0x4'),_0xaf17('0x5'),'service','email','active',_0xaf17('0x6'),_0xaf17('0x7'),_0xaf17('0x8')],'raw':![],'include':[{'model':_0xaf17('0x9'),'as':_0xaf17('0xa'),'include':[{'model':_0xaf17('0xb'),'attributes':['id','name',_0xaf17('0xc'),'type',_0xaf17('0xd')],'as':_0xaf17('0xb')}]},{'model':_0xaf17('0xe'),'as':'Smtp','include':[{'model':_0xaf17('0xb'),'attributes':['id',_0xaf17('0x4'),_0xaf17('0xc'),_0xaf17('0xf'),_0xaf17('0xd')],'as':_0xaf17('0xb')}]}]},'log':_0xaf17('0x10')});};};exports['notify']=function(_0x46166f,_0x52c772){return client['Request'](_0xaf17('0x11'),{'account':{'id':_0x46166f},'body':_0x52c772,'log':_0xaf17('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index d9f219c..52263ab 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 _0x0c4a=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x259c7e,_0x96223a){var _0x15d791=function(_0x5f4198){while(--_0x5f4198){_0x259c7e['push'](_0x259c7e['shift']());}};_0x15d791(++_0x96223a);}(_0x0c4a,0x1cc));var _0xa0c4=function(_0x234c01,_0x25e549){_0x234c01=_0x234c01-0x0;var _0x494f70=_0x0c4a[_0x234c01];return _0x494f70;};'use strict';var client=require('../client');exports[_0xa0c4('0x0')]=function(){return client[_0xa0c4('0x1')](_0xa0c4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xa0c4('0x3')});}; \ No newline at end of file +var _0xab25=['loginMailFrequency','getSettings','Request','ShowSetting'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xab25,0x13d));var _0x5ab2=function(_0x5e8a5b,_0x529bfc){_0x5e8a5b=_0x5e8a5b-0x0;var _0x1f118f=_0xab25[_0x5e8a5b];return _0x1f118f;};'use strict';var client=require('../client');exports[_0x5ab2('0x0')]=function(){return client[_0x5ab2('0x1')](_0x5ab2('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5ab2('0x3')]},'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 6797de3..eb21a02 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 fe07048..fd5f4a7 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 _0xe51f=['../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','sticky-session','ioredis','timeout','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default'];(function(_0xba9f0e,_0x5bbe9e){var _0x4bd05c=function(_0x10ddfa){while(--_0x10ddfa){_0xba9f0e['push'](_0xba9f0e['shift']());}};_0x4bd05c(++_0x5bbe9e);}(_0xe51f,0x13a));var _0xfe51=function(_0x110063,_0x265e26){_0x110063=_0x110063-0x0;var _0x47ecc5=_0xe51f[_0x110063];return _0x47ecc5;};'use strict';var _=require('lodash');var http=require(_0xfe51('0x0'));var express=require(_0xfe51('0x1'));var sticky=require(_0xfe51('0x2'));var Redis=require(_0xfe51('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xfe51('0x4')]=0xdbba0;if(sticky[_0xfe51('0x5')](server,config['port'])){var socketio=require(_0xfe51('0x6'))(server,{'transports':[_0xfe51('0x7'),_0xfe51('0x8')]});config[_0xfe51('0x9')]=_[_0xfe51('0xa')](config[_0xfe51('0x9')],{'host':_0xfe51('0xb'),'port':0x18eb});socketio[_0xfe51('0xc')](require(_0xfe51('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xfe51('0xe'))[_0xfe51('0xf')]();require(_0xfe51('0x10'))[_0xfe51('0xf')](socketio);require('../../config/express')['default'](app);require(_0xfe51('0x11'))[_0xfe51('0xf')](app);}else{server[_0xfe51('0x12')](_0xfe51('0x13'),function(){console[_0xfe51('0x14')](_0xfe51('0x15'),config['port']);});}exports=module['exports']=app; \ No newline at end of file +var _0xef3c=['listening','log','exports','core-js/web','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once'];(function(_0x2c649b,_0x3033d2){var _0x1a6057=function(_0x1c1d3c){while(--_0x1c1d3c){_0x2c649b['push'](_0x2c649b['shift']());}};_0x1a6057(++_0x3033d2);}(_0xef3c,0x1de));var _0xcef3=function(_0x4fe5ab,_0x548401){_0x4fe5ab=_0x4fe5ab-0x0;var _0xfeaf92=_0xef3c[_0x4fe5ab];return _0xfeaf92;};'use strict';require(_0xcef3('0x0'));var _=require(_0xcef3('0x1'));var http=require(_0xcef3('0x2'));var express=require(_0xcef3('0x3'));var sticky=require(_0xcef3('0x4'));var Redis=require('ioredis');var config=require(_0xcef3('0x5'));var app=express();var server=http[_0xcef3('0x6')](app);server[_0xcef3('0x7')]=0xdbba0;if(sticky[_0xcef3('0x8')](server,config[_0xcef3('0x9')])){var socketio=require(_0xcef3('0xa'))(server,{'transports':['websocket',_0xcef3('0xb')]});config[_0xcef3('0xc')]=_['defaults'](config[_0xcef3('0xc')],{'host':_0xcef3('0xd'),'port':0x18eb});socketio[_0xcef3('0xe')](require(_0xcef3('0xf'))({'pubClient':new Redis(config[_0xcef3('0xc')]),'subClient':new Redis(config[_0xcef3('0xc')])}));require(_0xcef3('0x10'))[_0xcef3('0x11')]();require(_0xcef3('0x12'))['default'](socketio);require(_0xcef3('0x13'))['default'](app);require(_0xcef3('0x14'))['default'](app);}else{server[_0xcef3('0x15')](_0xcef3('0x16'),function(){console[_0xcef3('0x17')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcef3('0x9')]);});}exports=module[_0xcef3('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 69b1781..7639b6d 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 _0x6dfe=['exports','jayson/promise','bluebird','../../config/logger','http','Request','then','debug','rpc','routing','error','result','catch'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x6dfe,0x160));var _0xe6df=function(_0x393dc9,_0x3b18b0){_0x393dc9=_0x393dc9-0x0;var _0x287fd3=_0x6dfe[_0x393dc9];return _0x287fd3;};'use strict';var jayson=require(_0xe6df('0x0'));var BPromise=require(_0xe6df('0x1'));var logger=require(_0xe6df('0x2'))('routing');var client=jayson['client'][_0xe6df('0x3')]({'port':0x2329});client[_0xe6df('0x4')]=function(_0x510c7d,_0x4bb342){return new BPromise(function(_0x250cdd,_0x407552){return client['request'](_0x510c7d,_0x4bb342)[_0xe6df('0x5')](function(_0x37276e){logger[_0xe6df('0x6')](_0xe6df('0x7'),_0xe6df('0x8'),_0x510c7d,_0x4bb342,_0x37276e);if(_0x37276e[_0xe6df('0x9')]){logger[_0xe6df('0x9')](_0xe6df('0x7'),_0xe6df('0x8'),_0x510c7d,_0x37276e[_0xe6df('0x9')]['message'],_0x4bb342);return _0x407552(_0x37276e[_0xe6df('0x9')]['message']);}else{return _0x250cdd(_0x37276e[_0xe6df('0xa')]);}})[_0xe6df('0xb')](function(_0x3a7dce){logger[_0xe6df('0x9')]('rpc',_0xe6df('0x8'),_0x510c7d,_0x3a7dce,_0x4bb342);return _0x407552(_0x3a7dce);});});};module[_0xe6df('0xc')]=client; \ No newline at end of file +var _0xffc5=['jayson/promise','bluebird','../../config/logger','routing','client','Request','then','debug','rpc','error','message','result','catch'];(function(_0x5be810,_0x19c182){var _0x33101e=function(_0x3a92ef){while(--_0x3a92ef){_0x5be810['push'](_0x5be810['shift']());}};_0x33101e(++_0x19c182);}(_0xffc5,0x111));var _0x5ffc=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xffc5[_0x1ac120];return _0x19b703;};'use strict';var jayson=require(_0x5ffc('0x0'));var BPromise=require(_0x5ffc('0x1'));var logger=require(_0x5ffc('0x2'))(_0x5ffc('0x3'));var client=jayson[_0x5ffc('0x4')]['http']({'port':0x2329});client[_0x5ffc('0x5')]=function(_0x20a1a0,_0x2f6985){return new BPromise(function(_0x2e84f1,_0x50f339){return client['request'](_0x20a1a0,_0x2f6985)[_0x5ffc('0x6')](function(_0x5b16f5){logger[_0x5ffc('0x7')](_0x5ffc('0x8'),_0x5ffc('0x3'),_0x20a1a0,_0x2f6985,_0x5b16f5);if(_0x5b16f5['error']){logger[_0x5ffc('0x9')](_0x5ffc('0x8'),_0x5ffc('0x3'),_0x20a1a0,_0x5b16f5[_0x5ffc('0x9')][_0x5ffc('0xa')],_0x2f6985);return _0x50f339(_0x5b16f5[_0x5ffc('0x9')][_0x5ffc('0xa')]);}else{return _0x2e84f1(_0x5b16f5[_0x5ffc('0xb')]);}})[_0x5ffc('0xc')](function(_0xb9ebf3){logger[_0x5ffc('0x9')]('rpc',_0x5ffc('0x3'),_0x20a1a0,_0xb9ebf3,_0x2f6985);return _0x50f339(_0xb9ebf3);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 90bd611..4b9cb14 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 _0xd8ac=['getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0xd8ac,0x1e3));var _0xcd8a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd8ac[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require(_0xcd8a('0x0'));var server=require(_0xcd8a('0x1'));var Realtime=require(_0xcd8a('0x2'));var user=require(_0xcd8a('0x3'));var interval=require(_0xcd8a('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcd8a('0x5'));var smsQueue=require(_0xcd8a('0x6'));var mailQueue=require(_0xcd8a('0x7'));var faxQueue=require(_0xcd8a('0x8'));var whatsappQueue=require(_0xcd8a('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcd8a('0xa')]()[_0xcd8a('0xb')](user['getAgents']())[_0xcd8a('0xb')](realtime[_0xcd8a('0xc')]())[_0xcd8a('0xb')](interval[_0xcd8a('0xd')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0xe')]())[_0xcd8a('0xb')](openchannelQueue[_0xcd8a('0xf')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x10')]())['then'](chatQueue[_0xcd8a('0x11')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x12')]())['then'](smsQueue['getSmsQueues']())[_0xcd8a('0xb')](realtime['initSmsQueues']())[_0xcd8a('0xb')](mailQueue[_0xcd8a('0x13')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x14')]())[_0xcd8a('0xb')](faxQueue[_0xcd8a('0x15')]())[_0xcd8a('0xb')](realtime[_0xcd8a('0x16')]())[_0xcd8a('0xb')](whatsappQueue[_0xcd8a('0x17')]())['then'](realtime[_0xcd8a('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0xcd8a('0x19')](realtime)[_0xcd8a('0xb')](function(_0x4af694){return initRealtime();})['then'](function(_0x4b09c4){return setInterval(initRealtime,0x1388);})[_0xcd8a('0x1a')](function(_0x4d1f08){console[_0xcd8a('0x1b')](_0x4d1f08);});}main(); \ No newline at end of file +var _0xf10b=['getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','getAgents','then','getIntervals','initIntervals'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xf10b,0x106));var _0xbf10=function(_0x2b7d52,_0x23cc7d){_0x2b7d52=_0x2b7d52-0x0;var _0x1f8c53=_0xf10b[_0x2b7d52];return _0x1f8c53;};'use strict';var BPromise=require('bluebird');var server=require(_0xbf10('0x0'));var Realtime=require(_0xbf10('0x1'));var user=require(_0xbf10('0x2'));var interval=require(_0xbf10('0x3'));var openchannelQueue=require(_0xbf10('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xbf10('0x5'));var mailQueue=require(_0xbf10('0x6'));var faxQueue=require(_0xbf10('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xbf10('0x8')]()['then'](user[_0xbf10('0x9')]())['then'](realtime['initAgents']())[_0xbf10('0xa')](interval[_0xbf10('0xb')]())['then'](realtime[_0xbf10('0xc')]())[_0xbf10('0xa')](openchannelQueue[_0xbf10('0xd')]())['then'](realtime[_0xbf10('0xe')]())[_0xbf10('0xa')](chatQueue['getChatQueues']())['then'](realtime[_0xbf10('0xf')]())[_0xbf10('0xa')](smsQueue[_0xbf10('0x10')]())['then'](realtime['initSmsQueues']())[_0xbf10('0xa')](mailQueue[_0xbf10('0x11')]())[_0xbf10('0xa')](realtime[_0xbf10('0x12')]())[_0xbf10('0xa')](faxQueue[_0xbf10('0x13')]())[_0xbf10('0xa')](realtime[_0xbf10('0x14')]())['then'](whatsappQueue[_0xbf10('0x15')]())['then'](realtime[_0xbf10('0x16')]())[_0xbf10('0xa')](function(){return realtime;});}function main(){return server[_0xbf10('0x17')](realtime)[_0xbf10('0xa')](function(_0x3afd11){return initRealtime();})[_0xbf10('0xa')](function(_0x4edf7c){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2a5532){console[_0xbf10('0x18')](_0x2a5532);});}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 df9b6e1..97ac0a2 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x11e1a5,_0xd108d9){var _0x2938de=function(_0x182097){while(--_0x182097){_0x11e1a5['push'](_0x11e1a5['shift']());}};_0x2938de(++_0xd108d9);}(_0x2ef3,0xba));var _0x32ef=function(_0x45597f,_0x2769c2){_0x45597f=_0x45597f-0x0;var _0x5e6472=_0x2ef3[_0x45597f];return _0x5e6472;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x412ed6,_0x5ac827){var _0x3883d2=function(_0x5f3380){while(--_0x5f3380){_0x412ed6['push'](_0x412ed6['shift']());}};_0x3883d2(++_0x5ac827);}(_0x326f,0xd1));var _0xf326=function(_0x3acb0d,_0x4eed1f){_0x3acb0d=_0x3acb0d-0x0;var _0x1a80ae=_0x326f[_0x3acb0d];return _0x1a80ae;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d18fc2d..5b48646 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 _0xcd7d=['bluebird','jayson/promise','client','http','request','then','error','message','catch','sendMailMessage'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcd7d,0x1c2));var _0xdcd7=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0xcd7d[_0x2d3a4d];return _0x3a94a3;};'use strict';var BPromise=require(_0xdcd7('0x0'));var jayson=require(_0xdcd7('0x1'));var client=jayson[_0xdcd7('0x2')][_0xdcd7('0x3')]({'port':0x232b});function request(_0x116de2,_0x32fce7){return new BPromise(function(_0x4bcced,_0x3b8203){return client[_0xdcd7('0x4')](_0x116de2,_0x32fce7)[_0xdcd7('0x5')](function(_0x5152c4){if(_0x5152c4[_0xdcd7('0x6')]){return _0x3b8203(_0x5152c4[_0xdcd7('0x6')][_0xdcd7('0x7')]);}else{return _0x4bcced(_0x5152c4['result']);}})[_0xdcd7('0x8')](function(_0x12206b){return _0x3b8203(_0x12206b);});});}exports[_0xdcd7('0x9')]=function(_0x1fcfaa,_0x3cd6ea){return request('SendMail',{'account':_0x1fcfaa,'message':_0x3cd6ea});}; \ No newline at end of file +var _0x33b3=['client','http','then','error','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x1e1244,_0x59c68e){var _0x331c74=function(_0x56014a){while(--_0x56014a){_0x1e1244['push'](_0x1e1244['shift']());}};_0x331c74(++_0x59c68e);}(_0x33b3,0x6a));var _0x333b=function(_0x39a81c,_0x52281a){_0x39a81c=_0x39a81c-0x0;var _0x40b946=_0x33b3[_0x39a81c];return _0x40b946;};'use strict';var BPromise=require(_0x333b('0x0'));var jayson=require(_0x333b('0x1'));var client=jayson[_0x333b('0x2')][_0x333b('0x3')]({'port':0x232b});function request(_0x5c673f,_0x12e5ce){return new BPromise(function(_0x2580cf,_0x4f0333){return client['request'](_0x5c673f,_0x12e5ce)[_0x333b('0x4')](function(_0x5e941a){if(_0x5e941a[_0x333b('0x5')]){return _0x4f0333(_0x5e941a['error']['message']);}else{return _0x2580cf(_0x5e941a[_0x333b('0x6')]);}})[_0x333b('0x7')](function(_0x4310a7){return _0x4f0333(_0x4310a7);});});}exports[_0x333b('0x8')]=function(_0x578a22,_0x4f06ea){return request('SendMail',{'account':_0x578a22,'message':_0x4f06ea});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 1ec5423..2d5e42d 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 _0x3f62=['StatusTime','toNumber','chatCurrentCapacity','faxStatusTime','faxCurrentCapacity','whatsappStatusTime','chatWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail','chat','openchannel','sms','whatsapp','length','Status'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3f62,0x127));var _0x23f6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3f62[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x23f6('0x0'));var moment=require(_0x23f6('0x1'));var md5=require(_0x23f6('0x2'));var Redis=require(_0x23f6('0x3'));var config=require(_0x23f6('0x4'));config[_0x23f6('0x5')]=_[_0x23f6('0x6')](config['redis'],{'host':_0x23f6('0x7'),'port':0x18eb});var io=require(_0x23f6('0x8'))(new Redis(config[_0x23f6('0x5')]));function Agent(_0x210a38){this['id']=_0x210a38['id']||0x0;this['name']=_0x210a38[_0x23f6('0x9')]||'';this[_0x23f6('0xa')]=_0x210a38['online']||!![];this[_0x23f6('0xb')]=_0x210a38[_0x23f6('0xb')]||![];this['chatPause']=_0x210a38[_0x23f6('0xc')]||![];this[_0x23f6('0xd')]=_0x210a38[_0x23f6('0xd')]||![];this[_0x23f6('0xe')]=_0x210a38['faxPause']||![];this[_0x23f6('0xf')]=_0x210a38[_0x23f6('0xf')]||![];this[_0x23f6('0x10')]=_0x210a38['openchannelPause']||![];this[_0x23f6('0x11')]=_0x23f6('0x12');this[_0x23f6('0x13')]=0x0;this[_0x23f6('0x14')]=_0x210a38['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x23f6('0x15')]=_0x23f6('0x12');this[_0x23f6('0x16')]=0x0;this['mailCapacity']=_0x210a38[_0x23f6('0x17')]||0x0;this[_0x23f6('0x18')]=0x0;this[_0x23f6('0x19')]=_0x23f6('0x12');this['faxStatusTime']=0x0;this['faxCapacity']=_0x210a38[_0x23f6('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x23f6('0x1b')]=_0x23f6('0x12');this[_0x23f6('0x1c')]=0x0;this[_0x23f6('0x1d')]=_0x210a38['smsCapacity']||0x0;this[_0x23f6('0x1e')]=0x0;this[_0x23f6('0x1f')]=_0x23f6('0x12');this['whatsappStatusTime']=0x0;this[_0x23f6('0x20')]=_0x210a38[_0x23f6('0x20')]||0x0;this[_0x23f6('0x21')]=0x0;this[_0x23f6('0x22')]=_0x23f6('0x12');this[_0x23f6('0x23')]=0x0;this[_0x23f6('0x24')]=_0x210a38[_0x23f6('0x24')]||0x0;this[_0x23f6('0x25')]=0x0;this[_0x23f6('0x26')]=![];this[_0x23f6('0x27')]=undefined;this[_0x23f6('0x2')]='';this['chatWaitingInteractions']={};this[_0x23f6('0x28')]={};this[_0x23f6('0x29')]={};this[_0x23f6('0x2a')]={};this[_0x23f6('0x2b')]={};this[_0x23f6('0x2c')]={};this[_0x23f6('0x2d')]();}Agent['prototype'][_0x23f6('0x2e')]=function(_0x262d69){if(this[_0x262d69+'CurrentCapacity']>0x0){if(this[_0x262d69+_0x23f6('0x2f')]>0x0&&this[_0x262d69+_0x23f6('0x30')]>=this[_0x262d69+_0x23f6('0x2f')]){return _0x23f6('0x31');}else{return _0x23f6('0x32');}}else{return _0x23f6('0x33');}};Agent[_0x23f6('0x34')]['updateRealtime']=function(){var _0x9cacaf=[_0x23f6('0x35'),_0x23f6('0x36'),_0x23f6('0x37'),'fax',_0x23f6('0x38'),_0x23f6('0x39')];for(var _0x43da8a=0x0;_0x43da8a<_0x9cacaf[_0x23f6('0x3a')];_0x43da8a+=0x1){var _0x174857=this[_0x23f6('0x2e')](_0x9cacaf[_0x43da8a]);if(this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3b')]!==_0x174857){this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3c')]=_[_0x23f6('0x3d')](moment()['format']('x'));}this[_0x9cacaf[_0x43da8a]+_0x23f6('0x3b')]=_0x174857;}var _0x230d76={'id':this['id'],'name':this['name'],'online':this[_0x23f6('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x23f6('0xc')],'mailPause':this[_0x23f6('0xd')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x23f6('0x10')],'chatStatus':this[_0x23f6('0x11')],'chatStatusTime':this[_0x23f6('0x13')],'chatCapacity':this[_0x23f6('0x14')],'chatCurrentCapacity':this[_0x23f6('0x3e')],'mailStatus':this[_0x23f6('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x23f6('0x18')],'faxStatus':this[_0x23f6('0x19')],'faxStatusTime':this[_0x23f6('0x3f')],'faxCapacity':this[_0x23f6('0x1a')],'faxCurrentCapacity':this[_0x23f6('0x40')],'smsStatus':this[_0x23f6('0x1b')],'smsStatusTime':this[_0x23f6('0x1c')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x23f6('0x1e')],'whatsappStatus':this[_0x23f6('0x1f')],'whatsappStatusTime':this[_0x23f6('0x41')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x23f6('0x21')],'openchannelStatus':this[_0x23f6('0x22')],'openchannelStatusTime':this[_0x23f6('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x23f6('0x25')],'busy':this[_0x23f6('0x26')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x23f6('0x42')],'faxWaitingInteractions':this[_0x23f6('0x28')],'mailWaitingInteractions':this[_0x23f6('0x29')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x23f6('0x2b')],'whatsappWaitingInteractions':this[_0x23f6('0x2c')]};var _0x30b32b=md5(JSON[_0x23f6('0x43')](_0x230d76));if(this[_0x23f6('0x2')]!==_0x30b32b){this[_0x23f6('0x2')]=_0x30b32b;io[_0x23f6('0x44')](_0x23f6('0x45'),_0x230d76);}};module[_0x23f6('0x46')]=Agent; \ No newline at end of file +var _0xb5a7=['Status','StatusTime','format','online','openchannelWaitingInteractions','smsWaitingInteractions','stringify','emit','user:save','lodash','moment','md5','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','chat','sms','getChannelStatus'];(function(_0x3beb69,_0x376c8e){var _0x3d601a=function(_0x5158cf){while(--_0x5158cf){_0x3beb69['push'](_0x3beb69['shift']());}};_0x3d601a(++_0x376c8e);}(_0xb5a7,0x1a6));var _0x7b5a=function(_0x1678b4,_0x295b24){_0x1678b4=_0x1678b4-0x0;var _0x2533ed=_0xb5a7[_0x1678b4];return _0x2533ed;};'use strict';var _=require(_0x7b5a('0x0'));var moment=require(_0x7b5a('0x1'));var md5=require(_0x7b5a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7b5a('0x3')]=_[_0x7b5a('0x4')](config[_0x7b5a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7b5a('0x5'))(new Redis(config[_0x7b5a('0x3')]));function Agent(_0x5471d0){this['id']=_0x5471d0['id']||0x0;this[_0x7b5a('0x6')]=_0x5471d0['name']||'';this['online']=_0x5471d0['online']||!![];this[_0x7b5a('0x7')]=_0x5471d0[_0x7b5a('0x7')]||![];this[_0x7b5a('0x8')]=_0x5471d0[_0x7b5a('0x8')]||![];this[_0x7b5a('0x9')]=_0x5471d0[_0x7b5a('0x9')]||![];this[_0x7b5a('0xa')]=_0x5471d0[_0x7b5a('0xa')]||![];this[_0x7b5a('0xb')]=_0x5471d0[_0x7b5a('0xb')]||![];this[_0x7b5a('0xc')]=_0x5471d0[_0x7b5a('0xc')]||![];this[_0x7b5a('0xd')]=_0x7b5a('0xe');this[_0x7b5a('0xf')]=0x0;this[_0x7b5a('0x10')]=_0x5471d0[_0x7b5a('0x10')]||0x0;this[_0x7b5a('0x11')]=0x0;this[_0x7b5a('0x12')]='unknown';this[_0x7b5a('0x13')]=0x0;this[_0x7b5a('0x14')]=_0x5471d0[_0x7b5a('0x14')]||0x0;this[_0x7b5a('0x15')]=0x0;this[_0x7b5a('0x16')]=_0x7b5a('0xe');this[_0x7b5a('0x17')]=0x0;this[_0x7b5a('0x18')]=_0x5471d0[_0x7b5a('0x18')]||0x0;this[_0x7b5a('0x19')]=0x0;this['smsStatus']='unknown';this[_0x7b5a('0x1a')]=0x0;this[_0x7b5a('0x1b')]=_0x5471d0[_0x7b5a('0x1b')]||0x0;this[_0x7b5a('0x1c')]=0x0;this[_0x7b5a('0x1d')]=_0x7b5a('0xe');this[_0x7b5a('0x1e')]=0x0;this[_0x7b5a('0x1f')]=_0x5471d0['whatsappCapacity']||0x0;this[_0x7b5a('0x20')]=0x0;this[_0x7b5a('0x21')]=_0x7b5a('0xe');this[_0x7b5a('0x22')]=0x0;this[_0x7b5a('0x23')]=_0x5471d0[_0x7b5a('0x23')]||0x0;this[_0x7b5a('0x24')]=0x0;this[_0x7b5a('0x25')]=![];this[_0x7b5a('0x26')]=undefined;this[_0x7b5a('0x2')]='';this[_0x7b5a('0x27')]={};this[_0x7b5a('0x28')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0x7b5a('0x29')]={};this[_0x7b5a('0x2a')]();}Agent[_0x7b5a('0x2b')]['getChannelStatus']=function(_0x34f6a8){if(this[_0x34f6a8+_0x7b5a('0x2c')]>0x0){if(this[_0x34f6a8+_0x7b5a('0x2d')]>0x0&&this[_0x34f6a8+_0x7b5a('0x2c')]>=this[_0x34f6a8+'Capacity']){return _0x7b5a('0x2e');}else{return'working';}}else{return'idle';}};Agent[_0x7b5a('0x2b')][_0x7b5a('0x2a')]=function(){var _0x1aed6a=['mail',_0x7b5a('0x2f'),'openchannel','fax',_0x7b5a('0x30'),'whatsapp'];for(var _0x13010c=0x0;_0x13010c<_0x1aed6a['length'];_0x13010c+=0x1){var _0x5e51f1=this[_0x7b5a('0x31')](_0x1aed6a[_0x13010c]);if(this[_0x1aed6a[_0x13010c]+_0x7b5a('0x32')]!==_0x5e51f1){this[_0x1aed6a[_0x13010c]+_0x7b5a('0x33')]=_['toNumber'](moment()[_0x7b5a('0x34')]('x'));}this[_0x1aed6a[_0x13010c]+'Status']=_0x5e51f1;}var _0x303e6f={'id':this['id'],'name':this[_0x7b5a('0x6')],'online':this[_0x7b5a('0x35')],'voicePause':this[_0x7b5a('0x7')],'chatPause':this[_0x7b5a('0x8')],'mailPause':this[_0x7b5a('0x9')],'smsPause':this[_0x7b5a('0xb')],'faxPause':this[_0x7b5a('0xa')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x7b5a('0xd')],'chatStatusTime':this[_0x7b5a('0xf')],'chatCapacity':this[_0x7b5a('0x10')],'chatCurrentCapacity':this[_0x7b5a('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x7b5a('0x13')],'mailCapacity':this[_0x7b5a('0x14')],'mailCurrentCapacity':this[_0x7b5a('0x15')],'faxStatus':this[_0x7b5a('0x16')],'faxStatusTime':this[_0x7b5a('0x17')],'faxCapacity':this[_0x7b5a('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x7b5a('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x7b5a('0x1c')],'whatsappStatus':this[_0x7b5a('0x1d')],'whatsappStatusTime':this[_0x7b5a('0x1e')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x7b5a('0x20')],'openchannelStatus':this[_0x7b5a('0x21')],'openchannelStatusTime':this[_0x7b5a('0x22')],'openchannelCapacity':this[_0x7b5a('0x23')],'openchannelCurrentCapacity':this[_0x7b5a('0x24')],'busy':this['busy'],'busyQueue':this[_0x7b5a('0x26')],'chatWaitingInteractions':this[_0x7b5a('0x27')],'faxWaitingInteractions':this[_0x7b5a('0x28')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x7b5a('0x36')],'smsWaitingInteractions':this[_0x7b5a('0x37')],'whatsappWaitingInteractions':this[_0x7b5a('0x29')]};var _0x581539=md5(JSON[_0x7b5a('0x38')](_0x303e6f));if(this[_0x7b5a('0x2')]!==_0x581539){this[_0x7b5a('0x2')]=_0x581539;io[_0x7b5a('0x39')](_0x7b5a('0x3a'),_0x303e6f);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e8510ad..6ec6f9f 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 _0x7ce3=['stringify','format','chat:queue:%s','emit','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','available'];(function(_0x3f92bc,_0x482ad4){var _0xa15d20=function(_0x1381be){while(--_0x1381be){_0x3f92bc['push'](_0x3f92bc['shift']());}};_0xa15d20(++_0x482ad4);}(_0x7ce3,0x1d4));var _0x37ce=function(_0x29b4e5,_0x385e2e){_0x29b4e5=_0x29b4e5-0x0;var _0x439ca4=_0x7ce3[_0x29b4e5];return _0x439ca4;};'use strict';var _=require(_0x37ce('0x0'));var md5=require('md5');var util=require(_0x37ce('0x1'));var Redis=require(_0x37ce('0x2'));var config=require('../../../config/environment');config[_0x37ce('0x3')]=_[_0x37ce('0x4')](config[_0x37ce('0x3')],{'host':_0x37ce('0x5'),'port':0x18eb});var io=require(_0x37ce('0x6'))(new Redis(config[_0x37ce('0x3')]));function ChatQueue(_0x246c31){this['id']=_0x246c31['id']||0x0;this[_0x37ce('0x7')]=_0x246c31['name']||'';this['timeout']=_0x246c31[_0x37ce('0x8')]||0xa;this[_0x37ce('0x9')]=_0x246c31['strategy']||_0x37ce('0xa');this[_0x37ce('0xb')]=_0x246c31[_0x37ce('0xb')];this['mapAgentsId']={};this[_0x37ce('0xc')]=0x0;this[_0x37ce('0xd')]='';this[_0x37ce('0xe')]();this[_0x37ce('0xf')]();}ChatQueue[_0x37ce('0x10')][_0x37ce('0xe')]=function(){var _0x4a3e10=this[_0x37ce('0x11')][_0x37ce('0x12')];this['mapAgentsId']=_[_0x37ce('0x13')](this[_0x37ce('0xb')],'id');this[_0x37ce('0x11')][_0x37ce('0x12')]=_0x4a3e10;};ChatQueue[_0x37ce('0x10')][_0x37ce('0xf')]=function(){this['loggedIn']=0x0;this[_0x37ce('0x14')]=0x0;for(var _0x185991=0x0;_0x185991=0x0?this[_0x37ce('0x18')]:0x0;var _0x2496f7={'id':this['id'],'available':this[_0x37ce('0x18')],'loggedIn':this[_0x37ce('0x17')],'name':this['name'],'paused':this[_0x37ce('0x14')],'waiting':this[_0x37ce('0xc')]};var _0x511631=md5(JSON[_0x37ce('0x19')](_0x2496f7));if(this['md5']!==_0x511631){this[_0x37ce('0xd')]=_0x511631;io['to'](util[_0x37ce('0x1a')](_0x37ce('0x1b'),_0x2496f7[_0x37ce('0x7')]))[_0x37ce('0x1c')]('chat_queue:save',_0x2496f7);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x6e9b=['updateRouting','_rr','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x6e9b,0x1ee));var _0xb6e9=function(_0xfc73bd,_0x203202){_0xfc73bd=_0xfc73bd-0x0;var _0x1ad402=_0x6e9b[_0xfc73bd];return _0x1ad402;};'use strict';var _=require(_0xb6e9('0x0'));var md5=require(_0xb6e9('0x1'));var util=require(_0xb6e9('0x2'));var Redis=require(_0xb6e9('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xb6e9('0x4')](config[_0xb6e9('0x5')],{'host':_0xb6e9('0x6'),'port':0x18eb});var io=require(_0xb6e9('0x7'))(new Redis(config[_0xb6e9('0x5')]));function ChatQueue(_0x545937){this['id']=_0x545937['id']||0x0;this[_0xb6e9('0x8')]=_0x545937[_0xb6e9('0x8')]||'';this['timeout']=_0x545937[_0xb6e9('0x9')]||0xa;this[_0xb6e9('0xa')]=_0x545937[_0xb6e9('0xa')]||_0xb6e9('0xb');this[_0xb6e9('0xc')]=_0x545937['Agents'];this[_0xb6e9('0xd')]={};this[_0xb6e9('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0xb6e9('0xf')][_0xb6e9('0x10')]=function(){var _0x47a0ea=this[_0xb6e9('0xd')][_0xb6e9('0x11')];this[_0xb6e9('0xd')]=_[_0xb6e9('0x12')](this[_0xb6e9('0xc')],'id');this[_0xb6e9('0xd')]['_rr']=_0x47a0ea;};ChatQueue[_0xb6e9('0xf')][_0xb6e9('0x13')]=function(){this[_0xb6e9('0x14')]=0x0;this[_0xb6e9('0x15')]=0x0;for(var _0x13ecf3=0x0;_0x13ecf3=0x0?this['available']:0x0;var _0x5061af={'id':this['id'],'available':this[_0xb6e9('0x19')],'loggedIn':this[_0xb6e9('0x14')],'name':this[_0xb6e9('0x8')],'paused':this['paused'],'waiting':this[_0xb6e9('0xe')]};var _0x3ce8e9=md5(JSON[_0xb6e9('0x1a')](_0x5061af));if(this[_0xb6e9('0x1')]!==_0x3ce8e9){this[_0xb6e9('0x1')]=_0x3ce8e9;io['to'](util[_0xb6e9('0x1b')](_0xb6e9('0x1c'),_0x5061af[_0xb6e9('0x8')]))['emit'](_0xb6e9('0x1d'),_0x5061af);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8f25280..6a7aeeb 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 _0x507c=['Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','length','available','md5','format','fax:queue:%s','fax_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','name','timeout','strategy','beepall'];(function(_0x23d307,_0x46e6c2){var _0x514d62=function(_0x16f355){while(--_0x16f355){_0x23d307['push'](_0x23d307['shift']());}};_0x514d62(++_0x46e6c2);}(_0x507c,0x1a0));var _0xc507=function(_0xa7281b,_0x40b787){_0xa7281b=_0xa7281b-0x0;var _0xb96593=_0x507c[_0xa7281b];return _0xb96593;};'use strict';var _=require(_0xc507('0x0'));var md5=require('md5');var util=require(_0xc507('0x1'));var Redis=require('ioredis');var config=require(_0xc507('0x2'));config['redis']=_[_0xc507('0x3')](config[_0xc507('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc507('0x4')]));function FaxQueue(_0x35f0cd){this['id']=_0x35f0cd['id']||0x0;this[_0xc507('0x5')]=_0x35f0cd[_0xc507('0x5')]||'';this[_0xc507('0x6')]=_0x35f0cd[_0xc507('0x6')]||0xa;this[_0xc507('0x7')]=_0x35f0cd[_0xc507('0x7')]||_0xc507('0x8');this[_0xc507('0x9')]=_0x35f0cd['Agents'];this[_0xc507('0xa')]={};this[_0xc507('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0xc507('0xc')]=function(){var _0x1a480e=this[_0xc507('0xa')][_0xc507('0xd')];this[_0xc507('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xc507('0xd')]=_0x1a480e;};FaxQueue[_0xc507('0xe')][_0xc507('0xf')]=function(){this[_0xc507('0x10')]=0x0;this[_0xc507('0x11')]=0x0;for(var _0x4b52b1=0x0;_0x4b52b1=0x0?this['available']:0x0;var _0x580a35={'id':this['id'],'available':this[_0xc507('0x13')],'loggedIn':this[_0xc507('0x10')],'name':this[_0xc507('0x5')],'paused':this[_0xc507('0x11')],'waiting':this['waiting']};var _0x4720e9=md5(JSON['stringify'](_0x580a35));if(this[_0xc507('0x14')]!==_0x4720e9){this[_0xc507('0x14')]=_0x4720e9;io['to'](util[_0xc507('0x15')](_0xc507('0x16'),_0x580a35[_0xc507('0x5')]))['emit'](_0xc507('0x17'),_0x580a35);}};module[_0xc507('0x18')]=FaxQueue; \ No newline at end of file +var _0x8951=['fax_queue:save','exports','lodash','md5','ioredis','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','available','fax:queue:%s','emit'];(function(_0x4fefc0,_0x43febb){var _0x2e1c7e=function(_0x53dfb9){while(--_0x53dfb9){_0x4fefc0['push'](_0x4fefc0['shift']());}};_0x2e1c7e(++_0x43febb);}(_0x8951,0xca));var _0x1895=function(_0x244716,_0x1e6caf){_0x244716=_0x244716-0x0;var _0x2e5b9d=_0x8951[_0x244716];return _0x2e5b9d;};'use strict';var _=require(_0x1895('0x0'));var md5=require(_0x1895('0x1'));var util=require('util');var Redis=require(_0x1895('0x2'));var config=require('../../../config/environment');config[_0x1895('0x3')]=_[_0x1895('0x4')](config[_0x1895('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1895('0x3')]));function FaxQueue(_0xd4730b){this['id']=_0xd4730b['id']||0x0;this['name']=_0xd4730b[_0x1895('0x5')]||'';this[_0x1895('0x6')]=_0xd4730b['timeout']||0xa;this[_0x1895('0x7')]=_0xd4730b[_0x1895('0x7')]||_0x1895('0x8');this[_0x1895('0x9')]=_0xd4730b[_0x1895('0x9')];this[_0x1895('0xa')]={};this[_0x1895('0xb')]=0x0;this['md5']='';this[_0x1895('0xc')]();this['updateRealtime']();}FaxQueue['prototype'][_0x1895('0xc')]=function(){var _0x4ccfac=this[_0x1895('0xa')][_0x1895('0xd')];this['mapAgentsId']=_[_0x1895('0xe')](this['Agents'],'id');this[_0x1895('0xa')][_0x1895('0xd')]=_0x4ccfac;};FaxQueue[_0x1895('0xf')][_0x1895('0x10')]=function(){this[_0x1895('0x11')]=0x0;this[_0x1895('0x12')]=0x0;for(var _0x9706b6=0x0;_0x9706b6=0x0?this[_0x1895('0x14')]:0x0;var _0x5c5d66={'id':this['id'],'available':this[_0x1895('0x14')],'loggedIn':this[_0x1895('0x11')],'name':this[_0x1895('0x5')],'paused':this[_0x1895('0x12')],'waiting':this[_0x1895('0xb')]};var _0x1b9446=md5(JSON['stringify'](_0x5c5d66));if(this[_0x1895('0x1')]!==_0x1b9446){this[_0x1895('0x1')]=_0x1b9446;io['to'](util['format'](_0x1895('0x15'),_0x5c5d66[_0x1895('0x5')]))[_0x1895('0x16')](_0x1895('0x17'),_0x5c5d66);}};module[_0x1895('0x18')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 6e2d80e..4d84637 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 _0x0f45=['Intervals','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f45,0xe9));var _0x50f4=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x0f45[_0x2aecb2];return _0x3ebb80;};'use strict';function Interval(_0x173719){this['id']=_0x173719['id']||0x0;this[_0x50f4('0x0')]=_0x173719[_0x50f4('0x0')]||'';this[_0x50f4('0x1')]=_0x173719[_0x50f4('0x1')]||{};}module[_0x50f4('0x2')]=Interval; \ No newline at end of file +var _0xfc41=['Intervals','name'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xfc41,0x137));var _0x1fc4=function(_0x2fc391,_0x56a2c1){_0x2fc391=_0x2fc391-0x0;var _0x311138=_0xfc41[_0x2fc391];return _0x311138;};'use strict';function Interval(_0x512deb){this['id']=_0x512deb['id']||0x0;this[_0x1fc4('0x0')]=_0x512deb[_0x1fc4('0x0')]||'';this[_0x1fc4('0x1')]=_0x512deb['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 85088e5..4fe340c 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 _0x1655=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','emit','exports','lodash','md5','util'];(function(_0x2e6938,_0x30549c){var _0x464d2d=function(_0x1cdf61){while(--_0x1cdf61){_0x2e6938['push'](_0x2e6938['shift']());}};_0x464d2d(++_0x30549c);}(_0x1655,0xb1));var _0x5165=function(_0x97c0ac,_0x1b4271){_0x97c0ac=_0x97c0ac-0x0;var _0x4728ab=_0x1655[_0x97c0ac];return _0x4728ab;};'use strict';var _=require(_0x5165('0x0'));var md5=require(_0x5165('0x1'));var util=require(_0x5165('0x2'));var Redis=require(_0x5165('0x3'));var config=require('../../../config/environment');config[_0x5165('0x4')]=_[_0x5165('0x5')](config[_0x5165('0x4')],{'host':_0x5165('0x6'),'port':0x18eb});var io=require(_0x5165('0x7'))(new Redis(config['redis']));function MailQueue(_0x16692c){this['id']=_0x16692c['id']||0x0;this[_0x5165('0x8')]=_0x16692c['name']||'';this[_0x5165('0x9')]=_0x16692c[_0x5165('0x9')]||0xa;this[_0x5165('0xa')]=_0x16692c[_0x5165('0xa')]||_0x5165('0xb');this[_0x5165('0xc')]=_0x16692c['Agents'];this[_0x5165('0xd')]={};this['waiting']=0x0;this[_0x5165('0x1')]='';this[_0x5165('0xe')]();this['updateRealtime']();}MailQueue[_0x5165('0xf')][_0x5165('0xe')]=function(){var _0x1086a7=this[_0x5165('0xd')][_0x5165('0x10')];this[_0x5165('0xd')]=_[_0x5165('0x11')](this[_0x5165('0xc')],'id');this[_0x5165('0xd')][_0x5165('0x10')]=_0x1086a7;};MailQueue[_0x5165('0xf')][_0x5165('0x12')]=function(){this[_0x5165('0x13')]=0x0;this[_0x5165('0x14')]=0x0;for(var _0x3f5329=0x0;_0x3f5329=0x0?this[_0x5165('0x18')]:0x0;var _0x29885a={'id':this['id'],'available':this[_0x5165('0x18')],'loggedIn':this[_0x5165('0x13')],'name':this[_0x5165('0x8')],'paused':this[_0x5165('0x14')],'waiting':this[_0x5165('0x19')]};var _0x1ef8af=md5(JSON[_0x5165('0x1a')](_0x29885a));if(this['md5']!==_0x1ef8af){this[_0x5165('0x1')]=_0x1ef8af;io['to'](util[_0x5165('0x1b')]('mail:queue:%s',_0x29885a[_0x5165('0x8')]))[_0x5165('0x1c')]('mail_queue:save',_0x29885a);}};module[_0x5165('0x1d')]=MailQueue; \ No newline at end of file +var _0x1caf=['mailPause','available','stringify','format','emit','mail_queue:save','lodash','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn'];(function(_0x375cdf,_0x1c5436){var _0x18d43b=function(_0x5f2465){while(--_0x5f2465){_0x375cdf['push'](_0x375cdf['shift']());}};_0x18d43b(++_0x1c5436);}(_0x1caf,0x11e));var _0xf1ca=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1caf[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xf1ca('0x0'));var md5=require('md5');var util=require(_0xf1ca('0x1'));var Redis=require(_0xf1ca('0x2'));var config=require(_0xf1ca('0x3'));config[_0xf1ca('0x4')]=_['defaults'](config[_0xf1ca('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1ca('0x4')]));function MailQueue(_0x505d60){this['id']=_0x505d60['id']||0x0;this['name']=_0x505d60[_0xf1ca('0x5')]||'';this[_0xf1ca('0x6')]=_0x505d60[_0xf1ca('0x6')]||0xa;this['strategy']=_0x505d60[_0xf1ca('0x7')]||_0xf1ca('0x8');this['Agents']=_0x505d60[_0xf1ca('0x9')];this[_0xf1ca('0xa')]={};this[_0xf1ca('0xb')]=0x0;this[_0xf1ca('0xc')]='';this[_0xf1ca('0xd')]();this[_0xf1ca('0xe')]();}MailQueue[_0xf1ca('0xf')]['updateRouting']=function(){var _0x187e4f=this[_0xf1ca('0xa')][_0xf1ca('0x10')];this[_0xf1ca('0xa')]=_[_0xf1ca('0x11')](this['Agents'],'id');this[_0xf1ca('0xa')][_0xf1ca('0x10')]=_0x187e4f;};MailQueue[_0xf1ca('0xf')][_0xf1ca('0xe')]=function(){this['loggedIn']=0x0;this[_0xf1ca('0x12')]=0x0;for(var _0x3b362f=0x0;_0x3b362f=0x0?this[_0xf1ca('0x17')]:0x0;var _0x19122a={'id':this['id'],'available':this[_0xf1ca('0x17')],'loggedIn':this[_0xf1ca('0x15')],'name':this[_0xf1ca('0x5')],'paused':this[_0xf1ca('0x12')],'waiting':this['waiting']};var _0x3eb152=md5(JSON[_0xf1ca('0x18')](_0x19122a));if(this[_0xf1ca('0xc')]!==_0x3eb152){this[_0xf1ca('0xc')]=_0x3eb152;io['to'](util[_0xf1ca('0x19')]('mail:queue:%s',_0x19122a[_0xf1ca('0x5')]))[_0xf1ca('0x1a')](_0xf1ca('0x1b'),_0x19122a);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 19d13c2..a5fcf4d 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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 8ea8829..fe55e04 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 _0x1306=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x1306,0x17a));var _0x6130=function(_0x5c54d8,_0x2d1594){_0x5c54d8=_0x5c54d8-0x0;var _0x2f1472=_0x1306[_0x5c54d8];return _0x2f1472;};'use strict';var _=require(_0x6130('0x0'));var md5=require(_0x6130('0x1'));var util=require(_0x6130('0x2'));var Redis=require(_0x6130('0x3'));var config=require(_0x6130('0x4'));config[_0x6130('0x5')]=_[_0x6130('0x6')](config[_0x6130('0x5')],{'host':_0x6130('0x7'),'port':0x18eb});var io=require(_0x6130('0x8'))(new Redis(config[_0x6130('0x5')]));function SmsQueue(_0x181070){this['id']=_0x181070['id']||0x0;this[_0x6130('0x9')]=_0x181070[_0x6130('0x9')]||'';this[_0x6130('0xa')]=_0x181070[_0x6130('0xa')]||0xa;this[_0x6130('0xb')]=_0x181070[_0x6130('0xb')]||_0x6130('0xc');this[_0x6130('0xd')]=_0x181070[_0x6130('0xd')];this[_0x6130('0xe')]={};this[_0x6130('0xf')]=0x0;this[_0x6130('0x1')]='';this[_0x6130('0x10')]();this[_0x6130('0x11')]();}SmsQueue[_0x6130('0x12')][_0x6130('0x10')]=function(){var _0xac0bf1=this['mapAgentsId'][_0x6130('0x13')];this['mapAgentsId']=_[_0x6130('0x14')](this[_0x6130('0xd')],'id');this['mapAgentsId'][_0x6130('0x13')]=_0xac0bf1;};SmsQueue[_0x6130('0x12')][_0x6130('0x11')]=function(){this[_0x6130('0x15')]=0x0;this[_0x6130('0x16')]=0x0;for(var _0x3470e8=0x0;_0x3470e8=0x0?this['available']:0x0;var _0x1cd785={'id':this['id'],'available':this[_0x6130('0x1a')],'loggedIn':this[_0x6130('0x15')],'name':this[_0x6130('0x9')],'paused':this[_0x6130('0x16')],'waiting':this['waiting']};var _0x33f0f6=md5(JSON['stringify'](_0x1cd785));if(this[_0x6130('0x1')]!==_0x33f0f6){this[_0x6130('0x1')]=_0x33f0f6;io['to'](util[_0x6130('0x1b')](_0x6130('0x1c'),_0x1cd785[_0x6130('0x9')]))['emit']('sms_queue:save',_0x1cd785);}};module[_0x6130('0x1d')]=SmsQueue; \ No newline at end of file +var _0xe2cc=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','smsPause','paused','available','format','sms:queue:%s','name','emit','sms_queue:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x52a259,_0x92b541){var _0x5535f4=function(_0x59e4ec){while(--_0x59e4ec){_0x52a259['push'](_0x52a259['shift']());}};_0x5535f4(++_0x92b541);}(_0xe2cc,0x69));var _0xce2c=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xe2cc[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xce2c('0x0'));var md5=require(_0xce2c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xce2c('0x2'));config[_0xce2c('0x3')]=_[_0xce2c('0x4')](config[_0xce2c('0x3')],{'host':_0xce2c('0x5'),'port':0x18eb});var io=require(_0xce2c('0x6'))(new Redis(config[_0xce2c('0x3')]));function SmsQueue(_0x16312a){this['id']=_0x16312a['id']||0x0;this['name']=_0x16312a['name']||'';this[_0xce2c('0x7')]=_0x16312a[_0xce2c('0x7')]||0xa;this[_0xce2c('0x8')]=_0x16312a[_0xce2c('0x8')]||_0xce2c('0x9');this[_0xce2c('0xa')]=_0x16312a['Agents'];this[_0xce2c('0xb')]={};this[_0xce2c('0xc')]=0x0;this[_0xce2c('0x1')]='';this[_0xce2c('0xd')]();this[_0xce2c('0xe')]();}SmsQueue[_0xce2c('0xf')][_0xce2c('0xd')]=function(){var _0x6fc2c3=this[_0xce2c('0xb')][_0xce2c('0x10')];this[_0xce2c('0xb')]=_[_0xce2c('0x11')](this[_0xce2c('0xa')],'id');this[_0xce2c('0xb')][_0xce2c('0x10')]=_0x6fc2c3;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xce2c('0x12')]=0x0;this['paused']=0x0;for(var _0x214c62=0x0;_0x214c62=0x0?this[_0xce2c('0x16')]:0x0;var _0x383085={'id':this['id'],'available':this[_0xce2c('0x16')],'loggedIn':this[_0xce2c('0x12')],'name':this['name'],'paused':this[_0xce2c('0x15')],'waiting':this[_0xce2c('0xc')]};var _0x591921=md5(JSON['stringify'](_0x383085));if(this[_0xce2c('0x1')]!==_0x591921){this[_0xce2c('0x1')]=_0x591921;io['to'](util[_0xce2c('0x17')](_0xce2c('0x18'),_0x383085[_0xce2c('0x19')]))[_0xce2c('0x1a')](_0xce2c('0x1b'),_0x383085);}};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 f3cb7ca..5768f10 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 _0x5d35=['paused','online','available','name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0x33be77,_0x43896e){var _0x5d48a5=function(_0x1cb1c0){while(--_0x1cb1c0){_0x33be77['push'](_0x33be77['shift']());}};_0x5d48a5(++_0x43896e);}(_0x5d35,0x192));var _0x55d3=function(_0x3713d5,_0x547e07){_0x3713d5=_0x3713d5-0x0;var _0x4773de=_0x5d35[_0x3713d5];return _0x4773de;};'use strict';var _=require(_0x55d3('0x0'));var md5=require(_0x55d3('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x55d3('0x2'));config['redis']=_[_0x55d3('0x3')](config[_0x55d3('0x4')],{'host':_0x55d3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x55d3('0x4')]));function WhatsappQueue(_0x13bdd5){this['id']=_0x13bdd5['id']||0x0;this['name']=_0x13bdd5['name']||'';this[_0x55d3('0x6')]=_0x13bdd5[_0x55d3('0x6')]||0xa;this[_0x55d3('0x7')]=_0x13bdd5[_0x55d3('0x7')]||_0x55d3('0x8');this[_0x55d3('0x9')]=_0x13bdd5[_0x55d3('0x9')];this[_0x55d3('0xa')]={};this[_0x55d3('0xb')]=0x0;this[_0x55d3('0x1')]='';this[_0x55d3('0xc')]();this[_0x55d3('0xd')]();}WhatsappQueue['prototype'][_0x55d3('0xc')]=function(){var _0x24076a=this[_0x55d3('0xa')][_0x55d3('0xe')];this[_0x55d3('0xa')]=_[_0x55d3('0xf')](this[_0x55d3('0x9')],'id');this[_0x55d3('0xa')][_0x55d3('0xe')]=_0x24076a;};WhatsappQueue[_0x55d3('0x10')][_0x55d3('0xd')]=function(){this[_0x55d3('0x11')]=0x0;this[_0x55d3('0x12')]=0x0;for(var _0x3bd9dd=0x0;_0x3bd9dd=0x0?this[_0x55d3('0x14')]:0x0;var _0x365e5d={'id':this['id'],'available':this[_0x55d3('0x14')],'loggedIn':this[_0x55d3('0x11')],'name':this[_0x55d3('0x15')],'paused':this[_0x55d3('0x12')],'waiting':this['waiting']};var _0x4a8758=md5(JSON[_0x55d3('0x16')](_0x365e5d));if(this[_0x55d3('0x1')]!==_0x4a8758){this['md5']=_0x4a8758;io['to'](util[_0x55d3('0x17')](_0x55d3('0x18'),_0x365e5d['name']))[_0x55d3('0x19')](_0x55d3('0x1a'),_0x365e5d);}};module[_0x55d3('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x4365=['_rr','prototype','paused','length','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','md5','ioredis','defaults','redis','localhost','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime'];(function(_0x1349b6,_0x43f3c5){var _0x542c93=function(_0xaf2f22){while(--_0xaf2f22){_0x1349b6['push'](_0x1349b6['shift']());}};_0x542c93(++_0x43f3c5);}(_0x4365,0x108));var _0x5436=function(_0x3544a4,_0x2b801c){_0x3544a4=_0x3544a4-0x0;var _0x3ad501=_0x4365[_0x3544a4];return _0x3ad501;};'use strict';var _=require('lodash');var md5=require(_0x5436('0x0'));var util=require('util');var Redis=require(_0x5436('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x5436('0x2')](config[_0x5436('0x3')],{'host':_0x5436('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x2597d5){this['id']=_0x2597d5['id']||0x0;this[_0x5436('0x5')]=_0x2597d5['name']||'';this[_0x5436('0x6')]=_0x2597d5[_0x5436('0x6')]||0xa;this[_0x5436('0x7')]=_0x2597d5[_0x5436('0x7')]||'beepall';this[_0x5436('0x8')]=_0x2597d5[_0x5436('0x8')];this['mapAgentsId']={};this[_0x5436('0x9')]=0x0;this[_0x5436('0x0')]='';this[_0x5436('0xa')]();this[_0x5436('0xb')]();}WhatsappQueue['prototype'][_0x5436('0xa')]=function(){var _0xf8a35=this['mapAgentsId'][_0x5436('0xc')];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5436('0xc')]=_0xf8a35;};WhatsappQueue[_0x5436('0xd')][_0x5436('0xb')]=function(){this['loggedIn']=0x0;this[_0x5436('0xe')]=0x0;for(var _0x3f227b=0x0;_0x3f227b=0x0?this[_0x5436('0x12')]:0x0;var _0x58914b={'id':this['id'],'available':this[_0x5436('0x12')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5436('0x9')]};var _0xe7f52d=md5(JSON[_0x5436('0x13')](_0x58914b));if(this[_0x5436('0x0')]!==_0xe7f52d){this[_0x5436('0x0')]=_0xe7f52d;io['to'](util[_0x5436('0x14')]('whatsapp:queue:%s',_0x58914b['name']))[_0x5436('0x15')](_0x5436('0x16'),_0x58914b);}};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 c7e73bb..8bd1758 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 869cbaa..4f27bde 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 _0xa1c8=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x59075a,_0x1278d7){var _0x14b4e5=function(_0x2db124){while(--_0x2db124){_0x59075a['push'](_0x59075a['shift']());}};_0x14b4e5(++_0x1278d7);}(_0xa1c8,0xca));var _0x8a1c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa1c8[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x8a1c('0x0'));exports[_0x8a1c('0x1')]=function(_0x578aa9,_0x1548fe){return client[_0x8a1c('0x2')](_0x8a1c('0x3'),{'body':_0x1548fe,'options':{'where':{'id':_0x578aa9}},'log':_0x8a1c('0x4')});};exports[_0x8a1c('0x5')]=function(_0x16f2c0,_0x5ab489){return client['Request'](_0x8a1c('0x6'),{'body':_0x5ab489,'options':{'where':{'id':_0x16f2c0}},'log':_0x8a1c('0x7')});}; \ No newline at end of file +var _0xa00c=['../client','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x62fc8,_0x19388b){var _0x43fd5c=function(_0xe19432){while(--_0xe19432){_0x62fc8['push'](_0x62fc8['shift']());}};_0x43fd5c(++_0x19388b);}(_0xa00c,0x1a4));var _0xca00=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa00c[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xca00('0x0'));exports['update']=function(_0xb077ce,_0x2a0ed3){return client[_0xca00('0x1')]('UpdateChatInteraction',{'body':_0x2a0ed3,'options':{'where':{'id':_0xb077ce}},'log':_0xca00('0x2')});};exports[_0xca00('0x3')]=function(_0xf4c38d,_0x3e5a06){return client[_0xca00('0x1')](_0xca00('0x4'),{'body':_0x3e5a06,'options':{'where':{'id':_0xf4c38d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 812fed1..97b0ed9 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 _0xfdff=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x29ba98,_0x4dad7e){var _0x464e83=function(_0x195b47){while(--_0x195b47){_0x29ba98['push'](_0x29ba98['shift']());}};_0x464e83(++_0x4dad7e);}(_0xfdff,0x14f));var _0xffdf=function(_0x4b2da4,_0x45f055){_0x4b2da4=_0x4b2da4-0x0;var _0x376450=_0xfdff[_0x4b2da4];return _0x376450;};'use strict';var client=require(_0xffdf('0x0'));exports[_0xffdf('0x1')]=function(_0x2fb7ce){return client[_0xffdf('0x2')](_0xffdf('0x3'),{'body':_0x2fb7ce,'log':_0xffdf('0x4')});}; \ No newline at end of file +var _0x3a69=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x2d883b,_0x5e7ba4){var _0xb0d8f3=function(_0x14e99c){while(--_0x14e99c){_0x2d883b['push'](_0x2d883b['shift']());}};_0xb0d8f3(++_0x5e7ba4);}(_0x3a69,0x107));var _0x93a6=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x3a69[_0x18d5d7];return _0x30a9ea;};'use strict';var client=require(_0x93a6('0x0'));exports[_0x93a6('0x1')]=function(_0xcfd1bb){return client['Request'](_0x93a6('0x2'),{'body':_0xcfd1bb,'log':_0x93a6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 080907c..aca7350 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 _0xc99e=['../client','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents','online','chatPause'];(function(_0x296239,_0x48a53a){var _0x1f8db5=function(_0x13ac58){while(--_0x13ac58){_0x296239['push'](_0x296239['shift']());}};_0x1f8db5(++_0x48a53a);}(_0xc99e,0x6e));var _0xec99=function(_0x2bd56e,_0x4ba093){_0x2bd56e=_0x2bd56e-0x0;var _0x353689=_0xc99e[_0x2bd56e];return _0x353689;};'use strict';var client=require(_0xec99('0x0'));exports[_0xec99('0x1')]=function(){return function(){return client[_0xec99('0x2')](_0xec99('0x3'),{'options':{'raw':![],'attributes':['id',_0xec99('0x4'),_0xec99('0x5'),'strategy'],'include':[{'model':_0xec99('0x6'),'as':_0xec99('0x7'),'attributes':['id',_0xec99('0x4'),_0xec99('0x8'),_0xec99('0x9')]}]},'log':_0xec99('0x1')});};}; \ No newline at end of file +var _0x3ca4=['chatPause','../client','getChatQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x6330a4,_0x31ce3f){var _0x3a9b65=function(_0x5cb8d1){while(--_0x5cb8d1){_0x6330a4['push'](_0x6330a4['shift']());}};_0x3a9b65(++_0x31ce3f);}(_0x3ca4,0x17d));var _0x43ca=function(_0x548b08,_0x5c5c28){_0x548b08=_0x548b08-0x0;var _0x5ae0ab=_0x3ca4[_0x548b08];return _0x5ae0ab;};'use strict';var client=require(_0x43ca('0x0'));exports[_0x43ca('0x1')]=function(){return function(){return client[_0x43ca('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x43ca('0x3'),_0x43ca('0x4')],'include':[{'model':_0x43ca('0x5'),'as':_0x43ca('0x6'),'attributes':['id',_0x43ca('0x7'),_0x43ca('0x8'),_0x43ca('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index b2805c5..1a7add9 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 _0x167e=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x4fbb3e,_0x55785f){var _0x1eb197=function(_0xfda25){while(--_0xfda25){_0x4fbb3e['push'](_0x4fbb3e['shift']());}};_0x1eb197(++_0x55785f);}(_0x167e,0xa3));var _0xe167=function(_0x29bbbe,_0x41dc63){_0x29bbbe=_0x29bbbe-0x0;var _0x2b7776=_0x167e[_0x29bbbe];return _0x2b7776;};'use strict';var client=require(_0xe167('0x0'));exports[_0xe167('0x1')]=function(_0x2a44c5){return client[_0xe167('0x2')](_0xe167('0x3'),{'body':_0x2a44c5,'log':_0xe167('0x3')});};exports[_0xe167('0x4')]=function(_0x62d76c,_0x5e4863){return client[_0xe167('0x2')]('UpdateChatQueueReport',{'body':_0x5e4863,'options':{'where':{'uniqueid':_0x62d76c},'order':[['id',_0xe167('0x5')]],'limit':0x1},'log':_0xe167('0x6')});}; \ No newline at end of file +var _0x615a=['UpdateChatQueueReport','../client','CreateChatQueueReport','update','Request'];(function(_0x19b445,_0x442c37){var _0x5e0d02=function(_0x44d811){while(--_0x44d811){_0x19b445['push'](_0x19b445['shift']());}};_0x5e0d02(++_0x442c37);}(_0x615a,0x119));var _0xa615=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x615a[_0x5ce15c];return _0x36e4f5;};'use strict';var client=require(_0xa615('0x0'));exports['create']=function(_0x21ebaf){return client['Request'](_0xa615('0x1'),{'body':_0x21ebaf,'log':_0xa615('0x1')});};exports[_0xa615('0x2')]=function(_0x11fd6e,_0x52ae35){return client[_0xa615('0x3')](_0xa615('0x4'),{'body':_0x52ae35,'options':{'where':{'uniqueid':_0x11fd6e},'order':[['id','DESC']],'limit':0x1},'log':_0xa615('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2df8e3a..8ae5a76 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(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x7a54,0x106));var _0x47a5=function(_0x19948c,_0x439d48){_0x19948c=_0x19948c-0x0;var _0x257b43=_0x7a54[_0x19948c];return _0x257b43;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1336db,_0x2402c1){var _0x6158fa=function(_0x4e673b){while(--_0x4e673b){_0x1336db['push'](_0x1336db['shift']());}};_0x6158fa(++_0x2402c1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 123c837..6c9a312 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 _0x812c=['createFaxMessage','Request','CreateFaxMessage'];(function(_0x26a91c,_0x1547d0){var _0x4100a5=function(_0x32a405){while(--_0x32a405){_0x26a91c['push'](_0x26a91c['shift']());}};_0x4100a5(++_0x1547d0);}(_0x812c,0xf4));var _0xc812=function(_0x3c3407,_0x54bc76){_0x3c3407=_0x3c3407-0x0;var _0xd8eb13=_0x812c[_0x3c3407];return _0xd8eb13;};'use strict';var client=require('../client');exports['create']=function(_0x5c6593){return client[_0xc812('0x0')](_0xc812('0x1'),{'body':_0x5c6593,'log':_0xc812('0x2')});}; \ No newline at end of file +var _0xc4a8=['CreateFaxMessage','../client'];(function(_0x3bc72b,_0x34bc37){var _0x519a42=function(_0x244dd2){while(--_0x244dd2){_0x3bc72b['push'](_0x3bc72b['shift']());}};_0x519a42(++_0x34bc37);}(_0xc4a8,0x6d));var _0x8c4a=function(_0x2e2320,_0x5d2bac){_0x2e2320=_0x2e2320-0x0;var _0x19a322=_0xc4a8[_0x2e2320];return _0x19a322;};'use strict';var client=require(_0x8c4a('0x0'));exports['create']=function(_0x3cb854){return client['Request'](_0x8c4a('0x1'),{'body':_0x3cb854,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d7f91c8..f8e378f 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 _0xfc8b=['getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause','../client'];(function(_0x2f34aa,_0x4f5e96){var _0x36bf5f=function(_0x345f7d){while(--_0x345f7d){_0x2f34aa['push'](_0x2f34aa['shift']());}};_0x36bf5f(++_0x4f5e96);}(_0xfc8b,0x103));var _0xbfc8=function(_0x126e11,_0x927f3a){_0x126e11=_0x126e11-0x0;var _0x303f35=_0xfc8b[_0x126e11];return _0x303f35;};'use strict';var client=require(_0xbfc8('0x0'));exports[_0xbfc8('0x1')]=function(){return function(){return client[_0xbfc8('0x2')](_0xbfc8('0x3'),{'options':{'raw':![],'attributes':['id',_0xbfc8('0x4'),'timeout',_0xbfc8('0x5')],'include':[{'model':_0xbfc8('0x6'),'as':_0xbfc8('0x7'),'attributes':['id',_0xbfc8('0x4'),_0xbfc8('0x8'),_0xbfc8('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x19cf=['online','faxPause','../client','getFaxQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x19cf,0xb6));var _0xf19c=function(_0x1284ef,_0x7243e5){_0x1284ef=_0x1284ef-0x0;var _0xf4c0ab=_0x19cf[_0x1284ef];return _0xf4c0ab;};'use strict';var client=require(_0xf19c('0x0'));exports[_0xf19c('0x1')]=function(){return function(){return client[_0xf19c('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xf19c('0x3'),_0xf19c('0x4'),_0xf19c('0x5')],'include':[{'model':_0xf19c('0x6'),'as':_0xf19c('0x7'),'attributes':['id',_0xf19c('0x3'),_0xf19c('0x8'),_0xf19c('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index cfb54df..03e0951 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 _0xb973=['CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport','../client'];(function(_0x3127d4,_0x519d3b){var _0x573f75=function(_0x5180d0){while(--_0x5180d0){_0x3127d4['push'](_0x3127d4['shift']());}};_0x573f75(++_0x519d3b);}(_0xb973,0x167));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3b97('0x0'));exports['create']=function(_0x11713b){return client['Request']('CreateFaxQueueReport',{'body':_0x11713b,'log':_0x3b97('0x1')});};exports[_0x3b97('0x2')]=function(_0x2ade61,_0x46971e){return client[_0x3b97('0x3')]('UpdateFaxQueueReport',{'body':_0x46971e,'options':{'where':{'uniqueid':_0x2ade61},'order':[['id',_0x3b97('0x4')]],'limit':0x1},'log':_0x3b97('0x5')});}; \ No newline at end of file +var _0xcf27=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xcf27,0x78));var _0x7cf2=function(_0x3e9144,_0x2fb2fe){_0x3e9144=_0x3e9144-0x0;var _0x382112=_0xcf27[_0x3e9144];return _0x382112;};'use strict';var client=require(_0x7cf2('0x0'));exports['create']=function(_0x500382){return client[_0x7cf2('0x1')](_0x7cf2('0x2'),{'body':_0x500382,'log':_0x7cf2('0x2')});};exports[_0x7cf2('0x3')]=function(_0x109853,_0xfe29c8){return client[_0x7cf2('0x1')](_0x7cf2('0x4'),{'body':_0xfe29c8,'options':{'where':{'uniqueid':_0x109853},'order':[['id','DESC']],'limit':0x1},'log':_0x7cf2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 2fc18a4..034e790 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 _0xb275=['interval','../client','getIntervals','GetInterval','name','Interval'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb275,0xcd));var _0x5b27=function(_0x48631f,_0x50a5bb){_0x48631f=_0x48631f-0x0;var _0x8ef75d=_0xb275[_0x48631f];return _0x8ef75d;};'use strict';var client=require(_0x5b27('0x0'));exports[_0x5b27('0x1')]=function(){return function(){return client['Request'](_0x5b27('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5b27('0x3')],'include':[{'model':_0x5b27('0x4'),'as':'Intervals','attributes':['id','name',_0x5b27('0x5')]}]},'log':_0x5b27('0x1')});};}; \ No newline at end of file +var _0x1978=['../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x114088,_0x2b6667){var _0x2b5bda=function(_0x2242d2){while(--_0x2242d2){_0x114088['push'](_0x114088['shift']());}};_0x2b5bda(++_0x2b6667);}(_0x1978,0x17a));var _0x8197=function(_0x31afac,_0x1e8e05){_0x31afac=_0x31afac-0x0;var _0x1981b6=_0x1978[_0x31afac];return _0x1981b6;};'use strict';var client=require(_0x8197('0x0'));exports[_0x8197('0x1')]=function(){return function(){return client[_0x8197('0x2')](_0x8197('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8197('0x4')],'include':[{'model':_0x8197('0x5'),'as':'Intervals','attributes':['id','name','interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 35db7c7..7007c5f 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 _0x8603=['update','updateMailInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x3f0a77,_0x1c3ad8){var _0x4b8cf9=function(_0x5ea3c0){while(--_0x5ea3c0){_0x3f0a77['push'](_0x3f0a77['shift']());}};_0x4b8cf9(++_0x1c3ad8);}(_0x8603,0x190));var _0x3860=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0x8603[_0x11b19b];return _0x1daac1;};'use strict';var client=require('../client');exports[_0x3860('0x0')]=function(_0x3b9c54,_0x96d2bc){return client['Request']('UpdateMailInteraction',{'body':_0x96d2bc,'options':{'where':{'id':_0x3b9c54}},'log':_0x3860('0x1')});};exports[_0x3860('0x2')]=function(_0x2f56a3,_0x490262){return client[_0x3860('0x3')]('AddTagsToMailInteraction',{'body':_0x490262,'options':{'where':{'id':_0x2f56a3}},'log':_0x3860('0x4')});}; \ No newline at end of file +var _0x5fdc=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x37715d,_0xdb0d52){var _0x2caac8=function(_0x4a18e9){while(--_0x4a18e9){_0x37715d['push'](_0x37715d['shift']());}};_0x2caac8(++_0xdb0d52);}(_0x5fdc,0x127));var _0xc5fd=function(_0x591342,_0x56fe9c){_0x591342=_0x591342-0x0;var _0x587b3=_0x5fdc[_0x591342];return _0x587b3;};'use strict';var client=require(_0xc5fd('0x0'));exports[_0xc5fd('0x1')]=function(_0xd4407f,_0x1d01cf){return client[_0xc5fd('0x2')](_0xc5fd('0x3'),{'body':_0x1d01cf,'options':{'where':{'id':_0xd4407f}},'log':_0xc5fd('0x4')});};exports[_0xc5fd('0x5')]=function(_0xfdf928,_0x1b6205){return client[_0xc5fd('0x2')](_0xc5fd('0x6'),{'body':_0x1b6205,'options':{'where':{'id':_0xfdf928}},'log':_0xc5fd('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index fb550d7..cb20ae9 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 _0xb7cf=['Request','../client','create'];(function(_0x57117d,_0xe0956e){var _0x4a230c=function(_0x43b11d){while(--_0x43b11d){_0x57117d['push'](_0x57117d['shift']());}};_0x4a230c(++_0xe0956e);}(_0xb7cf,0x145));var _0xfb7c=function(_0x202ea3,_0x38ab41){_0x202ea3=_0x202ea3-0x0;var _0x58787b=_0xb7cf[_0x202ea3];return _0x58787b;};'use strict';var client=require(_0xfb7c('0x0'));exports[_0xfb7c('0x1')]=function(_0x481214){return client[_0xfb7c('0x2')]('CreateMailMessage',{'body':_0x481214,'log':'createMailMessage'});}; \ No newline at end of file +var _0x3920=['CreateMailMessage','createMailMessage','create','Request'];(function(_0xdbcd8e,_0x17bdee){var _0x528d11=function(_0x86aba){while(--_0x86aba){_0xdbcd8e['push'](_0xdbcd8e['shift']());}};_0x528d11(++_0x17bdee);}(_0x3920,0x11a));var _0x0392=function(_0x4013ea,_0x21079){_0x4013ea=_0x4013ea-0x0;var _0x1fd89d=_0x3920[_0x4013ea];return _0x1fd89d;};'use strict';var client=require('../client');exports[_0x0392('0x0')]=function(_0x5ee657){return client[_0x0392('0x1')](_0x0392('0x2'),{'body':_0x5ee657,'log':_0x0392('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 704adef..b3091ae 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 _0xfdf8=['name','User','online','getMailQueues','../client','Request'];(function(_0x57beaf,_0x165fb5){var _0x1f23c6=function(_0x240790){while(--_0x240790){_0x57beaf['push'](_0x57beaf['shift']());}};_0x1f23c6(++_0x165fb5);}(_0xfdf8,0x100));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x8fdf('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x8fdf('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x8fdf('0x2'),'timeout','strategy'],'include':[{'model':_0x8fdf('0x3'),'as':'Agents','attributes':['id',_0x8fdf('0x2'),_0x8fdf('0x4'),'mailPause']}]},'log':_0x8fdf('0x5')});};}; \ No newline at end of file +var _0xf561=['mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy','Agents','online'];(function(_0x460d3e,_0x59f626){var _0x5582b0=function(_0x4e3ab6){while(--_0x4e3ab6){_0x460d3e['push'](_0x460d3e['shift']());}};_0x5582b0(++_0x59f626);}(_0xf561,0x145));var _0x1f56=function(_0x2ab688,_0x206b54){_0x2ab688=_0x2ab688-0x0;var _0x352100=_0xf561[_0x2ab688];return _0x352100;};'use strict';var client=require(_0x1f56('0x0'));exports[_0x1f56('0x1')]=function(){return function(){return client[_0x1f56('0x2')](_0x1f56('0x3'),{'options':{'raw':![],'attributes':['id',_0x1f56('0x4'),'timeout',_0x1f56('0x5')],'include':[{'model':'User','as':_0x1f56('0x6'),'attributes':['id','name',_0x1f56('0x7'),_0x1f56('0x8')]}]},'log':_0x1f56('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 0507a83..5107354 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 _0x878b=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client'];(function(_0x11fe62,_0x462b8e){var _0x2cd6ed=function(_0x1e1e0c){while(--_0x1e1e0c){_0x11fe62['push'](_0x11fe62['shift']());}};_0x2cd6ed(++_0x462b8e);}(_0x878b,0x113));var _0xb878=function(_0x275cbc,_0x2a2ed6){_0x275cbc=_0x275cbc-0x0;var _0xd4e2a8=_0x878b[_0x275cbc];return _0xd4e2a8;};'use strict';var client=require(_0xb878('0x0'));exports[_0xb878('0x1')]=function(_0x18bc8d){return client[_0xb878('0x2')](_0xb878('0x3'),{'body':_0x18bc8d,'log':_0xb878('0x3')});};exports['update']=function(_0x371b6e,_0x2a7b07){return client[_0xb878('0x2')](_0xb878('0x4'),{'body':_0x2a7b07,'options':{'where':{'uniqueid':_0x371b6e},'order':[['id',_0xb878('0x5')]],'limit':0x1},'log':_0xb878('0x4')});}; \ No newline at end of file +var _0x3c1d=['CreateMailQueueReport','update','UpdateMailQueueReport','create','Request'];(function(_0x451735,_0x391a76){var _0x41d1e2=function(_0x3566d7){while(--_0x3566d7){_0x451735['push'](_0x451735['shift']());}};_0x41d1e2(++_0x391a76);}(_0x3c1d,0x85));var _0xd3c1=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x3c1d[_0x5c2e3e];return _0x53f64a;};'use strict';var client=require('../client');exports[_0xd3c1('0x0')]=function(_0x557e2e){return client[_0xd3c1('0x1')](_0xd3c1('0x2'),{'body':_0x557e2e,'log':_0xd3c1('0x2')});};exports[_0xd3c1('0x3')]=function(_0x304692,_0x4b923c){return client[_0xd3c1('0x1')](_0xd3c1('0x4'),{'body':_0x4b923c,'options':{'where':{'uniqueid':_0x304692},'order':[['id','DESC']],'limit':0x1},'log':_0xd3c1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3441103..9a53ed0 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 _0xf55e=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','../client','update'];(function(_0x1eca34,_0x1397fc){var _0x1e43b7=function(_0x586570){while(--_0x586570){_0x1eca34['push'](_0x1eca34['shift']());}};_0x1e43b7(++_0x1397fc);}(_0xf55e,0xd6));var _0xef55=function(_0x50b3fa,_0x322c75){_0x50b3fa=_0x50b3fa-0x0;var _0x3318fe=_0xf55e[_0x50b3fa];return _0x3318fe;};'use strict';var client=require(_0xef55('0x0'));exports[_0xef55('0x1')]=function(_0x4f5de4,_0xe536b2){return client[_0xef55('0x2')](_0xef55('0x3'),{'body':_0xe536b2,'options':{'where':{'id':_0x4f5de4}},'log':_0xef55('0x4')});};exports[_0xef55('0x5')]=function(_0x195fc9,_0x21e7d8){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x21e7d8,'options':{'where':{'id':_0x195fc9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xe72e=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x545503,_0x499cc1){var _0x3489a6=function(_0x6ff83b){while(--_0x6ff83b){_0x545503['push'](_0x545503['shift']());}};_0x3489a6(++_0x499cc1);}(_0xe72e,0x16b));var _0xee72=function(_0x1feb8b,_0x1228fd){_0x1feb8b=_0x1feb8b-0x0;var _0x233898=_0xe72e[_0x1feb8b];return _0x233898;};'use strict';var client=require(_0xee72('0x0'));exports[_0xee72('0x1')]=function(_0x3c460c,_0x460ee1){return client[_0xee72('0x2')](_0xee72('0x3'),{'body':_0x460ee1,'options':{'where':{'id':_0x3c460c}},'log':_0xee72('0x4')});};exports[_0xee72('0x5')]=function(_0x4cf903,_0x42de77){return client[_0xee72('0x2')](_0xee72('0x6'),{'body':_0x42de77,'options':{'where':{'id':_0x4cf903}},'log':_0xee72('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 4f8b3ae..7d8085f 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 _0x2649=['Request','createOpenchannelMessage','../client'];(function(_0x20b5ab,_0x59a647){var _0x3bd618=function(_0x295f08){while(--_0x295f08){_0x20b5ab['push'](_0x20b5ab['shift']());}};_0x3bd618(++_0x59a647);}(_0x2649,0x8f));var _0x9264=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x2649[_0x87b0ff];return _0x3bc0b2;};'use strict';var client=require(_0x9264('0x0'));exports['create']=function(_0x17408d){return client[_0x9264('0x1')]('CreateOpenchannelMessage',{'body':_0x17408d,'log':_0x9264('0x2')});}; \ No newline at end of file +var _0xf8f8=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x2b6fd6,_0x4e5a05){var _0xc0d50f=function(_0x343f1d){while(--_0x343f1d){_0x2b6fd6['push'](_0x2b6fd6['shift']());}};_0xc0d50f(++_0x4e5a05);}(_0xf8f8,0x68));var _0x8f8f=function(_0x324fd1,_0x31b165){_0x324fd1=_0x324fd1-0x0;var _0x30bd56=_0xf8f8[_0x324fd1];return _0x30bd56;};'use strict';var client=require('../client');exports['create']=function(_0x57ab88){return client[_0x8f8f('0x0')](_0x8f8f('0x1'),{'body':_0x57ab88,'log':_0x8f8f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 4432cf2..91118f8 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 _0x9d46=['name','timeout','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xddc063,_0x29ef7d){var _0x4cde0c=function(_0x1ba3e9){while(--_0x1ba3e9){_0xddc063['push'](_0xddc063['shift']());}};_0x4cde0c(++_0x29ef7d);}(_0x9d46,0x1f4));var _0x69d4=function(_0x1216bf,_0x2b0866){_0x1216bf=_0x1216bf-0x0;var _0x9ddc50=_0x9d46[_0x1216bf];return _0x9ddc50;};'use strict';var client=require(_0x69d4('0x0'));exports[_0x69d4('0x1')]=function(){return function(){return client[_0x69d4('0x2')](_0x69d4('0x3'),{'options':{'raw':![],'attributes':['id',_0x69d4('0x4'),_0x69d4('0x5'),'strategy'],'include':[{'model':_0x69d4('0x6'),'as':_0x69d4('0x7'),'attributes':['id','name','online',_0x69d4('0x8')]}]},'log':_0x69d4('0x1')});};}; \ No newline at end of file +var _0x59b7=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x47db7a,_0x16c00e){var _0x5966dc=function(_0x343f62){while(--_0x343f62){_0x47db7a['push'](_0x47db7a['shift']());}};_0x5966dc(++_0x16c00e);}(_0x59b7,0x1ae));var _0x759b=function(_0x57b680,_0x7e6240){_0x57b680=_0x57b680-0x0;var _0x46e938=_0x59b7[_0x57b680];return _0x46e938;};'use strict';var client=require(_0x759b('0x0'));exports[_0x759b('0x1')]=function(){return function(){return client[_0x759b('0x2')](_0x759b('0x3'),{'options':{'raw':![],'attributes':['id',_0x759b('0x4'),_0x759b('0x5'),_0x759b('0x6')],'include':[{'model':_0x759b('0x7'),'as':_0x759b('0x8'),'attributes':['id',_0x759b('0x4'),_0x759b('0x9'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f23b4a1..7641186 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 _0x219c=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x469aab,_0x198e34){var _0x35a826=function(_0x261f7f){while(--_0x261f7f){_0x469aab['push'](_0x469aab['shift']());}};_0x35a826(++_0x198e34);}(_0x219c,0x163));var _0xc219=function(_0x277aa5,_0x3b6050){_0x277aa5=_0x277aa5-0x0;var _0x4b2aee=_0x219c[_0x277aa5];return _0x4b2aee;};'use strict';var client=require(_0xc219('0x0'));exports[_0xc219('0x1')]=function(_0x3dbfab){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x3dbfab,'log':_0xc219('0x2')});};exports[_0xc219('0x3')]=function(_0x14fad7,_0x5cfd65){return client[_0xc219('0x4')](_0xc219('0x5'),{'body':_0x5cfd65,'options':{'where':{'uniqueid':_0x14fad7},'order':[['id',_0xc219('0x6')]],'limit':0x1},'log':_0xc219('0x5')});}; \ No newline at end of file +var _0xb47c=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x2831cf,_0x24babf){var _0x5ec206=function(_0x590587){while(--_0x590587){_0x2831cf['push'](_0x2831cf['shift']());}};_0x5ec206(++_0x24babf);}(_0xb47c,0x1b4));var _0xcb47=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0xb47c[_0xd98def];return _0x55b182;};'use strict';var client=require(_0xcb47('0x0'));exports['create']=function(_0xa2c9a9){return client[_0xcb47('0x1')](_0xcb47('0x2'),{'body':_0xa2c9a9,'log':_0xcb47('0x2')});};exports[_0xcb47('0x3')]=function(_0x411ec3,_0x356919){return client['Request'](_0xcb47('0x4'),{'body':_0x356919,'options':{'where':{'uniqueid':_0x411ec3},'order':[['id',_0xcb47('0x5')]],'limit':0x1},'log':_0xcb47('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 127fb2f..23136af 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 _0x0a9a=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x38e79d,_0x4050ce){var _0x4021e6=function(_0x5e8c0c){while(--_0x5e8c0c){_0x38e79d['push'](_0x38e79d['shift']());}};_0x4021e6(++_0x4050ce);}(_0x0a9a,0x183));var _0xa0a9=function(_0x78ce99,_0x173dc1){_0x78ce99=_0x78ce99-0x0;var _0x22ddfd=_0x0a9a[_0x78ce99];return _0x22ddfd;};'use strict';var client=require('../client');exports[_0xa0a9('0x0')]=function(_0x51baa8,_0x3b1a40){return client[_0xa0a9('0x1')](_0xa0a9('0x2'),{'body':_0x3b1a40,'options':{'where':{'id':_0x51baa8}},'log':_0xa0a9('0x3')});};exports['addTags']=function(_0x317a94,_0x360be5){return client['Request'](_0xa0a9('0x4'),{'body':_0x360be5,'options':{'where':{'id':_0x317a94}},'log':_0xa0a9('0x5')});}; \ No newline at end of file +var _0xac0a=['addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x3b2d61,_0x389346){var _0x1e9fc6=function(_0x5c0f10){while(--_0x5c0f10){_0x3b2d61['push'](_0x3b2d61['shift']());}};_0x1e9fc6(++_0x389346);}(_0xac0a,0x11e));var _0xaac0=function(_0x50736c,_0x2bd1e7){_0x50736c=_0x50736c-0x0;var _0x3e001b=_0xac0a[_0x50736c];return _0x3e001b;};'use strict';var client=require('../client');exports['update']=function(_0x1cbfa7,_0x24ec08){return client['Request'](_0xaac0('0x0'),{'body':_0x24ec08,'options':{'where':{'id':_0x1cbfa7}},'log':_0xaac0('0x1')});};exports[_0xaac0('0x2')]=function(_0x1ca4e1,_0x3ccfd9){return client[_0xaac0('0x3')](_0xaac0('0x4'),{'body':_0x3ccfd9,'options':{'where':{'id':_0x1ca4e1}},'log':_0xaac0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 98f3939..206c5a4 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 _0xc4a5=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x3c3579,_0x64ce36){var _0x71745c=function(_0x1ad223){while(--_0x1ad223){_0x3c3579['push'](_0x3c3579['shift']());}};_0x71745c(++_0x64ce36);}(_0xc4a5,0x15f));var _0x5c4a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xc4a5[_0xa8883];return _0x479426;};'use strict';var client=require(_0x5c4a('0x0'));exports[_0x5c4a('0x1')]=function(_0x597ea){return client[_0x5c4a('0x2')](_0x5c4a('0x3'),{'body':_0x597ea,'log':_0x5c4a('0x4')});}; \ No newline at end of file +var _0xd85b=['createSmsMessage','create','CreateSmsMessage'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xd85b,0x88));var _0xbd85=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd85b[_0x19950b];return _0x3c6b41;};'use strict';var client=require('../client');exports[_0xbd85('0x0')]=function(_0x334eb1){return client['Request'](_0xbd85('0x1'),{'body':_0x334eb1,'log':_0xbd85('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 3b2340e..d318c90 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x539544,_0x5484a3){var _0x5c863e=function(_0x274978){while(--_0x274978){_0x539544['push'](_0x539544['shift']());}};_0x5c863e(++_0x5484a3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0xcb91[_0xf31767];return _0x24bd0c;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xf04ce5,_0x164bed){var _0x25fe1a=function(_0x44b64a){while(--_0x44b64a){_0xf04ce5['push'](_0xf04ce5['shift']());}};_0x25fe1a(++_0x164bed);}(_0xe706,0xa3));var _0x6e70=function(_0xa9430,_0x14f536){_0xa9430=_0xa9430-0x0;var _0x220b68=_0xe706[_0xa9430];return _0x220b68;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c32b58a..bcffe91 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x306e60,_0x284708){var _0x6f7789=function(_0x3de569){while(--_0x3de569){_0x306e60['push'](_0x306e60['shift']());}};_0x6f7789(++_0x284708);}(_0x70e0,0x17b));var _0x070e=function(_0x2a6052,_0x2b2914){_0x2a6052=_0x2a6052-0x0;var _0x55951f=_0x70e0[_0x2a6052];return _0x55951f;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x17f3bb,_0x5aecc2){var _0x3ec342=function(_0x11a6fe){while(--_0x11a6fe){_0x17f3bb['push'](_0x17f3bb['shift']());}};_0x3ec342(++_0x5aecc2);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6a4ec2b..c36cdb3 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(_0x18cc6e,_0x3ff051){var _0x3ef7bd=function(_0x4c7b9d){while(--_0x4c7b9d){_0x18cc6e['push'](_0x18cc6e['shift']());}};_0x3ef7bd(++_0x3ff051);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x4a8c7b,_0xbb188d){var _0x2bff52=function(_0x18eb7b){while(--_0x18eb7b){_0x4a8c7b['push'](_0x4a8c7b['shift']());}};_0x2bff52(++_0xbb188d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 d4b4967..1df446e 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 _0xd9fb=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update','Request'];(function(_0x37449b,_0x34444c){var _0xfee9a1=function(_0x2407ee){while(--_0x2407ee){_0x37449b['push'](_0x37449b['shift']());}};_0xfee9a1(++_0x34444c);}(_0xd9fb,0x189));var _0xbd9f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xd9fb[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(_0x288314,_0x1eeb46){return client[_0xbd9f('0x2')](_0xbd9f('0x3'),{'body':_0x1eeb46,'options':{'where':{'id':_0x288314}},'log':_0xbd9f('0x4')});};exports['addTags']=function(_0x2d4213,_0xf146bc){return client['Request'](_0xbd9f('0x5'),{'body':_0xf146bc,'options':{'where':{'id':_0x2d4213}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xeda8=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x4e8713,_0x343df3){var _0x48646f=function(_0x2e1219){while(--_0x2e1219){_0x4e8713['push'](_0x4e8713['shift']());}};_0x48646f(++_0x343df3);}(_0xeda8,0x104));var _0x8eda=function(_0x5c451f,_0x1bf2bb){_0x5c451f=_0x5c451f-0x0;var _0x1b7651=_0xeda8[_0x5c451f];return _0x1b7651;};'use strict';var client=require(_0x8eda('0x0'));exports[_0x8eda('0x1')]=function(_0x539019,_0x12899a){return client[_0x8eda('0x2')](_0x8eda('0x3'),{'body':_0x12899a,'options':{'where':{'id':_0x539019}},'log':_0x8eda('0x4')});};exports[_0x8eda('0x5')]=function(_0x94b83f,_0x25b19a){return client[_0x8eda('0x2')](_0x8eda('0x6'),{'body':_0x25b19a,'options':{'where':{'id':_0x94b83f}},'log':_0x8eda('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 3bc2d93..0d87280 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 _0xd532=['CreateWhatsappMessage','../client','create','Request'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0xd532,0x149));var _0x2d53=function(_0x248390,_0x5a6316){_0x248390=_0x248390-0x0;var _0x1f431c=_0xd532[_0x248390];return _0x1f431c;};'use strict';var client=require(_0x2d53('0x0'));exports[_0x2d53('0x1')]=function(_0x2ce5bc){return client[_0x2d53('0x2')](_0x2d53('0x3'),{'body':_0x2ce5bc,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xc2c9=['create','Request','CreateWhatsappMessage','../client'];(function(_0x5f3ebe,_0x161e96){var _0x3c93a2=function(_0x5bc126){while(--_0x5bc126){_0x5f3ebe['push'](_0x5f3ebe['shift']());}};_0x3c93a2(++_0x161e96);}(_0xc2c9,0x87));var _0x9c2c=function(_0x2f3db5,_0x5d7094){_0x2f3db5=_0x2f3db5-0x0;var _0x3b8713=_0xc2c9[_0x2f3db5];return _0x3b8713;};'use strict';var client=require(_0x9c2c('0x0'));exports[_0x9c2c('0x1')]=function(_0x1725c6){return client[_0x9c2c('0x2')](_0x9c2c('0x3'),{'body':_0x1725c6,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b7a70fd..88fec55 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 _0x03bb=['name','timeout','strategy','Agents','getWhatsappQueues','../client','Request','GetWhatsappQueue'];(function(_0x51057c,_0x2a7744){var _0x236290=function(_0xe9aaa3){while(--_0xe9aaa3){_0x51057c['push'](_0x51057c['shift']());}};_0x236290(++_0x2a7744);}(_0x03bb,0x6d));var _0xb03b=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x03bb[_0x2405bc];return _0x5272d4;};'use strict';var client=require(_0xb03b('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xb03b('0x1')](_0xb03b('0x2'),{'options':{'raw':![],'attributes':['id',_0xb03b('0x3'),_0xb03b('0x4'),_0xb03b('0x5')],'include':[{'model':'User','as':_0xb03b('0x6'),'attributes':['id','name','online','whatsappPause']}]},'log':_0xb03b('0x7')});};}; \ No newline at end of file +var _0x2032=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x117581,_0x307e77){var _0x25cfa7=function(_0xcb89ee){while(--_0xcb89ee){_0x117581['push'](_0x117581['shift']());}};_0x25cfa7(++_0x307e77);}(_0x2032,0x156));var _0x2203=function(_0x5173dc,_0x26bef5){_0x5173dc=_0x5173dc-0x0;var _0x34b891=_0x2032[_0x5173dc];return _0x34b891;};'use strict';var client=require(_0x2203('0x0'));exports[_0x2203('0x1')]=function(){return function(){return client[_0x2203('0x2')](_0x2203('0x3'),{'options':{'raw':![],'attributes':['id',_0x2203('0x4'),_0x2203('0x5'),_0x2203('0x6')],'include':[{'model':_0x2203('0x7'),'as':_0x2203('0x8'),'attributes':['id',_0x2203('0x4'),_0x2203('0x9'),_0x2203('0xa')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7ac5f9a..cabeda5 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 _0x68c4=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x68c4,0xe8));var _0x468c=function(_0x3ba537,_0x56b969){_0x3ba537=_0x3ba537-0x0;var _0x585c1a=_0x68c4[_0x3ba537];return _0x585c1a;};'use strict';var client=require('../client');exports['create']=function(_0x4c2f56){return client[_0x468c('0x0')](_0x468c('0x1'),{'body':_0x4c2f56,'log':_0x468c('0x1')});};exports['update']=function(_0xba8783,_0x115132){return client['Request'](_0x468c('0x2'),{'body':_0x115132,'options':{'where':{'uniqueid':_0xba8783},'order':[['id',_0x468c('0x3')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xe972=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x1101b3,_0x204a1f){var _0x4e1dc1=function(_0x19593f){while(--_0x19593f){_0x1101b3['push'](_0x1101b3['shift']());}};_0x4e1dc1(++_0x204a1f);}(_0xe972,0x116));var _0x2e97=function(_0x14d0d4,_0x47e746){_0x14d0d4=_0x14d0d4-0x0;var _0x26e52e=_0xe972[_0x14d0d4];return _0x26e52e;};'use strict';var client=require(_0x2e97('0x0'));exports[_0x2e97('0x1')]=function(_0x2834e9){return client[_0x2e97('0x2')](_0x2e97('0x3'),{'body':_0x2834e9,'log':_0x2e97('0x3')});};exports[_0x2e97('0x4')]=function(_0x1da2ab,_0x321e4d){return client[_0x2e97('0x2')](_0x2e97('0x5'),{'body':_0x321e4d,'options':{'where':{'uniqueid':_0x1da2ab},'order':[['id',_0x2e97('0x6')]],'limit':0x1},'log':_0x2e97('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c127b7f..150a4ce 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 _0x0830=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','stop','find','timeout','atimeout','channel','START:%s','rules','close','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing'];(function(_0x51821c,_0x2e39c5){var _0x20bde8=function(_0x2d307a){while(--_0x2d307a){_0x51821c['push'](_0x51821c['shift']());}};_0x20bde8(++_0x2e39c5);}(_0x0830,0x15b));var _0x0083=function(_0x1035ad,_0x18a82a){_0x1035ad=_0x1035ad-0x0;var _0x70d5c4=_0x0830[_0x1035ad];return _0x70d5c4;};'use strict';var schema=require(_0x0083('0x0'));var _=require(_0x0083('0x1'));var util=require(_0x0083('0x2'));var seqqueue=require(_0x0083('0x3'));var logger=require('../../../../config/logger')(_0x0083('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x0083('0x5')},'timeout':{'type':_0x0083('0x6'),'message':_0x0083('0x7')}});function writeLog(_0xa4753d,_0x1d6afc,_0x63b4c6){return logger[_0x0083('0x8')](util['format'](_0x0083('0x9'),_0xa4753d,_0x1d6afc[_0x0083('0xa')],_0x63b4c6));}function handleFindAgent(_0x5ae9fa){return function(_0x197151){return _0x197151[_0x0083('0xa')][_0x0083('0xb')]()===_0x5ae9fa['toLowerCase']();};}exports[_0x0083('0xc')]=function(_0x253014,_0x352ac6,_0xe6e4b4,_0x851f7c){return function(_0x5109ed){try{var _0x3f2bfb={'name':_0x352ac6[0x0],'timeout':_0x352ac6[0x1]};var _0xfb7061=queue[_0x0083('0x0')](_0x3f2bfb,{'typecast':!![]});if(_0xfb7061[_0x0083('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x253014,_[_0x0083('0xe')](_0xfb7061,_0x0083('0xf'))[_0x0083('0x10')](',\x20'));_0x5109ed[_0x0083('0x11')]();}else{var _0x3a9c26=_[_0x0083('0x12')](_0xe6e4b4['agents'],handleFindAgent(_0x3f2bfb[_0x0083('0xa')]));if(_0x3a9c26){var _0x3edd89=(_0x3f2bfb[_0x0083('0x13')]||0xa)*0x3e8;var _0x37cb07,_0x50009c;var _0x5dac2b=seqqueue['createQueue'](_0x3edd89);_0x5dac2b['id']=_0x253014;_0x5dac2b[_0x0083('0x14')]=_0x3edd89;_0x5dac2b[_0x0083('0x15')]=_0x851f7c[_0x0083('0x15')];writeLog(_0x253014,_0x3a9c26,util['format'](_0x0083('0x16'),_0x3edd89));_0xe6e4b4[_0x0083('0x17')][_0x253014]['on']('end',function(){logger[_0x0083('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x253014);clearTimeout(_0x50009c);_0x50009c=undefined;_0x5dac2b[_0x0083('0x18')]();if(_0xe6e4b4[_0x0083('0x17')][_0x253014]){delete _0xe6e4b4['rules'][_0x253014];}_0x5109ed[_0x0083('0x11')]();});_0xe6e4b4['rules'][_0x253014]['on']('complete',function(){if(_0xe6e4b4[_0x0083('0x17')][_0x253014]){delete _0xe6e4b4[_0x0083('0x17')][_0x253014];}});_0x50009c=setTimeout(function(){logger[_0x0083('0x8')](_0x0083('0x19'),_0x253014);clearTimeout(_0x50009c);_0x5dac2b[_0x0083('0x18')]();_0x5109ed[_0x0083('0x1a')]();},_0x3edd89);strategy['agent'](_0x5dac2b,_0x3a9c26,_0xe6e4b4,_0x851f7c);}else{logger[_0x0083('0x1b')](_0x0083('0x1c'),_0x253014,_0x3f2bfb[_0x0083('0xa')]);_0x5109ed[_0x0083('0x11')]();}}}catch(_0x517919){console[_0x0083('0x1d')](_0x517919);logger[_0x0083('0x1b')](_0x0083('0x1e'),_0x253014,_0x517919[_0x0083('0x1f')]);_0x5109ed[_0x0083('0x11')]();}};}; \ No newline at end of file +var _0x7ac1=['toLowerCase','consequence','error','map','message','stop','timeout','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','agent','log','stack','validate','lodash','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','name'];(function(_0x460819,_0x2e1aa8){var _0x2c82d7=function(_0xca2d32){while(--_0xca2d32){_0x460819['push'](_0x460819['shift']());}};_0x2c82d7(++_0x2e1aa8);}(_0x7ac1,0xcd));var _0x17ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ac1[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0x17ac('0x0'));var _=require(_0x17ac('0x1'));var util=require('util');var seqqueue=require(_0x17ac('0x2'));var logger=require(_0x17ac('0x3'))('routing');var strategy=require(_0x17ac('0x4'));var queue=schema({'name':{'type':_0x17ac('0x5'),'required':!![],'message':_0x17ac('0x6')},'timeout':{'type':_0x17ac('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x42e6bb,_0xaac349,_0xacc092){return logger[_0x17ac('0x8')](util[_0x17ac('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x42e6bb,_0xaac349[_0x17ac('0xa')],_0xacc092));}function handleFindAgent(_0x921c8c){return function(_0x181fb8){return _0x181fb8[_0x17ac('0xa')][_0x17ac('0xb')]()===_0x921c8c[_0x17ac('0xb')]();};}exports[_0x17ac('0xc')]=function(_0x36be84,_0xdf5e30,_0x1a8104,_0x5a2d91){return function(_0x1b8b61){try{var _0x46f355={'name':_0xdf5e30[0x0],'timeout':_0xdf5e30[0x1]};var _0x946f1d=queue['validate'](_0x46f355,{'typecast':!![]});if(_0x946f1d['length']){logger[_0x17ac('0xd')]('[%s][AGENT]\x20%s',_0x36be84,_[_0x17ac('0xe')](_0x946f1d,_0x17ac('0xf'))['join'](',\x20'));_0x1b8b61[_0x17ac('0x10')]();}else{var _0x594a79=_['find'](_0x1a8104['agents'],handleFindAgent(_0x46f355['name']));if(_0x594a79){var _0xc844f=(_0x46f355[_0x17ac('0x11')]||0xa)*0x3e8;var _0x3ccd50,_0xe942a;var _0x3da5e5=seqqueue['createQueue'](_0xc844f);_0x3da5e5['id']=_0x36be84;_0x3da5e5[_0x17ac('0x12')]=_0xc844f;_0x3da5e5[_0x17ac('0x13')]=_0x5a2d91['channel'];writeLog(_0x36be84,_0x594a79,util[_0x17ac('0x9')]('START:%s',_0xc844f));_0x1a8104[_0x17ac('0x14')][_0x36be84]['on'](_0x17ac('0x15'),function(){logger[_0x17ac('0x8')](_0x17ac('0x16'),_0x36be84);clearTimeout(_0xe942a);_0xe942a=undefined;_0x3da5e5['close']();if(_0x1a8104[_0x17ac('0x14')][_0x36be84]){delete _0x1a8104[_0x17ac('0x14')][_0x36be84];}_0x1b8b61[_0x17ac('0x10')]();});_0x1a8104[_0x17ac('0x14')][_0x36be84]['on'](_0x17ac('0x17'),function(){if(_0x1a8104['rules'][_0x36be84]){delete _0x1a8104[_0x17ac('0x14')][_0x36be84];}});_0xe942a=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x36be84);clearTimeout(_0xe942a);_0x3da5e5['close']();_0x1b8b61['next']();},_0xc844f);strategy[_0x17ac('0x18')](_0x3da5e5,_0x594a79,_0x1a8104,_0x5a2d91);}else{logger[_0x17ac('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x36be84,_0x46f355[_0x17ac('0xa')]);_0x1b8b61[_0x17ac('0x10')]();}}}catch(_0x151ae5){console[_0x17ac('0x19')](_0x151ae5);logger[_0x17ac('0xd')]('[%s][QUEUE]\x20%s',_0x36be84,_0x151ae5[_0x17ac('0x1a')]);_0x1b8b61[_0x17ac('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 9eaa4b3..3f1d604 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 _0xa1a1=['out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','body','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','toString','postText','amazonlex','providerName','then','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x3e8082,_0x481707){var _0x58794=function(_0x25fb94){while(--_0x25fb94){_0x3e8082['push'](_0x3e8082['shift']());}};_0x58794(++_0x481707);}(_0xa1a1,0x144));var _0x1a1a=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xa1a1[_0x27dba4];return _0x35ec9d;};'use strict';var _=require('lodash');var moment=require(_0x1a1a('0x0'));var AWS=require(_0x1a1a('0x1'));var utils=require(_0x1a1a('0x2'));var logger=require(_0x1a1a('0x3'))(_0x1a1a('0x4'));var rpc={'chatMessage':require(_0x1a1a('0x5')),'openchannelMessage':require(_0x1a1a('0x6')),'mailMessage':require(_0x1a1a('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1a1a('0x8')),'whatsappMessage':require(_0x1a1a('0x9'))};exports[_0x1a1a('0xa')]=function(_0x35bcde,_0x294278){return function(_0x5210fd){try{if(!_[_0x1a1a('0xb')](this[_0x1a1a('0xc')][_0x1a1a('0xd')])){logger[_0x1a1a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,_0x1a1a('0xf'));return _0x5210fd[_0x1a1a('0x10')]();}var _0x116df4={'ContactId':this[_0x1a1a('0x11')]['id'],'sentAt':moment()[_0x1a1a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1a1a('0x13')};if(this[_0x1a1a('0x14')]===_0x1a1a('0x15')||this[_0x1a1a('0x14')]===_0x1a1a('0x16')){_0x116df4[_0x1a1a('0x17')]=this[_0x1a1a('0xc')][_0x1a1a('0x17')];}var _0x30919e=this['channel'];if(_0x30919e===_0x1a1a('0x18')){_0x116df4[_0x1a1a('0x19')]=this[_0x1a1a('0x1a')]['id'];}else{_0x116df4[_[_0x1a1a('0x1b')](_0x30919e)+_0x1a1a('0x1c')]=this[_0x1a1a('0x1a')]['id'];}_0x116df4[_['upperFirst'](_0x30919e)+'InteractionId']=this[_0x1a1a('0xc')]['id'];if(this[_0x1a1a('0xc')]['created']){var _0x4e5920=_0x294278[0x4];if(!_['isEmpty'](_0x4e5920)){_0x116df4[_0x1a1a('0x1d')]=utils[_0x1a1a('0x1e')](_0x4e5920,this);return rpc[_0x30919e+_0x1a1a('0x1f')][_0x1a1a('0x20')](_0x116df4)['then'](function(_0x15e291){logger[_0x1a1a('0xe')](_0x1a1a('0x21'),_0x35bcde,_0x116df4[_0x1a1a('0x1d')]);})['catch'](function(_0xb6bee4){logger[_0x1a1a('0x22')](_0x1a1a('0x21'),_0x35bcde,JSON[_0x1a1a('0x23')](_0xb6bee4));})[_0x1a1a('0x24')](function(){logger[_0x1a1a('0xe')](_0x1a1a('0x25'),_0x35bcde);_0x5210fd['stop']();});}else{logger['info'](_0x1a1a('0x26'),_0x35bcde);_0x5210fd[_0x1a1a('0x27')]();}}else{var _0x19505f=this;var _0xc1aba4=new AWS[(_0x1a1a('0x28'))]({'accessKeyId':_0x294278[0x0],'secretAccessKey':_0x294278[0x1],'region':_0x294278[0x2]});var _0x14d825={'botAlias':'$LATEST','botName':_0x294278[0x3],'inputText':this[_0x1a1a('0x29')][_0x1a1a('0x1d')],'userId':this[_0x1a1a('0x14')]+':'+this[_0x1a1a('0xc')]['id'][_0x1a1a('0x2a')]()};_0xc1aba4[_0x1a1a('0x2b')](_0x14d825,function(_0x5692e0,_0x13f519){if(_0x5692e0){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,_0x5692e0[_0x1a1a('0x29')]);_0x5210fd[_0x1a1a('0x10')]();}else if(_0x13f519&&_0x13f519[_0x1a1a('0x29')]){_0x19505f[_0x1a1a('0x1d')][_0x1a1a('0x2c')]=_0x13f519;_0x116df4[_0x1a1a('0x1d')]=_0x13f519['message'];_0x116df4[_0x1a1a('0x2d')]=_0x1a1a('0x2c');_0x116df4['providerResponse']=JSON['stringify'](_0x13f519);return rpc[_0x30919e+_0x1a1a('0x1f')][_0x1a1a('0x20')](_0x116df4)[_0x1a1a('0x2e')](function(_0x1f4bb7){logger[_0x1a1a('0xe')](_0x1a1a('0x21'),_0x35bcde,_0x116df4[_0x1a1a('0x1d')]);if(_0x13f519[_0x1a1a('0x2f')]==_0x1a1a('0x30')){_0x5210fd['next']();}else{_0x5210fd['stop']();}})['catch'](function(_0x2a8f92){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,JSON[_0x1a1a('0x23')](_0x2a8f92));_0x5210fd['next']();});}else{_0x5210fd[_0x1a1a('0x10')]();}});}}catch(_0x13eefe){logger[_0x1a1a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x35bcde,JSON[_0x1a1a('0x23')](_0x13eefe));_0x5210fd['stop']();}};}; \ No newline at end of file +var _0x3526=['catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','then','info','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','postText','error','amazonlex','providerName','providerResponse','Message','create','dialogState','Failed'];(function(_0x48a87b,_0x3af8e5){var _0x359057=function(_0x516834){while(--_0x516834){_0x48a87b['push'](_0x48a87b['shift']());}};_0x359057(++_0x3af8e5);}(_0x3526,0x139));var _0x6352=function(_0x3baad2,_0x5c6c49){_0x3baad2=_0x3baad2-0x0;var _0x24da68=_0x3526[_0x3baad2];return _0x24da68;};'use strict';var _=require(_0x6352('0x0'));var moment=require(_0x6352('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6352('0x2'));var logger=require(_0x6352('0x3'))(_0x6352('0x4'));var rpc={'chatMessage':require(_0x6352('0x5')),'openchannelMessage':require(_0x6352('0x6')),'mailMessage':require(_0x6352('0x7')),'smsMessage':require(_0x6352('0x8')),'faxMessage':require(_0x6352('0x9')),'whatsappMessage':require(_0x6352('0xa'))};exports[_0x6352('0xb')]=function(_0x4339b4,_0x3dd4cf){return function(_0x438298){try{if(!_[_0x6352('0xc')](this[_0x6352('0xd')][_0x6352('0xe')])){logger['info'](_0x6352('0xf'),_0x4339b4,_0x6352('0x10'));return _0x438298[_0x6352('0x11')]();}var _0x5a38d9={'ContactId':this[_0x6352('0x12')]['id'],'sentAt':moment()[_0x6352('0x13')](_0x6352('0x14')),'direction':_0x6352('0x15')};if(this[_0x6352('0x16')]===_0x6352('0x17')||this[_0x6352('0x16')]==='whatsapp'){_0x5a38d9[_0x6352('0x18')]=this[_0x6352('0xd')][_0x6352('0x18')];}var _0x3733ab=this[_0x6352('0x16')];if(_0x3733ab===_0x6352('0x19')){_0x5a38d9[_0x6352('0x1a')]=this[_0x6352('0x1b')]['id'];}else{_0x5a38d9[_[_0x6352('0x1c')](_0x3733ab)+_0x6352('0x1d')]=this[_0x6352('0x1b')]['id'];}_0x5a38d9[_[_0x6352('0x1c')](_0x3733ab)+'InteractionId']=this[_0x6352('0xd')]['id'];if(this['interaction'][_0x6352('0x1e')]){var _0x2e9ec0=_0x3dd4cf[0x4];if(!_[_0x6352('0x1f')](_0x2e9ec0)){_0x5a38d9[_0x6352('0x20')]=utils['getMustacheRender'](_0x2e9ec0,this);return rpc[_0x3733ab+'Message']['create'](_0x5a38d9)[_0x6352('0x21')](function(_0x16c611){logger[_0x6352('0x22')](_0x6352('0xf'),_0x4339b4,_0x5a38d9['body']);})['catch'](function(_0x21d2e6){logger['error'](_0x6352('0xf'),_0x4339b4,JSON[_0x6352('0x23')](_0x21d2e6));})[_0x6352('0x24')](function(){logger[_0x6352('0x22')](_0x6352('0x25'),_0x4339b4);_0x438298[_0x6352('0x26')]();});}else{logger[_0x6352('0x22')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4339b4);_0x438298['stop']();}}else{var _0xa1e3e5=this;var _0x45d75d=new AWS[(_0x6352('0x27'))]({'accessKeyId':_0x3dd4cf[0x0],'secretAccessKey':_0x3dd4cf[0x1],'region':_0x3dd4cf[0x2]});var _0x4ca36f={'botAlias':_0x6352('0x28'),'botName':_0x3dd4cf[0x3],'inputText':this[_0x6352('0x29')]['body'],'userId':this[_0x6352('0x16')]+':'+this[_0x6352('0xd')]['id']['toString']()};_0x45d75d[_0x6352('0x2a')](_0x4ca36f,function(_0x15226b,_0x209614){if(_0x15226b){logger[_0x6352('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x4339b4,_0x15226b[_0x6352('0x29')]);_0x438298[_0x6352('0x11')]();}else if(_0x209614&&_0x209614['message']){_0xa1e3e5[_0x6352('0x20')][_0x6352('0x2c')]=_0x209614;_0x5a38d9['body']=_0x209614[_0x6352('0x29')];_0x5a38d9[_0x6352('0x2d')]=_0x6352('0x2c');_0x5a38d9[_0x6352('0x2e')]=JSON[_0x6352('0x23')](_0x209614);return rpc[_0x3733ab+_0x6352('0x2f')][_0x6352('0x30')](_0x5a38d9)[_0x6352('0x21')](function(_0x4e899c){logger[_0x6352('0x22')]('[%s][AMAZONLEX]\x20%s',_0x4339b4,_0x5a38d9[_0x6352('0x20')]);if(_0x209614[_0x6352('0x31')]==_0x6352('0x32')){_0x438298[_0x6352('0x11')]();}else{_0x438298[_0x6352('0x26')]();}})[_0x6352('0x33')](function(_0x401180){logger[_0x6352('0x2b')](_0x6352('0xf'),_0x4339b4,JSON[_0x6352('0x23')](_0x401180));_0x438298[_0x6352('0x11')]();});}else{_0x438298['next']();}});}}catch(_0x5b986f){logger[_0x6352('0x2b')](_0x6352('0xf'),_0x4339b4,JSON['stringify'](_0x5b986f));_0x438298['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 106b15e..dcf6421 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 _0xae9a=['sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','replace','','auto-replied','All','auto_reply'];(function(_0x48d260,_0x43871c){var _0x499460=function(_0x2a5074){while(--_0x2a5074){_0x48d260['push'](_0x48d260['shift']());}};_0x499460(++_0x43871c);}(_0xae9a,0x1b2));var _0xaae9=function(_0x8f7df5,_0x48c110){_0x8f7df5=_0x8f7df5-0x0;var _0x4e66d=_0xae9a[_0x8f7df5];return _0x4e66d;};'use strict';var _=require(_0xaae9('0x0'));var moment=require(_0xaae9('0x1'));var utils=require(_0xaae9('0x2'));var logger=require(_0xaae9('0x3'))(_0xaae9('0x4'));var rpc={'chatMessage':require(_0xaae9('0x5')),'openchannelMessage':require(_0xaae9('0x6')),'mailMessage':require(_0xaae9('0x7')),'smsMessage':require(_0xaae9('0x8')),'faxMessage':require(_0xaae9('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xaae9('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xaae9('0xb')),'smsInteraction':require(_0xaae9('0xc')),'faxInteraction':require(_0xaae9('0xd')),'whatsappInteraction':require(_0xaae9('0xe'))};var mailRpc=require(_0xaae9('0xf'));exports[_0xaae9('0x10')]=function(_0x3aff7d,_0x26350a,_0x3e6152,_0x16800c){return function(_0x555824){try{var _0x5aa036=this[_0xaae9('0x11')];if(_0x5aa036===_0xaae9('0x12')&&_0x16800c['body']['isAutoreply']){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,_0xaae9('0x15'));return _0x555824['next']();}if(_0x26350a[0x0]==='1'&&(_[_0xaae9('0x16')](this[_0xaae9('0x17')][_0xaae9('0x18')])||!this[_0xaae9('0x17')]['created'])){logger[_0xaae9('0x13')]('[%s][AUTOREPLY]\x20%s',_0x3aff7d,_0xaae9('0x19'));return _0x555824[_0xaae9('0x1a')]();}if(_0x26350a[0x0]==='2'&&this[_0xaae9('0x17')][_0xaae9('0x1b')]){logger['info'](_0xaae9('0x1c'),_0x3aff7d,_0xaae9('0x1d'));return _0x555824[_0xaae9('0x1a')]();}var _0x3cacb7={'ContactId':this[_0xaae9('0x1e')]['id'],'sentAt':moment()['format'](_0xaae9('0x1f')),'direction':_0xaae9('0x20')};if(this['channel']===_0xaae9('0x12')){_0x3cacb7[_0xaae9('0x21')]=utils['getMustacheRender'](_0x26350a[0x2],this);}else{_0x3cacb7['body']=utils[_0xaae9('0x22')](_0x26350a[0x1],this);}if(this['message']){_0x3cacb7['to']=this[_0xaae9('0x23')][_0xaae9('0x24')]||'';if(this[_0xaae9('0x11')]==='mail'&&_0x26350a[0x1]==='1'){_0x3cacb7['cc']=this['message']['cc']||'';}_0x3cacb7[_0xaae9('0x24')]=this[_0xaae9('0x23')]['to']||'';_0x3cacb7[_0xaae9('0x25')]=this['message']['phone']||'';_0x3cacb7[_0xaae9('0x26')]=!![];if(this[_0xaae9('0x23')][_0xaae9('0x27')]){_0x3cacb7[_0xaae9('0x27')]='';_0x3cacb7[_0xaae9('0x27')]+=_['startsWith'](this[_0xaae9('0x23')][_0xaae9('0x27')],_0xaae9('0x28'))?'':_0xaae9('0x29');_0x3cacb7[_0xaae9('0x27')]+=this[_0xaae9('0x23')]['subject'];}}if(this[_0xaae9('0x11')]==='chat'){_0x3cacb7['ChatWebsiteId']=this[_0xaae9('0x2a')]['id'];}else{_0x3cacb7[_['upperFirst'](this[_0xaae9('0x11')])+_0xaae9('0x2b')]=this[_0xaae9('0x2a')]['id'];}_0x3cacb7[_[_0xaae9('0x2c')](this['channel'])+'InteractionId']=this[_0xaae9('0x17')]['id'];var _0x5ad6f6=this[_0xaae9('0x17')];if(rpc[this['channel']+_0xaae9('0x2d')]){if(this[_0xaae9('0x11')]===_0xaae9('0x12')){_0x3cacb7[_0xaae9('0x2e')]=this[_0xaae9('0x23')][_0xaae9('0x2f')];_0x3cacb7[_0xaae9('0x30')]=''+_[_0xaae9('0x31')](_0x3cacb7[_0xaae9('0x21')],_0xaae9('0x32'),_0xaae9('0x33'))+_0xaae9('0x34');_0x3cacb7['headers']={'Auto-Submitted':_0xaae9('0x35'),'X-Auto-Response-Suppress':_0xaae9('0x36'),'Precedence':_0xaae9('0x37')};return mailRpc[_0xaae9('0x38')](this[_0xaae9('0x2a')][_0xaae9('0x39')],_0x3cacb7)[_0xaae9('0x3a')](function(_0x4aa113){logger['info'](_0xaae9('0x3b'),_0x3aff7d);_0x3cacb7[_0xaae9('0x2f')]=_0x4aa113[_0xaae9('0x23')][_0xaae9('0x2f')];return rpc[_0x5aa036+_0xaae9('0x2d')][_0xaae9('0x3c')](_0x3cacb7);})['then'](function(_0x29505a){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x29505a));})[_0xaae9('0x3e')](function(_0xf02e9d){logger[_0xaae9('0x3f')]('[RPC][%s][AUTOREPLY]\x20%s',_0x3aff7d,JSON['stringify'](_0xf02e9d));})['finally'](function(){Promise[_0xaae9('0x40')]()['then'](function(){if(_0x26350a[0x0]!=='2'||_0x5ad6f6['autoreplyExecuted'])return;return rpc[_0x5aa036+_0xaae9('0x41')][_0xaae9('0x42')](_0x5ad6f6['id'],{'autoreplyExecuted':!![]})[_0xaae9('0x3a')](function(_0x3188d5){logger[_0xaae9('0x13')](_0xaae9('0x1c'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x3188d5));})[_0xaae9('0x3e')](function(_0x74ad16){logger[_0xaae9('0x3f')](_0xaae9('0x43'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x74ad16));});})['then'](function(){_0x555824[_0xaae9('0x1a')]();});});}else{return rpc[this[_0xaae9('0x11')]+_0xaae9('0x2d')][_0xaae9('0x3c')](_0x3cacb7)['then'](function(){logger[_0xaae9('0x13')](_0xaae9('0x14'),_0x3aff7d,_0x3cacb7[_0xaae9('0x21')]);})['catch'](function(_0x116eec){logger[_0xaae9('0x3f')](_0xaae9('0x14'),_0x3aff7d,JSON['stringify'](_0x116eec));})[_0xaae9('0x44')](function(){Promise['resolve']()['then'](function(){if(_0x26350a[0x0]!=='2'||_0x5ad6f6[_0xaae9('0x1b')])return;return rpc[_0x5aa036+'Interaction'][_0xaae9('0x42')](_0x5ad6f6['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3b1659){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3aff7d,JSON['stringify'](_0x3b1659));})[_0xaae9('0x3e')](function(_0x192195){logger[_0xaae9('0x3f')](_0xaae9('0x43'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x192195));});})['then'](function(){_0x555824[_0xaae9('0x1a')]();});});}}}catch(_0x5283df){logger[_0xaae9('0x3f')](_0xaae9('0x14'),_0x3aff7d,JSON[_0xaae9('0x3d')](_0x5283df));_0x555824[_0xaae9('0x45')]();}};}; \ No newline at end of file +var _0x4120=['smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','catch','[RPC][%s][AUTOREPLY]\x20%s','stringify','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','finally','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','Autoreply\x20already\x20sent','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','Re:','chat','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto_reply','sendMailMessage'];(function(_0x1385f0,_0x5550bb){var _0x36ca00=function(_0x1bc769){while(--_0x1bc769){_0x1385f0['push'](_0x1385f0['shift']());}};_0x36ca00(++_0x5550bb);}(_0x4120,0x182));var _0x0412=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4120[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x0412('0x0'));var moment=require(_0x0412('0x1'));var utils=require('./utils');var logger=require(_0x0412('0x2'))(_0x0412('0x3'));var rpc={'chatMessage':require(_0x0412('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0412('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0412('0x6')),'chatInteraction':require(_0x0412('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x0412('0x8')),'smsInteraction':require(_0x0412('0x9')),'faxInteraction':require(_0x0412('0xa')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x0412('0xb')]=function(_0x54dc3c,_0x579fc3,_0x2bd207,_0x46b33e){return function(_0x3bc83c){try{var _0x4c020f=this[_0x0412('0xc')];if(_0x4c020f===_0x0412('0xd')&&_0x46b33e[_0x0412('0xe')]['isAutoreply']){logger[_0x0412('0xf')](_0x0412('0x10'),_0x54dc3c,_0x0412('0x11'));return _0x3bc83c[_0x0412('0x12')]();}if(_0x579fc3[0x0]==='1'&&(_[_0x0412('0x13')](this['interaction']['created'])||!this['interaction'][_0x0412('0x14')])){logger[_0x0412('0xf')]('[%s][AUTOREPLY]\x20%s',_0x54dc3c,_0x0412('0x15'));return _0x3bc83c[_0x0412('0x12')]();}if(_0x579fc3[0x0]==='2'&&this[_0x0412('0x16')][_0x0412('0x17')]){logger[_0x0412('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54dc3c,_0x0412('0x18'));return _0x3bc83c[_0x0412('0x12')]();}var _0x486e9d={'ContactId':this[_0x0412('0x19')]['id'],'sentAt':moment()['format'](_0x0412('0x1a')),'direction':_0x0412('0x1b')};if(this[_0x0412('0xc')]==='mail'){_0x486e9d['body']=utils[_0x0412('0x1c')](_0x579fc3[0x2],this);}else{_0x486e9d[_0x0412('0xe')]=utils['getMustacheRender'](_0x579fc3[0x1],this);}if(this['message']){_0x486e9d['to']=this[_0x0412('0x1d')][_0x0412('0x1e')]||'';if(this[_0x0412('0xc')]==='mail'&&_0x579fc3[0x1]==='1'){_0x486e9d['cc']=this[_0x0412('0x1d')]['cc']||'';}_0x486e9d[_0x0412('0x1e')]=this['message']['to']||'';_0x486e9d[_0x0412('0x1f')]=this['message']['phone']||'';_0x486e9d['read']=!![];if(this[_0x0412('0x1d')][_0x0412('0x20')]){_0x486e9d[_0x0412('0x20')]='';_0x486e9d['subject']+=_['startsWith'](this['message'][_0x0412('0x20')],_0x0412('0x21'))?'':'Re:\x20';_0x486e9d[_0x0412('0x20')]+=this['message'][_0x0412('0x20')];}}if(this[_0x0412('0xc')]===_0x0412('0x22')){_0x486e9d['ChatWebsiteId']=this[_0x0412('0x23')]['id'];}else{_0x486e9d[_[_0x0412('0x24')](this[_0x0412('0xc')])+_0x0412('0x25')]=this[_0x0412('0x23')]['id'];}_0x486e9d[_[_0x0412('0x24')](this[_0x0412('0xc')])+_0x0412('0x26')]=this[_0x0412('0x16')]['id'];var _0x843f6a=this[_0x0412('0x16')];if(rpc[this[_0x0412('0xc')]+_0x0412('0x27')]){if(this['channel']===_0x0412('0xd')){_0x486e9d[_0x0412('0x28')]=this[_0x0412('0x1d')]['messageId'];_0x486e9d[_0x0412('0x29')]=''+_['replace'](_0x486e9d[_0x0412('0xe')],_0x0412('0x2a'),_0x0412('0x2b'))+_0x0412('0x2c');_0x486e9d[_0x0412('0x2d')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x0412('0x2e')};return mailRpc[_0x0412('0x2f')](this[_0x0412('0x23')][_0x0412('0x30')],_0x486e9d)['then'](function(_0x31c401){logger[_0x0412('0xf')](_0x0412('0x31'),_0x54dc3c);_0x486e9d[_0x0412('0x32')]=_0x31c401[_0x0412('0x1d')][_0x0412('0x32')];return rpc[_0x4c020f+'Message']['create'](_0x486e9d);})[_0x0412('0x33')](function(_0x5ce45e){logger['info']('[%s][AUTOREPLY]\x20%s',_0x54dc3c,JSON['stringify'](_0x5ce45e));})[_0x0412('0x34')](function(_0x17be1b){logger['error'](_0x0412('0x35'),_0x54dc3c,JSON[_0x0412('0x36')](_0x17be1b));})['finally'](function(){Promise[_0x0412('0x37')]()['then'](function(){if(_0x579fc3[0x0]!=='2'||_0x843f6a[_0x0412('0x17')])return;return rpc[_0x4c020f+_0x0412('0x38')][_0x0412('0x39')](_0x843f6a['id'],{'autoreplyExecuted':!![]})[_0x0412('0x33')](function(_0x312a7e){logger[_0x0412('0xf')](_0x0412('0x3a'),_0x54dc3c,JSON['stringify'](_0x312a7e));})[_0x0412('0x34')](function(_0x306a87){logger['error'](_0x0412('0x3b'),_0x54dc3c,JSON['stringify'](_0x306a87));});})[_0x0412('0x33')](function(){_0x3bc83c[_0x0412('0x12')]();});});}else{return rpc[this['channel']+_0x0412('0x27')]['create'](_0x486e9d)[_0x0412('0x33')](function(){logger['info'](_0x0412('0x10'),_0x54dc3c,_0x486e9d[_0x0412('0xe')]);})['catch'](function(_0x4a2534){logger[_0x0412('0x3c')](_0x0412('0x10'),_0x54dc3c,JSON[_0x0412('0x36')](_0x4a2534));})[_0x0412('0x3d')](function(){Promise[_0x0412('0x37')]()[_0x0412('0x33')](function(){if(_0x579fc3[0x0]!=='2'||_0x843f6a[_0x0412('0x17')])return;return rpc[_0x4c020f+'Interaction'][_0x0412('0x39')](_0x843f6a['id'],{'autoreplyExecuted':!![]})[_0x0412('0x33')](function(_0x44a2b1){logger[_0x0412('0xf')](_0x0412('0x3a'),_0x54dc3c,JSON[_0x0412('0x36')](_0x44a2b1));})[_0x0412('0x34')](function(_0x20ecd9){logger[_0x0412('0x3c')](_0x0412('0x3b'),_0x54dc3c,JSON[_0x0412('0x36')](_0x20ecd9));});})[_0x0412('0x33')](function(){_0x3bc83c[_0x0412('0x12')]();});});}}}catch(_0x30faef){logger['error'](_0x0412('0x10'),_0x54dc3c,JSON[_0x0412('0x36')](_0x30faef));_0x3bc83c['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 dbc32de..74286c6 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 _0xa92f=['[%s][CLOSE]\x20reason\x20%s','format','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info'];(function(_0x36f0c6,_0x4a0ba8){var _0x5c6f44=function(_0x1ebd76){while(--_0x1ebd76){_0x36f0c6['push'](_0x36f0c6['shift']());}};_0x5c6f44(++_0x4a0ba8);}(_0xa92f,0x140));var _0xfa92=function(_0x46b93b,_0x1a736e){_0x46b93b=_0x46b93b-0x0;var _0x22a8ba=_0xa92f[_0x46b93b];return _0x22a8ba;};'use strict';var moment=require(_0xfa92('0x0'));var logger=require(_0xfa92('0x1'))(_0xfa92('0x2'));var rpc={'chatInteraction':require(_0xfa92('0x3')),'openchannelInteraction':require(_0xfa92('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfa92('0x5')),'faxInteraction':require(_0xfa92('0x6')),'whatsappInteraction':require(_0xfa92('0x7'))};exports[_0xfa92('0x8')]=function(_0x15ab3d,_0xca4c9a,_0xa87060,_0x4ab54f){return function(_0x5f5d38){try{logger[_0xfa92('0x9')](_0xfa92('0xa'),_0x15ab3d,_0xca4c9a[0x0]);var _0x584bac={'closed':0x1,'closedAt':moment()[_0xfa92('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0xca4c9a[0x0]};if(rpc[_0x4ab54f[_0xfa92('0xc')]+'Interaction']){rpc[_0x4ab54f[_0xfa92('0xc')]+_0xfa92('0xd')][_0xfa92('0xe')](_0x4ab54f[_0xfa92('0xf')]['id'],_0x584bac)[_0xfa92('0x10')](function(_0x4afa83){logger[_0xfa92('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x15ab3d,_0x4ab54f[_0xfa92('0xf')]['id']);})[_0xfa92('0x11')](function(_0x46a52e){logger[_0xfa92('0x12')](_0xfa92('0x13'),_0x15ab3d,JSON[_0xfa92('0x14')](_0x46a52e));})['finally'](function(){_0x5f5d38[_0xfa92('0x15')]();});}}catch(_0x5cde98){logger[_0xfa92('0x12')](_0xfa92('0x13'),_0x15ab3d,JSON[_0xfa92('0x14')](_0x5cde98));_0x5f5d38['stop']();}};}; \ No newline at end of file +var _0xcca2=['consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','../../../../config/logger','routing','../../rpc/whatsappInteraction'];(function(_0x5e8584,_0xab5d1f){var _0x500b5a=function(_0x5b4223){while(--_0x5b4223){_0x5e8584['push'](_0x5e8584['shift']());}};_0x500b5a(++_0xab5d1f);}(_0xcca2,0x95));var _0x2cca=function(_0x3b1343,_0xfe4522){_0x3b1343=_0x3b1343-0x0;var _0x799eb6=_0xcca2[_0x3b1343];return _0x799eb6;};'use strict';var moment=require('moment');var logger=require(_0x2cca('0x0'))(_0x2cca('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2cca('0x2'))};exports[_0x2cca('0x3')]=function(_0x5cb519,_0x52c5a1,_0xdcba5c,_0x1d7df3){return function(_0x3e592a){try{logger[_0x2cca('0x4')]('[%s][CLOSE]\x20reason\x20%s',_0x5cb519,_0x52c5a1[0x0]);var _0x34fa07={'closed':0x1,'closedAt':moment()[_0x2cca('0x5')](_0x2cca('0x6')),'closeReason':_0x2cca('0x7'),'disposition':_0x52c5a1[0x0]};if(rpc[_0x1d7df3['channel']+_0x2cca('0x8')]){rpc[_0x1d7df3[_0x2cca('0x9')]+'Interaction'][_0x2cca('0xa')](_0x1d7df3[_0x2cca('0xb')]['id'],_0x34fa07)[_0x2cca('0xc')](function(_0x560788){logger[_0x2cca('0x4')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5cb519,_0x1d7df3[_0x2cca('0xb')]['id']);})[_0x2cca('0xd')](function(_0x5b15a5){logger[_0x2cca('0xe')](_0x2cca('0xf'),_0x5cb519,JSON['stringify'](_0x5b15a5));})[_0x2cca('0x10')](function(){_0x3e592a[_0x2cca('0x11')]();});}}catch(_0x2fa2bb){logger[_0x2cca('0xe')](_0x2cca('0xf'),_0x5cb519,JSON[_0x2cca('0x12')](_0x2fa2bb));_0x3e592a[_0x2cca('0x11')]();}};}; \ 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 482efaa..f8671af 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 _0x18af=['result','fulfillment','speech','dialogflow','providerResponse','create','catch','lodash','apiai-promise','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','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','whatsapp','phone','chat','account','AccountId','InteractionId','created','body','getMustacheRender','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message'];(function(_0x3dd7ad,_0xc96b15){var _0x6c72d8=function(_0x5ccd3a){while(--_0x5ccd3a){_0x3dd7ad['push'](_0x3dd7ad['shift']());}};_0x6c72d8(++_0xc96b15);}(_0x18af,0x8b));var _0xf18a=function(_0x5a0797,_0x17b0f5){_0x5a0797=_0x5a0797-0x0;var _0x3e8fee=_0x18af[_0x5a0797];return _0x3e8fee;};'use strict';var _=require(_0xf18a('0x0'));var moment=require('moment');var apiai=require(_0xf18a('0x1'));var md5=require('md5');var utils=require(_0xf18a('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf18a('0x3')),'mailMessage':require(_0xf18a('0x4')),'smsMessage':require(_0xf18a('0x5')),'faxMessage':require(_0xf18a('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf18a('0x7')]=function(_0x2d5955,_0x3fc64b){return function(_0x4dc297){try{if(!_[_0xf18a('0x8')](this[_0xf18a('0x9')][_0xf18a('0xa')])){logger[_0xf18a('0xb')](_0xf18a('0xc'),_0x2d5955,_0xf18a('0xd'));return _0x4dc297[_0xf18a('0xe')]();}var _0x20247d={'ContactId':this[_0xf18a('0xf')]['id'],'sentAt':moment()[_0xf18a('0x10')](_0xf18a('0x11')),'direction':_0xf18a('0x12')};if(this[_0xf18a('0x13')]==='sms'||this[_0xf18a('0x13')]===_0xf18a('0x14')){_0x20247d[_0xf18a('0x15')]=this[_0xf18a('0x9')][_0xf18a('0x15')];}var _0x4e9ee9=this[_0xf18a('0x13')];if(_0x4e9ee9===_0xf18a('0x16')){_0x20247d['ChatWebsiteId']=this[_0xf18a('0x17')]['id'];}else{_0x20247d[_['upperFirst'](_0x4e9ee9)+_0xf18a('0x18')]=this[_0xf18a('0x17')]['id'];}_0x20247d[_['upperFirst'](_0x4e9ee9)+_0xf18a('0x19')]=this['interaction']['id'];if(this[_0xf18a('0x9')][_0xf18a('0x1a')]){var _0x52fcfa=_0x3fc64b[0x2];if(!_['isEmpty'](_0x52fcfa)){_0x20247d[_0xf18a('0x1b')]=utils[_0xf18a('0x1c')](_0x52fcfa,this);return rpc[_0x4e9ee9+'Message']['create'](_0x20247d)[_0xf18a('0x1d')](function(_0x1aff7c){logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x20247d[_0xf18a('0x1b')]);})['catch'](function(_0x305b74){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,JSON[_0xf18a('0x1f')](_0x305b74));})[_0xf18a('0x20')](function(){logger['info'](_0xf18a('0x21'),_0x2d5955);_0x4dc297[_0xf18a('0x22')]();});}else{logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2d5955);_0x4dc297['stop']();}}else{var _0x43a50a=this;var _0x4438ed=apiai(_0x3fc64b[0x0],{'language':_0x3fc64b[0x1]||'en'});return _0x4438ed[_0xf18a('0x23')](this[_0xf18a('0x24')][_0xf18a('0x1b')],{'sessionId':md5(this[_0xf18a('0x9')]['id'])})[_0xf18a('0x1d')](function(_0x304bd4){_0x43a50a[_0xf18a('0x1b')]['dialogflow']=_0x304bd4;_0x20247d[_0xf18a('0x1b')]=_0x304bd4[_0xf18a('0x25')][_0xf18a('0x26')][_0xf18a('0x27')];_0x20247d['providerName']=_0xf18a('0x28');_0x20247d[_0xf18a('0x29')]=JSON[_0xf18a('0x1f')](_0x304bd4);return rpc[_0x4e9ee9+'Message'][_0xf18a('0x2a')](_0x20247d)[_0xf18a('0x1d')](function(_0xf7e6c2){logger[_0xf18a('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x20247d[_0xf18a('0x1b')]);if(_0x304bd4[_0xf18a('0x25')]['metadata']['endConversation']){_0x4dc297[_0xf18a('0xe')]();}else{_0x4dc297[_0xf18a('0x22')]();}})[_0xf18a('0x2b')](function(_0xdc0fe9){logger['error'](_0xf18a('0xc'),_0x2d5955,JSON[_0xf18a('0x1f')](_0xdc0fe9));_0x4dc297[_0xf18a('0xe')]();});})[_0xf18a('0x2b')](function(_0x3a9b89){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,_0x3a9b89['message']);_0x4dc297[_0xf18a('0xe')]();});}}catch(_0x3ea07a){logger[_0xf18a('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x2d5955,JSON['stringify'](_0x3ea07a));_0x4dc297[_0xf18a('0x22')]();}};}; \ No newline at end of file +var _0xfd50=['contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','metadata','message','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0xe12f2c,_0x1972fb){var _0x51ae49=function(_0x248be6){while(--_0x248be6){_0xe12f2c['push'](_0xe12f2c['shift']());}};_0x51ae49(++_0x1972fb);}(_0xfd50,0x178));var _0x0fd5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfd50[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var moment=require(_0x0fd5('0x0'));var apiai=require(_0x0fd5('0x1'));var md5=require(_0x0fd5('0x2'));var utils=require(_0x0fd5('0x3'));var logger=require(_0x0fd5('0x4'))('routing');var rpc={'chatMessage':require(_0x0fd5('0x5')),'openchannelMessage':require(_0x0fd5('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0fd5('0x7')),'whatsappMessage':require(_0x0fd5('0x8'))};exports[_0x0fd5('0x9')]=function(_0x24319e,_0x50c54f){return function(_0x1baf7){try{if(!_[_0x0fd5('0xa')](this['interaction'][_0x0fd5('0xb')])){logger[_0x0fd5('0xc')](_0x0fd5('0xd'),_0x24319e,_0x0fd5('0xe'));return _0x1baf7[_0x0fd5('0xf')]();}var _0x1dfd3f={'ContactId':this[_0x0fd5('0x10')]['id'],'sentAt':moment()['format'](_0x0fd5('0x11')),'direction':_0x0fd5('0x12')};if(this['channel']===_0x0fd5('0x13')||this[_0x0fd5('0x14')]===_0x0fd5('0x15')){_0x1dfd3f[_0x0fd5('0x16')]=this[_0x0fd5('0x17')][_0x0fd5('0x16')];}var _0x2b3251=this['channel'];if(_0x2b3251==='chat'){_0x1dfd3f[_0x0fd5('0x18')]=this['account']['id'];}else{_0x1dfd3f[_[_0x0fd5('0x19')](_0x2b3251)+_0x0fd5('0x1a')]=this[_0x0fd5('0x1b')]['id'];}_0x1dfd3f[_[_0x0fd5('0x19')](_0x2b3251)+_0x0fd5('0x1c')]=this['interaction']['id'];if(this[_0x0fd5('0x17')][_0x0fd5('0x1d')]){var _0x2721d9=_0x50c54f[0x2];if(!_[_0x0fd5('0x1e')](_0x2721d9)){_0x1dfd3f[_0x0fd5('0x1f')]=utils[_0x0fd5('0x20')](_0x2721d9,this);return rpc[_0x2b3251+'Message'][_0x0fd5('0x21')](_0x1dfd3f)[_0x0fd5('0x22')](function(_0x3f1843){logger[_0x0fd5('0xc')](_0x0fd5('0xd'),_0x24319e,_0x1dfd3f['body']);})[_0x0fd5('0x23')](function(_0x202cbf){logger[_0x0fd5('0x24')](_0x0fd5('0xd'),_0x24319e,JSON[_0x0fd5('0x25')](_0x202cbf));})['finally'](function(){logger[_0x0fd5('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x24319e);_0x1baf7[_0x0fd5('0x26')]();});}else{logger[_0x0fd5('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x24319e);_0x1baf7[_0x0fd5('0x26')]();}}else{var _0xf5cefa=this;var _0x349fda=apiai(_0x50c54f[0x0],{'language':_0x50c54f[0x1]||'en'});return _0x349fda[_0x0fd5('0x27')](this['message'][_0x0fd5('0x1f')],{'sessionId':md5(this[_0x0fd5('0x17')]['id'])})[_0x0fd5('0x22')](function(_0x236e1e){_0xf5cefa['body'][_0x0fd5('0x28')]=_0x236e1e;_0x1dfd3f[_0x0fd5('0x1f')]=_0x236e1e[_0x0fd5('0x29')][_0x0fd5('0x2a')][_0x0fd5('0x2b')];_0x1dfd3f[_0x0fd5('0x2c')]=_0x0fd5('0x28');_0x1dfd3f[_0x0fd5('0x2d')]=JSON[_0x0fd5('0x25')](_0x236e1e);return rpc[_0x2b3251+_0x0fd5('0x2e')][_0x0fd5('0x21')](_0x1dfd3f)[_0x0fd5('0x22')](function(_0x2596d7){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x24319e,_0x1dfd3f['body']);if(_0x236e1e[_0x0fd5('0x29')][_0x0fd5('0x2f')]['endConversation']){_0x1baf7[_0x0fd5('0xf')]();}else{_0x1baf7[_0x0fd5('0x26')]();}})[_0x0fd5('0x23')](function(_0x79a5a){logger['error'](_0x0fd5('0xd'),_0x24319e,JSON[_0x0fd5('0x25')](_0x79a5a));_0x1baf7[_0x0fd5('0xf')]();});})['catch'](function(_0x3e41d4){logger[_0x0fd5('0x24')](_0x0fd5('0xd'),_0x24319e,_0x3e41d4[_0x0fd5('0x30')]);_0x1baf7[_0x0fd5('0xf')]();});}}catch(_0x50d329){logger[_0x0fd5('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x24319e,JSON['stringify'](_0x50d329));_0x1baf7[_0x0fd5('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index d4954a2..1bbd829 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 _0x0cc2=['isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','push','fulfillmentText','message','lodash','dialogflow','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','clone','body','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','info','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','length','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName'];(function(_0x2dc520,_0x562e06){var _0x4e3c28=function(_0x1610d7){while(--_0x1610d7){_0x2dc520['push'](_0x2dc520['shift']());}};_0x4e3c28(++_0x562e06);}(_0x0cc2,0x87));var _0x20cc=function(_0x3aa7e6,_0x3fe287){_0x3aa7e6=_0x3aa7e6-0x0;var _0x1680fc=_0x0cc2[_0x3aa7e6];return _0x1680fc;};'use strict';var _=require(_0x20cc('0x0'));var dialogflow=require(_0x20cc('0x1'));var md5=require('md5');var moment=require(_0x20cc('0x2'));var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x20cc('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x20cc('0x4')),'openchannelMessage':require(_0x20cc('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x42479c,_0x5c9ae4,_0x3c8798,_0x47e077){return new Promise(function(_0x270628,_0x292097){var _0x28bd82=_[_0x20cc('0x6')](_0x3c8798);_0x28bd82[_0x20cc('0x7')]=_0x47e077;return rpc[_0x5c9ae4+'Message']['create'](_0x28bd82)[_0x20cc('0x8')](function(){logger['info'](_0x20cc('0x9'),_0x42479c,_0x28bd82['body']);_0x270628();})[_0x20cc('0xa')](function(_0x4c5549){logger[_0x20cc('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x42479c,JSON[_0x20cc('0xc')](_0x4c5549));_0x292097(_0x4c5549);});});}exports[_0x20cc('0xd')]=function(_0x493a85,_0x27e189){return function(_0x411e06){try{if(!_[_0x20cc('0xe')](this[_0x20cc('0xf')][_0x20cc('0x10')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x493a85,_0x20cc('0x11'));return _0x411e06[_0x20cc('0x12')]();}var _0x452bdd={'ContactId':this[_0x20cc('0x13')]['id'],'sentAt':moment()[_0x20cc('0x14')](_0x20cc('0x15')),'direction':'out'};if(this[_0x20cc('0x16')]===_0x20cc('0x17')||this['channel']===_0x20cc('0x18')){_0x452bdd[_0x20cc('0x19')]=this[_0x20cc('0xf')][_0x20cc('0x19')];}var _0x455fe8=this['channel'];if(_0x455fe8==='chat'){_0x452bdd[_0x20cc('0x1a')]=this[_0x20cc('0x1b')]['id'];}else{_0x452bdd[_['upperFirst'](_0x455fe8)+'AccountId']=this[_0x20cc('0x1b')]['id'];}_0x452bdd[_[_0x20cc('0x1c')](_0x455fe8)+_0x20cc('0x1d')]=this[_0x20cc('0xf')]['id'];if(this[_0x20cc('0xf')]['created']){var _0x44253a=_0x27e189[0x4];if(!_[_0x20cc('0x1e')](_0x44253a)){_0x452bdd[_0x20cc('0x7')]=utils[_0x20cc('0x1f')](_0x44253a,this);return rpc[_0x455fe8+_0x20cc('0x20')][_0x20cc('0x21')](_0x452bdd)['then'](function(_0x21399e){logger[_0x20cc('0x22')](_0x20cc('0x9'),_0x493a85,_0x452bdd[_0x20cc('0x7')]);})[_0x20cc('0xa')](function(_0x1861ba){logger[_0x20cc('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x493a85,JSON[_0x20cc('0xc')](_0x1861ba));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x493a85);_0x411e06[_0x20cc('0x23')]();});}else{logger[_0x20cc('0x22')](_0x20cc('0x24'),_0x493a85);_0x411e06[_0x20cc('0x23')]();}}else{var _0x465d35=this;var _0xc8aee2=_0x27e189[0x2]['replace'](/\\n/g,'\x0a');var _0x38b116={'credentials':{'private_key':_0xc8aee2,'client_email':_0x27e189[0x1]}};var _0x1f23b9=new dialogflow[(_0x20cc('0x25'))](_0x38b116);var _0x43fd04=_0x1f23b9['sessionPath'](_0x27e189[0x0],md5(_0x465d35[_0x20cc('0xf')]['id']));var _0x4231f6={'session':_0x43fd04,'queryInput':{'text':{'text':_0x465d35['message'][_0x20cc('0x7')],'languageCode':_0x27e189[0x3]||'en'}}};return _0x1f23b9['detectIntent'](_0x4231f6)[_0x20cc('0x8')](function(_0x3cb8ff){if(_0x3cb8ff&&_0x3cb8ff[_0x20cc('0x26')]){_0x465d35[_0x20cc('0x7')]['dialogflowV2']=_0x3cb8ff;var _0x3476bf=_0x3cb8ff[0x0];var _0xf8439e=_0x3476bf['queryResult']['diagnosticInfo']&&_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')]['fields']?_0x3476bf['queryResult'][_0x20cc('0x28')][_0x20cc('0x29')]['end_conversation'][_0x20cc('0x2a')]:![];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2b')]=_0x3476bf['queryResult'][_0x20cc('0x2c')];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2d')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x2e')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')]&&_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')][_0x20cc('0x29')]?_0x3476bf[_0x20cc('0x27')][_0x20cc('0x28')][_0x20cc('0x29')]['end_conversation'][_0x20cc('0x2a')]:![];_0x465d35[_0x20cc('0x7')][_0x20cc('0x2f')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x30')]['name'];_0x465d35[_0x20cc('0x7')][_0x20cc('0x31')]=_0x3476bf['queryResult'][_0x20cc('0x30')][_0x20cc('0x32')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x30')][_0x20cc('0x33')];_0x465d35[_0x20cc('0x7')][_0x20cc('0x34')]=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x35')];_0x465d35[_0x20cc('0x7')]['DIALOGFLOWV2_QUERYTEXT']=_0x3476bf[_0x20cc('0x27')][_0x20cc('0x36')];_0x465d35['body'][_0x20cc('0x37')]=_0x3476bf['queryResult']['intentDetectionConfidence'];_0x452bdd[_0x20cc('0x38')]=_0x20cc('0x39');_0x452bdd[_0x20cc('0x3a')]=JSON[_0x20cc('0xc')](_0x3cb8ff);var _0x26d419=[];for(var _0x1b69e4=0x0;_0x1b69e4<_0x3cb8ff[_0x20cc('0x26')];_0x1b69e4++){var _0x277bad=_0x3cb8ff[_0x1b69e4];if(_0x277bad&&_0x277bad[_0x20cc('0x27')]&&_0x277bad[_0x20cc('0x27')]['fulfillmentText']){_0x26d419[_0x20cc('0x3b')](createMessage(_0x493a85,_0x455fe8,_0x452bdd,_0x277bad[_0x20cc('0x27')][_0x20cc('0x3c')]));}}return Promise['all'](_0x26d419)[_0x20cc('0x8')](function(){if(_0xf8439e){_0x411e06[_0x20cc('0x12')]();}else{_0x411e06[_0x20cc('0x23')]();}})[_0x20cc('0xa')](function(_0x56bda5){logger[_0x20cc('0xb')](_0x20cc('0x9'),_0x493a85,JSON['stringify'](_0x56bda5));_0x411e06[_0x20cc('0x12')]();});}})[_0x20cc('0xa')](function(_0x19a0c9){logger['error'](_0x20cc('0x9'),_0x493a85,_0x19a0c9[_0x20cc('0x3d')]);_0x411e06[_0x20cc('0x12')]();});}}catch(_0x58ffdf){logger['error'](_0x20cc('0x9'),_0x493a85,JSON['stringify'](_0x58ffdf));_0x411e06['stop']();}};}; \ No newline at end of file +var _0x5de0=['ChatWebsiteId','account','upperFirst','created','isEmpty','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','push','all','catch','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','clone','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','consequence','isNil','interaction','UserId','info','next','format','out','sms','channel','whatsapp','phone','chat'];(function(_0x55fd76,_0x45cb0f){var _0x340fc0=function(_0x92b573){while(--_0x92b573){_0x55fd76['push'](_0x55fd76['shift']());}};_0x340fc0(++_0x45cb0f);}(_0x5de0,0xb7));var _0x05de=function(_0x347925,_0xc3d077){_0x347925=_0x347925-0x0;var _0x48a647=_0x5de0[_0x347925];return _0x48a647;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x05de('0x0'));var Promise=require(_0x05de('0x1'));var logger=require(_0x05de('0x2'))(_0x05de('0x3'));var utils=require(_0x05de('0x4'));var rpc={'chatMessage':require(_0x05de('0x5')),'openchannelMessage':require(_0x05de('0x6')),'mailMessage':require(_0x05de('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x05de('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1ccc4c,_0x46949b,_0x47d9a1,_0x52e36d){return new Promise(function(_0x267fd5,_0x1d425b){var _0x38a0de=_[_0x05de('0x9')](_0x47d9a1);_0x38a0de['body']=_0x52e36d;return rpc[_0x46949b+_0x05de('0xa')][_0x05de('0xb')](_0x38a0de)[_0x05de('0xc')](function(){logger['info'](_0x05de('0xd'),_0x1ccc4c,_0x38a0de[_0x05de('0xe')]);_0x267fd5();})['catch'](function(_0xf77dfc){logger[_0x05de('0xf')](_0x05de('0xd'),_0x1ccc4c,JSON[_0x05de('0x10')](_0xf77dfc));_0x1d425b(_0xf77dfc);});});}exports[_0x05de('0x11')]=function(_0x4392e1,_0x9fdc31){return function(_0x591ff9){try{if(!_[_0x05de('0x12')](this[_0x05de('0x13')][_0x05de('0x14')])){logger[_0x05de('0x15')](_0x05de('0xd'),_0x4392e1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x591ff9[_0x05de('0x16')]();}var _0x51affe={'ContactId':this['contact']['id'],'sentAt':moment()[_0x05de('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x05de('0x18')};if(this['channel']===_0x05de('0x19')||this[_0x05de('0x1a')]===_0x05de('0x1b')){_0x51affe[_0x05de('0x1c')]=this['interaction'][_0x05de('0x1c')];}var _0x58312d=this[_0x05de('0x1a')];if(_0x58312d===_0x05de('0x1d')){_0x51affe[_0x05de('0x1e')]=this[_0x05de('0x1f')]['id'];}else{_0x51affe[_['upperFirst'](_0x58312d)+'AccountId']=this[_0x05de('0x1f')]['id'];}_0x51affe[_[_0x05de('0x20')](_0x58312d)+'InteractionId']=this[_0x05de('0x13')]['id'];if(this[_0x05de('0x13')][_0x05de('0x21')]){var _0x413b2c=_0x9fdc31[0x4];if(!_[_0x05de('0x22')](_0x413b2c)){_0x51affe[_0x05de('0xe')]=utils['getMustacheRender'](_0x413b2c,this);return rpc[_0x58312d+_0x05de('0xa')][_0x05de('0xb')](_0x51affe)[_0x05de('0xc')](function(_0x28bc20){logger[_0x05de('0x15')](_0x05de('0xd'),_0x4392e1,_0x51affe[_0x05de('0xe')]);})['catch'](function(_0x3ed166){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4392e1,JSON[_0x05de('0x10')](_0x3ed166));})[_0x05de('0x23')](function(){logger[_0x05de('0x15')](_0x05de('0x24'),_0x4392e1);_0x591ff9[_0x05de('0x25')]();});}else{logger['info'](_0x05de('0x26'),_0x4392e1);_0x591ff9[_0x05de('0x25')]();}}else{var _0x1ad6c1=this;var _0x2d3f77=_0x9fdc31[0x2][_0x05de('0x27')](/\\n/g,'\x0a');var _0xf7ac9e={'credentials':{'private_key':_0x2d3f77,'client_email':_0x9fdc31[0x1]}};var _0x3d3910=new dialogflow[(_0x05de('0x28'))](_0xf7ac9e);var _0x292ab4=_0x3d3910[_0x05de('0x29')](_0x9fdc31[0x0],md5(_0x1ad6c1[_0x05de('0x13')]['id']));var _0x2089d7={'session':_0x292ab4,'queryInput':{'text':{'text':_0x1ad6c1[_0x05de('0x2a')]['body'],'languageCode':_0x9fdc31[0x3]||'en'}}};return _0x3d3910[_0x05de('0x2b')](_0x2089d7)[_0x05de('0xc')](function(_0x1105f8){if(_0x1105f8&&_0x1105f8['length']){_0x1ad6c1[_0x05de('0xe')][_0x05de('0x2c')]=_0x1105f8;var _0x30537d=_0x1105f8[0x0];var _0x16dd94=_0x30537d[_0x05de('0x2d')][_0x05de('0x2e')]&&_0x30537d['queryResult']['diagnosticInfo']['fields']?_0x30537d['queryResult']['diagnosticInfo'][_0x05de('0x2f')][_0x05de('0x30')][_0x05de('0x31')]:![];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x32')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x33')];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x34')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x35')];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x36')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x2e')]&&_0x30537d[_0x05de('0x2d')]['diagnosticInfo']['fields']?_0x30537d['queryResult'][_0x05de('0x2e')][_0x05de('0x2f')][_0x05de('0x30')][_0x05de('0x31')]:![];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x37')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x38')][_0x05de('0x39')];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x3a')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x38')]['displayName'];_0x1ad6c1[_0x05de('0xe')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x30537d[_0x05de('0x2d')][_0x05de('0x38')][_0x05de('0x3b')];_0x1ad6c1[_0x05de('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x30537d[_0x05de('0x2d')][_0x05de('0x3c')];_0x1ad6c1[_0x05de('0xe')][_0x05de('0x3d')]=_0x30537d[_0x05de('0x2d')][_0x05de('0x3e')];_0x1ad6c1['body']['DIALOGFLOWV2_SCORE']=_0x30537d[_0x05de('0x2d')][_0x05de('0x3f')];_0x51affe[_0x05de('0x40')]=_0x05de('0x2c');_0x51affe[_0x05de('0x41')]=JSON[_0x05de('0x10')](_0x1105f8);var _0x539f14=[];for(var _0x46f6ab=0x0;_0x46f6ab<_0x1105f8[_0x05de('0x42')];_0x46f6ab++){var _0x108dd6=_0x1105f8[_0x46f6ab];if(_0x108dd6&&_0x108dd6[_0x05de('0x2d')]&&_0x108dd6['queryResult'][_0x05de('0x43')]){_0x539f14[_0x05de('0x44')](createMessage(_0x4392e1,_0x58312d,_0x51affe,_0x108dd6[_0x05de('0x2d')][_0x05de('0x43')]));}}return Promise[_0x05de('0x45')](_0x539f14)[_0x05de('0xc')](function(){if(_0x16dd94){_0x591ff9[_0x05de('0x16')]();}else{_0x591ff9[_0x05de('0x25')]();}})[_0x05de('0x46')](function(_0x4cf27b){logger[_0x05de('0xf')](_0x05de('0xd'),_0x4392e1,JSON[_0x05de('0x10')](_0x4cf27b));_0x591ff9['next']();});}})[_0x05de('0x46')](function(_0x48ff58){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4392e1,_0x48ff58[_0x05de('0x2a')]);_0x591ff9[_0x05de('0x16')]();});}}catch(_0x1e8dec){logger['error'](_0x05de('0xd'),_0x4392e1,JSON['stringify'](_0x1e8dec));_0x591ff9[_0x05de('0x25')]();}};}; \ 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 2db7c6c..dbcf8dc 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 _0xd404=['priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20eval\x20error:\x20%s','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop'];(function(_0x13dcc3,_0x1565c6){var _0xe53a94=function(_0xa86700){while(--_0xa86700){_0x13dcc3['push'](_0x13dcc3['shift']());}};_0xe53a94(++_0x1565c6);}(_0xd404,0x148));var _0x4d40=function(_0x5714be,_0x13fed0){_0x5714be=_0x5714be-0x0;var _0x341da2=_0xd404[_0x5714be];return _0x341da2;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x4d40('0x0'));var utils=require(_0x4d40('0x1'));var logger=require(_0x4d40('0x2'))(_0x4d40('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x4d40('0x4')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4d40('0x5'),'message':_0x4d40('0x6')}});exports['consequence']=function(_0x20467a,_0x42e6ea){return function(_0x1be996){try{var _0x38bda5={'condition':htmlToText[_0x4d40('0x7')](utils['getMustacheRender'](_0x42e6ea[0x0],this),{'wordwrap':![]})[_0x4d40('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x42e6ea[0x1],'priorityFalse':_0x42e6ea[0x2]};var _0x11bdb5=gotoif[_0x4d40('0x9')](_0x38bda5,{'typecast':!![]});if(_0x11bdb5[_0x4d40('0xa')]){logger[_0x4d40('0xb')](_0x4d40('0xc'),_0x20467a,_[_0x4d40('0xd')](_0x11bdb5,_0x4d40('0xe'))[_0x4d40('0xf')](',\x20'));_0x1be996[_0x4d40('0x10')]();}else{try{var _0xfb7228=eval('('+_0x38bda5['condition']+')');var _0x18cf71=_0xfb7228?_0x38bda5[_0x4d40('0x11')]:_0x38bda5[_0x4d40('0x12')];logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x20467a,_0x38bda5['condition'],_0xfb7228,_0x18cf71||_0x4d40('0x14'));if(_0x18cf71){var _0x4d9fa1=_['findIndex'](_0x1be996[_0x4d40('0x15')](),{'p':_0x18cf71});if(_0x4d9fa1>=0x0){logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x20467a,_0x18cf71||_0x4d40('0x14'),_0x4d9fa1);_0x1be996[_0x4d40('0x14')](_0x4d9fa1);}else{logger[_0x4d40('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x20467a,_0x18cf71||_0x4d40('0x14'));_0x1be996[_0x4d40('0x10')]();}}else{_0x1be996['next']();}}catch(_0x383fb4){logger[_0x4d40('0xb')](_0x4d40('0x16'),_0x20467a,_0x383fb4[_0x4d40('0xe')]);_0x1be996[_0x4d40('0x10')]();}}}catch(_0x513607){logger[_0x4d40('0xb')](_0x4d40('0xc'),_0x20467a,JSON['stringify'](_0x513607));_0x1be996['stop']();}};}; \ No newline at end of file +var _0x5496=['[%s][GOTOIF]\x20%s','map','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length','error'];(function(_0x3f7643,_0x279cd9){var _0x546a6c=function(_0x394e52){while(--_0x394e52){_0x3f7643['push'](_0x3f7643['shift']());}};_0x546a6c(++_0x279cd9);}(_0x5496,0xa3));var _0x6549=function(_0x10486e,_0x49ff50){_0x10486e=_0x10486e-0x0;var _0x309c03=_0x5496[_0x10486e];return _0x309c03;};'use strict';var schema=require('validate');var _=require(_0x6549('0x0'));var htmlToText=require(_0x6549('0x1'));var utils=require(_0x6549('0x2'));var logger=require(_0x6549('0x3'))(_0x6549('0x4'));var gotoif=schema({'condition':{'type':_0x6549('0x5'),'required':!![],'message':_0x6549('0x6')},'priorityTrue':{'type':_0x6549('0x7'),'message':_0x6549('0x8')},'priorityFalse':{'type':'number','message':_0x6549('0x9')}});exports[_0x6549('0xa')]=function(_0x8655e9,_0x5299a5){return function(_0x2825cc){try{var _0xb2f5da={'condition':htmlToText[_0x6549('0xb')](utils[_0x6549('0xc')](_0x5299a5[0x0],this),{'wordwrap':![]})[_0x6549('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5299a5[0x1],'priorityFalse':_0x5299a5[0x2]};var _0x4c9fdc=gotoif[_0x6549('0xe')](_0xb2f5da,{'typecast':!![]});if(_0x4c9fdc[_0x6549('0xf')]){logger[_0x6549('0x10')](_0x6549('0x11'),_0x8655e9,_[_0x6549('0x12')](_0x4c9fdc,'message')['join'](',\x20'));_0x2825cc['stop']();}else{try{var _0x268f99=eval('('+_0xb2f5da[_0x6549('0x13')]+')');var _0x12487b=_0x268f99?_0xb2f5da['priorityTrue']:_0xb2f5da[_0x6549('0x14')];logger['info'](_0x6549('0x15'),_0x8655e9,_0xb2f5da[_0x6549('0x13')],_0x268f99,_0x12487b||_0x6549('0x16'));if(_0x12487b){var _0x30111e=_[_0x6549('0x17')](_0x2825cc[_0x6549('0x18')](),{'p':_0x12487b});if(_0x30111e>=0x0){logger[_0x6549('0x19')](_0x6549('0x1a'),_0x8655e9,_0x12487b||_0x6549('0x16'),_0x30111e);_0x2825cc[_0x6549('0x16')](_0x30111e);}else{logger[_0x6549('0x19')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x8655e9,_0x12487b||_0x6549('0x16'));_0x2825cc[_0x6549('0x1b')]();}}else{_0x2825cc[_0x6549('0x16')]();}}catch(_0x4eb501){logger[_0x6549('0x10')](_0x6549('0x1c'),_0x8655e9,_0x4eb501['message']);_0x2825cc[_0x6549('0x1b')]();}}}catch(_0xb0a1d1){logger[_0x6549('0x10')](_0x6549('0x11'),_0x8655e9,JSON[_0x6549('0x1d')](_0xb0a1d1));_0x2825cc[_0x6549('0x1b')]();}};}; \ 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 067dcf5..acf963b 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 _0xfdc7=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','join','stop'];(function(_0x4772bd,_0x255ff6){var _0x386a8e=function(_0x5034ce){while(--_0x5034ce){_0x4772bd['push'](_0x4772bd['shift']());}};_0x386a8e(++_0x255ff6);}(_0xfdc7,0x182));var _0x7fdc=function(_0x12c076,_0x5bef17){_0x12c076=_0x12c076-0x0;var _0x2ddd18=_0xfdc7[_0x12c076];return _0x2ddd18;};'use strict';var schema=require(_0x7fdc('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x7fdc('0x1'));var gotop=schema({'priority':{'type':_0x7fdc('0x2'),'required':!![],'message':_0x7fdc('0x3')}});exports['consequence']=function(_0x99529a,_0x39de40){return function(_0x15c309){try{var _0x11ad24={'priority':_0x39de40[0x0]};var _0x5ca57a=gotop['validate'](_0x11ad24,{'typecast':!![]});if(_0x5ca57a[_0x7fdc('0x4')]){logger[_0x7fdc('0x5')](_0x7fdc('0x6'),_0x99529a,_[_0x7fdc('0x7')](_0x5ca57a,'message')[_0x7fdc('0x8')](',\x20'));_0x15c309[_0x7fdc('0x9')]();}else{logger[_0x7fdc('0xa')](_0x7fdc('0xb'),_0x99529a,_0x11ad24['priority']);if(_0x11ad24[_0x7fdc('0xc')]){var _0x2d1b6d=_[_0x7fdc('0xd')](_0x15c309[_0x7fdc('0xe')](),{'p':_0x11ad24[_0x7fdc('0xc')]});if(_0x2d1b6d>=0x0){logger[_0x7fdc('0xa')](_0x7fdc('0xf'),_0x99529a,_0x11ad24[_0x7fdc('0xc')]||_0x7fdc('0x10'),_0x2d1b6d);_0x15c309[_0x7fdc('0x10')](_0x2d1b6d);}else{logger[_0x7fdc('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x99529a,_0x11ad24[_0x7fdc('0xc')]||_0x7fdc('0x10'));_0x15c309['stop']();}}else{_0x15c309[_0x7fdc('0x10')]();}}}catch(_0x593bb6){logger[_0x7fdc('0x5')](_0x7fdc('0x6'),_0x99529a,JSON[_0x7fdc('0x11')](_0x593bb6));_0x15c309[_0x7fdc('0x9')]();}};}; \ No newline at end of file +var _0xea05=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][GOTOP]\x20%s','map','message','join','stop','info'];(function(_0x38c371,_0x59c0ce){var _0x1cdf30=function(_0x408e44){while(--_0x408e44){_0x38c371['push'](_0x38c371['shift']());}};_0x1cdf30(++_0x59c0ce);}(_0xea05,0x79));var _0x5ea0=function(_0xe3a165,_0x4962ff){_0xe3a165=_0xe3a165-0x0;var _0x174e4c=_0xea05[_0xe3a165];return _0x174e4c;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x5ea0('0x0'))(_0x5ea0('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5ea0('0x2')}});exports[_0x5ea0('0x3')]=function(_0x3a8732,_0x1ae353){return function(_0x434736){try{var _0x5da4c5={'priority':_0x1ae353[0x0]};var _0x2b0380=gotop[_0x5ea0('0x4')](_0x5da4c5,{'typecast':!![]});if(_0x2b0380['length']){logger[_0x5ea0('0x5')](_0x5ea0('0x6'),_0x3a8732,_[_0x5ea0('0x7')](_0x2b0380,_0x5ea0('0x8'))[_0x5ea0('0x9')](',\x20'));_0x434736[_0x5ea0('0xa')]();}else{logger[_0x5ea0('0xb')](_0x5ea0('0xc'),_0x3a8732,_0x5da4c5['priority']);if(_0x5da4c5[_0x5ea0('0xd')]){var _0x4e009b=_[_0x5ea0('0xe')](_0x434736['rules'](),{'p':_0x5da4c5['priority']});if(_0x4e009b>=0x0){logger['info'](_0x5ea0('0xf'),_0x3a8732,_0x5da4c5[_0x5ea0('0xd')]||_0x5ea0('0x10'),_0x4e009b);_0x434736['next'](_0x4e009b);}else{logger[_0x5ea0('0xb')](_0x5ea0('0x11'),_0x3a8732,_0x5da4c5[_0x5ea0('0xd')]||_0x5ea0('0x10'));_0x434736['stop']();}}else{_0x434736[_0x5ea0('0x10')]();}}}catch(_0x3820b6){logger[_0x5ea0('0x5')](_0x5ea0('0x6'),_0x3a8732,JSON[_0x5ea0('0x12')](_0x3820b6));_0x434736[_0x5ea0('0xa')]();}};}; \ 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 cf86687..419bb83 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 _0x4808=['create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','account','InteractionId','interaction','Message'];(function(_0x3beda3,_0x18e35b){var _0x44bafb=function(_0xe56f33){while(--_0xe56f33){_0x3beda3['push'](_0x3beda3['shift']());}};_0x44bafb(++_0x18e35b);}(_0x4808,0x1cc));var _0x8480=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4808[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x8480('0x0'));var utils=require(_0x8480('0x1'));var logger=require(_0x8480('0x2'))(_0x8480('0x3'));var rpc={'chatMessage':require(_0x8480('0x4')),'openchannelMessage':require(_0x8480('0x5')),'mailMessage':require(_0x8480('0x6')),'smsMessage':require(_0x8480('0x7')),'faxMessage':require(_0x8480('0x8')),'whatsappMessage':require(_0x8480('0x9'))};exports[_0x8480('0xa')]=function(_0x515297,_0x195872){return function(_0xf1622f){try{var _0x3de577={'body':utils[_0x8480('0xb')](_0x195872[0x0],this),'ContactId':this[_0x8480('0xc')]['id']};if(this[_0x8480('0xd')]==='chat'){_0x3de577[_0x8480('0xe')]=this['account']['id'];}else{_0x3de577[_[_0x8480('0xf')](this['channel'])+'AccountId']=this[_0x8480('0x10')]['id'];}_0x3de577[_[_0x8480('0xf')](this[_0x8480('0xd')])+_0x8480('0x11')]=this[_0x8480('0x12')]['id'];if(rpc[this[_0x8480('0xd')]+'Message']){return rpc[this['channel']+_0x8480('0x13')][_0x8480('0x14')](_0x3de577)[_0x8480('0x15')](function(_0x2cd226){logger[_0x8480('0x16')]('[%s][MESSAGE]\x20%s',_0x515297,_0x3de577[_0x8480('0x17')]);_0xf1622f[_0x8480('0x18')]();})[_0x8480('0x19')](function(_0x5802a5){logger[_0x8480('0x1a')](_0x8480('0x1b'),_0x515297,JSON[_0x8480('0x1c')](_0x5802a5));_0xf1622f['stop']();});}}catch(_0x4d6b59){logger['error'](_0x8480('0x1b'),_0x515297,JSON[_0x8480('0x1c')](_0x4d6b59));_0xf1622f[_0x8480('0x1d')]();}};}; \ No newline at end of file +var _0xc73a=['consequence','channel','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage'];(function(_0x535ea8,_0x335ade){var _0xee9ccc=function(_0x2eae47){while(--_0x2eae47){_0x535ea8['push'](_0x535ea8['shift']());}};_0xee9ccc(++_0x335ade);}(_0xc73a,0x1ae));var _0xac73=function(_0x177d83,_0x16e316){_0x177d83=_0x177d83-0x0;var _0x425acc=_0xc73a[_0x177d83];return _0x425acc;};'use strict';var _=require(_0xac73('0x0'));var utils=require(_0xac73('0x1'));var logger=require(_0xac73('0x2'))(_0xac73('0x3'));var rpc={'chatMessage':require(_0xac73('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xac73('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xac73('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xac73('0x7')]=function(_0x18c85f,_0x4a76ab){return function(_0x834c4c){try{var _0x5793e0={'body':utils['getMustacheRender'](_0x4a76ab[0x0],this),'ContactId':this['contact']['id']};if(this[_0xac73('0x8')]==='chat'){_0x5793e0[_0xac73('0x9')]=this[_0xac73('0xa')]['id'];}else{_0x5793e0[_[_0xac73('0xb')](this[_0xac73('0x8')])+_0xac73('0xc')]=this[_0xac73('0xa')]['id'];}_0x5793e0[_[_0xac73('0xb')](this[_0xac73('0x8')])+'InteractionId']=this[_0xac73('0xd')]['id'];if(rpc[this[_0xac73('0x8')]+'Message']){return rpc[this[_0xac73('0x8')]+_0xac73('0xe')][_0xac73('0xf')](_0x5793e0)['then'](function(_0x3a9802){logger[_0xac73('0x10')](_0xac73('0x11'),_0x18c85f,_0x5793e0[_0xac73('0x12')]);_0x834c4c[_0xac73('0x13')]();})[_0xac73('0x14')](function(_0x45e8fc){logger[_0xac73('0x15')](_0xac73('0x11'),_0x18c85f,JSON[_0xac73('0x16')](_0x45e8fc));_0x834c4c['stop']();});}}catch(_0x4fff9c){logger[_0xac73('0x15')](_0xac73('0x11'),_0x18c85f,JSON[_0xac73('0x16')](_0x4fff9c));_0x834c4c['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 3d243f5..e77027f 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 _0xdb69=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x446570,_0x4a2b6a){var _0xfbaef1=function(_0x28cbfa){while(--_0x28cbfa){_0x446570['push'](_0x446570['shift']());}};_0xfbaef1(++_0x4a2b6a);}(_0xdb69,0xba));var _0x9db6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdb69[_0x3bf83f];return _0x22c4a9;};'use strict';var utils=require(_0x9db6('0x0'));var logger=require(_0x9db6('0x1'))(_0x9db6('0x2'));exports[_0x9db6('0x3')]=function(_0x4bedce,_0x4dd4fa){return function(_0x420b7b){try{logger[_0x9db6('0x4')](_0x9db6('0x5'),_0x4bedce,utils['getMustacheRender'](_0x4dd4fa[0x0],this));_0x420b7b[_0x9db6('0x6')]();}catch(_0x1611fa){logger[_0x9db6('0x7')]('[%s][NOOP]\x20%s',_0x4bedce,JSON[_0x9db6('0x8')](_0x1611fa));_0x420b7b[_0x9db6('0x9')]();}};}; \ No newline at end of file +var _0x15c9=['error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','consequence','info','getMustacheRender','next'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x15c9,0x18a));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var utils=require(_0x915c('0x0'));var logger=require(_0x915c('0x1'))('routing');exports[_0x915c('0x2')]=function(_0x2d75de,_0x12be26){return function(_0xb871e5){try{logger[_0x915c('0x3')]('[%s][NOOP]\x20%s',_0x2d75de,utils[_0x915c('0x4')](_0x12be26[0x0],this));_0xb871e5[_0x915c('0x5')]();}catch(_0x57679d){logger[_0x915c('0x6')](_0x915c('0x7'),_0x2d75de,JSON[_0x915c('0x8')](_0x57679d));_0xb871e5[_0x915c('0x9')]();}};}; \ 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 470f47d..b124766 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 _0x63d4=['InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','interaction','message','chat','AccountId','WebsiteId','info','name','QueueReport','error','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','validate','length','map','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','from','joinAt','queue_id','account','push'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x63d4,0xd4));var _0x463d=function(_0xe88031,_0x5d40ff){_0xe88031=_0xe88031-0x0;var _0x2427be=_0x63d4[_0xe88031];return _0x2427be;};'use strict';var schema=require('validate');var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var seqqueue=require(_0x463d('0x2'));var moment=require('moment');var Redis=require(_0x463d('0x3'));var config=require(_0x463d('0x4'));var logger=require('../../../../config/logger')(_0x463d('0x5'));var strategy=require(_0x463d('0x6'));config[_0x463d('0x7')]=_[_0x463d('0x8')](config[_0x463d('0x7')],{'host':_0x463d('0x9'),'port':0x18eb});var io=require(_0x463d('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id','account','queue',_0x463d('0xb'),_0x463d('0xc')];function emit(_0x5c49e3,_0x1215c7,_0x153a74){io['to'](_0x5c49e3)['emit'](_0x1215c7,_0x153a74);}function emitChannelQueueInteraction(_0x4ea45c,_0x7d2df7,_0x4376b7,_0x62549,_0x28a8e5,_0x3ee27d,_0x3263f3,_0x1cea2b){var _0x2399c0=_['clone'](_0x4376b7);_0x2399c0[_0x463d('0xd')]=_0x1cea2b;_0x2399c0['queue']=_0x7d2df7;_0x2399c0[_0x463d('0xe')]=_0x62549;_0x2399c0['id']=_0x28a8e5;if(_0x3ee27d){attributes[_0x463d('0xf')](_['capitalize'](_0x4ea45c)+_0x463d('0x10'));_0x3263f3[util[_0x463d('0x11')](_0x463d('0x12'),_0x4ea45c)][_0x28a8e5]=_[_0x463d('0x13')](_0x2399c0,attributes);}else{delete _0x3263f3[util[_0x463d('0x11')](_0x463d('0x12'),_0x4ea45c)][_0x28a8e5];}emit(util[_0x463d('0x11')]('%s:queue:%s',_0x4ea45c,_0x7d2df7),util[_0x463d('0x11')](_0x463d('0x14'),_0x4ea45c,_0x3ee27d?_0x463d('0x15'):'remove'),_[_0x463d('0x13')](_0x2399c0,attributes));}var rpc={'openchannelQueueReport':require(_0x463d('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x463d('0x17')),'smsQueueReport':require(_0x463d('0x18')),'faxQueueReport':require(_0x463d('0x19')),'whatsappQueueReport':require(_0x463d('0x1a'))};var queue=schema({'name':{'type':_0x463d('0x1b'),'required':!![],'message':_0x463d('0x1c')},'timeout':{'type':_0x463d('0x1d'),'message':_0x463d('0x1e')}});function startRouting(_0x1aa027,_0x3178b6,_0x2bb6d6,_0x2a2802){if(_0x1aa027&&_0x3178b6&&_0x2bb6d6){_0x3178b6[_0x463d('0x1f')]+=0x1;var _0x485426={'uniqueid':_0x1aa027,'from':_0x2bb6d6[_0x463d('0x20')]?_0x2bb6d6['body'][_0x463d('0xb')]:'','joinAt':moment()[_0x463d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bb6d6[_0x463d('0x21')]?_0x2bb6d6[_0x463d('0x21')]['id']:null,'ListId':_0x2bb6d6[_0x463d('0x22')]?_0x2bb6d6[_0x463d('0x22')]['id']:null};_0x485426[_['upperFirst'](_0x2bb6d6['channel'])+'QueueId']=_0x3178b6['id']||null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+_0x463d('0x10')]=_0x2bb6d6[_0x463d('0x25')]?_0x2bb6d6[_0x463d('0x25')]['id']:null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+'MessageId']=_0x2bb6d6[_0x463d('0x26')]?_0x2bb6d6[_0x463d('0x26')]['id']:null;_0x485426[_[_0x463d('0x23')](_0x2bb6d6[_0x463d('0x24')])+(_0x2bb6d6['channel']!==_0x463d('0x27')?_0x463d('0x28'):_0x463d('0x29'))]=_0x2bb6d6[_0x463d('0xe')]?_0x2bb6d6[_0x463d('0xe')]['id']:null;logger[_0x463d('0x2a')](util[_0x463d('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x1aa027,_0x3178b6['name']));emitChannelQueueInteraction(_0x2bb6d6[_0x463d('0x24')],_0x3178b6[_0x463d('0x2b')],_0x485426,_0x2bb6d6[_0x463d('0xe')][_0x463d('0x2b')],_0x2bb6d6['message']['id'],!![],_0x2a2802,_0x3178b6['id']);if(rpc[_0x2bb6d6[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x2bb6d6[_0x463d('0x24')]+_0x463d('0x2c')]['create'](_0x485426)['catch'](function(_0x40bac5){logger[_0x463d('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x19e6cd,_0x591410,_0x35a157,_0xd66af9){if(_0x19e6cd&&_0x591410){_0x591410[_0x463d('0x1f')]-=0x1;var _0x37f3b2={'leaveAt':moment()[_0x463d('0x11')](_0x463d('0x2e')),'acceptAt':moment()['format'](_0x463d('0x2e')),'reason':'accepted'};logger[_0x463d('0x2a')](util[_0x463d('0x11')](_0x463d('0x2f'),_0x19e6cd,_0x591410[_0x463d('0x2b')]));emitChannelQueueInteraction(_0x35a157[_0x463d('0x24')],_0x591410[_0x463d('0x2b')],_0x35a157[_0x463d('0x20')],_0x35a157['account'][_0x463d('0x2b')],_0x35a157['message']['id'],![],_0xd66af9,_0x591410['id']);if(rpc[_0x35a157[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x35a157[_0x463d('0x24')]+_0x463d('0x2c')][_0x463d('0x30')](_0x19e6cd,_0x37f3b2)[_0x463d('0x31')](function(_0x3e9c2c){logger[_0x463d('0x2d')](_0x463d('0x32'));});}}}function endRouting(_0x21f80a,_0x3b87b6,_0x520a60,_0x3510a4){if(_0x21f80a&&_0x3b87b6){_0x3b87b6[_0x463d('0x1f')]-=0x1;var _0x3770ab={'leaveAt':moment()[_0x463d('0x11')](_0x463d('0x2e')),'exitAt':moment()['format'](_0x463d('0x2e')),'reason':'timeout'};logger['info'](util[_0x463d('0x11')](_0x463d('0x33'),_0x21f80a,_0x3b87b6[_0x463d('0x2b')]));emitChannelQueueInteraction(_0x520a60[_0x463d('0x24')],_0x3b87b6[_0x463d('0x2b')],_0x520a60[_0x463d('0x20')],_0x520a60[_0x463d('0xe')][_0x463d('0x2b')],_0x520a60[_0x463d('0x26')]['id'],![],_0x3510a4);if(rpc[_0x520a60[_0x463d('0x24')]+_0x463d('0x2c')]){return rpc[_0x520a60[_0x463d('0x24')]+_0x463d('0x2c')][_0x463d('0x30')](_0x21f80a,_0x3770ab)[_0x463d('0x31')](function(_0x4f45a3){logger[_0x463d('0x2d')](_0x463d('0x32'));});}}}function handleFindQueue(_0x2b3306){return function(_0x322280){return _0x322280[_0x463d('0x2b')]['toLowerCase']()===_0x2b3306[_0x463d('0x34')]();};}exports['consequence']=function(_0x4c3050,_0x425ecd,_0x48dc6f,_0x1ac8aa){return function(_0x21fd17){try{var _0xdeddf3={'name':_0x425ecd[0x0],'timeout':_0x425ecd[0x1]};var _0x336bc3=queue[_0x463d('0x35')](_0xdeddf3,{'typecast':!![]});if(_0x336bc3[_0x463d('0x36')]){logger[_0x463d('0x2d')]('[%s][QUEUE]\x20%s',_0x4c3050,_[_0x463d('0x37')](_0x336bc3,_0x463d('0x26'))[_0x463d('0x38')](',\x20'));_0x21fd17[_0x463d('0x39')]();}else{var _0x118976=_[_0x463d('0x3a')](_0x48dc6f[_0x1ac8aa[_0x463d('0x24')]+_0x463d('0x3b')],handleFindQueue(_0xdeddf3['name']));if(_0x118976){startRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);var _0x1e646a=(_0x118976['timeout']||0xa)*0x3e8;var _0x1b61a1=(_0xdeddf3[_0x463d('0x3c')]||0x14)*0x3e8;var _0x29300f;if(_0x1e646a>_0x1b61a1){_0x1b61a1=_0x1e646a;}var _0x471f8e=seqqueue[_0x463d('0x3d')](_0x1e646a);_0x471f8e['id']=_0x4c3050;_0x471f8e[_0x463d('0x3e')]=_0x1e646a;_0x471f8e[_0x463d('0x3f')]=_0x1b61a1;_0x471f8e[_0x463d('0x24')]=_0x1ac8aa[_0x463d('0x24')];_0x48dc6f[_0x463d('0x40')][_0x4c3050]['on'](_0x463d('0x41'),function(){logger[_0x463d('0x2a')](_0x463d('0x42'),_0x4c3050);stopRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);clearTimeout(_0x29300f);_0x29300f=undefined;_0x471f8e[_0x463d('0x43')](!![]);if(_0x48dc6f[_0x463d('0x40')][_0x4c3050]){delete _0x48dc6f['rules'][_0x4c3050];}_0x21fd17[_0x463d('0x39')]();});_0x48dc6f['rules'][_0x4c3050]['on'](_0x463d('0x44'),function(){if(_0x48dc6f['rules'][_0x4c3050]){delete _0x48dc6f[_0x463d('0x40')][_0x4c3050];}});_0x29300f=setTimeout(function(){logger[_0x463d('0x2a')](_0x463d('0x45'),_0x4c3050);endRouting(_0x4c3050,_0x118976,_0x1ac8aa,_0x48dc6f);clearTimeout(_0x29300f);_0x471f8e[_0x463d('0x43')](!![]);_0x21fd17[_0x463d('0x46')]();},_0x1b61a1);switch(_0x118976['strategy']){case _0x463d('0x47'):strategy[_0x463d('0x47')](_0x471f8e,_0x118976,_0x48dc6f,_0x1ac8aa);break;default:strategy[_0x463d('0x48')](_0x471f8e,_0x118976,_0x48dc6f,_0x1ac8aa);}}else{logger['error'](_0x463d('0x49'),_0x4c3050,_0xdeddf3[_0x463d('0x2b')]);_0x21fd17[_0x463d('0x39')]();}}}catch(_0x1f9483){console['log'](_0x1f9483);logger[_0x463d('0x2d')](_0x463d('0x4a'),_0x4c3050,_0x1f9483[_0x463d('0x4b')]);_0x21fd17['stop']();}};}; \ No newline at end of file +var _0x3cab=['[%s][QUEUE]\x20APPLICATION\x20END','next','beepall','log','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','emit','clone','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','catch','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','validate','length','map','find','Queues','createQueue','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop'];(function(_0x5d7b89,_0x843d13){var _0x439852=function(_0x5c3232){while(--_0x5c3232){_0x5d7b89['push'](_0x5d7b89['shift']());}};_0x439852(++_0x843d13);}(_0x3cab,0x18c));var _0xb3ca=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x3cab[_0x5a7d41];return _0x98d8fa;};'use strict';var schema=require('validate');var _=require(_0xb3ca('0x0'));var util=require('util');var seqqueue=require(_0xb3ca('0x1'));var moment=require(_0xb3ca('0x2'));var Redis=require(_0xb3ca('0x3'));var config=require(_0xb3ca('0x4'));var logger=require(_0xb3ca('0x5'))(_0xb3ca('0x6'));var strategy=require('./strategy');config[_0xb3ca('0x7')]=_[_0xb3ca('0x8')](config[_0xb3ca('0x7')],{'host':_0xb3ca('0x9'),'port':0x18eb});var io=require(_0xb3ca('0xa'))(new Redis(config['redis']));var attributes=['id',_0xb3ca('0xb'),_0xb3ca('0xc'),'queue',_0xb3ca('0xd'),'joinAt'];function emit(_0x6e0823,_0x5e43e5,_0xcb304b){io['to'](_0x6e0823)[_0xb3ca('0xe')](_0x5e43e5,_0xcb304b);}function emitChannelQueueInteraction(_0x2b11d6,_0xd850b6,_0x2bd370,_0x4b5c05,_0x49549a,_0x1ef678,_0x4f2065,_0x48555d){var _0x2deb0c=_[_0xb3ca('0xf')](_0x2bd370);_0x2deb0c[_0xb3ca('0xb')]=_0x48555d;_0x2deb0c[_0xb3ca('0x10')]=_0xd850b6;_0x2deb0c[_0xb3ca('0xc')]=_0x4b5c05;_0x2deb0c['id']=_0x49549a;if(_0x1ef678){attributes[_0xb3ca('0x11')](_[_0xb3ca('0x12')](_0x2b11d6)+_0xb3ca('0x13'));_0x4f2065[util[_0xb3ca('0x14')](_0xb3ca('0x15'),_0x2b11d6)][_0x49549a]=_[_0xb3ca('0x16')](_0x2deb0c,attributes);}else{delete _0x4f2065[util['format']('%sQueuesWaitingInteractions',_0x2b11d6)][_0x49549a];}emit(util[_0xb3ca('0x14')](_0xb3ca('0x17'),_0x2b11d6,_0xd850b6),util['format'](_0xb3ca('0x18'),_0x2b11d6,_0x1ef678?_0xb3ca('0x19'):'remove'),_[_0xb3ca('0x16')](_0x2deb0c,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb3ca('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xb3ca('0x1b')),'whatsappQueueReport':require(_0xb3ca('0x1c'))};var queue=schema({'name':{'type':_0xb3ca('0x1d'),'required':!![],'message':_0xb3ca('0x1e')},'timeout':{'type':_0xb3ca('0x1f'),'message':_0xb3ca('0x20')}});function startRouting(_0x3c85fa,_0x2435d6,_0x5ac6a8,_0x22b39d){if(_0x3c85fa&&_0x2435d6&&_0x5ac6a8){_0x2435d6[_0xb3ca('0x21')]+=0x1;var _0x42eba7={'uniqueid':_0x3c85fa,'from':_0x5ac6a8[_0xb3ca('0x22')]?_0x5ac6a8[_0xb3ca('0x22')]['from']:'','joinAt':moment()[_0xb3ca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5ac6a8[_0xb3ca('0x23')]?_0x5ac6a8[_0xb3ca('0x23')]['id']:null,'ListId':_0x5ac6a8[_0xb3ca('0x24')]?_0x5ac6a8['list']['id']:null};_0x42eba7[_[_0xb3ca('0x25')](_0x5ac6a8[_0xb3ca('0x26')])+_0xb3ca('0x27')]=_0x2435d6['id']||null;_0x42eba7[_[_0xb3ca('0x25')](_0x5ac6a8['channel'])+'InteractionId']=_0x5ac6a8[_0xb3ca('0x28')]?_0x5ac6a8[_0xb3ca('0x28')]['id']:null;_0x42eba7[_[_0xb3ca('0x25')](_0x5ac6a8[_0xb3ca('0x26')])+_0xb3ca('0x29')]=_0x5ac6a8[_0xb3ca('0x2a')]?_0x5ac6a8[_0xb3ca('0x2a')]['id']:null;_0x42eba7[_[_0xb3ca('0x25')](_0x5ac6a8['channel'])+(_0x5ac6a8[_0xb3ca('0x26')]!==_0xb3ca('0x2b')?_0xb3ca('0x2c'):_0xb3ca('0x2d'))]=_0x5ac6a8[_0xb3ca('0xc')]?_0x5ac6a8[_0xb3ca('0xc')]['id']:null;logger[_0xb3ca('0x2e')](util['format'](_0xb3ca('0x2f'),_0x3c85fa,_0x2435d6[_0xb3ca('0x30')]));emitChannelQueueInteraction(_0x5ac6a8['channel'],_0x2435d6['name'],_0x42eba7,_0x5ac6a8[_0xb3ca('0xc')][_0xb3ca('0x30')],_0x5ac6a8['message']['id'],!![],_0x22b39d,_0x2435d6['id']);if(rpc[_0x5ac6a8[_0xb3ca('0x26')]+_0xb3ca('0x31')]){return rpc[_0x5ac6a8['channel']+_0xb3ca('0x31')][_0xb3ca('0x32')](_0x42eba7)['catch'](function(_0x5af8e0){logger[_0xb3ca('0x33')](_0xb3ca('0x34'));});}}}function stopRouting(_0x3c3510,_0x150509,_0x33a04d,_0x1afb2d){if(_0x3c3510&&_0x150509){_0x150509[_0xb3ca('0x21')]-=0x1;var _0x11f4fe={'leaveAt':moment()[_0xb3ca('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb3ca('0x35')};logger['info'](util[_0xb3ca('0x14')]('[%s][STOP:QUEUE][NAME:%s]',_0x3c3510,_0x150509[_0xb3ca('0x30')]));emitChannelQueueInteraction(_0x33a04d[_0xb3ca('0x26')],_0x150509['name'],_0x33a04d[_0xb3ca('0x22')],_0x33a04d['account']['name'],_0x33a04d['message']['id'],![],_0x1afb2d,_0x150509['id']);if(rpc[_0x33a04d[_0xb3ca('0x26')]+_0xb3ca('0x31')]){return rpc[_0x33a04d['channel']+_0xb3ca('0x31')]['update'](_0x3c3510,_0x11f4fe)[_0xb3ca('0x36')](function(_0x4e95a9){logger[_0xb3ca('0x33')]('update\x20queue\x20report');});}}}function endRouting(_0x10566f,_0x54f9ef,_0x5ca252,_0x2c95bf){if(_0x10566f&&_0x54f9ef){_0x54f9ef[_0xb3ca('0x21')]-=0x1;var _0x51435d={'leaveAt':moment()['format'](_0xb3ca('0x37')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb3ca('0x38')};logger[_0xb3ca('0x2e')](util[_0xb3ca('0x14')](_0xb3ca('0x39'),_0x10566f,_0x54f9ef[_0xb3ca('0x30')]));emitChannelQueueInteraction(_0x5ca252['channel'],_0x54f9ef[_0xb3ca('0x30')],_0x5ca252[_0xb3ca('0x22')],_0x5ca252['account'][_0xb3ca('0x30')],_0x5ca252[_0xb3ca('0x2a')]['id'],![],_0x2c95bf);if(rpc[_0x5ca252[_0xb3ca('0x26')]+_0xb3ca('0x31')]){return rpc[_0x5ca252[_0xb3ca('0x26')]+'QueueReport'][_0xb3ca('0x3a')](_0x10566f,_0x51435d)[_0xb3ca('0x36')](function(_0x249538){logger[_0xb3ca('0x33')]('update\x20queue\x20report');});}}}function handleFindQueue(_0xfae31b){return function(_0x3afba4){return _0x3afba4[_0xb3ca('0x30')][_0xb3ca('0x3b')]()===_0xfae31b[_0xb3ca('0x3b')]();};}exports[_0xb3ca('0x3c')]=function(_0x472daf,_0x3f99fd,_0x332f82,_0x345c73){return function(_0x537cf3){try{var _0x45d65b={'name':_0x3f99fd[0x0],'timeout':_0x3f99fd[0x1]};var _0x161018=queue[_0xb3ca('0x3d')](_0x45d65b,{'typecast':!![]});if(_0x161018[_0xb3ca('0x3e')]){logger[_0xb3ca('0x33')]('[%s][QUEUE]\x20%s',_0x472daf,_[_0xb3ca('0x3f')](_0x161018,_0xb3ca('0x2a'))['join'](',\x20'));_0x537cf3['stop']();}else{var _0x188bfc=_[_0xb3ca('0x40')](_0x332f82[_0x345c73[_0xb3ca('0x26')]+_0xb3ca('0x41')],handleFindQueue(_0x45d65b[_0xb3ca('0x30')]));if(_0x188bfc){startRouting(_0x472daf,_0x188bfc,_0x345c73,_0x332f82);var _0x3e42ba=(_0x188bfc['timeout']||0xa)*0x3e8;var _0x3b3cc8=(_0x45d65b[_0xb3ca('0x38')]||0x14)*0x3e8;var _0x3eec7a;if(_0x3e42ba>_0x3b3cc8){_0x3b3cc8=_0x3e42ba;}var _0x9660b=seqqueue[_0xb3ca('0x42')](_0x3e42ba);_0x9660b['id']=_0x472daf;_0x9660b[_0xb3ca('0x43')]=_0x3e42ba;_0x9660b['qtimeout']=_0x3b3cc8;_0x9660b['channel']=_0x345c73[_0xb3ca('0x26')];_0x332f82[_0xb3ca('0x44')][_0x472daf]['on']('end',function(){logger[_0xb3ca('0x2e')](_0xb3ca('0x45'),_0x472daf);stopRouting(_0x472daf,_0x188bfc,_0x345c73,_0x332f82);clearTimeout(_0x3eec7a);_0x3eec7a=undefined;_0x9660b[_0xb3ca('0x46')](!![]);if(_0x332f82[_0xb3ca('0x44')][_0x472daf]){delete _0x332f82[_0xb3ca('0x44')][_0x472daf];}_0x537cf3[_0xb3ca('0x47')]();});_0x332f82[_0xb3ca('0x44')][_0x472daf]['on']('complete',function(){if(_0x332f82[_0xb3ca('0x44')][_0x472daf]){delete _0x332f82['rules'][_0x472daf];}});_0x3eec7a=setTimeout(function(){logger[_0xb3ca('0x2e')](_0xb3ca('0x48'),_0x472daf);endRouting(_0x472daf,_0x188bfc,_0x345c73,_0x332f82);clearTimeout(_0x3eec7a);_0x9660b['close'](!![]);_0x537cf3[_0xb3ca('0x49')]();},_0x3b3cc8);switch(_0x188bfc['strategy']){case'rrmemory':strategy['rrmemory'](_0x9660b,_0x188bfc,_0x332f82,_0x345c73);break;default:strategy[_0xb3ca('0x4a')](_0x9660b,_0x188bfc,_0x332f82,_0x345c73);}}else{logger[_0xb3ca('0x33')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x472daf,_0x45d65b[_0xb3ca('0x30')]);_0x537cf3[_0xb3ca('0x47')]();}}}catch(_0x18424e){console[_0xb3ca('0x4b')](_0x18424e);logger[_0xb3ca('0x33')](_0xb3ca('0x4c'),_0x472daf,_0x18424e[_0xb3ca('0x4d')]);_0x537cf3[_0xb3ca('0x47')]();}};}; \ 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 fa1d28f..654eb00 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 _0xf2ca=['channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','handleRun','bind','timeout','drained','handleDrained','push','prototype','handleTimeout','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x32bfd3,_0xf51849){var _0x1d7ce6=function(_0x40edad){while(--_0x40edad){_0x32bfd3['push'](_0x32bfd3['shift']());}};_0x1d7ce6(++_0xf51849);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0xf2ca[_0x507597];return _0x110a0f;};'use strict';var _=require(_0xaf2c('0x0'));var uuid=require(_0xaf2c('0x1'));var util=require(_0xaf2c('0x2'));var logger=require('../../../../../config/logger')(_0xaf2c('0x3'));var Agent=function(_0x2102e2,_0x1271a9,_0x219511,_0x3a724c){this[_0xaf2c('0x4')]=uuid['v4']();this['squeue']=_0x2102e2;this[_0xaf2c('0x5')]=_0x1271a9;this[_0xaf2c('0x6')]=_0x219511;this[_0xaf2c('0x3')]=_0x3a724c;this[_0xaf2c('0x7')]['push'](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout'][_0xaf2c('0x9')](this));this['squeue']['on'](_0xaf2c('0xa'),this['handleTimeout'][_0xaf2c('0x9')](this));this[_0xaf2c('0x7')]['on'](_0xaf2c('0xb'),this[_0xaf2c('0xc')]['bind'](this));};Agent['prototype'][_0xaf2c('0xd')]=function(){this[_0xaf2c('0x7')][_0xaf2c('0xd')](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0xaf2c('0xe')][_0xaf2c('0xc')]=function(){this[_0xaf2c('0xf')](!![]);};Agent[_0xaf2c('0xe')][_0xaf2c('0x8')]=function(){logger[_0xaf2c('0x10')](_0xaf2c('0x11'),this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);if(_[_0xaf2c('0x12')](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){logger[_0xaf2c('0x10')](_0xaf2c('0x14'),this['squeue']['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this['push'][_0xaf2c('0x9')](this),0x3e8);}else{if(this[_0xaf2c('0x3')][_0xaf2c('0x15')]||util['isAgentAvailable'](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],this[_0xaf2c('0x7')][_0xaf2c('0x16')],![])){this['realtime'][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=!![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']][_0xaf2c('0x18')]=undefined;util[_0xaf2c('0x19')](this[_0xaf2c('0x6')],this['routing'],this['agent'],this[_0xaf2c('0x7')][_0xaf2c('0x16')]);util[_0xaf2c('0x1a')](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],null,this[_0xaf2c('0x3')]);util[_0xaf2c('0x1b')](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']],_0xaf2c('0x1c')+(this[_0xaf2c('0x3')][_0xaf2c('0x15')]?':FORCED':''));}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this[_0xaf2c('0xd')]['bind'](this),0x3e8);}}};Agent[_0xaf2c('0xe')][_0xaf2c('0xf')]=function(_0x3baee2){if(_['isNil'](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){return logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xaf2c('0x5')]['id']);util['hideNotification'](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']],null,this[_0xaf2c('0x3')]);this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x18')]=undefined;util['removeWaitingNotification'](this[_0xaf2c('0x6')],this['routing'],this[_0xaf2c('0x5')],this['squeue'][_0xaf2c('0x16')]);util['writeLog'](this[_0xaf2c('0x7')]['id'],this['realtime'][_0xaf2c('0x13')][this['agent']['id']],_0x3baee2?_0xaf2c('0x1d'):_0xaf2c('0x1e'));}if(!_0x3baee2){setTimeout(this[_0xaf2c('0xd')][_0xaf2c('0x9')](this),0x3e8);}};function agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d){return new Agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d);}module[_0xaf2c('0x1f')]=agent; \ No newline at end of file +var _0x5178=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x5178,0x171));var _0x8517=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5178[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var uuid=require(_0x8517('0x0'));var util=require(_0x8517('0x1'));var logger=require(_0x8517('0x2'))(_0x8517('0x3'));var Agent=function(_0x38d5b3,_0x5e0a44,_0x483381,_0x3ed6a5){this[_0x8517('0x4')]=uuid['v4']();this['squeue']=_0x38d5b3;this[_0x8517('0x5')]=_0x5e0a44;this['realtime']=_0x483381;this[_0x8517('0x3')]=_0x3ed6a5;this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')][_0x8517('0x9')](this),this['handleTimeout'][_0x8517('0x9')](this));this['squeue']['on']('timeout',this[_0x8517('0xa')][_0x8517('0x9')](this));this['squeue']['on'](_0x8517('0xb'),this[_0x8517('0xc')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0x7')]=function(){this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')]['bind'](this),this[_0x8517('0xa')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0xc')]=function(){this[_0x8517('0xa')](!![]);};Agent['prototype'][_0x8517('0x8')]=function(){logger[_0x8517('0xe')](_0x8517('0xf'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);if(_[_0x8517('0x10')](this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']])){logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}else{if(this[_0x8517('0x3')][_0x8517('0x14')]||util[_0x8517('0x15')](this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']],this['squeue']['channel'],![])){this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=!![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x8517('0x17')](this[_0x8517('0x11')],this[_0x8517('0x3')],this[_0x8517('0x5')],this[_0x8517('0x6')][_0x8517('0x18')]);util['showNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],null,this[_0x8517('0x3')]);util['writeLog'](this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x8517('0x19')+(this[_0x8517('0x3')][_0x8517('0x14')]?_0x8517('0x1a'):''));}else{logger['debug'](_0x8517('0x1b'),this['squeue']['id'],this[_0x8517('0x5')]['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}}};Agent[_0x8517('0xd')][_0x8517('0xa')]=function(_0x1b2423){if(_['isNil'](this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']])){return logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);}else{logger[_0x8517('0xe')](_0x8517('0x1c'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);util['hideNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this['agent']['id']],null,this['routing']);this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']][_0x8517('0x1d')]=undefined;util[_0x8517('0x1e')](this[_0x8517('0x11')],this['routing'],this[_0x8517('0x5')],this['squeue'][_0x8517('0x18')]);util[_0x8517('0x1f')](this['squeue']['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x1b2423?_0x8517('0x20'):_0x8517('0x21'));}if(!_0x1b2423){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1){return new Agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1);}module[_0x8517('0x22')]=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 c3aaf31..1888515 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 _0xb455=['./util','../../../../../config/logger','notificationId','queue','realtime','routing','push','handleTimeout','bind','timeout','squeue','drained','handleDrained','handleRun','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','name','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','TIMEOUT','removeWaitingNotification','exports','lodash','uuid'];(function(_0x5f42e3,_0x200da8){var _0x665f00=function(_0xb8a86e){while(--_0xb8a86e){_0x5f42e3['push'](_0x5f42e3['shift']());}};_0x665f00(++_0x200da8);}(_0xb455,0x142));var _0x5b45=function(_0x21a597,_0x577a62){_0x21a597=_0x21a597-0x0;var _0x39a478=_0xb455[_0x21a597];return _0x39a478;};'use strict';var _=require(_0x5b45('0x0'));var uuid=require(_0x5b45('0x1'));var util=require(_0x5b45('0x2'));var logger=require(_0x5b45('0x3'))('routing');var Beepall=function(_0x4aaabf,_0x2db7b0,_0x5d6627,_0xe4a0a){this[_0x5b45('0x4')]=uuid['v4']();this['squeue']=_0x4aaabf;this[_0x5b45('0x5')]=_0x2db7b0;this[_0x5b45('0x6')]=_0x5d6627;this[_0x5b45('0x7')]=_0xe4a0a;this['squeue'][_0x5b45('0x8')](this['handleRun']['bind'](this),this[_0x5b45('0x9')][_0x5b45('0xa')](this));this['squeue']['on'](_0x5b45('0xb'),this[_0x5b45('0x9')][_0x5b45('0xa')](this));this[_0x5b45('0xc')]['on'](_0x5b45('0xd'),this[_0x5b45('0xe')][_0x5b45('0xa')](this));};Beepall['prototype'][_0x5b45('0x8')]=function(){this[_0x5b45('0xc')][_0x5b45('0x8')](this[_0x5b45('0xf')]['bind'](this),this[_0x5b45('0x9')][_0x5b45('0xa')](this));};Beepall[_0x5b45('0x10')][_0x5b45('0xe')]=function(){this[_0x5b45('0x9')](!![]);};Beepall[_0x5b45('0x10')][_0x5b45('0xf')]=function(){var _0x791c3a=!![];if(!_['isNil'](this[_0x5b45('0x5')])&&!_[_0x5b45('0x11')](this[_0x5b45('0x5')]['Agents'])&&this[_0x5b45('0x5')][_0x5b45('0x12')]['length']>0x0){for(var _0x1a71c9=0x0,_0x2be52b;_0x1a71c90x0){for(var _0x1dd111=0x0,_0x3fd65d;_0x1dd1110x0&&_0x161ca7[_0x58ce16+'CurrentCapacity']>=_0x161ca7[_0x58ce16+'Capacity']){writeLog(_0x17db78,_0x161ca7,_0x58ce16[_0x128c('0x28')]()+_0x128c('0x29'));return![];}}return!![];};exports[_0x128c('0x2a')]=function(_0x228671,_0x414a8d,_0x509e37,_0x447a16,_0x51683a){return sendNotification(!![],_0x228671,_0x414a8d,_0x509e37,_0x447a16,_0x51683a);};exports['hideNotification']=function(_0x14b7a0,_0x1ed641,_0x15344b,_0x1b5723,_0x1954fb){return sendNotification(![],_0x14b7a0,_0x1ed641,_0x15344b,_0x1b5723,_0x1954fb);};exports[_0x128c('0x2b')]=function(_0x596adc,_0x4a7a9f,_0x99930e){var _0x8c23f0=_0x4a7a9f[_0x128c('0x2c')][_0x128c('0x2d')];if(!_0x8c23f0&&_0x99930e){_0x8c23f0=_0x99930e['id'];}var _0xb63082=_[_0x128c('0x2e')](_0x596adc[_0x4a7a9f[_0x128c('0x2f')]+_0x128c('0x30')],function(_0x392ba3){var _0x2218df=_[_0x128c('0x31')](_0x4a7a9f[_0x128c('0x2f')])+'InteractionId';return _0x392ba3[_0x2218df]===_0x4a7a9f[_0x128c('0x2c')]['id'];});if(!_0xb63082&&_0x8c23f0){_0xb63082=_['some'](_0x596adc[_0x128c('0x32')][_0x8c23f0][_0x4a7a9f[_0x128c('0x2f')]+_0x128c('0x33')],function(_0x19dc67){return _0x19dc67['id']===_0x4a7a9f['interaction']['id'];});}return _0xb63082;};exports[_0x128c('0x34')]=function(_0x176cd9,_0x5cc8c5,_0x3af028,_0x1e4f57){_0x176cd9[_0x128c('0x32')][_0x3af028['id']][_0x1e4f57+_0x128c('0x33')][_0x5cc8c5['message']['id']]={'id':_0x5cc8c5[_0x128c('0x2c')]['id']};};exports['removeWaitingNotification']=function(_0x286b06,_0x190da9,_0x112265,_0x17ec36){delete _0x286b06[_0x128c('0x32')][_0x112265['id']][_0x17ec36+_0x128c('0x33')][_0x190da9[_0x128c('0x19')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x110e=['toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction','some','QueuesWaitingInteractions','channel','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','user:%s','name','emit','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Capacity','hasOwnProperty','CurrentCapacity'];(function(_0x2e8fba,_0x572cfa){var _0x505997=function(_0x222730){while(--_0x222730){_0x2e8fba['push'](_0x2e8fba['shift']());}};_0x505997(++_0x572cfa);}(_0x110e,0x12d));var _0xe110=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x110e[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var utils=require(_0xe110('0x2'));var Redis=require(_0xe110('0x3'));var config=require(_0xe110('0x4'));var logger=require(_0xe110('0x5'))(_0xe110('0x6'));config[_0xe110('0x7')]=_[_0xe110('0x8')](config[_0xe110('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe110('0x7')]));function sendNotification(_0x701c57,_0x37fcb9,_0x2a2a24,_0x146594,_0x1e5fd4,_0x4dd23b){io['to'](util['format'](_0xe110('0x9'),_0x146594[_0xe110('0xa')]))[_0xe110('0xb')]('user:save',_0x146594);var _0x5dd6da=_0x4dd23b||{};var _0x1d7a1b=_0x2a2a24['split']('.');var _0x425522={'uniqueid':_0x37fcb9,'channel':_0x1d7a1b[0x0],'id':_0x1d7a1b[0x1],'title':_0x1d7a1b[0x0]+_0xe110('0xc'),'interactionId':_0x1d7a1b[0x2],'queue':_0x1e5fd4?_0x1e5fd4[_0xe110('0xa')]:null,'sound':_0x5dd6da[_0xe110('0xd')][_0xe110('0xe')],'shake':_0x5dd6da[_0xe110('0xd')][_0xe110('0xf')]};try{if(!_0x5dd6da[_0xe110('0x10')]){_0x5dd6da[_0xe110('0x10')]={};}if(_0x1e5fd4){_0x5dd6da[_0xe110('0x10')]['queue']=_0x1e5fd4;}else if(_0x5dd6da['body'][_0xe110('0x11')]){delete _0x5dd6da[_0xe110('0x10')][_0xe110('0x11')];}_0x425522[_0xe110('0x12')]=utils['getMustacheRender'](_0x5dd6da[_0xe110('0xd')]['notificationTemplate'],_0x5dd6da);}catch(_0x361e5d){_0x425522[_0xe110('0x12')]=_0xe110('0x13');logger[_0xe110('0x14')](util[_0xe110('0x15')]('[%s][QUEUE]\x20%s',_0x37fcb9,_0x361e5d[_0xe110('0x16')]));}io['to'](util[_0xe110('0x15')](_0xe110('0x9'),_0x146594[_0xe110('0xa')]))[_0xe110('0xb')](util[_0xe110('0x15')]('notification:%s',_0x701c57?_0xe110('0x17'):_0xe110('0x18')),_0x425522);}function writeLog(_0xae1189,_0x2106a2,_0x50812a){return logger[_0xe110('0x19')](util[_0xe110('0x15')](_0xe110('0x1a'),_0xae1189,_0x2106a2[_0xe110('0xa')],_0x50812a));}exports[_0xe110('0x1b')]=function(_0x18a05c,_0x35ab90,_0x385ecc,_0xa99cfc){if(_0x35ab90[_0xe110('0x1c')]){writeLog(_0x18a05c,_0x35ab90,_0xe110('0x1d'));return![];}if(!_0x35ab90[_0xe110('0x1e')]){writeLog(_0x18a05c,_0x35ab90,_0xe110('0x1f'));return![];}if(_0x35ab90[_0x385ecc+'Pause']){writeLog(_0x18a05c,_0x35ab90,'PAUSE');return![];}if(_0xa99cfc&&_0x35ab90['hasOwnProperty'](_0x385ecc+_0xe110('0x20'))&&_0x35ab90[_0xe110('0x21')](_0x385ecc+_0xe110('0x22'))){if(_0x35ab90[_0x385ecc+_0xe110('0x20')]>0x0&&_0x35ab90[_0x385ecc+_0xe110('0x22')]>=_0x35ab90[_0x385ecc+'Capacity']){writeLog(_0x18a05c,_0x35ab90,_0x385ecc[_0xe110('0x23')]()+_0xe110('0x24'));return![];}}return!![];};exports[_0xe110('0x25')]=function(_0x16be9f,_0x3bddd7,_0x5867be,_0x45e914,_0x252dc2){return sendNotification(!![],_0x16be9f,_0x3bddd7,_0x5867be,_0x45e914,_0x252dc2);};exports[_0xe110('0x26')]=function(_0x3881e8,_0x108c39,_0x1abf09,_0x1d18ea,_0x33cb8c){return sendNotification(![],_0x3881e8,_0x108c39,_0x1abf09,_0x1d18ea,_0x33cb8c);};exports['checkWaitingNotifications']=function(_0x33f07e,_0x350883,_0x2396f4){var _0x3baf34=_0x350883[_0xe110('0x27')]['UserId'];if(!_0x3baf34&&_0x2396f4){_0x3baf34=_0x2396f4['id'];}var _0x467a0d=_[_0xe110('0x28')](_0x33f07e[_0x350883['channel']+_0xe110('0x29')],function(_0x2d0a9a){var _0x422bae=_['capitalize'](_0x350883[_0xe110('0x2a')])+_0xe110('0x2b');return _0x2d0a9a[_0x422bae]===_0x350883[_0xe110('0x27')]['id'];});if(!_0x467a0d&&_0x3baf34){_0x467a0d=_['some'](_0x33f07e[_0xe110('0x2c')][_0x3baf34][_0x350883[_0xe110('0x2a')]+_0xe110('0x2d')],function(_0x52f344){return _0x52f344['id']===_0x350883[_0xe110('0x27')]['id'];});}return _0x467a0d;};exports[_0xe110('0x2e')]=function(_0x1bd77b,_0x4c215a,_0x5c57a7,_0x7f77a2){_0x1bd77b[_0xe110('0x2c')][_0x5c57a7['id']][_0x7f77a2+_0xe110('0x2d')][_0x4c215a[_0xe110('0x16')]['id']]={'id':_0x4c215a[_0xe110('0x27')]['id']};};exports[_0xe110('0x2f')]=function(_0x4776b7,_0x24458f,_0x1e2fd7,_0x5e0e5e){delete _0x4776b7[_0xe110('0x2c')][_0x1e2fd7['id']][_0x5e0e5e+_0xe110('0x2d')][_0x24458f[_0xe110('0x16')]['id']];};exports['writeLog']=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 dfd6e97..667f95e 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 _0x09c1=['isObject','stringify','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x09c1,0xb1));var _0x109c=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x09c1[_0x4eab61];return _0x342426;};'use strict';var schema=require('validate');var sh=require(_0x109c('0x0'));var _=require(_0x109c('0x1'));var utils=require('./utils');var logger=require(_0x109c('0x2'))(_0x109c('0x3'));var system=schema({'command':{'type':_0x109c('0x4'),'required':!![],'message':_0x109c('0x5')}});exports['consequence']=function(_0x3609f6,_0x1b7c47){return function(_0x542217){try{var _0x369c4e={'command':_0x1b7c47[0x0]};var _0x17a333=system[_0x109c('0x6')](_0x369c4e,{'typecast':!![]});if(_0x17a333['length']){logger[_0x109c('0x7')]('[%s][SYSTEM]\x20%s',_0x3609f6,_[_0x109c('0x8')](_0x17a333,_0x109c('0x9'))['join'](',\x20'));logger[_0x109c('0xa')](_0x109c('0xb'),_0x3609f6);_0x542217[_0x109c('0xc')]();}else{var _0x17a60f=this;var _0x9eebc0=utils[_0x109c('0xd')](_0x1b7c47[0x0],this);logger[_0x109c('0xa')](_0x109c('0xe'),_0x3609f6,_0x9eebc0);sh[_0x109c('0xf')](_['trim'](_0x9eebc0),function(_0x1d5b3b,_0x427b87){logger[_0x109c('0xa')](_0x109c('0x10'),_0x3609f6,_0x1d5b3b);if(_0x1d5b3b==0x0){var _0x266097=_0x427b87[_0x109c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x109c('0x12')](_0x1b7c47[0x1])||_['isEmpty'](_0x1b7c47[0x1])){logger[_0x109c('0xa')](_0x109c('0x13'),_0x3609f6);_0x17a60f[_0x109c('0x14')][_0x1b7c47[0x1]]=_0x266097;}else{logger[_0x109c('0xa')](_0x109c('0x15'),_0x3609f6,_0x1b7c47[0x1],_0x266097);_0x17a60f[_0x109c('0x14')][_0x1b7c47[0x1]]=_0x266097;}}_0x542217[_0x109c('0xc')]();});}}catch(_0x13f6db){logger[_0x109c('0x7')](_0x109c('0x16'),_0x3609f6,_[_0x109c('0x17')](_0x13f6db)?JSON[_0x109c('0x18')](_0x13f6db):_0x13f6db);logger[_0x109c('0xa')](_0x109c('0xb'),_0x3609f6);_0x542217['next']();}};}; \ No newline at end of file +var _0x3518=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','./utils','../../../../config/logger','string','consequence','length','error','map','message','join','info'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x3518,0xbc));var _0x8351=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x3518[_0x503641];return _0x17757d;};'use strict';var schema=require(_0x8351('0x0'));var sh=require(_0x8351('0x1'));var _=require('lodash');var utils=require(_0x8351('0x2'));var logger=require(_0x8351('0x3'))('routing');var system=schema({'command':{'type':_0x8351('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x8351('0x5')]=function(_0x3d30aa,_0x829d2){return function(_0x1be444){try{var _0x155685={'command':_0x829d2[0x0]};var _0x66e994=system[_0x8351('0x0')](_0x155685,{'typecast':!![]});if(_0x66e994[_0x8351('0x6')]){logger[_0x8351('0x7')]('[%s][SYSTEM]\x20%s',_0x3d30aa,_[_0x8351('0x8')](_0x66e994,_0x8351('0x9'))[_0x8351('0xa')](',\x20'));logger[_0x8351('0xb')](_0x8351('0xc'),_0x3d30aa);_0x1be444[_0x8351('0xd')]();}else{var _0x601cde=this;var _0x595e71=utils['getMustacheRender'](_0x829d2[0x0],this);logger[_0x8351('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3d30aa,_0x595e71);sh[_0x8351('0xe')](_[_0x8351('0xf')](_0x595e71),function(_0xac43c4,_0xad153){logger[_0x8351('0xb')](_0x8351('0x10'),_0x3d30aa,_0xac43c4);if(_0xac43c4==0x0){var _0x4dc7bc=_0xad153[_0x8351('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x8351('0x12')](_0x829d2[0x1])||_[_0x8351('0x13')](_0x829d2[0x1])){logger[_0x8351('0xb')](_0x8351('0x14'),_0x3d30aa);_0x601cde[_0x8351('0x15')][_0x829d2[0x1]]=_0x4dc7bc;}else{logger['info'](_0x8351('0x16'),_0x3d30aa,_0x829d2[0x1],_0x4dc7bc);_0x601cde[_0x8351('0x15')][_0x829d2[0x1]]=_0x4dc7bc;}}_0x1be444[_0x8351('0xd')]();});}}catch(_0x34a0f0){logger[_0x8351('0x7')](_0x8351('0x17'),_0x3d30aa,_[_0x8351('0x18')](_0x34a0f0)?JSON['stringify'](_0x34a0f0):_0x34a0f0);logger[_0x8351('0xb')](_0x8351('0xc'),_0x3d30aa);_0x1be444[_0x8351('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 34798bc..aa7d6af 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 _0x0e63=['then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','isObject','stringify','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction'];(function(_0x5bed68,_0x552486){var _0x857701=function(_0x4da81d){while(--_0x4da81d){_0x5bed68['push'](_0x5bed68['shift']());}};_0x857701(++_0x552486);}(_0x0e63,0xe6));var _0x30e6=function(_0x183fa0,_0x13b4af){_0x183fa0=_0x183fa0-0x0;var _0x5db369=_0x0e63[_0x183fa0];return _0x5db369;};'use strict';var schema=require('validate');var _=require(_0x30e6('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x30e6('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x30e6('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x30e6('0x3'))};var logger=require(_0x30e6('0x4'))(_0x30e6('0x5'));var tag=schema({'tag':{'type':_0x30e6('0x6'),'required':!![],'message':_0x30e6('0x7')}});exports[_0x30e6('0x8')]=function(_0x2656d8,_0x3ed82e,_0xdbf4e6,_0x2cf19b){return function(_0x1d3297){try{var _0x3778c8={'tag':_0x3ed82e[0x0]};var _0x404c43=tag[_0x30e6('0x9')](_0x3778c8,{'typecast':!![]});if(_0x404c43[_0x30e6('0xa')]){logger[_0x30e6('0xb')](_0x30e6('0xc'),_0x2656d8,_[_0x30e6('0xd')](_0x404c43,_0x30e6('0xe'))[_0x30e6('0xf')](',\x20'));logger['info'](_0x30e6('0x10'),_0x2656d8);_0x1d3297[_0x30e6('0x11')]();}else{var _0x1172b7={'ids':[_0x3ed82e[0x0]]};if(rpc[_0x2cf19b[_0x30e6('0x12')]+'Interaction']){rpc[_0x2cf19b['channel']+_0x30e6('0x13')][_0x30e6('0x14')](_0x2cf19b[_0x30e6('0x15')]['id'],_0x1172b7)[_0x30e6('0x16')](function(_0x26d30a){logger[_0x30e6('0x17')](_0x30e6('0x18'),_0x2656d8,_0x3ed82e[0x1],_0x2cf19b['channel'],_0x2cf19b[_0x30e6('0x15')]['id']);})['catch'](function(_0x4612fb){logger['error'](_0x30e6('0xc'),_0x2656d8,JSON['stringify'](_0x4612fb));logger[_0x30e6('0x17')](_0x30e6('0x10'),_0x2656d8);})[_0x30e6('0x19')](function(){_0x1d3297['next']();});}}}catch(_0x202fae){logger[_0x30e6('0xb')]('[%s][TAG]\x20%s',_0x2656d8,_[_0x30e6('0x1a')](_0x202fae)?JSON[_0x30e6('0x1b')](_0x202fae):_0x202fae);logger[_0x30e6('0x17')](_0x30e6('0x10'),_0x2656d8);_0x1d3297[_0x30e6('0x11')]();}};}; \ No newline at end of file +var _0x39ce=['validate','lodash','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','length','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject'];(function(_0x1059ef,_0xf146e8){var _0x5f25cf=function(_0x15ac15){while(--_0x15ac15){_0x1059ef['push'](_0x1059ef['shift']());}};_0x5f25cf(++_0xf146e8);}(_0x39ce,0xf0));var _0xe39c=function(_0x5062ff,_0x50953e){_0x5062ff=_0x5062ff-0x0;var _0x525c0c=_0x39ce[_0x5062ff];return _0x525c0c;};'use strict';var schema=require(_0xe39c('0x0'));var _=require(_0xe39c('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe39c('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xe39c('0x3')),'whatsappInteraction':require(_0xe39c('0x4'))};var logger=require(_0xe39c('0x5'))('routing');var tag=schema({'tag':{'type':_0xe39c('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x41b6cd,_0x561be5,_0x519f77,_0x30827d){return function(_0x2ccbdd){try{var _0x4ab335={'tag':_0x561be5[0x0]};var _0x42c26b=tag['validate'](_0x4ab335,{'typecast':!![]});if(_0x42c26b[_0xe39c('0x7')]){logger[_0xe39c('0x8')](_0xe39c('0x9'),_0x41b6cd,_[_0xe39c('0xa')](_0x42c26b,_0xe39c('0xb'))[_0xe39c('0xc')](',\x20'));logger[_0xe39c('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x41b6cd);_0x2ccbdd[_0xe39c('0xe')]();}else{var _0x5a7599={'ids':[_0x561be5[0x0]]};if(rpc[_0x30827d[_0xe39c('0xf')]+_0xe39c('0x10')]){rpc[_0x30827d[_0xe39c('0xf')]+'Interaction'][_0xe39c('0x11')](_0x30827d[_0xe39c('0x12')]['id'],_0x5a7599)['then'](function(_0x276b0f){logger[_0xe39c('0xd')](_0xe39c('0x13'),_0x41b6cd,_0x561be5[0x1],_0x30827d[_0xe39c('0xf')],_0x30827d[_0xe39c('0x12')]['id']);})[_0xe39c('0x14')](function(_0x21e961){logger[_0xe39c('0x8')]('[%s][TAG]\x20%s',_0x41b6cd,JSON[_0xe39c('0x15')](_0x21e961));logger[_0xe39c('0xd')](_0xe39c('0x16'),_0x41b6cd);})['finally'](function(){_0x2ccbdd[_0xe39c('0xe')]();});}}}catch(_0x57638f){logger['error'](_0xe39c('0x9'),_0x41b6cd,_[_0xe39c('0x17')](_0x57638f)?JSON[_0xe39c('0x15')](_0x57638f):_0x57638f);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x41b6cd);_0x2ccbdd[_0xe39c('0xe')]();}};}; \ 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 7e1dcf8..b10c089 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 _0xd731=['next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','push','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next'];(function(_0x2fd04b,_0x5f0d01){var _0xb874aa=function(_0x197e4b){while(--_0x197e4b){_0x2fd04b['push'](_0x2fd04b['shift']());}};_0xb874aa(++_0x5f0d01);}(_0xd731,0x119));var _0x1d73=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd731[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0x1d73('0x0'));var logger=require(_0x1d73('0x1'))(_0x1d73('0x2'));var _=require('lodash');var arr=[];exports[_0x1d73('0x3')]=function(_0x32c287,_0x31004f){return function(_0x29ee8e){var _0x55eda2=_0x31004f[0xa];var _0x39743a=_0x31004f[0xb];var _0xe05f8c=_0x31004f[0xc];var _0x5176ef=_0x31004f[0xd];var _0x314f8c=_0x31004f[0xe];var _0x3bd99a=_0x31004f[0xf][_0x1d73('0x4')](/\n/g,_0x1d73('0x5'));var _0x44121d=_0x31004f[0x10][_0x1d73('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x39743a)){arr[_0x1d73('0x6')](_0x39743a);var _0x4acfe0=_0x31004f[0x3];var _0x1abb39=_0x31004f[0x4];var _0x53f7bc=_0x31004f[0x1];var _0xc1e669=_0x31004f[0x0];var _0x1a18c8={};_0x1a18c8['urlOnAnswer']=_0x31004f[0x8]+_0x1d73('0x7')+_0xe05f8c+'|'+_0x55eda2+'|'+_0x5176ef+'|'+_0x39743a+'|'+_0x314f8c;_0x1a18c8[_0x1d73('0x8')]=_0x31004f[0x7]+'?params='+_0xe05f8c+'|'+_0x55eda2+'|'+_0x5176ef+'|'+_0x39743a+'|'+_0x314f8c+'|'+_0x3bd99a+'|'+_0x44121d;_0x1a18c8[_0x1d73('0x9')]=_0x31004f[0x9];var _0x4da21a={};_0x4da21a[_0x1d73('0xa')]=_0x1d73('0xb');_0x4da21a[_0x1d73('0xc')]=_0x1d73('0xd');var _0x46d0a7=[];_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x2]);_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x5]);_0x46d0a7[_0x1d73('0x6')](_0x31004f[0x6]);_0x4da21a[_0x1d73('0xe')]=_0x46d0a7;_0x4da21a['id']=0x1;var _0x1c9f40=JSON[_0x1d73('0xf')](_0x4da21a);var _0x138b68={'encoding':_0x1d73('0x10'),'method':_0x1d73('0x11'),'timeout':0x2710,'url':_0x4acfe0,'headers':{'Content-Type':_0x1d73('0x12')},'body':_0x1c9f40};return rp(_0x138b68)[_0x1d73('0x13')](function(_0x368dc9){const _0x12bd64=JSON[_0x1d73('0x14')](_0x368dc9);if(!_0x12bd64[_0x1d73('0x15')]['logged']){throw new Error(_0x1d73('0x16'));}var _0xb5bb6f=_0x39743a;var _0x4afad6=_0x1d73('0x17')+_0x53f7bc+_0x1d73('0x18')+_0xc1e669+_0x1d73('0x19')+_0xb5bb6f+_0x1d73('0x1a')+JSON[_0x1d73('0xf')](_0x1a18c8);var _0x167c37=_0x1abb39+'?'+_0x4afad6;return rp(_0x167c37);})[_0x1d73('0x13')](function(_0x1d3154){logger[_0x1d73('0x1b')](_0x1d73('0x1c'),_0x32c287,_0x1d3154);_0x29ee8e[_0x1d73('0x1d')]();})[_0x1d73('0x1e')](function(_0x5bc895){logger[_0x1d73('0x1f')](_0x1d73('0x20'),_0x32c287,_['isObject'](_0x5bc895)?JSON[_0x1d73('0xf')](_0x5bc895):_0x5bc895);_0x29ee8e['stop']();});}else{logger[_0x1d73('0x1b')](_0x1d73('0x21'),_0x32c287);_0x29ee8e[_0x1d73('0x22')]();}};}; \ No newline at end of file +var _0xec28=['\x20-\x20','push','urlOnAnswer','urlOnRing','?params=','title','2.0','method','login','params','stringify','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','replace'];(function(_0x1a0a13,_0x4ddd60){var _0x1c368f=function(_0x30c169){while(--_0x30c169){_0x1a0a13['push'](_0x1a0a13['shift']());}};_0x1c368f(++_0x4ddd60);}(_0xec28,0x1c9));var _0x8ec2=function(_0x2f0162,_0x561c38){_0x2f0162=_0x2f0162-0x0;var _0x4becec=_0xec28[_0x2f0162];return _0x4becec;};'use strict';var rp=require(_0x8ec2('0x0'));var logger=require(_0x8ec2('0x1'))(_0x8ec2('0x2'));var _=require(_0x8ec2('0x3'));var arr=[];exports['consequence']=function(_0xee4159,_0x468071){return function(_0x17192c){var _0x2e05e0=_0x468071[0xa];var _0xef7763=_0x468071[0xb];var _0x4f3e57=_0x468071[0xc];var _0xc12311=_0x468071[0xd];var _0x77282=_0x468071[0xe];var _0x31e416=_0x468071[0xf][_0x8ec2('0x4')](/\n/g,_0x8ec2('0x5'));var _0x179d46=_0x468071[0x10][_0x8ec2('0x4')](/\n/g,'\x20');if(!arr['includes'](_0xef7763)){arr[_0x8ec2('0x6')](_0xef7763);var _0x2224df=_0x468071[0x3];var _0x86161a=_0x468071[0x4];var _0x54bd0f=_0x468071[0x1];var _0x2b05d7=_0x468071[0x0];var _0x29cdfa={};_0x29cdfa[_0x8ec2('0x7')]=_0x468071[0x8]+'?params='+_0x4f3e57+'|'+_0x2e05e0+'|'+_0xc12311+'|'+_0xef7763+'|'+_0x77282;_0x29cdfa[_0x8ec2('0x8')]=_0x468071[0x7]+_0x8ec2('0x9')+_0x4f3e57+'|'+_0x2e05e0+'|'+_0xc12311+'|'+_0xef7763+'|'+_0x77282+'|'+_0x31e416+'|'+_0x179d46;_0x29cdfa[_0x8ec2('0xa')]=_0x468071[0x9];var _0x2d7fd5={};_0x2d7fd5['jsonrpc']=_0x8ec2('0xb');_0x2d7fd5[_0x8ec2('0xc')]=_0x8ec2('0xd');var _0x523907=[];_0x523907[_0x8ec2('0x6')](_0x468071[0x2]);_0x523907[_0x8ec2('0x6')](_0x468071[0x5]);_0x523907[_0x8ec2('0x6')](_0x468071[0x6]);_0x2d7fd5[_0x8ec2('0xe')]=_0x523907;_0x2d7fd5['id']=0x1;var _0x4adf0c=JSON[_0x8ec2('0xf')](_0x2d7fd5);var _0x3e6d0b={'encoding':'utf8','method':_0x8ec2('0x10'),'timeout':0x2710,'url':_0x2224df,'headers':{'Content-Type':'application/json-rpc'},'body':_0x4adf0c};return rp(_0x3e6d0b)[_0x8ec2('0x11')](function(_0x59dbe9){const _0x339fa3=JSON[_0x8ec2('0x12')](_0x59dbe9);if(!_0x339fa3[_0x8ec2('0x13')][_0x8ec2('0x14')]){throw new Error(_0x8ec2('0x15'));}var _0x1b0c02=_0xef7763;var _0x5f173f=_0x8ec2('0x16')+_0x54bd0f+_0x8ec2('0x17')+_0x2b05d7+_0x8ec2('0x18')+_0x1b0c02+'&data='+JSON[_0x8ec2('0xf')](_0x29cdfa);var _0x3df986=_0x86161a+'?'+_0x5f173f;return rp(_0x3df986);})[_0x8ec2('0x11')](function(_0x4b8c3b){logger['info'](_0x8ec2('0x19'),_0xee4159,_0x4b8c3b);_0x17192c[_0x8ec2('0x1a')]();})[_0x8ec2('0x1b')](function(_0x53febb){logger[_0x8ec2('0x1c')](_0x8ec2('0x1d'),_0xee4159,_[_0x8ec2('0x1e')](_0x53febb)?JSON['stringify'](_0x53febb):_0x53febb);_0x17192c[_0x8ec2('0x1a')]();});}else{logger['info'](_0x8ec2('0x1f'),_0xee4159);_0x17192c[_0x8ec2('0x20')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index ad5817a..0ad6076 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5a20b9,_0x4fe20b){var _0x2aed1a=function(_0x5ad501){while(--_0x5ad501){_0x5a20b9['push'](_0x5a20b9['shift']());}};_0x2aed1a(++_0x4fe20b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xd141d8,_0x4c10f7){var _0x592294=function(_0x1da572){while(--_0x1da572){_0xd141d8['push'](_0xd141d8['shift']());}};_0x592294(++_0x4c10f7);}(_0xe706,0xa3));var _0x6e70=function(_0x3c3b51,_0xe90b55){_0x3c3b51=_0x3c3b51-0x0;var _0x303246=_0xe706[_0x3c3b51];return _0x303246;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 6141212..e4b0722 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 _0xaa96=['matchPath','emit','complete','stack','routing\x20is\x20empty','agents','agent','busyQueue','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account','ChatWebsiteId','ContactId','body','./interval','intervals','consequence','Push\x20new\x20rule','\x20|\x20','error','stringify'];(function(_0x4f33a6,_0x1276be){var _0x38ce14=function(_0x562606){while(--_0x562606){_0x4f33a6['push'](_0x4f33a6['shift']());}};_0x38ce14(++_0x1276be);}(_0xaa96,0x143));var _0x6aa9=function(_0x3af319,_0x16ab42){_0x3af319=_0x3af319-0x0;var _0x11f801=_0xaa96[_0x3af319];return _0x11f801;};'use strict';var _=require(_0x6aa9('0x0'));var util=require(_0x6aa9('0x1'));var path=require(_0x6aa9('0x2'));var fs=require('fs');var jayson=require(_0x6aa9('0x3'));var BPromise=require(_0x6aa9('0x4'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0x6aa9('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x6aa9('0x6')),'mailQueueReport':require(_0x6aa9('0x7')),'chatQueueReport':require(_0x6aa9('0x8')),'smsQueueReport':require(_0x6aa9('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x6aa9('0xa'))};var RuleEngine=require(_0x6aa9('0xb'));function getId(_0xa10fd5,_0x12862f,_0x89a823){return util[_0x6aa9('0xc')](_0x6aa9('0xd'),_0xa10fd5,_0x12862f||0x0,_0x89a823||0x0);}function getIntervals(_0x4393bd,_0x38d195){var _0x18989c=[];if(!_[_0x6aa9('0xe')](_0x38d195[_0x6aa9('0xf')])&&!_[_0x6aa9('0xe')](_0x4393bd[_0x38d195[_0x6aa9('0xf')]])&&!_['isNil'](_0x4393bd[_0x38d195['IntervalId']][_0x6aa9('0x10')])){_0x18989c=_[_0x6aa9('0x11')](_0x4393bd[_0x38d195['IntervalId']][_0x6aa9('0x10')],_0x6aa9('0x12'));}else if(!_['isNil'](_0x38d195['interval'])){_0x18989c=[_0x38d195[_0x6aa9('0x12')]];}return _0x18989c;}exports['listen']=function(_0x3d992d){_0x3d992d[_0x6aa9('0x13')]={};return new BPromise(function(_0x2add71,_0x5bc2d3){var _0x27523e={'Start':function(_0x87d6b){var _0x258922=this;return new Promise(function(_0x266d49,_0x4e8cf8){if(_0x87d6b){try{var _0x32ca2d=[];var _0xd35b65=getId(_0x87d6b[_0x6aa9('0x14')],_0x87d6b[_0x6aa9('0x15')]?_0x87d6b[_0x6aa9('0x15')]['id']:0x0,_0x87d6b['interaction']?_0x87d6b[_0x6aa9('0x16')]['id']:0x0);var _0x89e8a2=sUtils[_0x6aa9('0x17')](_0x3d992d,_0x87d6b);if(!_0x89e8a2&&_0x87d6b['applications']&&_[_0x6aa9('0x18')](_0x87d6b[_0x6aa9('0x19')])&&_0x87d6b[_0x6aa9('0x19')][_0x6aa9('0x1a')]){for(var _0x45ac88=0x0;_0x45ac88<_0x87d6b[_0x6aa9('0x19')][_0x6aa9('0x1a')];_0x45ac88+=0x1){var _0x3ea692=_0x87d6b[_0x6aa9('0x19')][_0x45ac88];if(fs[_0x6aa9('0x1b')](path[_0x6aa9('0x1c')](__dirname,_0x6aa9('0x19'),_0x3ea692[_0x6aa9('0x1d')]+_0x6aa9('0x1e')))){var _0x37bf43=[];switch(_0x3ea692[_0x6aa9('0x1d')][_0x6aa9('0x1f')]()){case'autoreply':var _0x28f242=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');if(_0x87d6b['channel']===_0x6aa9('0x22')){_0x37bf43[_0x6aa9('0x23')](_0x28f242[0x0]);_0x37bf43['push'](_0x28f242[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x28f242[_0x6aa9('0x24')](0x2,_0x28f242[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));}else{_0x37bf43[_0x6aa9('0x23')](_0x28f242[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x28f242['slice'](0x1,_0x28f242[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));}break;case'dialogflow':var _0x407a81=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');_0x37bf43[_0x6aa9('0x23')](_0x407a81[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x407a81[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x407a81[_0x6aa9('0x24')](0x2,_0x407a81[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case _0x6aa9('0x25'):var _0x103603=_0x3ea692['appdata'][_0x6aa9('0x21')](',');_0x37bf43['push'](_0x103603[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x103603[0x3]);_0x37bf43[_0x6aa9('0x23')](_0x103603['slice'](0x4,_0x103603[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case _0x6aa9('0x26'):var _0x472074=_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');_0x37bf43[_0x6aa9('0x23')](_0x472074[0x0]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x472074[0x3]);_0x37bf43[_0x6aa9('0x23')](_0x472074[_0x6aa9('0x24')](0x4,_0x472074[_0x6aa9('0x1a')])[_0x6aa9('0x1c')](','));break;case'message':_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x20')]);break;case _0x6aa9('0x27'):_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x28')]);_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x20')]);break;case _0x6aa9('0x29'):var _0x145424=utils['getMustacheRender'](_0x87d6b[_0x6aa9('0x2a')]['notificationTemplate'],_0x87d6b);var _0x512828=_0x3ea692[_0x6aa9('0x20')]['split'](',');_0x37bf43[_0x6aa9('0x23')](_0x512828[0x0]);_0x37bf43['push'](_0x512828[0x1]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x2]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x3]);_0x37bf43['push'](_0x512828[0x4]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x5]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x6]);_0x37bf43['push'](_0x512828[0x7]);_0x37bf43[_0x6aa9('0x23')](_0x512828[0x8]);_0x37bf43['push'](_0x512828[0x9]);_0x37bf43['push'](_0x512828[0xa]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x16')]['id']);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x15')]['id']);_0x37bf43[_0x6aa9('0x23')](_0x3ea692[_0x6aa9('0x2b')]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x16')][_0x6aa9('0x2c')]);_0x37bf43[_0x6aa9('0x23')](_0x87d6b[_0x6aa9('0x2d')][_0x6aa9('0x2d')]);_0x37bf43[_0x6aa9('0x23')](_0x145424);break;default:_0x37bf43=_[_0x6aa9('0xe')](_0x3ea692[_0x6aa9('0x20')])?[]:_0x3ea692[_0x6aa9('0x20')][_0x6aa9('0x21')](',');}var _0x48b8e0={'id':util['format']('%s:%s:%s',_0xd35b65,_0x3ea692['id'],_0x3ea692[_0x6aa9('0x1d')]),'condition':require(_0x6aa9('0x2e'))['condition'](_0xd35b65,getIntervals(_0x3d992d[_0x6aa9('0x2f')],_0x3ea692),_0x3d992d),'consequence':require('./applications/'+_0x3ea692[_0x6aa9('0x1d')])[_0x6aa9('0x30')](_0xd35b65,_0x37bf43,_0x3d992d,_0x87d6b),'p':_0x3ea692['priority']||0x0};logger['info'](_0x6aa9('0x31'),_0x48b8e0['id'],'on\x20interval',getIntervals(_0x3d992d[_0x6aa9('0x2f')],_0x3ea692)[_0x6aa9('0x1c')](_0x6aa9('0x32')));_0x32ca2d['push'](_0x48b8e0);}else{logger[_0x6aa9('0x33')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x6aa9('0x1c')](__dirname,_0x6aa9('0x19'),_0x3ea692['app']+_0x6aa9('0x1e')));}}_0x3d992d['rules'][_0xd35b65]=new RuleEngine(_0x32ca2d);_0x3d992d[_0x6aa9('0x13')][_0xd35b65]['execute'](_0x87d6b,function(_0x5ea020){logger['info']('Applications\x20executed',JSON[_0x6aa9('0x34')](_0x5ea020[_0x6aa9('0x35')]));if(_0x3d992d['rules'][_0xd35b65]){_0x3d992d['rules'][_0xd35b65][_0x6aa9('0x36')](_0x6aa9('0x37'));}});return _0x266d49({'code':0xc8,'message':_0x87d6b});}else{if(_0x89e8a2){logger['info'](util[_0x6aa9('0xc')]('Skipped\x20routing\x20for\x20%s',_0xd35b65));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x266d49({'code':0xc8,'message':_0x87d6b});}}catch(_0x847e9f){logger[_0x6aa9('0x33')](_0x847e9f[_0x6aa9('0x38')]);return _0x4e8cf8(_0x258922[_0x6aa9('0x33')](0x1f4,_0x847e9f));}}return _0x4e8cf8(_0x6aa9('0x39'));});},'AcceptMessage':function(_0x188739){var _0x169c46=this;return new Promise(function(_0xda892,_0x4a9212){if(_0x188739['agent']&&_0x188739['agent']['id']){if(_0x3d992d[_0x6aa9('0x3a')][_0x188739[_0x6aa9('0x3b')]['id']]){_0x3d992d[_0x6aa9('0x3a')][_0x188739['agent']['id']]['busy']=![];_0x3d992d[_0x6aa9('0x3a')][_0x188739['agent']['id']][_0x6aa9('0x3c')]=undefined;}}if(_0x188739['message']&&_0x188739[_0x6aa9('0x15')]['id']){try{var _0x26936f=getId(_0x188739[_0x6aa9('0x14')],_0x188739[_0x6aa9('0x15')]?_0x188739[_0x6aa9('0x15')]['id']:0x0,_0x188739[_0x6aa9('0x16')]?_0x188739['interaction']['id']:0x0);if(_0x3d992d[_0x6aa9('0x13')][_0x26936f]){_0x3d992d[_0x6aa9('0x13')][_0x26936f][_0x6aa9('0x36')]('end');if(rpc[_0x188739['channel']+_0x6aa9('0x3d')]){rpc[_0x188739[_0x6aa9('0x14')]+'QueueReport'][_0x6aa9('0x3e')](_0x26936f,{'UserId':_0x188739[_0x6aa9('0x15')]['UserId']})[_0x6aa9('0x3f')](function(){logger['error'](_0x6aa9('0x40'));});}}return _0xda892({'code':0xc8,'message':_0x188739});}catch(_0x1ee150){logger[_0x6aa9('0x33')](_0x1ee150[_0x6aa9('0x38')]);return _0x4a9212(_0x169c46[_0x6aa9('0x33')](0x1f4,_0x1ee150));}}logger[_0x6aa9('0x33')]('message\x20is\x20empty');return _0x4a9212(_0x169c46['error'](0x1f4,_0x6aa9('0x41')));});},'RejectMessage':function(_0x58757d){var _0x1d96f0=this;return new Promise(function(_0x532634,_0x2fb696){if(_0x58757d['agent']&&_0x58757d[_0x6aa9('0x3b')]['id']){try{if(_0x3d992d[_0x6aa9('0x3a')][_0x58757d[_0x6aa9('0x3b')]['id']]){_0x3d992d[_0x6aa9('0x3a')][_0x58757d['agent']['id']][_0x6aa9('0x42')]=![];_0x3d992d['agents'][_0x58757d[_0x6aa9('0x3b')]['id']][_0x6aa9('0x3c')]=undefined;}return _0x532634({'code':0xc8,'message':_0x58757d});}catch(_0x2e689d){logger[_0x6aa9('0x33')](_0x2e689d['stack']);return _0x2fb696(_0x1d96f0[_0x6aa9('0x33')](0x1f4,_0x2e689d));}}logger['error'](_0x6aa9('0x41'));return _0x2fb696(_0x1d96f0[_0x6aa9('0x33')](0x1f4,_0x6aa9('0x41')));});},'AbandonInteraction':function(_0x41caf5){var _0x2660d5=this;return new Promise(function(_0x7bc679,_0x3d9f2f){if(_0x41caf5[_0x6aa9('0x14')]&&_0x41caf5[_0x6aa9('0x16')]&&_0x41caf5[_0x6aa9('0x16')]['id']){try{var _0x42dd16=getId(_0x41caf5[_0x6aa9('0x14')],_0x41caf5[_0x6aa9('0x15')]?_0x41caf5[_0x6aa9('0x15')]['id']:0x0,_0x41caf5[_0x6aa9('0x16')]?_0x41caf5[_0x6aa9('0x16')]['id']:0x0);if(_0x3d992d['rules'][_0x42dd16]){_0x3d992d[_0x6aa9('0x13')][_0x42dd16][_0x6aa9('0x36')](_0x6aa9('0x43'));}return _0x7bc679({'code':0xc8,'message':_0x41caf5});}catch(_0x5a3080){logger['error'](_0x5a3080[_0x6aa9('0x38')]);return _0x3d9f2f(_0x2660d5[_0x6aa9('0x33')](0x1f4,_0x5a3080));}}logger[_0x6aa9('0x33')](_0x6aa9('0x41'));return _0x3d9f2f(_0x2660d5[_0x6aa9('0x33')](0x1f4,_0x6aa9('0x41')));});},'AgentCapacity':function(_0x10c3d4){var _0x16a84a=this;return new Promise(function(_0x3eb592,_0x4ccbf0){if(_0x3d992d[_0x6aa9('0x3a')]['hasOwnProperty'](_0x10c3d4['id'])){for(var _0xba2366 in _0x10c3d4['capacity']){if(_0x10c3d4[_0x6aa9('0x44')][_0x6aa9('0x45')](_0xba2366)){if(_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']][_0x6aa9('0x45')](_0xba2366+'CurrentCapacity')){_0x3d992d['agents'][_0x10c3d4['id']][_0xba2366+_0x6aa9('0x46')]=parseInt(_0x10c3d4['capacity'][_0xba2366],0xa);}}}_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']][_0x6aa9('0x47')]();return _0x3eb592({'code':0xc8,'message':_0x3d992d[_0x6aa9('0x3a')][_0x10c3d4['id']]});}else{return _0x4ccbf0(_0x16a84a['error'](0x1f4,_0x6aa9('0x48')));}});},'Agents':function(_0x36ffab){return new Promise(function(_0x121c65){var _0x22d4c2=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x3a')]);if(_0x36ffab&&_0x36ffab['id']){var _0x11e092=_[_0x6aa9('0x4a')](_0x22d4c2,function(_0x5173b6){return _0x5173b6['id']===_0x36ffab['id'];});_0x121c65(_0x11e092);}else{_0x121c65({'count':_0x22d4c2[_0x6aa9('0x1a')],'rows':_0x22d4c2});}});},'ChatQueues':function(){return new Promise(function(_0x467606){var _0x58a1dd=[];for(var _0x5d484d in _0x3d992d[_0x6aa9('0x4b')]){if(_0x3d992d['chatQueues']['hasOwnProperty'](_0x5d484d)){var _0x114431=_0x3d992d[_0x6aa9('0x4b')][_0x5d484d];var _0xe6ceca={'id':_0x114431['id'],'available':_0x114431[_0x6aa9('0x4c')],'loggedIn':_0x114431[_0x6aa9('0x4d')],'name':_0x114431['name'],'paused':_0x114431[_0x6aa9('0x4e')],'waiting':_0x114431[_0x6aa9('0x4f')]};_0x58a1dd[_0x6aa9('0x23')](_0xe6ceca);}}_0x467606({'count':_0x58a1dd[_0x6aa9('0x1a')],'rows':_0x58a1dd});});},'MailQueues':function(){return new Promise(function(_0x4cff6d){var _0x5e48c5=[];for(var _0x141292 in _0x3d992d['mailQueues']){if(_0x3d992d[_0x6aa9('0x50')]['hasOwnProperty'](_0x141292)){var _0x10402c=_0x3d992d['mailQueues'][_0x141292];var _0x2505cf={'id':_0x10402c['id'],'available':_0x10402c[_0x6aa9('0x4c')],'loggedIn':_0x10402c[_0x6aa9('0x4d')],'name':_0x10402c[_0x6aa9('0x51')],'paused':_0x10402c[_0x6aa9('0x4e')],'waiting':_0x10402c['waiting']};_0x5e48c5[_0x6aa9('0x23')](_0x2505cf);}}_0x4cff6d({'count':_0x5e48c5[_0x6aa9('0x1a')],'rows':_0x5e48c5});});},'OpenchannelQueues':function(){return new Promise(function(_0x2da6ce){var _0x14056b=[];for(var _0x271df7 in _0x3d992d[_0x6aa9('0x52')]){if(_0x3d992d[_0x6aa9('0x52')][_0x6aa9('0x45')](_0x271df7)){var _0x4fc0ae=_0x3d992d[_0x6aa9('0x52')][_0x271df7];var _0x5ba94e={'id':_0x4fc0ae['id'],'available':_0x4fc0ae[_0x6aa9('0x4c')],'loggedIn':_0x4fc0ae[_0x6aa9('0x4d')],'name':_0x4fc0ae['name'],'paused':_0x4fc0ae[_0x6aa9('0x4e')],'waiting':_0x4fc0ae[_0x6aa9('0x4f')]};_0x14056b[_0x6aa9('0x23')](_0x5ba94e);}}_0x2da6ce({'count':_0x14056b['length'],'rows':_0x14056b});});},'SmsQueues':function(){return new Promise(function(_0x3b7066){var _0xba60b7=[];for(var _0x4165ea in _0x3d992d['smsQueues']){if(_0x3d992d[_0x6aa9('0x53')][_0x6aa9('0x45')](_0x4165ea)){var _0x481897=_0x3d992d['smsQueues'][_0x4165ea];var _0xd57e7c={'id':_0x481897['id'],'available':_0x481897[_0x6aa9('0x4c')],'loggedIn':_0x481897[_0x6aa9('0x4d')],'name':_0x481897[_0x6aa9('0x51')],'paused':_0x481897[_0x6aa9('0x4e')],'waiting':_0x481897[_0x6aa9('0x4f')]};_0xba60b7[_0x6aa9('0x23')](_0xd57e7c);}}_0x3b7066({'count':_0xba60b7['length'],'rows':_0xba60b7});});},'FaxQueues':function(){return new Promise(function(_0x26fddc){var _0x9ec8c1=[];for(var _0x1227a1 in _0x3d992d[_0x6aa9('0x54')]){if(_0x3d992d[_0x6aa9('0x54')][_0x6aa9('0x45')](_0x1227a1)){var _0x300c2e=_0x3d992d[_0x6aa9('0x54')][_0x1227a1];var _0x10a30a={'id':_0x300c2e['id'],'available':_0x300c2e[_0x6aa9('0x4c')],'loggedIn':_0x300c2e[_0x6aa9('0x4d')],'name':_0x300c2e[_0x6aa9('0x51')],'paused':_0x300c2e[_0x6aa9('0x4e')],'waiting':_0x300c2e[_0x6aa9('0x4f')]};_0x9ec8c1[_0x6aa9('0x23')](_0x10a30a);}}_0x26fddc({'count':_0x9ec8c1[_0x6aa9('0x1a')],'rows':_0x9ec8c1});});},'WhatsappQueues':function(){return new Promise(function(_0x55c3b7){var _0x645f43=[];for(var _0x396b22 in _0x3d992d[_0x6aa9('0x55')]){if(_0x3d992d[_0x6aa9('0x55')][_0x6aa9('0x45')](_0x396b22)){var _0x44d66d=_0x3d992d['whatsappQueues'][_0x396b22];var _0x1e6bc6={'id':_0x44d66d['id'],'available':_0x44d66d['available'],'loggedIn':_0x44d66d[_0x6aa9('0x4d')],'name':_0x44d66d[_0x6aa9('0x51')],'paused':_0x44d66d[_0x6aa9('0x4e')],'waiting':_0x44d66d[_0x6aa9('0x4f')]};_0x645f43[_0x6aa9('0x23')](_0x1e6bc6);}}_0x55c3b7({'count':_0x645f43[_0x6aa9('0x1a')],'rows':_0x645f43});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x15d0a3){var _0x1188fd=_[_0x6aa9('0x49')](_0x3d992d['chatQueuesWaitingInteractions']);_0x15d0a3({'count':_0x1188fd['length'],'rows':_0x1188fd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4fb538){var _0x4aa11f=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x56')]);_0x4fb538({'count':_0x4aa11f[_0x6aa9('0x1a')],'rows':_0x4aa11f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x32cc4f){var _0x29b50e=_['values'](_0x3d992d['openchannelQueuesWaitingInteractions']);_0x32cc4f({'count':_0x29b50e['length'],'rows':_0x29b50e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3a9ce7){var _0x1a6cc1=_[_0x6aa9('0x49')](_0x3d992d[_0x6aa9('0x57')]);_0x3a9ce7({'count':_0x1a6cc1['length'],'rows':_0x1a6cc1});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2c4e1c){var _0x32cf4f=_['values'](_0x3d992d['faxQueuesWaitingInteractions']);_0x2c4e1c({'count':_0x32cf4f[_0x6aa9('0x1a')],'rows':_0x32cf4f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x244806){var _0x4339ff=_['values'](_0x3d992d[_0x6aa9('0x58')]);_0x244806({'count':_0x4339ff[_0x6aa9('0x1a')],'rows':_0x4339ff});});}};var _0x1acc98=jayson[_0x6aa9('0x59')](_0x27523e)['http']();_0x1acc98['on'](_0x6aa9('0x33'),function(_0x40ac31){logger['error'](JSON['stringify'](_0x40ac31));return _0x5bc2d3(_0x40ac31);});_0x1acc98[_0x6aa9('0x5a')](0x232c,_0x6aa9('0x5b'),function(){console[_0x6aa9('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2add71(_0x6aa9('0x5d')+0x232c);});});}; \ No newline at end of file +var _0x1fbf=['push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','stack','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','map','Intervals','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','mail'];(function(_0x2fa506,_0x244065){var _0x24c103=function(_0x312a54){while(--_0x312a54){_0x2fa506['push'](_0x2fa506['shift']());}};_0x24c103(++_0x244065);}(_0x1fbf,0x101));var _0xf1fb=function(_0x61bba8,_0x1b5654){_0x61bba8=_0x61bba8-0x0;var _0x3ee484=_0x1fbf[_0x61bba8];return _0x3ee484;};'use strict';var _=require(_0xf1fb('0x0'));var util=require(_0xf1fb('0x1'));var path=require(_0xf1fb('0x2'));var fs=require('fs');var jayson=require(_0xf1fb('0x3'));var BPromise=require('bluebird');var utils=require(_0xf1fb('0x4'));var sUtils=require(_0xf1fb('0x5'));var logger=require(_0xf1fb('0x6'))(_0xf1fb('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xf1fb('0x8')),'chatQueueReport':require(_0xf1fb('0x9')),'smsQueueReport':require(_0xf1fb('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf1fb('0xb'))};var RuleEngine=require(_0xf1fb('0xc'));function getId(_0x446580,_0x468b8a,_0x20b351){return util[_0xf1fb('0xd')]('%s.%s.%s',_0x446580,_0x468b8a||0x0,_0x20b351||0x0);}function getIntervals(_0x2249ff,_0x4fa229){var _0x1b22f1=[];if(!_[_0xf1fb('0xe')](_0x4fa229[_0xf1fb('0xf')])&&!_['isNil'](_0x2249ff[_0x4fa229[_0xf1fb('0xf')]])&&!_['isNil'](_0x2249ff[_0x4fa229['IntervalId']]['Intervals'])){_0x1b22f1=_[_0xf1fb('0x10')](_0x2249ff[_0x4fa229[_0xf1fb('0xf')]][_0xf1fb('0x11')],_0xf1fb('0x12'));}else if(!_['isNil'](_0x4fa229[_0xf1fb('0x12')])){_0x1b22f1=[_0x4fa229[_0xf1fb('0x12')]];}return _0x1b22f1;}exports[_0xf1fb('0x13')]=function(_0x2e7a08){_0x2e7a08['rules']={};return new BPromise(function(_0x1137c9,_0x42a04f){var _0x521e77={'Start':function(_0x1a7fa3){var _0x2d6174=this;return new Promise(function(_0xac4775,_0x424279){if(_0x1a7fa3){try{var _0x20f99b=[];var _0x19d4fa=getId(_0x1a7fa3[_0xf1fb('0x14')],_0x1a7fa3[_0xf1fb('0x15')]?_0x1a7fa3[_0xf1fb('0x15')]['id']:0x0,_0x1a7fa3[_0xf1fb('0x16')]?_0x1a7fa3[_0xf1fb('0x16')]['id']:0x0);var _0x4a31bb=sUtils['checkWaitingNotifications'](_0x2e7a08,_0x1a7fa3);if(!_0x4a31bb&&_0x1a7fa3[_0xf1fb('0x17')]&&_[_0xf1fb('0x18')](_0x1a7fa3[_0xf1fb('0x17')])&&_0x1a7fa3[_0xf1fb('0x17')][_0xf1fb('0x19')]){for(var _0x18f7ba=0x0;_0x18f7ba<_0x1a7fa3[_0xf1fb('0x17')][_0xf1fb('0x19')];_0x18f7ba+=0x1){var _0x2498d0=_0x1a7fa3[_0xf1fb('0x17')][_0x18f7ba];if(fs[_0xf1fb('0x1a')](path[_0xf1fb('0x1b')](__dirname,_0xf1fb('0x17'),_0x2498d0[_0xf1fb('0x1c')]+_0xf1fb('0x1d')))){var _0x4db9e3=[];switch(_0x2498d0[_0xf1fb('0x1c')]['toLowerCase']()){case _0xf1fb('0x1e'):var _0x5ee14c=_0x2498d0[_0xf1fb('0x1f')][_0xf1fb('0x20')](',');if(_0x1a7fa3[_0xf1fb('0x14')]===_0xf1fb('0x21')){_0x4db9e3[_0xf1fb('0x22')](_0x5ee14c[0x0]);_0x4db9e3[_0xf1fb('0x22')](_0x5ee14c[0x1]);_0x4db9e3[_0xf1fb('0x22')](_0x5ee14c['slice'](0x2,_0x5ee14c[_0xf1fb('0x19')])[_0xf1fb('0x1b')](','));}else{_0x4db9e3[_0xf1fb('0x22')](_0x5ee14c[0x0]);_0x4db9e3[_0xf1fb('0x22')](_0x5ee14c[_0xf1fb('0x23')](0x1,_0x5ee14c[_0xf1fb('0x19')])[_0xf1fb('0x1b')](','));}break;case _0xf1fb('0x24'):var _0x2994fe=_0x2498d0[_0xf1fb('0x1f')][_0xf1fb('0x20')](',');_0x4db9e3[_0xf1fb('0x22')](_0x2994fe[0x0]);_0x4db9e3[_0xf1fb('0x22')](_0x2994fe[0x1]);_0x4db9e3[_0xf1fb('0x22')](_0x2994fe[_0xf1fb('0x23')](0x2,_0x2994fe[_0xf1fb('0x19')])[_0xf1fb('0x1b')](','));break;case'dialogflowv2':var _0x271748=_0x2498d0['appdata'][_0xf1fb('0x20')](',');_0x4db9e3[_0xf1fb('0x22')](_0x271748[0x0]);_0x4db9e3[_0xf1fb('0x22')](_0x271748[0x1]);_0x4db9e3[_0xf1fb('0x22')](_0x271748[0x2]);_0x4db9e3[_0xf1fb('0x22')](_0x271748[0x3]);_0x4db9e3[_0xf1fb('0x22')](_0x271748[_0xf1fb('0x23')](0x4,_0x271748[_0xf1fb('0x19')])[_0xf1fb('0x1b')](','));break;case _0xf1fb('0x25'):var _0x3d8b3b=_0x2498d0[_0xf1fb('0x1f')]['split'](',');_0x4db9e3['push'](_0x3d8b3b[0x0]);_0x4db9e3[_0xf1fb('0x22')](_0x3d8b3b[0x1]);_0x4db9e3[_0xf1fb('0x22')](_0x3d8b3b[0x2]);_0x4db9e3[_0xf1fb('0x22')](_0x3d8b3b[0x3]);_0x4db9e3[_0xf1fb('0x22')](_0x3d8b3b[_0xf1fb('0x23')](0x4,_0x3d8b3b[_0xf1fb('0x19')])[_0xf1fb('0x1b')](','));break;case _0xf1fb('0x15'):_0x4db9e3[_0xf1fb('0x22')](_0x2498d0['appdata']);break;case _0xf1fb('0x26'):_0x4db9e3[_0xf1fb('0x22')](_0x2498d0[_0xf1fb('0x27')]);_0x4db9e3[_0xf1fb('0x22')](_0x2498d0[_0xf1fb('0x1f')]);break;case _0xf1fb('0x28'):var _0x23b125=utils[_0xf1fb('0x29')](_0x1a7fa3[_0xf1fb('0x2a')]['notificationTemplate'],_0x1a7fa3);var _0x324129=_0x2498d0[_0xf1fb('0x1f')]['split'](',');_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x0]);_0x4db9e3['push'](_0x324129[0x1]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x2]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x3]);_0x4db9e3['push'](_0x324129[0x4]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x5]);_0x4db9e3['push'](_0x324129[0x6]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x7]);_0x4db9e3['push'](_0x324129[0x8]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0x9]);_0x4db9e3[_0xf1fb('0x22')](_0x324129[0xa]);_0x4db9e3['push'](_0x1a7fa3[_0xf1fb('0x16')]['id']);_0x4db9e3[_0xf1fb('0x22')](_0x1a7fa3[_0xf1fb('0x15')]['id']);_0x4db9e3[_0xf1fb('0x22')](_0x2498d0[_0xf1fb('0x2b')]);_0x4db9e3[_0xf1fb('0x22')](_0x1a7fa3[_0xf1fb('0x16')][_0xf1fb('0x2c')]);_0x4db9e3[_0xf1fb('0x22')](_0x1a7fa3[_0xf1fb('0x2d')][_0xf1fb('0x2d')]);_0x4db9e3[_0xf1fb('0x22')](_0x23b125);break;default:_0x4db9e3=_['isNil'](_0x2498d0['appdata'])?[]:_0x2498d0[_0xf1fb('0x1f')][_0xf1fb('0x20')](',');}var _0x89a885={'id':util[_0xf1fb('0xd')](_0xf1fb('0x2e'),_0x19d4fa,_0x2498d0['id'],_0x2498d0[_0xf1fb('0x1c')]),'condition':require('./interval')[_0xf1fb('0x2f')](_0x19d4fa,getIntervals(_0x2e7a08[_0xf1fb('0x30')],_0x2498d0),_0x2e7a08),'consequence':require(_0xf1fb('0x31')+_0x2498d0[_0xf1fb('0x1c')])[_0xf1fb('0x32')](_0x19d4fa,_0x4db9e3,_0x2e7a08,_0x1a7fa3),'p':_0x2498d0[_0xf1fb('0x33')]||0x0};logger[_0xf1fb('0x34')](_0xf1fb('0x35'),_0x89a885['id'],'on\x20interval',getIntervals(_0x2e7a08[_0xf1fb('0x30')],_0x2498d0)[_0xf1fb('0x1b')](_0xf1fb('0x36')));_0x20f99b[_0xf1fb('0x22')](_0x89a885);}else{logger[_0xf1fb('0x37')](_0xf1fb('0x38'),path[_0xf1fb('0x1b')](__dirname,_0xf1fb('0x17'),_0x2498d0['app']+_0xf1fb('0x1d')));}}_0x2e7a08[_0xf1fb('0x39')][_0x19d4fa]=new RuleEngine(_0x20f99b);_0x2e7a08[_0xf1fb('0x39')][_0x19d4fa][_0xf1fb('0x3a')](_0x1a7fa3,function(_0x39f06d){logger['info'](_0xf1fb('0x3b'),JSON[_0xf1fb('0x3c')](_0x39f06d[_0xf1fb('0x3d')]));if(_0x2e7a08[_0xf1fb('0x39')][_0x19d4fa]){_0x2e7a08[_0xf1fb('0x39')][_0x19d4fa][_0xf1fb('0x3e')](_0xf1fb('0x3f'));}});return _0xac4775({'code':0xc8,'message':_0x1a7fa3});}else{if(_0x4a31bb){logger[_0xf1fb('0x34')](util['format']('Skipped\x20routing\x20for\x20%s',_0x19d4fa));}else{logger[_0xf1fb('0x34')]('No\x20applications\x20to\x20execute');}return _0xac4775({'code':0xc8,'message':_0x1a7fa3});}}catch(_0x28a16a){logger[_0xf1fb('0x37')](_0x28a16a[_0xf1fb('0x40')]);return _0x424279(_0x2d6174['error'](0x1f4,_0x28a16a));}}return _0x424279('routing\x20is\x20empty');});},'AcceptMessage':function(_0x489932){var _0x1ac1a7=this;return new Promise(function(_0x198023,_0x3a9575){if(_0x489932[_0xf1fb('0x41')]&&_0x489932[_0xf1fb('0x41')]['id']){if(_0x2e7a08[_0xf1fb('0x42')][_0x489932[_0xf1fb('0x41')]['id']]){_0x2e7a08[_0xf1fb('0x42')][_0x489932[_0xf1fb('0x41')]['id']][_0xf1fb('0x43')]=![];_0x2e7a08['agents'][_0x489932[_0xf1fb('0x41')]['id']][_0xf1fb('0x44')]=undefined;}}if(_0x489932[_0xf1fb('0x15')]&&_0x489932[_0xf1fb('0x15')]['id']){try{var _0xe5c09b=getId(_0x489932[_0xf1fb('0x14')],_0x489932[_0xf1fb('0x15')]?_0x489932[_0xf1fb('0x15')]['id']:0x0,_0x489932['interaction']?_0x489932[_0xf1fb('0x16')]['id']:0x0);if(_0x2e7a08[_0xf1fb('0x39')][_0xe5c09b]){_0x2e7a08[_0xf1fb('0x39')][_0xe5c09b][_0xf1fb('0x3e')](_0xf1fb('0x45'));if(rpc[_0x489932[_0xf1fb('0x14')]+_0xf1fb('0x46')]){rpc[_0x489932[_0xf1fb('0x14')]+_0xf1fb('0x46')][_0xf1fb('0x47')](_0xe5c09b,{'UserId':_0x489932['message']['UserId']})[_0xf1fb('0x48')](function(){logger[_0xf1fb('0x37')](_0xf1fb('0x49'));});}}return _0x198023({'code':0xc8,'message':_0x489932});}catch(_0x2599f6){logger['error'](_0x2599f6[_0xf1fb('0x40')]);return _0x3a9575(_0x1ac1a7['error'](0x1f4,_0x2599f6));}}logger[_0xf1fb('0x37')]('message\x20is\x20empty');return _0x3a9575(_0x1ac1a7[_0xf1fb('0x37')](0x1f4,_0xf1fb('0x4a')));});},'RejectMessage':function(_0x592bee){var _0x126e3c=this;return new Promise(function(_0x289488,_0x4b9b54){if(_0x592bee[_0xf1fb('0x41')]&&_0x592bee[_0xf1fb('0x41')]['id']){try{if(_0x2e7a08[_0xf1fb('0x42')][_0x592bee[_0xf1fb('0x41')]['id']]){_0x2e7a08['agents'][_0x592bee['agent']['id']][_0xf1fb('0x43')]=![];_0x2e7a08[_0xf1fb('0x42')][_0x592bee[_0xf1fb('0x41')]['id']][_0xf1fb('0x44')]=undefined;}return _0x289488({'code':0xc8,'message':_0x592bee});}catch(_0x535aeb){logger[_0xf1fb('0x37')](_0x535aeb[_0xf1fb('0x40')]);return _0x4b9b54(_0x126e3c[_0xf1fb('0x37')](0x1f4,_0x535aeb));}}logger[_0xf1fb('0x37')](_0xf1fb('0x4a'));return _0x4b9b54(_0x126e3c[_0xf1fb('0x37')](0x1f4,_0xf1fb('0x4a')));});},'AbandonInteraction':function(_0x15ffa2){var _0x1c6624=this;return new Promise(function(_0x598fd1,_0x5426b9){if(_0x15ffa2[_0xf1fb('0x14')]&&_0x15ffa2[_0xf1fb('0x16')]&&_0x15ffa2[_0xf1fb('0x16')]['id']){try{var _0x399d7b=getId(_0x15ffa2[_0xf1fb('0x14')],_0x15ffa2[_0xf1fb('0x15')]?_0x15ffa2[_0xf1fb('0x15')]['id']:0x0,_0x15ffa2[_0xf1fb('0x16')]?_0x15ffa2[_0xf1fb('0x16')]['id']:0x0);if(_0x2e7a08[_0xf1fb('0x39')][_0x399d7b]){_0x2e7a08[_0xf1fb('0x39')][_0x399d7b]['emit']('end');}return _0x598fd1({'code':0xc8,'message':_0x15ffa2});}catch(_0x1239f9){logger['error'](_0x1239f9[_0xf1fb('0x40')]);return _0x5426b9(_0x1c6624[_0xf1fb('0x37')](0x1f4,_0x1239f9));}}logger[_0xf1fb('0x37')](_0xf1fb('0x4a'));return _0x5426b9(_0x1c6624[_0xf1fb('0x37')](0x1f4,_0xf1fb('0x4a')));});},'AgentCapacity':function(_0x4afdb1){var _0x153934=this;return new Promise(function(_0x2a9b46,_0x1b1514){if(_0x2e7a08['agents'][_0xf1fb('0x4b')](_0x4afdb1['id'])){for(var _0xb8683d in _0x4afdb1['capacity']){if(_0x4afdb1[_0xf1fb('0x4c')]['hasOwnProperty'](_0xb8683d)){if(_0x2e7a08['agents'][_0x4afdb1['id']][_0xf1fb('0x4b')](_0xb8683d+'CurrentCapacity')){_0x2e7a08[_0xf1fb('0x42')][_0x4afdb1['id']][_0xb8683d+_0xf1fb('0x4d')]=parseInt(_0x4afdb1[_0xf1fb('0x4c')][_0xb8683d],0xa);}}}_0x2e7a08[_0xf1fb('0x42')][_0x4afdb1['id']]['updateRealtime']();return _0x2a9b46({'code':0xc8,'message':_0x2e7a08['agents'][_0x4afdb1['id']]});}else{return _0x1b1514(_0x153934[_0xf1fb('0x37')](0x1f4,_0xf1fb('0x4e')));}});},'Agents':function(_0x4abcb5){return new Promise(function(_0x348723){var _0xe008a0=_[_0xf1fb('0x4f')](_0x2e7a08[_0xf1fb('0x42')]);if(_0x4abcb5&&_0x4abcb5['id']){var _0x2f3477=_[_0xf1fb('0x50')](_0xe008a0,function(_0x382fb9){return _0x382fb9['id']===_0x4abcb5['id'];});_0x348723(_0x2f3477);}else{_0x348723({'count':_0xe008a0['length'],'rows':_0xe008a0});}});},'ChatQueues':function(){return new Promise(function(_0x51b40c){var _0x52893d=[];for(var _0x1f3f4f in _0x2e7a08[_0xf1fb('0x51')]){if(_0x2e7a08['chatQueues']['hasOwnProperty'](_0x1f3f4f)){var _0x47cc55=_0x2e7a08[_0xf1fb('0x51')][_0x1f3f4f];var _0x2bf0ae={'id':_0x47cc55['id'],'available':_0x47cc55[_0xf1fb('0x52')],'loggedIn':_0x47cc55[_0xf1fb('0x53')],'name':_0x47cc55['name'],'paused':_0x47cc55[_0xf1fb('0x54')],'waiting':_0x47cc55[_0xf1fb('0x55')]};_0x52893d['push'](_0x2bf0ae);}}_0x51b40c({'count':_0x52893d[_0xf1fb('0x19')],'rows':_0x52893d});});},'MailQueues':function(){return new Promise(function(_0x12d261){var _0x24f4f7=[];for(var _0x197ebc in _0x2e7a08['mailQueues']){if(_0x2e7a08[_0xf1fb('0x56')]['hasOwnProperty'](_0x197ebc)){var _0x355cf1=_0x2e7a08[_0xf1fb('0x56')][_0x197ebc];var _0x3eaec2={'id':_0x355cf1['id'],'available':_0x355cf1[_0xf1fb('0x52')],'loggedIn':_0x355cf1['loggedIn'],'name':_0x355cf1[_0xf1fb('0x57')],'paused':_0x355cf1[_0xf1fb('0x54')],'waiting':_0x355cf1['waiting']};_0x24f4f7[_0xf1fb('0x22')](_0x3eaec2);}}_0x12d261({'count':_0x24f4f7['length'],'rows':_0x24f4f7});});},'OpenchannelQueues':function(){return new Promise(function(_0x203770){var _0x1ac569=[];for(var _0x4dfd69 in _0x2e7a08[_0xf1fb('0x58')]){if(_0x2e7a08['openchannelQueues'][_0xf1fb('0x4b')](_0x4dfd69)){var _0x97b261=_0x2e7a08['openchannelQueues'][_0x4dfd69];var _0x18528d={'id':_0x97b261['id'],'available':_0x97b261['available'],'loggedIn':_0x97b261[_0xf1fb('0x53')],'name':_0x97b261[_0xf1fb('0x57')],'paused':_0x97b261[_0xf1fb('0x54')],'waiting':_0x97b261[_0xf1fb('0x55')]};_0x1ac569[_0xf1fb('0x22')](_0x18528d);}}_0x203770({'count':_0x1ac569[_0xf1fb('0x19')],'rows':_0x1ac569});});},'SmsQueues':function(){return new Promise(function(_0x395f10){var _0x3e299e=[];for(var _0x578846 in _0x2e7a08[_0xf1fb('0x59')]){if(_0x2e7a08[_0xf1fb('0x59')][_0xf1fb('0x4b')](_0x578846)){var _0x36171b=_0x2e7a08[_0xf1fb('0x59')][_0x578846];var _0x459c52={'id':_0x36171b['id'],'available':_0x36171b[_0xf1fb('0x52')],'loggedIn':_0x36171b[_0xf1fb('0x53')],'name':_0x36171b[_0xf1fb('0x57')],'paused':_0x36171b[_0xf1fb('0x54')],'waiting':_0x36171b[_0xf1fb('0x55')]};_0x3e299e[_0xf1fb('0x22')](_0x459c52);}}_0x395f10({'count':_0x3e299e[_0xf1fb('0x19')],'rows':_0x3e299e});});},'FaxQueues':function(){return new Promise(function(_0x257925){var _0x2ce6c0=[];for(var _0x33a7b4 in _0x2e7a08[_0xf1fb('0x5a')]){if(_0x2e7a08[_0xf1fb('0x5a')][_0xf1fb('0x4b')](_0x33a7b4)){var _0x36706d=_0x2e7a08[_0xf1fb('0x5a')][_0x33a7b4];var _0x3236ef={'id':_0x36706d['id'],'available':_0x36706d[_0xf1fb('0x52')],'loggedIn':_0x36706d['loggedIn'],'name':_0x36706d[_0xf1fb('0x57')],'paused':_0x36706d[_0xf1fb('0x54')],'waiting':_0x36706d['waiting']};_0x2ce6c0[_0xf1fb('0x22')](_0x3236ef);}}_0x257925({'count':_0x2ce6c0['length'],'rows':_0x2ce6c0});});},'WhatsappQueues':function(){return new Promise(function(_0x26b1fc){var _0x36c492=[];for(var _0xb7b0e1 in _0x2e7a08[_0xf1fb('0x5b')]){if(_0x2e7a08[_0xf1fb('0x5b')][_0xf1fb('0x4b')](_0xb7b0e1)){var _0x22236d=_0x2e7a08[_0xf1fb('0x5b')][_0xb7b0e1];var _0xc2fed7={'id':_0x22236d['id'],'available':_0x22236d[_0xf1fb('0x52')],'loggedIn':_0x22236d[_0xf1fb('0x53')],'name':_0x22236d[_0xf1fb('0x57')],'paused':_0x22236d[_0xf1fb('0x54')],'waiting':_0x22236d[_0xf1fb('0x55')]};_0x36c492['push'](_0xc2fed7);}}_0x26b1fc({'count':_0x36c492[_0xf1fb('0x19')],'rows':_0x36c492});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x329635){var _0x5bba9c=_['values'](_0x2e7a08[_0xf1fb('0x5c')]);_0x329635({'count':_0x5bba9c[_0xf1fb('0x19')],'rows':_0x5bba9c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5e42b4){var _0x1f143a=_[_0xf1fb('0x4f')](_0x2e7a08[_0xf1fb('0x5d')]);_0x5e42b4({'count':_0x1f143a[_0xf1fb('0x19')],'rows':_0x1f143a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x448ec1){var _0x2d5990=_[_0xf1fb('0x4f')](_0x2e7a08['openchannelQueuesWaitingInteractions']);_0x448ec1({'count':_0x2d5990[_0xf1fb('0x19')],'rows':_0x2d5990});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x227acc){var _0x15c153=_['values'](_0x2e7a08['smsQueuesWaitingInteractions']);_0x227acc({'count':_0x15c153[_0xf1fb('0x19')],'rows':_0x15c153});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3239a4){var _0xa168d1=_['values'](_0x2e7a08['faxQueuesWaitingInteractions']);_0x3239a4({'count':_0xa168d1[_0xf1fb('0x19')],'rows':_0xa168d1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x58d192){var _0x3c0065=_[_0xf1fb('0x4f')](_0x2e7a08[_0xf1fb('0x5e')]);_0x58d192({'count':_0x3c0065[_0xf1fb('0x19')],'rows':_0x3c0065});});}};var _0x3ad9ca=jayson['server'](_0x521e77)[_0xf1fb('0x5f')]();_0x3ad9ca['on']('error',function(_0x46f763){logger[_0xf1fb('0x37')](JSON[_0xf1fb('0x3c')](_0x46f763));return _0x42a04f(_0x46f763);});_0x3ad9ca[_0xf1fb('0x13')](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1137c9(_0xf1fb('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 1c47de7..4605618 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 _0xc78b=['stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','log','stack'];(function(_0x4abafe,_0x43afdf){var _0x674b3a=function(_0xe3c9e1){while(--_0xe3c9e1){_0x4abafe['push'](_0x4abafe['shift']());}};_0x674b3a(++_0x43afdf);}(_0xc78b,0x189));var _0xbc78=function(_0x2ab30a,_0x2d0af0){_0x2ab30a=_0x2ab30a-0x0;var _0x4542d9=_0xc78b[_0x2ab30a];return _0x4542d9;};'use strict';var util=require(_0xbc78('0x0'));var BPromise=require(_0xbc78('0x1'));var jayson=require(_0xbc78('0x2'));var _=require(_0xbc78('0x3'));var logger=require(_0xbc78('0x4'))(_0xbc78('0x5'));var client=jayson['client'][_0xbc78('0x6')]({'port':0x232a});function request(_0x475dc1,_0x573add){return new BPromise(function(_0x422ce3,_0x3ee201){return client[_0xbc78('0x7')](_0x475dc1,_0x573add)[_0xbc78('0x8')](function(_0x13b59e){if(_0x13b59e[_0xbc78('0x9')]){return _0x3ee201(_0x13b59e['error'][_0xbc78('0xa')]);}else{return _0x422ce3(_0x13b59e[_0xbc78('0xb')]);}})[_0xbc78('0xc')](function(_0x5b73a6){return _0x3ee201(_0x5b73a6);});});}exports[_0xbc78('0xd')]=function(_0x4ca1c5,_0x79bd4c,_0x483301){return function(_0x462d3b){if(_0x483301['rules']&&!_0x483301['rules'][_0x4ca1c5]){logger[_0xbc78('0xe')](_0xbc78('0xf'),_0x4ca1c5);return _0x462d3b['stop']();}var _0x1ebc1b=[];for(var _0x337605=0x0;_0x337605<_0x79bd4c['length'];_0x337605+=0x1){_0x1ebc1b[_0xbc78('0x10')](request(_0xbc78('0x11'),{'command':util[_0xbc78('0x12')]('iftime\x20%s',_0x79bd4c[_0x337605])})[_0xbc78('0x8')](function(_0x41f7c5){return _0x41f7c5&&_0x41f7c5[_0xbc78('0xa')]&&_0x41f7c5[_0xbc78('0xa')][_0xbc78('0x13')](_0xbc78('0x14'))>=0x0?!![]:![];})[_0xbc78('0xc')](function(_0x128b20){logger['error'](_0xbc78('0x15'),_0x4ca1c5,_0x79bd4c[_0x337605]);}));}BPromise['all'](_0x1ebc1b)[_0xbc78('0x8')](function(_0x3dad23){var _0x542145=_[_0xbc78('0x16')](_0x3dad23);logger[_0xbc78('0xe')](_0xbc78('0x17'),_0x4ca1c5,_0x79bd4c['join'](_0xbc78('0x18')),_0x542145);_0x462d3b['when'](_0x542145);})[_0xbc78('0xc')](function(_0x55576d){console[_0xbc78('0x19')](_0x55576d);logger[_0xbc78('0x9')](_0xbc78('0x17'),_0x4ca1c5,_0x79bd4c['join'](_0xbc78('0x18')),_0x55576d[_0xbc78('0x1a')]);_0x462d3b[_0xbc78('0x1b')]();});};}; \ No newline at end of file +var _0x4372=['Command','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','\x20|\x20','when','log','join','stack','util','jayson/promise','lodash','../../../config/logger','client','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push'];(function(_0x2a388,_0x447623){var _0x43b023=function(_0x3341a3){while(--_0x3341a3){_0x2a388['push'](_0x2a388['shift']());}};_0x43b023(++_0x447623);}(_0x4372,0x134));var _0x2437=function(_0x2f7be9,_0x173b28){_0x2f7be9=_0x2f7be9-0x0;var _0x22b2ad=_0x4372[_0x2f7be9];return _0x22b2ad;};'use strict';var util=require(_0x2437('0x0'));var BPromise=require('bluebird');var jayson=require(_0x2437('0x1'));var _=require(_0x2437('0x2'));var logger=require(_0x2437('0x3'))('routing');var client=jayson[_0x2437('0x4')]['http']({'port':0x232a});function request(_0x18c29d,_0x26e4f5){return new BPromise(function(_0x25168a,_0x306a13){return client[_0x2437('0x5')](_0x18c29d,_0x26e4f5)[_0x2437('0x6')](function(_0x48fc18){if(_0x48fc18[_0x2437('0x7')]){return _0x306a13(_0x48fc18[_0x2437('0x7')][_0x2437('0x8')]);}else{return _0x25168a(_0x48fc18[_0x2437('0x9')]);}})[_0x2437('0xa')](function(_0x3ddd16){return _0x306a13(_0x3ddd16);});});}exports['condition']=function(_0x400efb,_0x22b5ad,_0x19c3fc){return function(_0xe32eda){if(_0x19c3fc['rules']&&!_0x19c3fc[_0x2437('0xb')][_0x400efb]){logger[_0x2437('0xc')](_0x2437('0xd'),_0x400efb);return _0xe32eda['stop']();}var _0x14d863=[];for(var _0x59c553=0x0;_0x59c553<_0x22b5ad[_0x2437('0xe')];_0x59c553+=0x1){_0x14d863[_0x2437('0xf')](request(_0x2437('0x10'),{'command':util['format'](_0x2437('0x11'),_0x22b5ad[_0x59c553])})[_0x2437('0x6')](function(_0x5ef3ae){return _0x5ef3ae&&_0x5ef3ae[_0x2437('0x8')]&&_0x5ef3ae[_0x2437('0x8')]['indexOf'](_0x2437('0x12'))>=0x0?!![]:![];})[_0x2437('0xa')](function(_0x13a54d){logger[_0x2437('0x7')](_0x2437('0x13'),_0x400efb,_0x22b5ad[_0x59c553]);}));}BPromise[_0x2437('0x14')](_0x14d863)[_0x2437('0x6')](function(_0x487e16){var _0x275cd5=_[_0x2437('0x15')](_0x487e16);logger[_0x2437('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x400efb,_0x22b5ad['join'](_0x2437('0x16')),_0x275cd5);_0xe32eda[_0x2437('0x17')](_0x275cd5);})[_0x2437('0xa')](function(_0x368e8d){console[_0x2437('0x18')](_0x368e8d);logger[_0x2437('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x400efb,_0x22b5ad[_0x2437('0x19')](_0x2437('0x16')),_0x368e8d[_0x2437('0x1a')]);_0xe32eda['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 6016bdf..ddbe629 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 _0x9348=['clone','calleridname','transfer','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agentcomplete','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','info','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','uniqueid','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfereeuniqueid'];(function(_0xabdb7d,_0x35fedd){var _0x4fc69d=function(_0x4a6e25){while(--_0x4a6e25){_0xabdb7d['push'](_0xabdb7d['shift']());}};_0x4fc69d(++_0x35fedd);}(_0x9348,0x10d));var _0x8934=function(_0x491a80,_0x2df8e5){_0x491a80=_0x491a80-0x0;var _0x1610d4=_0x9348[_0x491a80];return _0x1610d4;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var utils=require(_0x8934('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x135b2c,_0x46a231){utils['info'](util[_0x8934('0x3')](_0x8934('0x4'),_0x135b2c['uniqueid'],_0x135b2c[_0x8934('0x5')],_0x135b2c[_0x8934('0x6')],_0x135b2c[_0x8934('0x7')],_0x135b2c[_0x8934('0x8')],_0x135b2c[_0x8934('0x9')],_0x135b2c[_0x8934('0xa')],_0x135b2c['lastevent']));if(_0x135b2c[_0x8934('0x6')]){utils[_0x8934('0xb')](_0x135b2c[_0x8934('0x6')])['then'](function(_0x4b470d){if(_0x4b470d){_0x135b2c['type']=_0x4b470d['type'];_0x135b2c[_0x8934('0xc')]=_0x135b2c['agentcomplete']?_0x4b470d[_0x8934('0xd')]:![];_0x135b2c[_0x8934('0xe')]=_0x135b2c[_0x8934('0xc')]?_0x4b470d[_0x8934('0xf')]:0x0;}utils[_0x8934('0x10')](_0x8934('0x11'),_0x135b2c);});}else{utils[_0x8934('0x10')](_0x8934('0x11'),_0x135b2c);}if(_0x46a231){delete transfers[_0x135b2c['uniqueid']];}else{delete agents[_0x135b2c[_0x8934('0x12')]];}}exports[_0x8934('0x13')]=function(_0x46bca5){try{utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x15'),_0x46bca5['uniqueid']),_0x46bca5);agents[_0x46bca5[_0x8934('0x12')]]=_0x46bca5;agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x16')]=utils[_0x8934('0x17')]();agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x18')]=_0x8934('0x19');agents[_0x46bca5[_0x8934('0x12')]]['connectedlinenum']=null;agents[_0x46bca5[_0x8934('0x12')]][_0x8934('0x1a')]=null;utils[_0x8934('0x1b')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x46bca5['uniqueid'],agents[_0x46bca5[_0x8934('0x12')]]['membername'],_0x46bca5[_0x8934('0x12')]));}catch(_0xa9c394){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x15'),_0x46bca5['uniqueid']),_0xa9c394);}};exports[_0x8934('0x1d')]=function(_0x5ae49f){try{if(!_[_0x8934('0x1e')](agents[_0x5ae49f[_0x8934('0x12')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x1f'),_0x5ae49f[_0x8934('0x20')]),_0x5ae49f);utils[_0x8934('0x1b')](util['format'](_0x8934('0x21'),_0x5ae49f[_0x8934('0x20')],agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x7')],_0x5ae49f[_0x8934('0x12')]));agents[_0x5ae49f['destuniqueid']][_0x8934('0x1d')]=!![];agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x22')]=utils['now']();agents[_0x5ae49f[_0x8934('0x12')]]['lastevent']=_0x8934('0x23');agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x24')]='timeout';agents[_0x5ae49f[_0x8934('0x12')]][_0x8934('0x25')]=_0x5ae49f[_0x8934('0x26')]?parseInt(_0x5ae49f[_0x8934('0x26')])/0x3e8:0x0;agents[_0x5ae49f['destuniqueid']][_0x8934('0x27')]=0x0;unanswered[_0x8934('0x28')](_0x5ae49f[_0x8934('0x12')]);}}catch(_0x3d93c7){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x1f'),_0x5ae49f[_0x8934('0x20')]),_0x3d93c7);}};exports[_0x8934('0x29')]=function(_0x18938a){try{_['forIn'](agents,function(_0x1d068c,_0x3e973e){if(_0x1d068c['uniqueid']==_0x18938a[_0x8934('0x20')]&&!_[_0x8934('0x2a')](unanswered,_0x1d068c[_0x8934('0x12')])){utils[_0x8934('0x14')](util['format'](_0x8934('0x2b'),_0x18938a[_0x8934('0x20')]),_0x18938a);utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x2c'),_0x18938a['uniqueid'],_0x1d068c[_0x8934('0x7')],_0x1d068c['destuniqueid']));_0x1d068c['agentringnoanswer']=!![];_0x1d068c[_0x8934('0x22')]=utils[_0x8934('0x17')]();_0x1d068c[_0x8934('0x18')]=_0x8934('0x2d');_0x1d068c['reason']=_0x8934('0x2d');_0x1d068c[_0x8934('0x25')]=_0x18938a[_0x8934('0x25')];_0x1d068c[_0x8934('0x27')]=0x0;writeDB(_0x1d068c);}});}catch(_0x7b2a1c){utils['error'](util[_0x8934('0x3')](_0x8934('0x2b'),_0x18938a['uniqueid']),_0x7b2a1c);}};exports['agentconnect']=function(_0x845028){try{if(agents[_0x845028[_0x8934('0x12')]]){utils['debug'](util['format'](_0x8934('0x2e'),_0x845028[_0x8934('0x20')]),_0x845028);utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x2f'),_0x845028[_0x8934('0x20')],agents[_0x845028[_0x8934('0x12')]][_0x8934('0x7')],_0x845028[_0x8934('0x12')]));agents[_0x845028[_0x8934('0x12')]][_0x8934('0x30')]=utils['now']();agents[_0x845028[_0x8934('0x12')]][_0x8934('0xa')]=_0x845028['connectedlinenum'];agents[_0x845028[_0x8934('0x12')]][_0x8934('0x1a')]=_0x845028[_0x8934('0x1a')];agents[_0x845028[_0x8934('0x12')]][_0x8934('0x25')]=_0x845028['ringtime'];agents[_0x845028['destuniqueid']]['lastevent']=_0x8934('0x31');_[_0x8934('0x32')](agents,function(_0x8814f6,_0x53581b){if(_0x8814f6[_0x8934('0x12')]!=_0x845028['destuniqueid']&&_0x8814f6['uniqueid']==_0x845028[_0x8934('0x20')]){_0x8814f6[_0x8934('0x27')]=0x0;_0x8814f6['holdtime']=_0x845028['ringtime'];_0x8814f6[_0x8934('0x1d')]=!![];_0x8814f6[_0x8934('0x22')]=utils[_0x8934('0x17')]();_0x8814f6['lastevent']=_0x8934('0x33');_0x8814f6['reason']=_0x8934('0x33');_0x8814f6['answeredelsewheredestinationuniqueid']=_0x845028[_0x8934('0x12')];_0x8814f6[_0x8934('0x34')]=_0x845028[_0x8934('0x7')];writeDB(_0x8814f6);}});}}catch(_0x566d67){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x2e'),_0x845028[_0x8934('0x20')]),_0x566d67);}};exports['agentcomplete']=function(_0x2182db){try{if(!_[_0x8934('0x1e')](agents[_0x2182db[_0x8934('0x12')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x35'),_0x2182db[_0x8934('0x20')]),_0x2182db);utils[_0x8934('0x1b')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2182db['uniqueid'],agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x7')],_0x2182db['destuniqueid']));agents[_0x2182db[_0x8934('0x12')]]['agentcomplete']=!![];agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x36')]=utils['now']();agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x27')]=utils[_0x8934('0x37')](agents[_0x2182db[_0x8934('0x12')]]['agentcompleteAt'],agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x30')]);agents[_0x2182db['destuniqueid']][_0x8934('0x24')]=_0x2182db[_0x8934('0x24')];agents[_0x2182db[_0x8934('0x12')]][_0x8934('0x18')]=_0x8934('0x38');writeDB(agents[_0x2182db[_0x8934('0x12')]]);}}catch(_0xa45543){utils[_0x8934('0x1c')](util[_0x8934('0x3')](_0x8934('0x35'),_0x2182db[_0x8934('0x20')]),_0xa45543);}};exports[_0x8934('0x39')]=function(_0x2c322d){try{if(!_[_0x8934('0x1e')](agents[_0x2c322d[_0x8934('0x3a')]])){utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x3b'),_0x2c322d['uniqueid']),_0x2c322d);utils[_0x8934('0x1b')](util[_0x8934('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x2c322d['uniqueid'],agents[_0x2c322d['transfereruniqueid']]['membername'],agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x20')]));agents[_0x2c322d[_0x8934('0x3a')]]['transfer']=!![];agents[_0x2c322d['transfereruniqueid']][_0x8934('0x3c')]='blind';agents[_0x2c322d['transfereruniqueid']][_0x8934('0x3d')]=_0x2c322d[_0x8934('0x3e')];agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x3f')]=agents[_0x2c322d[_0x8934('0x3a')]][_0x8934('0x20')];}}catch(_0x3902fb){utils['error'](util[_0x8934('0x3')]('[%s][agents][blindtransfer]',_0x2c322d[_0x8934('0x20')]),_0x3902fb);}};exports[_0x8934('0x40')]=function(_0x2d776a){try{utils[_0x8934('0x14')](util[_0x8934('0x3')](_0x8934('0x41'),_0x2d776a[_0x8934('0x42')]),_0x2d776a);if(_0x2d776a[_0x8934('0x42')]==_0x2d776a['origtransfererlinkedid']){if(!_[_0x8934('0x1e')](agents[_0x2d776a[_0x8934('0x43')]])){utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x44'),_0x2d776a['origtransfereruniqueid'],agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x7')]));agents[_0x2d776a[_0x8934('0x43')]]['transfer']=!![];agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x3c')]=_0x8934('0x45');agents[_0x2d776a['secondtransfereruniqueid']]['transferexten']=_0x2d776a['origtransfererexten'];agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x3f')]=_0x2d776a[_0x8934('0x42')];}if(_0x2d776a['transfereeuniqueid']&&agents[_0x2d776a[_0x8934('0x46')]]){agents[_0x2d776a[_0x8934('0x46')]]['agententerreason']=0x1;transfers[_0x2d776a['transfereeuniqueid']]=_[_0x8934('0x47')](agents[_0x2d776a[_0x8934('0x46')]]);transfers[_0x2d776a[_0x8934('0x46')]][_0x8934('0x9')]=agents[_0x2d776a['secondtransfereruniqueid']]['calleridnum'];transfers[_0x2d776a['transfereeuniqueid']]['calleridname']=agents[_0x2d776a[_0x8934('0x43')]][_0x8934('0x48')];transfers[_0x2d776a[_0x8934('0x46')]][_0x8934('0x16')]=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x46')]]['agentconnectAt']=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x46')]]['holdtime']=0x0;transfers[_0x2d776a[_0x8934('0x46')]]['agententerreason']=0x2;}}else if(_0x2d776a[_0x8934('0x43')]==_0x2d776a['secondtransfererlinkedid']){if(!_[_0x8934('0x1e')](agents[_0x2d776a[_0x8934('0x42')]])){utils[_0x8934('0x1b')](util[_0x8934('0x3')](_0x8934('0x44'),_0x2d776a[_0x8934('0x42')],agents[_0x2d776a[_0x8934('0x42')]]['membername']));agents[_0x2d776a['origtransfereruniqueid']][_0x8934('0x49')]=!![];agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3c')]=_0x8934('0x45');agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3d')]=_0x2d776a[_0x8934('0x4a')];agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x3f')]=_0x2d776a[_0x8934('0x43')];}if(_0x2d776a[_0x8934('0x4b')]&&agents[_0x2d776a[_0x8934('0x4b')]]){agents[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x4c')]=0x1;transfers[_0x2d776a['transfertargetuniqueid']]=_['clone'](agents[_0x2d776a[_0x8934('0x4b')]]);transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x9')]=agents[_0x2d776a[_0x8934('0x42')]][_0x8934('0x9')];transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x48')]=agents[_0x2d776a['origtransfereruniqueid']][_0x8934('0x48')];transfers[_0x2d776a[_0x8934('0x4b')]]['agentcalledAt']=utils[_0x8934('0x17')]();transfers[_0x2d776a['transfertargetuniqueid']][_0x8934('0x30')]=utils[_0x8934('0x17')]();transfers[_0x2d776a[_0x8934('0x4b')]]['holdtime']=0x0;transfers[_0x2d776a[_0x8934('0x4b')]][_0x8934('0x4c')]=0x2;}}}catch(_0x544fa7){utils[_0x8934('0x1c')](util['format'](_0x8934('0x41'),_0x2d776a['origtransfereruniqueid']),_0x544fa7);}};exports[_0x8934('0x4d')]=function(_0x6b3376){try{utils[_0x8934('0x14')](util['format'](_0x8934('0x4e'),_0x6b3376[_0x8934('0x20')]),_0x6b3376);if(agents[_0x6b3376[_0x8934('0x20')]]&&agents[_0x6b3376[_0x8934('0x20')]]['reason']===_0x8934('0x23')){if(_0x6b3376['cause']==='21'){agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')]=_0x8934('0x4f');agents[_0x6b3376[_0x8934('0x20')]]['lastevent']=_0x8934('0x4f');}utils[_0x8934('0x1b')](util[_0x8934('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x6b3376[_0x8934('0x20')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],agents[_0x6b3376['uniqueid']]['reason'],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(agents[_0x6b3376[_0x8934('0x20')]]);var _0x1efd58=unanswered[_0x8934('0x50')](_0x6b3376[_0x8934('0x20')]);if(_0x1efd58>-0x1){unanswered[_0x8934('0x51')](_0x1efd58,0x1);}}if(transfers[_0x6b3376[_0x8934('0x20')]]){transfers[_0x6b3376[_0x8934('0x20')]]['agentcomplete']=!![];transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')]=utils[_0x8934('0x17')]();transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x27')]=utils['diffTime'](transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')],transfers[_0x6b3376['uniqueid']][_0x8934('0x30')]);transfers[_0x6b3376['uniqueid']]['reason']='agent';transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]=_0x8934('0x38');utils['info'](util[_0x8934('0x3')](_0x8934('0x52'),_0x6b3376['uniqueid'],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')],transfers[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(transfers[_0x6b3376[_0x8934('0x20')]],!![]);}if(agents[_0x6b3376[_0x8934('0x20')]]&&agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x30')]){agents[_0x6b3376['uniqueid']][_0x8934('0x53')]=!![];agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x36')]=utils[_0x8934('0x17')]();agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x27')]=utils[_0x8934('0x37')](agents[_0x6b3376['uniqueid']][_0x8934('0x36')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x30')]);agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')]=agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x49')]?_0x8934('0x49'):_0x8934('0x54');agents[_0x6b3376['uniqueid']]['lastevent']=_0x8934('0x38');utils[_0x8934('0x1b')](util['format'](_0x8934('0x52'),_0x6b3376[_0x8934('0x20')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x7')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x24')],agents[_0x6b3376[_0x8934('0x20')]][_0x8934('0x18')]));writeDB(agents[_0x6b3376[_0x8934('0x20')]]);}}catch(_0x2d094e){utils[_0x8934('0x1c')](util['format'](_0x8934('0x4e'),_0x6b3376[_0x8934('0x20')]),_0x2d094e);}}; \ No newline at end of file +var _0x087b=['calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','diffTime','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','isNil','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone'];(function(_0x1f988f,_0x5dac7c){var _0x4f1427=function(_0x4e837f){while(--_0x4e837f){_0x1f988f['push'](_0x1f988f['shift']());}};_0x4f1427(++_0x5dac7c);}(_0x087b,0x11a));var _0xb087=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x087b[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f3606,_0x40e6d6){utils['info'](util[_0xb087('0x2')](_0xb087('0x3'),_0x5f3606[_0xb087('0x4')],_0x5f3606[_0xb087('0x5')],_0x5f3606[_0xb087('0x6')],_0x5f3606[_0xb087('0x7')],_0x5f3606[_0xb087('0x8')],_0x5f3606[_0xb087('0x9')],_0x5f3606[_0xb087('0xa')],_0x5f3606[_0xb087('0xb')]));if(_0x5f3606[_0xb087('0x6')]){utils[_0xb087('0xc')](_0x5f3606[_0xb087('0x6')])[_0xb087('0xd')](function(_0x2f14bc){if(_0x2f14bc){_0x5f3606[_0xb087('0xe')]=_0x2f14bc[_0xb087('0xe')];_0x5f3606['agentacw']=_0x5f3606[_0xb087('0xf')]?_0x2f14bc[_0xb087('0x10')]:![];_0x5f3606[_0xb087('0x11')]=_0x5f3606[_0xb087('0x12')]?_0x2f14bc[_0xb087('0x13')]:0x0;}utils[_0xb087('0x14')](_0xb087('0x15'),_0x5f3606);});}else{utils['request'](_0xb087('0x15'),_0x5f3606);}if(_0x40e6d6){delete transfers[_0x5f3606[_0xb087('0x4')]];}else{delete agents[_0x5f3606[_0xb087('0x16')]];}}exports['agentcalled']=function(_0x3001e3){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3[_0xb087('0x4')]),_0x3001e3);agents[_0x3001e3[_0xb087('0x16')]]=_0x3001e3;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x19')]=utils[_0xb087('0x1a')]();agents[_0x3001e3[_0xb087('0x16')]]['lastevent']=_0xb087('0x1b');agents[_0x3001e3[_0xb087('0x16')]]['connectedlinenum']=null;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x1c')]=null;utils[_0xb087('0x1d')](util['format'](_0xb087('0x1e'),_0x3001e3[_0xb087('0x4')],agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x7')],_0x3001e3['destuniqueid']));}catch(_0x13d534){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3['uniqueid']),_0x13d534);}};exports['agentringnoanswer']=function(_0x5ea3dc){try{if(!_['isNil'](agents[_0x5ea3dc[_0xb087('0x16')]])){utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc[_0xb087('0x4')]),_0x5ea3dc);utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5ea3dc[_0xb087('0x4')],agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x7')],_0x5ea3dc[_0xb087('0x16')]));agents[_0x5ea3dc[_0xb087('0x16')]]['agentringnoanswer']=!![];agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x21')]=utils['now']();agents[_0x5ea3dc['destuniqueid']]['lastevent']='timeout';agents[_0x5ea3dc['destuniqueid']][_0xb087('0x22')]=_0xb087('0x23');agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x24')]=_0x5ea3dc[_0xb087('0x25')]?parseInt(_0x5ea3dc[_0xb087('0x25')])/0x3e8:0x0;agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x26')]=0x0;unanswered[_0xb087('0x27')](_0x5ea3dc[_0xb087('0x16')]);}}catch(_0x18058c){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc['uniqueid']),_0x18058c);}};exports[_0xb087('0x28')]=function(_0x1335d9){try{_[_0xb087('0x29')](agents,function(_0x15c9ac,_0x22d441){if(_0x15c9ac[_0xb087('0x4')]==_0x1335d9[_0xb087('0x4')]&&!_[_0xb087('0x2a')](unanswered,_0x15c9ac['destuniqueid'])){utils['debug'](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9['uniqueid']),_0x1335d9);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x2c'),_0x1335d9[_0xb087('0x4')],_0x15c9ac[_0xb087('0x7')],_0x15c9ac[_0xb087('0x16')]));_0x15c9ac[_0xb087('0x2d')]=!![];_0x15c9ac[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0x15c9ac[_0xb087('0xb')]=_0xb087('0x2e');_0x15c9ac[_0xb087('0x22')]='abandoned';_0x15c9ac[_0xb087('0x24')]=_0x1335d9['holdtime'];_0x15c9ac[_0xb087('0x26')]=0x0;writeDB(_0x15c9ac);}});}catch(_0x296e9b){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9[_0xb087('0x4')]),_0x296e9b);}};exports[_0xb087('0x2f')]=function(_0x29df58){try{if(agents[_0x29df58[_0xb087('0x16')]]){utils['debug'](util['format'](_0xb087('0x30'),_0x29df58[_0xb087('0x4')]),_0x29df58);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x31'),_0x29df58['uniqueid'],agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x7')],_0x29df58['destuniqueid']));agents[_0x29df58['destuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();agents[_0x29df58[_0xb087('0x16')]]['connectedlinenum']=_0x29df58[_0xb087('0xa')];agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x1c')]=_0x29df58[_0xb087('0x1c')];agents[_0x29df58[_0xb087('0x16')]]['holdtime']=_0x29df58[_0xb087('0x25')];agents[_0x29df58['destuniqueid']][_0xb087('0xb')]='connect';_[_0xb087('0x29')](agents,function(_0xc9f9e9,_0x513332){if(_0xc9f9e9[_0xb087('0x16')]!=_0x29df58['destuniqueid']&&_0xc9f9e9[_0xb087('0x4')]==_0x29df58['uniqueid']){_0xc9f9e9[_0xb087('0x26')]=0x0;_0xc9f9e9[_0xb087('0x24')]=_0x29df58[_0xb087('0x25')];_0xc9f9e9[_0xb087('0x2d')]=!![];_0xc9f9e9[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0xc9f9e9[_0xb087('0xb')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x22')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x33')]=_0x29df58[_0xb087('0x16')];_0xc9f9e9['answeredelsewheremembername']=_0x29df58[_0xb087('0x7')];writeDB(_0xc9f9e9);}});}}catch(_0x45dc6f){utils[_0xb087('0x1f')](util['format'](_0xb087('0x30'),_0x29df58['uniqueid']),_0x45dc6f);}};exports[_0xb087('0xf')]=function(_0x32b9d3){try{if(!_['isNil'](agents[_0x32b9d3[_0xb087('0x16')]])){utils[_0xb087('0x17')](util['format'](_0xb087('0x34'),_0x32b9d3[_0xb087('0x4')]),_0x32b9d3);utils['info'](util[_0xb087('0x2')](_0xb087('0x35'),_0x32b9d3[_0xb087('0x4')],agents[_0x32b9d3[_0xb087('0x16')]]['membername'],_0x32b9d3['destuniqueid']));agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0xf')]=!![];agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x36')]=utils[_0xb087('0x1a')]();agents[_0x32b9d3[_0xb087('0x16')]]['talktime']=utils['diffTime'](agents[_0x32b9d3[_0xb087('0x16')]]['agentcompleteAt'],agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x32')]);agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x22')]=_0x32b9d3['reason'];agents[_0x32b9d3[_0xb087('0x16')]]['lastevent']=_0xb087('0x37');writeDB(agents[_0x32b9d3[_0xb087('0x16')]]);}}catch(_0xcb56c7){utils[_0xb087('0x1f')](util[_0xb087('0x2')]('[%s][agents][agentcomplete]',_0x32b9d3[_0xb087('0x4')]),_0xcb56c7);}};exports[_0xb087('0x38')]=function(_0x588d96){try{if(!_['isNil'](agents[_0x588d96[_0xb087('0x39')]])){utils['debug'](util['format'](_0xb087('0x3a'),_0x588d96[_0xb087('0x4')]),_0x588d96);utils['info'](util[_0xb087('0x2')](_0xb087('0x3b'),_0x588d96[_0xb087('0x4')],agents[_0x588d96['transfereruniqueid']]['membername'],agents[_0x588d96[_0xb087('0x39')]]['uniqueid']));agents[_0x588d96['transfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3d')]=_0xb087('0x3e');agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3f')]=_0x588d96[_0xb087('0x40')];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x41')]=agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x4')];}}catch(_0x2cfc44){utils['error'](util[_0xb087('0x2')](_0xb087('0x3a'),_0x588d96['uniqueid']),_0x2cfc44);}};exports[_0xb087('0x42')]=function(_0x458301){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x458301);if(_0x458301[_0xb087('0x44')]==_0x458301[_0xb087('0x45')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x47')]])){utils[_0xb087('0x1d')](util['format'](_0xb087('0x48'),_0x458301['origtransfereruniqueid'],agents[_0x458301[_0xb087('0x47')]]['membername']));agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3c')]=!![];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3d')]=_0xb087('0x49');agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3f')]=_0x458301[_0xb087('0x4a')];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x41')]=_0x458301[_0xb087('0x44')];}if(_0x458301[_0xb087('0x4b')]&&agents[_0x458301[_0xb087('0x4b')]]){agents[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x1;transfers[_0x458301[_0xb087('0x4b')]]=_[_0xb087('0x4d')](agents[_0x458301[_0xb087('0x4b')]]);transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x9')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x9')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x4e')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x19')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfereeuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301[_0xb087('0x4b')]]['holdtime']=0x0;transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x2;}}else if(_0x458301[_0xb087('0x47')]==_0x458301[_0xb087('0x4f')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x44')]])){utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x458301[_0xb087('0x44')],agents[_0x458301[_0xb087('0x44')]][_0xb087('0x7')]));agents[_0x458301['origtransfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x458301['origtransfereruniqueid']]['transfertype']=_0xb087('0x49');agents[_0x458301[_0xb087('0x44')]]['transferexten']=_0x458301[_0xb087('0x50')];agents[_0x458301['origtransfereruniqueid']][_0xb087('0x41')]=_0x458301[_0xb087('0x47')];}if(_0x458301['transfertargetuniqueid']&&agents[_0x458301['transfertargetuniqueid']]){agents[_0x458301[_0xb087('0x51')]]['agententerreason']=0x1;transfers[_0x458301['transfertargetuniqueid']]=_[_0xb087('0x4d')](agents[_0x458301['transfertargetuniqueid']]);transfers[_0x458301[_0xb087('0x51')]]['calleridnum']=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x9')];transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x4e')];transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x19')]=utils['now']();transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x24')]=0x0;transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x4c')]=0x2;}}}catch(_0x3784f7){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x3784f7);}};exports['hangup']=function(_0x245d68){try{utils[_0xb087('0x17')](util['format'](_0xb087('0x52'),_0x245d68['uniqueid']),_0x245d68);if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]===_0xb087('0x23')){if(_0x245d68[_0xb087('0x53')]==='21'){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x54');agents[_0x245d68['uniqueid']]['lastevent']='rejected';}utils[_0xb087('0x1d')](util['format'](_0xb087('0x55'),_0x245d68['uniqueid'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],agents[_0x245d68['uniqueid']][_0xb087('0xb')]));writeDB(agents[_0x245d68['uniqueid']]);var _0x185102=unanswered[_0xb087('0x56')](_0x245d68[_0xb087('0x4')]);if(_0x185102>-0x1){unanswered[_0xb087('0x57')](_0x185102,0x1);}}if(transfers[_0x245d68['uniqueid']]){transfers[_0x245d68['uniqueid']][_0xb087('0xf')]=!![];transfers[_0x245d68['uniqueid']][_0xb087('0x36')]=utils[_0xb087('0x1a')]();transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils['diffTime'](transfers[_0x245d68['uniqueid']][_0xb087('0x36')],transfers[_0x245d68['uniqueid']][_0xb087('0x32')]);transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x58');transfers[_0x245d68[_0xb087('0x4')]]['lastevent']=_0xb087('0x37');utils[_0xb087('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x245d68['uniqueid'],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(transfers[_0x245d68['uniqueid']],!![]);}if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x32')]){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xf')]=!![];agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x36')]=utils['now']();agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils[_0xb087('0x59')](agents[_0x245d68['uniqueid']][_0xb087('0x36')],agents[_0x245d68['uniqueid']][_0xb087('0x32')]);agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x3c')]?_0xb087('0x3c'):'agent';agents[_0x245d68['uniqueid']][_0xb087('0xb')]=_0xb087('0x37');utils['info'](util[_0xb087('0x2')](_0xb087('0x55'),_0x245d68[_0xb087('0x4')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]]['reason'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(agents[_0x245d68[_0xb087('0x4')]]);}}catch(_0x3114ce){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x52'),_0x245d68[_0xb087('0x4')]),_0x3114ce);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8136056..96c38dd 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 _0x43d7=['ContactId','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','BUSY','FAILED','uniqueid','blinds','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','debug','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','now','isNil','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x43d7,0x7b));var _0x743d=function(_0x570647,_0x496f71){_0x570647=_0x570647-0x0;var _0x386c8d=_0x43d7[_0x570647];return _0x386c8d;};'use strict';var _=require(_0x743d('0x0'));var util=require(_0x743d('0x1'));var utils=require(_0x743d('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x743d('0x3'),'FAILED','FAILED',_0x743d('0x3'),_0x743d('0x3'),'NO\x20ANSWER','ANSWERED',_0x743d('0x4'),_0x743d('0x5'),_0x743d('0x5'),_0x743d('0x5')];var channels={};function writeDB(_0x3b7560){var _0xf490f7;if(transfers['blinds'][_0x3b7560['uniqueid']]){_0xf490f7=_0x3b7560[_0x743d('0x6')];_0x3b7560[_0x743d('0x6')]=transfers[_0x743d('0x7')][_0x3b7560['uniqueid']][_0x743d('0x8')];}utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3b7560[_0x743d('0x6')],_0x3b7560[_0x743d('0xb')],_0x3b7560[_0x743d('0xc')],_0x3b7560[_0x743d('0xd')],_0x3b7560[_0x743d('0xe')],_0x3b7560[_0x743d('0xf')],_0x3b7560['connectedlinenum'],_0x3b7560['lastevent']));if(_0x3b7560[_0x743d('0x10')]){utils[_0x743d('0x11')](_0x3b7560[_0x743d('0x10')])[_0x743d('0x12')](function(_0x374f87){if(_0x374f87){_0x3b7560['UserId']=_0x374f87['id'];}utils[_0x743d('0x13')](_0x743d('0x14'),_0x3b7560);});}else{utils[_0x743d('0x13')](_0x743d('0x14'),_0x3b7560);}if(channels[_0x3b7560[_0x743d('0x6')]]){delete channels[_0x3b7560[_0x743d('0x6')]];}else if(_0xf490f7&&channels[_0xf490f7]){if(!transfers[_0x743d('0x7')][_0xf490f7]['recording'])delete transfers[_0x743d('0x7')][_0xf490f7];delete channels[_0xf490f7];}}exports[_0x743d('0x15')]=function(_0x3ef653){try{utils['debug'](util['format'](_0x743d('0x16'),_0x3ef653[_0x743d('0x6')]),_0x3ef653);if(_0x3ef653[_0x743d('0x6')]==_0x3ef653[_0x743d('0x17')]&&_0x3ef653['channel']!=_0x743d('0x18')){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x19'),_0x3ef653['uniqueid'],_0x3ef653[_0x743d('0x1a')],_0x3ef653[_0x743d('0x1b')]));channels[_0x3ef653['uniqueid']]={'uniqueid':_0x3ef653[_0x743d('0x6')],'accountcode':_0x3ef653['accountcode'],'source':_0x3ef653[_0x743d('0xf')],'destination':_0x3ef653[_0x743d('0x1b')],'destinationcontext':_0x3ef653[_0x743d('0x1a')],'channel':_0x3ef653['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x743d('0x1c')};}}catch(_0x3ad5d5){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x16'),_0x3ef653['uniqueid']),_0x3ad5d5);}};exports[_0x743d('0x1e')]=function(_0x4eaac7){try{utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x20'),_0x4eaac7['uniqueid']),_0x4eaac7);if(!_['isNil'](channels[_0x4eaac7[_0x743d('0x6')]])&&_0x4eaac7[_0x743d('0x21')]==0x6){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x22'),_0x4eaac7[_0x743d('0x6')],_0x4eaac7[_0x743d('0x1a')],_0x4eaac7[_0x743d('0xb')]));if(_['isNil'](channels[_0x4eaac7[_0x743d('0x6')]]['systemanswertime'])){channels[_0x4eaac7['uniqueid']]['systemanswertime']=utils[_0x743d('0x23')]();}}else if(!_[_0x743d('0x24')](channels[_0x4eaac7['linkedid']])&&_0x4eaac7[_0x743d('0x21')]==0x6&&_0x4eaac7[_0x743d('0x1a')]!=_0x743d('0x25')){utils[_0x743d('0x9')](util['format'](_0x743d('0x26'),_0x4eaac7['uniqueid'],_0x4eaac7[_0x743d('0x17')],_0x4eaac7['context'],_0x4eaac7[_0x743d('0xb')]));channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x10')]=_0x4eaac7[_0x743d('0x10')];channels[_0x4eaac7['linkedid']][_0x743d('0x27')]=_0x4eaac7[_0x743d('0xb')];if(_[_0x743d('0x24')](channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x28')])){channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x28')]=utils[_0x743d('0x23')]();}channels[_0x4eaac7[_0x743d('0x17')]][_0x743d('0x29')]=dispositions[_[_0x743d('0x2a')](_0x4eaac7[_0x743d('0x21')])]||'ANSWERED';}}catch(_0xa84896){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x20'),_0x4eaac7['uniqueid']),_0xa84896);}};exports[_0x743d('0x2b')]=function(_0x4141b6){try{if(!_[_0x743d('0x24')](channels[_0x4141b6[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x2c'),_0x4141b6[_0x743d('0x6')]),_0x4141b6);if(_[_0x743d('0x24')](channels[_0x4141b6[_0x743d('0x6')]]['callerid'])){channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x2d')]=_0x4141b6['calleridname']+'\x20<'+_0x4141b6[_0x743d('0xf')]+'>';}utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x2e'),_0x4141b6[_0x743d('0x6')],channels[_0x4141b6['uniqueid']][_0x743d('0x2d')],_0x4141b6[_0x743d('0x2f')]));channels[_0x4141b6['uniqueid']][_0x743d('0x30')]=utils[_0x743d('0x23')]();channels[_0x4141b6[_0x743d('0x6')]]['duration']=utils['diffTime'](channels[_0x4141b6[_0x743d('0x6')]]['endtime'],channels[_0x4141b6[_0x743d('0x6')]]['starttime']);channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x31')]=channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x28')]?utils[_0x743d('0x32')](channels[_0x4141b6[_0x743d('0x6')]][_0x743d('0x30')],channels[_0x4141b6['uniqueid']][_0x743d('0x28')]):0x0;writeDB(channels[_0x4141b6[_0x743d('0x6')]]);}}catch(_0x1d79d5){utils['error'](util[_0x743d('0xa')](_0x743d('0x2c'),_0x4141b6[_0x743d('0x6')]),_0x1d79d5);}};exports['attendedtransfer']=function(_0x9f777c){try{if(!_[_0x743d('0x24')](channels[_0x9f777c[_0x743d('0x33')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x34'),_0x9f777c[_0x743d('0x35')]),_0x9f777c);if(channels[_0x9f777c['localtwolinkedid']]['channel']==_0x9f777c[_0x743d('0x36')]){utils['info'](util[_0x743d('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x9f777c['origtransfereruniqueid'],_0x9f777c[_0x743d('0x33')],_0x9f777c['secondtransfererchannel']));channels[_0x9f777c[_0x743d('0x33')]]['destinationchannel']=_0x9f777c[_0x743d('0x37')];channels[_0x9f777c[_0x743d('0x33')]]['userfield']=_0x743d('0x38');}else if(channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0xb')]=_0x9f777c[_0x743d('0x39')]){utils[_0x743d('0x9')](util['format'](_0x743d('0x3a'),_0x9f777c['origtransfereruniqueid'],_0x9f777c[_0x743d('0x33')],_0x9f777c['origtransfererchannel']));channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0x27')]=_0x9f777c[_0x743d('0x3b')];channels[_0x9f777c[_0x743d('0x33')]][_0x743d('0x3c')]=_0x743d('0x38');}}}catch(_0x3824f0){utils['error'](util[_0x743d('0xa')](_0x743d('0x34'),_0x9f777c['origtransfereruniqueid']),_0x3824f0);}};exports[_0x743d('0x3d')]=function(_0x9aa5fe){try{if(!_[_0x743d('0x24')](channels[_0x9aa5fe[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x3e'),_0x9aa5fe[_0x743d('0x6')]),_0x9aa5fe);channels[_0x9aa5fe[_0x743d('0x6')]][_0x743d('0x3f')]=utils[_0x743d('0x23')]();utils['info'](util[_0x743d('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x9aa5fe['uniqueid'],channels[_0x9aa5fe['uniqueid']][_0x743d('0x3f')]));}}catch(_0x15fced){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x3e'),_0x9aa5fe[_0x743d('0x6')]),_0x15fced);}};exports['musiconholdstop']=function(_0x157159){try{if(!_[_0x743d('0x24')](channels[_0x157159[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x40'),_0x157159[_0x743d('0x6')]),_0x157159);if(!_[_0x743d('0x24')](channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')])){channels[_0x157159[_0x743d('0x6')]][_0x743d('0x41')]+=utils[_0x743d('0x32')](utils['now'](),channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')]);utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x157159[_0x743d('0x6')],channels[_0x157159['uniqueid']][_0x743d('0x41')]));delete channels[_0x157159[_0x743d('0x6')]][_0x743d('0x3f')];}}}catch(_0x595adc){utils['error'](util[_0x743d('0xa')](_0x743d('0x40'),_0x157159['uniqueid']),_0x595adc);}};exports[_0x743d('0x42')]=function(_0x5448b9){try{if(!_[_0x743d('0x24')](channels[_0x5448b9[_0x743d('0x6')]])){utils[_0x743d('0x1f')](util[_0x743d('0xa')](_0x743d('0x43'),_0x5448b9['uniqueid']),_0x5448b9);if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x45')])){utils['info'](util[_0x743d('0xa')](_0x743d('0x46'),_0x5448b9['uniqueid'],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x48')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['xmd-phone'])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x49'),_0x5448b9['uniqueid'],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9[_0x743d('0x6')]]['destination']=_0x5448b9['value'];channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x2d')]='\x22'+_0x5448b9[_0x743d('0x47')]+_0x743d('0x4a')+_0x5448b9['value']+'>';}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4b')])||!_[_0x743d('0x24')](_0x5448b9['variable'][_0x743d('0x4c')])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x4d'),_0x5448b9[_0x743d('0x6')],!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4b')])?_0x743d('0x4b'):_0x743d('0x4c'),_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x2d')]=_0x5448b9[_0x743d('0x47')];}if(!_['isNil'](_0x5448b9[_0x743d('0x44')]['xmd-queue'])||!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x4e')])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x4d'),_0x5448b9[_0x743d('0x6')],!_['isNil'](_0x5448b9['variable'][_0x743d('0x4f')])?_0x743d('0x4f'):'xmcs-queue',_0x5448b9['value']));channels[_0x5448b9['uniqueid']][_0x743d('0x50')]=_0x743d('0x51');channels[_0x5448b9['uniqueid']][_0x743d('0x52')]=_0x5448b9[_0x743d('0x47')];channels[_0x5448b9[_0x743d('0x6')]]['queue']=!![];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')][_0x743d('0x53')])){utils['info'](util['format'](_0x743d('0x54'),_0x5448b9[_0x743d('0x6')],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9['uniqueid']][_0x743d('0x55')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['xmd-cdrtype'])){utils[_0x743d('0x9')](util[_0x743d('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5448b9[_0x743d('0x6')],_0x5448b9[_0x743d('0x47')]));channels[_0x5448b9['uniqueid']][_0x743d('0x56')]=_0x5448b9['value'];}if(!_['isNil'](_0x5448b9[_0x743d('0x44')][_0x743d('0x57')])){utils['info'](util[_0x743d('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5448b9[_0x743d('0x6')],_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x58')]=_0x5448b9[_0x743d('0x47')];}if(!_[_0x743d('0x24')](_0x5448b9[_0x743d('0x44')]['sipcallid'])){utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x59'),_0x5448b9['uniqueid'],_0x5448b9['value']));channels[_0x5448b9[_0x743d('0x6')]][_0x743d('0x5a')]=_0x5448b9['value'];}}}catch(_0x5958df){utils['error'](util[_0x743d('0xa')](_0x743d('0x43'),_0x5448b9[_0x743d('0x6')]),_0x5958df);}};exports[_0x743d('0x5b')]=function(_0x3f7163){try{if(!_[_0x743d('0x24')](channels[_0x3f7163[_0x743d('0x6')]])){utils['debug'](util['format'](_0x743d('0x5c'),_0x3f7163['uniqueid']),_0x3f7163);utils[_0x743d('0x9')](util[_0x743d('0xa')](_0x743d('0x5d'),_0x3f7163['uniqueid'],_0x3f7163[_0x743d('0x5e')],_0x3f7163[_0x743d('0x5f')]));if(_0x3f7163[_0x743d('0x5e')]['toLowerCase']()=='set'&&_[_0x743d('0x60')](_0x3f7163[_0x743d('0x5f')][_0x743d('0x61')](),_0x743d('0x62'))){var _0x8093c1=_0x3f7163[_0x743d('0x5f')]['split']('=');var _0x1f5a57=_0x8093c1[0x0]['substring'](_0x8093c1[0x0][_0x743d('0x63')]('(')+0x1,_0x8093c1[0x0][_0x743d('0x63')](')'));var _0x223058=_0x8093c1[0x1];channels[_0x3f7163[_0x743d('0x6')]][_0x1f5a57]=_0x223058;}if(!_[_0x743d('0x64')]([_0x743d('0x2b'),_0x743d('0x65'),_0x743d('0x66'),'set',_0x743d('0x67')],_0x3f7163[_0x743d('0x5e')][_0x743d('0x61')]())){channels[_0x3f7163[_0x743d('0x6')]][_0x743d('0x50')]=_0x3f7163['application'];channels[_0x3f7163[_0x743d('0x6')]][_0x743d('0x52')]=_0x3f7163[_0x743d('0x5f')];}}}catch(_0x5a837d){utils[_0x743d('0x1d')](util[_0x743d('0xa')](_0x743d('0x5c'),_0x3f7163[_0x743d('0x6')]),_0x5a837d);}}; \ No newline at end of file +var _0xc48d=['[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','linkedid','disposition','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','answertime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','variable','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','split','lastIndexOf','includes','noop','execif','gotoif','application','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','lastevent','getUserByInternal','accountcode','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate'];(function(_0x4472e3,_0x2c5b48){var _0x27a168=function(_0x198052){while(--_0x198052){_0x4472e3['push'](_0x4472e3['shift']());}};_0x27a168(++_0x2c5b48);}(_0xc48d,0x11a));var _0xdc48=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xc48d[_0x4eec9b];return _0x2e3849;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xdc48('0x2'),_0xdc48('0x3'),_0xdc48('0x3'),_0xdc48('0x2'),_0xdc48('0x2'),_0xdc48('0x2'),_0xdc48('0x4'),_0xdc48('0x5'),_0xdc48('0x3'),_0xdc48('0x3'),_0xdc48('0x3')];var channels={};function writeDB(_0x1487ca){var _0x44e5c1;if(transfers[_0xdc48('0x6')][_0x1487ca['uniqueid']]){_0x44e5c1=_0x1487ca[_0xdc48('0x7')];_0x1487ca[_0xdc48('0x7')]=transfers[_0xdc48('0x6')][_0x1487ca[_0xdc48('0x7')]][_0xdc48('0x8')];}utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0xb'),_0x1487ca[_0xdc48('0x7')],_0x1487ca[_0xdc48('0xc')],_0x1487ca[_0xdc48('0xd')],_0x1487ca[_0xdc48('0xe')],_0x1487ca['interface'],_0x1487ca[_0xdc48('0xf')],_0x1487ca['connectedlinenum'],_0x1487ca[_0xdc48('0x10')]));if(_0x1487ca['accountcode']){utils[_0xdc48('0x11')](_0x1487ca[_0xdc48('0x12')])[_0xdc48('0x13')](function(_0x22233c){if(_0x22233c){_0x1487ca['UserId']=_0x22233c['id'];}utils[_0xdc48('0x14')](_0xdc48('0x15'),_0x1487ca);});}else{utils[_0xdc48('0x14')](_0xdc48('0x15'),_0x1487ca);}if(channels[_0x1487ca[_0xdc48('0x7')]]){delete channels[_0x1487ca[_0xdc48('0x7')]];}else if(_0x44e5c1&&channels[_0x44e5c1]){if(!transfers[_0xdc48('0x6')][_0x44e5c1][_0xdc48('0x16')])delete transfers[_0xdc48('0x6')][_0x44e5c1];delete channels[_0x44e5c1];}}exports[_0xdc48('0x17')]=function(_0x101d7a){try{utils[_0xdc48('0x18')](util[_0xdc48('0xa')](_0xdc48('0x19'),_0x101d7a[_0xdc48('0x7')]),_0x101d7a);if(_0x101d7a['uniqueid']==_0x101d7a['linkedid']&&_0x101d7a['channel']!=_0xdc48('0x1a')){utils['info'](util[_0xdc48('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x101d7a[_0xdc48('0x7')],_0x101d7a[_0xdc48('0x1b')],_0x101d7a[_0xdc48('0x1c')]));channels[_0x101d7a[_0xdc48('0x7')]]={'uniqueid':_0x101d7a[_0xdc48('0x7')],'accountcode':_0x101d7a['accountcode'],'source':_0x101d7a[_0xdc48('0xf')],'destination':_0x101d7a[_0xdc48('0x1c')],'destinationcontext':_0x101d7a[_0xdc48('0x1b')],'channel':_0x101d7a[_0xdc48('0xc')],'starttime':utils[_0xdc48('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdc48('0x2'),'amaflags':_0xdc48('0x1e')};}}catch(_0x2e2f08){utils[_0xdc48('0x1f')](util[_0xdc48('0xa')](_0xdc48('0x19'),_0x101d7a[_0xdc48('0x7')]),_0x2e2f08);}};exports[_0xdc48('0x20')]=function(_0x59b4ee){try{utils[_0xdc48('0x18')](util[_0xdc48('0xa')](_0xdc48('0x21'),_0x59b4ee[_0xdc48('0x7')]),_0x59b4ee);if(!_[_0xdc48('0x22')](channels[_0x59b4ee[_0xdc48('0x7')]])&&_0x59b4ee['channelstate']==0x6){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x23'),_0x59b4ee['uniqueid'],_0x59b4ee['context'],_0x59b4ee[_0xdc48('0xc')]));if(_[_0xdc48('0x22')](channels[_0x59b4ee[_0xdc48('0x7')]][_0xdc48('0x24')])){channels[_0x59b4ee[_0xdc48('0x7')]]['systemanswertime']=utils[_0xdc48('0x1d')]();}}else if(!_[_0xdc48('0x22')](channels[_0x59b4ee['linkedid']])&&_0x59b4ee[_0xdc48('0x25')]==0x6&&_0x59b4ee[_0xdc48('0x1b')]!=_0xdc48('0x26')){utils[_0xdc48('0x9')](util[_0xdc48('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x59b4ee[_0xdc48('0x7')],_0x59b4ee[_0xdc48('0x27')],_0x59b4ee[_0xdc48('0x1b')],_0x59b4ee[_0xdc48('0xc')]));channels[_0x59b4ee['linkedid']]['accountcode']=_0x59b4ee[_0xdc48('0x12')];channels[_0x59b4ee[_0xdc48('0x27')]]['destinationchannel']=_0x59b4ee[_0xdc48('0xc')];if(_['isNil'](channels[_0x59b4ee[_0xdc48('0x27')]]['answertime'])){channels[_0x59b4ee[_0xdc48('0x27')]]['answertime']=utils[_0xdc48('0x1d')]();}channels[_0x59b4ee[_0xdc48('0x27')]][_0xdc48('0x28')]=dispositions[_['toNumber'](_0x59b4ee['channelstate'])]||_0xdc48('0x4');}}catch(_0x17e0d5){utils[_0xdc48('0x1f')](util['format']('[%s][calls][newstate]',_0x59b4ee[_0xdc48('0x7')]),_0x17e0d5);}};exports[_0xdc48('0x29')]=function(_0xda384d){try{if(!_[_0xdc48('0x22')](channels[_0xda384d[_0xdc48('0x7')]])){utils['debug'](util[_0xdc48('0xa')]('[%s][calls][hangup]',_0xda384d[_0xdc48('0x7')]),_0xda384d);if(_['isNil'](channels[_0xda384d[_0xdc48('0x7')]]['callerid'])){channels[_0xda384d['uniqueid']][_0xdc48('0x2a')]=_0xda384d[_0xdc48('0x2b')]+'\x20<'+_0xda384d[_0xdc48('0xf')]+'>';}utils['info'](util[_0xdc48('0xa')](_0xdc48('0x2c'),_0xda384d[_0xdc48('0x7')],channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x2a')],_0xda384d[_0xdc48('0x2d')]));channels[_0xda384d['uniqueid']][_0xdc48('0x2e')]=utils['now']();channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x2f')]=utils[_0xdc48('0x30')](channels[_0xda384d['uniqueid']]['endtime'],channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x31')]);channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x32')]=channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x33')]?utils[_0xdc48('0x30')](channels[_0xda384d['uniqueid']][_0xdc48('0x2e')],channels[_0xda384d[_0xdc48('0x7')]][_0xdc48('0x33')]):0x0;writeDB(channels[_0xda384d[_0xdc48('0x7')]]);}}catch(_0x1be137){utils[_0xdc48('0x1f')](util['format']('[%s][calls][hangup]',_0xda384d[_0xdc48('0x7')]),_0x1be137);}};exports[_0xdc48('0x34')]=function(_0x1d6c3b){try{if(!_[_0xdc48('0x22')](channels[_0x1d6c3b['localtwolinkedid']])){utils[_0xdc48('0x18')](util[_0xdc48('0xa')](_0xdc48('0x35'),_0x1d6c3b[_0xdc48('0x36')]),_0x1d6c3b);if(channels[_0x1d6c3b[_0xdc48('0x37')]][_0xdc48('0xc')]==_0x1d6c3b[_0xdc48('0x38')]){utils['info'](util[_0xdc48('0xa')](_0xdc48('0x39'),_0x1d6c3b[_0xdc48('0x36')],_0x1d6c3b[_0xdc48('0x37')],_0x1d6c3b[_0xdc48('0x3a')]));channels[_0x1d6c3b[_0xdc48('0x37')]][_0xdc48('0x3b')]=_0x1d6c3b['secondtransfererchannel'];channels[_0x1d6c3b[_0xdc48('0x37')]][_0xdc48('0x3c')]=_0xdc48('0x3d');}else if(channels[_0x1d6c3b[_0xdc48('0x37')]][_0xdc48('0xc')]=_0x1d6c3b['transfertargetchannel']){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x39'),_0x1d6c3b[_0xdc48('0x36')],_0x1d6c3b[_0xdc48('0x37')],_0x1d6c3b['origtransfererchannel']));channels[_0x1d6c3b[_0xdc48('0x37')]][_0xdc48('0x3b')]=_0x1d6c3b['origtransfererchannel'];channels[_0x1d6c3b['localtwolinkedid']][_0xdc48('0x3c')]='_attended';}}}catch(_0x53ae49){utils[_0xdc48('0x1f')](util[_0xdc48('0xa')]('[%s][calls][attendedtransfer]',_0x1d6c3b[_0xdc48('0x36')]),_0x53ae49);}};exports[_0xdc48('0x3e')]=function(_0x3acd17){try{if(!_[_0xdc48('0x22')](channels[_0x3acd17[_0xdc48('0x7')]])){utils['debug'](util['format'](_0xdc48('0x3f'),_0x3acd17[_0xdc48('0x7')]),_0x3acd17);channels[_0x3acd17['uniqueid']][_0xdc48('0x40')]=utils[_0xdc48('0x1d')]();utils['info'](util[_0xdc48('0xa')](_0xdc48('0x41'),_0x3acd17[_0xdc48('0x7')],channels[_0x3acd17[_0xdc48('0x7')]][_0xdc48('0x40')]));}}catch(_0x5ea3a3){utils['error'](util['format'](_0xdc48('0x3f'),_0x3acd17['uniqueid']),_0x5ea3a3);}};exports[_0xdc48('0x42')]=function(_0x3de330){try{if(!_[_0xdc48('0x22')](channels[_0x3de330['uniqueid']])){utils[_0xdc48('0x18')](util[_0xdc48('0xa')](_0xdc48('0x43'),_0x3de330[_0xdc48('0x7')]),_0x3de330);if(!_[_0xdc48('0x22')](channels[_0x3de330[_0xdc48('0x7')]][_0xdc48('0x40')])){channels[_0x3de330['uniqueid']]['mohtime']+=utils[_0xdc48('0x30')](utils[_0xdc48('0x1d')](),channels[_0x3de330['uniqueid']][_0xdc48('0x40')]);utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x44'),_0x3de330['uniqueid'],channels[_0x3de330[_0xdc48('0x7')]]['mohtime']));delete channels[_0x3de330[_0xdc48('0x7')]][_0xdc48('0x40')];}}}catch(_0xbcd070){utils[_0xdc48('0x1f')](util[_0xdc48('0xa')](_0xdc48('0x43'),_0x3de330[_0xdc48('0x7')]),_0xbcd070);}};exports[_0xdc48('0x45')]=function(_0x51d184){try{if(!_['isNil'](channels[_0x51d184[_0xdc48('0x7')]])){utils[_0xdc48('0x18')](util[_0xdc48('0xa')](_0xdc48('0x46'),_0x51d184[_0xdc48('0x7')]),_0x51d184);if(!_[_0xdc48('0x22')](_0x51d184['variable'][_0xdc48('0x47')])){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x48'),_0x51d184[_0xdc48('0x7')],_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]]['source']=_0x51d184['value'];}if(!_[_0xdc48('0x22')](_0x51d184['variable'][_0xdc48('0x4a')])){utils[_0xdc48('0x9')](util['format'](_0xdc48('0x4b'),_0x51d184[_0xdc48('0x7')],_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]]['destination']=_0x51d184[_0xdc48('0x49')];channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x2a')]='\x22'+_0x51d184['value']+_0xdc48('0x4c')+_0x51d184['value']+'>';}if(!_[_0xdc48('0x22')](_0x51d184['variable'][_0xdc48('0x4d')])||!_[_0xdc48('0x22')](_0x51d184[_0xdc48('0x4e')][_0xdc48('0x4f')])){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x50'),_0x51d184[_0xdc48('0x7')],!_[_0xdc48('0x22')](_0x51d184['variable'][_0xdc48('0x4d')])?_0xdc48('0x4d'):_0xdc48('0x4f'),_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x2a')]=_0x51d184[_0xdc48('0x49')];}if(!_[_0xdc48('0x22')](_0x51d184[_0xdc48('0x4e')][_0xdc48('0x51')])||!_['isNil'](_0x51d184[_0xdc48('0x4e')]['xmcs-queue'])){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x50'),_0x51d184[_0xdc48('0x7')],!_['isNil'](_0x51d184[_0xdc48('0x4e')][_0xdc48('0x51')])?_0xdc48('0x51'):_0xdc48('0x52'),_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]]['lastapplication']=_0xdc48('0x53');channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x54')]=_0x51d184[_0xdc48('0x49')];channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0xd')]=!![];}if(!_['isNil'](_0x51d184[_0xdc48('0x4e')]['xmd-contactid'])){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x55'),_0x51d184[_0xdc48('0x7')],_0x51d184['value']));channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x56')]=_0x51d184['value'];}if(!_[_0xdc48('0x22')](_0x51d184[_0xdc48('0x4e')]['xmd-cdrtype'])){utils['info'](util[_0xdc48('0xa')](_0xdc48('0x57'),_0x51d184[_0xdc48('0x7')],_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x58')]=_0x51d184['value'];}if(!_['isNil'](_0x51d184['variable']['outboundrouteid'])){utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x59'),_0x51d184[_0xdc48('0x7')],_0x51d184['value']));channels[_0x51d184[_0xdc48('0x7')]]['routeid']=_0x51d184[_0xdc48('0x49')];}if(!_[_0xdc48('0x22')](_0x51d184[_0xdc48('0x4e')][_0xdc48('0x5a')])){utils['info'](util[_0xdc48('0xa')](_0xdc48('0x5b'),_0x51d184[_0xdc48('0x7')],_0x51d184[_0xdc48('0x49')]));channels[_0x51d184[_0xdc48('0x7')]][_0xdc48('0x5a')]=_0x51d184[_0xdc48('0x49')];}}}catch(_0x17e3cd){utils[_0xdc48('0x1f')](util[_0xdc48('0xa')](_0xdc48('0x46'),_0x51d184[_0xdc48('0x7')]),_0x17e3cd);}};exports['newexten']=function(_0x985e2){try{if(!_[_0xdc48('0x22')](channels[_0x985e2[_0xdc48('0x7')]])){utils['debug'](util[_0xdc48('0xa')](_0xdc48('0x5c'),_0x985e2['uniqueid']),_0x985e2);utils[_0xdc48('0x9')](util[_0xdc48('0xa')](_0xdc48('0x5d'),_0x985e2[_0xdc48('0x7')],_0x985e2['application'],_0x985e2[_0xdc48('0x5e')]));if(_0x985e2['application'][_0xdc48('0x5f')]()==_0xdc48('0x60')&&_[_0xdc48('0x61')](_0x985e2[_0xdc48('0x5e')][_0xdc48('0x5f')](),'cdr')){var _0xe92176=_0x985e2[_0xdc48('0x5e')][_0xdc48('0x62')]('=');var _0xb5f32d=_0xe92176[0x0]['substring'](_0xe92176[0x0]['lastIndexOf']('(')+0x1,_0xe92176[0x0][_0xdc48('0x63')](')'));var _0xcd6c2c=_0xe92176[0x1];channels[_0x985e2['uniqueid']][_0xb5f32d]=_0xcd6c2c;}if(!_[_0xdc48('0x64')]([_0xdc48('0x29'),_0xdc48('0x65'),_0xdc48('0x66'),_0xdc48('0x60'),_0xdc48('0x67')],_0x985e2[_0xdc48('0x68')]['toLowerCase']())){channels[_0x985e2[_0xdc48('0x7')]]['lastapplication']=_0x985e2[_0xdc48('0x68')];channels[_0x985e2[_0xdc48('0x7')]][_0xdc48('0x54')]=_0x985e2[_0xdc48('0x5e')];}}}catch(_0x29960d){utils[_0xdc48('0x1f')](util[_0xdc48('0xa')](_0xdc48('0x5c'),_0x985e2[_0xdc48('0x7')]),_0x29960d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 815f06b..ce165b4 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 _0xfcd2=['[core]\x20error','close','[core]\x20close','managerevent','info','shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x2ef9ce,_0x39e0ea){var _0x578d58=function(_0x39a8f8){while(--_0x39a8f8){_0x2ef9ce['push'](_0x2ef9ce['shift']());}};_0x578d58(++_0x39e0ea);}(_0xfcd2,0x1d8));var _0x2fcd=function(_0x3a187e,_0x1d34c2){_0x3a187e=_0x3a187e-0x0;var _0x588537=_0xfcd2[_0x3a187e];return _0x588537;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x2fcd('0x0')]('[core]\x20connected');};exports[_0x2fcd('0x1')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x2fcd('0x2')]=function(){utils[_0x2fcd('0x0')](_0x2fcd('0x3'));};exports[_0x2fcd('0x4')]=function(_0x26e6f9){utils['error'](_0x2fcd('0x5'),_0x26e6f9);};exports[_0x2fcd('0x6')]=function(){utils[_0x2fcd('0x0')](_0x2fcd('0x7'));};exports[_0x2fcd('0x8')]=function(_0x16daf3){}; \ No newline at end of file +var _0xa786=['[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xa786,0x71));var _0x6a78=function(_0x14c734,_0x4217da){_0x14c734=_0x14c734-0x0;var _0x51d7c5=_0xa786[_0x14c734];return _0x51d7c5;};'use strict';var utils=require(_0x6a78('0x0'));exports[_0x6a78('0x1')]=function(){utils[_0x6a78('0x2')]('[core]\x20connected');};exports[_0x6a78('0x3')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x6a78('0x4')]=function(){utils[_0x6a78('0x2')](_0x6a78('0x5'));};exports[_0x6a78('0x6')]=function(_0x41bb73){utils[_0x6a78('0x6')](_0x6a78('0x7'),_0x41bb73);};exports['close']=function(){utils[_0x6a78('0x2')](_0x6a78('0x8'));};exports[_0x6a78('0x9')]=function(_0x30debf){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 5c66ec6..f193375 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 _0xffa4=['startsWith','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','error','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','uniqueid','application','appdata','toLowerCase','set'];(function(_0x39cb96,_0x5dbaa9){var _0x3170d5=function(_0x3993f3){while(--_0x3993f3){_0x39cb96['push'](_0x39cb96['shift']());}};_0x3170d5(++_0x5dbaa9);}(_0xffa4,0xe0));var _0x4ffa=function(_0x42f1e7,_0x3a1279){_0x42f1e7=_0x42f1e7-0x0;var _0x460d91=_0xffa4[_0x42f1e7];return _0x460d91;};'use strict';var _=require(_0x4ffa('0x0'));var util=require(_0x4ffa('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x4fb205){utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')](_0x4ffa('0x4'),_0x4fb205['uniqueid'],_0x4fb205['channel'],_0x4fb205[_0x4ffa('0x5')],_0x4fb205['calleridnum'],_0x4fb205[_0x4ffa('0x6')],_0x4fb205['dialstatus']));utils[_0x4ffa('0x7')](_0x4ffa('0x8'),_0x4fb205);delete dials[_0x4fb205['uniqueid']];}exports['newexten']=function(_0x349f06){try{utils[_0x4ffa('0x9')](util['format'](_0x4ffa('0xa'),_0x349f06[_0x4ffa('0xb')]),_0x349f06);utils['info'](util[_0x4ffa('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x349f06[_0x4ffa('0xb')],_0x349f06[_0x4ffa('0xc')],_0x349f06[_0x4ffa('0xd')]));if(_0x349f06[_0x4ffa('0xc')][_0x4ffa('0xe')]()==_0x4ffa('0xf')&&_[_0x4ffa('0x10')](_0x349f06[_0x4ffa('0xd')]['toLowerCase'](),_0x4ffa('0x11'))){var _0x3052a1=_0x349f06['appdata']['split']('=');dials[_0x349f06['uniqueid']]={'routeId':_0x3052a1[0x1]};}}catch(_0x30df15){utils['error'](util[_0x4ffa('0x3')](_0x4ffa('0xa'),_0x349f06['uniqueid']),_0x30df15);}};exports[_0x4ffa('0x12')]=function(_0x3c869a){try{utils[_0x4ffa('0x9')](util[_0x4ffa('0x3')](_0x4ffa('0x13'),_0x3c869a[_0x4ffa('0xb')]),_0x3c869a);if(!_[_0x4ffa('0x14')](_0x3c869a[_0x4ffa('0x15')][_0x4ffa('0x16')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3c869a[_0x4ffa('0xb')],_0x3c869a[_0x4ffa('0x17')]));dials[_0x3c869a[_0x4ffa('0xb')]]={'routeId':_0x3c869a['value']};}}catch(_0x580e9c){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x13'),_0x3c869a['uniqueid']),_0x580e9c);}};exports[_0x4ffa('0x19')]=function(_0x22c41c){try{if(!_['isNil'](dials[_0x22c41c[_0x4ffa('0xb')]])){utils[_0x4ffa('0x9')](util['format']('[%s][dials][dialbegin]',_0x22c41c[_0x4ffa('0xb')]),_0x22c41c);dials[_0x22c41c[_0x4ffa('0xb')]]=_[_0x4ffa('0x1a')](dials[_0x22c41c[_0x4ffa('0xb')]],_0x22c41c);dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]=utils[_0x4ffa('0x1c')]();dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1d')]=_0x4ffa('0x1e');utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x22c41c[_0x4ffa('0xb')],dials[_0x22c41c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]));}}catch(_0x3dee50){utils[_0x4ffa('0x18')](util['format'](_0x4ffa('0x1f'),_0x22c41c[_0x4ffa('0xb')]),_0x3dee50);}};exports[_0x4ffa('0x20')]=function(_0x32d7dc){try{if(!_['isNil'](dials[_0x32d7dc[_0x4ffa('0xb')]])){utils['debug'](util['format'](_0x4ffa('0x21'),_0x32d7dc[_0x4ffa('0xb')]),_0x32d7dc);dials[_0x32d7dc[_0x4ffa('0xb')]]['dialstatus']=_0x32d7dc[_0x4ffa('0x22')];if(_0x32d7dc[_0x4ffa('0x22')]==_0x4ffa('0x23')){dials[_0x32d7dc['uniqueid']]=_[_0x4ffa('0x1a')](dials[_0x32d7dc['uniqueid']],_0x32d7dc);dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x24')]=utils['now']();dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x1d')]='connect';utils[_0x4ffa('0x2')](util[_0x4ffa('0x3')](_0x4ffa('0x25'),_0x32d7dc[_0x4ffa('0xb')],_0x32d7dc[_0x4ffa('0x22')],dials[_0x32d7dc[_0x4ffa('0xb')]][_0x4ffa('0x24')]));}else{utils['info'](util[_0x4ffa('0x3')](_0x4ffa('0x26'),_0x32d7dc[_0x4ffa('0xb')],_0x32d7dc[_0x4ffa('0x22')]));}}}catch(_0x1d871b){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x21'),_0x32d7dc[_0x4ffa('0xb')]),_0x1d871b);}};exports[_0x4ffa('0x27')]=function(_0x57738c){try{if(!_['isNil'](dials[_0x57738c['uniqueid']])){utils['debug'](util[_0x4ffa('0x3')](_0x4ffa('0x28'),_0x57738c[_0x4ffa('0xb')]),_0x57738c);utils['info'](util[_0x4ffa('0x3')](_0x4ffa('0x29'),_0x57738c[_0x4ffa('0xb')],_0x57738c['calleridnum'],_0x57738c[_0x4ffa('0x2a')],_0x57738c[_0x4ffa('0x2b')]));dials[_0x57738c[_0x4ffa('0xb')]]=_[_0x4ffa('0x1a')](dials[_0x57738c['uniqueid']],{'endtime':utils[_0x4ffa('0x1c')](),'lastevent':_0x4ffa('0x2c')});dials[_0x57738c[_0x4ffa('0xb')]]['duration']=utils[_0x4ffa('0x2d')](dials[_0x57738c['uniqueid']][_0x4ffa('0x2e')],dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]);dials[_0x57738c[_0x4ffa('0xb')]]['holdtime']=utils[_0x4ffa('0x2d')](dials[_0x57738c[_0x4ffa('0xb')]]['answertime']||dials[_0x57738c['uniqueid']][_0x4ffa('0x2e')],dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x1b')]);dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x2f')]=dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x24')]?utils[_0x4ffa('0x2d')](dials[_0x57738c[_0x4ffa('0xb')]][_0x4ffa('0x2e')],dials[_0x57738c['uniqueid']][_0x4ffa('0x24')]):0x0;writeDB(dials[_0x57738c['uniqueid']]);}}catch(_0x2bc31c){utils[_0x4ffa('0x18')](util[_0x4ffa('0x3')](_0x4ffa('0x28'),_0x57738c[_0x4ffa('0xb')]),_0x2bc31c);}}; \ No newline at end of file +var _0xf4da=['billableseconds','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','request','newexten','debug','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','assign','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','holdtime'];(function(_0xdce631,_0x30fc29){var _0x33edae=function(_0x4cf469){while(--_0x4cf469){_0xdce631['push'](_0xdce631['shift']());}};_0x33edae(++_0x30fc29);}(_0xf4da,0x14a));var _0xaf4d=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xf4da[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xaf4d('0x0'));var dials={};function writeDB(_0x4c7fee){utils[_0xaf4d('0x1')](util[_0xaf4d('0x2')](_0xaf4d('0x3'),_0x4c7fee[_0xaf4d('0x4')],_0x4c7fee[_0xaf4d('0x5')],_0x4c7fee['dialstring'],_0x4c7fee[_0xaf4d('0x6')],_0x4c7fee[_0xaf4d('0x7')],_0x4c7fee['dialstatus']));utils[_0xaf4d('0x8')]('CreateVoiceDialReport',_0x4c7fee);delete dials[_0x4c7fee[_0xaf4d('0x4')]];}exports[_0xaf4d('0x9')]=function(_0x2edc4d){try{utils[_0xaf4d('0xa')](util[_0xaf4d('0x2')]('[%s][dials][newexten]',_0x2edc4d[_0xaf4d('0x4')]),_0x2edc4d);utils[_0xaf4d('0x1')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2edc4d[_0xaf4d('0x4')],_0x2edc4d[_0xaf4d('0xb')],_0x2edc4d[_0xaf4d('0xc')]));if(_0x2edc4d[_0xaf4d('0xb')][_0xaf4d('0xd')]()==_0xaf4d('0xe')&&_[_0xaf4d('0xf')](_0x2edc4d['appdata']['toLowerCase'](),_0xaf4d('0x10'))){var _0x308bc4=_0x2edc4d[_0xaf4d('0xc')]['split']('=');dials[_0x2edc4d['uniqueid']]={'routeId':_0x308bc4[0x1]};}}catch(_0x155e40){utils['error'](util['format']('[%s][dials][newexten]',_0x2edc4d[_0xaf4d('0x4')]),_0x155e40);}};exports[_0xaf4d('0x11')]=function(_0x2df83d){try{utils['debug'](util[_0xaf4d('0x2')](_0xaf4d('0x12'),_0x2df83d[_0xaf4d('0x4')]),_0x2df83d);if(!_[_0xaf4d('0x13')](_0x2df83d[_0xaf4d('0x14')]['outboundrouteid'])){utils['info'](util['format'](_0xaf4d('0x15'),_0x2df83d[_0xaf4d('0x4')],_0x2df83d['value']));dials[_0x2df83d[_0xaf4d('0x4')]]={'routeId':_0x2df83d[_0xaf4d('0x16')]};}}catch(_0x359e27){utils[_0xaf4d('0x17')](util[_0xaf4d('0x2')](_0xaf4d('0x12'),_0x2df83d[_0xaf4d('0x4')]),_0x359e27);}};exports[_0xaf4d('0x18')]=function(_0x1446b0){try{if(!_[_0xaf4d('0x13')](dials[_0x1446b0[_0xaf4d('0x4')]])){utils[_0xaf4d('0xa')](util[_0xaf4d('0x2')](_0xaf4d('0x19'),_0x1446b0[_0xaf4d('0x4')]),_0x1446b0);dials[_0x1446b0[_0xaf4d('0x4')]]=_['assign'](dials[_0x1446b0['uniqueid']],_0x1446b0);dials[_0x1446b0[_0xaf4d('0x4')]][_0xaf4d('0x1a')]=utils[_0xaf4d('0x1b')]();dials[_0x1446b0[_0xaf4d('0x4')]][_0xaf4d('0x1c')]='called';utils[_0xaf4d('0x1')](util[_0xaf4d('0x2')](_0xaf4d('0x1d'),_0x1446b0[_0xaf4d('0x4')],dials[_0x1446b0[_0xaf4d('0x4')]][_0xaf4d('0x1a')]));}}catch(_0x2081c9){utils[_0xaf4d('0x17')](util[_0xaf4d('0x2')](_0xaf4d('0x19'),_0x1446b0[_0xaf4d('0x4')]),_0x2081c9);}};exports[_0xaf4d('0x1e')]=function(_0x1fc593){try{if(!_[_0xaf4d('0x13')](dials[_0x1fc593['uniqueid']])){utils[_0xaf4d('0xa')](util[_0xaf4d('0x2')](_0xaf4d('0x1f'),_0x1fc593[_0xaf4d('0x4')]),_0x1fc593);dials[_0x1fc593['uniqueid']][_0xaf4d('0x20')]=_0x1fc593[_0xaf4d('0x20')];if(_0x1fc593['dialstatus']==_0xaf4d('0x21')){dials[_0x1fc593['uniqueid']]=_[_0xaf4d('0x22')](dials[_0x1fc593['uniqueid']],_0x1fc593);dials[_0x1fc593[_0xaf4d('0x4')]]['answertime']=utils[_0xaf4d('0x1b')]();dials[_0x1fc593['uniqueid']][_0xaf4d('0x1c')]='connect';utils[_0xaf4d('0x1')](util['format'](_0xaf4d('0x23'),_0x1fc593[_0xaf4d('0x4')],_0x1fc593['dialstatus'],dials[_0x1fc593['uniqueid']][_0xaf4d('0x24')]));}else{utils['info'](util[_0xaf4d('0x2')](_0xaf4d('0x25'),_0x1fc593[_0xaf4d('0x4')],_0x1fc593['dialstatus']));}}}catch(_0x11ce2e){utils[_0xaf4d('0x17')](util[_0xaf4d('0x2')](_0xaf4d('0x1f'),_0x1fc593[_0xaf4d('0x4')]),_0x11ce2e);}};exports[_0xaf4d('0x26')]=function(_0x58051e){try{if(!_[_0xaf4d('0x13')](dials[_0x58051e['uniqueid']])){utils['debug'](util['format'](_0xaf4d('0x27'),_0x58051e[_0xaf4d('0x4')]),_0x58051e);utils[_0xaf4d('0x1')](util[_0xaf4d('0x2')](_0xaf4d('0x28'),_0x58051e[_0xaf4d('0x4')],_0x58051e[_0xaf4d('0x6')],_0x58051e['calleridname'],_0x58051e[_0xaf4d('0x29')]));dials[_0x58051e[_0xaf4d('0x4')]]=_[_0xaf4d('0x22')](dials[_0x58051e[_0xaf4d('0x4')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x2a')]=utils[_0xaf4d('0x2b')](dials[_0x58051e['uniqueid']][_0xaf4d('0x2c')],dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x1a')]);dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x2d')]=utils[_0xaf4d('0x2b')](dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x24')]||dials[_0x58051e['uniqueid']][_0xaf4d('0x2c')],dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x1a')]);dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x2e')]=dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x24')]?utils[_0xaf4d('0x2b')](dials[_0x58051e[_0xaf4d('0x4')]][_0xaf4d('0x2c')],dials[_0x58051e[_0xaf4d('0x4')]]['answertime']):0x0;writeDB(dials[_0x58051e['uniqueid']]);}}catch(_0x599702){utils[_0xaf4d('0x17')](util['format'](_0xaf4d('0x27'),_0x58051e['uniqueid']),_0x599702);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 740f8e5..54daa94 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 _0x8250=['error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','xdr','disabled','env','production','local','asterisk','port','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x351194,_0x42baf5){var _0x1c35e2=function(_0x5608a9){while(--_0x5608a9){_0x351194['push'](_0x351194['shift']());}};_0x1c35e2(++_0x42baf5);}(_0x8250,0xf5));var _0x0825=function(_0xd8b4f,_0x3fe442){_0xd8b4f=_0xd8b4f-0x0;var _0x172698=_0x8250[_0xd8b4f];return _0x172698;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x0825('0x0'));var util=require('util');var isXDREnabled=config[_0x0825('0x1')]&&config['xdr']['disabled']?!config[_0x0825('0x1')][_0x0825('0x2')]:!![];var isProduction=config[_0x0825('0x3')]===_0x0825('0x4')||![];var isLocalAsterisk=config['xdr']&&config[_0x0825('0x1')][_0x0825('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x0825('0x6')][_0x0825('0x7')],config[_0x0825('0x6')]['ip'],config[_0x0825('0x6')]['username'],config[_0x0825('0x6')][_0x0825('0x8')],!![]);ami[_0x0825('0x9')]();if(!isXDREnabled){utils['info'](_0x0825('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0825('0xb')](_0x0825('0xc'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x0825('0xd'));var dials=require(_0x0825('0xe'));var transfers=require('./transfers.controller');var core=require(_0x0825('0xf'));ami['on']('connect',core[_0x0825('0x10')]);ami['on'](_0x0825('0x11'),core[_0x0825('0x11')]);ami['on'](_0x0825('0x12'),core[_0x0825('0x12')]);ami['on'](_0x0825('0x13'),core[_0x0825('0x13')]);ami['on'](_0x0825('0x14'),core['close']);ami['on'](_0x0825('0x15'),core[_0x0825('0x15')]);ami['on'](_0x0825('0x16'),function(_0x1a419a){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x18'),_0x1a419a[_0x0825('0x19')]),_0x1a419a);members[_0x0825('0x16')](_0x1a419a);}catch(_0x5579eb){utils[_0x0825('0x13')](util['format']('[%s][index][devicestatechange]',_0x1a419a[_0x0825('0x19')]),_0x5579eb);}});ami['on'](_0x0825('0x1a'),function(_0x28abe9){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x1c'),_0x28abe9[_0x0825('0x1d')]),_0x28abe9);agents[_0x0825('0x1a')](_0x28abe9);}catch(_0x4364b1){utils['error'](util[_0x0825('0x1b')](_0x0825('0x1c'),_0x28abe9['uniqueid']),_0x4364b1);}});ami['on'](_0x0825('0x1e'),function(_0x4c5fe3){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x1f'),_0x4c5fe3[_0x0825('0x1d')]),_0x4c5fe3);agents[_0x0825('0x1e')](_0x4c5fe3);}catch(_0x4b144e){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][agentringnoanswer]',_0x4c5fe3[_0x0825('0x1d')]),_0x4b144e);}});ami['on'](_0x0825('0x20'),function(_0x5afd57){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x21'),_0x5afd57[_0x0825('0x1d')]),_0x5afd57);agents[_0x0825('0x20')](_0x5afd57);queues[_0x0825('0x20')](_0x5afd57);}catch(_0x38ae86){utils[_0x0825('0x13')](util['format']('[%s][index][agentconnect]',_0x5afd57[_0x0825('0x1d')]),_0x38ae86);}});ami['on'](_0x0825('0x22'),function(_0x2717fd){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][agentcomplete]',_0x2717fd[_0x0825('0x1d')]),_0x2717fd);agents[_0x0825('0x22')](_0x2717fd);queues[_0x0825('0x22')](_0x2717fd);members[_0x0825('0x22')](_0x2717fd);}catch(_0x3a89ae){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x23'),_0x2717fd[_0x0825('0x1d')]),_0x3a89ae);}});ami['on'](_0x0825('0x24'),function(_0xc072a3){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x25'),_0xc072a3['uniqueid']),_0xc072a3);agents[_0x0825('0x24')](_0xc072a3);queues[_0x0825('0x24')](_0xc072a3);}catch(_0x1b03b6){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x25'),_0xc072a3['uniqueid']),_0x1b03b6);}});ami['on']('queuecallerjoin',function(_0x4e9280){try{utils['debug'](util[_0x0825('0x1b')](_0x0825('0x26'),_0x4e9280[_0x0825('0x1d')]),_0x4e9280);queues['queuecallerjoin'](_0x4e9280);recordings[_0x0825('0x27')](_0x4e9280);}catch(_0x292950){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x26'),_0x4e9280['uniqueid']),_0x292950);}});ami['on'](_0x0825('0x28'),function(_0x585364){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x29'),_0x585364[_0x0825('0x1d')]),_0x585364);queues[_0x0825('0x28')](_0x585364);}catch(_0x13d347){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x29'),_0x585364['uniqueid']),_0x13d347);}});ami['on'](_0x0825('0x2a'),function(_0x45eef1){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][musiconholdstart]',_0x45eef1[_0x0825('0x1d')]),_0x45eef1);queues[_0x0825('0x2a')](_0x45eef1);calls[_0x0825('0x2a')](_0x45eef1);}catch(_0x40c3b6){utils['error'](util[_0x0825('0x1b')](_0x0825('0x2b'),_0x45eef1[_0x0825('0x1d')]),_0x40c3b6);}});ami['on'](_0x0825('0x2c'),function(_0x5783d0){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x2d'),_0x5783d0[_0x0825('0x1d')]),_0x5783d0);queues[_0x0825('0x2c')](_0x5783d0);calls[_0x0825('0x2c')](_0x5783d0);}catch(_0x5acda3){utils[_0x0825('0x13')](util['format'](_0x0825('0x2d'),_0x5783d0['uniqueid']),_0x5acda3);}});ami['on'](_0x0825('0x2e'),function(_0x3f19b6){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][newstate]',_0x3f19b6[_0x0825('0x1d')]),_0x3f19b6);calls[_0x0825('0x2e')](_0x3f19b6);recordings[_0x0825('0x2e')](_0x3f19b6);}catch(_0x234472){utils['error'](util[_0x0825('0x1b')]('[%s][index][newstate]',_0x3f19b6[_0x0825('0x1d')]),_0x234472);}});ami['on']('hangup',function(_0x512087){try{utils['debug'](util[_0x0825('0x1b')]('[%s][index][hangup]',_0x512087[_0x0825('0x1d')]),_0x512087);calls[_0x0825('0x2f')](_0x512087);recordings[_0x0825('0x2f')](_0x512087);dials[_0x0825('0x2f')](_0x512087);agents['hangup'](_0x512087);queues['hangup'](_0x512087);}catch(_0x2c7aa8){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x30'),_0x512087['uniqueid']),_0x2c7aa8);}});ami['on'](_0x0825('0x31'),function(_0x323b60){try{utils[_0x0825('0x17')](util['format'](_0x0825('0x32'),_0x323b60[_0x0825('0x1d')]),_0x323b60);members[_0x0825('0x31')](_0x323b60);}catch(_0xf1986f){utils[_0x0825('0x13')](util['format'](_0x0825('0x32'),_0x323b60[_0x0825('0x1d')]),_0xf1986f);}});ami['on'](_0x0825('0x33'),function(_0xb35a4){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x34'),_0xb35a4[_0x0825('0x1d')]),_0xb35a4);queues[_0x0825('0x33')](_0xb35a4);agents[_0x0825('0x33')](_0xb35a4);transfers['blindtransfer'](_0xb35a4);recordings[_0x0825('0x33')](_0xb35a4);}catch(_0x1a7e02){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x34'),_0xb35a4[_0x0825('0x1d')]),_0x1a7e02);}});ami['on'](_0x0825('0x35'),function(_0x2f25f6){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')]('[%s][index][attendedtransfer]',_0x2f25f6[_0x0825('0x36')]),_0x2f25f6);queues[_0x0825('0x35')](_0x2f25f6);transfers[_0x0825('0x35')](_0x2f25f6);agents[_0x0825('0x35')](_0x2f25f6);calls[_0x0825('0x35')](_0x2f25f6);}catch(_0x56d8bf){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][attendedtransfer]',_0x2f25f6[_0x0825('0x36')]),_0x56d8bf);}});ami['on']('varset',function(_0xc7f78f){try{utils['debug'](util[_0x0825('0x1b')]('[%s][index][varset]',_0xc7f78f[_0x0825('0x1d')]),_0xc7f78f);queues[_0x0825('0x37')](_0xc7f78f);recordings['varset'](_0xc7f78f);calls[_0x0825('0x37')](_0xc7f78f);dials[_0x0825('0x37')](_0xc7f78f);}catch(_0x299c88){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x38'),_0xc7f78f[_0x0825('0x1d')]),_0x299c88);}});ami['on']('newexten',function(_0x577210){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x39'),_0x577210[_0x0825('0x1d')]),_0x577210);calls[_0x0825('0x3a')](_0x577210);recordings['newexten'](_0x577210);dials[_0x0825('0x3a')](_0x577210);}catch(_0x23db92){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x39'),_0x577210['uniqueid']),_0x23db92);}});ami['on']('newchannel',function(_0x405a23){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x3b'),_0x405a23[_0x0825('0x1d')]),_0x405a23);calls[_0x0825('0x3c')](_0x405a23);recordings['newchannel'](_0x405a23);}catch(_0x419f1a){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x3b'),_0x405a23['uniqueid']),_0x419f1a);}});ami['on']('dialbegin',function(_0x41d2d5){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x3d'),_0x41d2d5['uniqueid']),_0x41d2d5);dials[_0x0825('0x3e')](_0x41d2d5);}catch(_0x19c810){utils[_0x0825('0x13')](util[_0x0825('0x1b')](_0x0825('0x3f'),_0x41d2d5[_0x0825('0x1d')]),_0x19c810);}});ami['on'](_0x0825('0x40'),function(_0x95368d){try{utils[_0x0825('0x17')](util[_0x0825('0x1b')](_0x0825('0x41'),_0x95368d[_0x0825('0x1d')]),_0x95368d);dials[_0x0825('0x40')](_0x95368d);}catch(_0x5894d8){utils[_0x0825('0x13')](util[_0x0825('0x1b')]('[%s][index][dialend]',_0x95368d['uniqueid']),_0x5894d8);}});} \ No newline at end of file +var _0xee87=['newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','xdr','disabled','env','production','asterisk','username','keepConnected','info','XDR\x20DISABLED','./agents.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','agentcalled','debug','format','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]'];(function(_0x15dfa5,_0x5e757b){var _0x297fbb=function(_0x39ccdb){while(--_0x39ccdb){_0x15dfa5['push'](_0x15dfa5['shift']());}};_0x297fbb(++_0x5e757b);}(_0xee87,0x80));var _0x7ee8=function(_0xfd7ba7,_0x3a6cda){_0xfd7ba7=_0xfd7ba7-0x0;var _0x35c5c6=_0xee87[_0xfd7ba7];return _0x35c5c6;};var AsteriskManager=require('asterisk-manager');var config=require(_0x7ee8('0x0'));var utils=require(_0x7ee8('0x1'));var util=require('util');var isXDREnabled=config[_0x7ee8('0x2')]&&config[_0x7ee8('0x2')][_0x7ee8('0x3')]?!config[_0x7ee8('0x2')][_0x7ee8('0x3')]:!![];var isProduction=config[_0x7ee8('0x4')]===_0x7ee8('0x5')||![];var isLocalAsterisk=config[_0x7ee8('0x2')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x7ee8('0x6')]['port'],config[_0x7ee8('0x6')]['ip'],config[_0x7ee8('0x6')][_0x7ee8('0x7')],config[_0x7ee8('0x6')]['password'],!![]);ami[_0x7ee8('0x8')]();if(!isXDREnabled){utils[_0x7ee8('0x9')](_0x7ee8('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x7ee8('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x7ee8('0xb'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x7ee8('0xc'));var members=require(_0x7ee8('0xd'));var dials=require(_0x7ee8('0xe'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on']('connect',core[_0x7ee8('0xf')]);ami['on']('shutdown',core[_0x7ee8('0x10')]);ami['on'](_0x7ee8('0x11'),core[_0x7ee8('0x11')]);ami['on'](_0x7ee8('0x12'),core[_0x7ee8('0x12')]);ami['on']('close',core[_0x7ee8('0x13')]);ami['on'](_0x7ee8('0x14'),core[_0x7ee8('0x14')]);ami['on']('devicestatechange',function(_0x493bc8){try{utils['debug'](util['format'](_0x7ee8('0x15'),_0x493bc8['device']),_0x493bc8);members['devicestatechange'](_0x493bc8);}catch(_0x4fe547){utils[_0x7ee8('0x12')](util['format'](_0x7ee8('0x15'),_0x493bc8['device']),_0x4fe547);}});ami['on'](_0x7ee8('0x16'),function(_0x4ce15f){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')]('[%s][index][agentcalled]',_0x4ce15f['uniqueid']),_0x4ce15f);agents[_0x7ee8('0x16')](_0x4ce15f);}catch(_0x4b8382){utils[_0x7ee8('0x12')](util['format']('[%s][index][agentcalled]',_0x4ce15f[_0x7ee8('0x19')]),_0x4b8382);}});ami['on']('agentringnoanswer',function(_0x27a7bb){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')]('[%s][index][agentringnoanswer]',_0x27a7bb[_0x7ee8('0x19')]),_0x27a7bb);agents['agentringnoanswer'](_0x27a7bb);}catch(_0xc4bf5a){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x1a'),_0x27a7bb[_0x7ee8('0x19')]),_0xc4bf5a);}});ami['on'](_0x7ee8('0x1b'),function(_0x2762d9){try{utils[_0x7ee8('0x17')](util['format'](_0x7ee8('0x1c'),_0x2762d9[_0x7ee8('0x19')]),_0x2762d9);agents[_0x7ee8('0x1b')](_0x2762d9);queues[_0x7ee8('0x1b')](_0x2762d9);}catch(_0x43a7c9){utils[_0x7ee8('0x12')](util['format']('[%s][index][agentconnect]',_0x2762d9['uniqueid']),_0x43a7c9);}});ami['on'](_0x7ee8('0x1d'),function(_0x55e519){try{utils[_0x7ee8('0x17')](util['format'](_0x7ee8('0x1e'),_0x55e519[_0x7ee8('0x19')]),_0x55e519);agents['agentcomplete'](_0x55e519);queues[_0x7ee8('0x1d')](_0x55e519);members[_0x7ee8('0x1d')](_0x55e519);}catch(_0x42cc94){utils[_0x7ee8('0x12')](util['format'](_0x7ee8('0x1e'),_0x55e519[_0x7ee8('0x19')]),_0x42cc94);}});ami['on']('queuecallerabandon',function(_0x1b58d9){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')]('[%s][index][queuecallerabandon]',_0x1b58d9[_0x7ee8('0x19')]),_0x1b58d9);agents['queuecallerabandon'](_0x1b58d9);queues['queuecallerabandon'](_0x1b58d9);}catch(_0x4a4a1d){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x1f'),_0x1b58d9[_0x7ee8('0x19')]),_0x4a4a1d);}});ami['on'](_0x7ee8('0x20'),function(_0x49f415){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')](_0x7ee8('0x21'),_0x49f415[_0x7ee8('0x19')]),_0x49f415);queues['queuecallerjoin'](_0x49f415);recordings[_0x7ee8('0x20')](_0x49f415);}catch(_0x2ec6c1){utils['error'](util['format'](_0x7ee8('0x21'),_0x49f415[_0x7ee8('0x19')]),_0x2ec6c1);}});ami['on'](_0x7ee8('0x22'),function(_0x29bd6f){try{utils[_0x7ee8('0x17')](util['format'](_0x7ee8('0x23'),_0x29bd6f[_0x7ee8('0x19')]),_0x29bd6f);queues[_0x7ee8('0x22')](_0x29bd6f);}catch(_0x2671e3){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x23'),_0x29bd6f['uniqueid']),_0x2671e3);}});ami['on'](_0x7ee8('0x24'),function(_0x1e757f){try{utils[_0x7ee8('0x17')](util['format']('[%s][index][musiconholdstart]',_0x1e757f[_0x7ee8('0x19')]),_0x1e757f);queues[_0x7ee8('0x24')](_0x1e757f);calls[_0x7ee8('0x24')](_0x1e757f);}catch(_0x175e34){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x25'),_0x1e757f[_0x7ee8('0x19')]),_0x175e34);}});ami['on']('musiconholdstop',function(_0xb64805){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')](_0x7ee8('0x26'),_0xb64805[_0x7ee8('0x19')]),_0xb64805);queues['musiconholdstop'](_0xb64805);calls['musiconholdstop'](_0xb64805);}catch(_0x172a31){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x26'),_0xb64805[_0x7ee8('0x19')]),_0x172a31);}});ami['on'](_0x7ee8('0x27'),function(_0x3ccb23){try{utils['debug'](util[_0x7ee8('0x18')](_0x7ee8('0x28'),_0x3ccb23[_0x7ee8('0x19')]),_0x3ccb23);calls[_0x7ee8('0x27')](_0x3ccb23);recordings['newstate'](_0x3ccb23);}catch(_0x19c3dd){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x28'),_0x3ccb23[_0x7ee8('0x19')]),_0x19c3dd);}});ami['on']('hangup',function(_0xfc3796){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')](_0x7ee8('0x29'),_0xfc3796['uniqueid']),_0xfc3796);calls[_0x7ee8('0x2a')](_0xfc3796);recordings[_0x7ee8('0x2a')](_0xfc3796);dials['hangup'](_0xfc3796);agents[_0x7ee8('0x2a')](_0xfc3796);queues[_0x7ee8('0x2a')](_0xfc3796);}catch(_0x24d240){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x29'),_0xfc3796[_0x7ee8('0x19')]),_0x24d240);}});ami['on'](_0x7ee8('0x2b'),function(_0xb13cd0){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')](_0x7ee8('0x2c'),_0xb13cd0[_0x7ee8('0x19')]),_0xb13cd0);members[_0x7ee8('0x2b')](_0xb13cd0);}catch(_0x79be34){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x2c'),_0xb13cd0[_0x7ee8('0x19')]),_0x79be34);}});ami['on'](_0x7ee8('0x2d'),function(_0x2a70cf){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')]('[%s][index][blindtransfer]',_0x2a70cf['uniqueid']),_0x2a70cf);queues[_0x7ee8('0x2d')](_0x2a70cf);agents[_0x7ee8('0x2d')](_0x2a70cf);transfers[_0x7ee8('0x2d')](_0x2a70cf);recordings[_0x7ee8('0x2d')](_0x2a70cf);}catch(_0x38115c){utils[_0x7ee8('0x12')](util['format'](_0x7ee8('0x2e'),_0x2a70cf[_0x7ee8('0x19')]),_0x38115c);}});ami['on'](_0x7ee8('0x2f'),function(_0x495556){try{utils[_0x7ee8('0x17')](util['format'](_0x7ee8('0x30'),_0x495556[_0x7ee8('0x31')]),_0x495556);queues['attendedtransfer'](_0x495556);transfers[_0x7ee8('0x2f')](_0x495556);agents[_0x7ee8('0x2f')](_0x495556);calls[_0x7ee8('0x2f')](_0x495556);}catch(_0x5e8b42){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x30'),_0x495556['origtransfereruniqueid']),_0x5e8b42);}});ami['on'](_0x7ee8('0x32'),function(_0x173f14){try{utils[_0x7ee8('0x17')](util['format'](_0x7ee8('0x33'),_0x173f14['uniqueid']),_0x173f14);queues[_0x7ee8('0x32')](_0x173f14);recordings[_0x7ee8('0x32')](_0x173f14);calls[_0x7ee8('0x32')](_0x173f14);dials[_0x7ee8('0x32')](_0x173f14);}catch(_0x116e1c){utils[_0x7ee8('0x12')](util['format'](_0x7ee8('0x33'),_0x173f14['uniqueid']),_0x116e1c);}});ami['on'](_0x7ee8('0x34'),function(_0xaaa9d6){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')](_0x7ee8('0x35'),_0xaaa9d6['uniqueid']),_0xaaa9d6);calls[_0x7ee8('0x34')](_0xaaa9d6);recordings[_0x7ee8('0x34')](_0xaaa9d6);dials[_0x7ee8('0x34')](_0xaaa9d6);}catch(_0x1b5f8e){utils[_0x7ee8('0x12')](util['format']('[%s][index][newexten]',_0xaaa9d6[_0x7ee8('0x19')]),_0x1b5f8e);}});ami['on']('newchannel',function(_0x3371de){try{utils['debug'](util[_0x7ee8('0x18')](_0x7ee8('0x36'),_0x3371de['uniqueid']),_0x3371de);calls['newchannel'](_0x3371de);recordings[_0x7ee8('0x37')](_0x3371de);}catch(_0x207832){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x36'),_0x3371de[_0x7ee8('0x19')]),_0x207832);}});ami['on'](_0x7ee8('0x38'),function(_0x5c204c){try{utils[_0x7ee8('0x17')](util[_0x7ee8('0x18')]('[%s][index][dialbegin]',_0x5c204c[_0x7ee8('0x19')]),_0x5c204c);dials['dialbegin'](_0x5c204c);}catch(_0x17c161){utils[_0x7ee8('0x12')](util[_0x7ee8('0x18')](_0x7ee8('0x39'),_0x5c204c['uniqueid']),_0x17c161);}});ami['on'](_0x7ee8('0x3a'),function(_0x4f14ab){try{utils['debug'](util[_0x7ee8('0x18')](_0x7ee8('0x3b'),_0x4f14ab['uniqueid']),_0x4f14ab);dials['dialend'](_0x4f14ab);}catch(_0x51158a){utils[_0x7ee8('0x12')](util['format']('[%s][index][dialend]',_0x4f14ab[_0x7ee8('0x19')]),_0x51158a);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e7df456..a60f254 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 _0x5294=['request','CreateMemberReport','getUserByName','error','[%s][members][writeDB]','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','split','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','type','interface','getUserByInterface','then','membername','name','internal'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x5294,0x1e4));var _0x4529=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5294[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x4529('0x0'));var utils=require(_0x4529('0x1'));var members={};var exclude=[_0x4529('0x2'),_0x4529('0x3')];function writeDB(_0x34fff9){utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x6'),_0x34fff9[_0x4529('0x7')],_0x34fff9['interface'],_0x34fff9[_0x4529('0x8')],_0x34fff9['data2'],_0x34fff9['membername'],_0x34fff9[_0x4529('0x9')]));if(_0x34fff9[_0x4529('0xa')]){utils[_0x4529('0xb')](_0x34fff9[_0x4529('0xa')])[_0x4529('0xc')](function(_0xd9d303){if(_0xd9d303){_0x34fff9[_0x4529('0xd')]=_0xd9d303[_0x4529('0xe')];_0x34fff9[_0x4529('0xf')]=_0xd9d303['internal'];utils[_0x4529('0x10')](_0x4529('0x11'),_0x34fff9);}else{utils[_0x4529('0x12')](_0x34fff9[_0x4529('0xa')]['split']('/')[0x1])[_0x4529('0xc')](function(_0x2057e7){if(_0x2057e7){_0x34fff9[_0x4529('0xd')]=_0x2057e7[_0x4529('0xe')];_0x34fff9[_0x4529('0xf')]=_0x2057e7['internal'];utils[_0x4529('0x10')](_0x4529('0x11'),_0x34fff9);}});}})['catch'](function(_0x1c1657){utils[_0x4529('0x13')](util[_0x4529('0x5')](_0x4529('0x14'),_0x34fff9[_0x4529('0x7')]),_0x1c1657);});}delete members[_0x34fff9[_0x4529('0xa')]];}function startsWith(_0x1be42f,_0x19ff24){return _[_0x4529('0x15')](_0x1be42f,function(_0x47a8b9){return _[_0x4529('0x16')](_0x19ff24,_0x47a8b9);});}exports['devicestatechange']=function(_0x42af66){try{utils[_0x4529('0x17')](util['format'](_0x4529('0x18'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]]['uniqueid']:_0x42af66[_0x4529('0x19')]),_0x42af66);utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x1a'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]]['uniqueid']:_0x42af66[_0x4529('0x19')],_0x42af66[_0x4529('0x1b')],_0x42af66[_0x4529('0x19')]));switch(_0x42af66[_0x4529('0x1b')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x42af66[_0x4529('0x19')])){members[_0x42af66['device']]={'channel':_0x4529('0x1c'),'interface':_0x42af66[_0x4529('0x19')],'type':_0x4529('0x1d'),'enterAt':utils['now'](),'role':_0x4529('0x1e')};}break;case _0x4529('0x1f'):if(!_[_0x4529('0x20')](members[_0x42af66[_0x4529('0x19')]])){members[_0x42af66[_0x4529('0x19')]][_0x4529('0x21')]=utils['now']();members[_0x42af66['device']][_0x4529('0x22')]=utils[_0x4529('0x23')](members[_0x42af66[_0x4529('0x19')]][_0x4529('0x21')],members[_0x42af66['device']][_0x4529('0x24')]);if(members[_0x42af66[_0x4529('0x19')]][_0x4529('0x7')]){writeDB(members[_0x42af66[_0x4529('0x19')]]);}}break;default:break;}}catch(_0x3cd09b){utils[_0x4529('0x13')](util['format'](_0x4529('0x18'),members[_0x42af66[_0x4529('0x19')]]?members[_0x42af66[_0x4529('0x19')]][_0x4529('0x7')]:_0x42af66[_0x4529('0x19')]),_0x3cd09b);}};exports['agentcomplete']=function(_0x175982){try{if(!_['isNil'](members[_0x175982[_0x4529('0xa')]])){utils[_0x4529('0x17')](util['format'](_0x4529('0x25'),_0x175982[_0x4529('0x7')]),_0x175982);utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x26'),_0x175982[_0x4529('0x7')],_0x175982[_0x4529('0xa')],_0x175982[_0x4529('0x27')]));members[_0x175982['interface']]=_[_0x4529('0x28')](members[_0x175982[_0x4529('0xa')]],{'data4':_0x175982[_0x4529('0x27')],'uniqueid':_0x175982[_0x4529('0x7')]});}}catch(_0x1562e9){utils['error'](util[_0x4529('0x5')](_0x4529('0x25'),_0x175982[_0x4529('0x7')]),_0x1562e9);}};exports['cdr']=function(_0x320736){try{utils['debug'](util['format']('[%s][members][cdr]',_0x320736[_0x4529('0x7')]),_0x320736);if(_0x320736[_0x4529('0x8')]){var _0x7d1f31=_0x320736['channel'][_0x4529('0x29')]('-')[0x0];if(!_[_0x4529('0x20')](members[_0x7d1f31])){members[_0x7d1f31]=_[_0x4529('0x28')](members[_0x7d1f31],{'data1':members[_0x7d1f31]['data1']||_0x320736[_0x4529('0x9')],'data2':members[_0x7d1f31][_0x4529('0x2a')]||_0x320736[_0x4529('0x2b')],'data3':members[_0x7d1f31][_0x4529('0x2c')]||_0x320736[_0x4529('0x2d')],'uniqueid':members[_0x7d1f31][_0x4529('0x7')]||_0x320736[_0x4529('0x7')]});utils['info'](util['format'](_0x4529('0x2e'),_0x320736[_0x4529('0x7')],members[_0x7d1f31][_0x4529('0x2f')],members[_0x7d1f31][_0x4529('0x2a')],members[_0x7d1f31][_0x4529('0x2c')]));if(members[_0x7d1f31][_0x4529('0x21')]){writeDB(members[_0x7d1f31]);}}}if(_0x320736[_0x4529('0x30')]){var _0x3238e5=_0x320736[_0x4529('0x30')][_0x4529('0x29')]('-')[0x0];if(!_['isNil'](members[_0x3238e5])){members[_0x3238e5]=_[_0x4529('0x28')](members[_0x3238e5],{'data1':members[_0x3238e5][_0x4529('0x2f')]||_0x320736[_0x4529('0x9')],'data2':members[_0x3238e5][_0x4529('0x2a')]||_0x320736[_0x4529('0x2b')],'data3':members[_0x3238e5][_0x4529('0x2c')]||_0x320736[_0x4529('0x2d')],'uniqueid':members[_0x3238e5][_0x4529('0x7')]||_0x320736[_0x4529('0x7')]});utils[_0x4529('0x4')](util[_0x4529('0x5')](_0x4529('0x2e'),_0x320736['uniqueid'],members[_0x3238e5]['data1'],members[_0x3238e5][_0x4529('0x2a')],members[_0x3238e5][_0x4529('0x2c')]));if(members[_0x3238e5][_0x4529('0x21')]){writeDB(members[_0x3238e5]);}}}}catch(_0x35a45b){utils[_0x4529('0x13')](util[_0x4529('0x5')](_0x4529('0x31'),_0x320736[_0x4529('0x7')]),_0x35a45b);}}; \ No newline at end of file +var _0xe6eb=['info','state','voice','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','type','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','assign','source','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','interface','getUserByInterface','membername','name','internal','request','CreateMemberReport','split','then','catch','error','[%s][members][writeDB]','some','startsWith','[%s][members][devicestatechange]','device'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0xe6eb,0xd7));var _0xbe6e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe6eb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xbe6e('0x0'));var util=require(_0xbe6e('0x1'));var utils=require(_0xbe6e('0x2'));var members={};var exclude=[_0xbe6e('0x3'),_0xbe6e('0x4')];function writeDB(_0x311531){utils['info'](util[_0xbe6e('0x5')](_0xbe6e('0x6'),_0x311531[_0xbe6e('0x7')],_0x311531['interface'],_0x311531[_0xbe6e('0x8')],_0x311531['data2'],_0x311531['membername'],_0x311531['type']));if(_0x311531[_0xbe6e('0x9')]){utils[_0xbe6e('0xa')](_0x311531[_0xbe6e('0x9')])['then'](function(_0x4bf18c){if(_0x4bf18c){_0x311531[_0xbe6e('0xb')]=_0x4bf18c[_0xbe6e('0xc')];_0x311531[_0xbe6e('0xd')]=_0x4bf18c[_0xbe6e('0xd')];utils[_0xbe6e('0xe')](_0xbe6e('0xf'),_0x311531);}else{utils['getUserByName'](_0x311531[_0xbe6e('0x9')][_0xbe6e('0x10')]('/')[0x1])[_0xbe6e('0x11')](function(_0x409fa1){if(_0x409fa1){_0x311531[_0xbe6e('0xb')]=_0x409fa1[_0xbe6e('0xc')];_0x311531['internal']=_0x409fa1[_0xbe6e('0xd')];utils[_0xbe6e('0xe')]('CreateMemberReport',_0x311531);}});}})[_0xbe6e('0x12')](function(_0x13b05a){utils[_0xbe6e('0x13')](util[_0xbe6e('0x5')](_0xbe6e('0x14'),_0x311531['uniqueid']),_0x13b05a);});}delete members[_0x311531[_0xbe6e('0x9')]];}function startsWith(_0x23ad33,_0x5acc57){return _[_0xbe6e('0x15')](_0x23ad33,function(_0x13e7c1){return _[_0xbe6e('0x16')](_0x5acc57,_0x13e7c1);});}exports['devicestatechange']=function(_0x49ee2a){try{utils['debug'](util[_0xbe6e('0x5')](_0xbe6e('0x17'),members[_0x49ee2a['device']]?members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x7')]:_0x49ee2a[_0xbe6e('0x18')]),_0x49ee2a);utils[_0xbe6e('0x19')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x49ee2a[_0xbe6e('0x18')]]?members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x7')]:_0x49ee2a[_0xbe6e('0x18')],_0x49ee2a[_0xbe6e('0x1a')],_0x49ee2a[_0xbe6e('0x18')]));switch(_0x49ee2a[_0xbe6e('0x1a')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x49ee2a[_0xbe6e('0x18')])){members[_0x49ee2a[_0xbe6e('0x18')]]={'channel':_0xbe6e('0x1b'),'interface':_0x49ee2a[_0xbe6e('0x18')],'type':'TALKING','enterAt':utils[_0xbe6e('0x1c')](),'role':_0xbe6e('0x1d')};}break;case'NOT_INUSE':if(!_[_0xbe6e('0x1e')](members[_0x49ee2a['device']])){members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x1f')]=utils[_0xbe6e('0x1c')]();members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x20')]=utils[_0xbe6e('0x21')](members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x1f')],members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x22')]);if(members[_0x49ee2a[_0xbe6e('0x18')]][_0xbe6e('0x7')]){writeDB(members[_0x49ee2a['device']]);}}break;default:break;}}catch(_0x38e847){utils[_0xbe6e('0x13')](util[_0xbe6e('0x5')](_0xbe6e('0x17'),members[_0x49ee2a['device']]?members[_0x49ee2a['device']][_0xbe6e('0x7')]:_0x49ee2a[_0xbe6e('0x18')]),_0x38e847);}};exports[_0xbe6e('0x23')]=function(_0x54d172){try{if(!_[_0xbe6e('0x1e')](members[_0x54d172[_0xbe6e('0x9')]])){utils[_0xbe6e('0x24')](util[_0xbe6e('0x5')](_0xbe6e('0x25'),_0x54d172[_0xbe6e('0x7')]),_0x54d172);utils[_0xbe6e('0x19')](util[_0xbe6e('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x54d172['uniqueid'],_0x54d172[_0xbe6e('0x9')],_0x54d172['queue']));members[_0x54d172[_0xbe6e('0x9')]]=_['assign'](members[_0x54d172[_0xbe6e('0x9')]],{'data4':_0x54d172['queue'],'uniqueid':_0x54d172[_0xbe6e('0x7')]});}}catch(_0x56980e){utils[_0xbe6e('0x13')](util['format'](_0xbe6e('0x25'),_0x54d172[_0xbe6e('0x7')]),_0x56980e);}};exports[_0xbe6e('0x26')]=function(_0x8c86ea){try{utils[_0xbe6e('0x24')](util[_0xbe6e('0x5')](_0xbe6e('0x27'),_0x8c86ea[_0xbe6e('0x7')]),_0x8c86ea);if(_0x8c86ea['channel']){var _0x4c23f6=_0x8c86ea['channel'][_0xbe6e('0x10')]('-')[0x0];if(!_[_0xbe6e('0x1e')](members[_0x4c23f6])){members[_0x4c23f6]=_['assign'](members[_0x4c23f6],{'data1':members[_0x4c23f6][_0xbe6e('0x28')]||_0x8c86ea[_0xbe6e('0x29')],'data2':members[_0x4c23f6]['data2']||_0x8c86ea['source'],'data3':members[_0x4c23f6][_0xbe6e('0x2a')]||_0x8c86ea[_0xbe6e('0x2b')],'uniqueid':members[_0x4c23f6][_0xbe6e('0x7')]||_0x8c86ea[_0xbe6e('0x7')]});utils[_0xbe6e('0x19')](util['format'](_0xbe6e('0x2c'),_0x8c86ea[_0xbe6e('0x7')],members[_0x4c23f6][_0xbe6e('0x28')],members[_0x4c23f6][_0xbe6e('0x2d')],members[_0x4c23f6]['data3']));if(members[_0x4c23f6][_0xbe6e('0x1f')]){writeDB(members[_0x4c23f6]);}}}if(_0x8c86ea['destinationchannel']){var _0x1a8dd1=_0x8c86ea['destinationchannel'][_0xbe6e('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1a8dd1])){members[_0x1a8dd1]=_[_0xbe6e('0x2e')](members[_0x1a8dd1],{'data1':members[_0x1a8dd1]['data1']||_0x8c86ea[_0xbe6e('0x29')],'data2':members[_0x1a8dd1][_0xbe6e('0x2d')]||_0x8c86ea[_0xbe6e('0x2f')],'data3':members[_0x1a8dd1][_0xbe6e('0x2a')]||_0x8c86ea[_0xbe6e('0x2b')],'uniqueid':members[_0x1a8dd1][_0xbe6e('0x7')]||_0x8c86ea[_0xbe6e('0x7')]});utils[_0xbe6e('0x19')](util['format'](_0xbe6e('0x2c'),_0x8c86ea[_0xbe6e('0x7')],members[_0x1a8dd1][_0xbe6e('0x28')],members[_0x1a8dd1][_0xbe6e('0x2d')],members[_0x1a8dd1][_0xbe6e('0x2a')]));if(members[_0x1a8dd1][_0xbe6e('0x1f')]){writeDB(members[_0x1a8dd1]);}}}}catch(_0x696b96){utils[_0xbe6e('0x13')](util[_0xbe6e('0x5')](_0xbe6e('0x27'),_0x8c86ea[_0xbe6e('0x7')]),_0x696b96);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 38da607..118c464 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 _0x73f5=['transfereelinkedid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','queue','accountcode','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER'];(function(_0x58fe9d,_0x32a78c){var _0x54070d=function(_0x324e4c){while(--_0x324e4c){_0x58fe9d['push'](_0x58fe9d['shift']());}};_0x54070d(++_0x32a78c);}(_0x73f5,0xdb));var _0x573f=function(_0x1f909d,_0x15f987){_0x1f909d=_0x1f909d-0x0;var _0x163242=_0x73f5[_0x1f909d];return _0x163242;};'use strict';var _=require('lodash');var util=require(_0x573f('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x4f938b){utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4f938b['uniqueid'],_0x4f938b['channel'],_0x4f938b[_0x573f('0x3')],_0x4f938b['lastAssignedTo'],_0x4f938b['calleridnum'],_0x4f938b[_0x573f('0x4')],_0x4f938b['queuecallerexitreason']));if(_0x4f938b['queue']){utils[_0x573f('0x5')](_0x4f938b[_0x573f('0x3')])[_0x573f('0x6')](function(_0x1b382b){if(_0x1b382b){_0x4f938b['type']=_0x1b382b['type'];}utils[_0x573f('0x7')](_0x573f('0x8'),_0x4f938b);});}else{utils[_0x573f('0x7')](_0x573f('0x8'),_0x4f938b);}if(_0x4f938b[_0x573f('0x9')]){delete queues[_0x4f938b['transfereduniqueid']];}else{delete queues[_0x4f938b['uniqueid']];}}exports[_0x573f('0xa')]=function(_0x2a669f){try{utils['debug'](util['format'](_0x573f('0xb'),_0x2a669f[_0x573f('0xc')]),_0x2a669f);utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0xd'),_0x2a669f['uniqueid'],_0x2a669f['queue'],_0x2a669f[_0x573f('0xe')]));queues[_0x2a669f[_0x573f('0xc')]]=_['assign'](_0x2a669f,{'originalposition':_0x2a669f[_0x573f('0xe')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4d2eaf){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0xb'),_0x2a669f[_0x573f('0xc')]),_0x4d2eaf);}};exports[_0x573f('0x10')]=function(_0x597a2b){try{if(!_[_0x573f('0x11')](queues[_0x597a2b[_0x573f('0xc')]])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x12'),_0x597a2b[_0x573f('0xc')]),_0x597a2b);if(queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x13')]){if(!queues[_0x597a2b['uniqueid']][_0x573f('0x14')]&&!queues[_0x597a2b['uniqueid']][_0x573f('0x15')]){queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x16')]=!![];queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x17')]=utils[_0x573f('0x18')]();queues[_0x597a2b['uniqueid']][_0x573f('0x19')]=_0x573f('0x1a');}utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x597a2b[_0x573f('0xc')],queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x19')]));writeDB(queues[_0x597a2b[_0x573f('0xc')]]);}else if(queues[_0x597a2b[_0x573f('0xc')]]['transfereduniqueid']){utils['info'](util[_0x573f('0x2')](_0x573f('0x1c'),_0x597a2b[_0x573f('0xc')],queues[_0x597a2b[_0x573f('0xc')]]['name'],queues[_0x597a2b[_0x573f('0xc')]]['transfereduniqueid']));queues[queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x9')]]=queues[_0x597a2b['uniqueid']];queues[queues[_0x597a2b[_0x573f('0xc')]][_0x573f('0x9')]][_0x573f('0x1d')]=0x2;delete queues[_0x597a2b[_0x573f('0xc')]];}}}catch(_0x2fe071){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x12'),_0x597a2b[_0x573f('0xc')]),_0x2fe071);}};exports[_0x573f('0x1e')]=function(_0x197c37){try{utils[_0x573f('0x1f')](util['format'](_0x573f('0x20'),_0x197c37[_0x573f('0xc')]),_0x197c37);if(!_[_0x573f('0x11')](_0x197c37[_0x573f('0x21')][_0x573f('0x22')])&&_0x197c37[_0x573f('0x23')][_0x573f('0x24')]()!==_0x573f('0x25')){if(!_[_0x573f('0x11')](queues[_0x197c37['uniqueid']])){queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x26')]=null;queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x15')]=!![];queues[_0x197c37[_0x573f('0xc')]]['queuecallerexitAt']=utils[_0x573f('0x18')]();queues[_0x197c37['uniqueid']][_0x573f('0x19')]=_0x197c37[_0x573f('0x23')]['toUpperCase']();utils['info'](util['format'](_0x573f('0x27'),_0x197c37[_0x573f('0xc')],queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x1b')],_0x197c37[_0x573f('0x23')],queues[_0x197c37['uniqueid']][_0x573f('0x19')]));writeDB(queues[_0x197c37[_0x573f('0xc')]]);}}else if(!_[_0x573f('0x11')](_0x197c37[_0x573f('0x21')][_0x573f('0x28')])){if(!_[_0x573f('0x11')](queues[_0x197c37['uniqueid']])&&!queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x14')]){queues[_0x197c37[_0x573f('0xc')]]['queuecallerabandon']=![];queues[_0x197c37[_0x573f('0xc')]]['queuecallerabandonAt']=null;queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x15')]=!![];queues[_0x197c37['uniqueid']][_0x573f('0x29')]=utils['now']();queues[_0x197c37['uniqueid']]['queuecallerexitreason']=_0x573f('0x2a');utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x197c37['uniqueid'],queues[_0x197c37[_0x573f('0xc')]]['name'],_0x197c37[_0x573f('0x23')],queues[_0x197c37[_0x573f('0xc')]][_0x573f('0x19')]));}}}catch(_0x105d52){utils[_0x573f('0xf')](util[_0x573f('0x2')]('[%s][queues][varset]',_0x197c37[_0x573f('0xc')]),_0x105d52);}};exports[_0x573f('0x14')]=function(_0x1660f2){try{if(!_[_0x573f('0x11')](queues[_0x1660f2[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x2b'),_0x1660f2['uniqueid']),_0x1660f2);queues[_0x1660f2[_0x573f('0xc')]][_0x573f('0x15')]=![];queues[_0x1660f2[_0x573f('0xc')]][_0x573f('0x29')]=null;queues[_0x1660f2[_0x573f('0xc')]]['queuecallerabandon']=!![];queues[_0x1660f2[_0x573f('0xc')]]['queuecallerabandonAt']=utils[_0x573f('0x18')]();queues[_0x1660f2[_0x573f('0xc')]]['queuecallerexitreason']=_0x573f('0x2c');utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x2d'),_0x1660f2[_0x573f('0xc')],queues[_0x1660f2['uniqueid']][_0x573f('0x1b')],queues[_0x1660f2[_0x573f('0xc')]]['queuecallerexitreason']));}}catch(_0x95b7f1){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x2b'),_0x1660f2['uniqueid']),_0x95b7f1);}};exports['queuecallerleave']=function(_0xaa4a69){try{if(!_[_0x573f('0x11')](queues[_0xaa4a69[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util['format']('[%s][queues][queuecallerleave]',_0xaa4a69[_0x573f('0xc')]),_0xaa4a69);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xaa4a69[_0x573f('0xc')],queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x1b')],_0xaa4a69[_0x573f('0x2e')],_0xaa4a69['connectedlinename']));queues[_0xaa4a69['uniqueid']][_0x573f('0x2f')]=!![];queues[_0xaa4a69['uniqueid']][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x30')]=utils[_0x573f('0x31')](queues[_0xaa4a69[_0x573f('0xc')]]['queuecallerleaveAt'],queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x32')]);queues[_0xaa4a69[_0x573f('0xc')]]['position']=_0xaa4a69['position'];queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x33')]=_0xaa4a69[_0x573f('0x33')];queues[_0xaa4a69[_0x573f('0xc')]][_0x573f('0x2e')]=_0xaa4a69[_0x573f('0x2e')];queues[_0xaa4a69[_0x573f('0xc')]]['connectedlinename']=_0xaa4a69['connectedlinename'];}}catch(_0x3a0f3d){utils['error'](util[_0x573f('0x2')](_0x573f('0x34'),_0xaa4a69[_0x573f('0xc')]),_0x3a0f3d);}};exports[_0x573f('0x35')]=function(_0x463d17){try{if(!_[_0x573f('0x11')](queues[_0x463d17[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x36'),_0x463d17[_0x573f('0xc')]),_0x463d17);utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x463d17[_0x573f('0xc')],queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x1b')],_0x463d17['membername'],_0x463d17[_0x573f('0x37')]));queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x463d17['uniqueid']][_0x573f('0x14')]=![];queues[_0x463d17['uniqueid']]['queuecallerabandonAt']=null;queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x15')]=![];queues[_0x463d17[_0x573f('0xc')]][_0x573f('0x19')]=null;queues[_0x463d17[_0x573f('0xc')]]['queuecallerexitAt']=null;queues[_0x463d17['uniqueid']][_0x573f('0x38')]=!![];queues[_0x463d17['uniqueid']][_0x573f('0x4')]=_0x463d17[_0x573f('0x37')];queues[_0x463d17['uniqueid']][_0x573f('0x39')]=_0x463d17[_0x573f('0x3a')];}}catch(_0x1cb6b4){utils[_0x573f('0xf')](util['format'](_0x573f('0x36'),_0x463d17[_0x573f('0xc')]),_0x1cb6b4);}};exports[_0x573f('0x3b')]=function(_0x2682d5){try{if(!_[_0x573f('0x11')](queues[_0x2682d5[_0x573f('0xc')]])){if(queues[_0x2682d5['uniqueid']][_0x573f('0x13')]){utils['debug'](util[_0x573f('0x2')](_0x573f('0x3c'),_0x2682d5[_0x573f('0xc')]),_0x2682d5);queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x14')]=![];queues[_0x2682d5['uniqueid']][_0x573f('0x14')]=![];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x26')]=null;queues[_0x2682d5[_0x573f('0xc')]]['queuecallerexit']=![];queues[_0x2682d5['uniqueid']][_0x573f('0x29')]=null;queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x38')]=!![];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x39')]=_0x2682d5[_0x573f('0x3a')];queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x16')]=!![];queues[_0x2682d5['uniqueid']]['queuecallercompleteAt']=utils[_0x573f('0x18')]();if(_0x2682d5[_0x573f('0x3d')]==_0x573f('0x3e')){if(!queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x3e')]){queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x19')]=_0x573f('0x3f');}}else{queues[_0x2682d5['uniqueid']][_0x573f('0x19')]=_0x573f('0x40')+_0x2682d5[_0x573f('0x3d')][_0x573f('0x24')]();}utils[_0x573f('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2682d5[_0x573f('0xc')],queues[_0x2682d5[_0x573f('0xc')]]['name'],_0x2682d5[_0x573f('0x3a')],queues[_0x2682d5[_0x573f('0xc')]][_0x573f('0x19')]));writeDB(queues[_0x2682d5['uniqueid']]);}}}catch(_0x4f9514){utils[_0x573f('0xf')](util['format'](_0x573f('0x3c'),_0x2682d5[_0x573f('0xc')]),_0x4f9514);}};exports[_0x573f('0x41')]=function(_0x4254bb){try{if(!_[_0x573f('0x11')](queues[_0x4254bb[_0x573f('0x42')]])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x43'),_0x4254bb['uniqueid']),_0x4254bb);queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x3e')]=!![];queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x44')]=_0x573f('0x45');queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x46')]=_0x4254bb[_0x573f('0x47')];queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x48')]=_0x4254bb[_0x573f('0x42')];queues[_0x4254bb['transfereeuniqueid']][_0x573f('0x19')]='BLINDTRANSFER';utils[_0x573f('0x1')](util['format'](_0x573f('0x49'),_0x4254bb[_0x573f('0xc')],queues[_0x4254bb[_0x573f('0x42')]][_0x573f('0x1b')],_0x4254bb['transfereeuniqueid'],_0x4254bb[_0x573f('0x47')]));}}catch(_0x2bb07c){utils[_0x573f('0xf')](util[_0x573f('0x2')](_0x573f('0x43'),_0x4254bb['uniqueid']),_0x2bb07c);}};exports[_0x573f('0x4a')]=function(_0x48b6d8){try{utils[_0x573f('0x1f')](util[_0x573f('0x2')]('[%s][queues][attendedtransfer]',_0x48b6d8[_0x573f('0x4b')]),_0x48b6d8);if(_0x48b6d8['origtransfereruniqueid']==_0x48b6d8[_0x573f('0x4c')]){if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4d')]])){utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x4e'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x1b')],_0x48b6d8[_0x573f('0x4f')]));queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x3e')]=!![];queues[_0x48b6d8[_0x573f('0x4d')]]['transfertype']='ATTENDED';queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x46')]=_0x48b6d8[_0x573f('0x4f')];queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x48')]=_0x48b6d8[_0x573f('0x4b')];queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x19')]=_0x573f('0x50');}if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4c')]])){if(_0x48b6d8[_0x573f('0x51')]&&queues[_0x48b6d8[_0x573f('0x51')]]){queues[_0x48b6d8[_0x573f('0x51')]][_0x573f('0x1d')]=0x1;queues[_0x48b6d8['transfereeuniqueid']]=_['clone'](queues[_0x48b6d8[_0x573f('0x51')]]);queues[_0x48b6d8[_0x573f('0x42')]]['transfereduniqueid']=_0x48b6d8['transfertargetuniqueid'];queues[_0x48b6d8[_0x573f('0x42')]]['queuecallerenterreason']=0x2;queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x52')]=queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x52')];queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x53')]=queues[_0x48b6d8[_0x573f('0x4d')]][_0x573f('0x53')];queues[_0x48b6d8['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x573f('0x18')]();queues[_0x48b6d8['transfereeuniqueid']][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x30')]=0x0;queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x54')]=0x0;utils[_0x573f('0x1')](util['format'](_0x573f('0x55'),_0x48b6d8['origtransfereruniqueid'],queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x1b')],queues[_0x48b6d8['transfereeuniqueid']][_0x573f('0x52')],queues[_0x48b6d8[_0x573f('0x42')]][_0x573f('0x53')]));}else{utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x56'),_0x48b6d8['origtransfereruniqueid'],queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x1b')],_0x48b6d8['secondtransfererlinkedid']));queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x9')]=_0x48b6d8[_0x573f('0x4d')];}}}else if(_0x48b6d8[_0x573f('0x57')]==_0x48b6d8[_0x573f('0x4d')]){if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4c')]])){utils[_0x573f('0x1')](util[_0x573f('0x2')](_0x573f('0x58'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x4c')]][_0x573f('0x1b')],_0x48b6d8['secondtransfereruniqueid'],_0x48b6d8['secondtransfererexten']));queues[_0x48b6d8[_0x573f('0x4c')]]['transfer']=!![];queues[_0x48b6d8[_0x573f('0x4c')]]['transfertype']='ATTENDED';queues[_0x48b6d8[_0x573f('0x4c')]]['transferexten']=_0x48b6d8[_0x573f('0x59')];queues[_0x48b6d8['origtransfererlinkedid']][_0x573f('0x48')]=_0x48b6d8[_0x573f('0x57')];queues[_0x48b6d8['origtransfererlinkedid']][_0x573f('0x19')]=_0x573f('0x50');}if(!_[_0x573f('0x11')](queues[_0x48b6d8[_0x573f('0x4d')]])){if(_0x48b6d8[_0x573f('0x5a')]&&queues[_0x48b6d8['transfertargetlinkedid']]){queues[_0x48b6d8[_0x573f('0x5a')]][_0x573f('0x1d')]=0x1;queues[_0x48b6d8[_0x573f('0x5b')]]=_[_0x573f('0x5c')](queues[_0x48b6d8[_0x573f('0x5a')]]);queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x9')]=_0x48b6d8['transfertargetuniqueid'];queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x1d')]=0x2;queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x52')]=queues[_0x48b6d8[_0x573f('0x4c')]]['calleridnum'];queues[_0x48b6d8['transfertargetuniqueid']][_0x573f('0x53')]=queues[_0x48b6d8[_0x573f('0x4c')]]['calleridname'];queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x32')]=utils['now']();queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x13')]=utils[_0x573f('0x18')]();queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x30')]=0x0;queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x54')]=0x0;utils[_0x573f('0x1')](util[_0x573f('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x1b')],queues[_0x48b6d8[_0x573f('0x5b')]]['transfereduniqueid'],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x52')],queues[_0x48b6d8[_0x573f('0x5b')]][_0x573f('0x53')]));}else{utils[_0x573f('0x1')](util['format'](_0x573f('0x56'),_0x48b6d8[_0x573f('0x4b')],queues[_0x48b6d8['secondtransfererlinkedid']]['name'],_0x48b6d8[_0x573f('0x4c')]));queues[_0x48b6d8['secondtransfererlinkedid']][_0x573f('0x9')]=_0x48b6d8[_0x573f('0x4c')];}}}}catch(_0x312760){utils[_0x573f('0xf')](util['format'](_0x573f('0x5d'),_0x48b6d8[_0x573f('0x4b')]),_0x312760);}};exports['musiconholdstart']=function(_0x26d5c0){try{if(!_[_0x573f('0x11')](queues[_0x26d5c0[_0x573f('0xc')]])){utils[_0x573f('0x1f')](util[_0x573f('0x2')](_0x573f('0x5e'),_0x26d5c0[_0x573f('0xc')]),_0x26d5c0);queues[_0x26d5c0[_0x573f('0xc')]][_0x573f('0x5f')]=utils['now']();utils['info'](util[_0x573f('0x2')](_0x573f('0x60'),_0x26d5c0['uniqueid'],queues[_0x26d5c0[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x26d5c0['uniqueid']][_0x573f('0x5f')]));}}catch(_0x16e290){utils['error'](util[_0x573f('0x2')](_0x573f('0x5e'),_0x26d5c0[_0x573f('0xc')]),_0x16e290);}};exports[_0x573f('0x61')]=function(_0x1c7805){try{if(!_['isNil'](queues[_0x1c7805[_0x573f('0xc')]])){if(!_[_0x573f('0x11')](queues[_0x1c7805['uniqueid']][_0x573f('0x5f')])){utils['debug'](util[_0x573f('0x2')](_0x573f('0x62'),_0x1c7805[_0x573f('0xc')]),_0x1c7805);queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x54')]+=utils['diffTime'](utils[_0x573f('0x18')](),queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x5f')]);utils[_0x573f('0x1')](util['format'](_0x573f('0x63'),_0x1c7805[_0x573f('0xc')],queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x1b')],queues[_0x1c7805[_0x573f('0xc')]][_0x573f('0x54')]));delete queues[_0x1c7805['uniqueid']][_0x573f('0x5f')];}}}catch(_0x3c43da){utils['error'](util[_0x573f('0x2')](_0x573f('0x62'),_0x1c7805['uniqueid']),_0x3c43da);}}; \ No newline at end of file +var _0x9cfa=['queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','accountcode','membername','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','queuecallerexitreason','queue','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition'];(function(_0x5bc872,_0xde7857){var _0x2ebc01=function(_0x490fcd){while(--_0x490fcd){_0x5bc872['push'](_0x5bc872['shift']());}};_0x2ebc01(++_0xde7857);}(_0x9cfa,0xa6));var _0xa9cf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9cfa[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xa9cf('0x0'));var utils=require(_0xa9cf('0x1'));var queues={};function writeDB(_0x2d1400){utils['info'](util[_0xa9cf('0x2')](_0xa9cf('0x3'),_0x2d1400[_0xa9cf('0x4')],_0x2d1400['channel'],_0x2d1400['queue'],_0x2d1400[_0xa9cf('0x5')],_0x2d1400['calleridnum'],_0x2d1400['accountcode'],_0x2d1400[_0xa9cf('0x6')]));if(_0x2d1400[_0xa9cf('0x7')]){utils[_0xa9cf('0x8')](_0x2d1400[_0xa9cf('0x7')])[_0xa9cf('0x9')](function(_0xaf8b8a){if(_0xaf8b8a){_0x2d1400[_0xa9cf('0xa')]=_0xaf8b8a[_0xa9cf('0xa')];}utils['request'](_0xa9cf('0xb'),_0x2d1400);});}else{utils[_0xa9cf('0xc')](_0xa9cf('0xb'),_0x2d1400);}if(_0x2d1400[_0xa9cf('0xd')]){delete queues[_0x2d1400[_0xa9cf('0xd')]];}else{delete queues[_0x2d1400[_0xa9cf('0x4')]];}}exports['queuecallerjoin']=function(_0x3fe47d){try{utils[_0xa9cf('0xe')](util['format'](_0xa9cf('0xf'),_0x3fe47d['uniqueid']),_0x3fe47d);utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x11'),_0x3fe47d[_0xa9cf('0x4')],_0x3fe47d[_0xa9cf('0x7')],_0x3fe47d[_0xa9cf('0x12')]));queues[_0x3fe47d[_0xa9cf('0x4')]]=_[_0xa9cf('0x13')](_0x3fe47d,{'originalposition':_0x3fe47d[_0xa9cf('0x12')],'queuecallerjoinAt':utils[_0xa9cf('0x14')](),'mohtime':0x0});}catch(_0x33307d){utils[_0xa9cf('0x15')](util['format'](_0xa9cf('0xf'),_0x3fe47d[_0xa9cf('0x4')]),_0x33307d);}};exports[_0xa9cf('0x16')]=function(_0x268047){try{if(!_[_0xa9cf('0x17')](queues[_0x268047[_0xa9cf('0x4')]])){utils['debug'](util[_0xa9cf('0x2')](_0xa9cf('0x18'),_0x268047[_0xa9cf('0x4')]),_0x268047);if(queues[_0x268047['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0x19')]&&!queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0x1a')]){queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0x1b')]=!![];queues[_0x268047[_0xa9cf('0x4')]]['queuecallercompleteAt']=utils[_0xa9cf('0x14')]();queues[_0x268047[_0xa9cf('0x4')]]['queuecallerexitreason']=_0xa9cf('0x1c');}utils['info'](util[_0xa9cf('0x2')](_0xa9cf('0x1d'),_0x268047['uniqueid'],queues[_0x268047[_0xa9cf('0x4')]]['name'],queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0x6')]));writeDB(queues[_0x268047[_0xa9cf('0x4')]]);}else if(queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0xd')]){utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x1e'),_0x268047[_0xa9cf('0x4')],queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0x1f')],queues[_0x268047[_0xa9cf('0x4')]]['transfereduniqueid']));queues[queues[_0x268047[_0xa9cf('0x4')]]['transfereduniqueid']]=queues[_0x268047[_0xa9cf('0x4')]];queues[queues[_0x268047[_0xa9cf('0x4')]][_0xa9cf('0xd')]][_0xa9cf('0x20')]=0x2;delete queues[_0x268047['uniqueid']];}}}catch(_0x3fb68f){utils['error'](util['format'](_0xa9cf('0x18'),_0x268047[_0xa9cf('0x4')]),_0x3fb68f);}};exports[_0xa9cf('0x21')]=function(_0x4aa315){try{utils[_0xa9cf('0xe')](util['format'](_0xa9cf('0x22'),_0x4aa315['uniqueid']),_0x4aa315);if(!_[_0xa9cf('0x17')](_0x4aa315[_0xa9cf('0x23')][_0xa9cf('0x24')])&&_0x4aa315[_0xa9cf('0x25')][_0xa9cf('0x26')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x4aa315[_0xa9cf('0x4')]])){queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x19')]=![];queues[_0x4aa315[_0xa9cf('0x4')]]['queuecallerabandonAt']=null;queues[_0x4aa315['uniqueid']][_0xa9cf('0x1a')]=!![];queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x27')]=utils[_0xa9cf('0x14')]();queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x6')]=_0x4aa315[_0xa9cf('0x25')][_0xa9cf('0x26')]();utils['info'](util[_0xa9cf('0x2')](_0xa9cf('0x28'),_0x4aa315['uniqueid'],queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x1f')],_0x4aa315[_0xa9cf('0x25')],queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x6')]));writeDB(queues[_0x4aa315['uniqueid']]);}}else if(!_[_0xa9cf('0x17')](_0x4aa315[_0xa9cf('0x23')][_0xa9cf('0x29')])){if(!_[_0xa9cf('0x17')](queues[_0x4aa315[_0xa9cf('0x4')]])&&!queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x19')]){queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x19')]=![];queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x2a')]=null;queues[_0x4aa315[_0xa9cf('0x4')]]['queuecallerexit']=!![];queues[_0x4aa315['uniqueid']]['queuecallerexitAt']=utils[_0xa9cf('0x14')]();queues[_0x4aa315['uniqueid']][_0xa9cf('0x6')]=_0xa9cf('0x2b');utils[_0xa9cf('0x10')](util['format'](_0xa9cf('0x2c'),_0x4aa315[_0xa9cf('0x4')],queues[_0x4aa315['uniqueid']][_0xa9cf('0x1f')],_0x4aa315[_0xa9cf('0x25')],queues[_0x4aa315[_0xa9cf('0x4')]][_0xa9cf('0x6')]));}}}catch(_0x3091f7){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')](_0xa9cf('0x22'),_0x4aa315[_0xa9cf('0x4')]),_0x3091f7);}};exports[_0xa9cf('0x19')]=function(_0x3e0f0c){try{if(!_[_0xa9cf('0x17')](queues[_0x3e0f0c['uniqueid']])){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')]('[%s][queues][queuecallerabandon]',_0x3e0f0c[_0xa9cf('0x4')]),_0x3e0f0c);queues[_0x3e0f0c[_0xa9cf('0x4')]][_0xa9cf('0x1a')]=![];queues[_0x3e0f0c['uniqueid']]['queuecallerexitAt']=null;queues[_0x3e0f0c['uniqueid']][_0xa9cf('0x19')]=!![];queues[_0x3e0f0c[_0xa9cf('0x4')]][_0xa9cf('0x2a')]=utils[_0xa9cf('0x14')]();queues[_0x3e0f0c[_0xa9cf('0x4')]][_0xa9cf('0x6')]=_0xa9cf('0x2d');utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3e0f0c[_0xa9cf('0x4')],queues[_0x3e0f0c[_0xa9cf('0x4')]][_0xa9cf('0x1f')],queues[_0x3e0f0c['uniqueid']][_0xa9cf('0x6')]));}}catch(_0xf322ca){utils['error'](util[_0xa9cf('0x2')](_0xa9cf('0x2e'),_0x3e0f0c[_0xa9cf('0x4')]),_0xf322ca);}};exports['queuecallerleave']=function(_0x35c96a){try{if(!_[_0xa9cf('0x17')](queues[_0x35c96a[_0xa9cf('0x4')]])){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')](_0xa9cf('0x2f'),_0x35c96a[_0xa9cf('0x4')]),_0x35c96a);utils['info'](util[_0xa9cf('0x2')](_0xa9cf('0x30'),_0x35c96a['uniqueid'],queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x1f')],_0x35c96a[_0xa9cf('0x31')],_0x35c96a['connectedlinename']));queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x32')]=!![];queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x33')]=utils['now']();queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x34')]=utils[_0xa9cf('0x35')](queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x33')],queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x36')]);queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x12')]=_0x35c96a[_0xa9cf('0x12')];queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x37')]=_0x35c96a[_0xa9cf('0x37')];queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x31')]=_0x35c96a[_0xa9cf('0x31')];queues[_0x35c96a[_0xa9cf('0x4')]][_0xa9cf('0x38')]=_0x35c96a[_0xa9cf('0x38')];}}catch(_0x57445b){utils[_0xa9cf('0x15')](util['format'](_0xa9cf('0x2f'),_0x35c96a[_0xa9cf('0x4')]),_0x57445b);}};exports['agentconnect']=function(_0x3ff2ff){try{if(!_[_0xa9cf('0x17')](queues[_0x3ff2ff['uniqueid']])){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')]('[%s][queues][agentconnect]',_0x3ff2ff[_0xa9cf('0x4')]),_0x3ff2ff);utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x39'),_0x3ff2ff[_0xa9cf('0x4')],queues[_0x3ff2ff[_0xa9cf('0x4')]][_0xa9cf('0x1f')],_0x3ff2ff['membername'],_0x3ff2ff['destaccountcode']));queues[_0x3ff2ff[_0xa9cf('0x4')]][_0xa9cf('0x19')]=![];queues[_0x3ff2ff['uniqueid']]['queuecallerabandon']=![];queues[_0x3ff2ff[_0xa9cf('0x4')]][_0xa9cf('0x2a')]=null;queues[_0x3ff2ff['uniqueid']]['queuecallerexit']=![];queues[_0x3ff2ff[_0xa9cf('0x4')]][_0xa9cf('0x6')]=null;queues[_0x3ff2ff[_0xa9cf('0x4')]]['queuecallerexitAt']=null;queues[_0x3ff2ff[_0xa9cf('0x4')]][_0xa9cf('0x3a')]=!![];queues[_0x3ff2ff['uniqueid']][_0xa9cf('0x3b')]=_0x3ff2ff['destaccountcode'];queues[_0x3ff2ff[_0xa9cf('0x4')]]['lastAssignedTo']=_0x3ff2ff[_0xa9cf('0x3c')];}}catch(_0x5c181b){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')](_0xa9cf('0x3d'),_0x3ff2ff['uniqueid']),_0x5c181b);}};exports[_0xa9cf('0x3e')]=function(_0x1d3c05){try{if(!_[_0xa9cf('0x17')](queues[_0x1d3c05[_0xa9cf('0x4')]])){if(queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x33')]){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')](_0xa9cf('0x3f'),_0x1d3c05['uniqueid']),_0x1d3c05);queues[_0x1d3c05[_0xa9cf('0x4')]]['queuecallerabandon']=![];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x19')]=![];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x2a')]=null;queues[_0x1d3c05['uniqueid']][_0xa9cf('0x1a')]=![];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x27')]=null;queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x3a')]=!![];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x5')]=_0x1d3c05['membername'];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x1b')]=!![];queues[_0x1d3c05[_0xa9cf('0x4')]][_0xa9cf('0x40')]=utils[_0xa9cf('0x14')]();if(_0x1d3c05[_0xa9cf('0x41')]==_0xa9cf('0x42')){if(!queues[_0x1d3c05[_0xa9cf('0x4')]]['transfer']){queues[_0x1d3c05[_0xa9cf('0x4')]]['queuecallerexitreason']=_0xa9cf('0x43');}}else{queues[_0x1d3c05[_0xa9cf('0x4')]]['queuecallerexitreason']=_0xa9cf('0x44')+_0x1d3c05[_0xa9cf('0x41')][_0xa9cf('0x26')]();}utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x45'),_0x1d3c05[_0xa9cf('0x4')],queues[_0x1d3c05['uniqueid']][_0xa9cf('0x1f')],_0x1d3c05[_0xa9cf('0x3c')],queues[_0x1d3c05['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x1d3c05[_0xa9cf('0x4')]]);}}}catch(_0x16ca85){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')]('[%s][queues][agentcomplete]',_0x1d3c05[_0xa9cf('0x4')]),_0x16ca85);}};exports['blindtransfer']=function(_0x232ac6){try{if(!_[_0xa9cf('0x17')](queues[_0x232ac6['transfereeuniqueid']])){utils['debug'](util['format'](_0xa9cf('0x46'),_0x232ac6[_0xa9cf('0x4')]),_0x232ac6);queues[_0x232ac6[_0xa9cf('0x47')]][_0xa9cf('0x42')]=!![];queues[_0x232ac6[_0xa9cf('0x47')]][_0xa9cf('0x48')]=_0xa9cf('0x49');queues[_0x232ac6[_0xa9cf('0x47')]][_0xa9cf('0x4a')]=_0x232ac6['extension'];queues[_0x232ac6[_0xa9cf('0x47')]][_0xa9cf('0x4b')]=_0x232ac6[_0xa9cf('0x47')];queues[_0x232ac6[_0xa9cf('0x47')]][_0xa9cf('0x6')]=_0xa9cf('0x4c');utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x4d'),_0x232ac6[_0xa9cf('0x4')],queues[_0x232ac6[_0xa9cf('0x47')]]['name'],_0x232ac6['transfereeuniqueid'],_0x232ac6[_0xa9cf('0x4e')]));}}catch(_0x5451b3){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')](_0xa9cf('0x46'),_0x232ac6['uniqueid']),_0x5451b3);}};exports[_0xa9cf('0x4f')]=function(_0x4dfc76){try{utils['debug'](util['format'](_0xa9cf('0x50'),_0x4dfc76[_0xa9cf('0x51')]),_0x4dfc76);if(_0x4dfc76[_0xa9cf('0x51')]==_0x4dfc76[_0xa9cf('0x52')]){if(!_['isNil'](queues[_0x4dfc76[_0xa9cf('0x53')]])){utils['info'](util[_0xa9cf('0x2')](_0xa9cf('0x54'),_0x4dfc76[_0xa9cf('0x51')],queues[_0x4dfc76[_0xa9cf('0x53')]]['name'],_0x4dfc76[_0xa9cf('0x55')]));queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x42')]=!![];queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x48')]=_0xa9cf('0x56');queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x4a')]=_0x4dfc76[_0xa9cf('0x55')];queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x4b')]=_0x4dfc76[_0xa9cf('0x51')];queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x6')]=_0xa9cf('0x57');}if(!_[_0xa9cf('0x17')](queues[_0x4dfc76[_0xa9cf('0x52')]])){if(_0x4dfc76[_0xa9cf('0x58')]&&queues[_0x4dfc76[_0xa9cf('0x58')]]){queues[_0x4dfc76[_0xa9cf('0x58')]][_0xa9cf('0x20')]=0x1;queues[_0x4dfc76[_0xa9cf('0x47')]]=_['clone'](queues[_0x4dfc76[_0xa9cf('0x58')]]);queues[_0x4dfc76[_0xa9cf('0x47')]][_0xa9cf('0xd')]=_0x4dfc76['transfertargetuniqueid'];queues[_0x4dfc76[_0xa9cf('0x47')]][_0xa9cf('0x20')]=0x2;queues[_0x4dfc76['transfereeuniqueid']][_0xa9cf('0x59')]=queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x59')];queues[_0x4dfc76[_0xa9cf('0x47')]][_0xa9cf('0x5a')]=queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x5a')];queues[_0x4dfc76[_0xa9cf('0x47')]]['queuecallerjoinAt']=utils[_0xa9cf('0x14')]();queues[_0x4dfc76['transfereeuniqueid']][_0xa9cf('0x33')]=utils['now']();queues[_0x4dfc76[_0xa9cf('0x47')]]['holdtime']=0x0;queues[_0x4dfc76[_0xa9cf('0x47')]][_0xa9cf('0x5b')]=0x0;utils[_0xa9cf('0x10')](util['format'](_0xa9cf('0x5c'),_0x4dfc76[_0xa9cf('0x51')],queues[_0x4dfc76[_0xa9cf('0x47')]][_0xa9cf('0x1f')],queues[_0x4dfc76['transfereeuniqueid']][_0xa9cf('0x59')],queues[_0x4dfc76['transfereeuniqueid']][_0xa9cf('0x5a')]));}else{utils[_0xa9cf('0x10')](util['format'](_0xa9cf('0x5d'),_0x4dfc76[_0xa9cf('0x51')],queues[_0x4dfc76[_0xa9cf('0x52')]][_0xa9cf('0x1f')],_0x4dfc76[_0xa9cf('0x53')]));queues[_0x4dfc76[_0xa9cf('0x52')]]['transfereduniqueid']=_0x4dfc76[_0xa9cf('0x53')];}}}else if(_0x4dfc76[_0xa9cf('0x5e')]==_0x4dfc76['secondtransfererlinkedid']){if(!_[_0xa9cf('0x17')](queues[_0x4dfc76['origtransfererlinkedid']])){utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4dfc76[_0xa9cf('0x51')],queues[_0x4dfc76[_0xa9cf('0x52')]][_0xa9cf('0x1f')],_0x4dfc76[_0xa9cf('0x5e')],_0x4dfc76[_0xa9cf('0x5f')]));queues[_0x4dfc76[_0xa9cf('0x52')]][_0xa9cf('0x42')]=!![];queues[_0x4dfc76['origtransfererlinkedid']][_0xa9cf('0x48')]=_0xa9cf('0x56');queues[_0x4dfc76[_0xa9cf('0x52')]][_0xa9cf('0x4a')]=_0x4dfc76[_0xa9cf('0x5f')];queues[_0x4dfc76[_0xa9cf('0x52')]][_0xa9cf('0x4b')]=_0x4dfc76[_0xa9cf('0x5e')];queues[_0x4dfc76['origtransfererlinkedid']][_0xa9cf('0x6')]=_0xa9cf('0x57');}if(!_['isNil'](queues[_0x4dfc76['secondtransfererlinkedid']])){if(_0x4dfc76[_0xa9cf('0x60')]&&queues[_0x4dfc76[_0xa9cf('0x60')]]){queues[_0x4dfc76[_0xa9cf('0x60')]][_0xa9cf('0x20')]=0x1;queues[_0x4dfc76['transfertargetuniqueid']]=_['clone'](queues[_0x4dfc76['transfertargetlinkedid']]);queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0xd')]=_0x4dfc76[_0xa9cf('0x61')];queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x20')]=0x2;queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x59')]=queues[_0x4dfc76[_0xa9cf('0x52')]]['calleridnum'];queues[_0x4dfc76['transfertargetuniqueid']][_0xa9cf('0x5a')]=queues[_0x4dfc76['origtransfererlinkedid']]['calleridname'];queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x36')]=utils[_0xa9cf('0x14')]();queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x33')]=utils[_0xa9cf('0x14')]();queues[_0x4dfc76[_0xa9cf('0x61')]]['holdtime']=0x0;queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x5b')]=0x0;utils[_0xa9cf('0x10')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4dfc76['origtransfereruniqueid'],queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x1f')],queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0xd')],queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x59')],queues[_0x4dfc76[_0xa9cf('0x61')]][_0xa9cf('0x5a')]));}else{utils[_0xa9cf('0x10')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4dfc76['origtransfereruniqueid'],queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0x1f')],_0x4dfc76[_0xa9cf('0x52')]));queues[_0x4dfc76[_0xa9cf('0x53')]][_0xa9cf('0xd')]=_0x4dfc76[_0xa9cf('0x52')];}}}}catch(_0x1a32e6){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')]('[%s][queues][attendedtransfer]',_0x4dfc76[_0xa9cf('0x51')]),_0x1a32e6);}};exports[_0xa9cf('0x62')]=function(_0x2745a0){try{if(!_[_0xa9cf('0x17')](queues[_0x2745a0['uniqueid']])){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')](_0xa9cf('0x63'),_0x2745a0[_0xa9cf('0x4')]),_0x2745a0);queues[_0x2745a0[_0xa9cf('0x4')]][_0xa9cf('0x64')]=utils['now']();utils['info'](util[_0xa9cf('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2745a0['uniqueid'],queues[_0x2745a0['uniqueid']][_0xa9cf('0x1f')],queues[_0x2745a0['uniqueid']][_0xa9cf('0x64')]));}}catch(_0x48dd80){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')](_0xa9cf('0x63'),_0x2745a0[_0xa9cf('0x4')]),_0x48dd80);}};exports[_0xa9cf('0x65')]=function(_0xfc1c6){try{if(!_['isNil'](queues[_0xfc1c6[_0xa9cf('0x4')]])){if(!_[_0xa9cf('0x17')](queues[_0xfc1c6[_0xa9cf('0x4')]][_0xa9cf('0x64')])){utils[_0xa9cf('0xe')](util[_0xa9cf('0x2')](_0xa9cf('0x66'),_0xfc1c6['uniqueid']),_0xfc1c6);queues[_0xfc1c6[_0xa9cf('0x4')]][_0xa9cf('0x5b')]+=utils['diffTime'](utils[_0xa9cf('0x14')](),queues[_0xfc1c6['uniqueid']]['musiconholdstartAt']);utils[_0xa9cf('0x10')](util[_0xa9cf('0x2')](_0xa9cf('0x67'),_0xfc1c6['uniqueid'],queues[_0xfc1c6[_0xa9cf('0x4')]][_0xa9cf('0x1f')],queues[_0xfc1c6[_0xa9cf('0x4')]][_0xa9cf('0x5b')]));delete queues[_0xfc1c6[_0xa9cf('0x4')]][_0xa9cf('0x64')];}}}catch(_0xbc3bb0){utils[_0xa9cf('0x15')](util[_0xa9cf('0x2')](_0xa9cf('0x66'),_0xfc1c6[_0xa9cf('0x4')]),_0xbc3bb0);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 1e727e9..c555ca5 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 _0x1cd8=['[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','error','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','uniqueid','blinds','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','format','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cd8,0x7b));var _0x81cd=function(_0x53e985,_0x2ba12b){_0x53e985=_0x53e985-0x0;var _0x262457=_0x1cd8[_0x53e985];return _0x262457;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var utils=require(_0x81cd('0x2'));var transfers=require(_0x81cd('0x3'));var recordings={};function writeDB(_0x341007){var _0x5e50c0;utils[_0x81cd('0x4')](util['format']('[%s][recordings][writeDB]',_0x341007[_0x81cd('0x5')]));if(transfers[_0x81cd('0x6')][_0x341007[_0x81cd('0x5')]]){_0x5e50c0=_0x341007[_0x81cd('0x5')];_0x341007[_0x81cd('0x5')]=transfers['blinds'][_0x341007[_0x81cd('0x5')]]['transfereeuniqueid'];}if(_0x341007[_0x81cd('0x7')]){utils[_0x81cd('0x8')](_0x341007[_0x81cd('0x7')])[_0x81cd('0x9')](function(_0x3de5ad){if(_0x3de5ad){_0x341007['membername']=_0x3de5ad[_0x81cd('0xa')];_0x341007[_0x81cd('0xb')]=_0x3de5ad['id'];}utils['request'](_0x81cd('0xc'),_0x341007);});}else{utils[_0x81cd('0xd')](_0x81cd('0xc'),_0x341007);}if(_0x5e50c0)delete transfers['blinds'][_0x5e50c0];}exports[_0x81cd('0xe')]=function(_0x3dd55f){try{utils[_0x81cd('0xf')](util['format'](_0x81cd('0x10'),_0x3dd55f[_0x81cd('0x5')]),_0x3dd55f);if(_0x3dd55f['uniqueid']==_0x3dd55f[_0x81cd('0x11')]){utils[_0x81cd('0x4')](util['format'](_0x81cd('0x12'),_0x3dd55f['uniqueid'],_0x3dd55f['context'],_0x3dd55f[_0x81cd('0x13')]));recordings[_0x3dd55f[_0x81cd('0x5')]]={'uniqueid':_0x3dd55f[_0x81cd('0x5')],'accountcode':_0x3dd55f[_0x81cd('0x7')],'exten':_0x3dd55f['exten'],'context':_0x3dd55f[_0x81cd('0x14')],'channel':_0x3dd55f[_0x81cd('0x15')],'monitors':[]};}}catch(_0x497423){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x10'),_0x3dd55f[_0x81cd('0x5')]),_0x497423);}};exports['newstate']=function(_0x9a76f7){try{utils[_0x81cd('0xf')](util[_0x81cd('0x16')]('[%s][recordings][newstate]',_0x9a76f7[_0x81cd('0x5')]),_0x9a76f7);if(!_[_0x81cd('0x17')](recordings[_0x9a76f7[_0x81cd('0x5')]])&&_0x9a76f7[_0x81cd('0x18')]==0x6){utils['info'](util[_0x81cd('0x16')](_0x81cd('0x19'),_0x9a76f7[_0x81cd('0x5')],_0x9a76f7[_0x81cd('0x14')],_0x9a76f7[_0x81cd('0x15')]));}else if(!_[_0x81cd('0x17')](recordings[_0x9a76f7['linkedid']])&&_0x9a76f7[_0x81cd('0x18')]==0x6&&_0x9a76f7[_0x81cd('0x14')]!='transfer'){utils['info'](util[_0x81cd('0x16')](_0x81cd('0x1a'),_0x9a76f7[_0x81cd('0x5')],_0x9a76f7[_0x81cd('0x11')],_0x9a76f7[_0x81cd('0x14')],_0x9a76f7[_0x81cd('0x15')]));recordings[_0x9a76f7[_0x81cd('0x11')]][_0x81cd('0x7')]=_0x9a76f7[_0x81cd('0x7')];}}catch(_0x491590){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x1b'),_0x9a76f7[_0x81cd('0x5')]),_0x491590);}};exports[_0x81cd('0x1c')]=function(_0x17d5e5){try{if(!_['isNil'](_0x17d5e5[_0x81cd('0x1d')])&&!_[_0x81cd('0x17')](_0x17d5e5['variable'][_0x81cd('0x1e')])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')](_0x81cd('0x1f'),_0x17d5e5[_0x81cd('0x5')]),_0x17d5e5);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x20'),_0x17d5e5['uniqueid'],_0x17d5e5[_0x81cd('0x1d')],_0x17d5e5[_0x81cd('0x21')]));if(_[_0x81cd('0x22')](_0x17d5e5[_0x81cd('0x21')],'.wav49')){_0x17d5e5[_0x81cd('0x21')]=_0x17d5e5[_0x81cd('0x21')][_0x81cd('0x23')](_0x81cd('0x24'),'.WAV');}if(recordings[_0x17d5e5[_0x81cd('0x11')]]){var _0x3f6ef4=_[_0x81cd('0x25')](recordings[_0x17d5e5[_0x81cd('0x11')]][_0x81cd('0x26')],{'value':_0x17d5e5[_0x81cd('0x21')]});if(_[_0x81cd('0x17')](_0x3f6ef4)){recordings[_0x17d5e5[_0x81cd('0x11')]][_0x81cd('0x26')][_0x81cd('0x27')]({'value':_0x17d5e5[_0x81cd('0x21')]});}}}}catch(_0xecc3ca){utils['error'](util[_0x81cd('0x16')](_0x81cd('0x1f'),_0x17d5e5[_0x81cd('0x5')]),_0xecc3ca);}};exports[_0x81cd('0x28')]=function(_0x10eb42){try{if(!_['isNil'](recordings[_0x10eb42[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')](_0x81cd('0x29'),_0x10eb42[_0x81cd('0x5')]),_0x10eb42);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x2a'),_0x10eb42[_0x81cd('0x5')],_0x10eb42['calleridnum'],_0x10eb42[_0x81cd('0x2b')],_0x10eb42[_0x81cd('0x2c')]));recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2d')]=_0x10eb42[_0x81cd('0x2d')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2b')]=_0x10eb42[_0x81cd('0x2b')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2e')]=_0x10eb42[_0x81cd('0x2e')];recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2f')]=_0x10eb42[_0x81cd('0x2f')];if(recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x30')]==_0x81cd('0x31')&&recordings[_0x10eb42['uniqueid']][_0x81cd('0x7')]){recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x2e')]=recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x7')];recordings[_0x10eb42[_0x81cd('0x5')]]['connectedlinename']='';}recordings[_0x10eb42[_0x81cd('0x5')]][_0x81cd('0x26')][_0x81cd('0x32')](function(_0x2c6694){var _0x1a8447=_[_0x81cd('0x33')](recordings[_0x10eb42['uniqueid']]);_0x1a8447[_0x81cd('0x21')]=_0x2c6694[_0x81cd('0x21')];writeDB(_0x1a8447);});delete recordings[_0x10eb42['uniqueid']];}}catch(_0x4cfc53){utils[_0x81cd('0x34')](util[_0x81cd('0x16')]('[%s][recordings][hangup]',_0x10eb42[_0x81cd('0x5')]),_0x4cfc53);}};exports[_0x81cd('0x35')]=function(_0x5c8964){try{if(!_[_0x81cd('0x17')](recordings[_0x5c8964[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util['format']('[%s][recordings][newexten]',_0x5c8964[_0x81cd('0x5')]),_0x5c8964);utils['info'](util[_0x81cd('0x16')](_0x81cd('0x36'),_0x5c8964[_0x81cd('0x5')],_0x5c8964[_0x81cd('0x37')],_0x5c8964[_0x81cd('0x38')]));if(_0x5c8964[_0x81cd('0x37')][_0x81cd('0x39')]()==_0x81cd('0x3a')&&_[_0x81cd('0x3b')](_0x5c8964['appdata'][_0x81cd('0x39')](),_0x81cd('0x3c'))){var _0x155559=_0x5c8964[_0x81cd('0x38')][_0x81cd('0x3d')]('=');var _0x431f20=_0x155559[0x0][_0x81cd('0x3e')](_0x155559[0x0][_0x81cd('0x3f')]('(')+0x1,_0x155559[0x0][_0x81cd('0x3f')](')'));var _0x2b3e83=_0x155559[0x1];recordings[_0x5c8964[_0x81cd('0x5')]][_0x431f20]=_0x2b3e83;}}}catch(_0x36c318){utils[_0x81cd('0x34')](util[_0x81cd('0x16')](_0x81cd('0x40'),_0x5c8964[_0x81cd('0x5')]),_0x36c318);}};exports[_0x81cd('0x41')]=function(_0x46f42e){try{if(!_[_0x81cd('0x17')](recordings[_0x46f42e[_0x81cd('0x5')]])){utils[_0x81cd('0xf')](util[_0x81cd('0x16')]('[%s][recordings][queuecallerjoin]',_0x46f42e['uniqueid']),_0x46f42e);utils[_0x81cd('0x4')](util['format'](_0x81cd('0x42'),_0x46f42e['uniqueid'],_0x46f42e[_0x81cd('0x43')]));recordings[_0x46f42e['uniqueid']]['queue']=_0x46f42e['queue'];}}catch(_0x5c5220){utils[_0x81cd('0x34')](util['format'](_0x81cd('0x44'),_0x46f42e[_0x81cd('0x5')]),_0x5c5220);}};exports[_0x81cd('0x45')]=function(_0x1173ff){try{utils['debug'](util['format'](_0x81cd('0x46'),_0x1173ff[_0x81cd('0x5')]),_0x1173ff);utils[_0x81cd('0x4')](util[_0x81cd('0x16')](_0x81cd('0x47'),_0x1173ff['uniqueid'],_0x1173ff[_0x81cd('0x48')],_0x1173ff[_0x81cd('0x49')],_0x1173ff[_0x81cd('0x4a')],_0x1173ff[_0x81cd('0x4b')]));if(recordings[_0x1173ff[_0x81cd('0x4c')]]&&transfers[_0x81cd('0x6')][_0x1173ff[_0x81cd('0x4c')]]){transfers['blinds'][_0x1173ff[_0x81cd('0x4c')]]['recording']=!![];}}catch(_0x4fc3f7){utils[_0x81cd('0x34')](util[_0x81cd('0x16')]('[%s][recordings][blindtransfer]',_0x1173ff[_0x81cd('0x5')]),_0x4fc3f7);}}; \ No newline at end of file +var _0x83da=['calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','error','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt'];(function(_0xb1a45f,_0x59f3cf){var _0x15142b=function(_0x4c9cdd){while(--_0x4c9cdd){_0xb1a45f['push'](_0xb1a45f['shift']());}};_0x15142b(++_0x59f3cf);}(_0x83da,0x104));var _0xa83d=function(_0x405336,_0x3701ee){_0x405336=_0x405336-0x0;var _0x2e377f=_0x83da[_0x405336];return _0x2e377f;};'use strict';var _=require(_0xa83d('0x0'));var util=require(_0xa83d('0x1'));var utils=require(_0xa83d('0x2'));var transfers=require(_0xa83d('0x3'));var recordings={};function writeDB(_0x1d0341){var _0x3892bd;utils[_0xa83d('0x4')](util[_0xa83d('0x5')](_0xa83d('0x6'),_0x1d0341[_0xa83d('0x7')]));if(transfers[_0xa83d('0x8')][_0x1d0341[_0xa83d('0x7')]]){_0x3892bd=_0x1d0341[_0xa83d('0x7')];_0x1d0341[_0xa83d('0x7')]=transfers[_0xa83d('0x8')][_0x1d0341[_0xa83d('0x7')]][_0xa83d('0x9')];}if(_0x1d0341[_0xa83d('0xa')]){utils[_0xa83d('0xb')](_0x1d0341['accountcode'])[_0xa83d('0xc')](function(_0x9d18d6){if(_0x9d18d6){_0x1d0341['membername']=_0x9d18d6[_0xa83d('0xd')];_0x1d0341[_0xa83d('0xe')]=_0x9d18d6['id'];}utils[_0xa83d('0xf')](_0xa83d('0x10'),_0x1d0341);});}else{utils[_0xa83d('0xf')](_0xa83d('0x10'),_0x1d0341);}if(_0x3892bd)delete transfers[_0xa83d('0x8')][_0x3892bd];}exports['newchannel']=function(_0x3221ad){try{utils['debug'](util[_0xa83d('0x5')](_0xa83d('0x11'),_0x3221ad[_0xa83d('0x7')]),_0x3221ad);if(_0x3221ad[_0xa83d('0x7')]==_0x3221ad[_0xa83d('0x12')]){utils[_0xa83d('0x4')](util['format'](_0xa83d('0x13'),_0x3221ad[_0xa83d('0x7')],_0x3221ad[_0xa83d('0x14')],_0x3221ad[_0xa83d('0x15')]));recordings[_0x3221ad[_0xa83d('0x7')]]={'uniqueid':_0x3221ad['uniqueid'],'accountcode':_0x3221ad['accountcode'],'exten':_0x3221ad[_0xa83d('0x15')],'context':_0x3221ad[_0xa83d('0x14')],'channel':_0x3221ad[_0xa83d('0x16')],'monitors':[]};}}catch(_0x11cb16){utils['error'](util['format'](_0xa83d('0x11'),_0x3221ad[_0xa83d('0x7')]),_0x11cb16);}};exports[_0xa83d('0x17')]=function(_0x141f6f){try{utils[_0xa83d('0x18')](util[_0xa83d('0x5')](_0xa83d('0x19'),_0x141f6f[_0xa83d('0x7')]),_0x141f6f);if(!_[_0xa83d('0x1a')](recordings[_0x141f6f[_0xa83d('0x7')]])&&_0x141f6f[_0xa83d('0x1b')]==0x6){utils[_0xa83d('0x4')](util[_0xa83d('0x5')](_0xa83d('0x1c'),_0x141f6f['uniqueid'],_0x141f6f[_0xa83d('0x14')],_0x141f6f[_0xa83d('0x16')]));}else if(!_[_0xa83d('0x1a')](recordings[_0x141f6f['linkedid']])&&_0x141f6f[_0xa83d('0x1b')]==0x6&&_0x141f6f[_0xa83d('0x14')]!=_0xa83d('0x1d')){utils[_0xa83d('0x4')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x141f6f[_0xa83d('0x7')],_0x141f6f[_0xa83d('0x12')],_0x141f6f[_0xa83d('0x14')],_0x141f6f[_0xa83d('0x16')]));recordings[_0x141f6f[_0xa83d('0x12')]][_0xa83d('0xa')]=_0x141f6f['accountcode'];}}catch(_0x2629f6){utils['error'](util['format'](_0xa83d('0x19'),_0x141f6f[_0xa83d('0x7')]),_0x2629f6);}};exports['varset']=function(_0xaa2884){try{if(!_[_0xa83d('0x1a')](_0xaa2884[_0xa83d('0x1e')])&&!_[_0xa83d('0x1a')](_0xaa2884[_0xa83d('0x1e')][_0xa83d('0x1f')])){utils[_0xa83d('0x18')](util[_0xa83d('0x5')](_0xa83d('0x20'),_0xaa2884[_0xa83d('0x7')]),_0xaa2884);utils[_0xa83d('0x4')](util[_0xa83d('0x5')](_0xa83d('0x21'),_0xaa2884[_0xa83d('0x7')],_0xaa2884[_0xa83d('0x1e')],_0xaa2884[_0xa83d('0x22')]));if(_[_0xa83d('0x23')](_0xaa2884[_0xa83d('0x22')],_0xa83d('0x24'))){_0xaa2884[_0xa83d('0x22')]=_0xaa2884[_0xa83d('0x22')][_0xa83d('0x25')](_0xa83d('0x24'),'.WAV');}if(recordings[_0xaa2884[_0xa83d('0x12')]]){var _0x3eeca9=_['find'](recordings[_0xaa2884[_0xa83d('0x12')]][_0xa83d('0x26')],{'value':_0xaa2884[_0xa83d('0x22')]});if(_[_0xa83d('0x1a')](_0x3eeca9)){recordings[_0xaa2884[_0xa83d('0x12')]][_0xa83d('0x26')]['push']({'value':_0xaa2884[_0xa83d('0x22')]});}}}}catch(_0x4ea510){utils['error'](util[_0xa83d('0x5')](_0xa83d('0x20'),_0xaa2884[_0xa83d('0x7')]),_0x4ea510);}};exports[_0xa83d('0x27')]=function(_0x5208e4){try{if(!_[_0xa83d('0x1a')](recordings[_0x5208e4[_0xa83d('0x7')]])){utils[_0xa83d('0x18')](util['format'](_0xa83d('0x28'),_0x5208e4[_0xa83d('0x7')]),_0x5208e4);utils[_0xa83d('0x4')](util[_0xa83d('0x5')](_0xa83d('0x29'),_0x5208e4[_0xa83d('0x7')],_0x5208e4['calleridnum'],_0x5208e4[_0xa83d('0x2a')],_0x5208e4[_0xa83d('0x2b')]));recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0x2c')]=_0x5208e4[_0xa83d('0x2c')];recordings[_0x5208e4[_0xa83d('0x7')]]['calleridname']=_0x5208e4['calleridname'];recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0x2d')]=_0x5208e4[_0xa83d('0x2d')];recordings[_0x5208e4['uniqueid']]['connectedlinename']=_0x5208e4[_0xa83d('0x2e')];if(recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0x2f')]==_0xa83d('0x30')&&recordings[_0x5208e4[_0xa83d('0x7')]]['accountcode']){recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0x2d')]=recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0xa')];recordings[_0x5208e4[_0xa83d('0x7')]][_0xa83d('0x2e')]='';}recordings[_0x5208e4[_0xa83d('0x7')]]['monitors'][_0xa83d('0x31')](function(_0x4334bb){var _0x184b17=_[_0xa83d('0x32')](recordings[_0x5208e4[_0xa83d('0x7')]]);_0x184b17[_0xa83d('0x22')]=_0x4334bb[_0xa83d('0x22')];writeDB(_0x184b17);});delete recordings[_0x5208e4[_0xa83d('0x7')]];}}catch(_0x55eef5){utils[_0xa83d('0x33')](util[_0xa83d('0x5')](_0xa83d('0x28'),_0x5208e4[_0xa83d('0x7')]),_0x55eef5);}};exports[_0xa83d('0x34')]=function(_0x32f87e){try{if(!_[_0xa83d('0x1a')](recordings[_0x32f87e['uniqueid']])){utils[_0xa83d('0x18')](util[_0xa83d('0x5')](_0xa83d('0x35'),_0x32f87e[_0xa83d('0x7')]),_0x32f87e);utils['info'](util[_0xa83d('0x5')](_0xa83d('0x36'),_0x32f87e[_0xa83d('0x7')],_0x32f87e[_0xa83d('0x37')],_0x32f87e[_0xa83d('0x38')]));if(_0x32f87e[_0xa83d('0x37')][_0xa83d('0x39')]()==_0xa83d('0x3a')&&_[_0xa83d('0x3b')](_0x32f87e['appdata'][_0xa83d('0x39')](),_0xa83d('0x3c'))){var _0x395840=_0x32f87e[_0xa83d('0x38')][_0xa83d('0x3d')]('=');var _0x5abb0b=_0x395840[0x0][_0xa83d('0x3e')](_0x395840[0x0][_0xa83d('0x3f')]('(')+0x1,_0x395840[0x0][_0xa83d('0x3f')](')'));var _0x1d039a=_0x395840[0x1];recordings[_0x32f87e['uniqueid']][_0x5abb0b]=_0x1d039a;}}}catch(_0x435acb){utils['error'](util['format'](_0xa83d('0x35'),_0x32f87e[_0xa83d('0x7')]),_0x435acb);}};exports[_0xa83d('0x40')]=function(_0x4a9f47){try{if(!_['isNil'](recordings[_0x4a9f47[_0xa83d('0x7')]])){utils[_0xa83d('0x18')](util[_0xa83d('0x5')](_0xa83d('0x41'),_0x4a9f47[_0xa83d('0x7')]),_0x4a9f47);utils[_0xa83d('0x4')](util[_0xa83d('0x5')](_0xa83d('0x42'),_0x4a9f47['uniqueid'],_0x4a9f47['queue']));recordings[_0x4a9f47[_0xa83d('0x7')]]['queue']=_0x4a9f47[_0xa83d('0x43')];}}catch(_0x511549){utils[_0xa83d('0x33')](util[_0xa83d('0x5')]('[%s][recordings][queuecallerjoin]',_0x4a9f47[_0xa83d('0x7')]),_0x511549);}};exports[_0xa83d('0x44')]=function(_0x1a902d){try{utils[_0xa83d('0x18')](util[_0xa83d('0x5')](_0xa83d('0x45'),_0x1a902d[_0xa83d('0x7')]),_0x1a902d);utils['info'](util['format'](_0xa83d('0x46'),_0x1a902d[_0xa83d('0x7')],_0x1a902d[_0xa83d('0x47')],_0x1a902d[_0xa83d('0x48')],_0x1a902d[_0xa83d('0x49')],_0x1a902d['transfereecalleridname']));if(recordings[_0x1a902d[_0xa83d('0x4a')]]&&transfers[_0xa83d('0x8')][_0x1a902d['transfereruniqueid']]){transfers[_0xa83d('0x8')][_0x1a902d[_0xa83d('0x4a')]][_0xa83d('0x4b')]=!![];}}catch(_0x835d31){utils[_0xa83d('0x33')](util['format'](_0xa83d('0x45'),_0x1a902d[_0xa83d('0x7')]),_0x835d31);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 1d19ab0..0fdb6e1 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 _0x3e7e=['transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfereruniqueid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type','request','CreateVoiceTransferReport','blinds','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','error','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname'];(function(_0x159f26,_0xf2d107){var _0x59b826=function(_0x5a5233){while(--_0x5a5233){_0x159f26['push'](_0x159f26['shift']());}};_0x59b826(++_0xf2d107);}(_0x3e7e,0x8e));var _0xe3e7=function(_0x15959c,_0x2ddb06){_0x15959c=_0x15959c-0x0;var _0x59b2d5=_0x3e7e[_0x15959c];return _0x59b2d5;};'use strict';var _=require(_0xe3e7('0x0'));var util=require(_0xe3e7('0x1'));var utils=require(_0xe3e7('0x2'));function writeDB(_0x4da48){utils[_0xe3e7('0x3')](util[_0xe3e7('0x4')](_0xe3e7('0x5'),_0x4da48['type']===_0xe3e7('0x6')?_0x4da48['origtransfereruniqueid']:_0x4da48[_0xe3e7('0x7')],_0x4da48[_0xe3e7('0x8')]));utils[_0xe3e7('0x9')](_0xe3e7('0xa'),_0x4da48);}exports[_0xe3e7('0xb')]={};exports['blindtransfer']=function(_0x434063){try{utils['debug'](util[_0xe3e7('0x4')](_0xe3e7('0xc'),_0x434063['uniqueid']),_0x434063);utils[_0xe3e7('0x3')](util['format'](_0xe3e7('0xd'),_0x434063['uniqueid'],_0x434063[_0xe3e7('0xe')],_0x434063['transferercalleridname'],_0x434063['transfereecalleridnum'],_0x434063[_0xe3e7('0xf')]));_0x434063['type']=_0xe3e7('0x10');exports[_0xe3e7('0xb')][_0x434063['transfereruniqueid']]=_0x434063;writeDB(_0x434063);}catch(_0x14c718){utils[_0xe3e7('0x11')](util[_0xe3e7('0x4')](_0xe3e7('0xc'),_0x434063[_0xe3e7('0x7')]),_0x14c718);}};exports['attendedtransfer']=function(_0x55fb15){try{utils[_0xe3e7('0x12')](util[_0xe3e7('0x4')](_0xe3e7('0x13'),_0x55fb15['origtransfereruniqueid']),_0x55fb15);utils['info'](util[_0xe3e7('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x55fb15['origtransfereruniqueid'],_0x55fb15[_0xe3e7('0x14')],_0x55fb15[_0xe3e7('0x15')],_0x55fb15['transfertargetcalleridnum'],_0x55fb15[_0xe3e7('0x16')]));_0x55fb15=_['assign'](_0x55fb15,{'transfererchannel':_0x55fb15[_0xe3e7('0x17')],'transferercalleridnum':_0x55fb15['origtransferercalleridnum'],'transferercalleridname':_0x55fb15[_0xe3e7('0x15')],'transfererconnectedlinenum':_0x55fb15[_0xe3e7('0x18')],'transfererconnectedlinename':_0x55fb15[_0xe3e7('0x19')],'transfereraccountcode':_0x55fb15['origtransfereraccountcode'],'transferercontext':_0x55fb15[_0xe3e7('0x1a')],'transfererexten':_0x55fb15[_0xe3e7('0x1b')],'transfererlinkedid':_0x55fb15[_0xe3e7('0x1c')],'context':_0x55fb15[_0xe3e7('0x1d')],'extension':_0x55fb15[_0xe3e7('0x1e')],'type':_0xe3e7('0x6')});if(_[_0xe3e7('0x1f')](_0x55fb15[_0xe3e7('0x20')])){_0x55fb15=_[_0xe3e7('0x21')](_0x55fb15,{'transfereechannel':_0x55fb15[_0xe3e7('0x22')],'transfereecalleridnum':_0x55fb15['transfertargetcalleridnum'],'transfereecalleridname':_0x55fb15[_0xe3e7('0x16')],'transfereeconnectedlinenum':_0x55fb15[_0xe3e7('0x23')],'transfereeconnectedlinename':_0x55fb15['transfertargetconnectedlinename'],'transfereeaccountcode':_0x55fb15[_0xe3e7('0x24')],'transfereecontext':_0x55fb15[_0xe3e7('0x25')],'transfereeexten':_0x55fb15[_0xe3e7('0x26')],'transfereelinkedid':_0x55fb15[_0xe3e7('0x27')]});}writeDB(_0x55fb15);}catch(_0x9f5c91){utils['error'](util[_0xe3e7('0x4')](_0xe3e7('0x13'),_0x55fb15[_0xe3e7('0x28')]),_0x9f5c91);}}; \ No newline at end of file +var _0x42d7=['format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info'];(function(_0x4baba9,_0x1479ef){var _0x1e8951=function(_0x1154af){while(--_0x1154af){_0x4baba9['push'](_0x4baba9['shift']());}};_0x1e8951(++_0x1479ef);}(_0x42d7,0x191));var _0x742d=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x42d7[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x742d('0x0'));var util=require(_0x742d('0x1'));var utils=require(_0x742d('0x2'));function writeDB(_0x11beb1){utils[_0x742d('0x3')](util[_0x742d('0x4')](_0x742d('0x5'),_0x11beb1[_0x742d('0x6')]===_0x742d('0x7')?_0x11beb1[_0x742d('0x8')]:_0x11beb1[_0x742d('0x9')],_0x11beb1['type']));utils[_0x742d('0xa')](_0x742d('0xb'),_0x11beb1);}exports['blinds']={};exports[_0x742d('0xc')]=function(_0x1a9ce0){try{utils[_0x742d('0xd')](util['format'](_0x742d('0xe'),_0x1a9ce0[_0x742d('0x9')]),_0x1a9ce0);utils['info'](util[_0x742d('0x4')](_0x742d('0xf'),_0x1a9ce0[_0x742d('0x9')],_0x1a9ce0[_0x742d('0x10')],_0x1a9ce0['transferercalleridname'],_0x1a9ce0[_0x742d('0x11')],_0x1a9ce0[_0x742d('0x12')]));_0x1a9ce0['type']=_0x742d('0x13');exports[_0x742d('0x14')][_0x1a9ce0[_0x742d('0x15')]]=_0x1a9ce0;writeDB(_0x1a9ce0);}catch(_0x85b07b){utils[_0x742d('0x16')](util[_0x742d('0x4')](_0x742d('0xe'),_0x1a9ce0[_0x742d('0x9')]),_0x85b07b);}};exports[_0x742d('0x17')]=function(_0x1665b2){try{utils[_0x742d('0xd')](util[_0x742d('0x4')](_0x742d('0x18'),_0x1665b2['origtransfereruniqueid']),_0x1665b2);utils[_0x742d('0x3')](util[_0x742d('0x4')](_0x742d('0x19'),_0x1665b2['origtransfereruniqueid'],_0x1665b2['origtransferercalleridnum'],_0x1665b2['origtransferercalleridname'],_0x1665b2[_0x742d('0x1a')],_0x1665b2[_0x742d('0x1b')]));_0x1665b2=_[_0x742d('0x1c')](_0x1665b2,{'transfererchannel':_0x1665b2[_0x742d('0x1d')],'transferercalleridnum':_0x1665b2['origtransferercalleridnum'],'transferercalleridname':_0x1665b2[_0x742d('0x1e')],'transfererconnectedlinenum':_0x1665b2[_0x742d('0x1f')],'transfererconnectedlinename':_0x1665b2[_0x742d('0x20')],'transfereraccountcode':_0x1665b2['origtransfereraccountcode'],'transferercontext':_0x1665b2[_0x742d('0x21')],'transfererexten':_0x1665b2[_0x742d('0x22')],'transfererlinkedid':_0x1665b2[_0x742d('0x23')],'context':_0x1665b2[_0x742d('0x24')],'extension':_0x1665b2[_0x742d('0x25')],'type':_0x742d('0x7')});if(_[_0x742d('0x26')](_0x1665b2[_0x742d('0x27')])){_0x1665b2=_[_0x742d('0x1c')](_0x1665b2,{'transfereechannel':_0x1665b2[_0x742d('0x28')],'transfereecalleridnum':_0x1665b2[_0x742d('0x1a')],'transfereecalleridname':_0x1665b2[_0x742d('0x1b')],'transfereeconnectedlinenum':_0x1665b2['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1665b2['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1665b2[_0x742d('0x29')],'transfereecontext':_0x1665b2[_0x742d('0x2a')],'transfereeexten':_0x1665b2[_0x742d('0x2b')],'transfereelinkedid':_0x1665b2[_0x742d('0x2c')]});}writeDB(_0x1665b2);}catch(_0x59e593){utils['error'](util[_0x742d('0x4')](_0x742d('0x18'),_0x1665b2[_0x742d('0x8')]),_0x59e593);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 45a907d..42a341b 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 _0x2f8f=['isBefore','bluebird','jayson/promise','moment','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now','isAfter'];(function(_0xe62b83,_0x5bf4c8){var _0x3ce0de=function(_0x4701a1){while(--_0x4701a1){_0xe62b83['push'](_0xe62b83['shift']());}};_0x3ce0de(++_0x5bf4c8);}(_0x2f8f,0x13c));var _0xf2f8=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x2f8f[_0x43fdf8];return _0x1160c6;};'use strict';var BPromise=require(_0xf2f8('0x0'));var jayson=require(_0xf2f8('0x1'));var moment=require(_0xf2f8('0x2'));var util=require('util');var client=jayson[_0xf2f8('0x3')][_0xf2f8('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xf2f8('0x5'));exports[_0xf2f8('0x6')]=function(_0x4a85d7,_0x1676a7){logger['info'](_0x4a85d7,_0x1676a7?util[_0xf2f8('0x7')](_0x1676a7,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0x8')]=function(_0xf045cb,_0x52973d){logger[_0xf2f8('0x8')](_0xf045cb,_0x52973d?util[_0xf2f8('0x7')](_0x52973d,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0x9')]=function(_0x4deb5d,_0x3fcf2d){logger[_0xf2f8('0x9')](_0x4deb5d,_0x3fcf2d?util[_0xf2f8('0x7')](_0x3fcf2d,{'showHidden':![],'depth':null}):'');};exports[_0xf2f8('0xa')]=function(_0x1fcc1b,_0x208a2a){return client[_0xf2f8('0xa')](_0x1fcc1b,{'body':_0x208a2a})[_0xf2f8('0xb')](function(_0x446743){logger['debug']('[utils][request]\x20name:%s',_0x1fcc1b,_0x446743?util[_0xf2f8('0x7')](_0x446743,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4bc336){logger[_0xf2f8('0x9')](_0xf2f8('0xc'),_0x1fcc1b,_0x4bc336?util[_0xf2f8('0x7')](_0x4bc336,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5c23de){return client[_0xf2f8('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf2f8('0xd'),'name',_0xf2f8('0xe')],'where':_0x5c23de,'limit':0x1}})[_0xf2f8('0xb')](function(_0x58d525){logger[_0xf2f8('0x8')](_0xf2f8('0xf'),JSON['stringify'](_0x5c23de),_0x58d525?util[_0xf2f8('0x7')](_0x58d525,{'showHidden':![],'depth':null}):'');return _0x58d525[_0xf2f8('0x10')][_0xf2f8('0x11')]?_0x58d525[_0xf2f8('0x10')][0x0]:null;});}exports[_0xf2f8('0x12')]=function(_0x4413de){return new BPromise(function(_0x596cb7,_0x35d787){if(_0x4413de){return getUser({'internal':_0x4413de})[_0xf2f8('0xb')](function(_0x1730f4){logger[_0xf2f8('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4413de,_0x1730f4?_0xf2f8('0x13'):'notfound');return _0x596cb7(_0x1730f4);})['catch'](function(_0x137ee1){logger[_0xf2f8('0x9')]('[utils][getUserByInternal]',_0x137ee1?util[_0xf2f8('0x7')](_0x137ee1,{'showHidden':![],'depth':null}):'');return _0x596cb7(null);});}return _0x596cb7(null);});};exports[_0xf2f8('0x14')]=function(_0x64fa64){return new BPromise(function(_0x267b6e,_0x2da8e4){if(_0x64fa64){return getUser({'interface':_0x64fa64})[_0xf2f8('0xb')](function(_0x57c27e){logger['info'](_0xf2f8('0x15'),_0x64fa64,_0x57c27e?_0xf2f8('0x13'):_0xf2f8('0x16'));return _0x267b6e(_0x57c27e);})[_0xf2f8('0x17')](function(_0x531619){logger[_0xf2f8('0x9')](_0xf2f8('0x18'),_0x531619?util[_0xf2f8('0x7')](_0x531619,{'showHidden':![],'depth':null}):'');return _0x267b6e(null);});}return _0x267b6e(null);});};exports[_0xf2f8('0x19')]=function(_0x213005){return new BPromise(function(_0x56461d,_0x1aa3fa){if(_0x213005){return getUser({'name':_0x213005})['then'](function(_0xf45da8){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x213005,_0xf45da8?'found':'notfound');return _0x56461d(_0xf45da8);})[_0xf2f8('0x17')](function(_0x40ad31){logger[_0xf2f8('0x9')](_0xf2f8('0x1a'),_0x40ad31?util[_0xf2f8('0x7')](_0x40ad31,{'showHidden':![],'depth':null}):'');return _0x56461d(null);});}return _0x56461d(null);});};exports[_0xf2f8('0x1b')]=function(_0x13adb6){return new BPromise(function(_0x20b9f,_0x5f42e4){if(_0x13adb6){return client[_0xf2f8('0xa')](_0xf2f8('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xf2f8('0x1d'),_0xf2f8('0x1e'),'acw','acwTimeout'],'where':{'name':_0x13adb6},'limit':0x1}})[_0xf2f8('0xb')](function(_0x50a0bc){logger[_0xf2f8('0x8')](_0xf2f8('0x1f'),_0x13adb6,_0x50a0bc?util['inspect'](_0x50a0bc,{'showHidden':![],'depth':null}):'');logger[_0xf2f8('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x13adb6,_0x50a0bc?_0xf2f8('0x13'):'notfound');return _0x20b9f(_0x50a0bc[_0xf2f8('0x10')]['length']?_0x50a0bc['result'][0x0]:null);})[_0xf2f8('0x17')](function(_0x1d6218){logger['error'](_0xf2f8('0x20'),_0x1d6218?util[_0xf2f8('0x7')](_0x1d6218,{'showHidden':![],'depth':null}):'');return _0x20b9f(null);});}return _0x20b9f(null);});};exports[_0xf2f8('0x21')]=function(_0x2d9c06,_0x39a408){return moment(_0x2d9c06)[_0xf2f8('0x22')](_0x39a408,_0xf2f8('0x23'))[_0xf2f8('0x24')](_0xf2f8('0x25'));};exports[_0xf2f8('0x26')]=function(_0x524fa8,_0x443275){return moment(_0x524fa8)['subtract'](_0x443275,_0xf2f8('0x23'))[_0xf2f8('0x24')](_0xf2f8('0x25'));};exports[_0xf2f8('0x27')]=function(_0x59d8c5,_0x259b92){return moment(_0x59d8c5)[_0xf2f8('0x28')](moment(_0x259b92),_0xf2f8('0x23'));};exports[_0xf2f8('0x29')]=function(_0x216d35,_0x3648e0){return parseInt(_0x216d35,0xa)+parseInt(_0x3648e0,0xa);};exports[_0xf2f8('0x2a')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf2f8('0x2b')]=function(_0x241eed,_0x240b27){if(_0x240b27){return moment(_0x241eed)[_0xf2f8('0x2b')](_0x240b27);}return!![];};exports['isBefore']=function(_0x43f690,_0x2dbebb){if(_0x2dbebb){return moment(_0x43f690)[_0xf2f8('0x2c')](_0x2dbebb);}else if(_0x43f690){return!![];}return![];}; \ No newline at end of file +var _0xa9f6=['subtract','diffTime','diff','isAfter','isBefore','bluebird','moment','util','client','../../config/logger','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','internal','name','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime'];(function(_0x6a4fe7,_0x40a337){var _0x5e467d=function(_0x24eb0b){while(--_0x24eb0b){_0x6a4fe7['push'](_0x6a4fe7['shift']());}};_0x5e467d(++_0x40a337);}(_0xa9f6,0x14e));var _0x6a9f=function(_0x3c5fcf,_0x285e55){_0x3c5fcf=_0x3c5fcf-0x0;var _0x4d1dcb=_0xa9f6[_0x3c5fcf];return _0x4d1dcb;};'use strict';var BPromise=require(_0x6a9f('0x0'));var jayson=require('jayson/promise');var moment=require(_0x6a9f('0x1'));var util=require(_0x6a9f('0x2'));var client=jayson[_0x6a9f('0x3')]['http']({'port':0x2329});var logger=require(_0x6a9f('0x4'))('xdr');exports[_0x6a9f('0x5')]=function(_0x31f05e,_0x33b04f){logger[_0x6a9f('0x5')](_0x31f05e,_0x33b04f?util['inspect'](_0x33b04f,{'showHidden':![],'depth':null}):'');};exports[_0x6a9f('0x6')]=function(_0x3e52d7,_0x398010){logger[_0x6a9f('0x6')](_0x3e52d7,_0x398010?util[_0x6a9f('0x7')](_0x398010,{'showHidden':![],'depth':null}):'');};exports[_0x6a9f('0x8')]=function(_0x56077e,_0x312991){logger['error'](_0x56077e,_0x312991?util[_0x6a9f('0x7')](_0x312991,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x2d48f6,_0x2a9658){return client[_0x6a9f('0x9')](_0x2d48f6,{'body':_0x2a9658})[_0x6a9f('0xa')](function(_0x556e79){logger[_0x6a9f('0x6')](_0x6a9f('0xb'),_0x2d48f6,_0x556e79?util[_0x6a9f('0x7')](_0x556e79,{'showHidden':![],'depth':null}):'');})[_0x6a9f('0xc')](function(_0x4d7825){logger['error'](_0x6a9f('0xb'),_0x2d48f6,_0x4d7825?util[_0x6a9f('0x7')](_0x4d7825,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5bcd04){return client[_0x6a9f('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x6a9f('0xd'),_0x6a9f('0xe'),'interface'],'where':_0x5bcd04,'limit':0x1}})[_0x6a9f('0xa')](function(_0x5cad6b){logger[_0x6a9f('0x6')]('[utils][getUser]\x20where:%s',JSON[_0x6a9f('0xf')](_0x5bcd04),_0x5cad6b?util[_0x6a9f('0x7')](_0x5cad6b,{'showHidden':![],'depth':null}):'');return _0x5cad6b[_0x6a9f('0x10')][_0x6a9f('0x11')]?_0x5cad6b[_0x6a9f('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x4b0530){return new BPromise(function(_0x5e4d29,_0x5de2b0){if(_0x4b0530){return getUser({'internal':_0x4b0530})[_0x6a9f('0xa')](function(_0x1d81dc){logger[_0x6a9f('0x5')](_0x6a9f('0x12'),_0x4b0530,_0x1d81dc?_0x6a9f('0x13'):_0x6a9f('0x14'));return _0x5e4d29(_0x1d81dc);})[_0x6a9f('0xc')](function(_0xda5380){logger[_0x6a9f('0x8')](_0x6a9f('0x15'),_0xda5380?util[_0x6a9f('0x7')](_0xda5380,{'showHidden':![],'depth':null}):'');return _0x5e4d29(null);});}return _0x5e4d29(null);});};exports[_0x6a9f('0x16')]=function(_0x31d2d0){return new BPromise(function(_0x16fcee,_0x2981a0){if(_0x31d2d0){return getUser({'interface':_0x31d2d0})['then'](function(_0x5b6d34){logger[_0x6a9f('0x5')](_0x6a9f('0x17'),_0x31d2d0,_0x5b6d34?_0x6a9f('0x13'):_0x6a9f('0x14'));return _0x16fcee(_0x5b6d34);})['catch'](function(_0x512aed){logger['error'](_0x6a9f('0x18'),_0x512aed?util[_0x6a9f('0x7')](_0x512aed,{'showHidden':![],'depth':null}):'');return _0x16fcee(null);});}return _0x16fcee(null);});};exports[_0x6a9f('0x19')]=function(_0x262dad){return new BPromise(function(_0x5b921f,_0x6b12b7){if(_0x262dad){return getUser({'name':_0x262dad})[_0x6a9f('0xa')](function(_0x5cd590){logger[_0x6a9f('0x5')](_0x6a9f('0x1a'),_0x262dad,_0x5cd590?_0x6a9f('0x13'):'notfound');return _0x5b921f(_0x5cd590);})[_0x6a9f('0xc')](function(_0x3a6647){logger['error'](_0x6a9f('0x1b'),_0x3a6647?util[_0x6a9f('0x7')](_0x3a6647,{'showHidden':![],'depth':null}):'');return _0x5b921f(null);});}return _0x5b921f(null);});};exports[_0x6a9f('0x1c')]=function(_0x496f7f){return new BPromise(function(_0x2bb342,_0x2cf7e0){if(_0x496f7f){return client[_0x6a9f('0x9')](_0x6a9f('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x6a9f('0x1e'),_0x6a9f('0x1f'),_0x6a9f('0x20')],'where':{'name':_0x496f7f},'limit':0x1}})['then'](function(_0x445749){logger[_0x6a9f('0x6')](_0x6a9f('0x21'),_0x496f7f,_0x445749?util['inspect'](_0x445749,{'showHidden':![],'depth':null}):'');logger[_0x6a9f('0x5')](_0x6a9f('0x22'),_0x496f7f,_0x445749?_0x6a9f('0x13'):_0x6a9f('0x14'));return _0x2bb342(_0x445749[_0x6a9f('0x10')][_0x6a9f('0x11')]?_0x445749['result'][0x0]:null);})[_0x6a9f('0xc')](function(_0x278271){logger['error'](_0x6a9f('0x23'),_0x278271?util[_0x6a9f('0x7')](_0x278271,{'showHidden':![],'depth':null}):'');return _0x2bb342(null);});}return _0x2bb342(null);});};exports[_0x6a9f('0x24')]=function(_0x4d1c36,_0x409cbd){return moment(_0x4d1c36)[_0x6a9f('0x25')](_0x409cbd,_0x6a9f('0x26'))[_0x6a9f('0x27')](_0x6a9f('0x28'));};exports[_0x6a9f('0x29')]=function(_0x5c781b,_0x52378f){return moment(_0x5c781b)[_0x6a9f('0x2a')](_0x52378f,_0x6a9f('0x26'))['format'](_0x6a9f('0x28'));};exports[_0x6a9f('0x2b')]=function(_0x49531e,_0x48b11a){return moment(_0x49531e)[_0x6a9f('0x2c')](moment(_0x48b11a),'seconds');};exports['sumTime']=function(_0xa33d37,_0x320818){return parseInt(_0xa33d37,0xa)+parseInt(_0x320818,0xa);};exports['now']=function(){return moment()[_0x6a9f('0x27')](_0x6a9f('0x28'));};exports[_0x6a9f('0x2d')]=function(_0xc661fc,_0x401d4a){if(_0x401d4a){return moment(_0xc661fc)[_0x6a9f('0x2d')](_0x401d4a);}return!![];};exports[_0x6a9f('0x2e')]=function(_0x1b8e71,_0x113e92){if(_0x113e92){return moment(_0x1b8e71)[_0x6a9f('0x2e')](_0x113e92);}else if(_0x1b8e71){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 b462a86..e0e01d7 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 _0x6f55=['method','x-forwarded-for','headers','connection','url','statusCode','responseTime','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)','remoteAddress','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format'];(function(_0x33c90d,_0x56556a){var _0x4047ff=function(_0x9ae627){while(--_0x9ae627){_0x33c90d['push'](_0x33c90d['shift']());}};_0x4047ff(++_0x56556a);}(_0x6f55,0xd5));var _0x56f5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6f55[_0x36eaaa];return _0x461349;};var fs=require(_0x56f5('0x0'));var _=require(_0x56f5('0x1'));var ewinston=require('express-winston');var path=require(_0x56f5('0x2'));var util=require(_0x56f5('0x3'));var fileLogger=require(_0x56f5('0x4'))[_0x56f5('0x5')];var safeTemplate=require(_0x56f5('0x6'))[_0x56f5('0x7')];var maskSensitiveData=require(_0x56f5('0x8'))[_0x56f5('0x9')];function ClientSideLogger(){function _0x2d5f1e(_0x9c4337){var _0x2091e5=path[_0x56f5('0xa')](_0x56f5('0xb'),_0x56f5('0xc'),_0x56f5('0xd'));var _0x343697=path['join'](_0x56f5('0xe'),_0x9c4337[_0x56f5('0xf')]+'-'+_0x9c4337[_0x56f5('0x10')]);return fs[_0x56f5('0x11')](path[_0x56f5('0xa')](_0x2091e5,_0x343697))[_0x56f5('0x12')](function(){var _0xb5cd6c=fileLogger(_0x56f5('0xe'),path[_0x56f5('0xa')](_0x2091e5,_0x343697));return _0xb5cd6c;})[_0x56f5('0x13')](function(_0x17d010){throw _0x17d010;});}this[_0x56f5('0xc')]=function(_0x20a8b7,_0x52cc49,_0x508f4a,_0x51c1a0){return _0x2d5f1e(_0x20a8b7[_0x56f5('0x14')])[_0x56f5('0x12')](function(_0x4b2bbc){var _0x51bde1=_0x4b2bbc[_0x52cc49];return _0x51bde1;})[_0x56f5('0x12')](function(_0x25a94f){var _0x3eab5f=_0x20a8b7[_0x56f5('0x14')]?_0x20a8b7['user']['id']:_0x56f5('0x15');var _0x153a67=_0x51c1a0[_0x56f5('0x16')];var _0x11c1e1=_0x51c1a0['timestamp'];var _0x44248a=new Date(Number(_0x11c1e1));return _0x25a94f(_0x3eab5f,_0x44248a,_0x508f4a,_0x153a67);})['catch'](function(_0x2d3eaa){fileLogger(_0x56f5('0xe'))['error'](_0x2d3eaa);});};}function setupLoggers(_0x4ecd94){return new Promise(function(_0x2b3a87){var _0x6f2509=new ClientSideLogger();var _0xe4d62a=fileLogger(_0x56f5('0x17'));var _0x5ee509=fileLogger('auth');_0x4ecd94[_0x56f5('0x18')](_0x56f5('0x19'),_0x6f2509);_0x4ecd94[_0x56f5('0x1a')](ewinston[_0x56f5('0x1b')]({'winstonInstance':_0xe4d62a,'meta':![],'statusLevels':!![],'msg':function(_0x535743,_0x5c061c){var _0x536abc=_0x56f5('0x1c');if(!_[_0x56f5('0x1d')](_0x535743[_0x56f5('0x1e')])){_0x536abc+='\x20body=%s';var _0x34607e=_0x535743['body'];maskSensitiveData(_0x34607e);}return safeTemplate(util[_0x56f5('0x1f')](_0x536abc,_0x535743[_0x56f5('0x20')],_0x535743['headers'][_0x56f5('0x21')]?_0x535743[_0x56f5('0x22')]['x-forwarded-for']:_0x535743[_0x56f5('0x23')]['remoteAddress']||_0x535743['ip'],_0x535743[_0x56f5('0x24')],_0x5c061c[_0x56f5('0x25')],_0x5c061c[_0x56f5('0x26')],_0x535743[_0x56f5('0x14')]?_0x535743[_0x56f5('0x14')]['id']:null,_0x535743[_0x56f5('0x14')]?_0x535743['user'][_0x56f5('0x10')]:null,_0x535743[_0x56f5('0x14')]?_0x535743[_0x56f5('0x14')]['role']:null,_0x34607e?util[_0x56f5('0x27')](_0x34607e,![],null):''));}}));_0x4ecd94[_0x56f5('0x1a')](ewinston[_0x56f5('0x1b')]({'winstonInstance':_0x5ee509,'meta':![],'statusLevels':!![],'msg':function(_0xa15ece,_0x4362d0){var _0x2dad2c=_0x56f5('0x28');if(_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x29')]&&_0xa15ece['body'][_0x56f5('0x2a')]){_0x2dad2c=_0x56f5('0x2b');}return util['format'](_0x2dad2c,_0xa15ece[_0x56f5('0x20')],_0xa15ece[_0x56f5('0x22')][_0x56f5('0x21')]?_0xa15ece[_0x56f5('0x22')][_0x56f5('0x21')]:_0xa15ece['connection'][_0x56f5('0x2c')]||_0xa15ece['ip'],_0xa15ece['url'],_0x4362d0[_0x56f5('0x25')],_0x4362d0[_0x56f5('0x26')],_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')]['id']:null,_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')][_0x56f5('0x10')]:null,_0xa15ece[_0x56f5('0x14')]?_0xa15ece[_0x56f5('0x14')][_0x56f5('0xf')]:null,_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x29')]?_0xa15ece['body'][_0x56f5('0x29')]:_0x56f5('0x2d'),_0xa15ece['body']&&_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x2a')]?_0xa15ece[_0x56f5('0x1e')]['agent_id']:'',_0xa15ece[_0x56f5('0x1e')]&&_0xa15ece['body'][_0x56f5('0x2e')]?_0xa15ece[_0x56f5('0x1e')][_0x56f5('0x2e')]:'');},'ignoreRoute':function(_0x1ece83){var _0x566b79=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x566b79[_0x56f5('0x2f')](_0x1ece83[_0x56f5('0x24')]);}}));return _0x2b3a87();});}exports[_0x56f5('0x30')]=setupLoggers; \ No newline at end of file +var _0x875b=['isEmpty','body','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','/var','log','xcally','join','role','then','client','user','no-user','catch','error','api','set','client-side-logger','logger'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0x875b,0x158));var _0xb875=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x875b[_0x1deee5];return _0x1d6c3a;};var fs=require(_0xb875('0x0'));var _=require(_0xb875('0x1'));var ewinston=require('express-winston');var path=require(_0xb875('0x2'));var util=require(_0xb875('0x3'));var fileLogger=require(_0xb875('0x4'))[_0xb875('0x5')];var safeTemplate=require(_0xb875('0x6'))[_0xb875('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0xb875('0x8')];function ClientSideLogger(){function _0x248d43(_0x50adcc){var _0x50a3ce=path['join'](_0xb875('0x9'),_0xb875('0xa'),_0xb875('0xb'));var _0x57b99c=path[_0xb875('0xc')]('client',_0x50adcc[_0xb875('0xd')]+'-'+_0x50adcc['name']);return fs['ensureDir'](path[_0xb875('0xc')](_0x50a3ce,_0x57b99c))[_0xb875('0xe')](function(){var _0x5b9dc0=fileLogger(_0xb875('0xf'),path[_0xb875('0xc')](_0x50a3ce,_0x57b99c));return _0x5b9dc0;})['catch'](function(_0x92eaad){throw _0x92eaad;});}this[_0xb875('0xa')]=function(_0x4013b8,_0x4fe903,_0x33d802,_0x399a6f){return _0x248d43(_0x4013b8[_0xb875('0x10')])[_0xb875('0xe')](function(_0x373e65){var _0x457adc=_0x373e65[_0x4fe903];return _0x457adc;})[_0xb875('0xe')](function(_0x32458b){var _0x16cebb=_0x4013b8['user']?_0x4013b8[_0xb875('0x10')]['id']:_0xb875('0x11');var _0x5e7a55=_0x399a6f['data'];var _0x317935=_0x399a6f['timestamp'];var _0x3b387e=new Date(Number(_0x317935));return _0x32458b(_0x16cebb,_0x3b387e,_0x33d802,_0x5e7a55);})[_0xb875('0x12')](function(_0x285545){fileLogger('client')[_0xb875('0x13')](_0x285545);});};}function setupLoggers(_0x4ca347){return new Promise(function(_0x414671){var _0x52c7ac=new ClientSideLogger();var _0x4daf9e=fileLogger(_0xb875('0x14'));var _0x38987f=fileLogger('auth');_0x4ca347[_0xb875('0x15')](_0xb875('0x16'),_0x52c7ac);_0x4ca347['use'](ewinston[_0xb875('0x17')]({'winstonInstance':_0x4daf9e,'meta':![],'statusLevels':!![],'msg':function(_0x2edeb7,_0x56d4ec){var _0x799813='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xb875('0x18')](_0x2edeb7[_0xb875('0x19')])){_0x799813+='\x20body=%s';var _0x37db2f=_0x2edeb7['body'];maskSensitiveData(_0x37db2f);}return safeTemplate(util[_0xb875('0x1a')](_0x799813,_0x2edeb7[_0xb875('0x1b')],_0x2edeb7[_0xb875('0x1c')]['x-forwarded-for']?_0x2edeb7[_0xb875('0x1c')][_0xb875('0x1d')]:_0x2edeb7['connection'][_0xb875('0x1e')]||_0x2edeb7['ip'],_0x2edeb7[_0xb875('0x1f')],_0x56d4ec[_0xb875('0x20')],_0x56d4ec[_0xb875('0x21')],_0x2edeb7[_0xb875('0x10')]?_0x2edeb7[_0xb875('0x10')]['id']:null,_0x2edeb7[_0xb875('0x10')]?_0x2edeb7[_0xb875('0x10')][_0xb875('0x22')]:null,_0x2edeb7['user']?_0x2edeb7[_0xb875('0x10')][_0xb875('0xd')]:null,_0x37db2f?util[_0xb875('0x23')](_0x37db2f,![],null):''));}}));_0x4ca347[_0xb875('0x24')](ewinston[_0xb875('0x17')]({'winstonInstance':_0x38987f,'meta':![],'statusLevels':!![],'msg':function(_0x3a588c,_0x326267){var _0x31c2d=_0xb875('0x25');if(_0x3a588c[_0xb875('0x19')]&&_0x3a588c[_0xb875('0x19')][_0xb875('0x26')]&&_0x3a588c[_0xb875('0x19')][_0xb875('0x27')]){_0x31c2d=_0xb875('0x28');}return util[_0xb875('0x1a')](_0x31c2d,_0x3a588c[_0xb875('0x1b')],_0x3a588c[_0xb875('0x1c')][_0xb875('0x1d')]?_0x3a588c[_0xb875('0x1c')]['x-forwarded-for']:_0x3a588c[_0xb875('0x29')][_0xb875('0x1e')]||_0x3a588c['ip'],_0x3a588c[_0xb875('0x1f')],_0x326267[_0xb875('0x20')],_0x326267[_0xb875('0x21')],_0x3a588c['user']?_0x3a588c[_0xb875('0x10')]['id']:null,_0x3a588c['user']?_0x3a588c[_0xb875('0x10')]['name']:null,_0x3a588c[_0xb875('0x10')]?_0x3a588c[_0xb875('0x10')][_0xb875('0xd')]:null,_0x3a588c[_0xb875('0x19')]&&_0x3a588c[_0xb875('0x19')]['device']?_0x3a588c[_0xb875('0x19')][_0xb875('0x26')]:_0xb875('0x2a'),_0x3a588c[_0xb875('0x19')]&&_0x3a588c[_0xb875('0x19')][_0xb875('0x27')]?_0x3a588c[_0xb875('0x19')]['agent_id']:'',_0x3a588c[_0xb875('0x19')]&&_0x3a588c['body'][_0xb875('0x2b')]?_0x3a588c[_0xb875('0x19')]['agent_name']:'');},'ignoreRoute':function(_0x42ac5d){var _0x8aff90=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x8aff90[_0xb875('0x2c')](_0x42ac5d['url']);}}));return _0x414671();});}exports[_0xb875('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 35a71e2..21471fd 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf885=['minutes','day','endOf','isBetween','timeCompare','format','ddd','includes','date','min','max','domCompare','test','padStart','length','iftime','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours'];(function(_0x3e270c,_0x4474e7){var _0x985cab=function(_0x385964){while(--_0x385964){_0x3e270c['push'](_0x3e270c['shift']());}};_0x985cab(++_0x4474e7);}(_0xf885,0x130));var _0x5f88=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0xf885[_0x244f5d];return _0x1a3886;};var _=require('lodash');var moment=require(_0x5f88('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0xd2473a){return _0xd2473a[_0x5f88('0x1')];})[_0x5f88('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5f88('0x3');var EINVALID_DATE=_0x5f88('0x4');function throwIfDateNotValid(_0x3d0669){if(!_0x3d0669[_0x5f88('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x21819b){var _0x4bb05e=_0x21819b[_0x5f88('0x6')](':')[_0x5f88('0x7')](function(_0xbfe9d2){return parseInt(_0xbfe9d2,0xa);});var _0xe71b90=_0x4bb05e[0x0];var _0x342fd3=_0x4bb05e[0x1];if(_0xe71b90<0x0||_0xe71b90>0x17||_0x342fd3<0x0||_0x342fd3>0x3b){throw new Error(EINVALID_DATE);}return[_0xe71b90,_0x342fd3];}function circularDoWInterval(_0x2f7ac3,_0x4b90e2){if(_0x2f7ac3===_0x4b90e2){return[_0x2f7ac3];}else{var _0x2d2e89=moment[_0x5f88('0x8')]();moment[_0x5f88('0x8')]('en');var _0x22efd3=moment[_0x5f88('0x9')]()[_0x5f88('0x7')](function(_0x186f38){return _0x186f38[_0x5f88('0xa')]();});moment[_0x5f88('0x8')](_0x2d2e89);var _0x58ed16=_0x22efd3[_0x5f88('0xb')](_0x2f7ac3);var _0x3fddea=_0x22efd3[_0x5f88('0xb')](_0x4b90e2);if(_0x3fddea>_0x58ed16){return _0x22efd3[_0x5f88('0xc')](_0x58ed16,_0x3fddea+0x1);}else{var _0x47a963=_0x22efd3[_0x5f88('0xc')](0x0,_0x3fddea+0x1);var _0x266227=_0x22efd3['slice'](_0x58ed16);return _0x266227[_0x5f88('0xd')](_0x47a963);}}}module[_0x5f88('0xe')][_0x5f88('0xf')]=circularDoWInterval;function circularMonthInterval(_0x1f0f45,_0x4f58e4){if(_0x1f0f45===_0x4f58e4){return[_0x1f0f45];}else{var _0x2bd747=moment['locale']();moment[_0x5f88('0x8')]('en');var _0x2b5670=moment[_0x5f88('0x10')]()[_0x5f88('0x7')](function(_0x276576){return _0x276576['toLowerCase']();});moment[_0x5f88('0x8')](_0x2bd747);var _0x3a702a=_0x2b5670['indexOf'](_0x1f0f45);var _0x237239=_0x2b5670[_0x5f88('0xb')](_0x4f58e4);if(_0x237239>_0x3a702a){return _0x2b5670[_0x5f88('0xc')](_0x3a702a,_0x237239+0x1);}else{var _0x37da0a=_0x2b5670[_0x5f88('0xc')](0x0,_0x237239+0x1);var _0xb27f93=_0x2b5670[_0x5f88('0xc')](_0x3a702a);return _0xb27f93[_0x5f88('0xd')](_0x37da0a);}}}module['exports'][_0x5f88('0x11')]=circularMonthInterval;function parseDom(_0x15d7e1){var _0x55a15b=parseInt(_0x15d7e1,0xa);if(_0x55a15b<0x1||_0x55a15b>0x1f){throw new Error(EINVALID_DATE);}return _0x55a15b;}function timeCompare(_0x5d87bd,_0x3d1219,_0x16e0ab){var _0x28f55d=_0x5d87bd[_0x5f88('0x12')]();var _0x3adaa4=extractTime(_0x3d1219);var _0x6c9eca=_0x3adaa4[0x0];var _0x5b53a2=_0x3adaa4[0x1];var _0x7d4e6b=_0x5d87bd['clone']()[_0x5f88('0x13')](_0x6c9eca)[_0x5f88('0x14')](_0x5b53a2);throwIfDateNotValid(_0x7d4e6b);var _0x478d78=extractTime(_0x16e0ab);var _0x4e5754=_0x478d78[0x0];var _0x37dfb4=_0x478d78[0x1];var _0x489693=_0x5d87bd['clone']()[_0x5f88('0x13')](_0x4e5754)[_0x5f88('0x14')](_0x37dfb4);throwIfDateNotValid(_0x489693);if(_0x489693['isBefore'](_0x7d4e6b)){var _0x5646ff=_0x28f55d['clone']()['startOf'](_0x5f88('0x15'));var _0x5dbab3=_0x28f55d[_0x5f88('0x12')]()[_0x5f88('0x16')](_0x5f88('0x15'));return _0x28f55d[_0x5f88('0x17')](_0x7d4e6b,_0x5dbab3,undefined,'[]')||_0x28f55d[_0x5f88('0x17')](_0x5646ff,_0x489693,undefined,'[]');}else{return _0x28f55d['isBetween'](_0x7d4e6b,_0x489693,undefined,'[]');}}module[_0x5f88('0xe')][_0x5f88('0x18')]=timeCompare;function dowCompare(_0x19c596,_0x3bb91f,_0x1996f3){var _0x279aee=_0x19c596[_0x5f88('0x8')]('en')[_0x5f88('0x19')](_0x5f88('0x1a'))[_0x5f88('0xa')]();return circularDoWInterval(_0x3bb91f,_0x1996f3)[_0x5f88('0x1b')](_0x279aee);}module[_0x5f88('0xe')]['dowCompare']=dowCompare;function domCompare(_0x3e6928,_0x165da9,_0x19a46e){var _0x429a88=_0x3e6928[_0x5f88('0x1c')]();if(_0x165da9===_0x19a46e){return _0x429a88===_0x165da9;}else{var _0x2b80c9=_0x3e6928['daysInMonth']();var _0x26b203=_0x165da9<_0x19a46e;let _0x17e194=![];var _0x4cd75c=0x0;var _0x52e09b=0x0;if(_0x26b203){_0x4cd75c=Math['max'](0x1,_0x165da9);_0x52e09b=Math[_0x5f88('0x1d')](_0x19a46e,_0x2b80c9);_0x17e194=_0x429a88>=_0x4cd75c&&_0x429a88<=_0x52e09b;}else{_0x4cd75c=Math[_0x5f88('0x1d')](_0x165da9,_0x2b80c9);_0x52e09b=Math[_0x5f88('0x1e')](0x1,_0x19a46e);_0x17e194=_0x429a88>=_0x4cd75c||_0x429a88<=_0x52e09b;}return _0x17e194;}}module['exports'][_0x5f88('0x1f')]=domCompare;function monthCompare(_0x64f6,_0x318fa6,_0x3a8239){var _0x1f96cb=_0x64f6['locale']('en')[_0x5f88('0x19')]('MMM')[_0x5f88('0xa')]();return circularMonthInterval(_0x318fa6,_0x3a8239)[_0x5f88('0x1b')](_0x1f96cb);}module[_0x5f88('0xe')]['monthCompare']=monthCompare;function iftime(_0x4e5196,_0x51638a=moment['tz']['guess'](),_0x478335=moment()){if(!validateRx[_0x5f88('0x20')](_0x4e5196)){throw new Error(EINVALID_STRING);}else{var _0x2a4791=(moment['isMoment'](_0x478335)?_0x478335[_0x5f88('0x12')]():moment(_0x478335))['tz'](_0x51638a)[_0x5f88('0x8')]('en');throwIfDateNotValid(_0x2a4791);var _0x321f79=_0x4e5196[_0x5f88('0x6')](',');var _0x437723=_0x321f79[0x0];var _0x328ec0=_0x321f79[0x1];var _0x282db7=_0x321f79[0x2];var _0xba693e=_0x321f79[0x3];let _0x3762da=!![];if(_0x437723!=='*'){var _0x3043f7=_0x437723[_0x5f88('0x6')]('-');var _0x7cfe01=_[_0x5f88('0x21')](_0x3043f7[0x0],0x5,'0');var _0xd51da6=_0x3043f7[_0x5f88('0x22')]===0x2?_[_0x5f88('0x21')](_0x3043f7[0x1],0x5,'0'):_0x7cfe01;_0x3762da=timeCompare(_0x2a4791,_0x7cfe01,_0xd51da6);}let _0x303b10=!![];if(_0x328ec0!=='*'){var _0x21c9fe=_0x328ec0[_0x5f88('0x6')]('-');var _0x256d69=_0x21c9fe[0x0];var _0x5b3f55=_0x21c9fe[_0x5f88('0x22')]===0x2?_0x21c9fe[0x1]:_0x256d69;_0x303b10=dowCompare(_0x2a4791,_0x256d69,_0x5b3f55);}let _0x1df8ea=!![];if(_0x282db7!=='*'){var _0x2971b0=_0x282db7[_0x5f88('0x6')]('-');var _0x43a185=parseDom(_0x2971b0[0x0]);var _0x15bd26=_0x2971b0['length']===0x2?parseDom(_0x2971b0[0x1]):_0x43a185;_0x1df8ea=domCompare(_0x2a4791,_0x43a185,_0x15bd26);}let _0x530ebe=!![];if(_0xba693e!=='*'){var _0x464985=_0xba693e['split']('-');var _0x5a359f=_0x464985[0x0];var _0x1862f9=_0x464985[_0x5f88('0x22')]===0x2?_0x464985[0x1]:_0x464985[0x0];_0x530ebe=monthCompare(_0x2a4791,_0x5a359f,_0x1862f9);}return _0x3762da&&_0x303b10&&_0x1df8ea&&_0x530ebe;}}module['exports'][_0x5f88('0x23')]=iftime; \ No newline at end of file +var _0xf999=['max','min','domCompare','monthCompare','guess','test','isMoment','padStart','length','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','isValid','split','map','locale','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','daysInMonth'];(function(_0x5e6404,_0x41dfeb){var _0xde919d=function(_0x1712f0){while(--_0x1712f0){_0x5e6404['push'](_0x5e6404['shift']());}};_0xde919d(++_0x41dfeb);}(_0xf999,0xed));var _0x9f99=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0xf999[_0x187dbd];return _0x45d1e9;};var _=require(_0x9f99('0x0'));var moment=require(_0x9f99('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]['map'](function(_0x28c53c){return _0x28c53c[_0x9f99('0x2')];})[_0x9f99('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x9f99('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x283365){if(!_0x283365[_0x9f99('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x42244b){var _0x3b6171=_0x42244b[_0x9f99('0x6')](':')[_0x9f99('0x7')](function(_0x37e306){return parseInt(_0x37e306,0xa);});var _0x2175b3=_0x3b6171[0x0];var _0x4432d5=_0x3b6171[0x1];if(_0x2175b3<0x0||_0x2175b3>0x17||_0x4432d5<0x0||_0x4432d5>0x3b){throw new Error(EINVALID_DATE);}return[_0x2175b3,_0x4432d5];}function circularDoWInterval(_0xefe5bd,_0x3487d7){if(_0xefe5bd===_0x3487d7){return[_0xefe5bd];}else{var _0x5819f5=moment[_0x9f99('0x8')]();moment[_0x9f99('0x8')]('en');var _0x4bb628=moment['weekdaysShort']()[_0x9f99('0x7')](function(_0x437683){return _0x437683[_0x9f99('0x9')]();});moment[_0x9f99('0x8')](_0x5819f5);var _0x527bdd=_0x4bb628[_0x9f99('0xa')](_0xefe5bd);var _0xfd0574=_0x4bb628[_0x9f99('0xa')](_0x3487d7);if(_0xfd0574>_0x527bdd){return _0x4bb628[_0x9f99('0xb')](_0x527bdd,_0xfd0574+0x1);}else{var _0x1c2cf1=_0x4bb628[_0x9f99('0xb')](0x0,_0xfd0574+0x1);var _0x195d35=_0x4bb628['slice'](_0x527bdd);return _0x195d35['concat'](_0x1c2cf1);}}}module[_0x9f99('0xc')][_0x9f99('0xd')]=circularDoWInterval;function circularMonthInterval(_0x37f5a3,_0x38cac6){if(_0x37f5a3===_0x38cac6){return[_0x37f5a3];}else{var _0x360d70=moment[_0x9f99('0x8')]();moment[_0x9f99('0x8')]('en');var _0x20eb84=moment['monthsShort']()[_0x9f99('0x7')](function(_0x550ce8){return _0x550ce8[_0x9f99('0x9')]();});moment[_0x9f99('0x8')](_0x360d70);var _0x209534=_0x20eb84[_0x9f99('0xa')](_0x37f5a3);var _0x5a2abe=_0x20eb84['indexOf'](_0x38cac6);if(_0x5a2abe>_0x209534){return _0x20eb84[_0x9f99('0xb')](_0x209534,_0x5a2abe+0x1);}else{var _0x48c62c=_0x20eb84[_0x9f99('0xb')](0x0,_0x5a2abe+0x1);var _0x2b37d7=_0x20eb84[_0x9f99('0xb')](_0x209534);return _0x2b37d7[_0x9f99('0xe')](_0x48c62c);}}}module[_0x9f99('0xc')][_0x9f99('0xf')]=circularMonthInterval;function parseDom(_0x2516fb){var _0x5f427a=parseInt(_0x2516fb,0xa);if(_0x5f427a<0x1||_0x5f427a>0x1f){throw new Error(EINVALID_DATE);}return _0x5f427a;}function timeCompare(_0x4a141,_0x1a7243,_0x4726af){var _0x3f49ca=_0x4a141[_0x9f99('0x10')]();var _0xd0b407=extractTime(_0x1a7243);var _0xfd319e=_0xd0b407[0x0];var _0xfdb67d=_0xd0b407[0x1];var _0x298312=_0x4a141[_0x9f99('0x10')]()[_0x9f99('0x11')](_0xfd319e)[_0x9f99('0x12')](_0xfdb67d);throwIfDateNotValid(_0x298312);var _0x249a35=extractTime(_0x4726af);var _0x3811e4=_0x249a35[0x0];var _0x151ace=_0x249a35[0x1];var _0xba3815=_0x4a141[_0x9f99('0x10')]()[_0x9f99('0x11')](_0x3811e4)['minutes'](_0x151ace);throwIfDateNotValid(_0xba3815);if(_0xba3815[_0x9f99('0x13')](_0x298312)){var _0x3ce319=_0x3f49ca[_0x9f99('0x10')]()[_0x9f99('0x14')](_0x9f99('0x15'));var _0x4d1682=_0x3f49ca[_0x9f99('0x10')]()[_0x9f99('0x16')](_0x9f99('0x15'));return _0x3f49ca['isBetween'](_0x298312,_0x4d1682,undefined,'[]')||_0x3f49ca[_0x9f99('0x17')](_0x3ce319,_0xba3815,undefined,'[]');}else{return _0x3f49ca[_0x9f99('0x17')](_0x298312,_0xba3815,undefined,'[]');}}module['exports'][_0x9f99('0x18')]=timeCompare;function dowCompare(_0x1537b3,_0x169a5b,_0x2e95a8){var _0x321570=_0x1537b3[_0x9f99('0x8')]('en')[_0x9f99('0x19')](_0x9f99('0x1a'))[_0x9f99('0x9')]();return circularDoWInterval(_0x169a5b,_0x2e95a8)[_0x9f99('0x1b')](_0x321570);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x1fa270,_0x38bc88,_0x24761c){var _0x29dc29=_0x1fa270['date']();if(_0x38bc88===_0x24761c){return _0x29dc29===_0x38bc88;}else{var _0x36c070=_0x1fa270[_0x9f99('0x1c')]();var _0x4e48a3=_0x38bc88<_0x24761c;let _0x3a1ac2=![];var _0x55a2f2=0x0;var _0x1321df=0x0;if(_0x4e48a3){_0x55a2f2=Math[_0x9f99('0x1d')](0x1,_0x38bc88);_0x1321df=Math['min'](_0x24761c,_0x36c070);_0x3a1ac2=_0x29dc29>=_0x55a2f2&&_0x29dc29<=_0x1321df;}else{_0x55a2f2=Math[_0x9f99('0x1e')](_0x38bc88,_0x36c070);_0x1321df=Math[_0x9f99('0x1d')](0x1,_0x24761c);_0x3a1ac2=_0x29dc29>=_0x55a2f2||_0x29dc29<=_0x1321df;}return _0x3a1ac2;}}module[_0x9f99('0xc')][_0x9f99('0x1f')]=domCompare;function monthCompare(_0x51c04b,_0x10b32a,_0x5a867c){var _0x34716d=_0x51c04b[_0x9f99('0x8')]('en')[_0x9f99('0x19')]('MMM')['toLowerCase']();return circularMonthInterval(_0x10b32a,_0x5a867c)[_0x9f99('0x1b')](_0x34716d);}module[_0x9f99('0xc')][_0x9f99('0x20')]=monthCompare;function iftime(_0x7545f1,_0x33c091=moment['tz'][_0x9f99('0x21')](),_0x384491=moment()){if(!validateRx[_0x9f99('0x22')](_0x7545f1)){throw new Error(EINVALID_STRING);}else{var _0x19066b=(moment[_0x9f99('0x23')](_0x384491)?_0x384491[_0x9f99('0x10')]():moment(_0x384491))['tz'](_0x33c091)[_0x9f99('0x8')]('en');throwIfDateNotValid(_0x19066b);var _0x21aca8=_0x7545f1[_0x9f99('0x6')](',');var _0x5e0f8b=_0x21aca8[0x0];var _0xc9d333=_0x21aca8[0x1];var _0x30184c=_0x21aca8[0x2];var _0x430970=_0x21aca8[0x3];let _0x10307a=!![];if(_0x5e0f8b!=='*'){var _0x305fd2=_0x5e0f8b['split']('-');var _0x4e94fc=_[_0x9f99('0x24')](_0x305fd2[0x0],0x5,'0');var _0xe0419d=_0x305fd2[_0x9f99('0x25')]===0x2?_[_0x9f99('0x24')](_0x305fd2[0x1],0x5,'0'):_0x4e94fc;_0x10307a=timeCompare(_0x19066b,_0x4e94fc,_0xe0419d);}let _0x46f7ac=!![];if(_0xc9d333!=='*'){var _0x4c94f0=_0xc9d333[_0x9f99('0x6')]('-');var _0x243baf=_0x4c94f0[0x0];var _0x213f7e=_0x4c94f0[_0x9f99('0x25')]===0x2?_0x4c94f0[0x1]:_0x243baf;_0x46f7ac=dowCompare(_0x19066b,_0x243baf,_0x213f7e);}let _0x53a7c8=!![];if(_0x30184c!=='*'){var _0x5b45c3=_0x30184c[_0x9f99('0x6')]('-');var _0xb9716a=parseDom(_0x5b45c3[0x0]);var _0xb60c07=_0x5b45c3['length']===0x2?parseDom(_0x5b45c3[0x1]):_0xb9716a;_0x53a7c8=domCompare(_0x19066b,_0xb9716a,_0xb60c07);}let _0x4c898c=!![];if(_0x430970!=='*'){var _0x526624=_0x430970[_0x9f99('0x6')]('-');var _0x2ccf6c=_0x526624[0x0];var _0x2dcdf4=_0x526624['length']===0x2?_0x526624[0x1]:_0x526624[0x0];_0x4c898c=monthCompare(_0x19066b,_0x2ccf6c,_0x2dcdf4);}return _0x10307a&&_0x46f7ac&&_0x53a7c8&&_0x4c898c;}}module[_0x9f99('0xc')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f0b992d..e6ce46e 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x539f=['bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','path','util','moment','../config/environment','debugLevel','toLowerCase','redBG\x20white','white','bold\x20white','bold\x20green','bold\x20blue'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x539f,0x18d));var _0xf539=function(_0x464bb0,_0x28c3d0){_0x464bb0=_0x464bb0-0x0;var _0x2ae2ac=_0x539f[_0x464bb0];return _0x2ae2ac;};'use strict';var path=require(_0xf539('0x0'));var util=require(_0xf539('0x1'));var moment=require(_0xf539('0x2'));var winston=require('winston');var config=require(_0xf539('0x3'));var debugLevel=config[_0xf539('0x4')]?config['debugLevel'][_0xf539('0x5')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xf539('0x6'),'error':'red','warn':'bold\x20yellow','info':_0xf539('0x7'),'print':_0xf539('0x8'),'success':_0xf539('0x9'),'http':'gray','verbose':'bold\x20magenta','debug':_0xf539('0xa'),'silly':_0xf539('0xb')};winston[_0xf539('0xc')](XC_LOG_COLORS);function getLogFileName(_0x502080,_0x5104e5,_0xcbdce0){var _0x565985=_0x502080||_0xf539('0xd');return path['join'](_0x565985,util[_0xf539('0xe')](_0xf539('0xf'),_0x5104e5,_0xcbdce0));}function formatter(_0x360e3e,_0x294dde){_0x294dde[_0xf539('0x10')]=_0x294dde[_0xf539('0x10')][_0xf539('0x11')](/@@{/g,_0xf539('0x12'))[_0xf539('0x11')](/}@@/g,'}}}')[_0xf539('0x11')](/@{/g,'{{')[_0xf539('0x11')](/}@/g,'}}');return util[_0xf539('0xe')](_0xf539('0x13'),moment()[_0xf539('0xe')](_0xf539('0x14')),_0x294dde[_0xf539('0x15')][_0xf539('0x16')](),_0x360e3e,_0x294dde[_0xf539('0x10')]);}function fileFormat(_0x1bb537,_0x5097c4){_0x5097c4['message']=_0x5097c4['message']['replace'](/@@{/g,_0xf539('0x12'))[_0xf539('0x11')](/}@@/g,_0xf539('0x17'))[_0xf539('0x11')](/@{/g,'{{')[_0xf539('0x11')](/}@/g,'}}');var _0x3f4720=_0x5097c4['meta']&&Object[_0xf539('0x18')](_0x5097c4['meta'])[_0xf539('0x19')]?'\x0a\x09'+JSON['stringify'](_0x5097c4['meta']):'';return util[_0xf539('0xe')](_0xf539('0x1a'),moment()[_0xf539('0xe')](_0xf539('0x14')),_0x5097c4[_0xf539('0x15')][_0xf539('0x16')](),_0x1bb537,_0x5097c4['message'],_0x3f4720);}function consoleLogger(){var _0x638532=new winston[(_0xf539('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf539('0x1c'))][(_0xf539('0x1d'))]({'level':_0xf539('0x1e'),'json':![],'formatter':function(_0x287a64){return formatter('',_0x287a64);}})]});return _0x638532;}function fileLogger(_0x39ea9b,_0x100a50){var _0x4641ac=new winston[(_0xf539('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf539('0x1c'))][(_0xf539('0x1f'))]({'name':util[_0xf539('0xe')](_0xf539('0x20'),_0x39ea9b,_0xf539('0x21')),'filename':getLogFileName(_0x100a50,_0x39ea9b,_0xf539('0x21')),'level':_0xf539('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26e709){return fileFormat(_0x39ea9b,_0x26e709);}}),new winston[(_0xf539('0x1c'))][(_0xf539('0x1f'))]({'name':util[_0xf539('0xe')](_0xf539('0x20'),_0x39ea9b,debugLevel),'filename':getLogFileName(_0x100a50,_0x39ea9b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x33aba6){return fileFormat(_0x39ea9b,_0x33aba6);}}),new winston[(_0xf539('0x1c'))]['Console']({'level':_0xf539('0x1e'),'json':![],'formatter':function(_0x2f7966){return fileFormat(_0x39ea9b,_0x2f7966);}})]});return _0x4641ac;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0xd80c=['}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','File','%s-%s','error','consoleLogger','path','util','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','join','%s-%s.log','message','replace','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xd80c,0x19a));var _0xcd80=function(_0x4a8475,_0x4dc586){_0x4a8475=_0x4a8475-0x0;var _0x2576ba=_0xd80c[_0x4a8475];return _0x2576ba;};'use strict';var path=require(_0xcd80('0x0'));var util=require(_0xcd80('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0xcd80('0x2'));var debugLevel=config[_0xcd80('0x3')]?config[_0xcd80('0x3')]['toLowerCase']():_0xcd80('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':_0xcd80('0x5'),'error':_0xcd80('0x6'),'warn':_0xcd80('0x7'),'info':_0xcd80('0x8'),'print':_0xcd80('0x9'),'success':'bold\x20green','http':_0xcd80('0xa'),'verbose':_0xcd80('0xb'),'debug':_0xcd80('0xc'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x41e0a2,_0x5948ab,_0x59cb5c){var _0x157d8b=_0x41e0a2||'/var/log/xcally';return path[_0xcd80('0xd')](_0x157d8b,util['format'](_0xcd80('0xe'),_0x5948ab,_0x59cb5c));}function formatter(_0x54f201,_0x5243c9){_0x5243c9[_0xcd80('0xf')]=_0x5243c9[_0xcd80('0xf')][_0xcd80('0x10')](/@@{/g,'{{{')[_0xcd80('0x10')](/}@@/g,'}}}')[_0xcd80('0x10')](/@{/g,'{{')[_0xcd80('0x10')](/}@/g,'}}');return util[_0xcd80('0x11')](_0xcd80('0x12'),moment()[_0xcd80('0x11')](_0xcd80('0x13')),_0x5243c9[_0xcd80('0x14')]['toUpperCase'](),_0x54f201,_0x5243c9[_0xcd80('0xf')]);}function fileFormat(_0x2ad809,_0xb5655e){_0xb5655e[_0xcd80('0xf')]=_0xb5655e['message'][_0xcd80('0x10')](/@@{/g,_0xcd80('0x15'))['replace'](/}@@/g,_0xcd80('0x16'))[_0xcd80('0x10')](/@{/g,'{{')[_0xcd80('0x10')](/}@/g,'}}');var _0x488adc=_0xb5655e[_0xcd80('0x17')]&&Object[_0xcd80('0x18')](_0xb5655e['meta'])[_0xcd80('0x19')]?'\x0a\x09'+JSON[_0xcd80('0x1a')](_0xb5655e[_0xcd80('0x17')]):'';return util['format'](_0xcd80('0x1b'),moment()[_0xcd80('0x11')](_0xcd80('0x13')),_0xb5655e[_0xcd80('0x14')][_0xcd80('0x1c')](),_0x2ad809,_0xb5655e[_0xcd80('0xf')],_0x488adc);}function consoleLogger(){var _0x4d064b=new winston[(_0xcd80('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xcd80('0x1e'))][(_0xcd80('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x5138b7){return formatter('',_0x5138b7);}})]});return _0x4d064b;}function fileLogger(_0x58f991,_0x5011d6){var _0x422cf1=new winston[(_0xcd80('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xcd80('0x1e'))][(_0xcd80('0x20'))]({'name':util[_0xcd80('0x11')](_0xcd80('0x21'),_0x58f991,'error'),'filename':getLogFileName(_0x5011d6,_0x58f991,_0xcd80('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x521980){return fileFormat(_0x58f991,_0x521980);}}),new winston[(_0xcd80('0x1e'))][(_0xcd80('0x20'))]({'name':util[_0xcd80('0x11')](_0xcd80('0x21'),_0x58f991,debugLevel),'filename':getLogFileName(_0x5011d6,_0x58f991,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5da29f){return fileFormat(_0x58f991,_0x5da29f);}}),new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0xa51d65){return fileFormat(_0x58f991,_0xa51d65);}})]});return _0x422cf1;}exports[_0xcd80('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 56ba2b9..9864a44 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x1a85,0x178));var _0x51a8=function(_0x24bbd5,_0x34a7c4){_0x24bbd5=_0x24bbd5-0x0;var _0x8fb737=_0x1a85[_0x24bbd5];return _0x8fb737;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x1a352b,_0x3263db){_0x1a352b=_0x1a352b-0x0;var _0x5128f9=_0x7a54[_0x1a352b];return _0x5128f9;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 52aa2d3..c4c1655 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 _0xa571=['reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string','map','isPlainObject','keys'];(function(_0x3f91f7,_0xccc359){var _0x4962f2=function(_0x44a981){while(--_0x44a981){_0x3f91f7['push'](_0x3f91f7['shift']());}};_0x4962f2(++_0xccc359);}(_0xa571,0x107));var _0x1a57=function(_0x6840b2,_0x38f17f){_0x6840b2=_0x6840b2-0x0;var _0x5c0e64=_0xa571[_0x6840b2];return _0x5c0e64;};var _=require(_0x1a57('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x289e99){return _0x289e99==='{{'?_0x1a57('0x1'):_0x1a57('0x2');}function safeTemplate(_0x48485e){var _0x1a071f=_0x48485e;if(typeof _0x48485e===_0x1a57('0x3')){_0x1a071f=_0x48485e['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x48485e)){_0x1a071f=_0x48485e[_0x1a57('0x4')](function(_0x5067fa){return safeTemplate(_0x5067fa);});}else if(_[_0x1a57('0x5')](_0x48485e)){_0x1a071f=Object[_0x1a57('0x6')](_0x48485e)[_0x1a57('0x7')](function(_0x3c5352,_0x2492f5){_0x3c5352[_0x2492f5]=safeTemplate(_0x48485e[_0x2492f5]);return _0x3c5352;},{});}return _0x1a071f;}module[_0x1a57('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x8603=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','exports'];(function(_0x1c59a4,_0x1fae56){var _0x2d54ba=function(_0x4d8faf){while(--_0x4d8faf){_0x1c59a4['push'](_0x1c59a4['shift']());}};_0x2d54ba(++_0x1fae56);}(_0x8603,0x190));var _0x3860=function(_0x2496da,_0x3fe1fc){_0x2496da=_0x2496da-0x0;var _0x4caae0=_0x8603[_0x2496da];return _0x4caae0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2f848f){return _0x2f848f==='{{'?_0x3860('0x0'):_0x3860('0x1');}function safeTemplate(_0x51bfda){var _0x4961d6=_0x51bfda;if(typeof _0x51bfda===_0x3860('0x2')){_0x4961d6=_0x51bfda[_0x3860('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3860('0x4')](_0x51bfda)){_0x4961d6=_0x51bfda['map'](function(_0x2fc97a){return safeTemplate(_0x2fc97a);});}else if(_['isPlainObject'](_0x51bfda)){_0x4961d6=Object[_0x3860('0x5')](_0x51bfda)[_0x3860('0x6')](function(_0x1eca44,_0xd3ce26){_0x1eca44[_0xd3ce26]=safeTemplate(_0x51bfda[_0xd3ce26]);return _0x1eca44;},{});}return _0x4961d6;}module[_0x3860('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index ce9412a..af1753b 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 _0xf233=['../config/environment','resolve','server/app.json','legacy-libs','apps','findIndex','name','env','NODE_PATH','string','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra'];(function(_0x4738b7,_0x9096f0){var _0x47cb9e=function(_0x45ee49){while(--_0x45ee49){_0x4738b7['push'](_0x4738b7['shift']());}};_0x47cb9e(++_0x9096f0);}(_0xf233,0x97));var _0x3f23=function(_0x1ef0cd,_0x5735df){_0x1ef0cd=_0x1ef0cd-0x0;var _0x2542ab=_0xf233[_0x1ef0cd];return _0x2542ab;};var fs=require(_0x3f23('0x0'));var path=require('path');var config=require(_0x3f23('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0x3f23('0x2')](root,_0x3f23('0x3'));var NODEPATH=path[_0x3f23('0x2')](root,_0x3f23('0x4'));function setLegacyLibsNodeEnvPath(_0x589098){let _0x98e171=![];if(Array['isArray'](_0x589098[_0x3f23('0x5')])){var _0x40c721=_0x589098[_0x3f23('0x5')][_0x3f23('0x6')](function(_0x181f68){return _0x181f68[_0x3f23('0x7')]==='motion2';});if(_0x40c721>-0x1){var _0x1b901e=_0x589098['apps'][_0x40c721];if(typeof _0x1b901e[_0x3f23('0x8')][_0x3f23('0x9')]!==_0x3f23('0xa')){_0x1b901e[_0x3f23('0x8')][_0x3f23('0x9')]=NODEPATH;_0x98e171=!![];}}return{'appConfig':_0x589098,'updated':_0x98e171};}}function updateAppConfig(_0x28d983){return fs[_0x3f23('0xb')](APP_JSON_PATH)[_0x3f23('0xc')](function(_0x2c973e){if(_0x2c973e){return fs[_0x3f23('0xd')](APP_JSON_PATH)['then'](function(_0xf567be){var _0x3e28fa=setLegacyLibsNodeEnvPath(_0xf567be);if(_0x3e28fa[_0x3f23('0xe')]){_0x28d983[_0x3f23('0xf')](_0x3f23('0x10'));return fs[_0x3f23('0x11')](APP_JSON_PATH,_0xf567be,{'spaces':0x2});}else{return Promise[_0x3f23('0x2')]();}});}else{return Promise[_0x3f23('0x2')]();}});}module[_0x3f23('0x12')]=updateAppConfig; \ No newline at end of file +var _0x9d38=['readJSON','updated','info','Updating\x20app.json','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','env','string','NODE_PATH','pathExists','then'];(function(_0x533f7b,_0x4f832c){var _0x1fecc1=function(_0x2f2845){while(--_0x2f2845){_0x533f7b['push'](_0x533f7b['shift']());}};_0x1fecc1(++_0x4f832c);}(_0x9d38,0x17e));var _0x89d3=function(_0x5b6e5d,_0x245c62){_0x5b6e5d=_0x5b6e5d-0x0;var _0x269048=_0x9d38[_0x5b6e5d];return _0x269048;};var fs=require(_0x89d3('0x0'));var path=require(_0x89d3('0x1'));var config=require(_0x89d3('0x2'));var root=config[_0x89d3('0x3')];var APP_JSON_PATH=path[_0x89d3('0x4')](root,_0x89d3('0x5'));var NODEPATH=path[_0x89d3('0x4')](root,_0x89d3('0x6'));function setLegacyLibsNodeEnvPath(_0x470be3){let _0x5a69eb=![];if(Array[_0x89d3('0x7')](_0x470be3[_0x89d3('0x8')])){var _0x2f2941=_0x470be3[_0x89d3('0x8')][_0x89d3('0x9')](function(_0x6d44f3){return _0x6d44f3[_0x89d3('0xa')]===_0x89d3('0xb');});if(_0x2f2941>-0x1){var _0x5efbdc=_0x470be3[_0x89d3('0x8')][_0x2f2941];if(typeof _0x5efbdc[_0x89d3('0xc')]['NODE_PATH']!==_0x89d3('0xd')){_0x5efbdc[_0x89d3('0xc')][_0x89d3('0xe')]=NODEPATH;_0x5a69eb=!![];}}return{'appConfig':_0x470be3,'updated':_0x5a69eb};}}function updateAppConfig(_0x5b8284){return fs[_0x89d3('0xf')](APP_JSON_PATH)[_0x89d3('0x10')](function(_0x4637ad){if(_0x4637ad){return fs[_0x89d3('0x11')](APP_JSON_PATH)[_0x89d3('0x10')](function(_0x4a3383){var _0x479e16=setLegacyLibsNodeEnvPath(_0x4a3383);if(_0x479e16[_0x89d3('0x12')]){_0x5b8284[_0x89d3('0x13')](_0x89d3('0x14'));return fs['writeJSON'](APP_JSON_PATH,_0x4a3383,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x89d3('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file